import {createRequire as __cjsCompatRequire} from 'module'; const require = __cjsCompatRequire(import.meta.url); var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { get: (a, b) => (typeof require !== "undefined" ? require : a)[b] }) : x)(function(x) { if (typeof require !== "undefined") return require.apply(this, arguments); throw Error('Dynamic require of "' + x + '" is not supported'); }); var __commonJS = (cb, mod) => function __require3() { return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod )); // var require_tunnel = __commonJS({ ""(exports) { "use strict"; var net = __require("net"); var tls = __require("tls"); var http = __require("http"); var https = __require("https"); var events = __require("events"); var assert2 = __require("assert"); var util = __require("util"); exports.httpOverHttp = httpOverHttp2; exports.httpsOverHttp = httpsOverHttp2; exports.httpOverHttps = httpOverHttps2; exports.httpsOverHttps = httpsOverHttps2; function httpOverHttp2(options) { var agent = new TunnelingAgent(options); agent.request = http.request; return agent; } function httpsOverHttp2(options) { var agent = new TunnelingAgent(options); agent.request = http.request; agent.createSocket = createSecureSocket; agent.defaultPort = 443; return agent; } function httpOverHttps2(options) { var agent = new TunnelingAgent(options); agent.request = https.request; return agent; } function httpsOverHttps2(options) { var agent = new TunnelingAgent(options); agent.request = https.request; agent.createSocket = createSecureSocket; agent.defaultPort = 443; return agent; } function TunnelingAgent(options) { var self2 = this; self2.options = options || {}; self2.proxyOptions = self2.options.proxy || {}; self2.maxSockets = self2.options.maxSockets || http.Agent.defaultMaxSockets; self2.requests = []; self2.sockets = []; self2.on("free", function onFree(socket, host, port, localAddress) { var options2 = toOptions(host, port, localAddress); for (var i = 0, len = self2.requests.length; i < len; ++i) { var pending = self2.requests[i]; if (pending.host === options2.host && pending.port === options2.port) { self2.requests.splice(i, 1); pending.request.onSocket(socket); return; } } socket.destroy(); self2.removeSocket(socket); }); } util.inherits(TunnelingAgent, events.EventEmitter); TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) { var self2 = this; var options = mergeOptions({ request: req }, self2.options, toOptions(host, port, localAddress)); if (self2.sockets.length >= this.maxSockets) { self2.requests.push(options); return; } self2.createSocket(options, function(socket) { socket.on("free", onFree); socket.on("close", onCloseOrRemove); socket.on("agentRemove", onCloseOrRemove); req.onSocket(socket); function onFree() { self2.emit("free", socket, options); } function onCloseOrRemove(err) { self2.removeSocket(socket); socket.removeListener("free", onFree); socket.removeListener("close", onCloseOrRemove); socket.removeListener("agentRemove", onCloseOrRemove); } }); }; TunnelingAgent.prototype.createSocket = function createSocket(options, cb) { var self2 = this; var placeholder = {}; self2.sockets.push(placeholder); var connectOptions = mergeOptions({}, self2.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"); } debug2("making CONNECT request"); var connectReq = self2.request(connectOptions); connectReq.useChunkedEncodingByDefault = false; connectReq.once("response", onResponse); connectReq.once("upgrade", onUpgrade); connectReq.once("connect", onConnect); connectReq.once("error", onError); connectReq.end(); function onResponse(res) { res.upgrade = true; } function onUpgrade(res, socket, head) { process.nextTick(function() { onConnect(res, socket, head); }); } function onConnect(res, socket, head) { connectReq.removeAllListeners(); socket.removeAllListeners(); if (res.statusCode !== 200) { debug2( "tunneling socket could not be established, statusCode=%d", res.statusCode ); socket.destroy(); var error2 = new Error("tunneling socket could not be established, statusCode=" + res.statusCode); error2.code = "ECONNRESET"; options.request.emit("error", error2); self2.removeSocket(placeholder); return; } if (head.length > 0) { debug2("got illegal response body from proxy"); socket.destroy(); var error2 = new Error("got illegal response body from proxy"); error2.code = "ECONNRESET"; options.request.emit("error", error2); self2.removeSocket(placeholder); return; } debug2("tunneling connection has established"); self2.sockets[self2.sockets.indexOf(placeholder)] = socket; return cb(socket); } function onError(cause) { connectReq.removeAllListeners(); debug2( "tunneling socket could not be established, cause=%s\n", cause.message, cause.stack ); var error2 = new Error("tunneling socket could not be established, cause=" + cause.message); error2.code = "ECONNRESET"; options.request.emit("error", error2); self2.removeSocket(placeholder); } }; TunnelingAgent.prototype.removeSocket = function removeSocket(socket) { var pos = this.sockets.indexOf(socket); if (pos === -1) { return; } this.sockets.splice(pos, 1); var pending = this.requests.shift(); if (pending) { this.createSocket(pending, function(socket2) { pending.request.onSocket(socket2); }); } }; function createSecureSocket(options, cb) { var self2 = this; TunnelingAgent.prototype.createSocket.call(self2, options, function(socket) { var hostHeader = options.request.getHeader("host"); var tlsOptions = mergeOptions({}, self2.options, { socket, servername: hostHeader ? hostHeader.replace(/:.*$/, "") : options.host }); var secureSocket = tls.connect(0, tlsOptions); self2.sockets[self2.sockets.indexOf(socket)] = secureSocket; cb(secureSocket); }); } function toOptions(host, port, localAddress) { if (typeof host === "string") { return { host, port, localAddress }; } return 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] !== void 0) { target[k] = overrides[k]; } } } } return target; } var debug2; if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) { debug2 = 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 { debug2 = function() { }; } exports.debug = debug2; } }); // var require_tunnel2 = __commonJS({ ""(exports, module) { module.exports = require_tunnel(); } }); // var require_proxy = __commonJS({ ""(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getProxyUrl = getProxyUrl2; exports.checkBypass = checkBypass; function getProxyUrl2(reqUrl) { const usingSsl = reqUrl.protocol === "https:"; if (checkBypass(reqUrl)) { return void 0; } const proxyVar = (() => { if (usingSsl) { return process.env["https_proxy"] || process.env["HTTPS_PROXY"]; } else { return process.env["http_proxy"] || process.env["HTTP_PROXY"]; } })(); if (proxyVar) { try { return new DecodedURL(proxyVar); } catch (_a2) { if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) return new DecodedURL(`http://${proxyVar}`); } } else { return void 0; } } function checkBypass(reqUrl) { if (!reqUrl.hostname) { return false; } const reqHost = reqUrl.hostname; if (isLoopbackAddress(reqHost)) { return true; } const noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || ""; if (!noProxy) { return false; } let reqPort; if (reqUrl.port) { reqPort = Number(reqUrl.port); } else if (reqUrl.protocol === "http:") { reqPort = 80; } else if (reqUrl.protocol === "https:") { reqPort = 443; } const upperReqHosts = [reqUrl.hostname.toUpperCase()]; if (typeof reqPort === "number") { upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); } for (const upperNoProxyItem of noProxy.split(",").map((x) => x.trim().toUpperCase()).filter((x) => x)) { if (upperNoProxyItem === "*" || upperReqHosts.some((x) => x === upperNoProxyItem || x.endsWith(`.${upperNoProxyItem}`) || upperNoProxyItem.startsWith(".") && x.endsWith(`${upperNoProxyItem}`))) { return true; } } return false; } function isLoopbackAddress(host) { const hostLower = host.toLowerCase(); return hostLower === "localhost" || hostLower.startsWith("127.") || hostLower.startsWith("[::1]") || hostLower.startsWith("[0:0:0:0:0:0:0:1]"); } var DecodedURL = class extends URL { constructor(url, base) { super(url, base); this._decodedUsername = decodeURIComponent(super.username); this._decodedPassword = decodeURIComponent(super.password); } get username() { return this._decodedUsername; } get password() { return this._decodedPassword; } }; } }); // var require_lib = __commonJS({ ""(exports) { "use strict"; var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { if (k2 === void 0) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); } : function(o, m, k, k2) { if (k2 === void 0) k2 = k; o[k2] = m[k]; }); var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); } : function(o, v) { o["default"] = v; }); var __importStar = exports && exports.__importStar || /* @__PURE__ */ function() { var ownKeys = function(o) { ownKeys = Object.getOwnPropertyNames || function(o2) { var ar = []; for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k; return ar; }; return ownKeys(o); }; return function(mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) { for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); } __setModuleDefault(result, mod); return result; }; }(); var __awaiter3 = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve5) { resolve5(value); }); } return new (P || (P = Promise))(function(resolve5, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.HttpClient = exports.HttpClientResponse = exports.HttpClientError = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0; exports.getProxyUrl = getProxyUrl2; exports.isHttps = isHttps; var http = __importStar(__require("http")); var https = __importStar(__require("https")); var pm = __importStar(require_proxy()); var tunnel2 = __importStar(require_tunnel2()); var undici_1 = __require("undici"); var HttpCodes2; (function(HttpCodes3) { HttpCodes3[HttpCodes3["OK"] = 200] = "OK"; HttpCodes3[HttpCodes3["MultipleChoices"] = 300] = "MultipleChoices"; HttpCodes3[HttpCodes3["MovedPermanently"] = 301] = "MovedPermanently"; HttpCodes3[HttpCodes3["ResourceMoved"] = 302] = "ResourceMoved"; HttpCodes3[HttpCodes3["SeeOther"] = 303] = "SeeOther"; HttpCodes3[HttpCodes3["NotModified"] = 304] = "NotModified"; HttpCodes3[HttpCodes3["UseProxy"] = 305] = "UseProxy"; HttpCodes3[HttpCodes3["SwitchProxy"] = 306] = "SwitchProxy"; HttpCodes3[HttpCodes3["TemporaryRedirect"] = 307] = "TemporaryRedirect"; HttpCodes3[HttpCodes3["PermanentRedirect"] = 308] = "PermanentRedirect"; HttpCodes3[HttpCodes3["BadRequest"] = 400] = "BadRequest"; HttpCodes3[HttpCodes3["Unauthorized"] = 401] = "Unauthorized"; HttpCodes3[HttpCodes3["PaymentRequired"] = 402] = "PaymentRequired"; HttpCodes3[HttpCodes3["Forbidden"] = 403] = "Forbidden"; HttpCodes3[HttpCodes3["NotFound"] = 404] = "NotFound"; HttpCodes3[HttpCodes3["MethodNotAllowed"] = 405] = "MethodNotAllowed"; HttpCodes3[HttpCodes3["NotAcceptable"] = 406] = "NotAcceptable"; HttpCodes3[HttpCodes3["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired"; HttpCodes3[HttpCodes3["RequestTimeout"] = 408] = "RequestTimeout"; HttpCodes3[HttpCodes3["Conflict"] = 409] = "Conflict"; HttpCodes3[HttpCodes3["Gone"] = 410] = "Gone"; HttpCodes3[HttpCodes3["TooManyRequests"] = 429] = "TooManyRequests"; HttpCodes3[HttpCodes3["InternalServerError"] = 500] = "InternalServerError"; HttpCodes3[HttpCodes3["NotImplemented"] = 501] = "NotImplemented"; HttpCodes3[HttpCodes3["BadGateway"] = 502] = "BadGateway"; HttpCodes3[HttpCodes3["ServiceUnavailable"] = 503] = "ServiceUnavailable"; HttpCodes3[HttpCodes3["GatewayTimeout"] = 504] = "GatewayTimeout"; })(HttpCodes2 || (exports.HttpCodes = HttpCodes2 = {})); var Headers2; (function(Headers3) { Headers3["Accept"] = "accept"; Headers3["ContentType"] = "content-type"; })(Headers2 || (exports.Headers = Headers2 = {})); var MediaTypes2; (function(MediaTypes3) { MediaTypes3["ApplicationJson"] = "application/json"; })(MediaTypes2 || (exports.MediaTypes = MediaTypes2 = {})); function getProxyUrl2(serverUrl) { const proxyUrl = pm.getProxyUrl(new URL(serverUrl)); return proxyUrl ? proxyUrl.href : ""; } var HttpRedirectCodes2 = [ HttpCodes2.MovedPermanently, HttpCodes2.ResourceMoved, HttpCodes2.SeeOther, HttpCodes2.TemporaryRedirect, HttpCodes2.PermanentRedirect ]; var HttpResponseRetryCodes2 = [ HttpCodes2.BadGateway, HttpCodes2.ServiceUnavailable, HttpCodes2.GatewayTimeout ]; var RetryableHttpVerbs = ["OPTIONS", "GET", "DELETE", "HEAD"]; var ExponentialBackoffCeiling = 10; var ExponentialBackoffTimeSlice = 5; var HttpClientError = class _HttpClientError extends Error { constructor(message, statusCode) { super(message); this.name = "HttpClientError"; this.statusCode = statusCode; Object.setPrototypeOf(this, _HttpClientError.prototype); } }; exports.HttpClientError = HttpClientError; var HttpClientResponse = class { constructor(message) { this.message = message; } readBody() { return __awaiter3(this, void 0, void 0, function* () { return new Promise((resolve5) => __awaiter3(this, void 0, void 0, function* () { let output = Buffer.alloc(0); this.message.on("data", (chunk) => { output = Buffer.concat([output, chunk]); }); this.message.on("end", () => { resolve5(output.toString()); }); })); }); } readBodyBuffer() { return __awaiter3(this, void 0, void 0, function* () { return new Promise((resolve5) => __awaiter3(this, void 0, void 0, function* () { const chunks = []; this.message.on("data", (chunk) => { chunks.push(chunk); }); this.message.on("end", () => { resolve5(Buffer.concat(chunks)); }); })); }); } }; exports.HttpClientResponse = HttpClientResponse; function isHttps(requestUrl) { const parsedUrl = new URL(requestUrl); return parsedUrl.protocol === "https:"; } var HttpClient3 = class { constructor(userAgent3, handlers, requestOptions) { this._ignoreSslError = false; this._allowRedirects = true; this._allowRedirectDowngrade = false; this._maxRedirects = 50; this._allowRetries = false; this._maxRetries = 1; this._keepAlive = false; this._disposed = false; this.userAgent = this._getUserAgentWithOrchestrationId(userAgent3); this.handlers = handlers || []; this.requestOptions = requestOptions; if (requestOptions) { if (requestOptions.ignoreSslError != null) { this._ignoreSslError = requestOptions.ignoreSslError; } this._socketTimeout = requestOptions.socketTimeout; if (requestOptions.allowRedirects != null) { this._allowRedirects = requestOptions.allowRedirects; } if (requestOptions.allowRedirectDowngrade != null) { this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade; } if (requestOptions.maxRedirects != null) { this._maxRedirects = Math.max(requestOptions.maxRedirects, 0); } if (requestOptions.keepAlive != null) { this._keepAlive = requestOptions.keepAlive; } if (requestOptions.allowRetries != null) { this._allowRetries = requestOptions.allowRetries; } if (requestOptions.maxRetries != null) { this._maxRetries = requestOptions.maxRetries; } } } options(requestUrl, additionalHeaders) { return __awaiter3(this, void 0, void 0, function* () { return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); }); } get(requestUrl, additionalHeaders) { return __awaiter3(this, void 0, void 0, function* () { return this.request("GET", requestUrl, null, additionalHeaders || {}); }); } del(requestUrl, additionalHeaders) { return __awaiter3(this, void 0, void 0, function* () { return this.request("DELETE", requestUrl, null, additionalHeaders || {}); }); } post(requestUrl, data, additionalHeaders) { return __awaiter3(this, void 0, void 0, function* () { return this.request("POST", requestUrl, data, additionalHeaders || {}); }); } patch(requestUrl, data, additionalHeaders) { return __awaiter3(this, void 0, void 0, function* () { return this.request("PATCH", requestUrl, data, additionalHeaders || {}); }); } put(requestUrl, data, additionalHeaders) { return __awaiter3(this, void 0, void 0, function* () { return this.request("PUT", requestUrl, data, additionalHeaders || {}); }); } head(requestUrl, additionalHeaders) { return __awaiter3(this, void 0, void 0, function* () { return this.request("HEAD", requestUrl, null, additionalHeaders || {}); }); } sendStream(verb, requestUrl, stream, additionalHeaders) { return __awaiter3(this, void 0, void 0, function* () { return this.request(verb, requestUrl, stream, additionalHeaders); }); } /** * Gets a typed object from an endpoint * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise */ getJson(requestUrl_1) { return __awaiter3(this, arguments, void 0, function* (requestUrl, additionalHeaders = {}) { additionalHeaders[Headers2.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers2.Accept, MediaTypes2.ApplicationJson); const res = yield this.get(requestUrl, additionalHeaders); return this._processResponse(res, this.requestOptions); }); } postJson(requestUrl_1, obj_1) { return __awaiter3(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) { const data = JSON.stringify(obj, null, 2); additionalHeaders[Headers2.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers2.Accept, MediaTypes2.ApplicationJson); additionalHeaders[Headers2.ContentType] = this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes2.ApplicationJson); const res = yield this.post(requestUrl, data, additionalHeaders); return this._processResponse(res, this.requestOptions); }); } putJson(requestUrl_1, obj_1) { return __awaiter3(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) { const data = JSON.stringify(obj, null, 2); additionalHeaders[Headers2.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers2.Accept, MediaTypes2.ApplicationJson); additionalHeaders[Headers2.ContentType] = this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes2.ApplicationJson); const res = yield this.put(requestUrl, data, additionalHeaders); return this._processResponse(res, this.requestOptions); }); } patchJson(requestUrl_1, obj_1) { return __awaiter3(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) { const data = JSON.stringify(obj, null, 2); additionalHeaders[Headers2.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers2.Accept, MediaTypes2.ApplicationJson); additionalHeaders[Headers2.ContentType] = this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes2.ApplicationJson); const res = yield this.patch(requestUrl, data, additionalHeaders); return this._processResponse(res, this.requestOptions); }); } /** * Makes a raw http request. * All other methods such as get, post, patch, and request ultimately call this. * Prefer get, del, post and patch */ request(verb, requestUrl, data, headers) { return __awaiter3(this, void 0, void 0, function* () { if (this._disposed) { throw new Error("Client has already been disposed."); } const parsedUrl = new URL(requestUrl); let info = this._prepareRequest(verb, parsedUrl, headers); const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb) ? this._maxRetries + 1 : 1; let numTries = 0; let response; do { response = yield this.requestRaw(info, data); if (response && response.message && response.message.statusCode === HttpCodes2.Unauthorized) { let authenticationHandler; for (const handler3 of this.handlers) { if (handler3.canHandleAuthentication(response)) { authenticationHandler = handler3; break; } } if (authenticationHandler) { return authenticationHandler.handleAuthentication(this, info, data); } else { return response; } } let redirectsRemaining = this._maxRedirects; while (response.message.statusCode && HttpRedirectCodes2.includes(response.message.statusCode) && this._allowRedirects && redirectsRemaining > 0) { const redirectUrl = response.message.headers["location"]; if (!redirectUrl) { break; } const parsedRedirectUrl = new URL(redirectUrl); if (parsedUrl.protocol === "https:" && parsedUrl.protocol !== parsedRedirectUrl.protocol && !this._allowRedirectDowngrade) { throw new Error("Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true."); } yield response.readBody(); if (parsedRedirectUrl.hostname !== parsedUrl.hostname) { for (const header in headers) { if (header.toLowerCase() === "authorization") { delete headers[header]; } } } info = this._prepareRequest(verb, parsedRedirectUrl, headers); response = yield this.requestRaw(info, data); redirectsRemaining--; } if (!response.message.statusCode || !HttpResponseRetryCodes2.includes(response.message.statusCode)) { return response; } numTries += 1; if (numTries < maxTries) { yield response.readBody(); yield this._performExponentialBackoff(numTries); } } while (numTries < maxTries); return response; }); } /** * Needs to be called if keepAlive is set to true in request options. */ dispose() { if (this._agent) { this._agent.destroy(); } this._disposed = true; } /** * Raw request. * @param info * @param data */ requestRaw(info, data) { return __awaiter3(this, void 0, void 0, function* () { return new Promise((resolve5, reject) => { function callbackForResult(err, res) { if (err) { reject(err); } else if (!res) { reject(new Error("Unknown error")); } else { resolve5(res); } } this.requestRawWithCallback(info, data, callbackForResult); }); }); } /** * Raw request with callback. * @param info * @param data * @param onResult */ requestRawWithCallback(info, data, onResult) { if (typeof data === "string") { if (!info.options.headers) { info.options.headers = {}; } info.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); } let callbackCalled = false; function handleResult(err, res) { if (!callbackCalled) { callbackCalled = true; onResult(err, res); } } const req = info.httpModule.request(info.options, (msg) => { const res = new HttpClientResponse(msg); handleResult(void 0, res); }); let socket; req.on("socket", (sock) => { socket = sock; }); req.setTimeout(this._socketTimeout || 3 * 6e4, () => { if (socket) { socket.end(); } handleResult(new Error(`Request timeout: ${info.options.path}`)); }); req.on("error", function(err) { handleResult(err); }); if (data && typeof data === "string") { req.write(data, "utf8"); } if (data && typeof data !== "string") { data.on("close", function() { req.end(); }); data.pipe(req); } else { req.end(); } } /** * Gets an http agent. This function is useful when you need an http agent that handles * routing through a proxy server - depending upon the url and proxy environment variables. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com */ getAgent(serverUrl) { const parsedUrl = new URL(serverUrl); return this._getAgent(parsedUrl); } getAgentDispatcher(serverUrl) { const parsedUrl = new URL(serverUrl); const proxyUrl = pm.getProxyUrl(parsedUrl); const useProxy = proxyUrl && proxyUrl.hostname; if (!useProxy) { return; } return this._getProxyAgentDispatcher(parsedUrl, proxyUrl); } _prepareRequest(method, requestUrl, headers) { const info = {}; info.parsedUrl = requestUrl; const usingSsl = info.parsedUrl.protocol === "https:"; info.httpModule = usingSsl ? https : http; const defaultPort = usingSsl ? 443 : 80; info.options = {}; info.options.host = info.parsedUrl.hostname; info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort; info.options.path = (info.parsedUrl.pathname || "") + (info.parsedUrl.search || ""); info.options.method = method; info.options.headers = this._mergeHeaders(headers); if (this.userAgent != null) { info.options.headers["user-agent"] = this.userAgent; } info.options.agent = this._getAgent(info.parsedUrl); if (this.handlers) { for (const handler3 of this.handlers) { handler3.prepareRequest(info.options); } } return info; } _mergeHeaders(headers) { if (this.requestOptions && this.requestOptions.headers) { return Object.assign({}, lowercaseKeys3(this.requestOptions.headers), lowercaseKeys3(headers || {})); } return lowercaseKeys3(headers || {}); } /** * Gets an existing header value or returns a default. * Handles converting number header values to strings since HTTP headers must be strings. * Note: This returns string | string[] since some headers can have multiple values. * For headers that must always be a single string (like Content-Type), use the * specialized _getExistingOrDefaultContentTypeHeader method instead. */ _getExistingOrDefaultHeader(additionalHeaders, header, _default) { let clientHeader; if (this.requestOptions && this.requestOptions.headers) { const headerValue = lowercaseKeys3(this.requestOptions.headers)[header]; if (headerValue) { clientHeader = typeof headerValue === "number" ? headerValue.toString() : headerValue; } } const additionalValue = additionalHeaders[header]; if (additionalValue !== void 0) { return typeof additionalValue === "number" ? additionalValue.toString() : additionalValue; } if (clientHeader !== void 0) { return clientHeader; } return _default; } /** * Specialized version of _getExistingOrDefaultHeader for Content-Type header. * Always returns a single string (not an array) since Content-Type should be a single value. * Converts arrays to comma-separated strings and numbers to strings to ensure type safety. * This was split from _getExistingOrDefaultHeader to provide stricter typing for callers * that assign the result to places expecting a string (e.g., additionalHeaders[Headers.ContentType]). */ _getExistingOrDefaultContentTypeHeader(additionalHeaders, _default) { let clientHeader; if (this.requestOptions && this.requestOptions.headers) { const headerValue = lowercaseKeys3(this.requestOptions.headers)[Headers2.ContentType]; if (headerValue) { if (typeof headerValue === "number") { clientHeader = String(headerValue); } else if (Array.isArray(headerValue)) { clientHeader = headerValue.join(", "); } else { clientHeader = headerValue; } } } const additionalValue = additionalHeaders[Headers2.ContentType]; if (additionalValue !== void 0) { if (typeof additionalValue === "number") { return String(additionalValue); } else if (Array.isArray(additionalValue)) { return additionalValue.join(", "); } else { return additionalValue; } } if (clientHeader !== void 0) { return clientHeader; } return _default; } _getAgent(parsedUrl) { let agent; const proxyUrl = pm.getProxyUrl(parsedUrl); const useProxy = proxyUrl && proxyUrl.hostname; if (this._keepAlive && useProxy) { agent = this._proxyAgent; } if (!useProxy) { agent = this._agent; } if (agent) { return agent; } const usingSsl = parsedUrl.protocol === "https:"; let maxSockets = 100; if (this.requestOptions) { maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; } if (proxyUrl && proxyUrl.hostname) { const agentOptions = { maxSockets, keepAlive: this._keepAlive, proxy: Object.assign(Object.assign({}, (proxyUrl.username || proxyUrl.password) && { proxyAuth: `${proxyUrl.username}:${proxyUrl.password}` }), { host: proxyUrl.hostname, port: proxyUrl.port }) }; let tunnelAgent; const overHttps = proxyUrl.protocol === "https:"; if (usingSsl) { tunnelAgent = overHttps ? tunnel2.httpsOverHttps : tunnel2.httpsOverHttp; } else { tunnelAgent = overHttps ? tunnel2.httpOverHttps : tunnel2.httpOverHttp; } agent = tunnelAgent(agentOptions); this._proxyAgent = agent; } if (!agent) { const options = { keepAlive: this._keepAlive, maxSockets }; agent = usingSsl ? new https.Agent(options) : new http.Agent(options); this._agent = agent; } if (usingSsl && this._ignoreSslError) { agent.options = Object.assign(agent.options || {}, { rejectUnauthorized: false }); } return agent; } _getProxyAgentDispatcher(parsedUrl, proxyUrl) { let proxyAgent; if (this._keepAlive) { proxyAgent = this._proxyAgentDispatcher; } if (proxyAgent) { return proxyAgent; } const usingSsl = parsedUrl.protocol === "https:"; proxyAgent = new undici_1.ProxyAgent(Object.assign({ uri: proxyUrl.href, pipelining: !this._keepAlive ? 0 : 1 }, (proxyUrl.username || proxyUrl.password) && { token: `Basic ${Buffer.from(`${proxyUrl.username}:${proxyUrl.password}`).toString("base64")}` })); this._proxyAgentDispatcher = proxyAgent; if (usingSsl && this._ignoreSslError) { proxyAgent.options = Object.assign(proxyAgent.options.requestTls || {}, { rejectUnauthorized: false }); } return proxyAgent; } _getUserAgentWithOrchestrationId(userAgent3) { const baseUserAgent = userAgent3 || "actions/http-client"; const orchId = process.env["ACTIONS_ORCHESTRATION_ID"]; if (orchId) { const sanitizedId = orchId.replace(/[^a-z0-9_.-]/gi, "_"); return `${baseUserAgent} actions_orchestration_id/${sanitizedId}`; } return baseUserAgent; } _performExponentialBackoff(retryNumber) { return __awaiter3(this, void 0, void 0, function* () { retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); return new Promise((resolve5) => setTimeout(() => resolve5(), ms)); }); } _processResponse(res, options) { return __awaiter3(this, void 0, void 0, function* () { return new Promise((resolve5, reject) => __awaiter3(this, void 0, void 0, function* () { const statusCode = res.message.statusCode || 0; const response = { statusCode, result: null, headers: {} }; if (statusCode === HttpCodes2.NotFound) { resolve5(response); } function dateTimeDeserializer(key, value) { if (typeof value === "string") { const a = new Date(value); if (!isNaN(a.valueOf())) { return a; } } return value; } let obj; let contents; try { contents = yield res.readBody(); if (contents && contents.length > 0) { if (options && options.deserializeDates) { obj = JSON.parse(contents, dateTimeDeserializer); } else { obj = JSON.parse(contents); } response.result = obj; } response.headers = res.message.headers; } catch (err) { } if (statusCode > 299) { let msg; if (obj && obj.message) { msg = obj.message; } else if (contents && contents.length > 0) { msg = contents; } else { msg = `Failed request: (${statusCode})`; } const err = new HttpClientError(msg, statusCode); err.result = response.result; reject(err); } else { resolve5(response); } })); }); } }; exports.HttpClient = HttpClient3; var lowercaseKeys3 = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); } }); // var require_fast_content_type_parse = __commonJS({ ""(exports, module) { "use strict"; var NullObject = function NullObject2() { }; NullObject.prototype = /* @__PURE__ */ Object.create(null); var paramRE = /; *([!#$%&'*+.^\w`|~-]+)=("(?:[\v\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\v\u0020-\u00ff])*"|[!#$%&'*+.^\w`|~-]+) */gu; var quotedPairRE = /\\([\v\u0020-\u00ff])/gu; var mediaTypeRE = /^[!#$%&'*+.^\w|~-]+\/[!#$%&'*+.^\w|~-]+$/u; var defaultContentType = { type: "", parameters: new NullObject() }; Object.freeze(defaultContentType.parameters); Object.freeze(defaultContentType); function parse3(header) { if (typeof header !== "string") { throw new TypeError("argument header is required and must be a string"); } let index = header.indexOf(";"); const type = index !== -1 ? header.slice(0, index).trim() : header.trim(); if (mediaTypeRE.test(type) === false) { throw new TypeError("invalid media type"); } const result = { type: type.toLowerCase(), parameters: new NullObject() }; if (index === -1) { return result; } let key; let match; let value; paramRE.lastIndex = index; while (match = paramRE.exec(header)) { if (match.index !== index) { throw new TypeError("invalid parameter format"); } index += match[0].length; key = match[1].toLowerCase(); value = match[2]; if (value[0] === '"') { value = value.slice(1, value.length - 1); quotedPairRE.test(value) && (value = value.replace(quotedPairRE, "$1")); } result.parameters[key] = value; } if (index !== header.length) { throw new TypeError("invalid parameter format"); } return result; } function safeParse2(header) { if (typeof header !== "string") { return defaultContentType; } let index = header.indexOf(";"); const type = index !== -1 ? header.slice(0, index).trim() : header.trim(); if (mediaTypeRE.test(type) === false) { return defaultContentType; } const result = { type: type.toLowerCase(), parameters: new NullObject() }; if (index === -1) { return result; } let key; let match; let value; paramRE.lastIndex = index; while (match = paramRE.exec(header)) { if (match.index !== index) { return defaultContentType; } index += match[0].length; key = match[1].toLowerCase(); value = match[2]; if (value[0] === '"') { value = value.slice(1, value.length - 1); quotedPairRE.test(value) && (value = value.replace(quotedPairRE, "$1")); } result.parameters[key] = value; } if (index !== header.length) { return defaultContentType; } return result; } module.exports.default = { parse: parse3, safeParse: safeParse2 }; module.exports.parse = parse3; module.exports.safeParse = safeParse2; module.exports.defaultContentType = defaultContentType; } }); // var require_tmp = __commonJS({ ""(exports, module) { var fs2 = __require("fs"); var os4 = __require("os"); var path = __require("path"); var crypto = __require("crypto"); var _c2 = { fs: fs2.constants, os: os4.constants }; var RANDOM_CHARS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; var TEMPLATE_PATTERN = /XXXXXX/; var DEFAULT_TRIES = 3; var CREATE_FLAGS = (_c2.O_CREAT || _c2.fs.O_CREAT) | (_c2.O_EXCL || _c2.fs.O_EXCL) | (_c2.O_RDWR || _c2.fs.O_RDWR); var IS_WIN32 = os4.platform() === "win32"; var EBADF = _c2.EBADF || _c2.os.errno.EBADF; var ENOENT = _c2.ENOENT || _c2.os.errno.ENOENT; var DIR_MODE = 448; var FILE_MODE = 384; var EXIT = "exit"; var _removeObjects = []; var FN_RMDIR_SYNC = fs2.rmdirSync.bind(fs2); var _gracefulCleanup = false; function rimraf(dirPath, callback) { return fs2.rm(dirPath, { recursive: true }, callback); } function FN_RIMRAF_SYNC(dirPath) { return fs2.rmSync(dirPath, { recursive: true }); } function tmpName(options, callback) { const args = _parseArguments(options, callback), opts = args[0], cb = args[1]; _assertAndSanitizeOptions(opts, function(err, sanitizedOptions) { if (err) return cb(err); let tries = sanitizedOptions.tries; (function _getUniqueName() { try { const name = _generateTmpName(sanitizedOptions); fs2.stat(name, function(err2) { if (!err2) { if (tries-- > 0) return _getUniqueName(); return cb(new Error("Could not get a unique tmp filename, max tries reached " + name)); } cb(null, name); }); } catch (err2) { cb(err2); } })(); }); } function tmpNameSync(options) { const args = _parseArguments(options), opts = args[0]; const sanitizedOptions = _assertAndSanitizeOptionsSync(opts); let tries = sanitizedOptions.tries; do { const name = _generateTmpName(sanitizedOptions); try { fs2.statSync(name); } catch (e) { return name; } } while (tries-- > 0); throw new Error("Could not get a unique tmp filename, max tries reached"); } function file(options, callback) { const args = _parseArguments(options, callback), opts = args[0], cb = args[1]; tmpName(opts, function _tmpNameCreated(err, name) { if (err) return cb(err); fs2.open(name, CREATE_FLAGS, opts.mode || FILE_MODE, function _fileCreated(err2, fd) { if (err2) return cb(err2); if (opts.discardDescriptor) { return fs2.close(fd, function _discardCallback(possibleErr) { return cb(possibleErr, name, void 0, _prepareTmpFileRemoveCallback(name, -1, opts, false)); }); } else { const discardOrDetachDescriptor = opts.discardDescriptor || opts.detachDescriptor; cb(null, name, fd, _prepareTmpFileRemoveCallback(name, discardOrDetachDescriptor ? -1 : fd, opts, false)); } }); }); } function fileSync2(options) { const args = _parseArguments(options), opts = args[0]; const discardOrDetachDescriptor = opts.discardDescriptor || opts.detachDescriptor; const name = tmpNameSync(opts); let fd = fs2.openSync(name, CREATE_FLAGS, opts.mode || FILE_MODE); if (opts.discardDescriptor) { fs2.closeSync(fd); fd = void 0; } return { name, fd, removeCallback: _prepareTmpFileRemoveCallback(name, discardOrDetachDescriptor ? -1 : fd, opts, true) }; } function dir(options, callback) { const args = _parseArguments(options, callback), opts = args[0], cb = args[1]; tmpName(opts, function _tmpNameCreated(err, name) { if (err) return cb(err); fs2.mkdir(name, opts.mode || DIR_MODE, function _dirCreated(err2) { if (err2) return cb(err2); cb(null, name, _prepareTmpDirRemoveCallback(name, opts, false)); }); }); } function dirSync(options) { const args = _parseArguments(options), opts = args[0]; const name = tmpNameSync(opts); fs2.mkdirSync(name, opts.mode || DIR_MODE); return { name, removeCallback: _prepareTmpDirRemoveCallback(name, opts, true) }; } function _removeFileAsync(fdPath, next) { const _handler = function(err) { if (err && !_isENOENT(err)) { return next(err); } next(); }; if (0 <= fdPath[0]) fs2.close(fdPath[0], function() { fs2.unlink(fdPath[1], _handler); }); else fs2.unlink(fdPath[1], _handler); } function _removeFileSync(fdPath) { let rethrownException = null; try { if (0 <= fdPath[0]) fs2.closeSync(fdPath[0]); } catch (e) { if (!_isEBADF(e) && !_isENOENT(e)) throw e; } finally { try { fs2.unlinkSync(fdPath[1]); } catch (e) { if (!_isENOENT(e)) rethrownException = e; } } if (rethrownException !== null) { throw rethrownException; } } function _prepareTmpFileRemoveCallback(name, fd, opts, sync) { const removeCallbackSync = _prepareRemoveCallback(_removeFileSync, [fd, name], sync); const removeCallback = _prepareRemoveCallback(_removeFileAsync, [fd, name], sync, removeCallbackSync); if (!opts.keep) _removeObjects.unshift(removeCallbackSync); return sync ? removeCallbackSync : removeCallback; } function _prepareTmpDirRemoveCallback(name, opts, sync) { const removeFunction = opts.unsafeCleanup ? rimraf : fs2.rmdir.bind(fs2); const removeFunctionSync = opts.unsafeCleanup ? FN_RIMRAF_SYNC : FN_RMDIR_SYNC; const removeCallbackSync = _prepareRemoveCallback(removeFunctionSync, name, sync); const removeCallback = _prepareRemoveCallback(removeFunction, name, sync, removeCallbackSync); if (!opts.keep) _removeObjects.unshift(removeCallbackSync); return sync ? removeCallbackSync : removeCallback; } function _prepareRemoveCallback(removeFunction, fileOrDirName, sync, cleanupCallbackSync) { let called = false; return function _cleanupCallback(next) { if (!called) { const toRemove = cleanupCallbackSync || _cleanupCallback; const index = _removeObjects.indexOf(toRemove); if (index >= 0) _removeObjects.splice(index, 1); called = true; if (sync || removeFunction === FN_RMDIR_SYNC || removeFunction === FN_RIMRAF_SYNC) { return removeFunction(fileOrDirName); } else { return removeFunction(fileOrDirName, next || function() { }); } } }; } function _garbageCollector() { if (!_gracefulCleanup) return; while (_removeObjects.length) { try { _removeObjects[0](); } catch (e) { } } } function _randomChars(howMany) { let value = [], rnd = null; try { rnd = crypto.randomBytes(howMany); } catch (e) { rnd = crypto.pseudoRandomBytes(howMany); } for (let i = 0; i < howMany; i++) { value.push(RANDOM_CHARS[rnd[i] % RANDOM_CHARS.length]); } return value.join(""); } function _isUndefined(obj) { return typeof obj === "undefined"; } function _parseArguments(options, callback) { if (typeof options === "function") { return [{}, options]; } if (_isUndefined(options)) { return [{}, callback]; } const actualOptions = {}; for (const key of Object.getOwnPropertyNames(options)) { actualOptions[key] = options[key]; } return [actualOptions, callback]; } function _resolvePath(name, tmpDir, cb) { const pathToResolve = path.isAbsolute(name) ? name : path.join(tmpDir, name); fs2.stat(pathToResolve, function(err) { if (err) { fs2.realpath(path.dirname(pathToResolve), function(err2, parentDir) { if (err2) return cb(err2); cb(null, path.join(parentDir, path.basename(pathToResolve))); }); } else { fs2.realpath(pathToResolve, cb); } }); } function _resolvePathSync(name, tmpDir) { const pathToResolve = path.isAbsolute(name) ? name : path.join(tmpDir, name); try { fs2.statSync(pathToResolve); return fs2.realpathSync(pathToResolve); } catch (_err) { const parentDir = fs2.realpathSync(path.dirname(pathToResolve)); return path.join(parentDir, path.basename(pathToResolve)); } } function _generateTmpName(opts) { const tmpDir = opts.tmpdir; if (!_isUndefined(opts.name)) { return path.join(tmpDir, opts.dir, opts.name); } if (!_isUndefined(opts.template)) { return path.join(tmpDir, opts.dir, opts.template).replace(TEMPLATE_PATTERN, _randomChars(6)); } const name = [ opts.prefix ? opts.prefix : "tmp", "-", process.pid, "-", _randomChars(12), opts.postfix ? "-" + opts.postfix : "" ].join(""); return path.join(tmpDir, opts.dir, name); } function _assertOptionsBase(options) { if (!_isUndefined(options.name)) { const name = options.name; if (path.isAbsolute(name)) throw new Error(`name option must not contain an absolute path, found "${name}".`); const basename2 = path.basename(name); if (basename2 === ".." || basename2 === "." || basename2 !== name) throw new Error(`name option must not contain a path, found "${name}".`); } if (!_isUndefined(options.template) && !options.template.match(TEMPLATE_PATTERN)) { throw new Error(`Invalid template, found "${options.template}".`); } if (!_isUndefined(options.tries) && isNaN(options.tries) || options.tries < 0) { throw new Error(`Invalid tries, found "${options.tries}".`); } options.tries = _isUndefined(options.name) ? options.tries || DEFAULT_TRIES : 1; options.keep = !!options.keep; options.detachDescriptor = !!options.detachDescriptor; options.discardDescriptor = !!options.discardDescriptor; options.unsafeCleanup = !!options.unsafeCleanup; options.prefix = _isUndefined(options.prefix) ? "" : options.prefix; options.postfix = _isUndefined(options.postfix) ? "" : options.postfix; } function _getRelativePath(option, name, tmpDir, cb) { if (_isUndefined(name)) return cb(null); _resolvePath(name, tmpDir, function(err, resolvedPath) { if (err) return cb(err); const relativePath = path.relative(tmpDir, resolvedPath); if (!resolvedPath.startsWith(tmpDir)) { return cb(new Error(`${option} option must be relative to "${tmpDir}", found "${relativePath}".`)); } cb(null, relativePath); }); } function _getRelativePathSync(option, name, tmpDir) { if (_isUndefined(name)) return; const resolvedPath = _resolvePathSync(name, tmpDir); const relativePath = path.relative(tmpDir, resolvedPath); if (!resolvedPath.startsWith(tmpDir)) { throw new Error(`${option} option must be relative to "${tmpDir}", found "${relativePath}".`); } return relativePath; } function _assertAndSanitizeOptions(options, cb) { _getTmpDir(options, function(err, tmpDir) { if (err) return cb(err); options.tmpdir = tmpDir; try { _assertOptionsBase(options, tmpDir); } catch (err2) { return cb(err2); } _getRelativePath("dir", options.dir, tmpDir, function(err2, dir2) { if (err2) return cb(err2); options.dir = _isUndefined(dir2) ? "" : dir2; _getRelativePath("template", options.template, tmpDir, function(err3, template) { if (err3) return cb(err3); options.template = template; cb(null, options); }); }); }); } function _assertAndSanitizeOptionsSync(options) { const tmpDir = options.tmpdir = _getTmpDirSync(options); _assertOptionsBase(options, tmpDir); const dir2 = _getRelativePathSync("dir", options.dir, tmpDir); options.dir = _isUndefined(dir2) ? "" : dir2; options.template = _getRelativePathSync("template", options.template, tmpDir); return options; } function _isEBADF(error2) { return _isExpectedError(error2, -EBADF, "EBADF"); } function _isENOENT(error2) { return _isExpectedError(error2, -ENOENT, "ENOENT"); } function _isExpectedError(error2, errno, code) { return IS_WIN32 ? error2.code === code : error2.code === code && error2.errno === errno; } function setGracefulCleanup() { _gracefulCleanup = true; } function _getTmpDir(options, cb) { return fs2.realpath(options && options.tmpdir || os4.tmpdir(), cb); } function _getTmpDirSync(options) { return fs2.realpathSync(options && options.tmpdir || os4.tmpdir()); } process.addListener(EXIT, _garbageCollector); Object.defineProperty(module.exports, "tmpdir", { enumerable: true, configurable: false, get: function() { return _getTmpDirSync(); } }); module.exports.dir = dir; module.exports.dirSync = dirSync; module.exports.file = file; module.exports.fileSync = fileSync2; module.exports.tmpName = tmpName; module.exports.tmpNameSync = tmpNameSync; module.exports.setGracefulCleanup = setGracefulCleanup; } }); // var require_lockfile = __commonJS({ ""(exports, module) { module.exports = /******/ function(modules) { var installedModules = {}; function __webpack_require__(moduleId) { if (installedModules[moduleId]) { return installedModules[moduleId].exports; } var module2 = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; modules[moduleId].call(module2.exports, module2, module2.exports, __webpack_require__); module2.l = true; return module2.exports; } __webpack_require__.m = modules; __webpack_require__.c = installedModules; __webpack_require__.i = function(value) { return value; }; __webpack_require__.d = function(exports2, name, getter) { if (!__webpack_require__.o(exports2, name)) { Object.defineProperty(exports2, name, { /******/ configurable: false, /******/ enumerable: true, /******/ get: getter /******/ }); } }; __webpack_require__.n = function(module2) { var getter = module2 && module2.__esModule ? ( /******/ function getDefault() { return module2["default"]; } ) : ( /******/ function getModuleExports() { return module2; } ); __webpack_require__.d(getter, "a", getter); return getter; }; __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; __webpack_require__.p = ""; return __webpack_require__(__webpack_require__.s = 14); }([ /* 0 */ /***/ function(module2, exports2) { module2.exports = __require("path"); }, /* 1 */ /***/ function(module2, exports2, __webpack_require__) { "use strict"; exports2.__esModule = true; var _promise = __webpack_require__(173); var _promise2 = _interopRequireDefault(_promise); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports2.default = function(fn) { return function() { var gen = fn.apply(this, arguments); return new _promise2.default(function(resolve5, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error2) { reject(error2); return; } if (info.done) { resolve5(value); } else { return _promise2.default.resolve(value).then(function(value2) { step("next", value2); }, function(err) { step("throw", err); }); } } return step("next"); }); }; }; }, /* 2 */ /***/ function(module2, exports2) { module2.exports = __require("util"); }, /* 3 */ /***/ function(module2, exports2) { module2.exports = __require("fs"); }, /* 4 */ /***/ function(module2, exports2, __webpack_require__) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); class MessageError extends Error { constructor(msg, code) { super(msg); this.code = code; } } exports2.MessageError = MessageError; class ProcessSpawnError extends MessageError { constructor(msg, code, process3) { super(msg, code); this.process = process3; } } exports2.ProcessSpawnError = ProcessSpawnError; class SecurityError extends MessageError { } exports2.SecurityError = SecurityError; class ProcessTermError extends MessageError { } exports2.ProcessTermError = ProcessTermError; class ResponseError extends Error { constructor(msg, responseCode) { super(msg); this.responseCode = responseCode; } } exports2.ResponseError = ResponseError; }, /* 5 */ /***/ function(module2, exports2, __webpack_require__) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getFirstSuitableFolder = exports2.readFirstAvailableStream = exports2.makeTempDir = exports2.hardlinksWork = exports2.writeFilePreservingEol = exports2.getFileSizeOnDisk = exports2.walk = exports2.symlink = exports2.find = exports2.readJsonAndFile = exports2.readJson = exports2.readFileAny = exports2.hardlinkBulk = exports2.copyBulk = exports2.unlink = exports2.glob = exports2.link = exports2.chmod = exports2.lstat = exports2.exists = exports2.mkdirp = exports2.stat = exports2.access = exports2.rename = exports2.readdir = exports2.realpath = exports2.readlink = exports2.writeFile = exports2.open = exports2.readFileBuffer = exports2.lockQueue = exports2.constants = void 0; var _asyncToGenerator2; function _load_asyncToGenerator() { return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); } let buildActionsForCopy = (() => { var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, events, possibleExtraneous, reporter) { let build = (() => { var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) { const src = data.src, dest = data.dest, type = data.type; const onFresh = data.onFresh || noop4; const onDone = data.onDone || noop4; if (files.has(dest.toLowerCase())) { reporter.verbose(`The case-insensitive file ${dest} shouldn't be copied twice in one bulk copy`); } else { files.add(dest.toLowerCase()); } if (type === "symlink") { yield mkdirp((_path || _load_path()).default.dirname(dest)); onFresh(); actions.symlink.push({ dest, linkname: src }); onDone(); return; } if (events.ignoreBasenames.indexOf((_path || _load_path()).default.basename(src)) >= 0) { return; } const srcStat = yield lstat2(src); let srcFiles; if (srcStat.isDirectory()) { srcFiles = yield readdir2(src); } let destStat; try { destStat = yield lstat2(dest); } catch (e) { if (e.code !== "ENOENT") { throw e; } } if (destStat) { const bothSymlinks = srcStat.isSymbolicLink() && destStat.isSymbolicLink(); const bothFolders = srcStat.isDirectory() && destStat.isDirectory(); const bothFiles = srcStat.isFile() && destStat.isFile(); if (bothFiles && artifactFiles.has(dest)) { onDone(); reporter.verbose(reporter.lang("verboseFileSkipArtifact", src)); return; } if (bothFiles && srcStat.size === destStat.size && (0, (_fsNormalized || _load_fsNormalized()).fileDatesEqual)(srcStat.mtime, destStat.mtime)) { onDone(); reporter.verbose(reporter.lang("verboseFileSkip", src, dest, srcStat.size, +srcStat.mtime)); return; } if (bothSymlinks) { const srcReallink = yield readlink2(src); if (srcReallink === (yield readlink2(dest))) { onDone(); reporter.verbose(reporter.lang("verboseFileSkipSymlink", src, dest, srcReallink)); return; } } if (bothFolders) { const destFiles = yield readdir2(dest); invariant(srcFiles, "src files not initialised"); for (var _iterator4 = destFiles, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator](); ; ) { var _ref6; if (_isArray4) { if (_i4 >= _iterator4.length) break; _ref6 = _iterator4[_i4++]; } else { _i4 = _iterator4.next(); if (_i4.done) break; _ref6 = _i4.value; } const file = _ref6; if (srcFiles.indexOf(file) < 0) { const loc = (_path || _load_path()).default.join(dest, file); possibleExtraneous.add(loc); if ((yield lstat2(loc)).isDirectory()) { for (var _iterator5 = yield readdir2(loc), _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator](); ; ) { var _ref7; if (_isArray5) { if (_i5 >= _iterator5.length) break; _ref7 = _iterator5[_i5++]; } else { _i5 = _iterator5.next(); if (_i5.done) break; _ref7 = _i5.value; } const file2 = _ref7; possibleExtraneous.add((_path || _load_path()).default.join(loc, file2)); } } } } } } if (destStat && destStat.isSymbolicLink()) { yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(dest); destStat = null; } if (srcStat.isSymbolicLink()) { onFresh(); const linkname = yield readlink2(src); actions.symlink.push({ dest, linkname }); onDone(); } else if (srcStat.isDirectory()) { if (!destStat) { reporter.verbose(reporter.lang("verboseFileFolder", dest)); yield mkdirp(dest); } const destParts = dest.split((_path || _load_path()).default.sep); while (destParts.length) { files.add(destParts.join((_path || _load_path()).default.sep).toLowerCase()); destParts.pop(); } invariant(srcFiles, "src files not initialised"); let remaining = srcFiles.length; if (!remaining) { onDone(); } for (var _iterator6 = srcFiles, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : _iterator6[Symbol.iterator](); ; ) { var _ref8; if (_isArray6) { if (_i6 >= _iterator6.length) break; _ref8 = _iterator6[_i6++]; } else { _i6 = _iterator6.next(); if (_i6.done) break; _ref8 = _i6.value; } const file = _ref8; queue.push({ dest: (_path || _load_path()).default.join(dest, file), onFresh, onDone: function(_onDone) { function onDone2() { return _onDone.apply(this, arguments); } onDone2.toString = function() { return _onDone.toString(); }; return onDone2; }(function() { if (--remaining === 0) { onDone(); } }), src: (_path || _load_path()).default.join(src, file) }); } } else if (srcStat.isFile()) { onFresh(); actions.file.push({ src, dest, atime: srcStat.atime, mtime: srcStat.mtime, mode: srcStat.mode }); onDone(); } else { throw new Error(`unsure how to copy this: ${src}`); } }); return function build2(_x5) { return _ref5.apply(this, arguments); }; })(); const artifactFiles = new Set(events.artifactFiles || []); const files = /* @__PURE__ */ new Set(); for (var _iterator = queue, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator](); ; ) { var _ref2; if (_isArray) { if (_i >= _iterator.length) break; _ref2 = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref2 = _i.value; } const item = _ref2; const onDone = item.onDone; item.onDone = function() { events.onProgress(item.dest); if (onDone) { onDone(); } }; } events.onStart(queue.length); const actions = { file: [], symlink: [], link: [] }; while (queue.length) { const items = queue.splice(0, CONCURRENT_QUEUE_ITEMS); yield Promise.all(items.map(build)); } for (var _iterator2 = artifactFiles, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator](); ; ) { var _ref3; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref3 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref3 = _i2.value; } const file = _ref3; if (possibleExtraneous.has(file)) { reporter.verbose(reporter.lang("verboseFilePhantomExtraneous", file)); possibleExtraneous.delete(file); } } for (var _iterator3 = possibleExtraneous, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator](); ; ) { var _ref4; if (_isArray3) { if (_i3 >= _iterator3.length) break; _ref4 = _iterator3[_i3++]; } else { _i3 = _iterator3.next(); if (_i3.done) break; _ref4 = _i3.value; } const loc = _ref4; if (files.has(loc.toLowerCase())) { possibleExtraneous.delete(loc); } } return actions; }); return function buildActionsForCopy2(_x, _x2, _x3, _x4) { return _ref.apply(this, arguments); }; })(); let buildActionsForHardlink = (() => { var _ref9 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, events, possibleExtraneous, reporter) { let build = (() => { var _ref13 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) { const src = data.src, dest = data.dest; const onFresh = data.onFresh || noop4; const onDone = data.onDone || noop4; if (files.has(dest.toLowerCase())) { onDone(); return; } files.add(dest.toLowerCase()); if (events.ignoreBasenames.indexOf((_path || _load_path()).default.basename(src)) >= 0) { return; } const srcStat = yield lstat2(src); let srcFiles; if (srcStat.isDirectory()) { srcFiles = yield readdir2(src); } const destExists = yield exists2(dest); if (destExists) { const destStat = yield lstat2(dest); const bothSymlinks = srcStat.isSymbolicLink() && destStat.isSymbolicLink(); const bothFolders = srcStat.isDirectory() && destStat.isDirectory(); const bothFiles = srcStat.isFile() && destStat.isFile(); if (srcStat.mode !== destStat.mode) { try { yield access2(dest, srcStat.mode); } catch (err) { reporter.verbose(err); } } if (bothFiles && artifactFiles.has(dest)) { onDone(); reporter.verbose(reporter.lang("verboseFileSkipArtifact", src)); return; } if (bothFiles && srcStat.ino !== null && srcStat.ino === destStat.ino) { onDone(); reporter.verbose(reporter.lang("verboseFileSkip", src, dest, srcStat.ino)); return; } if (bothSymlinks) { const srcReallink = yield readlink2(src); if (srcReallink === (yield readlink2(dest))) { onDone(); reporter.verbose(reporter.lang("verboseFileSkipSymlink", src, dest, srcReallink)); return; } } if (bothFolders) { const destFiles = yield readdir2(dest); invariant(srcFiles, "src files not initialised"); for (var _iterator10 = destFiles, _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : _iterator10[Symbol.iterator](); ; ) { var _ref14; if (_isArray10) { if (_i10 >= _iterator10.length) break; _ref14 = _iterator10[_i10++]; } else { _i10 = _iterator10.next(); if (_i10.done) break; _ref14 = _i10.value; } const file = _ref14; if (srcFiles.indexOf(file) < 0) { const loc = (_path || _load_path()).default.join(dest, file); possibleExtraneous.add(loc); if ((yield lstat2(loc)).isDirectory()) { for (var _iterator11 = yield readdir2(loc), _isArray11 = Array.isArray(_iterator11), _i11 = 0, _iterator11 = _isArray11 ? _iterator11 : _iterator11[Symbol.iterator](); ; ) { var _ref15; if (_isArray11) { if (_i11 >= _iterator11.length) break; _ref15 = _iterator11[_i11++]; } else { _i11 = _iterator11.next(); if (_i11.done) break; _ref15 = _i11.value; } const file2 = _ref15; possibleExtraneous.add((_path || _load_path()).default.join(loc, file2)); } } } } } } if (srcStat.isSymbolicLink()) { onFresh(); const linkname = yield readlink2(src); actions.symlink.push({ dest, linkname }); onDone(); } else if (srcStat.isDirectory()) { reporter.verbose(reporter.lang("verboseFileFolder", dest)); yield mkdirp(dest); const destParts = dest.split((_path || _load_path()).default.sep); while (destParts.length) { files.add(destParts.join((_path || _load_path()).default.sep).toLowerCase()); destParts.pop(); } invariant(srcFiles, "src files not initialised"); let remaining = srcFiles.length; if (!remaining) { onDone(); } for (var _iterator12 = srcFiles, _isArray12 = Array.isArray(_iterator12), _i12 = 0, _iterator12 = _isArray12 ? _iterator12 : _iterator12[Symbol.iterator](); ; ) { var _ref16; if (_isArray12) { if (_i12 >= _iterator12.length) break; _ref16 = _iterator12[_i12++]; } else { _i12 = _iterator12.next(); if (_i12.done) break; _ref16 = _i12.value; } const file = _ref16; queue.push({ onFresh, src: (_path || _load_path()).default.join(src, file), dest: (_path || _load_path()).default.join(dest, file), onDone: function(_onDone2) { function onDone2() { return _onDone2.apply(this, arguments); } onDone2.toString = function() { return _onDone2.toString(); }; return onDone2; }(function() { if (--remaining === 0) { onDone(); } }) }); } } else if (srcStat.isFile()) { onFresh(); actions.link.push({ src, dest, removeDest: destExists }); onDone(); } else { throw new Error(`unsure how to copy this: ${src}`); } }); return function build2(_x10) { return _ref13.apply(this, arguments); }; })(); const artifactFiles = new Set(events.artifactFiles || []); const files = /* @__PURE__ */ new Set(); for (var _iterator7 = queue, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : _iterator7[Symbol.iterator](); ; ) { var _ref10; if (_isArray7) { if (_i7 >= _iterator7.length) break; _ref10 = _iterator7[_i7++]; } else { _i7 = _iterator7.next(); if (_i7.done) break; _ref10 = _i7.value; } const item = _ref10; const onDone = item.onDone || noop4; item.onDone = function() { events.onProgress(item.dest); onDone(); }; } events.onStart(queue.length); const actions = { file: [], symlink: [], link: [] }; while (queue.length) { const items = queue.splice(0, CONCURRENT_QUEUE_ITEMS); yield Promise.all(items.map(build)); } for (var _iterator8 = artifactFiles, _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : _iterator8[Symbol.iterator](); ; ) { var _ref11; if (_isArray8) { if (_i8 >= _iterator8.length) break; _ref11 = _iterator8[_i8++]; } else { _i8 = _iterator8.next(); if (_i8.done) break; _ref11 = _i8.value; } const file = _ref11; if (possibleExtraneous.has(file)) { reporter.verbose(reporter.lang("verboseFilePhantomExtraneous", file)); possibleExtraneous.delete(file); } } for (var _iterator9 = possibleExtraneous, _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : _iterator9[Symbol.iterator](); ; ) { var _ref12; if (_isArray9) { if (_i9 >= _iterator9.length) break; _ref12 = _iterator9[_i9++]; } else { _i9 = _iterator9.next(); if (_i9.done) break; _ref12 = _i9.value; } const loc = _ref12; if (files.has(loc.toLowerCase())) { possibleExtraneous.delete(loc); } } return actions; }); return function buildActionsForHardlink2(_x6, _x7, _x8, _x9) { return _ref9.apply(this, arguments); }; })(); let copyBulk = exports2.copyBulk = (() => { var _ref17 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, reporter, _events) { const events = { onStart: _events && _events.onStart || noop4, onProgress: _events && _events.onProgress || noop4, possibleExtraneous: _events ? _events.possibleExtraneous : /* @__PURE__ */ new Set(), ignoreBasenames: _events && _events.ignoreBasenames || [], artifactFiles: _events && _events.artifactFiles || [] }; const actions = yield buildActionsForCopy(queue, events, events.possibleExtraneous, reporter); events.onStart(actions.file.length + actions.symlink.length + actions.link.length); const fileActions = actions.file; const currentlyWriting = /* @__PURE__ */ new Map(); yield (_promise || _load_promise()).queue(fileActions, (() => { var _ref18 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) { let writePromise; while (writePromise = currentlyWriting.get(data.dest)) { yield writePromise; } reporter.verbose(reporter.lang("verboseFileCopy", data.src, data.dest)); const copier = (0, (_fsNormalized || _load_fsNormalized()).copyFile)(data, function() { return currentlyWriting.delete(data.dest); }); currentlyWriting.set(data.dest, copier); events.onProgress(data.dest); return copier; }); return function(_x14) { return _ref18.apply(this, arguments); }; })(), CONCURRENT_QUEUE_ITEMS); const symlinkActions = actions.symlink; yield (_promise || _load_promise()).queue(symlinkActions, function(data) { const linkname = (_path || _load_path()).default.resolve((_path || _load_path()).default.dirname(data.dest), data.linkname); reporter.verbose(reporter.lang("verboseFileSymlink", data.dest, linkname)); return symlink2(linkname, data.dest); }); }); return function copyBulk2(_x11, _x12, _x13) { return _ref17.apply(this, arguments); }; })(); let hardlinkBulk = exports2.hardlinkBulk = (() => { var _ref19 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, reporter, _events) { const events = { onStart: _events && _events.onStart || noop4, onProgress: _events && _events.onProgress || noop4, possibleExtraneous: _events ? _events.possibleExtraneous : /* @__PURE__ */ new Set(), artifactFiles: _events && _events.artifactFiles || [], ignoreBasenames: [] }; const actions = yield buildActionsForHardlink(queue, events, events.possibleExtraneous, reporter); events.onStart(actions.file.length + actions.symlink.length + actions.link.length); const fileActions = actions.link; yield (_promise || _load_promise()).queue(fileActions, (() => { var _ref20 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) { reporter.verbose(reporter.lang("verboseFileLink", data.src, data.dest)); if (data.removeDest) { yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(data.dest); } yield link(data.src, data.dest); }); return function(_x18) { return _ref20.apply(this, arguments); }; })(), CONCURRENT_QUEUE_ITEMS); const symlinkActions = actions.symlink; yield (_promise || _load_promise()).queue(symlinkActions, function(data) { const linkname = (_path || _load_path()).default.resolve((_path || _load_path()).default.dirname(data.dest), data.linkname); reporter.verbose(reporter.lang("verboseFileSymlink", data.dest, linkname)); return symlink2(linkname, data.dest); }); }); return function hardlinkBulk2(_x15, _x16, _x17) { return _ref19.apply(this, arguments); }; })(); let readFileAny = exports2.readFileAny = (() => { var _ref21 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (files) { for (var _iterator13 = files, _isArray13 = Array.isArray(_iterator13), _i13 = 0, _iterator13 = _isArray13 ? _iterator13 : _iterator13[Symbol.iterator](); ; ) { var _ref22; if (_isArray13) { if (_i13 >= _iterator13.length) break; _ref22 = _iterator13[_i13++]; } else { _i13 = _iterator13.next(); if (_i13.done) break; _ref22 = _i13.value; } const file = _ref22; if (yield exists2(file)) { return readFile3(file); } } return null; }); return function readFileAny2(_x19) { return _ref21.apply(this, arguments); }; })(); let readJson = exports2.readJson = (() => { var _ref23 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc) { return (yield readJsonAndFile(loc)).object; }); return function readJson2(_x20) { return _ref23.apply(this, arguments); }; })(); let readJsonAndFile = exports2.readJsonAndFile = (() => { var _ref24 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc) { const file = yield readFile3(loc); try { return { object: (0, (_map || _load_map()).default)(JSON.parse(stripBOM(file))), content: file }; } catch (err) { err.message = `${loc}: ${err.message}`; throw err; } }); return function readJsonAndFile2(_x21) { return _ref24.apply(this, arguments); }; })(); let find = exports2.find = (() => { var _ref25 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (filename, dir) { const parts = dir.split((_path || _load_path()).default.sep); while (parts.length) { const loc = parts.concat(filename).join((_path || _load_path()).default.sep); if (yield exists2(loc)) { return loc; } else { parts.pop(); } } return false; }); return function find2(_x22, _x23) { return _ref25.apply(this, arguments); }; })(); let symlink2 = exports2.symlink = (() => { var _ref26 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (src, dest) { try { const stats = yield lstat2(dest); if (stats.isSymbolicLink()) { const resolved = yield realpath(dest); if (resolved === src) { return; } } } catch (err) { if (err.code !== "ENOENT") { throw err; } } yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(dest); if (process.platform === "win32") { yield fsSymlink(src, dest, "junction"); } else { let relative2; try { relative2 = (_path || _load_path()).default.relative((_fs || _load_fs()).default.realpathSync((_path || _load_path()).default.dirname(dest)), (_fs || _load_fs()).default.realpathSync(src)); } catch (err) { if (err.code !== "ENOENT") { throw err; } relative2 = (_path || _load_path()).default.relative((_path || _load_path()).default.dirname(dest), src); } yield fsSymlink(relative2 || ".", dest); } }); return function symlink3(_x24, _x25) { return _ref26.apply(this, arguments); }; })(); let walk = exports2.walk = (() => { var _ref27 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dir, relativeDir, ignoreBasenames = /* @__PURE__ */ new Set()) { let files = []; let filenames = yield readdir2(dir); if (ignoreBasenames.size) { filenames = filenames.filter(function(name) { return !ignoreBasenames.has(name); }); } for (var _iterator14 = filenames, _isArray14 = Array.isArray(_iterator14), _i14 = 0, _iterator14 = _isArray14 ? _iterator14 : _iterator14[Symbol.iterator](); ; ) { var _ref28; if (_isArray14) { if (_i14 >= _iterator14.length) break; _ref28 = _iterator14[_i14++]; } else { _i14 = _iterator14.next(); if (_i14.done) break; _ref28 = _i14.value; } const name = _ref28; const relative2 = relativeDir ? (_path || _load_path()).default.join(relativeDir, name) : name; const loc = (_path || _load_path()).default.join(dir, name); const stat3 = yield lstat2(loc); files.push({ relative: relative2, basename: name, absolute: loc, mtime: +stat3.mtime }); if (stat3.isDirectory()) { files = files.concat(yield walk(loc, relative2, ignoreBasenames)); } } return files; }); return function walk2(_x26, _x27) { return _ref27.apply(this, arguments); }; })(); let getFileSizeOnDisk = exports2.getFileSizeOnDisk = (() => { var _ref29 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc) { const stat3 = yield lstat2(loc); const size = stat3.size, blockSize = stat3.blksize; return Math.ceil(size / blockSize) * blockSize; }); return function getFileSizeOnDisk2(_x28) { return _ref29.apply(this, arguments); }; })(); let getEolFromFile = (() => { var _ref30 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (path) { if (!(yield exists2(path))) { return void 0; } const buffer = yield readFileBuffer(path); for (let i = 0; i < buffer.length; ++i) { if (buffer[i] === cr) { return "\r\n"; } if (buffer[i] === lf) { return "\n"; } } return void 0; }); return function getEolFromFile2(_x29) { return _ref30.apply(this, arguments); }; })(); let writeFilePreservingEol = exports2.writeFilePreservingEol = (() => { var _ref31 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (path, data) { const eol = (yield getEolFromFile(path)) || (_os || _load_os()).default.EOL; if (eol !== "\n") { data = data.replace(/\n/g, eol); } yield writeFile5(path, data); }); return function writeFilePreservingEol2(_x30, _x31) { return _ref31.apply(this, arguments); }; })(); let hardlinksWork = exports2.hardlinksWork = (() => { var _ref32 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dir) { const filename = "test-file" + Math.random(); const file = (_path || _load_path()).default.join(dir, filename); const fileLink = (_path || _load_path()).default.join(dir, filename + "-link"); try { yield writeFile5(file, "test"); yield link(file, fileLink); } catch (err) { return false; } finally { yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(file); yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(fileLink); } return true; }); return function hardlinksWork2(_x32) { return _ref32.apply(this, arguments); }; })(); let makeTempDir = exports2.makeTempDir = (() => { var _ref33 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (prefix) { const dir = (_path || _load_path()).default.join((_os || _load_os()).default.tmpdir(), `yarn-${prefix || ""}-${Date.now()}-${Math.random()}`); yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(dir); yield mkdirp(dir); return dir; }); return function makeTempDir2(_x33) { return _ref33.apply(this, arguments); }; })(); let readFirstAvailableStream = exports2.readFirstAvailableStream = (() => { var _ref34 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (paths) { for (var _iterator15 = paths, _isArray15 = Array.isArray(_iterator15), _i15 = 0, _iterator15 = _isArray15 ? _iterator15 : _iterator15[Symbol.iterator](); ; ) { var _ref35; if (_isArray15) { if (_i15 >= _iterator15.length) break; _ref35 = _iterator15[_i15++]; } else { _i15 = _iterator15.next(); if (_i15.done) break; _ref35 = _i15.value; } const path = _ref35; try { const fd = yield open2(path, "r"); return (_fs || _load_fs()).default.createReadStream(path, { fd }); } catch (err) { } } return null; }); return function readFirstAvailableStream2(_x34) { return _ref34.apply(this, arguments); }; })(); let getFirstSuitableFolder = exports2.getFirstSuitableFolder = (() => { var _ref36 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (paths, mode = constants3.W_OK | constants3.X_OK) { const result = { skipped: [], folder: null }; for (var _iterator16 = paths, _isArray16 = Array.isArray(_iterator16), _i16 = 0, _iterator16 = _isArray16 ? _iterator16 : _iterator16[Symbol.iterator](); ; ) { var _ref37; if (_isArray16) { if (_i16 >= _iterator16.length) break; _ref37 = _iterator16[_i16++]; } else { _i16 = _iterator16.next(); if (_i16.done) break; _ref37 = _i16.value; } const folder = _ref37; try { yield mkdirp(folder); yield access2(folder, mode); result.folder = folder; return result; } catch (error2) { result.skipped.push({ error: error2, folder }); } } return result; }); return function getFirstSuitableFolder2(_x35) { return _ref36.apply(this, arguments); }; })(); exports2.copy = copy; exports2.readFile = readFile3; exports2.readFileRaw = readFileRaw; exports2.normalizeOS = normalizeOS; var _fs; function _load_fs() { return _fs = _interopRequireDefault(__webpack_require__(3)); } var _glob; function _load_glob() { return _glob = _interopRequireDefault(__webpack_require__(75)); } var _os; function _load_os() { return _os = _interopRequireDefault(__webpack_require__(36)); } var _path; function _load_path() { return _path = _interopRequireDefault(__webpack_require__(0)); } var _blockingQueue; function _load_blockingQueue() { return _blockingQueue = _interopRequireDefault(__webpack_require__(84)); } var _promise; function _load_promise() { return _promise = _interopRequireWildcard(__webpack_require__(40)); } var _promise2; function _load_promise2() { return _promise2 = __webpack_require__(40); } var _map; function _load_map() { return _map = _interopRequireDefault(__webpack_require__(20)); } var _fsNormalized; function _load_fsNormalized() { return _fsNormalized = __webpack_require__(164); } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } const constants3 = exports2.constants = typeof (_fs || _load_fs()).default.constants !== "undefined" ? (_fs || _load_fs()).default.constants : { R_OK: (_fs || _load_fs()).default.R_OK, W_OK: (_fs || _load_fs()).default.W_OK, X_OK: (_fs || _load_fs()).default.X_OK }; const lockQueue = exports2.lockQueue = new (_blockingQueue || _load_blockingQueue()).default("fs lock"); const readFileBuffer = exports2.readFileBuffer = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.readFile); const open2 = exports2.open = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.open); const writeFile5 = exports2.writeFile = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.writeFile); const readlink2 = exports2.readlink = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.readlink); const realpath = exports2.realpath = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.realpath); const readdir2 = exports2.readdir = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.readdir); const rename2 = exports2.rename = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.rename); const access2 = exports2.access = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.access); const stat2 = exports2.stat = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.stat); const mkdirp = exports2.mkdirp = (0, (_promise2 || _load_promise2()).promisify)(__webpack_require__(116)); const exists2 = exports2.exists = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.exists, true); const lstat2 = exports2.lstat = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.lstat); const chmod2 = exports2.chmod = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.chmod); const link = exports2.link = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.link); const glob = exports2.glob = (0, (_promise2 || _load_promise2()).promisify)((_glob || _load_glob()).default); exports2.unlink = (_fsNormalized || _load_fsNormalized()).unlink; const CONCURRENT_QUEUE_ITEMS = (_fs || _load_fs()).default.copyFile ? 128 : 4; const fsSymlink = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.symlink); const invariant = __webpack_require__(7); const stripBOM = __webpack_require__(122); const noop4 = () => { }; function copy(src, dest, reporter) { return copyBulk([{ src, dest }], reporter); } function _readFile(loc, encoding) { return new Promise((resolve5, reject) => { (_fs || _load_fs()).default.readFile(loc, encoding, function(err, content) { if (err) { reject(err); } else { resolve5(content); } }); }); } function readFile3(loc) { return _readFile(loc, "utf8").then(normalizeOS); } function readFileRaw(loc) { return _readFile(loc, "binary"); } function normalizeOS(body) { return body.replace(/\r\n/g, "\n"); } const cr = "\r".charCodeAt(0); const lf = "\n".charCodeAt(0); }, /* 6 */ /***/ function(module2, exports2, __webpack_require__) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getPathKey = getPathKey; const os4 = __webpack_require__(36); const path = __webpack_require__(0); const userHome = __webpack_require__(45).default; var _require = __webpack_require__(171); const getCacheDir = _require.getCacheDir, getConfigDir = _require.getConfigDir, getDataDir = _require.getDataDir; const isWebpackBundle = __webpack_require__(227); const DEPENDENCY_TYPES = exports2.DEPENDENCY_TYPES = ["devDependencies", "dependencies", "optionalDependencies", "peerDependencies"]; const RESOLUTIONS = exports2.RESOLUTIONS = "resolutions"; const MANIFEST_FIELDS = exports2.MANIFEST_FIELDS = [RESOLUTIONS, ...DEPENDENCY_TYPES]; const SUPPORTED_NODE_VERSIONS = exports2.SUPPORTED_NODE_VERSIONS = "^4.8.0 || ^5.7.0 || ^6.2.2 || >=8.0.0"; const YARN_REGISTRY = exports2.YARN_REGISTRY = "https://registry.yarnpkg.com"; const YARN_DOCS = exports2.YARN_DOCS = "https://yarnpkg.com/en/docs/cli/"; const YARN_INSTALLER_SH = exports2.YARN_INSTALLER_SH = "https://yarnpkg.com/install.sh"; const YARN_INSTALLER_MSI = exports2.YARN_INSTALLER_MSI = "https://yarnpkg.com/latest.msi"; const SELF_UPDATE_VERSION_URL = exports2.SELF_UPDATE_VERSION_URL = "https://yarnpkg.com/latest-version"; const CACHE_VERSION = exports2.CACHE_VERSION = 2; const LOCKFILE_VERSION = exports2.LOCKFILE_VERSION = 1; const NETWORK_CONCURRENCY = exports2.NETWORK_CONCURRENCY = 8; const NETWORK_TIMEOUT = exports2.NETWORK_TIMEOUT = 30 * 1e3; const CHILD_CONCURRENCY = exports2.CHILD_CONCURRENCY = 5; const REQUIRED_PACKAGE_KEYS = exports2.REQUIRED_PACKAGE_KEYS = ["name", "version", "_uid"]; function getPreferredCacheDirectories() { const preferredCacheDirectories = [getCacheDir()]; if (process.getuid) { preferredCacheDirectories.push(path.join(os4.tmpdir(), `.yarn-cache-${process.getuid()}`)); } preferredCacheDirectories.push(path.join(os4.tmpdir(), `.yarn-cache`)); return preferredCacheDirectories; } const PREFERRED_MODULE_CACHE_DIRECTORIES = exports2.PREFERRED_MODULE_CACHE_DIRECTORIES = getPreferredCacheDirectories(); const CONFIG_DIRECTORY = exports2.CONFIG_DIRECTORY = getConfigDir(); const DATA_DIRECTORY = exports2.DATA_DIRECTORY = getDataDir(); const LINK_REGISTRY_DIRECTORY = exports2.LINK_REGISTRY_DIRECTORY = path.join(DATA_DIRECTORY, "link"); const GLOBAL_MODULE_DIRECTORY = exports2.GLOBAL_MODULE_DIRECTORY = path.join(DATA_DIRECTORY, "global"); const NODE_BIN_PATH = exports2.NODE_BIN_PATH = process.execPath; const YARN_BIN_PATH = exports2.YARN_BIN_PATH = getYarnBinPath(); function getYarnBinPath() { if (isWebpackBundle) { return __filename; } else { return path.join(__dirname, "..", "bin", "yarn.js"); } } const NODE_MODULES_FOLDER = exports2.NODE_MODULES_FOLDER = "node_modules"; const NODE_PACKAGE_JSON = exports2.NODE_PACKAGE_JSON = "package.json"; const POSIX_GLOBAL_PREFIX = exports2.POSIX_GLOBAL_PREFIX = `${process.env.DESTDIR || ""}/usr/local`; const FALLBACK_GLOBAL_PREFIX = exports2.FALLBACK_GLOBAL_PREFIX = path.join(userHome, ".yarn"); const META_FOLDER = exports2.META_FOLDER = ".yarn-meta"; const INTEGRITY_FILENAME = exports2.INTEGRITY_FILENAME = ".yarn-integrity"; const LOCKFILE_FILENAME = exports2.LOCKFILE_FILENAME = "yarn.lock"; const METADATA_FILENAME = exports2.METADATA_FILENAME = ".yarn-metadata.json"; const TARBALL_FILENAME = exports2.TARBALL_FILENAME = ".yarn-tarball.tgz"; const CLEAN_FILENAME = exports2.CLEAN_FILENAME = ".yarnclean"; const NPM_LOCK_FILENAME = exports2.NPM_LOCK_FILENAME = "package-lock.json"; const NPM_SHRINKWRAP_FILENAME = exports2.NPM_SHRINKWRAP_FILENAME = "npm-shrinkwrap.json"; const DEFAULT_INDENT = exports2.DEFAULT_INDENT = " "; const SINGLE_INSTANCE_PORT = exports2.SINGLE_INSTANCE_PORT = 31997; const SINGLE_INSTANCE_FILENAME = exports2.SINGLE_INSTANCE_FILENAME = ".yarn-single-instance"; const ENV_PATH_KEY = exports2.ENV_PATH_KEY = getPathKey(process.platform, process.env); function getPathKey(platform2, env3) { let pathKey = "PATH"; if (platform2 === "win32") { pathKey = "Path"; for (const key in env3) { if (key.toLowerCase() === "path") { pathKey = key; } } } return pathKey; } const VERSION_COLOR_SCHEME = exports2.VERSION_COLOR_SCHEME = { major: "red", premajor: "red", minor: "yellow", preminor: "yellow", patch: "green", prepatch: "green", prerelease: "red", unchanged: "white", unknown: "red" }; }, /* 7 */ /***/ function(module2, exports2, __webpack_require__) { "use strict"; var NODE_ENV = process.env.NODE_ENV; var invariant = function(condition, format3, a, b, c, d, e, f) { if (NODE_ENV !== "production") { if (format3 === void 0) { throw new Error("invariant requires an error message argument"); } } if (!condition) { var error2; if (format3 === void 0) { error2 = new Error( "Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings." ); } else { var args = [a, b, c, d, e, f]; var argIndex = 0; error2 = new Error( format3.replace(/%s/g, function() { return args[argIndex++]; }) ); error2.name = "Invariant Violation"; } error2.framesToPop = 1; throw error2; } }; module2.exports = invariant; }, , /* 9 */ /***/ function(module2, exports2) { module2.exports = __require("crypto"); }, , /* 11 */ /***/ function(module2, exports2) { var global = module2.exports = typeof window != "undefined" && window.Math == Math ? window : typeof self != "undefined" && self.Math == Math ? self : Function("return this")(); if (typeof __g == "number") __g = global; }, /* 12 */ /***/ function(module2, exports2, __webpack_require__) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.sortAlpha = sortAlpha; exports2.entries = entries; exports2.removePrefix = removePrefix; exports2.removeSuffix = removeSuffix; exports2.addSuffix = addSuffix; exports2.hyphenate = hyphenate; exports2.camelCase = camelCase2; exports2.compareSortedArrays = compareSortedArrays; exports2.sleep = sleep; const _camelCase = __webpack_require__(176); function sortAlpha(a, b) { const shortLen = Math.min(a.length, b.length); for (let i = 0; i < shortLen; i++) { const aChar = a.charCodeAt(i); const bChar = b.charCodeAt(i); if (aChar !== bChar) { return aChar - bChar; } } return a.length - b.length; } function entries(obj) { const entries2 = []; if (obj) { for (const key in obj) { entries2.push([key, obj[key]]); } } return entries2; } function removePrefix(pattern, prefix) { if (pattern.startsWith(prefix)) { pattern = pattern.slice(prefix.length); } return pattern; } function removeSuffix(pattern, suffix) { if (pattern.endsWith(suffix)) { return pattern.slice(0, -suffix.length); } return pattern; } function addSuffix(pattern, suffix) { if (!pattern.endsWith(suffix)) { return pattern + suffix; } return pattern; } function hyphenate(str) { return str.replace(/[A-Z]/g, (match) => { return "-" + match.charAt(0).toLowerCase(); }); } function camelCase2(str) { if (/[A-Z]/.test(str)) { return null; } else { return _camelCase(str); } } function compareSortedArrays(array1, array2) { if (array1.length !== array2.length) { return false; } for (let i = 0, len = array1.length; i < len; i++) { if (array1[i] !== array2[i]) { return false; } } return true; } function sleep(ms) { return new Promise((resolve5) => { setTimeout(resolve5, ms); }); } }, /* 13 */ /***/ function(module2, exports2, __webpack_require__) { var store = __webpack_require__(107)("wks"); var uid = __webpack_require__(111); var Symbol2 = __webpack_require__(11).Symbol; var USE_SYMBOL = typeof Symbol2 == "function"; var $exports = module2.exports = function(name) { return store[name] || (store[name] = USE_SYMBOL && Symbol2[name] || (USE_SYMBOL ? Symbol2 : uid)("Symbol." + name)); }; $exports.store = store; }, /* 14 */ /***/ function(module2, exports2, __webpack_require__) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.stringify = exports2.parse = void 0; var _asyncToGenerator2; function _load_asyncToGenerator() { return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); } var _parse; function _load_parse() { return _parse = __webpack_require__(81); } Object.defineProperty(exports2, "parse", { enumerable: true, get: function get() { return _interopRequireDefault(_parse || _load_parse()).default; } }); var _stringify; function _load_stringify() { return _stringify = __webpack_require__(150); } Object.defineProperty(exports2, "stringify", { enumerable: true, get: function get() { return _interopRequireDefault(_stringify || _load_stringify()).default; } }); exports2.implodeEntry = implodeEntry; exports2.explodeEntry = explodeEntry; var _misc; function _load_misc() { return _misc = __webpack_require__(12); } var _normalizePattern; function _load_normalizePattern() { return _normalizePattern = __webpack_require__(29); } var _parse2; function _load_parse2() { return _parse2 = _interopRequireDefault(__webpack_require__(81)); } var _constants; function _load_constants() { return _constants = __webpack_require__(6); } var _fs; function _load_fs() { return _fs = _interopRequireWildcard(__webpack_require__(5)); } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } const invariant = __webpack_require__(7); const path = __webpack_require__(0); const ssri = __webpack_require__(55); function getName(pattern) { return (0, (_normalizePattern || _load_normalizePattern()).normalizePattern)(pattern).name; } function blankObjectUndefined(obj) { return obj && Object.keys(obj).length ? obj : void 0; } function keyForRemote(remote) { return remote.resolved || (remote.reference && remote.hash ? `${remote.reference}#${remote.hash}` : null); } function serializeIntegrity(integrity) { return integrity.toString().split(" ").sort().join(" "); } function implodeEntry(pattern, obj) { const inferredName = getName(pattern); const integrity = obj.integrity ? serializeIntegrity(obj.integrity) : ""; const imploded = { name: inferredName === obj.name ? void 0 : obj.name, version: obj.version, uid: obj.uid === obj.version ? void 0 : obj.uid, resolved: obj.resolved, registry: obj.registry === "npm" ? void 0 : obj.registry, dependencies: blankObjectUndefined(obj.dependencies), optionalDependencies: blankObjectUndefined(obj.optionalDependencies), permissions: blankObjectUndefined(obj.permissions), prebuiltVariants: blankObjectUndefined(obj.prebuiltVariants) }; if (integrity) { imploded.integrity = integrity; } return imploded; } function explodeEntry(pattern, obj) { obj.optionalDependencies = obj.optionalDependencies || {}; obj.dependencies = obj.dependencies || {}; obj.uid = obj.uid || obj.version; obj.permissions = obj.permissions || {}; obj.registry = obj.registry || "npm"; obj.name = obj.name || getName(pattern); const integrity = obj.integrity; if (integrity && integrity.isIntegrity) { obj.integrity = ssri.parse(integrity); } return obj; } class Lockfile { constructor({ cache, source, parseResultType } = {}) { this.source = source || ""; this.cache = cache; this.parseResultType = parseResultType; } // source string if the `cache` was parsed // if true, we're parsing an old yarn file and need to update integrity fields hasEntriesExistWithoutIntegrity() { if (!this.cache) { return false; } for (const key in this.cache) { if (!/^.*@(file:|http)/.test(key) && this.cache[key] && !this.cache[key].integrity) { return true; } } return false; } static fromDirectory(dir, reporter) { return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { const lockfileLoc = path.join(dir, (_constants || _load_constants()).LOCKFILE_FILENAME); let lockfile2; let rawLockfile = ""; let parseResult; if (yield (_fs || _load_fs()).exists(lockfileLoc)) { rawLockfile = yield (_fs || _load_fs()).readFile(lockfileLoc); parseResult = (0, (_parse2 || _load_parse2()).default)(rawLockfile, lockfileLoc); if (reporter) { if (parseResult.type === "merge") { reporter.info(reporter.lang("lockfileMerged")); } else if (parseResult.type === "conflict") { reporter.warn(reporter.lang("lockfileConflict")); } } lockfile2 = parseResult.object; } else if (reporter) { reporter.info(reporter.lang("noLockfileFound")); } return new Lockfile({ cache: lockfile2, source: rawLockfile, parseResultType: parseResult && parseResult.type }); })(); } getLocked(pattern) { const cache = this.cache; if (!cache) { return void 0; } const shrunk = pattern in cache && cache[pattern]; if (typeof shrunk === "string") { return this.getLocked(shrunk); } else if (shrunk) { explodeEntry(pattern, shrunk); return shrunk; } return void 0; } removePattern(pattern) { const cache = this.cache; if (!cache) { return; } delete cache[pattern]; } getLockfile(patterns) { const lockfile2 = {}; const seen = /* @__PURE__ */ new Map(); const sortedPatternsKeys = Object.keys(patterns).sort((_misc || _load_misc()).sortAlpha); for (var _iterator = sortedPatternsKeys, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator](); ; ) { var _ref; if (_isArray) { if (_i >= _iterator.length) break; _ref = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref = _i.value; } const pattern = _ref; const pkg = patterns[pattern]; const remote = pkg._remote, ref = pkg._reference; invariant(ref, "Package is missing a reference"); invariant(remote, "Package is missing a remote"); const remoteKey = keyForRemote(remote); const seenPattern = remoteKey && seen.get(remoteKey); if (seenPattern) { lockfile2[pattern] = seenPattern; if (!seenPattern.name && getName(pattern) !== pkg.name) { seenPattern.name = pkg.name; } continue; } const obj = implodeEntry(pattern, { name: pkg.name, version: pkg.version, uid: pkg._uid, resolved: remote.resolved, integrity: remote.integrity, registry: remote.registry, dependencies: pkg.dependencies, peerDependencies: pkg.peerDependencies, optionalDependencies: pkg.optionalDependencies, permissions: ref.permissions, prebuiltVariants: pkg.prebuiltVariants }); lockfile2[pattern] = obj; if (remoteKey) { seen.set(remoteKey, obj); } } return lockfile2; } } exports2.default = Lockfile; }, , , /* 17 */ /***/ function(module2, exports2) { module2.exports = __require("stream"); }, , , /* 20 */ /***/ function(module2, exports2, __webpack_require__) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.default = nullify; function nullify(obj = {}) { if (Array.isArray(obj)) { for (var _iterator = obj, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator](); ; ) { var _ref; if (_isArray) { if (_i >= _iterator.length) break; _ref = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref = _i.value; } const item = _ref; nullify(item); } } else if (obj !== null && typeof obj === "object" || typeof obj === "function") { Object.setPrototypeOf(obj, null); if (typeof obj === "object") { for (const key in obj) { nullify(obj[key]); } } } return obj; } }, , /* 22 */ /***/ function(module2, exports2) { module2.exports = __require("assert"); }, /* 23 */ /***/ function(module2, exports2) { var core = module2.exports = { version: "2.5.7" }; if (typeof __e == "number") __e = core; }, , , , /* 27 */ /***/ function(module2, exports2, __webpack_require__) { var isObject = __webpack_require__(34); module2.exports = function(it) { if (!isObject(it)) throw TypeError(it + " is not an object!"); return it; }; }, , /* 29 */ /***/ function(module2, exports2, __webpack_require__) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.normalizePattern = normalizePattern; function normalizePattern(pattern) { let hasVersion = false; let range = "latest"; let name = pattern; let isScoped = false; if (name[0] === "@") { isScoped = true; name = name.slice(1); } const parts = name.split("@"); if (parts.length > 1) { name = parts.shift(); range = parts.join("@"); if (range) { hasVersion = true; } else { range = "*"; } } if (isScoped) { name = `@${name}`; } return { name, range, hasVersion }; } }, , /* 31 */ /***/ function(module2, exports2, __webpack_require__) { var dP = __webpack_require__(50); var createDesc = __webpack_require__(106); module2.exports = __webpack_require__(33) ? function(object, key, value) { return dP.f(object, key, createDesc(1, value)); } : function(object, key, value) { object[key] = value; return object; }; }, /* 32 */ /***/ function(module2, exports2, __webpack_require__) { var buffer = __webpack_require__(63); var Buffer2 = buffer.Buffer; function copyProps(src, dst) { for (var key in src) { dst[key] = src[key]; } } if (Buffer2.from && Buffer2.alloc && Buffer2.allocUnsafe && Buffer2.allocUnsafeSlow) { module2.exports = buffer; } else { copyProps(buffer, exports2); exports2.Buffer = SafeBuffer; } function SafeBuffer(arg, encodingOrOffset, length) { return Buffer2(arg, encodingOrOffset, length); } copyProps(Buffer2, SafeBuffer); SafeBuffer.from = function(arg, encodingOrOffset, length) { if (typeof arg === "number") { throw new TypeError("Argument must not be a number"); } return Buffer2(arg, encodingOrOffset, length); }; SafeBuffer.alloc = function(size, fill, encoding) { if (typeof size !== "number") { throw new TypeError("Argument must be a number"); } var buf = Buffer2(size); if (fill !== void 0) { if (typeof encoding === "string") { buf.fill(fill, encoding); } else { buf.fill(fill); } } else { buf.fill(0); } return buf; }; SafeBuffer.allocUnsafe = function(size) { if (typeof size !== "number") { throw new TypeError("Argument must be a number"); } return Buffer2(size); }; SafeBuffer.allocUnsafeSlow = function(size) { if (typeof size !== "number") { throw new TypeError("Argument must be a number"); } return buffer.SlowBuffer(size); }; }, /* 33 */ /***/ function(module2, exports2, __webpack_require__) { module2.exports = !__webpack_require__(85)(function() { return Object.defineProperty({}, "a", { get: function() { return 7; } }).a != 7; }); }, /* 34 */ /***/ function(module2, exports2) { module2.exports = function(it) { return typeof it === "object" ? it !== null : typeof it === "function"; }; }, /* 35 */ /***/ function(module2, exports2) { module2.exports = {}; }, /* 36 */ /***/ function(module2, exports2) { module2.exports = __require("os"); }, , , , /* 40 */ /***/ function(module2, exports2, __webpack_require__) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.wait = wait; exports2.promisify = promisify; exports2.queue = queue; function wait(delay) { return new Promise((resolve5) => { setTimeout(resolve5, delay); }); } function promisify(fn, firstData) { return function(...args) { return new Promise(function(resolve5, reject) { args.push(function(err, ...result) { let res = result; if (result.length <= 1) { res = result[0]; } if (firstData) { res = err; err = null; } if (err) { reject(err); } else { resolve5(res); } }); fn.apply(null, args); }); }; } function queue(arr, promiseProducer, concurrency = Infinity) { concurrency = Math.min(concurrency, arr.length); arr = arr.slice(); const results = []; let total = arr.length; if (!total) { return Promise.resolve(results); } return new Promise((resolve5, reject) => { for (let i = 0; i < concurrency; i++) { next(); } function next() { const item = arr.shift(); const promise = promiseProducer(item); promise.then(function(result) { results.push(result); total--; if (total === 0) { resolve5(results); } else { if (arr.length) { next(); } } }, reject); } }); } }, /* 41 */ /***/ function(module2, exports2, __webpack_require__) { var global = __webpack_require__(11); var core = __webpack_require__(23); var ctx = __webpack_require__(48); var hide = __webpack_require__(31); var has = __webpack_require__(49); var PROTOTYPE = "prototype"; var $export = function(type, name, source) { var IS_FORCED = type & $export.F; var IS_GLOBAL = type & $export.G; var IS_STATIC = type & $export.S; var IS_PROTO = type & $export.P; var IS_BIND = type & $export.B; var IS_WRAP = type & $export.W; var exports3 = IS_GLOBAL ? core : core[name] || (core[name] = {}); var expProto = exports3[PROTOTYPE]; var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE]; var key, own, out; if (IS_GLOBAL) source = name; for (key in source) { own = !IS_FORCED && target && target[key] !== void 0; if (own && has(exports3, key)) continue; out = own ? target[key] : source[key]; exports3[key] = IS_GLOBAL && typeof target[key] != "function" ? source[key] : IS_BIND && own ? ctx(out, global) : IS_WRAP && target[key] == out ? function(C) { var F = function(a, b, c) { if (this instanceof C) { switch (arguments.length) { case 0: return new C(); case 1: return new C(a); case 2: return new C(a, b); } return new C(a, b, c); } return C.apply(this, arguments); }; F[PROTOTYPE] = C[PROTOTYPE]; return F; }(out) : IS_PROTO && typeof out == "function" ? ctx(Function.call, out) : out; if (IS_PROTO) { (exports3.virtual || (exports3.virtual = {}))[key] = out; if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out); } } }; $export.F = 1; $export.G = 2; $export.S = 4; $export.P = 8; $export.B = 16; $export.W = 32; $export.U = 64; $export.R = 128; module2.exports = $export; }, /* 42 */ /***/ function(module2, exports2, __webpack_require__) { try { var util = __webpack_require__(2); if (typeof util.inherits !== "function") throw ""; module2.exports = util.inherits; } catch (e) { module2.exports = __webpack_require__(224); } }, , , /* 45 */ /***/ function(module2, exports2, __webpack_require__) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.home = void 0; var _rootUser; function _load_rootUser() { return _rootUser = _interopRequireDefault(__webpack_require__(169)); } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } const path = __webpack_require__(0); const home = exports2.home = __webpack_require__(36).homedir(); const userHomeDir = (_rootUser || _load_rootUser()).default ? path.resolve("/usr/local/share") : home; exports2.default = userHomeDir; }, /* 46 */ /***/ function(module2, exports2) { module2.exports = function(it) { if (typeof it != "function") throw TypeError(it + " is not a function!"); return it; }; }, /* 47 */ /***/ function(module2, exports2) { var toString = {}.toString; module2.exports = function(it) { return toString.call(it).slice(8, -1); }; }, /* 48 */ /***/ function(module2, exports2, __webpack_require__) { var aFunction = __webpack_require__(46); module2.exports = function(fn, that, length) { aFunction(fn); if (that === void 0) return fn; switch (length) { case 1: return function(a) { return fn.call(that, a); }; case 2: return function(a, b) { return fn.call(that, a, b); }; case 3: return function(a, b, c) { return fn.call(that, a, b, c); }; } return function() { return fn.apply(that, arguments); }; }; }, /* 49 */ /***/ function(module2, exports2) { var hasOwnProperty = {}.hasOwnProperty; module2.exports = function(it, key) { return hasOwnProperty.call(it, key); }; }, /* 50 */ /***/ function(module2, exports2, __webpack_require__) { var anObject = __webpack_require__(27); var IE8_DOM_DEFINE = __webpack_require__(184); var toPrimitive = __webpack_require__(201); var dP = Object.defineProperty; exports2.f = __webpack_require__(33) ? Object.defineProperty : function defineProperty(O, P, Attributes) { anObject(O); P = toPrimitive(P, true); anObject(Attributes); if (IE8_DOM_DEFINE) try { return dP(O, P, Attributes); } catch (e) { } if ("get" in Attributes || "set" in Attributes) throw TypeError("Accessors not supported!"); if ("value" in Attributes) O[P] = Attributes.value; return O; }; }, , , , /* 54 */ /***/ function(module2, exports2) { module2.exports = __require("events"); }, /* 55 */ /***/ function(module2, exports2, __webpack_require__) { "use strict"; const Buffer2 = __webpack_require__(32).Buffer; const crypto = __webpack_require__(9); const Transform = __webpack_require__(17).Transform; const SPEC_ALGORITHMS = ["sha256", "sha384", "sha512"]; const BASE64_REGEX = /^[a-z0-9+/]+(?:=?=?)$/i; const SRI_REGEX = /^([^-]+)-([^?]+)([?\S*]*)$/; const STRICT_SRI_REGEX = /^([^-]+)-([A-Za-z0-9+/=]{44,88})(\?[\x21-\x7E]*)*$/; const VCHAR_REGEX = /^[\x21-\x7E]+$/; class Hash { get isHash() { return true; } constructor(hash, opts) { const strict = !!(opts && opts.strict); this.source = hash.trim(); const match = this.source.match( strict ? STRICT_SRI_REGEX : SRI_REGEX ); if (!match) { return; } if (strict && !SPEC_ALGORITHMS.some((a) => a === match[1])) { return; } this.algorithm = match[1]; this.digest = match[2]; const rawOpts = match[3]; this.options = rawOpts ? rawOpts.slice(1).split("?") : []; } hexDigest() { return this.digest && Buffer2.from(this.digest, "base64").toString("hex"); } toJSON() { return this.toString(); } toString(opts) { if (opts && opts.strict) { if (!// The spec has very restricted productions for algorithms. // https://www.w3.org/TR/CSP2/#source-list-syntax (SPEC_ALGORITHMS.some((x) => x === this.algorithm) && // Usually, if someone insists on using a "different" base64, we // leave it as-is, since there's multiple standards, and the // specified is not a URL-safe variant. // https://www.w3.org/TR/CSP2/#base64_value this.digest.match(BASE64_REGEX) && // Option syntax is strictly visual chars. // https://w3c.github.io/webappsec-subresource-integrity/#grammardef-option-expression // https://tools.ietf.org/html/rfc5234#appendix-B.1 (this.options || []).every((opt) => opt.match(VCHAR_REGEX)))) { return ""; } } const options = this.options && this.options.length ? `?${this.options.join("?")}` : ""; return `${this.algorithm}-${this.digest}${options}`; } } class Integrity { get isIntegrity() { return true; } toJSON() { return this.toString(); } toString(opts) { opts = opts || {}; let sep3 = opts.sep || " "; if (opts.strict) { sep3 = sep3.replace(/\S+/g, " "); } return Object.keys(this).map((k) => { return this[k].map((hash) => { return Hash.prototype.toString.call(hash, opts); }).filter((x) => x.length).join(sep3); }).filter((x) => x.length).join(sep3); } concat(integrity, opts) { const other = typeof integrity === "string" ? integrity : stringify(integrity, opts); return parse3(`${this.toString(opts)} ${other}`, opts); } hexDigest() { return parse3(this, { single: true }).hexDigest(); } match(integrity, opts) { const other = parse3(integrity, opts); const algo = other.pickAlgorithm(opts); return this[algo] && other[algo] && this[algo].find( (hash) => other[algo].find( (otherhash) => hash.digest === otherhash.digest ) ) || false; } pickAlgorithm(opts) { const pickAlgorithm = opts && opts.pickAlgorithm || getPrioritizedHash; const keys = Object.keys(this); if (!keys.length) { throw new Error(`No algorithms available for ${JSON.stringify(this.toString())}`); } return keys.reduce((acc, algo) => { return pickAlgorithm(acc, algo) || acc; }); } } module2.exports.parse = parse3; function parse3(sri, opts) { opts = opts || {}; if (typeof sri === "string") { return _parse(sri, opts); } else if (sri.algorithm && sri.digest) { const fullSri = new Integrity(); fullSri[sri.algorithm] = [sri]; return _parse(stringify(fullSri, opts), opts); } else { return _parse(stringify(sri, opts), opts); } } function _parse(integrity, opts) { if (opts.single) { return new Hash(integrity, opts); } return integrity.trim().split(/\s+/).reduce((acc, string) => { const hash = new Hash(string, opts); if (hash.algorithm && hash.digest) { const algo = hash.algorithm; if (!acc[algo]) { acc[algo] = []; } acc[algo].push(hash); } return acc; }, new Integrity()); } module2.exports.stringify = stringify; function stringify(obj, opts) { if (obj.algorithm && obj.digest) { return Hash.prototype.toString.call(obj, opts); } else if (typeof obj === "string") { return stringify(parse3(obj, opts), opts); } else { return Integrity.prototype.toString.call(obj, opts); } } module2.exports.fromHex = fromHex; function fromHex(hexDigest, algorithm, opts) { const optString = opts && opts.options && opts.options.length ? `?${opts.options.join("?")}` : ""; return parse3( `${algorithm}-${Buffer2.from(hexDigest, "hex").toString("base64")}${optString}`, opts ); } module2.exports.fromData = fromData; function fromData(data, opts) { opts = opts || {}; const algorithms = opts.algorithms || ["sha512"]; const optString = opts.options && opts.options.length ? `?${opts.options.join("?")}` : ""; return algorithms.reduce((acc, algo) => { const digest = crypto.createHash(algo).update(data).digest("base64"); const hash = new Hash( `${algo}-${digest}${optString}`, opts ); if (hash.algorithm && hash.digest) { const algo2 = hash.algorithm; if (!acc[algo2]) { acc[algo2] = []; } acc[algo2].push(hash); } return acc; }, new Integrity()); } module2.exports.fromStream = fromStream; function fromStream(stream, opts) { opts = opts || {}; const P = opts.Promise || Promise; const istream = integrityStream(opts); return new P((resolve5, reject) => { stream.pipe(istream); stream.on("error", reject); istream.on("error", reject); let sri; istream.on("integrity", (s) => { sri = s; }); istream.on("end", () => resolve5(sri)); istream.on("data", () => { }); }); } module2.exports.checkData = checkData; function checkData(data, sri, opts) { opts = opts || {}; sri = parse3(sri, opts); if (!Object.keys(sri).length) { if (opts.error) { throw Object.assign( new Error("No valid integrity hashes to check against"), { code: "EINTEGRITY" } ); } else { return false; } } const algorithm = sri.pickAlgorithm(opts); const digest = crypto.createHash(algorithm).update(data).digest("base64"); const newSri = parse3({ algorithm, digest }); const match = newSri.match(sri, opts); if (match || !opts.error) { return match; } else if (typeof opts.size === "number" && data.length !== opts.size) { const err = new Error(`data size mismatch when checking ${sri}. Wanted: ${opts.size} Found: ${data.length}`); err.code = "EBADSIZE"; err.found = data.length; err.expected = opts.size; err.sri = sri; throw err; } else { const err = new Error(`Integrity checksum failed when using ${algorithm}: Wanted ${sri}, but got ${newSri}. (${data.length} bytes)`); err.code = "EINTEGRITY"; err.found = newSri; err.expected = sri; err.algorithm = algorithm; err.sri = sri; throw err; } } module2.exports.checkStream = checkStream; function checkStream(stream, sri, opts) { opts = opts || {}; const P = opts.Promise || Promise; const checker = integrityStream(Object.assign({}, opts, { integrity: sri })); return new P((resolve5, reject) => { stream.pipe(checker); stream.on("error", reject); checker.on("error", reject); let sri2; checker.on("verified", (s) => { sri2 = s; }); checker.on("end", () => resolve5(sri2)); checker.on("data", () => { }); }); } module2.exports.integrityStream = integrityStream; function integrityStream(opts) { opts = opts || {}; const sri = opts.integrity && parse3(opts.integrity, opts); const goodSri = sri && Object.keys(sri).length; const algorithm = goodSri && sri.pickAlgorithm(opts); const digests = goodSri && sri[algorithm]; const algorithms = Array.from( new Set( (opts.algorithms || ["sha512"]).concat(algorithm ? [algorithm] : []) ) ); const hashes = algorithms.map(crypto.createHash); let streamSize = 0; const stream = new Transform({ transform(chunk, enc, cb) { streamSize += chunk.length; hashes.forEach((h) => h.update(chunk, enc)); cb(null, chunk, enc); } }).on("end", () => { const optString = opts.options && opts.options.length ? `?${opts.options.join("?")}` : ""; const newSri = parse3(hashes.map((h, i) => { return `${algorithms[i]}-${h.digest("base64")}${optString}`; }).join(" "), opts); const match = goodSri && newSri.match(sri, opts); if (typeof opts.size === "number" && streamSize !== opts.size) { const err = new Error(`stream size mismatch when checking ${sri}. Wanted: ${opts.size} Found: ${streamSize}`); err.code = "EBADSIZE"; err.found = streamSize; err.expected = opts.size; err.sri = sri; stream.emit("error", err); } else if (opts.integrity && !match) { const err = new Error(`${sri} integrity checksum failed when using ${algorithm}: wanted ${digests} but got ${newSri}. (${streamSize} bytes)`); err.code = "EINTEGRITY"; err.found = newSri; err.expected = digests; err.algorithm = algorithm; err.sri = sri; stream.emit("error", err); } else { stream.emit("size", streamSize); stream.emit("integrity", newSri); match && stream.emit("verified", match); } }); return stream; } module2.exports.create = createIntegrity; function createIntegrity(opts) { opts = opts || {}; const algorithms = opts.algorithms || ["sha512"]; const optString = opts.options && opts.options.length ? `?${opts.options.join("?")}` : ""; const hashes = algorithms.map(crypto.createHash); return { update: function(chunk, enc) { hashes.forEach((h) => h.update(chunk, enc)); return this; }, digest: function(enc) { const integrity = algorithms.reduce((acc, algo) => { const digest = hashes.shift().digest("base64"); const hash = new Hash( `${algo}-${digest}${optString}`, opts ); if (hash.algorithm && hash.digest) { const algo2 = hash.algorithm; if (!acc[algo2]) { acc[algo2] = []; } acc[algo2].push(hash); } return acc; }, new Integrity()); return integrity; } }; } const NODE_HASHES = new Set(crypto.getHashes()); const DEFAULT_PRIORITY = [ "md5", "whirlpool", "sha1", "sha224", "sha256", "sha384", "sha512", // TODO - it's unclear _which_ of these Node will actually use as its name // for the algorithm, so we guesswork it based on the OpenSSL names. "sha3", "sha3-256", "sha3-384", "sha3-512", "sha3_256", "sha3_384", "sha3_512" ].filter((algo) => NODE_HASHES.has(algo)); function getPrioritizedHash(algo1, algo2) { return DEFAULT_PRIORITY.indexOf(algo1.toLowerCase()) >= DEFAULT_PRIORITY.indexOf(algo2.toLowerCase()) ? algo1 : algo2; } }, , , , , /* 60 */ /***/ function(module2, exports2, __webpack_require__) { module2.exports = minimatch; minimatch.Minimatch = Minimatch; var path = { sep: "/" }; try { path = __webpack_require__(0); } catch (er) { } var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}; var expand3 = __webpack_require__(175); var plTypes = { "!": { open: "(?:(?!(?:", close: "))[^/]*?)" }, "?": { open: "(?:", close: ")?" }, "+": { open: "(?:", close: ")+" }, "*": { open: "(?:", close: ")*" }, "@": { open: "(?:", close: ")" } }; var qmark = "[^/]"; var star = qmark + "*?"; var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?"; var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?"; var reSpecials = charSet("().*{}+?[]^$\\!"); function charSet(s) { return s.split("").reduce(function(set, c) { set[c] = true; return set; }, {}); } var slashSplit = /\/+/; minimatch.filter = filter; function filter(pattern, options) { options = options || {}; return function(p, i, list) { return minimatch(p, pattern, options); }; } function ext(a, b) { a = a || {}; b = b || {}; var t = {}; Object.keys(b).forEach(function(k) { t[k] = b[k]; }); Object.keys(a).forEach(function(k) { t[k] = a[k]; }); return t; } minimatch.defaults = function(def) { if (!def || !Object.keys(def).length) return minimatch; var orig = minimatch; var m = function minimatch2(p, pattern, options) { return orig.minimatch(p, pattern, ext(def, options)); }; m.Minimatch = function Minimatch2(pattern, options) { return new orig.Minimatch(pattern, ext(def, options)); }; return m; }; Minimatch.defaults = function(def) { if (!def || !Object.keys(def).length) return Minimatch; return minimatch.defaults(def).Minimatch; }; function minimatch(p, pattern, options) { if (typeof pattern !== "string") { throw new TypeError("glob pattern string required"); } if (!options) options = {}; if (!options.nocomment && pattern.charAt(0) === "#") { return false; } if (pattern.trim() === "") return p === ""; return new Minimatch(pattern, options).match(p); } function Minimatch(pattern, options) { if (!(this instanceof Minimatch)) { return new Minimatch(pattern, options); } if (typeof pattern !== "string") { throw new TypeError("glob pattern string required"); } if (!options) options = {}; pattern = pattern.trim(); if (path.sep !== "/") { pattern = pattern.split(path.sep).join("/"); } this.options = options; this.set = []; this.pattern = pattern; this.regexp = null; this.negate = false; this.comment = false; this.empty = false; this.make(); } Minimatch.prototype.debug = function() { }; Minimatch.prototype.make = make; function make() { if (this._made) return; var pattern = this.pattern; var options = this.options; if (!options.nocomment && pattern.charAt(0) === "#") { this.comment = true; return; } if (!pattern) { this.empty = true; return; } this.parseNegate(); var set = this.globSet = this.braceExpand(); if (options.debug) this.debug = console.error; this.debug(this.pattern, set); set = this.globParts = set.map(function(s) { return s.split(slashSplit); }); this.debug(this.pattern, set); set = set.map(function(s, si, set2) { return s.map(this.parse, this); }, this); this.debug(this.pattern, set); set = set.filter(function(s) { return s.indexOf(false) === -1; }); this.debug(this.pattern, set); this.set = set; } Minimatch.prototype.parseNegate = parseNegate; function parseNegate() { var pattern = this.pattern; var negate = false; var options = this.options; var negateOffset = 0; if (options.nonegate) return; for (var i = 0, l = pattern.length; i < l && pattern.charAt(i) === "!"; i++) { negate = !negate; negateOffset++; } if (negateOffset) this.pattern = pattern.substr(negateOffset); this.negate = negate; } minimatch.braceExpand = function(pattern, options) { return braceExpand(pattern, options); }; Minimatch.prototype.braceExpand = braceExpand; function braceExpand(pattern, options) { if (!options) { if (this instanceof Minimatch) { options = this.options; } else { options = {}; } } pattern = typeof pattern === "undefined" ? this.pattern : pattern; if (typeof pattern === "undefined") { throw new TypeError("undefined pattern"); } if (options.nobrace || !pattern.match(/\{.*\}/)) { return [pattern]; } return expand3(pattern); } Minimatch.prototype.parse = parse3; var SUBPARSE = {}; function parse3(pattern, isSub) { if (pattern.length > 1024 * 64) { throw new TypeError("pattern is too long"); } var options = this.options; if (!options.noglobstar && pattern === "**") return GLOBSTAR; if (pattern === "") return ""; var re = ""; var hasMagic = !!options.nocase; var escaping = false; var patternListStack = []; var negativeLists = []; var stateChar; var inClass = false; var reClassStart = -1; var classStart = -1; var patternStart = pattern.charAt(0) === "." ? "" : options.dot ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)"; var self2 = this; function clearStateChar() { if (stateChar) { switch (stateChar) { case "*": re += star; hasMagic = true; break; case "?": re += qmark; hasMagic = true; break; default: re += "\\" + stateChar; break; } self2.debug("clearStateChar %j %j", stateChar, re); stateChar = false; } } for (var i = 0, len = pattern.length, c; i < len && (c = pattern.charAt(i)); i++) { this.debug("%s %s %s %j", pattern, i, re, c); if (escaping && reSpecials[c]) { re += "\\" + c; escaping = false; continue; } switch (c) { case "/": return false; case "\\": clearStateChar(); escaping = true; continue; case "?": case "*": case "+": case "@": case "!": this.debug("%s %s %s %j <-- stateChar", pattern, i, re, c); if (inClass) { this.debug(" in class"); if (c === "!" && i === classStart + 1) c = "^"; re += c; continue; } self2.debug("call clearStateChar %j", stateChar); clearStateChar(); stateChar = c; if (options.noext) clearStateChar(); continue; case "(": if (inClass) { re += "("; continue; } if (!stateChar) { re += "\\("; continue; } patternListStack.push({ type: stateChar, start: i - 1, reStart: re.length, open: plTypes[stateChar].open, close: plTypes[stateChar].close }); re += stateChar === "!" ? "(?:(?!(?:" : "(?:"; this.debug("plType %j %j", stateChar, re); stateChar = false; continue; case ")": if (inClass || !patternListStack.length) { re += "\\)"; continue; } clearStateChar(); hasMagic = true; var pl = patternListStack.pop(); re += pl.close; if (pl.type === "!") { negativeLists.push(pl); } pl.reEnd = re.length; continue; case "|": if (inClass || !patternListStack.length || escaping) { re += "\\|"; escaping = false; continue; } clearStateChar(); re += "|"; continue; case "[": clearStateChar(); if (inClass) { re += "\\" + c; continue; } inClass = true; classStart = i; reClassStart = re.length; re += c; continue; case "]": if (i === classStart + 1 || !inClass) { re += "\\" + c; escaping = false; continue; } if (inClass) { var cs = pattern.substring(classStart + 1, i); try { RegExp("[" + cs + "]"); } catch (er) { var sp = this.parse(cs, SUBPARSE); re = re.substr(0, reClassStart) + "\\[" + sp[0] + "\\]"; hasMagic = hasMagic || sp[1]; inClass = false; continue; } } hasMagic = true; inClass = false; re += c; continue; default: clearStateChar(); if (escaping) { escaping = false; } else if (reSpecials[c] && !(c === "^" && inClass)) { re += "\\"; } re += c; } } if (inClass) { cs = pattern.substr(classStart + 1); sp = this.parse(cs, SUBPARSE); re = re.substr(0, reClassStart) + "\\[" + sp[0]; hasMagic = hasMagic || sp[1]; } for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { var tail = re.slice(pl.reStart + pl.open.length); this.debug("setting tail", re, pl); tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function(_, $1, $2) { if (!$2) { $2 = "\\"; } return $1 + $1 + $2 + "|"; }); this.debug("tail=%j\n %s", tail, tail, pl, re); var t = pl.type === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type; hasMagic = true; re = re.slice(0, pl.reStart) + t + "\\(" + tail; } clearStateChar(); if (escaping) { re += "\\\\"; } var addPatternStart = false; switch (re.charAt(0)) { case ".": case "[": case "(": addPatternStart = true; } for (var n = negativeLists.length - 1; n > -1; n--) { var nl = negativeLists[n]; var nlBefore = re.slice(0, nl.reStart); var nlFirst = re.slice(nl.reStart, nl.reEnd - 8); var nlLast = re.slice(nl.reEnd - 8, nl.reEnd); var nlAfter = re.slice(nl.reEnd); nlLast += nlAfter; var openParensBefore = nlBefore.split("(").length - 1; var cleanAfter = nlAfter; for (i = 0; i < openParensBefore; i++) { cleanAfter = cleanAfter.replace(/\)[+*?]?/, ""); } nlAfter = cleanAfter; var dollar = ""; if (nlAfter === "" && isSub !== SUBPARSE) { dollar = "$"; } var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast; re = newRe; } if (re !== "" && hasMagic) { re = "(?=.)" + re; } if (addPatternStart) { re = patternStart + re; } if (isSub === SUBPARSE) { return [re, hasMagic]; } if (!hasMagic) { return globUnescape(pattern); } var flags = options.nocase ? "i" : ""; try { var regExp = new RegExp("^" + re + "$", flags); } catch (er) { return new RegExp("$."); } regExp._glob = pattern; regExp._src = re; return regExp; } minimatch.makeRe = function(pattern, options) { return new Minimatch(pattern, options || {}).makeRe(); }; Minimatch.prototype.makeRe = makeRe; function makeRe() { if (this.regexp || this.regexp === false) return this.regexp; var set = this.set; if (!set.length) { this.regexp = false; return this.regexp; } var options = this.options; var twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot; var flags = options.nocase ? "i" : ""; var re = set.map(function(pattern) { return pattern.map(function(p) { return p === GLOBSTAR ? twoStar : typeof p === "string" ? regExpEscape(p) : p._src; }).join("\\/"); }).join("|"); re = "^(?:" + re + ")$"; if (this.negate) re = "^(?!" + re + ").*$"; try { this.regexp = new RegExp(re, flags); } catch (ex) { this.regexp = false; } return this.regexp; } minimatch.match = function(list, pattern, options) { options = options || {}; var mm = new Minimatch(pattern, options); list = list.filter(function(f) { return mm.match(f); }); if (mm.options.nonull && !list.length) { list.push(pattern); } return list; }; Minimatch.prototype.match = match; function match(f, partial) { this.debug("match", f, this.pattern); if (this.comment) return false; if (this.empty) return f === ""; if (f === "/" && partial) return true; var options = this.options; if (path.sep !== "/") { f = f.split(path.sep).join("/"); } f = f.split(slashSplit); this.debug(this.pattern, "split", f); var set = this.set; this.debug(this.pattern, "set", set); var filename; var i; for (i = f.length - 1; i >= 0; i--) { filename = f[i]; if (filename) break; } for (i = 0; i < set.length; i++) { var pattern = set[i]; var file = f; if (options.matchBase && pattern.length === 1) { file = [filename]; } var hit = this.matchOne(file, pattern, partial); if (hit) { if (options.flipNegate) return true; return !this.negate; } } if (options.flipNegate) return false; return this.negate; } Minimatch.prototype.matchOne = function(file, pattern, partial) { var options = this.options; this.debug( "matchOne", { "this": this, file, pattern } ); this.debug("matchOne", file.length, pattern.length); for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) { this.debug("matchOne loop"); var p = pattern[pi]; var f = file[fi]; this.debug(pattern, p, f); if (p === false) return false; if (p === GLOBSTAR) { this.debug("GLOBSTAR", [pattern, p, f]); var fr = fi; var pr = pi + 1; if (pr === pl) { this.debug("** at the end"); for (; fi < fl; fi++) { if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".") return false; } return true; } while (fr < fl) { var swallowee = file[fr]; this.debug("\nglobstar while", file, fr, pattern, pr, swallowee); if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { this.debug("globstar found match!", fr, fl, swallowee); return true; } else { if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") { this.debug("dot detected!", file, fr, pattern, pr); break; } this.debug("globstar swallow a segment, and continue"); fr++; } } if (partial) { this.debug("\n>>> no match, partial?", file, fr, pattern, pr); if (fr === fl) return true; } return false; } var hit; if (typeof p === "string") { if (options.nocase) { hit = f.toLowerCase() === p.toLowerCase(); } else { hit = f === p; } this.debug("string match", p, f, hit); } else { hit = f.match(p); this.debug("pattern match", p, f, hit); } if (!hit) return false; } if (fi === fl && pi === pl) { return true; } else if (fi === fl) { return partial; } else if (pi === pl) { var emptyFileEnd = fi === fl - 1 && file[fi] === ""; return emptyFileEnd; } throw new Error("wtf?"); }; function globUnescape(s) { return s.replace(/\\(.)/g, "$1"); } function regExpEscape(s) { return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); } }, /* 61 */ /***/ function(module2, exports2, __webpack_require__) { var wrappy = __webpack_require__(123); module2.exports = wrappy(once); module2.exports.strict = wrappy(onceStrict); once.proto = once(function() { Object.defineProperty(Function.prototype, "once", { value: function() { return once(this); }, configurable: true }); Object.defineProperty(Function.prototype, "onceStrict", { value: function() { return onceStrict(this); }, configurable: true }); }); function once(fn) { var f = function() { if (f.called) return f.value; f.called = true; return f.value = fn.apply(this, arguments); }; f.called = false; return f; } function onceStrict(fn) { var f = function() { if (f.called) throw new Error(f.onceError); f.called = true; return f.value = fn.apply(this, arguments); }; var name = fn.name || "Function wrapped with `once`"; f.onceError = name + " shouldn't be called more than once"; f.called = false; return f; } }, , /* 63 */ /***/ function(module2, exports2) { module2.exports = __require("buffer"); }, , , , /* 67 */ /***/ function(module2, exports2) { module2.exports = function(it) { if (it == void 0) throw TypeError("Can't call method on " + it); return it; }; }, /* 68 */ /***/ function(module2, exports2, __webpack_require__) { var isObject = __webpack_require__(34); var document2 = __webpack_require__(11).document; var is = isObject(document2) && isObject(document2.createElement); module2.exports = function(it) { return is ? document2.createElement(it) : {}; }; }, /* 69 */ /***/ function(module2, exports2) { module2.exports = true; }, /* 70 */ /***/ function(module2, exports2, __webpack_require__) { "use strict"; var aFunction = __webpack_require__(46); function PromiseCapability(C) { var resolve5, reject; this.promise = new C(function($$resolve, $$reject) { if (resolve5 !== void 0 || reject !== void 0) throw TypeError("Bad Promise constructor"); resolve5 = $$resolve; reject = $$reject; }); this.resolve = aFunction(resolve5); this.reject = aFunction(reject); } module2.exports.f = function(C) { return new PromiseCapability(C); }; }, /* 71 */ /***/ function(module2, exports2, __webpack_require__) { var def = __webpack_require__(50).f; var has = __webpack_require__(49); var TAG = __webpack_require__(13)("toStringTag"); module2.exports = function(it, tag, stat2) { if (it && !has(it = stat2 ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag }); }; }, /* 72 */ /***/ function(module2, exports2, __webpack_require__) { var shared = __webpack_require__(107)("keys"); var uid = __webpack_require__(111); module2.exports = function(key) { return shared[key] || (shared[key] = uid(key)); }; }, /* 73 */ /***/ function(module2, exports2) { var ceil = Math.ceil; var floor = Math.floor; module2.exports = function(it) { return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); }; }, /* 74 */ /***/ function(module2, exports2, __webpack_require__) { var IObject = __webpack_require__(131); var defined = __webpack_require__(67); module2.exports = function(it) { return IObject(defined(it)); }; }, /* 75 */ /***/ function(module2, exports2, __webpack_require__) { module2.exports = glob; var fs2 = __webpack_require__(3); var rp = __webpack_require__(114); var minimatch = __webpack_require__(60); var Minimatch = minimatch.Minimatch; var inherits = __webpack_require__(42); var EE = __webpack_require__(54).EventEmitter; var path = __webpack_require__(0); var assert2 = __webpack_require__(22); var isAbsolute = __webpack_require__(76); var globSync = __webpack_require__(218); var common = __webpack_require__(115); var alphasort = common.alphasort; var alphasorti = common.alphasorti; var setopts = common.setopts; var ownProp = common.ownProp; var inflight = __webpack_require__(223); var util = __webpack_require__(2); var childrenIgnored = common.childrenIgnored; var isIgnored = common.isIgnored; var once = __webpack_require__(61); function glob(pattern, options, cb) { if (typeof options === "function") cb = options, options = {}; if (!options) options = {}; if (options.sync) { if (cb) throw new TypeError("callback provided to sync glob"); return globSync(pattern, options); } return new Glob(pattern, options, cb); } glob.sync = globSync; var GlobSync = glob.GlobSync = globSync.GlobSync; glob.glob = glob; function extend(origin, add) { if (add === null || typeof add !== "object") { return origin; } var keys = Object.keys(add); var i = keys.length; while (i--) { origin[keys[i]] = add[keys[i]]; } return origin; } glob.hasMagic = function(pattern, options_) { var options = extend({}, options_); options.noprocess = true; var g = new Glob(pattern, options); var set = g.minimatch.set; if (!pattern) return false; if (set.length > 1) return true; for (var j = 0; j < set[0].length; j++) { if (typeof set[0][j] !== "string") return true; } return false; }; glob.Glob = Glob; inherits(Glob, EE); function Glob(pattern, options, cb) { if (typeof options === "function") { cb = options; options = null; } if (options && options.sync) { if (cb) throw new TypeError("callback provided to sync glob"); return new GlobSync(pattern, options); } if (!(this instanceof Glob)) return new Glob(pattern, options, cb); setopts(this, pattern, options); this._didRealPath = false; var n = this.minimatch.set.length; this.matches = new Array(n); if (typeof cb === "function") { cb = once(cb); this.on("error", cb); this.on("end", function(matches) { cb(null, matches); }); } var self2 = this; this._processing = 0; this._emitQueue = []; this._processQueue = []; this.paused = false; if (this.noprocess) return this; if (n === 0) return done(); var sync = true; for (var i = 0; i < n; i++) { this._process(this.minimatch.set[i], i, false, done); } sync = false; function done() { --self2._processing; if (self2._processing <= 0) { if (sync) { process.nextTick(function() { self2._finish(); }); } else { self2._finish(); } } } } Glob.prototype._finish = function() { assert2(this instanceof Glob); if (this.aborted) return; if (this.realpath && !this._didRealpath) return this._realpath(); common.finish(this); this.emit("end", this.found); }; Glob.prototype._realpath = function() { if (this._didRealpath) return; this._didRealpath = true; var n = this.matches.length; if (n === 0) return this._finish(); var self2 = this; for (var i = 0; i < this.matches.length; i++) this._realpathSet(i, next); function next() { if (--n === 0) self2._finish(); } }; Glob.prototype._realpathSet = function(index, cb) { var matchset = this.matches[index]; if (!matchset) return cb(); var found = Object.keys(matchset); var self2 = this; var n = found.length; if (n === 0) return cb(); var set = this.matches[index] = /* @__PURE__ */ Object.create(null); found.forEach(function(p, i) { p = self2._makeAbs(p); rp.realpath(p, self2.realpathCache, function(er, real) { if (!er) set[real] = true; else if (er.syscall === "stat") set[p] = true; else self2.emit("error", er); if (--n === 0) { self2.matches[index] = set; cb(); } }); }); }; Glob.prototype._mark = function(p) { return common.mark(this, p); }; Glob.prototype._makeAbs = function(f) { return common.makeAbs(this, f); }; Glob.prototype.abort = function() { this.aborted = true; this.emit("abort"); }; Glob.prototype.pause = function() { if (!this.paused) { this.paused = true; this.emit("pause"); } }; Glob.prototype.resume = function() { if (this.paused) { this.emit("resume"); this.paused = false; if (this._emitQueue.length) { var eq = this._emitQueue.slice(0); this._emitQueue.length = 0; for (var i = 0; i < eq.length; i++) { var e = eq[i]; this._emitMatch(e[0], e[1]); } } if (this._processQueue.length) { var pq = this._processQueue.slice(0); this._processQueue.length = 0; for (var i = 0; i < pq.length; i++) { var p = pq[i]; this._processing--; this._process(p[0], p[1], p[2], p[3]); } } } }; Glob.prototype._process = function(pattern, index, inGlobStar, cb) { assert2(this instanceof Glob); assert2(typeof cb === "function"); if (this.aborted) return; this._processing++; if (this.paused) { this._processQueue.push([pattern, index, inGlobStar, cb]); return; } var n = 0; while (typeof pattern[n] === "string") { n++; } var prefix; switch (n) { case pattern.length: this._processSimple(pattern.join("/"), index, cb); return; case 0: prefix = null; break; default: prefix = pattern.slice(0, n).join("/"); break; } var remain = pattern.slice(n); var read; if (prefix === null) read = "."; else if (isAbsolute(prefix) || isAbsolute(pattern.join("/"))) { if (!prefix || !isAbsolute(prefix)) prefix = "/" + prefix; read = prefix; } else read = prefix; var abs = this._makeAbs(read); if (childrenIgnored(this, read)) return cb(); var isGlobStar = remain[0] === minimatch.GLOBSTAR; if (isGlobStar) this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb); else this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb); }; Glob.prototype._processReaddir = function(prefix, read, abs, remain, index, inGlobStar, cb) { var self2 = this; this._readdir(abs, inGlobStar, function(er, entries) { return self2._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb); }); }; Glob.prototype._processReaddir2 = function(prefix, read, abs, remain, index, inGlobStar, entries, cb) { if (!entries) return cb(); var pn = remain[0]; var negate = !!this.minimatch.negate; var rawGlob = pn._glob; var dotOk = this.dot || rawGlob.charAt(0) === "."; var matchedEntries = []; for (var i = 0; i < entries.length; i++) { var e = entries[i]; if (e.charAt(0) !== "." || dotOk) { var m; if (negate && !prefix) { m = !e.match(pn); } else { m = e.match(pn); } if (m) matchedEntries.push(e); } } var len = matchedEntries.length; if (len === 0) return cb(); if (remain.length === 1 && !this.mark && !this.stat) { if (!this.matches[index]) this.matches[index] = /* @__PURE__ */ Object.create(null); for (var i = 0; i < len; i++) { var e = matchedEntries[i]; if (prefix) { if (prefix !== "/") e = prefix + "/" + e; else e = prefix + e; } if (e.charAt(0) === "/" && !this.nomount) { e = path.join(this.root, e); } this._emitMatch(index, e); } return cb(); } remain.shift(); for (var i = 0; i < len; i++) { var e = matchedEntries[i]; var newPattern; if (prefix) { if (prefix !== "/") e = prefix + "/" + e; else e = prefix + e; } this._process([e].concat(remain), index, inGlobStar, cb); } cb(); }; Glob.prototype._emitMatch = function(index, e) { if (this.aborted) return; if (isIgnored(this, e)) return; if (this.paused) { this._emitQueue.push([index, e]); return; } var abs = isAbsolute(e) ? e : this._makeAbs(e); if (this.mark) e = this._mark(e); if (this.absolute) e = abs; if (this.matches[index][e]) return; if (this.nodir) { var c = this.cache[abs]; if (c === "DIR" || Array.isArray(c)) return; } this.matches[index][e] = true; var st = this.statCache[abs]; if (st) this.emit("stat", e, st); this.emit("match", e); }; Glob.prototype._readdirInGlobStar = function(abs, cb) { if (this.aborted) return; if (this.follow) return this._readdir(abs, false, cb); var lstatkey = "lstat\0" + abs; var self2 = this; var lstatcb = inflight(lstatkey, lstatcb_); if (lstatcb) fs2.lstat(abs, lstatcb); function lstatcb_(er, lstat2) { if (er && er.code === "ENOENT") return cb(); var isSym = lstat2 && lstat2.isSymbolicLink(); self2.symlinks[abs] = isSym; if (!isSym && lstat2 && !lstat2.isDirectory()) { self2.cache[abs] = "FILE"; cb(); } else self2._readdir(abs, false, cb); } }; Glob.prototype._readdir = function(abs, inGlobStar, cb) { if (this.aborted) return; cb = inflight("readdir\0" + abs + "\0" + inGlobStar, cb); if (!cb) return; if (inGlobStar && !ownProp(this.symlinks, abs)) return this._readdirInGlobStar(abs, cb); if (ownProp(this.cache, abs)) { var c = this.cache[abs]; if (!c || c === "FILE") return cb(); if (Array.isArray(c)) return cb(null, c); } var self2 = this; fs2.readdir(abs, readdirCb(this, abs, cb)); }; function readdirCb(self2, abs, cb) { return function(er, entries) { if (er) self2._readdirError(abs, er, cb); else self2._readdirEntries(abs, entries, cb); }; } Glob.prototype._readdirEntries = function(abs, entries, cb) { if (this.aborted) return; if (!this.mark && !this.stat) { for (var i = 0; i < entries.length; i++) { var e = entries[i]; if (abs === "/") e = abs + e; else e = abs + "/" + e; this.cache[e] = true; } } this.cache[abs] = entries; return cb(null, entries); }; Glob.prototype._readdirError = function(f, er, cb) { if (this.aborted) return; switch (er.code) { case "ENOTSUP": case "ENOTDIR": var abs = this._makeAbs(f); this.cache[abs] = "FILE"; if (abs === this.cwdAbs) { var error2 = new Error(er.code + " invalid cwd " + this.cwd); error2.path = this.cwd; error2.code = er.code; this.emit("error", error2); this.abort(); } break; case "ENOENT": case "ELOOP": case "ENAMETOOLONG": case "UNKNOWN": this.cache[this._makeAbs(f)] = false; break; default: this.cache[this._makeAbs(f)] = false; if (this.strict) { this.emit("error", er); this.abort(); } if (!this.silent) console.error("glob error", er); break; } return cb(); }; Glob.prototype._processGlobStar = function(prefix, read, abs, remain, index, inGlobStar, cb) { var self2 = this; this._readdir(abs, inGlobStar, function(er, entries) { self2._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb); }); }; Glob.prototype._processGlobStar2 = function(prefix, read, abs, remain, index, inGlobStar, entries, cb) { if (!entries) return cb(); var remainWithoutGlobStar = remain.slice(1); var gspref = prefix ? [prefix] : []; var noGlobStar = gspref.concat(remainWithoutGlobStar); this._process(noGlobStar, index, false, cb); var isSym = this.symlinks[abs]; var len = entries.length; if (isSym && inGlobStar) return cb(); for (var i = 0; i < len; i++) { var e = entries[i]; if (e.charAt(0) === "." && !this.dot) continue; var instead = gspref.concat(entries[i], remainWithoutGlobStar); this._process(instead, index, true, cb); var below = gspref.concat(entries[i], remain); this._process(below, index, true, cb); } cb(); }; Glob.prototype._processSimple = function(prefix, index, cb) { var self2 = this; this._stat(prefix, function(er, exists2) { self2._processSimple2(prefix, index, er, exists2, cb); }); }; Glob.prototype._processSimple2 = function(prefix, index, er, exists2, cb) { if (!this.matches[index]) this.matches[index] = /* @__PURE__ */ Object.create(null); if (!exists2) return cb(); if (prefix && isAbsolute(prefix) && !this.nomount) { var trail = /[\/\\]$/.test(prefix); if (prefix.charAt(0) === "/") { prefix = path.join(this.root, prefix); } else { prefix = path.resolve(this.root, prefix); if (trail) prefix += "/"; } } if (process.platform === "win32") prefix = prefix.replace(/\\/g, "/"); this._emitMatch(index, prefix); cb(); }; Glob.prototype._stat = function(f, cb) { var abs = this._makeAbs(f); var needDir = f.slice(-1) === "/"; if (f.length > this.maxLength) return cb(); if (!this.stat && ownProp(this.cache, abs)) { var c = this.cache[abs]; if (Array.isArray(c)) c = "DIR"; if (!needDir || c === "DIR") return cb(null, c); if (needDir && c === "FILE") return cb(); } var exists2; var stat2 = this.statCache[abs]; if (stat2 !== void 0) { if (stat2 === false) return cb(null, stat2); else { var type = stat2.isDirectory() ? "DIR" : "FILE"; if (needDir && type === "FILE") return cb(); else return cb(null, type, stat2); } } var self2 = this; var statcb = inflight("stat\0" + abs, lstatcb_); if (statcb) fs2.lstat(abs, statcb); function lstatcb_(er, lstat2) { if (lstat2 && lstat2.isSymbolicLink()) { return fs2.stat(abs, function(er2, stat3) { if (er2) self2._stat2(f, abs, null, lstat2, cb); else self2._stat2(f, abs, er2, stat3, cb); }); } else { self2._stat2(f, abs, er, lstat2, cb); } } }; Glob.prototype._stat2 = function(f, abs, er, stat2, cb) { if (er && (er.code === "ENOENT" || er.code === "ENOTDIR")) { this.statCache[abs] = false; return cb(); } var needDir = f.slice(-1) === "/"; this.statCache[abs] = stat2; if (abs.slice(-1) === "/" && stat2 && !stat2.isDirectory()) return cb(null, false, stat2); var c = true; if (stat2) c = stat2.isDirectory() ? "DIR" : "FILE"; this.cache[abs] = this.cache[abs] || c; if (needDir && c === "FILE") return cb(); return cb(null, c, stat2); }; }, /* 76 */ /***/ function(module2, exports2, __webpack_require__) { "use strict"; function posix(path) { return path.charAt(0) === "/"; } function win32(path) { var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; var result = splitDeviceRe.exec(path); var device = result[1] || ""; var isUnc = Boolean(device && device.charAt(1) !== ":"); return Boolean(result[2] || isUnc); } module2.exports = process.platform === "win32" ? win32 : posix; module2.exports.posix = posix; module2.exports.win32 = win32; }, , , /* 79 */ /***/ function(module2, exports2) { module2.exports = __require("tty"); }, , /* 81 */ /***/ function(module2, exports2, __webpack_require__) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.default = function(str, fileLoc = "lockfile") { str = (0, (_stripBom || _load_stripBom()).default)(str); return hasMergeConflicts(str) ? parseWithConflict(str, fileLoc) : { type: "success", object: parse3(str, fileLoc) }; }; var _util; function _load_util() { return _util = _interopRequireDefault(__webpack_require__(2)); } var _invariant; function _load_invariant() { return _invariant = _interopRequireDefault(__webpack_require__(7)); } var _stripBom; function _load_stripBom() { return _stripBom = _interopRequireDefault(__webpack_require__(122)); } var _constants; function _load_constants() { return _constants = __webpack_require__(6); } var _errors; function _load_errors() { return _errors = __webpack_require__(4); } var _map; function _load_map() { return _map = _interopRequireDefault(__webpack_require__(20)); } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } const VERSION_REGEX = /^yarn lockfile v(\d+)$/; const TOKEN_TYPES = { boolean: "BOOLEAN", string: "STRING", identifier: "IDENTIFIER", eof: "EOF", colon: "COLON", newline: "NEWLINE", comment: "COMMENT", indent: "INDENT", invalid: "INVALID", number: "NUMBER", comma: "COMMA" }; const VALID_PROP_VALUE_TOKENS = [TOKEN_TYPES.boolean, TOKEN_TYPES.string, TOKEN_TYPES.number]; function isValidPropValueToken(token) { return VALID_PROP_VALUE_TOKENS.indexOf(token.type) >= 0; } function* tokenise(input) { let lastNewline = false; let line = 1; let col = 0; function buildToken(type, value) { return { line, col, type, value }; } while (input.length) { let chop = 0; if (input[0] === "\n" || input[0] === "\r") { chop++; if (input[1] === "\n") { chop++; } line++; col = 0; yield buildToken(TOKEN_TYPES.newline); } else if (input[0] === "#") { chop++; let val = ""; while (input[chop] !== "\n") { val += input[chop]; chop++; } yield buildToken(TOKEN_TYPES.comment, val); } else if (input[0] === " ") { if (lastNewline) { let indent = ""; for (let i = 0; input[i] === " "; i++) { indent += input[i]; } if (indent.length % 2) { throw new TypeError("Invalid number of spaces"); } else { chop = indent.length; yield buildToken(TOKEN_TYPES.indent, indent.length / 2); } } else { chop++; } } else if (input[0] === '"') { let val = ""; for (let i = 0; ; i++) { const currentChar = input[i]; val += currentChar; if (i > 0 && currentChar === '"') { const isEscaped = input[i - 1] === "\\" && input[i - 2] !== "\\"; if (!isEscaped) { break; } } } chop = val.length; try { yield buildToken(TOKEN_TYPES.string, JSON.parse(val)); } catch (err) { if (err instanceof SyntaxError) { yield buildToken(TOKEN_TYPES.invalid); } else { throw err; } } } else if (/^[0-9]/.test(input)) { let val = ""; for (let i = 0; /^[0-9]$/.test(input[i]); i++) { val += input[i]; } chop = val.length; yield buildToken(TOKEN_TYPES.number, +val); } else if (/^true/.test(input)) { yield buildToken(TOKEN_TYPES.boolean, true); chop = 4; } else if (/^false/.test(input)) { yield buildToken(TOKEN_TYPES.boolean, false); chop = 5; } else if (input[0] === ":") { yield buildToken(TOKEN_TYPES.colon); chop++; } else if (input[0] === ",") { yield buildToken(TOKEN_TYPES.comma); chop++; } else if (/^[a-zA-Z\/-]/g.test(input)) { let name = ""; for (let i = 0; i < input.length; i++) { const char = input[i]; if (char === ":" || char === " " || char === "\n" || char === "\r" || char === ",") { break; } else { name += char; } } chop = name.length; yield buildToken(TOKEN_TYPES.string, name); } else { yield buildToken(TOKEN_TYPES.invalid); } if (!chop) { yield buildToken(TOKEN_TYPES.invalid); } col += chop; lastNewline = input[0] === "\n" || input[0] === "\r" && input[1] === "\n"; input = input.slice(chop); } yield buildToken(TOKEN_TYPES.eof); } class Parser2 { constructor(input, fileLoc = "lockfile") { this.comments = []; this.tokens = tokenise(input); this.fileLoc = fileLoc; } onComment(token) { const value = token.value; (0, (_invariant || _load_invariant()).default)(typeof value === "string", "expected token value to be a string"); const comment = value.trim(); const versionMatch = comment.match(VERSION_REGEX); if (versionMatch) { const version = +versionMatch[1]; if (version > (_constants || _load_constants()).LOCKFILE_VERSION) { throw new (_errors || _load_errors()).MessageError(`Can't install from a lockfile of version ${version} as you're on an old yarn version that only supports versions up to ${(_constants || _load_constants()).LOCKFILE_VERSION}. Run \`$ yarn self-update\` to upgrade to the latest version.`); } } this.comments.push(comment); } next() { const item = this.tokens.next(); (0, (_invariant || _load_invariant()).default)(item, "expected a token"); const done = item.done, value = item.value; if (done || !value) { throw new Error("No more tokens"); } else if (value.type === TOKEN_TYPES.comment) { this.onComment(value); return this.next(); } else { return this.token = value; } } unexpected(msg = "Unexpected token") { throw new SyntaxError(`${msg} ${this.token.line}:${this.token.col} in ${this.fileLoc}`); } expect(tokType) { if (this.token.type === tokType) { this.next(); } else { this.unexpected(); } } eat(tokType) { if (this.token.type === tokType) { this.next(); return true; } else { return false; } } parse(indent = 0) { const obj = (0, (_map || _load_map()).default)(); while (true) { const propToken = this.token; if (propToken.type === TOKEN_TYPES.newline) { const nextToken = this.next(); if (!indent) { continue; } if (nextToken.type !== TOKEN_TYPES.indent) { break; } if (nextToken.value === indent) { this.next(); } else { break; } } else if (propToken.type === TOKEN_TYPES.indent) { if (propToken.value === indent) { this.next(); } else { break; } } else if (propToken.type === TOKEN_TYPES.eof) { break; } else if (propToken.type === TOKEN_TYPES.string) { const key = propToken.value; (0, (_invariant || _load_invariant()).default)(key, "Expected a key"); const keys = [key]; this.next(); while (this.token.type === TOKEN_TYPES.comma) { this.next(); const keyToken = this.token; if (keyToken.type !== TOKEN_TYPES.string) { this.unexpected("Expected string"); } const key2 = keyToken.value; (0, (_invariant || _load_invariant()).default)(key2, "Expected a key"); keys.push(key2); this.next(); } const valToken = this.token; if (valToken.type === TOKEN_TYPES.colon) { this.next(); const val = this.parse(indent + 1); for (var _iterator = keys, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator](); ; ) { var _ref; if (_isArray) { if (_i >= _iterator.length) break; _ref = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref = _i.value; } const key2 = _ref; obj[key2] = val; } if (indent && this.token.type !== TOKEN_TYPES.indent) { break; } } else if (isValidPropValueToken(valToken)) { for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator](); ; ) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } const key2 = _ref2; obj[key2] = valToken.value; } this.next(); } else { this.unexpected("Invalid value type"); } } else { this.unexpected(`Unknown token: ${(_util || _load_util()).default.inspect(propToken)}`); } } return obj; } } const MERGE_CONFLICT_ANCESTOR = "|||||||"; const MERGE_CONFLICT_END = ">>>>>>>"; const MERGE_CONFLICT_SEP = "======="; const MERGE_CONFLICT_START = "<<<<<<<"; function extractConflictVariants(str) { const variants = [[], []]; const lines = str.split(/\r?\n/g); let skip = false; while (lines.length) { const line = lines.shift(); if (line.startsWith(MERGE_CONFLICT_START)) { while (lines.length) { const conflictLine = lines.shift(); if (conflictLine === MERGE_CONFLICT_SEP) { skip = false; break; } else if (skip || conflictLine.startsWith(MERGE_CONFLICT_ANCESTOR)) { skip = true; continue; } else { variants[0].push(conflictLine); } } while (lines.length) { const conflictLine = lines.shift(); if (conflictLine.startsWith(MERGE_CONFLICT_END)) { break; } else { variants[1].push(conflictLine); } } } else { variants[0].push(line); variants[1].push(line); } } return [variants[0].join("\n"), variants[1].join("\n")]; } function hasMergeConflicts(str) { return str.includes(MERGE_CONFLICT_START) && str.includes(MERGE_CONFLICT_SEP) && str.includes(MERGE_CONFLICT_END); } function parse3(str, fileLoc) { const parser2 = new Parser2(str, fileLoc); parser2.next(); return parser2.parse(); } function parseWithConflict(str, fileLoc) { const variants = extractConflictVariants(str); try { return { type: "merge", object: Object.assign({}, parse3(variants[0], fileLoc), parse3(variants[1], fileLoc)) }; } catch (err) { if (err instanceof SyntaxError) { return { type: "conflict", object: {} }; } else { throw err; } } } }, , , /* 84 */ /***/ function(module2, exports2, __webpack_require__) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var _map; function _load_map() { return _map = _interopRequireDefault(__webpack_require__(20)); } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } const debug2 = __webpack_require__(212)("yarn"); class BlockingQueue { constructor(alias, maxConcurrency = Infinity) { this.concurrencyQueue = []; this.maxConcurrency = maxConcurrency; this.runningCount = 0; this.warnedStuck = false; this.alias = alias; this.first = true; this.running = (0, (_map || _load_map()).default)(); this.queue = (0, (_map || _load_map()).default)(); this.stuckTick = this.stuckTick.bind(this); } stillActive() { if (this.stuckTimer) { clearTimeout(this.stuckTimer); } this.stuckTimer = setTimeout(this.stuckTick, 5e3); this.stuckTimer.unref && this.stuckTimer.unref(); } stuckTick() { if (this.runningCount === 1) { this.warnedStuck = true; debug2(`The ${JSON.stringify(this.alias)} blocking queue may be stuck. 5 seconds without any activity with 1 worker: ${Object.keys(this.running)[0]}`); } } push(key, factory) { if (this.first) { this.first = false; } else { this.stillActive(); } return new Promise((resolve5, reject) => { const queue = this.queue[key] = this.queue[key] || []; queue.push({ factory, resolve: resolve5, reject }); if (!this.running[key]) { this.shift(key); } }); } shift(key) { if (this.running[key]) { delete this.running[key]; this.runningCount--; if (this.stuckTimer) { clearTimeout(this.stuckTimer); this.stuckTimer = null; } if (this.warnedStuck) { this.warnedStuck = false; debug2(`${JSON.stringify(this.alias)} blocking queue finally resolved. Nothing to worry about.`); } } const queue = this.queue[key]; if (!queue) { return; } var _queue$shift = queue.shift(); const resolve5 = _queue$shift.resolve, reject = _queue$shift.reject, factory = _queue$shift.factory; if (!queue.length) { delete this.queue[key]; } const next = () => { this.shift(key); this.shiftConcurrencyQueue(); }; const run = () => { this.running[key] = true; this.runningCount++; factory().then(function(val) { resolve5(val); next(); return null; }).catch(function(err) { reject(err); next(); }); }; this.maybePushConcurrencyQueue(run); } maybePushConcurrencyQueue(run) { if (this.runningCount < this.maxConcurrency) { run(); } else { this.concurrencyQueue.push(run); } } shiftConcurrencyQueue() { if (this.runningCount < this.maxConcurrency) { const fn = this.concurrencyQueue.shift(); if (fn) { fn(); } } } } exports2.default = BlockingQueue; }, /* 85 */ /***/ function(module2, exports2) { module2.exports = function(exec2) { try { return !!exec2(); } catch (e) { return true; } }; }, , , , , , , , , , , , , , , /* 100 */ /***/ function(module2, exports2, __webpack_require__) { var cof = __webpack_require__(47); var TAG = __webpack_require__(13)("toStringTag"); var ARG = cof(/* @__PURE__ */ function() { return arguments; }()) == "Arguments"; var tryGet = function(it, key) { try { return it[key]; } catch (e) { } }; module2.exports = function(it) { var O, T, B; return it === void 0 ? "Undefined" : it === null ? "Null" : typeof (T = tryGet(O = Object(it), TAG)) == "string" ? T : ARG ? cof(O) : (B = cof(O)) == "Object" && typeof O.callee == "function" ? "Arguments" : B; }; }, /* 101 */ /***/ function(module2, exports2) { module2.exports = "constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","); }, /* 102 */ /***/ function(module2, exports2, __webpack_require__) { var document2 = __webpack_require__(11).document; module2.exports = document2 && document2.documentElement; }, /* 103 */ /***/ function(module2, exports2, __webpack_require__) { "use strict"; var LIBRARY = __webpack_require__(69); var $export = __webpack_require__(41); var redefine = __webpack_require__(197); var hide = __webpack_require__(31); var Iterators = __webpack_require__(35); var $iterCreate = __webpack_require__(188); var setToStringTag = __webpack_require__(71); var getPrototypeOf = __webpack_require__(194); var ITERATOR = __webpack_require__(13)("iterator"); var BUGGY = !([].keys && "next" in [].keys()); var FF_ITERATOR = "@@iterator"; var KEYS = "keys"; var VALUES = "values"; var returnThis = function() { return this; }; module2.exports = function(Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) { $iterCreate(Constructor, NAME, next); var getMethod = function(kind) { if (!BUGGY && kind in proto) return proto[kind]; switch (kind) { case KEYS: return function keys() { return new Constructor(this, kind); }; case VALUES: return function values() { return new Constructor(this, kind); }; } return function entries() { return new Constructor(this, kind); }; }; var TAG = NAME + " Iterator"; var DEF_VALUES = DEFAULT == VALUES; var VALUES_BUG = false; var proto = Base.prototype; var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT]; var $default = $native || getMethod(DEFAULT); var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod("entries") : void 0; var $anyNative = NAME == "Array" ? proto.entries || $native : $native; var methods, key, IteratorPrototype; if ($anyNative) { IteratorPrototype = getPrototypeOf($anyNative.call(new Base())); if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) { setToStringTag(IteratorPrototype, TAG, true); if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != "function") hide(IteratorPrototype, ITERATOR, returnThis); } } if (DEF_VALUES && $native && $native.name !== VALUES) { VALUES_BUG = true; $default = function values() { return $native.call(this); }; } if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) { hide(proto, ITERATOR, $default); } Iterators[NAME] = $default; Iterators[TAG] = returnThis; if (DEFAULT) { methods = { values: DEF_VALUES ? $default : getMethod(VALUES), keys: IS_SET ? $default : getMethod(KEYS), entries: $entries }; if (FORCED) for (key in methods) { if (!(key in proto)) redefine(proto, key, methods[key]); } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods); } return methods; }; }, /* 104 */ /***/ function(module2, exports2) { module2.exports = function(exec2) { try { return { e: false, v: exec2() }; } catch (e) { return { e: true, v: e }; } }; }, /* 105 */ /***/ function(module2, exports2, __webpack_require__) { var anObject = __webpack_require__(27); var isObject = __webpack_require__(34); var newPromiseCapability = __webpack_require__(70); module2.exports = function(C, x) { anObject(C); if (isObject(x) && x.constructor === C) return x; var promiseCapability = newPromiseCapability.f(C); var resolve5 = promiseCapability.resolve; resolve5(x); return promiseCapability.promise; }; }, /* 106 */ /***/ function(module2, exports2) { module2.exports = function(bitmap, value) { return { enumerable: !(bitmap & 1), configurable: !(bitmap & 2), writable: !(bitmap & 4), value }; }; }, /* 107 */ /***/ function(module2, exports2, __webpack_require__) { var core = __webpack_require__(23); var global = __webpack_require__(11); var SHARED = "__core-js_shared__"; var store = global[SHARED] || (global[SHARED] = {}); (module2.exports = function(key, value) { return store[key] || (store[key] = value !== void 0 ? value : {}); })("versions", []).push({ version: core.version, mode: __webpack_require__(69) ? "pure" : "global", copyright: "\xA9 2018 Denis Pushkarev (zloirock.ru)" }); }, /* 108 */ /***/ function(module2, exports2, __webpack_require__) { var anObject = __webpack_require__(27); var aFunction = __webpack_require__(46); var SPECIES = __webpack_require__(13)("species"); module2.exports = function(O, D) { var C = anObject(O).constructor; var S; return C === void 0 || (S = anObject(C)[SPECIES]) == void 0 ? D : aFunction(S); }; }, /* 109 */ /***/ function(module2, exports2, __webpack_require__) { var ctx = __webpack_require__(48); var invoke = __webpack_require__(185); var html = __webpack_require__(102); var cel = __webpack_require__(68); var global = __webpack_require__(11); var process3 = global.process; var setTask = global.setImmediate; var clearTask = global.clearImmediate; var MessageChannel = global.MessageChannel; var Dispatch = global.Dispatch; var counter = 0; var queue = {}; var ONREADYSTATECHANGE = "onreadystatechange"; var defer, channel, port; var run = function() { var id = +this; if (queue.hasOwnProperty(id)) { var fn = queue[id]; delete queue[id]; fn(); } }; var listener = function(event) { run.call(event.data); }; if (!setTask || !clearTask) { setTask = function setImmediate(fn) { var args = []; var i = 1; while (arguments.length > i) args.push(arguments[i++]); queue[++counter] = function() { invoke(typeof fn == "function" ? fn : Function(fn), args); }; defer(counter); return counter; }; clearTask = function clearImmediate(id) { delete queue[id]; }; if (__webpack_require__(47)(process3) == "process") { defer = function(id) { process3.nextTick(ctx(run, id, 1)); }; } else if (Dispatch && Dispatch.now) { defer = function(id) { Dispatch.now(ctx(run, id, 1)); }; } else if (MessageChannel) { channel = new MessageChannel(); port = channel.port2; channel.port1.onmessage = listener; defer = ctx(port.postMessage, port, 1); } else if (global.addEventListener && typeof postMessage == "function" && !global.importScripts) { defer = function(id) { global.postMessage(id + "", "*"); }; global.addEventListener("message", listener, false); } else if (ONREADYSTATECHANGE in cel("script")) { defer = function(id) { html.appendChild(cel("script"))[ONREADYSTATECHANGE] = function() { html.removeChild(this); run.call(id); }; }; } else { defer = function(id) { setTimeout(ctx(run, id, 1), 0); }; } } module2.exports = { set: setTask, clear: clearTask }; }, /* 110 */ /***/ function(module2, exports2, __webpack_require__) { var toInteger = __webpack_require__(73); var min = Math.min; module2.exports = function(it) { return it > 0 ? min(toInteger(it), 9007199254740991) : 0; }; }, /* 111 */ /***/ function(module2, exports2) { var id = 0; var px = Math.random(); module2.exports = function(key) { return "Symbol(".concat(key === void 0 ? "" : key, ")_", (++id + px).toString(36)); }; }, /* 112 */ /***/ function(module2, exports2, __webpack_require__) { exports2 = module2.exports = createDebug.debug = createDebug["default"] = createDebug; exports2.coerce = coerce; exports2.disable = disable; exports2.enable = enable; exports2.enabled = enabled; exports2.humanize = __webpack_require__(229); exports2.instances = []; exports2.names = []; exports2.skips = []; exports2.formatters = {}; function selectColor(namespace) { var hash = 0, i; for (i in namespace) { hash = (hash << 5) - hash + namespace.charCodeAt(i); hash |= 0; } return exports2.colors[Math.abs(hash) % exports2.colors.length]; } function createDebug(namespace) { var prevTime; function debug2() { if (!debug2.enabled) return; var self2 = debug2; var curr = +/* @__PURE__ */ new Date(); var ms = curr - (prevTime || curr); self2.diff = ms; self2.prev = prevTime; self2.curr = curr; prevTime = curr; var args = new Array(arguments.length); for (var i = 0; i < args.length; i++) { args[i] = arguments[i]; } args[0] = exports2.coerce(args[0]); if ("string" !== typeof args[0]) { args.unshift("%O"); } var index = 0; args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format3) { if (match === "%%") return match; index++; var formatter = exports2.formatters[format3]; if ("function" === typeof formatter) { var val = args[index]; match = formatter.call(self2, val); args.splice(index, 1); index--; } return match; }); exports2.formatArgs.call(self2, args); var logFn = debug2.log || exports2.log || console.log.bind(console); logFn.apply(self2, args); } debug2.namespace = namespace; debug2.enabled = exports2.enabled(namespace); debug2.useColors = exports2.useColors(); debug2.color = selectColor(namespace); debug2.destroy = destroy; if ("function" === typeof exports2.init) { exports2.init(debug2); } exports2.instances.push(debug2); return debug2; } function destroy() { var index = exports2.instances.indexOf(this); if (index !== -1) { exports2.instances.splice(index, 1); return true; } else { return false; } } function enable(namespaces) { exports2.save(namespaces); exports2.names = []; exports2.skips = []; var i; var split = (typeof namespaces === "string" ? namespaces : "").split(/[\s,]+/); var len = split.length; for (i = 0; i < len; i++) { if (!split[i]) continue; namespaces = split[i].replace(/\*/g, ".*?"); if (namespaces[0] === "-") { exports2.skips.push(new RegExp("^" + namespaces.substr(1) + "$")); } else { exports2.names.push(new RegExp("^" + namespaces + "$")); } } for (i = 0; i < exports2.instances.length; i++) { var instance = exports2.instances[i]; instance.enabled = exports2.enabled(instance.namespace); } } function disable() { exports2.enable(""); } function enabled(name) { if (name[name.length - 1] === "*") { return true; } var i, len; for (i = 0, len = exports2.skips.length; i < len; i++) { if (exports2.skips[i].test(name)) { return false; } } for (i = 0, len = exports2.names.length; i < len; i++) { if (exports2.names[i].test(name)) { return true; } } return false; } function coerce(val) { if (val instanceof Error) return val.stack || val.message; return val; } }, , /* 114 */ /***/ function(module2, exports2, __webpack_require__) { module2.exports = realpath; realpath.realpath = realpath; realpath.sync = realpathSync; realpath.realpathSync = realpathSync; realpath.monkeypatch = monkeypatch; realpath.unmonkeypatch = unmonkeypatch; var fs2 = __webpack_require__(3); var origRealpath = fs2.realpath; var origRealpathSync = fs2.realpathSync; var version = process.version; var ok = /^v[0-5]\./.test(version); var old = __webpack_require__(217); function newError(er) { return er && er.syscall === "realpath" && (er.code === "ELOOP" || er.code === "ENOMEM" || er.code === "ENAMETOOLONG"); } function realpath(p, cache, cb) { if (ok) { return origRealpath(p, cache, cb); } if (typeof cache === "function") { cb = cache; cache = null; } origRealpath(p, cache, function(er, result) { if (newError(er)) { old.realpath(p, cache, cb); } else { cb(er, result); } }); } function realpathSync(p, cache) { if (ok) { return origRealpathSync(p, cache); } try { return origRealpathSync(p, cache); } catch (er) { if (newError(er)) { return old.realpathSync(p, cache); } else { throw er; } } } function monkeypatch() { fs2.realpath = realpath; fs2.realpathSync = realpathSync; } function unmonkeypatch() { fs2.realpath = origRealpath; fs2.realpathSync = origRealpathSync; } }, /* 115 */ /***/ function(module2, exports2, __webpack_require__) { exports2.alphasort = alphasort; exports2.alphasorti = alphasorti; exports2.setopts = setopts; exports2.ownProp = ownProp; exports2.makeAbs = makeAbs; exports2.finish = finish; exports2.mark = mark; exports2.isIgnored = isIgnored; exports2.childrenIgnored = childrenIgnored; function ownProp(obj, field) { return Object.prototype.hasOwnProperty.call(obj, field); } var path = __webpack_require__(0); var minimatch = __webpack_require__(60); var isAbsolute = __webpack_require__(76); var Minimatch = minimatch.Minimatch; function alphasorti(a, b) { return a.toLowerCase().localeCompare(b.toLowerCase()); } function alphasort(a, b) { return a.localeCompare(b); } function setupIgnores(self2, options) { self2.ignore = options.ignore || []; if (!Array.isArray(self2.ignore)) self2.ignore = [self2.ignore]; if (self2.ignore.length) { self2.ignore = self2.ignore.map(ignoreMap); } } function ignoreMap(pattern) { var gmatcher = null; if (pattern.slice(-3) === "/**") { var gpattern = pattern.replace(/(\/\*\*)+$/, ""); gmatcher = new Minimatch(gpattern, { dot: true }); } return { matcher: new Minimatch(pattern, { dot: true }), gmatcher }; } function setopts(self2, pattern, options) { if (!options) options = {}; if (options.matchBase && -1 === pattern.indexOf("/")) { if (options.noglobstar) { throw new Error("base matching requires globstar"); } pattern = "**/" + pattern; } self2.silent = !!options.silent; self2.pattern = pattern; self2.strict = options.strict !== false; self2.realpath = !!options.realpath; self2.realpathCache = options.realpathCache || /* @__PURE__ */ Object.create(null); self2.follow = !!options.follow; self2.dot = !!options.dot; self2.mark = !!options.mark; self2.nodir = !!options.nodir; if (self2.nodir) self2.mark = true; self2.sync = !!options.sync; self2.nounique = !!options.nounique; self2.nonull = !!options.nonull; self2.nosort = !!options.nosort; self2.nocase = !!options.nocase; self2.stat = !!options.stat; self2.noprocess = !!options.noprocess; self2.absolute = !!options.absolute; self2.maxLength = options.maxLength || Infinity; self2.cache = options.cache || /* @__PURE__ */ Object.create(null); self2.statCache = options.statCache || /* @__PURE__ */ Object.create(null); self2.symlinks = options.symlinks || /* @__PURE__ */ Object.create(null); setupIgnores(self2, options); self2.changedCwd = false; var cwd = process.cwd(); if (!ownProp(options, "cwd")) self2.cwd = cwd; else { self2.cwd = path.resolve(options.cwd); self2.changedCwd = self2.cwd !== cwd; } self2.root = options.root || path.resolve(self2.cwd, "/"); self2.root = path.resolve(self2.root); if (process.platform === "win32") self2.root = self2.root.replace(/\\/g, "/"); self2.cwdAbs = isAbsolute(self2.cwd) ? self2.cwd : makeAbs(self2, self2.cwd); if (process.platform === "win32") self2.cwdAbs = self2.cwdAbs.replace(/\\/g, "/"); self2.nomount = !!options.nomount; options.nonegate = true; options.nocomment = true; self2.minimatch = new Minimatch(pattern, options); self2.options = self2.minimatch.options; } function finish(self2) { var nou = self2.nounique; var all = nou ? [] : /* @__PURE__ */ Object.create(null); for (var i = 0, l = self2.matches.length; i < l; i++) { var matches = self2.matches[i]; if (!matches || Object.keys(matches).length === 0) { if (self2.nonull) { var literal = self2.minimatch.globSet[i]; if (nou) all.push(literal); else all[literal] = true; } } else { var m = Object.keys(matches); if (nou) all.push.apply(all, m); else m.forEach(function(m2) { all[m2] = true; }); } } if (!nou) all = Object.keys(all); if (!self2.nosort) all = all.sort(self2.nocase ? alphasorti : alphasort); if (self2.mark) { for (var i = 0; i < all.length; i++) { all[i] = self2._mark(all[i]); } if (self2.nodir) { all = all.filter(function(e) { var notDir = !/\/$/.test(e); var c = self2.cache[e] || self2.cache[makeAbs(self2, e)]; if (notDir && c) notDir = c !== "DIR" && !Array.isArray(c); return notDir; }); } } if (self2.ignore.length) all = all.filter(function(m2) { return !isIgnored(self2, m2); }); self2.found = all; } function mark(self2, p) { var abs = makeAbs(self2, p); var c = self2.cache[abs]; var m = p; if (c) { var isDir = c === "DIR" || Array.isArray(c); var slash = p.slice(-1) === "/"; if (isDir && !slash) m += "/"; else if (!isDir && slash) m = m.slice(0, -1); if (m !== p) { var mabs = makeAbs(self2, m); self2.statCache[mabs] = self2.statCache[abs]; self2.cache[mabs] = self2.cache[abs]; } } return m; } function makeAbs(self2, f) { var abs = f; if (f.charAt(0) === "/") { abs = path.join(self2.root, f); } else if (isAbsolute(f) || f === "") { abs = f; } else if (self2.changedCwd) { abs = path.resolve(self2.cwd, f); } else { abs = path.resolve(f); } if (process.platform === "win32") abs = abs.replace(/\\/g, "/"); return abs; } function isIgnored(self2, path2) { if (!self2.ignore.length) return false; return self2.ignore.some(function(item) { return item.matcher.match(path2) || !!(item.gmatcher && item.gmatcher.match(path2)); }); } function childrenIgnored(self2, path2) { if (!self2.ignore.length) return false; return self2.ignore.some(function(item) { return !!(item.gmatcher && item.gmatcher.match(path2)); }); } }, /* 116 */ /***/ function(module2, exports2, __webpack_require__) { var path = __webpack_require__(0); var fs2 = __webpack_require__(3); var _0777 = parseInt("0777", 8); module2.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP; function mkdirP(p, opts, f, made) { if (typeof opts === "function") { f = opts; opts = {}; } else if (!opts || typeof opts !== "object") { opts = { mode: opts }; } var mode = opts.mode; var xfs = opts.fs || fs2; if (mode === void 0) { mode = _0777 & ~process.umask(); } if (!made) made = null; var cb = f || function() { }; p = path.resolve(p); xfs.mkdir(p, mode, function(er) { if (!er) { made = made || p; return cb(null, made); } switch (er.code) { case "ENOENT": mkdirP(path.dirname(p), opts, function(er2, made2) { if (er2) cb(er2, made2); else mkdirP(p, opts, cb, made2); }); break; default: xfs.stat(p, function(er2, stat2) { if (er2 || !stat2.isDirectory()) cb(er, made); else cb(null, made); }); break; } }); } mkdirP.sync = function sync(p, opts, made) { if (!opts || typeof opts !== "object") { opts = { mode: opts }; } var mode = opts.mode; var xfs = opts.fs || fs2; if (mode === void 0) { mode = _0777 & ~process.umask(); } if (!made) made = null; p = path.resolve(p); try { xfs.mkdirSync(p, mode); made = made || p; } catch (err0) { switch (err0.code) { case "ENOENT": made = sync(path.dirname(p), opts, made); sync(p, opts, made); break; default: var stat2; try { stat2 = xfs.statSync(p); } catch (err1) { throw err0; } if (!stat2.isDirectory()) throw err0; break; } } return made; }; }, , , , , , /* 122 */ /***/ function(module2, exports2, __webpack_require__) { "use strict"; module2.exports = (x) => { if (typeof x !== "string") { throw new TypeError("Expected a string, got " + typeof x); } if (x.charCodeAt(0) === 65279) { return x.slice(1); } return x; }; }, /* 123 */ /***/ function(module2, exports2) { module2.exports = wrappy; function wrappy(fn, cb) { if (fn && cb) return wrappy(fn)(cb); if (typeof fn !== "function") throw new TypeError("need wrapper function"); Object.keys(fn).forEach(function(k) { wrapper[k] = fn[k]; }); return wrapper; 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 cb2 = args[args.length - 1]; if (typeof ret === "function" && ret !== cb2) { Object.keys(cb2).forEach(function(k) { ret[k] = cb2[k]; }); } return ret; } } }, , , , , , , , /* 131 */ /***/ function(module2, exports2, __webpack_require__) { var cof = __webpack_require__(47); module2.exports = Object("z").propertyIsEnumerable(0) ? Object : function(it) { return cof(it) == "String" ? it.split("") : Object(it); }; }, /* 132 */ /***/ function(module2, exports2, __webpack_require__) { var $keys = __webpack_require__(195); var enumBugKeys = __webpack_require__(101); module2.exports = Object.keys || function keys(O) { return $keys(O, enumBugKeys); }; }, /* 133 */ /***/ function(module2, exports2, __webpack_require__) { var defined = __webpack_require__(67); module2.exports = function(it) { return Object(defined(it)); }; }, , , , , , , , , , , , /* 145 */ /***/ function(module2, exports2) { module2.exports = { "name": "yarn", "installationMethod": "unknown", "version": "1.10.0-0", "license": "BSD-2-Clause", "preferGlobal": true, "description": "\u{1F4E6}\u{1F408} Fast, reliable, and secure dependency management.", "dependencies": { "@zkochan/cmd-shim": "^2.2.4", "babel-runtime": "^6.26.0", "bytes": "^3.0.0", "camelcase": "^4.0.0", "chalk": "^2.1.0", "commander": "^2.9.0", "death": "^1.0.0", "debug": "^3.0.0", "deep-equal": "^1.0.1", "detect-indent": "^5.0.0", "dnscache": "^1.0.1", "glob": "^7.1.1", "gunzip-maybe": "^1.4.0", "hash-for-dep": "^1.2.3", "imports-loader": "^0.8.0", "ini": "^1.3.4", "inquirer": "^3.0.1", "invariant": "^2.2.0", "is-builtin-module": "^2.0.0", "is-ci": "^1.0.10", "is-webpack-bundle": "^1.0.0", "leven": "^2.0.0", "loud-rejection": "^1.2.0", "micromatch": "^2.3.11", "mkdirp": "^0.5.1", "node-emoji": "^1.6.1", "normalize-url": "^2.0.0", "npm-logical-tree": "^1.2.1", "object-path": "^0.11.2", "proper-lockfile": "^2.0.0", "puka": "^1.0.0", "read": "^1.0.7", "request": "^2.87.0", "request-capture-har": "^1.2.2", "rimraf": "^2.5.0", "semver": "^5.1.0", "ssri": "^5.3.0", "strip-ansi": "^4.0.0", "strip-bom": "^3.0.0", "tar-fs": "^1.16.0", "tar-stream": "^1.6.1", "uuid": "^3.0.1", "v8-compile-cache": "^2.0.0", "validate-npm-package-license": "^3.0.3", "yn": "^2.0.0" }, "devDependencies": { "babel-core": "^6.26.0", "babel-eslint": "^7.2.3", "babel-loader": "^6.2.5", "babel-plugin-array-includes": "^2.0.3", "babel-plugin-transform-builtin-extend": "^1.1.2", "babel-plugin-transform-inline-imports-commonjs": "^1.0.0", "babel-plugin-transform-runtime": "^6.4.3", "babel-preset-env": "^1.6.0", "babel-preset-flow": "^6.23.0", "babel-preset-stage-0": "^6.0.0", "babylon": "^6.5.0", "commitizen": "^2.9.6", "cz-conventional-changelog": "^2.0.0", "eslint": "^4.3.0", "eslint-config-fb-strict": "^22.0.0", "eslint-plugin-babel": "^5.0.0", "eslint-plugin-flowtype": "^2.35.0", "eslint-plugin-jasmine": "^2.6.2", "eslint-plugin-jest": "^21.0.0", "eslint-plugin-jsx-a11y": "^6.0.2", "eslint-plugin-prefer-object-spread": "^1.2.1", "eslint-plugin-prettier": "^2.1.2", "eslint-plugin-react": "^7.1.0", "eslint-plugin-relay": "^0.0.24", "eslint-plugin-yarn-internal": "file:scripts/eslint-rules", "execa": "^0.10.0", "flow-bin": "^0.66.0", "git-release-notes": "^3.0.0", "gulp": "^3.9.0", "gulp-babel": "^7.0.0", "gulp-if": "^2.0.1", "gulp-newer": "^1.0.0", "gulp-plumber": "^1.0.1", "gulp-sourcemaps": "^2.2.0", "gulp-util": "^3.0.7", "gulp-watch": "^5.0.0", "jest": "^22.4.4", "jsinspect": "^0.12.6", "minimatch": "^3.0.4", "mock-stdin": "^0.3.0", "prettier": "^1.5.2", "temp": "^0.8.3", "webpack": "^2.1.0-beta.25", "yargs": "^6.3.0" }, "resolutions": { "sshpk": "^1.14.2" }, "engines": { "node": ">=4.0.0" }, "repository": "yarnpkg/yarn", "bin": { "yarn": "./bin/yarn.js", "yarnpkg": "./bin/yarn.js" }, "scripts": { "build": "gulp build", "build-bundle": "node ./scripts/build-webpack.js", "build-chocolatey": "powershell ./scripts/build-chocolatey.ps1", "build-deb": "./scripts/build-deb.sh", "build-dist": "bash ./scripts/build-dist.sh", "build-win-installer": "scripts\\build-windows-installer.bat", "changelog": "git-release-notes $(git describe --tags --abbrev=0 $(git describe --tags --abbrev=0)^)..$(git describe --tags --abbrev=0) scripts/changelog.md", "dupe-check": "yarn jsinspect ./src", "lint": "eslint . && flow check", "pkg-tests": "yarn --cwd packages/pkg-tests jest yarn.test.js", "prettier": "eslint src __tests__ --fix", "release-branch": "./scripts/release-branch.sh", "test": "yarn lint && yarn test-only", "test-only": "node --max_old_space_size=4096 ", "test-only-debug": "node --inspect-brk --max_old_space_size=4096 ", "test-coverage": "node --max_old_space_size=4096 ", "watch": "gulp watch", "commit": "git-cz" }, "jest": { "collectCoverageFrom": ["src/**/*.js"], "testEnvironment": "node", "modulePathIgnorePatterns": ["__tests__/fixtures/", "packages/pkg-tests/pkg-tests-fixtures", "dist/"], "testPathIgnorePatterns": ["__tests__/(fixtures|__mocks__)/", "updates/", "_(temp|mock|install|init|helpers).js$", "packages/pkg-tests"] }, "config": { "commitizen": { "path": "./" } } }; }, , , , , /* 150 */ /***/ function(module2, exports2, __webpack_require__) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.default = stringify; var _misc; function _load_misc() { return _misc = __webpack_require__(12); } var _constants; function _load_constants() { return _constants = __webpack_require__(6); } var _package; function _load_package() { return _package = __webpack_require__(145); } const NODE_VERSION = process.version; function shouldWrapKey(str) { return str.indexOf("true") === 0 || str.indexOf("false") === 0 || /[:\s\n\\",\[\]]/g.test(str) || /^[0-9]/g.test(str) || !/^[a-zA-Z]/g.test(str); } function maybeWrap(str) { if (typeof str === "boolean" || typeof str === "number" || shouldWrapKey(str)) { return JSON.stringify(str); } else { return str; } } const priorities = { name: 1, version: 2, uid: 3, resolved: 4, integrity: 5, registry: 6, dependencies: 7 }; function priorityThenAlphaSort(a, b) { if (priorities[a] || priorities[b]) { return (priorities[a] || 100) > (priorities[b] || 100) ? 1 : -1; } else { return (0, (_misc || _load_misc()).sortAlpha)(a, b); } } function _stringify(obj, options) { if (typeof obj !== "object") { throw new TypeError(); } const indent = options.indent; const lines = []; const keys = Object.keys(obj).sort(priorityThenAlphaSort); let addedKeys = []; for (let i = 0; i < keys.length; i++) { const key = keys[i]; const val = obj[key]; if (val == null || addedKeys.indexOf(key) >= 0) { continue; } const valKeys = [key]; if (typeof val === "object") { for (let j = i + 1; j < keys.length; j++) { const key2 = keys[j]; if (val === obj[key2]) { valKeys.push(key2); } } } const keyLine = valKeys.sort((_misc || _load_misc()).sortAlpha).map(maybeWrap).join(", "); if (typeof val === "string" || typeof val === "boolean" || typeof val === "number") { lines.push(`${keyLine} ${maybeWrap(val)}`); } else if (typeof val === "object") { lines.push(`${keyLine}: ${_stringify(val, { indent: indent + " " })}` + (options.topLevel ? "\n" : "")); } else { throw new TypeError(); } addedKeys = addedKeys.concat(valKeys); } return indent + lines.join(` ${indent}`); } function stringify(obj, noHeader, enableVersions) { const val = _stringify(obj, { indent: "", topLevel: true }); if (noHeader) { return val; } const lines = []; lines.push("# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY."); lines.push(`# yarn lockfile v${(_constants || _load_constants()).LOCKFILE_VERSION}`); if (enableVersions) { lines.push(`# yarn v${(_package || _load_package()).version}`); lines.push(`# node ${NODE_VERSION}`); } lines.push("\n"); lines.push(val); return lines.join("\n"); } }, , , , , , , , , , , , , , /* 164 */ /***/ function(module2, exports2, __webpack_require__) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.fileDatesEqual = exports2.copyFile = exports2.unlink = void 0; var _asyncToGenerator2; function _load_asyncToGenerator() { return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); } let fixTimes = (() => { var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (fd, dest, data) { const doOpen = fd === void 0; let openfd = fd ? fd : -1; if (disableTimestampCorrection === void 0) { const destStat = yield lstat2(dest); disableTimestampCorrection = fileDatesEqual(destStat.mtime, data.mtime); } if (disableTimestampCorrection) { return; } if (doOpen) { try { openfd = yield open2(dest, "a", data.mode); } catch (er) { try { openfd = yield open2(dest, "r", data.mode); } catch (err) { return; } } } try { if (openfd) { yield futimes(openfd, data.atime, data.mtime); } } catch (er) { } finally { if (doOpen && openfd) { yield close(openfd); } } }); return function fixTimes2(_x7, _x8, _x9) { return _ref3.apply(this, arguments); }; })(); var _fs; function _load_fs() { return _fs = _interopRequireDefault(__webpack_require__(3)); } var _promise; function _load_promise() { return _promise = __webpack_require__(40); } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } let disableTimestampCorrection = void 0; const readFileBuffer = (0, (_promise || _load_promise()).promisify)((_fs || _load_fs()).default.readFile); const close = (0, (_promise || _load_promise()).promisify)((_fs || _load_fs()).default.close); const lstat2 = (0, (_promise || _load_promise()).promisify)((_fs || _load_fs()).default.lstat); const open2 = (0, (_promise || _load_promise()).promisify)((_fs || _load_fs()).default.open); const futimes = (0, (_promise || _load_promise()).promisify)((_fs || _load_fs()).default.futimes); const write = (0, (_promise || _load_promise()).promisify)((_fs || _load_fs()).default.write); const unlink2 = exports2.unlink = (0, (_promise || _load_promise()).promisify)(__webpack_require__(233)); const copyFile2 = exports2.copyFile = (() => { var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data, cleanup) { try { yield unlink2(data.dest); yield copyFilePoly(data.src, data.dest, 0, data); } finally { if (cleanup) { cleanup(); } } }); return function copyFile3(_x, _x2) { return _ref.apply(this, arguments); }; })(); const copyFilePoly = (src, dest, flags, data) => { if ((_fs || _load_fs()).default.copyFile) { return new Promise((resolve5, reject) => (_fs || _load_fs()).default.copyFile(src, dest, flags, (err) => { if (err) { reject(err); } else { fixTimes(void 0, dest, data).then(() => resolve5()).catch((ex) => reject(ex)); } })); } else { return copyWithBuffer(src, dest, flags, data); } }; const copyWithBuffer = (() => { var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (src, dest, flags, data) { const fd = yield open2(dest, "w", data.mode); try { const buffer = yield readFileBuffer(src); yield write(fd, buffer, 0, buffer.length); yield fixTimes(fd, dest, data); } finally { yield close(fd); } }); return function copyWithBuffer2(_x3, _x4, _x5, _x6) { return _ref2.apply(this, arguments); }; })(); const fileDatesEqual = exports2.fileDatesEqual = (a, b) => { const aTime = a.getTime(); const bTime = b.getTime(); if (process.platform !== "win32") { return aTime === bTime; } if (Math.abs(aTime - bTime) <= 1) { return true; } const aTimeSec = Math.floor(aTime / 1e3); const bTimeSec = Math.floor(bTime / 1e3); if (aTime - aTimeSec * 1e3 === 0 || bTime - bTimeSec * 1e3 === 0) { return aTimeSec === bTimeSec; } return aTime === bTime; }; }, , , , , /* 169 */ /***/ function(module2, exports2, __webpack_require__) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.isFakeRoot = isFakeRoot; exports2.isRootUser = isRootUser; function getUid() { if (process.platform !== "win32" && process.getuid) { return process.getuid(); } return null; } exports2.default = isRootUser(getUid()) && !isFakeRoot(); function isFakeRoot() { return Boolean(process.env.FAKEROOTKEY); } function isRootUser(uid) { return uid === 0; } }, , /* 171 */ /***/ function(module2, exports2, __webpack_require__) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getDataDir = getDataDir; exports2.getCacheDir = getCacheDir; exports2.getConfigDir = getConfigDir; const path = __webpack_require__(0); const userHome = __webpack_require__(45).default; const FALLBACK_CONFIG_DIR = path.join(userHome, ".config", "yarn"); const FALLBACK_CACHE_DIR = path.join(userHome, ".cache", "yarn"); function getDataDir() { if (process.platform === "win32") { const WIN32_APPDATA_DIR = getLocalAppDataDir(); return WIN32_APPDATA_DIR == null ? FALLBACK_CONFIG_DIR : path.join(WIN32_APPDATA_DIR, "Data"); } else if (process.env.XDG_DATA_HOME) { return path.join(process.env.XDG_DATA_HOME, "yarn"); } else { return FALLBACK_CONFIG_DIR; } } function getCacheDir() { if (process.platform === "win32") { return path.join(getLocalAppDataDir() || path.join(userHome, "AppData", "Local", "Yarn"), "Cache"); } else if (process.env.XDG_CACHE_HOME) { return path.join(process.env.XDG_CACHE_HOME, "yarn"); } else if (process.platform === "darwin") { return path.join(userHome, "Library", "Caches", "Yarn"); } else { return FALLBACK_CACHE_DIR; } } function getConfigDir() { if (process.platform === "win32") { const WIN32_APPDATA_DIR = getLocalAppDataDir(); return WIN32_APPDATA_DIR == null ? FALLBACK_CONFIG_DIR : path.join(WIN32_APPDATA_DIR, "Config"); } else if (process.env.XDG_CONFIG_HOME) { return path.join(process.env.XDG_CONFIG_HOME, "yarn"); } else { return FALLBACK_CONFIG_DIR; } } function getLocalAppDataDir() { return process.env.LOCALAPPDATA ? path.join(process.env.LOCALAPPDATA, "Yarn") : null; } }, , /* 173 */ /***/ function(module2, exports2, __webpack_require__) { module2.exports = { "default": __webpack_require__(179), __esModule: true }; }, /* 174 */ /***/ function(module2, exports2, __webpack_require__) { "use strict"; module2.exports = balanced; function balanced(a, b, str) { if (a instanceof RegExp) a = maybeMatch(a, str); if (b instanceof RegExp) b = maybeMatch(b, str); var r = range(a, b, str); return r && { start: r[0], end: r[1], pre: str.slice(0, r[0]), body: str.slice(r[0] + a.length, r[1]), post: str.slice(r[1] + b.length) }; } function maybeMatch(reg, str) { var m = str.match(reg); return m ? m[0] : null; } balanced.range = range; function range(a, b, str) { var begs, beg, left2, right2, result; var ai = str.indexOf(a); var bi = str.indexOf(b, ai + 1); var i = ai; if (ai >= 0 && bi > 0) { begs = []; left2 = str.length; while (i >= 0 && !result) { if (i == ai) { begs.push(i); ai = str.indexOf(a, i + 1); } else if (begs.length == 1) { result = [begs.pop(), bi]; } else { beg = begs.pop(); if (beg < left2) { left2 = beg; right2 = bi; } bi = str.indexOf(b, i + 1); } i = ai < bi && ai >= 0 ? ai : bi; } if (begs.length) { result = [left2, right2]; } } return result; } }, /* 175 */ /***/ function(module2, exports2, __webpack_require__) { var concatMap = __webpack_require__(178); var balanced = __webpack_require__(174); module2.exports = expandTop; var escSlash = "\0SLASH" + Math.random() + "\0"; var escOpen = "\0OPEN" + Math.random() + "\0"; var escClose = "\0CLOSE" + Math.random() + "\0"; var escComma = "\0COMMA" + Math.random() + "\0"; var escPeriod = "\0PERIOD" + Math.random() + "\0"; function numeric(str) { return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0); } function escapeBraces(str) { return str.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod); } function unescapeBraces(str) { return str.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join("."); } function parseCommaParts(str) { if (!str) return [""]; var parts = []; var m = balanced("{", "}", str); if (!m) return str.split(","); var pre = m.pre; var body = m.body; var post = m.post; var p = pre.split(","); p[p.length - 1] += "{" + body + "}"; var postParts = parseCommaParts(post); if (post.length) { p[p.length - 1] += postParts.shift(); p.push.apply(p, postParts); } parts.push.apply(parts, p); return parts; } function expandTop(str) { if (!str) return []; if (str.substr(0, 2) === "{}") { str = "\\{\\}" + str.substr(2); } return expand3(escapeBraces(str), true).map(unescapeBraces); } function identity(e) { return e; } function embrace(str) { return "{" + str + "}"; } function isPadded(el) { return /^-?0\d/.test(el); } function lte(i, y) { return i <= y; } function gte(i, y) { return i >= y; } function expand3(str, isTop) { var expansions = []; var m = balanced("{", "}", str); if (!m || /\$$/.test(m.pre)) return [str]; var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); var isSequence = isNumericSequence || isAlphaSequence; var isOptions = m.body.indexOf(",") >= 0; if (!isSequence && !isOptions) { if (m.post.match(/,.*\}/)) { str = m.pre + "{" + m.body + escClose + m.post; return expand3(str); } return [str]; } var n; if (isSequence) { n = m.body.split(/\.\./); } else { n = parseCommaParts(m.body); if (n.length === 1) { n = expand3(n[0], false).map(embrace); if (n.length === 1) { var post = m.post.length ? expand3(m.post, false) : [""]; return post.map(function(p) { return m.pre + n[0] + p; }); } } } var pre = m.pre; var post = m.post.length ? expand3(m.post, false) : [""]; var N; if (isSequence) { var x = numeric(n[0]); var y = numeric(n[1]); var width = Math.max(n[0].length, n[1].length); var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1; var test = lte; var reverse = y < x; if (reverse) { incr *= -1; test = gte; } var pad = n.some(isPadded); N = []; for (var i = x; test(i, y); i += incr) { var c; if (isAlphaSequence) { c = String.fromCharCode(i); if (c === "\\") c = ""; } else { c = String(i); if (pad) { var need = width - c.length; if (need > 0) { var z = new Array(need + 1).join("0"); if (i < 0) c = "-" + z + c.slice(1); else c = z + c; } } } N.push(c); } } else { N = concatMap(n, function(el) { return expand3(el, false); }); } for (var j = 0; j < N.length; j++) { for (var k = 0; k < post.length; k++) { var expansion = pre + N[j] + post[k]; if (!isTop || isSequence || expansion) expansions.push(expansion); } } return expansions; } }, /* 176 */ /***/ function(module2, exports2, __webpack_require__) { "use strict"; function preserveCamelCase(str) { let isLastCharLower = false; let isLastCharUpper = false; let isLastLastCharUpper = false; for (let i = 0; i < str.length; i++) { const c = str[i]; if (isLastCharLower && /[a-zA-Z]/.test(c) && c.toUpperCase() === c) { str = str.substr(0, i) + "-" + str.substr(i); isLastCharLower = false; isLastLastCharUpper = isLastCharUpper; isLastCharUpper = true; i++; } else if (isLastCharUpper && isLastLastCharUpper && /[a-zA-Z]/.test(c) && c.toLowerCase() === c) { str = str.substr(0, i - 1) + "-" + str.substr(i - 1); isLastLastCharUpper = isLastCharUpper; isLastCharUpper = false; isLastCharLower = true; } else { isLastCharLower = c.toLowerCase() === c; isLastLastCharUpper = isLastCharUpper; isLastCharUpper = c.toUpperCase() === c; } } return str; } module2.exports = function(str) { if (arguments.length > 1) { str = Array.from(arguments).map((x) => x.trim()).filter((x) => x.length).join("-"); } else { str = str.trim(); } if (str.length === 0) { return ""; } if (str.length === 1) { return str.toLowerCase(); } if (/^[a-z0-9]+$/.test(str)) { return str; } const hasUpperCase = str !== str.toLowerCase(); if (hasUpperCase) { str = preserveCamelCase(str); } return str.replace(/^[_.\- ]+/, "").toLowerCase().replace(/[_.\- ]+(\w|$)/g, (m, p1) => p1.toUpperCase()); }; }, , /* 178 */ /***/ function(module2, exports2) { module2.exports = function(xs, fn) { var res = []; for (var i = 0; i < xs.length; i++) { var x = fn(xs[i], i); if (isArray(x)) res.push.apply(res, x); else res.push(x); } return res; }; var isArray = Array.isArray || function(xs) { return Object.prototype.toString.call(xs) === "[object Array]"; }; }, /* 179 */ /***/ function(module2, exports2, __webpack_require__) { __webpack_require__(205); __webpack_require__(207); __webpack_require__(210); __webpack_require__(206); __webpack_require__(208); __webpack_require__(209); module2.exports = __webpack_require__(23).Promise; }, /* 180 */ /***/ function(module2, exports2) { module2.exports = function() { }; }, /* 181 */ /***/ function(module2, exports2) { module2.exports = function(it, Constructor, name, forbiddenField) { if (!(it instanceof Constructor) || forbiddenField !== void 0 && forbiddenField in it) { throw TypeError(name + ": incorrect invocation!"); } return it; }; }, /* 182 */ /***/ function(module2, exports2, __webpack_require__) { var toIObject = __webpack_require__(74); var toLength = __webpack_require__(110); var toAbsoluteIndex = __webpack_require__(200); module2.exports = function(IS_INCLUDES) { return function($this, el, fromIndex) { var O = toIObject($this); var length = toLength(O.length); var index = toAbsoluteIndex(fromIndex, length); var value; if (IS_INCLUDES && el != el) while (length > index) { value = O[index++]; if (value != value) return true; } else for (; length > index; index++) if (IS_INCLUDES || index in O) { if (O[index] === el) return IS_INCLUDES || index || 0; } return !IS_INCLUDES && -1; }; }; }, /* 183 */ /***/ function(module2, exports2, __webpack_require__) { var ctx = __webpack_require__(48); var call = __webpack_require__(187); var isArrayIter = __webpack_require__(186); var anObject = __webpack_require__(27); var toLength = __webpack_require__(110); var getIterFn = __webpack_require__(203); var BREAK = {}; var RETURN = {}; var exports2 = module2.exports = function(iterable, entries, fn, that, ITERATOR) { var iterFn = ITERATOR ? function() { return iterable; } : getIterFn(iterable); var f = ctx(fn, that, entries ? 2 : 1); var index = 0; var length, step, iterator3, result; if (typeof iterFn != "function") throw TypeError(iterable + " is not iterable!"); if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) { result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]); if (result === BREAK || result === RETURN) return result; } else for (iterator3 = iterFn.call(iterable); !(step = iterator3.next()).done; ) { result = call(iterator3, f, step.value, entries); if (result === BREAK || result === RETURN) return result; } }; exports2.BREAK = BREAK; exports2.RETURN = RETURN; }, /* 184 */ /***/ function(module2, exports2, __webpack_require__) { module2.exports = !__webpack_require__(33) && !__webpack_require__(85)(function() { return Object.defineProperty(__webpack_require__(68)("div"), "a", { get: function() { return 7; } }).a != 7; }); }, /* 185 */ /***/ function(module2, exports2) { module2.exports = function(fn, args, that) { var un = that === void 0; switch (args.length) { case 0: return un ? fn() : fn.call(that); case 1: return un ? fn(args[0]) : fn.call(that, args[0]); case 2: return un ? fn(args[0], args[1]) : fn.call(that, args[0], args[1]); case 3: return un ? fn(args[0], args[1], args[2]) : fn.call(that, args[0], args[1], args[2]); case 4: return un ? fn(args[0], args[1], args[2], args[3]) : fn.call(that, args[0], args[1], args[2], args[3]); } return fn.apply(that, args); }; }, /* 186 */ /***/ function(module2, exports2, __webpack_require__) { var Iterators = __webpack_require__(35); var ITERATOR = __webpack_require__(13)("iterator"); var ArrayProto = Array.prototype; module2.exports = function(it) { return it !== void 0 && (Iterators.Array === it || ArrayProto[ITERATOR] === it); }; }, /* 187 */ /***/ function(module2, exports2, __webpack_require__) { var anObject = __webpack_require__(27); module2.exports = function(iterator3, fn, value, entries) { try { return entries ? fn(anObject(value)[0], value[1]) : fn(value); } catch (e) { var ret = iterator3["return"]; if (ret !== void 0) anObject(ret.call(iterator3)); throw e; } }; }, /* 188 */ /***/ function(module2, exports2, __webpack_require__) { "use strict"; var create = __webpack_require__(192); var descriptor = __webpack_require__(106); var setToStringTag = __webpack_require__(71); var IteratorPrototype = {}; __webpack_require__(31)(IteratorPrototype, __webpack_require__(13)("iterator"), function() { return this; }); module2.exports = function(Constructor, NAME, next) { Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) }); setToStringTag(Constructor, NAME + " Iterator"); }; }, /* 189 */ /***/ function(module2, exports2, __webpack_require__) { var ITERATOR = __webpack_require__(13)("iterator"); var SAFE_CLOSING = false; try { var riter = [7][ITERATOR](); riter["return"] = function() { SAFE_CLOSING = true; }; Array.from(riter, function() { throw 2; }); } catch (e) { } module2.exports = function(exec2, skipClosing) { if (!skipClosing && !SAFE_CLOSING) return false; var safe = false; try { var arr = [7]; var iter = arr[ITERATOR](); iter.next = function() { return { done: safe = true }; }; arr[ITERATOR] = function() { return iter; }; exec2(arr); } catch (e) { } return safe; }; }, /* 190 */ /***/ function(module2, exports2) { module2.exports = function(done, value) { return { value, done: !!done }; }; }, /* 191 */ /***/ function(module2, exports2, __webpack_require__) { var global = __webpack_require__(11); var macrotask = __webpack_require__(109).set; var Observer = global.MutationObserver || global.WebKitMutationObserver; var process3 = global.process; var Promise2 = global.Promise; var isNode = __webpack_require__(47)(process3) == "process"; module2.exports = function() { var head, last, notify; var flush = function() { var parent, fn; if (isNode && (parent = process3.domain)) parent.exit(); while (head) { fn = head.fn; head = head.next; try { fn(); } catch (e) { if (head) notify(); else last = void 0; throw e; } } last = void 0; if (parent) parent.enter(); }; if (isNode) { notify = function() { process3.nextTick(flush); }; } else if (Observer && !(global.navigator && global.navigator.standalone)) { var toggle = true; var node = document.createTextNode(""); new Observer(flush).observe(node, { characterData: true }); notify = function() { node.data = toggle = !toggle; }; } else if (Promise2 && Promise2.resolve) { var promise = Promise2.resolve(void 0); notify = function() { promise.then(flush); }; } else { notify = function() { macrotask.call(global, flush); }; } return function(fn) { var task = { fn, next: void 0 }; if (last) last.next = task; if (!head) { head = task; notify(); } last = task; }; }; }, /* 192 */ /***/ function(module2, exports2, __webpack_require__) { var anObject = __webpack_require__(27); var dPs = __webpack_require__(193); var enumBugKeys = __webpack_require__(101); var IE_PROTO = __webpack_require__(72)("IE_PROTO"); var Empty = function() { }; var PROTOTYPE = "prototype"; var createDict = function() { var iframe = __webpack_require__(68)("iframe"); var i = enumBugKeys.length; var lt = "<"; var gt = ">"; var iframeDocument; iframe.style.display = "none"; __webpack_require__(102).appendChild(iframe); iframe.src = "javascript:"; iframeDocument = iframe.contentWindow.document; iframeDocument.open(); iframeDocument.write(lt + "script" + gt + "document.F=Object" + lt + "/script" + gt); iframeDocument.close(); createDict = iframeDocument.F; while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]]; return createDict(); }; module2.exports = Object.create || function create(O, Properties) { var result; if (O !== null) { Empty[PROTOTYPE] = anObject(O); result = new Empty(); Empty[PROTOTYPE] = null; result[IE_PROTO] = O; } else result = createDict(); return Properties === void 0 ? result : dPs(result, Properties); }; }, /* 193 */ /***/ function(module2, exports2, __webpack_require__) { var dP = __webpack_require__(50); var anObject = __webpack_require__(27); var getKeys = __webpack_require__(132); module2.exports = __webpack_require__(33) ? Object.defineProperties : function defineProperties(O, Properties) { anObject(O); var keys = getKeys(Properties); var length = keys.length; var i = 0; var P; while (length > i) dP.f(O, P = keys[i++], Properties[P]); return O; }; }, /* 194 */ /***/ function(module2, exports2, __webpack_require__) { var has = __webpack_require__(49); var toObject = __webpack_require__(133); var IE_PROTO = __webpack_require__(72)("IE_PROTO"); var ObjectProto = Object.prototype; module2.exports = Object.getPrototypeOf || function(O) { O = toObject(O); if (has(O, IE_PROTO)) return O[IE_PROTO]; if (typeof O.constructor == "function" && O instanceof O.constructor) { return O.constructor.prototype; } return O instanceof Object ? ObjectProto : null; }; }, /* 195 */ /***/ function(module2, exports2, __webpack_require__) { var has = __webpack_require__(49); var toIObject = __webpack_require__(74); var arrayIndexOf = __webpack_require__(182)(false); var IE_PROTO = __webpack_require__(72)("IE_PROTO"); module2.exports = function(object, names) { var O = toIObject(object); var i = 0; var result = []; var key; for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key); while (names.length > i) if (has(O, key = names[i++])) { ~arrayIndexOf(result, key) || result.push(key); } return result; }; }, /* 196 */ /***/ function(module2, exports2, __webpack_require__) { var hide = __webpack_require__(31); module2.exports = function(target, src, safe) { for (var key in src) { if (safe && target[key]) target[key] = src[key]; else hide(target, key, src[key]); } return target; }; }, /* 197 */ /***/ function(module2, exports2, __webpack_require__) { module2.exports = __webpack_require__(31); }, /* 198 */ /***/ function(module2, exports2, __webpack_require__) { "use strict"; var global = __webpack_require__(11); var core = __webpack_require__(23); var dP = __webpack_require__(50); var DESCRIPTORS = __webpack_require__(33); var SPECIES = __webpack_require__(13)("species"); module2.exports = function(KEY) { var C = typeof core[KEY] == "function" ? core[KEY] : global[KEY]; if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, { configurable: true, get: function() { return this; } }); }; }, /* 199 */ /***/ function(module2, exports2, __webpack_require__) { var toInteger = __webpack_require__(73); var defined = __webpack_require__(67); module2.exports = function(TO_STRING) { return function(that, pos) { var s = String(defined(that)); var i = toInteger(pos); var l = s.length; var a, b; if (i < 0 || i >= l) return TO_STRING ? "" : void 0; a = s.charCodeAt(i); return a < 55296 || a > 56319 || i + 1 === l || (b = s.charCodeAt(i + 1)) < 56320 || b > 57343 ? TO_STRING ? s.charAt(i) : a : TO_STRING ? s.slice(i, i + 2) : (a - 55296 << 10) + (b - 56320) + 65536; }; }; }, /* 200 */ /***/ function(module2, exports2, __webpack_require__) { var toInteger = __webpack_require__(73); var max = Math.max; var min = Math.min; module2.exports = function(index, length) { index = toInteger(index); return index < 0 ? max(index + length, 0) : min(index, length); }; }, /* 201 */ /***/ function(module2, exports2, __webpack_require__) { var isObject = __webpack_require__(34); module2.exports = function(it, S) { if (!isObject(it)) return it; var fn, val; if (S && typeof (fn = it.toString) == "function" && !isObject(val = fn.call(it))) return val; if (typeof (fn = it.valueOf) == "function" && !isObject(val = fn.call(it))) return val; if (!S && typeof (fn = it.toString) == "function" && !isObject(val = fn.call(it))) return val; throw TypeError("Can't convert object to primitive value"); }; }, /* 202 */ /***/ function(module2, exports2, __webpack_require__) { var global = __webpack_require__(11); var navigator2 = global.navigator; module2.exports = navigator2 && navigator2.userAgent || ""; }, /* 203 */ /***/ function(module2, exports2, __webpack_require__) { var classof = __webpack_require__(100); var ITERATOR = __webpack_require__(13)("iterator"); var Iterators = __webpack_require__(35); module2.exports = __webpack_require__(23).getIteratorMethod = function(it) { if (it != void 0) return it[ITERATOR] || it["@@iterator"] || Iterators[classof(it)]; }; }, /* 204 */ /***/ function(module2, exports2, __webpack_require__) { "use strict"; var addToUnscopables = __webpack_require__(180); var step = __webpack_require__(190); var Iterators = __webpack_require__(35); var toIObject = __webpack_require__(74); module2.exports = __webpack_require__(103)(Array, "Array", function(iterated, kind) { this._t = toIObject(iterated); this._i = 0; this._k = kind; }, function() { var O = this._t; var kind = this._k; var index = this._i++; if (!O || index >= O.length) { this._t = void 0; return step(1); } if (kind == "keys") return step(0, index); if (kind == "values") return step(0, O[index]); return step(0, [index, O[index]]); }, "values"); Iterators.Arguments = Iterators.Array; addToUnscopables("keys"); addToUnscopables("values"); addToUnscopables("entries"); }, /* 205 */ /***/ function(module2, exports2) { }, /* 206 */ /***/ function(module2, exports2, __webpack_require__) { "use strict"; var LIBRARY = __webpack_require__(69); var global = __webpack_require__(11); var ctx = __webpack_require__(48); var classof = __webpack_require__(100); var $export = __webpack_require__(41); var isObject = __webpack_require__(34); var aFunction = __webpack_require__(46); var anInstance = __webpack_require__(181); var forOf = __webpack_require__(183); var speciesConstructor = __webpack_require__(108); var task = __webpack_require__(109).set; var microtask = __webpack_require__(191)(); var newPromiseCapabilityModule = __webpack_require__(70); var perform = __webpack_require__(104); var userAgent3 = __webpack_require__(202); var promiseResolve = __webpack_require__(105); var PROMISE = "Promise"; var TypeError2 = global.TypeError; var process3 = global.process; var versions = process3 && process3.versions; var v8 = versions && versions.v8 || ""; var $Promise = global[PROMISE]; var isNode = classof(process3) == "process"; var empty = function() { }; var Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper; var newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f; var USE_NATIVE = !!function() { try { var promise = $Promise.resolve(1); var FakePromise = (promise.constructor = {})[__webpack_require__(13)("species")] = function(exec2) { exec2(empty, empty); }; return (isNode || typeof PromiseRejectionEvent == "function") && promise.then(empty) instanceof FakePromise && v8.indexOf("6.6") !== 0 && userAgent3.indexOf("Chrome/66") === -1; } catch (e) { } }(); var isThenable = function(it) { var then; return isObject(it) && typeof (then = it.then) == "function" ? then : false; }; var notify = function(promise, isReject) { if (promise._n) return; promise._n = true; var chain = promise._c; microtask(function() { var value = promise._v; var ok = promise._s == 1; var i = 0; var run = function(reaction) { var handler3 = ok ? reaction.ok : reaction.fail; var resolve5 = reaction.resolve; var reject = reaction.reject; var domain = reaction.domain; var result, then, exited; try { if (handler3) { if (!ok) { if (promise._h == 2) onHandleUnhandled(promise); promise._h = 1; } if (handler3 === true) result = value; else { if (domain) domain.enter(); result = handler3(value); if (domain) { domain.exit(); exited = true; } } if (result === reaction.promise) { reject(TypeError2("Promise-chain cycle")); } else if (then = isThenable(result)) { then.call(result, resolve5, reject); } else resolve5(result); } else reject(value); } catch (e) { if (domain && !exited) domain.exit(); reject(e); } }; while (chain.length > i) run(chain[i++]); promise._c = []; promise._n = false; if (isReject && !promise._h) onUnhandled(promise); }); }; var onUnhandled = function(promise) { task.call(global, function() { var value = promise._v; var unhandled = isUnhandled(promise); var result, handler3, console2; if (unhandled) { result = perform(function() { if (isNode) { process3.emit("unhandledRejection", value, promise); } else if (handler3 = global.onunhandledrejection) { handler3({ promise, reason: value }); } else if ((console2 = global.console) && console2.error) { console2.error("Unhandled promise rejection", value); } }); promise._h = isNode || isUnhandled(promise) ? 2 : 1; } promise._a = void 0; if (unhandled && result.e) throw result.v; }); }; var isUnhandled = function(promise) { return promise._h !== 1 && (promise._a || promise._c).length === 0; }; var onHandleUnhandled = function(promise) { task.call(global, function() { var handler3; if (isNode) { process3.emit("rejectionHandled", promise); } else if (handler3 = global.onrejectionhandled) { handler3({ promise, reason: promise._v }); } }); }; var $reject = function(value) { var promise = this; if (promise._d) return; promise._d = true; promise = promise._w || promise; promise._v = value; promise._s = 2; if (!promise._a) promise._a = promise._c.slice(); notify(promise, true); }; var $resolve = function(value) { var promise = this; var then; if (promise._d) return; promise._d = true; promise = promise._w || promise; try { if (promise === value) throw TypeError2("Promise can't be resolved itself"); if (then = isThenable(value)) { microtask(function() { var wrapper = { _w: promise, _d: false }; try { then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1)); } catch (e) { $reject.call(wrapper, e); } }); } else { promise._v = value; promise._s = 1; notify(promise, false); } } catch (e) { $reject.call({ _w: promise, _d: false }, e); } }; if (!USE_NATIVE) { $Promise = function Promise2(executor) { anInstance(this, $Promise, PROMISE, "_h"); aFunction(executor); Internal.call(this); try { executor(ctx($resolve, this, 1), ctx($reject, this, 1)); } catch (err) { $reject.call(this, err); } }; Internal = function Promise2(executor) { this._c = []; this._a = void 0; this._s = 0; this._d = false; this._v = void 0; this._h = 0; this._n = false; }; Internal.prototype = __webpack_require__(196)($Promise.prototype, { // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected) then: function then(onFulfilled, onRejected) { var reaction = newPromiseCapability(speciesConstructor(this, $Promise)); reaction.ok = typeof onFulfilled == "function" ? onFulfilled : true; reaction.fail = typeof onRejected == "function" && onRejected; reaction.domain = isNode ? process3.domain : void 0; this._c.push(reaction); if (this._a) this._a.push(reaction); if (this._s) notify(this, false); return reaction.promise; }, // 25.4.5.1 Promise.prototype.catch(onRejected) "catch": function(onRejected) { return this.then(void 0, onRejected); } }); OwnPromiseCapability = function() { var promise = new Internal(); this.promise = promise; this.resolve = ctx($resolve, promise, 1); this.reject = ctx($reject, promise, 1); }; newPromiseCapabilityModule.f = newPromiseCapability = function(C) { return C === $Promise || C === Wrapper ? new OwnPromiseCapability(C) : newGenericPromiseCapability(C); }; } $export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise }); __webpack_require__(71)($Promise, PROMISE); __webpack_require__(198)(PROMISE); Wrapper = __webpack_require__(23)[PROMISE]; $export($export.S + $export.F * !USE_NATIVE, PROMISE, { // 25.4.4.5 Promise.reject(r) reject: function reject(r) { var capability = newPromiseCapability(this); var $$reject = capability.reject; $$reject(r); return capability.promise; } }); $export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, { // 25.4.4.6 Promise.resolve(x) resolve: function resolve5(x) { return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x); } }); $export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(189)(function(iter) { $Promise.all(iter)["catch"](empty); })), PROMISE, { // 25.4.4.1 Promise.all(iterable) all: function all(iterable) { var C = this; var capability = newPromiseCapability(C); var resolve5 = capability.resolve; var reject = capability.reject; var result = perform(function() { var values = []; var index = 0; var remaining = 1; forOf(iterable, false, function(promise) { var $index = index++; var alreadyCalled = false; values.push(void 0); remaining++; C.resolve(promise).then(function(value) { if (alreadyCalled) return; alreadyCalled = true; values[$index] = value; --remaining || resolve5(values); }, reject); }); --remaining || resolve5(values); }); if (result.e) reject(result.v); return capability.promise; }, // 25.4.4.4 Promise.race(iterable) race: function race(iterable) { var C = this; var capability = newPromiseCapability(C); var reject = capability.reject; var result = perform(function() { forOf(iterable, false, function(promise) { C.resolve(promise).then(capability.resolve, reject); }); }); if (result.e) reject(result.v); return capability.promise; } }); }, /* 207 */ /***/ function(module2, exports2, __webpack_require__) { "use strict"; var $at = __webpack_require__(199)(true); __webpack_require__(103)(String, "String", function(iterated) { this._t = String(iterated); this._i = 0; }, function() { var O = this._t; var index = this._i; var point; if (index >= O.length) return { value: void 0, done: true }; point = $at(O, index); this._i += point.length; return { value: point, done: false }; }); }, /* 208 */ /***/ function(module2, exports2, __webpack_require__) { "use strict"; var $export = __webpack_require__(41); var core = __webpack_require__(23); var global = __webpack_require__(11); var speciesConstructor = __webpack_require__(108); var promiseResolve = __webpack_require__(105); $export($export.P + $export.R, "Promise", { "finally": function(onFinally) { var C = speciesConstructor(this, core.Promise || global.Promise); var isFunction2 = typeof onFinally == "function"; return this.then( isFunction2 ? function(x) { return promiseResolve(C, onFinally()).then(function() { return x; }); } : onFinally, isFunction2 ? function(e) { return promiseResolve(C, onFinally()).then(function() { throw e; }); } : onFinally ); } }); }, /* 209 */ /***/ function(module2, exports2, __webpack_require__) { "use strict"; var $export = __webpack_require__(41); var newPromiseCapability = __webpack_require__(70); var perform = __webpack_require__(104); $export($export.S, "Promise", { "try": function(callbackfn) { var promiseCapability = newPromiseCapability.f(this); var result = perform(callbackfn); (result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v); return promiseCapability.promise; } }); }, /* 210 */ /***/ function(module2, exports2, __webpack_require__) { __webpack_require__(204); var global = __webpack_require__(11); var hide = __webpack_require__(31); var Iterators = __webpack_require__(35); var TO_STRING_TAG = __webpack_require__(13)("toStringTag"); var DOMIterables = "CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","); for (var i = 0; i < DOMIterables.length; i++) { var NAME = DOMIterables[i]; var Collection3 = global[NAME]; var proto = Collection3 && Collection3.prototype; if (proto && !proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME); Iterators[NAME] = Iterators.Array; } }, /* 211 */ /***/ function(module2, exports2, __webpack_require__) { exports2 = module2.exports = __webpack_require__(112); exports2.log = log; exports2.formatArgs = formatArgs; exports2.save = save; exports2.load = load; exports2.useColors = useColors; exports2.storage = "undefined" != typeof chrome && "undefined" != typeof chrome.storage ? chrome.storage.local : localstorage(); exports2.colors = [ "#0000CC", "#0000FF", "#0033CC", "#0033FF", "#0066CC", "#0066FF", "#0099CC", "#0099FF", "#00CC00", "#00CC33", "#00CC66", "#00CC99", "#00CCCC", "#00CCFF", "#3300CC", "#3300FF", "#3333CC", "#3333FF", "#3366CC", "#3366FF", "#3399CC", "#3399FF", "#33CC00", "#33CC33", "#33CC66", "#33CC99", "#33CCCC", "#33CCFF", "#6600CC", "#6600FF", "#6633CC", "#6633FF", "#66CC00", "#66CC33", "#9900CC", "#9900FF", "#9933CC", "#9933FF", "#99CC00", "#99CC33", "#CC0000", "#CC0033", "#CC0066", "#CC0099", "#CC00CC", "#CC00FF", "#CC3300", "#CC3333", "#CC3366", "#CC3399", "#CC33CC", "#CC33FF", "#CC6600", "#CC6633", "#CC9900", "#CC9933", "#CCCC00", "#CCCC33", "#FF0000", "#FF0033", "#FF0066", "#FF0099", "#FF00CC", "#FF00FF", "#FF3300", "#FF3333", "#FF3366", "#FF3399", "#FF33CC", "#FF33FF", "#FF6600", "#FF6633", "#FF9900", "#FF9933", "#FFCC00", "#FFCC33" ]; function useColors() { if (typeof window !== "undefined" && window.process && window.process.type === "renderer") { return true; } if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { return false; } return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // is firebug? http://stackoverflow.com/a/398120/376773 typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // is firefox >= v31? // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // double check webkit in userAgent just in case we are in a worker typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); } exports2.formatters.j = function(v) { try { return JSON.stringify(v); } catch (err) { return "[UnexpectedJSONParseError]: " + err.message; } }; function formatArgs(args) { var useColors2 = this.useColors; args[0] = (useColors2 ? "%c" : "") + this.namespace + (useColors2 ? " %c" : " ") + args[0] + (useColors2 ? "%c " : " ") + "+" + exports2.humanize(this.diff); if (!useColors2) return; var c = "color: " + this.color; args.splice(1, 0, c, "color: inherit"); var index = 0; var lastC = 0; args[0].replace(/%[a-zA-Z%]/g, function(match) { if ("%%" === match) return; index++; if ("%c" === match) { lastC = index; } }); args.splice(lastC, 0, c); } function log() { return "object" === typeof console && console.log && Function.prototype.apply.call(console.log, console, arguments); } function save(namespaces) { try { if (null == namespaces) { exports2.storage.removeItem("debug"); } else { exports2.storage.debug = namespaces; } } catch (e) { } } function load() { var r; try { r = exports2.storage.debug; } catch (e) { } if (!r && typeof process !== "undefined" && "env" in process) { r = process.env.DEBUG; } return r; } exports2.enable(load()); function localstorage() { try { return window.localStorage; } catch (e) { } } }, /* 212 */ /***/ function(module2, exports2, __webpack_require__) { if (typeof process === "undefined" || process.type === "renderer") { module2.exports = __webpack_require__(211); } else { module2.exports = __webpack_require__(213); } }, /* 213 */ /***/ function(module2, exports2, __webpack_require__) { var tty2 = __webpack_require__(79); var util = __webpack_require__(2); exports2 = module2.exports = __webpack_require__(112); exports2.init = init; exports2.log = log; exports2.formatArgs = formatArgs; exports2.save = save; exports2.load = load; exports2.useColors = useColors; exports2.colors = [6, 2, 3, 4, 5, 1]; try { var supportsColor2 = __webpack_require__(239); if (supportsColor2 && supportsColor2.level >= 2) { exports2.colors = [ 20, 21, 26, 27, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 56, 57, 62, 63, 68, 69, 74, 75, 76, 77, 78, 79, 80, 81, 92, 93, 98, 99, 112, 113, 128, 129, 134, 135, 148, 149, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 178, 179, 184, 185, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 214, 215, 220, 221 ]; } } catch (err) { } exports2.inspectOpts = Object.keys(process.env).filter(function(key) { return /^debug_/i.test(key); }).reduce(function(obj, key) { var prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, function(_, k) { return k.toUpperCase(); }); var val = process.env[key]; if (/^(yes|on|true|enabled)$/i.test(val)) val = true; else if (/^(no|off|false|disabled)$/i.test(val)) val = false; else if (val === "null") val = null; else val = Number(val); obj[prop] = val; return obj; }, {}); function useColors() { return "colors" in exports2.inspectOpts ? Boolean(exports2.inspectOpts.colors) : tty2.isatty(process.stderr.fd); } exports2.formatters.o = function(v) { this.inspectOpts.colors = this.useColors; return util.inspect(v, this.inspectOpts).split("\n").map(function(str) { return str.trim(); }).join(" "); }; exports2.formatters.O = function(v) { this.inspectOpts.colors = this.useColors; return util.inspect(v, this.inspectOpts); }; function formatArgs(args) { var name = this.namespace; var useColors2 = this.useColors; if (useColors2) { var c = this.color; var colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c); var prefix = " " + colorCode + ";1m" + name + " \x1B[0m"; args[0] = prefix + args[0].split("\n").join("\n" + prefix); args.push(colorCode + "m+" + exports2.humanize(this.diff) + "\x1B[0m"); } else { args[0] = getDate() + name + " " + args[0]; } } function getDate() { if (exports2.inspectOpts.hideDate) { return ""; } else { return (/* @__PURE__ */ new Date()).toISOString() + " "; } } function log() { return process.stderr.write(util.format.apply(util, arguments) + "\n"); } function save(namespaces) { if (null == namespaces) { delete process.env.DEBUG; } else { process.env.DEBUG = namespaces; } } function load() { return process.env.DEBUG; } function init(debug2) { debug2.inspectOpts = {}; var keys = Object.keys(exports2.inspectOpts); for (var i = 0; i < keys.length; i++) { debug2.inspectOpts[keys[i]] = exports2.inspectOpts[keys[i]]; } } exports2.enable(load()); }, , , , /* 217 */ /***/ function(module2, exports2, __webpack_require__) { var pathModule = __webpack_require__(0); var isWindows = process.platform === "win32"; var fs2 = __webpack_require__(3); var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG); function rethrow() { var callback; if (DEBUG) { var backtrace = new Error(); callback = debugCallback; } else callback = missingCallback; return callback; function debugCallback(err) { if (err) { backtrace.message = err.message; err = backtrace; missingCallback(err); } } function missingCallback(err) { if (err) { if (process.throwDeprecation) throw err; else if (!process.noDeprecation) { var msg = "fs: missing callback " + (err.stack || err.message); if (process.traceDeprecation) console.trace(msg); else console.error(msg); } } } } function maybeCallback(cb) { return typeof cb === "function" ? cb : rethrow(); } var normalize2 = pathModule.normalize; if (isWindows) { var nextPartRe = /(.*?)(?:[\/\\]+|$)/g; } else { var nextPartRe = /(.*?)(?:[\/]+|$)/g; } if (isWindows) { var splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/; } else { var splitRootRe = /^[\/]*/; } exports2.realpathSync = function realpathSync(p, cache) { p = pathModule.resolve(p); if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { return cache[p]; } var original = p, seenLinks = {}, knownHard = {}; var pos; var current; var base; var previous; start(); function start() { var m = splitRootRe.exec(p); pos = m[0].length; current = m[0]; base = m[0]; previous = ""; if (isWindows && !knownHard[base]) { fs2.lstatSync(base); knownHard[base] = true; } } while (pos < p.length) { nextPartRe.lastIndex = pos; var result = nextPartRe.exec(p); previous = current; current += result[0]; base = previous + result[1]; pos = nextPartRe.lastIndex; if (knownHard[base] || cache && cache[base] === base) { continue; } var resolvedLink; if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { resolvedLink = cache[base]; } else { var stat2 = fs2.lstatSync(base); if (!stat2.isSymbolicLink()) { knownHard[base] = true; if (cache) cache[base] = base; continue; } var linkTarget = null; if (!isWindows) { var id = stat2.dev.toString(32) + ":" + stat2.ino.toString(32); if (seenLinks.hasOwnProperty(id)) { linkTarget = seenLinks[id]; } } if (linkTarget === null) { fs2.statSync(base); linkTarget = fs2.readlinkSync(base); } resolvedLink = pathModule.resolve(previous, linkTarget); if (cache) cache[base] = resolvedLink; if (!isWindows) seenLinks[id] = linkTarget; } p = pathModule.resolve(resolvedLink, p.slice(pos)); start(); } if (cache) cache[original] = p; return p; }; exports2.realpath = function realpath(p, cache, cb) { if (typeof cb !== "function") { cb = maybeCallback(cache); cache = null; } p = pathModule.resolve(p); if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { return process.nextTick(cb.bind(null, null, cache[p])); } var original = p, seenLinks = {}, knownHard = {}; var pos; var current; var base; var previous; start(); function start() { var m = splitRootRe.exec(p); pos = m[0].length; current = m[0]; base = m[0]; previous = ""; if (isWindows && !knownHard[base]) { fs2.lstat(base, function(err) { if (err) return cb(err); knownHard[base] = true; LOOP(); }); } else { process.nextTick(LOOP); } } function LOOP() { if (pos >= p.length) { if (cache) cache[original] = p; return cb(null, p); } nextPartRe.lastIndex = pos; var result = nextPartRe.exec(p); previous = current; current += result[0]; base = previous + result[1]; pos = nextPartRe.lastIndex; if (knownHard[base] || cache && cache[base] === base) { return process.nextTick(LOOP); } if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { return gotResolvedLink(cache[base]); } return fs2.lstat(base, gotStat); } function gotStat(err, stat2) { if (err) return cb(err); if (!stat2.isSymbolicLink()) { knownHard[base] = true; if (cache) cache[base] = base; return process.nextTick(LOOP); } if (!isWindows) { var id = stat2.dev.toString(32) + ":" + stat2.ino.toString(32); if (seenLinks.hasOwnProperty(id)) { return gotTarget(null, seenLinks[id], base); } } fs2.stat(base, function(err2) { if (err2) return cb(err2); fs2.readlink(base, function(err3, target) { if (!isWindows) seenLinks[id] = target; gotTarget(err3, target); }); }); } function gotTarget(err, target, base2) { if (err) return cb(err); var resolvedLink = pathModule.resolve(previous, target); if (cache) cache[base2] = resolvedLink; gotResolvedLink(resolvedLink); } function gotResolvedLink(resolvedLink) { p = pathModule.resolve(resolvedLink, p.slice(pos)); start(); } }; }, /* 218 */ /***/ function(module2, exports2, __webpack_require__) { module2.exports = globSync; globSync.GlobSync = GlobSync; var fs2 = __webpack_require__(3); var rp = __webpack_require__(114); var minimatch = __webpack_require__(60); var Minimatch = minimatch.Minimatch; var Glob = __webpack_require__(75).Glob; var util = __webpack_require__(2); var path = __webpack_require__(0); var assert2 = __webpack_require__(22); var isAbsolute = __webpack_require__(76); var common = __webpack_require__(115); var alphasort = common.alphasort; var alphasorti = common.alphasorti; var setopts = common.setopts; var ownProp = common.ownProp; var childrenIgnored = common.childrenIgnored; var isIgnored = common.isIgnored; function globSync(pattern, options) { if (typeof options === "function" || arguments.length === 3) throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167"); return new GlobSync(pattern, options).found; } function GlobSync(pattern, options) { if (!pattern) throw new Error("must provide pattern"); if (typeof options === "function" || arguments.length === 3) throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167"); if (!(this instanceof GlobSync)) return new GlobSync(pattern, options); setopts(this, pattern, options); if (this.noprocess) return this; var n = this.minimatch.set.length; this.matches = new Array(n); for (var i = 0; i < n; i++) { this._process(this.minimatch.set[i], i, false); } this._finish(); } GlobSync.prototype._finish = function() { assert2(this instanceof GlobSync); if (this.realpath) { var self2 = this; this.matches.forEach(function(matchset, index) { var set = self2.matches[index] = /* @__PURE__ */ Object.create(null); for (var p in matchset) { try { p = self2._makeAbs(p); var real = rp.realpathSync(p, self2.realpathCache); set[real] = true; } catch (er) { if (er.syscall === "stat") set[self2._makeAbs(p)] = true; else throw er; } } }); } common.finish(this); }; GlobSync.prototype._process = function(pattern, index, inGlobStar) { assert2(this instanceof GlobSync); var n = 0; while (typeof pattern[n] === "string") { n++; } var prefix; switch (n) { case pattern.length: this._processSimple(pattern.join("/"), index); return; case 0: prefix = null; break; default: prefix = pattern.slice(0, n).join("/"); break; } var remain = pattern.slice(n); var read; if (prefix === null) read = "."; else if (isAbsolute(prefix) || isAbsolute(pattern.join("/"))) { if (!prefix || !isAbsolute(prefix)) prefix = "/" + prefix; read = prefix; } else read = prefix; var abs = this._makeAbs(read); if (childrenIgnored(this, read)) return; var isGlobStar = remain[0] === minimatch.GLOBSTAR; if (isGlobStar) this._processGlobStar(prefix, read, abs, remain, index, inGlobStar); else this._processReaddir(prefix, read, abs, remain, index, inGlobStar); }; GlobSync.prototype._processReaddir = function(prefix, read, abs, remain, index, inGlobStar) { var entries = this._readdir(abs, inGlobStar); if (!entries) return; var pn = remain[0]; var negate = !!this.minimatch.negate; var rawGlob = pn._glob; var dotOk = this.dot || rawGlob.charAt(0) === "."; var matchedEntries = []; for (var i = 0; i < entries.length; i++) { var e = entries[i]; if (e.charAt(0) !== "." || dotOk) { var m; if (negate && !prefix) { m = !e.match(pn); } else { m = e.match(pn); } if (m) matchedEntries.push(e); } } var len = matchedEntries.length; if (len === 0) return; if (remain.length === 1 && !this.mark && !this.stat) { if (!this.matches[index]) this.matches[index] = /* @__PURE__ */ Object.create(null); for (var i = 0; i < len; i++) { var e = matchedEntries[i]; if (prefix) { if (prefix.slice(-1) !== "/") e = prefix + "/" + e; else e = prefix + e; } if (e.charAt(0) === "/" && !this.nomount) { e = path.join(this.root, e); } this._emitMatch(index, e); } return; } remain.shift(); for (var i = 0; i < len; i++) { var e = matchedEntries[i]; var newPattern; if (prefix) newPattern = [prefix, e]; else newPattern = [e]; this._process(newPattern.concat(remain), index, inGlobStar); } }; GlobSync.prototype._emitMatch = function(index, e) { if (isIgnored(this, e)) return; var abs = this._makeAbs(e); if (this.mark) e = this._mark(e); if (this.absolute) { e = abs; } if (this.matches[index][e]) return; if (this.nodir) { var c = this.cache[abs]; if (c === "DIR" || Array.isArray(c)) return; } this.matches[index][e] = true; if (this.stat) this._stat(e); }; GlobSync.prototype._readdirInGlobStar = function(abs) { if (this.follow) return this._readdir(abs, false); var entries; var lstat2; var stat2; try { lstat2 = fs2.lstatSync(abs); } catch (er) { if (er.code === "ENOENT") { return null; } } var isSym = lstat2 && lstat2.isSymbolicLink(); this.symlinks[abs] = isSym; if (!isSym && lstat2 && !lstat2.isDirectory()) this.cache[abs] = "FILE"; else entries = this._readdir(abs, false); return entries; }; GlobSync.prototype._readdir = function(abs, inGlobStar) { var entries; if (inGlobStar && !ownProp(this.symlinks, abs)) return this._readdirInGlobStar(abs); if (ownProp(this.cache, abs)) { var c = this.cache[abs]; if (!c || c === "FILE") return null; if (Array.isArray(c)) return c; } try { return this._readdirEntries(abs, fs2.readdirSync(abs)); } catch (er) { this._readdirError(abs, er); return null; } }; GlobSync.prototype._readdirEntries = function(abs, entries) { if (!this.mark && !this.stat) { for (var i = 0; i < entries.length; i++) { var e = entries[i]; if (abs === "/") e = abs + e; else e = abs + "/" + e; this.cache[e] = true; } } this.cache[abs] = entries; return entries; }; GlobSync.prototype._readdirError = function(f, er) { switch (er.code) { case "ENOTSUP": case "ENOTDIR": var abs = this._makeAbs(f); this.cache[abs] = "FILE"; if (abs === this.cwdAbs) { var error2 = new Error(er.code + " invalid cwd " + this.cwd); error2.path = this.cwd; error2.code = er.code; throw error2; } break; case "ENOENT": case "ELOOP": case "ENAMETOOLONG": case "UNKNOWN": this.cache[this._makeAbs(f)] = false; break; default: this.cache[this._makeAbs(f)] = false; if (this.strict) throw er; if (!this.silent) console.error("glob error", er); break; } }; GlobSync.prototype._processGlobStar = function(prefix, read, abs, remain, index, inGlobStar) { var entries = this._readdir(abs, inGlobStar); if (!entries) return; var remainWithoutGlobStar = remain.slice(1); var gspref = prefix ? [prefix] : []; var noGlobStar = gspref.concat(remainWithoutGlobStar); this._process(noGlobStar, index, false); var len = entries.length; var isSym = this.symlinks[abs]; if (isSym && inGlobStar) return; for (var i = 0; i < len; i++) { var e = entries[i]; if (e.charAt(0) === "." && !this.dot) continue; var instead = gspref.concat(entries[i], remainWithoutGlobStar); this._process(instead, index, true); var below = gspref.concat(entries[i], remain); this._process(below, index, true); } }; GlobSync.prototype._processSimple = function(prefix, index) { var exists2 = this._stat(prefix); if (!this.matches[index]) this.matches[index] = /* @__PURE__ */ Object.create(null); if (!exists2) return; if (prefix && isAbsolute(prefix) && !this.nomount) { var trail = /[\/\\]$/.test(prefix); if (prefix.charAt(0) === "/") { prefix = path.join(this.root, prefix); } else { prefix = path.resolve(this.root, prefix); if (trail) prefix += "/"; } } if (process.platform === "win32") prefix = prefix.replace(/\\/g, "/"); this._emitMatch(index, prefix); }; GlobSync.prototype._stat = function(f) { var abs = this._makeAbs(f); var needDir = f.slice(-1) === "/"; if (f.length > this.maxLength) return false; if (!this.stat && ownProp(this.cache, abs)) { var c = this.cache[abs]; if (Array.isArray(c)) c = "DIR"; if (!needDir || c === "DIR") return c; if (needDir && c === "FILE") return false; } var exists2; var stat2 = this.statCache[abs]; if (!stat2) { var lstat2; try { lstat2 = fs2.lstatSync(abs); } catch (er) { if (er && (er.code === "ENOENT" || er.code === "ENOTDIR")) { this.statCache[abs] = false; return false; } } if (lstat2 && lstat2.isSymbolicLink()) { try { stat2 = fs2.statSync(abs); } catch (er) { stat2 = lstat2; } } else { stat2 = lstat2; } } this.statCache[abs] = stat2; var c = true; if (stat2) c = stat2.isDirectory() ? "DIR" : "FILE"; this.cache[abs] = this.cache[abs] || c; if (needDir && c === "FILE") return false; return c; }; GlobSync.prototype._mark = function(p) { return common.mark(this, p); }; GlobSync.prototype._makeAbs = function(f) { return common.makeAbs(this, f); }; }, , , /* 221 */ /***/ function(module2, exports2, __webpack_require__) { "use strict"; module2.exports = function(flag, argv) { argv = argv || process.argv; var terminatorPos = argv.indexOf("--"); var prefix = /^--/.test(flag) ? "" : "--"; var pos = argv.indexOf(prefix + flag); return pos !== -1 && (terminatorPos !== -1 ? pos < terminatorPos : true); }; }, , /* 223 */ /***/ function(module2, exports2, __webpack_require__) { var wrappy = __webpack_require__(123); var reqs = /* @__PURE__ */ Object.create(null); var once = __webpack_require__(61); module2.exports = wrappy(inflight); function inflight(key, cb) { if (reqs[key]) { reqs[key].push(cb); return null; } else { reqs[key] = [cb]; return makeres(key); } } function makeres(key) { return once(function RES() { var cbs = reqs[key]; var len = cbs.length; var args = slice(arguments); try { for (var i = 0; i < len; i++) { cbs[i].apply(null, args); } } finally { if (cbs.length > len) { cbs.splice(0, len); process.nextTick(function() { RES.apply(null, args); }); } else { delete reqs[key]; } } }); } function slice(args) { var length = args.length; var array = []; for (var i = 0; i < length; i++) array[i] = args[i]; return array; } }, /* 224 */ /***/ function(module2, exports2) { if (typeof Object.create === "function") { module2.exports = function inherits(ctor, superCtor) { ctor.super_ = superCtor; ctor.prototype = Object.create(superCtor.prototype, { constructor: { value: ctor, enumerable: false, writable: true, configurable: true } }); }; } else { module2.exports = function inherits(ctor, superCtor) { ctor.super_ = superCtor; var TempCtor = function() { }; TempCtor.prototype = superCtor.prototype; ctor.prototype = new TempCtor(); ctor.prototype.constructor = ctor; }; } }, , , /* 227 */ /***/ function(module2, exports2, __webpack_require__) { module2.exports = typeof __webpack_require__ !== "undefined"; }, , /* 229 */ /***/ function(module2, exports2) { var s = 1e3; var m = s * 60; var h = m * 60; var d = h * 24; var y = d * 365.25; module2.exports = function(val, options) { options = options || {}; var type = typeof val; if (type === "string" && val.length > 0) { return parse3(val); } else if (type === "number" && isNaN(val) === false) { return options.long ? fmtLong(val) : fmtShort(val); } throw new Error( "val is not a non-empty string or a valid number. val=" + JSON.stringify(val) ); }; function parse3(str) { str = String(str); if (str.length > 100) { return; } var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec( str ); if (!match) { return; } var n = parseFloat(match[1]); var type = (match[2] || "ms").toLowerCase(); switch (type) { case "years": case "year": case "yrs": case "yr": case "y": return n * y; case "days": case "day": case "d": return n * d; case "hours": case "hour": case "hrs": case "hr": case "h": return n * h; case "minutes": case "minute": case "mins": case "min": case "m": return n * m; case "seconds": case "second": case "secs": case "sec": case "s": return n * s; case "milliseconds": case "millisecond": case "msecs": case "msec": case "ms": return n; default: return void 0; } } function fmtShort(ms) { if (ms >= d) { return Math.round(ms / d) + "d"; } if (ms >= h) { return Math.round(ms / h) + "h"; } if (ms >= m) { return Math.round(ms / m) + "m"; } if (ms >= s) { return Math.round(ms / s) + "s"; } return ms + "ms"; } function fmtLong(ms) { return plural(ms, d, "day") || plural(ms, h, "hour") || plural(ms, m, "minute") || plural(ms, s, "second") || ms + " ms"; } function plural(ms, n, name) { if (ms < n) { return; } if (ms < n * 1.5) { return Math.floor(ms / n) + " " + name; } return Math.ceil(ms / n) + " " + name + "s"; } }, , , , /* 233 */ /***/ function(module2, exports2, __webpack_require__) { module2.exports = rimraf; rimraf.sync = rimrafSync; var assert2 = __webpack_require__(22); var path = __webpack_require__(0); var fs2 = __webpack_require__(3); var glob = __webpack_require__(75); var _0666 = parseInt("666", 8); var defaultGlobOpts = { nosort: true, silent: true }; var timeout = 0; var isWindows = process.platform === "win32"; function defaults2(options) { var methods = [ "unlink", "chmod", "stat", "lstat", "rmdir", "readdir" ]; methods.forEach(function(m) { options[m] = options[m] || fs2[m]; m = m + "Sync"; options[m] = options[m] || fs2[m]; }); options.maxBusyTries = options.maxBusyTries || 3; options.emfileWait = options.emfileWait || 1e3; if (options.glob === false) { options.disableGlob = true; } options.disableGlob = options.disableGlob || false; options.glob = options.glob || defaultGlobOpts; } function rimraf(p, options, cb) { if (typeof options === "function") { cb = options; options = {}; } assert2(p, "rimraf: missing path"); assert2.equal(typeof p, "string", "rimraf: path should be a string"); assert2.equal(typeof cb, "function", "rimraf: callback function required"); assert2(options, "rimraf: invalid options argument provided"); assert2.equal(typeof options, "object", "rimraf: options should be object"); defaults2(options); var busyTries = 0; var errState = null; var n = 0; if (options.disableGlob || !glob.hasMagic(p)) return afterGlob(null, [p]); options.lstat(p, function(er, stat2) { if (!er) return afterGlob(null, [p]); glob(p, options.glob, afterGlob); }); function next(er) { errState = errState || er; if (--n === 0) cb(errState); } function afterGlob(er, results) { if (er) return cb(er); n = results.length; if (n === 0) return cb(); results.forEach(function(p2) { rimraf_(p2, options, function CB(er2) { if (er2) { if ((er2.code === "EBUSY" || er2.code === "ENOTEMPTY" || er2.code === "EPERM") && busyTries < options.maxBusyTries) { busyTries++; var time = busyTries * 100; return setTimeout(function() { rimraf_(p2, options, CB); }, time); } if (er2.code === "EMFILE" && timeout < options.emfileWait) { return setTimeout(function() { rimraf_(p2, options, CB); }, timeout++); } if (er2.code === "ENOENT") er2 = null; } timeout = 0; next(er2); }); }); } } function rimraf_(p, options, cb) { assert2(p); assert2(options); assert2(typeof cb === "function"); options.lstat(p, function(er, st) { if (er && er.code === "ENOENT") return cb(null); if (er && er.code === "EPERM" && isWindows) fixWinEPERM(p, options, er, cb); if (st && st.isDirectory()) return rmdir2(p, options, er, cb); options.unlink(p, function(er2) { if (er2) { if (er2.code === "ENOENT") return cb(null); if (er2.code === "EPERM") return isWindows ? fixWinEPERM(p, options, er2, cb) : rmdir2(p, options, er2, cb); if (er2.code === "EISDIR") return rmdir2(p, options, er2, cb); } return cb(er2); }); }); } function fixWinEPERM(p, options, er, cb) { assert2(p); assert2(options); assert2(typeof cb === "function"); if (er) assert2(er instanceof Error); options.chmod(p, _0666, function(er2) { if (er2) cb(er2.code === "ENOENT" ? null : er); else options.stat(p, function(er3, stats) { if (er3) cb(er3.code === "ENOENT" ? null : er); else if (stats.isDirectory()) rmdir2(p, options, er, cb); else options.unlink(p, cb); }); }); } function fixWinEPERMSync(p, options, er) { assert2(p); assert2(options); if (er) assert2(er instanceof Error); try { options.chmodSync(p, _0666); } catch (er2) { if (er2.code === "ENOENT") return; else throw er; } try { var stats = options.statSync(p); } catch (er3) { if (er3.code === "ENOENT") return; else throw er; } if (stats.isDirectory()) rmdirSync(p, options, er); else options.unlinkSync(p); } function rmdir2(p, options, originalEr, cb) { assert2(p); assert2(options); if (originalEr) assert2(originalEr instanceof Error); assert2(typeof cb === "function"); options.rmdir(p, function(er) { if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")) rmkids(p, options, cb); else if (er && er.code === "ENOTDIR") cb(originalEr); else cb(er); }); } function rmkids(p, options, cb) { assert2(p); assert2(options); assert2(typeof cb === "function"); options.readdir(p, function(er, files) { if (er) return cb(er); var n = files.length; if (n === 0) return options.rmdir(p, cb); var errState; files.forEach(function(f) { rimraf(path.join(p, f), options, function(er2) { if (errState) return; if (er2) return cb(errState = er2); if (--n === 0) options.rmdir(p, cb); }); }); }); } function rimrafSync(p, options) { options = options || {}; defaults2(options); assert2(p, "rimraf: missing path"); assert2.equal(typeof p, "string", "rimraf: path should be a string"); assert2(options, "rimraf: missing options"); assert2.equal(typeof options, "object", "rimraf: options should be object"); var results; if (options.disableGlob || !glob.hasMagic(p)) { results = [p]; } else { try { options.lstatSync(p); results = [p]; } catch (er) { results = glob.sync(p, options.glob); } } if (!results.length) return; for (var i = 0; i < results.length; i++) { var p = results[i]; try { var st = options.lstatSync(p); } catch (er) { if (er.code === "ENOENT") return; if (er.code === "EPERM" && isWindows) fixWinEPERMSync(p, options, er); } try { if (st && st.isDirectory()) rmdirSync(p, options, null); else options.unlinkSync(p); } catch (er) { if (er.code === "ENOENT") return; if (er.code === "EPERM") return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er); if (er.code !== "EISDIR") throw er; rmdirSync(p, options, er); } } } function rmdirSync(p, options, originalEr) { assert2(p); assert2(options); if (originalEr) assert2(originalEr instanceof Error); try { options.rmdirSync(p); } catch (er) { if (er.code === "ENOENT") return; if (er.code === "ENOTDIR") throw originalEr; if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM") rmkidsSync(p, options); } } function rmkidsSync(p, options) { assert2(p); assert2(options); options.readdirSync(p).forEach(function(f) { rimrafSync(path.join(p, f), options); }); var retries = isWindows ? 100 : 1; var i = 0; do { var threw = true; try { var ret = options.rmdirSync(p, options); threw = false; return ret; } finally { if (++i < retries && threw) continue; } } while (true); } }, , , , , , /* 239 */ /***/ function(module2, exports2, __webpack_require__) { "use strict"; var hasFlag2 = __webpack_require__(221); var support = function(level) { if (level === 0) { return false; } return { level, hasBasic: true, has256: level >= 2, has16m: level >= 3 }; }; var supportLevel = function() { if (hasFlag2("no-color") || hasFlag2("no-colors") || hasFlag2("color=false")) { return 0; } if (hasFlag2("color=16m") || hasFlag2("color=full") || hasFlag2("color=truecolor")) { return 3; } if (hasFlag2("color=256")) { return 2; } if (hasFlag2("color") || hasFlag2("colors") || hasFlag2("color=true") || hasFlag2("color=always")) { return 1; } if (process.stdout && !process.stdout.isTTY) { return 0; } if (process.platform === "win32") { return 1; } if ("CI" in process.env) { if ("TRAVIS" in process.env || process.env.CI === "Travis") { return 1; } return 0; } if ("TEAMCITY_VERSION" in process.env) { return process.env.TEAMCITY_VERSION.match(/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/) === null ? 0 : 1; } if (/^(screen|xterm)-256(?:color)?/.test(process.env.TERM)) { return 2; } if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)) { return 1; } if ("COLORTERM" in process.env) { return 1; } if (process.env.TERM === "dumb") { return 0; } return 0; }(); if (supportLevel === 0 && "FORCE_COLOR" in process.env) { supportLevel = 1; } module2.exports = process && support(supportLevel); } /******/ ]); } }); // import * as os from "os"; // function toCommandValue(input) { if (input === null || input === void 0) { return ""; } else if (typeof input === "string" || input instanceof String) { return input; } return JSON.stringify(input); } function toCommandProperties(annotationProperties) { if (!Object.keys(annotationProperties).length) { return {}; } return { title: annotationProperties.title, file: annotationProperties.file, line: annotationProperties.startLine, endLine: annotationProperties.endLine, col: annotationProperties.startColumn, endColumn: annotationProperties.endColumn }; } // function issueCommand(command2, properties, message) { const cmd = new Command(command2, properties, message); process.stdout.write(cmd.toString() + os.EOL); } var CMD_STRING = "::"; var Command = class { constructor(command2, properties, message) { if (!command2) { command2 = "missing.command"; } this.command = command2; this.properties = properties; this.message = message; } toString() { let cmdStr = CMD_STRING + this.command; if (this.properties && Object.keys(this.properties).length > 0) { cmdStr += " "; let first = true; for (const key in this.properties) { if (this.properties.hasOwnProperty(key)) { const val = this.properties[key]; if (val) { if (first) { first = false; } else { cmdStr += ","; } cmdStr += `${key}=${escapeProperty(val)}`; } } } } cmdStr += `${CMD_STRING}${escapeData(this.message)}`; return cmdStr; } }; function escapeData(s) { return toCommandValue(s).replace(/%/g, "%25").replace(/\r/g, "%0D").replace(/\n/g, "%0A"); } function escapeProperty(s) { return toCommandValue(s).replace(/%/g, "%25").replace(/\r/g, "%0D").replace(/\n/g, "%0A").replace(/:/g, "%3A").replace(/,/g, "%2C"); } // var tunnel = __toESM(require_tunnel2()); import { ProxyAgent } from "undici"; var HttpCodes; (function(HttpCodes2) { HttpCodes2[HttpCodes2["OK"] = 200] = "OK"; HttpCodes2[HttpCodes2["MultipleChoices"] = 300] = "MultipleChoices"; HttpCodes2[HttpCodes2["MovedPermanently"] = 301] = "MovedPermanently"; HttpCodes2[HttpCodes2["ResourceMoved"] = 302] = "ResourceMoved"; HttpCodes2[HttpCodes2["SeeOther"] = 303] = "SeeOther"; HttpCodes2[HttpCodes2["NotModified"] = 304] = "NotModified"; HttpCodes2[HttpCodes2["UseProxy"] = 305] = "UseProxy"; HttpCodes2[HttpCodes2["SwitchProxy"] = 306] = "SwitchProxy"; HttpCodes2[HttpCodes2["TemporaryRedirect"] = 307] = "TemporaryRedirect"; HttpCodes2[HttpCodes2["PermanentRedirect"] = 308] = "PermanentRedirect"; HttpCodes2[HttpCodes2["BadRequest"] = 400] = "BadRequest"; HttpCodes2[HttpCodes2["Unauthorized"] = 401] = "Unauthorized"; HttpCodes2[HttpCodes2["PaymentRequired"] = 402] = "PaymentRequired"; HttpCodes2[HttpCodes2["Forbidden"] = 403] = "Forbidden"; HttpCodes2[HttpCodes2["NotFound"] = 404] = "NotFound"; HttpCodes2[HttpCodes2["MethodNotAllowed"] = 405] = "MethodNotAllowed"; HttpCodes2[HttpCodes2["NotAcceptable"] = 406] = "NotAcceptable"; HttpCodes2[HttpCodes2["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired"; HttpCodes2[HttpCodes2["RequestTimeout"] = 408] = "RequestTimeout"; HttpCodes2[HttpCodes2["Conflict"] = 409] = "Conflict"; HttpCodes2[HttpCodes2["Gone"] = 410] = "Gone"; HttpCodes2[HttpCodes2["TooManyRequests"] = 429] = "TooManyRequests"; HttpCodes2[HttpCodes2["InternalServerError"] = 500] = "InternalServerError"; HttpCodes2[HttpCodes2["NotImplemented"] = 501] = "NotImplemented"; HttpCodes2[HttpCodes2["BadGateway"] = 502] = "BadGateway"; HttpCodes2[HttpCodes2["ServiceUnavailable"] = 503] = "ServiceUnavailable"; HttpCodes2[HttpCodes2["GatewayTimeout"] = 504] = "GatewayTimeout"; })(HttpCodes || (HttpCodes = {})); var Headers; (function(Headers2) { Headers2["Accept"] = "accept"; Headers2["ContentType"] = "content-type"; })(Headers || (Headers = {})); var MediaTypes; (function(MediaTypes2) { MediaTypes2["ApplicationJson"] = "application/json"; })(MediaTypes || (MediaTypes = {})); var HttpRedirectCodes = [ HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect ]; var HttpResponseRetryCodes = [ HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout ]; // import { EOL as EOL2 } from "os"; import { constants, promises } from "fs"; var __awaiter = function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve5) { resolve5(value); }); } return new (P || (P = Promise))(function(resolve5, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var { access, appendFile, writeFile } = promises; var SUMMARY_ENV_VAR = "GITHUB_STEP_SUMMARY"; var Summary = class { constructor() { this._buffer = ""; } /** * Finds the summary file path from the environment, rejects if env var is not found or file does not exist * Also checks r/w permissions. * * @returns step summary file path */ filePath() { return __awaiter(this, void 0, void 0, function* () { if (this._filePath) { return this._filePath; } const pathFromEnv = process.env[SUMMARY_ENV_VAR]; if (!pathFromEnv) { throw new Error(`Unable to find environment variable for $${SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`); } try { yield access(pathFromEnv, constants.R_OK | constants.W_OK); } catch (_a2) { throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`); } this._filePath = pathFromEnv; return this._filePath; }); } /** * Wraps content in an HTML tag, adding any HTML attributes * * @param {string} tag HTML tag to wrap * @param {string | null} content content within the tag * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add * * @returns {string} content wrapped in HTML element */ wrap(tag, content, attrs = {}) { const htmlAttrs = Object.entries(attrs).map(([key, value]) => ` ${key}="${value}"`).join(""); if (!content) { return `<${tag}${htmlAttrs}>`; } return `<${tag}${htmlAttrs}>${content}`; } /** * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default. * * @param {SummaryWriteOptions} [options] (optional) options for write operation * * @returns {Promise} summary instance */ write(options) { return __awaiter(this, void 0, void 0, function* () { const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite); const filePath = yield this.filePath(); const writeFunc = overwrite ? writeFile : appendFile; yield writeFunc(filePath, this._buffer, { encoding: "utf8" }); return this.emptyBuffer(); }); } /** * Clears the summary buffer and wipes the summary file * * @returns {Summary} summary instance */ clear() { return __awaiter(this, void 0, void 0, function* () { return this.emptyBuffer().write({ overwrite: true }); }); } /** * Returns the current summary buffer as a string * * @returns {string} string of summary buffer */ stringify() { return this._buffer; } /** * If the summary buffer is empty * * @returns {boolen} true if the buffer is empty */ isEmptyBuffer() { return this._buffer.length === 0; } /** * Resets the summary buffer without writing to summary file * * @returns {Summary} summary instance */ emptyBuffer() { this._buffer = ""; return this; } /** * Adds raw text to the summary buffer * * @param {string} text content to add * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false) * * @returns {Summary} summary instance */ addRaw(text, addEOL = false) { this._buffer += text; return addEOL ? this.addEOL() : this; } /** * Adds the operating system-specific end-of-line marker to the buffer * * @returns {Summary} summary instance */ addEOL() { return this.addRaw(EOL2); } /** * Adds an HTML codeblock to the summary buffer * * @param {string} code content to render within fenced code block * @param {string} lang (optional) language to syntax highlight code * * @returns {Summary} summary instance */ addCodeBlock(code, lang) { const attrs = Object.assign({}, lang && { lang }); const element = this.wrap("pre", this.wrap("code", code), attrs); return this.addRaw(element).addEOL(); } /** * Adds an HTML list to the summary buffer * * @param {string[]} items list of items to render * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false) * * @returns {Summary} summary instance */ addList(items, ordered = false) { const tag = ordered ? "ol" : "ul"; const listItems = items.map((item) => this.wrap("li", item)).join(""); const element = this.wrap(tag, listItems); return this.addRaw(element).addEOL(); } /** * Adds an HTML table to the summary buffer * * @param {SummaryTableCell[]} rows table rows * * @returns {Summary} summary instance */ addTable(rows) { const tableBody = rows.map((row) => { const cells = row.map((cell) => { if (typeof cell === "string") { return this.wrap("td", cell); } const { header, data, colspan, rowspan } = cell; const tag = header ? "th" : "td"; const attrs = Object.assign(Object.assign({}, colspan && { colspan }), rowspan && { rowspan }); return this.wrap(tag, data, attrs); }).join(""); return this.wrap("tr", cells); }).join(""); const element = this.wrap("table", tableBody); return this.addRaw(element).addEOL(); } /** * Adds a collapsable HTML details element to the summary buffer * * @param {string} label text for the closed state * @param {string} content collapsable content * * @returns {Summary} summary instance */ addDetails(label, content) { const element = this.wrap("details", this.wrap("summary", label) + content); return this.addRaw(element).addEOL(); } /** * Adds an HTML image tag to the summary buffer * * @param {string} src path to the image you to embed * @param {string} alt text description of the image * @param {SummaryImageOptions} options (optional) addition image attributes * * @returns {Summary} summary instance */ addImage(src, alt, options) { const { width, height } = options || {}; const attrs = Object.assign(Object.assign({}, width && { width }), height && { height }); const element = this.wrap("img", null, Object.assign({ src, alt }, attrs)); return this.addRaw(element).addEOL(); } /** * Adds an HTML section heading element * * @param {string} text heading text * @param {number | string} [level=1] (optional) the heading level, default: 1 * * @returns {Summary} summary instance */ addHeading(text, level) { const tag = `h${level}`; const allowedTag = ["h1", "h2", "h3", "h4", "h5", "h6"].includes(tag) ? tag : "h1"; const element = this.wrap(allowedTag, text); return this.addRaw(element).addEOL(); } /** * Adds an HTML thematic break (
) to the summary buffer * * @returns {Summary} summary instance */ addSeparator() { const element = this.wrap("hr", null); return this.addRaw(element).addEOL(); } /** * Adds an HTML line break (
) to the summary buffer * * @returns {Summary} summary instance */ addBreak() { const element = this.wrap("br", null); return this.addRaw(element).addEOL(); } /** * Adds an HTML blockquote to the summary buffer * * @param {string} text quote text * @param {string} cite (optional) citation url * * @returns {Summary} summary instance */ addQuote(text, cite) { const attrs = Object.assign({}, cite && { cite }); const element = this.wrap("blockquote", text, attrs); return this.addRaw(element).addEOL(); } /** * Adds an HTML anchor tag to the summary buffer * * @param {string} text link text/content * @param {string} href hyperlink * * @returns {Summary} summary instance */ addLink(text, href) { const element = this.wrap("a", text, { href }); return this.addRaw(element).addEOL(); } }; var _summary = new Summary(); // import os2 from "os"; // import * as fs from "fs"; var { chmod, copyFile, lstat, mkdir, open, readdir, rename, rm, rmdir, stat, symlink, unlink } = fs.promises; var IS_WINDOWS = process.platform === "win32"; var READONLY = fs.constants.O_RDONLY; // var IS_WINDOWS2 = process.platform === "win32"; // var platform = os2.platform(); var arch = os2.arch(); // var ExitCode; (function(ExitCode2) { ExitCode2[ExitCode2["Success"] = 0] = "Success"; ExitCode2[ExitCode2["Failure"] = 1] = "Failure"; })(ExitCode || (ExitCode = {})); function setSecret(secret) { issueCommand("add-mask", {}, secret); } function getInput(name, options) { const val = process.env[`INPUT_${name.replace(/ /g, "_").toUpperCase()}`] || ""; if (options && options.required && !val) { throw new Error(`Input required and not supplied: ${name}`); } if (options && options.trimWhitespace === false) { return val; } return val.trim(); } function setFailed(message) { process.exitCode = ExitCode.Failure; error(message); } function error(message, properties = {}) { issueCommand("error", toCommandProperties(properties), message instanceof Error ? message.toString() : message); } // import { readFileSync, existsSync } from "fs"; import { EOL as EOL3 } from "os"; var Context = class { /** * Hydrate the context from the environment */ constructor() { var _a2, _b2, _c2; this.payload = {}; if (process.env.GITHUB_EVENT_PATH) { if (existsSync(process.env.GITHUB_EVENT_PATH)) { this.payload = JSON.parse(readFileSync(process.env.GITHUB_EVENT_PATH, { encoding: "utf8" })); } else { const path = process.env.GITHUB_EVENT_PATH; process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${EOL3}`); } } this.eventName = process.env.GITHUB_EVENT_NAME; this.sha = process.env.GITHUB_SHA; this.ref = process.env.GITHUB_REF; this.workflow = process.env.GITHUB_WORKFLOW; this.action = process.env.GITHUB_ACTION; this.actor = process.env.GITHUB_ACTOR; this.job = process.env.GITHUB_JOB; this.runAttempt = parseInt(process.env.GITHUB_RUN_ATTEMPT, 10); this.runNumber = parseInt(process.env.GITHUB_RUN_NUMBER, 10); this.runId = parseInt(process.env.GITHUB_RUN_ID, 10); this.apiUrl = (_a2 = process.env.GITHUB_API_URL) !== null && _a2 !== void 0 ? _a2 : `https://api.github.com`; this.serverUrl = (_b2 = process.env.GITHUB_SERVER_URL) !== null && _b2 !== void 0 ? _b2 : `https://github.com`; this.graphqlUrl = (_c2 = process.env.GITHUB_GRAPHQL_URL) !== null && _c2 !== void 0 ? _c2 : `https://api.github.com/graphql`; } get issue() { const payload = this.payload; return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pull_request || payload).number }); } get repo() { if (process.env.GITHUB_REPOSITORY) { const [owner, repo] = process.env.GITHUB_REPOSITORY.split("/"); return { owner, repo }; } if (this.payload.repository) { return { owner: this.payload.repository.owner.login, repo: this.payload.repository.name }; } throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'"); } }; // var httpClient = __toESM(require_lib()); import { fetch as fetch2 } from "undici"; var __awaiter2 = function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve5) { resolve5(value); }); } return new (P || (P = Promise))(function(resolve5, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; function getProxyAgent(destinationUrl) { const hc = new httpClient.HttpClient(); return hc.getAgent(destinationUrl); } function getProxyAgentDispatcher(destinationUrl) { const hc = new httpClient.HttpClient(); return hc.getAgentDispatcher(destinationUrl); } function getProxyFetch(destinationUrl) { const httpDispatcher = getProxyAgentDispatcher(destinationUrl); const proxyFetch = (url, opts) => __awaiter2(this, void 0, void 0, function* () { return fetch2(url, Object.assign(Object.assign({}, opts), { dispatcher: httpDispatcher })); }); return proxyFetch; } function getApiBaseUrl() { return process.env["GITHUB_API_URL"] || "https://api.github.com"; } // function getUserAgent() { if (typeof navigator === "object" && "userAgent" in navigator) { return navigator.userAgent; } if (typeof process === "object" && process.version !== void 0) { return `Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`; } return ""; } // function register(state, name, method, options) { if (typeof method !== "function") { throw new Error("method for before hook must be a function"); } if (!options) { options = {}; } if (Array.isArray(name)) { return name.reverse().reduce((callback, name2) => { return register.bind(null, state, name2, callback, options); }, method)(); } return Promise.resolve().then(() => { if (!state.registry[name]) { return method(options); } return state.registry[name].reduce((method2, registered) => { return registered.hook.bind(null, method2, options); }, method)(); }); } // function addHook(state, kind, name, hook3) { const orig = hook3; if (!state.registry[name]) { state.registry[name] = []; } if (kind === "before") { hook3 = (method, options) => { return Promise.resolve().then(orig.bind(null, options)).then(method.bind(null, options)); }; } if (kind === "after") { hook3 = (method, options) => { let result; return Promise.resolve().then(method.bind(null, options)).then((result_) => { result = result_; return orig(result, options); }).then(() => { return result; }); }; } if (kind === "error") { hook3 = (method, options) => { return Promise.resolve().then(method.bind(null, options)).catch((error2) => { return orig(error2, options); }); }; } state.registry[name].push({ hook: hook3, orig }); } // function removeHook(state, name, method) { if (!state.registry[name]) { return; } const index = state.registry[name].map((registered) => { return registered.orig; }).indexOf(method); if (index === -1) { return; } state.registry[name].splice(index, 1); } // var bind = Function.bind; var bindable = bind.bind(bind); function bindApi(hook3, state, name) { const removeHookRef = bindable(removeHook, null).apply( null, name ? [state, name] : [state] ); hook3.api = { remove: removeHookRef }; hook3.remove = removeHookRef; ["before", "error", "after", "wrap"].forEach((kind) => { const args = name ? [state, kind, name] : [state, kind]; hook3[kind] = hook3.api[kind] = bindable(addHook, null).apply(null, args); }); } function Singular() { const singularHookName = Symbol("Singular"); const singularHookState = { registry: {} }; const singularHook = register.bind(null, singularHookState, singularHookName); bindApi(singularHook, singularHookState, singularHookName); return singularHook; } function Collection() { const state = { registry: {} }; const hook3 = register.bind(null, state); bindApi(hook3, state); return hook3; } var before_after_hook_default = { Singular, Collection }; // var VERSION = "0.0.0-development"; var userAgent = `octokit-endpoint.js/${VERSION} ${getUserAgent()}`; var DEFAULTS = { method: "GET", baseUrl: "https://api.github.com", headers: { accept: "application/vnd.github.v3+json", "user-agent": userAgent }, mediaType: { format: "" } }; function lowercaseKeys(object) { if (!object) { return {}; } return Object.keys(object).reduce((newObj, key) => { newObj[key.toLowerCase()] = object[key]; return newObj; }, {}); } function isPlainObject(value) { if (typeof value !== "object" || value === null) return false; if (Object.prototype.toString.call(value) !== "[object Object]") return false; const proto = Object.getPrototypeOf(value); if (proto === null) return true; const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor; return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value); } function mergeDeep(defaults2, options) { const result = Object.assign({}, defaults2); Object.keys(options).forEach((key) => { if (isPlainObject(options[key])) { if (!(key in defaults2)) Object.assign(result, { [key]: options[key] }); else result[key] = mergeDeep(defaults2[key], options[key]); } else { Object.assign(result, { [key]: options[key] }); } }); return result; } function removeUndefinedProperties(obj) { for (const key in obj) { if (obj[key] === void 0) { delete obj[key]; } } return obj; } function merge(defaults2, route, options) { if (typeof route === "string") { let [method, url] = route.split(" "); options = Object.assign(url ? { method, url } : { url: method }, options); } else { options = Object.assign({}, route); } options.headers = lowercaseKeys(options.headers); removeUndefinedProperties(options); removeUndefinedProperties(options.headers); const mergedOptions = mergeDeep(defaults2 || {}, options); if (options.url === "/graphql") { if (defaults2 && defaults2.mediaType.previews?.length) { mergedOptions.mediaType.previews = defaults2.mediaType.previews.filter( (preview) => !mergedOptions.mediaType.previews.includes(preview) ).concat(mergedOptions.mediaType.previews); } mergedOptions.mediaType.previews = (mergedOptions.mediaType.previews || []).map((preview) => preview.replace(/-preview/, "")); } return mergedOptions; } function addQueryParameters(url, parameters) { const separator = /\?/.test(url) ? "&" : "?"; const names = Object.keys(parameters); if (names.length === 0) { return url; } return url + separator + names.map((name) => { if (name === "q") { return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+"); } return `${name}=${encodeURIComponent(parameters[name])}`; }).join("&"); } var urlVariableRegex = /\{[^{}}]+\}/g; function removeNonChars(variableName) { return variableName.replace(/(?:^\W+)|(?:(? a.concat(b), []); } function omit(object, keysToOmit) { const result = { __proto__: null }; for (const key of Object.keys(object)) { if (keysToOmit.indexOf(key) === -1) { result[key] = object[key]; } } return result; } function encodeReserved(str) { return str.split(/(%[0-9A-Fa-f]{2})/g).map(function(part) { if (!/%[0-9A-Fa-f]/.test(part)) { part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]"); } return part; }).join(""); } function encodeUnreserved(str) { return encodeURIComponent(str).replace(/[!'()*]/g, function(c) { return "%" + c.charCodeAt(0).toString(16).toUpperCase(); }); } function encodeValue(operator, value, key) { value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value); if (key) { return encodeUnreserved(key) + "=" + value; } else { return value; } } function isDefined(value) { return value !== void 0 && value !== null; } function isKeyOperator(operator) { return operator === ";" || operator === "&" || operator === "?"; } function getValues(context3, operator, key, modifier) { var value = context3[key], result = []; if (isDefined(value) && value !== "") { if (typeof value === "string" || typeof value === "number" || typeof value === "bigint" || typeof value === "boolean") { value = value.toString(); if (modifier && modifier !== "*") { value = value.substring(0, parseInt(modifier, 10)); } result.push( encodeValue(operator, value, isKeyOperator(operator) ? key : "") ); } else { if (modifier === "*") { if (Array.isArray(value)) { value.filter(isDefined).forEach(function(value2) { result.push( encodeValue(operator, value2, isKeyOperator(operator) ? key : "") ); }); } else { Object.keys(value).forEach(function(k) { if (isDefined(value[k])) { result.push(encodeValue(operator, value[k], k)); } }); } } else { const tmp = []; if (Array.isArray(value)) { value.filter(isDefined).forEach(function(value2) { tmp.push(encodeValue(operator, value2)); }); } else { Object.keys(value).forEach(function(k) { if (isDefined(value[k])) { tmp.push(encodeUnreserved(k)); tmp.push(encodeValue(operator, value[k].toString())); } }); } if (isKeyOperator(operator)) { result.push(encodeUnreserved(key) + "=" + tmp.join(",")); } else if (tmp.length !== 0) { result.push(tmp.join(",")); } } } } else { if (operator === ";") { if (isDefined(value)) { result.push(encodeUnreserved(key)); } } else if (value === "" && (operator === "&" || operator === "?")) { result.push(encodeUnreserved(key) + "="); } else if (value === "") { result.push(""); } } return result; } function parseUrl(template) { return { expand: expand.bind(null, template) }; } function expand(template, context3) { var operators = ["+", "#", ".", "/", ";", "?", "&"]; template = template.replace( /\{([^\{\}]+)\}|([^\{\}]+)/g, function(_, expression, literal) { if (expression) { let operator = ""; const values = []; if (operators.indexOf(expression.charAt(0)) !== -1) { operator = expression.charAt(0); expression = expression.substr(1); } expression.split(/,/g).forEach(function(variable) { var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable); values.push(getValues(context3, operator, tmp[1], tmp[2] || tmp[3])); }); if (operator && operator !== "+") { var separator = ","; if (operator === "?") { separator = "&"; } else if (operator !== "#") { separator = operator; } return (values.length !== 0 ? operator : "") + values.join(separator); } else { return values.join(","); } } else { return encodeReserved(literal); } } ); if (template === "/") { return template; } else { return template.replace(/\/$/, ""); } } function parse(options) { let method = options.method.toUpperCase(); let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{$1}"); let headers = Object.assign({}, options.headers); let body; let parameters = omit(options, [ "method", "baseUrl", "url", "headers", "request", "mediaType" ]); const urlVariableNames = extractUrlVariableNames(url); url = parseUrl(url).expand(parameters); if (!/^http/.test(url)) { url = options.baseUrl + url; } const omittedParameters = Object.keys(options).filter((option) => urlVariableNames.includes(option)).concat("baseUrl"); const remainingParameters = omit(parameters, omittedParameters); const isBinaryRequest = /application\/octet-stream/i.test(headers.accept); if (!isBinaryRequest) { if (options.mediaType.format) { headers.accept = headers.accept.split(/,/).map( (format3) => format3.replace( /application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${options.mediaType.format}` ) ).join(","); } if (url.endsWith("/graphql")) { if (options.mediaType.previews?.length) { const previewsFromAcceptHeader = headers.accept.match(/(? { const format3 = options.mediaType.format ? `.${options.mediaType.format}` : "+json"; return `application/vnd.github.${preview}-preview${format3}`; }).join(","); } } } if (["GET", "HEAD"].includes(method)) { url = addQueryParameters(url, remainingParameters); } else { if ("data" in remainingParameters) { body = remainingParameters.data; } else { if (Object.keys(remainingParameters).length) { body = remainingParameters; } } } if (!headers["content-type"] && typeof body !== "undefined") { headers["content-type"] = "application/json; charset=utf-8"; } if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") { body = ""; } return Object.assign( { method, url, headers }, typeof body !== "undefined" ? { body } : null, options.request ? { request: options.request } : null ); } function endpointWithDefaults(defaults2, route, options) { return parse(merge(defaults2, route, options)); } function withDefaults(oldDefaults, newDefaults) { const DEFAULTS22 = merge(oldDefaults, newDefaults); const endpoint22 = endpointWithDefaults.bind(null, DEFAULTS22); return Object.assign(endpoint22, { DEFAULTS: DEFAULTS22, defaults: withDefaults.bind(null, DEFAULTS22), merge: merge.bind(null, DEFAULTS22), parse }); } var endpoint = withDefaults(null, DEFAULTS); // var import_fast_content_type_parse = __toESM(require_fast_content_type_parse()); // var intRegex = /^-?\d+$/; var noiseValue = /^-?\d+n+$/; var originalStringify = JSON.stringify; var originalParse = JSON.parse; var customFormat = /^-?\d+n$/; var bigIntsStringify = /([\[:])?"(-?\d+)n"($|([\\n]|\s)*(\s|[\\n])*[,\}\]])/g; var noiseStringify = /([\[:])?("-?\d+n+)n("$|"([\\n]|\s)*(\s|[\\n])*[,\}\]])/g; var JSONStringify = (value, replacer, space) => { if ("rawJSON" in JSON) { return originalStringify( value, (key, value2) => { if (typeof value2 === "bigint") return JSON.rawJSON(value2.toString()); if (typeof replacer === "function") return replacer(key, value2); if (Array.isArray(replacer) && replacer.includes(key)) return value2; return value2; }, space ); } if (!value) return originalStringify(value, replacer, space); const convertedToCustomJSON = originalStringify( value, (key, value2) => { const isNoise = typeof value2 === "string" && noiseValue.test(value2); if (isNoise) return value2.toString() + "n"; if (typeof value2 === "bigint") return value2.toString() + "n"; if (typeof replacer === "function") return replacer(key, value2); if (Array.isArray(replacer) && replacer.includes(key)) return value2; return value2; }, space ); const processedJSON = convertedToCustomJSON.replace( bigIntsStringify, "$1$2$3" ); const denoisedJSON = processedJSON.replace(noiseStringify, "$1$2$3"); return denoisedJSON; }; var featureCache = /* @__PURE__ */ new Map(); var isContextSourceSupported = () => { const parseFingerprint = JSON.parse.toString(); if (featureCache.has(parseFingerprint)) { return featureCache.get(parseFingerprint); } try { const result = JSON.parse( "1", (_, __, context3) => !!context3?.source && context3.source === "1" ); featureCache.set(parseFingerprint, result); return result; } catch { featureCache.set(parseFingerprint, false); return false; } }; var convertMarkedBigIntsReviver = (key, value, context3, userReviver) => { const isCustomFormatBigInt = typeof value === "string" && customFormat.test(value); if (isCustomFormatBigInt) return BigInt(value.slice(0, -1)); const isNoiseValue = typeof value === "string" && noiseValue.test(value); if (isNoiseValue) return value.slice(0, -1); if (typeof userReviver !== "function") return value; return userReviver(key, value, context3); }; var JSONParseV2 = (text, reviver) => { return JSON.parse(text, (key, value, context3) => { const isBigNumber = typeof value === "number" && (value > Number.MAX_SAFE_INTEGER || value < Number.MIN_SAFE_INTEGER); const isInt = context3 && intRegex.test(context3.source); const isBigInt = isBigNumber && isInt; if (isBigInt) return BigInt(context3.source); if (typeof reviver !== "function") return value; return reviver(key, value, context3); }); }; var MAX_INT = Number.MAX_SAFE_INTEGER.toString(); var MAX_DIGITS = MAX_INT.length; var stringsOrLargeNumbers = /"(?:\\.|[^"])*"|-?(0|[1-9][0-9]*)(\.[0-9]+)?([eE][+-]?[0-9]+)?/g; var noiseValueWithQuotes = /^"-?\d+n+"$/; var JSONParse = (text, reviver) => { if (!text) return originalParse(text, reviver); if (isContextSourceSupported()) return JSONParseV2(text, reviver); const serializedData = text.replace( stringsOrLargeNumbers, (text2, digits, fractional, exponential) => { const isString = text2[0] === '"'; const isNoise = isString && noiseValueWithQuotes.test(text2); if (isNoise) return text2.substring(0, text2.length - 1) + 'n"'; const isFractionalOrExponential = fractional || exponential; const isLessThanMaxSafeInt = digits && (digits.length < MAX_DIGITS || digits.length === MAX_DIGITS && digits <= MAX_INT); if (isString || isFractionalOrExponential || isLessThanMaxSafeInt) return text2; return '"' + text2 + 'n"'; } ); return originalParse( serializedData, (key, value, context3) => convertMarkedBigIntsReviver(key, value, context3, reviver) ); }; // var RequestError = class extends Error { name; /** * http status code */ status; /** * Request options that lead to the error. */ request; /** * Response object if a response was received */ response; constructor(message, statusCode, options) { super(message, { cause: options.cause }); this.name = "HttpError"; this.status = Number.parseInt(statusCode); if (Number.isNaN(this.status)) { this.status = 0; } if ("response" in options) { this.response = options.response; } const requestCopy = Object.assign({}, options.request); if (options.request.headers.authorization) { requestCopy.headers = Object.assign({}, options.request.headers, { authorization: options.request.headers.authorization.replace( /(? ""; async function fetchWrapper(requestOptions) { const fetch3 = requestOptions.request?.fetch || globalThis.fetch; if (!fetch3) { throw new Error( "fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing" ); } const log = requestOptions.request?.log || console; const parseSuccessResponseBody = requestOptions.request?.parseSuccessResponseBody !== false; const body = isPlainObject2(requestOptions.body) || Array.isArray(requestOptions.body) ? JSONStringify(requestOptions.body) : requestOptions.body; const requestHeaders = Object.fromEntries( Object.entries(requestOptions.headers).map(([name, value]) => [ name, String(value) ]) ); let fetchResponse; try { fetchResponse = await fetch3(requestOptions.url, { method: requestOptions.method, body, redirect: requestOptions.request?.redirect, headers: requestHeaders, signal: requestOptions.request?.signal, // duplex must be set if request.body is ReadableStream or Async Iterables. // See https://fetch.spec.whatwg.org/#dom-requestinit-duplex. ...requestOptions.body && { duplex: "half" } }); } catch (error2) { let message = "Unknown Error"; if (error2 instanceof Error) { if (error2.name === "AbortError") { error2.status = 500; throw error2; } message = error2.message; if (error2.name === "TypeError" && "cause" in error2) { if (error2.cause instanceof Error) { message = error2.cause.message; } else if (typeof error2.cause === "string") { message = error2.cause; } } } const requestError = new RequestError(message, 500, { request: requestOptions }); requestError.cause = error2; throw requestError; } const status = fetchResponse.status; const url = fetchResponse.url; const responseHeaders = {}; for (const [key, value] of fetchResponse.headers) { responseHeaders[key] = value; } const octokitResponse = { url, status, headers: responseHeaders, data: "" }; if ("deprecation" in responseHeaders) { const matches = responseHeaders.link && responseHeaders.link.match(/<([^<>]+)>; rel="deprecation"/); const deprecationLink = matches && matches.pop(); log.warn( `[@octokit/request] "${requestOptions.method} ${requestOptions.url}" is deprecated. It is scheduled to be removed on ${responseHeaders.sunset}${deprecationLink ? `. See ${deprecationLink}` : ""}` ); } if (status === 204 || status === 205) { return octokitResponse; } if (requestOptions.method === "HEAD") { if (status < 400) { return octokitResponse; } throw new RequestError(fetchResponse.statusText, status, { response: octokitResponse, request: requestOptions }); } if (status === 304) { octokitResponse.data = await getResponseData(fetchResponse); throw new RequestError("Not modified", status, { response: octokitResponse, request: requestOptions }); } if (status >= 400) { octokitResponse.data = await getResponseData(fetchResponse); throw new RequestError(toErrorMessage(octokitResponse.data), status, { response: octokitResponse, request: requestOptions }); } octokitResponse.data = parseSuccessResponseBody ? await getResponseData(fetchResponse) : fetchResponse.body; return octokitResponse; } async function getResponseData(response) { const contentType = response.headers.get("content-type"); if (!contentType) { return response.text().catch(noop); } const mimetype = (0, import_fast_content_type_parse.safeParse)(contentType); if (isJSONResponse(mimetype)) { let text = ""; try { text = await response.text(); return JSONParse(text); } catch (err) { return text; } } else if (mimetype.type.startsWith("text/") || mimetype.parameters.charset?.toLowerCase() === "utf-8") { return response.text().catch(noop); } else { return response.arrayBuffer().catch( /* v8 ignore next -- @preserve */ () => new ArrayBuffer(0) ); } } function isJSONResponse(mimetype) { return mimetype.type === "application/json" || mimetype.type === "application/scim+json"; } function toErrorMessage(data) { if (typeof data === "string") { return data; } if (data instanceof ArrayBuffer) { return "Unknown error"; } if ("message" in data) { const suffix = "documentation_url" in data ? ` - ${data.documentation_url}` : ""; return Array.isArray(data.errors) ? `${data.message}: ${data.errors.map((v) => JSON.stringify(v)).join(", ")}${suffix}` : `${data.message}${suffix}`; } return `Unknown error: ${JSON.stringify(data)}`; } function withDefaults2(oldEndpoint, newDefaults) { const endpoint22 = oldEndpoint.defaults(newDefaults); const newApi = function(route, parameters) { const endpointOptions = endpoint22.merge(route, parameters); if (!endpointOptions.request || !endpointOptions.request.hook) { return fetchWrapper(endpoint22.parse(endpointOptions)); } const request22 = (route2, parameters2) => { return fetchWrapper( endpoint22.parse(endpoint22.merge(route2, parameters2)) ); }; Object.assign(request22, { endpoint: endpoint22, defaults: withDefaults2.bind(null, endpoint22) }); return endpointOptions.request.hook(request22, endpointOptions); }; return Object.assign(newApi, { endpoint: endpoint22, defaults: withDefaults2.bind(null, endpoint22) }); } var request = withDefaults2(endpoint, defaults_default); // var VERSION3 = "0.0.0-development"; function _buildMessageForResponseErrors(data) { return `Request failed due to following response errors: ` + data.errors.map((e) => ` - ${e.message}`).join("\n"); } var GraphqlResponseError = class extends Error { constructor(request22, headers, response) { super(_buildMessageForResponseErrors(response)); this.request = request22; this.headers = headers; this.response = response; this.errors = response.errors; this.data = response.data; if (Error.captureStackTrace) { Error.captureStackTrace(this, this.constructor); } } name = "GraphqlResponseError"; errors; data; }; var NON_VARIABLE_OPTIONS = [ "method", "baseUrl", "url", "headers", "request", "query", "mediaType", "operationName" ]; var FORBIDDEN_VARIABLE_OPTIONS = ["query", "method", "url"]; var GHES_V3_SUFFIX_REGEX = /\/api\/v3\/?$/; function graphql(request22, query2, options) { if (options) { if (typeof query2 === "string" && "query" in options) { return Promise.reject( new Error(`[@octokit/graphql] "query" cannot be used as variable name`) ); } for (const key in options) { if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key)) continue; return Promise.reject( new Error( `[@octokit/graphql] "${key}" cannot be used as variable name` ) ); } } const parsedOptions = typeof query2 === "string" ? Object.assign({ query: query2 }, options) : query2; const requestOptions = Object.keys( parsedOptions ).reduce((result, key) => { if (NON_VARIABLE_OPTIONS.includes(key)) { result[key] = parsedOptions[key]; return result; } if (!result.variables) { result.variables = {}; } result.variables[key] = parsedOptions[key]; return result; }, {}); const baseUrl2 = parsedOptions.baseUrl || request22.endpoint.DEFAULTS.baseUrl; if (GHES_V3_SUFFIX_REGEX.test(baseUrl2)) { requestOptions.url = baseUrl2.replace(GHES_V3_SUFFIX_REGEX, "/api/graphql"); } return request22(requestOptions).then((response) => { if (response.data.errors) { const headers = {}; for (const key of Object.keys(response.headers)) { headers[key] = response.headers[key]; } throw new GraphqlResponseError( requestOptions, headers, response.data ); } return response.data.data; }); } function withDefaults3(request22, newDefaults) { const newRequest = request22.defaults(newDefaults); const newApi = (query2, options) => { return graphql(newRequest, query2, options); }; return Object.assign(newApi, { defaults: withDefaults3.bind(null, newRequest), endpoint: newRequest.endpoint }); } var graphql2 = withDefaults3(request, { headers: { "user-agent": `octokit-graphql.js/${VERSION3} ${getUserAgent()}` }, method: "POST", url: "/graphql" }); function withCustomRequest(customRequest) { return withDefaults3(customRequest, { method: "POST", url: "/graphql" }); } // var b64url = "(?:[a-zA-Z0-9_-]+)"; var sep = "\\."; var jwtRE = new RegExp(`^${b64url}${sep}${b64url}${sep}${b64url}$`); var isJWT = jwtRE.test.bind(jwtRE); async function auth(token) { const isApp = isJWT(token); const isInstallation = token.startsWith("v1.") || token.startsWith("ghs_"); const isUserToServer = token.startsWith("ghu_"); const tokenType = isApp ? "app" : isInstallation ? "installation" : isUserToServer ? "user-to-server" : "oauth"; return { type: "token", token, tokenType }; } function withAuthorizationPrefix(token) { if (token.split(/\./).length === 3) { return `bearer ${token}`; } return `token ${token}`; } async function hook(token, request3, route, parameters) { const endpoint3 = request3.endpoint.merge( route, parameters ); endpoint3.headers.authorization = withAuthorizationPrefix(token); return request3(endpoint3); } var createTokenAuth = function createTokenAuth2(token) { if (!token) { throw new Error("[@octokit/auth-token] No token passed to createTokenAuth"); } if (typeof token !== "string") { throw new Error( "[@octokit/auth-token] Token passed to createTokenAuth is not a string" ); } token = token.replace(/^(token|bearer) +/i, ""); return Object.assign(auth.bind(null, token), { hook: hook.bind(null, token) }); }; // var VERSION4 = "7.0.6"; // var noop2 = () => { }; var consoleWarn = console.warn.bind(console); var consoleError = console.error.bind(console); function createLogger(logger = {}) { if (typeof logger.debug !== "function") { logger.debug = noop2; } if (typeof logger.info !== "function") { logger.info = noop2; } if (typeof logger.warn !== "function") { logger.warn = consoleWarn; } if (typeof logger.error !== "function") { logger.error = consoleError; } return logger; } var userAgentTrail = `octokit-core.js/${VERSION4} ${getUserAgent()}`; var Octokit = class { static VERSION = VERSION4; static defaults(defaults2) { const OctokitWithDefaults = class extends this { constructor(...args) { const options = args[0] || {}; if (typeof defaults2 === "function") { super(defaults2(options)); return; } super( Object.assign( {}, defaults2, options, options.userAgent && defaults2.userAgent ? { userAgent: `${options.userAgent} ${defaults2.userAgent}` } : null ) ); } }; return OctokitWithDefaults; } static plugins = []; /** * Attach a plugin (or many) to your Octokit instance. * * @example * const API = Octokit.plugin(plugin1, plugin2, plugin3, ...) */ static plugin(...newPlugins) { const currentPlugins = this.plugins; const NewOctokit = class extends this { static plugins = currentPlugins.concat( newPlugins.filter((plugin) => !currentPlugins.includes(plugin)) ); }; return NewOctokit; } constructor(options = {}) { const hook3 = new before_after_hook_default.Collection(); const requestDefaults = { baseUrl: request.endpoint.DEFAULTS.baseUrl, headers: {}, request: Object.assign({}, options.request, { // @ts-ignore internal usage only, no need to type hook: hook3.bind(null, "request") }), mediaType: { previews: [], format: "" } }; requestDefaults.headers["user-agent"] = options.userAgent ? `${options.userAgent} ${userAgentTrail}` : userAgentTrail; if (options.baseUrl) { requestDefaults.baseUrl = options.baseUrl; } if (options.previews) { requestDefaults.mediaType.previews = options.previews; } if (options.timeZone) { requestDefaults.headers["time-zone"] = options.timeZone; } this.request = request.defaults(requestDefaults); this.graphql = withCustomRequest(this.request).defaults(requestDefaults); this.log = createLogger(options.log); this.hook = hook3; if (!options.authStrategy) { if (!options.auth) { this.auth = async () => ({ type: "unauthenticated" }); } else { const auth3 = createTokenAuth(options.auth); hook3.wrap("request", auth3.hook); this.auth = auth3; } } else { const { authStrategy, ...otherOptions } = options; const auth3 = authStrategy( Object.assign( { request: this.request, log: this.log, // we pass the current octokit instance as well as its constructor options // to allow for authentication strategies that return a new octokit instance // that shares the same internal state as the current one. The original // requirement for this was the "event-octokit" authentication strategy // of https://github.com/probot/octokit-auth-probot. octokit: this, octokitOptions: otherOptions }, options.auth ) ); hook3.wrap("request", auth3.hook); this.auth = auth3; } const classConstructor = this.constructor; for (let i = 0; i < classConstructor.plugins.length; ++i) { Object.assign(this, classConstructor.plugins[i](this, options)); } } // assigned during constructor request; graphql; log; hook; // TODO: type `octokit.auth` based on passed options.authStrategy auth; }; // var VERSION5 = "17.0.0"; // var Endpoints = { actions: { addCustomLabelsToSelfHostedRunnerForOrg: [ "POST /orgs/{org}/actions/runners/{runner_id}/labels" ], addCustomLabelsToSelfHostedRunnerForRepo: [ "POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels" ], addRepoAccessToSelfHostedRunnerGroupInOrg: [ "PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}" ], addSelectedRepoToOrgSecret: [ "PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}" ], addSelectedRepoToOrgVariable: [ "PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}" ], approveWorkflowRun: [ "POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve" ], cancelWorkflowRun: [ "POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel" ], createEnvironmentVariable: [ "POST /repos/{owner}/{repo}/environments/{environment_name}/variables" ], createHostedRunnerForOrg: ["POST /orgs/{org}/actions/hosted-runners"], createOrUpdateEnvironmentSecret: [ "PUT /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}" ], createOrUpdateOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}"], createOrUpdateRepoSecret: [ "PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}" ], createOrgVariable: ["POST /orgs/{org}/actions/variables"], createRegistrationTokenForOrg: [ "POST /orgs/{org}/actions/runners/registration-token" ], createRegistrationTokenForRepo: [ "POST /repos/{owner}/{repo}/actions/runners/registration-token" ], createRemoveTokenForOrg: ["POST /orgs/{org}/actions/runners/remove-token"], createRemoveTokenForRepo: [ "POST /repos/{owner}/{repo}/actions/runners/remove-token" ], createRepoVariable: ["POST /repos/{owner}/{repo}/actions/variables"], createWorkflowDispatch: [ "POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches" ], deleteActionsCacheById: [ "DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}" ], deleteActionsCacheByKey: [ "DELETE /repos/{owner}/{repo}/actions/caches{?key,ref}" ], deleteArtifact: [ "DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}" ], deleteCustomImageFromOrg: [ "DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}" ], deleteCustomImageVersionFromOrg: [ "DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}" ], deleteEnvironmentSecret: [ "DELETE /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}" ], deleteEnvironmentVariable: [ "DELETE /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}" ], deleteHostedRunnerForOrg: [ "DELETE /orgs/{org}/actions/hosted-runners/{hosted_runner_id}" ], deleteOrgSecret: ["DELETE /orgs/{org}/actions/secrets/{secret_name}"], deleteOrgVariable: ["DELETE /orgs/{org}/actions/variables/{name}"], deleteRepoSecret: [ "DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}" ], deleteRepoVariable: [ "DELETE /repos/{owner}/{repo}/actions/variables/{name}" ], deleteSelfHostedRunnerFromOrg: [ "DELETE /orgs/{org}/actions/runners/{runner_id}" ], deleteSelfHostedRunnerFromRepo: [ "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}" ], deleteWorkflowRun: ["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}"], deleteWorkflowRunLogs: [ "DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs" ], disableSelectedRepositoryGithubActionsOrganization: [ "DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}" ], disableWorkflow: [ "PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable" ], downloadArtifact: [ "GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}" ], downloadJobLogsForWorkflowRun: [ "GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs" ], downloadWorkflowRunAttemptLogs: [ "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs" ], downloadWorkflowRunLogs: [ "GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs" ], enableSelectedRepositoryGithubActionsOrganization: [ "PUT /orgs/{org}/actions/permissions/repositories/{repository_id}" ], enableWorkflow: [ "PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable" ], forceCancelWorkflowRun: [ "POST /repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel" ], generateRunnerJitconfigForOrg: [ "POST /orgs/{org}/actions/runners/generate-jitconfig" ], generateRunnerJitconfigForRepo: [ "POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig" ], getActionsCacheList: ["GET /repos/{owner}/{repo}/actions/caches"], getActionsCacheUsage: ["GET /repos/{owner}/{repo}/actions/cache/usage"], getActionsCacheUsageByRepoForOrg: [ "GET /orgs/{org}/actions/cache/usage-by-repository" ], getActionsCacheUsageForOrg: ["GET /orgs/{org}/actions/cache/usage"], getAllowedActionsOrganization: [ "GET /orgs/{org}/actions/permissions/selected-actions" ], getAllowedActionsRepository: [ "GET /repos/{owner}/{repo}/actions/permissions/selected-actions" ], getArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"], getCustomImageForOrg: [ "GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}" ], getCustomImageVersionForOrg: [ "GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}" ], getCustomOidcSubClaimForRepo: [ "GET /repos/{owner}/{repo}/actions/oidc/customization/sub" ], getEnvironmentPublicKey: [ "GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/public-key" ], getEnvironmentSecret: [ "GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}" ], getEnvironmentVariable: [ "GET /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}" ], getGithubActionsDefaultWorkflowPermissionsOrganization: [ "GET /orgs/{org}/actions/permissions/workflow" ], getGithubActionsDefaultWorkflowPermissionsRepository: [ "GET /repos/{owner}/{repo}/actions/permissions/workflow" ], getGithubActionsPermissionsOrganization: [ "GET /orgs/{org}/actions/permissions" ], getGithubActionsPermissionsRepository: [ "GET /repos/{owner}/{repo}/actions/permissions" ], getHostedRunnerForOrg: [ "GET /orgs/{org}/actions/hosted-runners/{hosted_runner_id}" ], getHostedRunnersGithubOwnedImagesForOrg: [ "GET /orgs/{org}/actions/hosted-runners/images/github-owned" ], getHostedRunnersLimitsForOrg: [ "GET /orgs/{org}/actions/hosted-runners/limits" ], getHostedRunnersMachineSpecsForOrg: [ "GET /orgs/{org}/actions/hosted-runners/machine-sizes" ], getHostedRunnersPartnerImagesForOrg: [ "GET /orgs/{org}/actions/hosted-runners/images/partner" ], getHostedRunnersPlatformsForOrg: [ "GET /orgs/{org}/actions/hosted-runners/platforms" ], getJobForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"], getOrgPublicKey: ["GET /orgs/{org}/actions/secrets/public-key"], getOrgSecret: ["GET /orgs/{org}/actions/secrets/{secret_name}"], getOrgVariable: ["GET /orgs/{org}/actions/variables/{name}"], getPendingDeploymentsForRun: [ "GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments" ], getRepoPermissions: [ "GET /repos/{owner}/{repo}/actions/permissions", {}, { renamed: ["actions", "getGithubActionsPermissionsRepository"] } ], getRepoPublicKey: ["GET /repos/{owner}/{repo}/actions/secrets/public-key"], getRepoSecret: ["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"], getRepoVariable: ["GET /repos/{owner}/{repo}/actions/variables/{name}"], getReviewsForRun: [ "GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals" ], getSelfHostedRunnerForOrg: ["GET /orgs/{org}/actions/runners/{runner_id}"], getSelfHostedRunnerForRepo: [ "GET /repos/{owner}/{repo}/actions/runners/{runner_id}" ], getWorkflow: ["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"], getWorkflowAccessToRepository: [ "GET /repos/{owner}/{repo}/actions/permissions/access" ], getWorkflowRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}"], getWorkflowRunAttempt: [ "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}" ], getWorkflowRunUsage: [ "GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing" ], getWorkflowUsage: [ "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing" ], listArtifactsForRepo: ["GET /repos/{owner}/{repo}/actions/artifacts"], listCustomImageVersionsForOrg: [ "GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions" ], listCustomImagesForOrg: [ "GET /orgs/{org}/actions/hosted-runners/images/custom" ], listEnvironmentSecrets: [ "GET /repos/{owner}/{repo}/environments/{environment_name}/secrets" ], listEnvironmentVariables: [ "GET /repos/{owner}/{repo}/environments/{environment_name}/variables" ], listGithubHostedRunnersInGroupForOrg: [ "GET /orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners" ], listHostedRunnersForOrg: ["GET /orgs/{org}/actions/hosted-runners"], listJobsForWorkflowRun: [ "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs" ], listJobsForWorkflowRunAttempt: [ "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs" ], listLabelsForSelfHostedRunnerForOrg: [ "GET /orgs/{org}/actions/runners/{runner_id}/labels" ], listLabelsForSelfHostedRunnerForRepo: [ "GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels" ], listOrgSecrets: ["GET /orgs/{org}/actions/secrets"], listOrgVariables: ["GET /orgs/{org}/actions/variables"], listRepoOrganizationSecrets: [ "GET /repos/{owner}/{repo}/actions/organization-secrets" ], listRepoOrganizationVariables: [ "GET /repos/{owner}/{repo}/actions/organization-variables" ], listRepoSecrets: ["GET /repos/{owner}/{repo}/actions/secrets"], listRepoVariables: ["GET /repos/{owner}/{repo}/actions/variables"], listRepoWorkflows: ["GET /repos/{owner}/{repo}/actions/workflows"], listRunnerApplicationsForOrg: ["GET /orgs/{org}/actions/runners/downloads"], listRunnerApplicationsForRepo: [ "GET /repos/{owner}/{repo}/actions/runners/downloads" ], listSelectedReposForOrgSecret: [ "GET /orgs/{org}/actions/secrets/{secret_name}/repositories" ], listSelectedReposForOrgVariable: [ "GET /orgs/{org}/actions/variables/{name}/repositories" ], listSelectedRepositoriesEnabledGithubActionsOrganization: [ "GET /orgs/{org}/actions/permissions/repositories" ], listSelfHostedRunnersForOrg: ["GET /orgs/{org}/actions/runners"], listSelfHostedRunnersForRepo: ["GET /repos/{owner}/{repo}/actions/runners"], listWorkflowRunArtifacts: [ "GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts" ], listWorkflowRuns: [ "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs" ], listWorkflowRunsForRepo: ["GET /repos/{owner}/{repo}/actions/runs"], reRunJobForWorkflowRun: [ "POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun" ], reRunWorkflow: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun"], reRunWorkflowFailedJobs: [ "POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs" ], removeAllCustomLabelsFromSelfHostedRunnerForOrg: [ "DELETE /orgs/{org}/actions/runners/{runner_id}/labels" ], removeAllCustomLabelsFromSelfHostedRunnerForRepo: [ "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels" ], removeCustomLabelFromSelfHostedRunnerForOrg: [ "DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}" ], removeCustomLabelFromSelfHostedRunnerForRepo: [ "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}" ], removeSelectedRepoFromOrgSecret: [ "DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}" ], removeSelectedRepoFromOrgVariable: [ "DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}" ], reviewCustomGatesForRun: [ "POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule" ], reviewPendingDeploymentsForRun: [ "POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments" ], setAllowedActionsOrganization: [ "PUT /orgs/{org}/actions/permissions/selected-actions" ], setAllowedActionsRepository: [ "PUT /repos/{owner}/{repo}/actions/permissions/selected-actions" ], setCustomLabelsForSelfHostedRunnerForOrg: [ "PUT /orgs/{org}/actions/runners/{runner_id}/labels" ], setCustomLabelsForSelfHostedRunnerForRepo: [ "PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels" ], setCustomOidcSubClaimForRepo: [ "PUT /repos/{owner}/{repo}/actions/oidc/customization/sub" ], setGithubActionsDefaultWorkflowPermissionsOrganization: [ "PUT /orgs/{org}/actions/permissions/workflow" ], setGithubActionsDefaultWorkflowPermissionsRepository: [ "PUT /repos/{owner}/{repo}/actions/permissions/workflow" ], setGithubActionsPermissionsOrganization: [ "PUT /orgs/{org}/actions/permissions" ], setGithubActionsPermissionsRepository: [ "PUT /repos/{owner}/{repo}/actions/permissions" ], setSelectedReposForOrgSecret: [ "PUT /orgs/{org}/actions/secrets/{secret_name}/repositories" ], setSelectedReposForOrgVariable: [ "PUT /orgs/{org}/actions/variables/{name}/repositories" ], setSelectedRepositoriesEnabledGithubActionsOrganization: [ "PUT /orgs/{org}/actions/permissions/repositories" ], setWorkflowAccessToRepository: [ "PUT /repos/{owner}/{repo}/actions/permissions/access" ], updateEnvironmentVariable: [ "PATCH /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}" ], updateHostedRunnerForOrg: [ "PATCH /orgs/{org}/actions/hosted-runners/{hosted_runner_id}" ], updateOrgVariable: ["PATCH /orgs/{org}/actions/variables/{name}"], updateRepoVariable: [ "PATCH /repos/{owner}/{repo}/actions/variables/{name}" ] }, activity: { checkRepoIsStarredByAuthenticatedUser: ["GET /user/starred/{owner}/{repo}"], deleteRepoSubscription: ["DELETE /repos/{owner}/{repo}/subscription"], deleteThreadSubscription: [ "DELETE /notifications/threads/{thread_id}/subscription" ], getFeeds: ["GET /feeds"], getRepoSubscription: ["GET /repos/{owner}/{repo}/subscription"], getThread: ["GET /notifications/threads/{thread_id}"], getThreadSubscriptionForAuthenticatedUser: [ "GET /notifications/threads/{thread_id}/subscription" ], listEventsForAuthenticatedUser: ["GET /users/{username}/events"], listNotificationsForAuthenticatedUser: ["GET /notifications"], listOrgEventsForAuthenticatedUser: [ "GET /users/{username}/events/orgs/{org}" ], listPublicEvents: ["GET /events"], listPublicEventsForRepoNetwork: ["GET /networks/{owner}/{repo}/events"], listPublicEventsForUser: ["GET /users/{username}/events/public"], listPublicOrgEvents: ["GET /orgs/{org}/events"], listReceivedEventsForUser: ["GET /users/{username}/received_events"], listReceivedPublicEventsForUser: [ "GET /users/{username}/received_events/public" ], listRepoEvents: ["GET /repos/{owner}/{repo}/events"], listRepoNotificationsForAuthenticatedUser: [ "GET /repos/{owner}/{repo}/notifications" ], listReposStarredByAuthenticatedUser: ["GET /user/starred"], listReposStarredByUser: ["GET /users/{username}/starred"], listReposWatchedByUser: ["GET /users/{username}/subscriptions"], listStargazersForRepo: ["GET /repos/{owner}/{repo}/stargazers"], listWatchedReposForAuthenticatedUser: ["GET /user/subscriptions"], listWatchersForRepo: ["GET /repos/{owner}/{repo}/subscribers"], markNotificationsAsRead: ["PUT /notifications"], markRepoNotificationsAsRead: ["PUT /repos/{owner}/{repo}/notifications"], markThreadAsDone: ["DELETE /notifications/threads/{thread_id}"], markThreadAsRead: ["PATCH /notifications/threads/{thread_id}"], setRepoSubscription: ["PUT /repos/{owner}/{repo}/subscription"], setThreadSubscription: [ "PUT /notifications/threads/{thread_id}/subscription" ], starRepoForAuthenticatedUser: ["PUT /user/starred/{owner}/{repo}"], unstarRepoForAuthenticatedUser: ["DELETE /user/starred/{owner}/{repo}"] }, apps: { addRepoToInstallation: [ "PUT /user/installations/{installation_id}/repositories/{repository_id}", {}, { renamed: ["apps", "addRepoToInstallationForAuthenticatedUser"] } ], addRepoToInstallationForAuthenticatedUser: [ "PUT /user/installations/{installation_id}/repositories/{repository_id}" ], checkToken: ["POST /applications/{client_id}/token"], createFromManifest: ["POST /app-manifests/{code}/conversions"], createInstallationAccessToken: [ "POST /app/installations/{installation_id}/access_tokens" ], deleteAuthorization: ["DELETE /applications/{client_id}/grant"], deleteInstallation: ["DELETE /app/installations/{installation_id}"], deleteToken: ["DELETE /applications/{client_id}/token"], getAuthenticated: ["GET /app"], getBySlug: ["GET /apps/{app_slug}"], getInstallation: ["GET /app/installations/{installation_id}"], getOrgInstallation: ["GET /orgs/{org}/installation"], getRepoInstallation: ["GET /repos/{owner}/{repo}/installation"], getSubscriptionPlanForAccount: [ "GET /marketplace_listing/accounts/{account_id}" ], getSubscriptionPlanForAccountStubbed: [ "GET /marketplace_listing/stubbed/accounts/{account_id}" ], getUserInstallation: ["GET /users/{username}/installation"], getWebhookConfigForApp: ["GET /app/hook/config"], getWebhookDelivery: ["GET /app/hook/deliveries/{delivery_id}"], listAccountsForPlan: ["GET /marketplace_listing/plans/{plan_id}/accounts"], listAccountsForPlanStubbed: [ "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts" ], listInstallationReposForAuthenticatedUser: [ "GET /user/installations/{installation_id}/repositories" ], listInstallationRequestsForAuthenticatedApp: [ "GET /app/installation-requests" ], listInstallations: ["GET /app/installations"], listInstallationsForAuthenticatedUser: ["GET /user/installations"], listPlans: ["GET /marketplace_listing/plans"], listPlansStubbed: ["GET /marketplace_listing/stubbed/plans"], listReposAccessibleToInstallation: ["GET /installation/repositories"], listSubscriptionsForAuthenticatedUser: ["GET /user/marketplace_purchases"], listSubscriptionsForAuthenticatedUserStubbed: [ "GET /user/marketplace_purchases/stubbed" ], listWebhookDeliveries: ["GET /app/hook/deliveries"], redeliverWebhookDelivery: [ "POST /app/hook/deliveries/{delivery_id}/attempts" ], removeRepoFromInstallation: [ "DELETE /user/installations/{installation_id}/repositories/{repository_id}", {}, { renamed: ["apps", "removeRepoFromInstallationForAuthenticatedUser"] } ], removeRepoFromInstallationForAuthenticatedUser: [ "DELETE /user/installations/{installation_id}/repositories/{repository_id}" ], resetToken: ["PATCH /applications/{client_id}/token"], revokeInstallationAccessToken: ["DELETE /installation/token"], scopeToken: ["POST /applications/{client_id}/token/scoped"], suspendInstallation: ["PUT /app/installations/{installation_id}/suspended"], unsuspendInstallation: [ "DELETE /app/installations/{installation_id}/suspended" ], updateWebhookConfigForApp: ["PATCH /app/hook/config"] }, billing: { getGithubActionsBillingOrg: ["GET /orgs/{org}/settings/billing/actions"], getGithubActionsBillingUser: [ "GET /users/{username}/settings/billing/actions" ], getGithubBillingPremiumRequestUsageReportOrg: [ "GET /organizations/{org}/settings/billing/premium_request/usage" ], getGithubBillingPremiumRequestUsageReportUser: [ "GET /users/{username}/settings/billing/premium_request/usage" ], getGithubBillingUsageReportOrg: [ "GET /organizations/{org}/settings/billing/usage" ], getGithubBillingUsageReportUser: [ "GET /users/{username}/settings/billing/usage" ], getGithubPackagesBillingOrg: ["GET /orgs/{org}/settings/billing/packages"], getGithubPackagesBillingUser: [ "GET /users/{username}/settings/billing/packages" ], getSharedStorageBillingOrg: [ "GET /orgs/{org}/settings/billing/shared-storage" ], getSharedStorageBillingUser: [ "GET /users/{username}/settings/billing/shared-storage" ] }, campaigns: { createCampaign: ["POST /orgs/{org}/campaigns"], deleteCampaign: ["DELETE /orgs/{org}/campaigns/{campaign_number}"], getCampaignSummary: ["GET /orgs/{org}/campaigns/{campaign_number}"], listOrgCampaigns: ["GET /orgs/{org}/campaigns"], updateCampaign: ["PATCH /orgs/{org}/campaigns/{campaign_number}"] }, checks: { create: ["POST /repos/{owner}/{repo}/check-runs"], createSuite: ["POST /repos/{owner}/{repo}/check-suites"], get: ["GET /repos/{owner}/{repo}/check-runs/{check_run_id}"], getSuite: ["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}"], listAnnotations: [ "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations" ], listForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-runs"], listForSuite: [ "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs" ], listSuitesForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-suites"], rerequestRun: [ "POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest" ], rerequestSuite: [ "POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest" ], setSuitesPreferences: [ "PATCH /repos/{owner}/{repo}/check-suites/preferences" ], update: ["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}"] }, codeScanning: { commitAutofix: [ "POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/commits" ], createAutofix: [ "POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix" ], createVariantAnalysis: [ "POST /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses" ], deleteAnalysis: [ "DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}" ], deleteCodeqlDatabase: [ "DELETE /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}" ], getAlert: [ "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}", {}, { renamedParameters: { alert_id: "alert_number" } } ], getAnalysis: [ "GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}" ], getAutofix: [ "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix" ], getCodeqlDatabase: [ "GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}" ], getDefaultSetup: ["GET /repos/{owner}/{repo}/code-scanning/default-setup"], getSarif: ["GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}"], getVariantAnalysis: [ "GET /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id}" ], getVariantAnalysisRepoTask: [ "GET /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id}/repos/{repo_owner}/{repo_name}" ], listAlertInstances: [ "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances" ], listAlertsForOrg: ["GET /orgs/{org}/code-scanning/alerts"], listAlertsForRepo: ["GET /repos/{owner}/{repo}/code-scanning/alerts"], listAlertsInstances: [ "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances", {}, { renamed: ["codeScanning", "listAlertInstances"] } ], listCodeqlDatabases: [ "GET /repos/{owner}/{repo}/code-scanning/codeql/databases" ], listRecentAnalyses: ["GET /repos/{owner}/{repo}/code-scanning/analyses"], updateAlert: [ "PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}" ], updateDefaultSetup: [ "PATCH /repos/{owner}/{repo}/code-scanning/default-setup" ], uploadSarif: ["POST /repos/{owner}/{repo}/code-scanning/sarifs"] }, codeSecurity: { attachConfiguration: [ "POST /orgs/{org}/code-security/configurations/{configuration_id}/attach" ], attachEnterpriseConfiguration: [ "POST /enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach" ], createConfiguration: ["POST /orgs/{org}/code-security/configurations"], createConfigurationForEnterprise: [ "POST /enterprises/{enterprise}/code-security/configurations" ], deleteConfiguration: [ "DELETE /orgs/{org}/code-security/configurations/{configuration_id}" ], deleteConfigurationForEnterprise: [ "DELETE /enterprises/{enterprise}/code-security/configurations/{configuration_id}" ], detachConfiguration: [ "DELETE /orgs/{org}/code-security/configurations/detach" ], getConfiguration: [ "GET /orgs/{org}/code-security/configurations/{configuration_id}" ], getConfigurationForRepository: [ "GET /repos/{owner}/{repo}/code-security-configuration" ], getConfigurationsForEnterprise: [ "GET /enterprises/{enterprise}/code-security/configurations" ], getConfigurationsForOrg: ["GET /orgs/{org}/code-security/configurations"], getDefaultConfigurations: [ "GET /orgs/{org}/code-security/configurations/defaults" ], getDefaultConfigurationsForEnterprise: [ "GET /enterprises/{enterprise}/code-security/configurations/defaults" ], getRepositoriesForConfiguration: [ "GET /orgs/{org}/code-security/configurations/{configuration_id}/repositories" ], getRepositoriesForEnterpriseConfiguration: [ "GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories" ], getSingleConfigurationForEnterprise: [ "GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}" ], setConfigurationAsDefault: [ "PUT /orgs/{org}/code-security/configurations/{configuration_id}/defaults" ], setConfigurationAsDefaultForEnterprise: [ "PUT /enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults" ], updateConfiguration: [ "PATCH /orgs/{org}/code-security/configurations/{configuration_id}" ], updateEnterpriseConfiguration: [ "PATCH /enterprises/{enterprise}/code-security/configurations/{configuration_id}" ] }, codesOfConduct: { getAllCodesOfConduct: ["GET /codes_of_conduct"], getConductCode: ["GET /codes_of_conduct/{key}"] }, codespaces: { addRepositoryForSecretForAuthenticatedUser: [ "PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id}" ], addSelectedRepoToOrgSecret: [ "PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}" ], checkPermissionsForDevcontainer: [ "GET /repos/{owner}/{repo}/codespaces/permissions_check" ], codespaceMachinesForAuthenticatedUser: [ "GET /user/codespaces/{codespace_name}/machines" ], createForAuthenticatedUser: ["POST /user/codespaces"], createOrUpdateOrgSecret: [ "PUT /orgs/{org}/codespaces/secrets/{secret_name}" ], createOrUpdateRepoSecret: [ "PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}" ], createOrUpdateSecretForAuthenticatedUser: [ "PUT /user/codespaces/secrets/{secret_name}" ], createWithPrForAuthenticatedUser: [ "POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces" ], createWithRepoForAuthenticatedUser: [ "POST /repos/{owner}/{repo}/codespaces" ], deleteForAuthenticatedUser: ["DELETE /user/codespaces/{codespace_name}"], deleteFromOrganization: [ "DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}" ], deleteOrgSecret: ["DELETE /orgs/{org}/codespaces/secrets/{secret_name}"], deleteRepoSecret: [ "DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}" ], deleteSecretForAuthenticatedUser: [ "DELETE /user/codespaces/secrets/{secret_name}" ], exportForAuthenticatedUser: [ "POST /user/codespaces/{codespace_name}/exports" ], getCodespacesForUserInOrg: [ "GET /orgs/{org}/members/{username}/codespaces" ], getExportDetailsForAuthenticatedUser: [ "GET /user/codespaces/{codespace_name}/exports/{export_id}" ], getForAuthenticatedUser: ["GET /user/codespaces/{codespace_name}"], getOrgPublicKey: ["GET /orgs/{org}/codespaces/secrets/public-key"], getOrgSecret: ["GET /orgs/{org}/codespaces/secrets/{secret_name}"], getPublicKeyForAuthenticatedUser: [ "GET /user/codespaces/secrets/public-key" ], getRepoPublicKey: [ "GET /repos/{owner}/{repo}/codespaces/secrets/public-key" ], getRepoSecret: [ "GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name}" ], getSecretForAuthenticatedUser: [ "GET /user/codespaces/secrets/{secret_name}" ], listDevcontainersInRepositoryForAuthenticatedUser: [ "GET /repos/{owner}/{repo}/codespaces/devcontainers" ], listForAuthenticatedUser: ["GET /user/codespaces"], listInOrganization: [ "GET /orgs/{org}/codespaces", {}, { renamedParameters: { org_id: "org" } } ], listInRepositoryForAuthenticatedUser: [ "GET /repos/{owner}/{repo}/codespaces" ], listOrgSecrets: ["GET /orgs/{org}/codespaces/secrets"], listRepoSecrets: ["GET /repos/{owner}/{repo}/codespaces/secrets"], listRepositoriesForSecretForAuthenticatedUser: [ "GET /user/codespaces/secrets/{secret_name}/repositories" ], listSecretsForAuthenticatedUser: ["GET /user/codespaces/secrets"], listSelectedReposForOrgSecret: [ "GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories" ], preFlightWithRepoForAuthenticatedUser: [ "GET /repos/{owner}/{repo}/codespaces/new" ], publishForAuthenticatedUser: [ "POST /user/codespaces/{codespace_name}/publish" ], removeRepositoryForSecretForAuthenticatedUser: [ "DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id}" ], removeSelectedRepoFromOrgSecret: [ "DELETE /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}" ], repoMachinesForAuthenticatedUser: [ "GET /repos/{owner}/{repo}/codespaces/machines" ], setRepositoriesForSecretForAuthenticatedUser: [ "PUT /user/codespaces/secrets/{secret_name}/repositories" ], setSelectedReposForOrgSecret: [ "PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories" ], startForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/start"], stopForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/stop"], stopInOrganization: [ "POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop" ], updateForAuthenticatedUser: ["PATCH /user/codespaces/{codespace_name}"] }, copilot: { addCopilotSeatsForTeams: [ "POST /orgs/{org}/copilot/billing/selected_teams" ], addCopilotSeatsForUsers: [ "POST /orgs/{org}/copilot/billing/selected_users" ], cancelCopilotSeatAssignmentForTeams: [ "DELETE /orgs/{org}/copilot/billing/selected_teams" ], cancelCopilotSeatAssignmentForUsers: [ "DELETE /orgs/{org}/copilot/billing/selected_users" ], copilotMetricsForOrganization: ["GET /orgs/{org}/copilot/metrics"], copilotMetricsForTeam: ["GET /orgs/{org}/team/{team_slug}/copilot/metrics"], getCopilotOrganizationDetails: ["GET /orgs/{org}/copilot/billing"], getCopilotSeatDetailsForUser: [ "GET /orgs/{org}/members/{username}/copilot" ], listCopilotSeats: ["GET /orgs/{org}/copilot/billing/seats"] }, credentials: { revoke: ["POST /credentials/revoke"] }, dependabot: { addSelectedRepoToOrgSecret: [ "PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}" ], createOrUpdateOrgSecret: [ "PUT /orgs/{org}/dependabot/secrets/{secret_name}" ], createOrUpdateRepoSecret: [ "PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name}" ], deleteOrgSecret: ["DELETE /orgs/{org}/dependabot/secrets/{secret_name}"], deleteRepoSecret: [ "DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name}" ], getAlert: ["GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"], getOrgPublicKey: ["GET /orgs/{org}/dependabot/secrets/public-key"], getOrgSecret: ["GET /orgs/{org}/dependabot/secrets/{secret_name}"], getRepoPublicKey: [ "GET /repos/{owner}/{repo}/dependabot/secrets/public-key" ], getRepoSecret: [ "GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name}" ], listAlertsForEnterprise: [ "GET /enterprises/{enterprise}/dependabot/alerts" ], listAlertsForOrg: ["GET /orgs/{org}/dependabot/alerts"], listAlertsForRepo: ["GET /repos/{owner}/{repo}/dependabot/alerts"], listOrgSecrets: ["GET /orgs/{org}/dependabot/secrets"], listRepoSecrets: ["GET /repos/{owner}/{repo}/dependabot/secrets"], listSelectedReposForOrgSecret: [ "GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories" ], removeSelectedRepoFromOrgSecret: [ "DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}" ], repositoryAccessForOrg: [ "GET /organizations/{org}/dependabot/repository-access" ], setRepositoryAccessDefaultLevel: [ "PUT /organizations/{org}/dependabot/repository-access/default-level" ], setSelectedReposForOrgSecret: [ "PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories" ], updateAlert: [ "PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}" ], updateRepositoryAccessForOrg: [ "PATCH /organizations/{org}/dependabot/repository-access" ] }, dependencyGraph: { createRepositorySnapshot: [ "POST /repos/{owner}/{repo}/dependency-graph/snapshots" ], diffRange: [ "GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}" ], exportSbom: ["GET /repos/{owner}/{repo}/dependency-graph/sbom"] }, emojis: { get: ["GET /emojis"] }, enterpriseTeamMemberships: { add: [ "PUT /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}" ], bulkAdd: [ "POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/add" ], bulkRemove: [ "POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove" ], get: [ "GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}" ], list: ["GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships"], remove: [ "DELETE /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}" ] }, enterpriseTeamOrganizations: { add: [ "PUT /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}" ], bulkAdd: [ "POST /enterprises/{enterprise}/teams/{enterprise-team}/organizations/add" ], bulkRemove: [ "POST /enterprises/{enterprise}/teams/{enterprise-team}/organizations/remove" ], delete: [ "DELETE /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}" ], getAssignment: [ "GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}" ], getAssignments: [ "GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations" ] }, enterpriseTeams: { create: ["POST /enterprises/{enterprise}/teams"], delete: ["DELETE /enterprises/{enterprise}/teams/{team_slug}"], get: ["GET /enterprises/{enterprise}/teams/{team_slug}"], list: ["GET /enterprises/{enterprise}/teams"], update: ["PATCH /enterprises/{enterprise}/teams/{team_slug}"] }, gists: { checkIsStarred: ["GET /gists/{gist_id}/star"], create: ["POST /gists"], createComment: ["POST /gists/{gist_id}/comments"], delete: ["DELETE /gists/{gist_id}"], deleteComment: ["DELETE /gists/{gist_id}/comments/{comment_id}"], fork: ["POST /gists/{gist_id}/forks"], get: ["GET /gists/{gist_id}"], getComment: ["GET /gists/{gist_id}/comments/{comment_id}"], getRevision: ["GET /gists/{gist_id}/{sha}"], list: ["GET /gists"], listComments: ["GET /gists/{gist_id}/comments"], listCommits: ["GET /gists/{gist_id}/commits"], listForUser: ["GET /users/{username}/gists"], listForks: ["GET /gists/{gist_id}/forks"], listPublic: ["GET /gists/public"], listStarred: ["GET /gists/starred"], star: ["PUT /gists/{gist_id}/star"], unstar: ["DELETE /gists/{gist_id}/star"], update: ["PATCH /gists/{gist_id}"], updateComment: ["PATCH /gists/{gist_id}/comments/{comment_id}"] }, git: { createBlob: ["POST /repos/{owner}/{repo}/git/blobs"], createCommit: ["POST /repos/{owner}/{repo}/git/commits"], createRef: ["POST /repos/{owner}/{repo}/git/refs"], createTag: ["POST /repos/{owner}/{repo}/git/tags"], createTree: ["POST /repos/{owner}/{repo}/git/trees"], deleteRef: ["DELETE /repos/{owner}/{repo}/git/refs/{ref}"], getBlob: ["GET /repos/{owner}/{repo}/git/blobs/{file_sha}"], getCommit: ["GET /repos/{owner}/{repo}/git/commits/{commit_sha}"], getRef: ["GET /repos/{owner}/{repo}/git/ref/{ref}"], getTag: ["GET /repos/{owner}/{repo}/git/tags/{tag_sha}"], getTree: ["GET /repos/{owner}/{repo}/git/trees/{tree_sha}"], listMatchingRefs: ["GET /repos/{owner}/{repo}/git/matching-refs/{ref}"], updateRef: ["PATCH /repos/{owner}/{repo}/git/refs/{ref}"] }, gitignore: { getAllTemplates: ["GET /gitignore/templates"], getTemplate: ["GET /gitignore/templates/{name}"] }, hostedCompute: { createNetworkConfigurationForOrg: [ "POST /orgs/{org}/settings/network-configurations" ], deleteNetworkConfigurationFromOrg: [ "DELETE /orgs/{org}/settings/network-configurations/{network_configuration_id}" ], getNetworkConfigurationForOrg: [ "GET /orgs/{org}/settings/network-configurations/{network_configuration_id}" ], getNetworkSettingsForOrg: [ "GET /orgs/{org}/settings/network-settings/{network_settings_id}" ], listNetworkConfigurationsForOrg: [ "GET /orgs/{org}/settings/network-configurations" ], updateNetworkConfigurationForOrg: [ "PATCH /orgs/{org}/settings/network-configurations/{network_configuration_id}" ] }, interactions: { getRestrictionsForAuthenticatedUser: ["GET /user/interaction-limits"], getRestrictionsForOrg: ["GET /orgs/{org}/interaction-limits"], getRestrictionsForRepo: ["GET /repos/{owner}/{repo}/interaction-limits"], getRestrictionsForYourPublicRepos: [ "GET /user/interaction-limits", {}, { renamed: ["interactions", "getRestrictionsForAuthenticatedUser"] } ], removeRestrictionsForAuthenticatedUser: ["DELETE /user/interaction-limits"], removeRestrictionsForOrg: ["DELETE /orgs/{org}/interaction-limits"], removeRestrictionsForRepo: [ "DELETE /repos/{owner}/{repo}/interaction-limits" ], removeRestrictionsForYourPublicRepos: [ "DELETE /user/interaction-limits", {}, { renamed: ["interactions", "removeRestrictionsForAuthenticatedUser"] } ], setRestrictionsForAuthenticatedUser: ["PUT /user/interaction-limits"], setRestrictionsForOrg: ["PUT /orgs/{org}/interaction-limits"], setRestrictionsForRepo: ["PUT /repos/{owner}/{repo}/interaction-limits"], setRestrictionsForYourPublicRepos: [ "PUT /user/interaction-limits", {}, { renamed: ["interactions", "setRestrictionsForAuthenticatedUser"] } ] }, issues: { addAssignees: [ "POST /repos/{owner}/{repo}/issues/{issue_number}/assignees" ], addBlockedByDependency: [ "POST /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by" ], addLabels: ["POST /repos/{owner}/{repo}/issues/{issue_number}/labels"], addSubIssue: [ "POST /repos/{owner}/{repo}/issues/{issue_number}/sub_issues" ], checkUserCanBeAssigned: ["GET /repos/{owner}/{repo}/assignees/{assignee}"], checkUserCanBeAssignedToIssue: [ "GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}" ], create: ["POST /repos/{owner}/{repo}/issues"], createComment: [ "POST /repos/{owner}/{repo}/issues/{issue_number}/comments" ], createLabel: ["POST /repos/{owner}/{repo}/labels"], createMilestone: ["POST /repos/{owner}/{repo}/milestones"], deleteComment: [ "DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}" ], deleteLabel: ["DELETE /repos/{owner}/{repo}/labels/{name}"], deleteMilestone: [ "DELETE /repos/{owner}/{repo}/milestones/{milestone_number}" ], get: ["GET /repos/{owner}/{repo}/issues/{issue_number}"], getComment: ["GET /repos/{owner}/{repo}/issues/comments/{comment_id}"], getEvent: ["GET /repos/{owner}/{repo}/issues/events/{event_id}"], getLabel: ["GET /repos/{owner}/{repo}/labels/{name}"], getMilestone: ["GET /repos/{owner}/{repo}/milestones/{milestone_number}"], getParent: ["GET /repos/{owner}/{repo}/issues/{issue_number}/parent"], list: ["GET /issues"], listAssignees: ["GET /repos/{owner}/{repo}/assignees"], listComments: ["GET /repos/{owner}/{repo}/issues/{issue_number}/comments"], listCommentsForRepo: ["GET /repos/{owner}/{repo}/issues/comments"], listDependenciesBlockedBy: [ "GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by" ], listDependenciesBlocking: [ "GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking" ], listEvents: ["GET /repos/{owner}/{repo}/issues/{issue_number}/events"], listEventsForRepo: ["GET /repos/{owner}/{repo}/issues/events"], listEventsForTimeline: [ "GET /repos/{owner}/{repo}/issues/{issue_number}/timeline" ], listForAuthenticatedUser: ["GET /user/issues"], listForOrg: ["GET /orgs/{org}/issues"], listForRepo: ["GET /repos/{owner}/{repo}/issues"], listLabelsForMilestone: [ "GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels" ], listLabelsForRepo: ["GET /repos/{owner}/{repo}/labels"], listLabelsOnIssue: [ "GET /repos/{owner}/{repo}/issues/{issue_number}/labels" ], listMilestones: ["GET /repos/{owner}/{repo}/milestones"], listSubIssues: [ "GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues" ], lock: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/lock"], removeAllLabels: [ "DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels" ], removeAssignees: [ "DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees" ], removeDependencyBlockedBy: [ "DELETE /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}" ], removeLabel: [ "DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}" ], removeSubIssue: [ "DELETE /repos/{owner}/{repo}/issues/{issue_number}/sub_issue" ], reprioritizeSubIssue: [ "PATCH /repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority" ], setLabels: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/labels"], unlock: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock"], update: ["PATCH /repos/{owner}/{repo}/issues/{issue_number}"], updateComment: ["PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}"], updateLabel: ["PATCH /repos/{owner}/{repo}/labels/{name}"], updateMilestone: [ "PATCH /repos/{owner}/{repo}/milestones/{milestone_number}" ] }, licenses: { get: ["GET /licenses/{license}"], getAllCommonlyUsed: ["GET /licenses"], getForRepo: ["GET /repos/{owner}/{repo}/license"] }, markdown: { render: ["POST /markdown"], renderRaw: [ "POST /markdown/raw", { headers: { "content-type": "text/plain; charset=utf-8" } } ] }, meta: { get: ["GET /meta"], getAllVersions: ["GET /versions"], getOctocat: ["GET /octocat"], getZen: ["GET /zen"], root: ["GET /"] }, migrations: { deleteArchiveForAuthenticatedUser: [ "DELETE /user/migrations/{migration_id}/archive" ], deleteArchiveForOrg: [ "DELETE /orgs/{org}/migrations/{migration_id}/archive" ], downloadArchiveForOrg: [ "GET /orgs/{org}/migrations/{migration_id}/archive" ], getArchiveForAuthenticatedUser: [ "GET /user/migrations/{migration_id}/archive" ], getStatusForAuthenticatedUser: ["GET /user/migrations/{migration_id}"], getStatusForOrg: ["GET /orgs/{org}/migrations/{migration_id}"], listForAuthenticatedUser: ["GET /user/migrations"], listForOrg: ["GET /orgs/{org}/migrations"], listReposForAuthenticatedUser: [ "GET /user/migrations/{migration_id}/repositories" ], listReposForOrg: ["GET /orgs/{org}/migrations/{migration_id}/repositories"], listReposForUser: [ "GET /user/migrations/{migration_id}/repositories", {}, { renamed: ["migrations", "listReposForAuthenticatedUser"] } ], startForAuthenticatedUser: ["POST /user/migrations"], startForOrg: ["POST /orgs/{org}/migrations"], unlockRepoForAuthenticatedUser: [ "DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock" ], unlockRepoForOrg: [ "DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock" ] }, oidc: { getOidcCustomSubTemplateForOrg: [ "GET /orgs/{org}/actions/oidc/customization/sub" ], updateOidcCustomSubTemplateForOrg: [ "PUT /orgs/{org}/actions/oidc/customization/sub" ] }, orgs: { addSecurityManagerTeam: [ "PUT /orgs/{org}/security-managers/teams/{team_slug}", {}, { deprecated: "octokit.rest.orgs.addSecurityManagerTeam() is deprecated, see https://docs.github.com/rest/orgs/security-managers#add-a-security-manager-team" } ], assignTeamToOrgRole: [ "PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}" ], assignUserToOrgRole: [ "PUT /orgs/{org}/organization-roles/users/{username}/{role_id}" ], blockUser: ["PUT /orgs/{org}/blocks/{username}"], cancelInvitation: ["DELETE /orgs/{org}/invitations/{invitation_id}"], checkBlockedUser: ["GET /orgs/{org}/blocks/{username}"], checkMembershipForUser: ["GET /orgs/{org}/members/{username}"], checkPublicMembershipForUser: ["GET /orgs/{org}/public_members/{username}"], convertMemberToOutsideCollaborator: [ "PUT /orgs/{org}/outside_collaborators/{username}" ], createArtifactStorageRecord: [ "POST /orgs/{org}/artifacts/metadata/storage-record" ], createInvitation: ["POST /orgs/{org}/invitations"], createIssueType: ["POST /orgs/{org}/issue-types"], createWebhook: ["POST /orgs/{org}/hooks"], customPropertiesForOrgsCreateOrUpdateOrganizationValues: [ "PATCH /organizations/{org}/org-properties/values" ], customPropertiesForOrgsGetOrganizationValues: [ "GET /organizations/{org}/org-properties/values" ], customPropertiesForReposCreateOrUpdateOrganizationDefinition: [ "PUT /orgs/{org}/properties/schema/{custom_property_name}" ], customPropertiesForReposCreateOrUpdateOrganizationDefinitions: [ "PATCH /orgs/{org}/properties/schema" ], customPropertiesForReposCreateOrUpdateOrganizationValues: [ "PATCH /orgs/{org}/properties/values" ], customPropertiesForReposDeleteOrganizationDefinition: [ "DELETE /orgs/{org}/properties/schema/{custom_property_name}" ], customPropertiesForReposGetOrganizationDefinition: [ "GET /orgs/{org}/properties/schema/{custom_property_name}" ], customPropertiesForReposGetOrganizationDefinitions: [ "GET /orgs/{org}/properties/schema" ], customPropertiesForReposGetOrganizationValues: [ "GET /orgs/{org}/properties/values" ], delete: ["DELETE /orgs/{org}"], deleteAttestationsBulk: ["POST /orgs/{org}/attestations/delete-request"], deleteAttestationsById: [ "DELETE /orgs/{org}/attestations/{attestation_id}" ], deleteAttestationsBySubjectDigest: [ "DELETE /orgs/{org}/attestations/digest/{subject_digest}" ], deleteIssueType: ["DELETE /orgs/{org}/issue-types/{issue_type_id}"], deleteWebhook: ["DELETE /orgs/{org}/hooks/{hook_id}"], disableSelectedRepositoryImmutableReleasesOrganization: [ "DELETE /orgs/{org}/settings/immutable-releases/repositories/{repository_id}" ], enableSelectedRepositoryImmutableReleasesOrganization: [ "PUT /orgs/{org}/settings/immutable-releases/repositories/{repository_id}" ], get: ["GET /orgs/{org}"], getImmutableReleasesSettings: [ "GET /orgs/{org}/settings/immutable-releases" ], getImmutableReleasesSettingsRepositories: [ "GET /orgs/{org}/settings/immutable-releases/repositories" ], getMembershipForAuthenticatedUser: ["GET /user/memberships/orgs/{org}"], getMembershipForUser: ["GET /orgs/{org}/memberships/{username}"], getOrgRole: ["GET /orgs/{org}/organization-roles/{role_id}"], getOrgRulesetHistory: ["GET /orgs/{org}/rulesets/{ruleset_id}/history"], getOrgRulesetVersion: [ "GET /orgs/{org}/rulesets/{ruleset_id}/history/{version_id}" ], getWebhook: ["GET /orgs/{org}/hooks/{hook_id}"], getWebhookConfigForOrg: ["GET /orgs/{org}/hooks/{hook_id}/config"], getWebhookDelivery: [ "GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}" ], list: ["GET /organizations"], listAppInstallations: ["GET /orgs/{org}/installations"], listArtifactStorageRecords: [ "GET /orgs/{org}/artifacts/{subject_digest}/metadata/storage-records" ], listAttestationRepositories: ["GET /orgs/{org}/attestations/repositories"], listAttestations: ["GET /orgs/{org}/attestations/{subject_digest}"], listAttestationsBulk: [ "POST /orgs/{org}/attestations/bulk-list{?per_page,before,after}" ], listBlockedUsers: ["GET /orgs/{org}/blocks"], listFailedInvitations: ["GET /orgs/{org}/failed_invitations"], listForAuthenticatedUser: ["GET /user/orgs"], listForUser: ["GET /users/{username}/orgs"], listInvitationTeams: ["GET /orgs/{org}/invitations/{invitation_id}/teams"], listIssueTypes: ["GET /orgs/{org}/issue-types"], listMembers: ["GET /orgs/{org}/members"], listMembershipsForAuthenticatedUser: ["GET /user/memberships/orgs"], listOrgRoleTeams: ["GET /orgs/{org}/organization-roles/{role_id}/teams"], listOrgRoleUsers: ["GET /orgs/{org}/organization-roles/{role_id}/users"], listOrgRoles: ["GET /orgs/{org}/organization-roles"], listOrganizationFineGrainedPermissions: [ "GET /orgs/{org}/organization-fine-grained-permissions" ], listOutsideCollaborators: ["GET /orgs/{org}/outside_collaborators"], listPatGrantRepositories: [ "GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories" ], listPatGrantRequestRepositories: [ "GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories" ], listPatGrantRequests: ["GET /orgs/{org}/personal-access-token-requests"], listPatGrants: ["GET /orgs/{org}/personal-access-tokens"], listPendingInvitations: ["GET /orgs/{org}/invitations"], listPublicMembers: ["GET /orgs/{org}/public_members"], listSecurityManagerTeams: [ "GET /orgs/{org}/security-managers", {}, { deprecated: "octokit.rest.orgs.listSecurityManagerTeams() is deprecated, see https://docs.github.com/rest/orgs/security-managers#list-security-manager-teams" } ], listWebhookDeliveries: ["GET /orgs/{org}/hooks/{hook_id}/deliveries"], listWebhooks: ["GET /orgs/{org}/hooks"], pingWebhook: ["POST /orgs/{org}/hooks/{hook_id}/pings"], redeliverWebhookDelivery: [ "POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts" ], removeMember: ["DELETE /orgs/{org}/members/{username}"], removeMembershipForUser: ["DELETE /orgs/{org}/memberships/{username}"], removeOutsideCollaborator: [ "DELETE /orgs/{org}/outside_collaborators/{username}" ], removePublicMembershipForAuthenticatedUser: [ "DELETE /orgs/{org}/public_members/{username}" ], removeSecurityManagerTeam: [ "DELETE /orgs/{org}/security-managers/teams/{team_slug}", {}, { deprecated: "octokit.rest.orgs.removeSecurityManagerTeam() is deprecated, see https://docs.github.com/rest/orgs/security-managers#remove-a-security-manager-team" } ], reviewPatGrantRequest: [ "POST /orgs/{org}/personal-access-token-requests/{pat_request_id}" ], reviewPatGrantRequestsInBulk: [ "POST /orgs/{org}/personal-access-token-requests" ], revokeAllOrgRolesTeam: [ "DELETE /orgs/{org}/organization-roles/teams/{team_slug}" ], revokeAllOrgRolesUser: [ "DELETE /orgs/{org}/organization-roles/users/{username}" ], revokeOrgRoleTeam: [ "DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}" ], revokeOrgRoleUser: [ "DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}" ], setImmutableReleasesSettings: [ "PUT /orgs/{org}/settings/immutable-releases" ], setImmutableReleasesSettingsRepositories: [ "PUT /orgs/{org}/settings/immutable-releases/repositories" ], setMembershipForUser: ["PUT /orgs/{org}/memberships/{username}"], setPublicMembershipForAuthenticatedUser: [ "PUT /orgs/{org}/public_members/{username}" ], unblockUser: ["DELETE /orgs/{org}/blocks/{username}"], update: ["PATCH /orgs/{org}"], updateIssueType: ["PUT /orgs/{org}/issue-types/{issue_type_id}"], updateMembershipForAuthenticatedUser: [ "PATCH /user/memberships/orgs/{org}" ], updatePatAccess: ["POST /orgs/{org}/personal-access-tokens/{pat_id}"], updatePatAccesses: ["POST /orgs/{org}/personal-access-tokens"], updateWebhook: ["PATCH /orgs/{org}/hooks/{hook_id}"], updateWebhookConfigForOrg: ["PATCH /orgs/{org}/hooks/{hook_id}/config"] }, packages: { deletePackageForAuthenticatedUser: [ "DELETE /user/packages/{package_type}/{package_name}" ], deletePackageForOrg: [ "DELETE /orgs/{org}/packages/{package_type}/{package_name}" ], deletePackageForUser: [ "DELETE /users/{username}/packages/{package_type}/{package_name}" ], deletePackageVersionForAuthenticatedUser: [ "DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}" ], deletePackageVersionForOrg: [ "DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}" ], deletePackageVersionForUser: [ "DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}" ], getAllPackageVersionsForAPackageOwnedByAnOrg: [ "GET /orgs/{org}/packages/{package_type}/{package_name}/versions", {}, { renamed: ["packages", "getAllPackageVersionsForPackageOwnedByOrg"] } ], getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser: [ "GET /user/packages/{package_type}/{package_name}/versions", {}, { renamed: [ "packages", "getAllPackageVersionsForPackageOwnedByAuthenticatedUser" ] } ], getAllPackageVersionsForPackageOwnedByAuthenticatedUser: [ "GET /user/packages/{package_type}/{package_name}/versions" ], getAllPackageVersionsForPackageOwnedByOrg: [ "GET /orgs/{org}/packages/{package_type}/{package_name}/versions" ], getAllPackageVersionsForPackageOwnedByUser: [ "GET /users/{username}/packages/{package_type}/{package_name}/versions" ], getPackageForAuthenticatedUser: [ "GET /user/packages/{package_type}/{package_name}" ], getPackageForOrganization: [ "GET /orgs/{org}/packages/{package_type}/{package_name}" ], getPackageForUser: [ "GET /users/{username}/packages/{package_type}/{package_name}" ], getPackageVersionForAuthenticatedUser: [ "GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}" ], getPackageVersionForOrganization: [ "GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}" ], getPackageVersionForUser: [ "GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}" ], listDockerMigrationConflictingPackagesForAuthenticatedUser: [ "GET /user/docker/conflicts" ], listDockerMigrationConflictingPackagesForOrganization: [ "GET /orgs/{org}/docker/conflicts" ], listDockerMigrationConflictingPackagesForUser: [ "GET /users/{username}/docker/conflicts" ], listPackagesForAuthenticatedUser: ["GET /user/packages"], listPackagesForOrganization: ["GET /orgs/{org}/packages"], listPackagesForUser: ["GET /users/{username}/packages"], restorePackageForAuthenticatedUser: [ "POST /user/packages/{package_type}/{package_name}/restore{?token}" ], restorePackageForOrg: [ "POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}" ], restorePackageForUser: [ "POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}" ], restorePackageVersionForAuthenticatedUser: [ "POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore" ], restorePackageVersionForOrg: [ "POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore" ], restorePackageVersionForUser: [ "POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore" ] }, privateRegistries: { createOrgPrivateRegistry: ["POST /orgs/{org}/private-registries"], deleteOrgPrivateRegistry: [ "DELETE /orgs/{org}/private-registries/{secret_name}" ], getOrgPrivateRegistry: ["GET /orgs/{org}/private-registries/{secret_name}"], getOrgPublicKey: ["GET /orgs/{org}/private-registries/public-key"], listOrgPrivateRegistries: ["GET /orgs/{org}/private-registries"], updateOrgPrivateRegistry: [ "PATCH /orgs/{org}/private-registries/{secret_name}" ] }, projects: { addItemForOrg: ["POST /orgs/{org}/projectsV2/{project_number}/items"], addItemForUser: [ "POST /users/{username}/projectsV2/{project_number}/items" ], deleteItemForOrg: [ "DELETE /orgs/{org}/projectsV2/{project_number}/items/{item_id}" ], deleteItemForUser: [ "DELETE /users/{username}/projectsV2/{project_number}/items/{item_id}" ], getFieldForOrg: [ "GET /orgs/{org}/projectsV2/{project_number}/fields/{field_id}" ], getFieldForUser: [ "GET /users/{username}/projectsV2/{project_number}/fields/{field_id}" ], getForOrg: ["GET /orgs/{org}/projectsV2/{project_number}"], getForUser: ["GET /users/{username}/projectsV2/{project_number}"], getOrgItem: ["GET /orgs/{org}/projectsV2/{project_number}/items/{item_id}"], getUserItem: [ "GET /users/{username}/projectsV2/{project_number}/items/{item_id}" ], listFieldsForOrg: ["GET /orgs/{org}/projectsV2/{project_number}/fields"], listFieldsForUser: [ "GET /users/{username}/projectsV2/{project_number}/fields" ], listForOrg: ["GET /orgs/{org}/projectsV2"], listForUser: ["GET /users/{username}/projectsV2"], listItemsForOrg: ["GET /orgs/{org}/projectsV2/{project_number}/items"], listItemsForUser: [ "GET /users/{username}/projectsV2/{project_number}/items" ], updateItemForOrg: [ "PATCH /orgs/{org}/projectsV2/{project_number}/items/{item_id}" ], updateItemForUser: [ "PATCH /users/{username}/projectsV2/{project_number}/items/{item_id}" ] }, pulls: { checkIfMerged: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/merge"], create: ["POST /repos/{owner}/{repo}/pulls"], createReplyForReviewComment: [ "POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies" ], createReview: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews"], createReviewComment: [ "POST /repos/{owner}/{repo}/pulls/{pull_number}/comments" ], deletePendingReview: [ "DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}" ], deleteReviewComment: [ "DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}" ], dismissReview: [ "PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals" ], get: ["GET /repos/{owner}/{repo}/pulls/{pull_number}"], getReview: [ "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}" ], getReviewComment: ["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}"], list: ["GET /repos/{owner}/{repo}/pulls"], listCommentsForReview: [ "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments" ], listCommits: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/commits"], listFiles: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/files"], listRequestedReviewers: [ "GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers" ], listReviewComments: [ "GET /repos/{owner}/{repo}/pulls/{pull_number}/comments" ], listReviewCommentsForRepo: ["GET /repos/{owner}/{repo}/pulls/comments"], listReviews: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews"], merge: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge"], removeRequestedReviewers: [ "DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers" ], requestReviewers: [ "POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers" ], submitReview: [ "POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events" ], update: ["PATCH /repos/{owner}/{repo}/pulls/{pull_number}"], updateBranch: [ "PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch" ], updateReview: [ "PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}" ], updateReviewComment: [ "PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}" ] }, rateLimit: { get: ["GET /rate_limit"] }, reactions: { createForCommitComment: [ "POST /repos/{owner}/{repo}/comments/{comment_id}/reactions" ], createForIssue: [ "POST /repos/{owner}/{repo}/issues/{issue_number}/reactions" ], createForIssueComment: [ "POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions" ], createForPullRequestReviewComment: [ "POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions" ], createForRelease: [ "POST /repos/{owner}/{repo}/releases/{release_id}/reactions" ], createForTeamDiscussionCommentInOrg: [ "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions" ], createForTeamDiscussionInOrg: [ "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions" ], deleteForCommitComment: [ "DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}" ], deleteForIssue: [ "DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}" ], deleteForIssueComment: [ "DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}" ], deleteForPullRequestComment: [ "DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}" ], deleteForRelease: [ "DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}" ], deleteForTeamDiscussion: [ "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}" ], deleteForTeamDiscussionComment: [ "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}" ], listForCommitComment: [ "GET /repos/{owner}/{repo}/comments/{comment_id}/reactions" ], listForIssue: ["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions"], listForIssueComment: [ "GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions" ], listForPullRequestReviewComment: [ "GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions" ], listForRelease: [ "GET /repos/{owner}/{repo}/releases/{release_id}/reactions" ], listForTeamDiscussionCommentInOrg: [ "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions" ], listForTeamDiscussionInOrg: [ "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions" ] }, repos: { acceptInvitation: [ "PATCH /user/repository_invitations/{invitation_id}", {}, { renamed: ["repos", "acceptInvitationForAuthenticatedUser"] } ], acceptInvitationForAuthenticatedUser: [ "PATCH /user/repository_invitations/{invitation_id}" ], addAppAccessRestrictions: [ "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", {}, { mapToData: "apps" } ], addCollaborator: ["PUT /repos/{owner}/{repo}/collaborators/{username}"], addStatusCheckContexts: [ "POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts", {}, { mapToData: "contexts" } ], addTeamAccessRestrictions: [ "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams", {}, { mapToData: "teams" } ], addUserAccessRestrictions: [ "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users", {}, { mapToData: "users" } ], cancelPagesDeployment: [ "POST /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}/cancel" ], checkAutomatedSecurityFixes: [ "GET /repos/{owner}/{repo}/automated-security-fixes" ], checkCollaborator: ["GET /repos/{owner}/{repo}/collaborators/{username}"], checkImmutableReleases: ["GET /repos/{owner}/{repo}/immutable-releases"], checkPrivateVulnerabilityReporting: [ "GET /repos/{owner}/{repo}/private-vulnerability-reporting" ], checkVulnerabilityAlerts: [ "GET /repos/{owner}/{repo}/vulnerability-alerts" ], codeownersErrors: ["GET /repos/{owner}/{repo}/codeowners/errors"], compareCommits: ["GET /repos/{owner}/{repo}/compare/{base}...{head}"], compareCommitsWithBasehead: [ "GET /repos/{owner}/{repo}/compare/{basehead}" ], createAttestation: ["POST /repos/{owner}/{repo}/attestations"], createAutolink: ["POST /repos/{owner}/{repo}/autolinks"], createCommitComment: [ "POST /repos/{owner}/{repo}/commits/{commit_sha}/comments" ], createCommitSignatureProtection: [ "POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures" ], createCommitStatus: ["POST /repos/{owner}/{repo}/statuses/{sha}"], createDeployKey: ["POST /repos/{owner}/{repo}/keys"], createDeployment: ["POST /repos/{owner}/{repo}/deployments"], createDeploymentBranchPolicy: [ "POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies" ], createDeploymentProtectionRule: [ "POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules" ], createDeploymentStatus: [ "POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses" ], createDispatchEvent: ["POST /repos/{owner}/{repo}/dispatches"], createForAuthenticatedUser: ["POST /user/repos"], createFork: ["POST /repos/{owner}/{repo}/forks"], createInOrg: ["POST /orgs/{org}/repos"], createOrUpdateEnvironment: [ "PUT /repos/{owner}/{repo}/environments/{environment_name}" ], createOrUpdateFileContents: ["PUT /repos/{owner}/{repo}/contents/{path}"], createOrgRuleset: ["POST /orgs/{org}/rulesets"], createPagesDeployment: ["POST /repos/{owner}/{repo}/pages/deployments"], createPagesSite: ["POST /repos/{owner}/{repo}/pages"], createRelease: ["POST /repos/{owner}/{repo}/releases"], createRepoRuleset: ["POST /repos/{owner}/{repo}/rulesets"], createUsingTemplate: [ "POST /repos/{template_owner}/{template_repo}/generate" ], createWebhook: ["POST /repos/{owner}/{repo}/hooks"], customPropertiesForReposCreateOrUpdateRepositoryValues: [ "PATCH /repos/{owner}/{repo}/properties/values" ], customPropertiesForReposGetRepositoryValues: [ "GET /repos/{owner}/{repo}/properties/values" ], declineInvitation: [ "DELETE /user/repository_invitations/{invitation_id}", {}, { renamed: ["repos", "declineInvitationForAuthenticatedUser"] } ], declineInvitationForAuthenticatedUser: [ "DELETE /user/repository_invitations/{invitation_id}" ], delete: ["DELETE /repos/{owner}/{repo}"], deleteAccessRestrictions: [ "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions" ], deleteAdminBranchProtection: [ "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins" ], deleteAnEnvironment: [ "DELETE /repos/{owner}/{repo}/environments/{environment_name}" ], deleteAutolink: ["DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}"], deleteBranchProtection: [ "DELETE /repos/{owner}/{repo}/branches/{branch}/protection" ], deleteCommitComment: ["DELETE /repos/{owner}/{repo}/comments/{comment_id}"], deleteCommitSignatureProtection: [ "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures" ], deleteDeployKey: ["DELETE /repos/{owner}/{repo}/keys/{key_id}"], deleteDeployment: [ "DELETE /repos/{owner}/{repo}/deployments/{deployment_id}" ], deleteDeploymentBranchPolicy: [ "DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}" ], deleteFile: ["DELETE /repos/{owner}/{repo}/contents/{path}"], deleteInvitation: [ "DELETE /repos/{owner}/{repo}/invitations/{invitation_id}" ], deleteOrgRuleset: ["DELETE /orgs/{org}/rulesets/{ruleset_id}"], deletePagesSite: ["DELETE /repos/{owner}/{repo}/pages"], deletePullRequestReviewProtection: [ "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews" ], deleteRelease: ["DELETE /repos/{owner}/{repo}/releases/{release_id}"], deleteReleaseAsset: [ "DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}" ], deleteRepoRuleset: ["DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id}"], deleteWebhook: ["DELETE /repos/{owner}/{repo}/hooks/{hook_id}"], disableAutomatedSecurityFixes: [ "DELETE /repos/{owner}/{repo}/automated-security-fixes" ], disableDeploymentProtectionRule: [ "DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}" ], disableImmutableReleases: [ "DELETE /repos/{owner}/{repo}/immutable-releases" ], disablePrivateVulnerabilityReporting: [ "DELETE /repos/{owner}/{repo}/private-vulnerability-reporting" ], disableVulnerabilityAlerts: [ "DELETE /repos/{owner}/{repo}/vulnerability-alerts" ], downloadArchive: [ "GET /repos/{owner}/{repo}/zipball/{ref}", {}, { renamed: ["repos", "downloadZipballArchive"] } ], downloadTarballArchive: ["GET /repos/{owner}/{repo}/tarball/{ref}"], downloadZipballArchive: ["GET /repos/{owner}/{repo}/zipball/{ref}"], enableAutomatedSecurityFixes: [ "PUT /repos/{owner}/{repo}/automated-security-fixes" ], enableImmutableReleases: ["PUT /repos/{owner}/{repo}/immutable-releases"], enablePrivateVulnerabilityReporting: [ "PUT /repos/{owner}/{repo}/private-vulnerability-reporting" ], enableVulnerabilityAlerts: [ "PUT /repos/{owner}/{repo}/vulnerability-alerts" ], generateReleaseNotes: [ "POST /repos/{owner}/{repo}/releases/generate-notes" ], get: ["GET /repos/{owner}/{repo}"], getAccessRestrictions: [ "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions" ], getAdminBranchProtection: [ "GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins" ], getAllDeploymentProtectionRules: [ "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules" ], getAllEnvironments: ["GET /repos/{owner}/{repo}/environments"], getAllStatusCheckContexts: [ "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts" ], getAllTopics: ["GET /repos/{owner}/{repo}/topics"], getAppsWithAccessToProtectedBranch: [ "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps" ], getAutolink: ["GET /repos/{owner}/{repo}/autolinks/{autolink_id}"], getBranch: ["GET /repos/{owner}/{repo}/branches/{branch}"], getBranchProtection: [ "GET /repos/{owner}/{repo}/branches/{branch}/protection" ], getBranchRules: ["GET /repos/{owner}/{repo}/rules/branches/{branch}"], getClones: ["GET /repos/{owner}/{repo}/traffic/clones"], getCodeFrequencyStats: ["GET /repos/{owner}/{repo}/stats/code_frequency"], getCollaboratorPermissionLevel: [ "GET /repos/{owner}/{repo}/collaborators/{username}/permission" ], getCombinedStatusForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/status"], getCommit: ["GET /repos/{owner}/{repo}/commits/{ref}"], getCommitActivityStats: ["GET /repos/{owner}/{repo}/stats/commit_activity"], getCommitComment: ["GET /repos/{owner}/{repo}/comments/{comment_id}"], getCommitSignatureProtection: [ "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures" ], getCommunityProfileMetrics: ["GET /repos/{owner}/{repo}/community/profile"], getContent: ["GET /repos/{owner}/{repo}/contents/{path}"], getContributorsStats: ["GET /repos/{owner}/{repo}/stats/contributors"], getCustomDeploymentProtectionRule: [ "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}" ], getDeployKey: ["GET /repos/{owner}/{repo}/keys/{key_id}"], getDeployment: ["GET /repos/{owner}/{repo}/deployments/{deployment_id}"], getDeploymentBranchPolicy: [ "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}" ], getDeploymentStatus: [ "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}" ], getEnvironment: [ "GET /repos/{owner}/{repo}/environments/{environment_name}" ], getLatestPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/latest"], getLatestRelease: ["GET /repos/{owner}/{repo}/releases/latest"], getOrgRuleSuite: ["GET /orgs/{org}/rulesets/rule-suites/{rule_suite_id}"], getOrgRuleSuites: ["GET /orgs/{org}/rulesets/rule-suites"], getOrgRuleset: ["GET /orgs/{org}/rulesets/{ruleset_id}"], getOrgRulesets: ["GET /orgs/{org}/rulesets"], getPages: ["GET /repos/{owner}/{repo}/pages"], getPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/{build_id}"], getPagesDeployment: [ "GET /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}" ], getPagesHealthCheck: ["GET /repos/{owner}/{repo}/pages/health"], getParticipationStats: ["GET /repos/{owner}/{repo}/stats/participation"], getPullRequestReviewProtection: [ "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews" ], getPunchCardStats: ["GET /repos/{owner}/{repo}/stats/punch_card"], getReadme: ["GET /repos/{owner}/{repo}/readme"], getReadmeInDirectory: ["GET /repos/{owner}/{repo}/readme/{dir}"], getRelease: ["GET /repos/{owner}/{repo}/releases/{release_id}"], getReleaseAsset: ["GET /repos/{owner}/{repo}/releases/assets/{asset_id}"], getReleaseByTag: ["GET /repos/{owner}/{repo}/releases/tags/{tag}"], getRepoRuleSuite: [ "GET /repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}" ], getRepoRuleSuites: ["GET /repos/{owner}/{repo}/rulesets/rule-suites"], getRepoRuleset: ["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}"], getRepoRulesetHistory: [ "GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history" ], getRepoRulesetVersion: [ "GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history/{version_id}" ], getRepoRulesets: ["GET /repos/{owner}/{repo}/rulesets"], getStatusChecksProtection: [ "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks" ], getTeamsWithAccessToProtectedBranch: [ "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams" ], getTopPaths: ["GET /repos/{owner}/{repo}/traffic/popular/paths"], getTopReferrers: ["GET /repos/{owner}/{repo}/traffic/popular/referrers"], getUsersWithAccessToProtectedBranch: [ "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users" ], getViews: ["GET /repos/{owner}/{repo}/traffic/views"], getWebhook: ["GET /repos/{owner}/{repo}/hooks/{hook_id}"], getWebhookConfigForRepo: [ "GET /repos/{owner}/{repo}/hooks/{hook_id}/config" ], getWebhookDelivery: [ "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}" ], listActivities: ["GET /repos/{owner}/{repo}/activity"], listAttestations: [ "GET /repos/{owner}/{repo}/attestations/{subject_digest}" ], listAutolinks: ["GET /repos/{owner}/{repo}/autolinks"], listBranches: ["GET /repos/{owner}/{repo}/branches"], listBranchesForHeadCommit: [ "GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head" ], listCollaborators: ["GET /repos/{owner}/{repo}/collaborators"], listCommentsForCommit: [ "GET /repos/{owner}/{repo}/commits/{commit_sha}/comments" ], listCommitCommentsForRepo: ["GET /repos/{owner}/{repo}/comments"], listCommitStatusesForRef: [ "GET /repos/{owner}/{repo}/commits/{ref}/statuses" ], listCommits: ["GET /repos/{owner}/{repo}/commits"], listContributors: ["GET /repos/{owner}/{repo}/contributors"], listCustomDeploymentRuleIntegrations: [ "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps" ], listDeployKeys: ["GET /repos/{owner}/{repo}/keys"], listDeploymentBranchPolicies: [ "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies" ], listDeploymentStatuses: [ "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses" ], listDeployments: ["GET /repos/{owner}/{repo}/deployments"], listForAuthenticatedUser: ["GET /user/repos"], listForOrg: ["GET /orgs/{org}/repos"], listForUser: ["GET /users/{username}/repos"], listForks: ["GET /repos/{owner}/{repo}/forks"], listInvitations: ["GET /repos/{owner}/{repo}/invitations"], listInvitationsForAuthenticatedUser: ["GET /user/repository_invitations"], listLanguages: ["GET /repos/{owner}/{repo}/languages"], listPagesBuilds: ["GET /repos/{owner}/{repo}/pages/builds"], listPublic: ["GET /repositories"], listPullRequestsAssociatedWithCommit: [ "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls" ], listReleaseAssets: [ "GET /repos/{owner}/{repo}/releases/{release_id}/assets" ], listReleases: ["GET /repos/{owner}/{repo}/releases"], listTags: ["GET /repos/{owner}/{repo}/tags"], listTeams: ["GET /repos/{owner}/{repo}/teams"], listWebhookDeliveries: [ "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries" ], listWebhooks: ["GET /repos/{owner}/{repo}/hooks"], merge: ["POST /repos/{owner}/{repo}/merges"], mergeUpstream: ["POST /repos/{owner}/{repo}/merge-upstream"], pingWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/pings"], redeliverWebhookDelivery: [ "POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts" ], removeAppAccessRestrictions: [ "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", {}, { mapToData: "apps" } ], removeCollaborator: [ "DELETE /repos/{owner}/{repo}/collaborators/{username}" ], removeStatusCheckContexts: [ "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts", {}, { mapToData: "contexts" } ], removeStatusCheckProtection: [ "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks" ], removeTeamAccessRestrictions: [ "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams", {}, { mapToData: "teams" } ], removeUserAccessRestrictions: [ "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users", {}, { mapToData: "users" } ], renameBranch: ["POST /repos/{owner}/{repo}/branches/{branch}/rename"], replaceAllTopics: ["PUT /repos/{owner}/{repo}/topics"], requestPagesBuild: ["POST /repos/{owner}/{repo}/pages/builds"], setAdminBranchProtection: [ "POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins" ], setAppAccessRestrictions: [ "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", {}, { mapToData: "apps" } ], setStatusCheckContexts: [ "PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts", {}, { mapToData: "contexts" } ], setTeamAccessRestrictions: [ "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams", {}, { mapToData: "teams" } ], setUserAccessRestrictions: [ "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users", {}, { mapToData: "users" } ], testPushWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/tests"], transfer: ["POST /repos/{owner}/{repo}/transfer"], update: ["PATCH /repos/{owner}/{repo}"], updateBranchProtection: [ "PUT /repos/{owner}/{repo}/branches/{branch}/protection" ], updateCommitComment: ["PATCH /repos/{owner}/{repo}/comments/{comment_id}"], updateDeploymentBranchPolicy: [ "PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}" ], updateInformationAboutPagesSite: ["PUT /repos/{owner}/{repo}/pages"], updateInvitation: [ "PATCH /repos/{owner}/{repo}/invitations/{invitation_id}" ], updateOrgRuleset: ["PUT /orgs/{org}/rulesets/{ruleset_id}"], updatePullRequestReviewProtection: [ "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews" ], updateRelease: ["PATCH /repos/{owner}/{repo}/releases/{release_id}"], updateReleaseAsset: [ "PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}" ], updateRepoRuleset: ["PUT /repos/{owner}/{repo}/rulesets/{ruleset_id}"], updateStatusCheckPotection: [ "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks", {}, { renamed: ["repos", "updateStatusCheckProtection"] } ], updateStatusCheckProtection: [ "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks" ], updateWebhook: ["PATCH /repos/{owner}/{repo}/hooks/{hook_id}"], updateWebhookConfigForRepo: [ "PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config" ], uploadReleaseAsset: [ "POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}", { baseUrl: "https://uploads.github.com" } ] }, search: { code: ["GET /search/code"], commits: ["GET /search/commits"], issuesAndPullRequests: ["GET /search/issues"], labels: ["GET /search/labels"], repos: ["GET /search/repositories"], topics: ["GET /search/topics"], users: ["GET /search/users"] }, secretScanning: { createPushProtectionBypass: [ "POST /repos/{owner}/{repo}/secret-scanning/push-protection-bypasses" ], getAlert: [ "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}" ], getScanHistory: ["GET /repos/{owner}/{repo}/secret-scanning/scan-history"], listAlertsForOrg: ["GET /orgs/{org}/secret-scanning/alerts"], listAlertsForRepo: ["GET /repos/{owner}/{repo}/secret-scanning/alerts"], listLocationsForAlert: [ "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations" ], listOrgPatternConfigs: [ "GET /orgs/{org}/secret-scanning/pattern-configurations" ], updateAlert: [ "PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}" ], updateOrgPatternConfigs: [ "PATCH /orgs/{org}/secret-scanning/pattern-configurations" ] }, securityAdvisories: { createFork: [ "POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks" ], createPrivateVulnerabilityReport: [ "POST /repos/{owner}/{repo}/security-advisories/reports" ], createRepositoryAdvisory: [ "POST /repos/{owner}/{repo}/security-advisories" ], createRepositoryAdvisoryCveRequest: [ "POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve" ], getGlobalAdvisory: ["GET /advisories/{ghsa_id}"], getRepositoryAdvisory: [ "GET /repos/{owner}/{repo}/security-advisories/{ghsa_id}" ], listGlobalAdvisories: ["GET /advisories"], listOrgRepositoryAdvisories: ["GET /orgs/{org}/security-advisories"], listRepositoryAdvisories: ["GET /repos/{owner}/{repo}/security-advisories"], updateRepositoryAdvisory: [ "PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id}" ] }, teams: { addOrUpdateMembershipForUserInOrg: [ "PUT /orgs/{org}/teams/{team_slug}/memberships/{username}" ], addOrUpdateRepoPermissionsInOrg: [ "PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}" ], checkPermissionsForRepoInOrg: [ "GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}" ], create: ["POST /orgs/{org}/teams"], createDiscussionCommentInOrg: [ "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments" ], createDiscussionInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions"], deleteDiscussionCommentInOrg: [ "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}" ], deleteDiscussionInOrg: [ "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}" ], deleteInOrg: ["DELETE /orgs/{org}/teams/{team_slug}"], getByName: ["GET /orgs/{org}/teams/{team_slug}"], getDiscussionCommentInOrg: [ "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}" ], getDiscussionInOrg: [ "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}" ], getMembershipForUserInOrg: [ "GET /orgs/{org}/teams/{team_slug}/memberships/{username}" ], list: ["GET /orgs/{org}/teams"], listChildInOrg: ["GET /orgs/{org}/teams/{team_slug}/teams"], listDiscussionCommentsInOrg: [ "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments" ], listDiscussionsInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions"], listForAuthenticatedUser: ["GET /user/teams"], listMembersInOrg: ["GET /orgs/{org}/teams/{team_slug}/members"], listPendingInvitationsInOrg: [ "GET /orgs/{org}/teams/{team_slug}/invitations" ], listReposInOrg: ["GET /orgs/{org}/teams/{team_slug}/repos"], removeMembershipForUserInOrg: [ "DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}" ], removeRepoInOrg: [ "DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}" ], updateDiscussionCommentInOrg: [ "PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}" ], updateDiscussionInOrg: [ "PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}" ], updateInOrg: ["PATCH /orgs/{org}/teams/{team_slug}"] }, users: { addEmailForAuthenticated: [ "POST /user/emails", {}, { renamed: ["users", "addEmailForAuthenticatedUser"] } ], addEmailForAuthenticatedUser: ["POST /user/emails"], addSocialAccountForAuthenticatedUser: ["POST /user/social_accounts"], block: ["PUT /user/blocks/{username}"], checkBlocked: ["GET /user/blocks/{username}"], checkFollowingForUser: ["GET /users/{username}/following/{target_user}"], checkPersonIsFollowedByAuthenticated: ["GET /user/following/{username}"], createGpgKeyForAuthenticated: [ "POST /user/gpg_keys", {}, { renamed: ["users", "createGpgKeyForAuthenticatedUser"] } ], createGpgKeyForAuthenticatedUser: ["POST /user/gpg_keys"], createPublicSshKeyForAuthenticated: [ "POST /user/keys", {}, { renamed: ["users", "createPublicSshKeyForAuthenticatedUser"] } ], createPublicSshKeyForAuthenticatedUser: ["POST /user/keys"], createSshSigningKeyForAuthenticatedUser: ["POST /user/ssh_signing_keys"], deleteAttestationsBulk: [ "POST /users/{username}/attestations/delete-request" ], deleteAttestationsById: [ "DELETE /users/{username}/attestations/{attestation_id}" ], deleteAttestationsBySubjectDigest: [ "DELETE /users/{username}/attestations/digest/{subject_digest}" ], deleteEmailForAuthenticated: [ "DELETE /user/emails", {}, { renamed: ["users", "deleteEmailForAuthenticatedUser"] } ], deleteEmailForAuthenticatedUser: ["DELETE /user/emails"], deleteGpgKeyForAuthenticated: [ "DELETE /user/gpg_keys/{gpg_key_id}", {}, { renamed: ["users", "deleteGpgKeyForAuthenticatedUser"] } ], deleteGpgKeyForAuthenticatedUser: ["DELETE /user/gpg_keys/{gpg_key_id}"], deletePublicSshKeyForAuthenticated: [ "DELETE /user/keys/{key_id}", {}, { renamed: ["users", "deletePublicSshKeyForAuthenticatedUser"] } ], deletePublicSshKeyForAuthenticatedUser: ["DELETE /user/keys/{key_id}"], deleteSocialAccountForAuthenticatedUser: ["DELETE /user/social_accounts"], deleteSshSigningKeyForAuthenticatedUser: [ "DELETE /user/ssh_signing_keys/{ssh_signing_key_id}" ], follow: ["PUT /user/following/{username}"], getAuthenticated: ["GET /user"], getById: ["GET /user/{account_id}"], getByUsername: ["GET /users/{username}"], getContextForUser: ["GET /users/{username}/hovercard"], getGpgKeyForAuthenticated: [ "GET /user/gpg_keys/{gpg_key_id}", {}, { renamed: ["users", "getGpgKeyForAuthenticatedUser"] } ], getGpgKeyForAuthenticatedUser: ["GET /user/gpg_keys/{gpg_key_id}"], getPublicSshKeyForAuthenticated: [ "GET /user/keys/{key_id}", {}, { renamed: ["users", "getPublicSshKeyForAuthenticatedUser"] } ], getPublicSshKeyForAuthenticatedUser: ["GET /user/keys/{key_id}"], getSshSigningKeyForAuthenticatedUser: [ "GET /user/ssh_signing_keys/{ssh_signing_key_id}" ], list: ["GET /users"], listAttestations: ["GET /users/{username}/attestations/{subject_digest}"], listAttestationsBulk: [ "POST /users/{username}/attestations/bulk-list{?per_page,before,after}" ], listBlockedByAuthenticated: [ "GET /user/blocks", {}, { renamed: ["users", "listBlockedByAuthenticatedUser"] } ], listBlockedByAuthenticatedUser: ["GET /user/blocks"], listEmailsForAuthenticated: [ "GET /user/emails", {}, { renamed: ["users", "listEmailsForAuthenticatedUser"] } ], listEmailsForAuthenticatedUser: ["GET /user/emails"], listFollowedByAuthenticated: [ "GET /user/following", {}, { renamed: ["users", "listFollowedByAuthenticatedUser"] } ], listFollowedByAuthenticatedUser: ["GET /user/following"], listFollowersForAuthenticatedUser: ["GET /user/followers"], listFollowersForUser: ["GET /users/{username}/followers"], listFollowingForUser: ["GET /users/{username}/following"], listGpgKeysForAuthenticated: [ "GET /user/gpg_keys", {}, { renamed: ["users", "listGpgKeysForAuthenticatedUser"] } ], listGpgKeysForAuthenticatedUser: ["GET /user/gpg_keys"], listGpgKeysForUser: ["GET /users/{username}/gpg_keys"], listPublicEmailsForAuthenticated: [ "GET /user/public_emails", {}, { renamed: ["users", "listPublicEmailsForAuthenticatedUser"] } ], listPublicEmailsForAuthenticatedUser: ["GET /user/public_emails"], listPublicKeysForUser: ["GET /users/{username}/keys"], listPublicSshKeysForAuthenticated: [ "GET /user/keys", {}, { renamed: ["users", "listPublicSshKeysForAuthenticatedUser"] } ], listPublicSshKeysForAuthenticatedUser: ["GET /user/keys"], listSocialAccountsForAuthenticatedUser: ["GET /user/social_accounts"], listSocialAccountsForUser: ["GET /users/{username}/social_accounts"], listSshSigningKeysForAuthenticatedUser: ["GET /user/ssh_signing_keys"], listSshSigningKeysForUser: ["GET /users/{username}/ssh_signing_keys"], setPrimaryEmailVisibilityForAuthenticated: [ "PATCH /user/email/visibility", {}, { renamed: ["users", "setPrimaryEmailVisibilityForAuthenticatedUser"] } ], setPrimaryEmailVisibilityForAuthenticatedUser: [ "PATCH /user/email/visibility" ], unblock: ["DELETE /user/blocks/{username}"], unfollow: ["DELETE /user/following/{username}"], updateAuthenticated: ["PATCH /user"] } }; var endpoints_default = Endpoints; // var endpointMethodsMap = /* @__PURE__ */ new Map(); for (const [scope, endpoints] of Object.entries(endpoints_default)) { for (const [methodName, endpoint3] of Object.entries(endpoints)) { const [route, defaults2, decorations] = endpoint3; const [method, url] = route.split(/ /); const endpointDefaults = Object.assign( { method, url }, defaults2 ); if (!endpointMethodsMap.has(scope)) { endpointMethodsMap.set(scope, /* @__PURE__ */ new Map()); } endpointMethodsMap.get(scope).set(methodName, { scope, methodName, endpointDefaults, decorations }); } } var handler = { has({ scope }, methodName) { return endpointMethodsMap.get(scope).has(methodName); }, getOwnPropertyDescriptor(target, methodName) { return { value: this.get(target, methodName), // ensures method is in the cache configurable: true, writable: true, enumerable: true }; }, defineProperty(target, methodName, descriptor) { Object.defineProperty(target.cache, methodName, descriptor); return true; }, deleteProperty(target, methodName) { delete target.cache[methodName]; return true; }, ownKeys({ scope }) { return [...endpointMethodsMap.get(scope).keys()]; }, set(target, methodName, value) { return target.cache[methodName] = value; }, get({ octokit, scope, cache }, methodName) { if (cache[methodName]) { return cache[methodName]; } const method = endpointMethodsMap.get(scope).get(methodName); if (!method) { return void 0; } const { endpointDefaults, decorations } = method; if (decorations) { cache[methodName] = decorate( octokit, scope, methodName, endpointDefaults, decorations ); } else { cache[methodName] = octokit.request.defaults(endpointDefaults); } return cache[methodName]; } }; function endpointsToMethods(octokit) { const newMethods = {}; for (const scope of endpointMethodsMap.keys()) { newMethods[scope] = new Proxy({ octokit, scope, cache: {} }, handler); } return newMethods; } function decorate(octokit, scope, methodName, defaults2, decorations) { const requestWithDefaults = octokit.request.defaults(defaults2); function withDecorations(...args) { let options = requestWithDefaults.endpoint.merge(...args); if (decorations.mapToData) { options = Object.assign({}, options, { data: options[decorations.mapToData], [decorations.mapToData]: void 0 }); return requestWithDefaults(options); } if (decorations.renamed) { const [newScope, newMethodName] = decorations.renamed; octokit.log.warn( `octokit.${scope}.${methodName}() has been renamed to octokit.${newScope}.${newMethodName}()` ); } if (decorations.deprecated) { octokit.log.warn(decorations.deprecated); } if (decorations.renamedParameters) { const options2 = requestWithDefaults.endpoint.merge(...args); for (const [name, alias] of Object.entries( decorations.renamedParameters )) { if (name in options2) { octokit.log.warn( `"${name}" parameter is deprecated for "octokit.${scope}.${methodName}()". Use "${alias}" instead` ); if (!(alias in options2)) { options2[alias] = options2[name]; } delete options2[name]; } } return requestWithDefaults(options2); } return requestWithDefaults(...args); } return Object.assign(withDecorations, requestWithDefaults); } // function restEndpointMethods(octokit) { const api = endpointsToMethods(octokit); return { rest: api }; } restEndpointMethods.VERSION = VERSION5; function legacyRestEndpointMethods(octokit) { const api = endpointsToMethods(octokit); return { ...api, rest: api }; } legacyRestEndpointMethods.VERSION = VERSION5; // var VERSION6 = "0.0.0-development"; function normalizePaginatedListResponse(response) { if (!response.data) { return { ...response, data: [] }; } const responseNeedsNormalization = ("total_count" in response.data || "total_commits" in response.data) && !("url" in response.data); if (!responseNeedsNormalization) return response; const incompleteResults = response.data.incomplete_results; const repositorySelection = response.data.repository_selection; const totalCount = response.data.total_count; const totalCommits = response.data.total_commits; delete response.data.incomplete_results; delete response.data.repository_selection; delete response.data.total_count; delete response.data.total_commits; const namespaceKey = Object.keys(response.data)[0]; const data = response.data[namespaceKey]; response.data = data; if (typeof incompleteResults !== "undefined") { response.data.incomplete_results = incompleteResults; } if (typeof repositorySelection !== "undefined") { response.data.repository_selection = repositorySelection; } response.data.total_count = totalCount; response.data.total_commits = totalCommits; return response; } function iterator(octokit, route, parameters) { const options = typeof route === "function" ? route.endpoint(parameters) : octokit.request.endpoint(route, parameters); const requestMethod = typeof route === "function" ? route : octokit.request; const method = options.method; const headers = options.headers; let url = options.url; return { [Symbol.asyncIterator]: () => ({ async next() { if (!url) return { done: true }; try { const response = await requestMethod({ method, url, headers }); const normalizedResponse = normalizePaginatedListResponse(response); url = ((normalizedResponse.headers.link || "").match( /<([^<>]+)>;\s*rel="next"/ ) || [])[1]; if (!url && "total_commits" in normalizedResponse.data) { const parsedUrl = new URL(normalizedResponse.url); const params2 = parsedUrl.searchParams; const page = parseInt(params2.get("page") || "1", 10); const per_page = parseInt(params2.get("per_page") || "250", 10); if (page * per_page < normalizedResponse.data.total_commits) { params2.set("page", String(page + 1)); url = parsedUrl.toString(); } } return { value: normalizedResponse }; } catch (error2) { if (error2.status !== 409) throw error2; url = ""; return { value: { status: 200, headers: {}, data: [] } }; } } }) }; } function paginate(octokit, route, parameters, mapFn) { if (typeof parameters === "function") { mapFn = parameters; parameters = void 0; } return gather( octokit, [], iterator(octokit, route, parameters)[Symbol.asyncIterator](), mapFn ); } function gather(octokit, results, iterator22, mapFn) { return iterator22.next().then((result) => { if (result.done) { return results; } let earlyExit = false; function done() { earlyExit = true; } results = results.concat( mapFn ? mapFn(result.value, done) : result.value.data ); if (earlyExit) { return results; } return gather(octokit, results, iterator22, mapFn); }); } var composePaginateRest = Object.assign(paginate, { iterator }); function paginateRest(octokit) { return { paginate: Object.assign(paginate.bind(null, octokit), { iterator: iterator.bind(null, octokit) }) }; } paginateRest.VERSION = VERSION6; // var context = new Context(); var baseUrl = getApiBaseUrl(); var defaults = { baseUrl, request: { agent: getProxyAgent(baseUrl), fetch: getProxyFetch(baseUrl) } }; var GitHub = Octokit.plugin(restEndpointMethods, paginateRest).defaults(defaults); // var context2 = new Context(); // .github/actions/deploy-docs-site/lib/deploy.mjs import { mkdtemp, readFile, rm as rm2, writeFile as writeFile2 } from "node:fs/promises"; import { join } from "node:path"; import { tmpdir } from "node:os"; import { spawnSync } from "node:child_process"; // .github/actions/deploy-docs-site/lib/credential.mjs var import_tmp = __toESM(require_tmp(), 1); import { writeSync } from "node:fs"; var credentialFilePath; function getCredentialFilePath() { if (credentialFilePath === void 0) { const tmpFile = (0, import_tmp.fileSync)({ postfix: ".json" }); writeSync(tmpFile.fd, getInput("serviceKey", { required: true })); setSecret(tmpFile.name); credentialFilePath = tmpFile.name; } return credentialFilePath; } var githubReleaseTrainReadToken = getInput("githubReleaseTrainReadToken", { required: true }); // .github/actions/deploy-docs-site/lib/deploy.mjs async function deployToFirebase(deployment, configPath, stagingDir) { if (deployment.destination == void 0) { console.log(`No deployment necessary for docs created from: ${deployment.branch}`); return; } console.log("Preparing for deployment to firebase..."); const deployConfigPath = join(stagingDir, "firebase.json"); const config = JSON.parse(await readFile(configPath, { encoding: "utf-8" })); config["hosting"]["public"] = "./browser"; await writeFile2(deployConfigPath, JSON.stringify(config, null, 2)); firebase(`target:clear --config ${deployConfigPath} --project angular-dev-site hosting angular-docs`, stagingDir); firebase(`target:apply --config ${deployConfigPath} --project angular-dev-site hosting angular-docs ${deployment.destination}`, stagingDir); firebase(`deploy --config ${deployConfigPath} --project angular-dev-site --only hosting --non-interactive`, stagingDir); firebase(`target:clear --config ${deployConfigPath} --project angular-dev-site hosting angular-docs`, stagingDir); await rm2(stagingDir, { recursive: true }); } async function setupRedirect(deployment) { if (deployment.redirect === void 0) { console.log(`No redirect necessary for docs created from: ${deployment.branch}`); return; } console.log("Preparing to set up redirect on firebase..."); const redirectConfig = JSON.stringify({ hosting: { target: "angular-docs", redirects: [ { type: 302, regex: "^(.*)$", destination: `${deployment.redirect.to}:1` } ] } }, null, 2); const tmpRedirectDir = await mkdtemp(join(tmpdir(), "redirect-directory")); const redirectConfigPath = join(tmpRedirectDir, "firebase.json"); await writeFile2(redirectConfigPath, redirectConfig); spawnSync(`chmod 777 -R ${tmpRedirectDir}`, { encoding: "utf-8", shell: true }); firebase(`target:clear --config ${redirectConfigPath} --project angular-dev-site hosting angular-docs`, tmpRedirectDir); firebase(`target:apply --config ${redirectConfigPath} --project angular-dev-site hosting angular-docs ${deployment.redirect.from}`, tmpRedirectDir); firebase(`deploy --config ${redirectConfigPath} --project angular-dev-site --only hosting --non-interactive`, tmpRedirectDir); firebase(`target:clear --config ${redirectConfigPath} --project angular-dev-site hosting angular-docs`, tmpRedirectDir); await rm2(tmpRedirectDir, { recursive: true }); } function firebase(cmd, cwd) { const { status } = spawnSync("npx", `-y firebase-tools@13.15.1 ${cmd}`.split(" "), { cwd, encoding: "utf-8", shell: true, stdio: "inherit", env: { ...process.env, GOOGLE_APPLICATION_CREDENTIALS: getCredentialFilePath() } }); if (status !== 0) { console.error("Firebase command failed, see log above for details."); process.exit(status); } } // import { createRequire as __cjsCompatRequire_ngDev5 } from "module"; // import { createRequire as __cjsCompatRequire_ngDev4 } from "module"; // import { createRequire as __cjsCompatRequire_ngDev3 } from "module"; // import { createRequire as __cjsCompatRequire_ngDev2 } from "module"; // import { createRequire as __cjsCompatRequire_ngDev } from "module"; var require2 = __cjsCompatRequire_ngDev(import.meta.url); var __create2 = Object.create; var __defProp2 = Object.defineProperty; var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; var __getOwnPropNames2 = Object.getOwnPropertyNames; var __getProtoOf2 = Object.getPrototypeOf; var __hasOwnProp2 = Object.prototype.hasOwnProperty; var __require2 = ((x) => typeof require2 !== "undefined" ? require2 : typeof Proxy !== "undefined" ? new Proxy(x, { get: (a, b) => (typeof require2 !== "undefined" ? require2 : a)[b] }) : x)(function(x) { if (typeof require2 !== "undefined") return require2.apply(this, arguments); throw Error('Dynamic require of "' + x + '" is not supported'); }); var __esm = (fn, res) => function __init() { return fn && (res = (0, fn[__getOwnPropNames2(fn)[0]])(fn = 0)), res; }; var __commonJS2 = (cb, mod) => function __require22() { return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; var __export = (target, all) => { for (var name in all) __defProp2(target, name, { get: all[name], enumerable: true }); }; var __copyProps2 = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames2(from)) if (!__hasOwnProp2.call(to, key) && key !== except) __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); } return to; }; var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target, mod )); // import process2 from "node:process"; import os3 from "node:os"; import tty from "node:tty"; var require3 = __cjsCompatRequire_ngDev2(import.meta.url); var supports_color_exports = {}; __export(supports_color_exports, { createSupportsColor: () => createSupportsColor, default: () => supports_color_default }); function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process2.argv) { const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--"; const position = argv.indexOf(prefix + flag); const terminatorPosition = argv.indexOf("--"); return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition); } function envForceColor() { if (!("FORCE_COLOR" in env)) { return; } if (env.FORCE_COLOR === "true") { return 1; } if (env.FORCE_COLOR === "false") { return 0; } if (env.FORCE_COLOR.length === 0) { return 1; } const level = Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3); if (![0, 1, 2, 3].includes(level)) { return; } return level; } function translateLevel(level) { if (level === 0) { return false; } return { level, hasBasic: true, has256: level >= 2, has16m: level >= 3 }; } function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) { const noFlagForceColor = envForceColor(); if (noFlagForceColor !== void 0) { flagForceColor = noFlagForceColor; } const forceColor = sniffFlags ? flagForceColor : noFlagForceColor; if (forceColor === 0) { return 0; } if (sniffFlags) { if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) { return 3; } if (hasFlag("color=256")) { return 2; } } if ("TF_BUILD" in env && "AGENT_NAME" in env) { return 1; } if (haveStream && !streamIsTTY && forceColor === void 0) { return 0; } const min = forceColor || 0; if (env.TERM === "dumb") { return min; } if (process2.platform === "win32") { const osRelease = os3.release().split("."); if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { return Number(osRelease[2]) >= 14931 ? 3 : 2; } return 1; } if ("CI" in env) { if (["GITHUB_ACTIONS", "GITEA_ACTIONS", "CIRCLECI"].some((key) => key in env)) { return 3; } if (["TRAVIS", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") { return 1; } return min; } if ("TEAMCITY_VERSION" in env) { return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; } if (env.COLORTERM === "truecolor") { return 3; } if (env.TERM === "xterm-kitty") { return 3; } if (env.TERM === "xterm-ghostty") { return 3; } if (env.TERM === "wezterm") { return 3; } if ("TERM_PROGRAM" in env) { const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10); switch (env.TERM_PROGRAM) { case "iTerm.app": { return version >= 3 ? 3 : 2; } case "Apple_Terminal": { return 2; } } } if (/-256(color)?$/i.test(env.TERM)) { return 2; } if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { return 1; } if ("COLORTERM" in env) { return 1; } return min; } function createSupportsColor(stream, options = {}) { const level = _supportsColor(stream, { streamIsTTY: stream && stream.isTTY, ...options }); return translateLevel(level); } var env; var flagForceColor; var supportsColor; var supports_color_default; var init_supports_color = __esm({ ""() { ({ env } = process2); if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) { flagForceColor = 0; } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) { flagForceColor = 1; } supportsColor = { stdout: createSupportsColor({ isTTY: tty.isatty(1) }), stderr: createSupportsColor({ isTTY: tty.isatty(2) }) }; supports_color_default = supportsColor; } }); // import { notStrictEqual, strictEqual } from "assert"; import { dirname, resolve } from "path"; import { readdirSync, statSync } from "fs"; import { inspect } from "util"; import { fileURLToPath } from "url"; import { format } from "util"; import { normalize, resolve as resolve2 } from "path"; import { readFileSync as readFileSync2 } from "fs"; import { createRequire } from "node:module"; import { basename, dirname as dirname2, extname, relative, resolve as resolve4, join as join2 } from "path"; import { readFileSync as readFileSync22, statSync as statSync2, writeFile as writeFile3 } from "fs"; import { format as format2 } from "util"; import { resolve as resolve3 } from "path"; import { createRequire as createRequire2 } from "node:module"; import { readFileSync as readFileSync3, readdirSync as readdirSync2 } from "node:fs"; import { styleText } from "util"; import { spawn as _spawn, spawnSync as _spawnSync, exec as _exec } from "child_process"; import assert from "assert"; import { stripVTControlCharacters } from "util"; import { join as join3 } from "path"; import { pathToFileURL } from "url"; var require4 = __cjsCompatRequire_ngDev3(import.meta.url); var require_get_caller_file = __commonJS2({ ""(exports, module) { "use strict"; module.exports = function getCallerFile2(position) { if (position === void 0) { position = 2; } if (position >= Error.stackTraceLimit) { throw new TypeError("getCallerFile(position) requires position be less then Error.stackTraceLimit but position was: `" + position + "` and Error.stackTraceLimit was: `" + Error.stackTraceLimit + "`"); } var oldPrepareStackTrace = Error.prepareStackTrace; Error.prepareStackTrace = function(_, stack2) { return stack2; }; var stack = new Error().stack; Error.prepareStackTrace = oldPrepareStackTrace; if (stack !== null && typeof stack === "object") { return stack[position] ? stack[position].getFileName() : void 0; } }; } }); var align = { right: alignRight, center: alignCenter }; var top = 0; var right = 1; var bottom = 2; var left = 3; var UI = class { constructor(opts) { var _a2; this.width = opts.width; this.wrap = (_a2 = opts.wrap) !== null && _a2 !== void 0 ? _a2 : true; this.rows = []; } span(...args) { const cols = this.div(...args); cols.span = true; } resetOutput() { this.rows = []; } div(...args) { if (args.length === 0) { this.div(""); } if (this.wrap && this.shouldApplyLayoutDSL(...args) && typeof args[0] === "string") { return this.applyLayoutDSL(args[0]); } const cols = args.map((arg) => { if (typeof arg === "string") { return this.colFromString(arg); } return arg; }); this.rows.push(cols); return cols; } shouldApplyLayoutDSL(...args) { return args.length === 1 && typeof args[0] === "string" && /[\t\n]/.test(args[0]); } applyLayoutDSL(str) { const rows = str.split("\n").map((row) => row.split(" ")); let leftColumnWidth = 0; rows.forEach((columns) => { if (columns.length > 1 && mixin.stringWidth(columns[0]) > leftColumnWidth) { leftColumnWidth = Math.min(Math.floor(this.width * 0.5), mixin.stringWidth(columns[0])); } }); rows.forEach((columns) => { this.div(...columns.map((r, i) => { return { text: r.trim(), padding: this.measurePadding(r), width: i === 0 && columns.length > 1 ? leftColumnWidth : void 0 }; })); }); return this.rows[this.rows.length - 1]; } colFromString(text) { return { text, padding: this.measurePadding(text) }; } measurePadding(str) { const noAnsi = mixin.stripAnsi(str); return [0, noAnsi.match(/\s*$/)[0].length, 0, noAnsi.match(/^\s*/)[0].length]; } toString() { const lines = []; this.rows.forEach((row) => { this.rowToString(row, lines); }); return lines.filter((line) => !line.hidden).map((line) => line.text).join("\n"); } rowToString(row, lines) { this.rasterize(row).forEach((rrow, r) => { let str = ""; rrow.forEach((col, c) => { const { width } = row[c]; const wrapWidth = this.negatePadding(row[c]); let ts = col; if (wrapWidth > mixin.stringWidth(col)) { ts += " ".repeat(wrapWidth - mixin.stringWidth(col)); } if (row[c].align && row[c].align !== "left" && this.wrap) { const fn = align[row[c].align]; ts = fn(ts, wrapWidth); if (mixin.stringWidth(ts) < wrapWidth) { ts += " ".repeat((width || 0) - mixin.stringWidth(ts) - 1); } } const padding = row[c].padding || [0, 0, 0, 0]; if (padding[left]) { str += " ".repeat(padding[left]); } str += addBorder(row[c], ts, "| "); str += ts; str += addBorder(row[c], ts, " |"); if (padding[right]) { str += " ".repeat(padding[right]); } if (r === 0 && lines.length > 0) { str = this.renderInline(str, lines[lines.length - 1]); } }); lines.push({ text: str.replace(/ +$/, ""), span: row.span }); }); return lines; } // if the full 'source' can render in // the target line, do so. renderInline(source, previousLine) { const match = source.match(/^ */); const leadingWhitespace = match ? match[0].length : 0; const target = previousLine.text; const targetTextWidth = mixin.stringWidth(target.trimRight()); if (!previousLine.span) { return source; } if (!this.wrap) { previousLine.hidden = true; return target + source; } if (leadingWhitespace < targetTextWidth) { return source; } previousLine.hidden = true; return target.trimRight() + " ".repeat(leadingWhitespace - targetTextWidth) + source.trimLeft(); } rasterize(row) { const rrows = []; const widths = this.columnWidths(row); let wrapped; row.forEach((col, c) => { col.width = widths[c]; if (this.wrap) { wrapped = mixin.wrap(col.text, this.negatePadding(col), { hard: true }).split("\n"); } else { wrapped = col.text.split("\n"); } if (col.border) { wrapped.unshift("." + "-".repeat(this.negatePadding(col) + 2) + "."); wrapped.push("'" + "-".repeat(this.negatePadding(col) + 2) + "'"); } if (col.padding) { wrapped.unshift(...new Array(col.padding[top] || 0).fill("")); wrapped.push(...new Array(col.padding[bottom] || 0).fill("")); } wrapped.forEach((str, r) => { if (!rrows[r]) { rrows.push([]); } const rrow = rrows[r]; for (let i = 0; i < c; i++) { if (rrow[i] === void 0) { rrow.push(""); } } rrow.push(str); }); }); return rrows; } negatePadding(col) { let wrapWidth = col.width || 0; if (col.padding) { wrapWidth -= (col.padding[left] || 0) + (col.padding[right] || 0); } if (col.border) { wrapWidth -= 4; } return wrapWidth; } columnWidths(row) { if (!this.wrap) { return row.map((col) => { return col.width || mixin.stringWidth(col.text); }); } let unset = row.length; let remainingWidth = this.width; const widths = row.map((col) => { if (col.width) { unset--; remainingWidth -= col.width; return col.width; } return void 0; }); const unsetWidth = unset ? Math.floor(remainingWidth / unset) : 0; return widths.map((w, i) => { if (w === void 0) { return Math.max(unsetWidth, _minWidth(row[i])); } return w; }); } }; function addBorder(col, ts, style) { if (col.border) { if (/[.']-+[.']/.test(ts)) { return ""; } if (ts.trim().length !== 0) { return style; } return " "; } return ""; } function _minWidth(col) { const padding = col.padding || []; const minWidth = 1 + (padding[left] || 0) + (padding[right] || 0); if (col.border) { return minWidth + 4; } return minWidth; } function getWindowWidth() { if (typeof process === "object" && process.stdout && process.stdout.columns) { return process.stdout.columns; } return 80; } function alignRight(str, width) { str = str.trim(); const strWidth = mixin.stringWidth(str); if (strWidth < width) { return " ".repeat(width - strWidth) + str; } return str; } function alignCenter(str, width) { str = str.trim(); const strWidth = mixin.stringWidth(str); if (strWidth >= width) { return str; } return " ".repeat(width - strWidth >> 1) + str; } var mixin; function cliui(opts, _mixin) { mixin = _mixin; return new UI({ width: (opts === null || opts === void 0 ? void 0 : opts.width) || getWindowWidth(), wrap: opts === null || opts === void 0 ? void 0 : opts.wrap }); } function ansiRegex({ onlyFirst = false } = {}) { const ST = "(?:\\u0007|\\u001B\\u005C|\\u009C)"; const osc = `(?:\\u001B\\][\\s\\S]*?${ST})`; const csi = "[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]"; const pattern = `${osc}|${csi}`; return new RegExp(pattern, onlyFirst ? void 0 : "g"); } var regex = ansiRegex(); function stripAnsi(string) { if (typeof string !== "string") { throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``); } if (!string.includes("\x1B") && !string.includes("\x9B")) { return string; } return string.replace(regex, ""); } var ambiguousRanges = [161, 161, 164, 164, 167, 168, 170, 170, 173, 174, 176, 180, 182, 186, 188, 191, 198, 198, 208, 208, 215, 216, 222, 225, 230, 230, 232, 234, 236, 237, 240, 240, 242, 243, 247, 250, 252, 252, 254, 254, 257, 257, 273, 273, 275, 275, 283, 283, 294, 295, 299, 299, 305, 307, 312, 312, 319, 322, 324, 324, 328, 331, 333, 333, 338, 339, 358, 359, 363, 363, 462, 462, 464, 464, 466, 466, 468, 468, 470, 470, 472, 472, 474, 474, 476, 476, 593, 593, 609, 609, 708, 708, 711, 711, 713, 715, 717, 717, 720, 720, 728, 731, 733, 733, 735, 735, 768, 879, 913, 929, 931, 937, 945, 961, 963, 969, 1025, 1025, 1040, 1103, 1105, 1105, 8208, 8208, 8211, 8214, 8216, 8217, 8220, 8221, 8224, 8226, 8228, 8231, 8240, 8240, 8242, 8243, 8245, 8245, 8251, 8251, 8254, 8254, 8308, 8308, 8319, 8319, 8321, 8324, 8364, 8364, 8451, 8451, 8453, 8453, 8457, 8457, 8467, 8467, 8470, 8470, 8481, 8482, 8486, 8486, 8491, 8491, 8531, 8532, 8539, 8542, 8544, 8555, 8560, 8569, 8585, 8585, 8592, 8601, 8632, 8633, 8658, 8658, 8660, 8660, 8679, 8679, 8704, 8704, 8706, 8707, 8711, 8712, 8715, 8715, 8719, 8719, 8721, 8721, 8725, 8725, 8730, 8730, 8733, 8736, 8739, 8739, 8741, 8741, 8743, 8748, 8750, 8750, 8756, 8759, 8764, 8765, 8776, 8776, 8780, 8780, 8786, 8786, 8800, 8801, 8804, 8807, 8810, 8811, 8814, 8815, 8834, 8835, 8838, 8839, 8853, 8853, 8857, 8857, 8869, 8869, 8895, 8895, 8978, 8978, 9312, 9449, 9451, 9547, 9552, 9587, 9600, 9615, 9618, 9621, 9632, 9633, 9635, 9641, 9650, 9651, 9654, 9655, 9660, 9661, 9664, 9665, 9670, 9672, 9675, 9675, 9678, 9681, 9698, 9701, 9711, 9711, 9733, 9734, 9737, 9737, 9742, 9743, 9756, 9756, 9758, 9758, 9792, 9792, 9794, 9794, 9824, 9825, 9827, 9829, 9831, 9834, 9836, 9837, 9839, 9839, 9886, 9887, 9919, 9919, 9926, 9933, 9935, 9939, 9941, 9953, 9955, 9955, 9960, 9961, 9963, 9969, 9972, 9972, 9974, 9977, 9979, 9980, 9982, 9983, 10045, 10045, 10102, 10111, 11094, 11097, 12872, 12879, 57344, 63743, 65024, 65039, 65533, 65533, 127232, 127242, 127248, 127277, 127280, 127337, 127344, 127373, 127375, 127376, 127387, 127404, 917760, 917999, 983040, 1048573, 1048576, 1114109]; var fullwidthRanges = [12288, 12288, 65281, 65376, 65504, 65510]; var halfwidthRanges = [8361, 8361, 65377, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, 65512, 65518]; var narrowRanges = [32, 126, 162, 163, 165, 166, 172, 172, 175, 175, 10214, 10221, 10629, 10630]; var wideRanges = [4352, 4447, 8986, 8987, 9001, 9002, 9193, 9196, 9200, 9200, 9203, 9203, 9725, 9726, 9748, 9749, 9776, 9783, 9800, 9811, 9855, 9855, 9866, 9871, 9875, 9875, 9889, 9889, 9898, 9899, 9917, 9918, 9924, 9925, 9934, 9934, 9940, 9940, 9962, 9962, 9970, 9971, 9973, 9973, 9978, 9978, 9981, 9981, 9989, 9989, 9994, 9995, 10024, 10024, 10060, 10060, 10062, 10062, 10067, 10069, 10071, 10071, 10133, 10135, 10160, 10160, 10175, 10175, 11035, 11036, 11088, 11088, 11093, 11093, 11904, 11929, 11931, 12019, 12032, 12245, 12272, 12287, 12289, 12350, 12353, 12438, 12441, 12543, 12549, 12591, 12593, 12686, 12688, 12773, 12783, 12830, 12832, 12871, 12880, 42124, 42128, 42182, 43360, 43388, 44032, 55203, 63744, 64255, 65040, 65049, 65072, 65106, 65108, 65126, 65128, 65131, 94176, 94180, 94192, 94198, 94208, 101589, 101631, 101662, 101760, 101874, 110576, 110579, 110581, 110587, 110589, 110590, 110592, 110882, 110898, 110898, 110928, 110930, 110933, 110933, 110948, 110951, 110960, 111355, 119552, 119638, 119648, 119670, 126980, 126980, 127183, 127183, 127374, 127374, 127377, 127386, 127488, 127490, 127504, 127547, 127552, 127560, 127568, 127569, 127584, 127589, 127744, 127776, 127789, 127797, 127799, 127868, 127870, 127891, 127904, 127946, 127951, 127955, 127968, 127984, 127988, 127988, 127992, 128062, 128064, 128064, 128066, 128252, 128255, 128317, 128331, 128334, 128336, 128359, 128378, 128378, 128405, 128406, 128420, 128420, 128507, 128591, 128640, 128709, 128716, 128716, 128720, 128722, 128725, 128728, 128732, 128735, 128747, 128748, 128756, 128764, 128992, 129003, 129008, 129008, 129292, 129338, 129340, 129349, 129351, 129535, 129648, 129660, 129664, 129674, 129678, 129734, 129736, 129736, 129741, 129756, 129759, 129770, 129775, 129784, 131072, 196605, 196608, 262141]; var isInRange = (ranges, codePoint) => { let low = 0; let high = Math.floor(ranges.length / 2) - 1; while (low <= high) { const mid = Math.floor((low + high) / 2); const i = mid * 2; if (codePoint < ranges[i]) { high = mid - 1; } else if (codePoint > ranges[i + 1]) { low = mid + 1; } else { return true; } } return false; }; var minimumAmbiguousCodePoint = ambiguousRanges[0]; var maximumAmbiguousCodePoint = ambiguousRanges.at(-1); var minimumFullWidthCodePoint = fullwidthRanges[0]; var maximumFullWidthCodePoint = fullwidthRanges.at(-1); var minimumHalfWidthCodePoint = halfwidthRanges[0]; var maximumHalfWidthCodePoint = halfwidthRanges.at(-1); var minimumNarrowCodePoint = narrowRanges[0]; var maximumNarrowCodePoint = narrowRanges.at(-1); var minimumWideCodePoint = wideRanges[0]; var maximumWideCodePoint = wideRanges.at(-1); var commonCjkCodePoint = 19968; var [wideFastPathStart, wideFastPathEnd] = findWideFastPathRange(wideRanges); function findWideFastPathRange(ranges) { let fastPathStart = ranges[0]; let fastPathEnd = ranges[1]; for (let index = 0; index < ranges.length; index += 2) { const start = ranges[index]; const end = ranges[index + 1]; if (commonCjkCodePoint >= start && commonCjkCodePoint <= end) { return [start, end]; } if (end - start > fastPathEnd - fastPathStart) { fastPathStart = start; fastPathEnd = end; } } return [fastPathStart, fastPathEnd]; } var isAmbiguous = (codePoint) => { if (codePoint < minimumAmbiguousCodePoint || codePoint > maximumAmbiguousCodePoint) { return false; } return isInRange(ambiguousRanges, codePoint); }; var isFullWidth = (codePoint) => { if (codePoint < minimumFullWidthCodePoint || codePoint > maximumFullWidthCodePoint) { return false; } return isInRange(fullwidthRanges, codePoint); }; var isWide = (codePoint) => { if (codePoint >= wideFastPathStart && codePoint <= wideFastPathEnd) { return true; } if (codePoint < minimumWideCodePoint || codePoint > maximumWideCodePoint) { return false; } return isInRange(wideRanges, codePoint); }; function validate(codePoint) { if (!Number.isSafeInteger(codePoint)) { throw new TypeError(`Expected a code point, got \`${typeof codePoint}\`.`); } } function eastAsianWidth(codePoint, { ambiguousAsWide = false } = {}) { validate(codePoint); if (isFullWidth(codePoint) || isWide(codePoint) || ambiguousAsWide && isAmbiguous(codePoint)) { return 2; } return 1; } var emoji_regex_default = () => { return /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g; }; var segmenter = new Intl.Segmenter(); var defaultIgnorableCodePointRegex = new RegExp("^\\p{Default_Ignorable_Code_Point}$", "u"); function stringWidth(string, options = {}) { if (typeof string !== "string" || string.length === 0) { return 0; } const { ambiguousIsNarrow = true, countAnsiEscapeCodes = false } = options; if (!countAnsiEscapeCodes) { string = stripAnsi(string); } if (string.length === 0) { return 0; } let width = 0; const eastAsianWidthOptions = { ambiguousAsWide: !ambiguousIsNarrow }; for (const { segment: character } of segmenter.segment(string)) { const codePoint = character.codePointAt(0); if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) { continue; } if (codePoint >= 8203 && codePoint <= 8207 || codePoint === 65279) { continue; } if (codePoint >= 768 && codePoint <= 879 || codePoint >= 6832 && codePoint <= 6911 || codePoint >= 7616 && codePoint <= 7679 || codePoint >= 8400 && codePoint <= 8447 || codePoint >= 65056 && codePoint <= 65071) { continue; } if (codePoint >= 55296 && codePoint <= 57343) { continue; } if (codePoint >= 65024 && codePoint <= 65039) { continue; } if (defaultIgnorableCodePointRegex.test(character)) { continue; } if (emoji_regex_default().test(character)) { width += 2; continue; } width += eastAsianWidth(codePoint, eastAsianWidthOptions); } return width; } var ANSI_BACKGROUND_OFFSET = 10; var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`; var wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`; var wrapAnsi16m = (offset = 0) => (red2, green2, blue2) => `\x1B[${38 + offset};2;${red2};${green2};${blue2}m`; var styles = { modifier: { reset: [0, 0], // 21 isn't widely supported and 22 does the same thing bold: [1, 22], dim: [2, 22], italic: [3, 23], underline: [4, 24], overline: [53, 55], inverse: [7, 27], hidden: [8, 28], strikethrough: [9, 29] }, color: { black: [30, 39], red: [31, 39], green: [32, 39], yellow: [33, 39], blue: [34, 39], magenta: [35, 39], cyan: [36, 39], white: [37, 39], // Bright color blackBright: [90, 39], gray: [90, 39], // Alias of `blackBright` grey: [90, 39], // Alias of `blackBright` redBright: [91, 39], greenBright: [92, 39], yellowBright: [93, 39], blueBright: [94, 39], magentaBright: [95, 39], cyanBright: [96, 39], whiteBright: [97, 39] }, bgColor: { bgBlack: [40, 49], bgRed: [41, 49], bgGreen: [42, 49], bgYellow: [43, 49], bgBlue: [44, 49], bgMagenta: [45, 49], bgCyan: [46, 49], bgWhite: [47, 49], // Bright color bgBlackBright: [100, 49], bgGray: [100, 49], // Alias of `bgBlackBright` bgGrey: [100, 49], // Alias of `bgBlackBright` bgRedBright: [101, 49], bgGreenBright: [102, 49], bgYellowBright: [103, 49], bgBlueBright: [104, 49], bgMagentaBright: [105, 49], bgCyanBright: [106, 49], bgWhiteBright: [107, 49] } }; var modifierNames = Object.keys(styles.modifier); var foregroundColorNames = Object.keys(styles.color); var backgroundColorNames = Object.keys(styles.bgColor); var colorNames = [...foregroundColorNames, ...backgroundColorNames]; function assembleStyles() { const codes = /* @__PURE__ */ new Map(); for (const [groupName, group] of Object.entries(styles)) { for (const [styleName, style] of Object.entries(group)) { styles[styleName] = { open: `\x1B[${style[0]}m`, close: `\x1B[${style[1]}m` }; group[styleName] = styles[styleName]; codes.set(style[0], style[1]); } Object.defineProperty(styles, groupName, { value: group, enumerable: false }); } Object.defineProperty(styles, "codes", { value: codes, enumerable: false }); styles.color.close = "\x1B[39m"; styles.bgColor.close = "\x1B[49m"; styles.color.ansi = wrapAnsi16(); styles.color.ansi256 = wrapAnsi256(); styles.color.ansi16m = wrapAnsi16m(); styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET); styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET); styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET); Object.defineProperties(styles, { rgbToAnsi256: { value(red2, green2, blue2) { if (red2 === green2 && green2 === blue2) { if (red2 < 8) { return 16; } if (red2 > 248) { return 231; } return Math.round((red2 - 8) / 247 * 24) + 232; } return 16 + 36 * Math.round(red2 / 255 * 5) + 6 * Math.round(green2 / 255 * 5) + Math.round(blue2 / 255 * 5); }, enumerable: false }, hexToRgb: { value(hex) { const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16)); if (!matches) { return [0, 0, 0]; } let [colorString] = matches; if (colorString.length === 3) { colorString = [...colorString].map((character) => character + character).join(""); } const integer = Number.parseInt(colorString, 16); return [ /* eslint-disable no-bitwise */ integer >> 16 & 255, integer >> 8 & 255, integer & 255 /* eslint-enable no-bitwise */ ]; }, enumerable: false }, hexToAnsi256: { value: (hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)), enumerable: false }, ansi256ToAnsi: { value(code) { if (code < 8) { return 30 + code; } if (code < 16) { return 90 + (code - 8); } let red2; let green2; let blue2; if (code >= 232) { red2 = ((code - 232) * 10 + 8) / 255; green2 = red2; blue2 = red2; } else { code -= 16; const remainder = code % 36; red2 = Math.floor(code / 36) / 5; green2 = Math.floor(remainder / 6) / 5; blue2 = remainder % 6 / 5; } const value = Math.max(red2, green2, blue2) * 2; if (value === 0) { return 30; } let result = 30 + (Math.round(blue2) << 2 | Math.round(green2) << 1 | Math.round(red2)); if (value === 2) { result += 60; } return result; }, enumerable: false }, rgbToAnsi: { value: (red2, green2, blue2) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red2, green2, blue2)), enumerable: false }, hexToAnsi: { value: (hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)), enumerable: false } }); return styles; } var ansiStyles = assembleStyles(); var ansi_styles_default = ansiStyles; var ESCAPES = /* @__PURE__ */ new Set([ "\x1B", "\x9B" ]); var END_CODE = 39; var ANSI_ESCAPE_BELL = "\x07"; var ANSI_CSI = "["; var ANSI_OSC = "]"; var ANSI_SGR_TERMINATOR = "m"; var ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`; var wrapAnsiCode = (code) => `${ESCAPES.values().next().value}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`; var wrapAnsiHyperlink = (url) => `${ESCAPES.values().next().value}${ANSI_ESCAPE_LINK}${url}${ANSI_ESCAPE_BELL}`; var wordLengths = (string) => string.split(" ").map((character) => stringWidth(character)); var wrapWord = (rows, word, columns) => { const characters = [...word]; let isInsideEscape = false; let isInsideLinkEscape = false; let visible = stringWidth(stripAnsi(rows.at(-1))); for (const [index, character] of characters.entries()) { const characterLength = stringWidth(character); if (visible + characterLength <= columns) { rows[rows.length - 1] += character; } else { rows.push(character); visible = 0; } if (ESCAPES.has(character)) { isInsideEscape = true; const ansiEscapeLinkCandidate = characters.slice(index + 1, index + 1 + ANSI_ESCAPE_LINK.length).join(""); isInsideLinkEscape = ansiEscapeLinkCandidate === ANSI_ESCAPE_LINK; } if (isInsideEscape) { if (isInsideLinkEscape) { if (character === ANSI_ESCAPE_BELL) { isInsideEscape = false; isInsideLinkEscape = false; } } else if (character === ANSI_SGR_TERMINATOR) { isInsideEscape = false; } continue; } visible += characterLength; if (visible === columns && index < characters.length - 1) { rows.push(""); visible = 0; } } if (!visible && rows.at(-1).length > 0 && rows.length > 1) { rows[rows.length - 2] += rows.pop(); } }; var stringVisibleTrimSpacesRight = (string) => { const words = string.split(" "); let last = words.length; while (last > 0) { if (stringWidth(words[last - 1]) > 0) { break; } last--; } if (last === words.length) { return string; } return words.slice(0, last).join(" ") + words.slice(last).join(""); }; var exec = (string, columns, options = {}) => { if (options.trim !== false && string.trim() === "") { return ""; } let returnValue = ""; let escapeCode; let escapeUrl; const lengths = wordLengths(string); let rows = [""]; for (const [index, word] of string.split(" ").entries()) { if (options.trim !== false) { rows[rows.length - 1] = rows.at(-1).trimStart(); } let rowLength = stringWidth(rows.at(-1)); if (index !== 0) { if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) { rows.push(""); rowLength = 0; } if (rowLength > 0 || options.trim === false) { rows[rows.length - 1] += " "; rowLength++; } } if (options.hard && lengths[index] > columns) { const remainingColumns = columns - rowLength; const breaksStartingThisLine = 1 + Math.floor((lengths[index] - remainingColumns - 1) / columns); const breaksStartingNextLine = Math.floor((lengths[index] - 1) / columns); if (breaksStartingNextLine < breaksStartingThisLine) { rows.push(""); } wrapWord(rows, word, columns); continue; } if (rowLength + lengths[index] > columns && rowLength > 0 && lengths[index] > 0) { if (options.wordWrap === false && rowLength < columns) { wrapWord(rows, word, columns); continue; } rows.push(""); } if (rowLength + lengths[index] > columns && options.wordWrap === false) { wrapWord(rows, word, columns); continue; } rows[rows.length - 1] += word; } if (options.trim !== false) { rows = rows.map((row) => stringVisibleTrimSpacesRight(row)); } const preString = rows.join("\n"); const pre = [...preString]; let preStringIndex = 0; for (const [index, character] of pre.entries()) { returnValue += character; if (ESCAPES.has(character)) { const { groups } = new RegExp(`(?:\\${ANSI_CSI}(?\\d+)m|\\${ANSI_ESCAPE_LINK}(?.*)${ANSI_ESCAPE_BELL})`).exec(preString.slice(preStringIndex)) || { groups: {} }; if (groups.code !== void 0) { const code2 = Number.parseFloat(groups.code); escapeCode = code2 === END_CODE ? void 0 : code2; } else if (groups.uri !== void 0) { escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri; } } const code = ansi_styles_default.codes.get(Number(escapeCode)); if (pre[index + 1] === "\n") { if (escapeUrl) { returnValue += wrapAnsiHyperlink(""); } if (escapeCode && code) { returnValue += wrapAnsiCode(code); } } else if (character === "\n") { if (escapeCode && code) { returnValue += wrapAnsiCode(escapeCode); } if (escapeUrl) { returnValue += wrapAnsiHyperlink(escapeUrl); } } preStringIndex += character.length; } return returnValue; }; function wrapAnsi(string, columns, options) { return String(string).normalize().replaceAll("\r\n", "\n").split("\n").map((line) => exec(line, columns, options)).join("\n"); } function ui(opts) { return cliui(opts, { stringWidth, stripAnsi, wrap: wrapAnsi }); } function sync_default(start, callback) { let dir = resolve(".", start); let tmp, stats = statSync(dir); if (!stats.isDirectory()) { dir = dirname(dir); } while (true) { tmp = callback(dir, readdirSync(dir)); if (tmp) return resolve(dir, tmp); dir = dirname(tmp = dir); if (tmp === dir) break; } } function camelCase(str) { const isCamelCase = str !== str.toLowerCase() && str !== str.toUpperCase(); if (!isCamelCase) { str = str.toLowerCase(); } if (str.indexOf("-") === -1 && str.indexOf("_") === -1) { return str; } else { let camelcase = ""; let nextChrUpper = false; const leadingHyphens = str.match(/^-+/); for (let i = leadingHyphens ? leadingHyphens[0].length : 0; i < str.length; i++) { let chr = str.charAt(i); if (nextChrUpper) { nextChrUpper = false; chr = chr.toUpperCase(); } if (i !== 0 && (chr === "-" || chr === "_")) { nextChrUpper = true; } else if (chr !== "-" && chr !== "_") { camelcase += chr; } } return camelcase; } } function decamelize(str, joinString) { const lowercase = str.toLowerCase(); joinString = joinString || "-"; let notCamelcase = ""; for (let i = 0; i < str.length; i++) { const chrLower = lowercase.charAt(i); const chrString = str.charAt(i); if (chrLower !== chrString && i > 0) { notCamelcase += `${joinString}${lowercase.charAt(i)}`; } else { notCamelcase += chrString; } } return notCamelcase; } function looksLikeNumber(x) { if (x === null || x === void 0) return false; if (typeof x === "number") return true; if (/^0x[0-9a-f]+$/i.test(x)) return true; if (/^0[^.]/.test(x)) return false; return /^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x); } function tokenizeArgString(argString) { if (Array.isArray(argString)) { return argString.map((e) => typeof e !== "string" ? e + "" : e); } argString = argString.trim(); let i = 0; let prevC = null; let c = null; let opening = null; const args = []; for (let ii = 0; ii < argString.length; ii++) { prevC = c; c = argString.charAt(ii); if (c === " " && !opening) { if (!(prevC === " ")) { i++; } continue; } if (c === opening) { opening = null; } else if ((c === "'" || c === '"') && !opening) { opening = c; } if (!args[i]) args[i] = ""; args[i] += c; } return args; } var DefaultValuesForTypeKey; (function(DefaultValuesForTypeKey2) { DefaultValuesForTypeKey2["BOOLEAN"] = "boolean"; DefaultValuesForTypeKey2["STRING"] = "string"; DefaultValuesForTypeKey2["NUMBER"] = "number"; DefaultValuesForTypeKey2["ARRAY"] = "array"; })(DefaultValuesForTypeKey || (DefaultValuesForTypeKey = {})); var mixin2; var YargsParser = class { constructor(_mixin) { mixin2 = _mixin; } parse(argsInput, options) { const opts = Object.assign({ alias: void 0, array: void 0, boolean: void 0, config: void 0, configObjects: void 0, configuration: void 0, coerce: void 0, count: void 0, default: void 0, envPrefix: void 0, narg: void 0, normalize: void 0, string: void 0, number: void 0, __: void 0, key: void 0 }, options); const args = tokenizeArgString(argsInput); const inputIsString = typeof argsInput === "string"; const aliases = combineAliases(Object.assign(/* @__PURE__ */ Object.create(null), opts.alias)); const configuration = Object.assign({ "boolean-negation": true, "camel-case-expansion": true, "combine-arrays": false, "dot-notation": true, "duplicate-arguments-array": true, "flatten-duplicate-arrays": true, "greedy-arrays": true, "halt-at-non-option": false, "nargs-eats-options": false, "negation-prefix": "no-", "parse-numbers": true, "parse-positional-numbers": true, "populate--": false, "set-placeholder-key": false, "short-option-groups": true, "strip-aliased": false, "strip-dashed": false, "unknown-options-as-args": false }, opts.configuration); const defaults2 = Object.assign(/* @__PURE__ */ Object.create(null), opts.default); const configObjects = opts.configObjects || []; const envPrefix = opts.envPrefix; const notFlagsOption = configuration["populate--"]; const notFlagsArgv = notFlagsOption ? "--" : "_"; const newAliases = /* @__PURE__ */ Object.create(null); const defaulted = /* @__PURE__ */ Object.create(null); const __ = opts.__ || mixin2.format; const flags = { aliases: /* @__PURE__ */ Object.create(null), arrays: /* @__PURE__ */ Object.create(null), bools: /* @__PURE__ */ Object.create(null), strings: /* @__PURE__ */ Object.create(null), numbers: /* @__PURE__ */ Object.create(null), counts: /* @__PURE__ */ Object.create(null), normalize: /* @__PURE__ */ Object.create(null), configs: /* @__PURE__ */ Object.create(null), nargs: /* @__PURE__ */ Object.create(null), coercions: /* @__PURE__ */ Object.create(null), keys: [] }; const negative = /^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/; const negatedBoolean = new RegExp("^--" + configuration["negation-prefix"] + "(.+)"); [].concat(opts.array || []).filter(Boolean).forEach(function(opt) { const key = typeof opt === "object" ? opt.key : opt; const assignment = Object.keys(opt).map(function(key2) { const arrayFlagKeys = { boolean: "bools", string: "strings", number: "numbers" }; return arrayFlagKeys[key2]; }).filter(Boolean).pop(); if (assignment) { flags[assignment][key] = true; } flags.arrays[key] = true; flags.keys.push(key); }); [].concat(opts.boolean || []).filter(Boolean).forEach(function(key) { flags.bools[key] = true; flags.keys.push(key); }); [].concat(opts.string || []).filter(Boolean).forEach(function(key) { flags.strings[key] = true; flags.keys.push(key); }); [].concat(opts.number || []).filter(Boolean).forEach(function(key) { flags.numbers[key] = true; flags.keys.push(key); }); [].concat(opts.count || []).filter(Boolean).forEach(function(key) { flags.counts[key] = true; flags.keys.push(key); }); [].concat(opts.normalize || []).filter(Boolean).forEach(function(key) { flags.normalize[key] = true; flags.keys.push(key); }); if (typeof opts.narg === "object") { Object.entries(opts.narg).forEach(([key, value]) => { if (typeof value === "number") { flags.nargs[key] = value; flags.keys.push(key); } }); } if (typeof opts.coerce === "object") { Object.entries(opts.coerce).forEach(([key, value]) => { if (typeof value === "function") { flags.coercions[key] = value; flags.keys.push(key); } }); } if (typeof opts.config !== "undefined") { if (Array.isArray(opts.config) || typeof opts.config === "string") { ; [].concat(opts.config).filter(Boolean).forEach(function(key) { flags.configs[key] = true; }); } else if (typeof opts.config === "object") { Object.entries(opts.config).forEach(([key, value]) => { if (typeof value === "boolean" || typeof value === "function") { flags.configs[key] = value; } }); } } extendAliases(opts.key, aliases, opts.default, flags.arrays); Object.keys(defaults2).forEach(function(key) { (flags.aliases[key] || []).forEach(function(alias) { defaults2[alias] = defaults2[key]; }); }); let error2 = null; checkConfiguration(); let notFlags = []; const argv = Object.assign(/* @__PURE__ */ Object.create(null), { _: [] }); const argvReturn = {}; for (let i = 0; i < args.length; i++) { const arg = args[i]; const truncatedArg = arg.replace(/^-{3,}/, "---"); let broken; let key; let letters; let m; let next; let value; if (arg !== "--" && /^-/.test(arg) && isUnknownOptionAsArg(arg)) { pushPositional(arg); } else if (truncatedArg.match(/^---+(=|$)/)) { pushPositional(arg); continue; } else if (arg.match(/^--.+=/) || !configuration["short-option-groups"] && arg.match(/^-.+=/)) { m = arg.match(/^--?([^=]+)=([\s\S]*)$/); if (m !== null && Array.isArray(m) && m.length >= 3) { if (checkAllAliases(m[1], flags.arrays)) { i = eatArray(i, m[1], args, m[2]); } else if (checkAllAliases(m[1], flags.nargs) !== false) { i = eatNargs(i, m[1], args, m[2]); } else { setArg(m[1], m[2], true); } } } else if (arg.match(negatedBoolean) && configuration["boolean-negation"]) { m = arg.match(negatedBoolean); if (m !== null && Array.isArray(m) && m.length >= 2) { key = m[1]; setArg(key, checkAllAliases(key, flags.arrays) ? [false] : false); } } else if (arg.match(/^--.+/) || !configuration["short-option-groups"] && arg.match(/^-[^-]+/)) { m = arg.match(/^--?(.+)/); if (m !== null && Array.isArray(m) && m.length >= 2) { key = m[1]; if (checkAllAliases(key, flags.arrays)) { i = eatArray(i, key, args); } else if (checkAllAliases(key, flags.nargs) !== false) { i = eatNargs(i, key, args); } else { next = args[i + 1]; if (next !== void 0 && (!next.match(/^-/) || next.match(negative)) && !checkAllAliases(key, flags.bools) && !checkAllAliases(key, flags.counts)) { setArg(key, next); i++; } else if (/^(true|false)$/.test(next)) { setArg(key, next); i++; } else { setArg(key, defaultValue(key)); } } } } else if (arg.match(/^-.\..+=/)) { m = arg.match(/^-([^=]+)=([\s\S]*)$/); if (m !== null && Array.isArray(m) && m.length >= 3) { setArg(m[1], m[2]); } } else if (arg.match(/^-.\..+/) && !arg.match(negative)) { next = args[i + 1]; m = arg.match(/^-(.\..+)/); if (m !== null && Array.isArray(m) && m.length >= 2) { key = m[1]; if (next !== void 0 && !next.match(/^-/) && !checkAllAliases(key, flags.bools) && !checkAllAliases(key, flags.counts)) { setArg(key, next); i++; } else { setArg(key, defaultValue(key)); } } } else if (arg.match(/^-[^-]+/) && !arg.match(negative)) { letters = arg.slice(1, -1).split(""); broken = false; for (let j = 0; j < letters.length; j++) { next = arg.slice(j + 2); if (letters[j + 1] && letters[j + 1] === "=") { value = arg.slice(j + 3); key = letters[j]; if (checkAllAliases(key, flags.arrays)) { i = eatArray(i, key, args, value); } else if (checkAllAliases(key, flags.nargs) !== false) { i = eatNargs(i, key, args, value); } else { setArg(key, value); } broken = true; break; } if (next === "-") { setArg(letters[j], next); continue; } if (/[A-Za-z]/.test(letters[j]) && /^-?\d+(\.\d*)?(e-?\d+)?$/.test(next) && checkAllAliases(next, flags.bools) === false) { setArg(letters[j], next); broken = true; break; } if (letters[j + 1] && letters[j + 1].match(/\W/)) { setArg(letters[j], next); broken = true; break; } else { setArg(letters[j], defaultValue(letters[j])); } } key = arg.slice(-1)[0]; if (!broken && key !== "-") { if (checkAllAliases(key, flags.arrays)) { i = eatArray(i, key, args); } else if (checkAllAliases(key, flags.nargs) !== false) { i = eatNargs(i, key, args); } else { next = args[i + 1]; if (next !== void 0 && (!/^(-|--)[^-]/.test(next) || next.match(negative)) && !checkAllAliases(key, flags.bools) && !checkAllAliases(key, flags.counts)) { setArg(key, next); i++; } else if (/^(true|false)$/.test(next)) { setArg(key, next); i++; } else { setArg(key, defaultValue(key)); } } } } else if (arg.match(/^-[0-9]$/) && arg.match(negative) && checkAllAliases(arg.slice(1), flags.bools)) { key = arg.slice(1); setArg(key, defaultValue(key)); } else if (arg === "--") { notFlags = args.slice(i + 1); break; } else if (configuration["halt-at-non-option"]) { notFlags = args.slice(i); break; } else { pushPositional(arg); } } applyEnvVars(argv, true); applyEnvVars(argv, false); setConfig2(argv); setConfigObjects(); applyDefaultsAndAliases(argv, flags.aliases, defaults2, true); applyCoercions(argv); if (configuration["set-placeholder-key"]) setPlaceholderKeys(argv); Object.keys(flags.counts).forEach(function(key) { if (!hasKey(argv, key.split("."))) setArg(key, 0); }); if (notFlagsOption && notFlags.length) argv[notFlagsArgv] = []; notFlags.forEach(function(key) { argv[notFlagsArgv].push(key); }); if (configuration["camel-case-expansion"] && configuration["strip-dashed"]) { Object.keys(argv).filter((key) => key !== "--" && key.includes("-")).forEach((key) => { delete argv[key]; }); } if (configuration["strip-aliased"]) { ; [].concat(...Object.keys(aliases).map((k) => aliases[k])).forEach((alias) => { if (configuration["camel-case-expansion"] && alias.includes("-")) { delete argv[alias.split(".").map((prop) => camelCase(prop)).join(".")]; } delete argv[alias]; }); } function pushPositional(arg) { const maybeCoercedNumber = maybeCoerceNumber("_", arg); if (typeof maybeCoercedNumber === "string" || typeof maybeCoercedNumber === "number") { argv._.push(maybeCoercedNumber); } } function eatNargs(i, key, args2, argAfterEqualSign) { let ii; let toEat = checkAllAliases(key, flags.nargs); toEat = typeof toEat !== "number" || isNaN(toEat) ? 1 : toEat; if (toEat === 0) { if (!isUndefined(argAfterEqualSign)) { error2 = Error(__("Argument unexpected for: %s", key)); } setArg(key, defaultValue(key)); return i; } let available = isUndefined(argAfterEqualSign) ? 0 : 1; if (configuration["nargs-eats-options"]) { if (args2.length - (i + 1) + available < toEat) { error2 = Error(__("Not enough arguments following: %s", key)); } available = toEat; } else { for (ii = i + 1; ii < args2.length; ii++) { if (!args2[ii].match(/^-[^0-9]/) || args2[ii].match(negative) || isUnknownOptionAsArg(args2[ii])) available++; else break; } if (available < toEat) error2 = Error(__("Not enough arguments following: %s", key)); } let consumed = Math.min(available, toEat); if (!isUndefined(argAfterEqualSign) && consumed > 0) { setArg(key, argAfterEqualSign); consumed--; } for (ii = i + 1; ii < consumed + i + 1; ii++) { setArg(key, args2[ii]); } return i + consumed; } function eatArray(i, key, args2, argAfterEqualSign) { let argsToSet = []; let next = argAfterEqualSign || args2[i + 1]; const nargsCount = checkAllAliases(key, flags.nargs); if (checkAllAliases(key, flags.bools) && !/^(true|false)$/.test(next)) { argsToSet.push(true); } else if (isUndefined(next) || isUndefined(argAfterEqualSign) && /^-/.test(next) && !negative.test(next) && !isUnknownOptionAsArg(next)) { if (defaults2[key] !== void 0) { const defVal = defaults2[key]; argsToSet = Array.isArray(defVal) ? defVal : [defVal]; } } else { if (!isUndefined(argAfterEqualSign)) { argsToSet.push(processValue(key, argAfterEqualSign, true)); } for (let ii = i + 1; ii < args2.length; ii++) { if (!configuration["greedy-arrays"] && argsToSet.length > 0 || nargsCount && typeof nargsCount === "number" && argsToSet.length >= nargsCount) break; next = args2[ii]; if (/^-/.test(next) && !negative.test(next) && !isUnknownOptionAsArg(next)) break; i = ii; argsToSet.push(processValue(key, next, inputIsString)); } } if (typeof nargsCount === "number" && (nargsCount && argsToSet.length < nargsCount || isNaN(nargsCount) && argsToSet.length === 0)) { error2 = Error(__("Not enough arguments following: %s", key)); } setArg(key, argsToSet); return i; } function setArg(key, val, shouldStripQuotes = inputIsString) { if (/-/.test(key) && configuration["camel-case-expansion"]) { const alias = key.split(".").map(function(prop) { return camelCase(prop); }).join("."); addNewAlias(key, alias); } const value = processValue(key, val, shouldStripQuotes); const splitKey = key.split("."); setKey(argv, splitKey, value); if (flags.aliases[key]) { flags.aliases[key].forEach(function(x) { const keyProperties = x.split("."); setKey(argv, keyProperties, value); }); } if (splitKey.length > 1 && configuration["dot-notation"]) { ; (flags.aliases[splitKey[0]] || []).forEach(function(x) { let keyProperties = x.split("."); const a = [].concat(splitKey); a.shift(); keyProperties = keyProperties.concat(a); if (!(flags.aliases[key] || []).includes(keyProperties.join("."))) { setKey(argv, keyProperties, value); } }); } if (checkAllAliases(key, flags.normalize) && !checkAllAliases(key, flags.arrays)) { const keys = [key].concat(flags.aliases[key] || []); keys.forEach(function(key2) { Object.defineProperty(argvReturn, key2, { enumerable: true, get() { return val; }, set(value2) { val = typeof value2 === "string" ? mixin2.normalize(value2) : value2; } }); }); } } function addNewAlias(key, alias) { if (!(flags.aliases[key] && flags.aliases[key].length)) { flags.aliases[key] = [alias]; newAliases[alias] = true; } if (!(flags.aliases[alias] && flags.aliases[alias].length)) { addNewAlias(alias, key); } } function processValue(key, val, shouldStripQuotes) { if (shouldStripQuotes) { val = stripQuotes(val); } if (checkAllAliases(key, flags.bools) || checkAllAliases(key, flags.counts)) { if (typeof val === "string") val = val === "true"; } let value = Array.isArray(val) ? val.map(function(v) { return maybeCoerceNumber(key, v); }) : maybeCoerceNumber(key, val); if (checkAllAliases(key, flags.counts) && (isUndefined(value) || typeof value === "boolean")) { value = increment(); } if (checkAllAliases(key, flags.normalize) && checkAllAliases(key, flags.arrays)) { if (Array.isArray(val)) value = val.map((val2) => { return mixin2.normalize(val2); }); else value = mixin2.normalize(val); } return value; } function maybeCoerceNumber(key, value) { if (!configuration["parse-positional-numbers"] && key === "_") return value; if (!checkAllAliases(key, flags.strings) && !checkAllAliases(key, flags.bools) && !Array.isArray(value)) { const shouldCoerceNumber = looksLikeNumber(value) && configuration["parse-numbers"] && Number.isSafeInteger(Math.floor(parseFloat(`${value}`))); if (shouldCoerceNumber || !isUndefined(value) && checkAllAliases(key, flags.numbers)) { value = Number(value); } } return value; } function setConfig2(argv2) { const configLookup = /* @__PURE__ */ Object.create(null); applyDefaultsAndAliases(configLookup, flags.aliases, defaults2); Object.keys(flags.configs).forEach(function(configKey) { const configPath = argv2[configKey] || configLookup[configKey]; if (configPath) { try { let config = null; const resolvedConfigPath = mixin2.resolve(mixin2.cwd(), configPath); const resolveConfig = flags.configs[configKey]; if (typeof resolveConfig === "function") { try { config = resolveConfig(resolvedConfigPath); } catch (e) { config = e; } if (config instanceof Error) { error2 = config; return; } } else { config = mixin2.require(resolvedConfigPath); } setConfigObject(config); } catch (ex) { if (ex.name === "PermissionDenied") error2 = ex; else if (argv2[configKey]) error2 = Error(__("Invalid JSON config file: %s", configPath)); } } }); } function setConfigObject(config, prev) { Object.keys(config).forEach(function(key) { const value = config[key]; const fullKey = prev ? prev + "." + key : key; if (typeof value === "object" && value !== null && !Array.isArray(value) && configuration["dot-notation"]) { setConfigObject(value, fullKey); } else { if (!hasKey(argv, fullKey.split(".")) || checkAllAliases(fullKey, flags.arrays) && configuration["combine-arrays"]) { setArg(fullKey, value); } } }); } function setConfigObjects() { if (typeof configObjects !== "undefined") { configObjects.forEach(function(configObject) { setConfigObject(configObject); }); } } function applyEnvVars(argv2, configOnly) { if (typeof envPrefix === "undefined") return; const prefix = typeof envPrefix === "string" ? envPrefix : ""; const env22 = mixin2.env(); Object.keys(env22).forEach(function(envVar) { if (prefix === "" || envVar.lastIndexOf(prefix, 0) === 0) { const keys = envVar.split("__").map(function(key, i) { if (i === 0) { key = key.substring(prefix.length); } return camelCase(key); }); if ((configOnly && flags.configs[keys.join(".")] || !configOnly) && !hasKey(argv2, keys)) { setArg(keys.join("."), env22[envVar]); } } }); } function applyCoercions(argv2) { let coerce; const applied = /* @__PURE__ */ new Set(); Object.keys(argv2).forEach(function(key) { if (!applied.has(key)) { coerce = checkAllAliases(key, flags.coercions); if (typeof coerce === "function") { try { const value = maybeCoerceNumber(key, coerce(argv2[key])); [].concat(flags.aliases[key] || [], key).forEach((ali) => { applied.add(ali); argv2[ali] = value; }); } catch (err) { error2 = err; } } } }); } function setPlaceholderKeys(argv2) { flags.keys.forEach((key) => { if (~key.indexOf(".")) return; if (typeof argv2[key] === "undefined") argv2[key] = void 0; }); return argv2; } function applyDefaultsAndAliases(obj, aliases2, defaults22, canLog = false) { Object.keys(defaults22).forEach(function(key) { if (!hasKey(obj, key.split("."))) { setKey(obj, key.split("."), defaults22[key]); if (canLog) defaulted[key] = true; (aliases2[key] || []).forEach(function(x) { if (hasKey(obj, x.split("."))) return; setKey(obj, x.split("."), defaults22[key]); }); } }); } function hasKey(obj, keys) { let o = obj; if (!configuration["dot-notation"]) keys = [keys.join(".")]; keys.slice(0, -1).forEach(function(key2) { o = o[key2] || {}; }); const key = keys[keys.length - 1]; if (typeof o !== "object") return false; else return key in o; } function setKey(obj, keys, value) { let o = obj; if (!configuration["dot-notation"]) keys = [keys.join(".")]; keys.slice(0, -1).forEach(function(key2) { key2 = sanitizeKey(key2); if (typeof o === "object" && o[key2] === void 0) { o[key2] = {}; } if (typeof o[key2] !== "object" || Array.isArray(o[key2])) { if (Array.isArray(o[key2])) { o[key2].push({}); } else { o[key2] = [o[key2], {}]; } o = o[key2][o[key2].length - 1]; } else { o = o[key2]; } }); const key = sanitizeKey(keys[keys.length - 1]); const isTypeArray = checkAllAliases(keys.join("."), flags.arrays); const isValueArray = Array.isArray(value); let duplicate = configuration["duplicate-arguments-array"]; if (!duplicate && checkAllAliases(key, flags.nargs)) { duplicate = true; if (!isUndefined(o[key]) && flags.nargs[key] === 1 || Array.isArray(o[key]) && o[key].length === flags.nargs[key]) { o[key] = void 0; } } if (value === increment()) { o[key] = increment(o[key]); } else if (Array.isArray(o[key])) { if (duplicate && isTypeArray && isValueArray) { o[key] = configuration["flatten-duplicate-arrays"] ? o[key].concat(value) : (Array.isArray(o[key][0]) ? o[key] : [o[key]]).concat([value]); } else if (!duplicate && Boolean(isTypeArray) === Boolean(isValueArray)) { o[key] = value; } else { o[key] = o[key].concat([value]); } } else if (o[key] === void 0 && isTypeArray) { o[key] = isValueArray ? value : [value]; } else if (duplicate && !(o[key] === void 0 || checkAllAliases(key, flags.counts) || checkAllAliases(key, flags.bools))) { o[key] = [o[key], value]; } else { o[key] = value; } } function extendAliases(...args2) { args2.forEach(function(obj) { Object.keys(obj || {}).forEach(function(key) { if (flags.aliases[key]) return; flags.aliases[key] = [].concat(aliases[key] || []); flags.aliases[key].concat(key).forEach(function(x) { if (/-/.test(x) && configuration["camel-case-expansion"]) { const c = camelCase(x); if (c !== key && flags.aliases[key].indexOf(c) === -1) { flags.aliases[key].push(c); newAliases[c] = true; } } }); flags.aliases[key].concat(key).forEach(function(x) { if (x.length > 1 && /[A-Z]/.test(x) && configuration["camel-case-expansion"]) { const c = decamelize(x, "-"); if (c !== key && flags.aliases[key].indexOf(c) === -1) { flags.aliases[key].push(c); newAliases[c] = true; } } }); flags.aliases[key].forEach(function(x) { flags.aliases[x] = [key].concat(flags.aliases[key].filter(function(y) { return x !== y; })); }); }); }); } function checkAllAliases(key, flag) { const toCheck = [].concat(flags.aliases[key] || [], key); const keys = Object.keys(flag); const setAlias = toCheck.find((key2) => keys.includes(key2)); return setAlias ? flag[setAlias] : false; } function hasAnyFlag(key) { const flagsKeys = Object.keys(flags); const toCheck = [].concat(flagsKeys.map((k) => flags[k])); return toCheck.some(function(flag) { return Array.isArray(flag) ? flag.includes(key) : flag[key]; }); } function hasFlagsMatching(arg, ...patterns) { const toCheck = [].concat(...patterns); return toCheck.some(function(pattern) { const match = arg.match(pattern); return match && hasAnyFlag(match[1]); }); } function hasAllShortFlags(arg) { if (arg.match(negative) || !arg.match(/^-[^-]+/)) { return false; } let hasAllFlags = true; let next; const letters = arg.slice(1).split(""); for (let j = 0; j < letters.length; j++) { next = arg.slice(j + 2); if (!hasAnyFlag(letters[j])) { hasAllFlags = false; break; } if (letters[j + 1] && letters[j + 1] === "=" || next === "-" || /[A-Za-z]/.test(letters[j]) && /^-?\d+(\.\d*)?(e-?\d+)?$/.test(next) || letters[j + 1] && letters[j + 1].match(/\W/)) { break; } } return hasAllFlags; } function isUnknownOptionAsArg(arg) { return configuration["unknown-options-as-args"] && isUnknownOption(arg); } function isUnknownOption(arg) { arg = arg.replace(/^-{3,}/, "--"); if (arg.match(negative)) { return false; } if (hasAllShortFlags(arg)) { return false; } const flagWithEquals = /^-+([^=]+?)=[\s\S]*$/; const normalFlag = /^-+([^=]+?)$/; const flagEndingInHyphen = /^-+([^=]+?)-$/; const flagEndingInDigits = /^-+([^=]+?\d+)$/; const flagEndingInNonWordCharacters = /^-+([^=]+?)\W+.*$/; return !hasFlagsMatching(arg, flagWithEquals, negatedBoolean, normalFlag, flagEndingInHyphen, flagEndingInDigits, flagEndingInNonWordCharacters); } function defaultValue(key) { if (!checkAllAliases(key, flags.bools) && !checkAllAliases(key, flags.counts) && `${key}` in defaults2) { return defaults2[key]; } else { return defaultForType(guessType2(key)); } } function defaultForType(type) { const def = { [DefaultValuesForTypeKey.BOOLEAN]: true, [DefaultValuesForTypeKey.STRING]: "", [DefaultValuesForTypeKey.NUMBER]: void 0, [DefaultValuesForTypeKey.ARRAY]: [] }; return def[type]; } function guessType2(key) { let type = DefaultValuesForTypeKey.BOOLEAN; if (checkAllAliases(key, flags.strings)) type = DefaultValuesForTypeKey.STRING; else if (checkAllAliases(key, flags.numbers)) type = DefaultValuesForTypeKey.NUMBER; else if (checkAllAliases(key, flags.bools)) type = DefaultValuesForTypeKey.BOOLEAN; else if (checkAllAliases(key, flags.arrays)) type = DefaultValuesForTypeKey.ARRAY; return type; } function isUndefined(num) { return num === void 0; } function checkConfiguration() { Object.keys(flags.counts).find((key) => { if (checkAllAliases(key, flags.arrays)) { error2 = Error(__("Invalid configuration: %s, opts.count excludes opts.array.", key)); return true; } else if (checkAllAliases(key, flags.nargs)) { error2 = Error(__("Invalid configuration: %s, opts.count excludes opts.narg.", key)); return true; } return false; }); } return { aliases: Object.assign({}, flags.aliases), argv: Object.assign(argvReturn, argv), configuration, defaulted: Object.assign({}, defaulted), error: error2, newAliases: Object.assign({}, newAliases) }; } }; function combineAliases(aliases) { const aliasArrays = []; const combined = /* @__PURE__ */ Object.create(null); let change = true; Object.keys(aliases).forEach(function(key) { aliasArrays.push([].concat(aliases[key], key)); }); while (change) { change = false; for (let i = 0; i < aliasArrays.length; i++) { for (let ii = i + 1; ii < aliasArrays.length; ii++) { const intersect = aliasArrays[i].filter(function(v) { return aliasArrays[ii].indexOf(v) !== -1; }); if (intersect.length) { aliasArrays[i] = aliasArrays[i].concat(aliasArrays[ii]); aliasArrays.splice(ii, 1); change = true; break; } } } } aliasArrays.forEach(function(aliasArray) { aliasArray = aliasArray.filter(function(v, i, self2) { return self2.indexOf(v) === i; }); const lastAlias = aliasArray.pop(); if (lastAlias !== void 0 && typeof lastAlias === "string") { combined[lastAlias] = aliasArray; } }); return combined; } function increment(orig) { return orig !== void 0 ? orig + 1 : 1; } function sanitizeKey(key) { if (key === "__proto__") return "___proto___"; return key; } function stripQuotes(val) { return typeof val === "string" && (val[0] === "'" || val[0] === '"') && val[val.length - 1] === val[0] ? val.substring(1, val.length - 1) : val; } var _a; var _b; var _c; var minNodeVersion = process && process.env && process.env.YARGS_MIN_NODE_VERSION ? Number(process.env.YARGS_MIN_NODE_VERSION) : 20; var nodeVersion = (_b = (_a = process === null || process === void 0 ? void 0 : process.versions) === null || _a === void 0 ? void 0 : _a.node) !== null && _b !== void 0 ? _b : (_c = process === null || process === void 0 ? void 0 : process.version) === null || _c === void 0 ? void 0 : _c.slice(1); if (nodeVersion) { const major = Number(nodeVersion.match(/^([^.]+)/)[1]); if (major < minNodeVersion) { throw Error(`yargs parser supports a minimum Node.js version of ${minNodeVersion}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`); } } var env2 = process ? process.env : {}; var require22 = createRequire ? createRequire(import.meta.url) : void 0; var parser = new YargsParser({ cwd: process.cwd, env: () => { return env2; }, format, normalize, resolve: resolve2, require: (path) => { if (typeof require22 !== "undefined") { return require22(path); } else if (path.match(/\.json$/)) { return JSON.parse(readFileSync2(path, "utf8")); } else { throw Error("only .json config files are supported in ESM"); } } }); var yargsParser = function Parser(args, opts) { const result = parser.parse(args.slice(), opts); return result.argv; }; yargsParser.detailed = function(args, opts) { return parser.parse(args.slice(), opts); }; yargsParser.camelCase = camelCase; yargsParser.decamelize = decamelize; yargsParser.looksLikeNumber = looksLikeNumber; var lib_default = yargsParser; function getProcessArgvBinIndex() { if (isBundledElectronApp()) return 0; return 1; } function isBundledElectronApp() { return isElectronApp() && !process.defaultApp; } function isElectronApp() { return !!process.versions.electron; } function getProcessArgvBin() { return process.argv[getProcessArgvBinIndex()]; } var node_default = { fs: { readFileSync: readFileSync22, writeFile: writeFile3 }, format: format2, resolve: resolve3, exists: (file) => { try { return statSync2(file).isFile(); } catch (err) { return false; } } }; var shim; var Y18N = class { constructor(opts) { opts = opts || {}; this.directory = opts.directory || "./locales"; this.updateFiles = typeof opts.updateFiles === "boolean" ? opts.updateFiles : true; this.locale = opts.locale || "en"; this.fallbackToLanguage = typeof opts.fallbackToLanguage === "boolean" ? opts.fallbackToLanguage : true; this.cache = /* @__PURE__ */ Object.create(null); this.writeQueue = []; } __(...args) { if (typeof arguments[0] !== "string") { return this._taggedLiteral(arguments[0], ...arguments); } const str = args.shift(); let cb = function() { }; if (typeof args[args.length - 1] === "function") cb = args.pop(); cb = cb || function() { }; if (!this.cache[this.locale]) this._readLocaleFile(); if (!this.cache[this.locale][str] && this.updateFiles) { this.cache[this.locale][str] = str; this._enqueueWrite({ directory: this.directory, locale: this.locale, cb }); } else { cb(); } return shim.format.apply(shim.format, [this.cache[this.locale][str] || str].concat(args)); } __n() { const args = Array.prototype.slice.call(arguments); const singular = args.shift(); const plural = args.shift(); const quantity = args.shift(); let cb = function() { }; if (typeof args[args.length - 1] === "function") cb = args.pop(); if (!this.cache[this.locale]) this._readLocaleFile(); let str = quantity === 1 ? singular : plural; if (this.cache[this.locale][singular]) { const entry = this.cache[this.locale][singular]; str = entry[quantity === 1 ? "one" : "other"]; } if (!this.cache[this.locale][singular] && this.updateFiles) { this.cache[this.locale][singular] = { one: singular, other: plural }; this._enqueueWrite({ directory: this.directory, locale: this.locale, cb }); } else { cb(); } const values = [str]; if (~str.indexOf("%d")) values.push(quantity); return shim.format.apply(shim.format, values.concat(args)); } setLocale(locale) { this.locale = locale; } getLocale() { return this.locale; } updateLocale(obj) { if (!this.cache[this.locale]) this._readLocaleFile(); for (const key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { this.cache[this.locale][key] = obj[key]; } } } _taggedLiteral(parts, ...args) { let str = ""; parts.forEach(function(part, i) { const arg = args[i + 1]; str += part; if (typeof arg !== "undefined") { str += "%s"; } }); return this.__.apply(this, [str].concat([].slice.call(args, 1))); } _enqueueWrite(work) { this.writeQueue.push(work); if (this.writeQueue.length === 1) this._processWriteQueue(); } _processWriteQueue() { const _this = this; const work = this.writeQueue[0]; const directory = work.directory; const locale = work.locale; const cb = work.cb; const languageFile = this._resolveLocaleFile(directory, locale); const serializedLocale = JSON.stringify(this.cache[locale], null, 2); shim.fs.writeFile(languageFile, serializedLocale, "utf-8", function(err) { _this.writeQueue.shift(); if (_this.writeQueue.length > 0) _this._processWriteQueue(); cb(err); }); } _readLocaleFile() { let localeLookup = {}; const languageFile = this._resolveLocaleFile(this.directory, this.locale); try { if (shim.fs.readFileSync) { localeLookup = JSON.parse(shim.fs.readFileSync(languageFile, "utf-8")); } } catch (err) { if (err instanceof SyntaxError) { err.message = "syntax error in " + languageFile; } if (err.code === "ENOENT") localeLookup = {}; else throw err; } this.cache[this.locale] = localeLookup; } _resolveLocaleFile(directory, locale) { let file = shim.resolve(directory, "./", locale + ".json"); if (this.fallbackToLanguage && !this._fileExistsSync(file) && ~locale.lastIndexOf("_")) { const languageFile = shim.resolve(directory, "./", locale.split("_")[0] + ".json"); if (this._fileExistsSync(languageFile)) file = languageFile; } return file; } _fileExistsSync(file) { return shim.exists(file); } }; function y18n(opts, _shim) { shim = _shim; const y18n3 = new Y18N(opts); return { __: y18n3.__.bind(y18n3), __n: y18n3.__n.bind(y18n3), setLocale: y18n3.setLocale.bind(y18n3), getLocale: y18n3.getLocale.bind(y18n3), updateLocale: y18n3.updateLocale.bind(y18n3), locale: y18n3.locale }; } var y18n2 = (opts) => { return y18n(opts, node_default); }; var y18n_default = y18n2; var import_get_caller_file = __toESM2(require_get_caller_file(), 1); var __dirname2 = fileURLToPath(import.meta.url); var mainFilename = __dirname2.substring(0, __dirname2.lastIndexOf("node_modules")); var require32 = createRequire2(import.meta.url); var esm_default = { assert: { notStrictEqual, strictEqual }, cliui: ui, findUp: sync_default, getEnv: (key) => { return process.env[key]; }, inspect, getProcessArgvBin, mainFilename: mainFilename || process.cwd(), Parser: lib_default, path: { basename, dirname: dirname2, extname, relative, resolve: resolve4, join: join2 }, process: { argv: () => process.argv, cwd: process.cwd, emitWarning: (warning, type) => process.emitWarning(warning, type), execPath: () => process.execPath, exit: (code) => { process.exit(code); }, nextTick: process.nextTick, stdColumns: typeof process.stdout.columns !== "undefined" ? process.stdout.columns : null }, readFileSync: readFileSync3, readdirSync: readdirSync2, require: require32, getCallerFile: () => { const callerFile = (0, import_get_caller_file.default)(3); return callerFile.match(/^file:\/\//) ? fileURLToPath(callerFile) : callerFile; }, stringWidth, y18n: y18n_default({ directory: resolve4(__dirname2, "../../../locales"), updateFiles: false }) }; function assertNotStrictEqual(actual, expected, shim3, message) { shim3.assert.notStrictEqual(actual, expected, message); } function assertSingleKey(actual, shim3) { shim3.assert.strictEqual(typeof actual, "string"); } function objectKeys(object) { return Object.keys(object); } function isPromise(maybePromise) { return !!maybePromise && !!maybePromise.then && typeof maybePromise.then === "function"; } var YError = class _YError extends Error { constructor(msg) { super(msg || "yargs error"); this.name = "YError"; if (Error.captureStackTrace) { Error.captureStackTrace(this, _YError); } } }; function parseCommand(cmd) { const extraSpacesStrippedCommand = cmd.replace(/\s{2,}/g, " "); const splitCommand = extraSpacesStrippedCommand.split(/\s+(?![^[]*]|[^<]*>)/); const bregex = /\.*[\][<>]/g; const firstCommand = splitCommand.shift(); if (!firstCommand) throw new Error(`No command found in: ${cmd}`); const parsedCommand = { cmd: firstCommand.replace(bregex, ""), demanded: [], optional: [] }; splitCommand.forEach((cmd2, i) => { let variadic = false; cmd2 = cmd2.replace(/\s/g, ""); if (/\.+[\]>]/.test(cmd2) && i === splitCommand.length - 1) variadic = true; if (/^\[/.test(cmd2)) { parsedCommand.optional.push({ cmd: cmd2.replace(bregex, "").split("|"), variadic }); } else { parsedCommand.demanded.push({ cmd: cmd2.replace(bregex, "").split("|"), variadic }); } }); return parsedCommand; } var positionName = ["first", "second", "third", "fourth", "fifth", "sixth"]; function argsert(arg1, arg2, arg3) { function parseArgs() { return typeof arg1 === "object" ? [{ demanded: [], optional: [] }, arg1, arg2] : [ parseCommand(`cmd ${arg1}`), arg2, arg3 ]; } try { let position = 0; const [parsed, callerArguments, _length] = parseArgs(); const args = [].slice.call(callerArguments); while (args.length && args[args.length - 1] === void 0) args.pop(); const length = _length || args.length; if (length < parsed.demanded.length) { throw new YError(`Not enough arguments provided. Expected ${parsed.demanded.length} but received ${args.length}.`); } const totalCommands = parsed.demanded.length + parsed.optional.length; if (length > totalCommands) { throw new YError(`Too many arguments provided. Expected max ${totalCommands} but received ${length}.`); } parsed.demanded.forEach((demanded) => { const arg = args.shift(); const observedType = guessType(arg); const matchingTypes = demanded.cmd.filter((type) => type === observedType || type === "*"); if (matchingTypes.length === 0) argumentTypeError(observedType, demanded.cmd, position); position += 1; }); parsed.optional.forEach((optional) => { if (args.length === 0) return; const arg = args.shift(); const observedType = guessType(arg); const matchingTypes = optional.cmd.filter((type) => type === observedType || type === "*"); if (matchingTypes.length === 0) argumentTypeError(observedType, optional.cmd, position); position += 1; }); } catch (err) { console.warn(err.stack); } } function guessType(arg) { if (Array.isArray(arg)) { return "array"; } else if (arg === null) { return "null"; } return typeof arg; } function argumentTypeError(observedType, allowedTypes, position) { throw new YError(`Invalid ${positionName[position] || "manyith"} argument. Expected ${allowedTypes.join(" or ")} but received ${observedType}.`); } var GlobalMiddleware = class { constructor(yargs) { this.globalMiddleware = []; this.frozens = []; this.yargs = yargs; } addMiddleware(callback, applyBeforeValidation, global = true, mutates = false) { argsert(" [boolean] [boolean] [boolean]", [callback, applyBeforeValidation, global], arguments.length); if (Array.isArray(callback)) { for (let i = 0; i < callback.length; i++) { if (typeof callback[i] !== "function") { throw Error("middleware must be a function"); } const m = callback[i]; m.applyBeforeValidation = applyBeforeValidation; m.global = global; } Array.prototype.push.apply(this.globalMiddleware, callback); } else if (typeof callback === "function") { const m = callback; m.applyBeforeValidation = applyBeforeValidation; m.global = global; m.mutates = mutates; this.globalMiddleware.push(callback); } return this.yargs; } addCoerceMiddleware(callback, option) { const aliases = this.yargs.getAliases(); this.globalMiddleware = this.globalMiddleware.filter((m) => { const toCheck = [...aliases[option] || [], option]; if (!m.option) return true; else return !toCheck.includes(m.option); }); callback.option = option; return this.addMiddleware(callback, true, true, true); } getMiddleware() { return this.globalMiddleware; } freeze() { this.frozens.push([...this.globalMiddleware]); } unfreeze() { const frozen = this.frozens.pop(); if (frozen !== void 0) this.globalMiddleware = frozen; } reset() { this.globalMiddleware = this.globalMiddleware.filter((m) => m.global); } }; function commandMiddlewareFactory(commandMiddleware) { if (!commandMiddleware) return []; return commandMiddleware.map((middleware) => { middleware.applyBeforeValidation = false; return middleware; }); } function applyMiddleware(argv, yargs, middlewares, beforeValidation) { return middlewares.reduce((acc, middleware) => { if (middleware.applyBeforeValidation !== beforeValidation) { return acc; } if (middleware.mutates) { if (middleware.applied) return acc; middleware.applied = true; } if (isPromise(acc)) { return acc.then((initialObj) => Promise.all([initialObj, middleware(initialObj, yargs)])).then(([initialObj, middlewareObj]) => Object.assign(initialObj, middlewareObj)); } else { const result = middleware(acc, yargs); return isPromise(result) ? result.then((middlewareObj) => Object.assign(acc, middlewareObj)) : Object.assign(acc, result); } }, argv); } function maybeAsyncResult(getResult, resultHandler, errorHandler = (err) => { throw err; }) { try { const result = isFunction(getResult) ? getResult() : getResult; return isPromise(result) ? result.then((result2) => resultHandler(result2)) : resultHandler(result); } catch (err) { return errorHandler(err); } } function isFunction(arg) { return typeof arg === "function"; } var DEFAULT_MARKER = /(^\*)|(^\$0)/; var CommandInstance = class { constructor(usage2, validation2, globalMiddleware, shim3) { this.requireCache = /* @__PURE__ */ new Set(); this.handlers = {}; this.aliasMap = {}; this.frozens = []; this.shim = shim3; this.usage = usage2; this.globalMiddleware = globalMiddleware; this.validation = validation2; } addDirectory(dir, req, callerFile, opts) { opts = opts || {}; this.requireCache.add(callerFile); const fullDirPath = this.shim.path.resolve(this.shim.path.dirname(callerFile), dir); const files = this.shim.readdirSync(fullDirPath, { recursive: opts.recurse ? true : false }); if (!Array.isArray(opts.extensions)) opts.extensions = ["js"]; const visit = typeof opts.visit === "function" ? opts.visit : (o) => o; for (const fileb of files) { const file = fileb.toString(); if (opts.exclude) { let exclude = false; if (typeof opts.exclude === "function") { exclude = opts.exclude(file); } else { exclude = opts.exclude.test(file); } if (exclude) continue; } if (opts.include) { let include = false; if (typeof opts.include === "function") { include = opts.include(file); } else { include = opts.include.test(file); } if (!include) continue; } let supportedExtension = false; for (const ext of opts.extensions) { if (file.endsWith(ext)) supportedExtension = true; } if (supportedExtension) { const joined = this.shim.path.join(fullDirPath, file); const module = req(joined); const extendableModule = Object.create(null, Object.getOwnPropertyDescriptors({ ...module })); const visited = visit(extendableModule, joined, file); if (visited) { if (this.requireCache.has(joined)) continue; else this.requireCache.add(joined); if (!extendableModule.command) { extendableModule.command = this.shim.path.basename(joined, this.shim.path.extname(joined)); } this.addHandler(extendableModule); } } } } addHandler(cmd, description, builder, handler3, commandMiddleware, deprecated) { let aliases = []; const middlewares = commandMiddlewareFactory(commandMiddleware); handler3 = handler3 || (() => { }); if (Array.isArray(cmd)) { if (isCommandAndAliases(cmd)) { [cmd, ...aliases] = cmd; } else { for (const command2 of cmd) { this.addHandler(command2); } } } else if (isCommandHandlerDefinition(cmd)) { let command2 = Array.isArray(cmd.command) || typeof cmd.command === "string" ? cmd.command : null; if (command2 === null) { throw new Error(`No command name given for module: ${this.shim.inspect(cmd)}`); } if (cmd.aliases) command2 = [].concat(command2).concat(cmd.aliases); this.addHandler(command2, this.extractDesc(cmd), cmd.builder, cmd.handler, cmd.middlewares, cmd.deprecated); return; } else if (isCommandBuilderDefinition(builder)) { this.addHandler([cmd].concat(aliases), description, builder.builder, builder.handler, builder.middlewares, builder.deprecated); return; } if (typeof cmd === "string") { const parsedCommand = parseCommand(cmd); aliases = aliases.map((alias) => parseCommand(alias).cmd); let isDefault = false; const parsedAliases = [parsedCommand.cmd].concat(aliases).filter((c) => { if (DEFAULT_MARKER.test(c)) { isDefault = true; return false; } return true; }); if (parsedAliases.length === 0 && isDefault) parsedAliases.push("$0"); if (isDefault) { parsedCommand.cmd = parsedAliases[0]; aliases = parsedAliases.slice(1); cmd = cmd.replace(DEFAULT_MARKER, parsedCommand.cmd); } aliases.forEach((alias) => { this.aliasMap[alias] = parsedCommand.cmd; }); if (description !== false) { this.usage.command(cmd, description, isDefault, aliases, deprecated); } this.handlers[parsedCommand.cmd] = { original: cmd, description, handler: handler3, builder: builder || {}, middlewares, deprecated, demanded: parsedCommand.demanded, optional: parsedCommand.optional }; if (isDefault) this.defaultCommand = this.handlers[parsedCommand.cmd]; } } getCommandHandlers() { return this.handlers; } getCommands() { return Object.keys(this.handlers).concat(Object.keys(this.aliasMap)); } hasDefaultCommand() { return !!this.defaultCommand; } runCommand(command2, yargs, parsed, commandIndex, helpOnly, helpOrVersionSet) { const commandHandler = this.handlers[command2] || this.handlers[this.aliasMap[command2]] || this.defaultCommand; const currentContext = yargs.getInternalMethods().getContext(); const parentCommands = currentContext.commands.slice(); const isDefaultCommand = !command2; if (command2) { currentContext.commands.push(command2); currentContext.fullCommands.push(commandHandler.original); } const builderResult = this.applyBuilderUpdateUsageAndParse(isDefaultCommand, commandHandler, yargs, parsed.aliases, parentCommands, commandIndex, helpOnly, helpOrVersionSet); return isPromise(builderResult) ? builderResult.then((result) => this.applyMiddlewareAndGetResult(isDefaultCommand, commandHandler, result.innerArgv, currentContext, helpOnly, result.aliases, yargs)) : this.applyMiddlewareAndGetResult(isDefaultCommand, commandHandler, builderResult.innerArgv, currentContext, helpOnly, builderResult.aliases, yargs); } applyBuilderUpdateUsageAndParse(isDefaultCommand, commandHandler, yargs, aliases, parentCommands, commandIndex, helpOnly, helpOrVersionSet) { const builder = commandHandler.builder; let innerYargs = yargs; if (isCommandBuilderCallback(builder)) { yargs.getInternalMethods().getUsageInstance().freeze(); const builderOutput = builder(yargs.getInternalMethods().reset(aliases), helpOrVersionSet); if (isPromise(builderOutput)) { return builderOutput.then((output) => { innerYargs = isYargsInstance(output) ? output : yargs; return this.parseAndUpdateUsage(isDefaultCommand, commandHandler, innerYargs, parentCommands, commandIndex, helpOnly); }); } } else if (isCommandBuilderOptionDefinitions(builder)) { yargs.getInternalMethods().getUsageInstance().freeze(); innerYargs = yargs.getInternalMethods().reset(aliases); Object.keys(commandHandler.builder).forEach((key) => { innerYargs.option(key, builder[key]); }); } return this.parseAndUpdateUsage(isDefaultCommand, commandHandler, innerYargs, parentCommands, commandIndex, helpOnly); } parseAndUpdateUsage(isDefaultCommand, commandHandler, innerYargs, parentCommands, commandIndex, helpOnly) { if (isDefaultCommand) innerYargs.getInternalMethods().getUsageInstance().unfreeze(true); if (this.shouldUpdateUsage(innerYargs)) { innerYargs.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(parentCommands, commandHandler), commandHandler.description); } const innerArgv = innerYargs.getInternalMethods().runYargsParserAndExecuteCommands(null, void 0, true, commandIndex, helpOnly); return isPromise(innerArgv) ? innerArgv.then((argv) => ({ aliases: innerYargs.parsed.aliases, innerArgv: argv })) : { aliases: innerYargs.parsed.aliases, innerArgv }; } shouldUpdateUsage(yargs) { return !yargs.getInternalMethods().getUsageInstance().getUsageDisabled() && yargs.getInternalMethods().getUsageInstance().getUsage().length === 0; } usageFromParentCommandsCommandHandler(parentCommands, commandHandler) { const c = DEFAULT_MARKER.test(commandHandler.original) ? commandHandler.original.replace(DEFAULT_MARKER, "").trim() : commandHandler.original; const pc = parentCommands.filter((c2) => { return !DEFAULT_MARKER.test(c2); }); pc.push(c); return `$0 ${pc.join(" ")}`; } handleValidationAndGetResult(isDefaultCommand, commandHandler, innerArgv, currentContext, aliases, yargs, middlewares, positionalMap) { if (!yargs.getInternalMethods().getHasOutput()) { const validation2 = yargs.getInternalMethods().runValidation(aliases, positionalMap, yargs.parsed.error, isDefaultCommand); innerArgv = maybeAsyncResult(innerArgv, (result) => { validation2(result); return result; }); } if (commandHandler.handler && !yargs.getInternalMethods().getHasOutput()) { yargs.getInternalMethods().setHasOutput(); const populateDoubleDash = !!yargs.getOptions().configuration["populate--"]; yargs.getInternalMethods().postProcess(innerArgv, populateDoubleDash, false, false); innerArgv = applyMiddleware(innerArgv, yargs, middlewares, false); innerArgv = maybeAsyncResult(innerArgv, (result) => { const handlerResult = commandHandler.handler(result); return isPromise(handlerResult) ? handlerResult.then(() => result) : result; }); if (!isDefaultCommand) { yargs.getInternalMethods().getUsageInstance().cacheHelpMessage(); } if (isPromise(innerArgv) && !yargs.getInternalMethods().hasParseCallback()) { innerArgv.catch((error2) => { try { yargs.getInternalMethods().getUsageInstance().fail(null, error2); } catch (_err) { } }); } } if (!isDefaultCommand) { currentContext.commands.pop(); currentContext.fullCommands.pop(); } return innerArgv; } applyMiddlewareAndGetResult(isDefaultCommand, commandHandler, innerArgv, currentContext, helpOnly, aliases, yargs) { let positionalMap = {}; if (helpOnly) return innerArgv; if (!yargs.getInternalMethods().getHasOutput()) { positionalMap = this.populatePositionals(commandHandler, innerArgv, currentContext, yargs); } const middlewares = this.globalMiddleware.getMiddleware().slice(0).concat(commandHandler.middlewares); const maybePromiseArgv = applyMiddleware(innerArgv, yargs, middlewares, true); return isPromise(maybePromiseArgv) ? maybePromiseArgv.then((resolvedInnerArgv) => this.handleValidationAndGetResult(isDefaultCommand, commandHandler, resolvedInnerArgv, currentContext, aliases, yargs, middlewares, positionalMap)) : this.handleValidationAndGetResult(isDefaultCommand, commandHandler, maybePromiseArgv, currentContext, aliases, yargs, middlewares, positionalMap); } populatePositionals(commandHandler, argv, context3, yargs) { argv._ = argv._.slice(context3.commands.length); const demanded = commandHandler.demanded.slice(0); const optional = commandHandler.optional.slice(0); const positionalMap = {}; this.validation.positionalCount(demanded.length, argv._.length); while (demanded.length) { const demand = demanded.shift(); this.populatePositional(demand, argv, positionalMap); } while (optional.length) { const maybe = optional.shift(); this.populatePositional(maybe, argv, positionalMap); } argv._ = context3.commands.concat(argv._.map((a) => "" + a)); this.postProcessPositionals(argv, positionalMap, this.cmdToParseOptions(commandHandler.original), yargs); return positionalMap; } populatePositional(positional, argv, positionalMap) { const cmd = positional.cmd[0]; if (positional.variadic) { positionalMap[cmd] = argv._.splice(0).map(String); } else { if (argv._.length) positionalMap[cmd] = [String(argv._.shift())]; } } cmdToParseOptions(cmdString) { const parseOptions = { array: [], default: {}, alias: {}, demand: {} }; const parsed = parseCommand(cmdString); parsed.demanded.forEach((d) => { const [cmd, ...aliases] = d.cmd; if (d.variadic) { parseOptions.array.push(cmd); parseOptions.default[cmd] = []; } parseOptions.alias[cmd] = aliases; parseOptions.demand[cmd] = true; }); parsed.optional.forEach((o) => { const [cmd, ...aliases] = o.cmd; if (o.variadic) { parseOptions.array.push(cmd); parseOptions.default[cmd] = []; } parseOptions.alias[cmd] = aliases; }); return parseOptions; } postProcessPositionals(argv, positionalMap, parseOptions, yargs) { const options = Object.assign({}, yargs.getOptions()); options.default = Object.assign(parseOptions.default, options.default); for (const key of Object.keys(parseOptions.alias)) { options.alias[key] = (options.alias[key] || []).concat(parseOptions.alias[key]); } options.array = options.array.concat(parseOptions.array); options.config = {}; const unparsed = []; Object.keys(positionalMap).forEach((key) => { positionalMap[key].map((value) => { if (options.configuration["unknown-options-as-args"]) options.key[key] = true; unparsed.push(`--${key}`); unparsed.push(value); }); }); if (!unparsed.length) return; const config = Object.assign({}, options.configuration, { "populate--": false }); const parsed = this.shim.Parser.detailed(unparsed, Object.assign({}, options, { configuration: config })); if (parsed.error) { yargs.getInternalMethods().getUsageInstance().fail(parsed.error.message, parsed.error); } else { const positionalKeys = Object.keys(positionalMap); Object.keys(positionalMap).forEach((key) => { positionalKeys.push(...parsed.aliases[key]); }); Object.keys(parsed.argv).forEach((key) => { if (positionalKeys.includes(key)) { if (!positionalMap[key]) positionalMap[key] = parsed.argv[key]; if (!this.isInConfigs(yargs, key) && !this.isDefaulted(yargs, key) && Object.prototype.hasOwnProperty.call(argv, key) && Object.prototype.hasOwnProperty.call(parsed.argv, key) && (Array.isArray(argv[key]) || Array.isArray(parsed.argv[key]))) { argv[key] = [].concat(argv[key], parsed.argv[key]); } else { argv[key] = parsed.argv[key]; } } }); } } isDefaulted(yargs, key) { const { default: defaults2 } = yargs.getOptions(); return Object.prototype.hasOwnProperty.call(defaults2, key) || Object.prototype.hasOwnProperty.call(defaults2, this.shim.Parser.camelCase(key)); } isInConfigs(yargs, key) { const { configObjects } = yargs.getOptions(); return configObjects.some((c) => Object.prototype.hasOwnProperty.call(c, key)) || configObjects.some((c) => Object.prototype.hasOwnProperty.call(c, this.shim.Parser.camelCase(key))); } runDefaultBuilderOn(yargs) { if (!this.defaultCommand) return; if (this.shouldUpdateUsage(yargs)) { const commandString = DEFAULT_MARKER.test(this.defaultCommand.original) ? this.defaultCommand.original : this.defaultCommand.original.replace(/^[^[\]<>]*/, "$0 "); yargs.getInternalMethods().getUsageInstance().usage(commandString, this.defaultCommand.description); } const builder = this.defaultCommand.builder; if (isCommandBuilderCallback(builder)) { return builder(yargs, true); } else if (!isCommandBuilderDefinition(builder)) { Object.keys(builder).forEach((key) => { yargs.option(key, builder[key]); }); } return void 0; } extractDesc({ describe, description, desc }) { for (const test of [describe, description, desc]) { if (typeof test === "string" || test === false) return test; assertNotStrictEqual(test, true, this.shim); } return false; } freeze() { this.frozens.push({ handlers: this.handlers, aliasMap: this.aliasMap, defaultCommand: this.defaultCommand }); } unfreeze() { const frozen = this.frozens.pop(); assertNotStrictEqual(frozen, void 0, this.shim); ({ handlers: this.handlers, aliasMap: this.aliasMap, defaultCommand: this.defaultCommand } = frozen); } reset() { this.handlers = {}; this.aliasMap = {}; this.defaultCommand = void 0; this.requireCache = /* @__PURE__ */ new Set(); return this; } }; function command(usage2, validation2, globalMiddleware, shim3) { return new CommandInstance(usage2, validation2, globalMiddleware, shim3); } function isCommandBuilderDefinition(builder) { return typeof builder === "object" && !!builder.builder && typeof builder.handler === "function"; } function isCommandAndAliases(cmd) { return cmd.every((c) => typeof c === "string"); } function isCommandBuilderCallback(builder) { return typeof builder === "function"; } function isCommandBuilderOptionDefinitions(builder) { return typeof builder === "object"; } function isCommandHandlerDefinition(cmd) { return typeof cmd === "object" && !Array.isArray(cmd); } function objFilter(original = {}, filter = () => true) { const obj = {}; objectKeys(original).forEach((key) => { if (filter(key, original[key])) { obj[key] = original[key]; } }); return obj; } function setBlocking(blocking) { if (typeof process === "undefined") return; [process.stdout, process.stderr].forEach((_stream) => { const stream = _stream; if (stream._handle && stream.isTTY && typeof stream._handle.setBlocking === "function") { stream._handle.setBlocking(blocking); } }); } function isBoolean(fail) { return typeof fail === "boolean"; } function usage(yargs, shim3) { const __ = shim3.y18n.__; const self2 = {}; const fails = []; self2.failFn = function failFn(f) { fails.push(f); }; let failMessage = null; let globalFailMessage = null; let showHelpOnFail = true; self2.showHelpOnFail = function showHelpOnFailFn(arg1 = true, arg2) { const [enabled, message] = typeof arg1 === "string" ? [true, arg1] : [arg1, arg2]; if (yargs.getInternalMethods().isGlobalContext()) { globalFailMessage = message; } failMessage = message; showHelpOnFail = enabled; return self2; }; let failureOutput = false; self2.fail = function fail(msg, err) { const logger = yargs.getInternalMethods().getLoggerInstance(); if (fails.length) { for (let i = fails.length - 1; i >= 0; --i) { const fail2 = fails[i]; if (isBoolean(fail2)) { if (err) throw err; else if (msg) throw Error(msg); } else { fail2(msg, err, self2); } } } else { if (yargs.getExitProcess()) setBlocking(true); if (!failureOutput) { failureOutput = true; if (showHelpOnFail) { yargs.showHelp("error"); logger.error(); } if (msg || err) logger.error(msg || err); const globalOrCommandFailMessage = failMessage || globalFailMessage; if (globalOrCommandFailMessage) { if (msg || err) logger.error(""); logger.error(globalOrCommandFailMessage); } } err = err || new YError(msg); if (yargs.getExitProcess()) { return yargs.exit(1); } else if (yargs.getInternalMethods().hasParseCallback()) { return yargs.exit(1, err); } else { throw err; } } }; let usages = []; let usageDisabled = false; self2.usage = (msg, description) => { if (msg === null) { usageDisabled = true; usages = []; return self2; } usageDisabled = false; usages.push([msg, description || ""]); return self2; }; self2.getUsage = () => { return usages; }; self2.getUsageDisabled = () => { return usageDisabled; }; self2.getPositionalGroupName = () => { return __("Positionals:"); }; let examples = []; self2.example = (cmd, description) => { examples.push([cmd, description || ""]); }; let commands = []; self2.command = function command2(cmd, description, isDefault, aliases, deprecated = false) { if (isDefault) { commands = commands.map((cmdArray) => { cmdArray[2] = false; return cmdArray; }); } commands.push([cmd, description || "", isDefault, aliases, deprecated]); }; self2.getCommands = () => commands; let descriptions = {}; self2.describe = function describe(keyOrKeys, desc) { if (Array.isArray(keyOrKeys)) { keyOrKeys.forEach((k) => { self2.describe(k, desc); }); } else if (typeof keyOrKeys === "object") { Object.keys(keyOrKeys).forEach((k) => { self2.describe(k, keyOrKeys[k]); }); } else { descriptions[keyOrKeys] = desc; } }; self2.getDescriptions = () => descriptions; let epilogs = []; self2.epilog = (msg) => { epilogs.push(msg); }; let wrapSet = false; let wrap; self2.wrap = (cols) => { wrapSet = true; wrap = cols; }; self2.getWrap = () => { if (shim3.getEnv("YARGS_DISABLE_WRAP")) { return null; } if (!wrapSet) { wrap = windowWidth(); wrapSet = true; } return wrap; }; const deferY18nLookupPrefix = "__yargsString__:"; self2.deferY18nLookup = (str) => deferY18nLookupPrefix + str; self2.help = function help() { if (cachedHelpMessage) return cachedHelpMessage; normalizeAliases(); const base$0 = yargs.customScriptName ? yargs.$0 : shim3.path.basename(yargs.$0); const demandedOptions = yargs.getDemandedOptions(); const demandedCommands = yargs.getDemandedCommands(); const deprecatedOptions = yargs.getDeprecatedOptions(); const groups = yargs.getGroups(); const options = yargs.getOptions(); let keys = []; keys = keys.concat(Object.keys(descriptions)); keys = keys.concat(Object.keys(demandedOptions)); keys = keys.concat(Object.keys(demandedCommands)); keys = keys.concat(Object.keys(options.default)); keys = keys.filter(filterHiddenOptions); keys = Object.keys(keys.reduce((acc, key) => { if (key !== "_") acc[key] = true; return acc; }, {})); const theWrap = self2.getWrap(); const ui2 = shim3.cliui({ width: theWrap, wrap: !!theWrap }); if (!usageDisabled) { if (usages.length) { usages.forEach((usage2) => { ui2.div({ text: `${usage2[0].replace(/\$0/g, base$0)}` }); if (usage2[1]) { ui2.div({ text: `${usage2[1]}`, padding: [1, 0, 0, 0] }); } }); ui2.div(); } else if (commands.length) { let u = null; if (demandedCommands._) { u = `${base$0} <${__("command")}> `; } else { u = `${base$0} [${__("command")}] `; } ui2.div(`${u}`); } } if (commands.length > 1 || commands.length === 1 && !commands[0][2]) { ui2.div(__("Commands:")); const context3 = yargs.getInternalMethods().getContext(); const parentCommands = context3.commands.length ? `${context3.commands.join(" ")} ` : ""; if (yargs.getInternalMethods().getParserConfiguration()["sort-commands"] === true) { commands = commands.sort((a, b) => a[0].localeCompare(b[0])); } const prefix = base$0 ? `${base$0} ` : ""; commands.forEach((command2) => { const commandString = `${prefix}${parentCommands}${command2[0].replace(/^\$0 ?/, "")}`; ui2.span({ text: commandString, padding: [0, 2, 0, 2], width: maxWidth(commands, theWrap, `${base$0}${parentCommands}`) + 4 }, { text: command2[1] }); const hints = []; if (command2[2]) hints.push(`[${__("default")}]`); if (command2[3] && command2[3].length) { hints.push(`[${__("aliases:")} ${command2[3].join(", ")}]`); } if (command2[4]) { if (typeof command2[4] === "string") { hints.push(`[${__("deprecated: %s", command2[4])}]`); } else { hints.push(`[${__("deprecated")}]`); } } if (hints.length) { ui2.div({ text: hints.join(" "), padding: [0, 0, 0, 2], align: "right" }); } else { ui2.div(); } }); ui2.div(); } const aliasKeys = (Object.keys(options.alias) || []).concat(Object.keys(yargs.parsed.newAliases) || []); keys = keys.filter((key) => !yargs.parsed.newAliases[key] && aliasKeys.every((alias) => (options.alias[alias] || []).indexOf(key) === -1)); const defaultGroup = __("Options:"); if (!groups[defaultGroup]) groups[defaultGroup] = []; addUngroupedKeys(keys, options.alias, groups, defaultGroup); const isLongSwitch = (sw) => /^--/.test(getText(sw)); const displayedGroups = Object.keys(groups).filter((groupName) => groups[groupName].length > 0).map((groupName) => { const normalizedKeys = groups[groupName].filter(filterHiddenOptions).map((key) => { if (aliasKeys.includes(key)) return key; for (let i = 0, aliasKey; (aliasKey = aliasKeys[i]) !== void 0; i++) { if ((options.alias[aliasKey] || []).includes(key)) return aliasKey; } return key; }); return { groupName, normalizedKeys }; }).filter(({ normalizedKeys }) => normalizedKeys.length > 0).map(({ groupName, normalizedKeys }) => { const switches = normalizedKeys.reduce((acc, key) => { acc[key] = [key].concat(options.alias[key] || []).map((sw) => { if (groupName === self2.getPositionalGroupName()) return sw; else { return (/^[0-9]$/.test(sw) ? options.boolean.includes(key) ? "-" : "--" : sw.length > 1 ? "--" : "-") + sw; } }).sort((sw1, sw2) => isLongSwitch(sw1) === isLongSwitch(sw2) ? 0 : isLongSwitch(sw1) ? 1 : -1).join(", "); return acc; }, {}); return { groupName, normalizedKeys, switches }; }); const shortSwitchesUsed = displayedGroups.filter(({ groupName }) => groupName !== self2.getPositionalGroupName()).some(({ normalizedKeys, switches }) => !normalizedKeys.every((key) => isLongSwitch(switches[key]))); if (shortSwitchesUsed) { displayedGroups.filter(({ groupName }) => groupName !== self2.getPositionalGroupName()).forEach(({ normalizedKeys, switches }) => { normalizedKeys.forEach((key) => { if (isLongSwitch(switches[key])) { switches[key] = addIndentation(switches[key], "-x, ".length); } }); }); } displayedGroups.forEach(({ groupName, normalizedKeys, switches }) => { ui2.div(groupName); normalizedKeys.forEach((key) => { const kswitch = switches[key]; let desc = descriptions[key] || ""; let type = null; if (desc.includes(deferY18nLookupPrefix)) desc = __(desc.substring(deferY18nLookupPrefix.length)); if (options.boolean.includes(key)) type = `[${__("boolean")}]`; if (options.count.includes(key)) type = `[${__("count")}]`; if (options.string.includes(key)) type = `[${__("string")}]`; if (options.normalize.includes(key)) type = `[${__("string")}]`; if (options.array.includes(key)) type = `[${__("array")}]`; if (options.number.includes(key)) type = `[${__("number")}]`; const deprecatedExtra = (deprecated) => typeof deprecated === "string" ? `[${__("deprecated: %s", deprecated)}]` : `[${__("deprecated")}]`; const extra = [ key in deprecatedOptions ? deprecatedExtra(deprecatedOptions[key]) : null, type, key in demandedOptions ? `[${__("required")}]` : null, options.choices && options.choices[key] ? `[${__("choices:")} ${self2.stringifiedValues(options.choices[key])}]` : null, defaultString(options.default[key], options.defaultDescription[key]) ].filter(Boolean).join(" "); ui2.span({ text: getText(kswitch), padding: [0, 2, 0, 2 + getIndentation(kswitch)], width: maxWidth(switches, theWrap) + 4 }, desc); const shouldHideOptionExtras = yargs.getInternalMethods().getUsageConfiguration()["hide-types"] === true; if (extra && !shouldHideOptionExtras) ui2.div({ text: extra, padding: [0, 0, 0, 2], align: "right" }); else ui2.div(); }); ui2.div(); }); if (examples.length) { ui2.div(__("Examples:")); examples.forEach((example) => { example[0] = example[0].replace(/\$0/g, base$0); }); examples.forEach((example) => { if (example[1] === "") { ui2.div({ text: example[0], padding: [0, 2, 0, 2] }); } else { ui2.div({ text: example[0], padding: [0, 2, 0, 2], width: maxWidth(examples, theWrap) + 4 }, { text: example[1] }); } }); ui2.div(); } if (epilogs.length > 0) { const e = epilogs.map((epilog) => epilog.replace(/\$0/g, base$0)).join("\n"); ui2.div(`${e} `); } return ui2.toString().replace(/\s*$/, ""); }; function maxWidth(table, theWrap, modifier) { let width = 0; if (!Array.isArray(table)) { table = Object.values(table).map((v) => [v]); } table.forEach((v) => { width = Math.max(shim3.stringWidth(modifier ? `${modifier} ${getText(v[0])}` : getText(v[0])) + getIndentation(v[0]), width); }); if (theWrap) width = Math.min(width, parseInt((theWrap * 0.5).toString(), 10)); return width; } function normalizeAliases() { const demandedOptions = yargs.getDemandedOptions(); const options = yargs.getOptions(); (Object.keys(options.alias) || []).forEach((key) => { options.alias[key].forEach((alias) => { if (descriptions[alias]) self2.describe(key, descriptions[alias]); if (alias in demandedOptions) yargs.demandOption(key, demandedOptions[alias]); if (options.boolean.includes(alias)) yargs.boolean(key); if (options.count.includes(alias)) yargs.count(key); if (options.string.includes(alias)) yargs.string(key); if (options.normalize.includes(alias)) yargs.normalize(key); if (options.array.includes(alias)) yargs.array(key); if (options.number.includes(alias)) yargs.number(key); }); }); } let cachedHelpMessage; self2.cacheHelpMessage = function() { cachedHelpMessage = this.help(); }; self2.clearCachedHelpMessage = function() { cachedHelpMessage = void 0; }; self2.hasCachedHelpMessage = function() { return !!cachedHelpMessage; }; function addUngroupedKeys(keys, aliases, groups, defaultGroup) { let groupedKeys = []; let toCheck = null; Object.keys(groups).forEach((group) => { groupedKeys = groupedKeys.concat(groups[group]); }); keys.forEach((key) => { toCheck = [key].concat(aliases[key]); if (!toCheck.some((k) => groupedKeys.indexOf(k) !== -1)) { groups[defaultGroup].push(key); } }); return groupedKeys; } function filterHiddenOptions(key) { return yargs.getOptions().hiddenOptions.indexOf(key) < 0 || yargs.parsed.argv[yargs.getOptions().showHiddenOpt]; } self2.showHelp = (level) => { const logger = yargs.getInternalMethods().getLoggerInstance(); if (!level) level = "error"; const emit = typeof level === "function" ? level : logger[level]; emit(self2.help()); }; self2.functionDescription = (fn) => { const description = fn.name ? shim3.Parser.decamelize(fn.name, "-") : __("generated-value"); return ["(", description, ")"].join(""); }; self2.stringifiedValues = function stringifiedValues(values, separator) { let string = ""; const sep3 = separator || ", "; const array = [].concat(values); if (!values || !array.length) return string; array.forEach((value) => { if (string.length) string += sep3; string += JSON.stringify(value); }); return string; }; function defaultString(value, defaultDescription) { let string = `[${__("default:")} `; if (value === void 0 && !defaultDescription) return null; if (defaultDescription) { string += defaultDescription; } else { switch (typeof value) { case "string": string += `"${value}"`; break; case "object": string += JSON.stringify(value); break; default: string += value; } } return `${string}]`; } function windowWidth() { const maxWidth2 = 80; if (shim3.process.stdColumns) { return Math.min(maxWidth2, shim3.process.stdColumns); } else { return maxWidth2; } } let version = null; self2.version = (ver) => { version = ver; }; self2.showVersion = (level) => { const logger = yargs.getInternalMethods().getLoggerInstance(); if (!level) level = "error"; const emit = typeof level === "function" ? level : logger[level]; emit(version); }; self2.reset = function reset(localLookup) { failMessage = null; failureOutput = false; usages = []; usageDisabled = false; epilogs = []; examples = []; commands = []; descriptions = objFilter(descriptions, (k) => !localLookup[k]); return self2; }; const frozens = []; self2.freeze = function freeze() { frozens.push({ failMessage, failureOutput, usages, usageDisabled, epilogs, examples, commands, descriptions }); }; self2.unfreeze = function unfreeze(defaultCommand = false) { const frozen = frozens.pop(); if (!frozen) return; if (defaultCommand) { descriptions = { ...frozen.descriptions, ...descriptions }; commands = [...frozen.commands, ...commands]; usages = [...frozen.usages, ...usages]; examples = [...frozen.examples, ...examples]; epilogs = [...frozen.epilogs, ...epilogs]; } else { ({ failMessage, failureOutput, usages, usageDisabled, epilogs, examples, commands, descriptions } = frozen); } }; return self2; } function isIndentedText(text) { return typeof text === "object"; } function addIndentation(text, indent) { return isIndentedText(text) ? { text: text.text, indentation: text.indentation + indent } : { text, indentation: indent }; } function getIndentation(text) { return isIndentedText(text) ? text.indentation : 0; } function getText(text) { return isIndentedText(text) ? text.text : text; } var completionShTemplate = `###-begin-{{app_name}}-completions-### # # yargs command completion script # # Installation: {{app_path}} {{completion_command}} >> ~/.bashrc # or {{app_path}} {{completion_command}} >> ~/.bash_profile on OSX. # _{{app_name}}_yargs_completions() { local cur_word args type_list cur_word="\${COMP_WORDS[COMP_CWORD]}" args=("\${COMP_WORDS[@]}") # ask yargs to generate completions. # see https://stackoverflow.com/a/40944195/7080036 for the spaces-handling awk mapfile -t type_list < <({{app_path}} --get-yargs-completions "\${args[@]}") mapfile -t COMPREPLY < <(compgen -W "$( printf '%q ' "\${type_list[@]}" )" -- "\${cur_word}" | awk '/ / { print "\\""$0"\\"" } /^[^ ]+$/ { print $0 }') # if no match was found, fall back to filename completion if [ \${#COMPREPLY[@]} -eq 0 ]; then COMPREPLY=() fi return 0 } complete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}} ###-end-{{app_name}}-completions-### `; var completionZshTemplate = `#compdef {{app_name}} ###-begin-{{app_name}}-completions-### # # yargs command completion script # # Installation: {{app_path}} {{completion_command}} >> ~/.zshrc # or {{app_path}} {{completion_command}} >> ~/.zprofile on OSX. # _{{app_name}}_yargs_completions() { local reply local si=$IFS IFS=$' ' reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" {{app_path}} --get-yargs-completions "\${words[@]}")) IFS=$si if [[ \${#reply} -gt 0 ]]; then _describe 'values' reply else _default fi } if [[ "'\${zsh_eval_context[-1]}" == "loadautofunc" ]]; then _{{app_name}}_yargs_completions "$@" else compdef _{{app_name}}_yargs_completions {{app_name}} fi ###-end-{{app_name}}-completions-### `; var Completion = class { constructor(yargs, usage2, command2, shim3) { var _a2, _b2, _c2; this.yargs = yargs; this.usage = usage2; this.command = command2; this.shim = shim3; this.completionKey = "get-yargs-completions"; this.aliases = null; this.customCompletionFunction = null; this.indexAfterLastReset = 0; this.zshShell = (_c2 = ((_a2 = this.shim.getEnv("SHELL")) === null || _a2 === void 0 ? void 0 : _a2.includes("zsh")) || ((_b2 = this.shim.getEnv("ZSH_NAME")) === null || _b2 === void 0 ? void 0 : _b2.includes("zsh"))) !== null && _c2 !== void 0 ? _c2 : false; } defaultCompletion(args, argv, current, done) { const handlers = this.command.getCommandHandlers(); for (let i = 0, ii = args.length; i < ii; ++i) { if (handlers[args[i]] && handlers[args[i]].builder) { const builder = handlers[args[i]].builder; if (isCommandBuilderCallback(builder)) { this.indexAfterLastReset = i + 1; const y = this.yargs.getInternalMethods().reset(); builder(y, true); return y.argv; } } } const completions = []; this.commandCompletions(completions, args, current); this.optionCompletions(completions, args, argv, current); this.choicesFromOptionsCompletions(completions, args, argv, current); this.choicesFromPositionalsCompletions(completions, args, argv, current); done(null, completions); } commandCompletions(completions, args, current) { const parentCommands = this.yargs.getInternalMethods().getContext().commands; if (!current.match(/^-/) && parentCommands[parentCommands.length - 1] !== current && !this.previousArgHasChoices(args)) { this.usage.getCommands().forEach((usageCommand) => { const commandName = parseCommand(usageCommand[0]).cmd; if (args.indexOf(commandName) === -1) { if (!this.zshShell) { completions.push(commandName); } else { const desc = usageCommand[1] || ""; completions.push(commandName.replace(/:/g, "\\:") + ":" + desc); } } }); } } optionCompletions(completions, args, argv, current) { if ((current.match(/^-/) || current === "" && completions.length === 0) && !this.previousArgHasChoices(args)) { const options = this.yargs.getOptions(); const positionalKeys = this.yargs.getGroups()[this.usage.getPositionalGroupName()] || []; Object.keys(options.key).forEach((key) => { const negable = !!options.configuration["boolean-negation"] && options.boolean.includes(key); const isPositionalKey = positionalKeys.includes(key); if (!isPositionalKey && !options.hiddenOptions.includes(key) && !this.argsContainKey(args, key, negable)) { this.completeOptionKey(key, completions, current, negable && !!options.default[key]); } }); } } choicesFromOptionsCompletions(completions, args, argv, current) { if (this.previousArgHasChoices(args)) { const choices = this.getPreviousArgChoices(args); if (choices && choices.length > 0) { completions.push(...choices.map((c) => c.replace(/:/g, "\\:"))); } } } choicesFromPositionalsCompletions(completions, args, argv, current) { if (current === "" && completions.length > 0 && this.previousArgHasChoices(args)) { return; } const positionalKeys = this.yargs.getGroups()[this.usage.getPositionalGroupName()] || []; const offset = Math.max(this.indexAfterLastReset, this.yargs.getInternalMethods().getContext().commands.length + 1); const positionalKey = positionalKeys[argv._.length - offset - 1]; if (!positionalKey) { return; } const choices = this.yargs.getOptions().choices[positionalKey] || []; for (const choice of choices) { if (choice.startsWith(current)) { completions.push(choice.replace(/:/g, "\\:")); } } } getPreviousArgChoices(args) { if (args.length < 1) return; let previousArg = args[args.length - 1]; let filter = ""; if (!previousArg.startsWith("-") && args.length > 1) { filter = previousArg; previousArg = args[args.length - 2]; } if (!previousArg.startsWith("-")) return; const previousArgKey = previousArg.replace(/^-+/, ""); const options = this.yargs.getOptions(); const possibleAliases = [ previousArgKey, ...this.yargs.getAliases()[previousArgKey] || [] ]; let choices; for (const possibleAlias of possibleAliases) { if (Object.prototype.hasOwnProperty.call(options.key, possibleAlias) && Array.isArray(options.choices[possibleAlias])) { choices = options.choices[possibleAlias]; break; } } if (choices) { return choices.filter((choice) => !filter || choice.startsWith(filter)); } } previousArgHasChoices(args) { const choices = this.getPreviousArgChoices(args); return choices !== void 0 && choices.length > 0; } argsContainKey(args, key, negable) { const argsContains = (s) => args.indexOf((/^[^0-9]$/.test(s) ? "-" : "--") + s) !== -1; if (argsContains(key)) return true; if (negable && argsContains(`no-${key}`)) return true; if (this.aliases) { for (const alias of this.aliases[key]) { if (argsContains(alias)) return true; } } return false; } completeOptionKey(key, completions, current, negable) { var _a2, _b2, _c2, _d; let keyWithDesc = key; if (this.zshShell) { const descs = this.usage.getDescriptions(); const aliasKey = (_b2 = (_a2 = this === null || this === void 0 ? void 0 : this.aliases) === null || _a2 === void 0 ? void 0 : _a2[key]) === null || _b2 === void 0 ? void 0 : _b2.find((alias) => { const desc2 = descs[alias]; return typeof desc2 === "string" && desc2.length > 0; }); const descFromAlias = aliasKey ? descs[aliasKey] : void 0; const desc = (_d = (_c2 = descs[key]) !== null && _c2 !== void 0 ? _c2 : descFromAlias) !== null && _d !== void 0 ? _d : ""; keyWithDesc = `${key.replace(/:/g, "\\:")}:${desc.replace("__yargsString__:", "").replace(/(\r\n|\n|\r)/gm, " ")}`; } const startsByTwoDashes = (s) => /^--/.test(s); const isShortOption = (s) => /^[^0-9]$/.test(s); const dashes = !startsByTwoDashes(current) && isShortOption(key) ? "-" : "--"; completions.push(dashes + keyWithDesc); if (negable) { completions.push(dashes + "no-" + keyWithDesc); } } customCompletion(args, argv, current, done) { assertNotStrictEqual(this.customCompletionFunction, null, this.shim); if (isSyncCompletionFunction(this.customCompletionFunction)) { const result = this.customCompletionFunction(current, argv); if (isPromise(result)) { return result.then((list) => { this.shim.process.nextTick(() => { done(null, list); }); }).catch((err) => { this.shim.process.nextTick(() => { done(err, void 0); }); }); } return done(null, result); } else if (isFallbackCompletionFunction(this.customCompletionFunction)) { return this.customCompletionFunction(current, argv, (onCompleted = done) => this.defaultCompletion(args, argv, current, onCompleted), (completions) => { done(null, completions); }); } else { return this.customCompletionFunction(current, argv, (completions) => { done(null, completions); }); } } getCompletion(args, done) { const current = args.length ? args[args.length - 1] : ""; const argv = this.yargs.parse(args, true); const completionFunction = this.customCompletionFunction ? (argv2) => this.customCompletion(args, argv2, current, done) : (argv2) => this.defaultCompletion(args, argv2, current, done); return isPromise(argv) ? argv.then(completionFunction) : completionFunction(argv); } generateCompletionScript($0, cmd) { let script = this.zshShell ? completionZshTemplate : completionShTemplate; const name = this.shim.path.basename($0); if ($0.match(/\.js$/)) $0 = `./${$0}`; script = script.replace(/{{app_name}}/g, name); script = script.replace(/{{completion_command}}/g, cmd); return script.replace(/{{app_path}}/g, $0); } registerFunction(fn) { this.customCompletionFunction = fn; } setParsed(parsed) { this.aliases = parsed.aliases; } }; function completion(yargs, usage2, command2, shim3) { return new Completion(yargs, usage2, command2, shim3); } function isSyncCompletionFunction(completionFunction) { return completionFunction.length < 3; } function isFallbackCompletionFunction(completionFunction) { return completionFunction.length > 3; } function levenshtein(a, b) { if (a.length === 0) return b.length; if (b.length === 0) return a.length; const matrix = []; let i; for (i = 0; i <= b.length; i++) { matrix[i] = [i]; } let j; for (j = 0; j <= a.length; j++) { matrix[0][j] = j; } for (i = 1; i <= b.length; i++) { for (j = 1; j <= a.length; j++) { if (b.charAt(i - 1) === a.charAt(j - 1)) { matrix[i][j] = matrix[i - 1][j - 1]; } else { if (i > 1 && j > 1 && b.charAt(i - 2) === a.charAt(j - 1) && b.charAt(i - 1) === a.charAt(j - 2)) { matrix[i][j] = matrix[i - 2][j - 2] + 1; } else { matrix[i][j] = Math.min(matrix[i - 1][j - 1] + 1, Math.min(matrix[i][j - 1] + 1, matrix[i - 1][j] + 1)); } } } } return matrix[b.length][a.length]; } var specialKeys = ["$0", "--", "_"]; function validation(yargs, usage2, shim3) { const __ = shim3.y18n.__; const __n = shim3.y18n.__n; const self2 = {}; self2.nonOptionCount = function nonOptionCount(argv) { const demandedCommands = yargs.getDemandedCommands(); const positionalCount = argv._.length + (argv["--"] ? argv["--"].length : 0); const _s = positionalCount - yargs.getInternalMethods().getContext().commands.length; if (demandedCommands._ && (_s < demandedCommands._.min || _s > demandedCommands._.max)) { if (_s < demandedCommands._.min) { if (demandedCommands._.minMsg !== void 0) { usage2.fail(demandedCommands._.minMsg ? demandedCommands._.minMsg.replace(/\$0/g, _s.toString()).replace(/\$1/, demandedCommands._.min.toString()) : null); } else { usage2.fail(__n("Not enough non-option arguments: got %s, need at least %s", "Not enough non-option arguments: got %s, need at least %s", _s, _s.toString(), demandedCommands._.min.toString())); } } else if (_s > demandedCommands._.max) { if (demandedCommands._.maxMsg !== void 0) { usage2.fail(demandedCommands._.maxMsg ? demandedCommands._.maxMsg.replace(/\$0/g, _s.toString()).replace(/\$1/, demandedCommands._.max.toString()) : null); } else { usage2.fail(__n("Too many non-option arguments: got %s, maximum of %s", "Too many non-option arguments: got %s, maximum of %s", _s, _s.toString(), demandedCommands._.max.toString())); } } } }; self2.positionalCount = function positionalCount(required, observed) { if (observed < required) { usage2.fail(__n("Not enough non-option arguments: got %s, need at least %s", "Not enough non-option arguments: got %s, need at least %s", observed, observed + "", required + "")); } }; self2.requiredArguments = function requiredArguments(argv, demandedOptions) { let missing = null; for (const key of Object.keys(demandedOptions)) { if (!Object.prototype.hasOwnProperty.call(argv, key) || typeof argv[key] === "undefined") { missing = missing || {}; missing[key] = demandedOptions[key]; } } if (missing) { const customMsgs = []; for (const key of Object.keys(missing)) { const msg = missing[key]; if (msg && customMsgs.indexOf(msg) < 0) { customMsgs.push(msg); } } const customMsg = customMsgs.length ? ` ${customMsgs.join("\n")}` : ""; usage2.fail(__n("Missing required argument: %s", "Missing required arguments: %s", Object.keys(missing).length, Object.keys(missing).join(", ") + customMsg)); } }; self2.unknownArguments = function unknownArguments(argv, aliases, positionalMap, isDefaultCommand, checkPositionals = true) { var _a2; const commandKeys = yargs.getInternalMethods().getCommandInstance().getCommands(); const unknown = []; const currentContext = yargs.getInternalMethods().getContext(); Object.keys(argv).forEach((key) => { if (!specialKeys.includes(key) && !Object.prototype.hasOwnProperty.call(positionalMap, key) && !Object.prototype.hasOwnProperty.call(yargs.getInternalMethods().getParseContext(), key) && !self2.isValidAndSomeAliasIsNotNew(key, aliases)) { unknown.push(key); } }); if (checkPositionals && (currentContext.commands.length > 0 || commandKeys.length > 0 || isDefaultCommand)) { argv._.slice(currentContext.commands.length).forEach((key) => { if (!commandKeys.includes("" + key)) { unknown.push("" + key); } }); } if (checkPositionals) { const demandedCommands = yargs.getDemandedCommands(); const maxNonOptDemanded = ((_a2 = demandedCommands._) === null || _a2 === void 0 ? void 0 : _a2.max) || 0; const expected = currentContext.commands.length + maxNonOptDemanded; if (expected < argv._.length) { argv._.slice(expected).forEach((key) => { key = String(key); if (!currentContext.commands.includes(key) && !unknown.includes(key)) { unknown.push(key); } }); } } if (unknown.length) { usage2.fail(__n("Unknown argument: %s", "Unknown arguments: %s", unknown.length, unknown.map((s) => s.trim() ? s : `"${s}"`).join(", "))); } }; self2.unknownCommands = function unknownCommands(argv) { const commandKeys = yargs.getInternalMethods().getCommandInstance().getCommands(); const unknown = []; const currentContext = yargs.getInternalMethods().getContext(); if (currentContext.commands.length > 0 || commandKeys.length > 0) { argv._.slice(currentContext.commands.length).forEach((key) => { if (!commandKeys.includes("" + key)) { unknown.push("" + key); } }); } if (unknown.length > 0) { usage2.fail(__n("Unknown command: %s", "Unknown commands: %s", unknown.length, unknown.join(", "))); return true; } else { return false; } }; self2.isValidAndSomeAliasIsNotNew = function isValidAndSomeAliasIsNotNew(key, aliases) { if (!Object.prototype.hasOwnProperty.call(aliases, key)) { return false; } const newAliases = yargs.parsed.newAliases; return [key, ...aliases[key]].some((a) => !Object.prototype.hasOwnProperty.call(newAliases, a) || !newAliases[key]); }; self2.limitedChoices = function limitedChoices(argv) { const options = yargs.getOptions(); const invalid = {}; if (!Object.keys(options.choices).length) return; Object.keys(argv).forEach((key) => { if (specialKeys.indexOf(key) === -1 && Object.prototype.hasOwnProperty.call(options.choices, key)) { [].concat(argv[key]).forEach((value) => { if (options.choices[key].indexOf(value) === -1 && value !== void 0) { invalid[key] = (invalid[key] || []).concat(value); } }); } }); const invalidKeys = Object.keys(invalid); if (!invalidKeys.length) return; let msg = __("Invalid values:"); invalidKeys.forEach((key) => { msg += ` ${__("Argument: %s, Given: %s, Choices: %s", key, usage2.stringifiedValues(invalid[key]), usage2.stringifiedValues(options.choices[key]))}`; }); usage2.fail(msg); }; let implied = {}; self2.implies = function implies(key, value) { argsert(" [array|number|string]", [key, value], arguments.length); if (typeof key === "object") { Object.keys(key).forEach((k) => { self2.implies(k, key[k]); }); } else { yargs.global(key); if (!implied[key]) { implied[key] = []; } if (Array.isArray(value)) { value.forEach((i) => self2.implies(key, i)); } else { assertNotStrictEqual(value, void 0, shim3); implied[key].push(value); } } }; self2.getImplied = function getImplied() { return implied; }; function keyExists(argv, val) { const num = Number(val); val = isNaN(num) ? val : num; if (typeof val === "number") { val = argv._.length >= val; } else if (val.match(/^--no-.+/)) { val = val.match(/^--no-(.+)/)[1]; val = !Object.prototype.hasOwnProperty.call(argv, val); } else { val = Object.prototype.hasOwnProperty.call(argv, val); } return val; } self2.implications = function implications(argv) { const implyFail = []; Object.keys(implied).forEach((key) => { const origKey = key; (implied[key] || []).forEach((value) => { let key2 = origKey; const origValue = value; key2 = keyExists(argv, key2); value = keyExists(argv, value); if (key2 && !value) { implyFail.push(` ${origKey} -> ${origValue}`); } }); }); if (implyFail.length) { let msg = `${__("Implications failed:")} `; implyFail.forEach((value) => { msg += value; }); usage2.fail(msg); } }; let conflicting = {}; self2.conflicts = function conflicts(key, value) { argsert(" [array|string]", [key, value], arguments.length); if (typeof key === "object") { Object.keys(key).forEach((k) => { self2.conflicts(k, key[k]); }); } else { yargs.global(key); if (!conflicting[key]) { conflicting[key] = []; } if (Array.isArray(value)) { value.forEach((i) => self2.conflicts(key, i)); } else { conflicting[key].push(value); } } }; self2.getConflicting = () => conflicting; self2.conflicting = function conflictingFn(argv) { Object.keys(argv).forEach((key) => { if (conflicting[key]) { conflicting[key].forEach((value) => { if (value && argv[key] !== void 0 && argv[value] !== void 0) { usage2.fail(__("Arguments %s and %s are mutually exclusive", key, value)); } }); } }); if (yargs.getInternalMethods().getParserConfiguration()["strip-dashed"]) { Object.keys(conflicting).forEach((key) => { conflicting[key].forEach((value) => { if (value && argv[shim3.Parser.camelCase(key)] !== void 0 && argv[shim3.Parser.camelCase(value)] !== void 0) { usage2.fail(__("Arguments %s and %s are mutually exclusive", key, value)); } }); }); } }; self2.recommendCommands = function recommendCommands(cmd, potentialCommands) { const threshold = 3; potentialCommands = potentialCommands.sort((a, b) => b.length - a.length); let recommended = null; let bestDistance = Infinity; for (let i = 0, candidate; (candidate = potentialCommands[i]) !== void 0; i++) { const d = levenshtein(cmd, candidate); if (d <= threshold && d < bestDistance) { bestDistance = d; recommended = candidate; } } if (recommended) usage2.fail(__("Did you mean %s?", recommended)); }; self2.reset = function reset(localLookup) { implied = objFilter(implied, (k) => !localLookup[k]); conflicting = objFilter(conflicting, (k) => !localLookup[k]); return self2; }; const frozens = []; self2.freeze = function freeze() { frozens.push({ implied, conflicting }); }; self2.unfreeze = function unfreeze() { const frozen = frozens.pop(); assertNotStrictEqual(frozen, void 0, shim3); ({ implied, conflicting } = frozen); }; return self2; } var previouslyVisitedConfigs = []; var shim2; function applyExtends(config, cwd, mergeExtends, _shim) { shim2 = _shim; let defaultConfig = {}; if (Object.prototype.hasOwnProperty.call(config, "extends")) { if (typeof config.extends !== "string") return defaultConfig; const isPath = /\.json|\..*rc$/.test(config.extends); let pathToDefault = null; if (!isPath) { try { pathToDefault = import.meta.resolve(config.extends); } catch (_err) { return config; } } else { pathToDefault = getPathToDefaultConfig(cwd, config.extends); } checkForCircularExtends(pathToDefault); previouslyVisitedConfigs.push(pathToDefault); defaultConfig = isPath ? JSON.parse(shim2.readFileSync(pathToDefault, "utf8")) : _shim.require(config.extends); delete config.extends; defaultConfig = applyExtends(defaultConfig, shim2.path.dirname(pathToDefault), mergeExtends, shim2); } previouslyVisitedConfigs = []; return mergeExtends ? mergeDeep2(defaultConfig, config) : Object.assign({}, defaultConfig, config); } function checkForCircularExtends(cfgPath) { if (previouslyVisitedConfigs.indexOf(cfgPath) > -1) { throw new YError(`Circular extended configurations: '${cfgPath}'.`); } } function getPathToDefaultConfig(cwd, pathToExtend) { return shim2.path.resolve(cwd, pathToExtend); } function mergeDeep2(config1, config2) { const target = {}; function isObject(obj) { return obj && typeof obj === "object" && !Array.isArray(obj); } Object.assign(target, config1); for (const key of Object.keys(config2)) { if (isObject(config2[key]) && isObject(target[key])) { target[key] = mergeDeep2(config1[key], config2[key]); } else { target[key] = config2[key]; } } return target; } var __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 = 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 _YargsInstance_command; var _YargsInstance_cwd; var _YargsInstance_context; var _YargsInstance_completion; var _YargsInstance_completionCommand; var _YargsInstance_defaultShowHiddenOpt; var _YargsInstance_exitError; var _YargsInstance_detectLocale; var _YargsInstance_emittedWarnings; var _YargsInstance_exitProcess; var _YargsInstance_frozens; var _YargsInstance_globalMiddleware; var _YargsInstance_groups; var _YargsInstance_hasOutput; var _YargsInstance_helpOpt; var _YargsInstance_isGlobalContext; var _YargsInstance_logger; var _YargsInstance_output; var _YargsInstance_options; var _YargsInstance_parentRequire; var _YargsInstance_parserConfig; var _YargsInstance_parseFn; var _YargsInstance_parseContext; var _YargsInstance_pkgs; var _YargsInstance_preservedGroups; var _YargsInstance_processArgs; var _YargsInstance_recommendCommands; var _YargsInstance_shim; var _YargsInstance_strict; var _YargsInstance_strictCommands; var _YargsInstance_strictOptions; var _YargsInstance_usage; var _YargsInstance_usageConfig; var _YargsInstance_versionOpt; var _YargsInstance_validation; function YargsFactory(_shim) { return (processArgs = [], cwd = _shim.process.cwd(), parentRequire) => { const yargs = new YargsInstance(processArgs, cwd, parentRequire, _shim); Object.defineProperty(yargs, "argv", { get: () => { return yargs.parse(); }, enumerable: true }); yargs.help(); yargs.version(); return yargs; }; } var kCopyDoubleDash = Symbol("copyDoubleDash"); var kCreateLogger = Symbol("copyDoubleDash"); var kDeleteFromParserHintObject = Symbol("deleteFromParserHintObject"); var kEmitWarning = Symbol("emitWarning"); var kFreeze = Symbol("freeze"); var kGetDollarZero = Symbol("getDollarZero"); var kGetParserConfiguration = Symbol("getParserConfiguration"); var kGetUsageConfiguration = Symbol("getUsageConfiguration"); var kGuessLocale = Symbol("guessLocale"); var kGuessVersion = Symbol("guessVersion"); var kParsePositionalNumbers = Symbol("parsePositionalNumbers"); var kPkgUp = Symbol("pkgUp"); var kPopulateParserHintArray = Symbol("populateParserHintArray"); var kPopulateParserHintSingleValueDictionary = Symbol("populateParserHintSingleValueDictionary"); var kPopulateParserHintArrayDictionary = Symbol("populateParserHintArrayDictionary"); var kPopulateParserHintDictionary = Symbol("populateParserHintDictionary"); var kSanitizeKey = Symbol("sanitizeKey"); var kSetKey = Symbol("setKey"); var kUnfreeze = Symbol("unfreeze"); var kValidateAsync = Symbol("validateAsync"); var kGetCommandInstance = Symbol("getCommandInstance"); var kGetContext = Symbol("getContext"); var kGetHasOutput = Symbol("getHasOutput"); var kGetLoggerInstance = Symbol("getLoggerInstance"); var kGetParseContext = Symbol("getParseContext"); var kGetUsageInstance = Symbol("getUsageInstance"); var kGetValidationInstance = Symbol("getValidationInstance"); var kHasParseCallback = Symbol("hasParseCallback"); var kIsGlobalContext = Symbol("isGlobalContext"); var kPostProcess = Symbol("postProcess"); var kRebase = Symbol("rebase"); var kReset = Symbol("reset"); var kRunYargsParserAndExecuteCommands = Symbol("runYargsParserAndExecuteCommands"); var kRunValidation = Symbol("runValidation"); var kSetHasOutput = Symbol("setHasOutput"); var kTrackManuallySetKeys = Symbol("kTrackManuallySetKeys"); var DEFAULT_LOCALE = "en_US"; var YargsInstance = class { constructor(processArgs = [], cwd, parentRequire, shim3) { this.customScriptName = false; this.parsed = false; _YargsInstance_command.set(this, void 0); _YargsInstance_cwd.set(this, void 0); _YargsInstance_context.set(this, { commands: [], fullCommands: [] }); _YargsInstance_completion.set(this, null); _YargsInstance_completionCommand.set(this, null); _YargsInstance_defaultShowHiddenOpt.set(this, "show-hidden"); _YargsInstance_exitError.set(this, null); _YargsInstance_detectLocale.set(this, true); _YargsInstance_emittedWarnings.set(this, {}); _YargsInstance_exitProcess.set(this, true); _YargsInstance_frozens.set(this, []); _YargsInstance_globalMiddleware.set(this, void 0); _YargsInstance_groups.set(this, {}); _YargsInstance_hasOutput.set(this, false); _YargsInstance_helpOpt.set(this, null); _YargsInstance_isGlobalContext.set(this, true); _YargsInstance_logger.set(this, void 0); _YargsInstance_output.set(this, ""); _YargsInstance_options.set(this, void 0); _YargsInstance_parentRequire.set(this, void 0); _YargsInstance_parserConfig.set(this, {}); _YargsInstance_parseFn.set(this, null); _YargsInstance_parseContext.set(this, null); _YargsInstance_pkgs.set(this, {}); _YargsInstance_preservedGroups.set(this, {}); _YargsInstance_processArgs.set(this, void 0); _YargsInstance_recommendCommands.set(this, false); _YargsInstance_shim.set(this, void 0); _YargsInstance_strict.set(this, false); _YargsInstance_strictCommands.set(this, false); _YargsInstance_strictOptions.set(this, false); _YargsInstance_usage.set(this, void 0); _YargsInstance_usageConfig.set(this, {}); _YargsInstance_versionOpt.set(this, null); _YargsInstance_validation.set(this, void 0); __classPrivateFieldSet(this, _YargsInstance_shim, shim3, "f"); __classPrivateFieldSet(this, _YargsInstance_processArgs, processArgs, "f"); __classPrivateFieldSet(this, _YargsInstance_cwd, cwd, "f"); __classPrivateFieldSet(this, _YargsInstance_parentRequire, parentRequire, "f"); __classPrivateFieldSet(this, _YargsInstance_globalMiddleware, new GlobalMiddleware(this), "f"); this.$0 = this[kGetDollarZero](); this[kReset](); __classPrivateFieldSet(this, _YargsInstance_command, __classPrivateFieldGet(this, _YargsInstance_command, "f"), "f"); __classPrivateFieldSet(this, _YargsInstance_usage, __classPrivateFieldGet(this, _YargsInstance_usage, "f"), "f"); __classPrivateFieldSet(this, _YargsInstance_validation, __classPrivateFieldGet(this, _YargsInstance_validation, "f"), "f"); __classPrivateFieldSet(this, _YargsInstance_options, __classPrivateFieldGet(this, _YargsInstance_options, "f"), "f"); __classPrivateFieldGet(this, _YargsInstance_options, "f").showHiddenOpt = __classPrivateFieldGet(this, _YargsInstance_defaultShowHiddenOpt, "f"); __classPrivateFieldSet(this, _YargsInstance_logger, this[kCreateLogger](), "f"); __classPrivateFieldGet(this, _YargsInstance_shim, "f").y18n.setLocale(DEFAULT_LOCALE); } addHelpOpt(opt, msg) { const defaultHelpOpt = "help"; argsert("[string|boolean] [string]", [opt, msg], arguments.length); if (__classPrivateFieldGet(this, _YargsInstance_helpOpt, "f")) { this[kDeleteFromParserHintObject](__classPrivateFieldGet(this, _YargsInstance_helpOpt, "f")); __classPrivateFieldSet(this, _YargsInstance_helpOpt, null, "f"); } if (opt === false && msg === void 0) return this; __classPrivateFieldSet(this, _YargsInstance_helpOpt, typeof opt === "string" ? opt : defaultHelpOpt, "f"); this.boolean(__classPrivateFieldGet(this, _YargsInstance_helpOpt, "f")); this.describe(__classPrivateFieldGet(this, _YargsInstance_helpOpt, "f"), msg || __classPrivateFieldGet(this, _YargsInstance_usage, "f").deferY18nLookup("Show help")); return this; } help(opt, msg) { return this.addHelpOpt(opt, msg); } addShowHiddenOpt(opt, msg) { argsert("[string|boolean] [string]", [opt, msg], arguments.length); if (opt === false && msg === void 0) return this; const showHiddenOpt = typeof opt === "string" ? opt : __classPrivateFieldGet(this, _YargsInstance_defaultShowHiddenOpt, "f"); this.boolean(showHiddenOpt); this.describe(showHiddenOpt, msg || __classPrivateFieldGet(this, _YargsInstance_usage, "f").deferY18nLookup("Show hidden options")); __classPrivateFieldGet(this, _YargsInstance_options, "f").showHiddenOpt = showHiddenOpt; return this; } showHidden(opt, msg) { return this.addShowHiddenOpt(opt, msg); } alias(key, value) { argsert(" [string|array]", [key, value], arguments.length); this[kPopulateParserHintArrayDictionary](this.alias.bind(this), "alias", key, value); return this; } array(keys) { argsert("", [keys], arguments.length); this[kPopulateParserHintArray]("array", keys); this[kTrackManuallySetKeys](keys); return this; } boolean(keys) { argsert("", [keys], arguments.length); this[kPopulateParserHintArray]("boolean", keys); this[kTrackManuallySetKeys](keys); return this; } check(f, global) { argsert(" [boolean]", [f, global], arguments.length); this.middleware((argv, _yargs) => { return maybeAsyncResult(() => { return f(argv, _yargs.getOptions()); }, (result) => { if (!result) { __classPrivateFieldGet(this, _YargsInstance_usage, "f").fail(__classPrivateFieldGet(this, _YargsInstance_shim, "f").y18n.__("Argument check failed: %s", f.toString())); } else if (typeof result === "string" || result instanceof Error) { __classPrivateFieldGet(this, _YargsInstance_usage, "f").fail(result.toString(), result); } return argv; }, (err) => { __classPrivateFieldGet(this, _YargsInstance_usage, "f").fail(err.message ? err.message : err.toString(), err); return argv; }); }, false, global); return this; } choices(key, value) { argsert(" [string|array]", [key, value], arguments.length); this[kPopulateParserHintArrayDictionary](this.choices.bind(this), "choices", key, value); return this; } coerce(keys, value) { argsert(" [function]", [keys, value], arguments.length); if (Array.isArray(keys)) { if (!value) { throw new YError("coerce callback must be provided"); } for (const key of keys) { this.coerce(key, value); } return this; } else if (typeof keys === "object") { for (const key of Object.keys(keys)) { this.coerce(key, keys[key]); } return this; } if (!value) { throw new YError("coerce callback must be provided"); } const coerceKey = keys; __classPrivateFieldGet(this, _YargsInstance_options, "f").key[coerceKey] = true; __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").addCoerceMiddleware((argv, yargs) => { var _a2; const coerceKeyAliases = (_a2 = yargs.getAliases()[coerceKey]) !== null && _a2 !== void 0 ? _a2 : []; const argvKeys = [coerceKey, ...coerceKeyAliases].filter((key) => Object.prototype.hasOwnProperty.call(argv, key)); if (argvKeys.length === 0) { return argv; } return maybeAsyncResult(() => { return value(argv[argvKeys[0]]); }, (result) => { argvKeys.forEach((key) => { argv[key] = result; }); return argv; }, (err) => { throw new YError(err.message); }); }, coerceKey); return this; } conflicts(key1, key2) { argsert(" [string|array]", [key1, key2], arguments.length); __classPrivateFieldGet(this, _YargsInstance_validation, "f").conflicts(key1, key2); return this; } config(key = "config", msg, parseFn) { argsert("[object|string] [string|function] [function]", [key, msg, parseFn], arguments.length); if (typeof key === "object" && !Array.isArray(key)) { key = applyExtends(key, __classPrivateFieldGet(this, _YargsInstance_cwd, "f"), this[kGetParserConfiguration]()["deep-merge-config"] || false, __classPrivateFieldGet(this, _YargsInstance_shim, "f")); __classPrivateFieldGet(this, _YargsInstance_options, "f").configObjects = (__classPrivateFieldGet(this, _YargsInstance_options, "f").configObjects || []).concat(key); return this; } if (typeof msg === "function") { parseFn = msg; msg = void 0; } this.describe(key, msg || __classPrivateFieldGet(this, _YargsInstance_usage, "f").deferY18nLookup("Path to JSON config file")); (Array.isArray(key) ? key : [key]).forEach((k) => { __classPrivateFieldGet(this, _YargsInstance_options, "f").config[k] = parseFn || true; }); return this; } completion(cmd, desc, fn) { argsert("[string] [string|boolean|function] [function]", [cmd, desc, fn], arguments.length); if (typeof desc === "function") { fn = desc; desc = void 0; } __classPrivateFieldSet(this, _YargsInstance_completionCommand, cmd || __classPrivateFieldGet(this, _YargsInstance_completionCommand, "f") || "completion", "f"); if (!desc && desc !== false) { desc = "generate completion script"; } this.command(__classPrivateFieldGet(this, _YargsInstance_completionCommand, "f"), desc); if (fn) __classPrivateFieldGet(this, _YargsInstance_completion, "f").registerFunction(fn); return this; } command(cmd, description, builder, handler3, middlewares, deprecated) { argsert(" [string|boolean] [function|object] [function] [array] [boolean|string]", [cmd, description, builder, handler3, middlewares, deprecated], arguments.length); __classPrivateFieldGet(this, _YargsInstance_command, "f").addHandler(cmd, description, builder, handler3, middlewares, deprecated); return this; } commands(cmd, description, builder, handler3, middlewares, deprecated) { return this.command(cmd, description, builder, handler3, middlewares, deprecated); } commandDir(dir, opts) { argsert(" [object]", [dir, opts], arguments.length); const req = __classPrivateFieldGet(this, _YargsInstance_parentRequire, "f") || __classPrivateFieldGet(this, _YargsInstance_shim, "f").require; __classPrivateFieldGet(this, _YargsInstance_command, "f").addDirectory(dir, req, __classPrivateFieldGet(this, _YargsInstance_shim, "f").getCallerFile(), opts); return this; } count(keys) { argsert("", [keys], arguments.length); this[kPopulateParserHintArray]("count", keys); this[kTrackManuallySetKeys](keys); return this; } default(key, value, defaultDescription) { argsert(" [*] [string]", [key, value, defaultDescription], arguments.length); if (defaultDescription) { assertSingleKey(key, __classPrivateFieldGet(this, _YargsInstance_shim, "f")); __classPrivateFieldGet(this, _YargsInstance_options, "f").defaultDescription[key] = defaultDescription; } if (typeof value === "function") { assertSingleKey(key, __classPrivateFieldGet(this, _YargsInstance_shim, "f")); if (!__classPrivateFieldGet(this, _YargsInstance_options, "f").defaultDescription[key]) __classPrivateFieldGet(this, _YargsInstance_options, "f").defaultDescription[key] = __classPrivateFieldGet(this, _YargsInstance_usage, "f").functionDescription(value); value = value.call(); } this[kPopulateParserHintSingleValueDictionary](this.default.bind(this), "default", key, value); return this; } defaults(key, value, defaultDescription) { return this.default(key, value, defaultDescription); } demandCommand(min = 1, max, minMsg, maxMsg) { argsert("[number] [number|string] [string|null|undefined] [string|null|undefined]", [min, max, minMsg, maxMsg], arguments.length); if (typeof max !== "number") { minMsg = max; max = Infinity; } this.global("_", false); __classPrivateFieldGet(this, _YargsInstance_options, "f").demandedCommands._ = { min, max, minMsg, maxMsg }; return this; } demand(keys, max, msg) { if (Array.isArray(max)) { max.forEach((key) => { assertNotStrictEqual(msg, true, __classPrivateFieldGet(this, _YargsInstance_shim, "f")); this.demandOption(key, msg); }); max = Infinity; } else if (typeof max !== "number") { msg = max; max = Infinity; } if (typeof keys === "number") { assertNotStrictEqual(msg, true, __classPrivateFieldGet(this, _YargsInstance_shim, "f")); this.demandCommand(keys, max, msg, msg); } else if (Array.isArray(keys)) { keys.forEach((key) => { assertNotStrictEqual(msg, true, __classPrivateFieldGet(this, _YargsInstance_shim, "f")); this.demandOption(key, msg); }); } else { if (typeof msg === "string") { this.demandOption(keys, msg); } else if (msg === true || typeof msg === "undefined") { this.demandOption(keys); } } return this; } demandOption(keys, msg) { argsert(" [string]", [keys, msg], arguments.length); this[kPopulateParserHintSingleValueDictionary](this.demandOption.bind(this), "demandedOptions", keys, msg); return this; } deprecateOption(option, message) { argsert(" [string|boolean]", [option, message], arguments.length); __classPrivateFieldGet(this, _YargsInstance_options, "f").deprecatedOptions[option] = message; return this; } describe(keys, description) { argsert(" [string]", [keys, description], arguments.length); this[kSetKey](keys, true); __classPrivateFieldGet(this, _YargsInstance_usage, "f").describe(keys, description); return this; } detectLocale(detect) { argsert("", [detect], arguments.length); __classPrivateFieldSet(this, _YargsInstance_detectLocale, detect, "f"); return this; } env(prefix) { argsert("[string|boolean]", [prefix], arguments.length); if (prefix === false) delete __classPrivateFieldGet(this, _YargsInstance_options, "f").envPrefix; else __classPrivateFieldGet(this, _YargsInstance_options, "f").envPrefix = prefix || ""; return this; } epilogue(msg) { argsert("", [msg], arguments.length); __classPrivateFieldGet(this, _YargsInstance_usage, "f").epilog(msg); return this; } epilog(msg) { return this.epilogue(msg); } example(cmd, description) { argsert(" [string]", [cmd, description], arguments.length); if (Array.isArray(cmd)) { cmd.forEach((exampleParams) => this.example(...exampleParams)); } else { __classPrivateFieldGet(this, _YargsInstance_usage, "f").example(cmd, description); } return this; } exit(code, err) { __classPrivateFieldSet(this, _YargsInstance_hasOutput, true, "f"); __classPrivateFieldSet(this, _YargsInstance_exitError, err, "f"); if (__classPrivateFieldGet(this, _YargsInstance_exitProcess, "f")) __classPrivateFieldGet(this, _YargsInstance_shim, "f").process.exit(code); } exitProcess(enabled = true) { argsert("[boolean]", [enabled], arguments.length); __classPrivateFieldSet(this, _YargsInstance_exitProcess, enabled, "f"); return this; } fail(f) { argsert("", [f], arguments.length); if (typeof f === "boolean" && f !== false) { throw new YError("Invalid first argument. Expected function or boolean 'false'"); } __classPrivateFieldGet(this, _YargsInstance_usage, "f").failFn(f); return this; } getAliases() { return this.parsed ? this.parsed.aliases : {}; } async getCompletion(args, done) { argsert(" [function]", [args, done], arguments.length); if (!done) { return new Promise((resolve5, reject) => { __classPrivateFieldGet(this, _YargsInstance_completion, "f").getCompletion(args, (err, completions) => { if (err) reject(err); else resolve5(completions); }); }); } else { return __classPrivateFieldGet(this, _YargsInstance_completion, "f").getCompletion(args, done); } } getDemandedOptions() { argsert([], 0); return __classPrivateFieldGet(this, _YargsInstance_options, "f").demandedOptions; } getDemandedCommands() { argsert([], 0); return __classPrivateFieldGet(this, _YargsInstance_options, "f").demandedCommands; } getDeprecatedOptions() { argsert([], 0); return __classPrivateFieldGet(this, _YargsInstance_options, "f").deprecatedOptions; } getDetectLocale() { return __classPrivateFieldGet(this, _YargsInstance_detectLocale, "f"); } getExitProcess() { return __classPrivateFieldGet(this, _YargsInstance_exitProcess, "f"); } getGroups() { return Object.assign({}, __classPrivateFieldGet(this, _YargsInstance_groups, "f"), __classPrivateFieldGet(this, _YargsInstance_preservedGroups, "f")); } getHelp() { __classPrivateFieldSet(this, _YargsInstance_hasOutput, true, "f"); if (!__classPrivateFieldGet(this, _YargsInstance_usage, "f").hasCachedHelpMessage()) { if (!this.parsed) { const parse3 = this[kRunYargsParserAndExecuteCommands](__classPrivateFieldGet(this, _YargsInstance_processArgs, "f"), void 0, void 0, 0, true); if (isPromise(parse3)) { return parse3.then(() => { return __classPrivateFieldGet(this, _YargsInstance_usage, "f").help(); }); } } const builderResponse = __classPrivateFieldGet(this, _YargsInstance_command, "f").runDefaultBuilderOn(this); if (isPromise(builderResponse)) { return builderResponse.then(() => { return __classPrivateFieldGet(this, _YargsInstance_usage, "f").help(); }); } } return Promise.resolve(__classPrivateFieldGet(this, _YargsInstance_usage, "f").help()); } getOptions() { return __classPrivateFieldGet(this, _YargsInstance_options, "f"); } getStrict() { return __classPrivateFieldGet(this, _YargsInstance_strict, "f"); } getStrictCommands() { return __classPrivateFieldGet(this, _YargsInstance_strictCommands, "f"); } getStrictOptions() { return __classPrivateFieldGet(this, _YargsInstance_strictOptions, "f"); } global(globals, global) { argsert(" [boolean]", [globals, global], arguments.length); globals = [].concat(globals); if (global !== false) { __classPrivateFieldGet(this, _YargsInstance_options, "f").local = __classPrivateFieldGet(this, _YargsInstance_options, "f").local.filter((l) => globals.indexOf(l) === -1); } else { globals.forEach((g) => { if (!__classPrivateFieldGet(this, _YargsInstance_options, "f").local.includes(g)) __classPrivateFieldGet(this, _YargsInstance_options, "f").local.push(g); }); } return this; } group(opts, groupName) { argsert(" ", [opts, groupName], arguments.length); const existing = __classPrivateFieldGet(this, _YargsInstance_preservedGroups, "f")[groupName] || __classPrivateFieldGet(this, _YargsInstance_groups, "f")[groupName]; if (__classPrivateFieldGet(this, _YargsInstance_preservedGroups, "f")[groupName]) { delete __classPrivateFieldGet(this, _YargsInstance_preservedGroups, "f")[groupName]; } const seen = {}; __classPrivateFieldGet(this, _YargsInstance_groups, "f")[groupName] = (existing || []).concat(opts).filter((key) => { if (seen[key]) return false; return seen[key] = true; }); return this; } hide(key) { argsert("", [key], arguments.length); __classPrivateFieldGet(this, _YargsInstance_options, "f").hiddenOptions.push(key); return this; } implies(key, value) { argsert(" [number|string|array]", [key, value], arguments.length); __classPrivateFieldGet(this, _YargsInstance_validation, "f").implies(key, value); return this; } locale(locale) { argsert("[string]", [locale], arguments.length); if (locale === void 0) { this[kGuessLocale](); return __classPrivateFieldGet(this, _YargsInstance_shim, "f").y18n.getLocale(); } __classPrivateFieldSet(this, _YargsInstance_detectLocale, false, "f"); __classPrivateFieldGet(this, _YargsInstance_shim, "f").y18n.setLocale(locale); return this; } middleware(callback, applyBeforeValidation, global) { return __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").addMiddleware(callback, !!applyBeforeValidation, global); } nargs(key, value) { argsert(" [number]", [key, value], arguments.length); this[kPopulateParserHintSingleValueDictionary](this.nargs.bind(this), "narg", key, value); return this; } normalize(keys) { argsert("", [keys], arguments.length); this[kPopulateParserHintArray]("normalize", keys); return this; } number(keys) { argsert("", [keys], arguments.length); this[kPopulateParserHintArray]("number", keys); this[kTrackManuallySetKeys](keys); return this; } option(key, opt) { argsert(" [object]", [key, opt], arguments.length); if (typeof key === "object") { Object.keys(key).forEach((k) => { this.options(k, key[k]); }); } else { if (typeof opt !== "object") { opt = {}; } this[kTrackManuallySetKeys](key); if (__classPrivateFieldGet(this, _YargsInstance_versionOpt, "f") && (key === "version" || (opt === null || opt === void 0 ? void 0 : opt.alias) === "version")) { this[kEmitWarning]([ '"version" is a reserved word.', "Please do one of the following:", '- Disable version with `yargs.version(false)` if using "version" as an option', "- Use the built-in `yargs.version` method instead (if applicable)", "- Use a different option key", "https://yargs.js.org/docs/#api-reference-version" ].join("\n"), void 0, "versionWarning"); } __classPrivateFieldGet(this, _YargsInstance_options, "f").key[key] = true; if (opt.alias) this.alias(key, opt.alias); const deprecate = opt.deprecate || opt.deprecated; if (deprecate) { this.deprecateOption(key, deprecate); } const demand = opt.demand || opt.required || opt.require; if (demand) { this.demand(key, demand); } if (opt.demandOption) { this.demandOption(key, typeof opt.demandOption === "string" ? opt.demandOption : void 0); } if (opt.conflicts) { this.conflicts(key, opt.conflicts); } if ("default" in opt) { this.default(key, opt.default); } if (opt.implies !== void 0) { this.implies(key, opt.implies); } if (opt.nargs !== void 0) { this.nargs(key, opt.nargs); } if (opt.config) { this.config(key, opt.configParser); } if (opt.normalize) { this.normalize(key); } if (opt.choices) { this.choices(key, opt.choices); } if (opt.coerce) { this.coerce(key, opt.coerce); } if (opt.group) { this.group(key, opt.group); } if (opt.boolean || opt.type === "boolean") { this.boolean(key); if (opt.alias) this.boolean(opt.alias); } if (opt.array || opt.type === "array") { this.array(key); if (opt.alias) this.array(opt.alias); } if (opt.number || opt.type === "number") { this.number(key); if (opt.alias) this.number(opt.alias); } if (opt.string || opt.type === "string") { this.string(key); if (opt.alias) this.string(opt.alias); } if (opt.count || opt.type === "count") { this.count(key); } if (typeof opt.global === "boolean") { this.global(key, opt.global); } if (opt.defaultDescription) { __classPrivateFieldGet(this, _YargsInstance_options, "f").defaultDescription[key] = opt.defaultDescription; } if (opt.skipValidation) { this.skipValidation(key); } const desc = opt.describe || opt.description || opt.desc; const descriptions = __classPrivateFieldGet(this, _YargsInstance_usage, "f").getDescriptions(); if (!Object.prototype.hasOwnProperty.call(descriptions, key) || typeof desc === "string") { this.describe(key, desc); } if (opt.hidden) { this.hide(key); } if (opt.requiresArg) { this.requiresArg(key); } } return this; } options(key, opt) { return this.option(key, opt); } parse(args, shortCircuit, _parseFn) { argsert("[string|array] [function|boolean|object] [function]", [args, shortCircuit, _parseFn], arguments.length); this[kFreeze](); if (typeof args === "undefined") { args = __classPrivateFieldGet(this, _YargsInstance_processArgs, "f"); } if (typeof shortCircuit === "object") { __classPrivateFieldSet(this, _YargsInstance_parseContext, shortCircuit, "f"); shortCircuit = _parseFn; } if (typeof shortCircuit === "function") { __classPrivateFieldSet(this, _YargsInstance_parseFn, shortCircuit, "f"); shortCircuit = false; } if (!shortCircuit) __classPrivateFieldSet(this, _YargsInstance_processArgs, args, "f"); if (__classPrivateFieldGet(this, _YargsInstance_parseFn, "f")) __classPrivateFieldSet(this, _YargsInstance_exitProcess, false, "f"); const parsed = this[kRunYargsParserAndExecuteCommands](args, !!shortCircuit); const tmpParsed = this.parsed; __classPrivateFieldGet(this, _YargsInstance_completion, "f").setParsed(this.parsed); if (isPromise(parsed)) { return parsed.then((argv) => { if (__classPrivateFieldGet(this, _YargsInstance_parseFn, "f")) __classPrivateFieldGet(this, _YargsInstance_parseFn, "f").call(this, __classPrivateFieldGet(this, _YargsInstance_exitError, "f"), argv, __classPrivateFieldGet(this, _YargsInstance_output, "f")); return argv; }).catch((err) => { if (__classPrivateFieldGet(this, _YargsInstance_parseFn, "f")) { __classPrivateFieldGet(this, _YargsInstance_parseFn, "f")(err, this.parsed.argv, __classPrivateFieldGet(this, _YargsInstance_output, "f")); } throw err; }).finally(() => { this[kUnfreeze](); this.parsed = tmpParsed; }); } else { if (__classPrivateFieldGet(this, _YargsInstance_parseFn, "f")) __classPrivateFieldGet(this, _YargsInstance_parseFn, "f").call(this, __classPrivateFieldGet(this, _YargsInstance_exitError, "f"), parsed, __classPrivateFieldGet(this, _YargsInstance_output, "f")); this[kUnfreeze](); this.parsed = tmpParsed; } return parsed; } parseAsync(args, shortCircuit, _parseFn) { const maybePromise = this.parse(args, shortCircuit, _parseFn); return !isPromise(maybePromise) ? Promise.resolve(maybePromise) : maybePromise; } parseSync(args, shortCircuit, _parseFn) { const maybePromise = this.parse(args, shortCircuit, _parseFn); if (isPromise(maybePromise)) { throw new YError(".parseSync() must not be used with asynchronous builders, handlers, or middleware"); } return maybePromise; } parserConfiguration(config) { argsert("", [config], arguments.length); __classPrivateFieldSet(this, _YargsInstance_parserConfig, config, "f"); return this; } pkgConf(key, rootPath) { argsert(" [string]", [key, rootPath], arguments.length); let conf = null; const obj = this[kPkgUp](rootPath || __classPrivateFieldGet(this, _YargsInstance_cwd, "f")); if (obj[key] && typeof obj[key] === "object") { conf = applyExtends(obj[key], rootPath || __classPrivateFieldGet(this, _YargsInstance_cwd, "f"), this[kGetParserConfiguration]()["deep-merge-config"] || false, __classPrivateFieldGet(this, _YargsInstance_shim, "f")); __classPrivateFieldGet(this, _YargsInstance_options, "f").configObjects = (__classPrivateFieldGet(this, _YargsInstance_options, "f").configObjects || []).concat(conf); } return this; } positional(key, opts) { argsert(" ", [key, opts], arguments.length); const supportedOpts = [ "default", "defaultDescription", "implies", "normalize", "choices", "conflicts", "coerce", "type", "describe", "desc", "description", "alias" ]; opts = objFilter(opts, (k, v) => { if (k === "type" && !["string", "number", "boolean"].includes(v)) return false; return supportedOpts.includes(k); }); const fullCommand = __classPrivateFieldGet(this, _YargsInstance_context, "f").fullCommands[__classPrivateFieldGet(this, _YargsInstance_context, "f").fullCommands.length - 1]; const parseOptions = fullCommand ? __classPrivateFieldGet(this, _YargsInstance_command, "f").cmdToParseOptions(fullCommand) : { array: [], alias: {}, default: {}, demand: {} }; objectKeys(parseOptions).forEach((pk) => { const parseOption = parseOptions[pk]; if (Array.isArray(parseOption)) { if (parseOption.indexOf(key) !== -1) opts[pk] = true; } else { if (parseOption[key] && !(pk in opts)) opts[pk] = parseOption[key]; } }); this.group(key, __classPrivateFieldGet(this, _YargsInstance_usage, "f").getPositionalGroupName()); return this.option(key, opts); } recommendCommands(recommend = true) { argsert("[boolean]", [recommend], arguments.length); __classPrivateFieldSet(this, _YargsInstance_recommendCommands, recommend, "f"); return this; } required(keys, max, msg) { return this.demand(keys, max, msg); } require(keys, max, msg) { return this.demand(keys, max, msg); } requiresArg(keys) { argsert(" [number]", [keys], arguments.length); if (typeof keys === "string" && __classPrivateFieldGet(this, _YargsInstance_options, "f").narg[keys]) { return this; } else { this[kPopulateParserHintSingleValueDictionary](this.requiresArg.bind(this), "narg", keys, NaN); } return this; } showCompletionScript($0, cmd) { argsert("[string] [string]", [$0, cmd], arguments.length); $0 = $0 || this.$0; __classPrivateFieldGet(this, _YargsInstance_logger, "f").log(__classPrivateFieldGet(this, _YargsInstance_completion, "f").generateCompletionScript($0, cmd || __classPrivateFieldGet(this, _YargsInstance_completionCommand, "f") || "completion")); return this; } showHelp(level) { argsert("[string|function]", [level], arguments.length); __classPrivateFieldSet(this, _YargsInstance_hasOutput, true, "f"); if (!__classPrivateFieldGet(this, _YargsInstance_usage, "f").hasCachedHelpMessage()) { if (!this.parsed) { const parse3 = this[kRunYargsParserAndExecuteCommands](__classPrivateFieldGet(this, _YargsInstance_processArgs, "f"), void 0, void 0, 0, true); if (isPromise(parse3)) { parse3.then(() => { __classPrivateFieldGet(this, _YargsInstance_usage, "f").showHelp(level); }); return this; } } const builderResponse = __classPrivateFieldGet(this, _YargsInstance_command, "f").runDefaultBuilderOn(this); if (isPromise(builderResponse)) { builderResponse.then(() => { __classPrivateFieldGet(this, _YargsInstance_usage, "f").showHelp(level); }); return this; } } __classPrivateFieldGet(this, _YargsInstance_usage, "f").showHelp(level); return this; } scriptName(scriptName) { this.customScriptName = true; this.$0 = scriptName; return this; } showHelpOnFail(enabled, message) { argsert("[boolean|string] [string]", [enabled, message], arguments.length); __classPrivateFieldGet(this, _YargsInstance_usage, "f").showHelpOnFail(enabled, message); return this; } showVersion(level) { argsert("[string|function]", [level], arguments.length); __classPrivateFieldGet(this, _YargsInstance_usage, "f").showVersion(level); return this; } skipValidation(keys) { argsert("", [keys], arguments.length); this[kPopulateParserHintArray]("skipValidation", keys); return this; } strict(enabled) { argsert("[boolean]", [enabled], arguments.length); __classPrivateFieldSet(this, _YargsInstance_strict, enabled !== false, "f"); return this; } strictCommands(enabled) { argsert("[boolean]", [enabled], arguments.length); __classPrivateFieldSet(this, _YargsInstance_strictCommands, enabled !== false, "f"); return this; } strictOptions(enabled) { argsert("[boolean]", [enabled], arguments.length); __classPrivateFieldSet(this, _YargsInstance_strictOptions, enabled !== false, "f"); return this; } string(keys) { argsert("", [keys], arguments.length); this[kPopulateParserHintArray]("string", keys); this[kTrackManuallySetKeys](keys); return this; } terminalWidth() { argsert([], 0); return __classPrivateFieldGet(this, _YargsInstance_shim, "f").process.stdColumns; } updateLocale(obj) { return this.updateStrings(obj); } updateStrings(obj) { argsert("", [obj], arguments.length); __classPrivateFieldSet(this, _YargsInstance_detectLocale, false, "f"); __classPrivateFieldGet(this, _YargsInstance_shim, "f").y18n.updateLocale(obj); return this; } usage(msg, description, builder, handler3) { argsert(" [string|boolean] [function|object] [function]", [msg, description, builder, handler3], arguments.length); if (description !== void 0) { assertNotStrictEqual(msg, null, __classPrivateFieldGet(this, _YargsInstance_shim, "f")); if ((msg || "").match(/^\$0( |$)/)) { return this.command(msg, description, builder, handler3); } else { throw new YError(".usage() description must start with $0 if being used as alias for .command()"); } } else { __classPrivateFieldGet(this, _YargsInstance_usage, "f").usage(msg); return this; } } usageConfiguration(config) { argsert("", [config], arguments.length); __classPrivateFieldSet(this, _YargsInstance_usageConfig, config, "f"); return this; } version(opt, msg, ver) { const defaultVersionOpt = "version"; argsert("[boolean|string] [string] [string]", [opt, msg, ver], arguments.length); if (__classPrivateFieldGet(this, _YargsInstance_versionOpt, "f")) { this[kDeleteFromParserHintObject](__classPrivateFieldGet(this, _YargsInstance_versionOpt, "f")); __classPrivateFieldGet(this, _YargsInstance_usage, "f").version(void 0); __classPrivateFieldSet(this, _YargsInstance_versionOpt, null, "f"); } if (arguments.length === 0) { ver = this[kGuessVersion](); opt = defaultVersionOpt; } else if (arguments.length === 1) { if (opt === false) { return this; } ver = opt; opt = defaultVersionOpt; } else if (arguments.length === 2) { ver = msg; msg = void 0; } __classPrivateFieldSet(this, _YargsInstance_versionOpt, typeof opt === "string" ? opt : defaultVersionOpt, "f"); msg = msg || __classPrivateFieldGet(this, _YargsInstance_usage, "f").deferY18nLookup("Show version number"); __classPrivateFieldGet(this, _YargsInstance_usage, "f").version(ver || void 0); this.boolean(__classPrivateFieldGet(this, _YargsInstance_versionOpt, "f")); this.describe(__classPrivateFieldGet(this, _YargsInstance_versionOpt, "f"), msg); return this; } wrap(cols) { argsert("", [cols], arguments.length); __classPrivateFieldGet(this, _YargsInstance_usage, "f").wrap(cols); return this; } [(_YargsInstance_command = /* @__PURE__ */ new WeakMap(), _YargsInstance_cwd = /* @__PURE__ */ new WeakMap(), _YargsInstance_context = /* @__PURE__ */ new WeakMap(), _YargsInstance_completion = /* @__PURE__ */ new WeakMap(), _YargsInstance_completionCommand = /* @__PURE__ */ new WeakMap(), _YargsInstance_defaultShowHiddenOpt = /* @__PURE__ */ new WeakMap(), _YargsInstance_exitError = /* @__PURE__ */ new WeakMap(), _YargsInstance_detectLocale = /* @__PURE__ */ new WeakMap(), _YargsInstance_emittedWarnings = /* @__PURE__ */ new WeakMap(), _YargsInstance_exitProcess = /* @__PURE__ */ new WeakMap(), _YargsInstance_frozens = /* @__PURE__ */ new WeakMap(), _YargsInstance_globalMiddleware = /* @__PURE__ */ new WeakMap(), _YargsInstance_groups = /* @__PURE__ */ new WeakMap(), _YargsInstance_hasOutput = /* @__PURE__ */ new WeakMap(), _YargsInstance_helpOpt = /* @__PURE__ */ new WeakMap(), _YargsInstance_isGlobalContext = /* @__PURE__ */ new WeakMap(), _YargsInstance_logger = /* @__PURE__ */ new WeakMap(), _YargsInstance_output = /* @__PURE__ */ new WeakMap(), _YargsInstance_options = /* @__PURE__ */ new WeakMap(), _YargsInstance_parentRequire = /* @__PURE__ */ new WeakMap(), _YargsInstance_parserConfig = /* @__PURE__ */ new WeakMap(), _YargsInstance_parseFn = /* @__PURE__ */ new WeakMap(), _YargsInstance_parseContext = /* @__PURE__ */ new WeakMap(), _YargsInstance_pkgs = /* @__PURE__ */ new WeakMap(), _YargsInstance_preservedGroups = /* @__PURE__ */ new WeakMap(), _YargsInstance_processArgs = /* @__PURE__ */ new WeakMap(), _YargsInstance_recommendCommands = /* @__PURE__ */ new WeakMap(), _YargsInstance_shim = /* @__PURE__ */ new WeakMap(), _YargsInstance_strict = /* @__PURE__ */ new WeakMap(), _YargsInstance_strictCommands = /* @__PURE__ */ new WeakMap(), _YargsInstance_strictOptions = /* @__PURE__ */ new WeakMap(), _YargsInstance_usage = /* @__PURE__ */ new WeakMap(), _YargsInstance_usageConfig = /* @__PURE__ */ new WeakMap(), _YargsInstance_versionOpt = /* @__PURE__ */ new WeakMap(), _YargsInstance_validation = /* @__PURE__ */ new WeakMap(), kCopyDoubleDash)](argv) { if (!argv._ || !argv["--"]) return argv; argv._.push.apply(argv._, argv["--"]); try { delete argv["--"]; } catch (_err) { } return argv; } [kCreateLogger]() { return { log: (...args) => { if (!this[kHasParseCallback]()) console.log(...args); __classPrivateFieldSet(this, _YargsInstance_hasOutput, true, "f"); if (__classPrivateFieldGet(this, _YargsInstance_output, "f").length) __classPrivateFieldSet(this, _YargsInstance_output, __classPrivateFieldGet(this, _YargsInstance_output, "f") + "\n", "f"); __classPrivateFieldSet(this, _YargsInstance_output, __classPrivateFieldGet(this, _YargsInstance_output, "f") + args.join(" "), "f"); }, error: (...args) => { if (!this[kHasParseCallback]()) console.error(...args); __classPrivateFieldSet(this, _YargsInstance_hasOutput, true, "f"); if (__classPrivateFieldGet(this, _YargsInstance_output, "f").length) __classPrivateFieldSet(this, _YargsInstance_output, __classPrivateFieldGet(this, _YargsInstance_output, "f") + "\n", "f"); __classPrivateFieldSet(this, _YargsInstance_output, __classPrivateFieldGet(this, _YargsInstance_output, "f") + args.join(" "), "f"); } }; } [kDeleteFromParserHintObject](optionKey) { objectKeys(__classPrivateFieldGet(this, _YargsInstance_options, "f")).forEach((hintKey) => { if (/* @__PURE__ */ ((key) => key === "configObjects")(hintKey)) return; const hint = __classPrivateFieldGet(this, _YargsInstance_options, "f")[hintKey]; if (Array.isArray(hint)) { if (hint.includes(optionKey)) hint.splice(hint.indexOf(optionKey), 1); } else if (typeof hint === "object") { delete hint[optionKey]; } }); delete __classPrivateFieldGet(this, _YargsInstance_usage, "f").getDescriptions()[optionKey]; } [kEmitWarning](warning, type, deduplicationId) { if (!__classPrivateFieldGet(this, _YargsInstance_emittedWarnings, "f")[deduplicationId]) { __classPrivateFieldGet(this, _YargsInstance_shim, "f").process.emitWarning(warning, type); __classPrivateFieldGet(this, _YargsInstance_emittedWarnings, "f")[deduplicationId] = true; } } [kFreeze]() { __classPrivateFieldGet(this, _YargsInstance_frozens, "f").push({ options: __classPrivateFieldGet(this, _YargsInstance_options, "f"), configObjects: __classPrivateFieldGet(this, _YargsInstance_options, "f").configObjects.slice(0), exitProcess: __classPrivateFieldGet(this, _YargsInstance_exitProcess, "f"), groups: __classPrivateFieldGet(this, _YargsInstance_groups, "f"), strict: __classPrivateFieldGet(this, _YargsInstance_strict, "f"), strictCommands: __classPrivateFieldGet(this, _YargsInstance_strictCommands, "f"), strictOptions: __classPrivateFieldGet(this, _YargsInstance_strictOptions, "f"), completionCommand: __classPrivateFieldGet(this, _YargsInstance_completionCommand, "f"), output: __classPrivateFieldGet(this, _YargsInstance_output, "f"), exitError: __classPrivateFieldGet(this, _YargsInstance_exitError, "f"), hasOutput: __classPrivateFieldGet(this, _YargsInstance_hasOutput, "f"), parsed: this.parsed, parseFn: __classPrivateFieldGet(this, _YargsInstance_parseFn, "f"), parseContext: __classPrivateFieldGet(this, _YargsInstance_parseContext, "f") }); __classPrivateFieldGet(this, _YargsInstance_usage, "f").freeze(); __classPrivateFieldGet(this, _YargsInstance_validation, "f").freeze(); __classPrivateFieldGet(this, _YargsInstance_command, "f").freeze(); __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").freeze(); } [kGetDollarZero]() { let $0 = ""; let default$0; if (/\b(node|iojs|electron)(\.exe)?$/.test(__classPrivateFieldGet(this, _YargsInstance_shim, "f").process.argv()[0])) { default$0 = __classPrivateFieldGet(this, _YargsInstance_shim, "f").process.argv().slice(1, 2); } else { default$0 = __classPrivateFieldGet(this, _YargsInstance_shim, "f").process.argv().slice(0, 1); } $0 = default$0.map((x) => { const b = this[kRebase](__classPrivateFieldGet(this, _YargsInstance_cwd, "f"), x); return x.match(/^(\/|([a-zA-Z]:)?\\)/) && b.length < x.length ? b : x; }).join(" ").trim(); if (__classPrivateFieldGet(this, _YargsInstance_shim, "f").getEnv("_") && __classPrivateFieldGet(this, _YargsInstance_shim, "f").getProcessArgvBin() === __classPrivateFieldGet(this, _YargsInstance_shim, "f").getEnv("_")) { $0 = __classPrivateFieldGet(this, _YargsInstance_shim, "f").getEnv("_").replace(`${__classPrivateFieldGet(this, _YargsInstance_shim, "f").path.dirname(__classPrivateFieldGet(this, _YargsInstance_shim, "f").process.execPath())}/`, ""); } return $0; } [kGetParserConfiguration]() { return __classPrivateFieldGet(this, _YargsInstance_parserConfig, "f"); } [kGetUsageConfiguration]() { return __classPrivateFieldGet(this, _YargsInstance_usageConfig, "f"); } [kGuessLocale]() { if (!__classPrivateFieldGet(this, _YargsInstance_detectLocale, "f")) return; const locale = __classPrivateFieldGet(this, _YargsInstance_shim, "f").getEnv("LC_ALL") || __classPrivateFieldGet(this, _YargsInstance_shim, "f").getEnv("LC_MESSAGES") || __classPrivateFieldGet(this, _YargsInstance_shim, "f").getEnv("LANG") || __classPrivateFieldGet(this, _YargsInstance_shim, "f").getEnv("LANGUAGE") || "en_US"; this.locale(locale.replace(/[.:].*/, "")); } [kGuessVersion]() { const obj = this[kPkgUp](); return obj.version || "unknown"; } [kParsePositionalNumbers](argv) { const args = argv["--"] ? argv["--"] : argv._; for (let i = 0, arg; (arg = args[i]) !== void 0; i++) { if (__classPrivateFieldGet(this, _YargsInstance_shim, "f").Parser.looksLikeNumber(arg) && Number.isSafeInteger(Math.floor(parseFloat(`${arg}`)))) { args[i] = Number(arg); } } return argv; } [kPkgUp](rootPath) { const npath = rootPath || "*"; if (__classPrivateFieldGet(this, _YargsInstance_pkgs, "f")[npath]) return __classPrivateFieldGet(this, _YargsInstance_pkgs, "f")[npath]; let obj = {}; try { let startDir = rootPath || __classPrivateFieldGet(this, _YargsInstance_shim, "f").mainFilename; if (__classPrivateFieldGet(this, _YargsInstance_shim, "f").path.extname(startDir)) { startDir = __classPrivateFieldGet(this, _YargsInstance_shim, "f").path.dirname(startDir); } const pkgJsonPath = __classPrivateFieldGet(this, _YargsInstance_shim, "f").findUp(startDir, (dir, names) => { if (names.includes("package.json")) { return "package.json"; } else { return void 0; } }); assertNotStrictEqual(pkgJsonPath, void 0, __classPrivateFieldGet(this, _YargsInstance_shim, "f")); obj = JSON.parse(__classPrivateFieldGet(this, _YargsInstance_shim, "f").readFileSync(pkgJsonPath, "utf8")); } catch (_noop) { } __classPrivateFieldGet(this, _YargsInstance_pkgs, "f")[npath] = obj || {}; return __classPrivateFieldGet(this, _YargsInstance_pkgs, "f")[npath]; } [kPopulateParserHintArray](type, keys) { keys = [].concat(keys); keys.forEach((key) => { key = this[kSanitizeKey](key); __classPrivateFieldGet(this, _YargsInstance_options, "f")[type].push(key); }); } [kPopulateParserHintSingleValueDictionary](builder, type, key, value) { this[kPopulateParserHintDictionary](builder, type, key, value, (type2, key2, value2) => { __classPrivateFieldGet(this, _YargsInstance_options, "f")[type2][key2] = value2; }); } [kPopulateParserHintArrayDictionary](builder, type, key, value) { this[kPopulateParserHintDictionary](builder, type, key, value, (type2, key2, value2) => { __classPrivateFieldGet(this, _YargsInstance_options, "f")[type2][key2] = (__classPrivateFieldGet(this, _YargsInstance_options, "f")[type2][key2] || []).concat(value2); }); } [kPopulateParserHintDictionary](builder, type, key, value, singleKeyHandler) { if (Array.isArray(key)) { key.forEach((k) => { builder(k, value); }); } else if (/* @__PURE__ */ ((key2) => typeof key2 === "object")(key)) { for (const k of objectKeys(key)) { builder(k, key[k]); } } else { singleKeyHandler(type, this[kSanitizeKey](key), value); } } [kSanitizeKey](key) { if (key === "__proto__") return "___proto___"; return key; } [kSetKey](key, set) { this[kPopulateParserHintSingleValueDictionary](this[kSetKey].bind(this), "key", key, set); return this; } [kUnfreeze]() { var _a2, _b2, _c2, _d, _e, _f, _g, _h, _j, _k, _l, _m; const frozen = __classPrivateFieldGet(this, _YargsInstance_frozens, "f").pop(); assertNotStrictEqual(frozen, void 0, __classPrivateFieldGet(this, _YargsInstance_shim, "f")); let configObjects; _a2 = this, _b2 = this, _c2 = this, _d = this, _e = this, _f = this, _g = this, _h = this, _j = this, _k = this, _l = this, _m = this, { options: { set value(_o) { __classPrivateFieldSet(_a2, _YargsInstance_options, _o, "f"); } }.value, configObjects, exitProcess: { set value(_o) { __classPrivateFieldSet(_b2, _YargsInstance_exitProcess, _o, "f"); } }.value, groups: { set value(_o) { __classPrivateFieldSet(_c2, _YargsInstance_groups, _o, "f"); } }.value, output: { set value(_o) { __classPrivateFieldSet(_d, _YargsInstance_output, _o, "f"); } }.value, exitError: { set value(_o) { __classPrivateFieldSet(_e, _YargsInstance_exitError, _o, "f"); } }.value, hasOutput: { set value(_o) { __classPrivateFieldSet(_f, _YargsInstance_hasOutput, _o, "f"); } }.value, parsed: this.parsed, strict: { set value(_o) { __classPrivateFieldSet(_g, _YargsInstance_strict, _o, "f"); } }.value, strictCommands: { set value(_o) { __classPrivateFieldSet(_h, _YargsInstance_strictCommands, _o, "f"); } }.value, strictOptions: { set value(_o) { __classPrivateFieldSet(_j, _YargsInstance_strictOptions, _o, "f"); } }.value, completionCommand: { set value(_o) { __classPrivateFieldSet(_k, _YargsInstance_completionCommand, _o, "f"); } }.value, parseFn: { set value(_o) { __classPrivateFieldSet(_l, _YargsInstance_parseFn, _o, "f"); } }.value, parseContext: { set value(_o) { __classPrivateFieldSet(_m, _YargsInstance_parseContext, _o, "f"); } }.value } = frozen; __classPrivateFieldGet(this, _YargsInstance_options, "f").configObjects = configObjects; __classPrivateFieldGet(this, _YargsInstance_usage, "f").unfreeze(); __classPrivateFieldGet(this, _YargsInstance_validation, "f").unfreeze(); __classPrivateFieldGet(this, _YargsInstance_command, "f").unfreeze(); __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").unfreeze(); } [kValidateAsync](validation2, argv) { return maybeAsyncResult(argv, (result) => { validation2(result); return result; }); } getInternalMethods() { return { getCommandInstance: this[kGetCommandInstance].bind(this), getContext: this[kGetContext].bind(this), getHasOutput: this[kGetHasOutput].bind(this), getLoggerInstance: this[kGetLoggerInstance].bind(this), getParseContext: this[kGetParseContext].bind(this), getParserConfiguration: this[kGetParserConfiguration].bind(this), getUsageConfiguration: this[kGetUsageConfiguration].bind(this), getUsageInstance: this[kGetUsageInstance].bind(this), getValidationInstance: this[kGetValidationInstance].bind(this), hasParseCallback: this[kHasParseCallback].bind(this), isGlobalContext: this[kIsGlobalContext].bind(this), postProcess: this[kPostProcess].bind(this), reset: this[kReset].bind(this), runValidation: this[kRunValidation].bind(this), runYargsParserAndExecuteCommands: this[kRunYargsParserAndExecuteCommands].bind(this), setHasOutput: this[kSetHasOutput].bind(this) }; } [kGetCommandInstance]() { return __classPrivateFieldGet(this, _YargsInstance_command, "f"); } [kGetContext]() { return __classPrivateFieldGet(this, _YargsInstance_context, "f"); } [kGetHasOutput]() { return __classPrivateFieldGet(this, _YargsInstance_hasOutput, "f"); } [kGetLoggerInstance]() { return __classPrivateFieldGet(this, _YargsInstance_logger, "f"); } [kGetParseContext]() { return __classPrivateFieldGet(this, _YargsInstance_parseContext, "f") || {}; } [kGetUsageInstance]() { return __classPrivateFieldGet(this, _YargsInstance_usage, "f"); } [kGetValidationInstance]() { return __classPrivateFieldGet(this, _YargsInstance_validation, "f"); } [kHasParseCallback]() { return !!__classPrivateFieldGet(this, _YargsInstance_parseFn, "f"); } [kIsGlobalContext]() { return __classPrivateFieldGet(this, _YargsInstance_isGlobalContext, "f"); } [kPostProcess](argv, populateDoubleDash, calledFromCommand, runGlobalMiddleware) { if (calledFromCommand) return argv; if (isPromise(argv)) return argv; if (!populateDoubleDash) { argv = this[kCopyDoubleDash](argv); } const parsePositionalNumbers = this[kGetParserConfiguration]()["parse-positional-numbers"] || this[kGetParserConfiguration]()["parse-positional-numbers"] === void 0; if (parsePositionalNumbers) { argv = this[kParsePositionalNumbers](argv); } if (runGlobalMiddleware) { argv = applyMiddleware(argv, this, __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").getMiddleware(), false); } return argv; } [kReset](aliases = {}) { __classPrivateFieldSet(this, _YargsInstance_options, __classPrivateFieldGet(this, _YargsInstance_options, "f") || {}, "f"); const tmpOptions = {}; tmpOptions.local = __classPrivateFieldGet(this, _YargsInstance_options, "f").local || []; tmpOptions.configObjects = __classPrivateFieldGet(this, _YargsInstance_options, "f").configObjects || []; const localLookup = {}; tmpOptions.local.forEach((l) => { localLookup[l] = true; (aliases[l] || []).forEach((a) => { localLookup[a] = true; }); }); Object.assign(__classPrivateFieldGet(this, _YargsInstance_preservedGroups, "f"), Object.keys(__classPrivateFieldGet(this, _YargsInstance_groups, "f")).reduce((acc, groupName) => { const keys = __classPrivateFieldGet(this, _YargsInstance_groups, "f")[groupName].filter((key) => !(key in localLookup)); if (keys.length > 0) { acc[groupName] = keys; } return acc; }, {})); __classPrivateFieldSet(this, _YargsInstance_groups, {}, "f"); const arrayOptions = [ "array", "boolean", "string", "skipValidation", "count", "normalize", "number", "hiddenOptions" ]; const objectOptions = [ "narg", "key", "alias", "default", "defaultDescription", "config", "choices", "demandedOptions", "demandedCommands", "deprecatedOptions" ]; arrayOptions.forEach((k) => { tmpOptions[k] = (__classPrivateFieldGet(this, _YargsInstance_options, "f")[k] || []).filter((k2) => !localLookup[k2]); }); objectOptions.forEach((k) => { tmpOptions[k] = objFilter(__classPrivateFieldGet(this, _YargsInstance_options, "f")[k], (k2) => !localLookup[k2]); }); tmpOptions.envPrefix = __classPrivateFieldGet(this, _YargsInstance_options, "f").envPrefix; __classPrivateFieldSet(this, _YargsInstance_options, tmpOptions, "f"); __classPrivateFieldSet(this, _YargsInstance_usage, __classPrivateFieldGet(this, _YargsInstance_usage, "f") ? __classPrivateFieldGet(this, _YargsInstance_usage, "f").reset(localLookup) : usage(this, __classPrivateFieldGet(this, _YargsInstance_shim, "f")), "f"); __classPrivateFieldSet(this, _YargsInstance_validation, __classPrivateFieldGet(this, _YargsInstance_validation, "f") ? __classPrivateFieldGet(this, _YargsInstance_validation, "f").reset(localLookup) : validation(this, __classPrivateFieldGet(this, _YargsInstance_usage, "f"), __classPrivateFieldGet(this, _YargsInstance_shim, "f")), "f"); __classPrivateFieldSet(this, _YargsInstance_command, __classPrivateFieldGet(this, _YargsInstance_command, "f") ? __classPrivateFieldGet(this, _YargsInstance_command, "f").reset() : command(__classPrivateFieldGet(this, _YargsInstance_usage, "f"), __classPrivateFieldGet(this, _YargsInstance_validation, "f"), __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f"), __classPrivateFieldGet(this, _YargsInstance_shim, "f")), "f"); if (!__classPrivateFieldGet(this, _YargsInstance_completion, "f")) __classPrivateFieldSet(this, _YargsInstance_completion, completion(this, __classPrivateFieldGet(this, _YargsInstance_usage, "f"), __classPrivateFieldGet(this, _YargsInstance_command, "f"), __classPrivateFieldGet(this, _YargsInstance_shim, "f")), "f"); __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").reset(); __classPrivateFieldSet(this, _YargsInstance_completionCommand, null, "f"); __classPrivateFieldSet(this, _YargsInstance_output, "", "f"); __classPrivateFieldSet(this, _YargsInstance_exitError, null, "f"); __classPrivateFieldSet(this, _YargsInstance_hasOutput, false, "f"); this.parsed = false; return this; } [kRebase](base, dir) { return __classPrivateFieldGet(this, _YargsInstance_shim, "f").path.relative(base, dir); } [kRunYargsParserAndExecuteCommands](args, shortCircuit, calledFromCommand, commandIndex = 0, helpOnly = false) { var _a2, _b2, _c2, _d; let skipValidation = !!calledFromCommand || helpOnly; args = args || __classPrivateFieldGet(this, _YargsInstance_processArgs, "f"); __classPrivateFieldGet(this, _YargsInstance_options, "f").__ = __classPrivateFieldGet(this, _YargsInstance_shim, "f").y18n.__; __classPrivateFieldGet(this, _YargsInstance_options, "f").configuration = this[kGetParserConfiguration](); const populateDoubleDash = !!__classPrivateFieldGet(this, _YargsInstance_options, "f").configuration["populate--"]; const config = Object.assign({}, __classPrivateFieldGet(this, _YargsInstance_options, "f").configuration, { "populate--": true }); const parsed = __classPrivateFieldGet(this, _YargsInstance_shim, "f").Parser.detailed(args, Object.assign({}, __classPrivateFieldGet(this, _YargsInstance_options, "f"), { configuration: { "parse-positional-numbers": false, ...config } })); const argv = Object.assign(parsed.argv, __classPrivateFieldGet(this, _YargsInstance_parseContext, "f")); let argvPromise = void 0; const aliases = parsed.aliases; let helpOptSet = false; let versionOptSet = false; Object.keys(argv).forEach((key) => { if (key === __classPrivateFieldGet(this, _YargsInstance_helpOpt, "f") && argv[key]) { helpOptSet = true; } else if (key === __classPrivateFieldGet(this, _YargsInstance_versionOpt, "f") && argv[key]) { versionOptSet = true; } }); argv.$0 = this.$0; this.parsed = parsed; if (commandIndex === 0) { __classPrivateFieldGet(this, _YargsInstance_usage, "f").clearCachedHelpMessage(); } try { this[kGuessLocale](); if (shortCircuit) { return this[kPostProcess](argv, populateDoubleDash, !!calledFromCommand, false); } if (__classPrivateFieldGet(this, _YargsInstance_helpOpt, "f")) { const helpCmds = [__classPrivateFieldGet(this, _YargsInstance_helpOpt, "f")].concat(aliases[__classPrivateFieldGet(this, _YargsInstance_helpOpt, "f")] || []).filter((k) => k.length > 1); if (helpCmds.includes("" + argv._[argv._.length - 1])) { argv._.pop(); helpOptSet = true; } } __classPrivateFieldSet(this, _YargsInstance_isGlobalContext, false, "f"); const handlerKeys = __classPrivateFieldGet(this, _YargsInstance_command, "f").getCommands(); const requestCompletions = ((_a2 = __classPrivateFieldGet(this, _YargsInstance_completion, "f")) === null || _a2 === void 0 ? void 0 : _a2.completionKey) ? [ (_b2 = __classPrivateFieldGet(this, _YargsInstance_completion, "f")) === null || _b2 === void 0 ? void 0 : _b2.completionKey, ...(_d = this.getAliases()[(_c2 = __classPrivateFieldGet(this, _YargsInstance_completion, "f")) === null || _c2 === void 0 ? void 0 : _c2.completionKey]) !== null && _d !== void 0 ? _d : [] ].some((key) => Object.prototype.hasOwnProperty.call(argv, key)) : false; const skipRecommendation = helpOptSet || requestCompletions || helpOnly; if (argv._.length) { if (handlerKeys.length) { let firstUnknownCommand; for (let i = commandIndex || 0, cmd; argv._[i] !== void 0; i++) { cmd = String(argv._[i]); if (handlerKeys.includes(cmd) && cmd !== __classPrivateFieldGet(this, _YargsInstance_completionCommand, "f")) { const innerArgv = __classPrivateFieldGet(this, _YargsInstance_command, "f").runCommand(cmd, this, parsed, i + 1, helpOnly, helpOptSet || versionOptSet || helpOnly); return this[kPostProcess](innerArgv, populateDoubleDash, !!calledFromCommand, false); } else if (!firstUnknownCommand && cmd !== __classPrivateFieldGet(this, _YargsInstance_completionCommand, "f")) { firstUnknownCommand = cmd; break; } } if (!__classPrivateFieldGet(this, _YargsInstance_command, "f").hasDefaultCommand() && __classPrivateFieldGet(this, _YargsInstance_recommendCommands, "f") && firstUnknownCommand && !skipRecommendation) { __classPrivateFieldGet(this, _YargsInstance_validation, "f").recommendCommands(firstUnknownCommand, handlerKeys); } } if (__classPrivateFieldGet(this, _YargsInstance_completionCommand, "f") && argv._.includes(__classPrivateFieldGet(this, _YargsInstance_completionCommand, "f")) && !requestCompletions) { if (__classPrivateFieldGet(this, _YargsInstance_exitProcess, "f")) setBlocking(true); this.showCompletionScript(); this.exit(0); } } if (__classPrivateFieldGet(this, _YargsInstance_command, "f").hasDefaultCommand() && !skipRecommendation) { const innerArgv = __classPrivateFieldGet(this, _YargsInstance_command, "f").runCommand(null, this, parsed, 0, helpOnly, helpOptSet || versionOptSet || helpOnly); return this[kPostProcess](innerArgv, populateDoubleDash, !!calledFromCommand, false); } if (requestCompletions) { if (__classPrivateFieldGet(this, _YargsInstance_exitProcess, "f")) setBlocking(true); args = [].concat(args); const completionArgs = args.slice(args.indexOf(`--${__classPrivateFieldGet(this, _YargsInstance_completion, "f").completionKey}`) + 1); __classPrivateFieldGet(this, _YargsInstance_completion, "f").getCompletion(completionArgs, (err, completions) => { if (err) throw new YError(err.message); (completions || []).forEach((completion2) => { __classPrivateFieldGet(this, _YargsInstance_logger, "f").log(completion2); }); this.exit(0); }); return this[kPostProcess](argv, !populateDoubleDash, !!calledFromCommand, false); } if (!__classPrivateFieldGet(this, _YargsInstance_hasOutput, "f")) { if (helpOptSet) { if (__classPrivateFieldGet(this, _YargsInstance_exitProcess, "f")) setBlocking(true); skipValidation = true; this.showHelp((message) => { __classPrivateFieldGet(this, _YargsInstance_logger, "f").log(message); this.exit(0); }); } else if (versionOptSet) { if (__classPrivateFieldGet(this, _YargsInstance_exitProcess, "f")) setBlocking(true); skipValidation = true; __classPrivateFieldGet(this, _YargsInstance_usage, "f").showVersion("log"); this.exit(0); } } if (!skipValidation && __classPrivateFieldGet(this, _YargsInstance_options, "f").skipValidation.length > 0) { skipValidation = Object.keys(argv).some((key) => __classPrivateFieldGet(this, _YargsInstance_options, "f").skipValidation.indexOf(key) >= 0 && argv[key] === true); } if (!skipValidation) { if (parsed.error) throw new YError(parsed.error.message); if (!requestCompletions) { const validation2 = this[kRunValidation](aliases, {}, parsed.error); if (!calledFromCommand) { argvPromise = applyMiddleware(argv, this, __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").getMiddleware(), true); } argvPromise = this[kValidateAsync](validation2, argvPromise !== null && argvPromise !== void 0 ? argvPromise : argv); if (isPromise(argvPromise) && !calledFromCommand) { argvPromise = argvPromise.then(() => { return applyMiddleware(argv, this, __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").getMiddleware(), false); }); } } } } catch (err) { if (err instanceof YError) __classPrivateFieldGet(this, _YargsInstance_usage, "f").fail(err.message, err); else throw err; } return this[kPostProcess](argvPromise !== null && argvPromise !== void 0 ? argvPromise : argv, populateDoubleDash, !!calledFromCommand, true); } [kRunValidation](aliases, positionalMap, parseErrors, isDefaultCommand) { const demandedOptions = { ...this.getDemandedOptions() }; return (argv) => { if (parseErrors) throw new YError(parseErrors.message); __classPrivateFieldGet(this, _YargsInstance_validation, "f").nonOptionCount(argv); __classPrivateFieldGet(this, _YargsInstance_validation, "f").requiredArguments(argv, demandedOptions); let failedStrictCommands = false; if (__classPrivateFieldGet(this, _YargsInstance_strictCommands, "f")) { failedStrictCommands = __classPrivateFieldGet(this, _YargsInstance_validation, "f").unknownCommands(argv); } if (__classPrivateFieldGet(this, _YargsInstance_strict, "f") && !failedStrictCommands) { __classPrivateFieldGet(this, _YargsInstance_validation, "f").unknownArguments(argv, aliases, positionalMap, !!isDefaultCommand); } else if (__classPrivateFieldGet(this, _YargsInstance_strictOptions, "f")) { __classPrivateFieldGet(this, _YargsInstance_validation, "f").unknownArguments(argv, aliases, {}, false, false); } __classPrivateFieldGet(this, _YargsInstance_validation, "f").limitedChoices(argv); __classPrivateFieldGet(this, _YargsInstance_validation, "f").implications(argv); __classPrivateFieldGet(this, _YargsInstance_validation, "f").conflicting(argv); }; } [kSetHasOutput]() { __classPrivateFieldSet(this, _YargsInstance_hasOutput, true, "f"); } [kTrackManuallySetKeys](keys) { if (typeof keys === "string") { __classPrivateFieldGet(this, _YargsInstance_options, "f").key[keys] = true; } else { for (const k of keys) { __classPrivateFieldGet(this, _YargsInstance_options, "f").key[k] = true; } } } }; function isYargsInstance(y) { return !!y && typeof y.getInternalMethods === "function"; } var Yargs = YargsFactory(esm_default); init_supports_color(); var ChildProcess = class { static spawnInteractive(command2, args, options = {}) { return new Promise((resolve5, reject) => { const commandText = `${command2} ${args.join(" ")}`; Log.debug(`Executing command: ${commandText}`); const childProcess = _spawn(command2, args, { ...options, stdio: "inherit" }); childProcess.on("close", (status) => status === 0 ? resolve5() : reject(status)); }); } static spawnSync(command2, args, options = {}) { const commandText = `${command2} ${args.join(" ")}`; const env22 = getEnvironmentForNonInteractiveCommand(options.env); Log.debug(`Executing command: ${commandText}`); const { status: exitCode, signal, stdout, stderr } = _spawnSync(command2, args, { ...options, env: env22, encoding: "utf8", stdio: "pipe" }); const status = statusFromExitCodeAndSignal(exitCode, signal); if (status === 0 || options.suppressErrorOnFailingExitCode) { return { status, stdout, stderr }; } throw new Error(stderr); } static spawn(command2, args, options = {}) { const commandText = `${command2} ${args.join(" ")}`; const env22 = getEnvironmentForNonInteractiveCommand(options.env); return processAsyncCmd(commandText, options, _spawn(command2, args, { ...options, env: env22, stdio: "pipe" })); } static exec(command2, options = {}) { const env22 = getEnvironmentForNonInteractiveCommand(options.env); return processAsyncCmd(command2, options, _exec(command2, { ...options, env: env22 })); } }; function statusFromExitCodeAndSignal(exitCode, signal) { return exitCode ?? signal ?? -1; } function getEnvironmentForNonInteractiveCommand(userProvidedEnv) { const forceColorValue = supports_color_default.stdout !== false ? supports_color_default.stdout.level.toString() : void 0; return { FORCE_COLOR: forceColorValue, ...userProvidedEnv ?? process.env }; } function processAsyncCmd(command2, options, childProcess) { return new Promise((resolve5, reject) => { let logOutput = ""; let stdout = ""; let stderr = ""; Log.debug(`Executing command: ${command2}`); if (options.input !== void 0) { assert(childProcess.stdin, "Cannot write process `input` if there is no pipe `stdin` channel."); childProcess.stdin.write(options.input); childProcess.stdin.end(); } childProcess.stderr?.on("data", (message) => { stderr += message; logOutput += message; if (options.mode === void 0 || options.mode === "enabled") { process.stderr.write(message); } }); childProcess.stdout?.on("data", (message) => { stdout += message; logOutput += message; if (options.mode === void 0 || options.mode === "enabled") { process.stderr.write(message); } }); childProcess.on("close", (exitCode, signal) => { const exitDescription = exitCode !== null ? `exit code "${exitCode}"` : `signal "${signal}"`; const status = statusFromExitCodeAndSignal(exitCode, signal); const printFn = status !== 0 && options.mode === "on-error" ? Log.error : Log.debug; printFn(`Command "${command2}" completed with ${exitDescription}.`); printFn(`Process output: ${logOutput}`); if (status === 0 || options.suppressErrorOnFailingExitCode) { resolve5({ stdout, stderr, status }); } else { reject(options.mode === "silent" ? logOutput : void 0); } }); }); } function determineRepoBaseDirFromCwd() { const { stdout, stderr, status } = ChildProcess.spawnSync("git", ["rev-parse", "--show-toplevel"]); if (status !== 0) { throw Error(`Unable to find the path to the base directory of the repository. Was the command run from inside of the repo? ${stderr}`); } return stdout.trim(); } var LogLevel; (function(LogLevel2) { LogLevel2[LogLevel2["SILENT"] = 0] = "SILENT"; LogLevel2[LogLevel2["ERROR"] = 1] = "ERROR"; LogLevel2[LogLevel2["WARN"] = 2] = "WARN"; LogLevel2[LogLevel2["LOG"] = 3] = "LOG"; LogLevel2[LogLevel2["INFO"] = 4] = "INFO"; LogLevel2[LogLevel2["DEBUG"] = 5] = "DEBUG"; })(LogLevel || (LogLevel = {})); var DEFAULT_LOG_LEVEL = LogLevel.INFO; var red = styleText.bind(null, "red"); var green = styleText.bind(null, "green"); var yellow = styleText.bind(null, "yellow"); var bold = styleText.bind(null, "bold"); var blue = styleText.bind(null, "blue"); var underline = styleText.bind(null, "underline"); var Log = class { }; Log.info = buildLogLevelFunction(() => console.info, LogLevel.INFO, null); Log.error = buildLogLevelFunction(() => console.error, LogLevel.ERROR, red); Log.debug = buildLogLevelFunction(() => console.debug, LogLevel.DEBUG, null); Log.log = buildLogLevelFunction(() => console.log, LogLevel.LOG, null); Log.warn = buildLogLevelFunction(() => console.warn, LogLevel.WARN, yellow); function buildLogLevelFunction(loadCommand, level, defaultColor) { return (...values) => { runConsoleCommand(loadCommand, level, ...values.map((v) => typeof v === "string" && defaultColor ? defaultColor(v) : v)); }; } function runConsoleCommand(loadCommand, logLevel, ...text) { if (getLogLevel() >= logLevel) { loadCommand()(...text); } appendToLogFile(logLevel, ...text); } function getLogLevel() { const logLevel = Object.keys(LogLevel).indexOf((process.env[`LOG_LEVEL`] || "").toUpperCase()); if (logLevel === -1) { return DEFAULT_LOG_LEVEL; } return logLevel; } var LOG_LEVEL_COLUMNS = 7; var logStream = void 0; function appendToLogFile(logLevel, ...text) { if (logStream === void 0) { return; } if (logLevel === void 0) { logStream.write(text.join(" ") + "\n"); return; } const logLevelText = `${LogLevel[logLevel]}:`.padEnd(LOG_LEVEL_COLUMNS); logStream.write(stripVTControlCharacters(text.join(" ").split("\n").map((l) => `${logLevelText} ${l} `).join(""))); } var cachedConfig = null; function setCachedConfig(config) { cachedConfig = config; } function getCachedConfig() { return cachedConfig; } var CONFIG_FILE_PATH_MATCHER = ".ng-dev/config.mjs"; async function getConfig(baseDirOrAssertions) { let cachedConfig2 = getCachedConfig(); if (cachedConfig2 === null) { let baseDir; if (typeof baseDirOrAssertions === "string") { baseDir = baseDirOrAssertions; } else { baseDir = determineRepoBaseDirFromCwd(); } const configPath = join3(baseDir, CONFIG_FILE_PATH_MATCHER); cachedConfig2 = await readConfigFile(configPath); setCachedConfig(cachedConfig2); } if (Array.isArray(baseDirOrAssertions)) { for (const assertion of baseDirOrAssertions) { assertion(cachedConfig2); } } return { ...cachedConfig2, __isNgDevConfigObject: true }; } var ConfigValidationError = class extends Error { constructor(message, errors = []) { super(message); this.errors = errors; } }; function assertValidGithubConfig(config) { const errors = []; if (config.github === void 0) { errors.push(`Github repository not configured. Set the "github" option.`); } else { if (config.github.name === void 0) { errors.push(`"github.name" is not defined`); } if (config.github.owner === void 0) { errors.push(`"github.owner" is not defined`); } if (config.github.mergeMode === void 0) { errors.push(`"github.mergeMode" is not defined`); } } if (errors.length) { throw new ConfigValidationError("Invalid `github` configuration", errors); } } async function readConfigFile(configPath, returnEmptyObjectOnError = false) { try { return await import(pathToFileURL(configPath).toString()); } catch (e) { if (returnEmptyObjectOnError) { Log.debug(`Could not read configuration file at ${configPath}, returning empty object instead.`); Log.debug(e); return {}; } Log.error(`Could not read configuration file at ${configPath}.`); Log.error(e); process.exit(1); } } // import { spawnSync as spawnSync2 } from "child_process"; import { URL as URL2 } from "url"; var import_lockfile = __toESM(require_lockfile(), 1); var require5 = __cjsCompatRequire_ngDev4(import.meta.url); var require_fast_content_type_parse2 = __commonJS2({ ""(exports, module) { "use strict"; var NullObject = function NullObject2() { }; NullObject.prototype = /* @__PURE__ */ Object.create(null); var paramRE = /; *([!#$%&'*+.^\w`|~-]+)=("(?:[\v\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\v\u0020-\u00ff])*"|[!#$%&'*+.^\w`|~-]+) */gu; var quotedPairRE = /\\([\v\u0020-\u00ff])/gu; var mediaTypeRE = /^[!#$%&'*+.^\w|~-]+\/[!#$%&'*+.^\w|~-]+$/u; var defaultContentType = { type: "", parameters: new NullObject() }; Object.freeze(defaultContentType.parameters); Object.freeze(defaultContentType); function parse22(header) { if (typeof header !== "string") { throw new TypeError("argument header is required and must be a string"); } let index = header.indexOf(";"); const type = index !== -1 ? header.slice(0, index).trim() : header.trim(); if (mediaTypeRE.test(type) === false) { throw new TypeError("invalid media type"); } const result = { type: type.toLowerCase(), parameters: new NullObject() }; if (index === -1) { return result; } let key; let match; let value; paramRE.lastIndex = index; while (match = paramRE.exec(header)) { if (match.index !== index) { throw new TypeError("invalid parameter format"); } index += match[0].length; key = match[1].toLowerCase(); value = match[2]; if (value[0] === '"') { value = value.slice(1, value.length - 1); quotedPairRE.test(value) && (value = value.replace(quotedPairRE, "$1")); } result.parameters[key] = value; } if (index !== header.length) { throw new TypeError("invalid parameter format"); } return result; } function safeParse2(header) { if (typeof header !== "string") { return defaultContentType; } let index = header.indexOf(";"); const type = index !== -1 ? header.slice(0, index).trim() : header.trim(); if (mediaTypeRE.test(type) === false) { return defaultContentType; } const result = { type: type.toLowerCase(), parameters: new NullObject() }; if (index === -1) { return result; } let key; let match; let value; paramRE.lastIndex = index; while (match = paramRE.exec(header)) { if (match.index !== index) { return defaultContentType; } index += match[0].length; key = match[1].toLowerCase(); value = match[2]; if (value[0] === '"') { value = value.slice(1, value.length - 1); quotedPairRE.test(value) && (value = value.replace(quotedPairRE, "$1")); } result.parameters[key] = value; } if (index !== header.length) { return defaultContentType; } return result; } module.exports.default = { parse: parse22, safeParse: safeParse2 }; module.exports.parse = parse22; module.exports.safeParse = safeParse2; module.exports.defaultContentType = defaultContentType; } }); var require_constants = __commonJS2({ ""(exports, module) { "use strict"; var SEMVER_SPEC_VERSION = "2.0.0"; var MAX_LENGTH = 256; var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */ 9007199254740991; var MAX_SAFE_COMPONENT_LENGTH = 16; var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6; var RELEASE_TYPES = [ "major", "premajor", "minor", "preminor", "patch", "prepatch", "prerelease" ]; module.exports = { MAX_LENGTH, MAX_SAFE_COMPONENT_LENGTH, MAX_SAFE_BUILD_LENGTH, MAX_SAFE_INTEGER, RELEASE_TYPES, SEMVER_SPEC_VERSION, FLAG_INCLUDE_PRERELEASE: 1, FLAG_LOOSE: 2 }; } }); var require_debug = __commonJS2({ ""(exports, module) { "use strict"; var debug2 = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => { }; module.exports = debug2; } }); var require_re = __commonJS2({ ""(exports, module) { "use strict"; var { MAX_SAFE_COMPONENT_LENGTH, MAX_SAFE_BUILD_LENGTH, MAX_LENGTH } = require_constants(); var debug2 = require_debug(); exports = module.exports = {}; var re = exports.re = []; var safeRe = exports.safeRe = []; var src = exports.src = []; var safeSrc = exports.safeSrc = []; var t = exports.t = {}; var R = 0; var LETTERDASHNUMBER = "[a-zA-Z0-9-]"; var safeRegexReplacements = [ ["\\s", 1], ["\\d", MAX_LENGTH], [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH] ]; var makeSafeRegex = (value) => { for (const [token, max] of safeRegexReplacements) { value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`); } return value; }; var createToken = (name, value, isGlobal) => { const safe = makeSafeRegex(value); const index = R++; debug2(name, index, value); t[name] = index; src[index] = value; safeSrc[index] = safe; re[index] = new RegExp(value, isGlobal ? "g" : void 0); safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0); }; createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*"); createToken("NUMERICIDENTIFIERLOOSE", "\\d+"); createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`); createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`); createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`); createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIER]})`); createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIERLOOSE]})`); createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`); createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`); createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`); createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`); createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`); createToken("FULL", `^${src[t.FULLPLAIN]}$`); createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`); createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`); createToken("GTLT", "((?:<|>)?=?)"); 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]}?)?)?`); createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`); createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`); createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`); createToken("COERCEPLAIN", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`); createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`); createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`); createToken("COERCERTL", src[t.COERCE], true); createToken("COERCERTLFULL", src[t.COERCEFULL], true); createToken("LONETILDE", "(?:~>?)"); createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true); exports.tildeTrimReplace = "$1~"; createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`); createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`); createToken("LONECARET", "(?:\\^)"); createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true); exports.caretTrimReplace = "$1^"; createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`); createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`); createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`); createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`); createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true); exports.comparatorTrimReplace = "$1$2$3"; createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`); createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`); createToken("STAR", "(<|>)?=?\\s*\\*"); createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$"); createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$"); } }); var require_parse_options = __commonJS2({ ""(exports, module) { "use strict"; var looseOption = Object.freeze({ loose: true }); var emptyOpts = Object.freeze({}); var parseOptions = (options) => { if (!options) { return emptyOpts; } if (typeof options !== "object") { return looseOption; } return options; }; module.exports = parseOptions; } }); var require_identifiers = __commonJS2({ ""(exports, module) { "use strict"; var numeric = /^[0-9]+$/; var compareIdentifiers = (a, b) => { if (typeof a === "number" && typeof b === "number") { return a === b ? 0 : a < b ? -1 : 1; } const anum = numeric.test(a); const bnum = numeric.test(b); if (anum && bnum) { a = +a; b = +b; } return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1; }; var rcompareIdentifiers = (a, b) => compareIdentifiers(b, a); module.exports = { compareIdentifiers, rcompareIdentifiers }; } }); var require_semver = __commonJS2({ ""(exports, module) { "use strict"; var debug2 = require_debug(); var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants(); var { safeRe: re, t } = require_re(); var parseOptions = require_parse_options(); var { compareIdentifiers } = require_identifiers(); var SemVer = class _SemVer { constructor(version, options) { options = parseOptions(options); 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. Must be a string. Got type "${typeof version}".`); } if (version.length > MAX_LENGTH) { throw new TypeError( `version is longer than ${MAX_LENGTH} characters` ); } debug2("SemVer", version, options); this.options = options; this.loose = !!options.loose; this.includePrerelease = !!options.includePrerelease; const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]); if (!m) { throw new TypeError(`Invalid Version: ${version}`); } this.raw = version; this.major = +m[1]; this.minor = +m[2]; this.patch = +m[3]; if (this.major > MAX_SAFE_INTEGER || this.major < 0) { throw new TypeError("Invalid major version"); } if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { throw new TypeError("Invalid minor version"); } if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { throw new TypeError("Invalid patch version"); } 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; }); } this.build = m[5] ? m[5].split(".") : []; this.format(); } format() { this.version = `${this.major}.${this.minor}.${this.patch}`; if (this.prerelease.length) { this.version += `-${this.prerelease.join(".")}`; } return this.version; } toString() { return this.version; } compare(other) { debug2("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 (other.version === this.version) { return 0; } return this.compareMain(other) || this.comparePre(other); } compareMain(other) { if (!(other instanceof _SemVer)) { other = new _SemVer(other, this.options); } if (this.major < other.major) { return -1; } if (this.major > other.major) { return 1; } if (this.minor < other.minor) { return -1; } if (this.minor > other.minor) { return 1; } if (this.patch < other.patch) { return -1; } if (this.patch > other.patch) { return 1; } return 0; } comparePre(other) { if (!(other instanceof _SemVer)) { other = new _SemVer(other, this.options); } 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; } let i = 0; do { const a = this.prerelease[i]; const b = other.prerelease[i]; debug2("prerelease compare", i, a, b); if (a === void 0 && b === void 0) { return 0; } else if (b === void 0) { return 1; } else if (a === void 0) { return -1; } else if (a === b) { continue; } else { return compareIdentifiers(a, b); } } while (++i); } 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]; debug2("build compare", i, a, b); if (a === void 0 && b === void 0) { return 0; } else if (b === void 0) { return 1; } else if (a === void 0) { return -1; } else if (a === b) { continue; } else { return compareIdentifiers(a, b); } } while (++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, identifierBase) { if (release.startsWith("pre")) { if (!identifier && identifierBase === false) { throw new Error("invalid increment argument: identifier is empty"); } if (identifier) { const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]); if (!match || match[1] !== identifier) { throw new Error(`invalid identifier: ${identifier}`); } } } 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": this.prerelease.length = 0; this.inc("patch", identifier, identifierBase); this.inc("pre", identifier, identifierBase); break; case "prerelease": if (this.prerelease.length === 0) { this.inc("patch", identifier, identifierBase); } this.inc("pre", identifier, identifierBase); break; case "release": if (this.prerelease.length === 0) { throw new Error(`version ${this.raw} is not a prerelease`); } this.prerelease.length = 0; break; case "major": 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.patch !== 0 || this.prerelease.length === 0) { this.minor++; } this.patch = 0; this.prerelease = []; break; case "patch": if (this.prerelease.length === 0) { this.patch++; } this.prerelease = []; break; case "pre": { const base = Number(identifierBase) ? 1 : 0; 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) { if (identifier === this.prerelease.join(".") && identifierBase === false) { throw new Error("invalid increment argument: identifier already exists"); } this.prerelease.push(base); } } if (identifier) { 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.raw = this.format(); if (this.build.length) { this.raw += `+${this.build.join(".")}`; } return this; } }; module.exports = SemVer; } }); var require_parse = __commonJS2({ ""(exports, module) { "use strict"; var SemVer = require_semver(); var parse22 = (version, options, throwErrors = false) => { if (version instanceof SemVer) { return version; } try { return new SemVer(version, options); } catch (er) { if (!throwErrors) { return null; } throw er; } }; module.exports = parse22; } }); var require_valid = __commonJS2({ ""(exports, module) { "use strict"; var parse22 = require_parse(); var valid = (version, options) => { const v = parse22(version, options); return v ? v.version : null; }; module.exports = valid; } }); var require_clean = __commonJS2({ ""(exports, module) { "use strict"; var parse22 = require_parse(); var clean = (version, options) => { const s = parse22(version.trim().replace(/^[=v]+/, ""), options); return s ? s.version : null; }; module.exports = clean; } }); var require_inc = __commonJS2({ ""(exports, module) { "use strict"; var SemVer = require_semver(); var inc = (version, release, options, identifier, identifierBase) => { if (typeof options === "string") { identifierBase = identifier; identifier = options; options = void 0; } try { return new SemVer( version instanceof SemVer ? version.version : version, options ).inc(release, identifier, identifierBase).version; } catch (er) { return null; } }; module.exports = inc; } }); var require_diff = __commonJS2({ ""(exports, module) { "use strict"; var parse22 = require_parse(); var diff = (version1, version2) => { const v1 = parse22(version1, null, true); const v2 = parse22(version2, null, true); const comparison = v1.compare(v2); if (comparison === 0) { return null; } const v1Higher = comparison > 0; const highVersion = v1Higher ? v1 : v2; const lowVersion = v1Higher ? v2 : v1; const highHasPre = !!highVersion.prerelease.length; const lowHasPre = !!lowVersion.prerelease.length; if (lowHasPre && !highHasPre) { if (!lowVersion.patch && !lowVersion.minor) { return "major"; } if (lowVersion.compareMain(highVersion) === 0) { if (lowVersion.minor && !lowVersion.patch) { return "minor"; } return "patch"; } } const prefix = highHasPre ? "pre" : ""; if (v1.major !== v2.major) { return prefix + "major"; } if (v1.minor !== v2.minor) { return prefix + "minor"; } if (v1.patch !== v2.patch) { return prefix + "patch"; } return "prerelease"; }; module.exports = diff; } }); var require_major = __commonJS2({ ""(exports, module) { "use strict"; var SemVer = require_semver(); var major = (a, loose) => new SemVer(a, loose).major; module.exports = major; } }); var require_minor = __commonJS2({ ""(exports, module) { "use strict"; var SemVer = require_semver(); var minor = (a, loose) => new SemVer(a, loose).minor; module.exports = minor; } }); var require_patch = __commonJS2({ ""(exports, module) { "use strict"; var SemVer = require_semver(); var patch = (a, loose) => new SemVer(a, loose).patch; module.exports = patch; } }); var require_prerelease = __commonJS2({ ""(exports, module) { "use strict"; var parse22 = require_parse(); var prerelease = (version, options) => { const parsed = parse22(version, options); return parsed && parsed.prerelease.length ? parsed.prerelease : null; }; module.exports = prerelease; } }); var require_compare = __commonJS2({ ""(exports, module) { "use strict"; var SemVer = require_semver(); var compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose)); module.exports = compare; } }); var require_rcompare = __commonJS2({ ""(exports, module) { "use strict"; var compare = require_compare(); var rcompare = (a, b, loose) => compare(b, a, loose); module.exports = rcompare; } }); var require_compare_loose = __commonJS2({ ""(exports, module) { "use strict"; var compare = require_compare(); var compareLoose = (a, b) => compare(a, b, true); module.exports = compareLoose; } }); var require_compare_build = __commonJS2({ ""(exports, module) { "use strict"; var SemVer = require_semver(); var 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; } }); var require_sort = __commonJS2({ ""(exports, module) { "use strict"; var compareBuild = require_compare_build(); var sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose)); module.exports = sort; } }); var require_rsort = __commonJS2({ ""(exports, module) { "use strict"; var compareBuild = require_compare_build(); var rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose)); module.exports = rsort; } }); var require_gt = __commonJS2({ ""(exports, module) { "use strict"; var compare = require_compare(); var gt = (a, b, loose) => compare(a, b, loose) > 0; module.exports = gt; } }); var require_lt = __commonJS2({ ""(exports, module) { "use strict"; var compare = require_compare(); var lt = (a, b, loose) => compare(a, b, loose) < 0; module.exports = lt; } }); var require_eq = __commonJS2({ ""(exports, module) { "use strict"; var compare = require_compare(); var eq = (a, b, loose) => compare(a, b, loose) === 0; module.exports = eq; } }); var require_neq = __commonJS2({ ""(exports, module) { "use strict"; var compare = require_compare(); var neq = (a, b, loose) => compare(a, b, loose) !== 0; module.exports = neq; } }); var require_gte = __commonJS2({ ""(exports, module) { "use strict"; var compare = require_compare(); var gte = (a, b, loose) => compare(a, b, loose) >= 0; module.exports = gte; } }); var require_lte = __commonJS2({ ""(exports, module) { "use strict"; var compare = require_compare(); var lte = (a, b, loose) => compare(a, b, loose) <= 0; module.exports = lte; } }); var require_cmp = __commonJS2({ ""(exports, module) { "use strict"; var eq = require_eq(); var neq = require_neq(); var gt = require_gt(); var gte = require_gte(); var lt = require_lt(); var lte = require_lte(); var 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; case "!==": if (typeof a === "object") { a = a.version; } if (typeof b === "object") { b = b.version; } return a !== b; case "": case "=": case "==": return eq(a, b, loose); case "!=": return neq(a, b, loose); case ">": return gt(a, b, loose); case ">=": return gte(a, b, loose); case "<": return lt(a, b, loose); case "<=": return lte(a, b, loose); default: throw new TypeError(`Invalid operator: ${op}`); } }; module.exports = cmp; } }); var require_coerce = __commonJS2({ ""(exports, module) { "use strict"; var SemVer = require_semver(); var parse22 = require_parse(); var { safeRe: re, t } = require_re(); var coerce = (version, options) => { if (version instanceof SemVer) { return version; } if (typeof version === "number") { version = String(version); } if (typeof version !== "string") { return null; } options = options || {}; let match = null; if (!options.rtl) { match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]); } else { const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL]; let next; while ((next = coerceRtlRegex.exec(version)) && (!match || match.index + match[0].length !== version.length)) { if (!match || next.index + next[0].length !== match.index + match[0].length) { match = next; } coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length; } coerceRtlRegex.lastIndex = -1; } if (match === null) { return null; } const major = match[2]; const minor = match[3] || "0"; const patch = match[4] || "0"; const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : ""; const build = options.includePrerelease && match[6] ? `+${match[6]}` : ""; return parse22(`${major}.${minor}.${patch}${prerelease}${build}`, options); }; module.exports = coerce; } }); var require_lrucache = __commonJS2({ ""(exports, module) { "use strict"; var LRUCache = class { constructor() { this.max = 1e3; this.map = /* @__PURE__ */ new Map(); } get(key) { const value = this.map.get(key); if (value === void 0) { return void 0; } else { this.map.delete(key); this.map.set(key, value); return value; } } delete(key) { return this.map.delete(key); } set(key, value) { const deleted = this.delete(key); if (!deleted && value !== void 0) { if (this.map.size >= this.max) { const firstKey = this.map.keys().next().value; this.delete(firstKey); } this.map.set(key, value); } return this; } }; module.exports = LRUCache; } }); var require_range = __commonJS2({ ""(exports, module) { "use strict"; var SPACE_CHARACTERS = /\s+/g; var Range = class _Range { constructor(range, options) { options = parseOptions(options); if (range instanceof _Range) { if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) { return range; } else { return new _Range(range.raw, options); } } if (range instanceof Comparator) { this.raw = range.value; this.set = [[range]]; this.formatted = void 0; return this; } this.options = options; this.loose = !!options.loose; this.includePrerelease = !!options.includePrerelease; this.raw = range.trim().replace(SPACE_CHARACTERS, " "); this.set = this.raw.split("||").map((r) => this.parseRange(r.trim())).filter((c) => c.length); if (!this.set.length) { throw new TypeError(`Invalid SemVer Range: ${this.raw}`); } if (this.set.length > 1) { 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) { for (const c of this.set) { if (c.length === 1 && isAny(c[0])) { this.set = [c]; break; } } } } this.formatted = void 0; } get range() { if (this.formatted === void 0) { this.formatted = ""; for (let i = 0; i < this.set.length; i++) { if (i > 0) { this.formatted += "||"; } const comps = this.set[i]; for (let k = 0; k < comps.length; k++) { if (k > 0) { this.formatted += " "; } this.formatted += comps[k].toString().trim(); } } } return this.formatted; } format() { return this.range; } toString() { return this.range; } parseRange(range) { 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; } const loose = this.options.loose; const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]; range = range.replace(hr, hyphenReplace(this.options.includePrerelease)); debug2("hyphen replace", range); range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace); debug2("comparator trim", range); range = range.replace(re[t.TILDETRIM], tildeTrimReplace); debug2("tilde trim", range); range = range.replace(re[t.CARETTRIM], caretTrimReplace); debug2("caret trim", range); let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options)); if (loose) { rangeList = rangeList.filter((comp) => { debug2("loose invalid filter", comp, this.options); return !!comp.match(re[t.COMPARATORLOOSE]); }); } debug2("range list", rangeList); const rangeMap = /* @__PURE__ */ 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(""); } const result = [...rangeMap.values()]; cache.set(memoKey, result); return result; } intersects(range, options) { if (!(range instanceof _Range)) { throw new TypeError("a Range is required"); } 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); }); }); }); }); } // if ANY of the sets match ALL of its comparators, then pass test(version) { if (!version) { return false; } if (typeof version === "string") { try { version = new SemVer(version, this.options); } catch (er) { return false; } } for (let i = 0; i < this.set.length; i++) { if (testSet(this.set[i], version, this.options)) { return true; } } return false; } }; module.exports = Range; var LRU = require_lrucache(); var cache = new LRU(); var parseOptions = require_parse_options(); var Comparator = require_comparator(); var debug2 = require_debug(); var SemVer = require_semver(); var { safeRe: re, t, comparatorTrimReplace, tildeTrimReplace, caretTrimReplace } = require_re(); var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants(); var isNullSet = (c) => c.value === "<0.0.0-0"; var isAny = (c) => c.value === ""; var isSatisfiable = (comparators, options) => { let result = true; const remainingComparators = comparators.slice(); let testComparator = remainingComparators.pop(); while (result && remainingComparators.length) { result = remainingComparators.every((otherComparator) => { return testComparator.intersects(otherComparator, options); }); testComparator = remainingComparators.pop(); } return result; }; var parseComparator = (comp, options) => { comp = comp.replace(re[t.BUILD], ""); debug2("comp", comp, options); comp = replaceCarets(comp, options); debug2("caret", comp); comp = replaceTildes(comp, options); debug2("tildes", comp); comp = replaceXRanges(comp, options); debug2("xrange", comp); comp = replaceStars(comp, options); debug2("stars", comp); return comp; }; var isX = (id) => !id || id.toLowerCase() === "x" || id === "*"; var replaceTildes = (comp, options) => { return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" "); }; var replaceTilde = (comp, options) => { const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]; return comp.replace(r, (_, M, m, p, pr) => { debug2("tilde", comp, _, M, m, p, pr); let ret; if (isX(M)) { ret = ""; } else if (isX(m)) { ret = `>=${M}.0.0 <${+M + 1}.0.0-0`; } else if (isX(p)) { ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`; } else if (pr) { debug2("replaceTilde pr", pr); ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`; } else { ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`; } debug2("tilde return", ret); return ret; }); }; var replaceCarets = (comp, options) => { return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" "); }; var replaceCaret = (comp, options) => { debug2("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) => { debug2("caret", comp, _, M, m, p, pr); let ret; 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) { debug2("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 { debug2("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`; } } debug2("caret return", ret); return ret; }); }; var replaceXRanges = (comp, options) => { debug2("replaceXRanges", comp, options); return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" "); }; var 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) => { debug2("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; if (gtlt === "=" && anyX) { gtlt = ""; } pr = options.includePrerelease ? "-0" : ""; if (xM) { if (gtlt === ">" || gtlt === "<") { ret = "<0.0.0-0"; } else { ret = "*"; } } else if (gtlt && anyX) { if (xm) { m = 0; } p = 0; if (gtlt === ">") { gtlt = ">="; if (xm) { M = +M + 1; m = 0; p = 0; } else { m = +m + 1; p = 0; } } else if (gtlt === "<=") { gtlt = "<"; if (xm) { M = +M + 1; } else { m = +m + 1; } } if (gtlt === "<") { pr = "-0"; } 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`; } debug2("xRange return", ret); return ret; }); }; var replaceStars = (comp, options) => { debug2("replaceStars", comp, options); return comp.trim().replace(re[t.STAR], ""); }; var replaceGTE0 = (comp, options) => { debug2("replaceGTE0", comp, options); return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], ""); }; var hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => { 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" : ""}`; } 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}`; } return `${from} ${to}`.trim(); }; var testSet = (set, version, options) => { for (let i = 0; i < set.length; i++) { if (!set[i].test(version)) { return false; } } if (version.prerelease.length && !options.includePrerelease) { for (let i = 0; i < set.length; i++) { debug2(set[i].semver); if (set[i].semver === Comparator.ANY) { continue; } 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; } } } return false; } return true; }; } }); var require_comparator = __commonJS2({ ""(exports, module) { "use strict"; var ANY = Symbol("SemVer ANY"); var Comparator = class _Comparator { static get ANY() { return ANY; } constructor(comp, options) { options = parseOptions(options); if (comp instanceof _Comparator) { if (comp.loose === !!options.loose) { return comp; } else { comp = comp.value; } } comp = comp.trim().split(/\s+/).join(" "); debug2("comparator", comp, options); this.options = options; this.loose = !!options.loose; this.parse(comp); if (this.semver === ANY) { this.value = ""; } else { this.value = this.operator + this.semver.version; } debug2("comp", this); } parse(comp) { const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]; const m = comp.match(r); if (!m) { throw new TypeError(`Invalid comparator: ${comp}`); } this.operator = m[1] !== void 0 ? m[1] : ""; if (this.operator === "=") { this.operator = ""; } if (!m[2]) { this.semver = ANY; } else { this.semver = new SemVer(m[2], this.options.loose); } } toString() { return this.value; } test(version) { debug2("Comparator.test", version, this.options.loose); if (this.semver === ANY || version === ANY) { return true; } if (typeof version === "string") { try { version = new SemVer(version, this.options); } catch (er) { return false; } } return cmp(version, this.operator, this.semver, this.options); } intersects(comp, options) { if (!(comp instanceof _Comparator)) { throw new TypeError("a Comparator is required"); } 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); } options = parseOptions(options); 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; } if (this.operator.startsWith(">") && comp.operator.startsWith(">")) { return true; } if (this.operator.startsWith("<") && comp.operator.startsWith("<")) { return true; } if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) { return true; } if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) { return true; } if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) { return true; } return false; } }; module.exports = Comparator; var parseOptions = require_parse_options(); var { safeRe: re, t } = require_re(); var cmp = require_cmp(); var debug2 = require_debug(); var SemVer = require_semver(); var Range = require_range(); } }); var require_satisfies = __commonJS2({ ""(exports, module) { "use strict"; var Range = require_range(); var satisfies = (version, range, options) => { try { range = new Range(range, options); } catch (er) { return false; } return range.test(version); }; module.exports = satisfies; } }); var require_to_comparators = __commonJS2({ ""(exports, module) { "use strict"; var Range = require_range(); var toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" ")); module.exports = toComparators; } }); var require_max_satisfying = __commonJS2({ ""(exports, module) { "use strict"; var SemVer = require_semver(); var Range = require_range(); var 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)) { if (!max || maxSV.compare(v) === -1) { max = v; maxSV = new SemVer(max, options); } } }); return max; }; module.exports = maxSatisfying; } }); var require_min_satisfying = __commonJS2({ ""(exports, module) { "use strict"; var SemVer = require_semver(); var Range = require_range(); var 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)) { if (!min || minSV.compare(v) === 1) { min = v; minSV = new SemVer(min, options); } } }); return min; }; module.exports = minSatisfying; } }); var require_min_version = __commonJS2({ ""(exports, module) { "use strict"; var SemVer = require_semver(); var Range = require_range(); var gt = require_gt(); var minVersion = (range, loose) => { range = new Range(range, loose); let minver = new SemVer("0.0.0"); if (range.test(minver)) { return minver; } minver = new SemVer("0.0.0-0"); if (range.test(minver)) { return minver; } minver = null; for (let i = 0; i < range.set.length; ++i) { const comparators = range.set[i]; let setMin = null; comparators.forEach((comparator) => { 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(); case "": case ">=": if (!setMin || gt(compver, setMin)) { setMin = compver; } break; case "<": case "<=": break; default: throw new Error(`Unexpected operation: ${comparator.operator}`); } }); if (setMin && (!minver || gt(minver, setMin))) { minver = setMin; } } if (minver && range.test(minver)) { return minver; } return null; }; module.exports = minVersion; } }); var require_valid2 = __commonJS2({ ""(exports, module) { "use strict"; var Range = require_range(); var validRange = (range, options) => { try { return new Range(range, options).range || "*"; } catch (er) { return null; } }; module.exports = validRange; } }); var require_outside = __commonJS2({ ""(exports, module) { "use strict"; var SemVer = require_semver(); var Comparator = require_comparator(); var { ANY } = Comparator; var Range = require_range(); var satisfies = require_satisfies(); var gt = require_gt(); var lt = require_lt(); var lte = require_lte(); var gte = require_gte(); var outside = (version, range, hilo, options) => { version = new SemVer(version, options); range = new Range(range, options); 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 (satisfies(version, range, options)) { return false; } for (let i = 0; i < range.set.length; ++i) { const comparators = range.set[i]; let high = null; let low = null; 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; } }); if (high.operator === comp || high.operator === ecomp) { return false; } 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; }; module.exports = outside; } }); var require_gtr = __commonJS2({ ""(exports, module) { "use strict"; var outside = require_outside(); var gtr = (version, range, options) => outside(version, range, ">", options); module.exports = gtr; } }); var require_ltr = __commonJS2({ ""(exports, module) { "use strict"; var outside = require_outside(); var ltr = (version, range, options) => outside(version, range, "<", options); module.exports = ltr; } }); var require_intersects = __commonJS2({ ""(exports, module) { "use strict"; var Range = require_range(); var intersects = (r1, r2, options) => { r1 = new Range(r1, options); r2 = new Range(r2, options); return r1.intersects(r2, options); }; module.exports = intersects; } }); var require_simplify = __commonJS2({ ""(exports, module) { "use strict"; var satisfies = require_satisfies(); var compare = require_compare(); 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]); } 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; }; } }); var require_subset = __commonJS2({ ""(exports, module) { "use strict"; var Range = require_range(); var Comparator = require_comparator(); var { ANY } = Comparator; var satisfies = require_satisfies(); var compare = require_compare(); var subset = (sub, dom, options = {}) => { if (sub === dom) { return true; } 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; } } if (sawNonNull) { return false; } } return true; }; var minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")]; var minimumVersion = [new Comparator(">=0.0.0")]; var simpleSubset = (sub, dom, options) => { if (sub === dom) { return true; } 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; } } if (dom.length === 1 && dom[0].semver === ANY) { if (options.includePrerelease) { return true; } else { dom = minimumVersion; } } const eqSet = /* @__PURE__ */ 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); } } if (eqSet.size > 1) { return null; } 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; } } for (const eq of eqSet) { if (gt && !satisfies(eq, String(gt), options)) { return null; } if (lt && !satisfies(eq, String(lt), options)) { return null; } for (const c of dom) { if (!satisfies(eq, String(c), options)) { return false; } } return true; } let higher, lower; let hasDomLT, hasDomGT; let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false; let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false; if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0) { needDomLTPre = false; } 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; } } if (gt && hasDomLT && !lt && gtltComp !== 0) { return false; } if (lt && hasDomGT && !gt && gtltComp !== 0) { return false; } if (needDomGTPre || needDomLTPre) { return false; } return true; }; var 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; }; var 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; }; module.exports = subset; } }); var require_semver2 = __commonJS2({ ""(exports, module) { "use strict"; var internalRe = require_re(); var constants3 = require_constants(); var SemVer = require_semver(); var identifiers = require_identifiers(); var parse22 = require_parse(); var valid = require_valid(); var clean = require_clean(); var inc = require_inc(); var diff = require_diff(); var major = require_major(); var minor = require_minor(); var patch = require_patch(); var prerelease = require_prerelease(); var compare = require_compare(); var rcompare = require_rcompare(); var compareLoose = require_compare_loose(); var compareBuild = require_compare_build(); var sort = require_sort(); var rsort = require_rsort(); var gt = require_gt(); var lt = require_lt(); var eq = require_eq(); var neq = require_neq(); var gte = require_gte(); var lte = require_lte(); var cmp = require_cmp(); var coerce = require_coerce(); var Comparator = require_comparator(); var Range = require_range(); var satisfies = require_satisfies(); var toComparators = require_to_comparators(); var maxSatisfying = require_max_satisfying(); var minSatisfying = require_min_satisfying(); var minVersion = require_min_version(); var validRange = require_valid2(); var outside = require_outside(); var gtr = require_gtr(); var ltr = require_ltr(); var intersects = require_intersects(); var simplifyRange = require_simplify(); var subset = require_subset(); module.exports = { parse: parse22, 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: constants3.SEMVER_SPEC_VERSION, RELEASE_TYPES: constants3.RELEASE_TYPES, compareIdentifiers: identifiers.compareIdentifiers, rcompareIdentifiers: identifiers.rcompareIdentifiers }; } }); var require_index_min = __commonJS2({ ""(exports) { "use strict"; var a = (t, e) => () => (e || t((e = { exports: {} }).exports, e), e.exports); var _ = a((i) => { "use strict"; Object.defineProperty(i, "__esModule", { value: true }); i.sync = i.isexe = void 0; var M = __require2("node:fs"), x = __require2("node:fs/promises"), q = async (t, e = {}) => { let { ignoreErrors: r = false } = e; try { return d(await (0, x.stat)(t), e); } catch (s) { let n = s; if (r || n.code === "EACCES") return false; throw n; } }; i.isexe = q; var m = (t, e = {}) => { let { ignoreErrors: r = false } = e; try { return d((0, M.statSync)(t), e); } catch (s) { let n = s; if (r || n.code === "EACCES") return false; throw n; } }; i.sync = m; var d = (t, e) => t.isFile() && A(t, e), A = (t, e) => { let r = e.uid ?? process.getuid?.(), s = e.groups ?? process.getgroups?.() ?? [], n = e.gid ?? process.getgid?.() ?? s[0]; if (r === void 0 || n === void 0) throw new Error("cannot get uid or gid"); let u = /* @__PURE__ */ new Set([n, ...s]), c = t.mode, S = t.uid, P = t.gid, f = parseInt("100", 8), l = parseInt("010", 8), j = parseInt("001", 8), C = f | l; return !!(c & j || c & l && u.has(P) || c & f && S === r || c & C && r === 0); }; }); var g = a((o) => { "use strict"; Object.defineProperty(o, "__esModule", { value: true }); o.sync = o.isexe = void 0; var T = __require2("node:fs"), I = __require2("node:fs/promises"), D = __require2("node:path"), F = async (t, e = {}) => { let { ignoreErrors: r = false } = e; try { return y(await (0, I.stat)(t), t, e); } catch (s) { let n = s; if (r || n.code === "EACCES") return false; throw n; } }; o.isexe = F; var L = (t, e = {}) => { let { ignoreErrors: r = false } = e; try { return y((0, T.statSync)(t), t, e); } catch (s) { let n = s; if (r || n.code === "EACCES") return false; throw n; } }; o.sync = L; var B = (t, e) => { let { pathExt: r = process.env.PATHEXT || "" } = e, s = r.split(D.delimiter); if (s.indexOf("") !== -1) return true; for (let n of s) { let u = n.toLowerCase(), c = t.substring(t.length - u.length).toLowerCase(); if (u && c === u) return true; } return false; }, y = (t, e, r) => t.isFile() && B(e, r); }); var p = a((h) => { "use strict"; Object.defineProperty(h, "__esModule", { value: true }); }); var v = exports && exports.__createBinding || (Object.create ? function(t, e, r, s) { s === void 0 && (s = r); var n = Object.getOwnPropertyDescriptor(e, r); (!n || ("get" in n ? !e.__esModule : n.writable || n.configurable)) && (n = { enumerable: true, get: function() { return e[r]; } }), Object.defineProperty(t, s, n); } : function(t, e, r, s) { s === void 0 && (s = r), t[s] = e[r]; }); var G = exports && exports.__setModuleDefault || (Object.create ? function(t, e) { Object.defineProperty(t, "default", { enumerable: true, value: e }); } : function(t, e) { t.default = e; }); var w = exports && exports.__importStar || /* @__PURE__ */ function() { var t = function(e) { return t = Object.getOwnPropertyNames || function(r) { var s = []; for (var n in r) Object.prototype.hasOwnProperty.call(r, n) && (s[s.length] = n); return s; }, t(e); }; return function(e) { if (e && e.__esModule) return e; var r = {}; if (e != null) for (var s = t(e), n = 0; n < s.length; n++) s[n] !== "default" && v(r, e, s[n]); return G(r, e), r; }; }(); var X = exports && exports.__exportStar || function(t, e) { for (var r in t) r !== "default" && !Object.prototype.hasOwnProperty.call(e, r) && v(e, t, r); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.sync = exports.isexe = exports.posix = exports.win32 = void 0; var E = w(_()); exports.posix = E; var O = w(g()); exports.win32 = O; X(p(), exports); var H = process.env._ISEXE_TEST_PLATFORM_ || process.platform; var b = H === "win32" ? O : E; exports.isexe = b.isexe; exports.sync = b.sync; } }); var require_lib2 = __commonJS2({ ""(exports, module) { var { isexe, sync: isexeSync } = require_index_min(); var { join: join22, delimiter, sep: sep22, posix } = __require2("path"); var isWindows = process.platform === "win32"; var rSlash = new RegExp(`[${posix.sep}${sep22 === posix.sep ? "" : sep22}]`.replace(/(\\)/g, "\\$1")); var rRel = new RegExp(`^\\.${rSlash.source}`); var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" }); var getPathInfo = (cmd, { path: optPath = process.env.PATH, pathExt: optPathExt = process.env.PATHEXT, delimiter: optDelimiter = delimiter }) => { const pathEnv = cmd.match(rSlash) ? [""] : [ // windows always checks the cwd first ...isWindows ? [process.cwd()] : [], ...(optPath || /* istanbul ignore next: very unusual */ "").split(optDelimiter) ]; if (isWindows) { const pathExtExe = optPathExt || [".EXE", ".CMD", ".BAT", ".COM"].join(optDelimiter); const pathExt = pathExtExe.split(optDelimiter).flatMap((item) => [item, item.toLowerCase()]); if (cmd.includes(".") && pathExt[0] !== "") { pathExt.unshift(""); } return { pathEnv, pathExt, pathExtExe }; } return { pathEnv, pathExt: [""] }; }; var getPathPart = (raw, cmd) => { const pathPart = /^".*"$/.test(raw) ? raw.slice(1, -1) : raw; const prefix = !pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : ""; return prefix + join22(pathPart, cmd); }; var which2 = async (cmd, opt = {}) => { const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt); const found = []; for (const envPart of pathEnv) { const p = getPathPart(envPart, cmd); for (const ext of pathExt) { const withExt = p + ext; const is = await isexe(withExt, { pathExt: pathExtExe, ignoreErrors: true }); if (is) { if (!opt.all) { return withExt; } found.push(withExt); } } } if (opt.all && found.length) { return found; } if (opt.nothrow) { return null; } throw getNotFoundError(cmd); }; var whichSync = (cmd, opt = {}) => { const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt); const found = []; for (const pathEnvPart of pathEnv) { const p = getPathPart(pathEnvPart, cmd); for (const ext of pathExt) { const withExt = p + ext; const is = isexeSync(withExt, { pathExt: pathExtExe, ignoreErrors: true }); if (is) { if (!opt.all) { return withExt; } found.push(withExt); } } } if (opt.all && found.length) { return found; } if (opt.nothrow) { return null; } throw getNotFoundError(cmd); }; module.exports = which2; which2.sync = whichSync; } }); var require_identity = __commonJS2({ ""(exports) { "use strict"; var ALIAS = Symbol.for("yaml.alias"); var DOC = Symbol.for("yaml.document"); var MAP = Symbol.for("yaml.map"); var PAIR = Symbol.for("yaml.pair"); var SCALAR = Symbol.for("yaml.scalar"); var SEQ = Symbol.for("yaml.seq"); var NODE_TYPE = Symbol.for("yaml.node.type"); var isAlias = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === ALIAS; var isDocument = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === DOC; var isMap = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === MAP; var isPair = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === PAIR; var isScalar = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === SCALAR; var isSeq = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === SEQ; function isCollection(node) { if (node && typeof node === "object") switch (node[NODE_TYPE]) { case MAP: case SEQ: return true; } return false; } function isNode(node) { if (node && typeof node === "object") switch (node[NODE_TYPE]) { case ALIAS: case MAP: case SCALAR: case SEQ: return true; } return false; } var hasAnchor = (node) => (isScalar(node) || isCollection(node)) && !!node.anchor; exports.ALIAS = ALIAS; exports.DOC = DOC; exports.MAP = MAP; exports.NODE_TYPE = NODE_TYPE; exports.PAIR = PAIR; exports.SCALAR = SCALAR; exports.SEQ = SEQ; exports.hasAnchor = hasAnchor; exports.isAlias = isAlias; exports.isCollection = isCollection; exports.isDocument = isDocument; exports.isMap = isMap; exports.isNode = isNode; exports.isPair = isPair; exports.isScalar = isScalar; exports.isSeq = isSeq; } }); var require_visit = __commonJS2({ ""(exports) { "use strict"; var identity = require_identity(); var BREAK = Symbol("break visit"); var SKIP = Symbol("skip children"); var REMOVE = Symbol("remove node"); function visit(node, visitor) { const visitor_ = initVisitor(visitor); if (identity.isDocument(node)) { const cd = visit_(null, node.contents, visitor_, Object.freeze([node])); if (cd === REMOVE) node.contents = null; } else visit_(null, node, visitor_, Object.freeze([])); } visit.BREAK = BREAK; visit.SKIP = SKIP; visit.REMOVE = REMOVE; function visit_(key, node, visitor, path2) { const ctrl = callVisitor(key, node, visitor, path2); if (identity.isNode(ctrl) || identity.isPair(ctrl)) { replaceNode(key, path2, ctrl); return visit_(key, ctrl, visitor, path2); } if (typeof ctrl !== "symbol") { if (identity.isCollection(node)) { path2 = Object.freeze(path2.concat(node)); for (let i = 0; i < node.items.length; ++i) { const ci = visit_(i, node.items[i], visitor, path2); if (typeof ci === "number") i = ci - 1; else if (ci === BREAK) return BREAK; else if (ci === REMOVE) { node.items.splice(i, 1); i -= 1; } } } else if (identity.isPair(node)) { path2 = Object.freeze(path2.concat(node)); const ck = visit_("key", node.key, visitor, path2); if (ck === BREAK) return BREAK; else if (ck === REMOVE) node.key = null; const cv = visit_("value", node.value, visitor, path2); if (cv === BREAK) return BREAK; else if (cv === REMOVE) node.value = null; } } return ctrl; } async function visitAsync(node, visitor) { const visitor_ = initVisitor(visitor); if (identity.isDocument(node)) { const cd = await visitAsync_(null, node.contents, visitor_, Object.freeze([node])); if (cd === REMOVE) node.contents = null; } else await visitAsync_(null, node, visitor_, Object.freeze([])); } visitAsync.BREAK = BREAK; visitAsync.SKIP = SKIP; visitAsync.REMOVE = REMOVE; async function visitAsync_(key, node, visitor, path2) { const ctrl = await callVisitor(key, node, visitor, path2); if (identity.isNode(ctrl) || identity.isPair(ctrl)) { replaceNode(key, path2, ctrl); return visitAsync_(key, ctrl, visitor, path2); } if (typeof ctrl !== "symbol") { if (identity.isCollection(node)) { path2 = Object.freeze(path2.concat(node)); for (let i = 0; i < node.items.length; ++i) { const ci = await visitAsync_(i, node.items[i], visitor, path2); if (typeof ci === "number") i = ci - 1; else if (ci === BREAK) return BREAK; else if (ci === REMOVE) { node.items.splice(i, 1); i -= 1; } } } else if (identity.isPair(node)) { path2 = Object.freeze(path2.concat(node)); const ck = await visitAsync_("key", node.key, visitor, path2); if (ck === BREAK) return BREAK; else if (ck === REMOVE) node.key = null; const cv = await visitAsync_("value", node.value, visitor, path2); if (cv === BREAK) return BREAK; else if (cv === REMOVE) node.value = null; } } return ctrl; } function initVisitor(visitor) { if (typeof visitor === "object" && (visitor.Collection || visitor.Node || visitor.Value)) { return Object.assign({ Alias: visitor.Node, Map: visitor.Node, Scalar: visitor.Node, Seq: visitor.Node }, visitor.Value && { Map: visitor.Value, Scalar: visitor.Value, Seq: visitor.Value }, visitor.Collection && { Map: visitor.Collection, Seq: visitor.Collection }, visitor); } return visitor; } function callVisitor(key, node, visitor, path2) { if (typeof visitor === "function") return visitor(key, node, path2); if (identity.isMap(node)) return visitor.Map?.(key, node, path2); if (identity.isSeq(node)) return visitor.Seq?.(key, node, path2); if (identity.isPair(node)) return visitor.Pair?.(key, node, path2); if (identity.isScalar(node)) return visitor.Scalar?.(key, node, path2); if (identity.isAlias(node)) return visitor.Alias?.(key, node, path2); return void 0; } function replaceNode(key, path2, node) { const parent = path2[path2.length - 1]; if (identity.isCollection(parent)) { parent.items[key] = node; } else if (identity.isPair(parent)) { if (key === "key") parent.key = node; else parent.value = node; } else if (identity.isDocument(parent)) { parent.contents = node; } else { const pt = identity.isAlias(parent) ? "alias" : "scalar"; throw new Error(`Cannot replace node with ${pt} parent`); } } exports.visit = visit; exports.visitAsync = visitAsync; } }); var require_directives = __commonJS2({ ""(exports) { "use strict"; var identity = require_identity(); var visit = require_visit(); var escapeChars = { "!": "%21", ",": "%2C", "[": "%5B", "]": "%5D", "{": "%7B", "}": "%7D" }; var escapeTagName = (tn) => tn.replace(/[!,[\]{}]/g, (ch) => escapeChars[ch]); var Directives = class _Directives { constructor(yaml, tags) { this.docStart = null; this.docEnd = false; this.yaml = Object.assign({}, _Directives.defaultYaml, yaml); this.tags = Object.assign({}, _Directives.defaultTags, tags); } clone() { const copy = new _Directives(this.yaml, this.tags); copy.docStart = this.docStart; return copy; } /** * During parsing, get a Directives instance for the current document and * update the stream state according to the current version's spec. */ atDocument() { const res = new _Directives(this.yaml, this.tags); switch (this.yaml.version) { case "1.1": this.atNextDocument = true; break; case "1.2": this.atNextDocument = false; this.yaml = { explicit: _Directives.defaultYaml.explicit, version: "1.2" }; this.tags = Object.assign({}, _Directives.defaultTags); break; } return res; } /** * @param onError - May be called even if the action was successful * @returns `true` on success */ add(line, onError) { if (this.atNextDocument) { this.yaml = { explicit: _Directives.defaultYaml.explicit, version: "1.1" }; this.tags = Object.assign({}, _Directives.defaultTags); this.atNextDocument = false; } const parts = line.trim().split(/[ \t]+/); const name = parts.shift(); switch (name) { case "%TAG": { if (parts.length !== 2) { onError(0, "%TAG directive should contain exactly two parts"); if (parts.length < 2) return false; } const [handle, prefix] = parts; this.tags[handle] = prefix; return true; } case "%YAML": { this.yaml.explicit = true; if (parts.length !== 1) { onError(0, "%YAML directive should contain exactly one part"); return false; } const [version] = parts; if (version === "1.1" || version === "1.2") { this.yaml.version = version; return true; } else { const isValid = /^\d+\.\d+$/.test(version); onError(6, `Unsupported YAML version ${version}`, isValid); return false; } } default: onError(0, `Unknown directive ${name}`, true); return false; } } /** * Resolves a tag, matching handles to those defined in %TAG directives. * * @returns Resolved tag, which may also be the non-specific tag `'!'` or a * `'!local'` tag, or `null` if unresolvable. */ tagName(source, onError) { if (source === "!") return "!"; if (source[0] !== "!") { onError(`Not a valid tag: ${source}`); return null; } if (source[1] === "<") { const verbatim = source.slice(2, -1); if (verbatim === "!" || verbatim === "!!") { onError(`Verbatim tags aren't resolved, so ${source} is invalid.`); return null; } if (source[source.length - 1] !== ">") onError("Verbatim tags must end with a >"); return verbatim; } const [, handle, suffix] = source.match(/^(.*!)([^!]*)$/s); if (!suffix) onError(`The ${source} tag has no suffix`); const prefix = this.tags[handle]; if (prefix) { try { return prefix + decodeURIComponent(suffix); } catch (error2) { onError(String(error2)); return null; } } if (handle === "!") return source; onError(`Could not resolve tag: ${source}`); return null; } /** * Given a fully resolved tag, returns its printable string form, * taking into account current tag prefixes and defaults. */ tagString(tag) { for (const [handle, prefix] of Object.entries(this.tags)) { if (tag.startsWith(prefix)) return handle + escapeTagName(tag.substring(prefix.length)); } return tag[0] === "!" ? tag : `!<${tag}>`; } toString(doc) { const lines = this.yaml.explicit ? [`%YAML ${this.yaml.version || "1.2"}`] : []; const tagEntries = Object.entries(this.tags); let tagNames; if (doc && tagEntries.length > 0 && identity.isNode(doc.contents)) { const tags = {}; visit.visit(doc.contents, (_key, node) => { if (identity.isNode(node) && node.tag) tags[node.tag] = true; }); tagNames = Object.keys(tags); } else tagNames = []; for (const [handle, prefix] of tagEntries) { if (handle === "!!" && prefix === "tag:yaml.org,2002:") continue; if (!doc || tagNames.some((tn) => tn.startsWith(prefix))) lines.push(`%TAG ${handle} ${prefix}`); } return lines.join("\n"); } }; Directives.defaultYaml = { explicit: false, version: "1.2" }; Directives.defaultTags = { "!!": "tag:yaml.org,2002:" }; exports.Directives = Directives; } }); var require_anchors = __commonJS2({ ""(exports) { "use strict"; var identity = require_identity(); var visit = require_visit(); function anchorIsValid(anchor) { if (/[\x00-\x19\s,[\]{}]/.test(anchor)) { const sa = JSON.stringify(anchor); const msg = `Anchor must not contain whitespace or control characters: ${sa}`; throw new Error(msg); } return true; } function anchorNames(root) { const anchors = /* @__PURE__ */ new Set(); visit.visit(root, { Value(_key, node) { if (node.anchor) anchors.add(node.anchor); } }); return anchors; } function findNewAnchor(prefix, exclude) { for (let i = 1; true; ++i) { const name = `${prefix}${i}`; if (!exclude.has(name)) return name; } } function createNodeAnchors(doc, prefix) { const aliasObjects = []; const sourceObjects = /* @__PURE__ */ new Map(); let prevAnchors = null; return { onAnchor: (source) => { aliasObjects.push(source); prevAnchors ?? (prevAnchors = anchorNames(doc)); const anchor = findNewAnchor(prefix, prevAnchors); prevAnchors.add(anchor); return anchor; }, /** * With circular references, the source node is only resolved after all * of its child nodes are. This is why anchors are set only after all of * the nodes have been created. */ setAnchors: () => { for (const source of aliasObjects) { const ref = sourceObjects.get(source); if (typeof ref === "object" && ref.anchor && (identity.isScalar(ref.node) || identity.isCollection(ref.node))) { ref.node.anchor = ref.anchor; } else { const error2 = new Error("Failed to resolve repeated object (this should not happen)"); error2.source = source; throw error2; } } }, sourceObjects }; } exports.anchorIsValid = anchorIsValid; exports.anchorNames = anchorNames; exports.createNodeAnchors = createNodeAnchors; exports.findNewAnchor = findNewAnchor; } }); var require_applyReviver = __commonJS2({ ""(exports) { "use strict"; function applyReviver(reviver, obj, key, val) { if (val && typeof val === "object") { if (Array.isArray(val)) { for (let i = 0, len = val.length; i < len; ++i) { const v0 = val[i]; const v1 = applyReviver(reviver, val, String(i), v0); if (v1 === void 0) delete val[i]; else if (v1 !== v0) val[i] = v1; } } else if (val instanceof Map) { for (const k of Array.from(val.keys())) { const v0 = val.get(k); const v1 = applyReviver(reviver, val, k, v0); if (v1 === void 0) val.delete(k); else if (v1 !== v0) val.set(k, v1); } } else if (val instanceof Set) { for (const v0 of Array.from(val)) { const v1 = applyReviver(reviver, val, v0, v0); if (v1 === void 0) val.delete(v0); else if (v1 !== v0) { val.delete(v0); val.add(v1); } } } else { for (const [k, v0] of Object.entries(val)) { const v1 = applyReviver(reviver, val, k, v0); if (v1 === void 0) delete val[k]; else if (v1 !== v0) val[k] = v1; } } } return reviver.call(obj, key, val); } exports.applyReviver = applyReviver; } }); var require_toJS = __commonJS2({ ""(exports) { "use strict"; var identity = require_identity(); function toJS(value, arg, ctx) { if (Array.isArray(value)) return value.map((v, i) => toJS(v, String(i), ctx)); if (value && typeof value.toJSON === "function") { if (!ctx || !identity.hasAnchor(value)) return value.toJSON(arg, ctx); const data = { aliasCount: 0, count: 1, res: void 0 }; ctx.anchors.set(value, data); ctx.onCreate = (res2) => { data.res = res2; delete ctx.onCreate; }; const res = value.toJSON(arg, ctx); if (ctx.onCreate) ctx.onCreate(res); return res; } if (typeof value === "bigint" && !ctx?.keep) return Number(value); return value; } exports.toJS = toJS; } }); var require_Node = __commonJS2({ ""(exports) { "use strict"; var applyReviver = require_applyReviver(); var identity = require_identity(); var toJS = require_toJS(); var NodeBase = class { constructor(type) { Object.defineProperty(this, identity.NODE_TYPE, { value: type }); } /** Create a copy of this node. */ clone() { const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this)); if (this.range) copy.range = this.range.slice(); return copy; } /** A plain JavaScript representation of this node. */ toJS(doc, { mapAsMap, maxAliasCount, onAnchor, reviver } = {}) { if (!identity.isDocument(doc)) throw new TypeError("A document argument is required"); const ctx = { anchors: /* @__PURE__ */ new Map(), doc, keep: true, mapAsMap: mapAsMap === true, mapKeyWarned: false, maxAliasCount: typeof maxAliasCount === "number" ? maxAliasCount : 100 }; const res = toJS.toJS(this, "", ctx); if (typeof onAnchor === "function") for (const { count, res: res2 } of ctx.anchors.values()) onAnchor(res2, count); return typeof reviver === "function" ? applyReviver.applyReviver(reviver, { "": res }, "", res) : res; } }; exports.NodeBase = NodeBase; } }); var require_Alias = __commonJS2({ ""(exports) { "use strict"; var anchors = require_anchors(); var visit = require_visit(); var identity = require_identity(); var Node = require_Node(); var toJS = require_toJS(); var Alias = class extends Node.NodeBase { constructor(source) { super(identity.ALIAS); this.source = source; Object.defineProperty(this, "tag", { set() { throw new Error("Alias nodes cannot have tags"); } }); } /** * Resolve the value of this alias within `doc`, finding the last * instance of the `source` anchor before this node. */ resolve(doc, ctx) { let nodes; if (ctx?.aliasResolveCache) { nodes = ctx.aliasResolveCache; } else { nodes = []; visit.visit(doc, { Node: (_key, node) => { if (identity.isAlias(node) || identity.hasAnchor(node)) nodes.push(node); } }); if (ctx) ctx.aliasResolveCache = nodes; } let found = void 0; for (const node of nodes) { if (node === this) break; if (node.anchor === this.source) found = node; } return found; } toJSON(_arg, ctx) { if (!ctx) return { source: this.source }; const { anchors: anchors2, doc, maxAliasCount } = ctx; const source = this.resolve(doc, ctx); if (!source) { const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`; throw new ReferenceError(msg); } let data = anchors2.get(source); if (!data) { toJS.toJS(source, null, ctx); data = anchors2.get(source); } if (data?.res === void 0) { const msg = "This should not happen: Alias anchor was not resolved?"; throw new ReferenceError(msg); } if (maxAliasCount >= 0) { data.count += 1; if (data.aliasCount === 0) data.aliasCount = getAliasCount(doc, source, anchors2); if (data.count * data.aliasCount > maxAliasCount) { const msg = "Excessive alias count indicates a resource exhaustion attack"; throw new ReferenceError(msg); } } return data.res; } toString(ctx, _onComment, _onChompKeep) { const src = `*${this.source}`; if (ctx) { anchors.anchorIsValid(this.source); if (ctx.options.verifyAliasOrder && !ctx.anchors.has(this.source)) { const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`; throw new Error(msg); } if (ctx.implicitKey) return `${src} `; } return src; } }; function getAliasCount(doc, node, anchors2) { if (identity.isAlias(node)) { const source = node.resolve(doc); const anchor = anchors2 && source && anchors2.get(source); return anchor ? anchor.count * anchor.aliasCount : 0; } else if (identity.isCollection(node)) { let count = 0; for (const item of node.items) { const c = getAliasCount(doc, item, anchors2); if (c > count) count = c; } return count; } else if (identity.isPair(node)) { const kc = getAliasCount(doc, node.key, anchors2); const vc = getAliasCount(doc, node.value, anchors2); return Math.max(kc, vc); } return 1; } exports.Alias = Alias; } }); var require_Scalar = __commonJS2({ ""(exports) { "use strict"; var identity = require_identity(); var Node = require_Node(); var toJS = require_toJS(); var isScalarValue = (value) => !value || typeof value !== "function" && typeof value !== "object"; var Scalar = class extends Node.NodeBase { constructor(value) { super(identity.SCALAR); this.value = value; } toJSON(arg, ctx) { return ctx?.keep ? this.value : toJS.toJS(this.value, arg, ctx); } toString() { return String(this.value); } }; Scalar.BLOCK_FOLDED = "BLOCK_FOLDED"; Scalar.BLOCK_LITERAL = "BLOCK_LITERAL"; Scalar.PLAIN = "PLAIN"; Scalar.QUOTE_DOUBLE = "QUOTE_DOUBLE"; Scalar.QUOTE_SINGLE = "QUOTE_SINGLE"; exports.Scalar = Scalar; exports.isScalarValue = isScalarValue; } }); var require_createNode = __commonJS2({ ""(exports) { "use strict"; var Alias = require_Alias(); var identity = require_identity(); var Scalar = require_Scalar(); var defaultTagPrefix = "tag:yaml.org,2002:"; function findTagObject(value, tagName, tags) { if (tagName) { const match = tags.filter((t) => t.tag === tagName); const tagObj = match.find((t) => !t.format) ?? match[0]; if (!tagObj) throw new Error(`Tag ${tagName} not found`); return tagObj; } return tags.find((t) => t.identify?.(value) && !t.format); } function createNode(value, tagName, ctx) { if (identity.isDocument(value)) value = value.contents; if (identity.isNode(value)) return value; if (identity.isPair(value)) { const map = ctx.schema[identity.MAP].createNode?.(ctx.schema, null, ctx); map.items.push(value); return map; } if (value instanceof String || value instanceof Number || value instanceof Boolean || typeof BigInt !== "undefined" && value instanceof BigInt) { value = value.valueOf(); } const { aliasDuplicateObjects, onAnchor, onTagObj, schema, sourceObjects } = ctx; let ref = void 0; if (aliasDuplicateObjects && value && typeof value === "object") { ref = sourceObjects.get(value); if (ref) { ref.anchor ?? (ref.anchor = onAnchor(value)); return new Alias.Alias(ref.anchor); } else { ref = { anchor: null, node: null }; sourceObjects.set(value, ref); } } if (tagName?.startsWith("!!")) tagName = defaultTagPrefix + tagName.slice(2); let tagObj = findTagObject(value, tagName, schema.tags); if (!tagObj) { if (value && typeof value.toJSON === "function") { value = value.toJSON(); } if (!value || typeof value !== "object") { const node2 = new Scalar.Scalar(value); if (ref) ref.node = node2; return node2; } tagObj = value instanceof Map ? schema[identity.MAP] : Symbol.iterator in Object(value) ? schema[identity.SEQ] : schema[identity.MAP]; } if (onTagObj) { onTagObj(tagObj); delete ctx.onTagObj; } const node = tagObj?.createNode ? tagObj.createNode(ctx.schema, value, ctx) : typeof tagObj?.nodeClass?.from === "function" ? tagObj.nodeClass.from(ctx.schema, value, ctx) : new Scalar.Scalar(value); if (tagName) node.tag = tagName; else if (!tagObj.default) node.tag = tagObj.tag; if (ref) ref.node = node; return node; } exports.createNode = createNode; } }); var require_Collection = __commonJS2({ ""(exports) { "use strict"; var createNode = require_createNode(); var identity = require_identity(); var Node = require_Node(); function collectionFromPath(schema, path2, value) { let v = value; for (let i = path2.length - 1; i >= 0; --i) { const k = path2[i]; if (typeof k === "number" && Number.isInteger(k) && k >= 0) { const a = []; a[k] = v; v = a; } else { v = /* @__PURE__ */ new Map([[k, v]]); } } return createNode.createNode(v, void 0, { aliasDuplicateObjects: false, keepUndefined: false, onAnchor: () => { throw new Error("This should not happen, please report a bug."); }, schema, sourceObjects: /* @__PURE__ */ new Map() }); } var isEmptyPath = (path2) => path2 == null || typeof path2 === "object" && !!path2[Symbol.iterator]().next().done; var Collection22 = class extends Node.NodeBase { constructor(type, schema) { super(type); Object.defineProperty(this, "schema", { value: schema, configurable: true, enumerable: false, writable: true }); } /** * Create a copy of this collection. * * @param schema - If defined, overwrites the original's schema */ clone(schema) { const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this)); if (schema) copy.schema = schema; copy.items = copy.items.map((it) => identity.isNode(it) || identity.isPair(it) ? it.clone(schema) : it); if (this.range) copy.range = this.range.slice(); return copy; } /** * Adds a value to the collection. For `!!map` and `!!omap` the value must * be a Pair instance or a `{ key, value }` object, which may not have a key * that already exists in the map. */ addIn(path2, value) { if (isEmptyPath(path2)) this.add(value); else { const [key, ...rest] = path2; const node = this.get(key, true); if (identity.isCollection(node)) node.addIn(rest, value); else if (node === void 0 && this.schema) this.set(key, collectionFromPath(this.schema, rest, value)); else throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`); } } /** * Removes a value from the collection. * @returns `true` if the item was found and removed. */ deleteIn(path2) { const [key, ...rest] = path2; if (rest.length === 0) return this.delete(key); const node = this.get(key, true); if (identity.isCollection(node)) return node.deleteIn(rest); else throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`); } /** * Returns item at `key`, or `undefined` if not found. By default unwraps * scalar values from their surrounding node; to disable set `keepScalar` to * `true` (collections are always returned intact). */ getIn(path2, keepScalar) { const [key, ...rest] = path2; const node = this.get(key, true); if (rest.length === 0) return !keepScalar && identity.isScalar(node) ? node.value : node; else return identity.isCollection(node) ? node.getIn(rest, keepScalar) : void 0; } hasAllNullValues(allowScalar) { return this.items.every((node) => { if (!identity.isPair(node)) return false; const n = node.value; return n == null || allowScalar && identity.isScalar(n) && n.value == null && !n.commentBefore && !n.comment && !n.tag; }); } /** * Checks if the collection includes a value with the key `key`. */ hasIn(path2) { const [key, ...rest] = path2; if (rest.length === 0) return this.has(key); const node = this.get(key, true); return identity.isCollection(node) ? node.hasIn(rest) : false; } /** * Sets a value in this collection. For `!!set`, `value` needs to be a * boolean to add/remove the item from the set. */ setIn(path2, value) { const [key, ...rest] = path2; if (rest.length === 0) { this.set(key, value); } else { const node = this.get(key, true); if (identity.isCollection(node)) node.setIn(rest, value); else if (node === void 0 && this.schema) this.set(key, collectionFromPath(this.schema, rest, value)); else throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`); } } }; exports.Collection = Collection22; exports.collectionFromPath = collectionFromPath; exports.isEmptyPath = isEmptyPath; } }); var require_stringifyComment = __commonJS2({ ""(exports) { "use strict"; var stringifyComment = (str) => str.replace(/^(?!$)(?: $)?/gm, "#"); function indentComment(comment, indent) { if (/^\n+$/.test(comment)) return comment.substring(1); return indent ? comment.replace(/^(?! *$)/gm, indent) : comment; } var lineComment = (str, indent, comment) => str.endsWith("\n") ? indentComment(comment, indent) : comment.includes("\n") ? "\n" + indentComment(comment, indent) : (str.endsWith(" ") ? "" : " ") + comment; exports.indentComment = indentComment; exports.lineComment = lineComment; exports.stringifyComment = stringifyComment; } }); var require_foldFlowLines = __commonJS2({ ""(exports) { "use strict"; var FOLD_FLOW = "flow"; var FOLD_BLOCK = "block"; var FOLD_QUOTED = "quoted"; function foldFlowLines(text, indent, mode = "flow", { indentAtStart, lineWidth = 80, minContentWidth = 20, onFold, onOverflow } = {}) { if (!lineWidth || lineWidth < 0) return text; if (lineWidth < minContentWidth) minContentWidth = 0; const endStep = Math.max(1 + minContentWidth, 1 + lineWidth - indent.length); if (text.length <= endStep) return text; const folds = []; const escapedFolds = {}; let end = lineWidth - indent.length; if (typeof indentAtStart === "number") { if (indentAtStart > lineWidth - Math.max(2, minContentWidth)) folds.push(0); else end = lineWidth - indentAtStart; } let split = void 0; let prev = void 0; let overflow = false; let i = -1; let escStart = -1; let escEnd = -1; if (mode === FOLD_BLOCK) { i = consumeMoreIndentedLines(text, i, indent.length); if (i !== -1) end = i + endStep; } for (let ch; ch = text[i += 1]; ) { if (mode === FOLD_QUOTED && ch === "\\") { escStart = i; switch (text[i + 1]) { case "x": i += 3; break; case "u": i += 5; break; case "U": i += 9; break; default: i += 1; } escEnd = i; } if (ch === "\n") { if (mode === FOLD_BLOCK) i = consumeMoreIndentedLines(text, i, indent.length); end = i + indent.length + endStep; split = void 0; } else { if (ch === " " && prev && prev !== " " && prev !== "\n" && prev !== " ") { const next = text[i + 1]; if (next && next !== " " && next !== "\n" && next !== " ") split = i; } if (i >= end) { if (split) { folds.push(split); end = split + endStep; split = void 0; } else if (mode === FOLD_QUOTED) { while (prev === " " || prev === " ") { prev = ch; ch = text[i += 1]; overflow = true; } const j = i > escEnd + 1 ? i - 2 : escStart - 1; if (escapedFolds[j]) return text; folds.push(j); escapedFolds[j] = true; end = j + endStep; split = void 0; } else { overflow = true; } } } prev = ch; } if (overflow && onOverflow) onOverflow(); if (folds.length === 0) return text; if (onFold) onFold(); let res = text.slice(0, folds[0]); for (let i2 = 0; i2 < folds.length; ++i2) { const fold = folds[i2]; const end2 = folds[i2 + 1] || text.length; if (fold === 0) res = ` ${indent}${text.slice(0, end2)}`; else { if (mode === FOLD_QUOTED && escapedFolds[fold]) res += `${text[fold]}\\`; res += ` ${indent}${text.slice(fold + 1, end2)}`; } } return res; } function consumeMoreIndentedLines(text, i, indent) { let end = i; let start = i + 1; let ch = text[start]; while (ch === " " || ch === " ") { if (i < start + indent) { ch = text[++i]; } else { do { ch = text[++i]; } while (ch && ch !== "\n"); end = i; start = i + 1; ch = text[start]; } } return end; } exports.FOLD_BLOCK = FOLD_BLOCK; exports.FOLD_FLOW = FOLD_FLOW; exports.FOLD_QUOTED = FOLD_QUOTED; exports.foldFlowLines = foldFlowLines; } }); var require_stringifyString = __commonJS2({ ""(exports) { "use strict"; var Scalar = require_Scalar(); var foldFlowLines = require_foldFlowLines(); var getFoldOptions = (ctx, isBlock) => ({ indentAtStart: isBlock ? ctx.indent.length : ctx.indentAtStart, lineWidth: ctx.options.lineWidth, minContentWidth: ctx.options.minContentWidth }); var containsDocumentMarker = (str) => /^(%|---|\.\.\.)/m.test(str); function lineLengthOverLimit(str, lineWidth, indentLength) { if (!lineWidth || lineWidth < 0) return false; const limit = lineWidth - indentLength; const strLen = str.length; if (strLen <= limit) return false; for (let i = 0, start = 0; i < strLen; ++i) { if (str[i] === "\n") { if (i - start > limit) return true; start = i + 1; if (strLen - start <= limit) return false; } } return true; } function doubleQuotedString(value, ctx) { const json = JSON.stringify(value); if (ctx.options.doubleQuotedAsJSON) return json; const { implicitKey } = ctx; const minMultiLineLength = ctx.options.doubleQuotedMinMultiLineLength; const indent = ctx.indent || (containsDocumentMarker(value) ? " " : ""); let str = ""; let start = 0; for (let i = 0, ch = json[i]; ch; ch = json[++i]) { if (ch === " " && json[i + 1] === "\\" && json[i + 2] === "n") { str += json.slice(start, i) + "\\ "; i += 1; start = i; ch = "\\"; } if (ch === "\\") switch (json[i + 1]) { case "u": { str += json.slice(start, i); const code = json.substr(i + 2, 4); switch (code) { case "0000": str += "\\0"; break; case "0007": str += "\\a"; break; case "000b": str += "\\v"; break; case "001b": str += "\\e"; break; case "0085": str += "\\N"; break; case "00a0": str += "\\_"; break; case "2028": str += "\\L"; break; case "2029": str += "\\P"; break; default: if (code.substr(0, 2) === "00") str += "\\x" + code.substr(2); else str += json.substr(i, 6); } i += 5; start = i + 1; } break; case "n": if (implicitKey || json[i + 2] === '"' || json.length < minMultiLineLength) { i += 1; } else { str += json.slice(start, i) + "\n\n"; while (json[i + 2] === "\\" && json[i + 3] === "n" && json[i + 4] !== '"') { str += "\n"; i += 2; } str += indent; if (json[i + 2] === " ") str += "\\"; i += 1; start = i + 1; } break; default: i += 1; } } str = start ? str + json.slice(start) : json; return implicitKey ? str : foldFlowLines.foldFlowLines(str, indent, foldFlowLines.FOLD_QUOTED, getFoldOptions(ctx, false)); } function singleQuotedString(value, ctx) { if (ctx.options.singleQuote === false || ctx.implicitKey && value.includes("\n") || /[ \t]\n|\n[ \t]/.test(value)) return doubleQuotedString(value, ctx); const indent = ctx.indent || (containsDocumentMarker(value) ? " " : ""); const res = "'" + value.replace(/'/g, "''").replace(/\n+/g, `$& ${indent}`) + "'"; return ctx.implicitKey ? res : foldFlowLines.foldFlowLines(res, indent, foldFlowLines.FOLD_FLOW, getFoldOptions(ctx, false)); } function quotedString(value, ctx) { const { singleQuote } = ctx.options; let qs; if (singleQuote === false) qs = doubleQuotedString; else { const hasDouble = value.includes('"'); const hasSingle = value.includes("'"); if (hasDouble && !hasSingle) qs = singleQuotedString; else if (hasSingle && !hasDouble) qs = doubleQuotedString; else qs = singleQuote ? singleQuotedString : doubleQuotedString; } return qs(value, ctx); } var blockEndNewlines; try { blockEndNewlines = new RegExp("(^|(?\n"; let chomp; let endStart; for (endStart = value.length; endStart > 0; --endStart) { const ch = value[endStart - 1]; if (ch !== "\n" && ch !== " " && ch !== " ") break; } let end = value.substring(endStart); const endNlPos = end.indexOf("\n"); if (endNlPos === -1) { chomp = "-"; } else if (value === end || endNlPos !== end.length - 1) { chomp = "+"; if (onChompKeep) onChompKeep(); } else { chomp = ""; } if (end) { value = value.slice(0, -end.length); if (end[end.length - 1] === "\n") end = end.slice(0, -1); end = end.replace(blockEndNewlines, `$&${indent}`); } let startWithSpace = false; let startEnd; let startNlPos = -1; for (startEnd = 0; startEnd < value.length; ++startEnd) { const ch = value[startEnd]; if (ch === " ") startWithSpace = true; else if (ch === "\n") startNlPos = startEnd; else break; } let start = value.substring(0, startNlPos < startEnd ? startNlPos + 1 : startEnd); if (start) { value = value.substring(start.length); start = start.replace(/\n+/g, `$&${indent}`); } const indentSize = indent ? "2" : "1"; let header = (startWithSpace ? indentSize : "") + chomp; if (comment) { header += " " + commentString(comment.replace(/ ?[\r\n]+/g, " ")); if (onComment) onComment(); } if (!literal) { const foldedValue = value.replace(/\n+/g, "\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, "$1$2").replace(/\n+/g, `$&${indent}`); let literalFallback = false; const foldOptions = getFoldOptions(ctx, true); if (blockQuote !== "folded" && type !== Scalar.Scalar.BLOCK_FOLDED) { foldOptions.onOverflow = () => { literalFallback = true; }; } const body = foldFlowLines.foldFlowLines(`${start}${foldedValue}${end}`, indent, foldFlowLines.FOLD_BLOCK, foldOptions); if (!literalFallback) return `>${header} ${indent}${body}`; } value = value.replace(/\n+/g, `$&${indent}`); return `|${header} ${indent}${start}${value}${end}`; } function plainString(item, ctx, onComment, onChompKeep) { const { type, value } = item; const { actualString, implicitKey, indent, indentStep, inFlow } = ctx; if (implicitKey && value.includes("\n") || inFlow && /[[\]{},]/.test(value)) { return quotedString(value, ctx); } if (/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(value)) { return implicitKey || inFlow || !value.includes("\n") ? quotedString(value, ctx) : blockString(item, ctx, onComment, onChompKeep); } if (!implicitKey && !inFlow && type !== Scalar.Scalar.PLAIN && value.includes("\n")) { return blockString(item, ctx, onComment, onChompKeep); } if (containsDocumentMarker(value)) { if (indent === "") { ctx.forceBlockIndent = true; return blockString(item, ctx, onComment, onChompKeep); } else if (implicitKey && indent === indentStep) { return quotedString(value, ctx); } } const str = value.replace(/\n+/g, `$& ${indent}`); if (actualString) { const test = (tag) => tag.default && tag.tag !== "tag:yaml.org,2002:str" && tag.test?.test(str); const { compat, tags } = ctx.doc.schema; if (tags.some(test) || compat?.some(test)) return quotedString(value, ctx); } return implicitKey ? str : foldFlowLines.foldFlowLines(str, indent, foldFlowLines.FOLD_FLOW, getFoldOptions(ctx, false)); } function stringifyString(item, ctx, onComment, onChompKeep) { const { implicitKey, inFlow } = ctx; const ss = typeof item.value === "string" ? item : Object.assign({}, item, { value: String(item.value) }); let { type } = item; if (type !== Scalar.Scalar.QUOTE_DOUBLE) { if (/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(ss.value)) type = Scalar.Scalar.QUOTE_DOUBLE; } const _stringify = (_type) => { switch (_type) { case Scalar.Scalar.BLOCK_FOLDED: case Scalar.Scalar.BLOCK_LITERAL: return implicitKey || inFlow ? quotedString(ss.value, ctx) : blockString(ss, ctx, onComment, onChompKeep); case Scalar.Scalar.QUOTE_DOUBLE: return doubleQuotedString(ss.value, ctx); case Scalar.Scalar.QUOTE_SINGLE: return singleQuotedString(ss.value, ctx); case Scalar.Scalar.PLAIN: return plainString(ss, ctx, onComment, onChompKeep); default: return null; } }; let res = _stringify(type); if (res === null) { const { defaultKeyType, defaultStringType } = ctx.options; const t = implicitKey && defaultKeyType || defaultStringType; res = _stringify(t); if (res === null) throw new Error(`Unsupported default string type ${t}`); } return res; } exports.stringifyString = stringifyString; } }); var require_stringify = __commonJS2({ ""(exports) { "use strict"; var anchors = require_anchors(); var identity = require_identity(); var stringifyComment = require_stringifyComment(); var stringifyString = require_stringifyString(); function createStringifyContext(doc, options) { const opt = Object.assign({ blockQuote: true, commentString: stringifyComment.stringifyComment, defaultKeyType: null, defaultStringType: "PLAIN", directives: null, doubleQuotedAsJSON: false, doubleQuotedMinMultiLineLength: 40, falseStr: "false", flowCollectionPadding: true, indentSeq: true, lineWidth: 80, minContentWidth: 20, nullStr: "null", simpleKeys: false, singleQuote: null, trailingComma: false, trueStr: "true", verifyAliasOrder: true }, doc.schema.toStringOptions, options); let inFlow; switch (opt.collectionStyle) { case "block": inFlow = false; break; case "flow": inFlow = true; break; default: inFlow = null; } return { anchors: /* @__PURE__ */ new Set(), doc, flowCollectionPadding: opt.flowCollectionPadding ? " " : "", indent: "", indentStep: typeof opt.indent === "number" ? " ".repeat(opt.indent) : " ", inFlow, options: opt }; } function getTagObject(tags, item) { if (item.tag) { const match = tags.filter((t) => t.tag === item.tag); if (match.length > 0) return match.find((t) => t.format === item.format) ?? match[0]; } let tagObj = void 0; let obj; if (identity.isScalar(item)) { obj = item.value; let match = tags.filter((t) => t.identify?.(obj)); if (match.length > 1) { const testMatch = match.filter((t) => t.test); if (testMatch.length > 0) match = testMatch; } tagObj = match.find((t) => t.format === item.format) ?? match.find((t) => !t.format); } else { obj = item; tagObj = tags.find((t) => t.nodeClass && obj instanceof t.nodeClass); } if (!tagObj) { const name = obj?.constructor?.name ?? (obj === null ? "null" : typeof obj); throw new Error(`Tag not resolved for ${name} value`); } return tagObj; } function stringifyProps(node, tagObj, { anchors: anchors$1, doc }) { if (!doc.directives) return ""; const props = []; const anchor = (identity.isScalar(node) || identity.isCollection(node)) && node.anchor; if (anchor && anchors.anchorIsValid(anchor)) { anchors$1.add(anchor); props.push(`&${anchor}`); } const tag = node.tag ?? (tagObj.default ? null : tagObj.tag); if (tag) props.push(doc.directives.tagString(tag)); return props.join(" "); } function stringify(item, ctx, onComment, onChompKeep) { if (identity.isPair(item)) return item.toString(ctx, onComment, onChompKeep); if (identity.isAlias(item)) { if (ctx.doc.directives) return item.toString(ctx); if (ctx.resolvedAliases?.has(item)) { throw new TypeError(`Cannot stringify circular structure without alias nodes`); } else { if (ctx.resolvedAliases) ctx.resolvedAliases.add(item); else ctx.resolvedAliases = /* @__PURE__ */ new Set([item]); item = item.resolve(ctx.doc); } } let tagObj = void 0; const node = identity.isNode(item) ? item : ctx.doc.createNode(item, { onTagObj: (o) => tagObj = o }); tagObj ?? (tagObj = getTagObject(ctx.doc.schema.tags, node)); const props = stringifyProps(node, tagObj, ctx); if (props.length > 0) ctx.indentAtStart = (ctx.indentAtStart ?? 0) + props.length + 1; const str = typeof tagObj.stringify === "function" ? tagObj.stringify(node, ctx, onComment, onChompKeep) : identity.isScalar(node) ? stringifyString.stringifyString(node, ctx, onComment, onChompKeep) : node.toString(ctx, onComment, onChompKeep); if (!props) return str; return identity.isScalar(node) || str[0] === "{" || str[0] === "[" ? `${props} ${str}` : `${props} ${ctx.indent}${str}`; } exports.createStringifyContext = createStringifyContext; exports.stringify = stringify; } }); var require_stringifyPair = __commonJS2({ ""(exports) { "use strict"; var identity = require_identity(); var Scalar = require_Scalar(); var stringify = require_stringify(); var stringifyComment = require_stringifyComment(); function stringifyPair({ key, value }, ctx, onComment, onChompKeep) { const { allNullValues, doc, indent, indentStep, options: { commentString, indentSeq, simpleKeys } } = ctx; let keyComment = identity.isNode(key) && key.comment || null; if (simpleKeys) { if (keyComment) { throw new Error("With simple keys, key nodes cannot have comments"); } if (identity.isCollection(key) || !identity.isNode(key) && typeof key === "object") { const msg = "With simple keys, collection cannot be used as a key value"; throw new Error(msg); } } let explicitKey = !simpleKeys && (!key || keyComment && value == null && !ctx.inFlow || identity.isCollection(key) || (identity.isScalar(key) ? key.type === Scalar.Scalar.BLOCK_FOLDED || key.type === Scalar.Scalar.BLOCK_LITERAL : typeof key === "object")); ctx = Object.assign({}, ctx, { allNullValues: false, implicitKey: !explicitKey && (simpleKeys || !allNullValues), indent: indent + indentStep }); let keyCommentDone = false; let chompKeep = false; let str = stringify.stringify(key, ctx, () => keyCommentDone = true, () => chompKeep = true); if (!explicitKey && !ctx.inFlow && str.length > 1024) { if (simpleKeys) throw new Error("With simple keys, single line scalar must not span more than 1024 characters"); explicitKey = true; } if (ctx.inFlow) { if (allNullValues || value == null) { if (keyCommentDone && onComment) onComment(); return str === "" ? "?" : explicitKey ? `? ${str}` : str; } } else if (allNullValues && !simpleKeys || value == null && explicitKey) { str = `? ${str}`; if (keyComment && !keyCommentDone) { str += stringifyComment.lineComment(str, ctx.indent, commentString(keyComment)); } else if (chompKeep && onChompKeep) onChompKeep(); return str; } if (keyCommentDone) keyComment = null; if (explicitKey) { if (keyComment) str += stringifyComment.lineComment(str, ctx.indent, commentString(keyComment)); str = `? ${str} ${indent}:`; } else { str = `${str}:`; if (keyComment) str += stringifyComment.lineComment(str, ctx.indent, commentString(keyComment)); } let vsb, vcb, valueComment; if (identity.isNode(value)) { vsb = !!value.spaceBefore; vcb = value.commentBefore; valueComment = value.comment; } else { vsb = false; vcb = null; valueComment = null; if (value && typeof value === "object") value = doc.createNode(value); } ctx.implicitKey = false; if (!explicitKey && !keyComment && identity.isScalar(value)) ctx.indentAtStart = str.length + 1; chompKeep = false; if (!indentSeq && indentStep.length >= 2 && !ctx.inFlow && !explicitKey && identity.isSeq(value) && !value.flow && !value.tag && !value.anchor) { ctx.indent = ctx.indent.substring(2); } let valueCommentDone = false; const valueStr = stringify.stringify(value, ctx, () => valueCommentDone = true, () => chompKeep = true); let ws = " "; if (keyComment || vsb || vcb) { ws = vsb ? "\n" : ""; if (vcb) { const cs = commentString(vcb); ws += ` ${stringifyComment.indentComment(cs, ctx.indent)}`; } if (valueStr === "" && !ctx.inFlow) { if (ws === "\n" && valueComment) ws = "\n\n"; } else { ws += ` ${ctx.indent}`; } } else if (!explicitKey && identity.isCollection(value)) { const vs0 = valueStr[0]; const nl0 = valueStr.indexOf("\n"); const hasNewline = nl0 !== -1; const flow = ctx.inFlow ?? value.flow ?? value.items.length === 0; if (hasNewline || !flow) { let hasPropsLine = false; if (hasNewline && (vs0 === "&" || vs0 === "!")) { let sp0 = valueStr.indexOf(" "); if (vs0 === "&" && sp0 !== -1 && sp0 < nl0 && valueStr[sp0 + 1] === "!") { sp0 = valueStr.indexOf(" ", sp0 + 1); } if (sp0 === -1 || nl0 < sp0) hasPropsLine = true; } if (!hasPropsLine) ws = ` ${ctx.indent}`; } } else if (valueStr === "" || valueStr[0] === "\n") { ws = ""; } str += ws + valueStr; if (ctx.inFlow) { if (valueCommentDone && onComment) onComment(); } else if (valueComment && !valueCommentDone) { str += stringifyComment.lineComment(str, ctx.indent, commentString(valueComment)); } else if (chompKeep && onChompKeep) { onChompKeep(); } return str; } exports.stringifyPair = stringifyPair; } }); var require_log = __commonJS2({ ""(exports) { "use strict"; var node_process = __require2("process"); function debug2(logLevel, ...messages) { if (logLevel === "debug") console.log(...messages); } function warn(logLevel, warning) { if (logLevel === "debug" || logLevel === "warn") { if (typeof node_process.emitWarning === "function") node_process.emitWarning(warning); else console.warn(warning); } } exports.debug = debug2; exports.warn = warn; } }); var require_merge = __commonJS2({ ""(exports) { "use strict"; var identity = require_identity(); var Scalar = require_Scalar(); var MERGE_KEY = "<<"; var merge22 = { identify: (value) => value === MERGE_KEY || typeof value === "symbol" && value.description === MERGE_KEY, default: "key", tag: "tag:yaml.org,2002:merge", test: /^<<$/, resolve: () => Object.assign(new Scalar.Scalar(Symbol(MERGE_KEY)), { addToJSMap: addMergeToJSMap }), stringify: () => MERGE_KEY }; var isMergeKey = (ctx, key) => (merge22.identify(key) || identity.isScalar(key) && (!key.type || key.type === Scalar.Scalar.PLAIN) && merge22.identify(key.value)) && ctx?.doc.schema.tags.some((tag) => tag.tag === merge22.tag && tag.default); function addMergeToJSMap(ctx, map, value) { value = ctx && identity.isAlias(value) ? value.resolve(ctx.doc) : value; if (identity.isSeq(value)) for (const it of value.items) mergeValue(ctx, map, it); else if (Array.isArray(value)) for (const it of value) mergeValue(ctx, map, it); else mergeValue(ctx, map, value); } function mergeValue(ctx, map, value) { const source = ctx && identity.isAlias(value) ? value.resolve(ctx.doc) : value; if (!identity.isMap(source)) throw new Error("Merge sources must be maps or map aliases"); const srcMap = source.toJSON(null, ctx, Map); for (const [key, value2] of srcMap) { if (map instanceof Map) { if (!map.has(key)) map.set(key, value2); } else if (map instanceof Set) { map.add(key); } else if (!Object.prototype.hasOwnProperty.call(map, key)) { Object.defineProperty(map, key, { value: value2, writable: true, enumerable: true, configurable: true }); } } return map; } exports.addMergeToJSMap = addMergeToJSMap; exports.isMergeKey = isMergeKey; exports.merge = merge22; } }); var require_addPairToJSMap = __commonJS2({ ""(exports) { "use strict"; var log = require_log(); var merge22 = require_merge(); var stringify = require_stringify(); var identity = require_identity(); var toJS = require_toJS(); function addPairToJSMap(ctx, map, { key, value }) { if (identity.isNode(key) && key.addToJSMap) key.addToJSMap(ctx, map, value); else if (merge22.isMergeKey(ctx, key)) merge22.addMergeToJSMap(ctx, map, value); else { const jsKey = toJS.toJS(key, "", ctx); if (map instanceof Map) { map.set(jsKey, toJS.toJS(value, jsKey, ctx)); } else if (map instanceof Set) { map.add(jsKey); } else { const stringKey = stringifyKey(key, jsKey, ctx); const jsValue = toJS.toJS(value, stringKey, ctx); if (stringKey in map) Object.defineProperty(map, stringKey, { value: jsValue, writable: true, enumerable: true, configurable: true }); else map[stringKey] = jsValue; } } return map; } function stringifyKey(key, jsKey, ctx) { if (jsKey === null) return ""; if (typeof jsKey !== "object") return String(jsKey); if (identity.isNode(key) && ctx?.doc) { const strCtx = stringify.createStringifyContext(ctx.doc, {}); strCtx.anchors = /* @__PURE__ */ new Set(); for (const node of ctx.anchors.keys()) strCtx.anchors.add(node.anchor); strCtx.inFlow = true; strCtx.inStringifyKey = true; const strKey = key.toString(strCtx); if (!ctx.mapKeyWarned) { let jsonStr = JSON.stringify(strKey); if (jsonStr.length > 40) jsonStr = jsonStr.substring(0, 36) + '..."'; log.warn(ctx.doc.options.logLevel, `Keys with collection values will be stringified due to JS Object restrictions: ${jsonStr}. Set mapAsMap: true to use object keys.`); ctx.mapKeyWarned = true; } return strKey; } return JSON.stringify(jsKey); } exports.addPairToJSMap = addPairToJSMap; } }); var require_Pair = __commonJS2({ ""(exports) { "use strict"; var createNode = require_createNode(); var stringifyPair = require_stringifyPair(); var addPairToJSMap = require_addPairToJSMap(); var identity = require_identity(); function createPair(key, value, ctx) { const k = createNode.createNode(key, void 0, ctx); const v = createNode.createNode(value, void 0, ctx); return new Pair(k, v); } var Pair = class _Pair { constructor(key, value = null) { Object.defineProperty(this, identity.NODE_TYPE, { value: identity.PAIR }); this.key = key; this.value = value; } clone(schema) { let { key, value } = this; if (identity.isNode(key)) key = key.clone(schema); if (identity.isNode(value)) value = value.clone(schema); return new _Pair(key, value); } toJSON(_, ctx) { const pair = ctx?.mapAsMap ? /* @__PURE__ */ new Map() : {}; return addPairToJSMap.addPairToJSMap(ctx, pair, this); } toString(ctx, onComment, onChompKeep) { return ctx?.doc ? stringifyPair.stringifyPair(this, ctx, onComment, onChompKeep) : JSON.stringify(this); } }; exports.Pair = Pair; exports.createPair = createPair; } }); var require_stringifyCollection = __commonJS2({ ""(exports) { "use strict"; var identity = require_identity(); var stringify = require_stringify(); var stringifyComment = require_stringifyComment(); function stringifyCollection(collection, ctx, options) { const flow = ctx.inFlow ?? collection.flow; const stringify2 = flow ? stringifyFlowCollection : stringifyBlockCollection; return stringify2(collection, ctx, options); } function stringifyBlockCollection({ comment, items }, ctx, { blockItemPrefix, flowChars, itemIndent, onChompKeep, onComment }) { const { indent, options: { commentString } } = ctx; const itemCtx = Object.assign({}, ctx, { indent: itemIndent, type: null }); let chompKeep = false; const lines = []; for (let i = 0; i < items.length; ++i) { const item = items[i]; let comment2 = null; if (identity.isNode(item)) { if (!chompKeep && item.spaceBefore) lines.push(""); addCommentBefore(ctx, lines, item.commentBefore, chompKeep); if (item.comment) comment2 = item.comment; } else if (identity.isPair(item)) { const ik = identity.isNode(item.key) ? item.key : null; if (ik) { if (!chompKeep && ik.spaceBefore) lines.push(""); addCommentBefore(ctx, lines, ik.commentBefore, chompKeep); } } chompKeep = false; let str2 = stringify.stringify(item, itemCtx, () => comment2 = null, () => chompKeep = true); if (comment2) str2 += stringifyComment.lineComment(str2, itemIndent, commentString(comment2)); if (chompKeep && comment2) chompKeep = false; lines.push(blockItemPrefix + str2); } let str; if (lines.length === 0) { str = flowChars.start + flowChars.end; } else { str = lines[0]; for (let i = 1; i < lines.length; ++i) { const line = lines[i]; str += line ? ` ${indent}${line}` : "\n"; } } if (comment) { str += "\n" + stringifyComment.indentComment(commentString(comment), indent); if (onComment) onComment(); } else if (chompKeep && onChompKeep) onChompKeep(); return str; } function stringifyFlowCollection({ items }, ctx, { flowChars, itemIndent }) { const { indent, indentStep, flowCollectionPadding: fcPadding, options: { commentString } } = ctx; itemIndent += indentStep; const itemCtx = Object.assign({}, ctx, { indent: itemIndent, inFlow: true, type: null }); let reqNewline = false; let linesAtValue = 0; const lines = []; for (let i = 0; i < items.length; ++i) { const item = items[i]; let comment = null; if (identity.isNode(item)) { if (item.spaceBefore) lines.push(""); addCommentBefore(ctx, lines, item.commentBefore, false); if (item.comment) comment = item.comment; } else if (identity.isPair(item)) { const ik = identity.isNode(item.key) ? item.key : null; if (ik) { if (ik.spaceBefore) lines.push(""); addCommentBefore(ctx, lines, ik.commentBefore, false); if (ik.comment) reqNewline = true; } const iv = identity.isNode(item.value) ? item.value : null; if (iv) { if (iv.comment) comment = iv.comment; if (iv.commentBefore) reqNewline = true; } else if (item.value == null && ik?.comment) { comment = ik.comment; } } if (comment) reqNewline = true; let str = stringify.stringify(item, itemCtx, () => comment = null); reqNewline || (reqNewline = lines.length > linesAtValue || str.includes("\n")); if (i < items.length - 1) { str += ","; } else if (ctx.options.trailingComma) { if (ctx.options.lineWidth > 0) { reqNewline || (reqNewline = lines.reduce((sum, line) => sum + line.length + 2, 2) + (str.length + 2) > ctx.options.lineWidth); } if (reqNewline) { str += ","; } } if (comment) str += stringifyComment.lineComment(str, itemIndent, commentString(comment)); lines.push(str); linesAtValue = lines.length; } const { start, end } = flowChars; if (lines.length === 0) { return start + end; } else { if (!reqNewline) { const len = lines.reduce((sum, line) => sum + line.length + 2, 2); reqNewline = ctx.options.lineWidth > 0 && len > ctx.options.lineWidth; } if (reqNewline) { let str = start; for (const line of lines) str += line ? ` ${indentStep}${indent}${line}` : "\n"; return `${str} ${indent}${end}`; } else { return `${start}${fcPadding}${lines.join(" ")}${fcPadding}${end}`; } } } function addCommentBefore({ indent, options: { commentString } }, lines, comment, chompKeep) { if (comment && chompKeep) comment = comment.replace(/^\n+/, ""); if (comment) { const ic = stringifyComment.indentComment(commentString(comment), indent); lines.push(ic.trimStart()); } } exports.stringifyCollection = stringifyCollection; } }); var require_YAMLMap = __commonJS2({ ""(exports) { "use strict"; var stringifyCollection = require_stringifyCollection(); var addPairToJSMap = require_addPairToJSMap(); var Collection22 = require_Collection(); var identity = require_identity(); var Pair = require_Pair(); var Scalar = require_Scalar(); function findPair(items, key) { const k = identity.isScalar(key) ? key.value : key; for (const it of items) { if (identity.isPair(it)) { if (it.key === key || it.key === k) return it; if (identity.isScalar(it.key) && it.key.value === k) return it; } } return void 0; } var YAMLMap = class extends Collection22.Collection { static get tagName() { return "tag:yaml.org,2002:map"; } constructor(schema) { super(identity.MAP, schema); this.items = []; } /** * A generic collection parsing method that can be extended * to other node classes that inherit from YAMLMap */ static from(schema, obj, ctx) { const { keepUndefined, replacer } = ctx; const map = new this(schema); const add = (key, value) => { if (typeof replacer === "function") value = replacer.call(obj, key, value); else if (Array.isArray(replacer) && !replacer.includes(key)) return; if (value !== void 0 || keepUndefined) map.items.push(Pair.createPair(key, value, ctx)); }; if (obj instanceof Map) { for (const [key, value] of obj) add(key, value); } else if (obj && typeof obj === "object") { for (const key of Object.keys(obj)) add(key, obj[key]); } if (typeof schema.sortMapEntries === "function") { map.items.sort(schema.sortMapEntries); } return map; } /** * Adds a value to the collection. * * @param overwrite - If not set `true`, using a key that is already in the * collection will throw. Otherwise, overwrites the previous value. */ add(pair, overwrite) { let _pair; if (identity.isPair(pair)) _pair = pair; else if (!pair || typeof pair !== "object" || !("key" in pair)) { _pair = new Pair.Pair(pair, pair?.value); } else _pair = new Pair.Pair(pair.key, pair.value); const prev = findPair(this.items, _pair.key); const sortEntries = this.schema?.sortMapEntries; if (prev) { if (!overwrite) throw new Error(`Key ${_pair.key} already set`); if (identity.isScalar(prev.value) && Scalar.isScalarValue(_pair.value)) prev.value.value = _pair.value; else prev.value = _pair.value; } else if (sortEntries) { const i = this.items.findIndex((item) => sortEntries(_pair, item) < 0); if (i === -1) this.items.push(_pair); else this.items.splice(i, 0, _pair); } else { this.items.push(_pair); } } delete(key) { const it = findPair(this.items, key); if (!it) return false; const del = this.items.splice(this.items.indexOf(it), 1); return del.length > 0; } get(key, keepScalar) { const it = findPair(this.items, key); const node = it?.value; return (!keepScalar && identity.isScalar(node) ? node.value : node) ?? void 0; } has(key) { return !!findPair(this.items, key); } set(key, value) { this.add(new Pair.Pair(key, value), true); } /** * @param ctx - Conversion context, originally set in Document#toJS() * @param {Class} Type - If set, forces the returned collection type * @returns Instance of Type, Map, or Object */ toJSON(_, ctx, Type) { const map = Type ? new Type() : ctx?.mapAsMap ? /* @__PURE__ */ new Map() : {}; if (ctx?.onCreate) ctx.onCreate(map); for (const item of this.items) addPairToJSMap.addPairToJSMap(ctx, map, item); return map; } toString(ctx, onComment, onChompKeep) { if (!ctx) return JSON.stringify(this); for (const item of this.items) { if (!identity.isPair(item)) throw new Error(`Map items must all be pairs; found ${JSON.stringify(item)} instead`); } if (!ctx.allNullValues && this.hasAllNullValues(false)) ctx = Object.assign({}, ctx, { allNullValues: true }); return stringifyCollection.stringifyCollection(this, ctx, { blockItemPrefix: "", flowChars: { start: "{", end: "}" }, itemIndent: ctx.indent || "", onChompKeep, onComment }); } }; exports.YAMLMap = YAMLMap; exports.findPair = findPair; } }); var require_map = __commonJS2({ ""(exports) { "use strict"; var identity = require_identity(); var YAMLMap = require_YAMLMap(); var map = { collection: "map", default: true, nodeClass: YAMLMap.YAMLMap, tag: "tag:yaml.org,2002:map", resolve(map2, onError) { if (!identity.isMap(map2)) onError("Expected a mapping for this tag"); return map2; }, createNode: (schema, obj, ctx) => YAMLMap.YAMLMap.from(schema, obj, ctx) }; exports.map = map; } }); var require_YAMLSeq = __commonJS2({ ""(exports) { "use strict"; var createNode = require_createNode(); var stringifyCollection = require_stringifyCollection(); var Collection22 = require_Collection(); var identity = require_identity(); var Scalar = require_Scalar(); var toJS = require_toJS(); var YAMLSeq = class extends Collection22.Collection { static get tagName() { return "tag:yaml.org,2002:seq"; } constructor(schema) { super(identity.SEQ, schema); this.items = []; } add(value) { this.items.push(value); } /** * Removes a value from the collection. * * `key` must contain a representation of an integer for this to succeed. * It may be wrapped in a `Scalar`. * * @returns `true` if the item was found and removed. */ delete(key) { const idx = asItemIndex(key); if (typeof idx !== "number") return false; const del = this.items.splice(idx, 1); return del.length > 0; } get(key, keepScalar) { const idx = asItemIndex(key); if (typeof idx !== "number") return void 0; const it = this.items[idx]; return !keepScalar && identity.isScalar(it) ? it.value : it; } /** * Checks if the collection includes a value with the key `key`. * * `key` must contain a representation of an integer for this to succeed. * It may be wrapped in a `Scalar`. */ has(key) { const idx = asItemIndex(key); return typeof idx === "number" && idx < this.items.length; } /** * Sets a value in this collection. For `!!set`, `value` needs to be a * boolean to add/remove the item from the set. * * If `key` does not contain a representation of an integer, this will throw. * It may be wrapped in a `Scalar`. */ set(key, value) { const idx = asItemIndex(key); if (typeof idx !== "number") throw new Error(`Expected a valid index, not ${key}.`); const prev = this.items[idx]; if (identity.isScalar(prev) && Scalar.isScalarValue(value)) prev.value = value; else this.items[idx] = value; } toJSON(_, ctx) { const seq = []; if (ctx?.onCreate) ctx.onCreate(seq); let i = 0; for (const item of this.items) seq.push(toJS.toJS(item, String(i++), ctx)); return seq; } toString(ctx, onComment, onChompKeep) { if (!ctx) return JSON.stringify(this); return stringifyCollection.stringifyCollection(this, ctx, { blockItemPrefix: "- ", flowChars: { start: "[", end: "]" }, itemIndent: (ctx.indent || "") + " ", onChompKeep, onComment }); } static from(schema, obj, ctx) { const { replacer } = ctx; const seq = new this(schema); if (obj && Symbol.iterator in Object(obj)) { let i = 0; for (let it of obj) { if (typeof replacer === "function") { const key = obj instanceof Set ? it : String(i++); it = replacer.call(obj, key, it); } seq.items.push(createNode.createNode(it, void 0, ctx)); } } return seq; } }; function asItemIndex(key) { let idx = identity.isScalar(key) ? key.value : key; if (idx && typeof idx === "string") idx = Number(idx); return typeof idx === "number" && Number.isInteger(idx) && idx >= 0 ? idx : null; } exports.YAMLSeq = YAMLSeq; } }); var require_seq = __commonJS2({ ""(exports) { "use strict"; var identity = require_identity(); var YAMLSeq = require_YAMLSeq(); var seq = { collection: "seq", default: true, nodeClass: YAMLSeq.YAMLSeq, tag: "tag:yaml.org,2002:seq", resolve(seq2, onError) { if (!identity.isSeq(seq2)) onError("Expected a sequence for this tag"); return seq2; }, createNode: (schema, obj, ctx) => YAMLSeq.YAMLSeq.from(schema, obj, ctx) }; exports.seq = seq; } }); var require_string = __commonJS2({ ""(exports) { "use strict"; var stringifyString = require_stringifyString(); var string = { identify: (value) => typeof value === "string", default: true, tag: "tag:yaml.org,2002:str", resolve: (str) => str, stringify(item, ctx, onComment, onChompKeep) { ctx = Object.assign({ actualString: true }, ctx); return stringifyString.stringifyString(item, ctx, onComment, onChompKeep); } }; exports.string = string; } }); var require_null = __commonJS2({ ""(exports) { "use strict"; var Scalar = require_Scalar(); var nullTag = { identify: (value) => value == null, createNode: () => new Scalar.Scalar(null), default: true, tag: "tag:yaml.org,2002:null", test: /^(?:~|[Nn]ull|NULL)?$/, resolve: () => new Scalar.Scalar(null), stringify: ({ source }, ctx) => typeof source === "string" && nullTag.test.test(source) ? source : ctx.options.nullStr }; exports.nullTag = nullTag; } }); var require_bool = __commonJS2({ ""(exports) { "use strict"; var Scalar = require_Scalar(); var boolTag = { identify: (value) => typeof value === "boolean", default: true, tag: "tag:yaml.org,2002:bool", test: /^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/, resolve: (str) => new Scalar.Scalar(str[0] === "t" || str[0] === "T"), stringify({ source, value }, ctx) { if (source && boolTag.test.test(source)) { const sv = source[0] === "t" || source[0] === "T"; if (value === sv) return source; } return value ? ctx.options.trueStr : ctx.options.falseStr; } }; exports.boolTag = boolTag; } }); var require_stringifyNumber = __commonJS2({ ""(exports) { "use strict"; function stringifyNumber({ format: format3, minFractionDigits, tag, value }) { if (typeof value === "bigint") return String(value); const num = typeof value === "number" ? value : Number(value); if (!isFinite(num)) return isNaN(num) ? ".nan" : num < 0 ? "-.inf" : ".inf"; let n = Object.is(value, -0) ? "-0" : JSON.stringify(value); if (!format3 && minFractionDigits && (!tag || tag === "tag:yaml.org,2002:float") && /^\d/.test(n)) { let i = n.indexOf("."); if (i < 0) { i = n.length; n += "."; } let d = minFractionDigits - (n.length - i - 1); while (d-- > 0) n += "0"; } return n; } exports.stringifyNumber = stringifyNumber; } }); var require_float = __commonJS2({ ""(exports) { "use strict"; var Scalar = require_Scalar(); var stringifyNumber = require_stringifyNumber(); var floatNaN = { identify: (value) => typeof value === "number", default: true, tag: "tag:yaml.org,2002:float", test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/, resolve: (str) => str.slice(-3).toLowerCase() === "nan" ? NaN : str[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY, stringify: stringifyNumber.stringifyNumber }; var floatExp = { identify: (value) => typeof value === "number", default: true, tag: "tag:yaml.org,2002:float", format: "EXP", test: /^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/, resolve: (str) => parseFloat(str), stringify(node) { const num = Number(node.value); return isFinite(num) ? num.toExponential() : stringifyNumber.stringifyNumber(node); } }; var float = { identify: (value) => typeof value === "number", default: true, tag: "tag:yaml.org,2002:float", test: /^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/, resolve(str) { const node = new Scalar.Scalar(parseFloat(str)); const dot = str.indexOf("."); if (dot !== -1 && str[str.length - 1] === "0") node.minFractionDigits = str.length - dot - 1; return node; }, stringify: stringifyNumber.stringifyNumber }; exports.float = float; exports.floatExp = floatExp; exports.floatNaN = floatNaN; } }); var require_int = __commonJS2({ ""(exports) { "use strict"; var stringifyNumber = require_stringifyNumber(); var intIdentify = (value) => typeof value === "bigint" || Number.isInteger(value); var intResolve = (str, offset, radix, { intAsBigInt }) => intAsBigInt ? BigInt(str) : parseInt(str.substring(offset), radix); function intStringify(node, radix, prefix) { const { value } = node; if (intIdentify(value) && value >= 0) return prefix + value.toString(radix); return stringifyNumber.stringifyNumber(node); } var intOct = { identify: (value) => intIdentify(value) && value >= 0, default: true, tag: "tag:yaml.org,2002:int", format: "OCT", test: /^0o[0-7]+$/, resolve: (str, _onError, opt) => intResolve(str, 2, 8, opt), stringify: (node) => intStringify(node, 8, "0o") }; var int = { identify: intIdentify, default: true, tag: "tag:yaml.org,2002:int", test: /^[-+]?[0-9]+$/, resolve: (str, _onError, opt) => intResolve(str, 0, 10, opt), stringify: stringifyNumber.stringifyNumber }; var intHex = { identify: (value) => intIdentify(value) && value >= 0, default: true, tag: "tag:yaml.org,2002:int", format: "HEX", test: /^0x[0-9a-fA-F]+$/, resolve: (str, _onError, opt) => intResolve(str, 2, 16, opt), stringify: (node) => intStringify(node, 16, "0x") }; exports.int = int; exports.intHex = intHex; exports.intOct = intOct; } }); var require_schema = __commonJS2({ ""(exports) { "use strict"; var map = require_map(); var _null = require_null(); var seq = require_seq(); var string = require_string(); var bool = require_bool(); var float = require_float(); var int = require_int(); var schema = [ map.map, seq.seq, string.string, _null.nullTag, bool.boolTag, int.intOct, int.int, int.intHex, float.floatNaN, float.floatExp, float.float ]; exports.schema = schema; } }); var require_schema2 = __commonJS2({ ""(exports) { "use strict"; var Scalar = require_Scalar(); var map = require_map(); var seq = require_seq(); function intIdentify(value) { return typeof value === "bigint" || Number.isInteger(value); } var stringifyJSON = ({ value }) => JSON.stringify(value); var jsonScalars = [ { identify: (value) => typeof value === "string", default: true, tag: "tag:yaml.org,2002:str", resolve: (str) => str, stringify: stringifyJSON }, { identify: (value) => value == null, createNode: () => new Scalar.Scalar(null), default: true, tag: "tag:yaml.org,2002:null", test: /^null$/, resolve: () => null, stringify: stringifyJSON }, { identify: (value) => typeof value === "boolean", default: true, tag: "tag:yaml.org,2002:bool", test: /^true$|^false$/, resolve: (str) => str === "true", stringify: stringifyJSON }, { identify: intIdentify, default: true, tag: "tag:yaml.org,2002:int", test: /^-?(?:0|[1-9][0-9]*)$/, resolve: (str, _onError, { intAsBigInt }) => intAsBigInt ? BigInt(str) : parseInt(str, 10), stringify: ({ value }) => intIdentify(value) ? value.toString() : JSON.stringify(value) }, { identify: (value) => typeof value === "number", default: true, tag: "tag:yaml.org,2002:float", test: /^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/, resolve: (str) => parseFloat(str), stringify: stringifyJSON } ]; var jsonError = { default: true, tag: "", test: /^/, resolve(str, onError) { onError(`Unresolved plain scalar ${JSON.stringify(str)}`); return str; } }; var schema = [map.map, seq.seq].concat(jsonScalars, jsonError); exports.schema = schema; } }); var require_binary = __commonJS2({ ""(exports) { "use strict"; var node_buffer = __require2("buffer"); var Scalar = require_Scalar(); var stringifyString = require_stringifyString(); var binary = { identify: (value) => value instanceof Uint8Array, // Buffer inherits from Uint8Array default: false, tag: "tag:yaml.org,2002:binary", /** * Returns a Buffer in node and an Uint8Array in browsers * * To use the resulting buffer as an image, you'll want to do something like: * * const blob = new Blob([buffer], { type: 'image/jpeg' }) * document.querySelector('#photo').src = URL.createObjectURL(blob) */ resolve(src, onError) { if (typeof node_buffer.Buffer === "function") { return node_buffer.Buffer.from(src, "base64"); } else if (typeof atob === "function") { const str = atob(src.replace(/[\n\r]/g, "")); const buffer = new Uint8Array(str.length); for (let i = 0; i < str.length; ++i) buffer[i] = str.charCodeAt(i); return buffer; } else { onError("This environment does not support reading binary tags; either Buffer or atob is required"); return src; } }, stringify({ comment, type, value }, ctx, onComment, onChompKeep) { if (!value) return ""; const buf = value; let str; if (typeof node_buffer.Buffer === "function") { str = buf instanceof node_buffer.Buffer ? buf.toString("base64") : node_buffer.Buffer.from(buf.buffer).toString("base64"); } else if (typeof btoa === "function") { let s = ""; for (let i = 0; i < buf.length; ++i) s += String.fromCharCode(buf[i]); str = btoa(s); } else { throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required"); } type ?? (type = Scalar.Scalar.BLOCK_LITERAL); if (type !== Scalar.Scalar.QUOTE_DOUBLE) { const lineWidth = Math.max(ctx.options.lineWidth - ctx.indent.length, ctx.options.minContentWidth); const n = Math.ceil(str.length / lineWidth); const lines = new Array(n); for (let i = 0, o = 0; i < n; ++i, o += lineWidth) { lines[i] = str.substr(o, lineWidth); } str = lines.join(type === Scalar.Scalar.BLOCK_LITERAL ? "\n" : " "); } return stringifyString.stringifyString({ comment, type, value: str }, ctx, onComment, onChompKeep); } }; exports.binary = binary; } }); var require_pairs = __commonJS2({ ""(exports) { "use strict"; var identity = require_identity(); var Pair = require_Pair(); var Scalar = require_Scalar(); var YAMLSeq = require_YAMLSeq(); function resolvePairs(seq, onError) { if (identity.isSeq(seq)) { for (let i = 0; i < seq.items.length; ++i) { let item = seq.items[i]; if (identity.isPair(item)) continue; else if (identity.isMap(item)) { if (item.items.length > 1) onError("Each pair must have its own sequence indicator"); const pair = item.items[0] || new Pair.Pair(new Scalar.Scalar(null)); if (item.commentBefore) pair.key.commentBefore = pair.key.commentBefore ? `${item.commentBefore} ${pair.key.commentBefore}` : item.commentBefore; if (item.comment) { const cn = pair.value ?? pair.key; cn.comment = cn.comment ? `${item.comment} ${cn.comment}` : item.comment; } item = pair; } seq.items[i] = identity.isPair(item) ? item : new Pair.Pair(item); } } else onError("Expected a sequence for this tag"); return seq; } function createPairs(schema, iterable, ctx) { const { replacer } = ctx; const pairs2 = new YAMLSeq.YAMLSeq(schema); pairs2.tag = "tag:yaml.org,2002:pairs"; let i = 0; if (iterable && Symbol.iterator in Object(iterable)) for (let it of iterable) { if (typeof replacer === "function") it = replacer.call(iterable, String(i++), it); let key, value; if (Array.isArray(it)) { if (it.length === 2) { key = it[0]; value = it[1]; } else throw new TypeError(`Expected [key, value] tuple: ${it}`); } else if (it && it instanceof Object) { const keys = Object.keys(it); if (keys.length === 1) { key = keys[0]; value = it[key]; } else { throw new TypeError(`Expected tuple with one key, not ${keys.length} keys`); } } else { key = it; } pairs2.items.push(Pair.createPair(key, value, ctx)); } return pairs2; } var pairs = { collection: "seq", default: false, tag: "tag:yaml.org,2002:pairs", resolve: resolvePairs, createNode: createPairs }; exports.createPairs = createPairs; exports.pairs = pairs; exports.resolvePairs = resolvePairs; } }); var require_omap = __commonJS2({ ""(exports) { "use strict"; var identity = require_identity(); var toJS = require_toJS(); var YAMLMap = require_YAMLMap(); var YAMLSeq = require_YAMLSeq(); var pairs = require_pairs(); var YAMLOMap = class _YAMLOMap extends YAMLSeq.YAMLSeq { constructor() { super(); this.add = YAMLMap.YAMLMap.prototype.add.bind(this); this.delete = YAMLMap.YAMLMap.prototype.delete.bind(this); this.get = YAMLMap.YAMLMap.prototype.get.bind(this); this.has = YAMLMap.YAMLMap.prototype.has.bind(this); this.set = YAMLMap.YAMLMap.prototype.set.bind(this); this.tag = _YAMLOMap.tag; } /** * If `ctx` is given, the return type is actually `Map`, * but TypeScript won't allow widening the signature of a child method. */ toJSON(_, ctx) { if (!ctx) return super.toJSON(_); const map = /* @__PURE__ */ new Map(); if (ctx?.onCreate) ctx.onCreate(map); for (const pair of this.items) { let key, value; if (identity.isPair(pair)) { key = toJS.toJS(pair.key, "", ctx); value = toJS.toJS(pair.value, key, ctx); } else { key = toJS.toJS(pair, "", ctx); } if (map.has(key)) throw new Error("Ordered maps must not include duplicate keys"); map.set(key, value); } return map; } static from(schema, iterable, ctx) { const pairs$1 = pairs.createPairs(schema, iterable, ctx); const omap2 = new this(); omap2.items = pairs$1.items; return omap2; } }; YAMLOMap.tag = "tag:yaml.org,2002:omap"; var omap = { collection: "seq", identify: (value) => value instanceof Map, nodeClass: YAMLOMap, default: false, tag: "tag:yaml.org,2002:omap", resolve(seq, onError) { const pairs$1 = pairs.resolvePairs(seq, onError); const seenKeys = []; for (const { key } of pairs$1.items) { if (identity.isScalar(key)) { if (seenKeys.includes(key.value)) { onError(`Ordered maps must not include duplicate keys: ${key.value}`); } else { seenKeys.push(key.value); } } } return Object.assign(new YAMLOMap(), pairs$1); }, createNode: (schema, iterable, ctx) => YAMLOMap.from(schema, iterable, ctx) }; exports.YAMLOMap = YAMLOMap; exports.omap = omap; } }); var require_bool2 = __commonJS2({ ""(exports) { "use strict"; var Scalar = require_Scalar(); function boolStringify({ value, source }, ctx) { const boolObj = value ? trueTag : falseTag; if (source && boolObj.test.test(source)) return source; return value ? ctx.options.trueStr : ctx.options.falseStr; } var trueTag = { identify: (value) => value === true, default: true, tag: "tag:yaml.org,2002:bool", test: /^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/, resolve: () => new Scalar.Scalar(true), stringify: boolStringify }; var falseTag = { identify: (value) => value === false, default: true, tag: "tag:yaml.org,2002:bool", test: /^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/, resolve: () => new Scalar.Scalar(false), stringify: boolStringify }; exports.falseTag = falseTag; exports.trueTag = trueTag; } }); var require_float2 = __commonJS2({ ""(exports) { "use strict"; var Scalar = require_Scalar(); var stringifyNumber = require_stringifyNumber(); var floatNaN = { identify: (value) => typeof value === "number", default: true, tag: "tag:yaml.org,2002:float", test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/, resolve: (str) => str.slice(-3).toLowerCase() === "nan" ? NaN : str[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY, stringify: stringifyNumber.stringifyNumber }; var floatExp = { identify: (value) => typeof value === "number", default: true, tag: "tag:yaml.org,2002:float", format: "EXP", test: /^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/, resolve: (str) => parseFloat(str.replace(/_/g, "")), stringify(node) { const num = Number(node.value); return isFinite(num) ? num.toExponential() : stringifyNumber.stringifyNumber(node); } }; var float = { identify: (value) => typeof value === "number", default: true, tag: "tag:yaml.org,2002:float", test: /^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/, resolve(str) { const node = new Scalar.Scalar(parseFloat(str.replace(/_/g, ""))); const dot = str.indexOf("."); if (dot !== -1) { const f = str.substring(dot + 1).replace(/_/g, ""); if (f[f.length - 1] === "0") node.minFractionDigits = f.length; } return node; }, stringify: stringifyNumber.stringifyNumber }; exports.float = float; exports.floatExp = floatExp; exports.floatNaN = floatNaN; } }); var require_int2 = __commonJS2({ ""(exports) { "use strict"; var stringifyNumber = require_stringifyNumber(); var intIdentify = (value) => typeof value === "bigint" || Number.isInteger(value); function intResolve(str, offset, radix, { intAsBigInt }) { const sign = str[0]; if (sign === "-" || sign === "+") offset += 1; str = str.substring(offset).replace(/_/g, ""); if (intAsBigInt) { switch (radix) { case 2: str = `0b${str}`; break; case 8: str = `0o${str}`; break; case 16: str = `0x${str}`; break; } const n2 = BigInt(str); return sign === "-" ? BigInt(-1) * n2 : n2; } const n = parseInt(str, radix); return sign === "-" ? -1 * n : n; } function intStringify(node, radix, prefix) { const { value } = node; if (intIdentify(value)) { const str = value.toString(radix); return value < 0 ? "-" + prefix + str.substr(1) : prefix + str; } return stringifyNumber.stringifyNumber(node); } var intBin = { identify: intIdentify, default: true, tag: "tag:yaml.org,2002:int", format: "BIN", test: /^[-+]?0b[0-1_]+$/, resolve: (str, _onError, opt) => intResolve(str, 2, 2, opt), stringify: (node) => intStringify(node, 2, "0b") }; var intOct = { identify: intIdentify, default: true, tag: "tag:yaml.org,2002:int", format: "OCT", test: /^[-+]?0[0-7_]+$/, resolve: (str, _onError, opt) => intResolve(str, 1, 8, opt), stringify: (node) => intStringify(node, 8, "0") }; var int = { identify: intIdentify, default: true, tag: "tag:yaml.org,2002:int", test: /^[-+]?[0-9][0-9_]*$/, resolve: (str, _onError, opt) => intResolve(str, 0, 10, opt), stringify: stringifyNumber.stringifyNumber }; var intHex = { identify: intIdentify, default: true, tag: "tag:yaml.org,2002:int", format: "HEX", test: /^[-+]?0x[0-9a-fA-F_]+$/, resolve: (str, _onError, opt) => intResolve(str, 2, 16, opt), stringify: (node) => intStringify(node, 16, "0x") }; exports.int = int; exports.intBin = intBin; exports.intHex = intHex; exports.intOct = intOct; } }); var require_set = __commonJS2({ ""(exports) { "use strict"; var identity = require_identity(); var Pair = require_Pair(); var YAMLMap = require_YAMLMap(); var YAMLSet = class _YAMLSet extends YAMLMap.YAMLMap { constructor(schema) { super(schema); this.tag = _YAMLSet.tag; } add(key) { let pair; if (identity.isPair(key)) pair = key; else if (key && typeof key === "object" && "key" in key && "value" in key && key.value === null) pair = new Pair.Pair(key.key, null); else pair = new Pair.Pair(key, null); const prev = YAMLMap.findPair(this.items, pair.key); if (!prev) this.items.push(pair); } /** * If `keepPair` is `true`, returns the Pair matching `key`. * Otherwise, returns the value of that Pair's key. */ get(key, keepPair) { const pair = YAMLMap.findPair(this.items, key); return !keepPair && identity.isPair(pair) ? identity.isScalar(pair.key) ? pair.key.value : pair.key : pair; } set(key, value) { if (typeof value !== "boolean") throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof value}`); const prev = YAMLMap.findPair(this.items, key); if (prev && !value) { this.items.splice(this.items.indexOf(prev), 1); } else if (!prev && value) { this.items.push(new Pair.Pair(key)); } } toJSON(_, ctx) { return super.toJSON(_, ctx, Set); } toString(ctx, onComment, onChompKeep) { if (!ctx) return JSON.stringify(this); if (this.hasAllNullValues(true)) return super.toString(Object.assign({}, ctx, { allNullValues: true }), onComment, onChompKeep); else throw new Error("Set items must all have null values"); } static from(schema, iterable, ctx) { const { replacer } = ctx; const set2 = new this(schema); if (iterable && Symbol.iterator in Object(iterable)) for (let value of iterable) { if (typeof replacer === "function") value = replacer.call(iterable, value, value); set2.items.push(Pair.createPair(value, null, ctx)); } return set2; } }; YAMLSet.tag = "tag:yaml.org,2002:set"; var set = { collection: "map", identify: (value) => value instanceof Set, nodeClass: YAMLSet, default: false, tag: "tag:yaml.org,2002:set", createNode: (schema, iterable, ctx) => YAMLSet.from(schema, iterable, ctx), resolve(map, onError) { if (identity.isMap(map)) { if (map.hasAllNullValues(true)) return Object.assign(new YAMLSet(), map); else onError("Set items must all have null values"); } else onError("Expected a mapping for this tag"); return map; } }; exports.YAMLSet = YAMLSet; exports.set = set; } }); var require_timestamp = __commonJS2({ ""(exports) { "use strict"; var stringifyNumber = require_stringifyNumber(); function parseSexagesimal(str, asBigInt) { const sign = str[0]; const parts = sign === "-" || sign === "+" ? str.substring(1) : str; const num = (n) => asBigInt ? BigInt(n) : Number(n); const res = parts.replace(/_/g, "").split(":").reduce((res2, p) => res2 * num(60) + num(p), num(0)); return sign === "-" ? num(-1) * res : res; } function stringifySexagesimal(node) { let { value } = node; let num = (n) => n; if (typeof value === "bigint") num = (n) => BigInt(n); else if (isNaN(value) || !isFinite(value)) return stringifyNumber.stringifyNumber(node); let sign = ""; if (value < 0) { sign = "-"; value *= num(-1); } const _60 = num(60); const parts = [value % _60]; if (value < 60) { parts.unshift(0); } else { value = (value - parts[0]) / _60; parts.unshift(value % _60); if (value >= 60) { value = (value - parts[0]) / _60; parts.unshift(value); } } return sign + parts.map((n) => String(n).padStart(2, "0")).join(":").replace(/000000\d*$/, ""); } var intTime = { identify: (value) => typeof value === "bigint" || Number.isInteger(value), default: true, tag: "tag:yaml.org,2002:int", format: "TIME", test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/, resolve: (str, _onError, { intAsBigInt }) => parseSexagesimal(str, intAsBigInt), stringify: stringifySexagesimal }; var floatTime = { identify: (value) => typeof value === "number", default: true, tag: "tag:yaml.org,2002:float", format: "TIME", test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/, resolve: (str) => parseSexagesimal(str, false), stringify: stringifySexagesimal }; var timestamp = { identify: (value) => value instanceof Date, default: true, tag: "tag:yaml.org,2002:timestamp", // If the time zone is omitted, the timestamp is assumed to be specified in UTC. The time part // may be omitted altogether, resulting in a date format. In such a case, the time part is // assumed to be 00:00:00Z (start of day, UTC). test: RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"), resolve(str) { const match = str.match(timestamp.test); if (!match) throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd"); const [, year, month, day, hour, minute, second] = match.map(Number); const millisec = match[7] ? Number((match[7] + "00").substr(1, 3)) : 0; let date = Date.UTC(year, month - 1, day, hour || 0, minute || 0, second || 0, millisec); const tz = match[8]; if (tz && tz !== "Z") { let d = parseSexagesimal(tz, false); if (Math.abs(d) < 30) d *= 60; date -= 6e4 * d; } return new Date(date); }, stringify: ({ value }) => value?.toISOString().replace(/(T00:00:00)?\.000Z$/, "") ?? "" }; exports.floatTime = floatTime; exports.intTime = intTime; exports.timestamp = timestamp; } }); var require_schema3 = __commonJS2({ ""(exports) { "use strict"; var map = require_map(); var _null = require_null(); var seq = require_seq(); var string = require_string(); var binary = require_binary(); var bool = require_bool2(); var float = require_float2(); var int = require_int2(); var merge22 = require_merge(); var omap = require_omap(); var pairs = require_pairs(); var set = require_set(); var timestamp = require_timestamp(); var schema = [ map.map, seq.seq, string.string, _null.nullTag, bool.trueTag, bool.falseTag, int.intBin, int.intOct, int.int, int.intHex, float.floatNaN, float.floatExp, float.float, binary.binary, merge22.merge, omap.omap, pairs.pairs, set.set, timestamp.intTime, timestamp.floatTime, timestamp.timestamp ]; exports.schema = schema; } }); var require_tags = __commonJS2({ ""(exports) { "use strict"; var map = require_map(); var _null = require_null(); var seq = require_seq(); var string = require_string(); var bool = require_bool(); var float = require_float(); var int = require_int(); var schema = require_schema(); var schema$1 = require_schema2(); var binary = require_binary(); var merge22 = require_merge(); var omap = require_omap(); var pairs = require_pairs(); var schema$2 = require_schema3(); var set = require_set(); var timestamp = require_timestamp(); var schemas = /* @__PURE__ */ new Map([ ["core", schema.schema], ["failsafe", [map.map, seq.seq, string.string]], ["json", schema$1.schema], ["yaml11", schema$2.schema], ["yaml-1.1", schema$2.schema] ]); var tagsByName = { binary: binary.binary, bool: bool.boolTag, float: float.float, floatExp: float.floatExp, floatNaN: float.floatNaN, floatTime: timestamp.floatTime, int: int.int, intHex: int.intHex, intOct: int.intOct, intTime: timestamp.intTime, map: map.map, merge: merge22.merge, null: _null.nullTag, omap: omap.omap, pairs: pairs.pairs, seq: seq.seq, set: set.set, timestamp: timestamp.timestamp }; var coreKnownTags = { "tag:yaml.org,2002:binary": binary.binary, "tag:yaml.org,2002:merge": merge22.merge, "tag:yaml.org,2002:omap": omap.omap, "tag:yaml.org,2002:pairs": pairs.pairs, "tag:yaml.org,2002:set": set.set, "tag:yaml.org,2002:timestamp": timestamp.timestamp }; function getTags(customTags, schemaName, addMergeTag) { const schemaTags = schemas.get(schemaName); if (schemaTags && !customTags) { return addMergeTag && !schemaTags.includes(merge22.merge) ? schemaTags.concat(merge22.merge) : schemaTags.slice(); } let tags = schemaTags; if (!tags) { if (Array.isArray(customTags)) tags = []; else { const keys = Array.from(schemas.keys()).filter((key) => key !== "yaml11").map((key) => JSON.stringify(key)).join(", "); throw new Error(`Unknown schema "${schemaName}"; use one of ${keys} or define customTags array`); } } if (Array.isArray(customTags)) { for (const tag of customTags) tags = tags.concat(tag); } else if (typeof customTags === "function") { tags = customTags(tags.slice()); } if (addMergeTag) tags = tags.concat(merge22.merge); return tags.reduce((tags2, tag) => { const tagObj = typeof tag === "string" ? tagsByName[tag] : tag; if (!tagObj) { const tagName = JSON.stringify(tag); const keys = Object.keys(tagsByName).map((key) => JSON.stringify(key)).join(", "); throw new Error(`Unknown custom tag ${tagName}; use one of ${keys}`); } if (!tags2.includes(tagObj)) tags2.push(tagObj); return tags2; }, []); } exports.coreKnownTags = coreKnownTags; exports.getTags = getTags; } }); var require_Schema = __commonJS2({ ""(exports) { "use strict"; var identity = require_identity(); var map = require_map(); var seq = require_seq(); var string = require_string(); var tags = require_tags(); var sortMapEntriesByKey = (a, b) => a.key < b.key ? -1 : a.key > b.key ? 1 : 0; var Schema = class _Schema { constructor({ compat, customTags, merge: merge22, resolveKnownTags, schema, sortMapEntries, toStringDefaults }) { this.compat = Array.isArray(compat) ? tags.getTags(compat, "compat") : compat ? tags.getTags(null, compat) : null; this.name = typeof schema === "string" && schema || "core"; this.knownTags = resolveKnownTags ? tags.coreKnownTags : {}; this.tags = tags.getTags(customTags, this.name, merge22); this.toStringOptions = toStringDefaults ?? null; Object.defineProperty(this, identity.MAP, { value: map.map }); Object.defineProperty(this, identity.SCALAR, { value: string.string }); Object.defineProperty(this, identity.SEQ, { value: seq.seq }); this.sortMapEntries = typeof sortMapEntries === "function" ? sortMapEntries : sortMapEntries === true ? sortMapEntriesByKey : null; } clone() { const copy = Object.create(_Schema.prototype, Object.getOwnPropertyDescriptors(this)); copy.tags = this.tags.slice(); return copy; } }; exports.Schema = Schema; } }); var require_stringifyDocument = __commonJS2({ ""(exports) { "use strict"; var identity = require_identity(); var stringify = require_stringify(); var stringifyComment = require_stringifyComment(); function stringifyDocument(doc, options) { const lines = []; let hasDirectives = options.directives === true; if (options.directives !== false && doc.directives) { const dir = doc.directives.toString(doc); if (dir) { lines.push(dir); hasDirectives = true; } else if (doc.directives.docStart) hasDirectives = true; } if (hasDirectives) lines.push("---"); const ctx = stringify.createStringifyContext(doc, options); const { commentString } = ctx.options; if (doc.commentBefore) { if (lines.length !== 1) lines.unshift(""); const cs = commentString(doc.commentBefore); lines.unshift(stringifyComment.indentComment(cs, "")); } let chompKeep = false; let contentComment = null; if (doc.contents) { if (identity.isNode(doc.contents)) { if (doc.contents.spaceBefore && hasDirectives) lines.push(""); if (doc.contents.commentBefore) { const cs = commentString(doc.contents.commentBefore); lines.push(stringifyComment.indentComment(cs, "")); } ctx.forceBlockIndent = !!doc.comment; contentComment = doc.contents.comment; } const onChompKeep = contentComment ? void 0 : () => chompKeep = true; let body = stringify.stringify(doc.contents, ctx, () => contentComment = null, onChompKeep); if (contentComment) body += stringifyComment.lineComment(body, "", commentString(contentComment)); if ((body[0] === "|" || body[0] === ">") && lines[lines.length - 1] === "---") { lines[lines.length - 1] = `--- ${body}`; } else lines.push(body); } else { lines.push(stringify.stringify(doc.contents, ctx)); } if (doc.directives?.docEnd) { if (doc.comment) { const cs = commentString(doc.comment); if (cs.includes("\n")) { lines.push("..."); lines.push(stringifyComment.indentComment(cs, "")); } else { lines.push(`... ${cs}`); } } else { lines.push("..."); } } else { let dc = doc.comment; if (dc && chompKeep) dc = dc.replace(/^\n+/, ""); if (dc) { if ((!chompKeep || contentComment) && lines[lines.length - 1] !== "") lines.push(""); lines.push(stringifyComment.indentComment(commentString(dc), "")); } } return lines.join("\n") + "\n"; } exports.stringifyDocument = stringifyDocument; } }); var require_Document = __commonJS2({ ""(exports) { "use strict"; var Alias = require_Alias(); var Collection22 = require_Collection(); var identity = require_identity(); var Pair = require_Pair(); var toJS = require_toJS(); var Schema = require_Schema(); var stringifyDocument = require_stringifyDocument(); var anchors = require_anchors(); var applyReviver = require_applyReviver(); var createNode = require_createNode(); var directives = require_directives(); var Document = class _Document { constructor(value, replacer, options) { this.commentBefore = null; this.comment = null; this.errors = []; this.warnings = []; Object.defineProperty(this, identity.NODE_TYPE, { value: identity.DOC }); let _replacer = null; if (typeof replacer === "function" || Array.isArray(replacer)) { _replacer = replacer; } else if (options === void 0 && replacer) { options = replacer; replacer = void 0; } const opt = Object.assign({ intAsBigInt: false, keepSourceTokens: false, logLevel: "warn", prettyErrors: true, strict: true, stringKeys: false, uniqueKeys: true, version: "1.2" }, options); this.options = opt; let { version } = opt; if (options?._directives) { this.directives = options._directives.atDocument(); if (this.directives.yaml.explicit) version = this.directives.yaml.version; } else this.directives = new directives.Directives({ version }); this.setSchema(version, options); this.contents = value === void 0 ? null : this.createNode(value, _replacer, options); } /** * Create a deep copy of this Document and its contents. * * Custom Node values that inherit from `Object` still refer to their original instances. */ clone() { const copy = Object.create(_Document.prototype, { [identity.NODE_TYPE]: { value: identity.DOC } }); copy.commentBefore = this.commentBefore; copy.comment = this.comment; copy.errors = this.errors.slice(); copy.warnings = this.warnings.slice(); copy.options = Object.assign({}, this.options); if (this.directives) copy.directives = this.directives.clone(); copy.schema = this.schema.clone(); copy.contents = identity.isNode(this.contents) ? this.contents.clone(copy.schema) : this.contents; if (this.range) copy.range = this.range.slice(); return copy; } /** Adds a value to the document. */ add(value) { if (assertCollection(this.contents)) this.contents.add(value); } /** Adds a value to the document. */ addIn(path2, value) { if (assertCollection(this.contents)) this.contents.addIn(path2, value); } /** * Create a new `Alias` node, ensuring that the target `node` has the required anchor. * * If `node` already has an anchor, `name` is ignored. * Otherwise, the `node.anchor` value will be set to `name`, * or if an anchor with that name is already present in the document, * `name` will be used as a prefix for a new unique anchor. * If `name` is undefined, the generated anchor will use 'a' as a prefix. */ createAlias(node, name) { if (!node.anchor) { const prev = anchors.anchorNames(this); node.anchor = // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing !name || prev.has(name) ? anchors.findNewAnchor(name || "a", prev) : name; } return new Alias.Alias(node.anchor); } createNode(value, replacer, options) { let _replacer = void 0; if (typeof replacer === "function") { value = replacer.call({ "": value }, "", value); _replacer = replacer; } else if (Array.isArray(replacer)) { const keyToStr = (v) => typeof v === "number" || v instanceof String || v instanceof Number; const asStr = replacer.filter(keyToStr).map(String); if (asStr.length > 0) replacer = replacer.concat(asStr); _replacer = replacer; } else if (options === void 0 && replacer) { options = replacer; replacer = void 0; } const { aliasDuplicateObjects, anchorPrefix, flow, keepUndefined, onTagObj, tag } = options ?? {}; const { onAnchor, setAnchors, sourceObjects } = anchors.createNodeAnchors( this, // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing anchorPrefix || "a" ); const ctx = { aliasDuplicateObjects: aliasDuplicateObjects ?? true, keepUndefined: keepUndefined ?? false, onAnchor, onTagObj, replacer: _replacer, schema: this.schema, sourceObjects }; const node = createNode.createNode(value, tag, ctx); if (flow && identity.isCollection(node)) node.flow = true; setAnchors(); return node; } /** * Convert a key and a value into a `Pair` using the current schema, * recursively wrapping all values as `Scalar` or `Collection` nodes. */ createPair(key, value, options = {}) { const k = this.createNode(key, null, options); const v = this.createNode(value, null, options); return new Pair.Pair(k, v); } /** * Removes a value from the document. * @returns `true` if the item was found and removed. */ delete(key) { return assertCollection(this.contents) ? this.contents.delete(key) : false; } /** * Removes a value from the document. * @returns `true` if the item was found and removed. */ deleteIn(path2) { if (Collection22.isEmptyPath(path2)) { if (this.contents == null) return false; this.contents = null; return true; } return assertCollection(this.contents) ? this.contents.deleteIn(path2) : false; } /** * Returns item at `key`, or `undefined` if not found. By default unwraps * scalar values from their surrounding node; to disable set `keepScalar` to * `true` (collections are always returned intact). */ get(key, keepScalar) { return identity.isCollection(this.contents) ? this.contents.get(key, keepScalar) : void 0; } /** * Returns item at `path`, or `undefined` if not found. By default unwraps * scalar values from their surrounding node; to disable set `keepScalar` to * `true` (collections are always returned intact). */ getIn(path2, keepScalar) { if (Collection22.isEmptyPath(path2)) return !keepScalar && identity.isScalar(this.contents) ? this.contents.value : this.contents; return identity.isCollection(this.contents) ? this.contents.getIn(path2, keepScalar) : void 0; } /** * Checks if the document includes a value with the key `key`. */ has(key) { return identity.isCollection(this.contents) ? this.contents.has(key) : false; } /** * Checks if the document includes a value at `path`. */ hasIn(path2) { if (Collection22.isEmptyPath(path2)) return this.contents !== void 0; return identity.isCollection(this.contents) ? this.contents.hasIn(path2) : false; } /** * Sets a value in this document. For `!!set`, `value` needs to be a * boolean to add/remove the item from the set. */ set(key, value) { if (this.contents == null) { this.contents = Collection22.collectionFromPath(this.schema, [key], value); } else if (assertCollection(this.contents)) { this.contents.set(key, value); } } /** * Sets a value in this document. For `!!set`, `value` needs to be a * boolean to add/remove the item from the set. */ setIn(path2, value) { if (Collection22.isEmptyPath(path2)) { this.contents = value; } else if (this.contents == null) { this.contents = Collection22.collectionFromPath(this.schema, Array.from(path2), value); } else if (assertCollection(this.contents)) { this.contents.setIn(path2, value); } } /** * Change the YAML version and schema used by the document. * A `null` version disables support for directives, explicit tags, anchors, and aliases. * It also requires the `schema` option to be given as a `Schema` instance value. * * Overrides all previously set schema options. */ setSchema(version, options = {}) { if (typeof version === "number") version = String(version); let opt; switch (version) { case "1.1": if (this.directives) this.directives.yaml.version = "1.1"; else this.directives = new directives.Directives({ version: "1.1" }); opt = { resolveKnownTags: false, schema: "yaml-1.1" }; break; case "1.2": case "next": if (this.directives) this.directives.yaml.version = version; else this.directives = new directives.Directives({ version }); opt = { resolveKnownTags: true, schema: "core" }; break; case null: if (this.directives) delete this.directives; opt = null; break; default: { const sv = JSON.stringify(version); throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${sv}`); } } if (options.schema instanceof Object) this.schema = options.schema; else if (opt) this.schema = new Schema.Schema(Object.assign(opt, options)); else throw new Error(`With a null YAML version, the { schema: Schema } option is required`); } // json & jsonArg are only used from toJSON() toJS({ json, jsonArg, mapAsMap, maxAliasCount, onAnchor, reviver } = {}) { const ctx = { anchors: /* @__PURE__ */ new Map(), doc: this, keep: !json, mapAsMap: mapAsMap === true, mapKeyWarned: false, maxAliasCount: typeof maxAliasCount === "number" ? maxAliasCount : 100 }; const res = toJS.toJS(this.contents, jsonArg ?? "", ctx); if (typeof onAnchor === "function") for (const { count, res: res2 } of ctx.anchors.values()) onAnchor(res2, count); return typeof reviver === "function" ? applyReviver.applyReviver(reviver, { "": res }, "", res) : res; } /** * A JSON representation of the document `contents`. * * @param jsonArg Used by `JSON.stringify` to indicate the array index or * property name. */ toJSON(jsonArg, onAnchor) { return this.toJS({ json: true, jsonArg, mapAsMap: false, onAnchor }); } /** A YAML representation of the document. */ toString(options = {}) { if (this.errors.length > 0) throw new Error("Document with errors cannot be stringified"); if ("indent" in options && (!Number.isInteger(options.indent) || Number(options.indent) <= 0)) { const s = JSON.stringify(options.indent); throw new Error(`"indent" option must be a positive integer, not ${s}`); } return stringifyDocument.stringifyDocument(this, options); } }; function assertCollection(contents) { if (identity.isCollection(contents)) return true; throw new Error("Expected a YAML collection as document contents"); } exports.Document = Document; } }); var require_errors = __commonJS2({ ""(exports) { "use strict"; var YAMLError = class extends Error { constructor(name, pos, code, message) { super(); this.name = name; this.code = code; this.message = message; this.pos = pos; } }; var YAMLParseError = class extends YAMLError { constructor(pos, code, message) { super("YAMLParseError", pos, code, message); } }; var YAMLWarning = class extends YAMLError { constructor(pos, code, message) { super("YAMLWarning", pos, code, message); } }; var prettifyError = (src, lc) => (error2) => { if (error2.pos[0] === -1) return; error2.linePos = error2.pos.map((pos) => lc.linePos(pos)); const { line, col } = error2.linePos[0]; error2.message += ` at line ${line}, column ${col}`; let ci = col - 1; let lineStr = src.substring(lc.lineStarts[line - 1], lc.lineStarts[line]).replace(/[\n\r]+$/, ""); if (ci >= 60 && lineStr.length > 80) { const trimStart = Math.min(ci - 39, lineStr.length - 79); lineStr = "\u2026" + lineStr.substring(trimStart); ci -= trimStart - 1; } if (lineStr.length > 80) lineStr = lineStr.substring(0, 79) + "\u2026"; if (line > 1 && /^ *$/.test(lineStr.substring(0, ci))) { let prev = src.substring(lc.lineStarts[line - 2], lc.lineStarts[line - 1]); if (prev.length > 80) prev = prev.substring(0, 79) + "\u2026\n"; lineStr = prev + lineStr; } if (/[^ ]/.test(lineStr)) { let count = 1; const end = error2.linePos[1]; if (end?.line === line && end.col > col) { count = Math.max(1, Math.min(end.col - col, 80 - ci)); } const pointer = " ".repeat(ci) + "^".repeat(count); error2.message += `: ${lineStr} ${pointer} `; } }; exports.YAMLError = YAMLError; exports.YAMLParseError = YAMLParseError; exports.YAMLWarning = YAMLWarning; exports.prettifyError = prettifyError; } }); var require_resolve_props = __commonJS2({ ""(exports) { "use strict"; function resolveProps(tokens, { flow, indicator, next, offset, onError, parentIndent, startOnNewline }) { let spaceBefore = false; let atNewline = startOnNewline; let hasSpace = startOnNewline; let comment = ""; let commentSep = ""; let hasNewline = false; let reqSpace = false; let tab = null; let anchor = null; let tag = null; let newlineAfterProp = null; let comma = null; let found = null; let start = null; for (const token of tokens) { if (reqSpace) { if (token.type !== "space" && token.type !== "newline" && token.type !== "comma") onError(token.offset, "MISSING_CHAR", "Tags and anchors must be separated from the next token by white space"); reqSpace = false; } if (tab) { if (atNewline && token.type !== "comment" && token.type !== "newline") { onError(tab, "TAB_AS_INDENT", "Tabs are not allowed as indentation"); } tab = null; } switch (token.type) { case "space": if (!flow && (indicator !== "doc-start" || next?.type !== "flow-collection") && token.source.includes(" ")) { tab = token; } hasSpace = true; break; case "comment": { if (!hasSpace) onError(token, "MISSING_CHAR", "Comments must be separated from other tokens by white space characters"); const cb = token.source.substring(1) || " "; if (!comment) comment = cb; else comment += commentSep + cb; commentSep = ""; atNewline = false; break; } case "newline": if (atNewline) { if (comment) comment += token.source; else if (!found || indicator !== "seq-item-ind") spaceBefore = true; } else commentSep += token.source; atNewline = true; hasNewline = true; if (anchor || tag) newlineAfterProp = token; hasSpace = true; break; case "anchor": if (anchor) onError(token, "MULTIPLE_ANCHORS", "A node can have at most one anchor"); if (token.source.endsWith(":")) onError(token.offset + token.source.length - 1, "BAD_ALIAS", "Anchor ending in : is ambiguous", true); anchor = token; start ?? (start = token.offset); atNewline = false; hasSpace = false; reqSpace = true; break; case "tag": { if (tag) onError(token, "MULTIPLE_TAGS", "A node can have at most one tag"); tag = token; start ?? (start = token.offset); atNewline = false; hasSpace = false; reqSpace = true; break; } case indicator: if (anchor || tag) onError(token, "BAD_PROP_ORDER", `Anchors and tags must be after the ${token.source} indicator`); if (found) onError(token, "UNEXPECTED_TOKEN", `Unexpected ${token.source} in ${flow ?? "collection"}`); found = token; atNewline = indicator === "seq-item-ind" || indicator === "explicit-key-ind"; hasSpace = false; break; case "comma": if (flow) { if (comma) onError(token, "UNEXPECTED_TOKEN", `Unexpected , in ${flow}`); comma = token; atNewline = false; hasSpace = false; break; } default: onError(token, "UNEXPECTED_TOKEN", `Unexpected ${token.type} token`); atNewline = false; hasSpace = false; } } const last = tokens[tokens.length - 1]; const end = last ? last.offset + last.source.length : offset; if (reqSpace && next && next.type !== "space" && next.type !== "newline" && next.type !== "comma" && (next.type !== "scalar" || next.source !== "")) { onError(next.offset, "MISSING_CHAR", "Tags and anchors must be separated from the next token by white space"); } if (tab && (atNewline && tab.indent <= parentIndent || next?.type === "block-map" || next?.type === "block-seq")) onError(tab, "TAB_AS_INDENT", "Tabs are not allowed as indentation"); return { comma, found, spaceBefore, comment, hasNewline, anchor, tag, newlineAfterProp, end, start: start ?? end }; } exports.resolveProps = resolveProps; } }); var require_util_contains_newline = __commonJS2({ ""(exports) { "use strict"; function containsNewline(key) { if (!key) return null; switch (key.type) { case "alias": case "scalar": case "double-quoted-scalar": case "single-quoted-scalar": if (key.source.includes("\n")) return true; if (key.end) { for (const st of key.end) if (st.type === "newline") return true; } return false; case "flow-collection": for (const it of key.items) { for (const st of it.start) if (st.type === "newline") return true; if (it.sep) { for (const st of it.sep) if (st.type === "newline") return true; } if (containsNewline(it.key) || containsNewline(it.value)) return true; } return false; default: return true; } } exports.containsNewline = containsNewline; } }); var require_util_flow_indent_check = __commonJS2({ ""(exports) { "use strict"; var utilContainsNewline = require_util_contains_newline(); function flowIndentCheck(indent, fc, onError) { if (fc?.type === "flow-collection") { const end = fc.end[0]; if (end.indent === indent && (end.source === "]" || end.source === "}") && utilContainsNewline.containsNewline(fc)) { const msg = "Flow end indicator should be more indented than parent"; onError(end, "BAD_INDENT", msg, true); } } } exports.flowIndentCheck = flowIndentCheck; } }); var require_util_map_includes = __commonJS2({ ""(exports) { "use strict"; var identity = require_identity(); function mapIncludes(ctx, items, search) { const { uniqueKeys } = ctx.options; if (uniqueKeys === false) return false; const isEqual = typeof uniqueKeys === "function" ? uniqueKeys : (a, b) => a === b || identity.isScalar(a) && identity.isScalar(b) && a.value === b.value; return items.some((pair) => isEqual(pair.key, search)); } exports.mapIncludes = mapIncludes; } }); var require_resolve_block_map = __commonJS2({ ""(exports) { "use strict"; var Pair = require_Pair(); var YAMLMap = require_YAMLMap(); var resolveProps = require_resolve_props(); var utilContainsNewline = require_util_contains_newline(); var utilFlowIndentCheck = require_util_flow_indent_check(); var utilMapIncludes = require_util_map_includes(); var startColMsg = "All mapping items must start at the same column"; function resolveBlockMap({ composeNode, composeEmptyNode }, ctx, bm, onError, tag) { const NodeClass = tag?.nodeClass ?? YAMLMap.YAMLMap; const map = new NodeClass(ctx.schema); if (ctx.atRoot) ctx.atRoot = false; let offset = bm.offset; let commentEnd = null; for (const collItem of bm.items) { const { start, key, sep: sep22, value } = collItem; const keyProps = resolveProps.resolveProps(start, { indicator: "explicit-key-ind", next: key ?? sep22?.[0], offset, onError, parentIndent: bm.indent, startOnNewline: true }); const implicitKey = !keyProps.found; if (implicitKey) { if (key) { if (key.type === "block-seq") onError(offset, "BLOCK_AS_IMPLICIT_KEY", "A block sequence may not be used as an implicit map key"); else if ("indent" in key && key.indent !== bm.indent) onError(offset, "BAD_INDENT", startColMsg); } if (!keyProps.anchor && !keyProps.tag && !sep22) { commentEnd = keyProps.end; if (keyProps.comment) { if (map.comment) map.comment += "\n" + keyProps.comment; else map.comment = keyProps.comment; } continue; } if (keyProps.newlineAfterProp || utilContainsNewline.containsNewline(key)) { onError(key ?? start[start.length - 1], "MULTILINE_IMPLICIT_KEY", "Implicit keys need to be on a single line"); } } else if (keyProps.found?.indent !== bm.indent) { onError(offset, "BAD_INDENT", startColMsg); } ctx.atKey = true; const keyStart = keyProps.end; const keyNode = key ? composeNode(ctx, key, keyProps, onError) : composeEmptyNode(ctx, keyStart, start, null, keyProps, onError); if (ctx.schema.compat) utilFlowIndentCheck.flowIndentCheck(bm.indent, key, onError); ctx.atKey = false; if (utilMapIncludes.mapIncludes(ctx, map.items, keyNode)) onError(keyStart, "DUPLICATE_KEY", "Map keys must be unique"); const valueProps = resolveProps.resolveProps(sep22 ?? [], { indicator: "map-value-ind", next: value, offset: keyNode.range[2], onError, parentIndent: bm.indent, startOnNewline: !key || key.type === "block-scalar" }); offset = valueProps.end; if (valueProps.found) { if (implicitKey) { if (value?.type === "block-map" && !valueProps.hasNewline) onError(offset, "BLOCK_AS_IMPLICIT_KEY", "Nested mappings are not allowed in compact mappings"); if (ctx.options.strict && keyProps.start < valueProps.found.offset - 1024) onError(keyNode.range, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit block mapping key"); } const valueNode = value ? composeNode(ctx, value, valueProps, onError) : composeEmptyNode(ctx, offset, sep22, null, valueProps, onError); if (ctx.schema.compat) utilFlowIndentCheck.flowIndentCheck(bm.indent, value, onError); offset = valueNode.range[2]; const pair = new Pair.Pair(keyNode, valueNode); if (ctx.options.keepSourceTokens) pair.srcToken = collItem; map.items.push(pair); } else { if (implicitKey) onError(keyNode.range, "MISSING_CHAR", "Implicit map keys need to be followed by map values"); if (valueProps.comment) { if (keyNode.comment) keyNode.comment += "\n" + valueProps.comment; else keyNode.comment = valueProps.comment; } const pair = new Pair.Pair(keyNode); if (ctx.options.keepSourceTokens) pair.srcToken = collItem; map.items.push(pair); } } if (commentEnd && commentEnd < offset) onError(commentEnd, "IMPOSSIBLE", "Map comment with trailing content"); map.range = [bm.offset, offset, commentEnd ?? offset]; return map; } exports.resolveBlockMap = resolveBlockMap; } }); var require_resolve_block_seq = __commonJS2({ ""(exports) { "use strict"; var YAMLSeq = require_YAMLSeq(); var resolveProps = require_resolve_props(); var utilFlowIndentCheck = require_util_flow_indent_check(); function resolveBlockSeq({ composeNode, composeEmptyNode }, ctx, bs, onError, tag) { const NodeClass = tag?.nodeClass ?? YAMLSeq.YAMLSeq; const seq = new NodeClass(ctx.schema); if (ctx.atRoot) ctx.atRoot = false; if (ctx.atKey) ctx.atKey = false; let offset = bs.offset; let commentEnd = null; for (const { start, value } of bs.items) { const props = resolveProps.resolveProps(start, { indicator: "seq-item-ind", next: value, offset, onError, parentIndent: bs.indent, startOnNewline: true }); if (!props.found) { if (props.anchor || props.tag || value) { if (value?.type === "block-seq") onError(props.end, "BAD_INDENT", "All sequence items must start at the same column"); else onError(offset, "MISSING_CHAR", "Sequence item without - indicator"); } else { commentEnd = props.end; if (props.comment) seq.comment = props.comment; continue; } } const node = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end, start, null, props, onError); if (ctx.schema.compat) utilFlowIndentCheck.flowIndentCheck(bs.indent, value, onError); offset = node.range[2]; seq.items.push(node); } seq.range = [bs.offset, offset, commentEnd ?? offset]; return seq; } exports.resolveBlockSeq = resolveBlockSeq; } }); var require_resolve_end = __commonJS2({ ""(exports) { "use strict"; function resolveEnd(end, offset, reqSpace, onError) { let comment = ""; if (end) { let hasSpace = false; let sep22 = ""; for (const token of end) { const { source, type } = token; switch (type) { case "space": hasSpace = true; break; case "comment": { if (reqSpace && !hasSpace) onError(token, "MISSING_CHAR", "Comments must be separated from other tokens by white space characters"); const cb = source.substring(1) || " "; if (!comment) comment = cb; else comment += sep22 + cb; sep22 = ""; break; } case "newline": if (comment) sep22 += source; hasSpace = true; break; default: onError(token, "UNEXPECTED_TOKEN", `Unexpected ${type} at node end`); } offset += source.length; } } return { comment, offset }; } exports.resolveEnd = resolveEnd; } }); var require_resolve_flow_collection = __commonJS2({ ""(exports) { "use strict"; var identity = require_identity(); var Pair = require_Pair(); var YAMLMap = require_YAMLMap(); var YAMLSeq = require_YAMLSeq(); var resolveEnd = require_resolve_end(); var resolveProps = require_resolve_props(); var utilContainsNewline = require_util_contains_newline(); var utilMapIncludes = require_util_map_includes(); var blockMsg = "Block collections are not allowed within flow collections"; var isBlock = (token) => token && (token.type === "block-map" || token.type === "block-seq"); function resolveFlowCollection({ composeNode, composeEmptyNode }, ctx, fc, onError, tag) { const isMap = fc.start.source === "{"; const fcName = isMap ? "flow map" : "flow sequence"; const NodeClass = tag?.nodeClass ?? (isMap ? YAMLMap.YAMLMap : YAMLSeq.YAMLSeq); const coll = new NodeClass(ctx.schema); coll.flow = true; const atRoot = ctx.atRoot; if (atRoot) ctx.atRoot = false; if (ctx.atKey) ctx.atKey = false; let offset = fc.offset + fc.start.source.length; for (let i = 0; i < fc.items.length; ++i) { const collItem = fc.items[i]; const { start, key, sep: sep22, value } = collItem; const props = resolveProps.resolveProps(start, { flow: fcName, indicator: "explicit-key-ind", next: key ?? sep22?.[0], offset, onError, parentIndent: fc.indent, startOnNewline: false }); if (!props.found) { if (!props.anchor && !props.tag && !sep22 && !value) { if (i === 0 && props.comma) onError(props.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${fcName}`); else if (i < fc.items.length - 1) onError(props.start, "UNEXPECTED_TOKEN", `Unexpected empty item in ${fcName}`); if (props.comment) { if (coll.comment) coll.comment += "\n" + props.comment; else coll.comment = props.comment; } offset = props.end; continue; } if (!isMap && ctx.options.strict && utilContainsNewline.containsNewline(key)) onError( key, // checked by containsNewline() "MULTILINE_IMPLICIT_KEY", "Implicit keys of flow sequence pairs need to be on a single line" ); } if (i === 0) { if (props.comma) onError(props.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${fcName}`); } else { if (!props.comma) onError(props.start, "MISSING_CHAR", `Missing , between ${fcName} items`); if (props.comment) { let prevItemComment = ""; loop: for (const st of start) { switch (st.type) { case "comma": case "space": break; case "comment": prevItemComment = st.source.substring(1); break loop; default: break loop; } } if (prevItemComment) { let prev = coll.items[coll.items.length - 1]; if (identity.isPair(prev)) prev = prev.value ?? prev.key; if (prev.comment) prev.comment += "\n" + prevItemComment; else prev.comment = prevItemComment; props.comment = props.comment.substring(prevItemComment.length + 1); } } } if (!isMap && !sep22 && !props.found) { const valueNode = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end, sep22, null, props, onError); coll.items.push(valueNode); offset = valueNode.range[2]; if (isBlock(value)) onError(valueNode.range, "BLOCK_IN_FLOW", blockMsg); } else { ctx.atKey = true; const keyStart = props.end; const keyNode = key ? composeNode(ctx, key, props, onError) : composeEmptyNode(ctx, keyStart, start, null, props, onError); if (isBlock(key)) onError(keyNode.range, "BLOCK_IN_FLOW", blockMsg); ctx.atKey = false; const valueProps = resolveProps.resolveProps(sep22 ?? [], { flow: fcName, indicator: "map-value-ind", next: value, offset: keyNode.range[2], onError, parentIndent: fc.indent, startOnNewline: false }); if (valueProps.found) { if (!isMap && !props.found && ctx.options.strict) { if (sep22) for (const st of sep22) { if (st === valueProps.found) break; if (st.type === "newline") { onError(st, "MULTILINE_IMPLICIT_KEY", "Implicit keys of flow sequence pairs need to be on a single line"); break; } } if (props.start < valueProps.found.offset - 1024) onError(valueProps.found, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit flow sequence key"); } } else if (value) { if ("source" in value && value.source?.[0] === ":") onError(value, "MISSING_CHAR", `Missing space after : in ${fcName}`); else onError(valueProps.start, "MISSING_CHAR", `Missing , or : between ${fcName} items`); } const valueNode = value ? composeNode(ctx, value, valueProps, onError) : valueProps.found ? composeEmptyNode(ctx, valueProps.end, sep22, null, valueProps, onError) : null; if (valueNode) { if (isBlock(value)) onError(valueNode.range, "BLOCK_IN_FLOW", blockMsg); } else if (valueProps.comment) { if (keyNode.comment) keyNode.comment += "\n" + valueProps.comment; else keyNode.comment = valueProps.comment; } const pair = new Pair.Pair(keyNode, valueNode); if (ctx.options.keepSourceTokens) pair.srcToken = collItem; if (isMap) { const map = coll; if (utilMapIncludes.mapIncludes(ctx, map.items, keyNode)) onError(keyStart, "DUPLICATE_KEY", "Map keys must be unique"); map.items.push(pair); } else { const map = new YAMLMap.YAMLMap(ctx.schema); map.flow = true; map.items.push(pair); const endRange = (valueNode ?? keyNode).range; map.range = [keyNode.range[0], endRange[1], endRange[2]]; coll.items.push(map); } offset = valueNode ? valueNode.range[2] : valueProps.end; } } const expectedEnd = isMap ? "}" : "]"; const [ce, ...ee] = fc.end; let cePos = offset; if (ce?.source === expectedEnd) cePos = ce.offset + ce.source.length; else { const name = fcName[0].toUpperCase() + fcName.substring(1); const msg = atRoot ? `${name} must end with a ${expectedEnd}` : `${name} in block collection must be sufficiently indented and end with a ${expectedEnd}`; onError(offset, atRoot ? "MISSING_CHAR" : "BAD_INDENT", msg); if (ce && ce.source.length !== 1) ee.unshift(ce); } if (ee.length > 0) { const end = resolveEnd.resolveEnd(ee, cePos, ctx.options.strict, onError); if (end.comment) { if (coll.comment) coll.comment += "\n" + end.comment; else coll.comment = end.comment; } coll.range = [fc.offset, cePos, end.offset]; } else { coll.range = [fc.offset, cePos, cePos]; } return coll; } exports.resolveFlowCollection = resolveFlowCollection; } }); var require_compose_collection = __commonJS2({ ""(exports) { "use strict"; var identity = require_identity(); var Scalar = require_Scalar(); var YAMLMap = require_YAMLMap(); var YAMLSeq = require_YAMLSeq(); var resolveBlockMap = require_resolve_block_map(); var resolveBlockSeq = require_resolve_block_seq(); var resolveFlowCollection = require_resolve_flow_collection(); function resolveCollection(CN, ctx, token, onError, tagName, tag) { const coll = token.type === "block-map" ? resolveBlockMap.resolveBlockMap(CN, ctx, token, onError, tag) : token.type === "block-seq" ? resolveBlockSeq.resolveBlockSeq(CN, ctx, token, onError, tag) : resolveFlowCollection.resolveFlowCollection(CN, ctx, token, onError, tag); const Coll = coll.constructor; if (tagName === "!" || tagName === Coll.tagName) { coll.tag = Coll.tagName; return coll; } if (tagName) coll.tag = tagName; return coll; } function composeCollection(CN, ctx, token, props, onError) { const tagToken = props.tag; const tagName = !tagToken ? null : ctx.directives.tagName(tagToken.source, (msg) => onError(tagToken, "TAG_RESOLVE_FAILED", msg)); if (token.type === "block-seq") { const { anchor, newlineAfterProp: nl } = props; const lastProp = anchor && tagToken ? anchor.offset > tagToken.offset ? anchor : tagToken : anchor ?? tagToken; if (lastProp && (!nl || nl.offset < lastProp.offset)) { const message = "Missing newline after block sequence props"; onError(lastProp, "MISSING_CHAR", message); } } const expType = token.type === "block-map" ? "map" : token.type === "block-seq" ? "seq" : token.start.source === "{" ? "map" : "seq"; if (!tagToken || !tagName || tagName === "!" || tagName === YAMLMap.YAMLMap.tagName && expType === "map" || tagName === YAMLSeq.YAMLSeq.tagName && expType === "seq") { return resolveCollection(CN, ctx, token, onError, tagName); } let tag = ctx.schema.tags.find((t) => t.tag === tagName && t.collection === expType); if (!tag) { const kt = ctx.schema.knownTags[tagName]; if (kt?.collection === expType) { ctx.schema.tags.push(Object.assign({}, kt, { default: false })); tag = kt; } else { if (kt) { onError(tagToken, "BAD_COLLECTION_TYPE", `${kt.tag} used for ${expType} collection, but expects ${kt.collection ?? "scalar"}`, true); } else { onError(tagToken, "TAG_RESOLVE_FAILED", `Unresolved tag: ${tagName}`, true); } return resolveCollection(CN, ctx, token, onError, tagName); } } const coll = resolveCollection(CN, ctx, token, onError, tagName, tag); const res = tag.resolve?.(coll, (msg) => onError(tagToken, "TAG_RESOLVE_FAILED", msg), ctx.options) ?? coll; const node = identity.isNode(res) ? res : new Scalar.Scalar(res); node.range = coll.range; node.tag = tagName; if (tag?.format) node.format = tag.format; return node; } exports.composeCollection = composeCollection; } }); var require_resolve_block_scalar = __commonJS2({ ""(exports) { "use strict"; var Scalar = require_Scalar(); function resolveBlockScalar(ctx, scalar, onError) { const start = scalar.offset; const header = parseBlockScalarHeader(scalar, ctx.options.strict, onError); if (!header) return { value: "", type: null, comment: "", range: [start, start, start] }; const type = header.mode === ">" ? Scalar.Scalar.BLOCK_FOLDED : Scalar.Scalar.BLOCK_LITERAL; const lines = scalar.source ? splitLines(scalar.source) : []; let chompStart = lines.length; for (let i = lines.length - 1; i >= 0; --i) { const content = lines[i][1]; if (content === "" || content === "\r") chompStart = i; else break; } if (chompStart === 0) { const value2 = header.chomp === "+" && lines.length > 0 ? "\n".repeat(Math.max(1, lines.length - 1)) : ""; let end2 = start + header.length; if (scalar.source) end2 += scalar.source.length; return { value: value2, type, comment: header.comment, range: [start, end2, end2] }; } let trimIndent = scalar.indent + header.indent; let offset = scalar.offset + header.length; let contentStart = 0; for (let i = 0; i < chompStart; ++i) { const [indent, content] = lines[i]; if (content === "" || content === "\r") { if (header.indent === 0 && indent.length > trimIndent) trimIndent = indent.length; } else { if (indent.length < trimIndent) { const message = "Block scalars with more-indented leading empty lines must use an explicit indentation indicator"; onError(offset + indent.length, "MISSING_CHAR", message); } if (header.indent === 0) trimIndent = indent.length; contentStart = i; if (trimIndent === 0 && !ctx.atRoot) { const message = "Block scalar values in collections must be indented"; onError(offset, "BAD_INDENT", message); } break; } offset += indent.length + content.length + 1; } for (let i = lines.length - 1; i >= chompStart; --i) { if (lines[i][0].length > trimIndent) chompStart = i + 1; } let value = ""; let sep22 = ""; let prevMoreIndented = false; for (let i = 0; i < contentStart; ++i) value += lines[i][0].slice(trimIndent) + "\n"; for (let i = contentStart; i < chompStart; ++i) { let [indent, content] = lines[i]; offset += indent.length + content.length + 1; const crlf = content[content.length - 1] === "\r"; if (crlf) content = content.slice(0, -1); if (content && indent.length < trimIndent) { const src = header.indent ? "explicit indentation indicator" : "first line"; const message = `Block scalar lines must not be less indented than their ${src}`; onError(offset - content.length - (crlf ? 2 : 1), "BAD_INDENT", message); indent = ""; } if (type === Scalar.Scalar.BLOCK_LITERAL) { value += sep22 + indent.slice(trimIndent) + content; sep22 = "\n"; } else if (indent.length > trimIndent || content[0] === " ") { if (sep22 === " ") sep22 = "\n"; else if (!prevMoreIndented && sep22 === "\n") sep22 = "\n\n"; value += sep22 + indent.slice(trimIndent) + content; sep22 = "\n"; prevMoreIndented = true; } else if (content === "") { if (sep22 === "\n") value += "\n"; else sep22 = "\n"; } else { value += sep22 + content; sep22 = " "; prevMoreIndented = false; } } switch (header.chomp) { case "-": break; case "+": for (let i = chompStart; i < lines.length; ++i) value += "\n" + lines[i][0].slice(trimIndent); if (value[value.length - 1] !== "\n") value += "\n"; break; default: value += "\n"; } const end = start + header.length + scalar.source.length; return { value, type, comment: header.comment, range: [start, end, end] }; } function parseBlockScalarHeader({ offset, props }, strict, onError) { if (props[0].type !== "block-scalar-header") { onError(props[0], "IMPOSSIBLE", "Block scalar header not found"); return null; } const { source } = props[0]; const mode = source[0]; let indent = 0; let chomp = ""; let error2 = -1; for (let i = 1; i < source.length; ++i) { const ch = source[i]; if (!chomp && (ch === "-" || ch === "+")) chomp = ch; else { const n = Number(ch); if (!indent && n) indent = n; else if (error2 === -1) error2 = offset + i; } } if (error2 !== -1) onError(error2, "UNEXPECTED_TOKEN", `Block scalar header includes extra characters: ${source}`); let hasSpace = false; let comment = ""; let length = source.length; for (let i = 1; i < props.length; ++i) { const token = props[i]; switch (token.type) { case "space": hasSpace = true; case "newline": length += token.source.length; break; case "comment": if (strict && !hasSpace) { const message = "Comments must be separated from other tokens by white space characters"; onError(token, "MISSING_CHAR", message); } length += token.source.length; comment = token.source.substring(1); break; case "error": onError(token, "UNEXPECTED_TOKEN", token.message); length += token.source.length; break; default: { const message = `Unexpected token in block scalar header: ${token.type}`; onError(token, "UNEXPECTED_TOKEN", message); const ts = token.source; if (ts && typeof ts === "string") length += ts.length; } } } return { mode, indent, chomp, comment, length }; } function splitLines(source) { const split = source.split(/\n( *)/); const first = split[0]; const m = first.match(/^( *)/); const line0 = m?.[1] ? [m[1], first.slice(m[1].length)] : ["", first]; const lines = [line0]; for (let i = 1; i < split.length; i += 2) lines.push([split[i], split[i + 1]]); return lines; } exports.resolveBlockScalar = resolveBlockScalar; } }); var require_resolve_flow_scalar = __commonJS2({ ""(exports) { "use strict"; var Scalar = require_Scalar(); var resolveEnd = require_resolve_end(); function resolveFlowScalar(scalar, strict, onError) { const { offset, type, source, end } = scalar; let _type; let value; const _onError = (rel, code, msg) => onError(offset + rel, code, msg); switch (type) { case "scalar": _type = Scalar.Scalar.PLAIN; value = plainValue(source, _onError); break; case "single-quoted-scalar": _type = Scalar.Scalar.QUOTE_SINGLE; value = singleQuotedValue(source, _onError); break; case "double-quoted-scalar": _type = Scalar.Scalar.QUOTE_DOUBLE; value = doubleQuotedValue(source, _onError); break; default: onError(scalar, "UNEXPECTED_TOKEN", `Expected a flow scalar value, but found: ${type}`); return { value: "", type: null, comment: "", range: [offset, offset + source.length, offset + source.length] }; } const valueEnd = offset + source.length; const re = resolveEnd.resolveEnd(end, valueEnd, strict, onError); return { value, type: _type, comment: re.comment, range: [offset, valueEnd, re.offset] }; } function plainValue(source, onError) { let badChar = ""; switch (source[0]) { case " ": badChar = "a tab character"; break; case ",": badChar = "flow indicator character ,"; break; case "%": badChar = "directive indicator character %"; break; case "|": case ">": { badChar = `block scalar indicator ${source[0]}`; break; } case "@": case "`": { badChar = `reserved character ${source[0]}`; break; } } if (badChar) onError(0, "BAD_SCALAR_START", `Plain value cannot start with ${badChar}`); return foldLines(source); } function singleQuotedValue(source, onError) { if (source[source.length - 1] !== "'" || source.length === 1) onError(source.length, "MISSING_CHAR", "Missing closing 'quote"); return foldLines(source.slice(1, -1)).replace(/''/g, "'"); } function foldLines(source) { let first, line; try { first = new RegExp("(.*?)(? wsStart ? source.slice(wsStart, i + 1) : ch; } else { res += ch; } } if (source[source.length - 1] !== '"' || source.length === 1) onError(source.length, "MISSING_CHAR", 'Missing closing "quote'); return res; } function foldNewline(source, offset) { let fold = ""; let ch = source[offset + 1]; while (ch === " " || ch === " " || ch === "\n" || ch === "\r") { if (ch === "\r" && source[offset + 2] !== "\n") break; if (ch === "\n") fold += "\n"; offset += 1; ch = source[offset + 1]; } if (!fold) fold = " "; return { fold, offset }; } var escapeCodes = { "0": "\0", // null character a: "\x07", // bell character b: "\b", // backspace e: "\x1B", // escape character f: "\f", // form feed n: "\n", // line feed r: "\r", // carriage return t: " ", // horizontal tab v: "\v", // vertical tab N: "\x85", // Unicode next line _: "\xA0", // Unicode non-breaking space L: "\u2028", // Unicode line separator P: "\u2029", // Unicode paragraph separator " ": " ", '"': '"', "/": "/", "\\": "\\", " ": " " }; function parseCharCode(source, offset, length, onError) { const cc = source.substr(offset, length); const ok = cc.length === length && /^[0-9a-fA-F]+$/.test(cc); const code = ok ? parseInt(cc, 16) : NaN; if (isNaN(code)) { const raw = source.substr(offset - 2, length + 2); onError(offset - 2, "BAD_DQ_ESCAPE", `Invalid escape sequence ${raw}`); return raw; } return String.fromCodePoint(code); } exports.resolveFlowScalar = resolveFlowScalar; } }); var require_compose_scalar = __commonJS2({ ""(exports) { "use strict"; var identity = require_identity(); var Scalar = require_Scalar(); var resolveBlockScalar = require_resolve_block_scalar(); var resolveFlowScalar = require_resolve_flow_scalar(); function composeScalar(ctx, token, tagToken, onError) { const { value, type, comment, range } = token.type === "block-scalar" ? resolveBlockScalar.resolveBlockScalar(ctx, token, onError) : resolveFlowScalar.resolveFlowScalar(token, ctx.options.strict, onError); const tagName = tagToken ? ctx.directives.tagName(tagToken.source, (msg) => onError(tagToken, "TAG_RESOLVE_FAILED", msg)) : null; let tag; if (ctx.options.stringKeys && ctx.atKey) { tag = ctx.schema[identity.SCALAR]; } else if (tagName) tag = findScalarTagByName(ctx.schema, value, tagName, tagToken, onError); else if (token.type === "scalar") tag = findScalarTagByTest(ctx, value, token, onError); else tag = ctx.schema[identity.SCALAR]; let scalar; try { const res = tag.resolve(value, (msg) => onError(tagToken ?? token, "TAG_RESOLVE_FAILED", msg), ctx.options); scalar = identity.isScalar(res) ? res : new Scalar.Scalar(res); } catch (error2) { const msg = error2 instanceof Error ? error2.message : String(error2); onError(tagToken ?? token, "TAG_RESOLVE_FAILED", msg); scalar = new Scalar.Scalar(value); } scalar.range = range; scalar.source = value; if (type) scalar.type = type; if (tagName) scalar.tag = tagName; if (tag.format) scalar.format = tag.format; if (comment) scalar.comment = comment; return scalar; } function findScalarTagByName(schema, value, tagName, tagToken, onError) { if (tagName === "!") return schema[identity.SCALAR]; const matchWithTest = []; for (const tag of schema.tags) { if (!tag.collection && tag.tag === tagName) { if (tag.default && tag.test) matchWithTest.push(tag); else return tag; } } for (const tag of matchWithTest) if (tag.test?.test(value)) return tag; const kt = schema.knownTags[tagName]; if (kt && !kt.collection) { schema.tags.push(Object.assign({}, kt, { default: false, test: void 0 })); return kt; } onError(tagToken, "TAG_RESOLVE_FAILED", `Unresolved tag: ${tagName}`, tagName !== "tag:yaml.org,2002:str"); return schema[identity.SCALAR]; } function findScalarTagByTest({ atKey, directives, schema }, value, token, onError) { const tag = schema.tags.find((tag2) => (tag2.default === true || atKey && tag2.default === "key") && tag2.test?.test(value)) || schema[identity.SCALAR]; if (schema.compat) { const compat = schema.compat.find((tag2) => tag2.default && tag2.test?.test(value)) ?? schema[identity.SCALAR]; if (tag.tag !== compat.tag) { const ts = directives.tagString(tag.tag); const cs = directives.tagString(compat.tag); const msg = `Value may be parsed as either ${ts} or ${cs}`; onError(token, "TAG_RESOLVE_FAILED", msg, true); } } return tag; } exports.composeScalar = composeScalar; } }); var require_util_empty_scalar_position = __commonJS2({ ""(exports) { "use strict"; function emptyScalarPosition(offset, before, pos) { if (before) { pos ?? (pos = before.length); for (let i = pos - 1; i >= 0; --i) { let st = before[i]; switch (st.type) { case "space": case "comment": case "newline": offset -= st.source.length; continue; } st = before[++i]; while (st?.type === "space") { offset += st.source.length; st = before[++i]; } break; } } return offset; } exports.emptyScalarPosition = emptyScalarPosition; } }); var require_compose_node = __commonJS2({ ""(exports) { "use strict"; var Alias = require_Alias(); var identity = require_identity(); var composeCollection = require_compose_collection(); var composeScalar = require_compose_scalar(); var resolveEnd = require_resolve_end(); var utilEmptyScalarPosition = require_util_empty_scalar_position(); var CN = { composeNode, composeEmptyNode }; function composeNode(ctx, token, props, onError) { const atKey = ctx.atKey; const { spaceBefore, comment, anchor, tag } = props; let node; let isSrcToken = true; switch (token.type) { case "alias": node = composeAlias(ctx, token, onError); if (anchor || tag) onError(token, "ALIAS_PROPS", "An alias node must not specify any properties"); break; case "scalar": case "single-quoted-scalar": case "double-quoted-scalar": case "block-scalar": node = composeScalar.composeScalar(ctx, token, tag, onError); if (anchor) node.anchor = anchor.source.substring(1); break; case "block-map": case "block-seq": case "flow-collection": try { node = composeCollection.composeCollection(CN, ctx, token, props, onError); if (anchor) node.anchor = anchor.source.substring(1); } catch (error2) { const message = error2 instanceof Error ? error2.message : String(error2); onError(token, "RESOURCE_EXHAUSTION", message); } break; default: { const message = token.type === "error" ? token.message : `Unsupported token (type: ${token.type})`; onError(token, "UNEXPECTED_TOKEN", message); isSrcToken = false; } } node ?? (node = composeEmptyNode(ctx, token.offset, void 0, null, props, onError)); if (anchor && node.anchor === "") onError(anchor, "BAD_ALIAS", "Anchor cannot be an empty string"); if (atKey && ctx.options.stringKeys && (!identity.isScalar(node) || typeof node.value !== "string" || node.tag && node.tag !== "tag:yaml.org,2002:str")) { const msg = "With stringKeys, all keys must be strings"; onError(tag ?? token, "NON_STRING_KEY", msg); } if (spaceBefore) node.spaceBefore = true; if (comment) { if (token.type === "scalar" && token.source === "") node.comment = comment; else node.commentBefore = comment; } if (ctx.options.keepSourceTokens && isSrcToken) node.srcToken = token; return node; } function composeEmptyNode(ctx, offset, before, pos, { spaceBefore, comment, anchor, tag, end }, onError) { const token = { type: "scalar", offset: utilEmptyScalarPosition.emptyScalarPosition(offset, before, pos), indent: -1, source: "" }; const node = composeScalar.composeScalar(ctx, token, tag, onError); if (anchor) { node.anchor = anchor.source.substring(1); if (node.anchor === "") onError(anchor, "BAD_ALIAS", "Anchor cannot be an empty string"); } if (spaceBefore) node.spaceBefore = true; if (comment) { node.comment = comment; node.range[2] = end; } return node; } function composeAlias({ options }, { offset, source, end }, onError) { const alias2 = new Alias.Alias(source.substring(1)); if (alias2.source === "") onError(offset, "BAD_ALIAS", "Alias cannot be an empty string"); if (alias2.source.endsWith(":")) onError(offset + source.length - 1, "BAD_ALIAS", "Alias ending in : is ambiguous", true); const valueEnd = offset + source.length; const re = resolveEnd.resolveEnd(end, valueEnd, options.strict, onError); alias2.range = [offset, valueEnd, re.offset]; if (re.comment) alias2.comment = re.comment; return alias2; } exports.composeEmptyNode = composeEmptyNode; exports.composeNode = composeNode; } }); var require_compose_doc = __commonJS2({ ""(exports) { "use strict"; var Document = require_Document(); var composeNode = require_compose_node(); var resolveEnd = require_resolve_end(); var resolveProps = require_resolve_props(); function composeDoc(options, directives, { offset, start, value, end }, onError) { const opts = Object.assign({ _directives: directives }, options); const doc = new Document.Document(void 0, opts); const ctx = { atKey: false, atRoot: true, directives: doc.directives, options: doc.options, schema: doc.schema }; const props = resolveProps.resolveProps(start, { indicator: "doc-start", next: value ?? end?.[0], offset, onError, parentIndent: 0, startOnNewline: true }); if (props.found) { doc.directives.docStart = true; if (value && (value.type === "block-map" || value.type === "block-seq") && !props.hasNewline) onError(props.end, "MISSING_CHAR", "Block collection cannot start on same line with directives-end marker"); } doc.contents = value ? composeNode.composeNode(ctx, value, props, onError) : composeNode.composeEmptyNode(ctx, props.end, start, null, props, onError); const contentEnd = doc.contents.range[2]; const re = resolveEnd.resolveEnd(end, contentEnd, false, onError); if (re.comment) doc.comment = re.comment; doc.range = [offset, contentEnd, re.offset]; return doc; } exports.composeDoc = composeDoc; } }); var require_composer = __commonJS2({ ""(exports) { "use strict"; var node_process = __require2("process"); var directives = require_directives(); var Document = require_Document(); var errors = require_errors(); var identity = require_identity(); var composeDoc = require_compose_doc(); var resolveEnd = require_resolve_end(); function getErrorPos(src) { if (typeof src === "number") return [src, src + 1]; if (Array.isArray(src)) return src.length === 2 ? src : [src[0], src[1]]; const { offset, source } = src; return [offset, offset + (typeof source === "string" ? source.length : 1)]; } function parsePrelude(prelude) { let comment = ""; let atComment = false; let afterEmptyLine = false; for (let i = 0; i < prelude.length; ++i) { const source = prelude[i]; switch (source[0]) { case "#": comment += (comment === "" ? "" : afterEmptyLine ? "\n\n" : "\n") + (source.substring(1) || " "); atComment = true; afterEmptyLine = false; break; case "%": if (prelude[i + 1]?.[0] !== "#") i += 1; atComment = false; break; default: if (!atComment) afterEmptyLine = true; atComment = false; } } return { comment, afterEmptyLine }; } var Composer = class { constructor(options = {}) { this.doc = null; this.atDirectives = false; this.prelude = []; this.errors = []; this.warnings = []; this.onError = (source, code, message, warning) => { const pos = getErrorPos(source); if (warning) this.warnings.push(new errors.YAMLWarning(pos, code, message)); else this.errors.push(new errors.YAMLParseError(pos, code, message)); }; this.directives = new directives.Directives({ version: options.version || "1.2" }); this.options = options; } decorate(doc, afterDoc) { const { comment, afterEmptyLine } = parsePrelude(this.prelude); if (comment) { const dc = doc.contents; if (afterDoc) { doc.comment = doc.comment ? `${doc.comment} ${comment}` : comment; } else if (afterEmptyLine || doc.directives.docStart || !dc) { doc.commentBefore = comment; } else if (identity.isCollection(dc) && !dc.flow && dc.items.length > 0) { let it = dc.items[0]; if (identity.isPair(it)) it = it.key; const cb = it.commentBefore; it.commentBefore = cb ? `${comment} ${cb}` : comment; } else { const cb = dc.commentBefore; dc.commentBefore = cb ? `${comment} ${cb}` : comment; } } if (afterDoc) { Array.prototype.push.apply(doc.errors, this.errors); Array.prototype.push.apply(doc.warnings, this.warnings); } else { doc.errors = this.errors; doc.warnings = this.warnings; } this.prelude = []; this.errors = []; this.warnings = []; } /** * Current stream status information. * * Mostly useful at the end of input for an empty stream. */ streamInfo() { return { comment: parsePrelude(this.prelude).comment, directives: this.directives, errors: this.errors, warnings: this.warnings }; } /** * Compose tokens into documents. * * @param forceDoc - If the stream contains no document, still emit a final document including any comments and directives that would be applied to a subsequent document. * @param endOffset - Should be set if `forceDoc` is also set, to set the document range end and to indicate errors correctly. */ *compose(tokens, forceDoc = false, endOffset = -1) { for (const token of tokens) yield* this.next(token); yield* this.end(forceDoc, endOffset); } /** Advance the composer by one CST token. */ *next(token) { if (node_process.env.LOG_STREAM) console.dir(token, { depth: null }); switch (token.type) { case "directive": this.directives.add(token.source, (offset, message, warning) => { const pos = getErrorPos(token); pos[0] += offset; this.onError(pos, "BAD_DIRECTIVE", message, warning); }); this.prelude.push(token.source); this.atDirectives = true; break; case "document": { const doc = composeDoc.composeDoc(this.options, this.directives, token, this.onError); if (this.atDirectives && !doc.directives.docStart) this.onError(token, "MISSING_CHAR", "Missing directives-end/doc-start indicator line"); this.decorate(doc, false); if (this.doc) yield this.doc; this.doc = doc; this.atDirectives = false; break; } case "byte-order-mark": case "space": break; case "comment": case "newline": this.prelude.push(token.source); break; case "error": { const msg = token.source ? `${token.message}: ${JSON.stringify(token.source)}` : token.message; const error2 = new errors.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", msg); if (this.atDirectives || !this.doc) this.errors.push(error2); else this.doc.errors.push(error2); break; } case "doc-end": { if (!this.doc) { const msg = "Unexpected doc-end without preceding document"; this.errors.push(new errors.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", msg)); break; } this.doc.directives.docEnd = true; const end = resolveEnd.resolveEnd(token.end, token.offset + token.source.length, this.doc.options.strict, this.onError); this.decorate(this.doc, true); if (end.comment) { const dc = this.doc.comment; this.doc.comment = dc ? `${dc} ${end.comment}` : end.comment; } this.doc.range[2] = end.offset; break; } default: this.errors.push(new errors.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", `Unsupported token ${token.type}`)); } } /** * Call at end of input to yield any remaining document. * * @param forceDoc - If the stream contains no document, still emit a final document including any comments and directives that would be applied to a subsequent document. * @param endOffset - Should be set if `forceDoc` is also set, to set the document range end and to indicate errors correctly. */ *end(forceDoc = false, endOffset = -1) { if (this.doc) { this.decorate(this.doc, true); yield this.doc; this.doc = null; } else if (forceDoc) { const opts = Object.assign({ _directives: this.directives }, this.options); const doc = new Document.Document(void 0, opts); if (this.atDirectives) this.onError(endOffset, "MISSING_CHAR", "Missing directives-end indicator line"); doc.range = [0, endOffset, endOffset]; this.decorate(doc, false); yield doc; } } }; exports.Composer = Composer; } }); var require_cst_scalar = __commonJS2({ ""(exports) { "use strict"; var resolveBlockScalar = require_resolve_block_scalar(); var resolveFlowScalar = require_resolve_flow_scalar(); var errors = require_errors(); var stringifyString = require_stringifyString(); function resolveAsScalar(token, strict = true, onError) { if (token) { const _onError = (pos, code, message) => { const offset = typeof pos === "number" ? pos : Array.isArray(pos) ? pos[0] : pos.offset; if (onError) onError(offset, code, message); else throw new errors.YAMLParseError([offset, offset + 1], code, message); }; switch (token.type) { case "scalar": case "single-quoted-scalar": case "double-quoted-scalar": return resolveFlowScalar.resolveFlowScalar(token, strict, _onError); case "block-scalar": return resolveBlockScalar.resolveBlockScalar({ options: { strict } }, token, _onError); } } return null; } function createScalarToken(value, context3) { const { implicitKey = false, indent, inFlow = false, offset = -1, type = "PLAIN" } = context3; const source = stringifyString.stringifyString({ type, value }, { implicitKey, indent: indent > 0 ? " ".repeat(indent) : "", inFlow, options: { blockQuote: true, lineWidth: -1 } }); const end = context3.end ?? [ { type: "newline", offset: -1, indent, source: "\n" } ]; switch (source[0]) { case "|": case ">": { const he = source.indexOf("\n"); const head = source.substring(0, he); const body = source.substring(he + 1) + "\n"; const props = [ { type: "block-scalar-header", offset, indent, source: head } ]; if (!addEndtoBlockProps(props, end)) props.push({ type: "newline", offset: -1, indent, source: "\n" }); return { type: "block-scalar", offset, indent, props, source: body }; } case '"': return { type: "double-quoted-scalar", offset, indent, source, end }; case "'": return { type: "single-quoted-scalar", offset, indent, source, end }; default: return { type: "scalar", offset, indent, source, end }; } } function setScalarValue(token, value, context3 = {}) { let { afterKey = false, implicitKey = false, inFlow = false, type } = context3; let indent = "indent" in token ? token.indent : null; if (afterKey && typeof indent === "number") indent += 2; if (!type) switch (token.type) { case "single-quoted-scalar": type = "QUOTE_SINGLE"; break; case "double-quoted-scalar": type = "QUOTE_DOUBLE"; break; case "block-scalar": { const header = token.props[0]; if (header.type !== "block-scalar-header") throw new Error("Invalid block scalar header"); type = header.source[0] === ">" ? "BLOCK_FOLDED" : "BLOCK_LITERAL"; break; } default: type = "PLAIN"; } const source = stringifyString.stringifyString({ type, value }, { implicitKey: implicitKey || indent === null, indent: indent !== null && indent > 0 ? " ".repeat(indent) : "", inFlow, options: { blockQuote: true, lineWidth: -1 } }); switch (source[0]) { case "|": case ">": setBlockScalarValue(token, source); break; case '"': setFlowScalarValue(token, source, "double-quoted-scalar"); break; case "'": setFlowScalarValue(token, source, "single-quoted-scalar"); break; default: setFlowScalarValue(token, source, "scalar"); } } function setBlockScalarValue(token, source) { const he = source.indexOf("\n"); const head = source.substring(0, he); const body = source.substring(he + 1) + "\n"; if (token.type === "block-scalar") { const header = token.props[0]; if (header.type !== "block-scalar-header") throw new Error("Invalid block scalar header"); header.source = head; token.source = body; } else { const { offset } = token; const indent = "indent" in token ? token.indent : -1; const props = [ { type: "block-scalar-header", offset, indent, source: head } ]; if (!addEndtoBlockProps(props, "end" in token ? token.end : void 0)) props.push({ type: "newline", offset: -1, indent, source: "\n" }); for (const key of Object.keys(token)) if (key !== "type" && key !== "offset") delete token[key]; Object.assign(token, { type: "block-scalar", indent, props, source: body }); } } function addEndtoBlockProps(props, end) { if (end) for (const st of end) switch (st.type) { case "space": case "comment": props.push(st); break; case "newline": props.push(st); return true; } return false; } function setFlowScalarValue(token, source, type) { switch (token.type) { case "scalar": case "double-quoted-scalar": case "single-quoted-scalar": token.type = type; token.source = source; break; case "block-scalar": { const end = token.props.slice(1); let oa = source.length; if (token.props[0].type === "block-scalar-header") oa -= token.props[0].source.length; for (const tok of end) tok.offset += oa; delete token.props; Object.assign(token, { type, source, end }); break; } case "block-map": case "block-seq": { const offset = token.offset + source.length; const nl = { type: "newline", offset, indent: token.indent, source: "\n" }; delete token.items; Object.assign(token, { type, source, end: [nl] }); break; } default: { const indent = "indent" in token ? token.indent : -1; const end = "end" in token && Array.isArray(token.end) ? token.end.filter((st) => st.type === "space" || st.type === "comment" || st.type === "newline") : []; for (const key of Object.keys(token)) if (key !== "type" && key !== "offset") delete token[key]; Object.assign(token, { type, indent, source, end }); } } } exports.createScalarToken = createScalarToken; exports.resolveAsScalar = resolveAsScalar; exports.setScalarValue = setScalarValue; } }); var require_cst_stringify = __commonJS2({ ""(exports) { "use strict"; var stringify = (cst) => "type" in cst ? stringifyToken(cst) : stringifyItem(cst); function stringifyToken(token) { switch (token.type) { case "block-scalar": { let res = ""; for (const tok of token.props) res += stringifyToken(tok); return res + token.source; } case "block-map": case "block-seq": { let res = ""; for (const item of token.items) res += stringifyItem(item); return res; } case "flow-collection": { let res = token.start.source; for (const item of token.items) res += stringifyItem(item); for (const st of token.end) res += st.source; return res; } case "document": { let res = stringifyItem(token); if (token.end) for (const st of token.end) res += st.source; return res; } default: { let res = token.source; if ("end" in token && token.end) for (const st of token.end) res += st.source; return res; } } } function stringifyItem({ start, key, sep: sep22, value }) { let res = ""; for (const st of start) res += st.source; if (key) res += stringifyToken(key); if (sep22) for (const st of sep22) res += st.source; if (value) res += stringifyToken(value); return res; } exports.stringify = stringify; } }); var require_cst_visit = __commonJS2({ ""(exports) { "use strict"; var BREAK = Symbol("break visit"); var SKIP = Symbol("skip children"); var REMOVE = Symbol("remove item"); function visit(cst, visitor) { if ("type" in cst && cst.type === "document") cst = { start: cst.start, value: cst.value }; _visit(Object.freeze([]), cst, visitor); } visit.BREAK = BREAK; visit.SKIP = SKIP; visit.REMOVE = REMOVE; visit.itemAtPath = (cst, path2) => { let item = cst; for (const [field, index] of path2) { const tok = item?.[field]; if (tok && "items" in tok) { item = tok.items[index]; } else return void 0; } return item; }; visit.parentCollection = (cst, path2) => { const parent = visit.itemAtPath(cst, path2.slice(0, -1)); const field = path2[path2.length - 1][0]; const coll = parent?.[field]; if (coll && "items" in coll) return coll; throw new Error("Parent collection not found"); }; function _visit(path2, item, visitor) { let ctrl = visitor(item, path2); if (typeof ctrl === "symbol") return ctrl; for (const field of ["key", "value"]) { const token = item[field]; if (token && "items" in token) { for (let i = 0; i < token.items.length; ++i) { const ci = _visit(Object.freeze(path2.concat([[field, i]])), token.items[i], visitor); if (typeof ci === "number") i = ci - 1; else if (ci === BREAK) return BREAK; else if (ci === REMOVE) { token.items.splice(i, 1); i -= 1; } } if (typeof ctrl === "function" && field === "key") ctrl = ctrl(item, path2); } } return typeof ctrl === "function" ? ctrl(item, path2) : ctrl; } exports.visit = visit; } }); var require_cst = __commonJS2({ ""(exports) { "use strict"; var cstScalar = require_cst_scalar(); var cstStringify = require_cst_stringify(); var cstVisit = require_cst_visit(); var BOM = "\uFEFF"; var DOCUMENT = ""; var FLOW_END = ""; var SCALAR = ""; var isCollection = (token) => !!token && "items" in token; var isScalar = (token) => !!token && (token.type === "scalar" || token.type === "single-quoted-scalar" || token.type === "double-quoted-scalar" || token.type === "block-scalar"); function prettyToken(token) { switch (token) { case BOM: return ""; case DOCUMENT: return ""; case FLOW_END: return ""; case SCALAR: return ""; default: return JSON.stringify(token); } } function tokenType(source) { switch (source) { case BOM: return "byte-order-mark"; case DOCUMENT: return "doc-mode"; case FLOW_END: return "flow-error-end"; case SCALAR: return "scalar"; case "---": return "doc-start"; case "...": return "doc-end"; case "": case "\n": case "\r\n": return "newline"; case "-": return "seq-item-ind"; case "?": return "explicit-key-ind"; case ":": return "map-value-ind"; case "{": return "flow-map-start"; case "}": return "flow-map-end"; case "[": return "flow-seq-start"; case "]": return "flow-seq-end"; case ",": return "comma"; } switch (source[0]) { case " ": case " ": return "space"; case "#": return "comment"; case "%": return "directive-line"; case "*": return "alias"; case "&": return "anchor"; case "!": return "tag"; case "'": return "single-quoted-scalar"; case '"': return "double-quoted-scalar"; case "|": case ">": return "block-scalar-header"; } return null; } exports.createScalarToken = cstScalar.createScalarToken; exports.resolveAsScalar = cstScalar.resolveAsScalar; exports.setScalarValue = cstScalar.setScalarValue; exports.stringify = cstStringify.stringify; exports.visit = cstVisit.visit; exports.BOM = BOM; exports.DOCUMENT = DOCUMENT; exports.FLOW_END = FLOW_END; exports.SCALAR = SCALAR; exports.isCollection = isCollection; exports.isScalar = isScalar; exports.prettyToken = prettyToken; exports.tokenType = tokenType; } }); var require_lexer = __commonJS2({ ""(exports) { "use strict"; var cst = require_cst(); function isEmpty(ch) { switch (ch) { case void 0: case " ": case "\n": case "\r": case " ": return true; default: return false; } } var hexDigits = new Set("0123456789ABCDEFabcdef"); var tagChars = new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"); var flowIndicatorChars = new Set(",[]{}"); var invalidAnchorChars = new Set(" ,[]{}\n\r "); var isNotAnchorChar = (ch) => !ch || invalidAnchorChars.has(ch); var Lexer = class { constructor() { this.atEnd = false; this.blockScalarIndent = -1; this.blockScalarKeep = false; this.buffer = ""; this.flowKey = false; this.flowLevel = 0; this.indentNext = 0; this.indentValue = 0; this.lineEndPos = null; this.next = null; this.pos = 0; } /** * Generate YAML tokens from the `source` string. If `incomplete`, * a part of the last line may be left as a buffer for the next call. * * @returns A generator of lexical tokens */ *lex(source, incomplete = false) { if (source) { if (typeof source !== "string") throw TypeError("source is not a string"); this.buffer = this.buffer ? this.buffer + source : source; this.lineEndPos = null; } this.atEnd = !incomplete; let next = this.next ?? "stream"; while (next && (incomplete || this.hasChars(1))) next = yield* this.parseNext(next); } atLineEnd() { let i = this.pos; let ch = this.buffer[i]; while (ch === " " || ch === " ") ch = this.buffer[++i]; if (!ch || ch === "#" || ch === "\n") return true; if (ch === "\r") return this.buffer[i + 1] === "\n"; return false; } charAt(n) { return this.buffer[this.pos + n]; } continueScalar(offset) { let ch = this.buffer[offset]; if (this.indentNext > 0) { let indent = 0; while (ch === " ") ch = this.buffer[++indent + offset]; if (ch === "\r") { const next = this.buffer[indent + offset + 1]; if (next === "\n" || !next && !this.atEnd) return offset + indent + 1; } return ch === "\n" || indent >= this.indentNext || !ch && !this.atEnd ? offset + indent : -1; } if (ch === "-" || ch === ".") { const dt = this.buffer.substr(offset, 3); if ((dt === "---" || dt === "...") && isEmpty(this.buffer[offset + 3])) return -1; } return offset; } getLine() { let end = this.lineEndPos; if (typeof end !== "number" || end !== -1 && end < this.pos) { end = this.buffer.indexOf("\n", this.pos); this.lineEndPos = end; } if (end === -1) return this.atEnd ? this.buffer.substring(this.pos) : null; if (this.buffer[end - 1] === "\r") end -= 1; return this.buffer.substring(this.pos, end); } hasChars(n) { return this.pos + n <= this.buffer.length; } setNext(state) { this.buffer = this.buffer.substring(this.pos); this.pos = 0; this.lineEndPos = null; this.next = state; return null; } peek(n) { return this.buffer.substr(this.pos, n); } *parseNext(next) { switch (next) { case "stream": return yield* this.parseStream(); case "line-start": return yield* this.parseLineStart(); case "block-start": return yield* this.parseBlockStart(); case "doc": return yield* this.parseDocument(); case "flow": return yield* this.parseFlowCollection(); case "quoted-scalar": return yield* this.parseQuotedScalar(); case "block-scalar": return yield* this.parseBlockScalar(); case "plain-scalar": return yield* this.parsePlainScalar(); } } *parseStream() { let line = this.getLine(); if (line === null) return this.setNext("stream"); if (line[0] === cst.BOM) { yield* this.pushCount(1); line = line.substring(1); } if (line[0] === "%") { let dirEnd = line.length; let cs = line.indexOf("#"); while (cs !== -1) { const ch = line[cs - 1]; if (ch === " " || ch === " ") { dirEnd = cs - 1; break; } else { cs = line.indexOf("#", cs + 1); } } while (true) { const ch = line[dirEnd - 1]; if (ch === " " || ch === " ") dirEnd -= 1; else break; } const n = (yield* this.pushCount(dirEnd)) + (yield* this.pushSpaces(true)); yield* this.pushCount(line.length - n); this.pushNewline(); return "stream"; } if (this.atLineEnd()) { const sp = yield* this.pushSpaces(true); yield* this.pushCount(line.length - sp); yield* this.pushNewline(); return "stream"; } yield cst.DOCUMENT; return yield* this.parseLineStart(); } *parseLineStart() { const ch = this.charAt(0); if (!ch && !this.atEnd) return this.setNext("line-start"); if (ch === "-" || ch === ".") { if (!this.atEnd && !this.hasChars(4)) return this.setNext("line-start"); const s = this.peek(3); if ((s === "---" || s === "...") && isEmpty(this.charAt(3))) { yield* this.pushCount(3); this.indentValue = 0; this.indentNext = 0; return s === "---" ? "doc" : "stream"; } } this.indentValue = yield* this.pushSpaces(false); if (this.indentNext > this.indentValue && !isEmpty(this.charAt(1))) this.indentNext = this.indentValue; return yield* this.parseBlockStart(); } *parseBlockStart() { const [ch0, ch1] = this.peek(2); if (!ch1 && !this.atEnd) return this.setNext("block-start"); if ((ch0 === "-" || ch0 === "?" || ch0 === ":") && isEmpty(ch1)) { const n = (yield* this.pushCount(1)) + (yield* this.pushSpaces(true)); this.indentNext = this.indentValue + 1; this.indentValue += n; return yield* this.parseBlockStart(); } return "doc"; } *parseDocument() { yield* this.pushSpaces(true); const line = this.getLine(); if (line === null) return this.setNext("doc"); let n = yield* this.pushIndicators(); switch (line[n]) { case "#": yield* this.pushCount(line.length - n); case void 0: yield* this.pushNewline(); return yield* this.parseLineStart(); case "{": case "[": yield* this.pushCount(1); this.flowKey = false; this.flowLevel = 1; return "flow"; case "}": case "]": yield* this.pushCount(1); return "doc"; case "*": yield* this.pushUntil(isNotAnchorChar); return "doc"; case '"': case "'": return yield* this.parseQuotedScalar(); case "|": case ">": n += yield* this.parseBlockScalarHeader(); n += yield* this.pushSpaces(true); yield* this.pushCount(line.length - n); yield* this.pushNewline(); return yield* this.parseBlockScalar(); default: return yield* this.parsePlainScalar(); } } *parseFlowCollection() { let nl, sp; let indent = -1; do { nl = yield* this.pushNewline(); if (nl > 0) { sp = yield* this.pushSpaces(false); this.indentValue = indent = sp; } else { sp = 0; } sp += yield* this.pushSpaces(true); } while (nl + sp > 0); const line = this.getLine(); if (line === null) return this.setNext("flow"); if (indent !== -1 && indent < this.indentNext && line[0] !== "#" || indent === 0 && (line.startsWith("---") || line.startsWith("...")) && isEmpty(line[3])) { const atFlowEndMarker = indent === this.indentNext - 1 && this.flowLevel === 1 && (line[0] === "]" || line[0] === "}"); if (!atFlowEndMarker) { this.flowLevel = 0; yield cst.FLOW_END; return yield* this.parseLineStart(); } } let n = 0; while (line[n] === ",") { n += yield* this.pushCount(1); n += yield* this.pushSpaces(true); this.flowKey = false; } n += yield* this.pushIndicators(); switch (line[n]) { case void 0: return "flow"; case "#": yield* this.pushCount(line.length - n); return "flow"; case "{": case "[": yield* this.pushCount(1); this.flowKey = false; this.flowLevel += 1; return "flow"; case "}": case "]": yield* this.pushCount(1); this.flowKey = true; this.flowLevel -= 1; return this.flowLevel ? "flow" : "doc"; case "*": yield* this.pushUntil(isNotAnchorChar); return "flow"; case '"': case "'": this.flowKey = true; return yield* this.parseQuotedScalar(); case ":": { const next = this.charAt(1); if (this.flowKey || isEmpty(next) || next === ",") { this.flowKey = false; yield* this.pushCount(1); yield* this.pushSpaces(true); return "flow"; } } default: this.flowKey = false; return yield* this.parsePlainScalar(); } } *parseQuotedScalar() { const quote = this.charAt(0); let end = this.buffer.indexOf(quote, this.pos + 1); if (quote === "'") { while (end !== -1 && this.buffer[end + 1] === "'") end = this.buffer.indexOf("'", end + 2); } else { while (end !== -1) { let n = 0; while (this.buffer[end - 1 - n] === "\\") n += 1; if (n % 2 === 0) break; end = this.buffer.indexOf('"', end + 1); } } const qb = this.buffer.substring(0, end); let nl = qb.indexOf("\n", this.pos); if (nl !== -1) { while (nl !== -1) { const cs = this.continueScalar(nl + 1); if (cs === -1) break; nl = qb.indexOf("\n", cs); } if (nl !== -1) { end = nl - (qb[nl - 1] === "\r" ? 2 : 1); } } if (end === -1) { if (!this.atEnd) return this.setNext("quoted-scalar"); end = this.buffer.length; } yield* this.pushToIndex(end + 1, false); return this.flowLevel ? "flow" : "doc"; } *parseBlockScalarHeader() { this.blockScalarIndent = -1; this.blockScalarKeep = false; let i = this.pos; while (true) { const ch = this.buffer[++i]; if (ch === "+") this.blockScalarKeep = true; else if (ch > "0" && ch <= "9") this.blockScalarIndent = Number(ch) - 1; else if (ch !== "-") break; } return yield* this.pushUntil((ch) => isEmpty(ch) || ch === "#"); } *parseBlockScalar() { let nl = this.pos - 1; let indent = 0; let ch; loop: for (let i2 = this.pos; ch = this.buffer[i2]; ++i2) { switch (ch) { case " ": indent += 1; break; case "\n": nl = i2; indent = 0; break; case "\r": { const next = this.buffer[i2 + 1]; if (!next && !this.atEnd) return this.setNext("block-scalar"); if (next === "\n") break; } default: break loop; } } if (!ch && !this.atEnd) return this.setNext("block-scalar"); if (indent >= this.indentNext) { if (this.blockScalarIndent === -1) this.indentNext = indent; else { this.indentNext = this.blockScalarIndent + (this.indentNext === 0 ? 1 : this.indentNext); } do { const cs = this.continueScalar(nl + 1); if (cs === -1) break; nl = this.buffer.indexOf("\n", cs); } while (nl !== -1); if (nl === -1) { if (!this.atEnd) return this.setNext("block-scalar"); nl = this.buffer.length; } } let i = nl + 1; ch = this.buffer[i]; while (ch === " ") ch = this.buffer[++i]; if (ch === " ") { while (ch === " " || ch === " " || ch === "\r" || ch === "\n") ch = this.buffer[++i]; nl = i - 1; } else if (!this.blockScalarKeep) { do { let i2 = nl - 1; let ch2 = this.buffer[i2]; if (ch2 === "\r") ch2 = this.buffer[--i2]; const lastChar = i2; while (ch2 === " ") ch2 = this.buffer[--i2]; if (ch2 === "\n" && i2 >= this.pos && i2 + 1 + indent > lastChar) nl = i2; else break; } while (true); } yield cst.SCALAR; yield* this.pushToIndex(nl + 1, true); return yield* this.parseLineStart(); } *parsePlainScalar() { const inFlow = this.flowLevel > 0; let end = this.pos - 1; let i = this.pos - 1; let ch; while (ch = this.buffer[++i]) { if (ch === ":") { const next = this.buffer[i + 1]; if (isEmpty(next) || inFlow && flowIndicatorChars.has(next)) break; end = i; } else if (isEmpty(ch)) { let next = this.buffer[i + 1]; if (ch === "\r") { if (next === "\n") { i += 1; ch = "\n"; next = this.buffer[i + 1]; } else end = i; } if (next === "#" || inFlow && flowIndicatorChars.has(next)) break; if (ch === "\n") { const cs = this.continueScalar(i + 1); if (cs === -1) break; i = Math.max(i, cs - 2); } } else { if (inFlow && flowIndicatorChars.has(ch)) break; end = i; } } if (!ch && !this.atEnd) return this.setNext("plain-scalar"); yield cst.SCALAR; yield* this.pushToIndex(end + 1, true); return inFlow ? "flow" : "doc"; } *pushCount(n) { if (n > 0) { yield this.buffer.substr(this.pos, n); this.pos += n; return n; } return 0; } *pushToIndex(i, allowEmpty) { const s = this.buffer.slice(this.pos, i); if (s) { yield s; this.pos += s.length; return s.length; } else if (allowEmpty) yield ""; return 0; } *pushIndicators() { switch (this.charAt(0)) { case "!": return (yield* this.pushTag()) + (yield* this.pushSpaces(true)) + (yield* this.pushIndicators()); case "&": return (yield* this.pushUntil(isNotAnchorChar)) + (yield* this.pushSpaces(true)) + (yield* this.pushIndicators()); case "-": case "?": case ":": { const inFlow = this.flowLevel > 0; const ch1 = this.charAt(1); if (isEmpty(ch1) || inFlow && flowIndicatorChars.has(ch1)) { if (!inFlow) this.indentNext = this.indentValue + 1; else if (this.flowKey) this.flowKey = false; return (yield* this.pushCount(1)) + (yield* this.pushSpaces(true)) + (yield* this.pushIndicators()); } } } return 0; } *pushTag() { if (this.charAt(1) === "<") { let i = this.pos + 2; let ch = this.buffer[i]; while (!isEmpty(ch) && ch !== ">") ch = this.buffer[++i]; return yield* this.pushToIndex(ch === ">" ? i + 1 : i, false); } else { let i = this.pos + 1; let ch = this.buffer[i]; while (ch) { if (tagChars.has(ch)) ch = this.buffer[++i]; else if (ch === "%" && hexDigits.has(this.buffer[i + 1]) && hexDigits.has(this.buffer[i + 2])) { ch = this.buffer[i += 3]; } else break; } return yield* this.pushToIndex(i, false); } } *pushNewline() { const ch = this.buffer[this.pos]; if (ch === "\n") return yield* this.pushCount(1); else if (ch === "\r" && this.charAt(1) === "\n") return yield* this.pushCount(2); else return 0; } *pushSpaces(allowTabs) { let i = this.pos - 1; let ch; do { ch = this.buffer[++i]; } while (ch === " " || allowTabs && ch === " "); const n = i - this.pos; if (n > 0) { yield this.buffer.substr(this.pos, n); this.pos = i; } return n; } *pushUntil(test) { let i = this.pos; let ch = this.buffer[i]; while (!test(ch)) ch = this.buffer[++i]; return yield* this.pushToIndex(i, false); } }; exports.Lexer = Lexer; } }); var require_line_counter = __commonJS2({ ""(exports) { "use strict"; var LineCounter = class { constructor() { this.lineStarts = []; this.addNewLine = (offset) => this.lineStarts.push(offset); this.linePos = (offset) => { let low = 0; let high = this.lineStarts.length; while (low < high) { const mid = low + high >> 1; if (this.lineStarts[mid] < offset) low = mid + 1; else high = mid; } if (this.lineStarts[low] === offset) return { line: low + 1, col: 1 }; if (low === 0) return { line: 0, col: offset }; const start = this.lineStarts[low - 1]; return { line: low, col: offset - start + 1 }; }; } }; exports.LineCounter = LineCounter; } }); var require_parser = __commonJS2({ ""(exports) { "use strict"; var node_process = __require2("process"); var cst = require_cst(); var lexer = require_lexer(); function includesToken(list, type) { for (let i = 0; i < list.length; ++i) if (list[i].type === type) return true; return false; } function findNonEmptyIndex(list) { for (let i = 0; i < list.length; ++i) { switch (list[i].type) { case "space": case "comment": case "newline": break; default: return i; } } return -1; } function isFlowToken(token) { switch (token?.type) { case "alias": case "scalar": case "single-quoted-scalar": case "double-quoted-scalar": case "flow-collection": return true; default: return false; } } function getPrevProps(parent) { switch (parent.type) { case "document": return parent.start; case "block-map": { const it = parent.items[parent.items.length - 1]; return it.sep ?? it.start; } case "block-seq": return parent.items[parent.items.length - 1].start; default: return []; } } function getFirstKeyStartProps(prev) { if (prev.length === 0) return []; let i = prev.length; loop: while (--i >= 0) { switch (prev[i].type) { case "doc-start": case "explicit-key-ind": case "map-value-ind": case "seq-item-ind": case "newline": break loop; } } while (prev[++i]?.type === "space") { } return prev.splice(i, prev.length); } function fixFlowSeqItems(fc) { if (fc.start.type === "flow-seq-start") { for (const it of fc.items) { if (it.sep && !it.value && !includesToken(it.start, "explicit-key-ind") && !includesToken(it.sep, "map-value-ind")) { if (it.key) it.value = it.key; delete it.key; if (isFlowToken(it.value)) { if (it.value.end) Array.prototype.push.apply(it.value.end, it.sep); else it.value.end = it.sep; } else Array.prototype.push.apply(it.start, it.sep); delete it.sep; } } } } var Parser2 = class { /** * @param onNewLine - If defined, called separately with the start position of * each new line (in `parse()`, including the start of input). */ constructor(onNewLine) { this.atNewLine = true; this.atScalar = false; this.indent = 0; this.offset = 0; this.onKeyLine = false; this.stack = []; this.source = ""; this.type = ""; this.lexer = new lexer.Lexer(); this.onNewLine = onNewLine; } /** * Parse `source` as a YAML stream. * If `incomplete`, a part of the last line may be left as a buffer for the next call. * * Errors are not thrown, but yielded as `{ type: 'error', message }` tokens. * * @returns A generator of tokens representing each directive, document, and other structure. */ *parse(source, incomplete = false) { if (this.onNewLine && this.offset === 0) this.onNewLine(0); for (const lexeme of this.lexer.lex(source, incomplete)) yield* this.next(lexeme); if (!incomplete) yield* this.end(); } /** * Advance the parser by the `source` of one lexical token. */ *next(source) { this.source = source; if (node_process.env.LOG_TOKENS) console.log("|", cst.prettyToken(source)); if (this.atScalar) { this.atScalar = false; yield* this.step(); this.offset += source.length; return; } const type = cst.tokenType(source); if (!type) { const message = `Not a YAML token: ${source}`; yield* this.pop({ type: "error", offset: this.offset, message, source }); this.offset += source.length; } else if (type === "scalar") { this.atNewLine = false; this.atScalar = true; this.type = "scalar"; } else { this.type = type; yield* this.step(); switch (type) { case "newline": this.atNewLine = true; this.indent = 0; if (this.onNewLine) this.onNewLine(this.offset + source.length); break; case "space": if (this.atNewLine && source[0] === " ") this.indent += source.length; break; case "explicit-key-ind": case "map-value-ind": case "seq-item-ind": if (this.atNewLine) this.indent += source.length; break; case "doc-mode": case "flow-error-end": return; default: this.atNewLine = false; } this.offset += source.length; } } /** Call at end of input to push out any remaining constructions */ *end() { while (this.stack.length > 0) yield* this.pop(); } get sourceToken() { const st = { type: this.type, offset: this.offset, indent: this.indent, source: this.source }; return st; } *step() { const top2 = this.peek(1); if (this.type === "doc-end" && top2?.type !== "doc-end") { while (this.stack.length > 0) yield* this.pop(); this.stack.push({ type: "doc-end", offset: this.offset, source: this.source }); return; } if (!top2) return yield* this.stream(); switch (top2.type) { case "document": return yield* this.document(top2); case "alias": case "scalar": case "single-quoted-scalar": case "double-quoted-scalar": return yield* this.scalar(top2); case "block-scalar": return yield* this.blockScalar(top2); case "block-map": return yield* this.blockMap(top2); case "block-seq": return yield* this.blockSequence(top2); case "flow-collection": return yield* this.flowCollection(top2); case "doc-end": return yield* this.documentEnd(top2); } yield* this.pop(); } peek(n) { return this.stack[this.stack.length - n]; } *pop(error2) { const token = error2 ?? this.stack.pop(); if (!token) { const message = "Tried to pop an empty stack"; yield { type: "error", offset: this.offset, source: "", message }; } else if (this.stack.length === 0) { yield token; } else { const top2 = this.peek(1); if (token.type === "block-scalar") { token.indent = "indent" in top2 ? top2.indent : 0; } else if (token.type === "flow-collection" && top2.type === "document") { token.indent = 0; } if (token.type === "flow-collection") fixFlowSeqItems(token); switch (top2.type) { case "document": top2.value = token; break; case "block-scalar": top2.props.push(token); break; case "block-map": { const it = top2.items[top2.items.length - 1]; if (it.value) { top2.items.push({ start: [], key: token, sep: [] }); this.onKeyLine = true; return; } else if (it.sep) { it.value = token; } else { Object.assign(it, { key: token, sep: [] }); this.onKeyLine = !it.explicitKey; return; } break; } case "block-seq": { const it = top2.items[top2.items.length - 1]; if (it.value) top2.items.push({ start: [], value: token }); else it.value = token; break; } case "flow-collection": { const it = top2.items[top2.items.length - 1]; if (!it || it.value) top2.items.push({ start: [], key: token, sep: [] }); else if (it.sep) it.value = token; else Object.assign(it, { key: token, sep: [] }); return; } default: yield* this.pop(); yield* this.pop(token); } if ((top2.type === "document" || top2.type === "block-map" || top2.type === "block-seq") && (token.type === "block-map" || token.type === "block-seq")) { const last = token.items[token.items.length - 1]; if (last && !last.sep && !last.value && last.start.length > 0 && findNonEmptyIndex(last.start) === -1 && (token.indent === 0 || last.start.every((st) => st.type !== "comment" || st.indent < token.indent))) { if (top2.type === "document") top2.end = last.start; else top2.items.push({ start: last.start }); token.items.splice(-1, 1); } } } } *stream() { switch (this.type) { case "directive-line": yield { type: "directive", offset: this.offset, source: this.source }; return; case "byte-order-mark": case "space": case "comment": case "newline": yield this.sourceToken; return; case "doc-mode": case "doc-start": { const doc = { type: "document", offset: this.offset, start: [] }; if (this.type === "doc-start") doc.start.push(this.sourceToken); this.stack.push(doc); return; } } yield { type: "error", offset: this.offset, message: `Unexpected ${this.type} token in YAML stream`, source: this.source }; } *document(doc) { if (doc.value) return yield* this.lineEnd(doc); switch (this.type) { case "doc-start": { if (findNonEmptyIndex(doc.start) !== -1) { yield* this.pop(); yield* this.step(); } else doc.start.push(this.sourceToken); return; } case "anchor": case "tag": case "space": case "comment": case "newline": doc.start.push(this.sourceToken); return; } const bv = this.startBlockValue(doc); if (bv) this.stack.push(bv); else { yield { type: "error", offset: this.offset, message: `Unexpected ${this.type} token in YAML document`, source: this.source }; } } *scalar(scalar) { if (this.type === "map-value-ind") { const prev = getPrevProps(this.peek(2)); const start = getFirstKeyStartProps(prev); let sep22; if (scalar.end) { sep22 = scalar.end; sep22.push(this.sourceToken); delete scalar.end; } else sep22 = [this.sourceToken]; const map = { type: "block-map", offset: scalar.offset, indent: scalar.indent, items: [{ start, key: scalar, sep: sep22 }] }; this.onKeyLine = true; this.stack[this.stack.length - 1] = map; } else yield* this.lineEnd(scalar); } *blockScalar(scalar) { switch (this.type) { case "space": case "comment": case "newline": scalar.props.push(this.sourceToken); return; case "scalar": scalar.source = this.source; this.atNewLine = true; this.indent = 0; if (this.onNewLine) { let nl = this.source.indexOf("\n") + 1; while (nl !== 0) { this.onNewLine(this.offset + nl); nl = this.source.indexOf("\n", nl) + 1; } } yield* this.pop(); break; default: yield* this.pop(); yield* this.step(); } } *blockMap(map) { const it = map.items[map.items.length - 1]; switch (this.type) { case "newline": this.onKeyLine = false; if (it.value) { const end = "end" in it.value ? it.value.end : void 0; const last = Array.isArray(end) ? end[end.length - 1] : void 0; if (last?.type === "comment") end?.push(this.sourceToken); else map.items.push({ start: [this.sourceToken] }); } else if (it.sep) { it.sep.push(this.sourceToken); } else { it.start.push(this.sourceToken); } return; case "space": case "comment": if (it.value) { map.items.push({ start: [this.sourceToken] }); } else if (it.sep) { it.sep.push(this.sourceToken); } else { if (this.atIndentedComment(it.start, map.indent)) { const prev = map.items[map.items.length - 2]; const end = prev?.value?.end; if (Array.isArray(end)) { Array.prototype.push.apply(end, it.start); end.push(this.sourceToken); map.items.pop(); return; } } it.start.push(this.sourceToken); } return; } if (this.indent >= map.indent) { const atMapIndent = !this.onKeyLine && this.indent === map.indent; const atNextItem = atMapIndent && (it.sep || it.explicitKey) && this.type !== "seq-item-ind"; let start = []; if (atNextItem && it.sep && !it.value) { const nl = []; for (let i = 0; i < it.sep.length; ++i) { const st = it.sep[i]; switch (st.type) { case "newline": nl.push(i); break; case "space": break; case "comment": if (st.indent > map.indent) nl.length = 0; break; default: nl.length = 0; } } if (nl.length >= 2) start = it.sep.splice(nl[1]); } switch (this.type) { case "anchor": case "tag": if (atNextItem || it.value) { start.push(this.sourceToken); map.items.push({ start }); this.onKeyLine = true; } else if (it.sep) { it.sep.push(this.sourceToken); } else { it.start.push(this.sourceToken); } return; case "explicit-key-ind": if (!it.sep && !it.explicitKey) { it.start.push(this.sourceToken); it.explicitKey = true; } else if (atNextItem || it.value) { start.push(this.sourceToken); map.items.push({ start, explicitKey: true }); } else { this.stack.push({ type: "block-map", offset: this.offset, indent: this.indent, items: [{ start: [this.sourceToken], explicitKey: true }] }); } this.onKeyLine = true; return; case "map-value-ind": if (it.explicitKey) { if (!it.sep) { if (includesToken(it.start, "newline")) { Object.assign(it, { key: null, sep: [this.sourceToken] }); } else { const start2 = getFirstKeyStartProps(it.start); this.stack.push({ type: "block-map", offset: this.offset, indent: this.indent, items: [{ start: start2, key: null, sep: [this.sourceToken] }] }); } } else if (it.value) { map.items.push({ start: [], key: null, sep: [this.sourceToken] }); } else if (includesToken(it.sep, "map-value-ind")) { this.stack.push({ type: "block-map", offset: this.offset, indent: this.indent, items: [{ start, key: null, sep: [this.sourceToken] }] }); } else if (isFlowToken(it.key) && !includesToken(it.sep, "newline")) { const start2 = getFirstKeyStartProps(it.start); const key = it.key; const sep22 = it.sep; sep22.push(this.sourceToken); delete it.key; delete it.sep; this.stack.push({ type: "block-map", offset: this.offset, indent: this.indent, items: [{ start: start2, key, sep: sep22 }] }); } else if (start.length > 0) { it.sep = it.sep.concat(start, this.sourceToken); } else { it.sep.push(this.sourceToken); } } else { if (!it.sep) { Object.assign(it, { key: null, sep: [this.sourceToken] }); } else if (it.value || atNextItem) { map.items.push({ start, key: null, sep: [this.sourceToken] }); } else if (includesToken(it.sep, "map-value-ind")) { this.stack.push({ type: "block-map", offset: this.offset, indent: this.indent, items: [{ start: [], key: null, sep: [this.sourceToken] }] }); } else { it.sep.push(this.sourceToken); } } this.onKeyLine = true; return; case "alias": case "scalar": case "single-quoted-scalar": case "double-quoted-scalar": { const fs2 = this.flowScalar(this.type); if (atNextItem || it.value) { map.items.push({ start, key: fs2, sep: [] }); this.onKeyLine = true; } else if (it.sep) { this.stack.push(fs2); } else { Object.assign(it, { key: fs2, sep: [] }); this.onKeyLine = true; } return; } default: { const bv = this.startBlockValue(map); if (bv) { if (bv.type === "block-seq") { if (!it.explicitKey && it.sep && !includesToken(it.sep, "newline")) { yield* this.pop({ type: "error", offset: this.offset, message: "Unexpected block-seq-ind on same line with key", source: this.source }); return; } } else if (atMapIndent) { map.items.push({ start }); } this.stack.push(bv); return; } } } } yield* this.pop(); yield* this.step(); } *blockSequence(seq) { const it = seq.items[seq.items.length - 1]; switch (this.type) { case "newline": if (it.value) { const end = "end" in it.value ? it.value.end : void 0; const last = Array.isArray(end) ? end[end.length - 1] : void 0; if (last?.type === "comment") end?.push(this.sourceToken); else seq.items.push({ start: [this.sourceToken] }); } else it.start.push(this.sourceToken); return; case "space": case "comment": if (it.value) seq.items.push({ start: [this.sourceToken] }); else { if (this.atIndentedComment(it.start, seq.indent)) { const prev = seq.items[seq.items.length - 2]; const end = prev?.value?.end; if (Array.isArray(end)) { Array.prototype.push.apply(end, it.start); end.push(this.sourceToken); seq.items.pop(); return; } } it.start.push(this.sourceToken); } return; case "anchor": case "tag": if (it.value || this.indent <= seq.indent) break; it.start.push(this.sourceToken); return; case "seq-item-ind": if (this.indent !== seq.indent) break; if (it.value || includesToken(it.start, "seq-item-ind")) seq.items.push({ start: [this.sourceToken] }); else it.start.push(this.sourceToken); return; } if (this.indent > seq.indent) { const bv = this.startBlockValue(seq); if (bv) { this.stack.push(bv); return; } } yield* this.pop(); yield* this.step(); } *flowCollection(fc) { const it = fc.items[fc.items.length - 1]; if (this.type === "flow-error-end") { let top2; do { yield* this.pop(); top2 = this.peek(1); } while (top2?.type === "flow-collection"); } else if (fc.end.length === 0) { switch (this.type) { case "comma": case "explicit-key-ind": if (!it || it.sep) fc.items.push({ start: [this.sourceToken] }); else it.start.push(this.sourceToken); return; case "map-value-ind": if (!it || it.value) fc.items.push({ start: [], key: null, sep: [this.sourceToken] }); else if (it.sep) it.sep.push(this.sourceToken); else Object.assign(it, { key: null, sep: [this.sourceToken] }); return; case "space": case "comment": case "newline": case "anchor": case "tag": if (!it || it.value) fc.items.push({ start: [this.sourceToken] }); else if (it.sep) it.sep.push(this.sourceToken); else it.start.push(this.sourceToken); return; case "alias": case "scalar": case "single-quoted-scalar": case "double-quoted-scalar": { const fs2 = this.flowScalar(this.type); if (!it || it.value) fc.items.push({ start: [], key: fs2, sep: [] }); else if (it.sep) this.stack.push(fs2); else Object.assign(it, { key: fs2, sep: [] }); return; } case "flow-map-end": case "flow-seq-end": fc.end.push(this.sourceToken); return; } const bv = this.startBlockValue(fc); if (bv) this.stack.push(bv); else { yield* this.pop(); yield* this.step(); } } else { const parent = this.peek(2); if (parent.type === "block-map" && (this.type === "map-value-ind" && parent.indent === fc.indent || this.type === "newline" && !parent.items[parent.items.length - 1].sep)) { yield* this.pop(); yield* this.step(); } else if (this.type === "map-value-ind" && parent.type !== "flow-collection") { const prev = getPrevProps(parent); const start = getFirstKeyStartProps(prev); fixFlowSeqItems(fc); const sep22 = fc.end.splice(1, fc.end.length); sep22.push(this.sourceToken); const map = { type: "block-map", offset: fc.offset, indent: fc.indent, items: [{ start, key: fc, sep: sep22 }] }; this.onKeyLine = true; this.stack[this.stack.length - 1] = map; } else { yield* this.lineEnd(fc); } } } flowScalar(type) { if (this.onNewLine) { let nl = this.source.indexOf("\n") + 1; while (nl !== 0) { this.onNewLine(this.offset + nl); nl = this.source.indexOf("\n", nl) + 1; } } return { type, offset: this.offset, indent: this.indent, source: this.source }; } startBlockValue(parent) { switch (this.type) { case "alias": case "scalar": case "single-quoted-scalar": case "double-quoted-scalar": return this.flowScalar(this.type); case "block-scalar-header": return { type: "block-scalar", offset: this.offset, indent: this.indent, props: [this.sourceToken], source: "" }; case "flow-map-start": case "flow-seq-start": return { type: "flow-collection", offset: this.offset, indent: this.indent, start: this.sourceToken, items: [], end: [] }; case "seq-item-ind": return { type: "block-seq", offset: this.offset, indent: this.indent, items: [{ start: [this.sourceToken] }] }; case "explicit-key-ind": { this.onKeyLine = true; const prev = getPrevProps(parent); const start = getFirstKeyStartProps(prev); start.push(this.sourceToken); return { type: "block-map", offset: this.offset, indent: this.indent, items: [{ start, explicitKey: true }] }; } case "map-value-ind": { this.onKeyLine = true; const prev = getPrevProps(parent); const start = getFirstKeyStartProps(prev); return { type: "block-map", offset: this.offset, indent: this.indent, items: [{ start, key: null, sep: [this.sourceToken] }] }; } } return null; } atIndentedComment(start, indent) { if (this.type !== "comment") return false; if (this.indent <= indent) return false; return start.every((st) => st.type === "newline" || st.type === "space"); } *documentEnd(docEnd) { if (this.type !== "doc-mode") { if (docEnd.end) docEnd.end.push(this.sourceToken); else docEnd.end = [this.sourceToken]; if (this.type === "newline") yield* this.pop(); } } *lineEnd(token) { switch (this.type) { case "comma": case "doc-start": case "doc-end": case "flow-seq-end": case "flow-map-end": case "map-value-ind": yield* this.pop(); yield* this.step(); break; case "newline": this.onKeyLine = false; case "space": case "comment": default: if (token.end) token.end.push(this.sourceToken); else token.end = [this.sourceToken]; if (this.type === "newline") yield* this.pop(); } } }; exports.Parser = Parser2; } }); var require_public_api = __commonJS2({ ""(exports) { "use strict"; var composer = require_composer(); var Document = require_Document(); var errors = require_errors(); var log = require_log(); var identity = require_identity(); var lineCounter = require_line_counter(); var parser2 = require_parser(); function parseOptions(options) { const prettyErrors = options.prettyErrors !== false; const lineCounter$1 = options.lineCounter || prettyErrors && new lineCounter.LineCounter() || null; return { lineCounter: lineCounter$1, prettyErrors }; } function parseAllDocuments(source, options = {}) { const { lineCounter: lineCounter2, prettyErrors } = parseOptions(options); const parser$1 = new parser2.Parser(lineCounter2?.addNewLine); const composer$1 = new composer.Composer(options); const docs = Array.from(composer$1.compose(parser$1.parse(source))); if (prettyErrors && lineCounter2) for (const doc of docs) { doc.errors.forEach(errors.prettifyError(source, lineCounter2)); doc.warnings.forEach(errors.prettifyError(source, lineCounter2)); } if (docs.length > 0) return docs; return Object.assign([], { empty: true }, composer$1.streamInfo()); } function parseDocument(source, options = {}) { const { lineCounter: lineCounter2, prettyErrors } = parseOptions(options); const parser$1 = new parser2.Parser(lineCounter2?.addNewLine); const composer$1 = new composer.Composer(options); let doc = null; for (const _doc of composer$1.compose(parser$1.parse(source), true, source.length)) { if (!doc) doc = _doc; else if (doc.options.logLevel !== "silent") { doc.errors.push(new errors.YAMLParseError(_doc.range.slice(0, 2), "MULTIPLE_DOCS", "Source contains multiple documents; please use YAML.parseAllDocuments()")); break; } } if (prettyErrors && lineCounter2) { doc.errors.forEach(errors.prettifyError(source, lineCounter2)); doc.warnings.forEach(errors.prettifyError(source, lineCounter2)); } return doc; } function parse22(src, reviver, options) { let _reviver = void 0; if (typeof reviver === "function") { _reviver = reviver; } else if (options === void 0 && reviver && typeof reviver === "object") { options = reviver; } const doc = parseDocument(src, options); if (!doc) return null; doc.warnings.forEach((warning) => log.warn(doc.options.logLevel, warning)); if (doc.errors.length > 0) { if (doc.options.logLevel !== "silent") throw doc.errors[0]; else doc.errors = []; } return doc.toJS(Object.assign({ reviver: _reviver }, options)); } function stringify(value, replacer, options) { let _replacer = null; if (typeof replacer === "function" || Array.isArray(replacer)) { _replacer = replacer; } else if (options === void 0 && replacer) { options = replacer; } if (typeof options === "string") options = options.length; if (typeof options === "number") { const indent = Math.round(options); options = indent < 1 ? void 0 : indent > 8 ? { indent: 8 } : { indent }; } if (value === void 0) { const { keepUndefined } = options ?? replacer ?? {}; if (!keepUndefined) return void 0; } if (identity.isDocument(value) && !_replacer) return value.toString(options); return new Document.Document(value, _replacer, options).toString(options); } exports.parse = parse22; exports.parseAllDocuments = parseAllDocuments; exports.parseDocument = parseDocument; exports.stringify = stringify; } }); var require_dist = __commonJS2({ ""(exports) { "use strict"; var composer = require_composer(); var Document = require_Document(); var Schema = require_Schema(); var errors = require_errors(); var Alias = require_Alias(); var identity = require_identity(); var Pair = require_Pair(); var Scalar = require_Scalar(); var YAMLMap = require_YAMLMap(); var YAMLSeq = require_YAMLSeq(); var cst = require_cst(); var lexer = require_lexer(); var lineCounter = require_line_counter(); var parser2 = require_parser(); var publicApi = require_public_api(); var visit = require_visit(); exports.Composer = composer.Composer; exports.Document = Document.Document; exports.Schema = Schema.Schema; exports.YAMLError = errors.YAMLError; exports.YAMLParseError = errors.YAMLParseError; exports.YAMLWarning = errors.YAMLWarning; exports.Alias = Alias.Alias; exports.isAlias = identity.isAlias; exports.isCollection = identity.isCollection; exports.isDocument = identity.isDocument; exports.isMap = identity.isMap; exports.isNode = identity.isNode; exports.isPair = identity.isPair; exports.isScalar = identity.isScalar; exports.isSeq = identity.isSeq; exports.Pair = Pair.Pair; exports.Scalar = Scalar.Scalar; exports.YAMLMap = YAMLMap.YAMLMap; exports.YAMLSeq = YAMLSeq.YAMLSeq; exports.CST = cst; exports.Lexer = lexer.Lexer; exports.LineCounter = lineCounter.LineCounter; exports.Parser = parser2.Parser; exports.parse = publicApi.parse; exports.parseAllDocuments = publicApi.parseAllDocuments; exports.parseDocument = publicApi.parseDocument; exports.stringify = publicApi.stringify; exports.visit = visit.visit; exports.visitAsync = visit.visitAsync; } }); function getUserAgent2() { if (typeof navigator === "object" && "userAgent" in navigator) { return navigator.userAgent; } if (typeof process === "object" && process.version !== void 0) { return `Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`; } return ""; } function register2(state, name, method, options) { if (typeof method !== "function") { throw new Error("method for before hook must be a function"); } if (!options) { options = {}; } if (Array.isArray(name)) { return name.reverse().reduce((callback, name2) => { return register2.bind(null, state, name2, callback, options); }, method)(); } return Promise.resolve().then(() => { if (!state.registry[name]) { return method(options); } return state.registry[name].reduce((method2, registered) => { return registered.hook.bind(null, method2, options); }, method)(); }); } function addHook2(state, kind, name, hook22) { const orig = hook22; if (!state.registry[name]) { state.registry[name] = []; } if (kind === "before") { hook22 = (method, options) => { return Promise.resolve().then(orig.bind(null, options)).then(method.bind(null, options)); }; } if (kind === "after") { hook22 = (method, options) => { let result; return Promise.resolve().then(method.bind(null, options)).then((result_) => { result = result_; return orig(result, options); }).then(() => { return result; }); }; } if (kind === "error") { hook22 = (method, options) => { return Promise.resolve().then(method.bind(null, options)).catch((error2) => { return orig(error2, options); }); }; } state.registry[name].push({ hook: hook22, orig }); } function removeHook2(state, name, method) { if (!state.registry[name]) { return; } const index = state.registry[name].map((registered) => { return registered.orig; }).indexOf(method); if (index === -1) { return; } state.registry[name].splice(index, 1); } var bind2 = Function.bind; var bindable2 = bind2.bind(bind2); function bindApi2(hook22, state, name) { const removeHookRef = bindable2(removeHook2, null).apply( null, name ? [state, name] : [state] ); hook22.api = { remove: removeHookRef }; hook22.remove = removeHookRef; ["before", "error", "after", "wrap"].forEach((kind) => { const args = name ? [state, kind, name] : [state, kind]; hook22[kind] = hook22.api[kind] = bindable2(addHook2, null).apply(null, args); }); } function Singular2() { const singularHookName = Symbol("Singular"); const singularHookState = { registry: {} }; const singularHook = register2.bind(null, singularHookState, singularHookName); bindApi2(singularHook, singularHookState, singularHookName); return singularHook; } function Collection2() { const state = { registry: {} }; const hook22 = register2.bind(null, state); bindApi2(hook22, state); return hook22; } var before_after_hook_default2 = { Singular: Singular2, Collection: Collection2 }; var VERSION7 = "0.0.0-development"; var userAgent2 = `octokit-endpoint.js/${VERSION7} ${getUserAgent2()}`; var DEFAULTS2 = { method: "GET", baseUrl: "https://api.github.com", headers: { accept: "application/vnd.github.v3+json", "user-agent": userAgent2 }, mediaType: { format: "" } }; function lowercaseKeys2(object) { if (!object) { return {}; } return Object.keys(object).reduce((newObj, key) => { newObj[key.toLowerCase()] = object[key]; return newObj; }, {}); } function isPlainObject3(value) { if (typeof value !== "object" || value === null) return false; if (Object.prototype.toString.call(value) !== "[object Object]") return false; const proto = Object.getPrototypeOf(value); if (proto === null) return true; const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor; return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value); } function mergeDeep3(defaults2, options) { const result = Object.assign({}, defaults2); Object.keys(options).forEach((key) => { if (isPlainObject3(options[key])) { if (!(key in defaults2)) Object.assign(result, { [key]: options[key] }); else result[key] = mergeDeep3(defaults2[key], options[key]); } else { Object.assign(result, { [key]: options[key] }); } }); return result; } function removeUndefinedProperties2(obj) { for (const key in obj) { if (obj[key] === void 0) { delete obj[key]; } } return obj; } function merge2(defaults2, route, options) { if (typeof route === "string") { let [method, url] = route.split(" "); options = Object.assign(url ? { method, url } : { url: method }, options); } else { options = Object.assign({}, route); } options.headers = lowercaseKeys2(options.headers); removeUndefinedProperties2(options); removeUndefinedProperties2(options.headers); const mergedOptions = mergeDeep3(defaults2 || {}, options); if (options.url === "/graphql") { if (defaults2 && defaults2.mediaType.previews?.length) { mergedOptions.mediaType.previews = defaults2.mediaType.previews.filter( (preview) => !mergedOptions.mediaType.previews.includes(preview) ).concat(mergedOptions.mediaType.previews); } mergedOptions.mediaType.previews = (mergedOptions.mediaType.previews || []).map((preview) => preview.replace(/-preview/, "")); } return mergedOptions; } function addQueryParameters2(url, parameters) { const separator = /\?/.test(url) ? "&" : "?"; const names = Object.keys(parameters); if (names.length === 0) { return url; } return url + separator + names.map((name) => { if (name === "q") { return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+"); } return `${name}=${encodeURIComponent(parameters[name])}`; }).join("&"); } var urlVariableRegex2 = /\{[^{}}]+\}/g; function removeNonChars2(variableName) { return variableName.replace(/(?:^\W+)|(?:(? a.concat(b), []); } function omit2(object, keysToOmit) { const result = { __proto__: null }; for (const key of Object.keys(object)) { if (keysToOmit.indexOf(key) === -1) { result[key] = object[key]; } } return result; } function encodeReserved2(str) { return str.split(/(%[0-9A-Fa-f]{2})/g).map(function(part) { if (!/%[0-9A-Fa-f]/.test(part)) { part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]"); } return part; }).join(""); } function encodeUnreserved2(str) { return encodeURIComponent(str).replace(/[!'()*]/g, function(c) { return "%" + c.charCodeAt(0).toString(16).toUpperCase(); }); } function encodeValue2(operator, value, key) { value = operator === "+" || operator === "#" ? encodeReserved2(value) : encodeUnreserved2(value); if (key) { return encodeUnreserved2(key) + "=" + value; } else { return value; } } function isDefined2(value) { return value !== void 0 && value !== null; } function isKeyOperator2(operator) { return operator === ";" || operator === "&" || operator === "?"; } function getValues2(context3, operator, key, modifier) { var value = context3[key], result = []; if (isDefined2(value) && value !== "") { if (typeof value === "string" || typeof value === "number" || typeof value === "bigint" || typeof value === "boolean") { value = value.toString(); if (modifier && modifier !== "*") { value = value.substring(0, parseInt(modifier, 10)); } result.push( encodeValue2(operator, value, isKeyOperator2(operator) ? key : "") ); } else { if (modifier === "*") { if (Array.isArray(value)) { value.filter(isDefined2).forEach(function(value2) { result.push( encodeValue2(operator, value2, isKeyOperator2(operator) ? key : "") ); }); } else { Object.keys(value).forEach(function(k) { if (isDefined2(value[k])) { result.push(encodeValue2(operator, value[k], k)); } }); } } else { const tmp = []; if (Array.isArray(value)) { value.filter(isDefined2).forEach(function(value2) { tmp.push(encodeValue2(operator, value2)); }); } else { Object.keys(value).forEach(function(k) { if (isDefined2(value[k])) { tmp.push(encodeUnreserved2(k)); tmp.push(encodeValue2(operator, value[k].toString())); } }); } if (isKeyOperator2(operator)) { result.push(encodeUnreserved2(key) + "=" + tmp.join(",")); } else if (tmp.length !== 0) { result.push(tmp.join(",")); } } } } else { if (operator === ";") { if (isDefined2(value)) { result.push(encodeUnreserved2(key)); } } else if (value === "" && (operator === "&" || operator === "?")) { result.push(encodeUnreserved2(key) + "="); } else if (value === "") { result.push(""); } } return result; } function parseUrl2(template) { return { expand: expand2.bind(null, template) }; } function expand2(template, context3) { var operators = ["+", "#", ".", "/", ";", "?", "&"]; template = template.replace( /\{([^\{\}]+)\}|([^\{\}]+)/g, function(_, expression, literal) { if (expression) { let operator = ""; const values = []; if (operators.indexOf(expression.charAt(0)) !== -1) { operator = expression.charAt(0); expression = expression.substr(1); } expression.split(/,/g).forEach(function(variable) { var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable); values.push(getValues2(context3, operator, tmp[1], tmp[2] || tmp[3])); }); if (operator && operator !== "+") { var separator = ","; if (operator === "?") { separator = "&"; } else if (operator !== "#") { separator = operator; } return (values.length !== 0 ? operator : "") + values.join(separator); } else { return values.join(","); } } else { return encodeReserved2(literal); } } ); if (template === "/") { return template; } else { return template.replace(/\/$/, ""); } } function parse2(options) { let method = options.method.toUpperCase(); let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{$1}"); let headers = Object.assign({}, options.headers); let body; let parameters = omit2(options, [ "method", "baseUrl", "url", "headers", "request", "mediaType" ]); const urlVariableNames = extractUrlVariableNames2(url); url = parseUrl2(url).expand(parameters); if (!/^http/.test(url)) { url = options.baseUrl + url; } const omittedParameters = Object.keys(options).filter((option) => urlVariableNames.includes(option)).concat("baseUrl"); const remainingParameters = omit2(parameters, omittedParameters); const isBinaryRequest = /application\/octet-stream/i.test(headers.accept); if (!isBinaryRequest) { if (options.mediaType.format) { headers.accept = headers.accept.split(/,/).map( (format3) => format3.replace( /application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${options.mediaType.format}` ) ).join(","); } if (url.endsWith("/graphql")) { if (options.mediaType.previews?.length) { const previewsFromAcceptHeader = headers.accept.match(/(? { const format3 = options.mediaType.format ? `.${options.mediaType.format}` : "+json"; return `application/vnd.github.${preview}-preview${format3}`; }).join(","); } } } if (["GET", "HEAD"].includes(method)) { url = addQueryParameters2(url, remainingParameters); } else { if ("data" in remainingParameters) { body = remainingParameters.data; } else { if (Object.keys(remainingParameters).length) { body = remainingParameters; } } } if (!headers["content-type"] && typeof body !== "undefined") { headers["content-type"] = "application/json; charset=utf-8"; } if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") { body = ""; } return Object.assign( { method, url, headers }, typeof body !== "undefined" ? { body } : null, options.request ? { request: options.request } : null ); } function endpointWithDefaults2(defaults2, route, options) { return parse2(merge2(defaults2, route, options)); } function withDefaults4(oldDefaults, newDefaults) { const DEFAULTS22 = merge2(oldDefaults, newDefaults); const endpoint22 = endpointWithDefaults2.bind(null, DEFAULTS22); return Object.assign(endpoint22, { DEFAULTS: DEFAULTS22, defaults: withDefaults4.bind(null, DEFAULTS22), merge: merge2.bind(null, DEFAULTS22), parse: parse2 }); } var endpoint2 = withDefaults4(null, DEFAULTS2); var import_fast_content_type_parse2 = __toESM2(require_fast_content_type_parse2()); var intRegex2 = /^-?\d+$/; var noiseValue2 = /^-?\d+n+$/; var originalStringify2 = JSON.stringify; var originalParse2 = JSON.parse; var customFormat2 = /^-?\d+n$/; var bigIntsStringify2 = /([\[:])?"(-?\d+)n"($|([\\n]|\s)*(\s|[\\n])*[,\}\]])/g; var noiseStringify2 = /([\[:])?("-?\d+n+)n("$|"([\\n]|\s)*(\s|[\\n])*[,\}\]])/g; var JSONStringify2 = (value, replacer, space) => { if ("rawJSON" in JSON) { return originalStringify2( value, (key, value2) => { if (typeof value2 === "bigint") return JSON.rawJSON(value2.toString()); if (typeof replacer === "function") return replacer(key, value2); if (Array.isArray(replacer) && replacer.includes(key)) return value2; return value2; }, space ); } if (!value) return originalStringify2(value, replacer, space); const convertedToCustomJSON = originalStringify2( value, (key, value2) => { const isNoise = typeof value2 === "string" && noiseValue2.test(value2); if (isNoise) return value2.toString() + "n"; if (typeof value2 === "bigint") return value2.toString() + "n"; if (typeof replacer === "function") return replacer(key, value2); if (Array.isArray(replacer) && replacer.includes(key)) return value2; return value2; }, space ); const processedJSON = convertedToCustomJSON.replace( bigIntsStringify2, "$1$2$3" ); const denoisedJSON = processedJSON.replace(noiseStringify2, "$1$2$3"); return denoisedJSON; }; var featureCache2 = /* @__PURE__ */ new Map(); var isContextSourceSupported2 = () => { const parseFingerprint = JSON.parse.toString(); if (featureCache2.has(parseFingerprint)) { return featureCache2.get(parseFingerprint); } try { const result = JSON.parse( "1", (_, __, context3) => !!context3?.source && context3.source === "1" ); featureCache2.set(parseFingerprint, result); return result; } catch { featureCache2.set(parseFingerprint, false); return false; } }; var convertMarkedBigIntsReviver2 = (key, value, context3, userReviver) => { const isCustomFormatBigInt = typeof value === "string" && customFormat2.test(value); if (isCustomFormatBigInt) return BigInt(value.slice(0, -1)); const isNoiseValue = typeof value === "string" && noiseValue2.test(value); if (isNoiseValue) return value.slice(0, -1); if (typeof userReviver !== "function") return value; return userReviver(key, value, context3); }; var JSONParseV22 = (text, reviver) => { return JSON.parse(text, (key, value, context3) => { const isBigNumber = typeof value === "number" && (value > Number.MAX_SAFE_INTEGER || value < Number.MIN_SAFE_INTEGER); const isInt = context3 && intRegex2.test(context3.source); const isBigInt = isBigNumber && isInt; if (isBigInt) return BigInt(context3.source); if (typeof reviver !== "function") return value; return reviver(key, value, context3); }); }; var MAX_INT2 = Number.MAX_SAFE_INTEGER.toString(); var MAX_DIGITS2 = MAX_INT2.length; var stringsOrLargeNumbers2 = /"(?:\\.|[^"])*"|-?(0|[1-9][0-9]*)(\.[0-9]+)?([eE][+-]?[0-9]+)?/g; var noiseValueWithQuotes2 = /^"-?\d+n+"$/; var JSONParse2 = (text, reviver) => { if (!text) return originalParse2(text, reviver); if (isContextSourceSupported2()) return JSONParseV22(text, reviver); const serializedData = text.replace( stringsOrLargeNumbers2, (text2, digits, fractional, exponential) => { const isString = text2[0] === '"'; const isNoise = isString && noiseValueWithQuotes2.test(text2); if (isNoise) return text2.substring(0, text2.length - 1) + 'n"'; const isFractionalOrExponential = fractional || exponential; const isLessThanMaxSafeInt = digits && (digits.length < MAX_DIGITS2 || digits.length === MAX_DIGITS2 && digits <= MAX_INT2); if (isString || isFractionalOrExponential || isLessThanMaxSafeInt) return text2; return '"' + text2 + 'n"'; } ); return originalParse2( serializedData, (key, value, context3) => convertMarkedBigIntsReviver2(key, value, context3, reviver) ); }; var RequestError2 = class extends Error { name; /** * http status code */ status; /** * Request options that lead to the error. */ request; /** * Response object if a response was received */ response; constructor(message, statusCode, options) { super(message, { cause: options.cause }); this.name = "HttpError"; this.status = Number.parseInt(statusCode); if (Number.isNaN(this.status)) { this.status = 0; } if ("response" in options) { this.response = options.response; } const requestCopy = Object.assign({}, options.request); if (options.request.headers.authorization) { requestCopy.headers = Object.assign({}, options.request.headers, { authorization: options.request.headers.authorization.replace( /(? ""; async function fetchWrapper2(requestOptions) { const fetch22 = requestOptions.request?.fetch || globalThis.fetch; if (!fetch22) { throw new Error( "fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing" ); } const log = requestOptions.request?.log || console; const parseSuccessResponseBody = requestOptions.request?.parseSuccessResponseBody !== false; const body = isPlainObject22(requestOptions.body) || Array.isArray(requestOptions.body) ? JSONStringify2(requestOptions.body) : requestOptions.body; const requestHeaders = Object.fromEntries( Object.entries(requestOptions.headers).map(([name, value]) => [ name, String(value) ]) ); let fetchResponse; try { fetchResponse = await fetch22(requestOptions.url, { method: requestOptions.method, body, redirect: requestOptions.request?.redirect, headers: requestHeaders, signal: requestOptions.request?.signal, // duplex must be set if request.body is ReadableStream or Async Iterables. // See https://fetch.spec.whatwg.org/#dom-requestinit-duplex. ...requestOptions.body && { duplex: "half" } }); } catch (error2) { let message = "Unknown Error"; if (error2 instanceof Error) { if (error2.name === "AbortError") { error2.status = 500; throw error2; } message = error2.message; if (error2.name === "TypeError" && "cause" in error2) { if (error2.cause instanceof Error) { message = error2.cause.message; } else if (typeof error2.cause === "string") { message = error2.cause; } } } const requestError = new RequestError2(message, 500, { request: requestOptions }); requestError.cause = error2; throw requestError; } const status = fetchResponse.status; const url = fetchResponse.url; const responseHeaders = {}; for (const [key, value] of fetchResponse.headers) { responseHeaders[key] = value; } const octokitResponse = { url, status, headers: responseHeaders, data: "" }; if ("deprecation" in responseHeaders) { const matches = responseHeaders.link && responseHeaders.link.match(/<([^<>]+)>; rel="deprecation"/); const deprecationLink = matches && matches.pop(); log.warn( `[@octokit/request] "${requestOptions.method} ${requestOptions.url}" is deprecated. It is scheduled to be removed on ${responseHeaders.sunset}${deprecationLink ? `. See ${deprecationLink}` : ""}` ); } if (status === 204 || status === 205) { return octokitResponse; } if (requestOptions.method === "HEAD") { if (status < 400) { return octokitResponse; } throw new RequestError2(fetchResponse.statusText, status, { response: octokitResponse, request: requestOptions }); } if (status === 304) { octokitResponse.data = await getResponseData2(fetchResponse); throw new RequestError2("Not modified", status, { response: octokitResponse, request: requestOptions }); } if (status >= 400) { octokitResponse.data = await getResponseData2(fetchResponse); throw new RequestError2(toErrorMessage2(octokitResponse.data), status, { response: octokitResponse, request: requestOptions }); } octokitResponse.data = parseSuccessResponseBody ? await getResponseData2(fetchResponse) : fetchResponse.body; return octokitResponse; } async function getResponseData2(response) { const contentType = response.headers.get("content-type"); if (!contentType) { return response.text().catch(noop3); } const mimetype = (0, import_fast_content_type_parse2.safeParse)(contentType); if (isJSONResponse2(mimetype)) { let text = ""; try { text = await response.text(); return JSONParse2(text); } catch (err) { return text; } } else if (mimetype.type.startsWith("text/") || mimetype.parameters.charset?.toLowerCase() === "utf-8") { return response.text().catch(noop3); } else { return response.arrayBuffer().catch( /* v8 ignore next -- @preserve */ () => new ArrayBuffer(0) ); } } function isJSONResponse2(mimetype) { return mimetype.type === "application/json" || mimetype.type === "application/scim+json"; } function toErrorMessage2(data) { if (typeof data === "string") { return data; } if (data instanceof ArrayBuffer) { return "Unknown error"; } if ("message" in data) { const suffix = "documentation_url" in data ? ` - ${data.documentation_url}` : ""; return Array.isArray(data.errors) ? `${data.message}: ${data.errors.map((v) => JSON.stringify(v)).join(", ")}${suffix}` : `${data.message}${suffix}`; } return `Unknown error: ${JSON.stringify(data)}`; } function withDefaults22(oldEndpoint, newDefaults) { const endpoint22 = oldEndpoint.defaults(newDefaults); const newApi = function(route, parameters) { const endpointOptions = endpoint22.merge(route, parameters); if (!endpointOptions.request || !endpointOptions.request.hook) { return fetchWrapper2(endpoint22.parse(endpointOptions)); } const request22 = (route2, parameters2) => { return fetchWrapper2( endpoint22.parse(endpoint22.merge(route2, parameters2)) ); }; Object.assign(request22, { endpoint: endpoint22, defaults: withDefaults22.bind(null, endpoint22) }); return endpointOptions.request.hook(request22, endpointOptions); }; return Object.assign(newApi, { endpoint: endpoint22, defaults: withDefaults22.bind(null, endpoint22) }); } var request2 = withDefaults22(endpoint2, defaults_default2); var VERSION32 = "0.0.0-development"; function _buildMessageForResponseErrors2(data) { return `Request failed due to following response errors: ` + data.errors.map((e) => ` - ${e.message}`).join("\n"); } var GraphqlResponseError2 = class extends Error { constructor(request22, headers, response) { super(_buildMessageForResponseErrors2(response)); this.request = request22; this.headers = headers; this.response = response; this.errors = response.errors; this.data = response.data; if (Error.captureStackTrace) { Error.captureStackTrace(this, this.constructor); } } name = "GraphqlResponseError"; errors; data; }; var NON_VARIABLE_OPTIONS2 = [ "method", "baseUrl", "url", "headers", "request", "query", "mediaType", "operationName" ]; var FORBIDDEN_VARIABLE_OPTIONS2 = ["query", "method", "url"]; var GHES_V3_SUFFIX_REGEX2 = /\/api\/v3\/?$/; function graphql3(request22, query2, options) { if (options) { if (typeof query2 === "string" && "query" in options) { return Promise.reject( new Error(`[@octokit/graphql] "query" cannot be used as variable name`) ); } for (const key in options) { if (!FORBIDDEN_VARIABLE_OPTIONS2.includes(key)) continue; return Promise.reject( new Error( `[@octokit/graphql] "${key}" cannot be used as variable name` ) ); } } const parsedOptions = typeof query2 === "string" ? Object.assign({ query: query2 }, options) : query2; const requestOptions = Object.keys( parsedOptions ).reduce((result, key) => { if (NON_VARIABLE_OPTIONS2.includes(key)) { result[key] = parsedOptions[key]; return result; } if (!result.variables) { result.variables = {}; } result.variables[key] = parsedOptions[key]; return result; }, {}); const baseUrl2 = parsedOptions.baseUrl || request22.endpoint.DEFAULTS.baseUrl; if (GHES_V3_SUFFIX_REGEX2.test(baseUrl2)) { requestOptions.url = baseUrl2.replace(GHES_V3_SUFFIX_REGEX2, "/api/graphql"); } return request22(requestOptions).then((response) => { if (response.data.errors) { const headers = {}; for (const key of Object.keys(response.headers)) { headers[key] = response.headers[key]; } throw new GraphqlResponseError2( requestOptions, headers, response.data ); } return response.data.data; }); } function withDefaults32(request22, newDefaults) { const newRequest = request22.defaults(newDefaults); const newApi = (query2, options) => { return graphql3(newRequest, query2, options); }; return Object.assign(newApi, { defaults: withDefaults32.bind(null, newRequest), endpoint: newRequest.endpoint }); } var graphql22 = withDefaults32(request2, { headers: { "user-agent": `octokit-graphql.js/${VERSION32} ${getUserAgent2()}` }, method: "POST", url: "/graphql" }); function withCustomRequest2(customRequest) { return withDefaults32(customRequest, { method: "POST", url: "/graphql" }); } var b64url2 = "(?:[a-zA-Z0-9_-]+)"; var sep2 = "\\."; var jwtRE2 = new RegExp(`^${b64url2}${sep2}${b64url2}${sep2}${b64url2}$`); var isJWT2 = jwtRE2.test.bind(jwtRE2); async function auth2(token) { const isApp = isJWT2(token); const isInstallation = token.startsWith("v1.") || token.startsWith("ghs_"); const isUserToServer = token.startsWith("ghu_"); const tokenType = isApp ? "app" : isInstallation ? "installation" : isUserToServer ? "user-to-server" : "oauth"; return { type: "token", token, tokenType }; } function withAuthorizationPrefix2(token) { if (token.split(/\./).length === 3) { return `bearer ${token}`; } return `token ${token}`; } async function hook2(token, request22, route, parameters) { const endpoint22 = request22.endpoint.merge( route, parameters ); endpoint22.headers.authorization = withAuthorizationPrefix2(token); return request22(endpoint22); } var createTokenAuth3 = function createTokenAuth22(token) { if (!token) { throw new Error("[@octokit/auth-token] No token passed to createTokenAuth"); } if (typeof token !== "string") { throw new Error( "[@octokit/auth-token] Token passed to createTokenAuth is not a string" ); } token = token.replace(/^(token|bearer) +/i, ""); return Object.assign(auth2.bind(null, token), { hook: hook2.bind(null, token) }); }; var VERSION42 = "7.0.6"; var noop22 = () => { }; var consoleWarn2 = console.warn.bind(console); var consoleError2 = console.error.bind(console); function createLogger2(logger = {}) { if (typeof logger.debug !== "function") { logger.debug = noop22; } if (typeof logger.info !== "function") { logger.info = noop22; } if (typeof logger.warn !== "function") { logger.warn = consoleWarn2; } if (typeof logger.error !== "function") { logger.error = consoleError2; } return logger; } var userAgentTrail2 = `octokit-core.js/${VERSION42} ${getUserAgent2()}`; var Octokit2 = class { static VERSION = VERSION42; static defaults(defaults2) { const OctokitWithDefaults = class extends this { constructor(...args) { const options = args[0] || {}; if (typeof defaults2 === "function") { super(defaults2(options)); return; } super( Object.assign( {}, defaults2, options, options.userAgent && defaults2.userAgent ? { userAgent: `${options.userAgent} ${defaults2.userAgent}` } : null ) ); } }; return OctokitWithDefaults; } static plugins = []; /** * Attach a plugin (or many) to your Octokit instance. * * @example * const API = Octokit.plugin(plugin1, plugin2, plugin3, ...) */ static plugin(...newPlugins) { const currentPlugins = this.plugins; const NewOctokit = class extends this { static plugins = currentPlugins.concat( newPlugins.filter((plugin) => !currentPlugins.includes(plugin)) ); }; return NewOctokit; } constructor(options = {}) { const hook22 = new before_after_hook_default2.Collection(); const requestDefaults = { baseUrl: request2.endpoint.DEFAULTS.baseUrl, headers: {}, request: Object.assign({}, options.request, { // @ts-ignore internal usage only, no need to type hook: hook22.bind(null, "request") }), mediaType: { previews: [], format: "" } }; requestDefaults.headers["user-agent"] = options.userAgent ? `${options.userAgent} ${userAgentTrail2}` : userAgentTrail2; if (options.baseUrl) { requestDefaults.baseUrl = options.baseUrl; } if (options.previews) { requestDefaults.mediaType.previews = options.previews; } if (options.timeZone) { requestDefaults.headers["time-zone"] = options.timeZone; } this.request = request2.defaults(requestDefaults); this.graphql = withCustomRequest2(this.request).defaults(requestDefaults); this.log = createLogger2(options.log); this.hook = hook22; if (!options.authStrategy) { if (!options.auth) { this.auth = async () => ({ type: "unauthenticated" }); } else { const auth22 = createTokenAuth3(options.auth); hook22.wrap("request", auth22.hook); this.auth = auth22; } } else { const { authStrategy, ...otherOptions } = options; const auth22 = authStrategy( Object.assign( { request: this.request, log: this.log, // we pass the current octokit instance as well as its constructor options // to allow for authentication strategies that return a new octokit instance // that shares the same internal state as the current one. The original // requirement for this was the "event-octokit" authentication strategy // of https://github.com/probot/octokit-auth-probot. octokit: this, octokitOptions: otherOptions }, options.auth ) ); hook22.wrap("request", auth22.hook); this.auth = auth22; } const classConstructor = this.constructor; for (let i = 0; i < classConstructor.plugins.length; ++i) { Object.assign(this, classConstructor.plugins[i](this, options)); } } // assigned during constructor request; graphql; log; hook; // TODO: type `octokit.auth` based on passed options.authStrategy auth; }; var VERSION52 = "6.0.0"; function requestLog(octokit) { octokit.hook.wrap("request", (request22, options) => { octokit.log.debug("request", options); const start = Date.now(); const requestOptions = octokit.request.endpoint.parse(options); const path2 = requestOptions.url.replace(options.baseUrl, ""); return request22(options).then((response) => { const requestId = response.headers["x-github-request-id"]; octokit.log.info( `${requestOptions.method} ${path2} - ${response.status} with id ${requestId} in ${Date.now() - start}ms` ); return response; }).catch((error2) => { const requestId = error2.response?.headers["x-github-request-id"] || "UNKNOWN"; octokit.log.error( `${requestOptions.method} ${path2} - ${error2.status} with id ${requestId} in ${Date.now() - start}ms` ); throw error2; }); }); } requestLog.VERSION = VERSION52; var VERSION62 = "0.0.0-development"; function normalizePaginatedListResponse2(response) { if (!response.data) { return { ...response, data: [] }; } const responseNeedsNormalization = ("total_count" in response.data || "total_commits" in response.data) && !("url" in response.data); if (!responseNeedsNormalization) return response; const incompleteResults = response.data.incomplete_results; const repositorySelection = response.data.repository_selection; const totalCount = response.data.total_count; const totalCommits = response.data.total_commits; delete response.data.incomplete_results; delete response.data.repository_selection; delete response.data.total_count; delete response.data.total_commits; const namespaceKey = Object.keys(response.data)[0]; const data = response.data[namespaceKey]; response.data = data; if (typeof incompleteResults !== "undefined") { response.data.incomplete_results = incompleteResults; } if (typeof repositorySelection !== "undefined") { response.data.repository_selection = repositorySelection; } response.data.total_count = totalCount; response.data.total_commits = totalCommits; return response; } function iterator2(octokit, route, parameters) { const options = typeof route === "function" ? route.endpoint(parameters) : octokit.request.endpoint(route, parameters); const requestMethod = typeof route === "function" ? route : octokit.request; const method = options.method; const headers = options.headers; let url = options.url; return { [Symbol.asyncIterator]: () => ({ async next() { if (!url) return { done: true }; try { const response = await requestMethod({ method, url, headers }); const normalizedResponse = normalizePaginatedListResponse2(response); url = ((normalizedResponse.headers.link || "").match( /<([^<>]+)>;\s*rel="next"/ ) || [])[1]; if (!url && "total_commits" in normalizedResponse.data) { const parsedUrl = new URL(normalizedResponse.url); const params2 = parsedUrl.searchParams; const page = parseInt(params2.get("page") || "1", 10); const per_page = parseInt(params2.get("per_page") || "250", 10); if (page * per_page < normalizedResponse.data.total_commits) { params2.set("page", String(page + 1)); url = parsedUrl.toString(); } } return { value: normalizedResponse }; } catch (error2) { if (error2.status !== 409) throw error2; url = ""; return { value: { status: 200, headers: {}, data: [] } }; } } }) }; } function paginate2(octokit, route, parameters, mapFn) { if (typeof parameters === "function") { mapFn = parameters; parameters = void 0; } return gather2( octokit, [], iterator2(octokit, route, parameters)[Symbol.asyncIterator](), mapFn ); } function gather2(octokit, results, iterator22, mapFn) { return iterator22.next().then((result) => { if (result.done) { return results; } let earlyExit = false; function done() { earlyExit = true; } results = results.concat( mapFn ? mapFn(result.value, done) : result.value.data ); if (earlyExit) { return results; } return gather2(octokit, results, iterator22, mapFn); }); } var composePaginateRest2 = Object.assign(paginate2, { iterator: iterator2 }); function paginateRest2(octokit) { return { paginate: Object.assign(paginate2.bind(null, octokit), { iterator: iterator2.bind(null, octokit) }) }; } paginateRest2.VERSION = VERSION62; var VERSION72 = "17.0.0"; var Endpoints2 = { actions: { addCustomLabelsToSelfHostedRunnerForOrg: [ "POST /orgs/{org}/actions/runners/{runner_id}/labels" ], addCustomLabelsToSelfHostedRunnerForRepo: [ "POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels" ], addRepoAccessToSelfHostedRunnerGroupInOrg: [ "PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}" ], addSelectedRepoToOrgSecret: [ "PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}" ], addSelectedRepoToOrgVariable: [ "PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}" ], approveWorkflowRun: [ "POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve" ], cancelWorkflowRun: [ "POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel" ], createEnvironmentVariable: [ "POST /repos/{owner}/{repo}/environments/{environment_name}/variables" ], createHostedRunnerForOrg: ["POST /orgs/{org}/actions/hosted-runners"], createOrUpdateEnvironmentSecret: [ "PUT /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}" ], createOrUpdateOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}"], createOrUpdateRepoSecret: [ "PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}" ], createOrgVariable: ["POST /orgs/{org}/actions/variables"], createRegistrationTokenForOrg: [ "POST /orgs/{org}/actions/runners/registration-token" ], createRegistrationTokenForRepo: [ "POST /repos/{owner}/{repo}/actions/runners/registration-token" ], createRemoveTokenForOrg: ["POST /orgs/{org}/actions/runners/remove-token"], createRemoveTokenForRepo: [ "POST /repos/{owner}/{repo}/actions/runners/remove-token" ], createRepoVariable: ["POST /repos/{owner}/{repo}/actions/variables"], createWorkflowDispatch: [ "POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches" ], deleteActionsCacheById: [ "DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}" ], deleteActionsCacheByKey: [ "DELETE /repos/{owner}/{repo}/actions/caches{?key,ref}" ], deleteArtifact: [ "DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}" ], deleteCustomImageFromOrg: [ "DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}" ], deleteCustomImageVersionFromOrg: [ "DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}" ], deleteEnvironmentSecret: [ "DELETE /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}" ], deleteEnvironmentVariable: [ "DELETE /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}" ], deleteHostedRunnerForOrg: [ "DELETE /orgs/{org}/actions/hosted-runners/{hosted_runner_id}" ], deleteOrgSecret: ["DELETE /orgs/{org}/actions/secrets/{secret_name}"], deleteOrgVariable: ["DELETE /orgs/{org}/actions/variables/{name}"], deleteRepoSecret: [ "DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}" ], deleteRepoVariable: [ "DELETE /repos/{owner}/{repo}/actions/variables/{name}" ], deleteSelfHostedRunnerFromOrg: [ "DELETE /orgs/{org}/actions/runners/{runner_id}" ], deleteSelfHostedRunnerFromRepo: [ "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}" ], deleteWorkflowRun: ["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}"], deleteWorkflowRunLogs: [ "DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs" ], disableSelectedRepositoryGithubActionsOrganization: [ "DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}" ], disableWorkflow: [ "PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable" ], downloadArtifact: [ "GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}" ], downloadJobLogsForWorkflowRun: [ "GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs" ], downloadWorkflowRunAttemptLogs: [ "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs" ], downloadWorkflowRunLogs: [ "GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs" ], enableSelectedRepositoryGithubActionsOrganization: [ "PUT /orgs/{org}/actions/permissions/repositories/{repository_id}" ], enableWorkflow: [ "PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable" ], forceCancelWorkflowRun: [ "POST /repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel" ], generateRunnerJitconfigForOrg: [ "POST /orgs/{org}/actions/runners/generate-jitconfig" ], generateRunnerJitconfigForRepo: [ "POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig" ], getActionsCacheList: ["GET /repos/{owner}/{repo}/actions/caches"], getActionsCacheUsage: ["GET /repos/{owner}/{repo}/actions/cache/usage"], getActionsCacheUsageByRepoForOrg: [ "GET /orgs/{org}/actions/cache/usage-by-repository" ], getActionsCacheUsageForOrg: ["GET /orgs/{org}/actions/cache/usage"], getAllowedActionsOrganization: [ "GET /orgs/{org}/actions/permissions/selected-actions" ], getAllowedActionsRepository: [ "GET /repos/{owner}/{repo}/actions/permissions/selected-actions" ], getArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"], getCustomImageForOrg: [ "GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}" ], getCustomImageVersionForOrg: [ "GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}" ], getCustomOidcSubClaimForRepo: [ "GET /repos/{owner}/{repo}/actions/oidc/customization/sub" ], getEnvironmentPublicKey: [ "GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/public-key" ], getEnvironmentSecret: [ "GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}" ], getEnvironmentVariable: [ "GET /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}" ], getGithubActionsDefaultWorkflowPermissionsOrganization: [ "GET /orgs/{org}/actions/permissions/workflow" ], getGithubActionsDefaultWorkflowPermissionsRepository: [ "GET /repos/{owner}/{repo}/actions/permissions/workflow" ], getGithubActionsPermissionsOrganization: [ "GET /orgs/{org}/actions/permissions" ], getGithubActionsPermissionsRepository: [ "GET /repos/{owner}/{repo}/actions/permissions" ], getHostedRunnerForOrg: [ "GET /orgs/{org}/actions/hosted-runners/{hosted_runner_id}" ], getHostedRunnersGithubOwnedImagesForOrg: [ "GET /orgs/{org}/actions/hosted-runners/images/github-owned" ], getHostedRunnersLimitsForOrg: [ "GET /orgs/{org}/actions/hosted-runners/limits" ], getHostedRunnersMachineSpecsForOrg: [ "GET /orgs/{org}/actions/hosted-runners/machine-sizes" ], getHostedRunnersPartnerImagesForOrg: [ "GET /orgs/{org}/actions/hosted-runners/images/partner" ], getHostedRunnersPlatformsForOrg: [ "GET /orgs/{org}/actions/hosted-runners/platforms" ], getJobForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"], getOrgPublicKey: ["GET /orgs/{org}/actions/secrets/public-key"], getOrgSecret: ["GET /orgs/{org}/actions/secrets/{secret_name}"], getOrgVariable: ["GET /orgs/{org}/actions/variables/{name}"], getPendingDeploymentsForRun: [ "GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments" ], getRepoPermissions: [ "GET /repos/{owner}/{repo}/actions/permissions", {}, { renamed: ["actions", "getGithubActionsPermissionsRepository"] } ], getRepoPublicKey: ["GET /repos/{owner}/{repo}/actions/secrets/public-key"], getRepoSecret: ["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"], getRepoVariable: ["GET /repos/{owner}/{repo}/actions/variables/{name}"], getReviewsForRun: [ "GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals" ], getSelfHostedRunnerForOrg: ["GET /orgs/{org}/actions/runners/{runner_id}"], getSelfHostedRunnerForRepo: [ "GET /repos/{owner}/{repo}/actions/runners/{runner_id}" ], getWorkflow: ["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"], getWorkflowAccessToRepository: [ "GET /repos/{owner}/{repo}/actions/permissions/access" ], getWorkflowRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}"], getWorkflowRunAttempt: [ "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}" ], getWorkflowRunUsage: [ "GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing" ], getWorkflowUsage: [ "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing" ], listArtifactsForRepo: ["GET /repos/{owner}/{repo}/actions/artifacts"], listCustomImageVersionsForOrg: [ "GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions" ], listCustomImagesForOrg: [ "GET /orgs/{org}/actions/hosted-runners/images/custom" ], listEnvironmentSecrets: [ "GET /repos/{owner}/{repo}/environments/{environment_name}/secrets" ], listEnvironmentVariables: [ "GET /repos/{owner}/{repo}/environments/{environment_name}/variables" ], listGithubHostedRunnersInGroupForOrg: [ "GET /orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners" ], listHostedRunnersForOrg: ["GET /orgs/{org}/actions/hosted-runners"], listJobsForWorkflowRun: [ "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs" ], listJobsForWorkflowRunAttempt: [ "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs" ], listLabelsForSelfHostedRunnerForOrg: [ "GET /orgs/{org}/actions/runners/{runner_id}/labels" ], listLabelsForSelfHostedRunnerForRepo: [ "GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels" ], listOrgSecrets: ["GET /orgs/{org}/actions/secrets"], listOrgVariables: ["GET /orgs/{org}/actions/variables"], listRepoOrganizationSecrets: [ "GET /repos/{owner}/{repo}/actions/organization-secrets" ], listRepoOrganizationVariables: [ "GET /repos/{owner}/{repo}/actions/organization-variables" ], listRepoSecrets: ["GET /repos/{owner}/{repo}/actions/secrets"], listRepoVariables: ["GET /repos/{owner}/{repo}/actions/variables"], listRepoWorkflows: ["GET /repos/{owner}/{repo}/actions/workflows"], listRunnerApplicationsForOrg: ["GET /orgs/{org}/actions/runners/downloads"], listRunnerApplicationsForRepo: [ "GET /repos/{owner}/{repo}/actions/runners/downloads" ], listSelectedReposForOrgSecret: [ "GET /orgs/{org}/actions/secrets/{secret_name}/repositories" ], listSelectedReposForOrgVariable: [ "GET /orgs/{org}/actions/variables/{name}/repositories" ], listSelectedRepositoriesEnabledGithubActionsOrganization: [ "GET /orgs/{org}/actions/permissions/repositories" ], listSelfHostedRunnersForOrg: ["GET /orgs/{org}/actions/runners"], listSelfHostedRunnersForRepo: ["GET /repos/{owner}/{repo}/actions/runners"], listWorkflowRunArtifacts: [ "GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts" ], listWorkflowRuns: [ "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs" ], listWorkflowRunsForRepo: ["GET /repos/{owner}/{repo}/actions/runs"], reRunJobForWorkflowRun: [ "POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun" ], reRunWorkflow: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun"], reRunWorkflowFailedJobs: [ "POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs" ], removeAllCustomLabelsFromSelfHostedRunnerForOrg: [ "DELETE /orgs/{org}/actions/runners/{runner_id}/labels" ], removeAllCustomLabelsFromSelfHostedRunnerForRepo: [ "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels" ], removeCustomLabelFromSelfHostedRunnerForOrg: [ "DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}" ], removeCustomLabelFromSelfHostedRunnerForRepo: [ "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}" ], removeSelectedRepoFromOrgSecret: [ "DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}" ], removeSelectedRepoFromOrgVariable: [ "DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}" ], reviewCustomGatesForRun: [ "POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule" ], reviewPendingDeploymentsForRun: [ "POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments" ], setAllowedActionsOrganization: [ "PUT /orgs/{org}/actions/permissions/selected-actions" ], setAllowedActionsRepository: [ "PUT /repos/{owner}/{repo}/actions/permissions/selected-actions" ], setCustomLabelsForSelfHostedRunnerForOrg: [ "PUT /orgs/{org}/actions/runners/{runner_id}/labels" ], setCustomLabelsForSelfHostedRunnerForRepo: [ "PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels" ], setCustomOidcSubClaimForRepo: [ "PUT /repos/{owner}/{repo}/actions/oidc/customization/sub" ], setGithubActionsDefaultWorkflowPermissionsOrganization: [ "PUT /orgs/{org}/actions/permissions/workflow" ], setGithubActionsDefaultWorkflowPermissionsRepository: [ "PUT /repos/{owner}/{repo}/actions/permissions/workflow" ], setGithubActionsPermissionsOrganization: [ "PUT /orgs/{org}/actions/permissions" ], setGithubActionsPermissionsRepository: [ "PUT /repos/{owner}/{repo}/actions/permissions" ], setSelectedReposForOrgSecret: [ "PUT /orgs/{org}/actions/secrets/{secret_name}/repositories" ], setSelectedReposForOrgVariable: [ "PUT /orgs/{org}/actions/variables/{name}/repositories" ], setSelectedRepositoriesEnabledGithubActionsOrganization: [ "PUT /orgs/{org}/actions/permissions/repositories" ], setWorkflowAccessToRepository: [ "PUT /repos/{owner}/{repo}/actions/permissions/access" ], updateEnvironmentVariable: [ "PATCH /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}" ], updateHostedRunnerForOrg: [ "PATCH /orgs/{org}/actions/hosted-runners/{hosted_runner_id}" ], updateOrgVariable: ["PATCH /orgs/{org}/actions/variables/{name}"], updateRepoVariable: [ "PATCH /repos/{owner}/{repo}/actions/variables/{name}" ] }, activity: { checkRepoIsStarredByAuthenticatedUser: ["GET /user/starred/{owner}/{repo}"], deleteRepoSubscription: ["DELETE /repos/{owner}/{repo}/subscription"], deleteThreadSubscription: [ "DELETE /notifications/threads/{thread_id}/subscription" ], getFeeds: ["GET /feeds"], getRepoSubscription: ["GET /repos/{owner}/{repo}/subscription"], getThread: ["GET /notifications/threads/{thread_id}"], getThreadSubscriptionForAuthenticatedUser: [ "GET /notifications/threads/{thread_id}/subscription" ], listEventsForAuthenticatedUser: ["GET /users/{username}/events"], listNotificationsForAuthenticatedUser: ["GET /notifications"], listOrgEventsForAuthenticatedUser: [ "GET /users/{username}/events/orgs/{org}" ], listPublicEvents: ["GET /events"], listPublicEventsForRepoNetwork: ["GET /networks/{owner}/{repo}/events"], listPublicEventsForUser: ["GET /users/{username}/events/public"], listPublicOrgEvents: ["GET /orgs/{org}/events"], listReceivedEventsForUser: ["GET /users/{username}/received_events"], listReceivedPublicEventsForUser: [ "GET /users/{username}/received_events/public" ], listRepoEvents: ["GET /repos/{owner}/{repo}/events"], listRepoNotificationsForAuthenticatedUser: [ "GET /repos/{owner}/{repo}/notifications" ], listReposStarredByAuthenticatedUser: ["GET /user/starred"], listReposStarredByUser: ["GET /users/{username}/starred"], listReposWatchedByUser: ["GET /users/{username}/subscriptions"], listStargazersForRepo: ["GET /repos/{owner}/{repo}/stargazers"], listWatchedReposForAuthenticatedUser: ["GET /user/subscriptions"], listWatchersForRepo: ["GET /repos/{owner}/{repo}/subscribers"], markNotificationsAsRead: ["PUT /notifications"], markRepoNotificationsAsRead: ["PUT /repos/{owner}/{repo}/notifications"], markThreadAsDone: ["DELETE /notifications/threads/{thread_id}"], markThreadAsRead: ["PATCH /notifications/threads/{thread_id}"], setRepoSubscription: ["PUT /repos/{owner}/{repo}/subscription"], setThreadSubscription: [ "PUT /notifications/threads/{thread_id}/subscription" ], starRepoForAuthenticatedUser: ["PUT /user/starred/{owner}/{repo}"], unstarRepoForAuthenticatedUser: ["DELETE /user/starred/{owner}/{repo}"] }, apps: { addRepoToInstallation: [ "PUT /user/installations/{installation_id}/repositories/{repository_id}", {}, { renamed: ["apps", "addRepoToInstallationForAuthenticatedUser"] } ], addRepoToInstallationForAuthenticatedUser: [ "PUT /user/installations/{installation_id}/repositories/{repository_id}" ], checkToken: ["POST /applications/{client_id}/token"], createFromManifest: ["POST /app-manifests/{code}/conversions"], createInstallationAccessToken: [ "POST /app/installations/{installation_id}/access_tokens" ], deleteAuthorization: ["DELETE /applications/{client_id}/grant"], deleteInstallation: ["DELETE /app/installations/{installation_id}"], deleteToken: ["DELETE /applications/{client_id}/token"], getAuthenticated: ["GET /app"], getBySlug: ["GET /apps/{app_slug}"], getInstallation: ["GET /app/installations/{installation_id}"], getOrgInstallation: ["GET /orgs/{org}/installation"], getRepoInstallation: ["GET /repos/{owner}/{repo}/installation"], getSubscriptionPlanForAccount: [ "GET /marketplace_listing/accounts/{account_id}" ], getSubscriptionPlanForAccountStubbed: [ "GET /marketplace_listing/stubbed/accounts/{account_id}" ], getUserInstallation: ["GET /users/{username}/installation"], getWebhookConfigForApp: ["GET /app/hook/config"], getWebhookDelivery: ["GET /app/hook/deliveries/{delivery_id}"], listAccountsForPlan: ["GET /marketplace_listing/plans/{plan_id}/accounts"], listAccountsForPlanStubbed: [ "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts" ], listInstallationReposForAuthenticatedUser: [ "GET /user/installations/{installation_id}/repositories" ], listInstallationRequestsForAuthenticatedApp: [ "GET /app/installation-requests" ], listInstallations: ["GET /app/installations"], listInstallationsForAuthenticatedUser: ["GET /user/installations"], listPlans: ["GET /marketplace_listing/plans"], listPlansStubbed: ["GET /marketplace_listing/stubbed/plans"], listReposAccessibleToInstallation: ["GET /installation/repositories"], listSubscriptionsForAuthenticatedUser: ["GET /user/marketplace_purchases"], listSubscriptionsForAuthenticatedUserStubbed: [ "GET /user/marketplace_purchases/stubbed" ], listWebhookDeliveries: ["GET /app/hook/deliveries"], redeliverWebhookDelivery: [ "POST /app/hook/deliveries/{delivery_id}/attempts" ], removeRepoFromInstallation: [ "DELETE /user/installations/{installation_id}/repositories/{repository_id}", {}, { renamed: ["apps", "removeRepoFromInstallationForAuthenticatedUser"] } ], removeRepoFromInstallationForAuthenticatedUser: [ "DELETE /user/installations/{installation_id}/repositories/{repository_id}" ], resetToken: ["PATCH /applications/{client_id}/token"], revokeInstallationAccessToken: ["DELETE /installation/token"], scopeToken: ["POST /applications/{client_id}/token/scoped"], suspendInstallation: ["PUT /app/installations/{installation_id}/suspended"], unsuspendInstallation: [ "DELETE /app/installations/{installation_id}/suspended" ], updateWebhookConfigForApp: ["PATCH /app/hook/config"] }, billing: { getGithubActionsBillingOrg: ["GET /orgs/{org}/settings/billing/actions"], getGithubActionsBillingUser: [ "GET /users/{username}/settings/billing/actions" ], getGithubBillingPremiumRequestUsageReportOrg: [ "GET /organizations/{org}/settings/billing/premium_request/usage" ], getGithubBillingPremiumRequestUsageReportUser: [ "GET /users/{username}/settings/billing/premium_request/usage" ], getGithubBillingUsageReportOrg: [ "GET /organizations/{org}/settings/billing/usage" ], getGithubBillingUsageReportUser: [ "GET /users/{username}/settings/billing/usage" ], getGithubPackagesBillingOrg: ["GET /orgs/{org}/settings/billing/packages"], getGithubPackagesBillingUser: [ "GET /users/{username}/settings/billing/packages" ], getSharedStorageBillingOrg: [ "GET /orgs/{org}/settings/billing/shared-storage" ], getSharedStorageBillingUser: [ "GET /users/{username}/settings/billing/shared-storage" ] }, campaigns: { createCampaign: ["POST /orgs/{org}/campaigns"], deleteCampaign: ["DELETE /orgs/{org}/campaigns/{campaign_number}"], getCampaignSummary: ["GET /orgs/{org}/campaigns/{campaign_number}"], listOrgCampaigns: ["GET /orgs/{org}/campaigns"], updateCampaign: ["PATCH /orgs/{org}/campaigns/{campaign_number}"] }, checks: { create: ["POST /repos/{owner}/{repo}/check-runs"], createSuite: ["POST /repos/{owner}/{repo}/check-suites"], get: ["GET /repos/{owner}/{repo}/check-runs/{check_run_id}"], getSuite: ["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}"], listAnnotations: [ "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations" ], listForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-runs"], listForSuite: [ "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs" ], listSuitesForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-suites"], rerequestRun: [ "POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest" ], rerequestSuite: [ "POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest" ], setSuitesPreferences: [ "PATCH /repos/{owner}/{repo}/check-suites/preferences" ], update: ["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}"] }, codeScanning: { commitAutofix: [ "POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/commits" ], createAutofix: [ "POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix" ], createVariantAnalysis: [ "POST /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses" ], deleteAnalysis: [ "DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}" ], deleteCodeqlDatabase: [ "DELETE /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}" ], getAlert: [ "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}", {}, { renamedParameters: { alert_id: "alert_number" } } ], getAnalysis: [ "GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}" ], getAutofix: [ "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix" ], getCodeqlDatabase: [ "GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}" ], getDefaultSetup: ["GET /repos/{owner}/{repo}/code-scanning/default-setup"], getSarif: ["GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}"], getVariantAnalysis: [ "GET /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id}" ], getVariantAnalysisRepoTask: [ "GET /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id}/repos/{repo_owner}/{repo_name}" ], listAlertInstances: [ "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances" ], listAlertsForOrg: ["GET /orgs/{org}/code-scanning/alerts"], listAlertsForRepo: ["GET /repos/{owner}/{repo}/code-scanning/alerts"], listAlertsInstances: [ "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances", {}, { renamed: ["codeScanning", "listAlertInstances"] } ], listCodeqlDatabases: [ "GET /repos/{owner}/{repo}/code-scanning/codeql/databases" ], listRecentAnalyses: ["GET /repos/{owner}/{repo}/code-scanning/analyses"], updateAlert: [ "PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}" ], updateDefaultSetup: [ "PATCH /repos/{owner}/{repo}/code-scanning/default-setup" ], uploadSarif: ["POST /repos/{owner}/{repo}/code-scanning/sarifs"] }, codeSecurity: { attachConfiguration: [ "POST /orgs/{org}/code-security/configurations/{configuration_id}/attach" ], attachEnterpriseConfiguration: [ "POST /enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach" ], createConfiguration: ["POST /orgs/{org}/code-security/configurations"], createConfigurationForEnterprise: [ "POST /enterprises/{enterprise}/code-security/configurations" ], deleteConfiguration: [ "DELETE /orgs/{org}/code-security/configurations/{configuration_id}" ], deleteConfigurationForEnterprise: [ "DELETE /enterprises/{enterprise}/code-security/configurations/{configuration_id}" ], detachConfiguration: [ "DELETE /orgs/{org}/code-security/configurations/detach" ], getConfiguration: [ "GET /orgs/{org}/code-security/configurations/{configuration_id}" ], getConfigurationForRepository: [ "GET /repos/{owner}/{repo}/code-security-configuration" ], getConfigurationsForEnterprise: [ "GET /enterprises/{enterprise}/code-security/configurations" ], getConfigurationsForOrg: ["GET /orgs/{org}/code-security/configurations"], getDefaultConfigurations: [ "GET /orgs/{org}/code-security/configurations/defaults" ], getDefaultConfigurationsForEnterprise: [ "GET /enterprises/{enterprise}/code-security/configurations/defaults" ], getRepositoriesForConfiguration: [ "GET /orgs/{org}/code-security/configurations/{configuration_id}/repositories" ], getRepositoriesForEnterpriseConfiguration: [ "GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories" ], getSingleConfigurationForEnterprise: [ "GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}" ], setConfigurationAsDefault: [ "PUT /orgs/{org}/code-security/configurations/{configuration_id}/defaults" ], setConfigurationAsDefaultForEnterprise: [ "PUT /enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults" ], updateConfiguration: [ "PATCH /orgs/{org}/code-security/configurations/{configuration_id}" ], updateEnterpriseConfiguration: [ "PATCH /enterprises/{enterprise}/code-security/configurations/{configuration_id}" ] }, codesOfConduct: { getAllCodesOfConduct: ["GET /codes_of_conduct"], getConductCode: ["GET /codes_of_conduct/{key}"] }, codespaces: { addRepositoryForSecretForAuthenticatedUser: [ "PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id}" ], addSelectedRepoToOrgSecret: [ "PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}" ], checkPermissionsForDevcontainer: [ "GET /repos/{owner}/{repo}/codespaces/permissions_check" ], codespaceMachinesForAuthenticatedUser: [ "GET /user/codespaces/{codespace_name}/machines" ], createForAuthenticatedUser: ["POST /user/codespaces"], createOrUpdateOrgSecret: [ "PUT /orgs/{org}/codespaces/secrets/{secret_name}" ], createOrUpdateRepoSecret: [ "PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}" ], createOrUpdateSecretForAuthenticatedUser: [ "PUT /user/codespaces/secrets/{secret_name}" ], createWithPrForAuthenticatedUser: [ "POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces" ], createWithRepoForAuthenticatedUser: [ "POST /repos/{owner}/{repo}/codespaces" ], deleteForAuthenticatedUser: ["DELETE /user/codespaces/{codespace_name}"], deleteFromOrganization: [ "DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}" ], deleteOrgSecret: ["DELETE /orgs/{org}/codespaces/secrets/{secret_name}"], deleteRepoSecret: [ "DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}" ], deleteSecretForAuthenticatedUser: [ "DELETE /user/codespaces/secrets/{secret_name}" ], exportForAuthenticatedUser: [ "POST /user/codespaces/{codespace_name}/exports" ], getCodespacesForUserInOrg: [ "GET /orgs/{org}/members/{username}/codespaces" ], getExportDetailsForAuthenticatedUser: [ "GET /user/codespaces/{codespace_name}/exports/{export_id}" ], getForAuthenticatedUser: ["GET /user/codespaces/{codespace_name}"], getOrgPublicKey: ["GET /orgs/{org}/codespaces/secrets/public-key"], getOrgSecret: ["GET /orgs/{org}/codespaces/secrets/{secret_name}"], getPublicKeyForAuthenticatedUser: [ "GET /user/codespaces/secrets/public-key" ], getRepoPublicKey: [ "GET /repos/{owner}/{repo}/codespaces/secrets/public-key" ], getRepoSecret: [ "GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name}" ], getSecretForAuthenticatedUser: [ "GET /user/codespaces/secrets/{secret_name}" ], listDevcontainersInRepositoryForAuthenticatedUser: [ "GET /repos/{owner}/{repo}/codespaces/devcontainers" ], listForAuthenticatedUser: ["GET /user/codespaces"], listInOrganization: [ "GET /orgs/{org}/codespaces", {}, { renamedParameters: { org_id: "org" } } ], listInRepositoryForAuthenticatedUser: [ "GET /repos/{owner}/{repo}/codespaces" ], listOrgSecrets: ["GET /orgs/{org}/codespaces/secrets"], listRepoSecrets: ["GET /repos/{owner}/{repo}/codespaces/secrets"], listRepositoriesForSecretForAuthenticatedUser: [ "GET /user/codespaces/secrets/{secret_name}/repositories" ], listSecretsForAuthenticatedUser: ["GET /user/codespaces/secrets"], listSelectedReposForOrgSecret: [ "GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories" ], preFlightWithRepoForAuthenticatedUser: [ "GET /repos/{owner}/{repo}/codespaces/new" ], publishForAuthenticatedUser: [ "POST /user/codespaces/{codespace_name}/publish" ], removeRepositoryForSecretForAuthenticatedUser: [ "DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id}" ], removeSelectedRepoFromOrgSecret: [ "DELETE /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}" ], repoMachinesForAuthenticatedUser: [ "GET /repos/{owner}/{repo}/codespaces/machines" ], setRepositoriesForSecretForAuthenticatedUser: [ "PUT /user/codespaces/secrets/{secret_name}/repositories" ], setSelectedReposForOrgSecret: [ "PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories" ], startForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/start"], stopForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/stop"], stopInOrganization: [ "POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop" ], updateForAuthenticatedUser: ["PATCH /user/codespaces/{codespace_name}"] }, copilot: { addCopilotSeatsForTeams: [ "POST /orgs/{org}/copilot/billing/selected_teams" ], addCopilotSeatsForUsers: [ "POST /orgs/{org}/copilot/billing/selected_users" ], cancelCopilotSeatAssignmentForTeams: [ "DELETE /orgs/{org}/copilot/billing/selected_teams" ], cancelCopilotSeatAssignmentForUsers: [ "DELETE /orgs/{org}/copilot/billing/selected_users" ], copilotMetricsForOrganization: ["GET /orgs/{org}/copilot/metrics"], copilotMetricsForTeam: ["GET /orgs/{org}/team/{team_slug}/copilot/metrics"], getCopilotOrganizationDetails: ["GET /orgs/{org}/copilot/billing"], getCopilotSeatDetailsForUser: [ "GET /orgs/{org}/members/{username}/copilot" ], listCopilotSeats: ["GET /orgs/{org}/copilot/billing/seats"] }, credentials: { revoke: ["POST /credentials/revoke"] }, dependabot: { addSelectedRepoToOrgSecret: [ "PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}" ], createOrUpdateOrgSecret: [ "PUT /orgs/{org}/dependabot/secrets/{secret_name}" ], createOrUpdateRepoSecret: [ "PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name}" ], deleteOrgSecret: ["DELETE /orgs/{org}/dependabot/secrets/{secret_name}"], deleteRepoSecret: [ "DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name}" ], getAlert: ["GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"], getOrgPublicKey: ["GET /orgs/{org}/dependabot/secrets/public-key"], getOrgSecret: ["GET /orgs/{org}/dependabot/secrets/{secret_name}"], getRepoPublicKey: [ "GET /repos/{owner}/{repo}/dependabot/secrets/public-key" ], getRepoSecret: [ "GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name}" ], listAlertsForEnterprise: [ "GET /enterprises/{enterprise}/dependabot/alerts" ], listAlertsForOrg: ["GET /orgs/{org}/dependabot/alerts"], listAlertsForRepo: ["GET /repos/{owner}/{repo}/dependabot/alerts"], listOrgSecrets: ["GET /orgs/{org}/dependabot/secrets"], listRepoSecrets: ["GET /repos/{owner}/{repo}/dependabot/secrets"], listSelectedReposForOrgSecret: [ "GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories" ], removeSelectedRepoFromOrgSecret: [ "DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}" ], repositoryAccessForOrg: [ "GET /organizations/{org}/dependabot/repository-access" ], setRepositoryAccessDefaultLevel: [ "PUT /organizations/{org}/dependabot/repository-access/default-level" ], setSelectedReposForOrgSecret: [ "PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories" ], updateAlert: [ "PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}" ], updateRepositoryAccessForOrg: [ "PATCH /organizations/{org}/dependabot/repository-access" ] }, dependencyGraph: { createRepositorySnapshot: [ "POST /repos/{owner}/{repo}/dependency-graph/snapshots" ], diffRange: [ "GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}" ], exportSbom: ["GET /repos/{owner}/{repo}/dependency-graph/sbom"] }, emojis: { get: ["GET /emojis"] }, enterpriseTeamMemberships: { add: [ "PUT /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}" ], bulkAdd: [ "POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/add" ], bulkRemove: [ "POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove" ], get: [ "GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}" ], list: ["GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships"], remove: [ "DELETE /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}" ] }, enterpriseTeamOrganizations: { add: [ "PUT /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}" ], bulkAdd: [ "POST /enterprises/{enterprise}/teams/{enterprise-team}/organizations/add" ], bulkRemove: [ "POST /enterprises/{enterprise}/teams/{enterprise-team}/organizations/remove" ], delete: [ "DELETE /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}" ], getAssignment: [ "GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}" ], getAssignments: [ "GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations" ] }, enterpriseTeams: { create: ["POST /enterprises/{enterprise}/teams"], delete: ["DELETE /enterprises/{enterprise}/teams/{team_slug}"], get: ["GET /enterprises/{enterprise}/teams/{team_slug}"], list: ["GET /enterprises/{enterprise}/teams"], update: ["PATCH /enterprises/{enterprise}/teams/{team_slug}"] }, gists: { checkIsStarred: ["GET /gists/{gist_id}/star"], create: ["POST /gists"], createComment: ["POST /gists/{gist_id}/comments"], delete: ["DELETE /gists/{gist_id}"], deleteComment: ["DELETE /gists/{gist_id}/comments/{comment_id}"], fork: ["POST /gists/{gist_id}/forks"], get: ["GET /gists/{gist_id}"], getComment: ["GET /gists/{gist_id}/comments/{comment_id}"], getRevision: ["GET /gists/{gist_id}/{sha}"], list: ["GET /gists"], listComments: ["GET /gists/{gist_id}/comments"], listCommits: ["GET /gists/{gist_id}/commits"], listForUser: ["GET /users/{username}/gists"], listForks: ["GET /gists/{gist_id}/forks"], listPublic: ["GET /gists/public"], listStarred: ["GET /gists/starred"], star: ["PUT /gists/{gist_id}/star"], unstar: ["DELETE /gists/{gist_id}/star"], update: ["PATCH /gists/{gist_id}"], updateComment: ["PATCH /gists/{gist_id}/comments/{comment_id}"] }, git: { createBlob: ["POST /repos/{owner}/{repo}/git/blobs"], createCommit: ["POST /repos/{owner}/{repo}/git/commits"], createRef: ["POST /repos/{owner}/{repo}/git/refs"], createTag: ["POST /repos/{owner}/{repo}/git/tags"], createTree: ["POST /repos/{owner}/{repo}/git/trees"], deleteRef: ["DELETE /repos/{owner}/{repo}/git/refs/{ref}"], getBlob: ["GET /repos/{owner}/{repo}/git/blobs/{file_sha}"], getCommit: ["GET /repos/{owner}/{repo}/git/commits/{commit_sha}"], getRef: ["GET /repos/{owner}/{repo}/git/ref/{ref}"], getTag: ["GET /repos/{owner}/{repo}/git/tags/{tag_sha}"], getTree: ["GET /repos/{owner}/{repo}/git/trees/{tree_sha}"], listMatchingRefs: ["GET /repos/{owner}/{repo}/git/matching-refs/{ref}"], updateRef: ["PATCH /repos/{owner}/{repo}/git/refs/{ref}"] }, gitignore: { getAllTemplates: ["GET /gitignore/templates"], getTemplate: ["GET /gitignore/templates/{name}"] }, hostedCompute: { createNetworkConfigurationForOrg: [ "POST /orgs/{org}/settings/network-configurations" ], deleteNetworkConfigurationFromOrg: [ "DELETE /orgs/{org}/settings/network-configurations/{network_configuration_id}" ], getNetworkConfigurationForOrg: [ "GET /orgs/{org}/settings/network-configurations/{network_configuration_id}" ], getNetworkSettingsForOrg: [ "GET /orgs/{org}/settings/network-settings/{network_settings_id}" ], listNetworkConfigurationsForOrg: [ "GET /orgs/{org}/settings/network-configurations" ], updateNetworkConfigurationForOrg: [ "PATCH /orgs/{org}/settings/network-configurations/{network_configuration_id}" ] }, interactions: { getRestrictionsForAuthenticatedUser: ["GET /user/interaction-limits"], getRestrictionsForOrg: ["GET /orgs/{org}/interaction-limits"], getRestrictionsForRepo: ["GET /repos/{owner}/{repo}/interaction-limits"], getRestrictionsForYourPublicRepos: [ "GET /user/interaction-limits", {}, { renamed: ["interactions", "getRestrictionsForAuthenticatedUser"] } ], removeRestrictionsForAuthenticatedUser: ["DELETE /user/interaction-limits"], removeRestrictionsForOrg: ["DELETE /orgs/{org}/interaction-limits"], removeRestrictionsForRepo: [ "DELETE /repos/{owner}/{repo}/interaction-limits" ], removeRestrictionsForYourPublicRepos: [ "DELETE /user/interaction-limits", {}, { renamed: ["interactions", "removeRestrictionsForAuthenticatedUser"] } ], setRestrictionsForAuthenticatedUser: ["PUT /user/interaction-limits"], setRestrictionsForOrg: ["PUT /orgs/{org}/interaction-limits"], setRestrictionsForRepo: ["PUT /repos/{owner}/{repo}/interaction-limits"], setRestrictionsForYourPublicRepos: [ "PUT /user/interaction-limits", {}, { renamed: ["interactions", "setRestrictionsForAuthenticatedUser"] } ] }, issues: { addAssignees: [ "POST /repos/{owner}/{repo}/issues/{issue_number}/assignees" ], addBlockedByDependency: [ "POST /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by" ], addLabels: ["POST /repos/{owner}/{repo}/issues/{issue_number}/labels"], addSubIssue: [ "POST /repos/{owner}/{repo}/issues/{issue_number}/sub_issues" ], checkUserCanBeAssigned: ["GET /repos/{owner}/{repo}/assignees/{assignee}"], checkUserCanBeAssignedToIssue: [ "GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}" ], create: ["POST /repos/{owner}/{repo}/issues"], createComment: [ "POST /repos/{owner}/{repo}/issues/{issue_number}/comments" ], createLabel: ["POST /repos/{owner}/{repo}/labels"], createMilestone: ["POST /repos/{owner}/{repo}/milestones"], deleteComment: [ "DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}" ], deleteLabel: ["DELETE /repos/{owner}/{repo}/labels/{name}"], deleteMilestone: [ "DELETE /repos/{owner}/{repo}/milestones/{milestone_number}" ], get: ["GET /repos/{owner}/{repo}/issues/{issue_number}"], getComment: ["GET /repos/{owner}/{repo}/issues/comments/{comment_id}"], getEvent: ["GET /repos/{owner}/{repo}/issues/events/{event_id}"], getLabel: ["GET /repos/{owner}/{repo}/labels/{name}"], getMilestone: ["GET /repos/{owner}/{repo}/milestones/{milestone_number}"], getParent: ["GET /repos/{owner}/{repo}/issues/{issue_number}/parent"], list: ["GET /issues"], listAssignees: ["GET /repos/{owner}/{repo}/assignees"], listComments: ["GET /repos/{owner}/{repo}/issues/{issue_number}/comments"], listCommentsForRepo: ["GET /repos/{owner}/{repo}/issues/comments"], listDependenciesBlockedBy: [ "GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by" ], listDependenciesBlocking: [ "GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking" ], listEvents: ["GET /repos/{owner}/{repo}/issues/{issue_number}/events"], listEventsForRepo: ["GET /repos/{owner}/{repo}/issues/events"], listEventsForTimeline: [ "GET /repos/{owner}/{repo}/issues/{issue_number}/timeline" ], listForAuthenticatedUser: ["GET /user/issues"], listForOrg: ["GET /orgs/{org}/issues"], listForRepo: ["GET /repos/{owner}/{repo}/issues"], listLabelsForMilestone: [ "GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels" ], listLabelsForRepo: ["GET /repos/{owner}/{repo}/labels"], listLabelsOnIssue: [ "GET /repos/{owner}/{repo}/issues/{issue_number}/labels" ], listMilestones: ["GET /repos/{owner}/{repo}/milestones"], listSubIssues: [ "GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues" ], lock: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/lock"], removeAllLabels: [ "DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels" ], removeAssignees: [ "DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees" ], removeDependencyBlockedBy: [ "DELETE /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}" ], removeLabel: [ "DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}" ], removeSubIssue: [ "DELETE /repos/{owner}/{repo}/issues/{issue_number}/sub_issue" ], reprioritizeSubIssue: [ "PATCH /repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority" ], setLabels: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/labels"], unlock: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock"], update: ["PATCH /repos/{owner}/{repo}/issues/{issue_number}"], updateComment: ["PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}"], updateLabel: ["PATCH /repos/{owner}/{repo}/labels/{name}"], updateMilestone: [ "PATCH /repos/{owner}/{repo}/milestones/{milestone_number}" ] }, licenses: { get: ["GET /licenses/{license}"], getAllCommonlyUsed: ["GET /licenses"], getForRepo: ["GET /repos/{owner}/{repo}/license"] }, markdown: { render: ["POST /markdown"], renderRaw: [ "POST /markdown/raw", { headers: { "content-type": "text/plain; charset=utf-8" } } ] }, meta: { get: ["GET /meta"], getAllVersions: ["GET /versions"], getOctocat: ["GET /octocat"], getZen: ["GET /zen"], root: ["GET /"] }, migrations: { deleteArchiveForAuthenticatedUser: [ "DELETE /user/migrations/{migration_id}/archive" ], deleteArchiveForOrg: [ "DELETE /orgs/{org}/migrations/{migration_id}/archive" ], downloadArchiveForOrg: [ "GET /orgs/{org}/migrations/{migration_id}/archive" ], getArchiveForAuthenticatedUser: [ "GET /user/migrations/{migration_id}/archive" ], getStatusForAuthenticatedUser: ["GET /user/migrations/{migration_id}"], getStatusForOrg: ["GET /orgs/{org}/migrations/{migration_id}"], listForAuthenticatedUser: ["GET /user/migrations"], listForOrg: ["GET /orgs/{org}/migrations"], listReposForAuthenticatedUser: [ "GET /user/migrations/{migration_id}/repositories" ], listReposForOrg: ["GET /orgs/{org}/migrations/{migration_id}/repositories"], listReposForUser: [ "GET /user/migrations/{migration_id}/repositories", {}, { renamed: ["migrations", "listReposForAuthenticatedUser"] } ], startForAuthenticatedUser: ["POST /user/migrations"], startForOrg: ["POST /orgs/{org}/migrations"], unlockRepoForAuthenticatedUser: [ "DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock" ], unlockRepoForOrg: [ "DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock" ] }, oidc: { getOidcCustomSubTemplateForOrg: [ "GET /orgs/{org}/actions/oidc/customization/sub" ], updateOidcCustomSubTemplateForOrg: [ "PUT /orgs/{org}/actions/oidc/customization/sub" ] }, orgs: { addSecurityManagerTeam: [ "PUT /orgs/{org}/security-managers/teams/{team_slug}", {}, { deprecated: "octokit.rest.orgs.addSecurityManagerTeam() is deprecated, see https://docs.github.com/rest/orgs/security-managers#add-a-security-manager-team" } ], assignTeamToOrgRole: [ "PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}" ], assignUserToOrgRole: [ "PUT /orgs/{org}/organization-roles/users/{username}/{role_id}" ], blockUser: ["PUT /orgs/{org}/blocks/{username}"], cancelInvitation: ["DELETE /orgs/{org}/invitations/{invitation_id}"], checkBlockedUser: ["GET /orgs/{org}/blocks/{username}"], checkMembershipForUser: ["GET /orgs/{org}/members/{username}"], checkPublicMembershipForUser: ["GET /orgs/{org}/public_members/{username}"], convertMemberToOutsideCollaborator: [ "PUT /orgs/{org}/outside_collaborators/{username}" ], createArtifactStorageRecord: [ "POST /orgs/{org}/artifacts/metadata/storage-record" ], createInvitation: ["POST /orgs/{org}/invitations"], createIssueType: ["POST /orgs/{org}/issue-types"], createWebhook: ["POST /orgs/{org}/hooks"], customPropertiesForOrgsCreateOrUpdateOrganizationValues: [ "PATCH /organizations/{org}/org-properties/values" ], customPropertiesForOrgsGetOrganizationValues: [ "GET /organizations/{org}/org-properties/values" ], customPropertiesForReposCreateOrUpdateOrganizationDefinition: [ "PUT /orgs/{org}/properties/schema/{custom_property_name}" ], customPropertiesForReposCreateOrUpdateOrganizationDefinitions: [ "PATCH /orgs/{org}/properties/schema" ], customPropertiesForReposCreateOrUpdateOrganizationValues: [ "PATCH /orgs/{org}/properties/values" ], customPropertiesForReposDeleteOrganizationDefinition: [ "DELETE /orgs/{org}/properties/schema/{custom_property_name}" ], customPropertiesForReposGetOrganizationDefinition: [ "GET /orgs/{org}/properties/schema/{custom_property_name}" ], customPropertiesForReposGetOrganizationDefinitions: [ "GET /orgs/{org}/properties/schema" ], customPropertiesForReposGetOrganizationValues: [ "GET /orgs/{org}/properties/values" ], delete: ["DELETE /orgs/{org}"], deleteAttestationsBulk: ["POST /orgs/{org}/attestations/delete-request"], deleteAttestationsById: [ "DELETE /orgs/{org}/attestations/{attestation_id}" ], deleteAttestationsBySubjectDigest: [ "DELETE /orgs/{org}/attestations/digest/{subject_digest}" ], deleteIssueType: ["DELETE /orgs/{org}/issue-types/{issue_type_id}"], deleteWebhook: ["DELETE /orgs/{org}/hooks/{hook_id}"], disableSelectedRepositoryImmutableReleasesOrganization: [ "DELETE /orgs/{org}/settings/immutable-releases/repositories/{repository_id}" ], enableSelectedRepositoryImmutableReleasesOrganization: [ "PUT /orgs/{org}/settings/immutable-releases/repositories/{repository_id}" ], get: ["GET /orgs/{org}"], getImmutableReleasesSettings: [ "GET /orgs/{org}/settings/immutable-releases" ], getImmutableReleasesSettingsRepositories: [ "GET /orgs/{org}/settings/immutable-releases/repositories" ], getMembershipForAuthenticatedUser: ["GET /user/memberships/orgs/{org}"], getMembershipForUser: ["GET /orgs/{org}/memberships/{username}"], getOrgRole: ["GET /orgs/{org}/organization-roles/{role_id}"], getOrgRulesetHistory: ["GET /orgs/{org}/rulesets/{ruleset_id}/history"], getOrgRulesetVersion: [ "GET /orgs/{org}/rulesets/{ruleset_id}/history/{version_id}" ], getWebhook: ["GET /orgs/{org}/hooks/{hook_id}"], getWebhookConfigForOrg: ["GET /orgs/{org}/hooks/{hook_id}/config"], getWebhookDelivery: [ "GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}" ], list: ["GET /organizations"], listAppInstallations: ["GET /orgs/{org}/installations"], listArtifactStorageRecords: [ "GET /orgs/{org}/artifacts/{subject_digest}/metadata/storage-records" ], listAttestationRepositories: ["GET /orgs/{org}/attestations/repositories"], listAttestations: ["GET /orgs/{org}/attestations/{subject_digest}"], listAttestationsBulk: [ "POST /orgs/{org}/attestations/bulk-list{?per_page,before,after}" ], listBlockedUsers: ["GET /orgs/{org}/blocks"], listFailedInvitations: ["GET /orgs/{org}/failed_invitations"], listForAuthenticatedUser: ["GET /user/orgs"], listForUser: ["GET /users/{username}/orgs"], listInvitationTeams: ["GET /orgs/{org}/invitations/{invitation_id}/teams"], listIssueTypes: ["GET /orgs/{org}/issue-types"], listMembers: ["GET /orgs/{org}/members"], listMembershipsForAuthenticatedUser: ["GET /user/memberships/orgs"], listOrgRoleTeams: ["GET /orgs/{org}/organization-roles/{role_id}/teams"], listOrgRoleUsers: ["GET /orgs/{org}/organization-roles/{role_id}/users"], listOrgRoles: ["GET /orgs/{org}/organization-roles"], listOrganizationFineGrainedPermissions: [ "GET /orgs/{org}/organization-fine-grained-permissions" ], listOutsideCollaborators: ["GET /orgs/{org}/outside_collaborators"], listPatGrantRepositories: [ "GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories" ], listPatGrantRequestRepositories: [ "GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories" ], listPatGrantRequests: ["GET /orgs/{org}/personal-access-token-requests"], listPatGrants: ["GET /orgs/{org}/personal-access-tokens"], listPendingInvitations: ["GET /orgs/{org}/invitations"], listPublicMembers: ["GET /orgs/{org}/public_members"], listSecurityManagerTeams: [ "GET /orgs/{org}/security-managers", {}, { deprecated: "octokit.rest.orgs.listSecurityManagerTeams() is deprecated, see https://docs.github.com/rest/orgs/security-managers#list-security-manager-teams" } ], listWebhookDeliveries: ["GET /orgs/{org}/hooks/{hook_id}/deliveries"], listWebhooks: ["GET /orgs/{org}/hooks"], pingWebhook: ["POST /orgs/{org}/hooks/{hook_id}/pings"], redeliverWebhookDelivery: [ "POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts" ], removeMember: ["DELETE /orgs/{org}/members/{username}"], removeMembershipForUser: ["DELETE /orgs/{org}/memberships/{username}"], removeOutsideCollaborator: [ "DELETE /orgs/{org}/outside_collaborators/{username}" ], removePublicMembershipForAuthenticatedUser: [ "DELETE /orgs/{org}/public_members/{username}" ], removeSecurityManagerTeam: [ "DELETE /orgs/{org}/security-managers/teams/{team_slug}", {}, { deprecated: "octokit.rest.orgs.removeSecurityManagerTeam() is deprecated, see https://docs.github.com/rest/orgs/security-managers#remove-a-security-manager-team" } ], reviewPatGrantRequest: [ "POST /orgs/{org}/personal-access-token-requests/{pat_request_id}" ], reviewPatGrantRequestsInBulk: [ "POST /orgs/{org}/personal-access-token-requests" ], revokeAllOrgRolesTeam: [ "DELETE /orgs/{org}/organization-roles/teams/{team_slug}" ], revokeAllOrgRolesUser: [ "DELETE /orgs/{org}/organization-roles/users/{username}" ], revokeOrgRoleTeam: [ "DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}" ], revokeOrgRoleUser: [ "DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}" ], setImmutableReleasesSettings: [ "PUT /orgs/{org}/settings/immutable-releases" ], setImmutableReleasesSettingsRepositories: [ "PUT /orgs/{org}/settings/immutable-releases/repositories" ], setMembershipForUser: ["PUT /orgs/{org}/memberships/{username}"], setPublicMembershipForAuthenticatedUser: [ "PUT /orgs/{org}/public_members/{username}" ], unblockUser: ["DELETE /orgs/{org}/blocks/{username}"], update: ["PATCH /orgs/{org}"], updateIssueType: ["PUT /orgs/{org}/issue-types/{issue_type_id}"], updateMembershipForAuthenticatedUser: [ "PATCH /user/memberships/orgs/{org}" ], updatePatAccess: ["POST /orgs/{org}/personal-access-tokens/{pat_id}"], updatePatAccesses: ["POST /orgs/{org}/personal-access-tokens"], updateWebhook: ["PATCH /orgs/{org}/hooks/{hook_id}"], updateWebhookConfigForOrg: ["PATCH /orgs/{org}/hooks/{hook_id}/config"] }, packages: { deletePackageForAuthenticatedUser: [ "DELETE /user/packages/{package_type}/{package_name}" ], deletePackageForOrg: [ "DELETE /orgs/{org}/packages/{package_type}/{package_name}" ], deletePackageForUser: [ "DELETE /users/{username}/packages/{package_type}/{package_name}" ], deletePackageVersionForAuthenticatedUser: [ "DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}" ], deletePackageVersionForOrg: [ "DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}" ], deletePackageVersionForUser: [ "DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}" ], getAllPackageVersionsForAPackageOwnedByAnOrg: [ "GET /orgs/{org}/packages/{package_type}/{package_name}/versions", {}, { renamed: ["packages", "getAllPackageVersionsForPackageOwnedByOrg"] } ], getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser: [ "GET /user/packages/{package_type}/{package_name}/versions", {}, { renamed: [ "packages", "getAllPackageVersionsForPackageOwnedByAuthenticatedUser" ] } ], getAllPackageVersionsForPackageOwnedByAuthenticatedUser: [ "GET /user/packages/{package_type}/{package_name}/versions" ], getAllPackageVersionsForPackageOwnedByOrg: [ "GET /orgs/{org}/packages/{package_type}/{package_name}/versions" ], getAllPackageVersionsForPackageOwnedByUser: [ "GET /users/{username}/packages/{package_type}/{package_name}/versions" ], getPackageForAuthenticatedUser: [ "GET /user/packages/{package_type}/{package_name}" ], getPackageForOrganization: [ "GET /orgs/{org}/packages/{package_type}/{package_name}" ], getPackageForUser: [ "GET /users/{username}/packages/{package_type}/{package_name}" ], getPackageVersionForAuthenticatedUser: [ "GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}" ], getPackageVersionForOrganization: [ "GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}" ], getPackageVersionForUser: [ "GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}" ], listDockerMigrationConflictingPackagesForAuthenticatedUser: [ "GET /user/docker/conflicts" ], listDockerMigrationConflictingPackagesForOrganization: [ "GET /orgs/{org}/docker/conflicts" ], listDockerMigrationConflictingPackagesForUser: [ "GET /users/{username}/docker/conflicts" ], listPackagesForAuthenticatedUser: ["GET /user/packages"], listPackagesForOrganization: ["GET /orgs/{org}/packages"], listPackagesForUser: ["GET /users/{username}/packages"], restorePackageForAuthenticatedUser: [ "POST /user/packages/{package_type}/{package_name}/restore{?token}" ], restorePackageForOrg: [ "POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}" ], restorePackageForUser: [ "POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}" ], restorePackageVersionForAuthenticatedUser: [ "POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore" ], restorePackageVersionForOrg: [ "POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore" ], restorePackageVersionForUser: [ "POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore" ] }, privateRegistries: { createOrgPrivateRegistry: ["POST /orgs/{org}/private-registries"], deleteOrgPrivateRegistry: [ "DELETE /orgs/{org}/private-registries/{secret_name}" ], getOrgPrivateRegistry: ["GET /orgs/{org}/private-registries/{secret_name}"], getOrgPublicKey: ["GET /orgs/{org}/private-registries/public-key"], listOrgPrivateRegistries: ["GET /orgs/{org}/private-registries"], updateOrgPrivateRegistry: [ "PATCH /orgs/{org}/private-registries/{secret_name}" ] }, projects: { addItemForOrg: ["POST /orgs/{org}/projectsV2/{project_number}/items"], addItemForUser: [ "POST /users/{username}/projectsV2/{project_number}/items" ], deleteItemForOrg: [ "DELETE /orgs/{org}/projectsV2/{project_number}/items/{item_id}" ], deleteItemForUser: [ "DELETE /users/{username}/projectsV2/{project_number}/items/{item_id}" ], getFieldForOrg: [ "GET /orgs/{org}/projectsV2/{project_number}/fields/{field_id}" ], getFieldForUser: [ "GET /users/{username}/projectsV2/{project_number}/fields/{field_id}" ], getForOrg: ["GET /orgs/{org}/projectsV2/{project_number}"], getForUser: ["GET /users/{username}/projectsV2/{project_number}"], getOrgItem: ["GET /orgs/{org}/projectsV2/{project_number}/items/{item_id}"], getUserItem: [ "GET /users/{username}/projectsV2/{project_number}/items/{item_id}" ], listFieldsForOrg: ["GET /orgs/{org}/projectsV2/{project_number}/fields"], listFieldsForUser: [ "GET /users/{username}/projectsV2/{project_number}/fields" ], listForOrg: ["GET /orgs/{org}/projectsV2"], listForUser: ["GET /users/{username}/projectsV2"], listItemsForOrg: ["GET /orgs/{org}/projectsV2/{project_number}/items"], listItemsForUser: [ "GET /users/{username}/projectsV2/{project_number}/items" ], updateItemForOrg: [ "PATCH /orgs/{org}/projectsV2/{project_number}/items/{item_id}" ], updateItemForUser: [ "PATCH /users/{username}/projectsV2/{project_number}/items/{item_id}" ] }, pulls: { checkIfMerged: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/merge"], create: ["POST /repos/{owner}/{repo}/pulls"], createReplyForReviewComment: [ "POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies" ], createReview: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews"], createReviewComment: [ "POST /repos/{owner}/{repo}/pulls/{pull_number}/comments" ], deletePendingReview: [ "DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}" ], deleteReviewComment: [ "DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}" ], dismissReview: [ "PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals" ], get: ["GET /repos/{owner}/{repo}/pulls/{pull_number}"], getReview: [ "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}" ], getReviewComment: ["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}"], list: ["GET /repos/{owner}/{repo}/pulls"], listCommentsForReview: [ "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments" ], listCommits: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/commits"], listFiles: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/files"], listRequestedReviewers: [ "GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers" ], listReviewComments: [ "GET /repos/{owner}/{repo}/pulls/{pull_number}/comments" ], listReviewCommentsForRepo: ["GET /repos/{owner}/{repo}/pulls/comments"], listReviews: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews"], merge: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge"], removeRequestedReviewers: [ "DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers" ], requestReviewers: [ "POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers" ], submitReview: [ "POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events" ], update: ["PATCH /repos/{owner}/{repo}/pulls/{pull_number}"], updateBranch: [ "PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch" ], updateReview: [ "PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}" ], updateReviewComment: [ "PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}" ] }, rateLimit: { get: ["GET /rate_limit"] }, reactions: { createForCommitComment: [ "POST /repos/{owner}/{repo}/comments/{comment_id}/reactions" ], createForIssue: [ "POST /repos/{owner}/{repo}/issues/{issue_number}/reactions" ], createForIssueComment: [ "POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions" ], createForPullRequestReviewComment: [ "POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions" ], createForRelease: [ "POST /repos/{owner}/{repo}/releases/{release_id}/reactions" ], createForTeamDiscussionCommentInOrg: [ "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions" ], createForTeamDiscussionInOrg: [ "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions" ], deleteForCommitComment: [ "DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}" ], deleteForIssue: [ "DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}" ], deleteForIssueComment: [ "DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}" ], deleteForPullRequestComment: [ "DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}" ], deleteForRelease: [ "DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}" ], deleteForTeamDiscussion: [ "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}" ], deleteForTeamDiscussionComment: [ "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}" ], listForCommitComment: [ "GET /repos/{owner}/{repo}/comments/{comment_id}/reactions" ], listForIssue: ["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions"], listForIssueComment: [ "GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions" ], listForPullRequestReviewComment: [ "GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions" ], listForRelease: [ "GET /repos/{owner}/{repo}/releases/{release_id}/reactions" ], listForTeamDiscussionCommentInOrg: [ "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions" ], listForTeamDiscussionInOrg: [ "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions" ] }, repos: { acceptInvitation: [ "PATCH /user/repository_invitations/{invitation_id}", {}, { renamed: ["repos", "acceptInvitationForAuthenticatedUser"] } ], acceptInvitationForAuthenticatedUser: [ "PATCH /user/repository_invitations/{invitation_id}" ], addAppAccessRestrictions: [ "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", {}, { mapToData: "apps" } ], addCollaborator: ["PUT /repos/{owner}/{repo}/collaborators/{username}"], addStatusCheckContexts: [ "POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts", {}, { mapToData: "contexts" } ], addTeamAccessRestrictions: [ "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams", {}, { mapToData: "teams" } ], addUserAccessRestrictions: [ "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users", {}, { mapToData: "users" } ], cancelPagesDeployment: [ "POST /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}/cancel" ], checkAutomatedSecurityFixes: [ "GET /repos/{owner}/{repo}/automated-security-fixes" ], checkCollaborator: ["GET /repos/{owner}/{repo}/collaborators/{username}"], checkImmutableReleases: ["GET /repos/{owner}/{repo}/immutable-releases"], checkPrivateVulnerabilityReporting: [ "GET /repos/{owner}/{repo}/private-vulnerability-reporting" ], checkVulnerabilityAlerts: [ "GET /repos/{owner}/{repo}/vulnerability-alerts" ], codeownersErrors: ["GET /repos/{owner}/{repo}/codeowners/errors"], compareCommits: ["GET /repos/{owner}/{repo}/compare/{base}...{head}"], compareCommitsWithBasehead: [ "GET /repos/{owner}/{repo}/compare/{basehead}" ], createAttestation: ["POST /repos/{owner}/{repo}/attestations"], createAutolink: ["POST /repos/{owner}/{repo}/autolinks"], createCommitComment: [ "POST /repos/{owner}/{repo}/commits/{commit_sha}/comments" ], createCommitSignatureProtection: [ "POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures" ], createCommitStatus: ["POST /repos/{owner}/{repo}/statuses/{sha}"], createDeployKey: ["POST /repos/{owner}/{repo}/keys"], createDeployment: ["POST /repos/{owner}/{repo}/deployments"], createDeploymentBranchPolicy: [ "POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies" ], createDeploymentProtectionRule: [ "POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules" ], createDeploymentStatus: [ "POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses" ], createDispatchEvent: ["POST /repos/{owner}/{repo}/dispatches"], createForAuthenticatedUser: ["POST /user/repos"], createFork: ["POST /repos/{owner}/{repo}/forks"], createInOrg: ["POST /orgs/{org}/repos"], createOrUpdateEnvironment: [ "PUT /repos/{owner}/{repo}/environments/{environment_name}" ], createOrUpdateFileContents: ["PUT /repos/{owner}/{repo}/contents/{path}"], createOrgRuleset: ["POST /orgs/{org}/rulesets"], createPagesDeployment: ["POST /repos/{owner}/{repo}/pages/deployments"], createPagesSite: ["POST /repos/{owner}/{repo}/pages"], createRelease: ["POST /repos/{owner}/{repo}/releases"], createRepoRuleset: ["POST /repos/{owner}/{repo}/rulesets"], createUsingTemplate: [ "POST /repos/{template_owner}/{template_repo}/generate" ], createWebhook: ["POST /repos/{owner}/{repo}/hooks"], customPropertiesForReposCreateOrUpdateRepositoryValues: [ "PATCH /repos/{owner}/{repo}/properties/values" ], customPropertiesForReposGetRepositoryValues: [ "GET /repos/{owner}/{repo}/properties/values" ], declineInvitation: [ "DELETE /user/repository_invitations/{invitation_id}", {}, { renamed: ["repos", "declineInvitationForAuthenticatedUser"] } ], declineInvitationForAuthenticatedUser: [ "DELETE /user/repository_invitations/{invitation_id}" ], delete: ["DELETE /repos/{owner}/{repo}"], deleteAccessRestrictions: [ "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions" ], deleteAdminBranchProtection: [ "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins" ], deleteAnEnvironment: [ "DELETE /repos/{owner}/{repo}/environments/{environment_name}" ], deleteAutolink: ["DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}"], deleteBranchProtection: [ "DELETE /repos/{owner}/{repo}/branches/{branch}/protection" ], deleteCommitComment: ["DELETE /repos/{owner}/{repo}/comments/{comment_id}"], deleteCommitSignatureProtection: [ "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures" ], deleteDeployKey: ["DELETE /repos/{owner}/{repo}/keys/{key_id}"], deleteDeployment: [ "DELETE /repos/{owner}/{repo}/deployments/{deployment_id}" ], deleteDeploymentBranchPolicy: [ "DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}" ], deleteFile: ["DELETE /repos/{owner}/{repo}/contents/{path}"], deleteInvitation: [ "DELETE /repos/{owner}/{repo}/invitations/{invitation_id}" ], deleteOrgRuleset: ["DELETE /orgs/{org}/rulesets/{ruleset_id}"], deletePagesSite: ["DELETE /repos/{owner}/{repo}/pages"], deletePullRequestReviewProtection: [ "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews" ], deleteRelease: ["DELETE /repos/{owner}/{repo}/releases/{release_id}"], deleteReleaseAsset: [ "DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}" ], deleteRepoRuleset: ["DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id}"], deleteWebhook: ["DELETE /repos/{owner}/{repo}/hooks/{hook_id}"], disableAutomatedSecurityFixes: [ "DELETE /repos/{owner}/{repo}/automated-security-fixes" ], disableDeploymentProtectionRule: [ "DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}" ], disableImmutableReleases: [ "DELETE /repos/{owner}/{repo}/immutable-releases" ], disablePrivateVulnerabilityReporting: [ "DELETE /repos/{owner}/{repo}/private-vulnerability-reporting" ], disableVulnerabilityAlerts: [ "DELETE /repos/{owner}/{repo}/vulnerability-alerts" ], downloadArchive: [ "GET /repos/{owner}/{repo}/zipball/{ref}", {}, { renamed: ["repos", "downloadZipballArchive"] } ], downloadTarballArchive: ["GET /repos/{owner}/{repo}/tarball/{ref}"], downloadZipballArchive: ["GET /repos/{owner}/{repo}/zipball/{ref}"], enableAutomatedSecurityFixes: [ "PUT /repos/{owner}/{repo}/automated-security-fixes" ], enableImmutableReleases: ["PUT /repos/{owner}/{repo}/immutable-releases"], enablePrivateVulnerabilityReporting: [ "PUT /repos/{owner}/{repo}/private-vulnerability-reporting" ], enableVulnerabilityAlerts: [ "PUT /repos/{owner}/{repo}/vulnerability-alerts" ], generateReleaseNotes: [ "POST /repos/{owner}/{repo}/releases/generate-notes" ], get: ["GET /repos/{owner}/{repo}"], getAccessRestrictions: [ "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions" ], getAdminBranchProtection: [ "GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins" ], getAllDeploymentProtectionRules: [ "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules" ], getAllEnvironments: ["GET /repos/{owner}/{repo}/environments"], getAllStatusCheckContexts: [ "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts" ], getAllTopics: ["GET /repos/{owner}/{repo}/topics"], getAppsWithAccessToProtectedBranch: [ "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps" ], getAutolink: ["GET /repos/{owner}/{repo}/autolinks/{autolink_id}"], getBranch: ["GET /repos/{owner}/{repo}/branches/{branch}"], getBranchProtection: [ "GET /repos/{owner}/{repo}/branches/{branch}/protection" ], getBranchRules: ["GET /repos/{owner}/{repo}/rules/branches/{branch}"], getClones: ["GET /repos/{owner}/{repo}/traffic/clones"], getCodeFrequencyStats: ["GET /repos/{owner}/{repo}/stats/code_frequency"], getCollaboratorPermissionLevel: [ "GET /repos/{owner}/{repo}/collaborators/{username}/permission" ], getCombinedStatusForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/status"], getCommit: ["GET /repos/{owner}/{repo}/commits/{ref}"], getCommitActivityStats: ["GET /repos/{owner}/{repo}/stats/commit_activity"], getCommitComment: ["GET /repos/{owner}/{repo}/comments/{comment_id}"], getCommitSignatureProtection: [ "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures" ], getCommunityProfileMetrics: ["GET /repos/{owner}/{repo}/community/profile"], getContent: ["GET /repos/{owner}/{repo}/contents/{path}"], getContributorsStats: ["GET /repos/{owner}/{repo}/stats/contributors"], getCustomDeploymentProtectionRule: [ "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}" ], getDeployKey: ["GET /repos/{owner}/{repo}/keys/{key_id}"], getDeployment: ["GET /repos/{owner}/{repo}/deployments/{deployment_id}"], getDeploymentBranchPolicy: [ "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}" ], getDeploymentStatus: [ "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}" ], getEnvironment: [ "GET /repos/{owner}/{repo}/environments/{environment_name}" ], getLatestPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/latest"], getLatestRelease: ["GET /repos/{owner}/{repo}/releases/latest"], getOrgRuleSuite: ["GET /orgs/{org}/rulesets/rule-suites/{rule_suite_id}"], getOrgRuleSuites: ["GET /orgs/{org}/rulesets/rule-suites"], getOrgRuleset: ["GET /orgs/{org}/rulesets/{ruleset_id}"], getOrgRulesets: ["GET /orgs/{org}/rulesets"], getPages: ["GET /repos/{owner}/{repo}/pages"], getPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/{build_id}"], getPagesDeployment: [ "GET /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}" ], getPagesHealthCheck: ["GET /repos/{owner}/{repo}/pages/health"], getParticipationStats: ["GET /repos/{owner}/{repo}/stats/participation"], getPullRequestReviewProtection: [ "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews" ], getPunchCardStats: ["GET /repos/{owner}/{repo}/stats/punch_card"], getReadme: ["GET /repos/{owner}/{repo}/readme"], getReadmeInDirectory: ["GET /repos/{owner}/{repo}/readme/{dir}"], getRelease: ["GET /repos/{owner}/{repo}/releases/{release_id}"], getReleaseAsset: ["GET /repos/{owner}/{repo}/releases/assets/{asset_id}"], getReleaseByTag: ["GET /repos/{owner}/{repo}/releases/tags/{tag}"], getRepoRuleSuite: [ "GET /repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}" ], getRepoRuleSuites: ["GET /repos/{owner}/{repo}/rulesets/rule-suites"], getRepoRuleset: ["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}"], getRepoRulesetHistory: [ "GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history" ], getRepoRulesetVersion: [ "GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history/{version_id}" ], getRepoRulesets: ["GET /repos/{owner}/{repo}/rulesets"], getStatusChecksProtection: [ "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks" ], getTeamsWithAccessToProtectedBranch: [ "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams" ], getTopPaths: ["GET /repos/{owner}/{repo}/traffic/popular/paths"], getTopReferrers: ["GET /repos/{owner}/{repo}/traffic/popular/referrers"], getUsersWithAccessToProtectedBranch: [ "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users" ], getViews: ["GET /repos/{owner}/{repo}/traffic/views"], getWebhook: ["GET /repos/{owner}/{repo}/hooks/{hook_id}"], getWebhookConfigForRepo: [ "GET /repos/{owner}/{repo}/hooks/{hook_id}/config" ], getWebhookDelivery: [ "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}" ], listActivities: ["GET /repos/{owner}/{repo}/activity"], listAttestations: [ "GET /repos/{owner}/{repo}/attestations/{subject_digest}" ], listAutolinks: ["GET /repos/{owner}/{repo}/autolinks"], listBranches: ["GET /repos/{owner}/{repo}/branches"], listBranchesForHeadCommit: [ "GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head" ], listCollaborators: ["GET /repos/{owner}/{repo}/collaborators"], listCommentsForCommit: [ "GET /repos/{owner}/{repo}/commits/{commit_sha}/comments" ], listCommitCommentsForRepo: ["GET /repos/{owner}/{repo}/comments"], listCommitStatusesForRef: [ "GET /repos/{owner}/{repo}/commits/{ref}/statuses" ], listCommits: ["GET /repos/{owner}/{repo}/commits"], listContributors: ["GET /repos/{owner}/{repo}/contributors"], listCustomDeploymentRuleIntegrations: [ "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps" ], listDeployKeys: ["GET /repos/{owner}/{repo}/keys"], listDeploymentBranchPolicies: [ "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies" ], listDeploymentStatuses: [ "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses" ], listDeployments: ["GET /repos/{owner}/{repo}/deployments"], listForAuthenticatedUser: ["GET /user/repos"], listForOrg: ["GET /orgs/{org}/repos"], listForUser: ["GET /users/{username}/repos"], listForks: ["GET /repos/{owner}/{repo}/forks"], listInvitations: ["GET /repos/{owner}/{repo}/invitations"], listInvitationsForAuthenticatedUser: ["GET /user/repository_invitations"], listLanguages: ["GET /repos/{owner}/{repo}/languages"], listPagesBuilds: ["GET /repos/{owner}/{repo}/pages/builds"], listPublic: ["GET /repositories"], listPullRequestsAssociatedWithCommit: [ "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls" ], listReleaseAssets: [ "GET /repos/{owner}/{repo}/releases/{release_id}/assets" ], listReleases: ["GET /repos/{owner}/{repo}/releases"], listTags: ["GET /repos/{owner}/{repo}/tags"], listTeams: ["GET /repos/{owner}/{repo}/teams"], listWebhookDeliveries: [ "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries" ], listWebhooks: ["GET /repos/{owner}/{repo}/hooks"], merge: ["POST /repos/{owner}/{repo}/merges"], mergeUpstream: ["POST /repos/{owner}/{repo}/merge-upstream"], pingWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/pings"], redeliverWebhookDelivery: [ "POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts" ], removeAppAccessRestrictions: [ "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", {}, { mapToData: "apps" } ], removeCollaborator: [ "DELETE /repos/{owner}/{repo}/collaborators/{username}" ], removeStatusCheckContexts: [ "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts", {}, { mapToData: "contexts" } ], removeStatusCheckProtection: [ "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks" ], removeTeamAccessRestrictions: [ "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams", {}, { mapToData: "teams" } ], removeUserAccessRestrictions: [ "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users", {}, { mapToData: "users" } ], renameBranch: ["POST /repos/{owner}/{repo}/branches/{branch}/rename"], replaceAllTopics: ["PUT /repos/{owner}/{repo}/topics"], requestPagesBuild: ["POST /repos/{owner}/{repo}/pages/builds"], setAdminBranchProtection: [ "POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins" ], setAppAccessRestrictions: [ "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", {}, { mapToData: "apps" } ], setStatusCheckContexts: [ "PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts", {}, { mapToData: "contexts" } ], setTeamAccessRestrictions: [ "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams", {}, { mapToData: "teams" } ], setUserAccessRestrictions: [ "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users", {}, { mapToData: "users" } ], testPushWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/tests"], transfer: ["POST /repos/{owner}/{repo}/transfer"], update: ["PATCH /repos/{owner}/{repo}"], updateBranchProtection: [ "PUT /repos/{owner}/{repo}/branches/{branch}/protection" ], updateCommitComment: ["PATCH /repos/{owner}/{repo}/comments/{comment_id}"], updateDeploymentBranchPolicy: [ "PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}" ], updateInformationAboutPagesSite: ["PUT /repos/{owner}/{repo}/pages"], updateInvitation: [ "PATCH /repos/{owner}/{repo}/invitations/{invitation_id}" ], updateOrgRuleset: ["PUT /orgs/{org}/rulesets/{ruleset_id}"], updatePullRequestReviewProtection: [ "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews" ], updateRelease: ["PATCH /repos/{owner}/{repo}/releases/{release_id}"], updateReleaseAsset: [ "PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}" ], updateRepoRuleset: ["PUT /repos/{owner}/{repo}/rulesets/{ruleset_id}"], updateStatusCheckPotection: [ "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks", {}, { renamed: ["repos", "updateStatusCheckProtection"] } ], updateStatusCheckProtection: [ "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks" ], updateWebhook: ["PATCH /repos/{owner}/{repo}/hooks/{hook_id}"], updateWebhookConfigForRepo: [ "PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config" ], uploadReleaseAsset: [ "POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}", { baseUrl: "https://uploads.github.com" } ] }, search: { code: ["GET /search/code"], commits: ["GET /search/commits"], issuesAndPullRequests: ["GET /search/issues"], labels: ["GET /search/labels"], repos: ["GET /search/repositories"], topics: ["GET /search/topics"], users: ["GET /search/users"] }, secretScanning: { createPushProtectionBypass: [ "POST /repos/{owner}/{repo}/secret-scanning/push-protection-bypasses" ], getAlert: [ "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}" ], getScanHistory: ["GET /repos/{owner}/{repo}/secret-scanning/scan-history"], listAlertsForOrg: ["GET /orgs/{org}/secret-scanning/alerts"], listAlertsForRepo: ["GET /repos/{owner}/{repo}/secret-scanning/alerts"], listLocationsForAlert: [ "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations" ], listOrgPatternConfigs: [ "GET /orgs/{org}/secret-scanning/pattern-configurations" ], updateAlert: [ "PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}" ], updateOrgPatternConfigs: [ "PATCH /orgs/{org}/secret-scanning/pattern-configurations" ] }, securityAdvisories: { createFork: [ "POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks" ], createPrivateVulnerabilityReport: [ "POST /repos/{owner}/{repo}/security-advisories/reports" ], createRepositoryAdvisory: [ "POST /repos/{owner}/{repo}/security-advisories" ], createRepositoryAdvisoryCveRequest: [ "POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve" ], getGlobalAdvisory: ["GET /advisories/{ghsa_id}"], getRepositoryAdvisory: [ "GET /repos/{owner}/{repo}/security-advisories/{ghsa_id}" ], listGlobalAdvisories: ["GET /advisories"], listOrgRepositoryAdvisories: ["GET /orgs/{org}/security-advisories"], listRepositoryAdvisories: ["GET /repos/{owner}/{repo}/security-advisories"], updateRepositoryAdvisory: [ "PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id}" ] }, teams: { addOrUpdateMembershipForUserInOrg: [ "PUT /orgs/{org}/teams/{team_slug}/memberships/{username}" ], addOrUpdateRepoPermissionsInOrg: [ "PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}" ], checkPermissionsForRepoInOrg: [ "GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}" ], create: ["POST /orgs/{org}/teams"], createDiscussionCommentInOrg: [ "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments" ], createDiscussionInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions"], deleteDiscussionCommentInOrg: [ "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}" ], deleteDiscussionInOrg: [ "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}" ], deleteInOrg: ["DELETE /orgs/{org}/teams/{team_slug}"], getByName: ["GET /orgs/{org}/teams/{team_slug}"], getDiscussionCommentInOrg: [ "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}" ], getDiscussionInOrg: [ "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}" ], getMembershipForUserInOrg: [ "GET /orgs/{org}/teams/{team_slug}/memberships/{username}" ], list: ["GET /orgs/{org}/teams"], listChildInOrg: ["GET /orgs/{org}/teams/{team_slug}/teams"], listDiscussionCommentsInOrg: [ "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments" ], listDiscussionsInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions"], listForAuthenticatedUser: ["GET /user/teams"], listMembersInOrg: ["GET /orgs/{org}/teams/{team_slug}/members"], listPendingInvitationsInOrg: [ "GET /orgs/{org}/teams/{team_slug}/invitations" ], listReposInOrg: ["GET /orgs/{org}/teams/{team_slug}/repos"], removeMembershipForUserInOrg: [ "DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}" ], removeRepoInOrg: [ "DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}" ], updateDiscussionCommentInOrg: [ "PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}" ], updateDiscussionInOrg: [ "PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}" ], updateInOrg: ["PATCH /orgs/{org}/teams/{team_slug}"] }, users: { addEmailForAuthenticated: [ "POST /user/emails", {}, { renamed: ["users", "addEmailForAuthenticatedUser"] } ], addEmailForAuthenticatedUser: ["POST /user/emails"], addSocialAccountForAuthenticatedUser: ["POST /user/social_accounts"], block: ["PUT /user/blocks/{username}"], checkBlocked: ["GET /user/blocks/{username}"], checkFollowingForUser: ["GET /users/{username}/following/{target_user}"], checkPersonIsFollowedByAuthenticated: ["GET /user/following/{username}"], createGpgKeyForAuthenticated: [ "POST /user/gpg_keys", {}, { renamed: ["users", "createGpgKeyForAuthenticatedUser"] } ], createGpgKeyForAuthenticatedUser: ["POST /user/gpg_keys"], createPublicSshKeyForAuthenticated: [ "POST /user/keys", {}, { renamed: ["users", "createPublicSshKeyForAuthenticatedUser"] } ], createPublicSshKeyForAuthenticatedUser: ["POST /user/keys"], createSshSigningKeyForAuthenticatedUser: ["POST /user/ssh_signing_keys"], deleteAttestationsBulk: [ "POST /users/{username}/attestations/delete-request" ], deleteAttestationsById: [ "DELETE /users/{username}/attestations/{attestation_id}" ], deleteAttestationsBySubjectDigest: [ "DELETE /users/{username}/attestations/digest/{subject_digest}" ], deleteEmailForAuthenticated: [ "DELETE /user/emails", {}, { renamed: ["users", "deleteEmailForAuthenticatedUser"] } ], deleteEmailForAuthenticatedUser: ["DELETE /user/emails"], deleteGpgKeyForAuthenticated: [ "DELETE /user/gpg_keys/{gpg_key_id}", {}, { renamed: ["users", "deleteGpgKeyForAuthenticatedUser"] } ], deleteGpgKeyForAuthenticatedUser: ["DELETE /user/gpg_keys/{gpg_key_id}"], deletePublicSshKeyForAuthenticated: [ "DELETE /user/keys/{key_id}", {}, { renamed: ["users", "deletePublicSshKeyForAuthenticatedUser"] } ], deletePublicSshKeyForAuthenticatedUser: ["DELETE /user/keys/{key_id}"], deleteSocialAccountForAuthenticatedUser: ["DELETE /user/social_accounts"], deleteSshSigningKeyForAuthenticatedUser: [ "DELETE /user/ssh_signing_keys/{ssh_signing_key_id}" ], follow: ["PUT /user/following/{username}"], getAuthenticated: ["GET /user"], getById: ["GET /user/{account_id}"], getByUsername: ["GET /users/{username}"], getContextForUser: ["GET /users/{username}/hovercard"], getGpgKeyForAuthenticated: [ "GET /user/gpg_keys/{gpg_key_id}", {}, { renamed: ["users", "getGpgKeyForAuthenticatedUser"] } ], getGpgKeyForAuthenticatedUser: ["GET /user/gpg_keys/{gpg_key_id}"], getPublicSshKeyForAuthenticated: [ "GET /user/keys/{key_id}", {}, { renamed: ["users", "getPublicSshKeyForAuthenticatedUser"] } ], getPublicSshKeyForAuthenticatedUser: ["GET /user/keys/{key_id}"], getSshSigningKeyForAuthenticatedUser: [ "GET /user/ssh_signing_keys/{ssh_signing_key_id}" ], list: ["GET /users"], listAttestations: ["GET /users/{username}/attestations/{subject_digest}"], listAttestationsBulk: [ "POST /users/{username}/attestations/bulk-list{?per_page,before,after}" ], listBlockedByAuthenticated: [ "GET /user/blocks", {}, { renamed: ["users", "listBlockedByAuthenticatedUser"] } ], listBlockedByAuthenticatedUser: ["GET /user/blocks"], listEmailsForAuthenticated: [ "GET /user/emails", {}, { renamed: ["users", "listEmailsForAuthenticatedUser"] } ], listEmailsForAuthenticatedUser: ["GET /user/emails"], listFollowedByAuthenticated: [ "GET /user/following", {}, { renamed: ["users", "listFollowedByAuthenticatedUser"] } ], listFollowedByAuthenticatedUser: ["GET /user/following"], listFollowersForAuthenticatedUser: ["GET /user/followers"], listFollowersForUser: ["GET /users/{username}/followers"], listFollowingForUser: ["GET /users/{username}/following"], listGpgKeysForAuthenticated: [ "GET /user/gpg_keys", {}, { renamed: ["users", "listGpgKeysForAuthenticatedUser"] } ], listGpgKeysForAuthenticatedUser: ["GET /user/gpg_keys"], listGpgKeysForUser: ["GET /users/{username}/gpg_keys"], listPublicEmailsForAuthenticated: [ "GET /user/public_emails", {}, { renamed: ["users", "listPublicEmailsForAuthenticatedUser"] } ], listPublicEmailsForAuthenticatedUser: ["GET /user/public_emails"], listPublicKeysForUser: ["GET /users/{username}/keys"], listPublicSshKeysForAuthenticated: [ "GET /user/keys", {}, { renamed: ["users", "listPublicSshKeysForAuthenticatedUser"] } ], listPublicSshKeysForAuthenticatedUser: ["GET /user/keys"], listSocialAccountsForAuthenticatedUser: ["GET /user/social_accounts"], listSocialAccountsForUser: ["GET /users/{username}/social_accounts"], listSshSigningKeysForAuthenticatedUser: ["GET /user/ssh_signing_keys"], listSshSigningKeysForUser: ["GET /users/{username}/ssh_signing_keys"], setPrimaryEmailVisibilityForAuthenticated: [ "PATCH /user/email/visibility", {}, { renamed: ["users", "setPrimaryEmailVisibilityForAuthenticatedUser"] } ], setPrimaryEmailVisibilityForAuthenticatedUser: [ "PATCH /user/email/visibility" ], unblock: ["DELETE /user/blocks/{username}"], unfollow: ["DELETE /user/following/{username}"], updateAuthenticated: ["PATCH /user"] } }; var endpoints_default2 = Endpoints2; var endpointMethodsMap2 = /* @__PURE__ */ new Map(); for (const [scope, endpoints] of Object.entries(endpoints_default2)) { for (const [methodName, endpoint22] of Object.entries(endpoints)) { const [route, defaults2, decorations] = endpoint22; const [method, url] = route.split(/ /); const endpointDefaults = Object.assign( { method, url }, defaults2 ); if (!endpointMethodsMap2.has(scope)) { endpointMethodsMap2.set(scope, /* @__PURE__ */ new Map()); } endpointMethodsMap2.get(scope).set(methodName, { scope, methodName, endpointDefaults, decorations }); } } var handler2 = { has({ scope }, methodName) { return endpointMethodsMap2.get(scope).has(methodName); }, getOwnPropertyDescriptor(target, methodName) { return { value: this.get(target, methodName), // ensures method is in the cache configurable: true, writable: true, enumerable: true }; }, defineProperty(target, methodName, descriptor) { Object.defineProperty(target.cache, methodName, descriptor); return true; }, deleteProperty(target, methodName) { delete target.cache[methodName]; return true; }, ownKeys({ scope }) { return [...endpointMethodsMap2.get(scope).keys()]; }, set(target, methodName, value) { return target.cache[methodName] = value; }, get({ octokit, scope, cache }, methodName) { if (cache[methodName]) { return cache[methodName]; } const method = endpointMethodsMap2.get(scope).get(methodName); if (!method) { return void 0; } const { endpointDefaults, decorations } = method; if (decorations) { cache[methodName] = decorate2( octokit, scope, methodName, endpointDefaults, decorations ); } else { cache[methodName] = octokit.request.defaults(endpointDefaults); } return cache[methodName]; } }; function endpointsToMethods2(octokit) { const newMethods = {}; for (const scope of endpointMethodsMap2.keys()) { newMethods[scope] = new Proxy({ octokit, scope, cache: {} }, handler2); } return newMethods; } function decorate2(octokit, scope, methodName, defaults2, decorations) { const requestWithDefaults = octokit.request.defaults(defaults2); function withDecorations(...args) { let options = requestWithDefaults.endpoint.merge(...args); if (decorations.mapToData) { options = Object.assign({}, options, { data: options[decorations.mapToData], [decorations.mapToData]: void 0 }); return requestWithDefaults(options); } if (decorations.renamed) { const [newScope, newMethodName] = decorations.renamed; octokit.log.warn( `octokit.${scope}.${methodName}() has been renamed to octokit.${newScope}.${newMethodName}()` ); } if (decorations.deprecated) { octokit.log.warn(decorations.deprecated); } if (decorations.renamedParameters) { const options2 = requestWithDefaults.endpoint.merge(...args); for (const [name, alias2] of Object.entries( decorations.renamedParameters )) { if (name in options2) { octokit.log.warn( `"${name}" parameter is deprecated for "octokit.${scope}.${methodName}()". Use "${alias2}" instead` ); if (!(alias2 in options2)) { options2[alias2] = options2[name]; } delete options2[name]; } } return requestWithDefaults(options2); } return requestWithDefaults(...args); } return Object.assign(withDecorations, requestWithDefaults); } function restEndpointMethods2(octokit) { const api = endpointsToMethods2(octokit); return { rest: api }; } restEndpointMethods2.VERSION = VERSION72; function legacyRestEndpointMethods2(octokit) { const api = endpointsToMethods2(octokit); return { ...api, rest: api }; } legacyRestEndpointMethods2.VERSION = VERSION72; var VERSION8 = "22.0.1"; var Octokit22 = Octokit2.plugin(requestLog, legacyRestEndpointMethods2, paginateRest2).defaults( { userAgent: `octokit-rest.js/${VERSION8}` } ); var GraphQLType; (function(GraphQLType2) { GraphQLType2[GraphQLType2["SCALAR"] = 0] = "SCALAR"; GraphQLType2[GraphQLType2["INLINE_FRAGMENT"] = 1] = "INLINE_FRAGMENT"; GraphQLType2[GraphQLType2["FRAGMENT"] = 2] = "FRAGMENT"; })(GraphQLType || (GraphQLType = {})); var typeSymbol = Symbol("GraphQL Type"); var paramsSymbol = Symbol("GraphQL Params"); function isInlineFragmentObject(value) { return typeof value === "object" && value !== null && value[typeSymbol] === GraphQLType.INLINE_FRAGMENT; } function isFragmentObject(value) { return typeof value === "object" && value !== null && value[typeSymbol] === GraphQLType.FRAGMENT; } function isScalarObject(value) { return typeof value === "object" && value !== null && value[typeSymbol] === GraphQLType.SCALAR; } function renderName(name) { return name === void 0 ? "" : name; } function renderParams(params2, brackets, array) { if (brackets === void 0) { brackets = true; } if (array === void 0) { array = false; } if (!params2) { return ""; } var builder = []; for (var _i = 0, _a2 = Object.entries(params2); _i < _a2.length; _i++) { var _b2 = _a2[_i], key = _b2[0], value = _b2[1]; var params_1 = void 0; if (value === null) { params_1 = "null"; } else if (Array.isArray(value)) { params_1 = "[".concat(renderParams(value, false, true), "]"); } else if (typeof value === "object") { params_1 = "{".concat(renderParams(value, false), "}"); } else { params_1 = "".concat(value); } builder.push(array ? "".concat(params_1) : "".concat(key, ":").concat(params_1)); } var built = builder.join(","); if (brackets) { built = "(".concat(built, ")"); } return built; } function renderScalar(name, params2) { return renderName(name) + renderParams(params2); } function renderInlineFragment(fragment, context3) { return "...on ".concat(fragment.typeName).concat(renderObject(void 0, fragment.internal, context3)); } function renderFragment(fragment, context3) { return "fragment ".concat(fragment.name, " on ").concat(fragment.typeName).concat(renderObject(void 0, fragment.internal, context3)); } function renderArray(name, arr, context3) { var first = arr[0]; if (first === void 0 || first === null) { throw new Error("Cannot render array with no first value"); } first[paramsSymbol] = arr[paramsSymbol]; return renderType(name, first, context3); } function renderType(name, value, context3) { switch (typeof value) { case "bigint": case "boolean": case "number": case "string": throw new Error("Rendering type ".concat(typeof value, " directly is disallowed")); case "object": if (value === null) { throw new Error("Cannot render null"); } if (isScalarObject(value)) { return "".concat(renderScalar(name, value[paramsSymbol]), " "); } else if (Array.isArray(value)) { return renderArray(name, value, context3); } else { return renderObject(name, value, context3); } case "undefined": return ""; default: throw new Error("Cannot render type ".concat(typeof value)); } } function renderObject(name, obj, context3) { var fields = []; for (var _i = 0, _a2 = Object.entries(obj); _i < _a2.length; _i++) { var _b2 = _a2[_i], key = _b2[0], value = _b2[1]; fields.push(renderType(key, value, context3)); } for (var _c2 = 0, _d = Object.getOwnPropertySymbols(obj); _c2 < _d.length; _c2++) { var sym = _d[_c2]; var value = obj[sym]; if (isInlineFragmentObject(value)) { fields.push(renderInlineFragment(value, context3)); } else if (isFragmentObject(value)) { context3.fragments.set(sym, value); fields.push("...".concat(value.name)); } } if (fields.length === 0) { throw new Error("Object cannot have no fields"); } return "".concat(renderName(name)).concat(renderParams(obj[paramsSymbol]), "{").concat(fields.join("").trim(), "}"); } function render(value) { var context3 = { fragments: /* @__PURE__ */ new Map() }; var rend = renderObject(void 0, value, context3); var rendered = /* @__PURE__ */ new Map(); var executingContext = context3; var currentContext = { // The current context for execution. fragments: /* @__PURE__ */ new Map() }; while (executingContext.fragments.size > 0) { for (var _i = 0, _a2 = Array.from(executingContext.fragments.entries()); _i < _a2.length; _i++) { var _b2 = _a2[_i], sym = _b2[0], fragment = _b2[1]; if (!rendered.has(sym)) { rendered.set(sym, renderFragment(fragment, currentContext)); } } executingContext = currentContext; currentContext = { // Reset current context. fragments: /* @__PURE__ */ new Map() }; } return rend + Array.from(rendered.values()).join(""); } function createOperate(operateType) { function operate(opNameOrQueryObject, queryObject) { if (typeof opNameOrQueryObject === "string") { if (!queryObject) { throw new Error("queryObject is not set"); } return { toString: function() { return "".concat(operateType, " ").concat(opNameOrQueryObject).concat(render(queryObject)); } }; } return { toString: function() { return "".concat(operateType).concat(render(opNameOrQueryObject)); } }; } return operate; } var query = createOperate("query"); var mutation = createOperate("mutation"); var subscription = createOperate("subscription"); function params(params2, input) { if (typeof params2 !== "object") { throw new Error("Params have to be an object"); } if (typeof input !== "object") { throw new Error("Cannot apply params to JS ".concat(typeof params2)); } input[paramsSymbol] = params2; return input; } function scalarType() { var _a2; var scalar = (_a2 = {}, _a2[typeSymbol] = GraphQLType.SCALAR, _a2); return scalar; } var types = ( /** @class */ function() { function types2() { } Object.defineProperty(types2, "number", { get: function() { return scalarType(); }, enumerable: false, configurable: true }); Object.defineProperty(types2, "string", { get: function() { return scalarType(); }, enumerable: false, configurable: true }); Object.defineProperty(types2, "boolean", { get: function() { return scalarType(); }, enumerable: false, configurable: true }); types2.constant = function(_c2) { return scalarType(); }; types2.oneOf = function(_e) { return scalarType(); }; types2.custom = function() { return scalarType(); }; types2.optional = types2; return types2; }() ); async function invokeWithRetry(fn, retries = 3, delay = 1e3) { let attempt = 0; while (attempt < retries) { try { return await fn(); } catch (e) { attempt++; if (attempt >= retries) { throw e; } if (isGithubApiError(e) && e.status < 500) { throw e; } if (e instanceof GraphqlResponseError2) { if (!e.errors) { throw e; } if (e.errors.every((err) => ["NOT_FOUND", "FORBIDDEN", "BAD_USER_INPUT", "UNAUTHENTICATED"].includes(err.type))) { throw e; } } Log.warn(`GitHub API call failed (attempt ${attempt}/${retries}). Retrying in ${delay}ms...`); await new Promise((resolve22) => setTimeout(resolve22, delay)); } } throw new Error("Unreachable"); } function createRetryProxy(target) { return new Proxy(target, { get(targetObj, prop, receiver) { const value = Reflect.get(targetObj, prop, receiver); if (typeof value === "function") { return new Proxy(value, { apply(targetFn, thisArg, argArray) { return invokeWithRetry(() => targetFn.apply(targetObj, argArray)); } }); } if (typeof value === "object" && value !== null) { return createRetryProxy(value); } return value; }, apply(targetFn, thisArg, argArray) { return invokeWithRetry(() => targetFn.apply(thisArg, argArray)); } }); } var GithubClient = class { constructor(_octokitOptions) { this._octokitOptions = _octokitOptions; this._octokit = new Octokit22({ log: { debug: Log.debug, error: Log.debug, info: Log.debug, warn: Log.debug }, ...this._octokitOptions }); this.pulls = createRetryProxy(this._octokit.pulls); this.orgs = createRetryProxy(this._octokit.orgs); this.repos = createRetryProxy(this._octokit.repos); this.issues = createRetryProxy(this._octokit.issues); this.git = createRetryProxy(this._octokit.git); this.rateLimit = createRetryProxy(this._octokit.rateLimit); this.teams = createRetryProxy(this._octokit.teams); this.search = createRetryProxy(this._octokit.search); this.rest = createRetryProxy(this._octokit.rest); this.paginate = createRetryProxy(this._octokit.paginate); this.checks = createRetryProxy(this._octokit.checks); this.users = createRetryProxy(this._octokit.users); } }; var AuthenticatedGithubClient = class extends GithubClient { constructor(_token) { super({ auth: _token }); this._token = _token; this._graphql = this._octokit.graphql.defaults({ headers: { authorization: `token ${this._token}` } }); } async graphql(queryObject, params2 = {}) { return invokeWithRetry(async () => { return await this._graphql(query(queryObject).toString(), params2); }); } }; function isGithubApiError(obj) { return obj instanceof Error && obj.constructor.name === "RequestError" && obj.request !== void 0; } function isDryRun() { return process.env["DRY_RUN"] !== void 0; } var DryRunError = class extends Error { constructor() { super("Cannot call this function in dryRun mode."); } }; var GITHUB_TOKEN_SETTINGS_URL = "https://github.com/settings/tokens"; var GITHUB_TOKEN_GENERATE_URL = "https://github.com/settings/tokens/new"; function addTokenToGitHttpsUrl(githubHttpsUrl, token) { const url = new URL2(githubHttpsUrl); url.password = token; url.username = "x-access-token"; return url.href; } function getRepositoryGitUrl(config, githubToken) { if (config.useSsh) { return `git@github.com:${config.owner}/${config.name}.git`; } const baseHttpUrl = `https://github.com/${config.owner}/${config.name}.git`; if (githubToken !== void 0) { return addTokenToGitHttpsUrl(baseHttpUrl, githubToken); } return baseHttpUrl; } var GitCommandError = class extends Error { constructor(client, unsanitizedArgs) { super(`Command failed: git ${client.sanitizeConsoleOutput(unsanitizedArgs.join(" "))}`); } }; var GitClient = class _GitClient { constructor(config, baseDir = determineRepoBaseDirFromCwd()) { this.baseDir = baseDir; this.github = new GithubClient(); this.gitBinPath = "git"; this.config = config; this.remoteConfig = config.github; this.remoteParams = { owner: config.github.owner, repo: config.github.name }; this.mainBranchName = config.github.mainBranchName; } run(args, options) { const result = this.runGraceful(args, options); if (result.status !== 0) { throw new GitCommandError(this, args); } return result; } runGraceful(args, options = {}) { const gitCommand = args[0]; if (isDryRun() && gitCommand === "push") { Log.debug(`"git push" is not able to be run in dryRun mode.`); throw new DryRunError(); } args = ["-c", "credential.helper=", ...args]; Log.debug("Executing: git", this.sanitizeConsoleOutput(args.join(" "))); const result = spawnSync2(this.gitBinPath, args, { cwd: this.baseDir, stdio: "pipe", ...options, encoding: "utf8" }); Log.debug(`Status: ${result.status}, Error: ${!!result.error}, Signal: ${result.signal}`); if (result.status !== 0 && result.stderr !== null) { process.stderr.write(this.sanitizeConsoleOutput(result.stderr)); } Log.debug("Stdout:", result.stdout); Log.debug("Stderr:", result.stderr); Log.debug("Process Error:", result.error); if (result.error !== void 0) { process.stderr.write(this.sanitizeConsoleOutput(result.error.message)); } return result; } getRepoGitUrl() { return getRepositoryGitUrl(this.remoteConfig); } hasCommit(branchName, sha) { return this.run(["branch", branchName, "--contains", sha]).stdout !== ""; } isShallowRepo() { return this.run(["rev-parse", "--is-shallow-repository"]).stdout.trim() === "true"; } getCurrentBranchOrRevision() { const branchName = this.run(["rev-parse", "--abbrev-ref", "HEAD"]).stdout.trim(); if (branchName === "HEAD") { return this.run(["rev-parse", "HEAD"]).stdout.trim(); } return branchName; } hasUncommittedChanges() { this.runGraceful(["update-index", "-q", "--refresh"]); return this.runGraceful(["diff-index", "--quiet", "HEAD"]).status !== 0; } checkout(branchOrRevision, cleanState) { if (cleanState) { this.runGraceful(["am", "--abort"], { stdio: "ignore" }); this.runGraceful(["cherry-pick", "--abort"], { stdio: "ignore" }); this.runGraceful(["rebase", "--abort"], { stdio: "ignore" }); this.runGraceful(["reset", "--hard"], { stdio: "ignore" }); } return this.runGraceful(["checkout", branchOrRevision], { stdio: "ignore" }).status === 0; } allChangesFilesSince(shaOrRef = "HEAD") { return Array.from(/* @__PURE__ */ new Set([ ...gitOutputAsArray(this.runGraceful(["diff", "--name-only", "--diff-filter=d", shaOrRef])), ...gitOutputAsArray(this.runGraceful(["ls-files", "--others", "--exclude-standard"])) ])); } allStagedFiles() { return gitOutputAsArray(this.runGraceful(["diff", "--name-only", "--diff-filter=ACM", "--staged"])); } allFiles() { return gitOutputAsArray(this.runGraceful(["ls-files"])); } sanitizeConsoleOutput(value) { return value; } static async get() { if (_GitClient._unauthenticatedInstance === null) { _GitClient._unauthenticatedInstance = (async () => { return new _GitClient(await getConfig([assertValidGithubConfig])); })(); } return _GitClient._unauthenticatedInstance; } }; GitClient._unauthenticatedInstance = null; function gitOutputAsArray(gitCommandResult) { return gitCommandResult.stdout.split("\n").map((x) => x.trim()).filter((x) => !!x); } var findOwnedForksOfRepoQuery = params({ $owner: "String!", $name: "String!" }, { repository: params({ owner: "$owner", name: "$name" }, { forks: params({ affiliations: "OWNER", first: 1, orderBy: { field: "NAME", direction: "ASC" } }, { nodes: [ { owner: { login: types.string }, name: types.string } ] }) }) }); var AuthenticatedGitClient = class _AuthenticatedGitClient extends GitClient { constructor(githubToken, userType, config, baseDir) { super(config, baseDir); this.githubToken = githubToken; this.userType = userType; this._githubTokenRegex = new RegExp(this.githubToken, "g"); this._cachedOauthScopes = null; this._cachedForkRepositories = null; this.github = new AuthenticatedGithubClient(this.githubToken); } sanitizeConsoleOutput(value) { return value.replace(this._githubTokenRegex, ""); } getRepoGitUrl() { return getRepositoryGitUrl(this.remoteConfig, this.githubToken); } async hasOauthScopes(testFn) { if (this.userType === "bot") { return true; } const scopes = await this._fetchAuthScopesForToken(); const missingScopes = []; testFn(scopes, missingScopes); if (missingScopes.length === 0) { return true; } const error2 = `The provided does not have required permissions due to missing scope(s): ${yellow(missingScopes.join(", "))} Update the token in use at: ${GITHUB_TOKEN_SETTINGS_URL} Alternatively, a new token can be created at: ${GITHUB_TOKEN_GENERATE_URL} `; return { error: error2 }; } async getForkOfAuthenticatedUser() { const forks = await this.getAllForksOfAuthenticatedUser(); if (forks.length === 0) { throw Error("Unable to find fork a for currently authenticated user."); } return forks[0]; } async getAllForksOfAuthenticatedUser() { if (this._cachedForkRepositories !== null) { return this._cachedForkRepositories; } const { owner, name } = this.remoteConfig; const result = await this.github.graphql(findOwnedForksOfRepoQuery, { owner, name }); return this._cachedForkRepositories = result.repository.forks.nodes.map((node) => ({ owner: node.owner.login, name: node.name })); } _fetchAuthScopesForToken() { if (this._cachedOauthScopes !== null) { return this._cachedOauthScopes; } return this._cachedOauthScopes = this.github.rateLimit.get().then((response) => { const scopes = response.headers["x-oauth-scopes"]; if (scopes === void 0) { throw Error("Unable to retrieve OAuth scopes for token provided to Git client."); } return scopes.split(",").map((scope) => scope.trim()).filter((scope) => scope !== ""); }); } static async get() { if (_AuthenticatedGitClient._token === null) { throw new Error("No instance of `AuthenticatedGitClient` has been configured."); } if (_AuthenticatedGitClient._authenticatedInstance === null) { _AuthenticatedGitClient._authenticatedInstance = (async (token, userType) => { return new _AuthenticatedGitClient(token, userType, await getConfig([assertValidGithubConfig])); })(_AuthenticatedGitClient._token, _AuthenticatedGitClient._userType); } return _AuthenticatedGitClient._authenticatedInstance; } static configure(token, userType = "user") { if (_AuthenticatedGitClient._token) { throw Error("Unable to configure `AuthenticatedGitClient` as it has been configured already."); } _AuthenticatedGitClient._token = token; _AuthenticatedGitClient._userType = userType; } }; AuthenticatedGitClient._token = null; AuthenticatedGitClient._authenticatedInstance = null; var ReleaseTrain = class { constructor(branchName, version) { this.branchName = branchName; this.version = version; this.isMajor = this.version.minor === 0 && this.version.patch === 0; } }; var import_semver = __toESM2(require_semver2()); var versionBranchNameRegex = /^(\d+)\.(\d+)\.x$/; var exceptionalMinorPackageIndicator = "__ngDevExceptionalMinor__"; async function getVersionInfoForBranch(repo, branchName) { const { data } = await repo.api.repos.getContent({ owner: repo.owner, repo: repo.name, path: "/package.json", ref: branchName }); const content = data.content; if (!content) { throw Error(`Unable to read "package.json" file from repository.`); } const pkgJson = JSON.parse(Buffer.from(content, "base64").toString()); const parsedVersion = import_semver.default.parse(pkgJson.version); if (parsedVersion === null) { throw Error(`Invalid version detected in following branch: ${branchName}.`); } return { version: parsedVersion, isExceptionalMinor: pkgJson[exceptionalMinorPackageIndicator] === true }; } function isVersionBranch(branchName) { return versionBranchNameRegex.test(branchName); } async function getBranchesForMajorVersions(repo, majorVersions) { const branchData = await repo.api.paginate(repo.api.repos.listBranches, { owner: repo.owner, repo: repo.name, protected: true }); const branches = []; for (const { name } of branchData) { if (!isVersionBranch(name)) { continue; } const parsed = convertVersionBranchToSemVer(name); if (parsed !== null && majorVersions.includes(parsed.major)) { branches.push({ name, parsed }); } } return branches.sort((a, b) => import_semver.default.rcompare(a.parsed, b.parsed)); } function convertVersionBranchToSemVer(branchName) { return import_semver.default.parse(branchName.replace(versionBranchNameRegex, "$1.$2.0")); } var import_semver2 = __toESM2(require_semver2()); var ActiveReleaseTrains = class { constructor(trains) { this.trains = trains; this.releaseCandidate = this.trains.releaseCandidate; this.next = this.trains.next; this.latest = this.trains.latest; this.exceptionalMinor = this.trains.exceptionalMinor; } isFeatureFreeze() { return this.releaseCandidate !== null && this.releaseCandidate.version.prerelease[0] === "next"; } static async fetch(repo) { return fetchActiveReleaseTrains(repo); } }; async function fetchActiveReleaseTrains(repo) { const nextBranchName = repo.nextBranchName; const { version: nextVersion } = await getVersionInfoForBranch(repo, nextBranchName); const next = new ReleaseTrain(nextBranchName, nextVersion); const majorVersionsToFetch = []; const checks = { canHaveExceptionalMinor: () => false, isValidReleaseCandidateVersion: () => false, isValidExceptionalMinorVersion: () => false }; if (nextVersion.minor === 0) { majorVersionsToFetch.push(nextVersion.major - 1, nextVersion.major - 2); checks.isValidReleaseCandidateVersion = (v) => v.major === nextVersion.major - 1; checks.canHaveExceptionalMinor = (rc) => rc === null || rc.isMajor; checks.isValidExceptionalMinorVersion = (v, rc) => v.major === (rc === null ? nextVersion.major : rc.version.major) - 1; } else if (nextVersion.minor === 1) { majorVersionsToFetch.push(nextVersion.major, nextVersion.major - 1); checks.isValidReleaseCandidateVersion = (v) => v.major === nextVersion.major; checks.canHaveExceptionalMinor = (rc) => rc !== null && rc.isMajor; checks.isValidExceptionalMinorVersion = (v, rc) => v.major === rc.version.major - 1; } else { majorVersionsToFetch.push(nextVersion.major); checks.isValidReleaseCandidateVersion = (v) => v.major === nextVersion.major; checks.canHaveExceptionalMinor = () => false; } const branches = await getBranchesForMajorVersions(repo, majorVersionsToFetch); const { latest, releaseCandidate, exceptionalMinor } = await findActiveReleaseTrainsFromVersionBranches(repo, next, branches, checks); if (latest === null) { throw Error(`Unable to determine the latest release-train. The following branches have been considered: [${branches.map((b) => b.name).join(", ")}]`); } return new ActiveReleaseTrains({ releaseCandidate, next, latest, exceptionalMinor }); } async function findActiveReleaseTrainsFromVersionBranches(repo, next, branches, checks) { const nextReleaseTrainVersion = import_semver2.default.parse(`${next.version.major}.${next.version.minor}.0`); const nextBranchName = repo.nextBranchName; let latest = null; let releaseCandidate = null; let exceptionalMinor = null; for (const { name, parsed } of branches) { if (import_semver2.default.gt(parsed, nextReleaseTrainVersion)) { throw Error(`Discovered unexpected version-branch "${name}" for a release-train that is more recent than the release-train currently in the "${nextBranchName}" branch. Please either delete the branch if created by accident, or update the outdated version in the next branch (${nextBranchName}).`); } else if (import_semver2.default.eq(parsed, nextReleaseTrainVersion)) { throw Error(`Discovered unexpected version-branch "${name}" for a release-train that is already active in the "${nextBranchName}" branch. Please either delete the branch if created by accident, or update the version in the next branch (${nextBranchName}).`); } const { version, isExceptionalMinor } = await getVersionInfoForBranch(repo, name); const releaseTrain = new ReleaseTrain(name, version); const isPrerelease = version.prerelease[0] === "rc" || version.prerelease[0] === "next"; if (isExceptionalMinor) { if (exceptionalMinor !== null) { throw Error(`Unable to determine latest release-train. Found an additional exceptional minor version branch: "${name}". Already discovered: ${exceptionalMinor.branchName}.`); } if (!checks.canHaveExceptionalMinor(releaseCandidate)) { throw Error(`Unable to determine latest release-train. Found an unexpected exceptional minor version branch: "${name}". No exceptional minor is currently allowed.`); } if (!checks.isValidExceptionalMinorVersion(version, releaseCandidate)) { throw Error(`Unable to determine latest release-train. Found an invalid exceptional minor version branch: "${name}". Invalid version: ${version}.`); } exceptionalMinor = releaseTrain; continue; } if (isPrerelease) { if (exceptionalMinor !== null) { throw Error(`Unable to determine latest release-train. Discovered a feature-freeze/release-candidate version branch (${name}) that is older than an in-progress exceptional minor (${exceptionalMinor.branchName}).`); } if (releaseCandidate !== null) { throw Error(`Unable to determine latest release-train. Found two consecutive pre-release version branches. No exceptional minors are allowed currently, and there cannot be multiple feature-freeze/release-candidate branches: "${name}".`); } if (!checks.isValidReleaseCandidateVersion(version)) { throw Error(`Discovered unexpected old feature-freeze/release-candidate branch. Expected no version-branch in feature-freeze/release-candidate mode for v${version.major}.`); } releaseCandidate = releaseTrain; continue; } latest = releaseTrain; break; } return { releaseCandidate, exceptionalMinor, latest }; } var _npmPackageInfoCache = {}; async function fetchProjectNpmPackageInfo(config) { return await fetchPackageInfoFromNpmRegistry(config.representativeNpmPackage); } async function fetchPackageInfoFromNpmRegistry(pkgName) { if (_npmPackageInfoCache[pkgName] === void 0) { _npmPackageInfoCache[pkgName] = fetch(`https://registry.npmjs.org/${pkgName}`).then((r) => r.json()); } return await _npmPackageInfoCache[pkgName]; } var import_semver3 = __toESM2(require_semver2()); var majorActiveSupportDuration = 6; var majorLongTermSupportDuration = 12; var ltsNpmDistTagRegex = /^v(\d+)-lts$/; async function fetchLongTermSupportBranchesFromNpm(config) { const { "dist-tags": distTags, time } = await fetchProjectNpmPackageInfo(config); const today = /* @__PURE__ */ new Date(); const active = []; const inactive = []; for (const npmDistTag in distTags) { if (isLtsDistTag(npmDistTag)) { const version = import_semver3.default.parse(distTags[npmDistTag]); const branchName = `${version.major}.${version.minor}.x`; const majorReleaseDate = new Date(time[`${version.major}.0.0`]); const ltsEndDate = computeLtsEndDateOfMajor(majorReleaseDate); const ltsBranch = { name: branchName, version, npmDistTag }; if (today <= ltsEndDate) { active.push(ltsBranch); } else { inactive.push(ltsBranch); } } } active.sort((a, b) => import_semver3.default.rcompare(a.version, b.version)); inactive.sort((a, b) => import_semver3.default.rcompare(a.version, b.version)); return { active, inactive }; } function isLtsDistTag(tagName) { return ltsNpmDistTagRegex.test(tagName); } function computeLtsEndDateOfMajor(majorReleaseDate) { return new Date(majorReleaseDate.getFullYear(), majorReleaseDate.getMonth() + majorActiveSupportDuration + majorLongTermSupportDuration, majorReleaseDate.getDate(), majorReleaseDate.getHours(), majorReleaseDate.getMinutes(), majorReleaseDate.getSeconds(), majorReleaseDate.getMilliseconds()); } var ScopeRequirement; (function(ScopeRequirement2) { ScopeRequirement2[ScopeRequirement2["Required"] = 0] = "Required"; ScopeRequirement2[ScopeRequirement2["Optional"] = 1] = "Optional"; ScopeRequirement2[ScopeRequirement2["Forbidden"] = 2] = "Forbidden"; })(ScopeRequirement || (ScopeRequirement = {})); var ReleaseNotesLevel; (function(ReleaseNotesLevel2) { ReleaseNotesLevel2[ReleaseNotesLevel2["Hidden"] = 0] = "Hidden"; ReleaseNotesLevel2[ReleaseNotesLevel2["Visible"] = 1] = "Visible"; })(ReleaseNotesLevel || (ReleaseNotesLevel = {})); var COMMIT_TYPES = { build: { name: "build", description: "Changes to local repository build system and tooling", scope: ScopeRequirement.Optional, releaseNotesLevel: ReleaseNotesLevel.Hidden }, ci: { name: "ci", description: "Changes to CI configuration and CI specific tooling", scope: ScopeRequirement.Forbidden, releaseNotesLevel: ReleaseNotesLevel.Hidden }, docs: { name: "docs", description: "Changes which exclusively affects documentation.", scope: ScopeRequirement.Optional, releaseNotesLevel: ReleaseNotesLevel.Hidden }, feat: { name: "feat", description: "Creates a new feature", scope: ScopeRequirement.Required, releaseNotesLevel: ReleaseNotesLevel.Visible }, fix: { name: "fix", description: "Fixes a previously discovered failure/bug", scope: ScopeRequirement.Required, releaseNotesLevel: ReleaseNotesLevel.Visible }, perf: { name: "perf", description: "Improves performance without any change in functionality or API", scope: ScopeRequirement.Required, releaseNotesLevel: ReleaseNotesLevel.Visible }, refactor: { name: "refactor", description: "Refactor without any change in functionality or API (includes style changes)", scope: ScopeRequirement.Optional, releaseNotesLevel: ReleaseNotesLevel.Hidden }, release: { name: "release", description: "A release point in the repository", scope: ScopeRequirement.Forbidden, releaseNotesLevel: ReleaseNotesLevel.Hidden }, test: { name: "test", description: "Improvements or corrections made to the project's test suite", scope: ScopeRequirement.Optional, releaseNotesLevel: ReleaseNotesLevel.Hidden } }; var createTypedObject = (LabelConstructor) => { return (val) => { for (const key in val) { val[key] = new LabelConstructor(val[key]); } return val; }; }; var Label = class { constructor(params2) { this.params = params2; this.repositories = this.params.repositories || [ ManagedRepositories.ANGULAR, ManagedRepositories.ANGULAR_CLI, ManagedRepositories.COMPONENTS, ManagedRepositories.DEV_INFRA ]; this.name = this.params.name; this.description = this.params.description; this.color = this.params.color; } }; var ManagedRepositories; (function(ManagedRepositories2) { ManagedRepositories2["COMPONENTS"] = "components"; ManagedRepositories2["ANGULAR"] = "angular"; ManagedRepositories2["ANGULAR_CLI"] = "angular-cli"; ManagedRepositories2["DEV_INFRA"] = "dev-infra"; })(ManagedRepositories || (ManagedRepositories = {})); var TargetLabel = class extends Label { constructor() { super(...arguments); this.__hasTargetLabelMarker__ = true; } }; var targetLabels = createTypedObject(TargetLabel)({ TARGET_AUTOMATION: { description: "This PR is targeted to only merge into the branch defined in Github [bot use only]", name: "target: automation" }, TARGET_FEATURE: { description: "This PR is targeted for a feature branch (outside of main and semver branches)", name: "target: feature" }, TARGET_LTS: { description: "This PR is targeting a version currently in long-term support", name: "target: lts" }, TARGET_MAJOR: { description: "This PR is targeted for the next major release", name: "target: major" }, TARGET_MINOR: { description: "This PR is targeted for the next minor release", name: "target: minor" }, TARGET_PATCH: { description: "This PR is targeted for the next patch release", name: "target: patch" }, TARGET_RC: { description: "This PR is targeted for the next release-candidate", name: "target: rc" } }); var ManagedLabel = class extends Label { constructor() { super(...arguments); this.commitCheck = this.params.commitCheck; } }; var managedLabels = createTypedObject(ManagedLabel)({ DETECTED_BREAKING_CHANGE: { description: "PR contains a commit with a breaking change", name: "detected: breaking change", commitCheck: (c) => c.breakingChanges.length !== 0 }, DETECTED_DEPRECATION: { description: "PR contains a commit with a deprecation", name: "detected: deprecation", commitCheck: (c) => c.deprecations.length !== 0 }, DETECTED_FEATURE: { description: "PR contains a feature commit", name: "detected: feature", commitCheck: (c) => c.type === "feat" }, DETECTED_DOCS_CHANGE: { description: "Related to the documentation", name: "area: docs", commitCheck: (c) => c.type === "docs" }, DETECTED_INFRA_CHANGE: { description: "Related the build and CI infrastructure of the project", name: "area: build & ci", commitCheck: (c) => c.type === "build" || c.type === "ci" }, DETECTED_PERF_CHANGE: { description: "Issues related to performance", name: "area: performance", commitCheck: (c) => c.type === "perf" }, DETECTED_HTTP_CHANGE: { description: "Issues related to HTTP and HTTP Client", name: "area: common/http", commitCheck: (c) => c.scope === "common/http" || c.scope === "http", repositories: [ManagedRepositories.ANGULAR] }, DETECTED_COMPILER_CHANGE: { description: "Issues related to `ngc`, Angular's template compiler", name: "area: compiler", commitCheck: (c) => c.scope === "compiler" || c.scope === "compiler-cli", repositories: [ManagedRepositories.ANGULAR] }, DETECTED_PLATFORM_BROWSER_CHANGE: { description: "Issues related to the framework runtime", name: "area: core", commitCheck: (c) => c.scope === "platform-browser" || c.scope === "core" || c.scope === "platform-browser-dynamic", repositories: [ManagedRepositories.ANGULAR] }, DETECTED_PLATFORM_SERVER_CHANGE: { description: "Issues related to server-side rendering", name: "area: server", commitCheck: (c) => c.scope === "platform-server", repositories: [ManagedRepositories.ANGULAR] }, DETECTED_ZONES_CHANGE: { description: "Issues related to zone.js", name: "area: zones", commitCheck: (c) => c.scope === "zone.js", repositories: [ManagedRepositories.ANGULAR] }, DETECTED_LOCALIZE_CHANGE: { description: "Issues related to localization and internationalization", name: "area: i18n", commitCheck: (c) => c.scope === "localize", repositories: [ManagedRepositories.ANGULAR] } }); var ActionLabel = class extends Label { }; var actionLabels = createTypedObject(ActionLabel)({ ACTION_MERGE: { description: "The PR is ready for merge by the caretaker", name: "action: merge" }, ACTION_CLEANUP: { description: "The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews", name: "action: cleanup" }, ACTION_PRESUBMIT: { description: "The PR is in need of a google3 presubmit", name: "action: presubmit" }, ACTION_GLOBAL_PRESUBMIT: { description: "The PR is in need of a google3 global presubmit", name: "action: global presubmit" }, ACTION_REVIEW: { description: "The PR is still awaiting reviews from at least one requested reviewer", name: "action: review" } }); var MergeLabel = class extends Label { }; var mergeLabels = createTypedObject(MergeLabel)({ MERGE_PRESERVE_COMMITS: { description: "When the PR is merged, a rebase and merge should be performed", name: "merge: preserve commits" }, MERGE_SQUASH_COMMITS: { description: "When the PR is merged, a squash and merge should be performed", name: "merge: squash commits" }, MERGE_FIX_COMMIT_MESSAGE: { description: "When the PR is merged, rewrites/fixups of the commit messages are needed", name: "merge: fix commit message", repositories: [ManagedRepositories.COMPONENTS, ManagedRepositories.ANGULAR_CLI] }, MERGE_CARETAKER_NOTE: { description: "Alert the caretaker performing the merge to check the PR for an out of normal action needed or note", name: "merge: caretaker note" } }); var PriorityLabel = class extends Label { }; var priorityLabels = createTypedObject(PriorityLabel)({ P0: { name: "P0", description: "Issue that causes an outage, breakage, or major function to be unusable, with no known workarounds" }, P1: { name: "P1", description: "Impacts a large percentage of users; if a workaround exists it is partial or overly painful" }, P2: { name: "P2", description: "The issue is important to a large percentage of users, with a workaround" }, P3: { name: "P3", description: "An issue that is relevant to core functions, but does not impede progress. Important, but not urgent" }, P4: { name: "P4", description: "A relatively minor issue that is not relevant to core functions" }, P5: { name: "P5", description: "The team acknowledges the request but does not plan to address it, it remains open for discussion" } }); var RequiresLabel = class extends Label { }; var requiresLabels = createTypedObject(RequiresLabel)({ REQUIRES_TGP: { name: "requires: TGP", description: "This PR requires a passing TGP before merging is allowed" } }); var MiscLabel = class extends Label { }; var miscLabels = createTypedObject(MiscLabel)({ FEATURE: { name: "feature", description: "Label used to distinguish feature request from other issues" }, GOOD_FIRST_ISSUE: { name: "good first issue", description: "Label noting a good first issue to be worked on by a community member" }, HELP_WANTED: { name: "help wanted", description: "Label noting an issue which the team is looking for contribution from the community to fix" }, RENOVATE_MANAGED: { name: "renovate managed", description: "Label noting that a pull request will automatically be managed and rebased by renovate" }, GEMINI_TRIAGED: { name: "gemini-triaged", description: "Label noting that an issue has been triaged by gemini" } }); var allLabels = { ...managedLabels, ...actionLabels, ...mergeLabels, ...targetLabels, ...priorityLabels, ...requiresLabels, ...miscLabels }; var import_which = __toESM2(require_lib2()); var import_yaml = __toESM2(require_dist()); // var require6 = __cjsCompatRequire_ngDev5(import.meta.url); // .github/actions/deploy-docs-site/lib/deployments.mjs async function getDeployments() { const { github } = await AuthenticatedGitClient.get(); const releaseTrains = await ActiveReleaseTrains.fetch({ api: github, name: "angular", owner: "angular", nextBranchName: "main" }); const ltsBranches = await fetchLongTermSupportBranchesFromNpm({ representativeNpmPackage: "@angular/core" }); const docSites = /* @__PURE__ */ new Map(); [...ltsBranches.active, ...ltsBranches.inactive].forEach((branch) => { docSites.set(branch.name, { branch: branch.name, destination: `v${branch.version.major}-angular-dev`, servingUrl: `https://v${branch.version.major}.angular.dev/` }); }); docSites.set(releaseTrains.latest.branchName, { branch: releaseTrains.latest.branchName, redirect: { from: `v${releaseTrains.latest.version.major}-angular-dev`, to: "https://angular.dev" }, servingUrl: "https://angular.dev/", destination: "angular-dev-site" }); if (releaseTrains.releaseCandidate) { docSites.set(releaseTrains.next.branchName, { branch: releaseTrains.next.branchName, servingUrl: "https://next.angular.dev/" }); docSites.set(releaseTrains.releaseCandidate.branchName, { branch: releaseTrains.releaseCandidate.branchName, destination: "next-angular-dev", redirect: { from: `v${releaseTrains.releaseCandidate.version.major}-angular-dev`, to: "https://next.angular.dev" }, servingUrl: "https://next.angular.dev/" }); } else { docSites.set(releaseTrains.next.branchName, { branch: releaseTrains.next.branchName, destination: "next-angular-dev", servingUrl: "https://next.angular.dev/" }); } return docSites; } // .github/actions/deploy-docs-site/lib/sitemap.mjs import { join as join4 } from "node:path"; import { readFile as readFile2, writeFile as writeFile4 } from "node:fs/promises"; async function generateSitemap(deployment, distDir) { const lastModifiedTimestamp = (/* @__PURE__ */ new Date()).toISOString(); const { routes } = JSON.parse(await readFile2(join4(distDir, "prerendered-routes.json"), "utf-8")); const routePaths = Object.keys(routes); const sitemap = ` ${routePaths.map((route) => ` ${joinUrlParts(deployment.servingUrl, route)} ${lastModifiedTimestamp} daily 1.0 `).join("")} `; await writeFile4(join4(distDir, "browser", "sitemap.xml"), sitemap, "utf-8"); console.log(`Generated sitemap with ${routePaths.length} entries.`); } function joinUrlParts(...parts) { const normalizeParts = []; for (const part of parts) { if (part === "") { continue; } let normalizedPart = part; if (part[0] === "/") { normalizedPart = normalizedPart.slice(1); } if (part.at(-1) === "/") { normalizedPart = normalizedPart.slice(0, -1); } if (normalizedPart !== "") { normalizeParts.push(normalizedPart); } } return normalizeParts.join("/"); } // .github/actions/deploy-docs-site/lib/main.mts import { spawnSync as spawnSync3 } from "child_process"; import { cp, mkdtemp as mkdtemp2 } from "fs/promises"; import { tmpdir as tmpdir2 } from "os"; import { join as join5 } from "path"; var refMatcher = /refs\/heads\/(.*)/; async function deployDocs() { getConfig([assertValidGithubConfig]); AuthenticatedGitClient.configure(githubReleaseTrainReadToken); if (context2.eventName !== "push") { throw Error(); } const matchedRef = context2.ref.match(refMatcher); if (matchedRef === null) { throw Error(); } const currentBranch = matchedRef[1]; const configPath = getInput("configPath"); const stagingDir = await mkdtemp2(join5(tmpdir2(), "deploy-directory")); await cp(getInput("distDir"), stagingDir, { recursive: true }); spawnSync3(`chmod 777 -R ${stagingDir}`, { encoding: "utf-8", shell: true }); const deployment = (await getDeployments()).get(currentBranch); if (deployment === void 0) { console.log(`Current branch (${currentBranch}) does not deploy a documentation site.`); console.log(`Exiting...`); process.exit(0); } console.log("Doc site deployment information"); console.log(""); console.log("Current Branch:"); console.log(` ${deployment.branch}`); console.log(""); console.log("Firebase Site:"); if (deployment.destination === void 0) { console.log(" No deployment of a documenation site is necessary"); } else { console.log(` Deploying to: ${deployment.destination}`); } console.log(""); console.log("Redirect Configuration:"); if (deployment.redirect === void 0) { console.log(" No redirects are necessary"); } else { console.log(` From: ${deployment.redirect.from}`); console.log(` To: ${deployment.redirect.to}`); } await generateSitemap(deployment, stagingDir); await deployToFirebase(deployment, configPath, stagingDir); await setupRedirect(deployment); } if (context2.repo.owner === "angular") { deployDocs().catch((e) => { setFailed(e.message); console.error(e); }); } else { console.warn( "The action was skipped as this action is only meant to run in repos belonging to the Angular organization." ); } /*! Bundled license information: tmp/lib/tmp.js: (*! * Tmp * * Copyright (c) 2011-2017 KARASZI Istvan * * MIT Licensed *) @octokit/request-error/dist-src/index.js: (* v8 ignore else -- @preserve -- Bug with vitest coverage where it sees an else branch that doesn't exist *) @octokit/request/dist-bundle/index.js: (* v8 ignore next -- @preserve *) (* v8 ignore else -- @preserve *) @angular/ng-dev/bundles/chunk-G7GMCCSS.mjs: (*! Bundled license information: yargs-parser/build/lib/string-utils.js: (** * @license * Copyright (c) 2016, Contributors * SPDX-License-Identifier: ISC *) yargs-parser/build/lib/tokenize-arg-string.js: (** * @license * Copyright (c) 2016, Contributors * SPDX-License-Identifier: ISC *) yargs-parser/build/lib/yargs-parser-types.js: (** * @license * Copyright (c) 2016, Contributors * SPDX-License-Identifier: ISC *) yargs-parser/build/lib/yargs-parser.js: (** * @license * Copyright (c) 2016, Contributors * SPDX-License-Identifier: ISC *) yargs-parser/build/lib/index.js: (** * @fileoverview Main entrypoint for libraries using yargs-parser in Node.js * * @license * Copyright (c) 2016, Contributors * SPDX-License-Identifier: ISC *) *) @angular/ng-dev/bundles/chunk-PTDPQBIK.mjs: (*! Bundled license information: @octokit/request-error/dist-src/index.js: (* v8 ignore else -- @preserve -- Bug with vitest coverage where it sees an else branch that doesn't exist *) @octokit/request/dist-bundle/index.js: (* v8 ignore next -- @preserve *) (* v8 ignore else -- @preserve *) *) */