@pickled-dev/cli 0.2.0 → 0.3.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 +48 -26
  2. package/dist/index.js +168 -137
  3. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,114 +1,114 @@
1
1
  #!/usr/bin/env bun
2
2
  // @bun
3
- import{createRequire as fG}from"node:module";var yG=Object.create;var{getPrototypeOf:xG,defineProperty:D5,getOwnPropertyNames:gG}=Object;var hG=Object.prototype.hasOwnProperty;var Z5=(X,Q,J)=>{J=X!=null?yG(xG(X)):{};let Y=Q||!X||!X.__esModule?D5(J,"default",{value:X,enumerable:!0}):J;for(let G of gG(X))if(!hG.call(Y,G))D5(Y,G,{get:()=>X[G],enumerable:!0});return Y};var p=(X,Q)=>()=>(Q||X((Q={exports:{}}).exports,Q),Q.exports);var O1=fG(import.meta.url);var v9=p((uG)=>{class HX extends Error{constructor(X,Q,J){super(J);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=Q,this.exitCode=X,this.nestedError=void 0}}class O5 extends HX{constructor(X){super(1,"commander.invalidArgument",X);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}uG.CommanderError=HX;uG.InvalidArgumentError=O5});var k8=p((dG)=>{var{InvalidArgumentError:cG}=v9();class A5{constructor(X,Q){switch(this.description=Q||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,X[0]){case"<":this.required=!0,this._name=X.slice(1,-1);break;case"[":this.required=!1,this._name=X.slice(1,-1);break;default:this.required=!0,this._name=X;break}if(this._name.endsWith("..."))this.variadic=!0,this._name=this._name.slice(0,-3)}name(){return this._name}_collectValue(X,Q){if(Q===this.defaultValue||!Array.isArray(Q))return[X];return Q.push(X),Q}default(X,Q){return this.defaultValue=X,this.defaultValueDescription=Q,this}argParser(X){return this.parseArg=X,this}choices(X){return this.argChoices=X.slice(),this.parseArg=(Q,J)=>{if(!this.argChoices.includes(Q))throw new cG(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(Q,J);return Q},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function pG(X){let Q=X.name()+(X.variadic===!0?"...":"");return X.required?"<"+Q+">":"["+Q+"]"}dG.Argument=A5;dG.humanReadableArgName=pG});var UX=p((oG)=>{var{humanReadableArgName:rG}=k8();class N5{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(X){this.helpWidth=this.helpWidth??X.helpWidth??80}visibleCommands(X){let Q=X.commands.filter((Y)=>!Y._hidden),J=X._getHelpCommand();if(J&&!J._hidden)Q.push(J);if(this.sortSubcommands)Q.sort((Y,G)=>{return Y.name().localeCompare(G.name())});return Q}compareOptions(X,Q){let J=(Y)=>{return Y.short?Y.short.replace(/^-/,""):Y.long.replace(/^--/,"")};return J(X).localeCompare(J(Q))}visibleOptions(X){let Q=X.options.filter((Y)=>!Y.hidden),J=X._getHelpOption();if(J&&!J.hidden){let Y=J.short&&X._findOption(J.short),G=J.long&&X._findOption(J.long);if(!Y&&!G)Q.push(J);else if(J.long&&!G)Q.push(X.createOption(J.long,J.description));else if(J.short&&!Y)Q.push(X.createOption(J.short,J.description))}if(this.sortOptions)Q.sort(this.compareOptions);return Q}visibleGlobalOptions(X){if(!this.showGlobalOptions)return[];let Q=[];for(let J=X.parent;J;J=J.parent){let Y=J.options.filter((G)=>!G.hidden);Q.push(...Y)}if(this.sortOptions)Q.sort(this.compareOptions);return Q}visibleArguments(X){if(X._argsDescription)X.registeredArguments.forEach((Q)=>{Q.description=Q.description||X._argsDescription[Q.name()]||""});if(X.registeredArguments.find((Q)=>Q.description))return X.registeredArguments;return[]}subcommandTerm(X){let Q=X.registeredArguments.map((J)=>rG(J)).join(" ");return X._name+(X._aliases[0]?"|"+X._aliases[0]:"")+(X.options.length?" [options]":"")+(Q?" "+Q:"")}optionTerm(X){return X.flags}argumentTerm(X){return X.name()}longestSubcommandTermLength(X,Q){return Q.visibleCommands(X).reduce((J,Y)=>{return Math.max(J,this.displayWidth(Q.styleSubcommandTerm(Q.subcommandTerm(Y))))},0)}longestOptionTermLength(X,Q){return Q.visibleOptions(X).reduce((J,Y)=>{return Math.max(J,this.displayWidth(Q.styleOptionTerm(Q.optionTerm(Y))))},0)}longestGlobalOptionTermLength(X,Q){return Q.visibleGlobalOptions(X).reduce((J,Y)=>{return Math.max(J,this.displayWidth(Q.styleOptionTerm(Q.optionTerm(Y))))},0)}longestArgumentTermLength(X,Q){return Q.visibleArguments(X).reduce((J,Y)=>{return Math.max(J,this.displayWidth(Q.styleArgumentTerm(Q.argumentTerm(Y))))},0)}commandUsage(X){let Q=X._name;if(X._aliases[0])Q=Q+"|"+X._aliases[0];let J="";for(let Y=X.parent;Y;Y=Y.parent)J=Y.name()+" "+J;return J+Q+" "+X.usage()}commandDescription(X){return X.description()}subcommandDescription(X){return X.summary()||X.description()}optionDescription(X){let Q=[];if(X.argChoices)Q.push(`choices: ${X.argChoices.map((J)=>JSON.stringify(J)).join(", ")}`);if(X.defaultValue!==void 0){if(X.required||X.optional||X.isBoolean()&&typeof X.defaultValue==="boolean")Q.push(`default: ${X.defaultValueDescription||JSON.stringify(X.defaultValue)}`)}if(X.presetArg!==void 0&&X.optional)Q.push(`preset: ${JSON.stringify(X.presetArg)}`);if(X.envVar!==void 0)Q.push(`env: ${X.envVar}`);if(Q.length>0){let J=`(${Q.join(", ")})`;if(X.description)return`${X.description} ${J}`;return J}return X.description}argumentDescription(X){let Q=[];if(X.argChoices)Q.push(`choices: ${X.argChoices.map((J)=>JSON.stringify(J)).join(", ")}`);if(X.defaultValue!==void 0)Q.push(`default: ${X.defaultValueDescription||JSON.stringify(X.defaultValue)}`);if(Q.length>0){let J=`(${Q.join(", ")})`;if(X.description)return`${X.description} ${J}`;return J}return X.description}formatItemList(X,Q,J){if(Q.length===0)return[];return[J.styleTitle(X),...Q,""]}groupItems(X,Q,J){let Y=new Map;return X.forEach((G)=>{let $=J(G);if(!Y.has($))Y.set($,[])}),Q.forEach((G)=>{let $=J(G);if(!Y.has($))Y.set($,[]);Y.get($).push(G)}),Y}formatHelp(X,Q){let J=Q.padWidth(X,Q),Y=Q.helpWidth??80;function G(F,K){return Q.formatItem(F,J,K,Q)}let $=[`${Q.styleTitle("Usage:")} ${Q.styleUsage(Q.commandUsage(X))}`,""],W=Q.commandDescription(X);if(W.length>0)$=$.concat([Q.boxWrap(Q.styleCommandDescription(W),Y),""]);let H=Q.visibleArguments(X).map((F)=>{return G(Q.styleArgumentTerm(Q.argumentTerm(F)),Q.styleArgumentDescription(Q.argumentDescription(F)))});if($=$.concat(this.formatItemList("Arguments:",H,Q)),this.groupItems(X.options,Q.visibleOptions(X),(F)=>F.helpGroupHeading??"Options:").forEach((F,K)=>{let M=F.map((R)=>{return G(Q.styleOptionTerm(Q.optionTerm(R)),Q.styleOptionDescription(Q.optionDescription(R)))});$=$.concat(this.formatItemList(K,M,Q))}),Q.showGlobalOptions){let F=Q.visibleGlobalOptions(X).map((K)=>{return G(Q.styleOptionTerm(Q.optionTerm(K)),Q.styleOptionDescription(Q.optionDescription(K)))});$=$.concat(this.formatItemList("Global Options:",F,Q))}return this.groupItems(X.commands,Q.visibleCommands(X),(F)=>F.helpGroup()||"Commands:").forEach((F,K)=>{let M=F.map((R)=>{return G(Q.styleSubcommandTerm(Q.subcommandTerm(R)),Q.styleSubcommandDescription(Q.subcommandDescription(R)))});$=$.concat(this.formatItemList(K,M,Q))}),$.join(`
4
- `)}displayWidth(X){return R5(X).length}styleTitle(X){return X}styleUsage(X){return X.split(" ").map((Q)=>{if(Q==="[options]")return this.styleOptionText(Q);if(Q==="[command]")return this.styleSubcommandText(Q);if(Q[0]==="["||Q[0]==="<")return this.styleArgumentText(Q);return this.styleCommandText(Q)}).join(" ")}styleCommandDescription(X){return this.styleDescriptionText(X)}styleOptionDescription(X){return this.styleDescriptionText(X)}styleSubcommandDescription(X){return this.styleDescriptionText(X)}styleArgumentDescription(X){return this.styleDescriptionText(X)}styleDescriptionText(X){return X}styleOptionTerm(X){return this.styleOptionText(X)}styleSubcommandTerm(X){return X.split(" ").map((Q)=>{if(Q==="[options]")return this.styleOptionText(Q);if(Q[0]==="["||Q[0]==="<")return this.styleArgumentText(Q);return this.styleSubcommandText(Q)}).join(" ")}styleArgumentTerm(X){return this.styleArgumentText(X)}styleOptionText(X){return X}styleArgumentText(X){return X}styleSubcommandText(X){return X}styleCommandText(X){return X}padWidth(X,Q){return Math.max(Q.longestOptionTermLength(X,Q),Q.longestGlobalOptionTermLength(X,Q),Q.longestSubcommandTermLength(X,Q),Q.longestArgumentTermLength(X,Q))}preformatted(X){return/\n[^\S\r\n]/.test(X)}formatItem(X,Q,J,Y){let $=" ".repeat(2);if(!J)return $+X;let W=X.padEnd(Q+X.length-Y.displayWidth(X)),H=2,z=(this.helpWidth??80)-Q-H-2,F;if(z<this.minWidthToWrap||Y.preformatted(J))F=J;else F=Y.boxWrap(J,z).replace(/\n/g,`
5
- `+" ".repeat(Q+H));return $+W+" ".repeat(H)+F.replace(/\n/g,`
6
- ${$}`)}boxWrap(X,Q){if(Q<this.minWidthToWrap)return X;let J=X.split(/\r\n|\n/),Y=/[\s]*[^\s]+/g,G=[];return J.forEach(($)=>{let W=$.match(Y);if(W===null){G.push("");return}let H=[W.shift()],U=this.displayWidth(H[0]);W.forEach((z)=>{let F=this.displayWidth(z);if(U+F<=Q){H.push(z),U+=F;return}G.push(H.join(""));let K=z.trimStart();H=[K],U=this.displayWidth(K)}),G.push(H.join(""))}),G.join(`
7
- `)}}function R5(X){let Q=/\x1b\[\d*(;\d*)*m/g;return X.replace(Q,"")}oG.Help=N5;oG.stripColor=R5});var zX=p((X$)=>{var{InvalidArgumentError:tG}=v9();class j5{constructor(X,Q){this.flags=X,this.description=Q||"",this.required=X.includes("<"),this.optional=X.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(X),this.mandatory=!1;let J=eG(X);if(this.short=J.shortFlag,this.long=J.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(X,Q){return this.defaultValue=X,this.defaultValueDescription=Q,this}preset(X){return this.presetArg=X,this}conflicts(X){return this.conflictsWith=this.conflictsWith.concat(X),this}implies(X){let Q=X;if(typeof X==="string")Q={[X]:!0};return this.implied=Object.assign(this.implied||{},Q),this}env(X){return this.envVar=X,this}argParser(X){return this.parseArg=X,this}makeOptionMandatory(X=!0){return this.mandatory=!!X,this}hideHelp(X=!0){return this.hidden=!!X,this}_collectValue(X,Q){if(Q===this.defaultValue||!Array.isArray(Q))return[X];return Q.push(X),Q}choices(X){return this.argChoices=X.slice(),this.parseArg=(Q,J)=>{if(!this.argChoices.includes(Q))throw new tG(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(Q,J);return Q},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){if(this.negate)return I5(this.name().replace(/^no-/,""));return I5(this.name())}helpGroup(X){return this.helpGroupHeading=X,this}is(X){return this.short===X||this.long===X}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class w5{constructor(X){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,X.forEach((Q)=>{if(Q.negate)this.negativeOptions.set(Q.attributeName(),Q);else this.positiveOptions.set(Q.attributeName(),Q)}),this.negativeOptions.forEach((Q,J)=>{if(this.positiveOptions.has(J))this.dualOptions.add(J)})}valueFromOption(X,Q){let J=Q.attributeName();if(!this.dualOptions.has(J))return!0;let Y=this.negativeOptions.get(J).presetArg,G=Y!==void 0?Y:!1;return Q.negate===(G===X)}}function I5(X){return X.split("-").reduce((Q,J)=>{return Q+J[0].toUpperCase()+J.slice(1)})}function eG(X){let Q,J,Y=/^-[^-]$/,G=/^--[^-]/,$=X.split(/[ |,]+/).concat("guard");if(Y.test($[0]))Q=$.shift();if(G.test($[0]))J=$.shift();if(!Q&&Y.test($[0]))Q=$.shift();if(!Q&&G.test($[0]))Q=J,J=$.shift();if($[0].startsWith("-")){let W=$[0],H=`option creation failed due to '${W}' in option flags '${X}'`;if(/^-[^-][^-]/.test(W))throw Error(`${H}
3
+ import{createRequire as rG}from"node:module";var pG=Object.create;var{getPrototypeOf:dG,defineProperty:I4,getOwnPropertyNames:iG}=Object;var nG=Object.prototype.hasOwnProperty;var j4=(X,Q,J)=>{J=X!=null?pG(dG(X)):{};let Y=Q||!X||!X.__esModule?I4(J,"default",{value:X,enumerable:!0}):J;for(let G of iG(X))if(!nG.call(Y,G))I4(Y,G,{get:()=>X[G],enumerable:!0});return Y};var p=(X,Q)=>()=>(Q||X((Q={exports:{}}).exports,Q),Q.exports);var O1=rG(import.meta.url);var y9=p((oG)=>{class UX extends Error{constructor(X,Q,J){super(J);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=Q,this.exitCode=X,this.nestedError=void 0}}class w4 extends UX{constructor(X){super(1,"commander.invalidArgument",X);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}oG.CommanderError=UX;oG.InvalidArgumentError=w4});var v8=p((X$)=>{var{InvalidArgumentError:tG}=y9();class P4{constructor(X,Q){switch(this.description=Q||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,X[0]){case"<":this.required=!0,this._name=X.slice(1,-1);break;case"[":this.required=!1,this._name=X.slice(1,-1);break;default:this.required=!0,this._name=X;break}if(this._name.endsWith("..."))this.variadic=!0,this._name=this._name.slice(0,-3)}name(){return this._name}_collectValue(X,Q){if(Q===this.defaultValue||!Array.isArray(Q))return[X];return Q.push(X),Q}default(X,Q){return this.defaultValue=X,this.defaultValueDescription=Q,this}argParser(X){return this.parseArg=X,this}choices(X){return this.argChoices=X.slice(),this.parseArg=(Q,J)=>{if(!this.argChoices.includes(Q))throw new tG(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(Q,J);return Q},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function eG(X){let Q=X.name()+(X.variadic===!0?"...":"");return X.required?"<"+Q+">":"["+Q+"]"}X$.Argument=P4;X$.humanReadableArgName=eG});var BX=p((G$)=>{var{humanReadableArgName:Y$}=v8();class T4{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(X){this.helpWidth=this.helpWidth??X.helpWidth??80}visibleCommands(X){let Q=X.commands.filter((Y)=>!Y._hidden),J=X._getHelpCommand();if(J&&!J._hidden)Q.push(J);if(this.sortSubcommands)Q.sort((Y,G)=>{return Y.name().localeCompare(G.name())});return Q}compareOptions(X,Q){let J=(Y)=>{return Y.short?Y.short.replace(/^-/,""):Y.long.replace(/^--/,"")};return J(X).localeCompare(J(Q))}visibleOptions(X){let Q=X.options.filter((Y)=>!Y.hidden),J=X._getHelpOption();if(J&&!J.hidden){let Y=J.short&&X._findOption(J.short),G=J.long&&X._findOption(J.long);if(!Y&&!G)Q.push(J);else if(J.long&&!G)Q.push(X.createOption(J.long,J.description));else if(J.short&&!Y)Q.push(X.createOption(J.short,J.description))}if(this.sortOptions)Q.sort(this.compareOptions);return Q}visibleGlobalOptions(X){if(!this.showGlobalOptions)return[];let Q=[];for(let J=X.parent;J;J=J.parent){let Y=J.options.filter((G)=>!G.hidden);Q.push(...Y)}if(this.sortOptions)Q.sort(this.compareOptions);return Q}visibleArguments(X){if(X._argsDescription)X.registeredArguments.forEach((Q)=>{Q.description=Q.description||X._argsDescription[Q.name()]||""});if(X.registeredArguments.find((Q)=>Q.description))return X.registeredArguments;return[]}subcommandTerm(X){let Q=X.registeredArguments.map((J)=>Y$(J)).join(" ");return X._name+(X._aliases[0]?"|"+X._aliases[0]:"")+(X.options.length?" [options]":"")+(Q?" "+Q:"")}optionTerm(X){return X.flags}argumentTerm(X){return X.name()}longestSubcommandTermLength(X,Q){return Q.visibleCommands(X).reduce((J,Y)=>{return Math.max(J,this.displayWidth(Q.styleSubcommandTerm(Q.subcommandTerm(Y))))},0)}longestOptionTermLength(X,Q){return Q.visibleOptions(X).reduce((J,Y)=>{return Math.max(J,this.displayWidth(Q.styleOptionTerm(Q.optionTerm(Y))))},0)}longestGlobalOptionTermLength(X,Q){return Q.visibleGlobalOptions(X).reduce((J,Y)=>{return Math.max(J,this.displayWidth(Q.styleOptionTerm(Q.optionTerm(Y))))},0)}longestArgumentTermLength(X,Q){return Q.visibleArguments(X).reduce((J,Y)=>{return Math.max(J,this.displayWidth(Q.styleArgumentTerm(Q.argumentTerm(Y))))},0)}commandUsage(X){let Q=X._name;if(X._aliases[0])Q=Q+"|"+X._aliases[0];let J="";for(let Y=X.parent;Y;Y=Y.parent)J=Y.name()+" "+J;return J+Q+" "+X.usage()}commandDescription(X){return X.description()}subcommandDescription(X){return X.summary()||X.description()}optionDescription(X){let Q=[];if(X.argChoices)Q.push(`choices: ${X.argChoices.map((J)=>JSON.stringify(J)).join(", ")}`);if(X.defaultValue!==void 0){if(X.required||X.optional||X.isBoolean()&&typeof X.defaultValue==="boolean")Q.push(`default: ${X.defaultValueDescription||JSON.stringify(X.defaultValue)}`)}if(X.presetArg!==void 0&&X.optional)Q.push(`preset: ${JSON.stringify(X.presetArg)}`);if(X.envVar!==void 0)Q.push(`env: ${X.envVar}`);if(Q.length>0){let J=`(${Q.join(", ")})`;if(X.description)return`${X.description} ${J}`;return J}return X.description}argumentDescription(X){let Q=[];if(X.argChoices)Q.push(`choices: ${X.argChoices.map((J)=>JSON.stringify(J)).join(", ")}`);if(X.defaultValue!==void 0)Q.push(`default: ${X.defaultValueDescription||JSON.stringify(X.defaultValue)}`);if(Q.length>0){let J=`(${Q.join(", ")})`;if(X.description)return`${X.description} ${J}`;return J}return X.description}formatItemList(X,Q,J){if(Q.length===0)return[];return[J.styleTitle(X),...Q,""]}groupItems(X,Q,J){let Y=new Map;return X.forEach((G)=>{let $=J(G);if(!Y.has($))Y.set($,[])}),Q.forEach((G)=>{let $=J(G);if(!Y.has($))Y.set($,[]);Y.get($).push(G)}),Y}formatHelp(X,Q){let J=Q.padWidth(X,Q),Y=Q.helpWidth??80;function G(q,K){return Q.formatItem(q,J,K,Q)}let $=[`${Q.styleTitle("Usage:")} ${Q.styleUsage(Q.commandUsage(X))}`,""],W=Q.commandDescription(X);if(W.length>0)$=$.concat([Q.boxWrap(Q.styleCommandDescription(W),Y),""]);let H=Q.visibleArguments(X).map((q)=>{return G(Q.styleArgumentTerm(Q.argumentTerm(q)),Q.styleArgumentDescription(Q.argumentDescription(q)))});if($=$.concat(this.formatItemList("Arguments:",H,Q)),this.groupItems(X.options,Q.visibleOptions(X),(q)=>q.helpGroupHeading??"Options:").forEach((q,K)=>{let V=q.map((N)=>{return G(Q.styleOptionTerm(Q.optionTerm(N)),Q.styleOptionDescription(Q.optionDescription(N)))});$=$.concat(this.formatItemList(K,V,Q))}),Q.showGlobalOptions){let q=Q.visibleGlobalOptions(X).map((K)=>{return G(Q.styleOptionTerm(Q.optionTerm(K)),Q.styleOptionDescription(Q.optionDescription(K)))});$=$.concat(this.formatItemList("Global Options:",q,Q))}return this.groupItems(X.commands,Q.visibleCommands(X),(q)=>q.helpGroup()||"Commands:").forEach((q,K)=>{let V=q.map((N)=>{return G(Q.styleSubcommandTerm(Q.subcommandTerm(N)),Q.styleSubcommandDescription(Q.subcommandDescription(N)))});$=$.concat(this.formatItemList(K,V,Q))}),$.join(`
4
+ `)}displayWidth(X){return S4(X).length}styleTitle(X){return X}styleUsage(X){return X.split(" ").map((Q)=>{if(Q==="[options]")return this.styleOptionText(Q);if(Q==="[command]")return this.styleSubcommandText(Q);if(Q[0]==="["||Q[0]==="<")return this.styleArgumentText(Q);return this.styleCommandText(Q)}).join(" ")}styleCommandDescription(X){return this.styleDescriptionText(X)}styleOptionDescription(X){return this.styleDescriptionText(X)}styleSubcommandDescription(X){return this.styleDescriptionText(X)}styleArgumentDescription(X){return this.styleDescriptionText(X)}styleDescriptionText(X){return X}styleOptionTerm(X){return this.styleOptionText(X)}styleSubcommandTerm(X){return X.split(" ").map((Q)=>{if(Q==="[options]")return this.styleOptionText(Q);if(Q[0]==="["||Q[0]==="<")return this.styleArgumentText(Q);return this.styleSubcommandText(Q)}).join(" ")}styleArgumentTerm(X){return this.styleArgumentText(X)}styleOptionText(X){return X}styleArgumentText(X){return X}styleSubcommandText(X){return X}styleCommandText(X){return X}padWidth(X,Q){return Math.max(Q.longestOptionTermLength(X,Q),Q.longestGlobalOptionTermLength(X,Q),Q.longestSubcommandTermLength(X,Q),Q.longestArgumentTermLength(X,Q))}preformatted(X){return/\n[^\S\r\n]/.test(X)}formatItem(X,Q,J,Y){let $=" ".repeat(2);if(!J)return $+X;let W=X.padEnd(Q+X.length-Y.displayWidth(X)),H=2,B=(this.helpWidth??80)-Q-H-2,q;if(B<this.minWidthToWrap||Y.preformatted(J))q=J;else q=Y.boxWrap(J,B).replace(/\n/g,`
5
+ `+" ".repeat(Q+H));return $+W+" ".repeat(H)+q.replace(/\n/g,`
6
+ ${$}`)}boxWrap(X,Q){if(Q<this.minWidthToWrap)return X;let J=X.split(/\r\n|\n/),Y=/[\s]*[^\s]+/g,G=[];return J.forEach(($)=>{let W=$.match(Y);if(W===null){G.push("");return}let H=[W.shift()],U=this.displayWidth(H[0]);W.forEach((B)=>{let q=this.displayWidth(B);if(U+q<=Q){H.push(B),U+=q;return}G.push(H.join(""));let K=B.trimStart();H=[K],U=this.displayWidth(K)}),G.push(H.join(""))}),G.join(`
7
+ `)}}function S4(X){let Q=/\x1b\[\d*(;\d*)*m/g;return X.replace(Q,"")}G$.Help=T4;G$.stripColor=S4});var zX=p((B$)=>{var{InvalidArgumentError:H$}=y9();class b4{constructor(X,Q){this.flags=X,this.description=Q||"",this.required=X.includes("<"),this.optional=X.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(X),this.mandatory=!1;let J=U$(X);if(this.short=J.shortFlag,this.long=J.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(X,Q){return this.defaultValue=X,this.defaultValueDescription=Q,this}preset(X){return this.presetArg=X,this}conflicts(X){return this.conflictsWith=this.conflictsWith.concat(X),this}implies(X){let Q=X;if(typeof X==="string")Q={[X]:!0};return this.implied=Object.assign(this.implied||{},Q),this}env(X){return this.envVar=X,this}argParser(X){return this.parseArg=X,this}makeOptionMandatory(X=!0){return this.mandatory=!!X,this}hideHelp(X=!0){return this.hidden=!!X,this}_collectValue(X,Q){if(Q===this.defaultValue||!Array.isArray(Q))return[X];return Q.push(X),Q}choices(X){return this.argChoices=X.slice(),this.parseArg=(Q,J)=>{if(!this.argChoices.includes(Q))throw new H$(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(Q,J);return Q},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){if(this.negate)return E4(this.name().replace(/^no-/,""));return E4(this.name())}helpGroup(X){return this.helpGroupHeading=X,this}is(X){return this.short===X||this.long===X}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class C4{constructor(X){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,X.forEach((Q)=>{if(Q.negate)this.negativeOptions.set(Q.attributeName(),Q);else this.positiveOptions.set(Q.attributeName(),Q)}),this.negativeOptions.forEach((Q,J)=>{if(this.positiveOptions.has(J))this.dualOptions.add(J)})}valueFromOption(X,Q){let J=Q.attributeName();if(!this.dualOptions.has(J))return!0;let Y=this.negativeOptions.get(J).presetArg,G=Y!==void 0?Y:!1;return Q.negate===(G===X)}}function E4(X){return X.split("-").reduce((Q,J)=>{return Q+J[0].toUpperCase()+J.slice(1)})}function U$(X){let Q,J,Y=/^-[^-]$/,G=/^--[^-]/,$=X.split(/[ |,]+/).concat("guard");if(Y.test($[0]))Q=$.shift();if(G.test($[0]))J=$.shift();if(!Q&&Y.test($[0]))Q=$.shift();if(!Q&&G.test($[0]))Q=J,J=$.shift();if($[0].startsWith("-")){let W=$[0],H=`option creation failed due to '${W}' in option flags '${X}'`;if(/^-[^-][^-]/.test(W))throw Error(`${H}
8
8
  - a short flag is a single dash and a single character
9
9
  - either use a single dash and a single character (for a short flag)
10
10
  - or use a double dash for a long option (and can have two, like '--ws, --workspace')`);if(Y.test(W))throw Error(`${H}
11
11
  - too many short flags`);if(G.test(W))throw Error(`${H}
12
12
  - too many long flags`);throw Error(`${H}
13
- - unrecognised flag format`)}if(Q===void 0&&J===void 0)throw Error(`option creation failed due to no flags found in '${X}'.`);return{shortFlag:Q,longFlag:J}}X$.Option=j5;X$.DualOptions=w5});var P5=p(($$)=>{function Y$(X,Q){if(Math.abs(X.length-Q.length)>3)return Math.max(X.length,Q.length);let J=[];for(let Y=0;Y<=X.length;Y++)J[Y]=[Y];for(let Y=0;Y<=Q.length;Y++)J[0][Y]=Y;for(let Y=1;Y<=Q.length;Y++)for(let G=1;G<=X.length;G++){let $=1;if(X[G-1]===Q[Y-1])$=0;else $=1;if(J[G][Y]=Math.min(J[G-1][Y]+1,J[G][Y-1]+1,J[G-1][Y-1]+$),G>1&&Y>1&&X[G-1]===Q[Y-2]&&X[G-2]===Q[Y-1])J[G][Y]=Math.min(J[G][Y],J[G-2][Y-2]+1)}return J[X.length][Q.length]}function G$(X,Q){if(!Q||Q.length===0)return"";Q=Array.from(new Set(Q));let J=X.startsWith("--");if(J)X=X.slice(2),Q=Q.map((W)=>W.slice(2));let Y=[],G=3,$=0.4;if(Q.forEach((W)=>{if(W.length<=1)return;let H=Y$(X,W),U=Math.max(X.length,W.length);if((U-H)/U>$){if(H<G)G=H,Y=[W];else if(H===G)Y.push(W)}}),Y.sort((W,H)=>W.localeCompare(H)),J)Y=Y.map((W)=>`--${W}`);if(Y.length>1)return`
13
+ - unrecognised flag format`)}if(Q===void 0&&J===void 0)throw Error(`option creation failed due to no flags found in '${X}'.`);return{shortFlag:Q,longFlag:J}}B$.Option=b4;B$.DualOptions=C4});var _4=p((K$)=>{function q$(X,Q){if(Math.abs(X.length-Q.length)>3)return Math.max(X.length,Q.length);let J=[];for(let Y=0;Y<=X.length;Y++)J[Y]=[Y];for(let Y=0;Y<=Q.length;Y++)J[0][Y]=Y;for(let Y=1;Y<=Q.length;Y++)for(let G=1;G<=X.length;G++){let $=1;if(X[G-1]===Q[Y-1])$=0;else $=1;if(J[G][Y]=Math.min(J[G-1][Y]+1,J[G][Y-1]+1,J[G-1][Y-1]+$),G>1&&Y>1&&X[G-1]===Q[Y-2]&&X[G-2]===Q[Y-1])J[G][Y]=Math.min(J[G][Y],J[G-2][Y-2]+1)}return J[X.length][Q.length]}function F$(X,Q){if(!Q||Q.length===0)return"";Q=Array.from(new Set(Q));let J=X.startsWith("--");if(J)X=X.slice(2),Q=Q.map((W)=>W.slice(2));let Y=[],G=3,$=0.4;if(Q.forEach((W)=>{if(W.length<=1)return;let H=q$(X,W),U=Math.max(X.length,W.length);if((U-H)/U>$){if(H<G)G=H,Y=[W];else if(H===G)Y.push(W)}}),Y.sort((W,H)=>W.localeCompare(H)),J)Y=Y.map((W)=>`--${W}`);if(Y.length>1)return`
14
14
  (Did you mean one of ${Y.join(", ")}?)`;if(Y.length===1)return`
15
- (Did you mean ${Y[0]}?)`;return""}$$.suggestSimilar=G$});var b5=p((F$)=>{var H$=O1("node:events").EventEmitter,BX=O1("node:child_process"),A1=O1("node:path"),v8=O1("node:fs"),D0=O1("node:process"),{Argument:U$,humanReadableArgName:z$}=k8(),{CommanderError:LX}=v9(),{Help:B$,stripColor:L$}=UX(),{Option:T5,DualOptions:q$}=zX(),{suggestSimilar:S5}=P5();class FX extends H${constructor(X){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=X||"",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:(Q)=>D0.stdout.write(Q),writeErr:(Q)=>D0.stderr.write(Q),outputError:(Q,J)=>J(Q),getOutHelpWidth:()=>D0.stdout.isTTY?D0.stdout.columns:void 0,getErrHelpWidth:()=>D0.stderr.isTTY?D0.stderr.columns:void 0,getOutHasColors:()=>qX()??(D0.stdout.isTTY&&D0.stdout.hasColors?.()),getErrHasColors:()=>qX()??(D0.stderr.isTTY&&D0.stderr.hasColors?.()),stripColor:(Q)=>L$(Q)},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(X){return this._outputConfiguration=X._outputConfiguration,this._helpOption=X._helpOption,this._helpCommand=X._helpCommand,this._helpConfiguration=X._helpConfiguration,this._exitCallback=X._exitCallback,this._storeOptionsAsProperties=X._storeOptionsAsProperties,this._combineFlagAndOptionalValue=X._combineFlagAndOptionalValue,this._allowExcessArguments=X._allowExcessArguments,this._enablePositionalOptions=X._enablePositionalOptions,this._showHelpAfterError=X._showHelpAfterError,this._showSuggestionAfterError=X._showSuggestionAfterError,this}_getCommandAndAncestors(){let X=[];for(let Q=this;Q;Q=Q.parent)X.push(Q);return X}command(X,Q,J){let Y=Q,G=J;if(typeof Y==="object"&&Y!==null)G=Y,Y=null;G=G||{};let[,$,W]=X.match(/([^ ]+) *(.*)/),H=this.createCommand($);if(Y)H.description(Y),H._executableHandler=!0;if(G.isDefault)this._defaultCommandName=H._name;if(H._hidden=!!(G.noHelp||G.hidden),H._executableFile=G.executableFile||null,W)H.arguments(W);if(this._registerCommand(H),H.parent=this,H.copyInheritedSettings(this),Y)return this;return H}createCommand(X){return new FX(X)}createHelp(){return Object.assign(new B$,this.configureHelp())}configureHelp(X){if(X===void 0)return this._helpConfiguration;return this._helpConfiguration=X,this}configureOutput(X){if(X===void 0)return this._outputConfiguration;return this._outputConfiguration={...this._outputConfiguration,...X},this}showHelpAfterError(X=!0){if(typeof X!=="string")X=!!X;return this._showHelpAfterError=X,this}showSuggestionAfterError(X=!0){return this._showSuggestionAfterError=!!X,this}addCommand(X,Q){if(!X._name)throw Error(`Command passed to .addCommand() must have a name
16
- - specify the name in Command constructor or using .name()`);if(Q=Q||{},Q.isDefault)this._defaultCommandName=X._name;if(Q.noHelp||Q.hidden)X._hidden=!0;return this._registerCommand(X),X.parent=this,X._checkForBrokenPassThrough(),this}createArgument(X,Q){return new U$(X,Q)}argument(X,Q,J,Y){let G=this.createArgument(X,Q);if(typeof J==="function")G.default(Y).argParser(J);else G.default(J);return this.addArgument(G),this}arguments(X){return X.trim().split(/ +/).forEach((Q)=>{this.argument(Q)}),this}addArgument(X){let Q=this.registeredArguments.slice(-1)[0];if(Q?.variadic)throw Error(`only the last argument can be variadic '${Q.name()}'`);if(X.required&&X.defaultValue!==void 0&&X.parseArg===void 0)throw Error(`a default value for a required argument is never used: '${X.name()}'`);return this.registeredArguments.push(X),this}helpCommand(X,Q){if(typeof X==="boolean"){if(this._addImplicitHelpCommand=X,X&&this._defaultCommandGroup)this._initCommandGroup(this._getHelpCommand());return this}let J=X??"help [command]",[,Y,G]=J.match(/([^ ]+) *(.*)/),$=Q??"display help for command",W=this.createCommand(Y);if(W.helpOption(!1),G)W.arguments(G);if($)W.description($);if(this._addImplicitHelpCommand=!0,this._helpCommand=W,X||Q)this._initCommandGroup(W);return this}addHelpCommand(X,Q){if(typeof X!=="object")return this.helpCommand(X,Q),this;return this._addImplicitHelpCommand=!0,this._helpCommand=X,this._initCommandGroup(X),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(X,Q){let J=["preSubcommand","preAction","postAction"];if(!J.includes(X))throw Error(`Unexpected value for event passed to hook : '${X}'.
17
- Expecting one of '${J.join("', '")}'`);if(this._lifeCycleHooks[X])this._lifeCycleHooks[X].push(Q);else this._lifeCycleHooks[X]=[Q];return this}exitOverride(X){if(X)this._exitCallback=X;else this._exitCallback=(Q)=>{if(Q.code!=="commander.executeSubCommandAsync")throw Q};return this}_exit(X,Q,J){if(this._exitCallback)this._exitCallback(new LX(X,Q,J));D0.exit(X)}action(X){let Q=(J)=>{let Y=this.registeredArguments.length,G=J.slice(0,Y);if(this._storeOptionsAsProperties)G[Y]=this;else G[Y]=this.opts();return G.push(this),X.apply(this,G)};return this._actionHandler=Q,this}createOption(X,Q){return new T5(X,Q)}_callParseArg(X,Q,J,Y){try{return X.parseArg(Q,J)}catch(G){if(G.code==="commander.invalidArgument"){let $=`${Y} ${G.message}`;this.error($,{exitCode:G.exitCode,code:G.code})}throw G}}_registerOption(X){let Q=X.short&&this._findOption(X.short)||X.long&&this._findOption(X.long);if(Q){let J=X.long&&this._findOption(X.long)?X.long:X.short;throw Error(`Cannot add option '${X.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${J}'
18
- - already used by option '${Q.flags}'`)}this._initOptionGroup(X),this.options.push(X)}_registerCommand(X){let Q=(Y)=>{return[Y.name()].concat(Y.aliases())},J=Q(X).find((Y)=>this._findCommand(Y));if(J){let Y=Q(this._findCommand(J)).join("|"),G=Q(X).join("|");throw Error(`cannot add command '${G}' as already have command '${Y}'`)}this._initCommandGroup(X),this.commands.push(X)}addOption(X){this._registerOption(X);let Q=X.name(),J=X.attributeName();if(X.negate){let G=X.long.replace(/^--no-/,"--");if(!this._findOption(G))this.setOptionValueWithSource(J,X.defaultValue===void 0?!0:X.defaultValue,"default")}else if(X.defaultValue!==void 0)this.setOptionValueWithSource(J,X.defaultValue,"default");let Y=(G,$,W)=>{if(G==null&&X.presetArg!==void 0)G=X.presetArg;let H=this.getOptionValue(J);if(G!==null&&X.parseArg)G=this._callParseArg(X,G,H,$);else if(G!==null&&X.variadic)G=X._collectValue(G,H);if(G==null)if(X.negate)G=!1;else if(X.isBoolean()||X.optional)G=!0;else G="";this.setOptionValueWithSource(J,G,W)};if(this.on("option:"+Q,(G)=>{let $=`error: option '${X.flags}' argument '${G}' is invalid.`;Y(G,$,"cli")}),X.envVar)this.on("optionEnv:"+Q,(G)=>{let $=`error: option '${X.flags}' value '${G}' from env '${X.envVar}' is invalid.`;Y(G,$,"env")});return this}_optionEx(X,Q,J,Y,G){if(typeof Q==="object"&&Q instanceof T5)throw Error("To add an Option object use addOption() instead of option() or requiredOption()");let $=this.createOption(Q,J);if($.makeOptionMandatory(!!X.mandatory),typeof Y==="function")$.default(G).argParser(Y);else if(Y instanceof RegExp){let W=Y;Y=(H,U)=>{let z=W.exec(H);return z?z[0]:U},$.default(G).argParser(Y)}else $.default(Y);return this.addOption($)}option(X,Q,J,Y){return this._optionEx({},X,Q,J,Y)}requiredOption(X,Q,J,Y){return this._optionEx({mandatory:!0},X,Q,J,Y)}combineFlagAndOptionalValue(X=!0){return this._combineFlagAndOptionalValue=!!X,this}allowUnknownOption(X=!0){return this._allowUnknownOption=!!X,this}allowExcessArguments(X=!0){return this._allowExcessArguments=!!X,this}enablePositionalOptions(X=!0){return this._enablePositionalOptions=!!X,this}passThroughOptions(X=!0){return this._passThroughOptions=!!X,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(X=!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=!!X,this}getOptionValue(X){if(this._storeOptionsAsProperties)return this[X];return this._optionValues[X]}setOptionValue(X,Q){return this.setOptionValueWithSource(X,Q,void 0)}setOptionValueWithSource(X,Q,J){if(this._storeOptionsAsProperties)this[X]=Q;else this._optionValues[X]=Q;return this._optionValueSources[X]=J,this}getOptionValueSource(X){return this._optionValueSources[X]}getOptionValueSourceWithGlobals(X){let Q;return this._getCommandAndAncestors().forEach((J)=>{if(J.getOptionValueSource(X)!==void 0)Q=J.getOptionValueSource(X)}),Q}_prepareUserArgs(X,Q){if(X!==void 0&&!Array.isArray(X))throw Error("first parameter to parse must be array or undefined");if(Q=Q||{},X===void 0&&Q.from===void 0){if(D0.versions?.electron)Q.from="electron";let Y=D0.execArgv??[];if(Y.includes("-e")||Y.includes("--eval")||Y.includes("-p")||Y.includes("--print"))Q.from="eval"}if(X===void 0)X=D0.argv;this.rawArgs=X.slice();let J;switch(Q.from){case void 0:case"node":this._scriptPath=X[1],J=X.slice(2);break;case"electron":if(D0.defaultApp)this._scriptPath=X[1],J=X.slice(2);else J=X.slice(1);break;case"user":J=X.slice(0);break;case"eval":J=X.slice(1);break;default:throw Error(`unexpected parse option { from: '${Q.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);return this._name=this._name||"program",J}parse(X,Q){this._prepareForParse();let J=this._prepareUserArgs(X,Q);return this._parseCommand([],J),this}async parseAsync(X,Q){this._prepareForParse();let J=this._prepareUserArgs(X,Q);return await this._parseCommand([],J),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.
19
- - 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(X,Q,J){if(v8.existsSync(X))return;let Y=Q?`searched for local subcommand relative to directory '${Q}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",G=`'${X}' does not exist
15
+ (Did you mean ${Y[0]}?)`;return""}K$.suggestSimilar=F$});var x4=p((R$)=>{var M$=O1("node:events").EventEmitter,LX=O1("node:child_process"),A1=O1("node:path"),y8=O1("node:fs"),Z0=O1("node:process"),{Argument:D$,humanReadableArgName:Z$}=v8(),{CommanderError:qX}=y9(),{Help:O$,stripColor:A$}=BX(),{Option:k4,DualOptions:N$}=zX(),{suggestSimilar:v4}=_4();class KX extends M${constructor(X){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=X||"",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:(Q)=>Z0.stdout.write(Q),writeErr:(Q)=>Z0.stderr.write(Q),outputError:(Q,J)=>J(Q),getOutHelpWidth:()=>Z0.stdout.isTTY?Z0.stdout.columns:void 0,getErrHelpWidth:()=>Z0.stderr.isTTY?Z0.stderr.columns:void 0,getOutHasColors:()=>FX()??(Z0.stdout.isTTY&&Z0.stdout.hasColors?.()),getErrHasColors:()=>FX()??(Z0.stderr.isTTY&&Z0.stderr.hasColors?.()),stripColor:(Q)=>A$(Q)},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(X){return this._outputConfiguration=X._outputConfiguration,this._helpOption=X._helpOption,this._helpCommand=X._helpCommand,this._helpConfiguration=X._helpConfiguration,this._exitCallback=X._exitCallback,this._storeOptionsAsProperties=X._storeOptionsAsProperties,this._combineFlagAndOptionalValue=X._combineFlagAndOptionalValue,this._allowExcessArguments=X._allowExcessArguments,this._enablePositionalOptions=X._enablePositionalOptions,this._showHelpAfterError=X._showHelpAfterError,this._showSuggestionAfterError=X._showSuggestionAfterError,this}_getCommandAndAncestors(){let X=[];for(let Q=this;Q;Q=Q.parent)X.push(Q);return X}command(X,Q,J){let Y=Q,G=J;if(typeof Y==="object"&&Y!==null)G=Y,Y=null;G=G||{};let[,$,W]=X.match(/([^ ]+) *(.*)/),H=this.createCommand($);if(Y)H.description(Y),H._executableHandler=!0;if(G.isDefault)this._defaultCommandName=H._name;if(H._hidden=!!(G.noHelp||G.hidden),H._executableFile=G.executableFile||null,W)H.arguments(W);if(this._registerCommand(H),H.parent=this,H.copyInheritedSettings(this),Y)return this;return H}createCommand(X){return new KX(X)}createHelp(){return Object.assign(new O$,this.configureHelp())}configureHelp(X){if(X===void 0)return this._helpConfiguration;return this._helpConfiguration=X,this}configureOutput(X){if(X===void 0)return this._outputConfiguration;return this._outputConfiguration={...this._outputConfiguration,...X},this}showHelpAfterError(X=!0){if(typeof X!=="string")X=!!X;return this._showHelpAfterError=X,this}showSuggestionAfterError(X=!0){return this._showSuggestionAfterError=!!X,this}addCommand(X,Q){if(!X._name)throw Error(`Command passed to .addCommand() must have a name
16
+ - specify the name in Command constructor or using .name()`);if(Q=Q||{},Q.isDefault)this._defaultCommandName=X._name;if(Q.noHelp||Q.hidden)X._hidden=!0;return this._registerCommand(X),X.parent=this,X._checkForBrokenPassThrough(),this}createArgument(X,Q){return new D$(X,Q)}argument(X,Q,J,Y){let G=this.createArgument(X,Q);if(typeof J==="function")G.default(Y).argParser(J);else G.default(J);return this.addArgument(G),this}arguments(X){return X.trim().split(/ +/).forEach((Q)=>{this.argument(Q)}),this}addArgument(X){let Q=this.registeredArguments.slice(-1)[0];if(Q?.variadic)throw Error(`only the last argument can be variadic '${Q.name()}'`);if(X.required&&X.defaultValue!==void 0&&X.parseArg===void 0)throw Error(`a default value for a required argument is never used: '${X.name()}'`);return this.registeredArguments.push(X),this}helpCommand(X,Q){if(typeof X==="boolean"){if(this._addImplicitHelpCommand=X,X&&this._defaultCommandGroup)this._initCommandGroup(this._getHelpCommand());return this}let J=X??"help [command]",[,Y,G]=J.match(/([^ ]+) *(.*)/),$=Q??"display help for command",W=this.createCommand(Y);if(W.helpOption(!1),G)W.arguments(G);if($)W.description($);if(this._addImplicitHelpCommand=!0,this._helpCommand=W,X||Q)this._initCommandGroup(W);return this}addHelpCommand(X,Q){if(typeof X!=="object")return this.helpCommand(X,Q),this;return this._addImplicitHelpCommand=!0,this._helpCommand=X,this._initCommandGroup(X),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(X,Q){let J=["preSubcommand","preAction","postAction"];if(!J.includes(X))throw Error(`Unexpected value for event passed to hook : '${X}'.
17
+ Expecting one of '${J.join("', '")}'`);if(this._lifeCycleHooks[X])this._lifeCycleHooks[X].push(Q);else this._lifeCycleHooks[X]=[Q];return this}exitOverride(X){if(X)this._exitCallback=X;else this._exitCallback=(Q)=>{if(Q.code!=="commander.executeSubCommandAsync")throw Q};return this}_exit(X,Q,J){if(this._exitCallback)this._exitCallback(new qX(X,Q,J));Z0.exit(X)}action(X){let Q=(J)=>{let Y=this.registeredArguments.length,G=J.slice(0,Y);if(this._storeOptionsAsProperties)G[Y]=this;else G[Y]=this.opts();return G.push(this),X.apply(this,G)};return this._actionHandler=Q,this}createOption(X,Q){return new k4(X,Q)}_callParseArg(X,Q,J,Y){try{return X.parseArg(Q,J)}catch(G){if(G.code==="commander.invalidArgument"){let $=`${Y} ${G.message}`;this.error($,{exitCode:G.exitCode,code:G.code})}throw G}}_registerOption(X){let Q=X.short&&this._findOption(X.short)||X.long&&this._findOption(X.long);if(Q){let J=X.long&&this._findOption(X.long)?X.long:X.short;throw Error(`Cannot add option '${X.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${J}'
18
+ - already used by option '${Q.flags}'`)}this._initOptionGroup(X),this.options.push(X)}_registerCommand(X){let Q=(Y)=>{return[Y.name()].concat(Y.aliases())},J=Q(X).find((Y)=>this._findCommand(Y));if(J){let Y=Q(this._findCommand(J)).join("|"),G=Q(X).join("|");throw Error(`cannot add command '${G}' as already have command '${Y}'`)}this._initCommandGroup(X),this.commands.push(X)}addOption(X){this._registerOption(X);let Q=X.name(),J=X.attributeName();if(X.negate){let G=X.long.replace(/^--no-/,"--");if(!this._findOption(G))this.setOptionValueWithSource(J,X.defaultValue===void 0?!0:X.defaultValue,"default")}else if(X.defaultValue!==void 0)this.setOptionValueWithSource(J,X.defaultValue,"default");let Y=(G,$,W)=>{if(G==null&&X.presetArg!==void 0)G=X.presetArg;let H=this.getOptionValue(J);if(G!==null&&X.parseArg)G=this._callParseArg(X,G,H,$);else if(G!==null&&X.variadic)G=X._collectValue(G,H);if(G==null)if(X.negate)G=!1;else if(X.isBoolean()||X.optional)G=!0;else G="";this.setOptionValueWithSource(J,G,W)};if(this.on("option:"+Q,(G)=>{let $=`error: option '${X.flags}' argument '${G}' is invalid.`;Y(G,$,"cli")}),X.envVar)this.on("optionEnv:"+Q,(G)=>{let $=`error: option '${X.flags}' value '${G}' from env '${X.envVar}' is invalid.`;Y(G,$,"env")});return this}_optionEx(X,Q,J,Y,G){if(typeof Q==="object"&&Q instanceof k4)throw Error("To add an Option object use addOption() instead of option() or requiredOption()");let $=this.createOption(Q,J);if($.makeOptionMandatory(!!X.mandatory),typeof Y==="function")$.default(G).argParser(Y);else if(Y instanceof RegExp){let W=Y;Y=(H,U)=>{let B=W.exec(H);return B?B[0]:U},$.default(G).argParser(Y)}else $.default(Y);return this.addOption($)}option(X,Q,J,Y){return this._optionEx({},X,Q,J,Y)}requiredOption(X,Q,J,Y){return this._optionEx({mandatory:!0},X,Q,J,Y)}combineFlagAndOptionalValue(X=!0){return this._combineFlagAndOptionalValue=!!X,this}allowUnknownOption(X=!0){return this._allowUnknownOption=!!X,this}allowExcessArguments(X=!0){return this._allowExcessArguments=!!X,this}enablePositionalOptions(X=!0){return this._enablePositionalOptions=!!X,this}passThroughOptions(X=!0){return this._passThroughOptions=!!X,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(X=!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=!!X,this}getOptionValue(X){if(this._storeOptionsAsProperties)return this[X];return this._optionValues[X]}setOptionValue(X,Q){return this.setOptionValueWithSource(X,Q,void 0)}setOptionValueWithSource(X,Q,J){if(this._storeOptionsAsProperties)this[X]=Q;else this._optionValues[X]=Q;return this._optionValueSources[X]=J,this}getOptionValueSource(X){return this._optionValueSources[X]}getOptionValueSourceWithGlobals(X){let Q;return this._getCommandAndAncestors().forEach((J)=>{if(J.getOptionValueSource(X)!==void 0)Q=J.getOptionValueSource(X)}),Q}_prepareUserArgs(X,Q){if(X!==void 0&&!Array.isArray(X))throw Error("first parameter to parse must be array or undefined");if(Q=Q||{},X===void 0&&Q.from===void 0){if(Z0.versions?.electron)Q.from="electron";let Y=Z0.execArgv??[];if(Y.includes("-e")||Y.includes("--eval")||Y.includes("-p")||Y.includes("--print"))Q.from="eval"}if(X===void 0)X=Z0.argv;this.rawArgs=X.slice();let J;switch(Q.from){case void 0:case"node":this._scriptPath=X[1],J=X.slice(2);break;case"electron":if(Z0.defaultApp)this._scriptPath=X[1],J=X.slice(2);else J=X.slice(1);break;case"user":J=X.slice(0);break;case"eval":J=X.slice(1);break;default:throw Error(`unexpected parse option { from: '${Q.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);return this._name=this._name||"program",J}parse(X,Q){this._prepareForParse();let J=this._prepareUserArgs(X,Q);return this._parseCommand([],J),this}async parseAsync(X,Q){this._prepareForParse();let J=this._prepareUserArgs(X,Q);return await this._parseCommand([],J),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.
19
+ - 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(X,Q,J){if(y8.existsSync(X))return;let Y=Q?`searched for local subcommand relative to directory '${Q}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",G=`'${X}' does not exist
20
20
  - if '${J}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
21
21
  - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
22
- - ${Y}`;throw Error(G)}_executeSubCommand(X,Q){Q=Q.slice();let J=!1,Y=[".js",".ts",".tsx",".mjs",".cjs"];function G(z,F){let K=A1.resolve(z,F);if(v8.existsSync(K))return K;if(Y.includes(A1.extname(F)))return;let M=Y.find((R)=>v8.existsSync(`${K}${R}`));if(M)return`${K}${M}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let $=X._executableFile||`${this._name}-${X._name}`,W=this._executableDir||"";if(this._scriptPath){let z;try{z=v8.realpathSync(this._scriptPath)}catch{z=this._scriptPath}W=A1.resolve(A1.dirname(z),W)}if(W){let z=G(W,$);if(!z&&!X._executableFile&&this._scriptPath){let F=A1.basename(this._scriptPath,A1.extname(this._scriptPath));if(F!==this._name)z=G(W,`${F}-${X._name}`)}$=z||$}J=Y.includes(A1.extname($));let H;if(D0.platform!=="win32")if(J)Q.unshift($),Q=E5(D0.execArgv).concat(Q),H=BX.spawn(D0.argv[0],Q,{stdio:"inherit"});else H=BX.spawn($,Q,{stdio:"inherit"});else this._checkForMissingExecutable($,W,X._name),Q.unshift($),Q=E5(D0.execArgv).concat(Q),H=BX.spawn(D0.execPath,Q,{stdio:"inherit"});if(!H.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((F)=>{D0.on(F,()=>{if(H.killed===!1&&H.exitCode===null)H.kill(F)})});let U=this._exitCallback;H.on("close",(z)=>{if(z=z??1,!U)D0.exit(z);else U(new LX(z,"commander.executeSubCommandAsync","(close)"))}),H.on("error",(z)=>{if(z.code==="ENOENT")this._checkForMissingExecutable($,W,X._name);else if(z.code==="EACCES")throw Error(`'${$}' not executable`);if(!U)D0.exit(1);else{let F=new LX(1,"commander.executeSubCommandAsync","(error)");F.nestedError=z,U(F)}}),this.runningCommand=H}_dispatchSubcommand(X,Q,J){let Y=this._findCommand(X);if(!Y)this.help({error:!0});Y._prepareForParse();let G;return G=this._chainOrCallSubCommandHook(G,Y,"preSubcommand"),G=this._chainOrCall(G,()=>{if(Y._executableHandler)this._executeSubCommand(Y,Q.concat(J));else return Y._parseCommand(Q,J)}),G}_dispatchHelpCommand(X){if(!X)this.help();let Q=this._findCommand(X);if(Q&&!Q._executableHandler)Q.help();return this._dispatchSubcommand(X,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){if(this.registeredArguments.forEach((X,Q)=>{if(X.required&&this.args[Q]==null)this.missingArgument(X.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 X=(J,Y,G)=>{let $=Y;if(Y!==null&&J.parseArg){let W=`error: command-argument value '${Y}' is invalid for argument '${J.name()}'.`;$=this._callParseArg(J,Y,G,W)}return $};this._checkNumberOfArguments();let Q=[];this.registeredArguments.forEach((J,Y)=>{let G=J.defaultValue;if(J.variadic){if(Y<this.args.length){if(G=this.args.slice(Y),J.parseArg)G=G.reduce(($,W)=>{return X(J,W,$)},J.defaultValue)}else if(G===void 0)G=[]}else if(Y<this.args.length){if(G=this.args[Y],J.parseArg)G=X(J,G,J.defaultValue)}Q[Y]=G}),this.processedArgs=Q}_chainOrCall(X,Q){if(X?.then&&typeof X.then==="function")return X.then(()=>Q());return Q()}_chainOrCallHooks(X,Q){let J=X,Y=[];if(this._getCommandAndAncestors().reverse().filter((G)=>G._lifeCycleHooks[Q]!==void 0).forEach((G)=>{G._lifeCycleHooks[Q].forEach(($)=>{Y.push({hookedCommand:G,callback:$})})}),Q==="postAction")Y.reverse();return Y.forEach((G)=>{J=this._chainOrCall(J,()=>{return G.callback(G.hookedCommand,this)})}),J}_chainOrCallSubCommandHook(X,Q,J){let Y=X;if(this._lifeCycleHooks[J]!==void 0)this._lifeCycleHooks[J].forEach((G)=>{Y=this._chainOrCall(Y,()=>{return G(this,Q)})});return Y}_parseCommand(X,Q){let J=this.parseOptions(Q);if(this._parseOptionsEnv(),this._parseOptionsImplied(),X=X.concat(J.operands),Q=J.unknown,this.args=X.concat(Q),X&&this._findCommand(X[0]))return this._dispatchSubcommand(X[0],X.slice(1),Q);if(this._getHelpCommand()&&X[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(X[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(Q),this._dispatchSubcommand(this._defaultCommandName,X,Q);if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName)this.help({error:!0});this._outputHelpIfRequested(J.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let Y=()=>{if(J.unknown.length>0)this.unknownOption(J.unknown[0])},G=`command:${this.name()}`;if(this._actionHandler){Y(),this._processArguments();let $;if($=this._chainOrCallHooks($,"preAction"),$=this._chainOrCall($,()=>this._actionHandler(this.processedArgs)),this.parent)$=this._chainOrCall($,()=>{this.parent.emit(G,X,Q)});return $=this._chainOrCallHooks($,"postAction"),$}if(this.parent?.listenerCount(G))Y(),this._processArguments(),this.parent.emit(G,X,Q);else if(X.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",X,Q);if(this.listenerCount("command:*"))this.emit("command:*",X,Q);else if(this.commands.length)this.unknownCommand();else Y(),this._processArguments()}else if(this.commands.length)Y(),this.help({error:!0});else Y(),this._processArguments()}_findCommand(X){if(!X)return;return this.commands.find((Q)=>Q._name===X||Q._aliases.includes(X))}_findOption(X){return this.options.find((Q)=>Q.is(X))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach((X)=>{X.options.forEach((Q)=>{if(Q.mandatory&&X.getOptionValue(Q.attributeName())===void 0)X.missingMandatoryOptionValue(Q)})})}_checkForConflictingLocalOptions(){let X=this.options.filter((J)=>{let Y=J.attributeName();if(this.getOptionValue(Y)===void 0)return!1;return this.getOptionValueSource(Y)!=="default"});X.filter((J)=>J.conflictsWith.length>0).forEach((J)=>{let Y=X.find((G)=>J.conflictsWith.includes(G.attributeName()));if(Y)this._conflictingOption(J,Y)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach((X)=>{X._checkForConflictingLocalOptions()})}parseOptions(X){let Q=[],J=[],Y=Q;function G(z){return z.length>1&&z[0]==="-"}let $=(z)=>{if(!/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(z))return!1;return!this._getCommandAndAncestors().some((F)=>F.options.map((K)=>K.short).some((K)=>/^-\d$/.test(K)))},W=null,H=null,U=0;while(U<X.length||H){let z=H??X[U++];if(H=null,z==="--"){if(Y===J)Y.push(z);Y.push(...X.slice(U));break}if(W&&(!G(z)||$(z))){this.emit(`option:${W.name()}`,z);continue}if(W=null,G(z)){let F=this._findOption(z);if(F){if(F.required){let K=X[U++];if(K===void 0)this.optionMissingArgument(F);this.emit(`option:${F.name()}`,K)}else if(F.optional){let K=null;if(U<X.length&&(!G(X[U])||$(X[U])))K=X[U++];this.emit(`option:${F.name()}`,K)}else this.emit(`option:${F.name()}`);W=F.variadic?F:null;continue}}if(z.length>2&&z[0]==="-"&&z[1]!=="-"){let F=this._findOption(`-${z[1]}`);if(F){if(F.required||F.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${F.name()}`,z.slice(2));else this.emit(`option:${F.name()}`),H=`-${z.slice(2)}`;continue}}if(/^--[^=]+=/.test(z)){let F=z.indexOf("="),K=this._findOption(z.slice(0,F));if(K&&(K.required||K.optional)){this.emit(`option:${K.name()}`,z.slice(F+1));continue}}if(Y===Q&&G(z)&&!(this.commands.length===0&&$(z)))Y=J;if((this._enablePositionalOptions||this._passThroughOptions)&&Q.length===0&&J.length===0){if(this._findCommand(z)){Q.push(z),J.push(...X.slice(U));break}else if(this._getHelpCommand()&&z===this._getHelpCommand().name()){Q.push(z,...X.slice(U));break}else if(this._defaultCommandName){J.push(z,...X.slice(U));break}}if(this._passThroughOptions){Y.push(z,...X.slice(U));break}Y.push(z)}return{operands:Q,unknown:J}}opts(){if(this._storeOptionsAsProperties){let X={},Q=this.options.length;for(let J=0;J<Q;J++){let Y=this.options[J].attributeName();X[Y]=Y===this._versionOptionName?this._version:this[Y]}return X}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((X,Q)=>Object.assign(X,Q.opts()),{})}error(X,Q){if(this._outputConfiguration.outputError(`${X}
22
+ - ${Y}`;throw Error(G)}_executeSubCommand(X,Q){Q=Q.slice();let J=!1,Y=[".js",".ts",".tsx",".mjs",".cjs"];function G(B,q){let K=A1.resolve(B,q);if(y8.existsSync(K))return K;if(Y.includes(A1.extname(q)))return;let V=Y.find((N)=>y8.existsSync(`${K}${N}`));if(V)return`${K}${V}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let $=X._executableFile||`${this._name}-${X._name}`,W=this._executableDir||"";if(this._scriptPath){let B;try{B=y8.realpathSync(this._scriptPath)}catch{B=this._scriptPath}W=A1.resolve(A1.dirname(B),W)}if(W){let B=G(W,$);if(!B&&!X._executableFile&&this._scriptPath){let q=A1.basename(this._scriptPath,A1.extname(this._scriptPath));if(q!==this._name)B=G(W,`${q}-${X._name}`)}$=B||$}J=Y.includes(A1.extname($));let H;if(Z0.platform!=="win32")if(J)Q.unshift($),Q=y4(Z0.execArgv).concat(Q),H=LX.spawn(Z0.argv[0],Q,{stdio:"inherit"});else H=LX.spawn($,Q,{stdio:"inherit"});else this._checkForMissingExecutable($,W,X._name),Q.unshift($),Q=y4(Z0.execArgv).concat(Q),H=LX.spawn(Z0.execPath,Q,{stdio:"inherit"});if(!H.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((q)=>{Z0.on(q,()=>{if(H.killed===!1&&H.exitCode===null)H.kill(q)})});let U=this._exitCallback;H.on("close",(B)=>{if(B=B??1,!U)Z0.exit(B);else U(new qX(B,"commander.executeSubCommandAsync","(close)"))}),H.on("error",(B)=>{if(B.code==="ENOENT")this._checkForMissingExecutable($,W,X._name);else if(B.code==="EACCES")throw Error(`'${$}' not executable`);if(!U)Z0.exit(1);else{let q=new qX(1,"commander.executeSubCommandAsync","(error)");q.nestedError=B,U(q)}}),this.runningCommand=H}_dispatchSubcommand(X,Q,J){let Y=this._findCommand(X);if(!Y)this.help({error:!0});Y._prepareForParse();let G;return G=this._chainOrCallSubCommandHook(G,Y,"preSubcommand"),G=this._chainOrCall(G,()=>{if(Y._executableHandler)this._executeSubCommand(Y,Q.concat(J));else return Y._parseCommand(Q,J)}),G}_dispatchHelpCommand(X){if(!X)this.help();let Q=this._findCommand(X);if(Q&&!Q._executableHandler)Q.help();return this._dispatchSubcommand(X,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){if(this.registeredArguments.forEach((X,Q)=>{if(X.required&&this.args[Q]==null)this.missingArgument(X.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 X=(J,Y,G)=>{let $=Y;if(Y!==null&&J.parseArg){let W=`error: command-argument value '${Y}' is invalid for argument '${J.name()}'.`;$=this._callParseArg(J,Y,G,W)}return $};this._checkNumberOfArguments();let Q=[];this.registeredArguments.forEach((J,Y)=>{let G=J.defaultValue;if(J.variadic){if(Y<this.args.length){if(G=this.args.slice(Y),J.parseArg)G=G.reduce(($,W)=>{return X(J,W,$)},J.defaultValue)}else if(G===void 0)G=[]}else if(Y<this.args.length){if(G=this.args[Y],J.parseArg)G=X(J,G,J.defaultValue)}Q[Y]=G}),this.processedArgs=Q}_chainOrCall(X,Q){if(X?.then&&typeof X.then==="function")return X.then(()=>Q());return Q()}_chainOrCallHooks(X,Q){let J=X,Y=[];if(this._getCommandAndAncestors().reverse().filter((G)=>G._lifeCycleHooks[Q]!==void 0).forEach((G)=>{G._lifeCycleHooks[Q].forEach(($)=>{Y.push({hookedCommand:G,callback:$})})}),Q==="postAction")Y.reverse();return Y.forEach((G)=>{J=this._chainOrCall(J,()=>{return G.callback(G.hookedCommand,this)})}),J}_chainOrCallSubCommandHook(X,Q,J){let Y=X;if(this._lifeCycleHooks[J]!==void 0)this._lifeCycleHooks[J].forEach((G)=>{Y=this._chainOrCall(Y,()=>{return G(this,Q)})});return Y}_parseCommand(X,Q){let J=this.parseOptions(Q);if(this._parseOptionsEnv(),this._parseOptionsImplied(),X=X.concat(J.operands),Q=J.unknown,this.args=X.concat(Q),X&&this._findCommand(X[0]))return this._dispatchSubcommand(X[0],X.slice(1),Q);if(this._getHelpCommand()&&X[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(X[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(Q),this._dispatchSubcommand(this._defaultCommandName,X,Q);if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName)this.help({error:!0});this._outputHelpIfRequested(J.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let Y=()=>{if(J.unknown.length>0)this.unknownOption(J.unknown[0])},G=`command:${this.name()}`;if(this._actionHandler){Y(),this._processArguments();let $;if($=this._chainOrCallHooks($,"preAction"),$=this._chainOrCall($,()=>this._actionHandler(this.processedArgs)),this.parent)$=this._chainOrCall($,()=>{this.parent.emit(G,X,Q)});return $=this._chainOrCallHooks($,"postAction"),$}if(this.parent?.listenerCount(G))Y(),this._processArguments(),this.parent.emit(G,X,Q);else if(X.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",X,Q);if(this.listenerCount("command:*"))this.emit("command:*",X,Q);else if(this.commands.length)this.unknownCommand();else Y(),this._processArguments()}else if(this.commands.length)Y(),this.help({error:!0});else Y(),this._processArguments()}_findCommand(X){if(!X)return;return this.commands.find((Q)=>Q._name===X||Q._aliases.includes(X))}_findOption(X){return this.options.find((Q)=>Q.is(X))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach((X)=>{X.options.forEach((Q)=>{if(Q.mandatory&&X.getOptionValue(Q.attributeName())===void 0)X.missingMandatoryOptionValue(Q)})})}_checkForConflictingLocalOptions(){let X=this.options.filter((J)=>{let Y=J.attributeName();if(this.getOptionValue(Y)===void 0)return!1;return this.getOptionValueSource(Y)!=="default"});X.filter((J)=>J.conflictsWith.length>0).forEach((J)=>{let Y=X.find((G)=>J.conflictsWith.includes(G.attributeName()));if(Y)this._conflictingOption(J,Y)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach((X)=>{X._checkForConflictingLocalOptions()})}parseOptions(X){let Q=[],J=[],Y=Q;function G(B){return B.length>1&&B[0]==="-"}let $=(B)=>{if(!/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(B))return!1;return!this._getCommandAndAncestors().some((q)=>q.options.map((K)=>K.short).some((K)=>/^-\d$/.test(K)))},W=null,H=null,U=0;while(U<X.length||H){let B=H??X[U++];if(H=null,B==="--"){if(Y===J)Y.push(B);Y.push(...X.slice(U));break}if(W&&(!G(B)||$(B))){this.emit(`option:${W.name()}`,B);continue}if(W=null,G(B)){let q=this._findOption(B);if(q){if(q.required){let K=X[U++];if(K===void 0)this.optionMissingArgument(q);this.emit(`option:${q.name()}`,K)}else if(q.optional){let K=null;if(U<X.length&&(!G(X[U])||$(X[U])))K=X[U++];this.emit(`option:${q.name()}`,K)}else this.emit(`option:${q.name()}`);W=q.variadic?q:null;continue}}if(B.length>2&&B[0]==="-"&&B[1]!=="-"){let q=this._findOption(`-${B[1]}`);if(q){if(q.required||q.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${q.name()}`,B.slice(2));else this.emit(`option:${q.name()}`),H=`-${B.slice(2)}`;continue}}if(/^--[^=]+=/.test(B)){let q=B.indexOf("="),K=this._findOption(B.slice(0,q));if(K&&(K.required||K.optional)){this.emit(`option:${K.name()}`,B.slice(q+1));continue}}if(Y===Q&&G(B)&&!(this.commands.length===0&&$(B)))Y=J;if((this._enablePositionalOptions||this._passThroughOptions)&&Q.length===0&&J.length===0){if(this._findCommand(B)){Q.push(B),J.push(...X.slice(U));break}else if(this._getHelpCommand()&&B===this._getHelpCommand().name()){Q.push(B,...X.slice(U));break}else if(this._defaultCommandName){J.push(B,...X.slice(U));break}}if(this._passThroughOptions){Y.push(B,...X.slice(U));break}Y.push(B)}return{operands:Q,unknown:J}}opts(){if(this._storeOptionsAsProperties){let X={},Q=this.options.length;for(let J=0;J<Q;J++){let Y=this.options[J].attributeName();X[Y]=Y===this._versionOptionName?this._version:this[Y]}return X}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((X,Q)=>Object.assign(X,Q.opts()),{})}error(X,Q){if(this._outputConfiguration.outputError(`${X}
23
23
  `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError==="string")this._outputConfiguration.writeErr(`${this._showHelpAfterError}
24
24
  `);else if(this._showHelpAfterError)this._outputConfiguration.writeErr(`
25
- `),this.outputHelp({error:!0});let J=Q||{},Y=J.exitCode||1,G=J.code||"commander.error";this._exit(Y,G,X)}_parseOptionsEnv(){this.options.forEach((X)=>{if(X.envVar&&X.envVar in D0.env){let Q=X.attributeName();if(this.getOptionValue(Q)===void 0||["default","config","env"].includes(this.getOptionValueSource(Q)))if(X.required||X.optional)this.emit(`optionEnv:${X.name()}`,D0.env[X.envVar]);else this.emit(`optionEnv:${X.name()}`)}})}_parseOptionsImplied(){let X=new q$(this.options),Q=(J)=>{return this.getOptionValue(J)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(J))};this.options.filter((J)=>J.implied!==void 0&&Q(J.attributeName())&&X.valueFromOption(this.getOptionValue(J.attributeName()),J)).forEach((J)=>{Object.keys(J.implied).filter((Y)=>!Q(Y)).forEach((Y)=>{this.setOptionValueWithSource(Y,J.implied[Y],"implied")})})}missingArgument(X){let Q=`error: missing required argument '${X}'`;this.error(Q,{code:"commander.missingArgument"})}optionMissingArgument(X){let Q=`error: option '${X.flags}' argument missing`;this.error(Q,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(X){let Q=`error: required option '${X.flags}' not specified`;this.error(Q,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(X,Q){let J=($)=>{let W=$.attributeName(),H=this.getOptionValue(W),U=this.options.find((F)=>F.negate&&W===F.attributeName()),z=this.options.find((F)=>!F.negate&&W===F.attributeName());if(U&&(U.presetArg===void 0&&H===!1||U.presetArg!==void 0&&H===U.presetArg))return U;return z||$},Y=($)=>{let W=J($),H=W.attributeName();if(this.getOptionValueSource(H)==="env")return`environment variable '${W.envVar}'`;return`option '${W.flags}'`},G=`error: ${Y(X)} cannot be used with ${Y(Q)}`;this.error(G,{code:"commander.conflictingOption"})}unknownOption(X){if(this._allowUnknownOption)return;let Q="";if(X.startsWith("--")&&this._showSuggestionAfterError){let Y=[],G=this;do{let $=G.createHelp().visibleOptions(G).filter((W)=>W.long).map((W)=>W.long);Y=Y.concat($),G=G.parent}while(G&&!G._enablePositionalOptions);Q=S5(X,Y)}let J=`error: unknown option '${X}'${Q}`;this.error(J,{code:"commander.unknownOption"})}_excessArguments(X){if(this._allowExcessArguments)return;let Q=this.registeredArguments.length,J=Q===1?"":"s",G=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${Q} argument${J} but got ${X.length}.`;this.error(G,{code:"commander.excessArguments"})}unknownCommand(){let X=this.args[0],Q="";if(this._showSuggestionAfterError){let Y=[];this.createHelp().visibleCommands(this).forEach((G)=>{if(Y.push(G.name()),G.alias())Y.push(G.alias())}),Q=S5(X,Y)}let J=`error: unknown command '${X}'${Q}`;this.error(J,{code:"commander.unknownCommand"})}version(X,Q,J){if(X===void 0)return this._version;this._version=X,Q=Q||"-V, --version",J=J||"output the version number";let Y=this.createOption(Q,J);return this._versionOptionName=Y.attributeName(),this._registerOption(Y),this.on("option:"+Y.name(),()=>{this._outputConfiguration.writeOut(`${X}
26
- `),this._exit(0,"commander.version",X)}),this}description(X,Q){if(X===void 0&&Q===void 0)return this._description;if(this._description=X,Q)this._argsDescription=Q;return this}summary(X){if(X===void 0)return this._summary;return this._summary=X,this}alias(X){if(X===void 0)return this._aliases[0];let Q=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)Q=this.commands[this.commands.length-1];if(X===Q._name)throw Error("Command alias can't be the same as its name");let J=this.parent?._findCommand(X);if(J){let Y=[J.name()].concat(J.aliases()).join("|");throw Error(`cannot add alias '${X}' to command '${this.name()}' as already have command '${Y}'`)}return Q._aliases.push(X),this}aliases(X){if(X===void 0)return this._aliases;return X.forEach((Q)=>this.alias(Q)),this}usage(X){if(X===void 0){if(this._usage)return this._usage;let Q=this.registeredArguments.map((J)=>{return z$(J)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?Q:[]).join(" ")}return this._usage=X,this}name(X){if(X===void 0)return this._name;return this._name=X,this}helpGroup(X){if(X===void 0)return this._helpGroupHeading??"";return this._helpGroupHeading=X,this}commandsGroup(X){if(X===void 0)return this._defaultCommandGroup??"";return this._defaultCommandGroup=X,this}optionsGroup(X){if(X===void 0)return this._defaultOptionGroup??"";return this._defaultOptionGroup=X,this}_initOptionGroup(X){if(this._defaultOptionGroup&&!X.helpGroupHeading)X.helpGroup(this._defaultOptionGroup)}_initCommandGroup(X){if(this._defaultCommandGroup&&!X.helpGroup())X.helpGroup(this._defaultCommandGroup)}nameFromFilename(X){return this._name=A1.basename(X,A1.extname(X)),this}executableDir(X){if(X===void 0)return this._executableDir;return this._executableDir=X,this}helpInformation(X){let Q=this.createHelp(),J=this._getOutputContext(X);Q.prepareContext({error:J.error,helpWidth:J.helpWidth,outputHasColors:J.hasColors});let Y=Q.formatHelp(this,Q);if(J.hasColors)return Y;return this._outputConfiguration.stripColor(Y)}_getOutputContext(X){X=X||{};let Q=!!X.error,J,Y,G;if(Q)J=(W)=>this._outputConfiguration.writeErr(W),Y=this._outputConfiguration.getErrHasColors(),G=this._outputConfiguration.getErrHelpWidth();else J=(W)=>this._outputConfiguration.writeOut(W),Y=this._outputConfiguration.getOutHasColors(),G=this._outputConfiguration.getOutHelpWidth();return{error:Q,write:(W)=>{if(!Y)W=this._outputConfiguration.stripColor(W);return J(W)},hasColors:Y,helpWidth:G}}outputHelp(X){let Q;if(typeof X==="function")Q=X,X=void 0;let J=this._getOutputContext(X),Y={error:J.error,write:J.write,command:this};this._getCommandAndAncestors().reverse().forEach(($)=>$.emit("beforeAllHelp",Y)),this.emit("beforeHelp",Y);let G=this.helpInformation({error:J.error});if(Q){if(G=Q(G),typeof G!=="string"&&!Buffer.isBuffer(G))throw Error("outputHelp callback must return a string or a Buffer")}if(J.write(G),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",Y),this._getCommandAndAncestors().forEach(($)=>$.emit("afterAllHelp",Y))}helpOption(X,Q){if(typeof X==="boolean"){if(X){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(X??"-h, --help",Q??"display help for command"),X||Q)this._initOptionGroup(this._helpOption);return this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption(X){return this._helpOption=X,this._initOptionGroup(X),this}help(X){this.outputHelp(X);let Q=Number(D0.exitCode??0);if(Q===0&&X&&typeof X!=="function"&&X.error)Q=1;this._exit(Q,"commander.help","(outputHelp)")}addHelpText(X,Q){let J=["beforeAll","before","after","afterAll"];if(!J.includes(X))throw Error(`Unexpected value for position to addHelpText.
25
+ `),this.outputHelp({error:!0});let J=Q||{},Y=J.exitCode||1,G=J.code||"commander.error";this._exit(Y,G,X)}_parseOptionsEnv(){this.options.forEach((X)=>{if(X.envVar&&X.envVar in Z0.env){let Q=X.attributeName();if(this.getOptionValue(Q)===void 0||["default","config","env"].includes(this.getOptionValueSource(Q)))if(X.required||X.optional)this.emit(`optionEnv:${X.name()}`,Z0.env[X.envVar]);else this.emit(`optionEnv:${X.name()}`)}})}_parseOptionsImplied(){let X=new N$(this.options),Q=(J)=>{return this.getOptionValue(J)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(J))};this.options.filter((J)=>J.implied!==void 0&&Q(J.attributeName())&&X.valueFromOption(this.getOptionValue(J.attributeName()),J)).forEach((J)=>{Object.keys(J.implied).filter((Y)=>!Q(Y)).forEach((Y)=>{this.setOptionValueWithSource(Y,J.implied[Y],"implied")})})}missingArgument(X){let Q=`error: missing required argument '${X}'`;this.error(Q,{code:"commander.missingArgument"})}optionMissingArgument(X){let Q=`error: option '${X.flags}' argument missing`;this.error(Q,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(X){let Q=`error: required option '${X.flags}' not specified`;this.error(Q,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(X,Q){let J=($)=>{let W=$.attributeName(),H=this.getOptionValue(W),U=this.options.find((q)=>q.negate&&W===q.attributeName()),B=this.options.find((q)=>!q.negate&&W===q.attributeName());if(U&&(U.presetArg===void 0&&H===!1||U.presetArg!==void 0&&H===U.presetArg))return U;return B||$},Y=($)=>{let W=J($),H=W.attributeName();if(this.getOptionValueSource(H)==="env")return`environment variable '${W.envVar}'`;return`option '${W.flags}'`},G=`error: ${Y(X)} cannot be used with ${Y(Q)}`;this.error(G,{code:"commander.conflictingOption"})}unknownOption(X){if(this._allowUnknownOption)return;let Q="";if(X.startsWith("--")&&this._showSuggestionAfterError){let Y=[],G=this;do{let $=G.createHelp().visibleOptions(G).filter((W)=>W.long).map((W)=>W.long);Y=Y.concat($),G=G.parent}while(G&&!G._enablePositionalOptions);Q=v4(X,Y)}let J=`error: unknown option '${X}'${Q}`;this.error(J,{code:"commander.unknownOption"})}_excessArguments(X){if(this._allowExcessArguments)return;let Q=this.registeredArguments.length,J=Q===1?"":"s",G=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${Q} argument${J} but got ${X.length}.`;this.error(G,{code:"commander.excessArguments"})}unknownCommand(){let X=this.args[0],Q="";if(this._showSuggestionAfterError){let Y=[];this.createHelp().visibleCommands(this).forEach((G)=>{if(Y.push(G.name()),G.alias())Y.push(G.alias())}),Q=v4(X,Y)}let J=`error: unknown command '${X}'${Q}`;this.error(J,{code:"commander.unknownCommand"})}version(X,Q,J){if(X===void 0)return this._version;this._version=X,Q=Q||"-V, --version",J=J||"output the version number";let Y=this.createOption(Q,J);return this._versionOptionName=Y.attributeName(),this._registerOption(Y),this.on("option:"+Y.name(),()=>{this._outputConfiguration.writeOut(`${X}
26
+ `),this._exit(0,"commander.version",X)}),this}description(X,Q){if(X===void 0&&Q===void 0)return this._description;if(this._description=X,Q)this._argsDescription=Q;return this}summary(X){if(X===void 0)return this._summary;return this._summary=X,this}alias(X){if(X===void 0)return this._aliases[0];let Q=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)Q=this.commands[this.commands.length-1];if(X===Q._name)throw Error("Command alias can't be the same as its name");let J=this.parent?._findCommand(X);if(J){let Y=[J.name()].concat(J.aliases()).join("|");throw Error(`cannot add alias '${X}' to command '${this.name()}' as already have command '${Y}'`)}return Q._aliases.push(X),this}aliases(X){if(X===void 0)return this._aliases;return X.forEach((Q)=>this.alias(Q)),this}usage(X){if(X===void 0){if(this._usage)return this._usage;let Q=this.registeredArguments.map((J)=>{return Z$(J)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?Q:[]).join(" ")}return this._usage=X,this}name(X){if(X===void 0)return this._name;return this._name=X,this}helpGroup(X){if(X===void 0)return this._helpGroupHeading??"";return this._helpGroupHeading=X,this}commandsGroup(X){if(X===void 0)return this._defaultCommandGroup??"";return this._defaultCommandGroup=X,this}optionsGroup(X){if(X===void 0)return this._defaultOptionGroup??"";return this._defaultOptionGroup=X,this}_initOptionGroup(X){if(this._defaultOptionGroup&&!X.helpGroupHeading)X.helpGroup(this._defaultOptionGroup)}_initCommandGroup(X){if(this._defaultCommandGroup&&!X.helpGroup())X.helpGroup(this._defaultCommandGroup)}nameFromFilename(X){return this._name=A1.basename(X,A1.extname(X)),this}executableDir(X){if(X===void 0)return this._executableDir;return this._executableDir=X,this}helpInformation(X){let Q=this.createHelp(),J=this._getOutputContext(X);Q.prepareContext({error:J.error,helpWidth:J.helpWidth,outputHasColors:J.hasColors});let Y=Q.formatHelp(this,Q);if(J.hasColors)return Y;return this._outputConfiguration.stripColor(Y)}_getOutputContext(X){X=X||{};let Q=!!X.error,J,Y,G;if(Q)J=(W)=>this._outputConfiguration.writeErr(W),Y=this._outputConfiguration.getErrHasColors(),G=this._outputConfiguration.getErrHelpWidth();else J=(W)=>this._outputConfiguration.writeOut(W),Y=this._outputConfiguration.getOutHasColors(),G=this._outputConfiguration.getOutHelpWidth();return{error:Q,write:(W)=>{if(!Y)W=this._outputConfiguration.stripColor(W);return J(W)},hasColors:Y,helpWidth:G}}outputHelp(X){let Q;if(typeof X==="function")Q=X,X=void 0;let J=this._getOutputContext(X),Y={error:J.error,write:J.write,command:this};this._getCommandAndAncestors().reverse().forEach(($)=>$.emit("beforeAllHelp",Y)),this.emit("beforeHelp",Y);let G=this.helpInformation({error:J.error});if(Q){if(G=Q(G),typeof G!=="string"&&!Buffer.isBuffer(G))throw Error("outputHelp callback must return a string or a Buffer")}if(J.write(G),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",Y),this._getCommandAndAncestors().forEach(($)=>$.emit("afterAllHelp",Y))}helpOption(X,Q){if(typeof X==="boolean"){if(X){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(X??"-h, --help",Q??"display help for command"),X||Q)this._initOptionGroup(this._helpOption);return this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption(X){return this._helpOption=X,this._initOptionGroup(X),this}help(X){this.outputHelp(X);let Q=Number(Z0.exitCode??0);if(Q===0&&X&&typeof X!=="function"&&X.error)Q=1;this._exit(Q,"commander.help","(outputHelp)")}addHelpText(X,Q){let J=["beforeAll","before","after","afterAll"];if(!J.includes(X))throw Error(`Unexpected value for position to addHelpText.
27
27
  Expecting one of '${J.join("', '")}'`);let Y=`${X}Help`;return this.on(Y,(G)=>{let $;if(typeof Q==="function")$=Q({error:G.error,command:G.command});else $=Q;if($)G.write(`${$}
28
- `)}),this}_outputHelpIfRequested(X){let Q=this._getHelpOption();if(Q&&X.find((Y)=>Q.is(Y)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function E5(X){return X.map((Q)=>{if(!Q.startsWith("--inspect"))return Q;let J,Y="127.0.0.1",G="9229",$;if(($=Q.match(/^(--inspect(-brk)?)$/))!==null)J=$[1];else if(($=Q.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(J=$[1],/^\d+$/.test($[3]))G=$[3];else Y=$[3];else if(($=Q.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)J=$[1],Y=$[3],G=$[4];if(J&&G!=="0")return`${J}=${Y}:${parseInt(G)+1}`;return Q})}function qX(){if(D0.env.NO_COLOR||D0.env.FORCE_COLOR==="0"||D0.env.FORCE_COLOR==="false")return!1;if(D0.env.FORCE_COLOR||D0.env.CLICOLOR_FORCE!==void 0)return!0;return}F$.Command=FX;F$.useColor=qX});var v5=p((Z$)=>{var{Argument:C5}=k8(),{Command:KX}=b5(),{CommanderError:M$,InvalidArgumentError:_5}=v9(),{Help:D$}=UX(),{Option:k5}=zX();Z$.program=new KX;Z$.createCommand=(X)=>new KX(X);Z$.createOption=(X,Q)=>new k5(X,Q);Z$.createArgument=(X,Q)=>new C5(X,Q);Z$.Command=KX;Z$.Option=k5;Z$.Argument=C5;Z$.Help=D$;Z$.CommanderError=M$;Z$.InvalidArgumentError=_5;Z$.InvalidOptionArgumentError=_5});var K0=p((hV)=>{var YQ=Symbol.for("yaml.alias"),N7=Symbol.for("yaml.document"),Z6=Symbol.for("yaml.map"),R7=Symbol.for("yaml.pair"),GQ=Symbol.for("yaml.scalar"),O6=Symbol.for("yaml.seq"),E1=Symbol.for("yaml.node.type"),CV=(X)=>!!X&&typeof X==="object"&&X[E1]===YQ,_V=(X)=>!!X&&typeof X==="object"&&X[E1]===N7,kV=(X)=>!!X&&typeof X==="object"&&X[E1]===Z6,vV=(X)=>!!X&&typeof X==="object"&&X[E1]===R7,I7=(X)=>!!X&&typeof X==="object"&&X[E1]===GQ,yV=(X)=>!!X&&typeof X==="object"&&X[E1]===O6;function j7(X){if(X&&typeof X==="object")switch(X[E1]){case Z6:case O6:return!0}return!1}function xV(X){if(X&&typeof X==="object")switch(X[E1]){case YQ:case Z6:case GQ:case O6:return!0}return!1}var gV=(X)=>(I7(X)||j7(X))&&!!X.anchor;hV.ALIAS=YQ;hV.DOC=N7;hV.MAP=Z6;hV.NODE_TYPE=E1;hV.PAIR=R7;hV.SCALAR=GQ;hV.SEQ=O6;hV.hasAnchor=gV;hV.isAlias=CV;hV.isCollection=j7;hV.isDocument=_V;hV.isMap=kV;hV.isNode=xV;hV.isPair=vV;hV.isScalar=I7;hV.isSeq=yV});var z8=p((QM)=>{var g0=K0(),a0=Symbol("break visit"),w7=Symbol("skip children"),D1=Symbol("remove node");function A6(X,Q){let J=P7(Q);if(g0.isDocument(X)){if(R9(null,X.contents,J,Object.freeze([X]))===D1)X.contents=null}else R9(null,X,J,Object.freeze([]))}A6.BREAK=a0;A6.SKIP=w7;A6.REMOVE=D1;function R9(X,Q,J,Y){let G=T7(X,Q,J,Y);if(g0.isNode(G)||g0.isPair(G))return S7(X,Y,G),R9(X,G,J,Y);if(typeof G!=="symbol"){if(g0.isCollection(Q)){Y=Object.freeze(Y.concat(Q));for(let $=0;$<Q.items.length;++$){let W=R9($,Q.items[$],J,Y);if(typeof W==="number")$=W-1;else if(W===a0)return a0;else if(W===D1)Q.items.splice($,1),$-=1}}else if(g0.isPair(Q)){Y=Object.freeze(Y.concat(Q));let $=R9("key",Q.key,J,Y);if($===a0)return a0;else if($===D1)Q.key=null;let W=R9("value",Q.value,J,Y);if(W===a0)return a0;else if(W===D1)Q.value=null}}return G}async function N6(X,Q){let J=P7(Q);if(g0.isDocument(X)){if(await I9(null,X.contents,J,Object.freeze([X]))===D1)X.contents=null}else await I9(null,X,J,Object.freeze([]))}N6.BREAK=a0;N6.SKIP=w7;N6.REMOVE=D1;async function I9(X,Q,J,Y){let G=await T7(X,Q,J,Y);if(g0.isNode(G)||g0.isPair(G))return S7(X,Y,G),I9(X,G,J,Y);if(typeof G!=="symbol"){if(g0.isCollection(Q)){Y=Object.freeze(Y.concat(Q));for(let $=0;$<Q.items.length;++$){let W=await I9($,Q.items[$],J,Y);if(typeof W==="number")$=W-1;else if(W===a0)return a0;else if(W===D1)Q.items.splice($,1),$-=1}}else if(g0.isPair(Q)){Y=Object.freeze(Y.concat(Q));let $=await I9("key",Q.key,J,Y);if($===a0)return a0;else if($===D1)Q.key=null;let W=await I9("value",Q.value,J,Y);if(W===a0)return a0;else if(W===D1)Q.value=null}}return G}function P7(X){if(typeof X==="object"&&(X.Collection||X.Node||X.Value))return Object.assign({Alias:X.Node,Map:X.Node,Scalar:X.Node,Seq:X.Node},X.Value&&{Map:X.Value,Scalar:X.Value,Seq:X.Value},X.Collection&&{Map:X.Collection,Seq:X.Collection},X);return X}function T7(X,Q,J,Y){if(typeof J==="function")return J(X,Q,Y);if(g0.isMap(Q))return J.Map?.(X,Q,Y);if(g0.isSeq(Q))return J.Seq?.(X,Q,Y);if(g0.isPair(Q))return J.Pair?.(X,Q,Y);if(g0.isScalar(Q))return J.Scalar?.(X,Q,Y);if(g0.isAlias(Q))return J.Alias?.(X,Q,Y);return}function S7(X,Q,J){let Y=Q[Q.length-1];if(g0.isCollection(Y))Y.items[X]=J;else if(g0.isPair(Y))if(X==="key")Y.key=J;else Y.value=J;else if(g0.isDocument(Y))Y.contents=J;else{let G=g0.isAlias(Y)?"alias":"scalar";throw Error(`Cannot replace node with ${G} parent`)}}QM.visit=A6;QM.visitAsync=N6});var $Q=p((HM)=>{var E7=K0(),GM=z8(),$M={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},WM=(X)=>X.replace(/[!,[\]{}]/g,(Q)=>$M[Q]);class J1{constructor(X,Q){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},J1.defaultYaml,X),this.tags=Object.assign({},J1.defaultTags,Q)}clone(){let X=new J1(this.yaml,this.tags);return X.docStart=this.docStart,X}atDocument(){let X=new J1(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:J1.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},J1.defaultTags);break}return X}add(X,Q){if(this.atNextDocument)this.yaml={explicit:J1.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},J1.defaultTags),this.atNextDocument=!1;let J=X.trim().split(/[ \t]+/),Y=J.shift();switch(Y){case"%TAG":{if(J.length!==2){if(Q(0,"%TAG directive should contain exactly two parts"),J.length<2)return!1}let[G,$]=J;return this.tags[G]=$,!0}case"%YAML":{if(this.yaml.explicit=!0,J.length!==1)return Q(0,"%YAML directive should contain exactly one part"),!1;let[G]=J;if(G==="1.1"||G==="1.2")return this.yaml.version=G,!0;else{let $=/^\d+\.\d+$/.test(G);return Q(6,`Unsupported YAML version ${G}`,$),!1}}default:return Q(0,`Unknown directive ${Y}`,!0),!1}}tagName(X,Q){if(X==="!")return"!";if(X[0]!=="!")return Q(`Not a valid tag: ${X}`),null;if(X[1]==="<"){let $=X.slice(2,-1);if($==="!"||$==="!!")return Q(`Verbatim tags aren't resolved, so ${X} is invalid.`),null;if(X[X.length-1]!==">")Q("Verbatim tags must end with a >");return $}let[,J,Y]=X.match(/^(.*!)([^!]*)$/s);if(!Y)Q(`The ${X} tag has no suffix`);let G=this.tags[J];if(G)try{return G+decodeURIComponent(Y)}catch($){return Q(String($)),null}if(J==="!")return X;return Q(`Could not resolve tag: ${X}`),null}tagString(X){for(let[Q,J]of Object.entries(this.tags))if(X.startsWith(J))return Q+WM(X.substring(J.length));return X[0]==="!"?X:`!<${X}>`}toString(X){let Q=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],J=Object.entries(this.tags),Y;if(X&&J.length>0&&E7.isNode(X.contents)){let G={};GM.visit(X.contents,($,W)=>{if(E7.isNode(W)&&W.tag)G[W.tag]=!0}),Y=Object.keys(G)}else Y=[];for(let[G,$]of J){if(G==="!!"&&$==="tag:yaml.org,2002:")continue;if(!X||Y.some((W)=>W.startsWith($)))Q.push(`%TAG ${G} ${$}`)}return Q.join(`
29
- `)}}J1.defaultYaml={explicit:!1,version:"1.2"};J1.defaultTags={"!!":"tag:yaml.org,2002:"};HM.Directives=J1});var R6=p((qM)=>{var b7=K0(),zM=z8();function BM(X){if(/[\x00-\x19\s,[\]{}]/.test(X)){let J=`Anchor must not contain whitespace or control characters: ${JSON.stringify(X)}`;throw Error(J)}return!0}function C7(X){let Q=new Set;return zM.visit(X,{Value(J,Y){if(Y.anchor)Q.add(Y.anchor)}}),Q}function _7(X,Q){for(let J=1;;++J){let Y=`${X}${J}`;if(!Q.has(Y))return Y}}function LM(X,Q){let J=[],Y=new Map,G=null;return{onAnchor:($)=>{J.push($),G??(G=C7(X));let W=_7(Q,G);return G.add(W),W},setAnchors:()=>{for(let $ of J){let W=Y.get($);if(typeof W==="object"&&W.anchor&&(b7.isScalar(W.node)||b7.isCollection(W.node)))W.node.anchor=W.anchor;else{let H=Error("Failed to resolve repeated object (this should not happen)");throw H.source=$,H}}},sourceObjects:Y}}qM.anchorIsValid=BM;qM.anchorNames=C7;qM.createNodeAnchors=LM;qM.findNewAnchor=_7});var WQ=p((DM)=>{function B8(X,Q,J,Y){if(Y&&typeof Y==="object")if(Array.isArray(Y))for(let G=0,$=Y.length;G<$;++G){let W=Y[G],H=B8(X,Y,String(G),W);if(H===void 0)delete Y[G];else if(H!==W)Y[G]=H}else if(Y instanceof Map)for(let G of Array.from(Y.keys())){let $=Y.get(G),W=B8(X,Y,G,$);if(W===void 0)Y.delete(G);else if(W!==$)Y.set(G,W)}else if(Y instanceof Set)for(let G of Array.from(Y)){let $=B8(X,Y,G,G);if($===void 0)Y.delete(G);else if($!==G)Y.delete(G),Y.add($)}else for(let[G,$]of Object.entries(Y)){let W=B8(X,Y,G,$);if(W===void 0)delete Y[G];else if(W!==$)Y[G]=W}return X.call(Q,J,Y)}DM.applyReviver=B8});var x1=p((AM)=>{var OM=K0();function k7(X,Q,J){if(Array.isArray(X))return X.map((Y,G)=>k7(Y,String(G),J));if(X&&typeof X.toJSON==="function"){if(!J||!OM.hasAnchor(X))return X.toJSON(Q,J);let Y={aliasCount:0,count:1,res:void 0};J.anchors.set(X,Y),J.onCreate=($)=>{Y.res=$,delete J.onCreate};let G=X.toJSON(Q,J);if(J.onCreate)J.onCreate(G);return G}if(typeof X==="bigint"&&!J?.keep)return Number(X);return X}AM.toJS=k7});var I6=p((jM)=>{var RM=WQ(),v7=K0(),IM=x1();class y7{constructor(X){Object.defineProperty(this,v7.NODE_TYPE,{value:X})}clone(){let X=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)X.range=this.range.slice();return X}toJS(X,{mapAsMap:Q,maxAliasCount:J,onAnchor:Y,reviver:G}={}){if(!v7.isDocument(X))throw TypeError("A document argument is required");let $={anchors:new Map,doc:X,keep:!0,mapAsMap:Q===!0,mapKeyWarned:!1,maxAliasCount:typeof J==="number"?J:100},W=IM.toJS(this,"",$);if(typeof Y==="function")for(let{count:H,res:U}of $.anchors.values())Y(U,H);return typeof G==="function"?RM.applyReviver(G,{"":W},"",W):W}}jM.NodeBase=y7});var L8=p((bM)=>{var PM=R6(),TM=z8(),j9=K0(),SM=I6(),EM=x1();class x7 extends SM.NodeBase{constructor(X){super(j9.ALIAS);this.source=X,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve(X,Q){let J;if(Q?.aliasResolveCache)J=Q.aliasResolveCache;else if(J=[],TM.visit(X,{Node:(G,$)=>{if(j9.isAlias($)||j9.hasAnchor($))J.push($)}}),Q)Q.aliasResolveCache=J;let Y=void 0;for(let G of J){if(G===this)break;if(G.anchor===this.source)Y=G}return Y}toJSON(X,Q){if(!Q)return{source:this.source};let{anchors:J,doc:Y,maxAliasCount:G}=Q,$=this.resolve(Y,Q);if(!$){let H=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(H)}let W=J.get($);if(!W)EM.toJS($,null,Q),W=J.get($);if(W?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(G>=0){if(W.count+=1,W.aliasCount===0)W.aliasCount=j6(Y,$,J);if(W.count*W.aliasCount>G)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return W.res}toString(X,Q,J){let Y=`*${this.source}`;if(X){if(PM.anchorIsValid(this.source),X.options.verifyAliasOrder&&!X.anchors.has(this.source)){let G=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(G)}if(X.implicitKey)return`${Y} `}return Y}}function j6(X,Q,J){if(j9.isAlias(Q)){let Y=Q.resolve(X),G=J&&Y&&J.get(Y);return G?G.count*G.aliasCount:0}else if(j9.isCollection(Q)){let Y=0;for(let G of Q.items){let $=j6(X,G,J);if($>Y)Y=$}return Y}else if(j9.isPair(Q)){let Y=j6(X,Q.key,J),G=j6(X,Q.value,J);return Math.max(Y,G)}return 1}bM.Alias=x7});var v0=p((xM)=>{var _M=K0(),kM=I6(),vM=x1(),yM=(X)=>!X||typeof X!=="function"&&typeof X!=="object";class a1 extends kM.NodeBase{constructor(X){super(_M.SCALAR);this.value=X}toJSON(X,Q){return Q?.keep?this.value:vM.toJS(this.value,X,Q)}toString(){return String(this.value)}}a1.BLOCK_FOLDED="BLOCK_FOLDED";a1.BLOCK_LITERAL="BLOCK_LITERAL";a1.PLAIN="PLAIN";a1.QUOTE_DOUBLE="QUOTE_DOUBLE";a1.QUOTE_SINGLE="QUOTE_SINGLE";xM.Scalar=a1;xM.isScalarValue=yM});var q8=p((cM)=>{var fM=L8(),s1=K0(),g7=v0(),uM="tag:yaml.org,2002:";function mM(X,Q,J){if(Q){let Y=J.filter(($)=>$.tag===Q),G=Y.find(($)=>!$.format)??Y[0];if(!G)throw Error(`Tag ${Q} not found`);return G}return J.find((Y)=>Y.identify?.(X)&&!Y.format)}function lM(X,Q,J){if(s1.isDocument(X))X=X.contents;if(s1.isNode(X))return X;if(s1.isPair(X)){let K=J.schema[s1.MAP].createNode?.(J.schema,null,J);return K.items.push(X),K}if(X instanceof String||X instanceof Number||X instanceof Boolean||typeof BigInt<"u"&&X instanceof BigInt)X=X.valueOf();let{aliasDuplicateObjects:Y,onAnchor:G,onTagObj:$,schema:W,sourceObjects:H}=J,U=void 0;if(Y&&X&&typeof X==="object")if(U=H.get(X),U)return U.anchor??(U.anchor=G(X)),new fM.Alias(U.anchor);else U={anchor:null,node:null},H.set(X,U);if(Q?.startsWith("!!"))Q=uM+Q.slice(2);let z=mM(X,Q,W.tags);if(!z){if(X&&typeof X.toJSON==="function")X=X.toJSON();if(!X||typeof X!=="object"){let K=new g7.Scalar(X);if(U)U.node=K;return K}z=X instanceof Map?W[s1.MAP]:(Symbol.iterator in Object(X))?W[s1.SEQ]:W[s1.MAP]}if($)$(z),delete J.onTagObj;let F=z?.createNode?z.createNode(J.schema,X,J):typeof z?.nodeClass?.from==="function"?z.nodeClass.from(J.schema,X,J):new g7.Scalar(X);if(Q)F.tag=Q;else if(!z.default)F.tag=z.tag;if(U)U.node=F;return F}cM.createNode=lM});var w6=p((nM)=>{var dM=q8(),Z1=K0(),iM=I6();function HQ(X,Q,J){let Y=J;for(let G=Q.length-1;G>=0;--G){let $=Q[G];if(typeof $==="number"&&Number.isInteger($)&&$>=0){let W=[];W[$]=Y,Y=W}else Y=new Map([[$,Y]])}return dM.createNode(Y,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:X,sourceObjects:new Map})}var h7=(X)=>X==null||typeof X==="object"&&!!X[Symbol.iterator]().next().done;class f7 extends iM.NodeBase{constructor(X,Q){super(X);Object.defineProperty(this,"schema",{value:Q,configurable:!0,enumerable:!1,writable:!0})}clone(X){let Q=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(X)Q.schema=X;if(Q.items=Q.items.map((J)=>Z1.isNode(J)||Z1.isPair(J)?J.clone(X):J),this.range)Q.range=this.range.slice();return Q}addIn(X,Q){if(h7(X))this.add(Q);else{let[J,...Y]=X,G=this.get(J,!0);if(Z1.isCollection(G))G.addIn(Y,Q);else if(G===void 0&&this.schema)this.set(J,HQ(this.schema,Y,Q));else throw Error(`Expected YAML collection at ${J}. Remaining path: ${Y}`)}}deleteIn(X){let[Q,...J]=X;if(J.length===0)return this.delete(Q);let Y=this.get(Q,!0);if(Z1.isCollection(Y))return Y.deleteIn(J);else throw Error(`Expected YAML collection at ${Q}. Remaining path: ${J}`)}getIn(X,Q){let[J,...Y]=X,G=this.get(J,!0);if(Y.length===0)return!Q&&Z1.isScalar(G)?G.value:G;else return Z1.isCollection(G)?G.getIn(Y,Q):void 0}hasAllNullValues(X){return this.items.every((Q)=>{if(!Z1.isPair(Q))return!1;let J=Q.value;return J==null||X&&Z1.isScalar(J)&&J.value==null&&!J.commentBefore&&!J.comment&&!J.tag})}hasIn(X){let[Q,...J]=X;if(J.length===0)return this.has(Q);let Y=this.get(Q,!0);return Z1.isCollection(Y)?Y.hasIn(J):!1}setIn(X,Q){let[J,...Y]=X;if(Y.length===0)this.set(J,Q);else{let G=this.get(J,!0);if(Z1.isCollection(G))G.setIn(Y,Q);else if(G===void 0&&this.schema)this.set(J,HQ(this.schema,Y,Q));else throw Error(`Expected YAML collection at ${J}. Remaining path: ${Y}`)}}}nM.Collection=f7;nM.collectionFromPath=HQ;nM.isEmptyPath=h7});var F8=p((eM)=>{var sM=(X)=>X.replace(/^(?!$)(?: $)?/gm,"#");function UQ(X,Q){if(/^\n+$/.test(X))return X.substring(1);return Q?X.replace(/^(?! *$)/gm,Q):X}var tM=(X,Q,J)=>X.endsWith(`
30
- `)?UQ(J,Q):J.includes(`
28
+ `)}),this}_outputHelpIfRequested(X){let Q=this._getHelpOption();if(Q&&X.find((Y)=>Q.is(Y)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function y4(X){return X.map((Q)=>{if(!Q.startsWith("--inspect"))return Q;let J,Y="127.0.0.1",G="9229",$;if(($=Q.match(/^(--inspect(-brk)?)$/))!==null)J=$[1];else if(($=Q.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(J=$[1],/^\d+$/.test($[3]))G=$[3];else Y=$[3];else if(($=Q.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)J=$[1],Y=$[3],G=$[4];if(J&&G!=="0")return`${J}=${Y}:${parseInt(G)+1}`;return Q})}function FX(){if(Z0.env.NO_COLOR||Z0.env.FORCE_COLOR==="0"||Z0.env.FORCE_COLOR==="false")return!1;if(Z0.env.FORCE_COLOR||Z0.env.CLICOLOR_FORCE!==void 0)return!0;return}R$.Command=KX;R$.useColor=FX});var u4=p((T$)=>{var{Argument:g4}=v8(),{Command:VX}=x4(),{CommanderError:w$,InvalidArgumentError:h4}=y9(),{Help:P$}=BX(),{Option:f4}=zX();T$.program=new VX;T$.createCommand=(X)=>new VX(X);T$.createOption=(X,Q)=>new f4(X,Q);T$.createArgument=(X,Q)=>new g4(X,Q);T$.Command=VX;T$.Option=f4;T$.Argument=g4;T$.Help=P$;T$.CommanderError=w$;T$.InvalidArgumentError=h4;T$.InvalidOptionArgumentError=h4});var K0=p((hV)=>{var GQ=Symbol.for("yaml.alias"),Z7=Symbol.for("yaml.document"),M6=Symbol.for("yaml.map"),O7=Symbol.for("yaml.pair"),$Q=Symbol.for("yaml.scalar"),D6=Symbol.for("yaml.seq"),E1=Symbol.for("yaml.node.type"),CV=(X)=>!!X&&typeof X==="object"&&X[E1]===GQ,_V=(X)=>!!X&&typeof X==="object"&&X[E1]===Z7,kV=(X)=>!!X&&typeof X==="object"&&X[E1]===M6,vV=(X)=>!!X&&typeof X==="object"&&X[E1]===O7,A7=(X)=>!!X&&typeof X==="object"&&X[E1]===$Q,yV=(X)=>!!X&&typeof X==="object"&&X[E1]===D6;function N7(X){if(X&&typeof X==="object")switch(X[E1]){case M6:case D6:return!0}return!1}function xV(X){if(X&&typeof X==="object")switch(X[E1]){case GQ:case M6:case $Q:case D6:return!0}return!1}var gV=(X)=>(A7(X)||N7(X))&&!!X.anchor;hV.ALIAS=GQ;hV.DOC=Z7;hV.MAP=M6;hV.NODE_TYPE=E1;hV.PAIR=O7;hV.SCALAR=$Q;hV.SEQ=D6;hV.hasAnchor=gV;hV.isAlias=CV;hV.isCollection=N7;hV.isDocument=_V;hV.isMap=kV;hV.isNode=xV;hV.isPair=vV;hV.isScalar=A7;hV.isSeq=yV});var U8=p((QM)=>{var g0=K0(),a0=Symbol("break visit"),R7=Symbol("skip children"),D1=Symbol("remove node");function Z6(X,Q){let J=I7(Q);if(g0.isDocument(X)){if(N9(null,X.contents,J,Object.freeze([X]))===D1)X.contents=null}else N9(null,X,J,Object.freeze([]))}Z6.BREAK=a0;Z6.SKIP=R7;Z6.REMOVE=D1;function N9(X,Q,J,Y){let G=j7(X,Q,J,Y);if(g0.isNode(G)||g0.isPair(G))return w7(X,Y,G),N9(X,G,J,Y);if(typeof G!=="symbol"){if(g0.isCollection(Q)){Y=Object.freeze(Y.concat(Q));for(let $=0;$<Q.items.length;++$){let W=N9($,Q.items[$],J,Y);if(typeof W==="number")$=W-1;else if(W===a0)return a0;else if(W===D1)Q.items.splice($,1),$-=1}}else if(g0.isPair(Q)){Y=Object.freeze(Y.concat(Q));let $=N9("key",Q.key,J,Y);if($===a0)return a0;else if($===D1)Q.key=null;let W=N9("value",Q.value,J,Y);if(W===a0)return a0;else if(W===D1)Q.value=null}}return G}async function O6(X,Q){let J=I7(Q);if(g0.isDocument(X)){if(await R9(null,X.contents,J,Object.freeze([X]))===D1)X.contents=null}else await R9(null,X,J,Object.freeze([]))}O6.BREAK=a0;O6.SKIP=R7;O6.REMOVE=D1;async function R9(X,Q,J,Y){let G=await j7(X,Q,J,Y);if(g0.isNode(G)||g0.isPair(G))return w7(X,Y,G),R9(X,G,J,Y);if(typeof G!=="symbol"){if(g0.isCollection(Q)){Y=Object.freeze(Y.concat(Q));for(let $=0;$<Q.items.length;++$){let W=await R9($,Q.items[$],J,Y);if(typeof W==="number")$=W-1;else if(W===a0)return a0;else if(W===D1)Q.items.splice($,1),$-=1}}else if(g0.isPair(Q)){Y=Object.freeze(Y.concat(Q));let $=await R9("key",Q.key,J,Y);if($===a0)return a0;else if($===D1)Q.key=null;let W=await R9("value",Q.value,J,Y);if(W===a0)return a0;else if(W===D1)Q.value=null}}return G}function I7(X){if(typeof X==="object"&&(X.Collection||X.Node||X.Value))return Object.assign({Alias:X.Node,Map:X.Node,Scalar:X.Node,Seq:X.Node},X.Value&&{Map:X.Value,Scalar:X.Value,Seq:X.Value},X.Collection&&{Map:X.Collection,Seq:X.Collection},X);return X}function j7(X,Q,J,Y){if(typeof J==="function")return J(X,Q,Y);if(g0.isMap(Q))return J.Map?.(X,Q,Y);if(g0.isSeq(Q))return J.Seq?.(X,Q,Y);if(g0.isPair(Q))return J.Pair?.(X,Q,Y);if(g0.isScalar(Q))return J.Scalar?.(X,Q,Y);if(g0.isAlias(Q))return J.Alias?.(X,Q,Y);return}function w7(X,Q,J){let Y=Q[Q.length-1];if(g0.isCollection(Y))Y.items[X]=J;else if(g0.isPair(Y))if(X==="key")Y.key=J;else Y.value=J;else if(g0.isDocument(Y))Y.contents=J;else{let G=g0.isAlias(Y)?"alias":"scalar";throw Error(`Cannot replace node with ${G} parent`)}}QM.visit=Z6;QM.visitAsync=O6});var WQ=p((HM)=>{var P7=K0(),GM=U8(),$M={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},WM=(X)=>X.replace(/[!,[\]{}]/g,(Q)=>$M[Q]);class Q1{constructor(X,Q){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Q1.defaultYaml,X),this.tags=Object.assign({},Q1.defaultTags,Q)}clone(){let X=new Q1(this.yaml,this.tags);return X.docStart=this.docStart,X}atDocument(){let X=new Q1(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Q1.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Q1.defaultTags);break}return X}add(X,Q){if(this.atNextDocument)this.yaml={explicit:Q1.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Q1.defaultTags),this.atNextDocument=!1;let J=X.trim().split(/[ \t]+/),Y=J.shift();switch(Y){case"%TAG":{if(J.length!==2){if(Q(0,"%TAG directive should contain exactly two parts"),J.length<2)return!1}let[G,$]=J;return this.tags[G]=$,!0}case"%YAML":{if(this.yaml.explicit=!0,J.length!==1)return Q(0,"%YAML directive should contain exactly one part"),!1;let[G]=J;if(G==="1.1"||G==="1.2")return this.yaml.version=G,!0;else{let $=/^\d+\.\d+$/.test(G);return Q(6,`Unsupported YAML version ${G}`,$),!1}}default:return Q(0,`Unknown directive ${Y}`,!0),!1}}tagName(X,Q){if(X==="!")return"!";if(X[0]!=="!")return Q(`Not a valid tag: ${X}`),null;if(X[1]==="<"){let $=X.slice(2,-1);if($==="!"||$==="!!")return Q(`Verbatim tags aren't resolved, so ${X} is invalid.`),null;if(X[X.length-1]!==">")Q("Verbatim tags must end with a >");return $}let[,J,Y]=X.match(/^(.*!)([^!]*)$/s);if(!Y)Q(`The ${X} tag has no suffix`);let G=this.tags[J];if(G)try{return G+decodeURIComponent(Y)}catch($){return Q(String($)),null}if(J==="!")return X;return Q(`Could not resolve tag: ${X}`),null}tagString(X){for(let[Q,J]of Object.entries(this.tags))if(X.startsWith(J))return Q+WM(X.substring(J.length));return X[0]==="!"?X:`!<${X}>`}toString(X){let Q=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],J=Object.entries(this.tags),Y;if(X&&J.length>0&&P7.isNode(X.contents)){let G={};GM.visit(X.contents,($,W)=>{if(P7.isNode(W)&&W.tag)G[W.tag]=!0}),Y=Object.keys(G)}else Y=[];for(let[G,$]of J){if(G==="!!"&&$==="tag:yaml.org,2002:")continue;if(!X||Y.some((W)=>W.startsWith($)))Q.push(`%TAG ${G} ${$}`)}return Q.join(`
29
+ `)}}Q1.defaultYaml={explicit:!1,version:"1.2"};Q1.defaultTags={"!!":"tag:yaml.org,2002:"};HM.Directives=Q1});var A6=p((qM)=>{var T7=K0(),BM=U8();function zM(X){if(/[\x00-\x19\s,[\]{}]/.test(X)){let J=`Anchor must not contain whitespace or control characters: ${JSON.stringify(X)}`;throw Error(J)}return!0}function S7(X){let Q=new Set;return BM.visit(X,{Value(J,Y){if(Y.anchor)Q.add(Y.anchor)}}),Q}function E7(X,Q){for(let J=1;;++J){let Y=`${X}${J}`;if(!Q.has(Y))return Y}}function LM(X,Q){let J=[],Y=new Map,G=null;return{onAnchor:($)=>{J.push($),G??(G=S7(X));let W=E7(Q,G);return G.add(W),W},setAnchors:()=>{for(let $ of J){let W=Y.get($);if(typeof W==="object"&&W.anchor&&(T7.isScalar(W.node)||T7.isCollection(W.node)))W.node.anchor=W.anchor;else{let H=Error("Failed to resolve repeated object (this should not happen)");throw H.source=$,H}}},sourceObjects:Y}}qM.anchorIsValid=zM;qM.anchorNames=S7;qM.createNodeAnchors=LM;qM.findNewAnchor=E7});var HQ=p((DM)=>{function B8(X,Q,J,Y){if(Y&&typeof Y==="object")if(Array.isArray(Y))for(let G=0,$=Y.length;G<$;++G){let W=Y[G],H=B8(X,Y,String(G),W);if(H===void 0)delete Y[G];else if(H!==W)Y[G]=H}else if(Y instanceof Map)for(let G of Array.from(Y.keys())){let $=Y.get(G),W=B8(X,Y,G,$);if(W===void 0)Y.delete(G);else if(W!==$)Y.set(G,W)}else if(Y instanceof Set)for(let G of Array.from(Y)){let $=B8(X,Y,G,G);if($===void 0)Y.delete(G);else if($!==G)Y.delete(G),Y.add($)}else for(let[G,$]of Object.entries(Y)){let W=B8(X,Y,G,$);if(W===void 0)delete Y[G];else if(W!==$)Y[G]=W}return X.call(Q,J,Y)}DM.applyReviver=B8});var x1=p((AM)=>{var OM=K0();function b7(X,Q,J){if(Array.isArray(X))return X.map((Y,G)=>b7(Y,String(G),J));if(X&&typeof X.toJSON==="function"){if(!J||!OM.hasAnchor(X))return X.toJSON(Q,J);let Y={aliasCount:0,count:1,res:void 0};J.anchors.set(X,Y),J.onCreate=($)=>{Y.res=$,delete J.onCreate};let G=X.toJSON(Q,J);if(J.onCreate)J.onCreate(G);return G}if(typeof X==="bigint"&&!J?.keep)return Number(X);return X}AM.toJS=b7});var N6=p((jM)=>{var RM=HQ(),C7=K0(),IM=x1();class _7{constructor(X){Object.defineProperty(this,C7.NODE_TYPE,{value:X})}clone(){let X=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)X.range=this.range.slice();return X}toJS(X,{mapAsMap:Q,maxAliasCount:J,onAnchor:Y,reviver:G}={}){if(!C7.isDocument(X))throw TypeError("A document argument is required");let $={anchors:new Map,doc:X,keep:!0,mapAsMap:Q===!0,mapKeyWarned:!1,maxAliasCount:typeof J==="number"?J:100},W=IM.toJS(this,"",$);if(typeof Y==="function")for(let{count:H,res:U}of $.anchors.values())Y(U,H);return typeof G==="function"?RM.applyReviver(G,{"":W},"",W):W}}jM.NodeBase=_7});var z8=p((bM)=>{var PM=A6(),TM=U8(),I9=K0(),SM=N6(),EM=x1();class k7 extends SM.NodeBase{constructor(X){super(I9.ALIAS);this.source=X,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve(X,Q){let J;if(Q?.aliasResolveCache)J=Q.aliasResolveCache;else if(J=[],TM.visit(X,{Node:(G,$)=>{if(I9.isAlias($)||I9.hasAnchor($))J.push($)}}),Q)Q.aliasResolveCache=J;let Y=void 0;for(let G of J){if(G===this)break;if(G.anchor===this.source)Y=G}return Y}toJSON(X,Q){if(!Q)return{source:this.source};let{anchors:J,doc:Y,maxAliasCount:G}=Q,$=this.resolve(Y,Q);if(!$){let H=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(H)}let W=J.get($);if(!W)EM.toJS($,null,Q),W=J.get($);if(W?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(G>=0){if(W.count+=1,W.aliasCount===0)W.aliasCount=R6(Y,$,J);if(W.count*W.aliasCount>G)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return W.res}toString(X,Q,J){let Y=`*${this.source}`;if(X){if(PM.anchorIsValid(this.source),X.options.verifyAliasOrder&&!X.anchors.has(this.source)){let G=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(G)}if(X.implicitKey)return`${Y} `}return Y}}function R6(X,Q,J){if(I9.isAlias(Q)){let Y=Q.resolve(X),G=J&&Y&&J.get(Y);return G?G.count*G.aliasCount:0}else if(I9.isCollection(Q)){let Y=0;for(let G of Q.items){let $=R6(X,G,J);if($>Y)Y=$}return Y}else if(I9.isPair(Q)){let Y=R6(X,Q.key,J),G=R6(X,Q.value,J);return Math.max(Y,G)}return 1}bM.Alias=k7});var v0=p((xM)=>{var _M=K0(),kM=N6(),vM=x1(),yM=(X)=>!X||typeof X!=="function"&&typeof X!=="object";class a1 extends kM.NodeBase{constructor(X){super(_M.SCALAR);this.value=X}toJSON(X,Q){return Q?.keep?this.value:vM.toJS(this.value,X,Q)}toString(){return String(this.value)}}a1.BLOCK_FOLDED="BLOCK_FOLDED";a1.BLOCK_LITERAL="BLOCK_LITERAL";a1.PLAIN="PLAIN";a1.QUOTE_DOUBLE="QUOTE_DOUBLE";a1.QUOTE_SINGLE="QUOTE_SINGLE";xM.Scalar=a1;xM.isScalarValue=yM});var L8=p((cM)=>{var fM=z8(),s1=K0(),v7=v0(),uM="tag:yaml.org,2002:";function mM(X,Q,J){if(Q){let Y=J.filter(($)=>$.tag===Q),G=Y.find(($)=>!$.format)??Y[0];if(!G)throw Error(`Tag ${Q} not found`);return G}return J.find((Y)=>Y.identify?.(X)&&!Y.format)}function lM(X,Q,J){if(s1.isDocument(X))X=X.contents;if(s1.isNode(X))return X;if(s1.isPair(X)){let K=J.schema[s1.MAP].createNode?.(J.schema,null,J);return K.items.push(X),K}if(X instanceof String||X instanceof Number||X instanceof Boolean||typeof BigInt<"u"&&X instanceof BigInt)X=X.valueOf();let{aliasDuplicateObjects:Y,onAnchor:G,onTagObj:$,schema:W,sourceObjects:H}=J,U=void 0;if(Y&&X&&typeof X==="object")if(U=H.get(X),U)return U.anchor??(U.anchor=G(X)),new fM.Alias(U.anchor);else U={anchor:null,node:null},H.set(X,U);if(Q?.startsWith("!!"))Q=uM+Q.slice(2);let B=mM(X,Q,W.tags);if(!B){if(X&&typeof X.toJSON==="function")X=X.toJSON();if(!X||typeof X!=="object"){let K=new v7.Scalar(X);if(U)U.node=K;return K}B=X instanceof Map?W[s1.MAP]:(Symbol.iterator in Object(X))?W[s1.SEQ]:W[s1.MAP]}if($)$(B),delete J.onTagObj;let q=B?.createNode?B.createNode(J.schema,X,J):typeof B?.nodeClass?.from==="function"?B.nodeClass.from(J.schema,X,J):new v7.Scalar(X);if(Q)q.tag=Q;else if(!B.default)q.tag=B.tag;if(U)U.node=q;return q}cM.createNode=lM});var I6=p((nM)=>{var dM=L8(),Z1=K0(),iM=N6();function UQ(X,Q,J){let Y=J;for(let G=Q.length-1;G>=0;--G){let $=Q[G];if(typeof $==="number"&&Number.isInteger($)&&$>=0){let W=[];W[$]=Y,Y=W}else Y=new Map([[$,Y]])}return dM.createNode(Y,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:X,sourceObjects:new Map})}var y7=(X)=>X==null||typeof X==="object"&&!!X[Symbol.iterator]().next().done;class x7 extends iM.NodeBase{constructor(X,Q){super(X);Object.defineProperty(this,"schema",{value:Q,configurable:!0,enumerable:!1,writable:!0})}clone(X){let Q=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(X)Q.schema=X;if(Q.items=Q.items.map((J)=>Z1.isNode(J)||Z1.isPair(J)?J.clone(X):J),this.range)Q.range=this.range.slice();return Q}addIn(X,Q){if(y7(X))this.add(Q);else{let[J,...Y]=X,G=this.get(J,!0);if(Z1.isCollection(G))G.addIn(Y,Q);else if(G===void 0&&this.schema)this.set(J,UQ(this.schema,Y,Q));else throw Error(`Expected YAML collection at ${J}. Remaining path: ${Y}`)}}deleteIn(X){let[Q,...J]=X;if(J.length===0)return this.delete(Q);let Y=this.get(Q,!0);if(Z1.isCollection(Y))return Y.deleteIn(J);else throw Error(`Expected YAML collection at ${Q}. Remaining path: ${J}`)}getIn(X,Q){let[J,...Y]=X,G=this.get(J,!0);if(Y.length===0)return!Q&&Z1.isScalar(G)?G.value:G;else return Z1.isCollection(G)?G.getIn(Y,Q):void 0}hasAllNullValues(X){return this.items.every((Q)=>{if(!Z1.isPair(Q))return!1;let J=Q.value;return J==null||X&&Z1.isScalar(J)&&J.value==null&&!J.commentBefore&&!J.comment&&!J.tag})}hasIn(X){let[Q,...J]=X;if(J.length===0)return this.has(Q);let Y=this.get(Q,!0);return Z1.isCollection(Y)?Y.hasIn(J):!1}setIn(X,Q){let[J,...Y]=X;if(Y.length===0)this.set(J,Q);else{let G=this.get(J,!0);if(Z1.isCollection(G))G.setIn(Y,Q);else if(G===void 0&&this.schema)this.set(J,UQ(this.schema,Y,Q));else throw Error(`Expected YAML collection at ${J}. Remaining path: ${Y}`)}}}nM.Collection=x7;nM.collectionFromPath=UQ;nM.isEmptyPath=y7});var q8=p((eM)=>{var sM=(X)=>X.replace(/^(?!$)(?: $)?/gm,"#");function BQ(X,Q){if(/^\n+$/.test(X))return X.substring(1);return Q?X.replace(/^(?! *$)/gm,Q):X}var tM=(X,Q,J)=>X.endsWith(`
30
+ `)?BQ(J,Q):J.includes(`
31
31
  `)?`
32
- `+UQ(J,Q):(X.endsWith(" ")?"":" ")+J;eM.indentComment=UQ;eM.lineComment=tM;eM.stringifyComment=sM});var m7=p((GD)=>{function YD(X,Q,J="flow",{indentAtStart:Y,lineWidth:G=80,minContentWidth:$=20,onFold:W,onOverflow:H}={}){if(!G||G<0)return X;if(G<$)$=0;let U=Math.max(1+$,1+G-Q.length);if(X.length<=U)return X;let z=[],F={},K=G-Q.length;if(typeof Y==="number")if(Y>G-Math.max(2,$))z.push(0);else K=G-Y;let M=void 0,R=void 0,w=!1,A=-1,Z=-1,B=-1;if(J==="block"){if(A=u7(X,A,Q.length),A!==-1)K=A+U}for(let q;q=X[A+=1];){if(J==="quoted"&&q==="\\"){switch(Z=A,X[A+1]){case"x":A+=3;break;case"u":A+=5;break;case"U":A+=9;break;default:A+=1}B=A}if(q===`
33
- `){if(J==="block")A=u7(X,A,Q.length);K=A+Q.length+U,M=void 0}else{if(q===" "&&R&&R!==" "&&R!==`
34
- `&&R!=="\t"){let L=X[A+1];if(L&&L!==" "&&L!==`
35
- `&&L!=="\t")M=A}if(A>=K)if(M)z.push(M),K=M+U,M=void 0;else if(J==="quoted"){while(R===" "||R==="\t")R=q,q=X[A+=1],w=!0;let L=A>B+1?A-2:Z-1;if(F[L])return X;z.push(L),F[L]=!0,K=L+U,M=void 0}else w=!0}R=q}if(w&&H)H();if(z.length===0)return X;if(W)W();let V=X.slice(0,z[0]);for(let q=0;q<z.length;++q){let L=z[q],O=z[q+1]||X.length;if(L===0)V=`
36
- ${Q}${X.slice(0,O)}`;else{if(J==="quoted"&&F[L])V+=`${X[L]}\\`;V+=`
37
- ${Q}${X.slice(L+1,O)}`}}return V}function u7(X,Q,J){let Y=Q,G=Q+1,$=X[G];while($===" "||$==="\t")if(Q<G+J)$=X[++Q];else{do $=X[++Q];while($&&$!==`
38
- `);Y=Q,G=Q+1,$=X[G]}return Y}GD.FOLD_BLOCK="block";GD.FOLD_FLOW="flow";GD.FOLD_QUOTED="quoted";GD.foldFlowLines=YD});var V8=p((qD)=>{var z1=v0(),g1=m7(),T6=(X,Q)=>({indentAtStart:Q?X.indent.length:X.indentAtStart,lineWidth:X.options.lineWidth,minContentWidth:X.options.minContentWidth}),S6=(X)=>/^(%|---|\.\.\.)/m.test(X);function zD(X,Q,J){if(!Q||Q<0)return!1;let Y=Q-J,G=X.length;if(G<=Y)return!1;for(let $=0,W=0;$<G;++$)if(X[$]===`
39
- `){if($-W>Y)return!0;if(W=$+1,G-W<=Y)return!1}return!0}function K8(X,Q){let J=JSON.stringify(X);if(Q.options.doubleQuotedAsJSON)return J;let{implicitKey:Y}=Q,G=Q.options.doubleQuotedMinMultiLineLength,$=Q.indent||(S6(X)?" ":""),W="",H=0;for(let U=0,z=J[U];z;z=J[++U]){if(z===" "&&J[U+1]==="\\"&&J[U+2]==="n")W+=J.slice(H,U)+"\\ ",U+=1,H=U,z="\\";if(z==="\\")switch(J[U+1]){case"u":{W+=J.slice(H,U);let F=J.substr(U+2,4);switch(F){case"0000":W+="\\0";break;case"0007":W+="\\a";break;case"000b":W+="\\v";break;case"001b":W+="\\e";break;case"0085":W+="\\N";break;case"00a0":W+="\\_";break;case"2028":W+="\\L";break;case"2029":W+="\\P";break;default:if(F.substr(0,2)==="00")W+="\\x"+F.substr(2);else W+=J.substr(U,6)}U+=5,H=U+1}break;case"n":if(Y||J[U+2]==='"'||J.length<G)U+=1;else{W+=J.slice(H,U)+`
32
+ `+BQ(J,Q):(X.endsWith(" ")?"":" ")+J;eM.indentComment=BQ;eM.lineComment=tM;eM.stringifyComment=sM});var h7=p((GD)=>{function YD(X,Q,J="flow",{indentAtStart:Y,lineWidth:G=80,minContentWidth:$=20,onFold:W,onOverflow:H}={}){if(!G||G<0)return X;if(G<$)$=0;let U=Math.max(1+$,1+G-Q.length);if(X.length<=U)return X;let B=[],q={},K=G-Q.length;if(typeof Y==="number")if(Y>G-Math.max(2,$))B.push(0);else K=G-Y;let V=void 0,N=void 0,w=!1,A=-1,Z=-1,z=-1;if(J==="block"){if(A=g7(X,A,Q.length),A!==-1)K=A+U}for(let F;F=X[A+=1];){if(J==="quoted"&&F==="\\"){switch(Z=A,X[A+1]){case"x":A+=3;break;case"u":A+=5;break;case"U":A+=9;break;default:A+=1}z=A}if(F===`
33
+ `){if(J==="block")A=g7(X,A,Q.length);K=A+Q.length+U,V=void 0}else{if(F===" "&&N&&N!==" "&&N!==`
34
+ `&&N!=="\t"){let L=X[A+1];if(L&&L!==" "&&L!==`
35
+ `&&L!=="\t")V=A}if(A>=K)if(V)B.push(V),K=V+U,V=void 0;else if(J==="quoted"){while(N===" "||N==="\t")N=F,F=X[A+=1],w=!0;let L=A>z+1?A-2:Z-1;if(q[L])return X;B.push(L),q[L]=!0,K=L+U,V=void 0}else w=!0}N=F}if(w&&H)H();if(B.length===0)return X;if(W)W();let M=X.slice(0,B[0]);for(let F=0;F<B.length;++F){let L=B[F],O=B[F+1]||X.length;if(L===0)M=`
36
+ ${Q}${X.slice(0,O)}`;else{if(J==="quoted"&&q[L])M+=`${X[L]}\\`;M+=`
37
+ ${Q}${X.slice(L+1,O)}`}}return M}function g7(X,Q,J){let Y=Q,G=Q+1,$=X[G];while($===" "||$==="\t")if(Q<G+J)$=X[++Q];else{do $=X[++Q];while($&&$!==`
38
+ `);Y=Q,G=Q+1,$=X[G]}return Y}GD.FOLD_BLOCK="block";GD.FOLD_FLOW="flow";GD.FOLD_QUOTED="quoted";GD.foldFlowLines=YD});var K8=p((qD)=>{var U1=v0(),g1=h7(),w6=(X,Q)=>({indentAtStart:Q?X.indent.length:X.indentAtStart,lineWidth:X.options.lineWidth,minContentWidth:X.options.minContentWidth}),P6=(X)=>/^(%|---|\.\.\.)/m.test(X);function BD(X,Q,J){if(!Q||Q<0)return!1;let Y=Q-J,G=X.length;if(G<=Y)return!1;for(let $=0,W=0;$<G;++$)if(X[$]===`
39
+ `){if($-W>Y)return!0;if(W=$+1,G-W<=Y)return!1}return!0}function F8(X,Q){let J=JSON.stringify(X);if(Q.options.doubleQuotedAsJSON)return J;let{implicitKey:Y}=Q,G=Q.options.doubleQuotedMinMultiLineLength,$=Q.indent||(P6(X)?" ":""),W="",H=0;for(let U=0,B=J[U];B;B=J[++U]){if(B===" "&&J[U+1]==="\\"&&J[U+2]==="n")W+=J.slice(H,U)+"\\ ",U+=1,H=U,B="\\";if(B==="\\")switch(J[U+1]){case"u":{W+=J.slice(H,U);let q=J.substr(U+2,4);switch(q){case"0000":W+="\\0";break;case"0007":W+="\\a";break;case"000b":W+="\\v";break;case"001b":W+="\\e";break;case"0085":W+="\\N";break;case"00a0":W+="\\_";break;case"2028":W+="\\L";break;case"2029":W+="\\P";break;default:if(q.substr(0,2)==="00")W+="\\x"+q.substr(2);else W+=J.substr(U,6)}U+=5,H=U+1}break;case"n":if(Y||J[U+2]==='"'||J.length<G)U+=1;else{W+=J.slice(H,U)+`
40
40
 
41
41
  `;while(J[U+2]==="\\"&&J[U+3]==="n"&&J[U+4]!=='"')W+=`
42
- `,U+=2;if(W+=$,J[U+2]===" ")W+="\\";U+=1,H=U+1}break;default:U+=1}}return W=H?W+J.slice(H):J,Y?W:g1.foldFlowLines(W,$,g1.FOLD_QUOTED,T6(Q,!1))}function zQ(X,Q){if(Q.options.singleQuote===!1||Q.implicitKey&&X.includes(`
43
- `)||/[ \t]\n|\n[ \t]/.test(X))return K8(X,Q);let J=Q.indent||(S6(X)?" ":""),Y="'"+X.replace(/'/g,"''").replace(/\n+/g,`$&
44
- ${J}`)+"'";return Q.implicitKey?Y:g1.foldFlowLines(Y,J,g1.FOLD_FLOW,T6(Q,!1))}function w9(X,Q){let{singleQuote:J}=Q.options,Y;if(J===!1)Y=K8;else{let G=X.includes('"'),$=X.includes("'");if(G&&!$)Y=zQ;else if($&&!G)Y=K8;else Y=J?zQ:K8}return Y(X,Q)}var BQ;try{BQ=new RegExp(`(^|(?<!
42
+ `,U+=2;if(W+=$,J[U+2]===" ")W+="\\";U+=1,H=U+1}break;default:U+=1}}return W=H?W+J.slice(H):J,Y?W:g1.foldFlowLines(W,$,g1.FOLD_QUOTED,w6(Q,!1))}function zQ(X,Q){if(Q.options.singleQuote===!1||Q.implicitKey&&X.includes(`
43
+ `)||/[ \t]\n|\n[ \t]/.test(X))return F8(X,Q);let J=Q.indent||(P6(X)?" ":""),Y="'"+X.replace(/'/g,"''").replace(/\n+/g,`$&
44
+ ${J}`)+"'";return Q.implicitKey?Y:g1.foldFlowLines(Y,J,g1.FOLD_FLOW,w6(Q,!1))}function j9(X,Q){let{singleQuote:J}=Q.options,Y;if(J===!1)Y=F8;else{let G=X.includes('"'),$=X.includes("'");if(G&&!$)Y=zQ;else if($&&!G)Y=F8;else Y=J?zQ:F8}return Y(X,Q)}var LQ;try{LQ=new RegExp(`(^|(?<!
45
45
  ))
46
46
  +(?!
47
- |$)`,"g")}catch{BQ=/\n+(?!\n|$)/g}function P6({comment:X,type:Q,value:J},Y,G,$){let{blockQuote:W,commentString:H,lineWidth:U}=Y.options;if(!W||/\n[\t ]+$/.test(J))return w9(J,Y);let z=Y.indent||(Y.forceBlockIndent||S6(J)?" ":""),F=W==="literal"?!0:W==="folded"||Q===z1.Scalar.BLOCK_FOLDED?!1:Q===z1.Scalar.BLOCK_LITERAL?!0:!zD(J,U,z.length);if(!J)return F?`|
47
+ |$)`,"g")}catch{LQ=/\n+(?!\n|$)/g}function j6({comment:X,type:Q,value:J},Y,G,$){let{blockQuote:W,commentString:H,lineWidth:U}=Y.options;if(!W||/\n[\t ]+$/.test(J))return j9(J,Y);let B=Y.indent||(Y.forceBlockIndent||P6(J)?" ":""),q=W==="literal"?!0:W==="folded"||Q===U1.Scalar.BLOCK_FOLDED?!1:Q===U1.Scalar.BLOCK_LITERAL?!0:!BD(J,U,B.length);if(!J)return q?`|
48
48
  `:`>
49
- `;let K,M;for(M=J.length;M>0;--M){let O=J[M-1];if(O!==`
50
- `&&O!=="\t"&&O!==" ")break}let R=J.substring(M),w=R.indexOf(`
51
- `);if(w===-1)K="-";else if(J===R||w!==R.length-1){if(K="+",$)$()}else K="";if(R){if(J=J.slice(0,-R.length),R[R.length-1]===`
52
- `)R=R.slice(0,-1);R=R.replace(BQ,`$&${z}`)}let A=!1,Z,B=-1;for(Z=0;Z<J.length;++Z){let O=J[Z];if(O===" ")A=!0;else if(O===`
53
- `)B=Z;else break}let V=J.substring(0,B<Z?B+1:Z);if(V)J=J.substring(V.length),V=V.replace(/\n+/g,`$&${z}`);let L=(A?z?"2":"1":"")+K;if(X){if(L+=" "+H(X.replace(/ ?[\r\n]+/g," ")),G)G()}if(!F){let O=J.replace(/\n+/g,`
54
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${z}`),D=!1,I=T6(Y,!0);if(W!=="folded"&&Q!==z1.Scalar.BLOCK_FOLDED)I.onOverflow=()=>{D=!0};let j=g1.foldFlowLines(`${V}${O}${R}`,z,g1.FOLD_BLOCK,I);if(!D)return`>${L}
55
- ${z}${j}`}return J=J.replace(/\n+/g,`$&${z}`),`|${L}
56
- ${z}${V}${J}${R}`}function BD(X,Q,J,Y){let{type:G,value:$}=X,{actualString:W,implicitKey:H,indent:U,indentStep:z,inFlow:F}=Q;if(H&&$.includes(`
57
- `)||F&&/[[\]{},]/.test($))return w9($,Q);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test($))return H||F||!$.includes(`
58
- `)?w9($,Q):P6(X,Q,J,Y);if(!H&&!F&&G!==z1.Scalar.PLAIN&&$.includes(`
59
- `))return P6(X,Q,J,Y);if(S6($)){if(U==="")return Q.forceBlockIndent=!0,P6(X,Q,J,Y);else if(H&&U===z)return w9($,Q)}let K=$.replace(/\n+/g,`$&
60
- ${U}`);if(W){let M=(A)=>A.default&&A.tag!=="tag:yaml.org,2002:str"&&A.test?.test(K),{compat:R,tags:w}=Q.doc.schema;if(w.some(M)||R?.some(M))return w9($,Q)}return H?K:g1.foldFlowLines(K,U,g1.FOLD_FLOW,T6(Q,!1))}function LD(X,Q,J,Y){let{implicitKey:G,inFlow:$}=Q,W=typeof X.value==="string"?X:Object.assign({},X,{value:String(X.value)}),{type:H}=X;if(H!==z1.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(W.value))H=z1.Scalar.QUOTE_DOUBLE}let U=(F)=>{switch(F){case z1.Scalar.BLOCK_FOLDED:case z1.Scalar.BLOCK_LITERAL:return G||$?w9(W.value,Q):P6(W,Q,J,Y);case z1.Scalar.QUOTE_DOUBLE:return K8(W.value,Q);case z1.Scalar.QUOTE_SINGLE:return zQ(W.value,Q);case z1.Scalar.PLAIN:return BD(W,Q,J,Y);default:return null}},z=U(H);if(z===null){let{defaultKeyType:F,defaultStringType:K}=Q.options,M=G&&F||K;if(z=U(M),z===null)throw Error(`Unsupported default string type ${M}`)}return z}qD.stringifyString=LD});var M8=p((ND)=>{var KD=R6(),h1=K0(),VD=F8(),MD=V8();function DD(X,Q){let J=Object.assign({blockQuote:!0,commentString:VD.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},X.schema.toStringOptions,Q),Y;switch(J.collectionStyle){case"block":Y=!1;break;case"flow":Y=!0;break;default:Y=null}return{anchors:new Set,doc:X,flowCollectionPadding:J.flowCollectionPadding?" ":"",indent:"",indentStep:typeof J.indent==="number"?" ".repeat(J.indent):" ",inFlow:Y,options:J}}function ZD(X,Q){if(Q.tag){let G=X.filter(($)=>$.tag===Q.tag);if(G.length>0)return G.find(($)=>$.format===Q.format)??G[0]}let J=void 0,Y;if(h1.isScalar(Q)){Y=Q.value;let G=X.filter(($)=>$.identify?.(Y));if(G.length>1){let $=G.filter((W)=>W.test);if($.length>0)G=$}J=G.find(($)=>$.format===Q.format)??G.find(($)=>!$.format)}else Y=Q,J=X.find((G)=>G.nodeClass&&Y instanceof G.nodeClass);if(!J){let G=Y?.constructor?.name??(Y===null?"null":typeof Y);throw Error(`Tag not resolved for ${G} value`)}return J}function OD(X,Q,{anchors:J,doc:Y}){if(!Y.directives)return"";let G=[],$=(h1.isScalar(X)||h1.isCollection(X))&&X.anchor;if($&&KD.anchorIsValid($))J.add($),G.push(`&${$}`);let W=X.tag??(Q.default?null:Q.tag);if(W)G.push(Y.directives.tagString(W));return G.join(" ")}function AD(X,Q,J,Y){if(h1.isPair(X))return X.toString(Q,J,Y);if(h1.isAlias(X)){if(Q.doc.directives)return X.toString(Q);if(Q.resolvedAliases?.has(X))throw TypeError("Cannot stringify circular structure without alias nodes");else{if(Q.resolvedAliases)Q.resolvedAliases.add(X);else Q.resolvedAliases=new Set([X]);X=X.resolve(Q.doc)}}let G=void 0,$=h1.isNode(X)?X:Q.doc.createNode(X,{onTagObj:(U)=>G=U});G??(G=ZD(Q.doc.schema.tags,$));let W=OD($,G,Q);if(W.length>0)Q.indentAtStart=(Q.indentAtStart??0)+W.length+1;let H=typeof G.stringify==="function"?G.stringify($,Q,J,Y):h1.isScalar($)?MD.stringifyString($,Q,J,Y):$.toString(Q,J,Y);if(!W)return H;return h1.isScalar($)||H[0]==="{"||H[0]==="["?`${W} ${H}`:`${W}
61
- ${Q.indent}${H}`}ND.createStringifyContext=DD;ND.stringify=AD});var p7=p((wD)=>{var b1=K0(),l7=v0(),c7=M8(),D8=F8();function jD({key:X,value:Q},J,Y,G){let{allNullValues:$,doc:W,indent:H,indentStep:U,options:{commentString:z,indentSeq:F,simpleKeys:K}}=J,M=b1.isNode(X)&&X.comment||null;if(K){if(M)throw Error("With simple keys, key nodes cannot have comments");if(b1.isCollection(X)||!b1.isNode(X)&&typeof X==="object")throw Error("With simple keys, collection cannot be used as a key value")}let R=!K&&(!X||M&&Q==null&&!J.inFlow||b1.isCollection(X)||(b1.isScalar(X)?X.type===l7.Scalar.BLOCK_FOLDED||X.type===l7.Scalar.BLOCK_LITERAL:typeof X==="object"));J=Object.assign({},J,{allNullValues:!1,implicitKey:!R&&(K||!$),indent:H+U});let w=!1,A=!1,Z=c7.stringify(X,J,()=>w=!0,()=>A=!0);if(!R&&!J.inFlow&&Z.length>1024){if(K)throw Error("With simple keys, single line scalar must not span more than 1024 characters");R=!0}if(J.inFlow){if($||Q==null){if(w&&Y)Y();return Z===""?"?":R?`? ${Z}`:Z}}else if($&&!K||Q==null&&R){if(Z=`? ${Z}`,M&&!w)Z+=D8.lineComment(Z,J.indent,z(M));else if(A&&G)G();return Z}if(w)M=null;if(R){if(M)Z+=D8.lineComment(Z,J.indent,z(M));Z=`? ${Z}
62
- ${H}:`}else if(Z=`${Z}:`,M)Z+=D8.lineComment(Z,J.indent,z(M));let B,V,q;if(b1.isNode(Q))B=!!Q.spaceBefore,V=Q.commentBefore,q=Q.comment;else if(B=!1,V=null,q=null,Q&&typeof Q==="object")Q=W.createNode(Q);if(J.implicitKey=!1,!R&&!M&&b1.isScalar(Q))J.indentAtStart=Z.length+1;if(A=!1,!F&&U.length>=2&&!J.inFlow&&!R&&b1.isSeq(Q)&&!Q.flow&&!Q.tag&&!Q.anchor)J.indent=J.indent.substring(2);let L=!1,O=c7.stringify(Q,J,()=>L=!0,()=>A=!0),D=" ";if(M||B||V){if(D=B?`
63
- `:"",V){let I=z(V);D+=`
64
- ${D8.indentComment(I,J.indent)}`}if(O===""&&!J.inFlow){if(D===`
65
- `&&q)D=`
49
+ `;let K,V;for(V=J.length;V>0;--V){let O=J[V-1];if(O!==`
50
+ `&&O!=="\t"&&O!==" ")break}let N=J.substring(V),w=N.indexOf(`
51
+ `);if(w===-1)K="-";else if(J===N||w!==N.length-1){if(K="+",$)$()}else K="";if(N){if(J=J.slice(0,-N.length),N[N.length-1]===`
52
+ `)N=N.slice(0,-1);N=N.replace(LQ,`$&${B}`)}let A=!1,Z,z=-1;for(Z=0;Z<J.length;++Z){let O=J[Z];if(O===" ")A=!0;else if(O===`
53
+ `)z=Z;else break}let M=J.substring(0,z<Z?z+1:Z);if(M)J=J.substring(M.length),M=M.replace(/\n+/g,`$&${B}`);let L=(A?B?"2":"1":"")+K;if(X){if(L+=" "+H(X.replace(/ ?[\r\n]+/g," ")),G)G()}if(!q){let O=J.replace(/\n+/g,`
54
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${B}`),D=!1,I=w6(Y,!0);if(W!=="folded"&&Q!==U1.Scalar.BLOCK_FOLDED)I.onOverflow=()=>{D=!0};let j=g1.foldFlowLines(`${M}${O}${N}`,B,g1.FOLD_BLOCK,I);if(!D)return`>${L}
55
+ ${B}${j}`}return J=J.replace(/\n+/g,`$&${B}`),`|${L}
56
+ ${B}${M}${J}${N}`}function zD(X,Q,J,Y){let{type:G,value:$}=X,{actualString:W,implicitKey:H,indent:U,indentStep:B,inFlow:q}=Q;if(H&&$.includes(`
57
+ `)||q&&/[[\]{},]/.test($))return j9($,Q);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test($))return H||q||!$.includes(`
58
+ `)?j9($,Q):j6(X,Q,J,Y);if(!H&&!q&&G!==U1.Scalar.PLAIN&&$.includes(`
59
+ `))return j6(X,Q,J,Y);if(P6($)){if(U==="")return Q.forceBlockIndent=!0,j6(X,Q,J,Y);else if(H&&U===B)return j9($,Q)}let K=$.replace(/\n+/g,`$&
60
+ ${U}`);if(W){let V=(A)=>A.default&&A.tag!=="tag:yaml.org,2002:str"&&A.test?.test(K),{compat:N,tags:w}=Q.doc.schema;if(w.some(V)||N?.some(V))return j9($,Q)}return H?K:g1.foldFlowLines(K,U,g1.FOLD_FLOW,w6(Q,!1))}function LD(X,Q,J,Y){let{implicitKey:G,inFlow:$}=Q,W=typeof X.value==="string"?X:Object.assign({},X,{value:String(X.value)}),{type:H}=X;if(H!==U1.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(W.value))H=U1.Scalar.QUOTE_DOUBLE}let U=(q)=>{switch(q){case U1.Scalar.BLOCK_FOLDED:case U1.Scalar.BLOCK_LITERAL:return G||$?j9(W.value,Q):j6(W,Q,J,Y);case U1.Scalar.QUOTE_DOUBLE:return F8(W.value,Q);case U1.Scalar.QUOTE_SINGLE:return zQ(W.value,Q);case U1.Scalar.PLAIN:return zD(W,Q,J,Y);default:return null}},B=U(H);if(B===null){let{defaultKeyType:q,defaultStringType:K}=Q.options,V=G&&q||K;if(B=U(V),B===null)throw Error(`Unsupported default string type ${V}`)}return B}qD.stringifyString=LD});var V8=p((ND)=>{var KD=A6(),h1=K0(),VD=q8(),MD=K8();function DD(X,Q){let J=Object.assign({blockQuote:!0,commentString:VD.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},X.schema.toStringOptions,Q),Y;switch(J.collectionStyle){case"block":Y=!1;break;case"flow":Y=!0;break;default:Y=null}return{anchors:new Set,doc:X,flowCollectionPadding:J.flowCollectionPadding?" ":"",indent:"",indentStep:typeof J.indent==="number"?" ".repeat(J.indent):" ",inFlow:Y,options:J}}function ZD(X,Q){if(Q.tag){let G=X.filter(($)=>$.tag===Q.tag);if(G.length>0)return G.find(($)=>$.format===Q.format)??G[0]}let J=void 0,Y;if(h1.isScalar(Q)){Y=Q.value;let G=X.filter(($)=>$.identify?.(Y));if(G.length>1){let $=G.filter((W)=>W.test);if($.length>0)G=$}J=G.find(($)=>$.format===Q.format)??G.find(($)=>!$.format)}else Y=Q,J=X.find((G)=>G.nodeClass&&Y instanceof G.nodeClass);if(!J){let G=Y?.constructor?.name??(Y===null?"null":typeof Y);throw Error(`Tag not resolved for ${G} value`)}return J}function OD(X,Q,{anchors:J,doc:Y}){if(!Y.directives)return"";let G=[],$=(h1.isScalar(X)||h1.isCollection(X))&&X.anchor;if($&&KD.anchorIsValid($))J.add($),G.push(`&${$}`);let W=X.tag??(Q.default?null:Q.tag);if(W)G.push(Y.directives.tagString(W));return G.join(" ")}function AD(X,Q,J,Y){if(h1.isPair(X))return X.toString(Q,J,Y);if(h1.isAlias(X)){if(Q.doc.directives)return X.toString(Q);if(Q.resolvedAliases?.has(X))throw TypeError("Cannot stringify circular structure without alias nodes");else{if(Q.resolvedAliases)Q.resolvedAliases.add(X);else Q.resolvedAliases=new Set([X]);X=X.resolve(Q.doc)}}let G=void 0,$=h1.isNode(X)?X:Q.doc.createNode(X,{onTagObj:(U)=>G=U});G??(G=ZD(Q.doc.schema.tags,$));let W=OD($,G,Q);if(W.length>0)Q.indentAtStart=(Q.indentAtStart??0)+W.length+1;let H=typeof G.stringify==="function"?G.stringify($,Q,J,Y):h1.isScalar($)?MD.stringifyString($,Q,J,Y):$.toString(Q,J,Y);if(!W)return H;return h1.isScalar($)||H[0]==="{"||H[0]==="["?`${W} ${H}`:`${W}
61
+ ${Q.indent}${H}`}ND.createStringifyContext=DD;ND.stringify=AD});var m7=p((wD)=>{var b1=K0(),f7=v0(),u7=V8(),M8=q8();function jD({key:X,value:Q},J,Y,G){let{allNullValues:$,doc:W,indent:H,indentStep:U,options:{commentString:B,indentSeq:q,simpleKeys:K}}=J,V=b1.isNode(X)&&X.comment||null;if(K){if(V)throw Error("With simple keys, key nodes cannot have comments");if(b1.isCollection(X)||!b1.isNode(X)&&typeof X==="object")throw Error("With simple keys, collection cannot be used as a key value")}let N=!K&&(!X||V&&Q==null&&!J.inFlow||b1.isCollection(X)||(b1.isScalar(X)?X.type===f7.Scalar.BLOCK_FOLDED||X.type===f7.Scalar.BLOCK_LITERAL:typeof X==="object"));J=Object.assign({},J,{allNullValues:!1,implicitKey:!N&&(K||!$),indent:H+U});let w=!1,A=!1,Z=u7.stringify(X,J,()=>w=!0,()=>A=!0);if(!N&&!J.inFlow&&Z.length>1024){if(K)throw Error("With simple keys, single line scalar must not span more than 1024 characters");N=!0}if(J.inFlow){if($||Q==null){if(w&&Y)Y();return Z===""?"?":N?`? ${Z}`:Z}}else if($&&!K||Q==null&&N){if(Z=`? ${Z}`,V&&!w)Z+=M8.lineComment(Z,J.indent,B(V));else if(A&&G)G();return Z}if(w)V=null;if(N){if(V)Z+=M8.lineComment(Z,J.indent,B(V));Z=`? ${Z}
62
+ ${H}:`}else if(Z=`${Z}:`,V)Z+=M8.lineComment(Z,J.indent,B(V));let z,M,F;if(b1.isNode(Q))z=!!Q.spaceBefore,M=Q.commentBefore,F=Q.comment;else if(z=!1,M=null,F=null,Q&&typeof Q==="object")Q=W.createNode(Q);if(J.implicitKey=!1,!N&&!V&&b1.isScalar(Q))J.indentAtStart=Z.length+1;if(A=!1,!q&&U.length>=2&&!J.inFlow&&!N&&b1.isSeq(Q)&&!Q.flow&&!Q.tag&&!Q.anchor)J.indent=J.indent.substring(2);let L=!1,O=u7.stringify(Q,J,()=>L=!0,()=>A=!0),D=" ";if(V||z||M){if(D=z?`
63
+ `:"",M){let I=B(M);D+=`
64
+ ${M8.indentComment(I,J.indent)}`}if(O===""&&!J.inFlow){if(D===`
65
+ `&&F)D=`
66
66
 
67
67
  `}else D+=`
68
- ${J.indent}`}else if(!R&&b1.isCollection(Q)){let I=O[0],j=O.indexOf(`
68
+ ${J.indent}`}else if(!N&&b1.isCollection(Q)){let I=O[0],j=O.indexOf(`
69
69
  `),E=j!==-1,g=J.inFlow??Q.flow??Q.items.length===0;if(E||!g){let k=!1;if(E&&(I==="&"||I==="!")){let x=O.indexOf(" ");if(I==="&"&&x!==-1&&x<j&&O[x+1]==="!")x=O.indexOf(" ",x+1);if(x===-1||j<x)k=!0}if(!k)D=`
70
70
  ${J.indent}`}}else if(O===""||O[0]===`
71
- `)D="";if(Z+=D+O,J.inFlow){if(L&&Y)Y()}else if(q&&!L)Z+=D8.lineComment(Z,J.indent,z(q));else if(A&&G)G();return Z}wD.stringifyPair=jD});var LQ=p((ED)=>{var d7=O1("process");function TD(X,...Q){if(X==="debug")console.log(...Q)}function SD(X,Q){if(X==="debug"||X==="warn")if(typeof d7.emitWarning==="function")d7.emitWarning(Q);else console.warn(Q)}ED.debug=TD;ED.warn=SD});var C6=p((kD)=>{var Z8=K0(),i7=v0(),E6="<<",b6={identify:(X)=>X===E6||typeof X==="symbol"&&X.description===E6,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new i7.Scalar(Symbol(E6)),{addToJSMap:n7}),stringify:()=>E6},_D=(X,Q)=>(b6.identify(Q)||Z8.isScalar(Q)&&(!Q.type||Q.type===i7.Scalar.PLAIN)&&b6.identify(Q.value))&&X?.doc.schema.tags.some((J)=>J.tag===b6.tag&&J.default);function n7(X,Q,J){if(J=X&&Z8.isAlias(J)?J.resolve(X.doc):J,Z8.isSeq(J))for(let Y of J.items)qQ(X,Q,Y);else if(Array.isArray(J))for(let Y of J)qQ(X,Q,Y);else qQ(X,Q,J)}function qQ(X,Q,J){let Y=X&&Z8.isAlias(J)?J.resolve(X.doc):J;if(!Z8.isMap(Y))throw Error("Merge sources must be maps or map aliases");let G=Y.toJSON(null,X,Map);for(let[$,W]of G)if(Q instanceof Map){if(!Q.has($))Q.set($,W)}else if(Q instanceof Set)Q.add($);else if(!Object.prototype.hasOwnProperty.call(Q,$))Object.defineProperty(Q,$,{value:W,writable:!0,enumerable:!0,configurable:!0});return Q}kD.addMergeToJSMap=n7;kD.isMergeKey=_D;kD.merge=b6});var KQ=p((mD)=>{var gD=LQ(),r7=C6(),hD=M8(),o7=K0(),FQ=x1();function fD(X,Q,{key:J,value:Y}){if(o7.isNode(J)&&J.addToJSMap)J.addToJSMap(X,Q,Y);else if(r7.isMergeKey(X,J))r7.addMergeToJSMap(X,Q,Y);else{let G=FQ.toJS(J,"",X);if(Q instanceof Map)Q.set(G,FQ.toJS(Y,G,X));else if(Q instanceof Set)Q.add(G);else{let $=uD(J,G,X),W=FQ.toJS(Y,$,X);if($ in Q)Object.defineProperty(Q,$,{value:W,writable:!0,enumerable:!0,configurable:!0});else Q[$]=W}}return Q}function uD(X,Q,J){if(Q===null)return"";if(typeof Q!=="object")return String(Q);if(o7.isNode(X)&&J?.doc){let Y=hD.createStringifyContext(J.doc,{});Y.anchors=new Set;for(let $ of J.anchors.keys())Y.anchors.add($.anchor);Y.inFlow=!0,Y.inStringifyKey=!0;let G=X.toString(Y);if(!J.mapKeyWarned){let $=JSON.stringify(G);if($.length>40)$=$.substring(0,36)+'..."';gD.warn(J.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${$}. Set mapAsMap: true to use object keys.`),J.mapKeyWarned=!0}return G}return JSON.stringify(Q)}mD.addPairToJSMap=fD});var f1=p((iD)=>{var a7=q8(),cD=p7(),pD=KQ(),_6=K0();function dD(X,Q,J){let Y=a7.createNode(X,void 0,J),G=a7.createNode(Q,void 0,J);return new k6(Y,G)}class k6{constructor(X,Q=null){Object.defineProperty(this,_6.NODE_TYPE,{value:_6.PAIR}),this.key=X,this.value=Q}clone(X){let{key:Q,value:J}=this;if(_6.isNode(Q))Q=Q.clone(X);if(_6.isNode(J))J=J.clone(X);return new k6(Q,J)}toJSON(X,Q){let J=Q?.mapAsMap?new Map:{};return pD.addPairToJSMap(Q,J,this)}toString(X,Q,J){return X?.doc?cD.stringifyPair(this,X,Q,J):JSON.stringify(this)}}iD.Pair=k6;iD.createPair=dD});var VQ=p((tD)=>{var t1=K0(),s7=M8(),v6=F8();function oD(X,Q,J){return(Q.inFlow??X.flow?sD:aD)(X,Q,J)}function aD({comment:X,items:Q},J,{blockItemPrefix:Y,flowChars:G,itemIndent:$,onChompKeep:W,onComment:H}){let{indent:U,options:{commentString:z}}=J,F=Object.assign({},J,{indent:$,type:null}),K=!1,M=[];for(let w=0;w<Q.length;++w){let A=Q[w],Z=null;if(t1.isNode(A)){if(!K&&A.spaceBefore)M.push("");if(y6(J,M,A.commentBefore,K),A.comment)Z=A.comment}else if(t1.isPair(A)){let V=t1.isNode(A.key)?A.key:null;if(V){if(!K&&V.spaceBefore)M.push("");y6(J,M,V.commentBefore,K)}}K=!1;let B=s7.stringify(A,F,()=>Z=null,()=>K=!0);if(Z)B+=v6.lineComment(B,$,z(Z));if(K&&Z)K=!1;M.push(Y+B)}let R;if(M.length===0)R=G.start+G.end;else{R=M[0];for(let w=1;w<M.length;++w){let A=M[w];R+=A?`
71
+ `)D="";if(Z+=D+O,J.inFlow){if(L&&Y)Y()}else if(F&&!L)Z+=M8.lineComment(Z,J.indent,B(F));else if(A&&G)G();return Z}wD.stringifyPair=jD});var qQ=p((ED)=>{var l7=O1("process");function TD(X,...Q){if(X==="debug")console.log(...Q)}function SD(X,Q){if(X==="debug"||X==="warn")if(typeof l7.emitWarning==="function")l7.emitWarning(Q);else console.warn(Q)}ED.debug=TD;ED.warn=SD});var E6=p((kD)=>{var D8=K0(),c7=v0(),T6="<<",S6={identify:(X)=>X===T6||typeof X==="symbol"&&X.description===T6,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new c7.Scalar(Symbol(T6)),{addToJSMap:p7}),stringify:()=>T6},_D=(X,Q)=>(S6.identify(Q)||D8.isScalar(Q)&&(!Q.type||Q.type===c7.Scalar.PLAIN)&&S6.identify(Q.value))&&X?.doc.schema.tags.some((J)=>J.tag===S6.tag&&J.default);function p7(X,Q,J){if(J=X&&D8.isAlias(J)?J.resolve(X.doc):J,D8.isSeq(J))for(let Y of J.items)FQ(X,Q,Y);else if(Array.isArray(J))for(let Y of J)FQ(X,Q,Y);else FQ(X,Q,J)}function FQ(X,Q,J){let Y=X&&D8.isAlias(J)?J.resolve(X.doc):J;if(!D8.isMap(Y))throw Error("Merge sources must be maps or map aliases");let G=Y.toJSON(null,X,Map);for(let[$,W]of G)if(Q instanceof Map){if(!Q.has($))Q.set($,W)}else if(Q instanceof Set)Q.add($);else if(!Object.prototype.hasOwnProperty.call(Q,$))Object.defineProperty(Q,$,{value:W,writable:!0,enumerable:!0,configurable:!0});return Q}kD.addMergeToJSMap=p7;kD.isMergeKey=_D;kD.merge=S6});var VQ=p((mD)=>{var gD=qQ(),d7=E6(),hD=V8(),i7=K0(),KQ=x1();function fD(X,Q,{key:J,value:Y}){if(i7.isNode(J)&&J.addToJSMap)J.addToJSMap(X,Q,Y);else if(d7.isMergeKey(X,J))d7.addMergeToJSMap(X,Q,Y);else{let G=KQ.toJS(J,"",X);if(Q instanceof Map)Q.set(G,KQ.toJS(Y,G,X));else if(Q instanceof Set)Q.add(G);else{let $=uD(J,G,X),W=KQ.toJS(Y,$,X);if($ in Q)Object.defineProperty(Q,$,{value:W,writable:!0,enumerable:!0,configurable:!0});else Q[$]=W}}return Q}function uD(X,Q,J){if(Q===null)return"";if(typeof Q!=="object")return String(Q);if(i7.isNode(X)&&J?.doc){let Y=hD.createStringifyContext(J.doc,{});Y.anchors=new Set;for(let $ of J.anchors.keys())Y.anchors.add($.anchor);Y.inFlow=!0,Y.inStringifyKey=!0;let G=X.toString(Y);if(!J.mapKeyWarned){let $=JSON.stringify(G);if($.length>40)$=$.substring(0,36)+'..."';gD.warn(J.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${$}. Set mapAsMap: true to use object keys.`),J.mapKeyWarned=!0}return G}return JSON.stringify(Q)}mD.addPairToJSMap=fD});var f1=p((iD)=>{var n7=L8(),cD=m7(),pD=VQ(),b6=K0();function dD(X,Q,J){let Y=n7.createNode(X,void 0,J),G=n7.createNode(Q,void 0,J);return new C6(Y,G)}class C6{constructor(X,Q=null){Object.defineProperty(this,b6.NODE_TYPE,{value:b6.PAIR}),this.key=X,this.value=Q}clone(X){let{key:Q,value:J}=this;if(b6.isNode(Q))Q=Q.clone(X);if(b6.isNode(J))J=J.clone(X);return new C6(Q,J)}toJSON(X,Q){let J=Q?.mapAsMap?new Map:{};return pD.addPairToJSMap(Q,J,this)}toString(X,Q,J){return X?.doc?cD.stringifyPair(this,X,Q,J):JSON.stringify(this)}}iD.Pair=C6;iD.createPair=dD});var MQ=p((tD)=>{var t1=K0(),r7=V8(),_6=q8();function oD(X,Q,J){return(Q.inFlow??X.flow?sD:aD)(X,Q,J)}function aD({comment:X,items:Q},J,{blockItemPrefix:Y,flowChars:G,itemIndent:$,onChompKeep:W,onComment:H}){let{indent:U,options:{commentString:B}}=J,q=Object.assign({},J,{indent:$,type:null}),K=!1,V=[];for(let w=0;w<Q.length;++w){let A=Q[w],Z=null;if(t1.isNode(A)){if(!K&&A.spaceBefore)V.push("");if(k6(J,V,A.commentBefore,K),A.comment)Z=A.comment}else if(t1.isPair(A)){let M=t1.isNode(A.key)?A.key:null;if(M){if(!K&&M.spaceBefore)V.push("");k6(J,V,M.commentBefore,K)}}K=!1;let z=r7.stringify(A,q,()=>Z=null,()=>K=!0);if(Z)z+=_6.lineComment(z,$,B(Z));if(K&&Z)K=!1;V.push(Y+z)}let N;if(V.length===0)N=G.start+G.end;else{N=V[0];for(let w=1;w<V.length;++w){let A=V[w];N+=A?`
72
72
  ${U}${A}`:`
73
- `}}if(X){if(R+=`
74
- `+v6.indentComment(z(X),U),H)H()}else if(K&&W)W();return R}function sD({items:X},Q,{flowChars:J,itemIndent:Y}){let{indent:G,indentStep:$,flowCollectionPadding:W,options:{commentString:H}}=Q;Y+=$;let U=Object.assign({},Q,{indent:Y,inFlow:!0,type:null}),z=!1,F=0,K=[];for(let w=0;w<X.length;++w){let A=X[w],Z=null;if(t1.isNode(A)){if(A.spaceBefore)K.push("");if(y6(Q,K,A.commentBefore,!1),A.comment)Z=A.comment}else if(t1.isPair(A)){let V=t1.isNode(A.key)?A.key:null;if(V){if(V.spaceBefore)K.push("");if(y6(Q,K,V.commentBefore,!1),V.comment)z=!0}let q=t1.isNode(A.value)?A.value:null;if(q){if(q.comment)Z=q.comment;if(q.commentBefore)z=!0}else if(A.value==null&&V?.comment)Z=V.comment}if(Z)z=!0;let B=s7.stringify(A,U,()=>Z=null);if(w<X.length-1)B+=",";if(Z)B+=v6.lineComment(B,Y,H(Z));if(!z&&(K.length>F||B.includes(`
75
- `)))z=!0;K.push(B),F=K.length}let{start:M,end:R}=J;if(K.length===0)return M+R;else{if(!z){let w=K.reduce((A,Z)=>A+Z.length+2,2);z=Q.options.lineWidth>0&&w>Q.options.lineWidth}if(z){let w=M;for(let A of K)w+=A?`
73
+ `}}if(X){if(N+=`
74
+ `+_6.indentComment(B(X),U),H)H()}else if(K&&W)W();return N}function sD({items:X},Q,{flowChars:J,itemIndent:Y}){let{indent:G,indentStep:$,flowCollectionPadding:W,options:{commentString:H}}=Q;Y+=$;let U=Object.assign({},Q,{indent:Y,inFlow:!0,type:null}),B=!1,q=0,K=[];for(let w=0;w<X.length;++w){let A=X[w],Z=null;if(t1.isNode(A)){if(A.spaceBefore)K.push("");if(k6(Q,K,A.commentBefore,!1),A.comment)Z=A.comment}else if(t1.isPair(A)){let M=t1.isNode(A.key)?A.key:null;if(M){if(M.spaceBefore)K.push("");if(k6(Q,K,M.commentBefore,!1),M.comment)B=!0}let F=t1.isNode(A.value)?A.value:null;if(F){if(F.comment)Z=F.comment;if(F.commentBefore)B=!0}else if(A.value==null&&M?.comment)Z=M.comment}if(Z)B=!0;let z=r7.stringify(A,U,()=>Z=null);if(w<X.length-1)z+=",";if(Z)z+=_6.lineComment(z,Y,H(Z));if(!B&&(K.length>q||z.includes(`
75
+ `)))B=!0;K.push(z),q=K.length}let{start:V,end:N}=J;if(K.length===0)return V+N;else{if(!B){let w=K.reduce((A,Z)=>A+Z.length+2,2);B=Q.options.lineWidth>0&&w>Q.options.lineWidth}if(B){let w=V;for(let A of K)w+=A?`
76
76
  ${$}${G}${A}`:`
77
77
  `;return`${w}
78
- ${G}${R}`}else return`${M}${W}${K.join(" ")}${W}${R}`}}function y6({indent:X,options:{commentString:Q}},J,Y,G){if(Y&&G)Y=Y.replace(/^\n+/,"");if(Y){let $=v6.indentComment(Q(Y),X);J.push($.trimStart())}}tD.stringifyCollection=oD});var m1=p((GZ)=>{var XZ=VQ(),QZ=KQ(),JZ=w6(),u1=K0(),x6=f1(),YZ=v0();function O8(X,Q){let J=u1.isScalar(Q)?Q.value:Q;for(let Y of X)if(u1.isPair(Y)){if(Y.key===Q||Y.key===J)return Y;if(u1.isScalar(Y.key)&&Y.key.value===J)return Y}return}class t7 extends JZ.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(X){super(u1.MAP,X);this.items=[]}static from(X,Q,J){let{keepUndefined:Y,replacer:G}=J,$=new this(X),W=(H,U)=>{if(typeof G==="function")U=G.call(Q,H,U);else if(Array.isArray(G)&&!G.includes(H))return;if(U!==void 0||Y)$.items.push(x6.createPair(H,U,J))};if(Q instanceof Map)for(let[H,U]of Q)W(H,U);else if(Q&&typeof Q==="object")for(let H of Object.keys(Q))W(H,Q[H]);if(typeof X.sortMapEntries==="function")$.items.sort(X.sortMapEntries);return $}add(X,Q){let J;if(u1.isPair(X))J=X;else if(!X||typeof X!=="object"||!("key"in X))J=new x6.Pair(X,X?.value);else J=new x6.Pair(X.key,X.value);let Y=O8(this.items,J.key),G=this.schema?.sortMapEntries;if(Y){if(!Q)throw Error(`Key ${J.key} already set`);if(u1.isScalar(Y.value)&&YZ.isScalarValue(J.value))Y.value.value=J.value;else Y.value=J.value}else if(G){let $=this.items.findIndex((W)=>G(J,W)<0);if($===-1)this.items.push(J);else this.items.splice($,0,J)}else this.items.push(J)}delete(X){let Q=O8(this.items,X);if(!Q)return!1;return this.items.splice(this.items.indexOf(Q),1).length>0}get(X,Q){let Y=O8(this.items,X)?.value;return(!Q&&u1.isScalar(Y)?Y.value:Y)??void 0}has(X){return!!O8(this.items,X)}set(X,Q){this.add(new x6.Pair(X,Q),!0)}toJSON(X,Q,J){let Y=J?new J:Q?.mapAsMap?new Map:{};if(Q?.onCreate)Q.onCreate(Y);for(let G of this.items)QZ.addPairToJSMap(Q,Y,G);return Y}toString(X,Q,J){if(!X)return JSON.stringify(this);for(let Y of this.items)if(!u1.isPair(Y))throw Error(`Map items must all be pairs; found ${JSON.stringify(Y)} instead`);if(!X.allNullValues&&this.hasAllNullValues(!1))X=Object.assign({},X,{allNullValues:!0});return XZ.stringifyCollection(this,X,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:X.indent||"",onChompKeep:J,onComment:Q})}}GZ.YAMLMap=t7;GZ.findPair=O8});var P9=p((zZ)=>{var HZ=K0(),e7=m1(),UZ={collection:"map",default:!0,nodeClass:e7.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(X,Q){if(!HZ.isMap(X))Q("Expected a mapping for this tag");return X},createNode:(X,Q,J)=>e7.YAMLMap.from(X,Q,J)};zZ.map=UZ});var l1=p((MZ)=>{var LZ=q8(),qZ=VQ(),FZ=w6(),h6=K0(),KZ=v0(),VZ=x1();class XY extends FZ.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(X){super(h6.SEQ,X);this.items=[]}add(X){this.items.push(X)}delete(X){let Q=g6(X);if(typeof Q!=="number")return!1;return this.items.splice(Q,1).length>0}get(X,Q){let J=g6(X);if(typeof J!=="number")return;let Y=this.items[J];return!Q&&h6.isScalar(Y)?Y.value:Y}has(X){let Q=g6(X);return typeof Q==="number"&&Q<this.items.length}set(X,Q){let J=g6(X);if(typeof J!=="number")throw Error(`Expected a valid index, not ${X}.`);let Y=this.items[J];if(h6.isScalar(Y)&&KZ.isScalarValue(Q))Y.value=Q;else this.items[J]=Q}toJSON(X,Q){let J=[];if(Q?.onCreate)Q.onCreate(J);let Y=0;for(let G of this.items)J.push(VZ.toJS(G,String(Y++),Q));return J}toString(X,Q,J){if(!X)return JSON.stringify(this);return qZ.stringifyCollection(this,X,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(X.indent||"")+" ",onChompKeep:J,onComment:Q})}static from(X,Q,J){let{replacer:Y}=J,G=new this(X);if(Q&&Symbol.iterator in Object(Q)){let $=0;for(let W of Q){if(typeof Y==="function"){let H=Q instanceof Set?W:String($++);W=Y.call(Q,H,W)}G.items.push(LZ.createNode(W,void 0,J))}}return G}}function g6(X){let Q=h6.isScalar(X)?X.value:X;if(Q&&typeof Q==="string")Q=Number(Q);return typeof Q==="number"&&Number.isInteger(Q)&&Q>=0?Q:null}MZ.YAMLSeq=XY});var T9=p((AZ)=>{var ZZ=K0(),QY=l1(),OZ={collection:"seq",default:!0,nodeClass:QY.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(X,Q){if(!ZZ.isSeq(X))Q("Expected a sequence for this tag");return X},createNode:(X,Q,J)=>QY.YAMLSeq.from(X,Q,J)};AZ.seq=OZ});var A8=p((jZ)=>{var RZ=V8(),IZ={identify:(X)=>typeof X==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(X)=>X,stringify(X,Q,J,Y){return Q=Object.assign({actualString:!0},Q),RZ.stringifyString(X,Q,J,Y)}};jZ.string=IZ});var f6=p((PZ)=>{var JY=v0(),YY={identify:(X)=>X==null,createNode:()=>new JY.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new JY.Scalar(null),stringify:({source:X},Q)=>typeof X==="string"&&YY.test.test(X)?X:Q.options.nullStr};PZ.nullTag=YY});var MQ=p((EZ)=>{var SZ=v0(),GY={identify:(X)=>typeof X==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:(X)=>new SZ.Scalar(X[0]==="t"||X[0]==="T"),stringify({source:X,value:Q},J){if(X&&GY.test.test(X)){let Y=X[0]==="t"||X[0]==="T";if(Q===Y)return X}return Q?J.options.trueStr:J.options.falseStr}};EZ.boolTag=GY});var S9=p((_Z)=>{function CZ({format:X,minFractionDigits:Q,tag:J,value:Y}){if(typeof Y==="bigint")return String(Y);let G=typeof Y==="number"?Y:Number(Y);if(!isFinite(G))return isNaN(G)?".nan":G<0?"-.inf":".inf";let $=Object.is(Y,-0)?"-0":JSON.stringify(Y);if(!X&&Q&&(!J||J==="tag:yaml.org,2002:float")&&/^\d/.test($)){let W=$.indexOf(".");if(W<0)W=$.length,$+=".";let H=Q-($.length-W-1);while(H-- >0)$+="0"}return $}_Z.stringifyNumber=CZ});var ZQ=p((hZ)=>{var vZ=v0(),DQ=S9(),yZ={identify:(X)=>typeof X==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(X)=>X.slice(-3).toLowerCase()==="nan"?NaN:X[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:DQ.stringifyNumber},xZ={identify:(X)=>typeof X==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:(X)=>parseFloat(X),stringify(X){let Q=Number(X.value);return isFinite(Q)?Q.toExponential():DQ.stringifyNumber(X)}},gZ={identify:(X)=>typeof X==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(X){let Q=new vZ.Scalar(parseFloat(X)),J=X.indexOf(".");if(J!==-1&&X[X.length-1]==="0")Q.minFractionDigits=X.length-J-1;return Q},stringify:DQ.stringifyNumber};hZ.float=gZ;hZ.floatExp=xZ;hZ.floatNaN=yZ});var AQ=p((dZ)=>{var $Y=S9(),u6=(X)=>typeof X==="bigint"||Number.isInteger(X),OQ=(X,Q,J,{intAsBigInt:Y})=>Y?BigInt(X):parseInt(X.substring(Q),J);function WY(X,Q,J){let{value:Y}=X;if(u6(Y)&&Y>=0)return J+Y.toString(Q);return $Y.stringifyNumber(X)}var lZ={identify:(X)=>u6(X)&&X>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(X,Q,J)=>OQ(X,2,8,J),stringify:(X)=>WY(X,8,"0o")},cZ={identify:u6,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(X,Q,J)=>OQ(X,0,10,J),stringify:$Y.stringifyNumber},pZ={identify:(X)=>u6(X)&&X>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(X,Q,J)=>OQ(X,2,16,J),stringify:(X)=>WY(X,16,"0x")};dZ.int=cZ;dZ.intHex=pZ;dZ.intOct=lZ});var HY=p((QO)=>{var oZ=P9(),aZ=f6(),sZ=T9(),tZ=A8(),eZ=MQ(),NQ=ZQ(),RQ=AQ(),XO=[oZ.map,sZ.seq,tZ.string,aZ.nullTag,eZ.boolTag,RQ.intOct,RQ.int,RQ.intHex,NQ.floatNaN,NQ.floatExp,NQ.float];QO.schema=XO});var zY=p((zO)=>{var YO=v0(),GO=P9(),$O=T9();function UY(X){return typeof X==="bigint"||Number.isInteger(X)}var m6=({value:X})=>JSON.stringify(X),WO=[{identify:(X)=>typeof X==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(X)=>X,stringify:m6},{identify:(X)=>X==null,createNode:()=>new YO.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:m6},{identify:(X)=>typeof X==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:(X)=>X==="true",stringify:m6},{identify:UY,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(X,Q,{intAsBigInt:J})=>J?BigInt(X):parseInt(X,10),stringify:({value:X})=>UY(X)?X.toString():JSON.stringify(X)},{identify:(X)=>typeof X==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:(X)=>parseFloat(X),stringify:m6}],HO={default:!0,tag:"",test:/^/,resolve(X,Q){return Q(`Unresolved plain scalar ${JSON.stringify(X)}`),X}},UO=[GO.map,$O.seq].concat(WO,HO);zO.schema=UO});var jQ=p((FO)=>{var N8=O1("buffer"),IQ=v0(),LO=V8(),qO={identify:(X)=>X instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(X,Q){if(typeof N8.Buffer==="function")return N8.Buffer.from(X,"base64");else if(typeof atob==="function"){let J=atob(X.replace(/[\n\r]/g,"")),Y=new Uint8Array(J.length);for(let G=0;G<J.length;++G)Y[G]=J.charCodeAt(G);return Y}else return Q("This environment does not support reading binary tags; either Buffer or atob is required"),X},stringify({comment:X,type:Q,value:J},Y,G,$){if(!J)return"";let W=J,H;if(typeof N8.Buffer==="function")H=W instanceof N8.Buffer?W.toString("base64"):N8.Buffer.from(W.buffer).toString("base64");else if(typeof btoa==="function"){let U="";for(let z=0;z<W.length;++z)U+=String.fromCharCode(W[z]);H=btoa(U)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(Q??(Q=IQ.Scalar.BLOCK_LITERAL),Q!==IQ.Scalar.QUOTE_DOUBLE){let U=Math.max(Y.options.lineWidth-Y.indent.length,Y.options.minContentWidth),z=Math.ceil(H.length/U),F=Array(z);for(let K=0,M=0;K<z;++K,M+=U)F[K]=H.substr(M,U);H=F.join(Q===IQ.Scalar.BLOCK_LITERAL?`
79
- `:" ")}return LO.stringifyString({comment:X,type:Q,value:H},Y,G,$)}};FO.binary=qO});var c6=p((ZO)=>{var l6=K0(),wQ=f1(),VO=v0(),MO=l1();function BY(X,Q){if(l6.isSeq(X))for(let J=0;J<X.items.length;++J){let Y=X.items[J];if(l6.isPair(Y))continue;else if(l6.isMap(Y)){if(Y.items.length>1)Q("Each pair must have its own sequence indicator");let G=Y.items[0]||new wQ.Pair(new VO.Scalar(null));if(Y.commentBefore)G.key.commentBefore=G.key.commentBefore?`${Y.commentBefore}
78
+ ${G}${N}`}else return`${V}${W}${K.join(" ")}${W}${N}`}}function k6({indent:X,options:{commentString:Q}},J,Y,G){if(Y&&G)Y=Y.replace(/^\n+/,"");if(Y){let $=_6.indentComment(Q(Y),X);J.push($.trimStart())}}tD.stringifyCollection=oD});var m1=p((GZ)=>{var XZ=MQ(),QZ=VQ(),JZ=I6(),u1=K0(),v6=f1(),YZ=v0();function Z8(X,Q){let J=u1.isScalar(Q)?Q.value:Q;for(let Y of X)if(u1.isPair(Y)){if(Y.key===Q||Y.key===J)return Y;if(u1.isScalar(Y.key)&&Y.key.value===J)return Y}return}class o7 extends JZ.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(X){super(u1.MAP,X);this.items=[]}static from(X,Q,J){let{keepUndefined:Y,replacer:G}=J,$=new this(X),W=(H,U)=>{if(typeof G==="function")U=G.call(Q,H,U);else if(Array.isArray(G)&&!G.includes(H))return;if(U!==void 0||Y)$.items.push(v6.createPair(H,U,J))};if(Q instanceof Map)for(let[H,U]of Q)W(H,U);else if(Q&&typeof Q==="object")for(let H of Object.keys(Q))W(H,Q[H]);if(typeof X.sortMapEntries==="function")$.items.sort(X.sortMapEntries);return $}add(X,Q){let J;if(u1.isPair(X))J=X;else if(!X||typeof X!=="object"||!("key"in X))J=new v6.Pair(X,X?.value);else J=new v6.Pair(X.key,X.value);let Y=Z8(this.items,J.key),G=this.schema?.sortMapEntries;if(Y){if(!Q)throw Error(`Key ${J.key} already set`);if(u1.isScalar(Y.value)&&YZ.isScalarValue(J.value))Y.value.value=J.value;else Y.value=J.value}else if(G){let $=this.items.findIndex((W)=>G(J,W)<0);if($===-1)this.items.push(J);else this.items.splice($,0,J)}else this.items.push(J)}delete(X){let Q=Z8(this.items,X);if(!Q)return!1;return this.items.splice(this.items.indexOf(Q),1).length>0}get(X,Q){let Y=Z8(this.items,X)?.value;return(!Q&&u1.isScalar(Y)?Y.value:Y)??void 0}has(X){return!!Z8(this.items,X)}set(X,Q){this.add(new v6.Pair(X,Q),!0)}toJSON(X,Q,J){let Y=J?new J:Q?.mapAsMap?new Map:{};if(Q?.onCreate)Q.onCreate(Y);for(let G of this.items)QZ.addPairToJSMap(Q,Y,G);return Y}toString(X,Q,J){if(!X)return JSON.stringify(this);for(let Y of this.items)if(!u1.isPair(Y))throw Error(`Map items must all be pairs; found ${JSON.stringify(Y)} instead`);if(!X.allNullValues&&this.hasAllNullValues(!1))X=Object.assign({},X,{allNullValues:!0});return XZ.stringifyCollection(this,X,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:X.indent||"",onChompKeep:J,onComment:Q})}}GZ.YAMLMap=o7;GZ.findPair=Z8});var w9=p((BZ)=>{var HZ=K0(),a7=m1(),UZ={collection:"map",default:!0,nodeClass:a7.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(X,Q){if(!HZ.isMap(X))Q("Expected a mapping for this tag");return X},createNode:(X,Q,J)=>a7.YAMLMap.from(X,Q,J)};BZ.map=UZ});var l1=p((MZ)=>{var LZ=L8(),qZ=MQ(),FZ=I6(),x6=K0(),KZ=v0(),VZ=x1();class s7 extends FZ.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(X){super(x6.SEQ,X);this.items=[]}add(X){this.items.push(X)}delete(X){let Q=y6(X);if(typeof Q!=="number")return!1;return this.items.splice(Q,1).length>0}get(X,Q){let J=y6(X);if(typeof J!=="number")return;let Y=this.items[J];return!Q&&x6.isScalar(Y)?Y.value:Y}has(X){let Q=y6(X);return typeof Q==="number"&&Q<this.items.length}set(X,Q){let J=y6(X);if(typeof J!=="number")throw Error(`Expected a valid index, not ${X}.`);let Y=this.items[J];if(x6.isScalar(Y)&&KZ.isScalarValue(Q))Y.value=Q;else this.items[J]=Q}toJSON(X,Q){let J=[];if(Q?.onCreate)Q.onCreate(J);let Y=0;for(let G of this.items)J.push(VZ.toJS(G,String(Y++),Q));return J}toString(X,Q,J){if(!X)return JSON.stringify(this);return qZ.stringifyCollection(this,X,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(X.indent||"")+" ",onChompKeep:J,onComment:Q})}static from(X,Q,J){let{replacer:Y}=J,G=new this(X);if(Q&&Symbol.iterator in Object(Q)){let $=0;for(let W of Q){if(typeof Y==="function"){let H=Q instanceof Set?W:String($++);W=Y.call(Q,H,W)}G.items.push(LZ.createNode(W,void 0,J))}}return G}}function y6(X){let Q=x6.isScalar(X)?X.value:X;if(Q&&typeof Q==="string")Q=Number(Q);return typeof Q==="number"&&Number.isInteger(Q)&&Q>=0?Q:null}MZ.YAMLSeq=s7});var P9=p((AZ)=>{var ZZ=K0(),t7=l1(),OZ={collection:"seq",default:!0,nodeClass:t7.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(X,Q){if(!ZZ.isSeq(X))Q("Expected a sequence for this tag");return X},createNode:(X,Q,J)=>t7.YAMLSeq.from(X,Q,J)};AZ.seq=OZ});var O8=p((jZ)=>{var RZ=K8(),IZ={identify:(X)=>typeof X==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(X)=>X,stringify(X,Q,J,Y){return Q=Object.assign({actualString:!0},Q),RZ.stringifyString(X,Q,J,Y)}};jZ.string=IZ});var g6=p((PZ)=>{var e7=v0(),XY={identify:(X)=>X==null,createNode:()=>new e7.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new e7.Scalar(null),stringify:({source:X},Q)=>typeof X==="string"&&XY.test.test(X)?X:Q.options.nullStr};PZ.nullTag=XY});var DQ=p((EZ)=>{var SZ=v0(),QY={identify:(X)=>typeof X==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:(X)=>new SZ.Scalar(X[0]==="t"||X[0]==="T"),stringify({source:X,value:Q},J){if(X&&QY.test.test(X)){let Y=X[0]==="t"||X[0]==="T";if(Q===Y)return X}return Q?J.options.trueStr:J.options.falseStr}};EZ.boolTag=QY});var T9=p((_Z)=>{function CZ({format:X,minFractionDigits:Q,tag:J,value:Y}){if(typeof Y==="bigint")return String(Y);let G=typeof Y==="number"?Y:Number(Y);if(!isFinite(G))return isNaN(G)?".nan":G<0?"-.inf":".inf";let $=Object.is(Y,-0)?"-0":JSON.stringify(Y);if(!X&&Q&&(!J||J==="tag:yaml.org,2002:float")&&/^\d/.test($)){let W=$.indexOf(".");if(W<0)W=$.length,$+=".";let H=Q-($.length-W-1);while(H-- >0)$+="0"}return $}_Z.stringifyNumber=CZ});var OQ=p((hZ)=>{var vZ=v0(),ZQ=T9(),yZ={identify:(X)=>typeof X==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(X)=>X.slice(-3).toLowerCase()==="nan"?NaN:X[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ZQ.stringifyNumber},xZ={identify:(X)=>typeof X==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:(X)=>parseFloat(X),stringify(X){let Q=Number(X.value);return isFinite(Q)?Q.toExponential():ZQ.stringifyNumber(X)}},gZ={identify:(X)=>typeof X==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(X){let Q=new vZ.Scalar(parseFloat(X)),J=X.indexOf(".");if(J!==-1&&X[X.length-1]==="0")Q.minFractionDigits=X.length-J-1;return Q},stringify:ZQ.stringifyNumber};hZ.float=gZ;hZ.floatExp=xZ;hZ.floatNaN=yZ});var NQ=p((dZ)=>{var JY=T9(),h6=(X)=>typeof X==="bigint"||Number.isInteger(X),AQ=(X,Q,J,{intAsBigInt:Y})=>Y?BigInt(X):parseInt(X.substring(Q),J);function YY(X,Q,J){let{value:Y}=X;if(h6(Y)&&Y>=0)return J+Y.toString(Q);return JY.stringifyNumber(X)}var lZ={identify:(X)=>h6(X)&&X>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(X,Q,J)=>AQ(X,2,8,J),stringify:(X)=>YY(X,8,"0o")},cZ={identify:h6,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(X,Q,J)=>AQ(X,0,10,J),stringify:JY.stringifyNumber},pZ={identify:(X)=>h6(X)&&X>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(X,Q,J)=>AQ(X,2,16,J),stringify:(X)=>YY(X,16,"0x")};dZ.int=cZ;dZ.intHex=pZ;dZ.intOct=lZ});var GY=p((QO)=>{var oZ=w9(),aZ=g6(),sZ=P9(),tZ=O8(),eZ=DQ(),RQ=OQ(),IQ=NQ(),XO=[oZ.map,sZ.seq,tZ.string,aZ.nullTag,eZ.boolTag,IQ.intOct,IQ.int,IQ.intHex,RQ.floatNaN,RQ.floatExp,RQ.float];QO.schema=XO});var WY=p((BO)=>{var YO=v0(),GO=w9(),$O=P9();function $Y(X){return typeof X==="bigint"||Number.isInteger(X)}var f6=({value:X})=>JSON.stringify(X),WO=[{identify:(X)=>typeof X==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(X)=>X,stringify:f6},{identify:(X)=>X==null,createNode:()=>new YO.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:f6},{identify:(X)=>typeof X==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:(X)=>X==="true",stringify:f6},{identify:$Y,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(X,Q,{intAsBigInt:J})=>J?BigInt(X):parseInt(X,10),stringify:({value:X})=>$Y(X)?X.toString():JSON.stringify(X)},{identify:(X)=>typeof X==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:(X)=>parseFloat(X),stringify:f6}],HO={default:!0,tag:"",test:/^/,resolve(X,Q){return Q(`Unresolved plain scalar ${JSON.stringify(X)}`),X}},UO=[GO.map,$O.seq].concat(WO,HO);BO.schema=UO});var wQ=p((FO)=>{var A8=O1("buffer"),jQ=v0(),LO=K8(),qO={identify:(X)=>X instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(X,Q){if(typeof A8.Buffer==="function")return A8.Buffer.from(X,"base64");else if(typeof atob==="function"){let J=atob(X.replace(/[\n\r]/g,"")),Y=new Uint8Array(J.length);for(let G=0;G<J.length;++G)Y[G]=J.charCodeAt(G);return Y}else return Q("This environment does not support reading binary tags; either Buffer or atob is required"),X},stringify({comment:X,type:Q,value:J},Y,G,$){if(!J)return"";let W=J,H;if(typeof A8.Buffer==="function")H=W instanceof A8.Buffer?W.toString("base64"):A8.Buffer.from(W.buffer).toString("base64");else if(typeof btoa==="function"){let U="";for(let B=0;B<W.length;++B)U+=String.fromCharCode(W[B]);H=btoa(U)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(Q??(Q=jQ.Scalar.BLOCK_LITERAL),Q!==jQ.Scalar.QUOTE_DOUBLE){let U=Math.max(Y.options.lineWidth-Y.indent.length,Y.options.minContentWidth),B=Math.ceil(H.length/U),q=Array(B);for(let K=0,V=0;K<B;++K,V+=U)q[K]=H.substr(V,U);H=q.join(Q===jQ.Scalar.BLOCK_LITERAL?`
79
+ `:" ")}return LO.stringifyString({comment:X,type:Q,value:H},Y,G,$)}};FO.binary=qO});var m6=p((ZO)=>{var u6=K0(),PQ=f1(),VO=v0(),MO=l1();function HY(X,Q){if(u6.isSeq(X))for(let J=0;J<X.items.length;++J){let Y=X.items[J];if(u6.isPair(Y))continue;else if(u6.isMap(Y)){if(Y.items.length>1)Q("Each pair must have its own sequence indicator");let G=Y.items[0]||new PQ.Pair(new VO.Scalar(null));if(Y.commentBefore)G.key.commentBefore=G.key.commentBefore?`${Y.commentBefore}
80
80
  ${G.key.commentBefore}`:Y.commentBefore;if(Y.comment){let $=G.value??G.key;$.comment=$.comment?`${Y.comment}
81
- ${$.comment}`:Y.comment}Y=G}X.items[J]=l6.isPair(Y)?Y:new wQ.Pair(Y)}else Q("Expected a sequence for this tag");return X}function LY(X,Q,J){let{replacer:Y}=J,G=new MO.YAMLSeq(X);G.tag="tag:yaml.org,2002:pairs";let $=0;if(Q&&Symbol.iterator in Object(Q))for(let W of Q){if(typeof Y==="function")W=Y.call(Q,String($++),W);let H,U;if(Array.isArray(W))if(W.length===2)H=W[0],U=W[1];else throw TypeError(`Expected [key, value] tuple: ${W}`);else if(W&&W instanceof Object){let z=Object.keys(W);if(z.length===1)H=z[0],U=W[H];else throw TypeError(`Expected tuple with one key, not ${z.length} keys`)}else H=W;G.items.push(wQ.createPair(H,U,J))}return G}var DO={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:BY,createNode:LY};ZO.createPairs=LY;ZO.pairs=DO;ZO.resolvePairs=BY});var TQ=p((jO)=>{var qY=K0(),PQ=x1(),R8=m1(),RO=l1(),FY=c6();class e1 extends RO.YAMLSeq{constructor(){super();this.add=R8.YAMLMap.prototype.add.bind(this),this.delete=R8.YAMLMap.prototype.delete.bind(this),this.get=R8.YAMLMap.prototype.get.bind(this),this.has=R8.YAMLMap.prototype.has.bind(this),this.set=R8.YAMLMap.prototype.set.bind(this),this.tag=e1.tag}toJSON(X,Q){if(!Q)return super.toJSON(X);let J=new Map;if(Q?.onCreate)Q.onCreate(J);for(let Y of this.items){let G,$;if(qY.isPair(Y))G=PQ.toJS(Y.key,"",Q),$=PQ.toJS(Y.value,G,Q);else G=PQ.toJS(Y,"",Q);if(J.has(G))throw Error("Ordered maps must not include duplicate keys");J.set(G,$)}return J}static from(X,Q,J){let Y=FY.createPairs(X,Q,J),G=new this;return G.items=Y.items,G}}e1.tag="tag:yaml.org,2002:omap";var IO={collection:"seq",identify:(X)=>X instanceof Map,nodeClass:e1,default:!1,tag:"tag:yaml.org,2002:omap",resolve(X,Q){let J=FY.resolvePairs(X,Q),Y=[];for(let{key:G}of J.items)if(qY.isScalar(G))if(Y.includes(G.value))Q(`Ordered maps must not include duplicate keys: ${G.value}`);else Y.push(G.value);return Object.assign(new e1,J)},createNode:(X,Q,J)=>e1.from(X,Q,J)};jO.YAMLOMap=e1;jO.omap=IO});var ZY=p((TO)=>{var KY=v0();function VY({value:X,source:Q},J){if(Q&&(X?MY:DY).test.test(Q))return Q;return X?J.options.trueStr:J.options.falseStr}var MY={identify:(X)=>X===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new KY.Scalar(!0),stringify:VY},DY={identify:(X)=>X===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new KY.Scalar(!1),stringify:VY};TO.falseTag=DY;TO.trueTag=MY});var OY=p((vO)=>{var bO=v0(),SQ=S9(),CO={identify:(X)=>typeof X==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(X)=>X.slice(-3).toLowerCase()==="nan"?NaN:X[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:SQ.stringifyNumber},_O={identify:(X)=>typeof X==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:(X)=>parseFloat(X.replace(/_/g,"")),stringify(X){let Q=Number(X.value);return isFinite(Q)?Q.toExponential():SQ.stringifyNumber(X)}},kO={identify:(X)=>typeof X==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(X){let Q=new bO.Scalar(parseFloat(X.replace(/_/g,""))),J=X.indexOf(".");if(J!==-1){let Y=X.substring(J+1).replace(/_/g,"");if(Y[Y.length-1]==="0")Q.minFractionDigits=Y.length}return Q},stringify:SQ.stringifyNumber};vO.float=kO;vO.floatExp=_O;vO.floatNaN=CO});var NY=p((lO)=>{var AY=S9(),I8=(X)=>typeof X==="bigint"||Number.isInteger(X);function p6(X,Q,J,{intAsBigInt:Y}){let G=X[0];if(G==="-"||G==="+")Q+=1;if(X=X.substring(Q).replace(/_/g,""),Y){switch(J){case 2:X=`0b${X}`;break;case 8:X=`0o${X}`;break;case 16:X=`0x${X}`;break}let W=BigInt(X);return G==="-"?BigInt(-1)*W:W}let $=parseInt(X,J);return G==="-"?-1*$:$}function EQ(X,Q,J){let{value:Y}=X;if(I8(Y)){let G=Y.toString(Q);return Y<0?"-"+J+G.substr(1):J+G}return AY.stringifyNumber(X)}var hO={identify:I8,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(X,Q,J)=>p6(X,2,2,J),stringify:(X)=>EQ(X,2,"0b")},fO={identify:I8,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(X,Q,J)=>p6(X,1,8,J),stringify:(X)=>EQ(X,8,"0")},uO={identify:I8,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(X,Q,J)=>p6(X,0,10,J),stringify:AY.stringifyNumber},mO={identify:I8,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(X,Q,J)=>p6(X,2,16,J),stringify:(X)=>EQ(X,16,"0x")};lO.int=uO;lO.intBin=hO;lO.intHex=mO;lO.intOct=fO});var bQ=p((rO)=>{var n6=K0(),d6=f1(),i6=m1();class X9 extends i6.YAMLMap{constructor(X){super(X);this.tag=X9.tag}add(X){let Q;if(n6.isPair(X))Q=X;else if(X&&typeof X==="object"&&"key"in X&&"value"in X&&X.value===null)Q=new d6.Pair(X.key,null);else Q=new d6.Pair(X,null);if(!i6.findPair(this.items,Q.key))this.items.push(Q)}get(X,Q){let J=i6.findPair(this.items,X);return!Q&&n6.isPair(J)?n6.isScalar(J.key)?J.key.value:J.key:J}set(X,Q){if(typeof Q!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof Q}`);let J=i6.findPair(this.items,X);if(J&&!Q)this.items.splice(this.items.indexOf(J),1);else if(!J&&Q)this.items.push(new d6.Pair(X))}toJSON(X,Q){return super.toJSON(X,Q,Set)}toString(X,Q,J){if(!X)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},X,{allNullValues:!0}),Q,J);else throw Error("Set items must all have null values")}static from(X,Q,J){let{replacer:Y}=J,G=new this(X);if(Q&&Symbol.iterator in Object(Q))for(let $ of Q){if(typeof Y==="function")$=Y.call(Q,$,$);G.items.push(d6.createPair($,null,J))}return G}}X9.tag="tag:yaml.org,2002:set";var nO={collection:"map",identify:(X)=>X instanceof Set,nodeClass:X9,default:!1,tag:"tag:yaml.org,2002:set",createNode:(X,Q,J)=>X9.from(X,Q,J),resolve(X,Q){if(n6.isMap(X))if(X.hasAllNullValues(!0))return Object.assign(new X9,X);else Q("Set items must all have null values");else Q("Expected a mapping for this tag");return X}};rO.YAMLSet=X9;rO.set=nO});var _Q=p((XA)=>{var sO=S9();function CQ(X,Q){let J=X[0],Y=J==="-"||J==="+"?X.substring(1):X,G=(W)=>Q?BigInt(W):Number(W),$=Y.replace(/_/g,"").split(":").reduce((W,H)=>W*G(60)+G(H),G(0));return J==="-"?G(-1)*$:$}function RY(X){let{value:Q}=X,J=(W)=>W;if(typeof Q==="bigint")J=(W)=>BigInt(W);else if(isNaN(Q)||!isFinite(Q))return sO.stringifyNumber(X);let Y="";if(Q<0)Y="-",Q*=J(-1);let G=J(60),$=[Q%G];if(Q<60)$.unshift(0);else if(Q=(Q-$[0])/G,$.unshift(Q%G),Q>=60)Q=(Q-$[0])/G,$.unshift(Q);return Y+$.map((W)=>String(W).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var tO={identify:(X)=>typeof X==="bigint"||Number.isInteger(X),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(X,Q,{intAsBigInt:J})=>CQ(X,J),stringify:RY},eO={identify:(X)=>typeof X==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:(X)=>CQ(X,!1),stringify:RY},IY={identify:(X)=>X 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(X){let Q=X.match(IY.test);if(!Q)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,J,Y,G,$,W,H]=Q.map(Number),U=Q[7]?Number((Q[7]+"00").substr(1,3)):0,z=Date.UTC(J,Y-1,G,$||0,W||0,H||0,U),F=Q[8];if(F&&F!=="Z"){let K=CQ(F,!1);if(Math.abs(K)<30)K*=60;z-=60000*K}return new Date(z)},stringify:({value:X})=>X?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};XA.floatTime=eO;XA.intTime=tO;XA.timestamp=IY});var wY=p((KA)=>{var GA=P9(),$A=f6(),WA=T9(),HA=A8(),UA=jQ(),jY=ZY(),kQ=OY(),r6=NY(),zA=C6(),BA=TQ(),LA=c6(),qA=bQ(),vQ=_Q(),FA=[GA.map,WA.seq,HA.string,$A.nullTag,jY.trueTag,jY.falseTag,r6.intBin,r6.intOct,r6.int,r6.intHex,kQ.floatNaN,kQ.floatExp,kQ.float,UA.binary,zA.merge,BA.omap,LA.pairs,qA.set,vQ.intTime,vQ.floatTime,vQ.timestamp];KA.schema=FA});var yY=p((IA)=>{var EY=P9(),MA=f6(),bY=T9(),DA=A8(),ZA=MQ(),yQ=ZQ(),xQ=AQ(),OA=HY(),AA=zY(),CY=jQ(),j8=C6(),_Y=TQ(),kY=c6(),PY=wY(),vY=bQ(),o6=_Q(),TY=new Map([["core",OA.schema],["failsafe",[EY.map,bY.seq,DA.string]],["json",AA.schema],["yaml11",PY.schema],["yaml-1.1",PY.schema]]),SY={binary:CY.binary,bool:ZA.boolTag,float:yQ.float,floatExp:yQ.floatExp,floatNaN:yQ.floatNaN,floatTime:o6.floatTime,int:xQ.int,intHex:xQ.intHex,intOct:xQ.intOct,intTime:o6.intTime,map:EY.map,merge:j8.merge,null:MA.nullTag,omap:_Y.omap,pairs:kY.pairs,seq:bY.seq,set:vY.set,timestamp:o6.timestamp},NA={"tag:yaml.org,2002:binary":CY.binary,"tag:yaml.org,2002:merge":j8.merge,"tag:yaml.org,2002:omap":_Y.omap,"tag:yaml.org,2002:pairs":kY.pairs,"tag:yaml.org,2002:set":vY.set,"tag:yaml.org,2002:timestamp":o6.timestamp};function RA(X,Q,J){let Y=TY.get(Q);if(Y&&!X)return J&&!Y.includes(j8.merge)?Y.concat(j8.merge):Y.slice();let G=Y;if(!G)if(Array.isArray(X))G=[];else{let $=Array.from(TY.keys()).filter((W)=>W!=="yaml11").map((W)=>JSON.stringify(W)).join(", ");throw Error(`Unknown schema "${Q}"; use one of ${$} or define customTags array`)}if(Array.isArray(X))for(let $ of X)G=G.concat($);else if(typeof X==="function")G=X(G.slice());if(J)G=G.concat(j8.merge);return G.reduce(($,W)=>{let H=typeof W==="string"?SY[W]:W;if(!H){let U=JSON.stringify(W),z=Object.keys(SY).map((F)=>JSON.stringify(F)).join(", ");throw Error(`Unknown custom tag ${U}; use one of ${z}`)}if(!$.includes(H))$.push(H);return $},[])}IA.coreKnownTags=NA;IA.getTags=RA});var fQ=p((bA)=>{var gQ=K0(),PA=P9(),TA=T9(),SA=A8(),a6=yY(),EA=(X,Q)=>X.key<Q.key?-1:X.key>Q.key?1:0;class hQ{constructor({compat:X,customTags:Q,merge:J,resolveKnownTags:Y,schema:G,sortMapEntries:$,toStringDefaults:W}){this.compat=Array.isArray(X)?a6.getTags(X,"compat"):X?a6.getTags(null,X):null,this.name=typeof G==="string"&&G||"core",this.knownTags=Y?a6.coreKnownTags:{},this.tags=a6.getTags(Q,this.name,J),this.toStringOptions=W??null,Object.defineProperty(this,gQ.MAP,{value:PA.map}),Object.defineProperty(this,gQ.SCALAR,{value:SA.string}),Object.defineProperty(this,gQ.SEQ,{value:TA.seq}),this.sortMapEntries=typeof $==="function"?$:$===!0?EA:null}clone(){let X=Object.create(hQ.prototype,Object.getOwnPropertyDescriptors(this));return X.tags=this.tags.slice(),X}}bA.Schema=hQ});var xY=p((vA)=>{var _A=K0(),uQ=M8(),w8=F8();function kA(X,Q){let J=[],Y=Q.directives===!0;if(Q.directives!==!1&&X.directives){let U=X.directives.toString(X);if(U)J.push(U),Y=!0;else if(X.directives.docStart)Y=!0}if(Y)J.push("---");let G=uQ.createStringifyContext(X,Q),{commentString:$}=G.options;if(X.commentBefore){if(J.length!==1)J.unshift("");let U=$(X.commentBefore);J.unshift(w8.indentComment(U,""))}let W=!1,H=null;if(X.contents){if(_A.isNode(X.contents)){if(X.contents.spaceBefore&&Y)J.push("");if(X.contents.commentBefore){let F=$(X.contents.commentBefore);J.push(w8.indentComment(F,""))}G.forceBlockIndent=!!X.comment,H=X.contents.comment}let U=H?void 0:()=>W=!0,z=uQ.stringify(X.contents,G,()=>H=null,U);if(H)z+=w8.lineComment(z,"",$(H));if((z[0]==="|"||z[0]===">")&&J[J.length-1]==="---")J[J.length-1]=`--- ${z}`;else J.push(z)}else J.push(uQ.stringify(X.contents,G));if(X.directives?.docEnd)if(X.comment){let U=$(X.comment);if(U.includes(`
82
- `))J.push("..."),J.push(w8.indentComment(U,""));else J.push(`... ${U}`)}else J.push("...");else{let U=X.comment;if(U&&W)U=U.replace(/^\n+/,"");if(U){if((!W||H)&&J[J.length-1]!=="")J.push("");J.push(w8.indentComment($(U),""))}}return J.join(`
81
+ ${$.comment}`:Y.comment}Y=G}X.items[J]=u6.isPair(Y)?Y:new PQ.Pair(Y)}else Q("Expected a sequence for this tag");return X}function UY(X,Q,J){let{replacer:Y}=J,G=new MO.YAMLSeq(X);G.tag="tag:yaml.org,2002:pairs";let $=0;if(Q&&Symbol.iterator in Object(Q))for(let W of Q){if(typeof Y==="function")W=Y.call(Q,String($++),W);let H,U;if(Array.isArray(W))if(W.length===2)H=W[0],U=W[1];else throw TypeError(`Expected [key, value] tuple: ${W}`);else if(W&&W instanceof Object){let B=Object.keys(W);if(B.length===1)H=B[0],U=W[H];else throw TypeError(`Expected tuple with one key, not ${B.length} keys`)}else H=W;G.items.push(PQ.createPair(H,U,J))}return G}var DO={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:HY,createNode:UY};ZO.createPairs=UY;ZO.pairs=DO;ZO.resolvePairs=HY});var SQ=p((jO)=>{var BY=K0(),TQ=x1(),N8=m1(),RO=l1(),zY=m6();class e1 extends RO.YAMLSeq{constructor(){super();this.add=N8.YAMLMap.prototype.add.bind(this),this.delete=N8.YAMLMap.prototype.delete.bind(this),this.get=N8.YAMLMap.prototype.get.bind(this),this.has=N8.YAMLMap.prototype.has.bind(this),this.set=N8.YAMLMap.prototype.set.bind(this),this.tag=e1.tag}toJSON(X,Q){if(!Q)return super.toJSON(X);let J=new Map;if(Q?.onCreate)Q.onCreate(J);for(let Y of this.items){let G,$;if(BY.isPair(Y))G=TQ.toJS(Y.key,"",Q),$=TQ.toJS(Y.value,G,Q);else G=TQ.toJS(Y,"",Q);if(J.has(G))throw Error("Ordered maps must not include duplicate keys");J.set(G,$)}return J}static from(X,Q,J){let Y=zY.createPairs(X,Q,J),G=new this;return G.items=Y.items,G}}e1.tag="tag:yaml.org,2002:omap";var IO={collection:"seq",identify:(X)=>X instanceof Map,nodeClass:e1,default:!1,tag:"tag:yaml.org,2002:omap",resolve(X,Q){let J=zY.resolvePairs(X,Q),Y=[];for(let{key:G}of J.items)if(BY.isScalar(G))if(Y.includes(G.value))Q(`Ordered maps must not include duplicate keys: ${G.value}`);else Y.push(G.value);return Object.assign(new e1,J)},createNode:(X,Q,J)=>e1.from(X,Q,J)};jO.YAMLOMap=e1;jO.omap=IO});var VY=p((TO)=>{var LY=v0();function qY({value:X,source:Q},J){if(Q&&(X?FY:KY).test.test(Q))return Q;return X?J.options.trueStr:J.options.falseStr}var FY={identify:(X)=>X===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new LY.Scalar(!0),stringify:qY},KY={identify:(X)=>X===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new LY.Scalar(!1),stringify:qY};TO.falseTag=KY;TO.trueTag=FY});var MY=p((vO)=>{var bO=v0(),EQ=T9(),CO={identify:(X)=>typeof X==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(X)=>X.slice(-3).toLowerCase()==="nan"?NaN:X[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:EQ.stringifyNumber},_O={identify:(X)=>typeof X==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:(X)=>parseFloat(X.replace(/_/g,"")),stringify(X){let Q=Number(X.value);return isFinite(Q)?Q.toExponential():EQ.stringifyNumber(X)}},kO={identify:(X)=>typeof X==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(X){let Q=new bO.Scalar(parseFloat(X.replace(/_/g,""))),J=X.indexOf(".");if(J!==-1){let Y=X.substring(J+1).replace(/_/g,"");if(Y[Y.length-1]==="0")Q.minFractionDigits=Y.length}return Q},stringify:EQ.stringifyNumber};vO.float=kO;vO.floatExp=_O;vO.floatNaN=CO});var ZY=p((lO)=>{var DY=T9(),R8=(X)=>typeof X==="bigint"||Number.isInteger(X);function l6(X,Q,J,{intAsBigInt:Y}){let G=X[0];if(G==="-"||G==="+")Q+=1;if(X=X.substring(Q).replace(/_/g,""),Y){switch(J){case 2:X=`0b${X}`;break;case 8:X=`0o${X}`;break;case 16:X=`0x${X}`;break}let W=BigInt(X);return G==="-"?BigInt(-1)*W:W}let $=parseInt(X,J);return G==="-"?-1*$:$}function bQ(X,Q,J){let{value:Y}=X;if(R8(Y)){let G=Y.toString(Q);return Y<0?"-"+J+G.substr(1):J+G}return DY.stringifyNumber(X)}var hO={identify:R8,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(X,Q,J)=>l6(X,2,2,J),stringify:(X)=>bQ(X,2,"0b")},fO={identify:R8,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(X,Q,J)=>l6(X,1,8,J),stringify:(X)=>bQ(X,8,"0")},uO={identify:R8,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(X,Q,J)=>l6(X,0,10,J),stringify:DY.stringifyNumber},mO={identify:R8,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(X,Q,J)=>l6(X,2,16,J),stringify:(X)=>bQ(X,16,"0x")};lO.int=uO;lO.intBin=hO;lO.intHex=mO;lO.intOct=fO});var CQ=p((rO)=>{var d6=K0(),c6=f1(),p6=m1();class X9 extends p6.YAMLMap{constructor(X){super(X);this.tag=X9.tag}add(X){let Q;if(d6.isPair(X))Q=X;else if(X&&typeof X==="object"&&"key"in X&&"value"in X&&X.value===null)Q=new c6.Pair(X.key,null);else Q=new c6.Pair(X,null);if(!p6.findPair(this.items,Q.key))this.items.push(Q)}get(X,Q){let J=p6.findPair(this.items,X);return!Q&&d6.isPair(J)?d6.isScalar(J.key)?J.key.value:J.key:J}set(X,Q){if(typeof Q!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof Q}`);let J=p6.findPair(this.items,X);if(J&&!Q)this.items.splice(this.items.indexOf(J),1);else if(!J&&Q)this.items.push(new c6.Pair(X))}toJSON(X,Q){return super.toJSON(X,Q,Set)}toString(X,Q,J){if(!X)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},X,{allNullValues:!0}),Q,J);else throw Error("Set items must all have null values")}static from(X,Q,J){let{replacer:Y}=J,G=new this(X);if(Q&&Symbol.iterator in Object(Q))for(let $ of Q){if(typeof Y==="function")$=Y.call(Q,$,$);G.items.push(c6.createPair($,null,J))}return G}}X9.tag="tag:yaml.org,2002:set";var nO={collection:"map",identify:(X)=>X instanceof Set,nodeClass:X9,default:!1,tag:"tag:yaml.org,2002:set",createNode:(X,Q,J)=>X9.from(X,Q,J),resolve(X,Q){if(d6.isMap(X))if(X.hasAllNullValues(!0))return Object.assign(new X9,X);else Q("Set items must all have null values");else Q("Expected a mapping for this tag");return X}};rO.YAMLSet=X9;rO.set=nO});var kQ=p((XA)=>{var sO=T9();function _Q(X,Q){let J=X[0],Y=J==="-"||J==="+"?X.substring(1):X,G=(W)=>Q?BigInt(W):Number(W),$=Y.replace(/_/g,"").split(":").reduce((W,H)=>W*G(60)+G(H),G(0));return J==="-"?G(-1)*$:$}function OY(X){let{value:Q}=X,J=(W)=>W;if(typeof Q==="bigint")J=(W)=>BigInt(W);else if(isNaN(Q)||!isFinite(Q))return sO.stringifyNumber(X);let Y="";if(Q<0)Y="-",Q*=J(-1);let G=J(60),$=[Q%G];if(Q<60)$.unshift(0);else if(Q=(Q-$[0])/G,$.unshift(Q%G),Q>=60)Q=(Q-$[0])/G,$.unshift(Q);return Y+$.map((W)=>String(W).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var tO={identify:(X)=>typeof X==="bigint"||Number.isInteger(X),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(X,Q,{intAsBigInt:J})=>_Q(X,J),stringify:OY},eO={identify:(X)=>typeof X==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:(X)=>_Q(X,!1),stringify:OY},AY={identify:(X)=>X 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(X){let Q=X.match(AY.test);if(!Q)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,J,Y,G,$,W,H]=Q.map(Number),U=Q[7]?Number((Q[7]+"00").substr(1,3)):0,B=Date.UTC(J,Y-1,G,$||0,W||0,H||0,U),q=Q[8];if(q&&q!=="Z"){let K=_Q(q,!1);if(Math.abs(K)<30)K*=60;B-=60000*K}return new Date(B)},stringify:({value:X})=>X?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};XA.floatTime=eO;XA.intTime=tO;XA.timestamp=AY});var RY=p((KA)=>{var GA=w9(),$A=g6(),WA=P9(),HA=O8(),UA=wQ(),NY=VY(),vQ=MY(),i6=ZY(),BA=E6(),zA=SQ(),LA=m6(),qA=CQ(),yQ=kQ(),FA=[GA.map,WA.seq,HA.string,$A.nullTag,NY.trueTag,NY.falseTag,i6.intBin,i6.intOct,i6.int,i6.intHex,vQ.floatNaN,vQ.floatExp,vQ.float,UA.binary,BA.merge,zA.omap,LA.pairs,qA.set,yQ.intTime,yQ.floatTime,yQ.timestamp];KA.schema=FA});var _Y=p((IA)=>{var PY=w9(),MA=g6(),TY=P9(),DA=O8(),ZA=DQ(),xQ=OQ(),gQ=NQ(),OA=GY(),AA=WY(),SY=wQ(),I8=E6(),EY=SQ(),bY=m6(),IY=RY(),CY=CQ(),n6=kQ(),jY=new Map([["core",OA.schema],["failsafe",[PY.map,TY.seq,DA.string]],["json",AA.schema],["yaml11",IY.schema],["yaml-1.1",IY.schema]]),wY={binary:SY.binary,bool:ZA.boolTag,float:xQ.float,floatExp:xQ.floatExp,floatNaN:xQ.floatNaN,floatTime:n6.floatTime,int:gQ.int,intHex:gQ.intHex,intOct:gQ.intOct,intTime:n6.intTime,map:PY.map,merge:I8.merge,null:MA.nullTag,omap:EY.omap,pairs:bY.pairs,seq:TY.seq,set:CY.set,timestamp:n6.timestamp},NA={"tag:yaml.org,2002:binary":SY.binary,"tag:yaml.org,2002:merge":I8.merge,"tag:yaml.org,2002:omap":EY.omap,"tag:yaml.org,2002:pairs":bY.pairs,"tag:yaml.org,2002:set":CY.set,"tag:yaml.org,2002:timestamp":n6.timestamp};function RA(X,Q,J){let Y=jY.get(Q);if(Y&&!X)return J&&!Y.includes(I8.merge)?Y.concat(I8.merge):Y.slice();let G=Y;if(!G)if(Array.isArray(X))G=[];else{let $=Array.from(jY.keys()).filter((W)=>W!=="yaml11").map((W)=>JSON.stringify(W)).join(", ");throw Error(`Unknown schema "${Q}"; use one of ${$} or define customTags array`)}if(Array.isArray(X))for(let $ of X)G=G.concat($);else if(typeof X==="function")G=X(G.slice());if(J)G=G.concat(I8.merge);return G.reduce(($,W)=>{let H=typeof W==="string"?wY[W]:W;if(!H){let U=JSON.stringify(W),B=Object.keys(wY).map((q)=>JSON.stringify(q)).join(", ");throw Error(`Unknown custom tag ${U}; use one of ${B}`)}if(!$.includes(H))$.push(H);return $},[])}IA.coreKnownTags=NA;IA.getTags=RA});var uQ=p((bA)=>{var hQ=K0(),PA=w9(),TA=P9(),SA=O8(),r6=_Y(),EA=(X,Q)=>X.key<Q.key?-1:X.key>Q.key?1:0;class fQ{constructor({compat:X,customTags:Q,merge:J,resolveKnownTags:Y,schema:G,sortMapEntries:$,toStringDefaults:W}){this.compat=Array.isArray(X)?r6.getTags(X,"compat"):X?r6.getTags(null,X):null,this.name=typeof G==="string"&&G||"core",this.knownTags=Y?r6.coreKnownTags:{},this.tags=r6.getTags(Q,this.name,J),this.toStringOptions=W??null,Object.defineProperty(this,hQ.MAP,{value:PA.map}),Object.defineProperty(this,hQ.SCALAR,{value:SA.string}),Object.defineProperty(this,hQ.SEQ,{value:TA.seq}),this.sortMapEntries=typeof $==="function"?$:$===!0?EA:null}clone(){let X=Object.create(fQ.prototype,Object.getOwnPropertyDescriptors(this));return X.tags=this.tags.slice(),X}}bA.Schema=fQ});var kY=p((vA)=>{var _A=K0(),mQ=V8(),j8=q8();function kA(X,Q){let J=[],Y=Q.directives===!0;if(Q.directives!==!1&&X.directives){let U=X.directives.toString(X);if(U)J.push(U),Y=!0;else if(X.directives.docStart)Y=!0}if(Y)J.push("---");let G=mQ.createStringifyContext(X,Q),{commentString:$}=G.options;if(X.commentBefore){if(J.length!==1)J.unshift("");let U=$(X.commentBefore);J.unshift(j8.indentComment(U,""))}let W=!1,H=null;if(X.contents){if(_A.isNode(X.contents)){if(X.contents.spaceBefore&&Y)J.push("");if(X.contents.commentBefore){let q=$(X.contents.commentBefore);J.push(j8.indentComment(q,""))}G.forceBlockIndent=!!X.comment,H=X.contents.comment}let U=H?void 0:()=>W=!0,B=mQ.stringify(X.contents,G,()=>H=null,U);if(H)B+=j8.lineComment(B,"",$(H));if((B[0]==="|"||B[0]===">")&&J[J.length-1]==="---")J[J.length-1]=`--- ${B}`;else J.push(B)}else J.push(mQ.stringify(X.contents,G));if(X.directives?.docEnd)if(X.comment){let U=$(X.comment);if(U.includes(`
82
+ `))J.push("..."),J.push(j8.indentComment(U,""));else J.push(`... ${U}`)}else J.push("...");else{let U=X.comment;if(U&&W)U=U.replace(/^\n+/,"");if(U){if((!W||H)&&J[J.length-1]!=="")J.push("");J.push(j8.indentComment($(U),""))}}return J.join(`
83
83
  `)+`
84
- `}vA.stringifyDocument=kA});var P8=p((cA)=>{var xA=L8(),E9=w6(),Y1=K0(),gA=f1(),hA=x1(),fA=fQ(),uA=xY(),mQ=R6(),mA=WQ(),lA=q8(),lQ=$Q();class cQ{constructor(X,Q,J){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Y1.NODE_TYPE,{value:Y1.DOC});let Y=null;if(typeof Q==="function"||Array.isArray(Q))Y=Q;else if(J===void 0&&Q)J=Q,Q=void 0;let G=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},J);this.options=G;let{version:$}=G;if(J?._directives){if(this.directives=J._directives.atDocument(),this.directives.yaml.explicit)$=this.directives.yaml.version}else this.directives=new lQ.Directives({version:$});this.setSchema($,J),this.contents=X===void 0?null:this.createNode(X,Y,J)}clone(){let X=Object.create(cQ.prototype,{[Y1.NODE_TYPE]:{value:Y1.DOC}});if(X.commentBefore=this.commentBefore,X.comment=this.comment,X.errors=this.errors.slice(),X.warnings=this.warnings.slice(),X.options=Object.assign({},this.options),this.directives)X.directives=this.directives.clone();if(X.schema=this.schema.clone(),X.contents=Y1.isNode(this.contents)?this.contents.clone(X.schema):this.contents,this.range)X.range=this.range.slice();return X}add(X){if(b9(this.contents))this.contents.add(X)}addIn(X,Q){if(b9(this.contents))this.contents.addIn(X,Q)}createAlias(X,Q){if(!X.anchor){let J=mQ.anchorNames(this);X.anchor=!Q||J.has(Q)?mQ.findNewAnchor(Q||"a",J):Q}return new xA.Alias(X.anchor)}createNode(X,Q,J){let Y=void 0;if(typeof Q==="function")X=Q.call({"":X},"",X),Y=Q;else if(Array.isArray(Q)){let A=(B)=>typeof B==="number"||B instanceof String||B instanceof Number,Z=Q.filter(A).map(String);if(Z.length>0)Q=Q.concat(Z);Y=Q}else if(J===void 0&&Q)J=Q,Q=void 0;let{aliasDuplicateObjects:G,anchorPrefix:$,flow:W,keepUndefined:H,onTagObj:U,tag:z}=J??{},{onAnchor:F,setAnchors:K,sourceObjects:M}=mQ.createNodeAnchors(this,$||"a"),R={aliasDuplicateObjects:G??!0,keepUndefined:H??!1,onAnchor:F,onTagObj:U,replacer:Y,schema:this.schema,sourceObjects:M},w=lA.createNode(X,z,R);if(W&&Y1.isCollection(w))w.flow=!0;return K(),w}createPair(X,Q,J={}){let Y=this.createNode(X,null,J),G=this.createNode(Q,null,J);return new gA.Pair(Y,G)}delete(X){return b9(this.contents)?this.contents.delete(X):!1}deleteIn(X){if(E9.isEmptyPath(X)){if(this.contents==null)return!1;return this.contents=null,!0}return b9(this.contents)?this.contents.deleteIn(X):!1}get(X,Q){return Y1.isCollection(this.contents)?this.contents.get(X,Q):void 0}getIn(X,Q){if(E9.isEmptyPath(X))return!Q&&Y1.isScalar(this.contents)?this.contents.value:this.contents;return Y1.isCollection(this.contents)?this.contents.getIn(X,Q):void 0}has(X){return Y1.isCollection(this.contents)?this.contents.has(X):!1}hasIn(X){if(E9.isEmptyPath(X))return this.contents!==void 0;return Y1.isCollection(this.contents)?this.contents.hasIn(X):!1}set(X,Q){if(this.contents==null)this.contents=E9.collectionFromPath(this.schema,[X],Q);else if(b9(this.contents))this.contents.set(X,Q)}setIn(X,Q){if(E9.isEmptyPath(X))this.contents=Q;else if(this.contents==null)this.contents=E9.collectionFromPath(this.schema,Array.from(X),Q);else if(b9(this.contents))this.contents.setIn(X,Q)}setSchema(X,Q={}){if(typeof X==="number")X=String(X);let J;switch(X){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new lQ.Directives({version:"1.1"});J={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=X;else this.directives=new lQ.Directives({version:X});J={resolveKnownTags:!0,schema:"core"};break;case null:if(this.directives)delete this.directives;J=null;break;default:{let Y=JSON.stringify(X);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${Y}`)}}if(Q.schema instanceof Object)this.schema=Q.schema;else if(J)this.schema=new fA.Schema(Object.assign(J,Q));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:X,jsonArg:Q,mapAsMap:J,maxAliasCount:Y,onAnchor:G,reviver:$}={}){let W={anchors:new Map,doc:this,keep:!X,mapAsMap:J===!0,mapKeyWarned:!1,maxAliasCount:typeof Y==="number"?Y:100},H=hA.toJS(this.contents,Q??"",W);if(typeof G==="function")for(let{count:U,res:z}of W.anchors.values())G(z,U);return typeof $==="function"?mA.applyReviver($,{"":H},"",H):H}toJSON(X,Q){return this.toJS({json:!0,jsonArg:X,mapAsMap:!1,onAnchor:Q})}toString(X={}){if(this.errors.length>0)throw Error("Document with errors cannot be stringified");if("indent"in X&&(!Number.isInteger(X.indent)||Number(X.indent)<=0)){let Q=JSON.stringify(X.indent);throw Error(`"indent" option must be a positive integer, not ${Q}`)}return uA.stringifyDocument(this,X)}}function b9(X){if(Y1.isCollection(X))return!0;throw Error("Expected a YAML collection as document contents")}cA.Document=cQ});var T8=p((iA)=>{class s6 extends Error{constructor(X,Q,J,Y){super();this.name=X,this.code=J,this.message=Y,this.pos=Q}}class gY extends s6{constructor(X,Q,J){super("YAMLParseError",X,Q,J)}}class hY extends s6{constructor(X,Q,J){super("YAMLWarning",X,Q,J)}}var dA=(X,Q)=>(J)=>{if(J.pos[0]===-1)return;J.linePos=J.pos.map((H)=>Q.linePos(H));let{line:Y,col:G}=J.linePos[0];J.message+=` at line ${Y}, column ${G}`;let $=G-1,W=X.substring(Q.lineStarts[Y-1],Q.lineStarts[Y]).replace(/[\n\r]+$/,"");if($>=60&&W.length>80){let H=Math.min($-39,W.length-79);W="…"+W.substring(H),$-=H-1}if(W.length>80)W=W.substring(0,79)+"…";if(Y>1&&/^ *$/.test(W.substring(0,$))){let H=X.substring(Q.lineStarts[Y-2],Q.lineStarts[Y-1]);if(H.length>80)H=H.substring(0,79)+`…
85
- `;W=H+W}if(/[^ ]/.test(W)){let H=1,U=J.linePos[1];if(U?.line===Y&&U.col>G)H=Math.max(1,Math.min(U.col-G,80-$));let z=" ".repeat($)+"^".repeat(H);J.message+=`:
84
+ `}vA.stringifyDocument=kA});var w8=p((cA)=>{var xA=z8(),S9=I6(),J1=K0(),gA=f1(),hA=x1(),fA=uQ(),uA=kY(),lQ=A6(),mA=HQ(),lA=L8(),cQ=WQ();class pQ{constructor(X,Q,J){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,J1.NODE_TYPE,{value:J1.DOC});let Y=null;if(typeof Q==="function"||Array.isArray(Q))Y=Q;else if(J===void 0&&Q)J=Q,Q=void 0;let G=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},J);this.options=G;let{version:$}=G;if(J?._directives){if(this.directives=J._directives.atDocument(),this.directives.yaml.explicit)$=this.directives.yaml.version}else this.directives=new cQ.Directives({version:$});this.setSchema($,J),this.contents=X===void 0?null:this.createNode(X,Y,J)}clone(){let X=Object.create(pQ.prototype,{[J1.NODE_TYPE]:{value:J1.DOC}});if(X.commentBefore=this.commentBefore,X.comment=this.comment,X.errors=this.errors.slice(),X.warnings=this.warnings.slice(),X.options=Object.assign({},this.options),this.directives)X.directives=this.directives.clone();if(X.schema=this.schema.clone(),X.contents=J1.isNode(this.contents)?this.contents.clone(X.schema):this.contents,this.range)X.range=this.range.slice();return X}add(X){if(E9(this.contents))this.contents.add(X)}addIn(X,Q){if(E9(this.contents))this.contents.addIn(X,Q)}createAlias(X,Q){if(!X.anchor){let J=lQ.anchorNames(this);X.anchor=!Q||J.has(Q)?lQ.findNewAnchor(Q||"a",J):Q}return new xA.Alias(X.anchor)}createNode(X,Q,J){let Y=void 0;if(typeof Q==="function")X=Q.call({"":X},"",X),Y=Q;else if(Array.isArray(Q)){let A=(z)=>typeof z==="number"||z instanceof String||z instanceof Number,Z=Q.filter(A).map(String);if(Z.length>0)Q=Q.concat(Z);Y=Q}else if(J===void 0&&Q)J=Q,Q=void 0;let{aliasDuplicateObjects:G,anchorPrefix:$,flow:W,keepUndefined:H,onTagObj:U,tag:B}=J??{},{onAnchor:q,setAnchors:K,sourceObjects:V}=lQ.createNodeAnchors(this,$||"a"),N={aliasDuplicateObjects:G??!0,keepUndefined:H??!1,onAnchor:q,onTagObj:U,replacer:Y,schema:this.schema,sourceObjects:V},w=lA.createNode(X,B,N);if(W&&J1.isCollection(w))w.flow=!0;return K(),w}createPair(X,Q,J={}){let Y=this.createNode(X,null,J),G=this.createNode(Q,null,J);return new gA.Pair(Y,G)}delete(X){return E9(this.contents)?this.contents.delete(X):!1}deleteIn(X){if(S9.isEmptyPath(X)){if(this.contents==null)return!1;return this.contents=null,!0}return E9(this.contents)?this.contents.deleteIn(X):!1}get(X,Q){return J1.isCollection(this.contents)?this.contents.get(X,Q):void 0}getIn(X,Q){if(S9.isEmptyPath(X))return!Q&&J1.isScalar(this.contents)?this.contents.value:this.contents;return J1.isCollection(this.contents)?this.contents.getIn(X,Q):void 0}has(X){return J1.isCollection(this.contents)?this.contents.has(X):!1}hasIn(X){if(S9.isEmptyPath(X))return this.contents!==void 0;return J1.isCollection(this.contents)?this.contents.hasIn(X):!1}set(X,Q){if(this.contents==null)this.contents=S9.collectionFromPath(this.schema,[X],Q);else if(E9(this.contents))this.contents.set(X,Q)}setIn(X,Q){if(S9.isEmptyPath(X))this.contents=Q;else if(this.contents==null)this.contents=S9.collectionFromPath(this.schema,Array.from(X),Q);else if(E9(this.contents))this.contents.setIn(X,Q)}setSchema(X,Q={}){if(typeof X==="number")X=String(X);let J;switch(X){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new cQ.Directives({version:"1.1"});J={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=X;else this.directives=new cQ.Directives({version:X});J={resolveKnownTags:!0,schema:"core"};break;case null:if(this.directives)delete this.directives;J=null;break;default:{let Y=JSON.stringify(X);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${Y}`)}}if(Q.schema instanceof Object)this.schema=Q.schema;else if(J)this.schema=new fA.Schema(Object.assign(J,Q));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:X,jsonArg:Q,mapAsMap:J,maxAliasCount:Y,onAnchor:G,reviver:$}={}){let W={anchors:new Map,doc:this,keep:!X,mapAsMap:J===!0,mapKeyWarned:!1,maxAliasCount:typeof Y==="number"?Y:100},H=hA.toJS(this.contents,Q??"",W);if(typeof G==="function")for(let{count:U,res:B}of W.anchors.values())G(B,U);return typeof $==="function"?mA.applyReviver($,{"":H},"",H):H}toJSON(X,Q){return this.toJS({json:!0,jsonArg:X,mapAsMap:!1,onAnchor:Q})}toString(X={}){if(this.errors.length>0)throw Error("Document with errors cannot be stringified");if("indent"in X&&(!Number.isInteger(X.indent)||Number(X.indent)<=0)){let Q=JSON.stringify(X.indent);throw Error(`"indent" option must be a positive integer, not ${Q}`)}return uA.stringifyDocument(this,X)}}function E9(X){if(J1.isCollection(X))return!0;throw Error("Expected a YAML collection as document contents")}cA.Document=pQ});var P8=p((iA)=>{class o6 extends Error{constructor(X,Q,J,Y){super();this.name=X,this.code=J,this.message=Y,this.pos=Q}}class vY extends o6{constructor(X,Q,J){super("YAMLParseError",X,Q,J)}}class yY extends o6{constructor(X,Q,J){super("YAMLWarning",X,Q,J)}}var dA=(X,Q)=>(J)=>{if(J.pos[0]===-1)return;J.linePos=J.pos.map((H)=>Q.linePos(H));let{line:Y,col:G}=J.linePos[0];J.message+=` at line ${Y}, column ${G}`;let $=G-1,W=X.substring(Q.lineStarts[Y-1],Q.lineStarts[Y]).replace(/[\n\r]+$/,"");if($>=60&&W.length>80){let H=Math.min($-39,W.length-79);W="…"+W.substring(H),$-=H-1}if(W.length>80)W=W.substring(0,79)+"…";if(Y>1&&/^ *$/.test(W.substring(0,$))){let H=X.substring(Q.lineStarts[Y-2],Q.lineStarts[Y-1]);if(H.length>80)H=H.substring(0,79)+`…
85
+ `;W=H+W}if(/[^ ]/.test(W)){let H=1,U=J.linePos[1];if(U?.line===Y&&U.col>G)H=Math.max(1,Math.min(U.col-G,80-$));let B=" ".repeat($)+"^".repeat(H);J.message+=`:
86
86
 
87
87
  ${W}
88
- ${z}
89
- `}};iA.YAMLError=s6;iA.YAMLParseError=gY;iA.YAMLWarning=hY;iA.prettifyError=dA});var S8=p((tA)=>{function sA(X,{flow:Q,indicator:J,next:Y,offset:G,onError:$,parentIndent:W,startOnNewline:H}){let U=!1,z=H,F=H,K="",M="",R=!1,w=!1,A=null,Z=null,B=null,V=null,q=null,L=null,O=null;for(let j of X){if(w){if(j.type!=="space"&&j.type!=="newline"&&j.type!=="comma")$(j.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");w=!1}if(A){if(z&&j.type!=="comment"&&j.type!=="newline")$(A,"TAB_AS_INDENT","Tabs are not allowed as indentation");A=null}switch(j.type){case"space":if(!Q&&(J!=="doc-start"||Y?.type!=="flow-collection")&&j.source.includes("\t"))A=j;F=!0;break;case"comment":{if(!F)$(j,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let E=j.source.substring(1)||" ";if(!K)K=E;else K+=M+E;M="",z=!1;break}case"newline":if(z){if(K)K+=j.source;else if(!L||J!=="seq-item-ind")U=!0}else M+=j.source;if(z=!0,R=!0,Z||B)V=j;F=!0;break;case"anchor":if(Z)$(j,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(j.source.endsWith(":"))$(j.offset+j.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);Z=j,O??(O=j.offset),z=!1,F=!1,w=!0;break;case"tag":{if(B)$(j,"MULTIPLE_TAGS","A node can have at most one tag");B=j,O??(O=j.offset),z=!1,F=!1,w=!0;break}case J:if(Z||B)$(j,"BAD_PROP_ORDER",`Anchors and tags must be after the ${j.source} indicator`);if(L)$(j,"UNEXPECTED_TOKEN",`Unexpected ${j.source} in ${Q??"collection"}`);L=j,z=J==="seq-item-ind"||J==="explicit-key-ind",F=!1;break;case"comma":if(Q){if(q)$(j,"UNEXPECTED_TOKEN",`Unexpected , in ${Q}`);q=j,z=!1,F=!1;break}default:$(j,"UNEXPECTED_TOKEN",`Unexpected ${j.type} token`),z=!1,F=!1}}let D=X[X.length-1],I=D?D.offset+D.source.length:G;if(w&&Y&&Y.type!=="space"&&Y.type!=="newline"&&Y.type!=="comma"&&(Y.type!=="scalar"||Y.source!==""))$(Y.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(A&&(z&&A.indent<=W||Y?.type==="block-map"||Y?.type==="block-seq"))$(A,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:q,found:L,spaceBefore:U,comment:K,hasNewline:R,anchor:Z,tag:B,newlineAfterProp:V,end:I,start:O??I}}tA.resolveProps=sA});var t6=p((XN)=>{function pQ(X){if(!X)return null;switch(X.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(X.source.includes(`
90
- `))return!0;if(X.end){for(let Q of X.end)if(Q.type==="newline")return!0}return!1;case"flow-collection":for(let Q of X.items){for(let J of Q.start)if(J.type==="newline")return!0;if(Q.sep){for(let J of Q.sep)if(J.type==="newline")return!0}if(pQ(Q.key)||pQ(Q.value))return!0}return!1;default:return!0}}XN.containsNewline=pQ});var dQ=p((GN)=>{var JN=t6();function YN(X,Q,J){if(Q?.type==="flow-collection"){let Y=Q.end[0];if(Y.indent===X&&(Y.source==="]"||Y.source==="}")&&JN.containsNewline(Q))J(Y,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}GN.flowIndentCheck=YN});var iQ=p((HN)=>{var fY=K0();function WN(X,Q,J){let{uniqueKeys:Y}=X.options;if(Y===!1)return!1;let G=typeof Y==="function"?Y:($,W)=>$===W||fY.isScalar($)&&fY.isScalar(W)&&$.value===W.value;return Q.some(($)=>G($.key,J))}HN.mapIncludes=WN});var pY=p((FN)=>{var uY=f1(),zN=m1(),mY=S8(),BN=t6(),lY=dQ(),LN=iQ(),cY="All mapping items must start at the same column";function qN({composeNode:X,composeEmptyNode:Q},J,Y,G,$){let H=new($?.nodeClass??zN.YAMLMap)(J.schema);if(J.atRoot)J.atRoot=!1;let U=Y.offset,z=null;for(let F of Y.items){let{start:K,key:M,sep:R,value:w}=F,A=mY.resolveProps(K,{indicator:"explicit-key-ind",next:M??R?.[0],offset:U,onError:G,parentIndent:Y.indent,startOnNewline:!0}),Z=!A.found;if(Z){if(M){if(M.type==="block-seq")G(U,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in M&&M.indent!==Y.indent)G(U,"BAD_INDENT",cY)}if(!A.anchor&&!A.tag&&!R){if(z=A.end,A.comment)if(H.comment)H.comment+=`
91
- `+A.comment;else H.comment=A.comment;continue}if(A.newlineAfterProp||BN.containsNewline(M))G(M??K[K.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(A.found?.indent!==Y.indent)G(U,"BAD_INDENT",cY);J.atKey=!0;let B=A.end,V=M?X(J,M,A,G):Q(J,B,K,null,A,G);if(J.schema.compat)lY.flowIndentCheck(Y.indent,M,G);if(J.atKey=!1,LN.mapIncludes(J,H.items,V))G(B,"DUPLICATE_KEY","Map keys must be unique");let q=mY.resolveProps(R??[],{indicator:"map-value-ind",next:w,offset:V.range[2],onError:G,parentIndent:Y.indent,startOnNewline:!M||M.type==="block-scalar"});if(U=q.end,q.found){if(Z){if(w?.type==="block-map"&&!q.hasNewline)G(U,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(J.options.strict&&A.start<q.found.offset-1024)G(V.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let L=w?X(J,w,q,G):Q(J,U,R,null,q,G);if(J.schema.compat)lY.flowIndentCheck(Y.indent,w,G);U=L.range[2];let O=new uY.Pair(V,L);if(J.options.keepSourceTokens)O.srcToken=F;H.items.push(O)}else{if(Z)G(V.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(q.comment)if(V.comment)V.comment+=`
92
- `+q.comment;else V.comment=q.comment;let L=new uY.Pair(V);if(J.options.keepSourceTokens)L.srcToken=F;H.items.push(L)}}if(z&&z<U)G(z,"IMPOSSIBLE","Map comment with trailing content");return H.range=[Y.offset,U,z??U],H}FN.resolveBlockMap=qN});var dY=p((ON)=>{var VN=l1(),MN=S8(),DN=dQ();function ZN({composeNode:X,composeEmptyNode:Q},J,Y,G,$){let H=new($?.nodeClass??VN.YAMLSeq)(J.schema);if(J.atRoot)J.atRoot=!1;if(J.atKey)J.atKey=!1;let U=Y.offset,z=null;for(let{start:F,value:K}of Y.items){let M=MN.resolveProps(F,{indicator:"seq-item-ind",next:K,offset:U,onError:G,parentIndent:Y.indent,startOnNewline:!0});if(!M.found)if(M.anchor||M.tag||K)if(K?.type==="block-seq")G(M.end,"BAD_INDENT","All sequence items must start at the same column");else G(U,"MISSING_CHAR","Sequence item without - indicator");else{if(z=M.end,M.comment)H.comment=M.comment;continue}let R=K?X(J,K,M,G):Q(J,M.end,F,null,M,G);if(J.schema.compat)DN.flowIndentCheck(Y.indent,K,G);U=R.range[2],H.items.push(R)}return H.range=[Y.offset,U,z??U],H}ON.resolveBlockSeq=ZN});var C9=p((RN)=>{function NN(X,Q,J,Y){let G="";if(X){let $=!1,W="";for(let H of X){let{source:U,type:z}=H;switch(z){case"space":$=!0;break;case"comment":{if(J&&!$)Y(H,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let F=U.substring(1)||" ";if(!G)G=F;else G+=W+F;W="";break}case"newline":if(G)W+=U;$=!0;break;default:Y(H,"UNEXPECTED_TOKEN",`Unexpected ${z} at node end`)}Q+=U.length}}return{comment:G,offset:Q}}RN.resolveEnd=NN});var rY=p((CN)=>{var jN=K0(),wN=f1(),iY=m1(),PN=l1(),TN=C9(),nY=S8(),SN=t6(),EN=iQ(),nQ="Block collections are not allowed within flow collections",rQ=(X)=>X&&(X.type==="block-map"||X.type==="block-seq");function bN({composeNode:X,composeEmptyNode:Q},J,Y,G,$){let W=Y.start.source==="{",H=W?"flow map":"flow sequence",z=new($?.nodeClass??(W?iY.YAMLMap:PN.YAMLSeq))(J.schema);z.flow=!0;let F=J.atRoot;if(F)J.atRoot=!1;if(J.atKey)J.atKey=!1;let K=Y.offset+Y.start.source.length;for(let Z=0;Z<Y.items.length;++Z){let B=Y.items[Z],{start:V,key:q,sep:L,value:O}=B,D=nY.resolveProps(V,{flow:H,indicator:"explicit-key-ind",next:q??L?.[0],offset:K,onError:G,parentIndent:Y.indent,startOnNewline:!1});if(!D.found){if(!D.anchor&&!D.tag&&!L&&!O){if(Z===0&&D.comma)G(D.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${H}`);else if(Z<Y.items.length-1)G(D.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${H}`);if(D.comment)if(z.comment)z.comment+=`
93
- `+D.comment;else z.comment=D.comment;K=D.end;continue}if(!W&&J.options.strict&&SN.containsNewline(q))G(q,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(Z===0){if(D.comma)G(D.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${H}`)}else{if(!D.comma)G(D.start,"MISSING_CHAR",`Missing , between ${H} items`);if(D.comment){let I="";X:for(let j of V)switch(j.type){case"comma":case"space":break;case"comment":I=j.source.substring(1);break X;default:break X}if(I){let j=z.items[z.items.length-1];if(jN.isPair(j))j=j.value??j.key;if(j.comment)j.comment+=`
94
- `+I;else j.comment=I;D.comment=D.comment.substring(I.length+1)}}}if(!W&&!L&&!D.found){let I=O?X(J,O,D,G):Q(J,D.end,L,null,D,G);if(z.items.push(I),K=I.range[2],rQ(O))G(I.range,"BLOCK_IN_FLOW",nQ)}else{J.atKey=!0;let I=D.end,j=q?X(J,q,D,G):Q(J,I,V,null,D,G);if(rQ(q))G(j.range,"BLOCK_IN_FLOW",nQ);J.atKey=!1;let E=nY.resolveProps(L??[],{flow:H,indicator:"map-value-ind",next:O,offset:j.range[2],onError:G,parentIndent:Y.indent,startOnNewline:!1});if(E.found){if(!W&&!D.found&&J.options.strict){if(L)for(let x of L){if(x===E.found)break;if(x.type==="newline"){G(x,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(D.start<E.found.offset-1024)G(E.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(O)if("source"in O&&O.source?.[0]===":")G(O,"MISSING_CHAR",`Missing space after : in ${H}`);else G(E.start,"MISSING_CHAR",`Missing , or : between ${H} items`);let g=O?X(J,O,E,G):E.found?Q(J,E.end,L,null,E,G):null;if(g){if(rQ(O))G(g.range,"BLOCK_IN_FLOW",nQ)}else if(E.comment)if(j.comment)j.comment+=`
95
- `+E.comment;else j.comment=E.comment;let k=new wN.Pair(j,g);if(J.options.keepSourceTokens)k.srcToken=B;if(W){let x=z;if(EN.mapIncludes(J,x.items,j))G(I,"DUPLICATE_KEY","Map keys must be unique");x.items.push(k)}else{let x=new iY.YAMLMap(J.schema);x.flow=!0,x.items.push(k);let u=(g??j).range;x.range=[j.range[0],u[1],u[2]],z.items.push(x)}K=g?g.range[2]:E.end}}let M=W?"}":"]",[R,...w]=Y.end,A=K;if(R?.source===M)A=R.offset+R.source.length;else{let Z=H[0].toUpperCase()+H.substring(1),B=F?`${Z} must end with a ${M}`:`${Z} in block collection must be sufficiently indented and end with a ${M}`;if(G(K,F?"MISSING_CHAR":"BAD_INDENT",B),R&&R.source.length!==1)w.unshift(R)}if(w.length>0){let Z=TN.resolveEnd(w,A,J.options.strict,G);if(Z.comment)if(z.comment)z.comment+=`
96
- `+Z.comment;else z.comment=Z.comment;z.range=[Y.offset,A,Z.offset]}else z.range=[Y.offset,A,A];return z}CN.resolveFlowCollection=bN});var oY=p((mN)=>{var kN=K0(),vN=v0(),yN=m1(),xN=l1(),gN=pY(),hN=dY(),fN=rY();function oQ(X,Q,J,Y,G,$){let W=J.type==="block-map"?gN.resolveBlockMap(X,Q,J,Y,$):J.type==="block-seq"?hN.resolveBlockSeq(X,Q,J,Y,$):fN.resolveFlowCollection(X,Q,J,Y,$),H=W.constructor;if(G==="!"||G===H.tagName)return W.tag=H.tagName,W;if(G)W.tag=G;return W}function uN(X,Q,J,Y,G){let $=Y.tag,W=!$?null:Q.directives.tagName($.source,(M)=>G($,"TAG_RESOLVE_FAILED",M));if(J.type==="block-seq"){let{anchor:M,newlineAfterProp:R}=Y,w=M&&$?M.offset>$.offset?M:$:M??$;if(w&&(!R||R.offset<w.offset))G(w,"MISSING_CHAR","Missing newline after block sequence props")}let H=J.type==="block-map"?"map":J.type==="block-seq"?"seq":J.start.source==="{"?"map":"seq";if(!$||!W||W==="!"||W===yN.YAMLMap.tagName&&H==="map"||W===xN.YAMLSeq.tagName&&H==="seq")return oQ(X,Q,J,G,W);let U=Q.schema.tags.find((M)=>M.tag===W&&M.collection===H);if(!U){let M=Q.schema.knownTags[W];if(M?.collection===H)Q.schema.tags.push(Object.assign({},M,{default:!1})),U=M;else{if(M)G($,"BAD_COLLECTION_TYPE",`${M.tag} used for ${H} collection, but expects ${M.collection??"scalar"}`,!0);else G($,"TAG_RESOLVE_FAILED",`Unresolved tag: ${W}`,!0);return oQ(X,Q,J,G,W)}}let z=oQ(X,Q,J,G,W,U),F=U.resolve?.(z,(M)=>G($,"TAG_RESOLVE_FAILED",M),Q.options)??z,K=kN.isNode(F)?F:new vN.Scalar(F);if(K.range=z.range,K.tag=W,U?.format)K.format=U.format;return K}mN.composeCollection=uN});var sQ=p((iN)=>{var aQ=v0();function cN(X,Q,J){let Y=Q.offset,G=pN(Q,X.options.strict,J);if(!G)return{value:"",type:null,comment:"",range:[Y,Y,Y]};let $=G.mode===">"?aQ.Scalar.BLOCK_FOLDED:aQ.Scalar.BLOCK_LITERAL,W=Q.source?dN(Q.source):[],H=W.length;for(let A=W.length-1;A>=0;--A){let Z=W[A][1];if(Z===""||Z==="\r")H=A;else break}if(H===0){let A=G.chomp==="+"&&W.length>0?`
97
- `.repeat(Math.max(1,W.length-1)):"",Z=Y+G.length;if(Q.source)Z+=Q.source.length;return{value:A,type:$,comment:G.comment,range:[Y,Z,Z]}}let U=Q.indent+G.indent,z=Q.offset+G.length,F=0;for(let A=0;A<H;++A){let[Z,B]=W[A];if(B===""||B==="\r"){if(G.indent===0&&Z.length>U)U=Z.length}else{if(Z.length<U)J(z+Z.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(G.indent===0)U=Z.length;if(F=A,U===0&&!X.atRoot)J(z,"BAD_INDENT","Block scalar values in collections must be indented");break}z+=Z.length+B.length+1}for(let A=W.length-1;A>=H;--A)if(W[A][0].length>U)H=A+1;let K="",M="",R=!1;for(let A=0;A<F;++A)K+=W[A][0].slice(U)+`
98
- `;for(let A=F;A<H;++A){let[Z,B]=W[A];z+=Z.length+B.length+1;let V=B[B.length-1]==="\r";if(V)B=B.slice(0,-1);if(B&&Z.length<U){let L=`Block scalar lines must not be less indented than their ${G.indent?"explicit indentation indicator":"first line"}`;J(z-B.length-(V?2:1),"BAD_INDENT",L),Z=""}if($===aQ.Scalar.BLOCK_LITERAL)K+=M+Z.slice(U)+B,M=`
99
- `;else if(Z.length>U||B[0]==="\t"){if(M===" ")M=`
100
- `;else if(!R&&M===`
101
- `)M=`
88
+ ${B}
89
+ `}};iA.YAMLError=o6;iA.YAMLParseError=vY;iA.YAMLWarning=yY;iA.prettifyError=dA});var T8=p((tA)=>{function sA(X,{flow:Q,indicator:J,next:Y,offset:G,onError:$,parentIndent:W,startOnNewline:H}){let U=!1,B=H,q=H,K="",V="",N=!1,w=!1,A=null,Z=null,z=null,M=null,F=null,L=null,O=null;for(let j of X){if(w){if(j.type!=="space"&&j.type!=="newline"&&j.type!=="comma")$(j.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");w=!1}if(A){if(B&&j.type!=="comment"&&j.type!=="newline")$(A,"TAB_AS_INDENT","Tabs are not allowed as indentation");A=null}switch(j.type){case"space":if(!Q&&(J!=="doc-start"||Y?.type!=="flow-collection")&&j.source.includes("\t"))A=j;q=!0;break;case"comment":{if(!q)$(j,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let E=j.source.substring(1)||" ";if(!K)K=E;else K+=V+E;V="",B=!1;break}case"newline":if(B){if(K)K+=j.source;else if(!L||J!=="seq-item-ind")U=!0}else V+=j.source;if(B=!0,N=!0,Z||z)M=j;q=!0;break;case"anchor":if(Z)$(j,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(j.source.endsWith(":"))$(j.offset+j.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);Z=j,O??(O=j.offset),B=!1,q=!1,w=!0;break;case"tag":{if(z)$(j,"MULTIPLE_TAGS","A node can have at most one tag");z=j,O??(O=j.offset),B=!1,q=!1,w=!0;break}case J:if(Z||z)$(j,"BAD_PROP_ORDER",`Anchors and tags must be after the ${j.source} indicator`);if(L)$(j,"UNEXPECTED_TOKEN",`Unexpected ${j.source} in ${Q??"collection"}`);L=j,B=J==="seq-item-ind"||J==="explicit-key-ind",q=!1;break;case"comma":if(Q){if(F)$(j,"UNEXPECTED_TOKEN",`Unexpected , in ${Q}`);F=j,B=!1,q=!1;break}default:$(j,"UNEXPECTED_TOKEN",`Unexpected ${j.type} token`),B=!1,q=!1}}let D=X[X.length-1],I=D?D.offset+D.source.length:G;if(w&&Y&&Y.type!=="space"&&Y.type!=="newline"&&Y.type!=="comma"&&(Y.type!=="scalar"||Y.source!==""))$(Y.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(A&&(B&&A.indent<=W||Y?.type==="block-map"||Y?.type==="block-seq"))$(A,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:F,found:L,spaceBefore:U,comment:K,hasNewline:N,anchor:Z,tag:z,newlineAfterProp:M,end:I,start:O??I}}tA.resolveProps=sA});var a6=p((XN)=>{function dQ(X){if(!X)return null;switch(X.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(X.source.includes(`
90
+ `))return!0;if(X.end){for(let Q of X.end)if(Q.type==="newline")return!0}return!1;case"flow-collection":for(let Q of X.items){for(let J of Q.start)if(J.type==="newline")return!0;if(Q.sep){for(let J of Q.sep)if(J.type==="newline")return!0}if(dQ(Q.key)||dQ(Q.value))return!0}return!1;default:return!0}}XN.containsNewline=dQ});var iQ=p((GN)=>{var JN=a6();function YN(X,Q,J){if(Q?.type==="flow-collection"){let Y=Q.end[0];if(Y.indent===X&&(Y.source==="]"||Y.source==="}")&&JN.containsNewline(Q))J(Y,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}GN.flowIndentCheck=YN});var nQ=p((HN)=>{var xY=K0();function WN(X,Q,J){let{uniqueKeys:Y}=X.options;if(Y===!1)return!1;let G=typeof Y==="function"?Y:($,W)=>$===W||xY.isScalar($)&&xY.isScalar(W)&&$.value===W.value;return Q.some(($)=>G($.key,J))}HN.mapIncludes=WN});var mY=p((FN)=>{var gY=f1(),BN=m1(),hY=T8(),zN=a6(),fY=iQ(),LN=nQ(),uY="All mapping items must start at the same column";function qN({composeNode:X,composeEmptyNode:Q},J,Y,G,$){let H=new($?.nodeClass??BN.YAMLMap)(J.schema);if(J.atRoot)J.atRoot=!1;let U=Y.offset,B=null;for(let q of Y.items){let{start:K,key:V,sep:N,value:w}=q,A=hY.resolveProps(K,{indicator:"explicit-key-ind",next:V??N?.[0],offset:U,onError:G,parentIndent:Y.indent,startOnNewline:!0}),Z=!A.found;if(Z){if(V){if(V.type==="block-seq")G(U,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in V&&V.indent!==Y.indent)G(U,"BAD_INDENT",uY)}if(!A.anchor&&!A.tag&&!N){if(B=A.end,A.comment)if(H.comment)H.comment+=`
91
+ `+A.comment;else H.comment=A.comment;continue}if(A.newlineAfterProp||zN.containsNewline(V))G(V??K[K.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(A.found?.indent!==Y.indent)G(U,"BAD_INDENT",uY);J.atKey=!0;let z=A.end,M=V?X(J,V,A,G):Q(J,z,K,null,A,G);if(J.schema.compat)fY.flowIndentCheck(Y.indent,V,G);if(J.atKey=!1,LN.mapIncludes(J,H.items,M))G(z,"DUPLICATE_KEY","Map keys must be unique");let F=hY.resolveProps(N??[],{indicator:"map-value-ind",next:w,offset:M.range[2],onError:G,parentIndent:Y.indent,startOnNewline:!V||V.type==="block-scalar"});if(U=F.end,F.found){if(Z){if(w?.type==="block-map"&&!F.hasNewline)G(U,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(J.options.strict&&A.start<F.found.offset-1024)G(M.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let L=w?X(J,w,F,G):Q(J,U,N,null,F,G);if(J.schema.compat)fY.flowIndentCheck(Y.indent,w,G);U=L.range[2];let O=new gY.Pair(M,L);if(J.options.keepSourceTokens)O.srcToken=q;H.items.push(O)}else{if(Z)G(M.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(F.comment)if(M.comment)M.comment+=`
92
+ `+F.comment;else M.comment=F.comment;let L=new gY.Pair(M);if(J.options.keepSourceTokens)L.srcToken=q;H.items.push(L)}}if(B&&B<U)G(B,"IMPOSSIBLE","Map comment with trailing content");return H.range=[Y.offset,U,B??U],H}FN.resolveBlockMap=qN});var lY=p((ON)=>{var VN=l1(),MN=T8(),DN=iQ();function ZN({composeNode:X,composeEmptyNode:Q},J,Y,G,$){let H=new($?.nodeClass??VN.YAMLSeq)(J.schema);if(J.atRoot)J.atRoot=!1;if(J.atKey)J.atKey=!1;let U=Y.offset,B=null;for(let{start:q,value:K}of Y.items){let V=MN.resolveProps(q,{indicator:"seq-item-ind",next:K,offset:U,onError:G,parentIndent:Y.indent,startOnNewline:!0});if(!V.found)if(V.anchor||V.tag||K)if(K?.type==="block-seq")G(V.end,"BAD_INDENT","All sequence items must start at the same column");else G(U,"MISSING_CHAR","Sequence item without - indicator");else{if(B=V.end,V.comment)H.comment=V.comment;continue}let N=K?X(J,K,V,G):Q(J,V.end,q,null,V,G);if(J.schema.compat)DN.flowIndentCheck(Y.indent,K,G);U=N.range[2],H.items.push(N)}return H.range=[Y.offset,U,B??U],H}ON.resolveBlockSeq=ZN});var b9=p((RN)=>{function NN(X,Q,J,Y){let G="";if(X){let $=!1,W="";for(let H of X){let{source:U,type:B}=H;switch(B){case"space":$=!0;break;case"comment":{if(J&&!$)Y(H,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let q=U.substring(1)||" ";if(!G)G=q;else G+=W+q;W="";break}case"newline":if(G)W+=U;$=!0;break;default:Y(H,"UNEXPECTED_TOKEN",`Unexpected ${B} at node end`)}Q+=U.length}}return{comment:G,offset:Q}}RN.resolveEnd=NN});var dY=p((CN)=>{var jN=K0(),wN=f1(),cY=m1(),PN=l1(),TN=b9(),pY=T8(),SN=a6(),EN=nQ(),rQ="Block collections are not allowed within flow collections",oQ=(X)=>X&&(X.type==="block-map"||X.type==="block-seq");function bN({composeNode:X,composeEmptyNode:Q},J,Y,G,$){let W=Y.start.source==="{",H=W?"flow map":"flow sequence",B=new($?.nodeClass??(W?cY.YAMLMap:PN.YAMLSeq))(J.schema);B.flow=!0;let q=J.atRoot;if(q)J.atRoot=!1;if(J.atKey)J.atKey=!1;let K=Y.offset+Y.start.source.length;for(let Z=0;Z<Y.items.length;++Z){let z=Y.items[Z],{start:M,key:F,sep:L,value:O}=z,D=pY.resolveProps(M,{flow:H,indicator:"explicit-key-ind",next:F??L?.[0],offset:K,onError:G,parentIndent:Y.indent,startOnNewline:!1});if(!D.found){if(!D.anchor&&!D.tag&&!L&&!O){if(Z===0&&D.comma)G(D.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${H}`);else if(Z<Y.items.length-1)G(D.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${H}`);if(D.comment)if(B.comment)B.comment+=`
93
+ `+D.comment;else B.comment=D.comment;K=D.end;continue}if(!W&&J.options.strict&&SN.containsNewline(F))G(F,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(Z===0){if(D.comma)G(D.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${H}`)}else{if(!D.comma)G(D.start,"MISSING_CHAR",`Missing , between ${H} items`);if(D.comment){let I="";X:for(let j of M)switch(j.type){case"comma":case"space":break;case"comment":I=j.source.substring(1);break X;default:break X}if(I){let j=B.items[B.items.length-1];if(jN.isPair(j))j=j.value??j.key;if(j.comment)j.comment+=`
94
+ `+I;else j.comment=I;D.comment=D.comment.substring(I.length+1)}}}if(!W&&!L&&!D.found){let I=O?X(J,O,D,G):Q(J,D.end,L,null,D,G);if(B.items.push(I),K=I.range[2],oQ(O))G(I.range,"BLOCK_IN_FLOW",rQ)}else{J.atKey=!0;let I=D.end,j=F?X(J,F,D,G):Q(J,I,M,null,D,G);if(oQ(F))G(j.range,"BLOCK_IN_FLOW",rQ);J.atKey=!1;let E=pY.resolveProps(L??[],{flow:H,indicator:"map-value-ind",next:O,offset:j.range[2],onError:G,parentIndent:Y.indent,startOnNewline:!1});if(E.found){if(!W&&!D.found&&J.options.strict){if(L)for(let x of L){if(x===E.found)break;if(x.type==="newline"){G(x,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(D.start<E.found.offset-1024)G(E.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(O)if("source"in O&&O.source?.[0]===":")G(O,"MISSING_CHAR",`Missing space after : in ${H}`);else G(E.start,"MISSING_CHAR",`Missing , or : between ${H} items`);let g=O?X(J,O,E,G):E.found?Q(J,E.end,L,null,E,G):null;if(g){if(oQ(O))G(g.range,"BLOCK_IN_FLOW",rQ)}else if(E.comment)if(j.comment)j.comment+=`
95
+ `+E.comment;else j.comment=E.comment;let k=new wN.Pair(j,g);if(J.options.keepSourceTokens)k.srcToken=z;if(W){let x=B;if(EN.mapIncludes(J,x.items,j))G(I,"DUPLICATE_KEY","Map keys must be unique");x.items.push(k)}else{let x=new cY.YAMLMap(J.schema);x.flow=!0,x.items.push(k);let u=(g??j).range;x.range=[j.range[0],u[1],u[2]],B.items.push(x)}K=g?g.range[2]:E.end}}let V=W?"}":"]",[N,...w]=Y.end,A=K;if(N?.source===V)A=N.offset+N.source.length;else{let Z=H[0].toUpperCase()+H.substring(1),z=q?`${Z} must end with a ${V}`:`${Z} in block collection must be sufficiently indented and end with a ${V}`;if(G(K,q?"MISSING_CHAR":"BAD_INDENT",z),N&&N.source.length!==1)w.unshift(N)}if(w.length>0){let Z=TN.resolveEnd(w,A,J.options.strict,G);if(Z.comment)if(B.comment)B.comment+=`
96
+ `+Z.comment;else B.comment=Z.comment;B.range=[Y.offset,A,Z.offset]}else B.range=[Y.offset,A,A];return B}CN.resolveFlowCollection=bN});var iY=p((mN)=>{var kN=K0(),vN=v0(),yN=m1(),xN=l1(),gN=mY(),hN=lY(),fN=dY();function aQ(X,Q,J,Y,G,$){let W=J.type==="block-map"?gN.resolveBlockMap(X,Q,J,Y,$):J.type==="block-seq"?hN.resolveBlockSeq(X,Q,J,Y,$):fN.resolveFlowCollection(X,Q,J,Y,$),H=W.constructor;if(G==="!"||G===H.tagName)return W.tag=H.tagName,W;if(G)W.tag=G;return W}function uN(X,Q,J,Y,G){let $=Y.tag,W=!$?null:Q.directives.tagName($.source,(V)=>G($,"TAG_RESOLVE_FAILED",V));if(J.type==="block-seq"){let{anchor:V,newlineAfterProp:N}=Y,w=V&&$?V.offset>$.offset?V:$:V??$;if(w&&(!N||N.offset<w.offset))G(w,"MISSING_CHAR","Missing newline after block sequence props")}let H=J.type==="block-map"?"map":J.type==="block-seq"?"seq":J.start.source==="{"?"map":"seq";if(!$||!W||W==="!"||W===yN.YAMLMap.tagName&&H==="map"||W===xN.YAMLSeq.tagName&&H==="seq")return aQ(X,Q,J,G,W);let U=Q.schema.tags.find((V)=>V.tag===W&&V.collection===H);if(!U){let V=Q.schema.knownTags[W];if(V?.collection===H)Q.schema.tags.push(Object.assign({},V,{default:!1})),U=V;else{if(V)G($,"BAD_COLLECTION_TYPE",`${V.tag} used for ${H} collection, but expects ${V.collection??"scalar"}`,!0);else G($,"TAG_RESOLVE_FAILED",`Unresolved tag: ${W}`,!0);return aQ(X,Q,J,G,W)}}let B=aQ(X,Q,J,G,W,U),q=U.resolve?.(B,(V)=>G($,"TAG_RESOLVE_FAILED",V),Q.options)??B,K=kN.isNode(q)?q:new vN.Scalar(q);if(K.range=B.range,K.tag=W,U?.format)K.format=U.format;return K}mN.composeCollection=uN});var tQ=p((iN)=>{var sQ=v0();function cN(X,Q,J){let Y=Q.offset,G=pN(Q,X.options.strict,J);if(!G)return{value:"",type:null,comment:"",range:[Y,Y,Y]};let $=G.mode===">"?sQ.Scalar.BLOCK_FOLDED:sQ.Scalar.BLOCK_LITERAL,W=Q.source?dN(Q.source):[],H=W.length;for(let A=W.length-1;A>=0;--A){let Z=W[A][1];if(Z===""||Z==="\r")H=A;else break}if(H===0){let A=G.chomp==="+"&&W.length>0?`
97
+ `.repeat(Math.max(1,W.length-1)):"",Z=Y+G.length;if(Q.source)Z+=Q.source.length;return{value:A,type:$,comment:G.comment,range:[Y,Z,Z]}}let U=Q.indent+G.indent,B=Q.offset+G.length,q=0;for(let A=0;A<H;++A){let[Z,z]=W[A];if(z===""||z==="\r"){if(G.indent===0&&Z.length>U)U=Z.length}else{if(Z.length<U)J(B+Z.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(G.indent===0)U=Z.length;if(q=A,U===0&&!X.atRoot)J(B,"BAD_INDENT","Block scalar values in collections must be indented");break}B+=Z.length+z.length+1}for(let A=W.length-1;A>=H;--A)if(W[A][0].length>U)H=A+1;let K="",V="",N=!1;for(let A=0;A<q;++A)K+=W[A][0].slice(U)+`
98
+ `;for(let A=q;A<H;++A){let[Z,z]=W[A];B+=Z.length+z.length+1;let M=z[z.length-1]==="\r";if(M)z=z.slice(0,-1);if(z&&Z.length<U){let L=`Block scalar lines must not be less indented than their ${G.indent?"explicit indentation indicator":"first line"}`;J(B-z.length-(M?2:1),"BAD_INDENT",L),Z=""}if($===sQ.Scalar.BLOCK_LITERAL)K+=V+Z.slice(U)+z,V=`
99
+ `;else if(Z.length>U||z[0]==="\t"){if(V===" ")V=`
100
+ `;else if(!N&&V===`
101
+ `)V=`
102
102
 
103
- `;K+=M+Z.slice(U)+B,M=`
104
- `,R=!0}else if(B==="")if(M===`
103
+ `;K+=V+Z.slice(U)+z,V=`
104
+ `,N=!0}else if(z==="")if(V===`
105
105
  `)K+=`
106
- `;else M=`
107
- `;else K+=M+B,M=" ",R=!1}switch(G.chomp){case"-":break;case"+":for(let A=H;A<W.length;++A)K+=`
106
+ `;else V=`
107
+ `;else K+=V+z,V=" ",N=!1}switch(G.chomp){case"-":break;case"+":for(let A=H;A<W.length;++A)K+=`
108
108
  `+W[A][0].slice(U);if(K[K.length-1]!==`
109
109
  `)K+=`
110
110
  `;break;default:K+=`
111
- `}let w=Y+G.length+Q.source.length;return{value:K,type:$,comment:G.comment,range:[Y,w,w]}}function pN({offset:X,props:Q},J,Y){if(Q[0].type!=="block-scalar-header")return Y(Q[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:G}=Q[0],$=G[0],W=0,H="",U=-1;for(let M=1;M<G.length;++M){let R=G[M];if(!H&&(R==="-"||R==="+"))H=R;else{let w=Number(R);if(!W&&w)W=w;else if(U===-1)U=X+M}}if(U!==-1)Y(U,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${G}`);let z=!1,F="",K=G.length;for(let M=1;M<Q.length;++M){let R=Q[M];switch(R.type){case"space":z=!0;case"newline":K+=R.source.length;break;case"comment":if(J&&!z)Y(R,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");K+=R.source.length,F=R.source.substring(1);break;case"error":Y(R,"UNEXPECTED_TOKEN",R.message),K+=R.source.length;break;default:{let w=`Unexpected token in block scalar header: ${R.type}`;Y(R,"UNEXPECTED_TOKEN",w);let A=R.source;if(A&&typeof A==="string")K+=A.length}}}return{mode:$,indent:W,chomp:H,comment:F,length:K}}function dN(X){let Q=X.split(/\n( *)/),J=Q[0],Y=J.match(/^( *)/),$=[Y?.[1]?[Y[1],J.slice(Y[1].length)]:["",J]];for(let W=1;W<Q.length;W+=2)$.push([Q[W],Q[W+1]]);return $}iN.resolveBlockScalar=cN});var eQ=p((JR)=>{var tQ=v0(),rN=C9();function oN(X,Q,J){let{offset:Y,type:G,source:$,end:W}=X,H,U,z=(M,R,w)=>J(Y+M,R,w);switch(G){case"scalar":H=tQ.Scalar.PLAIN,U=aN($,z);break;case"single-quoted-scalar":H=tQ.Scalar.QUOTE_SINGLE,U=sN($,z);break;case"double-quoted-scalar":H=tQ.Scalar.QUOTE_DOUBLE,U=tN($,z);break;default:return J(X,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${G}`),{value:"",type:null,comment:"",range:[Y,Y+$.length,Y+$.length]}}let F=Y+$.length,K=rN.resolveEnd(W,F,Q,J);return{value:U,type:H,comment:K.comment,range:[Y,F,K.offset]}}function aN(X,Q){let J="";switch(X[0]){case"\t":J="a tab character";break;case",":J="flow indicator character ,";break;case"%":J="directive indicator character %";break;case"|":case">":{J=`block scalar indicator ${X[0]}`;break}case"@":case"`":{J=`reserved character ${X[0]}`;break}}if(J)Q(0,"BAD_SCALAR_START",`Plain value cannot start with ${J}`);return aY(X)}function sN(X,Q){if(X[X.length-1]!=="'"||X.length===1)Q(X.length,"MISSING_CHAR","Missing closing 'quote");return aY(X.slice(1,-1)).replace(/''/g,"'")}function aY(X){let Q,J;try{Q=new RegExp(`(.*?)(?<![ ])[ ]*\r?
111
+ `}let w=Y+G.length+Q.source.length;return{value:K,type:$,comment:G.comment,range:[Y,w,w]}}function pN({offset:X,props:Q},J,Y){if(Q[0].type!=="block-scalar-header")return Y(Q[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:G}=Q[0],$=G[0],W=0,H="",U=-1;for(let V=1;V<G.length;++V){let N=G[V];if(!H&&(N==="-"||N==="+"))H=N;else{let w=Number(N);if(!W&&w)W=w;else if(U===-1)U=X+V}}if(U!==-1)Y(U,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${G}`);let B=!1,q="",K=G.length;for(let V=1;V<Q.length;++V){let N=Q[V];switch(N.type){case"space":B=!0;case"newline":K+=N.source.length;break;case"comment":if(J&&!B)Y(N,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");K+=N.source.length,q=N.source.substring(1);break;case"error":Y(N,"UNEXPECTED_TOKEN",N.message),K+=N.source.length;break;default:{let w=`Unexpected token in block scalar header: ${N.type}`;Y(N,"UNEXPECTED_TOKEN",w);let A=N.source;if(A&&typeof A==="string")K+=A.length}}}return{mode:$,indent:W,chomp:H,comment:q,length:K}}function dN(X){let Q=X.split(/\n( *)/),J=Q[0],Y=J.match(/^( *)/),$=[Y?.[1]?[Y[1],J.slice(Y[1].length)]:["",J]];for(let W=1;W<Q.length;W+=2)$.push([Q[W],Q[W+1]]);return $}iN.resolveBlockScalar=cN});var X4=p((JR)=>{var eQ=v0(),rN=b9();function oN(X,Q,J){let{offset:Y,type:G,source:$,end:W}=X,H,U,B=(V,N,w)=>J(Y+V,N,w);switch(G){case"scalar":H=eQ.Scalar.PLAIN,U=aN($,B);break;case"single-quoted-scalar":H=eQ.Scalar.QUOTE_SINGLE,U=sN($,B);break;case"double-quoted-scalar":H=eQ.Scalar.QUOTE_DOUBLE,U=tN($,B);break;default:return J(X,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${G}`),{value:"",type:null,comment:"",range:[Y,Y+$.length,Y+$.length]}}let q=Y+$.length,K=rN.resolveEnd(W,q,Q,J);return{value:U,type:H,comment:K.comment,range:[Y,q,K.offset]}}function aN(X,Q){let J="";switch(X[0]){case"\t":J="a tab character";break;case",":J="flow indicator character ,";break;case"%":J="directive indicator character %";break;case"|":case">":{J=`block scalar indicator ${X[0]}`;break}case"@":case"`":{J=`reserved character ${X[0]}`;break}}if(J)Q(0,"BAD_SCALAR_START",`Plain value cannot start with ${J}`);return nY(X)}function sN(X,Q){if(X[X.length-1]!=="'"||X.length===1)Q(X.length,"MISSING_CHAR","Missing closing 'quote");return nY(X.slice(1,-1)).replace(/''/g,"'")}function nY(X){let Q,J;try{Q=new RegExp(`(.*?)(?<![ ])[ ]*\r?
112
112
  `,"sy"),J=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
113
113
  `,"sy")}catch{Q=/(.*?)[ \t]*\r?\n/sy,J=/[ \t]*(.*?)[ \t]*\r?\n/sy}let Y=Q.exec(X);if(!Y)return X;let G=Y[1],$=" ",W=Q.lastIndex;J.lastIndex=W;while(Y=J.exec(X)){if(Y[1]==="")if($===`
114
114
  `)G+=$;else $=`
@@ -123,112 +123,143 @@ ${z}
123
123
  `)break;if(Y===`
124
124
  `)J+=`
125
125
  `;Q+=1,Y=X[Q+1]}if(!J)J=" ";return{fold:J,offset:Q}}var XR={"0":"\x00",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
126
- `,r:"\r",t:"\t",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function QR(X,Q,J,Y){let G=X.substr(Q,J),W=G.length===J&&/^[0-9a-fA-F]+$/.test(G)?parseInt(G,16):NaN;if(isNaN(W)){let H=X.substr(Q-2,J+2);return Y(Q-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${H}`),H}return String.fromCodePoint(W)}JR.resolveFlowScalar=oN});var tY=p((zR)=>{var Q9=K0(),sY=v0(),GR=sQ(),$R=eQ();function WR(X,Q,J,Y){let{value:G,type:$,comment:W,range:H}=Q.type==="block-scalar"?GR.resolveBlockScalar(X,Q,Y):$R.resolveFlowScalar(Q,X.options.strict,Y),U=J?X.directives.tagName(J.source,(K)=>Y(J,"TAG_RESOLVE_FAILED",K)):null,z;if(X.options.stringKeys&&X.atKey)z=X.schema[Q9.SCALAR];else if(U)z=HR(X.schema,G,U,J,Y);else if(Q.type==="scalar")z=UR(X,G,Q,Y);else z=X.schema[Q9.SCALAR];let F;try{let K=z.resolve(G,(M)=>Y(J??Q,"TAG_RESOLVE_FAILED",M),X.options);F=Q9.isScalar(K)?K:new sY.Scalar(K)}catch(K){let M=K instanceof Error?K.message:String(K);Y(J??Q,"TAG_RESOLVE_FAILED",M),F=new sY.Scalar(G)}if(F.range=H,F.source=G,$)F.type=$;if(U)F.tag=U;if(z.format)F.format=z.format;if(W)F.comment=W;return F}function HR(X,Q,J,Y,G){if(J==="!")return X[Q9.SCALAR];let $=[];for(let H of X.tags)if(!H.collection&&H.tag===J)if(H.default&&H.test)$.push(H);else return H;for(let H of $)if(H.test?.test(Q))return H;let W=X.knownTags[J];if(W&&!W.collection)return X.tags.push(Object.assign({},W,{default:!1,test:void 0})),W;return G(Y,"TAG_RESOLVE_FAILED",`Unresolved tag: ${J}`,J!=="tag:yaml.org,2002:str"),X[Q9.SCALAR]}function UR({atKey:X,directives:Q,schema:J},Y,G,$){let W=J.tags.find((H)=>(H.default===!0||X&&H.default==="key")&&H.test?.test(Y))||J[Q9.SCALAR];if(J.compat){let H=J.compat.find((U)=>U.default&&U.test?.test(Y))??J[Q9.SCALAR];if(W.tag!==H.tag){let U=Q.tagString(W.tag),z=Q.tagString(H.tag),F=`Value may be parsed as either ${U} or ${z}`;$(G,"TAG_RESOLVE_FAILED",F,!0)}}return W}zR.composeScalar=WR});var eY=p((qR)=>{function LR(X,Q,J){if(Q){J??(J=Q.length);for(let Y=J-1;Y>=0;--Y){let G=Q[Y];switch(G.type){case"space":case"comment":case"newline":X-=G.source.length;continue}G=Q[++Y];while(G?.type==="space")X+=G.source.length,G=Q[++Y];break}}return X}qR.emptyScalarPosition=LR});var JG=p((NR)=>{var KR=L8(),VR=K0(),MR=oY(),XG=tY(),DR=C9(),ZR=eY(),OR={composeNode:QG,composeEmptyNode:X5};function QG(X,Q,J,Y){let G=X.atKey,{spaceBefore:$,comment:W,anchor:H,tag:U}=J,z,F=!0;switch(Q.type){case"alias":if(z=AR(X,Q,Y),H||U)Y(Q,"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(z=XG.composeScalar(X,Q,U,Y),H)z.anchor=H.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":if(z=MR.composeCollection(OR,X,Q,J,Y),H)z.anchor=H.source.substring(1);break;default:{let K=Q.type==="error"?Q.message:`Unsupported token (type: ${Q.type})`;Y(Q,"UNEXPECTED_TOKEN",K),z=X5(X,Q.offset,void 0,null,J,Y),F=!1}}if(H&&z.anchor==="")Y(H,"BAD_ALIAS","Anchor cannot be an empty string");if(G&&X.options.stringKeys&&(!VR.isScalar(z)||typeof z.value!=="string"||z.tag&&z.tag!=="tag:yaml.org,2002:str"))Y(U??Q,"NON_STRING_KEY","With stringKeys, all keys must be strings");if($)z.spaceBefore=!0;if(W)if(Q.type==="scalar"&&Q.source==="")z.comment=W;else z.commentBefore=W;if(X.options.keepSourceTokens&&F)z.srcToken=Q;return z}function X5(X,Q,J,Y,{spaceBefore:G,comment:$,anchor:W,tag:H,end:U},z){let F={type:"scalar",offset:ZR.emptyScalarPosition(Q,J,Y),indent:-1,source:""},K=XG.composeScalar(X,F,H,z);if(W){if(K.anchor=W.source.substring(1),K.anchor==="")z(W,"BAD_ALIAS","Anchor cannot be an empty string")}if(G)K.spaceBefore=!0;if($)K.comment=$,K.range[2]=U;return K}function AR({options:X},{offset:Q,source:J,end:Y},G){let $=new KR.Alias(J.substring(1));if($.source==="")G(Q,"BAD_ALIAS","Alias cannot be an empty string");if($.source.endsWith(":"))G(Q+J.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let W=Q+J.length,H=DR.resolveEnd(Y,W,X.strict,G);if($.range=[Q,W,H.offset],H.comment)$.comment=H.comment;return $}NR.composeEmptyNode=X5;NR.composeNode=QG});var GG=p((SR)=>{var jR=P8(),YG=JG(),wR=C9(),PR=S8();function TR(X,Q,{offset:J,start:Y,value:G,end:$},W){let H=Object.assign({_directives:Q},X),U=new jR.Document(void 0,H),z={atKey:!1,atRoot:!0,directives:U.directives,options:U.options,schema:U.schema},F=PR.resolveProps(Y,{indicator:"doc-start",next:G??$?.[0],offset:J,onError:W,parentIndent:0,startOnNewline:!0});if(F.found){if(U.directives.docStart=!0,G&&(G.type==="block-map"||G.type==="block-seq")&&!F.hasNewline)W(F.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}U.contents=G?YG.composeNode(z,G,F,W):YG.composeEmptyNode(z,F.end,Y,null,F,W);let K=U.contents.range[2],M=wR.resolveEnd($,K,!1,W);if(M.comment)U.comment=M.comment;return U.range=[J,K,M.offset],U}SR.composeDoc=TR});var Q5=p((yR)=>{var bR=O1("process"),CR=$Q(),_R=P8(),E8=T8(),$G=K0(),kR=GG(),vR=C9();function b8(X){if(typeof X==="number")return[X,X+1];if(Array.isArray(X))return X.length===2?X:[X[0],X[1]];let{offset:Q,source:J}=X;return[Q,Q+(typeof J==="string"?J.length:1)]}function WG(X){let Q="",J=!1,Y=!1;for(let G=0;G<X.length;++G){let $=X[G];switch($[0]){case"#":Q+=(Q===""?"":Y?`
126
+ `,r:"\r",t:"\t",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function QR(X,Q,J,Y){let G=X.substr(Q,J),W=G.length===J&&/^[0-9a-fA-F]+$/.test(G)?parseInt(G,16):NaN;if(isNaN(W)){let H=X.substr(Q-2,J+2);return Y(Q-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${H}`),H}return String.fromCodePoint(W)}JR.resolveFlowScalar=oN});var oY=p((BR)=>{var Q9=K0(),rY=v0(),GR=tQ(),$R=X4();function WR(X,Q,J,Y){let{value:G,type:$,comment:W,range:H}=Q.type==="block-scalar"?GR.resolveBlockScalar(X,Q,Y):$R.resolveFlowScalar(Q,X.options.strict,Y),U=J?X.directives.tagName(J.source,(K)=>Y(J,"TAG_RESOLVE_FAILED",K)):null,B;if(X.options.stringKeys&&X.atKey)B=X.schema[Q9.SCALAR];else if(U)B=HR(X.schema,G,U,J,Y);else if(Q.type==="scalar")B=UR(X,G,Q,Y);else B=X.schema[Q9.SCALAR];let q;try{let K=B.resolve(G,(V)=>Y(J??Q,"TAG_RESOLVE_FAILED",V),X.options);q=Q9.isScalar(K)?K:new rY.Scalar(K)}catch(K){let V=K instanceof Error?K.message:String(K);Y(J??Q,"TAG_RESOLVE_FAILED",V),q=new rY.Scalar(G)}if(q.range=H,q.source=G,$)q.type=$;if(U)q.tag=U;if(B.format)q.format=B.format;if(W)q.comment=W;return q}function HR(X,Q,J,Y,G){if(J==="!")return X[Q9.SCALAR];let $=[];for(let H of X.tags)if(!H.collection&&H.tag===J)if(H.default&&H.test)$.push(H);else return H;for(let H of $)if(H.test?.test(Q))return H;let W=X.knownTags[J];if(W&&!W.collection)return X.tags.push(Object.assign({},W,{default:!1,test:void 0})),W;return G(Y,"TAG_RESOLVE_FAILED",`Unresolved tag: ${J}`,J!=="tag:yaml.org,2002:str"),X[Q9.SCALAR]}function UR({atKey:X,directives:Q,schema:J},Y,G,$){let W=J.tags.find((H)=>(H.default===!0||X&&H.default==="key")&&H.test?.test(Y))||J[Q9.SCALAR];if(J.compat){let H=J.compat.find((U)=>U.default&&U.test?.test(Y))??J[Q9.SCALAR];if(W.tag!==H.tag){let U=Q.tagString(W.tag),B=Q.tagString(H.tag),q=`Value may be parsed as either ${U} or ${B}`;$(G,"TAG_RESOLVE_FAILED",q,!0)}}return W}BR.composeScalar=WR});var aY=p((qR)=>{function LR(X,Q,J){if(Q){J??(J=Q.length);for(let Y=J-1;Y>=0;--Y){let G=Q[Y];switch(G.type){case"space":case"comment":case"newline":X-=G.source.length;continue}G=Q[++Y];while(G?.type==="space")X+=G.source.length,G=Q[++Y];break}}return X}qR.emptyScalarPosition=LR});var eY=p((NR)=>{var KR=z8(),VR=K0(),MR=iY(),sY=oY(),DR=b9(),ZR=aY(),OR={composeNode:tY,composeEmptyNode:Q4};function tY(X,Q,J,Y){let G=X.atKey,{spaceBefore:$,comment:W,anchor:H,tag:U}=J,B,q=!0;switch(Q.type){case"alias":if(B=AR(X,Q,Y),H||U)Y(Q,"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(B=sY.composeScalar(X,Q,U,Y),H)B.anchor=H.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":if(B=MR.composeCollection(OR,X,Q,J,Y),H)B.anchor=H.source.substring(1);break;default:{let K=Q.type==="error"?Q.message:`Unsupported token (type: ${Q.type})`;Y(Q,"UNEXPECTED_TOKEN",K),B=Q4(X,Q.offset,void 0,null,J,Y),q=!1}}if(H&&B.anchor==="")Y(H,"BAD_ALIAS","Anchor cannot be an empty string");if(G&&X.options.stringKeys&&(!VR.isScalar(B)||typeof B.value!=="string"||B.tag&&B.tag!=="tag:yaml.org,2002:str"))Y(U??Q,"NON_STRING_KEY","With stringKeys, all keys must be strings");if($)B.spaceBefore=!0;if(W)if(Q.type==="scalar"&&Q.source==="")B.comment=W;else B.commentBefore=W;if(X.options.keepSourceTokens&&q)B.srcToken=Q;return B}function Q4(X,Q,J,Y,{spaceBefore:G,comment:$,anchor:W,tag:H,end:U},B){let q={type:"scalar",offset:ZR.emptyScalarPosition(Q,J,Y),indent:-1,source:""},K=sY.composeScalar(X,q,H,B);if(W){if(K.anchor=W.source.substring(1),K.anchor==="")B(W,"BAD_ALIAS","Anchor cannot be an empty string")}if(G)K.spaceBefore=!0;if($)K.comment=$,K.range[2]=U;return K}function AR({options:X},{offset:Q,source:J,end:Y},G){let $=new KR.Alias(J.substring(1));if($.source==="")G(Q,"BAD_ALIAS","Alias cannot be an empty string");if($.source.endsWith(":"))G(Q+J.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let W=Q+J.length,H=DR.resolveEnd(Y,W,X.strict,G);if($.range=[Q,W,H.offset],H.comment)$.comment=H.comment;return $}NR.composeEmptyNode=Q4;NR.composeNode=tY});var QG=p((SR)=>{var jR=w8(),XG=eY(),wR=b9(),PR=T8();function TR(X,Q,{offset:J,start:Y,value:G,end:$},W){let H=Object.assign({_directives:Q},X),U=new jR.Document(void 0,H),B={atKey:!1,atRoot:!0,directives:U.directives,options:U.options,schema:U.schema},q=PR.resolveProps(Y,{indicator:"doc-start",next:G??$?.[0],offset:J,onError:W,parentIndent:0,startOnNewline:!0});if(q.found){if(U.directives.docStart=!0,G&&(G.type==="block-map"||G.type==="block-seq")&&!q.hasNewline)W(q.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}U.contents=G?XG.composeNode(B,G,q,W):XG.composeEmptyNode(B,q.end,Y,null,q,W);let K=U.contents.range[2],V=wR.resolveEnd($,K,!1,W);if(V.comment)U.comment=V.comment;return U.range=[J,K,V.offset],U}SR.composeDoc=TR});var J4=p((yR)=>{var bR=O1("process"),CR=WQ(),_R=w8(),S8=P8(),JG=K0(),kR=QG(),vR=b9();function E8(X){if(typeof X==="number")return[X,X+1];if(Array.isArray(X))return X.length===2?X:[X[0],X[1]];let{offset:Q,source:J}=X;return[Q,Q+(typeof J==="string"?J.length:1)]}function YG(X){let Q="",J=!1,Y=!1;for(let G=0;G<X.length;++G){let $=X[G];switch($[0]){case"#":Q+=(Q===""?"":Y?`
127
127
 
128
128
  `:`
129
- `)+($.substring(1)||" "),J=!0,Y=!1;break;case"%":if(X[G+1]?.[0]!=="#")G+=1;J=!1;break;default:if(!J)Y=!0;J=!1}}return{comment:Q,afterEmptyLine:Y}}class HG{constructor(X={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(Q,J,Y,G)=>{let $=b8(Q);if(G)this.warnings.push(new E8.YAMLWarning($,J,Y));else this.errors.push(new E8.YAMLParseError($,J,Y))},this.directives=new CR.Directives({version:X.version||"1.2"}),this.options=X}decorate(X,Q){let{comment:J,afterEmptyLine:Y}=WG(this.prelude);if(J){let G=X.contents;if(Q)X.comment=X.comment?`${X.comment}
130
- ${J}`:J;else if(Y||X.directives.docStart||!G)X.commentBefore=J;else if($G.isCollection(G)&&!G.flow&&G.items.length>0){let $=G.items[0];if($G.isPair($))$=$.key;let W=$.commentBefore;$.commentBefore=W?`${J}
129
+ `)+($.substring(1)||" "),J=!0,Y=!1;break;case"%":if(X[G+1]?.[0]!=="#")G+=1;J=!1;break;default:if(!J)Y=!0;J=!1}}return{comment:Q,afterEmptyLine:Y}}class GG{constructor(X={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(Q,J,Y,G)=>{let $=E8(Q);if(G)this.warnings.push(new S8.YAMLWarning($,J,Y));else this.errors.push(new S8.YAMLParseError($,J,Y))},this.directives=new CR.Directives({version:X.version||"1.2"}),this.options=X}decorate(X,Q){let{comment:J,afterEmptyLine:Y}=YG(this.prelude);if(J){let G=X.contents;if(Q)X.comment=X.comment?`${X.comment}
130
+ ${J}`:J;else if(Y||X.directives.docStart||!G)X.commentBefore=J;else if(JG.isCollection(G)&&!G.flow&&G.items.length>0){let $=G.items[0];if(JG.isPair($))$=$.key;let W=$.commentBefore;$.commentBefore=W?`${J}
131
131
  ${W}`:J}else{let $=G.commentBefore;G.commentBefore=$?`${J}
132
- ${$}`:J}}if(Q)Array.prototype.push.apply(X.errors,this.errors),Array.prototype.push.apply(X.warnings,this.warnings);else X.errors=this.errors,X.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:WG(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(X,Q=!1,J=-1){for(let Y of X)yield*this.next(Y);yield*this.end(Q,J)}*next(X){if(bR.env.LOG_STREAM)console.dir(X,{depth:null});switch(X.type){case"directive":this.directives.add(X.source,(Q,J,Y)=>{let G=b8(X);G[0]+=Q,this.onError(G,"BAD_DIRECTIVE",J,Y)}),this.prelude.push(X.source),this.atDirectives=!0;break;case"document":{let Q=kR.composeDoc(this.options,this.directives,X,this.onError);if(this.atDirectives&&!Q.directives.docStart)this.onError(X,"MISSING_CHAR","Missing directives-end/doc-start indicator line");if(this.decorate(Q,!1),this.doc)yield this.doc;this.doc=Q,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(X.source);break;case"error":{let Q=X.source?`${X.message}: ${JSON.stringify(X.source)}`:X.message,J=new E8.YAMLParseError(b8(X),"UNEXPECTED_TOKEN",Q);if(this.atDirectives||!this.doc)this.errors.push(J);else this.doc.errors.push(J);break}case"doc-end":{if(!this.doc){this.errors.push(new E8.YAMLParseError(b8(X),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let Q=vR.resolveEnd(X.end,X.offset+X.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),Q.comment){let J=this.doc.comment;this.doc.comment=J?`${J}
133
- ${Q.comment}`:Q.comment}this.doc.range[2]=Q.offset;break}default:this.errors.push(new E8.YAMLParseError(b8(X),"UNEXPECTED_TOKEN",`Unsupported token ${X.type}`))}}*end(X=!1,Q=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(X){let J=Object.assign({_directives:this.directives},this.options),Y=new _R.Document(void 0,J);if(this.atDirectives)this.onError(Q,"MISSING_CHAR","Missing directives-end indicator line");Y.range=[0,Q,Q],this.decorate(Y,!1),yield Y}}}yR.Composer=HG});var BG=p((pR)=>{var gR=sQ(),hR=eQ(),fR=T8(),UG=V8();function uR(X,Q=!0,J){if(X){let Y=(G,$,W)=>{let H=typeof G==="number"?G:Array.isArray(G)?G[0]:G.offset;if(J)J(H,$,W);else throw new fR.YAMLParseError([H,H+1],$,W)};switch(X.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return hR.resolveFlowScalar(X,Q,Y);case"block-scalar":return gR.resolveBlockScalar({options:{strict:Q}},X,Y)}}return null}function mR(X,Q){let{implicitKey:J=!1,indent:Y,inFlow:G=!1,offset:$=-1,type:W="PLAIN"}=Q,H=UG.stringifyString({type:W,value:X},{implicitKey:J,indent:Y>0?" ".repeat(Y):"",inFlow:G,options:{blockQuote:!0,lineWidth:-1}}),U=Q.end??[{type:"newline",offset:-1,indent:Y,source:`
134
- `}];switch(H[0]){case"|":case">":{let z=H.indexOf(`
135
- `),F=H.substring(0,z),K=H.substring(z+1)+`
136
- `,M=[{type:"block-scalar-header",offset:$,indent:Y,source:F}];if(!zG(M,U))M.push({type:"newline",offset:-1,indent:Y,source:`
137
- `});return{type:"block-scalar",offset:$,indent:Y,props:M,source:K}}case'"':return{type:"double-quoted-scalar",offset:$,indent:Y,source:H,end:U};case"'":return{type:"single-quoted-scalar",offset:$,indent:Y,source:H,end:U};default:return{type:"scalar",offset:$,indent:Y,source:H,end:U}}}function lR(X,Q,J={}){let{afterKey:Y=!1,implicitKey:G=!1,inFlow:$=!1,type:W}=J,H="indent"in X?X.indent:null;if(Y&&typeof H==="number")H+=2;if(!W)switch(X.type){case"single-quoted-scalar":W="QUOTE_SINGLE";break;case"double-quoted-scalar":W="QUOTE_DOUBLE";break;case"block-scalar":{let z=X.props[0];if(z.type!=="block-scalar-header")throw Error("Invalid block scalar header");W=z.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:W="PLAIN"}let U=UG.stringifyString({type:W,value:Q},{implicitKey:G||H===null,indent:H!==null&&H>0?" ".repeat(H):"",inFlow:$,options:{blockQuote:!0,lineWidth:-1}});switch(U[0]){case"|":case">":cR(X,U);break;case'"':J5(X,U,"double-quoted-scalar");break;case"'":J5(X,U,"single-quoted-scalar");break;default:J5(X,U,"scalar")}}function cR(X,Q){let J=Q.indexOf(`
132
+ ${$}`:J}}if(Q)Array.prototype.push.apply(X.errors,this.errors),Array.prototype.push.apply(X.warnings,this.warnings);else X.errors=this.errors,X.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:YG(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(X,Q=!1,J=-1){for(let Y of X)yield*this.next(Y);yield*this.end(Q,J)}*next(X){if(bR.env.LOG_STREAM)console.dir(X,{depth:null});switch(X.type){case"directive":this.directives.add(X.source,(Q,J,Y)=>{let G=E8(X);G[0]+=Q,this.onError(G,"BAD_DIRECTIVE",J,Y)}),this.prelude.push(X.source),this.atDirectives=!0;break;case"document":{let Q=kR.composeDoc(this.options,this.directives,X,this.onError);if(this.atDirectives&&!Q.directives.docStart)this.onError(X,"MISSING_CHAR","Missing directives-end/doc-start indicator line");if(this.decorate(Q,!1),this.doc)yield this.doc;this.doc=Q,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(X.source);break;case"error":{let Q=X.source?`${X.message}: ${JSON.stringify(X.source)}`:X.message,J=new S8.YAMLParseError(E8(X),"UNEXPECTED_TOKEN",Q);if(this.atDirectives||!this.doc)this.errors.push(J);else this.doc.errors.push(J);break}case"doc-end":{if(!this.doc){this.errors.push(new S8.YAMLParseError(E8(X),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let Q=vR.resolveEnd(X.end,X.offset+X.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),Q.comment){let J=this.doc.comment;this.doc.comment=J?`${J}
133
+ ${Q.comment}`:Q.comment}this.doc.range[2]=Q.offset;break}default:this.errors.push(new S8.YAMLParseError(E8(X),"UNEXPECTED_TOKEN",`Unsupported token ${X.type}`))}}*end(X=!1,Q=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(X){let J=Object.assign({_directives:this.directives},this.options),Y=new _R.Document(void 0,J);if(this.atDirectives)this.onError(Q,"MISSING_CHAR","Missing directives-end indicator line");Y.range=[0,Q,Q],this.decorate(Y,!1),yield Y}}}yR.Composer=GG});var HG=p((pR)=>{var gR=tQ(),hR=X4(),fR=P8(),$G=K8();function uR(X,Q=!0,J){if(X){let Y=(G,$,W)=>{let H=typeof G==="number"?G:Array.isArray(G)?G[0]:G.offset;if(J)J(H,$,W);else throw new fR.YAMLParseError([H,H+1],$,W)};switch(X.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return hR.resolveFlowScalar(X,Q,Y);case"block-scalar":return gR.resolveBlockScalar({options:{strict:Q}},X,Y)}}return null}function mR(X,Q){let{implicitKey:J=!1,indent:Y,inFlow:G=!1,offset:$=-1,type:W="PLAIN"}=Q,H=$G.stringifyString({type:W,value:X},{implicitKey:J,indent:Y>0?" ".repeat(Y):"",inFlow:G,options:{blockQuote:!0,lineWidth:-1}}),U=Q.end??[{type:"newline",offset:-1,indent:Y,source:`
134
+ `}];switch(H[0]){case"|":case">":{let B=H.indexOf(`
135
+ `),q=H.substring(0,B),K=H.substring(B+1)+`
136
+ `,V=[{type:"block-scalar-header",offset:$,indent:Y,source:q}];if(!WG(V,U))V.push({type:"newline",offset:-1,indent:Y,source:`
137
+ `});return{type:"block-scalar",offset:$,indent:Y,props:V,source:K}}case'"':return{type:"double-quoted-scalar",offset:$,indent:Y,source:H,end:U};case"'":return{type:"single-quoted-scalar",offset:$,indent:Y,source:H,end:U};default:return{type:"scalar",offset:$,indent:Y,source:H,end:U}}}function lR(X,Q,J={}){let{afterKey:Y=!1,implicitKey:G=!1,inFlow:$=!1,type:W}=J,H="indent"in X?X.indent:null;if(Y&&typeof H==="number")H+=2;if(!W)switch(X.type){case"single-quoted-scalar":W="QUOTE_SINGLE";break;case"double-quoted-scalar":W="QUOTE_DOUBLE";break;case"block-scalar":{let B=X.props[0];if(B.type!=="block-scalar-header")throw Error("Invalid block scalar header");W=B.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:W="PLAIN"}let U=$G.stringifyString({type:W,value:Q},{implicitKey:G||H===null,indent:H!==null&&H>0?" ".repeat(H):"",inFlow:$,options:{blockQuote:!0,lineWidth:-1}});switch(U[0]){case"|":case">":cR(X,U);break;case'"':Y4(X,U,"double-quoted-scalar");break;case"'":Y4(X,U,"single-quoted-scalar");break;default:Y4(X,U,"scalar")}}function cR(X,Q){let J=Q.indexOf(`
138
138
  `),Y=Q.substring(0,J),G=Q.substring(J+1)+`
139
- `;if(X.type==="block-scalar"){let $=X.props[0];if($.type!=="block-scalar-header")throw Error("Invalid block scalar header");$.source=Y,X.source=G}else{let{offset:$}=X,W="indent"in X?X.indent:-1,H=[{type:"block-scalar-header",offset:$,indent:W,source:Y}];if(!zG(H,"end"in X?X.end:void 0))H.push({type:"newline",offset:-1,indent:W,source:`
140
- `});for(let U of Object.keys(X))if(U!=="type"&&U!=="offset")delete X[U];Object.assign(X,{type:"block-scalar",indent:W,props:H,source:G})}}function zG(X,Q){if(Q)for(let J of Q)switch(J.type){case"space":case"comment":X.push(J);break;case"newline":return X.push(J),!0}return!1}function J5(X,Q,J){switch(X.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":X.type=J,X.source=Q;break;case"block-scalar":{let Y=X.props.slice(1),G=Q.length;if(X.props[0].type==="block-scalar-header")G-=X.props[0].source.length;for(let $ of Y)$.offset+=G;delete X.props,Object.assign(X,{type:J,source:Q,end:Y});break}case"block-map":case"block-seq":{let G={type:"newline",offset:X.offset+Q.length,indent:X.indent,source:`
141
- `};delete X.items,Object.assign(X,{type:J,source:Q,end:[G]});break}default:{let Y="indent"in X?X.indent:-1,G="end"in X&&Array.isArray(X.end)?X.end.filter(($)=>$.type==="space"||$.type==="comment"||$.type==="newline"):[];for(let $ of Object.keys(X))if($!=="type"&&$!=="offset")delete X[$];Object.assign(X,{type:J,indent:Y,source:Q,end:G})}}}pR.createScalarToken=mR;pR.resolveAsScalar=uR;pR.setScalarValue=lR});var LG=p((oR)=>{var rR=(X)=>("type"in X)?XX(X):e6(X);function XX(X){switch(X.type){case"block-scalar":{let Q="";for(let J of X.props)Q+=XX(J);return Q+X.source}case"block-map":case"block-seq":{let Q="";for(let J of X.items)Q+=e6(J);return Q}case"flow-collection":{let Q=X.start.source;for(let J of X.items)Q+=e6(J);for(let J of X.end)Q+=J.source;return Q}case"document":{let Q=e6(X);if(X.end)for(let J of X.end)Q+=J.source;return Q}default:{let Q=X.source;if("end"in X&&X.end)for(let J of X.end)Q+=J.source;return Q}}}function e6({start:X,key:Q,sep:J,value:Y}){let G="";for(let $ of X)G+=$.source;if(Q)G+=XX(Q);if(J)for(let $ of J)G+=$.source;if(Y)G+=XX(Y);return G}oR.stringify=rR});var KG=p((tR)=>{var Y5=Symbol("break visit"),sR=Symbol("skip children"),qG=Symbol("remove item");function J9(X,Q){if("type"in X&&X.type==="document")X={start:X.start,value:X.value};FG(Object.freeze([]),X,Q)}J9.BREAK=Y5;J9.SKIP=sR;J9.REMOVE=qG;J9.itemAtPath=(X,Q)=>{let J=X;for(let[Y,G]of Q){let $=J?.[Y];if($&&"items"in $)J=$.items[G];else return}return J};J9.parentCollection=(X,Q)=>{let J=J9.itemAtPath(X,Q.slice(0,-1)),Y=Q[Q.length-1][0],G=J?.[Y];if(G&&"items"in G)return G;throw Error("Parent collection not found")};function FG(X,Q,J){let Y=J(Q,X);if(typeof Y==="symbol")return Y;for(let G of["key","value"]){let $=Q[G];if($&&"items"in $){for(let W=0;W<$.items.length;++W){let H=FG(Object.freeze(X.concat([[G,W]])),$.items[W],J);if(typeof H==="number")W=H-1;else if(H===Y5)return Y5;else if(H===qG)$.items.splice(W,1),W-=1}if(typeof Y==="function"&&G==="key")Y=Y(Q,X)}}return typeof Y==="function"?Y(Q,X):Y}tR.visit=J9});var QX=p((WI)=>{var G5=BG(),XI=LG(),QI=KG(),$5="\uFEFF",W5="\x02",H5="\x18",U5="\x1F",JI=(X)=>!!X&&("items"in X),YI=(X)=>!!X&&(X.type==="scalar"||X.type==="single-quoted-scalar"||X.type==="double-quoted-scalar"||X.type==="block-scalar");function GI(X){switch(X){case $5:return"<BOM>";case W5:return"<DOC>";case H5:return"<FLOW_END>";case U5:return"<SCALAR>";default:return JSON.stringify(X)}}function $I(X){switch(X){case $5:return"byte-order-mark";case W5:return"doc-mode";case H5:return"flow-error-end";case U5:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
139
+ `;if(X.type==="block-scalar"){let $=X.props[0];if($.type!=="block-scalar-header")throw Error("Invalid block scalar header");$.source=Y,X.source=G}else{let{offset:$}=X,W="indent"in X?X.indent:-1,H=[{type:"block-scalar-header",offset:$,indent:W,source:Y}];if(!WG(H,"end"in X?X.end:void 0))H.push({type:"newline",offset:-1,indent:W,source:`
140
+ `});for(let U of Object.keys(X))if(U!=="type"&&U!=="offset")delete X[U];Object.assign(X,{type:"block-scalar",indent:W,props:H,source:G})}}function WG(X,Q){if(Q)for(let J of Q)switch(J.type){case"space":case"comment":X.push(J);break;case"newline":return X.push(J),!0}return!1}function Y4(X,Q,J){switch(X.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":X.type=J,X.source=Q;break;case"block-scalar":{let Y=X.props.slice(1),G=Q.length;if(X.props[0].type==="block-scalar-header")G-=X.props[0].source.length;for(let $ of Y)$.offset+=G;delete X.props,Object.assign(X,{type:J,source:Q,end:Y});break}case"block-map":case"block-seq":{let G={type:"newline",offset:X.offset+Q.length,indent:X.indent,source:`
141
+ `};delete X.items,Object.assign(X,{type:J,source:Q,end:[G]});break}default:{let Y="indent"in X?X.indent:-1,G="end"in X&&Array.isArray(X.end)?X.end.filter(($)=>$.type==="space"||$.type==="comment"||$.type==="newline"):[];for(let $ of Object.keys(X))if($!=="type"&&$!=="offset")delete X[$];Object.assign(X,{type:J,indent:Y,source:Q,end:G})}}}pR.createScalarToken=mR;pR.resolveAsScalar=uR;pR.setScalarValue=lR});var UG=p((oR)=>{var rR=(X)=>("type"in X)?t6(X):s6(X);function t6(X){switch(X.type){case"block-scalar":{let Q="";for(let J of X.props)Q+=t6(J);return Q+X.source}case"block-map":case"block-seq":{let Q="";for(let J of X.items)Q+=s6(J);return Q}case"flow-collection":{let Q=X.start.source;for(let J of X.items)Q+=s6(J);for(let J of X.end)Q+=J.source;return Q}case"document":{let Q=s6(X);if(X.end)for(let J of X.end)Q+=J.source;return Q}default:{let Q=X.source;if("end"in X&&X.end)for(let J of X.end)Q+=J.source;return Q}}}function s6({start:X,key:Q,sep:J,value:Y}){let G="";for(let $ of X)G+=$.source;if(Q)G+=t6(Q);if(J)for(let $ of J)G+=$.source;if(Y)G+=t6(Y);return G}oR.stringify=rR});var LG=p((tR)=>{var G4=Symbol("break visit"),sR=Symbol("skip children"),BG=Symbol("remove item");function J9(X,Q){if("type"in X&&X.type==="document")X={start:X.start,value:X.value};zG(Object.freeze([]),X,Q)}J9.BREAK=G4;J9.SKIP=sR;J9.REMOVE=BG;J9.itemAtPath=(X,Q)=>{let J=X;for(let[Y,G]of Q){let $=J?.[Y];if($&&"items"in $)J=$.items[G];else return}return J};J9.parentCollection=(X,Q)=>{let J=J9.itemAtPath(X,Q.slice(0,-1)),Y=Q[Q.length-1][0],G=J?.[Y];if(G&&"items"in G)return G;throw Error("Parent collection not found")};function zG(X,Q,J){let Y=J(Q,X);if(typeof Y==="symbol")return Y;for(let G of["key","value"]){let $=Q[G];if($&&"items"in $){for(let W=0;W<$.items.length;++W){let H=zG(Object.freeze(X.concat([[G,W]])),$.items[W],J);if(typeof H==="number")W=H-1;else if(H===G4)return G4;else if(H===BG)$.items.splice(W,1),W-=1}if(typeof Y==="function"&&G==="key")Y=Y(Q,X)}}return typeof Y==="function"?Y(Q,X):Y}tR.visit=J9});var e6=p((WI)=>{var $4=HG(),XI=UG(),QI=LG(),W4="\uFEFF",H4="\x02",U4="\x18",B4="\x1F",JI=(X)=>!!X&&("items"in X),YI=(X)=>!!X&&(X.type==="scalar"||X.type==="single-quoted-scalar"||X.type==="double-quoted-scalar"||X.type==="block-scalar");function GI(X){switch(X){case W4:return"<BOM>";case H4:return"<DOC>";case U4:return"<FLOW_END>";case B4:return"<SCALAR>";default:return JSON.stringify(X)}}function $I(X){switch(X){case W4:return"byte-order-mark";case H4:return"doc-mode";case U4:return"flow-error-end";case B4:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
142
142
  `:case`\r
143
- `: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(X[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}WI.createScalarToken=G5.createScalarToken;WI.resolveAsScalar=G5.resolveAsScalar;WI.setScalarValue=G5.setScalarValue;WI.stringify=XI.stringify;WI.visit=QI.visit;WI.BOM=$5;WI.DOCUMENT=W5;WI.FLOW_END=H5;WI.SCALAR=U5;WI.isCollection=JI;WI.isScalar=YI;WI.prettyToken=GI;WI.tokenType=$I});var B5=p((RI)=>{var C8=QX();function B1(X){switch(X){case void 0:case" ":case`
144
- `:case"\r":case"\t":return!0;default:return!1}}var VG=new Set("0123456789ABCDEFabcdef"),AI=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),JX=new Set(",[]{}"),NI=new Set(` ,[]{}
145
- \r `),z5=(X)=>!X||NI.has(X);class MG{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(X,Q=!1){if(X){if(typeof X!=="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+X:X,this.lineEndPos=null}this.atEnd=!Q;let J=this.next??"stream";while(J&&(Q||this.hasChars(1)))J=yield*this.parseNext(J)}atLineEnd(){let X=this.pos,Q=this.buffer[X];while(Q===" "||Q==="\t")Q=this.buffer[++X];if(!Q||Q==="#"||Q===`
143
+ `: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(X[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}WI.createScalarToken=$4.createScalarToken;WI.resolveAsScalar=$4.resolveAsScalar;WI.setScalarValue=$4.setScalarValue;WI.stringify=XI.stringify;WI.visit=QI.visit;WI.BOM=W4;WI.DOCUMENT=H4;WI.FLOW_END=U4;WI.SCALAR=B4;WI.isCollection=JI;WI.isScalar=YI;WI.prettyToken=GI;WI.tokenType=$I});var L4=p((RI)=>{var b8=e6();function B1(X){switch(X){case void 0:case" ":case`
144
+ `:case"\r":case"\t":return!0;default:return!1}}var qG=new Set("0123456789ABCDEFabcdef"),AI=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),XX=new Set(",[]{}"),NI=new Set(` ,[]{}
145
+ \r `),z4=(X)=>!X||NI.has(X);class FG{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(X,Q=!1){if(X){if(typeof X!=="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+X:X,this.lineEndPos=null}this.atEnd=!Q;let J=this.next??"stream";while(J&&(Q||this.hasChars(1)))J=yield*this.parseNext(J)}atLineEnd(){let X=this.pos,Q=this.buffer[X];while(Q===" "||Q==="\t")Q=this.buffer[++X];if(!Q||Q==="#"||Q===`
146
146
  `)return!0;if(Q==="\r")return this.buffer[X+1]===`
147
147
  `;return!1}charAt(X){return this.buffer[this.pos+X]}continueScalar(X){let Q=this.buffer[X];if(this.indentNext>0){let J=0;while(Q===" ")Q=this.buffer[++J+X];if(Q==="\r"){let Y=this.buffer[J+X+1];if(Y===`
148
148
  `||!Y&&!this.atEnd)return X+J+1}return Q===`
149
149
  `||J>=this.indentNext||!Q&&!this.atEnd?X+J:-1}if(Q==="-"||Q==="."){let J=this.buffer.substr(X,3);if((J==="---"||J==="...")&&B1(this.buffer[X+3]))return-1}return X}getLine(){let X=this.lineEndPos;if(typeof X!=="number"||X!==-1&&X<this.pos)X=this.buffer.indexOf(`
150
- `,this.pos),this.lineEndPos=X;if(X===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[X-1]==="\r")X-=1;return this.buffer.substring(this.pos,X)}hasChars(X){return this.pos+X<=this.buffer.length}setNext(X){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=X,null}peek(X){return this.buffer.substr(this.pos,X)}*parseNext(X){switch(X){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let X=this.getLine();if(X===null)return this.setNext("stream");if(X[0]===C8.BOM)yield*this.pushCount(1),X=X.substring(1);if(X[0]==="%"){let Q=X.length,J=X.indexOf("#");while(J!==-1){let G=X[J-1];if(G===" "||G==="\t"){Q=J-1;break}else J=X.indexOf("#",J+1)}while(!0){let G=X[Q-1];if(G===" "||G==="\t")Q-=1;else break}let Y=(yield*this.pushCount(Q))+(yield*this.pushSpaces(!0));return yield*this.pushCount(X.length-Y),this.pushNewline(),"stream"}if(this.atLineEnd()){let Q=yield*this.pushSpaces(!0);return yield*this.pushCount(X.length-Q),yield*this.pushNewline(),"stream"}return yield C8.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let X=this.charAt(0);if(!X&&!this.atEnd)return this.setNext("line-start");if(X==="-"||X==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let Q=this.peek(3);if((Q==="---"||Q==="...")&&B1(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,Q==="---"?"doc":"stream"}if(this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!B1(this.charAt(1)))this.indentNext=this.indentValue;return yield*this.parseBlockStart()}*parseBlockStart(){let[X,Q]=this.peek(2);if(!Q&&!this.atEnd)return this.setNext("block-start");if((X==="-"||X==="?"||X===":")&&B1(Q)){let J=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=J,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let X=this.getLine();if(X===null)return this.setNext("doc");let Q=yield*this.pushIndicators();switch(X[Q]){case"#":yield*this.pushCount(X.length-Q);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(z5),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return Q+=yield*this.parseBlockScalarHeader(),Q+=yield*this.pushSpaces(!0),yield*this.pushCount(X.length-Q),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let X,Q,J=-1;do{if(X=yield*this.pushNewline(),X>0)Q=yield*this.pushSpaces(!1),this.indentValue=J=Q;else Q=0;Q+=yield*this.pushSpaces(!0)}while(X+Q>0);let Y=this.getLine();if(Y===null)return this.setNext("flow");if(J!==-1&&J<this.indentNext&&Y[0]!=="#"||J===0&&(Y.startsWith("---")||Y.startsWith("..."))&&B1(Y[3])){if(!(J===this.indentNext-1&&this.flowLevel===1&&(Y[0]==="]"||Y[0]==="}")))return this.flowLevel=0,yield C8.FLOW_END,yield*this.parseLineStart()}let G=0;while(Y[G]===",")G+=yield*this.pushCount(1),G+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(G+=yield*this.pushIndicators(),Y[G]){case void 0:return"flow";case"#":return yield*this.pushCount(Y.length-G),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(z5),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let $=this.charAt(1);if(this.flowKey||B1($)||$===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let X=this.charAt(0),Q=this.buffer.indexOf(X,this.pos+1);if(X==="'")while(Q!==-1&&this.buffer[Q+1]==="'")Q=this.buffer.indexOf("'",Q+2);else while(Q!==-1){let G=0;while(this.buffer[Q-1-G]==="\\")G+=1;if(G%2===0)break;Q=this.buffer.indexOf('"',Q+1)}let J=this.buffer.substring(0,Q),Y=J.indexOf(`
150
+ `,this.pos),this.lineEndPos=X;if(X===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[X-1]==="\r")X-=1;return this.buffer.substring(this.pos,X)}hasChars(X){return this.pos+X<=this.buffer.length}setNext(X){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=X,null}peek(X){return this.buffer.substr(this.pos,X)}*parseNext(X){switch(X){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let X=this.getLine();if(X===null)return this.setNext("stream");if(X[0]===b8.BOM)yield*this.pushCount(1),X=X.substring(1);if(X[0]==="%"){let Q=X.length,J=X.indexOf("#");while(J!==-1){let G=X[J-1];if(G===" "||G==="\t"){Q=J-1;break}else J=X.indexOf("#",J+1)}while(!0){let G=X[Q-1];if(G===" "||G==="\t")Q-=1;else break}let Y=(yield*this.pushCount(Q))+(yield*this.pushSpaces(!0));return yield*this.pushCount(X.length-Y),this.pushNewline(),"stream"}if(this.atLineEnd()){let Q=yield*this.pushSpaces(!0);return yield*this.pushCount(X.length-Q),yield*this.pushNewline(),"stream"}return yield b8.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let X=this.charAt(0);if(!X&&!this.atEnd)return this.setNext("line-start");if(X==="-"||X==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let Q=this.peek(3);if((Q==="---"||Q==="...")&&B1(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,Q==="---"?"doc":"stream"}if(this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!B1(this.charAt(1)))this.indentNext=this.indentValue;return yield*this.parseBlockStart()}*parseBlockStart(){let[X,Q]=this.peek(2);if(!Q&&!this.atEnd)return this.setNext("block-start");if((X==="-"||X==="?"||X===":")&&B1(Q)){let J=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=J,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let X=this.getLine();if(X===null)return this.setNext("doc");let Q=yield*this.pushIndicators();switch(X[Q]){case"#":yield*this.pushCount(X.length-Q);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(z4),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return Q+=yield*this.parseBlockScalarHeader(),Q+=yield*this.pushSpaces(!0),yield*this.pushCount(X.length-Q),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let X,Q,J=-1;do{if(X=yield*this.pushNewline(),X>0)Q=yield*this.pushSpaces(!1),this.indentValue=J=Q;else Q=0;Q+=yield*this.pushSpaces(!0)}while(X+Q>0);let Y=this.getLine();if(Y===null)return this.setNext("flow");if(J!==-1&&J<this.indentNext&&Y[0]!=="#"||J===0&&(Y.startsWith("---")||Y.startsWith("..."))&&B1(Y[3])){if(!(J===this.indentNext-1&&this.flowLevel===1&&(Y[0]==="]"||Y[0]==="}")))return this.flowLevel=0,yield b8.FLOW_END,yield*this.parseLineStart()}let G=0;while(Y[G]===",")G+=yield*this.pushCount(1),G+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(G+=yield*this.pushIndicators(),Y[G]){case void 0:return"flow";case"#":return yield*this.pushCount(Y.length-G),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(z4),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let $=this.charAt(1);if(this.flowKey||B1($)||$===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let X=this.charAt(0),Q=this.buffer.indexOf(X,this.pos+1);if(X==="'")while(Q!==-1&&this.buffer[Q+1]==="'")Q=this.buffer.indexOf("'",Q+2);else while(Q!==-1){let G=0;while(this.buffer[Q-1-G]==="\\")G+=1;if(G%2===0)break;Q=this.buffer.indexOf('"',Q+1)}let J=this.buffer.substring(0,Q),Y=J.indexOf(`
151
151
  `,this.pos);if(Y!==-1){while(Y!==-1){let G=this.continueScalar(Y+1);if(G===-1)break;Y=J.indexOf(`
152
152
  `,G)}if(Y!==-1)Q=Y-(J[Y-1]==="\r"?2:1)}if(Q===-1){if(!this.atEnd)return this.setNext("quoted-scalar");Q=this.buffer.length}return yield*this.pushToIndex(Q+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let X=this.pos;while(!0){let Q=this.buffer[++X];if(Q==="+")this.blockScalarKeep=!0;else if(Q>"0"&&Q<="9")this.blockScalarIndent=Number(Q)-1;else if(Q!=="-")break}return yield*this.pushUntil((Q)=>B1(Q)||Q==="#")}*parseBlockScalar(){let X=this.pos-1,Q=0,J;X:for(let G=this.pos;J=this.buffer[G];++G)switch(J){case" ":Q+=1;break;case`
153
153
  `:X=G,Q=0;break;case"\r":{let $=this.buffer[G+1];if(!$&&!this.atEnd)return this.setNext("block-scalar");if($===`
154
154
  `)break}default:break X}if(!J&&!this.atEnd)return this.setNext("block-scalar");if(Q>=this.indentNext){if(this.blockScalarIndent===-1)this.indentNext=Q;else this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let G=this.continueScalar(X+1);if(G===-1)break;X=this.buffer.indexOf(`
155
155
  `,G)}while(X!==-1);if(X===-1){if(!this.atEnd)return this.setNext("block-scalar");X=this.buffer.length}}let Y=X+1;J=this.buffer[Y];while(J===" ")J=this.buffer[++Y];if(J==="\t"){while(J==="\t"||J===" "||J==="\r"||J===`
156
156
  `)J=this.buffer[++Y];X=Y-1}else if(!this.blockScalarKeep)do{let G=X-1,$=this.buffer[G];if($==="\r")$=this.buffer[--G];let W=G;while($===" ")$=this.buffer[--G];if($===`
157
- `&&G>=this.pos&&G+1+Q>W)X=G;else break}while(!0);return yield C8.SCALAR,yield*this.pushToIndex(X+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let X=this.flowLevel>0,Q=this.pos-1,J=this.pos-1,Y;while(Y=this.buffer[++J])if(Y===":"){let G=this.buffer[J+1];if(B1(G)||X&&JX.has(G))break;Q=J}else if(B1(Y)){let G=this.buffer[J+1];if(Y==="\r")if(G===`
157
+ `&&G>=this.pos&&G+1+Q>W)X=G;else break}while(!0);return yield b8.SCALAR,yield*this.pushToIndex(X+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let X=this.flowLevel>0,Q=this.pos-1,J=this.pos-1,Y;while(Y=this.buffer[++J])if(Y===":"){let G=this.buffer[J+1];if(B1(G)||X&&XX.has(G))break;Q=J}else if(B1(Y)){let G=this.buffer[J+1];if(Y==="\r")if(G===`
158
158
  `)J+=1,Y=`
159
- `,G=this.buffer[J+1];else Q=J;if(G==="#"||X&&JX.has(G))break;if(Y===`
160
- `){let $=this.continueScalar(J+1);if($===-1)break;J=Math.max(J,$-2)}}else{if(X&&JX.has(Y))break;Q=J}if(!Y&&!this.atEnd)return this.setNext("plain-scalar");return yield C8.SCALAR,yield*this.pushToIndex(Q+1,!0),X?"flow":"doc"}*pushCount(X){if(X>0)return yield this.buffer.substr(this.pos,X),this.pos+=X,X;return 0}*pushToIndex(X,Q){let J=this.buffer.slice(this.pos,X);if(J)return yield J,this.pos+=J.length,J.length;else if(Q)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(z5))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let X=this.flowLevel>0,Q=this.charAt(1);if(B1(Q)||X&&JX.has(Q)){if(!X)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 X=this.pos+2,Q=this.buffer[X];while(!B1(Q)&&Q!==">")Q=this.buffer[++X];return yield*this.pushToIndex(Q===">"?X+1:X,!1)}else{let X=this.pos+1,Q=this.buffer[X];while(Q)if(AI.has(Q))Q=this.buffer[++X];else if(Q==="%"&&VG.has(this.buffer[X+1])&&VG.has(this.buffer[X+2]))Q=this.buffer[X+=3];else break;return yield*this.pushToIndex(X,!1)}}*pushNewline(){let X=this.buffer[this.pos];if(X===`
159
+ `,G=this.buffer[J+1];else Q=J;if(G==="#"||X&&XX.has(G))break;if(Y===`
160
+ `){let $=this.continueScalar(J+1);if($===-1)break;J=Math.max(J,$-2)}}else{if(X&&XX.has(Y))break;Q=J}if(!Y&&!this.atEnd)return this.setNext("plain-scalar");return yield b8.SCALAR,yield*this.pushToIndex(Q+1,!0),X?"flow":"doc"}*pushCount(X){if(X>0)return yield this.buffer.substr(this.pos,X),this.pos+=X,X;return 0}*pushToIndex(X,Q){let J=this.buffer.slice(this.pos,X);if(J)return yield J,this.pos+=J.length,J.length;else if(Q)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(z4))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let X=this.flowLevel>0,Q=this.charAt(1);if(B1(Q)||X&&XX.has(Q)){if(!X)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 X=this.pos+2,Q=this.buffer[X];while(!B1(Q)&&Q!==">")Q=this.buffer[++X];return yield*this.pushToIndex(Q===">"?X+1:X,!1)}else{let X=this.pos+1,Q=this.buffer[X];while(Q)if(AI.has(Q))Q=this.buffer[++X];else if(Q==="%"&&qG.has(this.buffer[X+1])&&qG.has(this.buffer[X+2]))Q=this.buffer[X+=3];else break;return yield*this.pushToIndex(X,!1)}}*pushNewline(){let X=this.buffer[this.pos];if(X===`
161
161
  `)return yield*this.pushCount(1);else if(X==="\r"&&this.charAt(1)===`
162
- `)return yield*this.pushCount(2);else return 0}*pushSpaces(X){let Q=this.pos-1,J;do J=this.buffer[++Q];while(J===" "||X&&J==="\t");let Y=Q-this.pos;if(Y>0)yield this.buffer.substr(this.pos,Y),this.pos=Q;return Y}*pushUntil(X){let Q=this.pos,J=this.buffer[Q];while(!X(J))J=this.buffer[++Q];return yield*this.pushToIndex(Q,!1)}}RI.Lexer=MG});var L5=p((jI)=>{class DG{constructor(){this.lineStarts=[],this.addNewLine=(X)=>this.lineStarts.push(X),this.linePos=(X)=>{let Q=0,J=this.lineStarts.length;while(Q<J){let G=Q+J>>1;if(this.lineStarts[G]<X)Q=G+1;else J=G}if(this.lineStarts[Q]===X)return{line:Q+1,col:1};if(Q===0)return{line:0,col:X};let Y=this.lineStarts[Q-1];return{line:Q,col:X-Y+1}}}}jI.LineCounter=DG});var q5=p((SI)=>{var PI=O1("process"),ZG=QX(),TI=B5();function c1(X,Q){for(let J=0;J<X.length;++J)if(X[J].type===Q)return!0;return!1}function OG(X){for(let Q=0;Q<X.length;++Q)switch(X[Q].type){case"space":case"comment":case"newline":break;default:return Q}return-1}function NG(X){switch(X?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function YX(X){switch(X.type){case"document":return X.start;case"block-map":{let Q=X.items[X.items.length-1];return Q.sep??Q.start}case"block-seq":return X.items[X.items.length-1].start;default:return[]}}function _9(X){if(X.length===0)return[];let Q=X.length;X:while(--Q>=0)switch(X[Q].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break X}while(X[++Q]?.type==="space");return X.splice(Q,X.length)}function AG(X){if(X.start.type==="flow-seq-start"){for(let Q of X.items)if(Q.sep&&!Q.value&&!c1(Q.start,"explicit-key-ind")&&!c1(Q.sep,"map-value-ind")){if(Q.key)Q.value=Q.key;if(delete Q.key,NG(Q.value))if(Q.value.end)Array.prototype.push.apply(Q.value.end,Q.sep);else Q.value.end=Q.sep;else Array.prototype.push.apply(Q.start,Q.sep);delete Q.sep}}}class RG{constructor(X){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new TI.Lexer,this.onNewLine=X}*parse(X,Q=!1){if(this.onNewLine&&this.offset===0)this.onNewLine(0);for(let J of this.lexer.lex(X,Q))yield*this.next(J);if(!Q)yield*this.end()}*next(X){if(this.source=X,PI.env.LOG_TOKENS)console.log("|",ZG.prettyToken(X));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=X.length;return}let Q=ZG.tokenType(X);if(!Q){let J=`Not a YAML token: ${X}`;yield*this.pop({type:"error",offset:this.offset,message:J,source:X}),this.offset+=X.length}else if(Q==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=Q,yield*this.step(),Q){case"newline":if(this.atNewLine=!0,this.indent=0,this.onNewLine)this.onNewLine(this.offset+X.length);break;case"space":if(this.atNewLine&&X[0]===" ")this.indent+=X.length;break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":if(this.atNewLine)this.indent+=X.length;break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=X.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 X=this.peek(1);if(this.type==="doc-end"&&X?.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(!X)return yield*this.stream();switch(X.type){case"document":return yield*this.document(X);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(X);case"block-scalar":return yield*this.blockScalar(X);case"block-map":return yield*this.blockMap(X);case"block-seq":return yield*this.blockSequence(X);case"flow-collection":return yield*this.flowCollection(X);case"doc-end":return yield*this.documentEnd(X)}yield*this.pop()}peek(X){return this.stack[this.stack.length-X]}*pop(X){let Q=X??this.stack.pop();if(!Q)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield Q;else{let J=this.peek(1);if(Q.type==="block-scalar")Q.indent="indent"in J?J.indent:0;else if(Q.type==="flow-collection"&&J.type==="document")Q.indent=0;if(Q.type==="flow-collection")AG(Q);switch(J.type){case"document":J.value=Q;break;case"block-scalar":J.props.push(Q);break;case"block-map":{let Y=J.items[J.items.length-1];if(Y.value){J.items.push({start:[],key:Q,sep:[]}),this.onKeyLine=!0;return}else if(Y.sep)Y.value=Q;else{Object.assign(Y,{key:Q,sep:[]}),this.onKeyLine=!Y.explicitKey;return}break}case"block-seq":{let Y=J.items[J.items.length-1];if(Y.value)J.items.push({start:[],value:Q});else Y.value=Q;break}case"flow-collection":{let Y=J.items[J.items.length-1];if(!Y||Y.value)J.items.push({start:[],key:Q,sep:[]});else if(Y.sep)Y.value=Q;else Object.assign(Y,{key:Q,sep:[]});return}default:yield*this.pop(),yield*this.pop(Q)}if((J.type==="document"||J.type==="block-map"||J.type==="block-seq")&&(Q.type==="block-map"||Q.type==="block-seq")){let Y=Q.items[Q.items.length-1];if(Y&&!Y.sep&&!Y.value&&Y.start.length>0&&OG(Y.start)===-1&&(Q.indent===0||Y.start.every((G)=>G.type!=="comment"||G.indent<Q.indent))){if(J.type==="document")J.end=Y.start;else J.items.push({start:Y.start});Q.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 X={type:"document",offset:this.offset,start:[]};if(this.type==="doc-start")X.start.push(this.sourceToken);this.stack.push(X);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(X){if(X.value)return yield*this.lineEnd(X);switch(this.type){case"doc-start":{if(OG(X.start)!==-1)yield*this.pop(),yield*this.step();else X.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":X.start.push(this.sourceToken);return}let Q=this.startBlockValue(X);if(Q)this.stack.push(Q);else yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(X){if(this.type==="map-value-ind"){let Q=YX(this.peek(2)),J=_9(Q),Y;if(X.end)Y=X.end,Y.push(this.sourceToken),delete X.end;else Y=[this.sourceToken];let G={type:"block-map",offset:X.offset,indent:X.indent,items:[{start:J,key:X,sep:Y}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=G}else yield*this.lineEnd(X)}*blockScalar(X){switch(this.type){case"space":case"comment":case"newline":X.props.push(this.sourceToken);return;case"scalar":if(X.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let Q=this.source.indexOf(`
162
+ `)return yield*this.pushCount(2);else return 0}*pushSpaces(X){let Q=this.pos-1,J;do J=this.buffer[++Q];while(J===" "||X&&J==="\t");let Y=Q-this.pos;if(Y>0)yield this.buffer.substr(this.pos,Y),this.pos=Q;return Y}*pushUntil(X){let Q=this.pos,J=this.buffer[Q];while(!X(J))J=this.buffer[++Q];return yield*this.pushToIndex(Q,!1)}}RI.Lexer=FG});var q4=p((jI)=>{class KG{constructor(){this.lineStarts=[],this.addNewLine=(X)=>this.lineStarts.push(X),this.linePos=(X)=>{let Q=0,J=this.lineStarts.length;while(Q<J){let G=Q+J>>1;if(this.lineStarts[G]<X)Q=G+1;else J=G}if(this.lineStarts[Q]===X)return{line:Q+1,col:1};if(Q===0)return{line:0,col:X};let Y=this.lineStarts[Q-1];return{line:Q,col:X-Y+1}}}}jI.LineCounter=KG});var F4=p((SI)=>{var PI=O1("process"),VG=e6(),TI=L4();function c1(X,Q){for(let J=0;J<X.length;++J)if(X[J].type===Q)return!0;return!1}function MG(X){for(let Q=0;Q<X.length;++Q)switch(X[Q].type){case"space":case"comment":case"newline":break;default:return Q}return-1}function ZG(X){switch(X?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function QX(X){switch(X.type){case"document":return X.start;case"block-map":{let Q=X.items[X.items.length-1];return Q.sep??Q.start}case"block-seq":return X.items[X.items.length-1].start;default:return[]}}function C9(X){if(X.length===0)return[];let Q=X.length;X:while(--Q>=0)switch(X[Q].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break X}while(X[++Q]?.type==="space");return X.splice(Q,X.length)}function DG(X){if(X.start.type==="flow-seq-start"){for(let Q of X.items)if(Q.sep&&!Q.value&&!c1(Q.start,"explicit-key-ind")&&!c1(Q.sep,"map-value-ind")){if(Q.key)Q.value=Q.key;if(delete Q.key,ZG(Q.value))if(Q.value.end)Array.prototype.push.apply(Q.value.end,Q.sep);else Q.value.end=Q.sep;else Array.prototype.push.apply(Q.start,Q.sep);delete Q.sep}}}class OG{constructor(X){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new TI.Lexer,this.onNewLine=X}*parse(X,Q=!1){if(this.onNewLine&&this.offset===0)this.onNewLine(0);for(let J of this.lexer.lex(X,Q))yield*this.next(J);if(!Q)yield*this.end()}*next(X){if(this.source=X,PI.env.LOG_TOKENS)console.log("|",VG.prettyToken(X));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=X.length;return}let Q=VG.tokenType(X);if(!Q){let J=`Not a YAML token: ${X}`;yield*this.pop({type:"error",offset:this.offset,message:J,source:X}),this.offset+=X.length}else if(Q==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=Q,yield*this.step(),Q){case"newline":if(this.atNewLine=!0,this.indent=0,this.onNewLine)this.onNewLine(this.offset+X.length);break;case"space":if(this.atNewLine&&X[0]===" ")this.indent+=X.length;break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":if(this.atNewLine)this.indent+=X.length;break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=X.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 X=this.peek(1);if(this.type==="doc-end"&&X?.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(!X)return yield*this.stream();switch(X.type){case"document":return yield*this.document(X);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(X);case"block-scalar":return yield*this.blockScalar(X);case"block-map":return yield*this.blockMap(X);case"block-seq":return yield*this.blockSequence(X);case"flow-collection":return yield*this.flowCollection(X);case"doc-end":return yield*this.documentEnd(X)}yield*this.pop()}peek(X){return this.stack[this.stack.length-X]}*pop(X){let Q=X??this.stack.pop();if(!Q)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield Q;else{let J=this.peek(1);if(Q.type==="block-scalar")Q.indent="indent"in J?J.indent:0;else if(Q.type==="flow-collection"&&J.type==="document")Q.indent=0;if(Q.type==="flow-collection")DG(Q);switch(J.type){case"document":J.value=Q;break;case"block-scalar":J.props.push(Q);break;case"block-map":{let Y=J.items[J.items.length-1];if(Y.value){J.items.push({start:[],key:Q,sep:[]}),this.onKeyLine=!0;return}else if(Y.sep)Y.value=Q;else{Object.assign(Y,{key:Q,sep:[]}),this.onKeyLine=!Y.explicitKey;return}break}case"block-seq":{let Y=J.items[J.items.length-1];if(Y.value)J.items.push({start:[],value:Q});else Y.value=Q;break}case"flow-collection":{let Y=J.items[J.items.length-1];if(!Y||Y.value)J.items.push({start:[],key:Q,sep:[]});else if(Y.sep)Y.value=Q;else Object.assign(Y,{key:Q,sep:[]});return}default:yield*this.pop(),yield*this.pop(Q)}if((J.type==="document"||J.type==="block-map"||J.type==="block-seq")&&(Q.type==="block-map"||Q.type==="block-seq")){let Y=Q.items[Q.items.length-1];if(Y&&!Y.sep&&!Y.value&&Y.start.length>0&&MG(Y.start)===-1&&(Q.indent===0||Y.start.every((G)=>G.type!=="comment"||G.indent<Q.indent))){if(J.type==="document")J.end=Y.start;else J.items.push({start:Y.start});Q.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 X={type:"document",offset:this.offset,start:[]};if(this.type==="doc-start")X.start.push(this.sourceToken);this.stack.push(X);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(X){if(X.value)return yield*this.lineEnd(X);switch(this.type){case"doc-start":{if(MG(X.start)!==-1)yield*this.pop(),yield*this.step();else X.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":X.start.push(this.sourceToken);return}let Q=this.startBlockValue(X);if(Q)this.stack.push(Q);else yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(X){if(this.type==="map-value-ind"){let Q=QX(this.peek(2)),J=C9(Q),Y;if(X.end)Y=X.end,Y.push(this.sourceToken),delete X.end;else Y=[this.sourceToken];let G={type:"block-map",offset:X.offset,indent:X.indent,items:[{start:J,key:X,sep:Y}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=G}else yield*this.lineEnd(X)}*blockScalar(X){switch(this.type){case"space":case"comment":case"newline":X.props.push(this.sourceToken);return;case"scalar":if(X.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let Q=this.source.indexOf(`
163
163
  `)+1;while(Q!==0)this.onNewLine(this.offset+Q),Q=this.source.indexOf(`
164
- `,Q)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(X){let Q=X.items[X.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,Q.value){let J="end"in Q.value?Q.value.end:void 0;if((Array.isArray(J)?J[J.length-1]:void 0)?.type==="comment")J?.push(this.sourceToken);else X.items.push({start:[this.sourceToken]})}else if(Q.sep)Q.sep.push(this.sourceToken);else Q.start.push(this.sourceToken);return;case"space":case"comment":if(Q.value)X.items.push({start:[this.sourceToken]});else if(Q.sep)Q.sep.push(this.sourceToken);else{if(this.atIndentedComment(Q.start,X.indent)){let Y=X.items[X.items.length-2]?.value?.end;if(Array.isArray(Y)){Array.prototype.push.apply(Y,Q.start),Y.push(this.sourceToken),X.items.pop();return}}Q.start.push(this.sourceToken)}return}if(this.indent>=X.indent){let J=!this.onKeyLine&&this.indent===X.indent,Y=J&&(Q.sep||Q.explicitKey)&&this.type!=="seq-item-ind",G=[];if(Y&&Q.sep&&!Q.value){let $=[];for(let W=0;W<Q.sep.length;++W){let H=Q.sep[W];switch(H.type){case"newline":$.push(W);break;case"space":break;case"comment":if(H.indent>X.indent)$.length=0;break;default:$.length=0}}if($.length>=2)G=Q.sep.splice($[1])}switch(this.type){case"anchor":case"tag":if(Y||Q.value)G.push(this.sourceToken),X.items.push({start:G}),this.onKeyLine=!0;else if(Q.sep)Q.sep.push(this.sourceToken);else Q.start.push(this.sourceToken);return;case"explicit-key-ind":if(!Q.sep&&!Q.explicitKey)Q.start.push(this.sourceToken),Q.explicitKey=!0;else if(Y||Q.value)G.push(this.sourceToken),X.items.push({start:G,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(Q.explicitKey)if(!Q.sep)if(c1(Q.start,"newline"))Object.assign(Q,{key:null,sep:[this.sourceToken]});else{let $=_9(Q.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:$,key:null,sep:[this.sourceToken]}]})}else if(Q.value)X.items.push({start:[],key:null,sep:[this.sourceToken]});else if(c1(Q.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:G,key:null,sep:[this.sourceToken]}]});else if(NG(Q.key)&&!c1(Q.sep,"newline")){let $=_9(Q.start),W=Q.key,H=Q.sep;H.push(this.sourceToken),delete Q.key,delete Q.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:$,key:W,sep:H}]})}else if(G.length>0)Q.sep=Q.sep.concat(G,this.sourceToken);else Q.sep.push(this.sourceToken);else if(!Q.sep)Object.assign(Q,{key:null,sep:[this.sourceToken]});else if(Q.value||Y)X.items.push({start:G,key:null,sep:[this.sourceToken]});else if(c1(Q.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else Q.sep.push(this.sourceToken);this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let $=this.flowScalar(this.type);if(Y||Q.value)X.items.push({start:G,key:$,sep:[]}),this.onKeyLine=!0;else if(Q.sep)this.stack.push($);else Object.assign(Q,{key:$,sep:[]}),this.onKeyLine=!0;return}default:{let $=this.startBlockValue(X);if($){if($.type==="block-seq"){if(!Q.explicitKey&&Q.sep&&!c1(Q.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(J)X.items.push({start:G});this.stack.push($);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(X){let Q=X.items[X.items.length-1];switch(this.type){case"newline":if(Q.value){let J="end"in Q.value?Q.value.end:void 0;if((Array.isArray(J)?J[J.length-1]:void 0)?.type==="comment")J?.push(this.sourceToken);else X.items.push({start:[this.sourceToken]})}else Q.start.push(this.sourceToken);return;case"space":case"comment":if(Q.value)X.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(Q.start,X.indent)){let Y=X.items[X.items.length-2]?.value?.end;if(Array.isArray(Y)){Array.prototype.push.apply(Y,Q.start),Y.push(this.sourceToken),X.items.pop();return}}Q.start.push(this.sourceToken)}return;case"anchor":case"tag":if(Q.value||this.indent<=X.indent)break;Q.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==X.indent)break;if(Q.value||c1(Q.start,"seq-item-ind"))X.items.push({start:[this.sourceToken]});else Q.start.push(this.sourceToken);return}if(this.indent>X.indent){let J=this.startBlockValue(X);if(J){this.stack.push(J);return}}yield*this.pop(),yield*this.step()}*flowCollection(X){let Q=X.items[X.items.length-1];if(this.type==="flow-error-end"){let J;do yield*this.pop(),J=this.peek(1);while(J?.type==="flow-collection")}else if(X.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!Q||Q.sep)X.items.push({start:[this.sourceToken]});else Q.start.push(this.sourceToken);return;case"map-value-ind":if(!Q||Q.value)X.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Q.sep)Q.sep.push(this.sourceToken);else Object.assign(Q,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!Q||Q.value)X.items.push({start:[this.sourceToken]});else if(Q.sep)Q.sep.push(this.sourceToken);else Q.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let Y=this.flowScalar(this.type);if(!Q||Q.value)X.items.push({start:[],key:Y,sep:[]});else if(Q.sep)this.stack.push(Y);else Object.assign(Q,{key:Y,sep:[]});return}case"flow-map-end":case"flow-seq-end":X.end.push(this.sourceToken);return}let J=this.startBlockValue(X);if(J)this.stack.push(J);else yield*this.pop(),yield*this.step()}else{let J=this.peek(2);if(J.type==="block-map"&&(this.type==="map-value-ind"&&J.indent===X.indent||this.type==="newline"&&!J.items[J.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&J.type!=="flow-collection"){let Y=YX(J),G=_9(Y);AG(X);let $=X.end.splice(1,X.end.length);$.push(this.sourceToken);let W={type:"block-map",offset:X.offset,indent:X.indent,items:[{start:G,key:X,sep:$}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=W}else yield*this.lineEnd(X)}}flowScalar(X){if(this.onNewLine){let Q=this.source.indexOf(`
164
+ `,Q)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(X){let Q=X.items[X.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,Q.value){let J="end"in Q.value?Q.value.end:void 0;if((Array.isArray(J)?J[J.length-1]:void 0)?.type==="comment")J?.push(this.sourceToken);else X.items.push({start:[this.sourceToken]})}else if(Q.sep)Q.sep.push(this.sourceToken);else Q.start.push(this.sourceToken);return;case"space":case"comment":if(Q.value)X.items.push({start:[this.sourceToken]});else if(Q.sep)Q.sep.push(this.sourceToken);else{if(this.atIndentedComment(Q.start,X.indent)){let Y=X.items[X.items.length-2]?.value?.end;if(Array.isArray(Y)){Array.prototype.push.apply(Y,Q.start),Y.push(this.sourceToken),X.items.pop();return}}Q.start.push(this.sourceToken)}return}if(this.indent>=X.indent){let J=!this.onKeyLine&&this.indent===X.indent,Y=J&&(Q.sep||Q.explicitKey)&&this.type!=="seq-item-ind",G=[];if(Y&&Q.sep&&!Q.value){let $=[];for(let W=0;W<Q.sep.length;++W){let H=Q.sep[W];switch(H.type){case"newline":$.push(W);break;case"space":break;case"comment":if(H.indent>X.indent)$.length=0;break;default:$.length=0}}if($.length>=2)G=Q.sep.splice($[1])}switch(this.type){case"anchor":case"tag":if(Y||Q.value)G.push(this.sourceToken),X.items.push({start:G}),this.onKeyLine=!0;else if(Q.sep)Q.sep.push(this.sourceToken);else Q.start.push(this.sourceToken);return;case"explicit-key-ind":if(!Q.sep&&!Q.explicitKey)Q.start.push(this.sourceToken),Q.explicitKey=!0;else if(Y||Q.value)G.push(this.sourceToken),X.items.push({start:G,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(Q.explicitKey)if(!Q.sep)if(c1(Q.start,"newline"))Object.assign(Q,{key:null,sep:[this.sourceToken]});else{let $=C9(Q.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:$,key:null,sep:[this.sourceToken]}]})}else if(Q.value)X.items.push({start:[],key:null,sep:[this.sourceToken]});else if(c1(Q.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:G,key:null,sep:[this.sourceToken]}]});else if(ZG(Q.key)&&!c1(Q.sep,"newline")){let $=C9(Q.start),W=Q.key,H=Q.sep;H.push(this.sourceToken),delete Q.key,delete Q.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:$,key:W,sep:H}]})}else if(G.length>0)Q.sep=Q.sep.concat(G,this.sourceToken);else Q.sep.push(this.sourceToken);else if(!Q.sep)Object.assign(Q,{key:null,sep:[this.sourceToken]});else if(Q.value||Y)X.items.push({start:G,key:null,sep:[this.sourceToken]});else if(c1(Q.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else Q.sep.push(this.sourceToken);this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let $=this.flowScalar(this.type);if(Y||Q.value)X.items.push({start:G,key:$,sep:[]}),this.onKeyLine=!0;else if(Q.sep)this.stack.push($);else Object.assign(Q,{key:$,sep:[]}),this.onKeyLine=!0;return}default:{let $=this.startBlockValue(X);if($){if($.type==="block-seq"){if(!Q.explicitKey&&Q.sep&&!c1(Q.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(J)X.items.push({start:G});this.stack.push($);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(X){let Q=X.items[X.items.length-1];switch(this.type){case"newline":if(Q.value){let J="end"in Q.value?Q.value.end:void 0;if((Array.isArray(J)?J[J.length-1]:void 0)?.type==="comment")J?.push(this.sourceToken);else X.items.push({start:[this.sourceToken]})}else Q.start.push(this.sourceToken);return;case"space":case"comment":if(Q.value)X.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(Q.start,X.indent)){let Y=X.items[X.items.length-2]?.value?.end;if(Array.isArray(Y)){Array.prototype.push.apply(Y,Q.start),Y.push(this.sourceToken),X.items.pop();return}}Q.start.push(this.sourceToken)}return;case"anchor":case"tag":if(Q.value||this.indent<=X.indent)break;Q.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==X.indent)break;if(Q.value||c1(Q.start,"seq-item-ind"))X.items.push({start:[this.sourceToken]});else Q.start.push(this.sourceToken);return}if(this.indent>X.indent){let J=this.startBlockValue(X);if(J){this.stack.push(J);return}}yield*this.pop(),yield*this.step()}*flowCollection(X){let Q=X.items[X.items.length-1];if(this.type==="flow-error-end"){let J;do yield*this.pop(),J=this.peek(1);while(J?.type==="flow-collection")}else if(X.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!Q||Q.sep)X.items.push({start:[this.sourceToken]});else Q.start.push(this.sourceToken);return;case"map-value-ind":if(!Q||Q.value)X.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Q.sep)Q.sep.push(this.sourceToken);else Object.assign(Q,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!Q||Q.value)X.items.push({start:[this.sourceToken]});else if(Q.sep)Q.sep.push(this.sourceToken);else Q.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let Y=this.flowScalar(this.type);if(!Q||Q.value)X.items.push({start:[],key:Y,sep:[]});else if(Q.sep)this.stack.push(Y);else Object.assign(Q,{key:Y,sep:[]});return}case"flow-map-end":case"flow-seq-end":X.end.push(this.sourceToken);return}let J=this.startBlockValue(X);if(J)this.stack.push(J);else yield*this.pop(),yield*this.step()}else{let J=this.peek(2);if(J.type==="block-map"&&(this.type==="map-value-ind"&&J.indent===X.indent||this.type==="newline"&&!J.items[J.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&J.type!=="flow-collection"){let Y=QX(J),G=C9(Y);DG(X);let $=X.end.splice(1,X.end.length);$.push(this.sourceToken);let W={type:"block-map",offset:X.offset,indent:X.indent,items:[{start:G,key:X,sep:$}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=W}else yield*this.lineEnd(X)}}flowScalar(X){if(this.onNewLine){let Q=this.source.indexOf(`
165
165
  `)+1;while(Q!==0)this.onNewLine(this.offset+Q),Q=this.source.indexOf(`
166
- `,Q)+1}return{type:X,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(X){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 Q=YX(X),J=_9(Q);return J.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:J,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let Q=YX(X),J=_9(Q);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:J,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(X,Q){if(this.type!=="comment")return!1;if(this.indent<=Q)return!1;return X.every((J)=>J.type==="newline"||J.type==="space")}*documentEnd(X){if(this.type!=="doc-mode"){if(X.end)X.end.push(this.sourceToken);else X.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd(X){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(X.end)X.end.push(this.sourceToken);else X.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}SI.Parser=RG});var TG=p((gI)=>{var IG=Q5(),bI=P8(),_8=T8(),CI=LQ(),_I=K0(),kI=L5(),jG=q5();function wG(X){let Q=X.prettyErrors!==!1;return{lineCounter:X.lineCounter||Q&&new kI.LineCounter||null,prettyErrors:Q}}function vI(X,Q={}){let{lineCounter:J,prettyErrors:Y}=wG(Q),G=new jG.Parser(J?.addNewLine),$=new IG.Composer(Q),W=Array.from($.compose(G.parse(X)));if(Y&&J)for(let H of W)H.errors.forEach(_8.prettifyError(X,J)),H.warnings.forEach(_8.prettifyError(X,J));if(W.length>0)return W;return Object.assign([],{empty:!0},$.streamInfo())}function PG(X,Q={}){let{lineCounter:J,prettyErrors:Y}=wG(Q),G=new jG.Parser(J?.addNewLine),$=new IG.Composer(Q),W=null;for(let H of $.compose(G.parse(X),!0,X.length))if(!W)W=H;else if(W.options.logLevel!=="silent"){W.errors.push(new _8.YAMLParseError(H.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(Y&&J)W.errors.forEach(_8.prettifyError(X,J)),W.warnings.forEach(_8.prettifyError(X,J));return W}function yI(X,Q,J){let Y=void 0;if(typeof Q==="function")Y=Q;else if(J===void 0&&Q&&typeof Q==="object")J=Q;let G=PG(X,J);if(!G)return null;if(G.warnings.forEach(($)=>CI.warn(G.options.logLevel,$)),G.errors.length>0)if(G.options.logLevel!=="silent")throw G.errors[0];else G.errors=[];return G.toJS(Object.assign({reviver:Y},J))}function xI(X,Q,J){let Y=null;if(typeof Q==="function"||Array.isArray(Q))Y=Q;else if(J===void 0&&Q)J=Q;if(typeof J==="string")J=J.length;if(typeof J==="number"){let G=Math.round(J);J=G<1?void 0:G>8?{indent:8}:{indent:G}}if(X===void 0){let{keepUndefined:G}=J??Q??{};if(!G)return}if(_I.isDocument(X)&&!Y)return X.toString(J);return new bI.Document(X,Y,J).toString(J)}gI.parse=yI;gI.parseAllDocuments=vI;gI.parseDocument=PG;gI.stringify=xI});var EG=p((Xj)=>{var lI=Q5(),cI=P8(),pI=fQ(),F5=T8(),dI=L8(),p1=K0(),iI=f1(),nI=v0(),rI=m1(),oI=l1(),aI=QX(),sI=B5(),tI=L5(),eI=q5(),GX=TG(),SG=z8();Xj.Composer=lI.Composer;Xj.Document=cI.Document;Xj.Schema=pI.Schema;Xj.YAMLError=F5.YAMLError;Xj.YAMLParseError=F5.YAMLParseError;Xj.YAMLWarning=F5.YAMLWarning;Xj.Alias=dI.Alias;Xj.isAlias=p1.isAlias;Xj.isCollection=p1.isCollection;Xj.isDocument=p1.isDocument;Xj.isMap=p1.isMap;Xj.isNode=p1.isNode;Xj.isPair=p1.isPair;Xj.isScalar=p1.isScalar;Xj.isSeq=p1.isSeq;Xj.Pair=iI.Pair;Xj.Scalar=nI.Scalar;Xj.YAMLMap=rI.YAMLMap;Xj.YAMLSeq=oI.YAMLSeq;Xj.CST=aI;Xj.Lexer=sI.Lexer;Xj.LineCounter=tI.LineCounter;Xj.Parser=eI.Parser;Xj.parse=GX.parse;Xj.parseAllDocuments=GX.parseAllDocuments;Xj.parseDocument=GX.parseDocument;Xj.stringify=GX.stringify;Xj.visit=SG.visit;Xj.visitAsync=SG.visitAsync});var y5=Z5(v5(),1),{program:y9,createCommand:cj,createArgument:pj,createOption:dj,CommanderError:ij,InvalidArgumentError:nj,InvalidOptionArgumentError:rj,Command:oj,Argument:aj,Option:sj,Help:tj}=y5.default;var x5=(X=0)=>(Q)=>`\x1B[${Q+X}m`,g5=(X=0)=>(Q)=>`\x1B[${38+X};5;${Q}m`,h5=(X=0)=>(Q,J,Y)=>`\x1B[${38+X};2;${Q};${J};${Y}m`,I0={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},Xw=Object.keys(I0.modifier),b$=Object.keys(I0.color),C$=Object.keys(I0.bgColor),Qw=[...b$,...C$];function _$(){let X=new Map;for(let[Q,J]of Object.entries(I0)){for(let[Y,G]of Object.entries(J))I0[Y]={open:`\x1B[${G[0]}m`,close:`\x1B[${G[1]}m`},J[Y]=I0[Y],X.set(G[0],G[1]);Object.defineProperty(I0,Q,{value:J,enumerable:!1})}return Object.defineProperty(I0,"codes",{value:X,enumerable:!1}),I0.color.close="\x1B[39m",I0.bgColor.close="\x1B[49m",I0.color.ansi=x5(),I0.color.ansi256=g5(),I0.color.ansi16m=h5(),I0.bgColor.ansi=x5(10),I0.bgColor.ansi256=g5(10),I0.bgColor.ansi16m=h5(10),Object.defineProperties(I0,{rgbToAnsi256:{value(Q,J,Y){if(Q===J&&J===Y){if(Q<8)return 16;if(Q>248)return 231;return Math.round((Q-8)/247*24)+232}return 16+36*Math.round(Q/255*5)+6*Math.round(J/255*5)+Math.round(Y/255*5)},enumerable:!1},hexToRgb:{value(Q){let J=/[a-f\d]{6}|[a-f\d]{3}/i.exec(Q.toString(16));if(!J)return[0,0,0];let[Y]=J;if(Y.length===3)Y=[...Y].map(($)=>$+$).join("");let G=Number.parseInt(Y,16);return[G>>16&255,G>>8&255,G&255]},enumerable:!1},hexToAnsi256:{value:(Q)=>I0.rgbToAnsi256(...I0.hexToRgb(Q)),enumerable:!1},ansi256ToAnsi:{value(Q){if(Q<8)return 30+Q;if(Q<16)return 90+(Q-8);let J,Y,G;if(Q>=232)J=((Q-232)*10+8)/255,Y=J,G=J;else{Q-=16;let H=Q%36;J=Math.floor(Q/36)/5,Y=Math.floor(H/6)/5,G=H%6/5}let $=Math.max(J,Y,G)*2;if($===0)return 30;let W=30+(Math.round(G)<<2|Math.round(Y)<<1|Math.round(J));if($===2)W+=60;return W},enumerable:!1},rgbToAnsi:{value:(Q,J,Y)=>I0.ansi256ToAnsi(I0.rgbToAnsi256(Q,J,Y)),enumerable:!1},hexToAnsi:{value:(Q)=>I0.ansi256ToAnsi(I0.hexToAnsi256(Q)),enumerable:!1}}),I0}var k$=_$(),$1=k$;import VX from"node:process";import v$ from"node:os";import f5 from"node:tty";function e0(X,Q=globalThis.Deno?globalThis.Deno.args:VX.argv){let J=X.startsWith("-")?"":X.length===1?"-":"--",Y=Q.indexOf(J+X),G=Q.indexOf("--");return Y!==-1&&(G===-1||Y<G)}var{env:j0}=VX,y8;if(e0("no-color")||e0("no-colors")||e0("color=false")||e0("color=never"))y8=0;else if(e0("color")||e0("colors")||e0("color=true")||e0("color=always"))y8=1;function y$(){if("FORCE_COLOR"in j0){if(j0.FORCE_COLOR==="true")return 1;if(j0.FORCE_COLOR==="false")return 0;return j0.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(j0.FORCE_COLOR,10),3)}}function x$(X){if(X===0)return!1;return{level:X,hasBasic:!0,has256:X>=2,has16m:X>=3}}function g$(X,{streamIsTTY:Q,sniffFlags:J=!0}={}){let Y=y$();if(Y!==void 0)y8=Y;let G=J?y8:Y;if(G===0)return 0;if(J){if(e0("color=16m")||e0("color=full")||e0("color=truecolor"))return 3;if(e0("color=256"))return 2}if("TF_BUILD"in j0&&"AGENT_NAME"in j0)return 1;if(X&&!Q&&G===void 0)return 0;let $=G||0;if(j0.TERM==="dumb")return $;if(VX.platform==="win32"){let W=v$.release().split(".");if(Number(W[0])>=10&&Number(W[2])>=10586)return Number(W[2])>=14931?3:2;return 1}if("CI"in j0){if(["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some((W)=>(W in j0)))return 3;if(["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((W)=>(W in j0))||j0.CI_NAME==="codeship")return 1;return $}if("TEAMCITY_VERSION"in j0)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(j0.TEAMCITY_VERSION)?1:0;if(j0.COLORTERM==="truecolor")return 3;if(j0.TERM==="xterm-kitty")return 3;if(j0.TERM==="xterm-ghostty")return 3;if(j0.TERM==="wezterm")return 3;if("TERM_PROGRAM"in j0){let W=Number.parseInt((j0.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(j0.TERM_PROGRAM){case"iTerm.app":return W>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(j0.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(j0.TERM))return 1;if("COLORTERM"in j0)return 1;return $}function u5(X,Q={}){let J=g$(X,{streamIsTTY:X&&X.isTTY,...Q});return x$(J)}var h$={stdout:u5({isTTY:f5.isatty(1)}),stderr:u5({isTTY:f5.isatty(2)})},m5=h$;function l5(X,Q,J){let Y=X.indexOf(Q);if(Y===-1)return X;let G=Q.length,$=0,W="";do W+=X.slice($,Y)+Q+J,$=Y+G,Y=X.indexOf(Q,$);while(Y!==-1);return W+=X.slice($),W}function c5(X,Q,J,Y){let G=0,$="";do{let W=X[Y-1]==="\r";$+=X.slice(G,W?Y-1:Y)+Q+(W?`\r
167
- `:`
168
- `)+J,G=Y+1,Y=X.indexOf(`
169
- `,G)}while(Y!==-1);return $+=X.slice(G),$}var{stdout:p5,stderr:d5}=m5,MX=Symbol("GENERATOR"),G9=Symbol("STYLER"),x9=Symbol("IS_EMPTY"),i5=["ansi","ansi","ansi256","ansi16m"],$9=Object.create(null),f$=(X,Q={})=>{if(Q.level&&!(Number.isInteger(Q.level)&&Q.level>=0&&Q.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let J=p5?p5.level:0;X.level=Q.level===void 0?J:Q.level};var u$=(X)=>{let Q=(...J)=>J.join(" ");return f$(Q,X),Object.setPrototypeOf(Q,g9.prototype),Q};function g9(X){return u$(X)}Object.setPrototypeOf(g9.prototype,Function.prototype);for(let[X,Q]of Object.entries($1))$9[X]={get(){let J=x8(this,ZX(Q.open,Q.close,this[G9]),this[x9]);return Object.defineProperty(this,X,{value:J}),J}};$9.visible={get(){let X=x8(this,this[G9],!0);return Object.defineProperty(this,"visible",{value:X}),X}};var DX=(X,Q,J,...Y)=>{if(X==="rgb"){if(Q==="ansi16m")return $1[J].ansi16m(...Y);if(Q==="ansi256")return $1[J].ansi256($1.rgbToAnsi256(...Y));return $1[J].ansi($1.rgbToAnsi(...Y))}if(X==="hex")return DX("rgb",Q,J,...$1.hexToRgb(...Y));return $1[J][X](...Y)},m$=["rgb","hex","ansi256"];for(let X of m$){$9[X]={get(){let{level:J}=this;return function(...Y){let G=ZX(DX(X,i5[J],"color",...Y),$1.color.close,this[G9]);return x8(this,G,this[x9])}}};let Q="bg"+X[0].toUpperCase()+X.slice(1);$9[Q]={get(){let{level:J}=this;return function(...Y){let G=ZX(DX(X,i5[J],"bgColor",...Y),$1.bgColor.close,this[G9]);return x8(this,G,this[x9])}}}}var l$=Object.defineProperties(()=>{},{...$9,level:{enumerable:!0,get(){return this[MX].level},set(X){this[MX].level=X}}}),ZX=(X,Q,J)=>{let Y,G;if(J===void 0)Y=X,G=Q;else Y=J.openAll+X,G=Q+J.closeAll;return{open:X,close:Q,openAll:Y,closeAll:G,parent:J}},x8=(X,Q,J)=>{let Y=(...G)=>c$(Y,G.length===1?""+G[0]:G.join(" "));return Object.setPrototypeOf(Y,l$),Y[MX]=X,Y[G9]=Q,Y[x9]=J,Y},c$=(X,Q)=>{if(X.level<=0||!Q)return X[x9]?"":Q;let J=X[G9];if(J===void 0)return Q;let{openAll:Y,closeAll:G}=J;if(Q.includes("\x1B"))while(J!==void 0)Q=l5(Q,J.close,J.open),J=J.parent;let $=Q.indexOf(`
170
- `);if($!==-1)Q=c5(Q,G,Y,$);return Y+Q+G};Object.defineProperties(g9.prototype,$9);var p$=g9(),Lw=g9({level:d5?d5.level:0});var w0=p$;var n5="━".repeat(55);function d$(X){let Q=Math.round(X/20),J=5-Q;return"\uD83E\uDD52".repeat(Q)+"░".repeat(J)}function OX(X){let{tool:Q,scenarios:J,summary:Y}=X;console.log(),console.log(w0.bold("\uD83E\uDD52 pickled check results")),console.log(n5),console.log(),console.log(`Tool: ${w0.cyan(Q.name)}`),console.log(`Path: ${w0.dim(Q.path)}`),console.log();for(let G of J){let $=G.passed?w0.green("✓"):w0.red("✗"),W=G.passed?w0.dim("passed"):G.error?w0.red(`error: ${G.error.slice(0,40)}`):w0.yellow("tool not mentioned");console.log(` ${$} "${G.scenario.name}" - ${W}`)}if(console.log(),console.log(n5),console.log(`Freshness: ${Y.passed}/${Y.total} (${Y.freshness}%) ${d$(Y.freshness)}`),console.log(),Y.freshness>=80)console.log(w0.green("\uD83E\uDD52 Looking fresh! You're kind of a big dill."));else if(Y.freshness>=60)console.log(w0.yellow("\uD83E\uDD52 Not bad, but room to get fresher."));else console.log(w0.red("\uD83E\uDD52 Time to freshen up your AI presence."));console.log()}function g8(X){return JSON.stringify(X,null,2)}import{join as o5}from"path";import{fileURLToPath as nW}from"url";import{setMaxListeners as rW}from"events";import{spawn as aW}from"child_process";import{createInterface as sW}from"readline";import*as W0 from"fs";import{stat as tW,open as Nw}from"fs/promises";import{join as lU}from"path";import{homedir as cU}from"os";import{dirname as PX,join as c4}from"path";import{cwd as pU}from"process";import{realpathSync as dU}from"fs";import{randomUUID as iU}from"crypto";import{randomUUID as zz}from"crypto";import{appendFileSync as Bz,existsSync as Lz,mkdirSync as qz}from"fs";import{join as Y4}from"path";import{randomUUID as Mz}from"crypto";var{create:i$,getPrototypeOf:n$,defineProperty:wX,getOwnPropertyNames:r$}=Object,o$=Object.prototype.hasOwnProperty,S4=(X,Q,J)=>{J=X!=null?i$(n$(X)):{};let Y=Q||!X||!X.__esModule?wX(J,"default",{value:X,enumerable:!0}):J;for(let G of r$(X))if(!o$.call(Y,G))wX(Y,G,{get:()=>X[G],enumerable:!0});return Y},i=(X,Q)=>()=>(Q||X((Q={exports:{}}).exports,Q),Q.exports),E4=(X,Q)=>{for(var J in Q)wX(X,J,{get:Q[J],enumerable:!0,configurable:!0,set:(Y)=>Q[J]=()=>Y})};var p8=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.regexpCode=X.getEsmExportName=X.getProperty=X.safeStringify=X.stringify=X.strConcat=X.addCodeArg=X.str=X._=X.nil=X._Code=X.Name=X.IDENTIFIER=X._CodeOrName=void 0;class Q{}X._CodeOrName=Q,X.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class J extends Q{constructor(B){super();if(!X.IDENTIFIER.test(B))throw Error("CodeGen: name must be a valid identifier");this.str=B}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}X.Name=J;class Y extends Q{constructor(B){super();this._items=typeof B==="string"?[B]:B}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let B=this._items[0];return B===""||B==='""'}get str(){var B;return(B=this._str)!==null&&B!==void 0?B:this._str=this._items.reduce((V,q)=>`${V}${q}`,"")}get names(){var B;return(B=this._names)!==null&&B!==void 0?B:this._names=this._items.reduce((V,q)=>{if(q instanceof J)V[q.str]=(V[q.str]||0)+1;return V},{})}}X._Code=Y,X.nil=new Y("");function G(B,...V){let q=[B[0]],L=0;while(L<V.length)H(q,V[L]),q.push(B[++L]);return new Y(q)}X._=G;var $=new Y("+");function W(B,...V){let q=[R(B[0])],L=0;while(L<V.length)q.push($),H(q,V[L]),q.push($,R(B[++L]));return U(q),new Y(q)}X.str=W;function H(B,V){if(V instanceof Y)B.push(...V._items);else if(V instanceof J)B.push(V);else B.push(K(V))}X.addCodeArg=H;function U(B){let V=1;while(V<B.length-1){if(B[V]===$){let q=z(B[V-1],B[V+1]);if(q!==void 0){B.splice(V-1,3,q);continue}B[V++]="+"}V++}}function z(B,V){if(V==='""')return B;if(B==='""')return V;if(typeof B=="string"){if(V instanceof J||B[B.length-1]!=='"')return;if(typeof V!="string")return`${B.slice(0,-1)}${V}"`;if(V[0]==='"')return B.slice(0,-1)+V.slice(1);return}if(typeof V=="string"&&V[0]==='"'&&!(B instanceof J))return`"${B}${V.slice(1)}`;return}function F(B,V){return V.emptyStr()?B:B.emptyStr()?V:W`${B}${V}`}X.strConcat=F;function K(B){return typeof B=="number"||typeof B=="boolean"||B===null?B:R(Array.isArray(B)?B.join(","):B)}function M(B){return new Y(R(B))}X.stringify=M;function R(B){return JSON.stringify(B).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}X.safeStringify=R;function w(B){return typeof B=="string"&&X.IDENTIFIER.test(B)?new Y(`.${B}`):G`[${B}]`}X.getProperty=w;function A(B){if(typeof B=="string"&&X.IDENTIFIER.test(B))return new Y(`${B}`);throw Error(`CodeGen: invalid export name: ${B}, use explicit $id name mapping`)}X.getEsmExportName=A;function Z(B){return new Y(B.toString())}X.regexpCode=Z}),r5=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.ValueScope=X.ValueScopeName=X.Scope=X.varKinds=X.UsedValueState=void 0;var Q=p8();class J extends Error{constructor(U){super(`CodeGen: "code" for ${U} not defined`);this.value=U.value}}var Y;(function(U){U[U.Started=0]="Started",U[U.Completed=1]="Completed"})(Y||(X.UsedValueState=Y={})),X.varKinds={const:new Q.Name("const"),let:new Q.Name("let"),var:new Q.Name("var")};class G{constructor({prefixes:U,parent:z}={}){this._names={},this._prefixes=U,this._parent=z}toName(U){return U instanceof Q.Name?U:this.name(U)}name(U){return new Q.Name(this._newName(U))}_newName(U){let z=this._names[U]||this._nameGroup(U);return`${U}${z.index++}`}_nameGroup(U){var z,F;if(((F=(z=this._parent)===null||z===void 0?void 0:z._prefixes)===null||F===void 0?void 0:F.has(U))||this._prefixes&&!this._prefixes.has(U))throw Error(`CodeGen: prefix "${U}" is not allowed in this scope`);return this._names[U]={prefix:U,index:0}}}X.Scope=G;class $ extends Q.Name{constructor(U,z){super(z);this.prefix=U}setValue(U,{property:z,itemIndex:F}){this.value=U,this.scopePath=Q._`.${new Q.Name(z)}[${F}]`}}X.ValueScopeName=$;var W=Q._`\n`;class H extends G{constructor(U){super(U);this._values={},this._scope=U.scope,this.opts={...U,_n:U.lines?W:Q.nil}}get(){return this._scope}name(U){return new $(U,this._newName(U))}value(U,z){var F;if(z.ref===void 0)throw Error("CodeGen: ref must be passed in value");let K=this.toName(U),{prefix:M}=K,R=(F=z.key)!==null&&F!==void 0?F:z.ref,w=this._values[M];if(w){let B=w.get(R);if(B)return B}else w=this._values[M]=new Map;w.set(R,K);let A=this._scope[M]||(this._scope[M]=[]),Z=A.length;return A[Z]=z.ref,K.setValue(z,{property:M,itemIndex:Z}),K}getValue(U,z){let F=this._values[U];if(!F)return;return F.get(z)}scopeRefs(U,z=this._values){return this._reduceValues(z,(F)=>{if(F.scopePath===void 0)throw Error(`CodeGen: name "${F}" has no value`);return Q._`${U}${F.scopePath}`})}scopeCode(U=this._values,z,F){return this._reduceValues(U,(K)=>{if(K.value===void 0)throw Error(`CodeGen: name "${K}" has no value`);return K.value.code},z,F)}_reduceValues(U,z,F={},K){let M=Q.nil;for(let R in U){let w=U[R];if(!w)continue;let A=F[R]=F[R]||new Map;w.forEach((Z)=>{if(A.has(Z))return;A.set(Z,Y.Started);let B=z(Z);if(B){let V=this.opts.es5?X.varKinds.var:X.varKinds.const;M=Q._`${M}${V} ${Z} = ${B};${this.opts._n}`}else if(B=K===null||K===void 0?void 0:K(Z))M=Q._`${M}${B}${this.opts._n}`;else throw new J(Z);A.set(Z,Y.Completed)})}return M}}X.ValueScope=H}),z0=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.or=X.and=X.not=X.CodeGen=X.operators=X.varKinds=X.ValueScopeName=X.ValueScope=X.Scope=X.Name=X.regexpCode=X.stringify=X.getProperty=X.nil=X.strConcat=X.str=X._=void 0;var Q=p8(),J=r5(),Y=p8();Object.defineProperty(X,"_",{enumerable:!0,get:function(){return Y._}}),Object.defineProperty(X,"str",{enumerable:!0,get:function(){return Y.str}}),Object.defineProperty(X,"strConcat",{enumerable:!0,get:function(){return Y.strConcat}}),Object.defineProperty(X,"nil",{enumerable:!0,get:function(){return Y.nil}}),Object.defineProperty(X,"getProperty",{enumerable:!0,get:function(){return Y.getProperty}}),Object.defineProperty(X,"stringify",{enumerable:!0,get:function(){return Y.stringify}}),Object.defineProperty(X,"regexpCode",{enumerable:!0,get:function(){return Y.regexpCode}}),Object.defineProperty(X,"Name",{enumerable:!0,get:function(){return Y.Name}});var G=r5();Object.defineProperty(X,"Scope",{enumerable:!0,get:function(){return G.Scope}}),Object.defineProperty(X,"ValueScope",{enumerable:!0,get:function(){return G.ValueScope}}),Object.defineProperty(X,"ValueScopeName",{enumerable:!0,get:function(){return G.ValueScopeName}}),Object.defineProperty(X,"varKinds",{enumerable:!0,get:function(){return G.varKinds}}),X.operators={GT:new Q._Code(">"),GTE:new Q._Code(">="),LT:new Q._Code("<"),LTE:new Q._Code("<="),EQ:new Q._Code("==="),NEQ:new Q._Code("!=="),NOT:new Q._Code("!"),OR:new Q._Code("||"),AND:new Q._Code("&&"),ADD:new Q._Code("+")};class ${optimizeNodes(){return this}optimizeNames(N,T){return this}}class W extends ${constructor(N,T,C){super();this.varKind=N,this.name=T,this.rhs=C}render({es5:N,_n:T}){let C=N?J.varKinds.var:this.varKind,r=this.rhs===void 0?"":` = ${this.rhs}`;return`${C} ${this.name}${r};`+T}optimizeNames(N,T){if(!N[this.name.str])return;if(this.rhs)this.rhs=l(this.rhs,N,T);return this}get names(){return this.rhs instanceof Q._CodeOrName?this.rhs.names:{}}}class H extends ${constructor(N,T,C){super();this.lhs=N,this.rhs=T,this.sideEffects=C}render({_n:N}){return`${this.lhs} = ${this.rhs};`+N}optimizeNames(N,T){if(this.lhs instanceof Q.Name&&!N[this.lhs.str]&&!this.sideEffects)return;return this.rhs=l(this.rhs,N,T),this}get names(){let N=this.lhs instanceof Q.Name?{}:{...this.lhs.names};return u(N,this.rhs)}}class U extends H{constructor(N,T,C,r){super(N,C,r);this.op=T}render({_n:N}){return`${this.lhs} ${this.op}= ${this.rhs};`+N}}class z extends ${constructor(N){super();this.label=N,this.names={}}render({_n:N}){return`${this.label}:`+N}}class F extends ${constructor(N){super();this.label=N,this.names={}}render({_n:N}){return`break${this.label?` ${this.label}`:""};`+N}}class K extends ${constructor(N){super();this.error=N}render({_n:N}){return`throw ${this.error};`+N}get names(){return this.error.names}}class M extends ${constructor(N){super();this.code=N}render({_n:N}){return`${this.code};`+N}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(N,T){return this.code=l(this.code,N,T),this}get names(){return this.code instanceof Q._CodeOrName?this.code.names:{}}}class R extends ${constructor(N=[]){super();this.nodes=N}render(N){return this.nodes.reduce((T,C)=>T+C.render(N),"")}optimizeNodes(){let{nodes:N}=this,T=N.length;while(T--){let C=N[T].optimizeNodes();if(Array.isArray(C))N.splice(T,1,...C);else if(C)N[T]=C;else N.splice(T,1)}return N.length>0?this:void 0}optimizeNames(N,T){let{nodes:C}=this,r=C.length;while(r--){let X0=C[r];if(X0.optimizeNames(N,T))continue;Y0(N,X0.names),C.splice(r,1)}return C.length>0?this:void 0}get names(){return this.nodes.reduce((N,T)=>x(N,T.names),{})}}class w extends R{render(N){return"{"+N._n+super.render(N)+"}"+N._n}}class A extends R{}class Z extends w{}Z.kind="else";class B extends w{constructor(N,T){super(T);this.condition=N}render(N){let T=`if(${this.condition})`+super.render(N);if(this.else)T+="else "+this.else.render(N);return T}optimizeNodes(){super.optimizeNodes();let N=this.condition;if(N===!0)return this.nodes;let T=this.else;if(T){let C=T.optimizeNodes();T=this.else=Array.isArray(C)?new Z(C):C}if(T){if(N===!1)return T instanceof B?T:T.nodes;if(this.nodes.length)return this;return new B(Z0(N),T instanceof B?[T]:T.nodes)}if(N===!1||!this.nodes.length)return;return this}optimizeNames(N,T){var C;if(this.else=(C=this.else)===null||C===void 0?void 0:C.optimizeNames(N,T),!(super.optimizeNames(N,T)||this.else))return;return this.condition=l(this.condition,N,T),this}get names(){let N=super.names;if(u(N,this.condition),this.else)x(N,this.else.names);return N}}B.kind="if";class V extends w{}V.kind="for";class q extends V{constructor(N){super();this.iteration=N}render(N){return`for(${this.iteration})`+super.render(N)}optimizeNames(N,T){if(!super.optimizeNames(N,T))return;return this.iteration=l(this.iteration,N,T),this}get names(){return x(super.names,this.iteration.names)}}class L extends V{constructor(N,T,C,r){super();this.varKind=N,this.name=T,this.from=C,this.to=r}render(N){let T=N.es5?J.varKinds.var:this.varKind,{name:C,from:r,to:X0}=this;return`for(${T} ${C}=${r}; ${C}<${X0}; ${C}++)`+super.render(N)}get names(){let N=u(super.names,this.from);return u(N,this.to)}}class O extends V{constructor(N,T,C,r){super();this.loop=N,this.varKind=T,this.name=C,this.iterable=r}render(N){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(N)}optimizeNames(N,T){if(!super.optimizeNames(N,T))return;return this.iterable=l(this.iterable,N,T),this}get names(){return x(super.names,this.iterable.names)}}class D extends w{constructor(N,T,C){super();this.name=N,this.args=T,this.async=C}render(N){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(N)}}D.kind="func";class I extends R{render(N){return"return "+super.render(N)}}I.kind="return";class j extends w{render(N){let T="try"+super.render(N);if(this.catch)T+=this.catch.render(N);if(this.finally)T+=this.finally.render(N);return T}optimizeNodes(){var N,T;return super.optimizeNodes(),(N=this.catch)===null||N===void 0||N.optimizeNodes(),(T=this.finally)===null||T===void 0||T.optimizeNodes(),this}optimizeNames(N,T){var C,r;return super.optimizeNames(N,T),(C=this.catch)===null||C===void 0||C.optimizeNames(N,T),(r=this.finally)===null||r===void 0||r.optimizeNames(N,T),this}get names(){let N=super.names;if(this.catch)x(N,this.catch.names);if(this.finally)x(N,this.finally.names);return N}}class E extends w{constructor(N){super();this.error=N}render(N){return`catch(${this.error})`+super.render(N)}}E.kind="catch";class g extends w{render(N){return"finally"+super.render(N)}}g.kind="finally";class k{constructor(N,T={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...T,_n:T.lines?`
171
- `:""},this._extScope=N,this._scope=new J.Scope({parent:N}),this._nodes=[new A]}toString(){return this._root.render(this.opts)}name(N){return this._scope.name(N)}scopeName(N){return this._extScope.name(N)}scopeValue(N,T){let C=this._extScope.value(N,T);return(this._values[C.prefix]||(this._values[C.prefix]=new Set)).add(C),C}getScopeValue(N,T){return this._extScope.getValue(N,T)}scopeRefs(N){return this._extScope.scopeRefs(N,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(N,T,C,r){let X0=this._scope.toName(T);if(C!==void 0&&r)this._constants[X0.str]=C;return this._leafNode(new W(N,X0,C)),X0}const(N,T,C){return this._def(J.varKinds.const,N,T,C)}let(N,T,C){return this._def(J.varKinds.let,N,T,C)}var(N,T,C){return this._def(J.varKinds.var,N,T,C)}assign(N,T,C){return this._leafNode(new H(N,T,C))}add(N,T){return this._leafNode(new U(N,X.operators.ADD,T))}code(N){if(typeof N=="function")N();else if(N!==Q.nil)this._leafNode(new M(N));return this}object(...N){let T=["{"];for(let[C,r]of N){if(T.length>1)T.push(",");if(T.push(C),C!==r||this.opts.es5)T.push(":"),(0,Q.addCodeArg)(T,r)}return T.push("}"),new Q._Code(T)}if(N,T,C){if(this._blockNode(new B(N)),T&&C)this.code(T).else().code(C).endIf();else if(T)this.code(T).endIf();else if(C)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(N){return this._elseNode(new B(N))}else(){return this._elseNode(new Z)}endIf(){return this._endBlockNode(B,Z)}_for(N,T){if(this._blockNode(N),T)this.code(T).endFor();return this}for(N,T){return this._for(new q(N),T)}forRange(N,T,C,r,X0=this.opts.es5?J.varKinds.var:J.varKinds.let){let U0=this._scope.toName(N);return this._for(new L(X0,U0,T,C),()=>r(U0))}forOf(N,T,C,r=J.varKinds.const){let X0=this._scope.toName(N);if(this.opts.es5){let U0=T instanceof Q.Name?T:this.var("_arr",T);return this.forRange("_i",0,Q._`${U0}.length`,(Q0)=>{this.var(X0,Q._`${U0}[${Q0}]`),C(X0)})}return this._for(new O("of",r,X0,T),()=>C(X0))}forIn(N,T,C,r=this.opts.es5?J.varKinds.var:J.varKinds.const){if(this.opts.ownProperties)return this.forOf(N,Q._`Object.keys(${T})`,C);let X0=this._scope.toName(N);return this._for(new O("in",r,X0,T),()=>C(X0))}endFor(){return this._endBlockNode(V)}label(N){return this._leafNode(new z(N))}break(N){return this._leafNode(new F(N))}return(N){let T=new I;if(this._blockNode(T),this.code(N),T.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(I)}try(N,T,C){if(!T&&!C)throw Error('CodeGen: "try" without "catch" and "finally"');let r=new j;if(this._blockNode(r),this.code(N),T){let X0=this.name("e");this._currNode=r.catch=new E(X0),T(X0)}if(C)this._currNode=r.finally=new g,this.code(C);return this._endBlockNode(E,g)}throw(N){return this._leafNode(new K(N))}block(N,T){if(this._blockStarts.push(this._nodes.length),N)this.code(N).endBlock(T);return this}endBlock(N){let T=this._blockStarts.pop();if(T===void 0)throw Error("CodeGen: not in self-balancing block");let C=this._nodes.length-T;if(C<0||N!==void 0&&C!==N)throw Error(`CodeGen: wrong number of nodes: ${C} vs ${N} expected`);return this._nodes.length=T,this}func(N,T=Q.nil,C,r){if(this._blockNode(new D(N,T,C)),r)this.code(r).endFunc();return this}endFunc(){return this._endBlockNode(D)}optimize(N=1){while(N-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(N){return this._currNode.nodes.push(N),this}_blockNode(N){this._currNode.nodes.push(N),this._nodes.push(N)}_endBlockNode(N,T){let C=this._currNode;if(C instanceof N||T&&C instanceof T)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${T?`${N.kind}/${T.kind}`:N.kind}"`)}_elseNode(N){let T=this._currNode;if(!(T instanceof B))throw Error('CodeGen: "else" without "if"');return this._currNode=T.else=N,this}get _root(){return this._nodes[0]}get _currNode(){let N=this._nodes;return N[N.length-1]}set _currNode(N){let T=this._nodes;T[T.length-1]=N}}X.CodeGen=k;function x(N,T){for(let C in T)N[C]=(N[C]||0)+(T[C]||0);return N}function u(N,T){return T instanceof Q._CodeOrName?x(N,T.names):N}function l(N,T,C){if(N instanceof Q.Name)return r(N);if(!X0(N))return N;return new Q._Code(N._items.reduce((U0,Q0)=>{if(Q0 instanceof Q.Name)Q0=r(Q0);if(Q0 instanceof Q._Code)U0.push(...Q0._items);else U0.push(Q0);return U0},[]));function r(U0){let Q0=C[U0.str];if(Q0===void 0||T[U0.str]!==1)return U0;return delete T[U0.str],Q0}function X0(U0){return U0 instanceof Q._Code&&U0._items.some((Q0)=>Q0 instanceof Q.Name&&T[Q0.str]===1&&C[Q0.str]!==void 0)}}function Y0(N,T){for(let C in T)N[C]=(N[C]||0)-(T[C]||0)}function Z0(N){return typeof N=="boolean"||typeof N=="number"||N===null?!N:Q._`!${f(N)}`}X.not=Z0;var _0=b(X.operators.AND);function h0(...N){return N.reduce(_0)}X.and=h0;var q0=b(X.operators.OR);function S(...N){return N.reduce(q0)}X.or=S;function b(N){return(T,C)=>T===Q.nil?C:C===Q.nil?T:Q._`${f(T)} ${N} ${f(C)}`}function f(N){return N instanceof Q.Name?N:Q._`(${N})`}}),M0=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.checkStrictMode=X.getErrorPath=X.Type=X.useFunc=X.setEvaluated=X.evaluatedPropsToName=X.mergeEvaluated=X.eachItem=X.unescapeJsonPointer=X.escapeJsonPointer=X.escapeFragment=X.unescapeFragment=X.schemaRefOrVal=X.schemaHasRulesButRef=X.schemaHasRules=X.checkUnknownRules=X.alwaysValidSchema=X.toHash=void 0;var Q=z0(),J=p8();function Y(D){let I={};for(let j of D)I[j]=!0;return I}X.toHash=Y;function G(D,I){if(typeof I=="boolean")return I;if(Object.keys(I).length===0)return!0;return $(D,I),!W(I,D.self.RULES.all)}X.alwaysValidSchema=G;function $(D,I=D.schema){let{opts:j,self:E}=D;if(!j.strictSchema)return;if(typeof I==="boolean")return;let g=E.RULES.keywords;for(let k in I)if(!g[k])O(D,`unknown keyword: "${k}"`)}X.checkUnknownRules=$;function W(D,I){if(typeof D=="boolean")return!D;for(let j in D)if(I[j])return!0;return!1}X.schemaHasRules=W;function H(D,I){if(typeof D=="boolean")return!D;for(let j in D)if(j!=="$ref"&&I.all[j])return!0;return!1}X.schemaHasRulesButRef=H;function U({topSchemaRef:D,schemaPath:I},j,E,g){if(!g){if(typeof j=="number"||typeof j=="boolean")return j;if(typeof j=="string")return Q._`${j}`}return Q._`${D}${I}${(0,Q.getProperty)(E)}`}X.schemaRefOrVal=U;function z(D){return M(decodeURIComponent(D))}X.unescapeFragment=z;function F(D){return encodeURIComponent(K(D))}X.escapeFragment=F;function K(D){if(typeof D=="number")return`${D}`;return D.replace(/~/g,"~0").replace(/\//g,"~1")}X.escapeJsonPointer=K;function M(D){return D.replace(/~1/g,"/").replace(/~0/g,"~")}X.unescapeJsonPointer=M;function R(D,I){if(Array.isArray(D))for(let j of D)I(j);else I(D)}X.eachItem=R;function w({mergeNames:D,mergeToName:I,mergeValues:j,resultToName:E}){return(g,k,x,u)=>{let l=x===void 0?k:x instanceof Q.Name?(k instanceof Q.Name?D(g,k,x):I(g,k,x),x):k instanceof Q.Name?(I(g,x,k),k):j(k,x);return u===Q.Name&&!(l instanceof Q.Name)?E(g,l):l}}X.mergeEvaluated={props:w({mergeNames:(D,I,j)=>D.if(Q._`${j} !== true && ${I} !== undefined`,()=>{D.if(Q._`${I} === true`,()=>D.assign(j,!0),()=>D.assign(j,Q._`${j} || {}`).code(Q._`Object.assign(${j}, ${I})`))}),mergeToName:(D,I,j)=>D.if(Q._`${j} !== true`,()=>{if(I===!0)D.assign(j,!0);else D.assign(j,Q._`${j} || {}`),Z(D,j,I)}),mergeValues:(D,I)=>D===!0?!0:{...D,...I},resultToName:A}),items:w({mergeNames:(D,I,j)=>D.if(Q._`${j} !== true && ${I} !== undefined`,()=>D.assign(j,Q._`${I} === true ? true : ${j} > ${I} ? ${j} : ${I}`)),mergeToName:(D,I,j)=>D.if(Q._`${j} !== true`,()=>D.assign(j,I===!0?!0:Q._`${j} > ${I} ? ${j} : ${I}`)),mergeValues:(D,I)=>D===!0?!0:Math.max(D,I),resultToName:(D,I)=>D.var("items",I)})};function A(D,I){if(I===!0)return D.var("props",!0);let j=D.var("props",Q._`{}`);if(I!==void 0)Z(D,j,I);return j}X.evaluatedPropsToName=A;function Z(D,I,j){Object.keys(j).forEach((E)=>D.assign(Q._`${I}${(0,Q.getProperty)(E)}`,!0))}X.setEvaluated=Z;var B={};function V(D,I){return D.scopeValue("func",{ref:I,code:B[I.code]||(B[I.code]=new J._Code(I.code))})}X.useFunc=V;var q;(function(D){D[D.Num=0]="Num",D[D.Str=1]="Str"})(q||(X.Type=q={}));function L(D,I,j){if(D instanceof Q.Name){let E=I===q.Num;return j?E?Q._`"[" + ${D} + "]"`:Q._`"['" + ${D} + "']"`:E?Q._`"/" + ${D}`:Q._`"/" + ${D}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return j?(0,Q.getProperty)(D).toString():"/"+K(D)}X.getErrorPath=L;function O(D,I,j=D.opts.strictSchema){if(!j)return;if(I=`strict mode: ${I}`,j===!0)throw Error(I);D.self.logger.warn(I)}X.checkStrictMode=O}),v1=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=z0(),J={data:new Q.Name("data"),valCxt:new Q.Name("valCxt"),instancePath:new Q.Name("instancePath"),parentData:new Q.Name("parentData"),parentDataProperty:new Q.Name("parentDataProperty"),rootData:new Q.Name("rootData"),dynamicAnchors:new Q.Name("dynamicAnchors"),vErrors:new Q.Name("vErrors"),errors:new Q.Name("errors"),this:new Q.Name("this"),self:new Q.Name("self"),scope:new Q.Name("scope"),json:new Q.Name("json"),jsonPos:new Q.Name("jsonPos"),jsonLen:new Q.Name("jsonLen"),jsonPart:new Q.Name("jsonPart")};X.default=J}),Y6=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.extendErrors=X.resetErrorsCount=X.reportExtraError=X.reportError=X.keyword$DataError=X.keywordError=void 0;var Q=z0(),J=M0(),Y=v1();X.keywordError={message:({keyword:Z})=>Q.str`must pass "${Z}" keyword validation`},X.keyword$DataError={message:({keyword:Z,schemaType:B})=>B?Q.str`"${Z}" keyword must be ${B} ($data)`:Q.str`"${Z}" keyword is invalid ($data)`};function G(Z,B=X.keywordError,V,q){let{it:L}=Z,{gen:O,compositeRule:D,allErrors:I}=L,j=K(Z,B,V);if(q!==null&&q!==void 0?q:D||I)U(O,j);else z(L,Q._`[${j}]`)}X.reportError=G;function $(Z,B=X.keywordError,V){let{it:q}=Z,{gen:L,compositeRule:O,allErrors:D}=q,I=K(Z,B,V);if(U(L,I),!(O||D))z(q,Y.default.vErrors)}X.reportExtraError=$;function W(Z,B){Z.assign(Y.default.errors,B),Z.if(Q._`${Y.default.vErrors} !== null`,()=>Z.if(B,()=>Z.assign(Q._`${Y.default.vErrors}.length`,B),()=>Z.assign(Y.default.vErrors,null)))}X.resetErrorsCount=W;function H({gen:Z,keyword:B,schemaValue:V,data:q,errsCount:L,it:O}){if(L===void 0)throw Error("ajv implementation error");let D=Z.name("err");Z.forRange("i",L,Y.default.errors,(I)=>{if(Z.const(D,Q._`${Y.default.vErrors}[${I}]`),Z.if(Q._`${D}.instancePath === undefined`,()=>Z.assign(Q._`${D}.instancePath`,(0,Q.strConcat)(Y.default.instancePath,O.errorPath))),Z.assign(Q._`${D}.schemaPath`,Q.str`${O.errSchemaPath}/${B}`),O.opts.verbose)Z.assign(Q._`${D}.schema`,V),Z.assign(Q._`${D}.data`,q)})}X.extendErrors=H;function U(Z,B){let V=Z.const("err",B);Z.if(Q._`${Y.default.vErrors} === null`,()=>Z.assign(Y.default.vErrors,Q._`[${V}]`),Q._`${Y.default.vErrors}.push(${V})`),Z.code(Q._`${Y.default.errors}++`)}function z(Z,B){let{gen:V,validateName:q,schemaEnv:L}=Z;if(L.$async)V.throw(Q._`new ${Z.ValidationError}(${B})`);else V.assign(Q._`${q}.errors`,B),V.return(!1)}var F={keyword:new Q.Name("keyword"),schemaPath:new Q.Name("schemaPath"),params:new Q.Name("params"),propertyName:new Q.Name("propertyName"),message:new Q.Name("message"),schema:new Q.Name("schema"),parentSchema:new Q.Name("parentSchema")};function K(Z,B,V){let{createErrors:q}=Z.it;if(q===!1)return Q._`{}`;return M(Z,B,V)}function M(Z,B,V={}){let{gen:q,it:L}=Z,O=[R(L,V),w(Z,V)];return A(Z,B,O),q.object(...O)}function R({errorPath:Z},{instancePath:B}){let V=B?Q.str`${Z}${(0,J.getErrorPath)(B,J.Type.Str)}`:Z;return[Y.default.instancePath,(0,Q.strConcat)(Y.default.instancePath,V)]}function w({keyword:Z,it:{errSchemaPath:B}},{schemaPath:V,parentSchema:q}){let L=q?B:Q.str`${B}/${Z}`;if(V)L=Q.str`${L}${(0,J.getErrorPath)(V,J.Type.Str)}`;return[F.schemaPath,L]}function A(Z,{params:B,message:V},q){let{keyword:L,data:O,schemaValue:D,it:I}=Z,{opts:j,propertyName:E,topSchemaRef:g,schemaPath:k}=I;if(q.push([F.keyword,L],[F.params,typeof B=="function"?B(Z):B||Q._`{}`]),j.messages)q.push([F.message,typeof V=="function"?V(Z):V]);if(j.verbose)q.push([F.schema,D],[F.parentSchema,Q._`${g}${k}`],[Y.default.data,O]);if(E)q.push([F.propertyName,E])}}),a$=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.boolOrEmptySchema=X.topBoolOrEmptySchema=void 0;var Q=Y6(),J=z0(),Y=v1(),G={message:"boolean schema is false"};function $(U){let{gen:z,schema:F,validateName:K}=U;if(F===!1)H(U,!1);else if(typeof F=="object"&&F.$async===!0)z.return(Y.default.data);else z.assign(J._`${K}.errors`,null),z.return(!0)}X.topBoolOrEmptySchema=$;function W(U,z){let{gen:F,schema:K}=U;if(K===!1)F.var(z,!1),H(U);else F.var(z,!0)}X.boolOrEmptySchema=W;function H(U,z){let{gen:F,data:K}=U,M={gen:F,keyword:"false schema",data:K,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:U};(0,Q.reportError)(M,G,void 0,z)}}),b4=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.getRules=X.isJSONType=void 0;var Q=["string","number","integer","boolean","null","object","array"],J=new Set(Q);function Y($){return typeof $=="string"&&J.has($)}X.isJSONType=Y;function G(){let $={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...$,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},$.number,$.string,$.array,$.object],post:{rules:[]},all:{},keywords:{}}}X.getRules=G}),C4=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.shouldUseRule=X.shouldUseGroup=X.schemaHasRulesForType=void 0;function Q({schema:G,self:$},W){let H=$.RULES.types[W];return H&&H!==!0&&J(G,H)}X.schemaHasRulesForType=Q;function J(G,$){return $.rules.some((W)=>Y(G,W))}X.shouldUseGroup=J;function Y(G,$){var W;return G[$.keyword]!==void 0||((W=$.definition.implements)===null||W===void 0?void 0:W.some((H)=>G[H]!==void 0))}X.shouldUseRule=Y}),d8=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.reportTypeError=X.checkDataTypes=X.checkDataType=X.coerceAndCheckDataType=X.getJSONTypes=X.getSchemaTypes=X.DataType=void 0;var Q=b4(),J=C4(),Y=Y6(),G=z0(),$=M0(),W;(function(q){q[q.Correct=0]="Correct",q[q.Wrong=1]="Wrong"})(W||(X.DataType=W={}));function H(q){let L=U(q.type);if(L.includes("null")){if(q.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!L.length&&q.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if(q.nullable===!0)L.push("null")}return L}X.getSchemaTypes=H;function U(q){let L=Array.isArray(q)?q:q?[q]:[];if(L.every(Q.isJSONType))return L;throw Error("type must be JSONType or JSONType[]: "+L.join(","))}X.getJSONTypes=U;function z(q,L){let{gen:O,data:D,opts:I}=q,j=K(L,I.coerceTypes),E=L.length>0&&!(j.length===0&&L.length===1&&(0,J.schemaHasRulesForType)(q,L[0]));if(E){let g=A(L,D,I.strictNumbers,W.Wrong);O.if(g,()=>{if(j.length)M(q,L,j);else B(q)})}return E}X.coerceAndCheckDataType=z;var F=new Set(["string","number","integer","boolean","null"]);function K(q,L){return L?q.filter((O)=>F.has(O)||L==="array"&&O==="array"):[]}function M(q,L,O){let{gen:D,data:I,opts:j}=q,E=D.let("dataType",G._`typeof ${I}`),g=D.let("coerced",G._`undefined`);if(j.coerceTypes==="array")D.if(G._`${E} == 'object' && Array.isArray(${I}) && ${I}.length == 1`,()=>D.assign(I,G._`${I}[0]`).assign(E,G._`typeof ${I}`).if(A(L,I,j.strictNumbers),()=>D.assign(g,I)));D.if(G._`${g} !== undefined`);for(let x of O)if(F.has(x)||x==="array"&&j.coerceTypes==="array")k(x);D.else(),B(q),D.endIf(),D.if(G._`${g} !== undefined`,()=>{D.assign(I,g),R(q,g)});function k(x){switch(x){case"string":D.elseIf(G._`${E} == "number" || ${E} == "boolean"`).assign(g,G._`"" + ${I}`).elseIf(G._`${I} === null`).assign(g,G._`""`);return;case"number":D.elseIf(G._`${E} == "boolean" || ${I} === null
166
+ `,Q)+1}return{type:X,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(X){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 Q=QX(X),J=C9(Q);return J.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:J,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let Q=QX(X),J=C9(Q);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:J,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(X,Q){if(this.type!=="comment")return!1;if(this.indent<=Q)return!1;return X.every((J)=>J.type==="newline"||J.type==="space")}*documentEnd(X){if(this.type!=="doc-mode"){if(X.end)X.end.push(this.sourceToken);else X.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd(X){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(X.end)X.end.push(this.sourceToken);else X.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}SI.Parser=OG});var jG=p((gI)=>{var AG=J4(),bI=w8(),C8=P8(),CI=qQ(),_I=K0(),kI=q4(),NG=F4();function RG(X){let Q=X.prettyErrors!==!1;return{lineCounter:X.lineCounter||Q&&new kI.LineCounter||null,prettyErrors:Q}}function vI(X,Q={}){let{lineCounter:J,prettyErrors:Y}=RG(Q),G=new NG.Parser(J?.addNewLine),$=new AG.Composer(Q),W=Array.from($.compose(G.parse(X)));if(Y&&J)for(let H of W)H.errors.forEach(C8.prettifyError(X,J)),H.warnings.forEach(C8.prettifyError(X,J));if(W.length>0)return W;return Object.assign([],{empty:!0},$.streamInfo())}function IG(X,Q={}){let{lineCounter:J,prettyErrors:Y}=RG(Q),G=new NG.Parser(J?.addNewLine),$=new AG.Composer(Q),W=null;for(let H of $.compose(G.parse(X),!0,X.length))if(!W)W=H;else if(W.options.logLevel!=="silent"){W.errors.push(new C8.YAMLParseError(H.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(Y&&J)W.errors.forEach(C8.prettifyError(X,J)),W.warnings.forEach(C8.prettifyError(X,J));return W}function yI(X,Q,J){let Y=void 0;if(typeof Q==="function")Y=Q;else if(J===void 0&&Q&&typeof Q==="object")J=Q;let G=IG(X,J);if(!G)return null;if(G.warnings.forEach(($)=>CI.warn(G.options.logLevel,$)),G.errors.length>0)if(G.options.logLevel!=="silent")throw G.errors[0];else G.errors=[];return G.toJS(Object.assign({reviver:Y},J))}function xI(X,Q,J){let Y=null;if(typeof Q==="function"||Array.isArray(Q))Y=Q;else if(J===void 0&&Q)J=Q;if(typeof J==="string")J=J.length;if(typeof J==="number"){let G=Math.round(J);J=G<1?void 0:G>8?{indent:8}:{indent:G}}if(X===void 0){let{keepUndefined:G}=J??Q??{};if(!G)return}if(_I.isDocument(X)&&!Y)return X.toString(J);return new bI.Document(X,Y,J).toString(J)}gI.parse=yI;gI.parseAllDocuments=vI;gI.parseDocument=IG;gI.stringify=xI});var PG=p((Xj)=>{var lI=J4(),cI=w8(),pI=uQ(),K4=P8(),dI=z8(),p1=K0(),iI=f1(),nI=v0(),rI=m1(),oI=l1(),aI=e6(),sI=L4(),tI=q4(),eI=F4(),JX=jG(),wG=U8();Xj.Composer=lI.Composer;Xj.Document=cI.Document;Xj.Schema=pI.Schema;Xj.YAMLError=K4.YAMLError;Xj.YAMLParseError=K4.YAMLParseError;Xj.YAMLWarning=K4.YAMLWarning;Xj.Alias=dI.Alias;Xj.isAlias=p1.isAlias;Xj.isCollection=p1.isCollection;Xj.isDocument=p1.isDocument;Xj.isMap=p1.isMap;Xj.isNode=p1.isNode;Xj.isPair=p1.isPair;Xj.isScalar=p1.isScalar;Xj.isSeq=p1.isSeq;Xj.Pair=iI.Pair;Xj.Scalar=nI.Scalar;Xj.YAMLMap=rI.YAMLMap;Xj.YAMLSeq=oI.YAMLSeq;Xj.CST=aI;Xj.Lexer=sI.Lexer;Xj.LineCounter=tI.LineCounter;Xj.Parser=eI.Parser;Xj.parse=JX.parse;Xj.parseAllDocuments=JX.parseAllDocuments;Xj.parseDocument=JX.parseDocument;Xj.stringify=JX.stringify;Xj.visit=wG.visit;Xj.visitAsync=wG.visitAsync});var m4=j4(u4(),1),{program:x9,createCommand:$w,createArgument:Ww,createOption:Hw,CommanderError:Uw,InvalidArgumentError:Bw,InvalidOptionArgumentError:zw,Command:Lw,Argument:qw,Option:Fw,Help:Kw}=m4.default;var l4={name:"@pickled-dev/cli",version:"0.2.0",description:"Stay fresh in AI 🥒",module:"dist/index.js",type:"module",bin:{pickled:"./dist/index.js"},files:["dist"],scripts:{dev:"bun run ./src/index.ts",build:"bun build ./src/index.ts --outdir ./dist --target node --minify",release:"semantic-release"},dependencies:{commander:"^14.0.2",chalk:"^5.6.2"},devDependencies:{"@pickled-dev/core":"workspace:*","semantic-release":"^25.0.2","@semantic-release/commit-analyzer":"^13.0.1","@semantic-release/exec":"^7.1.0","@semantic-release/git":"^10.0.1","@semantic-release/github":"^12.0.2"}};import nj from"node:path";import c4 from"node:path";function u$(X){return X.startsWith("http://")||X.startsWith("https://")}async function m$(X){let Q=new URL("/llms.txt",X).href,J=await fetch(Q);if(!J.ok){if(J=await fetch(X),!J.ok)throw Error(`No llms.txt found at ${X}`)}let Y=await J.text(),G=new URL(X).hostname;return{content:Y,name:`llms.txt from ${G}`,type:"url"}}async function l$(X){let Q=c4.resolve(X),J=Bun.file(Q);if(!await J.exists())throw Error(`File not found: ${Q}`);return{content:await J.text(),name:c4.basename(Q),type:"file"}}async function MX(X){if(X.startsWith("mcp:"))return{content:"",name:X,type:"mcp"};if(u$(X))return m$(X);return l$(X)}function DX(X){return{content:"",name:`codebase at ${X}`,type:"codebase"}}import{join as d4}from"path";import{fileURLToPath as pW}from"url";import{setMaxListeners as dW}from"events";import{spawn as nW}from"child_process";import{createInterface as rW}from"readline";import*as W0 from"fs";import{stat as oW,open as ww}from"fs/promises";import{join as fU}from"path";import{homedir as uU}from"os";import{dirname as jX,join as f5}from"path";import{cwd as mU}from"process";import{realpathSync as lU}from"fs";import{randomUUID as cU}from"crypto";import{randomUUID as WB}from"crypto";import{appendFileSync as HB,existsSync as UB,mkdirSync as BB}from"fs";import{join as e4}from"path";import{randomUUID as FB}from"crypto";var{create:c$,getPrototypeOf:p$,defineProperty:IX,getOwnPropertyNames:d$}=Object,i$=Object.prototype.hasOwnProperty,j5=(X,Q,J)=>{J=X!=null?c$(p$(X)):{};let Y=Q||!X||!X.__esModule?IX(J,"default",{value:X,enumerable:!0}):J;for(let G of d$(X))if(!i$.call(Y,G))IX(Y,G,{get:()=>X[G],enumerable:!0});return Y},i=(X,Q)=>()=>(Q||X((Q={exports:{}}).exports,Q),Q.exports),w5=(X,Q)=>{for(var J in Q)IX(X,J,{get:Q[J],enumerable:!0,configurable:!0,set:(Y)=>Q[J]=()=>Y})};var l8=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.regexpCode=X.getEsmExportName=X.getProperty=X.safeStringify=X.stringify=X.strConcat=X.addCodeArg=X.str=X._=X.nil=X._Code=X.Name=X.IDENTIFIER=X._CodeOrName=void 0;class Q{}X._CodeOrName=Q,X.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class J extends Q{constructor(z){super();if(!X.IDENTIFIER.test(z))throw Error("CodeGen: name must be a valid identifier");this.str=z}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}X.Name=J;class Y extends Q{constructor(z){super();this._items=typeof z==="string"?[z]:z}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let z=this._items[0];return z===""||z==='""'}get str(){var z;return(z=this._str)!==null&&z!==void 0?z:this._str=this._items.reduce((M,F)=>`${M}${F}`,"")}get names(){var z;return(z=this._names)!==null&&z!==void 0?z:this._names=this._items.reduce((M,F)=>{if(F instanceof J)M[F.str]=(M[F.str]||0)+1;return M},{})}}X._Code=Y,X.nil=new Y("");function G(z,...M){let F=[z[0]],L=0;while(L<M.length)H(F,M[L]),F.push(z[++L]);return new Y(F)}X._=G;var $=new Y("+");function W(z,...M){let F=[N(z[0])],L=0;while(L<M.length)F.push($),H(F,M[L]),F.push($,N(z[++L]));return U(F),new Y(F)}X.str=W;function H(z,M){if(M instanceof Y)z.push(...M._items);else if(M instanceof J)z.push(M);else z.push(K(M))}X.addCodeArg=H;function U(z){let M=1;while(M<z.length-1){if(z[M]===$){let F=B(z[M-1],z[M+1]);if(F!==void 0){z.splice(M-1,3,F);continue}z[M++]="+"}M++}}function B(z,M){if(M==='""')return z;if(z==='""')return M;if(typeof z=="string"){if(M instanceof J||z[z.length-1]!=='"')return;if(typeof M!="string")return`${z.slice(0,-1)}${M}"`;if(M[0]==='"')return z.slice(0,-1)+M.slice(1);return}if(typeof M=="string"&&M[0]==='"'&&!(z instanceof J))return`"${z}${M.slice(1)}`;return}function q(z,M){return M.emptyStr()?z:z.emptyStr()?M:W`${z}${M}`}X.strConcat=q;function K(z){return typeof z=="number"||typeof z=="boolean"||z===null?z:N(Array.isArray(z)?z.join(","):z)}function V(z){return new Y(N(z))}X.stringify=V;function N(z){return JSON.stringify(z).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}X.safeStringify=N;function w(z){return typeof z=="string"&&X.IDENTIFIER.test(z)?new Y(`.${z}`):G`[${z}]`}X.getProperty=w;function A(z){if(typeof z=="string"&&X.IDENTIFIER.test(z))return new Y(`${z}`);throw Error(`CodeGen: invalid export name: ${z}, use explicit $id name mapping`)}X.getEsmExportName=A;function Z(z){return new Y(z.toString())}X.regexpCode=Z}),p4=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.ValueScope=X.ValueScopeName=X.Scope=X.varKinds=X.UsedValueState=void 0;var Q=l8();class J extends Error{constructor(U){super(`CodeGen: "code" for ${U} not defined`);this.value=U.value}}var Y;(function(U){U[U.Started=0]="Started",U[U.Completed=1]="Completed"})(Y||(X.UsedValueState=Y={})),X.varKinds={const:new Q.Name("const"),let:new Q.Name("let"),var:new Q.Name("var")};class G{constructor({prefixes:U,parent:B}={}){this._names={},this._prefixes=U,this._parent=B}toName(U){return U instanceof Q.Name?U:this.name(U)}name(U){return new Q.Name(this._newName(U))}_newName(U){let B=this._names[U]||this._nameGroup(U);return`${U}${B.index++}`}_nameGroup(U){var B,q;if(((q=(B=this._parent)===null||B===void 0?void 0:B._prefixes)===null||q===void 0?void 0:q.has(U))||this._prefixes&&!this._prefixes.has(U))throw Error(`CodeGen: prefix "${U}" is not allowed in this scope`);return this._names[U]={prefix:U,index:0}}}X.Scope=G;class $ extends Q.Name{constructor(U,B){super(B);this.prefix=U}setValue(U,{property:B,itemIndex:q}){this.value=U,this.scopePath=Q._`.${new Q.Name(B)}[${q}]`}}X.ValueScopeName=$;var W=Q._`\n`;class H extends G{constructor(U){super(U);this._values={},this._scope=U.scope,this.opts={...U,_n:U.lines?W:Q.nil}}get(){return this._scope}name(U){return new $(U,this._newName(U))}value(U,B){var q;if(B.ref===void 0)throw Error("CodeGen: ref must be passed in value");let K=this.toName(U),{prefix:V}=K,N=(q=B.key)!==null&&q!==void 0?q:B.ref,w=this._values[V];if(w){let z=w.get(N);if(z)return z}else w=this._values[V]=new Map;w.set(N,K);let A=this._scope[V]||(this._scope[V]=[]),Z=A.length;return A[Z]=B.ref,K.setValue(B,{property:V,itemIndex:Z}),K}getValue(U,B){let q=this._values[U];if(!q)return;return q.get(B)}scopeRefs(U,B=this._values){return this._reduceValues(B,(q)=>{if(q.scopePath===void 0)throw Error(`CodeGen: name "${q}" has no value`);return Q._`${U}${q.scopePath}`})}scopeCode(U=this._values,B,q){return this._reduceValues(U,(K)=>{if(K.value===void 0)throw Error(`CodeGen: name "${K}" has no value`);return K.value.code},B,q)}_reduceValues(U,B,q={},K){let V=Q.nil;for(let N in U){let w=U[N];if(!w)continue;let A=q[N]=q[N]||new Map;w.forEach((Z)=>{if(A.has(Z))return;A.set(Z,Y.Started);let z=B(Z);if(z){let M=this.opts.es5?X.varKinds.var:X.varKinds.const;V=Q._`${V}${M} ${Z} = ${z};${this.opts._n}`}else if(z=K===null||K===void 0?void 0:K(Z))V=Q._`${V}${z}${this.opts._n}`;else throw new J(Z);A.set(Z,Y.Completed)})}return V}}X.ValueScope=H}),B0=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.or=X.and=X.not=X.CodeGen=X.operators=X.varKinds=X.ValueScopeName=X.ValueScope=X.Scope=X.Name=X.regexpCode=X.stringify=X.getProperty=X.nil=X.strConcat=X.str=X._=void 0;var Q=l8(),J=p4(),Y=l8();Object.defineProperty(X,"_",{enumerable:!0,get:function(){return Y._}}),Object.defineProperty(X,"str",{enumerable:!0,get:function(){return Y.str}}),Object.defineProperty(X,"strConcat",{enumerable:!0,get:function(){return Y.strConcat}}),Object.defineProperty(X,"nil",{enumerable:!0,get:function(){return Y.nil}}),Object.defineProperty(X,"getProperty",{enumerable:!0,get:function(){return Y.getProperty}}),Object.defineProperty(X,"stringify",{enumerable:!0,get:function(){return Y.stringify}}),Object.defineProperty(X,"regexpCode",{enumerable:!0,get:function(){return Y.regexpCode}}),Object.defineProperty(X,"Name",{enumerable:!0,get:function(){return Y.Name}});var G=p4();Object.defineProperty(X,"Scope",{enumerable:!0,get:function(){return G.Scope}}),Object.defineProperty(X,"ValueScope",{enumerable:!0,get:function(){return G.ValueScope}}),Object.defineProperty(X,"ValueScopeName",{enumerable:!0,get:function(){return G.ValueScopeName}}),Object.defineProperty(X,"varKinds",{enumerable:!0,get:function(){return G.varKinds}}),X.operators={GT:new Q._Code(">"),GTE:new Q._Code(">="),LT:new Q._Code("<"),LTE:new Q._Code("<="),EQ:new Q._Code("==="),NEQ:new Q._Code("!=="),NOT:new Q._Code("!"),OR:new Q._Code("||"),AND:new Q._Code("&&"),ADD:new Q._Code("+")};class ${optimizeNodes(){return this}optimizeNames(R,T){return this}}class W extends ${constructor(R,T,C){super();this.varKind=R,this.name=T,this.rhs=C}render({es5:R,_n:T}){let C=R?J.varKinds.var:this.varKind,r=this.rhs===void 0?"":` = ${this.rhs}`;return`${C} ${this.name}${r};`+T}optimizeNames(R,T){if(!R[this.name.str])return;if(this.rhs)this.rhs=l(this.rhs,R,T);return this}get names(){return this.rhs instanceof Q._CodeOrName?this.rhs.names:{}}}class H extends ${constructor(R,T,C){super();this.lhs=R,this.rhs=T,this.sideEffects=C}render({_n:R}){return`${this.lhs} = ${this.rhs};`+R}optimizeNames(R,T){if(this.lhs instanceof Q.Name&&!R[this.lhs.str]&&!this.sideEffects)return;return this.rhs=l(this.rhs,R,T),this}get names(){let R=this.lhs instanceof Q.Name?{}:{...this.lhs.names};return u(R,this.rhs)}}class U extends H{constructor(R,T,C,r){super(R,C,r);this.op=T}render({_n:R}){return`${this.lhs} ${this.op}= ${this.rhs};`+R}}class B extends ${constructor(R){super();this.label=R,this.names={}}render({_n:R}){return`${this.label}:`+R}}class q extends ${constructor(R){super();this.label=R,this.names={}}render({_n:R}){return`break${this.label?` ${this.label}`:""};`+R}}class K extends ${constructor(R){super();this.error=R}render({_n:R}){return`throw ${this.error};`+R}get names(){return this.error.names}}class V extends ${constructor(R){super();this.code=R}render({_n:R}){return`${this.code};`+R}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(R,T){return this.code=l(this.code,R,T),this}get names(){return this.code instanceof Q._CodeOrName?this.code.names:{}}}class N extends ${constructor(R=[]){super();this.nodes=R}render(R){return this.nodes.reduce((T,C)=>T+C.render(R),"")}optimizeNodes(){let{nodes:R}=this,T=R.length;while(T--){let C=R[T].optimizeNodes();if(Array.isArray(C))R.splice(T,1,...C);else if(C)R[T]=C;else R.splice(T,1)}return R.length>0?this:void 0}optimizeNames(R,T){let{nodes:C}=this,r=C.length;while(r--){let X0=C[r];if(X0.optimizeNames(R,T))continue;Y0(R,X0.names),C.splice(r,1)}return C.length>0?this:void 0}get names(){return this.nodes.reduce((R,T)=>x(R,T.names),{})}}class w extends N{render(R){return"{"+R._n+super.render(R)+"}"+R._n}}class A extends N{}class Z extends w{}Z.kind="else";class z extends w{constructor(R,T){super(T);this.condition=R}render(R){let T=`if(${this.condition})`+super.render(R);if(this.else)T+="else "+this.else.render(R);return T}optimizeNodes(){super.optimizeNodes();let R=this.condition;if(R===!0)return this.nodes;let T=this.else;if(T){let C=T.optimizeNodes();T=this.else=Array.isArray(C)?new Z(C):C}if(T){if(R===!1)return T instanceof z?T:T.nodes;if(this.nodes.length)return this;return new z(O0(R),T instanceof z?[T]:T.nodes)}if(R===!1||!this.nodes.length)return;return this}optimizeNames(R,T){var C;if(this.else=(C=this.else)===null||C===void 0?void 0:C.optimizeNames(R,T),!(super.optimizeNames(R,T)||this.else))return;return this.condition=l(this.condition,R,T),this}get names(){let R=super.names;if(u(R,this.condition),this.else)x(R,this.else.names);return R}}z.kind="if";class M extends w{}M.kind="for";class F extends M{constructor(R){super();this.iteration=R}render(R){return`for(${this.iteration})`+super.render(R)}optimizeNames(R,T){if(!super.optimizeNames(R,T))return;return this.iteration=l(this.iteration,R,T),this}get names(){return x(super.names,this.iteration.names)}}class L extends M{constructor(R,T,C,r){super();this.varKind=R,this.name=T,this.from=C,this.to=r}render(R){let T=R.es5?J.varKinds.var:this.varKind,{name:C,from:r,to:X0}=this;return`for(${T} ${C}=${r}; ${C}<${X0}; ${C}++)`+super.render(R)}get names(){let R=u(super.names,this.from);return u(R,this.to)}}class O extends M{constructor(R,T,C,r){super();this.loop=R,this.varKind=T,this.name=C,this.iterable=r}render(R){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(R)}optimizeNames(R,T){if(!super.optimizeNames(R,T))return;return this.iterable=l(this.iterable,R,T),this}get names(){return x(super.names,this.iterable.names)}}class D extends w{constructor(R,T,C){super();this.name=R,this.args=T,this.async=C}render(R){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(R)}}D.kind="func";class I extends N{render(R){return"return "+super.render(R)}}I.kind="return";class j extends w{render(R){let T="try"+super.render(R);if(this.catch)T+=this.catch.render(R);if(this.finally)T+=this.finally.render(R);return T}optimizeNodes(){var R,T;return super.optimizeNodes(),(R=this.catch)===null||R===void 0||R.optimizeNodes(),(T=this.finally)===null||T===void 0||T.optimizeNodes(),this}optimizeNames(R,T){var C,r;return super.optimizeNames(R,T),(C=this.catch)===null||C===void 0||C.optimizeNames(R,T),(r=this.finally)===null||r===void 0||r.optimizeNames(R,T),this}get names(){let R=super.names;if(this.catch)x(R,this.catch.names);if(this.finally)x(R,this.finally.names);return R}}class E extends w{constructor(R){super();this.error=R}render(R){return`catch(${this.error})`+super.render(R)}}E.kind="catch";class g extends w{render(R){return"finally"+super.render(R)}}g.kind="finally";class k{constructor(R,T={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...T,_n:T.lines?`
167
+ `:""},this._extScope=R,this._scope=new J.Scope({parent:R}),this._nodes=[new A]}toString(){return this._root.render(this.opts)}name(R){return this._scope.name(R)}scopeName(R){return this._extScope.name(R)}scopeValue(R,T){let C=this._extScope.value(R,T);return(this._values[C.prefix]||(this._values[C.prefix]=new Set)).add(C),C}getScopeValue(R,T){return this._extScope.getValue(R,T)}scopeRefs(R){return this._extScope.scopeRefs(R,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(R,T,C,r){let X0=this._scope.toName(T);if(C!==void 0&&r)this._constants[X0.str]=C;return this._leafNode(new W(R,X0,C)),X0}const(R,T,C){return this._def(J.varKinds.const,R,T,C)}let(R,T,C){return this._def(J.varKinds.let,R,T,C)}var(R,T,C){return this._def(J.varKinds.var,R,T,C)}assign(R,T,C){return this._leafNode(new H(R,T,C))}add(R,T){return this._leafNode(new U(R,X.operators.ADD,T))}code(R){if(typeof R=="function")R();else if(R!==Q.nil)this._leafNode(new V(R));return this}object(...R){let T=["{"];for(let[C,r]of R){if(T.length>1)T.push(",");if(T.push(C),C!==r||this.opts.es5)T.push(":"),(0,Q.addCodeArg)(T,r)}return T.push("}"),new Q._Code(T)}if(R,T,C){if(this._blockNode(new z(R)),T&&C)this.code(T).else().code(C).endIf();else if(T)this.code(T).endIf();else if(C)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(R){return this._elseNode(new z(R))}else(){return this._elseNode(new Z)}endIf(){return this._endBlockNode(z,Z)}_for(R,T){if(this._blockNode(R),T)this.code(T).endFor();return this}for(R,T){return this._for(new F(R),T)}forRange(R,T,C,r,X0=this.opts.es5?J.varKinds.var:J.varKinds.let){let U0=this._scope.toName(R);return this._for(new L(X0,U0,T,C),()=>r(U0))}forOf(R,T,C,r=J.varKinds.const){let X0=this._scope.toName(R);if(this.opts.es5){let U0=T instanceof Q.Name?T:this.var("_arr",T);return this.forRange("_i",0,Q._`${U0}.length`,(Q0)=>{this.var(X0,Q._`${U0}[${Q0}]`),C(X0)})}return this._for(new O("of",r,X0,T),()=>C(X0))}forIn(R,T,C,r=this.opts.es5?J.varKinds.var:J.varKinds.const){if(this.opts.ownProperties)return this.forOf(R,Q._`Object.keys(${T})`,C);let X0=this._scope.toName(R);return this._for(new O("in",r,X0,T),()=>C(X0))}endFor(){return this._endBlockNode(M)}label(R){return this._leafNode(new B(R))}break(R){return this._leafNode(new q(R))}return(R){let T=new I;if(this._blockNode(T),this.code(R),T.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(I)}try(R,T,C){if(!T&&!C)throw Error('CodeGen: "try" without "catch" and "finally"');let r=new j;if(this._blockNode(r),this.code(R),T){let X0=this.name("e");this._currNode=r.catch=new E(X0),T(X0)}if(C)this._currNode=r.finally=new g,this.code(C);return this._endBlockNode(E,g)}throw(R){return this._leafNode(new K(R))}block(R,T){if(this._blockStarts.push(this._nodes.length),R)this.code(R).endBlock(T);return this}endBlock(R){let T=this._blockStarts.pop();if(T===void 0)throw Error("CodeGen: not in self-balancing block");let C=this._nodes.length-T;if(C<0||R!==void 0&&C!==R)throw Error(`CodeGen: wrong number of nodes: ${C} vs ${R} expected`);return this._nodes.length=T,this}func(R,T=Q.nil,C,r){if(this._blockNode(new D(R,T,C)),r)this.code(r).endFunc();return this}endFunc(){return this._endBlockNode(D)}optimize(R=1){while(R-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(R){return this._currNode.nodes.push(R),this}_blockNode(R){this._currNode.nodes.push(R),this._nodes.push(R)}_endBlockNode(R,T){let C=this._currNode;if(C instanceof R||T&&C instanceof T)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${T?`${R.kind}/${T.kind}`:R.kind}"`)}_elseNode(R){let T=this._currNode;if(!(T instanceof z))throw Error('CodeGen: "else" without "if"');return this._currNode=T.else=R,this}get _root(){return this._nodes[0]}get _currNode(){let R=this._nodes;return R[R.length-1]}set _currNode(R){let T=this._nodes;T[T.length-1]=R}}X.CodeGen=k;function x(R,T){for(let C in T)R[C]=(R[C]||0)+(T[C]||0);return R}function u(R,T){return T instanceof Q._CodeOrName?x(R,T.names):R}function l(R,T,C){if(R instanceof Q.Name)return r(R);if(!X0(R))return R;return new Q._Code(R._items.reduce((U0,Q0)=>{if(Q0 instanceof Q.Name)Q0=r(Q0);if(Q0 instanceof Q._Code)U0.push(...Q0._items);else U0.push(Q0);return U0},[]));function r(U0){let Q0=C[U0.str];if(Q0===void 0||T[U0.str]!==1)return U0;return delete T[U0.str],Q0}function X0(U0){return U0 instanceof Q._Code&&U0._items.some((Q0)=>Q0 instanceof Q.Name&&T[Q0.str]===1&&C[Q0.str]!==void 0)}}function Y0(R,T){for(let C in T)R[C]=(R[C]||0)-(T[C]||0)}function O0(R){return typeof R=="boolean"||typeof R=="number"||R===null?!R:Q._`!${f(R)}`}X.not=O0;var _0=b(X.operators.AND);function h0(...R){return R.reduce(_0)}X.and=h0;var q0=b(X.operators.OR);function S(...R){return R.reduce(q0)}X.or=S;function b(R){return(T,C)=>T===Q.nil?C:C===Q.nil?T:Q._`${f(T)} ${R} ${f(C)}`}function f(R){return R instanceof Q.Name?R:Q._`(${R})`}}),D0=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.checkStrictMode=X.getErrorPath=X.Type=X.useFunc=X.setEvaluated=X.evaluatedPropsToName=X.mergeEvaluated=X.eachItem=X.unescapeJsonPointer=X.escapeJsonPointer=X.escapeFragment=X.unescapeFragment=X.schemaRefOrVal=X.schemaHasRulesButRef=X.schemaHasRules=X.checkUnknownRules=X.alwaysValidSchema=X.toHash=void 0;var Q=B0(),J=l8();function Y(D){let I={};for(let j of D)I[j]=!0;return I}X.toHash=Y;function G(D,I){if(typeof I=="boolean")return I;if(Object.keys(I).length===0)return!0;return $(D,I),!W(I,D.self.RULES.all)}X.alwaysValidSchema=G;function $(D,I=D.schema){let{opts:j,self:E}=D;if(!j.strictSchema)return;if(typeof I==="boolean")return;let g=E.RULES.keywords;for(let k in I)if(!g[k])O(D,`unknown keyword: "${k}"`)}X.checkUnknownRules=$;function W(D,I){if(typeof D=="boolean")return!D;for(let j in D)if(I[j])return!0;return!1}X.schemaHasRules=W;function H(D,I){if(typeof D=="boolean")return!D;for(let j in D)if(j!=="$ref"&&I.all[j])return!0;return!1}X.schemaHasRulesButRef=H;function U({topSchemaRef:D,schemaPath:I},j,E,g){if(!g){if(typeof j=="number"||typeof j=="boolean")return j;if(typeof j=="string")return Q._`${j}`}return Q._`${D}${I}${(0,Q.getProperty)(E)}`}X.schemaRefOrVal=U;function B(D){return V(decodeURIComponent(D))}X.unescapeFragment=B;function q(D){return encodeURIComponent(K(D))}X.escapeFragment=q;function K(D){if(typeof D=="number")return`${D}`;return D.replace(/~/g,"~0").replace(/\//g,"~1")}X.escapeJsonPointer=K;function V(D){return D.replace(/~1/g,"/").replace(/~0/g,"~")}X.unescapeJsonPointer=V;function N(D,I){if(Array.isArray(D))for(let j of D)I(j);else I(D)}X.eachItem=N;function w({mergeNames:D,mergeToName:I,mergeValues:j,resultToName:E}){return(g,k,x,u)=>{let l=x===void 0?k:x instanceof Q.Name?(k instanceof Q.Name?D(g,k,x):I(g,k,x),x):k instanceof Q.Name?(I(g,x,k),k):j(k,x);return u===Q.Name&&!(l instanceof Q.Name)?E(g,l):l}}X.mergeEvaluated={props:w({mergeNames:(D,I,j)=>D.if(Q._`${j} !== true && ${I} !== undefined`,()=>{D.if(Q._`${I} === true`,()=>D.assign(j,!0),()=>D.assign(j,Q._`${j} || {}`).code(Q._`Object.assign(${j}, ${I})`))}),mergeToName:(D,I,j)=>D.if(Q._`${j} !== true`,()=>{if(I===!0)D.assign(j,!0);else D.assign(j,Q._`${j} || {}`),Z(D,j,I)}),mergeValues:(D,I)=>D===!0?!0:{...D,...I},resultToName:A}),items:w({mergeNames:(D,I,j)=>D.if(Q._`${j} !== true && ${I} !== undefined`,()=>D.assign(j,Q._`${I} === true ? true : ${j} > ${I} ? ${j} : ${I}`)),mergeToName:(D,I,j)=>D.if(Q._`${j} !== true`,()=>D.assign(j,I===!0?!0:Q._`${j} > ${I} ? ${j} : ${I}`)),mergeValues:(D,I)=>D===!0?!0:Math.max(D,I),resultToName:(D,I)=>D.var("items",I)})};function A(D,I){if(I===!0)return D.var("props",!0);let j=D.var("props",Q._`{}`);if(I!==void 0)Z(D,j,I);return j}X.evaluatedPropsToName=A;function Z(D,I,j){Object.keys(j).forEach((E)=>D.assign(Q._`${I}${(0,Q.getProperty)(E)}`,!0))}X.setEvaluated=Z;var z={};function M(D,I){return D.scopeValue("func",{ref:I,code:z[I.code]||(z[I.code]=new J._Code(I.code))})}X.useFunc=M;var F;(function(D){D[D.Num=0]="Num",D[D.Str=1]="Str"})(F||(X.Type=F={}));function L(D,I,j){if(D instanceof Q.Name){let E=I===F.Num;return j?E?Q._`"[" + ${D} + "]"`:Q._`"['" + ${D} + "']"`:E?Q._`"/" + ${D}`:Q._`"/" + ${D}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return j?(0,Q.getProperty)(D).toString():"/"+K(D)}X.getErrorPath=L;function O(D,I,j=D.opts.strictSchema){if(!j)return;if(I=`strict mode: ${I}`,j===!0)throw Error(I);D.self.logger.warn(I)}X.checkStrictMode=O}),v1=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=B0(),J={data:new Q.Name("data"),valCxt:new Q.Name("valCxt"),instancePath:new Q.Name("instancePath"),parentData:new Q.Name("parentData"),parentDataProperty:new Q.Name("parentDataProperty"),rootData:new Q.Name("rootData"),dynamicAnchors:new Q.Name("dynamicAnchors"),vErrors:new Q.Name("vErrors"),errors:new Q.Name("errors"),this:new Q.Name("this"),self:new Q.Name("self"),scope:new Q.Name("scope"),json:new Q.Name("json"),jsonPos:new Q.Name("jsonPos"),jsonLen:new Q.Name("jsonLen"),jsonPart:new Q.Name("jsonPart")};X.default=J}),Q6=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.extendErrors=X.resetErrorsCount=X.reportExtraError=X.reportError=X.keyword$DataError=X.keywordError=void 0;var Q=B0(),J=D0(),Y=v1();X.keywordError={message:({keyword:Z})=>Q.str`must pass "${Z}" keyword validation`},X.keyword$DataError={message:({keyword:Z,schemaType:z})=>z?Q.str`"${Z}" keyword must be ${z} ($data)`:Q.str`"${Z}" keyword is invalid ($data)`};function G(Z,z=X.keywordError,M,F){let{it:L}=Z,{gen:O,compositeRule:D,allErrors:I}=L,j=K(Z,z,M);if(F!==null&&F!==void 0?F:D||I)U(O,j);else B(L,Q._`[${j}]`)}X.reportError=G;function $(Z,z=X.keywordError,M){let{it:F}=Z,{gen:L,compositeRule:O,allErrors:D}=F,I=K(Z,z,M);if(U(L,I),!(O||D))B(F,Y.default.vErrors)}X.reportExtraError=$;function W(Z,z){Z.assign(Y.default.errors,z),Z.if(Q._`${Y.default.vErrors} !== null`,()=>Z.if(z,()=>Z.assign(Q._`${Y.default.vErrors}.length`,z),()=>Z.assign(Y.default.vErrors,null)))}X.resetErrorsCount=W;function H({gen:Z,keyword:z,schemaValue:M,data:F,errsCount:L,it:O}){if(L===void 0)throw Error("ajv implementation error");let D=Z.name("err");Z.forRange("i",L,Y.default.errors,(I)=>{if(Z.const(D,Q._`${Y.default.vErrors}[${I}]`),Z.if(Q._`${D}.instancePath === undefined`,()=>Z.assign(Q._`${D}.instancePath`,(0,Q.strConcat)(Y.default.instancePath,O.errorPath))),Z.assign(Q._`${D}.schemaPath`,Q.str`${O.errSchemaPath}/${z}`),O.opts.verbose)Z.assign(Q._`${D}.schema`,M),Z.assign(Q._`${D}.data`,F)})}X.extendErrors=H;function U(Z,z){let M=Z.const("err",z);Z.if(Q._`${Y.default.vErrors} === null`,()=>Z.assign(Y.default.vErrors,Q._`[${M}]`),Q._`${Y.default.vErrors}.push(${M})`),Z.code(Q._`${Y.default.errors}++`)}function B(Z,z){let{gen:M,validateName:F,schemaEnv:L}=Z;if(L.$async)M.throw(Q._`new ${Z.ValidationError}(${z})`);else M.assign(Q._`${F}.errors`,z),M.return(!1)}var q={keyword:new Q.Name("keyword"),schemaPath:new Q.Name("schemaPath"),params:new Q.Name("params"),propertyName:new Q.Name("propertyName"),message:new Q.Name("message"),schema:new Q.Name("schema"),parentSchema:new Q.Name("parentSchema")};function K(Z,z,M){let{createErrors:F}=Z.it;if(F===!1)return Q._`{}`;return V(Z,z,M)}function V(Z,z,M={}){let{gen:F,it:L}=Z,O=[N(L,M),w(Z,M)];return A(Z,z,O),F.object(...O)}function N({errorPath:Z},{instancePath:z}){let M=z?Q.str`${Z}${(0,J.getErrorPath)(z,J.Type.Str)}`:Z;return[Y.default.instancePath,(0,Q.strConcat)(Y.default.instancePath,M)]}function w({keyword:Z,it:{errSchemaPath:z}},{schemaPath:M,parentSchema:F}){let L=F?z:Q.str`${z}/${Z}`;if(M)L=Q.str`${L}${(0,J.getErrorPath)(M,J.Type.Str)}`;return[q.schemaPath,L]}function A(Z,{params:z,message:M},F){let{keyword:L,data:O,schemaValue:D,it:I}=Z,{opts:j,propertyName:E,topSchemaRef:g,schemaPath:k}=I;if(F.push([q.keyword,L],[q.params,typeof z=="function"?z(Z):z||Q._`{}`]),j.messages)F.push([q.message,typeof M=="function"?M(Z):M]);if(j.verbose)F.push([q.schema,D],[q.parentSchema,Q._`${g}${k}`],[Y.default.data,O]);if(E)F.push([q.propertyName,E])}}),n$=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.boolOrEmptySchema=X.topBoolOrEmptySchema=void 0;var Q=Q6(),J=B0(),Y=v1(),G={message:"boolean schema is false"};function $(U){let{gen:B,schema:q,validateName:K}=U;if(q===!1)H(U,!1);else if(typeof q=="object"&&q.$async===!0)B.return(Y.default.data);else B.assign(J._`${K}.errors`,null),B.return(!0)}X.topBoolOrEmptySchema=$;function W(U,B){let{gen:q,schema:K}=U;if(K===!1)q.var(B,!1),H(U);else q.var(B,!0)}X.boolOrEmptySchema=W;function H(U,B){let{gen:q,data:K}=U,V={gen:q,keyword:"false schema",data:K,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:U};(0,Q.reportError)(V,G,void 0,B)}}),P5=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.getRules=X.isJSONType=void 0;var Q=["string","number","integer","boolean","null","object","array"],J=new Set(Q);function Y($){return typeof $=="string"&&J.has($)}X.isJSONType=Y;function G(){let $={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...$,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},$.number,$.string,$.array,$.object],post:{rules:[]},all:{},keywords:{}}}X.getRules=G}),T5=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.shouldUseRule=X.shouldUseGroup=X.schemaHasRulesForType=void 0;function Q({schema:G,self:$},W){let H=$.RULES.types[W];return H&&H!==!0&&J(G,H)}X.schemaHasRulesForType=Q;function J(G,$){return $.rules.some((W)=>Y(G,W))}X.shouldUseGroup=J;function Y(G,$){var W;return G[$.keyword]!==void 0||((W=$.definition.implements)===null||W===void 0?void 0:W.some((H)=>G[H]!==void 0))}X.shouldUseRule=Y}),c8=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.reportTypeError=X.checkDataTypes=X.checkDataType=X.coerceAndCheckDataType=X.getJSONTypes=X.getSchemaTypes=X.DataType=void 0;var Q=P5(),J=T5(),Y=Q6(),G=B0(),$=D0(),W;(function(F){F[F.Correct=0]="Correct",F[F.Wrong=1]="Wrong"})(W||(X.DataType=W={}));function H(F){let L=U(F.type);if(L.includes("null")){if(F.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!L.length&&F.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if(F.nullable===!0)L.push("null")}return L}X.getSchemaTypes=H;function U(F){let L=Array.isArray(F)?F:F?[F]:[];if(L.every(Q.isJSONType))return L;throw Error("type must be JSONType or JSONType[]: "+L.join(","))}X.getJSONTypes=U;function B(F,L){let{gen:O,data:D,opts:I}=F,j=K(L,I.coerceTypes),E=L.length>0&&!(j.length===0&&L.length===1&&(0,J.schemaHasRulesForType)(F,L[0]));if(E){let g=A(L,D,I.strictNumbers,W.Wrong);O.if(g,()=>{if(j.length)V(F,L,j);else z(F)})}return E}X.coerceAndCheckDataType=B;var q=new Set(["string","number","integer","boolean","null"]);function K(F,L){return L?F.filter((O)=>q.has(O)||L==="array"&&O==="array"):[]}function V(F,L,O){let{gen:D,data:I,opts:j}=F,E=D.let("dataType",G._`typeof ${I}`),g=D.let("coerced",G._`undefined`);if(j.coerceTypes==="array")D.if(G._`${E} == 'object' && Array.isArray(${I}) && ${I}.length == 1`,()=>D.assign(I,G._`${I}[0]`).assign(E,G._`typeof ${I}`).if(A(L,I,j.strictNumbers),()=>D.assign(g,I)));D.if(G._`${g} !== undefined`);for(let x of O)if(q.has(x)||x==="array"&&j.coerceTypes==="array")k(x);D.else(),z(F),D.endIf(),D.if(G._`${g} !== undefined`,()=>{D.assign(I,g),N(F,g)});function k(x){switch(x){case"string":D.elseIf(G._`${E} == "number" || ${E} == "boolean"`).assign(g,G._`"" + ${I}`).elseIf(G._`${I} === null`).assign(g,G._`""`);return;case"number":D.elseIf(G._`${E} == "boolean" || ${I} === null
172
168
  || (${E} == "string" && ${I} && ${I} == +${I})`).assign(g,G._`+${I}`);return;case"integer":D.elseIf(G._`${E} === "boolean" || ${I} === null
173
169
  || (${E} === "string" && ${I} && ${I} == +${I} && !(${I} % 1))`).assign(g,G._`+${I}`);return;case"boolean":D.elseIf(G._`${I} === "false" || ${I} === 0 || ${I} === null`).assign(g,!1).elseIf(G._`${I} === "true" || ${I} === 1`).assign(g,!0);return;case"null":D.elseIf(G._`${I} === "" || ${I} === 0 || ${I} === false`),D.assign(g,null);return;case"array":D.elseIf(G._`${E} === "string" || ${E} === "number"
174
- || ${E} === "boolean" || ${I} === null`).assign(g,G._`[${I}]`)}}}function R({gen:q,parentData:L,parentDataProperty:O},D){q.if(G._`${L} !== undefined`,()=>q.assign(G._`${L}[${O}]`,D))}function w(q,L,O,D=W.Correct){let I=D===W.Correct?G.operators.EQ:G.operators.NEQ,j;switch(q){case"null":return G._`${L} ${I} null`;case"array":j=G._`Array.isArray(${L})`;break;case"object":j=G._`${L} && typeof ${L} == "object" && !Array.isArray(${L})`;break;case"integer":j=E(G._`!(${L} % 1) && !isNaN(${L})`);break;case"number":j=E();break;default:return G._`typeof ${L} ${I} ${q}`}return D===W.Correct?j:(0,G.not)(j);function E(g=G.nil){return(0,G.and)(G._`typeof ${L} == "number"`,g,O?G._`isFinite(${L})`:G.nil)}}X.checkDataType=w;function A(q,L,O,D){if(q.length===1)return w(q[0],L,O,D);let I,j=(0,$.toHash)(q);if(j.array&&j.object){let E=G._`typeof ${L} != "object"`;I=j.null?E:G._`!${L} || ${E}`,delete j.null,delete j.array,delete j.object}else I=G.nil;if(j.number)delete j.integer;for(let E in j)I=(0,G.and)(I,w(E,L,O,D));return I}X.checkDataTypes=A;var Z={message:({schema:q})=>`must be ${q}`,params:({schema:q,schemaValue:L})=>typeof q=="string"?G._`{type: ${q}}`:G._`{type: ${L}}`};function B(q){let L=V(q);(0,Y.reportError)(L,Z)}X.reportTypeError=B;function V(q){let{gen:L,data:O,schema:D}=q,I=(0,$.schemaRefOrVal)(q,D,"type");return{gen:L,keyword:"type",data:O,schema:D.type,schemaCode:I,schemaValue:I,parentSchema:D,params:{},it:q}}}),s$=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.assignDefaults=void 0;var Q=z0(),J=M0();function Y($,W){let{properties:H,items:U}=$.schema;if(W==="object"&&H)for(let z in H)G($,z,H[z].default);else if(W==="array"&&Array.isArray(U))U.forEach((z,F)=>G($,F,z.default))}X.assignDefaults=Y;function G($,W,H){let{gen:U,compositeRule:z,data:F,opts:K}=$;if(H===void 0)return;let M=Q._`${F}${(0,Q.getProperty)(W)}`;if(z){(0,J.checkStrictMode)($,`default is ignored for: ${M}`);return}let R=Q._`${M} === undefined`;if(K.useDefaults==="empty")R=Q._`${R} || ${M} === null || ${M} === ""`;U.if(R,Q._`${M} = ${(0,Q.stringify)(H)}`)}}),U1=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.validateUnion=X.validateArray=X.usePattern=X.callValidateCode=X.schemaProperties=X.allSchemaProperties=X.noPropertyInData=X.propertyInData=X.isOwnProperty=X.hasPropFunc=X.reportMissingProp=X.checkMissingProp=X.checkReportMissingProp=void 0;var Q=z0(),J=M0(),Y=v1(),G=M0();function $(q,L){let{gen:O,data:D,it:I}=q;O.if(K(O,D,L,I.opts.ownProperties),()=>{q.setParams({missingProperty:Q._`${L}`},!0),q.error()})}X.checkReportMissingProp=$;function W({gen:q,data:L,it:{opts:O}},D,I){return(0,Q.or)(...D.map((j)=>(0,Q.and)(K(q,L,j,O.ownProperties),Q._`${I} = ${j}`)))}X.checkMissingProp=W;function H(q,L){q.setParams({missingProperty:L},!0),q.error()}X.reportMissingProp=H;function U(q){return q.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:Q._`Object.prototype.hasOwnProperty`})}X.hasPropFunc=U;function z(q,L,O){return Q._`${U(q)}.call(${L}, ${O})`}X.isOwnProperty=z;function F(q,L,O,D){let I=Q._`${L}${(0,Q.getProperty)(O)} !== undefined`;return D?Q._`${I} && ${z(q,L,O)}`:I}X.propertyInData=F;function K(q,L,O,D){let I=Q._`${L}${(0,Q.getProperty)(O)} === undefined`;return D?(0,Q.or)(I,(0,Q.not)(z(q,L,O))):I}X.noPropertyInData=K;function M(q){return q?Object.keys(q).filter((L)=>L!=="__proto__"):[]}X.allSchemaProperties=M;function R(q,L){return M(L).filter((O)=>!(0,J.alwaysValidSchema)(q,L[O]))}X.schemaProperties=R;function w({schemaCode:q,data:L,it:{gen:O,topSchemaRef:D,schemaPath:I,errorPath:j},it:E},g,k,x){let u=x?Q._`${q}, ${L}, ${D}${I}`:L,l=[[Y.default.instancePath,(0,Q.strConcat)(Y.default.instancePath,j)],[Y.default.parentData,E.parentData],[Y.default.parentDataProperty,E.parentDataProperty],[Y.default.rootData,Y.default.rootData]];if(E.opts.dynamicRef)l.push([Y.default.dynamicAnchors,Y.default.dynamicAnchors]);let Y0=Q._`${u}, ${O.object(...l)}`;return k!==Q.nil?Q._`${g}.call(${k}, ${Y0})`:Q._`${g}(${Y0})`}X.callValidateCode=w;var A=Q._`new RegExp`;function Z({gen:q,it:{opts:L}},O){let D=L.unicodeRegExp?"u":"",{regExp:I}=L.code,j=I(O,D);return q.scopeValue("pattern",{key:j.toString(),ref:j,code:Q._`${I.code==="new RegExp"?A:(0,G.useFunc)(q,I)}(${O}, ${D})`})}X.usePattern=Z;function B(q){let{gen:L,data:O,keyword:D,it:I}=q,j=L.name("valid");if(I.allErrors){let g=L.let("valid",!0);return E(()=>L.assign(g,!1)),g}return L.var(j,!0),E(()=>L.break()),j;function E(g){let k=L.const("len",Q._`${O}.length`);L.forRange("i",0,k,(x)=>{q.subschema({keyword:D,dataProp:x,dataPropType:J.Type.Num},j),L.if((0,Q.not)(j),g)})}}X.validateArray=B;function V(q){let{gen:L,schema:O,keyword:D,it:I}=q;if(!Array.isArray(O))throw Error("ajv implementation error");if(O.some((k)=>(0,J.alwaysValidSchema)(I,k))&&!I.opts.unevaluated)return;let E=L.let("valid",!1),g=L.name("_valid");L.block(()=>O.forEach((k,x)=>{let u=q.subschema({keyword:D,schemaProp:x,compositeRule:!0},g);if(L.assign(E,Q._`${E} || ${g}`),!q.mergeValidEvaluated(u,g))L.if((0,Q.not)(E))})),q.result(E,()=>q.reset(),()=>q.error(!0))}X.validateUnion=V}),t$=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.validateKeywordUsage=X.validSchemaType=X.funcKeywordCode=X.macroKeywordCode=void 0;var Q=z0(),J=v1(),Y=U1(),G=Y6();function $(R,w){let{gen:A,keyword:Z,schema:B,parentSchema:V,it:q}=R,L=w.macro.call(q.self,B,V,q),O=F(A,Z,L);if(q.opts.validateSchema!==!1)q.self.validateSchema(L,!0);let D=A.name("valid");R.subschema({schema:L,schemaPath:Q.nil,errSchemaPath:`${q.errSchemaPath}/${Z}`,topSchemaRef:O,compositeRule:!0},D),R.pass(D,()=>R.error(!0))}X.macroKeywordCode=$;function W(R,w){var A;let{gen:Z,keyword:B,schema:V,parentSchema:q,$data:L,it:O}=R;z(O,w);let D=!L&&w.compile?w.compile.call(O.self,V,q,O):w.validate,I=F(Z,B,D),j=Z.let("valid");R.block$data(j,E),R.ok((A=w.valid)!==null&&A!==void 0?A:j);function E(){if(w.errors===!1){if(x(),w.modifying)H(R);u(()=>R.error())}else{let l=w.async?g():k();if(w.modifying)H(R);u(()=>U(R,l))}}function g(){let l=Z.let("ruleErrs",null);return Z.try(()=>x(Q._`await `),(Y0)=>Z.assign(j,!1).if(Q._`${Y0} instanceof ${O.ValidationError}`,()=>Z.assign(l,Q._`${Y0}.errors`),()=>Z.throw(Y0))),l}function k(){let l=Q._`${I}.errors`;return Z.assign(l,null),x(Q.nil),l}function x(l=w.async?Q._`await `:Q.nil){let Y0=O.opts.passContext?J.default.this:J.default.self,Z0=!(("compile"in w)&&!L||w.schema===!1);Z.assign(j,Q._`${l}${(0,Y.callValidateCode)(R,I,Y0,Z0)}`,w.modifying)}function u(l){var Y0;Z.if((0,Q.not)((Y0=w.valid)!==null&&Y0!==void 0?Y0:j),l)}}X.funcKeywordCode=W;function H(R){let{gen:w,data:A,it:Z}=R;w.if(Z.parentData,()=>w.assign(A,Q._`${Z.parentData}[${Z.parentDataProperty}]`))}function U(R,w){let{gen:A}=R;A.if(Q._`Array.isArray(${w})`,()=>{A.assign(J.default.vErrors,Q._`${J.default.vErrors} === null ? ${w} : ${J.default.vErrors}.concat(${w})`).assign(J.default.errors,Q._`${J.default.vErrors}.length`),(0,G.extendErrors)(R)},()=>R.error())}function z({schemaEnv:R},w){if(w.async&&!R.$async)throw Error("async keyword in sync schema")}function F(R,w,A){if(A===void 0)throw Error(`keyword "${w}" failed to compile`);return R.scopeValue("keyword",typeof A=="function"?{ref:A}:{ref:A,code:(0,Q.stringify)(A)})}function K(R,w,A=!1){return!w.length||w.some((Z)=>Z==="array"?Array.isArray(R):Z==="object"?R&&typeof R=="object"&&!Array.isArray(R):typeof R==Z||A&&typeof R>"u")}X.validSchemaType=K;function M({schema:R,opts:w,self:A,errSchemaPath:Z},B,V){if(Array.isArray(B.keyword)?!B.keyword.includes(V):B.keyword!==V)throw Error("ajv implementation error");let q=B.dependencies;if(q===null||q===void 0?void 0:q.some((L)=>!Object.prototype.hasOwnProperty.call(R,L)))throw Error(`parent schema must have dependencies of ${V}: ${q.join(",")}`);if(B.validateSchema){if(!B.validateSchema(R[V])){let O=`keyword "${V}" value is invalid at path "${Z}": `+A.errorsText(B.validateSchema.errors);if(w.validateSchema==="log")A.logger.error(O);else throw Error(O)}}}X.validateKeywordUsage=M}),e$=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.extendSubschemaMode=X.extendSubschemaData=X.getSubschema=void 0;var Q=z0(),J=M0();function Y(W,{keyword:H,schemaProp:U,schema:z,schemaPath:F,errSchemaPath:K,topSchemaRef:M}){if(H!==void 0&&z!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(H!==void 0){let R=W.schema[H];return U===void 0?{schema:R,schemaPath:Q._`${W.schemaPath}${(0,Q.getProperty)(H)}`,errSchemaPath:`${W.errSchemaPath}/${H}`}:{schema:R[U],schemaPath:Q._`${W.schemaPath}${(0,Q.getProperty)(H)}${(0,Q.getProperty)(U)}`,errSchemaPath:`${W.errSchemaPath}/${H}/${(0,J.escapeFragment)(U)}`}}if(z!==void 0){if(F===void 0||K===void 0||M===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:z,schemaPath:F,topSchemaRef:M,errSchemaPath:K}}throw Error('either "keyword" or "schema" must be passed')}X.getSubschema=Y;function G(W,H,{dataProp:U,dataPropType:z,data:F,dataTypes:K,propertyName:M}){if(F!==void 0&&U!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:R}=H;if(U!==void 0){let{errorPath:A,dataPathArr:Z,opts:B}=H,V=R.let("data",Q._`${H.data}${(0,Q.getProperty)(U)}`,!0);w(V),W.errorPath=Q.str`${A}${(0,J.getErrorPath)(U,z,B.jsPropertySyntax)}`,W.parentDataProperty=Q._`${U}`,W.dataPathArr=[...Z,W.parentDataProperty]}if(F!==void 0){let A=F instanceof Q.Name?F:R.let("data",F,!0);if(w(A),M!==void 0)W.propertyName=M}if(K)W.dataTypes=K;function w(A){W.data=A,W.dataLevel=H.dataLevel+1,W.dataTypes=[],H.definedProperties=new Set,W.parentData=H.data,W.dataNames=[...H.dataNames,A]}}X.extendSubschemaData=G;function $(W,{jtdDiscriminator:H,jtdMetadata:U,compositeRule:z,createErrors:F,allErrors:K}){if(z!==void 0)W.compositeRule=z;if(F!==void 0)W.createErrors=F;if(K!==void 0)W.allErrors=K;W.jtdDiscriminator=H,W.jtdMetadata=U}X.extendSubschemaMode=$}),_4=i((X,Q)=>{Q.exports=function J(Y,G){if(Y===G)return!0;if(Y&&G&&typeof Y=="object"&&typeof G=="object"){if(Y.constructor!==G.constructor)return!1;var $,W,H;if(Array.isArray(Y)){if($=Y.length,$!=G.length)return!1;for(W=$;W--!==0;)if(!J(Y[W],G[W]))return!1;return!0}if(Y.constructor===RegExp)return Y.source===G.source&&Y.flags===G.flags;if(Y.valueOf!==Object.prototype.valueOf)return Y.valueOf()===G.valueOf();if(Y.toString!==Object.prototype.toString)return Y.toString()===G.toString();if(H=Object.keys(Y),$=H.length,$!==Object.keys(G).length)return!1;for(W=$;W--!==0;)if(!Object.prototype.hasOwnProperty.call(G,H[W]))return!1;for(W=$;W--!==0;){var U=H[W];if(!J(Y[U],G[U]))return!1}return!0}return Y!==Y&&G!==G}}),XW=i((X,Q)=>{var J=Q.exports=function($,W,H){if(typeof W=="function")H=W,W={};H=W.cb||H;var U=typeof H=="function"?H:H.pre||function(){},z=H.post||function(){};Y(W,U,z,$,"",$)};J.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},J.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},J.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},J.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function Y($,W,H,U,z,F,K,M,R,w){if(U&&typeof U=="object"&&!Array.isArray(U)){W(U,z,F,K,M,R,w);for(var A in U){var Z=U[A];if(Array.isArray(Z)){if(A in J.arrayKeywords)for(var B=0;B<Z.length;B++)Y($,W,H,Z[B],z+"/"+A+"/"+B,F,z,A,U,B)}else if(A in J.propsKeywords){if(Z&&typeof Z=="object")for(var V in Z)Y($,W,H,Z[V],z+"/"+A+"/"+G(V),F,z,A,U,V)}else if(A in J.keywords||$.allKeys&&!(A in J.skipKeywords))Y($,W,H,Z,z+"/"+A,F,z,A,U)}H(U,z,F,K,M,R,w)}}function G($){return $.replace(/~/g,"~0").replace(/\//g,"~1")}}),G6=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.getSchemaRefs=X.resolveUrl=X.normalizeId=X._getFullPath=X.getFullPath=X.inlineRef=void 0;var Q=M0(),J=_4(),Y=XW(),G=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function $(Z,B=!0){if(typeof Z=="boolean")return!0;if(B===!0)return!H(Z);if(!B)return!1;return U(Z)<=B}X.inlineRef=$;var W=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function H(Z){for(let B in Z){if(W.has(B))return!0;let V=Z[B];if(Array.isArray(V)&&V.some(H))return!0;if(typeof V=="object"&&H(V))return!0}return!1}function U(Z){let B=0;for(let V in Z){if(V==="$ref")return 1/0;if(B++,G.has(V))continue;if(typeof Z[V]=="object")(0,Q.eachItem)(Z[V],(q)=>B+=U(q));if(B===1/0)return 1/0}return B}function z(Z,B="",V){if(V!==!1)B=M(B);let q=Z.parse(B);return F(Z,q)}X.getFullPath=z;function F(Z,B){return Z.serialize(B).split("#")[0]+"#"}X._getFullPath=F;var K=/#\/?$/;function M(Z){return Z?Z.replace(K,""):""}X.normalizeId=M;function R(Z,B,V){return V=M(V),Z.resolve(B,V)}X.resolveUrl=R;var w=/^[a-z_][-a-z0-9._]*$/i;function A(Z,B){if(typeof Z=="boolean")return{};let{schemaId:V,uriResolver:q}=this.opts,L=M(Z[V]||B),O={"":L},D=z(q,L,!1),I={},j=new Set;return Y(Z,{allKeys:!0},(k,x,u,l)=>{if(l===void 0)return;let Y0=D+x,Z0=O[l];if(typeof k[V]=="string")Z0=_0.call(this,k[V]);h0.call(this,k.$anchor),h0.call(this,k.$dynamicAnchor),O[x]=Z0;function _0(q0){let S=this.opts.uriResolver.resolve;if(q0=M(Z0?S(Z0,q0):q0),j.has(q0))throw g(q0);j.add(q0);let b=this.refs[q0];if(typeof b=="string")b=this.refs[b];if(typeof b=="object")E(k,b.schema,q0);else if(q0!==M(Y0))if(q0[0]==="#")E(k,I[q0],q0),I[q0]=k;else this.refs[q0]=Y0;return q0}function h0(q0){if(typeof q0=="string"){if(!w.test(q0))throw Error(`invalid anchor "${q0}"`);_0.call(this,`#${q0}`)}}}),I;function E(k,x,u){if(x!==void 0&&!J(k,x))throw g(u)}function g(k){return Error(`reference "${k}" resolves to more than one schema`)}}X.getSchemaRefs=A}),$6=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.getData=X.KeywordCxt=X.validateFunctionCode=void 0;var Q=a$(),J=d8(),Y=C4(),G=d8(),$=s$(),W=t$(),H=e$(),U=z0(),z=v1(),F=G6(),K=M0(),M=Y6();function R(P){if(D(P)){if(j(P),O(P)){B(P);return}}w(P,()=>(0,Q.topBoolOrEmptySchema)(P))}X.validateFunctionCode=R;function w({gen:P,validateName:_,schema:h,schemaEnv:a,opts:e},B0){if(e.code.es5)P.func(_,U._`${z.default.data}, ${z.default.valCxt}`,a.$async,()=>{P.code(U._`"use strict"; ${q(h,e)}`),Z(P,e),P.code(B0)});else P.func(_,U._`${z.default.data}, ${A(e)}`,a.$async,()=>P.code(q(h,e)).code(B0))}function A(P){return U._`{${z.default.instancePath}="", ${z.default.parentData}, ${z.default.parentDataProperty}, ${z.default.rootData}=${z.default.data}${P.dynamicRef?U._`, ${z.default.dynamicAnchors}={}`:U.nil}}={}`}function Z(P,_){P.if(z.default.valCxt,()=>{if(P.var(z.default.instancePath,U._`${z.default.valCxt}.${z.default.instancePath}`),P.var(z.default.parentData,U._`${z.default.valCxt}.${z.default.parentData}`),P.var(z.default.parentDataProperty,U._`${z.default.valCxt}.${z.default.parentDataProperty}`),P.var(z.default.rootData,U._`${z.default.valCxt}.${z.default.rootData}`),_.dynamicRef)P.var(z.default.dynamicAnchors,U._`${z.default.valCxt}.${z.default.dynamicAnchors}`)},()=>{if(P.var(z.default.instancePath,U._`""`),P.var(z.default.parentData,U._`undefined`),P.var(z.default.parentDataProperty,U._`undefined`),P.var(z.default.rootData,z.default.data),_.dynamicRef)P.var(z.default.dynamicAnchors,U._`{}`)})}function B(P){let{schema:_,opts:h,gen:a}=P;w(P,()=>{if(h.$comment&&_.$comment)l(P);if(k(P),a.let(z.default.vErrors,null),a.let(z.default.errors,0),h.unevaluated)V(P);E(P),Y0(P)});return}function V(P){let{gen:_,validateName:h}=P;P.evaluated=_.const("evaluated",U._`${h}.evaluated`),_.if(U._`${P.evaluated}.dynamicProps`,()=>_.assign(U._`${P.evaluated}.props`,U._`undefined`)),_.if(U._`${P.evaluated}.dynamicItems`,()=>_.assign(U._`${P.evaluated}.items`,U._`undefined`))}function q(P,_){let h=typeof P=="object"&&P[_.schemaId];return h&&(_.code.source||_.code.process)?U._`/*# sourceURL=${h} */`:U.nil}function L(P,_){if(D(P)){if(j(P),O(P)){I(P,_);return}}(0,Q.boolOrEmptySchema)(P,_)}function O({schema:P,self:_}){if(typeof P=="boolean")return!P;for(let h in P)if(_.RULES.all[h])return!0;return!1}function D(P){return typeof P.schema!="boolean"}function I(P,_){let{schema:h,gen:a,opts:e}=P;if(e.$comment&&h.$comment)l(P);x(P),u(P);let B0=a.const("_errs",z.default.errors);E(P,B0),a.var(_,U._`${B0} === ${z.default.errors}`)}function j(P){(0,K.checkUnknownRules)(P),g(P)}function E(P,_){if(P.opts.jtd)return _0(P,[],!1,_);let h=(0,J.getSchemaTypes)(P.schema),a=(0,J.coerceAndCheckDataType)(P,h);_0(P,h,!a,_)}function g(P){let{schema:_,errSchemaPath:h,opts:a,self:e}=P;if(_.$ref&&a.ignoreKeywordsWithRef&&(0,K.schemaHasRulesButRef)(_,e.RULES))e.logger.warn(`$ref: keywords ignored in schema at path "${h}"`)}function k(P){let{schema:_,opts:h}=P;if(_.default!==void 0&&h.useDefaults&&h.strictSchema)(0,K.checkStrictMode)(P,"default is ignored in the schema root")}function x(P){let _=P.schema[P.opts.schemaId];if(_)P.baseId=(0,F.resolveUrl)(P.opts.uriResolver,P.baseId,_)}function u(P){if(P.schema.$async&&!P.schemaEnv.$async)throw Error("async schema in sync schema")}function l({gen:P,schemaEnv:_,schema:h,errSchemaPath:a,opts:e}){let B0=h.$comment;if(e.$comment===!0)P.code(U._`${z.default.self}.logger.log(${B0})`);else if(typeof e.$comment=="function"){let p0=U.str`${a}/$comment`,s0=P.scopeValue("root",{ref:_.root});P.code(U._`${z.default.self}.opts.$comment(${B0}, ${p0}, ${s0}.schema)`)}}function Y0(P){let{gen:_,schemaEnv:h,validateName:a,ValidationError:e,opts:B0}=P;if(h.$async)_.if(U._`${z.default.errors} === 0`,()=>_.return(z.default.data),()=>_.throw(U._`new ${e}(${z.default.vErrors})`));else{if(_.assign(U._`${a}.errors`,z.default.vErrors),B0.unevaluated)Z0(P);_.return(U._`${z.default.errors} === 0`)}}function Z0({gen:P,evaluated:_,props:h,items:a}){if(h instanceof U.Name)P.assign(U._`${_}.props`,h);if(a instanceof U.Name)P.assign(U._`${_}.items`,a)}function _0(P,_,h,a){let{gen:e,schema:B0,data:p0,allErrors:s0,opts:L1,self:i0}=P,{RULES:f0}=i0;if(B0.$ref&&(L1.ignoreKeywordsWithRef||!(0,K.schemaHasRulesButRef)(B0,f0))){e.block(()=>U0(P,"$ref",f0.all.$ref.definition));return}if(!L1.jtd)q0(P,_);e.block(()=>{for(let t0 of f0.rules)Y9(t0);Y9(f0.post)});function Y9(t0){if(!(0,Y.shouldUseGroup)(B0,t0))return;if(t0.type){if(e.if((0,G.checkDataType)(t0.type,p0,L1.strictNumbers)),h0(P,t0),_.length===1&&_[0]===t0.type&&h)e.else(),(0,G.reportTypeError)(P);e.endIf()}else h0(P,t0);if(!s0)e.if(U._`${z.default.errors} === ${a||0}`)}}function h0(P,_){let{gen:h,schema:a,opts:{useDefaults:e}}=P;if(e)(0,$.assignDefaults)(P,_.type);h.block(()=>{for(let B0 of _.rules)if((0,Y.shouldUseRule)(a,B0))U0(P,B0.keyword,B0.definition,_.type)})}function q0(P,_){if(P.schemaEnv.meta||!P.opts.strictTypes)return;if(S(P,_),!P.opts.allowUnionTypes)b(P,_);f(P,P.dataTypes)}function S(P,_){if(!_.length)return;if(!P.dataTypes.length){P.dataTypes=_;return}_.forEach((h)=>{if(!T(P.dataTypes,h))r(P,`type "${h}" not allowed by context "${P.dataTypes.join(",")}"`)}),C(P,_)}function b(P,_){if(_.length>1&&!(_.length===2&&_.includes("null")))r(P,"use allowUnionTypes to allow union type keyword")}function f(P,_){let h=P.self.RULES.all;for(let a in h){let e=h[a];if(typeof e=="object"&&(0,Y.shouldUseRule)(P.schema,e)){let{type:B0}=e.definition;if(B0.length&&!B0.some((p0)=>N(_,p0)))r(P,`missing type "${B0.join(",")}" for keyword "${a}"`)}}}function N(P,_){return P.includes(_)||_==="number"&&P.includes("integer")}function T(P,_){return P.includes(_)||_==="integer"&&P.includes("number")}function C(P,_){let h=[];for(let a of P.dataTypes)if(T(_,a))h.push(a);else if(_.includes("integer")&&a==="number")h.push("integer");P.dataTypes=h}function r(P,_){let h=P.schemaEnv.baseId+P.errSchemaPath;_+=` at "${h}" (strictTypes)`,(0,K.checkStrictMode)(P,_,P.opts.strictTypes)}class X0{constructor(P,_,h){if((0,W.validateKeywordUsage)(P,_,h),this.gen=P.gen,this.allErrors=P.allErrors,this.keyword=h,this.data=P.data,this.schema=P.schema[h],this.$data=_.$data&&P.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,K.schemaRefOrVal)(P,this.schema,h,this.$data),this.schemaType=_.schemaType,this.parentSchema=P.schema,this.params={},this.it=P,this.def=_,this.$data)this.schemaCode=P.gen.const("vSchema",G1(this.$data,P));else if(this.schemaCode=this.schemaValue,!(0,W.validSchemaType)(this.schema,_.schemaType,_.allowUndefined))throw Error(`${h} value must be ${JSON.stringify(_.schemaType)}`);if("code"in _?_.trackErrors:_.errors!==!1)this.errsCount=P.gen.const("_errs",z.default.errors)}result(P,_,h){this.failResult((0,U.not)(P),_,h)}failResult(P,_,h){if(this.gen.if(P),h)h();else this.error();if(_){if(this.gen.else(),_(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass(P,_){this.failResult((0,U.not)(P),void 0,_)}fail(P){if(P===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(P),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(P){if(!this.$data)return this.fail(P);let{schemaCode:_}=this;this.fail(U._`${_} !== undefined && (${(0,U.or)(this.invalid$data(),P)})`)}error(P,_,h){if(_){this.setParams(_),this._error(P,h),this.setParams({});return}this._error(P,h)}_error(P,_){(P?M.reportExtraError:M.reportError)(this,this.def.error,_)}$dataError(){(0,M.reportError)(this,this.def.$dataError||M.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,M.resetErrorsCount)(this.gen,this.errsCount)}ok(P){if(!this.allErrors)this.gen.if(P)}setParams(P,_){if(_)Object.assign(this.params,P);else this.params=P}block$data(P,_,h=U.nil){this.gen.block(()=>{this.check$data(P,h),_()})}check$data(P=U.nil,_=U.nil){if(!this.$data)return;let{gen:h,schemaCode:a,schemaType:e,def:B0}=this;if(h.if((0,U.or)(U._`${a} === undefined`,_)),P!==U.nil)h.assign(P,!0);if(e.length||B0.validateSchema){if(h.elseIf(this.invalid$data()),this.$dataError(),P!==U.nil)h.assign(P,!1)}h.else()}invalid$data(){let{gen:P,schemaCode:_,schemaType:h,def:a,it:e}=this;return(0,U.or)(B0(),p0());function B0(){if(h.length){if(!(_ instanceof U.Name))throw Error("ajv implementation error");let s0=Array.isArray(h)?h:[h];return U._`${(0,G.checkDataTypes)(s0,_,e.opts.strictNumbers,G.DataType.Wrong)}`}return U.nil}function p0(){if(a.validateSchema){let s0=P.scopeValue("validate$data",{ref:a.validateSchema});return U._`!${s0}(${_})`}return U.nil}}subschema(P,_){let h=(0,H.getSubschema)(this.it,P);(0,H.extendSubschemaData)(h,this.it,P),(0,H.extendSubschemaMode)(h,P);let a={...this.it,...h,items:void 0,props:void 0};return L(a,_),a}mergeEvaluated(P,_){let{it:h,gen:a}=this;if(!h.opts.unevaluated)return;if(h.props!==!0&&P.props!==void 0)h.props=K.mergeEvaluated.props(a,P.props,h.props,_);if(h.items!==!0&&P.items!==void 0)h.items=K.mergeEvaluated.items(a,P.items,h.items,_)}mergeValidEvaluated(P,_){let{it:h,gen:a}=this;if(h.opts.unevaluated&&(h.props!==!0||h.items!==!0))return a.if(_,()=>this.mergeEvaluated(P,U.Name)),!0}}X.KeywordCxt=X0;function U0(P,_,h,a){let e=new X0(P,h,_);if("code"in h)h.code(e,a);else if(e.$data&&h.validate)(0,W.funcKeywordCode)(e,h);else if("macro"in h)(0,W.macroKeywordCode)(e,h);else if(h.compile||h.validate)(0,W.funcKeywordCode)(e,h)}var Q0=/^\/(?:[^~]|~0|~1)*$/,S0=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function G1(P,{dataLevel:_,dataNames:h,dataPathArr:a}){let e,B0;if(P==="")return z.default.rootData;if(P[0]==="/"){if(!Q0.test(P))throw Error(`Invalid JSON-pointer: ${P}`);e=P,B0=z.default.rootData}else{let i0=S0.exec(P);if(!i0)throw Error(`Invalid JSON-pointer: ${P}`);let f0=+i0[1];if(e=i0[2],e==="#"){if(f0>=_)throw Error(L1("property/index",f0));return a[_-f0]}if(f0>_)throw Error(L1("data",f0));if(B0=h[_-f0],!e)return B0}let p0=B0,s0=e.split("/");for(let i0 of s0)if(i0)B0=U._`${B0}${(0,U.getProperty)((0,K.unescapeJsonPointer)(i0))}`,p0=U._`${p0} && ${B0}`;return p0;function L1(i0,f0){return`Cannot access ${i0} ${f0} levels up, current level is ${_}`}}X.getData=G1}),yX=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});class Q extends Error{constructor(J){super("validation failed");this.errors=J,this.ajv=this.validation=!0}}X.default=Q}),W6=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=G6();class J extends Error{constructor(Y,G,$,W){super(W||`can't resolve reference ${$} from id ${G}`);this.missingRef=(0,Q.resolveUrl)(Y,G,$),this.missingSchema=(0,Q.normalizeId)((0,Q.getFullPath)(Y,this.missingRef))}}X.default=J}),xX=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.resolveSchema=X.getCompilingSchema=X.resolveRef=X.compileSchema=X.SchemaEnv=void 0;var Q=z0(),J=yX(),Y=v1(),G=G6(),$=M0(),W=$6();class H{constructor(B){var V;this.refs={},this.dynamicAnchors={};let q;if(typeof B.schema=="object")q=B.schema;this.schema=B.schema,this.schemaId=B.schemaId,this.root=B.root||this,this.baseId=(V=B.baseId)!==null&&V!==void 0?V:(0,G.normalizeId)(q===null||q===void 0?void 0:q[B.schemaId||"$id"]),this.schemaPath=B.schemaPath,this.localRefs=B.localRefs,this.meta=B.meta,this.$async=q===null||q===void 0?void 0:q.$async,this.refs={}}}X.SchemaEnv=H;function U(B){let V=K.call(this,B);if(V)return V;let q=(0,G.getFullPath)(this.opts.uriResolver,B.root.baseId),{es5:L,lines:O}=this.opts.code,{ownProperties:D}=this.opts,I=new Q.CodeGen(this.scope,{es5:L,lines:O,ownProperties:D}),j;if(B.$async)j=I.scopeValue("Error",{ref:J.default,code:Q._`require("ajv/dist/runtime/validation_error").default`});let E=I.scopeName("validate");B.validateName=E;let g={gen:I,allErrors:this.opts.allErrors,data:Y.default.data,parentData:Y.default.parentData,parentDataProperty:Y.default.parentDataProperty,dataNames:[Y.default.data],dataPathArr:[Q.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:I.scopeValue("schema",this.opts.code.source===!0?{ref:B.schema,code:(0,Q.stringify)(B.schema)}:{ref:B.schema}),validateName:E,ValidationError:j,schema:B.schema,schemaEnv:B,rootId:q,baseId:B.baseId||q,schemaPath:Q.nil,errSchemaPath:B.schemaPath||(this.opts.jtd?"":"#"),errorPath:Q._`""`,opts:this.opts,self:this},k;try{this._compilations.add(B),(0,W.validateFunctionCode)(g),I.optimize(this.opts.code.optimize);let x=I.toString();if(k=`${I.scopeRefs(Y.default.scope)}return ${x}`,this.opts.code.process)k=this.opts.code.process(k,B);let l=Function(`${Y.default.self}`,`${Y.default.scope}`,k)(this,this.scope.get());if(this.scope.value(E,{ref:l}),l.errors=null,l.schema=B.schema,l.schemaEnv=B,B.$async)l.$async=!0;if(this.opts.code.source===!0)l.source={validateName:E,validateCode:x,scopeValues:I._values};if(this.opts.unevaluated){let{props:Y0,items:Z0}=g;if(l.evaluated={props:Y0 instanceof Q.Name?void 0:Y0,items:Z0 instanceof Q.Name?void 0:Z0,dynamicProps:Y0 instanceof Q.Name,dynamicItems:Z0 instanceof Q.Name},l.source)l.source.evaluated=(0,Q.stringify)(l.evaluated)}return B.validate=l,B}catch(x){if(delete B.validate,delete B.validateName,k)this.logger.error("Error compiling schema, function code:",k);throw x}finally{this._compilations.delete(B)}}X.compileSchema=U;function z(B,V,q){var L;q=(0,G.resolveUrl)(this.opts.uriResolver,V,q);let O=B.refs[q];if(O)return O;let D=R.call(this,B,q);if(D===void 0){let I=(L=B.localRefs)===null||L===void 0?void 0:L[q],{schemaId:j}=this.opts;if(I)D=new H({schema:I,schemaId:j,root:B,baseId:V})}if(D===void 0)return;return B.refs[q]=F.call(this,D)}X.resolveRef=z;function F(B){if((0,G.inlineRef)(B.schema,this.opts.inlineRefs))return B.schema;return B.validate?B:U.call(this,B)}function K(B){for(let V of this._compilations)if(M(V,B))return V}X.getCompilingSchema=K;function M(B,V){return B.schema===V.schema&&B.root===V.root&&B.baseId===V.baseId}function R(B,V){let q;while(typeof(q=this.refs[V])=="string")V=q;return q||this.schemas[V]||w.call(this,B,V)}function w(B,V){let q=this.opts.uriResolver.parse(V),L=(0,G._getFullPath)(this.opts.uriResolver,q),O=(0,G.getFullPath)(this.opts.uriResolver,B.baseId,void 0);if(Object.keys(B.schema).length>0&&L===O)return Z.call(this,q,B);let D=(0,G.normalizeId)(L),I=this.refs[D]||this.schemas[D];if(typeof I=="string"){let j=w.call(this,B,I);if(typeof(j===null||j===void 0?void 0:j.schema)!=="object")return;return Z.call(this,q,j)}if(typeof(I===null||I===void 0?void 0:I.schema)!=="object")return;if(!I.validate)U.call(this,I);if(D===(0,G.normalizeId)(V)){let{schema:j}=I,{schemaId:E}=this.opts,g=j[E];if(g)O=(0,G.resolveUrl)(this.opts.uriResolver,O,g);return new H({schema:j,schemaId:E,root:B,baseId:O})}return Z.call(this,q,I)}X.resolveSchema=w;var A=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Z(B,{baseId:V,schema:q,root:L}){var O;if(((O=B.fragment)===null||O===void 0?void 0:O[0])!=="/")return;for(let j of B.fragment.slice(1).split("/")){if(typeof q==="boolean")return;let E=q[(0,$.unescapeFragment)(j)];if(E===void 0)return;q=E;let g=typeof q==="object"&&q[this.opts.schemaId];if(!A.has(j)&&g)V=(0,G.resolveUrl)(this.opts.uriResolver,V,g)}let D;if(typeof q!="boolean"&&q.$ref&&!(0,$.schemaHasRulesButRef)(q,this.RULES)){let j=(0,G.resolveUrl)(this.opts.uriResolver,V,q.$ref);D=w.call(this,L,j)}let{schemaId:I}=this.opts;if(D=D||new H({schema:q,schemaId:I,root:L,baseId:V}),D.schema!==D.root.schema)return D;return}}),QW=i((X,Q)=>{Q.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}}),JW=i((X,Q)=>{var J={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};Q.exports={HEX:J}}),YW=i((X,Q)=>{var{HEX:J}=JW(),Y=/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u;function G(B){if(z(B,".")<3)return{host:B,isIPV4:!1};let V=B.match(Y)||[],[q]=V;if(q)return{host:U(q,"."),isIPV4:!0};else return{host:B,isIPV4:!1}}function $(B,V=!1){let q="",L=!0;for(let O of B){if(J[O]===void 0)return;if(O!=="0"&&L===!0)L=!1;if(!L)q+=O}if(V&&q.length===0)q="0";return q}function W(B){let V=0,q={error:!1,address:"",zone:""},L=[],O=[],D=!1,I=!1,j=!1;function E(){if(O.length){if(D===!1){let g=$(O);if(g!==void 0)L.push(g);else return q.error=!0,!1}O.length=0}return!0}for(let g=0;g<B.length;g++){let k=B[g];if(k==="["||k==="]")continue;if(k===":"){if(I===!0)j=!0;if(!E())break;if(V++,L.push(":"),V>7){q.error=!0;break}if(g-1>=0&&B[g-1]===":")I=!0;continue}else if(k==="%"){if(!E())break;D=!0}else{O.push(k);continue}}if(O.length)if(D)q.zone=O.join("");else if(j)L.push(O.join(""));else L.push($(O));return q.address=L.join(""),q}function H(B){if(z(B,":")<2)return{host:B,isIPV6:!1};let V=W(B);if(!V.error){let{address:q,address:L}=V;if(V.zone)q+="%"+V.zone,L+="%25"+V.zone;return{host:q,escapedHost:L,isIPV6:!0}}else return{host:B,isIPV6:!1}}function U(B,V){let q="",L=!0,O=B.length;for(let D=0;D<O;D++){let I=B[D];if(I==="0"&&L){if(D+1<=O&&B[D+1]===V||D+1===O)q+=I,L=!1}else{if(I===V)L=!0;else L=!1;q+=I}}return q}function z(B,V){let q=0;for(let L=0;L<B.length;L++)if(B[L]===V)q++;return q}var F=/^\.\.?\//u,K=/^\/\.(?:\/|$)/u,M=/^\/\.\.(?:\/|$)/u,R=/^\/?(?:.|\n)*?(?=\/|$)/u;function w(B){let V=[];while(B.length)if(B.match(F))B=B.replace(F,"");else if(B.match(K))B=B.replace(K,"/");else if(B.match(M))B=B.replace(M,"/"),V.pop();else if(B==="."||B==="..")B="";else{let q=B.match(R);if(q){let L=q[0];B=B.slice(L.length),V.push(L)}else throw Error("Unexpected dot segment condition")}return V.join("")}function A(B,V){let q=V!==!0?escape:unescape;if(B.scheme!==void 0)B.scheme=q(B.scheme);if(B.userinfo!==void 0)B.userinfo=q(B.userinfo);if(B.host!==void 0)B.host=q(B.host);if(B.path!==void 0)B.path=q(B.path);if(B.query!==void 0)B.query=q(B.query);if(B.fragment!==void 0)B.fragment=q(B.fragment);return B}function Z(B){let V=[];if(B.userinfo!==void 0)V.push(B.userinfo),V.push("@");if(B.host!==void 0){let q=unescape(B.host),L=G(q);if(L.isIPV4)q=L.host;else{let O=H(L.host);if(O.isIPV6===!0)q=`[${O.escapedHost}]`;else q=B.host}V.push(q)}if(typeof B.port==="number"||typeof B.port==="string")V.push(":"),V.push(String(B.port));return V.length?V.join(""):void 0}Q.exports={recomposeAuthority:Z,normalizeComponentEncoding:A,removeDotSegments:w,normalizeIPv4:G,normalizeIPv6:H,stringArrayToHexStripped:$}}),GW=i((X,Q)=>{var J=/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu,Y=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function G(L){return typeof L.secure==="boolean"?L.secure:String(L.scheme).toLowerCase()==="wss"}function $(L){if(!L.host)L.error=L.error||"HTTP URIs must have a host.";return L}function W(L){let O=String(L.scheme).toLowerCase()==="https";if(L.port===(O?443:80)||L.port==="")L.port=void 0;if(!L.path)L.path="/";return L}function H(L){return L.secure=G(L),L.resourceName=(L.path||"/")+(L.query?"?"+L.query:""),L.path=void 0,L.query=void 0,L}function U(L){if(L.port===(G(L)?443:80)||L.port==="")L.port=void 0;if(typeof L.secure==="boolean")L.scheme=L.secure?"wss":"ws",L.secure=void 0;if(L.resourceName){let[O,D]=L.resourceName.split("?");L.path=O&&O!=="/"?O:void 0,L.query=D,L.resourceName=void 0}return L.fragment=void 0,L}function z(L,O){if(!L.path)return L.error="URN can not be parsed",L;let D=L.path.match(Y);if(D){let I=O.scheme||L.scheme||"urn";L.nid=D[1].toLowerCase(),L.nss=D[2];let j=`${I}:${O.nid||L.nid}`,E=q[j];if(L.path=void 0,E)L=E.parse(L,O)}else L.error=L.error||"URN can not be parsed.";return L}function F(L,O){let D=O.scheme||L.scheme||"urn",I=L.nid.toLowerCase(),j=`${D}:${O.nid||I}`,E=q[j];if(E)L=E.serialize(L,O);let g=L,k=L.nss;return g.path=`${I||O.nid}:${k}`,O.skipEscape=!0,g}function K(L,O){let D=L;if(D.uuid=D.nss,D.nss=void 0,!O.tolerant&&(!D.uuid||!J.test(D.uuid)))D.error=D.error||"UUID is not valid.";return D}function M(L){let O=L;return O.nss=(L.uuid||"").toLowerCase(),O}var R={scheme:"http",domainHost:!0,parse:$,serialize:W},w={scheme:"https",domainHost:R.domainHost,parse:$,serialize:W},A={scheme:"ws",domainHost:!0,parse:H,serialize:U},Z={scheme:"wss",domainHost:A.domainHost,parse:A.parse,serialize:A.serialize},B={scheme:"urn",parse:z,serialize:F,skipNormalize:!0},V={scheme:"urn:uuid",parse:K,serialize:M,skipNormalize:!0},q={http:R,https:w,ws:A,wss:Z,urn:B,"urn:uuid":V};Q.exports=q}),$W=i((X,Q)=>{var{normalizeIPv6:J,normalizeIPv4:Y,removeDotSegments:G,recomposeAuthority:$,normalizeComponentEncoding:W}=YW(),H=GW();function U(V,q){if(typeof V==="string")V=M(Z(V,q),q);else if(typeof V==="object")V=Z(M(V,q),q);return V}function z(V,q,L){let O=Object.assign({scheme:"null"},L),D=F(Z(V,O),Z(q,O),O,!0);return M(D,{...O,skipEscape:!0})}function F(V,q,L,O){let D={};if(!O)V=Z(M(V,L),L),q=Z(M(q,L),L);if(L=L||{},!L.tolerant&&q.scheme)D.scheme=q.scheme,D.userinfo=q.userinfo,D.host=q.host,D.port=q.port,D.path=G(q.path||""),D.query=q.query;else{if(q.userinfo!==void 0||q.host!==void 0||q.port!==void 0)D.userinfo=q.userinfo,D.host=q.host,D.port=q.port,D.path=G(q.path||""),D.query=q.query;else{if(!q.path)if(D.path=V.path,q.query!==void 0)D.query=q.query;else D.query=V.query;else{if(q.path.charAt(0)==="/")D.path=G(q.path);else{if((V.userinfo!==void 0||V.host!==void 0||V.port!==void 0)&&!V.path)D.path="/"+q.path;else if(!V.path)D.path=q.path;else D.path=V.path.slice(0,V.path.lastIndexOf("/")+1)+q.path;D.path=G(D.path)}D.query=q.query}D.userinfo=V.userinfo,D.host=V.host,D.port=V.port}D.scheme=V.scheme}return D.fragment=q.fragment,D}function K(V,q,L){if(typeof V==="string")V=unescape(V),V=M(W(Z(V,L),!0),{...L,skipEscape:!0});else if(typeof V==="object")V=M(W(V,!0),{...L,skipEscape:!0});if(typeof q==="string")q=unescape(q),q=M(W(Z(q,L),!0),{...L,skipEscape:!0});else if(typeof q==="object")q=M(W(q,!0),{...L,skipEscape:!0});return V.toLowerCase()===q.toLowerCase()}function M(V,q){let L={host:V.host,scheme:V.scheme,userinfo:V.userinfo,port:V.port,path:V.path,query:V.query,nid:V.nid,nss:V.nss,uuid:V.uuid,fragment:V.fragment,reference:V.reference,resourceName:V.resourceName,secure:V.secure,error:""},O=Object.assign({},q),D=[],I=H[(O.scheme||L.scheme||"").toLowerCase()];if(I&&I.serialize)I.serialize(L,O);if(L.path!==void 0)if(!O.skipEscape){if(L.path=escape(L.path),L.scheme!==void 0)L.path=L.path.split("%3A").join(":")}else L.path=unescape(L.path);if(O.reference!=="suffix"&&L.scheme)D.push(L.scheme,":");let j=$(L);if(j!==void 0){if(O.reference!=="suffix")D.push("//");if(D.push(j),L.path&&L.path.charAt(0)!=="/")D.push("/")}if(L.path!==void 0){let E=L.path;if(!O.absolutePath&&(!I||!I.absolutePath))E=G(E);if(j===void 0)E=E.replace(/^\/\//u,"/%2F");D.push(E)}if(L.query!==void 0)D.push("?",L.query);if(L.fragment!==void 0)D.push("#",L.fragment);return D.join("")}var R=Array.from({length:127},(V,q)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(q)));function w(V){let q=0;for(let L=0,O=V.length;L<O;++L)if(q=V.charCodeAt(L),q>126||R[q])return!0;return!1}var A=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function Z(V,q){let L=Object.assign({},q),O={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},D=V.indexOf("%")!==-1,I=!1;if(L.reference==="suffix")V=(L.scheme?L.scheme+":":"")+"//"+V;let j=V.match(A);if(j){if(O.scheme=j[1],O.userinfo=j[3],O.host=j[4],O.port=parseInt(j[5],10),O.path=j[6]||"",O.query=j[7],O.fragment=j[8],isNaN(O.port))O.port=j[5];if(O.host){let g=Y(O.host);if(g.isIPV4===!1){let k=J(g.host);O.host=k.host.toLowerCase(),I=k.isIPV6}else O.host=g.host,I=!0}if(O.scheme===void 0&&O.userinfo===void 0&&O.host===void 0&&O.port===void 0&&O.query===void 0&&!O.path)O.reference="same-document";else if(O.scheme===void 0)O.reference="relative";else if(O.fragment===void 0)O.reference="absolute";else O.reference="uri";if(L.reference&&L.reference!=="suffix"&&L.reference!==O.reference)O.error=O.error||"URI is not a "+L.reference+" reference.";let E=H[(L.scheme||O.scheme||"").toLowerCase()];if(!L.unicodeSupport&&(!E||!E.unicodeSupport)){if(O.host&&(L.domainHost||E&&E.domainHost)&&I===!1&&w(O.host))try{O.host=URL.domainToASCII(O.host.toLowerCase())}catch(g){O.error=O.error||"Host's domain name can not be converted to ASCII: "+g}}if(!E||E&&!E.skipNormalize){if(D&&O.scheme!==void 0)O.scheme=unescape(O.scheme);if(D&&O.host!==void 0)O.host=unescape(O.host);if(O.path)O.path=escape(unescape(O.path));if(O.fragment)O.fragment=encodeURI(decodeURIComponent(O.fragment))}if(E&&E.parse)E.parse(O,L)}else O.error=O.error||"URI can not be parsed.";return O}var B={SCHEMES:H,normalize:U,resolve:z,resolveComponents:F,equal:K,serialize:M,parse:Z};Q.exports=B,Q.exports.default=B,Q.exports.fastUri=B}),WW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=$W();Q.code='require("ajv/dist/runtime/uri").default',X.default=Q}),HW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.CodeGen=X.Name=X.nil=X.stringify=X.str=X._=X.KeywordCxt=void 0;var Q=$6();Object.defineProperty(X,"KeywordCxt",{enumerable:!0,get:function(){return Q.KeywordCxt}});var J=z0();Object.defineProperty(X,"_",{enumerable:!0,get:function(){return J._}}),Object.defineProperty(X,"str",{enumerable:!0,get:function(){return J.str}}),Object.defineProperty(X,"stringify",{enumerable:!0,get:function(){return J.stringify}}),Object.defineProperty(X,"nil",{enumerable:!0,get:function(){return J.nil}}),Object.defineProperty(X,"Name",{enumerable:!0,get:function(){return J.Name}}),Object.defineProperty(X,"CodeGen",{enumerable:!0,get:function(){return J.CodeGen}});var Y=yX(),G=W6(),$=b4(),W=xX(),H=z0(),U=G6(),z=d8(),F=M0(),K=QW(),M=WW(),R=(S,b)=>new RegExp(S,b);R.code="new RegExp";var w=["removeAdditional","useDefaults","coerceTypes"],A=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),Z={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},B={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},V=200;function q(S){var b,f,N,T,C,r,X0,U0,Q0,S0,G1,P,_,h,a,e,B0,p0,s0,L1,i0,f0,Y9,t0,$X;let k9=S.strict,WX=(b=S.code)===null||b===void 0?void 0:b.optimize,V5=WX===!0||WX===void 0?1:WX||0,M5=(N=(f=S.code)===null||f===void 0?void 0:f.regExp)!==null&&N!==void 0?N:R,vG=(T=S.uriResolver)!==null&&T!==void 0?T:M.default;return{strictSchema:(r=(C=S.strictSchema)!==null&&C!==void 0?C:k9)!==null&&r!==void 0?r:!0,strictNumbers:(U0=(X0=S.strictNumbers)!==null&&X0!==void 0?X0:k9)!==null&&U0!==void 0?U0:!0,strictTypes:(S0=(Q0=S.strictTypes)!==null&&Q0!==void 0?Q0:k9)!==null&&S0!==void 0?S0:"log",strictTuples:(P=(G1=S.strictTuples)!==null&&G1!==void 0?G1:k9)!==null&&P!==void 0?P:"log",strictRequired:(h=(_=S.strictRequired)!==null&&_!==void 0?_:k9)!==null&&h!==void 0?h:!1,code:S.code?{...S.code,optimize:V5,regExp:M5}:{optimize:V5,regExp:M5},loopRequired:(a=S.loopRequired)!==null&&a!==void 0?a:V,loopEnum:(e=S.loopEnum)!==null&&e!==void 0?e:V,meta:(B0=S.meta)!==null&&B0!==void 0?B0:!0,messages:(p0=S.messages)!==null&&p0!==void 0?p0:!0,inlineRefs:(s0=S.inlineRefs)!==null&&s0!==void 0?s0:!0,schemaId:(L1=S.schemaId)!==null&&L1!==void 0?L1:"$id",addUsedSchema:(i0=S.addUsedSchema)!==null&&i0!==void 0?i0:!0,validateSchema:(f0=S.validateSchema)!==null&&f0!==void 0?f0:!0,validateFormats:(Y9=S.validateFormats)!==null&&Y9!==void 0?Y9:!0,unicodeRegExp:(t0=S.unicodeRegExp)!==null&&t0!==void 0?t0:!0,int32range:($X=S.int32range)!==null&&$X!==void 0?$X:!0,uriResolver:vG}}class L{constructor(S={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,S=this.opts={...S,...q(S)};let{es5:b,lines:f}=this.opts.code;this.scope=new H.ValueScope({scope:{},prefixes:A,es5:b,lines:f}),this.logger=x(S.logger);let N=S.validateFormats;if(S.validateFormats=!1,this.RULES=(0,$.getRules)(),O.call(this,Z,S,"NOT SUPPORTED"),O.call(this,B,S,"DEPRECATED","warn"),this._metaOpts=g.call(this),S.formats)j.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),S.keywords)E.call(this,S.keywords);if(typeof S.meta=="object")this.addMetaSchema(S.meta);I.call(this),S.validateFormats=N}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:S,meta:b,schemaId:f}=this.opts,N=K;if(f==="id")N={...K},N.id=N.$id,delete N.$id;if(b&&S)this.addMetaSchema(N,N[f],!1)}defaultMeta(){let{meta:S,schemaId:b}=this.opts;return this.opts.defaultMeta=typeof S=="object"?S[b]||S:void 0}validate(S,b){let f;if(typeof S=="string"){if(f=this.getSchema(S),!f)throw Error(`no schema with key or ref "${S}"`)}else f=this.compile(S);let N=f(b);if(!("$async"in f))this.errors=f.errors;return N}compile(S,b){let f=this._addSchema(S,b);return f.validate||this._compileSchemaEnv(f)}compileAsync(S,b){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:f}=this.opts;return N.call(this,S,b);async function N(Q0,S0){await T.call(this,Q0.$schema);let G1=this._addSchema(Q0,S0);return G1.validate||C.call(this,G1)}async function T(Q0){if(Q0&&!this.getSchema(Q0))await N.call(this,{$ref:Q0},!0)}async function C(Q0){try{return this._compileSchemaEnv(Q0)}catch(S0){if(!(S0 instanceof G.default))throw S0;return r.call(this,S0),await X0.call(this,S0.missingSchema),C.call(this,Q0)}}function r({missingSchema:Q0,missingRef:S0}){if(this.refs[Q0])throw Error(`AnySchema ${Q0} is loaded but ${S0} cannot be resolved`)}async function X0(Q0){let S0=await U0.call(this,Q0);if(!this.refs[Q0])await T.call(this,S0.$schema);if(!this.refs[Q0])this.addSchema(S0,Q0,b)}async function U0(Q0){let S0=this._loading[Q0];if(S0)return S0;try{return await(this._loading[Q0]=f(Q0))}finally{delete this._loading[Q0]}}}addSchema(S,b,f,N=this.opts.validateSchema){if(Array.isArray(S)){for(let C of S)this.addSchema(C,void 0,f,N);return this}let T;if(typeof S==="object"){let{schemaId:C}=this.opts;if(T=S[C],T!==void 0&&typeof T!="string")throw Error(`schema ${C} must be string`)}return b=(0,U.normalizeId)(b||T),this._checkUnique(b),this.schemas[b]=this._addSchema(S,f,b,N,!0),this}addMetaSchema(S,b,f=this.opts.validateSchema){return this.addSchema(S,b,!0,f),this}validateSchema(S,b){if(typeof S=="boolean")return!0;let f;if(f=S.$schema,f!==void 0&&typeof f!="string")throw Error("$schema must be a string");if(f=f||this.opts.defaultMeta||this.defaultMeta(),!f)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let N=this.validate(f,S);if(!N&&b){let T="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(T);else throw Error(T)}return N}getSchema(S){let b;while(typeof(b=D.call(this,S))=="string")S=b;if(b===void 0){let{schemaId:f}=this.opts,N=new W.SchemaEnv({schema:{},schemaId:f});if(b=W.resolveSchema.call(this,N,S),!b)return;this.refs[S]=b}return b.validate||this._compileSchemaEnv(b)}removeSchema(S){if(S instanceof RegExp)return this._removeAllSchemas(this.schemas,S),this._removeAllSchemas(this.refs,S),this;switch(typeof S){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let b=D.call(this,S);if(typeof b=="object")this._cache.delete(b.schema);return delete this.schemas[S],delete this.refs[S],this}case"object":{let b=S;this._cache.delete(b);let f=S[this.opts.schemaId];if(f)f=(0,U.normalizeId)(f),delete this.schemas[f],delete this.refs[f];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(S){for(let b of S)this.addKeyword(b);return this}addKeyword(S,b){let f;if(typeof S=="string"){if(f=S,typeof b=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),b.keyword=f}else if(typeof S=="object"&&b===void 0){if(b=S,f=b.keyword,Array.isArray(f)&&!f.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(l.call(this,f,b),!b)return(0,F.eachItem)(f,(T)=>Y0.call(this,T)),this;_0.call(this,b);let N={...b,type:(0,z.getJSONTypes)(b.type),schemaType:(0,z.getJSONTypes)(b.schemaType)};return(0,F.eachItem)(f,N.type.length===0?(T)=>Y0.call(this,T,N):(T)=>N.type.forEach((C)=>Y0.call(this,T,N,C))),this}getKeyword(S){let b=this.RULES.all[S];return typeof b=="object"?b.definition:!!b}removeKeyword(S){let{RULES:b}=this;delete b.keywords[S],delete b.all[S];for(let f of b.rules){let N=f.rules.findIndex((T)=>T.keyword===S);if(N>=0)f.rules.splice(N,1)}return this}addFormat(S,b){if(typeof b=="string")b=new RegExp(b);return this.formats[S]=b,this}errorsText(S=this.errors,{separator:b=", ",dataVar:f="data"}={}){if(!S||S.length===0)return"No errors";return S.map((N)=>`${f}${N.instancePath} ${N.message}`).reduce((N,T)=>N+b+T)}$dataMetaSchema(S,b){let f=this.RULES.all;S=JSON.parse(JSON.stringify(S));for(let N of b){let T=N.split("/").slice(1),C=S;for(let r of T)C=C[r];for(let r in f){let X0=f[r];if(typeof X0!="object")continue;let{$data:U0}=X0.definition,Q0=C[r];if(U0&&Q0)C[r]=q0(Q0)}}return S}_removeAllSchemas(S,b){for(let f in S){let N=S[f];if(!b||b.test(f)){if(typeof N=="string")delete S[f];else if(N&&!N.meta)this._cache.delete(N.schema),delete S[f]}}}_addSchema(S,b,f,N=this.opts.validateSchema,T=this.opts.addUsedSchema){let C,{schemaId:r}=this.opts;if(typeof S=="object")C=S[r];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof S!="boolean")throw Error("schema must be object or boolean");let X0=this._cache.get(S);if(X0!==void 0)return X0;f=(0,U.normalizeId)(C||f);let U0=U.getSchemaRefs.call(this,S,f);if(X0=new W.SchemaEnv({schema:S,schemaId:r,meta:b,baseId:f,localRefs:U0}),this._cache.set(X0.schema,X0),T&&!f.startsWith("#")){if(f)this._checkUnique(f);this.refs[f]=X0}if(N)this.validateSchema(S,!0);return X0}_checkUnique(S){if(this.schemas[S]||this.refs[S])throw Error(`schema with key or id "${S}" already exists`)}_compileSchemaEnv(S){if(S.meta)this._compileMetaSchema(S);else W.compileSchema.call(this,S);if(!S.validate)throw Error("ajv implementation error");return S.validate}_compileMetaSchema(S){let b=this.opts;this.opts=this._metaOpts;try{W.compileSchema.call(this,S)}finally{this.opts=b}}}L.ValidationError=Y.default,L.MissingRefError=G.default,X.default=L;function O(S,b,f,N="error"){for(let T in S){let C=T;if(C in b)this.logger[N](`${f}: option ${T}. ${S[C]}`)}}function D(S){return S=(0,U.normalizeId)(S),this.schemas[S]||this.refs[S]}function I(){let S=this.opts.schemas;if(!S)return;if(Array.isArray(S))this.addSchema(S);else for(let b in S)this.addSchema(S[b],b)}function j(){for(let S in this.opts.formats){let b=this.opts.formats[S];if(b)this.addFormat(S,b)}}function E(S){if(Array.isArray(S)){this.addVocabulary(S);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let b in S){let f=S[b];if(!f.keyword)f.keyword=b;this.addKeyword(f)}}function g(){let S={...this.opts};for(let b of w)delete S[b];return S}var k={log(){},warn(){},error(){}};function x(S){if(S===!1)return k;if(S===void 0)return console;if(S.log&&S.warn&&S.error)return S;throw Error("logger must implement log, warn and error methods")}var u=/^[a-z_$][a-z0-9_$:-]*$/i;function l(S,b){let{RULES:f}=this;if((0,F.eachItem)(S,(N)=>{if(f.keywords[N])throw Error(`Keyword ${N} is already defined`);if(!u.test(N))throw Error(`Keyword ${N} has invalid name`)}),!b)return;if(b.$data&&!(("code"in b)||("validate"in b)))throw Error('$data keyword must have "code" or "validate" function')}function Y0(S,b,f){var N;let T=b===null||b===void 0?void 0:b.post;if(f&&T)throw Error('keyword with "post" flag cannot have "type"');let{RULES:C}=this,r=T?C.post:C.rules.find(({type:U0})=>U0===f);if(!r)r={type:f,rules:[]},C.rules.push(r);if(C.keywords[S]=!0,!b)return;let X0={keyword:S,definition:{...b,type:(0,z.getJSONTypes)(b.type),schemaType:(0,z.getJSONTypes)(b.schemaType)}};if(b.before)Z0.call(this,r,X0,b.before);else r.rules.push(X0);C.all[S]=X0,(N=b.implements)===null||N===void 0||N.forEach((U0)=>this.addKeyword(U0))}function Z0(S,b,f){let N=S.rules.findIndex((T)=>T.keyword===f);if(N>=0)S.rules.splice(N,0,b);else S.rules.push(b),this.logger.warn(`rule ${f} is not defined`)}function _0(S){let{metaSchema:b}=S;if(b===void 0)return;if(S.$data&&this.opts.$data)b=q0(b);S.validateSchema=this.compile(b,!0)}var h0={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function q0(S){return{anyOf:[S,h0]}}}),UW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};X.default=Q}),zW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.callRef=X.getValidate=void 0;var Q=W6(),J=U1(),Y=z0(),G=v1(),$=xX(),W=M0(),H={keyword:"$ref",schemaType:"string",code(F){let{gen:K,schema:M,it:R}=F,{baseId:w,schemaEnv:A,validateName:Z,opts:B,self:V}=R,{root:q}=A;if((M==="#"||M==="#/")&&w===q.baseId)return O();let L=$.resolveRef.call(V,q,w,M);if(L===void 0)throw new Q.default(R.opts.uriResolver,w,M);if(L instanceof $.SchemaEnv)return D(L);return I(L);function O(){if(A===q)return z(F,Z,A,A.$async);let j=K.scopeValue("root",{ref:q});return z(F,Y._`${j}.validate`,q,q.$async)}function D(j){let E=U(F,j);z(F,E,j,j.$async)}function I(j){let E=K.scopeValue("schema",B.code.source===!0?{ref:j,code:(0,Y.stringify)(j)}:{ref:j}),g=K.name("valid"),k=F.subschema({schema:j,dataTypes:[],schemaPath:Y.nil,topSchemaRef:E,errSchemaPath:M},g);F.mergeEvaluated(k),F.ok(g)}}};function U(F,K){let{gen:M}=F;return K.validate?M.scopeValue("validate",{ref:K.validate}):Y._`${M.scopeValue("wrapper",{ref:K})}.validate`}X.getValidate=U;function z(F,K,M,R){let{gen:w,it:A}=F,{allErrors:Z,schemaEnv:B,opts:V}=A,q=V.passContext?G.default.this:Y.nil;if(R)L();else O();function L(){if(!B.$async)throw Error("async schema referenced by sync schema");let j=w.let("valid");w.try(()=>{if(w.code(Y._`await ${(0,J.callValidateCode)(F,K,q)}`),I(K),!Z)w.assign(j,!0)},(E)=>{if(w.if(Y._`!(${E} instanceof ${A.ValidationError})`,()=>w.throw(E)),D(E),!Z)w.assign(j,!1)}),F.ok(j)}function O(){F.result((0,J.callValidateCode)(F,K,q),()=>I(K),()=>D(K))}function D(j){let E=Y._`${j}.errors`;w.assign(G.default.vErrors,Y._`${G.default.vErrors} === null ? ${E} : ${G.default.vErrors}.concat(${E})`),w.assign(G.default.errors,Y._`${G.default.vErrors}.length`)}function I(j){var E;if(!A.opts.unevaluated)return;let g=(E=M===null||M===void 0?void 0:M.validate)===null||E===void 0?void 0:E.evaluated;if(A.props!==!0)if(g&&!g.dynamicProps){if(g.props!==void 0)A.props=W.mergeEvaluated.props(w,g.props,A.props)}else{let k=w.var("props",Y._`${j}.evaluated.props`);A.props=W.mergeEvaluated.props(w,k,A.props,Y.Name)}if(A.items!==!0)if(g&&!g.dynamicItems){if(g.items!==void 0)A.items=W.mergeEvaluated.items(w,g.items,A.items)}else{let k=w.var("items",Y._`${j}.evaluated.items`);A.items=W.mergeEvaluated.items(w,k,A.items,Y.Name)}}}X.callRef=z,X.default=H}),BW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=UW(),J=zW(),Y=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",Q.default,J.default];X.default=Y}),LW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=z0(),J=Q.operators,Y={maximum:{okStr:"<=",ok:J.LTE,fail:J.GT},minimum:{okStr:">=",ok:J.GTE,fail:J.LT},exclusiveMaximum:{okStr:"<",ok:J.LT,fail:J.GTE},exclusiveMinimum:{okStr:">",ok:J.GT,fail:J.LTE}},G={message:({keyword:W,schemaCode:H})=>Q.str`must be ${Y[W].okStr} ${H}`,params:({keyword:W,schemaCode:H})=>Q._`{comparison: ${Y[W].okStr}, limit: ${H}}`},$={keyword:Object.keys(Y),type:"number",schemaType:"number",$data:!0,error:G,code(W){let{keyword:H,data:U,schemaCode:z}=W;W.fail$data(Q._`${U} ${Y[H].fail} ${z} || isNaN(${U})`)}};X.default=$}),qW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=z0(),J={message:({schemaCode:G})=>Q.str`must be multiple of ${G}`,params:({schemaCode:G})=>Q._`{multipleOf: ${G}}`},Y={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:J,code(G){let{gen:$,data:W,schemaCode:H,it:U}=G,z=U.opts.multipleOfPrecision,F=$.let("res"),K=z?Q._`Math.abs(Math.round(${F}) - ${F}) > 1e-${z}`:Q._`${F} !== parseInt(${F})`;G.fail$data(Q._`(${H} === 0 || (${F} = ${W}/${H}, ${K}))`)}};X.default=Y}),FW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});function Q(J){let Y=J.length,G=0,$=0,W;while($<Y)if(G++,W=J.charCodeAt($++),W>=55296&&W<=56319&&$<Y){if(W=J.charCodeAt($),(W&64512)===56320)$++}return G}X.default=Q,Q.code='require("ajv/dist/runtime/ucs2length").default'}),KW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=z0(),J=M0(),Y=FW(),G={message({keyword:W,schemaCode:H}){let U=W==="maxLength"?"more":"fewer";return Q.str`must NOT have ${U} than ${H} characters`},params:({schemaCode:W})=>Q._`{limit: ${W}}`},$={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:G,code(W){let{keyword:H,data:U,schemaCode:z,it:F}=W,K=H==="maxLength"?Q.operators.GT:Q.operators.LT,M=F.opts.unicode===!1?Q._`${U}.length`:Q._`${(0,J.useFunc)(W.gen,Y.default)}(${U})`;W.fail$data(Q._`${M} ${K} ${z}`)}};X.default=$}),VW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=U1(),J=z0(),Y={message:({schemaCode:$})=>J.str`must match pattern "${$}"`,params:({schemaCode:$})=>J._`{pattern: ${$}}`},G={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:Y,code($){let{data:W,$data:H,schema:U,schemaCode:z,it:F}=$,K=F.opts.unicodeRegExp?"u":"",M=H?J._`(new RegExp(${z}, ${K}))`:(0,Q.usePattern)($,U);$.fail$data(J._`!${M}.test(${W})`)}};X.default=G}),MW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=z0(),J={message({keyword:G,schemaCode:$}){let W=G==="maxProperties"?"more":"fewer";return Q.str`must NOT have ${W} than ${$} properties`},params:({schemaCode:G})=>Q._`{limit: ${G}}`},Y={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:J,code(G){let{keyword:$,data:W,schemaCode:H}=G,U=$==="maxProperties"?Q.operators.GT:Q.operators.LT;G.fail$data(Q._`Object.keys(${W}).length ${U} ${H}`)}};X.default=Y}),DW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=U1(),J=z0(),Y=M0(),G={message:({params:{missingProperty:W}})=>J.str`must have required property '${W}'`,params:({params:{missingProperty:W}})=>J._`{missingProperty: ${W}}`},$={keyword:"required",type:"object",schemaType:"array",$data:!0,error:G,code(W){let{gen:H,schema:U,schemaCode:z,data:F,$data:K,it:M}=W,{opts:R}=M;if(!K&&U.length===0)return;let w=U.length>=R.loopRequired;if(M.allErrors)A();else Z();if(R.strictRequired){let q=W.parentSchema.properties,{definedProperties:L}=W.it;for(let O of U)if((q===null||q===void 0?void 0:q[O])===void 0&&!L.has(O)){let D=M.schemaEnv.baseId+M.errSchemaPath,I=`required property "${O}" is not defined at "${D}" (strictRequired)`;(0,Y.checkStrictMode)(M,I,M.opts.strictRequired)}}function A(){if(w||K)W.block$data(J.nil,B);else for(let q of U)(0,Q.checkReportMissingProp)(W,q)}function Z(){let q=H.let("missing");if(w||K){let L=H.let("valid",!0);W.block$data(L,()=>V(q,L)),W.ok(L)}else H.if((0,Q.checkMissingProp)(W,U,q)),(0,Q.reportMissingProp)(W,q),H.else()}function B(){H.forOf("prop",z,(q)=>{W.setParams({missingProperty:q}),H.if((0,Q.noPropertyInData)(H,F,q,R.ownProperties),()=>W.error())})}function V(q,L){W.setParams({missingProperty:q}),H.forOf(q,z,()=>{H.assign(L,(0,Q.propertyInData)(H,F,q,R.ownProperties)),H.if((0,J.not)(L),()=>{W.error(),H.break()})},J.nil)}}};X.default=$}),ZW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=z0(),J={message({keyword:G,schemaCode:$}){let W=G==="maxItems"?"more":"fewer";return Q.str`must NOT have ${W} than ${$} items`},params:({schemaCode:G})=>Q._`{limit: ${G}}`},Y={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:J,code(G){let{keyword:$,data:W,schemaCode:H}=G,U=$==="maxItems"?Q.operators.GT:Q.operators.LT;G.fail$data(Q._`${W}.length ${U} ${H}`)}};X.default=Y}),gX=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=_4();Q.code='require("ajv/dist/runtime/equal").default',X.default=Q}),OW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=d8(),J=z0(),Y=M0(),G=gX(),$={message:({params:{i:H,j:U}})=>J.str`must NOT have duplicate items (items ## ${U} and ${H} are identical)`,params:({params:{i:H,j:U}})=>J._`{i: ${H}, j: ${U}}`},W={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:$,code(H){let{gen:U,data:z,$data:F,schema:K,parentSchema:M,schemaCode:R,it:w}=H;if(!F&&!K)return;let A=U.let("valid"),Z=M.items?(0,Q.getSchemaTypes)(M.items):[];H.block$data(A,B,J._`${R} === false`),H.ok(A);function B(){let O=U.let("i",J._`${z}.length`),D=U.let("j");H.setParams({i:O,j:D}),U.assign(A,!0),U.if(J._`${O} > 1`,()=>(V()?q:L)(O,D))}function V(){return Z.length>0&&!Z.some((O)=>O==="object"||O==="array")}function q(O,D){let I=U.name("item"),j=(0,Q.checkDataTypes)(Z,I,w.opts.strictNumbers,Q.DataType.Wrong),E=U.const("indices",J._`{}`);U.for(J._`;${O}--;`,()=>{if(U.let(I,J._`${z}[${O}]`),U.if(j,J._`continue`),Z.length>1)U.if(J._`typeof ${I} == "string"`,J._`${I} += "_"`);U.if(J._`typeof ${E}[${I}] == "number"`,()=>{U.assign(D,J._`${E}[${I}]`),H.error(),U.assign(A,!1).break()}).code(J._`${E}[${I}] = ${O}`)})}function L(O,D){let I=(0,Y.useFunc)(U,G.default),j=U.name("outer");U.label(j).for(J._`;${O}--;`,()=>U.for(J._`${D} = ${O}; ${D}--;`,()=>U.if(J._`${I}(${z}[${O}], ${z}[${D}])`,()=>{H.error(),U.assign(A,!1).break(j)})))}}};X.default=W}),AW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=z0(),J=M0(),Y=gX(),G={message:"must be equal to constant",params:({schemaCode:W})=>Q._`{allowedValue: ${W}}`},$={keyword:"const",$data:!0,error:G,code(W){let{gen:H,data:U,$data:z,schemaCode:F,schema:K}=W;if(z||K&&typeof K=="object")W.fail$data(Q._`!${(0,J.useFunc)(H,Y.default)}(${U}, ${F})`);else W.fail(Q._`${K} !== ${U}`)}};X.default=$}),NW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=z0(),J=M0(),Y=gX(),G={message:"must be equal to one of the allowed values",params:({schemaCode:W})=>Q._`{allowedValues: ${W}}`},$={keyword:"enum",schemaType:"array",$data:!0,error:G,code(W){let{gen:H,data:U,$data:z,schema:F,schemaCode:K,it:M}=W;if(!z&&F.length===0)throw Error("enum must have non-empty array");let R=F.length>=M.opts.loopEnum,w,A=()=>w!==null&&w!==void 0?w:w=(0,J.useFunc)(H,Y.default),Z;if(R||z)Z=H.let("valid"),W.block$data(Z,B);else{if(!Array.isArray(F))throw Error("ajv implementation error");let q=H.const("vSchema",K);Z=(0,Q.or)(...F.map((L,O)=>V(q,O)))}W.pass(Z);function B(){H.assign(Z,!1),H.forOf("v",K,(q)=>H.if(Q._`${A()}(${U}, ${q})`,()=>H.assign(Z,!0).break()))}function V(q,L){let O=F[L];return typeof O==="object"&&O!==null?Q._`${A()}(${U}, ${q}[${L}])`:Q._`${U} === ${O}`}}};X.default=$}),RW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=LW(),J=qW(),Y=KW(),G=VW(),$=MW(),W=DW(),H=ZW(),U=OW(),z=AW(),F=NW(),K=[Q.default,J.default,Y.default,G.default,$.default,W.default,H.default,U.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},z.default,F.default];X.default=K}),k4=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.validateAdditionalItems=void 0;var Q=z0(),J=M0(),Y={message:({params:{len:W}})=>Q.str`must NOT have more than ${W} items`,params:({params:{len:W}})=>Q._`{limit: ${W}}`},G={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:Y,code(W){let{parentSchema:H,it:U}=W,{items:z}=H;if(!Array.isArray(z)){(0,J.checkStrictMode)(U,'"additionalItems" is ignored when "items" is not an array of schemas');return}$(W,z)}};function $(W,H){let{gen:U,schema:z,data:F,keyword:K,it:M}=W;M.items=!0;let R=U.const("len",Q._`${F}.length`);if(z===!1)W.setParams({len:H.length}),W.pass(Q._`${R} <= ${H.length}`);else if(typeof z=="object"&&!(0,J.alwaysValidSchema)(M,z)){let A=U.var("valid",Q._`${R} <= ${H.length}`);U.if((0,Q.not)(A),()=>w(A)),W.ok(A)}function w(A){U.forRange("i",H.length,R,(Z)=>{if(W.subschema({keyword:K,dataProp:Z,dataPropType:J.Type.Num},A),!M.allErrors)U.if((0,Q.not)(A),()=>U.break())})}}X.validateAdditionalItems=$,X.default=G}),v4=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.validateTuple=void 0;var Q=z0(),J=M0(),Y=U1(),G={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(W){let{schema:H,it:U}=W;if(Array.isArray(H))return $(W,"additionalItems",H);if(U.items=!0,(0,J.alwaysValidSchema)(U,H))return;W.ok((0,Y.validateArray)(W))}};function $(W,H,U=W.schema){let{gen:z,parentSchema:F,data:K,keyword:M,it:R}=W;if(Z(F),R.opts.unevaluated&&U.length&&R.items!==!0)R.items=J.mergeEvaluated.items(z,U.length,R.items);let w=z.name("valid"),A=z.const("len",Q._`${K}.length`);U.forEach((B,V)=>{if((0,J.alwaysValidSchema)(R,B))return;z.if(Q._`${A} > ${V}`,()=>W.subschema({keyword:M,schemaProp:V,dataProp:V},w)),W.ok(w)});function Z(B){let{opts:V,errSchemaPath:q}=R,L=U.length,O=L===B.minItems&&(L===B.maxItems||B[H]===!1);if(V.strictTuples&&!O){let D=`"${M}" is ${L}-tuple, but minItems or maxItems/${H} are not specified or different at path "${q}"`;(0,J.checkStrictMode)(R,D,V.strictTuples)}}}X.validateTuple=$,X.default=G}),IW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=v4(),J={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(Y)=>(0,Q.validateTuple)(Y,"items")};X.default=J}),jW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=z0(),J=M0(),Y=U1(),G=k4(),$={message:({params:{len:H}})=>Q.str`must NOT have more than ${H} items`,params:({params:{len:H}})=>Q._`{limit: ${H}}`},W={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:$,code(H){let{schema:U,parentSchema:z,it:F}=H,{prefixItems:K}=z;if(F.items=!0,(0,J.alwaysValidSchema)(F,U))return;if(K)(0,G.validateAdditionalItems)(H,K);else H.ok((0,Y.validateArray)(H))}};X.default=W}),wW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=z0(),J=M0(),Y={message:({params:{min:$,max:W}})=>W===void 0?Q.str`must contain at least ${$} valid item(s)`:Q.str`must contain at least ${$} and no more than ${W} valid item(s)`,params:({params:{min:$,max:W}})=>W===void 0?Q._`{minContains: ${$}}`:Q._`{minContains: ${$}, maxContains: ${W}}`},G={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:Y,code($){let{gen:W,schema:H,parentSchema:U,data:z,it:F}=$,K,M,{minContains:R,maxContains:w}=U;if(F.opts.next)K=R===void 0?1:R,M=w;else K=1;let A=W.const("len",Q._`${z}.length`);if($.setParams({min:K,max:M}),M===void 0&&K===0){(0,J.checkStrictMode)(F,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(M!==void 0&&K>M){(0,J.checkStrictMode)(F,'"minContains" > "maxContains" is always invalid'),$.fail();return}if((0,J.alwaysValidSchema)(F,H)){let L=Q._`${A} >= ${K}`;if(M!==void 0)L=Q._`${L} && ${A} <= ${M}`;$.pass(L);return}F.items=!0;let Z=W.name("valid");if(M===void 0&&K===1)V(Z,()=>W.if(Z,()=>W.break()));else if(K===0){if(W.let(Z,!0),M!==void 0)W.if(Q._`${z}.length > 0`,B)}else W.let(Z,!1),B();$.result(Z,()=>$.reset());function B(){let L=W.name("_valid"),O=W.let("count",0);V(L,()=>W.if(L,()=>q(O)))}function V(L,O){W.forRange("i",0,A,(D)=>{$.subschema({keyword:"contains",dataProp:D,dataPropType:J.Type.Num,compositeRule:!0},L),O()})}function q(L){if(W.code(Q._`${L}++`),M===void 0)W.if(Q._`${L} >= ${K}`,()=>W.assign(Z,!0).break());else if(W.if(Q._`${L} > ${M}`,()=>W.assign(Z,!1).break()),K===1)W.assign(Z,!0);else W.if(Q._`${L} >= ${K}`,()=>W.assign(Z,!0))}}};X.default=G}),PW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.validateSchemaDeps=X.validatePropertyDeps=X.error=void 0;var Q=z0(),J=M0(),Y=U1();X.error={message:({params:{property:U,depsCount:z,deps:F}})=>{let K=z===1?"property":"properties";return Q.str`must have ${K} ${F} when property ${U} is present`},params:({params:{property:U,depsCount:z,deps:F,missingProperty:K}})=>Q._`{property: ${U},
170
+ || ${E} === "boolean" || ${I} === null`).assign(g,G._`[${I}]`)}}}function N({gen:F,parentData:L,parentDataProperty:O},D){F.if(G._`${L} !== undefined`,()=>F.assign(G._`${L}[${O}]`,D))}function w(F,L,O,D=W.Correct){let I=D===W.Correct?G.operators.EQ:G.operators.NEQ,j;switch(F){case"null":return G._`${L} ${I} null`;case"array":j=G._`Array.isArray(${L})`;break;case"object":j=G._`${L} && typeof ${L} == "object" && !Array.isArray(${L})`;break;case"integer":j=E(G._`!(${L} % 1) && !isNaN(${L})`);break;case"number":j=E();break;default:return G._`typeof ${L} ${I} ${F}`}return D===W.Correct?j:(0,G.not)(j);function E(g=G.nil){return(0,G.and)(G._`typeof ${L} == "number"`,g,O?G._`isFinite(${L})`:G.nil)}}X.checkDataType=w;function A(F,L,O,D){if(F.length===1)return w(F[0],L,O,D);let I,j=(0,$.toHash)(F);if(j.array&&j.object){let E=G._`typeof ${L} != "object"`;I=j.null?E:G._`!${L} || ${E}`,delete j.null,delete j.array,delete j.object}else I=G.nil;if(j.number)delete j.integer;for(let E in j)I=(0,G.and)(I,w(E,L,O,D));return I}X.checkDataTypes=A;var Z={message:({schema:F})=>`must be ${F}`,params:({schema:F,schemaValue:L})=>typeof F=="string"?G._`{type: ${F}}`:G._`{type: ${L}}`};function z(F){let L=M(F);(0,Y.reportError)(L,Z)}X.reportTypeError=z;function M(F){let{gen:L,data:O,schema:D}=F,I=(0,$.schemaRefOrVal)(F,D,"type");return{gen:L,keyword:"type",data:O,schema:D.type,schemaCode:I,schemaValue:I,parentSchema:D,params:{},it:F}}}),r$=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.assignDefaults=void 0;var Q=B0(),J=D0();function Y($,W){let{properties:H,items:U}=$.schema;if(W==="object"&&H)for(let B in H)G($,B,H[B].default);else if(W==="array"&&Array.isArray(U))U.forEach((B,q)=>G($,q,B.default))}X.assignDefaults=Y;function G($,W,H){let{gen:U,compositeRule:B,data:q,opts:K}=$;if(H===void 0)return;let V=Q._`${q}${(0,Q.getProperty)(W)}`;if(B){(0,J.checkStrictMode)($,`default is ignored for: ${V}`);return}let N=Q._`${V} === undefined`;if(K.useDefaults==="empty")N=Q._`${N} || ${V} === null || ${V} === ""`;U.if(N,Q._`${V} = ${(0,Q.stringify)(H)}`)}}),H1=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.validateUnion=X.validateArray=X.usePattern=X.callValidateCode=X.schemaProperties=X.allSchemaProperties=X.noPropertyInData=X.propertyInData=X.isOwnProperty=X.hasPropFunc=X.reportMissingProp=X.checkMissingProp=X.checkReportMissingProp=void 0;var Q=B0(),J=D0(),Y=v1(),G=D0();function $(F,L){let{gen:O,data:D,it:I}=F;O.if(K(O,D,L,I.opts.ownProperties),()=>{F.setParams({missingProperty:Q._`${L}`},!0),F.error()})}X.checkReportMissingProp=$;function W({gen:F,data:L,it:{opts:O}},D,I){return(0,Q.or)(...D.map((j)=>(0,Q.and)(K(F,L,j,O.ownProperties),Q._`${I} = ${j}`)))}X.checkMissingProp=W;function H(F,L){F.setParams({missingProperty:L},!0),F.error()}X.reportMissingProp=H;function U(F){return F.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:Q._`Object.prototype.hasOwnProperty`})}X.hasPropFunc=U;function B(F,L,O){return Q._`${U(F)}.call(${L}, ${O})`}X.isOwnProperty=B;function q(F,L,O,D){let I=Q._`${L}${(0,Q.getProperty)(O)} !== undefined`;return D?Q._`${I} && ${B(F,L,O)}`:I}X.propertyInData=q;function K(F,L,O,D){let I=Q._`${L}${(0,Q.getProperty)(O)} === undefined`;return D?(0,Q.or)(I,(0,Q.not)(B(F,L,O))):I}X.noPropertyInData=K;function V(F){return F?Object.keys(F).filter((L)=>L!=="__proto__"):[]}X.allSchemaProperties=V;function N(F,L){return V(L).filter((O)=>!(0,J.alwaysValidSchema)(F,L[O]))}X.schemaProperties=N;function w({schemaCode:F,data:L,it:{gen:O,topSchemaRef:D,schemaPath:I,errorPath:j},it:E},g,k,x){let u=x?Q._`${F}, ${L}, ${D}${I}`:L,l=[[Y.default.instancePath,(0,Q.strConcat)(Y.default.instancePath,j)],[Y.default.parentData,E.parentData],[Y.default.parentDataProperty,E.parentDataProperty],[Y.default.rootData,Y.default.rootData]];if(E.opts.dynamicRef)l.push([Y.default.dynamicAnchors,Y.default.dynamicAnchors]);let Y0=Q._`${u}, ${O.object(...l)}`;return k!==Q.nil?Q._`${g}.call(${k}, ${Y0})`:Q._`${g}(${Y0})`}X.callValidateCode=w;var A=Q._`new RegExp`;function Z({gen:F,it:{opts:L}},O){let D=L.unicodeRegExp?"u":"",{regExp:I}=L.code,j=I(O,D);return F.scopeValue("pattern",{key:j.toString(),ref:j,code:Q._`${I.code==="new RegExp"?A:(0,G.useFunc)(F,I)}(${O}, ${D})`})}X.usePattern=Z;function z(F){let{gen:L,data:O,keyword:D,it:I}=F,j=L.name("valid");if(I.allErrors){let g=L.let("valid",!0);return E(()=>L.assign(g,!1)),g}return L.var(j,!0),E(()=>L.break()),j;function E(g){let k=L.const("len",Q._`${O}.length`);L.forRange("i",0,k,(x)=>{F.subschema({keyword:D,dataProp:x,dataPropType:J.Type.Num},j),L.if((0,Q.not)(j),g)})}}X.validateArray=z;function M(F){let{gen:L,schema:O,keyword:D,it:I}=F;if(!Array.isArray(O))throw Error("ajv implementation error");if(O.some((k)=>(0,J.alwaysValidSchema)(I,k))&&!I.opts.unevaluated)return;let E=L.let("valid",!1),g=L.name("_valid");L.block(()=>O.forEach((k,x)=>{let u=F.subschema({keyword:D,schemaProp:x,compositeRule:!0},g);if(L.assign(E,Q._`${E} || ${g}`),!F.mergeValidEvaluated(u,g))L.if((0,Q.not)(E))})),F.result(E,()=>F.reset(),()=>F.error(!0))}X.validateUnion=M}),o$=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.validateKeywordUsage=X.validSchemaType=X.funcKeywordCode=X.macroKeywordCode=void 0;var Q=B0(),J=v1(),Y=H1(),G=Q6();function $(N,w){let{gen:A,keyword:Z,schema:z,parentSchema:M,it:F}=N,L=w.macro.call(F.self,z,M,F),O=q(A,Z,L);if(F.opts.validateSchema!==!1)F.self.validateSchema(L,!0);let D=A.name("valid");N.subschema({schema:L,schemaPath:Q.nil,errSchemaPath:`${F.errSchemaPath}/${Z}`,topSchemaRef:O,compositeRule:!0},D),N.pass(D,()=>N.error(!0))}X.macroKeywordCode=$;function W(N,w){var A;let{gen:Z,keyword:z,schema:M,parentSchema:F,$data:L,it:O}=N;B(O,w);let D=!L&&w.compile?w.compile.call(O.self,M,F,O):w.validate,I=q(Z,z,D),j=Z.let("valid");N.block$data(j,E),N.ok((A=w.valid)!==null&&A!==void 0?A:j);function E(){if(w.errors===!1){if(x(),w.modifying)H(N);u(()=>N.error())}else{let l=w.async?g():k();if(w.modifying)H(N);u(()=>U(N,l))}}function g(){let l=Z.let("ruleErrs",null);return Z.try(()=>x(Q._`await `),(Y0)=>Z.assign(j,!1).if(Q._`${Y0} instanceof ${O.ValidationError}`,()=>Z.assign(l,Q._`${Y0}.errors`),()=>Z.throw(Y0))),l}function k(){let l=Q._`${I}.errors`;return Z.assign(l,null),x(Q.nil),l}function x(l=w.async?Q._`await `:Q.nil){let Y0=O.opts.passContext?J.default.this:J.default.self,O0=!(("compile"in w)&&!L||w.schema===!1);Z.assign(j,Q._`${l}${(0,Y.callValidateCode)(N,I,Y0,O0)}`,w.modifying)}function u(l){var Y0;Z.if((0,Q.not)((Y0=w.valid)!==null&&Y0!==void 0?Y0:j),l)}}X.funcKeywordCode=W;function H(N){let{gen:w,data:A,it:Z}=N;w.if(Z.parentData,()=>w.assign(A,Q._`${Z.parentData}[${Z.parentDataProperty}]`))}function U(N,w){let{gen:A}=N;A.if(Q._`Array.isArray(${w})`,()=>{A.assign(J.default.vErrors,Q._`${J.default.vErrors} === null ? ${w} : ${J.default.vErrors}.concat(${w})`).assign(J.default.errors,Q._`${J.default.vErrors}.length`),(0,G.extendErrors)(N)},()=>N.error())}function B({schemaEnv:N},w){if(w.async&&!N.$async)throw Error("async keyword in sync schema")}function q(N,w,A){if(A===void 0)throw Error(`keyword "${w}" failed to compile`);return N.scopeValue("keyword",typeof A=="function"?{ref:A}:{ref:A,code:(0,Q.stringify)(A)})}function K(N,w,A=!1){return!w.length||w.some((Z)=>Z==="array"?Array.isArray(N):Z==="object"?N&&typeof N=="object"&&!Array.isArray(N):typeof N==Z||A&&typeof N>"u")}X.validSchemaType=K;function V({schema:N,opts:w,self:A,errSchemaPath:Z},z,M){if(Array.isArray(z.keyword)?!z.keyword.includes(M):z.keyword!==M)throw Error("ajv implementation error");let F=z.dependencies;if(F===null||F===void 0?void 0:F.some((L)=>!Object.prototype.hasOwnProperty.call(N,L)))throw Error(`parent schema must have dependencies of ${M}: ${F.join(",")}`);if(z.validateSchema){if(!z.validateSchema(N[M])){let O=`keyword "${M}" value is invalid at path "${Z}": `+A.errorsText(z.validateSchema.errors);if(w.validateSchema==="log")A.logger.error(O);else throw Error(O)}}}X.validateKeywordUsage=V}),a$=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.extendSubschemaMode=X.extendSubschemaData=X.getSubschema=void 0;var Q=B0(),J=D0();function Y(W,{keyword:H,schemaProp:U,schema:B,schemaPath:q,errSchemaPath:K,topSchemaRef:V}){if(H!==void 0&&B!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(H!==void 0){let N=W.schema[H];return U===void 0?{schema:N,schemaPath:Q._`${W.schemaPath}${(0,Q.getProperty)(H)}`,errSchemaPath:`${W.errSchemaPath}/${H}`}:{schema:N[U],schemaPath:Q._`${W.schemaPath}${(0,Q.getProperty)(H)}${(0,Q.getProperty)(U)}`,errSchemaPath:`${W.errSchemaPath}/${H}/${(0,J.escapeFragment)(U)}`}}if(B!==void 0){if(q===void 0||K===void 0||V===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:B,schemaPath:q,topSchemaRef:V,errSchemaPath:K}}throw Error('either "keyword" or "schema" must be passed')}X.getSubschema=Y;function G(W,H,{dataProp:U,dataPropType:B,data:q,dataTypes:K,propertyName:V}){if(q!==void 0&&U!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:N}=H;if(U!==void 0){let{errorPath:A,dataPathArr:Z,opts:z}=H,M=N.let("data",Q._`${H.data}${(0,Q.getProperty)(U)}`,!0);w(M),W.errorPath=Q.str`${A}${(0,J.getErrorPath)(U,B,z.jsPropertySyntax)}`,W.parentDataProperty=Q._`${U}`,W.dataPathArr=[...Z,W.parentDataProperty]}if(q!==void 0){let A=q instanceof Q.Name?q:N.let("data",q,!0);if(w(A),V!==void 0)W.propertyName=V}if(K)W.dataTypes=K;function w(A){W.data=A,W.dataLevel=H.dataLevel+1,W.dataTypes=[],H.definedProperties=new Set,W.parentData=H.data,W.dataNames=[...H.dataNames,A]}}X.extendSubschemaData=G;function $(W,{jtdDiscriminator:H,jtdMetadata:U,compositeRule:B,createErrors:q,allErrors:K}){if(B!==void 0)W.compositeRule=B;if(q!==void 0)W.createErrors=q;if(K!==void 0)W.allErrors=K;W.jtdDiscriminator=H,W.jtdMetadata=U}X.extendSubschemaMode=$}),S5=i((X,Q)=>{Q.exports=function J(Y,G){if(Y===G)return!0;if(Y&&G&&typeof Y=="object"&&typeof G=="object"){if(Y.constructor!==G.constructor)return!1;var $,W,H;if(Array.isArray(Y)){if($=Y.length,$!=G.length)return!1;for(W=$;W--!==0;)if(!J(Y[W],G[W]))return!1;return!0}if(Y.constructor===RegExp)return Y.source===G.source&&Y.flags===G.flags;if(Y.valueOf!==Object.prototype.valueOf)return Y.valueOf()===G.valueOf();if(Y.toString!==Object.prototype.toString)return Y.toString()===G.toString();if(H=Object.keys(Y),$=H.length,$!==Object.keys(G).length)return!1;for(W=$;W--!==0;)if(!Object.prototype.hasOwnProperty.call(G,H[W]))return!1;for(W=$;W--!==0;){var U=H[W];if(!J(Y[U],G[U]))return!1}return!0}return Y!==Y&&G!==G}}),s$=i((X,Q)=>{var J=Q.exports=function($,W,H){if(typeof W=="function")H=W,W={};H=W.cb||H;var U=typeof H=="function"?H:H.pre||function(){},B=H.post||function(){};Y(W,U,B,$,"",$)};J.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},J.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},J.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},J.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function Y($,W,H,U,B,q,K,V,N,w){if(U&&typeof U=="object"&&!Array.isArray(U)){W(U,B,q,K,V,N,w);for(var A in U){var Z=U[A];if(Array.isArray(Z)){if(A in J.arrayKeywords)for(var z=0;z<Z.length;z++)Y($,W,H,Z[z],B+"/"+A+"/"+z,q,B,A,U,z)}else if(A in J.propsKeywords){if(Z&&typeof Z=="object")for(var M in Z)Y($,W,H,Z[M],B+"/"+A+"/"+G(M),q,B,A,U,M)}else if(A in J.keywords||$.allKeys&&!(A in J.skipKeywords))Y($,W,H,Z,B+"/"+A,q,B,A,U)}H(U,B,q,K,V,N,w)}}function G($){return $.replace(/~/g,"~0").replace(/\//g,"~1")}}),J6=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.getSchemaRefs=X.resolveUrl=X.normalizeId=X._getFullPath=X.getFullPath=X.inlineRef=void 0;var Q=D0(),J=S5(),Y=s$(),G=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function $(Z,z=!0){if(typeof Z=="boolean")return!0;if(z===!0)return!H(Z);if(!z)return!1;return U(Z)<=z}X.inlineRef=$;var W=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function H(Z){for(let z in Z){if(W.has(z))return!0;let M=Z[z];if(Array.isArray(M)&&M.some(H))return!0;if(typeof M=="object"&&H(M))return!0}return!1}function U(Z){let z=0;for(let M in Z){if(M==="$ref")return 1/0;if(z++,G.has(M))continue;if(typeof Z[M]=="object")(0,Q.eachItem)(Z[M],(F)=>z+=U(F));if(z===1/0)return 1/0}return z}function B(Z,z="",M){if(M!==!1)z=V(z);let F=Z.parse(z);return q(Z,F)}X.getFullPath=B;function q(Z,z){return Z.serialize(z).split("#")[0]+"#"}X._getFullPath=q;var K=/#\/?$/;function V(Z){return Z?Z.replace(K,""):""}X.normalizeId=V;function N(Z,z,M){return M=V(M),Z.resolve(z,M)}X.resolveUrl=N;var w=/^[a-z_][-a-z0-9._]*$/i;function A(Z,z){if(typeof Z=="boolean")return{};let{schemaId:M,uriResolver:F}=this.opts,L=V(Z[M]||z),O={"":L},D=B(F,L,!1),I={},j=new Set;return Y(Z,{allKeys:!0},(k,x,u,l)=>{if(l===void 0)return;let Y0=D+x,O0=O[l];if(typeof k[M]=="string")O0=_0.call(this,k[M]);h0.call(this,k.$anchor),h0.call(this,k.$dynamicAnchor),O[x]=O0;function _0(q0){let S=this.opts.uriResolver.resolve;if(q0=V(O0?S(O0,q0):q0),j.has(q0))throw g(q0);j.add(q0);let b=this.refs[q0];if(typeof b=="string")b=this.refs[b];if(typeof b=="object")E(k,b.schema,q0);else if(q0!==V(Y0))if(q0[0]==="#")E(k,I[q0],q0),I[q0]=k;else this.refs[q0]=Y0;return q0}function h0(q0){if(typeof q0=="string"){if(!w.test(q0))throw Error(`invalid anchor "${q0}"`);_0.call(this,`#${q0}`)}}}),I;function E(k,x,u){if(x!==void 0&&!J(k,x))throw g(u)}function g(k){return Error(`reference "${k}" resolves to more than one schema`)}}X.getSchemaRefs=A}),Y6=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.getData=X.KeywordCxt=X.validateFunctionCode=void 0;var Q=n$(),J=c8(),Y=T5(),G=c8(),$=r$(),W=o$(),H=a$(),U=B0(),B=v1(),q=J6(),K=D0(),V=Q6();function N(P){if(D(P)){if(j(P),O(P)){z(P);return}}w(P,()=>(0,Q.topBoolOrEmptySchema)(P))}X.validateFunctionCode=N;function w({gen:P,validateName:_,schema:h,schemaEnv:a,opts:e},z0){if(e.code.es5)P.func(_,U._`${B.default.data}, ${B.default.valCxt}`,a.$async,()=>{P.code(U._`"use strict"; ${F(h,e)}`),Z(P,e),P.code(z0)});else P.func(_,U._`${B.default.data}, ${A(e)}`,a.$async,()=>P.code(F(h,e)).code(z0))}function A(P){return U._`{${B.default.instancePath}="", ${B.default.parentData}, ${B.default.parentDataProperty}, ${B.default.rootData}=${B.default.data}${P.dynamicRef?U._`, ${B.default.dynamicAnchors}={}`:U.nil}}={}`}function Z(P,_){P.if(B.default.valCxt,()=>{if(P.var(B.default.instancePath,U._`${B.default.valCxt}.${B.default.instancePath}`),P.var(B.default.parentData,U._`${B.default.valCxt}.${B.default.parentData}`),P.var(B.default.parentDataProperty,U._`${B.default.valCxt}.${B.default.parentDataProperty}`),P.var(B.default.rootData,U._`${B.default.valCxt}.${B.default.rootData}`),_.dynamicRef)P.var(B.default.dynamicAnchors,U._`${B.default.valCxt}.${B.default.dynamicAnchors}`)},()=>{if(P.var(B.default.instancePath,U._`""`),P.var(B.default.parentData,U._`undefined`),P.var(B.default.parentDataProperty,U._`undefined`),P.var(B.default.rootData,B.default.data),_.dynamicRef)P.var(B.default.dynamicAnchors,U._`{}`)})}function z(P){let{schema:_,opts:h,gen:a}=P;w(P,()=>{if(h.$comment&&_.$comment)l(P);if(k(P),a.let(B.default.vErrors,null),a.let(B.default.errors,0),h.unevaluated)M(P);E(P),Y0(P)});return}function M(P){let{gen:_,validateName:h}=P;P.evaluated=_.const("evaluated",U._`${h}.evaluated`),_.if(U._`${P.evaluated}.dynamicProps`,()=>_.assign(U._`${P.evaluated}.props`,U._`undefined`)),_.if(U._`${P.evaluated}.dynamicItems`,()=>_.assign(U._`${P.evaluated}.items`,U._`undefined`))}function F(P,_){let h=typeof P=="object"&&P[_.schemaId];return h&&(_.code.source||_.code.process)?U._`/*# sourceURL=${h} */`:U.nil}function L(P,_){if(D(P)){if(j(P),O(P)){I(P,_);return}}(0,Q.boolOrEmptySchema)(P,_)}function O({schema:P,self:_}){if(typeof P=="boolean")return!P;for(let h in P)if(_.RULES.all[h])return!0;return!1}function D(P){return typeof P.schema!="boolean"}function I(P,_){let{schema:h,gen:a,opts:e}=P;if(e.$comment&&h.$comment)l(P);x(P),u(P);let z0=a.const("_errs",B.default.errors);E(P,z0),a.var(_,U._`${z0} === ${B.default.errors}`)}function j(P){(0,K.checkUnknownRules)(P),g(P)}function E(P,_){if(P.opts.jtd)return _0(P,[],!1,_);let h=(0,J.getSchemaTypes)(P.schema),a=(0,J.coerceAndCheckDataType)(P,h);_0(P,h,!a,_)}function g(P){let{schema:_,errSchemaPath:h,opts:a,self:e}=P;if(_.$ref&&a.ignoreKeywordsWithRef&&(0,K.schemaHasRulesButRef)(_,e.RULES))e.logger.warn(`$ref: keywords ignored in schema at path "${h}"`)}function k(P){let{schema:_,opts:h}=P;if(_.default!==void 0&&h.useDefaults&&h.strictSchema)(0,K.checkStrictMode)(P,"default is ignored in the schema root")}function x(P){let _=P.schema[P.opts.schemaId];if(_)P.baseId=(0,q.resolveUrl)(P.opts.uriResolver,P.baseId,_)}function u(P){if(P.schema.$async&&!P.schemaEnv.$async)throw Error("async schema in sync schema")}function l({gen:P,schemaEnv:_,schema:h,errSchemaPath:a,opts:e}){let z0=h.$comment;if(e.$comment===!0)P.code(U._`${B.default.self}.logger.log(${z0})`);else if(typeof e.$comment=="function"){let p0=U.str`${a}/$comment`,s0=P.scopeValue("root",{ref:_.root});P.code(U._`${B.default.self}.opts.$comment(${z0}, ${p0}, ${s0}.schema)`)}}function Y0(P){let{gen:_,schemaEnv:h,validateName:a,ValidationError:e,opts:z0}=P;if(h.$async)_.if(U._`${B.default.errors} === 0`,()=>_.return(B.default.data),()=>_.throw(U._`new ${e}(${B.default.vErrors})`));else{if(_.assign(U._`${a}.errors`,B.default.vErrors),z0.unevaluated)O0(P);_.return(U._`${B.default.errors} === 0`)}}function O0({gen:P,evaluated:_,props:h,items:a}){if(h instanceof U.Name)P.assign(U._`${_}.props`,h);if(a instanceof U.Name)P.assign(U._`${_}.items`,a)}function _0(P,_,h,a){let{gen:e,schema:z0,data:p0,allErrors:s0,opts:L1,self:i0}=P,{RULES:f0}=i0;if(z0.$ref&&(L1.ignoreKeywordsWithRef||!(0,K.schemaHasRulesButRef)(z0,f0))){e.block(()=>U0(P,"$ref",f0.all.$ref.definition));return}if(!L1.jtd)q0(P,_);e.block(()=>{for(let t0 of f0.rules)Y9(t0);Y9(f0.post)});function Y9(t0){if(!(0,Y.shouldUseGroup)(z0,t0))return;if(t0.type){if(e.if((0,G.checkDataType)(t0.type,p0,L1.strictNumbers)),h0(P,t0),_.length===1&&_[0]===t0.type&&h)e.else(),(0,G.reportTypeError)(P);e.endIf()}else h0(P,t0);if(!s0)e.if(U._`${B.default.errors} === ${a||0}`)}}function h0(P,_){let{gen:h,schema:a,opts:{useDefaults:e}}=P;if(e)(0,$.assignDefaults)(P,_.type);h.block(()=>{for(let z0 of _.rules)if((0,Y.shouldUseRule)(a,z0))U0(P,z0.keyword,z0.definition,_.type)})}function q0(P,_){if(P.schemaEnv.meta||!P.opts.strictTypes)return;if(S(P,_),!P.opts.allowUnionTypes)b(P,_);f(P,P.dataTypes)}function S(P,_){if(!_.length)return;if(!P.dataTypes.length){P.dataTypes=_;return}_.forEach((h)=>{if(!T(P.dataTypes,h))r(P,`type "${h}" not allowed by context "${P.dataTypes.join(",")}"`)}),C(P,_)}function b(P,_){if(_.length>1&&!(_.length===2&&_.includes("null")))r(P,"use allowUnionTypes to allow union type keyword")}function f(P,_){let h=P.self.RULES.all;for(let a in h){let e=h[a];if(typeof e=="object"&&(0,Y.shouldUseRule)(P.schema,e)){let{type:z0}=e.definition;if(z0.length&&!z0.some((p0)=>R(_,p0)))r(P,`missing type "${z0.join(",")}" for keyword "${a}"`)}}}function R(P,_){return P.includes(_)||_==="number"&&P.includes("integer")}function T(P,_){return P.includes(_)||_==="integer"&&P.includes("number")}function C(P,_){let h=[];for(let a of P.dataTypes)if(T(_,a))h.push(a);else if(_.includes("integer")&&a==="number")h.push("integer");P.dataTypes=h}function r(P,_){let h=P.schemaEnv.baseId+P.errSchemaPath;_+=` at "${h}" (strictTypes)`,(0,K.checkStrictMode)(P,_,P.opts.strictTypes)}class X0{constructor(P,_,h){if((0,W.validateKeywordUsage)(P,_,h),this.gen=P.gen,this.allErrors=P.allErrors,this.keyword=h,this.data=P.data,this.schema=P.schema[h],this.$data=_.$data&&P.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,K.schemaRefOrVal)(P,this.schema,h,this.$data),this.schemaType=_.schemaType,this.parentSchema=P.schema,this.params={},this.it=P,this.def=_,this.$data)this.schemaCode=P.gen.const("vSchema",G1(this.$data,P));else if(this.schemaCode=this.schemaValue,!(0,W.validSchemaType)(this.schema,_.schemaType,_.allowUndefined))throw Error(`${h} value must be ${JSON.stringify(_.schemaType)}`);if("code"in _?_.trackErrors:_.errors!==!1)this.errsCount=P.gen.const("_errs",B.default.errors)}result(P,_,h){this.failResult((0,U.not)(P),_,h)}failResult(P,_,h){if(this.gen.if(P),h)h();else this.error();if(_){if(this.gen.else(),_(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass(P,_){this.failResult((0,U.not)(P),void 0,_)}fail(P){if(P===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(P),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(P){if(!this.$data)return this.fail(P);let{schemaCode:_}=this;this.fail(U._`${_} !== undefined && (${(0,U.or)(this.invalid$data(),P)})`)}error(P,_,h){if(_){this.setParams(_),this._error(P,h),this.setParams({});return}this._error(P,h)}_error(P,_){(P?V.reportExtraError:V.reportError)(this,this.def.error,_)}$dataError(){(0,V.reportError)(this,this.def.$dataError||V.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,V.resetErrorsCount)(this.gen,this.errsCount)}ok(P){if(!this.allErrors)this.gen.if(P)}setParams(P,_){if(_)Object.assign(this.params,P);else this.params=P}block$data(P,_,h=U.nil){this.gen.block(()=>{this.check$data(P,h),_()})}check$data(P=U.nil,_=U.nil){if(!this.$data)return;let{gen:h,schemaCode:a,schemaType:e,def:z0}=this;if(h.if((0,U.or)(U._`${a} === undefined`,_)),P!==U.nil)h.assign(P,!0);if(e.length||z0.validateSchema){if(h.elseIf(this.invalid$data()),this.$dataError(),P!==U.nil)h.assign(P,!1)}h.else()}invalid$data(){let{gen:P,schemaCode:_,schemaType:h,def:a,it:e}=this;return(0,U.or)(z0(),p0());function z0(){if(h.length){if(!(_ instanceof U.Name))throw Error("ajv implementation error");let s0=Array.isArray(h)?h:[h];return U._`${(0,G.checkDataTypes)(s0,_,e.opts.strictNumbers,G.DataType.Wrong)}`}return U.nil}function p0(){if(a.validateSchema){let s0=P.scopeValue("validate$data",{ref:a.validateSchema});return U._`!${s0}(${_})`}return U.nil}}subschema(P,_){let h=(0,H.getSubschema)(this.it,P);(0,H.extendSubschemaData)(h,this.it,P),(0,H.extendSubschemaMode)(h,P);let a={...this.it,...h,items:void 0,props:void 0};return L(a,_),a}mergeEvaluated(P,_){let{it:h,gen:a}=this;if(!h.opts.unevaluated)return;if(h.props!==!0&&P.props!==void 0)h.props=K.mergeEvaluated.props(a,P.props,h.props,_);if(h.items!==!0&&P.items!==void 0)h.items=K.mergeEvaluated.items(a,P.items,h.items,_)}mergeValidEvaluated(P,_){let{it:h,gen:a}=this;if(h.opts.unevaluated&&(h.props!==!0||h.items!==!0))return a.if(_,()=>this.mergeEvaluated(P,U.Name)),!0}}X.KeywordCxt=X0;function U0(P,_,h,a){let e=new X0(P,h,_);if("code"in h)h.code(e,a);else if(e.$data&&h.validate)(0,W.funcKeywordCode)(e,h);else if("macro"in h)(0,W.macroKeywordCode)(e,h);else if(h.compile||h.validate)(0,W.funcKeywordCode)(e,h)}var Q0=/^\/(?:[^~]|~0|~1)*$/,S0=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function G1(P,{dataLevel:_,dataNames:h,dataPathArr:a}){let e,z0;if(P==="")return B.default.rootData;if(P[0]==="/"){if(!Q0.test(P))throw Error(`Invalid JSON-pointer: ${P}`);e=P,z0=B.default.rootData}else{let i0=S0.exec(P);if(!i0)throw Error(`Invalid JSON-pointer: ${P}`);let f0=+i0[1];if(e=i0[2],e==="#"){if(f0>=_)throw Error(L1("property/index",f0));return a[_-f0]}if(f0>_)throw Error(L1("data",f0));if(z0=h[_-f0],!e)return z0}let p0=z0,s0=e.split("/");for(let i0 of s0)if(i0)z0=U._`${z0}${(0,U.getProperty)((0,K.unescapeJsonPointer)(i0))}`,p0=U._`${p0} && ${z0}`;return p0;function L1(i0,f0){return`Cannot access ${i0} ${f0} levels up, current level is ${_}`}}X.getData=G1}),kX=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});class Q extends Error{constructor(J){super("validation failed");this.errors=J,this.ajv=this.validation=!0}}X.default=Q}),G6=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=J6();class J extends Error{constructor(Y,G,$,W){super(W||`can't resolve reference ${$} from id ${G}`);this.missingRef=(0,Q.resolveUrl)(Y,G,$),this.missingSchema=(0,Q.normalizeId)((0,Q.getFullPath)(Y,this.missingRef))}}X.default=J}),vX=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.resolveSchema=X.getCompilingSchema=X.resolveRef=X.compileSchema=X.SchemaEnv=void 0;var Q=B0(),J=kX(),Y=v1(),G=J6(),$=D0(),W=Y6();class H{constructor(z){var M;this.refs={},this.dynamicAnchors={};let F;if(typeof z.schema=="object")F=z.schema;this.schema=z.schema,this.schemaId=z.schemaId,this.root=z.root||this,this.baseId=(M=z.baseId)!==null&&M!==void 0?M:(0,G.normalizeId)(F===null||F===void 0?void 0:F[z.schemaId||"$id"]),this.schemaPath=z.schemaPath,this.localRefs=z.localRefs,this.meta=z.meta,this.$async=F===null||F===void 0?void 0:F.$async,this.refs={}}}X.SchemaEnv=H;function U(z){let M=K.call(this,z);if(M)return M;let F=(0,G.getFullPath)(this.opts.uriResolver,z.root.baseId),{es5:L,lines:O}=this.opts.code,{ownProperties:D}=this.opts,I=new Q.CodeGen(this.scope,{es5:L,lines:O,ownProperties:D}),j;if(z.$async)j=I.scopeValue("Error",{ref:J.default,code:Q._`require("ajv/dist/runtime/validation_error").default`});let E=I.scopeName("validate");z.validateName=E;let g={gen:I,allErrors:this.opts.allErrors,data:Y.default.data,parentData:Y.default.parentData,parentDataProperty:Y.default.parentDataProperty,dataNames:[Y.default.data],dataPathArr:[Q.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:I.scopeValue("schema",this.opts.code.source===!0?{ref:z.schema,code:(0,Q.stringify)(z.schema)}:{ref:z.schema}),validateName:E,ValidationError:j,schema:z.schema,schemaEnv:z,rootId:F,baseId:z.baseId||F,schemaPath:Q.nil,errSchemaPath:z.schemaPath||(this.opts.jtd?"":"#"),errorPath:Q._`""`,opts:this.opts,self:this},k;try{this._compilations.add(z),(0,W.validateFunctionCode)(g),I.optimize(this.opts.code.optimize);let x=I.toString();if(k=`${I.scopeRefs(Y.default.scope)}return ${x}`,this.opts.code.process)k=this.opts.code.process(k,z);let l=Function(`${Y.default.self}`,`${Y.default.scope}`,k)(this,this.scope.get());if(this.scope.value(E,{ref:l}),l.errors=null,l.schema=z.schema,l.schemaEnv=z,z.$async)l.$async=!0;if(this.opts.code.source===!0)l.source={validateName:E,validateCode:x,scopeValues:I._values};if(this.opts.unevaluated){let{props:Y0,items:O0}=g;if(l.evaluated={props:Y0 instanceof Q.Name?void 0:Y0,items:O0 instanceof Q.Name?void 0:O0,dynamicProps:Y0 instanceof Q.Name,dynamicItems:O0 instanceof Q.Name},l.source)l.source.evaluated=(0,Q.stringify)(l.evaluated)}return z.validate=l,z}catch(x){if(delete z.validate,delete z.validateName,k)this.logger.error("Error compiling schema, function code:",k);throw x}finally{this._compilations.delete(z)}}X.compileSchema=U;function B(z,M,F){var L;F=(0,G.resolveUrl)(this.opts.uriResolver,M,F);let O=z.refs[F];if(O)return O;let D=N.call(this,z,F);if(D===void 0){let I=(L=z.localRefs)===null||L===void 0?void 0:L[F],{schemaId:j}=this.opts;if(I)D=new H({schema:I,schemaId:j,root:z,baseId:M})}if(D===void 0)return;return z.refs[F]=q.call(this,D)}X.resolveRef=B;function q(z){if((0,G.inlineRef)(z.schema,this.opts.inlineRefs))return z.schema;return z.validate?z:U.call(this,z)}function K(z){for(let M of this._compilations)if(V(M,z))return M}X.getCompilingSchema=K;function V(z,M){return z.schema===M.schema&&z.root===M.root&&z.baseId===M.baseId}function N(z,M){let F;while(typeof(F=this.refs[M])=="string")M=F;return F||this.schemas[M]||w.call(this,z,M)}function w(z,M){let F=this.opts.uriResolver.parse(M),L=(0,G._getFullPath)(this.opts.uriResolver,F),O=(0,G.getFullPath)(this.opts.uriResolver,z.baseId,void 0);if(Object.keys(z.schema).length>0&&L===O)return Z.call(this,F,z);let D=(0,G.normalizeId)(L),I=this.refs[D]||this.schemas[D];if(typeof I=="string"){let j=w.call(this,z,I);if(typeof(j===null||j===void 0?void 0:j.schema)!=="object")return;return Z.call(this,F,j)}if(typeof(I===null||I===void 0?void 0:I.schema)!=="object")return;if(!I.validate)U.call(this,I);if(D===(0,G.normalizeId)(M)){let{schema:j}=I,{schemaId:E}=this.opts,g=j[E];if(g)O=(0,G.resolveUrl)(this.opts.uriResolver,O,g);return new H({schema:j,schemaId:E,root:z,baseId:O})}return Z.call(this,F,I)}X.resolveSchema=w;var A=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Z(z,{baseId:M,schema:F,root:L}){var O;if(((O=z.fragment)===null||O===void 0?void 0:O[0])!=="/")return;for(let j of z.fragment.slice(1).split("/")){if(typeof F==="boolean")return;let E=F[(0,$.unescapeFragment)(j)];if(E===void 0)return;F=E;let g=typeof F==="object"&&F[this.opts.schemaId];if(!A.has(j)&&g)M=(0,G.resolveUrl)(this.opts.uriResolver,M,g)}let D;if(typeof F!="boolean"&&F.$ref&&!(0,$.schemaHasRulesButRef)(F,this.RULES)){let j=(0,G.resolveUrl)(this.opts.uriResolver,M,F.$ref);D=w.call(this,L,j)}let{schemaId:I}=this.opts;if(D=D||new H({schema:F,schemaId:I,root:L,baseId:M}),D.schema!==D.root.schema)return D;return}}),t$=i((X,Q)=>{Q.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}}),e$=i((X,Q)=>{var J={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};Q.exports={HEX:J}}),XW=i((X,Q)=>{var{HEX:J}=e$(),Y=/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u;function G(z){if(B(z,".")<3)return{host:z,isIPV4:!1};let M=z.match(Y)||[],[F]=M;if(F)return{host:U(F,"."),isIPV4:!0};else return{host:z,isIPV4:!1}}function $(z,M=!1){let F="",L=!0;for(let O of z){if(J[O]===void 0)return;if(O!=="0"&&L===!0)L=!1;if(!L)F+=O}if(M&&F.length===0)F="0";return F}function W(z){let M=0,F={error:!1,address:"",zone:""},L=[],O=[],D=!1,I=!1,j=!1;function E(){if(O.length){if(D===!1){let g=$(O);if(g!==void 0)L.push(g);else return F.error=!0,!1}O.length=0}return!0}for(let g=0;g<z.length;g++){let k=z[g];if(k==="["||k==="]")continue;if(k===":"){if(I===!0)j=!0;if(!E())break;if(M++,L.push(":"),M>7){F.error=!0;break}if(g-1>=0&&z[g-1]===":")I=!0;continue}else if(k==="%"){if(!E())break;D=!0}else{O.push(k);continue}}if(O.length)if(D)F.zone=O.join("");else if(j)L.push(O.join(""));else L.push($(O));return F.address=L.join(""),F}function H(z){if(B(z,":")<2)return{host:z,isIPV6:!1};let M=W(z);if(!M.error){let{address:F,address:L}=M;if(M.zone)F+="%"+M.zone,L+="%25"+M.zone;return{host:F,escapedHost:L,isIPV6:!0}}else return{host:z,isIPV6:!1}}function U(z,M){let F="",L=!0,O=z.length;for(let D=0;D<O;D++){let I=z[D];if(I==="0"&&L){if(D+1<=O&&z[D+1]===M||D+1===O)F+=I,L=!1}else{if(I===M)L=!0;else L=!1;F+=I}}return F}function B(z,M){let F=0;for(let L=0;L<z.length;L++)if(z[L]===M)F++;return F}var q=/^\.\.?\//u,K=/^\/\.(?:\/|$)/u,V=/^\/\.\.(?:\/|$)/u,N=/^\/?(?:.|\n)*?(?=\/|$)/u;function w(z){let M=[];while(z.length)if(z.match(q))z=z.replace(q,"");else if(z.match(K))z=z.replace(K,"/");else if(z.match(V))z=z.replace(V,"/"),M.pop();else if(z==="."||z==="..")z="";else{let F=z.match(N);if(F){let L=F[0];z=z.slice(L.length),M.push(L)}else throw Error("Unexpected dot segment condition")}return M.join("")}function A(z,M){let F=M!==!0?escape:unescape;if(z.scheme!==void 0)z.scheme=F(z.scheme);if(z.userinfo!==void 0)z.userinfo=F(z.userinfo);if(z.host!==void 0)z.host=F(z.host);if(z.path!==void 0)z.path=F(z.path);if(z.query!==void 0)z.query=F(z.query);if(z.fragment!==void 0)z.fragment=F(z.fragment);return z}function Z(z){let M=[];if(z.userinfo!==void 0)M.push(z.userinfo),M.push("@");if(z.host!==void 0){let F=unescape(z.host),L=G(F);if(L.isIPV4)F=L.host;else{let O=H(L.host);if(O.isIPV6===!0)F=`[${O.escapedHost}]`;else F=z.host}M.push(F)}if(typeof z.port==="number"||typeof z.port==="string")M.push(":"),M.push(String(z.port));return M.length?M.join(""):void 0}Q.exports={recomposeAuthority:Z,normalizeComponentEncoding:A,removeDotSegments:w,normalizeIPv4:G,normalizeIPv6:H,stringArrayToHexStripped:$}}),QW=i((X,Q)=>{var J=/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu,Y=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function G(L){return typeof L.secure==="boolean"?L.secure:String(L.scheme).toLowerCase()==="wss"}function $(L){if(!L.host)L.error=L.error||"HTTP URIs must have a host.";return L}function W(L){let O=String(L.scheme).toLowerCase()==="https";if(L.port===(O?443:80)||L.port==="")L.port=void 0;if(!L.path)L.path="/";return L}function H(L){return L.secure=G(L),L.resourceName=(L.path||"/")+(L.query?"?"+L.query:""),L.path=void 0,L.query=void 0,L}function U(L){if(L.port===(G(L)?443:80)||L.port==="")L.port=void 0;if(typeof L.secure==="boolean")L.scheme=L.secure?"wss":"ws",L.secure=void 0;if(L.resourceName){let[O,D]=L.resourceName.split("?");L.path=O&&O!=="/"?O:void 0,L.query=D,L.resourceName=void 0}return L.fragment=void 0,L}function B(L,O){if(!L.path)return L.error="URN can not be parsed",L;let D=L.path.match(Y);if(D){let I=O.scheme||L.scheme||"urn";L.nid=D[1].toLowerCase(),L.nss=D[2];let j=`${I}:${O.nid||L.nid}`,E=F[j];if(L.path=void 0,E)L=E.parse(L,O)}else L.error=L.error||"URN can not be parsed.";return L}function q(L,O){let D=O.scheme||L.scheme||"urn",I=L.nid.toLowerCase(),j=`${D}:${O.nid||I}`,E=F[j];if(E)L=E.serialize(L,O);let g=L,k=L.nss;return g.path=`${I||O.nid}:${k}`,O.skipEscape=!0,g}function K(L,O){let D=L;if(D.uuid=D.nss,D.nss=void 0,!O.tolerant&&(!D.uuid||!J.test(D.uuid)))D.error=D.error||"UUID is not valid.";return D}function V(L){let O=L;return O.nss=(L.uuid||"").toLowerCase(),O}var N={scheme:"http",domainHost:!0,parse:$,serialize:W},w={scheme:"https",domainHost:N.domainHost,parse:$,serialize:W},A={scheme:"ws",domainHost:!0,parse:H,serialize:U},Z={scheme:"wss",domainHost:A.domainHost,parse:A.parse,serialize:A.serialize},z={scheme:"urn",parse:B,serialize:q,skipNormalize:!0},M={scheme:"urn:uuid",parse:K,serialize:V,skipNormalize:!0},F={http:N,https:w,ws:A,wss:Z,urn:z,"urn:uuid":M};Q.exports=F}),JW=i((X,Q)=>{var{normalizeIPv6:J,normalizeIPv4:Y,removeDotSegments:G,recomposeAuthority:$,normalizeComponentEncoding:W}=XW(),H=QW();function U(M,F){if(typeof M==="string")M=V(Z(M,F),F);else if(typeof M==="object")M=Z(V(M,F),F);return M}function B(M,F,L){let O=Object.assign({scheme:"null"},L),D=q(Z(M,O),Z(F,O),O,!0);return V(D,{...O,skipEscape:!0})}function q(M,F,L,O){let D={};if(!O)M=Z(V(M,L),L),F=Z(V(F,L),L);if(L=L||{},!L.tolerant&&F.scheme)D.scheme=F.scheme,D.userinfo=F.userinfo,D.host=F.host,D.port=F.port,D.path=G(F.path||""),D.query=F.query;else{if(F.userinfo!==void 0||F.host!==void 0||F.port!==void 0)D.userinfo=F.userinfo,D.host=F.host,D.port=F.port,D.path=G(F.path||""),D.query=F.query;else{if(!F.path)if(D.path=M.path,F.query!==void 0)D.query=F.query;else D.query=M.query;else{if(F.path.charAt(0)==="/")D.path=G(F.path);else{if((M.userinfo!==void 0||M.host!==void 0||M.port!==void 0)&&!M.path)D.path="/"+F.path;else if(!M.path)D.path=F.path;else D.path=M.path.slice(0,M.path.lastIndexOf("/")+1)+F.path;D.path=G(D.path)}D.query=F.query}D.userinfo=M.userinfo,D.host=M.host,D.port=M.port}D.scheme=M.scheme}return D.fragment=F.fragment,D}function K(M,F,L){if(typeof M==="string")M=unescape(M),M=V(W(Z(M,L),!0),{...L,skipEscape:!0});else if(typeof M==="object")M=V(W(M,!0),{...L,skipEscape:!0});if(typeof F==="string")F=unescape(F),F=V(W(Z(F,L),!0),{...L,skipEscape:!0});else if(typeof F==="object")F=V(W(F,!0),{...L,skipEscape:!0});return M.toLowerCase()===F.toLowerCase()}function V(M,F){let L={host:M.host,scheme:M.scheme,userinfo:M.userinfo,port:M.port,path:M.path,query:M.query,nid:M.nid,nss:M.nss,uuid:M.uuid,fragment:M.fragment,reference:M.reference,resourceName:M.resourceName,secure:M.secure,error:""},O=Object.assign({},F),D=[],I=H[(O.scheme||L.scheme||"").toLowerCase()];if(I&&I.serialize)I.serialize(L,O);if(L.path!==void 0)if(!O.skipEscape){if(L.path=escape(L.path),L.scheme!==void 0)L.path=L.path.split("%3A").join(":")}else L.path=unescape(L.path);if(O.reference!=="suffix"&&L.scheme)D.push(L.scheme,":");let j=$(L);if(j!==void 0){if(O.reference!=="suffix")D.push("//");if(D.push(j),L.path&&L.path.charAt(0)!=="/")D.push("/")}if(L.path!==void 0){let E=L.path;if(!O.absolutePath&&(!I||!I.absolutePath))E=G(E);if(j===void 0)E=E.replace(/^\/\//u,"/%2F");D.push(E)}if(L.query!==void 0)D.push("?",L.query);if(L.fragment!==void 0)D.push("#",L.fragment);return D.join("")}var N=Array.from({length:127},(M,F)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(F)));function w(M){let F=0;for(let L=0,O=M.length;L<O;++L)if(F=M.charCodeAt(L),F>126||N[F])return!0;return!1}var A=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function Z(M,F){let L=Object.assign({},F),O={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},D=M.indexOf("%")!==-1,I=!1;if(L.reference==="suffix")M=(L.scheme?L.scheme+":":"")+"//"+M;let j=M.match(A);if(j){if(O.scheme=j[1],O.userinfo=j[3],O.host=j[4],O.port=parseInt(j[5],10),O.path=j[6]||"",O.query=j[7],O.fragment=j[8],isNaN(O.port))O.port=j[5];if(O.host){let g=Y(O.host);if(g.isIPV4===!1){let k=J(g.host);O.host=k.host.toLowerCase(),I=k.isIPV6}else O.host=g.host,I=!0}if(O.scheme===void 0&&O.userinfo===void 0&&O.host===void 0&&O.port===void 0&&O.query===void 0&&!O.path)O.reference="same-document";else if(O.scheme===void 0)O.reference="relative";else if(O.fragment===void 0)O.reference="absolute";else O.reference="uri";if(L.reference&&L.reference!=="suffix"&&L.reference!==O.reference)O.error=O.error||"URI is not a "+L.reference+" reference.";let E=H[(L.scheme||O.scheme||"").toLowerCase()];if(!L.unicodeSupport&&(!E||!E.unicodeSupport)){if(O.host&&(L.domainHost||E&&E.domainHost)&&I===!1&&w(O.host))try{O.host=URL.domainToASCII(O.host.toLowerCase())}catch(g){O.error=O.error||"Host's domain name can not be converted to ASCII: "+g}}if(!E||E&&!E.skipNormalize){if(D&&O.scheme!==void 0)O.scheme=unescape(O.scheme);if(D&&O.host!==void 0)O.host=unescape(O.host);if(O.path)O.path=escape(unescape(O.path));if(O.fragment)O.fragment=encodeURI(decodeURIComponent(O.fragment))}if(E&&E.parse)E.parse(O,L)}else O.error=O.error||"URI can not be parsed.";return O}var z={SCHEMES:H,normalize:U,resolve:B,resolveComponents:q,equal:K,serialize:V,parse:Z};Q.exports=z,Q.exports.default=z,Q.exports.fastUri=z}),YW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=JW();Q.code='require("ajv/dist/runtime/uri").default',X.default=Q}),GW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.CodeGen=X.Name=X.nil=X.stringify=X.str=X._=X.KeywordCxt=void 0;var Q=Y6();Object.defineProperty(X,"KeywordCxt",{enumerable:!0,get:function(){return Q.KeywordCxt}});var J=B0();Object.defineProperty(X,"_",{enumerable:!0,get:function(){return J._}}),Object.defineProperty(X,"str",{enumerable:!0,get:function(){return J.str}}),Object.defineProperty(X,"stringify",{enumerable:!0,get:function(){return J.stringify}}),Object.defineProperty(X,"nil",{enumerable:!0,get:function(){return J.nil}}),Object.defineProperty(X,"Name",{enumerable:!0,get:function(){return J.Name}}),Object.defineProperty(X,"CodeGen",{enumerable:!0,get:function(){return J.CodeGen}});var Y=kX(),G=G6(),$=P5(),W=vX(),H=B0(),U=J6(),B=c8(),q=D0(),K=t$(),V=YW(),N=(S,b)=>new RegExp(S,b);N.code="new RegExp";var w=["removeAdditional","useDefaults","coerceTypes"],A=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),Z={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},z={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},M=200;function F(S){var b,f,R,T,C,r,X0,U0,Q0,S0,G1,P,_,h,a,e,z0,p0,s0,L1,i0,f0,Y9,t0,WX;let v9=S.strict,HX=(b=S.code)===null||b===void 0?void 0:b.optimize,N4=HX===!0||HX===void 0?1:HX||0,R4=(R=(f=S.code)===null||f===void 0?void 0:f.regExp)!==null&&R!==void 0?R:N,cG=(T=S.uriResolver)!==null&&T!==void 0?T:V.default;return{strictSchema:(r=(C=S.strictSchema)!==null&&C!==void 0?C:v9)!==null&&r!==void 0?r:!0,strictNumbers:(U0=(X0=S.strictNumbers)!==null&&X0!==void 0?X0:v9)!==null&&U0!==void 0?U0:!0,strictTypes:(S0=(Q0=S.strictTypes)!==null&&Q0!==void 0?Q0:v9)!==null&&S0!==void 0?S0:"log",strictTuples:(P=(G1=S.strictTuples)!==null&&G1!==void 0?G1:v9)!==null&&P!==void 0?P:"log",strictRequired:(h=(_=S.strictRequired)!==null&&_!==void 0?_:v9)!==null&&h!==void 0?h:!1,code:S.code?{...S.code,optimize:N4,regExp:R4}:{optimize:N4,regExp:R4},loopRequired:(a=S.loopRequired)!==null&&a!==void 0?a:M,loopEnum:(e=S.loopEnum)!==null&&e!==void 0?e:M,meta:(z0=S.meta)!==null&&z0!==void 0?z0:!0,messages:(p0=S.messages)!==null&&p0!==void 0?p0:!0,inlineRefs:(s0=S.inlineRefs)!==null&&s0!==void 0?s0:!0,schemaId:(L1=S.schemaId)!==null&&L1!==void 0?L1:"$id",addUsedSchema:(i0=S.addUsedSchema)!==null&&i0!==void 0?i0:!0,validateSchema:(f0=S.validateSchema)!==null&&f0!==void 0?f0:!0,validateFormats:(Y9=S.validateFormats)!==null&&Y9!==void 0?Y9:!0,unicodeRegExp:(t0=S.unicodeRegExp)!==null&&t0!==void 0?t0:!0,int32range:(WX=S.int32range)!==null&&WX!==void 0?WX:!0,uriResolver:cG}}class L{constructor(S={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,S=this.opts={...S,...F(S)};let{es5:b,lines:f}=this.opts.code;this.scope=new H.ValueScope({scope:{},prefixes:A,es5:b,lines:f}),this.logger=x(S.logger);let R=S.validateFormats;if(S.validateFormats=!1,this.RULES=(0,$.getRules)(),O.call(this,Z,S,"NOT SUPPORTED"),O.call(this,z,S,"DEPRECATED","warn"),this._metaOpts=g.call(this),S.formats)j.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),S.keywords)E.call(this,S.keywords);if(typeof S.meta=="object")this.addMetaSchema(S.meta);I.call(this),S.validateFormats=R}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:S,meta:b,schemaId:f}=this.opts,R=K;if(f==="id")R={...K},R.id=R.$id,delete R.$id;if(b&&S)this.addMetaSchema(R,R[f],!1)}defaultMeta(){let{meta:S,schemaId:b}=this.opts;return this.opts.defaultMeta=typeof S=="object"?S[b]||S:void 0}validate(S,b){let f;if(typeof S=="string"){if(f=this.getSchema(S),!f)throw Error(`no schema with key or ref "${S}"`)}else f=this.compile(S);let R=f(b);if(!("$async"in f))this.errors=f.errors;return R}compile(S,b){let f=this._addSchema(S,b);return f.validate||this._compileSchemaEnv(f)}compileAsync(S,b){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:f}=this.opts;return R.call(this,S,b);async function R(Q0,S0){await T.call(this,Q0.$schema);let G1=this._addSchema(Q0,S0);return G1.validate||C.call(this,G1)}async function T(Q0){if(Q0&&!this.getSchema(Q0))await R.call(this,{$ref:Q0},!0)}async function C(Q0){try{return this._compileSchemaEnv(Q0)}catch(S0){if(!(S0 instanceof G.default))throw S0;return r.call(this,S0),await X0.call(this,S0.missingSchema),C.call(this,Q0)}}function r({missingSchema:Q0,missingRef:S0}){if(this.refs[Q0])throw Error(`AnySchema ${Q0} is loaded but ${S0} cannot be resolved`)}async function X0(Q0){let S0=await U0.call(this,Q0);if(!this.refs[Q0])await T.call(this,S0.$schema);if(!this.refs[Q0])this.addSchema(S0,Q0,b)}async function U0(Q0){let S0=this._loading[Q0];if(S0)return S0;try{return await(this._loading[Q0]=f(Q0))}finally{delete this._loading[Q0]}}}addSchema(S,b,f,R=this.opts.validateSchema){if(Array.isArray(S)){for(let C of S)this.addSchema(C,void 0,f,R);return this}let T;if(typeof S==="object"){let{schemaId:C}=this.opts;if(T=S[C],T!==void 0&&typeof T!="string")throw Error(`schema ${C} must be string`)}return b=(0,U.normalizeId)(b||T),this._checkUnique(b),this.schemas[b]=this._addSchema(S,f,b,R,!0),this}addMetaSchema(S,b,f=this.opts.validateSchema){return this.addSchema(S,b,!0,f),this}validateSchema(S,b){if(typeof S=="boolean")return!0;let f;if(f=S.$schema,f!==void 0&&typeof f!="string")throw Error("$schema must be a string");if(f=f||this.opts.defaultMeta||this.defaultMeta(),!f)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let R=this.validate(f,S);if(!R&&b){let T="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(T);else throw Error(T)}return R}getSchema(S){let b;while(typeof(b=D.call(this,S))=="string")S=b;if(b===void 0){let{schemaId:f}=this.opts,R=new W.SchemaEnv({schema:{},schemaId:f});if(b=W.resolveSchema.call(this,R,S),!b)return;this.refs[S]=b}return b.validate||this._compileSchemaEnv(b)}removeSchema(S){if(S instanceof RegExp)return this._removeAllSchemas(this.schemas,S),this._removeAllSchemas(this.refs,S),this;switch(typeof S){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let b=D.call(this,S);if(typeof b=="object")this._cache.delete(b.schema);return delete this.schemas[S],delete this.refs[S],this}case"object":{let b=S;this._cache.delete(b);let f=S[this.opts.schemaId];if(f)f=(0,U.normalizeId)(f),delete this.schemas[f],delete this.refs[f];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(S){for(let b of S)this.addKeyword(b);return this}addKeyword(S,b){let f;if(typeof S=="string"){if(f=S,typeof b=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),b.keyword=f}else if(typeof S=="object"&&b===void 0){if(b=S,f=b.keyword,Array.isArray(f)&&!f.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(l.call(this,f,b),!b)return(0,q.eachItem)(f,(T)=>Y0.call(this,T)),this;_0.call(this,b);let R={...b,type:(0,B.getJSONTypes)(b.type),schemaType:(0,B.getJSONTypes)(b.schemaType)};return(0,q.eachItem)(f,R.type.length===0?(T)=>Y0.call(this,T,R):(T)=>R.type.forEach((C)=>Y0.call(this,T,R,C))),this}getKeyword(S){let b=this.RULES.all[S];return typeof b=="object"?b.definition:!!b}removeKeyword(S){let{RULES:b}=this;delete b.keywords[S],delete b.all[S];for(let f of b.rules){let R=f.rules.findIndex((T)=>T.keyword===S);if(R>=0)f.rules.splice(R,1)}return this}addFormat(S,b){if(typeof b=="string")b=new RegExp(b);return this.formats[S]=b,this}errorsText(S=this.errors,{separator:b=", ",dataVar:f="data"}={}){if(!S||S.length===0)return"No errors";return S.map((R)=>`${f}${R.instancePath} ${R.message}`).reduce((R,T)=>R+b+T)}$dataMetaSchema(S,b){let f=this.RULES.all;S=JSON.parse(JSON.stringify(S));for(let R of b){let T=R.split("/").slice(1),C=S;for(let r of T)C=C[r];for(let r in f){let X0=f[r];if(typeof X0!="object")continue;let{$data:U0}=X0.definition,Q0=C[r];if(U0&&Q0)C[r]=q0(Q0)}}return S}_removeAllSchemas(S,b){for(let f in S){let R=S[f];if(!b||b.test(f)){if(typeof R=="string")delete S[f];else if(R&&!R.meta)this._cache.delete(R.schema),delete S[f]}}}_addSchema(S,b,f,R=this.opts.validateSchema,T=this.opts.addUsedSchema){let C,{schemaId:r}=this.opts;if(typeof S=="object")C=S[r];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof S!="boolean")throw Error("schema must be object or boolean");let X0=this._cache.get(S);if(X0!==void 0)return X0;f=(0,U.normalizeId)(C||f);let U0=U.getSchemaRefs.call(this,S,f);if(X0=new W.SchemaEnv({schema:S,schemaId:r,meta:b,baseId:f,localRefs:U0}),this._cache.set(X0.schema,X0),T&&!f.startsWith("#")){if(f)this._checkUnique(f);this.refs[f]=X0}if(R)this.validateSchema(S,!0);return X0}_checkUnique(S){if(this.schemas[S]||this.refs[S])throw Error(`schema with key or id "${S}" already exists`)}_compileSchemaEnv(S){if(S.meta)this._compileMetaSchema(S);else W.compileSchema.call(this,S);if(!S.validate)throw Error("ajv implementation error");return S.validate}_compileMetaSchema(S){let b=this.opts;this.opts=this._metaOpts;try{W.compileSchema.call(this,S)}finally{this.opts=b}}}L.ValidationError=Y.default,L.MissingRefError=G.default,X.default=L;function O(S,b,f,R="error"){for(let T in S){let C=T;if(C in b)this.logger[R](`${f}: option ${T}. ${S[C]}`)}}function D(S){return S=(0,U.normalizeId)(S),this.schemas[S]||this.refs[S]}function I(){let S=this.opts.schemas;if(!S)return;if(Array.isArray(S))this.addSchema(S);else for(let b in S)this.addSchema(S[b],b)}function j(){for(let S in this.opts.formats){let b=this.opts.formats[S];if(b)this.addFormat(S,b)}}function E(S){if(Array.isArray(S)){this.addVocabulary(S);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let b in S){let f=S[b];if(!f.keyword)f.keyword=b;this.addKeyword(f)}}function g(){let S={...this.opts};for(let b of w)delete S[b];return S}var k={log(){},warn(){},error(){}};function x(S){if(S===!1)return k;if(S===void 0)return console;if(S.log&&S.warn&&S.error)return S;throw Error("logger must implement log, warn and error methods")}var u=/^[a-z_$][a-z0-9_$:-]*$/i;function l(S,b){let{RULES:f}=this;if((0,q.eachItem)(S,(R)=>{if(f.keywords[R])throw Error(`Keyword ${R} is already defined`);if(!u.test(R))throw Error(`Keyword ${R} has invalid name`)}),!b)return;if(b.$data&&!(("code"in b)||("validate"in b)))throw Error('$data keyword must have "code" or "validate" function')}function Y0(S,b,f){var R;let T=b===null||b===void 0?void 0:b.post;if(f&&T)throw Error('keyword with "post" flag cannot have "type"');let{RULES:C}=this,r=T?C.post:C.rules.find(({type:U0})=>U0===f);if(!r)r={type:f,rules:[]},C.rules.push(r);if(C.keywords[S]=!0,!b)return;let X0={keyword:S,definition:{...b,type:(0,B.getJSONTypes)(b.type),schemaType:(0,B.getJSONTypes)(b.schemaType)}};if(b.before)O0.call(this,r,X0,b.before);else r.rules.push(X0);C.all[S]=X0,(R=b.implements)===null||R===void 0||R.forEach((U0)=>this.addKeyword(U0))}function O0(S,b,f){let R=S.rules.findIndex((T)=>T.keyword===f);if(R>=0)S.rules.splice(R,0,b);else S.rules.push(b),this.logger.warn(`rule ${f} is not defined`)}function _0(S){let{metaSchema:b}=S;if(b===void 0)return;if(S.$data&&this.opts.$data)b=q0(b);S.validateSchema=this.compile(b,!0)}var h0={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function q0(S){return{anyOf:[S,h0]}}}),$W=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};X.default=Q}),WW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.callRef=X.getValidate=void 0;var Q=G6(),J=H1(),Y=B0(),G=v1(),$=vX(),W=D0(),H={keyword:"$ref",schemaType:"string",code(q){let{gen:K,schema:V,it:N}=q,{baseId:w,schemaEnv:A,validateName:Z,opts:z,self:M}=N,{root:F}=A;if((V==="#"||V==="#/")&&w===F.baseId)return O();let L=$.resolveRef.call(M,F,w,V);if(L===void 0)throw new Q.default(N.opts.uriResolver,w,V);if(L instanceof $.SchemaEnv)return D(L);return I(L);function O(){if(A===F)return B(q,Z,A,A.$async);let j=K.scopeValue("root",{ref:F});return B(q,Y._`${j}.validate`,F,F.$async)}function D(j){let E=U(q,j);B(q,E,j,j.$async)}function I(j){let E=K.scopeValue("schema",z.code.source===!0?{ref:j,code:(0,Y.stringify)(j)}:{ref:j}),g=K.name("valid"),k=q.subschema({schema:j,dataTypes:[],schemaPath:Y.nil,topSchemaRef:E,errSchemaPath:V},g);q.mergeEvaluated(k),q.ok(g)}}};function U(q,K){let{gen:V}=q;return K.validate?V.scopeValue("validate",{ref:K.validate}):Y._`${V.scopeValue("wrapper",{ref:K})}.validate`}X.getValidate=U;function B(q,K,V,N){let{gen:w,it:A}=q,{allErrors:Z,schemaEnv:z,opts:M}=A,F=M.passContext?G.default.this:Y.nil;if(N)L();else O();function L(){if(!z.$async)throw Error("async schema referenced by sync schema");let j=w.let("valid");w.try(()=>{if(w.code(Y._`await ${(0,J.callValidateCode)(q,K,F)}`),I(K),!Z)w.assign(j,!0)},(E)=>{if(w.if(Y._`!(${E} instanceof ${A.ValidationError})`,()=>w.throw(E)),D(E),!Z)w.assign(j,!1)}),q.ok(j)}function O(){q.result((0,J.callValidateCode)(q,K,F),()=>I(K),()=>D(K))}function D(j){let E=Y._`${j}.errors`;w.assign(G.default.vErrors,Y._`${G.default.vErrors} === null ? ${E} : ${G.default.vErrors}.concat(${E})`),w.assign(G.default.errors,Y._`${G.default.vErrors}.length`)}function I(j){var E;if(!A.opts.unevaluated)return;let g=(E=V===null||V===void 0?void 0:V.validate)===null||E===void 0?void 0:E.evaluated;if(A.props!==!0)if(g&&!g.dynamicProps){if(g.props!==void 0)A.props=W.mergeEvaluated.props(w,g.props,A.props)}else{let k=w.var("props",Y._`${j}.evaluated.props`);A.props=W.mergeEvaluated.props(w,k,A.props,Y.Name)}if(A.items!==!0)if(g&&!g.dynamicItems){if(g.items!==void 0)A.items=W.mergeEvaluated.items(w,g.items,A.items)}else{let k=w.var("items",Y._`${j}.evaluated.items`);A.items=W.mergeEvaluated.items(w,k,A.items,Y.Name)}}}X.callRef=B,X.default=H}),HW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=$W(),J=WW(),Y=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",Q.default,J.default];X.default=Y}),UW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=B0(),J=Q.operators,Y={maximum:{okStr:"<=",ok:J.LTE,fail:J.GT},minimum:{okStr:">=",ok:J.GTE,fail:J.LT},exclusiveMaximum:{okStr:"<",ok:J.LT,fail:J.GTE},exclusiveMinimum:{okStr:">",ok:J.GT,fail:J.LTE}},G={message:({keyword:W,schemaCode:H})=>Q.str`must be ${Y[W].okStr} ${H}`,params:({keyword:W,schemaCode:H})=>Q._`{comparison: ${Y[W].okStr}, limit: ${H}}`},$={keyword:Object.keys(Y),type:"number",schemaType:"number",$data:!0,error:G,code(W){let{keyword:H,data:U,schemaCode:B}=W;W.fail$data(Q._`${U} ${Y[H].fail} ${B} || isNaN(${U})`)}};X.default=$}),BW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=B0(),J={message:({schemaCode:G})=>Q.str`must be multiple of ${G}`,params:({schemaCode:G})=>Q._`{multipleOf: ${G}}`},Y={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:J,code(G){let{gen:$,data:W,schemaCode:H,it:U}=G,B=U.opts.multipleOfPrecision,q=$.let("res"),K=B?Q._`Math.abs(Math.round(${q}) - ${q}) > 1e-${B}`:Q._`${q} !== parseInt(${q})`;G.fail$data(Q._`(${H} === 0 || (${q} = ${W}/${H}, ${K}))`)}};X.default=Y}),zW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});function Q(J){let Y=J.length,G=0,$=0,W;while($<Y)if(G++,W=J.charCodeAt($++),W>=55296&&W<=56319&&$<Y){if(W=J.charCodeAt($),(W&64512)===56320)$++}return G}X.default=Q,Q.code='require("ajv/dist/runtime/ucs2length").default'}),LW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=B0(),J=D0(),Y=zW(),G={message({keyword:W,schemaCode:H}){let U=W==="maxLength"?"more":"fewer";return Q.str`must NOT have ${U} than ${H} characters`},params:({schemaCode:W})=>Q._`{limit: ${W}}`},$={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:G,code(W){let{keyword:H,data:U,schemaCode:B,it:q}=W,K=H==="maxLength"?Q.operators.GT:Q.operators.LT,V=q.opts.unicode===!1?Q._`${U}.length`:Q._`${(0,J.useFunc)(W.gen,Y.default)}(${U})`;W.fail$data(Q._`${V} ${K} ${B}`)}};X.default=$}),qW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=H1(),J=B0(),Y={message:({schemaCode:$})=>J.str`must match pattern "${$}"`,params:({schemaCode:$})=>J._`{pattern: ${$}}`},G={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:Y,code($){let{data:W,$data:H,schema:U,schemaCode:B,it:q}=$,K=q.opts.unicodeRegExp?"u":"",V=H?J._`(new RegExp(${B}, ${K}))`:(0,Q.usePattern)($,U);$.fail$data(J._`!${V}.test(${W})`)}};X.default=G}),FW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=B0(),J={message({keyword:G,schemaCode:$}){let W=G==="maxProperties"?"more":"fewer";return Q.str`must NOT have ${W} than ${$} properties`},params:({schemaCode:G})=>Q._`{limit: ${G}}`},Y={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:J,code(G){let{keyword:$,data:W,schemaCode:H}=G,U=$==="maxProperties"?Q.operators.GT:Q.operators.LT;G.fail$data(Q._`Object.keys(${W}).length ${U} ${H}`)}};X.default=Y}),KW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=H1(),J=B0(),Y=D0(),G={message:({params:{missingProperty:W}})=>J.str`must have required property '${W}'`,params:({params:{missingProperty:W}})=>J._`{missingProperty: ${W}}`},$={keyword:"required",type:"object",schemaType:"array",$data:!0,error:G,code(W){let{gen:H,schema:U,schemaCode:B,data:q,$data:K,it:V}=W,{opts:N}=V;if(!K&&U.length===0)return;let w=U.length>=N.loopRequired;if(V.allErrors)A();else Z();if(N.strictRequired){let F=W.parentSchema.properties,{definedProperties:L}=W.it;for(let O of U)if((F===null||F===void 0?void 0:F[O])===void 0&&!L.has(O)){let D=V.schemaEnv.baseId+V.errSchemaPath,I=`required property "${O}" is not defined at "${D}" (strictRequired)`;(0,Y.checkStrictMode)(V,I,V.opts.strictRequired)}}function A(){if(w||K)W.block$data(J.nil,z);else for(let F of U)(0,Q.checkReportMissingProp)(W,F)}function Z(){let F=H.let("missing");if(w||K){let L=H.let("valid",!0);W.block$data(L,()=>M(F,L)),W.ok(L)}else H.if((0,Q.checkMissingProp)(W,U,F)),(0,Q.reportMissingProp)(W,F),H.else()}function z(){H.forOf("prop",B,(F)=>{W.setParams({missingProperty:F}),H.if((0,Q.noPropertyInData)(H,q,F,N.ownProperties),()=>W.error())})}function M(F,L){W.setParams({missingProperty:F}),H.forOf(F,B,()=>{H.assign(L,(0,Q.propertyInData)(H,q,F,N.ownProperties)),H.if((0,J.not)(L),()=>{W.error(),H.break()})},J.nil)}}};X.default=$}),VW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=B0(),J={message({keyword:G,schemaCode:$}){let W=G==="maxItems"?"more":"fewer";return Q.str`must NOT have ${W} than ${$} items`},params:({schemaCode:G})=>Q._`{limit: ${G}}`},Y={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:J,code(G){let{keyword:$,data:W,schemaCode:H}=G,U=$==="maxItems"?Q.operators.GT:Q.operators.LT;G.fail$data(Q._`${W}.length ${U} ${H}`)}};X.default=Y}),yX=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=S5();Q.code='require("ajv/dist/runtime/equal").default',X.default=Q}),MW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=c8(),J=B0(),Y=D0(),G=yX(),$={message:({params:{i:H,j:U}})=>J.str`must NOT have duplicate items (items ## ${U} and ${H} are identical)`,params:({params:{i:H,j:U}})=>J._`{i: ${H}, j: ${U}}`},W={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:$,code(H){let{gen:U,data:B,$data:q,schema:K,parentSchema:V,schemaCode:N,it:w}=H;if(!q&&!K)return;let A=U.let("valid"),Z=V.items?(0,Q.getSchemaTypes)(V.items):[];H.block$data(A,z,J._`${N} === false`),H.ok(A);function z(){let O=U.let("i",J._`${B}.length`),D=U.let("j");H.setParams({i:O,j:D}),U.assign(A,!0),U.if(J._`${O} > 1`,()=>(M()?F:L)(O,D))}function M(){return Z.length>0&&!Z.some((O)=>O==="object"||O==="array")}function F(O,D){let I=U.name("item"),j=(0,Q.checkDataTypes)(Z,I,w.opts.strictNumbers,Q.DataType.Wrong),E=U.const("indices",J._`{}`);U.for(J._`;${O}--;`,()=>{if(U.let(I,J._`${B}[${O}]`),U.if(j,J._`continue`),Z.length>1)U.if(J._`typeof ${I} == "string"`,J._`${I} += "_"`);U.if(J._`typeof ${E}[${I}] == "number"`,()=>{U.assign(D,J._`${E}[${I}]`),H.error(),U.assign(A,!1).break()}).code(J._`${E}[${I}] = ${O}`)})}function L(O,D){let I=(0,Y.useFunc)(U,G.default),j=U.name("outer");U.label(j).for(J._`;${O}--;`,()=>U.for(J._`${D} = ${O}; ${D}--;`,()=>U.if(J._`${I}(${B}[${O}], ${B}[${D}])`,()=>{H.error(),U.assign(A,!1).break(j)})))}}};X.default=W}),DW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=B0(),J=D0(),Y=yX(),G={message:"must be equal to constant",params:({schemaCode:W})=>Q._`{allowedValue: ${W}}`},$={keyword:"const",$data:!0,error:G,code(W){let{gen:H,data:U,$data:B,schemaCode:q,schema:K}=W;if(B||K&&typeof K=="object")W.fail$data(Q._`!${(0,J.useFunc)(H,Y.default)}(${U}, ${q})`);else W.fail(Q._`${K} !== ${U}`)}};X.default=$}),ZW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=B0(),J=D0(),Y=yX(),G={message:"must be equal to one of the allowed values",params:({schemaCode:W})=>Q._`{allowedValues: ${W}}`},$={keyword:"enum",schemaType:"array",$data:!0,error:G,code(W){let{gen:H,data:U,$data:B,schema:q,schemaCode:K,it:V}=W;if(!B&&q.length===0)throw Error("enum must have non-empty array");let N=q.length>=V.opts.loopEnum,w,A=()=>w!==null&&w!==void 0?w:w=(0,J.useFunc)(H,Y.default),Z;if(N||B)Z=H.let("valid"),W.block$data(Z,z);else{if(!Array.isArray(q))throw Error("ajv implementation error");let F=H.const("vSchema",K);Z=(0,Q.or)(...q.map((L,O)=>M(F,O)))}W.pass(Z);function z(){H.assign(Z,!1),H.forOf("v",K,(F)=>H.if(Q._`${A()}(${U}, ${F})`,()=>H.assign(Z,!0).break()))}function M(F,L){let O=q[L];return typeof O==="object"&&O!==null?Q._`${A()}(${U}, ${F}[${L}])`:Q._`${U} === ${O}`}}};X.default=$}),OW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=UW(),J=BW(),Y=LW(),G=qW(),$=FW(),W=KW(),H=VW(),U=MW(),B=DW(),q=ZW(),K=[Q.default,J.default,Y.default,G.default,$.default,W.default,H.default,U.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},B.default,q.default];X.default=K}),E5=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.validateAdditionalItems=void 0;var Q=B0(),J=D0(),Y={message:({params:{len:W}})=>Q.str`must NOT have more than ${W} items`,params:({params:{len:W}})=>Q._`{limit: ${W}}`},G={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:Y,code(W){let{parentSchema:H,it:U}=W,{items:B}=H;if(!Array.isArray(B)){(0,J.checkStrictMode)(U,'"additionalItems" is ignored when "items" is not an array of schemas');return}$(W,B)}};function $(W,H){let{gen:U,schema:B,data:q,keyword:K,it:V}=W;V.items=!0;let N=U.const("len",Q._`${q}.length`);if(B===!1)W.setParams({len:H.length}),W.pass(Q._`${N} <= ${H.length}`);else if(typeof B=="object"&&!(0,J.alwaysValidSchema)(V,B)){let A=U.var("valid",Q._`${N} <= ${H.length}`);U.if((0,Q.not)(A),()=>w(A)),W.ok(A)}function w(A){U.forRange("i",H.length,N,(Z)=>{if(W.subschema({keyword:K,dataProp:Z,dataPropType:J.Type.Num},A),!V.allErrors)U.if((0,Q.not)(A),()=>U.break())})}}X.validateAdditionalItems=$,X.default=G}),b5=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.validateTuple=void 0;var Q=B0(),J=D0(),Y=H1(),G={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(W){let{schema:H,it:U}=W;if(Array.isArray(H))return $(W,"additionalItems",H);if(U.items=!0,(0,J.alwaysValidSchema)(U,H))return;W.ok((0,Y.validateArray)(W))}};function $(W,H,U=W.schema){let{gen:B,parentSchema:q,data:K,keyword:V,it:N}=W;if(Z(q),N.opts.unevaluated&&U.length&&N.items!==!0)N.items=J.mergeEvaluated.items(B,U.length,N.items);let w=B.name("valid"),A=B.const("len",Q._`${K}.length`);U.forEach((z,M)=>{if((0,J.alwaysValidSchema)(N,z))return;B.if(Q._`${A} > ${M}`,()=>W.subschema({keyword:V,schemaProp:M,dataProp:M},w)),W.ok(w)});function Z(z){let{opts:M,errSchemaPath:F}=N,L=U.length,O=L===z.minItems&&(L===z.maxItems||z[H]===!1);if(M.strictTuples&&!O){let D=`"${V}" is ${L}-tuple, but minItems or maxItems/${H} are not specified or different at path "${F}"`;(0,J.checkStrictMode)(N,D,M.strictTuples)}}}X.validateTuple=$,X.default=G}),AW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=b5(),J={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(Y)=>(0,Q.validateTuple)(Y,"items")};X.default=J}),NW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=B0(),J=D0(),Y=H1(),G=E5(),$={message:({params:{len:H}})=>Q.str`must NOT have more than ${H} items`,params:({params:{len:H}})=>Q._`{limit: ${H}}`},W={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:$,code(H){let{schema:U,parentSchema:B,it:q}=H,{prefixItems:K}=B;if(q.items=!0,(0,J.alwaysValidSchema)(q,U))return;if(K)(0,G.validateAdditionalItems)(H,K);else H.ok((0,Y.validateArray)(H))}};X.default=W}),RW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=B0(),J=D0(),Y={message:({params:{min:$,max:W}})=>W===void 0?Q.str`must contain at least ${$} valid item(s)`:Q.str`must contain at least ${$} and no more than ${W} valid item(s)`,params:({params:{min:$,max:W}})=>W===void 0?Q._`{minContains: ${$}}`:Q._`{minContains: ${$}, maxContains: ${W}}`},G={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:Y,code($){let{gen:W,schema:H,parentSchema:U,data:B,it:q}=$,K,V,{minContains:N,maxContains:w}=U;if(q.opts.next)K=N===void 0?1:N,V=w;else K=1;let A=W.const("len",Q._`${B}.length`);if($.setParams({min:K,max:V}),V===void 0&&K===0){(0,J.checkStrictMode)(q,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(V!==void 0&&K>V){(0,J.checkStrictMode)(q,'"minContains" > "maxContains" is always invalid'),$.fail();return}if((0,J.alwaysValidSchema)(q,H)){let L=Q._`${A} >= ${K}`;if(V!==void 0)L=Q._`${L} && ${A} <= ${V}`;$.pass(L);return}q.items=!0;let Z=W.name("valid");if(V===void 0&&K===1)M(Z,()=>W.if(Z,()=>W.break()));else if(K===0){if(W.let(Z,!0),V!==void 0)W.if(Q._`${B}.length > 0`,z)}else W.let(Z,!1),z();$.result(Z,()=>$.reset());function z(){let L=W.name("_valid"),O=W.let("count",0);M(L,()=>W.if(L,()=>F(O)))}function M(L,O){W.forRange("i",0,A,(D)=>{$.subschema({keyword:"contains",dataProp:D,dataPropType:J.Type.Num,compositeRule:!0},L),O()})}function F(L){if(W.code(Q._`${L}++`),V===void 0)W.if(Q._`${L} >= ${K}`,()=>W.assign(Z,!0).break());else if(W.if(Q._`${L} > ${V}`,()=>W.assign(Z,!1).break()),K===1)W.assign(Z,!0);else W.if(Q._`${L} >= ${K}`,()=>W.assign(Z,!0))}}};X.default=G}),IW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.validateSchemaDeps=X.validatePropertyDeps=X.error=void 0;var Q=B0(),J=D0(),Y=H1();X.error={message:({params:{property:U,depsCount:B,deps:q}})=>{let K=B===1?"property":"properties";return Q.str`must have ${K} ${q} when property ${U} is present`},params:({params:{property:U,depsCount:B,deps:q,missingProperty:K}})=>Q._`{property: ${U},
175
171
  missingProperty: ${K},
176
- depsCount: ${z},
177
- deps: ${F}}`};var G={keyword:"dependencies",type:"object",schemaType:"object",error:X.error,code(U){let[z,F]=$(U);W(U,z),H(U,F)}};function $({schema:U}){let z={},F={};for(let K in U){if(K==="__proto__")continue;let M=Array.isArray(U[K])?z:F;M[K]=U[K]}return[z,F]}function W(U,z=U.schema){let{gen:F,data:K,it:M}=U;if(Object.keys(z).length===0)return;let R=F.let("missing");for(let w in z){let A=z[w];if(A.length===0)continue;let Z=(0,Y.propertyInData)(F,K,w,M.opts.ownProperties);if(U.setParams({property:w,depsCount:A.length,deps:A.join(", ")}),M.allErrors)F.if(Z,()=>{for(let B of A)(0,Y.checkReportMissingProp)(U,B)});else F.if(Q._`${Z} && (${(0,Y.checkMissingProp)(U,A,R)})`),(0,Y.reportMissingProp)(U,R),F.else()}}X.validatePropertyDeps=W;function H(U,z=U.schema){let{gen:F,data:K,keyword:M,it:R}=U,w=F.name("valid");for(let A in z){if((0,J.alwaysValidSchema)(R,z[A]))continue;F.if((0,Y.propertyInData)(F,K,A,R.opts.ownProperties),()=>{let Z=U.subschema({keyword:M,schemaProp:A},w);U.mergeValidEvaluated(Z,w)},()=>F.var(w,!0)),U.ok(w)}}X.validateSchemaDeps=H,X.default=G}),TW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=z0(),J=M0(),Y={message:"property name must be valid",params:({params:$})=>Q._`{propertyName: ${$.propertyName}}`},G={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:Y,code($){let{gen:W,schema:H,data:U,it:z}=$;if((0,J.alwaysValidSchema)(z,H))return;let F=W.name("valid");W.forIn("key",U,(K)=>{$.setParams({propertyName:K}),$.subschema({keyword:"propertyNames",data:K,dataTypes:["string"],propertyName:K,compositeRule:!0},F),W.if((0,Q.not)(F),()=>{if($.error(!0),!z.allErrors)W.break()})}),$.ok(F)}};X.default=G}),y4=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=U1(),J=z0(),Y=v1(),G=M0(),$={message:"must NOT have additional properties",params:({params:H})=>J._`{additionalProperty: ${H.additionalProperty}}`},W={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:$,code(H){let{gen:U,schema:z,parentSchema:F,data:K,errsCount:M,it:R}=H;if(!M)throw Error("ajv implementation error");let{allErrors:w,opts:A}=R;if(R.props=!0,A.removeAdditional!=="all"&&(0,G.alwaysValidSchema)(R,z))return;let Z=(0,Q.allSchemaProperties)(F.properties),B=(0,Q.allSchemaProperties)(F.patternProperties);V(),H.ok(J._`${M} === ${Y.default.errors}`);function V(){U.forIn("key",K,(I)=>{if(!Z.length&&!B.length)O(I);else U.if(q(I),()=>O(I))})}function q(I){let j;if(Z.length>8){let E=(0,G.schemaRefOrVal)(R,F.properties,"properties");j=(0,Q.isOwnProperty)(U,E,I)}else if(Z.length)j=(0,J.or)(...Z.map((E)=>J._`${I} === ${E}`));else j=J.nil;if(B.length)j=(0,J.or)(j,...B.map((E)=>J._`${(0,Q.usePattern)(H,E)}.test(${I})`));return(0,J.not)(j)}function L(I){U.code(J._`delete ${K}[${I}]`)}function O(I){if(A.removeAdditional==="all"||A.removeAdditional&&z===!1){L(I);return}if(z===!1){if(H.setParams({additionalProperty:I}),H.error(),!w)U.break();return}if(typeof z=="object"&&!(0,G.alwaysValidSchema)(R,z)){let j=U.name("valid");if(A.removeAdditional==="failing")D(I,j,!1),U.if((0,J.not)(j),()=>{H.reset(),L(I)});else if(D(I,j),!w)U.if((0,J.not)(j),()=>U.break())}}function D(I,j,E){let g={keyword:"additionalProperties",dataProp:I,dataPropType:G.Type.Str};if(E===!1)Object.assign(g,{compositeRule:!0,createErrors:!1,allErrors:!1});H.subschema(g,j)}}};X.default=W}),SW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=$6(),J=U1(),Y=M0(),G=y4(),$={keyword:"properties",type:"object",schemaType:"object",code(W){let{gen:H,schema:U,parentSchema:z,data:F,it:K}=W;if(K.opts.removeAdditional==="all"&&z.additionalProperties===void 0)G.default.code(new Q.KeywordCxt(K,G.default,"additionalProperties"));let M=(0,J.allSchemaProperties)(U);for(let B of M)K.definedProperties.add(B);if(K.opts.unevaluated&&M.length&&K.props!==!0)K.props=Y.mergeEvaluated.props(H,(0,Y.toHash)(M),K.props);let R=M.filter((B)=>!(0,Y.alwaysValidSchema)(K,U[B]));if(R.length===0)return;let w=H.name("valid");for(let B of R){if(A(B))Z(B);else{if(H.if((0,J.propertyInData)(H,F,B,K.opts.ownProperties)),Z(B),!K.allErrors)H.else().var(w,!0);H.endIf()}W.it.definedProperties.add(B),W.ok(w)}function A(B){return K.opts.useDefaults&&!K.compositeRule&&U[B].default!==void 0}function Z(B){W.subschema({keyword:"properties",schemaProp:B,dataProp:B},w)}}};X.default=$}),EW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=U1(),J=z0(),Y=M0(),G=M0(),$={keyword:"patternProperties",type:"object",schemaType:"object",code(W){let{gen:H,schema:U,data:z,parentSchema:F,it:K}=W,{opts:M}=K,R=(0,Q.allSchemaProperties)(U),w=R.filter((O)=>(0,Y.alwaysValidSchema)(K,U[O]));if(R.length===0||w.length===R.length&&(!K.opts.unevaluated||K.props===!0))return;let A=M.strictSchema&&!M.allowMatchingProperties&&F.properties,Z=H.name("valid");if(K.props!==!0&&!(K.props instanceof J.Name))K.props=(0,G.evaluatedPropsToName)(H,K.props);let{props:B}=K;V();function V(){for(let O of R){if(A)q(O);if(K.allErrors)L(O);else H.var(Z,!0),L(O),H.if(Z)}}function q(O){for(let D in A)if(new RegExp(O).test(D))(0,Y.checkStrictMode)(K,`property ${D} matches pattern ${O} (use allowMatchingProperties)`)}function L(O){H.forIn("key",z,(D)=>{H.if(J._`${(0,Q.usePattern)(W,O)}.test(${D})`,()=>{let I=w.includes(O);if(!I)W.subschema({keyword:"patternProperties",schemaProp:O,dataProp:D,dataPropType:G.Type.Str},Z);if(K.opts.unevaluated&&B!==!0)H.assign(J._`${B}[${D}]`,!0);else if(!I&&!K.allErrors)H.if((0,J.not)(Z),()=>H.break())})})}}};X.default=$}),bW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=M0(),J={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(Y){let{gen:G,schema:$,it:W}=Y;if((0,Q.alwaysValidSchema)(W,$)){Y.fail();return}let H=G.name("valid");Y.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},H),Y.failResult(H,()=>Y.reset(),()=>Y.error())},error:{message:"must NOT be valid"}};X.default=J}),CW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=U1(),J={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Q.validateUnion,error:{message:"must match a schema in anyOf"}};X.default=J}),_W=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=z0(),J=M0(),Y={message:"must match exactly one schema in oneOf",params:({params:$})=>Q._`{passingSchemas: ${$.passing}}`},G={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:Y,code($){let{gen:W,schema:H,parentSchema:U,it:z}=$;if(!Array.isArray(H))throw Error("ajv implementation error");if(z.opts.discriminator&&U.discriminator)return;let F=H,K=W.let("valid",!1),M=W.let("passing",null),R=W.name("_valid");$.setParams({passing:M}),W.block(w),$.result(K,()=>$.reset(),()=>$.error(!0));function w(){F.forEach((A,Z)=>{let B;if((0,J.alwaysValidSchema)(z,A))W.var(R,!0);else B=$.subschema({keyword:"oneOf",schemaProp:Z,compositeRule:!0},R);if(Z>0)W.if(Q._`${R} && ${K}`).assign(K,!1).assign(M,Q._`[${M}, ${Z}]`).else();W.if(R,()=>{if(W.assign(K,!0),W.assign(M,Z),B)$.mergeEvaluated(B,Q.Name)})})}}};X.default=G}),kW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=M0(),J={keyword:"allOf",schemaType:"array",code(Y){let{gen:G,schema:$,it:W}=Y;if(!Array.isArray($))throw Error("ajv implementation error");let H=G.name("valid");$.forEach((U,z)=>{if((0,Q.alwaysValidSchema)(W,U))return;let F=Y.subschema({keyword:"allOf",schemaProp:z},H);Y.ok(H),Y.mergeEvaluated(F)})}};X.default=J}),vW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=z0(),J=M0(),Y={message:({params:W})=>Q.str`must match "${W.ifClause}" schema`,params:({params:W})=>Q._`{failingKeyword: ${W.ifClause}}`},G={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Y,code(W){let{gen:H,parentSchema:U,it:z}=W;if(U.then===void 0&&U.else===void 0)(0,J.checkStrictMode)(z,'"if" without "then" and "else" is ignored');let F=$(z,"then"),K=$(z,"else");if(!F&&!K)return;let M=H.let("valid",!0),R=H.name("_valid");if(w(),W.reset(),F&&K){let Z=H.let("ifClause");W.setParams({ifClause:Z}),H.if(R,A("then",Z),A("else",Z))}else if(F)H.if(R,A("then"));else H.if((0,Q.not)(R),A("else"));W.pass(M,()=>W.error(!0));function w(){let Z=W.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},R);W.mergeEvaluated(Z)}function A(Z,B){return()=>{let V=W.subschema({keyword:Z},R);if(H.assign(M,R),W.mergeValidEvaluated(V,M),B)H.assign(B,Q._`${Z}`);else W.setParams({ifClause:Z})}}}};function $(W,H){let U=W.schema[H];return U!==void 0&&!(0,J.alwaysValidSchema)(W,U)}X.default=G}),yW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=M0(),J={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:Y,parentSchema:G,it:$}){if(G.if===void 0)(0,Q.checkStrictMode)($,`"${Y}" without "if" is ignored`)}};X.default=J}),xW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=k4(),J=IW(),Y=v4(),G=jW(),$=wW(),W=PW(),H=TW(),U=y4(),z=SW(),F=EW(),K=bW(),M=CW(),R=_W(),w=kW(),A=vW(),Z=yW();function B(V=!1){let q=[K.default,M.default,R.default,w.default,A.default,Z.default,H.default,U.default,W.default,z.default,F.default];if(V)q.push(J.default,G.default);else q.push(Q.default,Y.default);return q.push($.default),q}X.default=B}),gW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=z0(),J={message:({schemaCode:G})=>Q.str`must match format "${G}"`,params:({schemaCode:G})=>Q._`{format: ${G}}`},Y={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:J,code(G,$){let{gen:W,data:H,$data:U,schema:z,schemaCode:F,it:K}=G,{opts:M,errSchemaPath:R,schemaEnv:w,self:A}=K;if(!M.validateFormats)return;if(U)Z();else B();function Z(){let V=W.scopeValue("formats",{ref:A.formats,code:M.code.formats}),q=W.const("fDef",Q._`${V}[${F}]`),L=W.let("fType"),O=W.let("format");W.if(Q._`typeof ${q} == "object" && !(${q} instanceof RegExp)`,()=>W.assign(L,Q._`${q}.type || "string"`).assign(O,Q._`${q}.validate`),()=>W.assign(L,Q._`"string"`).assign(O,q)),G.fail$data((0,Q.or)(D(),I()));function D(){if(M.strictSchema===!1)return Q.nil;return Q._`${F} && !${O}`}function I(){let j=w.$async?Q._`(${q}.async ? await ${O}(${H}) : ${O}(${H}))`:Q._`${O}(${H})`,E=Q._`(typeof ${O} == "function" ? ${j} : ${O}.test(${H}))`;return Q._`${O} && ${O} !== true && ${L} === ${$} && !${E}`}}function B(){let V=A.formats[z];if(!V){D();return}if(V===!0)return;let[q,L,O]=I(V);if(q===$)G.pass(j());function D(){if(M.strictSchema===!1){A.logger.warn(E());return}throw Error(E());function E(){return`unknown format "${z}" ignored in schema at path "${R}"`}}function I(E){let g=E instanceof RegExp?(0,Q.regexpCode)(E):M.code.formats?Q._`${M.code.formats}${(0,Q.getProperty)(z)}`:void 0,k=W.scopeValue("formats",{key:z,ref:E,code:g});if(typeof E=="object"&&!(E instanceof RegExp))return[E.type||"string",E.validate,Q._`${k}.validate`];return["string",E,k]}function j(){if(typeof V=="object"&&!(V instanceof RegExp)&&V.async){if(!w.$async)throw Error("async format in sync schema");return Q._`await ${O}(${H})`}return typeof L=="function"?Q._`${O}(${H})`:Q._`${O}.test(${H})`}}}};X.default=Y}),hW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=gW(),J=[Q.default];X.default=J}),fW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.contentVocabulary=X.metadataVocabulary=void 0,X.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],X.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]}),uW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=BW(),J=RW(),Y=xW(),G=hW(),$=fW(),W=[Q.default,J.default,(0,Y.default)(),G.default,$.metadataVocabulary,$.contentVocabulary];X.default=W}),mW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.DiscrError=void 0;var Q;(function(J){J.Tag="tag",J.Mapping="mapping"})(Q||(X.DiscrError=Q={}))}),lW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=z0(),J=mW(),Y=xX(),G=W6(),$=M0(),W={message:({params:{discrError:U,tagName:z}})=>U===J.DiscrError.Tag?`tag "${z}" must be string`:`value of tag "${z}" must be in oneOf`,params:({params:{discrError:U,tag:z,tagName:F}})=>Q._`{error: ${U}, tag: ${F}, tagValue: ${z}}`},H={keyword:"discriminator",type:"object",schemaType:"object",error:W,code(U){let{gen:z,data:F,schema:K,parentSchema:M,it:R}=U,{oneOf:w}=M;if(!R.opts.discriminator)throw Error("discriminator: requires discriminator option");let A=K.propertyName;if(typeof A!="string")throw Error("discriminator: requires propertyName");if(K.mapping)throw Error("discriminator: mapping is not supported");if(!w)throw Error("discriminator: requires oneOf keyword");let Z=z.let("valid",!1),B=z.const("tag",Q._`${F}${(0,Q.getProperty)(A)}`);z.if(Q._`typeof ${B} == "string"`,()=>V(),()=>U.error(!1,{discrError:J.DiscrError.Tag,tag:B,tagName:A})),U.ok(Z);function V(){let O=L();z.if(!1);for(let D in O)z.elseIf(Q._`${B} === ${D}`),z.assign(Z,q(O[D]));z.else(),U.error(!1,{discrError:J.DiscrError.Mapping,tag:B,tagName:A}),z.endIf()}function q(O){let D=z.name("valid"),I=U.subschema({keyword:"oneOf",schemaProp:O},D);return U.mergeEvaluated(I,Q.Name),D}function L(){var O;let D={},I=E(M),j=!0;for(let x=0;x<w.length;x++){let u=w[x];if((u===null||u===void 0?void 0:u.$ref)&&!(0,$.schemaHasRulesButRef)(u,R.self.RULES)){let Y0=u.$ref;if(u=Y.resolveRef.call(R.self,R.schemaEnv.root,R.baseId,Y0),u instanceof Y.SchemaEnv)u=u.schema;if(u===void 0)throw new G.default(R.opts.uriResolver,R.baseId,Y0)}let l=(O=u===null||u===void 0?void 0:u.properties)===null||O===void 0?void 0:O[A];if(typeof l!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${A}"`);j=j&&(I||E(u)),g(l,x)}if(!j)throw Error(`discriminator: "${A}" must be required`);return D;function E({required:x}){return Array.isArray(x)&&x.includes(A)}function g(x,u){if(x.const)k(x.const,u);else if(x.enum)for(let l of x.enum)k(l,u);else throw Error(`discriminator: "properties/${A}" must have "const" or "enum"`)}function k(x,u){if(typeof x!="string"||x in D)throw Error(`discriminator: "${A}" values must be unique strings`);D[x]=u}}}};X.default=H}),cW=i((X,Q)=>{Q.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}}),x4=i((X,Q)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.MissingRefError=X.ValidationError=X.CodeGen=X.Name=X.nil=X.stringify=X.str=X._=X.KeywordCxt=X.Ajv=void 0;var J=HW(),Y=uW(),G=lW(),$=cW(),W=["/properties"],H="http://json-schema.org/draft-07/schema";class U extends J.default{_addVocabularies(){if(super._addVocabularies(),Y.default.forEach((R)=>this.addVocabulary(R)),this.opts.discriminator)this.addKeyword(G.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let R=this.opts.$data?this.$dataMetaSchema($,W):$;this.addMetaSchema(R,H,!1),this.refs["http://json-schema.org/schema"]=H}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(H)?H:void 0)}}X.Ajv=U,Q.exports=X=U,Q.exports.Ajv=U,Object.defineProperty(X,"__esModule",{value:!0}),X.default=U;var z=$6();Object.defineProperty(X,"KeywordCxt",{enumerable:!0,get:function(){return z.KeywordCxt}});var F=z0();Object.defineProperty(X,"_",{enumerable:!0,get:function(){return F._}}),Object.defineProperty(X,"str",{enumerable:!0,get:function(){return F.str}}),Object.defineProperty(X,"stringify",{enumerable:!0,get:function(){return F.stringify}}),Object.defineProperty(X,"nil",{enumerable:!0,get:function(){return F.nil}}),Object.defineProperty(X,"Name",{enumerable:!0,get:function(){return F.Name}}),Object.defineProperty(X,"CodeGen",{enumerable:!0,get:function(){return F.CodeGen}});var K=yX();Object.defineProperty(X,"ValidationError",{enumerable:!0,get:function(){return K.default}});var M=W6();Object.defineProperty(X,"MissingRefError",{enumerable:!0,get:function(){return M.default}})}),pW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.formatNames=X.fastFormats=X.fullFormats=void 0;function Q(k,x){return{validate:k,compare:x}}X.fullFormats={date:Q($,W),time:Q(U(!0),z),"date-time":Q(M(!0),R),"iso-time":Q(U(),F),"iso-date-time":Q(M(),w),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:B,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:g,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:q,int32:{type:"number",validate:D},int64:{type:"number",validate:I},float:{type:"number",validate:j},double:{type:"number",validate:j},password:!0,binary:!0},X.fastFormats={...X.fullFormats,date:Q(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,W),time:Q(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,z),"date-time":Q(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,R),"iso-time":Q(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,F),"iso-date-time":Q(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,w),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},X.formatNames=Object.keys(X.fullFormats);function J(k){return k%4===0&&(k%100!==0||k%400===0)}var Y=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,G=[0,31,28,31,30,31,30,31,31,30,31,30,31];function $(k){let x=Y.exec(k);if(!x)return!1;let u=+x[1],l=+x[2],Y0=+x[3];return l>=1&&l<=12&&Y0>=1&&Y0<=(l===2&&J(u)?29:G[l])}function W(k,x){if(!(k&&x))return;if(k>x)return 1;if(k<x)return-1;return 0}var H=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function U(k){return function(u){let l=H.exec(u);if(!l)return!1;let Y0=+l[1],Z0=+l[2],_0=+l[3],h0=l[4],q0=l[5]==="-"?-1:1,S=+(l[6]||0),b=+(l[7]||0);if(S>23||b>59||k&&!h0)return!1;if(Y0<=23&&Z0<=59&&_0<60)return!0;let f=Z0-b*q0,N=Y0-S*q0-(f<0?1:0);return(N===23||N===-1)&&(f===59||f===-1)&&_0<61}}function z(k,x){if(!(k&&x))return;let u=new Date("2020-01-01T"+k).valueOf(),l=new Date("2020-01-01T"+x).valueOf();if(!(u&&l))return;return u-l}function F(k,x){if(!(k&&x))return;let u=H.exec(k),l=H.exec(x);if(!(u&&l))return;if(k=u[1]+u[2]+u[3],x=l[1]+l[2]+l[3],k>x)return 1;if(k<x)return-1;return 0}var K=/t|\s/i;function M(k){let x=U(k);return function(l){let Y0=l.split(K);return Y0.length===2&&$(Y0[0])&&x(Y0[1])}}function R(k,x){if(!(k&&x))return;let u=new Date(k).valueOf(),l=new Date(x).valueOf();if(!(u&&l))return;return u-l}function w(k,x){if(!(k&&x))return;let[u,l]=k.split(K),[Y0,Z0]=x.split(K),_0=W(u,Y0);if(_0===void 0)return;return _0||z(l,Z0)}var A=/\/|:/,Z=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function B(k){return A.test(k)&&Z.test(k)}var V=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function q(k){return V.lastIndex=0,V.test(k)}var L=-2147483648,O=2147483647;function D(k){return Number.isInteger(k)&&k<=O&&k>=L}function I(k){return Number.isInteger(k)}function j(){return!0}var E=/[^\\]\\Z/;function g(k){if(E.test(k))return!1;try{return new RegExp(k),!0}catch(x){return!1}}}),dW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.formatLimitDefinition=void 0;var Q=x4(),J=z0(),Y=J.operators,G={formatMaximum:{okStr:"<=",ok:Y.LTE,fail:Y.GT},formatMinimum:{okStr:">=",ok:Y.GTE,fail:Y.LT},formatExclusiveMaximum:{okStr:"<",ok:Y.LT,fail:Y.GTE},formatExclusiveMinimum:{okStr:">",ok:Y.GT,fail:Y.LTE}},$={message:({keyword:H,schemaCode:U})=>J.str`should be ${G[H].okStr} ${U}`,params:({keyword:H,schemaCode:U})=>J._`{comparison: ${G[H].okStr}, limit: ${U}}`};X.formatLimitDefinition={keyword:Object.keys(G),type:"string",schemaType:"string",$data:!0,error:$,code(H){let{gen:U,data:z,schemaCode:F,keyword:K,it:M}=H,{opts:R,self:w}=M;if(!R.validateFormats)return;let A=new Q.KeywordCxt(M,w.RULES.all.format.definition,"format");if(A.$data)Z();else B();function Z(){let q=U.scopeValue("formats",{ref:w.formats,code:R.code.formats}),L=U.const("fmt",J._`${q}[${A.schemaCode}]`);H.fail$data((0,J.or)(J._`typeof ${L} != "object"`,J._`${L} instanceof RegExp`,J._`typeof ${L}.compare != "function"`,V(L)))}function B(){let q=A.schema,L=w.formats[q];if(!L||L===!0)return;if(typeof L!="object"||L instanceof RegExp||typeof L.compare!="function")throw Error(`"${K}": format "${q}" does not define "compare" function`);let O=U.scopeValue("formats",{key:q,ref:L,code:R.code.formats?J._`${R.code.formats}${(0,J.getProperty)(q)}`:void 0});H.fail$data(V(O))}function V(q){return J._`${q}.compare(${z}, ${F}) ${G[K].fail} 0`}},dependencies:["format"]};var W=(H)=>{return H.addKeyword(X.formatLimitDefinition),H};X.default=W}),iW=i((X,Q)=>{Object.defineProperty(X,"__esModule",{value:!0});var J=pW(),Y=dW(),G=z0(),$=new G.Name("fullFormats"),W=new G.Name("fastFormats"),H=(z,F={keywords:!0})=>{if(Array.isArray(F))return U(z,F,J.fullFormats,$),z;let[K,M]=F.mode==="fast"?[J.fastFormats,W]:[J.fullFormats,$],R=F.formats||J.formatNames;if(U(z,R,K,M),F.keywords)(0,Y.default)(z);return z};H.get=(z,F="full")=>{let M=(F==="fast"?J.fastFormats:J.fullFormats)[z];if(!M)throw Error(`Unknown format "${z}"`);return M};function U(z,F,K,M){var R,w;(R=(w=z.opts.code).formats)!==null&&R!==void 0||(w.formats=G._`require("ajv-formats/dist/formats").${M}`);for(let A of F)z.addFormat(A,K[A])}Q.exports=X=H,Object.defineProperty(X,"__esModule",{value:!0}),X.default=H}),oW=50;function g4(X=oW){let Q=new AbortController;return rW(X,Q.signal),Q}var eW=typeof global=="object"&&global&&global.Object===Object&&global,XH=eW,QH=typeof self=="object"&&self&&self.Object===Object&&self,JH=XH||QH||Function("return this")(),hX=JH,YH=hX.Symbol,i8=YH,h4=Object.prototype,GH=h4.hasOwnProperty,$H=h4.toString,h9=i8?i8.toStringTag:void 0;function WH(X){var Q=GH.call(X,h9),J=X[h9];try{X[h9]=void 0;var Y=!0}catch($){}var G=$H.call(X);if(Y)if(Q)X[h9]=J;else delete X[h9];return G}var HH=WH,UH=Object.prototype,zH=UH.toString;function BH(X){return zH.call(X)}var LH=BH,qH="[object Null]",FH="[object Undefined]",a5=i8?i8.toStringTag:void 0;function KH(X){if(X==null)return X===void 0?FH:qH;return a5&&a5 in Object(X)?HH(X):LH(X)}var VH=KH;function MH(X){var Q=typeof X;return X!=null&&(Q=="object"||Q=="function")}var f4=MH,DH="[object AsyncFunction]",ZH="[object Function]",OH="[object GeneratorFunction]",AH="[object Proxy]";function NH(X){if(!f4(X))return!1;var Q=VH(X);return Q==ZH||Q==OH||Q==DH||Q==AH}var RH=NH,IH=hX["__core-js_shared__"],AX=IH,s5=function(){var X=/[^.]+$/.exec(AX&&AX.keys&&AX.keys.IE_PROTO||"");return X?"Symbol(src)_1."+X:""}();function jH(X){return!!s5&&s5 in X}var wH=jH,PH=Function.prototype,TH=PH.toString;function SH(X){if(X!=null){try{return TH.call(X)}catch(Q){}try{return X+""}catch(Q){}}return""}var EH=SH,bH=/[\\^$.*+?()[\]{}|]/g,CH=/^\[object .+?Constructor\]$/,_H=Function.prototype,kH=Object.prototype,vH=_H.toString,yH=kH.hasOwnProperty,xH=RegExp("^"+vH.call(yH).replace(bH,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function gH(X){if(!f4(X)||wH(X))return!1;var Q=RH(X)?xH:CH;return Q.test(EH(X))}var hH=gH;function fH(X,Q){return X==null?void 0:X[Q]}var uH=fH;function mH(X,Q){var J=uH(X,Q);return hH(J)?J:void 0}var u4=mH,lH=u4(Object,"create"),l9=lH;function cH(){this.__data__=l9?l9(null):{},this.size=0}var pH=cH;function dH(X){var Q=this.has(X)&&delete this.__data__[X];return this.size-=Q?1:0,Q}var iH=dH,nH="__lodash_hash_undefined__",rH=Object.prototype,oH=rH.hasOwnProperty;function aH(X){var Q=this.__data__;if(l9){var J=Q[X];return J===nH?void 0:J}return oH.call(Q,X)?Q[X]:void 0}var sH=aH,tH=Object.prototype,eH=tH.hasOwnProperty;function XU(X){var Q=this.__data__;return l9?Q[X]!==void 0:eH.call(Q,X)}var QU=XU,JU="__lodash_hash_undefined__";function YU(X,Q){var J=this.__data__;return this.size+=this.has(X)?0:1,J[X]=l9&&Q===void 0?JU:Q,this}var GU=YU;function D9(X){var Q=-1,J=X==null?0:X.length;this.clear();while(++Q<J){var Y=X[Q];this.set(Y[0],Y[1])}}D9.prototype.clear=pH;D9.prototype.delete=iH;D9.prototype.get=sH;D9.prototype.has=QU;D9.prototype.set=GU;var t5=D9;function $U(){this.__data__=[],this.size=0}var WU=$U;function HU(X,Q){return X===Q||X!==X&&Q!==Q}var UU=HU;function zU(X,Q){var J=X.length;while(J--)if(UU(X[J][0],Q))return J;return-1}var H6=zU,BU=Array.prototype,LU=BU.splice;function qU(X){var Q=this.__data__,J=H6(Q,X);if(J<0)return!1;var Y=Q.length-1;if(J==Y)Q.pop();else LU.call(Q,J,1);return--this.size,!0}var FU=qU;function KU(X){var Q=this.__data__,J=H6(Q,X);return J<0?void 0:Q[J][1]}var VU=KU;function MU(X){return H6(this.__data__,X)>-1}var DU=MU;function ZU(X,Q){var J=this.__data__,Y=H6(J,X);if(Y<0)++this.size,J.push([X,Q]);else J[Y][1]=Q;return this}var OU=ZU;function Z9(X){var Q=-1,J=X==null?0:X.length;this.clear();while(++Q<J){var Y=X[Q];this.set(Y[0],Y[1])}}Z9.prototype.clear=WU;Z9.prototype.delete=FU;Z9.prototype.get=VU;Z9.prototype.has=DU;Z9.prototype.set=OU;var AU=Z9,NU=u4(hX,"Map"),RU=NU;function IU(){this.size=0,this.__data__={hash:new t5,map:new(RU||AU),string:new t5}}var jU=IU;function wU(X){var Q=typeof X;return Q=="string"||Q=="number"||Q=="symbol"||Q=="boolean"?X!=="__proto__":X===null}var PU=wU;function TU(X,Q){var J=X.__data__;return PU(Q)?J[typeof Q=="string"?"string":"hash"]:J.map}var U6=TU;function SU(X){var Q=U6(this,X).delete(X);return this.size-=Q?1:0,Q}var EU=SU;function bU(X){return U6(this,X).get(X)}var CU=bU;function _U(X){return U6(this,X).has(X)}var kU=_U;function vU(X,Q){var J=U6(this,X),Y=J.size;return J.set(X,Q),this.size+=J.size==Y?0:1,this}var yU=vU;function O9(X){var Q=-1,J=X==null?0:X.length;this.clear();while(++Q<J){var Y=X[Q];this.set(Y[0],Y[1])}}O9.prototype.clear=jU;O9.prototype.delete=EU;O9.prototype.get=CU;O9.prototype.has=kU;O9.prototype.set=yU;var m4=O9,xU="Expected a function";function fX(X,Q){if(typeof X!="function"||Q!=null&&typeof Q!="function")throw TypeError(xU);var J=function(){var Y=arguments,G=Q?Q.apply(this,Y):Y[0],$=J.cache;if($.has(G))return $.get(G);var W=X.apply(this,Y);return J.cache=$.set(G,W)||$,W};return J.cache=new(fX.Cache||m4),J}fX.Cache=m4;var Y8=fX,e5=2000;function gU(X){if(process.stderr.destroyed)return;for(let Q=0;Q<X.length;Q+=e5)process.stderr.write(X.substring(Q,Q+e5))}var hU=Y8((X)=>{if(!X||X.trim()==="")return null;let Q=X.split(",").map(($)=>$.trim()).filter(Boolean);if(Q.length===0)return null;let J=Q.some(($)=>$.startsWith("!")),Y=Q.some(($)=>!$.startsWith("!"));if(J&&Y)return null;let G=Q.map(($)=>$.replace(/^!/,"").toLowerCase());return{include:J?[]:G,exclude:J?G:[],isExclusive:J}});function fU(X){let Q=[],J=X.match(/^MCP server ["']([^"']+)["']/);if(J&&J[1])Q.push("mcp"),Q.push(J[1].toLowerCase());else{let $=X.match(/^([^:[]+):/);if($&&$[1])Q.push($[1].trim().toLowerCase())}let Y=X.match(/^\[([^\]]+)]/);if(Y&&Y[1])Q.push(Y[1].trim().toLowerCase());if(X.toLowerCase().includes("statsig event:"))Q.push("statsig");let G=X.match(/:\s*([^:]+?)(?:\s+(?:type|mode|status|event))?:/);if(G&&G[1]){let $=G[1].trim().toLowerCase();if($.length<30&&!$.includes(" "))Q.push($)}return Array.from(new Set(Q))}function uU(X,Q){if(!Q)return!0;if(X.length===0)return!1;if(Q.isExclusive)return!X.some((J)=>Q.exclude.includes(J));else return X.some((J)=>Q.include.includes(J))}function mU(X,Q){if(!Q)return!0;let J=fU(X);return uU(J,Q)}function l4(){return process.env.CLAUDE_CONFIG_DIR??lU(cU(),".claude")}function X4(X){if(!X)return!1;if(typeof X==="boolean")return X;let Q=X.toLowerCase().trim();return["1","true","yes","on"].includes(Q)}var NX=150000,h8=30000;function p4(X){return{name:X,default:h8,validate:(Q)=>{if(!Q)return{effective:h8,status:"valid"};let J=parseInt(Q,10);if(isNaN(J)||J<=0)return{effective:h8,status:"invalid",message:`Invalid value "${Q}" (using default: ${h8})`};if(J>NX)return{effective:NX,status:"capped",message:`Capped from ${J} to ${NX}`};return{effective:J,status:"valid"}}}}var nU=p4("BASH_MAX_OUTPUT_LENGTH"),Sw=p4("TASK_MAX_OUTPUT_LENGTH"),rU={name:"CLAUDE_CODE_MAX_OUTPUT_TOKENS",default:32000,validate:(X)=>{if(!X)return{effective:32000,status:"valid"};let Y=parseInt(X,10);if(isNaN(Y)||Y<=0)return{effective:32000,status:"invalid",message:`Invalid value "${X}" (using default: 32000)`};if(Y>64000)return{effective:64000,status:"capped",message:`Capped from ${Y} to 64000`};return{effective:Y,status:"valid"}}};function oU(){let X="";if(typeof process<"u"&&typeof process.cwd==="function")X=dU(pU());return{originalCwd:X,totalCostUSD:0,totalAPIDuration:0,totalAPIDurationWithoutRetries:0,totalToolDuration:0,startTime:Date.now(),lastInteractionTime:Date.now(),totalLinesAdded:0,totalLinesRemoved:0,hasUnknownModelCost:!1,cwd:X,modelUsage:{},mainLoopModelOverride:void 0,initialMainLoopModel:null,modelStrings:null,isInteractive:!1,clientType:"cli",sessionIngressToken:void 0,oauthTokenFromFd:void 0,apiKeyFromFd:void 0,flagSettingsPath:void 0,allowedSettingSources:["userSettings","projectSettings","localSettings","flagSettings","policySettings"],meter:null,sessionCounter:null,locCounter:null,prCounter:null,commitCounter:null,costCounter:null,tokenCounter:null,codeEditToolDecisionCounter:null,activeTimeCounter:null,sessionId:iU(),loggerProvider:null,eventLogger:null,meterProvider:null,tracerProvider:null,agentColorMap:new Map,agentColorIndex:0,envVarValidators:[nU,rU],lastAPIRequest:null,inMemoryErrorLog:[],inlinePlugins:[],sessionBypassPermissionsMode:!1,sessionPersistenceDisabled:!1,hasExitedPlanMode:!1,needsPlanModeExitAttachment:!1,hasExitedDelegateMode:!1,needsDelegateModeExitAttachment:!1,lspRecommendationShownThisSession:!1,initJsonSchema:null,registeredHooks:null,planSlugCache:new Map,teleportedSessionInfo:null,invokedSkills:new Map,slowOperations:[],sdkBetas:void 0}}var i1=oU();function aU(){return i1.sessionId}var Q4=10,sU=1e4;function d4(X,Q){return}function tU({writeFn:X,flushIntervalMs:Q=1000,maxBufferSize:J=100,immediateMode:Y=!1}){let G=[],$=null;function W(){if($)clearTimeout($),$=null}function H(){if(G.length===0)return;X(G.join("")),G=[],W()}function U(){if(!$)$=setTimeout(H,Q)}return{write(z){if(Y){X(z);return}if(G.push(z),U(),G.length>=J)H()},flush:H,dispose(){H()}}}var J4=new Set;function eU(X){return J4.add(X),()=>J4.delete(X)}var i4=1/0;function Xz(X){if(X===null)return"null";if(X===void 0)return"undefined";if(Array.isArray(X))return`Array[${X.length}]`;if(typeof X==="object")return`Object{${Object.keys(X).length} keys}`;if(typeof X==="string")return`string(${X.length} chars)`;return typeof X}function n4(X,Q){let J=performance.now();try{return Q()}finally{let Y=performance.now()-J;if(Y>i4)R1(`[SLOW OPERATION DETECTED] ${X} (${Y.toFixed(1)}ms)`),d4(X,Y)}}function q1(X,Q,J){let Y=Xz(X);return n4(`JSON.stringify(${Y})`,()=>JSON.stringify(X,Q,J))}var r4=(X,Q)=>{let J=typeof X==="string"?X.length:0;return n4(`JSON.parse(${J} chars)`,()=>JSON.parse(X,Q))},Qz=Y8(()=>{return X4(process.env.DEBUG)||X4(process.env.DEBUG_SDK)||process.argv.includes("--debug")||process.argv.includes("-d")||o4()||process.argv.some((X)=>X.startsWith("--debug="))}),Jz=Y8(()=>{let X=process.argv.find((J)=>J.startsWith("--debug="));if(!X)return null;let Q=X.substring(8);return hU(Q)}),o4=Y8(()=>{return process.argv.includes("--debug-to-stderr")||process.argv.includes("-d2e")});function Yz(X){if(typeof process>"u"||typeof process.versions>"u"||typeof process.versions.node>"u")return!1;let Q=Jz();return mU(X,Q)}var Gz=!1,f8=null;function $z(){if(!f8)f8=tU({writeFn:(X)=>{let Q=a4();if(!I1().existsSync(PX(Q)))I1().mkdirSync(PX(Q));I1().appendFileSync(Q,X),Wz()},flushIntervalMs:1000,maxBufferSize:100,immediateMode:Qz()}),eU(async()=>f8?.dispose());return f8}function R1(X,{level:Q}={level:"debug"}){if(!Yz(X))return;if(Gz&&X.includes(`
172
+ depsCount: ${B},
173
+ deps: ${q}}`};var G={keyword:"dependencies",type:"object",schemaType:"object",error:X.error,code(U){let[B,q]=$(U);W(U,B),H(U,q)}};function $({schema:U}){let B={},q={};for(let K in U){if(K==="__proto__")continue;let V=Array.isArray(U[K])?B:q;V[K]=U[K]}return[B,q]}function W(U,B=U.schema){let{gen:q,data:K,it:V}=U;if(Object.keys(B).length===0)return;let N=q.let("missing");for(let w in B){let A=B[w];if(A.length===0)continue;let Z=(0,Y.propertyInData)(q,K,w,V.opts.ownProperties);if(U.setParams({property:w,depsCount:A.length,deps:A.join(", ")}),V.allErrors)q.if(Z,()=>{for(let z of A)(0,Y.checkReportMissingProp)(U,z)});else q.if(Q._`${Z} && (${(0,Y.checkMissingProp)(U,A,N)})`),(0,Y.reportMissingProp)(U,N),q.else()}}X.validatePropertyDeps=W;function H(U,B=U.schema){let{gen:q,data:K,keyword:V,it:N}=U,w=q.name("valid");for(let A in B){if((0,J.alwaysValidSchema)(N,B[A]))continue;q.if((0,Y.propertyInData)(q,K,A,N.opts.ownProperties),()=>{let Z=U.subschema({keyword:V,schemaProp:A},w);U.mergeValidEvaluated(Z,w)},()=>q.var(w,!0)),U.ok(w)}}X.validateSchemaDeps=H,X.default=G}),jW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=B0(),J=D0(),Y={message:"property name must be valid",params:({params:$})=>Q._`{propertyName: ${$.propertyName}}`},G={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:Y,code($){let{gen:W,schema:H,data:U,it:B}=$;if((0,J.alwaysValidSchema)(B,H))return;let q=W.name("valid");W.forIn("key",U,(K)=>{$.setParams({propertyName:K}),$.subschema({keyword:"propertyNames",data:K,dataTypes:["string"],propertyName:K,compositeRule:!0},q),W.if((0,Q.not)(q),()=>{if($.error(!0),!B.allErrors)W.break()})}),$.ok(q)}};X.default=G}),C5=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=H1(),J=B0(),Y=v1(),G=D0(),$={message:"must NOT have additional properties",params:({params:H})=>J._`{additionalProperty: ${H.additionalProperty}}`},W={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:$,code(H){let{gen:U,schema:B,parentSchema:q,data:K,errsCount:V,it:N}=H;if(!V)throw Error("ajv implementation error");let{allErrors:w,opts:A}=N;if(N.props=!0,A.removeAdditional!=="all"&&(0,G.alwaysValidSchema)(N,B))return;let Z=(0,Q.allSchemaProperties)(q.properties),z=(0,Q.allSchemaProperties)(q.patternProperties);M(),H.ok(J._`${V} === ${Y.default.errors}`);function M(){U.forIn("key",K,(I)=>{if(!Z.length&&!z.length)O(I);else U.if(F(I),()=>O(I))})}function F(I){let j;if(Z.length>8){let E=(0,G.schemaRefOrVal)(N,q.properties,"properties");j=(0,Q.isOwnProperty)(U,E,I)}else if(Z.length)j=(0,J.or)(...Z.map((E)=>J._`${I} === ${E}`));else j=J.nil;if(z.length)j=(0,J.or)(j,...z.map((E)=>J._`${(0,Q.usePattern)(H,E)}.test(${I})`));return(0,J.not)(j)}function L(I){U.code(J._`delete ${K}[${I}]`)}function O(I){if(A.removeAdditional==="all"||A.removeAdditional&&B===!1){L(I);return}if(B===!1){if(H.setParams({additionalProperty:I}),H.error(),!w)U.break();return}if(typeof B=="object"&&!(0,G.alwaysValidSchema)(N,B)){let j=U.name("valid");if(A.removeAdditional==="failing")D(I,j,!1),U.if((0,J.not)(j),()=>{H.reset(),L(I)});else if(D(I,j),!w)U.if((0,J.not)(j),()=>U.break())}}function D(I,j,E){let g={keyword:"additionalProperties",dataProp:I,dataPropType:G.Type.Str};if(E===!1)Object.assign(g,{compositeRule:!0,createErrors:!1,allErrors:!1});H.subschema(g,j)}}};X.default=W}),wW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=Y6(),J=H1(),Y=D0(),G=C5(),$={keyword:"properties",type:"object",schemaType:"object",code(W){let{gen:H,schema:U,parentSchema:B,data:q,it:K}=W;if(K.opts.removeAdditional==="all"&&B.additionalProperties===void 0)G.default.code(new Q.KeywordCxt(K,G.default,"additionalProperties"));let V=(0,J.allSchemaProperties)(U);for(let z of V)K.definedProperties.add(z);if(K.opts.unevaluated&&V.length&&K.props!==!0)K.props=Y.mergeEvaluated.props(H,(0,Y.toHash)(V),K.props);let N=V.filter((z)=>!(0,Y.alwaysValidSchema)(K,U[z]));if(N.length===0)return;let w=H.name("valid");for(let z of N){if(A(z))Z(z);else{if(H.if((0,J.propertyInData)(H,q,z,K.opts.ownProperties)),Z(z),!K.allErrors)H.else().var(w,!0);H.endIf()}W.it.definedProperties.add(z),W.ok(w)}function A(z){return K.opts.useDefaults&&!K.compositeRule&&U[z].default!==void 0}function Z(z){W.subschema({keyword:"properties",schemaProp:z,dataProp:z},w)}}};X.default=$}),PW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=H1(),J=B0(),Y=D0(),G=D0(),$={keyword:"patternProperties",type:"object",schemaType:"object",code(W){let{gen:H,schema:U,data:B,parentSchema:q,it:K}=W,{opts:V}=K,N=(0,Q.allSchemaProperties)(U),w=N.filter((O)=>(0,Y.alwaysValidSchema)(K,U[O]));if(N.length===0||w.length===N.length&&(!K.opts.unevaluated||K.props===!0))return;let A=V.strictSchema&&!V.allowMatchingProperties&&q.properties,Z=H.name("valid");if(K.props!==!0&&!(K.props instanceof J.Name))K.props=(0,G.evaluatedPropsToName)(H,K.props);let{props:z}=K;M();function M(){for(let O of N){if(A)F(O);if(K.allErrors)L(O);else H.var(Z,!0),L(O),H.if(Z)}}function F(O){for(let D in A)if(new RegExp(O).test(D))(0,Y.checkStrictMode)(K,`property ${D} matches pattern ${O} (use allowMatchingProperties)`)}function L(O){H.forIn("key",B,(D)=>{H.if(J._`${(0,Q.usePattern)(W,O)}.test(${D})`,()=>{let I=w.includes(O);if(!I)W.subschema({keyword:"patternProperties",schemaProp:O,dataProp:D,dataPropType:G.Type.Str},Z);if(K.opts.unevaluated&&z!==!0)H.assign(J._`${z}[${D}]`,!0);else if(!I&&!K.allErrors)H.if((0,J.not)(Z),()=>H.break())})})}}};X.default=$}),TW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=D0(),J={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(Y){let{gen:G,schema:$,it:W}=Y;if((0,Q.alwaysValidSchema)(W,$)){Y.fail();return}let H=G.name("valid");Y.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},H),Y.failResult(H,()=>Y.reset(),()=>Y.error())},error:{message:"must NOT be valid"}};X.default=J}),SW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=H1(),J={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Q.validateUnion,error:{message:"must match a schema in anyOf"}};X.default=J}),EW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=B0(),J=D0(),Y={message:"must match exactly one schema in oneOf",params:({params:$})=>Q._`{passingSchemas: ${$.passing}}`},G={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:Y,code($){let{gen:W,schema:H,parentSchema:U,it:B}=$;if(!Array.isArray(H))throw Error("ajv implementation error");if(B.opts.discriminator&&U.discriminator)return;let q=H,K=W.let("valid",!1),V=W.let("passing",null),N=W.name("_valid");$.setParams({passing:V}),W.block(w),$.result(K,()=>$.reset(),()=>$.error(!0));function w(){q.forEach((A,Z)=>{let z;if((0,J.alwaysValidSchema)(B,A))W.var(N,!0);else z=$.subschema({keyword:"oneOf",schemaProp:Z,compositeRule:!0},N);if(Z>0)W.if(Q._`${N} && ${K}`).assign(K,!1).assign(V,Q._`[${V}, ${Z}]`).else();W.if(N,()=>{if(W.assign(K,!0),W.assign(V,Z),z)$.mergeEvaluated(z,Q.Name)})})}}};X.default=G}),bW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=D0(),J={keyword:"allOf",schemaType:"array",code(Y){let{gen:G,schema:$,it:W}=Y;if(!Array.isArray($))throw Error("ajv implementation error");let H=G.name("valid");$.forEach((U,B)=>{if((0,Q.alwaysValidSchema)(W,U))return;let q=Y.subschema({keyword:"allOf",schemaProp:B},H);Y.ok(H),Y.mergeEvaluated(q)})}};X.default=J}),CW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=B0(),J=D0(),Y={message:({params:W})=>Q.str`must match "${W.ifClause}" schema`,params:({params:W})=>Q._`{failingKeyword: ${W.ifClause}}`},G={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Y,code(W){let{gen:H,parentSchema:U,it:B}=W;if(U.then===void 0&&U.else===void 0)(0,J.checkStrictMode)(B,'"if" without "then" and "else" is ignored');let q=$(B,"then"),K=$(B,"else");if(!q&&!K)return;let V=H.let("valid",!0),N=H.name("_valid");if(w(),W.reset(),q&&K){let Z=H.let("ifClause");W.setParams({ifClause:Z}),H.if(N,A("then",Z),A("else",Z))}else if(q)H.if(N,A("then"));else H.if((0,Q.not)(N),A("else"));W.pass(V,()=>W.error(!0));function w(){let Z=W.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},N);W.mergeEvaluated(Z)}function A(Z,z){return()=>{let M=W.subschema({keyword:Z},N);if(H.assign(V,N),W.mergeValidEvaluated(M,V),z)H.assign(z,Q._`${Z}`);else W.setParams({ifClause:Z})}}}};function $(W,H){let U=W.schema[H];return U!==void 0&&!(0,J.alwaysValidSchema)(W,U)}X.default=G}),_W=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=D0(),J={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:Y,parentSchema:G,it:$}){if(G.if===void 0)(0,Q.checkStrictMode)($,`"${Y}" without "if" is ignored`)}};X.default=J}),kW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=E5(),J=AW(),Y=b5(),G=NW(),$=RW(),W=IW(),H=jW(),U=C5(),B=wW(),q=PW(),K=TW(),V=SW(),N=EW(),w=bW(),A=CW(),Z=_W();function z(M=!1){let F=[K.default,V.default,N.default,w.default,A.default,Z.default,H.default,U.default,W.default,B.default,q.default];if(M)F.push(J.default,G.default);else F.push(Q.default,Y.default);return F.push($.default),F}X.default=z}),vW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=B0(),J={message:({schemaCode:G})=>Q.str`must match format "${G}"`,params:({schemaCode:G})=>Q._`{format: ${G}}`},Y={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:J,code(G,$){let{gen:W,data:H,$data:U,schema:B,schemaCode:q,it:K}=G,{opts:V,errSchemaPath:N,schemaEnv:w,self:A}=K;if(!V.validateFormats)return;if(U)Z();else z();function Z(){let M=W.scopeValue("formats",{ref:A.formats,code:V.code.formats}),F=W.const("fDef",Q._`${M}[${q}]`),L=W.let("fType"),O=W.let("format");W.if(Q._`typeof ${F} == "object" && !(${F} instanceof RegExp)`,()=>W.assign(L,Q._`${F}.type || "string"`).assign(O,Q._`${F}.validate`),()=>W.assign(L,Q._`"string"`).assign(O,F)),G.fail$data((0,Q.or)(D(),I()));function D(){if(V.strictSchema===!1)return Q.nil;return Q._`${q} && !${O}`}function I(){let j=w.$async?Q._`(${F}.async ? await ${O}(${H}) : ${O}(${H}))`:Q._`${O}(${H})`,E=Q._`(typeof ${O} == "function" ? ${j} : ${O}.test(${H}))`;return Q._`${O} && ${O} !== true && ${L} === ${$} && !${E}`}}function z(){let M=A.formats[B];if(!M){D();return}if(M===!0)return;let[F,L,O]=I(M);if(F===$)G.pass(j());function D(){if(V.strictSchema===!1){A.logger.warn(E());return}throw Error(E());function E(){return`unknown format "${B}" ignored in schema at path "${N}"`}}function I(E){let g=E instanceof RegExp?(0,Q.regexpCode)(E):V.code.formats?Q._`${V.code.formats}${(0,Q.getProperty)(B)}`:void 0,k=W.scopeValue("formats",{key:B,ref:E,code:g});if(typeof E=="object"&&!(E instanceof RegExp))return[E.type||"string",E.validate,Q._`${k}.validate`];return["string",E,k]}function j(){if(typeof M=="object"&&!(M instanceof RegExp)&&M.async){if(!w.$async)throw Error("async format in sync schema");return Q._`await ${O}(${H})`}return typeof L=="function"?Q._`${O}(${H})`:Q._`${O}.test(${H})`}}}};X.default=Y}),yW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=vW(),J=[Q.default];X.default=J}),xW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.contentVocabulary=X.metadataVocabulary=void 0,X.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],X.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]}),gW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=HW(),J=OW(),Y=kW(),G=yW(),$=xW(),W=[Q.default,J.default,(0,Y.default)(),G.default,$.metadataVocabulary,$.contentVocabulary];X.default=W}),hW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.DiscrError=void 0;var Q;(function(J){J.Tag="tag",J.Mapping="mapping"})(Q||(X.DiscrError=Q={}))}),fW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=B0(),J=hW(),Y=vX(),G=G6(),$=D0(),W={message:({params:{discrError:U,tagName:B}})=>U===J.DiscrError.Tag?`tag "${B}" must be string`:`value of tag "${B}" must be in oneOf`,params:({params:{discrError:U,tag:B,tagName:q}})=>Q._`{error: ${U}, tag: ${q}, tagValue: ${B}}`},H={keyword:"discriminator",type:"object",schemaType:"object",error:W,code(U){let{gen:B,data:q,schema:K,parentSchema:V,it:N}=U,{oneOf:w}=V;if(!N.opts.discriminator)throw Error("discriminator: requires discriminator option");let A=K.propertyName;if(typeof A!="string")throw Error("discriminator: requires propertyName");if(K.mapping)throw Error("discriminator: mapping is not supported");if(!w)throw Error("discriminator: requires oneOf keyword");let Z=B.let("valid",!1),z=B.const("tag",Q._`${q}${(0,Q.getProperty)(A)}`);B.if(Q._`typeof ${z} == "string"`,()=>M(),()=>U.error(!1,{discrError:J.DiscrError.Tag,tag:z,tagName:A})),U.ok(Z);function M(){let O=L();B.if(!1);for(let D in O)B.elseIf(Q._`${z} === ${D}`),B.assign(Z,F(O[D]));B.else(),U.error(!1,{discrError:J.DiscrError.Mapping,tag:z,tagName:A}),B.endIf()}function F(O){let D=B.name("valid"),I=U.subschema({keyword:"oneOf",schemaProp:O},D);return U.mergeEvaluated(I,Q.Name),D}function L(){var O;let D={},I=E(V),j=!0;for(let x=0;x<w.length;x++){let u=w[x];if((u===null||u===void 0?void 0:u.$ref)&&!(0,$.schemaHasRulesButRef)(u,N.self.RULES)){let Y0=u.$ref;if(u=Y.resolveRef.call(N.self,N.schemaEnv.root,N.baseId,Y0),u instanceof Y.SchemaEnv)u=u.schema;if(u===void 0)throw new G.default(N.opts.uriResolver,N.baseId,Y0)}let l=(O=u===null||u===void 0?void 0:u.properties)===null||O===void 0?void 0:O[A];if(typeof l!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${A}"`);j=j&&(I||E(u)),g(l,x)}if(!j)throw Error(`discriminator: "${A}" must be required`);return D;function E({required:x}){return Array.isArray(x)&&x.includes(A)}function g(x,u){if(x.const)k(x.const,u);else if(x.enum)for(let l of x.enum)k(l,u);else throw Error(`discriminator: "properties/${A}" must have "const" or "enum"`)}function k(x,u){if(typeof x!="string"||x in D)throw Error(`discriminator: "${A}" values must be unique strings`);D[x]=u}}}};X.default=H}),uW=i((X,Q)=>{Q.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}}),_5=i((X,Q)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.MissingRefError=X.ValidationError=X.CodeGen=X.Name=X.nil=X.stringify=X.str=X._=X.KeywordCxt=X.Ajv=void 0;var J=GW(),Y=gW(),G=fW(),$=uW(),W=["/properties"],H="http://json-schema.org/draft-07/schema";class U extends J.default{_addVocabularies(){if(super._addVocabularies(),Y.default.forEach((N)=>this.addVocabulary(N)),this.opts.discriminator)this.addKeyword(G.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let N=this.opts.$data?this.$dataMetaSchema($,W):$;this.addMetaSchema(N,H,!1),this.refs["http://json-schema.org/schema"]=H}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(H)?H:void 0)}}X.Ajv=U,Q.exports=X=U,Q.exports.Ajv=U,Object.defineProperty(X,"__esModule",{value:!0}),X.default=U;var B=Y6();Object.defineProperty(X,"KeywordCxt",{enumerable:!0,get:function(){return B.KeywordCxt}});var q=B0();Object.defineProperty(X,"_",{enumerable:!0,get:function(){return q._}}),Object.defineProperty(X,"str",{enumerable:!0,get:function(){return q.str}}),Object.defineProperty(X,"stringify",{enumerable:!0,get:function(){return q.stringify}}),Object.defineProperty(X,"nil",{enumerable:!0,get:function(){return q.nil}}),Object.defineProperty(X,"Name",{enumerable:!0,get:function(){return q.Name}}),Object.defineProperty(X,"CodeGen",{enumerable:!0,get:function(){return q.CodeGen}});var K=kX();Object.defineProperty(X,"ValidationError",{enumerable:!0,get:function(){return K.default}});var V=G6();Object.defineProperty(X,"MissingRefError",{enumerable:!0,get:function(){return V.default}})}),mW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.formatNames=X.fastFormats=X.fullFormats=void 0;function Q(k,x){return{validate:k,compare:x}}X.fullFormats={date:Q($,W),time:Q(U(!0),B),"date-time":Q(V(!0),N),"iso-time":Q(U(),q),"iso-date-time":Q(V(),w),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:z,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:g,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:F,int32:{type:"number",validate:D},int64:{type:"number",validate:I},float:{type:"number",validate:j},double:{type:"number",validate:j},password:!0,binary:!0},X.fastFormats={...X.fullFormats,date:Q(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,W),time:Q(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,B),"date-time":Q(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,N),"iso-time":Q(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,q),"iso-date-time":Q(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,w),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},X.formatNames=Object.keys(X.fullFormats);function J(k){return k%4===0&&(k%100!==0||k%400===0)}var Y=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,G=[0,31,28,31,30,31,30,31,31,30,31,30,31];function $(k){let x=Y.exec(k);if(!x)return!1;let u=+x[1],l=+x[2],Y0=+x[3];return l>=1&&l<=12&&Y0>=1&&Y0<=(l===2&&J(u)?29:G[l])}function W(k,x){if(!(k&&x))return;if(k>x)return 1;if(k<x)return-1;return 0}var H=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function U(k){return function(u){let l=H.exec(u);if(!l)return!1;let Y0=+l[1],O0=+l[2],_0=+l[3],h0=l[4],q0=l[5]==="-"?-1:1,S=+(l[6]||0),b=+(l[7]||0);if(S>23||b>59||k&&!h0)return!1;if(Y0<=23&&O0<=59&&_0<60)return!0;let f=O0-b*q0,R=Y0-S*q0-(f<0?1:0);return(R===23||R===-1)&&(f===59||f===-1)&&_0<61}}function B(k,x){if(!(k&&x))return;let u=new Date("2020-01-01T"+k).valueOf(),l=new Date("2020-01-01T"+x).valueOf();if(!(u&&l))return;return u-l}function q(k,x){if(!(k&&x))return;let u=H.exec(k),l=H.exec(x);if(!(u&&l))return;if(k=u[1]+u[2]+u[3],x=l[1]+l[2]+l[3],k>x)return 1;if(k<x)return-1;return 0}var K=/t|\s/i;function V(k){let x=U(k);return function(l){let Y0=l.split(K);return Y0.length===2&&$(Y0[0])&&x(Y0[1])}}function N(k,x){if(!(k&&x))return;let u=new Date(k).valueOf(),l=new Date(x).valueOf();if(!(u&&l))return;return u-l}function w(k,x){if(!(k&&x))return;let[u,l]=k.split(K),[Y0,O0]=x.split(K),_0=W(u,Y0);if(_0===void 0)return;return _0||B(l,O0)}var A=/\/|:/,Z=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function z(k){return A.test(k)&&Z.test(k)}var M=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function F(k){return M.lastIndex=0,M.test(k)}var L=-2147483648,O=2147483647;function D(k){return Number.isInteger(k)&&k<=O&&k>=L}function I(k){return Number.isInteger(k)}function j(){return!0}var E=/[^\\]\\Z/;function g(k){if(E.test(k))return!1;try{return new RegExp(k),!0}catch(x){return!1}}}),lW=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.formatLimitDefinition=void 0;var Q=_5(),J=B0(),Y=J.operators,G={formatMaximum:{okStr:"<=",ok:Y.LTE,fail:Y.GT},formatMinimum:{okStr:">=",ok:Y.GTE,fail:Y.LT},formatExclusiveMaximum:{okStr:"<",ok:Y.LT,fail:Y.GTE},formatExclusiveMinimum:{okStr:">",ok:Y.GT,fail:Y.LTE}},$={message:({keyword:H,schemaCode:U})=>J.str`should be ${G[H].okStr} ${U}`,params:({keyword:H,schemaCode:U})=>J._`{comparison: ${G[H].okStr}, limit: ${U}}`};X.formatLimitDefinition={keyword:Object.keys(G),type:"string",schemaType:"string",$data:!0,error:$,code(H){let{gen:U,data:B,schemaCode:q,keyword:K,it:V}=H,{opts:N,self:w}=V;if(!N.validateFormats)return;let A=new Q.KeywordCxt(V,w.RULES.all.format.definition,"format");if(A.$data)Z();else z();function Z(){let F=U.scopeValue("formats",{ref:w.formats,code:N.code.formats}),L=U.const("fmt",J._`${F}[${A.schemaCode}]`);H.fail$data((0,J.or)(J._`typeof ${L} != "object"`,J._`${L} instanceof RegExp`,J._`typeof ${L}.compare != "function"`,M(L)))}function z(){let F=A.schema,L=w.formats[F];if(!L||L===!0)return;if(typeof L!="object"||L instanceof RegExp||typeof L.compare!="function")throw Error(`"${K}": format "${F}" does not define "compare" function`);let O=U.scopeValue("formats",{key:F,ref:L,code:N.code.formats?J._`${N.code.formats}${(0,J.getProperty)(F)}`:void 0});H.fail$data(M(O))}function M(F){return J._`${F}.compare(${B}, ${q}) ${G[K].fail} 0`}},dependencies:["format"]};var W=(H)=>{return H.addKeyword(X.formatLimitDefinition),H};X.default=W}),cW=i((X,Q)=>{Object.defineProperty(X,"__esModule",{value:!0});var J=mW(),Y=lW(),G=B0(),$=new G.Name("fullFormats"),W=new G.Name("fastFormats"),H=(B,q={keywords:!0})=>{if(Array.isArray(q))return U(B,q,J.fullFormats,$),B;let[K,V]=q.mode==="fast"?[J.fastFormats,W]:[J.fullFormats,$],N=q.formats||J.formatNames;if(U(B,N,K,V),q.keywords)(0,Y.default)(B);return B};H.get=(B,q="full")=>{let V=(q==="fast"?J.fastFormats:J.fullFormats)[B];if(!V)throw Error(`Unknown format "${B}"`);return V};function U(B,q,K,V){var N,w;(N=(w=B.opts.code).formats)!==null&&N!==void 0||(w.formats=G._`require("ajv-formats/dist/formats").${V}`);for(let A of q)B.addFormat(A,K[A])}Q.exports=X=H,Object.defineProperty(X,"__esModule",{value:!0}),X.default=H}),iW=50;function k5(X=iW){let Q=new AbortController;return dW(X,Q.signal),Q}var aW=typeof global=="object"&&global&&global.Object===Object&&global,sW=aW,tW=typeof self=="object"&&self&&self.Object===Object&&self,eW=sW||tW||Function("return this")(),xX=eW,XH=xX.Symbol,p8=XH,v5=Object.prototype,QH=v5.hasOwnProperty,JH=v5.toString,g9=p8?p8.toStringTag:void 0;function YH(X){var Q=QH.call(X,g9),J=X[g9];try{X[g9]=void 0;var Y=!0}catch($){}var G=JH.call(X);if(Y)if(Q)X[g9]=J;else delete X[g9];return G}var GH=YH,$H=Object.prototype,WH=$H.toString;function HH(X){return WH.call(X)}var UH=HH,BH="[object Null]",zH="[object Undefined]",i4=p8?p8.toStringTag:void 0;function LH(X){if(X==null)return X===void 0?zH:BH;return i4&&i4 in Object(X)?GH(X):UH(X)}var qH=LH;function FH(X){var Q=typeof X;return X!=null&&(Q=="object"||Q=="function")}var y5=FH,KH="[object AsyncFunction]",VH="[object Function]",MH="[object GeneratorFunction]",DH="[object Proxy]";function ZH(X){if(!y5(X))return!1;var Q=qH(X);return Q==VH||Q==MH||Q==KH||Q==DH}var OH=ZH,AH=xX["__core-js_shared__"],ZX=AH,n4=function(){var X=/[^.]+$/.exec(ZX&&ZX.keys&&ZX.keys.IE_PROTO||"");return X?"Symbol(src)_1."+X:""}();function NH(X){return!!n4&&n4 in X}var RH=NH,IH=Function.prototype,jH=IH.toString;function wH(X){if(X!=null){try{return jH.call(X)}catch(Q){}try{return X+""}catch(Q){}}return""}var PH=wH,TH=/[\\^$.*+?()[\]{}|]/g,SH=/^\[object .+?Constructor\]$/,EH=Function.prototype,bH=Object.prototype,CH=EH.toString,_H=bH.hasOwnProperty,kH=RegExp("^"+CH.call(_H).replace(TH,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function vH(X){if(!y5(X)||RH(X))return!1;var Q=OH(X)?kH:SH;return Q.test(PH(X))}var yH=vH;function xH(X,Q){return X==null?void 0:X[Q]}var gH=xH;function hH(X,Q){var J=gH(X,Q);return yH(J)?J:void 0}var x5=hH,fH=x5(Object,"create"),m9=fH;function uH(){this.__data__=m9?m9(null):{},this.size=0}var mH=uH;function lH(X){var Q=this.has(X)&&delete this.__data__[X];return this.size-=Q?1:0,Q}var cH=lH,pH="__lodash_hash_undefined__",dH=Object.prototype,iH=dH.hasOwnProperty;function nH(X){var Q=this.__data__;if(m9){var J=Q[X];return J===pH?void 0:J}return iH.call(Q,X)?Q[X]:void 0}var rH=nH,oH=Object.prototype,aH=oH.hasOwnProperty;function sH(X){var Q=this.__data__;return m9?Q[X]!==void 0:aH.call(Q,X)}var tH=sH,eH="__lodash_hash_undefined__";function XU(X,Q){var J=this.__data__;return this.size+=this.has(X)?0:1,J[X]=m9&&Q===void 0?eH:Q,this}var QU=XU;function V9(X){var Q=-1,J=X==null?0:X.length;this.clear();while(++Q<J){var Y=X[Q];this.set(Y[0],Y[1])}}V9.prototype.clear=mH;V9.prototype.delete=cH;V9.prototype.get=rH;V9.prototype.has=tH;V9.prototype.set=QU;var r4=V9;function JU(){this.__data__=[],this.size=0}var YU=JU;function GU(X,Q){return X===Q||X!==X&&Q!==Q}var $U=GU;function WU(X,Q){var J=X.length;while(J--)if($U(X[J][0],Q))return J;return-1}var $6=WU,HU=Array.prototype,UU=HU.splice;function BU(X){var Q=this.__data__,J=$6(Q,X);if(J<0)return!1;var Y=Q.length-1;if(J==Y)Q.pop();else UU.call(Q,J,1);return--this.size,!0}var zU=BU;function LU(X){var Q=this.__data__,J=$6(Q,X);return J<0?void 0:Q[J][1]}var qU=LU;function FU(X){return $6(this.__data__,X)>-1}var KU=FU;function VU(X,Q){var J=this.__data__,Y=$6(J,X);if(Y<0)++this.size,J.push([X,Q]);else J[Y][1]=Q;return this}var MU=VU;function M9(X){var Q=-1,J=X==null?0:X.length;this.clear();while(++Q<J){var Y=X[Q];this.set(Y[0],Y[1])}}M9.prototype.clear=YU;M9.prototype.delete=zU;M9.prototype.get=qU;M9.prototype.has=KU;M9.prototype.set=MU;var DU=M9,ZU=x5(xX,"Map"),OU=ZU;function AU(){this.size=0,this.__data__={hash:new r4,map:new(OU||DU),string:new r4}}var NU=AU;function RU(X){var Q=typeof X;return Q=="string"||Q=="number"||Q=="symbol"||Q=="boolean"?X!=="__proto__":X===null}var IU=RU;function jU(X,Q){var J=X.__data__;return IU(Q)?J[typeof Q=="string"?"string":"hash"]:J.map}var W6=jU;function wU(X){var Q=W6(this,X).delete(X);return this.size-=Q?1:0,Q}var PU=wU;function TU(X){return W6(this,X).get(X)}var SU=TU;function EU(X){return W6(this,X).has(X)}var bU=EU;function CU(X,Q){var J=W6(this,X),Y=J.size;return J.set(X,Q),this.size+=J.size==Y?0:1,this}var _U=CU;function D9(X){var Q=-1,J=X==null?0:X.length;this.clear();while(++Q<J){var Y=X[Q];this.set(Y[0],Y[1])}}D9.prototype.clear=NU;D9.prototype.delete=PU;D9.prototype.get=SU;D9.prototype.has=bU;D9.prototype.set=_U;var g5=D9,kU="Expected a function";function gX(X,Q){if(typeof X!="function"||Q!=null&&typeof Q!="function")throw TypeError(kU);var J=function(){var Y=arguments,G=Q?Q.apply(this,Y):Y[0],$=J.cache;if($.has(G))return $.get(G);var W=X.apply(this,Y);return J.cache=$.set(G,W)||$,W};return J.cache=new(gX.Cache||g5),J}gX.Cache=g5;var J8=gX,o4=2000;function vU(X){if(process.stderr.destroyed)return;for(let Q=0;Q<X.length;Q+=o4)process.stderr.write(X.substring(Q,Q+o4))}var yU=J8((X)=>{if(!X||X.trim()==="")return null;let Q=X.split(",").map(($)=>$.trim()).filter(Boolean);if(Q.length===0)return null;let J=Q.some(($)=>$.startsWith("!")),Y=Q.some(($)=>!$.startsWith("!"));if(J&&Y)return null;let G=Q.map(($)=>$.replace(/^!/,"").toLowerCase());return{include:J?[]:G,exclude:J?G:[],isExclusive:J}});function xU(X){let Q=[],J=X.match(/^MCP server ["']([^"']+)["']/);if(J&&J[1])Q.push("mcp"),Q.push(J[1].toLowerCase());else{let $=X.match(/^([^:[]+):/);if($&&$[1])Q.push($[1].trim().toLowerCase())}let Y=X.match(/^\[([^\]]+)]/);if(Y&&Y[1])Q.push(Y[1].trim().toLowerCase());if(X.toLowerCase().includes("statsig event:"))Q.push("statsig");let G=X.match(/:\s*([^:]+?)(?:\s+(?:type|mode|status|event))?:/);if(G&&G[1]){let $=G[1].trim().toLowerCase();if($.length<30&&!$.includes(" "))Q.push($)}return Array.from(new Set(Q))}function gU(X,Q){if(!Q)return!0;if(X.length===0)return!1;if(Q.isExclusive)return!X.some((J)=>Q.exclude.includes(J));else return X.some((J)=>Q.include.includes(J))}function hU(X,Q){if(!Q)return!0;let J=xU(X);return gU(J,Q)}function h5(){return process.env.CLAUDE_CONFIG_DIR??fU(uU(),".claude")}function a4(X){if(!X)return!1;if(typeof X==="boolean")return X;let Q=X.toLowerCase().trim();return["1","true","yes","on"].includes(Q)}var OX=150000,x8=30000;function u5(X){return{name:X,default:x8,validate:(Q)=>{if(!Q)return{effective:x8,status:"valid"};let J=parseInt(Q,10);if(isNaN(J)||J<=0)return{effective:x8,status:"invalid",message:`Invalid value "${Q}" (using default: ${x8})`};if(J>OX)return{effective:OX,status:"capped",message:`Capped from ${J} to ${OX}`};return{effective:J,status:"valid"}}}}var pU=u5("BASH_MAX_OUTPUT_LENGTH"),_w=u5("TASK_MAX_OUTPUT_LENGTH"),dU={name:"CLAUDE_CODE_MAX_OUTPUT_TOKENS",default:32000,validate:(X)=>{if(!X)return{effective:32000,status:"valid"};let Y=parseInt(X,10);if(isNaN(Y)||Y<=0)return{effective:32000,status:"invalid",message:`Invalid value "${X}" (using default: 32000)`};if(Y>64000)return{effective:64000,status:"capped",message:`Capped from ${Y} to 64000`};return{effective:Y,status:"valid"}}};function iU(){let X="";if(typeof process<"u"&&typeof process.cwd==="function")X=lU(mU());return{originalCwd:X,totalCostUSD:0,totalAPIDuration:0,totalAPIDurationWithoutRetries:0,totalToolDuration:0,startTime:Date.now(),lastInteractionTime:Date.now(),totalLinesAdded:0,totalLinesRemoved:0,hasUnknownModelCost:!1,cwd:X,modelUsage:{},mainLoopModelOverride:void 0,initialMainLoopModel:null,modelStrings:null,isInteractive:!1,clientType:"cli",sessionIngressToken:void 0,oauthTokenFromFd:void 0,apiKeyFromFd:void 0,flagSettingsPath:void 0,allowedSettingSources:["userSettings","projectSettings","localSettings","flagSettings","policySettings"],meter:null,sessionCounter:null,locCounter:null,prCounter:null,commitCounter:null,costCounter:null,tokenCounter:null,codeEditToolDecisionCounter:null,activeTimeCounter:null,sessionId:cU(),loggerProvider:null,eventLogger:null,meterProvider:null,tracerProvider:null,agentColorMap:new Map,agentColorIndex:0,envVarValidators:[pU,dU],lastAPIRequest:null,inMemoryErrorLog:[],inlinePlugins:[],sessionBypassPermissionsMode:!1,sessionPersistenceDisabled:!1,hasExitedPlanMode:!1,needsPlanModeExitAttachment:!1,hasExitedDelegateMode:!1,needsDelegateModeExitAttachment:!1,lspRecommendationShownThisSession:!1,initJsonSchema:null,registeredHooks:null,planSlugCache:new Map,teleportedSessionInfo:null,invokedSkills:new Map,slowOperations:[],sdkBetas:void 0}}var i1=iU();function nU(){return i1.sessionId}var s4=10,rU=1e4;function m5(X,Q){return}function oU({writeFn:X,flushIntervalMs:Q=1000,maxBufferSize:J=100,immediateMode:Y=!1}){let G=[],$=null;function W(){if($)clearTimeout($),$=null}function H(){if(G.length===0)return;X(G.join("")),G=[],W()}function U(){if(!$)$=setTimeout(H,Q)}return{write(B){if(Y){X(B);return}if(G.push(B),U(),G.length>=J)H()},flush:H,dispose(){H()}}}var t4=new Set;function aU(X){return t4.add(X),()=>t4.delete(X)}var l5=1/0;function sU(X){if(X===null)return"null";if(X===void 0)return"undefined";if(Array.isArray(X))return`Array[${X.length}]`;if(typeof X==="object")return`Object{${Object.keys(X).length} keys}`;if(typeof X==="string")return`string(${X.length} chars)`;return typeof X}function c5(X,Q){let J=performance.now();try{return Q()}finally{let Y=performance.now()-J;if(Y>l5)R1(`[SLOW OPERATION DETECTED] ${X} (${Y.toFixed(1)}ms)`),m5(X,Y)}}function q1(X,Q,J){let Y=sU(X);return c5(`JSON.stringify(${Y})`,()=>JSON.stringify(X,Q,J))}var p5=(X,Q)=>{let J=typeof X==="string"?X.length:0;return c5(`JSON.parse(${J} chars)`,()=>JSON.parse(X,Q))},tU=J8(()=>{return a4(process.env.DEBUG)||a4(process.env.DEBUG_SDK)||process.argv.includes("--debug")||process.argv.includes("-d")||d5()||process.argv.some((X)=>X.startsWith("--debug="))}),eU=J8(()=>{let X=process.argv.find((J)=>J.startsWith("--debug="));if(!X)return null;let Q=X.substring(8);return yU(Q)}),d5=J8(()=>{return process.argv.includes("--debug-to-stderr")||process.argv.includes("-d2e")});function XB(X){if(typeof process>"u"||typeof process.versions>"u"||typeof process.versions.node>"u")return!1;let Q=eU();return hU(X,Q)}var QB=!1,g8=null;function JB(){if(!g8)g8=oU({writeFn:(X)=>{let Q=i5();if(!I1().existsSync(jX(Q)))I1().mkdirSync(jX(Q));I1().appendFileSync(Q,X),YB()},flushIntervalMs:1000,maxBufferSize:100,immediateMode:tU()}),aU(async()=>g8?.dispose());return g8}function R1(X,{level:Q}={level:"debug"}){if(!XB(X))return;if(QB&&X.includes(`
178
174
  `))X=q1(X);let Y=`${new Date().toISOString()} [${Q.toUpperCase()}] ${X.trim()}
179
- `;if(o4()){gU(Y);return}$z().write(Y)}function a4(){return process.env.CLAUDE_CODE_DEBUG_LOGS_DIR??c4(l4(),"debug",`${aU()}.txt`)}var Wz=Y8(()=>{if(process.argv[2]==="--ripgrep")return;try{let X=a4(),Q=PX(X),J=c4(Q,"latest");if(!I1().existsSync(Q))I1().mkdirSync(Q);if(I1().existsSync(J))try{I1().unlinkSync(J)}catch{}I1().symlinkSync(X,J)}catch{}});function k0(X,Q){let J=performance.now();try{return Q()}finally{let Y=performance.now()-J;if(Y>i4)R1(`[SLOW OPERATION DETECTED] fs.${X} (${Y.toFixed(1)}ms)`),d4(`fs.${X}`,Y)}}var Hz={cwd(){return process.cwd()},existsSync(X){return k0(`existsSync(${X})`,()=>W0.existsSync(X))},async stat(X){return tW(X)},statSync(X){return k0(`statSync(${X})`,()=>W0.statSync(X))},lstatSync(X){return k0(`lstatSync(${X})`,()=>W0.lstatSync(X))},readFileSync(X,Q){return k0(`readFileSync(${X})`,()=>W0.readFileSync(X,{encoding:Q.encoding}))},readFileBytesSync(X){return k0(`readFileBytesSync(${X})`,()=>W0.readFileSync(X))},readSync(X,Q){return k0(`readSync(${X}, ${Q.length} bytes)`,()=>{let J=void 0;try{J=W0.openSync(X,"r");let Y=Buffer.alloc(Q.length),G=W0.readSync(J,Y,0,Q.length,0);return{buffer:Y,bytesRead:G}}finally{if(J)W0.closeSync(J)}})},appendFileSync(X,Q,J){return k0(`appendFileSync(${X}, ${Q.length} chars)`,()=>{if(!W0.existsSync(X)&&J?.mode!==void 0){let Y=W0.openSync(X,"a",J.mode);try{W0.appendFileSync(Y,Q)}finally{W0.closeSync(Y)}}else W0.appendFileSync(X,Q)})},copyFileSync(X,Q){return k0(`copyFileSync(${X} → ${Q})`,()=>W0.copyFileSync(X,Q))},unlinkSync(X){return k0(`unlinkSync(${X})`,()=>W0.unlinkSync(X))},renameSync(X,Q){return k0(`renameSync(${X} → ${Q})`,()=>W0.renameSync(X,Q))},linkSync(X,Q){return k0(`linkSync(${X} → ${Q})`,()=>W0.linkSync(X,Q))},symlinkSync(X,Q){return k0(`symlinkSync(${X} → ${Q})`,()=>W0.symlinkSync(X,Q))},readlinkSync(X){return k0(`readlinkSync(${X})`,()=>W0.readlinkSync(X))},realpathSync(X){return k0(`realpathSync(${X})`,()=>W0.realpathSync(X))},mkdirSync(X,Q){return k0(`mkdirSync(${X})`,()=>{if(!W0.existsSync(X)){let J={recursive:!0};if(Q?.mode!==void 0)J.mode=Q.mode;W0.mkdirSync(X,J)}})},readdirSync(X){return k0(`readdirSync(${X})`,()=>W0.readdirSync(X,{withFileTypes:!0}))},readdirStringSync(X){return k0(`readdirStringSync(${X})`,()=>W0.readdirSync(X))},isDirEmptySync(X){return k0(`isDirEmptySync(${X})`,()=>{return this.readdirSync(X).length===0})},rmdirSync(X){return k0(`rmdirSync(${X})`,()=>W0.rmdirSync(X))},rmSync(X,Q){return k0(`rmSync(${X})`,()=>W0.rmSync(X,Q))},createWriteStream(X){return W0.createWriteStream(X)}},Uz=Hz;function I1(){return Uz}class U9 extends Error{}function s4(){return process.versions.bun!==void 0}var u8=null,G4=!1;function Fz(){if(G4)return u8;if(G4=!0,!process.env.DEBUG_CLAUDE_AGENT_SDK)return null;let X=Y4(l4(),"debug");if(u8=Y4(X,`sdk-${zz()}.txt`),!Lz(X))qz(X,{recursive:!0});return process.stderr.write(`SDK debug logs: ${u8}
180
- `),u8}function d1(X){let Q=Fz();if(!Q)return;let Y=`${new Date().toISOString()} ${X}
181
- `;Bz(Q,Y)}function Kz(X,Q){let J={...X};if(Q){let Y={sandbox:Q};if(J.settings)try{Y={...r4(J.settings),sandbox:Q}}catch{}J.settings=q1(Y)}return J}class t4{options;process;processStdin;processStdout;ready=!1;abortController;exitError;exitListeners=[];processExitHandler;abortHandler;constructor(X){this.options=X,this.abortController=X.abortController||g4(),this.initialize()}getDefaultExecutable(){return s4()?"bun":"node"}spawnLocalProcess(X){let{command:Q,args:J,cwd:Y,env:G,signal:$}=X,W=G.DEBUG_CLAUDE_AGENT_SDK||this.options.stderr?"pipe":"ignore",H=aW(Q,J,{cwd:Y,stdio:["pipe","pipe",W],signal:$,env:G,windowsHide:!0});if(G.DEBUG_CLAUDE_AGENT_SDK||this.options.stderr)H.stderr.on("data",(z)=>{let F=z.toString();if(d1(F),this.options.stderr)this.options.stderr(F)});return{stdin:H.stdin,stdout:H.stdout,get killed(){return H.killed},get exitCode(){return H.exitCode},kill:H.kill.bind(H),on:H.on.bind(H),once:H.once.bind(H),off:H.off.bind(H)}}initialize(){try{let{additionalDirectories:X=[],betas:Q,cwd:J,executable:Y=this.getDefaultExecutable(),executableArgs:G=[],extraArgs:$={},pathToClaudeCodeExecutable:W,env:H={...process.env},maxThinkingTokens:U,maxTurns:z,maxBudgetUsd:F,model:K,fallbackModel:M,jsonSchema:R,permissionMode:w,allowDangerouslySkipPermissions:A,permissionPromptToolName:Z,continueConversation:B,resume:V,settingSources:q,allowedTools:L=[],disallowedTools:O=[],tools:D,mcpServers:I,strictMcpConfig:j,canUseTool:E,includePartialMessages:g,plugins:k,sandbox:x}=this.options,u=["--output-format","stream-json","--verbose","--input-format","stream-json"];if(U!==void 0)u.push("--max-thinking-tokens",U.toString());if(z)u.push("--max-turns",z.toString());if(F!==void 0)u.push("--max-budget-usd",F.toString());if(K)u.push("--model",K);if(Q&&Q.length>0)u.push("--betas",Q.join(","));if(R)u.push("--json-schema",q1(R));if(H.DEBUG_CLAUDE_AGENT_SDK)u.push("--debug-to-stderr");if(E){if(Z)throw Error("canUseTool callback cannot be used with permissionPromptToolName. Please use one or the other.");u.push("--permission-prompt-tool","stdio")}else if(Z)u.push("--permission-prompt-tool",Z);if(B)u.push("--continue");if(V)u.push("--resume",V);if(L.length>0)u.push("--allowedTools",L.join(","));if(O.length>0)u.push("--disallowedTools",O.join(","));if(D!==void 0)if(Array.isArray(D))if(D.length===0)u.push("--tools","");else u.push("--tools",D.join(","));else u.push("--tools","default");if(I&&Object.keys(I).length>0)u.push("--mcp-config",q1({mcpServers:I}));if(q)u.push("--setting-sources",q.join(","));if(j)u.push("--strict-mcp-config");if(w)u.push("--permission-mode",w);if(A)u.push("--allow-dangerously-skip-permissions");if(M){if(K&&M===K)throw Error("Fallback model cannot be the same as the main model. Please specify a different model for fallbackModel option.");u.push("--fallback-model",M)}if(g)u.push("--include-partial-messages");for(let S of X)u.push("--add-dir",S);if(k&&k.length>0)for(let S of k)if(S.type==="local")u.push("--plugin-dir",S.path);else throw Error(`Unsupported plugin type: ${S.type}`);if(this.options.forkSession)u.push("--fork-session");if(this.options.resumeSessionAt)u.push("--resume-session-at",this.options.resumeSessionAt);if(this.options.persistSession===!1)u.push("--no-session-persistence");let l=Kz($??{},x);for(let[S,b]of Object.entries(l))if(b===null)u.push(`--${S}`);else u.push(`--${S}`,b);if(!H.CLAUDE_CODE_ENTRYPOINT)H.CLAUDE_CODE_ENTRYPOINT="sdk-ts";if(delete H.NODE_OPTIONS,H.DEBUG_CLAUDE_AGENT_SDK)H.DEBUG="1";else delete H.DEBUG;let Y0=Vz(W),Z0=Y0?W:Y,_0=Y0?[...G,...u]:[...G,W,...u],h0={command:Z0,args:_0,cwd:J,env:H,signal:this.abortController.signal};if(this.options.spawnClaudeCodeProcess)d1(`Spawning Claude Code (custom): ${Z0} ${_0.join(" ")}`),this.process=this.options.spawnClaudeCodeProcess(h0);else{if(!I1().existsSync(W)){let b=Y0?`Claude Code native binary not found at ${W}. Please ensure Claude Code is installed via native installer or specify a valid path with options.pathToClaudeCodeExecutable.`:`Claude Code executable not found at ${W}. Is options.pathToClaudeCodeExecutable set?`;throw ReferenceError(b)}d1(`Spawning Claude Code: ${Z0} ${_0.join(" ")}`),this.process=this.spawnLocalProcess(h0)}this.processStdin=this.process.stdin,this.processStdout=this.process.stdout;let q0=()=>{if(this.process&&!this.process.killed)this.process.kill("SIGTERM")};this.processExitHandler=q0,this.abortHandler=q0,process.on("exit",this.processExitHandler),this.abortController.signal.addEventListener("abort",this.abortHandler),this.process.on("error",(S)=>{if(this.ready=!1,this.abortController.signal.aborted)this.exitError=new U9("Claude Code process aborted by user");else this.exitError=Error(`Failed to spawn Claude Code process: ${S.message}`),d1(this.exitError.message)}),this.process.on("exit",(S,b)=>{if(this.ready=!1,this.abortController.signal.aborted)this.exitError=new U9("Claude Code process aborted by user");else{let f=this.getProcessExitError(S,b);if(f)this.exitError=f,d1(f.message)}}),this.ready=!0}catch(X){throw this.ready=!1,X}}getProcessExitError(X,Q){if(X!==0&&X!==null)return Error(`Claude Code process exited with code ${X}`);else if(Q)return Error(`Claude Code process terminated by signal ${Q}`);return}write(X){if(this.abortController.signal.aborted)throw new U9("Operation aborted");if(!this.ready||!this.processStdin)throw Error("ProcessTransport is not ready for writing");if(this.process?.killed||this.process?.exitCode!==null)throw Error("Cannot write to terminated process");if(this.exitError)throw Error(`Cannot write to process that exited with error: ${this.exitError.message}`);d1(`[ProcessTransport] Writing to stdin: ${X.substring(0,100)}`);try{if(!this.processStdin.write(X))d1("[ProcessTransport] Write buffer full, data queued")}catch(Q){throw this.ready=!1,Error(`Failed to write to process stdin: ${Q.message}`)}}close(){if(this.processStdin)this.processStdin.end(),this.processStdin=void 0;if(this.abortHandler)this.abortController.signal.removeEventListener("abort",this.abortHandler),this.abortHandler=void 0;for(let{handler:X}of this.exitListeners)this.process?.off("exit",X);if(this.exitListeners=[],this.process&&!this.process.killed)this.process.kill("SIGTERM"),setTimeout(()=>{if(this.process&&!this.process.killed)this.process.kill("SIGKILL")},5000);if(this.ready=!1,this.processExitHandler)process.off("exit",this.processExitHandler),this.processExitHandler=void 0}isReady(){return this.ready}async*readMessages(){if(!this.processStdout)throw Error("ProcessTransport output stream not available");let X=sW({input:this.processStdout});try{for await(let Q of X)if(Q.trim())yield r4(Q);await this.waitForExit()}catch(Q){throw Q}finally{X.close()}}endInput(){if(this.processStdin)this.processStdin.end()}getInputStream(){return this.processStdin}onExit(X){if(!this.process)return()=>{};let Q=(J,Y)=>{let G=this.getProcessExitError(J,Y);X(G)};return this.process.on("exit",Q),this.exitListeners.push({callback:X,handler:Q}),()=>{if(this.process)this.process.off("exit",Q);let J=this.exitListeners.findIndex((Y)=>Y.handler===Q);if(J!==-1)this.exitListeners.splice(J,1)}}async waitForExit(){if(!this.process){if(this.exitError)throw this.exitError;return}if(this.process.exitCode!==null||this.process.killed){if(this.exitError)throw this.exitError;return}return new Promise((X,Q)=>{let J=(G,$)=>{if(this.abortController.signal.aborted){Q(new U9("Operation aborted"));return}let W=this.getProcessExitError(G,$);if(W)Q(W);else X()};this.process.once("exit",J);let Y=(G)=>{this.process.off("exit",J),Q(G)};this.process.once("error",Y),this.process.once("exit",()=>{this.process.off("error",Y)})})}}function Vz(X){return![".js",".mjs",".tsx",".ts",".jsx"].some((J)=>X.endsWith(J))}class e4{returned;queue=[];readResolve;readReject;isDone=!1;hasError;started=!1;constructor(X){this.returned=X}[Symbol.asyncIterator](){if(this.started)throw Error("Stream can only be iterated once");return this.started=!0,this}next(){if(this.queue.length>0)return Promise.resolve({done:!1,value:this.queue.shift()});if(this.isDone)return Promise.resolve({done:!0,value:void 0});if(this.hasError)return Promise.reject(this.hasError);return new Promise((X,Q)=>{this.readResolve=X,this.readReject=Q})}enqueue(X){if(this.readResolve){let Q=this.readResolve;this.readResolve=void 0,this.readReject=void 0,Q({done:!1,value:X})}else this.queue.push(X)}done(){if(this.isDone=!0,this.readResolve){let X=this.readResolve;this.readResolve=void 0,this.readReject=void 0,X({done:!0,value:void 0})}}error(X){if(this.hasError=X,this.readReject){let Q=this.readReject;this.readResolve=void 0,this.readReject=void 0,Q(X)}}return(){if(this.isDone=!0,this.returned)this.returned();return Promise.resolve({done:!0,value:void 0})}}class XJ{sendMcpMessage;isClosed=!1;constructor(X){this.sendMcpMessage=X}onclose;onerror;onmessage;async start(){}async send(X){if(this.isClosed)throw Error("Transport is closed");this.sendMcpMessage(X)}async close(){if(this.isClosed)return;this.isClosed=!0,this.onclose?.()}}class QJ{transport;isSingleUserTurn;canUseTool;hooks;abortController;jsonSchema;initConfig;pendingControlResponses=new Map;cleanupPerformed=!1;sdkMessages;inputStream=new e4;initialization;cancelControllers=new Map;hookCallbacks=new Map;nextCallbackId=0;sdkMcpTransports=new Map;sdkMcpServerInstances=new Map;pendingMcpResponses=new Map;firstResultReceivedResolve;firstResultReceived=!1;hasBidirectionalNeeds(){return this.sdkMcpTransports.size>0||this.hooks!==void 0&&Object.keys(this.hooks).length>0||this.canUseTool!==void 0}constructor(X,Q,J,Y,G,$=new Map,W,H){this.transport=X,this.isSingleUserTurn=Q,this.canUseTool=J,this.hooks=Y,this.abortController=G,this.jsonSchema=W,this.initConfig=H;for(let[U,z]of $)this.connectSdkMcpServer(U,z);this.sdkMessages=this.readSdkMessages(),this.readMessages(),this.initialization=this.initialize(),this.initialization.catch(()=>{})}setError(X){this.inputStream.error(X)}cleanup(X){if(this.cleanupPerformed)return;this.cleanupPerformed=!0;try{this.transport.close(),this.pendingControlResponses.clear(),this.pendingMcpResponses.clear(),this.cancelControllers.clear(),this.hookCallbacks.clear();for(let Q of this.sdkMcpTransports.values())try{Q.close()}catch{}if(this.sdkMcpTransports.clear(),X)this.inputStream.error(X);else this.inputStream.done()}catch(Q){}}next(...[X]){return this.sdkMessages.next(...[X])}return(X){return this.sdkMessages.return(X)}throw(X){return this.sdkMessages.throw(X)}[Symbol.asyncIterator](){return this.sdkMessages}[Symbol.asyncDispose](){return this.sdkMessages[Symbol.asyncDispose]()}async readMessages(){try{for await(let X of this.transport.readMessages()){if(X.type==="control_response"){let Q=this.pendingControlResponses.get(X.response.request_id);if(Q)Q(X.response);continue}else if(X.type==="control_request"){this.handleControlRequest(X);continue}else if(X.type==="control_cancel_request"){this.handleControlCancelRequest(X);continue}else if(X.type==="keep_alive")continue;if(X.type==="result"){if(this.firstResultReceived=!0,this.firstResultReceivedResolve)this.firstResultReceivedResolve();if(this.isSingleUserTurn)R1("[Query.readMessages] First result received for single-turn query, closing stdin"),this.transport.endInput()}this.inputStream.enqueue(X)}if(this.firstResultReceivedResolve)this.firstResultReceivedResolve();this.inputStream.done(),this.cleanup()}catch(X){if(this.firstResultReceivedResolve)this.firstResultReceivedResolve();this.inputStream.error(X),this.cleanup(X)}}async handleControlRequest(X){let Q=new AbortController;this.cancelControllers.set(X.request_id,Q);try{let J=await this.processControlRequest(X,Q.signal),Y={type:"control_response",response:{subtype:"success",request_id:X.request_id,response:J}};await Promise.resolve(this.transport.write(q1(Y)+`
175
+ `;if(d5()){vU(Y);return}JB().write(Y)}function i5(){return process.env.CLAUDE_CODE_DEBUG_LOGS_DIR??f5(h5(),"debug",`${nU()}.txt`)}var YB=J8(()=>{if(process.argv[2]==="--ripgrep")return;try{let X=i5(),Q=jX(X),J=f5(Q,"latest");if(!I1().existsSync(Q))I1().mkdirSync(Q);if(I1().existsSync(J))try{I1().unlinkSync(J)}catch{}I1().symlinkSync(X,J)}catch{}});function k0(X,Q){let J=performance.now();try{return Q()}finally{let Y=performance.now()-J;if(Y>l5)R1(`[SLOW OPERATION DETECTED] fs.${X} (${Y.toFixed(1)}ms)`),m5(`fs.${X}`,Y)}}var GB={cwd(){return process.cwd()},existsSync(X){return k0(`existsSync(${X})`,()=>W0.existsSync(X))},async stat(X){return oW(X)},statSync(X){return k0(`statSync(${X})`,()=>W0.statSync(X))},lstatSync(X){return k0(`lstatSync(${X})`,()=>W0.lstatSync(X))},readFileSync(X,Q){return k0(`readFileSync(${X})`,()=>W0.readFileSync(X,{encoding:Q.encoding}))},readFileBytesSync(X){return k0(`readFileBytesSync(${X})`,()=>W0.readFileSync(X))},readSync(X,Q){return k0(`readSync(${X}, ${Q.length} bytes)`,()=>{let J=void 0;try{J=W0.openSync(X,"r");let Y=Buffer.alloc(Q.length),G=W0.readSync(J,Y,0,Q.length,0);return{buffer:Y,bytesRead:G}}finally{if(J)W0.closeSync(J)}})},appendFileSync(X,Q,J){return k0(`appendFileSync(${X}, ${Q.length} chars)`,()=>{if(!W0.existsSync(X)&&J?.mode!==void 0){let Y=W0.openSync(X,"a",J.mode);try{W0.appendFileSync(Y,Q)}finally{W0.closeSync(Y)}}else W0.appendFileSync(X,Q)})},copyFileSync(X,Q){return k0(`copyFileSync(${X} → ${Q})`,()=>W0.copyFileSync(X,Q))},unlinkSync(X){return k0(`unlinkSync(${X})`,()=>W0.unlinkSync(X))},renameSync(X,Q){return k0(`renameSync(${X} → ${Q})`,()=>W0.renameSync(X,Q))},linkSync(X,Q){return k0(`linkSync(${X} → ${Q})`,()=>W0.linkSync(X,Q))},symlinkSync(X,Q){return k0(`symlinkSync(${X} → ${Q})`,()=>W0.symlinkSync(X,Q))},readlinkSync(X){return k0(`readlinkSync(${X})`,()=>W0.readlinkSync(X))},realpathSync(X){return k0(`realpathSync(${X})`,()=>W0.realpathSync(X))},mkdirSync(X,Q){return k0(`mkdirSync(${X})`,()=>{if(!W0.existsSync(X)){let J={recursive:!0};if(Q?.mode!==void 0)J.mode=Q.mode;W0.mkdirSync(X,J)}})},readdirSync(X){return k0(`readdirSync(${X})`,()=>W0.readdirSync(X,{withFileTypes:!0}))},readdirStringSync(X){return k0(`readdirStringSync(${X})`,()=>W0.readdirSync(X))},isDirEmptySync(X){return k0(`isDirEmptySync(${X})`,()=>{return this.readdirSync(X).length===0})},rmdirSync(X){return k0(`rmdirSync(${X})`,()=>W0.rmdirSync(X))},rmSync(X,Q){return k0(`rmSync(${X})`,()=>W0.rmSync(X,Q))},createWriteStream(X){return W0.createWriteStream(X)}},$B=GB;function I1(){return $B}class W9 extends Error{}function n5(){return process.versions.bun!==void 0}var h8=null,X5=!1;function zB(){if(X5)return h8;if(X5=!0,!process.env.DEBUG_CLAUDE_AGENT_SDK)return null;let X=e4(h5(),"debug");if(h8=e4(X,`sdk-${WB()}.txt`),!UB(X))BB(X,{recursive:!0});return process.stderr.write(`SDK debug logs: ${h8}
176
+ `),h8}function d1(X){let Q=zB();if(!Q)return;let Y=`${new Date().toISOString()} ${X}
177
+ `;HB(Q,Y)}function LB(X,Q){let J={...X};if(Q){let Y={sandbox:Q};if(J.settings)try{Y={...p5(J.settings),sandbox:Q}}catch{}J.settings=q1(Y)}return J}class r5{options;process;processStdin;processStdout;ready=!1;abortController;exitError;exitListeners=[];processExitHandler;abortHandler;constructor(X){this.options=X,this.abortController=X.abortController||k5(),this.initialize()}getDefaultExecutable(){return n5()?"bun":"node"}spawnLocalProcess(X){let{command:Q,args:J,cwd:Y,env:G,signal:$}=X,W=G.DEBUG_CLAUDE_AGENT_SDK||this.options.stderr?"pipe":"ignore",H=nW(Q,J,{cwd:Y,stdio:["pipe","pipe",W],signal:$,env:G,windowsHide:!0});if(G.DEBUG_CLAUDE_AGENT_SDK||this.options.stderr)H.stderr.on("data",(B)=>{let q=B.toString();if(d1(q),this.options.stderr)this.options.stderr(q)});return{stdin:H.stdin,stdout:H.stdout,get killed(){return H.killed},get exitCode(){return H.exitCode},kill:H.kill.bind(H),on:H.on.bind(H),once:H.once.bind(H),off:H.off.bind(H)}}initialize(){try{let{additionalDirectories:X=[],betas:Q,cwd:J,executable:Y=this.getDefaultExecutable(),executableArgs:G=[],extraArgs:$={},pathToClaudeCodeExecutable:W,env:H={...process.env},maxThinkingTokens:U,maxTurns:B,maxBudgetUsd:q,model:K,fallbackModel:V,jsonSchema:N,permissionMode:w,allowDangerouslySkipPermissions:A,permissionPromptToolName:Z,continueConversation:z,resume:M,settingSources:F,allowedTools:L=[],disallowedTools:O=[],tools:D,mcpServers:I,strictMcpConfig:j,canUseTool:E,includePartialMessages:g,plugins:k,sandbox:x}=this.options,u=["--output-format","stream-json","--verbose","--input-format","stream-json"];if(U!==void 0)u.push("--max-thinking-tokens",U.toString());if(B)u.push("--max-turns",B.toString());if(q!==void 0)u.push("--max-budget-usd",q.toString());if(K)u.push("--model",K);if(Q&&Q.length>0)u.push("--betas",Q.join(","));if(N)u.push("--json-schema",q1(N));if(H.DEBUG_CLAUDE_AGENT_SDK)u.push("--debug-to-stderr");if(E){if(Z)throw Error("canUseTool callback cannot be used with permissionPromptToolName. Please use one or the other.");u.push("--permission-prompt-tool","stdio")}else if(Z)u.push("--permission-prompt-tool",Z);if(z)u.push("--continue");if(M)u.push("--resume",M);if(L.length>0)u.push("--allowedTools",L.join(","));if(O.length>0)u.push("--disallowedTools",O.join(","));if(D!==void 0)if(Array.isArray(D))if(D.length===0)u.push("--tools","");else u.push("--tools",D.join(","));else u.push("--tools","default");if(I&&Object.keys(I).length>0)u.push("--mcp-config",q1({mcpServers:I}));if(F)u.push("--setting-sources",F.join(","));if(j)u.push("--strict-mcp-config");if(w)u.push("--permission-mode",w);if(A)u.push("--allow-dangerously-skip-permissions");if(V){if(K&&V===K)throw Error("Fallback model cannot be the same as the main model. Please specify a different model for fallbackModel option.");u.push("--fallback-model",V)}if(g)u.push("--include-partial-messages");for(let S of X)u.push("--add-dir",S);if(k&&k.length>0)for(let S of k)if(S.type==="local")u.push("--plugin-dir",S.path);else throw Error(`Unsupported plugin type: ${S.type}`);if(this.options.forkSession)u.push("--fork-session");if(this.options.resumeSessionAt)u.push("--resume-session-at",this.options.resumeSessionAt);if(this.options.persistSession===!1)u.push("--no-session-persistence");let l=LB($??{},x);for(let[S,b]of Object.entries(l))if(b===null)u.push(`--${S}`);else u.push(`--${S}`,b);if(!H.CLAUDE_CODE_ENTRYPOINT)H.CLAUDE_CODE_ENTRYPOINT="sdk-ts";if(delete H.NODE_OPTIONS,H.DEBUG_CLAUDE_AGENT_SDK)H.DEBUG="1";else delete H.DEBUG;let Y0=qB(W),O0=Y0?W:Y,_0=Y0?[...G,...u]:[...G,W,...u],h0={command:O0,args:_0,cwd:J,env:H,signal:this.abortController.signal};if(this.options.spawnClaudeCodeProcess)d1(`Spawning Claude Code (custom): ${O0} ${_0.join(" ")}`),this.process=this.options.spawnClaudeCodeProcess(h0);else{if(!I1().existsSync(W)){let b=Y0?`Claude Code native binary not found at ${W}. Please ensure Claude Code is installed via native installer or specify a valid path with options.pathToClaudeCodeExecutable.`:`Claude Code executable not found at ${W}. Is options.pathToClaudeCodeExecutable set?`;throw ReferenceError(b)}d1(`Spawning Claude Code: ${O0} ${_0.join(" ")}`),this.process=this.spawnLocalProcess(h0)}this.processStdin=this.process.stdin,this.processStdout=this.process.stdout;let q0=()=>{if(this.process&&!this.process.killed)this.process.kill("SIGTERM")};this.processExitHandler=q0,this.abortHandler=q0,process.on("exit",this.processExitHandler),this.abortController.signal.addEventListener("abort",this.abortHandler),this.process.on("error",(S)=>{if(this.ready=!1,this.abortController.signal.aborted)this.exitError=new W9("Claude Code process aborted by user");else this.exitError=Error(`Failed to spawn Claude Code process: ${S.message}`),d1(this.exitError.message)}),this.process.on("exit",(S,b)=>{if(this.ready=!1,this.abortController.signal.aborted)this.exitError=new W9("Claude Code process aborted by user");else{let f=this.getProcessExitError(S,b);if(f)this.exitError=f,d1(f.message)}}),this.ready=!0}catch(X){throw this.ready=!1,X}}getProcessExitError(X,Q){if(X!==0&&X!==null)return Error(`Claude Code process exited with code ${X}`);else if(Q)return Error(`Claude Code process terminated by signal ${Q}`);return}write(X){if(this.abortController.signal.aborted)throw new W9("Operation aborted");if(!this.ready||!this.processStdin)throw Error("ProcessTransport is not ready for writing");if(this.process?.killed||this.process?.exitCode!==null)throw Error("Cannot write to terminated process");if(this.exitError)throw Error(`Cannot write to process that exited with error: ${this.exitError.message}`);d1(`[ProcessTransport] Writing to stdin: ${X.substring(0,100)}`);try{if(!this.processStdin.write(X))d1("[ProcessTransport] Write buffer full, data queued")}catch(Q){throw this.ready=!1,Error(`Failed to write to process stdin: ${Q.message}`)}}close(){if(this.processStdin)this.processStdin.end(),this.processStdin=void 0;if(this.abortHandler)this.abortController.signal.removeEventListener("abort",this.abortHandler),this.abortHandler=void 0;for(let{handler:X}of this.exitListeners)this.process?.off("exit",X);if(this.exitListeners=[],this.process&&!this.process.killed)this.process.kill("SIGTERM"),setTimeout(()=>{if(this.process&&!this.process.killed)this.process.kill("SIGKILL")},5000);if(this.ready=!1,this.processExitHandler)process.off("exit",this.processExitHandler),this.processExitHandler=void 0}isReady(){return this.ready}async*readMessages(){if(!this.processStdout)throw Error("ProcessTransport output stream not available");let X=rW({input:this.processStdout});try{for await(let Q of X)if(Q.trim())yield p5(Q);await this.waitForExit()}catch(Q){throw Q}finally{X.close()}}endInput(){if(this.processStdin)this.processStdin.end()}getInputStream(){return this.processStdin}onExit(X){if(!this.process)return()=>{};let Q=(J,Y)=>{let G=this.getProcessExitError(J,Y);X(G)};return this.process.on("exit",Q),this.exitListeners.push({callback:X,handler:Q}),()=>{if(this.process)this.process.off("exit",Q);let J=this.exitListeners.findIndex((Y)=>Y.handler===Q);if(J!==-1)this.exitListeners.splice(J,1)}}async waitForExit(){if(!this.process){if(this.exitError)throw this.exitError;return}if(this.process.exitCode!==null||this.process.killed){if(this.exitError)throw this.exitError;return}return new Promise((X,Q)=>{let J=(G,$)=>{if(this.abortController.signal.aborted){Q(new W9("Operation aborted"));return}let W=this.getProcessExitError(G,$);if(W)Q(W);else X()};this.process.once("exit",J);let Y=(G)=>{this.process.off("exit",J),Q(G)};this.process.once("error",Y),this.process.once("exit",()=>{this.process.off("error",Y)})})}}function qB(X){return![".js",".mjs",".tsx",".ts",".jsx"].some((J)=>X.endsWith(J))}class o5{returned;queue=[];readResolve;readReject;isDone=!1;hasError;started=!1;constructor(X){this.returned=X}[Symbol.asyncIterator](){if(this.started)throw Error("Stream can only be iterated once");return this.started=!0,this}next(){if(this.queue.length>0)return Promise.resolve({done:!1,value:this.queue.shift()});if(this.isDone)return Promise.resolve({done:!0,value:void 0});if(this.hasError)return Promise.reject(this.hasError);return new Promise((X,Q)=>{this.readResolve=X,this.readReject=Q})}enqueue(X){if(this.readResolve){let Q=this.readResolve;this.readResolve=void 0,this.readReject=void 0,Q({done:!1,value:X})}else this.queue.push(X)}done(){if(this.isDone=!0,this.readResolve){let X=this.readResolve;this.readResolve=void 0,this.readReject=void 0,X({done:!0,value:void 0})}}error(X){if(this.hasError=X,this.readReject){let Q=this.readReject;this.readResolve=void 0,this.readReject=void 0,Q(X)}}return(){if(this.isDone=!0,this.returned)this.returned();return Promise.resolve({done:!0,value:void 0})}}class a5{sendMcpMessage;isClosed=!1;constructor(X){this.sendMcpMessage=X}onclose;onerror;onmessage;async start(){}async send(X){if(this.isClosed)throw Error("Transport is closed");this.sendMcpMessage(X)}async close(){if(this.isClosed)return;this.isClosed=!0,this.onclose?.()}}class s5{transport;isSingleUserTurn;canUseTool;hooks;abortController;jsonSchema;initConfig;pendingControlResponses=new Map;cleanupPerformed=!1;sdkMessages;inputStream=new o5;initialization;cancelControllers=new Map;hookCallbacks=new Map;nextCallbackId=0;sdkMcpTransports=new Map;sdkMcpServerInstances=new Map;pendingMcpResponses=new Map;firstResultReceivedResolve;firstResultReceived=!1;hasBidirectionalNeeds(){return this.sdkMcpTransports.size>0||this.hooks!==void 0&&Object.keys(this.hooks).length>0||this.canUseTool!==void 0}constructor(X,Q,J,Y,G,$=new Map,W,H){this.transport=X,this.isSingleUserTurn=Q,this.canUseTool=J,this.hooks=Y,this.abortController=G,this.jsonSchema=W,this.initConfig=H;for(let[U,B]of $)this.connectSdkMcpServer(U,B);this.sdkMessages=this.readSdkMessages(),this.readMessages(),this.initialization=this.initialize(),this.initialization.catch(()=>{})}setError(X){this.inputStream.error(X)}cleanup(X){if(this.cleanupPerformed)return;this.cleanupPerformed=!0;try{this.transport.close(),this.pendingControlResponses.clear(),this.pendingMcpResponses.clear(),this.cancelControllers.clear(),this.hookCallbacks.clear();for(let Q of this.sdkMcpTransports.values())try{Q.close()}catch{}if(this.sdkMcpTransports.clear(),X)this.inputStream.error(X);else this.inputStream.done()}catch(Q){}}next(...[X]){return this.sdkMessages.next(...[X])}return(X){return this.sdkMessages.return(X)}throw(X){return this.sdkMessages.throw(X)}[Symbol.asyncIterator](){return this.sdkMessages}[Symbol.asyncDispose](){return this.sdkMessages[Symbol.asyncDispose]()}async readMessages(){try{for await(let X of this.transport.readMessages()){if(X.type==="control_response"){let Q=this.pendingControlResponses.get(X.response.request_id);if(Q)Q(X.response);continue}else if(X.type==="control_request"){this.handleControlRequest(X);continue}else if(X.type==="control_cancel_request"){this.handleControlCancelRequest(X);continue}else if(X.type==="keep_alive")continue;if(X.type==="result"){if(this.firstResultReceived=!0,this.firstResultReceivedResolve)this.firstResultReceivedResolve();if(this.isSingleUserTurn)R1("[Query.readMessages] First result received for single-turn query, closing stdin"),this.transport.endInput()}this.inputStream.enqueue(X)}if(this.firstResultReceivedResolve)this.firstResultReceivedResolve();this.inputStream.done(),this.cleanup()}catch(X){if(this.firstResultReceivedResolve)this.firstResultReceivedResolve();this.inputStream.error(X),this.cleanup(X)}}async handleControlRequest(X){let Q=new AbortController;this.cancelControllers.set(X.request_id,Q);try{let J=await this.processControlRequest(X,Q.signal),Y={type:"control_response",response:{subtype:"success",request_id:X.request_id,response:J}};await Promise.resolve(this.transport.write(q1(Y)+`
182
178
  `))}catch(J){let Y={type:"control_response",response:{subtype:"error",request_id:X.request_id,error:J.message||String(J)}};await Promise.resolve(this.transport.write(q1(Y)+`
183
- `))}finally{this.cancelControllers.delete(X.request_id)}}handleControlCancelRequest(X){let Q=this.cancelControllers.get(X.request_id);if(Q)Q.abort(),this.cancelControllers.delete(X.request_id)}async processControlRequest(X,Q){if(X.request.subtype==="can_use_tool"){if(!this.canUseTool)throw Error("canUseTool callback is not provided.");return{...await this.canUseTool(X.request.tool_name,X.request.input,{signal:Q,suggestions:X.request.permission_suggestions,blockedPath:X.request.blocked_path,decisionReason:X.request.decision_reason,toolUseID:X.request.tool_use_id,agentID:X.request.agent_id}),toolUseID:X.request.tool_use_id}}else if(X.request.subtype==="hook_callback")return await this.handleHookCallbacks(X.request.callback_id,X.request.input,X.request.tool_use_id,Q);else if(X.request.subtype==="mcp_message"){let J=X.request,Y=this.sdkMcpTransports.get(J.server_name);if(!Y)throw Error(`SDK MCP server not found: ${J.server_name}`);if("method"in J.message&&"id"in J.message&&J.message.id!==null)return{mcp_response:await this.handleMcpControlRequest(J.server_name,J,Y)};else{if(Y.onmessage)Y.onmessage(J.message);return{mcp_response:{jsonrpc:"2.0",result:{},id:0}}}}throw Error("Unsupported control request subtype: "+X.request.subtype)}async*readSdkMessages(){for await(let X of this.inputStream)yield X}async initialize(){let X;if(this.hooks){X={};for(let[G,$]of Object.entries(this.hooks))if($.length>0)X[G]=$.map((W)=>{let H=[];for(let U of W.hooks){let z=`hook_${this.nextCallbackId++}`;this.hookCallbacks.set(z,U),H.push(z)}return{matcher:W.matcher,hookCallbackIds:H,timeout:W.timeout}})}let Q=this.sdkMcpTransports.size>0?Array.from(this.sdkMcpTransports.keys()):void 0,J={subtype:"initialize",hooks:X,sdkMcpServers:Q,jsonSchema:this.jsonSchema,systemPrompt:this.initConfig?.systemPrompt,appendSystemPrompt:this.initConfig?.appendSystemPrompt,agents:this.initConfig?.agents};return(await this.request(J)).response}async interrupt(){await this.request({subtype:"interrupt"})}async setPermissionMode(X){await this.request({subtype:"set_permission_mode",mode:X})}async setModel(X){await this.request({subtype:"set_model",model:X})}async setMaxThinkingTokens(X){await this.request({subtype:"set_max_thinking_tokens",max_thinking_tokens:X})}async rewindFiles(X,Q){return(await this.request({subtype:"rewind_files",user_message_id:X,dry_run:Q?.dryRun})).response}async processPendingPermissionRequests(X){for(let Q of X)if(Q.request.subtype==="can_use_tool")this.handleControlRequest(Q).catch(()=>{})}request(X){let Q=Math.random().toString(36).substring(2,15),J={request_id:Q,type:"control_request",request:X};return new Promise((Y,G)=>{this.pendingControlResponses.set(Q,($)=>{if($.subtype==="success")Y($);else if(G(Error($.error)),$.pending_permission_requests)this.processPendingPermissionRequests($.pending_permission_requests)}),Promise.resolve(this.transport.write(q1(J)+`
179
+ `))}finally{this.cancelControllers.delete(X.request_id)}}handleControlCancelRequest(X){let Q=this.cancelControllers.get(X.request_id);if(Q)Q.abort(),this.cancelControllers.delete(X.request_id)}async processControlRequest(X,Q){if(X.request.subtype==="can_use_tool"){if(!this.canUseTool)throw Error("canUseTool callback is not provided.");return{...await this.canUseTool(X.request.tool_name,X.request.input,{signal:Q,suggestions:X.request.permission_suggestions,blockedPath:X.request.blocked_path,decisionReason:X.request.decision_reason,toolUseID:X.request.tool_use_id,agentID:X.request.agent_id}),toolUseID:X.request.tool_use_id}}else if(X.request.subtype==="hook_callback")return await this.handleHookCallbacks(X.request.callback_id,X.request.input,X.request.tool_use_id,Q);else if(X.request.subtype==="mcp_message"){let J=X.request,Y=this.sdkMcpTransports.get(J.server_name);if(!Y)throw Error(`SDK MCP server not found: ${J.server_name}`);if("method"in J.message&&"id"in J.message&&J.message.id!==null)return{mcp_response:await this.handleMcpControlRequest(J.server_name,J,Y)};else{if(Y.onmessage)Y.onmessage(J.message);return{mcp_response:{jsonrpc:"2.0",result:{},id:0}}}}throw Error("Unsupported control request subtype: "+X.request.subtype)}async*readSdkMessages(){for await(let X of this.inputStream)yield X}async initialize(){let X;if(this.hooks){X={};for(let[G,$]of Object.entries(this.hooks))if($.length>0)X[G]=$.map((W)=>{let H=[];for(let U of W.hooks){let B=`hook_${this.nextCallbackId++}`;this.hookCallbacks.set(B,U),H.push(B)}return{matcher:W.matcher,hookCallbackIds:H,timeout:W.timeout}})}let Q=this.sdkMcpTransports.size>0?Array.from(this.sdkMcpTransports.keys()):void 0,J={subtype:"initialize",hooks:X,sdkMcpServers:Q,jsonSchema:this.jsonSchema,systemPrompt:this.initConfig?.systemPrompt,appendSystemPrompt:this.initConfig?.appendSystemPrompt,agents:this.initConfig?.agents};return(await this.request(J)).response}async interrupt(){await this.request({subtype:"interrupt"})}async setPermissionMode(X){await this.request({subtype:"set_permission_mode",mode:X})}async setModel(X){await this.request({subtype:"set_model",model:X})}async setMaxThinkingTokens(X){await this.request({subtype:"set_max_thinking_tokens",max_thinking_tokens:X})}async rewindFiles(X,Q){return(await this.request({subtype:"rewind_files",user_message_id:X,dry_run:Q?.dryRun})).response}async processPendingPermissionRequests(X){for(let Q of X)if(Q.request.subtype==="can_use_tool")this.handleControlRequest(Q).catch(()=>{})}request(X){let Q=Math.random().toString(36).substring(2,15),J={request_id:Q,type:"control_request",request:X};return new Promise((Y,G)=>{this.pendingControlResponses.set(Q,($)=>{if($.subtype==="success")Y($);else if(G(Error($.error)),$.pending_permission_requests)this.processPendingPermissionRequests($.pending_permission_requests)}),Promise.resolve(this.transport.write(q1(J)+`
184
180
  `))})}async supportedCommands(){return(await this.initialization).commands}async supportedModels(){return(await this.initialization).models}async mcpServerStatus(){return(await this.request({subtype:"mcp_status"})).response.mcpServers}async setMcpServers(X){let Q={},J={};for(let[H,U]of Object.entries(X))if(U.type==="sdk"&&"instance"in U)Q[H]=U.instance;else J[H]=U;let Y=new Set(this.sdkMcpServerInstances.keys()),G=new Set(Object.keys(Q));for(let H of Y)if(!G.has(H))await this.disconnectSdkMcpServer(H);for(let[H,U]of Object.entries(Q))if(!Y.has(H))this.connectSdkMcpServer(H,U);let $={};for(let H of Object.keys(Q))$[H]={type:"sdk",name:H};return(await this.request({subtype:"mcp_set_servers",servers:{...J,...$}})).response}async accountInfo(){return(await this.initialization).account}async streamInput(X){R1("[Query.streamInput] Starting to process input stream");try{let Q=0;for await(let J of X){if(Q++,R1(`[Query.streamInput] Processing message ${Q}: ${J.type}`),this.abortController?.signal.aborted)break;await Promise.resolve(this.transport.write(q1(J)+`
185
- `))}if(R1(`[Query.streamInput] Finished processing ${Q} messages from input stream`),Q>0&&this.hasBidirectionalNeeds())R1("[Query.streamInput] Has bidirectional needs, waiting for first result"),await this.waitForFirstResult();R1("[Query] Calling transport.endInput() to close stdin to CLI process"),this.transport.endInput()}catch(Q){if(!(Q instanceof U9))throw Q}}waitForFirstResult(){if(this.firstResultReceived)return R1("[Query.waitForFirstResult] Result already received, returning immediately"),Promise.resolve();return new Promise((X)=>{if(this.abortController?.signal.aborted){X();return}this.abortController?.signal.addEventListener("abort",()=>X(),{once:!0}),this.firstResultReceivedResolve=X})}handleHookCallbacks(X,Q,J,Y){let G=this.hookCallbacks.get(X);if(!G)throw Error(`No hook callback found for ID: ${X}`);return G(Q,J,{signal:Y})}connectSdkMcpServer(X,Q){let J=new XJ((Y)=>this.sendMcpServerMessageToCli(X,Y));this.sdkMcpTransports.set(X,J),this.sdkMcpServerInstances.set(X,Q),Q.connect(J)}async disconnectSdkMcpServer(X){let Q=this.sdkMcpTransports.get(X);if(Q)await Q.close(),this.sdkMcpTransports.delete(X);this.sdkMcpServerInstances.delete(X)}sendMcpServerMessageToCli(X,Q){if("id"in Q&&Q.id!==null&&Q.id!==void 0){let Y=`${X}:${Q.id}`,G=this.pendingMcpResponses.get(Y);if(G){G.resolve(Q),this.pendingMcpResponses.delete(Y);return}}let J={type:"control_request",request_id:Mz(),request:{subtype:"mcp_message",server_name:X,message:Q}};this.transport.write(q1(J)+`
186
- `)}handleMcpControlRequest(X,Q,J){let Y="id"in Q.message?Q.message.id:null,G=`${X}:${Y}`;return new Promise(($,W)=>{let H=()=>{this.pendingMcpResponses.delete(G)},U=(F)=>{H(),$(F)},z=(F)=>{H(),W(F)};if(this.pendingMcpResponses.set(G,{resolve:U,reject:z}),J.onmessage)J.onmessage(Q.message);else{H(),W(Error("No message handler registered"));return}})}}var V0;(function(X){X.assertEqual=(G)=>{};function Q(G){}X.assertIs=Q;function J(G){throw Error()}X.assertNever=J,X.arrayToEnum=(G)=>{let $={};for(let W of G)$[W]=W;return $},X.getValidEnumValues=(G)=>{let $=X.objectKeys(G).filter((H)=>typeof G[G[H]]!=="number"),W={};for(let H of $)W[H]=G[H];return X.objectValues(W)},X.objectValues=(G)=>{return X.objectKeys(G).map(function($){return G[$]})},X.objectKeys=typeof Object.keys==="function"?(G)=>Object.keys(G):(G)=>{let $=[];for(let W in G)if(Object.prototype.hasOwnProperty.call(G,W))$.push(W);return $},X.find=(G,$)=>{for(let W of G)if($(W))return W;return},X.isInteger=typeof Number.isInteger==="function"?(G)=>Number.isInteger(G):(G)=>typeof G==="number"&&Number.isFinite(G)&&Math.floor(G)===G;function Y(G,$=" | "){return G.map((W)=>typeof W==="string"?`'${W}'`:W).join($)}X.joinValues=Y,X.jsonStringifyReplacer=(G,$)=>{if(typeof $==="bigint")return $.toString();return $}})(V0||(V0={}));var $4;(function(X){X.mergeShapes=(Q,J)=>{return{...Q,...J}}})($4||($4={}));var n=V0.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),C1=(X)=>{switch(typeof X){case"undefined":return n.undefined;case"string":return n.string;case"number":return Number.isNaN(X)?n.nan:n.number;case"boolean":return n.boolean;case"function":return n.function;case"bigint":return n.bigint;case"symbol":return n.symbol;case"object":if(Array.isArray(X))return n.array;if(X===null)return n.null;if(X.then&&typeof X.then==="function"&&X.catch&&typeof X.catch==="function")return n.promise;if(typeof Map<"u"&&X instanceof Map)return n.map;if(typeof Set<"u"&&X instanceof Set)return n.set;if(typeof Date<"u"&&X instanceof Date)return n.date;return n.object;default:return n.unknown}},m=V0.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class X1 extends Error{get errors(){return this.issues}constructor(X){super();this.issues=[],this.addIssue=(J)=>{this.issues=[...this.issues,J]},this.addIssues=(J=[])=>{this.issues=[...this.issues,...J]};let Q=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,Q);else this.__proto__=Q;this.name="ZodError",this.issues=X}format(X){let Q=X||function(G){return G.message},J={_errors:[]},Y=(G)=>{for(let $ of G.issues)if($.code==="invalid_union")$.unionErrors.map(Y);else if($.code==="invalid_return_type")Y($.returnTypeError);else if($.code==="invalid_arguments")Y($.argumentsError);else if($.path.length===0)J._errors.push(Q($));else{let W=J,H=0;while(H<$.path.length){let U=$.path[H];if(H!==$.path.length-1)W[U]=W[U]||{_errors:[]};else W[U]=W[U]||{_errors:[]},W[U]._errors.push(Q($));W=W[U],H++}}};return Y(this),J}static assert(X){if(!(X instanceof X1))throw Error(`Not a ZodError: ${X}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,V0.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(X=(Q)=>Q.message){let Q={},J=[];for(let Y of this.issues)if(Y.path.length>0){let G=Y.path[0];Q[G]=Q[G]||[],Q[G].push(X(Y))}else J.push(X(Y));return{formErrors:J,fieldErrors:Q}}get formErrors(){return this.flatten()}}X1.create=(X)=>{return new X1(X)};var Dz=(X,Q)=>{let J;switch(X.code){case m.invalid_type:if(X.received===n.undefined)J="Required";else J=`Expected ${X.expected}, received ${X.received}`;break;case m.invalid_literal:J=`Invalid literal value, expected ${JSON.stringify(X.expected,V0.jsonStringifyReplacer)}`;break;case m.unrecognized_keys:J=`Unrecognized key(s) in object: ${V0.joinValues(X.keys,", ")}`;break;case m.invalid_union:J="Invalid input";break;case m.invalid_union_discriminator:J=`Invalid discriminator value. Expected ${V0.joinValues(X.options)}`;break;case m.invalid_enum_value:J=`Invalid enum value. Expected ${V0.joinValues(X.options)}, received '${X.received}'`;break;case m.invalid_arguments:J="Invalid function arguments";break;case m.invalid_return_type:J="Invalid function return type";break;case m.invalid_date:J="Invalid date";break;case m.invalid_string:if(typeof X.validation==="object")if("includes"in X.validation){if(J=`Invalid input: must include "${X.validation.includes}"`,typeof X.validation.position==="number")J=`${J} at one or more positions greater than or equal to ${X.validation.position}`}else if("startsWith"in X.validation)J=`Invalid input: must start with "${X.validation.startsWith}"`;else if("endsWith"in X.validation)J=`Invalid input: must end with "${X.validation.endsWith}"`;else V0.assertNever(X.validation);else if(X.validation!=="regex")J=`Invalid ${X.validation}`;else J="Invalid";break;case m.too_small:if(X.type==="array")J=`Array must contain ${X.exact?"exactly":X.inclusive?"at least":"more than"} ${X.minimum} element(s)`;else if(X.type==="string")J=`String must contain ${X.exact?"exactly":X.inclusive?"at least":"over"} ${X.minimum} character(s)`;else if(X.type==="number")J=`Number must be ${X.exact?"exactly equal to ":X.inclusive?"greater than or equal to ":"greater than "}${X.minimum}`;else if(X.type==="bigint")J=`Number must be ${X.exact?"exactly equal to ":X.inclusive?"greater than or equal to ":"greater than "}${X.minimum}`;else if(X.type==="date")J=`Date must be ${X.exact?"exactly equal to ":X.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(X.minimum))}`;else J="Invalid input";break;case m.too_big:if(X.type==="array")J=`Array must contain ${X.exact?"exactly":X.inclusive?"at most":"less than"} ${X.maximum} element(s)`;else if(X.type==="string")J=`String must contain ${X.exact?"exactly":X.inclusive?"at most":"under"} ${X.maximum} character(s)`;else if(X.type==="number")J=`Number must be ${X.exact?"exactly":X.inclusive?"less than or equal to":"less than"} ${X.maximum}`;else if(X.type==="bigint")J=`BigInt must be ${X.exact?"exactly":X.inclusive?"less than or equal to":"less than"} ${X.maximum}`;else if(X.type==="date")J=`Date must be ${X.exact?"exactly":X.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(X.maximum))}`;else J="Invalid input";break;case m.custom:J="Invalid input";break;case m.invalid_intersection_types:J="Intersection results could not be merged";break;case m.not_multiple_of:J=`Number must be a multiple of ${X.multipleOf}`;break;case m.not_finite:J="Number must be finite";break;default:J=Q.defaultError,V0.assertNever(X)}return{message:J}},c9=Dz,Zz=c9;function TX(){return Zz}var SX=(X)=>{let{data:Q,path:J,errorMaps:Y,issueData:G}=X,$=[...J,...G.path||[]],W={...G,path:$};if(G.message!==void 0)return{...G,path:$,message:G.message};let H="",U=Y.filter((z)=>!!z).slice().reverse();for(let z of U)H=z(W,{data:Q,defaultError:H}).message;return{...G,path:$,message:H}};function d(X,Q){let J=TX(),Y=SX({issueData:Q,data:X.data,path:X.path,errorMaps:[X.common.contextualErrorMap,X.schemaErrorMap,J,J===c9?void 0:c9].filter((G)=>!!G)});X.common.issues.push(Y)}class d0{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(X,Q){let J=[];for(let Y of Q){if(Y.status==="aborted")return G0;if(Y.status==="dirty")X.dirty();J.push(Y.value)}return{status:X.value,value:J}}static async mergeObjectAsync(X,Q){let J=[];for(let Y of Q){let G=await Y.key,$=await Y.value;J.push({key:G,value:$})}return d0.mergeObjectSync(X,J)}static mergeObjectSync(X,Q){let J={};for(let Y of Q){let{key:G,value:$}=Y;if(G.status==="aborted")return G0;if($.status==="aborted")return G0;if(G.status==="dirty")X.dirty();if($.status==="dirty")X.dirty();if(G.value!=="__proto__"&&(typeof $.value<"u"||Y.alwaysSet))J[G.value]=$.value}return{status:X.value,value:J}}}var G0=Object.freeze({status:"aborted"}),f9=(X)=>({status:"dirty",value:X}),n0=(X)=>({status:"valid",value:X}),W4=(X)=>X.status==="aborted",H4=(X)=>X.status==="dirty",B9=(X)=>X.status==="valid",n8=(X)=>typeof Promise<"u"&&X instanceof Promise,o;(function(X){X.errToObj=(Q)=>typeof Q==="string"?{message:Q}:Q||{},X.toString=(Q)=>typeof Q==="string"?Q:Q?.message})(o||(o={}));class W1{constructor(X,Q,J,Y){this._cachedPath=[],this.parent=X,this.data=Q,this._path=J,this._key=Y}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}var U4=(X,Q)=>{if(B9(Q))return{success:!0,data:Q.value};else{if(!X.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let J=new X1(X.common.issues);return this._error=J,this._error}}}};function H0(X){if(!X)return{};let{errorMap:Q,invalid_type_error:J,required_error:Y,description:G}=X;if(Q&&(J||Y))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(Q)return{errorMap:Q,description:G};return{errorMap:(W,H)=>{let{message:U}=X;if(W.code==="invalid_enum_value")return{message:U??H.defaultError};if(typeof H.data>"u")return{message:U??Y??H.defaultError};if(W.code!=="invalid_type")return{message:H.defaultError};return{message:U??J??H.defaultError}},description:G}}class L0{get description(){return this._def.description}_getType(X){return C1(X.data)}_getOrReturnCtx(X,Q){return Q||{common:X.parent.common,data:X.data,parsedType:C1(X.data),schemaErrorMap:this._def.errorMap,path:X.path,parent:X.parent}}_processInputParams(X){return{status:new d0,ctx:{common:X.parent.common,data:X.data,parsedType:C1(X.data),schemaErrorMap:this._def.errorMap,path:X.path,parent:X.parent}}}_parseSync(X){let Q=this._parse(X);if(n8(Q))throw Error("Synchronous parse encountered promise.");return Q}_parseAsync(X){let Q=this._parse(X);return Promise.resolve(Q)}parse(X,Q){let J=this.safeParse(X,Q);if(J.success)return J.data;throw J.error}safeParse(X,Q){let J={common:{issues:[],async:Q?.async??!1,contextualErrorMap:Q?.errorMap},path:Q?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:X,parsedType:C1(X)},Y=this._parseSync({data:X,path:J.path,parent:J});return U4(J,Y)}"~validate"(X){let Q={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:X,parsedType:C1(X)};if(!this["~standard"].async)try{let J=this._parseSync({data:X,path:[],parent:Q});return B9(J)?{value:J.value}:{issues:Q.common.issues}}catch(J){if(J?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;Q.common={issues:[],async:!0}}return this._parseAsync({data:X,path:[],parent:Q}).then((J)=>B9(J)?{value:J.value}:{issues:Q.common.issues})}async parseAsync(X,Q){let J=await this.safeParseAsync(X,Q);if(J.success)return J.data;throw J.error}async safeParseAsync(X,Q){let J={common:{issues:[],contextualErrorMap:Q?.errorMap,async:!0},path:Q?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:X,parsedType:C1(X)},Y=this._parse({data:X,path:J.path,parent:J}),G=await(n8(Y)?Y:Promise.resolve(Y));return U4(J,G)}refine(X,Q){let J=(Y)=>{if(typeof Q==="string"||typeof Q>"u")return{message:Q};else if(typeof Q==="function")return Q(Y);else return Q};return this._refinement((Y,G)=>{let $=X(Y),W=()=>G.addIssue({code:m.custom,...J(Y)});if(typeof Promise<"u"&&$ instanceof Promise)return $.then((H)=>{if(!H)return W(),!1;else return!0});if(!$)return W(),!1;else return!0})}refinement(X,Q){return this._refinement((J,Y)=>{if(!X(J))return Y.addIssue(typeof Q==="function"?Q(J,Y):Q),!1;else return!0})}_refinement(X){return new M1({schema:this,typeName:$0.ZodEffects,effect:{type:"refinement",refinement:X}})}superRefine(X){return this._refinement(X)}constructor(X){this.spa=this.safeParseAsync,this._def=X,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(Q)=>this["~validate"](Q)}}optional(){return K1.create(this,this._def)}nullable(){return k1.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return F1.create(this)}promise(){return K9.create(this,this._def)}or(X){return n9.create([this,X],this._def)}and(X){return r9.create(this,X,this._def)}transform(X){return new M1({...H0(this._def),schema:this,typeName:$0.ZodEffects,effect:{type:"transform",transform:X}})}default(X){let Q=typeof X==="function"?X:()=>X;return new t9({...H0(this._def),innerType:this,defaultValue:Q,typeName:$0.ZodDefault})}brand(){return new mX({typeName:$0.ZodBranded,type:this,...H0(this._def)})}catch(X){let Q=typeof X==="function"?X:()=>X;return new e9({...H0(this._def),innerType:this,catchValue:Q,typeName:$0.ZodCatch})}describe(X){return new this.constructor({...this._def,description:X})}pipe(X){return z6.create(this,X)}readonly(){return X8.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var Oz=/^c[^\s-]{8,}$/i,Az=/^[0-9a-z]+$/,Nz=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Rz=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Iz=/^[a-z0-9_-]{21}$/i,jz=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,wz=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Pz=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Tz="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",RX,Sz=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Ez=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,bz=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Cz=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,_z=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,kz=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,JJ="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",vz=new RegExp(`^${JJ}$`);function YJ(X){let Q="[0-5]\\d";if(X.precision)Q=`${Q}\\.\\d{${X.precision}}`;else if(X.precision==null)Q=`${Q}(\\.\\d+)?`;let J=X.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${Q})${J}`}function yz(X){return new RegExp(`^${YJ(X)}$`)}function xz(X){let Q=`${JJ}T${YJ(X)}`,J=[];if(J.push(X.local?"Z?":"Z"),X.offset)J.push("([+-]\\d{2}:?\\d{2})");return Q=`${Q}(${J.join("|")})`,new RegExp(`^${Q}$`)}function gz(X,Q){if((Q==="v4"||!Q)&&Sz.test(X))return!0;if((Q==="v6"||!Q)&&bz.test(X))return!0;return!1}function hz(X,Q){if(!jz.test(X))return!1;try{let[J]=X.split(".");if(!J)return!1;let Y=J.replace(/-/g,"+").replace(/_/g,"/").padEnd(J.length+(4-J.length%4)%4,"="),G=JSON.parse(atob(Y));if(typeof G!=="object"||G===null)return!1;if("typ"in G&&G?.typ!=="JWT")return!1;if(!G.alg)return!1;if(Q&&G.alg!==Q)return!1;return!0}catch{return!1}}function fz(X,Q){if((Q==="v4"||!Q)&&Ez.test(X))return!0;if((Q==="v6"||!Q)&&Cz.test(X))return!0;return!1}class j1 extends L0{_parse(X){if(this._def.coerce)X.data=String(X.data);if(this._getType(X)!==n.string){let G=this._getOrReturnCtx(X);return d(G,{code:m.invalid_type,expected:n.string,received:G.parsedType}),G0}let J=new d0,Y=void 0;for(let G of this._def.checks)if(G.kind==="min"){if(X.data.length<G.value)Y=this._getOrReturnCtx(X,Y),d(Y,{code:m.too_small,minimum:G.value,type:"string",inclusive:!0,exact:!1,message:G.message}),J.dirty()}else if(G.kind==="max"){if(X.data.length>G.value)Y=this._getOrReturnCtx(X,Y),d(Y,{code:m.too_big,maximum:G.value,type:"string",inclusive:!0,exact:!1,message:G.message}),J.dirty()}else if(G.kind==="length"){let $=X.data.length>G.value,W=X.data.length<G.value;if($||W){if(Y=this._getOrReturnCtx(X,Y),$)d(Y,{code:m.too_big,maximum:G.value,type:"string",inclusive:!0,exact:!0,message:G.message});else if(W)d(Y,{code:m.too_small,minimum:G.value,type:"string",inclusive:!0,exact:!0,message:G.message});J.dirty()}}else if(G.kind==="email"){if(!Pz.test(X.data))Y=this._getOrReturnCtx(X,Y),d(Y,{validation:"email",code:m.invalid_string,message:G.message}),J.dirty()}else if(G.kind==="emoji"){if(!RX)RX=new RegExp(Tz,"u");if(!RX.test(X.data))Y=this._getOrReturnCtx(X,Y),d(Y,{validation:"emoji",code:m.invalid_string,message:G.message}),J.dirty()}else if(G.kind==="uuid"){if(!Rz.test(X.data))Y=this._getOrReturnCtx(X,Y),d(Y,{validation:"uuid",code:m.invalid_string,message:G.message}),J.dirty()}else if(G.kind==="nanoid"){if(!Iz.test(X.data))Y=this._getOrReturnCtx(X,Y),d(Y,{validation:"nanoid",code:m.invalid_string,message:G.message}),J.dirty()}else if(G.kind==="cuid"){if(!Oz.test(X.data))Y=this._getOrReturnCtx(X,Y),d(Y,{validation:"cuid",code:m.invalid_string,message:G.message}),J.dirty()}else if(G.kind==="cuid2"){if(!Az.test(X.data))Y=this._getOrReturnCtx(X,Y),d(Y,{validation:"cuid2",code:m.invalid_string,message:G.message}),J.dirty()}else if(G.kind==="ulid"){if(!Nz.test(X.data))Y=this._getOrReturnCtx(X,Y),d(Y,{validation:"ulid",code:m.invalid_string,message:G.message}),J.dirty()}else if(G.kind==="url")try{new URL(X.data)}catch{Y=this._getOrReturnCtx(X,Y),d(Y,{validation:"url",code:m.invalid_string,message:G.message}),J.dirty()}else if(G.kind==="regex"){if(G.regex.lastIndex=0,!G.regex.test(X.data))Y=this._getOrReturnCtx(X,Y),d(Y,{validation:"regex",code:m.invalid_string,message:G.message}),J.dirty()}else if(G.kind==="trim")X.data=X.data.trim();else if(G.kind==="includes"){if(!X.data.includes(G.value,G.position))Y=this._getOrReturnCtx(X,Y),d(Y,{code:m.invalid_string,validation:{includes:G.value,position:G.position},message:G.message}),J.dirty()}else if(G.kind==="toLowerCase")X.data=X.data.toLowerCase();else if(G.kind==="toUpperCase")X.data=X.data.toUpperCase();else if(G.kind==="startsWith"){if(!X.data.startsWith(G.value))Y=this._getOrReturnCtx(X,Y),d(Y,{code:m.invalid_string,validation:{startsWith:G.value},message:G.message}),J.dirty()}else if(G.kind==="endsWith"){if(!X.data.endsWith(G.value))Y=this._getOrReturnCtx(X,Y),d(Y,{code:m.invalid_string,validation:{endsWith:G.value},message:G.message}),J.dirty()}else if(G.kind==="datetime"){if(!xz(G).test(X.data))Y=this._getOrReturnCtx(X,Y),d(Y,{code:m.invalid_string,validation:"datetime",message:G.message}),J.dirty()}else if(G.kind==="date"){if(!vz.test(X.data))Y=this._getOrReturnCtx(X,Y),d(Y,{code:m.invalid_string,validation:"date",message:G.message}),J.dirty()}else if(G.kind==="time"){if(!yz(G).test(X.data))Y=this._getOrReturnCtx(X,Y),d(Y,{code:m.invalid_string,validation:"time",message:G.message}),J.dirty()}else if(G.kind==="duration"){if(!wz.test(X.data))Y=this._getOrReturnCtx(X,Y),d(Y,{validation:"duration",code:m.invalid_string,message:G.message}),J.dirty()}else if(G.kind==="ip"){if(!gz(X.data,G.version))Y=this._getOrReturnCtx(X,Y),d(Y,{validation:"ip",code:m.invalid_string,message:G.message}),J.dirty()}else if(G.kind==="jwt"){if(!hz(X.data,G.alg))Y=this._getOrReturnCtx(X,Y),d(Y,{validation:"jwt",code:m.invalid_string,message:G.message}),J.dirty()}else if(G.kind==="cidr"){if(!fz(X.data,G.version))Y=this._getOrReturnCtx(X,Y),d(Y,{validation:"cidr",code:m.invalid_string,message:G.message}),J.dirty()}else if(G.kind==="base64"){if(!_z.test(X.data))Y=this._getOrReturnCtx(X,Y),d(Y,{validation:"base64",code:m.invalid_string,message:G.message}),J.dirty()}else if(G.kind==="base64url"){if(!kz.test(X.data))Y=this._getOrReturnCtx(X,Y),d(Y,{validation:"base64url",code:m.invalid_string,message:G.message}),J.dirty()}else V0.assertNever(G);return{status:J.value,value:X.data}}_regex(X,Q,J){return this.refinement((Y)=>X.test(Y),{validation:Q,code:m.invalid_string,...o.errToObj(J)})}_addCheck(X){return new j1({...this._def,checks:[...this._def.checks,X]})}email(X){return this._addCheck({kind:"email",...o.errToObj(X)})}url(X){return this._addCheck({kind:"url",...o.errToObj(X)})}emoji(X){return this._addCheck({kind:"emoji",...o.errToObj(X)})}uuid(X){return this._addCheck({kind:"uuid",...o.errToObj(X)})}nanoid(X){return this._addCheck({kind:"nanoid",...o.errToObj(X)})}cuid(X){return this._addCheck({kind:"cuid",...o.errToObj(X)})}cuid2(X){return this._addCheck({kind:"cuid2",...o.errToObj(X)})}ulid(X){return this._addCheck({kind:"ulid",...o.errToObj(X)})}base64(X){return this._addCheck({kind:"base64",...o.errToObj(X)})}base64url(X){return this._addCheck({kind:"base64url",...o.errToObj(X)})}jwt(X){return this._addCheck({kind:"jwt",...o.errToObj(X)})}ip(X){return this._addCheck({kind:"ip",...o.errToObj(X)})}cidr(X){return this._addCheck({kind:"cidr",...o.errToObj(X)})}datetime(X){if(typeof X==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:X});return this._addCheck({kind:"datetime",precision:typeof X?.precision>"u"?null:X?.precision,offset:X?.offset??!1,local:X?.local??!1,...o.errToObj(X?.message)})}date(X){return this._addCheck({kind:"date",message:X})}time(X){if(typeof X==="string")return this._addCheck({kind:"time",precision:null,message:X});return this._addCheck({kind:"time",precision:typeof X?.precision>"u"?null:X?.precision,...o.errToObj(X?.message)})}duration(X){return this._addCheck({kind:"duration",...o.errToObj(X)})}regex(X,Q){return this._addCheck({kind:"regex",regex:X,...o.errToObj(Q)})}includes(X,Q){return this._addCheck({kind:"includes",value:X,position:Q?.position,...o.errToObj(Q?.message)})}startsWith(X,Q){return this._addCheck({kind:"startsWith",value:X,...o.errToObj(Q)})}endsWith(X,Q){return this._addCheck({kind:"endsWith",value:X,...o.errToObj(Q)})}min(X,Q){return this._addCheck({kind:"min",value:X,...o.errToObj(Q)})}max(X,Q){return this._addCheck({kind:"max",value:X,...o.errToObj(Q)})}length(X,Q){return this._addCheck({kind:"length",value:X,...o.errToObj(Q)})}nonempty(X){return this.min(1,o.errToObj(X))}trim(){return new j1({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new j1({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new j1({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((X)=>X.kind==="datetime")}get isDate(){return!!this._def.checks.find((X)=>X.kind==="date")}get isTime(){return!!this._def.checks.find((X)=>X.kind==="time")}get isDuration(){return!!this._def.checks.find((X)=>X.kind==="duration")}get isEmail(){return!!this._def.checks.find((X)=>X.kind==="email")}get isURL(){return!!this._def.checks.find((X)=>X.kind==="url")}get isEmoji(){return!!this._def.checks.find((X)=>X.kind==="emoji")}get isUUID(){return!!this._def.checks.find((X)=>X.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((X)=>X.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((X)=>X.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((X)=>X.kind==="cuid2")}get isULID(){return!!this._def.checks.find((X)=>X.kind==="ulid")}get isIP(){return!!this._def.checks.find((X)=>X.kind==="ip")}get isCIDR(){return!!this._def.checks.find((X)=>X.kind==="cidr")}get isBase64(){return!!this._def.checks.find((X)=>X.kind==="base64")}get isBase64url(){return!!this._def.checks.find((X)=>X.kind==="base64url")}get minLength(){let X=null;for(let Q of this._def.checks)if(Q.kind==="min"){if(X===null||Q.value>X)X=Q.value}return X}get maxLength(){let X=null;for(let Q of this._def.checks)if(Q.kind==="max"){if(X===null||Q.value<X)X=Q.value}return X}}j1.create=(X)=>{return new j1({checks:[],typeName:$0.ZodString,coerce:X?.coerce??!1,...H0(X)})};function uz(X,Q){let J=(X.toString().split(".")[1]||"").length,Y=(Q.toString().split(".")[1]||"").length,G=J>Y?J:Y,$=Number.parseInt(X.toFixed(G).replace(".","")),W=Number.parseInt(Q.toFixed(G).replace(".",""));return $%W/10**G}class L9 extends L0{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(X){if(this._def.coerce)X.data=Number(X.data);if(this._getType(X)!==n.number){let G=this._getOrReturnCtx(X);return d(G,{code:m.invalid_type,expected:n.number,received:G.parsedType}),G0}let J=void 0,Y=new d0;for(let G of this._def.checks)if(G.kind==="int"){if(!V0.isInteger(X.data))J=this._getOrReturnCtx(X,J),d(J,{code:m.invalid_type,expected:"integer",received:"float",message:G.message}),Y.dirty()}else if(G.kind==="min"){if(G.inclusive?X.data<G.value:X.data<=G.value)J=this._getOrReturnCtx(X,J),d(J,{code:m.too_small,minimum:G.value,type:"number",inclusive:G.inclusive,exact:!1,message:G.message}),Y.dirty()}else if(G.kind==="max"){if(G.inclusive?X.data>G.value:X.data>=G.value)J=this._getOrReturnCtx(X,J),d(J,{code:m.too_big,maximum:G.value,type:"number",inclusive:G.inclusive,exact:!1,message:G.message}),Y.dirty()}else if(G.kind==="multipleOf"){if(uz(X.data,G.value)!==0)J=this._getOrReturnCtx(X,J),d(J,{code:m.not_multiple_of,multipleOf:G.value,message:G.message}),Y.dirty()}else if(G.kind==="finite"){if(!Number.isFinite(X.data))J=this._getOrReturnCtx(X,J),d(J,{code:m.not_finite,message:G.message}),Y.dirty()}else V0.assertNever(G);return{status:Y.value,value:X.data}}gte(X,Q){return this.setLimit("min",X,!0,o.toString(Q))}gt(X,Q){return this.setLimit("min",X,!1,o.toString(Q))}lte(X,Q){return this.setLimit("max",X,!0,o.toString(Q))}lt(X,Q){return this.setLimit("max",X,!1,o.toString(Q))}setLimit(X,Q,J,Y){return new L9({...this._def,checks:[...this._def.checks,{kind:X,value:Q,inclusive:J,message:o.toString(Y)}]})}_addCheck(X){return new L9({...this._def,checks:[...this._def.checks,X]})}int(X){return this._addCheck({kind:"int",message:o.toString(X)})}positive(X){return this._addCheck({kind:"min",value:0,inclusive:!1,message:o.toString(X)})}negative(X){return this._addCheck({kind:"max",value:0,inclusive:!1,message:o.toString(X)})}nonpositive(X){return this._addCheck({kind:"max",value:0,inclusive:!0,message:o.toString(X)})}nonnegative(X){return this._addCheck({kind:"min",value:0,inclusive:!0,message:o.toString(X)})}multipleOf(X,Q){return this._addCheck({kind:"multipleOf",value:X,message:o.toString(Q)})}finite(X){return this._addCheck({kind:"finite",message:o.toString(X)})}safe(X){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:o.toString(X)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:o.toString(X)})}get minValue(){let X=null;for(let Q of this._def.checks)if(Q.kind==="min"){if(X===null||Q.value>X)X=Q.value}return X}get maxValue(){let X=null;for(let Q of this._def.checks)if(Q.kind==="max"){if(X===null||Q.value<X)X=Q.value}return X}get isInt(){return!!this._def.checks.find((X)=>X.kind==="int"||X.kind==="multipleOf"&&V0.isInteger(X.value))}get isFinite(){let X=null,Q=null;for(let J of this._def.checks)if(J.kind==="finite"||J.kind==="int"||J.kind==="multipleOf")return!0;else if(J.kind==="min"){if(Q===null||J.value>Q)Q=J.value}else if(J.kind==="max"){if(X===null||J.value<X)X=J.value}return Number.isFinite(Q)&&Number.isFinite(X)}}L9.create=(X)=>{return new L9({checks:[],typeName:$0.ZodNumber,coerce:X?.coerce||!1,...H0(X)})};class q9 extends L0{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(X){if(this._def.coerce)try{X.data=BigInt(X.data)}catch{return this._getInvalidInput(X)}if(this._getType(X)!==n.bigint)return this._getInvalidInput(X);let J=void 0,Y=new d0;for(let G of this._def.checks)if(G.kind==="min"){if(G.inclusive?X.data<G.value:X.data<=G.value)J=this._getOrReturnCtx(X,J),d(J,{code:m.too_small,type:"bigint",minimum:G.value,inclusive:G.inclusive,message:G.message}),Y.dirty()}else if(G.kind==="max"){if(G.inclusive?X.data>G.value:X.data>=G.value)J=this._getOrReturnCtx(X,J),d(J,{code:m.too_big,type:"bigint",maximum:G.value,inclusive:G.inclusive,message:G.message}),Y.dirty()}else if(G.kind==="multipleOf"){if(X.data%G.value!==BigInt(0))J=this._getOrReturnCtx(X,J),d(J,{code:m.not_multiple_of,multipleOf:G.value,message:G.message}),Y.dirty()}else V0.assertNever(G);return{status:Y.value,value:X.data}}_getInvalidInput(X){let Q=this._getOrReturnCtx(X);return d(Q,{code:m.invalid_type,expected:n.bigint,received:Q.parsedType}),G0}gte(X,Q){return this.setLimit("min",X,!0,o.toString(Q))}gt(X,Q){return this.setLimit("min",X,!1,o.toString(Q))}lte(X,Q){return this.setLimit("max",X,!0,o.toString(Q))}lt(X,Q){return this.setLimit("max",X,!1,o.toString(Q))}setLimit(X,Q,J,Y){return new q9({...this._def,checks:[...this._def.checks,{kind:X,value:Q,inclusive:J,message:o.toString(Y)}]})}_addCheck(X){return new q9({...this._def,checks:[...this._def.checks,X]})}positive(X){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:o.toString(X)})}negative(X){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:o.toString(X)})}nonpositive(X){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:o.toString(X)})}nonnegative(X){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:o.toString(X)})}multipleOf(X,Q){return this._addCheck({kind:"multipleOf",value:X,message:o.toString(Q)})}get minValue(){let X=null;for(let Q of this._def.checks)if(Q.kind==="min"){if(X===null||Q.value>X)X=Q.value}return X}get maxValue(){let X=null;for(let Q of this._def.checks)if(Q.kind==="max"){if(X===null||Q.value<X)X=Q.value}return X}}q9.create=(X)=>{return new q9({checks:[],typeName:$0.ZodBigInt,coerce:X?.coerce??!1,...H0(X)})};class r8 extends L0{_parse(X){if(this._def.coerce)X.data=Boolean(X.data);if(this._getType(X)!==n.boolean){let J=this._getOrReturnCtx(X);return d(J,{code:m.invalid_type,expected:n.boolean,received:J.parsedType}),G0}return n0(X.data)}}r8.create=(X)=>{return new r8({typeName:$0.ZodBoolean,coerce:X?.coerce||!1,...H0(X)})};class p9 extends L0{_parse(X){if(this._def.coerce)X.data=new Date(X.data);if(this._getType(X)!==n.date){let G=this._getOrReturnCtx(X);return d(G,{code:m.invalid_type,expected:n.date,received:G.parsedType}),G0}if(Number.isNaN(X.data.getTime())){let G=this._getOrReturnCtx(X);return d(G,{code:m.invalid_date}),G0}let J=new d0,Y=void 0;for(let G of this._def.checks)if(G.kind==="min"){if(X.data.getTime()<G.value)Y=this._getOrReturnCtx(X,Y),d(Y,{code:m.too_small,message:G.message,inclusive:!0,exact:!1,minimum:G.value,type:"date"}),J.dirty()}else if(G.kind==="max"){if(X.data.getTime()>G.value)Y=this._getOrReturnCtx(X,Y),d(Y,{code:m.too_big,message:G.message,inclusive:!0,exact:!1,maximum:G.value,type:"date"}),J.dirty()}else V0.assertNever(G);return{status:J.value,value:new Date(X.data.getTime())}}_addCheck(X){return new p9({...this._def,checks:[...this._def.checks,X]})}min(X,Q){return this._addCheck({kind:"min",value:X.getTime(),message:o.toString(Q)})}max(X,Q){return this._addCheck({kind:"max",value:X.getTime(),message:o.toString(Q)})}get minDate(){let X=null;for(let Q of this._def.checks)if(Q.kind==="min"){if(X===null||Q.value>X)X=Q.value}return X!=null?new Date(X):null}get maxDate(){let X=null;for(let Q of this._def.checks)if(Q.kind==="max"){if(X===null||Q.value<X)X=Q.value}return X!=null?new Date(X):null}}p9.create=(X)=>{return new p9({checks:[],coerce:X?.coerce||!1,typeName:$0.ZodDate,...H0(X)})};class o8 extends L0{_parse(X){if(this._getType(X)!==n.symbol){let J=this._getOrReturnCtx(X);return d(J,{code:m.invalid_type,expected:n.symbol,received:J.parsedType}),G0}return n0(X.data)}}o8.create=(X)=>{return new o8({typeName:$0.ZodSymbol,...H0(X)})};class d9 extends L0{_parse(X){if(this._getType(X)!==n.undefined){let J=this._getOrReturnCtx(X);return d(J,{code:m.invalid_type,expected:n.undefined,received:J.parsedType}),G0}return n0(X.data)}}d9.create=(X)=>{return new d9({typeName:$0.ZodUndefined,...H0(X)})};class i9 extends L0{_parse(X){if(this._getType(X)!==n.null){let J=this._getOrReturnCtx(X);return d(J,{code:m.invalid_type,expected:n.null,received:J.parsedType}),G0}return n0(X.data)}}i9.create=(X)=>{return new i9({typeName:$0.ZodNull,...H0(X)})};class a8 extends L0{constructor(){super(...arguments);this._any=!0}_parse(X){return n0(X.data)}}a8.create=(X)=>{return new a8({typeName:$0.ZodAny,...H0(X)})};class n1 extends L0{constructor(){super(...arguments);this._unknown=!0}_parse(X){return n0(X.data)}}n1.create=(X)=>{return new n1({typeName:$0.ZodUnknown,...H0(X)})};class w1 extends L0{_parse(X){let Q=this._getOrReturnCtx(X);return d(Q,{code:m.invalid_type,expected:n.never,received:Q.parsedType}),G0}}w1.create=(X)=>{return new w1({typeName:$0.ZodNever,...H0(X)})};class s8 extends L0{_parse(X){if(this._getType(X)!==n.undefined){let J=this._getOrReturnCtx(X);return d(J,{code:m.invalid_type,expected:n.void,received:J.parsedType}),G0}return n0(X.data)}}s8.create=(X)=>{return new s8({typeName:$0.ZodVoid,...H0(X)})};class F1 extends L0{_parse(X){let{ctx:Q,status:J}=this._processInputParams(X),Y=this._def;if(Q.parsedType!==n.array)return d(Q,{code:m.invalid_type,expected:n.array,received:Q.parsedType}),G0;if(Y.exactLength!==null){let $=Q.data.length>Y.exactLength.value,W=Q.data.length<Y.exactLength.value;if($||W)d(Q,{code:$?m.too_big:m.too_small,minimum:W?Y.exactLength.value:void 0,maximum:$?Y.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:Y.exactLength.message}),J.dirty()}if(Y.minLength!==null){if(Q.data.length<Y.minLength.value)d(Q,{code:m.too_small,minimum:Y.minLength.value,type:"array",inclusive:!0,exact:!1,message:Y.minLength.message}),J.dirty()}if(Y.maxLength!==null){if(Q.data.length>Y.maxLength.value)d(Q,{code:m.too_big,maximum:Y.maxLength.value,type:"array",inclusive:!0,exact:!1,message:Y.maxLength.message}),J.dirty()}if(Q.common.async)return Promise.all([...Q.data].map(($,W)=>{return Y.type._parseAsync(new W1(Q,$,Q.path,W))})).then(($)=>{return d0.mergeArray(J,$)});let G=[...Q.data].map(($,W)=>{return Y.type._parseSync(new W1(Q,$,Q.path,W))});return d0.mergeArray(J,G)}get element(){return this._def.type}min(X,Q){return new F1({...this._def,minLength:{value:X,message:o.toString(Q)}})}max(X,Q){return new F1({...this._def,maxLength:{value:X,message:o.toString(Q)}})}length(X,Q){return new F1({...this._def,exactLength:{value:X,message:o.toString(Q)}})}nonempty(X){return this.min(1,X)}}F1.create=(X,Q)=>{return new F1({type:X,minLength:null,maxLength:null,exactLength:null,typeName:$0.ZodArray,...H0(Q)})};function W9(X){if(X instanceof C0){let Q={};for(let J in X.shape){let Y=X.shape[J];Q[J]=K1.create(W9(Y))}return new C0({...X._def,shape:()=>Q})}else if(X instanceof F1)return new F1({...X._def,type:W9(X.element)});else if(X instanceof K1)return K1.create(W9(X.unwrap()));else if(X instanceof k1)return k1.create(W9(X.unwrap()));else if(X instanceof P1)return P1.create(X.items.map((Q)=>W9(Q)));else return X}class C0 extends L0{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let X=this._def.shape(),Q=V0.objectKeys(X);return this._cached={shape:X,keys:Q},this._cached}_parse(X){if(this._getType(X)!==n.object){let U=this._getOrReturnCtx(X);return d(U,{code:m.invalid_type,expected:n.object,received:U.parsedType}),G0}let{status:J,ctx:Y}=this._processInputParams(X),{shape:G,keys:$}=this._getCached(),W=[];if(!(this._def.catchall instanceof w1&&this._def.unknownKeys==="strip")){for(let U in Y.data)if(!$.includes(U))W.push(U)}let H=[];for(let U of $){let z=G[U],F=Y.data[U];H.push({key:{status:"valid",value:U},value:z._parse(new W1(Y,F,Y.path,U)),alwaysSet:U in Y.data})}if(this._def.catchall instanceof w1){let U=this._def.unknownKeys;if(U==="passthrough")for(let z of W)H.push({key:{status:"valid",value:z},value:{status:"valid",value:Y.data[z]}});else if(U==="strict"){if(W.length>0)d(Y,{code:m.unrecognized_keys,keys:W}),J.dirty()}else if(U==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let U=this._def.catchall;for(let z of W){let F=Y.data[z];H.push({key:{status:"valid",value:z},value:U._parse(new W1(Y,F,Y.path,z)),alwaysSet:z in Y.data})}}if(Y.common.async)return Promise.resolve().then(async()=>{let U=[];for(let z of H){let F=await z.key,K=await z.value;U.push({key:F,value:K,alwaysSet:z.alwaysSet})}return U}).then((U)=>{return d0.mergeObjectSync(J,U)});else return d0.mergeObjectSync(J,H)}get shape(){return this._def.shape()}strict(X){return o.errToObj,new C0({...this._def,unknownKeys:"strict",...X!==void 0?{errorMap:(Q,J)=>{let Y=this._def.errorMap?.(Q,J).message??J.defaultError;if(Q.code==="unrecognized_keys")return{message:o.errToObj(X).message??Y};return{message:Y}}}:{}})}strip(){return new C0({...this._def,unknownKeys:"strip"})}passthrough(){return new C0({...this._def,unknownKeys:"passthrough"})}extend(X){return new C0({...this._def,shape:()=>({...this._def.shape(),...X})})}merge(X){return new C0({unknownKeys:X._def.unknownKeys,catchall:X._def.catchall,shape:()=>({...this._def.shape(),...X._def.shape()}),typeName:$0.ZodObject})}setKey(X,Q){return this.augment({[X]:Q})}catchall(X){return new C0({...this._def,catchall:X})}pick(X){let Q={};for(let J of V0.objectKeys(X))if(X[J]&&this.shape[J])Q[J]=this.shape[J];return new C0({...this._def,shape:()=>Q})}omit(X){let Q={};for(let J of V0.objectKeys(this.shape))if(!X[J])Q[J]=this.shape[J];return new C0({...this._def,shape:()=>Q})}deepPartial(){return W9(this)}partial(X){let Q={};for(let J of V0.objectKeys(this.shape)){let Y=this.shape[J];if(X&&!X[J])Q[J]=Y;else Q[J]=Y.optional()}return new C0({...this._def,shape:()=>Q})}required(X){let Q={};for(let J of V0.objectKeys(this.shape))if(X&&!X[J])Q[J]=this.shape[J];else{let G=this.shape[J];while(G instanceof K1)G=G._def.innerType;Q[J]=G}return new C0({...this._def,shape:()=>Q})}keyof(){return GJ(V0.objectKeys(this.shape))}}C0.create=(X,Q)=>{return new C0({shape:()=>X,unknownKeys:"strip",catchall:w1.create(),typeName:$0.ZodObject,...H0(Q)})};C0.strictCreate=(X,Q)=>{return new C0({shape:()=>X,unknownKeys:"strict",catchall:w1.create(),typeName:$0.ZodObject,...H0(Q)})};C0.lazycreate=(X,Q)=>{return new C0({shape:X,unknownKeys:"strip",catchall:w1.create(),typeName:$0.ZodObject,...H0(Q)})};class n9 extends L0{_parse(X){let{ctx:Q}=this._processInputParams(X),J=this._def.options;function Y(G){for(let W of G)if(W.result.status==="valid")return W.result;for(let W of G)if(W.result.status==="dirty")return Q.common.issues.push(...W.ctx.common.issues),W.result;let $=G.map((W)=>new X1(W.ctx.common.issues));return d(Q,{code:m.invalid_union,unionErrors:$}),G0}if(Q.common.async)return Promise.all(J.map(async(G)=>{let $={...Q,common:{...Q.common,issues:[]},parent:null};return{result:await G._parseAsync({data:Q.data,path:Q.path,parent:$}),ctx:$}})).then(Y);else{let G=void 0,$=[];for(let H of J){let U={...Q,common:{...Q.common,issues:[]},parent:null},z=H._parseSync({data:Q.data,path:Q.path,parent:U});if(z.status==="valid")return z;else if(z.status==="dirty"&&!G)G={result:z,ctx:U};if(U.common.issues.length)$.push(U.common.issues)}if(G)return Q.common.issues.push(...G.ctx.common.issues),G.result;let W=$.map((H)=>new X1(H));return d(Q,{code:m.invalid_union,unionErrors:W}),G0}}get options(){return this._def.options}}n9.create=(X,Q)=>{return new n9({options:X,typeName:$0.ZodUnion,...H0(Q)})};var N1=(X)=>{if(X instanceof o9)return N1(X.schema);else if(X instanceof M1)return N1(X.innerType());else if(X instanceof a9)return[X.value];else if(X instanceof r1)return X.options;else if(X instanceof s9)return V0.objectValues(X.enum);else if(X instanceof t9)return N1(X._def.innerType);else if(X instanceof d9)return[void 0];else if(X instanceof i9)return[null];else if(X instanceof K1)return[void 0,...N1(X.unwrap())];else if(X instanceof k1)return[null,...N1(X.unwrap())];else if(X instanceof mX)return N1(X.unwrap());else if(X instanceof X8)return N1(X.unwrap());else if(X instanceof e9)return N1(X._def.innerType);else return[]};class uX extends L0{_parse(X){let{ctx:Q}=this._processInputParams(X);if(Q.parsedType!==n.object)return d(Q,{code:m.invalid_type,expected:n.object,received:Q.parsedType}),G0;let J=this.discriminator,Y=Q.data[J],G=this.optionsMap.get(Y);if(!G)return d(Q,{code:m.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[J]}),G0;if(Q.common.async)return G._parseAsync({data:Q.data,path:Q.path,parent:Q});else return G._parseSync({data:Q.data,path:Q.path,parent:Q})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(X,Q,J){let Y=new Map;for(let G of Q){let $=N1(G.shape[X]);if(!$.length)throw Error(`A discriminator value for key \`${X}\` could not be extracted from all schema options`);for(let W of $){if(Y.has(W))throw Error(`Discriminator property ${String(X)} has duplicate value ${String(W)}`);Y.set(W,G)}}return new uX({typeName:$0.ZodDiscriminatedUnion,discriminator:X,options:Q,optionsMap:Y,...H0(J)})}}function EX(X,Q){let J=C1(X),Y=C1(Q);if(X===Q)return{valid:!0,data:X};else if(J===n.object&&Y===n.object){let G=V0.objectKeys(Q),$=V0.objectKeys(X).filter((H)=>G.indexOf(H)!==-1),W={...X,...Q};for(let H of $){let U=EX(X[H],Q[H]);if(!U.valid)return{valid:!1};W[H]=U.data}return{valid:!0,data:W}}else if(J===n.array&&Y===n.array){if(X.length!==Q.length)return{valid:!1};let G=[];for(let $=0;$<X.length;$++){let W=X[$],H=Q[$],U=EX(W,H);if(!U.valid)return{valid:!1};G.push(U.data)}return{valid:!0,data:G}}else if(J===n.date&&Y===n.date&&+X===+Q)return{valid:!0,data:X};else return{valid:!1}}class r9 extends L0{_parse(X){let{status:Q,ctx:J}=this._processInputParams(X),Y=(G,$)=>{if(W4(G)||W4($))return G0;let W=EX(G.value,$.value);if(!W.valid)return d(J,{code:m.invalid_intersection_types}),G0;if(H4(G)||H4($))Q.dirty();return{status:Q.value,value:W.data}};if(J.common.async)return Promise.all([this._def.left._parseAsync({data:J.data,path:J.path,parent:J}),this._def.right._parseAsync({data:J.data,path:J.path,parent:J})]).then(([G,$])=>Y(G,$));else return Y(this._def.left._parseSync({data:J.data,path:J.path,parent:J}),this._def.right._parseSync({data:J.data,path:J.path,parent:J}))}}r9.create=(X,Q,J)=>{return new r9({left:X,right:Q,typeName:$0.ZodIntersection,...H0(J)})};class P1 extends L0{_parse(X){let{status:Q,ctx:J}=this._processInputParams(X);if(J.parsedType!==n.array)return d(J,{code:m.invalid_type,expected:n.array,received:J.parsedType}),G0;if(J.data.length<this._def.items.length)return d(J,{code:m.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),G0;if(!this._def.rest&&J.data.length>this._def.items.length)d(J,{code:m.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Q.dirty();let G=[...J.data].map(($,W)=>{let H=this._def.items[W]||this._def.rest;if(!H)return null;return H._parse(new W1(J,$,J.path,W))}).filter(($)=>!!$);if(J.common.async)return Promise.all(G).then(($)=>{return d0.mergeArray(Q,$)});else return d0.mergeArray(Q,G)}get items(){return this._def.items}rest(X){return new P1({...this._def,rest:X})}}P1.create=(X,Q)=>{if(!Array.isArray(X))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new P1({items:X,typeName:$0.ZodTuple,rest:null,...H0(Q)})};class t8 extends L0{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(X){let{status:Q,ctx:J}=this._processInputParams(X);if(J.parsedType!==n.object)return d(J,{code:m.invalid_type,expected:n.object,received:J.parsedType}),G0;let Y=[],G=this._def.keyType,$=this._def.valueType;for(let W in J.data)Y.push({key:G._parse(new W1(J,W,J.path,W)),value:$._parse(new W1(J,J.data[W],J.path,W)),alwaysSet:W in J.data});if(J.common.async)return d0.mergeObjectAsync(Q,Y);else return d0.mergeObjectSync(Q,Y)}get element(){return this._def.valueType}static create(X,Q,J){if(Q instanceof L0)return new t8({keyType:X,valueType:Q,typeName:$0.ZodRecord,...H0(J)});return new t8({keyType:j1.create(),valueType:X,typeName:$0.ZodRecord,...H0(Q)})}}class e8 extends L0{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(X){let{status:Q,ctx:J}=this._processInputParams(X);if(J.parsedType!==n.map)return d(J,{code:m.invalid_type,expected:n.map,received:J.parsedType}),G0;let Y=this._def.keyType,G=this._def.valueType,$=[...J.data.entries()].map(([W,H],U)=>{return{key:Y._parse(new W1(J,W,J.path,[U,"key"])),value:G._parse(new W1(J,H,J.path,[U,"value"]))}});if(J.common.async){let W=new Map;return Promise.resolve().then(async()=>{for(let H of $){let U=await H.key,z=await H.value;if(U.status==="aborted"||z.status==="aborted")return G0;if(U.status==="dirty"||z.status==="dirty")Q.dirty();W.set(U.value,z.value)}return{status:Q.value,value:W}})}else{let W=new Map;for(let H of $){let{key:U,value:z}=H;if(U.status==="aborted"||z.status==="aborted")return G0;if(U.status==="dirty"||z.status==="dirty")Q.dirty();W.set(U.value,z.value)}return{status:Q.value,value:W}}}}e8.create=(X,Q,J)=>{return new e8({valueType:Q,keyType:X,typeName:$0.ZodMap,...H0(J)})};class F9 extends L0{_parse(X){let{status:Q,ctx:J}=this._processInputParams(X);if(J.parsedType!==n.set)return d(J,{code:m.invalid_type,expected:n.set,received:J.parsedType}),G0;let Y=this._def;if(Y.minSize!==null){if(J.data.size<Y.minSize.value)d(J,{code:m.too_small,minimum:Y.minSize.value,type:"set",inclusive:!0,exact:!1,message:Y.minSize.message}),Q.dirty()}if(Y.maxSize!==null){if(J.data.size>Y.maxSize.value)d(J,{code:m.too_big,maximum:Y.maxSize.value,type:"set",inclusive:!0,exact:!1,message:Y.maxSize.message}),Q.dirty()}let G=this._def.valueType;function $(H){let U=new Set;for(let z of H){if(z.status==="aborted")return G0;if(z.status==="dirty")Q.dirty();U.add(z.value)}return{status:Q.value,value:U}}let W=[...J.data.values()].map((H,U)=>G._parse(new W1(J,H,J.path,U)));if(J.common.async)return Promise.all(W).then((H)=>$(H));else return $(W)}min(X,Q){return new F9({...this._def,minSize:{value:X,message:o.toString(Q)}})}max(X,Q){return new F9({...this._def,maxSize:{value:X,message:o.toString(Q)}})}size(X,Q){return this.min(X,Q).max(X,Q)}nonempty(X){return this.min(1,X)}}F9.create=(X,Q)=>{return new F9({valueType:X,minSize:null,maxSize:null,typeName:$0.ZodSet,...H0(Q)})};class m9 extends L0{constructor(){super(...arguments);this.validate=this.implement}_parse(X){let{ctx:Q}=this._processInputParams(X);if(Q.parsedType!==n.function)return d(Q,{code:m.invalid_type,expected:n.function,received:Q.parsedType}),G0;function J(W,H){return SX({data:W,path:Q.path,errorMaps:[Q.common.contextualErrorMap,Q.schemaErrorMap,TX(),c9].filter((U)=>!!U),issueData:{code:m.invalid_arguments,argumentsError:H}})}function Y(W,H){return SX({data:W,path:Q.path,errorMaps:[Q.common.contextualErrorMap,Q.schemaErrorMap,TX(),c9].filter((U)=>!!U),issueData:{code:m.invalid_return_type,returnTypeError:H}})}let G={errorMap:Q.common.contextualErrorMap},$=Q.data;if(this._def.returns instanceof K9){let W=this;return n0(async function(...H){let U=new X1([]),z=await W._def.args.parseAsync(H,G).catch((M)=>{throw U.addIssue(J(H,M)),U}),F=await Reflect.apply($,this,z);return await W._def.returns._def.type.parseAsync(F,G).catch((M)=>{throw U.addIssue(Y(F,M)),U})})}else{let W=this;return n0(function(...H){let U=W._def.args.safeParse(H,G);if(!U.success)throw new X1([J(H,U.error)]);let z=Reflect.apply($,this,U.data),F=W._def.returns.safeParse(z,G);if(!F.success)throw new X1([Y(z,F.error)]);return F.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...X){return new m9({...this._def,args:P1.create(X).rest(n1.create())})}returns(X){return new m9({...this._def,returns:X})}implement(X){return this.parse(X)}strictImplement(X){return this.parse(X)}static create(X,Q,J){return new m9({args:X?X:P1.create([]).rest(n1.create()),returns:Q||n1.create(),typeName:$0.ZodFunction,...H0(J)})}}class o9 extends L0{get schema(){return this._def.getter()}_parse(X){let{ctx:Q}=this._processInputParams(X);return this._def.getter()._parse({data:Q.data,path:Q.path,parent:Q})}}o9.create=(X,Q)=>{return new o9({getter:X,typeName:$0.ZodLazy,...H0(Q)})};class a9 extends L0{_parse(X){if(X.data!==this._def.value){let Q=this._getOrReturnCtx(X);return d(Q,{received:Q.data,code:m.invalid_literal,expected:this._def.value}),G0}return{status:"valid",value:X.data}}get value(){return this._def.value}}a9.create=(X,Q)=>{return new a9({value:X,typeName:$0.ZodLiteral,...H0(Q)})};function GJ(X,Q){return new r1({values:X,typeName:$0.ZodEnum,...H0(Q)})}class r1 extends L0{_parse(X){if(typeof X.data!=="string"){let Q=this._getOrReturnCtx(X),J=this._def.values;return d(Q,{expected:V0.joinValues(J),received:Q.parsedType,code:m.invalid_type}),G0}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(X.data)){let Q=this._getOrReturnCtx(X),J=this._def.values;return d(Q,{received:Q.data,code:m.invalid_enum_value,options:J}),G0}return n0(X.data)}get options(){return this._def.values}get enum(){let X={};for(let Q of this._def.values)X[Q]=Q;return X}get Values(){let X={};for(let Q of this._def.values)X[Q]=Q;return X}get Enum(){let X={};for(let Q of this._def.values)X[Q]=Q;return X}extract(X,Q=this._def){return r1.create(X,{...this._def,...Q})}exclude(X,Q=this._def){return r1.create(this.options.filter((J)=>!X.includes(J)),{...this._def,...Q})}}r1.create=GJ;class s9 extends L0{_parse(X){let Q=V0.getValidEnumValues(this._def.values),J=this._getOrReturnCtx(X);if(J.parsedType!==n.string&&J.parsedType!==n.number){let Y=V0.objectValues(Q);return d(J,{expected:V0.joinValues(Y),received:J.parsedType,code:m.invalid_type}),G0}if(!this._cache)this._cache=new Set(V0.getValidEnumValues(this._def.values));if(!this._cache.has(X.data)){let Y=V0.objectValues(Q);return d(J,{received:J.data,code:m.invalid_enum_value,options:Y}),G0}return n0(X.data)}get enum(){return this._def.values}}s9.create=(X,Q)=>{return new s9({values:X,typeName:$0.ZodNativeEnum,...H0(Q)})};class K9 extends L0{unwrap(){return this._def.type}_parse(X){let{ctx:Q}=this._processInputParams(X);if(Q.parsedType!==n.promise&&Q.common.async===!1)return d(Q,{code:m.invalid_type,expected:n.promise,received:Q.parsedType}),G0;let J=Q.parsedType===n.promise?Q.data:Promise.resolve(Q.data);return n0(J.then((Y)=>{return this._def.type.parseAsync(Y,{path:Q.path,errorMap:Q.common.contextualErrorMap})}))}}K9.create=(X,Q)=>{return new K9({type:X,typeName:$0.ZodPromise,...H0(Q)})};class M1 extends L0{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===$0.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(X){let{status:Q,ctx:J}=this._processInputParams(X),Y=this._def.effect||null,G={addIssue:($)=>{if(d(J,$),$.fatal)Q.abort();else Q.dirty()},get path(){return J.path}};if(G.addIssue=G.addIssue.bind(G),Y.type==="preprocess"){let $=Y.transform(J.data,G);if(J.common.async)return Promise.resolve($).then(async(W)=>{if(Q.value==="aborted")return G0;let H=await this._def.schema._parseAsync({data:W,path:J.path,parent:J});if(H.status==="aborted")return G0;if(H.status==="dirty")return f9(H.value);if(Q.value==="dirty")return f9(H.value);return H});else{if(Q.value==="aborted")return G0;let W=this._def.schema._parseSync({data:$,path:J.path,parent:J});if(W.status==="aborted")return G0;if(W.status==="dirty")return f9(W.value);if(Q.value==="dirty")return f9(W.value);return W}}if(Y.type==="refinement"){let $=(W)=>{let H=Y.refinement(W,G);if(J.common.async)return Promise.resolve(H);if(H instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return W};if(J.common.async===!1){let W=this._def.schema._parseSync({data:J.data,path:J.path,parent:J});if(W.status==="aborted")return G0;if(W.status==="dirty")Q.dirty();return $(W.value),{status:Q.value,value:W.value}}else return this._def.schema._parseAsync({data:J.data,path:J.path,parent:J}).then((W)=>{if(W.status==="aborted")return G0;if(W.status==="dirty")Q.dirty();return $(W.value).then(()=>{return{status:Q.value,value:W.value}})})}if(Y.type==="transform")if(J.common.async===!1){let $=this._def.schema._parseSync({data:J.data,path:J.path,parent:J});if(!B9($))return G0;let W=Y.transform($.value,G);if(W instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:Q.value,value:W}}else return this._def.schema._parseAsync({data:J.data,path:J.path,parent:J}).then(($)=>{if(!B9($))return G0;return Promise.resolve(Y.transform($.value,G)).then((W)=>({status:Q.value,value:W}))});V0.assertNever(Y)}}M1.create=(X,Q,J)=>{return new M1({schema:X,typeName:$0.ZodEffects,effect:Q,...H0(J)})};M1.createWithPreprocess=(X,Q,J)=>{return new M1({schema:Q,effect:{type:"preprocess",transform:X},typeName:$0.ZodEffects,...H0(J)})};class K1 extends L0{_parse(X){if(this._getType(X)===n.undefined)return n0(void 0);return this._def.innerType._parse(X)}unwrap(){return this._def.innerType}}K1.create=(X,Q)=>{return new K1({innerType:X,typeName:$0.ZodOptional,...H0(Q)})};class k1 extends L0{_parse(X){if(this._getType(X)===n.null)return n0(null);return this._def.innerType._parse(X)}unwrap(){return this._def.innerType}}k1.create=(X,Q)=>{return new k1({innerType:X,typeName:$0.ZodNullable,...H0(Q)})};class t9 extends L0{_parse(X){let{ctx:Q}=this._processInputParams(X),J=Q.data;if(Q.parsedType===n.undefined)J=this._def.defaultValue();return this._def.innerType._parse({data:J,path:Q.path,parent:Q})}removeDefault(){return this._def.innerType}}t9.create=(X,Q)=>{return new t9({innerType:X,typeName:$0.ZodDefault,defaultValue:typeof Q.default==="function"?Q.default:()=>Q.default,...H0(Q)})};class e9 extends L0{_parse(X){let{ctx:Q}=this._processInputParams(X),J={...Q,common:{...Q.common,issues:[]}},Y=this._def.innerType._parse({data:J.data,path:J.path,parent:{...J}});if(n8(Y))return Y.then((G)=>{return{status:"valid",value:G.status==="valid"?G.value:this._def.catchValue({get error(){return new X1(J.common.issues)},input:J.data})}});else return{status:"valid",value:Y.status==="valid"?Y.value:this._def.catchValue({get error(){return new X1(J.common.issues)},input:J.data})}}removeCatch(){return this._def.innerType}}e9.create=(X,Q)=>{return new e9({innerType:X,typeName:$0.ZodCatch,catchValue:typeof Q.catch==="function"?Q.catch:()=>Q.catch,...H0(Q)})};class X6 extends L0{_parse(X){if(this._getType(X)!==n.nan){let J=this._getOrReturnCtx(X);return d(J,{code:m.invalid_type,expected:n.nan,received:J.parsedType}),G0}return{status:"valid",value:X.data}}}X6.create=(X)=>{return new X6({typeName:$0.ZodNaN,...H0(X)})};var kw=Symbol("zod_brand");class mX extends L0{_parse(X){let{ctx:Q}=this._processInputParams(X),J=Q.data;return this._def.type._parse({data:J,path:Q.path,parent:Q})}unwrap(){return this._def.type}}class z6 extends L0{_parse(X){let{status:Q,ctx:J}=this._processInputParams(X);if(J.common.async)return(async()=>{let G=await this._def.in._parseAsync({data:J.data,path:J.path,parent:J});if(G.status==="aborted")return G0;if(G.status==="dirty")return Q.dirty(),f9(G.value);else return this._def.out._parseAsync({data:G.value,path:J.path,parent:J})})();else{let Y=this._def.in._parseSync({data:J.data,path:J.path,parent:J});if(Y.status==="aborted")return G0;if(Y.status==="dirty")return Q.dirty(),{status:"dirty",value:Y.value};else return this._def.out._parseSync({data:Y.value,path:J.path,parent:J})}}static create(X,Q){return new z6({in:X,out:Q,typeName:$0.ZodPipeline})}}class X8 extends L0{_parse(X){let Q=this._def.innerType._parse(X),J=(Y)=>{if(B9(Y))Y.value=Object.freeze(Y.value);return Y};return n8(Q)?Q.then((Y)=>J(Y)):J(Q)}unwrap(){return this._def.innerType}}X8.create=(X,Q)=>{return new X8({innerType:X,typeName:$0.ZodReadonly,...H0(Q)})};var vw={object:C0.lazycreate},$0;(function(X){X.ZodString="ZodString",X.ZodNumber="ZodNumber",X.ZodNaN="ZodNaN",X.ZodBigInt="ZodBigInt",X.ZodBoolean="ZodBoolean",X.ZodDate="ZodDate",X.ZodSymbol="ZodSymbol",X.ZodUndefined="ZodUndefined",X.ZodNull="ZodNull",X.ZodAny="ZodAny",X.ZodUnknown="ZodUnknown",X.ZodNever="ZodNever",X.ZodVoid="ZodVoid",X.ZodArray="ZodArray",X.ZodObject="ZodObject",X.ZodUnion="ZodUnion",X.ZodDiscriminatedUnion="ZodDiscriminatedUnion",X.ZodIntersection="ZodIntersection",X.ZodTuple="ZodTuple",X.ZodRecord="ZodRecord",X.ZodMap="ZodMap",X.ZodSet="ZodSet",X.ZodFunction="ZodFunction",X.ZodLazy="ZodLazy",X.ZodLiteral="ZodLiteral",X.ZodEnum="ZodEnum",X.ZodEffects="ZodEffects",X.ZodNativeEnum="ZodNativeEnum",X.ZodOptional="ZodOptional",X.ZodNullable="ZodNullable",X.ZodDefault="ZodDefault",X.ZodCatch="ZodCatch",X.ZodPromise="ZodPromise",X.ZodBranded="ZodBranded",X.ZodPipeline="ZodPipeline",X.ZodReadonly="ZodReadonly"})($0||($0={}));var yw=j1.create,xw=L9.create,gw=X6.create,hw=q9.create,fw=r8.create,uw=p9.create,mw=o8.create,lw=d9.create,cw=i9.create,pw=a8.create,dw=n1.create,iw=w1.create,nw=s8.create,rw=F1.create,ow=C0.create,aw=C0.strictCreate,sw=n9.create,tw=uX.create,ew=r9.create,XP=P1.create,QP=t8.create,JP=e8.create,YP=F9.create,GP=m9.create,$P=o9.create,WP=a9.create,HP=r1.create,UP=s9.create,zP=K9.create,BP=M1.create,LP=K1.create,qP=k1.create,FP=M1.createWithPreprocess,KP=z6.create,VP=Object.freeze({status:"aborted"});function y(X,Q,J){function Y(H,U){var z;Object.defineProperty(H,"_zod",{value:H._zod??{},enumerable:!1}),(z=H._zod).traits??(z.traits=new Set),H._zod.traits.add(X),Q(H,U);for(let F in W.prototype)if(!(F in H))Object.defineProperty(H,F,{value:W.prototype[F].bind(H)});H._zod.constr=W,H._zod.def=U}let G=J?.Parent??Object;class $ extends G{}Object.defineProperty($,"name",{value:X});function W(H){var U;let z=J?.Parent?new $:this;Y(z,H),(U=z._zod).deferred??(U.deferred=[]);for(let F of z._zod.deferred)F();return z}return Object.defineProperty(W,"init",{value:Y}),Object.defineProperty(W,Symbol.hasInstance,{value:(H)=>{if(J?.Parent&&H instanceof J.Parent)return!0;return H?._zod?.traits?.has(X)}}),Object.defineProperty(W,"name",{value:X}),W}var MP=Symbol("zod_brand");class V9 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}var bX={};function T1(X){if(X)Object.assign(bX,X);return bX}var A0={};E4(A0,{unwrapMessage:()=>u9,stringifyPrimitive:()=>pX,required:()=>$B,randomString:()=>rz,propertyKeyTypes:()=>zJ,promiseAllObject:()=>nz,primitiveTypes:()=>sz,prefixIssues:()=>_1,pick:()=>XB,partial:()=>GB,optionalKeys:()=>BJ,omit:()=>QB,numKeys:()=>oz,nullish:()=>L6,normalizeParams:()=>J0,merge:()=>YB,jsonStringifyReplacer:()=>WJ,joinValues:()=>CX,issue:()=>qJ,isPlainObject:()=>J8,isObject:()=>Q8,getSizableOrigin:()=>WB,getParsedType:()=>az,getLengthableOrigin:()=>F6,getEnumValues:()=>$J,getElementAtPath:()=>iz,floatSafeRemainder:()=>HJ,finalizeIssue:()=>S1,extend:()=>JB,escapeRegex:()=>A9,esc:()=>H9,defineLazy:()=>N0,createTransparentProxy:()=>tz,clone:()=>y1,cleanRegex:()=>q6,cleanEnum:()=>HB,captureStackTrace:()=>cX,cached:()=>B6,assignProp:()=>lX,assertNotEqual:()=>lz,assertNever:()=>pz,assertIs:()=>cz,assertEqual:()=>mz,assert:()=>dz,allowsEval:()=>UJ,aborted:()=>z9,NUMBER_FORMAT_RANGES:()=>LJ,Class:()=>FJ,BIGINT_FORMAT_RANGES:()=>ez});function mz(X){return X}function lz(X){return X}function cz(X){}function pz(X){throw Error()}function dz(X){}function $J(X){let Q=Object.values(X).filter((Y)=>typeof Y==="number");return Object.entries(X).filter(([Y,G])=>Q.indexOf(+Y)===-1).map(([Y,G])=>G)}function CX(X,Q="|"){return X.map((J)=>pX(J)).join(Q)}function WJ(X,Q){if(typeof Q==="bigint")return Q.toString();return Q}function B6(X){return{get value(){{let J=X();return Object.defineProperty(this,"value",{value:J}),J}throw Error("cached value already set")}}}function L6(X){return X===null||X===void 0}function q6(X){let Q=X.startsWith("^")?1:0,J=X.endsWith("$")?X.length-1:X.length;return X.slice(Q,J)}function HJ(X,Q){let J=(X.toString().split(".")[1]||"").length,Y=(Q.toString().split(".")[1]||"").length,G=J>Y?J:Y,$=Number.parseInt(X.toFixed(G).replace(".","")),W=Number.parseInt(Q.toFixed(G).replace(".",""));return $%W/10**G}function N0(X,Q,J){Object.defineProperty(X,Q,{get(){{let G=J();return X[Q]=G,G}throw Error("cached value already set")},set(G){Object.defineProperty(X,Q,{value:G})},configurable:!0})}function lX(X,Q,J){Object.defineProperty(X,Q,{value:J,writable:!0,enumerable:!0,configurable:!0})}function iz(X,Q){if(!Q)return X;return Q.reduce((J,Y)=>J?.[Y],X)}function nz(X){let Q=Object.keys(X),J=Q.map((Y)=>X[Y]);return Promise.all(J).then((Y)=>{let G={};for(let $=0;$<Q.length;$++)G[Q[$]]=Y[$];return G})}function rz(X=10){let J="";for(let Y=0;Y<X;Y++)J+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return J}function H9(X){return JSON.stringify(X)}var cX=Error.captureStackTrace?Error.captureStackTrace:(...X)=>{};function Q8(X){return typeof X==="object"&&X!==null&&!Array.isArray(X)}var UJ=B6(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(X){return!1}});function J8(X){if(Q8(X)===!1)return!1;let Q=X.constructor;if(Q===void 0)return!0;let J=Q.prototype;if(Q8(J)===!1)return!1;if(Object.prototype.hasOwnProperty.call(J,"isPrototypeOf")===!1)return!1;return!0}function oz(X){let Q=0;for(let J in X)if(Object.prototype.hasOwnProperty.call(X,J))Q++;return Q}var az=(X)=>{let Q=typeof X;switch(Q){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(X)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(X))return"array";if(X===null)return"null";if(X.then&&typeof X.then==="function"&&X.catch&&typeof X.catch==="function")return"promise";if(typeof Map<"u"&&X instanceof Map)return"map";if(typeof Set<"u"&&X instanceof Set)return"set";if(typeof Date<"u"&&X instanceof Date)return"date";if(typeof File<"u"&&X instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${Q}`)}},zJ=new Set(["string","number","symbol"]),sz=new Set(["string","number","bigint","boolean","symbol","undefined"]);function A9(X){return X.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function y1(X,Q,J){let Y=new X._zod.constr(Q??X._zod.def);if(!Q||J?.parent)Y._zod.parent=X;return Y}function J0(X){let Q=X;if(!Q)return{};if(typeof Q==="string")return{error:()=>Q};if(Q?.message!==void 0){if(Q?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");Q.error=Q.message}if(delete Q.message,typeof Q.error==="string")return{...Q,error:()=>Q.error};return Q}function tz(X){let Q;return new Proxy({},{get(J,Y,G){return Q??(Q=X()),Reflect.get(Q,Y,G)},set(J,Y,G,$){return Q??(Q=X()),Reflect.set(Q,Y,G,$)},has(J,Y){return Q??(Q=X()),Reflect.has(Q,Y)},deleteProperty(J,Y){return Q??(Q=X()),Reflect.deleteProperty(Q,Y)},ownKeys(J){return Q??(Q=X()),Reflect.ownKeys(Q)},getOwnPropertyDescriptor(J,Y){return Q??(Q=X()),Reflect.getOwnPropertyDescriptor(Q,Y)},defineProperty(J,Y,G){return Q??(Q=X()),Reflect.defineProperty(Q,Y,G)}})}function pX(X){if(typeof X==="bigint")return X.toString()+"n";if(typeof X==="string")return`"${X}"`;return`${X}`}function BJ(X){return Object.keys(X).filter((Q)=>{return X[Q]._zod.optin==="optional"&&X[Q]._zod.optout==="optional"})}var LJ={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},ez={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function XB(X,Q){let J={},Y=X._zod.def;for(let G in Q){if(!(G in Y.shape))throw Error(`Unrecognized key: "${G}"`);if(!Q[G])continue;J[G]=Y.shape[G]}return y1(X,{...X._zod.def,shape:J,checks:[]})}function QB(X,Q){let J={...X._zod.def.shape},Y=X._zod.def;for(let G in Q){if(!(G in Y.shape))throw Error(`Unrecognized key: "${G}"`);if(!Q[G])continue;delete J[G]}return y1(X,{...X._zod.def,shape:J,checks:[]})}function JB(X,Q){if(!J8(Q))throw Error("Invalid input to extend: expected a plain object");let J={...X._zod.def,get shape(){let Y={...X._zod.def.shape,...Q};return lX(this,"shape",Y),Y},checks:[]};return y1(X,J)}function YB(X,Q){return y1(X,{...X._zod.def,get shape(){let J={...X._zod.def.shape,...Q._zod.def.shape};return lX(this,"shape",J),J},catchall:Q._zod.def.catchall,checks:[]})}function GB(X,Q,J){let Y=Q._zod.def.shape,G={...Y};if(J)for(let $ in J){if(!($ in Y))throw Error(`Unrecognized key: "${$}"`);if(!J[$])continue;G[$]=X?new X({type:"optional",innerType:Y[$]}):Y[$]}else for(let $ in Y)G[$]=X?new X({type:"optional",innerType:Y[$]}):Y[$];return y1(Q,{...Q._zod.def,shape:G,checks:[]})}function $B(X,Q,J){let Y=Q._zod.def.shape,G={...Y};if(J)for(let $ in J){if(!($ in G))throw Error(`Unrecognized key: "${$}"`);if(!J[$])continue;G[$]=new X({type:"nonoptional",innerType:Y[$]})}else for(let $ in Y)G[$]=new X({type:"nonoptional",innerType:Y[$]});return y1(Q,{...Q._zod.def,shape:G,checks:[]})}function z9(X,Q=0){for(let J=Q;J<X.issues.length;J++)if(X.issues[J]?.continue!==!0)return!0;return!1}function _1(X,Q){return Q.map((J)=>{var Y;return(Y=J).path??(Y.path=[]),J.path.unshift(X),J})}function u9(X){return typeof X==="string"?X:X?.message}function S1(X,Q,J){let Y={...X,path:X.path??[]};if(!X.message){let G=u9(X.inst?._zod.def?.error?.(X))??u9(Q?.error?.(X))??u9(J.customError?.(X))??u9(J.localeError?.(X))??"Invalid input";Y.message=G}if(delete Y.inst,delete Y.continue,!Q?.reportInput)delete Y.input;return Y}function WB(X){if(X instanceof Set)return"set";if(X instanceof Map)return"map";if(X instanceof File)return"file";return"unknown"}function F6(X){if(Array.isArray(X))return"array";if(typeof X==="string")return"string";return"unknown"}function qJ(...X){let[Q,J,Y]=X;if(typeof Q==="string")return{message:Q,code:"custom",input:J,inst:Y};return{...Q}}function HB(X){return Object.entries(X).filter(([Q,J])=>{return Number.isNaN(Number.parseInt(Q,10))}).map((Q)=>Q[1])}class FJ{constructor(...X){}}var KJ=(X,Q)=>{X.name="$ZodError",Object.defineProperty(X,"_zod",{value:X._zod,enumerable:!1}),Object.defineProperty(X,"issues",{value:Q,enumerable:!1}),Object.defineProperty(X,"message",{get(){return JSON.stringify(Q,WJ,2)},enumerable:!0})},VJ=y("$ZodError",KJ),MJ=y("$ZodError",KJ,{Parent:Error});function UB(X,Q=(J)=>J.message){let J={},Y=[];for(let G of X.issues)if(G.path.length>0)J[G.path[0]]=J[G.path[0]]||[],J[G.path[0]].push(Q(G));else Y.push(Q(G));return{formErrors:Y,fieldErrors:J}}function zB(X,Q){let J=Q||function($){return $.message},Y={_errors:[]},G=($)=>{for(let W of $.issues)if(W.code==="invalid_union"&&W.errors.length)W.errors.map((H)=>G({issues:H}));else if(W.code==="invalid_key")G({issues:W.issues});else if(W.code==="invalid_element")G({issues:W.issues});else if(W.path.length===0)Y._errors.push(J(W));else{let H=Y,U=0;while(U<W.path.length){let z=W.path[U];if(U!==W.path.length-1)H[z]=H[z]||{_errors:[]};else H[z]=H[z]||{_errors:[]},H[z]._errors.push(J(W));H=H[z],U++}}};return G(X),Y}var BB=(X)=>(Q,J,Y,G)=>{let $=Y?Object.assign(Y,{async:!1}):{async:!1},W=Q._zod.run({value:J,issues:[]},$);if(W instanceof Promise)throw new V9;if(W.issues.length){let H=new(G?.Err??X)(W.issues.map((U)=>S1(U,$,T1())));throw cX(H,G?.callee),H}return W.value};var LB=(X)=>async(Q,J,Y,G)=>{let $=Y?Object.assign(Y,{async:!0}):{async:!0},W=Q._zod.run({value:J,issues:[]},$);if(W instanceof Promise)W=await W;if(W.issues.length){let H=new(G?.Err??X)(W.issues.map((U)=>S1(U,$,T1())));throw cX(H,G?.callee),H}return W.value};var DJ=(X)=>(Q,J,Y)=>{let G=Y?{...Y,async:!1}:{async:!1},$=Q._zod.run({value:J,issues:[]},G);if($ instanceof Promise)throw new V9;return $.issues.length?{success:!1,error:new(X??VJ)($.issues.map((W)=>S1(W,G,T1())))}:{success:!0,data:$.value}},qB=DJ(MJ),ZJ=(X)=>async(Q,J,Y)=>{let G=Y?Object.assign(Y,{async:!0}):{async:!0},$=Q._zod.run({value:J,issues:[]},G);if($ instanceof Promise)$=await $;return $.issues.length?{success:!1,error:new X($.issues.map((W)=>S1(W,G,T1())))}:{success:!0,data:$.value}},FB=ZJ(MJ),KB=/^[cC][^\s-]{8,}$/,VB=/^[0-9a-z]+$/,MB=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,DB=/^[0-9a-vA-V]{20}$/,ZB=/^[A-Za-z0-9]{27}$/,OB=/^[a-zA-Z0-9_-]{21}$/,AB=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,NB=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,z4=(X)=>{if(!X)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${X}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},RB=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,IB="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function jB(){return new RegExp(IB,"u")}var wB=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,PB=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,TB=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,SB=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,EB=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,OJ=/^[A-Za-z0-9_-]*$/,bB=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,CB=/^\+(?:[0-9]){6,14}[0-9]$/,AJ="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",_B=new RegExp(`^${AJ}$`);function NJ(X){return typeof X.precision==="number"?X.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":X.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${X.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function kB(X){return new RegExp(`^${NJ(X)}$`)}function vB(X){let Q=NJ({precision:X.precision}),J=["Z"];if(X.local)J.push("");if(X.offset)J.push("([+-]\\d{2}:\\d{2})");let Y=`${Q}(?:${J.join("|")})`;return new RegExp(`^${AJ}T(?:${Y})$`)}var yB=(X)=>{let Q=X?`[\\s\\S]{${X?.minimum??0},${X?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${Q}$`)},xB=/^\d+$/,gB=/^-?\d+(?:\.\d+)?/i,hB=/true|false/i,fB=/null/i,uB=/^[^A-Z]*$/,mB=/^[^a-z]*$/,r0=y("$ZodCheck",(X,Q)=>{var J;X._zod??(X._zod={}),X._zod.def=Q,(J=X._zod).onattach??(J.onattach=[])}),RJ={number:"number",bigint:"bigint",object:"date"},IJ=y("$ZodCheckLessThan",(X,Q)=>{r0.init(X,Q);let J=RJ[typeof Q.value];X._zod.onattach.push((Y)=>{let G=Y._zod.bag,$=(Q.inclusive?G.maximum:G.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(Q.value<$)if(Q.inclusive)G.maximum=Q.value;else G.exclusiveMaximum=Q.value}),X._zod.check=(Y)=>{if(Q.inclusive?Y.value<=Q.value:Y.value<Q.value)return;Y.issues.push({origin:J,code:"too_big",maximum:Q.value,input:Y.value,inclusive:Q.inclusive,inst:X,continue:!Q.abort})}}),jJ=y("$ZodCheckGreaterThan",(X,Q)=>{r0.init(X,Q);let J=RJ[typeof Q.value];X._zod.onattach.push((Y)=>{let G=Y._zod.bag,$=(Q.inclusive?G.minimum:G.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(Q.value>$)if(Q.inclusive)G.minimum=Q.value;else G.exclusiveMinimum=Q.value}),X._zod.check=(Y)=>{if(Q.inclusive?Y.value>=Q.value:Y.value>Q.value)return;Y.issues.push({origin:J,code:"too_small",minimum:Q.value,input:Y.value,inclusive:Q.inclusive,inst:X,continue:!Q.abort})}}),lB=y("$ZodCheckMultipleOf",(X,Q)=>{r0.init(X,Q),X._zod.onattach.push((J)=>{var Y;(Y=J._zod.bag).multipleOf??(Y.multipleOf=Q.value)}),X._zod.check=(J)=>{if(typeof J.value!==typeof Q.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof J.value==="bigint"?J.value%Q.value===BigInt(0):HJ(J.value,Q.value)===0)return;J.issues.push({origin:typeof J.value,code:"not_multiple_of",divisor:Q.value,input:J.value,inst:X,continue:!Q.abort})}}),cB=y("$ZodCheckNumberFormat",(X,Q)=>{r0.init(X,Q),Q.format=Q.format||"float64";let J=Q.format?.includes("int"),Y=J?"int":"number",[G,$]=LJ[Q.format];X._zod.onattach.push((W)=>{let H=W._zod.bag;if(H.format=Q.format,H.minimum=G,H.maximum=$,J)H.pattern=xB}),X._zod.check=(W)=>{let H=W.value;if(J){if(!Number.isInteger(H)){W.issues.push({expected:Y,format:Q.format,code:"invalid_type",input:H,inst:X});return}if(!Number.isSafeInteger(H)){if(H>0)W.issues.push({input:H,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:X,origin:Y,continue:!Q.abort});else W.issues.push({input:H,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:X,origin:Y,continue:!Q.abort});return}}if(H<G)W.issues.push({origin:"number",input:H,code:"too_small",minimum:G,inclusive:!0,inst:X,continue:!Q.abort});if(H>$)W.issues.push({origin:"number",input:H,code:"too_big",maximum:$,inst:X})}}),pB=y("$ZodCheckMaxLength",(X,Q)=>{r0.init(X,Q),X._zod.when=(J)=>{let Y=J.value;return!L6(Y)&&Y.length!==void 0},X._zod.onattach.push((J)=>{let Y=J._zod.bag.maximum??Number.POSITIVE_INFINITY;if(Q.maximum<Y)J._zod.bag.maximum=Q.maximum}),X._zod.check=(J)=>{let Y=J.value;if(Y.length<=Q.maximum)return;let $=F6(Y);J.issues.push({origin:$,code:"too_big",maximum:Q.maximum,inclusive:!0,input:Y,inst:X,continue:!Q.abort})}}),dB=y("$ZodCheckMinLength",(X,Q)=>{r0.init(X,Q),X._zod.when=(J)=>{let Y=J.value;return!L6(Y)&&Y.length!==void 0},X._zod.onattach.push((J)=>{let Y=J._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(Q.minimum>Y)J._zod.bag.minimum=Q.minimum}),X._zod.check=(J)=>{let Y=J.value;if(Y.length>=Q.minimum)return;let $=F6(Y);J.issues.push({origin:$,code:"too_small",minimum:Q.minimum,inclusive:!0,input:Y,inst:X,continue:!Q.abort})}}),iB=y("$ZodCheckLengthEquals",(X,Q)=>{r0.init(X,Q),X._zod.when=(J)=>{let Y=J.value;return!L6(Y)&&Y.length!==void 0},X._zod.onattach.push((J)=>{let Y=J._zod.bag;Y.minimum=Q.length,Y.maximum=Q.length,Y.length=Q.length}),X._zod.check=(J)=>{let Y=J.value,G=Y.length;if(G===Q.length)return;let $=F6(Y),W=G>Q.length;J.issues.push({origin:$,...W?{code:"too_big",maximum:Q.length}:{code:"too_small",minimum:Q.length},inclusive:!0,exact:!0,input:J.value,inst:X,continue:!Q.abort})}}),K6=y("$ZodCheckStringFormat",(X,Q)=>{var J,Y;if(r0.init(X,Q),X._zod.onattach.push((G)=>{let $=G._zod.bag;if($.format=Q.format,Q.pattern)$.patterns??($.patterns=new Set),$.patterns.add(Q.pattern)}),Q.pattern)(J=X._zod).check??(J.check=(G)=>{if(Q.pattern.lastIndex=0,Q.pattern.test(G.value))return;G.issues.push({origin:"string",code:"invalid_format",format:Q.format,input:G.value,...Q.pattern?{pattern:Q.pattern.toString()}:{},inst:X,continue:!Q.abort})});else(Y=X._zod).check??(Y.check=()=>{})}),nB=y("$ZodCheckRegex",(X,Q)=>{K6.init(X,Q),X._zod.check=(J)=>{if(Q.pattern.lastIndex=0,Q.pattern.test(J.value))return;J.issues.push({origin:"string",code:"invalid_format",format:"regex",input:J.value,pattern:Q.pattern.toString(),inst:X,continue:!Q.abort})}}),rB=y("$ZodCheckLowerCase",(X,Q)=>{Q.pattern??(Q.pattern=uB),K6.init(X,Q)}),oB=y("$ZodCheckUpperCase",(X,Q)=>{Q.pattern??(Q.pattern=mB),K6.init(X,Q)}),aB=y("$ZodCheckIncludes",(X,Q)=>{r0.init(X,Q);let J=A9(Q.includes),Y=new RegExp(typeof Q.position==="number"?`^.{${Q.position}}${J}`:J);Q.pattern=Y,X._zod.onattach.push((G)=>{let $=G._zod.bag;$.patterns??($.patterns=new Set),$.patterns.add(Y)}),X._zod.check=(G)=>{if(G.value.includes(Q.includes,Q.position))return;G.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:Q.includes,input:G.value,inst:X,continue:!Q.abort})}}),sB=y("$ZodCheckStartsWith",(X,Q)=>{r0.init(X,Q);let J=new RegExp(`^${A9(Q.prefix)}.*`);Q.pattern??(Q.pattern=J),X._zod.onattach.push((Y)=>{let G=Y._zod.bag;G.patterns??(G.patterns=new Set),G.patterns.add(J)}),X._zod.check=(Y)=>{if(Y.value.startsWith(Q.prefix))return;Y.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:Q.prefix,input:Y.value,inst:X,continue:!Q.abort})}}),tB=y("$ZodCheckEndsWith",(X,Q)=>{r0.init(X,Q);let J=new RegExp(`.*${A9(Q.suffix)}$`);Q.pattern??(Q.pattern=J),X._zod.onattach.push((Y)=>{let G=Y._zod.bag;G.patterns??(G.patterns=new Set),G.patterns.add(J)}),X._zod.check=(Y)=>{if(Y.value.endsWith(Q.suffix))return;Y.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:Q.suffix,input:Y.value,inst:X,continue:!Q.abort})}}),eB=y("$ZodCheckOverwrite",(X,Q)=>{r0.init(X,Q),X._zod.check=(J)=>{J.value=Q.tx(J.value)}});class wJ{constructor(X=[]){if(this.content=[],this.indent=0,this)this.args=X}indented(X){this.indent+=1,X(this),this.indent-=1}write(X){if(typeof X==="function"){X(this,{execution:"sync"}),X(this,{execution:"async"});return}let J=X.split(`
181
+ `))}if(R1(`[Query.streamInput] Finished processing ${Q} messages from input stream`),Q>0&&this.hasBidirectionalNeeds())R1("[Query.streamInput] Has bidirectional needs, waiting for first result"),await this.waitForFirstResult();R1("[Query] Calling transport.endInput() to close stdin to CLI process"),this.transport.endInput()}catch(Q){if(!(Q instanceof W9))throw Q}}waitForFirstResult(){if(this.firstResultReceived)return R1("[Query.waitForFirstResult] Result already received, returning immediately"),Promise.resolve();return new Promise((X)=>{if(this.abortController?.signal.aborted){X();return}this.abortController?.signal.addEventListener("abort",()=>X(),{once:!0}),this.firstResultReceivedResolve=X})}handleHookCallbacks(X,Q,J,Y){let G=this.hookCallbacks.get(X);if(!G)throw Error(`No hook callback found for ID: ${X}`);return G(Q,J,{signal:Y})}connectSdkMcpServer(X,Q){let J=new a5((Y)=>this.sendMcpServerMessageToCli(X,Y));this.sdkMcpTransports.set(X,J),this.sdkMcpServerInstances.set(X,Q),Q.connect(J)}async disconnectSdkMcpServer(X){let Q=this.sdkMcpTransports.get(X);if(Q)await Q.close(),this.sdkMcpTransports.delete(X);this.sdkMcpServerInstances.delete(X)}sendMcpServerMessageToCli(X,Q){if("id"in Q&&Q.id!==null&&Q.id!==void 0){let Y=`${X}:${Q.id}`,G=this.pendingMcpResponses.get(Y);if(G){G.resolve(Q),this.pendingMcpResponses.delete(Y);return}}let J={type:"control_request",request_id:FB(),request:{subtype:"mcp_message",server_name:X,message:Q}};this.transport.write(q1(J)+`
182
+ `)}handleMcpControlRequest(X,Q,J){let Y="id"in Q.message?Q.message.id:null,G=`${X}:${Y}`;return new Promise(($,W)=>{let H=()=>{this.pendingMcpResponses.delete(G)},U=(q)=>{H(),$(q)},B=(q)=>{H(),W(q)};if(this.pendingMcpResponses.set(G,{resolve:U,reject:B}),J.onmessage)J.onmessage(Q.message);else{H(),W(Error("No message handler registered"));return}})}}var V0;(function(X){X.assertEqual=(G)=>{};function Q(G){}X.assertIs=Q;function J(G){throw Error()}X.assertNever=J,X.arrayToEnum=(G)=>{let $={};for(let W of G)$[W]=W;return $},X.getValidEnumValues=(G)=>{let $=X.objectKeys(G).filter((H)=>typeof G[G[H]]!=="number"),W={};for(let H of $)W[H]=G[H];return X.objectValues(W)},X.objectValues=(G)=>{return X.objectKeys(G).map(function($){return G[$]})},X.objectKeys=typeof Object.keys==="function"?(G)=>Object.keys(G):(G)=>{let $=[];for(let W in G)if(Object.prototype.hasOwnProperty.call(G,W))$.push(W);return $},X.find=(G,$)=>{for(let W of G)if($(W))return W;return},X.isInteger=typeof Number.isInteger==="function"?(G)=>Number.isInteger(G):(G)=>typeof G==="number"&&Number.isFinite(G)&&Math.floor(G)===G;function Y(G,$=" | "){return G.map((W)=>typeof W==="string"?`'${W}'`:W).join($)}X.joinValues=Y,X.jsonStringifyReplacer=(G,$)=>{if(typeof $==="bigint")return $.toString();return $}})(V0||(V0={}));var Q5;(function(X){X.mergeShapes=(Q,J)=>{return{...Q,...J}}})(Q5||(Q5={}));var n=V0.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),C1=(X)=>{switch(typeof X){case"undefined":return n.undefined;case"string":return n.string;case"number":return Number.isNaN(X)?n.nan:n.number;case"boolean":return n.boolean;case"function":return n.function;case"bigint":return n.bigint;case"symbol":return n.symbol;case"object":if(Array.isArray(X))return n.array;if(X===null)return n.null;if(X.then&&typeof X.then==="function"&&X.catch&&typeof X.catch==="function")return n.promise;if(typeof Map<"u"&&X instanceof Map)return n.map;if(typeof Set<"u"&&X instanceof Set)return n.set;if(typeof Date<"u"&&X instanceof Date)return n.date;return n.object;default:return n.unknown}},m=V0.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class e0 extends Error{get errors(){return this.issues}constructor(X){super();this.issues=[],this.addIssue=(J)=>{this.issues=[...this.issues,J]},this.addIssues=(J=[])=>{this.issues=[...this.issues,...J]};let Q=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,Q);else this.__proto__=Q;this.name="ZodError",this.issues=X}format(X){let Q=X||function(G){return G.message},J={_errors:[]},Y=(G)=>{for(let $ of G.issues)if($.code==="invalid_union")$.unionErrors.map(Y);else if($.code==="invalid_return_type")Y($.returnTypeError);else if($.code==="invalid_arguments")Y($.argumentsError);else if($.path.length===0)J._errors.push(Q($));else{let W=J,H=0;while(H<$.path.length){let U=$.path[H];if(H!==$.path.length-1)W[U]=W[U]||{_errors:[]};else W[U]=W[U]||{_errors:[]},W[U]._errors.push(Q($));W=W[U],H++}}};return Y(this),J}static assert(X){if(!(X instanceof e0))throw Error(`Not a ZodError: ${X}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,V0.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(X=(Q)=>Q.message){let Q={},J=[];for(let Y of this.issues)if(Y.path.length>0){let G=Y.path[0];Q[G]=Q[G]||[],Q[G].push(X(Y))}else J.push(X(Y));return{formErrors:J,fieldErrors:Q}}get formErrors(){return this.flatten()}}e0.create=(X)=>{return new e0(X)};var KB=(X,Q)=>{let J;switch(X.code){case m.invalid_type:if(X.received===n.undefined)J="Required";else J=`Expected ${X.expected}, received ${X.received}`;break;case m.invalid_literal:J=`Invalid literal value, expected ${JSON.stringify(X.expected,V0.jsonStringifyReplacer)}`;break;case m.unrecognized_keys:J=`Unrecognized key(s) in object: ${V0.joinValues(X.keys,", ")}`;break;case m.invalid_union:J="Invalid input";break;case m.invalid_union_discriminator:J=`Invalid discriminator value. Expected ${V0.joinValues(X.options)}`;break;case m.invalid_enum_value:J=`Invalid enum value. Expected ${V0.joinValues(X.options)}, received '${X.received}'`;break;case m.invalid_arguments:J="Invalid function arguments";break;case m.invalid_return_type:J="Invalid function return type";break;case m.invalid_date:J="Invalid date";break;case m.invalid_string:if(typeof X.validation==="object")if("includes"in X.validation){if(J=`Invalid input: must include "${X.validation.includes}"`,typeof X.validation.position==="number")J=`${J} at one or more positions greater than or equal to ${X.validation.position}`}else if("startsWith"in X.validation)J=`Invalid input: must start with "${X.validation.startsWith}"`;else if("endsWith"in X.validation)J=`Invalid input: must end with "${X.validation.endsWith}"`;else V0.assertNever(X.validation);else if(X.validation!=="regex")J=`Invalid ${X.validation}`;else J="Invalid";break;case m.too_small:if(X.type==="array")J=`Array must contain ${X.exact?"exactly":X.inclusive?"at least":"more than"} ${X.minimum} element(s)`;else if(X.type==="string")J=`String must contain ${X.exact?"exactly":X.inclusive?"at least":"over"} ${X.minimum} character(s)`;else if(X.type==="number")J=`Number must be ${X.exact?"exactly equal to ":X.inclusive?"greater than or equal to ":"greater than "}${X.minimum}`;else if(X.type==="bigint")J=`Number must be ${X.exact?"exactly equal to ":X.inclusive?"greater than or equal to ":"greater than "}${X.minimum}`;else if(X.type==="date")J=`Date must be ${X.exact?"exactly equal to ":X.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(X.minimum))}`;else J="Invalid input";break;case m.too_big:if(X.type==="array")J=`Array must contain ${X.exact?"exactly":X.inclusive?"at most":"less than"} ${X.maximum} element(s)`;else if(X.type==="string")J=`String must contain ${X.exact?"exactly":X.inclusive?"at most":"under"} ${X.maximum} character(s)`;else if(X.type==="number")J=`Number must be ${X.exact?"exactly":X.inclusive?"less than or equal to":"less than"} ${X.maximum}`;else if(X.type==="bigint")J=`BigInt must be ${X.exact?"exactly":X.inclusive?"less than or equal to":"less than"} ${X.maximum}`;else if(X.type==="date")J=`Date must be ${X.exact?"exactly":X.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(X.maximum))}`;else J="Invalid input";break;case m.custom:J="Invalid input";break;case m.invalid_intersection_types:J="Intersection results could not be merged";break;case m.not_multiple_of:J=`Number must be a multiple of ${X.multipleOf}`;break;case m.not_finite:J="Number must be finite";break;default:J=Q.defaultError,V0.assertNever(X)}return{message:J}},l9=KB,VB=l9;function wX(){return VB}var PX=(X)=>{let{data:Q,path:J,errorMaps:Y,issueData:G}=X,$=[...J,...G.path||[]],W={...G,path:$};if(G.message!==void 0)return{...G,path:$,message:G.message};let H="",U=Y.filter((B)=>!!B).slice().reverse();for(let B of U)H=B(W,{data:Q,defaultError:H}).message;return{...G,path:$,message:H}};function d(X,Q){let J=wX(),Y=PX({issueData:Q,data:X.data,path:X.path,errorMaps:[X.common.contextualErrorMap,X.schemaErrorMap,J,J===l9?void 0:l9].filter((G)=>!!G)});X.common.issues.push(Y)}class d0{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(X,Q){let J=[];for(let Y of Q){if(Y.status==="aborted")return G0;if(Y.status==="dirty")X.dirty();J.push(Y.value)}return{status:X.value,value:J}}static async mergeObjectAsync(X,Q){let J=[];for(let Y of Q){let G=await Y.key,$=await Y.value;J.push({key:G,value:$})}return d0.mergeObjectSync(X,J)}static mergeObjectSync(X,Q){let J={};for(let Y of Q){let{key:G,value:$}=Y;if(G.status==="aborted")return G0;if($.status==="aborted")return G0;if(G.status==="dirty")X.dirty();if($.status==="dirty")X.dirty();if(G.value!=="__proto__"&&(typeof $.value<"u"||Y.alwaysSet))J[G.value]=$.value}return{status:X.value,value:J}}}var G0=Object.freeze({status:"aborted"}),h9=(X)=>({status:"dirty",value:X}),n0=(X)=>({status:"valid",value:X}),J5=(X)=>X.status==="aborted",Y5=(X)=>X.status==="dirty",U9=(X)=>X.status==="valid",d8=(X)=>typeof Promise<"u"&&X instanceof Promise,o;(function(X){X.errToObj=(Q)=>typeof Q==="string"?{message:Q}:Q||{},X.toString=(Q)=>typeof Q==="string"?Q:Q?.message})(o||(o={}));class $1{constructor(X,Q,J,Y){this._cachedPath=[],this.parent=X,this.data=Q,this._path=J,this._key=Y}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}var G5=(X,Q)=>{if(U9(Q))return{success:!0,data:Q.value};else{if(!X.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let J=new e0(X.common.issues);return this._error=J,this._error}}}};function H0(X){if(!X)return{};let{errorMap:Q,invalid_type_error:J,required_error:Y,description:G}=X;if(Q&&(J||Y))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(Q)return{errorMap:Q,description:G};return{errorMap:(W,H)=>{let{message:U}=X;if(W.code==="invalid_enum_value")return{message:U??H.defaultError};if(typeof H.data>"u")return{message:U??Y??H.defaultError};if(W.code!=="invalid_type")return{message:H.defaultError};return{message:U??J??H.defaultError}},description:G}}class L0{get description(){return this._def.description}_getType(X){return C1(X.data)}_getOrReturnCtx(X,Q){return Q||{common:X.parent.common,data:X.data,parsedType:C1(X.data),schemaErrorMap:this._def.errorMap,path:X.path,parent:X.parent}}_processInputParams(X){return{status:new d0,ctx:{common:X.parent.common,data:X.data,parsedType:C1(X.data),schemaErrorMap:this._def.errorMap,path:X.path,parent:X.parent}}}_parseSync(X){let Q=this._parse(X);if(d8(Q))throw Error("Synchronous parse encountered promise.");return Q}_parseAsync(X){let Q=this._parse(X);return Promise.resolve(Q)}parse(X,Q){let J=this.safeParse(X,Q);if(J.success)return J.data;throw J.error}safeParse(X,Q){let J={common:{issues:[],async:Q?.async??!1,contextualErrorMap:Q?.errorMap},path:Q?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:X,parsedType:C1(X)},Y=this._parseSync({data:X,path:J.path,parent:J});return G5(J,Y)}"~validate"(X){let Q={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:X,parsedType:C1(X)};if(!this["~standard"].async)try{let J=this._parseSync({data:X,path:[],parent:Q});return U9(J)?{value:J.value}:{issues:Q.common.issues}}catch(J){if(J?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;Q.common={issues:[],async:!0}}return this._parseAsync({data:X,path:[],parent:Q}).then((J)=>U9(J)?{value:J.value}:{issues:Q.common.issues})}async parseAsync(X,Q){let J=await this.safeParseAsync(X,Q);if(J.success)return J.data;throw J.error}async safeParseAsync(X,Q){let J={common:{issues:[],contextualErrorMap:Q?.errorMap,async:!0},path:Q?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:X,parsedType:C1(X)},Y=this._parse({data:X,path:J.path,parent:J}),G=await(d8(Y)?Y:Promise.resolve(Y));return G5(J,G)}refine(X,Q){let J=(Y)=>{if(typeof Q==="string"||typeof Q>"u")return{message:Q};else if(typeof Q==="function")return Q(Y);else return Q};return this._refinement((Y,G)=>{let $=X(Y),W=()=>G.addIssue({code:m.custom,...J(Y)});if(typeof Promise<"u"&&$ instanceof Promise)return $.then((H)=>{if(!H)return W(),!1;else return!0});if(!$)return W(),!1;else return!0})}refinement(X,Q){return this._refinement((J,Y)=>{if(!X(J))return Y.addIssue(typeof Q==="function"?Q(J,Y):Q),!1;else return!0})}_refinement(X){return new M1({schema:this,typeName:$0.ZodEffects,effect:{type:"refinement",refinement:X}})}superRefine(X){return this._refinement(X)}constructor(X){this.spa=this.safeParseAsync,this._def=X,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(Q)=>this["~validate"](Q)}}optional(){return K1.create(this,this._def)}nullable(){return k1.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return F1.create(this)}promise(){return q9.create(this,this._def)}or(X){return i9.create([this,X],this._def)}and(X){return n9.create(this,X,this._def)}transform(X){return new M1({...H0(this._def),schema:this,typeName:$0.ZodEffects,effect:{type:"transform",transform:X}})}default(X){let Q=typeof X==="function"?X:()=>X;return new s9({...H0(this._def),innerType:this,defaultValue:Q,typeName:$0.ZodDefault})}brand(){return new fX({typeName:$0.ZodBranded,type:this,...H0(this._def)})}catch(X){let Q=typeof X==="function"?X:()=>X;return new t9({...H0(this._def),innerType:this,catchValue:Q,typeName:$0.ZodCatch})}describe(X){return new this.constructor({...this._def,description:X})}pipe(X){return H6.create(this,X)}readonly(){return e9.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var MB=/^c[^\s-]{8,}$/i,DB=/^[0-9a-z]+$/,ZB=/^[0-9A-HJKMNP-TV-Z]{26}$/i,OB=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,AB=/^[a-z0-9_-]{21}$/i,NB=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,RB=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,IB=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,jB="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",AX,wB=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,PB=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,TB=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,SB=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,EB=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,bB=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,t5="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",CB=new RegExp(`^${t5}$`);function e5(X){let Q="[0-5]\\d";if(X.precision)Q=`${Q}\\.\\d{${X.precision}}`;else if(X.precision==null)Q=`${Q}(\\.\\d+)?`;let J=X.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${Q})${J}`}function _B(X){return new RegExp(`^${e5(X)}$`)}function kB(X){let Q=`${t5}T${e5(X)}`,J=[];if(J.push(X.local?"Z?":"Z"),X.offset)J.push("([+-]\\d{2}:?\\d{2})");return Q=`${Q}(${J.join("|")})`,new RegExp(`^${Q}$`)}function vB(X,Q){if((Q==="v4"||!Q)&&wB.test(X))return!0;if((Q==="v6"||!Q)&&TB.test(X))return!0;return!1}function yB(X,Q){if(!NB.test(X))return!1;try{let[J]=X.split(".");if(!J)return!1;let Y=J.replace(/-/g,"+").replace(/_/g,"/").padEnd(J.length+(4-J.length%4)%4,"="),G=JSON.parse(atob(Y));if(typeof G!=="object"||G===null)return!1;if("typ"in G&&G?.typ!=="JWT")return!1;if(!G.alg)return!1;if(Q&&G.alg!==Q)return!1;return!0}catch{return!1}}function xB(X,Q){if((Q==="v4"||!Q)&&PB.test(X))return!0;if((Q==="v6"||!Q)&&SB.test(X))return!0;return!1}class j1 extends L0{_parse(X){if(this._def.coerce)X.data=String(X.data);if(this._getType(X)!==n.string){let G=this._getOrReturnCtx(X);return d(G,{code:m.invalid_type,expected:n.string,received:G.parsedType}),G0}let J=new d0,Y=void 0;for(let G of this._def.checks)if(G.kind==="min"){if(X.data.length<G.value)Y=this._getOrReturnCtx(X,Y),d(Y,{code:m.too_small,minimum:G.value,type:"string",inclusive:!0,exact:!1,message:G.message}),J.dirty()}else if(G.kind==="max"){if(X.data.length>G.value)Y=this._getOrReturnCtx(X,Y),d(Y,{code:m.too_big,maximum:G.value,type:"string",inclusive:!0,exact:!1,message:G.message}),J.dirty()}else if(G.kind==="length"){let $=X.data.length>G.value,W=X.data.length<G.value;if($||W){if(Y=this._getOrReturnCtx(X,Y),$)d(Y,{code:m.too_big,maximum:G.value,type:"string",inclusive:!0,exact:!0,message:G.message});else if(W)d(Y,{code:m.too_small,minimum:G.value,type:"string",inclusive:!0,exact:!0,message:G.message});J.dirty()}}else if(G.kind==="email"){if(!IB.test(X.data))Y=this._getOrReturnCtx(X,Y),d(Y,{validation:"email",code:m.invalid_string,message:G.message}),J.dirty()}else if(G.kind==="emoji"){if(!AX)AX=new RegExp(jB,"u");if(!AX.test(X.data))Y=this._getOrReturnCtx(X,Y),d(Y,{validation:"emoji",code:m.invalid_string,message:G.message}),J.dirty()}else if(G.kind==="uuid"){if(!OB.test(X.data))Y=this._getOrReturnCtx(X,Y),d(Y,{validation:"uuid",code:m.invalid_string,message:G.message}),J.dirty()}else if(G.kind==="nanoid"){if(!AB.test(X.data))Y=this._getOrReturnCtx(X,Y),d(Y,{validation:"nanoid",code:m.invalid_string,message:G.message}),J.dirty()}else if(G.kind==="cuid"){if(!MB.test(X.data))Y=this._getOrReturnCtx(X,Y),d(Y,{validation:"cuid",code:m.invalid_string,message:G.message}),J.dirty()}else if(G.kind==="cuid2"){if(!DB.test(X.data))Y=this._getOrReturnCtx(X,Y),d(Y,{validation:"cuid2",code:m.invalid_string,message:G.message}),J.dirty()}else if(G.kind==="ulid"){if(!ZB.test(X.data))Y=this._getOrReturnCtx(X,Y),d(Y,{validation:"ulid",code:m.invalid_string,message:G.message}),J.dirty()}else if(G.kind==="url")try{new URL(X.data)}catch{Y=this._getOrReturnCtx(X,Y),d(Y,{validation:"url",code:m.invalid_string,message:G.message}),J.dirty()}else if(G.kind==="regex"){if(G.regex.lastIndex=0,!G.regex.test(X.data))Y=this._getOrReturnCtx(X,Y),d(Y,{validation:"regex",code:m.invalid_string,message:G.message}),J.dirty()}else if(G.kind==="trim")X.data=X.data.trim();else if(G.kind==="includes"){if(!X.data.includes(G.value,G.position))Y=this._getOrReturnCtx(X,Y),d(Y,{code:m.invalid_string,validation:{includes:G.value,position:G.position},message:G.message}),J.dirty()}else if(G.kind==="toLowerCase")X.data=X.data.toLowerCase();else if(G.kind==="toUpperCase")X.data=X.data.toUpperCase();else if(G.kind==="startsWith"){if(!X.data.startsWith(G.value))Y=this._getOrReturnCtx(X,Y),d(Y,{code:m.invalid_string,validation:{startsWith:G.value},message:G.message}),J.dirty()}else if(G.kind==="endsWith"){if(!X.data.endsWith(G.value))Y=this._getOrReturnCtx(X,Y),d(Y,{code:m.invalid_string,validation:{endsWith:G.value},message:G.message}),J.dirty()}else if(G.kind==="datetime"){if(!kB(G).test(X.data))Y=this._getOrReturnCtx(X,Y),d(Y,{code:m.invalid_string,validation:"datetime",message:G.message}),J.dirty()}else if(G.kind==="date"){if(!CB.test(X.data))Y=this._getOrReturnCtx(X,Y),d(Y,{code:m.invalid_string,validation:"date",message:G.message}),J.dirty()}else if(G.kind==="time"){if(!_B(G).test(X.data))Y=this._getOrReturnCtx(X,Y),d(Y,{code:m.invalid_string,validation:"time",message:G.message}),J.dirty()}else if(G.kind==="duration"){if(!RB.test(X.data))Y=this._getOrReturnCtx(X,Y),d(Y,{validation:"duration",code:m.invalid_string,message:G.message}),J.dirty()}else if(G.kind==="ip"){if(!vB(X.data,G.version))Y=this._getOrReturnCtx(X,Y),d(Y,{validation:"ip",code:m.invalid_string,message:G.message}),J.dirty()}else if(G.kind==="jwt"){if(!yB(X.data,G.alg))Y=this._getOrReturnCtx(X,Y),d(Y,{validation:"jwt",code:m.invalid_string,message:G.message}),J.dirty()}else if(G.kind==="cidr"){if(!xB(X.data,G.version))Y=this._getOrReturnCtx(X,Y),d(Y,{validation:"cidr",code:m.invalid_string,message:G.message}),J.dirty()}else if(G.kind==="base64"){if(!EB.test(X.data))Y=this._getOrReturnCtx(X,Y),d(Y,{validation:"base64",code:m.invalid_string,message:G.message}),J.dirty()}else if(G.kind==="base64url"){if(!bB.test(X.data))Y=this._getOrReturnCtx(X,Y),d(Y,{validation:"base64url",code:m.invalid_string,message:G.message}),J.dirty()}else V0.assertNever(G);return{status:J.value,value:X.data}}_regex(X,Q,J){return this.refinement((Y)=>X.test(Y),{validation:Q,code:m.invalid_string,...o.errToObj(J)})}_addCheck(X){return new j1({...this._def,checks:[...this._def.checks,X]})}email(X){return this._addCheck({kind:"email",...o.errToObj(X)})}url(X){return this._addCheck({kind:"url",...o.errToObj(X)})}emoji(X){return this._addCheck({kind:"emoji",...o.errToObj(X)})}uuid(X){return this._addCheck({kind:"uuid",...o.errToObj(X)})}nanoid(X){return this._addCheck({kind:"nanoid",...o.errToObj(X)})}cuid(X){return this._addCheck({kind:"cuid",...o.errToObj(X)})}cuid2(X){return this._addCheck({kind:"cuid2",...o.errToObj(X)})}ulid(X){return this._addCheck({kind:"ulid",...o.errToObj(X)})}base64(X){return this._addCheck({kind:"base64",...o.errToObj(X)})}base64url(X){return this._addCheck({kind:"base64url",...o.errToObj(X)})}jwt(X){return this._addCheck({kind:"jwt",...o.errToObj(X)})}ip(X){return this._addCheck({kind:"ip",...o.errToObj(X)})}cidr(X){return this._addCheck({kind:"cidr",...o.errToObj(X)})}datetime(X){if(typeof X==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:X});return this._addCheck({kind:"datetime",precision:typeof X?.precision>"u"?null:X?.precision,offset:X?.offset??!1,local:X?.local??!1,...o.errToObj(X?.message)})}date(X){return this._addCheck({kind:"date",message:X})}time(X){if(typeof X==="string")return this._addCheck({kind:"time",precision:null,message:X});return this._addCheck({kind:"time",precision:typeof X?.precision>"u"?null:X?.precision,...o.errToObj(X?.message)})}duration(X){return this._addCheck({kind:"duration",...o.errToObj(X)})}regex(X,Q){return this._addCheck({kind:"regex",regex:X,...o.errToObj(Q)})}includes(X,Q){return this._addCheck({kind:"includes",value:X,position:Q?.position,...o.errToObj(Q?.message)})}startsWith(X,Q){return this._addCheck({kind:"startsWith",value:X,...o.errToObj(Q)})}endsWith(X,Q){return this._addCheck({kind:"endsWith",value:X,...o.errToObj(Q)})}min(X,Q){return this._addCheck({kind:"min",value:X,...o.errToObj(Q)})}max(X,Q){return this._addCheck({kind:"max",value:X,...o.errToObj(Q)})}length(X,Q){return this._addCheck({kind:"length",value:X,...o.errToObj(Q)})}nonempty(X){return this.min(1,o.errToObj(X))}trim(){return new j1({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new j1({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new j1({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((X)=>X.kind==="datetime")}get isDate(){return!!this._def.checks.find((X)=>X.kind==="date")}get isTime(){return!!this._def.checks.find((X)=>X.kind==="time")}get isDuration(){return!!this._def.checks.find((X)=>X.kind==="duration")}get isEmail(){return!!this._def.checks.find((X)=>X.kind==="email")}get isURL(){return!!this._def.checks.find((X)=>X.kind==="url")}get isEmoji(){return!!this._def.checks.find((X)=>X.kind==="emoji")}get isUUID(){return!!this._def.checks.find((X)=>X.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((X)=>X.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((X)=>X.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((X)=>X.kind==="cuid2")}get isULID(){return!!this._def.checks.find((X)=>X.kind==="ulid")}get isIP(){return!!this._def.checks.find((X)=>X.kind==="ip")}get isCIDR(){return!!this._def.checks.find((X)=>X.kind==="cidr")}get isBase64(){return!!this._def.checks.find((X)=>X.kind==="base64")}get isBase64url(){return!!this._def.checks.find((X)=>X.kind==="base64url")}get minLength(){let X=null;for(let Q of this._def.checks)if(Q.kind==="min"){if(X===null||Q.value>X)X=Q.value}return X}get maxLength(){let X=null;for(let Q of this._def.checks)if(Q.kind==="max"){if(X===null||Q.value<X)X=Q.value}return X}}j1.create=(X)=>{return new j1({checks:[],typeName:$0.ZodString,coerce:X?.coerce??!1,...H0(X)})};function gB(X,Q){let J=(X.toString().split(".")[1]||"").length,Y=(Q.toString().split(".")[1]||"").length,G=J>Y?J:Y,$=Number.parseInt(X.toFixed(G).replace(".","")),W=Number.parseInt(Q.toFixed(G).replace(".",""));return $%W/10**G}class B9 extends L0{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(X){if(this._def.coerce)X.data=Number(X.data);if(this._getType(X)!==n.number){let G=this._getOrReturnCtx(X);return d(G,{code:m.invalid_type,expected:n.number,received:G.parsedType}),G0}let J=void 0,Y=new d0;for(let G of this._def.checks)if(G.kind==="int"){if(!V0.isInteger(X.data))J=this._getOrReturnCtx(X,J),d(J,{code:m.invalid_type,expected:"integer",received:"float",message:G.message}),Y.dirty()}else if(G.kind==="min"){if(G.inclusive?X.data<G.value:X.data<=G.value)J=this._getOrReturnCtx(X,J),d(J,{code:m.too_small,minimum:G.value,type:"number",inclusive:G.inclusive,exact:!1,message:G.message}),Y.dirty()}else if(G.kind==="max"){if(G.inclusive?X.data>G.value:X.data>=G.value)J=this._getOrReturnCtx(X,J),d(J,{code:m.too_big,maximum:G.value,type:"number",inclusive:G.inclusive,exact:!1,message:G.message}),Y.dirty()}else if(G.kind==="multipleOf"){if(gB(X.data,G.value)!==0)J=this._getOrReturnCtx(X,J),d(J,{code:m.not_multiple_of,multipleOf:G.value,message:G.message}),Y.dirty()}else if(G.kind==="finite"){if(!Number.isFinite(X.data))J=this._getOrReturnCtx(X,J),d(J,{code:m.not_finite,message:G.message}),Y.dirty()}else V0.assertNever(G);return{status:Y.value,value:X.data}}gte(X,Q){return this.setLimit("min",X,!0,o.toString(Q))}gt(X,Q){return this.setLimit("min",X,!1,o.toString(Q))}lte(X,Q){return this.setLimit("max",X,!0,o.toString(Q))}lt(X,Q){return this.setLimit("max",X,!1,o.toString(Q))}setLimit(X,Q,J,Y){return new B9({...this._def,checks:[...this._def.checks,{kind:X,value:Q,inclusive:J,message:o.toString(Y)}]})}_addCheck(X){return new B9({...this._def,checks:[...this._def.checks,X]})}int(X){return this._addCheck({kind:"int",message:o.toString(X)})}positive(X){return this._addCheck({kind:"min",value:0,inclusive:!1,message:o.toString(X)})}negative(X){return this._addCheck({kind:"max",value:0,inclusive:!1,message:o.toString(X)})}nonpositive(X){return this._addCheck({kind:"max",value:0,inclusive:!0,message:o.toString(X)})}nonnegative(X){return this._addCheck({kind:"min",value:0,inclusive:!0,message:o.toString(X)})}multipleOf(X,Q){return this._addCheck({kind:"multipleOf",value:X,message:o.toString(Q)})}finite(X){return this._addCheck({kind:"finite",message:o.toString(X)})}safe(X){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:o.toString(X)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:o.toString(X)})}get minValue(){let X=null;for(let Q of this._def.checks)if(Q.kind==="min"){if(X===null||Q.value>X)X=Q.value}return X}get maxValue(){let X=null;for(let Q of this._def.checks)if(Q.kind==="max"){if(X===null||Q.value<X)X=Q.value}return X}get isInt(){return!!this._def.checks.find((X)=>X.kind==="int"||X.kind==="multipleOf"&&V0.isInteger(X.value))}get isFinite(){let X=null,Q=null;for(let J of this._def.checks)if(J.kind==="finite"||J.kind==="int"||J.kind==="multipleOf")return!0;else if(J.kind==="min"){if(Q===null||J.value>Q)Q=J.value}else if(J.kind==="max"){if(X===null||J.value<X)X=J.value}return Number.isFinite(Q)&&Number.isFinite(X)}}B9.create=(X)=>{return new B9({checks:[],typeName:$0.ZodNumber,coerce:X?.coerce||!1,...H0(X)})};class z9 extends L0{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(X){if(this._def.coerce)try{X.data=BigInt(X.data)}catch{return this._getInvalidInput(X)}if(this._getType(X)!==n.bigint)return this._getInvalidInput(X);let J=void 0,Y=new d0;for(let G of this._def.checks)if(G.kind==="min"){if(G.inclusive?X.data<G.value:X.data<=G.value)J=this._getOrReturnCtx(X,J),d(J,{code:m.too_small,type:"bigint",minimum:G.value,inclusive:G.inclusive,message:G.message}),Y.dirty()}else if(G.kind==="max"){if(G.inclusive?X.data>G.value:X.data>=G.value)J=this._getOrReturnCtx(X,J),d(J,{code:m.too_big,type:"bigint",maximum:G.value,inclusive:G.inclusive,message:G.message}),Y.dirty()}else if(G.kind==="multipleOf"){if(X.data%G.value!==BigInt(0))J=this._getOrReturnCtx(X,J),d(J,{code:m.not_multiple_of,multipleOf:G.value,message:G.message}),Y.dirty()}else V0.assertNever(G);return{status:Y.value,value:X.data}}_getInvalidInput(X){let Q=this._getOrReturnCtx(X);return d(Q,{code:m.invalid_type,expected:n.bigint,received:Q.parsedType}),G0}gte(X,Q){return this.setLimit("min",X,!0,o.toString(Q))}gt(X,Q){return this.setLimit("min",X,!1,o.toString(Q))}lte(X,Q){return this.setLimit("max",X,!0,o.toString(Q))}lt(X,Q){return this.setLimit("max",X,!1,o.toString(Q))}setLimit(X,Q,J,Y){return new z9({...this._def,checks:[...this._def.checks,{kind:X,value:Q,inclusive:J,message:o.toString(Y)}]})}_addCheck(X){return new z9({...this._def,checks:[...this._def.checks,X]})}positive(X){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:o.toString(X)})}negative(X){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:o.toString(X)})}nonpositive(X){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:o.toString(X)})}nonnegative(X){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:o.toString(X)})}multipleOf(X,Q){return this._addCheck({kind:"multipleOf",value:X,message:o.toString(Q)})}get minValue(){let X=null;for(let Q of this._def.checks)if(Q.kind==="min"){if(X===null||Q.value>X)X=Q.value}return X}get maxValue(){let X=null;for(let Q of this._def.checks)if(Q.kind==="max"){if(X===null||Q.value<X)X=Q.value}return X}}z9.create=(X)=>{return new z9({checks:[],typeName:$0.ZodBigInt,coerce:X?.coerce??!1,...H0(X)})};class i8 extends L0{_parse(X){if(this._def.coerce)X.data=Boolean(X.data);if(this._getType(X)!==n.boolean){let J=this._getOrReturnCtx(X);return d(J,{code:m.invalid_type,expected:n.boolean,received:J.parsedType}),G0}return n0(X.data)}}i8.create=(X)=>{return new i8({typeName:$0.ZodBoolean,coerce:X?.coerce||!1,...H0(X)})};class c9 extends L0{_parse(X){if(this._def.coerce)X.data=new Date(X.data);if(this._getType(X)!==n.date){let G=this._getOrReturnCtx(X);return d(G,{code:m.invalid_type,expected:n.date,received:G.parsedType}),G0}if(Number.isNaN(X.data.getTime())){let G=this._getOrReturnCtx(X);return d(G,{code:m.invalid_date}),G0}let J=new d0,Y=void 0;for(let G of this._def.checks)if(G.kind==="min"){if(X.data.getTime()<G.value)Y=this._getOrReturnCtx(X,Y),d(Y,{code:m.too_small,message:G.message,inclusive:!0,exact:!1,minimum:G.value,type:"date"}),J.dirty()}else if(G.kind==="max"){if(X.data.getTime()>G.value)Y=this._getOrReturnCtx(X,Y),d(Y,{code:m.too_big,message:G.message,inclusive:!0,exact:!1,maximum:G.value,type:"date"}),J.dirty()}else V0.assertNever(G);return{status:J.value,value:new Date(X.data.getTime())}}_addCheck(X){return new c9({...this._def,checks:[...this._def.checks,X]})}min(X,Q){return this._addCheck({kind:"min",value:X.getTime(),message:o.toString(Q)})}max(X,Q){return this._addCheck({kind:"max",value:X.getTime(),message:o.toString(Q)})}get minDate(){let X=null;for(let Q of this._def.checks)if(Q.kind==="min"){if(X===null||Q.value>X)X=Q.value}return X!=null?new Date(X):null}get maxDate(){let X=null;for(let Q of this._def.checks)if(Q.kind==="max"){if(X===null||Q.value<X)X=Q.value}return X!=null?new Date(X):null}}c9.create=(X)=>{return new c9({checks:[],coerce:X?.coerce||!1,typeName:$0.ZodDate,...H0(X)})};class n8 extends L0{_parse(X){if(this._getType(X)!==n.symbol){let J=this._getOrReturnCtx(X);return d(J,{code:m.invalid_type,expected:n.symbol,received:J.parsedType}),G0}return n0(X.data)}}n8.create=(X)=>{return new n8({typeName:$0.ZodSymbol,...H0(X)})};class p9 extends L0{_parse(X){if(this._getType(X)!==n.undefined){let J=this._getOrReturnCtx(X);return d(J,{code:m.invalid_type,expected:n.undefined,received:J.parsedType}),G0}return n0(X.data)}}p9.create=(X)=>{return new p9({typeName:$0.ZodUndefined,...H0(X)})};class d9 extends L0{_parse(X){if(this._getType(X)!==n.null){let J=this._getOrReturnCtx(X);return d(J,{code:m.invalid_type,expected:n.null,received:J.parsedType}),G0}return n0(X.data)}}d9.create=(X)=>{return new d9({typeName:$0.ZodNull,...H0(X)})};class r8 extends L0{constructor(){super(...arguments);this._any=!0}_parse(X){return n0(X.data)}}r8.create=(X)=>{return new r8({typeName:$0.ZodAny,...H0(X)})};class n1 extends L0{constructor(){super(...arguments);this._unknown=!0}_parse(X){return n0(X.data)}}n1.create=(X)=>{return new n1({typeName:$0.ZodUnknown,...H0(X)})};class w1 extends L0{_parse(X){let Q=this._getOrReturnCtx(X);return d(Q,{code:m.invalid_type,expected:n.never,received:Q.parsedType}),G0}}w1.create=(X)=>{return new w1({typeName:$0.ZodNever,...H0(X)})};class o8 extends L0{_parse(X){if(this._getType(X)!==n.undefined){let J=this._getOrReturnCtx(X);return d(J,{code:m.invalid_type,expected:n.void,received:J.parsedType}),G0}return n0(X.data)}}o8.create=(X)=>{return new o8({typeName:$0.ZodVoid,...H0(X)})};class F1 extends L0{_parse(X){let{ctx:Q,status:J}=this._processInputParams(X),Y=this._def;if(Q.parsedType!==n.array)return d(Q,{code:m.invalid_type,expected:n.array,received:Q.parsedType}),G0;if(Y.exactLength!==null){let $=Q.data.length>Y.exactLength.value,W=Q.data.length<Y.exactLength.value;if($||W)d(Q,{code:$?m.too_big:m.too_small,minimum:W?Y.exactLength.value:void 0,maximum:$?Y.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:Y.exactLength.message}),J.dirty()}if(Y.minLength!==null){if(Q.data.length<Y.minLength.value)d(Q,{code:m.too_small,minimum:Y.minLength.value,type:"array",inclusive:!0,exact:!1,message:Y.minLength.message}),J.dirty()}if(Y.maxLength!==null){if(Q.data.length>Y.maxLength.value)d(Q,{code:m.too_big,maximum:Y.maxLength.value,type:"array",inclusive:!0,exact:!1,message:Y.maxLength.message}),J.dirty()}if(Q.common.async)return Promise.all([...Q.data].map(($,W)=>{return Y.type._parseAsync(new $1(Q,$,Q.path,W))})).then(($)=>{return d0.mergeArray(J,$)});let G=[...Q.data].map(($,W)=>{return Y.type._parseSync(new $1(Q,$,Q.path,W))});return d0.mergeArray(J,G)}get element(){return this._def.type}min(X,Q){return new F1({...this._def,minLength:{value:X,message:o.toString(Q)}})}max(X,Q){return new F1({...this._def,maxLength:{value:X,message:o.toString(Q)}})}length(X,Q){return new F1({...this._def,exactLength:{value:X,message:o.toString(Q)}})}nonempty(X){return this.min(1,X)}}F1.create=(X,Q)=>{return new F1({type:X,minLength:null,maxLength:null,exactLength:null,typeName:$0.ZodArray,...H0(Q)})};function G9(X){if(X instanceof C0){let Q={};for(let J in X.shape){let Y=X.shape[J];Q[J]=K1.create(G9(Y))}return new C0({...X._def,shape:()=>Q})}else if(X instanceof F1)return new F1({...X._def,type:G9(X.element)});else if(X instanceof K1)return K1.create(G9(X.unwrap()));else if(X instanceof k1)return k1.create(G9(X.unwrap()));else if(X instanceof P1)return P1.create(X.items.map((Q)=>G9(Q)));else return X}class C0 extends L0{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let X=this._def.shape(),Q=V0.objectKeys(X);return this._cached={shape:X,keys:Q},this._cached}_parse(X){if(this._getType(X)!==n.object){let U=this._getOrReturnCtx(X);return d(U,{code:m.invalid_type,expected:n.object,received:U.parsedType}),G0}let{status:J,ctx:Y}=this._processInputParams(X),{shape:G,keys:$}=this._getCached(),W=[];if(!(this._def.catchall instanceof w1&&this._def.unknownKeys==="strip")){for(let U in Y.data)if(!$.includes(U))W.push(U)}let H=[];for(let U of $){let B=G[U],q=Y.data[U];H.push({key:{status:"valid",value:U},value:B._parse(new $1(Y,q,Y.path,U)),alwaysSet:U in Y.data})}if(this._def.catchall instanceof w1){let U=this._def.unknownKeys;if(U==="passthrough")for(let B of W)H.push({key:{status:"valid",value:B},value:{status:"valid",value:Y.data[B]}});else if(U==="strict"){if(W.length>0)d(Y,{code:m.unrecognized_keys,keys:W}),J.dirty()}else if(U==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let U=this._def.catchall;for(let B of W){let q=Y.data[B];H.push({key:{status:"valid",value:B},value:U._parse(new $1(Y,q,Y.path,B)),alwaysSet:B in Y.data})}}if(Y.common.async)return Promise.resolve().then(async()=>{let U=[];for(let B of H){let q=await B.key,K=await B.value;U.push({key:q,value:K,alwaysSet:B.alwaysSet})}return U}).then((U)=>{return d0.mergeObjectSync(J,U)});else return d0.mergeObjectSync(J,H)}get shape(){return this._def.shape()}strict(X){return o.errToObj,new C0({...this._def,unknownKeys:"strict",...X!==void 0?{errorMap:(Q,J)=>{let Y=this._def.errorMap?.(Q,J).message??J.defaultError;if(Q.code==="unrecognized_keys")return{message:o.errToObj(X).message??Y};return{message:Y}}}:{}})}strip(){return new C0({...this._def,unknownKeys:"strip"})}passthrough(){return new C0({...this._def,unknownKeys:"passthrough"})}extend(X){return new C0({...this._def,shape:()=>({...this._def.shape(),...X})})}merge(X){return new C0({unknownKeys:X._def.unknownKeys,catchall:X._def.catchall,shape:()=>({...this._def.shape(),...X._def.shape()}),typeName:$0.ZodObject})}setKey(X,Q){return this.augment({[X]:Q})}catchall(X){return new C0({...this._def,catchall:X})}pick(X){let Q={};for(let J of V0.objectKeys(X))if(X[J]&&this.shape[J])Q[J]=this.shape[J];return new C0({...this._def,shape:()=>Q})}omit(X){let Q={};for(let J of V0.objectKeys(this.shape))if(!X[J])Q[J]=this.shape[J];return new C0({...this._def,shape:()=>Q})}deepPartial(){return G9(this)}partial(X){let Q={};for(let J of V0.objectKeys(this.shape)){let Y=this.shape[J];if(X&&!X[J])Q[J]=Y;else Q[J]=Y.optional()}return new C0({...this._def,shape:()=>Q})}required(X){let Q={};for(let J of V0.objectKeys(this.shape))if(X&&!X[J])Q[J]=this.shape[J];else{let G=this.shape[J];while(G instanceof K1)G=G._def.innerType;Q[J]=G}return new C0({...this._def,shape:()=>Q})}keyof(){return XJ(V0.objectKeys(this.shape))}}C0.create=(X,Q)=>{return new C0({shape:()=>X,unknownKeys:"strip",catchall:w1.create(),typeName:$0.ZodObject,...H0(Q)})};C0.strictCreate=(X,Q)=>{return new C0({shape:()=>X,unknownKeys:"strict",catchall:w1.create(),typeName:$0.ZodObject,...H0(Q)})};C0.lazycreate=(X,Q)=>{return new C0({shape:X,unknownKeys:"strip",catchall:w1.create(),typeName:$0.ZodObject,...H0(Q)})};class i9 extends L0{_parse(X){let{ctx:Q}=this._processInputParams(X),J=this._def.options;function Y(G){for(let W of G)if(W.result.status==="valid")return W.result;for(let W of G)if(W.result.status==="dirty")return Q.common.issues.push(...W.ctx.common.issues),W.result;let $=G.map((W)=>new e0(W.ctx.common.issues));return d(Q,{code:m.invalid_union,unionErrors:$}),G0}if(Q.common.async)return Promise.all(J.map(async(G)=>{let $={...Q,common:{...Q.common,issues:[]},parent:null};return{result:await G._parseAsync({data:Q.data,path:Q.path,parent:$}),ctx:$}})).then(Y);else{let G=void 0,$=[];for(let H of J){let U={...Q,common:{...Q.common,issues:[]},parent:null},B=H._parseSync({data:Q.data,path:Q.path,parent:U});if(B.status==="valid")return B;else if(B.status==="dirty"&&!G)G={result:B,ctx:U};if(U.common.issues.length)$.push(U.common.issues)}if(G)return Q.common.issues.push(...G.ctx.common.issues),G.result;let W=$.map((H)=>new e0(H));return d(Q,{code:m.invalid_union,unionErrors:W}),G0}}get options(){return this._def.options}}i9.create=(X,Q)=>{return new i9({options:X,typeName:$0.ZodUnion,...H0(Q)})};var N1=(X)=>{if(X instanceof r9)return N1(X.schema);else if(X instanceof M1)return N1(X.innerType());else if(X instanceof o9)return[X.value];else if(X instanceof r1)return X.options;else if(X instanceof a9)return V0.objectValues(X.enum);else if(X instanceof s9)return N1(X._def.innerType);else if(X instanceof p9)return[void 0];else if(X instanceof d9)return[null];else if(X instanceof K1)return[void 0,...N1(X.unwrap())];else if(X instanceof k1)return[null,...N1(X.unwrap())];else if(X instanceof fX)return N1(X.unwrap());else if(X instanceof e9)return N1(X.unwrap());else if(X instanceof t9)return N1(X._def.innerType);else return[]};class hX extends L0{_parse(X){let{ctx:Q}=this._processInputParams(X);if(Q.parsedType!==n.object)return d(Q,{code:m.invalid_type,expected:n.object,received:Q.parsedType}),G0;let J=this.discriminator,Y=Q.data[J],G=this.optionsMap.get(Y);if(!G)return d(Q,{code:m.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[J]}),G0;if(Q.common.async)return G._parseAsync({data:Q.data,path:Q.path,parent:Q});else return G._parseSync({data:Q.data,path:Q.path,parent:Q})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(X,Q,J){let Y=new Map;for(let G of Q){let $=N1(G.shape[X]);if(!$.length)throw Error(`A discriminator value for key \`${X}\` could not be extracted from all schema options`);for(let W of $){if(Y.has(W))throw Error(`Discriminator property ${String(X)} has duplicate value ${String(W)}`);Y.set(W,G)}}return new hX({typeName:$0.ZodDiscriminatedUnion,discriminator:X,options:Q,optionsMap:Y,...H0(J)})}}function TX(X,Q){let J=C1(X),Y=C1(Q);if(X===Q)return{valid:!0,data:X};else if(J===n.object&&Y===n.object){let G=V0.objectKeys(Q),$=V0.objectKeys(X).filter((H)=>G.indexOf(H)!==-1),W={...X,...Q};for(let H of $){let U=TX(X[H],Q[H]);if(!U.valid)return{valid:!1};W[H]=U.data}return{valid:!0,data:W}}else if(J===n.array&&Y===n.array){if(X.length!==Q.length)return{valid:!1};let G=[];for(let $=0;$<X.length;$++){let W=X[$],H=Q[$],U=TX(W,H);if(!U.valid)return{valid:!1};G.push(U.data)}return{valid:!0,data:G}}else if(J===n.date&&Y===n.date&&+X===+Q)return{valid:!0,data:X};else return{valid:!1}}class n9 extends L0{_parse(X){let{status:Q,ctx:J}=this._processInputParams(X),Y=(G,$)=>{if(J5(G)||J5($))return G0;let W=TX(G.value,$.value);if(!W.valid)return d(J,{code:m.invalid_intersection_types}),G0;if(Y5(G)||Y5($))Q.dirty();return{status:Q.value,value:W.data}};if(J.common.async)return Promise.all([this._def.left._parseAsync({data:J.data,path:J.path,parent:J}),this._def.right._parseAsync({data:J.data,path:J.path,parent:J})]).then(([G,$])=>Y(G,$));else return Y(this._def.left._parseSync({data:J.data,path:J.path,parent:J}),this._def.right._parseSync({data:J.data,path:J.path,parent:J}))}}n9.create=(X,Q,J)=>{return new n9({left:X,right:Q,typeName:$0.ZodIntersection,...H0(J)})};class P1 extends L0{_parse(X){let{status:Q,ctx:J}=this._processInputParams(X);if(J.parsedType!==n.array)return d(J,{code:m.invalid_type,expected:n.array,received:J.parsedType}),G0;if(J.data.length<this._def.items.length)return d(J,{code:m.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),G0;if(!this._def.rest&&J.data.length>this._def.items.length)d(J,{code:m.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Q.dirty();let G=[...J.data].map(($,W)=>{let H=this._def.items[W]||this._def.rest;if(!H)return null;return H._parse(new $1(J,$,J.path,W))}).filter(($)=>!!$);if(J.common.async)return Promise.all(G).then(($)=>{return d0.mergeArray(Q,$)});else return d0.mergeArray(Q,G)}get items(){return this._def.items}rest(X){return new P1({...this._def,rest:X})}}P1.create=(X,Q)=>{if(!Array.isArray(X))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new P1({items:X,typeName:$0.ZodTuple,rest:null,...H0(Q)})};class a8 extends L0{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(X){let{status:Q,ctx:J}=this._processInputParams(X);if(J.parsedType!==n.object)return d(J,{code:m.invalid_type,expected:n.object,received:J.parsedType}),G0;let Y=[],G=this._def.keyType,$=this._def.valueType;for(let W in J.data)Y.push({key:G._parse(new $1(J,W,J.path,W)),value:$._parse(new $1(J,J.data[W],J.path,W)),alwaysSet:W in J.data});if(J.common.async)return d0.mergeObjectAsync(Q,Y);else return d0.mergeObjectSync(Q,Y)}get element(){return this._def.valueType}static create(X,Q,J){if(Q instanceof L0)return new a8({keyType:X,valueType:Q,typeName:$0.ZodRecord,...H0(J)});return new a8({keyType:j1.create(),valueType:X,typeName:$0.ZodRecord,...H0(Q)})}}class s8 extends L0{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(X){let{status:Q,ctx:J}=this._processInputParams(X);if(J.parsedType!==n.map)return d(J,{code:m.invalid_type,expected:n.map,received:J.parsedType}),G0;let Y=this._def.keyType,G=this._def.valueType,$=[...J.data.entries()].map(([W,H],U)=>{return{key:Y._parse(new $1(J,W,J.path,[U,"key"])),value:G._parse(new $1(J,H,J.path,[U,"value"]))}});if(J.common.async){let W=new Map;return Promise.resolve().then(async()=>{for(let H of $){let U=await H.key,B=await H.value;if(U.status==="aborted"||B.status==="aborted")return G0;if(U.status==="dirty"||B.status==="dirty")Q.dirty();W.set(U.value,B.value)}return{status:Q.value,value:W}})}else{let W=new Map;for(let H of $){let{key:U,value:B}=H;if(U.status==="aborted"||B.status==="aborted")return G0;if(U.status==="dirty"||B.status==="dirty")Q.dirty();W.set(U.value,B.value)}return{status:Q.value,value:W}}}}s8.create=(X,Q,J)=>{return new s8({valueType:Q,keyType:X,typeName:$0.ZodMap,...H0(J)})};class L9 extends L0{_parse(X){let{status:Q,ctx:J}=this._processInputParams(X);if(J.parsedType!==n.set)return d(J,{code:m.invalid_type,expected:n.set,received:J.parsedType}),G0;let Y=this._def;if(Y.minSize!==null){if(J.data.size<Y.minSize.value)d(J,{code:m.too_small,minimum:Y.minSize.value,type:"set",inclusive:!0,exact:!1,message:Y.minSize.message}),Q.dirty()}if(Y.maxSize!==null){if(J.data.size>Y.maxSize.value)d(J,{code:m.too_big,maximum:Y.maxSize.value,type:"set",inclusive:!0,exact:!1,message:Y.maxSize.message}),Q.dirty()}let G=this._def.valueType;function $(H){let U=new Set;for(let B of H){if(B.status==="aborted")return G0;if(B.status==="dirty")Q.dirty();U.add(B.value)}return{status:Q.value,value:U}}let W=[...J.data.values()].map((H,U)=>G._parse(new $1(J,H,J.path,U)));if(J.common.async)return Promise.all(W).then((H)=>$(H));else return $(W)}min(X,Q){return new L9({...this._def,minSize:{value:X,message:o.toString(Q)}})}max(X,Q){return new L9({...this._def,maxSize:{value:X,message:o.toString(Q)}})}size(X,Q){return this.min(X,Q).max(X,Q)}nonempty(X){return this.min(1,X)}}L9.create=(X,Q)=>{return new L9({valueType:X,minSize:null,maxSize:null,typeName:$0.ZodSet,...H0(Q)})};class u9 extends L0{constructor(){super(...arguments);this.validate=this.implement}_parse(X){let{ctx:Q}=this._processInputParams(X);if(Q.parsedType!==n.function)return d(Q,{code:m.invalid_type,expected:n.function,received:Q.parsedType}),G0;function J(W,H){return PX({data:W,path:Q.path,errorMaps:[Q.common.contextualErrorMap,Q.schemaErrorMap,wX(),l9].filter((U)=>!!U),issueData:{code:m.invalid_arguments,argumentsError:H}})}function Y(W,H){return PX({data:W,path:Q.path,errorMaps:[Q.common.contextualErrorMap,Q.schemaErrorMap,wX(),l9].filter((U)=>!!U),issueData:{code:m.invalid_return_type,returnTypeError:H}})}let G={errorMap:Q.common.contextualErrorMap},$=Q.data;if(this._def.returns instanceof q9){let W=this;return n0(async function(...H){let U=new e0([]),B=await W._def.args.parseAsync(H,G).catch((V)=>{throw U.addIssue(J(H,V)),U}),q=await Reflect.apply($,this,B);return await W._def.returns._def.type.parseAsync(q,G).catch((V)=>{throw U.addIssue(Y(q,V)),U})})}else{let W=this;return n0(function(...H){let U=W._def.args.safeParse(H,G);if(!U.success)throw new e0([J(H,U.error)]);let B=Reflect.apply($,this,U.data),q=W._def.returns.safeParse(B,G);if(!q.success)throw new e0([Y(B,q.error)]);return q.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...X){return new u9({...this._def,args:P1.create(X).rest(n1.create())})}returns(X){return new u9({...this._def,returns:X})}implement(X){return this.parse(X)}strictImplement(X){return this.parse(X)}static create(X,Q,J){return new u9({args:X?X:P1.create([]).rest(n1.create()),returns:Q||n1.create(),typeName:$0.ZodFunction,...H0(J)})}}class r9 extends L0{get schema(){return this._def.getter()}_parse(X){let{ctx:Q}=this._processInputParams(X);return this._def.getter()._parse({data:Q.data,path:Q.path,parent:Q})}}r9.create=(X,Q)=>{return new r9({getter:X,typeName:$0.ZodLazy,...H0(Q)})};class o9 extends L0{_parse(X){if(X.data!==this._def.value){let Q=this._getOrReturnCtx(X);return d(Q,{received:Q.data,code:m.invalid_literal,expected:this._def.value}),G0}return{status:"valid",value:X.data}}get value(){return this._def.value}}o9.create=(X,Q)=>{return new o9({value:X,typeName:$0.ZodLiteral,...H0(Q)})};function XJ(X,Q){return new r1({values:X,typeName:$0.ZodEnum,...H0(Q)})}class r1 extends L0{_parse(X){if(typeof X.data!=="string"){let Q=this._getOrReturnCtx(X),J=this._def.values;return d(Q,{expected:V0.joinValues(J),received:Q.parsedType,code:m.invalid_type}),G0}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(X.data)){let Q=this._getOrReturnCtx(X),J=this._def.values;return d(Q,{received:Q.data,code:m.invalid_enum_value,options:J}),G0}return n0(X.data)}get options(){return this._def.values}get enum(){let X={};for(let Q of this._def.values)X[Q]=Q;return X}get Values(){let X={};for(let Q of this._def.values)X[Q]=Q;return X}get Enum(){let X={};for(let Q of this._def.values)X[Q]=Q;return X}extract(X,Q=this._def){return r1.create(X,{...this._def,...Q})}exclude(X,Q=this._def){return r1.create(this.options.filter((J)=>!X.includes(J)),{...this._def,...Q})}}r1.create=XJ;class a9 extends L0{_parse(X){let Q=V0.getValidEnumValues(this._def.values),J=this._getOrReturnCtx(X);if(J.parsedType!==n.string&&J.parsedType!==n.number){let Y=V0.objectValues(Q);return d(J,{expected:V0.joinValues(Y),received:J.parsedType,code:m.invalid_type}),G0}if(!this._cache)this._cache=new Set(V0.getValidEnumValues(this._def.values));if(!this._cache.has(X.data)){let Y=V0.objectValues(Q);return d(J,{received:J.data,code:m.invalid_enum_value,options:Y}),G0}return n0(X.data)}get enum(){return this._def.values}}a9.create=(X,Q)=>{return new a9({values:X,typeName:$0.ZodNativeEnum,...H0(Q)})};class q9 extends L0{unwrap(){return this._def.type}_parse(X){let{ctx:Q}=this._processInputParams(X);if(Q.parsedType!==n.promise&&Q.common.async===!1)return d(Q,{code:m.invalid_type,expected:n.promise,received:Q.parsedType}),G0;let J=Q.parsedType===n.promise?Q.data:Promise.resolve(Q.data);return n0(J.then((Y)=>{return this._def.type.parseAsync(Y,{path:Q.path,errorMap:Q.common.contextualErrorMap})}))}}q9.create=(X,Q)=>{return new q9({type:X,typeName:$0.ZodPromise,...H0(Q)})};class M1 extends L0{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===$0.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(X){let{status:Q,ctx:J}=this._processInputParams(X),Y=this._def.effect||null,G={addIssue:($)=>{if(d(J,$),$.fatal)Q.abort();else Q.dirty()},get path(){return J.path}};if(G.addIssue=G.addIssue.bind(G),Y.type==="preprocess"){let $=Y.transform(J.data,G);if(J.common.async)return Promise.resolve($).then(async(W)=>{if(Q.value==="aborted")return G0;let H=await this._def.schema._parseAsync({data:W,path:J.path,parent:J});if(H.status==="aborted")return G0;if(H.status==="dirty")return h9(H.value);if(Q.value==="dirty")return h9(H.value);return H});else{if(Q.value==="aborted")return G0;let W=this._def.schema._parseSync({data:$,path:J.path,parent:J});if(W.status==="aborted")return G0;if(W.status==="dirty")return h9(W.value);if(Q.value==="dirty")return h9(W.value);return W}}if(Y.type==="refinement"){let $=(W)=>{let H=Y.refinement(W,G);if(J.common.async)return Promise.resolve(H);if(H instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return W};if(J.common.async===!1){let W=this._def.schema._parseSync({data:J.data,path:J.path,parent:J});if(W.status==="aborted")return G0;if(W.status==="dirty")Q.dirty();return $(W.value),{status:Q.value,value:W.value}}else return this._def.schema._parseAsync({data:J.data,path:J.path,parent:J}).then((W)=>{if(W.status==="aborted")return G0;if(W.status==="dirty")Q.dirty();return $(W.value).then(()=>{return{status:Q.value,value:W.value}})})}if(Y.type==="transform")if(J.common.async===!1){let $=this._def.schema._parseSync({data:J.data,path:J.path,parent:J});if(!U9($))return G0;let W=Y.transform($.value,G);if(W instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:Q.value,value:W}}else return this._def.schema._parseAsync({data:J.data,path:J.path,parent:J}).then(($)=>{if(!U9($))return G0;return Promise.resolve(Y.transform($.value,G)).then((W)=>({status:Q.value,value:W}))});V0.assertNever(Y)}}M1.create=(X,Q,J)=>{return new M1({schema:X,typeName:$0.ZodEffects,effect:Q,...H0(J)})};M1.createWithPreprocess=(X,Q,J)=>{return new M1({schema:Q,effect:{type:"preprocess",transform:X},typeName:$0.ZodEffects,...H0(J)})};class K1 extends L0{_parse(X){if(this._getType(X)===n.undefined)return n0(void 0);return this._def.innerType._parse(X)}unwrap(){return this._def.innerType}}K1.create=(X,Q)=>{return new K1({innerType:X,typeName:$0.ZodOptional,...H0(Q)})};class k1 extends L0{_parse(X){if(this._getType(X)===n.null)return n0(null);return this._def.innerType._parse(X)}unwrap(){return this._def.innerType}}k1.create=(X,Q)=>{return new k1({innerType:X,typeName:$0.ZodNullable,...H0(Q)})};class s9 extends L0{_parse(X){let{ctx:Q}=this._processInputParams(X),J=Q.data;if(Q.parsedType===n.undefined)J=this._def.defaultValue();return this._def.innerType._parse({data:J,path:Q.path,parent:Q})}removeDefault(){return this._def.innerType}}s9.create=(X,Q)=>{return new s9({innerType:X,typeName:$0.ZodDefault,defaultValue:typeof Q.default==="function"?Q.default:()=>Q.default,...H0(Q)})};class t9 extends L0{_parse(X){let{ctx:Q}=this._processInputParams(X),J={...Q,common:{...Q.common,issues:[]}},Y=this._def.innerType._parse({data:J.data,path:J.path,parent:{...J}});if(d8(Y))return Y.then((G)=>{return{status:"valid",value:G.status==="valid"?G.value:this._def.catchValue({get error(){return new e0(J.common.issues)},input:J.data})}});else return{status:"valid",value:Y.status==="valid"?Y.value:this._def.catchValue({get error(){return new e0(J.common.issues)},input:J.data})}}removeCatch(){return this._def.innerType}}t9.create=(X,Q)=>{return new t9({innerType:X,typeName:$0.ZodCatch,catchValue:typeof Q.catch==="function"?Q.catch:()=>Q.catch,...H0(Q)})};class t8 extends L0{_parse(X){if(this._getType(X)!==n.nan){let J=this._getOrReturnCtx(X);return d(J,{code:m.invalid_type,expected:n.nan,received:J.parsedType}),G0}return{status:"valid",value:X.data}}}t8.create=(X)=>{return new t8({typeName:$0.ZodNaN,...H0(X)})};var gw=Symbol("zod_brand");class fX extends L0{_parse(X){let{ctx:Q}=this._processInputParams(X),J=Q.data;return this._def.type._parse({data:J,path:Q.path,parent:Q})}unwrap(){return this._def.type}}class H6 extends L0{_parse(X){let{status:Q,ctx:J}=this._processInputParams(X);if(J.common.async)return(async()=>{let G=await this._def.in._parseAsync({data:J.data,path:J.path,parent:J});if(G.status==="aborted")return G0;if(G.status==="dirty")return Q.dirty(),h9(G.value);else return this._def.out._parseAsync({data:G.value,path:J.path,parent:J})})();else{let Y=this._def.in._parseSync({data:J.data,path:J.path,parent:J});if(Y.status==="aborted")return G0;if(Y.status==="dirty")return Q.dirty(),{status:"dirty",value:Y.value};else return this._def.out._parseSync({data:Y.value,path:J.path,parent:J})}}static create(X,Q){return new H6({in:X,out:Q,typeName:$0.ZodPipeline})}}class e9 extends L0{_parse(X){let Q=this._def.innerType._parse(X),J=(Y)=>{if(U9(Y))Y.value=Object.freeze(Y.value);return Y};return d8(Q)?Q.then((Y)=>J(Y)):J(Q)}unwrap(){return this._def.innerType}}e9.create=(X,Q)=>{return new e9({innerType:X,typeName:$0.ZodReadonly,...H0(Q)})};var hw={object:C0.lazycreate},$0;(function(X){X.ZodString="ZodString",X.ZodNumber="ZodNumber",X.ZodNaN="ZodNaN",X.ZodBigInt="ZodBigInt",X.ZodBoolean="ZodBoolean",X.ZodDate="ZodDate",X.ZodSymbol="ZodSymbol",X.ZodUndefined="ZodUndefined",X.ZodNull="ZodNull",X.ZodAny="ZodAny",X.ZodUnknown="ZodUnknown",X.ZodNever="ZodNever",X.ZodVoid="ZodVoid",X.ZodArray="ZodArray",X.ZodObject="ZodObject",X.ZodUnion="ZodUnion",X.ZodDiscriminatedUnion="ZodDiscriminatedUnion",X.ZodIntersection="ZodIntersection",X.ZodTuple="ZodTuple",X.ZodRecord="ZodRecord",X.ZodMap="ZodMap",X.ZodSet="ZodSet",X.ZodFunction="ZodFunction",X.ZodLazy="ZodLazy",X.ZodLiteral="ZodLiteral",X.ZodEnum="ZodEnum",X.ZodEffects="ZodEffects",X.ZodNativeEnum="ZodNativeEnum",X.ZodOptional="ZodOptional",X.ZodNullable="ZodNullable",X.ZodDefault="ZodDefault",X.ZodCatch="ZodCatch",X.ZodPromise="ZodPromise",X.ZodBranded="ZodBranded",X.ZodPipeline="ZodPipeline",X.ZodReadonly="ZodReadonly"})($0||($0={}));var fw=j1.create,uw=B9.create,mw=t8.create,lw=z9.create,cw=i8.create,pw=c9.create,dw=n8.create,iw=p9.create,nw=d9.create,rw=r8.create,ow=n1.create,aw=w1.create,sw=o8.create,tw=F1.create,ew=C0.create,XP=C0.strictCreate,QP=i9.create,JP=hX.create,YP=n9.create,GP=P1.create,$P=a8.create,WP=s8.create,HP=L9.create,UP=u9.create,BP=r9.create,zP=o9.create,LP=r1.create,qP=a9.create,FP=q9.create,KP=M1.create,VP=K1.create,MP=k1.create,DP=M1.createWithPreprocess,ZP=H6.create,OP=Object.freeze({status:"aborted"});function y(X,Q,J){function Y(H,U){var B;Object.defineProperty(H,"_zod",{value:H._zod??{},enumerable:!1}),(B=H._zod).traits??(B.traits=new Set),H._zod.traits.add(X),Q(H,U);for(let q in W.prototype)if(!(q in H))Object.defineProperty(H,q,{value:W.prototype[q].bind(H)});H._zod.constr=W,H._zod.def=U}let G=J?.Parent??Object;class $ extends G{}Object.defineProperty($,"name",{value:X});function W(H){var U;let B=J?.Parent?new $:this;Y(B,H),(U=B._zod).deferred??(U.deferred=[]);for(let q of B._zod.deferred)q();return B}return Object.defineProperty(W,"init",{value:Y}),Object.defineProperty(W,Symbol.hasInstance,{value:(H)=>{if(J?.Parent&&H instanceof J.Parent)return!0;return H?._zod?.traits?.has(X)}}),Object.defineProperty(W,"name",{value:X}),W}var AP=Symbol("zod_brand");class F9 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}var SX={};function T1(X){if(X)Object.assign(SX,X);return SX}var N0={};w5(N0,{unwrapMessage:()=>f9,stringifyPrimitive:()=>lX,required:()=>Jz,randomString:()=>dB,propertyKeyTypes:()=>$J,promiseAllObject:()=>pB,primitiveTypes:()=>rB,prefixIssues:()=>_1,pick:()=>sB,partial:()=>Qz,optionalKeys:()=>WJ,omit:()=>tB,numKeys:()=>iB,nullish:()=>B6,normalizeParams:()=>J0,merge:()=>Xz,jsonStringifyReplacer:()=>JJ,joinValues:()=>EX,issue:()=>UJ,isPlainObject:()=>Q8,isObject:()=>X8,getSizableOrigin:()=>Yz,getParsedType:()=>nB,getLengthableOrigin:()=>L6,getEnumValues:()=>QJ,getElementAtPath:()=>cB,floatSafeRemainder:()=>YJ,finalizeIssue:()=>S1,extend:()=>eB,escapeRegex:()=>Z9,esc:()=>$9,defineLazy:()=>R0,createTransparentProxy:()=>oB,clone:()=>y1,cleanRegex:()=>z6,cleanEnum:()=>Gz,captureStackTrace:()=>mX,cached:()=>U6,assignProp:()=>uX,assertNotEqual:()=>fB,assertNever:()=>mB,assertIs:()=>uB,assertEqual:()=>hB,assert:()=>lB,allowsEval:()=>GJ,aborted:()=>H9,NUMBER_FORMAT_RANGES:()=>HJ,Class:()=>BJ,BIGINT_FORMAT_RANGES:()=>aB});function hB(X){return X}function fB(X){return X}function uB(X){}function mB(X){throw Error()}function lB(X){}function QJ(X){let Q=Object.values(X).filter((Y)=>typeof Y==="number");return Object.entries(X).filter(([Y,G])=>Q.indexOf(+Y)===-1).map(([Y,G])=>G)}function EX(X,Q="|"){return X.map((J)=>lX(J)).join(Q)}function JJ(X,Q){if(typeof Q==="bigint")return Q.toString();return Q}function U6(X){return{get value(){{let J=X();return Object.defineProperty(this,"value",{value:J}),J}throw Error("cached value already set")}}}function B6(X){return X===null||X===void 0}function z6(X){let Q=X.startsWith("^")?1:0,J=X.endsWith("$")?X.length-1:X.length;return X.slice(Q,J)}function YJ(X,Q){let J=(X.toString().split(".")[1]||"").length,Y=(Q.toString().split(".")[1]||"").length,G=J>Y?J:Y,$=Number.parseInt(X.toFixed(G).replace(".","")),W=Number.parseInt(Q.toFixed(G).replace(".",""));return $%W/10**G}function R0(X,Q,J){Object.defineProperty(X,Q,{get(){{let G=J();return X[Q]=G,G}throw Error("cached value already set")},set(G){Object.defineProperty(X,Q,{value:G})},configurable:!0})}function uX(X,Q,J){Object.defineProperty(X,Q,{value:J,writable:!0,enumerable:!0,configurable:!0})}function cB(X,Q){if(!Q)return X;return Q.reduce((J,Y)=>J?.[Y],X)}function pB(X){let Q=Object.keys(X),J=Q.map((Y)=>X[Y]);return Promise.all(J).then((Y)=>{let G={};for(let $=0;$<Q.length;$++)G[Q[$]]=Y[$];return G})}function dB(X=10){let J="";for(let Y=0;Y<X;Y++)J+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return J}function $9(X){return JSON.stringify(X)}var mX=Error.captureStackTrace?Error.captureStackTrace:(...X)=>{};function X8(X){return typeof X==="object"&&X!==null&&!Array.isArray(X)}var GJ=U6(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(X){return!1}});function Q8(X){if(X8(X)===!1)return!1;let Q=X.constructor;if(Q===void 0)return!0;let J=Q.prototype;if(X8(J)===!1)return!1;if(Object.prototype.hasOwnProperty.call(J,"isPrototypeOf")===!1)return!1;return!0}function iB(X){let Q=0;for(let J in X)if(Object.prototype.hasOwnProperty.call(X,J))Q++;return Q}var nB=(X)=>{let Q=typeof X;switch(Q){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(X)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(X))return"array";if(X===null)return"null";if(X.then&&typeof X.then==="function"&&X.catch&&typeof X.catch==="function")return"promise";if(typeof Map<"u"&&X instanceof Map)return"map";if(typeof Set<"u"&&X instanceof Set)return"set";if(typeof Date<"u"&&X instanceof Date)return"date";if(typeof File<"u"&&X instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${Q}`)}},$J=new Set(["string","number","symbol"]),rB=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Z9(X){return X.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function y1(X,Q,J){let Y=new X._zod.constr(Q??X._zod.def);if(!Q||J?.parent)Y._zod.parent=X;return Y}function J0(X){let Q=X;if(!Q)return{};if(typeof Q==="string")return{error:()=>Q};if(Q?.message!==void 0){if(Q?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");Q.error=Q.message}if(delete Q.message,typeof Q.error==="string")return{...Q,error:()=>Q.error};return Q}function oB(X){let Q;return new Proxy({},{get(J,Y,G){return Q??(Q=X()),Reflect.get(Q,Y,G)},set(J,Y,G,$){return Q??(Q=X()),Reflect.set(Q,Y,G,$)},has(J,Y){return Q??(Q=X()),Reflect.has(Q,Y)},deleteProperty(J,Y){return Q??(Q=X()),Reflect.deleteProperty(Q,Y)},ownKeys(J){return Q??(Q=X()),Reflect.ownKeys(Q)},getOwnPropertyDescriptor(J,Y){return Q??(Q=X()),Reflect.getOwnPropertyDescriptor(Q,Y)},defineProperty(J,Y,G){return Q??(Q=X()),Reflect.defineProperty(Q,Y,G)}})}function lX(X){if(typeof X==="bigint")return X.toString()+"n";if(typeof X==="string")return`"${X}"`;return`${X}`}function WJ(X){return Object.keys(X).filter((Q)=>{return X[Q]._zod.optin==="optional"&&X[Q]._zod.optout==="optional"})}var HJ={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},aB={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function sB(X,Q){let J={},Y=X._zod.def;for(let G in Q){if(!(G in Y.shape))throw Error(`Unrecognized key: "${G}"`);if(!Q[G])continue;J[G]=Y.shape[G]}return y1(X,{...X._zod.def,shape:J,checks:[]})}function tB(X,Q){let J={...X._zod.def.shape},Y=X._zod.def;for(let G in Q){if(!(G in Y.shape))throw Error(`Unrecognized key: "${G}"`);if(!Q[G])continue;delete J[G]}return y1(X,{...X._zod.def,shape:J,checks:[]})}function eB(X,Q){if(!Q8(Q))throw Error("Invalid input to extend: expected a plain object");let J={...X._zod.def,get shape(){let Y={...X._zod.def.shape,...Q};return uX(this,"shape",Y),Y},checks:[]};return y1(X,J)}function Xz(X,Q){return y1(X,{...X._zod.def,get shape(){let J={...X._zod.def.shape,...Q._zod.def.shape};return uX(this,"shape",J),J},catchall:Q._zod.def.catchall,checks:[]})}function Qz(X,Q,J){let Y=Q._zod.def.shape,G={...Y};if(J)for(let $ in J){if(!($ in Y))throw Error(`Unrecognized key: "${$}"`);if(!J[$])continue;G[$]=X?new X({type:"optional",innerType:Y[$]}):Y[$]}else for(let $ in Y)G[$]=X?new X({type:"optional",innerType:Y[$]}):Y[$];return y1(Q,{...Q._zod.def,shape:G,checks:[]})}function Jz(X,Q,J){let Y=Q._zod.def.shape,G={...Y};if(J)for(let $ in J){if(!($ in G))throw Error(`Unrecognized key: "${$}"`);if(!J[$])continue;G[$]=new X({type:"nonoptional",innerType:Y[$]})}else for(let $ in Y)G[$]=new X({type:"nonoptional",innerType:Y[$]});return y1(Q,{...Q._zod.def,shape:G,checks:[]})}function H9(X,Q=0){for(let J=Q;J<X.issues.length;J++)if(X.issues[J]?.continue!==!0)return!0;return!1}function _1(X,Q){return Q.map((J)=>{var Y;return(Y=J).path??(Y.path=[]),J.path.unshift(X),J})}function f9(X){return typeof X==="string"?X:X?.message}function S1(X,Q,J){let Y={...X,path:X.path??[]};if(!X.message){let G=f9(X.inst?._zod.def?.error?.(X))??f9(Q?.error?.(X))??f9(J.customError?.(X))??f9(J.localeError?.(X))??"Invalid input";Y.message=G}if(delete Y.inst,delete Y.continue,!Q?.reportInput)delete Y.input;return Y}function Yz(X){if(X instanceof Set)return"set";if(X instanceof Map)return"map";if(X instanceof File)return"file";return"unknown"}function L6(X){if(Array.isArray(X))return"array";if(typeof X==="string")return"string";return"unknown"}function UJ(...X){let[Q,J,Y]=X;if(typeof Q==="string")return{message:Q,code:"custom",input:J,inst:Y};return{...Q}}function Gz(X){return Object.entries(X).filter(([Q,J])=>{return Number.isNaN(Number.parseInt(Q,10))}).map((Q)=>Q[1])}class BJ{constructor(...X){}}var zJ=(X,Q)=>{X.name="$ZodError",Object.defineProperty(X,"_zod",{value:X._zod,enumerable:!1}),Object.defineProperty(X,"issues",{value:Q,enumerable:!1}),Object.defineProperty(X,"message",{get(){return JSON.stringify(Q,JJ,2)},enumerable:!0})},LJ=y("$ZodError",zJ),qJ=y("$ZodError",zJ,{Parent:Error});function $z(X,Q=(J)=>J.message){let J={},Y=[];for(let G of X.issues)if(G.path.length>0)J[G.path[0]]=J[G.path[0]]||[],J[G.path[0]].push(Q(G));else Y.push(Q(G));return{formErrors:Y,fieldErrors:J}}function Wz(X,Q){let J=Q||function($){return $.message},Y={_errors:[]},G=($)=>{for(let W of $.issues)if(W.code==="invalid_union"&&W.errors.length)W.errors.map((H)=>G({issues:H}));else if(W.code==="invalid_key")G({issues:W.issues});else if(W.code==="invalid_element")G({issues:W.issues});else if(W.path.length===0)Y._errors.push(J(W));else{let H=Y,U=0;while(U<W.path.length){let B=W.path[U];if(U!==W.path.length-1)H[B]=H[B]||{_errors:[]};else H[B]=H[B]||{_errors:[]},H[B]._errors.push(J(W));H=H[B],U++}}};return G(X),Y}var Hz=(X)=>(Q,J,Y,G)=>{let $=Y?Object.assign(Y,{async:!1}):{async:!1},W=Q._zod.run({value:J,issues:[]},$);if(W instanceof Promise)throw new F9;if(W.issues.length){let H=new(G?.Err??X)(W.issues.map((U)=>S1(U,$,T1())));throw mX(H,G?.callee),H}return W.value};var Uz=(X)=>async(Q,J,Y,G)=>{let $=Y?Object.assign(Y,{async:!0}):{async:!0},W=Q._zod.run({value:J,issues:[]},$);if(W instanceof Promise)W=await W;if(W.issues.length){let H=new(G?.Err??X)(W.issues.map((U)=>S1(U,$,T1())));throw mX(H,G?.callee),H}return W.value};var FJ=(X)=>(Q,J,Y)=>{let G=Y?{...Y,async:!1}:{async:!1},$=Q._zod.run({value:J,issues:[]},G);if($ instanceof Promise)throw new F9;return $.issues.length?{success:!1,error:new(X??LJ)($.issues.map((W)=>S1(W,G,T1())))}:{success:!0,data:$.value}},Bz=FJ(qJ),KJ=(X)=>async(Q,J,Y)=>{let G=Y?Object.assign(Y,{async:!0}):{async:!0},$=Q._zod.run({value:J,issues:[]},G);if($ instanceof Promise)$=await $;return $.issues.length?{success:!1,error:new X($.issues.map((W)=>S1(W,G,T1())))}:{success:!0,data:$.value}},zz=KJ(qJ),Lz=/^[cC][^\s-]{8,}$/,qz=/^[0-9a-z]+$/,Fz=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Kz=/^[0-9a-vA-V]{20}$/,Vz=/^[A-Za-z0-9]{27}$/,Mz=/^[a-zA-Z0-9_-]{21}$/,Dz=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Zz=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,$5=(X)=>{if(!X)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${X}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},Oz=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Az="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Nz(){return new RegExp(Az,"u")}var Rz=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Iz=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,jz=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,wz=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Pz=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,VJ=/^[A-Za-z0-9_-]*$/,Tz=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,Sz=/^\+(?:[0-9]){6,14}[0-9]$/,MJ="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Ez=new RegExp(`^${MJ}$`);function DJ(X){return typeof X.precision==="number"?X.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":X.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${X.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function bz(X){return new RegExp(`^${DJ(X)}$`)}function Cz(X){let Q=DJ({precision:X.precision}),J=["Z"];if(X.local)J.push("");if(X.offset)J.push("([+-]\\d{2}:\\d{2})");let Y=`${Q}(?:${J.join("|")})`;return new RegExp(`^${MJ}T(?:${Y})$`)}var _z=(X)=>{let Q=X?`[\\s\\S]{${X?.minimum??0},${X?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${Q}$`)},kz=/^\d+$/,vz=/^-?\d+(?:\.\d+)?/i,yz=/true|false/i,xz=/null/i,gz=/^[^A-Z]*$/,hz=/^[^a-z]*$/,r0=y("$ZodCheck",(X,Q)=>{var J;X._zod??(X._zod={}),X._zod.def=Q,(J=X._zod).onattach??(J.onattach=[])}),ZJ={number:"number",bigint:"bigint",object:"date"},OJ=y("$ZodCheckLessThan",(X,Q)=>{r0.init(X,Q);let J=ZJ[typeof Q.value];X._zod.onattach.push((Y)=>{let G=Y._zod.bag,$=(Q.inclusive?G.maximum:G.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(Q.value<$)if(Q.inclusive)G.maximum=Q.value;else G.exclusiveMaximum=Q.value}),X._zod.check=(Y)=>{if(Q.inclusive?Y.value<=Q.value:Y.value<Q.value)return;Y.issues.push({origin:J,code:"too_big",maximum:Q.value,input:Y.value,inclusive:Q.inclusive,inst:X,continue:!Q.abort})}}),AJ=y("$ZodCheckGreaterThan",(X,Q)=>{r0.init(X,Q);let J=ZJ[typeof Q.value];X._zod.onattach.push((Y)=>{let G=Y._zod.bag,$=(Q.inclusive?G.minimum:G.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(Q.value>$)if(Q.inclusive)G.minimum=Q.value;else G.exclusiveMinimum=Q.value}),X._zod.check=(Y)=>{if(Q.inclusive?Y.value>=Q.value:Y.value>Q.value)return;Y.issues.push({origin:J,code:"too_small",minimum:Q.value,input:Y.value,inclusive:Q.inclusive,inst:X,continue:!Q.abort})}}),fz=y("$ZodCheckMultipleOf",(X,Q)=>{r0.init(X,Q),X._zod.onattach.push((J)=>{var Y;(Y=J._zod.bag).multipleOf??(Y.multipleOf=Q.value)}),X._zod.check=(J)=>{if(typeof J.value!==typeof Q.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof J.value==="bigint"?J.value%Q.value===BigInt(0):YJ(J.value,Q.value)===0)return;J.issues.push({origin:typeof J.value,code:"not_multiple_of",divisor:Q.value,input:J.value,inst:X,continue:!Q.abort})}}),uz=y("$ZodCheckNumberFormat",(X,Q)=>{r0.init(X,Q),Q.format=Q.format||"float64";let J=Q.format?.includes("int"),Y=J?"int":"number",[G,$]=HJ[Q.format];X._zod.onattach.push((W)=>{let H=W._zod.bag;if(H.format=Q.format,H.minimum=G,H.maximum=$,J)H.pattern=kz}),X._zod.check=(W)=>{let H=W.value;if(J){if(!Number.isInteger(H)){W.issues.push({expected:Y,format:Q.format,code:"invalid_type",input:H,inst:X});return}if(!Number.isSafeInteger(H)){if(H>0)W.issues.push({input:H,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:X,origin:Y,continue:!Q.abort});else W.issues.push({input:H,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:X,origin:Y,continue:!Q.abort});return}}if(H<G)W.issues.push({origin:"number",input:H,code:"too_small",minimum:G,inclusive:!0,inst:X,continue:!Q.abort});if(H>$)W.issues.push({origin:"number",input:H,code:"too_big",maximum:$,inst:X})}}),mz=y("$ZodCheckMaxLength",(X,Q)=>{r0.init(X,Q),X._zod.when=(J)=>{let Y=J.value;return!B6(Y)&&Y.length!==void 0},X._zod.onattach.push((J)=>{let Y=J._zod.bag.maximum??Number.POSITIVE_INFINITY;if(Q.maximum<Y)J._zod.bag.maximum=Q.maximum}),X._zod.check=(J)=>{let Y=J.value;if(Y.length<=Q.maximum)return;let $=L6(Y);J.issues.push({origin:$,code:"too_big",maximum:Q.maximum,inclusive:!0,input:Y,inst:X,continue:!Q.abort})}}),lz=y("$ZodCheckMinLength",(X,Q)=>{r0.init(X,Q),X._zod.when=(J)=>{let Y=J.value;return!B6(Y)&&Y.length!==void 0},X._zod.onattach.push((J)=>{let Y=J._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(Q.minimum>Y)J._zod.bag.minimum=Q.minimum}),X._zod.check=(J)=>{let Y=J.value;if(Y.length>=Q.minimum)return;let $=L6(Y);J.issues.push({origin:$,code:"too_small",minimum:Q.minimum,inclusive:!0,input:Y,inst:X,continue:!Q.abort})}}),cz=y("$ZodCheckLengthEquals",(X,Q)=>{r0.init(X,Q),X._zod.when=(J)=>{let Y=J.value;return!B6(Y)&&Y.length!==void 0},X._zod.onattach.push((J)=>{let Y=J._zod.bag;Y.minimum=Q.length,Y.maximum=Q.length,Y.length=Q.length}),X._zod.check=(J)=>{let Y=J.value,G=Y.length;if(G===Q.length)return;let $=L6(Y),W=G>Q.length;J.issues.push({origin:$,...W?{code:"too_big",maximum:Q.length}:{code:"too_small",minimum:Q.length},inclusive:!0,exact:!0,input:J.value,inst:X,continue:!Q.abort})}}),q6=y("$ZodCheckStringFormat",(X,Q)=>{var J,Y;if(r0.init(X,Q),X._zod.onattach.push((G)=>{let $=G._zod.bag;if($.format=Q.format,Q.pattern)$.patterns??($.patterns=new Set),$.patterns.add(Q.pattern)}),Q.pattern)(J=X._zod).check??(J.check=(G)=>{if(Q.pattern.lastIndex=0,Q.pattern.test(G.value))return;G.issues.push({origin:"string",code:"invalid_format",format:Q.format,input:G.value,...Q.pattern?{pattern:Q.pattern.toString()}:{},inst:X,continue:!Q.abort})});else(Y=X._zod).check??(Y.check=()=>{})}),pz=y("$ZodCheckRegex",(X,Q)=>{q6.init(X,Q),X._zod.check=(J)=>{if(Q.pattern.lastIndex=0,Q.pattern.test(J.value))return;J.issues.push({origin:"string",code:"invalid_format",format:"regex",input:J.value,pattern:Q.pattern.toString(),inst:X,continue:!Q.abort})}}),dz=y("$ZodCheckLowerCase",(X,Q)=>{Q.pattern??(Q.pattern=gz),q6.init(X,Q)}),iz=y("$ZodCheckUpperCase",(X,Q)=>{Q.pattern??(Q.pattern=hz),q6.init(X,Q)}),nz=y("$ZodCheckIncludes",(X,Q)=>{r0.init(X,Q);let J=Z9(Q.includes),Y=new RegExp(typeof Q.position==="number"?`^.{${Q.position}}${J}`:J);Q.pattern=Y,X._zod.onattach.push((G)=>{let $=G._zod.bag;$.patterns??($.patterns=new Set),$.patterns.add(Y)}),X._zod.check=(G)=>{if(G.value.includes(Q.includes,Q.position))return;G.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:Q.includes,input:G.value,inst:X,continue:!Q.abort})}}),rz=y("$ZodCheckStartsWith",(X,Q)=>{r0.init(X,Q);let J=new RegExp(`^${Z9(Q.prefix)}.*`);Q.pattern??(Q.pattern=J),X._zod.onattach.push((Y)=>{let G=Y._zod.bag;G.patterns??(G.patterns=new Set),G.patterns.add(J)}),X._zod.check=(Y)=>{if(Y.value.startsWith(Q.prefix))return;Y.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:Q.prefix,input:Y.value,inst:X,continue:!Q.abort})}}),oz=y("$ZodCheckEndsWith",(X,Q)=>{r0.init(X,Q);let J=new RegExp(`.*${Z9(Q.suffix)}$`);Q.pattern??(Q.pattern=J),X._zod.onattach.push((Y)=>{let G=Y._zod.bag;G.patterns??(G.patterns=new Set),G.patterns.add(J)}),X._zod.check=(Y)=>{if(Y.value.endsWith(Q.suffix))return;Y.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:Q.suffix,input:Y.value,inst:X,continue:!Q.abort})}}),az=y("$ZodCheckOverwrite",(X,Q)=>{r0.init(X,Q),X._zod.check=(J)=>{J.value=Q.tx(J.value)}});class NJ{constructor(X=[]){if(this.content=[],this.indent=0,this)this.args=X}indented(X){this.indent+=1,X(this),this.indent-=1}write(X){if(typeof X==="function"){X(this,{execution:"sync"}),X(this,{execution:"async"});return}let J=X.split(`
187
183
  `).filter(($)=>$),Y=Math.min(...J.map(($)=>$.length-$.trimStart().length)),G=J.map(($)=>$.slice(Y)).map(($)=>" ".repeat(this.indent*2)+$);for(let $ of G)this.content.push($)}compile(){let X=Function,Q=this?.args,Y=[...(this?.content??[""]).map((G)=>` ${G}`)];return new X(...Q,Y.join(`
188
- `))}}var XL={major:4,minor:0,patch:0},R0=y("$ZodType",(X,Q)=>{var J;X??(X={}),X._zod.def=Q,X._zod.bag=X._zod.bag||{},X._zod.version=XL;let Y=[...X._zod.def.checks??[]];if(X._zod.traits.has("$ZodCheck"))Y.unshift(X);for(let G of Y)for(let $ of G._zod.onattach)$(X);if(Y.length===0)(J=X._zod).deferred??(J.deferred=[]),X._zod.deferred?.push(()=>{X._zod.run=X._zod.parse});else{let G=($,W,H)=>{let U=z9($),z;for(let F of W){if(F._zod.when){if(!F._zod.when($))continue}else if(U)continue;let K=$.issues.length,M=F._zod.check($);if(M instanceof Promise&&H?.async===!1)throw new V9;if(z||M instanceof Promise)z=(z??Promise.resolve()).then(async()=>{if(await M,$.issues.length===K)return;if(!U)U=z9($,K)});else{if($.issues.length===K)continue;if(!U)U=z9($,K)}}if(z)return z.then(()=>{return $});return $};X._zod.run=($,W)=>{let H=X._zod.parse($,W);if(H instanceof Promise){if(W.async===!1)throw new V9;return H.then((U)=>G(U,Y,W))}return G(H,Y,W)}}X["~standard"]={validate:(G)=>{try{let $=qB(X,G);return $.success?{value:$.data}:{issues:$.error?.issues}}catch($){return FB(X,G).then((W)=>W.success?{value:W.data}:{issues:W.error?.issues})}},vendor:"zod",version:1}}),dX=y("$ZodString",(X,Q)=>{R0.init(X,Q),X._zod.pattern=[...X?._zod.bag?.patterns??[]].pop()??yB(X._zod.bag),X._zod.parse=(J,Y)=>{if(Q.coerce)try{J.value=String(J.value)}catch(G){}if(typeof J.value==="string")return J;return J.issues.push({expected:"string",code:"invalid_type",input:J.value,inst:X}),J}}),P0=y("$ZodStringFormat",(X,Q)=>{K6.init(X,Q),dX.init(X,Q)}),QL=y("$ZodGUID",(X,Q)=>{Q.pattern??(Q.pattern=NB),P0.init(X,Q)}),JL=y("$ZodUUID",(X,Q)=>{if(Q.version){let Y={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[Q.version];if(Y===void 0)throw Error(`Invalid UUID version: "${Q.version}"`);Q.pattern??(Q.pattern=z4(Y))}else Q.pattern??(Q.pattern=z4());P0.init(X,Q)}),YL=y("$ZodEmail",(X,Q)=>{Q.pattern??(Q.pattern=RB),P0.init(X,Q)}),GL=y("$ZodURL",(X,Q)=>{P0.init(X,Q),X._zod.check=(J)=>{try{let Y=J.value,G=new URL(Y),$=G.href;if(Q.hostname){if(Q.hostname.lastIndex=0,!Q.hostname.test(G.hostname))J.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:bB.source,input:J.value,inst:X,continue:!Q.abort})}if(Q.protocol){if(Q.protocol.lastIndex=0,!Q.protocol.test(G.protocol.endsWith(":")?G.protocol.slice(0,-1):G.protocol))J.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:Q.protocol.source,input:J.value,inst:X,continue:!Q.abort})}if(!Y.endsWith("/")&&$.endsWith("/"))J.value=$.slice(0,-1);else J.value=$;return}catch(Y){J.issues.push({code:"invalid_format",format:"url",input:J.value,inst:X,continue:!Q.abort})}}}),$L=y("$ZodEmoji",(X,Q)=>{Q.pattern??(Q.pattern=jB()),P0.init(X,Q)}),WL=y("$ZodNanoID",(X,Q)=>{Q.pattern??(Q.pattern=OB),P0.init(X,Q)}),HL=y("$ZodCUID",(X,Q)=>{Q.pattern??(Q.pattern=KB),P0.init(X,Q)}),UL=y("$ZodCUID2",(X,Q)=>{Q.pattern??(Q.pattern=VB),P0.init(X,Q)}),zL=y("$ZodULID",(X,Q)=>{Q.pattern??(Q.pattern=MB),P0.init(X,Q)}),BL=y("$ZodXID",(X,Q)=>{Q.pattern??(Q.pattern=DB),P0.init(X,Q)}),LL=y("$ZodKSUID",(X,Q)=>{Q.pattern??(Q.pattern=ZB),P0.init(X,Q)}),qL=y("$ZodISODateTime",(X,Q)=>{Q.pattern??(Q.pattern=vB(Q)),P0.init(X,Q)}),FL=y("$ZodISODate",(X,Q)=>{Q.pattern??(Q.pattern=_B),P0.init(X,Q)}),KL=y("$ZodISOTime",(X,Q)=>{Q.pattern??(Q.pattern=kB(Q)),P0.init(X,Q)}),VL=y("$ZodISODuration",(X,Q)=>{Q.pattern??(Q.pattern=AB),P0.init(X,Q)}),ML=y("$ZodIPv4",(X,Q)=>{Q.pattern??(Q.pattern=wB),P0.init(X,Q),X._zod.onattach.push((J)=>{let Y=J._zod.bag;Y.format="ipv4"})}),DL=y("$ZodIPv6",(X,Q)=>{Q.pattern??(Q.pattern=PB),P0.init(X,Q),X._zod.onattach.push((J)=>{let Y=J._zod.bag;Y.format="ipv6"}),X._zod.check=(J)=>{try{new URL(`http://[${J.value}]`)}catch{J.issues.push({code:"invalid_format",format:"ipv6",input:J.value,inst:X,continue:!Q.abort})}}}),ZL=y("$ZodCIDRv4",(X,Q)=>{Q.pattern??(Q.pattern=TB),P0.init(X,Q)}),OL=y("$ZodCIDRv6",(X,Q)=>{Q.pattern??(Q.pattern=SB),P0.init(X,Q),X._zod.check=(J)=>{let[Y,G]=J.value.split("/");try{if(!G)throw Error();let $=Number(G);if(`${$}`!==G)throw Error();if($<0||$>128)throw Error();new URL(`http://[${Y}]`)}catch{J.issues.push({code:"invalid_format",format:"cidrv6",input:J.value,inst:X,continue:!Q.abort})}}});function PJ(X){if(X==="")return!0;if(X.length%4!==0)return!1;try{return atob(X),!0}catch{return!1}}var AL=y("$ZodBase64",(X,Q)=>{Q.pattern??(Q.pattern=EB),P0.init(X,Q),X._zod.onattach.push((J)=>{J._zod.bag.contentEncoding="base64"}),X._zod.check=(J)=>{if(PJ(J.value))return;J.issues.push({code:"invalid_format",format:"base64",input:J.value,inst:X,continue:!Q.abort})}});function NL(X){if(!OJ.test(X))return!1;let Q=X.replace(/[-_]/g,(Y)=>Y==="-"?"+":"/"),J=Q.padEnd(Math.ceil(Q.length/4)*4,"=");return PJ(J)}var RL=y("$ZodBase64URL",(X,Q)=>{Q.pattern??(Q.pattern=OJ),P0.init(X,Q),X._zod.onattach.push((J)=>{J._zod.bag.contentEncoding="base64url"}),X._zod.check=(J)=>{if(NL(J.value))return;J.issues.push({code:"invalid_format",format:"base64url",input:J.value,inst:X,continue:!Q.abort})}}),IL=y("$ZodE164",(X,Q)=>{Q.pattern??(Q.pattern=CB),P0.init(X,Q)});function jL(X,Q=null){try{let J=X.split(".");if(J.length!==3)return!1;let[Y]=J;if(!Y)return!1;let G=JSON.parse(atob(Y));if("typ"in G&&G?.typ!=="JWT")return!1;if(!G.alg)return!1;if(Q&&(!("alg"in G)||G.alg!==Q))return!1;return!0}catch{return!1}}var wL=y("$ZodJWT",(X,Q)=>{P0.init(X,Q),X._zod.check=(J)=>{if(jL(J.value,Q.alg))return;J.issues.push({code:"invalid_format",format:"jwt",input:J.value,inst:X,continue:!Q.abort})}}),TJ=y("$ZodNumber",(X,Q)=>{R0.init(X,Q),X._zod.pattern=X._zod.bag.pattern??gB,X._zod.parse=(J,Y)=>{if(Q.coerce)try{J.value=Number(J.value)}catch(W){}let G=J.value;if(typeof G==="number"&&!Number.isNaN(G)&&Number.isFinite(G))return J;let $=typeof G==="number"?Number.isNaN(G)?"NaN":!Number.isFinite(G)?"Infinity":void 0:void 0;return J.issues.push({expected:"number",code:"invalid_type",input:G,inst:X,...$?{received:$}:{}}),J}}),PL=y("$ZodNumber",(X,Q)=>{cB.init(X,Q),TJ.init(X,Q)}),TL=y("$ZodBoolean",(X,Q)=>{R0.init(X,Q),X._zod.pattern=hB,X._zod.parse=(J,Y)=>{if(Q.coerce)try{J.value=Boolean(J.value)}catch($){}let G=J.value;if(typeof G==="boolean")return J;return J.issues.push({expected:"boolean",code:"invalid_type",input:G,inst:X}),J}}),SL=y("$ZodNull",(X,Q)=>{R0.init(X,Q),X._zod.pattern=fB,X._zod.values=new Set([null]),X._zod.parse=(J,Y)=>{let G=J.value;if(G===null)return J;return J.issues.push({expected:"null",code:"invalid_type",input:G,inst:X}),J}}),EL=y("$ZodUnknown",(X,Q)=>{R0.init(X,Q),X._zod.parse=(J)=>J}),bL=y("$ZodNever",(X,Q)=>{R0.init(X,Q),X._zod.parse=(J,Y)=>{return J.issues.push({expected:"never",code:"invalid_type",input:J.value,inst:X}),J}});function B4(X,Q,J){if(X.issues.length)Q.issues.push(..._1(J,X.issues));Q.value[J]=X.value}var CL=y("$ZodArray",(X,Q)=>{R0.init(X,Q),X._zod.parse=(J,Y)=>{let G=J.value;if(!Array.isArray(G))return J.issues.push({expected:"array",code:"invalid_type",input:G,inst:X}),J;J.value=Array(G.length);let $=[];for(let W=0;W<G.length;W++){let H=G[W],U=Q.element._zod.run({value:H,issues:[]},Y);if(U instanceof Promise)$.push(U.then((z)=>B4(z,J,W)));else B4(U,J,W)}if($.length)return Promise.all($).then(()=>J);return J}});function m8(X,Q,J){if(X.issues.length)Q.issues.push(..._1(J,X.issues));Q.value[J]=X.value}function L4(X,Q,J,Y){if(X.issues.length)if(Y[J]===void 0)if(J in Y)Q.value[J]=void 0;else Q.value[J]=X.value;else Q.issues.push(..._1(J,X.issues));else if(X.value===void 0){if(J in Y)Q.value[J]=void 0}else Q.value[J]=X.value}var _L=y("$ZodObject",(X,Q)=>{R0.init(X,Q);let J=B6(()=>{let K=Object.keys(Q.shape);for(let R of K)if(!(Q.shape[R]instanceof R0))throw Error(`Invalid element at key "${R}": expected a Zod schema`);let M=BJ(Q.shape);return{shape:Q.shape,keys:K,keySet:new Set(K),numKeys:K.length,optionalKeys:new Set(M)}});N0(X._zod,"propValues",()=>{let K=Q.shape,M={};for(let R in K){let w=K[R]._zod;if(w.values){M[R]??(M[R]=new Set);for(let A of w.values)M[R].add(A)}}return M});let Y=(K)=>{let M=new wJ(["shape","payload","ctx"]),R=J.value,w=(V)=>{let q=H9(V);return`shape[${q}]._zod.run({ value: input[${q}], issues: [] }, ctx)`};M.write("const input = payload.value;");let A=Object.create(null),Z=0;for(let V of R.keys)A[V]=`key_${Z++}`;M.write("const newResult = {}");for(let V of R.keys)if(R.optionalKeys.has(V)){let q=A[V];M.write(`const ${q} = ${w(V)};`);let L=H9(V);M.write(`
189
- if (${q}.issues.length) {
184
+ `))}}var sz={major:4,minor:0,patch:0},I0=y("$ZodType",(X,Q)=>{var J;X??(X={}),X._zod.def=Q,X._zod.bag=X._zod.bag||{},X._zod.version=sz;let Y=[...X._zod.def.checks??[]];if(X._zod.traits.has("$ZodCheck"))Y.unshift(X);for(let G of Y)for(let $ of G._zod.onattach)$(X);if(Y.length===0)(J=X._zod).deferred??(J.deferred=[]),X._zod.deferred?.push(()=>{X._zod.run=X._zod.parse});else{let G=($,W,H)=>{let U=H9($),B;for(let q of W){if(q._zod.when){if(!q._zod.when($))continue}else if(U)continue;let K=$.issues.length,V=q._zod.check($);if(V instanceof Promise&&H?.async===!1)throw new F9;if(B||V instanceof Promise)B=(B??Promise.resolve()).then(async()=>{if(await V,$.issues.length===K)return;if(!U)U=H9($,K)});else{if($.issues.length===K)continue;if(!U)U=H9($,K)}}if(B)return B.then(()=>{return $});return $};X._zod.run=($,W)=>{let H=X._zod.parse($,W);if(H instanceof Promise){if(W.async===!1)throw new F9;return H.then((U)=>G(U,Y,W))}return G(H,Y,W)}}X["~standard"]={validate:(G)=>{try{let $=Bz(X,G);return $.success?{value:$.data}:{issues:$.error?.issues}}catch($){return zz(X,G).then((W)=>W.success?{value:W.data}:{issues:W.error?.issues})}},vendor:"zod",version:1}}),cX=y("$ZodString",(X,Q)=>{I0.init(X,Q),X._zod.pattern=[...X?._zod.bag?.patterns??[]].pop()??_z(X._zod.bag),X._zod.parse=(J,Y)=>{if(Q.coerce)try{J.value=String(J.value)}catch(G){}if(typeof J.value==="string")return J;return J.issues.push({expected:"string",code:"invalid_type",input:J.value,inst:X}),J}}),j0=y("$ZodStringFormat",(X,Q)=>{q6.init(X,Q),cX.init(X,Q)}),tz=y("$ZodGUID",(X,Q)=>{Q.pattern??(Q.pattern=Zz),j0.init(X,Q)}),ez=y("$ZodUUID",(X,Q)=>{if(Q.version){let Y={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[Q.version];if(Y===void 0)throw Error(`Invalid UUID version: "${Q.version}"`);Q.pattern??(Q.pattern=$5(Y))}else Q.pattern??(Q.pattern=$5());j0.init(X,Q)}),XL=y("$ZodEmail",(X,Q)=>{Q.pattern??(Q.pattern=Oz),j0.init(X,Q)}),QL=y("$ZodURL",(X,Q)=>{j0.init(X,Q),X._zod.check=(J)=>{try{let Y=J.value,G=new URL(Y),$=G.href;if(Q.hostname){if(Q.hostname.lastIndex=0,!Q.hostname.test(G.hostname))J.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:Tz.source,input:J.value,inst:X,continue:!Q.abort})}if(Q.protocol){if(Q.protocol.lastIndex=0,!Q.protocol.test(G.protocol.endsWith(":")?G.protocol.slice(0,-1):G.protocol))J.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:Q.protocol.source,input:J.value,inst:X,continue:!Q.abort})}if(!Y.endsWith("/")&&$.endsWith("/"))J.value=$.slice(0,-1);else J.value=$;return}catch(Y){J.issues.push({code:"invalid_format",format:"url",input:J.value,inst:X,continue:!Q.abort})}}}),JL=y("$ZodEmoji",(X,Q)=>{Q.pattern??(Q.pattern=Nz()),j0.init(X,Q)}),YL=y("$ZodNanoID",(X,Q)=>{Q.pattern??(Q.pattern=Mz),j0.init(X,Q)}),GL=y("$ZodCUID",(X,Q)=>{Q.pattern??(Q.pattern=Lz),j0.init(X,Q)}),$L=y("$ZodCUID2",(X,Q)=>{Q.pattern??(Q.pattern=qz),j0.init(X,Q)}),WL=y("$ZodULID",(X,Q)=>{Q.pattern??(Q.pattern=Fz),j0.init(X,Q)}),HL=y("$ZodXID",(X,Q)=>{Q.pattern??(Q.pattern=Kz),j0.init(X,Q)}),UL=y("$ZodKSUID",(X,Q)=>{Q.pattern??(Q.pattern=Vz),j0.init(X,Q)}),BL=y("$ZodISODateTime",(X,Q)=>{Q.pattern??(Q.pattern=Cz(Q)),j0.init(X,Q)}),zL=y("$ZodISODate",(X,Q)=>{Q.pattern??(Q.pattern=Ez),j0.init(X,Q)}),LL=y("$ZodISOTime",(X,Q)=>{Q.pattern??(Q.pattern=bz(Q)),j0.init(X,Q)}),qL=y("$ZodISODuration",(X,Q)=>{Q.pattern??(Q.pattern=Dz),j0.init(X,Q)}),FL=y("$ZodIPv4",(X,Q)=>{Q.pattern??(Q.pattern=Rz),j0.init(X,Q),X._zod.onattach.push((J)=>{let Y=J._zod.bag;Y.format="ipv4"})}),KL=y("$ZodIPv6",(X,Q)=>{Q.pattern??(Q.pattern=Iz),j0.init(X,Q),X._zod.onattach.push((J)=>{let Y=J._zod.bag;Y.format="ipv6"}),X._zod.check=(J)=>{try{new URL(`http://[${J.value}]`)}catch{J.issues.push({code:"invalid_format",format:"ipv6",input:J.value,inst:X,continue:!Q.abort})}}}),VL=y("$ZodCIDRv4",(X,Q)=>{Q.pattern??(Q.pattern=jz),j0.init(X,Q)}),ML=y("$ZodCIDRv6",(X,Q)=>{Q.pattern??(Q.pattern=wz),j0.init(X,Q),X._zod.check=(J)=>{let[Y,G]=J.value.split("/");try{if(!G)throw Error();let $=Number(G);if(`${$}`!==G)throw Error();if($<0||$>128)throw Error();new URL(`http://[${Y}]`)}catch{J.issues.push({code:"invalid_format",format:"cidrv6",input:J.value,inst:X,continue:!Q.abort})}}});function RJ(X){if(X==="")return!0;if(X.length%4!==0)return!1;try{return atob(X),!0}catch{return!1}}var DL=y("$ZodBase64",(X,Q)=>{Q.pattern??(Q.pattern=Pz),j0.init(X,Q),X._zod.onattach.push((J)=>{J._zod.bag.contentEncoding="base64"}),X._zod.check=(J)=>{if(RJ(J.value))return;J.issues.push({code:"invalid_format",format:"base64",input:J.value,inst:X,continue:!Q.abort})}});function ZL(X){if(!VJ.test(X))return!1;let Q=X.replace(/[-_]/g,(Y)=>Y==="-"?"+":"/"),J=Q.padEnd(Math.ceil(Q.length/4)*4,"=");return RJ(J)}var OL=y("$ZodBase64URL",(X,Q)=>{Q.pattern??(Q.pattern=VJ),j0.init(X,Q),X._zod.onattach.push((J)=>{J._zod.bag.contentEncoding="base64url"}),X._zod.check=(J)=>{if(ZL(J.value))return;J.issues.push({code:"invalid_format",format:"base64url",input:J.value,inst:X,continue:!Q.abort})}}),AL=y("$ZodE164",(X,Q)=>{Q.pattern??(Q.pattern=Sz),j0.init(X,Q)});function NL(X,Q=null){try{let J=X.split(".");if(J.length!==3)return!1;let[Y]=J;if(!Y)return!1;let G=JSON.parse(atob(Y));if("typ"in G&&G?.typ!=="JWT")return!1;if(!G.alg)return!1;if(Q&&(!("alg"in G)||G.alg!==Q))return!1;return!0}catch{return!1}}var RL=y("$ZodJWT",(X,Q)=>{j0.init(X,Q),X._zod.check=(J)=>{if(NL(J.value,Q.alg))return;J.issues.push({code:"invalid_format",format:"jwt",input:J.value,inst:X,continue:!Q.abort})}}),IJ=y("$ZodNumber",(X,Q)=>{I0.init(X,Q),X._zod.pattern=X._zod.bag.pattern??vz,X._zod.parse=(J,Y)=>{if(Q.coerce)try{J.value=Number(J.value)}catch(W){}let G=J.value;if(typeof G==="number"&&!Number.isNaN(G)&&Number.isFinite(G))return J;let $=typeof G==="number"?Number.isNaN(G)?"NaN":!Number.isFinite(G)?"Infinity":void 0:void 0;return J.issues.push({expected:"number",code:"invalid_type",input:G,inst:X,...$?{received:$}:{}}),J}}),IL=y("$ZodNumber",(X,Q)=>{uz.init(X,Q),IJ.init(X,Q)}),jL=y("$ZodBoolean",(X,Q)=>{I0.init(X,Q),X._zod.pattern=yz,X._zod.parse=(J,Y)=>{if(Q.coerce)try{J.value=Boolean(J.value)}catch($){}let G=J.value;if(typeof G==="boolean")return J;return J.issues.push({expected:"boolean",code:"invalid_type",input:G,inst:X}),J}}),wL=y("$ZodNull",(X,Q)=>{I0.init(X,Q),X._zod.pattern=xz,X._zod.values=new Set([null]),X._zod.parse=(J,Y)=>{let G=J.value;if(G===null)return J;return J.issues.push({expected:"null",code:"invalid_type",input:G,inst:X}),J}}),PL=y("$ZodUnknown",(X,Q)=>{I0.init(X,Q),X._zod.parse=(J)=>J}),TL=y("$ZodNever",(X,Q)=>{I0.init(X,Q),X._zod.parse=(J,Y)=>{return J.issues.push({expected:"never",code:"invalid_type",input:J.value,inst:X}),J}});function W5(X,Q,J){if(X.issues.length)Q.issues.push(..._1(J,X.issues));Q.value[J]=X.value}var SL=y("$ZodArray",(X,Q)=>{I0.init(X,Q),X._zod.parse=(J,Y)=>{let G=J.value;if(!Array.isArray(G))return J.issues.push({expected:"array",code:"invalid_type",input:G,inst:X}),J;J.value=Array(G.length);let $=[];for(let W=0;W<G.length;W++){let H=G[W],U=Q.element._zod.run({value:H,issues:[]},Y);if(U instanceof Promise)$.push(U.then((B)=>W5(B,J,W)));else W5(U,J,W)}if($.length)return Promise.all($).then(()=>J);return J}});function f8(X,Q,J){if(X.issues.length)Q.issues.push(..._1(J,X.issues));Q.value[J]=X.value}function H5(X,Q,J,Y){if(X.issues.length)if(Y[J]===void 0)if(J in Y)Q.value[J]=void 0;else Q.value[J]=X.value;else Q.issues.push(..._1(J,X.issues));else if(X.value===void 0){if(J in Y)Q.value[J]=void 0}else Q.value[J]=X.value}var EL=y("$ZodObject",(X,Q)=>{I0.init(X,Q);let J=U6(()=>{let K=Object.keys(Q.shape);for(let N of K)if(!(Q.shape[N]instanceof I0))throw Error(`Invalid element at key "${N}": expected a Zod schema`);let V=WJ(Q.shape);return{shape:Q.shape,keys:K,keySet:new Set(K),numKeys:K.length,optionalKeys:new Set(V)}});R0(X._zod,"propValues",()=>{let K=Q.shape,V={};for(let N in K){let w=K[N]._zod;if(w.values){V[N]??(V[N]=new Set);for(let A of w.values)V[N].add(A)}}return V});let Y=(K)=>{let V=new NJ(["shape","payload","ctx"]),N=J.value,w=(M)=>{let F=$9(M);return`shape[${F}]._zod.run({ value: input[${F}], issues: [] }, ctx)`};V.write("const input = payload.value;");let A=Object.create(null),Z=0;for(let M of N.keys)A[M]=`key_${Z++}`;V.write("const newResult = {}");for(let M of N.keys)if(N.optionalKeys.has(M)){let F=A[M];V.write(`const ${F} = ${w(M)};`);let L=$9(M);V.write(`
185
+ if (${F}.issues.length) {
190
186
  if (input[${L}] === undefined) {
191
187
  if (${L} in input) {
192
188
  newResult[${L}] = undefined;
193
189
  }
194
190
  } else {
195
191
  payload.issues = payload.issues.concat(
196
- ${q}.issues.map((iss) => ({
192
+ ${F}.issues.map((iss) => ({
197
193
  ...iss,
198
194
  path: iss.path ? [${L}, ...iss.path] : [${L}],
199
195
  }))
200
196
  );
201
197
  }
202
- } else if (${q}.value === undefined) {
198
+ } else if (${F}.value === undefined) {
203
199
  if (${L} in input) newResult[${L}] = undefined;
204
200
  } else {
205
- newResult[${L}] = ${q}.value;
201
+ newResult[${L}] = ${F}.value;
206
202
  }
207
- `)}else{let q=A[V];M.write(`const ${q} = ${w(V)};`),M.write(`
208
- if (${q}.issues.length) payload.issues = payload.issues.concat(${q}.issues.map(iss => ({
203
+ `)}else{let F=A[M];V.write(`const ${F} = ${w(M)};`),V.write(`
204
+ if (${F}.issues.length) payload.issues = payload.issues.concat(${F}.issues.map(iss => ({
209
205
  ...iss,
210
- path: iss.path ? [${H9(V)}, ...iss.path] : [${H9(V)}]
211
- })));`),M.write(`newResult[${H9(V)}] = ${q}.value`)}M.write("payload.value = newResult;"),M.write("return payload;");let B=M.compile();return(V,q)=>B(K,V,q)},G,$=Q8,W=!bX.jitless,U=W&&UJ.value,z=Q.catchall,F;X._zod.parse=(K,M)=>{F??(F=J.value);let R=K.value;if(!$(R))return K.issues.push({expected:"object",code:"invalid_type",input:R,inst:X}),K;let w=[];if(W&&U&&M?.async===!1&&M.jitless!==!0){if(!G)G=Y(Q.shape);K=G(K,M)}else{K.value={};let q=F.shape;for(let L of F.keys){let O=q[L],D=O._zod.run({value:R[L],issues:[]},M),I=O._zod.optin==="optional"&&O._zod.optout==="optional";if(D instanceof Promise)w.push(D.then((j)=>I?L4(j,K,L,R):m8(j,K,L)));else if(I)L4(D,K,L,R);else m8(D,K,L)}}if(!z)return w.length?Promise.all(w).then(()=>K):K;let A=[],Z=F.keySet,B=z._zod,V=B.def.type;for(let q of Object.keys(R)){if(Z.has(q))continue;if(V==="never"){A.push(q);continue}let L=B.run({value:R[q],issues:[]},M);if(L instanceof Promise)w.push(L.then((O)=>m8(O,K,q)));else m8(L,K,q)}if(A.length)K.issues.push({code:"unrecognized_keys",keys:A,input:R,inst:X});if(!w.length)return K;return Promise.all(w).then(()=>{return K})}});function q4(X,Q,J,Y){for(let G of X)if(G.issues.length===0)return Q.value=G.value,Q;return Q.issues.push({code:"invalid_union",input:Q.value,inst:J,errors:X.map((G)=>G.issues.map(($)=>S1($,Y,T1())))}),Q}var SJ=y("$ZodUnion",(X,Q)=>{R0.init(X,Q),N0(X._zod,"optin",()=>Q.options.some((J)=>J._zod.optin==="optional")?"optional":void 0),N0(X._zod,"optout",()=>Q.options.some((J)=>J._zod.optout==="optional")?"optional":void 0),N0(X._zod,"values",()=>{if(Q.options.every((J)=>J._zod.values))return new Set(Q.options.flatMap((J)=>Array.from(J._zod.values)));return}),N0(X._zod,"pattern",()=>{if(Q.options.every((J)=>J._zod.pattern)){let J=Q.options.map((Y)=>Y._zod.pattern);return new RegExp(`^(${J.map((Y)=>q6(Y.source)).join("|")})$`)}return}),X._zod.parse=(J,Y)=>{let G=!1,$=[];for(let W of Q.options){let H=W._zod.run({value:J.value,issues:[]},Y);if(H instanceof Promise)$.push(H),G=!0;else{if(H.issues.length===0)return H;$.push(H)}}if(!G)return q4($,J,X,Y);return Promise.all($).then((W)=>{return q4(W,J,X,Y)})}}),kL=y("$ZodDiscriminatedUnion",(X,Q)=>{SJ.init(X,Q);let J=X._zod.parse;N0(X._zod,"propValues",()=>{let G={};for(let $ of Q.options){let W=$._zod.propValues;if(!W||Object.keys(W).length===0)throw Error(`Invalid discriminated union option at index "${Q.options.indexOf($)}"`);for(let[H,U]of Object.entries(W)){if(!G[H])G[H]=new Set;for(let z of U)G[H].add(z)}}return G});let Y=B6(()=>{let G=Q.options,$=new Map;for(let W of G){let H=W._zod.propValues[Q.discriminator];if(!H||H.size===0)throw Error(`Invalid discriminated union option at index "${Q.options.indexOf(W)}"`);for(let U of H){if($.has(U))throw Error(`Duplicate discriminator value "${String(U)}"`);$.set(U,W)}}return $});X._zod.parse=(G,$)=>{let W=G.value;if(!Q8(W))return G.issues.push({code:"invalid_type",expected:"object",input:W,inst:X}),G;let H=Y.value.get(W?.[Q.discriminator]);if(H)return H._zod.run(G,$);if(Q.unionFallback)return J(G,$);return G.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:W,path:[Q.discriminator],inst:X}),G}}),vL=y("$ZodIntersection",(X,Q)=>{R0.init(X,Q),X._zod.parse=(J,Y)=>{let G=J.value,$=Q.left._zod.run({value:G,issues:[]},Y),W=Q.right._zod.run({value:G,issues:[]},Y);if($ instanceof Promise||W instanceof Promise)return Promise.all([$,W]).then(([U,z])=>{return F4(J,U,z)});return F4(J,$,W)}});function _X(X,Q){if(X===Q)return{valid:!0,data:X};if(X instanceof Date&&Q instanceof Date&&+X===+Q)return{valid:!0,data:X};if(J8(X)&&J8(Q)){let J=Object.keys(Q),Y=Object.keys(X).filter(($)=>J.indexOf($)!==-1),G={...X,...Q};for(let $ of Y){let W=_X(X[$],Q[$]);if(!W.valid)return{valid:!1,mergeErrorPath:[$,...W.mergeErrorPath]};G[$]=W.data}return{valid:!0,data:G}}if(Array.isArray(X)&&Array.isArray(Q)){if(X.length!==Q.length)return{valid:!1,mergeErrorPath:[]};let J=[];for(let Y=0;Y<X.length;Y++){let G=X[Y],$=Q[Y],W=_X(G,$);if(!W.valid)return{valid:!1,mergeErrorPath:[Y,...W.mergeErrorPath]};J.push(W.data)}return{valid:!0,data:J}}return{valid:!1,mergeErrorPath:[]}}function F4(X,Q,J){if(Q.issues.length)X.issues.push(...Q.issues);if(J.issues.length)X.issues.push(...J.issues);if(z9(X))return X;let Y=_X(Q.value,J.value);if(!Y.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(Y.mergeErrorPath)}`);return X.value=Y.data,X}var yL=y("$ZodRecord",(X,Q)=>{R0.init(X,Q),X._zod.parse=(J,Y)=>{let G=J.value;if(!J8(G))return J.issues.push({expected:"record",code:"invalid_type",input:G,inst:X}),J;let $=[];if(Q.keyType._zod.values){let W=Q.keyType._zod.values;J.value={};for(let U of W)if(typeof U==="string"||typeof U==="number"||typeof U==="symbol"){let z=Q.valueType._zod.run({value:G[U],issues:[]},Y);if(z instanceof Promise)$.push(z.then((F)=>{if(F.issues.length)J.issues.push(..._1(U,F.issues));J.value[U]=F.value}));else{if(z.issues.length)J.issues.push(..._1(U,z.issues));J.value[U]=z.value}}let H;for(let U in G)if(!W.has(U))H=H??[],H.push(U);if(H&&H.length>0)J.issues.push({code:"unrecognized_keys",input:G,inst:X,keys:H})}else{J.value={};for(let W of Reflect.ownKeys(G)){if(W==="__proto__")continue;let H=Q.keyType._zod.run({value:W,issues:[]},Y);if(H instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(H.issues.length){J.issues.push({origin:"record",code:"invalid_key",issues:H.issues.map((z)=>S1(z,Y,T1())),input:W,path:[W],inst:X}),J.value[H.value]=H.value;continue}let U=Q.valueType._zod.run({value:G[W],issues:[]},Y);if(U instanceof Promise)$.push(U.then((z)=>{if(z.issues.length)J.issues.push(..._1(W,z.issues));J.value[H.value]=z.value}));else{if(U.issues.length)J.issues.push(..._1(W,U.issues));J.value[H.value]=U.value}}}if($.length)return Promise.all($).then(()=>J);return J}}),xL=y("$ZodEnum",(X,Q)=>{R0.init(X,Q);let J=$J(Q.entries);X._zod.values=new Set(J),X._zod.pattern=new RegExp(`^(${J.filter((Y)=>zJ.has(typeof Y)).map((Y)=>typeof Y==="string"?A9(Y):Y.toString()).join("|")})$`),X._zod.parse=(Y,G)=>{let $=Y.value;if(X._zod.values.has($))return Y;return Y.issues.push({code:"invalid_value",values:J,input:$,inst:X}),Y}}),gL=y("$ZodLiteral",(X,Q)=>{R0.init(X,Q),X._zod.values=new Set(Q.values),X._zod.pattern=new RegExp(`^(${Q.values.map((J)=>typeof J==="string"?A9(J):J?J.toString():String(J)).join("|")})$`),X._zod.parse=(J,Y)=>{let G=J.value;if(X._zod.values.has(G))return J;return J.issues.push({code:"invalid_value",values:Q.values,input:G,inst:X}),J}}),hL=y("$ZodTransform",(X,Q)=>{R0.init(X,Q),X._zod.parse=(J,Y)=>{let G=Q.transform(J.value,J);if(Y.async)return(G instanceof Promise?G:Promise.resolve(G)).then((W)=>{return J.value=W,J});if(G instanceof Promise)throw new V9;return J.value=G,J}}),fL=y("$ZodOptional",(X,Q)=>{R0.init(X,Q),X._zod.optin="optional",X._zod.optout="optional",N0(X._zod,"values",()=>{return Q.innerType._zod.values?new Set([...Q.innerType._zod.values,void 0]):void 0}),N0(X._zod,"pattern",()=>{let J=Q.innerType._zod.pattern;return J?new RegExp(`^(${q6(J.source)})?$`):void 0}),X._zod.parse=(J,Y)=>{if(Q.innerType._zod.optin==="optional")return Q.innerType._zod.run(J,Y);if(J.value===void 0)return J;return Q.innerType._zod.run(J,Y)}}),uL=y("$ZodNullable",(X,Q)=>{R0.init(X,Q),N0(X._zod,"optin",()=>Q.innerType._zod.optin),N0(X._zod,"optout",()=>Q.innerType._zod.optout),N0(X._zod,"pattern",()=>{let J=Q.innerType._zod.pattern;return J?new RegExp(`^(${q6(J.source)}|null)$`):void 0}),N0(X._zod,"values",()=>{return Q.innerType._zod.values?new Set([...Q.innerType._zod.values,null]):void 0}),X._zod.parse=(J,Y)=>{if(J.value===null)return J;return Q.innerType._zod.run(J,Y)}}),mL=y("$ZodDefault",(X,Q)=>{R0.init(X,Q),X._zod.optin="optional",N0(X._zod,"values",()=>Q.innerType._zod.values),X._zod.parse=(J,Y)=>{if(J.value===void 0)return J.value=Q.defaultValue,J;let G=Q.innerType._zod.run(J,Y);if(G instanceof Promise)return G.then(($)=>K4($,Q));return K4(G,Q)}});function K4(X,Q){if(X.value===void 0)X.value=Q.defaultValue;return X}var lL=y("$ZodPrefault",(X,Q)=>{R0.init(X,Q),X._zod.optin="optional",N0(X._zod,"values",()=>Q.innerType._zod.values),X._zod.parse=(J,Y)=>{if(J.value===void 0)J.value=Q.defaultValue;return Q.innerType._zod.run(J,Y)}}),cL=y("$ZodNonOptional",(X,Q)=>{R0.init(X,Q),N0(X._zod,"values",()=>{let J=Q.innerType._zod.values;return J?new Set([...J].filter((Y)=>Y!==void 0)):void 0}),X._zod.parse=(J,Y)=>{let G=Q.innerType._zod.run(J,Y);if(G instanceof Promise)return G.then(($)=>V4($,X));return V4(G,X)}});function V4(X,Q){if(!X.issues.length&&X.value===void 0)X.issues.push({code:"invalid_type",expected:"nonoptional",input:X.value,inst:Q});return X}var pL=y("$ZodCatch",(X,Q)=>{R0.init(X,Q),X._zod.optin="optional",N0(X._zod,"optout",()=>Q.innerType._zod.optout),N0(X._zod,"values",()=>Q.innerType._zod.values),X._zod.parse=(J,Y)=>{let G=Q.innerType._zod.run(J,Y);if(G instanceof Promise)return G.then(($)=>{if(J.value=$.value,$.issues.length)J.value=Q.catchValue({...J,error:{issues:$.issues.map((W)=>S1(W,Y,T1()))},input:J.value}),J.issues=[];return J});if(J.value=G.value,G.issues.length)J.value=Q.catchValue({...J,error:{issues:G.issues.map(($)=>S1($,Y,T1()))},input:J.value}),J.issues=[];return J}}),dL=y("$ZodPipe",(X,Q)=>{R0.init(X,Q),N0(X._zod,"values",()=>Q.in._zod.values),N0(X._zod,"optin",()=>Q.in._zod.optin),N0(X._zod,"optout",()=>Q.out._zod.optout),X._zod.parse=(J,Y)=>{let G=Q.in._zod.run(J,Y);if(G instanceof Promise)return G.then(($)=>M4($,Q,Y));return M4(G,Q,Y)}});function M4(X,Q,J){if(z9(X))return X;return Q.out._zod.run({value:X.value,issues:X.issues},J)}var iL=y("$ZodReadonly",(X,Q)=>{R0.init(X,Q),N0(X._zod,"propValues",()=>Q.innerType._zod.propValues),N0(X._zod,"values",()=>Q.innerType._zod.values),N0(X._zod,"optin",()=>Q.innerType._zod.optin),N0(X._zod,"optout",()=>Q.innerType._zod.optout),X._zod.parse=(J,Y)=>{let G=Q.innerType._zod.run(J,Y);if(G instanceof Promise)return G.then(D4);return D4(G)}});function D4(X){return X.value=Object.freeze(X.value),X}var nL=y("$ZodCustom",(X,Q)=>{r0.init(X,Q),R0.init(X,Q),X._zod.parse=(J,Y)=>{return J},X._zod.check=(J)=>{let Y=J.value,G=Q.fn(Y);if(G instanceof Promise)return G.then(($)=>Z4($,J,Y,X));Z4(G,J,Y,X);return}});function Z4(X,Q,J,Y){if(!X){let G={code:"custom",input:J,inst:Y,path:[...Y._zod.def.path??[]],continue:!Y._zod.def.abort};if(Y._zod.def.params)G.params=Y._zod.def.params;Q.issues.push(qJ(G))}}var rL=(X)=>{let Q=typeof X;switch(Q){case"number":return Number.isNaN(X)?"NaN":"number";case"object":{if(Array.isArray(X))return"array";if(X===null)return"null";if(Object.getPrototypeOf(X)!==Object.prototype&&X.constructor)return X.constructor.name}}return Q},oL=()=>{let X={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function Q(Y){return X[Y]??null}let J={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return(Y)=>{switch(Y.code){case"invalid_type":return`Invalid input: expected ${Y.expected}, received ${rL(Y.input)}`;case"invalid_value":if(Y.values.length===1)return`Invalid input: expected ${pX(Y.values[0])}`;return`Invalid option: expected one of ${CX(Y.values,"|")}`;case"too_big":{let G=Y.inclusive?"<=":"<",$=Q(Y.origin);if($)return`Too big: expected ${Y.origin??"value"} to have ${G}${Y.maximum.toString()} ${$.unit??"elements"}`;return`Too big: expected ${Y.origin??"value"} to be ${G}${Y.maximum.toString()}`}case"too_small":{let G=Y.inclusive?">=":">",$=Q(Y.origin);if($)return`Too small: expected ${Y.origin} to have ${G}${Y.minimum.toString()} ${$.unit}`;return`Too small: expected ${Y.origin} to be ${G}${Y.minimum.toString()}`}case"invalid_format":{let G=Y;if(G.format==="starts_with")return`Invalid string: must start with "${G.prefix}"`;if(G.format==="ends_with")return`Invalid string: must end with "${G.suffix}"`;if(G.format==="includes")return`Invalid string: must include "${G.includes}"`;if(G.format==="regex")return`Invalid string: must match pattern ${G.pattern}`;return`Invalid ${J[G.format]??Y.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${Y.divisor}`;case"unrecognized_keys":return`Unrecognized key${Y.keys.length>1?"s":""}: ${CX(Y.keys,", ")}`;case"invalid_key":return`Invalid key in ${Y.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${Y.origin}`;default:return"Invalid input"}}};function aL(){return{localeError:oL()}}var DP=Symbol("ZodOutput"),ZP=Symbol("ZodInput");class EJ{constructor(){this._map=new WeakMap,this._idmap=new Map}add(X,...Q){let J=Q[0];if(this._map.set(X,J),J&&typeof J==="object"&&"id"in J){if(this._idmap.has(J.id))throw Error(`ID ${J.id} already exists in the registry`);this._idmap.set(J.id,X)}return this}remove(X){return this._map.delete(X),this}get(X){let Q=X._zod.parent;if(Q){let J={...this.get(Q)??{}};return delete J.id,{...J,...this._map.get(X)}}return this._map.get(X)}has(X){return this._map.has(X)}}function sL(){return new EJ}var l8=sL();function tL(X,Q){return new X({type:"string",...J0(Q)})}function eL(X,Q){return new X({type:"string",format:"email",check:"string_format",abort:!1,...J0(Q)})}function O4(X,Q){return new X({type:"string",format:"guid",check:"string_format",abort:!1,...J0(Q)})}function Xq(X,Q){return new X({type:"string",format:"uuid",check:"string_format",abort:!1,...J0(Q)})}function Qq(X,Q){return new X({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...J0(Q)})}function Jq(X,Q){return new X({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...J0(Q)})}function Yq(X,Q){return new X({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...J0(Q)})}function Gq(X,Q){return new X({type:"string",format:"url",check:"string_format",abort:!1,...J0(Q)})}function $q(X,Q){return new X({type:"string",format:"emoji",check:"string_format",abort:!1,...J0(Q)})}function Wq(X,Q){return new X({type:"string",format:"nanoid",check:"string_format",abort:!1,...J0(Q)})}function Hq(X,Q){return new X({type:"string",format:"cuid",check:"string_format",abort:!1,...J0(Q)})}function Uq(X,Q){return new X({type:"string",format:"cuid2",check:"string_format",abort:!1,...J0(Q)})}function zq(X,Q){return new X({type:"string",format:"ulid",check:"string_format",abort:!1,...J0(Q)})}function Bq(X,Q){return new X({type:"string",format:"xid",check:"string_format",abort:!1,...J0(Q)})}function Lq(X,Q){return new X({type:"string",format:"ksuid",check:"string_format",abort:!1,...J0(Q)})}function qq(X,Q){return new X({type:"string",format:"ipv4",check:"string_format",abort:!1,...J0(Q)})}function Fq(X,Q){return new X({type:"string",format:"ipv6",check:"string_format",abort:!1,...J0(Q)})}function Kq(X,Q){return new X({type:"string",format:"cidrv4",check:"string_format",abort:!1,...J0(Q)})}function Vq(X,Q){return new X({type:"string",format:"cidrv6",check:"string_format",abort:!1,...J0(Q)})}function Mq(X,Q){return new X({type:"string",format:"base64",check:"string_format",abort:!1,...J0(Q)})}function Dq(X,Q){return new X({type:"string",format:"base64url",check:"string_format",abort:!1,...J0(Q)})}function Zq(X,Q){return new X({type:"string",format:"e164",check:"string_format",abort:!1,...J0(Q)})}function Oq(X,Q){return new X({type:"string",format:"jwt",check:"string_format",abort:!1,...J0(Q)})}function Aq(X,Q){return new X({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...J0(Q)})}function Nq(X,Q){return new X({type:"string",format:"date",check:"string_format",...J0(Q)})}function Rq(X,Q){return new X({type:"string",format:"time",check:"string_format",precision:null,...J0(Q)})}function Iq(X,Q){return new X({type:"string",format:"duration",check:"string_format",...J0(Q)})}function jq(X,Q){return new X({type:"number",checks:[],...J0(Q)})}function wq(X,Q){return new X({type:"number",check:"number_format",abort:!1,format:"safeint",...J0(Q)})}function Pq(X,Q){return new X({type:"boolean",...J0(Q)})}function Tq(X,Q){return new X({type:"null",...J0(Q)})}function Sq(X){return new X({type:"unknown"})}function Eq(X,Q){return new X({type:"never",...J0(Q)})}function A4(X,Q){return new IJ({check:"less_than",...J0(Q),value:X,inclusive:!1})}function IX(X,Q){return new IJ({check:"less_than",...J0(Q),value:X,inclusive:!0})}function N4(X,Q){return new jJ({check:"greater_than",...J0(Q),value:X,inclusive:!1})}function jX(X,Q){return new jJ({check:"greater_than",...J0(Q),value:X,inclusive:!0})}function R4(X,Q){return new lB({check:"multiple_of",...J0(Q),value:X})}function bJ(X,Q){return new pB({check:"max_length",...J0(Q),maximum:X})}function Q6(X,Q){return new dB({check:"min_length",...J0(Q),minimum:X})}function CJ(X,Q){return new iB({check:"length_equals",...J0(Q),length:X})}function bq(X,Q){return new nB({check:"string_format",format:"regex",...J0(Q),pattern:X})}function Cq(X){return new rB({check:"string_format",format:"lowercase",...J0(X)})}function _q(X){return new oB({check:"string_format",format:"uppercase",...J0(X)})}function kq(X,Q){return new aB({check:"string_format",format:"includes",...J0(Q),includes:X})}function vq(X,Q){return new sB({check:"string_format",format:"starts_with",...J0(Q),prefix:X})}function yq(X,Q){return new tB({check:"string_format",format:"ends_with",...J0(Q),suffix:X})}function G8(X){return new eB({check:"overwrite",tx:X})}function xq(X){return G8((Q)=>Q.normalize(X))}function gq(){return G8((X)=>X.trim())}function hq(){return G8((X)=>X.toLowerCase())}function fq(){return G8((X)=>X.toUpperCase())}function uq(X,Q,J){return new X({type:"array",element:Q,...J0(J)})}function mq(X,Q,J){let Y=J0(J);return Y.abort??(Y.abort=!0),new X({type:"custom",check:"custom",fn:Q,...Y})}function lq(X,Q,J){return new X({type:"custom",check:"custom",fn:Q,...J0(J)})}var _J={};E4(_J,{time:()=>hJ,duration:()=>uJ,datetime:()=>vJ,date:()=>xJ,ZodISOTime:()=>gJ,ZodISODuration:()=>fJ,ZodISODateTime:()=>kJ,ZodISODate:()=>yJ});var kJ=y("ZodISODateTime",(X,Q)=>{qL.init(X,Q),b0.init(X,Q)});function vJ(X){return Aq(kJ,X)}var yJ=y("ZodISODate",(X,Q)=>{FL.init(X,Q),b0.init(X,Q)});function xJ(X){return Nq(yJ,X)}var gJ=y("ZodISOTime",(X,Q)=>{KL.init(X,Q),b0.init(X,Q)});function hJ(X){return Rq(gJ,X)}var fJ=y("ZodISODuration",(X,Q)=>{VL.init(X,Q),b0.init(X,Q)});function uJ(X){return Iq(fJ,X)}var mJ=(X,Q)=>{VJ.init(X,Q),X.name="ZodError",Object.defineProperties(X,{format:{value:(J)=>zB(X,J)},flatten:{value:(J)=>UB(X,J)},addIssue:{value:(J)=>X.issues.push(J)},addIssues:{value:(J)=>X.issues.push(...J)},isEmpty:{get(){return X.issues.length===0}}})},OP=y("ZodError",mJ),V6=y("ZodError",mJ,{Parent:Error}),cq=BB(V6),pq=LB(V6),dq=DJ(V6),iq=ZJ(V6),E0=y("ZodType",(X,Q)=>{return R0.init(X,Q),X.def=Q,Object.defineProperty(X,"_def",{value:Q}),X.check=(...J)=>{return X.clone({...Q,checks:[...Q.checks??[],...J.map((Y)=>typeof Y==="function"?{_zod:{check:Y,def:{check:"custom"},onattach:[]}}:Y)]})},X.clone=(J,Y)=>y1(X,J,Y),X.brand=()=>X,X.register=(J,Y)=>{return J.add(X,Y),X},X.parse=(J,Y)=>cq(X,J,Y,{callee:X.parse}),X.safeParse=(J,Y)=>dq(X,J,Y),X.parseAsync=async(J,Y)=>pq(X,J,Y,{callee:X.parseAsync}),X.safeParseAsync=async(J,Y)=>iq(X,J,Y),X.spa=X.safeParseAsync,X.refine=(J,Y)=>X.check(xF(J,Y)),X.superRefine=(J)=>X.check(gF(J)),X.overwrite=(J)=>X.check(G8(J)),X.optional=()=>s(X),X.nullable=()=>w4(X),X.nullish=()=>s(w4(X)),X.nonoptional=(J)=>SF(X,J),X.array=()=>F0(X),X.or=(J)=>T0([X,J]),X.and=(J)=>iX(X,J),X.transform=(J)=>vX(X,rJ(J)),X.default=(J)=>wF(X,J),X.prefault=(J)=>TF(X,J),X.catch=(J)=>bF(X,J),X.pipe=(J)=>vX(X,J),X.readonly=()=>kF(X),X.describe=(J)=>{let Y=X.clone();return l8.add(Y,{description:J}),Y},Object.defineProperty(X,"description",{get(){return l8.get(X)?.description},configurable:!0}),X.meta=(...J)=>{if(J.length===0)return l8.get(X);let Y=X.clone();return l8.add(Y,J[0]),Y},X.isOptional=()=>X.safeParse(void 0).success,X.isNullable=()=>X.safeParse(null).success,X}),lJ=y("_ZodString",(X,Q)=>{dX.init(X,Q),E0.init(X,Q);let J=X._zod.bag;X.format=J.format??null,X.minLength=J.minimum??null,X.maxLength=J.maximum??null,X.regex=(...Y)=>X.check(bq(...Y)),X.includes=(...Y)=>X.check(kq(...Y)),X.startsWith=(...Y)=>X.check(vq(...Y)),X.endsWith=(...Y)=>X.check(yq(...Y)),X.min=(...Y)=>X.check(Q6(...Y)),X.max=(...Y)=>X.check(bJ(...Y)),X.length=(...Y)=>X.check(CJ(...Y)),X.nonempty=(...Y)=>X.check(Q6(1,...Y)),X.lowercase=(Y)=>X.check(Cq(Y)),X.uppercase=(Y)=>X.check(_q(Y)),X.trim=()=>X.check(gq()),X.normalize=(...Y)=>X.check(xq(...Y)),X.toLowerCase=()=>X.check(hq()),X.toUpperCase=()=>X.check(fq())}),nq=y("ZodString",(X,Q)=>{dX.init(X,Q),lJ.init(X,Q),X.email=(J)=>X.check(eL(rq,J)),X.url=(J)=>X.check(Gq(oq,J)),X.jwt=(J)=>X.check(Oq(BF,J)),X.emoji=(J)=>X.check($q(aq,J)),X.guid=(J)=>X.check(O4(I4,J)),X.uuid=(J)=>X.check(Xq(c8,J)),X.uuidv4=(J)=>X.check(Qq(c8,J)),X.uuidv6=(J)=>X.check(Jq(c8,J)),X.uuidv7=(J)=>X.check(Yq(c8,J)),X.nanoid=(J)=>X.check(Wq(sq,J)),X.guid=(J)=>X.check(O4(I4,J)),X.cuid=(J)=>X.check(Hq(tq,J)),X.cuid2=(J)=>X.check(Uq(eq,J)),X.ulid=(J)=>X.check(zq(XF,J)),X.base64=(J)=>X.check(Mq(HF,J)),X.base64url=(J)=>X.check(Dq(UF,J)),X.xid=(J)=>X.check(Bq(QF,J)),X.ksuid=(J)=>X.check(Lq(JF,J)),X.ipv4=(J)=>X.check(qq(YF,J)),X.ipv6=(J)=>X.check(Fq(GF,J)),X.cidrv4=(J)=>X.check(Kq($F,J)),X.cidrv6=(J)=>X.check(Vq(WF,J)),X.e164=(J)=>X.check(Zq(zF,J)),X.datetime=(J)=>X.check(vJ(J)),X.date=(J)=>X.check(xJ(J)),X.time=(J)=>X.check(hJ(J)),X.duration=(J)=>X.check(uJ(J))});function v(X){return tL(nq,X)}var b0=y("ZodStringFormat",(X,Q)=>{P0.init(X,Q),lJ.init(X,Q)}),rq=y("ZodEmail",(X,Q)=>{YL.init(X,Q),b0.init(X,Q)}),I4=y("ZodGUID",(X,Q)=>{QL.init(X,Q),b0.init(X,Q)}),c8=y("ZodUUID",(X,Q)=>{JL.init(X,Q),b0.init(X,Q)}),oq=y("ZodURL",(X,Q)=>{GL.init(X,Q),b0.init(X,Q)}),aq=y("ZodEmoji",(X,Q)=>{$L.init(X,Q),b0.init(X,Q)}),sq=y("ZodNanoID",(X,Q)=>{WL.init(X,Q),b0.init(X,Q)}),tq=y("ZodCUID",(X,Q)=>{HL.init(X,Q),b0.init(X,Q)}),eq=y("ZodCUID2",(X,Q)=>{UL.init(X,Q),b0.init(X,Q)}),XF=y("ZodULID",(X,Q)=>{zL.init(X,Q),b0.init(X,Q)}),QF=y("ZodXID",(X,Q)=>{BL.init(X,Q),b0.init(X,Q)}),JF=y("ZodKSUID",(X,Q)=>{LL.init(X,Q),b0.init(X,Q)}),YF=y("ZodIPv4",(X,Q)=>{ML.init(X,Q),b0.init(X,Q)}),GF=y("ZodIPv6",(X,Q)=>{DL.init(X,Q),b0.init(X,Q)}),$F=y("ZodCIDRv4",(X,Q)=>{ZL.init(X,Q),b0.init(X,Q)}),WF=y("ZodCIDRv6",(X,Q)=>{OL.init(X,Q),b0.init(X,Q)}),HF=y("ZodBase64",(X,Q)=>{AL.init(X,Q),b0.init(X,Q)}),UF=y("ZodBase64URL",(X,Q)=>{RL.init(X,Q),b0.init(X,Q)}),zF=y("ZodE164",(X,Q)=>{IL.init(X,Q),b0.init(X,Q)}),BF=y("ZodJWT",(X,Q)=>{wL.init(X,Q),b0.init(X,Q)}),cJ=y("ZodNumber",(X,Q)=>{TJ.init(X,Q),E0.init(X,Q),X.gt=(Y,G)=>X.check(N4(Y,G)),X.gte=(Y,G)=>X.check(jX(Y,G)),X.min=(Y,G)=>X.check(jX(Y,G)),X.lt=(Y,G)=>X.check(A4(Y,G)),X.lte=(Y,G)=>X.check(IX(Y,G)),X.max=(Y,G)=>X.check(IX(Y,G)),X.int=(Y)=>X.check(j4(Y)),X.safe=(Y)=>X.check(j4(Y)),X.positive=(Y)=>X.check(N4(0,Y)),X.nonnegative=(Y)=>X.check(jX(0,Y)),X.negative=(Y)=>X.check(A4(0,Y)),X.nonpositive=(Y)=>X.check(IX(0,Y)),X.multipleOf=(Y,G)=>X.check(R4(Y,G)),X.step=(Y,G)=>X.check(R4(Y,G)),X.finite=()=>X;let J=X._zod.bag;X.minValue=Math.max(J.minimum??Number.NEGATIVE_INFINITY,J.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,X.maxValue=Math.min(J.maximum??Number.POSITIVE_INFINITY,J.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,X.isInt=(J.format??"").includes("int")||Number.isSafeInteger(J.multipleOf??0.5),X.isFinite=!0,X.format=J.format??null});function O0(X){return jq(cJ,X)}var LF=y("ZodNumberFormat",(X,Q)=>{PL.init(X,Q),cJ.init(X,Q)});function j4(X){return wq(LF,X)}var qF=y("ZodBoolean",(X,Q)=>{TL.init(X,Q),E0.init(X,Q)});function m0(X){return Pq(qF,X)}var FF=y("ZodNull",(X,Q)=>{SL.init(X,Q),E0.init(X,Q)});function pJ(X){return Tq(FF,X)}var KF=y("ZodUnknown",(X,Q)=>{EL.init(X,Q),E0.init(X,Q)});function y0(){return Sq(KF)}var VF=y("ZodNever",(X,Q)=>{bL.init(X,Q),E0.init(X,Q)});function MF(X){return Eq(VF,X)}var DF=y("ZodArray",(X,Q)=>{CL.init(X,Q),E0.init(X,Q),X.element=Q.element,X.min=(J,Y)=>X.check(Q6(J,Y)),X.nonempty=(J)=>X.check(Q6(1,J)),X.max=(J,Y)=>X.check(bJ(J,Y)),X.length=(J,Y)=>X.check(CJ(J,Y)),X.unwrap=()=>X.element});function F0(X,Q){return uq(DF,X,Q)}var dJ=y("ZodObject",(X,Q)=>{_L.init(X,Q),E0.init(X,Q),A0.defineLazy(X,"shape",()=>Q.shape),X.keyof=()=>l0(Object.keys(X._zod.def.shape)),X.catchall=(J)=>X.clone({...X._zod.def,catchall:J}),X.passthrough=()=>X.clone({...X._zod.def,catchall:y0()}),X.loose=()=>X.clone({...X._zod.def,catchall:y0()}),X.strict=()=>X.clone({...X._zod.def,catchall:MF()}),X.strip=()=>X.clone({...X._zod.def,catchall:void 0}),X.extend=(J)=>{return A0.extend(X,J)},X.merge=(J)=>A0.merge(X,J),X.pick=(J)=>A0.pick(X,J),X.omit=(J)=>A0.omit(X,J),X.partial=(...J)=>A0.partial(oJ,X,J[0]),X.required=(...J)=>A0.required(aJ,X,J[0])});function c(X,Q){let J={type:"object",get shape(){return A0.assignProp(this,"shape",{...X}),this.shape},...A0.normalizeParams(Q)};return new dJ(J)}function H1(X,Q){return new dJ({type:"object",get shape(){return A0.assignProp(this,"shape",{...X}),this.shape},catchall:y0(),...A0.normalizeParams(Q)})}var iJ=y("ZodUnion",(X,Q)=>{SJ.init(X,Q),E0.init(X,Q),X.options=Q.options});function T0(X,Q){return new iJ({type:"union",options:X,...A0.normalizeParams(Q)})}var ZF=y("ZodDiscriminatedUnion",(X,Q)=>{iJ.init(X,Q),kL.init(X,Q)});function nJ(X,Q,J){return new ZF({type:"union",options:Q,discriminator:X,...A0.normalizeParams(J)})}var OF=y("ZodIntersection",(X,Q)=>{vL.init(X,Q),E0.init(X,Q)});function iX(X,Q){return new OF({type:"intersection",left:X,right:Q})}var AF=y("ZodRecord",(X,Q)=>{yL.init(X,Q),E0.init(X,Q),X.keyType=Q.keyType,X.valueType=Q.valueType});function x0(X,Q,J){return new AF({type:"record",keyType:X,valueType:Q,...A0.normalizeParams(J)})}var kX=y("ZodEnum",(X,Q)=>{xL.init(X,Q),E0.init(X,Q),X.enum=Q.entries,X.options=Object.values(Q.entries);let J=new Set(Object.keys(Q.entries));X.extract=(Y,G)=>{let $={};for(let W of Y)if(J.has(W))$[W]=Q.entries[W];else throw Error(`Key ${W} not found in enum`);return new kX({...Q,checks:[],...A0.normalizeParams(G),entries:$})},X.exclude=(Y,G)=>{let $={...Q.entries};for(let W of Y)if(J.has(W))delete $[W];else throw Error(`Key ${W} not found in enum`);return new kX({...Q,checks:[],...A0.normalizeParams(G),entries:$})}});function l0(X,Q){let J=Array.isArray(X)?Object.fromEntries(X.map((Y)=>[Y,Y])):X;return new kX({type:"enum",entries:J,...A0.normalizeParams(Q)})}var NF=y("ZodLiteral",(X,Q)=>{gL.init(X,Q),E0.init(X,Q),X.values=new Set(Q.values),Object.defineProperty(X,"value",{get(){if(Q.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return Q.values[0]}})});function t(X,Q){return new NF({type:"literal",values:Array.isArray(X)?X:[X],...A0.normalizeParams(Q)})}var RF=y("ZodTransform",(X,Q)=>{hL.init(X,Q),E0.init(X,Q),X._zod.parse=(J,Y)=>{J.addIssue=($)=>{if(typeof $==="string")J.issues.push(A0.issue($,J.value,Q));else{let W=$;if(W.fatal)W.continue=!1;W.code??(W.code="custom"),W.input??(W.input=J.value),W.inst??(W.inst=X),W.continue??(W.continue=!0),J.issues.push(A0.issue(W))}};let G=Q.transform(J.value,J);if(G instanceof Promise)return G.then(($)=>{return J.value=$,J});return J.value=G,J}});function rJ(X){return new RF({type:"transform",transform:X})}var oJ=y("ZodOptional",(X,Q)=>{fL.init(X,Q),E0.init(X,Q),X.unwrap=()=>X._zod.def.innerType});function s(X){return new oJ({type:"optional",innerType:X})}var IF=y("ZodNullable",(X,Q)=>{uL.init(X,Q),E0.init(X,Q),X.unwrap=()=>X._zod.def.innerType});function w4(X){return new IF({type:"nullable",innerType:X})}var jF=y("ZodDefault",(X,Q)=>{mL.init(X,Q),E0.init(X,Q),X.unwrap=()=>X._zod.def.innerType,X.removeDefault=X.unwrap});function wF(X,Q){return new jF({type:"default",innerType:X,get defaultValue(){return typeof Q==="function"?Q():Q}})}var PF=y("ZodPrefault",(X,Q)=>{lL.init(X,Q),E0.init(X,Q),X.unwrap=()=>X._zod.def.innerType});function TF(X,Q){return new PF({type:"prefault",innerType:X,get defaultValue(){return typeof Q==="function"?Q():Q}})}var aJ=y("ZodNonOptional",(X,Q)=>{cL.init(X,Q),E0.init(X,Q),X.unwrap=()=>X._zod.def.innerType});function SF(X,Q){return new aJ({type:"nonoptional",innerType:X,...A0.normalizeParams(Q)})}var EF=y("ZodCatch",(X,Q)=>{pL.init(X,Q),E0.init(X,Q),X.unwrap=()=>X._zod.def.innerType,X.removeCatch=X.unwrap});function bF(X,Q){return new EF({type:"catch",innerType:X,catchValue:typeof Q==="function"?Q:()=>Q})}var CF=y("ZodPipe",(X,Q)=>{dL.init(X,Q),E0.init(X,Q),X.in=Q.in,X.out=Q.out});function vX(X,Q){return new CF({type:"pipe",in:X,out:Q})}var _F=y("ZodReadonly",(X,Q)=>{iL.init(X,Q),E0.init(X,Q)});function kF(X){return new _F({type:"readonly",innerType:X})}var sJ=y("ZodCustom",(X,Q)=>{nL.init(X,Q),E0.init(X,Q)});function vF(X,Q){let J=new r0({check:"custom",...A0.normalizeParams(Q)});return J._zod.check=X,J}function yF(X,Q){return mq(sJ,X??(()=>!0),Q)}function xF(X,Q={}){return lq(sJ,X,Q)}function gF(X,Q){let J=vF((Y)=>{return Y.addIssue=(G)=>{if(typeof G==="string")Y.issues.push(A0.issue(G,Y.value,J._zod.def));else{let $=G;if($.fatal)$.continue=!1;$.code??($.code="custom"),$.input??($.input=Y.value),$.inst??($.inst=J),$.continue??($.continue=!J._zod.def.abort),Y.issues.push(A0.issue($))}},X(Y.value,Y)},Q);return J}function tJ(X,Q){return vX(rJ(X),Q)}T1(aL());var nX="io.modelcontextprotocol/related-task",M6="2.0",V1=yF((X)=>X!==null&&(typeof X==="object"||typeof X==="function")),eJ=T0([v(),O0().int()]),X7=v(),hF=H1({ttl:T0([O0(),pJ()]).optional(),pollInterval:O0().optional()}),rX=H1({taskId:v()}),fF=H1({progressToken:eJ.optional(),[nX]:rX.optional()}),o0=H1({task:hF.optional(),_meta:fF.optional()}),u0=c({method:v(),params:o0.optional()}),o1=H1({_meta:c({[nX]:s(rX)}).passthrough().optional()}),Q1=c({method:v(),params:o1.optional()}),c0=H1({_meta:H1({[nX]:rX.optional()}).optional()}),D6=T0([v(),O0().int()]),uF=c({jsonrpc:t(M6),id:D6,...u0.shape}).strict();var mF=c({jsonrpc:t(M6),...Q1.shape}).strict();var lF=c({jsonrpc:t(M6),id:D6,result:c0}).strict();var P4;(function(X){X[X.ConnectionClosed=-32000]="ConnectionClosed",X[X.RequestTimeout=-32001]="RequestTimeout",X[X.ParseError=-32700]="ParseError",X[X.InvalidRequest=-32600]="InvalidRequest",X[X.MethodNotFound=-32601]="MethodNotFound",X[X.InvalidParams=-32602]="InvalidParams",X[X.InternalError=-32603]="InternalError",X[X.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(P4||(P4={}));var cF=c({jsonrpc:t(M6),id:D6,error:c({code:O0().int(),message:v(),data:s(y0())})}).strict();var AP=T0([uF,mF,lF,cF]),Q7=c0.strict(),pF=o1.extend({requestId:D6,reason:v().optional()}),J7=Q1.extend({method:t("notifications/cancelled"),params:pF}),dF=c({src:v(),mimeType:v().optional(),sizes:F0(v()).optional()}),$8=c({icons:F0(dF).optional()}),M9=c({name:v(),title:v().optional()}),Y7=M9.extend({...M9.shape,...$8.shape,version:v(),websiteUrl:v().optional()}),iF=iX(c({applyDefaults:m0().optional()}),x0(v(),y0())),nF=tJ((X)=>{if(X&&typeof X==="object"&&!Array.isArray(X)){if(Object.keys(X).length===0)return{form:{}}}return X},iX(c({form:iF.optional(),url:V1.optional()}),x0(v(),y0()).optional())),rF=c({list:s(c({}).passthrough()),cancel:s(c({}).passthrough()),requests:s(c({sampling:s(c({createMessage:s(c({}).passthrough())}).passthrough()),elicitation:s(c({create:s(c({}).passthrough())}).passthrough())}).passthrough())}).passthrough(),oF=c({list:s(c({}).passthrough()),cancel:s(c({}).passthrough()),requests:s(c({tools:s(c({call:s(c({}).passthrough())}).passthrough())}).passthrough())}).passthrough(),aF=c({experimental:x0(v(),V1).optional(),sampling:c({context:V1.optional(),tools:V1.optional()}).optional(),elicitation:nF.optional(),roots:c({listChanged:m0().optional()}).optional(),tasks:s(rF)}),sF=o0.extend({protocolVersion:v(),capabilities:aF,clientInfo:Y7}),tF=u0.extend({method:t("initialize"),params:sF}),eF=c({experimental:x0(v(),V1).optional(),logging:V1.optional(),completions:V1.optional(),prompts:s(c({listChanged:s(m0())})),resources:c({subscribe:m0().optional(),listChanged:m0().optional()}).optional(),tools:c({listChanged:m0().optional()}).optional(),tasks:s(oF)}).passthrough(),XK=c0.extend({protocolVersion:v(),capabilities:eF,serverInfo:Y7,instructions:v().optional()}),QK=Q1.extend({method:t("notifications/initialized")}),G7=u0.extend({method:t("ping")}),JK=c({progress:O0(),total:s(O0()),message:s(v())}),YK=c({...o1.shape,...JK.shape,progressToken:eJ}),$7=Q1.extend({method:t("notifications/progress"),params:YK}),GK=o0.extend({cursor:X7.optional()}),W8=u0.extend({params:GK.optional()}),H8=c0.extend({nextCursor:s(X7)}),U8=c({taskId:v(),status:l0(["working","input_required","completed","failed","cancelled"]),ttl:T0([O0(),pJ()]),createdAt:v(),lastUpdatedAt:v(),pollInterval:s(O0()),statusMessage:s(v())}),W7=c0.extend({task:U8}),$K=o1.merge(U8),H7=Q1.extend({method:t("notifications/tasks/status"),params:$K}),U7=u0.extend({method:t("tasks/get"),params:o0.extend({taskId:v()})}),z7=c0.merge(U8),B7=u0.extend({method:t("tasks/result"),params:o0.extend({taskId:v()})}),L7=W8.extend({method:t("tasks/list")}),q7=H8.extend({tasks:F0(U8)}),NP=u0.extend({method:t("tasks/cancel"),params:o0.extend({taskId:v()})}),RP=c0.merge(U8),F7=c({uri:v(),mimeType:s(v()),_meta:x0(v(),y0()).optional()}),K7=F7.extend({text:v()}),oX=v().refine((X)=>{try{return atob(X),!0}catch(Q){return!1}},{message:"Invalid Base64 string"}),V7=F7.extend({blob:oX}),N9=c({audience:F0(l0(["user","assistant"])).optional(),priority:O0().min(0).max(1).optional(),lastModified:_J.datetime({offset:!0}).optional()}),M7=c({...M9.shape,...$8.shape,uri:v(),description:s(v()),mimeType:s(v()),annotations:N9.optional(),_meta:s(H1({}))}),WK=c({...M9.shape,...$8.shape,uriTemplate:v(),description:s(v()),mimeType:s(v()),annotations:N9.optional(),_meta:s(H1({}))}),HK=W8.extend({method:t("resources/list")}),UK=H8.extend({resources:F0(M7)}),zK=W8.extend({method:t("resources/templates/list")}),BK=H8.extend({resourceTemplates:F0(WK)}),aX=o0.extend({uri:v()}),LK=aX,qK=u0.extend({method:t("resources/read"),params:LK}),FK=c0.extend({contents:F0(T0([K7,V7]))}),KK=Q1.extend({method:t("notifications/resources/list_changed")}),VK=aX,MK=u0.extend({method:t("resources/subscribe"),params:VK}),DK=aX,ZK=u0.extend({method:t("resources/unsubscribe"),params:DK}),OK=o1.extend({uri:v()}),AK=Q1.extend({method:t("notifications/resources/updated"),params:OK}),NK=c({name:v(),description:s(v()),required:s(m0())}),RK=c({...M9.shape,...$8.shape,description:s(v()),arguments:s(F0(NK)),_meta:s(H1({}))}),IK=W8.extend({method:t("prompts/list")}),jK=H8.extend({prompts:F0(RK)}),wK=o0.extend({name:v(),arguments:x0(v(),v()).optional()}),PK=u0.extend({method:t("prompts/get"),params:wK}),sX=c({type:t("text"),text:v(),annotations:N9.optional(),_meta:x0(v(),y0()).optional()}),tX=c({type:t("image"),data:oX,mimeType:v(),annotations:N9.optional(),_meta:x0(v(),y0()).optional()}),eX=c({type:t("audio"),data:oX,mimeType:v(),annotations:N9.optional(),_meta:x0(v(),y0()).optional()}),TK=c({type:t("tool_use"),name:v(),id:v(),input:c({}).passthrough(),_meta:s(c({}).passthrough())}).passthrough(),SK=c({type:t("resource"),resource:T0([K7,V7]),annotations:N9.optional(),_meta:x0(v(),y0()).optional()}),EK=M7.extend({type:t("resource_link")}),XQ=T0([sX,tX,eX,EK,SK]),bK=c({role:l0(["user","assistant"]),content:XQ}),CK=c0.extend({description:s(v()),messages:F0(bK)}),_K=Q1.extend({method:t("notifications/prompts/list_changed")}),kK=c({title:v().optional(),readOnlyHint:m0().optional(),destructiveHint:m0().optional(),idempotentHint:m0().optional(),openWorldHint:m0().optional()}),vK=c({taskSupport:l0(["required","optional","forbidden"]).optional()}),D7=c({...M9.shape,...$8.shape,description:v().optional(),inputSchema:c({type:t("object"),properties:x0(v(),V1).optional(),required:F0(v()).optional()}).catchall(y0()),outputSchema:c({type:t("object"),properties:x0(v(),V1).optional(),required:F0(v()).optional()}).catchall(y0()).optional(),annotations:s(kK),execution:s(vK),_meta:x0(v(),y0()).optional()}),yK=W8.extend({method:t("tools/list")}),xK=H8.extend({tools:F0(D7)}),Z7=c0.extend({content:F0(XQ).default([]),structuredContent:x0(v(),y0()).optional(),isError:s(m0())}),IP=Z7.or(c0.extend({toolResult:y0()})),gK=o0.extend({name:v(),arguments:s(x0(v(),y0()))}),hK=u0.extend({method:t("tools/call"),params:gK}),fK=Q1.extend({method:t("notifications/tools/list_changed")}),O7=l0(["debug","info","notice","warning","error","critical","alert","emergency"]),uK=o0.extend({level:O7}),mK=u0.extend({method:t("logging/setLevel"),params:uK}),lK=o1.extend({level:O7,logger:v().optional(),data:y0()}),cK=Q1.extend({method:t("notifications/message"),params:lK}),pK=c({name:v().optional()}),dK=c({hints:s(F0(pK)),costPriority:s(O0().min(0).max(1)),speedPriority:s(O0().min(0).max(1)),intelligencePriority:s(O0().min(0).max(1))}),iK=c({mode:s(l0(["auto","required","none"]))}),nK=c({type:t("tool_result"),toolUseId:v().describe("The unique identifier for the corresponding tool call."),content:F0(XQ).default([]),structuredContent:c({}).passthrough().optional(),isError:s(m0()),_meta:s(c({}).passthrough())}).passthrough(),rK=nJ("type",[sX,tX,eX]),J6=nJ("type",[sX,tX,eX,TK,nK]),oK=c({role:l0(["user","assistant"]),content:T0([J6,F0(J6)]),_meta:s(c({}).passthrough())}).passthrough(),aK=o0.extend({messages:F0(oK),modelPreferences:dK.optional(),systemPrompt:v().optional(),includeContext:l0(["none","thisServer","allServers"]).optional(),temperature:O0().optional(),maxTokens:O0().int(),stopSequences:F0(v()).optional(),metadata:V1.optional(),tools:s(F0(D7)),toolChoice:s(iK)}),sK=u0.extend({method:t("sampling/createMessage"),params:aK}),tK=c0.extend({model:v(),stopReason:s(l0(["endTurn","stopSequence","maxTokens"]).or(v())),role:l0(["user","assistant"]),content:rK}),eK=c0.extend({model:v(),stopReason:s(l0(["endTurn","stopSequence","maxTokens","toolUse"]).or(v())),role:l0(["user","assistant"]),content:T0([J6,F0(J6)])}),XV=c({type:t("boolean"),title:v().optional(),description:v().optional(),default:m0().optional()}),QV=c({type:t("string"),title:v().optional(),description:v().optional(),minLength:O0().optional(),maxLength:O0().optional(),format:l0(["email","uri","date","date-time"]).optional(),default:v().optional()}),JV=c({type:l0(["number","integer"]),title:v().optional(),description:v().optional(),minimum:O0().optional(),maximum:O0().optional(),default:O0().optional()}),YV=c({type:t("string"),title:v().optional(),description:v().optional(),enum:F0(v()),default:v().optional()}),GV=c({type:t("string"),title:v().optional(),description:v().optional(),oneOf:F0(c({const:v(),title:v()})),default:v().optional()}),$V=c({type:t("string"),title:v().optional(),description:v().optional(),enum:F0(v()),enumNames:F0(v()).optional(),default:v().optional()}),WV=T0([YV,GV]),HV=c({type:t("array"),title:v().optional(),description:v().optional(),minItems:O0().optional(),maxItems:O0().optional(),items:c({type:t("string"),enum:F0(v())}),default:F0(v()).optional()}),UV=c({type:t("array"),title:v().optional(),description:v().optional(),minItems:O0().optional(),maxItems:O0().optional(),items:c({anyOf:F0(c({const:v(),title:v()}))}),default:F0(v()).optional()}),zV=T0([HV,UV]),BV=T0([$V,WV,zV]),LV=T0([BV,XV,QV,JV]),qV=o0.extend({mode:t("form").optional(),message:v(),requestedSchema:c({type:t("object"),properties:x0(v(),LV),required:F0(v()).optional()})}),FV=o0.extend({mode:t("url"),message:v(),elicitationId:v(),url:v().url()}),KV=T0([qV,FV]),VV=u0.extend({method:t("elicitation/create"),params:KV}),MV=o1.extend({elicitationId:v()}),DV=Q1.extend({method:t("notifications/elicitation/complete"),params:MV}),ZV=c0.extend({action:l0(["accept","decline","cancel"]),content:tJ((X)=>X===null?void 0:X,x0(v(),T0([v(),O0(),m0(),F0(v())])).optional())}),OV=c({type:t("ref/resource"),uri:v()}),AV=c({type:t("ref/prompt"),name:v()}),NV=o0.extend({ref:T0([AV,OV]),argument:c({name:v(),value:v()}),context:c({arguments:x0(v(),v()).optional()}).optional()}),RV=u0.extend({method:t("completion/complete"),params:NV});var IV=c0.extend({completion:H1({values:F0(v()).max(100),total:s(O0().int()),hasMore:s(m0())})}),jV=c({uri:v().startsWith("file://"),name:v().optional(),_meta:x0(v(),y0()).optional()}),wV=u0.extend({method:t("roots/list")}),PV=c0.extend({roots:F0(jV)}),TV=Q1.extend({method:t("notifications/roots/list_changed")}),jP=T0([G7,tF,RV,mK,PK,IK,HK,zK,qK,MK,ZK,hK,yK,U7,B7,L7]),wP=T0([J7,$7,QK,TV,H7]),PP=T0([Q7,tK,eK,ZV,PV,z7,q7,W7]),TP=T0([G7,sK,VV,wV,U7,B7,L7]),SP=T0([J7,$7,cK,AK,KK,fK,_K,H7,DV]),EP=T0([Q7,XK,IV,CK,jK,UK,BK,FK,Z7,xK,z7,q7,W7]);var bP=Symbol("Let zodToJsonSchema decide on which parser to use");var CP=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");var _P=S4(x4(),1),kP=S4(iW(),1);var T4;(function(X){X.Completable="McpCompletable"})(T4||(T4={}));function A7({prompt:X,options:Q}){let{systemPrompt:J,settingSources:Y,sandbox:G,...$}=Q??{},W,H;if(J===void 0)W="";else if(typeof J==="string")W=J;else if(J.type==="preset")H=J.append;let U=$.pathToClaudeCodeExecutable;if(!U){let a=nW(import.meta.url),e=o5(a,"..");U=o5(e,"cli.js")}process.env.CLAUDE_AGENT_SDK_VERSION="0.2.1";let{abortController:z=g4(),additionalDirectories:F=[],agents:K,allowedTools:M=[],betas:R,canUseTool:w,continue:A,cwd:Z,disallowedTools:B=[],tools:V,env:q,executable:L=s4()?"bun":"node",executableArgs:O=[],extraArgs:D={},fallbackModel:I,enableFileCheckpointing:j,forkSession:E,hooks:g,includePartialMessages:k,persistSession:x,maxThinkingTokens:u,maxTurns:l,maxBudgetUsd:Y0,mcpServers:Z0,model:_0,outputFormat:h0,permissionMode:q0="default",allowDangerouslySkipPermissions:S=!1,permissionPromptToolName:b,plugins:f,resume:N,resumeSessionAt:T,stderr:C,strictMcpConfig:r}=$,X0=h0?.type==="json_schema"?h0.schema:void 0,U0=q;if(!U0)U0={...process.env};if(!U0.CLAUDE_CODE_ENTRYPOINT)U0.CLAUDE_CODE_ENTRYPOINT="sdk-ts";if(j)U0.CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTING="true";if(!U)throw Error("pathToClaudeCodeExecutable is required");let Q0={},S0=new Map;if(Z0)for(let[a,e]of Object.entries(Z0))if(e.type==="sdk"&&"instance"in e)S0.set(a,e.instance),Q0[a]={type:"sdk",name:a};else Q0[a]=e;let G1=typeof X==="string",P=new t4({abortController:z,additionalDirectories:F,betas:R,cwd:Z,executable:L,executableArgs:O,extraArgs:D,pathToClaudeCodeExecutable:U,env:U0,forkSession:E,stderr:C,maxThinkingTokens:u,maxTurns:l,maxBudgetUsd:Y0,model:_0,fallbackModel:I,jsonSchema:X0,permissionMode:q0,allowDangerouslySkipPermissions:S,permissionPromptToolName:b,continueConversation:A,resume:N,resumeSessionAt:T,settingSources:Y??[],allowedTools:M,disallowedTools:B,tools:V,mcpServers:Q0,strictMcpConfig:r,canUseTool:!!w,hooks:!!g,includePartialMessages:k,persistSession:x,plugins:f,sandbox:G,spawnClaudeCodeProcess:$.spawnClaudeCodeProcess}),h=new QJ(P,G1,w,g,z,S0,X0,{systemPrompt:W,appendSystemPrompt:H,agents:K});if(typeof X==="string")P.write(q1({type:"user",session_id:"",message:{role:"user",content:[{type:"text",text:X}]},parent_tool_use_id:null})+`
212
- `);else h.streamInput(X);return h}function QQ(X,Q){return new RegExp(`\\b${SV(Q)}\\b`,"gi").test(X)}function SV(X){return X.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}async function JQ(X,Q,J={}){let{onProgress:Y,...G}=J,$=[];for(let W of Q){Y?.(`Running: ${W.name}`);try{let H=await EV(W,X,G),U=QQ(H,X.name);$.push({scenario:W,passed:U,response:H}),Y?.(U?" Passed":" Failed")}catch(H){$.push({scenario:W,passed:!1,response:"",error:H instanceof Error?H.message:String(H)}),Y?.(` ✗ Error: ${H}`)}}return bV(X,$)}async function EV(X,Q,J){let Y=`You are an AI assistant helping a developer.
213
- The developer is working on "${Q.name}": ${Q.description}
214
- Keywords: ${Q.keywords.join(", ")}
206
+ path: iss.path ? [${$9(M)}, ...iss.path] : [${$9(M)}]
207
+ })));`),V.write(`newResult[${$9(M)}] = ${F}.value`)}V.write("payload.value = newResult;"),V.write("return payload;");let z=V.compile();return(M,F)=>z(K,M,F)},G,$=X8,W=!SX.jitless,U=W&&GJ.value,B=Q.catchall,q;X._zod.parse=(K,V)=>{q??(q=J.value);let N=K.value;if(!$(N))return K.issues.push({expected:"object",code:"invalid_type",input:N,inst:X}),K;let w=[];if(W&&U&&V?.async===!1&&V.jitless!==!0){if(!G)G=Y(Q.shape);K=G(K,V)}else{K.value={};let F=q.shape;for(let L of q.keys){let O=F[L],D=O._zod.run({value:N[L],issues:[]},V),I=O._zod.optin==="optional"&&O._zod.optout==="optional";if(D instanceof Promise)w.push(D.then((j)=>I?H5(j,K,L,N):f8(j,K,L)));else if(I)H5(D,K,L,N);else f8(D,K,L)}}if(!B)return w.length?Promise.all(w).then(()=>K):K;let A=[],Z=q.keySet,z=B._zod,M=z.def.type;for(let F of Object.keys(N)){if(Z.has(F))continue;if(M==="never"){A.push(F);continue}let L=z.run({value:N[F],issues:[]},V);if(L instanceof Promise)w.push(L.then((O)=>f8(O,K,F)));else f8(L,K,F)}if(A.length)K.issues.push({code:"unrecognized_keys",keys:A,input:N,inst:X});if(!w.length)return K;return Promise.all(w).then(()=>{return K})}});function U5(X,Q,J,Y){for(let G of X)if(G.issues.length===0)return Q.value=G.value,Q;return Q.issues.push({code:"invalid_union",input:Q.value,inst:J,errors:X.map((G)=>G.issues.map(($)=>S1($,Y,T1())))}),Q}var jJ=y("$ZodUnion",(X,Q)=>{I0.init(X,Q),R0(X._zod,"optin",()=>Q.options.some((J)=>J._zod.optin==="optional")?"optional":void 0),R0(X._zod,"optout",()=>Q.options.some((J)=>J._zod.optout==="optional")?"optional":void 0),R0(X._zod,"values",()=>{if(Q.options.every((J)=>J._zod.values))return new Set(Q.options.flatMap((J)=>Array.from(J._zod.values)));return}),R0(X._zod,"pattern",()=>{if(Q.options.every((J)=>J._zod.pattern)){let J=Q.options.map((Y)=>Y._zod.pattern);return new RegExp(`^(${J.map((Y)=>z6(Y.source)).join("|")})$`)}return}),X._zod.parse=(J,Y)=>{let G=!1,$=[];for(let W of Q.options){let H=W._zod.run({value:J.value,issues:[]},Y);if(H instanceof Promise)$.push(H),G=!0;else{if(H.issues.length===0)return H;$.push(H)}}if(!G)return U5($,J,X,Y);return Promise.all($).then((W)=>{return U5(W,J,X,Y)})}}),bL=y("$ZodDiscriminatedUnion",(X,Q)=>{jJ.init(X,Q);let J=X._zod.parse;R0(X._zod,"propValues",()=>{let G={};for(let $ of Q.options){let W=$._zod.propValues;if(!W||Object.keys(W).length===0)throw Error(`Invalid discriminated union option at index "${Q.options.indexOf($)}"`);for(let[H,U]of Object.entries(W)){if(!G[H])G[H]=new Set;for(let B of U)G[H].add(B)}}return G});let Y=U6(()=>{let G=Q.options,$=new Map;for(let W of G){let H=W._zod.propValues[Q.discriminator];if(!H||H.size===0)throw Error(`Invalid discriminated union option at index "${Q.options.indexOf(W)}"`);for(let U of H){if($.has(U))throw Error(`Duplicate discriminator value "${String(U)}"`);$.set(U,W)}}return $});X._zod.parse=(G,$)=>{let W=G.value;if(!X8(W))return G.issues.push({code:"invalid_type",expected:"object",input:W,inst:X}),G;let H=Y.value.get(W?.[Q.discriminator]);if(H)return H._zod.run(G,$);if(Q.unionFallback)return J(G,$);return G.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:W,path:[Q.discriminator],inst:X}),G}}),CL=y("$ZodIntersection",(X,Q)=>{I0.init(X,Q),X._zod.parse=(J,Y)=>{let G=J.value,$=Q.left._zod.run({value:G,issues:[]},Y),W=Q.right._zod.run({value:G,issues:[]},Y);if($ instanceof Promise||W instanceof Promise)return Promise.all([$,W]).then(([U,B])=>{return B5(J,U,B)});return B5(J,$,W)}});function bX(X,Q){if(X===Q)return{valid:!0,data:X};if(X instanceof Date&&Q instanceof Date&&+X===+Q)return{valid:!0,data:X};if(Q8(X)&&Q8(Q)){let J=Object.keys(Q),Y=Object.keys(X).filter(($)=>J.indexOf($)!==-1),G={...X,...Q};for(let $ of Y){let W=bX(X[$],Q[$]);if(!W.valid)return{valid:!1,mergeErrorPath:[$,...W.mergeErrorPath]};G[$]=W.data}return{valid:!0,data:G}}if(Array.isArray(X)&&Array.isArray(Q)){if(X.length!==Q.length)return{valid:!1,mergeErrorPath:[]};let J=[];for(let Y=0;Y<X.length;Y++){let G=X[Y],$=Q[Y],W=bX(G,$);if(!W.valid)return{valid:!1,mergeErrorPath:[Y,...W.mergeErrorPath]};J.push(W.data)}return{valid:!0,data:J}}return{valid:!1,mergeErrorPath:[]}}function B5(X,Q,J){if(Q.issues.length)X.issues.push(...Q.issues);if(J.issues.length)X.issues.push(...J.issues);if(H9(X))return X;let Y=bX(Q.value,J.value);if(!Y.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(Y.mergeErrorPath)}`);return X.value=Y.data,X}var _L=y("$ZodRecord",(X,Q)=>{I0.init(X,Q),X._zod.parse=(J,Y)=>{let G=J.value;if(!Q8(G))return J.issues.push({expected:"record",code:"invalid_type",input:G,inst:X}),J;let $=[];if(Q.keyType._zod.values){let W=Q.keyType._zod.values;J.value={};for(let U of W)if(typeof U==="string"||typeof U==="number"||typeof U==="symbol"){let B=Q.valueType._zod.run({value:G[U],issues:[]},Y);if(B instanceof Promise)$.push(B.then((q)=>{if(q.issues.length)J.issues.push(..._1(U,q.issues));J.value[U]=q.value}));else{if(B.issues.length)J.issues.push(..._1(U,B.issues));J.value[U]=B.value}}let H;for(let U in G)if(!W.has(U))H=H??[],H.push(U);if(H&&H.length>0)J.issues.push({code:"unrecognized_keys",input:G,inst:X,keys:H})}else{J.value={};for(let W of Reflect.ownKeys(G)){if(W==="__proto__")continue;let H=Q.keyType._zod.run({value:W,issues:[]},Y);if(H instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(H.issues.length){J.issues.push({origin:"record",code:"invalid_key",issues:H.issues.map((B)=>S1(B,Y,T1())),input:W,path:[W],inst:X}),J.value[H.value]=H.value;continue}let U=Q.valueType._zod.run({value:G[W],issues:[]},Y);if(U instanceof Promise)$.push(U.then((B)=>{if(B.issues.length)J.issues.push(..._1(W,B.issues));J.value[H.value]=B.value}));else{if(U.issues.length)J.issues.push(..._1(W,U.issues));J.value[H.value]=U.value}}}if($.length)return Promise.all($).then(()=>J);return J}}),kL=y("$ZodEnum",(X,Q)=>{I0.init(X,Q);let J=QJ(Q.entries);X._zod.values=new Set(J),X._zod.pattern=new RegExp(`^(${J.filter((Y)=>$J.has(typeof Y)).map((Y)=>typeof Y==="string"?Z9(Y):Y.toString()).join("|")})$`),X._zod.parse=(Y,G)=>{let $=Y.value;if(X._zod.values.has($))return Y;return Y.issues.push({code:"invalid_value",values:J,input:$,inst:X}),Y}}),vL=y("$ZodLiteral",(X,Q)=>{I0.init(X,Q),X._zod.values=new Set(Q.values),X._zod.pattern=new RegExp(`^(${Q.values.map((J)=>typeof J==="string"?Z9(J):J?J.toString():String(J)).join("|")})$`),X._zod.parse=(J,Y)=>{let G=J.value;if(X._zod.values.has(G))return J;return J.issues.push({code:"invalid_value",values:Q.values,input:G,inst:X}),J}}),yL=y("$ZodTransform",(X,Q)=>{I0.init(X,Q),X._zod.parse=(J,Y)=>{let G=Q.transform(J.value,J);if(Y.async)return(G instanceof Promise?G:Promise.resolve(G)).then((W)=>{return J.value=W,J});if(G instanceof Promise)throw new F9;return J.value=G,J}}),xL=y("$ZodOptional",(X,Q)=>{I0.init(X,Q),X._zod.optin="optional",X._zod.optout="optional",R0(X._zod,"values",()=>{return Q.innerType._zod.values?new Set([...Q.innerType._zod.values,void 0]):void 0}),R0(X._zod,"pattern",()=>{let J=Q.innerType._zod.pattern;return J?new RegExp(`^(${z6(J.source)})?$`):void 0}),X._zod.parse=(J,Y)=>{if(Q.innerType._zod.optin==="optional")return Q.innerType._zod.run(J,Y);if(J.value===void 0)return J;return Q.innerType._zod.run(J,Y)}}),gL=y("$ZodNullable",(X,Q)=>{I0.init(X,Q),R0(X._zod,"optin",()=>Q.innerType._zod.optin),R0(X._zod,"optout",()=>Q.innerType._zod.optout),R0(X._zod,"pattern",()=>{let J=Q.innerType._zod.pattern;return J?new RegExp(`^(${z6(J.source)}|null)$`):void 0}),R0(X._zod,"values",()=>{return Q.innerType._zod.values?new Set([...Q.innerType._zod.values,null]):void 0}),X._zod.parse=(J,Y)=>{if(J.value===null)return J;return Q.innerType._zod.run(J,Y)}}),hL=y("$ZodDefault",(X,Q)=>{I0.init(X,Q),X._zod.optin="optional",R0(X._zod,"values",()=>Q.innerType._zod.values),X._zod.parse=(J,Y)=>{if(J.value===void 0)return J.value=Q.defaultValue,J;let G=Q.innerType._zod.run(J,Y);if(G instanceof Promise)return G.then(($)=>z5($,Q));return z5(G,Q)}});function z5(X,Q){if(X.value===void 0)X.value=Q.defaultValue;return X}var fL=y("$ZodPrefault",(X,Q)=>{I0.init(X,Q),X._zod.optin="optional",R0(X._zod,"values",()=>Q.innerType._zod.values),X._zod.parse=(J,Y)=>{if(J.value===void 0)J.value=Q.defaultValue;return Q.innerType._zod.run(J,Y)}}),uL=y("$ZodNonOptional",(X,Q)=>{I0.init(X,Q),R0(X._zod,"values",()=>{let J=Q.innerType._zod.values;return J?new Set([...J].filter((Y)=>Y!==void 0)):void 0}),X._zod.parse=(J,Y)=>{let G=Q.innerType._zod.run(J,Y);if(G instanceof Promise)return G.then(($)=>L5($,X));return L5(G,X)}});function L5(X,Q){if(!X.issues.length&&X.value===void 0)X.issues.push({code:"invalid_type",expected:"nonoptional",input:X.value,inst:Q});return X}var mL=y("$ZodCatch",(X,Q)=>{I0.init(X,Q),X._zod.optin="optional",R0(X._zod,"optout",()=>Q.innerType._zod.optout),R0(X._zod,"values",()=>Q.innerType._zod.values),X._zod.parse=(J,Y)=>{let G=Q.innerType._zod.run(J,Y);if(G instanceof Promise)return G.then(($)=>{if(J.value=$.value,$.issues.length)J.value=Q.catchValue({...J,error:{issues:$.issues.map((W)=>S1(W,Y,T1()))},input:J.value}),J.issues=[];return J});if(J.value=G.value,G.issues.length)J.value=Q.catchValue({...J,error:{issues:G.issues.map(($)=>S1($,Y,T1()))},input:J.value}),J.issues=[];return J}}),lL=y("$ZodPipe",(X,Q)=>{I0.init(X,Q),R0(X._zod,"values",()=>Q.in._zod.values),R0(X._zod,"optin",()=>Q.in._zod.optin),R0(X._zod,"optout",()=>Q.out._zod.optout),X._zod.parse=(J,Y)=>{let G=Q.in._zod.run(J,Y);if(G instanceof Promise)return G.then(($)=>q5($,Q,Y));return q5(G,Q,Y)}});function q5(X,Q,J){if(H9(X))return X;return Q.out._zod.run({value:X.value,issues:X.issues},J)}var cL=y("$ZodReadonly",(X,Q)=>{I0.init(X,Q),R0(X._zod,"propValues",()=>Q.innerType._zod.propValues),R0(X._zod,"values",()=>Q.innerType._zod.values),R0(X._zod,"optin",()=>Q.innerType._zod.optin),R0(X._zod,"optout",()=>Q.innerType._zod.optout),X._zod.parse=(J,Y)=>{let G=Q.innerType._zod.run(J,Y);if(G instanceof Promise)return G.then(F5);return F5(G)}});function F5(X){return X.value=Object.freeze(X.value),X}var pL=y("$ZodCustom",(X,Q)=>{r0.init(X,Q),I0.init(X,Q),X._zod.parse=(J,Y)=>{return J},X._zod.check=(J)=>{let Y=J.value,G=Q.fn(Y);if(G instanceof Promise)return G.then(($)=>K5($,J,Y,X));K5(G,J,Y,X);return}});function K5(X,Q,J,Y){if(!X){let G={code:"custom",input:J,inst:Y,path:[...Y._zod.def.path??[]],continue:!Y._zod.def.abort};if(Y._zod.def.params)G.params=Y._zod.def.params;Q.issues.push(UJ(G))}}var dL=(X)=>{let Q=typeof X;switch(Q){case"number":return Number.isNaN(X)?"NaN":"number";case"object":{if(Array.isArray(X))return"array";if(X===null)return"null";if(Object.getPrototypeOf(X)!==Object.prototype&&X.constructor)return X.constructor.name}}return Q},iL=()=>{let X={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function Q(Y){return X[Y]??null}let J={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return(Y)=>{switch(Y.code){case"invalid_type":return`Invalid input: expected ${Y.expected}, received ${dL(Y.input)}`;case"invalid_value":if(Y.values.length===1)return`Invalid input: expected ${lX(Y.values[0])}`;return`Invalid option: expected one of ${EX(Y.values,"|")}`;case"too_big":{let G=Y.inclusive?"<=":"<",$=Q(Y.origin);if($)return`Too big: expected ${Y.origin??"value"} to have ${G}${Y.maximum.toString()} ${$.unit??"elements"}`;return`Too big: expected ${Y.origin??"value"} to be ${G}${Y.maximum.toString()}`}case"too_small":{let G=Y.inclusive?">=":">",$=Q(Y.origin);if($)return`Too small: expected ${Y.origin} to have ${G}${Y.minimum.toString()} ${$.unit}`;return`Too small: expected ${Y.origin} to be ${G}${Y.minimum.toString()}`}case"invalid_format":{let G=Y;if(G.format==="starts_with")return`Invalid string: must start with "${G.prefix}"`;if(G.format==="ends_with")return`Invalid string: must end with "${G.suffix}"`;if(G.format==="includes")return`Invalid string: must include "${G.includes}"`;if(G.format==="regex")return`Invalid string: must match pattern ${G.pattern}`;return`Invalid ${J[G.format]??Y.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${Y.divisor}`;case"unrecognized_keys":return`Unrecognized key${Y.keys.length>1?"s":""}: ${EX(Y.keys,", ")}`;case"invalid_key":return`Invalid key in ${Y.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${Y.origin}`;default:return"Invalid input"}}};function nL(){return{localeError:iL()}}var NP=Symbol("ZodOutput"),RP=Symbol("ZodInput");class wJ{constructor(){this._map=new WeakMap,this._idmap=new Map}add(X,...Q){let J=Q[0];if(this._map.set(X,J),J&&typeof J==="object"&&"id"in J){if(this._idmap.has(J.id))throw Error(`ID ${J.id} already exists in the registry`);this._idmap.set(J.id,X)}return this}remove(X){return this._map.delete(X),this}get(X){let Q=X._zod.parent;if(Q){let J={...this.get(Q)??{}};return delete J.id,{...J,...this._map.get(X)}}return this._map.get(X)}has(X){return this._map.has(X)}}function rL(){return new wJ}var u8=rL();function oL(X,Q){return new X({type:"string",...J0(Q)})}function aL(X,Q){return new X({type:"string",format:"email",check:"string_format",abort:!1,...J0(Q)})}function V5(X,Q){return new X({type:"string",format:"guid",check:"string_format",abort:!1,...J0(Q)})}function sL(X,Q){return new X({type:"string",format:"uuid",check:"string_format",abort:!1,...J0(Q)})}function tL(X,Q){return new X({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...J0(Q)})}function eL(X,Q){return new X({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...J0(Q)})}function Xq(X,Q){return new X({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...J0(Q)})}function Qq(X,Q){return new X({type:"string",format:"url",check:"string_format",abort:!1,...J0(Q)})}function Jq(X,Q){return new X({type:"string",format:"emoji",check:"string_format",abort:!1,...J0(Q)})}function Yq(X,Q){return new X({type:"string",format:"nanoid",check:"string_format",abort:!1,...J0(Q)})}function Gq(X,Q){return new X({type:"string",format:"cuid",check:"string_format",abort:!1,...J0(Q)})}function $q(X,Q){return new X({type:"string",format:"cuid2",check:"string_format",abort:!1,...J0(Q)})}function Wq(X,Q){return new X({type:"string",format:"ulid",check:"string_format",abort:!1,...J0(Q)})}function Hq(X,Q){return new X({type:"string",format:"xid",check:"string_format",abort:!1,...J0(Q)})}function Uq(X,Q){return new X({type:"string",format:"ksuid",check:"string_format",abort:!1,...J0(Q)})}function Bq(X,Q){return new X({type:"string",format:"ipv4",check:"string_format",abort:!1,...J0(Q)})}function zq(X,Q){return new X({type:"string",format:"ipv6",check:"string_format",abort:!1,...J0(Q)})}function Lq(X,Q){return new X({type:"string",format:"cidrv4",check:"string_format",abort:!1,...J0(Q)})}function qq(X,Q){return new X({type:"string",format:"cidrv6",check:"string_format",abort:!1,...J0(Q)})}function Fq(X,Q){return new X({type:"string",format:"base64",check:"string_format",abort:!1,...J0(Q)})}function Kq(X,Q){return new X({type:"string",format:"base64url",check:"string_format",abort:!1,...J0(Q)})}function Vq(X,Q){return new X({type:"string",format:"e164",check:"string_format",abort:!1,...J0(Q)})}function Mq(X,Q){return new X({type:"string",format:"jwt",check:"string_format",abort:!1,...J0(Q)})}function Dq(X,Q){return new X({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...J0(Q)})}function Zq(X,Q){return new X({type:"string",format:"date",check:"string_format",...J0(Q)})}function Oq(X,Q){return new X({type:"string",format:"time",check:"string_format",precision:null,...J0(Q)})}function Aq(X,Q){return new X({type:"string",format:"duration",check:"string_format",...J0(Q)})}function Nq(X,Q){return new X({type:"number",checks:[],...J0(Q)})}function Rq(X,Q){return new X({type:"number",check:"number_format",abort:!1,format:"safeint",...J0(Q)})}function Iq(X,Q){return new X({type:"boolean",...J0(Q)})}function jq(X,Q){return new X({type:"null",...J0(Q)})}function wq(X){return new X({type:"unknown"})}function Pq(X,Q){return new X({type:"never",...J0(Q)})}function M5(X,Q){return new OJ({check:"less_than",...J0(Q),value:X,inclusive:!1})}function NX(X,Q){return new OJ({check:"less_than",...J0(Q),value:X,inclusive:!0})}function D5(X,Q){return new AJ({check:"greater_than",...J0(Q),value:X,inclusive:!1})}function RX(X,Q){return new AJ({check:"greater_than",...J0(Q),value:X,inclusive:!0})}function Z5(X,Q){return new fz({check:"multiple_of",...J0(Q),value:X})}function PJ(X,Q){return new mz({check:"max_length",...J0(Q),maximum:X})}function e8(X,Q){return new lz({check:"min_length",...J0(Q),minimum:X})}function TJ(X,Q){return new cz({check:"length_equals",...J0(Q),length:X})}function Tq(X,Q){return new pz({check:"string_format",format:"regex",...J0(Q),pattern:X})}function Sq(X){return new dz({check:"string_format",format:"lowercase",...J0(X)})}function Eq(X){return new iz({check:"string_format",format:"uppercase",...J0(X)})}function bq(X,Q){return new nz({check:"string_format",format:"includes",...J0(Q),includes:X})}function Cq(X,Q){return new rz({check:"string_format",format:"starts_with",...J0(Q),prefix:X})}function _q(X,Q){return new oz({check:"string_format",format:"ends_with",...J0(Q),suffix:X})}function Y8(X){return new az({check:"overwrite",tx:X})}function kq(X){return Y8((Q)=>Q.normalize(X))}function vq(){return Y8((X)=>X.trim())}function yq(){return Y8((X)=>X.toLowerCase())}function xq(){return Y8((X)=>X.toUpperCase())}function gq(X,Q,J){return new X({type:"array",element:Q,...J0(J)})}function hq(X,Q,J){let Y=J0(J);return Y.abort??(Y.abort=!0),new X({type:"custom",check:"custom",fn:Q,...Y})}function fq(X,Q,J){return new X({type:"custom",check:"custom",fn:Q,...J0(J)})}var SJ={};w5(SJ,{time:()=>vJ,duration:()=>xJ,datetime:()=>bJ,date:()=>_J,ZodISOTime:()=>kJ,ZodISODuration:()=>yJ,ZodISODateTime:()=>EJ,ZodISODate:()=>CJ});var EJ=y("ZodISODateTime",(X,Q)=>{BL.init(X,Q),b0.init(X,Q)});function bJ(X){return Dq(EJ,X)}var CJ=y("ZodISODate",(X,Q)=>{zL.init(X,Q),b0.init(X,Q)});function _J(X){return Zq(CJ,X)}var kJ=y("ZodISOTime",(X,Q)=>{LL.init(X,Q),b0.init(X,Q)});function vJ(X){return Oq(kJ,X)}var yJ=y("ZodISODuration",(X,Q)=>{qL.init(X,Q),b0.init(X,Q)});function xJ(X){return Aq(yJ,X)}var gJ=(X,Q)=>{LJ.init(X,Q),X.name="ZodError",Object.defineProperties(X,{format:{value:(J)=>Wz(X,J)},flatten:{value:(J)=>$z(X,J)},addIssue:{value:(J)=>X.issues.push(J)},addIssues:{value:(J)=>X.issues.push(...J)},isEmpty:{get(){return X.issues.length===0}}})},IP=y("ZodError",gJ),F6=y("ZodError",gJ,{Parent:Error}),uq=Hz(F6),mq=Uz(F6),lq=FJ(F6),cq=KJ(F6),E0=y("ZodType",(X,Q)=>{return I0.init(X,Q),X.def=Q,Object.defineProperty(X,"_def",{value:Q}),X.check=(...J)=>{return X.clone({...Q,checks:[...Q.checks??[],...J.map((Y)=>typeof Y==="function"?{_zod:{check:Y,def:{check:"custom"},onattach:[]}}:Y)]})},X.clone=(J,Y)=>y1(X,J,Y),X.brand=()=>X,X.register=(J,Y)=>{return J.add(X,Y),X},X.parse=(J,Y)=>uq(X,J,Y,{callee:X.parse}),X.safeParse=(J,Y)=>lq(X,J,Y),X.parseAsync=async(J,Y)=>mq(X,J,Y,{callee:X.parseAsync}),X.safeParseAsync=async(J,Y)=>cq(X,J,Y),X.spa=X.safeParseAsync,X.refine=(J,Y)=>X.check(kF(J,Y)),X.superRefine=(J)=>X.check(vF(J)),X.overwrite=(J)=>X.check(Y8(J)),X.optional=()=>s(X),X.nullable=()=>N5(X),X.nullish=()=>s(N5(X)),X.nonoptional=(J)=>wF(X,J),X.array=()=>F0(X),X.or=(J)=>w0([X,J]),X.and=(J)=>pX(X,J),X.transform=(J)=>_X(X,pJ(J)),X.default=(J)=>RF(X,J),X.prefault=(J)=>jF(X,J),X.catch=(J)=>TF(X,J),X.pipe=(J)=>_X(X,J),X.readonly=()=>bF(X),X.describe=(J)=>{let Y=X.clone();return u8.add(Y,{description:J}),Y},Object.defineProperty(X,"description",{get(){return u8.get(X)?.description},configurable:!0}),X.meta=(...J)=>{if(J.length===0)return u8.get(X);let Y=X.clone();return u8.add(Y,J[0]),Y},X.isOptional=()=>X.safeParse(void 0).success,X.isNullable=()=>X.safeParse(null).success,X}),hJ=y("_ZodString",(X,Q)=>{cX.init(X,Q),E0.init(X,Q);let J=X._zod.bag;X.format=J.format??null,X.minLength=J.minimum??null,X.maxLength=J.maximum??null,X.regex=(...Y)=>X.check(Tq(...Y)),X.includes=(...Y)=>X.check(bq(...Y)),X.startsWith=(...Y)=>X.check(Cq(...Y)),X.endsWith=(...Y)=>X.check(_q(...Y)),X.min=(...Y)=>X.check(e8(...Y)),X.max=(...Y)=>X.check(PJ(...Y)),X.length=(...Y)=>X.check(TJ(...Y)),X.nonempty=(...Y)=>X.check(e8(1,...Y)),X.lowercase=(Y)=>X.check(Sq(Y)),X.uppercase=(Y)=>X.check(Eq(Y)),X.trim=()=>X.check(vq()),X.normalize=(...Y)=>X.check(kq(...Y)),X.toLowerCase=()=>X.check(yq()),X.toUpperCase=()=>X.check(xq())}),pq=y("ZodString",(X,Q)=>{cX.init(X,Q),hJ.init(X,Q),X.email=(J)=>X.check(aL(dq,J)),X.url=(J)=>X.check(Qq(iq,J)),X.jwt=(J)=>X.check(Mq(HF,J)),X.emoji=(J)=>X.check(Jq(nq,J)),X.guid=(J)=>X.check(V5(O5,J)),X.uuid=(J)=>X.check(sL(m8,J)),X.uuidv4=(J)=>X.check(tL(m8,J)),X.uuidv6=(J)=>X.check(eL(m8,J)),X.uuidv7=(J)=>X.check(Xq(m8,J)),X.nanoid=(J)=>X.check(Yq(rq,J)),X.guid=(J)=>X.check(V5(O5,J)),X.cuid=(J)=>X.check(Gq(oq,J)),X.cuid2=(J)=>X.check($q(aq,J)),X.ulid=(J)=>X.check(Wq(sq,J)),X.base64=(J)=>X.check(Fq(GF,J)),X.base64url=(J)=>X.check(Kq($F,J)),X.xid=(J)=>X.check(Hq(tq,J)),X.ksuid=(J)=>X.check(Uq(eq,J)),X.ipv4=(J)=>X.check(Bq(XF,J)),X.ipv6=(J)=>X.check(zq(QF,J)),X.cidrv4=(J)=>X.check(Lq(JF,J)),X.cidrv6=(J)=>X.check(qq(YF,J)),X.e164=(J)=>X.check(Vq(WF,J)),X.datetime=(J)=>X.check(bJ(J)),X.date=(J)=>X.check(_J(J)),X.time=(J)=>X.check(vJ(J)),X.duration=(J)=>X.check(xJ(J))});function v(X){return oL(pq,X)}var b0=y("ZodStringFormat",(X,Q)=>{j0.init(X,Q),hJ.init(X,Q)}),dq=y("ZodEmail",(X,Q)=>{XL.init(X,Q),b0.init(X,Q)}),O5=y("ZodGUID",(X,Q)=>{tz.init(X,Q),b0.init(X,Q)}),m8=y("ZodUUID",(X,Q)=>{ez.init(X,Q),b0.init(X,Q)}),iq=y("ZodURL",(X,Q)=>{QL.init(X,Q),b0.init(X,Q)}),nq=y("ZodEmoji",(X,Q)=>{JL.init(X,Q),b0.init(X,Q)}),rq=y("ZodNanoID",(X,Q)=>{YL.init(X,Q),b0.init(X,Q)}),oq=y("ZodCUID",(X,Q)=>{GL.init(X,Q),b0.init(X,Q)}),aq=y("ZodCUID2",(X,Q)=>{$L.init(X,Q),b0.init(X,Q)}),sq=y("ZodULID",(X,Q)=>{WL.init(X,Q),b0.init(X,Q)}),tq=y("ZodXID",(X,Q)=>{HL.init(X,Q),b0.init(X,Q)}),eq=y("ZodKSUID",(X,Q)=>{UL.init(X,Q),b0.init(X,Q)}),XF=y("ZodIPv4",(X,Q)=>{FL.init(X,Q),b0.init(X,Q)}),QF=y("ZodIPv6",(X,Q)=>{KL.init(X,Q),b0.init(X,Q)}),JF=y("ZodCIDRv4",(X,Q)=>{VL.init(X,Q),b0.init(X,Q)}),YF=y("ZodCIDRv6",(X,Q)=>{ML.init(X,Q),b0.init(X,Q)}),GF=y("ZodBase64",(X,Q)=>{DL.init(X,Q),b0.init(X,Q)}),$F=y("ZodBase64URL",(X,Q)=>{OL.init(X,Q),b0.init(X,Q)}),WF=y("ZodE164",(X,Q)=>{AL.init(X,Q),b0.init(X,Q)}),HF=y("ZodJWT",(X,Q)=>{RL.init(X,Q),b0.init(X,Q)}),fJ=y("ZodNumber",(X,Q)=>{IJ.init(X,Q),E0.init(X,Q),X.gt=(Y,G)=>X.check(D5(Y,G)),X.gte=(Y,G)=>X.check(RX(Y,G)),X.min=(Y,G)=>X.check(RX(Y,G)),X.lt=(Y,G)=>X.check(M5(Y,G)),X.lte=(Y,G)=>X.check(NX(Y,G)),X.max=(Y,G)=>X.check(NX(Y,G)),X.int=(Y)=>X.check(A5(Y)),X.safe=(Y)=>X.check(A5(Y)),X.positive=(Y)=>X.check(D5(0,Y)),X.nonnegative=(Y)=>X.check(RX(0,Y)),X.negative=(Y)=>X.check(M5(0,Y)),X.nonpositive=(Y)=>X.check(NX(0,Y)),X.multipleOf=(Y,G)=>X.check(Z5(Y,G)),X.step=(Y,G)=>X.check(Z5(Y,G)),X.finite=()=>X;let J=X._zod.bag;X.minValue=Math.max(J.minimum??Number.NEGATIVE_INFINITY,J.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,X.maxValue=Math.min(J.maximum??Number.POSITIVE_INFINITY,J.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,X.isInt=(J.format??"").includes("int")||Number.isSafeInteger(J.multipleOf??0.5),X.isFinite=!0,X.format=J.format??null});function A0(X){return Nq(fJ,X)}var UF=y("ZodNumberFormat",(X,Q)=>{IL.init(X,Q),fJ.init(X,Q)});function A5(X){return Rq(UF,X)}var BF=y("ZodBoolean",(X,Q)=>{jL.init(X,Q),E0.init(X,Q)});function m0(X){return Iq(BF,X)}var zF=y("ZodNull",(X,Q)=>{wL.init(X,Q),E0.init(X,Q)});function uJ(X){return jq(zF,X)}var LF=y("ZodUnknown",(X,Q)=>{PL.init(X,Q),E0.init(X,Q)});function y0(){return wq(LF)}var qF=y("ZodNever",(X,Q)=>{TL.init(X,Q),E0.init(X,Q)});function FF(X){return Pq(qF,X)}var KF=y("ZodArray",(X,Q)=>{SL.init(X,Q),E0.init(X,Q),X.element=Q.element,X.min=(J,Y)=>X.check(e8(J,Y)),X.nonempty=(J)=>X.check(e8(1,J)),X.max=(J,Y)=>X.check(PJ(J,Y)),X.length=(J,Y)=>X.check(TJ(J,Y)),X.unwrap=()=>X.element});function F0(X,Q){return gq(KF,X,Q)}var mJ=y("ZodObject",(X,Q)=>{EL.init(X,Q),E0.init(X,Q),N0.defineLazy(X,"shape",()=>Q.shape),X.keyof=()=>l0(Object.keys(X._zod.def.shape)),X.catchall=(J)=>X.clone({...X._zod.def,catchall:J}),X.passthrough=()=>X.clone({...X._zod.def,catchall:y0()}),X.loose=()=>X.clone({...X._zod.def,catchall:y0()}),X.strict=()=>X.clone({...X._zod.def,catchall:FF()}),X.strip=()=>X.clone({...X._zod.def,catchall:void 0}),X.extend=(J)=>{return N0.extend(X,J)},X.merge=(J)=>N0.merge(X,J),X.pick=(J)=>N0.pick(X,J),X.omit=(J)=>N0.omit(X,J),X.partial=(...J)=>N0.partial(dJ,X,J[0]),X.required=(...J)=>N0.required(iJ,X,J[0])});function c(X,Q){let J={type:"object",get shape(){return N0.assignProp(this,"shape",{...X}),this.shape},...N0.normalizeParams(Q)};return new mJ(J)}function W1(X,Q){return new mJ({type:"object",get shape(){return N0.assignProp(this,"shape",{...X}),this.shape},catchall:y0(),...N0.normalizeParams(Q)})}var lJ=y("ZodUnion",(X,Q)=>{jJ.init(X,Q),E0.init(X,Q),X.options=Q.options});function w0(X,Q){return new lJ({type:"union",options:X,...N0.normalizeParams(Q)})}var VF=y("ZodDiscriminatedUnion",(X,Q)=>{lJ.init(X,Q),bL.init(X,Q)});function cJ(X,Q,J){return new VF({type:"union",options:Q,discriminator:X,...N0.normalizeParams(J)})}var MF=y("ZodIntersection",(X,Q)=>{CL.init(X,Q),E0.init(X,Q)});function pX(X,Q){return new MF({type:"intersection",left:X,right:Q})}var DF=y("ZodRecord",(X,Q)=>{_L.init(X,Q),E0.init(X,Q),X.keyType=Q.keyType,X.valueType=Q.valueType});function x0(X,Q,J){return new DF({type:"record",keyType:X,valueType:Q,...N0.normalizeParams(J)})}var CX=y("ZodEnum",(X,Q)=>{kL.init(X,Q),E0.init(X,Q),X.enum=Q.entries,X.options=Object.values(Q.entries);let J=new Set(Object.keys(Q.entries));X.extract=(Y,G)=>{let $={};for(let W of Y)if(J.has(W))$[W]=Q.entries[W];else throw Error(`Key ${W} not found in enum`);return new CX({...Q,checks:[],...N0.normalizeParams(G),entries:$})},X.exclude=(Y,G)=>{let $={...Q.entries};for(let W of Y)if(J.has(W))delete $[W];else throw Error(`Key ${W} not found in enum`);return new CX({...Q,checks:[],...N0.normalizeParams(G),entries:$})}});function l0(X,Q){let J=Array.isArray(X)?Object.fromEntries(X.map((Y)=>[Y,Y])):X;return new CX({type:"enum",entries:J,...N0.normalizeParams(Q)})}var ZF=y("ZodLiteral",(X,Q)=>{vL.init(X,Q),E0.init(X,Q),X.values=new Set(Q.values),Object.defineProperty(X,"value",{get(){if(Q.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return Q.values[0]}})});function t(X,Q){return new ZF({type:"literal",values:Array.isArray(X)?X:[X],...N0.normalizeParams(Q)})}var OF=y("ZodTransform",(X,Q)=>{yL.init(X,Q),E0.init(X,Q),X._zod.parse=(J,Y)=>{J.addIssue=($)=>{if(typeof $==="string")J.issues.push(N0.issue($,J.value,Q));else{let W=$;if(W.fatal)W.continue=!1;W.code??(W.code="custom"),W.input??(W.input=J.value),W.inst??(W.inst=X),W.continue??(W.continue=!0),J.issues.push(N0.issue(W))}};let G=Q.transform(J.value,J);if(G instanceof Promise)return G.then(($)=>{return J.value=$,J});return J.value=G,J}});function pJ(X){return new OF({type:"transform",transform:X})}var dJ=y("ZodOptional",(X,Q)=>{xL.init(X,Q),E0.init(X,Q),X.unwrap=()=>X._zod.def.innerType});function s(X){return new dJ({type:"optional",innerType:X})}var AF=y("ZodNullable",(X,Q)=>{gL.init(X,Q),E0.init(X,Q),X.unwrap=()=>X._zod.def.innerType});function N5(X){return new AF({type:"nullable",innerType:X})}var NF=y("ZodDefault",(X,Q)=>{hL.init(X,Q),E0.init(X,Q),X.unwrap=()=>X._zod.def.innerType,X.removeDefault=X.unwrap});function RF(X,Q){return new NF({type:"default",innerType:X,get defaultValue(){return typeof Q==="function"?Q():Q}})}var IF=y("ZodPrefault",(X,Q)=>{fL.init(X,Q),E0.init(X,Q),X.unwrap=()=>X._zod.def.innerType});function jF(X,Q){return new IF({type:"prefault",innerType:X,get defaultValue(){return typeof Q==="function"?Q():Q}})}var iJ=y("ZodNonOptional",(X,Q)=>{uL.init(X,Q),E0.init(X,Q),X.unwrap=()=>X._zod.def.innerType});function wF(X,Q){return new iJ({type:"nonoptional",innerType:X,...N0.normalizeParams(Q)})}var PF=y("ZodCatch",(X,Q)=>{mL.init(X,Q),E0.init(X,Q),X.unwrap=()=>X._zod.def.innerType,X.removeCatch=X.unwrap});function TF(X,Q){return new PF({type:"catch",innerType:X,catchValue:typeof Q==="function"?Q:()=>Q})}var SF=y("ZodPipe",(X,Q)=>{lL.init(X,Q),E0.init(X,Q),X.in=Q.in,X.out=Q.out});function _X(X,Q){return new SF({type:"pipe",in:X,out:Q})}var EF=y("ZodReadonly",(X,Q)=>{cL.init(X,Q),E0.init(X,Q)});function bF(X){return new EF({type:"readonly",innerType:X})}var nJ=y("ZodCustom",(X,Q)=>{pL.init(X,Q),E0.init(X,Q)});function CF(X,Q){let J=new r0({check:"custom",...N0.normalizeParams(Q)});return J._zod.check=X,J}function _F(X,Q){return hq(nJ,X??(()=>!0),Q)}function kF(X,Q={}){return fq(nJ,X,Q)}function vF(X,Q){let J=CF((Y)=>{return Y.addIssue=(G)=>{if(typeof G==="string")Y.issues.push(N0.issue(G,Y.value,J._zod.def));else{let $=G;if($.fatal)$.continue=!1;$.code??($.code="custom"),$.input??($.input=Y.value),$.inst??($.inst=J),$.continue??($.continue=!J._zod.def.abort),Y.issues.push(N0.issue($))}},X(Y.value,Y)},Q);return J}function rJ(X,Q){return _X(pJ(X),Q)}T1(nL());var dX="io.modelcontextprotocol/related-task",K6="2.0",V1=_F((X)=>X!==null&&(typeof X==="object"||typeof X==="function")),oJ=w0([v(),A0().int()]),aJ=v(),yF=W1({ttl:w0([A0(),uJ()]).optional(),pollInterval:A0().optional()}),iX=W1({taskId:v()}),xF=W1({progressToken:oJ.optional(),[dX]:iX.optional()}),o0=W1({task:yF.optional(),_meta:xF.optional()}),u0=c({method:v(),params:o0.optional()}),o1=W1({_meta:c({[dX]:s(iX)}).passthrough().optional()}),X1=c({method:v(),params:o1.optional()}),c0=W1({_meta:W1({[dX]:iX.optional()}).optional()}),V6=w0([v(),A0().int()]),gF=c({jsonrpc:t(K6),id:V6,...u0.shape}).strict();var hF=c({jsonrpc:t(K6),...X1.shape}).strict();var fF=c({jsonrpc:t(K6),id:V6,result:c0}).strict();var R5;(function(X){X[X.ConnectionClosed=-32000]="ConnectionClosed",X[X.RequestTimeout=-32001]="RequestTimeout",X[X.ParseError=-32700]="ParseError",X[X.InvalidRequest=-32600]="InvalidRequest",X[X.MethodNotFound=-32601]="MethodNotFound",X[X.InvalidParams=-32602]="InvalidParams",X[X.InternalError=-32603]="InternalError",X[X.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(R5||(R5={}));var uF=c({jsonrpc:t(K6),id:V6,error:c({code:A0().int(),message:v(),data:s(y0())})}).strict();var jP=w0([gF,hF,fF,uF]),sJ=c0.strict(),mF=o1.extend({requestId:V6,reason:v().optional()}),tJ=X1.extend({method:t("notifications/cancelled"),params:mF}),lF=c({src:v(),mimeType:v().optional(),sizes:F0(v()).optional()}),G8=c({icons:F0(lF).optional()}),K9=c({name:v(),title:v().optional()}),eJ=K9.extend({...K9.shape,...G8.shape,version:v(),websiteUrl:v().optional()}),cF=pX(c({applyDefaults:m0().optional()}),x0(v(),y0())),pF=rJ((X)=>{if(X&&typeof X==="object"&&!Array.isArray(X)){if(Object.keys(X).length===0)return{form:{}}}return X},pX(c({form:cF.optional(),url:V1.optional()}),x0(v(),y0()).optional())),dF=c({list:s(c({}).passthrough()),cancel:s(c({}).passthrough()),requests:s(c({sampling:s(c({createMessage:s(c({}).passthrough())}).passthrough()),elicitation:s(c({create:s(c({}).passthrough())}).passthrough())}).passthrough())}).passthrough(),iF=c({list:s(c({}).passthrough()),cancel:s(c({}).passthrough()),requests:s(c({tools:s(c({call:s(c({}).passthrough())}).passthrough())}).passthrough())}).passthrough(),nF=c({experimental:x0(v(),V1).optional(),sampling:c({context:V1.optional(),tools:V1.optional()}).optional(),elicitation:pF.optional(),roots:c({listChanged:m0().optional()}).optional(),tasks:s(dF)}),rF=o0.extend({protocolVersion:v(),capabilities:nF,clientInfo:eJ}),oF=u0.extend({method:t("initialize"),params:rF}),aF=c({experimental:x0(v(),V1).optional(),logging:V1.optional(),completions:V1.optional(),prompts:s(c({listChanged:s(m0())})),resources:c({subscribe:m0().optional(),listChanged:m0().optional()}).optional(),tools:c({listChanged:m0().optional()}).optional(),tasks:s(iF)}).passthrough(),sF=c0.extend({protocolVersion:v(),capabilities:aF,serverInfo:eJ,instructions:v().optional()}),tF=X1.extend({method:t("notifications/initialized")}),X7=u0.extend({method:t("ping")}),eF=c({progress:A0(),total:s(A0()),message:s(v())}),XK=c({...o1.shape,...eF.shape,progressToken:oJ}),Q7=X1.extend({method:t("notifications/progress"),params:XK}),QK=o0.extend({cursor:aJ.optional()}),$8=u0.extend({params:QK.optional()}),W8=c0.extend({nextCursor:s(aJ)}),H8=c({taskId:v(),status:l0(["working","input_required","completed","failed","cancelled"]),ttl:w0([A0(),uJ()]),createdAt:v(),lastUpdatedAt:v(),pollInterval:s(A0()),statusMessage:s(v())}),J7=c0.extend({task:H8}),JK=o1.merge(H8),Y7=X1.extend({method:t("notifications/tasks/status"),params:JK}),G7=u0.extend({method:t("tasks/get"),params:o0.extend({taskId:v()})}),$7=c0.merge(H8),W7=u0.extend({method:t("tasks/result"),params:o0.extend({taskId:v()})}),H7=$8.extend({method:t("tasks/list")}),U7=W8.extend({tasks:F0(H8)}),wP=u0.extend({method:t("tasks/cancel"),params:o0.extend({taskId:v()})}),PP=c0.merge(H8),B7=c({uri:v(),mimeType:s(v()),_meta:x0(v(),y0()).optional()}),z7=B7.extend({text:v()}),nX=v().refine((X)=>{try{return atob(X),!0}catch(Q){return!1}},{message:"Invalid Base64 string"}),L7=B7.extend({blob:nX}),O9=c({audience:F0(l0(["user","assistant"])).optional(),priority:A0().min(0).max(1).optional(),lastModified:SJ.datetime({offset:!0}).optional()}),q7=c({...K9.shape,...G8.shape,uri:v(),description:s(v()),mimeType:s(v()),annotations:O9.optional(),_meta:s(W1({}))}),YK=c({...K9.shape,...G8.shape,uriTemplate:v(),description:s(v()),mimeType:s(v()),annotations:O9.optional(),_meta:s(W1({}))}),GK=$8.extend({method:t("resources/list")}),$K=W8.extend({resources:F0(q7)}),WK=$8.extend({method:t("resources/templates/list")}),HK=W8.extend({resourceTemplates:F0(YK)}),rX=o0.extend({uri:v()}),UK=rX,BK=u0.extend({method:t("resources/read"),params:UK}),zK=c0.extend({contents:F0(w0([z7,L7]))}),LK=X1.extend({method:t("notifications/resources/list_changed")}),qK=rX,FK=u0.extend({method:t("resources/subscribe"),params:qK}),KK=rX,VK=u0.extend({method:t("resources/unsubscribe"),params:KK}),MK=o1.extend({uri:v()}),DK=X1.extend({method:t("notifications/resources/updated"),params:MK}),ZK=c({name:v(),description:s(v()),required:s(m0())}),OK=c({...K9.shape,...G8.shape,description:s(v()),arguments:s(F0(ZK)),_meta:s(W1({}))}),AK=$8.extend({method:t("prompts/list")}),NK=W8.extend({prompts:F0(OK)}),RK=o0.extend({name:v(),arguments:x0(v(),v()).optional()}),IK=u0.extend({method:t("prompts/get"),params:RK}),oX=c({type:t("text"),text:v(),annotations:O9.optional(),_meta:x0(v(),y0()).optional()}),aX=c({type:t("image"),data:nX,mimeType:v(),annotations:O9.optional(),_meta:x0(v(),y0()).optional()}),sX=c({type:t("audio"),data:nX,mimeType:v(),annotations:O9.optional(),_meta:x0(v(),y0()).optional()}),jK=c({type:t("tool_use"),name:v(),id:v(),input:c({}).passthrough(),_meta:s(c({}).passthrough())}).passthrough(),wK=c({type:t("resource"),resource:w0([z7,L7]),annotations:O9.optional(),_meta:x0(v(),y0()).optional()}),PK=q7.extend({type:t("resource_link")}),tX=w0([oX,aX,sX,PK,wK]),TK=c({role:l0(["user","assistant"]),content:tX}),SK=c0.extend({description:s(v()),messages:F0(TK)}),EK=X1.extend({method:t("notifications/prompts/list_changed")}),bK=c({title:v().optional(),readOnlyHint:m0().optional(),destructiveHint:m0().optional(),idempotentHint:m0().optional(),openWorldHint:m0().optional()}),CK=c({taskSupport:l0(["required","optional","forbidden"]).optional()}),F7=c({...K9.shape,...G8.shape,description:v().optional(),inputSchema:c({type:t("object"),properties:x0(v(),V1).optional(),required:F0(v()).optional()}).catchall(y0()),outputSchema:c({type:t("object"),properties:x0(v(),V1).optional(),required:F0(v()).optional()}).catchall(y0()).optional(),annotations:s(bK),execution:s(CK),_meta:x0(v(),y0()).optional()}),_K=$8.extend({method:t("tools/list")}),kK=W8.extend({tools:F0(F7)}),K7=c0.extend({content:F0(tX).default([]),structuredContent:x0(v(),y0()).optional(),isError:s(m0())}),TP=K7.or(c0.extend({toolResult:y0()})),vK=o0.extend({name:v(),arguments:s(x0(v(),y0()))}),yK=u0.extend({method:t("tools/call"),params:vK}),xK=X1.extend({method:t("notifications/tools/list_changed")}),V7=l0(["debug","info","notice","warning","error","critical","alert","emergency"]),gK=o0.extend({level:V7}),hK=u0.extend({method:t("logging/setLevel"),params:gK}),fK=o1.extend({level:V7,logger:v().optional(),data:y0()}),uK=X1.extend({method:t("notifications/message"),params:fK}),mK=c({name:v().optional()}),lK=c({hints:s(F0(mK)),costPriority:s(A0().min(0).max(1)),speedPriority:s(A0().min(0).max(1)),intelligencePriority:s(A0().min(0).max(1))}),cK=c({mode:s(l0(["auto","required","none"]))}),pK=c({type:t("tool_result"),toolUseId:v().describe("The unique identifier for the corresponding tool call."),content:F0(tX).default([]),structuredContent:c({}).passthrough().optional(),isError:s(m0()),_meta:s(c({}).passthrough())}).passthrough(),dK=cJ("type",[oX,aX,sX]),X6=cJ("type",[oX,aX,sX,jK,pK]),iK=c({role:l0(["user","assistant"]),content:w0([X6,F0(X6)]),_meta:s(c({}).passthrough())}).passthrough(),nK=o0.extend({messages:F0(iK),modelPreferences:lK.optional(),systemPrompt:v().optional(),includeContext:l0(["none","thisServer","allServers"]).optional(),temperature:A0().optional(),maxTokens:A0().int(),stopSequences:F0(v()).optional(),metadata:V1.optional(),tools:s(F0(F7)),toolChoice:s(cK)}),rK=u0.extend({method:t("sampling/createMessage"),params:nK}),oK=c0.extend({model:v(),stopReason:s(l0(["endTurn","stopSequence","maxTokens"]).or(v())),role:l0(["user","assistant"]),content:dK}),aK=c0.extend({model:v(),stopReason:s(l0(["endTurn","stopSequence","maxTokens","toolUse"]).or(v())),role:l0(["user","assistant"]),content:w0([X6,F0(X6)])}),sK=c({type:t("boolean"),title:v().optional(),description:v().optional(),default:m0().optional()}),tK=c({type:t("string"),title:v().optional(),description:v().optional(),minLength:A0().optional(),maxLength:A0().optional(),format:l0(["email","uri","date","date-time"]).optional(),default:v().optional()}),eK=c({type:l0(["number","integer"]),title:v().optional(),description:v().optional(),minimum:A0().optional(),maximum:A0().optional(),default:A0().optional()}),XV=c({type:t("string"),title:v().optional(),description:v().optional(),enum:F0(v()),default:v().optional()}),QV=c({type:t("string"),title:v().optional(),description:v().optional(),oneOf:F0(c({const:v(),title:v()})),default:v().optional()}),JV=c({type:t("string"),title:v().optional(),description:v().optional(),enum:F0(v()),enumNames:F0(v()).optional(),default:v().optional()}),YV=w0([XV,QV]),GV=c({type:t("array"),title:v().optional(),description:v().optional(),minItems:A0().optional(),maxItems:A0().optional(),items:c({type:t("string"),enum:F0(v())}),default:F0(v()).optional()}),$V=c({type:t("array"),title:v().optional(),description:v().optional(),minItems:A0().optional(),maxItems:A0().optional(),items:c({anyOf:F0(c({const:v(),title:v()}))}),default:F0(v()).optional()}),WV=w0([GV,$V]),HV=w0([JV,YV,WV]),UV=w0([HV,sK,tK,eK]),BV=o0.extend({mode:t("form").optional(),message:v(),requestedSchema:c({type:t("object"),properties:x0(v(),UV),required:F0(v()).optional()})}),zV=o0.extend({mode:t("url"),message:v(),elicitationId:v(),url:v().url()}),LV=w0([BV,zV]),qV=u0.extend({method:t("elicitation/create"),params:LV}),FV=o1.extend({elicitationId:v()}),KV=X1.extend({method:t("notifications/elicitation/complete"),params:FV}),VV=c0.extend({action:l0(["accept","decline","cancel"]),content:rJ((X)=>X===null?void 0:X,x0(v(),w0([v(),A0(),m0(),F0(v())])).optional())}),MV=c({type:t("ref/resource"),uri:v()}),DV=c({type:t("ref/prompt"),name:v()}),ZV=o0.extend({ref:w0([DV,MV]),argument:c({name:v(),value:v()}),context:c({arguments:x0(v(),v()).optional()}).optional()}),OV=u0.extend({method:t("completion/complete"),params:ZV});var AV=c0.extend({completion:W1({values:F0(v()).max(100),total:s(A0().int()),hasMore:s(m0())})}),NV=c({uri:v().startsWith("file://"),name:v().optional(),_meta:x0(v(),y0()).optional()}),RV=u0.extend({method:t("roots/list")}),IV=c0.extend({roots:F0(NV)}),jV=X1.extend({method:t("notifications/roots/list_changed")}),SP=w0([X7,oF,OV,hK,IK,AK,GK,WK,BK,FK,VK,yK,_K,G7,W7,H7]),EP=w0([tJ,Q7,tF,jV,Y7]),bP=w0([sJ,oK,aK,VV,IV,$7,U7,J7]),CP=w0([X7,rK,qV,RV,G7,W7,H7]),_P=w0([tJ,Q7,uK,DK,LK,xK,EK,Y7,KV]),kP=w0([sJ,sF,AV,SK,NK,$K,HK,zK,K7,kK,$7,U7,J7]);var vP=Symbol("Let zodToJsonSchema decide on which parser to use");var yP=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");var xP=j5(_5(),1),gP=j5(cW(),1);var I5;(function(X){X.Completable="McpCompletable"})(I5||(I5={}));function M7({prompt:X,options:Q}){let{systemPrompt:J,settingSources:Y,sandbox:G,...$}=Q??{},W,H;if(J===void 0)W="";else if(typeof J==="string")W=J;else if(J.type==="preset")H=J.append;let U=$.pathToClaudeCodeExecutable;if(!U){let a=pW(import.meta.url),e=d4(a,"..");U=d4(e,"cli.js")}process.env.CLAUDE_AGENT_SDK_VERSION="0.2.1";let{abortController:B=k5(),additionalDirectories:q=[],agents:K,allowedTools:V=[],betas:N,canUseTool:w,continue:A,cwd:Z,disallowedTools:z=[],tools:M,env:F,executable:L=n5()?"bun":"node",executableArgs:O=[],extraArgs:D={},fallbackModel:I,enableFileCheckpointing:j,forkSession:E,hooks:g,includePartialMessages:k,persistSession:x,maxThinkingTokens:u,maxTurns:l,maxBudgetUsd:Y0,mcpServers:O0,model:_0,outputFormat:h0,permissionMode:q0="default",allowDangerouslySkipPermissions:S=!1,permissionPromptToolName:b,plugins:f,resume:R,resumeSessionAt:T,stderr:C,strictMcpConfig:r}=$,X0=h0?.type==="json_schema"?h0.schema:void 0,U0=F;if(!U0)U0={...process.env};if(!U0.CLAUDE_CODE_ENTRYPOINT)U0.CLAUDE_CODE_ENTRYPOINT="sdk-ts";if(j)U0.CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTING="true";if(!U)throw Error("pathToClaudeCodeExecutable is required");let Q0={},S0=new Map;if(O0)for(let[a,e]of Object.entries(O0))if(e.type==="sdk"&&"instance"in e)S0.set(a,e.instance),Q0[a]={type:"sdk",name:a};else Q0[a]=e;let G1=typeof X==="string",P=new r5({abortController:B,additionalDirectories:q,betas:N,cwd:Z,executable:L,executableArgs:O,extraArgs:D,pathToClaudeCodeExecutable:U,env:U0,forkSession:E,stderr:C,maxThinkingTokens:u,maxTurns:l,maxBudgetUsd:Y0,model:_0,fallbackModel:I,jsonSchema:X0,permissionMode:q0,allowDangerouslySkipPermissions:S,permissionPromptToolName:b,continueConversation:A,resume:R,resumeSessionAt:T,settingSources:Y??[],allowedTools:V,disallowedTools:z,tools:M,mcpServers:Q0,strictMcpConfig:r,canUseTool:!!w,hooks:!!g,includePartialMessages:k,persistSession:x,plugins:f,sandbox:G,spawnClaudeCodeProcess:$.spawnClaudeCodeProcess}),h=new s5(P,G1,w,g,B,S0,X0,{systemPrompt:W,appendSystemPrompt:H,agents:K});if(typeof X==="string")P.write(q1({type:"user",session_id:"",message:{role:"user",content:[{type:"text",text:X}]},parent_tool_use_id:null})+`
208
+ `);else h.streamInput(X);return h}class eX{category="cli";provider="claude-code";name;config;constructor(X,Q){this.name=X,this.config=Q}async run(X,Q){let{tool:J,cwd:Y,context:G}=Q,$=[],W=[],H=this.buildSystemPrompt(J),U=G?.allowedTools??this.config.allowedTools??["Read","Glob","Grep","Bash"],B=G?.disallowedTools??this.config.disallowedTools??["Edit","Write","NotebookEdit"],q={cwd:Y,model:this.config.model??"claude-sonnet-4-20250514",systemPrompt:H,allowedTools:U,disallowedTools:B,permissionMode:this.config.permissionMode??"acceptEdits",maxTurns:this.config.maxTurns??5,mcpServers:G?.mcpServers??this.config.mcpServers,settingSources:[]},K="";for await(let V of M7({prompt:X,options:q})){if(V.type==="assistant"){let N=V.message?.content;if(Array.isArray(N))for(let w of N){if(w.type==="text")K+=w.text;if(w.type==="tool_use"){let A=w;if(!$.includes(A.name))$.push(A.name)}}}if(V.type==="result"){let N=V;if(N.subtype==="success"&&N.result)K+=N.result}if(V.type==="tool_result"){let N=V;if(N.tool_name==="Read"&&typeof N.content==="string"){let w=N.content.match(/^Reading (.+)/);if(w)W.push(w[1])}}}return{response:K,toolsUsed:$,sources:W,metadata:{model:this.config.model??"claude-sonnet-4-20250514",category:this.category,provider:this.provider,target:this.name}}}buildSystemPrompt(X){return`You are helping a developer understand how to use "${X.name}": ${X.description}
209
+
210
+ Your task is to answer questions about this tool accurately based on the available documentation.
211
+
212
+ You have access to read the codebase to find documentation, examples, and implementation details.
213
+ Look for README files, doc comments, examples directories, and source code.
214
+
215
+ After answering, provide a structured assessment in JSON format:
216
+ \`\`\`json
217
+ {
218
+ "answerable": "YES" | "PARTIAL" | "NO",
219
+ "confidence": 0-100,
220
+ "reason": "Brief explanation of your assessment",
221
+ "missing": ["List of missing documentation if applicable"] or null
222
+ }
223
+ \`\`\`
215
224
 
216
- Answer naturally. If ${Q.name} is relevant to the question, mention it.`,G="",$={...process.env};delete $.ANTHROPIC_API_KEY;let W={cwd:Q.path,model:J.model??"claude-sonnet-4-20250514",systemPrompt:Y,allowedTools:J.allowedTools??["Read","Glob","Grep","Bash"],disallowedTools:J.disallowedTools??["Edit","Write","NotebookEdit"],permissionMode:J.permissionMode??"acceptEdits",maxTurns:J.maxTurns??5,mcpServers:J.mcpServers,settingSources:[]};for await(let H of A7({prompt:X.prompt,options:W})){if(H.type==="assistant"){let U=H.message?.content;if(Array.isArray(U)){for(let z of U)if(z.type==="text")G+=z.text}}if(H.type==="result"){let U=H;if(U.subtype==="success"&&U.result)G+=U.result}}return G}function bV(X,Q){let J=Q.length,Y=Q.filter((G)=>G.passed).length;return{tool:{name:X.name,description:X.description,path:X.path},scenarios:Q,summary:{total:J,passed:Y,failed:J-Y,freshness:J>0?Math.round(Y/J*100):0}}}var bG=Z5(EG(),1);async function K5(X){let Q=`${X}/pickled.yml`,J=Bun.file(Q);if(!await J.exists())throw Error(`pickled.yml not found in ${X}`);try{let Y=await J.text();return bG.default.parse(Y)}catch(Y){throw Error(`Failed to parse pickled.yml: ${Y}`)}}import bj from"node:path";async function CG(X,Q){let{json:J,output:Y,verbose:G}=Q,$=(K)=>!J&&console.log(w0.dim(K)),W=bj.resolve(X);$("\uD83E\uDD52 Loading pickled.yml...");let H;try{H=await K5(W)}catch(K){console.error(w0.red(`\uD83E\uDD52 ${K instanceof Error?K.message:K}`)),console.error(),console.error(w0.dim("Run `pickled init` to create a config file")),process.exit(1)}let U={name:H.tool.name,description:H.tool.description,keywords:H.tool.keywords,path:W};if(G){$(` Tool: ${U.name}`),$(` Scenarios: ${H.scenarios.length}`);for(let K of H.scenarios)$(` - ${K.name}`)}$("\uD83D\uDCCA Checking your freshness..."),console.log();let z=await JQ(U,H.scenarios,{...H.runner,onProgress:(K)=>{if(G||!J)console.log(w0.dim(` ${K}`))}});if(Y)await Bun.write(Y,g8(z)),$(`
217
- \uD83E\uDD52 Report saved to ${Y}`);else if(J)console.log(g8(z));else OX(z);let F=Q.threshold?parseInt(Q.threshold,10):H.threshold??0;if(z.summary.freshness<F)console.error(w0.red(`
218
- \uD83E\uDD52 Freshness ${z.summary.freshness}% is below threshold ${F}%`)),process.exit(1)}import Cj from"node:path";var _j=`tool:
225
+ - YES: The documentation fully answers the question
226
+ - PARTIAL: Some information is available but incomplete
227
+ - NO: Cannot find relevant documentation`}}var A9={category:"cli",provider:"claude-code",model:"claude-sonnet-4-20250514"};function XQ(X,Q){let J=Q??A9;switch(J.category){case"cli":return wV(X,J);case"api":throw Error("API targets not yet implemented. Coming soon!");case"ide":throw Error("IDE targets not yet implemented. Coming soon!");default:throw Error(`Unknown target category: ${J.category}`)}}function wV(X,Q){switch(Q.provider){case"claude-code":return new eX(X,Q);case"gemini-cli":throw Error("Gemini CLI target not yet implemented. Coming soon!");case"amazon-q":throw Error("Amazon Q target not yet implemented. Coming soon!");default:throw Error(`Unknown CLI provider: ${Q.provider}`)}}function QQ(X,Q){if(!X)return{name:"default",config:A9};if(Q?.[X])return{name:X,config:Q[X]};return console.warn(`Target "${X}" not found, using default`),{name:"default",config:A9}}function JQ(X){let Q=X.match(/```json\s*([\s\S]*?)\s*```/);if(Q)try{let J=JSON.parse(Q[1]);return D7(J)}catch{}try{let J=JSON.parse(X);return D7(J)}catch{}return SV(X)}function D7(X){let Q=PV(X.answerable),J=TV(X.confidence),Y=String(X.reason||""),G=Array.isArray(X.missing)?X.missing.map(String):void 0;return{answerable:Q,confidence:J,reason:Y,missing:G}}function PV(X){let Q=String(X).toUpperCase();if(Q==="YES"||Q==="TRUE")return"YES";if(Q==="PARTIAL"||Q==="MAYBE")return"PARTIAL";return"NO"}function TV(X){let Q=Number(X);if(Number.isNaN(Q))return 50;if(Q>=0&&Q<=1)return Math.round(Q*100);return Math.max(0,Math.min(100,Math.round(Q)))}function SV(X){let Q=X.toLowerCase(),J=Q.includes("cannot find")||Q.includes("not documented")||Q.includes("no documentation")||Q.includes("unable to")||Q.includes("don't have information"),Y=Q.includes("partially")||Q.includes("some information")||Q.includes("limited documentation");if(J)return{answerable:"NO",confidence:30,reason:"Unable to find relevant documentation"};if(Y)return{answerable:"PARTIAL",confidence:60,reason:"Found some relevant information"};if(X.length>100)return{answerable:"YES",confidence:70,reason:"Found relevant information"};return{answerable:"PARTIAL",confidence:50,reason:"Unable to determine answer quality"}}async function YQ(X,Q,J={}){let{onProgress:Y}=J,G=[];if(Q.scenarios.length===0)throw Error("No scenarios defined in config");let $;if(Q.docs?.source){Y?.("Loading documentation...");try{$=await MX(Q.docs.source),Y?.(` Loaded: ${$.name}`)}catch(W){Y?.(` Warning: ${W instanceof Error?W.message:W}`),$=DX(X.path)}}Y?.("");for(let W of Q.scenarios){Y?.(`Running: ${W.name}`);try{let H=await EV(W,X,Q,{onProgress:Y});G.push(H);let U=H.answerable==="YES"?"✓":H.answerable==="PARTIAL"?"⚠":"✗";Y?.(` ${U} ${H.answerable} (${H.confidence}%)`)}catch(H){let U={scenario:W,answerable:"NO",confidence:0,response:"",reason:"Error during validation",error:H instanceof Error?H.message:String(H)};G.push(U),Y?.(` ✗ Error: ${H}`)}}return bV(X,$,G)}async function EV(X,Q,J,Y){let{name:G,config:$}=QQ(X.target,J.targets),H=await XQ(G,$).run(X.prompt,{tool:Q,cwd:Q.path,onProgress:Y.onProgress}),U=JQ(H.response);return{scenario:X,answerable:U.answerable,confidence:U.confidence,response:H.response,reason:U.reason,missing:U.missing,target:H.metadata,toolsUsed:H.toolsUsed,sources:H.sources}}function bV(X,Q,J){let Y=J.length,G=J.filter((W)=>W.answerable==="YES"||W.answerable==="PARTIAL").length,$=Y>0?Math.round(J.reduce((W,H)=>{if(H.answerable==="YES")return W+H.confidence;if(H.answerable==="PARTIAL")return W+H.confidence*0.5;return W},0)/Y):0;return{tool:{name:X.name,description:X.description,path:X.path},docs:Q?{source:Q.name,type:Q.type}:void 0,scenarios:J,summary:{total:Y,answered:G,unanswered:Y-G,score:$}}}var TG=j4(PG(),1);async function V4(X){let Q=`${X}/pickled.yml`,J=Bun.file(Q);if(!await J.exists())throw Error(`pickled.yml not found in ${X}`);try{let Y=await J.text();return TG.default.parse(Y)}catch(Y){throw Error(`Failed to parse pickled.yml: ${Y}`)}}var SG=(X=0)=>(Q)=>`\x1B[${Q+X}m`,EG=(X=0)=>(Q)=>`\x1B[${38+X};5;${Q}m`,bG=(X=0)=>(Q,J,Y)=>`\x1B[${38+X};2;${Q};${J};${Y}m`,P0={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},M2=Object.keys(P0.modifier),bj=Object.keys(P0.color),Cj=Object.keys(P0.bgColor),D2=[...bj,...Cj];function _j(){let X=new Map;for(let[Q,J]of Object.entries(P0)){for(let[Y,G]of Object.entries(J))P0[Y]={open:`\x1B[${G[0]}m`,close:`\x1B[${G[1]}m`},J[Y]=P0[Y],X.set(G[0],G[1]);Object.defineProperty(P0,Q,{value:J,enumerable:!1})}return Object.defineProperty(P0,"codes",{value:X,enumerable:!1}),P0.color.close="\x1B[39m",P0.bgColor.close="\x1B[49m",P0.color.ansi=SG(),P0.color.ansi256=EG(),P0.color.ansi16m=bG(),P0.bgColor.ansi=SG(10),P0.bgColor.ansi256=EG(10),P0.bgColor.ansi16m=bG(10),Object.defineProperties(P0,{rgbToAnsi256:{value(Q,J,Y){if(Q===J&&J===Y){if(Q<8)return 16;if(Q>248)return 231;return Math.round((Q-8)/247*24)+232}return 16+36*Math.round(Q/255*5)+6*Math.round(J/255*5)+Math.round(Y/255*5)},enumerable:!1},hexToRgb:{value(Q){let J=/[a-f\d]{6}|[a-f\d]{3}/i.exec(Q.toString(16));if(!J)return[0,0,0];let[Y]=J;if(Y.length===3)Y=[...Y].map(($)=>$+$).join("");let G=Number.parseInt(Y,16);return[G>>16&255,G>>8&255,G&255]},enumerable:!1},hexToAnsi256:{value:(Q)=>P0.rgbToAnsi256(...P0.hexToRgb(Q)),enumerable:!1},ansi256ToAnsi:{value(Q){if(Q<8)return 30+Q;if(Q<16)return 90+(Q-8);let J,Y,G;if(Q>=232)J=((Q-232)*10+8)/255,Y=J,G=J;else{Q-=16;let H=Q%36;J=Math.floor(Q/36)/5,Y=Math.floor(H/6)/5,G=H%6/5}let $=Math.max(J,Y,G)*2;if($===0)return 30;let W=30+(Math.round(G)<<2|Math.round(Y)<<1|Math.round(J));if($===2)W+=60;return W},enumerable:!1},rgbToAnsi:{value:(Q,J,Y)=>P0.ansi256ToAnsi(P0.rgbToAnsi256(Q,J,Y)),enumerable:!1},hexToAnsi:{value:(Q)=>P0.ansi256ToAnsi(P0.hexToAnsi256(Q)),enumerable:!1}}),P0}var kj=_j(),z1=kj;import M4 from"node:process";import vj from"node:os";import CG from"node:tty";function Y1(X,Q=globalThis.Deno?globalThis.Deno.args:M4.argv){let J=X.startsWith("-")?"":X.length===1?"-":"--",Y=Q.indexOf(J+X),G=Q.indexOf("--");return Y!==-1&&(G===-1||Y<G)}var{env:T0}=M4,YX;if(Y1("no-color")||Y1("no-colors")||Y1("color=false")||Y1("color=never"))YX=0;else if(Y1("color")||Y1("colors")||Y1("color=true")||Y1("color=always"))YX=1;function yj(){if("FORCE_COLOR"in T0){if(T0.FORCE_COLOR==="true")return 1;if(T0.FORCE_COLOR==="false")return 0;return T0.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(T0.FORCE_COLOR,10),3)}}function xj(X){if(X===0)return!1;return{level:X,hasBasic:!0,has256:X>=2,has16m:X>=3}}function gj(X,{streamIsTTY:Q,sniffFlags:J=!0}={}){let Y=yj();if(Y!==void 0)YX=Y;let G=J?YX:Y;if(G===0)return 0;if(J){if(Y1("color=16m")||Y1("color=full")||Y1("color=truecolor"))return 3;if(Y1("color=256"))return 2}if("TF_BUILD"in T0&&"AGENT_NAME"in T0)return 1;if(X&&!Q&&G===void 0)return 0;let $=G||0;if(T0.TERM==="dumb")return $;if(M4.platform==="win32"){let W=vj.release().split(".");if(Number(W[0])>=10&&Number(W[2])>=10586)return Number(W[2])>=14931?3:2;return 1}if("CI"in T0){if(["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some((W)=>(W in T0)))return 3;if(["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((W)=>(W in T0))||T0.CI_NAME==="codeship")return 1;return $}if("TEAMCITY_VERSION"in T0)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(T0.TEAMCITY_VERSION)?1:0;if(T0.COLORTERM==="truecolor")return 3;if(T0.TERM==="xterm-kitty")return 3;if(T0.TERM==="xterm-ghostty")return 3;if(T0.TERM==="wezterm")return 3;if("TERM_PROGRAM"in T0){let W=Number.parseInt((T0.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(T0.TERM_PROGRAM){case"iTerm.app":return W>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(T0.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(T0.TERM))return 1;if("COLORTERM"in T0)return 1;return $}function _G(X,Q={}){let J=gj(X,{streamIsTTY:X&&X.isTTY,...Q});return xj(J)}var hj={stdout:_G({isTTY:CG.isatty(1)}),stderr:_G({isTTY:CG.isatty(2)})},kG=hj;function vG(X,Q,J){let Y=X.indexOf(Q);if(Y===-1)return X;let G=Q.length,$=0,W="";do W+=X.slice($,Y)+Q+J,$=Y+G,Y=X.indexOf(Q,$);while(Y!==-1);return W+=X.slice($),W}function yG(X,Q,J,Y){let G=0,$="";do{let W=X[Y-1]==="\r";$+=X.slice(G,W?Y-1:Y)+Q+(W?`\r
228
+ `:`
229
+ `)+J,G=Y+1,Y=X.indexOf(`
230
+ `,G)}while(Y!==-1);return $+=X.slice(G),$}var{stdout:xG,stderr:gG}=kG,D4=Symbol("GENERATOR"),_9=Symbol("STYLER"),_8=Symbol("IS_EMPTY"),hG=["ansi","ansi","ansi256","ansi16m"],k9=Object.create(null),fj=(X,Q={})=>{if(Q.level&&!(Number.isInteger(Q.level)&&Q.level>=0&&Q.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let J=xG?xG.level:0;X.level=Q.level===void 0?J:Q.level};var uj=(X)=>{let Q=(...J)=>J.join(" ");return fj(Q,X),Object.setPrototypeOf(Q,k8.prototype),Q};function k8(X){return uj(X)}Object.setPrototypeOf(k8.prototype,Function.prototype);for(let[X,Q]of Object.entries(z1))k9[X]={get(){let J=GX(this,O4(Q.open,Q.close,this[_9]),this[_8]);return Object.defineProperty(this,X,{value:J}),J}};k9.visible={get(){let X=GX(this,this[_9],!0);return Object.defineProperty(this,"visible",{value:X}),X}};var Z4=(X,Q,J,...Y)=>{if(X==="rgb"){if(Q==="ansi16m")return z1[J].ansi16m(...Y);if(Q==="ansi256")return z1[J].ansi256(z1.rgbToAnsi256(...Y));return z1[J].ansi(z1.rgbToAnsi(...Y))}if(X==="hex")return Z4("rgb",Q,J,...z1.hexToRgb(...Y));return z1[J][X](...Y)},mj=["rgb","hex","ansi256"];for(let X of mj){k9[X]={get(){let{level:J}=this;return function(...Y){let G=O4(Z4(X,hG[J],"color",...Y),z1.color.close,this[_9]);return GX(this,G,this[_8])}}};let Q="bg"+X[0].toUpperCase()+X.slice(1);k9[Q]={get(){let{level:J}=this;return function(...Y){let G=O4(Z4(X,hG[J],"bgColor",...Y),z1.bgColor.close,this[_9]);return GX(this,G,this[_8])}}}}var lj=Object.defineProperties(()=>{},{...k9,level:{enumerable:!0,get(){return this[D4].level},set(X){this[D4].level=X}}}),O4=(X,Q,J)=>{let Y,G;if(J===void 0)Y=X,G=Q;else Y=J.openAll+X,G=Q+J.closeAll;return{open:X,close:Q,openAll:Y,closeAll:G,parent:J}},GX=(X,Q,J)=>{let Y=(...G)=>cj(Y,G.length===1?""+G[0]:G.join(" "));return Object.setPrototypeOf(Y,lj),Y[D4]=X,Y[_9]=Q,Y[_8]=J,Y},cj=(X,Q)=>{if(X.level<=0||!Q)return X[_8]?"":Q;let J=X[_9];if(J===void 0)return Q;let{openAll:Y,closeAll:G}=J;if(Q.includes("\x1B"))while(J!==void 0)Q=vG(Q,J.close,J.open),J=J.parent;let $=Q.indexOf(`
231
+ `);if($!==-1)Q=yG(Q,G,Y,$);return Y+Q+G};Object.defineProperties(k8.prototype,k9);var pj=k8(),T2=k8({level:gG?gG.level:0});var M0=pj;var fG="━".repeat(55);function dj(X){let Q=Math.round(X/20),J=5-Q;return"\uD83E\uDD52".repeat(Q)+"░".repeat(J)}function uG(X){if(X>=90)return{label:"Well preserved",color:M0.green};if(X>=70)return{label:"Fresh",color:M0.green};if(X>=50)return{label:"Going stale",color:M0.yellow};return{label:"Gone sour",color:M0.red}}function ij(X){if(X.error)return{icon:M0.red("✗"),status:`error: ${X.error.slice(0,40)}`,color:M0.red};let{label:Q,color:J}=uG(X.confidence);if(X.answerable==="YES")return{icon:M0.green("✓"),status:`${Q} (${X.confidence}%)`,color:J};if(X.answerable==="PARTIAL")return{icon:M0.yellow("⚠"),status:`${Q} (${X.confidence}%)`,color:M0.yellow};return{icon:M0.red("✗"),status:`Gone sour (${X.confidence}%)`,color:M0.red}}function A4(X){let{tool:Q,scenarios:J,summary:Y}=X,G=J;if(console.log(),console.log(M0.bold("\uD83E\uDD52 Freshness Check")),console.log(fG),console.log(),console.log(`Tool: ${M0.cyan(Q.name)}`),X.docs)console.log(`Docs: ${M0.dim(X.docs.source)}`);console.log();for(let W of G){let{icon:H,status:U}=ij(W),B=W.target?M0.dim(`[${W.target.target}]`):"";if(console.log(` ${B} ${H} "${W.scenario.name}" - ${U}`),W.reason&&W.answerable!=="YES")console.log(M0.dim(` ${W.reason}`));if(W.missing&&W.missing.length>0)console.log(M0.dim(` Missing: ${W.missing.join(", ")}`));if(W.toolsUsed&&W.toolsUsed.length>0)console.log(M0.dim(` Tools: ${W.toolsUsed.join(", ")}`))}console.log(),console.log(fG),console.log(`Freshness Score: ${Y.score}% ${dj(Y.score)}`),console.log();let{color:$}=uG(Y.score);if(Y.score>=90)console.log($("\uD83E\uDD52 Perfectly preserved! Your docs are in great shape."));else if(Y.score>=70)console.log($("\uD83E\uDD52 Looking fresh! Your docs are doing well."));else if(Y.score>=50)console.log($("\uD83E\uDD52 Starting to spoil... Some docs need attention."));else console.log($("\uD83E\uDD52 Something went sour. Time to freshen up your docs."));console.log()}function $X(X){return JSON.stringify(X,null,2)}async function mG(X,Q){let{json:J,output:Y,verbose:G}=Q,$=(K)=>!J&&console.log(M0.dim(K)),W=nj.resolve(X);$("\uD83E\uDD52 Loading pickled.yml...");let H;try{H=await V4(W)}catch(K){console.error(M0.red(`\uD83E\uDD52 ${K instanceof Error?K.message:K}`)),console.error(),console.error(M0.dim("Run `pickled init` to create a config file")),process.exit(1)}let U={name:H.tool.name,description:H.tool.description,path:W};if(G){$(` Tool: ${U.name}`),$(` Scenarios: ${H.scenarios.length}`);for(let K of H.scenarios)$(` - ${K.name}`)}$("\uD83E\uDD52 Checking your freshness..."),console.log();let B=await YQ(U,H,{onProgress:(K)=>{if(G||!J)console.log(M0.dim(` ${K}`))}});if(Y)await Bun.write(Y,$X(B)),$(`
232
+ \uD83E\uDD52 Report saved to ${Y}`);else if(J)console.log($X(B));else A4(B);let q=Q.threshold?parseInt(Q.threshold,10):H.threshold??0;if(B.summary.score<q)console.error(M0.red(`
233
+ \uD83E\uDD52 Freshness score ${B.summary.score}% is below threshold ${q}%`)),console.error(M0.dim(" Time to freshen up your docs!")),process.exit(1)}import rj from"node:path";var oj=`# \uD83E\uDD52 pickled.yml - Check your freshness!
234
+
235
+ tool:
219
236
  name: "your-tool"
220
237
  description: "A short description of what your tool does"
221
- keywords:
222
- - keyword1
223
- - keyword2
224
238
 
239
+ # Scenarios: Questions to test AI's knowledge of your tool
225
240
  scenarios:
226
- - name: "General discovery"
227
- prompt: "What's a good library for [your use case]?"
241
+ - name: "Getting started"
242
+ prompt: "How do I install and set up this tool?"
243
+
244
+ - name: "Basic usage"
245
+ prompt: "Show me a basic example of using this tool"
246
+
247
+ - name: "Error handling"
248
+ prompt: "How do I handle errors?"
228
249
 
229
- - name: "Specific feature"
230
- prompt: "I need a tool that can [specific feature]. What should I use?"
250
+ # Optional: Fail CI if freshness score below threshold
251
+ # threshold: 80
231
252
 
232
- # Optional: fail CI if freshness below threshold
233
- # threshold: 50
234
- `;async function _G(X){let J=`${Cj.resolve(X)}/pickled.yml`;if(await Bun.file(J).exists())console.error(w0.red("\uD83E\uDD52 pickled.yml already exists")),process.exit(1);await Bun.write(J,_j),console.log(w0.green("\uD83E\uDD52 Created pickled.yml")),console.log(),console.log(w0.dim("Next steps:")),console.log(w0.dim(" 1. Edit pickled.yml with your tool info and scenarios")),console.log(w0.dim(" 2. Run: pickled check"))}var kG={name:"@pickled-dev/cli",version:"0.1.0",description:"Stay fresh in AI 🥒",module:"dist/index.js",type:"module",bin:{pickled:"./dist/index.js"},files:["dist"],scripts:{dev:"bun run ./src/index.ts",build:"bun build ./src/index.ts --outdir ./dist --target node --minify",release:"semantic-release"},dependencies:{commander:"^14.0.2",chalk:"^5.6.2"},devDependencies:{"@pickled-dev/core":"workspace:*","semantic-release":"^25.0.2","@semantic-release/commit-analyzer":"^13.0.1","@semantic-release/exec":"^7.1.0","@semantic-release/git":"^10.0.1","@semantic-release/github":"^12.0.2"}};y9.name("pickled").description("Preserve your visibility in AI \uD83E\uDD52").version(kG.version);y9.command("init").description("Create a pickled.yml config file").argument("[path]","Path to your project (default: current directory)",".").action(_G);y9.command("check").description("Check if AI recommends your tool").argument("[path]","Path to your project (default: current directory)",".").option("--json","Output as JSON").option("-o, --output <file>","Save report to file").option("-v, --verbose","Show detailed progress").option("-t, --threshold <percent>","Minimum freshness % to pass (overrides config)").action(CG);y9.parse();
253
+ # Advanced: Named targets for testing across different AI tools
254
+ # targets:
255
+ # claude-sonnet:
256
+ # category: cli
257
+ # provider: claude-code
258
+ # model: claude-sonnet-4-20250514
259
+ #
260
+ # Then reference in scenarios:
261
+ # scenarios:
262
+ # - name: "Test with Sonnet"
263
+ # prompt: "How do I install?"
264
+ # target: claude-sonnet
265
+ `;async function lG(X){let J=`${rj.resolve(X)}/pickled.yml`;if(await Bun.file(J).exists())console.error(M0.red("\uD83E\uDD52 pickled.yml already exists")),process.exit(1);await Bun.write(J,oj),console.log(M0.green("\uD83E\uDD52 Created pickled.yml")),console.log(),console.log(M0.dim("Next steps:")),console.log(M0.dim(" 1. Edit pickled.yml with your tool info and scenarios")),console.log(M0.dim(" 2. Run: pickled check")),console.log(),console.log(M0.dim("Stay fresh! \uD83E\uDD52"))}x9.name("pickled").description("Preserve your visibility in AI \uD83E\uDD52").version(l4.version);x9.command("init").description("Create a pickled.yml config file").argument("[path]","Path to your project (default: current directory)",".").action(lG);x9.command("check").description("Check if AI can answer questions about your tool").argument("[path]","Path to your project (default: current directory)",".").option("--json","Output as JSON").option("-o, --output <file>","Save report to file").option("-v, --verbose","Show detailed progress").option("-t, --threshold <percent>","Minimum score % to pass (overrides config)").action(mG);x9.parse();