From 7e6b514c508941c26e8772ba9b920d0677e2160e Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Sat, 29 Aug 2026 15:33:20 -0300 Subject: [PATCH] chore: update generated files Signed-off-by: Carlos Alexandro Becker --- dist/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index 6a04c53..7e991d0 100644 --- a/dist/index.js +++ b/dist/index.js @@ -33,5 +33,5 @@ let te;class YargsParser{constructor(e){te=e}parse(e,t){const A=Object.assign({a * SPDX-License-Identifier: ISC */ var re,ne,se;const ie=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):20;const oe=(ne=(re=process===null||process===void 0?void 0:process.versions)===null||re===void 0?void 0:re.node)!==null&&ne!==void 0?ne:(se=process===null||process===void 0?void 0:process.version)===null||se===void 0?void 0:se.slice(1);if(oe){const e=Number(oe.match(/^([^.]+)/)[1]);if(eae,format:K.format,normalize:s.normalize,resolve:s.resolve,require:e=>{if(typeof ce!=="undefined"){return ce(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 ue=function Parser(e,t){const A=le.parse(e.slice(),t);return A.argv};ue.detailed=function(e,t){return le.parse(e.slice(),t)};ue.camelCase=camelCase;ue.decamelize=decamelize;ue.looksLikeNumber=looksLikeNumber;const ge=ue;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()]}function yargs_node_modules_ansi_regex_ansiRegex({onlyFirst:e=false}={}){const t="(?:\\u0007|\\u001B\\u005C|\\u009C)";const A=`(?:\\u001B\\][\\s\\S]*?${t})`;const r="[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";const n=`${A}|${r}`;return new RegExp(n,e?undefined:"g")}const he=yargs_node_modules_ansi_regex_ansiRegex();function yargs_node_modules_strip_ansi_stripAnsi(e){if(typeof e!=="string"){throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``)}if(!e.includes("")&&!e.includes("›")){return e}return e.replace(he,"")}const fe=new Intl.Segmenter;const Ee=/^(?:\p{Default_Ignorable_Code_Point}|\p{Control}|\p{Format}|\p{Nonspacing_Mark}|\p{Enclosing_Mark}|\p{Surrogate})+$/v;const de=/^[\p{Default_Ignorable_Code_Point}\p{Control}\p{Format}\p{Nonspacing_Mark}\p{Enclosing_Mark}\p{Surrogate}]+/v;const Ce=/\p{Spacing_Mark}/v;const Be=/^\p{RGI_Emoji}$/v;const Qe=/^[\d#*]\u20E3$/;const Ie=/\p{Extended_Pictographic}/gu;function isDoubleWidthNonRgiEmojiSequence(e){if(e.length>50){return false}if(Qe.test(e)){return true}if(e.includes("‍")){const t=e.match(Ie);return t!==null&&t.length>=2}return false}function baseVisible(e){return e.replace(de,"")}function isZeroWidthCluster(e){return Ee.test(e)}function isHangulLeadingJamo(e){return e>=4352&&e<=4447||e>=43360&&e<=43388}function isHangulVowelJamo(e){return e>=4448&&e<=4519||e>=55216&&e<=55238}function isHangulTrailingJamo(e){return e>=4520&&e<=4607||e>=55243&&e<=55291}function isHangulJamo(e){return isHangulLeadingJamo(e)||isHangulVowelJamo(e)||isHangulTrailingJamo(e)}function hangulClusterWidth(e,t){const A=[];for(const t of e){if(Ee.test(t)){continue}A.push(t.codePointAt(0))}if(A.length===0){return undefined}let r=0;for(let e=0;e="＀"&&n<="￯"){A+=eastAsianWidth(n.codePointAt(0),t)}}return A}function string_width_stringWidth(e,t={}){if(typeof e!=="string"||e.length===0){return 0}const{ambiguousIsNarrow:A=true,countAnsiEscapeCodes:r=false}=t;let n=e;if(!r&&(n.includes("")||n.includes("›"))){n=yargs_node_modules_strip_ansi_stripAnsi(n)}if(n.length===0){return 0}if(/^[\u0020-\u007E]*$/.test(n)){return n.length}let s=0;const i={ambiguousAsWide:!A};for(const{segment:e}of fe.segment(n)){if(isZeroWidthCluster(e)){continue}if(Be.test(e)||isDoubleWidthNonRgiEmojiSequence(e)){s+=2;continue}const t=baseVisible(e);const A=hangulClusterWidth(t,i);if(A!==undefined){s+=A;continue}const r=t.codePointAt(0);s+=eastAsianWidth(r,i);s+=trailingWidth(t,i)}return s}const pe={fs:{readFileSync:n.readFileSync,writeFile:n.writeFile},format:K.format,resolve:s.resolve,exists:e=>{try{return(0,n.statSync)(e).isFile()}catch(e){return false}}};let De;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 De.format.apply(De.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 De.format.apply(De.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);De.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(De.fs.readFileSync){e=JSON.parse(De.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=De.resolve(e,"./",t+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(A)&&~t.lastIndexOf("_")){const r=De.resolve(e,"./",t.split("_")[0]+".json");if(this._fileExistsSync(r))A=r}return A}_fileExistsSync(e){return De.exists(e)}}function y18n(e,t){De=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,pe);const me=y18n_y18n;var ye=__nccwpck_require__(3869);const we=e(import.meta.url)("node:fs");const Fe=(0,X.fileURLToPath)(import.meta.url);const be=Fe.substring(0,Fe.lastIndexOf("node_modules"));const ke=(0,Ae.createRequire)(import.meta.url);const Se={assert:{notStrictEqual:i.notStrictEqual,strictEqual:i.strictEqual},cliui:ui,findUp:sync,getEnv:e=>process.env[e],inspect:K.inspect,getProcessArgvBin:getProcessArgvBin,mainFilename:be||process.cwd(),Parser:ge,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:we.readFileSync,readdirSync:we.readdirSync,require:ke,getCallerFile:()=>{const e=ye(3);return e.match(/^file:\/\//)?(0,X.fileURLToPath)(e):e},stringWidth:string_width_stringWidth,y18n:me({directory:(0,s.resolve)(Fe,"../../../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 Re=["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 ${Re[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 Ne=/(^\*)|(^\$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(Ne.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(Ne,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=Ne.test(t.original)?t.original.replace(Ne,"").trim():t.original;const r=e.filter((e=>!Ne.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=Ne.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 f=[];r.epilog=e=>{f.push(e)};let E=false;let d;r.wrap=e=>{E=true;d=e};r.getWrap=()=>{if(t.getEnv("YARGS_DISABLE_WRAP")){return null}if(!E){d=windowWidth();E=true}return d};const C="__yargsString__:";r.deferY18nLookup=e=>C+e;r.help=function help(){if(B)return B;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 E=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(E.default));d=d.filter(filterHiddenOptions);d=Object.keys(d.reduce(((e,t)=>{if(t!=="_")e[t]=true;return e}),{}));const Q=r.getWrap();const I=t.cliui({width:Q,wrap:!!Q});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,Q,`${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(E.alias)||[]).concat(Object.keys(e.parsed.newAliases)||[]);d=d.filter((t=>!e.parsed.newAliases[t]&&p.every((e=>(E.alias[e]||[]).indexOf(t)===-1))));const D=A("Options:");if(!a[D])a[D]=[];addUngroupedKeys(d,E.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((E.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(E.alias[A]||[]).map((t=>{if(e===r.getPositionalGroupName())return t;else{return(/^[0-9]$/.test(t)?E.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(E.boolean.includes(t))c=`[${A("boolean")}]`;if(E.count.includes(t))c=`[${A("count")}]`;if(E.string.includes(t))c=`[${A("string")}]`;if(E.normalize.includes(t))c=`[${A("string")}]`;if(E.array.includes(t))c=`[${A("array")}]`;if(E.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,E.choices&&E.choices[t]?`[${A("choices:")} ${r.stringifiedValues(E.choices[t])}]`:null,defaultString(E.default[t],E.defaultDescription[t])].filter(Boolean).join(" ");I.span({text:getText(n),padding:[0,2,0,2+getIndentation(n)],width:maxWidth(i,Q)+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,Q)+4},{text:e[1]})}}));I.div()}if(f.length>0){const e=f.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 B;r.cacheHelpMessage=function(){B=this.help()};r.clearCachedHelpMessage=function(){B=undefined};r.hasCachedHelpMessage=function(){return!!B};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 Q=null;r.version=e=>{Q=e};r.showVersion=t=>{const A=e.getInternalMethods().getLoggerInstance();if(!t)t="error";const r=typeof t==="function"?t:A[t];r(Q)};r.reset=function reset(e){s=null;a=false;c=[];l=false;f=[];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:f,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];f=[...t.epilogs,...f]}else{({failMessage:s,failureOutput:a,usages:c,usageDisabled:l,epilogs:f,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 Me=`###-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 ve=`#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?ve:Me;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 Ue=["$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(!Ue.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(Ue.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 Te=[];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);Te.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)}Te=[];return A?mergeDeep(n,e):Object.assign({},n,e)}function checkForCircularExtends(e){if(Te.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(r==="__proto__")continue;if(isObject(t[r])&&isObject(A[r])){A[r]=mergeDeep(e[r],t[r])}else{A[r]=t[r]}}return A}var xe=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 He=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 Ye,Ge,Oe,Je,Ve,Pe,We,_e,qe,je,$e,ze,Ze,Ke,Xe,et,tt,At,rt,nt,st,it,ot,at,ct,ut,ht,ft,Et,dt,Ct,Bt,Qt,It,pt;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 Dt=Symbol("copyDoubleDash");const mt=Symbol("copyDoubleDash");const yt=Symbol("deleteFromParserHintObject");const wt=Symbol("emitWarning");const Ft=Symbol("freeze");const bt=Symbol("getDollarZero");const kt=Symbol("getParserConfiguration");const St=Symbol("getUsageConfiguration");const Rt=Symbol("guessLocale");const Nt=Symbol("guessVersion");const Mt=Symbol("parsePositionalNumbers");const vt=Symbol("pkgUp");const Ut=Symbol("populateParserHintArray");const Tt=Symbol("populateParserHintSingleValueDictionary");const Lt=Symbol("populateParserHintArrayDictionary");const xt=Symbol("populateParserHintDictionary");const Ht=Symbol("sanitizeKey");const Yt=Symbol("setKey");const Gt=Symbol("unfreeze");const Ot=Symbol("validateAsync");const Jt=Symbol("getCommandInstance");const Vt=Symbol("getContext");const Pt=Symbol("getHasOutput");const Wt=Symbol("getLoggerInstance");const _t=Symbol("getParseContext");const qt=Symbol("getUsageInstance");const jt=Symbol("getValidationInstance");const $t=Symbol("hasParseCallback");const zt=Symbol("isGlobalContext");const Zt=Symbol("postProcess");const Kt=Symbol("rebase");const Xt=Symbol("reset");const eA=Symbol("runYargsParserAndExecuteCommands");const tA=Symbol("runValidation");const AA=Symbol("setHasOutput");const rA=Symbol("kTrackManuallySetKeys");const nA="en_US";class YargsInstance{constructor(e=[],t,A,r){this.customScriptName=false;this.parsed=false;Ye.set(this,void 0);Ge.set(this,void 0);Oe.set(this,{commands:[],fullCommands:[]});Je.set(this,null);Ve.set(this,null);Pe.set(this,"show-hidden");We.set(this,null);_e.set(this,true);qe.set(this,{});je.set(this,true);$e.set(this,[]);ze.set(this,void 0);Ze.set(this,{});Ke.set(this,false);Xe.set(this,null);et.set(this,true);tt.set(this,void 0);At.set(this,"");rt.set(this,void 0);nt.set(this,void 0);st.set(this,{});it.set(this,null);ot.set(this,null);at.set(this,{});ct.set(this,{});ut.set(this,void 0);ht.set(this,false);ft.set(this,void 0);Et.set(this,false);dt.set(this,false);Ct.set(this,false);Bt.set(this,void 0);Qt.set(this,{});It.set(this,null);pt.set(this,void 0);xe(this,ft,r,"f");xe(this,ut,e,"f");xe(this,Ge,t,"f");xe(this,nt,A,"f");xe(this,ze,new GlobalMiddleware(this),"f");this.$0=this[bt]();this[Xt]();xe(this,Ye,He(this,Ye,"f"),"f");xe(this,Bt,He(this,Bt,"f"),"f");xe(this,pt,He(this,pt,"f"),"f");xe(this,rt,He(this,rt,"f"),"f");He(this,rt,"f").showHiddenOpt=He(this,Pe,"f");xe(this,tt,this[mt](),"f");He(this,ft,"f").y18n.setLocale(nA)}addHelpOpt(e,t){const A="help";argsert("[string|boolean] [string]",[e,t],arguments.length);if(He(this,Xe,"f")){this[yt](He(this,Xe,"f"));xe(this,Xe,null,"f")}if(e===false&&t===undefined)return this;xe(this,Xe,typeof e==="string"?e:A,"f");this.boolean(He(this,Xe,"f"));this.describe(He(this,Xe,"f"),t||He(this,Bt,"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:He(this,Pe,"f");this.boolean(A);this.describe(A,t||He(this,Bt,"f").deferY18nLookup("Show hidden options"));He(this,rt,"f").showHiddenOpt=A;return this}showHidden(e,t){return this.addShowHiddenOpt(e,t)}alias(e,t){argsert(" [string|array]",[e,t],arguments.length);this[Lt](this.alias.bind(this),"alias",e,t);return this}array(e){argsert("",[e],arguments.length);this[Ut]("array",e);this[rA](e);return this}boolean(e){argsert("",[e],arguments.length);this[Ut]("boolean",e);this[rA](e);return this}check(e,t){argsert(" [boolean]",[e,t],arguments.length);this.middleware(((t,A)=>maybeAsyncResult((()=>e(t,A.getOptions())),(A=>{if(!A){He(this,Bt,"f").fail(He(this,ft,"f").y18n.__("Argument check failed: %s",e.toString()))}else if(typeof A==="string"||A instanceof Error){He(this,Bt,"f").fail(A.toString(),A)}return t}),(e=>{He(this,Bt,"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[Lt](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;He(this,rt,"f").key[A]=true;He(this,ze,"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);He(this,pt,"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,He(this,Ge,"f"),this[kt]()["deep-merge-config"]||false,He(this,ft,"f"));He(this,rt,"f").configObjects=(He(this,rt,"f").configObjects||[]).concat(e);return this}if(typeof t==="function"){A=t;t=undefined}this.describe(e,t||He(this,Bt,"f").deferY18nLookup("Path to JSON config file"));(Array.isArray(e)?e:[e]).forEach((e=>{He(this,rt,"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}xe(this,Ve,e||He(this,Ve,"f")||"completion","f");if(!t&&t!==false){t="generate completion script"}this.command(He(this,Ve,"f"),t);if(A)He(this,Je,"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);He(this,Ye,"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=He(this,nt,"f")||He(this,ft,"f").require;He(this,Ye,"f").addDirectory(e,A,He(this,ft,"f").getCallerFile(),t);return this}count(e){argsert("",[e],arguments.length);this[Ut]("count",e);this[rA](e);return this}default(e,t,A){argsert(" [*] [string]",[e,t,A],arguments.length);if(A){assertSingleKey(e,He(this,ft,"f"));He(this,rt,"f").defaultDescription[e]=A}if(typeof t==="function"){assertSingleKey(e,He(this,ft,"f"));if(!He(this,rt,"f").defaultDescription[e])He(this,rt,"f").defaultDescription[e]=He(this,Bt,"f").functionDescription(t);t=t.call()}this[Tt](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);He(this,rt,"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,He(this,ft,"f"));this.demandOption(e,A)}));t=Infinity}else if(typeof t!=="number"){A=t;t=Infinity}if(typeof e==="number"){assertNotStrictEqual(A,true,He(this,ft,"f"));this.demandCommand(e,t,A,A)}else if(Array.isArray(e)){e.forEach((e=>{assertNotStrictEqual(A,true,He(this,ft,"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[Tt](this.demandOption.bind(this),"demandedOptions",e,t);return this}deprecateOption(e,t){argsert(" [string|boolean]",[e,t],arguments.length);He(this,rt,"f").deprecatedOptions[e]=t;return this}describe(e,t){argsert(" [string]",[e,t],arguments.length);this[Yt](e,true);He(this,Bt,"f").describe(e,t);return this}detectLocale(e){argsert("",[e],arguments.length);xe(this,_e,e,"f");return this}env(e){argsert("[string|boolean]",[e],arguments.length);if(e===false)delete He(this,rt,"f").envPrefix;else He(this,rt,"f").envPrefix=e||"";return this}epilogue(e){argsert("",[e],arguments.length);He(this,Bt,"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{He(this,Bt,"f").example(e,t)}return this}exit(e,t){xe(this,Ke,true,"f");xe(this,We,t,"f");if(He(this,je,"f"))He(this,ft,"f").process.exit(e)}exitProcess(e=true){argsert("[boolean]",[e],arguments.length);xe(this,je,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'")}He(this,Bt,"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)=>{He(this,Je,"f").getCompletion(e,((e,r)=>{if(e)A(e);else t(r)}))}))}else{return He(this,Je,"f").getCompletion(e,t)}}getDemandedOptions(){argsert([],0);return He(this,rt,"f").demandedOptions}getDemandedCommands(){argsert([],0);return He(this,rt,"f").demandedCommands}getDeprecatedOptions(){argsert([],0);return He(this,rt,"f").deprecatedOptions}getDetectLocale(){return He(this,_e,"f")}getExitProcess(){return He(this,je,"f")}getGroups(){return Object.assign({},He(this,Ze,"f"),He(this,ct,"f"))}getHelp(){xe(this,Ke,true,"f");if(!He(this,Bt,"f").hasCachedHelpMessage()){if(!this.parsed){const e=this[eA](He(this,ut,"f"),undefined,undefined,0,true);if(isPromise(e)){return e.then((()=>He(this,Bt,"f").help()))}}const e=He(this,Ye,"f").runDefaultBuilderOn(this);if(isPromise(e)){return e.then((()=>He(this,Bt,"f").help()))}}return Promise.resolve(He(this,Bt,"f").help())}getOptions(){return He(this,rt,"f")}getStrict(){return He(this,Et,"f")}getStrictCommands(){return He(this,dt,"f")}getStrictOptions(){return He(this,Ct,"f")}global(e,t){argsert(" [boolean]",[e,t],arguments.length);e=[].concat(e);if(t!==false){He(this,rt,"f").local=He(this,rt,"f").local.filter((t=>e.indexOf(t)===-1))}else{e.forEach((e=>{if(!He(this,rt,"f").local.includes(e))He(this,rt,"f").local.push(e)}))}return this}group(e,t){argsert(" ",[e,t],arguments.length);const A=He(this,ct,"f")[t]||He(this,Ze,"f")[t];if(He(this,ct,"f")[t]){delete He(this,ct,"f")[t]}const r={};He(this,Ze,"f")[t]=(A||[]).concat(e).filter((e=>{if(r[e])return false;return r[e]=true}));return this}hide(e){argsert("",[e],arguments.length);He(this,rt,"f").hiddenOptions.push(e);return this}implies(e,t){argsert(" [number|string|array]",[e,t],arguments.length);He(this,pt,"f").implies(e,t);return this}locale(e){argsert("[string]",[e],arguments.length);if(e===undefined){this[Rt]();return He(this,ft,"f").y18n.getLocale()}xe(this,_e,false,"f");He(this,ft,"f").y18n.setLocale(e);return this}middleware(e,t,A){return He(this,ze,"f").addMiddleware(e,!!t,A)}nargs(e,t){argsert(" [number]",[e,t],arguments.length);this[Tt](this.nargs.bind(this),"narg",e,t);return this}normalize(e){argsert("",[e],arguments.length);this[Ut]("normalize",e);return this}number(e){argsert("",[e],arguments.length);this[Ut]("number",e);this[rA](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[rA](e);if(He(this,It,"f")&&(e==="version"||(t===null||t===void 0?void 0:t.alias)==="version")){this[wt](['"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")}He(this,rt,"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){He(this,rt,"f").defaultDescription[e]=t.defaultDescription}if(t.skipValidation){this.skipValidation(e)}const n=t.describe||t.description||t.desc;const s=He(this,Bt,"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[Ft]();if(typeof e==="undefined"){e=He(this,ut,"f")}if(typeof t==="object"){xe(this,ot,t,"f");t=A}if(typeof t==="function"){xe(this,it,t,"f");t=false}if(!t)xe(this,ut,e,"f");if(He(this,it,"f"))xe(this,je,false,"f");const r=this[eA](e,!!t);const n=this.parsed;He(this,Je,"f").setParsed(this.parsed);if(isPromise(r)){return r.then((e=>{if(He(this,it,"f"))He(this,it,"f").call(this,He(this,We,"f"),e,He(this,At,"f"));return e})).catch((e=>{if(He(this,it,"f")){He(this,it,"f")(e,this.parsed.argv,He(this,At,"f"))}throw e})).finally((()=>{this[Gt]();this.parsed=n}))}else{if(He(this,it,"f"))He(this,it,"f").call(this,He(this,We,"f"),r,He(this,At,"f"));this[Gt]();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);xe(this,st,e,"f");return this}pkgConf(e,t){argsert(" [string]",[e,t],arguments.length);let A=null;const r=this[vt](t||He(this,Ge,"f"));if(r[e]&&typeof r[e]==="object"){A=applyExtends(r[e],t||He(this,Ge,"f"),this[kt]()["deep-merge-config"]||false,He(this,ft,"f"));He(this,rt,"f").configObjects=(He(this,rt,"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=He(this,Oe,"f").fullCommands[He(this,Oe,"f").fullCommands.length-1];const n=r?He(this,Ye,"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,He(this,Bt,"f").getPositionalGroupName());return this.option(e,t)}recommendCommands(e=true){argsert("[boolean]",[e],arguments.length);xe(this,ht,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"&&He(this,rt,"f").narg[e]){return this}else{this[Tt](this.requiresArg.bind(this),"narg",e,NaN)}return this}showCompletionScript(e,t){argsert("[string] [string]",[e,t],arguments.length);e=e||this.$0;He(this,tt,"f").log(He(this,Je,"f").generateCompletionScript(e,t||He(this,Ve,"f")||"completion"));return this}showHelp(e){argsert("[string|function]",[e],arguments.length);xe(this,Ke,true,"f");if(!He(this,Bt,"f").hasCachedHelpMessage()){if(!this.parsed){const t=this[eA](He(this,ut,"f"),undefined,undefined,0,true);if(isPromise(t)){t.then((()=>{He(this,Bt,"f").showHelp(e)}));return this}}const t=He(this,Ye,"f").runDefaultBuilderOn(this);if(isPromise(t)){t.then((()=>{He(this,Bt,"f").showHelp(e)}));return this}}He(this,Bt,"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);He(this,Bt,"f").showHelpOnFail(e,t);return this}showVersion(e){argsert("[string|function]",[e],arguments.length);He(this,Bt,"f").showVersion(e);return this}skipValidation(e){argsert("",[e],arguments.length);this[Ut]("skipValidation",e);return this}strict(e){argsert("[boolean]",[e],arguments.length);xe(this,Et,e!==false,"f");return this}strictCommands(e){argsert("[boolean]",[e],arguments.length);xe(this,dt,e!==false,"f");return this}strictOptions(e){argsert("[boolean]",[e],arguments.length);xe(this,Ct,e!==false,"f");return this}string(e){argsert("",[e],arguments.length);this[Ut]("string",e);this[rA](e);return this}terminalWidth(){argsert([],0);return He(this,ft,"f").process.stdColumns}updateLocale(e){return this.updateStrings(e)}updateStrings(e){argsert("",[e],arguments.length);xe(this,_e,false,"f");He(this,ft,"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,He(this,ft,"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{He(this,Bt,"f").usage(e);return this}}usageConfiguration(e){argsert("",[e],arguments.length);xe(this,Qt,e,"f");return this}version(e,t,A){const r="version";argsert("[boolean|string] [string] [string]",[e,t,A],arguments.length);if(He(this,It,"f")){this[yt](He(this,It,"f"));He(this,Bt,"f").version(undefined);xe(this,It,null,"f")}if(arguments.length===0){A=this[Nt]();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}xe(this,It,typeof e==="string"?e:r,"f");t=t||He(this,Bt,"f").deferY18nLookup("Show version number");He(this,Bt,"f").version(A||undefined);this.boolean(He(this,It,"f"));this.describe(He(this,It,"f"),t);return this}wrap(e){argsert("",[e],arguments.length);He(this,Bt,"f").wrap(e);return this}[(Ye=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=new WeakMap,$e=new WeakMap,ze=new WeakMap,Ze=new WeakMap,Ke=new WeakMap,Xe=new WeakMap,et=new WeakMap,tt=new WeakMap,At=new WeakMap,rt=new WeakMap,nt=new WeakMap,st=new WeakMap,it=new WeakMap,ot=new WeakMap,at=new WeakMap,ct=new WeakMap,ut=new WeakMap,ht=new WeakMap,ft=new WeakMap,Et=new WeakMap,dt=new WeakMap,Ct=new WeakMap,Bt=new WeakMap,Qt=new WeakMap,It=new WeakMap,pt=new WeakMap,Dt)](e){if(!e._||!e["--"])return e;e._.push.apply(e._,e["--"]);try{delete e["--"]}catch(e){}return e}[mt](){return{log:(...e)=>{if(!this[$t]())console.log(...e);xe(this,Ke,true,"f");if(He(this,At,"f").length)xe(this,At,He(this,At,"f")+"\n","f");xe(this,At,He(this,At,"f")+e.join(" "),"f")},error:(...e)=>{if(!this[$t]())console.error(...e);xe(this,Ke,true,"f");if(He(this,At,"f").length)xe(this,At,He(this,At,"f")+"\n","f");xe(this,At,He(this,At,"f")+e.join(" "),"f")}}}[yt](e){objectKeys(He(this,rt,"f")).forEach((t=>{if((e=>e==="configObjects")(t))return;const A=He(this,rt,"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 He(this,Bt,"f").getDescriptions()[e]}[wt](e,t,A){if(!He(this,qe,"f")[A]){He(this,ft,"f").process.emitWarning(e,t);He(this,qe,"f")[A]=true}}[Ft](){He(this,$e,"f").push({options:He(this,rt,"f"),configObjects:He(this,rt,"f").configObjects.slice(0),exitProcess:He(this,je,"f"),groups:He(this,Ze,"f"),strict:He(this,Et,"f"),strictCommands:He(this,dt,"f"),strictOptions:He(this,Ct,"f"),completionCommand:He(this,Ve,"f"),output:He(this,At,"f"),exitError:He(this,We,"f"),hasOutput:He(this,Ke,"f"),parsed:this.parsed,parseFn:He(this,it,"f"),parseContext:He(this,ot,"f")});He(this,Bt,"f").freeze();He(this,pt,"f").freeze();He(this,Ye,"f").freeze();He(this,ze,"f").freeze()}[bt](){let e="";let t;if(/\b(node|iojs|electron|bun)(\.exe)?$/.test(He(this,ft,"f").process.argv()[0])){t=He(this,ft,"f").process.argv().slice(1,2)}else{t=He(this,ft,"f").process.argv().slice(0,1)}e=t.map((e=>{const t=this[Kt](He(this,Ge,"f"),e);return e.match(/^(\/|([a-zA-Z]:)?\\)/)&&t.length{if(t.includes("package.json")){return"package.json"}else{return undefined}}));assertNotStrictEqual(r,undefined,He(this,ft,"f"));A=JSON.parse(He(this,ft,"f").readFileSync(r,"utf8"))}catch(e){}He(this,at,"f")[t]=A||{};return He(this,at,"f")[t]}[Ut](e,t){t=[].concat(t);t.forEach((t=>{t=this[Ht](t);He(this,rt,"f")[e].push(t)}))}[Tt](e,t,A,r){this[xt](e,t,A,r,((e,t,A)=>{He(this,rt,"f")[e][t]=A}))}[Lt](e,t,A,r){this[xt](e,t,A,r,((e,t,A)=>{He(this,rt,"f")[e][t]=(He(this,rt,"f")[e][t]||[]).concat(A)}))}[xt](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[Ht](A),r)}}[Ht](e){if(e==="__proto__")return"___proto___";return e}[Yt](e,t){this[Tt](this[Yt].bind(this),"key",e,t);return this}[Gt](){var e,t,A,r,n,s,i,o,a,c,l,u;const g=He(this,$e,"f").pop();assertNotStrictEqual(g,undefined,He(this,ft,"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){xe(e,rt,t,"f")}}.value,configObjects:h,exitProcess:{set value(e){xe(t,je,e,"f")}}.value,groups:{set value(e){xe(A,Ze,e,"f")}}.value,output:{set value(e){xe(r,At,e,"f")}}.value,exitError:{set value(e){xe(n,We,e,"f")}}.value,hasOutput:{set value(e){xe(s,Ke,e,"f")}}.value,parsed:this.parsed,strict:{set value(e){xe(i,Et,e,"f")}}.value,strictCommands:{set value(e){xe(o,dt,e,"f")}}.value,strictOptions:{set value(e){xe(a,Ct,e,"f")}}.value,completionCommand:{set value(e){xe(c,Ve,e,"f")}}.value,parseFn:{set value(e){xe(l,it,e,"f")}}.value,parseContext:{set value(e){xe(u,ot,e,"f")}}.value}=g);He(this,rt,"f").configObjects=h;He(this,Bt,"f").unfreeze();He(this,pt,"f").unfreeze();He(this,Ye,"f").unfreeze();He(this,ze,"f").unfreeze()}[Ot](e,t){return maybeAsyncResult(t,(t=>{e(t);return t}))}getInternalMethods(){return{getCommandInstance:this[Jt].bind(this),getContext:this[Vt].bind(this),getHasOutput:this[Pt].bind(this),getLoggerInstance:this[Wt].bind(this),getParseContext:this[_t].bind(this),getParserConfiguration:this[kt].bind(this),getUsageConfiguration:this[St].bind(this),getUsageInstance:this[qt].bind(this),getValidationInstance:this[jt].bind(this),hasParseCallback:this[$t].bind(this),isGlobalContext:this[zt].bind(this),postProcess:this[Zt].bind(this),reset:this[Xt].bind(this),runValidation:this[tA].bind(this),runYargsParserAndExecuteCommands:this[eA].bind(this),setHasOutput:this[AA].bind(this)}}[Jt](){return He(this,Ye,"f")}[Vt](){return He(this,Oe,"f")}[Pt](){return He(this,Ke,"f")}[Wt](){return He(this,tt,"f")}[_t](){return He(this,ot,"f")||{}}[qt](){return He(this,Bt,"f")}[jt](){return He(this,pt,"f")}[$t](){return!!He(this,it,"f")}[zt](){return He(this,et,"f")}[Zt](e,t,A,r){if(A)return e;if(isPromise(e))return e;if(!t){e=this[Dt](e)}const n=this[kt]()["parse-positional-numbers"]||this[kt]()["parse-positional-numbers"]===undefined;if(n){e=this[Mt](e)}if(r){e=applyMiddleware(e,this,He(this,ze,"f").getMiddleware(),false)}return e}[Xt](e={}){xe(this,rt,He(this,rt,"f")||{},"f");const t={};t.local=He(this,rt,"f").local||[];t.configObjects=He(this,rt,"f").configObjects||[];const A={};t.local.forEach((t=>{A[t]=true;(e[t]||[]).forEach((e=>{A[e]=true}))}));Object.assign(He(this,ct,"f"),Object.keys(He(this,Ze,"f")).reduce(((e,t)=>{const r=He(this,Ze,"f")[t].filter((e=>!(e in A)));if(r.length>0){e[t]=r}return e}),{}));xe(this,Ze,{},"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]=(He(this,rt,"f")[e]||[]).filter((e=>!A[e]))}));n.forEach((e=>{t[e]=objFilter(He(this,rt,"f")[e],(e=>!A[e]))}));t.envPrefix=He(this,rt,"f").envPrefix;xe(this,rt,t,"f");xe(this,Bt,He(this,Bt,"f")?He(this,Bt,"f").reset(A):usage(this,He(this,ft,"f")),"f");xe(this,pt,He(this,pt,"f")?He(this,pt,"f").reset(A):validation(this,He(this,Bt,"f"),He(this,ft,"f")),"f");xe(this,Ye,He(this,Ye,"f")?He(this,Ye,"f").reset():command(He(this,Bt,"f"),He(this,pt,"f"),He(this,ze,"f"),He(this,ft,"f")),"f");if(!He(this,Je,"f"))xe(this,Je,completion(this,He(this,Bt,"f"),He(this,Ye,"f"),He(this,ft,"f")),"f");He(this,ze,"f").reset();xe(this,Ve,null,"f");xe(this,At,"","f");xe(this,We,null,"f");xe(this,Ke,false,"f");this.parsed=false;return this}[Kt](e,t){return He(this,ft,"f").path.relative(e,t)}[eA](e,t,A,r=0,n=false){var s,i,o,a;let c=!!A||n;e=e||He(this,ut,"f");He(this,rt,"f").__=He(this,ft,"f").y18n.__;He(this,rt,"f").configuration=this[kt]();const l=!!He(this,rt,"f").configuration["populate--"];const u=Object.assign({},He(this,rt,"f").configuration,{"populate--":true});const g=He(this,ft,"f").Parser.detailed(e,Object.assign({},He(this,rt,"f"),{configuration:{"parse-positional-numbers":false,...u}}));const h=Object.assign(g.argv,He(this,ot,"f"));let f=undefined;const E=g.aliases;let d=false;let C=false;Object.keys(h).forEach((e=>{if(e===He(this,Xe,"f")&&h[e]){d=true}else if(e===He(this,It,"f")&&h[e]){C=true}}));h.$0=this.$0;this.parsed=g;if(r===0){He(this,Bt,"f").clearCachedHelpMessage()}try{this[Rt]();if(t){return this[Zt](h,l,!!A,false)}if(He(this,Xe,"f")){const e=[He(this,Xe,"f")].concat(E[He(this,Xe,"f")]||[]).filter((e=>e.length>1));if(e.includes(""+h._[h._.length-1])){h._.pop();d=true}}xe(this,et,false,"f");const u=He(this,Ye,"f").getCommands();const B=((s=He(this,Je,"f"))===null||s===void 0?void 0:s.completionKey)?[(i=He(this,Je,"f"))===null||i===void 0?void 0:i.completionKey,...(a=this.getAliases()[(o=He(this,Je,"f"))===null||o===void 0?void 0:o.completionKey])!==null&&a!==void 0?a:[]].some((e=>Object.prototype.hasOwnProperty.call(h,e))):false;const Q=d||B||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!==He(this,Ve,"f")){const e=He(this,Ye,"f").runCommand(s,this,g,t+1,n,d||C||n);return this[Zt](e,l,!!A,false)}else if(!e&&s!==He(this,Ve,"f")){e=s;break}}if(!He(this,Ye,"f").hasDefaultCommand()&&He(this,ht,"f")&&e&&!Q){He(this,pt,"f").recommendCommands(e,u)}}if(He(this,Ve,"f")&&h._.includes(He(this,Ve,"f"))&&!B){if(He(this,je,"f"))setBlocking(true);this.showCompletionScript();this.exit(0)}}if(He(this,Ye,"f").hasDefaultCommand()&&!Q){const e=He(this,Ye,"f").runCommand(null,this,g,0,n,d||C||n);return this[Zt](e,l,!!A,false)}if(B){if(He(this,je,"f"))setBlocking(true);e=[].concat(e);const t=e.slice(e.indexOf(`--${He(this,Je,"f").completionKey}`)+1);He(this,Je,"f").getCompletion(t,((e,t)=>{if(e)throw new YError(e.message);(t||[]).forEach((e=>{He(this,tt,"f").log(e)}));this.exit(0)}));return this[Zt](h,!l,!!A,false)}if(!He(this,Ke,"f")){if(d){if(He(this,je,"f"))setBlocking(true);c=true;this.showHelp((e=>{He(this,tt,"f").log(e);this.exit(0)}))}else if(C){if(He(this,je,"f"))setBlocking(true);c=true;He(this,Bt,"f").showVersion("log");this.exit(0)}}if(!c&&He(this,rt,"f").skipValidation.length>0){c=Object.keys(h).some((e=>He(this,rt,"f").skipValidation.indexOf(e)>=0&&h[e]===true))}if(!c){if(g.error)throw new YError(g.error.message);if(!B){const e=this[tA](E,{},g.error);if(!A){f=applyMiddleware(h,this,He(this,ze,"f").getMiddleware(),true)}f=this[Ot](e,f!==null&&f!==void 0?f:h);if(isPromise(f)&&!A){f=f.then((()=>applyMiddleware(h,this,He(this,ze,"f").getMiddleware(),false)))}}}}catch(e){if(e instanceof YError)He(this,Bt,"f").fail(e.message,e);else throw e}return this[Zt](f!==null&&f!==void 0?f:h,l,!!A,true)}[tA](e,t,A,r){const n={...this.getDemandedOptions()};return s=>{if(A)throw new YError(A.message);He(this,pt,"f").nonOptionCount(s);He(this,pt,"f").requiredArguments(s,n);let i=false;if(He(this,dt,"f")){i=He(this,pt,"f").unknownCommands(s)}if(He(this,Et,"f")&&!i){He(this,pt,"f").unknownArguments(s,e,t,!!r)}else if(He(this,Ct,"f")){He(this,pt,"f").unknownArguments(s,e,{},false,false)}He(this,pt,"f").limitedChoices(s);He(this,pt,"f").implications(s);He(this,pt,"f").conflicting(s)}}[AA](){xe(this,Ke,true,"f")}[rA](e){if(typeof e==="string"){He(this,rt,"f").key[e]=true}else{for(const t of e){He(this,rt,"f").key[t]=true}}}}function isYargsInstance(e){return!!e&&typeof e.getInternalMethods==="function"}const sA=YargsFactory(Se);const iA=sA;const oA=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()+oA.EOL)}function command_issue(e,t=""){command_issueCommand(e,{},t)}const aA="::";class Command{constructor(e,t,A){if(!e){e="missing.command"}this.command=e;this.properties=t;this.message=A}toString(){let e=aA+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+=`${aA}${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 cA=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)}${oA.EOL}`,{encoding:"utf8"})}function file_command_prepareKeyValueMessage(e,t){const A=`ghadelimiter_${cA.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}${oA.EOL}${r}${oA.EOL}${A}`}var lA=__nccwpck_require__(8611);var uA=__nccwpck_require__.t(lA,2);var gA=__nccwpck_require__(5692);var hA=__nccwpck_require__.t(gA,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 fA=__nccwpck_require__(770);var EA=__nccwpck_require__(6752);var dA=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 CA;(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"})(CA||(CA={}));var BA;(function(e){e["Accept"]="accept";e["ContentType"]="content-type"})(BA||(BA={}));var QA;(function(e){e["ApplicationJson"]="application/json"})(QA||(QA={}));function lib_getProxyUrl(e){const t=pm.getProxyUrl(new URL(e));return t?t.href:""}const IA=[CA.MovedPermanently,CA.ResourceMoved,CA.SeeOther,CA.TemporaryRedirect,CA.PermanentRedirect];const pA=[CA.BadGateway,CA.ServiceUnavailable,CA.GatewayTimeout];const DA=["OPTIONS","GET","DELETE","HEAD"];const mA=10;const yA=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 dA(this,void 0,void 0,(function*(){return new Promise((e=>dA(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 dA(this,void 0,void 0,(function*(){return new Promise((e=>dA(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 dA(this,void 0,void 0,(function*(){return this.request("OPTIONS",e,null,t||{})}))}get(e,t){return dA(this,void 0,void 0,(function*(){return this.request("GET",e,null,t||{})}))}del(e,t){return dA(this,void 0,void 0,(function*(){return this.request("DELETE",e,null,t||{})}))}post(e,t,A){return dA(this,void 0,void 0,(function*(){return this.request("POST",e,t,A||{})}))}patch(e,t,A){return dA(this,void 0,void 0,(function*(){return this.request("PATCH",e,t,A||{})}))}put(e,t,A){return dA(this,void 0,void 0,(function*(){return this.request("PUT",e,t,A||{})}))}head(e,t){return dA(this,void 0,void 0,(function*(){return this.request("HEAD",e,null,t||{})}))}sendStream(e,t,A,r){return dA(this,void 0,void 0,(function*(){return this.request(e,t,A,r)}))}getJson(e){return dA(this,arguments,void 0,(function*(e,t={}){t[BA.Accept]=this._getExistingOrDefaultHeader(t,BA.Accept,QA.ApplicationJson);const A=yield this.get(e,t);return this._processResponse(A,this.requestOptions)}))}postJson(e,t){return dA(this,arguments,void 0,(function*(e,t,A={}){const r=JSON.stringify(t,null,2);A[BA.Accept]=this._getExistingOrDefaultHeader(A,BA.Accept,QA.ApplicationJson);A[BA.ContentType]=this._getExistingOrDefaultContentTypeHeader(A,QA.ApplicationJson);const n=yield this.post(e,r,A);return this._processResponse(n,this.requestOptions)}))}putJson(e,t){return dA(this,arguments,void 0,(function*(e,t,A={}){const r=JSON.stringify(t,null,2);A[BA.Accept]=this._getExistingOrDefaultHeader(A,BA.Accept,QA.ApplicationJson);A[BA.ContentType]=this._getExistingOrDefaultContentTypeHeader(A,QA.ApplicationJson);const n=yield this.put(e,r,A);return this._processResponse(n,this.requestOptions)}))}patchJson(e,t){return dA(this,arguments,void 0,(function*(e,t,A={}){const r=JSON.stringify(t,null,2);A[BA.Accept]=this._getExistingOrDefaultHeader(A,BA.Accept,QA.ApplicationJson);A[BA.ContentType]=this._getExistingOrDefaultContentTypeHeader(A,QA.ApplicationJson);const n=yield this.patch(e,r,A);return this._processResponse(n,this.requestOptions)}))}request(e,t,A,r){return dA(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&&DA.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===CA.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&&IA.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||!pA.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?hA:uA;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)[BA.ContentType];if(e){if(typeof e==="number"){A=String(e)}else if(Array.isArray(e)){A=e.join(", ")}else{A=e}}}const r=e[BA.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||lA.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?fA.httpsOverHttps:fA.httpsOverHttp}else{r=i?fA.httpOverHttps:fA.httpOverHttp}t=r(e);this._proxyAgent=t}if(!t){const e={keepAlive:this._keepAlive,maxSockets:s};t=n?new gA.Agent(e):new lA.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 EA.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 dA(this,void 0,void 0,(function*(){e=Math.min(mA,e);const t=yA*Math.pow(2,e);return new Promise((e=>setTimeout((()=>e()),t)))}))}_processResponse(e,t){return dA(this,void 0,void 0,(function*(){return new Promise(((A,r)=>dA(this,void 0,void 0,(function*(){const n=e.message.statusCode||0;const s={statusCode:n,result:null,headers:{}};if(n===CA.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 wA=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 wA(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 wA(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 wA(this,void 0,void 0,(function*(){throw new Error("not implemented")}))}}var FA=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 FA(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 FA(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 bA=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:kA,appendFile:SA,writeFile:RA}=n.promises;const NA="GITHUB_STEP_SUMMARY";const MA="https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary";class Summary{constructor(){this._buffer=""}filePath(){return bA(this,void 0,void 0,(function*(){if(this._filePath){return this._filePath}const e=process.env[NA];if(!e){throw new Error(`Unable to find environment variable for $${NA}. Check if your runtime environment supports job summaries.`)}try{yield kA(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 bA(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?RA:SA;yield r(A,this._buffer,{encoding:"utf8"});return this.emptyBuffer()}))}clear(){return bA(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(oA.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 vA=new Summary;const UA=null&&vA;const TA=null&&vA;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 xA=__nccwpck_require__(4434);const HA=e(import.meta.url)("child_process");var YA=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:GA,copyFile:OA,lstat:JA,mkdir:VA,open:PA,readdir:WA,rename:_A,rm:qA,rmdir:jA,stat:$A,symlink:zA,unlink:ZA}=n.promises;const KA=process.platform==="win32";function readlink(e){return YA(this,void 0,void 0,(function*(){const t=yield n.promises.readlink(e);if(KA&&!t.endsWith("\\")){return`${t}\\`}return t}))}const XA=268435456;const er=n.constants.O_RDONLY;function exists(e){return YA(this,void 0,void 0,(function*(){try{yield $A(e)}catch(e){if(e.code==="ENOENT"){return false}throw e}return true}))}function isDirectory(e){return YA(this,arguments,void 0,(function*(e,t=false){const A=t?yield $A(e):yield JA(e);return A.isDirectory()}))}function isRooted(e){e=normalizeSeparators(e);if(!e){throw new Error('isRooted() parameter "p" cannot be empty')}if(KA){return e.startsWith("\\")||/^[A-Z]:/i.test(e)}return e.startsWith("/")}function tryGetExecutablePath(e,t){return YA(this,void 0,void 0,(function*(){let A=undefined;try{A=yield $A(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(KA){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 $A(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(KA){try{const t=s.dirname(e);const A=s.basename(e).toUpperCase();for(const r of yield WA(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(KA){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 tr=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 tr(this,arguments,void 0,(function*(e,t,A={}){const{force:r,recursive:n,copySourceDirectory:i}=readCopyOptions(A);const o=(yield exists(t))?yield $A(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 $A(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 tr(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 tr(this,void 0,void 0,(function*(){if(KA){if(/[*"<>|]/.test(e)){throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows')}}try{yield qA(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 tr(this,void 0,void 0,(function*(){(0,i.ok)(e,"a path argument must be provided");yield VA(e,{recursive:true})}))}function which(e,t){return tr(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(KA){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 tr(this,void 0,void 0,(function*(){if(!e){throw new Error("parameter 'tool' is required")}const t=[];if(KA&&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 tr(this,void 0,void 0,(function*(){if(A>=255)return;A++;yield mkdirP(t);const n=yield WA(e);for(const s of n){const n=`${e}/${s}`;const i=`${t}/${s}`;const o=yield JA(n);if(o.isDirectory()){yield cpDirRecursive(n,i,A,r)}else{yield io_copyFile(n,i,r)}}yield GA(t,(yield $A(e)).mode)}))}function io_copyFile(e,t,A){return tr(this,void 0,void 0,(function*(){if((yield JA(e)).isSymbolicLink()){try{yield JA(t);yield ZA(t)}catch(e){if(e.code==="EPERM"){yield GA(t,"0666");yield ZA(t)}}const A=yield readlink(e);yield zA(A,t,KA?"junction":null)}else if(!(yield exists(t))||A){yield OA(e,t)}}))}const Ar=e(import.meta.url)("timers");var rr=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 nr=process.platform==="win32";class ToolRunner extends xA.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(nr){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(oA.EOL);while(n>-1){const e=r.substring(0,n);A(e);r=r.substring(n+oA.EOL.length);n=r.indexOf(oA.EOL)}return r}catch(e){this._debug(`error processing line. Failed with error ${e}`);return""}}_getSpawnFileName(){if(nr){if(this._isCmdFile()){return process.env["COMSPEC"]||"cmd.exe"}}return this.toolPath}_getSpawnArgs(e){if(nr){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 rr(this,void 0,void 0,(function*(){if(!isRooted(this.toolPath)&&(this.toolPath.includes("/")||nr&&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)=>rr(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)+oA.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=HA.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 xA.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,Ar.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 sr=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 sr(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 sr(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 ir=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=()=>ir(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=()=>ir(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=()=>ir(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 or=oA.platform();const ar=oA.arch();const cr=or==="win32";const lr=or==="darwin";const ur=or==="linux";function getDetails(){return ir(this,void 0,void 0,(function*(){return Object.assign(Object.assign({},yield cr?getWindowsInfo():lr?getMacOsInfo():getLinuxInfo()),{platform:or,arch:ar,isWindows:cr,isMacOS:lr,isLinux:ur})}))}var gr=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 hr;(function(e){e[e["Success"]=0]="Success";e[e["Failure"]=1]="Failure"})(hr||(hr={}));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(oA.EOL);command_issueCommand("set-output",{name:e},utils_toCommandValue(t))}function setCommandEcho(e){issue("echo",e?"on":"off")}function setFailed(e){process.exitCode=hr.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+oA.EOL)}function startGroup(e){command_issue("group",e)}function endGroup(){command_issue("endgroup")}function group(e,t){return gr(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 gr(this,void 0,void 0,(function*(){return yield OidcClient.getIDToken(e)}))}const fr=oA.platform();const Er=oA.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 5.2.2 https://github.com/nodeca/js-yaml @license MIT */ -var dr=Symbol("NOT_RESOLVED");var Cr=Symbol("MERGE_KEY");function defineScalarTag(e,t){return{tagName:e,nodeKind:"scalar",implicit:t.implicit??false,matchByTagPrefix:t.matchByTagPrefix??false,implicitFirstChars:t.implicitFirstChars??null,resolve:t.resolve,identify:t.identify??null,represent:t.represent??(e=>String(e)),representTagName:t.representTagName??null}}function defineSequenceTag(e,t){const A=t.finalize===void 0;return{tagName:e,nodeKind:"sequence",implicit:false,matchByTagPrefix:t.matchByTagPrefix??false,create:t.create,addItem:t.addItem,finalize:t.finalize??(e=>e),carrierIsResult:A,identify:t.identify??null,represent:t.represent??(e=>e),representTagName:t.representTagName??null}}function defineMappingTag(e,t){const A=t.finalize===void 0;return{tagName:e,nodeKind:"mapping",implicit:false,matchByTagPrefix:t.matchByTagPrefix??false,create:t.create,addPair:t.addPair,has:t.has,keys:t.keys,get:t.get,finalize:t.finalize??(e=>e),carrierIsResult:A,identify:t.identify??null,represent:t.represent??(e=>e),representTagName:t.representTagName??null}}var Br=defineScalarTag("tag:yaml.org,2002:str",{resolve:e=>e,identify:e=>typeof e==="string"});var Qr=["","~","null","Null","NULL"];var Ir=defineScalarTag("tag:yaml.org,2002:null",{implicit:true,implicitFirstChars:["","~","n","N"],resolve:e=>{if(Qr.indexOf(e)!==-1)return null;return dr},identify:e=>e===null,represent:()=>"null"});var pr=defineScalarTag("tag:yaml.org,2002:null",{implicit:true,implicitFirstChars:["n"],resolve:(e,t)=>{if(e==="null"||t&&e==="")return null;return dr},identify:e=>e===null,represent:()=>"null"});var Dr=["","~","null","Null","NULL"];var mr=defineScalarTag("tag:yaml.org,2002:null",{implicit:true,implicitFirstChars:["","~","n","N"],resolve:e=>{if(Dr.indexOf(e)!==-1)return null;return dr},identify:e=>e===null,represent:()=>"null"});var yr=["true","True","TRUE"];var wr=["false","False","FALSE"];var Fr=defineScalarTag("tag:yaml.org,2002:bool",{implicit:true,implicitFirstChars:["t","T","f","F"],resolve:e=>{if(yr.indexOf(e)!==-1)return true;if(wr.indexOf(e)!==-1)return false;return dr},identify:e=>Object.prototype.toString.call(e)==="[object Boolean]",represent:e=>e?"true":"false"});var br=["true"];var kr=["false"];var Sr=defineScalarTag("tag:yaml.org,2002:bool",{implicit:true,implicitFirstChars:["t","f"],resolve:e=>{if(br.indexOf(e)!==-1)return true;if(kr.indexOf(e)!==-1)return false;return dr},identify:e=>Object.prototype.toString.call(e)==="[object Boolean]",represent:e=>e?"true":"false"});var Rr=["true","True","TRUE","y","Y","yes","Yes","YES","on","On","ON"];var Nr=["false","False","FALSE","n","N","no","No","NO","off","Off","OFF"];var Mr=defineScalarTag("tag:yaml.org,2002:bool",{implicit:true,implicitFirstChars:["y","Y","n","N","t","T","f","F","o","O"],resolve:e=>{if(Rr.indexOf(e)!==-1)return true;if(Nr.indexOf(e)!==-1)return false;return dr},identify:e=>Object.prototype.toString.call(e)==="[object Boolean]",represent:e=>e?"true":"false"});var vr=new RegExp("^(?:0o[0-7]+|0x[0-9a-fA-F]+|[-+]?[0-9]+)$");var Ur=new RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");function parseYamlInteger$2(e){let t=e;let A=1;if(t[0]==="-"||t[0]==="+"){if(t[0]==="-")A=-1;t=t.slice(1)}if(t.startsWith("0b"))return A*parseInt(t.slice(2),2);if(t.startsWith("0o"))return A*parseInt(t.slice(2),8);if(t.startsWith("0x"))return A*parseInt(t.slice(2),16);return A*parseInt(t,10)}function resolveYamlInteger$2(e,t){if(t){if(!Ur.test(e))return dr}else if(!vr.test(e))return dr;const A=parseYamlInteger$2(e);return Number.isFinite(A)?A:dr}var Tr=defineScalarTag("tag:yaml.org,2002:int",{implicit:true,implicitFirstChars:["-","+",..."0123456789"],resolve:resolveYamlInteger$2,identify:e=>Number.isInteger(e)&&!Object.is(e,-0)&&e.toString(10).indexOf("e")<0,represent:e=>e.toString(10)});var Lr=new RegExp("^-?(?:0|[1-9][0-9]*)$");var xr=new RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");function parseYamlInteger$1(e){let t=e;let A=1;if(t[0]==="-"||t[0]==="+"){if(t[0]==="-")A=-1;t=t.slice(1)}if(t.startsWith("0b"))return A*parseInt(t.slice(2),2);if(t.startsWith("0o"))return A*parseInt(t.slice(2),8);if(t.startsWith("0x"))return A*parseInt(t.slice(2),16);return A*parseInt(t,10)}function resolveYamlInteger$1(e,t){if(t){if(!xr.test(e))return dr}else if(!Lr.test(e))return dr;const A=parseYamlInteger$1(e);return Number.isFinite(A)?A:dr}var Hr=defineScalarTag("tag:yaml.org,2002:int",{implicit:true,implicitFirstChars:["-",..."0123456789"],resolve:resolveYamlInteger$1,identify:e=>Number.isInteger(e)&&!Object.is(e,-0)&&e.toString(10).indexOf("e")<0,represent:e=>e.toString(10)});var Yr=new RegExp("^(?:[-+]?0b[0-1_]+|[-+]?0[0-7_]+|[-+]?0x[0-9a-fA-F_]+|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+|[-+]?(?:0|[1-9][0-9_]*))$");function parseYamlInteger(e){let t=e.replace(/_/g,"");let A=1;if(t[0]==="-"||t[0]==="+"){if(t[0]==="-")A=-1;t=t.slice(1)}if(t.startsWith("0b"))return A*parseInt(t.slice(2),2);if(t.startsWith("0x"))return A*parseInt(t.slice(2),16);if(t.includes(":")){let e=0;for(const A of t.split(":"))e=e*60+Number(A);return A*e}if(t!=="0"&&t[0]==="0")return A*parseInt(t,8);return A*parseInt(t,10)}function resolveYamlInteger(e){if(!Yr.test(e))return dr;const t=parseYamlInteger(e);return Number.isFinite(t)?t:dr}var Gr=defineScalarTag("tag:yaml.org,2002:int",{implicit:true,implicitFirstChars:["-","+",..."0123456789"],resolve:resolveYamlInteger,identify:e=>Number.isInteger(e)&&!Object.is(e,-0)&&e.toString(10).indexOf("e")<0,represent:e=>e.toString(10)});var Or=new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");var Jr=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function resolveYamlFloat$2(e){if(!Or.test(e))return dr;let t=e.toLowerCase();const A=t[0]==="-"?-1:1;if("+-".includes(t[0]))t=t.slice(1);if(t===".inf")return A===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;if(t===".nan")return NaN;const r=A*parseFloat(t);if(Number.isFinite(r)||Jr.test(e))return r;return dr}function representYamlFloat$2(e){if(isNaN(e))return".nan";if(e===Number.POSITIVE_INFINITY)return".inf";if(e===Number.NEGATIVE_INFINITY)return"-.inf";if(Object.is(e,-0))return"-0.0";const t=e.toString(10);return/^[-+]?[0-9]+e/.test(t)?t.replace("e",".e"):t}var Vr=defineScalarTag("tag:yaml.org,2002:float",{implicit:true,implicitFirstChars:["-","+",".",..."0123456789"],resolve:resolveYamlFloat$2,identify:e=>typeof e==="number"&&(!Number.isInteger(e)||Object.is(e,-0)||e.toString(10).indexOf("e")>=0),represent:representYamlFloat$2});var Pr=new RegExp("^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$");var Wr=new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function resolveYamlFloat$1(e,t){if(t){if(!Wr.test(e))return dr;let t=e.toLowerCase();const A=t[0]==="-"?-1:1;if("+-".includes(t[0]))t=t.slice(1);if(t===".inf")return A===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;if(t===".nan")return NaN;const r=A*parseFloat(t);return Number.isFinite(r)?r:dr}if(!Pr.test(e))return dr;const A=Number(e);if(Number.isFinite(A))return A;return dr}function representYamlFloat$1(e){if(isNaN(e))return".nan";if(e===Number.POSITIVE_INFINITY)return".inf";if(e===Number.NEGATIVE_INFINITY)return"-.inf";if(Object.is(e,-0))return"-0.0";const t=e.toString(10);return/^[-+]?[0-9]+e/.test(t)?t.replace("e",".e"):t}var _r=defineScalarTag("tag:yaml.org,2002:float",{implicit:true,implicitFirstChars:["-",..."0123456789"],resolve:resolveYamlFloat$1,identify:e=>typeof e==="number"&&(!Number.isInteger(e)||Object.is(e,-0)||e.toString(10).indexOf("e")>=0),represent:representYamlFloat$1});var qr=new RegExp("^(?:[-+]?(?:(?:[0-9][0-9_]*)?\\.[0-9_]*)(?:[eE][-+][0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");var jr=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function resolveYamlFloat(e){if(!qr.test(e))return dr;let t=e.toLowerCase().replace(/_/g,"");const A=t[0]==="-"?-1:1;if("+-".includes(t[0]))t=t.slice(1);if(t===".inf")return A===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;if(t===".nan")return NaN;let r=0;if(t.includes(":")){for(const e of t.split(":"))r=r*60+Number(e);r*=A}else r=A*parseFloat(t);if(Number.isFinite(r)||jr.test(e))return r;return dr}function representYamlFloat(e){if(isNaN(e))return".nan";if(e===Number.POSITIVE_INFINITY)return".inf";if(e===Number.NEGATIVE_INFINITY)return"-.inf";if(Object.is(e,-0))return"-0.0";const t=e.toString(10);return/^[-+]?[0-9]+e/.test(t)?t.replace("e",".e"):t}var $r=defineScalarTag("tag:yaml.org,2002:float",{implicit:true,implicitFirstChars:["-","+",".",..."0123456789"],resolve:resolveYamlFloat,identify:e=>typeof e==="number"&&(!Number.isInteger(e)||Object.is(e,-0)||e.toString(10).indexOf("e")>=0),represent:representYamlFloat});var zr=defineScalarTag("tag:yaml.org,2002:merge",{implicit:true,implicitFirstChars:["<"],resolve:(e,t)=>{if(e==="<<"||t&&e==="")return Cr;return dr}});var Zr=/^[A-Za-z0-9+/]*={0,2}$/;function resolveYamlBinary(e){const t=e.replace(/\s/g,"");if(t.length%4!==0||!Zr.test(t))return dr;const A=atob(t);const r=new Uint8Array(A.length);for(let e=0;eObject.prototype.toString.call(e)==="[object Uint8Array]",represent:representYamlBinary});var Xr=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$");var en=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){let t=Xr.exec(e);if(t===null)t=en.exec(e);if(t===null)return dr;const A=+t[1];const r=+t[2]-1;const n=+t[3];if(!t[4]){const e=new Date(Date.UTC(A,r,n));if(e.getUTCFullYear()!==A||e.getUTCMonth()!==r||e.getUTCDate()!==n)return dr;return e}const s=+t[4];const i=+t[5];const o=+t[6];let a=0;if(s>23||i>59||o>59)return dr;if(t[7]){let e=t[7].slice(0,3);while(e.length<3)e+="0";a=+e}const c=new Date(Date.UTC(A,r,n,s,i,o,a));if(c.getUTCFullYear()!==A||c.getUTCMonth()!==r||c.getUTCDate()!==n)return dr;if(t[9]){const e=+t[10];const A=+(t[11]||0);if(e>23||A>59)return dr;const r=(e*60+A)*6e4;c.setTime(c.getTime()-(t[9]==="-"?-r:r))}return c}var tn=defineScalarTag("tag:yaml.org,2002:timestamp",{implicit:true,implicitFirstChars:[..."0123456789"],resolve:resolveYamlTimestamp,identify:e=>e instanceof Date,represent:e=>e.toISOString()});var An=defineSequenceTag("tag:yaml.org,2002:seq",{create:()=>[],addItem:(e,t)=>{e.push(t)},identify:Array.isArray});function isPlainObject(e){if(e===null||typeof e!=="object"||Array.isArray(e))return false;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function pick(e,t){const A={};for(const r of t)if(e[r]!==void 0)A[r]=e[r];return A}var rn=defineSequenceTag("tag:yaml.org,2002:omap",{create:()=>({list:[],seen:new Set}),addItem:(e,t)=>{let A;if(t instanceof Map){if(t.size!==1)return"cannot resolve an ordered map item";A=t.keys().next().value}else if(isPlainObject(t)){const e=Object.keys(t);if(e.length!==1)return"cannot resolve an ordered map item";A=e[0]}else return"cannot resolve an ordered map item";if(e.seen.has(A))return"duplicate key in ordered map";e.seen.add(A);e.list.push(t);return""},finalize:e=>e.list});var nn=defineSequenceTag("tag:yaml.org,2002:pairs",{create:()=>[],addItem:(e,t)=>{if(t instanceof Map){if(t.size!==1)return"cannot resolve a pairs item";e.push(t.entries().next().value);return""}if(Object.prototype.toString.call(t)!=="[object Object]")return"cannot resolve a pairs item";const A=t;const r=Object.keys(A);if(r.length!==1)return"cannot resolve a pairs item";e.push([r[0],A[r[0]]]);return""}});var sn=defineMappingTag("tag:yaml.org,2002:map",{create:()=>({}),identify:isPlainObject,represent:e=>{const t=new Map;for(const A of Object.keys(e))t.set(A,e[A]);return t},addPair:(e,t,A)=>{if(t!==null&&typeof t==="object")return"object-based map does not support complex keys";const r=String(t);if(r==="__proto__")Object.defineProperty(e,r,{value:A,enumerable:true,configurable:true,writable:true});else e[r]=A;return""},has:(e,t)=>{if(t!==null&&typeof t==="object")return false;return Object.prototype.hasOwnProperty.call(e,String(t))},keys:e=>Object.keys(e),get:(e,t)=>e[String(t)]});var on=defineMappingTag("tag:yaml.org,2002:set",{create:()=>new Set,identify:e=>e instanceof Set,represent:e=>{const t=new Map;for(const A of e)t.set(A,null);return t},addPair:(e,t,A)=>{if(A!==null)return"cannot resolve a set item";e.add(t);return""},has:(e,t)=>e.has(t),keys:e=>e.keys(),get:()=>null});function createTagDefinitionMap(){return{scalar:{},sequence:{},mapping:{}}}function createTagDefinitionListMap(){return{scalar:[],sequence:[],mapping:[]}}function compileTags(e){const t=[];for(const A of e){let e=t.length;for(let r=0;re.implicitFirstChars===null));const i=new Set;for(const e of A)if(e.implicitFirstChars!==null)for(const t of e.implicitFirstChars)i.add(t);const o=new Map;for(const e of i)o.set(e,A.filter((t=>t.implicitFirstChars===null||t.implicitFirstChars.indexOf(e)!==-1)));const a=r.scalar["tag:yaml.org,2002:str"];if(!a)throw new Error("schema does not define the default scalar tag (tag:yaml.org,2002:str)");this.tags=t;this.implicitScalarTags=A;this.implicitScalarByFirstChar=o;this.implicitScalarAnyFirstChar=s;this.defaultScalarTag=a;this.defaultSequenceTag=r.sequence["tag:yaml.org,2002:seq"];this.defaultMappingTag=r.mapping["tag:yaml.org,2002:map"];this.exact=r;this.prefix=n}withTags(...e){let t=[];for(const A of e)t=t.concat(A);return new Schema([...this.tags,...t])}};var cn=new an([Br,An,sn]);var ln=new an([...cn.tags,pr,Sr,Hr,_r]);var un=new an([...cn.tags,Ir,Fr,Tr,Vr]);var gn=new an([...cn.tags,mr,Mr,Gr,$r,tn,zr,Kr,rn,nn,on]);var hn=defineMappingTag("tag:yaml.org,2002:map",{create:()=>new Map,addPair:(e,t,A)=>{e.set(t,A);return""},has:(e,t)=>e.has(t),keys:e=>e.keys(),get:(e,t)=>e.get(t),identify:e=>e instanceof Map||isPlainObject(e),represent:e=>{if(e instanceof Map)return e;const t=new Map;const A=e;for(const e of Object.keys(A))t.set(e,A[e]);return t}});function normalizeKey(e){if(Array.isArray(e)){const t=Array.prototype.slice.call(e);for(let e=0;e({}),identify:isPlainObject,represent:e=>{const t=new Map;for(const A of Object.keys(e))t.set(A,e[A]);return t},addPair:(e,t,A)=>{const r=normalizeKey(t);if(r===null)return"nested arrays are not supported inside keys";if(r==="__proto__")Object.defineProperty(e,r,{value:A,enumerable:true,configurable:true,writable:true});else e[r]=A;return""},has:(e,t)=>{const A=normalizeKey(t);return A!==null&&Object.prototype.hasOwnProperty.call(e,A)},keys:e=>Object.keys(e),get:(e,t)=>e[String(t)]});var En={maxLength:79,indent:1,linesBefore:3,linesAfter:2};function getLine(e,t,A,r,n){let s="";let i="";const o=Math.floor(n/2)-1;if(r-t>o){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" ".repeat(Math.max(t-e.length,0))+e}function makeSnippet(e,t){if(!e.buffer)return null;const A={...En,...t};const r=/\r?\n|\r|\0/g;const n=[0];const s=[];let i;let o=-1;while(i=r.exec(e.buffer)){s.push(i.index);n.push(i.index+i[0].length);if(e.position<=i.index&&o<0)o=n.length-2}if(o<0)o=n.length-1;let a="";const c=Math.min(e.line+A.linesAfter,s.length).toString().length;const l=A.maxLength-(A.indent+c+3);for(let t=1;t<=A.linesBefore;t++){if(o-t<0)break;const r=getLine(e.buffer,n[o-t],s[o-t],e.position-(n[o]-n[o-t]),l);a=`${" ".repeat(A.indent)}${padStart((e.line-t+1).toString(),c)} | ${r.str}\n${a}`}const u=getLine(e.buffer,n[o],s[o],e.position,l);a+=`${" ".repeat(A.indent)}${padStart((e.line+1).toString(),c)} | ${u.str}\n`;a+=`${"-".repeat(A.indent+c+3+u.pos)}^\n`;for(let t=1;t<=A.linesAfter;t++){if(o+t>=s.length)break;const r=getLine(e.buffer,n[o+t],s[o+t],e.position-(n[o]-n[o+t]),l);a+=`${" ".repeat(A.indent)}${padStart((e.line+t+1).toString(),c)} | ${r.str}\n`}return a.replace(/\n$/,"")}function formatError(e,t){let A="";if(!e.mark)return e.reason;if(e.mark.name)A+=`in "${e.mark.name}" `;A+=`(${e.mark.line+1}:${e.mark.column+1})`;if(!t&&e.mark.snippet)A+=`\n\n${e.mark.snippet}`;return`${e.reason} ${A}`}var dn=class extends Error{reason;mark;constructor(e,t){super();this.name="YAMLException";this.reason=e;this.mark=t;this.message=formatError(this,false);if(Error.captureStackTrace)Error.captureStackTrace(this,this.constructor)}toString(e){return`${this.name}: ${formatError(this,e)}`}};function throwErrorAt(e,t,A,r=""){let n=0;let s=0;for(let A=0;A>10)+55296,(e-65536&1023)+56320)}function fromHexCode$1(e){if(e>=48&&e<=57)return e-48;return(e|32)-97+10}function escapedHexLen$1(e){if(e===120)return 2;if(e===117)return 4;return 8}function skipFoldedBreaks(e,t,A){let r=0;while(t0;A--){n++;const t=fromHexCode$1(e.charCodeAt(n));s=(s<<4)+t}r+=charFromCodepoint(s);n++}s=i=n}else if(t===10||t===13){r+=e.slice(s,i);const t=skipFoldedBreaks(e,n,A);r+=foldedBreaks(t.breaks);n=s=i=t.position}else{n++;if(t!==32&&t!==9)i=n}}return r+e.slice(s,A)}function getBlockValue(e,t,A,r,n,s){const i=r<0?0:r;const o=e.slice(t,A).replace(/\r\n?/g,"\n");const a=o===""?[]:(o.endsWith("\n")?o.slice(0,-1):o).split("\n");let c="";let l=false;let u=0;let g=false;for(const e of a){let t=0;while(t=e.length){u++;continue}const A=e.slice(i);const n=A.charCodeAt(0);if(s)if(n===32||n===9){g=true;c+="\n".repeat(l?1+u:u)}else if(g){g=false;c+="\n".repeat(u+1)}else if(u===0){if(l)c+=" "}else c+="\n".repeat(u);else c+="\n".repeat(l?1+u:u);c+=A;l=true;u=0}if(n===3)c+="\n".repeat(l?1+u:u);else if(n!==2){if(l)c+="\n"}return c}function getScalarValue(e,t){if(t.valueStart===vn)return"";const{valueStart:A,valueEnd:r}=t;if(t.fast)return e.slice(A,r);switch(t.style){case 2:return getSingleQuotedValue(e,A,r);case 3:return getDoubleQuotedValue(e,A,r);case 4:return getBlockValue(e,A,r,t.indent,t.chomping,false);case 5:return getBlockValue(e,A,r,t.indent,t.chomping,true);default:return getPlainValue(e,A,r)}}var Ln={"!":"!","!!":"tag:yaml.org,2002:"};function tagPercentEncode(e){return encodeURI(e).replace(/!/g,"%21")}function tagNameFull(e,t){if(e.startsWith("!<")&&e.endsWith(">"))return decodeURIComponent(e.slice(2,-1));const A=e.indexOf("!",1);const r=A===-1?"!":e.slice(0,A+1);const n=t?.[r]??Ln[r]??r;return decodeURIComponent(n)+decodeURIComponent(e.slice(r.length))}function tagNameShort(e){let t=e;if(t.charCodeAt(0)===33){t=t.slice(1);return`!${tagPercentEncode(t)}`}if(t.slice(0,18)==="tag:yaml.org,2002:")return`!!${tagPercentEncode(t.slice(18))}`;return`!<${tagPercentEncode(t)}>`}var xn=-1;var Hn={filename:"",schema:un,json:false,maxTotalMergeKeys:1e4,maxAliases:-1};function eventPosition$1(e){if("tagStart"in e&&e.tagStart!==xn)return e.tagStart;if("anchorStart"in e&&e.anchorStart!==xn)return e.anchorStart;if("valueStart"in e&&e.valueStart!==xn)return e.valueStart;if("start"in e)return e.start;return 0}function throwError$1(e,t){throwErrorAt(e.source,e.position,t,e.filename)}function finalizeCollection(e,t,A,r){try{return A.finalize(r)}catch(A){if(A instanceof dn)throw A;throwErrorAt(e.source,t,A instanceof Error?A.message:String(A),e.filename)}}function lookupTag(e,t,A){const r=e[A];if(r)return r;for(const e of t)if(A.startsWith(e.tagName))return e}function findExplicitTag(e,t,A,r,n){const s=lookupTag(t,A,r);if(s)return s;throwError$1(e,`unknown ${n} tag !<${r}>`)}function constructScalar(e,t){const A=getScalarValue(e.source,t);const r=t.tagStart===xn?"":e.source.slice(t.tagStart,t.tagEnd);const n=e.schema.defaultScalarTag;if(r!==""){if(r==="!")return{value:A,tag:n};const t=tagNameFull(r,e.tagHandlers);const s=lookupTag(e.schema.exact.scalar,e.schema.prefix.scalar,t);if(s){const r=s.resolve(A,true,t);if(r===dr)throwError$1(e,`cannot resolve a node with !<${t}> explicit tag`);return{value:r,tag:s}}const i=lookupTag(e.schema.exact.mapping,e.schema.prefix.mapping,t)??lookupTag(e.schema.exact.sequence,e.schema.prefix.sequence,t);if(i){if(A!=="")throwError$1(e,`cannot resolve a node with !<${t}> explicit tag`);const r=i.create(t);return{value:i.carrierIsResult?r:finalizeCollection(e,e.position,i,r),tag:i}}throwError$1(e,`unknown scalar tag !<${t}>`)}if(t.style===1){const t=e.schema.implicitScalarByFirstChar.get(A.charAt(0))??e.schema.implicitScalarAnyFirstChar;for(const e of t){const t=e.resolve(A,false,e.tagName);if(t!==dr)return{value:t,tag:e}}}return{value:n.resolve(A,false,n.tagName),tag:n}}function collectionTag(e,t,A,r,n,s){const i=t.tagStart===xn?"":e.source.slice(t.tagStart,t.tagEnd);const o=i===""||i==="!"?n:tagNameFull(i,e.tagHandlers);return{tagName:o,tag:findExplicitTag(e,A,r,o,s)}}function isMappingTag(e){return e.nodeKind==="mapping"}function mergeKeys(e,t,A,r){for(const n of r.keys(A)){if(e.maxTotalMergeKeys!==-1&&++e.totalMergeKeys>e.maxTotalMergeKeys)throwError$1(e,`merge keys exceeded maxTotalMergeKeys (${e.maxTotalMergeKeys})`);if(t.tag.has(t.value,n))continue;const s=t.tag.addPair(t.value,n,r.get(A,n));if(s)throwError$1(e,s);(t.overridable??=new Set).add(n)}}function mergeSource(e,t,A,r){e.position=t.keyPosition;if(isMappingTag(r))mergeKeys(e,t,A,r);else if(r.nodeKind==="sequence"&&Array.isArray(A))for(const r of A)mergeKeys(e,t,r,t.tag);else throwError$1(e,"cannot merge mappings; the provided source object is unacceptable")}function addMappingValue(e,t,A,r,n){e.position=t.keyPosition;if(A===Cr){mergeSource(e,t,r,n);return}if(!e.json&&t.tag.has(t.value,A)&&!t.overridable?.has(A))throwError$1(e,"duplicated mapping key");const s=t.tag.addPair(t.value,A,r);if(s)throwError$1(e,s);t.overridable?.delete(A)}function addValue(e,t,A){const r=e.frames[e.frames.length-1];if(r.kind==="document"){r.value=t;r.hasValue=true}else if(r.kind==="sequence"){if(r.merge){if(!isMappingTag(A))throwError$1(e,"cannot merge mappings; the provided source object is unacceptable")}const n=r.tag.addItem(r.value,t,r.index++);if(n)throwError$1(e,n)}else if(r.hasKey){const n=r.key;r.key=void 0;r.hasKey=false;addMappingValue(e,r,n,t,A)}else{r.key=t;r.keyPosition=e.position;r.hasKey=true}}function storeAnchor(e,t,A,r,n){if(t.anchorStart!==xn){const s={value:A,tag:r,isValueFinal:n};e.anchors.set(e.source.slice(t.anchorStart,t.anchorEnd),s);return s}return null}function constructFromEvents(e,t){const A={...Hn,...t,events:e,documents:[],eventIndex:0,position:0,frames:[],anchors:new Map,tagHandlers:Object.create(null),totalMergeKeys:0,aliasCount:0};while(A.eventIndexA.maxAliases)throwError$1(A,`aliases exceeded maxAliases (${A.maxAliases})`);const t=A.source.slice(e.anchorStart,e.anchorEnd);const r=A.anchors.get(t);if(!r)throwError$1(A,`unidentified alias "${t}"`);if(!r.isValueFinal)throwError$1(A,`recursive alias "${t}" is not supported for tag ${r.tag.tagName} because it uses finalize()`);addValue(A,r.value,r.tag);break}case 6:{const e=A.frames.pop();if(e.kind==="document")A.documents.push(e.value);else{const t=e.tag.carrierIsResult?e.value:finalizeCollection(A,e.position,e.tag,e.value);if(e.anchor){e.anchor.value=t;e.anchor.isValueFinal=true}addValue(A,t,e.tag)}break}}}return A.documents}var Yn=-1;var Gn=Object.prototype.hasOwnProperty;var On=1;var Jn=2;var Vn=3;var Pn=4;var Wn=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;var _n=/[,\[\]{}]/;var qn=/^(?:!|!!|![0-9A-Za-z-]+!)$/;var jn=String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$,_.!~*'()\[\]])`;var $n=String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$.~*'()_])`;var zn=new RegExp(`^(?:${jn})*$`);var Zn=new RegExp(`^(?:${$n})+$`);var Kn=new RegExp(`^(?:!(?:${jn})*|${$n}(?:${jn})*)$`);var Xn={filename:"",maxDepth:100};function addDocumentEvent(e,t,A){e.events.push({type:1,explicitStart:t,explicitEnd:A,directives:e.directives})}function addSequenceEvent(e,t,A,r,n,s,i){e.events.push({type:2,start:t,anchorStart:A,anchorEnd:r,tagStart:n,tagEnd:s,style:i})}function addMappingEvent(e,t,A,r,n,s,i){e.events.push({type:3,start:t,anchorStart:A,anchorEnd:r,tagStart:n,tagEnd:s,style:i})}function insertFlowPairMappingEvent(e,t){e.events.splice(t.eventsLength,0,{type:3,start:t.position,anchorStart:Yn,anchorEnd:Yn,tagStart:Yn,tagEnd:Yn,style:2})}function addScalarEvent(e,t,A,r,n,s,i,o,a=1,c=-1,l=false){e.events.push({type:4,valueStart:t,valueEnd:A,anchorStart:r,anchorEnd:n,tagStart:s,tagEnd:i,style:o,chomping:a,indent:c,fast:l})}function addAliasEvent(e,t,A){e.events.push({type:5,anchorStart:t,anchorEnd:A})}function addPopEvent(e){e.events.push({type:6})}function addEmptyScalarEvent(e){addScalarEvent(e,Yn,Yn,Yn,Yn,Yn,Yn,1)}function emptyProperties(){return{anchorStart:Yn,anchorEnd:Yn,tagStart:Yn,tagEnd:Yn}}function snapshotState(e){return{position:e.position,line:e.line,lineStart:e.lineStart,lineIndent:e.lineIndent,firstTabInLine:e.firstTabInLine,eventsLength:e.events.length}}function restoreState(e,t){e.position=t.position;e.line=t.line;e.lineStart=t.lineStart;e.lineIndent=t.lineIndent;e.firstTabInLine=t.firstTabInLine;e.events.length=t.eventsLength}function throwError(e,t){throwErrorAt(e.input.slice(0,e.length),e.position,t,e.filename)}function isEol(e){return e===10||e===13}function isWhiteSpace(e){return e===9||e===32}function isWsOrEol(e){return isWhiteSpace(e)||isEol(e)}function isWsOrEolOrEnd(e){return e===0||isWsOrEol(e)}function isFlowIndicator(e){return e===44||e===91||e===93||e===123||e===125}function fromDecimalCode(e){return e>=48&&e<=57?e-48:-1}function fromHexCode(e){if(e>=48&&e<=57)return e-48;const t=e|32;if(t>=97&&t<=102)return t-97+10;return-1}function escapedHexLen(e){if(e===120)return 2;if(e===117)return 4;if(e===85)return 8;return 0}function isSimpleEscape(e){return e===48||e===97||e===98||e===116||e===9||e===110||e===118||e===102||e===114||e===101||e===32||e===34||e===47||e===92||e===78||e===95||e===76||e===80}function consumeLineBreak(e){if(e.input.charCodeAt(e.position)===10)e.position++;else{e.position++;if(e.input.charCodeAt(e.position)===10)e.position++}e.line++;e.lineStart=e.position;e.lineIndent=0;e.firstTabInLine=-1}function skipSeparationSpace(e,t){let A=0;let r=e.input.charCodeAt(e.position);let n=e.position===e.lineStart||isWsOrEol(e.input.charCodeAt(e.position-1));while(r!==0){while(isWhiteSpace(r)){n=true;if(r===9&&e.firstTabInLine===-1)e.firstTabInLine=e.position;r=e.input.charCodeAt(++e.position)}if(t&&n&&r===35)do{r=e.input.charCodeAt(++e.position)}while(!isEol(r)&&r!==0);if(!isEol(r))break;consumeLineBreak(e);A++;n=true;r=e.input.charCodeAt(e.position);while(r===32){e.lineIndent++;r=e.input.charCodeAt(++e.position)}}return A}function testDocumentSeparator(e,t=e.position){const A=e.input.charCodeAt(t);if((A===45||A===46)&&A===e.input.charCodeAt(t+1)&&A===e.input.charCodeAt(t+2)){const A=e.input.charCodeAt(t+3);return A===0||isWsOrEol(A)}return false}function skipUntilLineEnd(e){let t=e.input.charCodeAt(e.position);while(t!==0&&!isEol(t))t=e.input.charCodeAt(++e.position)}function checkPrintable(e,t,A){if(Wn.test(e.input.slice(t,A)))throwError(e,"the stream contains non-printable characters")}function readTagProperty(e,t,A){if(e.input.charCodeAt(e.position)!==33)return false;if(t.tagStart!==Yn)throwError(e,"duplication of a tag property");const r=e.position;let n=false;let s=false;let i="!";let o=e.input.charCodeAt(++e.position);if(o===60){n=true;o=e.input.charCodeAt(++e.position)}else if(o===33){s=true;i="!!";o=e.input.charCodeAt(++e.position)}let a=e.position;let c;if(n){while(o!==0&&o!==62)o=e.input.charCodeAt(++e.position);if(o!==62)throwError(e,"unexpected end of the stream within a verbatim tag");c=e.input.slice(a,e.position);e.position++}else{while(o!==0&&!isWsOrEol(o)&&!(A&&isFlowIndicator(o))){if(o===33)if(!s){i=e.input.slice(a-1,e.position+1);if(!qn.test(i))throwError(e,"named tag handle cannot contain such characters");s=true;a=e.position+1}else throwError(e,"tag suffix cannot contain exclamation marks");o=e.input.charCodeAt(++e.position)}c=e.input.slice(a,e.position);if(_n.test(c))throwError(e,"tag suffix cannot contain flow indicator characters")}if(c&&!(n?zn.test(c):Zn.test(c)))throwError(e,`tag name cannot contain such characters: ${c}`);if(!n&&i!=="!"&&i!=="!!"&&!Gn.call(e.tagHandlers,i))throwError(e,`undeclared tag handle "${i}"`);t.tagStart=r;t.tagEnd=e.position;return true}function readAnchorProperty(e,t){if(e.input.charCodeAt(e.position)!==38)return false;if(t.anchorStart!==Yn)throwError(e,"duplication of an anchor property");e.position++;const A=e.position;while(e.input.charCodeAt(e.position)!==0&&!isWsOrEol(e.input.charCodeAt(e.position))&&!isFlowIndicator(e.input.charCodeAt(e.position)))e.position++;if(e.position===A)throwError(e,"name of an anchor node must contain at least one character");t.anchorStart=A;t.anchorEnd=e.position;return true}function readAlias(e,t){if(e.input.charCodeAt(e.position)!==42)return false;if(t.anchorStart!==Yn||t.tagStart!==Yn)throwError(e,"alias node should not have any properties");e.position++;const A=e.position;while(e.input.charCodeAt(e.position)!==0&&!isWsOrEol(e.input.charCodeAt(e.position))&&!isFlowIndicator(e.input.charCodeAt(e.position)))e.position++;if(e.position===A)throwError(e,"name of an alias node must contain at least one character");addAliasEvent(e,A,e.position);return true}function readFlowScalarBreak(e,t){skipSeparationSpace(e,false);if(e.lineIndent0){e.position++;if(fromHexCode(e.input.charCodeAt(e.position))<0)throwError(e,"expected hexadecimal character")}e.position++}}else if(isEol(s)){n=false;readFlowScalarBreak(e,t)}else if(e.position===e.lineStart&&testDocumentSeparator(e))throwError(e,"unexpected end of the document within a double quoted scalar");else if(s!==9&&s<32)throwError(e,"expected valid JSON character");else e.position++}throwError(e,"unexpected end of the stream within a double quoted scalar")}function readBlockScalar(e,t,A){const r=e.input.charCodeAt(e.position);let n=1;let s=-1;let i=false;if(r!==124&&r!==62)return false;const o=r===124?4:5;e.position++;while(e.input.charCodeAt(e.position)!==0){const A=e.input.charCodeAt(e.position);const r=fromDecimalCode(A);if(A===43||A===45){if(n!==1)throwError(e,"repeat of a chomping mode identifier");n=A===43?3:2;e.position++}else if(r>=0){if(r===0)throwError(e,"bad explicit indentation width of a block scalar; it cannot be less than one");if(i)throwError(e,"repeat of an indentation width identifier");s=t+r-1;i=true;e.position++}else break}let a=false;while(isWhiteSpace(e.input.charCodeAt(e.position))){a=true;e.position++}if(a&&e.input.charCodeAt(e.position)===35)skipUntilLineEnd(e);if(isEol(e.input.charCodeAt(e.position)))consumeLineBreak(e);else if(e.input.charCodeAt(e.position)!==0)throwError(e,"a line break is expected");let c=i?s:-1;let l=0;const u=e.position;let g=e.position;while(e.input.charCodeAt(e.position)!==0){const A=e.position;let r=0;while(e.input.charCodeAt(A+r)===32)r++;const n=e.input.charCodeAt(A+r);if(n===0){if(c>=0){if(r>c)g=A+r}else if(r>0)g=A+r;break}if(A===e.lineStart&&testDocumentSeparator(e,A))break;if(!i&&c===-1&&isEol(n))l=Math.max(l,r);if(!i&&c===-1&&!isEol(n)){if(n===9&&r=t){a=true;i=e.input.charCodeAt(e.position);continue}e.position=A;e.line=r;e.lineStart=n;e.lineIndent=s;break}if(!isWhiteSpace(i))s=e.position+1;i=e.input.charCodeAt(++e.position)}if(s===n)return false;checkPrintable(e,n,s);addScalarEvent(e,n,s,r.anchorStart,r.anchorEnd,r.tagStart,r.tagEnd,1,1,-1,!a);return true}function skipFlowSeparationSpace(e,t){const A=e.line;skipSeparationSpace(e,true);if(e.line>A&&e.lineIndent0;if(e.firstTabInLine!==-1&&e.input.charCodeAt(e.position)===45&&isWsOrEolOrEnd(e.input.charCodeAt(e.position+1)))throwError(e,"bad indentation of a sequence entry");if(r&&e.lineIndent<=t)addEmptyScalarEvent(e);else parseNode(e,t,Vn,false,true);skipSeparationSpace(e,true);if(e.lineIndent=e.length)break;if(e.lineIndent>t)throwError(e,"bad indentation of a sequence entry");if(e.line===A&&e.input.charCodeAt(e.position)===45&&isWsOrEolOrEnd(e.input.charCodeAt(e.position+1)))throwError(e,"bad indentation of a sequence entry")}addPopEvent(e);return true}function readBlockMapping(e,t,A,r){let n=false;let s=false;let i=false;let o=false;if(e.firstTabInLine!==-1)return false;let a=e.input.charCodeAt(e.position);while(a!==0){if(!n&&e.firstTabInLine!==-1){e.position=e.firstTabInLine;throwError(e,"tab characters must not be used in indentation")}const c=e.input.charCodeAt(e.position+1);const l=e.line;if((a===63||a===58)&&isWsOrEolOrEnd(c)){if(!i){addMappingEvent(e,e.position,r.anchorStart,r.anchorEnd,r.tagStart,r.tagEnd,1);i=true}if(a===63){if(n)addEmptyScalarEvent(e);s=true;n=true}else if(n)n=false;else{addEmptyScalarEvent(e);s=true;n=false}e.position+=1;o=true}else{if(n){addEmptyScalarEvent(e);n=false}const t=snapshotState(e);if(!parseNode(e,A,Jn,false,true))break;if(e.line===l){a=e.input.charCodeAt(e.position);while(isWhiteSpace(a))a=e.input.charCodeAt(++e.position);if(a===58){a=e.input.charCodeAt(++e.position);if(!isWsOrEolOrEnd(a))throwError(e,"a whitespace character is expected after the key-value separator within a block mapping");if(!i){restoreState(e,t);addMappingEvent(e,t.position,r.anchorStart,r.anchorEnd,r.tagStart,r.tagEnd,1);i=true;parseNode(e,A,Jn,false,true);a=e.input.charCodeAt(e.position);while(isWhiteSpace(a))a=e.input.charCodeAt(++e.position);e.position++}s=true;n=false;o=false}else if(s)throwError(e,"expected ':' after a mapping key");else{if(r.anchorStart!==Yn||r.tagStart!==Yn){restoreState(e,t);return false}return true}}else if(s)throwError(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else{if(r.anchorStart!==Yn||r.tagStart!==Yn){restoreState(e,t);return false}return true}}if(parseNode(e,t,Pn,true,o))o=false;if(!n){if(o){addEmptyScalarEvent(e);o=false}}skipSeparationSpace(e,true);a=e.input.charCodeAt(e.position);if((e.line===l||e.lineIndent>t)&&a!==0)throwError(e,"bad indentation of a mapping entry");else if(e.lineIndent=e.maxDepth)throwError(e,`nesting exceeded maxDepth (${e.maxDepth})`);e.depth++;let i=1;let o=false;let a=false;let c=null;const l=emptyProperties();let u=A===Pn||A===Vn;let g=u;const h=u;if(r&&skipSeparationSpace(e,true)){o=true;if(e.lineIndent>t)i=1;else if(e.lineIndent===t)i=0;else i=-1}if(e.position===e.lineStart&&testDocumentSeparator(e)){e.depth--;return false}if(i===1)while(true){const r=e.input.charCodeAt(e.position);const n=snapshotState(e);if(o&&i!==1&&(r===33||r===38))break;if(o&&h&&(l.tagStart!==Yn||l.anchorStart!==Yn)&&(r===33||r===38)){const A=snapshotState(e);const r=t+1;if(readBlockMapping(e,e.position-e.lineStart,r,l)&&e.events[A.eventsLength]?.type===3){e.depth--;return true}restoreState(e,A)}if(o&&(r===33&&l.tagStart!==Yn||r===38&&l.anchorStart!==Yn))break;if(!readTagProperty(e,l,A===On)&&!readAnchorProperty(e,l))break;if(c===null)c=n;if(skipSeparationSpace(e,true)){o=true;g=h;if(e.lineIndent>t)i=1;else if(e.lineIndent===t)i=0;else i=-1}else g=false}if(g)g=o||n;if(i===1||A===Pn){const r=A===On||A===Jn?t:t+1;const n=e.position-e.lineStart;if(i===1)if(g&&(readBlockSequence(e,n,l)||readBlockMapping(e,n,r,l))||readFlowCollection(e,r,l))a=true;else{const t=e.input.charCodeAt(e.position);if(c!==null&&s&&h&&!g&&t!==124&&t!==62){const t=snapshotState(e);const A=c.position-c.lineStart;restoreState(e,c);if(readBlockMapping(e,A,r,emptyProperties())&&e.events[t.eventsLength]?.type===3)a=true;else restoreState(e,t)}if(!a&&(u&&readBlockScalar(e,r,l)||readSingleQuotedScalar(e,r,l)||readDoubleQuotedScalar(e,r,l)||readAlias(e,l)||readPlainScalar(e,r,A,l)))a=true}else if(i===0)a=g&&readBlockSequence(e,n,l)}u=u&&!a;if(!a&&(l.anchorStart!==Yn||l.tagStart!==Yn||u)){addScalarEvent(e,Yn,Yn,l.anchorStart,l.anchorEnd,l.tagStart,l.tagEnd,1);a=true}e.depth--;return a||l.anchorStart!==Yn||l.tagStart!==Yn}function readDirective(e){if(e.lineIndent>0||e.input.charCodeAt(e.position)!==37)return false;e.position++;const t=e.position;while(e.input.charCodeAt(e.position)!==0&&!isWsOrEol(e.input.charCodeAt(e.position)))e.position++;const A=e.input.slice(t,e.position);const r=[];if(A.length===0)throwError(e,"directive name must not be less than one character in length");while(e.input.charCodeAt(e.position)!==0&&!isEol(e.input.charCodeAt(e.position))){while(isWhiteSpace(e.input.charCodeAt(e.position)))e.position++;if(e.input.charCodeAt(e.position)===35||isEol(e.input.charCodeAt(e.position))||e.input.charCodeAt(e.position)===0)break;const t=e.position;while(e.input.charCodeAt(e.position)!==0&&!isWsOrEol(e.input.charCodeAt(e.position)))e.position++;r.push(e.input.slice(t,e.position))}if(isEol(e.input.charCodeAt(e.position)))consumeLineBreak(e);if(A==="YAML"){if(e.directives.some((e=>e.kind==="yaml")))throwError(e,"duplication of %YAML directive");if(r.length!==1)throwError(e,"YAML directive accepts exactly one argument");const t=/^([0-9]+)\.([0-9]+)$/.exec(r[0]);if(t===null)throwError(e,"ill-formed argument of the YAML directive");if(parseInt(t[1],10)!==1)throwError(e,"unacceptable YAML version of the document");e.directives.push({kind:"yaml",version:r[0]})}else if(A==="TAG"){if(r.length!==2)throwError(e,"TAG directive accepts exactly two arguments");const[t,A]=r;if(!qn.test(t))throwError(e,"ill-formed tag handle (first argument) of the TAG directive");if(Gn.call(e.tagHandlers,t))throwError(e,`there is a previously declared suffix for "${t}" tag handle`);if(!Kn.test(A))throwError(e,"ill-formed tag prefix (second argument) of the TAG directive");e.tagHandlers[t]=A;e.directives.push({kind:"tag",handle:t,prefix:A})}return true}function readDocument(e){e.directives=[];e.tagHandlers=Object.create(null);let t=false;skipSeparationSpace(e,true);while(readDirective(e)){t=true;skipSeparationSpace(e,true)}let A=false;let r=false;let n=true;if(e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45&&isWsOrEolOrEnd(e.input.charCodeAt(e.position+3))){A=true;const t=e.line;e.position+=3;skipSeparationSpace(e,true);n=e.line>t}else if(t)throwError(e,"directives end mark is expected");const s=e.events.length;if(!A&&e.position===e.lineStart&&e.input.charCodeAt(e.position)===46&&testDocumentSeparator(e)){e.position+=3;skipSeparationSpace(e,true);return}addDocumentEvent(e,A,false);if(!parseNode(e,e.lineIndent-1,Pn,false,n,n))addEmptyScalarEvent(e);skipSeparationSpace(e,true);if(e.position===e.lineStart&&testDocumentSeparator(e)){r=e.input.charCodeAt(e.position)===46;if(r){const t=e.line;e.position+=3;skipSeparationSpace(e,true);if(e.line===t&&e.position=r.length)break;const e=r.position;readDocument(r);if(r.position===e)throwError(r,"can not read a document")}return r.events}var es={...Xn,...Hn};function loadDocuments(e,t={}){const A={...es,...t};const r=String(e);const n=Object.keys(Xn);const s=Object.keys(Hn);return constructFromEvents(parseEvents(r,pick(A,n)),{...pick(A,s),source:r})}function loadAll(e,t,A){let r=null;if(typeof t==="function")r=t;else if(t!==null&&typeof t==="object")A=t;const n=loadDocuments(e,A);if(r===null)return n;for(const e of n)r(e)}function load(e,t){const A=loadDocuments(e,t);if(A.length===0)throw new dn("expected a document, but the input is empty");if(A.length===1)return A[0];throw new dn("expected a single document in the stream, but found more")}var ts=class{tagged=false;flow=false;singleQuoted=false;doubleQuoted=false;literal=false;folded=false};var As=Symbol("INVALID");function buildRepresentTypes(e){const t=new Set([e.defaultScalarTag,e.defaultSequenceTag,e.defaultMappingTag].filter((e=>e!==void 0)));const A=e.implicitScalarTags;const r=e.tags.filter((e=>!(e.nodeKind==="scalar"&&e.implicit)&&!t.has(e)));const n=e.tags.filter((e=>t.has(e)));return[...A.map((e=>({tag:e,implicitTag:true}))),...r.map((e=>({tag:e,implicitTag:false}))),...n.map((e=>({tag:e,implicitTag:true})))]}function matchTag(e,t){for(let A=0,r=e.representTypes.length;A=32&&e<=126||e>=161&&e<=55295&&e!==8232&&e!==8233||e>=57344&&e<=65533&&e!==ss||e>=65536&&e<=1114111}function isNsCharOrWhitespace(e){return isPrintable(e)&&e!==ss&&e!==cs&&e!==as}function isPlainSafe(e,t,A){const r=isNsCharOrWhitespace(e);const n=r&&!isWhitespace(e);return(A?r:r&&e!==Qs&&e!==Fs&&e!==bs&&e!==Ss&&e!==Ns)&&e!==hs&&!(t===ps&&!n)||isNsCharOrWhitespace(t)&&!isWhitespace(t)&&e===hs||t===ps&&n&&(A||e!==Qs&&e!==Fs&&e!==bs&&e!==Ss&&e!==Ns)}function isPlainSafeFirst(e){return isPrintable(e)&&e!==ss&&!isWhitespace(e)&&e!==Is&&e!==ys&&e!==ps&&e!==Qs&&e!==Fs&&e!==bs&&e!==Ss&&e!==Ns&&e!==hs&&e!==ds&&e!==Bs&&e!==us&&e!==Rs&&e!==Ds&&e!==ms&&e!==Cs&&e!==gs&&e!==Es&&e!==ws&&e!==ks}function isPlainSafeAtStart(e,t){const A=codePointAt(e,0);if(isPlainSafeFirst(A))return true;if(e.length>1&&(A===Is||A===ys||A===ps)){const r=codePointAt(e,1);return!isWhitespace(r)&&isPlainSafe(r,A,t)}return false}function isPlainSafeLast(e){return!isWhitespace(e)&&e!==ps}function codePointAt(e,t){const A=e.charCodeAt(t);let r;if(A>=55296&&A<=56319&&t+1=56320&&r<=57343)return(A-55296)*1024+r-56320+65536}return A}function needIndentIndicator(e){return/^\n* /.test(e)}var Us=1;var Ts=2;var Ls=3;var xs=4;var Hs=5;function chooseScalarStyle(e,t,A,r,n,s){const{blockIndent:i,lineWidth:o}=A;let a;let c=0;let l=-1;let u=false;let g=false;const h=o!==-1;let f=-1;let E=!startsWithDocumentSeparator(t)&&isPlainSafeAtStart(t,s)&&isPlainSafeLast(codePointAt(t,t.length-1));if(r||n)for(a=0;a=65536?a+=2:a++){c=codePointAt(t,a);if(!isPrintable(c))return Hs;E=E&&isPlainSafe(c,l,s);l=c}else{for(a=0;a=65536?a+=2:a++){c=codePointAt(t,a);if(c===as){u=true;if(h){g=g||a-f-1>o&&t[f+1]!==" ";f=a}}else if(!isPrintable(c))return Hs;E=E&&isPlainSafe(c,l,s);l=c}g=g||h&&a-f-1>o&&t[f+1]!==" "}if(!u&&!g){if(E&&!n)return Us;return e.quoteStyle==="double"?Hs:Ts}if(i>9&&needIndentIndicator(t))return Hs;return g?xs:Ls}function renderScalarStyle(e,t,A){const{indent:r,blockIndent:n,lineWidth:s}=A;switch(t){case Us:return encodeFlowBreaks(e,r);case Ts:return`'${encodeFlowBreaks(e,r).replace(/'/g,"''")}'`;case Ls:return"|"+blockHeader(e,n)+dropEndingNewline(indentString(e,r));case xs:return">"+blockHeader(e,n)+dropEndingNewline(indentString(foldBlockScalar(e,s),r));case Hs:return`"${escapeString(e)}"`}}function resolveScalarStyle(e,t,A,r,n){const s=r||!n;if(t.style.singleQuoted)return Ts;if(t.style.doubleQuoted)return Hs;if(!s){if(t.style.literal)return Ls;if(t.style.folded)return xs}const i=t.value;if(i.length===0){if(t.style.tagged||resolveImplicitTag(e,i)===t.tag)return Us;return e.quoteStyle==="double"?Hs:Ts}const o=chooseScalarStyle(e,i,A,s,e.forceQuotes&&!r,n);if(o===Us&&!t.style.tagged&&resolveImplicitTag(e,i)!==t.tag)return e.quoteStyle==="double"?Hs:Ts;return o}function blockHeader(e,t){const A=needIndentIndicator(e)?String(t):"";const r=e[e.length-1]==="\n";return`${A}${r&&(e[e.length-2]==="\n"||e==="\n")?"+":r?"":"-"}\n`}function encodeFlowBreaks(e,t){let A=e.indexOf("\n");if(A===-1)return e;const r=" ".repeat(t);let n=e.slice(0,A);const s=/(\n+)([^\n]*)/g;s.lastIndex=A;let i;while(i=s.exec(e)){const e=i[1].length;const t=i[2];n+="\n".repeat(e+1)+r+t}return n}function dropEndingNewline(e){return e[e.length-1]==="\n"?e.slice(0,-1):e}function foldBlockScalar(e,t){const A=/(\n+)([^\n]*)/g;let r=e.indexOf("\n");if(r===-1)r=e.length;A.lastIndex=r;let n=foldLine(e.slice(0,r),t);let s=e[0]==="\n"||e[0]===" ";let i;let o;while(o=A.exec(e)){const e=o[1];const A=o[2];i=A[0]===" ";n+=e+(!s&&!i&&A!==""?"\n":"")+foldLine(A,t);s=i}return n}function foldLine(e,t){if(e===""||e[0]===" ")return e;const A=/ [^ ]/g;let r;let n=0;let s;let i=0;let o=0;let 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){let t="";let A=0;for(let r=0;r=65536?r+=2:r++){A=codePointAt(e,r);const n=Ms[A];if(n){t+=n;continue}if(isPrintable(A)){t+=e[r];if(A>=65536)t+=e[r+1];continue}t+=encodeNonPrintable(A)}return t}function writeFlowSequence(e,t,A){let r="";for(let n=0,s=A.items.length;n1024;if(o)n+="? ";else if(e.quoteFlowKeys)n+='"';const a=writeNode(e,t,s,{});const c=e.flowSkipColonSpace||a===""?"":" ";n+=`${i}${e.quoteFlowKeys&&!o?'"':""}:${c}${a}`;r+=n}const s=e.flowBracketPadding&&r!==""?" ":"";return`{${s}${r}${s}}`}function sortKeyValue(e){return e.kind==="scalar"?e.value:e}function sortMappingItems(e,t){if(!e.sortKeys)return t;const A=t.slice();if(e.sortKeys===true)A.sort(((e,t)=>{const A=sortKeyValue(e.key);const r=sortKeyValue(t.key);if(Ar)return 1;return 0}));else{const t=e.sortKeys;A.sort(((e,A)=>t(sortKeyValue(e.key),sortKeyValue(A.key))))}return A}function writeBlockMapping(e,t,A,r){let n="";const s=sortMappingItems(e,A.items);for(let A=0,i=s.length;A1024;if(g)if(l&&as===l.charCodeAt(0))i+="?";else i+="? ";i+=l;if(g)i+=generateNextLine(e,t);const h=writeNode(e,t+1,a,{block:true,compact:g,isblockseq:g&&!cannotBeCompact(e,a,t+1)});const f=o.kind==="scalar"&&o.value===""&&l!==""&&l.charCodeAt(l.length-1)!==Cs&&l.charCodeAt(l.length-1)!==gs;const E=!g&&(o.kind==="alias"||f)?" ":"";if(h===""||as===h.charCodeAt(0))i+=`${E}:`;else i+=`${E}: `;i+=h;n+=i}return n}function cannotBeCompact(e,t,A){return t.style.tagged||t.anchor!==void 0||e.indent<2&&A>0}function writeNode(e,t,A,r){if(A.kind==="alias")return`*${A.anchor}`;const{block:n=false,iskey:s=false,isblockseq:i=false}=r;let o=r.compact??false;const a=A.anchor!==void 0;if(cannotBeCompact(e,A,t))o=false;let c;let l=A.style.tagged;const u=n&&(A.kind==="mapping"||A.kind==="sequence")&&!A.style.flow&&A.items.length!==0;if(A.kind==="mapping")if(u)c=writeBlockMapping(e,t,A,o);else c=writeFlowMapping(e,t,A);else if(A.kind==="sequence")if(u)if(e.seqNoIndent&&!i&&t>0)c=writeBlockSequence(e,t-1,A,o);else c=writeBlockSequence(e,t,A,o);else c=writeFlowSequence(e,t,A);else{const r=scalarLayout(e,t);const i=resolveScalarStyle(e,A,r,s,n);c=renderScalarStyle(A.value,i,r);l=A.style.tagged||i!==Us&&A.tag!==e.defaultScalarTagName}if(u&&o&&t>0&&e.indent>2)c=`${" ".repeat(e.indent-2)}${c}`;if(l||a){const t=[];const r=l?nodeTagShort(A):null;const n=a?`&${A.anchor}`:null;if(e.tagBeforeAnchor){if(r!==null)t.push(r);if(n!==null)t.push(n)}else{if(n!==null)t.push(n);if(r!==null)t.push(r)}const s=c===""||c.charCodeAt(0)===as?"":" ";c=`${t.join(" ")}${s}${c}`}return c}function rootStartsOwnLine(e){return(e.kind==="sequence"||e.kind==="mapping")&&!e.style.flow&&e.items.length!==0&&!e.style.tagged&&e.anchor===void 0}function isOpenEnded(e){let t=e;while((t.kind==="sequence"||t.kind==="mapping")&&!t.style.flow&&t.items.length!==0)t=t.kind==="sequence"?t.items[t.items.length-1]:t.items[t.items.length-1].value;if(t.kind!=="scalar"||!(t.style.literal||t.style.folded))return false;const{value:A}=t;return A.endsWith("\n\n")||A==="\n"}function writeDocumentDirectives(e){let t="";for(const A of e.directives){if(A.kind==="yaml"){t+=`%YAML ${A.version}\n`;continue}const{handle:e,prefix:r}=A;t+=`%TAG ${e} ${r}\n`}return t}function present(e,t){const A=createPresenterState(t);let r="";let n=false;for(let t=0;t0&&!n;r+=i;if(s.contents===null){if(a)r+="---\n"}else if(a){const e=writeNode(A,0,s.contents,{block:true,compact:true});const t=e===""?"":o||rootStartsOwnLine(s.contents)?"\n":" ";r+=`---${t}${e}\n`}else r+=writeNode(A,0,s.contents,{block:true,compact:true})+"\n";n=s.explicitEnd||s.contents!==null&&isOpenEnded(s.contents);if(n)r+="...\n"}return r}var Ys=gn.withTags({...Gr,resolve:(e,t,A)=>{const r=Gr.resolve(e,t,A);return r===dr?Tr.resolve(e,t,A):r}},{...$r,resolve:(e,t,A)=>{const r=$r.resolve(e,t,A);return r===dr?Vr.resolve(e,t,A):r}});var Gs={...vs,schema:Ys,skipInvalid:false,noRefs:false,flowLevel:-1,transform:()=>{}};function dump(e,t={}){const A={...Gs,...t};const r=jsToAst(e,A.schema,{noRefs:A.noRefs,skipInvalid:A.skipInvalid});if(A.flowLevel>=0)visit(r,((e,t)=>{if(t.depth{let t;for(let A=0;A<=Vs;A++){try{return await e()}catch(e){t=e;if(A===Vs){break}core_debug(`Attempt ${A+1} failed, retrying in ${Ps}: ${t.message}`);await new Promise((e=>setTimeout(e,Ps)))}}throw t};const Ws=/^v\d+\.\d+\.\d+-[0-9a-f]+-nightly$/i;const isNightlyTag=e=>Ws.test(e);const latestNightlyRelease=e=>e.filter((e=>Ws.test(e.tag_name))).sort(((e,t)=>(t.published_at||"").localeCompare(e.published_at||""))).shift();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(Js.valid(A)){let r=t.startsWith("v")?t:`v${t}`;if(isPro(e)&&Js.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=latestNightlyRelease(A);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(!Js.valid(n)&&!Js.validRange(n)){return t}const s=Js.maxSatisfying(r,n);if(Js.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 _s=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 qs={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 _s(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=qs.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 qs.readLinuxVersionFile()}const js=e(import.meta.url)("stream");var $s=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 $s(this,void 0,void 0,(function*(){let A=1;while(AsetTimeout(t,e*1e3)))}))}}var zs=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 Zs=process.platform==="win32";const Ks=process.platform==="darwin";const Xs="actions/tool-cache";function downloadTool(e,t,A,r){return zs(this,void 0,void 0,(function*(){t=t||s.join(_getTempDirectory(),cA.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((()=>zs(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 zs(this,void 0,void 0,(function*(){if(n.existsSync(t)){throw new Error(`Destination file path ${t} already exists`)}const s=new lib_HttpClient(Xs,[],{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=K.promisify(js.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 zs(this,void 0,void 0,(function*(){ok(Zs,"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 zs(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(Zs&&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 zs(this,arguments,void 0,(function*(e,t,A=[]){ok(Ks,"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 zs(this,void 0,void 0,(function*(){if(!e){throw new Error("parameter 'file' is required")}t=yield _createExtractFolder(t);if(Zs){yield extractZipWin(e,t)}else{yield extractZipNix(e,t)}return t}))}function extractZipWin(e,t){return zs(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 zs(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 zs(this,void 0,void 0,(function*(){A=Js.clean(A)||A;r=r||oA.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 zs(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 zs(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 zs(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 zs(this,void 0,void 0,(function*(){if(!e){e=s.join(_getTempDirectory(),cA.randomUUID())}yield mkdirP(e);return e}))}function _createToolPath(e,t,A){return zs(this,void 0,void 0,(function*(){const r=s.join(_getCacheDirectory(),e,Js.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,Js.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(fr=="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,fr=="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=cA.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(Er){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=Er;break}}if(fr=="darwin"){t="all"}const A=fr=="win32"?"Windows":fr=="darwin"?"Darwin":"Linux";const r=fr=="win32"?"zip":"tar.gz";const n=distribSuffix(e);return`goreleaser${n}_${A}_${t}.${r}`};async function getDistPath(e){const t=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=iA(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 +/*! js-yaml 5.2.3 https://github.com/nodeca/js-yaml @license MIT */ +var dr=Symbol("NOT_RESOLVED");var Cr=Symbol("MERGE_KEY");function defineScalarTag(e,t){return{tagName:e,nodeKind:"scalar",implicit:t.implicit??false,matchByTagPrefix:t.matchByTagPrefix??false,implicitFirstChars:t.implicitFirstChars??null,resolve:t.resolve,identify:t.identify??null,represent:t.represent??(e=>String(e)),representTagName:t.representTagName??null}}function defineSequenceTag(e,t){const A=t.finalize===void 0;return{tagName:e,nodeKind:"sequence",implicit:false,matchByTagPrefix:t.matchByTagPrefix??false,create:t.create,addItem:t.addItem,finalize:t.finalize??(e=>e),carrierIsResult:A,identify:t.identify??null,represent:t.represent??(e=>e),representTagName:t.representTagName??null}}function defineMappingTag(e,t){const A=t.finalize===void 0;return{tagName:e,nodeKind:"mapping",implicit:false,matchByTagPrefix:t.matchByTagPrefix??false,create:t.create,addPair:t.addPair,has:t.has,keys:t.keys,get:t.get,finalize:t.finalize??(e=>e),carrierIsResult:A,identify:t.identify??null,represent:t.represent??(e=>e),representTagName:t.representTagName??null}}var Br=defineScalarTag("tag:yaml.org,2002:str",{resolve:e=>e,identify:e=>typeof e==="string"});var Qr=["","~","null","Null","NULL"];var Ir=defineScalarTag("tag:yaml.org,2002:null",{implicit:true,implicitFirstChars:["","~","n","N"],resolve:e=>{if(Qr.indexOf(e)!==-1)return null;return dr},identify:e=>e===null,represent:()=>"null"});var pr=defineScalarTag("tag:yaml.org,2002:null",{implicit:true,implicitFirstChars:["n"],resolve:(e,t)=>{if(e==="null"||t&&e==="")return null;return dr},identify:e=>e===null,represent:()=>"null"});var Dr=["","~","null","Null","NULL"];var mr=defineScalarTag("tag:yaml.org,2002:null",{implicit:true,implicitFirstChars:["","~","n","N"],resolve:e=>{if(Dr.indexOf(e)!==-1)return null;return dr},identify:e=>e===null,represent:()=>"null"});var yr=["true","True","TRUE"];var wr=["false","False","FALSE"];var Fr=defineScalarTag("tag:yaml.org,2002:bool",{implicit:true,implicitFirstChars:["t","T","f","F"],resolve:e=>{if(yr.indexOf(e)!==-1)return true;if(wr.indexOf(e)!==-1)return false;return dr},identify:e=>Object.prototype.toString.call(e)==="[object Boolean]",represent:e=>e?"true":"false"});var br=["true"];var kr=["false"];var Sr=defineScalarTag("tag:yaml.org,2002:bool",{implicit:true,implicitFirstChars:["t","f"],resolve:e=>{if(br.indexOf(e)!==-1)return true;if(kr.indexOf(e)!==-1)return false;return dr},identify:e=>Object.prototype.toString.call(e)==="[object Boolean]",represent:e=>e?"true":"false"});var Rr=["true","True","TRUE","y","Y","yes","Yes","YES","on","On","ON"];var Nr=["false","False","FALSE","n","N","no","No","NO","off","Off","OFF"];var Mr=defineScalarTag("tag:yaml.org,2002:bool",{implicit:true,implicitFirstChars:["y","Y","n","N","t","T","f","F","o","O"],resolve:e=>{if(Rr.indexOf(e)!==-1)return true;if(Nr.indexOf(e)!==-1)return false;return dr},identify:e=>Object.prototype.toString.call(e)==="[object Boolean]",represent:e=>e?"true":"false"});var vr=new RegExp("^(?:0o[0-7]+|0x[0-9a-fA-F]+|[-+]?[0-9]+)$");var Ur=new RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");function parseYamlInteger$2(e){let t=e;let A=1;if(t[0]==="-"||t[0]==="+"){if(t[0]==="-")A=-1;t=t.slice(1)}if(t.startsWith("0b"))return A*parseInt(t.slice(2),2);if(t.startsWith("0o"))return A*parseInt(t.slice(2),8);if(t.startsWith("0x"))return A*parseInt(t.slice(2),16);return A*parseInt(t,10)}function resolveYamlInteger$2(e,t){if(t){if(!Ur.test(e))return dr}else if(!vr.test(e))return dr;const A=parseYamlInteger$2(e);return Number.isFinite(A)?A:dr}var Tr=defineScalarTag("tag:yaml.org,2002:int",{implicit:true,implicitFirstChars:["-","+",..."0123456789"],resolve:resolveYamlInteger$2,identify:e=>Number.isInteger(e)&&!Object.is(e,-0)&&e.toString(10).indexOf("e")<0,represent:e=>e.toString(10)});var Lr=new RegExp("^-?(?:0|[1-9][0-9]*)$");var xr=new RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");function parseYamlInteger$1(e){let t=e;let A=1;if(t[0]==="-"||t[0]==="+"){if(t[0]==="-")A=-1;t=t.slice(1)}if(t.startsWith("0b"))return A*parseInt(t.slice(2),2);if(t.startsWith("0o"))return A*parseInt(t.slice(2),8);if(t.startsWith("0x"))return A*parseInt(t.slice(2),16);return A*parseInt(t,10)}function resolveYamlInteger$1(e,t){if(t){if(!xr.test(e))return dr}else if(!Lr.test(e))return dr;const A=parseYamlInteger$1(e);return Number.isFinite(A)?A:dr}var Hr=defineScalarTag("tag:yaml.org,2002:int",{implicit:true,implicitFirstChars:["-",..."0123456789"],resolve:resolveYamlInteger$1,identify:e=>Number.isInteger(e)&&!Object.is(e,-0)&&e.toString(10).indexOf("e")<0,represent:e=>e.toString(10)});var Yr=new RegExp("^(?:[-+]?0b[0-1_]+|[-+]?0[0-7_]+|[-+]?0x[0-9a-fA-F_]+|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+|[-+]?(?:0|[1-9][0-9_]*))$");function parseYamlInteger(e){let t=e.replace(/_/g,"");let A=1;if(t[0]==="-"||t[0]==="+"){if(t[0]==="-")A=-1;t=t.slice(1)}if(t.startsWith("0b"))return A*parseInt(t.slice(2),2);if(t.startsWith("0x"))return A*parseInt(t.slice(2),16);if(t.includes(":")){let e=0;for(const A of t.split(":"))e=e*60+Number(A);return A*e}if(t!=="0"&&t[0]==="0")return A*parseInt(t,8);return A*parseInt(t,10)}function resolveYamlInteger(e){if(!Yr.test(e))return dr;const t=parseYamlInteger(e);return Number.isFinite(t)?t:dr}var Gr=defineScalarTag("tag:yaml.org,2002:int",{implicit:true,implicitFirstChars:["-","+",..."0123456789"],resolve:resolveYamlInteger,identify:e=>Number.isInteger(e)&&!Object.is(e,-0)&&e.toString(10).indexOf("e")<0,represent:e=>e.toString(10)});var Or=new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");var Jr=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function resolveYamlFloat$2(e){if(!Or.test(e))return dr;let t=e.toLowerCase();const A=t[0]==="-"?-1:1;if("+-".includes(t[0]))t=t.slice(1);if(t===".inf")return A===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;if(t===".nan")return NaN;const r=A*parseFloat(t);if(Number.isFinite(r)||Jr.test(e))return r;return dr}function representYamlFloat$2(e){if(isNaN(e))return".nan";if(e===Number.POSITIVE_INFINITY)return".inf";if(e===Number.NEGATIVE_INFINITY)return"-.inf";if(Object.is(e,-0))return"-0.0";const t=e.toString(10);return/^[-+]?[0-9]+e/.test(t)?t.replace("e",".e"):t}var Vr=defineScalarTag("tag:yaml.org,2002:float",{implicit:true,implicitFirstChars:["-","+",".",..."0123456789"],resolve:resolveYamlFloat$2,identify:e=>typeof e==="number"&&(!Number.isInteger(e)||Object.is(e,-0)||e.toString(10).indexOf("e")>=0),represent:representYamlFloat$2});var Pr=new RegExp("^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$");var Wr=new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function resolveYamlFloat$1(e,t){if(t){if(!Wr.test(e))return dr;let t=e.toLowerCase();const A=t[0]==="-"?-1:1;if("+-".includes(t[0]))t=t.slice(1);if(t===".inf")return A===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;if(t===".nan")return NaN;const r=A*parseFloat(t);return Number.isFinite(r)?r:dr}if(!Pr.test(e))return dr;const A=Number(e);if(Number.isFinite(A))return A;return dr}function representYamlFloat$1(e){if(isNaN(e))return".nan";if(e===Number.POSITIVE_INFINITY)return".inf";if(e===Number.NEGATIVE_INFINITY)return"-.inf";if(Object.is(e,-0))return"-0.0";const t=e.toString(10);return/^[-+]?[0-9]+e/.test(t)?t.replace("e",".e"):t}var _r=defineScalarTag("tag:yaml.org,2002:float",{implicit:true,implicitFirstChars:["-",..."0123456789"],resolve:resolveYamlFloat$1,identify:e=>typeof e==="number"&&(!Number.isInteger(e)||Object.is(e,-0)||e.toString(10).indexOf("e")>=0),represent:representYamlFloat$1});var qr=new RegExp("^(?:[-+]?(?:(?:[0-9][0-9_]*)?\\.[0-9_]*)(?:[eE][-+][0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");var jr=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function resolveYamlFloat(e){if(!qr.test(e))return dr;let t=e.toLowerCase().replace(/_/g,"");const A=t[0]==="-"?-1:1;if("+-".includes(t[0]))t=t.slice(1);if(t===".inf")return A===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;if(t===".nan")return NaN;let r=0;if(t.includes(":")){for(const e of t.split(":"))r=r*60+Number(e);r*=A}else r=A*parseFloat(t);if(Number.isFinite(r)||jr.test(e))return r;return dr}function representYamlFloat(e){if(isNaN(e))return".nan";if(e===Number.POSITIVE_INFINITY)return".inf";if(e===Number.NEGATIVE_INFINITY)return"-.inf";if(Object.is(e,-0))return"-0.0";const t=e.toString(10);return/^[-+]?[0-9]+e/.test(t)?t.replace("e",".e"):t}var $r=defineScalarTag("tag:yaml.org,2002:float",{implicit:true,implicitFirstChars:["-","+",".",..."0123456789"],resolve:resolveYamlFloat,identify:e=>typeof e==="number"&&(!Number.isInteger(e)||Object.is(e,-0)||e.toString(10).indexOf("e")>=0),represent:representYamlFloat});var zr=defineScalarTag("tag:yaml.org,2002:merge",{implicit:true,implicitFirstChars:["<"],resolve:(e,t)=>{if(e==="<<"||t&&e==="")return Cr;return dr}});var Zr=/^[A-Za-z0-9+/]*={0,2}$/;function resolveYamlBinary(e){const t=e.replace(/\s/g,"");if(t.length%4!==0||!Zr.test(t))return dr;const A=atob(t);const r=new Uint8Array(A.length);for(let e=0;eObject.prototype.toString.call(e)==="[object Uint8Array]",represent:representYamlBinary});var Xr=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$");var en=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 makeUtcDate(e,t,A,r=0,n=0,s=0,i=0){const o=new Date(Date.UTC(e,t,A,r,n,s,i));o.setUTCFullYear(e,t,A);return o}function resolveYamlTimestamp(e){let t=Xr.exec(e);if(t===null)t=en.exec(e);if(t===null)return dr;const A=+t[1];const r=+t[2]-1;const n=+t[3];if(!t[4]){const e=makeUtcDate(A,r,n);if(e.getUTCFullYear()!==A||e.getUTCMonth()!==r||e.getUTCDate()!==n)return dr;return e}const s=+t[4];const i=+t[5];const o=+t[6];let a=0;if(s>23||i>59||o>59)return dr;if(t[7]){let e=t[7].slice(0,3);while(e.length<3)e+="0";a=+e}const c=makeUtcDate(A,r,n,s,i,o,a);if(c.getUTCFullYear()!==A||c.getUTCMonth()!==r||c.getUTCDate()!==n)return dr;if(t[9]){const e=+t[10];const A=+(t[11]||0);if(e>23||A>59)return dr;const r=(e*60+A)*6e4;c.setTime(c.getTime()-(t[9]==="-"?-r:r))}return c}var tn=defineScalarTag("tag:yaml.org,2002:timestamp",{implicit:true,implicitFirstChars:[..."0123456789"],resolve:resolveYamlTimestamp,identify:e=>e instanceof Date,represent:e=>e.toISOString()});var An=defineSequenceTag("tag:yaml.org,2002:seq",{create:()=>[],addItem:(e,t)=>{e.push(t)},identify:Array.isArray});function isPlainObject(e){if(e===null||typeof e!=="object"||Array.isArray(e))return false;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function pick(e,t){const A={};for(const r of t)if(e[r]!==void 0)A[r]=e[r];return A}var rn=defineSequenceTag("tag:yaml.org,2002:omap",{create:()=>({list:[],seen:new Set}),addItem:(e,t)=>{let A;if(t instanceof Map){if(t.size!==1)return"cannot resolve an ordered map item";A=t.keys().next().value}else if(isPlainObject(t)){const e=Object.keys(t);if(e.length!==1)return"cannot resolve an ordered map item";A=e[0]}else return"cannot resolve an ordered map item";if(e.seen.has(A))return"duplicate key in ordered map";e.seen.add(A);e.list.push(t);return""},finalize:e=>e.list});var nn=defineSequenceTag("tag:yaml.org,2002:pairs",{create:()=>[],addItem:(e,t)=>{if(t instanceof Map){if(t.size!==1)return"cannot resolve a pairs item";e.push(t.entries().next().value);return""}if(Object.prototype.toString.call(t)!=="[object Object]")return"cannot resolve a pairs item";const A=t;const r=Object.keys(A);if(r.length!==1)return"cannot resolve a pairs item";e.push([r[0],A[r[0]]]);return""}});var sn=defineMappingTag("tag:yaml.org,2002:map",{create:()=>({}),identify:isPlainObject,represent:e=>{const t=new Map;for(const A of Object.keys(e))t.set(A,e[A]);return t},addPair:(e,t,A)=>{if(t!==null&&typeof t==="object")return"object-based map does not support complex keys";const r=String(t);if(r==="__proto__")Object.defineProperty(e,r,{value:A,enumerable:true,configurable:true,writable:true});else e[r]=A;return""},has:(e,t)=>{if(t!==null&&typeof t==="object")return false;return Object.prototype.hasOwnProperty.call(e,String(t))},keys:e=>Object.keys(e),get:(e,t)=>{const A=String(t);if(!Object.prototype.hasOwnProperty.call(e,A))return null;return e[A]}});var on=defineMappingTag("tag:yaml.org,2002:set",{create:()=>new Set,identify:e=>e instanceof Set,represent:e=>{const t=new Map;for(const A of e)t.set(A,null);return t},addPair:(e,t,A)=>{if(A!==null)return"cannot resolve a set item";e.add(t);return""},has:(e,t)=>e.has(t),keys:e=>e.keys(),get:()=>null});function createTagDefinitionMap(){return{scalar:Object.create(null),sequence:Object.create(null),mapping:Object.create(null)}}function createTagDefinitionListMap(){return{scalar:[],sequence:[],mapping:[]}}function compileTags(e){const t=[];for(const A of e){let e=t.length;for(let r=0;re.implicitFirstChars===null));const i=new Set;for(const e of A)if(e.implicitFirstChars!==null)for(const t of e.implicitFirstChars)i.add(t);const o=new Map;for(const e of i)o.set(e,A.filter((t=>t.implicitFirstChars===null||t.implicitFirstChars.indexOf(e)!==-1)));const a=r.scalar["tag:yaml.org,2002:str"];if(!a)throw new Error("schema does not define the default scalar tag (tag:yaml.org,2002:str)");this.tags=t;this.implicitScalarTags=A;this.implicitScalarByFirstChar=o;this.implicitScalarAnyFirstChar=s;this.defaultScalarTag=a;this.defaultSequenceTag=r.sequence["tag:yaml.org,2002:seq"];this.defaultMappingTag=r.mapping["tag:yaml.org,2002:map"];this.exact=r;this.prefix=n}withTags(...e){let t=[];for(const A of e)t=t.concat(A);return new Schema([...this.tags,...t])}};var cn=new an([Br,An,sn]);var ln=new an([...cn.tags,pr,Sr,Hr,_r]);var un=new an([...cn.tags,Ir,Fr,Tr,Vr]);var gn=new an([...cn.tags,mr,Mr,Gr,$r,tn,zr,Kr,rn,nn,on]);var hn=defineMappingTag("tag:yaml.org,2002:map",{create:()=>new Map,addPair:(e,t,A)=>{e.set(t,A);return""},has:(e,t)=>e.has(t),keys:e=>e.keys(),get:(e,t)=>e.get(t),identify:e=>e instanceof Map||isPlainObject(e),represent:e=>{if(e instanceof Map)return e;const t=new Map;const A=e;for(const e of Object.keys(A))t.set(e,A[e]);return t}});function normalizeKey(e){if(Array.isArray(e)){const t=Array.prototype.slice.call(e);for(let e=0;e({}),identify:isPlainObject,represent:e=>{const t=new Map;for(const A of Object.keys(e))t.set(A,e[A]);return t},addPair:(e,t,A)=>{const r=normalizeKey(t);if(r===null)return"nested arrays are not supported inside keys";if(r==="__proto__")Object.defineProperty(e,r,{value:A,enumerable:true,configurable:true,writable:true});else e[r]=A;return""},has:(e,t)=>{const A=normalizeKey(t);return A!==null&&Object.prototype.hasOwnProperty.call(e,A)},keys:e=>Object.keys(e),get:(e,t)=>{const A=String(t);if(!Object.prototype.hasOwnProperty.call(e,A))return null;return e[A]}});var En={maxLength:79,indent:1,linesBefore:3,linesAfter:2};function getLine(e,t,A,r,n){let s="";let i="";const o=Math.floor(n/2)-1;if(r-t>o){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" ".repeat(Math.max(t-e.length,0))+e}function makeSnippet(e,t){if(!e.buffer)return null;const A={...En,...t};const r=/\r?\n|\r|\0/g;const n=[0];const s=[];let i;let o=-1;while(i=r.exec(e.buffer)){s.push(i.index);n.push(i.index+i[0].length);if(e.position<=i.index&&o<0)o=n.length-2}if(o<0)o=n.length-1;let a="";const c=Math.min(e.line+A.linesAfter,s.length).toString().length;const l=A.maxLength-(A.indent+c+3);for(let t=1;t<=A.linesBefore;t++){if(o-t<0)break;const r=getLine(e.buffer,n[o-t],s[o-t],e.position-(n[o]-n[o-t]),l);a=`${" ".repeat(A.indent)}${padStart((e.line-t+1).toString(),c)} | ${r.str}\n${a}`}const u=getLine(e.buffer,n[o],s[o],e.position,l);a+=`${" ".repeat(A.indent)}${padStart((e.line+1).toString(),c)} | ${u.str}\n`;a+=`${"-".repeat(A.indent+c+3+u.pos)}^\n`;for(let t=1;t<=A.linesAfter;t++){if(o+t>=s.length)break;const r=getLine(e.buffer,n[o+t],s[o+t],e.position-(n[o]-n[o+t]),l);a+=`${" ".repeat(A.indent)}${padStart((e.line+t+1).toString(),c)} | ${r.str}\n`}return a.replace(/\n$/,"")}function formatError(e,t){let A="";if(!e.mark)return e.reason;if(e.mark.name)A+=`in "${e.mark.name}" `;A+=`(${e.mark.line+1}:${e.mark.column+1})`;if(!t&&e.mark.snippet)A+=`\n\n${e.mark.snippet}`;return`${e.reason} ${A}`}var dn=class extends Error{reason;mark;constructor(e,t){super();this.name="YAMLException";this.reason=e;this.mark=t;this.message=formatError(this,false);if(Error.captureStackTrace)Error.captureStackTrace(this,this.constructor)}toString(e){return`${this.name}: ${formatError(this,e)}`}};function throwErrorAt(e,t,A,r=""){let n=0;let s=0;for(let A=0;A>10)+55296,(e-65536&1023)+56320)}function fromHexCode$1(e){if(e>=48&&e<=57)return e-48;return(e|32)-97+10}function escapedHexLen$1(e){if(e===120)return 2;if(e===117)return 4;return 8}function skipFoldedBreaks(e,t,A){let r=0;while(t0;A--){n++;const t=fromHexCode$1(e.charCodeAt(n));s=(s<<4)+t}r+=charFromCodepoint(s);n++}s=i=n}else if(t===10||t===13){r+=e.slice(s,i);const t=skipFoldedBreaks(e,n,A);r+=foldedBreaks(t.breaks);n=s=i=t.position}else{n++;if(t!==32&&t!==9)i=n}}return r+e.slice(s,A)}function getBlockValue(e,t,A,r,n,s){const i=r<0?0:r;const o=e.slice(t,A).replace(/\r\n?/g,"\n");const a=o===""?[]:(o.endsWith("\n")?o.slice(0,-1):o).split("\n");let c="";let l=false;let u=0;let g=false;for(const e of a){let t=0;while(t=e.length){u++;continue}const A=e.slice(i);const n=A.charCodeAt(0);if(s)if(n===32||n===9){g=true;c+="\n".repeat(l?1+u:u)}else if(g){g=false;c+="\n".repeat(u+1)}else if(u===0){if(l)c+=" "}else c+="\n".repeat(u);else c+="\n".repeat(l?1+u:u);c+=A;l=true;u=0}if(n===3)c+="\n".repeat(l?1+u:u);else if(n!==2){if(l)c+="\n"}return c}function getScalarValue(e,t){if(t.valueStart===vn)return"";const{valueStart:A,valueEnd:r}=t;if(t.fast)return e.slice(A,r);switch(t.style){case 2:return getSingleQuotedValue(e,A,r);case 3:return getDoubleQuotedValue(e,A,r);case 4:return getBlockValue(e,A,r,t.indent,t.chomping,false);case 5:return getBlockValue(e,A,r,t.indent,t.chomping,true);default:return getPlainValue(e,A,r)}}var Ln=Object.assign(Object.create(null),{"!":"!","!!":"tag:yaml.org,2002:"});function tagPercentEncode(e){return encodeURI(e).replace(/!/g,"%21")}function tagNameFull(e,t){if(e.startsWith("!<")&&e.endsWith(">"))return decodeURIComponent(e.slice(2,-1));const A=e.indexOf("!",1);const r=A===-1?"!":e.slice(0,A+1);const n=t?.[r]??Ln[r]??r;return decodeURIComponent(n)+decodeURIComponent(e.slice(r.length))}function tagNameShort(e){let t=e;if(t.charCodeAt(0)===33){t=t.slice(1);return`!${tagPercentEncode(t)}`}if(t.slice(0,18)==="tag:yaml.org,2002:")return`!!${tagPercentEncode(t.slice(18))}`;return`!<${tagPercentEncode(t)}>`}var xn=-1;var Hn={filename:"",schema:un,json:false,maxTotalMergeKeys:1e4,maxAliases:-1};function eventPosition$1(e){if("tagStart"in e&&e.tagStart!==xn)return e.tagStart;if("anchorStart"in e&&e.anchorStart!==xn)return e.anchorStart;if("valueStart"in e&&e.valueStart!==xn)return e.valueStart;if("start"in e)return e.start;return 0}function throwError$1(e,t){throwErrorAt(e.source,e.position,t,e.filename)}function finalizeCollection(e,t,A,r){try{return A.finalize(r)}catch(A){if(A instanceof dn)throw A;throwErrorAt(e.source,t,A instanceof Error?A.message:String(A),e.filename)}}function lookupTag(e,t,A){const r=e[A];if(r)return r;for(const e of t)if(A.startsWith(e.tagName))return e}function findExplicitTag(e,t,A,r,n){const s=lookupTag(t,A,r);if(s)return s;throwError$1(e,`unknown ${n} tag !<${r}>`)}function constructScalar(e,t){const A=getScalarValue(e.source,t);const r=t.tagStart===xn?"":e.source.slice(t.tagStart,t.tagEnd);const n=e.schema.defaultScalarTag;if(r!==""){if(r==="!")return{value:A,tag:n};const t=tagNameFull(r,e.tagHandlers);const s=lookupTag(e.schema.exact.scalar,e.schema.prefix.scalar,t);if(s){const r=s.resolve(A,true,t);if(r===dr)throwError$1(e,`cannot resolve a node with !<${t}> explicit tag`);return{value:r,tag:s}}const i=lookupTag(e.schema.exact.mapping,e.schema.prefix.mapping,t)??lookupTag(e.schema.exact.sequence,e.schema.prefix.sequence,t);if(i){if(A!=="")throwError$1(e,`cannot resolve a node with !<${t}> explicit tag`);const r=i.create(t);return{value:i.carrierIsResult?r:finalizeCollection(e,e.position,i,r),tag:i}}throwError$1(e,`unknown scalar tag !<${t}>`)}if(t.style===1){const t=e.schema.implicitScalarByFirstChar.get(A.charAt(0))??e.schema.implicitScalarAnyFirstChar;for(const e of t){const t=e.resolve(A,false,e.tagName);if(t!==dr)return{value:t,tag:e}}}return{value:n.resolve(A,false,n.tagName),tag:n}}function collectionTag(e,t,A,r,n,s){const i=t.tagStart===xn?"":e.source.slice(t.tagStart,t.tagEnd);const o=i===""||i==="!"?n:tagNameFull(i,e.tagHandlers);return{tagName:o,tag:findExplicitTag(e,A,r,o,s)}}function isMappingTag(e){return e.nodeKind==="mapping"}function mergeKeys(e,t,A,r){for(const n of r.keys(A)){if(e.maxTotalMergeKeys!==-1&&++e.totalMergeKeys>e.maxTotalMergeKeys)throwError$1(e,`merge keys exceeded maxTotalMergeKeys (${e.maxTotalMergeKeys})`);if(t.tag.has(t.value,n))continue;const s=t.tag.addPair(t.value,n,r.get(A,n));if(s)throwError$1(e,s);(t.overridable??=new Set).add(n)}}function mergeSource(e,t,A,r){e.position=t.keyPosition;if(isMappingTag(r))mergeKeys(e,t,A,r);else if(r.nodeKind==="sequence"&&Array.isArray(A))for(const r of A)mergeKeys(e,t,r,t.tag);else throwError$1(e,"cannot merge mappings; the provided source object is unacceptable")}function addMappingValue(e,t,A,r,n){e.position=t.keyPosition;if(A===Cr){mergeSource(e,t,r,n);return}if(!e.json&&t.tag.has(t.value,A)&&!t.overridable?.has(A))throwError$1(e,"duplicated mapping key");const s=t.tag.addPair(t.value,A,r);if(s)throwError$1(e,s);t.overridable?.delete(A)}function addValue(e,t,A){const r=e.frames[e.frames.length-1];if(r.kind==="document"){r.value=t;r.hasValue=true}else if(r.kind==="sequence"){if(r.merge){if(!isMappingTag(A))throwError$1(e,"cannot merge mappings; the provided source object is unacceptable")}const n=r.tag.addItem(r.value,t,r.index++);if(n)throwError$1(e,n)}else if(r.hasKey){const n=r.key;r.key=void 0;r.hasKey=false;addMappingValue(e,r,n,t,A)}else{r.key=t;r.keyPosition=e.position;r.hasKey=true}}function storeAnchor(e,t,A,r,n){if(t.anchorStart!==xn){const s={value:A,tag:r,isValueFinal:n};e.anchors.set(e.source.slice(t.anchorStart,t.anchorEnd),s);return s}return null}function constructFromEvents(e,t){const A={...Hn,...t,events:e,documents:[],eventIndex:0,position:0,frames:[],anchors:new Map,tagHandlers:Object.create(null),totalMergeKeys:0,aliasCount:0};while(A.eventIndexA.maxAliases)throwError$1(A,`aliases exceeded maxAliases (${A.maxAliases})`);const t=A.source.slice(e.anchorStart,e.anchorEnd);const r=A.anchors.get(t);if(!r)throwError$1(A,`unidentified alias "${t}"`);if(!r.isValueFinal)throwError$1(A,`recursive alias "${t}" is not supported for tag ${r.tag.tagName} because it uses finalize()`);addValue(A,r.value,r.tag);break}case 6:{const e=A.frames.pop();if(e.kind==="mapping"&&e.hasKey){A.position=e.keyPosition;throwError$1(A,"incomplete mapping pair in event stream")}if(e.kind==="document")A.documents.push(e.value);else{const t=e.tag.carrierIsResult?e.value:finalizeCollection(A,e.position,e.tag,e.value);if(e.anchor){e.anchor.value=t;e.anchor.isValueFinal=true}addValue(A,t,e.tag)}break}}}return A.documents}var Yn=-1;var Gn=Object.prototype.hasOwnProperty;var On=1;var Jn=2;var Vn=3;var Pn=4;var Wn=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;var _n=/[,\[\]{}]/;var qn=/^(?:!|!!|![0-9A-Za-z-]+!)$/;var jn=String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$,_.!~*'()\[\]])`;var $n=String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$.~*'()_])`;var zn=new RegExp(`^(?:${jn})*$`);var Zn=new RegExp(`^(?:${$n})+$`);var Kn=new RegExp(`^(?:!(?:${jn})*|${$n}(?:${jn})*)$`);var Xn={filename:"",maxDepth:100};function addDocumentEvent(e,t,A){e.events.push({type:1,explicitStart:t,explicitEnd:A,directives:e.directives})}function addSequenceEvent(e,t,A,r,n,s,i){e.events.push({type:2,start:t,anchorStart:A,anchorEnd:r,tagStart:n,tagEnd:s,style:i})}function addMappingEvent(e,t,A,r,n,s,i){e.events.push({type:3,start:t,anchorStart:A,anchorEnd:r,tagStart:n,tagEnd:s,style:i})}function insertFlowPairMappingEvent(e,t){e.events.splice(t.eventsLength,0,{type:3,start:t.position,anchorStart:Yn,anchorEnd:Yn,tagStart:Yn,tagEnd:Yn,style:2})}function addScalarEvent(e,t,A,r,n,s,i,o,a=1,c=-1,l=false){e.events.push({type:4,valueStart:t,valueEnd:A,anchorStart:r,anchorEnd:n,tagStart:s,tagEnd:i,style:o,chomping:a,indent:c,fast:l})}function addAliasEvent(e,t,A){e.events.push({type:5,anchorStart:t,anchorEnd:A})}function addPopEvent(e){e.events.push({type:6})}function addEmptyScalarEvent(e){addScalarEvent(e,Yn,Yn,Yn,Yn,Yn,Yn,1)}function emptyProperties(){return{anchorStart:Yn,anchorEnd:Yn,tagStart:Yn,tagEnd:Yn}}function snapshotState(e){return{position:e.position,line:e.line,lineStart:e.lineStart,lineIndent:e.lineIndent,firstTabInLine:e.firstTabInLine,eventsLength:e.events.length}}function restoreState(e,t){e.position=t.position;e.line=t.line;e.lineStart=t.lineStart;e.lineIndent=t.lineIndent;e.firstTabInLine=t.firstTabInLine;e.events.length=t.eventsLength}function throwError(e,t){throwErrorAt(e.input.slice(0,e.length),e.position,t,e.filename)}function isEol(e){return e===10||e===13}function isWhiteSpace(e){return e===9||e===32}function isWsOrEol(e){return isWhiteSpace(e)||isEol(e)}function isWsOrEolOrEnd(e){return e===0||isWsOrEol(e)}function isFlowIndicator(e){return e===44||e===91||e===93||e===123||e===125}function fromDecimalCode(e){return e>=48&&e<=57?e-48:-1}function fromHexCode(e){if(e>=48&&e<=57)return e-48;const t=e|32;if(t>=97&&t<=102)return t-97+10;return-1}function escapedHexLen(e){if(e===120)return 2;if(e===117)return 4;if(e===85)return 8;return 0}function isSimpleEscape(e){return e===48||e===97||e===98||e===116||e===9||e===110||e===118||e===102||e===114||e===101||e===32||e===34||e===47||e===92||e===78||e===95||e===76||e===80}function consumeLineBreak(e){if(e.input.charCodeAt(e.position)===10)e.position++;else{e.position++;if(e.input.charCodeAt(e.position)===10)e.position++}e.line++;e.lineStart=e.position;e.lineIndent=0;e.firstTabInLine=-1}function skipSeparationSpace(e,t){let A=0;let r=e.input.charCodeAt(e.position);let n=e.position===e.lineStart||isWsOrEol(e.input.charCodeAt(e.position-1));while(r!==0){while(isWhiteSpace(r)){n=true;if(r===9&&e.firstTabInLine===-1)e.firstTabInLine=e.position;r=e.input.charCodeAt(++e.position)}if(t&&n&&r===35)do{r=e.input.charCodeAt(++e.position)}while(!isEol(r)&&r!==0);if(!isEol(r))break;consumeLineBreak(e);A++;n=true;r=e.input.charCodeAt(e.position);while(r===32){e.lineIndent++;r=e.input.charCodeAt(++e.position)}}return A}function testDocumentSeparator(e,t=e.position){const A=e.input.charCodeAt(t);if((A===45||A===46)&&A===e.input.charCodeAt(t+1)&&A===e.input.charCodeAt(t+2)){const A=e.input.charCodeAt(t+3);return A===0||isWsOrEol(A)}return false}function skipUntilLineEnd(e){let t=e.input.charCodeAt(e.position);while(t!==0&&!isEol(t))t=e.input.charCodeAt(++e.position)}function checkPrintable(e,t,A){if(Wn.test(e.input.slice(t,A)))throwError(e,"the stream contains non-printable characters")}function readTagProperty(e,t,A){if(e.input.charCodeAt(e.position)!==33)return false;if(t.tagStart!==Yn)throwError(e,"duplication of a tag property");const r=e.position;let n=false;let s=false;let i="!";let o=e.input.charCodeAt(++e.position);if(o===60){n=true;o=e.input.charCodeAt(++e.position)}else if(o===33){s=true;i="!!";o=e.input.charCodeAt(++e.position)}let a=e.position;let c;if(n){while(o!==0&&o!==62)o=e.input.charCodeAt(++e.position);if(o!==62)throwError(e,"unexpected end of the stream within a verbatim tag");c=e.input.slice(a,e.position);e.position++}else{while(o!==0&&!isWsOrEol(o)&&!(A&&isFlowIndicator(o))){if(o===33)if(!s){i=e.input.slice(a-1,e.position+1);if(!qn.test(i))throwError(e,"named tag handle cannot contain such characters");s=true;a=e.position+1}else throwError(e,"tag suffix cannot contain exclamation marks");o=e.input.charCodeAt(++e.position)}c=e.input.slice(a,e.position);if(_n.test(c))throwError(e,"tag suffix cannot contain flow indicator characters")}if(c&&!(n?zn.test(c):Zn.test(c)))throwError(e,`tag name cannot contain such characters: ${c}`);if(!n&&i!=="!"&&i!=="!!"&&!Gn.call(e.tagHandlers,i))throwError(e,`undeclared tag handle "${i}"`);t.tagStart=r;t.tagEnd=e.position;return true}function readAnchorProperty(e,t){if(e.input.charCodeAt(e.position)!==38)return false;if(t.anchorStart!==Yn)throwError(e,"duplication of an anchor property");e.position++;const A=e.position;while(e.input.charCodeAt(e.position)!==0&&!isWsOrEol(e.input.charCodeAt(e.position))&&!isFlowIndicator(e.input.charCodeAt(e.position)))e.position++;if(e.position===A)throwError(e,"name of an anchor node must contain at least one character");t.anchorStart=A;t.anchorEnd=e.position;return true}function readAlias(e,t){if(e.input.charCodeAt(e.position)!==42)return false;if(t.anchorStart!==Yn||t.tagStart!==Yn)throwError(e,"alias node should not have any properties");e.position++;const A=e.position;while(e.input.charCodeAt(e.position)!==0&&!isWsOrEol(e.input.charCodeAt(e.position))&&!isFlowIndicator(e.input.charCodeAt(e.position)))e.position++;if(e.position===A)throwError(e,"name of an alias node must contain at least one character");addAliasEvent(e,A,e.position);return true}function readFlowScalarBreak(e,t){skipSeparationSpace(e,false);if(e.lineIndent0){e.position++;if(fromHexCode(e.input.charCodeAt(e.position))<0)throwError(e,"expected hexadecimal character")}e.position++}}else if(isEol(s)){n=false;readFlowScalarBreak(e,t)}else if(e.position===e.lineStart&&testDocumentSeparator(e))throwError(e,"unexpected end of the document within a double quoted scalar");else if(s!==9&&s<32)throwError(e,"expected valid JSON character");else e.position++}throwError(e,"unexpected end of the stream within a double quoted scalar")}function readBlockScalar(e,t,A){const r=e.input.charCodeAt(e.position);let n=1;let s=-1;let i=false;if(r!==124&&r!==62)return false;const o=r===124?4:5;e.position++;while(e.input.charCodeAt(e.position)!==0){const A=e.input.charCodeAt(e.position);const r=fromDecimalCode(A);if(A===43||A===45){if(n!==1)throwError(e,"repeat of a chomping mode identifier");n=A===43?3:2;e.position++}else if(r>=0){if(r===0)throwError(e,"bad explicit indentation width of a block scalar; it cannot be less than one");if(i)throwError(e,"repeat of an indentation width identifier");s=t+r-1;i=true;e.position++}else break}let a=false;while(isWhiteSpace(e.input.charCodeAt(e.position))){a=true;e.position++}if(a&&e.input.charCodeAt(e.position)===35)skipUntilLineEnd(e);if(isEol(e.input.charCodeAt(e.position)))consumeLineBreak(e);else if(e.input.charCodeAt(e.position)!==0)throwError(e,"a line break is expected");let c=i?s:-1;let l=0;const u=e.position;let g=e.position;while(e.input.charCodeAt(e.position)!==0){const A=e.position;let r=0;while(e.input.charCodeAt(A+r)===32)r++;const n=e.input.charCodeAt(A+r);if(n===0){if(c>=0){if(r>c)g=A+r}else if(r>0)g=A+r;break}if(A===e.lineStart&&testDocumentSeparator(e,A))break;if(!i&&c===-1&&isEol(n))l=Math.max(l,r);if(!i&&c===-1&&!isEol(n)){if(n===9&&r=t){a=true;i=e.input.charCodeAt(e.position);continue}e.position=A;e.line=r;e.lineStart=n;e.lineIndent=s;break}if(!isWhiteSpace(i))s=e.position+1;i=e.input.charCodeAt(++e.position)}if(s===n)return false;checkPrintable(e,n,s);addScalarEvent(e,n,s,r.anchorStart,r.anchorEnd,r.tagStart,r.tagEnd,1,1,-1,!a);return true}function skipFlowSeparationSpace(e,t){const A=e.line;skipSeparationSpace(e,true);if(e.line>A&&e.lineIndent0;if(e.firstTabInLine!==-1&&e.input.charCodeAt(e.position)===45&&isWsOrEolOrEnd(e.input.charCodeAt(e.position+1)))throwError(e,"bad indentation of a sequence entry");if(r&&e.lineIndent<=t)addEmptyScalarEvent(e);else parseNode(e,t,Vn,false,true);skipSeparationSpace(e,true);if(e.lineIndent=e.length)break;if(e.lineIndent>t)throwError(e,"bad indentation of a sequence entry");if(e.line===A&&e.input.charCodeAt(e.position)===45&&isWsOrEolOrEnd(e.input.charCodeAt(e.position+1)))throwError(e,"bad indentation of a sequence entry")}addPopEvent(e);return true}function readBlockMapping(e,t,A,r){let n=false;let s=false;let i=false;let o=false;if(e.firstTabInLine!==-1)return false;let a=e.input.charCodeAt(e.position);while(a!==0){if(!n&&e.firstTabInLine!==-1){e.position=e.firstTabInLine;throwError(e,"tab characters must not be used in indentation")}const c=e.input.charCodeAt(e.position+1);const l=e.line;if((a===63||a===58)&&isWsOrEolOrEnd(c)){if(!i){addMappingEvent(e,e.position,r.anchorStart,r.anchorEnd,r.tagStart,r.tagEnd,1);i=true}if(a===63){if(n)addEmptyScalarEvent(e);s=true;n=true}else if(n)n=false;else{addEmptyScalarEvent(e);s=true;n=false}e.position+=1;o=true}else{if(n){addEmptyScalarEvent(e);n=false}const t=snapshotState(e);if(!parseNode(e,A,Jn,false,true))break;if(e.line===l){a=e.input.charCodeAt(e.position);while(isWhiteSpace(a))a=e.input.charCodeAt(++e.position);if(a===58){a=e.input.charCodeAt(++e.position);if(!isWsOrEolOrEnd(a))throwError(e,"a whitespace character is expected after the key-value separator within a block mapping");if(!i){restoreState(e,t);addMappingEvent(e,t.position,r.anchorStart,r.anchorEnd,r.tagStart,r.tagEnd,1);i=true;parseNode(e,A,Jn,false,true);a=e.input.charCodeAt(e.position);while(isWhiteSpace(a))a=e.input.charCodeAt(++e.position);e.position++}s=true;n=false;o=false}else if(s)throwError(e,"expected ':' after a mapping key");else{if(r.anchorStart!==Yn||r.tagStart!==Yn){restoreState(e,t);return false}return true}}else if(s)throwError(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else{if(r.anchorStart!==Yn||r.tagStart!==Yn){restoreState(e,t);return false}return true}}if(parseNode(e,t,Pn,true,o))o=false;if(!n){if(o){addEmptyScalarEvent(e);o=false}}skipSeparationSpace(e,true);a=e.input.charCodeAt(e.position);if((e.line===l||e.lineIndent>t)&&a!==0)throwError(e,"bad indentation of a mapping entry");else if(e.lineIndent=e.maxDepth)throwError(e,`nesting exceeded maxDepth (${e.maxDepth})`);e.depth++;let i=1;let o=false;let a=false;let c=null;const l=emptyProperties();let u=A===Pn||A===Vn;let g=u;const h=u;if(r&&skipSeparationSpace(e,true)){o=true;if(e.lineIndent>t)i=1;else if(e.lineIndent===t)i=0;else i=-1}if(i===1)while(true){const r=e.input.charCodeAt(e.position);const n=snapshotState(e);if(o&&i!==1&&(r===33||r===38))break;if(o&&h&&(l.tagStart!==Yn||l.anchorStart!==Yn)&&(r===33||r===38)){const A=snapshotState(e);const r=t+1;if(readBlockMapping(e,e.position-e.lineStart,r,l)&&e.events[A.eventsLength]?.type===3){e.depth--;return true}restoreState(e,A)}if(o&&(r===33&&l.tagStart!==Yn||r===38&&l.anchorStart!==Yn))break;if(!readTagProperty(e,l,A===On)&&!readAnchorProperty(e,l))break;if(c===null)c=n;if(skipSeparationSpace(e,true)){o=true;g=h;if(e.lineIndent>t)i=1;else if(e.lineIndent===t)i=0;else i=-1}else g=false}if(g)g=o||n;if(i===1||A===Pn){const r=A===On||A===Jn?t:t+1;const n=e.position-e.lineStart;if(i===1)if(g&&(readBlockSequence(e,n,l)||readBlockMapping(e,n,r,l))||readFlowCollection(e,r,l))a=true;else{const t=e.input.charCodeAt(e.position);if(c!==null&&s&&h&&!g&&t!==124&&t!==62){const t=snapshotState(e);const A=c.position-c.lineStart;restoreState(e,c);if(readBlockMapping(e,A,r,emptyProperties())&&e.events[t.eventsLength]?.type===3)a=true;else restoreState(e,t)}if(!a&&(u&&readBlockScalar(e,r,l)||readSingleQuotedScalar(e,r,l)||readDoubleQuotedScalar(e,r,l)||readAlias(e,l)||readPlainScalar(e,r,A,l)))a=true}else if(i===0)a=g&&readBlockSequence(e,n,l)}u=u&&!a;if(!a&&(l.anchorStart!==Yn||l.tagStart!==Yn||u)){addScalarEvent(e,Yn,Yn,l.anchorStart,l.anchorEnd,l.tagStart,l.tagEnd,1);a=true}e.depth--;return a||l.anchorStart!==Yn||l.tagStart!==Yn}function readDirective(e){if(e.lineIndent>0||e.input.charCodeAt(e.position)!==37)return false;e.position++;const t=e.position;while(e.input.charCodeAt(e.position)!==0&&!isWsOrEol(e.input.charCodeAt(e.position)))e.position++;const A=e.input.slice(t,e.position);const r=[];if(A.length===0)throwError(e,"directive name must not be less than one character in length");while(e.input.charCodeAt(e.position)!==0&&!isEol(e.input.charCodeAt(e.position))){while(isWhiteSpace(e.input.charCodeAt(e.position)))e.position++;if(e.input.charCodeAt(e.position)===35||isEol(e.input.charCodeAt(e.position))||e.input.charCodeAt(e.position)===0)break;const t=e.position;while(e.input.charCodeAt(e.position)!==0&&!isWsOrEol(e.input.charCodeAt(e.position)))e.position++;r.push(e.input.slice(t,e.position))}if(isEol(e.input.charCodeAt(e.position)))consumeLineBreak(e);if(A==="YAML"){if(e.directives.some((e=>e.kind==="yaml")))throwError(e,"duplication of %YAML directive");if(r.length!==1)throwError(e,"YAML directive accepts exactly one argument");const t=/^([0-9]+)\.([0-9]+)$/.exec(r[0]);if(t===null)throwError(e,"ill-formed argument of the YAML directive");if(parseInt(t[1],10)!==1)throwError(e,"unacceptable YAML version of the document");e.directives.push({kind:"yaml",version:r[0]})}else if(A==="TAG"){if(r.length!==2)throwError(e,"TAG directive accepts exactly two arguments");const[t,A]=r;if(!qn.test(t))throwError(e,"ill-formed tag handle (first argument) of the TAG directive");if(Gn.call(e.tagHandlers,t))throwError(e,`there is a previously declared suffix for "${t}" tag handle`);if(!Kn.test(A))throwError(e,"ill-formed tag prefix (second argument) of the TAG directive");e.tagHandlers[t]=A;e.directives.push({kind:"tag",handle:t,prefix:A})}return true}function readDocument(e){e.directives=[];e.tagHandlers=Object.create(null);let t=false;skipSeparationSpace(e,true);while(readDirective(e)){t=true;skipSeparationSpace(e,true)}let A=false;let r=false;let n=true;if(e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45&&isWsOrEolOrEnd(e.input.charCodeAt(e.position+3))){A=true;const t=e.line;e.position+=3;skipSeparationSpace(e,true);n=e.line>t}else if(t)throwError(e,"directives end mark is expected");const s=e.events.length;if(!A&&e.position===e.lineStart&&e.input.charCodeAt(e.position)===46&&testDocumentSeparator(e)){e.position+=3;skipSeparationSpace(e,true);return}addDocumentEvent(e,A,false);if(!parseNode(e,e.lineIndent-1,Pn,false,n,n))addEmptyScalarEvent(e);skipSeparationSpace(e,true);if(e.position===e.lineStart&&testDocumentSeparator(e)){r=e.input.charCodeAt(e.position)===46;if(r){const t=e.line;e.position+=3;skipSeparationSpace(e,true);if(e.line===t&&e.position=r.length)break;const e=r.position;readDocument(r);if(r.position===e)throwError(r,"can not read a document")}return r.events}var es={...Xn,...Hn};function loadDocuments(e,t={}){const A={...es,...t};const r=String(e);const n=Object.keys(Xn);const s=Object.keys(Hn);return constructFromEvents(parseEvents(r,pick(A,n)),{...pick(A,s),source:r})}function loadAll(e,t,A){let r=null;if(typeof t==="function")r=t;else if(t!==null&&typeof t==="object")A=t;const n=loadDocuments(e,A);if(r===null)return n;for(const e of n)r(e)}function load(e,t){const A=loadDocuments(e,t);if(A.length===0)throw new dn("expected a document, but the input is empty");if(A.length===1)return A[0];throw new dn("expected a single document in the stream, but found more")}var ts=class{tagged=false;flow=false;singleQuoted=false;doubleQuoted=false;literal=false;folded=false};var As=Symbol("INVALID");function buildRepresentTypes(e){const t=new Set([e.defaultScalarTag,e.defaultSequenceTag,e.defaultMappingTag].filter((e=>e!==void 0)));const A=e.implicitScalarTags;const r=e.tags.filter((e=>!(e.nodeKind==="scalar"&&e.implicit)&&!t.has(e)));const n=e.tags.filter((e=>t.has(e)));return[...A.map((e=>({tag:e,implicitTag:true}))),...r.map((e=>({tag:e,implicitTag:false}))),...n.map((e=>({tag:e,implicitTag:true})))]}function matchTag(e,t){for(let A=0,r=e.representTypes.length;A=32&&e<=126||e>=161&&e<=55295&&e!==8232&&e!==8233||e>=57344&&e<=65533&&e!==ss||e>=65536&&e<=1114111}function isNsCharOrWhitespace(e){return isPrintable(e)&&e!==ss&&e!==cs&&e!==as}function isPlainSafe(e,t,A){const r=isNsCharOrWhitespace(e);const n=r&&!isWhitespace(e);return(A?r:r&&e!==Qs&&e!==Fs&&e!==bs&&e!==Ss&&e!==Ns)&&e!==hs&&!(t===ps&&!n)||isNsCharOrWhitespace(t)&&!isWhitespace(t)&&e===hs||t===ps&&n&&(A||e!==Qs&&e!==Fs&&e!==bs&&e!==Ss&&e!==Ns)}function isPlainSafeFirst(e){return isPrintable(e)&&e!==ss&&!isWhitespace(e)&&e!==Is&&e!==ys&&e!==ps&&e!==Qs&&e!==Fs&&e!==bs&&e!==Ss&&e!==Ns&&e!==hs&&e!==ds&&e!==Bs&&e!==us&&e!==Rs&&e!==Ds&&e!==ms&&e!==Cs&&e!==gs&&e!==Es&&e!==ws&&e!==ks}function isPlainSafeAtStart(e,t){const A=codePointAt(e,0);if(isPlainSafeFirst(A))return true;if(e.length>1&&(A===Is||A===ys||A===ps)){const r=codePointAt(e,1);return!isWhitespace(r)&&isPlainSafe(r,A,t)}return false}function isPlainSafeLast(e){return!isWhitespace(e)&&e!==ps}function codePointAt(e,t){const A=e.charCodeAt(t);let r;if(A>=55296&&A<=56319&&t+1=56320&&r<=57343)return(A-55296)*1024+r-56320+65536}return A}function needIndentIndicator(e){return/^\n* /.test(e)}var Us=1;var Ts=2;var Ls=3;var xs=4;var Hs=5;function chooseScalarStyle(e,t,A,r,n,s){const{blockIndent:i,lineWidth:o}=A;let a;let c=0;let l=-1;let u=false;let g=false;const h=o!==-1;let f=-1;let E=!startsWithDocumentSeparator(t)&&isPlainSafeAtStart(t,s)&&isPlainSafeLast(codePointAt(t,t.length-1));if(r||n)for(a=0;a=65536?a+=2:a++){c=codePointAt(t,a);if(!isPrintable(c))return Hs;E=E&&isPlainSafe(c,l,s);l=c}else{for(a=0;a=65536?a+=2:a++){c=codePointAt(t,a);if(c===as){u=true;if(h){g=g||a-f-1>o&&!isMoreIndented(t[f+1]);f=a}}else if(!isPrintable(c))return Hs;E=E&&isPlainSafe(c,l,s);l=c}g=g||h&&a-f-1>o&&!isMoreIndented(t[f+1])}if(!u&&!g){if(E&&!n)return Us;return e.quoteStyle==="double"?Hs:Ts}if(i>9&&needIndentIndicator(t))return Hs;return g?xs:Ls}function renderScalarStyle(e,t,A){const{indent:r,blockIndent:n,lineWidth:s}=A;switch(t){case Us:return encodeFlowBreaks(e,r);case Ts:return`'${encodeFlowBreaks(e,r).replace(/'/g,"''")}'`;case Ls:return"|"+blockHeader(e,n)+dropEndingNewline(indentString(e,r));case xs:return">"+blockHeader(e,n)+dropEndingNewline(indentString(foldBlockScalar(e,s),r));case Hs:return`"${escapeString(e)}"`}}function resolveScalarStyle(e,t,A,r,n){const s=r||!n;if(t.style.singleQuoted)return Ts;if(t.style.doubleQuoted)return Hs;if(!s){if(t.style.literal)return Ls;if(t.style.folded)return xs}const i=t.value;if(i.length===0){if(t.style.tagged||resolveImplicitTag(e,i)===t.tag)return Us;return e.quoteStyle==="double"?Hs:Ts}const o=chooseScalarStyle(e,i,A,s,e.forceQuotes&&!r,n);if(o===Us&&!t.style.tagged&&resolveImplicitTag(e,i)!==t.tag)return e.quoteStyle==="double"?Hs:Ts;return o}function blockHeader(e,t){const A=needIndentIndicator(e)?String(t):"";const r=e[e.length-1]==="\n";return`${A}${r&&(e[e.length-2]==="\n"||e==="\n")?"+":r?"":"-"}\n`}function encodeFlowBreaks(e,t){let A=e.indexOf("\n");if(A===-1)return e;const r=" ".repeat(t);let n=e.slice(0,A);const s=/(\n+)([^\n]*)/g;s.lastIndex=A;let i;while(i=s.exec(e)){const e=i[1].length;const t=i[2];n+="\n".repeat(e+1)+r+t}return n}function dropEndingNewline(e){return e[e.length-1]==="\n"?e.slice(0,-1):e}function isMoreIndented(e){return e===" "||e==="\t"}function foldBlockScalar(e,t){const A=/(\n+)([^\n]*)/g;let r=e.indexOf("\n");if(r===-1)r=e.length;A.lastIndex=r;let n=foldLine(e.slice(0,r),t);let s=e[0]==="\n"||isMoreIndented(e[0]);let i;let o;while(o=A.exec(e)){const e=o[1];const A=o[2];i=A!==""&&isMoreIndented(A[0]);n+=e+(!s&&!i&&A!==""?"\n":"")+foldLine(A,t);s=i}return n}function foldLine(e,t){if(e===""||isMoreIndented(e[0]))return e;const A=/ [^ \t]/g;let r;let n=0;let s;let i=0;let o=0;let 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){let t="";let A=0;for(let r=0;r=65536?r+=2:r++){A=codePointAt(e,r);const n=Ms[A];if(n){t+=n;continue}if(isPrintable(A)){t+=e[r];if(A>=65536)t+=e[r+1];continue}t+=encodeNonPrintable(A)}return t}function writeFlowSequence(e,t,A){let r="";for(let n=0,s=A.items.length;n1024;if(o)n+="? ";else if(e.quoteFlowKeys)n+='"';const a=writeNode(e,t,s,{});const c=e.flowSkipColonSpace||a===""?"":" ";n+=`${i}${e.quoteFlowKeys&&!o?'"':""}:${c}${a}`;r+=n}const s=e.flowBracketPadding&&r!==""?" ":"";return`{${s}${r}${s}}`}function sortKeyValue(e){return e.kind==="scalar"?e.value:e}function sortMappingItems(e,t){if(!e.sortKeys)return t;const A=t.slice();if(e.sortKeys===true)A.sort(((e,t)=>{const A=sortKeyValue(e.key);const r=sortKeyValue(t.key);if(Ar)return 1;return 0}));else{const t=e.sortKeys;A.sort(((e,A)=>t(sortKeyValue(e.key),sortKeyValue(A.key))))}return A}function writeBlockMapping(e,t,A,r){let n="";const s=sortMappingItems(e,A.items);for(let A=0,i=s.length;A1024;if(g)if(l&&as===l.charCodeAt(0))i+="?";else i+="? ";i+=l;if(g)i+=generateNextLine(e,t);const h=writeNode(e,t+1,a,{block:true,compact:g,isblockseq:g&&!cannotBeCompact(e,a,t+1)});const f=o.kind==="scalar"&&o.value===""&&l!==""&&l.charCodeAt(l.length-1)!==Cs&&l.charCodeAt(l.length-1)!==gs;const E=!g&&(o.kind==="alias"||f)?" ":"";if(h===""||as===h.charCodeAt(0))i+=`${E}:`;else i+=`${E}: `;i+=h;n+=i}return n}function cannotBeCompact(e,t,A){return t.style.tagged||t.anchor!==void 0||e.indent<2&&A>0}function writeNode(e,t,A,r){if(A.kind==="alias")return`*${A.anchor}`;const{block:n=false,iskey:s=false,isblockseq:i=false}=r;let o=r.compact??false;const a=A.anchor!==void 0;if(cannotBeCompact(e,A,t))o=false;let c;let l=A.style.tagged;const u=n&&(A.kind==="mapping"||A.kind==="sequence")&&!A.style.flow&&A.items.length!==0;if(A.kind==="mapping")if(u)c=writeBlockMapping(e,t,A,o);else c=writeFlowMapping(e,t,A);else if(A.kind==="sequence")if(u)if(e.seqNoIndent&&!i&&t>0)c=writeBlockSequence(e,t-1,A,o);else c=writeBlockSequence(e,t,A,o);else c=writeFlowSequence(e,t,A);else{const r=scalarLayout(e,t);const i=resolveScalarStyle(e,A,r,s,n);c=renderScalarStyle(A.value,i,r);l=A.style.tagged||i!==Us&&A.tag!==e.defaultScalarTagName}if(u&&o&&t>0&&e.indent>2)c=`${" ".repeat(e.indent-2)}${c}`;if(l||a){const t=[];const r=l?nodeTagShort(A):null;const n=a?`&${A.anchor}`:null;if(e.tagBeforeAnchor){if(r!==null)t.push(r);if(n!==null)t.push(n)}else{if(n!==null)t.push(n);if(r!==null)t.push(r)}const s=c===""||c.charCodeAt(0)===as?"":" ";c=`${t.join(" ")}${s}${c}`}return c}function rootStartsOwnLine(e){return(e.kind==="sequence"||e.kind==="mapping")&&!e.style.flow&&e.items.length!==0&&!e.style.tagged&&e.anchor===void 0}function isOpenEnded(e){let t=e;while((t.kind==="sequence"||t.kind==="mapping")&&!t.style.flow&&t.items.length!==0)t=t.kind==="sequence"?t.items[t.items.length-1]:t.items[t.items.length-1].value;if(t.kind!=="scalar"||!(t.style.literal||t.style.folded))return false;const{value:A}=t;return A.endsWith("\n\n")||A==="\n"}function writeDocumentDirectives(e){let t="";for(const A of e.directives){if(A.kind==="yaml"){t+=`%YAML ${A.version}\n`;continue}const{handle:e,prefix:r}=A;t+=`%TAG ${e} ${r}\n`}return t}function present(e,t){const A=createPresenterState(t);let r="";let n=false;for(let t=0;t0&&!n;r+=i;if(s.contents===null){if(a)r+="---\n"}else if(a){const e=writeNode(A,0,s.contents,{block:true,compact:true});const t=e===""?"":o||rootStartsOwnLine(s.contents)?"\n":" ";r+=`---${t}${e}\n`}else r+=writeNode(A,0,s.contents,{block:true,compact:true})+"\n";n=s.explicitEnd||s.contents!==null&&isOpenEnded(s.contents);if(n)r+="...\n"}return r}var Ys=gn.withTags({...Gr,resolve:(e,t,A)=>{const r=Gr.resolve(e,t,A);return r===dr?Tr.resolve(e,t,A):r}},{...$r,resolve:(e,t,A)=>{const r=$r.resolve(e,t,A);return r===dr?Vr.resolve(e,t,A):r}});var Gs={...vs,schema:Ys,skipInvalid:false,noRefs:false,flowLevel:-1,transform:()=>{}};function dump(e,t={}){const A={...Gs,...t};const r=jsToAst(e,A.schema,{noRefs:A.noRefs,skipInvalid:A.skipInvalid});if(A.flowLevel>=0)visit(r,((e,t)=>{if(t.depth{let t;for(let A=0;A<=Vs;A++){try{return await e()}catch(e){t=e;if(A===Vs){break}core_debug(`Attempt ${A+1} failed, retrying in ${Ps}: ${t.message}`);await new Promise((e=>setTimeout(e,Ps)))}}throw t};const Ws=/^v\d+\.\d+\.\d+-[0-9a-f]+-nightly$/i;const isNightlyTag=e=>Ws.test(e);const latestNightlyRelease=e=>e.filter((e=>Ws.test(e.tag_name))).sort(((e,t)=>(t.published_at||"").localeCompare(e.published_at||""))).shift();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(Js.valid(A)){let r=t.startsWith("v")?t:`v${t}`;if(isPro(e)&&Js.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=latestNightlyRelease(A);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(!Js.valid(n)&&!Js.validRange(n)){return t}const s=Js.maxSatisfying(r,n);if(Js.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 _s=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 qs={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 _s(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=qs.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 qs.readLinuxVersionFile()}const js=e(import.meta.url)("stream");var $s=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 $s(this,void 0,void 0,(function*(){let A=1;while(AsetTimeout(t,e*1e3)))}))}}var zs=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 Zs=process.platform==="win32";const Ks=process.platform==="darwin";const Xs="actions/tool-cache";function downloadTool(e,t,A,r){return zs(this,void 0,void 0,(function*(){t=t||s.join(_getTempDirectory(),cA.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((()=>zs(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 zs(this,void 0,void 0,(function*(){if(n.existsSync(t)){throw new Error(`Destination file path ${t} already exists`)}const s=new lib_HttpClient(Xs,[],{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=K.promisify(js.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 zs(this,void 0,void 0,(function*(){ok(Zs,"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 zs(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(Zs&&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 zs(this,arguments,void 0,(function*(e,t,A=[]){ok(Ks,"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 zs(this,void 0,void 0,(function*(){if(!e){throw new Error("parameter 'file' is required")}t=yield _createExtractFolder(t);if(Zs){yield extractZipWin(e,t)}else{yield extractZipNix(e,t)}return t}))}function extractZipWin(e,t){return zs(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 zs(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 zs(this,void 0,void 0,(function*(){A=Js.clean(A)||A;r=r||oA.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 zs(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 zs(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 zs(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 zs(this,void 0,void 0,(function*(){if(!e){e=s.join(_getTempDirectory(),cA.randomUUID())}yield mkdirP(e);return e}))}function _createToolPath(e,t,A){return zs(this,void 0,void 0,(function*(){const r=s.join(_getCacheDirectory(),e,Js.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,Js.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(fr=="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,fr=="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=cA.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(Er){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=Er;break}}if(fr=="darwin"){t="all"}const A=fr=="win32"?"Windows":fr=="darwin"?"Darwin":"Linux";const r=fr=="win32"?"zip":"tar.gz";const n=distribSuffix(e);return`goreleaser${n}_${A}_${t}.${r}`};async function getDistPath(e){const t=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=iA(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