agentdeps 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +4 -4
  2. package/dist/index.js +147 -147
  3. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,147 +1,147 @@
1
1
  #!/usr/bin/env node
2
- import{createRequire as b6}from"node:module";var N6=Object.create;var{getPrototypeOf:A6,defineProperty:u4,getOwnPropertyNames:S6}=Object;var w6=Object.prototype.hasOwnProperty;var m1=(q,Z,X)=>{X=q!=null?N6(A6(q)):{};let J=Z||!q||!q.__esModule?u4(X,"default",{value:q,enumerable:!0}):X;for(let $ of S6(q))if(!w6.call(J,$))u4(J,$,{get:()=>q[$],enumerable:!0});return J};var P=(q,Z)=>()=>(Z||q((Z={exports:{}}).exports,Z),Z.exports);var r=b6(import.meta.url);var d1=P((j6)=>{class uq extends Error{constructor(q,Z,X){super(X);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=Z,this.exitCode=q,this.nestedError=void 0}}class m4 extends uq{constructor(q){super(1,"commander.invalidArgument",q);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}j6.CommanderError=uq;j6.InvalidArgumentError=m4});var O0=P((x6)=>{var{InvalidArgumentError:f6}=d1();class d4{constructor(q,Z){switch(this.description=Z||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,q[0]){case"<":this.required=!0,this._name=q.slice(1,-1);break;case"[":this.required=!1,this._name=q.slice(1,-1);break;default:this.required=!0,this._name=q;break}if(this._name.endsWith("..."))this.variadic=!0,this._name=this._name.slice(0,-3)}name(){return this._name}_collectValue(q,Z){if(Z===this.defaultValue||!Array.isArray(Z))return[q];return Z.push(q),Z}default(q,Z){return this.defaultValue=q,this.defaultValueDescription=Z,this}argParser(q){return this.parseArg=q,this}choices(q){return this.argChoices=q.slice(),this.parseArg=(Z,X)=>{if(!this.argChoices.includes(Z))throw new f6(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(Z,X);return Z},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function y6(q){let Z=q.name()+(q.variadic===!0?"...":"");return q.required?"<"+Z+">":"["+Z+"]"}x6.Argument=d4;x6.humanReadableArgName=y6});var mq=P((g6)=>{var{humanReadableArgName:h6}=O0();class l4{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(q){this.helpWidth=this.helpWidth??q.helpWidth??80}visibleCommands(q){let Z=q.commands.filter((J)=>!J._hidden),X=q._getHelpCommand();if(X&&!X._hidden)Z.push(X);if(this.sortSubcommands)Z.sort((J,$)=>{return J.name().localeCompare($.name())});return Z}compareOptions(q,Z){let X=(J)=>{return J.short?J.short.replace(/^-/,""):J.long.replace(/^--/,"")};return X(q).localeCompare(X(Z))}visibleOptions(q){let Z=q.options.filter((J)=>!J.hidden),X=q._getHelpOption();if(X&&!X.hidden){let J=X.short&&q._findOption(X.short),$=X.long&&q._findOption(X.long);if(!J&&!$)Z.push(X);else if(X.long&&!$)Z.push(q.createOption(X.long,X.description));else if(X.short&&!J)Z.push(q.createOption(X.short,X.description))}if(this.sortOptions)Z.sort(this.compareOptions);return Z}visibleGlobalOptions(q){if(!this.showGlobalOptions)return[];let Z=[];for(let X=q.parent;X;X=X.parent){let J=X.options.filter(($)=>!$.hidden);Z.push(...J)}if(this.sortOptions)Z.sort(this.compareOptions);return Z}visibleArguments(q){if(q._argsDescription)q.registeredArguments.forEach((Z)=>{Z.description=Z.description||q._argsDescription[Z.name()]||""});if(q.registeredArguments.find((Z)=>Z.description))return q.registeredArguments;return[]}subcommandTerm(q){let Z=q.registeredArguments.map((X)=>h6(X)).join(" ");return q._name+(q._aliases[0]?"|"+q._aliases[0]:"")+(q.options.length?" [options]":"")+(Z?" "+Z:"")}optionTerm(q){return q.flags}argumentTerm(q){return q.name()}longestSubcommandTermLength(q,Z){return Z.visibleCommands(q).reduce((X,J)=>{return Math.max(X,this.displayWidth(Z.styleSubcommandTerm(Z.subcommandTerm(J))))},0)}longestOptionTermLength(q,Z){return Z.visibleOptions(q).reduce((X,J)=>{return Math.max(X,this.displayWidth(Z.styleOptionTerm(Z.optionTerm(J))))},0)}longestGlobalOptionTermLength(q,Z){return Z.visibleGlobalOptions(q).reduce((X,J)=>{return Math.max(X,this.displayWidth(Z.styleOptionTerm(Z.optionTerm(J))))},0)}longestArgumentTermLength(q,Z){return Z.visibleArguments(q).reduce((X,J)=>{return Math.max(X,this.displayWidth(Z.styleArgumentTerm(Z.argumentTerm(J))))},0)}commandUsage(q){let Z=q._name;if(q._aliases[0])Z=Z+"|"+q._aliases[0];let X="";for(let J=q.parent;J;J=J.parent)X=J.name()+" "+X;return X+Z+" "+q.usage()}commandDescription(q){return q.description()}subcommandDescription(q){return q.summary()||q.description()}optionDescription(q){let Z=[];if(q.argChoices)Z.push(`choices: ${q.argChoices.map((X)=>JSON.stringify(X)).join(", ")}`);if(q.defaultValue!==void 0){if(q.required||q.optional||q.isBoolean()&&typeof q.defaultValue==="boolean")Z.push(`default: ${q.defaultValueDescription||JSON.stringify(q.defaultValue)}`)}if(q.presetArg!==void 0&&q.optional)Z.push(`preset: ${JSON.stringify(q.presetArg)}`);if(q.envVar!==void 0)Z.push(`env: ${q.envVar}`);if(Z.length>0){let X=`(${Z.join(", ")})`;if(q.description)return`${q.description} ${X}`;return X}return q.description}argumentDescription(q){let Z=[];if(q.argChoices)Z.push(`choices: ${q.argChoices.map((X)=>JSON.stringify(X)).join(", ")}`);if(q.defaultValue!==void 0)Z.push(`default: ${q.defaultValueDescription||JSON.stringify(q.defaultValue)}`);if(Z.length>0){let X=`(${Z.join(", ")})`;if(q.description)return`${q.description} ${X}`;return X}return q.description}formatItemList(q,Z,X){if(Z.length===0)return[];return[X.styleTitle(q),...Z,""]}groupItems(q,Z,X){let J=new Map;return q.forEach(($)=>{let Q=X($);if(!J.has(Q))J.set(Q,[])}),Z.forEach(($)=>{let Q=X($);if(!J.has(Q))J.set(Q,[]);J.get(Q).push($)}),J}formatHelp(q,Z){let X=Z.padWidth(q,Z),J=Z.helpWidth??80;function $(T,Y){return Z.formatItem(T,X,Y,Z)}let Q=[`${Z.styleTitle("Usage:")} ${Z.styleUsage(Z.commandUsage(q))}`,""],H=Z.commandDescription(q);if(H.length>0)Q=Q.concat([Z.boxWrap(Z.styleCommandDescription(H),J),""]);let U=Z.visibleArguments(q).map((T)=>{return $(Z.styleArgumentTerm(Z.argumentTerm(T)),Z.styleArgumentDescription(Z.argumentDescription(T)))});if(Q=Q.concat(this.formatItemList("Arguments:",U,Z)),this.groupItems(q.options,Z.visibleOptions(q),(T)=>T.helpGroupHeading??"Options:").forEach((T,Y)=>{let _=T.map((V)=>{return $(Z.styleOptionTerm(Z.optionTerm(V)),Z.styleOptionDescription(Z.optionDescription(V)))});Q=Q.concat(this.formatItemList(Y,_,Z))}),Z.showGlobalOptions){let T=Z.visibleGlobalOptions(q).map((Y)=>{return $(Z.styleOptionTerm(Z.optionTerm(Y)),Z.styleOptionDescription(Z.optionDescription(Y)))});Q=Q.concat(this.formatItemList("Global Options:",T,Z))}return this.groupItems(q.commands,Z.visibleCommands(q),(T)=>T.helpGroup()||"Commands:").forEach((T,Y)=>{let _=T.map((V)=>{return $(Z.styleSubcommandTerm(Z.subcommandTerm(V)),Z.styleSubcommandDescription(Z.subcommandDescription(V)))});Q=Q.concat(this.formatItemList(Y,_,Z))}),Q.join(`
3
- `)}displayWidth(q){return p4(q).length}styleTitle(q){return q}styleUsage(q){return q.split(" ").map((Z)=>{if(Z==="[options]")return this.styleOptionText(Z);if(Z==="[command]")return this.styleSubcommandText(Z);if(Z[0]==="["||Z[0]==="<")return this.styleArgumentText(Z);return this.styleCommandText(Z)}).join(" ")}styleCommandDescription(q){return this.styleDescriptionText(q)}styleOptionDescription(q){return this.styleDescriptionText(q)}styleSubcommandDescription(q){return this.styleDescriptionText(q)}styleArgumentDescription(q){return this.styleDescriptionText(q)}styleDescriptionText(q){return q}styleOptionTerm(q){return this.styleOptionText(q)}styleSubcommandTerm(q){return q.split(" ").map((Z)=>{if(Z==="[options]")return this.styleOptionText(Z);if(Z[0]==="["||Z[0]==="<")return this.styleArgumentText(Z);return this.styleSubcommandText(Z)}).join(" ")}styleArgumentTerm(q){return this.styleArgumentText(q)}styleOptionText(q){return q}styleArgumentText(q){return q}styleSubcommandText(q){return q}styleCommandText(q){return q}padWidth(q,Z){return Math.max(Z.longestOptionTermLength(q,Z),Z.longestGlobalOptionTermLength(q,Z),Z.longestSubcommandTermLength(q,Z),Z.longestArgumentTermLength(q,Z))}preformatted(q){return/\n[^\S\r\n]/.test(q)}formatItem(q,Z,X,J){let Q=" ".repeat(2);if(!X)return Q+q;let H=q.padEnd(Z+q.length-J.displayWidth(q)),U=2,G=(this.helpWidth??80)-Z-U-2,T;if(G<this.minWidthToWrap||J.preformatted(X))T=X;else T=J.boxWrap(X,G).replace(/\n/g,`
4
- `+" ".repeat(Z+U));return Q+H+" ".repeat(U)+T.replace(/\n/g,`
5
- ${Q}`)}boxWrap(q,Z){if(Z<this.minWidthToWrap)return q;let X=q.split(/\r\n|\n/),J=/[\s]*[^\s]+/g,$=[];return X.forEach((Q)=>{let H=Q.match(J);if(H===null){$.push("");return}let U=[H.shift()],z=this.displayWidth(U[0]);H.forEach((G)=>{let T=this.displayWidth(G);if(z+T<=Z){U.push(G),z+=T;return}$.push(U.join(""));let Y=G.trimStart();U=[Y],z=this.displayWidth(Y)}),$.push(U.join(""))}),$.join(`
6
- `)}}function p4(q){let Z=/\x1b\[\d*(;\d*)*m/g;return q.replace(Z,"")}g6.Help=l4;g6.stripColor=p4});var dq=P((p6)=>{var{InvalidArgumentError:d6}=d1();class i4{constructor(q,Z){this.flags=q,this.description=Z||"",this.required=q.includes("<"),this.optional=q.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(q),this.mandatory=!1;let X=l6(q);if(this.short=X.shortFlag,this.long=X.longFlag,this.negate=!1,this.long)this.negate=this.long.startsWith("--no-");this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(q,Z){return this.defaultValue=q,this.defaultValueDescription=Z,this}preset(q){return this.presetArg=q,this}conflicts(q){return this.conflictsWith=this.conflictsWith.concat(q),this}implies(q){let Z=q;if(typeof q==="string")Z={[q]:!0};return this.implied=Object.assign(this.implied||{},Z),this}env(q){return this.envVar=q,this}argParser(q){return this.parseArg=q,this}makeOptionMandatory(q=!0){return this.mandatory=!!q,this}hideHelp(q=!0){return this.hidden=!!q,this}_collectValue(q,Z){if(Z===this.defaultValue||!Array.isArray(Z))return[q];return Z.push(q),Z}choices(q){return this.argChoices=q.slice(),this.parseArg=(Z,X)=>{if(!this.argChoices.includes(Z))throw new d6(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(Z,X);return Z},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){if(this.negate)return c4(this.name().replace(/^no-/,""));return c4(this.name())}helpGroup(q){return this.helpGroupHeading=q,this}is(q){return this.short===q||this.long===q}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class a4{constructor(q){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,q.forEach((Z)=>{if(Z.negate)this.negativeOptions.set(Z.attributeName(),Z);else this.positiveOptions.set(Z.attributeName(),Z)}),this.negativeOptions.forEach((Z,X)=>{if(this.positiveOptions.has(X))this.dualOptions.add(X)})}valueFromOption(q,Z){let X=Z.attributeName();if(!this.dualOptions.has(X))return!0;let J=this.negativeOptions.get(X).presetArg,$=J!==void 0?J:!1;return Z.negate===($===q)}}function c4(q){return q.split("-").reduce((Z,X)=>{return Z+X[0].toUpperCase()+X.slice(1)})}function l6(q){let Z,X,J=/^-[^-]$/,$=/^--[^-]/,Q=q.split(/[ |,]+/).concat("guard");if(J.test(Q[0]))Z=Q.shift();if($.test(Q[0]))X=Q.shift();if(!Z&&J.test(Q[0]))Z=Q.shift();if(!Z&&$.test(Q[0]))Z=X,X=Q.shift();if(Q[0].startsWith("-")){let H=Q[0],U=`option creation failed due to '${H}' in option flags '${q}'`;if(/^-[^-][^-]/.test(H))throw Error(`${U}
2
+ import{createRequire as x6}from"node:module";var E6=Object.create;var{getPrototypeOf:C6,defineProperty:m4,getOwnPropertyNames:f6}=Object;var y6=Object.prototype.hasOwnProperty;var m1=(q,Z,X)=>{X=q!=null?E6(C6(q)):{};let J=Z||!q||!q.__esModule?m4(X,"default",{value:q,enumerable:!0}):X;for(let $ of f6(q))if(!y6.call(J,$))m4(J,$,{get:()=>q[$],enumerable:!0});return J};var P=(q,Z)=>()=>(Z||q((Z={exports:{}}).exports,Z),Z.exports);var r=x6(import.meta.url);var d1=P((k6)=>{class uq extends Error{constructor(q,Z,X){super(X);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=Z,this.exitCode=q,this.nestedError=void 0}}class d4 extends uq{constructor(q){super(1,"commander.invalidArgument",q);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}k6.CommanderError=uq;k6.InvalidArgumentError=d4});var O0=P((m6)=>{var{InvalidArgumentError:g6}=d1();class l4{constructor(q,Z){switch(this.description=Z||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,q[0]){case"<":this.required=!0,this._name=q.slice(1,-1);break;case"[":this.required=!1,this._name=q.slice(1,-1);break;default:this.required=!0,this._name=q;break}if(this._name.endsWith("..."))this.variadic=!0,this._name=this._name.slice(0,-3)}name(){return this._name}_collectValue(q,Z){if(Z===this.defaultValue||!Array.isArray(Z))return[q];return Z.push(q),Z}default(q,Z){return this.defaultValue=q,this.defaultValueDescription=Z,this}argParser(q){return this.parseArg=q,this}choices(q){return this.argChoices=q.slice(),this.parseArg=(Z,X)=>{if(!this.argChoices.includes(Z))throw new g6(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(Z,X);return Z},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function u6(q){let Z=q.name()+(q.variadic===!0?"...":"");return q.required?"<"+Z+">":"["+Z+"]"}m6.Argument=l4;m6.humanReadableArgName=u6});var mq=P((c6)=>{var{humanReadableArgName:p6}=O0();class p4{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(q){this.helpWidth=this.helpWidth??q.helpWidth??80}visibleCommands(q){let Z=q.commands.filter((J)=>!J._hidden),X=q._getHelpCommand();if(X&&!X._hidden)Z.push(X);if(this.sortSubcommands)Z.sort((J,$)=>{return J.name().localeCompare($.name())});return Z}compareOptions(q,Z){let X=(J)=>{return J.short?J.short.replace(/^-/,""):J.long.replace(/^--/,"")};return X(q).localeCompare(X(Z))}visibleOptions(q){let Z=q.options.filter((J)=>!J.hidden),X=q._getHelpOption();if(X&&!X.hidden){let J=X.short&&q._findOption(X.short),$=X.long&&q._findOption(X.long);if(!J&&!$)Z.push(X);else if(X.long&&!$)Z.push(q.createOption(X.long,X.description));else if(X.short&&!J)Z.push(q.createOption(X.short,X.description))}if(this.sortOptions)Z.sort(this.compareOptions);return Z}visibleGlobalOptions(q){if(!this.showGlobalOptions)return[];let Z=[];for(let X=q.parent;X;X=X.parent){let J=X.options.filter(($)=>!$.hidden);Z.push(...J)}if(this.sortOptions)Z.sort(this.compareOptions);return Z}visibleArguments(q){if(q._argsDescription)q.registeredArguments.forEach((Z)=>{Z.description=Z.description||q._argsDescription[Z.name()]||""});if(q.registeredArguments.find((Z)=>Z.description))return q.registeredArguments;return[]}subcommandTerm(q){let Z=q.registeredArguments.map((X)=>p6(X)).join(" ");return q._name+(q._aliases[0]?"|"+q._aliases[0]:"")+(q.options.length?" [options]":"")+(Z?" "+Z:"")}optionTerm(q){return q.flags}argumentTerm(q){return q.name()}longestSubcommandTermLength(q,Z){return Z.visibleCommands(q).reduce((X,J)=>{return Math.max(X,this.displayWidth(Z.styleSubcommandTerm(Z.subcommandTerm(J))))},0)}longestOptionTermLength(q,Z){return Z.visibleOptions(q).reduce((X,J)=>{return Math.max(X,this.displayWidth(Z.styleOptionTerm(Z.optionTerm(J))))},0)}longestGlobalOptionTermLength(q,Z){return Z.visibleGlobalOptions(q).reduce((X,J)=>{return Math.max(X,this.displayWidth(Z.styleOptionTerm(Z.optionTerm(J))))},0)}longestArgumentTermLength(q,Z){return Z.visibleArguments(q).reduce((X,J)=>{return Math.max(X,this.displayWidth(Z.styleArgumentTerm(Z.argumentTerm(J))))},0)}commandUsage(q){let Z=q._name;if(q._aliases[0])Z=Z+"|"+q._aliases[0];let X="";for(let J=q.parent;J;J=J.parent)X=J.name()+" "+X;return X+Z+" "+q.usage()}commandDescription(q){return q.description()}subcommandDescription(q){return q.summary()||q.description()}optionDescription(q){let Z=[];if(q.argChoices)Z.push(`choices: ${q.argChoices.map((X)=>JSON.stringify(X)).join(", ")}`);if(q.defaultValue!==void 0){if(q.required||q.optional||q.isBoolean()&&typeof q.defaultValue==="boolean")Z.push(`default: ${q.defaultValueDescription||JSON.stringify(q.defaultValue)}`)}if(q.presetArg!==void 0&&q.optional)Z.push(`preset: ${JSON.stringify(q.presetArg)}`);if(q.envVar!==void 0)Z.push(`env: ${q.envVar}`);if(Z.length>0){let X=`(${Z.join(", ")})`;if(q.description)return`${q.description} ${X}`;return X}return q.description}argumentDescription(q){let Z=[];if(q.argChoices)Z.push(`choices: ${q.argChoices.map((X)=>JSON.stringify(X)).join(", ")}`);if(q.defaultValue!==void 0)Z.push(`default: ${q.defaultValueDescription||JSON.stringify(q.defaultValue)}`);if(Z.length>0){let X=`(${Z.join(", ")})`;if(q.description)return`${q.description} ${X}`;return X}return q.description}formatItemList(q,Z,X){if(Z.length===0)return[];return[X.styleTitle(q),...Z,""]}groupItems(q,Z,X){let J=new Map;return q.forEach(($)=>{let Q=X($);if(!J.has(Q))J.set(Q,[])}),Z.forEach(($)=>{let Q=X($);if(!J.has(Q))J.set(Q,[]);J.get(Q).push($)}),J}formatHelp(q,Z){let X=Z.padWidth(q,Z),J=Z.helpWidth??80;function $(T,Y){return Z.formatItem(T,X,Y,Z)}let Q=[`${Z.styleTitle("Usage:")} ${Z.styleUsage(Z.commandUsage(q))}`,""],H=Z.commandDescription(q);if(H.length>0)Q=Q.concat([Z.boxWrap(Z.styleCommandDescription(H),J),""]);let z=Z.visibleArguments(q).map((T)=>{return $(Z.styleArgumentTerm(Z.argumentTerm(T)),Z.styleArgumentDescription(Z.argumentDescription(T)))});if(Q=Q.concat(this.formatItemList("Arguments:",z,Z)),this.groupItems(q.options,Z.visibleOptions(q),(T)=>T.helpGroupHeading??"Options:").forEach((T,Y)=>{let _=T.map((V)=>{return $(Z.styleOptionTerm(Z.optionTerm(V)),Z.styleOptionDescription(Z.optionDescription(V)))});Q=Q.concat(this.formatItemList(Y,_,Z))}),Z.showGlobalOptions){let T=Z.visibleGlobalOptions(q).map((Y)=>{return $(Z.styleOptionTerm(Z.optionTerm(Y)),Z.styleOptionDescription(Z.optionDescription(Y)))});Q=Q.concat(this.formatItemList("Global Options:",T,Z))}return this.groupItems(q.commands,Z.visibleCommands(q),(T)=>T.helpGroup()||"Commands:").forEach((T,Y)=>{let _=T.map((V)=>{return $(Z.styleSubcommandTerm(Z.subcommandTerm(V)),Z.styleSubcommandDescription(Z.subcommandDescription(V)))});Q=Q.concat(this.formatItemList(Y,_,Z))}),Q.join(`
3
+ `)}displayWidth(q){return c4(q).length}styleTitle(q){return q}styleUsage(q){return q.split(" ").map((Z)=>{if(Z==="[options]")return this.styleOptionText(Z);if(Z==="[command]")return this.styleSubcommandText(Z);if(Z[0]==="["||Z[0]==="<")return this.styleArgumentText(Z);return this.styleCommandText(Z)}).join(" ")}styleCommandDescription(q){return this.styleDescriptionText(q)}styleOptionDescription(q){return this.styleDescriptionText(q)}styleSubcommandDescription(q){return this.styleDescriptionText(q)}styleArgumentDescription(q){return this.styleDescriptionText(q)}styleDescriptionText(q){return q}styleOptionTerm(q){return this.styleOptionText(q)}styleSubcommandTerm(q){return q.split(" ").map((Z)=>{if(Z==="[options]")return this.styleOptionText(Z);if(Z[0]==="["||Z[0]==="<")return this.styleArgumentText(Z);return this.styleSubcommandText(Z)}).join(" ")}styleArgumentTerm(q){return this.styleArgumentText(q)}styleOptionText(q){return q}styleArgumentText(q){return q}styleSubcommandText(q){return q}styleCommandText(q){return q}padWidth(q,Z){return Math.max(Z.longestOptionTermLength(q,Z),Z.longestGlobalOptionTermLength(q,Z),Z.longestSubcommandTermLength(q,Z),Z.longestArgumentTermLength(q,Z))}preformatted(q){return/\n[^\S\r\n]/.test(q)}formatItem(q,Z,X,J){let Q=" ".repeat(2);if(!X)return Q+q;let H=q.padEnd(Z+q.length-J.displayWidth(q)),z=2,G=(this.helpWidth??80)-Z-z-2,T;if(G<this.minWidthToWrap||J.preformatted(X))T=X;else T=J.boxWrap(X,G).replace(/\n/g,`
4
+ `+" ".repeat(Z+z));return Q+H+" ".repeat(z)+T.replace(/\n/g,`
5
+ ${Q}`)}boxWrap(q,Z){if(Z<this.minWidthToWrap)return q;let X=q.split(/\r\n|\n/),J=/[\s]*[^\s]+/g,$=[];return X.forEach((Q)=>{let H=Q.match(J);if(H===null){$.push("");return}let z=[H.shift()],U=this.displayWidth(z[0]);H.forEach((G)=>{let T=this.displayWidth(G);if(U+T<=Z){z.push(G),U+=T;return}$.push(z.join(""));let Y=G.trimStart();z=[Y],U=this.displayWidth(Y)}),$.push(z.join(""))}),$.join(`
6
+ `)}}function c4(q){let Z=/\x1b\[\d*(;\d*)*m/g;return q.replace(Z,"")}c6.Help=p4;c6.stripColor=c4});var dq=P((n6)=>{var{InvalidArgumentError:s6}=d1();class a4{constructor(q,Z){this.flags=q,this.description=Z||"",this.required=q.includes("<"),this.optional=q.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(q),this.mandatory=!1;let X=r6(q);if(this.short=X.shortFlag,this.long=X.longFlag,this.negate=!1,this.long)this.negate=this.long.startsWith("--no-");this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(q,Z){return this.defaultValue=q,this.defaultValueDescription=Z,this}preset(q){return this.presetArg=q,this}conflicts(q){return this.conflictsWith=this.conflictsWith.concat(q),this}implies(q){let Z=q;if(typeof q==="string")Z={[q]:!0};return this.implied=Object.assign(this.implied||{},Z),this}env(q){return this.envVar=q,this}argParser(q){return this.parseArg=q,this}makeOptionMandatory(q=!0){return this.mandatory=!!q,this}hideHelp(q=!0){return this.hidden=!!q,this}_collectValue(q,Z){if(Z===this.defaultValue||!Array.isArray(Z))return[q];return Z.push(q),Z}choices(q){return this.argChoices=q.slice(),this.parseArg=(Z,X)=>{if(!this.argChoices.includes(Z))throw new s6(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(Z,X);return Z},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){if(this.negate)return i4(this.name().replace(/^no-/,""));return i4(this.name())}helpGroup(q){return this.helpGroupHeading=q,this}is(q){return this.short===q||this.long===q}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class s4{constructor(q){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,q.forEach((Z)=>{if(Z.negate)this.negativeOptions.set(Z.attributeName(),Z);else this.positiveOptions.set(Z.attributeName(),Z)}),this.negativeOptions.forEach((Z,X)=>{if(this.positiveOptions.has(X))this.dualOptions.add(X)})}valueFromOption(q,Z){let X=Z.attributeName();if(!this.dualOptions.has(X))return!0;let J=this.negativeOptions.get(X).presetArg,$=J!==void 0?J:!1;return Z.negate===($===q)}}function i4(q){return q.split("-").reduce((Z,X)=>{return Z+X[0].toUpperCase()+X.slice(1)})}function r6(q){let Z,X,J=/^-[^-]$/,$=/^--[^-]/,Q=q.split(/[ |,]+/).concat("guard");if(J.test(Q[0]))Z=Q.shift();if($.test(Q[0]))X=Q.shift();if(!Z&&J.test(Q[0]))Z=Q.shift();if(!Z&&$.test(Q[0]))Z=X,X=Q.shift();if(Q[0].startsWith("-")){let H=Q[0],z=`option creation failed due to '${H}' in option flags '${q}'`;if(/^-[^-][^-]/.test(H))throw Error(`${z}
7
7
  - a short flag is a single dash and a single character
8
8
  - either use a single dash and a single character (for a short flag)
9
- - or use a double dash for a long option (and can have two, like '--ws, --workspace')`);if(J.test(H))throw Error(`${U}
10
- - too many short flags`);if($.test(H))throw Error(`${U}
11
- - too many long flags`);throw Error(`${U}
12
- - unrecognised flag format`)}if(Z===void 0&&X===void 0)throw Error(`option creation failed due to no flags found in '${q}'.`);return{shortFlag:Z,longFlag:X}}p6.Option=i4;p6.DualOptions=a4});var s4=P((r6)=>{function a6(q,Z){if(Math.abs(q.length-Z.length)>3)return Math.max(q.length,Z.length);let X=[];for(let J=0;J<=q.length;J++)X[J]=[J];for(let J=0;J<=Z.length;J++)X[0][J]=J;for(let J=1;J<=Z.length;J++)for(let $=1;$<=q.length;$++){let Q=1;if(q[$-1]===Z[J-1])Q=0;else Q=1;if(X[$][J]=Math.min(X[$-1][J]+1,X[$][J-1]+1,X[$-1][J-1]+Q),$>1&&J>1&&q[$-1]===Z[J-2]&&q[$-2]===Z[J-1])X[$][J]=Math.min(X[$][J],X[$-2][J-2]+1)}return X[q.length][Z.length]}function s6(q,Z){if(!Z||Z.length===0)return"";Z=Array.from(new Set(Z));let X=q.startsWith("--");if(X)q=q.slice(2),Z=Z.map((H)=>H.slice(2));let J=[],$=3,Q=0.4;if(Z.forEach((H)=>{if(H.length<=1)return;let U=a6(q,H),z=Math.max(q.length,H.length);if((z-U)/z>Q){if(U<$)$=U,J=[H];else if(U===$)J.push(H)}}),J.sort((H,U)=>H.localeCompare(U)),X)J=J.map((H)=>`--${H}`);if(J.length>1)return`
9
+ - or use a double dash for a long option (and can have two, like '--ws, --workspace')`);if(J.test(H))throw Error(`${z}
10
+ - too many short flags`);if($.test(H))throw Error(`${z}
11
+ - too many long flags`);throw Error(`${z}
12
+ - unrecognised flag format`)}if(Z===void 0&&X===void 0)throw Error(`option creation failed due to no flags found in '${q}'.`);return{shortFlag:Z,longFlag:X}}n6.Option=a4;n6.DualOptions=s4});var r4=P((Z7)=>{function e6(q,Z){if(Math.abs(q.length-Z.length)>3)return Math.max(q.length,Z.length);let X=[];for(let J=0;J<=q.length;J++)X[J]=[J];for(let J=0;J<=Z.length;J++)X[0][J]=J;for(let J=1;J<=Z.length;J++)for(let $=1;$<=q.length;$++){let Q=1;if(q[$-1]===Z[J-1])Q=0;else Q=1;if(X[$][J]=Math.min(X[$-1][J]+1,X[$][J-1]+1,X[$-1][J-1]+Q),$>1&&J>1&&q[$-1]===Z[J-2]&&q[$-2]===Z[J-1])X[$][J]=Math.min(X[$][J],X[$-2][J-2]+1)}return X[q.length][Z.length]}function q7(q,Z){if(!Z||Z.length===0)return"";Z=Array.from(new Set(Z));let X=q.startsWith("--");if(X)q=q.slice(2),Z=Z.map((H)=>H.slice(2));let J=[],$=3,Q=0.4;if(Z.forEach((H)=>{if(H.length<=1)return;let z=e6(q,H),U=Math.max(q.length,H.length);if((U-z)/U>Q){if(z<$)$=z,J=[H];else if(z===$)J.push(H)}}),J.sort((H,z)=>H.localeCompare(z)),X)J=J.map((H)=>`--${H}`);if(J.length>1)return`
13
13
  (Did you mean one of ${J.join(", ")}?)`;if(J.length===1)return`
14
- (Did you mean ${J[0]}?)`;return""}r6.suggestSimilar=s6});var t4=P((J7)=>{var o6=r("node:events").EventEmitter,lq=r("node:child_process"),n=r("node:path"),N0=r("node:fs"),b=r("node:process"),{Argument:t6,humanReadableArgName:e6}=O0(),{CommanderError:pq}=d1(),{Help:q7,stripColor:Z7}=mq(),{Option:r4,DualOptions:X7}=dq(),{suggestSimilar:n4}=s4();class iq extends o6{constructor(q){super();this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=q||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:(Z)=>b.stdout.write(Z),writeErr:(Z)=>b.stderr.write(Z),outputError:(Z,X)=>X(Z),getOutHelpWidth:()=>b.stdout.isTTY?b.stdout.columns:void 0,getErrHelpWidth:()=>b.stderr.isTTY?b.stderr.columns:void 0,getOutHasColors:()=>cq()??(b.stdout.isTTY&&b.stdout.hasColors?.()),getErrHasColors:()=>cq()??(b.stderr.isTTY&&b.stderr.hasColors?.()),stripColor:(Z)=>Z7(Z)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(q){return this._outputConfiguration=q._outputConfiguration,this._helpOption=q._helpOption,this._helpCommand=q._helpCommand,this._helpConfiguration=q._helpConfiguration,this._exitCallback=q._exitCallback,this._storeOptionsAsProperties=q._storeOptionsAsProperties,this._combineFlagAndOptionalValue=q._combineFlagAndOptionalValue,this._allowExcessArguments=q._allowExcessArguments,this._enablePositionalOptions=q._enablePositionalOptions,this._showHelpAfterError=q._showHelpAfterError,this._showSuggestionAfterError=q._showSuggestionAfterError,this}_getCommandAndAncestors(){let q=[];for(let Z=this;Z;Z=Z.parent)q.push(Z);return q}command(q,Z,X){let J=Z,$=X;if(typeof J==="object"&&J!==null)$=J,J=null;$=$||{};let[,Q,H]=q.match(/([^ ]+) *(.*)/),U=this.createCommand(Q);if(J)U.description(J),U._executableHandler=!0;if($.isDefault)this._defaultCommandName=U._name;if(U._hidden=!!($.noHelp||$.hidden),U._executableFile=$.executableFile||null,H)U.arguments(H);if(this._registerCommand(U),U.parent=this,U.copyInheritedSettings(this),J)return this;return U}createCommand(q){return new iq(q)}createHelp(){return Object.assign(new q7,this.configureHelp())}configureHelp(q){if(q===void 0)return this._helpConfiguration;return this._helpConfiguration=q,this}configureOutput(q){if(q===void 0)return this._outputConfiguration;return this._outputConfiguration={...this._outputConfiguration,...q},this}showHelpAfterError(q=!0){if(typeof q!=="string")q=!!q;return this._showHelpAfterError=q,this}showSuggestionAfterError(q=!0){return this._showSuggestionAfterError=!!q,this}addCommand(q,Z){if(!q._name)throw Error(`Command passed to .addCommand() must have a name
15
- - specify the name in Command constructor or using .name()`);if(Z=Z||{},Z.isDefault)this._defaultCommandName=q._name;if(Z.noHelp||Z.hidden)q._hidden=!0;return this._registerCommand(q),q.parent=this,q._checkForBrokenPassThrough(),this}createArgument(q,Z){return new t6(q,Z)}argument(q,Z,X,J){let $=this.createArgument(q,Z);if(typeof X==="function")$.default(J).argParser(X);else $.default(X);return this.addArgument($),this}arguments(q){return q.trim().split(/ +/).forEach((Z)=>{this.argument(Z)}),this}addArgument(q){let Z=this.registeredArguments.slice(-1)[0];if(Z?.variadic)throw Error(`only the last argument can be variadic '${Z.name()}'`);if(q.required&&q.defaultValue!==void 0&&q.parseArg===void 0)throw Error(`a default value for a required argument is never used: '${q.name()}'`);return this.registeredArguments.push(q),this}helpCommand(q,Z){if(typeof q==="boolean"){if(this._addImplicitHelpCommand=q,q&&this._defaultCommandGroup)this._initCommandGroup(this._getHelpCommand());return this}let X=q??"help [command]",[,J,$]=X.match(/([^ ]+) *(.*)/),Q=Z??"display help for command",H=this.createCommand(J);if(H.helpOption(!1),$)H.arguments($);if(Q)H.description(Q);if(this._addImplicitHelpCommand=!0,this._helpCommand=H,q||Z)this._initCommandGroup(H);return this}addHelpCommand(q,Z){if(typeof q!=="object")return this.helpCommand(q,Z),this;return this._addImplicitHelpCommand=!0,this._helpCommand=q,this._initCommandGroup(q),this}_getHelpCommand(){if(this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))){if(this._helpCommand===void 0)this.helpCommand(void 0,void 0);return this._helpCommand}return null}hook(q,Z){let X=["preSubcommand","preAction","postAction"];if(!X.includes(q))throw Error(`Unexpected value for event passed to hook : '${q}'.
16
- Expecting one of '${X.join("', '")}'`);if(this._lifeCycleHooks[q])this._lifeCycleHooks[q].push(Z);else this._lifeCycleHooks[q]=[Z];return this}exitOverride(q){if(q)this._exitCallback=q;else this._exitCallback=(Z)=>{if(Z.code!=="commander.executeSubCommandAsync")throw Z};return this}_exit(q,Z,X){if(this._exitCallback)this._exitCallback(new pq(q,Z,X));b.exit(q)}action(q){let Z=(X)=>{let J=this.registeredArguments.length,$=X.slice(0,J);if(this._storeOptionsAsProperties)$[J]=this;else $[J]=this.opts();return $.push(this),q.apply(this,$)};return this._actionHandler=Z,this}createOption(q,Z){return new r4(q,Z)}_callParseArg(q,Z,X,J){try{return q.parseArg(Z,X)}catch($){if($.code==="commander.invalidArgument"){let Q=`${J} ${$.message}`;this.error(Q,{exitCode:$.exitCode,code:$.code})}throw $}}_registerOption(q){let Z=q.short&&this._findOption(q.short)||q.long&&this._findOption(q.long);if(Z){let X=q.long&&this._findOption(q.long)?q.long:q.short;throw Error(`Cannot add option '${q.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${X}'
17
- - already used by option '${Z.flags}'`)}this._initOptionGroup(q),this.options.push(q)}_registerCommand(q){let Z=(J)=>{return[J.name()].concat(J.aliases())},X=Z(q).find((J)=>this._findCommand(J));if(X){let J=Z(this._findCommand(X)).join("|"),$=Z(q).join("|");throw Error(`cannot add command '${$}' as already have command '${J}'`)}this._initCommandGroup(q),this.commands.push(q)}addOption(q){this._registerOption(q);let Z=q.name(),X=q.attributeName();if(q.negate){let $=q.long.replace(/^--no-/,"--");if(!this._findOption($))this.setOptionValueWithSource(X,q.defaultValue===void 0?!0:q.defaultValue,"default")}else if(q.defaultValue!==void 0)this.setOptionValueWithSource(X,q.defaultValue,"default");let J=($,Q,H)=>{if($==null&&q.presetArg!==void 0)$=q.presetArg;let U=this.getOptionValue(X);if($!==null&&q.parseArg)$=this._callParseArg(q,$,U,Q);else if($!==null&&q.variadic)$=q._collectValue($,U);if($==null)if(q.negate)$=!1;else if(q.isBoolean()||q.optional)$=!0;else $="";this.setOptionValueWithSource(X,$,H)};if(this.on("option:"+Z,($)=>{let Q=`error: option '${q.flags}' argument '${$}' is invalid.`;J($,Q,"cli")}),q.envVar)this.on("optionEnv:"+Z,($)=>{let Q=`error: option '${q.flags}' value '${$}' from env '${q.envVar}' is invalid.`;J($,Q,"env")});return this}_optionEx(q,Z,X,J,$){if(typeof Z==="object"&&Z instanceof r4)throw Error("To add an Option object use addOption() instead of option() or requiredOption()");let Q=this.createOption(Z,X);if(Q.makeOptionMandatory(!!q.mandatory),typeof J==="function")Q.default($).argParser(J);else if(J instanceof RegExp){let H=J;J=(U,z)=>{let G=H.exec(U);return G?G[0]:z},Q.default($).argParser(J)}else Q.default(J);return this.addOption(Q)}option(q,Z,X,J){return this._optionEx({},q,Z,X,J)}requiredOption(q,Z,X,J){return this._optionEx({mandatory:!0},q,Z,X,J)}combineFlagAndOptionalValue(q=!0){return this._combineFlagAndOptionalValue=!!q,this}allowUnknownOption(q=!0){return this._allowUnknownOption=!!q,this}allowExcessArguments(q=!0){return this._allowExcessArguments=!!q,this}enablePositionalOptions(q=!0){return this._enablePositionalOptions=!!q,this}passThroughOptions(q=!0){return this._passThroughOptions=!!q,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(q=!0){if(this.options.length)throw Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!q,this}getOptionValue(q){if(this._storeOptionsAsProperties)return this[q];return this._optionValues[q]}setOptionValue(q,Z){return this.setOptionValueWithSource(q,Z,void 0)}setOptionValueWithSource(q,Z,X){if(this._storeOptionsAsProperties)this[q]=Z;else this._optionValues[q]=Z;return this._optionValueSources[q]=X,this}getOptionValueSource(q){return this._optionValueSources[q]}getOptionValueSourceWithGlobals(q){let Z;return this._getCommandAndAncestors().forEach((X)=>{if(X.getOptionValueSource(q)!==void 0)Z=X.getOptionValueSource(q)}),Z}_prepareUserArgs(q,Z){if(q!==void 0&&!Array.isArray(q))throw Error("first parameter to parse must be array or undefined");if(Z=Z||{},q===void 0&&Z.from===void 0){if(b.versions?.electron)Z.from="electron";let J=b.execArgv??[];if(J.includes("-e")||J.includes("--eval")||J.includes("-p")||J.includes("--print"))Z.from="eval"}if(q===void 0)q=b.argv;this.rawArgs=q.slice();let X;switch(Z.from){case void 0:case"node":this._scriptPath=q[1],X=q.slice(2);break;case"electron":if(b.defaultApp)this._scriptPath=q[1],X=q.slice(2);else X=q.slice(1);break;case"user":X=q.slice(0);break;case"eval":X=q.slice(1);break;default:throw Error(`unexpected parse option { from: '${Z.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);return this._name=this._name||"program",X}parse(q,Z){this._prepareForParse();let X=this._prepareUserArgs(q,Z);return this._parseCommand([],X),this}async parseAsync(q,Z){this._prepareForParse();let X=this._prepareUserArgs(q,Z);return await this._parseCommand([],X),this}_prepareForParse(){if(this._savedState===null)this.saveStateBeforeParse();else this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw Error(`Can not call parse again when storeOptionsAsProperties is true.
14
+ (Did you mean ${J[0]}?)`;return""}Z7.suggestSimilar=q7});var e4=P((G7)=>{var J7=r("node:events").EventEmitter,lq=r("node:child_process"),n=r("node:path"),N0=r("node:fs"),b=r("node:process"),{Argument:$7,humanReadableArgName:Q7}=O0(),{CommanderError:pq}=d1(),{Help:H7,stripColor:z7}=mq(),{Option:n4,DualOptions:U7}=dq(),{suggestSimilar:o4}=r4();class iq extends J7{constructor(q){super();this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=q||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:(Z)=>b.stdout.write(Z),writeErr:(Z)=>b.stderr.write(Z),outputError:(Z,X)=>X(Z),getOutHelpWidth:()=>b.stdout.isTTY?b.stdout.columns:void 0,getErrHelpWidth:()=>b.stderr.isTTY?b.stderr.columns:void 0,getOutHasColors:()=>cq()??(b.stdout.isTTY&&b.stdout.hasColors?.()),getErrHasColors:()=>cq()??(b.stderr.isTTY&&b.stderr.hasColors?.()),stripColor:(Z)=>z7(Z)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(q){return this._outputConfiguration=q._outputConfiguration,this._helpOption=q._helpOption,this._helpCommand=q._helpCommand,this._helpConfiguration=q._helpConfiguration,this._exitCallback=q._exitCallback,this._storeOptionsAsProperties=q._storeOptionsAsProperties,this._combineFlagAndOptionalValue=q._combineFlagAndOptionalValue,this._allowExcessArguments=q._allowExcessArguments,this._enablePositionalOptions=q._enablePositionalOptions,this._showHelpAfterError=q._showHelpAfterError,this._showSuggestionAfterError=q._showSuggestionAfterError,this}_getCommandAndAncestors(){let q=[];for(let Z=this;Z;Z=Z.parent)q.push(Z);return q}command(q,Z,X){let J=Z,$=X;if(typeof J==="object"&&J!==null)$=J,J=null;$=$||{};let[,Q,H]=q.match(/([^ ]+) *(.*)/),z=this.createCommand(Q);if(J)z.description(J),z._executableHandler=!0;if($.isDefault)this._defaultCommandName=z._name;if(z._hidden=!!($.noHelp||$.hidden),z._executableFile=$.executableFile||null,H)z.arguments(H);if(this._registerCommand(z),z.parent=this,z.copyInheritedSettings(this),J)return this;return z}createCommand(q){return new iq(q)}createHelp(){return Object.assign(new H7,this.configureHelp())}configureHelp(q){if(q===void 0)return this._helpConfiguration;return this._helpConfiguration=q,this}configureOutput(q){if(q===void 0)return this._outputConfiguration;return this._outputConfiguration={...this._outputConfiguration,...q},this}showHelpAfterError(q=!0){if(typeof q!=="string")q=!!q;return this._showHelpAfterError=q,this}showSuggestionAfterError(q=!0){return this._showSuggestionAfterError=!!q,this}addCommand(q,Z){if(!q._name)throw Error(`Command passed to .addCommand() must have a name
15
+ - specify the name in Command constructor or using .name()`);if(Z=Z||{},Z.isDefault)this._defaultCommandName=q._name;if(Z.noHelp||Z.hidden)q._hidden=!0;return this._registerCommand(q),q.parent=this,q._checkForBrokenPassThrough(),this}createArgument(q,Z){return new $7(q,Z)}argument(q,Z,X,J){let $=this.createArgument(q,Z);if(typeof X==="function")$.default(J).argParser(X);else $.default(X);return this.addArgument($),this}arguments(q){return q.trim().split(/ +/).forEach((Z)=>{this.argument(Z)}),this}addArgument(q){let Z=this.registeredArguments.slice(-1)[0];if(Z?.variadic)throw Error(`only the last argument can be variadic '${Z.name()}'`);if(q.required&&q.defaultValue!==void 0&&q.parseArg===void 0)throw Error(`a default value for a required argument is never used: '${q.name()}'`);return this.registeredArguments.push(q),this}helpCommand(q,Z){if(typeof q==="boolean"){if(this._addImplicitHelpCommand=q,q&&this._defaultCommandGroup)this._initCommandGroup(this._getHelpCommand());return this}let X=q??"help [command]",[,J,$]=X.match(/([^ ]+) *(.*)/),Q=Z??"display help for command",H=this.createCommand(J);if(H.helpOption(!1),$)H.arguments($);if(Q)H.description(Q);if(this._addImplicitHelpCommand=!0,this._helpCommand=H,q||Z)this._initCommandGroup(H);return this}addHelpCommand(q,Z){if(typeof q!=="object")return this.helpCommand(q,Z),this;return this._addImplicitHelpCommand=!0,this._helpCommand=q,this._initCommandGroup(q),this}_getHelpCommand(){if(this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))){if(this._helpCommand===void 0)this.helpCommand(void 0,void 0);return this._helpCommand}return null}hook(q,Z){let X=["preSubcommand","preAction","postAction"];if(!X.includes(q))throw Error(`Unexpected value for event passed to hook : '${q}'.
16
+ Expecting one of '${X.join("', '")}'`);if(this._lifeCycleHooks[q])this._lifeCycleHooks[q].push(Z);else this._lifeCycleHooks[q]=[Z];return this}exitOverride(q){if(q)this._exitCallback=q;else this._exitCallback=(Z)=>{if(Z.code!=="commander.executeSubCommandAsync")throw Z};return this}_exit(q,Z,X){if(this._exitCallback)this._exitCallback(new pq(q,Z,X));b.exit(q)}action(q){let Z=(X)=>{let J=this.registeredArguments.length,$=X.slice(0,J);if(this._storeOptionsAsProperties)$[J]=this;else $[J]=this.opts();return $.push(this),q.apply(this,$)};return this._actionHandler=Z,this}createOption(q,Z){return new n4(q,Z)}_callParseArg(q,Z,X,J){try{return q.parseArg(Z,X)}catch($){if($.code==="commander.invalidArgument"){let Q=`${J} ${$.message}`;this.error(Q,{exitCode:$.exitCode,code:$.code})}throw $}}_registerOption(q){let Z=q.short&&this._findOption(q.short)||q.long&&this._findOption(q.long);if(Z){let X=q.long&&this._findOption(q.long)?q.long:q.short;throw Error(`Cannot add option '${q.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${X}'
17
+ - already used by option '${Z.flags}'`)}this._initOptionGroup(q),this.options.push(q)}_registerCommand(q){let Z=(J)=>{return[J.name()].concat(J.aliases())},X=Z(q).find((J)=>this._findCommand(J));if(X){let J=Z(this._findCommand(X)).join("|"),$=Z(q).join("|");throw Error(`cannot add command '${$}' as already have command '${J}'`)}this._initCommandGroup(q),this.commands.push(q)}addOption(q){this._registerOption(q);let Z=q.name(),X=q.attributeName();if(q.negate){let $=q.long.replace(/^--no-/,"--");if(!this._findOption($))this.setOptionValueWithSource(X,q.defaultValue===void 0?!0:q.defaultValue,"default")}else if(q.defaultValue!==void 0)this.setOptionValueWithSource(X,q.defaultValue,"default");let J=($,Q,H)=>{if($==null&&q.presetArg!==void 0)$=q.presetArg;let z=this.getOptionValue(X);if($!==null&&q.parseArg)$=this._callParseArg(q,$,z,Q);else if($!==null&&q.variadic)$=q._collectValue($,z);if($==null)if(q.negate)$=!1;else if(q.isBoolean()||q.optional)$=!0;else $="";this.setOptionValueWithSource(X,$,H)};if(this.on("option:"+Z,($)=>{let Q=`error: option '${q.flags}' argument '${$}' is invalid.`;J($,Q,"cli")}),q.envVar)this.on("optionEnv:"+Z,($)=>{let Q=`error: option '${q.flags}' value '${$}' from env '${q.envVar}' is invalid.`;J($,Q,"env")});return this}_optionEx(q,Z,X,J,$){if(typeof Z==="object"&&Z instanceof n4)throw Error("To add an Option object use addOption() instead of option() or requiredOption()");let Q=this.createOption(Z,X);if(Q.makeOptionMandatory(!!q.mandatory),typeof J==="function")Q.default($).argParser(J);else if(J instanceof RegExp){let H=J;J=(z,U)=>{let G=H.exec(z);return G?G[0]:U},Q.default($).argParser(J)}else Q.default(J);return this.addOption(Q)}option(q,Z,X,J){return this._optionEx({},q,Z,X,J)}requiredOption(q,Z,X,J){return this._optionEx({mandatory:!0},q,Z,X,J)}combineFlagAndOptionalValue(q=!0){return this._combineFlagAndOptionalValue=!!q,this}allowUnknownOption(q=!0){return this._allowUnknownOption=!!q,this}allowExcessArguments(q=!0){return this._allowExcessArguments=!!q,this}enablePositionalOptions(q=!0){return this._enablePositionalOptions=!!q,this}passThroughOptions(q=!0){return this._passThroughOptions=!!q,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(q=!0){if(this.options.length)throw Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!q,this}getOptionValue(q){if(this._storeOptionsAsProperties)return this[q];return this._optionValues[q]}setOptionValue(q,Z){return this.setOptionValueWithSource(q,Z,void 0)}setOptionValueWithSource(q,Z,X){if(this._storeOptionsAsProperties)this[q]=Z;else this._optionValues[q]=Z;return this._optionValueSources[q]=X,this}getOptionValueSource(q){return this._optionValueSources[q]}getOptionValueSourceWithGlobals(q){let Z;return this._getCommandAndAncestors().forEach((X)=>{if(X.getOptionValueSource(q)!==void 0)Z=X.getOptionValueSource(q)}),Z}_prepareUserArgs(q,Z){if(q!==void 0&&!Array.isArray(q))throw Error("first parameter to parse must be array or undefined");if(Z=Z||{},q===void 0&&Z.from===void 0){if(b.versions?.electron)Z.from="electron";let J=b.execArgv??[];if(J.includes("-e")||J.includes("--eval")||J.includes("-p")||J.includes("--print"))Z.from="eval"}if(q===void 0)q=b.argv;this.rawArgs=q.slice();let X;switch(Z.from){case void 0:case"node":this._scriptPath=q[1],X=q.slice(2);break;case"electron":if(b.defaultApp)this._scriptPath=q[1],X=q.slice(2);else X=q.slice(1);break;case"user":X=q.slice(0);break;case"eval":X=q.slice(1);break;default:throw Error(`unexpected parse option { from: '${Z.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);return this._name=this._name||"program",X}parse(q,Z){this._prepareForParse();let X=this._prepareUserArgs(q,Z);return this._parseCommand([],X),this}async parseAsync(q,Z){this._prepareForParse();let X=this._prepareUserArgs(q,Z);return await this._parseCommand([],X),this}_prepareForParse(){if(this._savedState===null)this.saveStateBeforeParse();else this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw Error(`Can not call parse again when storeOptionsAsProperties is true.
18
18
  - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(q,Z,X){if(N0.existsSync(q))return;let J=Z?`searched for local subcommand relative to directory '${Z}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",$=`'${q}' does not exist
19
19
  - if '${X}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
20
20
  - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
21
- - ${J}`;throw Error($)}_executeSubCommand(q,Z){Z=Z.slice();let X=!1,J=[".js",".ts",".tsx",".mjs",".cjs"];function $(G,T){let Y=n.resolve(G,T);if(N0.existsSync(Y))return Y;if(J.includes(n.extname(T)))return;let _=J.find((V)=>N0.existsSync(`${Y}${V}`));if(_)return`${Y}${_}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let Q=q._executableFile||`${this._name}-${q._name}`,H=this._executableDir||"";if(this._scriptPath){let G;try{G=N0.realpathSync(this._scriptPath)}catch{G=this._scriptPath}H=n.resolve(n.dirname(G),H)}if(H){let G=$(H,Q);if(!G&&!q._executableFile&&this._scriptPath){let T=n.basename(this._scriptPath,n.extname(this._scriptPath));if(T!==this._name)G=$(H,`${T}-${q._name}`)}Q=G||Q}X=J.includes(n.extname(Q));let U;if(b.platform!=="win32")if(X)Z.unshift(Q),Z=o4(b.execArgv).concat(Z),U=lq.spawn(b.argv[0],Z,{stdio:"inherit"});else U=lq.spawn(Q,Z,{stdio:"inherit"});else this._checkForMissingExecutable(Q,H,q._name),Z.unshift(Q),Z=o4(b.execArgv).concat(Z),U=lq.spawn(b.execPath,Z,{stdio:"inherit"});if(!U.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((T)=>{b.on(T,()=>{if(U.killed===!1&&U.exitCode===null)U.kill(T)})});let z=this._exitCallback;U.on("close",(G)=>{if(G=G??1,!z)b.exit(G);else z(new pq(G,"commander.executeSubCommandAsync","(close)"))}),U.on("error",(G)=>{if(G.code==="ENOENT")this._checkForMissingExecutable(Q,H,q._name);else if(G.code==="EACCES")throw Error(`'${Q}' not executable`);if(!z)b.exit(1);else{let T=new pq(1,"commander.executeSubCommandAsync","(error)");T.nestedError=G,z(T)}}),this.runningCommand=U}_dispatchSubcommand(q,Z,X){let J=this._findCommand(q);if(!J)this.help({error:!0});J._prepareForParse();let $;return $=this._chainOrCallSubCommandHook($,J,"preSubcommand"),$=this._chainOrCall($,()=>{if(J._executableHandler)this._executeSubCommand(J,Z.concat(X));else return J._parseCommand(Z,X)}),$}_dispatchHelpCommand(q){if(!q)this.help();let Z=this._findCommand(q);if(Z&&!Z._executableHandler)Z.help();return this._dispatchSubcommand(q,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){if(this.registeredArguments.forEach((q,Z)=>{if(q.required&&this.args[Z]==null)this.missingArgument(q.name())}),this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)return;if(this.args.length>this.registeredArguments.length)this._excessArguments(this.args)}_processArguments(){let q=(X,J,$)=>{let Q=J;if(J!==null&&X.parseArg){let H=`error: command-argument value '${J}' is invalid for argument '${X.name()}'.`;Q=this._callParseArg(X,J,$,H)}return Q};this._checkNumberOfArguments();let Z=[];this.registeredArguments.forEach((X,J)=>{let $=X.defaultValue;if(X.variadic){if(J<this.args.length){if($=this.args.slice(J),X.parseArg)$=$.reduce((Q,H)=>{return q(X,H,Q)},X.defaultValue)}else if($===void 0)$=[]}else if(J<this.args.length){if($=this.args[J],X.parseArg)$=q(X,$,X.defaultValue)}Z[J]=$}),this.processedArgs=Z}_chainOrCall(q,Z){if(q?.then&&typeof q.then==="function")return q.then(()=>Z());return Z()}_chainOrCallHooks(q,Z){let X=q,J=[];if(this._getCommandAndAncestors().reverse().filter(($)=>$._lifeCycleHooks[Z]!==void 0).forEach(($)=>{$._lifeCycleHooks[Z].forEach((Q)=>{J.push({hookedCommand:$,callback:Q})})}),Z==="postAction")J.reverse();return J.forEach(($)=>{X=this._chainOrCall(X,()=>{return $.callback($.hookedCommand,this)})}),X}_chainOrCallSubCommandHook(q,Z,X){let J=q;if(this._lifeCycleHooks[X]!==void 0)this._lifeCycleHooks[X].forEach(($)=>{J=this._chainOrCall(J,()=>{return $(this,Z)})});return J}_parseCommand(q,Z){let X=this.parseOptions(Z);if(this._parseOptionsEnv(),this._parseOptionsImplied(),q=q.concat(X.operands),Z=X.unknown,this.args=q.concat(Z),q&&this._findCommand(q[0]))return this._dispatchSubcommand(q[0],q.slice(1),Z);if(this._getHelpCommand()&&q[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(q[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(Z),this._dispatchSubcommand(this._defaultCommandName,q,Z);if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName)this.help({error:!0});this._outputHelpIfRequested(X.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let J=()=>{if(X.unknown.length>0)this.unknownOption(X.unknown[0])},$=`command:${this.name()}`;if(this._actionHandler){J(),this._processArguments();let Q;if(Q=this._chainOrCallHooks(Q,"preAction"),Q=this._chainOrCall(Q,()=>this._actionHandler(this.processedArgs)),this.parent)Q=this._chainOrCall(Q,()=>{this.parent.emit($,q,Z)});return Q=this._chainOrCallHooks(Q,"postAction"),Q}if(this.parent?.listenerCount($))J(),this._processArguments(),this.parent.emit($,q,Z);else if(q.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",q,Z);if(this.listenerCount("command:*"))this.emit("command:*",q,Z);else if(this.commands.length)this.unknownCommand();else J(),this._processArguments()}else if(this.commands.length)J(),this.help({error:!0});else J(),this._processArguments()}_findCommand(q){if(!q)return;return this.commands.find((Z)=>Z._name===q||Z._aliases.includes(q))}_findOption(q){return this.options.find((Z)=>Z.is(q))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach((q)=>{q.options.forEach((Z)=>{if(Z.mandatory&&q.getOptionValue(Z.attributeName())===void 0)q.missingMandatoryOptionValue(Z)})})}_checkForConflictingLocalOptions(){let q=this.options.filter((X)=>{let J=X.attributeName();if(this.getOptionValue(J)===void 0)return!1;return this.getOptionValueSource(J)!=="default"});q.filter((X)=>X.conflictsWith.length>0).forEach((X)=>{let J=q.find(($)=>X.conflictsWith.includes($.attributeName()));if(J)this._conflictingOption(X,J)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach((q)=>{q._checkForConflictingLocalOptions()})}parseOptions(q){let Z=[],X=[],J=Z;function $(G){return G.length>1&&G[0]==="-"}let Q=(G)=>{if(!/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(G))return!1;return!this._getCommandAndAncestors().some((T)=>T.options.map((Y)=>Y.short).some((Y)=>/^-\d$/.test(Y)))},H=null,U=null,z=0;while(z<q.length||U){let G=U??q[z++];if(U=null,G==="--"){if(J===X)J.push(G);J.push(...q.slice(z));break}if(H&&(!$(G)||Q(G))){this.emit(`option:${H.name()}`,G);continue}if(H=null,$(G)){let T=this._findOption(G);if(T){if(T.required){let Y=q[z++];if(Y===void 0)this.optionMissingArgument(T);this.emit(`option:${T.name()}`,Y)}else if(T.optional){let Y=null;if(z<q.length&&(!$(q[z])||Q(q[z])))Y=q[z++];this.emit(`option:${T.name()}`,Y)}else this.emit(`option:${T.name()}`);H=T.variadic?T:null;continue}}if(G.length>2&&G[0]==="-"&&G[1]!=="-"){let T=this._findOption(`-${G[1]}`);if(T){if(T.required||T.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${T.name()}`,G.slice(2));else this.emit(`option:${T.name()}`),U=`-${G.slice(2)}`;continue}}if(/^--[^=]+=/.test(G)){let T=G.indexOf("="),Y=this._findOption(G.slice(0,T));if(Y&&(Y.required||Y.optional)){this.emit(`option:${Y.name()}`,G.slice(T+1));continue}}if(J===Z&&$(G)&&!(this.commands.length===0&&Q(G)))J=X;if((this._enablePositionalOptions||this._passThroughOptions)&&Z.length===0&&X.length===0){if(this._findCommand(G)){Z.push(G),X.push(...q.slice(z));break}else if(this._getHelpCommand()&&G===this._getHelpCommand().name()){Z.push(G,...q.slice(z));break}else if(this._defaultCommandName){X.push(G,...q.slice(z));break}}if(this._passThroughOptions){J.push(G,...q.slice(z));break}J.push(G)}return{operands:Z,unknown:X}}opts(){if(this._storeOptionsAsProperties){let q={},Z=this.options.length;for(let X=0;X<Z;X++){let J=this.options[X].attributeName();q[J]=J===this._versionOptionName?this._version:this[J]}return q}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((q,Z)=>Object.assign(q,Z.opts()),{})}error(q,Z){if(this._outputConfiguration.outputError(`${q}
21
+ - ${J}`;throw Error($)}_executeSubCommand(q,Z){Z=Z.slice();let X=!1,J=[".js",".ts",".tsx",".mjs",".cjs"];function $(G,T){let Y=n.resolve(G,T);if(N0.existsSync(Y))return Y;if(J.includes(n.extname(T)))return;let _=J.find((V)=>N0.existsSync(`${Y}${V}`));if(_)return`${Y}${_}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let Q=q._executableFile||`${this._name}-${q._name}`,H=this._executableDir||"";if(this._scriptPath){let G;try{G=N0.realpathSync(this._scriptPath)}catch{G=this._scriptPath}H=n.resolve(n.dirname(G),H)}if(H){let G=$(H,Q);if(!G&&!q._executableFile&&this._scriptPath){let T=n.basename(this._scriptPath,n.extname(this._scriptPath));if(T!==this._name)G=$(H,`${T}-${q._name}`)}Q=G||Q}X=J.includes(n.extname(Q));let z;if(b.platform!=="win32")if(X)Z.unshift(Q),Z=t4(b.execArgv).concat(Z),z=lq.spawn(b.argv[0],Z,{stdio:"inherit"});else z=lq.spawn(Q,Z,{stdio:"inherit"});else this._checkForMissingExecutable(Q,H,q._name),Z.unshift(Q),Z=t4(b.execArgv).concat(Z),z=lq.spawn(b.execPath,Z,{stdio:"inherit"});if(!z.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((T)=>{b.on(T,()=>{if(z.killed===!1&&z.exitCode===null)z.kill(T)})});let U=this._exitCallback;z.on("close",(G)=>{if(G=G??1,!U)b.exit(G);else U(new pq(G,"commander.executeSubCommandAsync","(close)"))}),z.on("error",(G)=>{if(G.code==="ENOENT")this._checkForMissingExecutable(Q,H,q._name);else if(G.code==="EACCES")throw Error(`'${Q}' not executable`);if(!U)b.exit(1);else{let T=new pq(1,"commander.executeSubCommandAsync","(error)");T.nestedError=G,U(T)}}),this.runningCommand=z}_dispatchSubcommand(q,Z,X){let J=this._findCommand(q);if(!J)this.help({error:!0});J._prepareForParse();let $;return $=this._chainOrCallSubCommandHook($,J,"preSubcommand"),$=this._chainOrCall($,()=>{if(J._executableHandler)this._executeSubCommand(J,Z.concat(X));else return J._parseCommand(Z,X)}),$}_dispatchHelpCommand(q){if(!q)this.help();let Z=this._findCommand(q);if(Z&&!Z._executableHandler)Z.help();return this._dispatchSubcommand(q,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){if(this.registeredArguments.forEach((q,Z)=>{if(q.required&&this.args[Z]==null)this.missingArgument(q.name())}),this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)return;if(this.args.length>this.registeredArguments.length)this._excessArguments(this.args)}_processArguments(){let q=(X,J,$)=>{let Q=J;if(J!==null&&X.parseArg){let H=`error: command-argument value '${J}' is invalid for argument '${X.name()}'.`;Q=this._callParseArg(X,J,$,H)}return Q};this._checkNumberOfArguments();let Z=[];this.registeredArguments.forEach((X,J)=>{let $=X.defaultValue;if(X.variadic){if(J<this.args.length){if($=this.args.slice(J),X.parseArg)$=$.reduce((Q,H)=>{return q(X,H,Q)},X.defaultValue)}else if($===void 0)$=[]}else if(J<this.args.length){if($=this.args[J],X.parseArg)$=q(X,$,X.defaultValue)}Z[J]=$}),this.processedArgs=Z}_chainOrCall(q,Z){if(q?.then&&typeof q.then==="function")return q.then(()=>Z());return Z()}_chainOrCallHooks(q,Z){let X=q,J=[];if(this._getCommandAndAncestors().reverse().filter(($)=>$._lifeCycleHooks[Z]!==void 0).forEach(($)=>{$._lifeCycleHooks[Z].forEach((Q)=>{J.push({hookedCommand:$,callback:Q})})}),Z==="postAction")J.reverse();return J.forEach(($)=>{X=this._chainOrCall(X,()=>{return $.callback($.hookedCommand,this)})}),X}_chainOrCallSubCommandHook(q,Z,X){let J=q;if(this._lifeCycleHooks[X]!==void 0)this._lifeCycleHooks[X].forEach(($)=>{J=this._chainOrCall(J,()=>{return $(this,Z)})});return J}_parseCommand(q,Z){let X=this.parseOptions(Z);if(this._parseOptionsEnv(),this._parseOptionsImplied(),q=q.concat(X.operands),Z=X.unknown,this.args=q.concat(Z),q&&this._findCommand(q[0]))return this._dispatchSubcommand(q[0],q.slice(1),Z);if(this._getHelpCommand()&&q[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(q[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(Z),this._dispatchSubcommand(this._defaultCommandName,q,Z);if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName)this.help({error:!0});this._outputHelpIfRequested(X.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let J=()=>{if(X.unknown.length>0)this.unknownOption(X.unknown[0])},$=`command:${this.name()}`;if(this._actionHandler){J(),this._processArguments();let Q;if(Q=this._chainOrCallHooks(Q,"preAction"),Q=this._chainOrCall(Q,()=>this._actionHandler(this.processedArgs)),this.parent)Q=this._chainOrCall(Q,()=>{this.parent.emit($,q,Z)});return Q=this._chainOrCallHooks(Q,"postAction"),Q}if(this.parent?.listenerCount($))J(),this._processArguments(),this.parent.emit($,q,Z);else if(q.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",q,Z);if(this.listenerCount("command:*"))this.emit("command:*",q,Z);else if(this.commands.length)this.unknownCommand();else J(),this._processArguments()}else if(this.commands.length)J(),this.help({error:!0});else J(),this._processArguments()}_findCommand(q){if(!q)return;return this.commands.find((Z)=>Z._name===q||Z._aliases.includes(q))}_findOption(q){return this.options.find((Z)=>Z.is(q))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach((q)=>{q.options.forEach((Z)=>{if(Z.mandatory&&q.getOptionValue(Z.attributeName())===void 0)q.missingMandatoryOptionValue(Z)})})}_checkForConflictingLocalOptions(){let q=this.options.filter((X)=>{let J=X.attributeName();if(this.getOptionValue(J)===void 0)return!1;return this.getOptionValueSource(J)!=="default"});q.filter((X)=>X.conflictsWith.length>0).forEach((X)=>{let J=q.find(($)=>X.conflictsWith.includes($.attributeName()));if(J)this._conflictingOption(X,J)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach((q)=>{q._checkForConflictingLocalOptions()})}parseOptions(q){let Z=[],X=[],J=Z;function $(G){return G.length>1&&G[0]==="-"}let Q=(G)=>{if(!/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(G))return!1;return!this._getCommandAndAncestors().some((T)=>T.options.map((Y)=>Y.short).some((Y)=>/^-\d$/.test(Y)))},H=null,z=null,U=0;while(U<q.length||z){let G=z??q[U++];if(z=null,G==="--"){if(J===X)J.push(G);J.push(...q.slice(U));break}if(H&&(!$(G)||Q(G))){this.emit(`option:${H.name()}`,G);continue}if(H=null,$(G)){let T=this._findOption(G);if(T){if(T.required){let Y=q[U++];if(Y===void 0)this.optionMissingArgument(T);this.emit(`option:${T.name()}`,Y)}else if(T.optional){let Y=null;if(U<q.length&&(!$(q[U])||Q(q[U])))Y=q[U++];this.emit(`option:${T.name()}`,Y)}else this.emit(`option:${T.name()}`);H=T.variadic?T:null;continue}}if(G.length>2&&G[0]==="-"&&G[1]!=="-"){let T=this._findOption(`-${G[1]}`);if(T){if(T.required||T.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${T.name()}`,G.slice(2));else this.emit(`option:${T.name()}`),z=`-${G.slice(2)}`;continue}}if(/^--[^=]+=/.test(G)){let T=G.indexOf("="),Y=this._findOption(G.slice(0,T));if(Y&&(Y.required||Y.optional)){this.emit(`option:${Y.name()}`,G.slice(T+1));continue}}if(J===Z&&$(G)&&!(this.commands.length===0&&Q(G)))J=X;if((this._enablePositionalOptions||this._passThroughOptions)&&Z.length===0&&X.length===0){if(this._findCommand(G)){Z.push(G),X.push(...q.slice(U));break}else if(this._getHelpCommand()&&G===this._getHelpCommand().name()){Z.push(G,...q.slice(U));break}else if(this._defaultCommandName){X.push(G,...q.slice(U));break}}if(this._passThroughOptions){J.push(G,...q.slice(U));break}J.push(G)}return{operands:Z,unknown:X}}opts(){if(this._storeOptionsAsProperties){let q={},Z=this.options.length;for(let X=0;X<Z;X++){let J=this.options[X].attributeName();q[J]=J===this._versionOptionName?this._version:this[J]}return q}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((q,Z)=>Object.assign(q,Z.opts()),{})}error(q,Z){if(this._outputConfiguration.outputError(`${q}
22
22
  `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError==="string")this._outputConfiguration.writeErr(`${this._showHelpAfterError}
23
23
  `);else if(this._showHelpAfterError)this._outputConfiguration.writeErr(`
24
- `),this.outputHelp({error:!0});let X=Z||{},J=X.exitCode||1,$=X.code||"commander.error";this._exit(J,$,q)}_parseOptionsEnv(){this.options.forEach((q)=>{if(q.envVar&&q.envVar in b.env){let Z=q.attributeName();if(this.getOptionValue(Z)===void 0||["default","config","env"].includes(this.getOptionValueSource(Z)))if(q.required||q.optional)this.emit(`optionEnv:${q.name()}`,b.env[q.envVar]);else this.emit(`optionEnv:${q.name()}`)}})}_parseOptionsImplied(){let q=new X7(this.options),Z=(X)=>{return this.getOptionValue(X)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(X))};this.options.filter((X)=>X.implied!==void 0&&Z(X.attributeName())&&q.valueFromOption(this.getOptionValue(X.attributeName()),X)).forEach((X)=>{Object.keys(X.implied).filter((J)=>!Z(J)).forEach((J)=>{this.setOptionValueWithSource(J,X.implied[J],"implied")})})}missingArgument(q){let Z=`error: missing required argument '${q}'`;this.error(Z,{code:"commander.missingArgument"})}optionMissingArgument(q){let Z=`error: option '${q.flags}' argument missing`;this.error(Z,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(q){let Z=`error: required option '${q.flags}' not specified`;this.error(Z,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(q,Z){let X=(Q)=>{let H=Q.attributeName(),U=this.getOptionValue(H),z=this.options.find((T)=>T.negate&&H===T.attributeName()),G=this.options.find((T)=>!T.negate&&H===T.attributeName());if(z&&(z.presetArg===void 0&&U===!1||z.presetArg!==void 0&&U===z.presetArg))return z;return G||Q},J=(Q)=>{let H=X(Q),U=H.attributeName();if(this.getOptionValueSource(U)==="env")return`environment variable '${H.envVar}'`;return`option '${H.flags}'`},$=`error: ${J(q)} cannot be used with ${J(Z)}`;this.error($,{code:"commander.conflictingOption"})}unknownOption(q){if(this._allowUnknownOption)return;let Z="";if(q.startsWith("--")&&this._showSuggestionAfterError){let J=[],$=this;do{let Q=$.createHelp().visibleOptions($).filter((H)=>H.long).map((H)=>H.long);J=J.concat(Q),$=$.parent}while($&&!$._enablePositionalOptions);Z=n4(q,J)}let X=`error: unknown option '${q}'${Z}`;this.error(X,{code:"commander.unknownOption"})}_excessArguments(q){if(this._allowExcessArguments)return;let Z=this.registeredArguments.length,X=Z===1?"":"s",$=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${Z} argument${X} but got ${q.length}.`;this.error($,{code:"commander.excessArguments"})}unknownCommand(){let q=this.args[0],Z="";if(this._showSuggestionAfterError){let J=[];this.createHelp().visibleCommands(this).forEach(($)=>{if(J.push($.name()),$.alias())J.push($.alias())}),Z=n4(q,J)}let X=`error: unknown command '${q}'${Z}`;this.error(X,{code:"commander.unknownCommand"})}version(q,Z,X){if(q===void 0)return this._version;this._version=q,Z=Z||"-V, --version",X=X||"output the version number";let J=this.createOption(Z,X);return this._versionOptionName=J.attributeName(),this._registerOption(J),this.on("option:"+J.name(),()=>{this._outputConfiguration.writeOut(`${q}
25
- `),this._exit(0,"commander.version",q)}),this}description(q,Z){if(q===void 0&&Z===void 0)return this._description;if(this._description=q,Z)this._argsDescription=Z;return this}summary(q){if(q===void 0)return this._summary;return this._summary=q,this}alias(q){if(q===void 0)return this._aliases[0];let Z=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)Z=this.commands[this.commands.length-1];if(q===Z._name)throw Error("Command alias can't be the same as its name");let X=this.parent?._findCommand(q);if(X){let J=[X.name()].concat(X.aliases()).join("|");throw Error(`cannot add alias '${q}' to command '${this.name()}' as already have command '${J}'`)}return Z._aliases.push(q),this}aliases(q){if(q===void 0)return this._aliases;return q.forEach((Z)=>this.alias(Z)),this}usage(q){if(q===void 0){if(this._usage)return this._usage;let Z=this.registeredArguments.map((X)=>{return e6(X)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?Z:[]).join(" ")}return this._usage=q,this}name(q){if(q===void 0)return this._name;return this._name=q,this}helpGroup(q){if(q===void 0)return this._helpGroupHeading??"";return this._helpGroupHeading=q,this}commandsGroup(q){if(q===void 0)return this._defaultCommandGroup??"";return this._defaultCommandGroup=q,this}optionsGroup(q){if(q===void 0)return this._defaultOptionGroup??"";return this._defaultOptionGroup=q,this}_initOptionGroup(q){if(this._defaultOptionGroup&&!q.helpGroupHeading)q.helpGroup(this._defaultOptionGroup)}_initCommandGroup(q){if(this._defaultCommandGroup&&!q.helpGroup())q.helpGroup(this._defaultCommandGroup)}nameFromFilename(q){return this._name=n.basename(q,n.extname(q)),this}executableDir(q){if(q===void 0)return this._executableDir;return this._executableDir=q,this}helpInformation(q){let Z=this.createHelp(),X=this._getOutputContext(q);Z.prepareContext({error:X.error,helpWidth:X.helpWidth,outputHasColors:X.hasColors});let J=Z.formatHelp(this,Z);if(X.hasColors)return J;return this._outputConfiguration.stripColor(J)}_getOutputContext(q){q=q||{};let Z=!!q.error,X,J,$;if(Z)X=(H)=>this._outputConfiguration.writeErr(H),J=this._outputConfiguration.getErrHasColors(),$=this._outputConfiguration.getErrHelpWidth();else X=(H)=>this._outputConfiguration.writeOut(H),J=this._outputConfiguration.getOutHasColors(),$=this._outputConfiguration.getOutHelpWidth();return{error:Z,write:(H)=>{if(!J)H=this._outputConfiguration.stripColor(H);return X(H)},hasColors:J,helpWidth:$}}outputHelp(q){let Z;if(typeof q==="function")Z=q,q=void 0;let X=this._getOutputContext(q),J={error:X.error,write:X.write,command:this};this._getCommandAndAncestors().reverse().forEach((Q)=>Q.emit("beforeAllHelp",J)),this.emit("beforeHelp",J);let $=this.helpInformation({error:X.error});if(Z){if($=Z($),typeof $!=="string"&&!Buffer.isBuffer($))throw Error("outputHelp callback must return a string or a Buffer")}if(X.write($),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",J),this._getCommandAndAncestors().forEach((Q)=>Q.emit("afterAllHelp",J))}helpOption(q,Z){if(typeof q==="boolean"){if(q){if(this._helpOption===null)this._helpOption=void 0;if(this._defaultOptionGroup)this._initOptionGroup(this._getHelpOption())}else this._helpOption=null;return this}if(this._helpOption=this.createOption(q??"-h, --help",Z??"display help for command"),q||Z)this._initOptionGroup(this._helpOption);return this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption(q){return this._helpOption=q,this._initOptionGroup(q),this}help(q){this.outputHelp(q);let Z=Number(b.exitCode??0);if(Z===0&&q&&typeof q!=="function"&&q.error)Z=1;this._exit(Z,"commander.help","(outputHelp)")}addHelpText(q,Z){let X=["beforeAll","before","after","afterAll"];if(!X.includes(q))throw Error(`Unexpected value for position to addHelpText.
24
+ `),this.outputHelp({error:!0});let X=Z||{},J=X.exitCode||1,$=X.code||"commander.error";this._exit(J,$,q)}_parseOptionsEnv(){this.options.forEach((q)=>{if(q.envVar&&q.envVar in b.env){let Z=q.attributeName();if(this.getOptionValue(Z)===void 0||["default","config","env"].includes(this.getOptionValueSource(Z)))if(q.required||q.optional)this.emit(`optionEnv:${q.name()}`,b.env[q.envVar]);else this.emit(`optionEnv:${q.name()}`)}})}_parseOptionsImplied(){let q=new U7(this.options),Z=(X)=>{return this.getOptionValue(X)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(X))};this.options.filter((X)=>X.implied!==void 0&&Z(X.attributeName())&&q.valueFromOption(this.getOptionValue(X.attributeName()),X)).forEach((X)=>{Object.keys(X.implied).filter((J)=>!Z(J)).forEach((J)=>{this.setOptionValueWithSource(J,X.implied[J],"implied")})})}missingArgument(q){let Z=`error: missing required argument '${q}'`;this.error(Z,{code:"commander.missingArgument"})}optionMissingArgument(q){let Z=`error: option '${q.flags}' argument missing`;this.error(Z,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(q){let Z=`error: required option '${q.flags}' not specified`;this.error(Z,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(q,Z){let X=(Q)=>{let H=Q.attributeName(),z=this.getOptionValue(H),U=this.options.find((T)=>T.negate&&H===T.attributeName()),G=this.options.find((T)=>!T.negate&&H===T.attributeName());if(U&&(U.presetArg===void 0&&z===!1||U.presetArg!==void 0&&z===U.presetArg))return U;return G||Q},J=(Q)=>{let H=X(Q),z=H.attributeName();if(this.getOptionValueSource(z)==="env")return`environment variable '${H.envVar}'`;return`option '${H.flags}'`},$=`error: ${J(q)} cannot be used with ${J(Z)}`;this.error($,{code:"commander.conflictingOption"})}unknownOption(q){if(this._allowUnknownOption)return;let Z="";if(q.startsWith("--")&&this._showSuggestionAfterError){let J=[],$=this;do{let Q=$.createHelp().visibleOptions($).filter((H)=>H.long).map((H)=>H.long);J=J.concat(Q),$=$.parent}while($&&!$._enablePositionalOptions);Z=o4(q,J)}let X=`error: unknown option '${q}'${Z}`;this.error(X,{code:"commander.unknownOption"})}_excessArguments(q){if(this._allowExcessArguments)return;let Z=this.registeredArguments.length,X=Z===1?"":"s",$=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${Z} argument${X} but got ${q.length}.`;this.error($,{code:"commander.excessArguments"})}unknownCommand(){let q=this.args[0],Z="";if(this._showSuggestionAfterError){let J=[];this.createHelp().visibleCommands(this).forEach(($)=>{if(J.push($.name()),$.alias())J.push($.alias())}),Z=o4(q,J)}let X=`error: unknown command '${q}'${Z}`;this.error(X,{code:"commander.unknownCommand"})}version(q,Z,X){if(q===void 0)return this._version;this._version=q,Z=Z||"-V, --version",X=X||"output the version number";let J=this.createOption(Z,X);return this._versionOptionName=J.attributeName(),this._registerOption(J),this.on("option:"+J.name(),()=>{this._outputConfiguration.writeOut(`${q}
25
+ `),this._exit(0,"commander.version",q)}),this}description(q,Z){if(q===void 0&&Z===void 0)return this._description;if(this._description=q,Z)this._argsDescription=Z;return this}summary(q){if(q===void 0)return this._summary;return this._summary=q,this}alias(q){if(q===void 0)return this._aliases[0];let Z=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)Z=this.commands[this.commands.length-1];if(q===Z._name)throw Error("Command alias can't be the same as its name");let X=this.parent?._findCommand(q);if(X){let J=[X.name()].concat(X.aliases()).join("|");throw Error(`cannot add alias '${q}' to command '${this.name()}' as already have command '${J}'`)}return Z._aliases.push(q),this}aliases(q){if(q===void 0)return this._aliases;return q.forEach((Z)=>this.alias(Z)),this}usage(q){if(q===void 0){if(this._usage)return this._usage;let Z=this.registeredArguments.map((X)=>{return Q7(X)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?Z:[]).join(" ")}return this._usage=q,this}name(q){if(q===void 0)return this._name;return this._name=q,this}helpGroup(q){if(q===void 0)return this._helpGroupHeading??"";return this._helpGroupHeading=q,this}commandsGroup(q){if(q===void 0)return this._defaultCommandGroup??"";return this._defaultCommandGroup=q,this}optionsGroup(q){if(q===void 0)return this._defaultOptionGroup??"";return this._defaultOptionGroup=q,this}_initOptionGroup(q){if(this._defaultOptionGroup&&!q.helpGroupHeading)q.helpGroup(this._defaultOptionGroup)}_initCommandGroup(q){if(this._defaultCommandGroup&&!q.helpGroup())q.helpGroup(this._defaultCommandGroup)}nameFromFilename(q){return this._name=n.basename(q,n.extname(q)),this}executableDir(q){if(q===void 0)return this._executableDir;return this._executableDir=q,this}helpInformation(q){let Z=this.createHelp(),X=this._getOutputContext(q);Z.prepareContext({error:X.error,helpWidth:X.helpWidth,outputHasColors:X.hasColors});let J=Z.formatHelp(this,Z);if(X.hasColors)return J;return this._outputConfiguration.stripColor(J)}_getOutputContext(q){q=q||{};let Z=!!q.error,X,J,$;if(Z)X=(H)=>this._outputConfiguration.writeErr(H),J=this._outputConfiguration.getErrHasColors(),$=this._outputConfiguration.getErrHelpWidth();else X=(H)=>this._outputConfiguration.writeOut(H),J=this._outputConfiguration.getOutHasColors(),$=this._outputConfiguration.getOutHelpWidth();return{error:Z,write:(H)=>{if(!J)H=this._outputConfiguration.stripColor(H);return X(H)},hasColors:J,helpWidth:$}}outputHelp(q){let Z;if(typeof q==="function")Z=q,q=void 0;let X=this._getOutputContext(q),J={error:X.error,write:X.write,command:this};this._getCommandAndAncestors().reverse().forEach((Q)=>Q.emit("beforeAllHelp",J)),this.emit("beforeHelp",J);let $=this.helpInformation({error:X.error});if(Z){if($=Z($),typeof $!=="string"&&!Buffer.isBuffer($))throw Error("outputHelp callback must return a string or a Buffer")}if(X.write($),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",J),this._getCommandAndAncestors().forEach((Q)=>Q.emit("afterAllHelp",J))}helpOption(q,Z){if(typeof q==="boolean"){if(q){if(this._helpOption===null)this._helpOption=void 0;if(this._defaultOptionGroup)this._initOptionGroup(this._getHelpOption())}else this._helpOption=null;return this}if(this._helpOption=this.createOption(q??"-h, --help",Z??"display help for command"),q||Z)this._initOptionGroup(this._helpOption);return this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption(q){return this._helpOption=q,this._initOptionGroup(q),this}help(q){this.outputHelp(q);let Z=Number(b.exitCode??0);if(Z===0&&q&&typeof q!=="function"&&q.error)Z=1;this._exit(Z,"commander.help","(outputHelp)")}addHelpText(q,Z){let X=["beforeAll","before","after","afterAll"];if(!X.includes(q))throw Error(`Unexpected value for position to addHelpText.
26
26
  Expecting one of '${X.join("', '")}'`);let J=`${q}Help`;return this.on(J,($)=>{let Q;if(typeof Z==="function")Q=Z({error:$.error,command:$.command});else Q=Z;if(Q)$.write(`${Q}
27
- `)}),this}_outputHelpIfRequested(q){let Z=this._getHelpOption();if(Z&&q.find((J)=>Z.is(J)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function o4(q){return q.map((Z)=>{if(!Z.startsWith("--inspect"))return Z;let X,J="127.0.0.1",$="9229",Q;if((Q=Z.match(/^(--inspect(-brk)?)$/))!==null)X=Q[1];else if((Q=Z.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(X=Q[1],/^\d+$/.test(Q[3]))$=Q[3];else J=Q[3];else if((Q=Z.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)X=Q[1],J=Q[3],$=Q[4];if(X&&$!=="0")return`${X}=${J}:${parseInt($)+1}`;return Z})}function cq(){if(b.env.NO_COLOR||b.env.FORCE_COLOR==="0"||b.env.FORCE_COLOR==="false")return!1;if(b.env.FORCE_COLOR||b.env.CLICOLOR_FORCE!==void 0)return!0;return}J7.Command=iq;J7.useColor=cq});var X2=P((z7)=>{var{Argument:e4}=O0(),{Command:aq}=t4(),{CommanderError:H7,InvalidArgumentError:q2}=d1(),{Help:U7}=mq(),{Option:Z2}=dq();z7.program=new aq;z7.createCommand=(q)=>new aq(q);z7.createOption=(q,Z)=>new Z2(q,Z);z7.createArgument=(q,Z)=>new e4(q,Z);z7.Command=aq;z7.Option=Z2;z7.Argument=e4;z7.Help=U7;z7.CommanderError=H7;z7.InvalidArgumentError=q2;z7.InvalidOptionArgumentError=q2});var S=P((u7)=>{var nq=Symbol.for("yaml.alias"),B2=Symbol.for("yaml.document"),b0=Symbol.for("yaml.map"),T2=Symbol.for("yaml.pair"),oq=Symbol.for("yaml.scalar"),j0=Symbol.for("yaml.seq"),t=Symbol.for("yaml.node.type"),f7=(q)=>!!q&&typeof q==="object"&&q[t]===nq,y7=(q)=>!!q&&typeof q==="object"&&q[t]===B2,x7=(q)=>!!q&&typeof q==="object"&&q[t]===b0,k7=(q)=>!!q&&typeof q==="object"&&q[t]===T2,_2=(q)=>!!q&&typeof q==="object"&&q[t]===oq,v7=(q)=>!!q&&typeof q==="object"&&q[t]===j0;function L2(q){if(q&&typeof q==="object")switch(q[t]){case b0:case j0:return!0}return!1}function h7(q){if(q&&typeof q==="object")switch(q[t]){case nq:case b0:case oq:case j0:return!0}return!1}var g7=(q)=>(_2(q)||L2(q))&&!!q.anchor;u7.ALIAS=nq;u7.DOC=B2;u7.MAP=b0;u7.NODE_TYPE=t;u7.PAIR=T2;u7.SCALAR=oq;u7.SEQ=j0;u7.hasAnchor=g7;u7.isAlias=f7;u7.isCollection=L2;u7.isDocument=y7;u7.isMap=x7;u7.isNode=h7;u7.isPair=k7;u7.isScalar=_2;u7.isSeq=v7});var l1=P((J8)=>{var k=S(),v=Symbol("break visit"),W2=Symbol("skip children"),a=Symbol("remove node");function E0(q,Z){let X=V2(Z);if(k.isDocument(q)){if(A1(null,q.contents,X,Object.freeze([q]))===a)q.contents=null}else A1(null,q,X,Object.freeze([]))}E0.BREAK=v;E0.SKIP=W2;E0.REMOVE=a;function A1(q,Z,X,J){let $=R2(q,Z,X,J);if(k.isNode($)||k.isPair($))return I2(q,J,$),A1(q,$,X,J);if(typeof $!=="symbol"){if(k.isCollection(Z)){J=Object.freeze(J.concat(Z));for(let Q=0;Q<Z.items.length;++Q){let H=A1(Q,Z.items[Q],X,J);if(typeof H==="number")Q=H-1;else if(H===v)return v;else if(H===a)Z.items.splice(Q,1),Q-=1}}else if(k.isPair(Z)){J=Object.freeze(J.concat(Z));let Q=A1("key",Z.key,X,J);if(Q===v)return v;else if(Q===a)Z.key=null;let H=A1("value",Z.value,X,J);if(H===v)return v;else if(H===a)Z.value=null}}return $}async function C0(q,Z){let X=V2(Z);if(k.isDocument(q)){if(await S1(null,q.contents,X,Object.freeze([q]))===a)q.contents=null}else await S1(null,q,X,Object.freeze([]))}C0.BREAK=v;C0.SKIP=W2;C0.REMOVE=a;async function S1(q,Z,X,J){let $=await R2(q,Z,X,J);if(k.isNode($)||k.isPair($))return I2(q,J,$),S1(q,$,X,J);if(typeof $!=="symbol"){if(k.isCollection(Z)){J=Object.freeze(J.concat(Z));for(let Q=0;Q<Z.items.length;++Q){let H=await S1(Q,Z.items[Q],X,J);if(typeof H==="number")Q=H-1;else if(H===v)return v;else if(H===a)Z.items.splice(Q,1),Q-=1}}else if(k.isPair(Z)){J=Object.freeze(J.concat(Z));let Q=await S1("key",Z.key,X,J);if(Q===v)return v;else if(Q===a)Z.key=null;let H=await S1("value",Z.value,X,J);if(H===v)return v;else if(H===a)Z.value=null}}return $}function V2(q){if(typeof q==="object"&&(q.Collection||q.Node||q.Value))return Object.assign({Alias:q.Node,Map:q.Node,Scalar:q.Node,Seq:q.Node},q.Value&&{Map:q.Value,Scalar:q.Value,Seq:q.Value},q.Collection&&{Map:q.Collection,Seq:q.Collection},q);return q}function R2(q,Z,X,J){if(typeof X==="function")return X(q,Z,J);if(k.isMap(Z))return X.Map?.(q,Z,J);if(k.isSeq(Z))return X.Seq?.(q,Z,J);if(k.isPair(Z))return X.Pair?.(q,Z,J);if(k.isScalar(Z))return X.Scalar?.(q,Z,J);if(k.isAlias(Z))return X.Alias?.(q,Z,J);return}function I2(q,Z,X){let J=Z[Z.length-1];if(k.isCollection(J))J.items[q]=X;else if(k.isPair(J))if(q==="key")J.key=X;else J.value=X;else if(k.isDocument(J))J.contents=X;else{let $=k.isAlias(J)?"alias":"scalar";throw Error(`Cannot replace node with ${$} parent`)}}J8.visit=E0;J8.visitAsync=C0});var tq=P((G8)=>{var M2=S(),H8=l1(),U8={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},z8=(q)=>q.replace(/[!,[\]{}]/g,(Z)=>U8[Z]);class g{constructor(q,Z){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},g.defaultYaml,q),this.tags=Object.assign({},g.defaultTags,Z)}clone(){let q=new g(this.yaml,this.tags);return q.docStart=this.docStart,q}atDocument(){let q=new g(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:g.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},g.defaultTags);break}return q}add(q,Z){if(this.atNextDocument)this.yaml={explicit:g.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},g.defaultTags),this.atNextDocument=!1;let X=q.trim().split(/[ \t]+/),J=X.shift();switch(J){case"%TAG":{if(X.length!==2){if(Z(0,"%TAG directive should contain exactly two parts"),X.length<2)return!1}let[$,Q]=X;return this.tags[$]=Q,!0}case"%YAML":{if(this.yaml.explicit=!0,X.length!==1)return Z(0,"%YAML directive should contain exactly one part"),!1;let[$]=X;if($==="1.1"||$==="1.2")return this.yaml.version=$,!0;else{let Q=/^\d+\.\d+$/.test($);return Z(6,`Unsupported YAML version ${$}`,Q),!1}}default:return Z(0,`Unknown directive ${J}`,!0),!1}}tagName(q,Z){if(q==="!")return"!";if(q[0]!=="!")return Z(`Not a valid tag: ${q}`),null;if(q[1]==="<"){let Q=q.slice(2,-1);if(Q==="!"||Q==="!!")return Z(`Verbatim tags aren't resolved, so ${q} is invalid.`),null;if(q[q.length-1]!==">")Z("Verbatim tags must end with a >");return Q}let[,X,J]=q.match(/^(.*!)([^!]*)$/s);if(!J)Z(`The ${q} tag has no suffix`);let $=this.tags[X];if($)try{return $+decodeURIComponent(J)}catch(Q){return Z(String(Q)),null}if(X==="!")return q;return Z(`Could not resolve tag: ${q}`),null}tagString(q){for(let[Z,X]of Object.entries(this.tags))if(q.startsWith(X))return Z+z8(q.substring(X.length));return q[0]==="!"?q:`!<${q}>`}toString(q){let Z=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],X=Object.entries(this.tags),J;if(q&&X.length>0&&M2.isNode(q.contents)){let $={};H8.visit(q.contents,(Q,H)=>{if(M2.isNode(H)&&H.tag)$[H.tag]=!0}),J=Object.keys($)}else J=[];for(let[$,Q]of X){if($==="!!"&&Q==="tag:yaml.org,2002:")continue;if(!q||J.some((H)=>H.startsWith(Q)))Z.push(`%TAG ${$} ${Q}`)}return Z.join(`
28
- `)}}g.defaultYaml={explicit:!1,version:"1.2"};g.defaultTags={"!!":"tag:yaml.org,2002:"};G8.Directives=g});var f0=P((L8)=>{var K2=S(),B8=l1();function T8(q){if(/[\x00-\x19\s,[\]{}]/.test(q)){let X=`Anchor must not contain whitespace or control characters: ${JSON.stringify(q)}`;throw Error(X)}return!0}function D2(q){let Z=new Set;return B8.visit(q,{Value(X,J){if(J.anchor)Z.add(J.anchor)}}),Z}function P2(q,Z){for(let X=1;;++X){let J=`${q}${X}`;if(!Z.has(J))return J}}function _8(q,Z){let X=[],J=new Map,$=null;return{onAnchor:(Q)=>{X.push(Q),$??($=D2(q));let H=P2(Z,$);return $.add(H),H},setAnchors:()=>{for(let Q of X){let H=J.get(Q);if(typeof H==="object"&&H.anchor&&(K2.isScalar(H.node)||K2.isCollection(H.node)))H.node.anchor=H.anchor;else{let U=Error("Failed to resolve repeated object (this should not happen)");throw U.source=Q,U}}},sourceObjects:J}}L8.anchorIsValid=T8;L8.anchorNames=D2;L8.createNodeAnchors=_8;L8.findNewAnchor=P2});var eq=P((M8)=>{function p1(q,Z,X,J){if(J&&typeof J==="object")if(Array.isArray(J))for(let $=0,Q=J.length;$<Q;++$){let H=J[$],U=p1(q,J,String($),H);if(U===void 0)delete J[$];else if(U!==H)J[$]=U}else if(J instanceof Map)for(let $ of Array.from(J.keys())){let Q=J.get($),H=p1(q,J,$,Q);if(H===void 0)J.delete($);else if(H!==Q)J.set($,H)}else if(J instanceof Set)for(let $ of Array.from(J)){let Q=p1(q,J,$,$);if(Q===void 0)J.delete($);else if(Q!==$)J.delete($),J.add(Q)}else for(let[$,Q]of Object.entries(J)){let H=p1(q,J,$,Q);if(H===void 0)delete J[$];else if(H!==Q)J[$]=H}return q.call(Z,X,J)}M8.applyReviver=p1});var Z1=P((P8)=>{var D8=S();function F2(q,Z,X){if(Array.isArray(q))return q.map((J,$)=>F2(J,String($),X));if(q&&typeof q.toJSON==="function"){if(!X||!D8.hasAnchor(q))return q.toJSON(Z,X);let J={aliasCount:0,count:1,res:void 0};X.anchors.set(q,J),X.onCreate=(Q)=>{J.res=Q,delete X.onCreate};let $=q.toJSON(Z,X);if(X.onCreate)X.onCreate($);return $}if(typeof q==="bigint"&&!X?.keep)return Number(q);return q}P8.toJS=F2});var y0=P((A8)=>{var O8=eq(),O2=S(),N8=Z1();class N2{constructor(q){Object.defineProperty(this,O2.NODE_TYPE,{value:q})}clone(){let q=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)q.range=this.range.slice();return q}toJS(q,{mapAsMap:Z,maxAliasCount:X,onAnchor:J,reviver:$}={}){if(!O2.isDocument(q))throw TypeError("A document argument is required");let Q={anchors:new Map,doc:q,keep:!0,mapAsMap:Z===!0,mapKeyWarned:!1,maxAliasCount:typeof X==="number"?X:100},H=N8.toJS(this,"",Q);if(typeof J==="function")for(let{count:U,res:z}of Q.anchors.values())J(z,U);return typeof $==="function"?O8.applyReviver($,{"":H},"",H):H}}A8.NodeBase=N2});var c1=P((C8)=>{var w8=f0(),b8=l1(),w1=S(),j8=y0(),E8=Z1();class A2 extends j8.NodeBase{constructor(q){super(w1.ALIAS);this.source=q,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve(q,Z){let X;if(Z?.aliasResolveCache)X=Z.aliasResolveCache;else if(X=[],b8.visit(q,{Node:($,Q)=>{if(w1.isAlias(Q)||w1.hasAnchor(Q))X.push(Q)}}),Z)Z.aliasResolveCache=X;let J=void 0;for(let $ of X){if($===this)break;if($.anchor===this.source)J=$}return J}toJSON(q,Z){if(!Z)return{source:this.source};let{anchors:X,doc:J,maxAliasCount:$}=Z,Q=this.resolve(J,Z);if(!Q){let U=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(U)}let H=X.get(Q);if(!H)E8.toJS(Q,null,Z),H=X.get(Q);if(H?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if($>=0){if(H.count+=1,H.aliasCount===0)H.aliasCount=x0(J,Q,X);if(H.count*H.aliasCount>$)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return H.res}toString(q,Z,X){let J=`*${this.source}`;if(q){if(w8.anchorIsValid(this.source),q.options.verifyAliasOrder&&!q.anchors.has(this.source)){let $=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error($)}if(q.implicitKey)return`${J} `}return J}}function x0(q,Z,X){if(w1.isAlias(Z)){let J=Z.resolve(q),$=X&&J&&X.get(J);return $?$.count*$.aliasCount:0}else if(w1.isCollection(Z)){let J=0;for(let $ of Z.items){let Q=x0(q,$,X);if(Q>J)J=Q}return J}else if(w1.isPair(Z)){let J=x0(q,Z.key,X),$=x0(q,Z.value,X);return Math.max(J,$)}return 1}C8.Alias=A2});var C=P((h8)=>{var y8=S(),x8=y0(),k8=Z1(),v8=(q)=>!q||typeof q!=="function"&&typeof q!=="object";class V1 extends x8.NodeBase{constructor(q){super(y8.SCALAR);this.value=q}toJSON(q,Z){return Z?.keep?this.value:k8.toJS(this.value,q,Z)}toString(){return String(this.value)}}V1.BLOCK_FOLDED="BLOCK_FOLDED";V1.BLOCK_LITERAL="BLOCK_LITERAL";V1.PLAIN="PLAIN";V1.QUOTE_DOUBLE="QUOTE_DOUBLE";V1.QUOTE_SINGLE="QUOTE_SINGLE";h8.Scalar=V1;h8.isScalarValue=v8});var i1=P((c8)=>{var m8=c1(),R1=S(),S2=C(),d8="tag:yaml.org,2002:";function l8(q,Z,X){if(Z){let J=X.filter((Q)=>Q.tag===Z),$=J.find((Q)=>!Q.format)??J[0];if(!$)throw Error(`Tag ${Z} not found`);return $}return X.find((J)=>J.identify?.(q)&&!J.format)}function p8(q,Z,X){if(R1.isDocument(q))q=q.contents;if(R1.isNode(q))return q;if(R1.isPair(q)){let Y=X.schema[R1.MAP].createNode?.(X.schema,null,X);return Y.items.push(q),Y}if(q instanceof String||q instanceof Number||q instanceof Boolean||typeof BigInt<"u"&&q instanceof BigInt)q=q.valueOf();let{aliasDuplicateObjects:J,onAnchor:$,onTagObj:Q,schema:H,sourceObjects:U}=X,z=void 0;if(J&&q&&typeof q==="object")if(z=U.get(q),z)return z.anchor??(z.anchor=$(q)),new m8.Alias(z.anchor);else z={anchor:null,node:null},U.set(q,z);if(Z?.startsWith("!!"))Z=d8+Z.slice(2);let G=l8(q,Z,H.tags);if(!G){if(q&&typeof q.toJSON==="function")q=q.toJSON();if(!q||typeof q!=="object"){let Y=new S2.Scalar(q);if(z)z.node=Y;return Y}G=q instanceof Map?H[R1.MAP]:(Symbol.iterator in Object(q))?H[R1.SEQ]:H[R1.MAP]}if(Q)Q(G),delete X.onTagObj;let T=G?.createNode?G.createNode(X.schema,q,X):typeof G?.nodeClass?.from==="function"?G.nodeClass.from(X.schema,q,X):new S2.Scalar(q);if(Z)T.tag=Z;else if(!G.default)T.tag=G.tag;if(z)z.node=T;return T}c8.createNode=p8});var k0=P((r8)=>{var a8=i1(),s=S(),s8=y0();function q9(q,Z,X){let J=X;for(let $=Z.length-1;$>=0;--$){let Q=Z[$];if(typeof Q==="number"&&Number.isInteger(Q)&&Q>=0){let H=[];H[Q]=J,J=H}else J=new Map([[Q,J]])}return a8.createNode(J,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:q,sourceObjects:new Map})}var w2=(q)=>q==null||typeof q==="object"&&!!q[Symbol.iterator]().next().done;class b2 extends s8.NodeBase{constructor(q,Z){super(q);Object.defineProperty(this,"schema",{value:Z,configurable:!0,enumerable:!1,writable:!0})}clone(q){let Z=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(q)Z.schema=q;if(Z.items=Z.items.map((X)=>s.isNode(X)||s.isPair(X)?X.clone(q):X),this.range)Z.range=this.range.slice();return Z}addIn(q,Z){if(w2(q))this.add(Z);else{let[X,...J]=q,$=this.get(X,!0);if(s.isCollection($))$.addIn(J,Z);else if($===void 0&&this.schema)this.set(X,q9(this.schema,J,Z));else throw Error(`Expected YAML collection at ${X}. Remaining path: ${J}`)}}deleteIn(q){let[Z,...X]=q;if(X.length===0)return this.delete(Z);let J=this.get(Z,!0);if(s.isCollection(J))return J.deleteIn(X);else throw Error(`Expected YAML collection at ${Z}. Remaining path: ${X}`)}getIn(q,Z){let[X,...J]=q,$=this.get(X,!0);if(J.length===0)return!Z&&s.isScalar($)?$.value:$;else return s.isCollection($)?$.getIn(J,Z):void 0}hasAllNullValues(q){return this.items.every((Z)=>{if(!s.isPair(Z))return!1;let X=Z.value;return X==null||q&&s.isScalar(X)&&X.value==null&&!X.commentBefore&&!X.comment&&!X.tag})}hasIn(q){let[Z,...X]=q;if(X.length===0)return this.has(Z);let J=this.get(Z,!0);return s.isCollection(J)?J.hasIn(X):!1}setIn(q,Z){let[X,...J]=q;if(J.length===0)this.set(X,Z);else{let $=this.get(X,!0);if(s.isCollection($))$.setIn(J,Z);else if($===void 0&&this.schema)this.set(X,q9(this.schema,J,Z));else throw Error(`Expected YAML collection at ${X}. Remaining path: ${J}`)}}}r8.Collection=b2;r8.collectionFromPath=q9;r8.isEmptyPath=w2});var a1=P((ZZ)=>{var e8=(q)=>q.replace(/^(?!$)(?: $)?/gm,"#");function Z9(q,Z){if(/^\n+$/.test(q))return q.substring(1);return Z?q.replace(/^(?! *$)/gm,Z):q}var qZ=(q,Z,X)=>q.endsWith(`
27
+ `)}),this}_outputHelpIfRequested(q){let Z=this._getHelpOption();if(Z&&q.find((J)=>Z.is(J)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function t4(q){return q.map((Z)=>{if(!Z.startsWith("--inspect"))return Z;let X,J="127.0.0.1",$="9229",Q;if((Q=Z.match(/^(--inspect(-brk)?)$/))!==null)X=Q[1];else if((Q=Z.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(X=Q[1],/^\d+$/.test(Q[3]))$=Q[3];else J=Q[3];else if((Q=Z.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)X=Q[1],J=Q[3],$=Q[4];if(X&&$!=="0")return`${X}=${J}:${parseInt($)+1}`;return Z})}function cq(){if(b.env.NO_COLOR||b.env.FORCE_COLOR==="0"||b.env.FORCE_COLOR==="false")return!1;if(b.env.FORCE_COLOR||b.env.CLICOLOR_FORCE!==void 0)return!0;return}G7.Command=iq;G7.useColor=cq});var J2=P((W7)=>{var{Argument:q2}=O0(),{Command:aq}=e4(),{CommanderError:T7,InvalidArgumentError:Z2}=d1(),{Help:_7}=mq(),{Option:X2}=dq();W7.program=new aq;W7.createCommand=(q)=>new aq(q);W7.createOption=(q,Z)=>new X2(q,Z);W7.createArgument=(q,Z)=>new q2(q,Z);W7.Command=aq;W7.Option=X2;W7.Argument=q2;W7.Help=_7;W7.CommanderError=T7;W7.InvalidArgumentError=Z2;W7.InvalidOptionArgumentError=Z2});var A=P((i7)=>{var nq=Symbol.for("yaml.alias"),_2=Symbol.for("yaml.document"),b0=Symbol.for("yaml.map"),W2=Symbol.for("yaml.pair"),oq=Symbol.for("yaml.scalar"),j0=Symbol.for("yaml.seq"),t=Symbol.for("yaml.node.type"),g7=(q)=>!!q&&typeof q==="object"&&q[t]===nq,u7=(q)=>!!q&&typeof q==="object"&&q[t]===_2,m7=(q)=>!!q&&typeof q==="object"&&q[t]===b0,d7=(q)=>!!q&&typeof q==="object"&&q[t]===W2,L2=(q)=>!!q&&typeof q==="object"&&q[t]===oq,l7=(q)=>!!q&&typeof q==="object"&&q[t]===j0;function V2(q){if(q&&typeof q==="object")switch(q[t]){case b0:case j0:return!0}return!1}function p7(q){if(q&&typeof q==="object")switch(q[t]){case nq:case b0:case oq:case j0:return!0}return!1}var c7=(q)=>(L2(q)||V2(q))&&!!q.anchor;i7.ALIAS=nq;i7.DOC=_2;i7.MAP=b0;i7.NODE_TYPE=t;i7.PAIR=W2;i7.SCALAR=oq;i7.SEQ=j0;i7.hasAnchor=c7;i7.isAlias=g7;i7.isCollection=V2;i7.isDocument=u7;i7.isMap=m7;i7.isNode=p7;i7.isPair=d7;i7.isScalar=L2;i7.isSeq=l7});var l1=P((G8)=>{var k=A(),v=Symbol("break visit"),R2=Symbol("skip children"),a=Symbol("remove node");function E0(q,Z){let X=I2(Z);if(k.isDocument(q)){if(S1(null,q.contents,X,Object.freeze([q]))===a)q.contents=null}else S1(null,q,X,Object.freeze([]))}E0.BREAK=v;E0.SKIP=R2;E0.REMOVE=a;function S1(q,Z,X,J){let $=M2(q,Z,X,J);if(k.isNode($)||k.isPair($))return K2(q,J,$),S1(q,$,X,J);if(typeof $!=="symbol"){if(k.isCollection(Z)){J=Object.freeze(J.concat(Z));for(let Q=0;Q<Z.items.length;++Q){let H=S1(Q,Z.items[Q],X,J);if(typeof H==="number")Q=H-1;else if(H===v)return v;else if(H===a)Z.items.splice(Q,1),Q-=1}}else if(k.isPair(Z)){J=Object.freeze(J.concat(Z));let Q=S1("key",Z.key,X,J);if(Q===v)return v;else if(Q===a)Z.key=null;let H=S1("value",Z.value,X,J);if(H===v)return v;else if(H===a)Z.value=null}}return $}async function C0(q,Z){let X=I2(Z);if(k.isDocument(q)){if(await A1(null,q.contents,X,Object.freeze([q]))===a)q.contents=null}else await A1(null,q,X,Object.freeze([]))}C0.BREAK=v;C0.SKIP=R2;C0.REMOVE=a;async function A1(q,Z,X,J){let $=await M2(q,Z,X,J);if(k.isNode($)||k.isPair($))return K2(q,J,$),A1(q,$,X,J);if(typeof $!=="symbol"){if(k.isCollection(Z)){J=Object.freeze(J.concat(Z));for(let Q=0;Q<Z.items.length;++Q){let H=await A1(Q,Z.items[Q],X,J);if(typeof H==="number")Q=H-1;else if(H===v)return v;else if(H===a)Z.items.splice(Q,1),Q-=1}}else if(k.isPair(Z)){J=Object.freeze(J.concat(Z));let Q=await A1("key",Z.key,X,J);if(Q===v)return v;else if(Q===a)Z.key=null;let H=await A1("value",Z.value,X,J);if(H===v)return v;else if(H===a)Z.value=null}}return $}function I2(q){if(typeof q==="object"&&(q.Collection||q.Node||q.Value))return Object.assign({Alias:q.Node,Map:q.Node,Scalar:q.Node,Seq:q.Node},q.Value&&{Map:q.Value,Scalar:q.Value,Seq:q.Value},q.Collection&&{Map:q.Collection,Seq:q.Collection},q);return q}function M2(q,Z,X,J){if(typeof X==="function")return X(q,Z,J);if(k.isMap(Z))return X.Map?.(q,Z,J);if(k.isSeq(Z))return X.Seq?.(q,Z,J);if(k.isPair(Z))return X.Pair?.(q,Z,J);if(k.isScalar(Z))return X.Scalar?.(q,Z,J);if(k.isAlias(Z))return X.Alias?.(q,Z,J);return}function K2(q,Z,X){let J=Z[Z.length-1];if(k.isCollection(J))J.items[q]=X;else if(k.isPair(J))if(q==="key")J.key=X;else J.value=X;else if(k.isDocument(J))J.contents=X;else{let $=k.isAlias(J)?"alias":"scalar";throw Error(`Cannot replace node with ${$} parent`)}}G8.visit=E0;G8.visitAsync=C0});var tq=P((L8)=>{var D2=A(),T8=l1(),_8={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},W8=(q)=>q.replace(/[!,[\]{}]/g,(Z)=>_8[Z]);class g{constructor(q,Z){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},g.defaultYaml,q),this.tags=Object.assign({},g.defaultTags,Z)}clone(){let q=new g(this.yaml,this.tags);return q.docStart=this.docStart,q}atDocument(){let q=new g(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:g.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},g.defaultTags);break}return q}add(q,Z){if(this.atNextDocument)this.yaml={explicit:g.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},g.defaultTags),this.atNextDocument=!1;let X=q.trim().split(/[ \t]+/),J=X.shift();switch(J){case"%TAG":{if(X.length!==2){if(Z(0,"%TAG directive should contain exactly two parts"),X.length<2)return!1}let[$,Q]=X;return this.tags[$]=Q,!0}case"%YAML":{if(this.yaml.explicit=!0,X.length!==1)return Z(0,"%YAML directive should contain exactly one part"),!1;let[$]=X;if($==="1.1"||$==="1.2")return this.yaml.version=$,!0;else{let Q=/^\d+\.\d+$/.test($);return Z(6,`Unsupported YAML version ${$}`,Q),!1}}default:return Z(0,`Unknown directive ${J}`,!0),!1}}tagName(q,Z){if(q==="!")return"!";if(q[0]!=="!")return Z(`Not a valid tag: ${q}`),null;if(q[1]==="<"){let Q=q.slice(2,-1);if(Q==="!"||Q==="!!")return Z(`Verbatim tags aren't resolved, so ${q} is invalid.`),null;if(q[q.length-1]!==">")Z("Verbatim tags must end with a >");return Q}let[,X,J]=q.match(/^(.*!)([^!]*)$/s);if(!J)Z(`The ${q} tag has no suffix`);let $=this.tags[X];if($)try{return $+decodeURIComponent(J)}catch(Q){return Z(String(Q)),null}if(X==="!")return q;return Z(`Could not resolve tag: ${q}`),null}tagString(q){for(let[Z,X]of Object.entries(this.tags))if(q.startsWith(X))return Z+W8(q.substring(X.length));return q[0]==="!"?q:`!<${q}>`}toString(q){let Z=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],X=Object.entries(this.tags),J;if(q&&X.length>0&&D2.isNode(q.contents)){let $={};T8.visit(q.contents,(Q,H)=>{if(D2.isNode(H)&&H.tag)$[H.tag]=!0}),J=Object.keys($)}else J=[];for(let[$,Q]of X){if($==="!!"&&Q==="tag:yaml.org,2002:")continue;if(!q||J.some((H)=>H.startsWith(Q)))Z.push(`%TAG ${$} ${Q}`)}return Z.join(`
28
+ `)}}g.defaultYaml={explicit:!1,version:"1.2"};g.defaultTags={"!!":"tag:yaml.org,2002:"};L8.Directives=g});var f0=P((K8)=>{var P2=A(),R8=l1();function I8(q){if(/[\x00-\x19\s,[\]{}]/.test(q)){let X=`Anchor must not contain whitespace or control characters: ${JSON.stringify(q)}`;throw Error(X)}return!0}function F2(q){let Z=new Set;return R8.visit(q,{Value(X,J){if(J.anchor)Z.add(J.anchor)}}),Z}function O2(q,Z){for(let X=1;;++X){let J=`${q}${X}`;if(!Z.has(J))return J}}function M8(q,Z){let X=[],J=new Map,$=null;return{onAnchor:(Q)=>{X.push(Q),$??($=F2(q));let H=O2(Z,$);return $.add(H),H},setAnchors:()=>{for(let Q of X){let H=J.get(Q);if(typeof H==="object"&&H.anchor&&(P2.isScalar(H.node)||P2.isCollection(H.node)))H.node.anchor=H.anchor;else{let z=Error("Failed to resolve repeated object (this should not happen)");throw z.source=Q,z}}},sourceObjects:J}}K8.anchorIsValid=I8;K8.anchorNames=F2;K8.createNodeAnchors=M8;K8.findNewAnchor=O2});var eq=P((N8)=>{function p1(q,Z,X,J){if(J&&typeof J==="object")if(Array.isArray(J))for(let $=0,Q=J.length;$<Q;++$){let H=J[$],z=p1(q,J,String($),H);if(z===void 0)delete J[$];else if(z!==H)J[$]=z}else if(J instanceof Map)for(let $ of Array.from(J.keys())){let Q=J.get($),H=p1(q,J,$,Q);if(H===void 0)J.delete($);else if(H!==Q)J.set($,H)}else if(J instanceof Set)for(let $ of Array.from(J)){let Q=p1(q,J,$,$);if(Q===void 0)J.delete($);else if(Q!==$)J.delete($),J.add(Q)}else for(let[$,Q]of Object.entries(J)){let H=p1(q,J,$,Q);if(H===void 0)delete J[$];else if(H!==Q)J[$]=H}return q.call(Z,X,J)}N8.applyReviver=p1});var Z1=P((w8)=>{var A8=A();function N2(q,Z,X){if(Array.isArray(q))return q.map((J,$)=>N2(J,String($),X));if(q&&typeof q.toJSON==="function"){if(!X||!A8.hasAnchor(q))return q.toJSON(Z,X);let J={aliasCount:0,count:1,res:void 0};X.anchors.set(q,J),X.onCreate=(Q)=>{J.res=Q,delete X.onCreate};let $=q.toJSON(Z,X);if(X.onCreate)X.onCreate($);return $}if(typeof q==="bigint"&&!X?.keep)return Number(q);return q}w8.toJS=N2});var y0=P((C8)=>{var j8=eq(),S2=A(),E8=Z1();class A2{constructor(q){Object.defineProperty(this,S2.NODE_TYPE,{value:q})}clone(){let q=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)q.range=this.range.slice();return q}toJS(q,{mapAsMap:Z,maxAliasCount:X,onAnchor:J,reviver:$}={}){if(!S2.isDocument(q))throw TypeError("A document argument is required");let Q={anchors:new Map,doc:q,keep:!0,mapAsMap:Z===!0,mapKeyWarned:!1,maxAliasCount:typeof X==="number"?X:100},H=E8.toJS(this,"",Q);if(typeof J==="function")for(let{count:z,res:U}of Q.anchors.values())J(U,z);return typeof $==="function"?j8.applyReviver($,{"":H},"",H):H}}C8.NodeBase=A2});var c1=P((h8)=>{var y8=f0(),x8=l1(),w1=A(),k8=y0(),v8=Z1();class w2 extends k8.NodeBase{constructor(q){super(w1.ALIAS);this.source=q,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve(q,Z){let X;if(Z?.aliasResolveCache)X=Z.aliasResolveCache;else if(X=[],x8.visit(q,{Node:($,Q)=>{if(w1.isAlias(Q)||w1.hasAnchor(Q))X.push(Q)}}),Z)Z.aliasResolveCache=X;let J=void 0;for(let $ of X){if($===this)break;if($.anchor===this.source)J=$}return J}toJSON(q,Z){if(!Z)return{source:this.source};let{anchors:X,doc:J,maxAliasCount:$}=Z,Q=this.resolve(J,Z);if(!Q){let z=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(z)}let H=X.get(Q);if(!H)v8.toJS(Q,null,Z),H=X.get(Q);if(H?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if($>=0){if(H.count+=1,H.aliasCount===0)H.aliasCount=x0(J,Q,X);if(H.count*H.aliasCount>$)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return H.res}toString(q,Z,X){let J=`*${this.source}`;if(q){if(y8.anchorIsValid(this.source),q.options.verifyAliasOrder&&!q.anchors.has(this.source)){let $=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error($)}if(q.implicitKey)return`${J} `}return J}}function x0(q,Z,X){if(w1.isAlias(Z)){let J=Z.resolve(q),$=X&&J&&X.get(J);return $?$.count*$.aliasCount:0}else if(w1.isCollection(Z)){let J=0;for(let $ of Z.items){let Q=x0(q,$,X);if(Q>J)J=Q}return J}else if(w1.isPair(Z)){let J=x0(q,Z.key,X),$=x0(q,Z.value,X);return Math.max(J,$)}return 1}h8.Alias=w2});var C=P((p8)=>{var u8=A(),m8=y0(),d8=Z1(),l8=(q)=>!q||typeof q!=="function"&&typeof q!=="object";class V1 extends m8.NodeBase{constructor(q){super(u8.SCALAR);this.value=q}toJSON(q,Z){return Z?.keep?this.value:d8.toJS(this.value,q,Z)}toString(){return String(this.value)}}V1.BLOCK_FOLDED="BLOCK_FOLDED";V1.BLOCK_LITERAL="BLOCK_LITERAL";V1.PLAIN="PLAIN";V1.QUOTE_DOUBLE="QUOTE_DOUBLE";V1.QUOTE_SINGLE="QUOTE_SINGLE";p8.Scalar=V1;p8.isScalarValue=l8});var i1=P((o8)=>{var a8=c1(),R1=A(),b2=C(),s8="tag:yaml.org,2002:";function r8(q,Z,X){if(Z){let J=X.filter((Q)=>Q.tag===Z),$=J.find((Q)=>!Q.format)??J[0];if(!$)throw Error(`Tag ${Z} not found`);return $}return X.find((J)=>J.identify?.(q)&&!J.format)}function n8(q,Z,X){if(R1.isDocument(q))q=q.contents;if(R1.isNode(q))return q;if(R1.isPair(q)){let Y=X.schema[R1.MAP].createNode?.(X.schema,null,X);return Y.items.push(q),Y}if(q instanceof String||q instanceof Number||q instanceof Boolean||typeof BigInt<"u"&&q instanceof BigInt)q=q.valueOf();let{aliasDuplicateObjects:J,onAnchor:$,onTagObj:Q,schema:H,sourceObjects:z}=X,U=void 0;if(J&&q&&typeof q==="object")if(U=z.get(q),U)return U.anchor??(U.anchor=$(q)),new a8.Alias(U.anchor);else U={anchor:null,node:null},z.set(q,U);if(Z?.startsWith("!!"))Z=s8+Z.slice(2);let G=r8(q,Z,H.tags);if(!G){if(q&&typeof q.toJSON==="function")q=q.toJSON();if(!q||typeof q!=="object"){let Y=new b2.Scalar(q);if(U)U.node=Y;return Y}G=q instanceof Map?H[R1.MAP]:(Symbol.iterator in Object(q))?H[R1.SEQ]:H[R1.MAP]}if(Q)Q(G),delete X.onTagObj;let T=G?.createNode?G.createNode(X.schema,q,X):typeof G?.nodeClass?.from==="function"?G.nodeClass.from(X.schema,q,X):new b2.Scalar(q);if(Z)T.tag=Z;else if(!G.default)T.tag=G.tag;if(U)U.node=T;return T}o8.createNode=n8});var k0=P((ZZ)=>{var e8=i1(),s=A(),qZ=y0();function q9(q,Z,X){let J=X;for(let $=Z.length-1;$>=0;--$){let Q=Z[$];if(typeof Q==="number"&&Number.isInteger(Q)&&Q>=0){let H=[];H[Q]=J,J=H}else J=new Map([[Q,J]])}return e8.createNode(J,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:q,sourceObjects:new Map})}var j2=(q)=>q==null||typeof q==="object"&&!!q[Symbol.iterator]().next().done;class E2 extends qZ.NodeBase{constructor(q,Z){super(q);Object.defineProperty(this,"schema",{value:Z,configurable:!0,enumerable:!1,writable:!0})}clone(q){let Z=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(q)Z.schema=q;if(Z.items=Z.items.map((X)=>s.isNode(X)||s.isPair(X)?X.clone(q):X),this.range)Z.range=this.range.slice();return Z}addIn(q,Z){if(j2(q))this.add(Z);else{let[X,...J]=q,$=this.get(X,!0);if(s.isCollection($))$.addIn(J,Z);else if($===void 0&&this.schema)this.set(X,q9(this.schema,J,Z));else throw Error(`Expected YAML collection at ${X}. Remaining path: ${J}`)}}deleteIn(q){let[Z,...X]=q;if(X.length===0)return this.delete(Z);let J=this.get(Z,!0);if(s.isCollection(J))return J.deleteIn(X);else throw Error(`Expected YAML collection at ${Z}. Remaining path: ${X}`)}getIn(q,Z){let[X,...J]=q,$=this.get(X,!0);if(J.length===0)return!Z&&s.isScalar($)?$.value:$;else return s.isCollection($)?$.getIn(J,Z):void 0}hasAllNullValues(q){return this.items.every((Z)=>{if(!s.isPair(Z))return!1;let X=Z.value;return X==null||q&&s.isScalar(X)&&X.value==null&&!X.commentBefore&&!X.comment&&!X.tag})}hasIn(q){let[Z,...X]=q;if(X.length===0)return this.has(Z);let J=this.get(Z,!0);return s.isCollection(J)?J.hasIn(X):!1}setIn(q,Z){let[X,...J]=q;if(J.length===0)this.set(X,Z);else{let $=this.get(X,!0);if(s.isCollection($))$.setIn(J,Z);else if($===void 0&&this.schema)this.set(X,q9(this.schema,J,Z));else throw Error(`Expected YAML collection at ${X}. Remaining path: ${J}`)}}}ZZ.Collection=E2;ZZ.collectionFromPath=q9;ZZ.isEmptyPath=j2});var a1=P((zZ)=>{var QZ=(q)=>q.replace(/^(?!$)(?: $)?/gm,"#");function Z9(q,Z){if(/^\n+$/.test(q))return q.substring(1);return Z?q.replace(/^(?! *$)/gm,Z):q}var HZ=(q,Z,X)=>q.endsWith(`
29
29
  `)?Z9(X,Z):X.includes(`
30
30
  `)?`
31
- `+Z9(X,Z):(q.endsWith(" ")?"":" ")+X;ZZ.indentComment=Z9;ZZ.lineComment=qZ;ZZ.stringifyComment=e8});var E2=P((HZ)=>{function QZ(q,Z,X="flow",{indentAtStart:J,lineWidth:$=80,minContentWidth:Q=20,onFold:H,onOverflow:U}={}){if(!$||$<0)return q;if($<Q)Q=0;let z=Math.max(1+Q,1+$-Z.length);if(q.length<=z)return q;let G=[],T={},Y=$-Z.length;if(typeof J==="number")if(J>$-Math.max(2,Q))G.push(0);else Y=$-J;let _=void 0,V=void 0,W=!1,B=-1,L=-1,I=-1;if(X==="block"){if(B=j2(q,B,Z.length),B!==-1)Y=B+z}for(let D;D=q[B+=1];){if(X==="quoted"&&D==="\\"){switch(L=B,q[B+1]){case"x":B+=3;break;case"u":B+=5;break;case"U":B+=9;break;default:B+=1}I=B}if(D===`
32
- `){if(X==="block")B=j2(q,B,Z.length);Y=B+Z.length+z,_=void 0}else{if(D===" "&&V&&V!==" "&&V!==`
31
+ `+Z9(X,Z):(q.endsWith(" ")?"":" ")+X;zZ.indentComment=Z9;zZ.lineComment=HZ;zZ.stringifyComment=QZ});var f2=P((TZ)=>{function BZ(q,Z,X="flow",{indentAtStart:J,lineWidth:$=80,minContentWidth:Q=20,onFold:H,onOverflow:z}={}){if(!$||$<0)return q;if($<Q)Q=0;let U=Math.max(1+Q,1+$-Z.length);if(q.length<=U)return q;let G=[],T={},Y=$-Z.length;if(typeof J==="number")if(J>$-Math.max(2,Q))G.push(0);else Y=$-J;let _=void 0,V=void 0,L=!1,B=-1,W=-1,I=-1;if(X==="block"){if(B=C2(q,B,Z.length),B!==-1)Y=B+U}for(let D;D=q[B+=1];){if(X==="quoted"&&D==="\\"){switch(W=B,q[B+1]){case"x":B+=3;break;case"u":B+=5;break;case"U":B+=9;break;default:B+=1}I=B}if(D===`
32
+ `){if(X==="block")B=C2(q,B,Z.length);Y=B+Z.length+U,_=void 0}else{if(D===" "&&V&&V!==" "&&V!==`
33
33
  `&&V!=="\t"){let O=q[B+1];if(O&&O!==" "&&O!==`
34
- `&&O!=="\t")_=B}if(B>=Y)if(_)G.push(_),Y=_+z,_=void 0;else if(X==="quoted"){while(V===" "||V==="\t")V=D,D=q[B+=1],W=!0;let O=B>I+1?B-2:L-1;if(T[O])return q;G.push(O),T[O]=!0,Y=O+z,_=void 0}else W=!0}V=D}if(W&&U)U();if(G.length===0)return q;if(H)H();let M=q.slice(0,G[0]);for(let D=0;D<G.length;++D){let O=G[D],N=G[D+1]||q.length;if(O===0)M=`
34
+ `&&O!=="\t")_=B}if(B>=Y)if(_)G.push(_),Y=_+U,_=void 0;else if(X==="quoted"){while(V===" "||V==="\t")V=D,D=q[B+=1],L=!0;let O=B>I+1?B-2:W-1;if(T[O])return q;G.push(O),T[O]=!0,Y=O+U,_=void 0}else L=!0}V=D}if(L&&z)z();if(G.length===0)return q;if(H)H();let M=q.slice(0,G[0]);for(let D=0;D<G.length;++D){let O=G[D],N=G[D+1]||q.length;if(O===0)M=`
35
35
  ${Z}${q.slice(0,N)}`;else{if(X==="quoted"&&T[O])M+=`${q[O]}\\`;M+=`
36
- ${Z}${q.slice(O+1,N)}`}}return M}function j2(q,Z,X){let J=Z,$=Z+1,Q=q[$];while(Q===" "||Q==="\t")if(Z<$+X)Q=q[++Z];else{do Q=q[++Z];while(Q&&Q!==`
37
- `);J=Z,$=Z+1,Q=q[$]}return J}HZ.FOLD_BLOCK="block";HZ.FOLD_FLOW="flow";HZ.FOLD_QUOTED="quoted";HZ.foldFlowLines=QZ});var r1=P((LZ)=>{var d=C(),X1=E2(),h0=(q,Z)=>({indentAtStart:Z?q.indent.length:q.indentAtStart,lineWidth:q.options.lineWidth,minContentWidth:q.options.minContentWidth}),g0=(q)=>/^(%|---|\.\.\.)/m.test(q);function BZ(q,Z,X){if(!Z||Z<0)return!1;let J=Z-X,$=q.length;if($<=J)return!1;for(let Q=0,H=0;Q<$;++Q)if(q[Q]===`
38
- `){if(Q-H>J)return!0;if(H=Q+1,$-H<=J)return!1}return!0}function s1(q,Z){let X=JSON.stringify(q);if(Z.options.doubleQuotedAsJSON)return X;let{implicitKey:J}=Z,$=Z.options.doubleQuotedMinMultiLineLength,Q=Z.indent||(g0(q)?" ":""),H="",U=0;for(let z=0,G=X[z];G;G=X[++z]){if(G===" "&&X[z+1]==="\\"&&X[z+2]==="n")H+=X.slice(U,z)+"\\ ",z+=1,U=z,G="\\";if(G==="\\")switch(X[z+1]){case"u":{H+=X.slice(U,z);let T=X.substr(z+2,4);switch(T){case"0000":H+="\\0";break;case"0007":H+="\\a";break;case"000b":H+="\\v";break;case"001b":H+="\\e";break;case"0085":H+="\\N";break;case"00a0":H+="\\_";break;case"2028":H+="\\L";break;case"2029":H+="\\P";break;default:if(T.substr(0,2)==="00")H+="\\x"+T.substr(2);else H+=X.substr(z,6)}z+=5,U=z+1}break;case"n":if(J||X[z+2]==='"'||X.length<$)z+=1;else{H+=X.slice(U,z)+`
36
+ ${Z}${q.slice(O+1,N)}`}}return M}function C2(q,Z,X){let J=Z,$=Z+1,Q=q[$];while(Q===" "||Q==="\t")if(Z<$+X)Q=q[++Z];else{do Q=q[++Z];while(Q&&Q!==`
37
+ `);J=Z,$=Z+1,Q=q[$]}return J}TZ.FOLD_BLOCK="block";TZ.FOLD_FLOW="flow";TZ.FOLD_QUOTED="quoted";TZ.foldFlowLines=BZ});var r1=P((KZ)=>{var d=C(),X1=f2(),h0=(q,Z)=>({indentAtStart:Z?q.indent.length:q.indentAtStart,lineWidth:q.options.lineWidth,minContentWidth:q.options.minContentWidth}),g0=(q)=>/^(%|---|\.\.\.)/m.test(q);function RZ(q,Z,X){if(!Z||Z<0)return!1;let J=Z-X,$=q.length;if($<=J)return!1;for(let Q=0,H=0;Q<$;++Q)if(q[Q]===`
38
+ `){if(Q-H>J)return!0;if(H=Q+1,$-H<=J)return!1}return!0}function s1(q,Z){let X=JSON.stringify(q);if(Z.options.doubleQuotedAsJSON)return X;let{implicitKey:J}=Z,$=Z.options.doubleQuotedMinMultiLineLength,Q=Z.indent||(g0(q)?" ":""),H="",z=0;for(let U=0,G=X[U];G;G=X[++U]){if(G===" "&&X[U+1]==="\\"&&X[U+2]==="n")H+=X.slice(z,U)+"\\ ",U+=1,z=U,G="\\";if(G==="\\")switch(X[U+1]){case"u":{H+=X.slice(z,U);let T=X.substr(U+2,4);switch(T){case"0000":H+="\\0";break;case"0007":H+="\\a";break;case"000b":H+="\\v";break;case"001b":H+="\\e";break;case"0085":H+="\\N";break;case"00a0":H+="\\_";break;case"2028":H+="\\L";break;case"2029":H+="\\P";break;default:if(T.substr(0,2)==="00")H+="\\x"+T.substr(2);else H+=X.substr(U,6)}U+=5,z=U+1}break;case"n":if(J||X[U+2]==='"'||X.length<$)U+=1;else{H+=X.slice(z,U)+`
39
39
 
40
- `;while(X[z+2]==="\\"&&X[z+3]==="n"&&X[z+4]!=='"')H+=`
41
- `,z+=2;if(H+=Q,X[z+2]===" ")H+="\\";z+=1,U=z+1}break;default:z+=1}}return H=U?H+X.slice(U):X,J?H:X1.foldFlowLines(H,Q,X1.FOLD_QUOTED,h0(Z,!1))}function X9(q,Z){if(Z.options.singleQuote===!1||Z.implicitKey&&q.includes(`
40
+ `;while(X[U+2]==="\\"&&X[U+3]==="n"&&X[U+4]!=='"')H+=`
41
+ `,U+=2;if(H+=Q,X[U+2]===" ")H+="\\";U+=1,z=U+1}break;default:U+=1}}return H=z?H+X.slice(z):X,J?H:X1.foldFlowLines(H,Q,X1.FOLD_QUOTED,h0(Z,!1))}function X9(q,Z){if(Z.options.singleQuote===!1||Z.implicitKey&&q.includes(`
42
42
  `)||/[ \t]\n|\n[ \t]/.test(q))return s1(q,Z);let X=Z.indent||(g0(q)?" ":""),J="'"+q.replace(/'/g,"''").replace(/\n+/g,`$&
43
43
  ${X}`)+"'";return Z.implicitKey?J:X1.foldFlowLines(J,X,X1.FOLD_FLOW,h0(Z,!1))}function b1(q,Z){let{singleQuote:X}=Z.options,J;if(X===!1)J=s1;else{let $=q.includes('"'),Q=q.includes("'");if($&&!Q)J=X9;else if(Q&&!$)J=s1;else J=X?X9:s1}return J(q,Z)}var J9;try{J9=new RegExp(`(^|(?<!
44
44
  ))
45
45
  +(?!
46
- |$)`,"g")}catch{J9=/\n+(?!\n|$)/g}function v0({comment:q,type:Z,value:X},J,$,Q){let{blockQuote:H,commentString:U,lineWidth:z}=J.options;if(!H||/\n[\t ]+$/.test(X))return b1(X,J);let G=J.indent||(J.forceBlockIndent||g0(X)?" ":""),T=H==="literal"?!0:H==="folded"||Z===d.Scalar.BLOCK_FOLDED?!1:Z===d.Scalar.BLOCK_LITERAL?!0:!BZ(X,z,G.length);if(!X)return T?`|
46
+ |$)`,"g")}catch{J9=/\n+(?!\n|$)/g}function v0({comment:q,type:Z,value:X},J,$,Q){let{blockQuote:H,commentString:z,lineWidth:U}=J.options;if(!H||/\n[\t ]+$/.test(X))return b1(X,J);let G=J.indent||(J.forceBlockIndent||g0(X)?" ":""),T=H==="literal"?!0:H==="folded"||Z===d.Scalar.BLOCK_FOLDED?!1:Z===d.Scalar.BLOCK_LITERAL?!0:!RZ(X,U,G.length);if(!X)return T?`|
47
47
  `:`>
48
48
  `;let Y,_;for(_=X.length;_>0;--_){let N=X[_-1];if(N!==`
49
- `&&N!=="\t"&&N!==" ")break}let V=X.substring(_),W=V.indexOf(`
50
- `);if(W===-1)Y="-";else if(X===V||W!==V.length-1){if(Y="+",Q)Q()}else Y="";if(V){if(X=X.slice(0,-V.length),V[V.length-1]===`
51
- `)V=V.slice(0,-1);V=V.replace(J9,`$&${G}`)}let B=!1,L,I=-1;for(L=0;L<X.length;++L){let N=X[L];if(N===" ")B=!0;else if(N===`
52
- `)I=L;else break}let M=X.substring(0,I<L?I+1:L);if(M)X=X.substring(M.length),M=M.replace(/\n+/g,`$&${G}`);let O=(B?G?"2":"1":"")+Y;if(q){if(O+=" "+U(q.replace(/ ?[\r\n]+/g," ")),$)$()}if(!T){let N=X.replace(/\n+/g,`
53
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${G}`),A=!1,K=h0(J,!0);if(H!=="folded"&&Z!==d.Scalar.BLOCK_FOLDED)K.onOverflow=()=>{A=!0};let R=X1.foldFlowLines(`${M}${N}${V}`,G,X1.FOLD_BLOCK,K);if(!A)return`>${O}
49
+ `&&N!=="\t"&&N!==" ")break}let V=X.substring(_),L=V.indexOf(`
50
+ `);if(L===-1)Y="-";else if(X===V||L!==V.length-1){if(Y="+",Q)Q()}else Y="";if(V){if(X=X.slice(0,-V.length),V[V.length-1]===`
51
+ `)V=V.slice(0,-1);V=V.replace(J9,`$&${G}`)}let B=!1,W,I=-1;for(W=0;W<X.length;++W){let N=X[W];if(N===" ")B=!0;else if(N===`
52
+ `)I=W;else break}let M=X.substring(0,I<W?I+1:W);if(M)X=X.substring(M.length),M=M.replace(/\n+/g,`$&${G}`);let O=(B?G?"2":"1":"")+Y;if(q){if(O+=" "+z(q.replace(/ ?[\r\n]+/g," ")),$)$()}if(!T){let N=X.replace(/\n+/g,`
53
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${G}`),S=!1,K=h0(J,!0);if(H!=="folded"&&Z!==d.Scalar.BLOCK_FOLDED)K.onOverflow=()=>{S=!0};let R=X1.foldFlowLines(`${M}${N}${V}`,G,X1.FOLD_BLOCK,K);if(!S)return`>${O}
54
54
  ${G}${R}`}return X=X.replace(/\n+/g,`$&${G}`),`|${O}
55
- ${G}${M}${X}${V}`}function TZ(q,Z,X,J){let{type:$,value:Q}=q,{actualString:H,implicitKey:U,indent:z,indentStep:G,inFlow:T}=Z;if(U&&Q.includes(`
56
- `)||T&&/[[\]{},]/.test(Q))return b1(Q,Z);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(Q))return U||T||!Q.includes(`
57
- `)?b1(Q,Z):v0(q,Z,X,J);if(!U&&!T&&$!==d.Scalar.PLAIN&&Q.includes(`
58
- `))return v0(q,Z,X,J);if(g0(Q)){if(z==="")return Z.forceBlockIndent=!0,v0(q,Z,X,J);else if(U&&z===G)return b1(Q,Z)}let Y=Q.replace(/\n+/g,`$&
59
- ${z}`);if(H){let _=(B)=>B.default&&B.tag!=="tag:yaml.org,2002:str"&&B.test?.test(Y),{compat:V,tags:W}=Z.doc.schema;if(W.some(_)||V?.some(_))return b1(Q,Z)}return U?Y:X1.foldFlowLines(Y,z,X1.FOLD_FLOW,h0(Z,!1))}function _Z(q,Z,X,J){let{implicitKey:$,inFlow:Q}=Z,H=typeof q.value==="string"?q:Object.assign({},q,{value:String(q.value)}),{type:U}=q;if(U!==d.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(H.value))U=d.Scalar.QUOTE_DOUBLE}let z=(T)=>{switch(T){case d.Scalar.BLOCK_FOLDED:case d.Scalar.BLOCK_LITERAL:return $||Q?b1(H.value,Z):v0(H,Z,X,J);case d.Scalar.QUOTE_DOUBLE:return s1(H.value,Z);case d.Scalar.QUOTE_SINGLE:return X9(H.value,Z);case d.Scalar.PLAIN:return TZ(H,Z,X,J);default:return null}},G=z(U);if(G===null){let{defaultKeyType:T,defaultStringType:Y}=Z.options,_=$&&T||Y;if(G=z(_),G===null)throw Error(`Unsupported default string type ${_}`)}return G}LZ.stringifyString=_Z});var n1=P((FZ)=>{var VZ=f0(),J1=S(),RZ=a1(),IZ=r1();function MZ(q,Z){let X=Object.assign({blockQuote:!0,commentString:RZ.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},q.schema.toStringOptions,Z),J;switch(X.collectionStyle){case"block":J=!1;break;case"flow":J=!0;break;default:J=null}return{anchors:new Set,doc:q,flowCollectionPadding:X.flowCollectionPadding?" ":"",indent:"",indentStep:typeof X.indent==="number"?" ".repeat(X.indent):" ",inFlow:J,options:X}}function KZ(q,Z){if(Z.tag){let $=q.filter((Q)=>Q.tag===Z.tag);if($.length>0)return $.find((Q)=>Q.format===Z.format)??$[0]}let X=void 0,J;if(J1.isScalar(Z)){J=Z.value;let $=q.filter((Q)=>Q.identify?.(J));if($.length>1){let Q=$.filter((H)=>H.test);if(Q.length>0)$=Q}X=$.find((Q)=>Q.format===Z.format)??$.find((Q)=>!Q.format)}else J=Z,X=q.find(($)=>$.nodeClass&&J instanceof $.nodeClass);if(!X){let $=J?.constructor?.name??(J===null?"null":typeof J);throw Error(`Tag not resolved for ${$} value`)}return X}function DZ(q,Z,{anchors:X,doc:J}){if(!J.directives)return"";let $=[],Q=(J1.isScalar(q)||J1.isCollection(q))&&q.anchor;if(Q&&VZ.anchorIsValid(Q))X.add(Q),$.push(`&${Q}`);let H=q.tag??(Z.default?null:Z.tag);if(H)$.push(J.directives.tagString(H));return $.join(" ")}function PZ(q,Z,X,J){if(J1.isPair(q))return q.toString(Z,X,J);if(J1.isAlias(q)){if(Z.doc.directives)return q.toString(Z);if(Z.resolvedAliases?.has(q))throw TypeError("Cannot stringify circular structure without alias nodes");else{if(Z.resolvedAliases)Z.resolvedAliases.add(q);else Z.resolvedAliases=new Set([q]);q=q.resolve(Z.doc)}}let $=void 0,Q=J1.isNode(q)?q:Z.doc.createNode(q,{onTagObj:(z)=>$=z});$??($=KZ(Z.doc.schema.tags,Q));let H=DZ(Q,$,Z);if(H.length>0)Z.indentAtStart=(Z.indentAtStart??0)+H.length+1;let U=typeof $.stringify==="function"?$.stringify(Q,Z,X,J):J1.isScalar(Q)?IZ.stringifyString(Q,Z,X,J):Q.toString(Z,X,J);if(!H)return U;return J1.isScalar(Q)||U[0]==="{"||U[0]==="["?`${H} ${U}`:`${H}
60
- ${Z.indent}${U}`}FZ.createStringifyContext=MZ;FZ.stringify=PZ});var y2=P((SZ)=>{var e=S(),C2=C(),f2=n1(),o1=a1();function AZ({key:q,value:Z},X,J,$){let{allNullValues:Q,doc:H,indent:U,indentStep:z,options:{commentString:G,indentSeq:T,simpleKeys:Y}}=X,_=e.isNode(q)&&q.comment||null;if(Y){if(_)throw Error("With simple keys, key nodes cannot have comments");if(e.isCollection(q)||!e.isNode(q)&&typeof q==="object")throw Error("With simple keys, collection cannot be used as a key value")}let V=!Y&&(!q||_&&Z==null&&!X.inFlow||e.isCollection(q)||(e.isScalar(q)?q.type===C2.Scalar.BLOCK_FOLDED||q.type===C2.Scalar.BLOCK_LITERAL:typeof q==="object"));X=Object.assign({},X,{allNullValues:!1,implicitKey:!V&&(Y||!Q),indent:U+z});let W=!1,B=!1,L=f2.stringify(q,X,()=>W=!0,()=>B=!0);if(!V&&!X.inFlow&&L.length>1024){if(Y)throw Error("With simple keys, single line scalar must not span more than 1024 characters");V=!0}if(X.inFlow){if(Q||Z==null){if(W&&J)J();return L===""?"?":V?`? ${L}`:L}}else if(Q&&!Y||Z==null&&V){if(L=`? ${L}`,_&&!W)L+=o1.lineComment(L,X.indent,G(_));else if(B&&$)$();return L}if(W)_=null;if(V){if(_)L+=o1.lineComment(L,X.indent,G(_));L=`? ${L}
61
- ${U}:`}else if(L=`${L}:`,_)L+=o1.lineComment(L,X.indent,G(_));let I,M,D;if(e.isNode(Z))I=!!Z.spaceBefore,M=Z.commentBefore,D=Z.comment;else if(I=!1,M=null,D=null,Z&&typeof Z==="object")Z=H.createNode(Z);if(X.implicitKey=!1,!V&&!_&&e.isScalar(Z))X.indentAtStart=L.length+1;if(B=!1,!T&&z.length>=2&&!X.inFlow&&!V&&e.isSeq(Z)&&!Z.flow&&!Z.tag&&!Z.anchor)X.indent=X.indent.substring(2);let O=!1,N=f2.stringify(Z,X,()=>O=!0,()=>B=!0),A=" ";if(_||I||M){if(A=I?`
62
- `:"",M){let K=G(M);A+=`
63
- ${o1.indentComment(K,X.indent)}`}if(N===""&&!X.inFlow){if(A===`
64
- `&&D)A=`
55
+ ${G}${M}${X}${V}`}function IZ(q,Z,X,J){let{type:$,value:Q}=q,{actualString:H,implicitKey:z,indent:U,indentStep:G,inFlow:T}=Z;if(z&&Q.includes(`
56
+ `)||T&&/[[\]{},]/.test(Q))return b1(Q,Z);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(Q))return z||T||!Q.includes(`
57
+ `)?b1(Q,Z):v0(q,Z,X,J);if(!z&&!T&&$!==d.Scalar.PLAIN&&Q.includes(`
58
+ `))return v0(q,Z,X,J);if(g0(Q)){if(U==="")return Z.forceBlockIndent=!0,v0(q,Z,X,J);else if(z&&U===G)return b1(Q,Z)}let Y=Q.replace(/\n+/g,`$&
59
+ ${U}`);if(H){let _=(B)=>B.default&&B.tag!=="tag:yaml.org,2002:str"&&B.test?.test(Y),{compat:V,tags:L}=Z.doc.schema;if(L.some(_)||V?.some(_))return b1(Q,Z)}return z?Y:X1.foldFlowLines(Y,U,X1.FOLD_FLOW,h0(Z,!1))}function MZ(q,Z,X,J){let{implicitKey:$,inFlow:Q}=Z,H=typeof q.value==="string"?q:Object.assign({},q,{value:String(q.value)}),{type:z}=q;if(z!==d.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(H.value))z=d.Scalar.QUOTE_DOUBLE}let U=(T)=>{switch(T){case d.Scalar.BLOCK_FOLDED:case d.Scalar.BLOCK_LITERAL:return $||Q?b1(H.value,Z):v0(H,Z,X,J);case d.Scalar.QUOTE_DOUBLE:return s1(H.value,Z);case d.Scalar.QUOTE_SINGLE:return X9(H.value,Z);case d.Scalar.PLAIN:return IZ(H,Z,X,J);default:return null}},G=U(z);if(G===null){let{defaultKeyType:T,defaultStringType:Y}=Z.options,_=$&&T||Y;if(G=U(_),G===null)throw Error(`Unsupported default string type ${_}`)}return G}KZ.stringifyString=MZ});var n1=P((bZ)=>{var PZ=f0(),J1=A(),FZ=a1(),OZ=r1();function NZ(q,Z){let X=Object.assign({blockQuote:!0,commentString:FZ.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},q.schema.toStringOptions,Z),J;switch(X.collectionStyle){case"block":J=!1;break;case"flow":J=!0;break;default:J=null}return{anchors:new Set,doc:q,flowCollectionPadding:X.flowCollectionPadding?" ":"",indent:"",indentStep:typeof X.indent==="number"?" ".repeat(X.indent):" ",inFlow:J,options:X}}function SZ(q,Z){if(Z.tag){let $=q.filter((Q)=>Q.tag===Z.tag);if($.length>0)return $.find((Q)=>Q.format===Z.format)??$[0]}let X=void 0,J;if(J1.isScalar(Z)){J=Z.value;let $=q.filter((Q)=>Q.identify?.(J));if($.length>1){let Q=$.filter((H)=>H.test);if(Q.length>0)$=Q}X=$.find((Q)=>Q.format===Z.format)??$.find((Q)=>!Q.format)}else J=Z,X=q.find(($)=>$.nodeClass&&J instanceof $.nodeClass);if(!X){let $=J?.constructor?.name??(J===null?"null":typeof J);throw Error(`Tag not resolved for ${$} value`)}return X}function AZ(q,Z,{anchors:X,doc:J}){if(!J.directives)return"";let $=[],Q=(J1.isScalar(q)||J1.isCollection(q))&&q.anchor;if(Q&&PZ.anchorIsValid(Q))X.add(Q),$.push(`&${Q}`);let H=q.tag??(Z.default?null:Z.tag);if(H)$.push(J.directives.tagString(H));return $.join(" ")}function wZ(q,Z,X,J){if(J1.isPair(q))return q.toString(Z,X,J);if(J1.isAlias(q)){if(Z.doc.directives)return q.toString(Z);if(Z.resolvedAliases?.has(q))throw TypeError("Cannot stringify circular structure without alias nodes");else{if(Z.resolvedAliases)Z.resolvedAliases.add(q);else Z.resolvedAliases=new Set([q]);q=q.resolve(Z.doc)}}let $=void 0,Q=J1.isNode(q)?q:Z.doc.createNode(q,{onTagObj:(U)=>$=U});$??($=SZ(Z.doc.schema.tags,Q));let H=AZ(Q,$,Z);if(H.length>0)Z.indentAtStart=(Z.indentAtStart??0)+H.length+1;let z=typeof $.stringify==="function"?$.stringify(Q,Z,X,J):J1.isScalar(Q)?OZ.stringifyString(Q,Z,X,J):Q.toString(Z,X,J);if(!H)return z;return J1.isScalar(Q)||z[0]==="{"||z[0]==="["?`${H} ${z}`:`${H}
60
+ ${Z.indent}${z}`}bZ.createStringifyContext=NZ;bZ.stringify=wZ});var k2=P((fZ)=>{var e=A(),y2=C(),x2=n1(),o1=a1();function CZ({key:q,value:Z},X,J,$){let{allNullValues:Q,doc:H,indent:z,indentStep:U,options:{commentString:G,indentSeq:T,simpleKeys:Y}}=X,_=e.isNode(q)&&q.comment||null;if(Y){if(_)throw Error("With simple keys, key nodes cannot have comments");if(e.isCollection(q)||!e.isNode(q)&&typeof q==="object")throw Error("With simple keys, collection cannot be used as a key value")}let V=!Y&&(!q||_&&Z==null&&!X.inFlow||e.isCollection(q)||(e.isScalar(q)?q.type===y2.Scalar.BLOCK_FOLDED||q.type===y2.Scalar.BLOCK_LITERAL:typeof q==="object"));X=Object.assign({},X,{allNullValues:!1,implicitKey:!V&&(Y||!Q),indent:z+U});let L=!1,B=!1,W=x2.stringify(q,X,()=>L=!0,()=>B=!0);if(!V&&!X.inFlow&&W.length>1024){if(Y)throw Error("With simple keys, single line scalar must not span more than 1024 characters");V=!0}if(X.inFlow){if(Q||Z==null){if(L&&J)J();return W===""?"?":V?`? ${W}`:W}}else if(Q&&!Y||Z==null&&V){if(W=`? ${W}`,_&&!L)W+=o1.lineComment(W,X.indent,G(_));else if(B&&$)$();return W}if(L)_=null;if(V){if(_)W+=o1.lineComment(W,X.indent,G(_));W=`? ${W}
61
+ ${z}:`}else if(W=`${W}:`,_)W+=o1.lineComment(W,X.indent,G(_));let I,M,D;if(e.isNode(Z))I=!!Z.spaceBefore,M=Z.commentBefore,D=Z.comment;else if(I=!1,M=null,D=null,Z&&typeof Z==="object")Z=H.createNode(Z);if(X.implicitKey=!1,!V&&!_&&e.isScalar(Z))X.indentAtStart=W.length+1;if(B=!1,!T&&U.length>=2&&!X.inFlow&&!V&&e.isSeq(Z)&&!Z.flow&&!Z.tag&&!Z.anchor)X.indent=X.indent.substring(2);let O=!1,N=x2.stringify(Z,X,()=>O=!0,()=>B=!0),S=" ";if(_||I||M){if(S=I?`
62
+ `:"",M){let K=G(M);S+=`
63
+ ${o1.indentComment(K,X.indent)}`}if(N===""&&!X.inFlow){if(S===`
64
+ `&&D)S=`
65
65
 
66
- `}else A+=`
66
+ `}else S+=`
67
67
  ${X.indent}`}else if(!V&&e.isCollection(Z)){let K=N[0],R=N.indexOf(`
68
- `),w=R!==-1,y=X.inFlow??Z.flow??Z.items.length===0;if(w||!y){let x=!1;if(w&&(K==="&"||K==="!")){let E=N.indexOf(" ");if(K==="&"&&E!==-1&&E<R&&N[E+1]==="!")E=N.indexOf(" ",E+1);if(E===-1||R<E)x=!0}if(!x)A=`
68
+ `),w=R!==-1,y=X.inFlow??Z.flow??Z.items.length===0;if(w||!y){let x=!1;if(w&&(K==="&"||K==="!")){let E=N.indexOf(" ");if(K==="&"&&E!==-1&&E<R&&N[E+1]==="!")E=N.indexOf(" ",E+1);if(E===-1||R<E)x=!0}if(!x)S=`
69
69
  ${X.indent}`}}else if(N===""||N[0]===`
70
- `)A="";if(L+=A+N,X.inFlow){if(O&&J)J()}else if(D&&!O)L+=o1.lineComment(L,X.indent,G(D));else if(B&&$)$();return L}SZ.stringifyPair=AZ});var $9=P((EZ)=>{var x2=r("process");function bZ(q,...Z){if(q==="debug")console.log(...Z)}function jZ(q,Z){if(q==="debug"||q==="warn")if(typeof x2.emitWarning==="function")x2.emitWarning(Z);else console.warn(Z)}EZ.debug=bZ;EZ.warn=jZ});var d0=P((xZ)=>{var t1=S(),k2=C(),u0="<<",m0={identify:(q)=>q===u0||typeof q==="symbol"&&q.description===u0,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new k2.Scalar(Symbol(u0)),{addToJSMap:v2}),stringify:()=>u0},yZ=(q,Z)=>(m0.identify(Z)||t1.isScalar(Z)&&(!Z.type||Z.type===k2.Scalar.PLAIN)&&m0.identify(Z.value))&&q?.doc.schema.tags.some((X)=>X.tag===m0.tag&&X.default);function v2(q,Z,X){if(X=q&&t1.isAlias(X)?X.resolve(q.doc):X,t1.isSeq(X))for(let J of X.items)Q9(q,Z,J);else if(Array.isArray(X))for(let J of X)Q9(q,Z,J);else Q9(q,Z,X)}function Q9(q,Z,X){let J=q&&t1.isAlias(X)?X.resolve(q.doc):X;if(!t1.isMap(J))throw Error("Merge sources must be maps or map aliases");let $=J.toJSON(null,q,Map);for(let[Q,H]of $)if(Z instanceof Map){if(!Z.has(Q))Z.set(Q,H)}else if(Z instanceof Set)Z.add(Q);else if(!Object.prototype.hasOwnProperty.call(Z,Q))Object.defineProperty(Z,Q,{value:H,writable:!0,enumerable:!0,configurable:!0});return Z}xZ.addMergeToJSMap=v2;xZ.isMergeKey=yZ;xZ.merge=m0});var U9=P((lZ)=>{var gZ=$9(),h2=d0(),uZ=n1(),g2=S(),H9=Z1();function mZ(q,Z,{key:X,value:J}){if(g2.isNode(X)&&X.addToJSMap)X.addToJSMap(q,Z,J);else if(h2.isMergeKey(q,X))h2.addMergeToJSMap(q,Z,J);else{let $=H9.toJS(X,"",q);if(Z instanceof Map)Z.set($,H9.toJS(J,$,q));else if(Z instanceof Set)Z.add($);else{let Q=dZ(X,$,q),H=H9.toJS(J,Q,q);if(Q in Z)Object.defineProperty(Z,Q,{value:H,writable:!0,enumerable:!0,configurable:!0});else Z[Q]=H}}return Z}function dZ(q,Z,X){if(Z===null)return"";if(typeof Z!=="object")return String(Z);if(g2.isNode(q)&&X?.doc){let J=uZ.createStringifyContext(X.doc,{});J.anchors=new Set;for(let Q of X.anchors.keys())J.anchors.add(Q.anchor);J.inFlow=!0,J.inStringifyKey=!0;let $=q.toString(J);if(!X.mapKeyWarned){let Q=JSON.stringify($);if(Q.length>40)Q=Q.substring(0,36)+'..."';gZ.warn(X.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${Q}. Set mapAsMap: true to use object keys.`),X.mapKeyWarned=!0}return $}return JSON.stringify(Z)}lZ.addPairToJSMap=mZ});var $1=P((sZ)=>{var u2=i1(),cZ=y2(),iZ=U9(),l0=S();function aZ(q,Z,X){let J=u2.createNode(q,void 0,X),$=u2.createNode(Z,void 0,X);return new p0(J,$)}class p0{constructor(q,Z=null){Object.defineProperty(this,l0.NODE_TYPE,{value:l0.PAIR}),this.key=q,this.value=Z}clone(q){let{key:Z,value:X}=this;if(l0.isNode(Z))Z=Z.clone(q);if(l0.isNode(X))X=X.clone(q);return new p0(Z,X)}toJSON(q,Z){let X=Z?.mapAsMap?new Map:{};return iZ.addPairToJSMap(Z,X,this)}toString(q,Z,X){return q?.doc?cZ.stringifyPair(this,q,Z,X):JSON.stringify(this)}}sZ.Pair=p0;sZ.createPair=aZ});var z9=P((qX)=>{var I1=S(),m2=n1(),c0=a1();function oZ(q,Z,X){return(Z.inFlow??q.flow?eZ:tZ)(q,Z,X)}function tZ({comment:q,items:Z},X,{blockItemPrefix:J,flowChars:$,itemIndent:Q,onChompKeep:H,onComment:U}){let{indent:z,options:{commentString:G}}=X,T=Object.assign({},X,{indent:Q,type:null}),Y=!1,_=[];for(let W=0;W<Z.length;++W){let B=Z[W],L=null;if(I1.isNode(B)){if(!Y&&B.spaceBefore)_.push("");if(i0(X,_,B.commentBefore,Y),B.comment)L=B.comment}else if(I1.isPair(B)){let M=I1.isNode(B.key)?B.key:null;if(M){if(!Y&&M.spaceBefore)_.push("");i0(X,_,M.commentBefore,Y)}}Y=!1;let I=m2.stringify(B,T,()=>L=null,()=>Y=!0);if(L)I+=c0.lineComment(I,Q,G(L));if(Y&&L)Y=!1;_.push(J+I)}let V;if(_.length===0)V=$.start+$.end;else{V=_[0];for(let W=1;W<_.length;++W){let B=_[W];V+=B?`
71
- ${z}${B}`:`
70
+ `)S="";if(W+=S+N,X.inFlow){if(O&&J)J()}else if(D&&!O)W+=o1.lineComment(W,X.indent,G(D));else if(B&&$)$();return W}fZ.stringifyPair=CZ});var $9=P((vZ)=>{var v2=r("process");function xZ(q,...Z){if(q==="debug")console.log(...Z)}function kZ(q,Z){if(q==="debug"||q==="warn")if(typeof v2.emitWarning==="function")v2.emitWarning(Z);else console.warn(Z)}vZ.debug=xZ;vZ.warn=kZ});var d0=P((mZ)=>{var t1=A(),h2=C(),u0="<<",m0={identify:(q)=>q===u0||typeof q==="symbol"&&q.description===u0,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new h2.Scalar(Symbol(u0)),{addToJSMap:g2}),stringify:()=>u0},uZ=(q,Z)=>(m0.identify(Z)||t1.isScalar(Z)&&(!Z.type||Z.type===h2.Scalar.PLAIN)&&m0.identify(Z.value))&&q?.doc.schema.tags.some((X)=>X.tag===m0.tag&&X.default);function g2(q,Z,X){if(X=q&&t1.isAlias(X)?X.resolve(q.doc):X,t1.isSeq(X))for(let J of X.items)Q9(q,Z,J);else if(Array.isArray(X))for(let J of X)Q9(q,Z,J);else Q9(q,Z,X)}function Q9(q,Z,X){let J=q&&t1.isAlias(X)?X.resolve(q.doc):X;if(!t1.isMap(J))throw Error("Merge sources must be maps or map aliases");let $=J.toJSON(null,q,Map);for(let[Q,H]of $)if(Z instanceof Map){if(!Z.has(Q))Z.set(Q,H)}else if(Z instanceof Set)Z.add(Q);else if(!Object.prototype.hasOwnProperty.call(Z,Q))Object.defineProperty(Z,Q,{value:H,writable:!0,enumerable:!0,configurable:!0});return Z}mZ.addMergeToJSMap=g2;mZ.isMergeKey=uZ;mZ.merge=m0});var z9=P((rZ)=>{var cZ=$9(),u2=d0(),iZ=n1(),m2=A(),H9=Z1();function aZ(q,Z,{key:X,value:J}){if(m2.isNode(X)&&X.addToJSMap)X.addToJSMap(q,Z,J);else if(u2.isMergeKey(q,X))u2.addMergeToJSMap(q,Z,J);else{let $=H9.toJS(X,"",q);if(Z instanceof Map)Z.set($,H9.toJS(J,$,q));else if(Z instanceof Set)Z.add($);else{let Q=sZ(X,$,q),H=H9.toJS(J,Q,q);if(Q in Z)Object.defineProperty(Z,Q,{value:H,writable:!0,enumerable:!0,configurable:!0});else Z[Q]=H}}return Z}function sZ(q,Z,X){if(Z===null)return"";if(typeof Z!=="object")return String(Z);if(m2.isNode(q)&&X?.doc){let J=iZ.createStringifyContext(X.doc,{});J.anchors=new Set;for(let Q of X.anchors.keys())J.anchors.add(Q.anchor);J.inFlow=!0,J.inStringifyKey=!0;let $=q.toString(J);if(!X.mapKeyWarned){let Q=JSON.stringify($);if(Q.length>40)Q=Q.substring(0,36)+'..."';cZ.warn(X.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${Q}. Set mapAsMap: true to use object keys.`),X.mapKeyWarned=!0}return $}return JSON.stringify(Z)}rZ.addPairToJSMap=aZ});var $1=P((qX)=>{var d2=i1(),oZ=k2(),tZ=z9(),l0=A();function eZ(q,Z,X){let J=d2.createNode(q,void 0,X),$=d2.createNode(Z,void 0,X);return new p0(J,$)}class p0{constructor(q,Z=null){Object.defineProperty(this,l0.NODE_TYPE,{value:l0.PAIR}),this.key=q,this.value=Z}clone(q){let{key:Z,value:X}=this;if(l0.isNode(Z))Z=Z.clone(q);if(l0.isNode(X))X=X.clone(q);return new p0(Z,X)}toJSON(q,Z){let X=Z?.mapAsMap?new Map:{};return tZ.addPairToJSMap(Z,X,this)}toString(q,Z,X){return q?.doc?oZ.stringifyPair(this,q,Z,X):JSON.stringify(this)}}qX.Pair=p0;qX.createPair=eZ});var U9=P((HX)=>{var I1=A(),l2=n1(),c0=a1();function JX(q,Z,X){return(Z.inFlow??q.flow?QX:$X)(q,Z,X)}function $X({comment:q,items:Z},X,{blockItemPrefix:J,flowChars:$,itemIndent:Q,onChompKeep:H,onComment:z}){let{indent:U,options:{commentString:G}}=X,T=Object.assign({},X,{indent:Q,type:null}),Y=!1,_=[];for(let L=0;L<Z.length;++L){let B=Z[L],W=null;if(I1.isNode(B)){if(!Y&&B.spaceBefore)_.push("");if(i0(X,_,B.commentBefore,Y),B.comment)W=B.comment}else if(I1.isPair(B)){let M=I1.isNode(B.key)?B.key:null;if(M){if(!Y&&M.spaceBefore)_.push("");i0(X,_,M.commentBefore,Y)}}Y=!1;let I=l2.stringify(B,T,()=>W=null,()=>Y=!0);if(W)I+=c0.lineComment(I,Q,G(W));if(Y&&W)Y=!1;_.push(J+I)}let V;if(_.length===0)V=$.start+$.end;else{V=_[0];for(let L=1;L<_.length;++L){let B=_[L];V+=B?`
71
+ ${U}${B}`:`
72
72
  `}}if(q){if(V+=`
73
- `+c0.indentComment(G(q),z),U)U()}else if(Y&&H)H();return V}function eZ({items:q},Z,{flowChars:X,itemIndent:J}){let{indent:$,indentStep:Q,flowCollectionPadding:H,options:{commentString:U}}=Z;J+=Q;let z=Object.assign({},Z,{indent:J,inFlow:!0,type:null}),G=!1,T=0,Y=[];for(let W=0;W<q.length;++W){let B=q[W],L=null;if(I1.isNode(B)){if(B.spaceBefore)Y.push("");if(i0(Z,Y,B.commentBefore,!1),B.comment)L=B.comment}else if(I1.isPair(B)){let M=I1.isNode(B.key)?B.key:null;if(M){if(M.spaceBefore)Y.push("");if(i0(Z,Y,M.commentBefore,!1),M.comment)G=!0}let D=I1.isNode(B.value)?B.value:null;if(D){if(D.comment)L=D.comment;if(D.commentBefore)G=!0}else if(B.value==null&&M?.comment)L=M.comment}if(L)G=!0;let I=m2.stringify(B,z,()=>L=null);if(W<q.length-1)I+=",";if(L)I+=c0.lineComment(I,J,U(L));if(!G&&(Y.length>T||I.includes(`
74
- `)))G=!0;Y.push(I),T=Y.length}let{start:_,end:V}=X;if(Y.length===0)return _+V;else{if(!G){let W=Y.reduce((B,L)=>B+L.length+2,2);G=Z.options.lineWidth>0&&W>Z.options.lineWidth}if(G){let W=_;for(let B of Y)W+=B?`
73
+ `+c0.indentComment(G(q),U),z)z()}else if(Y&&H)H();return V}function QX({items:q},Z,{flowChars:X,itemIndent:J}){let{indent:$,indentStep:Q,flowCollectionPadding:H,options:{commentString:z}}=Z;J+=Q;let U=Object.assign({},Z,{indent:J,inFlow:!0,type:null}),G=!1,T=0,Y=[];for(let L=0;L<q.length;++L){let B=q[L],W=null;if(I1.isNode(B)){if(B.spaceBefore)Y.push("");if(i0(Z,Y,B.commentBefore,!1),B.comment)W=B.comment}else if(I1.isPair(B)){let M=I1.isNode(B.key)?B.key:null;if(M){if(M.spaceBefore)Y.push("");if(i0(Z,Y,M.commentBefore,!1),M.comment)G=!0}let D=I1.isNode(B.value)?B.value:null;if(D){if(D.comment)W=D.comment;if(D.commentBefore)G=!0}else if(B.value==null&&M?.comment)W=M.comment}if(W)G=!0;let I=l2.stringify(B,U,()=>W=null);if(L<q.length-1)I+=",";if(W)I+=c0.lineComment(I,J,z(W));if(!G&&(Y.length>T||I.includes(`
74
+ `)))G=!0;Y.push(I),T=Y.length}let{start:_,end:V}=X;if(Y.length===0)return _+V;else{if(!G){let L=Y.reduce((B,W)=>B+W.length+2,2);G=Z.options.lineWidth>0&&L>Z.options.lineWidth}if(G){let L=_;for(let B of Y)L+=B?`
75
75
  ${Q}${$}${B}`:`
76
- `;return`${W}
77
- ${$}${V}`}else return`${_}${H}${Y.join(" ")}${H}${V}`}}function i0({indent:q,options:{commentString:Z}},X,J,$){if(J&&$)J=J.replace(/^\n+/,"");if(J){let Q=c0.indentComment(Z(J),q);X.push(Q.trimStart())}}qX.stringifyCollection=oZ});var H1=P((HX)=>{var XX=z9(),JX=U9(),$X=k0(),Q1=S(),a0=$1(),QX=C();function e1(q,Z){let X=Q1.isScalar(Z)?Z.value:Z;for(let J of q)if(Q1.isPair(J)){if(J.key===Z||J.key===X)return J;if(Q1.isScalar(J.key)&&J.key.value===X)return J}return}class d2 extends $X.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(q){super(Q1.MAP,q);this.items=[]}static from(q,Z,X){let{keepUndefined:J,replacer:$}=X,Q=new this(q),H=(U,z)=>{if(typeof $==="function")z=$.call(Z,U,z);else if(Array.isArray($)&&!$.includes(U))return;if(z!==void 0||J)Q.items.push(a0.createPair(U,z,X))};if(Z instanceof Map)for(let[U,z]of Z)H(U,z);else if(Z&&typeof Z==="object")for(let U of Object.keys(Z))H(U,Z[U]);if(typeof q.sortMapEntries==="function")Q.items.sort(q.sortMapEntries);return Q}add(q,Z){let X;if(Q1.isPair(q))X=q;else if(!q||typeof q!=="object"||!("key"in q))X=new a0.Pair(q,q?.value);else X=new a0.Pair(q.key,q.value);let J=e1(this.items,X.key),$=this.schema?.sortMapEntries;if(J){if(!Z)throw Error(`Key ${X.key} already set`);if(Q1.isScalar(J.value)&&QX.isScalarValue(X.value))J.value.value=X.value;else J.value=X.value}else if($){let Q=this.items.findIndex((H)=>$(X,H)<0);if(Q===-1)this.items.push(X);else this.items.splice(Q,0,X)}else this.items.push(X)}delete(q){let Z=e1(this.items,q);if(!Z)return!1;return this.items.splice(this.items.indexOf(Z),1).length>0}get(q,Z){let J=e1(this.items,q)?.value;return(!Z&&Q1.isScalar(J)?J.value:J)??void 0}has(q){return!!e1(this.items,q)}set(q,Z){this.add(new a0.Pair(q,Z),!0)}toJSON(q,Z,X){let J=X?new X:Z?.mapAsMap?new Map:{};if(Z?.onCreate)Z.onCreate(J);for(let $ of this.items)JX.addPairToJSMap(Z,J,$);return J}toString(q,Z,X){if(!q)return JSON.stringify(this);for(let J of this.items)if(!Q1.isPair(J))throw Error(`Map items must all be pairs; found ${JSON.stringify(J)} instead`);if(!q.allNullValues&&this.hasAllNullValues(!1))q=Object.assign({},q,{allNullValues:!0});return XX.stringifyCollection(this,q,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:q.indent||"",onChompKeep:X,onComment:Z})}}HX.YAMLMap=d2;HX.findPair=e1});var j1=P((BX)=>{var GX=S(),l2=H1(),YX={collection:"map",default:!0,nodeClass:l2.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(q,Z){if(!GX.isMap(q))Z("Expected a mapping for this tag");return q},createNode:(q,Z,X)=>l2.YAMLMap.from(q,Z,X)};BX.map=YX});var U1=P((IX)=>{var _X=i1(),LX=z9(),WX=k0(),r0=S(),VX=C(),RX=Z1();class p2 extends WX.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(q){super(r0.SEQ,q);this.items=[]}add(q){this.items.push(q)}delete(q){let Z=s0(q);if(typeof Z!=="number")return!1;return this.items.splice(Z,1).length>0}get(q,Z){let X=s0(q);if(typeof X!=="number")return;let J=this.items[X];return!Z&&r0.isScalar(J)?J.value:J}has(q){let Z=s0(q);return typeof Z==="number"&&Z<this.items.length}set(q,Z){let X=s0(q);if(typeof X!=="number")throw Error(`Expected a valid index, not ${q}.`);let J=this.items[X];if(r0.isScalar(J)&&VX.isScalarValue(Z))J.value=Z;else this.items[X]=Z}toJSON(q,Z){let X=[];if(Z?.onCreate)Z.onCreate(X);let J=0;for(let $ of this.items)X.push(RX.toJS($,String(J++),Z));return X}toString(q,Z,X){if(!q)return JSON.stringify(this);return LX.stringifyCollection(this,q,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(q.indent||"")+" ",onChompKeep:X,onComment:Z})}static from(q,Z,X){let{replacer:J}=X,$=new this(q);if(Z&&Symbol.iterator in Object(Z)){let Q=0;for(let H of Z){if(typeof J==="function"){let U=Z instanceof Set?H:String(Q++);H=J.call(Z,U,H)}$.items.push(_X.createNode(H,void 0,X))}}return $}}function s0(q){let Z=r0.isScalar(q)?q.value:q;if(Z&&typeof Z==="string")Z=Number(Z);return typeof Z==="number"&&Number.isInteger(Z)&&Z>=0?Z:null}IX.YAMLSeq=p2});var E1=P((PX)=>{var KX=S(),c2=U1(),DX={collection:"seq",default:!0,nodeClass:c2.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(q,Z){if(!KX.isSeq(q))Z("Expected a sequence for this tag");return q},createNode:(q,Z,X)=>c2.YAMLSeq.from(q,Z,X)};PX.seq=DX});var q0=P((AX)=>{var OX=r1(),NX={identify:(q)=>typeof q==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(q)=>q,stringify(q,Z,X,J){return Z=Object.assign({actualString:!0},Z),OX.stringifyString(q,Z,X,J)}};AX.string=NX});var n0=P((wX)=>{var i2=C(),a2={identify:(q)=>q==null,createNode:()=>new i2.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new i2.Scalar(null),stringify:({source:q},Z)=>typeof q==="string"&&a2.test.test(q)?q:Z.options.nullStr};wX.nullTag=a2});var G9=P((EX)=>{var jX=C(),s2={identify:(q)=>typeof q==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:(q)=>new jX.Scalar(q[0]==="t"||q[0]==="T"),stringify({source:q,value:Z},X){if(q&&s2.test.test(q)){let J=q[0]==="t"||q[0]==="T";if(Z===J)return q}return Z?X.options.trueStr:X.options.falseStr}};EX.boolTag=s2});var C1=P((yX)=>{function fX({format:q,minFractionDigits:Z,tag:X,value:J}){if(typeof J==="bigint")return String(J);let $=typeof J==="number"?J:Number(J);if(!isFinite($))return isNaN($)?".nan":$<0?"-.inf":".inf";let Q=Object.is(J,-0)?"-0":JSON.stringify(J);if(!q&&Z&&(!X||X==="tag:yaml.org,2002:float")&&/^\d/.test(Q)){let H=Q.indexOf(".");if(H<0)H=Q.length,Q+=".";let U=Z-(Q.length-H-1);while(U-- >0)Q+="0"}return Q}yX.stringifyNumber=fX});var B9=P((uX)=>{var kX=C(),Y9=C1(),vX={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(q)=>q.slice(-3).toLowerCase()==="nan"?NaN:q[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Y9.stringifyNumber},hX={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:(q)=>parseFloat(q),stringify(q){let Z=Number(q.value);return isFinite(Z)?Z.toExponential():Y9.stringifyNumber(q)}},gX={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(q){let Z=new kX.Scalar(parseFloat(q)),X=q.indexOf(".");if(X!==-1&&q[q.length-1]==="0")Z.minFractionDigits=q.length-X-1;return Z},stringify:Y9.stringifyNumber};uX.float=gX;uX.floatExp=hX;uX.floatNaN=vX});var _9=P((aX)=>{var r2=C1(),o0=(q)=>typeof q==="bigint"||Number.isInteger(q),T9=(q,Z,X,{intAsBigInt:J})=>J?BigInt(q):parseInt(q.substring(Z),X);function n2(q,Z,X){let{value:J}=q;if(o0(J)&&J>=0)return X+J.toString(Z);return r2.stringifyNumber(q)}var pX={identify:(q)=>o0(q)&&q>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(q,Z,X)=>T9(q,2,8,X),stringify:(q)=>n2(q,8,"0o")},cX={identify:o0,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(q,Z,X)=>T9(q,0,10,X),stringify:r2.stringifyNumber},iX={identify:(q)=>o0(q)&&q>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(q,Z,X)=>T9(q,2,16,X),stringify:(q)=>n2(q,16,"0x")};aX.int=cX;aX.intHex=iX;aX.intOct=pX});var o2=P((JJ)=>{var oX=j1(),tX=n0(),eX=E1(),qJ=q0(),ZJ=G9(),L9=B9(),W9=_9(),XJ=[oX.map,eX.seq,qJ.string,tX.nullTag,ZJ.boolTag,W9.intOct,W9.int,W9.intHex,L9.floatNaN,L9.floatExp,L9.float];JJ.schema=XJ});var e2=P((BJ)=>{var QJ=C(),HJ=j1(),UJ=E1();function t2(q){return typeof q==="bigint"||Number.isInteger(q)}var t0=({value:q})=>JSON.stringify(q),zJ=[{identify:(q)=>typeof q==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(q)=>q,stringify:t0},{identify:(q)=>q==null,createNode:()=>new QJ.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:t0},{identify:(q)=>typeof q==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:(q)=>q==="true",stringify:t0},{identify:t2,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(q,Z,{intAsBigInt:X})=>X?BigInt(q):parseInt(q,10),stringify:({value:q})=>t2(q)?q.toString():JSON.stringify(q)},{identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:(q)=>parseFloat(q),stringify:t0}],GJ={default:!0,tag:"",test:/^/,resolve(q,Z){return Z(`Unresolved plain scalar ${JSON.stringify(q)}`),q}},YJ=[HJ.map,UJ.seq].concat(zJ,GJ);BJ.schema=YJ});var R9=P((WJ)=>{var Z0=r("buffer"),V9=C(),_J=r1(),LJ={identify:(q)=>q instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(q,Z){if(typeof Z0.Buffer==="function")return Z0.Buffer.from(q,"base64");else if(typeof atob==="function"){let X=atob(q.replace(/[\n\r]/g,"")),J=new Uint8Array(X.length);for(let $=0;$<X.length;++$)J[$]=X.charCodeAt($);return J}else return Z("This environment does not support reading binary tags; either Buffer or atob is required"),q},stringify({comment:q,type:Z,value:X},J,$,Q){if(!X)return"";let H=X,U;if(typeof Z0.Buffer==="function")U=H instanceof Z0.Buffer?H.toString("base64"):Z0.Buffer.from(H.buffer).toString("base64");else if(typeof btoa==="function"){let z="";for(let G=0;G<H.length;++G)z+=String.fromCharCode(H[G]);U=btoa(z)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(Z??(Z=V9.Scalar.BLOCK_LITERAL),Z!==V9.Scalar.QUOTE_DOUBLE){let z=Math.max(J.options.lineWidth-J.indent.length,J.options.minContentWidth),G=Math.ceil(U.length/z),T=Array(G);for(let Y=0,_=0;Y<G;++Y,_+=z)T[Y]=U.substr(_,z);U=T.join(Z===V9.Scalar.BLOCK_LITERAL?`
78
- `:" ")}return _J.stringifyString({comment:q,type:Z,value:U},J,$,Q)}};WJ.binary=LJ});var qq=P((KJ)=>{var e0=S(),I9=$1(),RJ=C(),IJ=U1();function q3(q,Z){if(e0.isSeq(q))for(let X=0;X<q.items.length;++X){let J=q.items[X];if(e0.isPair(J))continue;else if(e0.isMap(J)){if(J.items.length>1)Z("Each pair must have its own sequence indicator");let $=J.items[0]||new I9.Pair(new RJ.Scalar(null));if(J.commentBefore)$.key.commentBefore=$.key.commentBefore?`${J.commentBefore}
76
+ `;return`${L}
77
+ ${$}${V}`}else return`${_}${H}${Y.join(" ")}${H}${V}`}}function i0({indent:q,options:{commentString:Z}},X,J,$){if(J&&$)J=J.replace(/^\n+/,"");if(J){let Q=c0.indentComment(Z(J),q);X.push(Q.trimStart())}}HX.stringifyCollection=JX});var H1=P((TX)=>{var UX=U9(),GX=z9(),YX=k0(),Q1=A(),a0=$1(),BX=C();function e1(q,Z){let X=Q1.isScalar(Z)?Z.value:Z;for(let J of q)if(Q1.isPair(J)){if(J.key===Z||J.key===X)return J;if(Q1.isScalar(J.key)&&J.key.value===X)return J}return}class p2 extends YX.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(q){super(Q1.MAP,q);this.items=[]}static from(q,Z,X){let{keepUndefined:J,replacer:$}=X,Q=new this(q),H=(z,U)=>{if(typeof $==="function")U=$.call(Z,z,U);else if(Array.isArray($)&&!$.includes(z))return;if(U!==void 0||J)Q.items.push(a0.createPair(z,U,X))};if(Z instanceof Map)for(let[z,U]of Z)H(z,U);else if(Z&&typeof Z==="object")for(let z of Object.keys(Z))H(z,Z[z]);if(typeof q.sortMapEntries==="function")Q.items.sort(q.sortMapEntries);return Q}add(q,Z){let X;if(Q1.isPair(q))X=q;else if(!q||typeof q!=="object"||!("key"in q))X=new a0.Pair(q,q?.value);else X=new a0.Pair(q.key,q.value);let J=e1(this.items,X.key),$=this.schema?.sortMapEntries;if(J){if(!Z)throw Error(`Key ${X.key} already set`);if(Q1.isScalar(J.value)&&BX.isScalarValue(X.value))J.value.value=X.value;else J.value=X.value}else if($){let Q=this.items.findIndex((H)=>$(X,H)<0);if(Q===-1)this.items.push(X);else this.items.splice(Q,0,X)}else this.items.push(X)}delete(q){let Z=e1(this.items,q);if(!Z)return!1;return this.items.splice(this.items.indexOf(Z),1).length>0}get(q,Z){let J=e1(this.items,q)?.value;return(!Z&&Q1.isScalar(J)?J.value:J)??void 0}has(q){return!!e1(this.items,q)}set(q,Z){this.add(new a0.Pair(q,Z),!0)}toJSON(q,Z,X){let J=X?new X:Z?.mapAsMap?new Map:{};if(Z?.onCreate)Z.onCreate(J);for(let $ of this.items)GX.addPairToJSMap(Z,J,$);return J}toString(q,Z,X){if(!q)return JSON.stringify(this);for(let J of this.items)if(!Q1.isPair(J))throw Error(`Map items must all be pairs; found ${JSON.stringify(J)} instead`);if(!q.allNullValues&&this.hasAllNullValues(!1))q=Object.assign({},q,{allNullValues:!0});return UX.stringifyCollection(this,q,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:q.indent||"",onChompKeep:X,onComment:Z})}}TX.YAMLMap=p2;TX.findPair=e1});var j1=P((RX)=>{var LX=A(),c2=H1(),VX={collection:"map",default:!0,nodeClass:c2.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(q,Z){if(!LX.isMap(q))Z("Expected a mapping for this tag");return q},createNode:(q,Z,X)=>c2.YAMLMap.from(q,Z,X)};RX.map=VX});var z1=P((OX)=>{var MX=i1(),KX=U9(),DX=k0(),r0=A(),PX=C(),FX=Z1();class i2 extends DX.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(q){super(r0.SEQ,q);this.items=[]}add(q){this.items.push(q)}delete(q){let Z=s0(q);if(typeof Z!=="number")return!1;return this.items.splice(Z,1).length>0}get(q,Z){let X=s0(q);if(typeof X!=="number")return;let J=this.items[X];return!Z&&r0.isScalar(J)?J.value:J}has(q){let Z=s0(q);return typeof Z==="number"&&Z<this.items.length}set(q,Z){let X=s0(q);if(typeof X!=="number")throw Error(`Expected a valid index, not ${q}.`);let J=this.items[X];if(r0.isScalar(J)&&PX.isScalarValue(Z))J.value=Z;else this.items[X]=Z}toJSON(q,Z){let X=[];if(Z?.onCreate)Z.onCreate(X);let J=0;for(let $ of this.items)X.push(FX.toJS($,String(J++),Z));return X}toString(q,Z,X){if(!q)return JSON.stringify(this);return KX.stringifyCollection(this,q,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(q.indent||"")+" ",onChompKeep:X,onComment:Z})}static from(q,Z,X){let{replacer:J}=X,$=new this(q);if(Z&&Symbol.iterator in Object(Z)){let Q=0;for(let H of Z){if(typeof J==="function"){let z=Z instanceof Set?H:String(Q++);H=J.call(Z,z,H)}$.items.push(MX.createNode(H,void 0,X))}}return $}}function s0(q){let Z=r0.isScalar(q)?q.value:q;if(Z&&typeof Z==="string")Z=Number(Z);return typeof Z==="number"&&Number.isInteger(Z)&&Z>=0?Z:null}OX.YAMLSeq=i2});var E1=P((wX)=>{var SX=A(),a2=z1(),AX={collection:"seq",default:!0,nodeClass:a2.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(q,Z){if(!SX.isSeq(q))Z("Expected a sequence for this tag");return q},createNode:(q,Z,X)=>a2.YAMLSeq.from(q,Z,X)};wX.seq=AX});var q0=P((CX)=>{var jX=r1(),EX={identify:(q)=>typeof q==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(q)=>q,stringify(q,Z,X,J){return Z=Object.assign({actualString:!0},Z),jX.stringifyString(q,Z,X,J)}};CX.string=EX});var n0=P((yX)=>{var s2=C(),r2={identify:(q)=>q==null,createNode:()=>new s2.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new s2.Scalar(null),stringify:({source:q},Z)=>typeof q==="string"&&r2.test.test(q)?q:Z.options.nullStr};yX.nullTag=r2});var G9=P((vX)=>{var kX=C(),n2={identify:(q)=>typeof q==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:(q)=>new kX.Scalar(q[0]==="t"||q[0]==="T"),stringify({source:q,value:Z},X){if(q&&n2.test.test(q)){let J=q[0]==="t"||q[0]==="T";if(Z===J)return q}return Z?X.options.trueStr:X.options.falseStr}};vX.boolTag=n2});var C1=P((uX)=>{function gX({format:q,minFractionDigits:Z,tag:X,value:J}){if(typeof J==="bigint")return String(J);let $=typeof J==="number"?J:Number(J);if(!isFinite($))return isNaN($)?".nan":$<0?"-.inf":".inf";let Q=Object.is(J,-0)?"-0":JSON.stringify(J);if(!q&&Z&&(!X||X==="tag:yaml.org,2002:float")&&/^\d/.test(Q)){let H=Q.indexOf(".");if(H<0)H=Q.length,Q+=".";let z=Z-(Q.length-H-1);while(z-- >0)Q+="0"}return Q}uX.stringifyNumber=gX});var B9=P((iX)=>{var dX=C(),Y9=C1(),lX={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(q)=>q.slice(-3).toLowerCase()==="nan"?NaN:q[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Y9.stringifyNumber},pX={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:(q)=>parseFloat(q),stringify(q){let Z=Number(q.value);return isFinite(Z)?Z.toExponential():Y9.stringifyNumber(q)}},cX={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(q){let Z=new dX.Scalar(parseFloat(q)),X=q.indexOf(".");if(X!==-1&&q[q.length-1]==="0")Z.minFractionDigits=q.length-X-1;return Z},stringify:Y9.stringifyNumber};iX.float=cX;iX.floatExp=pX;iX.floatNaN=lX});var _9=P((eX)=>{var o2=C1(),o0=(q)=>typeof q==="bigint"||Number.isInteger(q),T9=(q,Z,X,{intAsBigInt:J})=>J?BigInt(q):parseInt(q.substring(Z),X);function t2(q,Z,X){let{value:J}=q;if(o0(J)&&J>=0)return X+J.toString(Z);return o2.stringifyNumber(q)}var nX={identify:(q)=>o0(q)&&q>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(q,Z,X)=>T9(q,2,8,X),stringify:(q)=>t2(q,8,"0o")},oX={identify:o0,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(q,Z,X)=>T9(q,0,10,X),stringify:o2.stringifyNumber},tX={identify:(q)=>o0(q)&&q>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(q,Z,X)=>T9(q,2,16,X),stringify:(q)=>t2(q,16,"0x")};eX.int=oX;eX.intHex=tX;eX.intOct=nX});var e2=P((GJ)=>{var JJ=j1(),$J=n0(),QJ=E1(),HJ=q0(),zJ=G9(),W9=B9(),L9=_9(),UJ=[JJ.map,QJ.seq,HJ.string,$J.nullTag,zJ.boolTag,L9.intOct,L9.int,L9.intHex,W9.floatNaN,W9.floatExp,W9.float];GJ.schema=UJ});var Z3=P((RJ)=>{var BJ=C(),TJ=j1(),_J=E1();function q3(q){return typeof q==="bigint"||Number.isInteger(q)}var t0=({value:q})=>JSON.stringify(q),WJ=[{identify:(q)=>typeof q==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(q)=>q,stringify:t0},{identify:(q)=>q==null,createNode:()=>new BJ.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:t0},{identify:(q)=>typeof q==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:(q)=>q==="true",stringify:t0},{identify:q3,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(q,Z,{intAsBigInt:X})=>X?BigInt(q):parseInt(q,10),stringify:({value:q})=>q3(q)?q.toString():JSON.stringify(q)},{identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:(q)=>parseFloat(q),stringify:t0}],LJ={default:!0,tag:"",test:/^/,resolve(q,Z){return Z(`Unresolved plain scalar ${JSON.stringify(q)}`),q}},VJ=[TJ.map,_J.seq].concat(WJ,LJ);RJ.schema=VJ});var R9=P((DJ)=>{var Z0=r("buffer"),V9=C(),MJ=r1(),KJ={identify:(q)=>q instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(q,Z){if(typeof Z0.Buffer==="function")return Z0.Buffer.from(q,"base64");else if(typeof atob==="function"){let X=atob(q.replace(/[\n\r]/g,"")),J=new Uint8Array(X.length);for(let $=0;$<X.length;++$)J[$]=X.charCodeAt($);return J}else return Z("This environment does not support reading binary tags; either Buffer or atob is required"),q},stringify({comment:q,type:Z,value:X},J,$,Q){if(!X)return"";let H=X,z;if(typeof Z0.Buffer==="function")z=H instanceof Z0.Buffer?H.toString("base64"):Z0.Buffer.from(H.buffer).toString("base64");else if(typeof btoa==="function"){let U="";for(let G=0;G<H.length;++G)U+=String.fromCharCode(H[G]);z=btoa(U)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(Z??(Z=V9.Scalar.BLOCK_LITERAL),Z!==V9.Scalar.QUOTE_DOUBLE){let U=Math.max(J.options.lineWidth-J.indent.length,J.options.minContentWidth),G=Math.ceil(z.length/U),T=Array(G);for(let Y=0,_=0;Y<G;++Y,_+=U)T[Y]=z.substr(_,U);z=T.join(Z===V9.Scalar.BLOCK_LITERAL?`
78
+ `:" ")}return MJ.stringifyString({comment:q,type:Z,value:z},J,$,Q)}};DJ.binary=KJ});var qq=P((SJ)=>{var e0=A(),I9=$1(),FJ=C(),OJ=z1();function X3(q,Z){if(e0.isSeq(q))for(let X=0;X<q.items.length;++X){let J=q.items[X];if(e0.isPair(J))continue;else if(e0.isMap(J)){if(J.items.length>1)Z("Each pair must have its own sequence indicator");let $=J.items[0]||new I9.Pair(new FJ.Scalar(null));if(J.commentBefore)$.key.commentBefore=$.key.commentBefore?`${J.commentBefore}
79
79
  ${$.key.commentBefore}`:J.commentBefore;if(J.comment){let Q=$.value??$.key;Q.comment=Q.comment?`${J.comment}
80
- ${Q.comment}`:J.comment}J=$}q.items[X]=e0.isPair(J)?J:new I9.Pair(J)}else Z("Expected a sequence for this tag");return q}function Z3(q,Z,X){let{replacer:J}=X,$=new IJ.YAMLSeq(q);$.tag="tag:yaml.org,2002:pairs";let Q=0;if(Z&&Symbol.iterator in Object(Z))for(let H of Z){if(typeof J==="function")H=J.call(Z,String(Q++),H);let U,z;if(Array.isArray(H))if(H.length===2)U=H[0],z=H[1];else throw TypeError(`Expected [key, value] tuple: ${H}`);else if(H&&H instanceof Object){let G=Object.keys(H);if(G.length===1)U=G[0],z=H[U];else throw TypeError(`Expected tuple with one key, not ${G.length} keys`)}else U=H;$.items.push(I9.createPair(U,z,X))}return $}var MJ={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:q3,createNode:Z3};KJ.createPairs=Z3;KJ.pairs=MJ;KJ.resolvePairs=q3});var K9=P((AJ)=>{var X3=S(),M9=Z1(),X0=H1(),OJ=U1(),J3=qq();class M1 extends OJ.YAMLSeq{constructor(){super();this.add=X0.YAMLMap.prototype.add.bind(this),this.delete=X0.YAMLMap.prototype.delete.bind(this),this.get=X0.YAMLMap.prototype.get.bind(this),this.has=X0.YAMLMap.prototype.has.bind(this),this.set=X0.YAMLMap.prototype.set.bind(this),this.tag=M1.tag}toJSON(q,Z){if(!Z)return super.toJSON(q);let X=new Map;if(Z?.onCreate)Z.onCreate(X);for(let J of this.items){let $,Q;if(X3.isPair(J))$=M9.toJS(J.key,"",Z),Q=M9.toJS(J.value,$,Z);else $=M9.toJS(J,"",Z);if(X.has($))throw Error("Ordered maps must not include duplicate keys");X.set($,Q)}return X}static from(q,Z,X){let J=J3.createPairs(q,Z,X),$=new this;return $.items=J.items,$}}M1.tag="tag:yaml.org,2002:omap";var NJ={collection:"seq",identify:(q)=>q instanceof Map,nodeClass:M1,default:!1,tag:"tag:yaml.org,2002:omap",resolve(q,Z){let X=J3.resolvePairs(q,Z),J=[];for(let{key:$}of X.items)if(X3.isScalar($))if(J.includes($.value))Z(`Ordered maps must not include duplicate keys: ${$.value}`);else J.push($.value);return Object.assign(new M1,X)},createNode:(q,Z,X)=>M1.from(q,Z,X)};AJ.YAMLOMap=M1;AJ.omap=NJ});var z3=P((bJ)=>{var $3=C();function Q3({value:q,source:Z},X){if(Z&&(q?H3:U3).test.test(Z))return Z;return q?X.options.trueStr:X.options.falseStr}var H3={identify:(q)=>q===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new $3.Scalar(!0),stringify:Q3},U3={identify:(q)=>q===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new $3.Scalar(!1),stringify:Q3};bJ.falseTag=U3;bJ.trueTag=H3});var G3=P((kJ)=>{var CJ=C(),D9=C1(),fJ={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(q)=>q.slice(-3).toLowerCase()==="nan"?NaN:q[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:D9.stringifyNumber},yJ={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:(q)=>parseFloat(q.replace(/_/g,"")),stringify(q){let Z=Number(q.value);return isFinite(Z)?Z.toExponential():D9.stringifyNumber(q)}},xJ={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(q){let Z=new CJ.Scalar(parseFloat(q.replace(/_/g,""))),X=q.indexOf(".");if(X!==-1){let J=q.substring(X+1).replace(/_/g,"");if(J[J.length-1]==="0")Z.minFractionDigits=J.length}return Z},stringify:D9.stringifyNumber};kJ.float=xJ;kJ.floatExp=yJ;kJ.floatNaN=fJ});var B3=P((pJ)=>{var Y3=C1(),J0=(q)=>typeof q==="bigint"||Number.isInteger(q);function Zq(q,Z,X,{intAsBigInt:J}){let $=q[0];if($==="-"||$==="+")Z+=1;if(q=q.substring(Z).replace(/_/g,""),J){switch(X){case 2:q=`0b${q}`;break;case 8:q=`0o${q}`;break;case 16:q=`0x${q}`;break}let H=BigInt(q);return $==="-"?BigInt(-1)*H:H}let Q=parseInt(q,X);return $==="-"?-1*Q:Q}function P9(q,Z,X){let{value:J}=q;if(J0(J)){let $=J.toString(Z);return J<0?"-"+X+$.substr(1):X+$}return Y3.stringifyNumber(q)}var uJ={identify:J0,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(q,Z,X)=>Zq(q,2,2,X),stringify:(q)=>P9(q,2,"0b")},mJ={identify:J0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(q,Z,X)=>Zq(q,1,8,X),stringify:(q)=>P9(q,8,"0")},dJ={identify:J0,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(q,Z,X)=>Zq(q,0,10,X),stringify:Y3.stringifyNumber},lJ={identify:J0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(q,Z,X)=>Zq(q,2,16,X),stringify:(q)=>P9(q,16,"0x")};pJ.int=dJ;pJ.intBin=uJ;pJ.intHex=lJ;pJ.intOct=mJ});var F9=P((nJ)=>{var $q=S(),Xq=$1(),Jq=H1();class K1 extends Jq.YAMLMap{constructor(q){super(q);this.tag=K1.tag}add(q){let Z;if($q.isPair(q))Z=q;else if(q&&typeof q==="object"&&"key"in q&&"value"in q&&q.value===null)Z=new Xq.Pair(q.key,null);else Z=new Xq.Pair(q,null);if(!Jq.findPair(this.items,Z.key))this.items.push(Z)}get(q,Z){let X=Jq.findPair(this.items,q);return!Z&&$q.isPair(X)?$q.isScalar(X.key)?X.key.value:X.key:X}set(q,Z){if(typeof Z!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof Z}`);let X=Jq.findPair(this.items,q);if(X&&!Z)this.items.splice(this.items.indexOf(X),1);else if(!X&&Z)this.items.push(new Xq.Pair(q))}toJSON(q,Z){return super.toJSON(q,Z,Set)}toString(q,Z,X){if(!q)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},q,{allNullValues:!0}),Z,X);else throw Error("Set items must all have null values")}static from(q,Z,X){let{replacer:J}=X,$=new this(q);if(Z&&Symbol.iterator in Object(Z))for(let Q of Z){if(typeof J==="function")Q=J.call(Z,Q,Q);$.items.push(Xq.createPair(Q,null,X))}return $}}K1.tag="tag:yaml.org,2002:set";var rJ={collection:"map",identify:(q)=>q instanceof Set,nodeClass:K1,default:!1,tag:"tag:yaml.org,2002:set",createNode:(q,Z,X)=>K1.from(q,Z,X),resolve(q,Z){if($q.isMap(q))if(q.hasAllNullValues(!0))return Object.assign(new K1,q);else Z("Set items must all have null values");else Z("Expected a mapping for this tag");return q}};nJ.YAMLSet=K1;nJ.set=rJ});var N9=P((X$)=>{var eJ=C1();function O9(q,Z){let X=q[0],J=X==="-"||X==="+"?q.substring(1):q,$=(H)=>Z?BigInt(H):Number(H),Q=J.replace(/_/g,"").split(":").reduce((H,U)=>H*$(60)+$(U),$(0));return X==="-"?$(-1)*Q:Q}function T3(q){let{value:Z}=q,X=(H)=>H;if(typeof Z==="bigint")X=(H)=>BigInt(H);else if(isNaN(Z)||!isFinite(Z))return eJ.stringifyNumber(q);let J="";if(Z<0)J="-",Z*=X(-1);let $=X(60),Q=[Z%$];if(Z<60)Q.unshift(0);else if(Z=(Z-Q[0])/$,Q.unshift(Z%$),Z>=60)Z=(Z-Q[0])/$,Q.unshift(Z);return J+Q.map((H)=>String(H).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var q$={identify:(q)=>typeof q==="bigint"||Number.isInteger(q),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(q,Z,{intAsBigInt:X})=>O9(q,X),stringify:T3},Z$={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:(q)=>O9(q,!1),stringify:T3},_3={identify:(q)=>q instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(q){let Z=q.match(_3.test);if(!Z)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,X,J,$,Q,H,U]=Z.map(Number),z=Z[7]?Number((Z[7]+"00").substr(1,3)):0,G=Date.UTC(X,J-1,$,Q||0,H||0,U||0,z),T=Z[8];if(T&&T!=="Z"){let Y=O9(T,!1);if(Math.abs(Y)<30)Y*=60;G-=60000*Y}return new Date(G)},stringify:({value:q})=>q?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};X$.floatTime=Z$;X$.intTime=q$;X$.timestamp=_3});var W3=P((V$)=>{var H$=j1(),U$=n0(),z$=E1(),G$=q0(),Y$=R9(),L3=z3(),A9=G3(),Qq=B3(),B$=d0(),T$=K9(),_$=qq(),L$=F9(),S9=N9(),W$=[H$.map,z$.seq,G$.string,U$.nullTag,L3.trueTag,L3.falseTag,Qq.intBin,Qq.intOct,Qq.int,Qq.intHex,A9.floatNaN,A9.floatExp,A9.float,Y$.binary,B$.merge,T$.omap,_$.pairs,L$.set,S9.intTime,S9.floatTime,S9.timestamp];V$.schema=W$});var N3=P((N$)=>{var M3=j1(),I$=n0(),K3=E1(),M$=q0(),K$=G9(),w9=B9(),b9=_9(),D$=o2(),P$=e2(),D3=R9(),$0=d0(),P3=K9(),F3=qq(),V3=W3(),O3=F9(),Hq=N9(),R3=new Map([["core",D$.schema],["failsafe",[M3.map,K3.seq,M$.string]],["json",P$.schema],["yaml11",V3.schema],["yaml-1.1",V3.schema]]),I3={binary:D3.binary,bool:K$.boolTag,float:w9.float,floatExp:w9.floatExp,floatNaN:w9.floatNaN,floatTime:Hq.floatTime,int:b9.int,intHex:b9.intHex,intOct:b9.intOct,intTime:Hq.intTime,map:M3.map,merge:$0.merge,null:I$.nullTag,omap:P3.omap,pairs:F3.pairs,seq:K3.seq,set:O3.set,timestamp:Hq.timestamp},F$={"tag:yaml.org,2002:binary":D3.binary,"tag:yaml.org,2002:merge":$0.merge,"tag:yaml.org,2002:omap":P3.omap,"tag:yaml.org,2002:pairs":F3.pairs,"tag:yaml.org,2002:set":O3.set,"tag:yaml.org,2002:timestamp":Hq.timestamp};function O$(q,Z,X){let J=R3.get(Z);if(J&&!q)return X&&!J.includes($0.merge)?J.concat($0.merge):J.slice();let $=J;if(!$)if(Array.isArray(q))$=[];else{let Q=Array.from(R3.keys()).filter((H)=>H!=="yaml11").map((H)=>JSON.stringify(H)).join(", ");throw Error(`Unknown schema "${Z}"; use one of ${Q} or define customTags array`)}if(Array.isArray(q))for(let Q of q)$=$.concat(Q);else if(typeof q==="function")$=q($.slice());if(X)$=$.concat($0.merge);return $.reduce((Q,H)=>{let U=typeof H==="string"?I3[H]:H;if(!U){let z=JSON.stringify(H),G=Object.keys(I3).map((T)=>JSON.stringify(T)).join(", ");throw Error(`Unknown custom tag ${z}; use one of ${G}`)}if(!Q.includes(U))Q.push(U);return Q},[])}N$.coreKnownTags=F$;N$.getTags=O$});var C9=P((C$)=>{var j9=S(),w$=j1(),b$=E1(),j$=q0(),Uq=N3(),E$=(q,Z)=>q.key<Z.key?-1:q.key>Z.key?1:0;class E9{constructor({compat:q,customTags:Z,merge:X,resolveKnownTags:J,schema:$,sortMapEntries:Q,toStringDefaults:H}){this.compat=Array.isArray(q)?Uq.getTags(q,"compat"):q?Uq.getTags(null,q):null,this.name=typeof $==="string"&&$||"core",this.knownTags=J?Uq.coreKnownTags:{},this.tags=Uq.getTags(Z,this.name,X),this.toStringOptions=H??null,Object.defineProperty(this,j9.MAP,{value:w$.map}),Object.defineProperty(this,j9.SCALAR,{value:j$.string}),Object.defineProperty(this,j9.SEQ,{value:b$.seq}),this.sortMapEntries=typeof Q==="function"?Q:Q===!0?E$:null}clone(){let q=Object.create(E9.prototype,Object.getOwnPropertyDescriptors(this));return q.tags=this.tags.slice(),q}}C$.Schema=E9});var A3=P((k$)=>{var y$=S(),f9=n1(),Q0=a1();function x$(q,Z){let X=[],J=Z.directives===!0;if(Z.directives!==!1&&q.directives){let z=q.directives.toString(q);if(z)X.push(z),J=!0;else if(q.directives.docStart)J=!0}if(J)X.push("---");let $=f9.createStringifyContext(q,Z),{commentString:Q}=$.options;if(q.commentBefore){if(X.length!==1)X.unshift("");let z=Q(q.commentBefore);X.unshift(Q0.indentComment(z,""))}let H=!1,U=null;if(q.contents){if(y$.isNode(q.contents)){if(q.contents.spaceBefore&&J)X.push("");if(q.contents.commentBefore){let T=Q(q.contents.commentBefore);X.push(Q0.indentComment(T,""))}$.forceBlockIndent=!!q.comment,U=q.contents.comment}let z=U?void 0:()=>H=!0,G=f9.stringify(q.contents,$,()=>U=null,z);if(U)G+=Q0.lineComment(G,"",Q(U));if((G[0]==="|"||G[0]===">")&&X[X.length-1]==="---")X[X.length-1]=`--- ${G}`;else X.push(G)}else X.push(f9.stringify(q.contents,$));if(q.directives?.docEnd)if(q.comment){let z=Q(q.comment);if(z.includes(`
81
- `))X.push("..."),X.push(Q0.indentComment(z,""));else X.push(`... ${z}`)}else X.push("...");else{let z=q.comment;if(z&&H)z=z.replace(/^\n+/,"");if(z){if((!H||U)&&X[X.length-1]!=="")X.push("");X.push(Q0.indentComment(Q(z),""))}}return X.join(`
80
+ ${Q.comment}`:J.comment}J=$}q.items[X]=e0.isPair(J)?J:new I9.Pair(J)}else Z("Expected a sequence for this tag");return q}function J3(q,Z,X){let{replacer:J}=X,$=new OJ.YAMLSeq(q);$.tag="tag:yaml.org,2002:pairs";let Q=0;if(Z&&Symbol.iterator in Object(Z))for(let H of Z){if(typeof J==="function")H=J.call(Z,String(Q++),H);let z,U;if(Array.isArray(H))if(H.length===2)z=H[0],U=H[1];else throw TypeError(`Expected [key, value] tuple: ${H}`);else if(H&&H instanceof Object){let G=Object.keys(H);if(G.length===1)z=G[0],U=H[z];else throw TypeError(`Expected tuple with one key, not ${G.length} keys`)}else z=H;$.items.push(I9.createPair(z,U,X))}return $}var NJ={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:X3,createNode:J3};SJ.createPairs=J3;SJ.pairs=NJ;SJ.resolvePairs=X3});var K9=P((CJ)=>{var $3=A(),M9=Z1(),X0=H1(),jJ=z1(),Q3=qq();class M1 extends jJ.YAMLSeq{constructor(){super();this.add=X0.YAMLMap.prototype.add.bind(this),this.delete=X0.YAMLMap.prototype.delete.bind(this),this.get=X0.YAMLMap.prototype.get.bind(this),this.has=X0.YAMLMap.prototype.has.bind(this),this.set=X0.YAMLMap.prototype.set.bind(this),this.tag=M1.tag}toJSON(q,Z){if(!Z)return super.toJSON(q);let X=new Map;if(Z?.onCreate)Z.onCreate(X);for(let J of this.items){let $,Q;if($3.isPair(J))$=M9.toJS(J.key,"",Z),Q=M9.toJS(J.value,$,Z);else $=M9.toJS(J,"",Z);if(X.has($))throw Error("Ordered maps must not include duplicate keys");X.set($,Q)}return X}static from(q,Z,X){let J=Q3.createPairs(q,Z,X),$=new this;return $.items=J.items,$}}M1.tag="tag:yaml.org,2002:omap";var EJ={collection:"seq",identify:(q)=>q instanceof Map,nodeClass:M1,default:!1,tag:"tag:yaml.org,2002:omap",resolve(q,Z){let X=Q3.resolvePairs(q,Z),J=[];for(let{key:$}of X.items)if($3.isScalar($))if(J.includes($.value))Z(`Ordered maps must not include duplicate keys: ${$.value}`);else J.push($.value);return Object.assign(new M1,X)},createNode:(q,Z,X)=>M1.from(q,Z,X)};CJ.YAMLOMap=M1;CJ.omap=EJ});var Y3=P((xJ)=>{var H3=C();function z3({value:q,source:Z},X){if(Z&&(q?U3:G3).test.test(Z))return Z;return q?X.options.trueStr:X.options.falseStr}var U3={identify:(q)=>q===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new H3.Scalar(!0),stringify:z3},G3={identify:(q)=>q===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new H3.Scalar(!1),stringify:z3};xJ.falseTag=G3;xJ.trueTag=U3});var B3=P((dJ)=>{var hJ=C(),D9=C1(),gJ={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(q)=>q.slice(-3).toLowerCase()==="nan"?NaN:q[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:D9.stringifyNumber},uJ={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:(q)=>parseFloat(q.replace(/_/g,"")),stringify(q){let Z=Number(q.value);return isFinite(Z)?Z.toExponential():D9.stringifyNumber(q)}},mJ={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(q){let Z=new hJ.Scalar(parseFloat(q.replace(/_/g,""))),X=q.indexOf(".");if(X!==-1){let J=q.substring(X+1).replace(/_/g,"");if(J[J.length-1]==="0")Z.minFractionDigits=J.length}return Z},stringify:D9.stringifyNumber};dJ.float=mJ;dJ.floatExp=uJ;dJ.floatNaN=gJ});var _3=P((nJ)=>{var T3=C1(),J0=(q)=>typeof q==="bigint"||Number.isInteger(q);function Zq(q,Z,X,{intAsBigInt:J}){let $=q[0];if($==="-"||$==="+")Z+=1;if(q=q.substring(Z).replace(/_/g,""),J){switch(X){case 2:q=`0b${q}`;break;case 8:q=`0o${q}`;break;case 16:q=`0x${q}`;break}let H=BigInt(q);return $==="-"?BigInt(-1)*H:H}let Q=parseInt(q,X);return $==="-"?-1*Q:Q}function P9(q,Z,X){let{value:J}=q;if(J0(J)){let $=J.toString(Z);return J<0?"-"+X+$.substr(1):X+$}return T3.stringifyNumber(q)}var iJ={identify:J0,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(q,Z,X)=>Zq(q,2,2,X),stringify:(q)=>P9(q,2,"0b")},aJ={identify:J0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(q,Z,X)=>Zq(q,1,8,X),stringify:(q)=>P9(q,8,"0")},sJ={identify:J0,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(q,Z,X)=>Zq(q,0,10,X),stringify:T3.stringifyNumber},rJ={identify:J0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(q,Z,X)=>Zq(q,2,16,X),stringify:(q)=>P9(q,16,"0x")};nJ.int=sJ;nJ.intBin=iJ;nJ.intHex=rJ;nJ.intOct=aJ});var F9=P((X$)=>{var $q=A(),Xq=$1(),Jq=H1();class K1 extends Jq.YAMLMap{constructor(q){super(q);this.tag=K1.tag}add(q){let Z;if($q.isPair(q))Z=q;else if(q&&typeof q==="object"&&"key"in q&&"value"in q&&q.value===null)Z=new Xq.Pair(q.key,null);else Z=new Xq.Pair(q,null);if(!Jq.findPair(this.items,Z.key))this.items.push(Z)}get(q,Z){let X=Jq.findPair(this.items,q);return!Z&&$q.isPair(X)?$q.isScalar(X.key)?X.key.value:X.key:X}set(q,Z){if(typeof Z!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof Z}`);let X=Jq.findPair(this.items,q);if(X&&!Z)this.items.splice(this.items.indexOf(X),1);else if(!X&&Z)this.items.push(new Xq.Pair(q))}toJSON(q,Z){return super.toJSON(q,Z,Set)}toString(q,Z,X){if(!q)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},q,{allNullValues:!0}),Z,X);else throw Error("Set items must all have null values")}static from(q,Z,X){let{replacer:J}=X,$=new this(q);if(Z&&Symbol.iterator in Object(Z))for(let Q of Z){if(typeof J==="function")Q=J.call(Z,Q,Q);$.items.push(Xq.createPair(Q,null,X))}return $}}K1.tag="tag:yaml.org,2002:set";var Z$={collection:"map",identify:(q)=>q instanceof Set,nodeClass:K1,default:!1,tag:"tag:yaml.org,2002:set",createNode:(q,Z,X)=>K1.from(q,Z,X),resolve(q,Z){if($q.isMap(q))if(q.hasAllNullValues(!0))return Object.assign(new K1,q);else Z("Set items must all have null values");else Z("Expected a mapping for this tag");return q}};X$.YAMLSet=K1;X$.set=Z$});var N9=P((U$)=>{var Q$=C1();function O9(q,Z){let X=q[0],J=X==="-"||X==="+"?q.substring(1):q,$=(H)=>Z?BigInt(H):Number(H),Q=J.replace(/_/g,"").split(":").reduce((H,z)=>H*$(60)+$(z),$(0));return X==="-"?$(-1)*Q:Q}function W3(q){let{value:Z}=q,X=(H)=>H;if(typeof Z==="bigint")X=(H)=>BigInt(H);else if(isNaN(Z)||!isFinite(Z))return Q$.stringifyNumber(q);let J="";if(Z<0)J="-",Z*=X(-1);let $=X(60),Q=[Z%$];if(Z<60)Q.unshift(0);else if(Z=(Z-Q[0])/$,Q.unshift(Z%$),Z>=60)Z=(Z-Q[0])/$,Q.unshift(Z);return J+Q.map((H)=>String(H).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var H$={identify:(q)=>typeof q==="bigint"||Number.isInteger(q),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(q,Z,{intAsBigInt:X})=>O9(q,X),stringify:W3},z$={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:(q)=>O9(q,!1),stringify:W3},L3={identify:(q)=>q instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(q){let Z=q.match(L3.test);if(!Z)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,X,J,$,Q,H,z]=Z.map(Number),U=Z[7]?Number((Z[7]+"00").substr(1,3)):0,G=Date.UTC(X,J-1,$,Q||0,H||0,z||0,U),T=Z[8];if(T&&T!=="Z"){let Y=O9(T,!1);if(Math.abs(Y)<30)Y*=60;G-=60000*Y}return new Date(G)},stringify:({value:q})=>q?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};U$.floatTime=z$;U$.intTime=H$;U$.timestamp=L3});var R3=P((P$)=>{var T$=j1(),_$=n0(),W$=E1(),L$=q0(),V$=R9(),V3=Y3(),S9=B3(),Qq=_3(),R$=d0(),I$=K9(),M$=qq(),K$=F9(),A9=N9(),D$=[T$.map,W$.seq,L$.string,_$.nullTag,V3.trueTag,V3.falseTag,Qq.intBin,Qq.intOct,Qq.int,Qq.intHex,S9.floatNaN,S9.floatExp,S9.float,V$.binary,R$.merge,I$.omap,M$.pairs,K$.set,A9.intTime,A9.floatTime,A9.timestamp];P$.schema=D$});var A3=P((E$)=>{var D3=j1(),O$=n0(),P3=E1(),N$=q0(),S$=G9(),w9=B9(),b9=_9(),A$=e2(),w$=Z3(),F3=R9(),$0=d0(),O3=K9(),N3=qq(),I3=R3(),S3=F9(),Hq=N9(),M3=new Map([["core",A$.schema],["failsafe",[D3.map,P3.seq,N$.string]],["json",w$.schema],["yaml11",I3.schema],["yaml-1.1",I3.schema]]),K3={binary:F3.binary,bool:S$.boolTag,float:w9.float,floatExp:w9.floatExp,floatNaN:w9.floatNaN,floatTime:Hq.floatTime,int:b9.int,intHex:b9.intHex,intOct:b9.intOct,intTime:Hq.intTime,map:D3.map,merge:$0.merge,null:O$.nullTag,omap:O3.omap,pairs:N3.pairs,seq:P3.seq,set:S3.set,timestamp:Hq.timestamp},b$={"tag:yaml.org,2002:binary":F3.binary,"tag:yaml.org,2002:merge":$0.merge,"tag:yaml.org,2002:omap":O3.omap,"tag:yaml.org,2002:pairs":N3.pairs,"tag:yaml.org,2002:set":S3.set,"tag:yaml.org,2002:timestamp":Hq.timestamp};function j$(q,Z,X){let J=M3.get(Z);if(J&&!q)return X&&!J.includes($0.merge)?J.concat($0.merge):J.slice();let $=J;if(!$)if(Array.isArray(q))$=[];else{let Q=Array.from(M3.keys()).filter((H)=>H!=="yaml11").map((H)=>JSON.stringify(H)).join(", ");throw Error(`Unknown schema "${Z}"; use one of ${Q} or define customTags array`)}if(Array.isArray(q))for(let Q of q)$=$.concat(Q);else if(typeof q==="function")$=q($.slice());if(X)$=$.concat($0.merge);return $.reduce((Q,H)=>{let z=typeof H==="string"?K3[H]:H;if(!z){let U=JSON.stringify(H),G=Object.keys(K3).map((T)=>JSON.stringify(T)).join(", ");throw Error(`Unknown custom tag ${U}; use one of ${G}`)}if(!Q.includes(z))Q.push(z);return Q},[])}E$.coreKnownTags=b$;E$.getTags=j$});var C9=P((h$)=>{var j9=A(),y$=j1(),x$=E1(),k$=q0(),zq=A3(),v$=(q,Z)=>q.key<Z.key?-1:q.key>Z.key?1:0;class E9{constructor({compat:q,customTags:Z,merge:X,resolveKnownTags:J,schema:$,sortMapEntries:Q,toStringDefaults:H}){this.compat=Array.isArray(q)?zq.getTags(q,"compat"):q?zq.getTags(null,q):null,this.name=typeof $==="string"&&$||"core",this.knownTags=J?zq.coreKnownTags:{},this.tags=zq.getTags(Z,this.name,X),this.toStringOptions=H??null,Object.defineProperty(this,j9.MAP,{value:y$.map}),Object.defineProperty(this,j9.SCALAR,{value:k$.string}),Object.defineProperty(this,j9.SEQ,{value:x$.seq}),this.sortMapEntries=typeof Q==="function"?Q:Q===!0?v$:null}clone(){let q=Object.create(E9.prototype,Object.getOwnPropertyDescriptors(this));return q.tags=this.tags.slice(),q}}h$.Schema=E9});var w3=P((d$)=>{var u$=A(),f9=n1(),Q0=a1();function m$(q,Z){let X=[],J=Z.directives===!0;if(Z.directives!==!1&&q.directives){let U=q.directives.toString(q);if(U)X.push(U),J=!0;else if(q.directives.docStart)J=!0}if(J)X.push("---");let $=f9.createStringifyContext(q,Z),{commentString:Q}=$.options;if(q.commentBefore){if(X.length!==1)X.unshift("");let U=Q(q.commentBefore);X.unshift(Q0.indentComment(U,""))}let H=!1,z=null;if(q.contents){if(u$.isNode(q.contents)){if(q.contents.spaceBefore&&J)X.push("");if(q.contents.commentBefore){let T=Q(q.contents.commentBefore);X.push(Q0.indentComment(T,""))}$.forceBlockIndent=!!q.comment,z=q.contents.comment}let U=z?void 0:()=>H=!0,G=f9.stringify(q.contents,$,()=>z=null,U);if(z)G+=Q0.lineComment(G,"",Q(z));if((G[0]==="|"||G[0]===">")&&X[X.length-1]==="---")X[X.length-1]=`--- ${G}`;else X.push(G)}else X.push(f9.stringify(q.contents,$));if(q.directives?.docEnd)if(q.comment){let U=Q(q.comment);if(U.includes(`
81
+ `))X.push("..."),X.push(Q0.indentComment(U,""));else X.push(`... ${U}`)}else X.push("...");else{let U=q.comment;if(U&&H)U=U.replace(/^\n+/,"");if(U){if((!H||z)&&X[X.length-1]!=="")X.push("");X.push(Q0.indentComment(Q(U),""))}}return X.join(`
82
82
  `)+`
83
- `}k$.stringifyDocument=x$});var H0=P((c$)=>{var h$=c1(),f1=k0(),u=S(),g$=$1(),u$=Z1(),m$=C9(),d$=A3(),y9=f0(),l$=eq(),p$=i1(),x9=tq();class k9{constructor(q,Z,X){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,u.NODE_TYPE,{value:u.DOC});let J=null;if(typeof Z==="function"||Array.isArray(Z))J=Z;else if(X===void 0&&Z)X=Z,Z=void 0;let $=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},X);this.options=$;let{version:Q}=$;if(X?._directives){if(this.directives=X._directives.atDocument(),this.directives.yaml.explicit)Q=this.directives.yaml.version}else this.directives=new x9.Directives({version:Q});this.setSchema(Q,X),this.contents=q===void 0?null:this.createNode(q,J,X)}clone(){let q=Object.create(k9.prototype,{[u.NODE_TYPE]:{value:u.DOC}});if(q.commentBefore=this.commentBefore,q.comment=this.comment,q.errors=this.errors.slice(),q.warnings=this.warnings.slice(),q.options=Object.assign({},this.options),this.directives)q.directives=this.directives.clone();if(q.schema=this.schema.clone(),q.contents=u.isNode(this.contents)?this.contents.clone(q.schema):this.contents,this.range)q.range=this.range.slice();return q}add(q){if(y1(this.contents))this.contents.add(q)}addIn(q,Z){if(y1(this.contents))this.contents.addIn(q,Z)}createAlias(q,Z){if(!q.anchor){let X=y9.anchorNames(this);q.anchor=!Z||X.has(Z)?y9.findNewAnchor(Z||"a",X):Z}return new h$.Alias(q.anchor)}createNode(q,Z,X){let J=void 0;if(typeof Z==="function")q=Z.call({"":q},"",q),J=Z;else if(Array.isArray(Z)){let B=(I)=>typeof I==="number"||I instanceof String||I instanceof Number,L=Z.filter(B).map(String);if(L.length>0)Z=Z.concat(L);J=Z}else if(X===void 0&&Z)X=Z,Z=void 0;let{aliasDuplicateObjects:$,anchorPrefix:Q,flow:H,keepUndefined:U,onTagObj:z,tag:G}=X??{},{onAnchor:T,setAnchors:Y,sourceObjects:_}=y9.createNodeAnchors(this,Q||"a"),V={aliasDuplicateObjects:$??!0,keepUndefined:U??!1,onAnchor:T,onTagObj:z,replacer:J,schema:this.schema,sourceObjects:_},W=p$.createNode(q,G,V);if(H&&u.isCollection(W))W.flow=!0;return Y(),W}createPair(q,Z,X={}){let J=this.createNode(q,null,X),$=this.createNode(Z,null,X);return new g$.Pair(J,$)}delete(q){return y1(this.contents)?this.contents.delete(q):!1}deleteIn(q){if(f1.isEmptyPath(q)){if(this.contents==null)return!1;return this.contents=null,!0}return y1(this.contents)?this.contents.deleteIn(q):!1}get(q,Z){return u.isCollection(this.contents)?this.contents.get(q,Z):void 0}getIn(q,Z){if(f1.isEmptyPath(q))return!Z&&u.isScalar(this.contents)?this.contents.value:this.contents;return u.isCollection(this.contents)?this.contents.getIn(q,Z):void 0}has(q){return u.isCollection(this.contents)?this.contents.has(q):!1}hasIn(q){if(f1.isEmptyPath(q))return this.contents!==void 0;return u.isCollection(this.contents)?this.contents.hasIn(q):!1}set(q,Z){if(this.contents==null)this.contents=f1.collectionFromPath(this.schema,[q],Z);else if(y1(this.contents))this.contents.set(q,Z)}setIn(q,Z){if(f1.isEmptyPath(q))this.contents=Z;else if(this.contents==null)this.contents=f1.collectionFromPath(this.schema,Array.from(q),Z);else if(y1(this.contents))this.contents.setIn(q,Z)}setSchema(q,Z={}){if(typeof q==="number")q=String(q);let X;switch(q){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new x9.Directives({version:"1.1"});X={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=q;else this.directives=new x9.Directives({version:q});X={resolveKnownTags:!0,schema:"core"};break;case null:if(this.directives)delete this.directives;X=null;break;default:{let J=JSON.stringify(q);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${J}`)}}if(Z.schema instanceof Object)this.schema=Z.schema;else if(X)this.schema=new m$.Schema(Object.assign(X,Z));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:q,jsonArg:Z,mapAsMap:X,maxAliasCount:J,onAnchor:$,reviver:Q}={}){let H={anchors:new Map,doc:this,keep:!q,mapAsMap:X===!0,mapKeyWarned:!1,maxAliasCount:typeof J==="number"?J:100},U=u$.toJS(this.contents,Z??"",H);if(typeof $==="function")for(let{count:z,res:G}of H.anchors.values())$(G,z);return typeof Q==="function"?l$.applyReviver(Q,{"":U},"",U):U}toJSON(q,Z){return this.toJS({json:!0,jsonArg:q,mapAsMap:!1,onAnchor:Z})}toString(q={}){if(this.errors.length>0)throw Error("Document with errors cannot be stringified");if("indent"in q&&(!Number.isInteger(q.indent)||Number(q.indent)<=0)){let Z=JSON.stringify(q.indent);throw Error(`"indent" option must be a positive integer, not ${Z}`)}return d$.stringifyDocument(this,q)}}function y1(q){if(u.isCollection(q))return!0;throw Error("Expected a YAML collection as document contents")}c$.Document=k9});var U0=P((s$)=>{class zq extends Error{constructor(q,Z,X,J){super();this.name=q,this.code=X,this.message=J,this.pos=Z}}class S3 extends zq{constructor(q,Z,X){super("YAMLParseError",q,Z,X)}}class w3 extends zq{constructor(q,Z,X){super("YAMLWarning",q,Z,X)}}var a$=(q,Z)=>(X)=>{if(X.pos[0]===-1)return;X.linePos=X.pos.map((U)=>Z.linePos(U));let{line:J,col:$}=X.linePos[0];X.message+=` at line ${J}, column ${$}`;let Q=$-1,H=q.substring(Z.lineStarts[J-1],Z.lineStarts[J]).replace(/[\n\r]+$/,"");if(Q>=60&&H.length>80){let U=Math.min(Q-39,H.length-79);H="…"+H.substring(U),Q-=U-1}if(H.length>80)H=H.substring(0,79)+"…";if(J>1&&/^ *$/.test(H.substring(0,Q))){let U=q.substring(Z.lineStarts[J-2],Z.lineStarts[J-1]);if(U.length>80)U=U.substring(0,79)+`…
84
- `;H=U+H}if(/[^ ]/.test(H)){let U=1,z=X.linePos[1];if(z?.line===J&&z.col>$)U=Math.max(1,Math.min(z.col-$,80-Q));let G=" ".repeat(Q)+"^".repeat(U);X.message+=`:
83
+ `}d$.stringifyDocument=m$});var H0=P((o$)=>{var p$=c1(),f1=k0(),u=A(),c$=$1(),i$=Z1(),a$=C9(),s$=w3(),y9=f0(),r$=eq(),n$=i1(),x9=tq();class k9{constructor(q,Z,X){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,u.NODE_TYPE,{value:u.DOC});let J=null;if(typeof Z==="function"||Array.isArray(Z))J=Z;else if(X===void 0&&Z)X=Z,Z=void 0;let $=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},X);this.options=$;let{version:Q}=$;if(X?._directives){if(this.directives=X._directives.atDocument(),this.directives.yaml.explicit)Q=this.directives.yaml.version}else this.directives=new x9.Directives({version:Q});this.setSchema(Q,X),this.contents=q===void 0?null:this.createNode(q,J,X)}clone(){let q=Object.create(k9.prototype,{[u.NODE_TYPE]:{value:u.DOC}});if(q.commentBefore=this.commentBefore,q.comment=this.comment,q.errors=this.errors.slice(),q.warnings=this.warnings.slice(),q.options=Object.assign({},this.options),this.directives)q.directives=this.directives.clone();if(q.schema=this.schema.clone(),q.contents=u.isNode(this.contents)?this.contents.clone(q.schema):this.contents,this.range)q.range=this.range.slice();return q}add(q){if(y1(this.contents))this.contents.add(q)}addIn(q,Z){if(y1(this.contents))this.contents.addIn(q,Z)}createAlias(q,Z){if(!q.anchor){let X=y9.anchorNames(this);q.anchor=!Z||X.has(Z)?y9.findNewAnchor(Z||"a",X):Z}return new p$.Alias(q.anchor)}createNode(q,Z,X){let J=void 0;if(typeof Z==="function")q=Z.call({"":q},"",q),J=Z;else if(Array.isArray(Z)){let B=(I)=>typeof I==="number"||I instanceof String||I instanceof Number,W=Z.filter(B).map(String);if(W.length>0)Z=Z.concat(W);J=Z}else if(X===void 0&&Z)X=Z,Z=void 0;let{aliasDuplicateObjects:$,anchorPrefix:Q,flow:H,keepUndefined:z,onTagObj:U,tag:G}=X??{},{onAnchor:T,setAnchors:Y,sourceObjects:_}=y9.createNodeAnchors(this,Q||"a"),V={aliasDuplicateObjects:$??!0,keepUndefined:z??!1,onAnchor:T,onTagObj:U,replacer:J,schema:this.schema,sourceObjects:_},L=n$.createNode(q,G,V);if(H&&u.isCollection(L))L.flow=!0;return Y(),L}createPair(q,Z,X={}){let J=this.createNode(q,null,X),$=this.createNode(Z,null,X);return new c$.Pair(J,$)}delete(q){return y1(this.contents)?this.contents.delete(q):!1}deleteIn(q){if(f1.isEmptyPath(q)){if(this.contents==null)return!1;return this.contents=null,!0}return y1(this.contents)?this.contents.deleteIn(q):!1}get(q,Z){return u.isCollection(this.contents)?this.contents.get(q,Z):void 0}getIn(q,Z){if(f1.isEmptyPath(q))return!Z&&u.isScalar(this.contents)?this.contents.value:this.contents;return u.isCollection(this.contents)?this.contents.getIn(q,Z):void 0}has(q){return u.isCollection(this.contents)?this.contents.has(q):!1}hasIn(q){if(f1.isEmptyPath(q))return this.contents!==void 0;return u.isCollection(this.contents)?this.contents.hasIn(q):!1}set(q,Z){if(this.contents==null)this.contents=f1.collectionFromPath(this.schema,[q],Z);else if(y1(this.contents))this.contents.set(q,Z)}setIn(q,Z){if(f1.isEmptyPath(q))this.contents=Z;else if(this.contents==null)this.contents=f1.collectionFromPath(this.schema,Array.from(q),Z);else if(y1(this.contents))this.contents.setIn(q,Z)}setSchema(q,Z={}){if(typeof q==="number")q=String(q);let X;switch(q){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new x9.Directives({version:"1.1"});X={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=q;else this.directives=new x9.Directives({version:q});X={resolveKnownTags:!0,schema:"core"};break;case null:if(this.directives)delete this.directives;X=null;break;default:{let J=JSON.stringify(q);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${J}`)}}if(Z.schema instanceof Object)this.schema=Z.schema;else if(X)this.schema=new a$.Schema(Object.assign(X,Z));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:q,jsonArg:Z,mapAsMap:X,maxAliasCount:J,onAnchor:$,reviver:Q}={}){let H={anchors:new Map,doc:this,keep:!q,mapAsMap:X===!0,mapKeyWarned:!1,maxAliasCount:typeof J==="number"?J:100},z=i$.toJS(this.contents,Z??"",H);if(typeof $==="function")for(let{count:U,res:G}of H.anchors.values())$(G,U);return typeof Q==="function"?r$.applyReviver(Q,{"":z},"",z):z}toJSON(q,Z){return this.toJS({json:!0,jsonArg:q,mapAsMap:!1,onAnchor:Z})}toString(q={}){if(this.errors.length>0)throw Error("Document with errors cannot be stringified");if("indent"in q&&(!Number.isInteger(q.indent)||Number(q.indent)<=0)){let Z=JSON.stringify(q.indent);throw Error(`"indent" option must be a positive integer, not ${Z}`)}return s$.stringifyDocument(this,q)}}function y1(q){if(u.isCollection(q))return!0;throw Error("Expected a YAML collection as document contents")}o$.Document=k9});var z0=P((qQ)=>{class Uq extends Error{constructor(q,Z,X,J){super();this.name=q,this.code=X,this.message=J,this.pos=Z}}class b3 extends Uq{constructor(q,Z,X){super("YAMLParseError",q,Z,X)}}class j3 extends Uq{constructor(q,Z,X){super("YAMLWarning",q,Z,X)}}var e$=(q,Z)=>(X)=>{if(X.pos[0]===-1)return;X.linePos=X.pos.map((z)=>Z.linePos(z));let{line:J,col:$}=X.linePos[0];X.message+=` at line ${J}, column ${$}`;let Q=$-1,H=q.substring(Z.lineStarts[J-1],Z.lineStarts[J]).replace(/[\n\r]+$/,"");if(Q>=60&&H.length>80){let z=Math.min(Q-39,H.length-79);H="…"+H.substring(z),Q-=z-1}if(H.length>80)H=H.substring(0,79)+"…";if(J>1&&/^ *$/.test(H.substring(0,Q))){let z=q.substring(Z.lineStarts[J-2],Z.lineStarts[J-1]);if(z.length>80)z=z.substring(0,79)+`…
84
+ `;H=z+H}if(/[^ ]/.test(H)){let z=1,U=X.linePos[1];if(U?.line===J&&U.col>$)z=Math.max(1,Math.min(U.col-$,80-Q));let G=" ".repeat(Q)+"^".repeat(z);X.message+=`:
85
85
 
86
86
  ${H}
87
87
  ${G}
88
- `}};s$.YAMLError=zq;s$.YAMLParseError=S3;s$.YAMLWarning=w3;s$.prettifyError=a$});var z0=P((qQ)=>{function e$(q,{flow:Z,indicator:X,next:J,offset:$,onError:Q,parentIndent:H,startOnNewline:U}){let z=!1,G=U,T=U,Y="",_="",V=!1,W=!1,B=null,L=null,I=null,M=null,D=null,O=null,N=null;for(let R of q){if(W){if(R.type!=="space"&&R.type!=="newline"&&R.type!=="comma")Q(R.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");W=!1}if(B){if(G&&R.type!=="comment"&&R.type!=="newline")Q(B,"TAB_AS_INDENT","Tabs are not allowed as indentation");B=null}switch(R.type){case"space":if(!Z&&(X!=="doc-start"||J?.type!=="flow-collection")&&R.source.includes("\t"))B=R;T=!0;break;case"comment":{if(!T)Q(R,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let w=R.source.substring(1)||" ";if(!Y)Y=w;else Y+=_+w;_="",G=!1;break}case"newline":if(G){if(Y)Y+=R.source;else if(!O||X!=="seq-item-ind")z=!0}else _+=R.source;if(G=!0,V=!0,L||I)M=R;T=!0;break;case"anchor":if(L)Q(R,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(R.source.endsWith(":"))Q(R.offset+R.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);L=R,N??(N=R.offset),G=!1,T=!1,W=!0;break;case"tag":{if(I)Q(R,"MULTIPLE_TAGS","A node can have at most one tag");I=R,N??(N=R.offset),G=!1,T=!1,W=!0;break}case X:if(L||I)Q(R,"BAD_PROP_ORDER",`Anchors and tags must be after the ${R.source} indicator`);if(O)Q(R,"UNEXPECTED_TOKEN",`Unexpected ${R.source} in ${Z??"collection"}`);O=R,G=X==="seq-item-ind"||X==="explicit-key-ind",T=!1;break;case"comma":if(Z){if(D)Q(R,"UNEXPECTED_TOKEN",`Unexpected , in ${Z}`);D=R,G=!1,T=!1;break}default:Q(R,"UNEXPECTED_TOKEN",`Unexpected ${R.type} token`),G=!1,T=!1}}let A=q[q.length-1],K=A?A.offset+A.source.length:$;if(W&&J&&J.type!=="space"&&J.type!=="newline"&&J.type!=="comma"&&(J.type!=="scalar"||J.source!==""))Q(J.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(B&&(G&&B.indent<=H||J?.type==="block-map"||J?.type==="block-seq"))Q(B,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:D,found:O,spaceBefore:z,comment:Y,hasNewline:V,anchor:L,tag:I,newlineAfterProp:M,end:K,start:N??K}}qQ.resolveProps=e$});var Gq=P((XQ)=>{function v9(q){if(!q)return null;switch(q.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(q.source.includes(`
89
- `))return!0;if(q.end){for(let Z of q.end)if(Z.type==="newline")return!0}return!1;case"flow-collection":for(let Z of q.items){for(let X of Z.start)if(X.type==="newline")return!0;if(Z.sep){for(let X of Z.sep)if(X.type==="newline")return!0}if(v9(Z.key)||v9(Z.value))return!0}return!1;default:return!0}}XQ.containsNewline=v9});var h9=P((HQ)=>{var $Q=Gq();function QQ(q,Z,X){if(Z?.type==="flow-collection"){let J=Z.end[0];if(J.indent===q&&(J.source==="]"||J.source==="}")&&$Q.containsNewline(Z))X(J,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}HQ.flowIndentCheck=QQ});var g9=P((GQ)=>{var b3=S();function zQ(q,Z,X){let{uniqueKeys:J}=q.options;if(J===!1)return!1;let $=typeof J==="function"?J:(Q,H)=>Q===H||b3.isScalar(Q)&&b3.isScalar(H)&&Q.value===H.value;return Z.some((Q)=>$(Q.key,X))}GQ.mapIncludes=zQ});var y3=P((WQ)=>{var j3=$1(),BQ=H1(),E3=z0(),TQ=Gq(),C3=h9(),_Q=g9(),f3="All mapping items must start at the same column";function LQ({composeNode:q,composeEmptyNode:Z},X,J,$,Q){let U=new(Q?.nodeClass??BQ.YAMLMap)(X.schema);if(X.atRoot)X.atRoot=!1;let z=J.offset,G=null;for(let T of J.items){let{start:Y,key:_,sep:V,value:W}=T,B=E3.resolveProps(Y,{indicator:"explicit-key-ind",next:_??V?.[0],offset:z,onError:$,parentIndent:J.indent,startOnNewline:!0}),L=!B.found;if(L){if(_){if(_.type==="block-seq")$(z,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in _&&_.indent!==J.indent)$(z,"BAD_INDENT",f3)}if(!B.anchor&&!B.tag&&!V){if(G=B.end,B.comment)if(U.comment)U.comment+=`
90
- `+B.comment;else U.comment=B.comment;continue}if(B.newlineAfterProp||TQ.containsNewline(_))$(_??Y[Y.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(B.found?.indent!==J.indent)$(z,"BAD_INDENT",f3);X.atKey=!0;let I=B.end,M=_?q(X,_,B,$):Z(X,I,Y,null,B,$);if(X.schema.compat)C3.flowIndentCheck(J.indent,_,$);if(X.atKey=!1,_Q.mapIncludes(X,U.items,M))$(I,"DUPLICATE_KEY","Map keys must be unique");let D=E3.resolveProps(V??[],{indicator:"map-value-ind",next:W,offset:M.range[2],onError:$,parentIndent:J.indent,startOnNewline:!_||_.type==="block-scalar"});if(z=D.end,D.found){if(L){if(W?.type==="block-map"&&!D.hasNewline)$(z,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(X.options.strict&&B.start<D.found.offset-1024)$(M.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let O=W?q(X,W,D,$):Z(X,z,V,null,D,$);if(X.schema.compat)C3.flowIndentCheck(J.indent,W,$);z=O.range[2];let N=new j3.Pair(M,O);if(X.options.keepSourceTokens)N.srcToken=T;U.items.push(N)}else{if(L)$(M.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(D.comment)if(M.comment)M.comment+=`
91
- `+D.comment;else M.comment=D.comment;let O=new j3.Pair(M);if(X.options.keepSourceTokens)O.srcToken=T;U.items.push(O)}}if(G&&G<z)$(G,"IMPOSSIBLE","Map comment with trailing content");return U.range=[J.offset,z,G??z],U}WQ.resolveBlockMap=LQ});var x3=P((DQ)=>{var RQ=U1(),IQ=z0(),MQ=h9();function KQ({composeNode:q,composeEmptyNode:Z},X,J,$,Q){let U=new(Q?.nodeClass??RQ.YAMLSeq)(X.schema);if(X.atRoot)X.atRoot=!1;if(X.atKey)X.atKey=!1;let z=J.offset,G=null;for(let{start:T,value:Y}of J.items){let _=IQ.resolveProps(T,{indicator:"seq-item-ind",next:Y,offset:z,onError:$,parentIndent:J.indent,startOnNewline:!0});if(!_.found)if(_.anchor||_.tag||Y)if(Y?.type==="block-seq")$(_.end,"BAD_INDENT","All sequence items must start at the same column");else $(z,"MISSING_CHAR","Sequence item without - indicator");else{if(G=_.end,_.comment)U.comment=_.comment;continue}let V=Y?q(X,Y,_,$):Z(X,_.end,T,null,_,$);if(X.schema.compat)MQ.flowIndentCheck(J.indent,Y,$);z=V.range[2],U.items.push(V)}return U.range=[J.offset,z,G??z],U}DQ.resolveBlockSeq=KQ});var x1=P((OQ)=>{function FQ(q,Z,X,J){let $="";if(q){let Q=!1,H="";for(let U of q){let{source:z,type:G}=U;switch(G){case"space":Q=!0;break;case"comment":{if(X&&!Q)J(U,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let T=z.substring(1)||" ";if(!$)$=T;else $+=H+T;H="";break}case"newline":if($)H+=z;Q=!0;break;default:J(U,"UNEXPECTED_TOKEN",`Unexpected ${G} at node end`)}Z+=z.length}}return{comment:$,offset:Z}}OQ.resolveEnd=FQ});var h3=P((fQ)=>{var AQ=S(),SQ=$1(),k3=H1(),wQ=U1(),bQ=x1(),v3=z0(),jQ=Gq(),EQ=g9(),u9="Block collections are not allowed within flow collections",m9=(q)=>q&&(q.type==="block-map"||q.type==="block-seq");function CQ({composeNode:q,composeEmptyNode:Z},X,J,$,Q){let H=J.start.source==="{",U=H?"flow map":"flow sequence",G=new(Q?.nodeClass??(H?k3.YAMLMap:wQ.YAMLSeq))(X.schema);G.flow=!0;let T=X.atRoot;if(T)X.atRoot=!1;if(X.atKey)X.atKey=!1;let Y=J.offset+J.start.source.length;for(let L=0;L<J.items.length;++L){let I=J.items[L],{start:M,key:D,sep:O,value:N}=I,A=v3.resolveProps(M,{flow:U,indicator:"explicit-key-ind",next:D??O?.[0],offset:Y,onError:$,parentIndent:J.indent,startOnNewline:!1});if(!A.found){if(!A.anchor&&!A.tag&&!O&&!N){if(L===0&&A.comma)$(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${U}`);else if(L<J.items.length-1)$(A.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${U}`);if(A.comment)if(G.comment)G.comment+=`
92
- `+A.comment;else G.comment=A.comment;Y=A.end;continue}if(!H&&X.options.strict&&jQ.containsNewline(D))$(D,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(L===0){if(A.comma)$(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${U}`)}else{if(!A.comma)$(A.start,"MISSING_CHAR",`Missing , between ${U} items`);if(A.comment){let K="";q:for(let R of M)switch(R.type){case"comma":case"space":break;case"comment":K=R.source.substring(1);break q;default:break q}if(K){let R=G.items[G.items.length-1];if(AQ.isPair(R))R=R.value??R.key;if(R.comment)R.comment+=`
93
- `+K;else R.comment=K;A.comment=A.comment.substring(K.length+1)}}}if(!H&&!O&&!A.found){let K=N?q(X,N,A,$):Z(X,A.end,O,null,A,$);if(G.items.push(K),Y=K.range[2],m9(N))$(K.range,"BLOCK_IN_FLOW",u9)}else{X.atKey=!0;let K=A.end,R=D?q(X,D,A,$):Z(X,K,M,null,A,$);if(m9(D))$(R.range,"BLOCK_IN_FLOW",u9);X.atKey=!1;let w=v3.resolveProps(O??[],{flow:U,indicator:"map-value-ind",next:N,offset:R.range[2],onError:$,parentIndent:J.indent,startOnNewline:!1});if(w.found){if(!H&&!A.found&&X.options.strict){if(O)for(let E of O){if(E===w.found)break;if(E.type==="newline"){$(E,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(A.start<w.found.offset-1024)$(w.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(N)if("source"in N&&N.source?.[0]===":")$(N,"MISSING_CHAR",`Missing space after : in ${U}`);else $(w.start,"MISSING_CHAR",`Missing , or : between ${U} items`);let y=N?q(X,N,w,$):w.found?Z(X,w.end,O,null,w,$):null;if(y){if(m9(N))$(y.range,"BLOCK_IN_FLOW",u9)}else if(w.comment)if(R.comment)R.comment+=`
94
- `+w.comment;else R.comment=w.comment;let x=new SQ.Pair(R,y);if(X.options.keepSourceTokens)x.srcToken=I;if(H){let E=G;if(EQ.mapIncludes(X,E.items,R))$(K,"DUPLICATE_KEY","Map keys must be unique");E.items.push(x)}else{let E=new k3.YAMLMap(X.schema);E.flow=!0,E.items.push(x);let F0=(y??R).range;E.range=[R.range[0],F0[1],F0[2]],G.items.push(E)}Y=y?y.range[2]:w.end}}let _=H?"}":"]",[V,...W]=J.end,B=Y;if(V?.source===_)B=V.offset+V.source.length;else{let L=U[0].toUpperCase()+U.substring(1),I=T?`${L} must end with a ${_}`:`${L} in block collection must be sufficiently indented and end with a ${_}`;if($(Y,T?"MISSING_CHAR":"BAD_INDENT",I),V&&V.source.length!==1)W.unshift(V)}if(W.length>0){let L=bQ.resolveEnd(W,B,X.options.strict,$);if(L.comment)if(G.comment)G.comment+=`
95
- `+L.comment;else G.comment=L.comment;G.range=[J.offset,B,L.offset]}else G.range=[J.offset,B,B];return G}fQ.resolveFlowCollection=CQ});var g3=P((lQ)=>{var xQ=S(),kQ=C(),vQ=H1(),hQ=U1(),gQ=y3(),uQ=x3(),mQ=h3();function d9(q,Z,X,J,$,Q){let H=X.type==="block-map"?gQ.resolveBlockMap(q,Z,X,J,Q):X.type==="block-seq"?uQ.resolveBlockSeq(q,Z,X,J,Q):mQ.resolveFlowCollection(q,Z,X,J,Q),U=H.constructor;if($==="!"||$===U.tagName)return H.tag=U.tagName,H;if($)H.tag=$;return H}function dQ(q,Z,X,J,$){let Q=J.tag,H=!Q?null:Z.directives.tagName(Q.source,(_)=>$(Q,"TAG_RESOLVE_FAILED",_));if(X.type==="block-seq"){let{anchor:_,newlineAfterProp:V}=J,W=_&&Q?_.offset>Q.offset?_:Q:_??Q;if(W&&(!V||V.offset<W.offset))$(W,"MISSING_CHAR","Missing newline after block sequence props")}let U=X.type==="block-map"?"map":X.type==="block-seq"?"seq":X.start.source==="{"?"map":"seq";if(!Q||!H||H==="!"||H===vQ.YAMLMap.tagName&&U==="map"||H===hQ.YAMLSeq.tagName&&U==="seq")return d9(q,Z,X,$,H);let z=Z.schema.tags.find((_)=>_.tag===H&&_.collection===U);if(!z){let _=Z.schema.knownTags[H];if(_?.collection===U)Z.schema.tags.push(Object.assign({},_,{default:!1})),z=_;else{if(_)$(Q,"BAD_COLLECTION_TYPE",`${_.tag} used for ${U} collection, but expects ${_.collection??"scalar"}`,!0);else $(Q,"TAG_RESOLVE_FAILED",`Unresolved tag: ${H}`,!0);return d9(q,Z,X,$,H)}}let G=d9(q,Z,X,$,H,z),T=z.resolve?.(G,(_)=>$(Q,"TAG_RESOLVE_FAILED",_),Z.options)??G,Y=xQ.isNode(T)?T:new kQ.Scalar(T);if(Y.range=G.range,Y.tag=H,z?.format)Y.format=z.format;return Y}lQ.composeCollection=dQ});var p9=P((sQ)=>{var l9=C();function cQ(q,Z,X){let J=Z.offset,$=iQ(Z,q.options.strict,X);if(!$)return{value:"",type:null,comment:"",range:[J,J,J]};let Q=$.mode===">"?l9.Scalar.BLOCK_FOLDED:l9.Scalar.BLOCK_LITERAL,H=Z.source?aQ(Z.source):[],U=H.length;for(let B=H.length-1;B>=0;--B){let L=H[B][1];if(L===""||L==="\r")U=B;else break}if(U===0){let B=$.chomp==="+"&&H.length>0?`
96
- `.repeat(Math.max(1,H.length-1)):"",L=J+$.length;if(Z.source)L+=Z.source.length;return{value:B,type:Q,comment:$.comment,range:[J,L,L]}}let z=Z.indent+$.indent,G=Z.offset+$.length,T=0;for(let B=0;B<U;++B){let[L,I]=H[B];if(I===""||I==="\r"){if($.indent===0&&L.length>z)z=L.length}else{if(L.length<z)X(G+L.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if($.indent===0)z=L.length;if(T=B,z===0&&!q.atRoot)X(G,"BAD_INDENT","Block scalar values in collections must be indented");break}G+=L.length+I.length+1}for(let B=H.length-1;B>=U;--B)if(H[B][0].length>z)U=B+1;let Y="",_="",V=!1;for(let B=0;B<T;++B)Y+=H[B][0].slice(z)+`
97
- `;for(let B=T;B<U;++B){let[L,I]=H[B];G+=L.length+I.length+1;let M=I[I.length-1]==="\r";if(M)I=I.slice(0,-1);if(I&&L.length<z){let O=`Block scalar lines must not be less indented than their ${$.indent?"explicit indentation indicator":"first line"}`;X(G-I.length-(M?2:1),"BAD_INDENT",O),L=""}if(Q===l9.Scalar.BLOCK_LITERAL)Y+=_+L.slice(z)+I,_=`
98
- `;else if(L.length>z||I[0]==="\t"){if(_===" ")_=`
88
+ `}};qQ.YAMLError=Uq;qQ.YAMLParseError=b3;qQ.YAMLWarning=j3;qQ.prettifyError=e$});var U0=P((HQ)=>{function QQ(q,{flow:Z,indicator:X,next:J,offset:$,onError:Q,parentIndent:H,startOnNewline:z}){let U=!1,G=z,T=z,Y="",_="",V=!1,L=!1,B=null,W=null,I=null,M=null,D=null,O=null,N=null;for(let R of q){if(L){if(R.type!=="space"&&R.type!=="newline"&&R.type!=="comma")Q(R.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");L=!1}if(B){if(G&&R.type!=="comment"&&R.type!=="newline")Q(B,"TAB_AS_INDENT","Tabs are not allowed as indentation");B=null}switch(R.type){case"space":if(!Z&&(X!=="doc-start"||J?.type!=="flow-collection")&&R.source.includes("\t"))B=R;T=!0;break;case"comment":{if(!T)Q(R,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let w=R.source.substring(1)||" ";if(!Y)Y=w;else Y+=_+w;_="",G=!1;break}case"newline":if(G){if(Y)Y+=R.source;else if(!O||X!=="seq-item-ind")U=!0}else _+=R.source;if(G=!0,V=!0,W||I)M=R;T=!0;break;case"anchor":if(W)Q(R,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(R.source.endsWith(":"))Q(R.offset+R.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);W=R,N??(N=R.offset),G=!1,T=!1,L=!0;break;case"tag":{if(I)Q(R,"MULTIPLE_TAGS","A node can have at most one tag");I=R,N??(N=R.offset),G=!1,T=!1,L=!0;break}case X:if(W||I)Q(R,"BAD_PROP_ORDER",`Anchors and tags must be after the ${R.source} indicator`);if(O)Q(R,"UNEXPECTED_TOKEN",`Unexpected ${R.source} in ${Z??"collection"}`);O=R,G=X==="seq-item-ind"||X==="explicit-key-ind",T=!1;break;case"comma":if(Z){if(D)Q(R,"UNEXPECTED_TOKEN",`Unexpected , in ${Z}`);D=R,G=!1,T=!1;break}default:Q(R,"UNEXPECTED_TOKEN",`Unexpected ${R.type} token`),G=!1,T=!1}}let S=q[q.length-1],K=S?S.offset+S.source.length:$;if(L&&J&&J.type!=="space"&&J.type!=="newline"&&J.type!=="comma"&&(J.type!=="scalar"||J.source!==""))Q(J.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(B&&(G&&B.indent<=H||J?.type==="block-map"||J?.type==="block-seq"))Q(B,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:D,found:O,spaceBefore:U,comment:Y,hasNewline:V,anchor:W,tag:I,newlineAfterProp:M,end:K,start:N??K}}HQ.resolveProps=QQ});var Gq=P((UQ)=>{function v9(q){if(!q)return null;switch(q.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(q.source.includes(`
89
+ `))return!0;if(q.end){for(let Z of q.end)if(Z.type==="newline")return!0}return!1;case"flow-collection":for(let Z of q.items){for(let X of Z.start)if(X.type==="newline")return!0;if(Z.sep){for(let X of Z.sep)if(X.type==="newline")return!0}if(v9(Z.key)||v9(Z.value))return!0}return!1;default:return!0}}UQ.containsNewline=v9});var h9=P((TQ)=>{var YQ=Gq();function BQ(q,Z,X){if(Z?.type==="flow-collection"){let J=Z.end[0];if(J.indent===q&&(J.source==="]"||J.source==="}")&&YQ.containsNewline(Z))X(J,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}TQ.flowIndentCheck=BQ});var g9=P((LQ)=>{var E3=A();function WQ(q,Z,X){let{uniqueKeys:J}=q.options;if(J===!1)return!1;let $=typeof J==="function"?J:(Q,H)=>Q===H||E3.isScalar(Q)&&E3.isScalar(H)&&Q.value===H.value;return Z.some((Q)=>$(Q.key,X))}LQ.mapIncludes=WQ});var k3=P((DQ)=>{var C3=$1(),RQ=H1(),f3=U0(),IQ=Gq(),y3=h9(),MQ=g9(),x3="All mapping items must start at the same column";function KQ({composeNode:q,composeEmptyNode:Z},X,J,$,Q){let z=new(Q?.nodeClass??RQ.YAMLMap)(X.schema);if(X.atRoot)X.atRoot=!1;let U=J.offset,G=null;for(let T of J.items){let{start:Y,key:_,sep:V,value:L}=T,B=f3.resolveProps(Y,{indicator:"explicit-key-ind",next:_??V?.[0],offset:U,onError:$,parentIndent:J.indent,startOnNewline:!0}),W=!B.found;if(W){if(_){if(_.type==="block-seq")$(U,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in _&&_.indent!==J.indent)$(U,"BAD_INDENT",x3)}if(!B.anchor&&!B.tag&&!V){if(G=B.end,B.comment)if(z.comment)z.comment+=`
90
+ `+B.comment;else z.comment=B.comment;continue}if(B.newlineAfterProp||IQ.containsNewline(_))$(_??Y[Y.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(B.found?.indent!==J.indent)$(U,"BAD_INDENT",x3);X.atKey=!0;let I=B.end,M=_?q(X,_,B,$):Z(X,I,Y,null,B,$);if(X.schema.compat)y3.flowIndentCheck(J.indent,_,$);if(X.atKey=!1,MQ.mapIncludes(X,z.items,M))$(I,"DUPLICATE_KEY","Map keys must be unique");let D=f3.resolveProps(V??[],{indicator:"map-value-ind",next:L,offset:M.range[2],onError:$,parentIndent:J.indent,startOnNewline:!_||_.type==="block-scalar"});if(U=D.end,D.found){if(W){if(L?.type==="block-map"&&!D.hasNewline)$(U,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(X.options.strict&&B.start<D.found.offset-1024)$(M.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let O=L?q(X,L,D,$):Z(X,U,V,null,D,$);if(X.schema.compat)y3.flowIndentCheck(J.indent,L,$);U=O.range[2];let N=new C3.Pair(M,O);if(X.options.keepSourceTokens)N.srcToken=T;z.items.push(N)}else{if(W)$(M.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(D.comment)if(M.comment)M.comment+=`
91
+ `+D.comment;else M.comment=D.comment;let O=new C3.Pair(M);if(X.options.keepSourceTokens)O.srcToken=T;z.items.push(O)}}if(G&&G<U)$(G,"IMPOSSIBLE","Map comment with trailing content");return z.range=[J.offset,U,G??U],z}DQ.resolveBlockMap=KQ});var v3=P((AQ)=>{var FQ=z1(),OQ=U0(),NQ=h9();function SQ({composeNode:q,composeEmptyNode:Z},X,J,$,Q){let z=new(Q?.nodeClass??FQ.YAMLSeq)(X.schema);if(X.atRoot)X.atRoot=!1;if(X.atKey)X.atKey=!1;let U=J.offset,G=null;for(let{start:T,value:Y}of J.items){let _=OQ.resolveProps(T,{indicator:"seq-item-ind",next:Y,offset:U,onError:$,parentIndent:J.indent,startOnNewline:!0});if(!_.found)if(_.anchor||_.tag||Y)if(Y?.type==="block-seq")$(_.end,"BAD_INDENT","All sequence items must start at the same column");else $(U,"MISSING_CHAR","Sequence item without - indicator");else{if(G=_.end,_.comment)z.comment=_.comment;continue}let V=Y?q(X,Y,_,$):Z(X,_.end,T,null,_,$);if(X.schema.compat)NQ.flowIndentCheck(J.indent,Y,$);U=V.range[2],z.items.push(V)}return z.range=[J.offset,U,G??U],z}AQ.resolveBlockSeq=SQ});var x1=P((jQ)=>{function bQ(q,Z,X,J){let $="";if(q){let Q=!1,H="";for(let z of q){let{source:U,type:G}=z;switch(G){case"space":Q=!0;break;case"comment":{if(X&&!Q)J(z,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let T=U.substring(1)||" ";if(!$)$=T;else $+=H+T;H="";break}case"newline":if($)H+=U;Q=!0;break;default:J(z,"UNEXPECTED_TOKEN",`Unexpected ${G} at node end`)}Z+=U.length}}return{comment:$,offset:Z}}jQ.resolveEnd=bQ});var u3=P((gQ)=>{var CQ=A(),fQ=$1(),h3=H1(),yQ=z1(),xQ=x1(),g3=U0(),kQ=Gq(),vQ=g9(),u9="Block collections are not allowed within flow collections",m9=(q)=>q&&(q.type==="block-map"||q.type==="block-seq");function hQ({composeNode:q,composeEmptyNode:Z},X,J,$,Q){let H=J.start.source==="{",z=H?"flow map":"flow sequence",G=new(Q?.nodeClass??(H?h3.YAMLMap:yQ.YAMLSeq))(X.schema);G.flow=!0;let T=X.atRoot;if(T)X.atRoot=!1;if(X.atKey)X.atKey=!1;let Y=J.offset+J.start.source.length;for(let W=0;W<J.items.length;++W){let I=J.items[W],{start:M,key:D,sep:O,value:N}=I,S=g3.resolveProps(M,{flow:z,indicator:"explicit-key-ind",next:D??O?.[0],offset:Y,onError:$,parentIndent:J.indent,startOnNewline:!1});if(!S.found){if(!S.anchor&&!S.tag&&!O&&!N){if(W===0&&S.comma)$(S.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${z}`);else if(W<J.items.length-1)$(S.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${z}`);if(S.comment)if(G.comment)G.comment+=`
92
+ `+S.comment;else G.comment=S.comment;Y=S.end;continue}if(!H&&X.options.strict&&kQ.containsNewline(D))$(D,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(W===0){if(S.comma)$(S.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${z}`)}else{if(!S.comma)$(S.start,"MISSING_CHAR",`Missing , between ${z} items`);if(S.comment){let K="";q:for(let R of M)switch(R.type){case"comma":case"space":break;case"comment":K=R.source.substring(1);break q;default:break q}if(K){let R=G.items[G.items.length-1];if(CQ.isPair(R))R=R.value??R.key;if(R.comment)R.comment+=`
93
+ `+K;else R.comment=K;S.comment=S.comment.substring(K.length+1)}}}if(!H&&!O&&!S.found){let K=N?q(X,N,S,$):Z(X,S.end,O,null,S,$);if(G.items.push(K),Y=K.range[2],m9(N))$(K.range,"BLOCK_IN_FLOW",u9)}else{X.atKey=!0;let K=S.end,R=D?q(X,D,S,$):Z(X,K,M,null,S,$);if(m9(D))$(R.range,"BLOCK_IN_FLOW",u9);X.atKey=!1;let w=g3.resolveProps(O??[],{flow:z,indicator:"map-value-ind",next:N,offset:R.range[2],onError:$,parentIndent:J.indent,startOnNewline:!1});if(w.found){if(!H&&!S.found&&X.options.strict){if(O)for(let E of O){if(E===w.found)break;if(E.type==="newline"){$(E,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(S.start<w.found.offset-1024)$(w.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(N)if("source"in N&&N.source?.[0]===":")$(N,"MISSING_CHAR",`Missing space after : in ${z}`);else $(w.start,"MISSING_CHAR",`Missing , or : between ${z} items`);let y=N?q(X,N,w,$):w.found?Z(X,w.end,O,null,w,$):null;if(y){if(m9(N))$(y.range,"BLOCK_IN_FLOW",u9)}else if(w.comment)if(R.comment)R.comment+=`
94
+ `+w.comment;else R.comment=w.comment;let x=new fQ.Pair(R,y);if(X.options.keepSourceTokens)x.srcToken=I;if(H){let E=G;if(vQ.mapIncludes(X,E.items,R))$(K,"DUPLICATE_KEY","Map keys must be unique");E.items.push(x)}else{let E=new h3.YAMLMap(X.schema);E.flow=!0,E.items.push(x);let F0=(y??R).range;E.range=[R.range[0],F0[1],F0[2]],G.items.push(E)}Y=y?y.range[2]:w.end}}let _=H?"}":"]",[V,...L]=J.end,B=Y;if(V?.source===_)B=V.offset+V.source.length;else{let W=z[0].toUpperCase()+z.substring(1),I=T?`${W} must end with a ${_}`:`${W} in block collection must be sufficiently indented and end with a ${_}`;if($(Y,T?"MISSING_CHAR":"BAD_INDENT",I),V&&V.source.length!==1)L.unshift(V)}if(L.length>0){let W=xQ.resolveEnd(L,B,X.options.strict,$);if(W.comment)if(G.comment)G.comment+=`
95
+ `+W.comment;else G.comment=W.comment;G.range=[J.offset,B,W.offset]}else G.range=[J.offset,B,B];return G}gQ.resolveFlowCollection=hQ});var m3=P((rQ)=>{var mQ=A(),dQ=C(),lQ=H1(),pQ=z1(),cQ=k3(),iQ=v3(),aQ=u3();function d9(q,Z,X,J,$,Q){let H=X.type==="block-map"?cQ.resolveBlockMap(q,Z,X,J,Q):X.type==="block-seq"?iQ.resolveBlockSeq(q,Z,X,J,Q):aQ.resolveFlowCollection(q,Z,X,J,Q),z=H.constructor;if($==="!"||$===z.tagName)return H.tag=z.tagName,H;if($)H.tag=$;return H}function sQ(q,Z,X,J,$){let Q=J.tag,H=!Q?null:Z.directives.tagName(Q.source,(_)=>$(Q,"TAG_RESOLVE_FAILED",_));if(X.type==="block-seq"){let{anchor:_,newlineAfterProp:V}=J,L=_&&Q?_.offset>Q.offset?_:Q:_??Q;if(L&&(!V||V.offset<L.offset))$(L,"MISSING_CHAR","Missing newline after block sequence props")}let z=X.type==="block-map"?"map":X.type==="block-seq"?"seq":X.start.source==="{"?"map":"seq";if(!Q||!H||H==="!"||H===lQ.YAMLMap.tagName&&z==="map"||H===pQ.YAMLSeq.tagName&&z==="seq")return d9(q,Z,X,$,H);let U=Z.schema.tags.find((_)=>_.tag===H&&_.collection===z);if(!U){let _=Z.schema.knownTags[H];if(_?.collection===z)Z.schema.tags.push(Object.assign({},_,{default:!1})),U=_;else{if(_)$(Q,"BAD_COLLECTION_TYPE",`${_.tag} used for ${z} collection, but expects ${_.collection??"scalar"}`,!0);else $(Q,"TAG_RESOLVE_FAILED",`Unresolved tag: ${H}`,!0);return d9(q,Z,X,$,H)}}let G=d9(q,Z,X,$,H,U),T=U.resolve?.(G,(_)=>$(Q,"TAG_RESOLVE_FAILED",_),Z.options)??G,Y=mQ.isNode(T)?T:new dQ.Scalar(T);if(Y.range=G.range,Y.tag=H,U?.format)Y.format=U.format;return Y}rQ.composeCollection=sQ});var p9=P((qH)=>{var l9=C();function oQ(q,Z,X){let J=Z.offset,$=tQ(Z,q.options.strict,X);if(!$)return{value:"",type:null,comment:"",range:[J,J,J]};let Q=$.mode===">"?l9.Scalar.BLOCK_FOLDED:l9.Scalar.BLOCK_LITERAL,H=Z.source?eQ(Z.source):[],z=H.length;for(let B=H.length-1;B>=0;--B){let W=H[B][1];if(W===""||W==="\r")z=B;else break}if(z===0){let B=$.chomp==="+"&&H.length>0?`
96
+ `.repeat(Math.max(1,H.length-1)):"",W=J+$.length;if(Z.source)W+=Z.source.length;return{value:B,type:Q,comment:$.comment,range:[J,W,W]}}let U=Z.indent+$.indent,G=Z.offset+$.length,T=0;for(let B=0;B<z;++B){let[W,I]=H[B];if(I===""||I==="\r"){if($.indent===0&&W.length>U)U=W.length}else{if(W.length<U)X(G+W.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if($.indent===0)U=W.length;if(T=B,U===0&&!q.atRoot)X(G,"BAD_INDENT","Block scalar values in collections must be indented");break}G+=W.length+I.length+1}for(let B=H.length-1;B>=z;--B)if(H[B][0].length>U)z=B+1;let Y="",_="",V=!1;for(let B=0;B<T;++B)Y+=H[B][0].slice(U)+`
97
+ `;for(let B=T;B<z;++B){let[W,I]=H[B];G+=W.length+I.length+1;let M=I[I.length-1]==="\r";if(M)I=I.slice(0,-1);if(I&&W.length<U){let O=`Block scalar lines must not be less indented than their ${$.indent?"explicit indentation indicator":"first line"}`;X(G-I.length-(M?2:1),"BAD_INDENT",O),W=""}if(Q===l9.Scalar.BLOCK_LITERAL)Y+=_+W.slice(U)+I,_=`
98
+ `;else if(W.length>U||I[0]==="\t"){if(_===" ")_=`
99
99
  `;else if(!V&&_===`
100
100
  `)_=`
101
101
 
102
- `;Y+=_+L.slice(z)+I,_=`
102
+ `;Y+=_+W.slice(U)+I,_=`
103
103
  `,V=!0}else if(I==="")if(_===`
104
104
  `)Y+=`
105
105
  `;else _=`
106
- `;else Y+=_+I,_=" ",V=!1}switch($.chomp){case"-":break;case"+":for(let B=U;B<H.length;++B)Y+=`
107
- `+H[B][0].slice(z);if(Y[Y.length-1]!==`
106
+ `;else Y+=_+I,_=" ",V=!1}switch($.chomp){case"-":break;case"+":for(let B=z;B<H.length;++B)Y+=`
107
+ `+H[B][0].slice(U);if(Y[Y.length-1]!==`
108
108
  `)Y+=`
109
109
  `;break;default:Y+=`
110
- `}let W=J+$.length+Z.source.length;return{value:Y,type:Q,comment:$.comment,range:[J,W,W]}}function iQ({offset:q,props:Z},X,J){if(Z[0].type!=="block-scalar-header")return J(Z[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:$}=Z[0],Q=$[0],H=0,U="",z=-1;for(let _=1;_<$.length;++_){let V=$[_];if(!U&&(V==="-"||V==="+"))U=V;else{let W=Number(V);if(!H&&W)H=W;else if(z===-1)z=q+_}}if(z!==-1)J(z,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${$}`);let G=!1,T="",Y=$.length;for(let _=1;_<Z.length;++_){let V=Z[_];switch(V.type){case"space":G=!0;case"newline":Y+=V.source.length;break;case"comment":if(X&&!G)J(V,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");Y+=V.source.length,T=V.source.substring(1);break;case"error":J(V,"UNEXPECTED_TOKEN",V.message),Y+=V.source.length;break;default:{let W=`Unexpected token in block scalar header: ${V.type}`;J(V,"UNEXPECTED_TOKEN",W);let B=V.source;if(B&&typeof B==="string")Y+=B.length}}}return{mode:Q,indent:H,chomp:U,comment:T,length:Y}}function aQ(q){let Z=q.split(/\n( *)/),X=Z[0],J=X.match(/^( *)/),Q=[J?.[1]?[J[1],X.slice(J[1].length)]:["",X]];for(let H=1;H<Z.length;H+=2)Q.push([Z[H],Z[H+1]]);return Q}sQ.resolveBlockScalar=cQ});var i9=P(($H)=>{var c9=C(),nQ=x1();function oQ(q,Z,X){let{offset:J,type:$,source:Q,end:H}=q,U,z,G=(_,V,W)=>X(J+_,V,W);switch($){case"scalar":U=c9.Scalar.PLAIN,z=tQ(Q,G);break;case"single-quoted-scalar":U=c9.Scalar.QUOTE_SINGLE,z=eQ(Q,G);break;case"double-quoted-scalar":U=c9.Scalar.QUOTE_DOUBLE,z=qH(Q,G);break;default:return X(q,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${$}`),{value:"",type:null,comment:"",range:[J,J+Q.length,J+Q.length]}}let T=J+Q.length,Y=nQ.resolveEnd(H,T,Z,X);return{value:z,type:U,comment:Y.comment,range:[J,T,Y.offset]}}function tQ(q,Z){let X="";switch(q[0]){case"\t":X="a tab character";break;case",":X="flow indicator character ,";break;case"%":X="directive indicator character %";break;case"|":case">":{X=`block scalar indicator ${q[0]}`;break}case"@":case"`":{X=`reserved character ${q[0]}`;break}}if(X)Z(0,"BAD_SCALAR_START",`Plain value cannot start with ${X}`);return u3(q)}function eQ(q,Z){if(q[q.length-1]!=="'"||q.length===1)Z(q.length,"MISSING_CHAR","Missing closing 'quote");return u3(q.slice(1,-1)).replace(/''/g,"'")}function u3(q){let Z,X;try{Z=new RegExp(`(.*?)(?<![ ])[ ]*\r?
110
+ `}let L=J+$.length+Z.source.length;return{value:Y,type:Q,comment:$.comment,range:[J,L,L]}}function tQ({offset:q,props:Z},X,J){if(Z[0].type!=="block-scalar-header")return J(Z[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:$}=Z[0],Q=$[0],H=0,z="",U=-1;for(let _=1;_<$.length;++_){let V=$[_];if(!z&&(V==="-"||V==="+"))z=V;else{let L=Number(V);if(!H&&L)H=L;else if(U===-1)U=q+_}}if(U!==-1)J(U,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${$}`);let G=!1,T="",Y=$.length;for(let _=1;_<Z.length;++_){let V=Z[_];switch(V.type){case"space":G=!0;case"newline":Y+=V.source.length;break;case"comment":if(X&&!G)J(V,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");Y+=V.source.length,T=V.source.substring(1);break;case"error":J(V,"UNEXPECTED_TOKEN",V.message),Y+=V.source.length;break;default:{let L=`Unexpected token in block scalar header: ${V.type}`;J(V,"UNEXPECTED_TOKEN",L);let B=V.source;if(B&&typeof B==="string")Y+=B.length}}}return{mode:Q,indent:H,chomp:z,comment:T,length:Y}}function eQ(q){let Z=q.split(/\n( *)/),X=Z[0],J=X.match(/^( *)/),Q=[J?.[1]?[J[1],X.slice(J[1].length)]:["",X]];for(let H=1;H<Z.length;H+=2)Q.push([Z[H],Z[H+1]]);return Q}qH.resolveBlockScalar=oQ});var i9=P((YH)=>{var c9=C(),XH=x1();function JH(q,Z,X){let{offset:J,type:$,source:Q,end:H}=q,z,U,G=(_,V,L)=>X(J+_,V,L);switch($){case"scalar":z=c9.Scalar.PLAIN,U=$H(Q,G);break;case"single-quoted-scalar":z=c9.Scalar.QUOTE_SINGLE,U=QH(Q,G);break;case"double-quoted-scalar":z=c9.Scalar.QUOTE_DOUBLE,U=HH(Q,G);break;default:return X(q,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${$}`),{value:"",type:null,comment:"",range:[J,J+Q.length,J+Q.length]}}let T=J+Q.length,Y=XH.resolveEnd(H,T,Z,X);return{value:U,type:z,comment:Y.comment,range:[J,T,Y.offset]}}function $H(q,Z){let X="";switch(q[0]){case"\t":X="a tab character";break;case",":X="flow indicator character ,";break;case"%":X="directive indicator character %";break;case"|":case">":{X=`block scalar indicator ${q[0]}`;break}case"@":case"`":{X=`reserved character ${q[0]}`;break}}if(X)Z(0,"BAD_SCALAR_START",`Plain value cannot start with ${X}`);return d3(q)}function QH(q,Z){if(q[q.length-1]!=="'"||q.length===1)Z(q.length,"MISSING_CHAR","Missing closing 'quote");return d3(q.slice(1,-1)).replace(/''/g,"'")}function d3(q){let Z,X;try{Z=new RegExp(`(.*?)(?<![ ])[ ]*\r?
111
111
  `,"sy"),X=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
112
112
  `,"sy")}catch{Z=/(.*?)[ \t]*\r?\n/sy,X=/[ \t]*(.*?)[ \t]*\r?\n/sy}let J=Z.exec(q);if(!J)return q;let $=J[1],Q=" ",H=Z.lastIndex;X.lastIndex=H;while(J=X.exec(q)){if(J[1]==="")if(Q===`
113
113
  `)$+=Q;else Q=`
114
- `;else $+=Q+J[1],Q=" ";H=X.lastIndex}let U=/[ \t]*(.*)/sy;return U.lastIndex=H,J=U.exec(q),$+Q+(J?.[1]??"")}function qH(q,Z){let X="";for(let J=1;J<q.length-1;++J){let $=q[J];if($==="\r"&&q[J+1]===`
114
+ `;else $+=Q+J[1],Q=" ";H=X.lastIndex}let z=/[ \t]*(.*)/sy;return z.lastIndex=H,J=z.exec(q),$+Q+(J?.[1]??"")}function HH(q,Z){let X="";for(let J=1;J<q.length-1;++J){let $=q[J];if($==="\r"&&q[J+1]===`
115
115
  `)continue;if($===`
116
- `){let{fold:Q,offset:H}=ZH(q,J);X+=Q,J=H}else if($==="\\"){let Q=q[++J],H=XH[Q];if(H)X+=H;else if(Q===`
116
+ `){let{fold:Q,offset:H}=zH(q,J);X+=Q,J=H}else if($==="\\"){let Q=q[++J],H=UH[Q];if(H)X+=H;else if(Q===`
117
117
  `){Q=q[J+1];while(Q===" "||Q==="\t")Q=q[++J+1]}else if(Q==="\r"&&q[J+1]===`
118
- `){Q=q[++J+1];while(Q===" "||Q==="\t")Q=q[++J+1]}else if(Q==="x"||Q==="u"||Q==="U"){let U={x:2,u:4,U:8}[Q];X+=JH(q,J+1,U,Z),J+=U}else{let U=q.substr(J-1,2);Z(J-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${U}`),X+=U}}else if($===" "||$==="\t"){let Q=J,H=q[J+1];while(H===" "||H==="\t")H=q[++J+1];if(H!==`
118
+ `){Q=q[++J+1];while(Q===" "||Q==="\t")Q=q[++J+1]}else if(Q==="x"||Q==="u"||Q==="U"){let z={x:2,u:4,U:8}[Q];X+=GH(q,J+1,z,Z),J+=z}else{let z=q.substr(J-1,2);Z(J-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${z}`),X+=z}}else if($===" "||$==="\t"){let Q=J,H=q[J+1];while(H===" "||H==="\t")H=q[++J+1];if(H!==`
119
119
  `&&!(H==="\r"&&q[J+2]===`
120
- `))X+=J>Q?q.slice(Q,J+1):$}else X+=$}if(q[q.length-1]!=='"'||q.length===1)Z(q.length,"MISSING_CHAR",'Missing closing "quote');return X}function ZH(q,Z){let X="",J=q[Z+1];while(J===" "||J==="\t"||J===`
120
+ `))X+=J>Q?q.slice(Q,J+1):$}else X+=$}if(q[q.length-1]!=='"'||q.length===1)Z(q.length,"MISSING_CHAR",'Missing closing "quote');return X}function zH(q,Z){let X="",J=q[Z+1];while(J===" "||J==="\t"||J===`
121
121
  `||J==="\r"){if(J==="\r"&&q[Z+2]!==`
122
122
  `)break;if(J===`
123
123
  `)X+=`
124
- `;Z+=1,J=q[Z+1]}if(!X)X=" ";return{fold:X,offset:Z}}var XH={"0":"\x00",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
125
- `,r:"\r",t:"\t",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function JH(q,Z,X,J){let $=q.substr(Z,X),H=$.length===X&&/^[0-9a-fA-F]+$/.test($)?parseInt($,16):NaN;if(isNaN(H)){let U=q.substr(Z-2,X+2);return J(Z-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${U}`),U}return String.fromCodePoint(H)}$H.resolveFlowScalar=oQ});var d3=P((BH)=>{var D1=S(),m3=C(),HH=p9(),UH=i9();function zH(q,Z,X,J){let{value:$,type:Q,comment:H,range:U}=Z.type==="block-scalar"?HH.resolveBlockScalar(q,Z,J):UH.resolveFlowScalar(Z,q.options.strict,J),z=X?q.directives.tagName(X.source,(Y)=>J(X,"TAG_RESOLVE_FAILED",Y)):null,G;if(q.options.stringKeys&&q.atKey)G=q.schema[D1.SCALAR];else if(z)G=GH(q.schema,$,z,X,J);else if(Z.type==="scalar")G=YH(q,$,Z,J);else G=q.schema[D1.SCALAR];let T;try{let Y=G.resolve($,(_)=>J(X??Z,"TAG_RESOLVE_FAILED",_),q.options);T=D1.isScalar(Y)?Y:new m3.Scalar(Y)}catch(Y){let _=Y instanceof Error?Y.message:String(Y);J(X??Z,"TAG_RESOLVE_FAILED",_),T=new m3.Scalar($)}if(T.range=U,T.source=$,Q)T.type=Q;if(z)T.tag=z;if(G.format)T.format=G.format;if(H)T.comment=H;return T}function GH(q,Z,X,J,$){if(X==="!")return q[D1.SCALAR];let Q=[];for(let U of q.tags)if(!U.collection&&U.tag===X)if(U.default&&U.test)Q.push(U);else return U;for(let U of Q)if(U.test?.test(Z))return U;let H=q.knownTags[X];if(H&&!H.collection)return q.tags.push(Object.assign({},H,{default:!1,test:void 0})),H;return $(J,"TAG_RESOLVE_FAILED",`Unresolved tag: ${X}`,X!=="tag:yaml.org,2002:str"),q[D1.SCALAR]}function YH({atKey:q,directives:Z,schema:X},J,$,Q){let H=X.tags.find((U)=>(U.default===!0||q&&U.default==="key")&&U.test?.test(J))||X[D1.SCALAR];if(X.compat){let U=X.compat.find((z)=>z.default&&z.test?.test(J))??X[D1.SCALAR];if(H.tag!==U.tag){let z=Z.tagString(H.tag),G=Z.tagString(U.tag),T=`Value may be parsed as either ${z} or ${G}`;Q($,"TAG_RESOLVE_FAILED",T,!0)}}return H}BH.composeScalar=zH});var l3=P((LH)=>{function _H(q,Z,X){if(Z){X??(X=Z.length);for(let J=X-1;J>=0;--J){let $=Z[J];switch($.type){case"space":case"comment":case"newline":q-=$.source.length;continue}$=Z[++J];while($?.type==="space")q+=$.source.length,$=Z[++J];break}}return q}LH.emptyScalarPosition=_H});var i3=P((FH)=>{var VH=c1(),RH=S(),IH=g3(),p3=d3(),MH=x1(),KH=l3(),DH={composeNode:c3,composeEmptyNode:a9};function c3(q,Z,X,J){let $=q.atKey,{spaceBefore:Q,comment:H,anchor:U,tag:z}=X,G,T=!0;switch(Z.type){case"alias":if(G=PH(q,Z,J),U||z)J(Z,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":if(G=p3.composeScalar(q,Z,z,J),U)G.anchor=U.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":if(G=IH.composeCollection(DH,q,Z,X,J),U)G.anchor=U.source.substring(1);break;default:{let Y=Z.type==="error"?Z.message:`Unsupported token (type: ${Z.type})`;J(Z,"UNEXPECTED_TOKEN",Y),G=a9(q,Z.offset,void 0,null,X,J),T=!1}}if(U&&G.anchor==="")J(U,"BAD_ALIAS","Anchor cannot be an empty string");if($&&q.options.stringKeys&&(!RH.isScalar(G)||typeof G.value!=="string"||G.tag&&G.tag!=="tag:yaml.org,2002:str"))J(z??Z,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(Q)G.spaceBefore=!0;if(H)if(Z.type==="scalar"&&Z.source==="")G.comment=H;else G.commentBefore=H;if(q.options.keepSourceTokens&&T)G.srcToken=Z;return G}function a9(q,Z,X,J,{spaceBefore:$,comment:Q,anchor:H,tag:U,end:z},G){let T={type:"scalar",offset:KH.emptyScalarPosition(Z,X,J),indent:-1,source:""},Y=p3.composeScalar(q,T,U,G);if(H){if(Y.anchor=H.source.substring(1),Y.anchor==="")G(H,"BAD_ALIAS","Anchor cannot be an empty string")}if($)Y.spaceBefore=!0;if(Q)Y.comment=Q,Y.range[2]=z;return Y}function PH({options:q},{offset:Z,source:X,end:J},$){let Q=new VH.Alias(X.substring(1));if(Q.source==="")$(Z,"BAD_ALIAS","Alias cannot be an empty string");if(Q.source.endsWith(":"))$(Z+X.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let H=Z+X.length,U=MH.resolveEnd(J,H,q.strict,$);if(Q.range=[Z,H,U.offset],U.comment)Q.comment=U.comment;return Q}FH.composeEmptyNode=a9;FH.composeNode=c3});var s3=P((jH)=>{var AH=H0(),a3=i3(),SH=x1(),wH=z0();function bH(q,Z,{offset:X,start:J,value:$,end:Q},H){let U=Object.assign({_directives:Z},q),z=new AH.Document(void 0,U),G={atKey:!1,atRoot:!0,directives:z.directives,options:z.options,schema:z.schema},T=wH.resolveProps(J,{indicator:"doc-start",next:$??Q?.[0],offset:X,onError:H,parentIndent:0,startOnNewline:!0});if(T.found){if(z.directives.docStart=!0,$&&($.type==="block-map"||$.type==="block-seq")&&!T.hasNewline)H(T.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}z.contents=$?a3.composeNode(G,$,T,H):a3.composeEmptyNode(G,T.end,J,null,T,H);let Y=z.contents.range[2],_=SH.resolveEnd(Q,Y,!1,H);if(_.comment)z.comment=_.comment;return z.range=[X,Y,_.offset],z}jH.composeDoc=bH});var s9=P((vH)=>{var CH=r("process"),fH=tq(),yH=H0(),G0=U0(),r3=S(),xH=s3(),kH=x1();function Y0(q){if(typeof q==="number")return[q,q+1];if(Array.isArray(q))return q.length===2?q:[q[0],q[1]];let{offset:Z,source:X}=q;return[Z,Z+(typeof X==="string"?X.length:1)]}function n3(q){let Z="",X=!1,J=!1;for(let $=0;$<q.length;++$){let Q=q[$];switch(Q[0]){case"#":Z+=(Z===""?"":J?`
124
+ `;Z+=1,J=q[Z+1]}if(!X)X=" ";return{fold:X,offset:Z}}var UH={"0":"\x00",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
125
+ `,r:"\r",t:"\t",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function GH(q,Z,X,J){let $=q.substr(Z,X),H=$.length===X&&/^[0-9a-fA-F]+$/.test($)?parseInt($,16):NaN;if(isNaN(H)){let z=q.substr(Z-2,X+2);return J(Z-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${z}`),z}return String.fromCodePoint(H)}YH.resolveFlowScalar=JH});var p3=P((RH)=>{var D1=A(),l3=C(),TH=p9(),_H=i9();function WH(q,Z,X,J){let{value:$,type:Q,comment:H,range:z}=Z.type==="block-scalar"?TH.resolveBlockScalar(q,Z,J):_H.resolveFlowScalar(Z,q.options.strict,J),U=X?q.directives.tagName(X.source,(Y)=>J(X,"TAG_RESOLVE_FAILED",Y)):null,G;if(q.options.stringKeys&&q.atKey)G=q.schema[D1.SCALAR];else if(U)G=LH(q.schema,$,U,X,J);else if(Z.type==="scalar")G=VH(q,$,Z,J);else G=q.schema[D1.SCALAR];let T;try{let Y=G.resolve($,(_)=>J(X??Z,"TAG_RESOLVE_FAILED",_),q.options);T=D1.isScalar(Y)?Y:new l3.Scalar(Y)}catch(Y){let _=Y instanceof Error?Y.message:String(Y);J(X??Z,"TAG_RESOLVE_FAILED",_),T=new l3.Scalar($)}if(T.range=z,T.source=$,Q)T.type=Q;if(U)T.tag=U;if(G.format)T.format=G.format;if(H)T.comment=H;return T}function LH(q,Z,X,J,$){if(X==="!")return q[D1.SCALAR];let Q=[];for(let z of q.tags)if(!z.collection&&z.tag===X)if(z.default&&z.test)Q.push(z);else return z;for(let z of Q)if(z.test?.test(Z))return z;let H=q.knownTags[X];if(H&&!H.collection)return q.tags.push(Object.assign({},H,{default:!1,test:void 0})),H;return $(J,"TAG_RESOLVE_FAILED",`Unresolved tag: ${X}`,X!=="tag:yaml.org,2002:str"),q[D1.SCALAR]}function VH({atKey:q,directives:Z,schema:X},J,$,Q){let H=X.tags.find((z)=>(z.default===!0||q&&z.default==="key")&&z.test?.test(J))||X[D1.SCALAR];if(X.compat){let z=X.compat.find((U)=>U.default&&U.test?.test(J))??X[D1.SCALAR];if(H.tag!==z.tag){let U=Z.tagString(H.tag),G=Z.tagString(z.tag),T=`Value may be parsed as either ${U} or ${G}`;Q($,"TAG_RESOLVE_FAILED",T,!0)}}return H}RH.composeScalar=WH});var c3=P((KH)=>{function MH(q,Z,X){if(Z){X??(X=Z.length);for(let J=X-1;J>=0;--J){let $=Z[J];switch($.type){case"space":case"comment":case"newline":q-=$.source.length;continue}$=Z[++J];while($?.type==="space")q+=$.source.length,$=Z[++J];break}}return q}KH.emptyScalarPosition=MH});var s3=P((bH)=>{var PH=c1(),FH=A(),OH=m3(),i3=p3(),NH=x1(),SH=c3(),AH={composeNode:a3,composeEmptyNode:a9};function a3(q,Z,X,J){let $=q.atKey,{spaceBefore:Q,comment:H,anchor:z,tag:U}=X,G,T=!0;switch(Z.type){case"alias":if(G=wH(q,Z,J),z||U)J(Z,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":if(G=i3.composeScalar(q,Z,U,J),z)G.anchor=z.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":if(G=OH.composeCollection(AH,q,Z,X,J),z)G.anchor=z.source.substring(1);break;default:{let Y=Z.type==="error"?Z.message:`Unsupported token (type: ${Z.type})`;J(Z,"UNEXPECTED_TOKEN",Y),G=a9(q,Z.offset,void 0,null,X,J),T=!1}}if(z&&G.anchor==="")J(z,"BAD_ALIAS","Anchor cannot be an empty string");if($&&q.options.stringKeys&&(!FH.isScalar(G)||typeof G.value!=="string"||G.tag&&G.tag!=="tag:yaml.org,2002:str"))J(U??Z,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(Q)G.spaceBefore=!0;if(H)if(Z.type==="scalar"&&Z.source==="")G.comment=H;else G.commentBefore=H;if(q.options.keepSourceTokens&&T)G.srcToken=Z;return G}function a9(q,Z,X,J,{spaceBefore:$,comment:Q,anchor:H,tag:z,end:U},G){let T={type:"scalar",offset:SH.emptyScalarPosition(Z,X,J),indent:-1,source:""},Y=i3.composeScalar(q,T,z,G);if(H){if(Y.anchor=H.source.substring(1),Y.anchor==="")G(H,"BAD_ALIAS","Anchor cannot be an empty string")}if($)Y.spaceBefore=!0;if(Q)Y.comment=Q,Y.range[2]=U;return Y}function wH({options:q},{offset:Z,source:X,end:J},$){let Q=new PH.Alias(X.substring(1));if(Q.source==="")$(Z,"BAD_ALIAS","Alias cannot be an empty string");if(Q.source.endsWith(":"))$(Z+X.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let H=Z+X.length,z=NH.resolveEnd(J,H,q.strict,$);if(Q.range=[Z,H,z.offset],z.comment)Q.comment=z.comment;return Q}bH.composeEmptyNode=a9;bH.composeNode=a3});var n3=P((kH)=>{var CH=H0(),r3=s3(),fH=x1(),yH=U0();function xH(q,Z,{offset:X,start:J,value:$,end:Q},H){let z=Object.assign({_directives:Z},q),U=new CH.Document(void 0,z),G={atKey:!1,atRoot:!0,directives:U.directives,options:U.options,schema:U.schema},T=yH.resolveProps(J,{indicator:"doc-start",next:$??Q?.[0],offset:X,onError:H,parentIndent:0,startOnNewline:!0});if(T.found){if(U.directives.docStart=!0,$&&($.type==="block-map"||$.type==="block-seq")&&!T.hasNewline)H(T.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}U.contents=$?r3.composeNode(G,$,T,H):r3.composeEmptyNode(G,T.end,J,null,T,H);let Y=U.contents.range[2],_=fH.resolveEnd(Q,Y,!1,H);if(_.comment)U.comment=_.comment;return U.range=[X,Y,_.offset],U}kH.composeDoc=xH});var s9=P((lH)=>{var hH=r("process"),gH=tq(),uH=H0(),G0=z0(),o3=A(),mH=n3(),dH=x1();function Y0(q){if(typeof q==="number")return[q,q+1];if(Array.isArray(q))return q.length===2?q:[q[0],q[1]];let{offset:Z,source:X}=q;return[Z,Z+(typeof X==="string"?X.length:1)]}function t3(q){let Z="",X=!1,J=!1;for(let $=0;$<q.length;++$){let Q=q[$];switch(Q[0]){case"#":Z+=(Z===""?"":J?`
126
126
 
127
127
  `:`
128
- `)+(Q.substring(1)||" "),X=!0,J=!1;break;case"%":if(q[$+1]?.[0]!=="#")$+=1;X=!1;break;default:if(!X)J=!0;X=!1}}return{comment:Z,afterEmptyLine:J}}class o3{constructor(q={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(Z,X,J,$)=>{let Q=Y0(Z);if($)this.warnings.push(new G0.YAMLWarning(Q,X,J));else this.errors.push(new G0.YAMLParseError(Q,X,J))},this.directives=new fH.Directives({version:q.version||"1.2"}),this.options=q}decorate(q,Z){let{comment:X,afterEmptyLine:J}=n3(this.prelude);if(X){let $=q.contents;if(Z)q.comment=q.comment?`${q.comment}
129
- ${X}`:X;else if(J||q.directives.docStart||!$)q.commentBefore=X;else if(r3.isCollection($)&&!$.flow&&$.items.length>0){let Q=$.items[0];if(r3.isPair(Q))Q=Q.key;let H=Q.commentBefore;Q.commentBefore=H?`${X}
128
+ `)+(Q.substring(1)||" "),X=!0,J=!1;break;case"%":if(q[$+1]?.[0]!=="#")$+=1;X=!1;break;default:if(!X)J=!0;X=!1}}return{comment:Z,afterEmptyLine:J}}class e3{constructor(q={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(Z,X,J,$)=>{let Q=Y0(Z);if($)this.warnings.push(new G0.YAMLWarning(Q,X,J));else this.errors.push(new G0.YAMLParseError(Q,X,J))},this.directives=new gH.Directives({version:q.version||"1.2"}),this.options=q}decorate(q,Z){let{comment:X,afterEmptyLine:J}=t3(this.prelude);if(X){let $=q.contents;if(Z)q.comment=q.comment?`${q.comment}
129
+ ${X}`:X;else if(J||q.directives.docStart||!$)q.commentBefore=X;else if(o3.isCollection($)&&!$.flow&&$.items.length>0){let Q=$.items[0];if(o3.isPair(Q))Q=Q.key;let H=Q.commentBefore;Q.commentBefore=H?`${X}
130
130
  ${H}`:X}else{let Q=$.commentBefore;$.commentBefore=Q?`${X}
131
- ${Q}`:X}}if(Z)Array.prototype.push.apply(q.errors,this.errors),Array.prototype.push.apply(q.warnings,this.warnings);else q.errors=this.errors,q.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:n3(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(q,Z=!1,X=-1){for(let J of q)yield*this.next(J);yield*this.end(Z,X)}*next(q){if(CH.env.LOG_STREAM)console.dir(q,{depth:null});switch(q.type){case"directive":this.directives.add(q.source,(Z,X,J)=>{let $=Y0(q);$[0]+=Z,this.onError($,"BAD_DIRECTIVE",X,J)}),this.prelude.push(q.source),this.atDirectives=!0;break;case"document":{let Z=xH.composeDoc(this.options,this.directives,q,this.onError);if(this.atDirectives&&!Z.directives.docStart)this.onError(q,"MISSING_CHAR","Missing directives-end/doc-start indicator line");if(this.decorate(Z,!1),this.doc)yield this.doc;this.doc=Z,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(q.source);break;case"error":{let Z=q.source?`${q.message}: ${JSON.stringify(q.source)}`:q.message,X=new G0.YAMLParseError(Y0(q),"UNEXPECTED_TOKEN",Z);if(this.atDirectives||!this.doc)this.errors.push(X);else this.doc.errors.push(X);break}case"doc-end":{if(!this.doc){this.errors.push(new G0.YAMLParseError(Y0(q),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let Z=kH.resolveEnd(q.end,q.offset+q.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),Z.comment){let X=this.doc.comment;this.doc.comment=X?`${X}
132
- ${Z.comment}`:Z.comment}this.doc.range[2]=Z.offset;break}default:this.errors.push(new G0.YAMLParseError(Y0(q),"UNEXPECTED_TOKEN",`Unsupported token ${q.type}`))}}*end(q=!1,Z=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(q){let X=Object.assign({_directives:this.directives},this.options),J=new yH.Document(void 0,X);if(this.atDirectives)this.onError(Z,"MISSING_CHAR","Missing directives-end indicator line");J.range=[0,Z,Z],this.decorate(J,!1),yield J}}}vH.Composer=o3});var q5=P((iH)=>{var gH=p9(),uH=i9(),mH=U0(),t3=r1();function dH(q,Z=!0,X){if(q){let J=($,Q,H)=>{let U=typeof $==="number"?$:Array.isArray($)?$[0]:$.offset;if(X)X(U,Q,H);else throw new mH.YAMLParseError([U,U+1],Q,H)};switch(q.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return uH.resolveFlowScalar(q,Z,J);case"block-scalar":return gH.resolveBlockScalar({options:{strict:Z}},q,J)}}return null}function lH(q,Z){let{implicitKey:X=!1,indent:J,inFlow:$=!1,offset:Q=-1,type:H="PLAIN"}=Z,U=t3.stringifyString({type:H,value:q},{implicitKey:X,indent:J>0?" ".repeat(J):"",inFlow:$,options:{blockQuote:!0,lineWidth:-1}}),z=Z.end??[{type:"newline",offset:-1,indent:J,source:`
133
- `}];switch(U[0]){case"|":case">":{let G=U.indexOf(`
134
- `),T=U.substring(0,G),Y=U.substring(G+1)+`
135
- `,_=[{type:"block-scalar-header",offset:Q,indent:J,source:T}];if(!e3(_,z))_.push({type:"newline",offset:-1,indent:J,source:`
136
- `});return{type:"block-scalar",offset:Q,indent:J,props:_,source:Y}}case'"':return{type:"double-quoted-scalar",offset:Q,indent:J,source:U,end:z};case"'":return{type:"single-quoted-scalar",offset:Q,indent:J,source:U,end:z};default:return{type:"scalar",offset:Q,indent:J,source:U,end:z}}}function pH(q,Z,X={}){let{afterKey:J=!1,implicitKey:$=!1,inFlow:Q=!1,type:H}=X,U="indent"in q?q.indent:null;if(J&&typeof U==="number")U+=2;if(!H)switch(q.type){case"single-quoted-scalar":H="QUOTE_SINGLE";break;case"double-quoted-scalar":H="QUOTE_DOUBLE";break;case"block-scalar":{let G=q.props[0];if(G.type!=="block-scalar-header")throw Error("Invalid block scalar header");H=G.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:H="PLAIN"}let z=t3.stringifyString({type:H,value:Z},{implicitKey:$||U===null,indent:U!==null&&U>0?" ".repeat(U):"",inFlow:Q,options:{blockQuote:!0,lineWidth:-1}});switch(z[0]){case"|":case">":cH(q,z);break;case'"':r9(q,z,"double-quoted-scalar");break;case"'":r9(q,z,"single-quoted-scalar");break;default:r9(q,z,"scalar")}}function cH(q,Z){let X=Z.indexOf(`
131
+ ${Q}`:X}}if(Z)Array.prototype.push.apply(q.errors,this.errors),Array.prototype.push.apply(q.warnings,this.warnings);else q.errors=this.errors,q.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:t3(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(q,Z=!1,X=-1){for(let J of q)yield*this.next(J);yield*this.end(Z,X)}*next(q){if(hH.env.LOG_STREAM)console.dir(q,{depth:null});switch(q.type){case"directive":this.directives.add(q.source,(Z,X,J)=>{let $=Y0(q);$[0]+=Z,this.onError($,"BAD_DIRECTIVE",X,J)}),this.prelude.push(q.source),this.atDirectives=!0;break;case"document":{let Z=mH.composeDoc(this.options,this.directives,q,this.onError);if(this.atDirectives&&!Z.directives.docStart)this.onError(q,"MISSING_CHAR","Missing directives-end/doc-start indicator line");if(this.decorate(Z,!1),this.doc)yield this.doc;this.doc=Z,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(q.source);break;case"error":{let Z=q.source?`${q.message}: ${JSON.stringify(q.source)}`:q.message,X=new G0.YAMLParseError(Y0(q),"UNEXPECTED_TOKEN",Z);if(this.atDirectives||!this.doc)this.errors.push(X);else this.doc.errors.push(X);break}case"doc-end":{if(!this.doc){this.errors.push(new G0.YAMLParseError(Y0(q),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let Z=dH.resolveEnd(q.end,q.offset+q.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),Z.comment){let X=this.doc.comment;this.doc.comment=X?`${X}
132
+ ${Z.comment}`:Z.comment}this.doc.range[2]=Z.offset;break}default:this.errors.push(new G0.YAMLParseError(Y0(q),"UNEXPECTED_TOKEN",`Unsupported token ${q.type}`))}}*end(q=!1,Z=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(q){let X=Object.assign({_directives:this.directives},this.options),J=new uH.Document(void 0,X);if(this.atDirectives)this.onError(Z,"MISSING_CHAR","Missing directives-end indicator line");J.range=[0,Z,Z],this.decorate(J,!1),yield J}}}lH.Composer=e3});var X5=P((tH)=>{var cH=p9(),iH=i9(),aH=z0(),q5=r1();function sH(q,Z=!0,X){if(q){let J=($,Q,H)=>{let z=typeof $==="number"?$:Array.isArray($)?$[0]:$.offset;if(X)X(z,Q,H);else throw new aH.YAMLParseError([z,z+1],Q,H)};switch(q.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return iH.resolveFlowScalar(q,Z,J);case"block-scalar":return cH.resolveBlockScalar({options:{strict:Z}},q,J)}}return null}function rH(q,Z){let{implicitKey:X=!1,indent:J,inFlow:$=!1,offset:Q=-1,type:H="PLAIN"}=Z,z=q5.stringifyString({type:H,value:q},{implicitKey:X,indent:J>0?" ".repeat(J):"",inFlow:$,options:{blockQuote:!0,lineWidth:-1}}),U=Z.end??[{type:"newline",offset:-1,indent:J,source:`
133
+ `}];switch(z[0]){case"|":case">":{let G=z.indexOf(`
134
+ `),T=z.substring(0,G),Y=z.substring(G+1)+`
135
+ `,_=[{type:"block-scalar-header",offset:Q,indent:J,source:T}];if(!Z5(_,U))_.push({type:"newline",offset:-1,indent:J,source:`
136
+ `});return{type:"block-scalar",offset:Q,indent:J,props:_,source:Y}}case'"':return{type:"double-quoted-scalar",offset:Q,indent:J,source:z,end:U};case"'":return{type:"single-quoted-scalar",offset:Q,indent:J,source:z,end:U};default:return{type:"scalar",offset:Q,indent:J,source:z,end:U}}}function nH(q,Z,X={}){let{afterKey:J=!1,implicitKey:$=!1,inFlow:Q=!1,type:H}=X,z="indent"in q?q.indent:null;if(J&&typeof z==="number")z+=2;if(!H)switch(q.type){case"single-quoted-scalar":H="QUOTE_SINGLE";break;case"double-quoted-scalar":H="QUOTE_DOUBLE";break;case"block-scalar":{let G=q.props[0];if(G.type!=="block-scalar-header")throw Error("Invalid block scalar header");H=G.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:H="PLAIN"}let U=q5.stringifyString({type:H,value:Z},{implicitKey:$||z===null,indent:z!==null&&z>0?" ".repeat(z):"",inFlow:Q,options:{blockQuote:!0,lineWidth:-1}});switch(U[0]){case"|":case">":oH(q,U);break;case'"':r9(q,U,"double-quoted-scalar");break;case"'":r9(q,U,"single-quoted-scalar");break;default:r9(q,U,"scalar")}}function oH(q,Z){let X=Z.indexOf(`
137
137
  `),J=Z.substring(0,X),$=Z.substring(X+1)+`
138
- `;if(q.type==="block-scalar"){let Q=q.props[0];if(Q.type!=="block-scalar-header")throw Error("Invalid block scalar header");Q.source=J,q.source=$}else{let{offset:Q}=q,H="indent"in q?q.indent:-1,U=[{type:"block-scalar-header",offset:Q,indent:H,source:J}];if(!e3(U,"end"in q?q.end:void 0))U.push({type:"newline",offset:-1,indent:H,source:`
139
- `});for(let z of Object.keys(q))if(z!=="type"&&z!=="offset")delete q[z];Object.assign(q,{type:"block-scalar",indent:H,props:U,source:$})}}function e3(q,Z){if(Z)for(let X of Z)switch(X.type){case"space":case"comment":q.push(X);break;case"newline":return q.push(X),!0}return!1}function r9(q,Z,X){switch(q.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":q.type=X,q.source=Z;break;case"block-scalar":{let J=q.props.slice(1),$=Z.length;if(q.props[0].type==="block-scalar-header")$-=q.props[0].source.length;for(let Q of J)Q.offset+=$;delete q.props,Object.assign(q,{type:X,source:Z,end:J});break}case"block-map":case"block-seq":{let $={type:"newline",offset:q.offset+Z.length,indent:q.indent,source:`
140
- `};delete q.items,Object.assign(q,{type:X,source:Z,end:[$]});break}default:{let J="indent"in q?q.indent:-1,$="end"in q&&Array.isArray(q.end)?q.end.filter((Q)=>Q.type==="space"||Q.type==="comment"||Q.type==="newline"):[];for(let Q of Object.keys(q))if(Q!=="type"&&Q!=="offset")delete q[Q];Object.assign(q,{type:X,indent:J,source:Z,end:$})}}}iH.createScalarToken=lH;iH.resolveAsScalar=dH;iH.setScalarValue=pH});var Z5=P((oH)=>{var nH=(q)=>("type"in q)?Bq(q):Yq(q);function Bq(q){switch(q.type){case"block-scalar":{let Z="";for(let X of q.props)Z+=Bq(X);return Z+q.source}case"block-map":case"block-seq":{let Z="";for(let X of q.items)Z+=Yq(X);return Z}case"flow-collection":{let Z=q.start.source;for(let X of q.items)Z+=Yq(X);for(let X of q.end)Z+=X.source;return Z}case"document":{let Z=Yq(q);if(q.end)for(let X of q.end)Z+=X.source;return Z}default:{let Z=q.source;if("end"in q&&q.end)for(let X of q.end)Z+=X.source;return Z}}}function Yq({start:q,key:Z,sep:X,value:J}){let $="";for(let Q of q)$+=Q.source;if(Z)$+=Bq(Z);if(X)for(let Q of X)$+=Q.source;if(J)$+=Bq(J);return $}oH.stringify=nH});var $5=P((qU)=>{var n9=Symbol("break visit"),eH=Symbol("skip children"),X5=Symbol("remove item");function P1(q,Z){if("type"in q&&q.type==="document")q={start:q.start,value:q.value};J5(Object.freeze([]),q,Z)}P1.BREAK=n9;P1.SKIP=eH;P1.REMOVE=X5;P1.itemAtPath=(q,Z)=>{let X=q;for(let[J,$]of Z){let Q=X?.[J];if(Q&&"items"in Q)X=Q.items[$];else return}return X};P1.parentCollection=(q,Z)=>{let X=P1.itemAtPath(q,Z.slice(0,-1)),J=Z[Z.length-1][0],$=X?.[J];if($&&"items"in $)return $;throw Error("Parent collection not found")};function J5(q,Z,X){let J=X(Z,q);if(typeof J==="symbol")return J;for(let $ of["key","value"]){let Q=Z[$];if(Q&&"items"in Q){for(let H=0;H<Q.items.length;++H){let U=J5(Object.freeze(q.concat([[$,H]])),Q.items[H],X);if(typeof U==="number")H=U-1;else if(U===n9)return n9;else if(U===X5)Q.items.splice(H,1),H-=1}if(typeof J==="function"&&$==="key")J=J(Z,q)}}return typeof J==="function"?J(Z,q):J}qU.visit=P1});var Tq=P((zU)=>{var o9=q5(),XU=Z5(),JU=$5(),t9="\uFEFF",e9="\x02",q4="\x18",Z4="\x1F",$U=(q)=>!!q&&("items"in q),QU=(q)=>!!q&&(q.type==="scalar"||q.type==="single-quoted-scalar"||q.type==="double-quoted-scalar"||q.type==="block-scalar");function HU(q){switch(q){case t9:return"<BOM>";case e9:return"<DOC>";case q4:return"<FLOW_END>";case Z4:return"<SCALAR>";default:return JSON.stringify(q)}}function UU(q){switch(q){case t9:return"byte-order-mark";case e9:return"doc-mode";case q4:return"flow-error-end";case Z4:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
138
+ `;if(q.type==="block-scalar"){let Q=q.props[0];if(Q.type!=="block-scalar-header")throw Error("Invalid block scalar header");Q.source=J,q.source=$}else{let{offset:Q}=q,H="indent"in q?q.indent:-1,z=[{type:"block-scalar-header",offset:Q,indent:H,source:J}];if(!Z5(z,"end"in q?q.end:void 0))z.push({type:"newline",offset:-1,indent:H,source:`
139
+ `});for(let U of Object.keys(q))if(U!=="type"&&U!=="offset")delete q[U];Object.assign(q,{type:"block-scalar",indent:H,props:z,source:$})}}function Z5(q,Z){if(Z)for(let X of Z)switch(X.type){case"space":case"comment":q.push(X);break;case"newline":return q.push(X),!0}return!1}function r9(q,Z,X){switch(q.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":q.type=X,q.source=Z;break;case"block-scalar":{let J=q.props.slice(1),$=Z.length;if(q.props[0].type==="block-scalar-header")$-=q.props[0].source.length;for(let Q of J)Q.offset+=$;delete q.props,Object.assign(q,{type:X,source:Z,end:J});break}case"block-map":case"block-seq":{let $={type:"newline",offset:q.offset+Z.length,indent:q.indent,source:`
140
+ `};delete q.items,Object.assign(q,{type:X,source:Z,end:[$]});break}default:{let J="indent"in q?q.indent:-1,$="end"in q&&Array.isArray(q.end)?q.end.filter((Q)=>Q.type==="space"||Q.type==="comment"||Q.type==="newline"):[];for(let Q of Object.keys(q))if(Q!=="type"&&Q!=="offset")delete q[Q];Object.assign(q,{type:X,indent:J,source:Z,end:$})}}}tH.createScalarToken=rH;tH.resolveAsScalar=sH;tH.setScalarValue=nH});var J5=P((Jz)=>{var Xz=(q)=>("type"in q)?Bq(q):Yq(q);function Bq(q){switch(q.type){case"block-scalar":{let Z="";for(let X of q.props)Z+=Bq(X);return Z+q.source}case"block-map":case"block-seq":{let Z="";for(let X of q.items)Z+=Yq(X);return Z}case"flow-collection":{let Z=q.start.source;for(let X of q.items)Z+=Yq(X);for(let X of q.end)Z+=X.source;return Z}case"document":{let Z=Yq(q);if(q.end)for(let X of q.end)Z+=X.source;return Z}default:{let Z=q.source;if("end"in q&&q.end)for(let X of q.end)Z+=X.source;return Z}}}function Yq({start:q,key:Z,sep:X,value:J}){let $="";for(let Q of q)$+=Q.source;if(Z)$+=Bq(Z);if(X)for(let Q of X)$+=Q.source;if(J)$+=Bq(J);return $}Jz.stringify=Xz});var H5=P((Hz)=>{var n9=Symbol("break visit"),Qz=Symbol("skip children"),$5=Symbol("remove item");function P1(q,Z){if("type"in q&&q.type==="document")q={start:q.start,value:q.value};Q5(Object.freeze([]),q,Z)}P1.BREAK=n9;P1.SKIP=Qz;P1.REMOVE=$5;P1.itemAtPath=(q,Z)=>{let X=q;for(let[J,$]of Z){let Q=X?.[J];if(Q&&"items"in Q)X=Q.items[$];else return}return X};P1.parentCollection=(q,Z)=>{let X=P1.itemAtPath(q,Z.slice(0,-1)),J=Z[Z.length-1][0],$=X?.[J];if($&&"items"in $)return $;throw Error("Parent collection not found")};function Q5(q,Z,X){let J=X(Z,q);if(typeof J==="symbol")return J;for(let $ of["key","value"]){let Q=Z[$];if(Q&&"items"in Q){for(let H=0;H<Q.items.length;++H){let z=Q5(Object.freeze(q.concat([[$,H]])),Q.items[H],X);if(typeof z==="number")H=z-1;else if(z===n9)return n9;else if(z===$5)Q.items.splice(H,1),H-=1}if(typeof J==="function"&&$==="key")J=J(Z,q)}}return typeof J==="function"?J(Z,q):J}Hz.visit=P1});var Tq=P((Wz)=>{var o9=X5(),Uz=J5(),Gz=H5(),t9="\uFEFF",e9="\x02",q4="\x18",Z4="\x1F",Yz=(q)=>!!q&&("items"in q),Bz=(q)=>!!q&&(q.type==="scalar"||q.type==="single-quoted-scalar"||q.type==="double-quoted-scalar"||q.type==="block-scalar");function Tz(q){switch(q){case t9:return"<BOM>";case e9:return"<DOC>";case q4:return"<FLOW_END>";case Z4:return"<SCALAR>";default:return JSON.stringify(q)}}function _z(q){switch(q){case t9:return"byte-order-mark";case e9:return"doc-mode";case q4:return"flow-error-end";case Z4:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
141
141
  `:case`\r
142
- `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(q[0]){case" ":case"\t":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}zU.createScalarToken=o9.createScalarToken;zU.resolveAsScalar=o9.resolveAsScalar;zU.setScalarValue=o9.setScalarValue;zU.stringify=XU.stringify;zU.visit=JU.visit;zU.BOM=t9;zU.DOCUMENT=e9;zU.FLOW_END=q4;zU.SCALAR=Z4;zU.isCollection=$U;zU.isScalar=QU;zU.prettyToken=HU;zU.tokenType=UU});var J4=P((OU)=>{var B0=Tq();function l(q){switch(q){case void 0:case" ":case`
143
- `:case"\r":case"\t":return!0;default:return!1}}var Q5=new Set("0123456789ABCDEFabcdef"),PU=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),_q=new Set(",[]{}"),FU=new Set(` ,[]{}
144
- \r `),X4=(q)=>!q||FU.has(q);class H5{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(q,Z=!1){if(q){if(typeof q!=="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+q:q,this.lineEndPos=null}this.atEnd=!Z;let X=this.next??"stream";while(X&&(Z||this.hasChars(1)))X=yield*this.parseNext(X)}atLineEnd(){let q=this.pos,Z=this.buffer[q];while(Z===" "||Z==="\t")Z=this.buffer[++q];if(!Z||Z==="#"||Z===`
142
+ `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(q[0]){case" ":case"\t":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}Wz.createScalarToken=o9.createScalarToken;Wz.resolveAsScalar=o9.resolveAsScalar;Wz.setScalarValue=o9.setScalarValue;Wz.stringify=Uz.stringify;Wz.visit=Gz.visit;Wz.BOM=t9;Wz.DOCUMENT=e9;Wz.FLOW_END=q4;Wz.SCALAR=Z4;Wz.isCollection=Yz;Wz.isScalar=Bz;Wz.prettyToken=Tz;Wz.tokenType=_z});var J4=P((jz)=>{var B0=Tq();function l(q){switch(q){case void 0:case" ":case`
143
+ `:case"\r":case"\t":return!0;default:return!1}}var z5=new Set("0123456789ABCDEFabcdef"),wz=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),_q=new Set(",[]{}"),bz=new Set(` ,[]{}
144
+ \r `),X4=(q)=>!q||bz.has(q);class U5{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(q,Z=!1){if(q){if(typeof q!=="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+q:q,this.lineEndPos=null}this.atEnd=!Z;let X=this.next??"stream";while(X&&(Z||this.hasChars(1)))X=yield*this.parseNext(X)}atLineEnd(){let q=this.pos,Z=this.buffer[q];while(Z===" "||Z==="\t")Z=this.buffer[++q];if(!Z||Z==="#"||Z===`
145
145
  `)return!0;if(Z==="\r")return this.buffer[q+1]===`
146
146
  `;return!1}charAt(q){return this.buffer[this.pos+q]}continueScalar(q){let Z=this.buffer[q];if(this.indentNext>0){let X=0;while(Z===" ")Z=this.buffer[++X+q];if(Z==="\r"){let J=this.buffer[X+q+1];if(J===`
147
147
  `||!J&&!this.atEnd)return q+X+1}return Z===`
@@ -156,95 +156,95 @@ ${Z.comment}`:Z.comment}this.doc.range[2]=Z.offset;break}default:this.errors.pus
156
156
  `&&$>=this.pos&&$+1+Z>H)q=$;else break}while(!0);return yield B0.SCALAR,yield*this.pushToIndex(q+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let q=this.flowLevel>0,Z=this.pos-1,X=this.pos-1,J;while(J=this.buffer[++X])if(J===":"){let $=this.buffer[X+1];if(l($)||q&&_q.has($))break;Z=X}else if(l(J)){let $=this.buffer[X+1];if(J==="\r")if($===`
157
157
  `)X+=1,J=`
158
158
  `,$=this.buffer[X+1];else Z=X;if($==="#"||q&&_q.has($))break;if(J===`
159
- `){let Q=this.continueScalar(X+1);if(Q===-1)break;X=Math.max(X,Q-2)}}else{if(q&&_q.has(J))break;Z=X}if(!J&&!this.atEnd)return this.setNext("plain-scalar");return yield B0.SCALAR,yield*this.pushToIndex(Z+1,!0),q?"flow":"doc"}*pushCount(q){if(q>0)return yield this.buffer.substr(this.pos,q),this.pos+=q,q;return 0}*pushToIndex(q,Z){let X=this.buffer.slice(this.pos,q);if(X)return yield X,this.pos+=X.length,X.length;else if(Z)yield"";return 0}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(X4))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let q=this.flowLevel>0,Z=this.charAt(1);if(l(Z)||q&&_q.has(Z)){if(!q)this.indentNext=this.indentValue+1;else if(this.flowKey)this.flowKey=!1;return(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}}return 0}*pushTag(){if(this.charAt(1)==="<"){let q=this.pos+2,Z=this.buffer[q];while(!l(Z)&&Z!==">")Z=this.buffer[++q];return yield*this.pushToIndex(Z===">"?q+1:q,!1)}else{let q=this.pos+1,Z=this.buffer[q];while(Z)if(PU.has(Z))Z=this.buffer[++q];else if(Z==="%"&&Q5.has(this.buffer[q+1])&&Q5.has(this.buffer[q+2]))Z=this.buffer[q+=3];else break;return yield*this.pushToIndex(q,!1)}}*pushNewline(){let q=this.buffer[this.pos];if(q===`
159
+ `){let Q=this.continueScalar(X+1);if(Q===-1)break;X=Math.max(X,Q-2)}}else{if(q&&_q.has(J))break;Z=X}if(!J&&!this.atEnd)return this.setNext("plain-scalar");return yield B0.SCALAR,yield*this.pushToIndex(Z+1,!0),q?"flow":"doc"}*pushCount(q){if(q>0)return yield this.buffer.substr(this.pos,q),this.pos+=q,q;return 0}*pushToIndex(q,Z){let X=this.buffer.slice(this.pos,q);if(X)return yield X,this.pos+=X.length,X.length;else if(Z)yield"";return 0}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(X4))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let q=this.flowLevel>0,Z=this.charAt(1);if(l(Z)||q&&_q.has(Z)){if(!q)this.indentNext=this.indentValue+1;else if(this.flowKey)this.flowKey=!1;return(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}}return 0}*pushTag(){if(this.charAt(1)==="<"){let q=this.pos+2,Z=this.buffer[q];while(!l(Z)&&Z!==">")Z=this.buffer[++q];return yield*this.pushToIndex(Z===">"?q+1:q,!1)}else{let q=this.pos+1,Z=this.buffer[q];while(Z)if(wz.has(Z))Z=this.buffer[++q];else if(Z==="%"&&z5.has(this.buffer[q+1])&&z5.has(this.buffer[q+2]))Z=this.buffer[q+=3];else break;return yield*this.pushToIndex(q,!1)}}*pushNewline(){let q=this.buffer[this.pos];if(q===`
160
160
  `)return yield*this.pushCount(1);else if(q==="\r"&&this.charAt(1)===`
161
- `)return yield*this.pushCount(2);else return 0}*pushSpaces(q){let Z=this.pos-1,X;do X=this.buffer[++Z];while(X===" "||q&&X==="\t");let J=Z-this.pos;if(J>0)yield this.buffer.substr(this.pos,J),this.pos=Z;return J}*pushUntil(q){let Z=this.pos,X=this.buffer[Z];while(!q(X))X=this.buffer[++Z];return yield*this.pushToIndex(Z,!1)}}OU.Lexer=H5});var $4=P((AU)=>{class U5{constructor(){this.lineStarts=[],this.addNewLine=(q)=>this.lineStarts.push(q),this.linePos=(q)=>{let Z=0,X=this.lineStarts.length;while(Z<X){let $=Z+X>>1;if(this.lineStarts[$]<q)Z=$+1;else X=$}if(this.lineStarts[Z]===q)return{line:Z+1,col:1};if(Z===0)return{line:0,col:q};let J=this.lineStarts[Z-1];return{line:Z,col:q-J+1}}}}AU.LineCounter=U5});var Q4=P((jU)=>{var wU=r("process"),z5=Tq(),bU=J4();function z1(q,Z){for(let X=0;X<q.length;++X)if(q[X].type===Z)return!0;return!1}function G5(q){for(let Z=0;Z<q.length;++Z)switch(q[Z].type){case"space":case"comment":case"newline":break;default:return Z}return-1}function B5(q){switch(q?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Lq(q){switch(q.type){case"document":return q.start;case"block-map":{let Z=q.items[q.items.length-1];return Z.sep??Z.start}case"block-seq":return q.items[q.items.length-1].start;default:return[]}}function k1(q){if(q.length===0)return[];let Z=q.length;q:while(--Z>=0)switch(q[Z].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break q}while(q[++Z]?.type==="space");return q.splice(Z,q.length)}function Y5(q){if(q.start.type==="flow-seq-start"){for(let Z of q.items)if(Z.sep&&!Z.value&&!z1(Z.start,"explicit-key-ind")&&!z1(Z.sep,"map-value-ind")){if(Z.key)Z.value=Z.key;if(delete Z.key,B5(Z.value))if(Z.value.end)Array.prototype.push.apply(Z.value.end,Z.sep);else Z.value.end=Z.sep;else Array.prototype.push.apply(Z.start,Z.sep);delete Z.sep}}}class T5{constructor(q){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new bU.Lexer,this.onNewLine=q}*parse(q,Z=!1){if(this.onNewLine&&this.offset===0)this.onNewLine(0);for(let X of this.lexer.lex(q,Z))yield*this.next(X);if(!Z)yield*this.end()}*next(q){if(this.source=q,wU.env.LOG_TOKENS)console.log("|",z5.prettyToken(q));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=q.length;return}let Z=z5.tokenType(q);if(!Z){let X=`Not a YAML token: ${q}`;yield*this.pop({type:"error",offset:this.offset,message:X,source:q}),this.offset+=q.length}else if(Z==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=Z,yield*this.step(),Z){case"newline":if(this.atNewLine=!0,this.indent=0,this.onNewLine)this.onNewLine(this.offset+q.length);break;case"space":if(this.atNewLine&&q[0]===" ")this.indent+=q.length;break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":if(this.atNewLine)this.indent+=q.length;break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=q.length}}*end(){while(this.stack.length>0)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let q=this.peek(1);if(this.type==="doc-end"&&q?.type!=="doc-end"){while(this.stack.length>0)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!q)return yield*this.stream();switch(q.type){case"document":return yield*this.document(q);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(q);case"block-scalar":return yield*this.blockScalar(q);case"block-map":return yield*this.blockMap(q);case"block-seq":return yield*this.blockSequence(q);case"flow-collection":return yield*this.flowCollection(q);case"doc-end":return yield*this.documentEnd(q)}yield*this.pop()}peek(q){return this.stack[this.stack.length-q]}*pop(q){let Z=q??this.stack.pop();if(!Z)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield Z;else{let X=this.peek(1);if(Z.type==="block-scalar")Z.indent="indent"in X?X.indent:0;else if(Z.type==="flow-collection"&&X.type==="document")Z.indent=0;if(Z.type==="flow-collection")Y5(Z);switch(X.type){case"document":X.value=Z;break;case"block-scalar":X.props.push(Z);break;case"block-map":{let J=X.items[X.items.length-1];if(J.value){X.items.push({start:[],key:Z,sep:[]}),this.onKeyLine=!0;return}else if(J.sep)J.value=Z;else{Object.assign(J,{key:Z,sep:[]}),this.onKeyLine=!J.explicitKey;return}break}case"block-seq":{let J=X.items[X.items.length-1];if(J.value)X.items.push({start:[],value:Z});else J.value=Z;break}case"flow-collection":{let J=X.items[X.items.length-1];if(!J||J.value)X.items.push({start:[],key:Z,sep:[]});else if(J.sep)J.value=Z;else Object.assign(J,{key:Z,sep:[]});return}default:yield*this.pop(),yield*this.pop(Z)}if((X.type==="document"||X.type==="block-map"||X.type==="block-seq")&&(Z.type==="block-map"||Z.type==="block-seq")){let J=Z.items[Z.items.length-1];if(J&&!J.sep&&!J.value&&J.start.length>0&&G5(J.start)===-1&&(Z.indent===0||J.start.every(($)=>$.type!=="comment"||$.indent<Z.indent))){if(X.type==="document")X.end=J.start;else X.items.push({start:J.start});Z.items.splice(-1,1)}}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let q={type:"document",offset:this.offset,start:[]};if(this.type==="doc-start")q.start.push(this.sourceToken);this.stack.push(q);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(q){if(q.value)return yield*this.lineEnd(q);switch(this.type){case"doc-start":{if(G5(q.start)!==-1)yield*this.pop(),yield*this.step();else q.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":q.start.push(this.sourceToken);return}let Z=this.startBlockValue(q);if(Z)this.stack.push(Z);else yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(q){if(this.type==="map-value-ind"){let Z=Lq(this.peek(2)),X=k1(Z),J;if(q.end)J=q.end,J.push(this.sourceToken),delete q.end;else J=[this.sourceToken];let $={type:"block-map",offset:q.offset,indent:q.indent,items:[{start:X,key:q,sep:J}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=$}else yield*this.lineEnd(q)}*blockScalar(q){switch(this.type){case"space":case"comment":case"newline":q.props.push(this.sourceToken);return;case"scalar":if(q.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let Z=this.source.indexOf(`
161
+ `)return yield*this.pushCount(2);else return 0}*pushSpaces(q){let Z=this.pos-1,X;do X=this.buffer[++Z];while(X===" "||q&&X==="\t");let J=Z-this.pos;if(J>0)yield this.buffer.substr(this.pos,J),this.pos=Z;return J}*pushUntil(q){let Z=this.pos,X=this.buffer[Z];while(!q(X))X=this.buffer[++Z];return yield*this.pushToIndex(Z,!1)}}jz.Lexer=U5});var $4=P((Cz)=>{class G5{constructor(){this.lineStarts=[],this.addNewLine=(q)=>this.lineStarts.push(q),this.linePos=(q)=>{let Z=0,X=this.lineStarts.length;while(Z<X){let $=Z+X>>1;if(this.lineStarts[$]<q)Z=$+1;else X=$}if(this.lineStarts[Z]===q)return{line:Z+1,col:1};if(Z===0)return{line:0,col:q};let J=this.lineStarts[Z-1];return{line:Z,col:q-J+1}}}}Cz.LineCounter=G5});var Q4=P((kz)=>{var yz=r("process"),Y5=Tq(),xz=J4();function U1(q,Z){for(let X=0;X<q.length;++X)if(q[X].type===Z)return!0;return!1}function B5(q){for(let Z=0;Z<q.length;++Z)switch(q[Z].type){case"space":case"comment":case"newline":break;default:return Z}return-1}function _5(q){switch(q?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Wq(q){switch(q.type){case"document":return q.start;case"block-map":{let Z=q.items[q.items.length-1];return Z.sep??Z.start}case"block-seq":return q.items[q.items.length-1].start;default:return[]}}function k1(q){if(q.length===0)return[];let Z=q.length;q:while(--Z>=0)switch(q[Z].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break q}while(q[++Z]?.type==="space");return q.splice(Z,q.length)}function T5(q){if(q.start.type==="flow-seq-start"){for(let Z of q.items)if(Z.sep&&!Z.value&&!U1(Z.start,"explicit-key-ind")&&!U1(Z.sep,"map-value-ind")){if(Z.key)Z.value=Z.key;if(delete Z.key,_5(Z.value))if(Z.value.end)Array.prototype.push.apply(Z.value.end,Z.sep);else Z.value.end=Z.sep;else Array.prototype.push.apply(Z.start,Z.sep);delete Z.sep}}}class W5{constructor(q){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new xz.Lexer,this.onNewLine=q}*parse(q,Z=!1){if(this.onNewLine&&this.offset===0)this.onNewLine(0);for(let X of this.lexer.lex(q,Z))yield*this.next(X);if(!Z)yield*this.end()}*next(q){if(this.source=q,yz.env.LOG_TOKENS)console.log("|",Y5.prettyToken(q));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=q.length;return}let Z=Y5.tokenType(q);if(!Z){let X=`Not a YAML token: ${q}`;yield*this.pop({type:"error",offset:this.offset,message:X,source:q}),this.offset+=q.length}else if(Z==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=Z,yield*this.step(),Z){case"newline":if(this.atNewLine=!0,this.indent=0,this.onNewLine)this.onNewLine(this.offset+q.length);break;case"space":if(this.atNewLine&&q[0]===" ")this.indent+=q.length;break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":if(this.atNewLine)this.indent+=q.length;break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=q.length}}*end(){while(this.stack.length>0)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let q=this.peek(1);if(this.type==="doc-end"&&q?.type!=="doc-end"){while(this.stack.length>0)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!q)return yield*this.stream();switch(q.type){case"document":return yield*this.document(q);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(q);case"block-scalar":return yield*this.blockScalar(q);case"block-map":return yield*this.blockMap(q);case"block-seq":return yield*this.blockSequence(q);case"flow-collection":return yield*this.flowCollection(q);case"doc-end":return yield*this.documentEnd(q)}yield*this.pop()}peek(q){return this.stack[this.stack.length-q]}*pop(q){let Z=q??this.stack.pop();if(!Z)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield Z;else{let X=this.peek(1);if(Z.type==="block-scalar")Z.indent="indent"in X?X.indent:0;else if(Z.type==="flow-collection"&&X.type==="document")Z.indent=0;if(Z.type==="flow-collection")T5(Z);switch(X.type){case"document":X.value=Z;break;case"block-scalar":X.props.push(Z);break;case"block-map":{let J=X.items[X.items.length-1];if(J.value){X.items.push({start:[],key:Z,sep:[]}),this.onKeyLine=!0;return}else if(J.sep)J.value=Z;else{Object.assign(J,{key:Z,sep:[]}),this.onKeyLine=!J.explicitKey;return}break}case"block-seq":{let J=X.items[X.items.length-1];if(J.value)X.items.push({start:[],value:Z});else J.value=Z;break}case"flow-collection":{let J=X.items[X.items.length-1];if(!J||J.value)X.items.push({start:[],key:Z,sep:[]});else if(J.sep)J.value=Z;else Object.assign(J,{key:Z,sep:[]});return}default:yield*this.pop(),yield*this.pop(Z)}if((X.type==="document"||X.type==="block-map"||X.type==="block-seq")&&(Z.type==="block-map"||Z.type==="block-seq")){let J=Z.items[Z.items.length-1];if(J&&!J.sep&&!J.value&&J.start.length>0&&B5(J.start)===-1&&(Z.indent===0||J.start.every(($)=>$.type!=="comment"||$.indent<Z.indent))){if(X.type==="document")X.end=J.start;else X.items.push({start:J.start});Z.items.splice(-1,1)}}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let q={type:"document",offset:this.offset,start:[]};if(this.type==="doc-start")q.start.push(this.sourceToken);this.stack.push(q);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(q){if(q.value)return yield*this.lineEnd(q);switch(this.type){case"doc-start":{if(B5(q.start)!==-1)yield*this.pop(),yield*this.step();else q.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":q.start.push(this.sourceToken);return}let Z=this.startBlockValue(q);if(Z)this.stack.push(Z);else yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(q){if(this.type==="map-value-ind"){let Z=Wq(this.peek(2)),X=k1(Z),J;if(q.end)J=q.end,J.push(this.sourceToken),delete q.end;else J=[this.sourceToken];let $={type:"block-map",offset:q.offset,indent:q.indent,items:[{start:X,key:q,sep:J}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=$}else yield*this.lineEnd(q)}*blockScalar(q){switch(this.type){case"space":case"comment":case"newline":q.props.push(this.sourceToken);return;case"scalar":if(q.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let Z=this.source.indexOf(`
162
162
  `)+1;while(Z!==0)this.onNewLine(this.offset+Z),Z=this.source.indexOf(`
163
- `,Z)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(q){let Z=q.items[q.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,Z.value){let X="end"in Z.value?Z.value.end:void 0;if((Array.isArray(X)?X[X.length-1]:void 0)?.type==="comment")X?.push(this.sourceToken);else q.items.push({start:[this.sourceToken]})}else if(Z.sep)Z.sep.push(this.sourceToken);else Z.start.push(this.sourceToken);return;case"space":case"comment":if(Z.value)q.items.push({start:[this.sourceToken]});else if(Z.sep)Z.sep.push(this.sourceToken);else{if(this.atIndentedComment(Z.start,q.indent)){let J=q.items[q.items.length-2]?.value?.end;if(Array.isArray(J)){Array.prototype.push.apply(J,Z.start),J.push(this.sourceToken),q.items.pop();return}}Z.start.push(this.sourceToken)}return}if(this.indent>=q.indent){let X=!this.onKeyLine&&this.indent===q.indent,J=X&&(Z.sep||Z.explicitKey)&&this.type!=="seq-item-ind",$=[];if(J&&Z.sep&&!Z.value){let Q=[];for(let H=0;H<Z.sep.length;++H){let U=Z.sep[H];switch(U.type){case"newline":Q.push(H);break;case"space":break;case"comment":if(U.indent>q.indent)Q.length=0;break;default:Q.length=0}}if(Q.length>=2)$=Z.sep.splice(Q[1])}switch(this.type){case"anchor":case"tag":if(J||Z.value)$.push(this.sourceToken),q.items.push({start:$}),this.onKeyLine=!0;else if(Z.sep)Z.sep.push(this.sourceToken);else Z.start.push(this.sourceToken);return;case"explicit-key-ind":if(!Z.sep&&!Z.explicitKey)Z.start.push(this.sourceToken),Z.explicitKey=!0;else if(J||Z.value)$.push(this.sourceToken),q.items.push({start:$,explicitKey:!0});else this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]});this.onKeyLine=!0;return;case"map-value-ind":if(Z.explicitKey)if(!Z.sep)if(z1(Z.start,"newline"))Object.assign(Z,{key:null,sep:[this.sourceToken]});else{let Q=k1(Z.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:Q,key:null,sep:[this.sourceToken]}]})}else if(Z.value)q.items.push({start:[],key:null,sep:[this.sourceToken]});else if(z1(Z.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:$,key:null,sep:[this.sourceToken]}]});else if(B5(Z.key)&&!z1(Z.sep,"newline")){let Q=k1(Z.start),H=Z.key,U=Z.sep;U.push(this.sourceToken),delete Z.key,delete Z.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:Q,key:H,sep:U}]})}else if($.length>0)Z.sep=Z.sep.concat($,this.sourceToken);else Z.sep.push(this.sourceToken);else if(!Z.sep)Object.assign(Z,{key:null,sep:[this.sourceToken]});else if(Z.value||J)q.items.push({start:$,key:null,sep:[this.sourceToken]});else if(z1(Z.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else Z.sep.push(this.sourceToken);this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let Q=this.flowScalar(this.type);if(J||Z.value)q.items.push({start:$,key:Q,sep:[]}),this.onKeyLine=!0;else if(Z.sep)this.stack.push(Q);else Object.assign(Z,{key:Q,sep:[]}),this.onKeyLine=!0;return}default:{let Q=this.startBlockValue(q);if(Q){if(Q.type==="block-seq"){if(!Z.explicitKey&&Z.sep&&!z1(Z.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else if(X)q.items.push({start:$});this.stack.push(Q);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(q){let Z=q.items[q.items.length-1];switch(this.type){case"newline":if(Z.value){let X="end"in Z.value?Z.value.end:void 0;if((Array.isArray(X)?X[X.length-1]:void 0)?.type==="comment")X?.push(this.sourceToken);else q.items.push({start:[this.sourceToken]})}else Z.start.push(this.sourceToken);return;case"space":case"comment":if(Z.value)q.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(Z.start,q.indent)){let J=q.items[q.items.length-2]?.value?.end;if(Array.isArray(J)){Array.prototype.push.apply(J,Z.start),J.push(this.sourceToken),q.items.pop();return}}Z.start.push(this.sourceToken)}return;case"anchor":case"tag":if(Z.value||this.indent<=q.indent)break;Z.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==q.indent)break;if(Z.value||z1(Z.start,"seq-item-ind"))q.items.push({start:[this.sourceToken]});else Z.start.push(this.sourceToken);return}if(this.indent>q.indent){let X=this.startBlockValue(q);if(X){this.stack.push(X);return}}yield*this.pop(),yield*this.step()}*flowCollection(q){let Z=q.items[q.items.length-1];if(this.type==="flow-error-end"){let X;do yield*this.pop(),X=this.peek(1);while(X?.type==="flow-collection")}else if(q.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!Z||Z.sep)q.items.push({start:[this.sourceToken]});else Z.start.push(this.sourceToken);return;case"map-value-ind":if(!Z||Z.value)q.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Z.sep)Z.sep.push(this.sourceToken);else Object.assign(Z,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!Z||Z.value)q.items.push({start:[this.sourceToken]});else if(Z.sep)Z.sep.push(this.sourceToken);else Z.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let J=this.flowScalar(this.type);if(!Z||Z.value)q.items.push({start:[],key:J,sep:[]});else if(Z.sep)this.stack.push(J);else Object.assign(Z,{key:J,sep:[]});return}case"flow-map-end":case"flow-seq-end":q.end.push(this.sourceToken);return}let X=this.startBlockValue(q);if(X)this.stack.push(X);else yield*this.pop(),yield*this.step()}else{let X=this.peek(2);if(X.type==="block-map"&&(this.type==="map-value-ind"&&X.indent===q.indent||this.type==="newline"&&!X.items[X.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&X.type!=="flow-collection"){let J=Lq(X),$=k1(J);Y5(q);let Q=q.end.splice(1,q.end.length);Q.push(this.sourceToken);let H={type:"block-map",offset:q.offset,indent:q.indent,items:[{start:$,key:q,sep:Q}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=H}else yield*this.lineEnd(q)}}flowScalar(q){if(this.onNewLine){let Z=this.source.indexOf(`
163
+ `,Z)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(q){let Z=q.items[q.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,Z.value){let X="end"in Z.value?Z.value.end:void 0;if((Array.isArray(X)?X[X.length-1]:void 0)?.type==="comment")X?.push(this.sourceToken);else q.items.push({start:[this.sourceToken]})}else if(Z.sep)Z.sep.push(this.sourceToken);else Z.start.push(this.sourceToken);return;case"space":case"comment":if(Z.value)q.items.push({start:[this.sourceToken]});else if(Z.sep)Z.sep.push(this.sourceToken);else{if(this.atIndentedComment(Z.start,q.indent)){let J=q.items[q.items.length-2]?.value?.end;if(Array.isArray(J)){Array.prototype.push.apply(J,Z.start),J.push(this.sourceToken),q.items.pop();return}}Z.start.push(this.sourceToken)}return}if(this.indent>=q.indent){let X=!this.onKeyLine&&this.indent===q.indent,J=X&&(Z.sep||Z.explicitKey)&&this.type!=="seq-item-ind",$=[];if(J&&Z.sep&&!Z.value){let Q=[];for(let H=0;H<Z.sep.length;++H){let z=Z.sep[H];switch(z.type){case"newline":Q.push(H);break;case"space":break;case"comment":if(z.indent>q.indent)Q.length=0;break;default:Q.length=0}}if(Q.length>=2)$=Z.sep.splice(Q[1])}switch(this.type){case"anchor":case"tag":if(J||Z.value)$.push(this.sourceToken),q.items.push({start:$}),this.onKeyLine=!0;else if(Z.sep)Z.sep.push(this.sourceToken);else Z.start.push(this.sourceToken);return;case"explicit-key-ind":if(!Z.sep&&!Z.explicitKey)Z.start.push(this.sourceToken),Z.explicitKey=!0;else if(J||Z.value)$.push(this.sourceToken),q.items.push({start:$,explicitKey:!0});else this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]});this.onKeyLine=!0;return;case"map-value-ind":if(Z.explicitKey)if(!Z.sep)if(U1(Z.start,"newline"))Object.assign(Z,{key:null,sep:[this.sourceToken]});else{let Q=k1(Z.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:Q,key:null,sep:[this.sourceToken]}]})}else if(Z.value)q.items.push({start:[],key:null,sep:[this.sourceToken]});else if(U1(Z.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:$,key:null,sep:[this.sourceToken]}]});else if(_5(Z.key)&&!U1(Z.sep,"newline")){let Q=k1(Z.start),H=Z.key,z=Z.sep;z.push(this.sourceToken),delete Z.key,delete Z.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:Q,key:H,sep:z}]})}else if($.length>0)Z.sep=Z.sep.concat($,this.sourceToken);else Z.sep.push(this.sourceToken);else if(!Z.sep)Object.assign(Z,{key:null,sep:[this.sourceToken]});else if(Z.value||J)q.items.push({start:$,key:null,sep:[this.sourceToken]});else if(U1(Z.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else Z.sep.push(this.sourceToken);this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let Q=this.flowScalar(this.type);if(J||Z.value)q.items.push({start:$,key:Q,sep:[]}),this.onKeyLine=!0;else if(Z.sep)this.stack.push(Q);else Object.assign(Z,{key:Q,sep:[]}),this.onKeyLine=!0;return}default:{let Q=this.startBlockValue(q);if(Q){if(Q.type==="block-seq"){if(!Z.explicitKey&&Z.sep&&!U1(Z.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else if(X)q.items.push({start:$});this.stack.push(Q);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(q){let Z=q.items[q.items.length-1];switch(this.type){case"newline":if(Z.value){let X="end"in Z.value?Z.value.end:void 0;if((Array.isArray(X)?X[X.length-1]:void 0)?.type==="comment")X?.push(this.sourceToken);else q.items.push({start:[this.sourceToken]})}else Z.start.push(this.sourceToken);return;case"space":case"comment":if(Z.value)q.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(Z.start,q.indent)){let J=q.items[q.items.length-2]?.value?.end;if(Array.isArray(J)){Array.prototype.push.apply(J,Z.start),J.push(this.sourceToken),q.items.pop();return}}Z.start.push(this.sourceToken)}return;case"anchor":case"tag":if(Z.value||this.indent<=q.indent)break;Z.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==q.indent)break;if(Z.value||U1(Z.start,"seq-item-ind"))q.items.push({start:[this.sourceToken]});else Z.start.push(this.sourceToken);return}if(this.indent>q.indent){let X=this.startBlockValue(q);if(X){this.stack.push(X);return}}yield*this.pop(),yield*this.step()}*flowCollection(q){let Z=q.items[q.items.length-1];if(this.type==="flow-error-end"){let X;do yield*this.pop(),X=this.peek(1);while(X?.type==="flow-collection")}else if(q.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!Z||Z.sep)q.items.push({start:[this.sourceToken]});else Z.start.push(this.sourceToken);return;case"map-value-ind":if(!Z||Z.value)q.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Z.sep)Z.sep.push(this.sourceToken);else Object.assign(Z,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!Z||Z.value)q.items.push({start:[this.sourceToken]});else if(Z.sep)Z.sep.push(this.sourceToken);else Z.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let J=this.flowScalar(this.type);if(!Z||Z.value)q.items.push({start:[],key:J,sep:[]});else if(Z.sep)this.stack.push(J);else Object.assign(Z,{key:J,sep:[]});return}case"flow-map-end":case"flow-seq-end":q.end.push(this.sourceToken);return}let X=this.startBlockValue(q);if(X)this.stack.push(X);else yield*this.pop(),yield*this.step()}else{let X=this.peek(2);if(X.type==="block-map"&&(this.type==="map-value-ind"&&X.indent===q.indent||this.type==="newline"&&!X.items[X.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&X.type!=="flow-collection"){let J=Wq(X),$=k1(J);T5(q);let Q=q.end.splice(1,q.end.length);Q.push(this.sourceToken);let H={type:"block-map",offset:q.offset,indent:q.indent,items:[{start:$,key:q,sep:Q}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=H}else yield*this.lineEnd(q)}}flowScalar(q){if(this.onNewLine){let Z=this.source.indexOf(`
164
164
  `)+1;while(Z!==0)this.onNewLine(this.offset+Z),Z=this.source.indexOf(`
165
- `,Z)+1}return{type:q,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(q){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let Z=Lq(q),X=k1(Z);return X.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:X,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let Z=Lq(q),X=k1(Z);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:X,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(q,Z){if(this.type!=="comment")return!1;if(this.indent<=Z)return!1;return q.every((X)=>X.type==="newline"||X.type==="space")}*documentEnd(q){if(this.type!=="doc-mode"){if(q.end)q.end.push(this.sourceToken);else q.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd(q){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:if(q.end)q.end.push(this.sourceToken);else q.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}jU.Parser=T5});var R5=P((gU)=>{var _5=s9(),CU=H0(),T0=U0(),fU=$9(),yU=S(),xU=$4(),L5=Q4();function W5(q){let Z=q.prettyErrors!==!1;return{lineCounter:q.lineCounter||Z&&new xU.LineCounter||null,prettyErrors:Z}}function kU(q,Z={}){let{lineCounter:X,prettyErrors:J}=W5(Z),$=new L5.Parser(X?.addNewLine),Q=new _5.Composer(Z),H=Array.from(Q.compose($.parse(q)));if(J&&X)for(let U of H)U.errors.forEach(T0.prettifyError(q,X)),U.warnings.forEach(T0.prettifyError(q,X));if(H.length>0)return H;return Object.assign([],{empty:!0},Q.streamInfo())}function V5(q,Z={}){let{lineCounter:X,prettyErrors:J}=W5(Z),$=new L5.Parser(X?.addNewLine),Q=new _5.Composer(Z),H=null;for(let U of Q.compose($.parse(q),!0,q.length))if(!H)H=U;else if(H.options.logLevel!=="silent"){H.errors.push(new T0.YAMLParseError(U.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(J&&X)H.errors.forEach(T0.prettifyError(q,X)),H.warnings.forEach(T0.prettifyError(q,X));return H}function vU(q,Z,X){let J=void 0;if(typeof Z==="function")J=Z;else if(X===void 0&&Z&&typeof Z==="object")X=Z;let $=V5(q,X);if(!$)return null;if($.warnings.forEach((Q)=>fU.warn($.options.logLevel,Q)),$.errors.length>0)if($.options.logLevel!=="silent")throw $.errors[0];else $.errors=[];return $.toJS(Object.assign({reviver:J},X))}function hU(q,Z,X){let J=null;if(typeof Z==="function"||Array.isArray(Z))J=Z;else if(X===void 0&&Z)X=Z;if(typeof X==="string")X=X.length;if(typeof X==="number"){let $=Math.round(X);X=$<1?void 0:$>8?{indent:8}:{indent:$}}if(q===void 0){let{keepUndefined:$}=X??Z??{};if(!$)return}if(yU.isDocument(q)&&!J)return q.toString(X);return new CU.Document(q,J,X).toString(X)}gU.parse=vU;gU.parseAllDocuments=kU;gU.parseDocument=V5;gU.stringify=hU});var Y4=P((QT,G4)=>{var Mq=process||{},D5=Mq.argv||[],Iq=Mq.env||{},Cz=!(!!Iq.NO_COLOR||D5.includes("--no-color"))&&(!!Iq.FORCE_COLOR||D5.includes("--color")||Mq.platform==="win32"||(Mq.stdout||{}).isTTY&&Iq.TERM!=="dumb"||!!Iq.CI),fz=(q,Z,X=q)=>(J)=>{let $=""+J,Q=$.indexOf(Z,q.length);return~Q?q+yz($,Z,X,Q)+Z:q+$+Z},yz=(q,Z,X,J)=>{let $="",Q=0;do $+=q.substring(Q,J)+X,Q=J+Z.length,J=q.indexOf(Z,Q);while(~J);return $+q.substring(Q)},P5=(q=Cz)=>{let Z=q?fz:()=>String;return{isColorSupported:q,reset:Z("\x1B[0m","\x1B[0m"),bold:Z("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:Z("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:Z("\x1B[3m","\x1B[23m"),underline:Z("\x1B[4m","\x1B[24m"),inverse:Z("\x1B[7m","\x1B[27m"),hidden:Z("\x1B[8m","\x1B[28m"),strikethrough:Z("\x1B[9m","\x1B[29m"),black:Z("\x1B[30m","\x1B[39m"),red:Z("\x1B[31m","\x1B[39m"),green:Z("\x1B[32m","\x1B[39m"),yellow:Z("\x1B[33m","\x1B[39m"),blue:Z("\x1B[34m","\x1B[39m"),magenta:Z("\x1B[35m","\x1B[39m"),cyan:Z("\x1B[36m","\x1B[39m"),white:Z("\x1B[37m","\x1B[39m"),gray:Z("\x1B[90m","\x1B[39m"),bgBlack:Z("\x1B[40m","\x1B[49m"),bgRed:Z("\x1B[41m","\x1B[49m"),bgGreen:Z("\x1B[42m","\x1B[49m"),bgYellow:Z("\x1B[43m","\x1B[49m"),bgBlue:Z("\x1B[44m","\x1B[49m"),bgMagenta:Z("\x1B[45m","\x1B[49m"),bgCyan:Z("\x1B[46m","\x1B[49m"),bgWhite:Z("\x1B[47m","\x1B[49m"),blackBright:Z("\x1B[90m","\x1B[39m"),redBright:Z("\x1B[91m","\x1B[39m"),greenBright:Z("\x1B[92m","\x1B[39m"),yellowBright:Z("\x1B[93m","\x1B[39m"),blueBright:Z("\x1B[94m","\x1B[39m"),magentaBright:Z("\x1B[95m","\x1B[39m"),cyanBright:Z("\x1B[96m","\x1B[39m"),whiteBright:Z("\x1B[97m","\x1B[39m"),bgBlackBright:Z("\x1B[100m","\x1B[49m"),bgRedBright:Z("\x1B[101m","\x1B[49m"),bgGreenBright:Z("\x1B[102m","\x1B[49m"),bgYellowBright:Z("\x1B[103m","\x1B[49m"),bgBlueBright:Z("\x1B[104m","\x1B[49m"),bgMagentaBright:Z("\x1B[105m","\x1B[49m"),bgCyanBright:Z("\x1B[106m","\x1B[49m"),bgWhiteBright:Z("\x1B[107m","\x1B[49m")}};G4.exports=P5();G4.exports.createColors=P5});var T4=P((HT,F5)=>{var B4={to(q,Z){if(!Z)return`\x1B[${q+1}G`;return`\x1B[${Z+1};${q+1}H`},move(q,Z){let X="";if(q<0)X+=`\x1B[${-q}D`;else if(q>0)X+=`\x1B[${q}C`;if(Z<0)X+=`\x1B[${-Z}A`;else if(Z>0)X+=`\x1B[${Z}B`;return X},up:(q=1)=>`\x1B[${q}A`,down:(q=1)=>`\x1B[${q}B`,forward:(q=1)=>`\x1B[${q}C`,backward:(q=1)=>`\x1B[${q}D`,nextLine:(q=1)=>"\x1B[E".repeat(q),prevLine:(q=1)=>"\x1B[F".repeat(q),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},xz={up:(q=1)=>"\x1B[S".repeat(q),down:(q=1)=>"\x1B[T".repeat(q)},kz={screen:"\x1B[2J",up:(q=1)=>"\x1B[1J".repeat(q),down:(q=1)=>"\x1B[J".repeat(q),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(q){let Z="";for(let X=0;X<q;X++)Z+=this.line+(X<q-1?B4.up():"");if(q)Z+=B4.left;return Z}};F5.exports={cursor:B4,scroll:xz,erase:kz,beep:"\x07"}});var J2=m1(X2(),1),{program:_Y,createCommand:LY,createArgument:WY,createOption:VY,CommanderError:RY,InvalidArgumentError:IY,InvalidOptionArgumentError:MY,Command:h,Argument:KY,Option:DY,Help:PY}=J2.default;import{join as L1}from"node:path";import{homedir as N7,platform as A7}from"node:os";import{mkdir as S7,stat as w7}from"node:fs/promises";import{spawn as b7}from"node:child_process";import{join as _1}from"node:path";import{homedir as K7,platform as D7}from"node:os";import{appendFileSync as Q2,mkdirSync as P7}from"node:fs";function H2(){let q=K7(),Z=D7();if(Z==="darwin")return _1(q,"Library","Logs","agentdeps");if(Z==="win32"){let $=process.env.LOCALAPPDATA??_1(q,"AppData","Local");return _1($,"agentdeps","logs")}let X=process.env.XDG_STATE_HOME;if(X)return _1(X,"agentdeps","logs");let J=process.env.XDG_CACHE_HOME;return _1(J??_1(q,".cache"),"agentdeps","logs")}function sq(){return _1(H2(),"agentdeps.log")}var A0=0,F7=0,$2=!1;function U2(){if($2)return!0;try{return P7(H2(),{recursive:!0}),$2=!0,!0}catch{return!1}}function O7(q){if(q instanceof Error)return q.stack??`${q.name}: ${q.message}`;if(typeof q==="object"&&q!==null)return JSON.stringify(q,null,2);return String(q)}function z2(){return new Date().toISOString()}function o(q,Z){if(!U2())return;let X=`[${z2()}] ERROR [${q}]
166
- ${O7(Z)}
165
+ `,Z)+1}return{type:q,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(q){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let Z=Wq(q),X=k1(Z);return X.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:X,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let Z=Wq(q),X=k1(Z);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:X,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(q,Z){if(this.type!=="comment")return!1;if(this.indent<=Z)return!1;return q.every((X)=>X.type==="newline"||X.type==="space")}*documentEnd(q){if(this.type!=="doc-mode"){if(q.end)q.end.push(this.sourceToken);else q.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd(q){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:if(q.end)q.end.push(this.sourceToken);else q.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}kz.Parser=W5});var M5=P((cz)=>{var L5=s9(),hz=H0(),T0=z0(),gz=$9(),uz=A(),mz=$4(),V5=Q4();function R5(q){let Z=q.prettyErrors!==!1;return{lineCounter:q.lineCounter||Z&&new mz.LineCounter||null,prettyErrors:Z}}function dz(q,Z={}){let{lineCounter:X,prettyErrors:J}=R5(Z),$=new V5.Parser(X?.addNewLine),Q=new L5.Composer(Z),H=Array.from(Q.compose($.parse(q)));if(J&&X)for(let z of H)z.errors.forEach(T0.prettifyError(q,X)),z.warnings.forEach(T0.prettifyError(q,X));if(H.length>0)return H;return Object.assign([],{empty:!0},Q.streamInfo())}function I5(q,Z={}){let{lineCounter:X,prettyErrors:J}=R5(Z),$=new V5.Parser(X?.addNewLine),Q=new L5.Composer(Z),H=null;for(let z of Q.compose($.parse(q),!0,q.length))if(!H)H=z;else if(H.options.logLevel!=="silent"){H.errors.push(new T0.YAMLParseError(z.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(J&&X)H.errors.forEach(T0.prettifyError(q,X)),H.warnings.forEach(T0.prettifyError(q,X));return H}function lz(q,Z,X){let J=void 0;if(typeof Z==="function")J=Z;else if(X===void 0&&Z&&typeof Z==="object")X=Z;let $=I5(q,X);if(!$)return null;if($.warnings.forEach((Q)=>gz.warn($.options.logLevel,Q)),$.errors.length>0)if($.options.logLevel!=="silent")throw $.errors[0];else $.errors=[];return $.toJS(Object.assign({reviver:J},X))}function pz(q,Z,X){let J=null;if(typeof Z==="function"||Array.isArray(Z))J=Z;else if(X===void 0&&Z)X=Z;if(typeof X==="string")X=X.length;if(typeof X==="number"){let $=Math.round(X);X=$<1?void 0:$>8?{indent:8}:{indent:$}}if(q===void 0){let{keepUndefined:$}=X??Z??{};if(!$)return}if(uz.isDocument(q)&&!J)return q.toString(X);return new hz.Document(q,J,X).toString(X)}cz.parse=lz;cz.parseAllDocuments=dz;cz.parseDocument=I5;cz.stringify=pz});var Y4=P((BT,G4)=>{var Mq=process||{},F5=Mq.argv||[],Iq=Mq.env||{},hU=!(!!Iq.NO_COLOR||F5.includes("--no-color"))&&(!!Iq.FORCE_COLOR||F5.includes("--color")||Mq.platform==="win32"||(Mq.stdout||{}).isTTY&&Iq.TERM!=="dumb"||!!Iq.CI),gU=(q,Z,X=q)=>(J)=>{let $=""+J,Q=$.indexOf(Z,q.length);return~Q?q+uU($,Z,X,Q)+Z:q+$+Z},uU=(q,Z,X,J)=>{let $="",Q=0;do $+=q.substring(Q,J)+X,Q=J+Z.length,J=q.indexOf(Z,Q);while(~J);return $+q.substring(Q)},O5=(q=hU)=>{let Z=q?gU:()=>String;return{isColorSupported:q,reset:Z("\x1B[0m","\x1B[0m"),bold:Z("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:Z("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:Z("\x1B[3m","\x1B[23m"),underline:Z("\x1B[4m","\x1B[24m"),inverse:Z("\x1B[7m","\x1B[27m"),hidden:Z("\x1B[8m","\x1B[28m"),strikethrough:Z("\x1B[9m","\x1B[29m"),black:Z("\x1B[30m","\x1B[39m"),red:Z("\x1B[31m","\x1B[39m"),green:Z("\x1B[32m","\x1B[39m"),yellow:Z("\x1B[33m","\x1B[39m"),blue:Z("\x1B[34m","\x1B[39m"),magenta:Z("\x1B[35m","\x1B[39m"),cyan:Z("\x1B[36m","\x1B[39m"),white:Z("\x1B[37m","\x1B[39m"),gray:Z("\x1B[90m","\x1B[39m"),bgBlack:Z("\x1B[40m","\x1B[49m"),bgRed:Z("\x1B[41m","\x1B[49m"),bgGreen:Z("\x1B[42m","\x1B[49m"),bgYellow:Z("\x1B[43m","\x1B[49m"),bgBlue:Z("\x1B[44m","\x1B[49m"),bgMagenta:Z("\x1B[45m","\x1B[49m"),bgCyan:Z("\x1B[46m","\x1B[49m"),bgWhite:Z("\x1B[47m","\x1B[49m"),blackBright:Z("\x1B[90m","\x1B[39m"),redBright:Z("\x1B[91m","\x1B[39m"),greenBright:Z("\x1B[92m","\x1B[39m"),yellowBright:Z("\x1B[93m","\x1B[39m"),blueBright:Z("\x1B[94m","\x1B[39m"),magentaBright:Z("\x1B[95m","\x1B[39m"),cyanBright:Z("\x1B[96m","\x1B[39m"),whiteBright:Z("\x1B[97m","\x1B[39m"),bgBlackBright:Z("\x1B[100m","\x1B[49m"),bgRedBright:Z("\x1B[101m","\x1B[49m"),bgGreenBright:Z("\x1B[102m","\x1B[49m"),bgYellowBright:Z("\x1B[103m","\x1B[49m"),bgBlueBright:Z("\x1B[104m","\x1B[49m"),bgMagentaBright:Z("\x1B[105m","\x1B[49m"),bgCyanBright:Z("\x1B[106m","\x1B[49m"),bgWhiteBright:Z("\x1B[107m","\x1B[49m")}};G4.exports=O5();G4.exports.createColors=O5});var T4=P((TT,N5)=>{var B4={to(q,Z){if(!Z)return`\x1B[${q+1}G`;return`\x1B[${Z+1};${q+1}H`},move(q,Z){let X="";if(q<0)X+=`\x1B[${-q}D`;else if(q>0)X+=`\x1B[${q}C`;if(Z<0)X+=`\x1B[${-Z}A`;else if(Z>0)X+=`\x1B[${Z}B`;return X},up:(q=1)=>`\x1B[${q}A`,down:(q=1)=>`\x1B[${q}B`,forward:(q=1)=>`\x1B[${q}C`,backward:(q=1)=>`\x1B[${q}D`,nextLine:(q=1)=>"\x1B[E".repeat(q),prevLine:(q=1)=>"\x1B[F".repeat(q),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},mU={up:(q=1)=>"\x1B[S".repeat(q),down:(q=1)=>"\x1B[T".repeat(q)},dU={screen:"\x1B[2J",up:(q=1)=>"\x1B[1J".repeat(q),down:(q=1)=>"\x1B[J".repeat(q),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(q){let Z="";for(let X=0;X<q;X++)Z+=this.line+(X<q-1?B4.up():"");if(q)Z+=B4.left;return Z}};N5.exports={cursor:B4,scroll:mU,erase:dU,beep:"\x07"}});var $2=m1(J2(),1),{program:MY,createCommand:KY,createArgument:DY,createOption:PY,CommanderError:FY,InvalidArgumentError:OY,InvalidOptionArgumentError:NY,Command:h,Argument:SY,Option:AY,Help:wY}=$2.default;import{join as W1}from"node:path";import{homedir as E7,platform as C7}from"node:os";import{mkdir as f7,rm as Y2,stat as y7}from"node:fs/promises";import{spawn as x7}from"node:child_process";import{join as _1}from"node:path";import{homedir as S7,platform as A7}from"node:os";import{appendFileSync as H2,mkdirSync as w7}from"node:fs";function z2(){let q=S7(),Z=A7();if(Z==="darwin")return _1(q,"Library","Logs","agentdeps");if(Z==="win32"){let $=process.env.LOCALAPPDATA??_1(q,"AppData","Local");return _1($,"agentdeps","logs")}let X=process.env.XDG_STATE_HOME;if(X)return _1(X,"agentdeps","logs");let J=process.env.XDG_CACHE_HOME;return _1(J??_1(q,".cache"),"agentdeps","logs")}function sq(){return _1(z2(),"agentdeps.log")}var S0=0,b7=0,Q2=!1;function U2(){if(Q2)return!0;try{return w7(z2(),{recursive:!0}),Q2=!0,!0}catch{return!1}}function j7(q){if(q instanceof Error)return q.stack??`${q.name}: ${q.message}`;if(typeof q==="object"&&q!==null)return JSON.stringify(q,null,2);return String(q)}function G2(){return new Date().toISOString()}function o(q,Z){if(!U2())return;let X=`[${G2()}] ERROR [${q}]
166
+ ${j7(Z)}
167
167
 
168
- `;try{Q2(sq(),X)}catch{}A0++}function rq(q,Z){if(!U2())return;let X=`[${z2()}] WARN [${q}] ${Z}
169
- `;try{Q2(sq(),X)}catch{}F7++}function S0(){if(A0===0)return;console.error(`
170
- ⚠ ${A0} error${A0===1?"":"s"} occurred. See log for details:
171
- ${sq()}`)}function G2(){let q=N7(),Z=A7();if(Z==="darwin")return L1(q,"Library","Caches","agentdeps","repos");if(Z==="win32"){let J=process.env.LOCALAPPDATA??L1(q,"AppData","Local");return L1(J,"agentdeps","repos")}let X=process.env.XDG_CACHE_HOME;return L1(X??L1(q,".cache"),"agentdeps","repos")}async function W1(q,Z){return new Promise((X)=>{let J=b7("git",q,{cwd:Z,stdio:["ignore","pipe","pipe"]}),$=[],Q=[];J.stdout.on("data",(H)=>$.push(H)),J.stderr.on("data",(H)=>Q.push(H)),J.on("close",(H)=>{X({success:H===0,stdout:Buffer.concat($).toString().trim(),stderr:Buffer.concat(Q).toString().trim()})}),J.on("error",()=>{X({success:!1,stdout:"",stderr:"Failed to spawn git process"})})})}async function Y2(){try{return(await W1(["--version"])).success}catch{return!1}}async function j7(q){try{return(await w7(q)).isDirectory()}catch{return!1}}async function E7(q,Z,X){let J=G2();await S7(J,{recursive:!0});let $=L1(J,X),Q=await W1(["clone","--branch",Z,"--single-branch",q,$]);if(!Q.success){if((await W1(["clone",q,$])).success){let U=await W1(["checkout",Z],$);if(!U.success)return{success:!1,path:$,error:U.stderr};return{success:!0,path:$}}return{success:!1,path:$,error:Q.stderr}}return{success:!0,path:$}}async function C7(q,Z){let X=await W1(["fetch","origin"],q);if(!X.success)return{success:!1,error:X.stderr};if((await W1(["reset","--hard",`origin/${Z}`],q)).success)return{success:!0};let $=await W1(["checkout",Z],q);if(!$.success)return{success:!1,error:$.stderr};return{success:!0}}async function w0(q,Z,X){let J=G2(),$=L1(J,X);if(await j7($)){let H=await C7($,Z);if(!H.success)o("cache.update",Error(`Failed to update ${X}: ${H.error}`)),console.warn(`⚠ Failed to update ${X} (using cached version)`);return{success:!0,path:$}}let Q=await E7(q,Z,X);if(!Q.success)o("cache.clone",Error(`Failed to clone ${q}: ${Q.error}`)),console.warn(`⚠ Failed to clone ${q}`);return Q}var pU=s9(),cU=H0(),iU=C9(),H4=U0(),aU=c1(),G1=S(),sU=$1(),rU=C(),nU=H1(),oU=U1(),oB=Tq(),tU=J4(),eU=$4(),qz=Q4(),Wq=R5(),I5=l1();var Zz=pU.Composer,Xz=cU.Document,Jz=iU.Schema,$z=H4.YAMLError,Qz=H4.YAMLParseError,Hz=H4.YAMLWarning,Uz=aU.Alias,zz=G1.isAlias,Gz=G1.isCollection,Yz=G1.isDocument,Bz=G1.isMap,Tz=G1.isNode,_z=G1.isPair,Lz=G1.isScalar,Wz=G1.isSeq,Vz=sU.Pair,Rz=rU.Scalar,Iz=nU.YAMLMap,Mz=oU.YAMLSeq;var Kz=tU.Lexer,Dz=eU.LineCounter,Pz=qz.Parser,_0=Wq.parse,Fz=Wq.parseAllDocuments,Oz=Wq.parseDocument,L0=Wq.stringify,Nz=I5.visit,Az=I5.visitAsync;import{mkdir as Sz,readFile as wz,writeFile as bz,access as M5}from"node:fs/promises";import{join as v1}from"node:path";import{homedir as jz,platform as Ez}from"node:os";function U4(){let q=jz();if(Ez()==="win32"){let J=process.env.APPDATA??v1(q,"AppData","Roaming");return v1(J,"agentdeps")}let X=process.env.XDG_CONFIG_HOME;return v1(X??v1(q,".config"),"agentdeps")}function Vq(){return v1(U4(),"config.yaml")}function h1(){return v1(U4(),"agents.yaml")}async function K5(){try{return await M5(Vq()),!0}catch{return!1}}async function z4(){let q=Vq();try{await M5(q)}catch{return}let Z=await wz(q,"utf-8"),X=_0(Z),J=X.clone_method??"ssh";if(J!=="ssh"&&J!=="https")throw Error(`Invalid clone_method: "${J}". Must be "ssh" or "https".`);let $=X.install_method??"link";if($!=="link"&&$!=="copy")throw Error(`Invalid install_method: "${$}". Must be "link" or "copy".`);let Q=X.agents??[];if(!Array.isArray(Q))throw Error(`Invalid agents: expected an array, got ${typeof Q}.`);return{clone_method:J,agents:Q,install_method:$,custom_agents:X.custom_agents}}async function Y1(){try{let q=await z4();if(!q)console.error("✗ No global config found. Run `agentdeps config` first."),process.exit(1);return q}catch(q){o("config",q);let Z=q instanceof Error?q.message:String(q);console.error(`✗ Invalid config at ${Vq()}: ${Z}`),console.error(" Run `agentdeps config` to fix it."),S0(),process.exit(1)}}async function Rq(q){let Z=U4();await Sz(Z,{recursive:!0});let X=L0(q,{lineWidth:0});await bz(Vq(),X,"utf-8")}var Oq=m1(Y4(),1);import{stdout as S5,stdin as vz}from"node:process";var m=m1(T4(),1);import hz from"node:readline";var gz=(q)=>q===161||q===164||q===167||q===168||q===170||q===173||q===174||q>=176&&q<=180||q>=182&&q<=186||q>=188&&q<=191||q===198||q===208||q===215||q===216||q>=222&&q<=225||q===230||q>=232&&q<=234||q===236||q===237||q===240||q===242||q===243||q>=247&&q<=250||q===252||q===254||q===257||q===273||q===275||q===283||q===294||q===295||q===299||q>=305&&q<=307||q===312||q>=319&&q<=322||q===324||q>=328&&q<=331||q===333||q===338||q===339||q===358||q===359||q===363||q===462||q===464||q===466||q===468||q===470||q===472||q===474||q===476||q===593||q===609||q===708||q===711||q>=713&&q<=715||q===717||q===720||q>=728&&q<=731||q===733||q===735||q>=768&&q<=879||q>=913&&q<=929||q>=931&&q<=937||q>=945&&q<=961||q>=963&&q<=969||q===1025||q>=1040&&q<=1103||q===1105||q===8208||q>=8211&&q<=8214||q===8216||q===8217||q===8220||q===8221||q>=8224&&q<=8226||q>=8228&&q<=8231||q===8240||q===8242||q===8243||q===8245||q===8251||q===8254||q===8308||q===8319||q>=8321&&q<=8324||q===8364||q===8451||q===8453||q===8457||q===8467||q===8470||q===8481||q===8482||q===8486||q===8491||q===8531||q===8532||q>=8539&&q<=8542||q>=8544&&q<=8555||q>=8560&&q<=8569||q===8585||q>=8592&&q<=8601||q===8632||q===8633||q===8658||q===8660||q===8679||q===8704||q===8706||q===8707||q===8711||q===8712||q===8715||q===8719||q===8721||q===8725||q===8730||q>=8733&&q<=8736||q===8739||q===8741||q>=8743&&q<=8748||q===8750||q>=8756&&q<=8759||q===8764||q===8765||q===8776||q===8780||q===8786||q===8800||q===8801||q>=8804&&q<=8807||q===8810||q===8811||q===8814||q===8815||q===8834||q===8835||q===8838||q===8839||q===8853||q===8857||q===8869||q===8895||q===8978||q>=9312&&q<=9449||q>=9451&&q<=9547||q>=9552&&q<=9587||q>=9600&&q<=9615||q>=9618&&q<=9621||q===9632||q===9633||q>=9635&&q<=9641||q===9650||q===9651||q===9654||q===9655||q===9660||q===9661||q===9664||q===9665||q>=9670&&q<=9672||q===9675||q>=9678&&q<=9681||q>=9698&&q<=9701||q===9711||q===9733||q===9734||q===9737||q===9742||q===9743||q===9756||q===9758||q===9792||q===9794||q===9824||q===9825||q>=9827&&q<=9829||q>=9831&&q<=9834||q===9836||q===9837||q===9839||q===9886||q===9887||q===9919||q>=9926&&q<=9933||q>=9935&&q<=9939||q>=9941&&q<=9953||q===9955||q===9960||q===9961||q>=9963&&q<=9969||q===9972||q>=9974&&q<=9977||q===9979||q===9980||q===9982||q===9983||q===10045||q>=10102&&q<=10111||q>=11094&&q<=11097||q>=12872&&q<=12879||q>=57344&&q<=63743||q>=65024&&q<=65039||q===65533||q>=127232&&q<=127242||q>=127248&&q<=127277||q>=127280&&q<=127337||q>=127344&&q<=127373||q===127375||q===127376||q>=127387&&q<=127404||q>=917760&&q<=917999||q>=983040&&q<=1048573||q>=1048576&&q<=1114109,uz=(q)=>q===12288||q>=65281&&q<=65376||q>=65504&&q<=65510,mz=(q)=>q>=4352&&q<=4447||q===8986||q===8987||q===9001||q===9002||q>=9193&&q<=9196||q===9200||q===9203||q===9725||q===9726||q===9748||q===9749||q>=9800&&q<=9811||q===9855||q===9875||q===9889||q===9898||q===9899||q===9917||q===9918||q===9924||q===9925||q===9934||q===9940||q===9962||q===9970||q===9971||q===9973||q===9978||q===9981||q===9989||q===9994||q===9995||q===10024||q===10060||q===10062||q>=10067&&q<=10069||q===10071||q>=10133&&q<=10135||q===10160||q===10175||q===11035||q===11036||q===11088||q===11093||q>=11904&&q<=11929||q>=11931&&q<=12019||q>=12032&&q<=12245||q>=12272&&q<=12287||q>=12289&&q<=12350||q>=12353&&q<=12438||q>=12441&&q<=12543||q>=12549&&q<=12591||q>=12593&&q<=12686||q>=12688&&q<=12771||q>=12783&&q<=12830||q>=12832&&q<=12871||q>=12880&&q<=19903||q>=19968&&q<=42124||q>=42128&&q<=42182||q>=43360&&q<=43388||q>=44032&&q<=55203||q>=63744&&q<=64255||q>=65040&&q<=65049||q>=65072&&q<=65106||q>=65108&&q<=65126||q>=65128&&q<=65131||q>=94176&&q<=94180||q===94192||q===94193||q>=94208&&q<=100343||q>=100352&&q<=101589||q>=101632&&q<=101640||q>=110576&&q<=110579||q>=110581&&q<=110587||q===110589||q===110590||q>=110592&&q<=110882||q===110898||q>=110928&&q<=110930||q===110933||q>=110948&&q<=110951||q>=110960&&q<=111355||q===126980||q===127183||q===127374||q>=127377&&q<=127386||q>=127488&&q<=127490||q>=127504&&q<=127547||q>=127552&&q<=127560||q===127568||q===127569||q>=127584&&q<=127589||q>=127744&&q<=127776||q>=127789&&q<=127797||q>=127799&&q<=127868||q>=127870&&q<=127891||q>=127904&&q<=127946||q>=127951&&q<=127955||q>=127968&&q<=127984||q===127988||q>=127992&&q<=128062||q===128064||q>=128066&&q<=128252||q>=128255&&q<=128317||q>=128331&&q<=128334||q>=128336&&q<=128359||q===128378||q===128405||q===128406||q===128420||q>=128507&&q<=128591||q>=128640&&q<=128709||q===128716||q>=128720&&q<=128722||q>=128725&&q<=128727||q>=128732&&q<=128735||q===128747||q===128748||q>=128756&&q<=128764||q>=128992&&q<=129003||q===129008||q>=129292&&q<=129338||q>=129340&&q<=129349||q>=129351&&q<=129535||q>=129648&&q<=129660||q>=129664&&q<=129672||q>=129680&&q<=129725||q>=129727&&q<=129733||q>=129742&&q<=129755||q>=129760&&q<=129768||q>=129776&&q<=129784||q>=131072&&q<=196605||q>=196608&&q<=262141,_4=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y,Kq=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,Dq=/\t{1,1000}/y,L4=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu,Pq=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,dz=/\p{M}+/gu,lz={limit:1/0,ellipsis:""},w5=(q,Z={},X={})=>{let J=Z.limit??1/0,$=Z.ellipsis??"",Q=Z?.ellipsisWidth??($?w5($,lz,X).width:0),H=X.ansiWidth??0,U=X.controlWidth??0,z=X.tabWidth??8,G=X.ambiguousWidth??1,T=X.emojiWidth??2,Y=X.fullWidthWidth??2,_=X.regularWidth??1,V=X.wideWidth??2,W=0,B=0,L=q.length,I=0,M=!1,D=L,O=Math.max(0,J-Q),N=0,A=0,K=0,R=0;q:for(;;){if(A>N||B>=L&&B>W){let w=q.slice(N,A)||q.slice(W,B);I=0;for(let y of w.replaceAll(dz,"")){let x=y.codePointAt(0)||0;if(uz(x)?R=Y:mz(x)?R=V:G!==_&&gz(x)?R=G:R=_,K+R>O&&(D=Math.min(D,Math.max(N,W)+I)),K+R>J){M=!0;break q}I+=y.length,K+=R}N=A=0}if(B>=L)break;if(Pq.lastIndex=B,Pq.test(q)){if(I=Pq.lastIndex-B,R=I*_,K+R>O&&(D=Math.min(D,B+Math.floor((O-K)/_))),K+R>J){M=!0;break}K+=R,N=W,A=B,B=W=Pq.lastIndex;continue}if(_4.lastIndex=B,_4.test(q)){if(K+H>O&&(D=Math.min(D,B)),K+H>J){M=!0;break}K+=H,N=W,A=B,B=W=_4.lastIndex;continue}if(Kq.lastIndex=B,Kq.test(q)){if(I=Kq.lastIndex-B,R=I*U,K+R>O&&(D=Math.min(D,B+Math.floor((O-K)/U))),K+R>J){M=!0;break}K+=R,N=W,A=B,B=W=Kq.lastIndex;continue}if(Dq.lastIndex=B,Dq.test(q)){if(I=Dq.lastIndex-B,R=I*z,K+R>O&&(D=Math.min(D,B+Math.floor((O-K)/z))),K+R>J){M=!0;break}K+=R,N=W,A=B,B=W=Dq.lastIndex;continue}if(L4.lastIndex=B,L4.test(q)){if(K+T>O&&(D=Math.min(D,B)),K+T>J){M=!0;break}K+=T,N=W,A=B,B=W=L4.lastIndex;continue}B+=1}return{width:M?O:K,index:M?D:L,truncated:M,ellipsed:M&&J>=Q}},pz={limit:1/0,ellipsis:"",ellipsisWidth:0},W0=(q,Z={})=>w5(q,pz,Z).width,Nq="\x1B",b5="›",cz=39,I4="\x07",j5="[",iz="]",E5="m",M4=`${iz}8;;`,O5=new RegExp(`(?:\\${j5}(?<code>\\d+)m|\\${M4}(?<uri>.*)${I4})`,"y"),az=(q)=>{if(q>=30&&q<=37||q>=90&&q<=97)return 39;if(q>=40&&q<=47||q>=100&&q<=107)return 49;if(q===1||q===2)return 22;if(q===3)return 23;if(q===4)return 24;if(q===7)return 27;if(q===8)return 28;if(q===9)return 29;if(q===0)return 0},N5=(q)=>`${Nq}${j5}${q}${E5}`,A5=(q)=>`${Nq}${M4}${q}${I4}`,sz=(q)=>q.map((Z)=>W0(Z)),W4=(q,Z,X)=>{let J=Z[Symbol.iterator](),$=!1,Q=!1,H=q.at(-1),U=H===void 0?0:W0(H),z=J.next(),G=J.next(),T=0;for(;!z.done;){let Y=z.value,_=W0(Y);U+_<=X?q[q.length-1]+=Y:(q.push(Y),U=0),(Y===Nq||Y===b5)&&($=!0,Q=Z.startsWith(M4,T+1)),$?Q?Y===I4&&($=!1,Q=!1):Y===E5&&($=!1):(U+=_,U===X&&!G.done&&(q.push(""),U=0)),z=G,G=J.next(),T+=Y.length}H=q.at(-1),!U&&H!==void 0&&H.length>0&&q.length>1&&(q[q.length-2]+=q.pop())},rz=(q)=>{let Z=q.split(" "),X=Z.length;for(;X>0&&!(W0(Z[X-1])>0);)X--;return X===Z.length?q:Z.slice(0,X).join(" ")+Z.slice(X).join("")},nz=(q,Z,X={})=>{if(X.trim!==!1&&q.trim()==="")return"";let J="",$,Q,H=q.split(" "),U=sz(H),z=[""];for(let[W,B]of H.entries()){X.trim!==!1&&(z[z.length-1]=(z.at(-1)??"").trimStart());let L=W0(z.at(-1)??"");if(W!==0&&(L>=Z&&(X.wordWrap===!1||X.trim===!1)&&(z.push(""),L=0),(L>0||X.trim===!1)&&(z[z.length-1]+=" ",L++)),X.hard&&U[W]>Z){let I=Z-L,M=1+Math.floor((U[W]-I-1)/Z);Math.floor((U[W]-1)/Z)<M&&z.push(""),W4(z,B,Z);continue}if(L+U[W]>Z&&L>0&&U[W]>0){if(X.wordWrap===!1&&L<Z){W4(z,B,Z);continue}z.push("")}if(L+U[W]>Z&&X.wordWrap===!1){W4(z,B,Z);continue}z[z.length-1]+=B}X.trim!==!1&&(z=z.map((W)=>rz(W)));let G=z.join(`
172
- `),T=G[Symbol.iterator](),Y=T.next(),_=T.next(),V=0;for(;!Y.done;){let W=Y.value,B=_.value;if(J+=W,W===Nq||W===b5){O5.lastIndex=V+1;let I=O5.exec(G)?.groups;if(I?.code!==void 0){let M=Number.parseFloat(I.code);$=M===cz?void 0:M}else I?.uri!==void 0&&(Q=I.uri.length===0?void 0:I.uri)}let L=$?az($):void 0;B===`
173
- `?(Q&&(J+=A5("")),$&&L&&(J+=N5(L))):W===`
174
- `&&($&&L&&(J+=N5($)),Q&&(J+=A5(Q))),V+=W.length,Y=_,_=T.next()}return J};function V4(q,Z,X){return String(q).normalize().replaceAll(`\r
168
+ `;try{H2(sq(),X)}catch{}S0++}function rq(q,Z){if(!U2())return;let X=`[${G2()}] WARN [${q}] ${Z}
169
+ `;try{H2(sq(),X)}catch{}b7++}function A0(){if(S0===0)return;console.error(`
170
+ ⚠ ${S0} error${S0===1?"":"s"} occurred. See log for details:
171
+ ${sq()}`)}function B2(){let q=E7(),Z=C7();if(Z==="darwin")return W1(q,"Library","Caches","agentdeps","repos");if(Z==="win32"){let J=process.env.LOCALAPPDATA??W1(q,"AppData","Local");return W1(J,"agentdeps","repos")}let X=process.env.XDG_CACHE_HOME;return W1(X??W1(q,".cache"),"agentdeps","repos")}async function L1(q,Z){return new Promise((X)=>{let J=x7("git",q,{cwd:Z,stdio:["ignore","pipe","pipe"]}),$=[],Q=[];J.stdout.on("data",(H)=>$.push(H)),J.stderr.on("data",(H)=>Q.push(H)),J.on("close",(H)=>{X({success:H===0,stdout:Buffer.concat($).toString().trim(),stderr:Buffer.concat(Q).toString().trim()})}),J.on("error",()=>{X({success:!1,stdout:"",stderr:"Failed to spawn git process"})})})}async function T2(){try{return(await L1(["--version"])).success}catch{return!1}}async function k7(q){try{return(await y7(q)).isDirectory()}catch{return!1}}async function v7(q,Z,X){let J=B2();await f7(J,{recursive:!0});let $=W1(J,X),Q=await L1(["clone","--branch",Z,"--single-branch",q,$]);if(!Q.success){if(await Y2($,{recursive:!0,force:!0}),(await L1(["clone",q,$])).success){let z=await L1(["checkout",Z],$);if(!z.success)return await Y2($,{recursive:!0,force:!0}),{success:!1,path:$,error:`ref '${Z}' not found: ${z.stderr}`};return{success:!0,path:$}}return{success:!1,path:$,error:Q.stderr}}return{success:!0,path:$}}async function h7(q,Z){let X=await L1(["fetch","origin"],q);if(!X.success)return{success:!1,error:X.stderr};if((await L1(["reset","--hard",`origin/${Z}`],q)).success)return{success:!0};let $=await L1(["checkout",Z],q);if(!$.success)return{success:!1,error:$.stderr};return{success:!0}}async function w0(q,Z,X){let J=B2(),$=W1(J,X);if(await k7($)){let H=await h7($,Z);if(!H.success)return o("cache.update",Error(`Failed to update ${X}: ${H.error}`)),{success:!1,path:$,error:`Failed to update ${X}: ${H.error}`};return{success:!0,path:$}}let Q=await v7(q,Z,X);if(!Q.success)o("cache.clone",Error(`Failed to clone ${q}: ${Q.error}`)),console.warn(`⚠ Failed to clone ${q}`);return Q}var nz=s9(),oz=H0(),tz=C9(),H4=z0(),ez=c1(),G1=A(),qU=$1(),ZU=C(),XU=H1(),JU=z1(),JT=Tq(),$U=J4(),QU=$4(),HU=Q4(),Lq=M5(),K5=l1();var zU=nz.Composer,UU=oz.Document,GU=tz.Schema,YU=H4.YAMLError,BU=H4.YAMLParseError,TU=H4.YAMLWarning,_U=ez.Alias,WU=G1.isAlias,LU=G1.isCollection,VU=G1.isDocument,RU=G1.isMap,IU=G1.isNode,MU=G1.isPair,KU=G1.isScalar,DU=G1.isSeq,PU=qU.Pair,FU=ZU.Scalar,OU=XU.YAMLMap,NU=JU.YAMLSeq;var SU=$U.Lexer,AU=QU.LineCounter,wU=HU.Parser,_0=Lq.parse,bU=Lq.parseAllDocuments,jU=Lq.parseDocument,W0=Lq.stringify,EU=K5.visit,CU=K5.visitAsync;import{mkdir as fU,readFile as yU,writeFile as xU,access as D5}from"node:fs/promises";import{join as v1}from"node:path";import{homedir as kU,platform as vU}from"node:os";function z4(){let q=kU();if(vU()==="win32"){let J=process.env.APPDATA??v1(q,"AppData","Roaming");return v1(J,"agentdeps")}let X=process.env.XDG_CONFIG_HOME;return v1(X??v1(q,".config"),"agentdeps")}function Vq(){return v1(z4(),"config.yaml")}function h1(){return v1(z4(),"agents.yaml")}async function P5(){try{return await D5(Vq()),!0}catch{return!1}}async function U4(){let q=Vq();try{await D5(q)}catch{return}let Z=await yU(q,"utf-8"),X=_0(Z),J=X.clone_method??"ssh";if(J!=="ssh"&&J!=="https")throw Error(`Invalid clone_method: "${J}". Must be "ssh" or "https".`);let $=X.install_method??"link";if($!=="link"&&$!=="copy")throw Error(`Invalid install_method: "${$}". Must be "link" or "copy".`);let Q=X.agents??[];if(!Array.isArray(Q))throw Error(`Invalid agents: expected an array, got ${typeof Q}.`);return{clone_method:J,agents:Q,install_method:$,custom_agents:X.custom_agents}}async function Y1(){try{let q=await U4();if(!q)console.error("✗ No global config found. Run `agentdeps config` first."),process.exit(1);return q}catch(q){o("config",q);let Z=q instanceof Error?q.message:String(q);console.error(`✗ Invalid config at ${Vq()}: ${Z}`),console.error(" Run `agentdeps config` to fix it."),A0(),process.exit(1)}}async function Rq(q){let Z=z4();await fU(Z,{recursive:!0});let X=W0(q,{lineWidth:0});await xU(Vq(),X,"utf-8")}var Oq=m1(Y4(),1);import{stdout as b5,stdin as lU}from"node:process";var m=m1(T4(),1);import pU from"node:readline";var cU=(q)=>q===161||q===164||q===167||q===168||q===170||q===173||q===174||q>=176&&q<=180||q>=182&&q<=186||q>=188&&q<=191||q===198||q===208||q===215||q===216||q>=222&&q<=225||q===230||q>=232&&q<=234||q===236||q===237||q===240||q===242||q===243||q>=247&&q<=250||q===252||q===254||q===257||q===273||q===275||q===283||q===294||q===295||q===299||q>=305&&q<=307||q===312||q>=319&&q<=322||q===324||q>=328&&q<=331||q===333||q===338||q===339||q===358||q===359||q===363||q===462||q===464||q===466||q===468||q===470||q===472||q===474||q===476||q===593||q===609||q===708||q===711||q>=713&&q<=715||q===717||q===720||q>=728&&q<=731||q===733||q===735||q>=768&&q<=879||q>=913&&q<=929||q>=931&&q<=937||q>=945&&q<=961||q>=963&&q<=969||q===1025||q>=1040&&q<=1103||q===1105||q===8208||q>=8211&&q<=8214||q===8216||q===8217||q===8220||q===8221||q>=8224&&q<=8226||q>=8228&&q<=8231||q===8240||q===8242||q===8243||q===8245||q===8251||q===8254||q===8308||q===8319||q>=8321&&q<=8324||q===8364||q===8451||q===8453||q===8457||q===8467||q===8470||q===8481||q===8482||q===8486||q===8491||q===8531||q===8532||q>=8539&&q<=8542||q>=8544&&q<=8555||q>=8560&&q<=8569||q===8585||q>=8592&&q<=8601||q===8632||q===8633||q===8658||q===8660||q===8679||q===8704||q===8706||q===8707||q===8711||q===8712||q===8715||q===8719||q===8721||q===8725||q===8730||q>=8733&&q<=8736||q===8739||q===8741||q>=8743&&q<=8748||q===8750||q>=8756&&q<=8759||q===8764||q===8765||q===8776||q===8780||q===8786||q===8800||q===8801||q>=8804&&q<=8807||q===8810||q===8811||q===8814||q===8815||q===8834||q===8835||q===8838||q===8839||q===8853||q===8857||q===8869||q===8895||q===8978||q>=9312&&q<=9449||q>=9451&&q<=9547||q>=9552&&q<=9587||q>=9600&&q<=9615||q>=9618&&q<=9621||q===9632||q===9633||q>=9635&&q<=9641||q===9650||q===9651||q===9654||q===9655||q===9660||q===9661||q===9664||q===9665||q>=9670&&q<=9672||q===9675||q>=9678&&q<=9681||q>=9698&&q<=9701||q===9711||q===9733||q===9734||q===9737||q===9742||q===9743||q===9756||q===9758||q===9792||q===9794||q===9824||q===9825||q>=9827&&q<=9829||q>=9831&&q<=9834||q===9836||q===9837||q===9839||q===9886||q===9887||q===9919||q>=9926&&q<=9933||q>=9935&&q<=9939||q>=9941&&q<=9953||q===9955||q===9960||q===9961||q>=9963&&q<=9969||q===9972||q>=9974&&q<=9977||q===9979||q===9980||q===9982||q===9983||q===10045||q>=10102&&q<=10111||q>=11094&&q<=11097||q>=12872&&q<=12879||q>=57344&&q<=63743||q>=65024&&q<=65039||q===65533||q>=127232&&q<=127242||q>=127248&&q<=127277||q>=127280&&q<=127337||q>=127344&&q<=127373||q===127375||q===127376||q>=127387&&q<=127404||q>=917760&&q<=917999||q>=983040&&q<=1048573||q>=1048576&&q<=1114109,iU=(q)=>q===12288||q>=65281&&q<=65376||q>=65504&&q<=65510,aU=(q)=>q>=4352&&q<=4447||q===8986||q===8987||q===9001||q===9002||q>=9193&&q<=9196||q===9200||q===9203||q===9725||q===9726||q===9748||q===9749||q>=9800&&q<=9811||q===9855||q===9875||q===9889||q===9898||q===9899||q===9917||q===9918||q===9924||q===9925||q===9934||q===9940||q===9962||q===9970||q===9971||q===9973||q===9978||q===9981||q===9989||q===9994||q===9995||q===10024||q===10060||q===10062||q>=10067&&q<=10069||q===10071||q>=10133&&q<=10135||q===10160||q===10175||q===11035||q===11036||q===11088||q===11093||q>=11904&&q<=11929||q>=11931&&q<=12019||q>=12032&&q<=12245||q>=12272&&q<=12287||q>=12289&&q<=12350||q>=12353&&q<=12438||q>=12441&&q<=12543||q>=12549&&q<=12591||q>=12593&&q<=12686||q>=12688&&q<=12771||q>=12783&&q<=12830||q>=12832&&q<=12871||q>=12880&&q<=19903||q>=19968&&q<=42124||q>=42128&&q<=42182||q>=43360&&q<=43388||q>=44032&&q<=55203||q>=63744&&q<=64255||q>=65040&&q<=65049||q>=65072&&q<=65106||q>=65108&&q<=65126||q>=65128&&q<=65131||q>=94176&&q<=94180||q===94192||q===94193||q>=94208&&q<=100343||q>=100352&&q<=101589||q>=101632&&q<=101640||q>=110576&&q<=110579||q>=110581&&q<=110587||q===110589||q===110590||q>=110592&&q<=110882||q===110898||q>=110928&&q<=110930||q===110933||q>=110948&&q<=110951||q>=110960&&q<=111355||q===126980||q===127183||q===127374||q>=127377&&q<=127386||q>=127488&&q<=127490||q>=127504&&q<=127547||q>=127552&&q<=127560||q===127568||q===127569||q>=127584&&q<=127589||q>=127744&&q<=127776||q>=127789&&q<=127797||q>=127799&&q<=127868||q>=127870&&q<=127891||q>=127904&&q<=127946||q>=127951&&q<=127955||q>=127968&&q<=127984||q===127988||q>=127992&&q<=128062||q===128064||q>=128066&&q<=128252||q>=128255&&q<=128317||q>=128331&&q<=128334||q>=128336&&q<=128359||q===128378||q===128405||q===128406||q===128420||q>=128507&&q<=128591||q>=128640&&q<=128709||q===128716||q>=128720&&q<=128722||q>=128725&&q<=128727||q>=128732&&q<=128735||q===128747||q===128748||q>=128756&&q<=128764||q>=128992&&q<=129003||q===129008||q>=129292&&q<=129338||q>=129340&&q<=129349||q>=129351&&q<=129535||q>=129648&&q<=129660||q>=129664&&q<=129672||q>=129680&&q<=129725||q>=129727&&q<=129733||q>=129742&&q<=129755||q>=129760&&q<=129768||q>=129776&&q<=129784||q>=131072&&q<=196605||q>=196608&&q<=262141,_4=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y,Kq=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,Dq=/\t{1,1000}/y,W4=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu,Pq=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,sU=/\p{M}+/gu,rU={limit:1/0,ellipsis:""},j5=(q,Z={},X={})=>{let J=Z.limit??1/0,$=Z.ellipsis??"",Q=Z?.ellipsisWidth??($?j5($,rU,X).width:0),H=X.ansiWidth??0,z=X.controlWidth??0,U=X.tabWidth??8,G=X.ambiguousWidth??1,T=X.emojiWidth??2,Y=X.fullWidthWidth??2,_=X.regularWidth??1,V=X.wideWidth??2,L=0,B=0,W=q.length,I=0,M=!1,D=W,O=Math.max(0,J-Q),N=0,S=0,K=0,R=0;q:for(;;){if(S>N||B>=W&&B>L){let w=q.slice(N,S)||q.slice(L,B);I=0;for(let y of w.replaceAll(sU,"")){let x=y.codePointAt(0)||0;if(iU(x)?R=Y:aU(x)?R=V:G!==_&&cU(x)?R=G:R=_,K+R>O&&(D=Math.min(D,Math.max(N,L)+I)),K+R>J){M=!0;break q}I+=y.length,K+=R}N=S=0}if(B>=W)break;if(Pq.lastIndex=B,Pq.test(q)){if(I=Pq.lastIndex-B,R=I*_,K+R>O&&(D=Math.min(D,B+Math.floor((O-K)/_))),K+R>J){M=!0;break}K+=R,N=L,S=B,B=L=Pq.lastIndex;continue}if(_4.lastIndex=B,_4.test(q)){if(K+H>O&&(D=Math.min(D,B)),K+H>J){M=!0;break}K+=H,N=L,S=B,B=L=_4.lastIndex;continue}if(Kq.lastIndex=B,Kq.test(q)){if(I=Kq.lastIndex-B,R=I*z,K+R>O&&(D=Math.min(D,B+Math.floor((O-K)/z))),K+R>J){M=!0;break}K+=R,N=L,S=B,B=L=Kq.lastIndex;continue}if(Dq.lastIndex=B,Dq.test(q)){if(I=Dq.lastIndex-B,R=I*U,K+R>O&&(D=Math.min(D,B+Math.floor((O-K)/U))),K+R>J){M=!0;break}K+=R,N=L,S=B,B=L=Dq.lastIndex;continue}if(W4.lastIndex=B,W4.test(q)){if(K+T>O&&(D=Math.min(D,B)),K+T>J){M=!0;break}K+=T,N=L,S=B,B=L=W4.lastIndex;continue}B+=1}return{width:M?O:K,index:M?D:W,truncated:M,ellipsed:M&&J>=Q}},nU={limit:1/0,ellipsis:"",ellipsisWidth:0},L0=(q,Z={})=>j5(q,nU,Z).width,Nq="\x1B",E5="›",oU=39,I4="\x07",C5="[",tU="]",f5="m",M4=`${tU}8;;`,S5=new RegExp(`(?:\\${C5}(?<code>\\d+)m|\\${M4}(?<uri>.*)${I4})`,"y"),eU=(q)=>{if(q>=30&&q<=37||q>=90&&q<=97)return 39;if(q>=40&&q<=47||q>=100&&q<=107)return 49;if(q===1||q===2)return 22;if(q===3)return 23;if(q===4)return 24;if(q===7)return 27;if(q===8)return 28;if(q===9)return 29;if(q===0)return 0},A5=(q)=>`${Nq}${C5}${q}${f5}`,w5=(q)=>`${Nq}${M4}${q}${I4}`,qG=(q)=>q.map((Z)=>L0(Z)),L4=(q,Z,X)=>{let J=Z[Symbol.iterator](),$=!1,Q=!1,H=q.at(-1),z=H===void 0?0:L0(H),U=J.next(),G=J.next(),T=0;for(;!U.done;){let Y=U.value,_=L0(Y);z+_<=X?q[q.length-1]+=Y:(q.push(Y),z=0),(Y===Nq||Y===E5)&&($=!0,Q=Z.startsWith(M4,T+1)),$?Q?Y===I4&&($=!1,Q=!1):Y===f5&&($=!1):(z+=_,z===X&&!G.done&&(q.push(""),z=0)),U=G,G=J.next(),T+=Y.length}H=q.at(-1),!z&&H!==void 0&&H.length>0&&q.length>1&&(q[q.length-2]+=q.pop())},ZG=(q)=>{let Z=q.split(" "),X=Z.length;for(;X>0&&!(L0(Z[X-1])>0);)X--;return X===Z.length?q:Z.slice(0,X).join(" ")+Z.slice(X).join("")},XG=(q,Z,X={})=>{if(X.trim!==!1&&q.trim()==="")return"";let J="",$,Q,H=q.split(" "),z=qG(H),U=[""];for(let[L,B]of H.entries()){X.trim!==!1&&(U[U.length-1]=(U.at(-1)??"").trimStart());let W=L0(U.at(-1)??"");if(L!==0&&(W>=Z&&(X.wordWrap===!1||X.trim===!1)&&(U.push(""),W=0),(W>0||X.trim===!1)&&(U[U.length-1]+=" ",W++)),X.hard&&z[L]>Z){let I=Z-W,M=1+Math.floor((z[L]-I-1)/Z);Math.floor((z[L]-1)/Z)<M&&U.push(""),L4(U,B,Z);continue}if(W+z[L]>Z&&W>0&&z[L]>0){if(X.wordWrap===!1&&W<Z){L4(U,B,Z);continue}U.push("")}if(W+z[L]>Z&&X.wordWrap===!1){L4(U,B,Z);continue}U[U.length-1]+=B}X.trim!==!1&&(U=U.map((L)=>ZG(L)));let G=U.join(`
172
+ `),T=G[Symbol.iterator](),Y=T.next(),_=T.next(),V=0;for(;!Y.done;){let L=Y.value,B=_.value;if(J+=L,L===Nq||L===E5){S5.lastIndex=V+1;let I=S5.exec(G)?.groups;if(I?.code!==void 0){let M=Number.parseFloat(I.code);$=M===oU?void 0:M}else I?.uri!==void 0&&(Q=I.uri.length===0?void 0:I.uri)}let W=$?eU($):void 0;B===`
173
+ `?(Q&&(J+=w5("")),$&&W&&(J+=A5(W))):L===`
174
+ `&&($&&W&&(J+=A5($)),Q&&(J+=w5(Q))),V+=L.length,Y=_,_=T.next()}return J};function V4(q,Z,X){return String(q).normalize().replaceAll(`\r
175
175
  `,`
176
176
  `).split(`
177
- `).map((J)=>nz(J,Z,X)).join(`
178
- `)}var oz=["up","down","left","right","space","enter","cancel"],F1={actions:new Set(oz),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]]),messages:{cancel:"Canceled",error:"Something went wrong"},withGuide:!0};function C5(q,Z){if(typeof q=="string")return F1.aliases.get(q)===Z;for(let X of q)if(X!==void 0&&C5(X,Z))return!0;return!1}function tz(q,Z){if(q===Z)return;let X=q.split(`
177
+ `).map((J)=>XG(J,Z,X)).join(`
178
+ `)}var JG=["up","down","left","right","space","enter","cancel"],F1={actions:new Set(JG),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]]),messages:{cancel:"Canceled",error:"Something went wrong"},withGuide:!0};function y5(q,Z){if(typeof q=="string")return F1.aliases.get(q)===Z;for(let X of q)if(X!==void 0&&y5(X,Z))return!0;return!1}function $G(q,Z){if(q===Z)return;let X=q.split(`
179
179
  `),J=Z.split(`
180
- `),$=Math.max(X.length,J.length),Q=[];for(let H=0;H<$;H++)X[H]!==J[H]&&Q.push(H);return{lines:Q,numLinesBefore:X.length,numLinesAfter:J.length,numLines:$}}var GT=globalThis.process.platform.startsWith("win"),R4=Symbol("clack:cancel");function q1(q){return q===R4}function Fq(q,Z){let X=q;X.isTTY&&X.setRawMode(Z)}var K4=(q)=>("columns"in q)&&typeof q.columns=="number"?q.columns:80,D4=(q)=>("rows"in q)&&typeof q.rows=="number"?q.rows:20;function N1(q,Z,X,J=X){let $=K4(q??S5);return V4(Z,$-X.length,{hard:!0,trim:!1}).split(`
180
+ `),$=Math.max(X.length,J.length),Q=[];for(let H=0;H<$;H++)X[H]!==J[H]&&Q.push(H);return{lines:Q,numLinesBefore:X.length,numLinesAfter:J.length,numLines:$}}var LT=globalThis.process.platform.startsWith("win"),R4=Symbol("clack:cancel");function q1(q){return q===R4}function Fq(q,Z){let X=q;X.isTTY&&X.setRawMode(Z)}var K4=(q)=>("columns"in q)&&typeof q.columns=="number"?q.columns:80,D4=(q)=>("rows"in q)&&typeof q.rows=="number"?q.rows:20;function N1(q,Z,X,J=X){let $=K4(q??b5);return V4(Z,$-X.length,{hard:!0,trim:!1}).split(`
181
181
  `).map((Q,H)=>`${H===0?J:X}${Q}`).join(`
182
- `)}class V0{input;output;_abortSignal;rl;opts;_render;_track=!1;_prevFrame="";_subscribers=new Map;_cursor=0;state="initial";error="";value;userInput="";constructor(q,Z=!0){let{input:X=vz,output:J=S5,render:$,signal:Q,...H}=q;this.opts=H,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=$.bind(this),this._track=Z,this._abortSignal=Q,this.input=X,this.output=J}unsubscribe(){this._subscribers.clear()}setSubscriber(q,Z){let X=this._subscribers.get(q)??[];X.push(Z),this._subscribers.set(q,X)}on(q,Z){this.setSubscriber(q,{cb:Z})}once(q,Z){this.setSubscriber(q,{cb:Z,once:!0})}emit(q,...Z){let X=this._subscribers.get(q)??[],J=[];for(let $ of X)$.cb(...Z),$.once&&J.push(()=>X.splice(X.indexOf($),1));for(let $ of J)$()}prompt(){return new Promise((q)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),q(R4);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}this.rl=hz.createInterface({input:this.input,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),this.rl.prompt(),this.opts.initialUserInput!==void 0&&this._setUserInput(this.opts.initialUserInput,!0),this.input.on("keypress",this.onKeypress),Fq(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(m.cursor.show),this.output.off("resize",this.render),Fq(this.input,!1),q(this.value)}),this.once("cancel",()=>{this.output.write(m.cursor.show),this.output.off("resize",this.render),Fq(this.input,!1),q(R4)})})}_isActionKey(q,Z){return q==="\t"}_setValue(q){this.value=q,this.emit("value",this.value)}_setUserInput(q,Z){this.userInput=q??"",this.emit("userInput",this.userInput),Z&&this._track&&this.rl&&(this.rl.write(this.userInput),this._cursor=this.rl.cursor)}_clearUserInput(){this.rl?.write(null,{ctrl:!0,name:"u"}),this._setUserInput("")}onKeypress(q,Z){if(this._track&&Z.name!=="return"&&(Z.name&&this._isActionKey(q,Z)&&this.rl?.write(null,{ctrl:!0,name:"h"}),this._cursor=this.rl?.cursor??0,this._setUserInput(this.rl?.line)),this.state==="error"&&(this.state="active"),Z?.name&&(!this._track&&F1.aliases.has(Z.name)&&this.emit("cursor",F1.aliases.get(Z.name)),F1.actions.has(Z.name)&&this.emit("cursor",Z.name)),q&&(q.toLowerCase()==="y"||q.toLowerCase()==="n")&&this.emit("confirm",q.toLowerCase()==="y"),this.emit("key",q?.toLowerCase(),Z),Z?.name==="return"){if(this.opts.validate){let X=this.opts.validate(this.value);X&&(this.error=X instanceof Error?X.message:X,this.state="error",this.rl?.write(this.userInput))}this.state!=="error"&&(this.state="submit")}C5([q,Z?.name,Z?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
182
+ `)}class V0{input;output;_abortSignal;rl;opts;_render;_track=!1;_prevFrame="";_subscribers=new Map;_cursor=0;state="initial";error="";value;userInput="";constructor(q,Z=!0){let{input:X=lU,output:J=b5,render:$,signal:Q,...H}=q;this.opts=H,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=$.bind(this),this._track=Z,this._abortSignal=Q,this.input=X,this.output=J}unsubscribe(){this._subscribers.clear()}setSubscriber(q,Z){let X=this._subscribers.get(q)??[];X.push(Z),this._subscribers.set(q,X)}on(q,Z){this.setSubscriber(q,{cb:Z})}once(q,Z){this.setSubscriber(q,{cb:Z,once:!0})}emit(q,...Z){let X=this._subscribers.get(q)??[],J=[];for(let $ of X)$.cb(...Z),$.once&&J.push(()=>X.splice(X.indexOf($),1));for(let $ of J)$()}prompt(){return new Promise((q)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),q(R4);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}this.rl=pU.createInterface({input:this.input,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),this.rl.prompt(),this.opts.initialUserInput!==void 0&&this._setUserInput(this.opts.initialUserInput,!0),this.input.on("keypress",this.onKeypress),Fq(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(m.cursor.show),this.output.off("resize",this.render),Fq(this.input,!1),q(this.value)}),this.once("cancel",()=>{this.output.write(m.cursor.show),this.output.off("resize",this.render),Fq(this.input,!1),q(R4)})})}_isActionKey(q,Z){return q==="\t"}_setValue(q){this.value=q,this.emit("value",this.value)}_setUserInput(q,Z){this.userInput=q??"",this.emit("userInput",this.userInput),Z&&this._track&&this.rl&&(this.rl.write(this.userInput),this._cursor=this.rl.cursor)}_clearUserInput(){this.rl?.write(null,{ctrl:!0,name:"u"}),this._setUserInput("")}onKeypress(q,Z){if(this._track&&Z.name!=="return"&&(Z.name&&this._isActionKey(q,Z)&&this.rl?.write(null,{ctrl:!0,name:"h"}),this._cursor=this.rl?.cursor??0,this._setUserInput(this.rl?.line)),this.state==="error"&&(this.state="active"),Z?.name&&(!this._track&&F1.aliases.has(Z.name)&&this.emit("cursor",F1.aliases.get(Z.name)),F1.actions.has(Z.name)&&this.emit("cursor",Z.name)),q&&(q.toLowerCase()==="y"||q.toLowerCase()==="n")&&this.emit("confirm",q.toLowerCase()==="y"),this.emit("key",q?.toLowerCase(),Z),Z?.name==="return"){if(this.opts.validate){let X=this.opts.validate(this.value);X&&(this.error=X instanceof Error?X.message:X,this.state="error",this.rl?.write(this.userInput))}this.state!=="error"&&(this.state="submit")}y5([q,Z?.name,Z?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
183
183
  `),Fq(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let q=V4(this._prevFrame,process.stdout.columns,{hard:!0,trim:!1}).split(`
184
- `).length-1;this.output.write(m.cursor.move(-999,q*-1))}render(){let q=V4(this._render(this)??"",process.stdout.columns,{hard:!0,trim:!1});if(q!==this._prevFrame){if(this.state==="initial")this.output.write(m.cursor.hide);else{let Z=tz(this._prevFrame,q),X=D4(this.output);if(this.restoreCursor(),Z){let J=Math.max(0,Z.numLinesAfter-X),$=Math.max(0,Z.numLinesBefore-X),Q=Z.lines.find((H)=>H>=J);if(Q===void 0){this._prevFrame=q;return}if(Z.lines.length===1){this.output.write(m.cursor.move(0,Q-$)),this.output.write(m.erase.lines(1));let H=q.split(`
185
- `);this.output.write(H[Q]),this._prevFrame=q,this.output.write(m.cursor.move(0,H.length-Q-1));return}else if(Z.lines.length>1){if(J<$)Q=J;else{let U=Q-$;U>0&&this.output.write(m.cursor.move(0,U))}this.output.write(m.erase.down());let H=q.split(`
184
+ `).length-1;this.output.write(m.cursor.move(-999,q*-1))}render(){let q=V4(this._render(this)??"",process.stdout.columns,{hard:!0,trim:!1});if(q!==this._prevFrame){if(this.state==="initial")this.output.write(m.cursor.hide);else{let Z=$G(this._prevFrame,q),X=D4(this.output);if(this.restoreCursor(),Z){let J=Math.max(0,Z.numLinesAfter-X),$=Math.max(0,Z.numLinesBefore-X),Q=Z.lines.find((H)=>H>=J);if(Q===void 0){this._prevFrame=q;return}if(Z.lines.length===1){this.output.write(m.cursor.move(0,Q-$)),this.output.write(m.erase.lines(1));let H=q.split(`
185
+ `);this.output.write(H[Q]),this._prevFrame=q,this.output.write(m.cursor.move(0,H.length-Q-1));return}else if(Z.lines.length>1){if(J<$)Q=J;else{let z=Q-$;z>0&&this.output.write(m.cursor.move(0,z))}this.output.write(m.erase.down());let H=q.split(`
186
186
  `).slice(Q);this.output.write(H.join(`
187
- `)),this._prevFrame=q;return}}this.output.write(m.erase.down())}this.output.write(q),this.state==="initial"&&(this.state="active"),this._prevFrame=q}}}function ez(q,Z){if(q===void 0||Z.length===0)return 0;let X=Z.findIndex((J)=>J.value===q);return X!==-1?X:0}function qG(q,Z){return(Z.label??String(Z.value)).toLowerCase().includes(q.toLowerCase())}function ZG(q,Z){if(Z)return q?Z:Z[0]}class f5 extends V0{filteredOptions;multiple;isNavigating=!1;selectedValues=[];focusedValue;#q=0;#X="";#J;#Z;get cursor(){return this.#q}get userInputWithCursor(){if(!this.userInput)return Oq.default.inverse(Oq.default.hidden("_"));if(this._cursor>=this.userInput.length)return`${this.userInput}█`;let q=this.userInput.slice(0,this._cursor),[Z,...X]=this.userInput.slice(this._cursor);return`${q}${Oq.default.inverse(Z)}${X.join("")}`}get options(){return typeof this.#Z=="function"?this.#Z():this.#Z}constructor(q){super(q),this.#Z=q.options;let Z=this.options;this.filteredOptions=[...Z],this.multiple=q.multiple===!0,this.#J=q.filter??qG;let X;if(q.initialValue&&Array.isArray(q.initialValue)?this.multiple?X=q.initialValue:X=q.initialValue.slice(0,1):!this.multiple&&this.options.length>0&&(X=[this.options[0].value]),X)for(let J of X){let $=Z.findIndex((Q)=>Q.value===J);$!==-1&&(this.toggleSelected(J),this.#q=$)}this.focusedValue=this.options[this.#q]?.value,this.on("key",(J,$)=>this.#$(J,$)),this.on("userInput",(J)=>this.#Q(J))}_isActionKey(q,Z){return q==="\t"||this.multiple&&this.isNavigating&&Z.name==="space"&&q!==void 0&&q!==""}#$(q,Z){let X=Z.name==="up",J=Z.name==="down",$=Z.name==="return";X||J?(this.#q=Math.max(0,Math.min(this.#q+(X?-1:1),this.filteredOptions.length-1)),this.focusedValue=this.filteredOptions[this.#q]?.value,this.multiple||(this.selectedValues=[this.focusedValue]),this.isNavigating=!0):$?this.value=ZG(this.multiple,this.selectedValues):this.multiple?this.focusedValue!==void 0&&(Z.name==="tab"||this.isNavigating&&Z.name==="space")?this.toggleSelected(this.focusedValue):this.isNavigating=!1:(this.focusedValue&&(this.selectedValues=[this.focusedValue]),this.isNavigating=!1)}deselectAll(){this.selectedValues=[]}toggleSelected(q){this.filteredOptions.length!==0&&(this.multiple?this.selectedValues.includes(q)?this.selectedValues=this.selectedValues.filter((Z)=>Z!==q):this.selectedValues=[...this.selectedValues,q]:this.selectedValues=[q])}#Q(q){if(q!==this.#X){this.#X=q;let Z=this.options;q?this.filteredOptions=Z.filter((X)=>this.#J(q,X)):this.filteredOptions=[...Z],this.#q=ez(this.focusedValue,this.filteredOptions),this.focusedValue=this.filteredOptions[this.#q]?.value,this.multiple||(this.focusedValue!==void 0?this.toggleSelected(this.focusedValue):this.deselectAll())}}}class y5 extends V0{options;cursor=0;#q;getGroupItems(q){return this.options.filter((Z)=>Z.group===q)}isGroupSelected(q){let Z=this.getGroupItems(q),X=this.value;return X===void 0?!1:Z.every((J)=>X.includes(J.value))}toggleValue(){let q=this.options[this.cursor];if(this.value===void 0&&(this.value=[]),q.group===!0){let Z=q.value,X=this.getGroupItems(Z);this.isGroupSelected(Z)?this.value=this.value.filter((J)=>X.findIndex(($)=>$.value===J)===-1):this.value=[...this.value,...X.map((J)=>J.value)],this.value=Array.from(new Set(this.value))}else{let Z=this.value.includes(q.value);this.value=Z?this.value.filter((X)=>X!==q.value):[...this.value,q.value]}}constructor(q){super(q,!1);let{options:Z}=q;this.#q=q.selectableGroups!==!1,this.options=Object.entries(Z).flatMap(([X,J])=>[{value:X,group:!0,label:X},...J.map(($)=>({...$,group:X}))]),this.value=[...q.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:X})=>X===q.cursorAt),this.#q?0:1),this.on("cursor",(X)=>{switch(X){case"left":case"up":{this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;let J=this.options[this.cursor]?.group===!0;!this.#q&&J&&(this.cursor=this.cursor===0?this.options.length-1:this.cursor-1);break}case"down":case"right":{this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;let J=this.options[this.cursor]?.group===!0;!this.#q&&J&&(this.cursor=this.cursor===this.options.length-1?0:this.cursor+1);break}case"space":this.toggleValue();break}})}}function O1(q,Z,X){let J=q+Z,$=Math.max(X.length-1,0),Q=J<0?$:J>$?0:J;return X[Q].disabled?O1(Q,Z<0?-1:1,X):Q}class P4 extends V0{options;cursor=0;get _value(){return this.options[this.cursor].value}get _enabledOptions(){return this.options.filter((q)=>q.disabled!==!0)}toggleAll(){let q=this._enabledOptions,Z=this.value!==void 0&&this.value.length===q.length;this.value=Z?[]:q.map((X)=>X.value)}toggleInvert(){let q=this.value;if(!q)return;let Z=this._enabledOptions.filter((X)=>!q.includes(X.value));this.value=Z.map((X)=>X.value)}toggleValue(){this.value===void 0&&(this.value=[]);let q=this.value.includes(this._value);this.value=q?this.value.filter((Z)=>Z!==this._value):[...this.value,this._value]}constructor(q){super(q,!1),this.options=q.options,this.value=[...q.initialValues??[]];let Z=Math.max(this.options.findIndex(({value:X})=>X===q.cursorAt),0);this.cursor=this.options[Z].disabled?O1(Z,1,this.options):Z,this.on("key",(X)=>{X==="a"&&this.toggleAll(),X==="i"&&this.toggleInvert()}),this.on("cursor",(X)=>{switch(X){case"left":case"up":this.cursor=O1(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=O1(this.cursor,1,this.options);break;case"space":this.toggleValue();break}})}}class F4 extends V0{options;cursor=0;get _selectedValue(){return this.options[this.cursor]}changeValue(){this.value=this._selectedValue.value}constructor(q){super(q,!1),this.options=q.options;let Z=this.options.findIndex(({value:J})=>J===q.initialValue),X=Z===-1?0:Z;this.cursor=this.options[X].disabled?O1(X,1,this.options):X,this.changeValue(),this.on("cursor",(J)=>{switch(J){case"left":case"up":this.cursor=O1(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=O1(this.cursor,1,this.options);break}this.changeValue()})}}var F=m1(Y4(),1);import p from"node:process";var m5=m1(T4(),1);function XG(){return p.platform!=="win32"?p.env.TERM!=="linux":!!p.env.CI||!!p.env.WT_SESSION||!!p.env.TERMINUS_SUBLIME||p.env.ConEmuTask==="{cmd::Cmder}"||p.env.TERM_PROGRAM==="Terminus-Sublime"||p.env.TERM_PROGRAM==="vscode"||p.env.TERM==="xterm-256color"||p.env.TERM==="alacritty"||p.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var JG=XG();var j=(q,Z)=>JG?q:Z,$G=j("◆","*"),QG=j("■","x"),HG=j("▲","x"),d5=j("◇","o"),UG=j("┌","T"),f=j("│","|"),I0=j("└","—"),MT=j("┐","T"),KT=j("┘","—"),zG=j("●",">"),x5=j("○"," "),GG=j("◻","[•]"),k5=j("◼","[+]"),v5=j("◻","[ ]"),DT=j("▪","•"),PT=j("─","-"),FT=j("╮","+"),OT=j("├","+"),NT=j("╯","+"),AT=j("╰","+"),ST=j("╭","+"),YG=j("●","•"),BG=j("◆","*"),TG=j("▲","!"),_G=j("■","x"),l5=(q)=>{switch(q){case"initial":case"active":return F.default.cyan($G);case"cancel":return F.default.red(QG);case"error":return F.default.yellow(HG);case"submit":return F.default.green(d5)}},p5=(q)=>{switch(q){case"initial":case"active":return F.default.cyan(f);case"cancel":return F.default.red(f);case"error":return F.default.yellow(f);case"submit":return F.default.green(f)}},LG=(q)=>q===161||q===164||q===167||q===168||q===170||q===173||q===174||q>=176&&q<=180||q>=182&&q<=186||q>=188&&q<=191||q===198||q===208||q===215||q===216||q>=222&&q<=225||q===230||q>=232&&q<=234||q===236||q===237||q===240||q===242||q===243||q>=247&&q<=250||q===252||q===254||q===257||q===273||q===275||q===283||q===294||q===295||q===299||q>=305&&q<=307||q===312||q>=319&&q<=322||q===324||q>=328&&q<=331||q===333||q===338||q===339||q===358||q===359||q===363||q===462||q===464||q===466||q===468||q===470||q===472||q===474||q===476||q===593||q===609||q===708||q===711||q>=713&&q<=715||q===717||q===720||q>=728&&q<=731||q===733||q===735||q>=768&&q<=879||q>=913&&q<=929||q>=931&&q<=937||q>=945&&q<=961||q>=963&&q<=969||q===1025||q>=1040&&q<=1103||q===1105||q===8208||q>=8211&&q<=8214||q===8216||q===8217||q===8220||q===8221||q>=8224&&q<=8226||q>=8228&&q<=8231||q===8240||q===8242||q===8243||q===8245||q===8251||q===8254||q===8308||q===8319||q>=8321&&q<=8324||q===8364||q===8451||q===8453||q===8457||q===8467||q===8470||q===8481||q===8482||q===8486||q===8491||q===8531||q===8532||q>=8539&&q<=8542||q>=8544&&q<=8555||q>=8560&&q<=8569||q===8585||q>=8592&&q<=8601||q===8632||q===8633||q===8658||q===8660||q===8679||q===8704||q===8706||q===8707||q===8711||q===8712||q===8715||q===8719||q===8721||q===8725||q===8730||q>=8733&&q<=8736||q===8739||q===8741||q>=8743&&q<=8748||q===8750||q>=8756&&q<=8759||q===8764||q===8765||q===8776||q===8780||q===8786||q===8800||q===8801||q>=8804&&q<=8807||q===8810||q===8811||q===8814||q===8815||q===8834||q===8835||q===8838||q===8839||q===8853||q===8857||q===8869||q===8895||q===8978||q>=9312&&q<=9449||q>=9451&&q<=9547||q>=9552&&q<=9587||q>=9600&&q<=9615||q>=9618&&q<=9621||q===9632||q===9633||q>=9635&&q<=9641||q===9650||q===9651||q===9654||q===9655||q===9660||q===9661||q===9664||q===9665||q>=9670&&q<=9672||q===9675||q>=9678&&q<=9681||q>=9698&&q<=9701||q===9711||q===9733||q===9734||q===9737||q===9742||q===9743||q===9756||q===9758||q===9792||q===9794||q===9824||q===9825||q>=9827&&q<=9829||q>=9831&&q<=9834||q===9836||q===9837||q===9839||q===9886||q===9887||q===9919||q>=9926&&q<=9933||q>=9935&&q<=9939||q>=9941&&q<=9953||q===9955||q===9960||q===9961||q>=9963&&q<=9969||q===9972||q>=9974&&q<=9977||q===9979||q===9980||q===9982||q===9983||q===10045||q>=10102&&q<=10111||q>=11094&&q<=11097||q>=12872&&q<=12879||q>=57344&&q<=63743||q>=65024&&q<=65039||q===65533||q>=127232&&q<=127242||q>=127248&&q<=127277||q>=127280&&q<=127337||q>=127344&&q<=127373||q===127375||q===127376||q>=127387&&q<=127404||q>=917760&&q<=917999||q>=983040&&q<=1048573||q>=1048576&&q<=1114109,WG=(q)=>q===12288||q>=65281&&q<=65376||q>=65504&&q<=65510,VG=(q)=>q>=4352&&q<=4447||q===8986||q===8987||q===9001||q===9002||q>=9193&&q<=9196||q===9200||q===9203||q===9725||q===9726||q===9748||q===9749||q>=9800&&q<=9811||q===9855||q===9875||q===9889||q===9898||q===9899||q===9917||q===9918||q===9924||q===9925||q===9934||q===9940||q===9962||q===9970||q===9971||q===9973||q===9978||q===9981||q===9989||q===9994||q===9995||q===10024||q===10060||q===10062||q>=10067&&q<=10069||q===10071||q>=10133&&q<=10135||q===10160||q===10175||q===11035||q===11036||q===11088||q===11093||q>=11904&&q<=11929||q>=11931&&q<=12019||q>=12032&&q<=12245||q>=12272&&q<=12287||q>=12289&&q<=12350||q>=12353&&q<=12438||q>=12441&&q<=12543||q>=12549&&q<=12591||q>=12593&&q<=12686||q>=12688&&q<=12771||q>=12783&&q<=12830||q>=12832&&q<=12871||q>=12880&&q<=19903||q>=19968&&q<=42124||q>=42128&&q<=42182||q>=43360&&q<=43388||q>=44032&&q<=55203||q>=63744&&q<=64255||q>=65040&&q<=65049||q>=65072&&q<=65106||q>=65108&&q<=65126||q>=65128&&q<=65131||q>=94176&&q<=94180||q===94192||q===94193||q>=94208&&q<=100343||q>=100352&&q<=101589||q>=101632&&q<=101640||q>=110576&&q<=110579||q>=110581&&q<=110587||q===110589||q===110590||q>=110592&&q<=110882||q===110898||q>=110928&&q<=110930||q===110933||q>=110948&&q<=110951||q>=110960&&q<=111355||q===126980||q===127183||q===127374||q>=127377&&q<=127386||q>=127488&&q<=127490||q>=127504&&q<=127547||q>=127552&&q<=127560||q===127568||q===127569||q>=127584&&q<=127589||q>=127744&&q<=127776||q>=127789&&q<=127797||q>=127799&&q<=127868||q>=127870&&q<=127891||q>=127904&&q<=127946||q>=127951&&q<=127955||q>=127968&&q<=127984||q===127988||q>=127992&&q<=128062||q===128064||q>=128066&&q<=128252||q>=128255&&q<=128317||q>=128331&&q<=128334||q>=128336&&q<=128359||q===128378||q===128405||q===128406||q===128420||q>=128507&&q<=128591||q>=128640&&q<=128709||q===128716||q>=128720&&q<=128722||q>=128725&&q<=128727||q>=128732&&q<=128735||q===128747||q===128748||q>=128756&&q<=128764||q>=128992&&q<=129003||q===129008||q>=129292&&q<=129338||q>=129340&&q<=129349||q>=129351&&q<=129535||q>=129648&&q<=129660||q>=129664&&q<=129672||q>=129680&&q<=129725||q>=129727&&q<=129733||q>=129742&&q<=129755||q>=129760&&q<=129768||q>=129776&&q<=129784||q>=131072&&q<=196605||q>=196608&&q<=262141,O4=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y,Aq=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,Sq=/\t{1,1000}/y,N4=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu,wq=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,RG=/\p{M}+/gu,IG={limit:1/0,ellipsis:""},c5=(q,Z={},X={})=>{let J=Z.limit??1/0,$=Z.ellipsis??"",Q=Z?.ellipsisWidth??($?c5($,IG,X).width:0),H=X.ansiWidth??0,U=X.controlWidth??0,z=X.tabWidth??8,G=X.ambiguousWidth??1,T=X.emojiWidth??2,Y=X.fullWidthWidth??2,_=X.regularWidth??1,V=X.wideWidth??2,W=0,B=0,L=q.length,I=0,M=!1,D=L,O=Math.max(0,J-Q),N=0,A=0,K=0,R=0;q:for(;;){if(A>N||B>=L&&B>W){let w=q.slice(N,A)||q.slice(W,B);I=0;for(let y of w.replaceAll(RG,"")){let x=y.codePointAt(0)||0;if(WG(x)?R=Y:VG(x)?R=V:G!==_&&LG(x)?R=G:R=_,K+R>O&&(D=Math.min(D,Math.max(N,W)+I)),K+R>J){M=!0;break q}I+=y.length,K+=R}N=A=0}if(B>=L)break;if(wq.lastIndex=B,wq.test(q)){if(I=wq.lastIndex-B,R=I*_,K+R>O&&(D=Math.min(D,B+Math.floor((O-K)/_))),K+R>J){M=!0;break}K+=R,N=W,A=B,B=W=wq.lastIndex;continue}if(O4.lastIndex=B,O4.test(q)){if(K+H>O&&(D=Math.min(D,B)),K+H>J){M=!0;break}K+=H,N=W,A=B,B=W=O4.lastIndex;continue}if(Aq.lastIndex=B,Aq.test(q)){if(I=Aq.lastIndex-B,R=I*U,K+R>O&&(D=Math.min(D,B+Math.floor((O-K)/U))),K+R>J){M=!0;break}K+=R,N=W,A=B,B=W=Aq.lastIndex;continue}if(Sq.lastIndex=B,Sq.test(q)){if(I=Sq.lastIndex-B,R=I*z,K+R>O&&(D=Math.min(D,B+Math.floor((O-K)/z))),K+R>J){M=!0;break}K+=R,N=W,A=B,B=W=Sq.lastIndex;continue}if(N4.lastIndex=B,N4.test(q)){if(K+T>O&&(D=Math.min(D,B)),K+T>J){M=!0;break}K+=T,N=W,A=B,B=W=N4.lastIndex;continue}B+=1}return{width:M?O:K,index:M?D:L,truncated:M,ellipsed:M&&J>=Q}},MG={limit:1/0,ellipsis:"",ellipsisWidth:0},M0=(q,Z={})=>c5(q,MG,Z).width,jq="\x1B",i5="›",KG=39,w4="\x07",a5="[",DG="]",s5="m",b4=`${DG}8;;`,h5=new RegExp(`(?:\\${a5}(?<code>\\d+)m|\\${b4}(?<uri>.*)${w4})`,"y"),PG=(q)=>{if(q>=30&&q<=37||q>=90&&q<=97)return 39;if(q>=40&&q<=47||q>=100&&q<=107)return 49;if(q===1||q===2)return 22;if(q===3)return 23;if(q===4)return 24;if(q===7)return 27;if(q===8)return 28;if(q===9)return 29;if(q===0)return 0},g5=(q)=>`${jq}${a5}${q}${s5}`,u5=(q)=>`${jq}${b4}${q}${w4}`,FG=(q)=>q.map((Z)=>M0(Z)),A4=(q,Z,X)=>{let J=Z[Symbol.iterator](),$=!1,Q=!1,H=q.at(-1),U=H===void 0?0:M0(H),z=J.next(),G=J.next(),T=0;for(;!z.done;){let Y=z.value,_=M0(Y);U+_<=X?q[q.length-1]+=Y:(q.push(Y),U=0),(Y===jq||Y===i5)&&($=!0,Q=Z.startsWith(b4,T+1)),$?Q?Y===w4&&($=!1,Q=!1):Y===s5&&($=!1):(U+=_,U===X&&!G.done&&(q.push(""),U=0)),z=G,G=J.next(),T+=Y.length}H=q.at(-1),!U&&H!==void 0&&H.length>0&&q.length>1&&(q[q.length-2]+=q.pop())},OG=(q)=>{let Z=q.split(" "),X=Z.length;for(;X>0&&!(M0(Z[X-1])>0);)X--;return X===Z.length?q:Z.slice(0,X).join(" ")+Z.slice(X).join("")},NG=(q,Z,X={})=>{if(X.trim!==!1&&q.trim()==="")return"";let J="",$,Q,H=q.split(" "),U=FG(H),z=[""];for(let[W,B]of H.entries()){X.trim!==!1&&(z[z.length-1]=(z.at(-1)??"").trimStart());let L=M0(z.at(-1)??"");if(W!==0&&(L>=Z&&(X.wordWrap===!1||X.trim===!1)&&(z.push(""),L=0),(L>0||X.trim===!1)&&(z[z.length-1]+=" ",L++)),X.hard&&U[W]>Z){let I=Z-L,M=1+Math.floor((U[W]-I-1)/Z);Math.floor((U[W]-1)/Z)<M&&z.push(""),A4(z,B,Z);continue}if(L+U[W]>Z&&L>0&&U[W]>0){if(X.wordWrap===!1&&L<Z){A4(z,B,Z);continue}z.push("")}if(L+U[W]>Z&&X.wordWrap===!1){A4(z,B,Z);continue}z[z.length-1]+=B}X.trim!==!1&&(z=z.map((W)=>OG(W)));let G=z.join(`
188
- `),T=G[Symbol.iterator](),Y=T.next(),_=T.next(),V=0;for(;!Y.done;){let W=Y.value,B=_.value;if(J+=W,W===jq||W===i5){h5.lastIndex=V+1;let I=h5.exec(G)?.groups;if(I?.code!==void 0){let M=Number.parseFloat(I.code);$=M===KG?void 0:M}else I?.uri!==void 0&&(Q=I.uri.length===0?void 0:I.uri)}let L=$?PG($):void 0;B===`
189
- `?(Q&&(J+=u5("")),$&&L&&(J+=g5(L))):W===`
190
- `&&($&&L&&(J+=g5($)),Q&&(J+=u5(Q))),V+=W.length,Y=_,_=T.next()}return J};function AG(q,Z,X){return String(q).normalize().replaceAll(`\r
187
+ `)),this._prevFrame=q;return}}this.output.write(m.erase.down())}this.output.write(q),this.state==="initial"&&(this.state="active"),this._prevFrame=q}}}function QG(q,Z){if(q===void 0||Z.length===0)return 0;let X=Z.findIndex((J)=>J.value===q);return X!==-1?X:0}function HG(q,Z){return(Z.label??String(Z.value)).toLowerCase().includes(q.toLowerCase())}function zG(q,Z){if(Z)return q?Z:Z[0]}class x5 extends V0{filteredOptions;multiple;isNavigating=!1;selectedValues=[];focusedValue;#q=0;#X="";#J;#Z;get cursor(){return this.#q}get userInputWithCursor(){if(!this.userInput)return Oq.default.inverse(Oq.default.hidden("_"));if(this._cursor>=this.userInput.length)return`${this.userInput}█`;let q=this.userInput.slice(0,this._cursor),[Z,...X]=this.userInput.slice(this._cursor);return`${q}${Oq.default.inverse(Z)}${X.join("")}`}get options(){return typeof this.#Z=="function"?this.#Z():this.#Z}constructor(q){super(q),this.#Z=q.options;let Z=this.options;this.filteredOptions=[...Z],this.multiple=q.multiple===!0,this.#J=q.filter??HG;let X;if(q.initialValue&&Array.isArray(q.initialValue)?this.multiple?X=q.initialValue:X=q.initialValue.slice(0,1):!this.multiple&&this.options.length>0&&(X=[this.options[0].value]),X)for(let J of X){let $=Z.findIndex((Q)=>Q.value===J);$!==-1&&(this.toggleSelected(J),this.#q=$)}this.focusedValue=this.options[this.#q]?.value,this.on("key",(J,$)=>this.#$(J,$)),this.on("userInput",(J)=>this.#Q(J))}_isActionKey(q,Z){return q==="\t"||this.multiple&&this.isNavigating&&Z.name==="space"&&q!==void 0&&q!==""}#$(q,Z){let X=Z.name==="up",J=Z.name==="down",$=Z.name==="return";X||J?(this.#q=Math.max(0,Math.min(this.#q+(X?-1:1),this.filteredOptions.length-1)),this.focusedValue=this.filteredOptions[this.#q]?.value,this.multiple||(this.selectedValues=[this.focusedValue]),this.isNavigating=!0):$?this.value=zG(this.multiple,this.selectedValues):this.multiple?this.focusedValue!==void 0&&(Z.name==="tab"||this.isNavigating&&Z.name==="space")?this.toggleSelected(this.focusedValue):this.isNavigating=!1:(this.focusedValue&&(this.selectedValues=[this.focusedValue]),this.isNavigating=!1)}deselectAll(){this.selectedValues=[]}toggleSelected(q){this.filteredOptions.length!==0&&(this.multiple?this.selectedValues.includes(q)?this.selectedValues=this.selectedValues.filter((Z)=>Z!==q):this.selectedValues=[...this.selectedValues,q]:this.selectedValues=[q])}#Q(q){if(q!==this.#X){this.#X=q;let Z=this.options;q?this.filteredOptions=Z.filter((X)=>this.#J(q,X)):this.filteredOptions=[...Z],this.#q=QG(this.focusedValue,this.filteredOptions),this.focusedValue=this.filteredOptions[this.#q]?.value,this.multiple||(this.focusedValue!==void 0?this.toggleSelected(this.focusedValue):this.deselectAll())}}}class k5 extends V0{options;cursor=0;#q;getGroupItems(q){return this.options.filter((Z)=>Z.group===q)}isGroupSelected(q){let Z=this.getGroupItems(q),X=this.value;return X===void 0?!1:Z.every((J)=>X.includes(J.value))}toggleValue(){let q=this.options[this.cursor];if(this.value===void 0&&(this.value=[]),q.group===!0){let Z=q.value,X=this.getGroupItems(Z);this.isGroupSelected(Z)?this.value=this.value.filter((J)=>X.findIndex(($)=>$.value===J)===-1):this.value=[...this.value,...X.map((J)=>J.value)],this.value=Array.from(new Set(this.value))}else{let Z=this.value.includes(q.value);this.value=Z?this.value.filter((X)=>X!==q.value):[...this.value,q.value]}}constructor(q){super(q,!1);let{options:Z}=q;this.#q=q.selectableGroups!==!1,this.options=Object.entries(Z).flatMap(([X,J])=>[{value:X,group:!0,label:X},...J.map(($)=>({...$,group:X}))]),this.value=[...q.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:X})=>X===q.cursorAt),this.#q?0:1),this.on("cursor",(X)=>{switch(X){case"left":case"up":{this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;let J=this.options[this.cursor]?.group===!0;!this.#q&&J&&(this.cursor=this.cursor===0?this.options.length-1:this.cursor-1);break}case"down":case"right":{this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;let J=this.options[this.cursor]?.group===!0;!this.#q&&J&&(this.cursor=this.cursor===this.options.length-1?0:this.cursor+1);break}case"space":this.toggleValue();break}})}}function O1(q,Z,X){let J=q+Z,$=Math.max(X.length-1,0),Q=J<0?$:J>$?0:J;return X[Q].disabled?O1(Q,Z<0?-1:1,X):Q}class P4 extends V0{options;cursor=0;get _value(){return this.options[this.cursor].value}get _enabledOptions(){return this.options.filter((q)=>q.disabled!==!0)}toggleAll(){let q=this._enabledOptions,Z=this.value!==void 0&&this.value.length===q.length;this.value=Z?[]:q.map((X)=>X.value)}toggleInvert(){let q=this.value;if(!q)return;let Z=this._enabledOptions.filter((X)=>!q.includes(X.value));this.value=Z.map((X)=>X.value)}toggleValue(){this.value===void 0&&(this.value=[]);let q=this.value.includes(this._value);this.value=q?this.value.filter((Z)=>Z!==this._value):[...this.value,this._value]}constructor(q){super(q,!1),this.options=q.options,this.value=[...q.initialValues??[]];let Z=Math.max(this.options.findIndex(({value:X})=>X===q.cursorAt),0);this.cursor=this.options[Z].disabled?O1(Z,1,this.options):Z,this.on("key",(X)=>{X==="a"&&this.toggleAll(),X==="i"&&this.toggleInvert()}),this.on("cursor",(X)=>{switch(X){case"left":case"up":this.cursor=O1(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=O1(this.cursor,1,this.options);break;case"space":this.toggleValue();break}})}}class F4 extends V0{options;cursor=0;get _selectedValue(){return this.options[this.cursor]}changeValue(){this.value=this._selectedValue.value}constructor(q){super(q,!1),this.options=q.options;let Z=this.options.findIndex(({value:J})=>J===q.initialValue),X=Z===-1?0:Z;this.cursor=this.options[X].disabled?O1(X,1,this.options):X,this.changeValue(),this.on("cursor",(J)=>{switch(J){case"left":case"up":this.cursor=O1(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=O1(this.cursor,1,this.options);break}this.changeValue()})}}var F=m1(Y4(),1);import p from"node:process";var l5=m1(T4(),1);function UG(){return p.platform!=="win32"?p.env.TERM!=="linux":!!p.env.CI||!!p.env.WT_SESSION||!!p.env.TERMINUS_SUBLIME||p.env.ConEmuTask==="{cmd::Cmder}"||p.env.TERM_PROGRAM==="Terminus-Sublime"||p.env.TERM_PROGRAM==="vscode"||p.env.TERM==="xterm-256color"||p.env.TERM==="alacritty"||p.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var GG=UG();var j=(q,Z)=>GG?q:Z,YG=j("◆","*"),BG=j("■","x"),TG=j("▲","x"),p5=j("◇","o"),_G=j("┌","T"),f=j("│","|"),I0=j("└","—"),NT=j("┐","T"),ST=j("┘","—"),WG=j("●",">"),v5=j("○"," "),LG=j("◻","[•]"),h5=j("◼","[+]"),g5=j("◻","[ ]"),AT=j("▪","•"),wT=j("─","-"),bT=j("╮","+"),jT=j("├","+"),ET=j("╯","+"),CT=j("╰","+"),fT=j("╭","+"),VG=j("●","•"),RG=j("◆","*"),IG=j("▲","!"),MG=j("■","x"),c5=(q)=>{switch(q){case"initial":case"active":return F.default.cyan(YG);case"cancel":return F.default.red(BG);case"error":return F.default.yellow(TG);case"submit":return F.default.green(p5)}},i5=(q)=>{switch(q){case"initial":case"active":return F.default.cyan(f);case"cancel":return F.default.red(f);case"error":return F.default.yellow(f);case"submit":return F.default.green(f)}},KG=(q)=>q===161||q===164||q===167||q===168||q===170||q===173||q===174||q>=176&&q<=180||q>=182&&q<=186||q>=188&&q<=191||q===198||q===208||q===215||q===216||q>=222&&q<=225||q===230||q>=232&&q<=234||q===236||q===237||q===240||q===242||q===243||q>=247&&q<=250||q===252||q===254||q===257||q===273||q===275||q===283||q===294||q===295||q===299||q>=305&&q<=307||q===312||q>=319&&q<=322||q===324||q>=328&&q<=331||q===333||q===338||q===339||q===358||q===359||q===363||q===462||q===464||q===466||q===468||q===470||q===472||q===474||q===476||q===593||q===609||q===708||q===711||q>=713&&q<=715||q===717||q===720||q>=728&&q<=731||q===733||q===735||q>=768&&q<=879||q>=913&&q<=929||q>=931&&q<=937||q>=945&&q<=961||q>=963&&q<=969||q===1025||q>=1040&&q<=1103||q===1105||q===8208||q>=8211&&q<=8214||q===8216||q===8217||q===8220||q===8221||q>=8224&&q<=8226||q>=8228&&q<=8231||q===8240||q===8242||q===8243||q===8245||q===8251||q===8254||q===8308||q===8319||q>=8321&&q<=8324||q===8364||q===8451||q===8453||q===8457||q===8467||q===8470||q===8481||q===8482||q===8486||q===8491||q===8531||q===8532||q>=8539&&q<=8542||q>=8544&&q<=8555||q>=8560&&q<=8569||q===8585||q>=8592&&q<=8601||q===8632||q===8633||q===8658||q===8660||q===8679||q===8704||q===8706||q===8707||q===8711||q===8712||q===8715||q===8719||q===8721||q===8725||q===8730||q>=8733&&q<=8736||q===8739||q===8741||q>=8743&&q<=8748||q===8750||q>=8756&&q<=8759||q===8764||q===8765||q===8776||q===8780||q===8786||q===8800||q===8801||q>=8804&&q<=8807||q===8810||q===8811||q===8814||q===8815||q===8834||q===8835||q===8838||q===8839||q===8853||q===8857||q===8869||q===8895||q===8978||q>=9312&&q<=9449||q>=9451&&q<=9547||q>=9552&&q<=9587||q>=9600&&q<=9615||q>=9618&&q<=9621||q===9632||q===9633||q>=9635&&q<=9641||q===9650||q===9651||q===9654||q===9655||q===9660||q===9661||q===9664||q===9665||q>=9670&&q<=9672||q===9675||q>=9678&&q<=9681||q>=9698&&q<=9701||q===9711||q===9733||q===9734||q===9737||q===9742||q===9743||q===9756||q===9758||q===9792||q===9794||q===9824||q===9825||q>=9827&&q<=9829||q>=9831&&q<=9834||q===9836||q===9837||q===9839||q===9886||q===9887||q===9919||q>=9926&&q<=9933||q>=9935&&q<=9939||q>=9941&&q<=9953||q===9955||q===9960||q===9961||q>=9963&&q<=9969||q===9972||q>=9974&&q<=9977||q===9979||q===9980||q===9982||q===9983||q===10045||q>=10102&&q<=10111||q>=11094&&q<=11097||q>=12872&&q<=12879||q>=57344&&q<=63743||q>=65024&&q<=65039||q===65533||q>=127232&&q<=127242||q>=127248&&q<=127277||q>=127280&&q<=127337||q>=127344&&q<=127373||q===127375||q===127376||q>=127387&&q<=127404||q>=917760&&q<=917999||q>=983040&&q<=1048573||q>=1048576&&q<=1114109,DG=(q)=>q===12288||q>=65281&&q<=65376||q>=65504&&q<=65510,PG=(q)=>q>=4352&&q<=4447||q===8986||q===8987||q===9001||q===9002||q>=9193&&q<=9196||q===9200||q===9203||q===9725||q===9726||q===9748||q===9749||q>=9800&&q<=9811||q===9855||q===9875||q===9889||q===9898||q===9899||q===9917||q===9918||q===9924||q===9925||q===9934||q===9940||q===9962||q===9970||q===9971||q===9973||q===9978||q===9981||q===9989||q===9994||q===9995||q===10024||q===10060||q===10062||q>=10067&&q<=10069||q===10071||q>=10133&&q<=10135||q===10160||q===10175||q===11035||q===11036||q===11088||q===11093||q>=11904&&q<=11929||q>=11931&&q<=12019||q>=12032&&q<=12245||q>=12272&&q<=12287||q>=12289&&q<=12350||q>=12353&&q<=12438||q>=12441&&q<=12543||q>=12549&&q<=12591||q>=12593&&q<=12686||q>=12688&&q<=12771||q>=12783&&q<=12830||q>=12832&&q<=12871||q>=12880&&q<=19903||q>=19968&&q<=42124||q>=42128&&q<=42182||q>=43360&&q<=43388||q>=44032&&q<=55203||q>=63744&&q<=64255||q>=65040&&q<=65049||q>=65072&&q<=65106||q>=65108&&q<=65126||q>=65128&&q<=65131||q>=94176&&q<=94180||q===94192||q===94193||q>=94208&&q<=100343||q>=100352&&q<=101589||q>=101632&&q<=101640||q>=110576&&q<=110579||q>=110581&&q<=110587||q===110589||q===110590||q>=110592&&q<=110882||q===110898||q>=110928&&q<=110930||q===110933||q>=110948&&q<=110951||q>=110960&&q<=111355||q===126980||q===127183||q===127374||q>=127377&&q<=127386||q>=127488&&q<=127490||q>=127504&&q<=127547||q>=127552&&q<=127560||q===127568||q===127569||q>=127584&&q<=127589||q>=127744&&q<=127776||q>=127789&&q<=127797||q>=127799&&q<=127868||q>=127870&&q<=127891||q>=127904&&q<=127946||q>=127951&&q<=127955||q>=127968&&q<=127984||q===127988||q>=127992&&q<=128062||q===128064||q>=128066&&q<=128252||q>=128255&&q<=128317||q>=128331&&q<=128334||q>=128336&&q<=128359||q===128378||q===128405||q===128406||q===128420||q>=128507&&q<=128591||q>=128640&&q<=128709||q===128716||q>=128720&&q<=128722||q>=128725&&q<=128727||q>=128732&&q<=128735||q===128747||q===128748||q>=128756&&q<=128764||q>=128992&&q<=129003||q===129008||q>=129292&&q<=129338||q>=129340&&q<=129349||q>=129351&&q<=129535||q>=129648&&q<=129660||q>=129664&&q<=129672||q>=129680&&q<=129725||q>=129727&&q<=129733||q>=129742&&q<=129755||q>=129760&&q<=129768||q>=129776&&q<=129784||q>=131072&&q<=196605||q>=196608&&q<=262141,O4=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y,Sq=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,Aq=/\t{1,1000}/y,N4=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu,wq=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,FG=/\p{M}+/gu,OG={limit:1/0,ellipsis:""},a5=(q,Z={},X={})=>{let J=Z.limit??1/0,$=Z.ellipsis??"",Q=Z?.ellipsisWidth??($?a5($,OG,X).width:0),H=X.ansiWidth??0,z=X.controlWidth??0,U=X.tabWidth??8,G=X.ambiguousWidth??1,T=X.emojiWidth??2,Y=X.fullWidthWidth??2,_=X.regularWidth??1,V=X.wideWidth??2,L=0,B=0,W=q.length,I=0,M=!1,D=W,O=Math.max(0,J-Q),N=0,S=0,K=0,R=0;q:for(;;){if(S>N||B>=W&&B>L){let w=q.slice(N,S)||q.slice(L,B);I=0;for(let y of w.replaceAll(FG,"")){let x=y.codePointAt(0)||0;if(DG(x)?R=Y:PG(x)?R=V:G!==_&&KG(x)?R=G:R=_,K+R>O&&(D=Math.min(D,Math.max(N,L)+I)),K+R>J){M=!0;break q}I+=y.length,K+=R}N=S=0}if(B>=W)break;if(wq.lastIndex=B,wq.test(q)){if(I=wq.lastIndex-B,R=I*_,K+R>O&&(D=Math.min(D,B+Math.floor((O-K)/_))),K+R>J){M=!0;break}K+=R,N=L,S=B,B=L=wq.lastIndex;continue}if(O4.lastIndex=B,O4.test(q)){if(K+H>O&&(D=Math.min(D,B)),K+H>J){M=!0;break}K+=H,N=L,S=B,B=L=O4.lastIndex;continue}if(Sq.lastIndex=B,Sq.test(q)){if(I=Sq.lastIndex-B,R=I*z,K+R>O&&(D=Math.min(D,B+Math.floor((O-K)/z))),K+R>J){M=!0;break}K+=R,N=L,S=B,B=L=Sq.lastIndex;continue}if(Aq.lastIndex=B,Aq.test(q)){if(I=Aq.lastIndex-B,R=I*U,K+R>O&&(D=Math.min(D,B+Math.floor((O-K)/U))),K+R>J){M=!0;break}K+=R,N=L,S=B,B=L=Aq.lastIndex;continue}if(N4.lastIndex=B,N4.test(q)){if(K+T>O&&(D=Math.min(D,B)),K+T>J){M=!0;break}K+=T,N=L,S=B,B=L=N4.lastIndex;continue}B+=1}return{width:M?O:K,index:M?D:W,truncated:M,ellipsed:M&&J>=Q}},NG={limit:1/0,ellipsis:"",ellipsisWidth:0},M0=(q,Z={})=>a5(q,NG,Z).width,jq="\x1B",s5="›",SG=39,w4="\x07",r5="[",AG="]",n5="m",b4=`${AG}8;;`,u5=new RegExp(`(?:\\${r5}(?<code>\\d+)m|\\${b4}(?<uri>.*)${w4})`,"y"),wG=(q)=>{if(q>=30&&q<=37||q>=90&&q<=97)return 39;if(q>=40&&q<=47||q>=100&&q<=107)return 49;if(q===1||q===2)return 22;if(q===3)return 23;if(q===4)return 24;if(q===7)return 27;if(q===8)return 28;if(q===9)return 29;if(q===0)return 0},m5=(q)=>`${jq}${r5}${q}${n5}`,d5=(q)=>`${jq}${b4}${q}${w4}`,bG=(q)=>q.map((Z)=>M0(Z)),S4=(q,Z,X)=>{let J=Z[Symbol.iterator](),$=!1,Q=!1,H=q.at(-1),z=H===void 0?0:M0(H),U=J.next(),G=J.next(),T=0;for(;!U.done;){let Y=U.value,_=M0(Y);z+_<=X?q[q.length-1]+=Y:(q.push(Y),z=0),(Y===jq||Y===s5)&&($=!0,Q=Z.startsWith(b4,T+1)),$?Q?Y===w4&&($=!1,Q=!1):Y===n5&&($=!1):(z+=_,z===X&&!G.done&&(q.push(""),z=0)),U=G,G=J.next(),T+=Y.length}H=q.at(-1),!z&&H!==void 0&&H.length>0&&q.length>1&&(q[q.length-2]+=q.pop())},jG=(q)=>{let Z=q.split(" "),X=Z.length;for(;X>0&&!(M0(Z[X-1])>0);)X--;return X===Z.length?q:Z.slice(0,X).join(" ")+Z.slice(X).join("")},EG=(q,Z,X={})=>{if(X.trim!==!1&&q.trim()==="")return"";let J="",$,Q,H=q.split(" "),z=bG(H),U=[""];for(let[L,B]of H.entries()){X.trim!==!1&&(U[U.length-1]=(U.at(-1)??"").trimStart());let W=M0(U.at(-1)??"");if(L!==0&&(W>=Z&&(X.wordWrap===!1||X.trim===!1)&&(U.push(""),W=0),(W>0||X.trim===!1)&&(U[U.length-1]+=" ",W++)),X.hard&&z[L]>Z){let I=Z-W,M=1+Math.floor((z[L]-I-1)/Z);Math.floor((z[L]-1)/Z)<M&&U.push(""),S4(U,B,Z);continue}if(W+z[L]>Z&&W>0&&z[L]>0){if(X.wordWrap===!1&&W<Z){S4(U,B,Z);continue}U.push("")}if(W+z[L]>Z&&X.wordWrap===!1){S4(U,B,Z);continue}U[U.length-1]+=B}X.trim!==!1&&(U=U.map((L)=>jG(L)));let G=U.join(`
188
+ `),T=G[Symbol.iterator](),Y=T.next(),_=T.next(),V=0;for(;!Y.done;){let L=Y.value,B=_.value;if(J+=L,L===jq||L===s5){u5.lastIndex=V+1;let I=u5.exec(G)?.groups;if(I?.code!==void 0){let M=Number.parseFloat(I.code);$=M===SG?void 0:M}else I?.uri!==void 0&&(Q=I.uri.length===0?void 0:I.uri)}let W=$?wG($):void 0;B===`
189
+ `?(Q&&(J+=d5("")),$&&W&&(J+=m5(W))):L===`
190
+ `&&($&&W&&(J+=m5($)),Q&&(J+=d5(Q))),V+=L.length,Y=_,_=T.next()}return J};function CG(q,Z,X){return String(q).normalize().replaceAll(`\r
191
191
  `,`
192
192
  `).split(`
193
- `).map((J)=>NG(J,Z,X)).join(`
194
- `)}var SG=(q,Z,X,J,$)=>{let Q=Z,H=0;for(let U=X;U<J;U++){let z=q[U];if(Q=Q-z.length,H++,Q<=$)break}return{lineCount:Q,removals:H}},S4=(q)=>{let{cursor:Z,options:X,style:J}=q,$=q.output??process.stdout,Q=K4($),H=q.columnPadding??0,U=q.rowPadding??4,z=Q-H,G=D4($),T=F.default.dim("..."),Y=q.maxItems??Number.POSITIVE_INFINITY,_=Math.max(G-U,0),V=Math.max(Math.min(Y,_),5),W=0;Z>=V-3&&(W=Math.max(Math.min(Z-V+3,X.length-V),0));let B=V<X.length&&W>0,L=V<X.length&&W+V<X.length,I=Math.min(W+V,X.length),M=[],D=0;B&&D++,L&&D++;let O=W+(B?1:0),N=I-(L?1:0);for(let K=O;K<N;K++){let R=AG(J(X[K],K===Z),z,{hard:!0,trim:!1}).split(`
195
- `);M.push(R),D+=R.length}if(D>_){let K=0,R=0,w=D,y=Z-O,x=(E,F0)=>SG(M,w,E,F0,_);B?({lineCount:w,removals:K}=x(0,y),w>_&&({lineCount:w,removals:R}=x(y+1,M.length))):({lineCount:w,removals:R}=x(y+1,M.length),w>_&&({lineCount:w,removals:K}=x(0,y))),K>0&&(B=!0,M.splice(0,K)),R>0&&(L=!0,M.splice(M.length-R,R))}let A=[];B&&A.push(T);for(let K of M)for(let R of K)A.push(R);return L&&A.push(T),A};var B1={message:(q=[],{symbol:Z=F.default.gray(f),secondarySymbol:X=F.default.gray(f),output:J=process.stdout,spacing:$=1,withGuide:Q}={})=>{let H=[],U=(Q??F1.withGuide)!==!1,z=U?X:"",G=U?`${Z} `:"",T=U?`${X} `:"";for(let _=0;_<$;_++)H.push(z);let Y=Array.isArray(q)?q:q.split(`
196
- `);if(Y.length>0){let[_,...V]=Y;_.length>0?H.push(`${G}${_}`):H.push(U?Z:"");for(let W of V)W.length>0?H.push(`${T}${W}`):H.push(U?X:"")}J.write(`${H.join(`
193
+ `).map((J)=>EG(J,Z,X)).join(`
194
+ `)}var fG=(q,Z,X,J,$)=>{let Q=Z,H=0;for(let z=X;z<J;z++){let U=q[z];if(Q=Q-U.length,H++,Q<=$)break}return{lineCount:Q,removals:H}},A4=(q)=>{let{cursor:Z,options:X,style:J}=q,$=q.output??process.stdout,Q=K4($),H=q.columnPadding??0,z=q.rowPadding??4,U=Q-H,G=D4($),T=F.default.dim("..."),Y=q.maxItems??Number.POSITIVE_INFINITY,_=Math.max(G-z,0),V=Math.max(Math.min(Y,_),5),L=0;Z>=V-3&&(L=Math.max(Math.min(Z-V+3,X.length-V),0));let B=V<X.length&&L>0,W=V<X.length&&L+V<X.length,I=Math.min(L+V,X.length),M=[],D=0;B&&D++,W&&D++;let O=L+(B?1:0),N=I-(W?1:0);for(let K=O;K<N;K++){let R=CG(J(X[K],K===Z),U,{hard:!0,trim:!1}).split(`
195
+ `);M.push(R),D+=R.length}if(D>_){let K=0,R=0,w=D,y=Z-O,x=(E,F0)=>fG(M,w,E,F0,_);B?({lineCount:w,removals:K}=x(0,y),w>_&&({lineCount:w,removals:R}=x(y+1,M.length))):({lineCount:w,removals:R}=x(y+1,M.length),w>_&&({lineCount:w,removals:K}=x(0,y))),K>0&&(B=!0,M.splice(0,K)),R>0&&(W=!0,M.splice(M.length-R,R))}let S=[];B&&S.push(T);for(let K of M)for(let R of K)S.push(R);return W&&S.push(T),S};var B1={message:(q=[],{symbol:Z=F.default.gray(f),secondarySymbol:X=F.default.gray(f),output:J=process.stdout,spacing:$=1,withGuide:Q}={})=>{let H=[],z=(Q??F1.withGuide)!==!1,U=z?X:"",G=z?`${Z} `:"",T=z?`${X} `:"";for(let _=0;_<$;_++)H.push(U);let Y=Array.isArray(q)?q:q.split(`
196
+ `);if(Y.length>0){let[_,...V]=Y;_.length>0?H.push(`${G}${_}`):H.push(z?Z:"");for(let L of V)L.length>0?H.push(`${T}${L}`):H.push(z?X:"")}J.write(`${H.join(`
197
197
  `)}
198
- `)},info:(q,Z)=>{B1.message(q,{...Z,symbol:F.default.blue(YG)})},success:(q,Z)=>{B1.message(q,{...Z,symbol:F.default.green(BG)})},step:(q,Z)=>{B1.message(q,{...Z,symbol:F.default.green(d5)})},warn:(q,Z)=>{B1.message(q,{...Z,symbol:F.default.yellow(TG)})},warning:(q,Z)=>{B1.warn(q,Z)},error:(q,Z)=>{B1.message(q,{...Z,symbol:F.default.red(_G)})}},Eq=(q="",Z)=>{(Z?.output??process.stdout).write(`${F.default.gray(I0)} ${F.default.red(q)}
198
+ `)},info:(q,Z)=>{B1.message(q,{...Z,symbol:F.default.blue(VG)})},success:(q,Z)=>{B1.message(q,{...Z,symbol:F.default.green(RG)})},step:(q,Z)=>{B1.message(q,{...Z,symbol:F.default.green(p5)})},warn:(q,Z)=>{B1.message(q,{...Z,symbol:F.default.yellow(IG)})},warning:(q,Z)=>{B1.warn(q,Z)},error:(q,Z)=>{B1.message(q,{...Z,symbol:F.default.red(MG)})}},Eq=(q="",Z)=>{(Z?.output??process.stdout).write(`${F.default.gray(I0)} ${F.default.red(q)}
199
199
 
200
- `)},r5=(q="",Z)=>{(Z?.output??process.stdout).write(`${F.default.gray(UG)} ${q}
201
- `)},n5=(q="",Z)=>{(Z?.output??process.stdout).write(`${F.default.gray(f)}
200
+ `)},o5=(q="",Z)=>{(Z?.output??process.stdout).write(`${F.default.gray(_G)} ${q}
201
+ `)},t5=(q="",Z)=>{(Z?.output??process.stdout).write(`${F.default.gray(f)}
202
202
  ${F.default.gray(I0)} ${q}
203
203
 
204
204
  `)},R0=(q,Z)=>q.split(`
205
205
  `).map((X)=>Z(X)).join(`
206
- `),K0=(q)=>{let Z=(J,$)=>{let Q=J.label??String(J.value);return $==="disabled"?`${F.default.gray(v5)} ${R0(Q,(H)=>F.default.strikethrough(F.default.gray(H)))}${J.hint?` ${F.default.dim(`(${J.hint??"disabled"})`)}`:""}`:$==="active"?`${F.default.cyan(GG)} ${Q}${J.hint?` ${F.default.dim(`(${J.hint})`)}`:""}`:$==="selected"?`${F.default.green(k5)} ${R0(Q,F.default.dim)}${J.hint?` ${F.default.dim(`(${J.hint})`)}`:""}`:$==="cancelled"?`${R0(Q,(H)=>F.default.strikethrough(F.default.dim(H)))}`:$==="active-selected"?`${F.default.green(k5)} ${Q}${J.hint?` ${F.default.dim(`(${J.hint})`)}`:""}`:$==="submitted"?`${R0(Q,F.default.dim)}`:`${F.default.dim(v5)} ${R0(Q,F.default.dim)}`},X=q.required??!0;return new P4({options:q.options,signal:q.signal,input:q.input,output:q.output,initialValues:q.initialValues,required:X,cursorAt:q.cursorAt,validate(J){if(X&&(J===void 0||J.length===0))return`Please select at least one option.
207
- ${F.default.reset(F.default.dim(`Press ${F.default.gray(F.default.bgWhite(F.default.inverse(" space ")))} to select, ${F.default.gray(F.default.bgWhite(F.default.inverse(" enter ")))} to submit`))}`},render(){let J=N1(q.output,q.message,`${p5(this.state)} `,`${l5(this.state)} `),$=`${F.default.gray(f)}
206
+ `),K0=(q)=>{let Z=(J,$)=>{let Q=J.label??String(J.value);return $==="disabled"?`${F.default.gray(g5)} ${R0(Q,(H)=>F.default.strikethrough(F.default.gray(H)))}${J.hint?` ${F.default.dim(`(${J.hint??"disabled"})`)}`:""}`:$==="active"?`${F.default.cyan(LG)} ${Q}${J.hint?` ${F.default.dim(`(${J.hint})`)}`:""}`:$==="selected"?`${F.default.green(h5)} ${R0(Q,F.default.dim)}${J.hint?` ${F.default.dim(`(${J.hint})`)}`:""}`:$==="cancelled"?`${R0(Q,(H)=>F.default.strikethrough(F.default.dim(H)))}`:$==="active-selected"?`${F.default.green(h5)} ${Q}${J.hint?` ${F.default.dim(`(${J.hint})`)}`:""}`:$==="submitted"?`${R0(Q,F.default.dim)}`:`${F.default.dim(g5)} ${R0(Q,F.default.dim)}`},X=q.required??!0;return new P4({options:q.options,signal:q.signal,input:q.input,output:q.output,initialValues:q.initialValues,required:X,cursorAt:q.cursorAt,validate(J){if(X&&(J===void 0||J.length===0))return`Please select at least one option.
207
+ ${F.default.reset(F.default.dim(`Press ${F.default.gray(F.default.bgWhite(F.default.inverse(" space ")))} to select, ${F.default.gray(F.default.bgWhite(F.default.inverse(" enter ")))} to submit`))}`},render(){let J=N1(q.output,q.message,`${i5(this.state)} `,`${c5(this.state)} `),$=`${F.default.gray(f)}
208
208
  ${J}
209
- `,Q=this.value??[],H=(U,z)=>{if(U.disabled)return Z(U,"disabled");let G=Q.includes(U.value);return z&&G?Z(U,"active-selected"):G?Z(U,"selected"):Z(U,z?"active":"inactive")};switch(this.state){case"submit":{let U=this.options.filter(({value:G})=>Q.includes(G)).map((G)=>Z(G,"submitted")).join(F.default.dim(", "))||F.default.dim("none"),z=N1(q.output,U,`${F.default.gray(f)} `);return`${$}${z}`}case"cancel":{let U=this.options.filter(({value:G})=>Q.includes(G)).map((G)=>Z(G,"cancelled")).join(F.default.dim(", "));if(U.trim()==="")return`${$}${F.default.gray(f)}`;let z=N1(q.output,U,`${F.default.gray(f)} `);return`${$}${z}
210
- ${F.default.gray(f)}`}case"error":{let U=`${F.default.yellow(f)} `,z=this.error.split(`
209
+ `,Q=this.value??[],H=(z,U)=>{if(z.disabled)return Z(z,"disabled");let G=Q.includes(z.value);return U&&G?Z(z,"active-selected"):G?Z(z,"selected"):Z(z,U?"active":"inactive")};switch(this.state){case"submit":{let z=this.options.filter(({value:G})=>Q.includes(G)).map((G)=>Z(G,"submitted")).join(F.default.dim(", "))||F.default.dim("none"),U=N1(q.output,z,`${F.default.gray(f)} `);return`${$}${U}`}case"cancel":{let z=this.options.filter(({value:G})=>Q.includes(G)).map((G)=>Z(G,"cancelled")).join(F.default.dim(", "));if(z.trim()==="")return`${$}${F.default.gray(f)}`;let U=N1(q.output,z,`${F.default.gray(f)} `);return`${$}${U}
210
+ ${F.default.gray(f)}`}case"error":{let z=`${F.default.yellow(f)} `,U=this.error.split(`
211
211
  `).map((Y,_)=>_===0?`${F.default.yellow(I0)} ${F.default.yellow(Y)}`:` ${Y}`).join(`
212
212
  `),G=$.split(`
213
- `).length,T=z.split(`
214
- `).length+1;return`${$}${U}${S4({output:q.output,options:this.options,cursor:this.cursor,maxItems:q.maxItems,columnPadding:U.length,rowPadding:G+T,style:H}).join(`
215
- ${U}`)}
216
- ${z}
217
- `}default:{let U=`${F.default.cyan(f)} `,z=$.split(`
218
- `).length;return`${$}${U}${S4({output:q.output,options:this.options,cursor:this.cursor,maxItems:q.maxItems,columnPadding:U.length,rowPadding:z+2,style:H}).join(`
219
- ${U}`)}
213
+ `).length,T=U.split(`
214
+ `).length+1;return`${$}${z}${A4({output:q.output,options:this.options,cursor:this.cursor,maxItems:q.maxItems,columnPadding:z.length,rowPadding:G+T,style:H}).join(`
215
+ ${z}`)}
216
+ ${U}
217
+ `}default:{let z=`${F.default.cyan(f)} `,U=$.split(`
218
+ `).length;return`${$}${z}${A4({output:q.output,options:this.options,cursor:this.cursor,maxItems:q.maxItems,columnPadding:z.length,rowPadding:U+2,style:H}).join(`
219
+ ${z}`)}
220
220
  ${F.default.cyan(I0)}
221
- `}}}}).prompt()};var wT=F.default.magenta;var bT={light:j("─","-"),heavy:j("━","="),block:j("█","#")};var bq=(q,Z)=>q.includes(`
221
+ `}}}}).prompt()};var yT=F.default.magenta;var xT={light:j("─","-"),heavy:j("━","="),block:j("█","#")};var bq=(q,Z)=>q.includes(`
222
222
  `)?q.split(`
223
223
  `).map((X)=>Z(X)).join(`
224
- `):Z(q),j4=(q)=>{let Z=(X,J)=>{let $=X.label??String(X.value);switch(J){case"disabled":return`${F.default.gray(x5)} ${bq($,F.default.gray)}${X.hint?` ${F.default.dim(`(${X.hint??"disabled"})`)}`:""}`;case"selected":return`${bq($,F.default.dim)}`;case"active":return`${F.default.green(zG)} ${$}${X.hint?` ${F.default.dim(`(${X.hint})`)}`:""}`;case"cancelled":return`${bq($,(Q)=>F.default.strikethrough(F.default.dim(Q)))}`;default:return`${F.default.dim(x5)} ${bq($,F.default.dim)}`}};return new F4({options:q.options,signal:q.signal,input:q.input,output:q.output,initialValue:q.initialValue,render(){let X=`${l5(this.state)} `,J=`${p5(this.state)} `,$=N1(q.output,q.message,J,X),Q=`${F.default.gray(f)}
224
+ `):Z(q),j4=(q)=>{let Z=(X,J)=>{let $=X.label??String(X.value);switch(J){case"disabled":return`${F.default.gray(v5)} ${bq($,F.default.gray)}${X.hint?` ${F.default.dim(`(${X.hint??"disabled"})`)}`:""}`;case"selected":return`${bq($,F.default.dim)}`;case"active":return`${F.default.green(WG)} ${$}${X.hint?` ${F.default.dim(`(${X.hint})`)}`:""}`;case"cancelled":return`${bq($,(Q)=>F.default.strikethrough(F.default.dim(Q)))}`;default:return`${F.default.dim(v5)} ${bq($,F.default.dim)}`}};return new F4({options:q.options,signal:q.signal,input:q.input,output:q.output,initialValue:q.initialValue,render(){let X=`${c5(this.state)} `,J=`${i5(this.state)} `,$=N1(q.output,q.message,J,X),Q=`${F.default.gray(f)}
225
225
  ${$}
226
- `;switch(this.state){case"submit":{let H=`${F.default.gray(f)} `,U=N1(q.output,Z(this.options[this.cursor],"selected"),H);return`${Q}${U}`}case"cancel":{let H=`${F.default.gray(f)} `,U=N1(q.output,Z(this.options[this.cursor],"cancelled"),H);return`${Q}${U}
227
- ${F.default.gray(f)}`}default:{let H=`${F.default.cyan(f)} `,U=Q.split(`
228
- `).length;return`${Q}${H}${S4({output:q.output,cursor:this.cursor,options:this.options,maxItems:q.maxItems,columnPadding:H.length,rowPadding:U+2,style:(z,G)=>Z(z,z.disabled?"disabled":G?"active":"inactive")}).join(`
226
+ `;switch(this.state){case"submit":{let H=`${F.default.gray(f)} `,z=N1(q.output,Z(this.options[this.cursor],"selected"),H);return`${Q}${z}`}case"cancel":{let H=`${F.default.gray(f)} `,z=N1(q.output,Z(this.options[this.cursor],"cancelled"),H);return`${Q}${z}
227
+ ${F.default.gray(f)}`}default:{let H=`${F.default.cyan(f)} `,z=Q.split(`
228
+ `).length;return`${Q}${H}${A4({output:q.output,cursor:this.cursor,options:this.options,maxItems:q.maxItems,columnPadding:H.length,rowPadding:z+2,style:(U,G)=>Z(U,U.disabled?"disabled":G?"active":"inactive")}).join(`
229
229
  ${H}`)}
230
230
  ${F.default.cyan(I0)}
231
- `}}}}).prompt()};var jT=`${F.default.gray(f)} `;var wG=[{name:"pi",displayName:"Pi",projectSkills:".pi/skills",projectAgents:".pi/agents",globalSkills:"~/.pi/agent/skills",globalAgents:"~/.pi/agent/agents",isUniversal:!1},{name:"claude-code",displayName:"Claude Code",projectSkills:".claude/skills",projectAgents:".claude/agents",globalSkills:"~/.claude/skills",globalAgents:"~/.claude/agents",isUniversal:!1},{name:"cursor",displayName:"Cursor",projectSkills:".cursor/skills",projectAgents:".cursor/agents",globalSkills:"~/.cursor/skills",globalAgents:"~/.cursor/agents",isUniversal:!1},{name:"roo",displayName:"Roo",projectSkills:".roo/skills",projectAgents:".roo/agents",globalSkills:"~/.roo/skills",globalAgents:"~/.roo/agents",isUniversal:!1},{name:"cline",displayName:"Cline",projectSkills:".cline/skills",projectAgents:".cline/agents",globalSkills:"~/.cline/skills",globalAgents:"~/.cline/agents",isUniversal:!1},{name:"windsurf",displayName:"Windsurf",projectSkills:".windsurf/skills",projectAgents:".windsurf/agents",globalSkills:"~/.windsurf/skills",globalAgents:"~/.windsurf/agents",isUniversal:!1},{name:"opencode",displayName:"OpenCode",projectSkills:".opencode/skills",projectAgents:".opencode/agents",globalSkills:"~/.config/opencode/skills",globalAgents:"~/.config/opencode/agents",isUniversal:!1},{name:"codex",displayName:"Codex",projectSkills:".agents/skills",projectAgents:".agents/agents",globalSkills:"~/.config/codex/skills",globalAgents:"~/.config/codex/agents",isUniversal:!0},{name:"amp",displayName:"Amp",projectSkills:".agents/skills",projectAgents:".agents/agents",globalSkills:"~/.config/amp/skills",globalAgents:"~/.config/amp/agents",isUniversal:!0},{name:"gemini-cli",displayName:"Gemini CLI",projectSkills:".agents/skills",projectAgents:".agents/agents",globalSkills:"~/.config/gemini-cli/skills",globalAgents:"~/.config/gemini-cli/agents",isUniversal:!0},{name:"github-copilot",displayName:"GitHub Copilot",projectSkills:".agents/skills",projectAgents:".agents/agents",globalSkills:"~/.config/github-copilot/skills",globalAgents:"~/.config/github-copilot/agents",isUniversal:!0},{name:"kimi-cli",displayName:"Kimi CLI",projectSkills:".agents/skills",projectAgents:".agents/agents",globalSkills:"~/.config/kimi-cli/skills",globalAgents:"~/.config/kimi-cli/agents",isUniversal:!0}],g1=[...wG];function t5(q){return g1.find((Z)=>Z.name===q)}function e5(){return g1.filter((q)=>q.isUniversal)}function q6(){return g1.filter((q)=>!q.isUniversal)}function Z6(q){return q.filter((Z)=>!t5(Z))}function X6(q){let Z=new Map;for(let X of q){let J=t5(X);if(!J)continue;let $=`${J.projectSkills}|${J.projectAgents}|${J.globalSkills}|${J.globalAgents}`,Q=Z.get($);if(Q)Q.displayNames.push(J.displayName);else Z.set($,{projectSkills:J.projectSkills,projectAgents:J.projectAgents,globalSkills:J.globalSkills,globalAgents:J.globalAgents,displayNames:[J.displayName]})}return Array.from(Z.values())}function Cq(q){let Z=new Set(Object.keys(q));g1=g1.filter((X)=>!Z.has(X.name));for(let[X,J]of Object.entries(q))g1.push({name:X,displayName:X,projectSkills:J.project_skills,projectAgents:J.project_agents,globalSkills:J.global_skills,globalAgents:J.global_agents,isUniversal:!1})}function J6(){return process.stdin.isTTY===!0}async function D0(q={}){let{defaults:Z}=q;r5("⚙️ agentdeps setup");let X=await j4({message:"How do you clone git repositories?",options:[{value:"ssh",label:"SSH (git@github.com:...)"},{value:"https",label:"HTTPS (https://github.com/...)"}],initialValue:Z?.clone_method??"ssh"});if(q1(X)){Eq("Setup cancelled.");return}let J=e5(),$=q6(),Q=[];for(let z of $)Q.push({value:z.name,label:`${z.displayName}`,hint:`${z.projectSkills}, ${z.projectAgents}`});for(let z of J)Q.push({value:z.name,label:`${z.displayName}`,hint:".agents/skills, .agents/agents (Universal)"});let H=await K0({message:"Which coding agents do you use? (space to select, enter to confirm)",options:Q,initialValues:Z?.agents??[],required:!0});if(q1(H)){Eq("Setup cancelled.");return}if(H.length===0)return B1.error("At least one agent must be selected."),D0(q);let U=await j4({message:"How should dependencies be installed?",options:[{value:"link",label:"Link (symlinks)",hint:"Fast, no duplication — default"},{value:"copy",label:"Copy (smart sync)",hint:"Portable, self-contained"}],initialValue:Z?.install_method??"link"});if(q1(U)){Eq("Setup cancelled.");return}return n5("✅ Configuration saved!"),{clone_method:X,agents:H,install_method:U,custom_agents:Z?.custom_agents}}import{join as g4}from"node:path";import{mkdir as bG,readFile as jG,writeFile as EG,access as CG}from"node:fs/promises";import{dirname as fG}from"node:path";function yG(q,Z){if(!q.repo)throw Error(`Dependency at index ${Z} is missing required 'repo' field`);let X;if(q.skills===void 0||q.skills==="*"||q.skills===!0)X="*";else if(q.skills===!1)X=!1;else if(Array.isArray(q.skills))X=q.skills;else rq("config.normalize",`Dependency "${q.repo}" has unexpected skills value (${JSON.stringify(q.skills)}), defaulting to "*"`),X="*";let J;if(q.agents===void 0||q.agents==="*"||q.agents===!0)J="*";else if(q.agents===!1)J=!1;else if(Array.isArray(q.agents))J=q.agents;else rq("config.normalize",`Dependency "${q.repo}" has unexpected agents value (${JSON.stringify(q.agents)}), defaulting to "*"`),J="*";return{repo:q.repo,ref:q.ref??"main",skills:X,agents:J}}async function c(q){try{return await CG(q),!0}catch{return!1}}async function i(q){let Z=await jG(q,"utf-8"),X=_0(Z);if(!X||!X.dependencies){if(X&&!X.dependencies)console.warn("⚠ agents.yaml has no 'dependencies' field");return{dependencies:[]}}let J=X.dependencies;if(!Array.isArray(J))throw Error("'dependencies' must be an array in agents.yaml");if(J.length===0)return console.warn("⚠ agents.yaml has an empty dependencies list"),{dependencies:[]};return{dependencies:J.map((Q,H)=>yG(Q,H))}}async function fq(q,Z){let X=fG(q);await bG(X,{recursive:!0});let J={dependencies:Z.dependencies.map((Q)=>{let H={repo:Q.repo};if(Q.ref!=="main")H.ref=Q.ref;if(Q.skills!=="*")H.skills=Q.skills;if(Q.agents!=="*")H.agents=Q.agents;return H})},$=L0(J,{lineWidth:0});await EG(q,$,"utf-8")}function xG(q){if(q.includes("://"))return!1;if(q.startsWith("git@"))return!1;return q.split("/").length-1===1}function kG(q,Z){if(Z==="ssh")return`git@github.com:${q}.git`;return`https://github.com/${q}.git`}function yq(q,Z){if(xG(q))return kG(q,Z);return q}function xq(q,Z){let X;if(q.startsWith("git@")){let $=q.indexOf(":");X=q.slice($+1)}else if(q.includes("://"))try{X=new URL(q).pathname.slice(1)}catch{X=q}else X=q;if(X.endsWith(".git"))X=X.slice(0,-4);return`${X.replace(/\//g,"-")}-${Z}`}import{readdir as $6,access as vG}from"node:fs/promises";import{join as u1}from"node:path";async function kq(q){let Z=u1(q,"skills");try{let J=(await $6(Z,{withFileTypes:!0})).filter((Q)=>Q.isDirectory());return(await Promise.all(J.map(async(Q)=>{let H;try{await vG(u1(Z,Q.name,"SKILL.md")),H=!0}catch{H=!1}return H?{name:Q.name,sourcePath:u1(Z,Q.name)}:null}))).filter((Q)=>Q!==null).sort((Q,H)=>Q.name.localeCompare(H.name))}catch{return[]}}async function vq(q){let Z=u1(q,"agents");try{let X=await $6(Z,{withFileTypes:!0}),J=[];for(let $ of X)if($.isDirectory())J.push({name:$.name,sourcePath:u1(Z,$.name)});else if($.isFile()&&$.name.endsWith(".md")){let Q=$.name.replace(/\.md$/,"");J.push({name:Q,sourcePath:u1(Z,$.name)})}return J.sort(($,Q)=>$.name.localeCompare(Q.name))}catch{return[]}}function E4(q,Z){if(Z===!1)return{selected:[],missing:[]};if(Z==="*")return{selected:[...q],missing:[]};let X=new Map(q.map((Q)=>[Q.name,Q])),J=[],$=[];for(let Q of Z){let H=X.get(Q);if(H)J.push(H);else $.push(Q)}return{selected:J,missing:$}}function C4(q,Z,X,J,$){if(J===!1)return;if(X.length===0)console.warn(`⚠ No ${Z} found in ${q}${Z==="skills"?" (no skills/ directory or no SKILL.md files)":" (no agents/ directory)"}`);if($.length>0)console.warn(`⚠ ${Z} not found in ${q}: ${$.join(", ")}`)}import{readdir as Y6,mkdir as sG,rm as B6,lstat as rG,stat as nG}from"node:fs/promises";import{join as k4}from"node:path";import{homedir as oG}from"node:os";import{symlink as hG,readlink as gG,unlink as uG,lstat as Q6,rm as mG}from"node:fs/promises";import{platform as dG}from"node:os";import{execFile as lG}from"node:child_process";import{promisify as pG}from"node:util";var cG=pG(lG);async function f4(q,Z){let X=!1;try{X=(await Q6(q)).isFile()}catch{}try{await hG(q,Z,X?"file":"dir")}catch(J){if(dG()==="win32"&&!X)try{await cG("cmd",["/c","mklink","/J",Z,q])}catch($){let Q=$ instanceof Error?$.message:String($);throw Error(`Failed to create symlink or junction at ${Z}. Consider switching to install_method: copy, or enable Developer Mode on Windows. Error: ${Q.trim()}`)}else throw J}}async function H6(q,Z){try{if((await Q6(Z)).isSymbolicLink()){if(await gG(Z)===q)return"unchanged";return await uG(Z),await f4(q,Z),"replaced"}return await mG(Z,{recursive:!0,force:!0}),await f4(q,Z),"replaced"}catch(X){if(X.code==="ENOENT")return await f4(q,Z),"created";throw X}}import{readdir as U6,mkdir as iG,rm as aG,stat as x4,copyFile as z6}from"node:fs/promises";import{join as y4}from"node:path";async function hq(q,Z){if((await x4(q)).isFile()){if(await G6(q,Z))await z6(q,Z);return}await iG(Z,{recursive:!0});let J=await U6(q,{withFileTypes:!0}),$=new Set(J.map((H)=>H.name)),Q=[];try{Q=await U6(Z,{withFileTypes:!0})}catch{}for(let H of Q)if(!$.has(H.name))await aG(y4(Z,H.name),{recursive:!0,force:!0});for(let H of J){let U=y4(q,H.name),z=y4(Z,H.name);if(H.isDirectory())await hq(U,z);else if(H.isFile()){if(await G6(U,z))await z6(U,z)}}}async function G6(q,Z){try{let[X,J]=await Promise.all([x4(q),x4(Z)]);if(X.size!==J.size)return!0;if(X.mtimeMs>J.mtimeMs)return!0;return!1}catch{return!0}}function v4(q){if(q.startsWith("~/")||q==="~")return k4(oG(),q.slice(1));return q}async function tG(q,Z){try{if((await nG(Z)).isFile()){let J=Z.match(/(\.[^.]+)$/)?.[1]??"";return q+J}}catch{}return q}async function h4(q,Z,X){let J={added:[],removed:[],unchanged:[]},$=[],Q=!1;try{$=await Y6(q),Q=!0}catch{}if(Z.size===0&&!Q)return J;let H=[];for(let[z,G]of Z){let T=await tG(z,G);H.push({name:z,targetName:T,sourcePath:G})}let U=new Set(H.map((z)=>z.targetName));for(let z of $)if(!U.has(z))await B6(k4(q,z),{recursive:!0,force:!0}),J.removed.push(z);if(Z.size===0){try{if((await Y6(q)).length===0)await B6(q,{recursive:!0,force:!0})}catch{}return J}await sG(q,{recursive:!0});for(let{name:z,targetName:G,sourcePath:T}of H){let Y=k4(q,G);if(X==="link"){let _=await H6(T,Y);if(_==="created")J.added.push(z);else if(_==="replaced")J.added.push(z);else J.unchanged.push(z)}else try{await rG(Y),await hq(T,Y),J.unchanged.push(z)}catch{await hq(T,Y),J.added.push(z)}}return J}async function T6(q,Z){let X=await Promise.all(q.map(async($)=>{let Q=yq($.repo,Z),H=xq($.repo,$.ref);console.log(` \uD83D\uDCE6 ${$.repo} (${$.ref})`);let U=await w0(Q,$.ref,H);return{dep:$,result:U}}));return(await Promise.all(X.map(async({dep:$,result:Q})=>{if(!Q.success)return console.error(` ✗ Failed to cache ${$.repo}, skipping`),null;let[H,U]=await Promise.all([kq(Q.path),vq(Q.path)]),z=E4(H,$.skills),G=E4(U,$.agents);return C4($.repo,"skills",H,$.skills,z.missing),C4($.repo,"agents",U,$.agents,G.missing),{repo:$.repo,cachePath:Q.path,skills:z.selected,agents:G.selected}}))).filter(($)=>$!==null)}async function _6(q,Z,X,J){let $=new Map,Q=new Map;for(let z of q){for(let G of z.skills)$.set(G.name,G.sourcePath);for(let G of z.agents)Q.set(G.name,G.sourcePath)}let H=new Map;for(let z of Z){let G=X==="global"?v4(z.globalSkills):z.projectSkills,T=X==="global"?v4(z.globalAgents):z.projectAgents,Y=`${G}|${T}`,_=H.get(Y);if(_)_.displayNames.push(...z.displayNames);else H.set(Y,{skillsDir:G,agentsDir:T,displayNames:[...z.displayNames]})}let U=[];for(let{skillsDir:z,agentsDir:G,displayNames:T}of H.values()){let Y=g4(z,"_agentdeps_managed"),_=g4(G,"_agentdeps_managed"),V=await h4(Y,$,J),W=await h4(_,Q,J);U.push({displayNames:T,skillsAdded:V.added.length,skillsRemoved:V.removed.length,agentsAdded:W.added.length,agentsRemoved:W.removed.length})}return U}function L6(q,Z){if(Z.length===0)return` ✓ ${q}: nothing to do`;if(Z.length===1){let J=Z[0],$=J.skillsRemoved+J.agentsRemoved,Q=[];if(J.skillsAdded>0)Q.push(`${J.skillsAdded} skills added`);if(J.agentsAdded>0)Q.push(`${J.agentsAdded} agents added`);if($>0)Q.push(`${$} removed`);if(Q.length===0)Q.push("up to date");let H=J.displayNames.join(", ");return` ✓ ${q} (${H}): ${Q.join(", ")}`}let X=[];for(let J of Z){let $=J.skillsRemoved+J.agentsRemoved,Q=[];if(J.skillsAdded>0)Q.push(`${J.skillsAdded} skills added`);if(J.agentsAdded>0)Q.push(`${J.agentsAdded} agents added`);if($>0)Q.push(`${$} removed`);if(Q.length===0)Q.push("up to date");let H=J.displayNames.join(", ");X.push(` ${H}: ${Q.join(", ")}`)}return` ✓ ${q}:
231
+ `}}}}).prompt()};var kT=`${F.default.gray(f)} `;var yG=[{name:"pi",displayName:"Pi",projectSkills:".agents/skills",projectAgents:".agents/agents",globalSkills:"~/.pi/agent/skills",globalAgents:"~/.pi/agent/agents",isUniversal:!0,legacyProjectPaths:{skills:".pi/skills",agents:".pi/agents"}},{name:"claude-code",displayName:"Claude Code",projectSkills:".claude/skills",projectAgents:".claude/agents",globalSkills:"~/.claude/skills",globalAgents:"~/.claude/agents",isUniversal:!1},{name:"cursor",displayName:"Cursor",projectSkills:".cursor/skills",projectAgents:".cursor/agents",globalSkills:"~/.cursor/skills",globalAgents:"~/.cursor/agents",isUniversal:!1},{name:"roo",displayName:"Roo",projectSkills:".roo/skills",projectAgents:".roo/agents",globalSkills:"~/.roo/skills",globalAgents:"~/.roo/agents",isUniversal:!1},{name:"cline",displayName:"Cline",projectSkills:".cline/skills",projectAgents:".cline/agents",globalSkills:"~/.cline/skills",globalAgents:"~/.cline/agents",isUniversal:!1},{name:"windsurf",displayName:"Windsurf",projectSkills:".windsurf/skills",projectAgents:".windsurf/agents",globalSkills:"~/.windsurf/skills",globalAgents:"~/.windsurf/agents",isUniversal:!1},{name:"opencode",displayName:"OpenCode",projectSkills:".agents/skills",projectAgents:".agents/agents",globalSkills:"~/.config/opencode/skills",globalAgents:"~/.config/opencode/agents",isUniversal:!0,legacyProjectPaths:{skills:".opencode/skills",agents:".opencode/agents"}},{name:"codex",displayName:"Codex",projectSkills:".agents/skills",projectAgents:".agents/agents",globalSkills:"~/.config/codex/skills",globalAgents:"~/.config/codex/agents",isUniversal:!0},{name:"amp",displayName:"Amp",projectSkills:".agents/skills",projectAgents:".agents/agents",globalSkills:"~/.config/amp/skills",globalAgents:"~/.config/amp/agents",isUniversal:!0},{name:"gemini-cli",displayName:"Gemini CLI",projectSkills:".agents/skills",projectAgents:".agents/agents",globalSkills:"~/.config/gemini-cli/skills",globalAgents:"~/.config/gemini-cli/agents",isUniversal:!0},{name:"github-copilot",displayName:"GitHub Copilot",projectSkills:".agents/skills",projectAgents:".agents/agents",globalSkills:"~/.config/github-copilot/skills",globalAgents:"~/.config/github-copilot/agents",isUniversal:!0},{name:"kimi-cli",displayName:"Kimi CLI",projectSkills:".agents/skills",projectAgents:".agents/agents",globalSkills:"~/.config/kimi-cli/skills",globalAgents:"~/.config/kimi-cli/agents",isUniversal:!0}],g1=[...yG];function E4(q){return g1.find((Z)=>Z.name===q)}function q6(){return g1.filter((q)=>q.isUniversal)}function Z6(){return g1.filter((q)=>!q.isUniversal)}function X6(q){let Z=new Set,X=[];for(let J of q){let $=E4(J);if(!$?.legacyProjectPaths)continue;let Q=`${$.legacyProjectPaths.skills}|${$.legacyProjectPaths.agents}`;if(Z.has(Q))continue;Z.add(Q),X.push($.legacyProjectPaths)}return X}function J6(q){return q.filter((Z)=>!E4(Z))}function $6(q){let Z=new Map;for(let X of q){let J=E4(X);if(!J)continue;let $=`${J.projectSkills}|${J.projectAgents}|${J.globalSkills}|${J.globalAgents}`,Q=Z.get($);if(Q)Q.displayNames.push(J.displayName);else Z.set($,{projectSkills:J.projectSkills,projectAgents:J.projectAgents,globalSkills:J.globalSkills,globalAgents:J.globalAgents,displayNames:[J.displayName]})}return Array.from(Z.values())}function Cq(q){let Z=new Set(Object.keys(q));g1=g1.filter((X)=>!Z.has(X.name));for(let[X,J]of Object.entries(q))g1.push({name:X,displayName:X,projectSkills:J.project_skills,projectAgents:J.project_agents,globalSkills:J.global_skills,globalAgents:J.global_agents,isUniversal:!1})}function Q6(){return process.stdin.isTTY===!0}async function D0(q={}){let{defaults:Z}=q;o5("⚙️ agentdeps setup");let X=await j4({message:"How do you clone git repositories?",options:[{value:"ssh",label:"SSH (git@github.com:...)"},{value:"https",label:"HTTPS (https://github.com/...)"}],initialValue:Z?.clone_method??"ssh"});if(q1(X)){Eq("Setup cancelled.");return}let J=q6(),$=Z6(),Q=[];for(let U of $)Q.push({value:U.name,label:`${U.displayName}`,hint:`${U.projectSkills}, ${U.projectAgents}`});for(let U of J)Q.push({value:U.name,label:`${U.displayName}`,hint:".agents/skills, .agents/agents (Universal)"});let H=await K0({message:"Which coding agents do you use? (space to select, enter to confirm)",options:Q,initialValues:Z?.agents??[],required:!0});if(q1(H)){Eq("Setup cancelled.");return}if(H.length===0)return B1.error("At least one agent must be selected."),D0(q);let z=await j4({message:"How should dependencies be installed?",options:[{value:"link",label:"Link (symlinks)",hint:"Fast, no duplication — default"},{value:"copy",label:"Copy (smart sync)",hint:"Portable, self-contained"}],initialValue:Z?.install_method??"link"});if(q1(z)){Eq("Setup cancelled.");return}return t5("✅ Configuration saved!"),{clone_method:X,agents:H,install_method:z,custom_agents:Z?.custom_agents}}import{join as u4}from"node:path";import{mkdir as xG,readFile as kG,writeFile as vG,access as hG}from"node:fs/promises";import{dirname as gG}from"node:path";function uG(q,Z){if(!q.repo)throw Error(`Dependency at index ${Z} is missing required 'repo' field`);let X;if(q.skills===void 0||q.skills==="*"||q.skills===!0)X="*";else if(q.skills===!1)X=!1;else if(Array.isArray(q.skills))X=q.skills;else rq("config.normalize",`Dependency "${q.repo}" has unexpected skills value (${JSON.stringify(q.skills)}), defaulting to "*"`),X="*";let J;if(q.agents===void 0||q.agents==="*"||q.agents===!0)J="*";else if(q.agents===!1)J=!1;else if(Array.isArray(q.agents))J=q.agents;else rq("config.normalize",`Dependency "${q.repo}" has unexpected agents value (${JSON.stringify(q.agents)}), defaulting to "*"`),J="*";return{repo:q.repo,ref:q.ref??"main",skills:X,agents:J}}async function c(q){try{return await hG(q),!0}catch{return!1}}async function i(q){let Z=await kG(q,"utf-8"),X=_0(Z);if(!X||!X.dependencies){if(X&&!X.dependencies)console.warn("⚠ agents.yaml has no 'dependencies' field");return{dependencies:[]}}let J=X.dependencies;if(!Array.isArray(J))throw Error("'dependencies' must be an array in agents.yaml");if(J.length===0)return console.warn("⚠ agents.yaml has an empty dependencies list"),{dependencies:[]};return{dependencies:J.map((Q,H)=>uG(Q,H))}}async function fq(q,Z){let X=gG(q);await xG(X,{recursive:!0});let J={dependencies:Z.dependencies.map((Q)=>{let H={repo:Q.repo};if(Q.ref!=="main")H.ref=Q.ref;if(Q.skills!=="*")H.skills=Q.skills;if(Q.agents!=="*")H.agents=Q.agents;return H})},$=W0(J,{lineWidth:0});await vG(q,$,"utf-8")}function mG(q){if(q.includes("://"))return!1;if(q.startsWith("git@"))return!1;return q.split("/").length-1===1}function dG(q,Z){if(Z==="ssh")return`git@github.com:${q}.git`;return`https://github.com/${q}.git`}function yq(q,Z){if(mG(q))return dG(q,Z);return q}function xq(q,Z){let X;if(q.startsWith("git@")){let $=q.indexOf(":");X=q.slice($+1)}else if(q.includes("://"))try{X=new URL(q).pathname.slice(1)}catch{X=q}else X=q;if(X.endsWith(".git"))X=X.slice(0,-4);return`${X.replace(/\//g,"-")}-${Z}`}import{readdir as H6,access as lG}from"node:fs/promises";import{join as u1}from"node:path";async function kq(q){let Z=u1(q,"skills");try{let J=(await H6(Z,{withFileTypes:!0})).filter((Q)=>Q.isDirectory());return(await Promise.all(J.map(async(Q)=>{let H;try{await lG(u1(Z,Q.name,"SKILL.md")),H=!0}catch{H=!1}return H?{name:Q.name,sourcePath:u1(Z,Q.name)}:null}))).filter((Q)=>Q!==null).sort((Q,H)=>Q.name.localeCompare(H.name))}catch{return[]}}async function vq(q){let Z=u1(q,"agents");try{let X=await H6(Z,{withFileTypes:!0}),J=[];for(let $ of X)if($.isDirectory())J.push({name:$.name,sourcePath:u1(Z,$.name)});else if($.isFile()&&$.name.endsWith(".md")){let Q=$.name.replace(/\.md$/,"");J.push({name:Q,sourcePath:u1(Z,$.name)})}return J.sort(($,Q)=>$.name.localeCompare(Q.name))}catch{return[]}}function C4(q,Z){if(Z===!1)return{selected:[],missing:[]};if(Z==="*")return{selected:[...q],missing:[]};let X=new Map(q.map((Q)=>[Q.name,Q])),J=[],$=[];for(let Q of Z){let H=X.get(Q);if(H)J.push(H);else $.push(Q)}return{selected:J,missing:$}}function f4(q,Z,X,J,$){if(J===!1)return;if(X.length===0)console.warn(`⚠ No ${Z} found in ${q}${Z==="skills"?" (no skills/ directory or no SKILL.md files)":" (no agents/ directory)"}`);if($.length>0)console.warn(`⚠ ${Z} not found in ${q}: ${$.join(", ")}`)}import{readdir as T6,mkdir as qY,rm as _6,lstat as ZY,stat as XY}from"node:fs/promises";import{join as v4}from"node:path";import{homedir as JY}from"node:os";import{symlink as pG,readlink as cG,unlink as iG,lstat as z6,rm as aG}from"node:fs/promises";import{platform as sG}from"node:os";import{execFile as rG}from"node:child_process";import{promisify as nG}from"node:util";var oG=nG(rG);async function y4(q,Z){let X=!1;try{X=(await z6(q)).isFile()}catch{}try{await pG(q,Z,X?"file":"dir")}catch(J){if(sG()==="win32"&&!X)try{await oG("cmd",["/c","mklink","/J",Z,q])}catch($){let Q=$ instanceof Error?$.message:String($);throw Error(`Failed to create symlink or junction at ${Z}. Consider switching to install_method: copy, or enable Developer Mode on Windows. Error: ${Q.trim()}`)}else throw J}}async function U6(q,Z){try{if((await z6(Z)).isSymbolicLink()){if(await cG(Z)===q)return"unchanged";return await iG(Z),await y4(q,Z),"replaced"}return await aG(Z,{recursive:!0,force:!0}),await y4(q,Z),"replaced"}catch(X){if(X.code==="ENOENT")return await y4(q,Z),"created";throw X}}import{readdir as G6,mkdir as tG,rm as eG,stat as k4,copyFile as Y6}from"node:fs/promises";import{join as x4}from"node:path";async function hq(q,Z){if((await k4(q)).isFile()){if(await B6(q,Z))await Y6(q,Z);return}await tG(Z,{recursive:!0});let J=await G6(q,{withFileTypes:!0}),$=new Set(J.map((H)=>H.name)),Q=[];try{Q=await G6(Z,{withFileTypes:!0})}catch{}for(let H of Q)if(!$.has(H.name))await eG(x4(Z,H.name),{recursive:!0,force:!0});for(let H of J){let z=x4(q,H.name),U=x4(Z,H.name);if(H.isDirectory())await hq(z,U);else if(H.isFile()){if(await B6(z,U))await Y6(z,U)}}}async function B6(q,Z){try{let[X,J]=await Promise.all([k4(q),k4(Z)]);if(X.size!==J.size)return!0;if(X.mtimeMs>J.mtimeMs)return!0;return!1}catch{return!0}}function h4(q){if(q.startsWith("~/")||q==="~")return v4(JY(),q.slice(1));return q}async function $Y(q,Z){try{if((await XY(Z)).isFile()){let J=Z.match(/(\.[^.]+)$/)?.[1]??"";return q+J}}catch{}return q}async function g4(q,Z,X){let J={added:[],removed:[],unchanged:[]},$=[],Q=!1;try{$=await T6(q),Q=!0}catch{}if(Z.size===0&&!Q)return J;let H=[];for(let[U,G]of Z){let T=await $Y(U,G);H.push({name:U,targetName:T,sourcePath:G})}let z=new Set(H.map((U)=>U.targetName));for(let U of $)if(!z.has(U))await _6(v4(q,U),{recursive:!0,force:!0}),J.removed.push(U);if(Z.size===0){try{if((await T6(q)).length===0)await _6(q,{recursive:!0,force:!0})}catch{}return J}await qY(q,{recursive:!0});for(let{name:U,targetName:G,sourcePath:T}of H){let Y=v4(q,G);if(X==="link"){let _=await U6(T,Y);if(_==="created")J.added.push(U);else if(_==="replaced")J.added.push(U);else J.unchanged.push(U)}else try{await ZY(Y),await hq(T,Y),J.unchanged.push(U)}catch{await hq(T,Y),J.added.push(U)}}return J}import{rm as W6}from"node:fs/promises";import{join as L6}from"node:path";var V6="_agentdeps_managed";async function R6(q){let Z=X6(q);for(let{skills:X,agents:J}of Z)await W6(L6(X,V6),{recursive:!0,force:!0}),await W6(L6(J,V6),{recursive:!0,force:!0})}async function I6(q,Z){let X=await Promise.all(q.map(async($)=>{let Q=yq($.repo,Z),H=xq($.repo,$.ref);console.log(` \uD83D\uDCE6 ${$.repo} (${$.ref})`);let z=await w0(Q,$.ref,H);return{dep:$,result:z}}));return(await Promise.all(X.map(async({dep:$,result:Q})=>{if(!Q.success)return console.error(` ✗ Failed to cache ${$.repo}, skipping`),null;let[H,z]=await Promise.all([kq(Q.path),vq(Q.path)]),U=C4(H,$.skills),G=C4(z,$.agents);return f4($.repo,"skills",H,$.skills,U.missing),f4($.repo,"agents",z,$.agents,G.missing),{repo:$.repo,cachePath:Q.path,skills:U.selected,agents:G.selected}}))).filter(($)=>$!==null)}async function M6(q,Z,X,J){let $=new Map,Q=new Map;for(let U of q){for(let G of U.skills)$.set(G.name,G.sourcePath);for(let G of U.agents)Q.set(G.name,G.sourcePath)}let H=new Map;for(let U of Z){let G=X==="global"?h4(U.globalSkills):U.projectSkills,T=X==="global"?h4(U.globalAgents):U.projectAgents,Y=`${G}|${T}`,_=H.get(Y);if(_)_.displayNames.push(...U.displayNames);else H.set(Y,{skillsDir:G,agentsDir:T,displayNames:[...U.displayNames]})}let z=[];for(let{skillsDir:U,agentsDir:G,displayNames:T}of H.values()){let Y=u4(U,"_agentdeps_managed"),_=u4(G,"_agentdeps_managed"),V=await g4(Y,$,J),L=await g4(_,Q,J);z.push({displayNames:T,skillsAdded:V.added.length,skillsRemoved:V.removed.length,agentsAdded:L.added.length,agentsRemoved:L.removed.length})}return z}function K6(q,Z){if(Z.length===0)return` ✓ ${q}: nothing to do`;if(Z.length===1){let J=Z[0],$=J.skillsRemoved+J.agentsRemoved,Q=[];if(J.skillsAdded>0)Q.push(`${J.skillsAdded} skills added`);if(J.agentsAdded>0)Q.push(`${J.agentsAdded} agents added`);if($>0)Q.push(`${$} removed`);if(Q.length===0)Q.push("up to date");let H=J.displayNames.join(", ");return` ✓ ${q} (${H}): ${Q.join(", ")}`}let X=[];for(let J of Z){let $=J.skillsRemoved+J.agentsRemoved,Q=[];if(J.skillsAdded>0)Q.push(`${J.skillsAdded} skills added`);if(J.agentsAdded>0)Q.push(`${J.agentsAdded} agents added`);if($>0)Q.push(`${$} removed`);if(Q.length===0)Q.push("up to date");let H=J.displayNames.join(", ");X.push(` ${H}: ${Q.join(", ")}`)}return` ✓ ${q}:
232
232
  ${X.join(`
233
- `)}`}async function P0(q){if(q.custom_agents)Cq(q.custom_agents);let Z=Z6(q.agents);if(Z.length>0)console.warn(`⚠ Unknown agents in config: ${Z.join(", ")}`);let X=X6(q.agents),J=h1();try{if(await c(J)){console.log(`
234
- \uD83C\uDF10 Processing global dependencies...`);let Q=await i(J);if(Q.dependencies.length>0){let H=await T6(Q.dependencies,q.clone_method),U=await _6(H,X,"global",q.install_method);console.log(L6("Global",U))}}}catch(Q){o("global-deps",Q),console.warn("⚠ Failed to process global dependencies")}let $=g4(process.cwd(),"agents.yaml");if(await c($)){console.log(`
235
- \uD83D\uDCC1 Processing project dependencies...`);let Q=await i($);if(Q.dependencies.length>0){let H=await T6(Q.dependencies,q.clone_method),U=await _6(H,X,"project",q.install_method);console.log(L6("Project",U))}else console.log(" ℹ No project dependencies defined")}else console.log(`
233
+ `)}`}async function P0(q){if(q.custom_agents)Cq(q.custom_agents);let Z=J6(q.agents);if(Z.length>0)console.warn(`⚠ Unknown agents in config: ${Z.join(", ")}`);let X=$6(q.agents);await R6(q.agents);let J=h1();try{if(await c(J)){console.log(`
234
+ \uD83C\uDF10 Processing global dependencies...`);let Q=await i(J);if(Q.dependencies.length>0){let H=await I6(Q.dependencies,q.clone_method),z=await M6(H,X,"global",q.install_method);console.log(K6("Global",z))}}}catch(Q){o("global-deps",Q),console.warn("⚠ Failed to process global dependencies")}let $=u4(process.cwd(),"agents.yaml");if(await c($)){console.log(`
235
+ \uD83D\uDCC1 Processing project dependencies...`);let Q=await i($);if(Q.dependencies.length>0){let H=await I6(Q.dependencies,q.clone_method),z=await M6(H,X,"project",q.install_method);console.log(K6("Project",z))}else console.log(" ℹ No project dependencies defined")}else console.log(`
236
236
  ℹ No project agents.yaml found — only global dependencies processed`);console.log(`
237
- ✅ Install complete`),S0()}var W6=new h("install").description("Install dependencies from agents.yaml").action(async()=>{let q=await Y1();await P0(q)});import{join as eG}from"node:path";var I6=new h("add").description("Add a new dependency to agents.yaml").argument("<repo>","Repository (owner/repo or full URL)").option("--ref <ref>","Git ref (branch, tag, SHA)","main").option("--skill <name>","Install specific skill (repeatable)",V6,[]).option("--agent <name>","Install specific agent (repeatable)",V6,[]).option("--all","Install all skills and agents").option("--all-skills","Install all skills").option("--all-agents","Install all agents").option("--no-skills","Don't install any skills").option("--no-agents","Don't install any agents").option("-g, --global","Add dependency to global agents.yaml instead of project").action(async(q,Z)=>{let X=await Y1(),J=!!Z.global,$=J?h1():eG(process.cwd(),"agents.yaml"),Q=J?"global":"project",H;if(await c($))H=(await i($)).dependencies.find((M)=>M.repo===q||gq(M.repo)===gq(q));let U=yq(q,X.clone_method),z=xq(q,Z.ref);console.log(`\uD83D\uDCE6 Fetching ${q}...`);let G=await w0(U,Z.ref,z);if(!G.success)console.error(`✗ Failed to clone ${q}`),process.exit(1);let[T,Y]=await Promise.all([kq(G.path),vq(G.path)]);console.log(` Found ${T.length} skill(s), ${Y.length} agent(s)`);let _,V;if(Z.all)_="*",V="*";else if(Z.skill.length>0||Z.agent.length>0||Z.allSkills||Z.allAgents||Z.skills===!1||Z.agents===!1){if(Z.skills===!1)_=!1;else if(Z.allSkills)_="*";else if(Z.skill.length>0)_=Z.skill;else _="*";if(Z.agents===!1)V=!1;else if(Z.allAgents)V="*";else if(Z.agent.length>0)V=Z.agent;else V="*"}else{let I=await qY(T,Y,H);if(!I)return;_=I.skills,V=I.agents}let W={repo:q,ref:Z.ref,skills:_,agents:V},B=await c($)?await i($):{dependencies:[]};if(H){let I=B.dependencies.findIndex((M)=>M.repo===q||gq(M.repo)===gq(q));B.dependencies[I]=W}else B.dependencies.push(W);await fq($,B),console.log(`
238
- ✓ ${H?"Updated":"Added"} ${q} in ${Q} agents.yaml`),await P0(X)});function V6(q,Z){return Z.concat([q])}function gq(q){return q.replace(/\.git$/,"").toLowerCase()}function R6(q,Z){if(Z===void 0||Z==="*")return q;if(Z===!1)return[];return Z.filter((X)=>q.includes(X))}async function qY(q,Z,X){let J={skills:"*",agents:"*"};if(q.length>0){let $=q.map((U)=>U.name),Q=await K0({message:"Select skills to install (press 'a' to toggle all):",options:$.map((U)=>({value:U,label:U})),initialValues:R6($,X?.skills),required:!1});if(q1(Q))return;let H=Q;if(H.length===$.length)J.skills="*";else if(H.length===0)J.skills=!1;else J.skills=H}else J.skills=!1;if(Z.length>0){let $=Z.map((U)=>U.name),Q=await K0({message:"Select agents to install (press 'a' to toggle all):",options:$.map((U)=>({value:U,label:U})),initialValues:R6($,X?.agents),required:!1});if(q1(Q))return;let H=Q;if(H.length===$.length)J.agents="*";else if(H.length===0)J.agents=!1;else J.agents=H}else J.agents=!1;return J}import{join as ZY}from"node:path";var K6=new h("remove").description("Remove a dependency from agents.yaml").argument("<repo>","Repository to remove (owner/repo or full URL)").action(async(q)=>{let Z=await Y1(),X=ZY(process.cwd(),"agents.yaml");if(!await c(X))console.error("✗ No agents.yaml found in current directory"),process.exit(1);let J=await i(X),$=M6(q),Q=J.dependencies.findIndex((U)=>M6(U.repo)===$);if(Q===-1)console.error(`✗ ${q} not found in agents.yaml`),process.exit(1);let[H]=J.dependencies.splice(Q,1);if(!H)console.error(`✗ Unexpected error removing ${q}`),process.exit(1);await fq(X,J),console.log(`✓ Removed ${H.repo} from agents.yaml`),await P0(Z)});function M6(q){return q.replace(/\.git$/,"").toLowerCase()}import{join as XY}from"node:path";var P6=new h("list").description("List installed dependencies").action(async()=>{let q=await Y1(),Z=!1,X=h1();if(await c(X)){let $=await i(X);if($.dependencies.length>0)Z=!0,console.log(`\uD83C\uDF10 Global dependencies:
239
- `),D6($.dependencies,q.agents)}let J=XY(process.cwd(),"agents.yaml");if(await c(J)){let $=await i(J);if($.dependencies.length>0)Z=!0,console.log(`\uD83D\uDCC1 Project dependencies:
240
- `),D6($.dependencies,q.agents)}if(!Z)console.log(`No dependencies configured.
237
+ ✅ Install complete`),A0()}var D6=new h("install").description("Install dependencies from agents.yaml").action(async()=>{let q=await Y1();await P0(q)});import{join as QY}from"node:path";var O6=new h("add").description("Add a new dependency to agents.yaml").argument("<repo>","Repository (owner/repo or full URL)").option("--ref <ref>","Git ref (branch, tag, SHA)","main").option("--skill <name>","Install specific skill (repeatable)",P6,[]).option("--agent <name>","Install specific agent (repeatable)",P6,[]).option("--all","Install all skills and agents").option("--all-skills","Install all skills").option("--all-agents","Install all agents").option("--no-skills","Don't install any skills").option("--no-agents","Don't install any agents").option("-g, --global","Add dependency to global agents.yaml instead of project").action(async(q,Z)=>{let X=await Y1(),J=!!Z.global,$=J?h1():QY(process.cwd(),"agents.yaml"),Q=J?"global":"project",H;if(await c($))H=(await i($)).dependencies.find((M)=>M.repo===q||gq(M.repo)===gq(q));let z=yq(q,X.clone_method),U=xq(q,Z.ref);console.log(`\uD83D\uDCE6 Fetching ${q}...`);let G=await w0(z,Z.ref,U);if(!G.success)console.error(`✗ Failed to clone ${q}`),process.exit(1);let[T,Y]=await Promise.all([kq(G.path),vq(G.path)]);console.log(` Found ${T.length} skill(s), ${Y.length} agent(s)`);let _,V;if(Z.all)_="*",V="*";else if(Z.skill.length>0||Z.agent.length>0||Z.allSkills||Z.allAgents||Z.skills===!1||Z.agents===!1){if(Z.skills===!1)_=!1;else if(Z.allSkills)_="*";else if(Z.skill.length>0)_=Z.skill;else _="*";if(Z.agents===!1)V=!1;else if(Z.allAgents)V="*";else if(Z.agent.length>0)V=Z.agent;else V="*"}else{let I=await HY(T,Y,H);if(!I)return;_=I.skills,V=I.agents}let L={repo:q,ref:Z.ref,skills:_,agents:V},B=await c($)?await i($):{dependencies:[]};if(H){let I=B.dependencies.findIndex((M)=>M.repo===q||gq(M.repo)===gq(q));B.dependencies[I]=L}else B.dependencies.push(L);await fq($,B),console.log(`
238
+ ✓ ${H?"Updated":"Added"} ${q} in ${Q} agents.yaml`),await P0(X)});function P6(q,Z){return Z.concat([q])}function gq(q){return q.replace(/\.git$/,"").toLowerCase()}function F6(q,Z){if(Z===void 0||Z==="*")return q;if(Z===!1)return[];return Z.filter((X)=>q.includes(X))}async function HY(q,Z,X){let J={skills:"*",agents:"*"};if(q.length>0){let $=q.map((z)=>z.name),Q=await K0({message:"Select skills to install (press 'a' to toggle all):",options:$.map((z)=>({value:z,label:z})),initialValues:F6($,X?.skills),required:!1});if(q1(Q))return;let H=Q;if(H.length===$.length)J.skills="*";else if(H.length===0)J.skills=!1;else J.skills=H}else J.skills=!1;if(Z.length>0){let $=Z.map((z)=>z.name),Q=await K0({message:"Select agents to install (press 'a' to toggle all):",options:$.map((z)=>({value:z,label:z})),initialValues:F6($,X?.agents),required:!1});if(q1(Q))return;let H=Q;if(H.length===$.length)J.agents="*";else if(H.length===0)J.agents=!1;else J.agents=H}else J.agents=!1;return J}import{join as zY}from"node:path";var S6=new h("remove").description("Remove a dependency from agents.yaml").argument("<repo>","Repository to remove (owner/repo or full URL)").action(async(q)=>{let Z=await Y1(),X=zY(process.cwd(),"agents.yaml");if(!await c(X))console.error("✗ No agents.yaml found in current directory"),process.exit(1);let J=await i(X),$=N6(q),Q=J.dependencies.findIndex((z)=>N6(z.repo)===$);if(Q===-1)console.error(`✗ ${q} not found in agents.yaml`),process.exit(1);let[H]=J.dependencies.splice(Q,1);if(!H)console.error(`✗ Unexpected error removing ${q}`),process.exit(1);await fq(X,J),console.log(`✓ Removed ${H.repo} from agents.yaml`),await P0(Z)});function N6(q){return q.replace(/\.git$/,"").toLowerCase()}import{join as UY}from"node:path";var w6=new h("list").description("List installed dependencies").action(async()=>{let q=await Y1(),Z=!1,X=h1();if(await c(X)){let $=await i(X);if($.dependencies.length>0)Z=!0,console.log(`\uD83C\uDF10 Global dependencies:
239
+ `),A6($.dependencies,q.agents)}let J=UY(process.cwd(),"agents.yaml");if(await c(J)){let $=await i(J);if($.dependencies.length>0)Z=!0,console.log(`\uD83D\uDCC1 Project dependencies:
240
+ `),A6($.dependencies,q.agents)}if(!Z)console.log(`No dependencies configured.
241
241
 
242
242
  Add one with:
243
243
  agentdeps add <owner/repo>
244
244
 
245
- Or create agents.yaml manually.`)});function D6(q,Z){for(let X of q){if(console.log(` ${X.repo} (ref: ${X.ref})`),X.skills==="*")console.log(" skills: all");else if(X.skills===!1)console.log(" skills: none");else console.log(` skills: ${X.skills.join(", ")}`);if(X.agents==="*")console.log(" agents: all");else if(X.agents===!1)console.log(" agents: none");else console.log(` agents: ${X.agents.join(", ")}`);console.log(` targets: ${Z.join(", ")}`),console.log()}}var F6=new h("config").description("Configure agentdeps (re-run interactive setup)").action(async()=>{let q=void 0;try{q=await z4()}catch(X){o("config.load",X),console.warn("⚠ Existing config is invalid, starting fresh")}if(q?.custom_agents)Cq(q.custom_agents);let Z=await D0({defaults:q});if(!Z)return;if(q?.custom_agents&&!Z.custom_agents)Z.custom_agents=q.custom_agents;await Rq(Z),console.log(`
246
- ✓ Configuration saved`)});var O6="0.4.0";var T1=new h().name("agentdeps").version(O6).description("Declarative dependency manager for AI coding agent skills and subagents"),JY=new Set(["install","add","remove","list"]);T1.hook("preAction",async(q,Z)=>{let X=Z.name();if(!JY.has(X))return;if(!await Y2())console.error(`✗ git is not installed or not in PATH.
245
+ Or create agents.yaml manually.`)});function A6(q,Z){for(let X of q){if(console.log(` ${X.repo} (ref: ${X.ref})`),X.skills==="*")console.log(" skills: all");else if(X.skills===!1)console.log(" skills: none");else console.log(` skills: ${X.skills.join(", ")}`);if(X.agents==="*")console.log(" agents: all");else if(X.agents===!1)console.log(" agents: none");else console.log(` agents: ${X.agents.join(", ")}`);console.log(` targets: ${Z.join(", ")}`),console.log()}}var b6=new h("config").description("Configure agentdeps (re-run interactive setup)").action(async()=>{let q=void 0;try{q=await U4()}catch(X){o("config.load",X),console.warn("⚠ Existing config is invalid, starting fresh")}if(q?.custom_agents)Cq(q.custom_agents);let Z=await D0({defaults:q});if(!Z)return;if(q?.custom_agents&&!Z.custom_agents)Z.custom_agents=q.custom_agents;await Rq(Z),console.log(`
246
+ ✓ Configuration saved`)});var j6="0.5.0";var T1=new h().name("agentdeps").version(j6).description("Declarative dependency manager for AI coding agent skills and subagents"),GY=new Set(["install","add","remove","list"]);T1.hook("preAction",async(q,Z)=>{let X=Z.name();if(!GY.has(X))return;if(!await T2())console.error(`✗ git is not installed or not in PATH.
247
247
  `+` agentdeps requires git to clone and update repositories.
248
- Install git: https://git-scm.com/downloads`),process.exit(1);if(!await K5()){if(!J6())console.error(`✗ No configuration found and terminal is not interactive.
248
+ Install git: https://git-scm.com/downloads`),process.exit(1);if(!await P5()){if(!Q6())console.error(`✗ No configuration found and terminal is not interactive.
249
249
  `+" Run `agentdeps config` in an interactive terminal first."),process.exit(1);console.log(`Welcome to agentdeps! Let's set up your configuration.
250
- `);let Q=await D0();if(!Q)process.exit(1);await Rq(Q)}});T1.addCommand(W6);T1.addCommand(I6);T1.addCommand(K6);T1.addCommand(P6);T1.addCommand(F6);T1.parse();
250
+ `);let Q=await D0();if(!Q)process.exit(1);await Rq(Q)}});T1.addCommand(D6);T1.addCommand(O6);T1.addCommand(S6);T1.addCommand(w6);T1.addCommand(b6);T1.parse();