From a71152e8274c84525d8835ba71448d64d2023702 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Sun, 26 Apr 2026 18:02:55 -0300 Subject: [PATCH 1/2] refactor: drop legacy 'nightly' tag fallback Both goreleaser and goreleaser-pro now publish nightly releases as vX.Y.Z--nightly, so the action no longer needs to special-case or fall back to the moving 'nightly' tag. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- __tests__/github.test.ts | 6 ++---- __tests__/goreleaser.test.ts | 12 ------------ dist/index.js | 2 +- src/github.ts | 14 +++++--------- 4 files changed, 8 insertions(+), 26 deletions(-) diff --git a/__tests__/github.test.ts b/__tests__/github.test.ts index c46910f1..cc386ef1 100644 --- a/__tests__/github.test.ts +++ b/__tests__/github.test.ts @@ -56,12 +56,10 @@ describe('getRelease', () => { expect(release?.tag_name).not.toEqual(''); }); - it('resolves nightly to the legacy nightly tag for OSS GoReleaser', async () => { - // No --nightly release exists in goreleaser/goreleaser yet, - // so this should fall back to the legacy moving `nightly` tag. + it('resolves nightly to a --nightly release for OSS GoReleaser', async () => { const release = await github.getRelease('goreleaser', 'nightly'); expect(release).not.toBeNull(); - expect(release.tag_name).toEqual('nightly'); + expect(release.tag_name).toMatch(github.nightlyTagRegex); }); it('resolves nightly to a --nightly release for GoReleaser Pro', async () => { diff --git a/__tests__/goreleaser.test.ts b/__tests__/goreleaser.test.ts index 9ded6afb..0936c131 100644 --- a/__tests__/goreleaser.test.ts +++ b/__tests__/goreleaser.test.ts @@ -104,18 +104,6 @@ describe('getCertificateIdentity', () => { ); }); - it('uses nightly-oss.yml@refs/heads/main for OSS legacy nightly tag', () => { - expect(goreleaser.getCertificateIdentity('goreleaser', 'nightly')).toEqual( - 'https://github.com/goreleaser/goreleaser/.github/workflows/nightly-oss.yml@refs/heads/main' - ); - }); - - it('uses nightly-pro.yml@refs/heads/main for Pro legacy nightly tag', () => { - expect(goreleaser.getCertificateIdentity('goreleaser-pro', 'nightly')).toEqual( - 'https://github.com/goreleaser/goreleaser-pro-internal/.github/workflows/nightly-pro.yml@refs/heads/main' - ); - }); - it('uses nightly-oss.yml@refs/heads/main for OSS nightly tag', () => { expect(goreleaser.getCertificateIdentity('goreleaser', 'v2.16.0-abc1234-nightly')).toEqual( 'https://github.com/goreleaser/goreleaser/.github/workflows/nightly-oss.yml@refs/heads/main' diff --git a/dist/index.js b/dist/index.js index 1a50f9d6..309913d4 100644 --- a/dist/index.js +++ b/dist/index.js @@ -34,4 +34,4 @@ let x;class YargsParser{constructor(e){x=e}parse(e,t){const A=Object.assign({ali */ var H,G,O;const J=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):20;const V=(G=(H=process===null||process===void 0?void 0:process.versions)===null||H===void 0?void 0:H.node)!==null&&G!==void 0?G:(O=process===null||process===void 0?void 0:process.version)===null||O===void 0?void 0:O.slice(1);if(V){const e=Number(V.match(/^([^.]+)/)[1]);if(eP,format:L.format,normalize:s.normalize,resolve:s.resolve,require:e=>{if(typeof W!=="undefined"){return W(e)}else if(e.match(/\.json$/)){return JSON.parse((0,n.readFileSync)(e,"utf8"))}else{throw Error("only .json config files are supported in ESM")}}});const q=function Parser(e,t){const A=_.parse(e.slice(),t);return A.argv};q.detailed=function(e,t){return _.parse(e.slice(),t)};q.camelCase=camelCase;q.decamelize=decamelize;q.looksLikeNumber=looksLikeNumber;const j=q;function getProcessArgvBinIndex(){if(isBundledElectronApp())return 0;return 1}function isBundledElectronApp(){return isElectronApp()&&!process.defaultApp}function isElectronApp(){return!!process.versions.electron}function hideBin(e){return e.slice(getProcessArgvBinIndex()+1)}function getProcessArgvBin(){return process.argv[getProcessArgvBinIndex()]}const $={fs:{readFileSync:n.readFileSync,writeFile:n.writeFile},format:L.format,resolve:s.resolve,exists:e=>{try{return(0,n.statSync)(e).isFile()}catch(e){return false}}};let z;class Y18N{constructor(e){e=e||{};this.directory=e.directory||"./locales";this.updateFiles=typeof e.updateFiles==="boolean"?e.updateFiles:true;this.locale=e.locale||"en";this.fallbackToLanguage=typeof e.fallbackToLanguage==="boolean"?e.fallbackToLanguage:true;this.cache=Object.create(null);this.writeQueue=[]}__(...e){if(typeof arguments[0]!=="string"){return this._taggedLiteral(arguments[0],...arguments)}const t=e.shift();let cb=function(){};if(typeof e[e.length-1]==="function")cb=e.pop();cb=cb||function(){};if(!this.cache[this.locale])this._readLocaleFile();if(!this.cache[this.locale][t]&&this.updateFiles){this.cache[this.locale][t]=t;this._enqueueWrite({directory:this.directory,locale:this.locale,cb:cb})}else{cb()}return z.format.apply(z.format,[this.cache[this.locale][t]||t].concat(e))}__n(){const e=Array.prototype.slice.call(arguments);const t=e.shift();const A=e.shift();const r=e.shift();let cb=function(){};if(typeof e[e.length-1]==="function")cb=e.pop();if(!this.cache[this.locale])this._readLocaleFile();let n=r===1?t:A;if(this.cache[this.locale][t]){const e=this.cache[this.locale][t];n=e[r===1?"one":"other"]}if(!this.cache[this.locale][t]&&this.updateFiles){this.cache[this.locale][t]={one:t,other:A};this._enqueueWrite({directory:this.directory,locale:this.locale,cb:cb})}else{cb()}const s=[n];if(~n.indexOf("%d"))s.push(r);return z.format.apply(z.format,s.concat(e))}setLocale(e){this.locale=e}getLocale(){return this.locale}updateLocale(e){if(!this.cache[this.locale])this._readLocaleFile();for(const t in e){if(Object.prototype.hasOwnProperty.call(e,t)){this.cache[this.locale][t]=e[t]}}}_taggedLiteral(e,...t){let A="";e.forEach((function(e,r){const n=t[r+1];A+=e;if(typeof n!=="undefined"){A+="%s"}}));return this.__.apply(this,[A].concat([].slice.call(t,1)))}_enqueueWrite(e){this.writeQueue.push(e);if(this.writeQueue.length===1)this._processWriteQueue()}_processWriteQueue(){const e=this;const t=this.writeQueue[0];const A=t.directory;const r=t.locale;const n=t.cb;const s=this._resolveLocaleFile(A,r);const i=JSON.stringify(this.cache[r],null,2);z.fs.writeFile(s,i,"utf-8",(function(t){e.writeQueue.shift();if(e.writeQueue.length>0)e._processWriteQueue();n(t)}))}_readLocaleFile(){let e={};const t=this._resolveLocaleFile(this.directory,this.locale);try{if(z.fs.readFileSync){e=JSON.parse(z.fs.readFileSync(t,"utf-8"))}}catch(A){if(A instanceof SyntaxError){A.message="syntax error in "+t}if(A.code==="ENOENT")e={};else throw A}this.cache[this.locale]=e}_resolveLocaleFile(e,t){let A=z.resolve(e,"./",t+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(A)&&~t.lastIndexOf("_")){const r=z.resolve(e,"./",t.split("_")[0]+".json");if(this._fileExistsSync(r))A=r}return A}_fileExistsSync(e){return z.exists(e)}}function y18n(e,t){z=t;const A=new Y18N(e);return{__:A.__.bind(A),__n:A.__n.bind(A),setLocale:A.setLocale.bind(A),getLocale:A.getLocale.bind(A),updateLocale:A.updateLocale.bind(A),locale:A.locale}}const y18n_y18n=e=>y18n(e,$);const Z=y18n_y18n;var K=__nccwpck_require__(3869);const X=e(import.meta.url)("node:fs");const ee=(0,v.fileURLToPath)(import.meta.url);const te=ee.substring(0,ee.lastIndexOf("node_modules"));const Ae=(0,Y.createRequire)(import.meta.url);const re={assert:{notStrictEqual:i.notStrictEqual,strictEqual:i.strictEqual},cliui:ui,findUp:sync,getEnv:e=>process.env[e],inspect:L.inspect,getProcessArgvBin:getProcessArgvBin,mainFilename:te||process.cwd(),Parser:j,path:{basename:s.basename,dirname:s.dirname,extname:s.extname,relative:s.relative,resolve:s.resolve,join:s.join},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(e,t)=>process.emitWarning(e,t),execPath:()=>process.execPath,exit:e=>{process.exit(e)},nextTick:process.nextTick,stdColumns:typeof process.stdout.columns!=="undefined"?process.stdout.columns:null},readFileSync:X.readFileSync,readdirSync:X.readdirSync,require:Ae,getCallerFile:()=>{const e=K(3);return e.match(/^file:\/\//)?(0,v.fileURLToPath)(e):e},stringWidth:stringWidth,y18n:Z({directory:(0,s.resolve)(ee,"../../../locales"),updateFiles:false})};function assertNotStrictEqual(e,t,A,r){A.assert.notStrictEqual(e,t,r)}function assertSingleKey(e,t){t.assert.strictEqual(typeof e,"string")}function objectKeys(e){return Object.keys(e)}function isPromise(e){return!!e&&!!e.then&&typeof e.then==="function"}class YError extends Error{constructor(e){super(e||"yargs error");this.name="YError";if(Error.captureStackTrace){Error.captureStackTrace(this,YError)}}}function parseCommand(e){const t=e.replace(/\s{2,}/g," ");const A=t.split(/\s+(?![^[]*]|[^<]*>)/);const r=/\.*[\][<>]/g;const n=A.shift();if(!n)throw new Error(`No command found in: ${e}`);const s={cmd:n.replace(r,""),demanded:[],optional:[]};A.forEach(((e,t)=>{let n=false;e=e.replace(/\s/g,"");if(/\.+[\]>]/.test(e)&&t===A.length-1)n=true;if(/^\[/.test(e)){s.optional.push({cmd:e.replace(r,"").split("|"),variadic:n})}else{s.demanded.push({cmd:e.replace(r,"").split("|"),variadic:n})}}));return s}const ne=["first","second","third","fourth","fifth","sixth"];function argsert(e,t,A){function parseArgs(){return typeof e==="object"?[{demanded:[],optional:[]},e,t]:[parseCommand(`cmd ${e}`),t,A]}try{let e=0;const[t,A,r]=parseArgs();const n=[].slice.call(A);while(n.length&&n[n.length-1]===undefined)n.pop();const s=r||n.length;if(si){throw new YError(`Too many arguments provided. Expected max ${i} but received ${s}.`)}t.demanded.forEach((t=>{const A=n.shift();const r=guessType(A);const s=t.cmd.filter((e=>e===r||e==="*"));if(s.length===0)argumentTypeError(r,t.cmd,e);e+=1}));t.optional.forEach((t=>{if(n.length===0)return;const A=n.shift();const r=guessType(A);const s=t.cmd.filter((e=>e===r||e==="*"));if(s.length===0)argumentTypeError(r,t.cmd,e);e+=1}))}catch(e){console.warn(e.stack)}}function guessType(e){if(Array.isArray(e)){return"array"}else if(e===null){return"null"}return typeof e}function argumentTypeError(e,t,A){throw new YError(`Invalid ${ne[A]||"manyith"} argument. Expected ${t.join(" or ")} but received ${e}.`)}class GlobalMiddleware{constructor(e){this.globalMiddleware=[];this.frozens=[];this.yargs=e}addMiddleware(e,t,A=true,r=false){argsert(" [boolean] [boolean] [boolean]",[e,t,A],arguments.length);if(Array.isArray(e)){for(let r=0;r{const r=[...A[t]||[],t];if(!e.option)return true;else return!r.includes(e.option)}));e.option=t;return this.addMiddleware(e,true,true,true)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){const e=this.frozens.pop();if(e!==undefined)this.globalMiddleware=e}reset(){this.globalMiddleware=this.globalMiddleware.filter((e=>e.global))}}function commandMiddlewareFactory(e){if(!e)return[];return e.map((e=>{e.applyBeforeValidation=false;return e}))}function applyMiddleware(e,t,A,r){return A.reduce(((e,A)=>{if(A.applyBeforeValidation!==r){return e}if(A.mutates){if(A.applied)return e;A.applied=true}if(isPromise(e)){return e.then((e=>Promise.all([e,A(e,t)]))).then((([e,t])=>Object.assign(e,t)))}else{const r=A(e,t);return isPromise(r)?r.then((t=>Object.assign(e,t))):Object.assign(e,r)}}),e)}function maybeAsyncResult(e,t,A=e=>{throw e}){try{const A=isFunction(e)?e():e;return isPromise(A)?A.then((e=>t(e))):t(A)}catch(e){return A(e)}}function isFunction(e){return typeof e==="function"}const se=/(^\*)|(^\$0)/;class CommandInstance{constructor(e,t,A,r){this.requireCache=new Set;this.handlers={};this.aliasMap={};this.frozens=[];this.shim=r;this.usage=e;this.globalMiddleware=A;this.validation=t}addDirectory(e,t,A,r){r=r||{};this.requireCache.add(A);const n=this.shim.path.resolve(this.shim.path.dirname(A),e);const s=this.shim.readdirSync(n,{recursive:r.recurse?true:false});if(!Array.isArray(r.extensions))r.extensions=["js"];const i=typeof r.visit==="function"?r.visit:e=>e;for(const e of s){const A=e.toString();if(r.exclude){let e=false;if(typeof r.exclude==="function"){e=r.exclude(A)}else{e=r.exclude.test(A)}if(e)continue}if(r.include){let e=false;if(typeof r.include==="function"){e=r.include(A)}else{e=r.include.test(A)}if(!e)continue}let s=false;for(const e of r.extensions){if(A.endsWith(e))s=true}if(s){const e=this.shim.path.join(n,A);const r=t(e);const s=Object.create(null,Object.getOwnPropertyDescriptors({...r}));const o=i(s,e,A);if(o){if(this.requireCache.has(e))continue;else this.requireCache.add(e);if(!s.command){s.command=this.shim.path.basename(e,this.shim.path.extname(e))}this.addHandler(s)}}}}addHandler(e,t,A,r,n,s){let i=[];const o=commandMiddlewareFactory(n);r=r||(()=>{});if(Array.isArray(e)){if(isCommandAndAliases(e)){[e,...i]=e}else{for(const t of e){this.addHandler(t)}}}else if(isCommandHandlerDefinition(e)){let t=Array.isArray(e.command)||typeof e.command==="string"?e.command:null;if(t===null){throw new Error(`No command name given for module: ${this.shim.inspect(e)}`)}if(e.aliases)t=[].concat(t).concat(e.aliases);this.addHandler(t,this.extractDesc(e),e.builder,e.handler,e.middlewares,e.deprecated);return}else if(isCommandBuilderDefinition(A)){this.addHandler([e].concat(i),t,A.builder,A.handler,A.middlewares,A.deprecated);return}if(typeof e==="string"){const n=parseCommand(e);i=i.map((e=>parseCommand(e).cmd));let a=false;const c=[n.cmd].concat(i).filter((e=>{if(se.test(e)){a=true;return false}return true}));if(c.length===0&&a)c.push("$0");if(a){n.cmd=c[0];i=c.slice(1);e=e.replace(se,n.cmd)}i.forEach((e=>{this.aliasMap[e]=n.cmd}));if(t!==false){this.usage.command(e,t,a,i,s)}this.handlers[n.cmd]={original:e,description:t,handler:r,builder:A||{},middlewares:o,deprecated:s,demanded:n.demanded,optional:n.optional};if(a)this.defaultCommand=this.handlers[n.cmd]}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(e,t,A,r,n,s){const i=this.handlers[e]||this.handlers[this.aliasMap[e]]||this.defaultCommand;const o=t.getInternalMethods().getContext();const a=o.commands.slice();const c=!e;if(e){o.commands.push(e);o.fullCommands.push(i.original)}const l=this.applyBuilderUpdateUsageAndParse(c,i,t,A.aliases,a,r,n,s);return isPromise(l)?l.then((e=>this.applyMiddlewareAndGetResult(c,i,e.innerArgv,o,n,e.aliases,t))):this.applyMiddlewareAndGetResult(c,i,l.innerArgv,o,n,l.aliases,t)}applyBuilderUpdateUsageAndParse(e,t,A,r,n,s,i,o){const a=t.builder;let c=A;if(isCommandBuilderCallback(a)){A.getInternalMethods().getUsageInstance().freeze();const l=a(A.getInternalMethods().reset(r),o);if(isPromise(l)){return l.then((r=>{c=isYargsInstance(r)?r:A;return this.parseAndUpdateUsage(e,t,c,n,s,i)}))}}else if(isCommandBuilderOptionDefinitions(a)){A.getInternalMethods().getUsageInstance().freeze();c=A.getInternalMethods().reset(r);Object.keys(t.builder).forEach((e=>{c.option(e,a[e])}))}return this.parseAndUpdateUsage(e,t,c,n,s,i)}parseAndUpdateUsage(e,t,A,r,n,s){if(e)A.getInternalMethods().getUsageInstance().unfreeze(true);if(this.shouldUpdateUsage(A)){A.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(r,t),t.description)}const i=A.getInternalMethods().runYargsParserAndExecuteCommands(null,undefined,true,n,s);return isPromise(i)?i.then((e=>({aliases:A.parsed.aliases,innerArgv:e}))):{aliases:A.parsed.aliases,innerArgv:i}}shouldUpdateUsage(e){return!e.getInternalMethods().getUsageInstance().getUsageDisabled()&&e.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(e,t){const A=se.test(t.original)?t.original.replace(se,"").trim():t.original;const r=e.filter((e=>!se.test(e)));r.push(A);return`$0 ${r.join(" ")}`}handleValidationAndGetResult(e,t,A,r,n,s,i,o){if(!s.getInternalMethods().getHasOutput()){const t=s.getInternalMethods().runValidation(n,o,s.parsed.error,e);A=maybeAsyncResult(A,(e=>{t(e);return e}))}if(t.handler&&!s.getInternalMethods().getHasOutput()){s.getInternalMethods().setHasOutput();const r=!!s.getOptions().configuration["populate--"];s.getInternalMethods().postProcess(A,r,false,false);A=applyMiddleware(A,s,i,false);A=maybeAsyncResult(A,(e=>{const A=t.handler(e);return isPromise(A)?A.then((()=>e)):e}));if(!e){s.getInternalMethods().getUsageInstance().cacheHelpMessage()}if(isPromise(A)&&!s.getInternalMethods().hasParseCallback()){A.catch((e=>{try{s.getInternalMethods().getUsageInstance().fail(null,e)}catch(e){}}))}}if(!e){r.commands.pop();r.fullCommands.pop()}return A}applyMiddlewareAndGetResult(e,t,A,r,n,s,i){let o={};if(n)return A;if(!i.getInternalMethods().getHasOutput()){o=this.populatePositionals(t,A,r,i)}const a=this.globalMiddleware.getMiddleware().slice(0).concat(t.middlewares);const c=applyMiddleware(A,i,a,true);return isPromise(c)?c.then((A=>this.handleValidationAndGetResult(e,t,A,r,s,i,a,o))):this.handleValidationAndGetResult(e,t,c,r,s,i,a,o)}populatePositionals(e,t,A,r){t._=t._.slice(A.commands.length);const n=e.demanded.slice(0);const s=e.optional.slice(0);const i={};this.validation.positionalCount(n.length,t._.length);while(n.length){const e=n.shift();this.populatePositional(e,t,i)}while(s.length){const e=s.shift();this.populatePositional(e,t,i)}t._=A.commands.concat(t._.map((e=>""+e)));this.postProcessPositionals(t,i,this.cmdToParseOptions(e.original),r);return i}populatePositional(e,t,A){const r=e.cmd[0];if(e.variadic){A[r]=t._.splice(0).map(String)}else{if(t._.length)A[r]=[String(t._.shift())]}}cmdToParseOptions(e){const t={array:[],default:{},alias:{},demand:{}};const A=parseCommand(e);A.demanded.forEach((e=>{const[A,...r]=e.cmd;if(e.variadic){t.array.push(A);t.default[A]=[]}t.alias[A]=r;t.demand[A]=true}));A.optional.forEach((e=>{const[A,...r]=e.cmd;if(e.variadic){t.array.push(A);t.default[A]=[]}t.alias[A]=r}));return t}postProcessPositionals(e,t,A,r){const n=Object.assign({},r.getOptions());n.default=Object.assign(A.default,n.default);for(const e of Object.keys(A.alias)){n.alias[e]=(n.alias[e]||[]).concat(A.alias[e])}n.array=n.array.concat(A.array);n.config={};const s=[];Object.keys(t).forEach((e=>{t[e].map((t=>{if(n.configuration["unknown-options-as-args"])n.key[e]=true;s.push(`--${e}`);s.push(t)}))}));if(!s.length)return;const i=Object.assign({},n.configuration,{"populate--":false});const o=this.shim.Parser.detailed(s,Object.assign({},n,{configuration:i}));if(o.error){r.getInternalMethods().getUsageInstance().fail(o.error.message,o.error)}else{const A=Object.keys(t);Object.keys(t).forEach((e=>{A.push(...o.aliases[e])}));Object.keys(o.argv).forEach((n=>{if(A.includes(n)){if(!t[n])t[n]=o.argv[n];if(!this.isInConfigs(r,n)&&!this.isDefaulted(r,n)&&Object.prototype.hasOwnProperty.call(e,n)&&Object.prototype.hasOwnProperty.call(o.argv,n)&&(Array.isArray(e[n])||Array.isArray(o.argv[n]))){e[n]=[].concat(e[n],o.argv[n])}else{e[n]=o.argv[n]}}}))}}isDefaulted(e,t){const{default:A}=e.getOptions();return Object.prototype.hasOwnProperty.call(A,t)||Object.prototype.hasOwnProperty.call(A,this.shim.Parser.camelCase(t))}isInConfigs(e,t){const{configObjects:A}=e.getOptions();return A.some((e=>Object.prototype.hasOwnProperty.call(e,t)))||A.some((e=>Object.prototype.hasOwnProperty.call(e,this.shim.Parser.camelCase(t))))}runDefaultBuilderOn(e){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(e)){const t=se.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");e.getInternalMethods().getUsageInstance().usage(t,this.defaultCommand.description)}const t=this.defaultCommand.builder;if(isCommandBuilderCallback(t)){return t(e,true)}else if(!isCommandBuilderDefinition(t)){Object.keys(t).forEach((A=>{e.option(A,t[A])}))}return undefined}extractDesc({describe:e,description:t,desc:A}){for(const r of[e,t,A]){if(typeof r==="string"||r===false)return r;assertNotStrictEqual(r,true,this.shim)}return false}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){const e=this.frozens.pop();assertNotStrictEqual(e,undefined,this.shim);({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=e)}reset(){this.handlers={};this.aliasMap={};this.defaultCommand=undefined;this.requireCache=new Set;return this}}function command(e,t,A,r){return new CommandInstance(e,t,A,r)}function isCommandBuilderDefinition(e){return typeof e==="object"&&!!e.builder&&typeof e.handler==="function"}function isCommandAndAliases(e){return e.every((e=>typeof e==="string"))}function isCommandBuilderCallback(e){return typeof e==="function"}function isCommandBuilderOptionDefinitions(e){return typeof e==="object"}function isCommandHandlerDefinition(e){return typeof e==="object"&&!Array.isArray(e)}function objFilter(e={},t=()=>true){const A={};objectKeys(e).forEach((r=>{if(t(r,e[r])){A[r]=e[r]}}));return A}function setBlocking(e){if(typeof process==="undefined")return;[process.stdout,process.stderr].forEach((t=>{const A=t;if(A._handle&&A.isTTY&&typeof A._handle.setBlocking==="function"){A._handle.setBlocking(e)}}))}function isBoolean(e){return typeof e==="boolean"}function usage(e,t){const A=t.y18n.__;const r={};const n=[];r.failFn=function failFn(e){n.push(e)};let s=null;let i=null;let o=true;r.showHelpOnFail=function showHelpOnFailFn(t=true,A){const[n,a]=typeof t==="string"?[true,t]:[t,A];if(e.getInternalMethods().isGlobalContext()){i=a}s=a;o=n;return r};let a=false;r.fail=function fail(t,A){const c=e.getInternalMethods().getLoggerInstance();if(n.length){for(let e=n.length-1;e>=0;--e){const s=n[e];if(isBoolean(s)){if(A)throw A;else if(t)throw Error(t)}else{s(t,A,r)}}}else{if(e.getExitProcess())setBlocking(true);if(!a){a=true;if(o){e.showHelp("error");c.error()}if(t||A)c.error(t||A);const r=s||i;if(r){if(t||A)c.error("");c.error(r)}}A=A||new YError(t);if(e.getExitProcess()){return e.exit(1)}else if(e.getInternalMethods().hasParseCallback()){return e.exit(1,A)}else{throw A}}};let c=[];let l=false;r.usage=(e,t)=>{if(e===null){l=true;c=[];return r}l=false;c.push([e,t||""]);return r};r.getUsage=()=>c;r.getUsageDisabled=()=>l;r.getPositionalGroupName=()=>A("Positionals:");let u=[];r.example=(e,t)=>{u.push([e,t||""])};let g=[];r.command=function command(e,t,A,r,n=false){if(A){g=g.map((e=>{e[2]=false;return e}))}g.push([e,t||"",A,r,n])};r.getCommands=()=>g;let h={};r.describe=function describe(e,t){if(Array.isArray(e)){e.forEach((e=>{r.describe(e,t)}))}else if(typeof e==="object"){Object.keys(e).forEach((t=>{r.describe(t,e[t])}))}else{h[e]=t}};r.getDescriptions=()=>h;let E=[];r.epilog=e=>{E.push(e)};let f=false;let d;r.wrap=e=>{f=true;d=e};r.getWrap=()=>{if(t.getEnv("YARGS_DISABLE_WRAP")){return null}if(!f){d=windowWidth();f=true}return d};const C="__yargsString__:";r.deferY18nLookup=e=>C+e;r.help=function help(){if(Q)return Q;normalizeAliases();const n=e.customScriptName?e.$0:t.path.basename(e.$0);const s=e.getDemandedOptions();const i=e.getDemandedCommands();const o=e.getDeprecatedOptions();const a=e.getGroups();const f=e.getOptions();let d=[];d=d.concat(Object.keys(h));d=d.concat(Object.keys(s));d=d.concat(Object.keys(i));d=d.concat(Object.keys(f.default));d=d.filter(filterHiddenOptions);d=Object.keys(d.reduce(((e,t)=>{if(t!=="_")e[t]=true;return e}),{}));const B=r.getWrap();const I=t.cliui({width:B,wrap:!!B});if(!l){if(c.length){c.forEach((e=>{I.div({text:`${e[0].replace(/\$0/g,n)}`});if(e[1]){I.div({text:`${e[1]}`,padding:[1,0,0,0]})}}));I.div()}else if(g.length){let e=null;if(i._){e=`${n} <${A("command")}>\n`}else{e=`${n} [${A("command")}]\n`}I.div(`${e}`)}}if(g.length>1||g.length===1&&!g[0][2]){I.div(A("Commands:"));const t=e.getInternalMethods().getContext();const r=t.commands.length?`${t.commands.join(" ")} `:"";if(e.getInternalMethods().getParserConfiguration()["sort-commands"]===true){g=g.sort(((e,t)=>e[0].localeCompare(t[0])))}const s=n?`${n} `:"";g.forEach((e=>{const t=`${s}${r}${e[0].replace(/^\$0 ?/,"")}`;I.span({text:t,padding:[0,2,0,2],width:maxWidth(g,B,`${n}${r}`)+4},{text:e[1]});const i=[];if(e[2])i.push(`[${A("default")}]`);if(e[3]&&e[3].length){i.push(`[${A("aliases:")} ${e[3].join(", ")}]`)}if(e[4]){if(typeof e[4]==="string"){i.push(`[${A("deprecated: %s",e[4])}]`)}else{i.push(`[${A("deprecated")}]`)}}if(i.length){I.div({text:i.join(" "),padding:[0,0,0,2],align:"right"})}else{I.div()}}));I.div()}const p=(Object.keys(f.alias)||[]).concat(Object.keys(e.parsed.newAliases)||[]);d=d.filter((t=>!e.parsed.newAliases[t]&&p.every((e=>(f.alias[e]||[]).indexOf(t)===-1))));const D=A("Options:");if(!a[D])a[D]=[];addUngroupedKeys(d,f.alias,a,D);const isLongSwitch=e=>/^--/.test(getText(e));const m=Object.keys(a).filter((e=>a[e].length>0)).map((e=>{const t=a[e].filter(filterHiddenOptions).map((e=>{if(p.includes(e))return e;for(let t=0,A;(A=p[t])!==undefined;t++){if((f.alias[A]||[]).includes(e))return A}return e}));return{groupName:e,normalizedKeys:t}})).filter((({normalizedKeys:e})=>e.length>0)).map((({groupName:e,normalizedKeys:t})=>{const A=t.reduce(((t,A)=>{t[A]=[A].concat(f.alias[A]||[]).map((t=>{if(e===r.getPositionalGroupName())return t;else{return(/^[0-9]$/.test(t)?f.boolean.includes(A)?"-":"--":t.length>1?"--":"-")+t}})).sort(((e,t)=>isLongSwitch(e)===isLongSwitch(t)?0:isLongSwitch(e)?1:-1)).join(", ");return t}),{});return{groupName:e,normalizedKeys:t,switches:A}}));const y=m.filter((({groupName:e})=>e!==r.getPositionalGroupName())).some((({normalizedKeys:e,switches:t})=>!e.every((e=>isLongSwitch(t[e])))));if(y){m.filter((({groupName:e})=>e!==r.getPositionalGroupName())).forEach((({normalizedKeys:e,switches:t})=>{e.forEach((e=>{if(isLongSwitch(t[e])){t[e]=addIndentation(t[e],"-x, ".length)}}))}))}m.forEach((({groupName:t,normalizedKeys:n,switches:i})=>{I.div(t);n.forEach((t=>{const n=i[t];let a=h[t]||"";let c=null;if(a.includes(C))a=A(a.substring(C.length));if(f.boolean.includes(t))c=`[${A("boolean")}]`;if(f.count.includes(t))c=`[${A("count")}]`;if(f.string.includes(t))c=`[${A("string")}]`;if(f.normalize.includes(t))c=`[${A("string")}]`;if(f.array.includes(t))c=`[${A("array")}]`;if(f.number.includes(t))c=`[${A("number")}]`;const deprecatedExtra=e=>typeof e==="string"?`[${A("deprecated: %s",e)}]`:`[${A("deprecated")}]`;const l=[t in o?deprecatedExtra(o[t]):null,c,t in s?`[${A("required")}]`:null,f.choices&&f.choices[t]?`[${A("choices:")} ${r.stringifiedValues(f.choices[t])}]`:null,defaultString(f.default[t],f.defaultDescription[t])].filter(Boolean).join(" ");I.span({text:getText(n),padding:[0,2,0,2+getIndentation(n)],width:maxWidth(i,B)+4},a);const u=e.getInternalMethods().getUsageConfiguration()["hide-types"]===true;if(l&&!u)I.div({text:l,padding:[0,0,0,2],align:"right"});else I.div()}));I.div()}));if(u.length){I.div(A("Examples:"));u.forEach((e=>{e[0]=e[0].replace(/\$0/g,n)}));u.forEach((e=>{if(e[1]===""){I.div({text:e[0],padding:[0,2,0,2]})}else{I.div({text:e[0],padding:[0,2,0,2],width:maxWidth(u,B)+4},{text:e[1]})}}));I.div()}if(E.length>0){const e=E.map((e=>e.replace(/\$0/g,n))).join("\n");I.div(`${e}\n`)}return I.toString().replace(/\s*$/,"")};function maxWidth(e,A,r){let n=0;if(!Array.isArray(e)){e=Object.values(e).map((e=>[e]))}e.forEach((e=>{n=Math.max(t.stringWidth(r?`${r} ${getText(e[0])}`:getText(e[0]))+getIndentation(e[0]),n)}));if(A)n=Math.min(n,parseInt((A*.5).toString(),10));return n}function normalizeAliases(){const t=e.getDemandedOptions();const A=e.getOptions();(Object.keys(A.alias)||[]).forEach((n=>{A.alias[n].forEach((s=>{if(h[s])r.describe(n,h[s]);if(s in t)e.demandOption(n,t[s]);if(A.boolean.includes(s))e.boolean(n);if(A.count.includes(s))e.count(n);if(A.string.includes(s))e.string(n);if(A.normalize.includes(s))e.normalize(n);if(A.array.includes(s))e.array(n);if(A.number.includes(s))e.number(n)}))}))}let Q;r.cacheHelpMessage=function(){Q=this.help()};r.clearCachedHelpMessage=function(){Q=undefined};r.hasCachedHelpMessage=function(){return!!Q};function addUngroupedKeys(e,t,A,r){let n=[];let s=null;Object.keys(A).forEach((e=>{n=n.concat(A[e])}));e.forEach((e=>{s=[e].concat(t[e]);if(!s.some((e=>n.indexOf(e)!==-1))){A[r].push(e)}}));return n}function filterHiddenOptions(t){return e.getOptions().hiddenOptions.indexOf(t)<0||e.parsed.argv[e.getOptions().showHiddenOpt]}r.showHelp=t=>{const A=e.getInternalMethods().getLoggerInstance();if(!t)t="error";const n=typeof t==="function"?t:A[t];n(r.help())};r.functionDescription=e=>{const r=e.name?t.Parser.decamelize(e.name,"-"):A("generated-value");return["(",r,")"].join("")};r.stringifiedValues=function stringifiedValues(e,t){let A="";const r=t||", ";const n=[].concat(e);if(!e||!n.length)return A;n.forEach((e=>{if(A.length)A+=r;A+=JSON.stringify(e)}));return A};function defaultString(e,t){let r=`[${A("default:")} `;if(e===undefined&&!t)return null;if(t){r+=t}else{switch(typeof e){case"string":r+=`"${e}"`;break;case"object":r+=JSON.stringify(e);break;default:r+=e}}return`${r}]`}function windowWidth(){const e=80;if(t.process.stdColumns){return Math.min(e,t.process.stdColumns)}else{return e}}let B=null;r.version=e=>{B=e};r.showVersion=t=>{const A=e.getInternalMethods().getLoggerInstance();if(!t)t="error";const r=typeof t==="function"?t:A[t];r(B)};r.reset=function reset(e){s=null;a=false;c=[];l=false;E=[];u=[];g=[];h=objFilter(h,(t=>!e[t]));return r};const I=[];r.freeze=function freeze(){I.push({failMessage:s,failureOutput:a,usages:c,usageDisabled:l,epilogs:E,examples:u,commands:g,descriptions:h})};r.unfreeze=function unfreeze(e=false){const t=I.pop();if(!t)return;if(e){h={...t.descriptions,...h};g=[...t.commands,...g];c=[...t.usages,...c];u=[...t.examples,...u];E=[...t.epilogs,...E]}else{({failMessage:s,failureOutput:a,usages:c,usageDisabled:l,epilogs:E,examples:u,commands:g,descriptions:h}=t)}};return r}function isIndentedText(e){return typeof e==="object"}function addIndentation(e,t){return isIndentedText(e)?{text:e.text,indentation:e.indentation+t}:{text:e,indentation:t}}function getIndentation(e){return isIndentedText(e)?e.indentation:0}function getText(e){return isIndentedText(e)?e.text:e}const ie=`###-begin-{{app_name}}-completions-###\n#\n# yargs command completion script\n#\n# Installation: {{app_path}} {{completion_command}} >> ~/.bashrc\n# or {{app_path}} {{completion_command}} >> ~/.bash_profile on OSX.\n#\n_{{app_name}}_yargs_completions()\n{\n local cur_word args type_list\n\n cur_word="\${COMP_WORDS[COMP_CWORD]}"\n args=("\${COMP_WORDS[@]}")\n\n # ask yargs to generate completions.\n # see https://stackoverflow.com/a/40944195/7080036 for the spaces-handling awk\n mapfile -t type_list < <({{app_path}} --get-yargs-completions "\${args[@]}")\n mapfile -t COMPREPLY < <(compgen -W "$( printf '%q ' "\${type_list[@]}" )" -- "\${cur_word}" |\n awk '/ / { print "\\""$0"\\"" } /^[^ ]+$/ { print $0 }')\n\n # if no match was found, fall back to filename completion\n if [ \${#COMPREPLY[@]} -eq 0 ]; then\n COMPREPLY=()\n fi\n\n return 0\n}\ncomplete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}}\n###-end-{{app_name}}-completions-###\n`;const oe=`#compdef {{app_name}}\n###-begin-{{app_name}}-completions-###\n#\n# yargs command completion script\n#\n# Installation: {{app_path}} {{completion_command}} >> ~/.zshrc\n# or {{app_path}} {{completion_command}} >> ~/.zprofile on OSX.\n#\n_{{app_name}}_yargs_completions()\n{\n local reply\n local si=$IFS\n IFS=$'\n' reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" {{app_path}} --get-yargs-completions "\${words[@]}"))\n IFS=$si\n if [[ \${#reply} -gt 0 ]]; then\n _describe 'values' reply\n else\n _default\n fi\n}\nif [[ "'\${zsh_eval_context[-1]}" == "loadautofunc" ]]; then\n _{{app_name}}_yargs_completions "$@"\nelse\n compdef _{{app_name}}_yargs_completions {{app_name}}\nfi\n###-end-{{app_name}}-completions-###\n`;class Completion{constructor(e,t,A,r){var n,s,i;this.yargs=e;this.usage=t;this.command=A;this.shim=r;this.completionKey="get-yargs-completions";this.aliases=null;this.customCompletionFunction=null;this.indexAfterLastReset=0;this.zshShell=(i=((n=this.shim.getEnv("SHELL"))===null||n===void 0?void 0:n.includes("zsh"))||((s=this.shim.getEnv("ZSH_NAME"))===null||s===void 0?void 0:s.includes("zsh")))!==null&&i!==void 0?i:false}defaultCompletion(e,t,A,r){const n=this.command.getCommandHandlers();for(let t=0,A=e.length;t{const r=parseCommand(A[0]).cmd;if(t.indexOf(r)===-1){if(!this.zshShell){e.push(r)}else{const t=A[1]||"";e.push(r.replace(/:/g,"\\:")+":"+t)}}}))}}optionCompletions(e,t,A,r){if((r.match(/^-/)||r===""&&e.length===0)&&!this.previousArgHasChoices(t)){const A=this.yargs.getOptions();const n=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(A.key).forEach((s=>{const i=!!A.configuration["boolean-negation"]&&A.boolean.includes(s);const o=n.includes(s);if(!o&&!A.hiddenOptions.includes(s)&&!this.argsContainKey(t,s,i)){this.completeOptionKey(s,e,r,i&&!!A.default[s])}}))}}choicesFromOptionsCompletions(e,t,A,r){if(this.previousArgHasChoices(t)){const A=this.getPreviousArgChoices(t);if(A&&A.length>0){e.push(...A.map((e=>e.replace(/:/g,"\\:"))))}}}choicesFromPositionalsCompletions(e,t,A,r){if(r===""&&e.length>0&&this.previousArgHasChoices(t)){return}const n=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];const s=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1);const i=n[A._.length-s-1];if(!i){return}const o=this.yargs.getOptions().choices[i]||[];for(const t of o){if(t.startsWith(r)){e.push(t.replace(/:/g,"\\:"))}}}getPreviousArgChoices(e){if(e.length<1)return;let t=e[e.length-1];let A="";if(!t.startsWith("-")&&e.length>1){A=t;t=e[e.length-2]}if(!t.startsWith("-"))return;const r=t.replace(/^-+/,"");const n=this.yargs.getOptions();const s=[r,...this.yargs.getAliases()[r]||[]];let i;for(const e of s){if(Object.prototype.hasOwnProperty.call(n.key,e)&&Array.isArray(n.choices[e])){i=n.choices[e];break}}if(i){return i.filter((e=>!A||e.startsWith(A)))}}previousArgHasChoices(e){const t=this.getPreviousArgChoices(e);return t!==undefined&&t.length>0}argsContainKey(e,t,A){const argsContains=t=>e.indexOf((/^[^0-9]$/.test(t)?"-":"--")+t)!==-1;if(argsContains(t))return true;if(A&&argsContains(`no-${t}`))return true;if(this.aliases){for(const e of this.aliases[t]){if(argsContains(e))return true}}return false}completeOptionKey(e,t,A,r){var n,s,i,o;let a=e;if(this.zshShell){const t=this.usage.getDescriptions();const A=(s=(n=this===null||this===void 0?void 0:this.aliases)===null||n===void 0?void 0:n[e])===null||s===void 0?void 0:s.find((e=>{const A=t[e];return typeof A==="string"&&A.length>0}));const r=A?t[A]:undefined;const c=(o=(i=t[e])!==null&&i!==void 0?i:r)!==null&&o!==void 0?o:"";a=`${e.replace(/:/g,"\\:")}:${c.replace("__yargsString__:","").replace(/(\r\n|\n|\r)/gm," ")}`}const startsByTwoDashes=e=>/^--/.test(e);const isShortOption=e=>/^[^0-9]$/.test(e);const c=!startsByTwoDashes(A)&&isShortOption(e)?"-":"--";t.push(c+a);if(r){t.push(c+"no-"+a)}}customCompletion(e,t,A,r){assertNotStrictEqual(this.customCompletionFunction,null,this.shim);if(isSyncCompletionFunction(this.customCompletionFunction)){const e=this.customCompletionFunction(A,t);if(isPromise(e)){return e.then((e=>{this.shim.process.nextTick((()=>{r(null,e)}))})).catch((e=>{this.shim.process.nextTick((()=>{r(e,undefined)}))}))}return r(null,e)}else if(isFallbackCompletionFunction(this.customCompletionFunction)){return this.customCompletionFunction(A,t,((n=r)=>this.defaultCompletion(e,t,A,n)),(e=>{r(null,e)}))}else{return this.customCompletionFunction(A,t,(e=>{r(null,e)}))}}getCompletion(e,t){const A=e.length?e[e.length-1]:"";const r=this.yargs.parse(e,true);const n=this.customCompletionFunction?r=>this.customCompletion(e,r,A,t):r=>this.defaultCompletion(e,r,A,t);return isPromise(r)?r.then(n):n(r)}generateCompletionScript(e,t){let A=this.zshShell?oe:ie;const r=this.shim.path.basename(e);if(e.match(/\.js$/))e=`./${e}`;A=A.replace(/{{app_name}}/g,r);A=A.replace(/{{completion_command}}/g,t);return A.replace(/{{app_path}}/g,e)}registerFunction(e){this.customCompletionFunction=e}setParsed(e){this.aliases=e.aliases}}function completion(e,t,A,r){return new Completion(e,t,A,r)}function isSyncCompletionFunction(e){return e.length<3}function isFallbackCompletionFunction(e){return e.length>3}function levenshtein(e,t){if(e.length===0)return t.length;if(t.length===0)return e.length;const A=[];let r;for(r=0;r<=t.length;r++){A[r]=[r]}let n;for(n=0;n<=e.length;n++){A[0][n]=n}for(r=1;r<=t.length;r++){for(n=1;n<=e.length;n++){if(t.charAt(r-1)===e.charAt(n-1)){A[r][n]=A[r-1][n-1]}else{if(r>1&&n>1&&t.charAt(r-2)===e.charAt(n-1)&&t.charAt(r-1)===e.charAt(n-2)){A[r][n]=A[r-2][n-2]+1}else{A[r][n]=Math.min(A[r-1][n-1]+1,Math.min(A[r][n-1]+1,A[r-1][n]+1))}}}}return A[t.length][e.length]}const ae=["$0","--","_"];function validation(e,t,A){const r=A.y18n.__;const n=A.y18n.__n;const s={};s.nonOptionCount=function nonOptionCount(A){const r=e.getDemandedCommands();const s=A._.length+(A["--"]?A["--"].length:0);const i=s-e.getInternalMethods().getContext().commands.length;if(r._&&(ir._.max)){if(ir._.max){if(r._.maxMsg!==undefined){t.fail(r._.maxMsg?r._.maxMsg.replace(/\$0/g,i.toString()).replace(/\$1/,r._.max.toString()):null)}else{t.fail(n("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",i,i.toString(),r._.max.toString()))}}}};s.positionalCount=function positionalCount(e,A){if(A{if(!ae.includes(t)&&!Object.prototype.hasOwnProperty.call(i,t)&&!Object.prototype.hasOwnProperty.call(e.getInternalMethods().getParseContext(),t)&&!s.isValidAndSomeAliasIsNotNew(t,r)){u.push(t)}}));if(a&&(g.commands.length>0||l.length>0||o)){A._.slice(g.commands.length).forEach((e=>{if(!l.includes(""+e)){u.push(""+e)}}))}if(a){const t=e.getDemandedCommands();const r=((c=t._)===null||c===void 0?void 0:c.max)||0;const n=g.commands.length+r;if(n{e=String(e);if(!g.commands.includes(e)&&!u.includes(e)){u.push(e)}}))}}if(u.length){t.fail(n("Unknown argument: %s","Unknown arguments: %s",u.length,u.map((e=>e.trim()?e:`"${e}"`)).join(", ")))}};s.unknownCommands=function unknownCommands(A){const r=e.getInternalMethods().getCommandInstance().getCommands();const s=[];const i=e.getInternalMethods().getContext();if(i.commands.length>0||r.length>0){A._.slice(i.commands.length).forEach((e=>{if(!r.includes(""+e)){s.push(""+e)}}))}if(s.length>0){t.fail(n("Unknown command: %s","Unknown commands: %s",s.length,s.join(", ")));return true}else{return false}};s.isValidAndSomeAliasIsNotNew=function isValidAndSomeAliasIsNotNew(t,A){if(!Object.prototype.hasOwnProperty.call(A,t)){return false}const r=e.parsed.newAliases;return[t,...A[t]].some((e=>!Object.prototype.hasOwnProperty.call(r,e)||!r[t]))};s.limitedChoices=function limitedChoices(A){const n=e.getOptions();const s={};if(!Object.keys(n.choices).length)return;Object.keys(A).forEach((e=>{if(ae.indexOf(e)===-1&&Object.prototype.hasOwnProperty.call(n.choices,e)){[].concat(A[e]).forEach((t=>{if(n.choices[e].indexOf(t)===-1&&t!==undefined){s[e]=(s[e]||[]).concat(t)}}))}}));const i=Object.keys(s);if(!i.length)return;let o=r("Invalid values:");i.forEach((e=>{o+=`\n ${r("Argument: %s, Given: %s, Choices: %s",e,t.stringifiedValues(s[e]),t.stringifiedValues(n.choices[e]))}`}));t.fail(o)};let i={};s.implies=function implies(t,r){argsert(" [array|number|string]",[t,r],arguments.length);if(typeof t==="object"){Object.keys(t).forEach((e=>{s.implies(e,t[e])}))}else{e.global(t);if(!i[t]){i[t]=[]}if(Array.isArray(r)){r.forEach((e=>s.implies(t,e)))}else{assertNotStrictEqual(r,undefined,A);i[t].push(r)}}};s.getImplied=function getImplied(){return i};function keyExists(e,t){const A=Number(t);t=isNaN(A)?t:A;if(typeof t==="number"){t=e._.length>=t}else if(t.match(/^--no-.+/)){t=t.match(/^--no-(.+)/)[1];t=!Object.prototype.hasOwnProperty.call(e,t)}else{t=Object.prototype.hasOwnProperty.call(e,t)}return t}s.implications=function implications(e){const A=[];Object.keys(i).forEach((t=>{const r=t;(i[t]||[]).forEach((t=>{let n=r;const s=t;n=keyExists(e,n);t=keyExists(e,t);if(n&&!t){A.push(` ${r} -> ${s}`)}}))}));if(A.length){let e=`${r("Implications failed:")}\n`;A.forEach((t=>{e+=t}));t.fail(e)}};let o={};s.conflicts=function conflicts(t,A){argsert(" [array|string]",[t,A],arguments.length);if(typeof t==="object"){Object.keys(t).forEach((e=>{s.conflicts(e,t[e])}))}else{e.global(t);if(!o[t]){o[t]=[]}if(Array.isArray(A)){A.forEach((e=>s.conflicts(t,e)))}else{o[t].push(A)}}};s.getConflicting=()=>o;s.conflicting=function conflictingFn(n){Object.keys(n).forEach((e=>{if(o[e]){o[e].forEach((A=>{if(A&&n[e]!==undefined&&n[A]!==undefined){t.fail(r("Arguments %s and %s are mutually exclusive",e,A))}}))}}));if(e.getInternalMethods().getParserConfiguration()["strip-dashed"]){Object.keys(o).forEach((e=>{o[e].forEach((s=>{if(s&&n[A.Parser.camelCase(e)]!==undefined&&n[A.Parser.camelCase(s)]!==undefined){t.fail(r("Arguments %s and %s are mutually exclusive",e,s))}}))}))}};s.recommendCommands=function recommendCommands(e,A){const n=3;A=A.sort(((e,t)=>t.length-e.length));let s=null;let i=Infinity;for(let t=0,r;(r=A[t])!==undefined;t++){const t=levenshtein(e,r);if(t<=n&&t!e[t]));o=objFilter(o,(t=>!e[t]));return s};const a=[];s.freeze=function freeze(){a.push({implied:i,conflicting:o})};s.unfreeze=function unfreeze(){const e=a.pop();assertNotStrictEqual(e,undefined,A);({implied:i,conflicting:o}=e)};return s}let ce=[];let le;function applyExtends(e,t,A,r){le=r;let n={};if(Object.prototype.hasOwnProperty.call(e,"extends")){if(typeof e.extends!=="string")return n;const s=/\.json|\..*rc$/.test(e.extends);let i=null;if(!s){try{i=import.meta.resolve(e.extends)}catch(t){return e}}else{i=getPathToDefaultConfig(t,e.extends)}checkForCircularExtends(i);ce.push(i);n=s?JSON.parse(le.readFileSync(i,"utf8")):r.require(e.extends);delete e.extends;n=applyExtends(n,le.path.dirname(i),A,le)}ce=[];return A?mergeDeep(n,e):Object.assign({},n,e)}function checkForCircularExtends(e){if(ce.indexOf(e)>-1){throw new YError(`Circular extended configurations: '${e}'.`)}}function getPathToDefaultConfig(e,t){return le.path.resolve(e,t)}function mergeDeep(e,t){const A={};function isObject(e){return e&&typeof e==="object"&&!Array.isArray(e)}Object.assign(A,e);for(const r of Object.keys(t)){if(isObject(t[r])&&isObject(A[r])){A[r]=mergeDeep(e[r],t[r])}else{A[r]=t[r]}}return A}var ue=undefined&&undefined.__classPrivateFieldSet||function(e,t,A,r,n){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof t==="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?n.call(e,A):n?n.value=A:t.set(e,A),A};var ge=undefined&&undefined.__classPrivateFieldGet||function(e,t,A,r){if(A==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t==="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return A==="m"?r:A==="a"?r.call(e):r?r.value:t.get(e)};var he,Ee,fe,de,Ce,Qe,Be,Ie,pe,De,me,ye,we,Fe,be,ke,Re,Se,Ne,Me,Ue,Le,ve,Te,xe,Ye,He,Ge,Oe,Je,Ve,Pe,We,_e,qe;function YargsFactory(e){return(t=[],A=e.process.cwd(),r)=>{const n=new YargsInstance(t,A,r,e);Object.defineProperty(n,"argv",{get:()=>n.parse(),enumerable:true});n.help();n.version();return n}}const je=Symbol("copyDoubleDash");const $e=Symbol("copyDoubleDash");const ze=Symbol("deleteFromParserHintObject");const Ze=Symbol("emitWarning");const Ke=Symbol("freeze");const Xe=Symbol("getDollarZero");const et=Symbol("getParserConfiguration");const tt=Symbol("getUsageConfiguration");const At=Symbol("guessLocale");const rt=Symbol("guessVersion");const nt=Symbol("parsePositionalNumbers");const st=Symbol("pkgUp");const it=Symbol("populateParserHintArray");const ot=Symbol("populateParserHintSingleValueDictionary");const at=Symbol("populateParserHintArrayDictionary");const ct=Symbol("populateParserHintDictionary");const ut=Symbol("sanitizeKey");const ht=Symbol("setKey");const Et=Symbol("unfreeze");const ft=Symbol("validateAsync");const dt=Symbol("getCommandInstance");const Ct=Symbol("getContext");const Qt=Symbol("getHasOutput");const Bt=Symbol("getLoggerInstance");const It=Symbol("getParseContext");const pt=Symbol("getUsageInstance");const Dt=Symbol("getValidationInstance");const mt=Symbol("hasParseCallback");const yt=Symbol("isGlobalContext");const wt=Symbol("postProcess");const Ft=Symbol("rebase");const bt=Symbol("reset");const kt=Symbol("runYargsParserAndExecuteCommands");const Rt=Symbol("runValidation");const St=Symbol("setHasOutput");const Nt=Symbol("kTrackManuallySetKeys");const Mt="en_US";class YargsInstance{constructor(e=[],t,A,r){this.customScriptName=false;this.parsed=false;he.set(this,void 0);Ee.set(this,void 0);fe.set(this,{commands:[],fullCommands:[]});de.set(this,null);Ce.set(this,null);Qe.set(this,"show-hidden");Be.set(this,null);Ie.set(this,true);pe.set(this,{});De.set(this,true);me.set(this,[]);ye.set(this,void 0);we.set(this,{});Fe.set(this,false);be.set(this,null);ke.set(this,true);Re.set(this,void 0);Se.set(this,"");Ne.set(this,void 0);Me.set(this,void 0);Ue.set(this,{});Le.set(this,null);ve.set(this,null);Te.set(this,{});xe.set(this,{});Ye.set(this,void 0);He.set(this,false);Ge.set(this,void 0);Oe.set(this,false);Je.set(this,false);Ve.set(this,false);Pe.set(this,void 0);We.set(this,{});_e.set(this,null);qe.set(this,void 0);ue(this,Ge,r,"f");ue(this,Ye,e,"f");ue(this,Ee,t,"f");ue(this,Me,A,"f");ue(this,ye,new GlobalMiddleware(this),"f");this.$0=this[Xe]();this[bt]();ue(this,he,ge(this,he,"f"),"f");ue(this,Pe,ge(this,Pe,"f"),"f");ue(this,qe,ge(this,qe,"f"),"f");ue(this,Ne,ge(this,Ne,"f"),"f");ge(this,Ne,"f").showHiddenOpt=ge(this,Qe,"f");ue(this,Re,this[$e](),"f");ge(this,Ge,"f").y18n.setLocale(Mt)}addHelpOpt(e,t){const A="help";argsert("[string|boolean] [string]",[e,t],arguments.length);if(ge(this,be,"f")){this[ze](ge(this,be,"f"));ue(this,be,null,"f")}if(e===false&&t===undefined)return this;ue(this,be,typeof e==="string"?e:A,"f");this.boolean(ge(this,be,"f"));this.describe(ge(this,be,"f"),t||ge(this,Pe,"f").deferY18nLookup("Show help"));return this}help(e,t){return this.addHelpOpt(e,t)}addShowHiddenOpt(e,t){argsert("[string|boolean] [string]",[e,t],arguments.length);if(e===false&&t===undefined)return this;const A=typeof e==="string"?e:ge(this,Qe,"f");this.boolean(A);this.describe(A,t||ge(this,Pe,"f").deferY18nLookup("Show hidden options"));ge(this,Ne,"f").showHiddenOpt=A;return this}showHidden(e,t){return this.addShowHiddenOpt(e,t)}alias(e,t){argsert(" [string|array]",[e,t],arguments.length);this[at](this.alias.bind(this),"alias",e,t);return this}array(e){argsert("",[e],arguments.length);this[it]("array",e);this[Nt](e);return this}boolean(e){argsert("",[e],arguments.length);this[it]("boolean",e);this[Nt](e);return this}check(e,t){argsert(" [boolean]",[e,t],arguments.length);this.middleware(((t,A)=>maybeAsyncResult((()=>e(t,A.getOptions())),(A=>{if(!A){ge(this,Pe,"f").fail(ge(this,Ge,"f").y18n.__("Argument check failed: %s",e.toString()))}else if(typeof A==="string"||A instanceof Error){ge(this,Pe,"f").fail(A.toString(),A)}return t}),(e=>{ge(this,Pe,"f").fail(e.message?e.message:e.toString(),e);return t}))),false,t);return this}choices(e,t){argsert(" [string|array]",[e,t],arguments.length);this[at](this.choices.bind(this),"choices",e,t);return this}coerce(e,t){argsert(" [function]",[e,t],arguments.length);if(Array.isArray(e)){if(!t){throw new YError("coerce callback must be provided")}for(const A of e){this.coerce(A,t)}return this}else if(typeof e==="object"){for(const t of Object.keys(e)){this.coerce(t,e[t])}return this}if(!t){throw new YError("coerce callback must be provided")}const A=e;ge(this,Ne,"f").key[A]=true;ge(this,ye,"f").addCoerceMiddleware(((e,r)=>{var n;const s=(n=r.getAliases()[A])!==null&&n!==void 0?n:[];const i=[A,...s].filter((t=>Object.prototype.hasOwnProperty.call(e,t)));if(i.length===0){return e}return maybeAsyncResult((()=>t(e[i[0]])),(t=>{i.forEach((A=>{e[A]=t}));return e}),(e=>{throw new YError(e.message)}))}),A);return this}conflicts(e,t){argsert(" [string|array]",[e,t],arguments.length);ge(this,qe,"f").conflicts(e,t);return this}config(e="config",t,A){argsert("[object|string] [string|function] [function]",[e,t,A],arguments.length);if(typeof e==="object"&&!Array.isArray(e)){e=applyExtends(e,ge(this,Ee,"f"),this[et]()["deep-merge-config"]||false,ge(this,Ge,"f"));ge(this,Ne,"f").configObjects=(ge(this,Ne,"f").configObjects||[]).concat(e);return this}if(typeof t==="function"){A=t;t=undefined}this.describe(e,t||ge(this,Pe,"f").deferY18nLookup("Path to JSON config file"));(Array.isArray(e)?e:[e]).forEach((e=>{ge(this,Ne,"f").config[e]=A||true}));return this}completion(e,t,A){argsert("[string] [string|boolean|function] [function]",[e,t,A],arguments.length);if(typeof t==="function"){A=t;t=undefined}ue(this,Ce,e||ge(this,Ce,"f")||"completion","f");if(!t&&t!==false){t="generate completion script"}this.command(ge(this,Ce,"f"),t);if(A)ge(this,de,"f").registerFunction(A);return this}command(e,t,A,r,n,s){argsert(" [string|boolean] [function|object] [function] [array] [boolean|string]",[e,t,A,r,n,s],arguments.length);ge(this,he,"f").addHandler(e,t,A,r,n,s);return this}commands(e,t,A,r,n,s){return this.command(e,t,A,r,n,s)}commandDir(e,t){argsert(" [object]",[e,t],arguments.length);const A=ge(this,Me,"f")||ge(this,Ge,"f").require;ge(this,he,"f").addDirectory(e,A,ge(this,Ge,"f").getCallerFile(),t);return this}count(e){argsert("",[e],arguments.length);this[it]("count",e);this[Nt](e);return this}default(e,t,A){argsert(" [*] [string]",[e,t,A],arguments.length);if(A){assertSingleKey(e,ge(this,Ge,"f"));ge(this,Ne,"f").defaultDescription[e]=A}if(typeof t==="function"){assertSingleKey(e,ge(this,Ge,"f"));if(!ge(this,Ne,"f").defaultDescription[e])ge(this,Ne,"f").defaultDescription[e]=ge(this,Pe,"f").functionDescription(t);t=t.call()}this[ot](this.default.bind(this),"default",e,t);return this}defaults(e,t,A){return this.default(e,t,A)}demandCommand(e=1,t,A,r){argsert("[number] [number|string] [string|null|undefined] [string|null|undefined]",[e,t,A,r],arguments.length);if(typeof t!=="number"){A=t;t=Infinity}this.global("_",false);ge(this,Ne,"f").demandedCommands._={min:e,max:t,minMsg:A,maxMsg:r};return this}demand(e,t,A){if(Array.isArray(t)){t.forEach((e=>{assertNotStrictEqual(A,true,ge(this,Ge,"f"));this.demandOption(e,A)}));t=Infinity}else if(typeof t!=="number"){A=t;t=Infinity}if(typeof e==="number"){assertNotStrictEqual(A,true,ge(this,Ge,"f"));this.demandCommand(e,t,A,A)}else if(Array.isArray(e)){e.forEach((e=>{assertNotStrictEqual(A,true,ge(this,Ge,"f"));this.demandOption(e,A)}))}else{if(typeof A==="string"){this.demandOption(e,A)}else if(A===true||typeof A==="undefined"){this.demandOption(e)}}return this}demandOption(e,t){argsert(" [string]",[e,t],arguments.length);this[ot](this.demandOption.bind(this),"demandedOptions",e,t);return this}deprecateOption(e,t){argsert(" [string|boolean]",[e,t],arguments.length);ge(this,Ne,"f").deprecatedOptions[e]=t;return this}describe(e,t){argsert(" [string]",[e,t],arguments.length);this[ht](e,true);ge(this,Pe,"f").describe(e,t);return this}detectLocale(e){argsert("",[e],arguments.length);ue(this,Ie,e,"f");return this}env(e){argsert("[string|boolean]",[e],arguments.length);if(e===false)delete ge(this,Ne,"f").envPrefix;else ge(this,Ne,"f").envPrefix=e||"";return this}epilogue(e){argsert("",[e],arguments.length);ge(this,Pe,"f").epilog(e);return this}epilog(e){return this.epilogue(e)}example(e,t){argsert(" [string]",[e,t],arguments.length);if(Array.isArray(e)){e.forEach((e=>this.example(...e)))}else{ge(this,Pe,"f").example(e,t)}return this}exit(e,t){ue(this,Fe,true,"f");ue(this,Be,t,"f");if(ge(this,De,"f"))ge(this,Ge,"f").process.exit(e)}exitProcess(e=true){argsert("[boolean]",[e],arguments.length);ue(this,De,e,"f");return this}fail(e){argsert("",[e],arguments.length);if(typeof e==="boolean"&&e!==false){throw new YError("Invalid first argument. Expected function or boolean 'false'")}ge(this,Pe,"f").failFn(e);return this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(e,t){argsert(" [function]",[e,t],arguments.length);if(!t){return new Promise(((t,A)=>{ge(this,de,"f").getCompletion(e,((e,r)=>{if(e)A(e);else t(r)}))}))}else{return ge(this,de,"f").getCompletion(e,t)}}getDemandedOptions(){argsert([],0);return ge(this,Ne,"f").demandedOptions}getDemandedCommands(){argsert([],0);return ge(this,Ne,"f").demandedCommands}getDeprecatedOptions(){argsert([],0);return ge(this,Ne,"f").deprecatedOptions}getDetectLocale(){return ge(this,Ie,"f")}getExitProcess(){return ge(this,De,"f")}getGroups(){return Object.assign({},ge(this,we,"f"),ge(this,xe,"f"))}getHelp(){ue(this,Fe,true,"f");if(!ge(this,Pe,"f").hasCachedHelpMessage()){if(!this.parsed){const e=this[kt](ge(this,Ye,"f"),undefined,undefined,0,true);if(isPromise(e)){return e.then((()=>ge(this,Pe,"f").help()))}}const e=ge(this,he,"f").runDefaultBuilderOn(this);if(isPromise(e)){return e.then((()=>ge(this,Pe,"f").help()))}}return Promise.resolve(ge(this,Pe,"f").help())}getOptions(){return ge(this,Ne,"f")}getStrict(){return ge(this,Oe,"f")}getStrictCommands(){return ge(this,Je,"f")}getStrictOptions(){return ge(this,Ve,"f")}global(e,t){argsert(" [boolean]",[e,t],arguments.length);e=[].concat(e);if(t!==false){ge(this,Ne,"f").local=ge(this,Ne,"f").local.filter((t=>e.indexOf(t)===-1))}else{e.forEach((e=>{if(!ge(this,Ne,"f").local.includes(e))ge(this,Ne,"f").local.push(e)}))}return this}group(e,t){argsert(" ",[e,t],arguments.length);const A=ge(this,xe,"f")[t]||ge(this,we,"f")[t];if(ge(this,xe,"f")[t]){delete ge(this,xe,"f")[t]}const r={};ge(this,we,"f")[t]=(A||[]).concat(e).filter((e=>{if(r[e])return false;return r[e]=true}));return this}hide(e){argsert("",[e],arguments.length);ge(this,Ne,"f").hiddenOptions.push(e);return this}implies(e,t){argsert(" [number|string|array]",[e,t],arguments.length);ge(this,qe,"f").implies(e,t);return this}locale(e){argsert("[string]",[e],arguments.length);if(e===undefined){this[At]();return ge(this,Ge,"f").y18n.getLocale()}ue(this,Ie,false,"f");ge(this,Ge,"f").y18n.setLocale(e);return this}middleware(e,t,A){return ge(this,ye,"f").addMiddleware(e,!!t,A)}nargs(e,t){argsert(" [number]",[e,t],arguments.length);this[ot](this.nargs.bind(this),"narg",e,t);return this}normalize(e){argsert("",[e],arguments.length);this[it]("normalize",e);return this}number(e){argsert("",[e],arguments.length);this[it]("number",e);this[Nt](e);return this}option(e,t){argsert(" [object]",[e,t],arguments.length);if(typeof e==="object"){Object.keys(e).forEach((t=>{this.options(t,e[t])}))}else{if(typeof t!=="object"){t={}}this[Nt](e);if(ge(this,_e,"f")&&(e==="version"||(t===null||t===void 0?void 0:t.alias)==="version")){this[Ze](['"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"),undefined,"versionWarning")}ge(this,Ne,"f").key[e]=true;if(t.alias)this.alias(e,t.alias);const A=t.deprecate||t.deprecated;if(A){this.deprecateOption(e,A)}const r=t.demand||t.required||t.require;if(r){this.demand(e,r)}if(t.demandOption){this.demandOption(e,typeof t.demandOption==="string"?t.demandOption:undefined)}if(t.conflicts){this.conflicts(e,t.conflicts)}if("default"in t){this.default(e,t.default)}if(t.implies!==undefined){this.implies(e,t.implies)}if(t.nargs!==undefined){this.nargs(e,t.nargs)}if(t.config){this.config(e,t.configParser)}if(t.normalize){this.normalize(e)}if(t.choices){this.choices(e,t.choices)}if(t.coerce){this.coerce(e,t.coerce)}if(t.group){this.group(e,t.group)}if(t.boolean||t.type==="boolean"){this.boolean(e);if(t.alias)this.boolean(t.alias)}if(t.array||t.type==="array"){this.array(e);if(t.alias)this.array(t.alias)}if(t.number||t.type==="number"){this.number(e);if(t.alias)this.number(t.alias)}if(t.string||t.type==="string"){this.string(e);if(t.alias)this.string(t.alias)}if(t.count||t.type==="count"){this.count(e)}if(typeof t.global==="boolean"){this.global(e,t.global)}if(t.defaultDescription){ge(this,Ne,"f").defaultDescription[e]=t.defaultDescription}if(t.skipValidation){this.skipValidation(e)}const n=t.describe||t.description||t.desc;const s=ge(this,Pe,"f").getDescriptions();if(!Object.prototype.hasOwnProperty.call(s,e)||typeof n==="string"){this.describe(e,n)}if(t.hidden){this.hide(e)}if(t.requiresArg){this.requiresArg(e)}}return this}options(e,t){return this.option(e,t)}parse(e,t,A){argsert("[string|array] [function|boolean|object] [function]",[e,t,A],arguments.length);this[Ke]();if(typeof e==="undefined"){e=ge(this,Ye,"f")}if(typeof t==="object"){ue(this,ve,t,"f");t=A}if(typeof t==="function"){ue(this,Le,t,"f");t=false}if(!t)ue(this,Ye,e,"f");if(ge(this,Le,"f"))ue(this,De,false,"f");const r=this[kt](e,!!t);const n=this.parsed;ge(this,de,"f").setParsed(this.parsed);if(isPromise(r)){return r.then((e=>{if(ge(this,Le,"f"))ge(this,Le,"f").call(this,ge(this,Be,"f"),e,ge(this,Se,"f"));return e})).catch((e=>{if(ge(this,Le,"f")){ge(this,Le,"f")(e,this.parsed.argv,ge(this,Se,"f"))}throw e})).finally((()=>{this[Et]();this.parsed=n}))}else{if(ge(this,Le,"f"))ge(this,Le,"f").call(this,ge(this,Be,"f"),r,ge(this,Se,"f"));this[Et]();this.parsed=n}return r}parseAsync(e,t,A){const r=this.parse(e,t,A);return!isPromise(r)?Promise.resolve(r):r}parseSync(e,t,A){const r=this.parse(e,t,A);if(isPromise(r)){throw new YError(".parseSync() must not be used with asynchronous builders, handlers, or middleware")}return r}parserConfiguration(e){argsert("",[e],arguments.length);ue(this,Ue,e,"f");return this}pkgConf(e,t){argsert(" [string]",[e,t],arguments.length);let A=null;const r=this[st](t||ge(this,Ee,"f"));if(r[e]&&typeof r[e]==="object"){A=applyExtends(r[e],t||ge(this,Ee,"f"),this[et]()["deep-merge-config"]||false,ge(this,Ge,"f"));ge(this,Ne,"f").configObjects=(ge(this,Ne,"f").configObjects||[]).concat(A)}return this}positional(e,t){argsert(" ",[e,t],arguments.length);const A=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];t=objFilter(t,((e,t)=>{if(e==="type"&&!["string","number","boolean"].includes(t))return false;return A.includes(e)}));const r=ge(this,fe,"f").fullCommands[ge(this,fe,"f").fullCommands.length-1];const n=r?ge(this,he,"f").cmdToParseOptions(r):{array:[],alias:{},default:{},demand:{}};objectKeys(n).forEach((A=>{const r=n[A];if(Array.isArray(r)){if(r.indexOf(e)!==-1)t[A]=true}else{if(r[e]&&!(A in t))t[A]=r[e]}}));this.group(e,ge(this,Pe,"f").getPositionalGroupName());return this.option(e,t)}recommendCommands(e=true){argsert("[boolean]",[e],arguments.length);ue(this,He,e,"f");return this}required(e,t,A){return this.demand(e,t,A)}require(e,t,A){return this.demand(e,t,A)}requiresArg(e){argsert(" [number]",[e],arguments.length);if(typeof e==="string"&&ge(this,Ne,"f").narg[e]){return this}else{this[ot](this.requiresArg.bind(this),"narg",e,NaN)}return this}showCompletionScript(e,t){argsert("[string] [string]",[e,t],arguments.length);e=e||this.$0;ge(this,Re,"f").log(ge(this,de,"f").generateCompletionScript(e,t||ge(this,Ce,"f")||"completion"));return this}showHelp(e){argsert("[string|function]",[e],arguments.length);ue(this,Fe,true,"f");if(!ge(this,Pe,"f").hasCachedHelpMessage()){if(!this.parsed){const t=this[kt](ge(this,Ye,"f"),undefined,undefined,0,true);if(isPromise(t)){t.then((()=>{ge(this,Pe,"f").showHelp(e)}));return this}}const t=ge(this,he,"f").runDefaultBuilderOn(this);if(isPromise(t)){t.then((()=>{ge(this,Pe,"f").showHelp(e)}));return this}}ge(this,Pe,"f").showHelp(e);return this}scriptName(e){this.customScriptName=true;this.$0=e;return this}showHelpOnFail(e,t){argsert("[boolean|string] [string]",[e,t],arguments.length);ge(this,Pe,"f").showHelpOnFail(e,t);return this}showVersion(e){argsert("[string|function]",[e],arguments.length);ge(this,Pe,"f").showVersion(e);return this}skipValidation(e){argsert("",[e],arguments.length);this[it]("skipValidation",e);return this}strict(e){argsert("[boolean]",[e],arguments.length);ue(this,Oe,e!==false,"f");return this}strictCommands(e){argsert("[boolean]",[e],arguments.length);ue(this,Je,e!==false,"f");return this}strictOptions(e){argsert("[boolean]",[e],arguments.length);ue(this,Ve,e!==false,"f");return this}string(e){argsert("",[e],arguments.length);this[it]("string",e);this[Nt](e);return this}terminalWidth(){argsert([],0);return ge(this,Ge,"f").process.stdColumns}updateLocale(e){return this.updateStrings(e)}updateStrings(e){argsert("",[e],arguments.length);ue(this,Ie,false,"f");ge(this,Ge,"f").y18n.updateLocale(e);return this}usage(e,t,A,r){argsert(" [string|boolean] [function|object] [function]",[e,t,A,r],arguments.length);if(t!==undefined){assertNotStrictEqual(e,null,ge(this,Ge,"f"));if((e||"").match(/^\$0( |$)/)){return this.command(e,t,A,r)}else{throw new YError(".usage() description must start with $0 if being used as alias for .command()")}}else{ge(this,Pe,"f").usage(e);return this}}usageConfiguration(e){argsert("",[e],arguments.length);ue(this,We,e,"f");return this}version(e,t,A){const r="version";argsert("[boolean|string] [string] [string]",[e,t,A],arguments.length);if(ge(this,_e,"f")){this[ze](ge(this,_e,"f"));ge(this,Pe,"f").version(undefined);ue(this,_e,null,"f")}if(arguments.length===0){A=this[rt]();e=r}else if(arguments.length===1){if(e===false){return this}A=e;e=r}else if(arguments.length===2){A=t;t=undefined}ue(this,_e,typeof e==="string"?e:r,"f");t=t||ge(this,Pe,"f").deferY18nLookup("Show version number");ge(this,Pe,"f").version(A||undefined);this.boolean(ge(this,_e,"f"));this.describe(ge(this,_e,"f"),t);return this}wrap(e){argsert("",[e],arguments.length);ge(this,Pe,"f").wrap(e);return this}[(he=new WeakMap,Ee=new WeakMap,fe=new WeakMap,de=new WeakMap,Ce=new WeakMap,Qe=new WeakMap,Be=new WeakMap,Ie=new WeakMap,pe=new WeakMap,De=new WeakMap,me=new WeakMap,ye=new WeakMap,we=new WeakMap,Fe=new WeakMap,be=new WeakMap,ke=new WeakMap,Re=new WeakMap,Se=new WeakMap,Ne=new WeakMap,Me=new WeakMap,Ue=new WeakMap,Le=new WeakMap,ve=new WeakMap,Te=new WeakMap,xe=new WeakMap,Ye=new WeakMap,He=new WeakMap,Ge=new WeakMap,Oe=new WeakMap,Je=new WeakMap,Ve=new WeakMap,Pe=new WeakMap,We=new WeakMap,_e=new WeakMap,qe=new WeakMap,je)](e){if(!e._||!e["--"])return e;e._.push.apply(e._,e["--"]);try{delete e["--"]}catch(e){}return e}[$e](){return{log:(...e)=>{if(!this[mt]())console.log(...e);ue(this,Fe,true,"f");if(ge(this,Se,"f").length)ue(this,Se,ge(this,Se,"f")+"\n","f");ue(this,Se,ge(this,Se,"f")+e.join(" "),"f")},error:(...e)=>{if(!this[mt]())console.error(...e);ue(this,Fe,true,"f");if(ge(this,Se,"f").length)ue(this,Se,ge(this,Se,"f")+"\n","f");ue(this,Se,ge(this,Se,"f")+e.join(" "),"f")}}}[ze](e){objectKeys(ge(this,Ne,"f")).forEach((t=>{if((e=>e==="configObjects")(t))return;const A=ge(this,Ne,"f")[t];if(Array.isArray(A)){if(A.includes(e))A.splice(A.indexOf(e),1)}else if(typeof A==="object"){delete A[e]}}));delete ge(this,Pe,"f").getDescriptions()[e]}[Ze](e,t,A){if(!ge(this,pe,"f")[A]){ge(this,Ge,"f").process.emitWarning(e,t);ge(this,pe,"f")[A]=true}}[Ke](){ge(this,me,"f").push({options:ge(this,Ne,"f"),configObjects:ge(this,Ne,"f").configObjects.slice(0),exitProcess:ge(this,De,"f"),groups:ge(this,we,"f"),strict:ge(this,Oe,"f"),strictCommands:ge(this,Je,"f"),strictOptions:ge(this,Ve,"f"),completionCommand:ge(this,Ce,"f"),output:ge(this,Se,"f"),exitError:ge(this,Be,"f"),hasOutput:ge(this,Fe,"f"),parsed:this.parsed,parseFn:ge(this,Le,"f"),parseContext:ge(this,ve,"f")});ge(this,Pe,"f").freeze();ge(this,qe,"f").freeze();ge(this,he,"f").freeze();ge(this,ye,"f").freeze()}[Xe](){let e="";let t;if(/\b(node|iojs|electron)(\.exe)?$/.test(ge(this,Ge,"f").process.argv()[0])){t=ge(this,Ge,"f").process.argv().slice(1,2)}else{t=ge(this,Ge,"f").process.argv().slice(0,1)}e=t.map((e=>{const t=this[Ft](ge(this,Ee,"f"),e);return e.match(/^(\/|([a-zA-Z]:)?\\)/)&&t.length{if(t.includes("package.json")){return"package.json"}else{return undefined}}));assertNotStrictEqual(r,undefined,ge(this,Ge,"f"));A=JSON.parse(ge(this,Ge,"f").readFileSync(r,"utf8"))}catch(e){}ge(this,Te,"f")[t]=A||{};return ge(this,Te,"f")[t]}[it](e,t){t=[].concat(t);t.forEach((t=>{t=this[ut](t);ge(this,Ne,"f")[e].push(t)}))}[ot](e,t,A,r){this[ct](e,t,A,r,((e,t,A)=>{ge(this,Ne,"f")[e][t]=A}))}[at](e,t,A,r){this[ct](e,t,A,r,((e,t,A)=>{ge(this,Ne,"f")[e][t]=(ge(this,Ne,"f")[e][t]||[]).concat(A)}))}[ct](e,t,A,r,n){if(Array.isArray(A)){A.forEach((t=>{e(t,r)}))}else if((e=>typeof e==="object")(A)){for(const t of objectKeys(A)){e(t,A[t])}}else{n(t,this[ut](A),r)}}[ut](e){if(e==="__proto__")return"___proto___";return e}[ht](e,t){this[ot](this[ht].bind(this),"key",e,t);return this}[Et](){var e,t,A,r,n,s,i,o,a,c,l,u;const g=ge(this,me,"f").pop();assertNotStrictEqual(g,undefined,ge(this,Ge,"f"));let h;e=this,t=this,A=this,r=this,n=this,s=this,i=this,o=this,a=this,c=this,l=this,u=this,({options:{set value(t){ue(e,Ne,t,"f")}}.value,configObjects:h,exitProcess:{set value(e){ue(t,De,e,"f")}}.value,groups:{set value(e){ue(A,we,e,"f")}}.value,output:{set value(e){ue(r,Se,e,"f")}}.value,exitError:{set value(e){ue(n,Be,e,"f")}}.value,hasOutput:{set value(e){ue(s,Fe,e,"f")}}.value,parsed:this.parsed,strict:{set value(e){ue(i,Oe,e,"f")}}.value,strictCommands:{set value(e){ue(o,Je,e,"f")}}.value,strictOptions:{set value(e){ue(a,Ve,e,"f")}}.value,completionCommand:{set value(e){ue(c,Ce,e,"f")}}.value,parseFn:{set value(e){ue(l,Le,e,"f")}}.value,parseContext:{set value(e){ue(u,ve,e,"f")}}.value}=g);ge(this,Ne,"f").configObjects=h;ge(this,Pe,"f").unfreeze();ge(this,qe,"f").unfreeze();ge(this,he,"f").unfreeze();ge(this,ye,"f").unfreeze()}[ft](e,t){return maybeAsyncResult(t,(t=>{e(t);return t}))}getInternalMethods(){return{getCommandInstance:this[dt].bind(this),getContext:this[Ct].bind(this),getHasOutput:this[Qt].bind(this),getLoggerInstance:this[Bt].bind(this),getParseContext:this[It].bind(this),getParserConfiguration:this[et].bind(this),getUsageConfiguration:this[tt].bind(this),getUsageInstance:this[pt].bind(this),getValidationInstance:this[Dt].bind(this),hasParseCallback:this[mt].bind(this),isGlobalContext:this[yt].bind(this),postProcess:this[wt].bind(this),reset:this[bt].bind(this),runValidation:this[Rt].bind(this),runYargsParserAndExecuteCommands:this[kt].bind(this),setHasOutput:this[St].bind(this)}}[dt](){return ge(this,he,"f")}[Ct](){return ge(this,fe,"f")}[Qt](){return ge(this,Fe,"f")}[Bt](){return ge(this,Re,"f")}[It](){return ge(this,ve,"f")||{}}[pt](){return ge(this,Pe,"f")}[Dt](){return ge(this,qe,"f")}[mt](){return!!ge(this,Le,"f")}[yt](){return ge(this,ke,"f")}[wt](e,t,A,r){if(A)return e;if(isPromise(e))return e;if(!t){e=this[je](e)}const n=this[et]()["parse-positional-numbers"]||this[et]()["parse-positional-numbers"]===undefined;if(n){e=this[nt](e)}if(r){e=applyMiddleware(e,this,ge(this,ye,"f").getMiddleware(),false)}return e}[bt](e={}){ue(this,Ne,ge(this,Ne,"f")||{},"f");const t={};t.local=ge(this,Ne,"f").local||[];t.configObjects=ge(this,Ne,"f").configObjects||[];const A={};t.local.forEach((t=>{A[t]=true;(e[t]||[]).forEach((e=>{A[e]=true}))}));Object.assign(ge(this,xe,"f"),Object.keys(ge(this,we,"f")).reduce(((e,t)=>{const r=ge(this,we,"f")[t].filter((e=>!(e in A)));if(r.length>0){e[t]=r}return e}),{}));ue(this,we,{},"f");const r=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"];const n=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];r.forEach((e=>{t[e]=(ge(this,Ne,"f")[e]||[]).filter((e=>!A[e]))}));n.forEach((e=>{t[e]=objFilter(ge(this,Ne,"f")[e],(e=>!A[e]))}));t.envPrefix=ge(this,Ne,"f").envPrefix;ue(this,Ne,t,"f");ue(this,Pe,ge(this,Pe,"f")?ge(this,Pe,"f").reset(A):usage(this,ge(this,Ge,"f")),"f");ue(this,qe,ge(this,qe,"f")?ge(this,qe,"f").reset(A):validation(this,ge(this,Pe,"f"),ge(this,Ge,"f")),"f");ue(this,he,ge(this,he,"f")?ge(this,he,"f").reset():command(ge(this,Pe,"f"),ge(this,qe,"f"),ge(this,ye,"f"),ge(this,Ge,"f")),"f");if(!ge(this,de,"f"))ue(this,de,completion(this,ge(this,Pe,"f"),ge(this,he,"f"),ge(this,Ge,"f")),"f");ge(this,ye,"f").reset();ue(this,Ce,null,"f");ue(this,Se,"","f");ue(this,Be,null,"f");ue(this,Fe,false,"f");this.parsed=false;return this}[Ft](e,t){return ge(this,Ge,"f").path.relative(e,t)}[kt](e,t,A,r=0,n=false){var s,i,o,a;let c=!!A||n;e=e||ge(this,Ye,"f");ge(this,Ne,"f").__=ge(this,Ge,"f").y18n.__;ge(this,Ne,"f").configuration=this[et]();const l=!!ge(this,Ne,"f").configuration["populate--"];const u=Object.assign({},ge(this,Ne,"f").configuration,{"populate--":true});const g=ge(this,Ge,"f").Parser.detailed(e,Object.assign({},ge(this,Ne,"f"),{configuration:{"parse-positional-numbers":false,...u}}));const h=Object.assign(g.argv,ge(this,ve,"f"));let E=undefined;const f=g.aliases;let d=false;let C=false;Object.keys(h).forEach((e=>{if(e===ge(this,be,"f")&&h[e]){d=true}else if(e===ge(this,_e,"f")&&h[e]){C=true}}));h.$0=this.$0;this.parsed=g;if(r===0){ge(this,Pe,"f").clearCachedHelpMessage()}try{this[At]();if(t){return this[wt](h,l,!!A,false)}if(ge(this,be,"f")){const e=[ge(this,be,"f")].concat(f[ge(this,be,"f")]||[]).filter((e=>e.length>1));if(e.includes(""+h._[h._.length-1])){h._.pop();d=true}}ue(this,ke,false,"f");const u=ge(this,he,"f").getCommands();const Q=((s=ge(this,de,"f"))===null||s===void 0?void 0:s.completionKey)?[(i=ge(this,de,"f"))===null||i===void 0?void 0:i.completionKey,...(a=this.getAliases()[(o=ge(this,de,"f"))===null||o===void 0?void 0:o.completionKey])!==null&&a!==void 0?a:[]].some((e=>Object.prototype.hasOwnProperty.call(h,e))):false;const B=d||Q||n;if(h._.length){if(u.length){let e;for(let t=r||0,s;h._[t]!==undefined;t++){s=String(h._[t]);if(u.includes(s)&&s!==ge(this,Ce,"f")){const e=ge(this,he,"f").runCommand(s,this,g,t+1,n,d||C||n);return this[wt](e,l,!!A,false)}else if(!e&&s!==ge(this,Ce,"f")){e=s;break}}if(!ge(this,he,"f").hasDefaultCommand()&&ge(this,He,"f")&&e&&!B){ge(this,qe,"f").recommendCommands(e,u)}}if(ge(this,Ce,"f")&&h._.includes(ge(this,Ce,"f"))&&!Q){if(ge(this,De,"f"))setBlocking(true);this.showCompletionScript();this.exit(0)}}if(ge(this,he,"f").hasDefaultCommand()&&!B){const e=ge(this,he,"f").runCommand(null,this,g,0,n,d||C||n);return this[wt](e,l,!!A,false)}if(Q){if(ge(this,De,"f"))setBlocking(true);e=[].concat(e);const t=e.slice(e.indexOf(`--${ge(this,de,"f").completionKey}`)+1);ge(this,de,"f").getCompletion(t,((e,t)=>{if(e)throw new YError(e.message);(t||[]).forEach((e=>{ge(this,Re,"f").log(e)}));this.exit(0)}));return this[wt](h,!l,!!A,false)}if(!ge(this,Fe,"f")){if(d){if(ge(this,De,"f"))setBlocking(true);c=true;this.showHelp((e=>{ge(this,Re,"f").log(e);this.exit(0)}))}else if(C){if(ge(this,De,"f"))setBlocking(true);c=true;ge(this,Pe,"f").showVersion("log");this.exit(0)}}if(!c&&ge(this,Ne,"f").skipValidation.length>0){c=Object.keys(h).some((e=>ge(this,Ne,"f").skipValidation.indexOf(e)>=0&&h[e]===true))}if(!c){if(g.error)throw new YError(g.error.message);if(!Q){const e=this[Rt](f,{},g.error);if(!A){E=applyMiddleware(h,this,ge(this,ye,"f").getMiddleware(),true)}E=this[ft](e,E!==null&&E!==void 0?E:h);if(isPromise(E)&&!A){E=E.then((()=>applyMiddleware(h,this,ge(this,ye,"f").getMiddleware(),false)))}}}}catch(e){if(e instanceof YError)ge(this,Pe,"f").fail(e.message,e);else throw e}return this[wt](E!==null&&E!==void 0?E:h,l,!!A,true)}[Rt](e,t,A,r){const n={...this.getDemandedOptions()};return s=>{if(A)throw new YError(A.message);ge(this,qe,"f").nonOptionCount(s);ge(this,qe,"f").requiredArguments(s,n);let i=false;if(ge(this,Je,"f")){i=ge(this,qe,"f").unknownCommands(s)}if(ge(this,Oe,"f")&&!i){ge(this,qe,"f").unknownArguments(s,e,t,!!r)}else if(ge(this,Ve,"f")){ge(this,qe,"f").unknownArguments(s,e,{},false,false)}ge(this,qe,"f").limitedChoices(s);ge(this,qe,"f").implications(s);ge(this,qe,"f").conflicting(s)}}[St](){ue(this,Fe,true,"f")}[Nt](e){if(typeof e==="string"){ge(this,Ne,"f").key[e]=true}else{for(const t of e){ge(this,Ne,"f").key[t]=true}}}}function isYargsInstance(e){return!!e&&typeof e.getInternalMethods==="function"}const Ut=YargsFactory(re);const Lt=Ut;const vt=e(import.meta.url)("os");function utils_toCommandValue(e){if(e===null||e===undefined){return""}else if(typeof e==="string"||e instanceof String){return e}return JSON.stringify(e)}function utils_toCommandProperties(e){if(!Object.keys(e).length){return{}}return{title:e.title,file:e.file,line:e.startLine,endLine:e.endLine,col:e.startColumn,endColumn:e.endColumn}}function command_issueCommand(e,t,A){const r=new Command(e,t,A);process.stdout.write(r.toString()+vt.EOL)}function command_issue(e,t=""){command_issueCommand(e,{},t)}const Tt="::";class Command{constructor(e,t,A){if(!e){e="missing.command"}this.command=e;this.properties=t;this.message=A}toString(){let e=Tt+this.command;if(this.properties&&Object.keys(this.properties).length>0){e+=" ";let t=true;for(const A in this.properties){if(this.properties.hasOwnProperty(A)){const r=this.properties[A];if(r){if(t){t=false}else{e+=","}e+=`${A}=${escapeProperty(r)}`}}}}e+=`${Tt}${escapeData(this.message)}`;return e}}function escapeData(e){return utils_toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}function escapeProperty(e){return utils_toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}const xt=e(import.meta.url)("crypto");function file_command_issueFileCommand(e,t){const A=process.env[`GITHUB_${e}`];if(!A){throw new Error(`Unable to find environment variable for file command ${e}`)}if(!n.existsSync(A)){throw new Error(`Missing file at path: ${A}`)}n.appendFileSync(A,`${utils_toCommandValue(t)}${vt.EOL}`,{encoding:"utf8"})}function file_command_prepareKeyValueMessage(e,t){const A=`ghadelimiter_${xt.randomUUID()}`;const r=utils_toCommandValue(t);if(e.includes(A)){throw new Error(`Unexpected input: name should not contain the delimiter "${A}"`)}if(r.includes(A)){throw new Error(`Unexpected input: value should not contain the delimiter "${A}"`)}return`${e}<<${A}${vt.EOL}${r}${vt.EOL}${A}`}var Yt=__nccwpck_require__(8611);var Ht=__nccwpck_require__.t(Yt,2);var Gt=__nccwpck_require__(5692);var Ot=__nccwpck_require__.t(Gt,2);function getProxyUrl(e){const t=e.protocol==="https:";if(checkBypass(e)){return undefined}const A=(()=>{if(t){return process.env["https_proxy"]||process.env["HTTPS_PROXY"]}else{return process.env["http_proxy"]||process.env["HTTP_PROXY"]}})();if(A){try{return new DecodedURL(A)}catch(e){if(!A.startsWith("http://")&&!A.startsWith("https://"))return new DecodedURL(`http://${A}`)}}else{return undefined}}function checkBypass(e){if(!e.hostname){return false}const t=e.hostname;if(isLoopbackAddress(t)){return true}const A=process.env["no_proxy"]||process.env["NO_PROXY"]||"";if(!A){return false}let r;if(e.port){r=Number(e.port)}else if(e.protocol==="http:"){r=80}else if(e.protocol==="https:"){r=443}const n=[e.hostname.toUpperCase()];if(typeof r==="number"){n.push(`${n[0]}:${r}`)}for(const e of A.split(",").map((e=>e.trim().toUpperCase())).filter((e=>e))){if(e==="*"||n.some((t=>t===e||t.endsWith(`.${e}`)||e.startsWith(".")&&t.endsWith(`${e}`)))){return true}}return false}function isLoopbackAddress(e){const t=e.toLowerCase();return t==="localhost"||t.startsWith("127.")||t.startsWith("[::1]")||t.startsWith("[0:0:0:0:0:0:0:1]")}class DecodedURL extends URL{constructor(e,t){super(e,t);this._decodedUsername=decodeURIComponent(super.username);this._decodedPassword=decodeURIComponent(super.password)}get username(){return this._decodedUsername}get password(){return this._decodedPassword}}var Jt=__nccwpck_require__(770);var Vt=__nccwpck_require__(6752);var Pt=undefined&&undefined.__awaiter||function(e,t,A,r){function adopt(e){return e instanceof A?e:new A((function(t){t(e)}))}return new(A||(A=Promise))((function(A,n){function fulfilled(e){try{step(r.next(e))}catch(e){n(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){n(e)}}function step(e){e.done?A(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())}))};var Wt;(function(e){e[e["OK"]=200]="OK";e[e["MultipleChoices"]=300]="MultipleChoices";e[e["MovedPermanently"]=301]="MovedPermanently";e[e["ResourceMoved"]=302]="ResourceMoved";e[e["SeeOther"]=303]="SeeOther";e[e["NotModified"]=304]="NotModified";e[e["UseProxy"]=305]="UseProxy";e[e["SwitchProxy"]=306]="SwitchProxy";e[e["TemporaryRedirect"]=307]="TemporaryRedirect";e[e["PermanentRedirect"]=308]="PermanentRedirect";e[e["BadRequest"]=400]="BadRequest";e[e["Unauthorized"]=401]="Unauthorized";e[e["PaymentRequired"]=402]="PaymentRequired";e[e["Forbidden"]=403]="Forbidden";e[e["NotFound"]=404]="NotFound";e[e["MethodNotAllowed"]=405]="MethodNotAllowed";e[e["NotAcceptable"]=406]="NotAcceptable";e[e["ProxyAuthenticationRequired"]=407]="ProxyAuthenticationRequired";e[e["RequestTimeout"]=408]="RequestTimeout";e[e["Conflict"]=409]="Conflict";e[e["Gone"]=410]="Gone";e[e["TooManyRequests"]=429]="TooManyRequests";e[e["InternalServerError"]=500]="InternalServerError";e[e["NotImplemented"]=501]="NotImplemented";e[e["BadGateway"]=502]="BadGateway";e[e["ServiceUnavailable"]=503]="ServiceUnavailable";e[e["GatewayTimeout"]=504]="GatewayTimeout"})(Wt||(Wt={}));var _t;(function(e){e["Accept"]="accept";e["ContentType"]="content-type"})(_t||(_t={}));var qt;(function(e){e["ApplicationJson"]="application/json"})(qt||(qt={}));function lib_getProxyUrl(e){const t=pm.getProxyUrl(new URL(e));return t?t.href:""}const jt=[Wt.MovedPermanently,Wt.ResourceMoved,Wt.SeeOther,Wt.TemporaryRedirect,Wt.PermanentRedirect];const $t=[Wt.BadGateway,Wt.ServiceUnavailable,Wt.GatewayTimeout];const zt=["OPTIONS","GET","DELETE","HEAD"];const Zt=10;const Kt=5;class HttpClientError extends Error{constructor(e,t){super(e);this.name="HttpClientError";this.statusCode=t;Object.setPrototypeOf(this,HttpClientError.prototype)}}class HttpClientResponse{constructor(e){this.message=e}readBody(){return Pt(this,void 0,void 0,(function*(){return new Promise((e=>Pt(this,void 0,void 0,(function*(){let t=Buffer.alloc(0);this.message.on("data",(e=>{t=Buffer.concat([t,e])}));this.message.on("end",(()=>{e(t.toString())}))}))))}))}readBodyBuffer(){return Pt(this,void 0,void 0,(function*(){return new Promise((e=>Pt(this,void 0,void 0,(function*(){const t=[];this.message.on("data",(e=>{t.push(e)}));this.message.on("end",(()=>{e(Buffer.concat(t))}))}))))}))}}function isHttps(e){const t=new URL(e);return t.protocol==="https:"}class lib_HttpClient{constructor(e,t,A){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(e);this.handlers=t||[];this.requestOptions=A;if(A){if(A.ignoreSslError!=null){this._ignoreSslError=A.ignoreSslError}this._socketTimeout=A.socketTimeout;if(A.allowRedirects!=null){this._allowRedirects=A.allowRedirects}if(A.allowRedirectDowngrade!=null){this._allowRedirectDowngrade=A.allowRedirectDowngrade}if(A.maxRedirects!=null){this._maxRedirects=Math.max(A.maxRedirects,0)}if(A.keepAlive!=null){this._keepAlive=A.keepAlive}if(A.allowRetries!=null){this._allowRetries=A.allowRetries}if(A.maxRetries!=null){this._maxRetries=A.maxRetries}}}options(e,t){return Pt(this,void 0,void 0,(function*(){return this.request("OPTIONS",e,null,t||{})}))}get(e,t){return Pt(this,void 0,void 0,(function*(){return this.request("GET",e,null,t||{})}))}del(e,t){return Pt(this,void 0,void 0,(function*(){return this.request("DELETE",e,null,t||{})}))}post(e,t,A){return Pt(this,void 0,void 0,(function*(){return this.request("POST",e,t,A||{})}))}patch(e,t,A){return Pt(this,void 0,void 0,(function*(){return this.request("PATCH",e,t,A||{})}))}put(e,t,A){return Pt(this,void 0,void 0,(function*(){return this.request("PUT",e,t,A||{})}))}head(e,t){return Pt(this,void 0,void 0,(function*(){return this.request("HEAD",e,null,t||{})}))}sendStream(e,t,A,r){return Pt(this,void 0,void 0,(function*(){return this.request(e,t,A,r)}))}getJson(e){return Pt(this,arguments,void 0,(function*(e,t={}){t[_t.Accept]=this._getExistingOrDefaultHeader(t,_t.Accept,qt.ApplicationJson);const A=yield this.get(e,t);return this._processResponse(A,this.requestOptions)}))}postJson(e,t){return Pt(this,arguments,void 0,(function*(e,t,A={}){const r=JSON.stringify(t,null,2);A[_t.Accept]=this._getExistingOrDefaultHeader(A,_t.Accept,qt.ApplicationJson);A[_t.ContentType]=this._getExistingOrDefaultContentTypeHeader(A,qt.ApplicationJson);const n=yield this.post(e,r,A);return this._processResponse(n,this.requestOptions)}))}putJson(e,t){return Pt(this,arguments,void 0,(function*(e,t,A={}){const r=JSON.stringify(t,null,2);A[_t.Accept]=this._getExistingOrDefaultHeader(A,_t.Accept,qt.ApplicationJson);A[_t.ContentType]=this._getExistingOrDefaultContentTypeHeader(A,qt.ApplicationJson);const n=yield this.put(e,r,A);return this._processResponse(n,this.requestOptions)}))}patchJson(e,t){return Pt(this,arguments,void 0,(function*(e,t,A={}){const r=JSON.stringify(t,null,2);A[_t.Accept]=this._getExistingOrDefaultHeader(A,_t.Accept,qt.ApplicationJson);A[_t.ContentType]=this._getExistingOrDefaultContentTypeHeader(A,qt.ApplicationJson);const n=yield this.patch(e,r,A);return this._processResponse(n,this.requestOptions)}))}request(e,t,A,r){return Pt(this,void 0,void 0,(function*(){if(this._disposed){throw new Error("Client has already been disposed.")}const n=new URL(t);let s=this._prepareRequest(e,n,r);const i=this._allowRetries&&zt.includes(e)?this._maxRetries+1:1;let o=0;let a;do{a=yield this.requestRaw(s,A);if(a&&a.message&&a.message.statusCode===Wt.Unauthorized){let e;for(const t of this.handlers){if(t.canHandleAuthentication(a)){e=t;break}}if(e){return e.handleAuthentication(this,s,A)}else{return a}}let t=this._maxRedirects;while(a.message.statusCode&&jt.includes(a.message.statusCode)&&this._allowRedirects&&t>0){const i=a.message.headers["location"];if(!i){break}const o=new URL(i);if(n.protocol==="https:"&&n.protocol!==o.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 a.readBody();if(o.hostname!==n.hostname){for(const e in r){if(e.toLowerCase()==="authorization"){delete r[e]}}}s=this._prepareRequest(e,o,r);a=yield this.requestRaw(s,A);t--}if(!a.message.statusCode||!$t.includes(a.message.statusCode)){return a}o+=1;if(o{function callbackForResult(e,t){if(e){r(e)}else if(!t){r(new Error("Unknown error"))}else{A(t)}}this.requestRawWithCallback(e,t,callbackForResult)}))}))}requestRawWithCallback(e,t,A){if(typeof t==="string"){if(!e.options.headers){e.options.headers={}}e.options.headers["Content-Length"]=Buffer.byteLength(t,"utf8")}let r=false;function handleResult(e,t){if(!r){r=true;A(e,t)}}const n=e.httpModule.request(e.options,(e=>{const t=new HttpClientResponse(e);handleResult(undefined,t)}));let s;n.on("socket",(e=>{s=e}));n.setTimeout(this._socketTimeout||3*6e4,(()=>{if(s){s.end()}handleResult(new Error(`Request timeout: ${e.options.path}`))}));n.on("error",(function(e){handleResult(e)}));if(t&&typeof t==="string"){n.write(t,"utf8")}if(t&&typeof t!=="string"){t.on("close",(function(){n.end()}));t.pipe(n)}else{n.end()}}getAgent(e){const t=new URL(e);return this._getAgent(t)}getAgentDispatcher(e){const t=new URL(e);const A=getProxyUrl(t);const r=A&&A.hostname;if(!r){return}return this._getProxyAgentDispatcher(t,A)}_prepareRequest(e,t,A){const r={};r.parsedUrl=t;const n=r.parsedUrl.protocol==="https:";r.httpModule=n?Ot:Ht;const s=n?443:80;r.options={};r.options.host=r.parsedUrl.hostname;r.options.port=r.parsedUrl.port?parseInt(r.parsedUrl.port):s;r.options.path=(r.parsedUrl.pathname||"")+(r.parsedUrl.search||"");r.options.method=e;r.options.headers=this._mergeHeaders(A);if(this.userAgent!=null){r.options.headers["user-agent"]=this.userAgent}r.options.agent=this._getAgent(r.parsedUrl);if(this.handlers){for(const e of this.handlers){e.prepareRequest(r.options)}}return r}_mergeHeaders(e){if(this.requestOptions&&this.requestOptions.headers){return Object.assign({},lowercaseKeys(this.requestOptions.headers),lowercaseKeys(e||{}))}return lowercaseKeys(e||{})}_getExistingOrDefaultHeader(e,t,A){let r;if(this.requestOptions&&this.requestOptions.headers){const e=lowercaseKeys(this.requestOptions.headers)[t];if(e){r=typeof e==="number"?e.toString():e}}const n=e[t];if(n!==undefined){return typeof n==="number"?n.toString():n}if(r!==undefined){return r}return A}_getExistingOrDefaultContentTypeHeader(e,t){let A;if(this.requestOptions&&this.requestOptions.headers){const e=lowercaseKeys(this.requestOptions.headers)[_t.ContentType];if(e){if(typeof e==="number"){A=String(e)}else if(Array.isArray(e)){A=e.join(", ")}else{A=e}}}const r=e[_t.ContentType];if(r!==undefined){if(typeof r==="number"){return String(r)}else if(Array.isArray(r)){return r.join(", ")}else{return r}}if(A!==undefined){return A}return t}_getAgent(e){let t;const A=getProxyUrl(e);const r=A&&A.hostname;if(this._keepAlive&&r){t=this._proxyAgent}if(!r){t=this._agent}if(t){return t}const n=e.protocol==="https:";let s=100;if(this.requestOptions){s=this.requestOptions.maxSockets||Yt.globalAgent.maxSockets}if(A&&A.hostname){const e={maxSockets:s,keepAlive:this._keepAlive,proxy:Object.assign(Object.assign({},(A.username||A.password)&&{proxyAuth:`${A.username}:${A.password}`}),{host:A.hostname,port:A.port})};let r;const i=A.protocol==="https:";if(n){r=i?Jt.httpsOverHttps:Jt.httpsOverHttp}else{r=i?Jt.httpOverHttps:Jt.httpOverHttp}t=r(e);this._proxyAgent=t}if(!t){const e={keepAlive:this._keepAlive,maxSockets:s};t=n?new Gt.Agent(e):new Yt.Agent(e);this._agent=t}if(n&&this._ignoreSslError){t.options=Object.assign(t.options||{},{rejectUnauthorized:false})}return t}_getProxyAgentDispatcher(e,t){let A;if(this._keepAlive){A=this._proxyAgentDispatcher}if(A){return A}const r=e.protocol==="https:";A=new Vt.kT(Object.assign({uri:t.href,pipelining:!this._keepAlive?0:1},(t.username||t.password)&&{token:`Basic ${Buffer.from(`${t.username}:${t.password}`).toString("base64")}`}));this._proxyAgentDispatcher=A;if(r&&this._ignoreSslError){A.options=Object.assign(A.options.requestTls||{},{rejectUnauthorized:false})}return A}_getUserAgentWithOrchestrationId(e){const t=e||"actions/http-client";const A=process.env["ACTIONS_ORCHESTRATION_ID"];if(A){const e=A.replace(/[^a-z0-9_.-]/gi,"_");return`${t} actions_orchestration_id/${e}`}return t}_performExponentialBackoff(e){return Pt(this,void 0,void 0,(function*(){e=Math.min(Zt,e);const t=Kt*Math.pow(2,e);return new Promise((e=>setTimeout((()=>e()),t)))}))}_processResponse(e,t){return Pt(this,void 0,void 0,(function*(){return new Promise(((A,r)=>Pt(this,void 0,void 0,(function*(){const n=e.message.statusCode||0;const s={statusCode:n,result:null,headers:{}};if(n===Wt.NotFound){A(s)}function dateTimeDeserializer(e,t){if(typeof t==="string"){const e=new Date(t);if(!isNaN(e.valueOf())){return e}}return t}let i;let o;try{o=yield e.readBody();if(o&&o.length>0){if(t&&t.deserializeDates){i=JSON.parse(o,dateTimeDeserializer)}else{i=JSON.parse(o)}s.result=i}s.headers=e.message.headers}catch(e){}if(n>299){let e;if(i&&i.message){e=i.message}else if(o&&o.length>0){e=o}else{e=`Failed request: (${n})`}const t=new HttpClientError(e,n);t.result=s.result;r(t)}else{A(s)}}))))}))}}const lowercaseKeys=e=>Object.keys(e).reduce(((t,A)=>(t[A.toLowerCase()]=e[A],t)),{});var Xt=undefined&&undefined.__awaiter||function(e,t,A,r){function adopt(e){return e instanceof A?e:new A((function(t){t(e)}))}return new(A||(A=Promise))((function(A,n){function fulfilled(e){try{step(r.next(e))}catch(e){n(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){n(e)}}function step(e){e.done?A(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())}))};class BasicCredentialHandler{constructor(e,t){this.username=e;this.password=t}prepareRequest(e){if(!e.headers){throw Error("The request has no headers")}e.headers["Authorization"]=`Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`}canHandleAuthentication(){return false}handleAuthentication(){return Xt(this,void 0,void 0,(function*(){throw new Error("not implemented")}))}}class auth_BearerCredentialHandler{constructor(e){this.token=e}prepareRequest(e){if(!e.headers){throw Error("The request has no headers")}e.headers["Authorization"]=`Bearer ${this.token}`}canHandleAuthentication(){return false}handleAuthentication(){return Xt(this,void 0,void 0,(function*(){throw new Error("not implemented")}))}}class PersonalAccessTokenCredentialHandler{constructor(e){this.token=e}prepareRequest(e){if(!e.headers){throw Error("The request has no headers")}e.headers["Authorization"]=`Basic ${Buffer.from(`PAT:${this.token}`).toString("base64")}`}canHandleAuthentication(){return false}handleAuthentication(){return Xt(this,void 0,void 0,(function*(){throw new Error("not implemented")}))}}var eA=undefined&&undefined.__awaiter||function(e,t,A,r){function adopt(e){return e instanceof A?e:new A((function(t){t(e)}))}return new(A||(A=Promise))((function(A,n){function fulfilled(e){try{step(r.next(e))}catch(e){n(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){n(e)}}function step(e){e.done?A(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())}))};class oidc_utils_OidcClient{static createHttpClient(e=true,t=10){const A={allowRetries:e,maxRetries:t};return new HttpClient("actions/oidc-client",[new BearerCredentialHandler(oidc_utils_OidcClient.getRequestToken())],A)}static getRequestToken(){const e=process.env["ACTIONS_ID_TOKEN_REQUEST_TOKEN"];if(!e){throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable")}return e}static getIDTokenUrl(){const e=process.env["ACTIONS_ID_TOKEN_REQUEST_URL"];if(!e){throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable")}return e}static getCall(e){return eA(this,void 0,void 0,(function*(){var t;const A=oidc_utils_OidcClient.createHttpClient();const r=yield A.getJson(e).catch((e=>{throw new Error(`Failed to get ID Token. \n \n Error Code : ${e.statusCode}\n \n Error Message: ${e.message}`)}));const n=(t=r.result)===null||t===void 0?void 0:t.value;if(!n){throw new Error("Response json body do not have ID Token field")}return n}))}static getIDToken(e){return eA(this,void 0,void 0,(function*(){try{let t=oidc_utils_OidcClient.getIDTokenUrl();if(e){const A=encodeURIComponent(e);t=`${t}&audience=${A}`}debug(`ID token url is ${t}`);const A=yield oidc_utils_OidcClient.getCall(t);setSecret(A);return A}catch(e){throw new Error(`Error message: ${e.message}`)}}))}}var tA=undefined&&undefined.__awaiter||function(e,t,A,r){function adopt(e){return e instanceof A?e:new A((function(t){t(e)}))}return new(A||(A=Promise))((function(A,n){function fulfilled(e){try{step(r.next(e))}catch(e){n(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){n(e)}}function step(e){e.done?A(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())}))};const{access:AA,appendFile:rA,writeFile:nA}=n.promises;const sA="GITHUB_STEP_SUMMARY";const iA="https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary";class Summary{constructor(){this._buffer=""}filePath(){return tA(this,void 0,void 0,(function*(){if(this._filePath){return this._filePath}const e=process.env[sA];if(!e){throw new Error(`Unable to find environment variable for $${sA}. Check if your runtime environment supports job summaries.`)}try{yield AA(e,n.constants.R_OK|n.constants.W_OK)}catch(t){throw new Error(`Unable to access summary file: '${e}'. Check if the file has correct read/write permissions.`)}this._filePath=e;return this._filePath}))}wrap(e,t,A={}){const r=Object.entries(A).map((([e,t])=>` ${e}="${t}"`)).join("");if(!t){return`<${e}${r}>`}return`<${e}${r}>${t}`}write(e){return tA(this,void 0,void 0,(function*(){const t=!!(e===null||e===void 0?void 0:e.overwrite);const A=yield this.filePath();const r=t?nA:rA;yield r(A,this._buffer,{encoding:"utf8"});return this.emptyBuffer()}))}clear(){return tA(this,void 0,void 0,(function*(){return this.emptyBuffer().write({overwrite:true})}))}stringify(){return this._buffer}isEmptyBuffer(){return this._buffer.length===0}emptyBuffer(){this._buffer="";return this}addRaw(e,t=false){this._buffer+=e;return t?this.addEOL():this}addEOL(){return this.addRaw(vt.EOL)}addCodeBlock(e,t){const A=Object.assign({},t&&{lang:t});const r=this.wrap("pre",this.wrap("code",e),A);return this.addRaw(r).addEOL()}addList(e,t=false){const A=t?"ol":"ul";const r=e.map((e=>this.wrap("li",e))).join("");const n=this.wrap(A,r);return this.addRaw(n).addEOL()}addTable(e){const t=e.map((e=>{const t=e.map((e=>{if(typeof e==="string"){return this.wrap("td",e)}const{header:t,data:A,colspan:r,rowspan:n}=e;const s=t?"th":"td";const i=Object.assign(Object.assign({},r&&{colspan:r}),n&&{rowspan:n});return this.wrap(s,A,i)})).join("");return this.wrap("tr",t)})).join("");const A=this.wrap("table",t);return this.addRaw(A).addEOL()}addDetails(e,t){const A=this.wrap("details",this.wrap("summary",e)+t);return this.addRaw(A).addEOL()}addImage(e,t,A){const{width:r,height:n}=A||{};const s=Object.assign(Object.assign({},r&&{width:r}),n&&{height:n});const i=this.wrap("img",null,Object.assign({src:e,alt:t},s));return this.addRaw(i).addEOL()}addHeading(e,t){const A=`h${t}`;const r=["h1","h2","h3","h4","h5","h6"].includes(A)?A:"h1";const n=this.wrap(r,e);return this.addRaw(n).addEOL()}addSeparator(){const e=this.wrap("hr",null);return this.addRaw(e).addEOL()}addBreak(){const e=this.wrap("br",null);return this.addRaw(e).addEOL()}addQuote(e,t){const A=Object.assign({},t&&{cite:t});const r=this.wrap("blockquote",e,A);return this.addRaw(r).addEOL()}addLink(e,t){const A=this.wrap("a",e,{href:t});return this.addRaw(A).addEOL()}}const oA=new Summary;const aA=null&&oA;const cA=null&&oA;function toPosixPath(e){return e.replace(/[\\]/g,"/")}function toWin32Path(e){return e.replace(/[/]/g,"\\")}function toPlatformPath(e){return e.replace(/[/\\]/g,path.sep)}var lA=__nccwpck_require__(3193);var uA=__nccwpck_require__(4434);const gA=e(import.meta.url)("child_process");var hA=undefined&&undefined.__awaiter||function(e,t,A,r){function adopt(e){return e instanceof A?e:new A((function(t){t(e)}))}return new(A||(A=Promise))((function(A,n){function fulfilled(e){try{step(r.next(e))}catch(e){n(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){n(e)}}function step(e){e.done?A(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())}))};const{chmod:EA,copyFile:fA,lstat:dA,mkdir:CA,open:QA,readdir:BA,rename:IA,rm:pA,rmdir:DA,stat:mA,symlink:yA,unlink:wA}=n.promises;const FA=process.platform==="win32";function readlink(e){return hA(this,void 0,void 0,(function*(){const t=yield n.promises.readlink(e);if(FA&&!t.endsWith("\\")){return`${t}\\`}return t}))}const bA=268435456;const kA=n.constants.O_RDONLY;function exists(e){return hA(this,void 0,void 0,(function*(){try{yield mA(e)}catch(e){if(e.code==="ENOENT"){return false}throw e}return true}))}function isDirectory(e){return hA(this,arguments,void 0,(function*(e,t=false){const A=t?yield mA(e):yield dA(e);return A.isDirectory()}))}function isRooted(e){e=normalizeSeparators(e);if(!e){throw new Error('isRooted() parameter "p" cannot be empty')}if(FA){return e.startsWith("\\")||/^[A-Z]:/i.test(e)}return e.startsWith("/")}function tryGetExecutablePath(e,t){return hA(this,void 0,void 0,(function*(){let A=undefined;try{A=yield mA(e)}catch(t){if(t.code!=="ENOENT"){console.log(`Unexpected error attempting to determine if executable file exists '${e}': ${t}`)}}if(A&&A.isFile()){if(FA){const A=s.extname(e).toUpperCase();if(t.some((e=>e.toUpperCase()===A))){return e}}else{if(isUnixExecutable(A)){return e}}}const r=e;for(const n of t){e=r+n;A=undefined;try{A=yield mA(e)}catch(t){if(t.code!=="ENOENT"){console.log(`Unexpected error attempting to determine if executable file exists '${e}': ${t}`)}}if(A&&A.isFile()){if(FA){try{const t=s.dirname(e);const A=s.basename(e).toUpperCase();for(const r of yield BA(t)){if(A===r.toUpperCase()){e=s.join(t,r);break}}}catch(t){console.log(`Unexpected error attempting to determine the actual case of the file '${e}': ${t}`)}return e}else{if(isUnixExecutable(A)){return e}}}}return""}))}function normalizeSeparators(e){e=e||"";if(FA){e=e.replace(/\//g,"\\");return e.replace(/\\\\+/g,"\\")}return e.replace(/\/\/+/g,"/")}function isUnixExecutable(e){return(e.mode&1)>0||(e.mode&8)>0&&process.getgid!==undefined&&e.gid===process.getgid()||(e.mode&64)>0&&process.getuid!==undefined&&e.uid===process.getuid()}function getCmdPath(){var e;return(e=process.env["COMSPEC"])!==null&&e!==void 0?e:`cmd.exe`}var RA=undefined&&undefined.__awaiter||function(e,t,A,r){function adopt(e){return e instanceof A?e:new A((function(t){t(e)}))}return new(A||(A=Promise))((function(A,n){function fulfilled(e){try{step(r.next(e))}catch(e){n(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){n(e)}}function step(e){e.done?A(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())}))};function io_cp(e,t){return RA(this,arguments,void 0,(function*(e,t,A={}){const{force:r,recursive:n,copySourceDirectory:i}=readCopyOptions(A);const o=(yield exists(t))?yield mA(t):null;if(o&&o.isFile()&&!r){return}const a=o&&o.isDirectory()&&i?s.join(t,s.basename(e)):t;if(!(yield exists(e))){throw new Error(`no such file or directory: ${e}`)}const c=yield mA(e);if(c.isDirectory()){if(!n){throw new Error(`Failed to copy. ${e} is a directory, but tried to copy without recursive flag.`)}else{yield cpDirRecursive(e,a,0,r)}}else{if(s.relative(e,a)===""){throw new Error(`'${a}' and '${e}' are the same file`)}yield io_copyFile(e,a,r)}}))}function mv(e,t){return RA(this,arguments,void 0,(function*(e,t,A={}){if(yield ioUtil.exists(t)){let r=true;if(yield ioUtil.isDirectory(t)){t=path.join(t,path.basename(e));r=yield ioUtil.exists(t)}if(r){if(A.force==null||A.force){yield rmRF(t)}else{throw new Error("Destination already exists")}}}yield mkdirP(path.dirname(t));yield ioUtil.rename(e,t)}))}function rmRF(e){return RA(this,void 0,void 0,(function*(){if(FA){if(/[*"<>|]/.test(e)){throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows')}}try{yield pA(e,{force:true,maxRetries:3,recursive:true,retryDelay:300})}catch(e){throw new Error(`File was unable to be removed ${e}`)}}))}function mkdirP(e){return RA(this,void 0,void 0,(function*(){(0,i.ok)(e,"a path argument must be provided");yield CA(e,{recursive:true})}))}function which(e,t){return RA(this,void 0,void 0,(function*(){if(!e){throw new Error("parameter 'tool' is required")}if(t){const t=yield which(e,false);if(!t){if(FA){throw new Error(`Unable to locate executable file: ${e}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`)}else{throw new Error(`Unable to locate executable file: ${e}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`)}}return t}const A=yield findInPath(e);if(A&&A.length>0){return A[0]}return""}))}function findInPath(e){return RA(this,void 0,void 0,(function*(){if(!e){throw new Error("parameter 'tool' is required")}const t=[];if(FA&&process.env["PATHEXT"]){for(const e of process.env["PATHEXT"].split(s.delimiter)){if(e){t.push(e)}}}if(isRooted(e)){const A=yield tryGetExecutablePath(e,t);if(A){return[A]}return[]}if(e.includes(s.sep)){return[]}const A=[];if(process.env.PATH){for(const e of process.env.PATH.split(s.delimiter)){if(e){A.push(e)}}}const r=[];for(const n of A){const A=yield tryGetExecutablePath(s.join(n,e),t);if(A){r.push(A)}}return r}))}function readCopyOptions(e){const t=e.force==null?true:e.force;const A=Boolean(e.recursive);const r=e.copySourceDirectory==null?true:Boolean(e.copySourceDirectory);return{force:t,recursive:A,copySourceDirectory:r}}function cpDirRecursive(e,t,A,r){return RA(this,void 0,void 0,(function*(){if(A>=255)return;A++;yield mkdirP(t);const n=yield BA(e);for(const s of n){const n=`${e}/${s}`;const i=`${t}/${s}`;const o=yield dA(n);if(o.isDirectory()){yield cpDirRecursive(n,i,A,r)}else{yield io_copyFile(n,i,r)}}yield EA(t,(yield mA(e)).mode)}))}function io_copyFile(e,t,A){return RA(this,void 0,void 0,(function*(){if((yield dA(e)).isSymbolicLink()){try{yield dA(t);yield wA(t)}catch(e){if(e.code==="EPERM"){yield EA(t,"0666");yield wA(t)}}const A=yield readlink(e);yield yA(A,t,FA?"junction":null)}else if(!(yield exists(t))||A){yield fA(e,t)}}))}const SA=e(import.meta.url)("timers");var NA=undefined&&undefined.__awaiter||function(e,t,A,r){function adopt(e){return e instanceof A?e:new A((function(t){t(e)}))}return new(A||(A=Promise))((function(A,n){function fulfilled(e){try{step(r.next(e))}catch(e){n(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){n(e)}}function step(e){e.done?A(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())}))};const MA=process.platform==="win32";class ToolRunner extends uA.EventEmitter{constructor(e,t,A){super();if(!e){throw new Error("Parameter 'toolPath' cannot be null or empty.")}this.toolPath=e;this.args=t||[];this.options=A||{}}_debug(e){if(this.options.listeners&&this.options.listeners.debug){this.options.listeners.debug(e)}}_getCommandString(e,t){const A=this._getSpawnFileName();const r=this._getSpawnArgs(e);let n=t?"":"[command]";if(MA){if(this._isCmdFile()){n+=A;for(const e of r){n+=` ${e}`}}else if(e.windowsVerbatimArguments){n+=`"${A}"`;for(const e of r){n+=` ${e}`}}else{n+=this._windowsQuoteCmdArg(A);for(const e of r){n+=` ${this._windowsQuoteCmdArg(e)}`}}}else{n+=A;for(const e of r){n+=` ${e}`}}return n}_processLineBuffer(e,t,A){try{let r=t+e.toString();let n=r.indexOf(vt.EOL);while(n>-1){const e=r.substring(0,n);A(e);r=r.substring(n+vt.EOL.length);n=r.indexOf(vt.EOL)}return r}catch(e){this._debug(`error processing line. Failed with error ${e}`);return""}}_getSpawnFileName(){if(MA){if(this._isCmdFile()){return process.env["COMSPEC"]||"cmd.exe"}}return this.toolPath}_getSpawnArgs(e){if(MA){if(this._isCmdFile()){let t=`/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;for(const A of this.args){t+=" ";t+=e.windowsVerbatimArguments?A:this._windowsQuoteCmdArg(A)}t+='"';return[t]}}return this.args}_endsWith(e,t){return e.endsWith(t)}_isCmdFile(){const e=this.toolPath.toUpperCase();return this._endsWith(e,".CMD")||this._endsWith(e,".BAT")}_windowsQuoteCmdArg(e){if(!this._isCmdFile()){return this._uvQuoteCmdArg(e)}if(!e){return'""'}const t=[" ","\t","&","(",")","[","]","{","}","^","=",";","!","'","+",",","`","~","|","<",">",'"'];let A=false;for(const r of e){if(t.some((e=>e===r))){A=true;break}}if(!A){return e}let r='"';let n=true;for(let t=e.length;t>0;t--){r+=e[t-1];if(n&&e[t-1]==="\\"){r+="\\"}else if(e[t-1]==='"'){n=true;r+='"'}else{n=false}}r+='"';return r.split("").reverse().join("")}_uvQuoteCmdArg(e){if(!e){return'""'}if(!e.includes(" ")&&!e.includes("\t")&&!e.includes('"')){return e}if(!e.includes('"')&&!e.includes("\\")){return`"${e}"`}let t='"';let A=true;for(let r=e.length;r>0;r--){t+=e[r-1];if(A&&e[r-1]==="\\"){t+="\\"}else if(e[r-1]==='"'){A=true;t+="\\"}else{A=false}}t+='"';return t.split("").reverse().join("")}_cloneExecOptions(e){e=e||{};const t={cwd:e.cwd||process.cwd(),env:e.env||process.env,silent:e.silent||false,windowsVerbatimArguments:e.windowsVerbatimArguments||false,failOnStdErr:e.failOnStdErr||false,ignoreReturnCode:e.ignoreReturnCode||false,delay:e.delay||1e4};t.outStream=e.outStream||process.stdout;t.errStream=e.errStream||process.stderr;return t}_getSpawnOptions(e,t){e=e||{};const A={};A.cwd=e.cwd;A.env=e.env;A["windowsVerbatimArguments"]=e.windowsVerbatimArguments||this._isCmdFile();if(e.windowsVerbatimArguments){A.argv0=`"${t}"`}return A}exec(){return NA(this,void 0,void 0,(function*(){if(!isRooted(this.toolPath)&&(this.toolPath.includes("/")||MA&&this.toolPath.includes("\\"))){this.toolPath=s.resolve(process.cwd(),this.options.cwd||process.cwd(),this.toolPath)}this.toolPath=yield which(this.toolPath,true);return new Promise(((e,t)=>NA(this,void 0,void 0,(function*(){this._debug(`exec tool: ${this.toolPath}`);this._debug("arguments:");for(const e of this.args){this._debug(` ${e}`)}const A=this._cloneExecOptions(this.options);if(!A.silent&&A.outStream){A.outStream.write(this._getCommandString(A)+vt.EOL)}const r=new ExecState(A,this.toolPath);r.on("debug",(e=>{this._debug(e)}));if(this.options.cwd&&!(yield exists(this.options.cwd))){return t(new Error(`The cwd: ${this.options.cwd} does not exist!`))}const n=this._getSpawnFileName();const s=gA.spawn(n,this._getSpawnArgs(A),this._getSpawnOptions(this.options,n));let i="";if(s.stdout){s.stdout.on("data",(e=>{if(this.options.listeners&&this.options.listeners.stdout){this.options.listeners.stdout(e)}if(!A.silent&&A.outStream){A.outStream.write(e)}i=this._processLineBuffer(e,i,(e=>{if(this.options.listeners&&this.options.listeners.stdline){this.options.listeners.stdline(e)}}))}))}let o="";if(s.stderr){s.stderr.on("data",(e=>{r.processStderr=true;if(this.options.listeners&&this.options.listeners.stderr){this.options.listeners.stderr(e)}if(!A.silent&&A.errStream&&A.outStream){const t=A.failOnStdErr?A.errStream:A.outStream;t.write(e)}o=this._processLineBuffer(e,o,(e=>{if(this.options.listeners&&this.options.listeners.errline){this.options.listeners.errline(e)}}))}))}s.on("error",(e=>{r.processError=e.message;r.processExited=true;r.processClosed=true;r.CheckComplete()}));s.on("exit",(e=>{r.processExitCode=e;r.processExited=true;this._debug(`Exit code ${e} received from tool '${this.toolPath}'`);r.CheckComplete()}));s.on("close",(e=>{r.processExitCode=e;r.processExited=true;r.processClosed=true;this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);r.CheckComplete()}));r.on("done",((A,r)=>{if(i.length>0){this.emit("stdline",i)}if(o.length>0){this.emit("errline",o)}s.removeAllListeners();if(A){t(A)}else{e(r)}}));if(this.options.input){if(!s.stdin){throw new Error("child process missing stdin")}s.stdin.end(this.options.input)}}))))}))}}function argStringToArray(e){const t=[];let A=false;let r=false;let n="";function append(e){if(r&&e!=='"'){n+="\\"}n+=e;r=false}for(let s=0;s0){t.push(n);n=""}continue}append(i)}if(n.length>0){t.push(n.trim())}return t}class ExecState extends uA.EventEmitter{constructor(e,t){super();this.processClosed=false;this.processError="";this.processExitCode=0;this.processExited=false;this.processStderr=false;this.delay=1e4;this.done=false;this.timeout=null;if(!t){throw new Error("toolPath must not be empty")}this.options=e;this.toolPath=t;if(e.delay){this.delay=e.delay}}CheckComplete(){if(this.done){return}if(this.processClosed){this._setResult()}else if(this.processExited){this.timeout=(0,SA.setTimeout)(ExecState.HandleTimeout,this.delay,this)}}_debug(e){this.emit("debug",e)}_setResult(){let e;if(this.processExited){if(this.processError){e=new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`)}else if(this.processExitCode!==0&&!this.options.ignoreReturnCode){e=new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`)}else if(this.processStderr&&this.options.failOnStdErr){e=new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`)}}if(this.timeout){clearTimeout(this.timeout);this.timeout=null}this.done=true;this.emit("done",e,this.processExitCode)}static HandleTimeout(e){if(e.done){return}if(!e.processClosed&&e.processExited){const t=`The STDIO streams did not close within ${e.delay/1e3} seconds of the exit event from process '${e.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`;e._debug(t)}e._setResult()}}var UA=undefined&&undefined.__awaiter||function(e,t,A,r){function adopt(e){return e instanceof A?e:new A((function(t){t(e)}))}return new(A||(A=Promise))((function(A,n){function fulfilled(e){try{step(r.next(e))}catch(e){n(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){n(e)}}function step(e){e.done?A(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())}))};function exec_exec(e,t,A){return UA(this,void 0,void 0,(function*(){const r=argStringToArray(e);if(r.length===0){throw new Error(`Parameter 'commandLine' cannot be null or empty.`)}const n=r[0];t=r.slice(1).concat(t||[]);const s=new ToolRunner(n,t,A);return s.exec()}))}function getExecOutput(e,t,A){return UA(this,void 0,void 0,(function*(){var r,n;let s="";let i="";const o=new StringDecoder("utf8");const a=new StringDecoder("utf8");const c=(r=A===null||A===void 0?void 0:A.listeners)===null||r===void 0?void 0:r.stdout;const l=(n=A===null||A===void 0?void 0:A.listeners)===null||n===void 0?void 0:n.stderr;const stdErrListener=e=>{i+=a.write(e);if(l){l(e)}};const stdOutListener=e=>{s+=o.write(e);if(c){c(e)}};const u=Object.assign(Object.assign({},A===null||A===void 0?void 0:A.listeners),{stdout:stdOutListener,stderr:stdErrListener});const g=yield exec_exec(e,t,Object.assign(Object.assign({},A),{listeners:u}));s+=o.end();i+=a.end();return{exitCode:g,stdout:s,stderr:i}}))}var LA=undefined&&undefined.__awaiter||function(e,t,A,r){function adopt(e){return e instanceof A?e:new A((function(t){t(e)}))}return new(A||(A=Promise))((function(A,n){function fulfilled(e){try{step(r.next(e))}catch(e){n(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){n(e)}}function step(e){e.done?A(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())}))};const getWindowsInfo=()=>LA(void 0,void 0,void 0,(function*(){const{stdout:e}=yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"',undefined,{silent:true});const{stdout:t}=yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"',undefined,{silent:true});return{name:t.trim(),version:e.trim()}}));const getMacOsInfo=()=>LA(void 0,void 0,void 0,(function*(){var e,t,A,r;const{stdout:n}=yield exec.getExecOutput("sw_vers",undefined,{silent:true});const s=(t=(e=n.match(/ProductVersion:\s*(.+)/))===null||e===void 0?void 0:e[1])!==null&&t!==void 0?t:"";const i=(r=(A=n.match(/ProductName:\s*(.+)/))===null||A===void 0?void 0:A[1])!==null&&r!==void 0?r:"";return{name:i,version:s}}));const getLinuxInfo=()=>LA(void 0,void 0,void 0,(function*(){const{stdout:e}=yield exec.getExecOutput("lsb_release",["-i","-r","-s"],{silent:true});const[t,A]=e.trim().split("\n");return{name:t,version:A}}));const vA=vt.platform();const TA=vt.arch();const xA=vA==="win32";const YA=vA==="darwin";const HA=vA==="linux";function getDetails(){return LA(this,void 0,void 0,(function*(){return Object.assign(Object.assign({},yield xA?getWindowsInfo():YA?getMacOsInfo():getLinuxInfo()),{platform:vA,arch:TA,isWindows:xA,isMacOS:YA,isLinux:HA})}))}var GA=undefined&&undefined.__awaiter||function(e,t,A,r){function adopt(e){return e instanceof A?e:new A((function(t){t(e)}))}return new(A||(A=Promise))((function(A,n){function fulfilled(e){try{step(r.next(e))}catch(e){n(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){n(e)}}function step(e){e.done?A(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())}))};var OA;(function(e){e[e["Success"]=0]="Success";e[e["Failure"]=1]="Failure"})(OA||(OA={}));function exportVariable(e,t){const A=toCommandValue(t);process.env[e]=A;const r=process.env["GITHUB_ENV"]||"";if(r){return issueFileCommand("ENV",prepareKeyValueMessage(e,t))}issueCommand("set-env",{name:e},A)}function core_setSecret(e){issueCommand("add-mask",{},e)}function addPath(e){const t=process.env["GITHUB_PATH"]||"";if(t){file_command_issueFileCommand("PATH",e)}else{command_issueCommand("add-path",{},e)}process.env["PATH"]=`${e}${s.delimiter}${process.env["PATH"]}`}function getInput(e,t){const A=process.env[`INPUT_${e.replace(/ /g,"_").toUpperCase()}`]||"";if(t&&t.required&&!A){throw new Error(`Input required and not supplied: ${e}`)}if(t&&t.trimWhitespace===false){return A}return A.trim()}function getMultilineInput(e,t){const A=getInput(e,t).split("\n").filter((e=>e!==""));if(t&&t.trimWhitespace===false){return A}return A.map((e=>e.trim()))}function getBooleanInput(e,t){const A=["true","True","TRUE"];const r=["false","False","FALSE"];const n=getInput(e,t);if(A.includes(n))return true;if(r.includes(n))return false;throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${e}\n`+`Support boolean input list: \`true | True | TRUE | false | False | FALSE\``)}function setOutput(e,t){const A=process.env["GITHUB_OUTPUT"]||"";if(A){return file_command_issueFileCommand("OUTPUT",file_command_prepareKeyValueMessage(e,t))}process.stdout.write(vt.EOL);command_issueCommand("set-output",{name:e},utils_toCommandValue(t))}function setCommandEcho(e){issue("echo",e?"on":"off")}function setFailed(e){process.exitCode=OA.Failure;error(e)}function isDebug(){return process.env["RUNNER_DEBUG"]==="1"}function core_debug(e){command_issueCommand("debug",{},e)}function error(e,t={}){command_issueCommand("error",utils_toCommandProperties(t),e instanceof Error?e.toString():e)}function warning(e,t={}){command_issueCommand("warning",utils_toCommandProperties(t),e instanceof Error?e.toString():e)}function notice(e,t={}){issueCommand("notice",toCommandProperties(t),e instanceof Error?e.toString():e)}function info(e){process.stdout.write(e+vt.EOL)}function startGroup(e){command_issue("group",e)}function endGroup(){command_issue("endgroup")}function group(e,t){return GA(this,void 0,void 0,(function*(){startGroup(e);let A;try{A=yield t()}finally{endGroup()}return A}))}function saveState(e,t){const A=process.env["GITHUB_STATE"]||"";if(A){return issueFileCommand("STATE",prepareKeyValueMessage(e,t))}issueCommand("save-state",{name:e},toCommandValue(t))}function getState(e){return process.env[`STATE_${e}`]||""}function getIDToken(e){return GA(this,void 0,void 0,(function*(){return yield OidcClient.getIDToken(e)}))}const JA=vt.platform();const VA=vt.arch();async function getInputs(){return{distribution:getInput("distribution")||"goreleaser",version:getInput("version")||"~> v2",versionFile:getInput("version-file"),args:getInput("args"),workdir:getInput("workdir")||".",installOnly:getBooleanInput("install-only")}} /*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT */ -function isNothing(e){return typeof e==="undefined"||e===null}function isObject(e){return typeof e==="object"&&e!==null}function toArray(e){if(Array.isArray(e))return e;else if(isNothing(e))return[];return[e]}function extend(e,t){var A,r,n,s;if(t){s=Object.keys(t);for(A=0,r=s.length;Ao){s=" ... ";t=r-o+s.length}if(A-r>o){i=" ...";A=r+o-i.length}return{str:s+e.slice(t,A).replace(/\t/g,"→")+i,pos:r-t+s.length}}function padStart(e,t){return zA.repeat(" ",t-e.length)+e}function makeSnippet(e,t){t=Object.create(t||null);if(!e.buffer)return null;if(!t.maxLength)t.maxLength=79;if(typeof t.indent!=="number")t.indent=1;if(typeof t.linesBefore!=="number")t.linesBefore=3;if(typeof t.linesAfter!=="number")t.linesAfter=2;var A=/\r?\n|\r|\0/g;var r=[0];var n=[];var s;var i=-1;while(s=A.exec(e.buffer)){n.push(s.index);r.push(s.index+s[0].length);if(e.position<=s.index&&i<0){i=r.length-2}}if(i<0)i=r.length-1;var o="",a,c;var l=Math.min(e.line+t.linesAfter,n.length).toString().length;var u=t.maxLength-(t.indent+l+3);for(a=1;a<=t.linesBefore;a++){if(i-a<0)break;c=getLine(e.buffer,r[i-a],n[i-a],e.position-(r[i]-r[i-a]),u);o=zA.repeat(" ",t.indent)+padStart((e.line-a+1).toString(),l)+" | "+c.str+"\n"+o}c=getLine(e.buffer,r[i],n[i],e.position,u);o+=zA.repeat(" ",t.indent)+padStart((e.line+1).toString(),l)+" | "+c.str+"\n";o+=zA.repeat("-",t.indent+l+3+c.pos)+"^"+"\n";for(a=1;a<=t.linesAfter;a++){if(i+a>=n.length)break;c=getLine(e.buffer,r[i+a],n[i+a],e.position-(r[i]-r[i+a]),u);o+=zA.repeat(" ",t.indent)+padStart((e.line+a+1).toString(),l)+" | "+c.str+"\n"}return o.replace(/\n$/,"")}var KA=makeSnippet;var XA=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"];var er=["scalar","sequence","mapping"];function compileStyleAliases(e){var t={};if(e!==null){Object.keys(e).forEach((function(A){e[A].forEach((function(e){t[String(e)]=A}))}))}return t}function Type$1(e,t){t=t||{};Object.keys(t).forEach((function(t){if(XA.indexOf(t)===-1){throw new ZA('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')}}));this.options=t;this.tag=e;this.kind=t["kind"]||null;this.resolve=t["resolve"]||function(){return true};this.construct=t["construct"]||function(e){return e};this.instanceOf=t["instanceOf"]||null;this.predicate=t["predicate"]||null;this.represent=t["represent"]||null;this.representName=t["representName"]||null;this.defaultStyle=t["defaultStyle"]||null;this.multi=t["multi"]||false;this.styleAliases=compileStyleAliases(t["styleAliases"]||null);if(er.indexOf(this.kind)===-1){throw new ZA('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}}var tr=Type$1;function compileList(e,t){var A=[];e[t].forEach((function(e){var t=A.length;A.forEach((function(A,r){if(A.tag===e.tag&&A.kind===e.kind&&A.multi===e.multi){t=r}}));A[t]=e}));return A}function compileMap(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,A;function collectType(t){if(t.multi){e.multi[t.kind].push(t);e.multi["fallback"].push(t)}else{e[t.kind][t.tag]=e["fallback"][t.tag]=t}}for(t=0,A=arguments.length;t=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}});var lr=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?"+"|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?"+"|[-+]?\\.(?:inf|Inf|INF)"+"|\\.(?:nan|NaN|NAN))$");function resolveYamlFloat(e){if(e===null)return false;if(!lr.test(e)||e[e.length-1]==="_"){return false}return true}function constructYamlFloat(e){var t,A;t=e.replace(/_/g,"").toLowerCase();A=t[0]==="-"?-1:1;if("+-".indexOf(t[0])>=0){t=t.slice(1)}if(t===".inf"){return A===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY}else if(t===".nan"){return NaN}return A*parseFloat(t,10)}var ur=/^[-+]?[0-9]+e/;function representYamlFloat(e,t){var A;if(isNaN(e)){switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}}else if(Number.POSITIVE_INFINITY===e){switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}}else if(Number.NEGATIVE_INFINITY===e){switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}}else if(zA.isNegativeZero(e)){return"-0.0"}A=e.toString(10);return ur.test(A)?A.replace("e",".e"):A}function isFloat(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||zA.isNegativeZero(e))}var gr=new tr("tag:yaml.org,2002:float",{kind:"scalar",resolve:resolveYamlFloat,construct:constructYamlFloat,predicate:isFloat,represent:representYamlFloat,defaultStyle:"lowercase"});var hr=ir.extend({implicit:[or,ar,cr,gr]});var Er=hr;var fr=new RegExp("^([0-9][0-9][0-9][0-9])"+"-([0-9][0-9])"+"-([0-9][0-9])$");var dr=new RegExp("^([0-9][0-9][0-9][0-9])"+"-([0-9][0-9]?)"+"-([0-9][0-9]?)"+"(?:[Tt]|[ \\t]+)"+"([0-9][0-9]?)"+":([0-9][0-9])"+":([0-9][0-9])"+"(?:\\.([0-9]*))?"+"(?:[ \\t]*(Z|([-+])([0-9][0-9]?)"+"(?::([0-9][0-9]))?))?$");function resolveYamlTimestamp(e){if(e===null)return false;if(fr.exec(e)!==null)return true;if(dr.exec(e)!==null)return true;return false}function constructYamlTimestamp(e){var t,A,r,n,s,i,o,a=0,c=null,l,u,g;t=fr.exec(e);if(t===null)t=dr.exec(e);if(t===null)throw new Error("Date resolve error");A=+t[1];r=+t[2]-1;n=+t[3];if(!t[4]){return new Date(Date.UTC(A,r,n))}s=+t[4];i=+t[5];o=+t[6];if(t[7]){a=t[7].slice(0,3);while(a.length<3){a+="0"}a=+a}if(t[9]){l=+t[10];u=+(t[11]||0);c=(l*60+u)*6e4;if(t[9]==="-")c=-c}g=new Date(Date.UTC(A,r,n,s,i,o,a));if(c)g.setTime(g.getTime()-c);return g}function representYamlTimestamp(e){return e.toISOString()}var Cr=new tr("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:resolveYamlTimestamp,construct:constructYamlTimestamp,instanceOf:Date,represent:representYamlTimestamp});function resolveYamlMerge(e){return e==="<<"||e===null}var Qr=new tr("tag:yaml.org,2002:merge",{kind:"scalar",resolve:resolveYamlMerge});var Br="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";function resolveYamlBinary(e){if(e===null)return false;var t,A,r=0,n=e.length,s=Br;for(A=0;A64)continue;if(t<0)return false;r+=6}return r%8===0}function constructYamlBinary(e){var t,A,r=e.replace(/[\r\n=]/g,""),n=r.length,s=Br,i=0,o=[];for(t=0;t>16&255);o.push(i>>8&255);o.push(i&255)}i=i<<6|s.indexOf(r.charAt(t))}A=n%4*6;if(A===0){o.push(i>>16&255);o.push(i>>8&255);o.push(i&255)}else if(A===18){o.push(i>>10&255);o.push(i>>2&255)}else if(A===12){o.push(i>>4&255)}return new Uint8Array(o)}function representYamlBinary(e){var t="",A=0,r,n,s=e.length,i=Br;for(r=0;r>18&63];t+=i[A>>12&63];t+=i[A>>6&63];t+=i[A&63]}A=(A<<8)+e[r]}n=s%3;if(n===0){t+=i[A>>18&63];t+=i[A>>12&63];t+=i[A>>6&63];t+=i[A&63]}else if(n===2){t+=i[A>>10&63];t+=i[A>>4&63];t+=i[A<<2&63];t+=i[64]}else if(n===1){t+=i[A>>2&63];t+=i[A<<4&63];t+=i[64];t+=i[64]}return t}function isBinary(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var Ir=new tr("tag:yaml.org,2002:binary",{kind:"scalar",resolve:resolveYamlBinary,construct:constructYamlBinary,predicate:isBinary,represent:representYamlBinary});var pr=Object.prototype.hasOwnProperty;var Dr=Object.prototype.toString;function resolveYamlOmap(e){if(e===null)return true;var t=[],A,r,n,s,i,o=e;for(A=0,r=o.length;A>10)+55296,(e-65536&1023)+56320)}function setProperty(e,t,A){if(t==="__proto__"){Object.defineProperty(e,t,{configurable:true,enumerable:true,writable:true,value:A})}else{e[t]=A}}var Jr=new Array(256);var Vr=new Array(256);for(var Pr=0;Pr<256;Pr++){Jr[Pr]=simpleEscapeSequence(Pr)?1:0;Vr[Pr]=simpleEscapeSequence(Pr)}function State$1(e,t){this.input=e;this.filename=t["filename"]||null;this.schema=t["schema"]||kr;this.onWarning=t["onWarning"]||null;this.legacy=t["legacy"]||false;this.json=t["json"]||false;this.listener=t["listener"]||null;this.implicitTypes=this.schema.compiledImplicit;this.typeMap=this.schema.compiledTypeMap;this.length=e.length;this.position=0;this.line=0;this.lineStart=0;this.lineIndent=0;this.firstTabInLine=-1;this.documents=[]}function generateError(e,t){var A={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};A.snippet=KA(A);return new ZA(t,A)}function throwError(e,t){throw generateError(e,t)}function throwWarning(e,t){if(e.onWarning){e.onWarning.call(null,generateError(e,t))}}var Wr={YAML:function handleYamlDirective(e,t,A){var r,n,s;if(e.version!==null){throwError(e,"duplication of %YAML directive")}if(A.length!==1){throwError(e,"YAML directive accepts exactly one argument")}r=/^([0-9]+)\.([0-9]+)$/.exec(A[0]);if(r===null){throwError(e,"ill-formed argument of the YAML directive")}n=parseInt(r[1],10);s=parseInt(r[2],10);if(n!==1){throwError(e,"unacceptable YAML version of the document")}e.version=A[0];e.checkLineBreaks=s<2;if(s!==1&&s!==2){throwWarning(e,"unsupported YAML version of the document")}},TAG:function handleTagDirective(e,t,A){var r,n;if(A.length!==2){throwError(e,"TAG directive accepts exactly two arguments")}r=A[0];n=A[1];if(!Gr.test(r)){throwError(e,"ill-formed tag handle (first argument) of the TAG directive")}if(Rr.call(e.tagMap,r)){throwError(e,'there is a previously declared suffix for "'+r+'" tag handle')}if(!Or.test(n)){throwError(e,"ill-formed tag prefix (second argument) of the TAG directive")}try{n=decodeURIComponent(n)}catch(t){throwError(e,"tag prefix is malformed: "+n)}e.tagMap[r]=n}};function captureSegment(e,t,A,r){var n,s,i,o;if(t1){e.result+=zA.repeat("\n",t-1)}}function readPlainScalar(e,t,A){var r,n,s,i,o,a,c,l,u=e.kind,g=e.result,h;h=e.input.charCodeAt(e.position);if(is_WS_OR_EOL(h)||is_FLOW_INDICATOR(h)||h===35||h===38||h===42||h===33||h===124||h===62||h===39||h===34||h===37||h===64||h===96){return false}if(h===63||h===45){n=e.input.charCodeAt(e.position+1);if(is_WS_OR_EOL(n)||A&&is_FLOW_INDICATOR(n)){return false}}e.kind="scalar";e.result="";s=i=e.position;o=false;while(h!==0){if(h===58){n=e.input.charCodeAt(e.position+1);if(is_WS_OR_EOL(n)||A&&is_FLOW_INDICATOR(n)){break}}else if(h===35){r=e.input.charCodeAt(e.position-1);if(is_WS_OR_EOL(r)){break}}else if(e.position===e.lineStart&&testDocumentSeparator(e)||A&&is_FLOW_INDICATOR(h)){break}else if(is_EOL(h)){a=e.line;c=e.lineStart;l=e.lineIndent;skipSeparationSpace(e,false,-1);if(e.lineIndent>=t){o=true;h=e.input.charCodeAt(e.position);continue}else{e.position=i;e.line=a;e.lineStart=c;e.lineIndent=l;break}}if(o){captureSegment(e,s,i,false);writeFoldedLines(e,e.line-a);s=i=e.position;o=false}if(!is_WHITE_SPACE(h)){i=e.position+1}h=e.input.charCodeAt(++e.position)}captureSegment(e,s,i,false);if(e.result){return true}e.kind=u;e.result=g;return false}function readSingleQuotedScalar(e,t){var A,r,n;A=e.input.charCodeAt(e.position);if(A!==39){return false}e.kind="scalar";e.result="";e.position++;r=n=e.position;while((A=e.input.charCodeAt(e.position))!==0){if(A===39){captureSegment(e,r,e.position,true);A=e.input.charCodeAt(++e.position);if(A===39){r=e.position;e.position++;n=e.position}else{return true}}else if(is_EOL(A)){captureSegment(e,r,n,true);writeFoldedLines(e,skipSeparationSpace(e,false,t));r=n=e.position}else if(e.position===e.lineStart&&testDocumentSeparator(e)){throwError(e,"unexpected end of the document within a single quoted scalar")}else{e.position++;n=e.position}}throwError(e,"unexpected end of the stream within a single quoted scalar")}function readDoubleQuotedScalar(e,t){var A,r,n,s,i,o;o=e.input.charCodeAt(e.position);if(o!==34){return false}e.kind="scalar";e.result="";e.position++;A=r=e.position;while((o=e.input.charCodeAt(e.position))!==0){if(o===34){captureSegment(e,A,e.position,true);e.position++;return true}else if(o===92){captureSegment(e,A,e.position,true);o=e.input.charCodeAt(++e.position);if(is_EOL(o)){skipSeparationSpace(e,false,t)}else if(o<256&&Jr[o]){e.result+=Vr[o];e.position++}else if((i=escapedHexLen(o))>0){n=i;s=0;for(;n>0;n--){o=e.input.charCodeAt(++e.position);if((i=fromHexCode(o))>=0){s=(s<<4)+i}else{throwError(e,"expected hexadecimal character")}}e.result+=charFromCodepoint(s);e.position++}else{throwError(e,"unknown escape sequence")}A=r=e.position}else if(is_EOL(o)){captureSegment(e,A,r,true);writeFoldedLines(e,skipSeparationSpace(e,false,t));A=r=e.position}else if(e.position===e.lineStart&&testDocumentSeparator(e)){throwError(e,"unexpected end of the document within a double quoted scalar")}else{e.position++;r=e.position}}throwError(e,"unexpected end of the stream within a double quoted scalar")}function readFlowCollection(e,t){var A=true,r,n,s,i=e.tag,o,a=e.anchor,c,l,u,g,h,E=Object.create(null),f,d,C,Q;Q=e.input.charCodeAt(e.position);if(Q===91){l=93;h=false;o=[]}else if(Q===123){l=125;h=true;o={}}else{return false}if(e.anchor!==null){e.anchorMap[e.anchor]=o}Q=e.input.charCodeAt(++e.position);while(Q!==0){skipSeparationSpace(e,true,t);Q=e.input.charCodeAt(e.position);if(Q===l){e.position++;e.tag=i;e.anchor=a;e.kind=h?"mapping":"sequence";e.result=o;return true}else if(!A){throwError(e,"missed comma between flow collection entries")}else if(Q===44){throwError(e,"expected the node content, but found ','")}d=f=C=null;u=g=false;if(Q===63){c=e.input.charCodeAt(e.position+1);if(is_WS_OR_EOL(c)){u=g=true;e.position++;skipSeparationSpace(e,true,t)}}r=e.line;n=e.lineStart;s=e.position;composeNode(e,t,Sr,false,true);d=e.tag;f=e.result;skipSeparationSpace(e,true,t);Q=e.input.charCodeAt(e.position);if((g||e.line===r)&&Q===58){u=true;Q=e.input.charCodeAt(++e.position);skipSeparationSpace(e,true,t);composeNode(e,t,Sr,false,true);C=e.result}if(h){storeMappingPair(e,o,E,d,f,C,r,n,s)}else if(u){o.push(storeMappingPair(e,null,E,d,f,C,r,n,s))}else{o.push(f)}skipSeparationSpace(e,true,t);Q=e.input.charCodeAt(e.position);if(Q===44){A=true;Q=e.input.charCodeAt(++e.position)}else{A=false}}throwError(e,"unexpected end of the stream within a flow collection")}function readBlockScalar(e,t){var A,r,n=Lr,s=false,i=false,o=t,a=0,c=false,l,u;u=e.input.charCodeAt(e.position);if(u===124){r=false}else if(u===62){r=true}else{return false}e.kind="scalar";e.result="";while(u!==0){u=e.input.charCodeAt(++e.position);if(u===43||u===45){if(Lr===n){n=u===43?Tr:vr}else{throwError(e,"repeat of a chomping mode identifier")}}else if((l=fromDecimalCode(u))>=0){if(l===0){throwError(e,"bad explicit indentation width of a block scalar; it cannot be less than one")}else if(!i){o=t+l-1;i=true}else{throwError(e,"repeat of an indentation width identifier")}}else{break}}if(is_WHITE_SPACE(u)){do{u=e.input.charCodeAt(++e.position)}while(is_WHITE_SPACE(u));if(u===35){do{u=e.input.charCodeAt(++e.position)}while(!is_EOL(u)&&u!==0)}}while(u!==0){readLineBreak(e);e.lineIndent=0;u=e.input.charCodeAt(e.position);while((!i||e.lineIndento){o=e.lineIndent}if(is_EOL(u)){a++;continue}if(e.lineIndentt)&&a!==0){throwError(e,"bad indentation of a sequence entry")}else if(e.lineIndentt){if(d){i=e.line;o=e.lineStart;a=e.position}if(composeNode(e,t,Ur,true,n)){if(d){E=e.result}else{f=e.result}}if(!d){storeMappingPair(e,u,g,h,E,f,i,o,a);h=E=f=null}skipSeparationSpace(e,true,-1);Q=e.input.charCodeAt(e.position)}if((e.line===s||e.lineIndent>t)&&Q!==0){throwError(e,"bad indentation of a mapping entry")}else if(e.lineIndentt){a=1}else if(e.lineIndent===t){a=0}else if(e.lineIndentt){a=1}else if(e.lineIndent===t){a=0}else if(e.lineIndent tag; it should be "scalar", not "'+e.kind+'"')}for(u=0,g=e.implicitTypes.length;u")}if(e.result!==null&&E.kind!==e.kind){throwError(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+E.kind+'", not "'+e.kind+'"')}if(!E.resolve(e.result,e.tag)){throwError(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}else{e.result=E.construct(e.result,e.tag);if(e.anchor!==null){e.anchorMap[e.anchor]=e.result}}}if(e.listener!==null){e.listener("close",e)}return e.tag!==null||e.anchor!==null||l}function readDocument(e){var t=e.position,A,r,n,s=false,i;e.version=null;e.checkLineBreaks=e.legacy;e.tagMap=Object.create(null);e.anchorMap=Object.create(null);while((i=e.input.charCodeAt(e.position))!==0){skipSeparationSpace(e,true,-1);i=e.input.charCodeAt(e.position);if(e.lineIndent>0||i!==37){break}s=true;i=e.input.charCodeAt(++e.position);A=e.position;while(i!==0&&!is_WS_OR_EOL(i)){i=e.input.charCodeAt(++e.position)}r=e.input.slice(A,e.position);n=[];if(r.length<1){throwError(e,"directive name must not be less than one character in length")}while(i!==0){while(is_WHITE_SPACE(i)){i=e.input.charCodeAt(++e.position)}if(i===35){do{i=e.input.charCodeAt(++e.position)}while(i!==0&&!is_EOL(i));break}if(is_EOL(i))break;A=e.position;while(i!==0&&!is_WS_OR_EOL(i)){i=e.input.charCodeAt(++e.position)}n.push(e.input.slice(A,e.position))}if(i!==0)readLineBreak(e);if(Rr.call(Wr,r)){Wr[r](e,r,n)}else{throwWarning(e,'unknown document directive "'+r+'"')}}skipSeparationSpace(e,true,-1);if(e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45){e.position+=3;skipSeparationSpace(e,true,-1)}else if(s){throwError(e,"directives end mark is expected")}composeNode(e,e.lineIndent-1,Ur,false,true);skipSeparationSpace(e,true,-1);if(e.checkLineBreaks&&Yr.test(e.input.slice(t,e.position))){throwWarning(e,"non-ASCII line breaks are interpreted as content")}e.documents.push(e.result);if(e.position===e.lineStart&&testDocumentSeparator(e)){if(e.input.charCodeAt(e.position)===46){e.position+=3;skipSeparationSpace(e,true,-1)}return}if(e.position=55296&&A<=56319&&t+1=56320&&r<=57343){return(A-55296)*1024+r-56320+65536}}return A}function needIndentIndicator(e){var t=/^\n* /;return t.test(e)}var kn=1,Rn=2,Sn=3,Nn=4,Mn=5;function chooseScalarStyle(e,t,A,r,n,s,i,o){var a;var c=0;var l=null;var u=false;var g=false;var h=r!==-1;var E=-1;var f=isPlainSafeFirst(codePointAt(e,0))&&isPlainSafeLast(codePointAt(e,e.length-1));if(t||i){for(a=0;a=65536?a+=2:a++){c=codePointAt(e,a);if(!isPrintable(c)){return Mn}f=f&&isPlainSafe(c,l,o);l=c}}else{for(a=0;a=65536?a+=2:a++){c=codePointAt(e,a);if(c===Xr){u=true;if(h){g=g||a-E-1>r&&e[E+1]!==" ";E=a}}else if(!isPrintable(c)){return Mn}f=f&&isPlainSafe(c,l,o);l=c}g=g||h&&(a-E-1>r&&e[E+1]!==" ")}if(!u&&!g){if(f&&!i&&!n(e)){return kn}return s===bn?Mn:Rn}if(A>9&&needIndentIndicator(e)){return Mn}if(!i){return g?Nn:Sn}return s===bn?Mn:Rn}function writeScalar(e,t,A,r,n){e.dump=function(){if(t.length===0){return e.quotingType===bn?'""':"''"}if(!e.noCompatMode){if(yn.indexOf(t)!==-1||wn.test(t)){return e.quotingType===bn?'"'+t+'"':"'"+t+"'"}}var s=e.indent*Math.max(1,A);var i=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-s);var o=r||e.flowLevel>-1&&A>=e.flowLevel;function testAmbiguity(t){return testImplicitResolving(e,t)}switch(chooseScalarStyle(t,o,e.indent,i,testAmbiguity,e.quotingType,e.forceQuotes&&!r,n)){case kn:return t;case Rn:return"'"+t.replace(/'/g,"''")+"'";case Sn:return"|"+blockHeader(t,e.indent)+dropEndingNewline(indentString(t,s));case Nn:return">"+blockHeader(t,e.indent)+dropEndingNewline(indentString(foldString(t,i),s));case Mn:return'"'+escapeString(t)+'"';default:throw new ZA("impossible error: invalid scalar style")}}()}function blockHeader(e,t){var A=needIndentIndicator(e)?String(t):"";var r=e[e.length-1]==="\n";var n=r&&(e[e.length-2]==="\n"||e==="\n");var s=n?"+":r?"":"-";return A+s+"\n"}function dropEndingNewline(e){return e[e.length-1]==="\n"?e.slice(0,-1):e}function foldString(e,t){var A=/(\n+)([^\n]*)/g;var r=function(){var r=e.indexOf("\n");r=r!==-1?r:e.length;A.lastIndex=r;return foldLine(e.slice(0,r),t)}();var n=e[0]==="\n"||e[0]===" ";var s;var i;while(i=A.exec(e)){var o=i[1],a=i[2];s=a[0]===" ";r+=o+(!n&&!s&&a!==""?"\n":"")+foldLine(a,t);n=s}return r}function foldLine(e,t){if(e===""||e[0]===" ")return e;var A=/ [^ ]/g;var r;var n=0,s,i=0,o=0;var a="";while(r=A.exec(e)){o=r.index;if(o-n>t){s=i>n?i:o;a+="\n"+e.slice(n,s);n=s+1}i=o}a+="\n";if(e.length-n>t&&i>n){a+=e.slice(n,i)+"\n"+e.slice(i+1)}else{a+=e.slice(n)}return a.slice(1)}function escapeString(e){var t="";var A=0;var r;for(var n=0;n=65536?n+=2:n++){A=codePointAt(e,n);r=mn[A];if(!r&&isPrintable(A)){t+=e[n];if(A>=65536)t+=e[n+1]}else{t+=r||encodeHex(A)}}return t}function writeFlowSequence(e,t,A){var r="",n=e.tag,s,i,o;for(s=0,i=A.length;s1024)l+="? ";l+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" ");if(!writeNode(e,t,c,false,false)){continue}l+=e.dump;r+=l}e.tag=n;e.dump="{"+r+"}"}function writeBlockMapping(e,t,A,r){var n="",s=e.tag,i=Object.keys(A),o,a,c,l,u,g;if(e.sortKeys===true){i.sort()}else if(typeof e.sortKeys==="function"){i.sort(e.sortKeys)}else if(e.sortKeys){throw new ZA("sortKeys must be a boolean or a function")}for(o=0,a=i.length;o1024;if(u){if(e.dump&&Xr===e.dump.charCodeAt(0)){g+="?"}else{g+="? "}}g+=e.dump;if(u){g+=generateNextLine(e,t)}if(!writeNode(e,t+1,l,true,u)){continue}if(e.dump&&Xr===e.dump.charCodeAt(0)){g+=":"}else{g+=": "}g+=e.dump;n+=g}e.tag=s;e.dump=n||"{}"}function detectType(e,t,A){var r,n,s,i,o,a;n=A?e.explicitTypes:e.implicitTypes;for(s=0,i=n.length;s tag resolver accepts not "'+a+'" style')}e.dump=r}return true}}return false}function writeNode(e,t,A,r,n,s,i){e.tag=null;e.dump=A;if(!detectType(e,A,false)){detectType(e,A,true)}var o=$r.call(e.dump);var a=r;var c;if(r){r=e.flowLevel<0||e.flowLevel>t}var l=o==="[object Object]"||o==="[object Array]",u,g;if(l){u=e.duplicates.indexOf(A);g=u!==-1}if(e.tag!==null&&e.tag!=="?"||g||e.indent!==2&&t>0){n=false}if(g&&e.usedDuplicates[u]){e.dump="*ref_"+u}else{if(l&&g&&!e.usedDuplicates[u]){e.usedDuplicates[u]=true}if(o==="[object Object]"){if(r&&Object.keys(e.dump).length!==0){writeBlockMapping(e,t,e.dump,n);if(g){e.dump="&ref_"+u+e.dump}}else{writeFlowMapping(e,t,e.dump);if(g){e.dump="&ref_"+u+" "+e.dump}}}else if(o==="[object Array]"){if(r&&e.dump.length!==0){if(e.noArrayIndent&&!i&&t>0){writeBlockSequence(e,t-1,e.dump,n)}else{writeBlockSequence(e,t,e.dump,n)}if(g){e.dump="&ref_"+u+e.dump}}else{writeFlowSequence(e,t,e.dump);if(g){e.dump="&ref_"+u+" "+e.dump}}}else if(o==="[object String]"){if(e.tag!=="?"){writeScalar(e,e.dump,t,s,a)}}else if(o==="[object Undefined]"){return false}else{if(e.skipInvalid)return false;throw new ZA("unacceptable kind of an object to dump "+o)}if(e.tag!==null&&e.tag!=="?"){c=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21");if(e.tag[0]==="!"){c="!"+c}else if(c.slice(0,18)==="tag:yaml.org,2002:"){c="!!"+c.slice(18)}else{c="!<"+c+">"}e.dump=c+" "+e.dump}}return true}function getDuplicateReferences(e,t){var A=[],r=[],n,s;inspectNode(e,A,r);for(n=0,s=r.length;n{let t;for(let A=0;A<=Zn;A++){try{return await e()}catch(e){t=e;if(A===Zn){break}core_debug(`Attempt ${A+1} failed, retrying in ${Kn}: ${t.message}`);await new Promise((e=>setTimeout(e,Kn)))}}throw t};const Xn=/^v\d+\.\d+\.\d+-[0-9a-f]+-nightly$/i;const isNightlyTag=e=>e==="nightly"||Xn.test(e);const getRelease=async(e,t)=>{if(t==="latest"){warning("You are using 'latest' as default version. Will lock to '~> v2'.");return getReleaseTag(e,"~> v2")}return getReleaseTag(e,t)};const getReleaseTag=async(e,t)=>{if(t==="nightly"){return resolveNightly(e)}const A=cleanTag(t);if(zn.valid(A)){let r=t.startsWith("v")?t:`v${t}`;if(isPro(e)&&zn.lt(A,"2.7.0")&&!r.endsWith("-pro")){r=r+distribSuffix(e)}return{tag_name:r}}const r=await resolveVersion(e,t)||t;const n=distribSuffix(e);const s=`https://goreleaser.com/releases${n}.json`;const i=await withRetry((async()=>{const e=new lib_HttpClient("goreleaser-action");const A=await e.get(s);const r=await A.readBody();const n=A.message.statusCode||500;if(n>=400){throw new Error(`Failed to get GoReleaser release ${t} from ${s} with status code ${n}: ${r}`)}return JSON.parse(r)}));const o=i.filter((e=>e.tag_name===r)).shift();if(o){return o}throw new Error(`Cannot find GoReleaser release ${t} in ${s}`)};const resolveNightly=async e=>{const t=`https://api.github.com/repos/goreleaser/${e}/releases?per_page=100`;core_debug(`Resolving latest nightly release from ${t}`);const A=await withRetry((async()=>{const e=new lib_HttpClient("goreleaser-action");const A={Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"};const r=process.env.GITHUB_TOKEN;if(r){A["Authorization"]=`Bearer ${r}`}const n=await e.get(t,A);const s=await n.readBody();const i=n.message.statusCode||500;if(i>=400){throw new Error(`Failed to list releases from ${t} with status code ${i}: ${s}`)}return JSON.parse(s)}));const r=A.find((e=>Xn.test(e.tag_name)));if(r){info(`Resolved nightly to ${r.tag_name}`);return r}warning(`No '--nightly' release found in ${t}, falling back to 'nightly' tag`);return{tag_name:"nightly"}};const resolveVersion=async(e,t)=>{const A=await getAllTags(e);if(!A){throw new Error(`Cannot download ${e} tags`)}core_debug(`Found ${A.length} tags in total`);const r=A.map((e=>cleanTag(e)));const n=cleanTag(t);if(!zn.valid(n)&&!zn.validRange(n)){return t}const s=zn.maxSatisfying(r,n);if(zn.lt(s,"2.7.0")){return s+distribSuffix(e)}return s};const getAllTags=async e=>{const t=distribSuffix(e);const A=`https://goreleaser.com/releases${t}.json`;core_debug(`Downloading ${A}`);return withRetry((async()=>{const e=new lib_HttpClient("goreleaser-action");const t=await e.getJson(A);if(t.result==null){return[]}return t.result.map((e=>e.tag_name))}))};const cleanTag=e=>e.replace(/-pro$/,"");var es=undefined&&undefined.__awaiter||function(e,t,A,r){function adopt(e){return e instanceof A?e:new A((function(t){t(e)}))}return new(A||(A=Promise))((function(A,n){function fulfilled(e){try{step(r.next(e))}catch(e){n(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){n(e)}}function step(e){e.done?A(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())}))};const ts={readLinuxVersionFile(){const e="/etc/lsb-release";const t="/etc/os-release";let A="";if(n.existsSync(e)){A=n.readFileSync(e).toString()}else if(n.existsSync(t)){A=n.readFileSync(t).toString()}return A}};function _findMatch(e,t,A,r){return es(this,void 0,void 0,(function*(){const n=os.platform();let s;let i;let o;for(const s of A){const A=s.version;debug(`check ${A} satisfies ${e}`);if(semver.satisfies(A,e)&&(!t||s.stable===t)){o=s.files.find((e=>{debug(`${e.arch}===${r} && ${e.platform}===${n}`);let t=e.arch===r&&e.platform===n;if(t&&e.platform_version){const A=_getOsVersion();if(A===e.platform_version){t=true}else{t=semver.satisfies(A,e.platform_version)}}return t}));if(o){debug(`matched ${s.version}`);i=s;break}}}if(i&&o){s=Object.assign({},i);s.files=[o]}return s}))}function _getOsVersion(){const e=os.platform();let t="";if(e==="darwin"){t=cp.execSync("sw_vers -productVersion").toString()}else if(e==="linux"){const e=ts.readLinuxVersionFile();if(e){const A=e.split("\n");for(const e of A){const A=e.split("=");if(A.length===2&&(A[0].trim()==="VERSION_ID"||A[0].trim()==="DISTRIB_RELEASE")){t=A[1].trim().replace(/^"/,"").replace(/"$/,"");break}}}}return t}function _readLinuxVersionFile(){return ts.readLinuxVersionFile()}const As=e(import.meta.url)("stream");var rs=undefined&&undefined.__awaiter||function(e,t,A,r){function adopt(e){return e instanceof A?e:new A((function(t){t(e)}))}return new(A||(A=Promise))((function(A,n){function fulfilled(e){try{step(r.next(e))}catch(e){n(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){n(e)}}function step(e){e.done?A(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())}))};class RetryHelper{constructor(e,t,A){if(e<1){throw new Error("max attempts should be greater than or equal to 1")}this.maxAttempts=e;this.minSeconds=Math.floor(t);this.maxSeconds=Math.floor(A);if(this.minSeconds>this.maxSeconds){throw new Error("min seconds should be less than or equal to max seconds")}}execute(e,t){return rs(this,void 0,void 0,(function*(){let A=1;while(AsetTimeout(t,e*1e3)))}))}}var ns=undefined&&undefined.__awaiter||function(e,t,A,r){function adopt(e){return e instanceof A?e:new A((function(t){t(e)}))}return new(A||(A=Promise))((function(A,n){function fulfilled(e){try{step(r.next(e))}catch(e){n(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){n(e)}}function step(e){e.done?A(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())}))};class HTTPError extends Error{constructor(e){super(`Unexpected HTTP response: ${e}`);this.httpStatusCode=e;Object.setPrototypeOf(this,new.target.prototype)}}const ss=process.platform==="win32";const is=process.platform==="darwin";const as="actions/tool-cache";function downloadTool(e,t,A,r){return ns(this,void 0,void 0,(function*(){t=t||s.join(_getTempDirectory(),xt.randomUUID());yield mkdirP(s.dirname(t));core_debug(`Downloading ${e}`);core_debug(`Destination ${t}`);const n=3;const i=_getGlobal("TEST_DOWNLOAD_TOOL_RETRY_MIN_SECONDS",10);const o=_getGlobal("TEST_DOWNLOAD_TOOL_RETRY_MAX_SECONDS",20);const a=new RetryHelper(n,i,o);return yield a.execute((()=>ns(this,void 0,void 0,(function*(){return yield downloadToolAttempt(e,t||"",A,r)}))),(e=>{if(e instanceof HTTPError&&e.httpStatusCode){if(e.httpStatusCode<500&&e.httpStatusCode!==408&&e.httpStatusCode!==429){return false}}return true}))}))}function downloadToolAttempt(e,t,A,r){return ns(this,void 0,void 0,(function*(){if(n.existsSync(t)){throw new Error(`Destination file path ${t} already exists`)}const s=new lib_HttpClient(as,[],{allowRetries:false});if(A){core_debug("set auth");if(r===undefined){r={}}r.authorization=A}const i=yield s.get(e,r);if(i.message.statusCode!==200){const t=new HTTPError(i.message.statusCode);core_debug(`Failed to download from "${e}". Code(${i.message.statusCode}) Message(${i.message.statusMessage})`);throw t}const o=L.promisify(As.pipeline);const a=_getGlobal("TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY",(()=>i.message));const c=a();let l=false;try{yield o(c,n.createWriteStream(t));core_debug("download complete");l=true;return t}finally{if(!l){core_debug("download failed");try{yield rmRF(t)}catch(e){core_debug(`Failed to delete '${t}'. ${e.message}`)}}}}))}function extract7z(e,t,A){return ns(this,void 0,void 0,(function*(){ok(ss,"extract7z() not supported on current OS");ok(e,'parameter "file" is required');t=yield _createExtractFolder(t);const r=process.cwd();process.chdir(t);if(A){try{const t=core.isDebug()?"-bb1":"-bb0";const r=["x",t,"-bd","-sccUTF-8",e];const n={silent:true};yield exec(`"${A}"`,r,n)}finally{process.chdir(r)}}else{const A=path.join(__dirname,"..","scripts","Invoke-7zdec.ps1").replace(/'/g,"''").replace(/"|\n|\r/g,"");const n=e.replace(/'/g,"''").replace(/"|\n|\r/g,"");const s=t.replace(/'/g,"''").replace(/"|\n|\r/g,"");const i=`& '${A}' -Source '${n}' -Target '${s}'`;const o=["-NoLogo","-Sta","-NoProfile","-NonInteractive","-ExecutionPolicy","Unrestricted","-Command",i];const a={silent:true};try{const e=yield io.which("powershell",true);yield exec(`"${e}"`,o,a)}finally{process.chdir(r)}}return t}))}function extractTar(e,t){return ns(this,arguments,void 0,(function*(e,t,A="xz"){if(!e){throw new Error("parameter 'file' is required")}t=yield _createExtractFolder(t);core_debug("Checking tar --version");let r="";yield exec_exec("tar --version",[],{ignoreReturnCode:true,silent:true,listeners:{stdout:e=>r+=e.toString(),stderr:e=>r+=e.toString()}});core_debug(r.trim());const n=r.toUpperCase().includes("GNU TAR");let s;if(A instanceof Array){s=A}else{s=[A]}if(isDebug()&&!A.includes("v")){s.push("-v")}let i=t;let o=e;if(ss&&n){s.push("--force-local");i=t.replace(/\\/g,"/");o=e.replace(/\\/g,"/")}if(n){s.push("--warning=no-unknown-keyword");s.push("--overwrite")}s.push("-C",i,"-f",o);yield exec_exec(`tar`,s);return t}))}function extractXar(e,t){return ns(this,arguments,void 0,(function*(e,t,A=[]){ok(is,"extractXar() not supported on current OS");ok(e,'parameter "file" is required');t=yield _createExtractFolder(t);let r;if(A instanceof Array){r=A}else{r=[A]}r.push("-x","-C",t,"-f",e);if(core.isDebug()){r.push("-v")}const n=yield io.which("xar",true);yield exec(`"${n}"`,_unique(r));return t}))}function extractZip(e,t){return ns(this,void 0,void 0,(function*(){if(!e){throw new Error("parameter 'file' is required")}t=yield _createExtractFolder(t);if(ss){yield extractZipWin(e,t)}else{yield extractZipNix(e,t)}return t}))}function extractZipWin(e,t){return ns(this,void 0,void 0,(function*(){const A=e.replace(/'/g,"''").replace(/"|\n|\r/g,"");const r=t.replace(/'/g,"''").replace(/"|\n|\r/g,"");const n=yield which("pwsh",false);if(n){const e=[`$ErrorActionPreference = 'Stop' ;`,`try { Add-Type -AssemblyName System.IO.Compression.ZipFile } catch { } ;`,`try { [System.IO.Compression.ZipFile]::ExtractToDirectory('${A}', '${r}', $true) }`,`catch { if (($_.Exception.GetType().FullName -eq 'System.Management.Automation.MethodException') -or ($_.Exception.GetType().FullName -eq 'System.Management.Automation.RuntimeException') ){ Expand-Archive -LiteralPath '${A}' -DestinationPath '${r}' -Force } else { throw $_ } } ;`].join(" ");const t=["-NoLogo","-NoProfile","-NonInteractive","-ExecutionPolicy","Unrestricted","-Command",e];core_debug(`Using pwsh at path: ${n}`);yield exec_exec(`"${n}"`,t)}else{const e=[`$ErrorActionPreference = 'Stop' ;`,`try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ;`,`if ((Get-Command -Name Expand-Archive -Module Microsoft.PowerShell.Archive -ErrorAction Ignore)) { Expand-Archive -LiteralPath '${A}' -DestinationPath '${r}' -Force }`,`else {[System.IO.Compression.ZipFile]::ExtractToDirectory('${A}', '${r}', $true) }`].join(" ");const t=["-NoLogo","-Sta","-NoProfile","-NonInteractive","-ExecutionPolicy","Unrestricted","-Command",e];const n=yield which("powershell",true);core_debug(`Using powershell at path: ${n}`);yield exec_exec(`"${n}"`,t)}}))}function extractZipNix(e,t){return ns(this,void 0,void 0,(function*(){const A=yield which("unzip",true);const r=[e];if(!isDebug()){r.unshift("-q")}r.unshift("-o");yield exec_exec(`"${A}"`,r,{cwd:t})}))}function cacheDir(e,t,A,r){return ns(this,void 0,void 0,(function*(){A=zn.clean(A)||A;r=r||vt.arch();core_debug(`Caching tool ${t} ${A} ${r}`);core_debug(`source dir: ${e}`);if(!n.statSync(e).isDirectory()){throw new Error("sourceDir is not a directory")}const i=yield _createToolPath(t,A,r);for(const t of n.readdirSync(e)){const A=s.join(e,t);yield io_cp(A,i,{recursive:true})}_completeToolPath(t,A,r);return i}))}function cacheFile(e,t,A,r,n){return ns(this,void 0,void 0,(function*(){r=semver.clean(r)||r;n=n||os.arch();core.debug(`Caching tool ${A} ${r} ${n}`);core.debug(`source file: ${e}`);if(!fs.statSync(e).isFile()){throw new Error("sourceFile is not a file")}const s=yield _createToolPath(A,r,n);const i=path.join(s,t);core.debug(`destination file ${i}`);yield io.cp(e,i);_completeToolPath(A,r,n);return s}))}function find(e,t,A){if(!e){throw new Error("toolName parameter is required")}if(!t){throw new Error("versionSpec parameter is required")}A=A||os.arch();if(!isExplicitVersion(t)){const r=findAllVersions(e,A);const n=evaluateVersions(r,t);t=n}let r="";if(t){t=semver.clean(t)||"";const n=path.join(_getCacheDirectory(),e,t,A);core.debug(`checking cache: ${n}`);if(fs.existsSync(n)&&fs.existsSync(`${n}.complete`)){core.debug(`Found tool in cache ${e} ${t} ${A}`);r=n}else{core.debug("not found")}}return r}function findAllVersions(e,t){const A=[];t=t||os.arch();const r=path.join(_getCacheDirectory(),e);if(fs.existsSync(r)){const e=fs.readdirSync(r);for(const n of e){if(isExplicitVersion(n)){const e=path.join(r,n,t||"");if(fs.existsSync(e)&&fs.existsSync(`${e}.complete`)){A.push(n)}}}}return A}function getManifestFromRepo(e,t,A){return ns(this,arguments,void 0,(function*(e,t,A,r="master"){let n=[];const s=`https://api.github.com/repos/${e}/${t}/git/trees/${r}`;const i=new httpm.HttpClient("tool-cache");const o={};if(A){core.debug("set auth");o.authorization=A}const a=yield i.getJson(s,o);if(!a.result){return n}let c="";for(const e of a.result.tree){if(e.path==="versions-manifest.json"){c=e.url;break}}o["accept"]="application/vnd.github.VERSION.raw";let l=yield(yield i.get(c,o)).readBody();if(l){l=l.replace(/^\uFEFF/,"");try{n=JSON.parse(l)}catch(e){core.debug("Invalid json")}}return n}))}function findFromManifest(e,t,A){return ns(this,arguments,void 0,(function*(e,t,A,r=os.arch()){const n=yield mm._findMatch(e,t,A,r);return n}))}function _createExtractFolder(e){return ns(this,void 0,void 0,(function*(){if(!e){e=s.join(_getTempDirectory(),xt.randomUUID())}yield mkdirP(e);return e}))}function _createToolPath(e,t,A){return ns(this,void 0,void 0,(function*(){const r=s.join(_getCacheDirectory(),e,zn.clean(t)||t,A||"");core_debug(`destination ${r}`);const n=`${r}.complete`;yield rmRF(r);yield rmRF(n);yield mkdirP(r);return r}))}function _completeToolPath(e,t,A){const r=s.join(_getCacheDirectory(),e,zn.clean(t)||t,A||"");const i=`${r}.complete`;n.writeFileSync(i,"");core_debug("finished caching tool")}function isExplicitVersion(e){const t=semver.clean(e)||"";core.debug(`isExplicit: ${t}`);const A=semver.valid(t)!=null;core.debug(`explicit? ${A}`);return A}function evaluateVersions(e,t){let A="";core.debug(`evaluating ${e.length} versions`);e=e.sort(((e,t)=>{if(semver.gt(e,t)){return 1}return-1}));for(let r=e.length-1;r>=0;r--){const n=e[r];const s=semver.satisfies(n,t);if(s){A=n;break}}if(A){core.debug(`matched: ${A}`)}else{core.debug("match not found")}return A}function _getCacheDirectory(){const e=process.env["RUNNER_TOOL_CACHE"]||"";(0,i.ok)(e,"Expected RUNNER_TOOL_CACHE to be defined");return e}function _getTempDirectory(){const e=process.env["RUNNER_TEMP"]||"";(0,i.ok)(e,"Expected RUNNER_TEMP to be defined");return e}function _getGlobal(e,t){const A=global[e];return A!==undefined?A:t}function _unique(e){return Array.from(new Set(e))}async function install(e,t){const A=await getRelease(e,t);const r=getFilename(e);const i=`https://github.com/goreleaser/${e}/releases/download/${A.tag_name}`;const o=`${i}/${r}`;info(`Downloading ${o}`);const a=await downloadTool(o);core_debug(`Downloaded to ${a}`);await verifyChecksum(e,A.tag_name,a,r);info("Extracting GoReleaser");let c;if(JA=="win32"){if(!a.endsWith(".zip")){const e=a+".zip";n.renameSync(a,e);c=await extractZip(e)}else{c=await extractZip(a)}}else{c=await extractTar(a)}core_debug(`Extracted to ${c}`);const l=await cacheDir(c,"goreleaser-action",A.tag_name.replace(/^v/,""));core_debug(`Cached to ${l}`);const u=s.join(l,JA=="win32"?"goreleaser.exe":"goreleaser");core_debug(`Exe path is ${u}`);return u}async function verifyChecksum(e,t,A,r){const s=`https://github.com/goreleaser/${e}/releases/download/${t}`;let i;try{info(`Downloading ${s}/checksums.txt`);i=await downloadTool(`${s}/checksums.txt`)}catch(e){warning(`Skipping checksum verification: unable to download checksums.txt: ${e.message}`);return}const o=xt.createHash("sha256").update(n.readFileSync(A)).digest("hex");const a=findChecksum(n.readFileSync(i,"utf8"),r);if(!a){throw new Error(`Could not find ${r} in checksums.txt`)}if(a.toLowerCase()!==o.toLowerCase()){throw new Error(`Checksum mismatch for ${r}: expected ${a}, got ${o}`)}info(`Checksum verified for ${r}`);await verifyCosignSignature(e,t,s,i)}const findChecksum=(e,t)=>{const A=e.split("\n").map((e=>e.trim().split(/\s+/))).find((e=>e.length>=2&&e[1].replace(/^[*]/,"")===t));return A?A[0]:undefined};async function verifyCosignSignature(e,t,A,r){const n=await which("cosign",false);if(!n){info("cosign not found in PATH, skipping signature verification");return}let s;try{info(`Downloading ${A}/checksums.txt.sigstore.json`);s=await downloadTool(`${A}/checksums.txt.sigstore.json`)}catch(e){warning(`Skipping cosign signature verification: unable to download sigstore bundle: ${e.message}`);return}const i=getCertificateIdentity(e,t);info(`Verifying checksums.txt signature with cosign (identity: ${i})`);await exec_exec(n,["verify-blob","--certificate-identity",i,"--certificate-oidc-issuer","https://token.actions.githubusercontent.com","--bundle",s,r]);info("cosign signature verified")}const getCertificateIdentity=(e,t)=>{const A=isPro(e);if(isNightlyTag(t)){const e=A?"nightly-pro.yml":"nightly-oss.yml";const t=A?"goreleaser-pro-internal":"goreleaser";return`https://github.com/goreleaser/${t}/.github/workflows/${e}@refs/heads/main`}if(A){return`https://github.com/goreleaser/goreleaser-pro-internal/.github/workflows/release-pro.yml@refs/tags/${t}`}return`https://github.com/goreleaser/goreleaser/.github/workflows/release.yml@refs/tags/${t}`};const distribSuffix=e=>isPro(e)?"-pro":"";const isPro=e=>e==="goreleaser-pro";const getFilename=e=>{let t;switch(VA){case"x64":{t="x86_64";break}case"x32":{t="i386";break}case"arm":{const e=process.config.variables.arm_version;t=e?"armv"+e:"arm";break}default:{t=VA;break}}if(JA=="darwin"){t="all"}const A=JA=="win32"?"Windows":JA=="darwin"?"Darwin":"Linux";const r=JA=="win32"?"zip":"tar.gz";const n=distribSuffix(e);return`goreleaser${n}_${A}_${t}.${r}`};async function getDistPath(e){const t=$n.load(n.readFileSync(e,"utf8"));return t.dist||"dist"}async function getArtifacts(e){const t=s.join(e,"artifacts.json");if(!n.existsSync(t)){return undefined}const A=n.readFileSync(t,{encoding:"utf-8"}).trim();if(A==="null"){return undefined}return A}async function getMetadata(e){const t=s.join(e,"metadata.json");if(!n.existsSync(t)){return undefined}const A=n.readFileSync(t,{encoding:"utf-8"}).trim();if(A==="null"){return undefined}return A}function getRequestedVersion(e){if(!e.versionFile){return e.version}const t=s.isAbsolute(e.versionFile)?e.versionFile:s.join(e.workdir||".",e.versionFile);if(!n.existsSync(t)){throw new Error(`version-file not found: ${t}`)}const A=s.basename(t);const r=n.readFileSync(t,"utf-8");switch(A){case".tool-versions":return parseToolVersions(r,t);default:throw new Error(`Unsupported version-file: ${t} (only .tool-versions is supported)`)}}function parseToolVersions(e,t){for(const A of e.split("\n")){const e=A.replace(/#.*$/,"").trim();if(!e){continue}const r=e.split(/\s+/);if(r[0]!=="goreleaser"){continue}const n=r[1];if(!n){throw new Error(`No version specified for goreleaser in ${t}`)}return/^\d/.test(n)?`v${n}`:n}throw new Error(`No goreleaser entry found in ${t}`)}async function run(){try{const e=await getInputs();const t=getRequestedVersion(e);const A=await install(e.distribution,t);info(`GoReleaser ${t} installed successfully`);if(e.installOnly){const e=s.dirname(A);addPath(e);core_debug(`Added ${e} to PATH`);return}else if(!e.args){setFailed("args input required");return}if(e.workdir&&e.workdir!=="."){info(`Using ${e.workdir} as working directory`);process.chdir(e.workdir)}let r;const i=Lt(e.args).parseSync();if(i.config){r=i.config}else{[".config/goreleaser.yaml",".config/goreleaser.yml",".goreleaser.yaml",".goreleaser.yml","goreleaser.yaml","goreleaser.yml"].forEach((e=>{if(n.existsSync(e)){r=e}}))}await exec_exec(`${A} ${e.args}`);if(typeof r==="string"){const e=await getArtifacts(await getDistPath(r));if(e){await group(`Artifacts output`,(async()=>{info(e);setOutput("artifacts",e)}))}const t=await getMetadata(await getDistPath(r));if(t){await group(`Metadata output`,(async()=>{info(t);setOutput("metadata",t)}))}}}catch(e){setFailed(e.message)}}run(); \ No newline at end of file +function isNothing(e){return typeof e==="undefined"||e===null}function isObject(e){return typeof e==="object"&&e!==null}function toArray(e){if(Array.isArray(e))return e;else if(isNothing(e))return[];return[e]}function extend(e,t){var A,r,n,s;if(t){s=Object.keys(t);for(A=0,r=s.length;Ao){s=" ... ";t=r-o+s.length}if(A-r>o){i=" ...";A=r+o-i.length}return{str:s+e.slice(t,A).replace(/\t/g,"→")+i,pos:r-t+s.length}}function padStart(e,t){return zA.repeat(" ",t-e.length)+e}function makeSnippet(e,t){t=Object.create(t||null);if(!e.buffer)return null;if(!t.maxLength)t.maxLength=79;if(typeof t.indent!=="number")t.indent=1;if(typeof t.linesBefore!=="number")t.linesBefore=3;if(typeof t.linesAfter!=="number")t.linesAfter=2;var A=/\r?\n|\r|\0/g;var r=[0];var n=[];var s;var i=-1;while(s=A.exec(e.buffer)){n.push(s.index);r.push(s.index+s[0].length);if(e.position<=s.index&&i<0){i=r.length-2}}if(i<0)i=r.length-1;var o="",a,c;var l=Math.min(e.line+t.linesAfter,n.length).toString().length;var u=t.maxLength-(t.indent+l+3);for(a=1;a<=t.linesBefore;a++){if(i-a<0)break;c=getLine(e.buffer,r[i-a],n[i-a],e.position-(r[i]-r[i-a]),u);o=zA.repeat(" ",t.indent)+padStart((e.line-a+1).toString(),l)+" | "+c.str+"\n"+o}c=getLine(e.buffer,r[i],n[i],e.position,u);o+=zA.repeat(" ",t.indent)+padStart((e.line+1).toString(),l)+" | "+c.str+"\n";o+=zA.repeat("-",t.indent+l+3+c.pos)+"^"+"\n";for(a=1;a<=t.linesAfter;a++){if(i+a>=n.length)break;c=getLine(e.buffer,r[i+a],n[i+a],e.position-(r[i]-r[i+a]),u);o+=zA.repeat(" ",t.indent)+padStart((e.line+a+1).toString(),l)+" | "+c.str+"\n"}return o.replace(/\n$/,"")}var KA=makeSnippet;var XA=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"];var er=["scalar","sequence","mapping"];function compileStyleAliases(e){var t={};if(e!==null){Object.keys(e).forEach((function(A){e[A].forEach((function(e){t[String(e)]=A}))}))}return t}function Type$1(e,t){t=t||{};Object.keys(t).forEach((function(t){if(XA.indexOf(t)===-1){throw new ZA('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')}}));this.options=t;this.tag=e;this.kind=t["kind"]||null;this.resolve=t["resolve"]||function(){return true};this.construct=t["construct"]||function(e){return e};this.instanceOf=t["instanceOf"]||null;this.predicate=t["predicate"]||null;this.represent=t["represent"]||null;this.representName=t["representName"]||null;this.defaultStyle=t["defaultStyle"]||null;this.multi=t["multi"]||false;this.styleAliases=compileStyleAliases(t["styleAliases"]||null);if(er.indexOf(this.kind)===-1){throw new ZA('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}}var tr=Type$1;function compileList(e,t){var A=[];e[t].forEach((function(e){var t=A.length;A.forEach((function(A,r){if(A.tag===e.tag&&A.kind===e.kind&&A.multi===e.multi){t=r}}));A[t]=e}));return A}function compileMap(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,A;function collectType(t){if(t.multi){e.multi[t.kind].push(t);e.multi["fallback"].push(t)}else{e[t.kind][t.tag]=e["fallback"][t.tag]=t}}for(t=0,A=arguments.length;t=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}});var lr=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?"+"|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?"+"|[-+]?\\.(?:inf|Inf|INF)"+"|\\.(?:nan|NaN|NAN))$");function resolveYamlFloat(e){if(e===null)return false;if(!lr.test(e)||e[e.length-1]==="_"){return false}return true}function constructYamlFloat(e){var t,A;t=e.replace(/_/g,"").toLowerCase();A=t[0]==="-"?-1:1;if("+-".indexOf(t[0])>=0){t=t.slice(1)}if(t===".inf"){return A===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY}else if(t===".nan"){return NaN}return A*parseFloat(t,10)}var ur=/^[-+]?[0-9]+e/;function representYamlFloat(e,t){var A;if(isNaN(e)){switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}}else if(Number.POSITIVE_INFINITY===e){switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}}else if(Number.NEGATIVE_INFINITY===e){switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}}else if(zA.isNegativeZero(e)){return"-0.0"}A=e.toString(10);return ur.test(A)?A.replace("e",".e"):A}function isFloat(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||zA.isNegativeZero(e))}var gr=new tr("tag:yaml.org,2002:float",{kind:"scalar",resolve:resolveYamlFloat,construct:constructYamlFloat,predicate:isFloat,represent:representYamlFloat,defaultStyle:"lowercase"});var hr=ir.extend({implicit:[or,ar,cr,gr]});var Er=hr;var fr=new RegExp("^([0-9][0-9][0-9][0-9])"+"-([0-9][0-9])"+"-([0-9][0-9])$");var dr=new RegExp("^([0-9][0-9][0-9][0-9])"+"-([0-9][0-9]?)"+"-([0-9][0-9]?)"+"(?:[Tt]|[ \\t]+)"+"([0-9][0-9]?)"+":([0-9][0-9])"+":([0-9][0-9])"+"(?:\\.([0-9]*))?"+"(?:[ \\t]*(Z|([-+])([0-9][0-9]?)"+"(?::([0-9][0-9]))?))?$");function resolveYamlTimestamp(e){if(e===null)return false;if(fr.exec(e)!==null)return true;if(dr.exec(e)!==null)return true;return false}function constructYamlTimestamp(e){var t,A,r,n,s,i,o,a=0,c=null,l,u,g;t=fr.exec(e);if(t===null)t=dr.exec(e);if(t===null)throw new Error("Date resolve error");A=+t[1];r=+t[2]-1;n=+t[3];if(!t[4]){return new Date(Date.UTC(A,r,n))}s=+t[4];i=+t[5];o=+t[6];if(t[7]){a=t[7].slice(0,3);while(a.length<3){a+="0"}a=+a}if(t[9]){l=+t[10];u=+(t[11]||0);c=(l*60+u)*6e4;if(t[9]==="-")c=-c}g=new Date(Date.UTC(A,r,n,s,i,o,a));if(c)g.setTime(g.getTime()-c);return g}function representYamlTimestamp(e){return e.toISOString()}var Cr=new tr("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:resolveYamlTimestamp,construct:constructYamlTimestamp,instanceOf:Date,represent:representYamlTimestamp});function resolveYamlMerge(e){return e==="<<"||e===null}var Qr=new tr("tag:yaml.org,2002:merge",{kind:"scalar",resolve:resolveYamlMerge});var Br="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";function resolveYamlBinary(e){if(e===null)return false;var t,A,r=0,n=e.length,s=Br;for(A=0;A64)continue;if(t<0)return false;r+=6}return r%8===0}function constructYamlBinary(e){var t,A,r=e.replace(/[\r\n=]/g,""),n=r.length,s=Br,i=0,o=[];for(t=0;t>16&255);o.push(i>>8&255);o.push(i&255)}i=i<<6|s.indexOf(r.charAt(t))}A=n%4*6;if(A===0){o.push(i>>16&255);o.push(i>>8&255);o.push(i&255)}else if(A===18){o.push(i>>10&255);o.push(i>>2&255)}else if(A===12){o.push(i>>4&255)}return new Uint8Array(o)}function representYamlBinary(e){var t="",A=0,r,n,s=e.length,i=Br;for(r=0;r>18&63];t+=i[A>>12&63];t+=i[A>>6&63];t+=i[A&63]}A=(A<<8)+e[r]}n=s%3;if(n===0){t+=i[A>>18&63];t+=i[A>>12&63];t+=i[A>>6&63];t+=i[A&63]}else if(n===2){t+=i[A>>10&63];t+=i[A>>4&63];t+=i[A<<2&63];t+=i[64]}else if(n===1){t+=i[A>>2&63];t+=i[A<<4&63];t+=i[64];t+=i[64]}return t}function isBinary(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var Ir=new tr("tag:yaml.org,2002:binary",{kind:"scalar",resolve:resolveYamlBinary,construct:constructYamlBinary,predicate:isBinary,represent:representYamlBinary});var pr=Object.prototype.hasOwnProperty;var Dr=Object.prototype.toString;function resolveYamlOmap(e){if(e===null)return true;var t=[],A,r,n,s,i,o=e;for(A=0,r=o.length;A>10)+55296,(e-65536&1023)+56320)}function setProperty(e,t,A){if(t==="__proto__"){Object.defineProperty(e,t,{configurable:true,enumerable:true,writable:true,value:A})}else{e[t]=A}}var Jr=new Array(256);var Vr=new Array(256);for(var Pr=0;Pr<256;Pr++){Jr[Pr]=simpleEscapeSequence(Pr)?1:0;Vr[Pr]=simpleEscapeSequence(Pr)}function State$1(e,t){this.input=e;this.filename=t["filename"]||null;this.schema=t["schema"]||kr;this.onWarning=t["onWarning"]||null;this.legacy=t["legacy"]||false;this.json=t["json"]||false;this.listener=t["listener"]||null;this.implicitTypes=this.schema.compiledImplicit;this.typeMap=this.schema.compiledTypeMap;this.length=e.length;this.position=0;this.line=0;this.lineStart=0;this.lineIndent=0;this.firstTabInLine=-1;this.documents=[]}function generateError(e,t){var A={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};A.snippet=KA(A);return new ZA(t,A)}function throwError(e,t){throw generateError(e,t)}function throwWarning(e,t){if(e.onWarning){e.onWarning.call(null,generateError(e,t))}}var Wr={YAML:function handleYamlDirective(e,t,A){var r,n,s;if(e.version!==null){throwError(e,"duplication of %YAML directive")}if(A.length!==1){throwError(e,"YAML directive accepts exactly one argument")}r=/^([0-9]+)\.([0-9]+)$/.exec(A[0]);if(r===null){throwError(e,"ill-formed argument of the YAML directive")}n=parseInt(r[1],10);s=parseInt(r[2],10);if(n!==1){throwError(e,"unacceptable YAML version of the document")}e.version=A[0];e.checkLineBreaks=s<2;if(s!==1&&s!==2){throwWarning(e,"unsupported YAML version of the document")}},TAG:function handleTagDirective(e,t,A){var r,n;if(A.length!==2){throwError(e,"TAG directive accepts exactly two arguments")}r=A[0];n=A[1];if(!Gr.test(r)){throwError(e,"ill-formed tag handle (first argument) of the TAG directive")}if(Rr.call(e.tagMap,r)){throwError(e,'there is a previously declared suffix for "'+r+'" tag handle')}if(!Or.test(n)){throwError(e,"ill-formed tag prefix (second argument) of the TAG directive")}try{n=decodeURIComponent(n)}catch(t){throwError(e,"tag prefix is malformed: "+n)}e.tagMap[r]=n}};function captureSegment(e,t,A,r){var n,s,i,o;if(t1){e.result+=zA.repeat("\n",t-1)}}function readPlainScalar(e,t,A){var r,n,s,i,o,a,c,l,u=e.kind,g=e.result,h;h=e.input.charCodeAt(e.position);if(is_WS_OR_EOL(h)||is_FLOW_INDICATOR(h)||h===35||h===38||h===42||h===33||h===124||h===62||h===39||h===34||h===37||h===64||h===96){return false}if(h===63||h===45){n=e.input.charCodeAt(e.position+1);if(is_WS_OR_EOL(n)||A&&is_FLOW_INDICATOR(n)){return false}}e.kind="scalar";e.result="";s=i=e.position;o=false;while(h!==0){if(h===58){n=e.input.charCodeAt(e.position+1);if(is_WS_OR_EOL(n)||A&&is_FLOW_INDICATOR(n)){break}}else if(h===35){r=e.input.charCodeAt(e.position-1);if(is_WS_OR_EOL(r)){break}}else if(e.position===e.lineStart&&testDocumentSeparator(e)||A&&is_FLOW_INDICATOR(h)){break}else if(is_EOL(h)){a=e.line;c=e.lineStart;l=e.lineIndent;skipSeparationSpace(e,false,-1);if(e.lineIndent>=t){o=true;h=e.input.charCodeAt(e.position);continue}else{e.position=i;e.line=a;e.lineStart=c;e.lineIndent=l;break}}if(o){captureSegment(e,s,i,false);writeFoldedLines(e,e.line-a);s=i=e.position;o=false}if(!is_WHITE_SPACE(h)){i=e.position+1}h=e.input.charCodeAt(++e.position)}captureSegment(e,s,i,false);if(e.result){return true}e.kind=u;e.result=g;return false}function readSingleQuotedScalar(e,t){var A,r,n;A=e.input.charCodeAt(e.position);if(A!==39){return false}e.kind="scalar";e.result="";e.position++;r=n=e.position;while((A=e.input.charCodeAt(e.position))!==0){if(A===39){captureSegment(e,r,e.position,true);A=e.input.charCodeAt(++e.position);if(A===39){r=e.position;e.position++;n=e.position}else{return true}}else if(is_EOL(A)){captureSegment(e,r,n,true);writeFoldedLines(e,skipSeparationSpace(e,false,t));r=n=e.position}else if(e.position===e.lineStart&&testDocumentSeparator(e)){throwError(e,"unexpected end of the document within a single quoted scalar")}else{e.position++;n=e.position}}throwError(e,"unexpected end of the stream within a single quoted scalar")}function readDoubleQuotedScalar(e,t){var A,r,n,s,i,o;o=e.input.charCodeAt(e.position);if(o!==34){return false}e.kind="scalar";e.result="";e.position++;A=r=e.position;while((o=e.input.charCodeAt(e.position))!==0){if(o===34){captureSegment(e,A,e.position,true);e.position++;return true}else if(o===92){captureSegment(e,A,e.position,true);o=e.input.charCodeAt(++e.position);if(is_EOL(o)){skipSeparationSpace(e,false,t)}else if(o<256&&Jr[o]){e.result+=Vr[o];e.position++}else if((i=escapedHexLen(o))>0){n=i;s=0;for(;n>0;n--){o=e.input.charCodeAt(++e.position);if((i=fromHexCode(o))>=0){s=(s<<4)+i}else{throwError(e,"expected hexadecimal character")}}e.result+=charFromCodepoint(s);e.position++}else{throwError(e,"unknown escape sequence")}A=r=e.position}else if(is_EOL(o)){captureSegment(e,A,r,true);writeFoldedLines(e,skipSeparationSpace(e,false,t));A=r=e.position}else if(e.position===e.lineStart&&testDocumentSeparator(e)){throwError(e,"unexpected end of the document within a double quoted scalar")}else{e.position++;r=e.position}}throwError(e,"unexpected end of the stream within a double quoted scalar")}function readFlowCollection(e,t){var A=true,r,n,s,i=e.tag,o,a=e.anchor,c,l,u,g,h,E=Object.create(null),f,d,C,Q;Q=e.input.charCodeAt(e.position);if(Q===91){l=93;h=false;o=[]}else if(Q===123){l=125;h=true;o={}}else{return false}if(e.anchor!==null){e.anchorMap[e.anchor]=o}Q=e.input.charCodeAt(++e.position);while(Q!==0){skipSeparationSpace(e,true,t);Q=e.input.charCodeAt(e.position);if(Q===l){e.position++;e.tag=i;e.anchor=a;e.kind=h?"mapping":"sequence";e.result=o;return true}else if(!A){throwError(e,"missed comma between flow collection entries")}else if(Q===44){throwError(e,"expected the node content, but found ','")}d=f=C=null;u=g=false;if(Q===63){c=e.input.charCodeAt(e.position+1);if(is_WS_OR_EOL(c)){u=g=true;e.position++;skipSeparationSpace(e,true,t)}}r=e.line;n=e.lineStart;s=e.position;composeNode(e,t,Sr,false,true);d=e.tag;f=e.result;skipSeparationSpace(e,true,t);Q=e.input.charCodeAt(e.position);if((g||e.line===r)&&Q===58){u=true;Q=e.input.charCodeAt(++e.position);skipSeparationSpace(e,true,t);composeNode(e,t,Sr,false,true);C=e.result}if(h){storeMappingPair(e,o,E,d,f,C,r,n,s)}else if(u){o.push(storeMappingPair(e,null,E,d,f,C,r,n,s))}else{o.push(f)}skipSeparationSpace(e,true,t);Q=e.input.charCodeAt(e.position);if(Q===44){A=true;Q=e.input.charCodeAt(++e.position)}else{A=false}}throwError(e,"unexpected end of the stream within a flow collection")}function readBlockScalar(e,t){var A,r,n=Lr,s=false,i=false,o=t,a=0,c=false,l,u;u=e.input.charCodeAt(e.position);if(u===124){r=false}else if(u===62){r=true}else{return false}e.kind="scalar";e.result="";while(u!==0){u=e.input.charCodeAt(++e.position);if(u===43||u===45){if(Lr===n){n=u===43?Tr:vr}else{throwError(e,"repeat of a chomping mode identifier")}}else if((l=fromDecimalCode(u))>=0){if(l===0){throwError(e,"bad explicit indentation width of a block scalar; it cannot be less than one")}else if(!i){o=t+l-1;i=true}else{throwError(e,"repeat of an indentation width identifier")}}else{break}}if(is_WHITE_SPACE(u)){do{u=e.input.charCodeAt(++e.position)}while(is_WHITE_SPACE(u));if(u===35){do{u=e.input.charCodeAt(++e.position)}while(!is_EOL(u)&&u!==0)}}while(u!==0){readLineBreak(e);e.lineIndent=0;u=e.input.charCodeAt(e.position);while((!i||e.lineIndento){o=e.lineIndent}if(is_EOL(u)){a++;continue}if(e.lineIndentt)&&a!==0){throwError(e,"bad indentation of a sequence entry")}else if(e.lineIndentt){if(d){i=e.line;o=e.lineStart;a=e.position}if(composeNode(e,t,Ur,true,n)){if(d){E=e.result}else{f=e.result}}if(!d){storeMappingPair(e,u,g,h,E,f,i,o,a);h=E=f=null}skipSeparationSpace(e,true,-1);Q=e.input.charCodeAt(e.position)}if((e.line===s||e.lineIndent>t)&&Q!==0){throwError(e,"bad indentation of a mapping entry")}else if(e.lineIndentt){a=1}else if(e.lineIndent===t){a=0}else if(e.lineIndentt){a=1}else if(e.lineIndent===t){a=0}else if(e.lineIndent tag; it should be "scalar", not "'+e.kind+'"')}for(u=0,g=e.implicitTypes.length;u")}if(e.result!==null&&E.kind!==e.kind){throwError(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+E.kind+'", not "'+e.kind+'"')}if(!E.resolve(e.result,e.tag)){throwError(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}else{e.result=E.construct(e.result,e.tag);if(e.anchor!==null){e.anchorMap[e.anchor]=e.result}}}if(e.listener!==null){e.listener("close",e)}return e.tag!==null||e.anchor!==null||l}function readDocument(e){var t=e.position,A,r,n,s=false,i;e.version=null;e.checkLineBreaks=e.legacy;e.tagMap=Object.create(null);e.anchorMap=Object.create(null);while((i=e.input.charCodeAt(e.position))!==0){skipSeparationSpace(e,true,-1);i=e.input.charCodeAt(e.position);if(e.lineIndent>0||i!==37){break}s=true;i=e.input.charCodeAt(++e.position);A=e.position;while(i!==0&&!is_WS_OR_EOL(i)){i=e.input.charCodeAt(++e.position)}r=e.input.slice(A,e.position);n=[];if(r.length<1){throwError(e,"directive name must not be less than one character in length")}while(i!==0){while(is_WHITE_SPACE(i)){i=e.input.charCodeAt(++e.position)}if(i===35){do{i=e.input.charCodeAt(++e.position)}while(i!==0&&!is_EOL(i));break}if(is_EOL(i))break;A=e.position;while(i!==0&&!is_WS_OR_EOL(i)){i=e.input.charCodeAt(++e.position)}n.push(e.input.slice(A,e.position))}if(i!==0)readLineBreak(e);if(Rr.call(Wr,r)){Wr[r](e,r,n)}else{throwWarning(e,'unknown document directive "'+r+'"')}}skipSeparationSpace(e,true,-1);if(e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45){e.position+=3;skipSeparationSpace(e,true,-1)}else if(s){throwError(e,"directives end mark is expected")}composeNode(e,e.lineIndent-1,Ur,false,true);skipSeparationSpace(e,true,-1);if(e.checkLineBreaks&&Yr.test(e.input.slice(t,e.position))){throwWarning(e,"non-ASCII line breaks are interpreted as content")}e.documents.push(e.result);if(e.position===e.lineStart&&testDocumentSeparator(e)){if(e.input.charCodeAt(e.position)===46){e.position+=3;skipSeparationSpace(e,true,-1)}return}if(e.position=55296&&A<=56319&&t+1=56320&&r<=57343){return(A-55296)*1024+r-56320+65536}}return A}function needIndentIndicator(e){var t=/^\n* /;return t.test(e)}var kn=1,Rn=2,Sn=3,Nn=4,Mn=5;function chooseScalarStyle(e,t,A,r,n,s,i,o){var a;var c=0;var l=null;var u=false;var g=false;var h=r!==-1;var E=-1;var f=isPlainSafeFirst(codePointAt(e,0))&&isPlainSafeLast(codePointAt(e,e.length-1));if(t||i){for(a=0;a=65536?a+=2:a++){c=codePointAt(e,a);if(!isPrintable(c)){return Mn}f=f&&isPlainSafe(c,l,o);l=c}}else{for(a=0;a=65536?a+=2:a++){c=codePointAt(e,a);if(c===Xr){u=true;if(h){g=g||a-E-1>r&&e[E+1]!==" ";E=a}}else if(!isPrintable(c)){return Mn}f=f&&isPlainSafe(c,l,o);l=c}g=g||h&&(a-E-1>r&&e[E+1]!==" ")}if(!u&&!g){if(f&&!i&&!n(e)){return kn}return s===bn?Mn:Rn}if(A>9&&needIndentIndicator(e)){return Mn}if(!i){return g?Nn:Sn}return s===bn?Mn:Rn}function writeScalar(e,t,A,r,n){e.dump=function(){if(t.length===0){return e.quotingType===bn?'""':"''"}if(!e.noCompatMode){if(yn.indexOf(t)!==-1||wn.test(t)){return e.quotingType===bn?'"'+t+'"':"'"+t+"'"}}var s=e.indent*Math.max(1,A);var i=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-s);var o=r||e.flowLevel>-1&&A>=e.flowLevel;function testAmbiguity(t){return testImplicitResolving(e,t)}switch(chooseScalarStyle(t,o,e.indent,i,testAmbiguity,e.quotingType,e.forceQuotes&&!r,n)){case kn:return t;case Rn:return"'"+t.replace(/'/g,"''")+"'";case Sn:return"|"+blockHeader(t,e.indent)+dropEndingNewline(indentString(t,s));case Nn:return">"+blockHeader(t,e.indent)+dropEndingNewline(indentString(foldString(t,i),s));case Mn:return'"'+escapeString(t)+'"';default:throw new ZA("impossible error: invalid scalar style")}}()}function blockHeader(e,t){var A=needIndentIndicator(e)?String(t):"";var r=e[e.length-1]==="\n";var n=r&&(e[e.length-2]==="\n"||e==="\n");var s=n?"+":r?"":"-";return A+s+"\n"}function dropEndingNewline(e){return e[e.length-1]==="\n"?e.slice(0,-1):e}function foldString(e,t){var A=/(\n+)([^\n]*)/g;var r=function(){var r=e.indexOf("\n");r=r!==-1?r:e.length;A.lastIndex=r;return foldLine(e.slice(0,r),t)}();var n=e[0]==="\n"||e[0]===" ";var s;var i;while(i=A.exec(e)){var o=i[1],a=i[2];s=a[0]===" ";r+=o+(!n&&!s&&a!==""?"\n":"")+foldLine(a,t);n=s}return r}function foldLine(e,t){if(e===""||e[0]===" ")return e;var A=/ [^ ]/g;var r;var n=0,s,i=0,o=0;var a="";while(r=A.exec(e)){o=r.index;if(o-n>t){s=i>n?i:o;a+="\n"+e.slice(n,s);n=s+1}i=o}a+="\n";if(e.length-n>t&&i>n){a+=e.slice(n,i)+"\n"+e.slice(i+1)}else{a+=e.slice(n)}return a.slice(1)}function escapeString(e){var t="";var A=0;var r;for(var n=0;n=65536?n+=2:n++){A=codePointAt(e,n);r=mn[A];if(!r&&isPrintable(A)){t+=e[n];if(A>=65536)t+=e[n+1]}else{t+=r||encodeHex(A)}}return t}function writeFlowSequence(e,t,A){var r="",n=e.tag,s,i,o;for(s=0,i=A.length;s1024)l+="? ";l+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" ");if(!writeNode(e,t,c,false,false)){continue}l+=e.dump;r+=l}e.tag=n;e.dump="{"+r+"}"}function writeBlockMapping(e,t,A,r){var n="",s=e.tag,i=Object.keys(A),o,a,c,l,u,g;if(e.sortKeys===true){i.sort()}else if(typeof e.sortKeys==="function"){i.sort(e.sortKeys)}else if(e.sortKeys){throw new ZA("sortKeys must be a boolean or a function")}for(o=0,a=i.length;o1024;if(u){if(e.dump&&Xr===e.dump.charCodeAt(0)){g+="?"}else{g+="? "}}g+=e.dump;if(u){g+=generateNextLine(e,t)}if(!writeNode(e,t+1,l,true,u)){continue}if(e.dump&&Xr===e.dump.charCodeAt(0)){g+=":"}else{g+=": "}g+=e.dump;n+=g}e.tag=s;e.dump=n||"{}"}function detectType(e,t,A){var r,n,s,i,o,a;n=A?e.explicitTypes:e.implicitTypes;for(s=0,i=n.length;s tag resolver accepts not "'+a+'" style')}e.dump=r}return true}}return false}function writeNode(e,t,A,r,n,s,i){e.tag=null;e.dump=A;if(!detectType(e,A,false)){detectType(e,A,true)}var o=$r.call(e.dump);var a=r;var c;if(r){r=e.flowLevel<0||e.flowLevel>t}var l=o==="[object Object]"||o==="[object Array]",u,g;if(l){u=e.duplicates.indexOf(A);g=u!==-1}if(e.tag!==null&&e.tag!=="?"||g||e.indent!==2&&t>0){n=false}if(g&&e.usedDuplicates[u]){e.dump="*ref_"+u}else{if(l&&g&&!e.usedDuplicates[u]){e.usedDuplicates[u]=true}if(o==="[object Object]"){if(r&&Object.keys(e.dump).length!==0){writeBlockMapping(e,t,e.dump,n);if(g){e.dump="&ref_"+u+e.dump}}else{writeFlowMapping(e,t,e.dump);if(g){e.dump="&ref_"+u+" "+e.dump}}}else if(o==="[object Array]"){if(r&&e.dump.length!==0){if(e.noArrayIndent&&!i&&t>0){writeBlockSequence(e,t-1,e.dump,n)}else{writeBlockSequence(e,t,e.dump,n)}if(g){e.dump="&ref_"+u+e.dump}}else{writeFlowSequence(e,t,e.dump);if(g){e.dump="&ref_"+u+" "+e.dump}}}else if(o==="[object String]"){if(e.tag!=="?"){writeScalar(e,e.dump,t,s,a)}}else if(o==="[object Undefined]"){return false}else{if(e.skipInvalid)return false;throw new ZA("unacceptable kind of an object to dump "+o)}if(e.tag!==null&&e.tag!=="?"){c=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21");if(e.tag[0]==="!"){c="!"+c}else if(c.slice(0,18)==="tag:yaml.org,2002:"){c="!!"+c.slice(18)}else{c="!<"+c+">"}e.dump=c+" "+e.dump}}return true}function getDuplicateReferences(e,t){var A=[],r=[],n,s;inspectNode(e,A,r);for(n=0,s=r.length;n{let t;for(let A=0;A<=Zn;A++){try{return await e()}catch(e){t=e;if(A===Zn){break}core_debug(`Attempt ${A+1} failed, retrying in ${Kn}: ${t.message}`);await new Promise((e=>setTimeout(e,Kn)))}}throw t};const Xn=/^v\d+\.\d+\.\d+-[0-9a-f]+-nightly$/i;const isNightlyTag=e=>Xn.test(e);const getRelease=async(e,t)=>{if(t==="latest"){warning("You are using 'latest' as default version. Will lock to '~> v2'.");return getReleaseTag(e,"~> v2")}return getReleaseTag(e,t)};const getReleaseTag=async(e,t)=>{if(t==="nightly"){return resolveNightly(e)}const A=cleanTag(t);if(zn.valid(A)){let r=t.startsWith("v")?t:`v${t}`;if(isPro(e)&&zn.lt(A,"2.7.0")&&!r.endsWith("-pro")){r=r+distribSuffix(e)}return{tag_name:r}}const r=await resolveVersion(e,t)||t;const n=distribSuffix(e);const s=`https://goreleaser.com/releases${n}.json`;const i=await withRetry((async()=>{const e=new lib_HttpClient("goreleaser-action");const A=await e.get(s);const r=await A.readBody();const n=A.message.statusCode||500;if(n>=400){throw new Error(`Failed to get GoReleaser release ${t} from ${s} with status code ${n}: ${r}`)}return JSON.parse(r)}));const o=i.filter((e=>e.tag_name===r)).shift();if(o){return o}throw new Error(`Cannot find GoReleaser release ${t} in ${s}`)};const resolveNightly=async e=>{const t=`https://api.github.com/repos/goreleaser/${e}/releases?per_page=100`;core_debug(`Resolving latest nightly release from ${t}`);const A=await withRetry((async()=>{const e=new lib_HttpClient("goreleaser-action");const A={Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"};const r=process.env.GITHUB_TOKEN;if(r){A["Authorization"]=`Bearer ${r}`}const n=await e.get(t,A);const s=await n.readBody();const i=n.message.statusCode||500;if(i>=400){throw new Error(`Failed to list releases from ${t} with status code ${i}: ${s}`)}return JSON.parse(s)}));const r=A.find((e=>Xn.test(e.tag_name)));if(!r){throw new Error(`No '--nightly' release found in ${t}`)}info(`Resolved nightly to ${r.tag_name}`);return r};const resolveVersion=async(e,t)=>{const A=await getAllTags(e);if(!A){throw new Error(`Cannot download ${e} tags`)}core_debug(`Found ${A.length} tags in total`);const r=A.map((e=>cleanTag(e)));const n=cleanTag(t);if(!zn.valid(n)&&!zn.validRange(n)){return t}const s=zn.maxSatisfying(r,n);if(zn.lt(s,"2.7.0")){return s+distribSuffix(e)}return s};const getAllTags=async e=>{const t=distribSuffix(e);const A=`https://goreleaser.com/releases${t}.json`;core_debug(`Downloading ${A}`);return withRetry((async()=>{const e=new lib_HttpClient("goreleaser-action");const t=await e.getJson(A);if(t.result==null){return[]}return t.result.map((e=>e.tag_name))}))};const cleanTag=e=>e.replace(/-pro$/,"");var es=undefined&&undefined.__awaiter||function(e,t,A,r){function adopt(e){return e instanceof A?e:new A((function(t){t(e)}))}return new(A||(A=Promise))((function(A,n){function fulfilled(e){try{step(r.next(e))}catch(e){n(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){n(e)}}function step(e){e.done?A(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())}))};const ts={readLinuxVersionFile(){const e="/etc/lsb-release";const t="/etc/os-release";let A="";if(n.existsSync(e)){A=n.readFileSync(e).toString()}else if(n.existsSync(t)){A=n.readFileSync(t).toString()}return A}};function _findMatch(e,t,A,r){return es(this,void 0,void 0,(function*(){const n=os.platform();let s;let i;let o;for(const s of A){const A=s.version;debug(`check ${A} satisfies ${e}`);if(semver.satisfies(A,e)&&(!t||s.stable===t)){o=s.files.find((e=>{debug(`${e.arch}===${r} && ${e.platform}===${n}`);let t=e.arch===r&&e.platform===n;if(t&&e.platform_version){const A=_getOsVersion();if(A===e.platform_version){t=true}else{t=semver.satisfies(A,e.platform_version)}}return t}));if(o){debug(`matched ${s.version}`);i=s;break}}}if(i&&o){s=Object.assign({},i);s.files=[o]}return s}))}function _getOsVersion(){const e=os.platform();let t="";if(e==="darwin"){t=cp.execSync("sw_vers -productVersion").toString()}else if(e==="linux"){const e=ts.readLinuxVersionFile();if(e){const A=e.split("\n");for(const e of A){const A=e.split("=");if(A.length===2&&(A[0].trim()==="VERSION_ID"||A[0].trim()==="DISTRIB_RELEASE")){t=A[1].trim().replace(/^"/,"").replace(/"$/,"");break}}}}return t}function _readLinuxVersionFile(){return ts.readLinuxVersionFile()}const As=e(import.meta.url)("stream");var rs=undefined&&undefined.__awaiter||function(e,t,A,r){function adopt(e){return e instanceof A?e:new A((function(t){t(e)}))}return new(A||(A=Promise))((function(A,n){function fulfilled(e){try{step(r.next(e))}catch(e){n(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){n(e)}}function step(e){e.done?A(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())}))};class RetryHelper{constructor(e,t,A){if(e<1){throw new Error("max attempts should be greater than or equal to 1")}this.maxAttempts=e;this.minSeconds=Math.floor(t);this.maxSeconds=Math.floor(A);if(this.minSeconds>this.maxSeconds){throw new Error("min seconds should be less than or equal to max seconds")}}execute(e,t){return rs(this,void 0,void 0,(function*(){let A=1;while(AsetTimeout(t,e*1e3)))}))}}var ns=undefined&&undefined.__awaiter||function(e,t,A,r){function adopt(e){return e instanceof A?e:new A((function(t){t(e)}))}return new(A||(A=Promise))((function(A,n){function fulfilled(e){try{step(r.next(e))}catch(e){n(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){n(e)}}function step(e){e.done?A(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())}))};class HTTPError extends Error{constructor(e){super(`Unexpected HTTP response: ${e}`);this.httpStatusCode=e;Object.setPrototypeOf(this,new.target.prototype)}}const ss=process.platform==="win32";const is=process.platform==="darwin";const as="actions/tool-cache";function downloadTool(e,t,A,r){return ns(this,void 0,void 0,(function*(){t=t||s.join(_getTempDirectory(),xt.randomUUID());yield mkdirP(s.dirname(t));core_debug(`Downloading ${e}`);core_debug(`Destination ${t}`);const n=3;const i=_getGlobal("TEST_DOWNLOAD_TOOL_RETRY_MIN_SECONDS",10);const o=_getGlobal("TEST_DOWNLOAD_TOOL_RETRY_MAX_SECONDS",20);const a=new RetryHelper(n,i,o);return yield a.execute((()=>ns(this,void 0,void 0,(function*(){return yield downloadToolAttempt(e,t||"",A,r)}))),(e=>{if(e instanceof HTTPError&&e.httpStatusCode){if(e.httpStatusCode<500&&e.httpStatusCode!==408&&e.httpStatusCode!==429){return false}}return true}))}))}function downloadToolAttempt(e,t,A,r){return ns(this,void 0,void 0,(function*(){if(n.existsSync(t)){throw new Error(`Destination file path ${t} already exists`)}const s=new lib_HttpClient(as,[],{allowRetries:false});if(A){core_debug("set auth");if(r===undefined){r={}}r.authorization=A}const i=yield s.get(e,r);if(i.message.statusCode!==200){const t=new HTTPError(i.message.statusCode);core_debug(`Failed to download from "${e}". Code(${i.message.statusCode}) Message(${i.message.statusMessage})`);throw t}const o=L.promisify(As.pipeline);const a=_getGlobal("TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY",(()=>i.message));const c=a();let l=false;try{yield o(c,n.createWriteStream(t));core_debug("download complete");l=true;return t}finally{if(!l){core_debug("download failed");try{yield rmRF(t)}catch(e){core_debug(`Failed to delete '${t}'. ${e.message}`)}}}}))}function extract7z(e,t,A){return ns(this,void 0,void 0,(function*(){ok(ss,"extract7z() not supported on current OS");ok(e,'parameter "file" is required');t=yield _createExtractFolder(t);const r=process.cwd();process.chdir(t);if(A){try{const t=core.isDebug()?"-bb1":"-bb0";const r=["x",t,"-bd","-sccUTF-8",e];const n={silent:true};yield exec(`"${A}"`,r,n)}finally{process.chdir(r)}}else{const A=path.join(__dirname,"..","scripts","Invoke-7zdec.ps1").replace(/'/g,"''").replace(/"|\n|\r/g,"");const n=e.replace(/'/g,"''").replace(/"|\n|\r/g,"");const s=t.replace(/'/g,"''").replace(/"|\n|\r/g,"");const i=`& '${A}' -Source '${n}' -Target '${s}'`;const o=["-NoLogo","-Sta","-NoProfile","-NonInteractive","-ExecutionPolicy","Unrestricted","-Command",i];const a={silent:true};try{const e=yield io.which("powershell",true);yield exec(`"${e}"`,o,a)}finally{process.chdir(r)}}return t}))}function extractTar(e,t){return ns(this,arguments,void 0,(function*(e,t,A="xz"){if(!e){throw new Error("parameter 'file' is required")}t=yield _createExtractFolder(t);core_debug("Checking tar --version");let r="";yield exec_exec("tar --version",[],{ignoreReturnCode:true,silent:true,listeners:{stdout:e=>r+=e.toString(),stderr:e=>r+=e.toString()}});core_debug(r.trim());const n=r.toUpperCase().includes("GNU TAR");let s;if(A instanceof Array){s=A}else{s=[A]}if(isDebug()&&!A.includes("v")){s.push("-v")}let i=t;let o=e;if(ss&&n){s.push("--force-local");i=t.replace(/\\/g,"/");o=e.replace(/\\/g,"/")}if(n){s.push("--warning=no-unknown-keyword");s.push("--overwrite")}s.push("-C",i,"-f",o);yield exec_exec(`tar`,s);return t}))}function extractXar(e,t){return ns(this,arguments,void 0,(function*(e,t,A=[]){ok(is,"extractXar() not supported on current OS");ok(e,'parameter "file" is required');t=yield _createExtractFolder(t);let r;if(A instanceof Array){r=A}else{r=[A]}r.push("-x","-C",t,"-f",e);if(core.isDebug()){r.push("-v")}const n=yield io.which("xar",true);yield exec(`"${n}"`,_unique(r));return t}))}function extractZip(e,t){return ns(this,void 0,void 0,(function*(){if(!e){throw new Error("parameter 'file' is required")}t=yield _createExtractFolder(t);if(ss){yield extractZipWin(e,t)}else{yield extractZipNix(e,t)}return t}))}function extractZipWin(e,t){return ns(this,void 0,void 0,(function*(){const A=e.replace(/'/g,"''").replace(/"|\n|\r/g,"");const r=t.replace(/'/g,"''").replace(/"|\n|\r/g,"");const n=yield which("pwsh",false);if(n){const e=[`$ErrorActionPreference = 'Stop' ;`,`try { Add-Type -AssemblyName System.IO.Compression.ZipFile } catch { } ;`,`try { [System.IO.Compression.ZipFile]::ExtractToDirectory('${A}', '${r}', $true) }`,`catch { if (($_.Exception.GetType().FullName -eq 'System.Management.Automation.MethodException') -or ($_.Exception.GetType().FullName -eq 'System.Management.Automation.RuntimeException') ){ Expand-Archive -LiteralPath '${A}' -DestinationPath '${r}' -Force } else { throw $_ } } ;`].join(" ");const t=["-NoLogo","-NoProfile","-NonInteractive","-ExecutionPolicy","Unrestricted","-Command",e];core_debug(`Using pwsh at path: ${n}`);yield exec_exec(`"${n}"`,t)}else{const e=[`$ErrorActionPreference = 'Stop' ;`,`try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ;`,`if ((Get-Command -Name Expand-Archive -Module Microsoft.PowerShell.Archive -ErrorAction Ignore)) { Expand-Archive -LiteralPath '${A}' -DestinationPath '${r}' -Force }`,`else {[System.IO.Compression.ZipFile]::ExtractToDirectory('${A}', '${r}', $true) }`].join(" ");const t=["-NoLogo","-Sta","-NoProfile","-NonInteractive","-ExecutionPolicy","Unrestricted","-Command",e];const n=yield which("powershell",true);core_debug(`Using powershell at path: ${n}`);yield exec_exec(`"${n}"`,t)}}))}function extractZipNix(e,t){return ns(this,void 0,void 0,(function*(){const A=yield which("unzip",true);const r=[e];if(!isDebug()){r.unshift("-q")}r.unshift("-o");yield exec_exec(`"${A}"`,r,{cwd:t})}))}function cacheDir(e,t,A,r){return ns(this,void 0,void 0,(function*(){A=zn.clean(A)||A;r=r||vt.arch();core_debug(`Caching tool ${t} ${A} ${r}`);core_debug(`source dir: ${e}`);if(!n.statSync(e).isDirectory()){throw new Error("sourceDir is not a directory")}const i=yield _createToolPath(t,A,r);for(const t of n.readdirSync(e)){const A=s.join(e,t);yield io_cp(A,i,{recursive:true})}_completeToolPath(t,A,r);return i}))}function cacheFile(e,t,A,r,n){return ns(this,void 0,void 0,(function*(){r=semver.clean(r)||r;n=n||os.arch();core.debug(`Caching tool ${A} ${r} ${n}`);core.debug(`source file: ${e}`);if(!fs.statSync(e).isFile()){throw new Error("sourceFile is not a file")}const s=yield _createToolPath(A,r,n);const i=path.join(s,t);core.debug(`destination file ${i}`);yield io.cp(e,i);_completeToolPath(A,r,n);return s}))}function find(e,t,A){if(!e){throw new Error("toolName parameter is required")}if(!t){throw new Error("versionSpec parameter is required")}A=A||os.arch();if(!isExplicitVersion(t)){const r=findAllVersions(e,A);const n=evaluateVersions(r,t);t=n}let r="";if(t){t=semver.clean(t)||"";const n=path.join(_getCacheDirectory(),e,t,A);core.debug(`checking cache: ${n}`);if(fs.existsSync(n)&&fs.existsSync(`${n}.complete`)){core.debug(`Found tool in cache ${e} ${t} ${A}`);r=n}else{core.debug("not found")}}return r}function findAllVersions(e,t){const A=[];t=t||os.arch();const r=path.join(_getCacheDirectory(),e);if(fs.existsSync(r)){const e=fs.readdirSync(r);for(const n of e){if(isExplicitVersion(n)){const e=path.join(r,n,t||"");if(fs.existsSync(e)&&fs.existsSync(`${e}.complete`)){A.push(n)}}}}return A}function getManifestFromRepo(e,t,A){return ns(this,arguments,void 0,(function*(e,t,A,r="master"){let n=[];const s=`https://api.github.com/repos/${e}/${t}/git/trees/${r}`;const i=new httpm.HttpClient("tool-cache");const o={};if(A){core.debug("set auth");o.authorization=A}const a=yield i.getJson(s,o);if(!a.result){return n}let c="";for(const e of a.result.tree){if(e.path==="versions-manifest.json"){c=e.url;break}}o["accept"]="application/vnd.github.VERSION.raw";let l=yield(yield i.get(c,o)).readBody();if(l){l=l.replace(/^\uFEFF/,"");try{n=JSON.parse(l)}catch(e){core.debug("Invalid json")}}return n}))}function findFromManifest(e,t,A){return ns(this,arguments,void 0,(function*(e,t,A,r=os.arch()){const n=yield mm._findMatch(e,t,A,r);return n}))}function _createExtractFolder(e){return ns(this,void 0,void 0,(function*(){if(!e){e=s.join(_getTempDirectory(),xt.randomUUID())}yield mkdirP(e);return e}))}function _createToolPath(e,t,A){return ns(this,void 0,void 0,(function*(){const r=s.join(_getCacheDirectory(),e,zn.clean(t)||t,A||"");core_debug(`destination ${r}`);const n=`${r}.complete`;yield rmRF(r);yield rmRF(n);yield mkdirP(r);return r}))}function _completeToolPath(e,t,A){const r=s.join(_getCacheDirectory(),e,zn.clean(t)||t,A||"");const i=`${r}.complete`;n.writeFileSync(i,"");core_debug("finished caching tool")}function isExplicitVersion(e){const t=semver.clean(e)||"";core.debug(`isExplicit: ${t}`);const A=semver.valid(t)!=null;core.debug(`explicit? ${A}`);return A}function evaluateVersions(e,t){let A="";core.debug(`evaluating ${e.length} versions`);e=e.sort(((e,t)=>{if(semver.gt(e,t)){return 1}return-1}));for(let r=e.length-1;r>=0;r--){const n=e[r];const s=semver.satisfies(n,t);if(s){A=n;break}}if(A){core.debug(`matched: ${A}`)}else{core.debug("match not found")}return A}function _getCacheDirectory(){const e=process.env["RUNNER_TOOL_CACHE"]||"";(0,i.ok)(e,"Expected RUNNER_TOOL_CACHE to be defined");return e}function _getTempDirectory(){const e=process.env["RUNNER_TEMP"]||"";(0,i.ok)(e,"Expected RUNNER_TEMP to be defined");return e}function _getGlobal(e,t){const A=global[e];return A!==undefined?A:t}function _unique(e){return Array.from(new Set(e))}async function install(e,t){const A=await getRelease(e,t);const r=getFilename(e);const i=`https://github.com/goreleaser/${e}/releases/download/${A.tag_name}`;const o=`${i}/${r}`;info(`Downloading ${o}`);const a=await downloadTool(o);core_debug(`Downloaded to ${a}`);await verifyChecksum(e,A.tag_name,a,r);info("Extracting GoReleaser");let c;if(JA=="win32"){if(!a.endsWith(".zip")){const e=a+".zip";n.renameSync(a,e);c=await extractZip(e)}else{c=await extractZip(a)}}else{c=await extractTar(a)}core_debug(`Extracted to ${c}`);const l=await cacheDir(c,"goreleaser-action",A.tag_name.replace(/^v/,""));core_debug(`Cached to ${l}`);const u=s.join(l,JA=="win32"?"goreleaser.exe":"goreleaser");core_debug(`Exe path is ${u}`);return u}async function verifyChecksum(e,t,A,r){const s=`https://github.com/goreleaser/${e}/releases/download/${t}`;let i;try{info(`Downloading ${s}/checksums.txt`);i=await downloadTool(`${s}/checksums.txt`)}catch(e){warning(`Skipping checksum verification: unable to download checksums.txt: ${e.message}`);return}const o=xt.createHash("sha256").update(n.readFileSync(A)).digest("hex");const a=findChecksum(n.readFileSync(i,"utf8"),r);if(!a){throw new Error(`Could not find ${r} in checksums.txt`)}if(a.toLowerCase()!==o.toLowerCase()){throw new Error(`Checksum mismatch for ${r}: expected ${a}, got ${o}`)}info(`Checksum verified for ${r}`);await verifyCosignSignature(e,t,s,i)}const findChecksum=(e,t)=>{const A=e.split("\n").map((e=>e.trim().split(/\s+/))).find((e=>e.length>=2&&e[1].replace(/^[*]/,"")===t));return A?A[0]:undefined};async function verifyCosignSignature(e,t,A,r){const n=await which("cosign",false);if(!n){info("cosign not found in PATH, skipping signature verification");return}let s;try{info(`Downloading ${A}/checksums.txt.sigstore.json`);s=await downloadTool(`${A}/checksums.txt.sigstore.json`)}catch(e){warning(`Skipping cosign signature verification: unable to download sigstore bundle: ${e.message}`);return}const i=getCertificateIdentity(e,t);info(`Verifying checksums.txt signature with cosign (identity: ${i})`);await exec_exec(n,["verify-blob","--certificate-identity",i,"--certificate-oidc-issuer","https://token.actions.githubusercontent.com","--bundle",s,r]);info("cosign signature verified")}const getCertificateIdentity=(e,t)=>{const A=isPro(e);if(isNightlyTag(t)){const e=A?"nightly-pro.yml":"nightly-oss.yml";const t=A?"goreleaser-pro-internal":"goreleaser";return`https://github.com/goreleaser/${t}/.github/workflows/${e}@refs/heads/main`}if(A){return`https://github.com/goreleaser/goreleaser-pro-internal/.github/workflows/release-pro.yml@refs/tags/${t}`}return`https://github.com/goreleaser/goreleaser/.github/workflows/release.yml@refs/tags/${t}`};const distribSuffix=e=>isPro(e)?"-pro":"";const isPro=e=>e==="goreleaser-pro";const getFilename=e=>{let t;switch(VA){case"x64":{t="x86_64";break}case"x32":{t="i386";break}case"arm":{const e=process.config.variables.arm_version;t=e?"armv"+e:"arm";break}default:{t=VA;break}}if(JA=="darwin"){t="all"}const A=JA=="win32"?"Windows":JA=="darwin"?"Darwin":"Linux";const r=JA=="win32"?"zip":"tar.gz";const n=distribSuffix(e);return`goreleaser${n}_${A}_${t}.${r}`};async function getDistPath(e){const t=$n.load(n.readFileSync(e,"utf8"));return t.dist||"dist"}async function getArtifacts(e){const t=s.join(e,"artifacts.json");if(!n.existsSync(t)){return undefined}const A=n.readFileSync(t,{encoding:"utf-8"}).trim();if(A==="null"){return undefined}return A}async function getMetadata(e){const t=s.join(e,"metadata.json");if(!n.existsSync(t)){return undefined}const A=n.readFileSync(t,{encoding:"utf-8"}).trim();if(A==="null"){return undefined}return A}function getRequestedVersion(e){if(!e.versionFile){return e.version}const t=s.isAbsolute(e.versionFile)?e.versionFile:s.join(e.workdir||".",e.versionFile);if(!n.existsSync(t)){throw new Error(`version-file not found: ${t}`)}const A=s.basename(t);const r=n.readFileSync(t,"utf-8");switch(A){case".tool-versions":return parseToolVersions(r,t);default:throw new Error(`Unsupported version-file: ${t} (only .tool-versions is supported)`)}}function parseToolVersions(e,t){for(const A of e.split("\n")){const e=A.replace(/#.*$/,"").trim();if(!e){continue}const r=e.split(/\s+/);if(r[0]!=="goreleaser"){continue}const n=r[1];if(!n){throw new Error(`No version specified for goreleaser in ${t}`)}return/^\d/.test(n)?`v${n}`:n}throw new Error(`No goreleaser entry found in ${t}`)}async function run(){try{const e=await getInputs();const t=getRequestedVersion(e);const A=await install(e.distribution,t);info(`GoReleaser ${t} installed successfully`);if(e.installOnly){const e=s.dirname(A);addPath(e);core_debug(`Added ${e} to PATH`);return}else if(!e.args){setFailed("args input required");return}if(e.workdir&&e.workdir!=="."){info(`Using ${e.workdir} as working directory`);process.chdir(e.workdir)}let r;const i=Lt(e.args).parseSync();if(i.config){r=i.config}else{[".config/goreleaser.yaml",".config/goreleaser.yml",".goreleaser.yaml",".goreleaser.yml","goreleaser.yaml","goreleaser.yml"].forEach((e=>{if(n.existsSync(e)){r=e}}))}await exec_exec(`${A} ${e.args}`);if(typeof r==="string"){const e=await getArtifacts(await getDistPath(r));if(e){await group(`Artifacts output`,(async()=>{info(e);setOutput("artifacts",e)}))}const t=await getMetadata(await getDistPath(r));if(t){await group(`Metadata output`,(async()=>{info(t);setOutput("metadata",t)}))}}}catch(e){setFailed(e.message)}}run(); \ No newline at end of file diff --git a/src/github.ts b/src/github.ts index 3e64ddb3..0d8d6c38 100644 --- a/src/github.ts +++ b/src/github.ts @@ -34,7 +34,7 @@ export interface GitHubRelease { export const nightlyTagRegex = /^v\d+\.\d+\.\d+-[0-9a-f]+-nightly$/i; export const isNightlyTag = (tag: string): boolean => { - return tag === 'nightly' || nightlyTagRegex.test(tag); + return nightlyTagRegex.test(tag); }; export const getRelease = async (distribution: string, version: string): Promise => { @@ -114,15 +114,11 @@ const resolveNightly = async (distribution: string): Promise => { }); const match = releases.find(r => nightlyTagRegex.test(r.tag_name)); - if (match) { - core.info(`Resolved nightly to ${match.tag_name}`); - return match; + if (!match) { + throw new Error(`No '--nightly' release found in ${url}`); } - - // Fallback to the legacy moving `nightly` tag during the transition period, - // until goreleaser stops publishing it. - core.warning(`No '--nightly' release found in ${url}, falling back to 'nightly' tag`); - return {tag_name: 'nightly'}; + core.info(`Resolved nightly to ${match.tag_name}`); + return match; }; const resolveVersion = async (distribution: string, version: string): Promise => { From 1a80836c5c9d9e5755a25cb59ec6f45a3b5f41a8 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Sun, 26 Apr 2026 18:04:06 -0300 Subject: [PATCH 2/2] ci(nightly): pass GITHUB_TOKEN to nightly integration job Releases API is rate-limited for unauthenticated requests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cf14fc0e..e625e897 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -242,6 +242,8 @@ jobs: install-only: true distribution: ${{ matrix.distribution }} version: nightly + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Check run: |