@longzai-intelligence-oxlint/cli 0.2.4 → 0.2.6

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 (2) hide show
  1. package/dist/index.js +87 -87
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -30,16 +30,16 @@ if(e&&e.length===3){let n=/^\s*/.exec(t)[0].length+4,a=` `.repeat(n),c=e[2],l=JS
30
30
  t===!0&&Array.prototype.push.apply(g,n);let _=``,{plain:v,errors:y}=Object.entries(e).reduce(({plain:t,errors:n},[r,i])=>{if(g.includes(r)===!1){let a=typeof d[r]==`function`?d[r](i,r,e,{colors:h.colors}):i;f.includes(r)?n[r]=a:t[r]=a}return{plain:t,errors:n}},{plain:{},errors:{}});return m?
31
31
  /* istanbul ignore else */
32
32
  (Object.keys(v).length>0&&(_+=p.greyMessage(r(v))),_+=l,_=_.replace(/\\\\/gi,`\\`)):Object.entries(v).forEach(([e,t])=>{let n=typeof d[e]==`function`?t:r(t,null,2);if(n===void 0)return;n=n.replace(/\\\\/gi,`\\`);let a=i({input:n,ident:u,eol:l}),s=o(e);_+=`${u}${p.property(s)}:${a.startsWith(l)?``:` `}${a}${l}`}),Object.entries(y).forEach(([e,t])=>{let n=typeof d[e]==`function`,i=n?t:r(t,null,2);i!==void 0&&(_+=a({keyName:e,lines:i,eol:l,ident:u,sanitizeStack:!n}))}),_}})),yt=/* @__PURE__ */ S(((e,t)=>{t.exports=s;let{LOGGER_KEYS:n}=Je(),r=ft(),i=pt(),a=vt(),o=gt();function s({log:e,context:t}){let{EOL:s,IDENT:c,errorProps:l,messageKey:u}=t,d=o(e.stack),f=`${c}${i({input:d,ident:c,eol:s})}${s}`;if(l.length>0){let i=n.concat(u,`type`,`stack`),d;d=l[0]===`*`?Object.keys(e).filter(e=>i.includes(e)===!1):l.filter(e=>i.includes(e)===!1);for(let n=0;n<d.length;n+=1){let i=d[n];if(!(i in e))continue;let l=o(i);if(r(e[i])){let n=a({log:e[i],excludeLoggerKeys:!1,context:{...t,IDENT:c+c}});f=`${f}${c}${l}: {${s}${n}${c}}${s}`;continue}let u=o(e[i]);f=`${f}${c}${l}: ${u}${s}`}}return f}})),bt=/* @__PURE__ */ S(((e,t)=>{t.exports=r;let n=rt();function r({log:e,context:t}){let{colorizer:r,customLevels:i,customLevelNames:a,levelKey:o,getLevelLabelData:s}=t,c=t.customPrettifiers?.level,l=n(e,o);if(l===void 0)return;let u=r(l,{customLevels:i,customLevelNames:a});if(c){let[t]=s(l);return c(l,o,e,{label:t,labelColorized:u,colors:r.colors})}return u}})),xt=/* @__PURE__ */ S(((e,t)=>{t.exports=o;let{LEVELS:n}=Je(),r=rt(),i=dt(),a=gt();function o({log:e,context:t}){let{colorizer:o,customLevels:s,levelKey:c,levelLabel:l,messageFormat:u,messageKey:d,useOnlyCustomProps:f}=t;if(u&&typeof u==`string`){let t=i(u,e),d=String(t).replace(/{([^{}]+)}/g,function(t,i){let a;if(i===l&&(a=r(e,c))!==void 0)return(f?s===void 0:s[a]===void 0)?n[a]:s[a];let o=r(e,i);return o===void 0?``:o});return o.message(a(d))}if(u&&typeof u==`function`){let t=u(e,d,l,{colors:o.colors});return o.message(t)}if(d in e&&(typeof e[d]==`string`||typeof e[d]==`number`||typeof e[d]==`boolean`))return o.message(a(e[d]))}})),St=/* @__PURE__ */ S(((e,t)=>{t.exports=r;let n=gt();function r({log:e,context:t}){let{customPrettifiers:r,colorizer:i}=t,a=``;if(e.name||e.pid||e.hostname){if(a+=`(`,e.name&&(a+=r.name?r.name(e.name,`name`,e,{colors:i.colors}):n(e.name)),e.pid){let t=r.pid?r.pid(e.pid,`pid`,e,{colors:i.colors}):n(e.pid);e.name&&e.pid?a+=`/`+t:a+=t}if(e.hostname){let t=r.hostname?r.hostname(e.hostname,`hostname`,e,{colors:i.colors}):n(e.hostname);a+=`${a===`(`?`on`:` on`} ${t}`}a+=`)`}if(e.caller){let t=r.caller?r.caller(e.caller,`caller`,e,{colors:i.colors}):n(e.caller);a+=`${a===``?``:` `}<${t}>`}if(a!==``)return a}})),Ct=/* @__PURE__ */ S(((e,t)=>{t.exports=i;let n=ct(),r=gt();function i({log:e,context:t}){let{timestampKey:i,translateTime:a}=t,o=t.customPrettifiers?.time,s=null;if(i in e?s=e[i]:`timestamp`in e&&(s=e.timestamp),s===null)return;let c=a?n(s,a):s;return o?o(c):`[${r(c)}]`}})),wt=/* @__PURE__ */ S(((e,t)=>{t.exports={buildSafeSonicBoom:$e(),createDate:tt(),deleteLogProperty:it(),filterLog:ot(),formatTime:ct(),getPropertyValue:rt(),handleCustomLevelsNamesOpts:lt(),handleCustomLevelsOpts:ut(),interpretConditionals:dt(),isObject:ft(),isValidDate:et(),joinLinesWithIndentation:pt(),noop:Qe(),parseFactoryOptions:mt(),prettifyErrorLog:yt(),prettifyError:_t(),prettifyLevel:bt(),prettifyMessage:xt(),prettifyMetadata:St(),prettifyObject:vt(),prettifyTime:Ct(),splitPropertyKey:nt(),stripUnsafeControlChars:gt(),getLevelLabelData:Ye()}})),Tt=/* @__PURE__ */ S(((e,t)=>{let n=typeof Buffer<`u`,r=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,i=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function a(e,t,a){a==null&&typeof t==`object`&&t&&(a=t,t=void 0),n&&Buffer.isBuffer(e)&&(e=e.toString()),e&&e.charCodeAt(0)===65279&&(e=e.slice(1));let s=JSON.parse(e,t);if(typeof s!=`object`||!s)return s;let c=a&&a.protoAction||`error`,l=a&&a.constructorAction||`error`;if(c===`ignore`&&l===`ignore`)return s;if(c!==`ignore`&&l!==`ignore`){if(r.test(e)===!1&&i.test(e)===!1)return s}else if(c!==`ignore`&&l===`ignore`){if(r.test(e)===!1)return s}else if(i.test(e)===!1)return s;return o(s,{protoAction:c,constructorAction:l,safe:a&&a.safe})}function o(e,{protoAction:t=`error`,constructorAction:n=`error`,safe:r}={}){let i=[e];for(;i.length;){let e=i;i=[];for(let a of e){if(t!==`ignore`&&Object.prototype.hasOwnProperty.call(a,`__proto__`)){if(r===!0)return null;if(t===`error`)throw SyntaxError(`Object contains forbidden prototype property`);delete a.__proto__}if(n!==`ignore`&&Object.prototype.hasOwnProperty.call(a,`constructor`)&&a.constructor!==null&&typeof a.constructor==`object`&&Object.prototype.hasOwnProperty.call(a.constructor,`prototype`)){if(r===!0)return null;if(n===`error`)throw SyntaxError(`Object contains forbidden prototype property`);delete a.constructor}for(let e in a){let t=a[e];t&&typeof t==`object`&&i.push(t)}}}return e}function s(e,t,n){let{stackTraceLimit:r}=Error;Error.stackTraceLimit=0;try{return a(e,t,n)}finally{Error.stackTraceLimit=r}}function c(e,t){let{stackTraceLimit:n}=Error;Error.stackTraceLimit=0;let r;try{r=a(e,t,{safe:!0})}catch{r=void 0}finally{Error.stackTraceLimit=n}return r}t.exports=s,t.exports.default=s,t.exports.parse=s,t.exports.safeParse=c,t.exports.scan=o})),Et=/* @__PURE__ */ S(((e,t)=>{t.exports=h;let n=Tt(),r=ft(),i=yt(),a=bt(),o=xt(),s=St(),c=vt(),l=Ct(),u=ot(),{LEVELS:d,LEVEL_KEY:f,LEVEL_NAMES:p}=Je(),m=e=>{try{return{value:n.parse(e,{protoAction:`remove`})}}catch(e){return{err:e}}};function h(e){let t;if(r(e))t=e;else{let n=m(e);if(n.err||!r(n.value))return e+this.EOL;t=n.value}if(this.minimumLevel){let e;e=this.useOnlyCustomProps?this.customLevels:this.customLevelNames[this.minimumLevel]!==void 0;let n;if(n=e?this.customLevelNames[this.minimumLevel]:p[this.minimumLevel],n||=typeof this.minimumLevel==`string`?p[this.minimumLevel]:p[d[this.minimumLevel].toLowerCase()],t[this.levelKey===void 0?f:this.levelKey]<n)return}let n=o({log:t,context:this.context});(this.ignoreKeys||this.includeKeys)&&(t=u({log:t,context:this.context}));let h=a({log:t,context:{...this.context,...this.context.customProperties}}),g=s({log:t,context:this.context}),_=l({log:t,context:this.context}),v=``;if(this.levelFirst&&h&&(v=`${h}`),_&&v===``?v=`${_}`:_&&(v=`${v} ${_}`),!this.levelFirst&&h&&(v=v.length>0?`${v} ${h}`:h),g&&(v=v.length>0?`${v} ${g}:`:g),v.endsWith(`:`)===!1&&v!==``&&(v+=`:`),n!==void 0&&(v=v.length>0?`${v} ${n}`:n),v.length>0&&!this.singleLine&&(v+=this.EOL),t.type===`Error`&&typeof t.stack==`string`){let e=i({log:t,context:this.context});this.singleLine&&(v+=this.EOL),v+=e}else if(this.hideObject===!1){let e=[this.messageKey,this.levelKey,this.timestampKey].map(e=>e.replaceAll(/\\/g,``)).filter(e=>typeof t[e]==`string`||typeof t[e]==`number`||typeof t[e]==`boolean`),n=c({log:t,skipKeys:e,context:this.context});this.singleLine&&!/^\s$/.test(n)&&(v+=` `),v+=n}return v}})),Dt=/* @__PURE__ */ w((/* @__PURE__ */ S(((e,t)=>{let{isColorSupported:n}=Ve(),r=Ge(),{Transform:i}=T(`node:stream`),a=qe(),o=Xe(),{ERROR_LIKE_KEYS:s,LEVEL_KEY:c,LEVEL_LABEL:l,MESSAGE_KEY:u,TIMESTAMP_KEY:d}=Je(),{buildSafeSonicBoom:f,parseFactoryOptions:p}=wt(),m=Et(),h={colorize:n,colorizeObjects:!0,crlf:!1,customColors:null,customLevels:null,customPrettifiers:{},errorLikeObjectKeys:s,errorProps:``,hideObject:!1,ignore:`hostname`,include:void 0,levelFirst:!1,levelKey:c,levelLabel:l,messageFormat:null,messageKey:u,minimumLevel:void 0,singleLine:!1,timestampKey:d,translateTime:!0,useOnlyCustomProps:!0};function g(e){return e===`true`||e!==`false`&&e}function _(e){let t={...e};for(let e of[`colorize`,`colorizeObjects`,`crlf`,`hideObject`,`levelFirst`,`singleLine`,`useOnlyCustomProps`])e in t&&(t[e]=g(t[e]));return`translateTime`in t&&(t.translateTime===`true`||t.translateTime===`false`)&&(t.translateTime=g(t.translateTime)),t}function v(e){let t=_(Object.assign({},h,e)),n=p(t);return m.bind({...n,context:n})}function y(e={}){let t=v(e),n;return a(function(a){a.on(`message`,function n(r){r&&r.code===`PINO_CONFIG`&&(Object.assign(e,{messageKey:r.config.messageKey,errorLikeObjectKeys:Array.from(/* @__PURE__ */ new Set([...e.errorLikeObjectKeys||s,r.config.errorKey])),customLevels:r.config.levels.values}),t=v(e),a.off(`message`,n))});let o=new i({objectMode:!0,autoDestroy:!0,transform(e,n,r){r(null,t(e))}});return n=typeof e.destination==`object`&&typeof e.destination.write==`function`?e.destination:f({dest:e.destination||1,append:e.append,mkdir:e.mkdir,sync:e.sync}),a.on(`unknown`,function(e){n.write(e+`
33
- `)}),r(a,o,n),o},{parse:`lines`,close(e,t){n.on(`close`,()=>{t(e)})}})}t.exports=y,t.exports.build=y,t.exports.PinoPretty=y,t.exports.prettyFactory=v,t.exports.colorizerFactory=o,t.exports.isColorSupported=n,t.exports.default=y})))(),1),Ot=class{module;constructor(e=`Noop`){this.module=e}debug(e,t){}info(e,t){}warn(e,t){}error(e,t,n){}withOperation(e){return this}withTrace(e){return this}flush(){return Promise.resolve()}getModule(){return this.module}};function kt(e=`Noop`){return new Ot(e)}kt(`App`);let At=!1;function jt(){At=!0}function Mt(){if(!At)throw Error(`日志预设未初始化,请先调用 initializeNodeLoggerPreset 再创建日志器`)}const Nt={colorize:!0,translateTime:`SYS:HH:MM:ss`,ignore:`pid,hostname,module`,messageFormat:`{msg}`,singleLine:!0};function Pt(){return e(import.meta.url).resolve(`pino-pretty`)}function Ft(e){return(0,Dt.default)({...Nt,...e})}function It(e){return{target:Pt(),options:{...Nt,...e}}}const Lt={enableTracing:!0,prettyMode:`stream`};function Rt(e={}){jt();let t={...Lt,...e},n=process.env.NODE_ENV!==`production`,r=n&&!e.transport&&t.prettyMode===`stream`?Ft(e.prettyOptions):void 0;Te({minLevel:e.minLevel??(n?`debug`:`info`),enableConsole:!0,autoTracing:t.enableTracing,transport:e.transport??(n&&t.prettyMode===`transport`?It(e.prettyOptions):void 0),stream:r}),t.enableTracing&&Re(Be())}function zt(e){Mt();let t=Pe(e),n=ze();return n?t.withTrace(n):t}Rt();var Bt=/* @__PURE__ */ S((e=>{var t=class extends Error{constructor(e,t,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},n=class extends t{constructor(e){super(1,`commander.invalidArgument`,e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};e.CommanderError=t,e.InvalidArgumentError=n})),Vt=/* @__PURE__ */ S((e=>{let{InvalidArgumentError:t}=Bt();var n=class{constructor(e,t){switch(this.description=t||``,this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case`<`:this.required=!0,this._name=e.slice(1,-1);break;case`[`:this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e}this._name.endsWith(`...`)&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,n)=>{if(!this.argChoices.includes(e))throw new t(`Allowed choices are ${this.argChoices.join(`, `)}.`);return this.variadic?this._collectValue(e,n):e},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function r(e){let t=e.name()+(e.variadic===!0?`...`:``);return e.required?`<`+t+`>`:`[`+t+`]`}e.Argument=n,e.humanReadableArgName=r})),Ht=/* @__PURE__ */ S((e=>{let{humanReadableArgName:t}=Vt();var n=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let t=e.commands.filter(e=>!e._hidden),n=e._getHelpCommand();return n&&!n._hidden&&t.push(n),this.sortSubcommands&&t.sort((e,t)=>e.name().localeCompare(t.name())),t}compareOptions(e,t){let n=e=>e.short?e.short.replace(/^-/,``):e.long.replace(/^--/,``);return n(e).localeCompare(n(t))}visibleOptions(e){let t=e.options.filter(e=>!e.hidden),n=e._getHelpOption();if(n&&!n.hidden){let r=n.short&&e._findOption(n.short),i=n.long&&e._findOption(n.long);!r&&!i?t.push(n):n.long&&!i?t.push(e.createOption(n.long,n.description)):n.short&&!r&&t.push(e.createOption(n.short,n.description))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let n=e.parent;n;n=n.parent){let e=n.options.filter(e=>!e.hidden);t.push(...e)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||``}),e.registeredArguments.find(e=>e.description)?e.registeredArguments:[]}subcommandTerm(e){let n=e.registeredArguments.map(e=>t(e)).join(` `);return e._name+(e._aliases[0]?`|`+e._aliases[0]:``)+(e.options.length?` [options]`:``)+(n?` `+n:``)}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleSubcommandTerm(t.subcommandTerm(n)))),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleArgumentTerm(t.argumentTerm(n)))),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+`|`+e._aliases[0]);let n=``;for(let t=e.parent;t;t=t.parent)n=t.name()+` `+n;return n+t+` `+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(`, `)}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue==`boolean`)&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0){let n=`(${t.join(`, `)})`;return e.description?`${e.description} ${n}`:n}return e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(`, `)}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let n=`(${t.join(`, `)})`;return e.description?`${e.description} ${n}`:n}return e.description}formatItemList(e,t,n){return t.length===0?[]:[n.styleTitle(e),...t,``]}groupItems(e,t,n){let r=/* @__PURE__ */ new Map;return e.forEach(e=>{let t=n(e);r.has(t)||r.set(t,[])}),t.forEach(e=>{let t=n(e);r.has(t)||r.set(t,[]),r.get(t).push(e)}),r}formatHelp(e,t){let n=t.padWidth(e,t),r=t.helpWidth??80;function i(e,r){return t.formatItem(e,n,r,t)}let a=[`${t.styleTitle(`Usage:`)} ${t.styleUsage(t.commandUsage(e))}`,``],o=t.commandDescription(e);o.length>0&&(a=a.concat([t.boxWrap(t.styleCommandDescription(o),r),``]));let s=t.visibleArguments(e).map(e=>i(t.styleArgumentTerm(t.argumentTerm(e)),t.styleArgumentDescription(t.argumentDescription(e))));if(a=a.concat(this.formatItemList(`Arguments:`,s,t)),this.groupItems(e.options,t.visibleOptions(e),e=>e.helpGroupHeading??`Options:`).forEach((e,n)=>{let r=e.map(e=>i(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));a=a.concat(this.formatItemList(n,r,t))}),t.showGlobalOptions){let n=t.visibleGlobalOptions(e).map(e=>i(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));a=a.concat(this.formatItemList(`Global Options:`,n,t))}return this.groupItems(e.commands,t.visibleCommands(e),e=>e.helpGroup()||`Commands:`).forEach((e,n)=>{let r=e.map(e=>i(t.styleSubcommandTerm(t.subcommandTerm(e)),t.styleSubcommandDescription(t.subcommandDescription(e))));a=a.concat(this.formatItemList(n,r,t))}),a.join(`
33
+ `)}),r(a,o,n),o},{parse:`lines`,close(e,t){n.on(`close`,()=>{t(e)})}})}t.exports=y,t.exports.build=y,t.exports.PinoPretty=y,t.exports.prettyFactory=v,t.exports.colorizerFactory=o,t.exports.isColorSupported=n,t.exports.default=y})))(),1),Ot=class{module;constructor(e=`Noop`){this.module=e}debug(e,t){}info(e,t){}warn(e,t){}error(e,t,n){}withOperation(e){return this}withTrace(e){return this}flush(){return Promise.resolve()}getModule(){return this.module}};function kt(e=`Noop`){return new Ot(e)}kt(`App`);const At={colorize:!0,translateTime:`SYS:HH:MM:ss`,ignore:`pid,hostname,module`,messageFormat:`{msg}`,singleLine:!0};let jt=!1;function Mt(){return e(import.meta.url).resolve(`pino-pretty`)}function Nt(e){return(0,Dt.default)({...At,...e})}function Pt(e){return{target:Mt(),options:{...At,...e}}}const Ft={enableTracing:!0,prettyMode:`stream`};function It(){return jt}function Lt(){jt=!0}function Rt(e={}){let t={...Ft,...e},n=process.env.NODE_ENV!==`production`,r=n&&!e.transport&&t.prettyMode===`stream`?Nt(e.prettyOptions):void 0;Te({minLevel:e.minLevel??(n?`debug`:`info`),enableConsole:!0,autoTracing:t.enableTracing,transport:e.transport??(n&&t.prettyMode===`transport`?Pt(e.prettyOptions):void 0),stream:r}),t.enableTracing&&Re(Be())}function zt(){It()||(Lt(),Rt())}function Bt(e={}){Lt(),Rt(e)}function Vt(e){zt();let t=Pe(e),n=ze();return n?t.withTrace(n):t}Bt();var Ht=/* @__PURE__ */ S((e=>{var t=class extends Error{constructor(e,t,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},n=class extends t{constructor(e){super(1,`commander.invalidArgument`,e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};e.CommanderError=t,e.InvalidArgumentError=n})),Ut=/* @__PURE__ */ S((e=>{let{InvalidArgumentError:t}=Ht();var n=class{constructor(e,t){switch(this.description=t||``,this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case`<`:this.required=!0,this._name=e.slice(1,-1);break;case`[`:this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e}this._name.endsWith(`...`)&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,n)=>{if(!this.argChoices.includes(e))throw new t(`Allowed choices are ${this.argChoices.join(`, `)}.`);return this.variadic?this._collectValue(e,n):e},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function r(e){let t=e.name()+(e.variadic===!0?`...`:``);return e.required?`<`+t+`>`:`[`+t+`]`}e.Argument=n,e.humanReadableArgName=r})),Wt=/* @__PURE__ */ S((e=>{let{humanReadableArgName:t}=Ut();var n=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let t=e.commands.filter(e=>!e._hidden),n=e._getHelpCommand();return n&&!n._hidden&&t.push(n),this.sortSubcommands&&t.sort((e,t)=>e.name().localeCompare(t.name())),t}compareOptions(e,t){let n=e=>e.short?e.short.replace(/^-/,``):e.long.replace(/^--/,``);return n(e).localeCompare(n(t))}visibleOptions(e){let t=e.options.filter(e=>!e.hidden),n=e._getHelpOption();if(n&&!n.hidden){let r=n.short&&e._findOption(n.short),i=n.long&&e._findOption(n.long);!r&&!i?t.push(n):n.long&&!i?t.push(e.createOption(n.long,n.description)):n.short&&!r&&t.push(e.createOption(n.short,n.description))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let n=e.parent;n;n=n.parent){let e=n.options.filter(e=>!e.hidden);t.push(...e)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||``}),e.registeredArguments.find(e=>e.description)?e.registeredArguments:[]}subcommandTerm(e){let n=e.registeredArguments.map(e=>t(e)).join(` `);return e._name+(e._aliases[0]?`|`+e._aliases[0]:``)+(e.options.length?` [options]`:``)+(n?` `+n:``)}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleSubcommandTerm(t.subcommandTerm(n)))),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleArgumentTerm(t.argumentTerm(n)))),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+`|`+e._aliases[0]);let n=``;for(let t=e.parent;t;t=t.parent)n=t.name()+` `+n;return n+t+` `+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(`, `)}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue==`boolean`)&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0){let n=`(${t.join(`, `)})`;return e.description?`${e.description} ${n}`:n}return e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(`, `)}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let n=`(${t.join(`, `)})`;return e.description?`${e.description} ${n}`:n}return e.description}formatItemList(e,t,n){return t.length===0?[]:[n.styleTitle(e),...t,``]}groupItems(e,t,n){let r=/* @__PURE__ */ new Map;return e.forEach(e=>{let t=n(e);r.has(t)||r.set(t,[])}),t.forEach(e=>{let t=n(e);r.has(t)||r.set(t,[]),r.get(t).push(e)}),r}formatHelp(e,t){let n=t.padWidth(e,t),r=t.helpWidth??80;function i(e,r){return t.formatItem(e,n,r,t)}let a=[`${t.styleTitle(`Usage:`)} ${t.styleUsage(t.commandUsage(e))}`,``],o=t.commandDescription(e);o.length>0&&(a=a.concat([t.boxWrap(t.styleCommandDescription(o),r),``]));let s=t.visibleArguments(e).map(e=>i(t.styleArgumentTerm(t.argumentTerm(e)),t.styleArgumentDescription(t.argumentDescription(e))));if(a=a.concat(this.formatItemList(`Arguments:`,s,t)),this.groupItems(e.options,t.visibleOptions(e),e=>e.helpGroupHeading??`Options:`).forEach((e,n)=>{let r=e.map(e=>i(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));a=a.concat(this.formatItemList(n,r,t))}),t.showGlobalOptions){let n=t.visibleGlobalOptions(e).map(e=>i(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));a=a.concat(this.formatItemList(`Global Options:`,n,t))}return this.groupItems(e.commands,t.visibleCommands(e),e=>e.helpGroup()||`Commands:`).forEach((e,n)=>{let r=e.map(e=>i(t.styleSubcommandTerm(t.subcommandTerm(e)),t.styleSubcommandDescription(t.subcommandDescription(e))));a=a.concat(this.formatItemList(n,r,t))}),a.join(`
34
34
  `)}displayWidth(e){return r(e).length}styleTitle(e){return e}styleUsage(e){return e.split(` `).map(e=>e===`[options]`?this.styleOptionText(e):e===`[command]`?this.styleSubcommandText(e):e[0]===`[`||e[0]===`<`?this.styleArgumentText(e):this.styleCommandText(e)).join(` `)}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(` `).map(e=>e===`[options]`?this.styleOptionText(e):e[0]===`[`||e[0]===`<`?this.styleArgumentText(e):this.styleSubcommandText(e)).join(` `)}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,t,n,r){let i=` `.repeat(2);if(!n)return i+e;let a=e.padEnd(t+e.length-r.displayWidth(e)),o=(this.helpWidth??80)-t-2-2,s;return s=o<this.minWidthToWrap||r.preformatted(n)?n:r.boxWrap(n,o).replace(/\n/g,`
35
35
  `+` `.repeat(t+2)),i+a+` `.repeat(2)+s.replace(/\n/g,`\n${i}`)}boxWrap(e,t){if(t<this.minWidthToWrap)return e;let n=e.split(/\r\n|\n/),r=/[\s]*[^\s]+/g,i=[];return n.forEach(e=>{let n=e.match(r);if(n===null){i.push(``);return}let a=[n.shift()],o=this.displayWidth(a[0]);n.forEach(e=>{let n=this.displayWidth(e);if(o+n<=t){a.push(e),o+=n;return}i.push(a.join(``));let r=e.trimStart();a=[r],o=this.displayWidth(r)}),i.push(a.join(``))}),i.join(`
36
- `)}};function r(e){return e.replace(/\x1b\[\d*(;\d*)*m/g,``)}e.Help=n,e.stripColor=r})),Ut=/* @__PURE__ */ S((e=>{let{InvalidArgumentError:t}=Bt();var n=class{constructor(e,t){this.flags=e,this.description=t||``,this.required=e.includes(`<`),this.optional=e.includes(`[`),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let n=a(e);this.short=n.shortFlag,this.long=n.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(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let t=e;return typeof e==`string`&&(t={[e]:!0}),this.implied=Object.assign(this.implied||{},t),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,n)=>{if(!this.argChoices.includes(e))throw new t(`Allowed choices are ${this.argChoices.join(`, `)}.`);return this.variadic?this._collectValue(e,n):e},this}name(){return this.long?this.long.replace(/^--/,``):this.short.replace(/^-/,``)}attributeName(){return this.negate?i(this.name().replace(/^no-/,``)):i(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},r=class{constructor(e){this.positiveOptions=/* @__PURE__ */ new Map,this.negativeOptions=/* @__PURE__ */ new Map,this.dualOptions=/* @__PURE__ */ new Set,e.forEach(e=>{e.negate?this.negativeOptions.set(e.attributeName(),e):this.positiveOptions.set(e.attributeName(),e)}),this.negativeOptions.forEach((e,t)=>{this.positiveOptions.has(t)&&this.dualOptions.add(t)})}valueFromOption(e,t){let n=t.attributeName();if(!this.dualOptions.has(n))return!0;let r=this.negativeOptions.get(n).presetArg,i=r!==void 0&&r;return t.negate===(i===e)}};function i(e){return e.split(`-`).reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}function a(e){let t,n,r=/^-[^-]$/,i=/^--[^-]/,a=e.split(/[ |,]+/).concat(`guard`);if(r.test(a[0])&&(t=a.shift()),i.test(a[0])&&(n=a.shift()),!t&&r.test(a[0])&&(t=a.shift()),!t&&i.test(a[0])&&(t=n,n=a.shift()),a[0].startsWith(`-`)){let t=a[0],n=`option creation failed due to '${t}' in option flags '${e}'`;throw/^-[^-][^-]/.test(t)?Error(`${n}
36
+ `)}};function r(e){return e.replace(/\x1b\[\d*(;\d*)*m/g,``)}e.Help=n,e.stripColor=r})),Gt=/* @__PURE__ */ S((e=>{let{InvalidArgumentError:t}=Ht();var n=class{constructor(e,t){this.flags=e,this.description=t||``,this.required=e.includes(`<`),this.optional=e.includes(`[`),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let n=a(e);this.short=n.shortFlag,this.long=n.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(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let t=e;return typeof e==`string`&&(t={[e]:!0}),this.implied=Object.assign(this.implied||{},t),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,n)=>{if(!this.argChoices.includes(e))throw new t(`Allowed choices are ${this.argChoices.join(`, `)}.`);return this.variadic?this._collectValue(e,n):e},this}name(){return this.long?this.long.replace(/^--/,``):this.short.replace(/^-/,``)}attributeName(){return this.negate?i(this.name().replace(/^no-/,``)):i(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},r=class{constructor(e){this.positiveOptions=/* @__PURE__ */ new Map,this.negativeOptions=/* @__PURE__ */ new Map,this.dualOptions=/* @__PURE__ */ new Set,e.forEach(e=>{e.negate?this.negativeOptions.set(e.attributeName(),e):this.positiveOptions.set(e.attributeName(),e)}),this.negativeOptions.forEach((e,t)=>{this.positiveOptions.has(t)&&this.dualOptions.add(t)})}valueFromOption(e,t){let n=t.attributeName();if(!this.dualOptions.has(n))return!0;let r=this.negativeOptions.get(n).presetArg,i=r!==void 0&&r;return t.negate===(i===e)}};function i(e){return e.split(`-`).reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}function a(e){let t,n,r=/^-[^-]$/,i=/^--[^-]/,a=e.split(/[ |,]+/).concat(`guard`);if(r.test(a[0])&&(t=a.shift()),i.test(a[0])&&(n=a.shift()),!t&&r.test(a[0])&&(t=a.shift()),!t&&i.test(a[0])&&(t=n,n=a.shift()),a[0].startsWith(`-`)){let t=a[0],n=`option creation failed due to '${t}' in option flags '${e}'`;throw/^-[^-][^-]/.test(t)?Error(`${n}
37
37
  - a short flag is a single dash and a single character
38
38
  - either use a single dash and a single character (for a short flag)
39
39
  - or use a double dash for a long option (and can have two, like '--ws, --workspace')`):r.test(t)?Error(`${n}
40
40
  - too many short flags`):i.test(t)?Error(`${n}
41
41
  - too many long flags`):Error(`${n}
42
- - unrecognised flag format`)}if(t===void 0&&n===void 0)throw Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:n}}e.Option=n,e.DualOptions=r})),Wt=/* @__PURE__ */ S((e=>{function t(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);let n=[];for(let t=0;t<=e.length;t++)n[t]=[t];for(let e=0;e<=t.length;e++)n[0][e]=e;for(let r=1;r<=t.length;r++)for(let i=1;i<=e.length;i++){let a=1;a=e[i-1]===t[r-1]?0:1,n[i][r]=Math.min(n[i-1][r]+1,n[i][r-1]+1,n[i-1][r-1]+a),i>1&&r>1&&e[i-1]===t[r-2]&&e[i-2]===t[r-1]&&(n[i][r]=Math.min(n[i][r],n[i-2][r-2]+1))}return n[e.length][t.length]}function n(e,n){if(!n||n.length===0)return``;n=Array.from(new Set(n));let r=e.startsWith(`--`);r&&(e=e.slice(2),n=n.map(e=>e.slice(2)));let i=[],a=3;return n.forEach(n=>{if(n.length<=1)return;let r=t(e,n),o=Math.max(e.length,n.length);(o-r)/o>.4&&(r<a?(a=r,i=[n]):r===a&&i.push(n))}),i.sort((e,t)=>e.localeCompare(t)),r&&(i=i.map(e=>`--${e}`)),i.length>1?`\n(Did you mean one of ${i.join(`, `)}?)`:i.length===1?`\n(Did you mean ${i[0]}?)`:``}e.suggestSimilar=n})),Gt=/* @__PURE__ */ S((e=>{let t=T(`node:events`).EventEmitter,n=T(`node:child_process`),r=T(`node:path`),i=T(`node:fs`),a=T(`node:process`),{Argument:o,humanReadableArgName:s}=Vt(),{CommanderError:c}=Bt(),{Help:l,stripColor:u}=Ht(),{Option:d,DualOptions:f}=Ut(),{suggestSimilar:p}=Wt();var m=class e extends t{constructor(e){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=e||``,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:e=>a.stdout.write(e),writeErr:e=>a.stderr.write(e),outputError:(e,t)=>t(e),getOutHelpWidth:()=>a.stdout.isTTY?a.stdout.columns:void 0,getErrHelpWidth:()=>a.stderr.isTTY?a.stderr.columns:void 0,getOutHasColors:()=>g()??(a.stdout.isTTY&&a.stdout.hasColors?.()),getErrHasColors:()=>g()??(a.stderr.isTTY&&a.stderr.hasColors?.()),stripColor:e=>u(e)},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(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let t=this;t;t=t.parent)e.push(t);return e}command(e,t,n){let r=t,i=n;typeof r==`object`&&r&&(i=r,r=null),i||={};let[,a,o]=e.match(/([^ ]+) *(.*)/),s=this.createCommand(a);return r&&(s.description(r),s._executableHandler=!0),i.isDefault&&(this._defaultCommandName=s._name),s._hidden=!!(i.noHelp||i.hidden),s._executableFile=i.executableFile||null,o&&s.arguments(o),this._registerCommand(s),s.parent=this,s.copyInheritedSettings(this),r?this:s}createCommand(t){return new e(t)}createHelp(){return Object.assign(new l,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...e},this)}showHelpAfterError(e=!0){return typeof e!=`string`&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,t){if(!e._name)throw Error(`Command passed to .addCommand() must have a name
42
+ - unrecognised flag format`)}if(t===void 0&&n===void 0)throw Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:n}}e.Option=n,e.DualOptions=r})),Kt=/* @__PURE__ */ S((e=>{function t(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);let n=[];for(let t=0;t<=e.length;t++)n[t]=[t];for(let e=0;e<=t.length;e++)n[0][e]=e;for(let r=1;r<=t.length;r++)for(let i=1;i<=e.length;i++){let a=1;a=e[i-1]===t[r-1]?0:1,n[i][r]=Math.min(n[i-1][r]+1,n[i][r-1]+1,n[i-1][r-1]+a),i>1&&r>1&&e[i-1]===t[r-2]&&e[i-2]===t[r-1]&&(n[i][r]=Math.min(n[i][r],n[i-2][r-2]+1))}return n[e.length][t.length]}function n(e,n){if(!n||n.length===0)return``;n=Array.from(new Set(n));let r=e.startsWith(`--`);r&&(e=e.slice(2),n=n.map(e=>e.slice(2)));let i=[],a=3;return n.forEach(n=>{if(n.length<=1)return;let r=t(e,n),o=Math.max(e.length,n.length);(o-r)/o>.4&&(r<a?(a=r,i=[n]):r===a&&i.push(n))}),i.sort((e,t)=>e.localeCompare(t)),r&&(i=i.map(e=>`--${e}`)),i.length>1?`\n(Did you mean one of ${i.join(`, `)}?)`:i.length===1?`\n(Did you mean ${i[0]}?)`:``}e.suggestSimilar=n})),qt=/* @__PURE__ */ S((e=>{let t=T(`node:events`).EventEmitter,n=T(`node:child_process`),r=T(`node:path`),i=T(`node:fs`),a=T(`node:process`),{Argument:o,humanReadableArgName:s}=Ut(),{CommanderError:c}=Ht(),{Help:l,stripColor:u}=Wt(),{Option:d,DualOptions:f}=Gt(),{suggestSimilar:p}=Kt();var m=class e extends t{constructor(e){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=e||``,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:e=>a.stdout.write(e),writeErr:e=>a.stderr.write(e),outputError:(e,t)=>t(e),getOutHelpWidth:()=>a.stdout.isTTY?a.stdout.columns:void 0,getErrHelpWidth:()=>a.stderr.isTTY?a.stderr.columns:void 0,getOutHasColors:()=>g()??(a.stdout.isTTY&&a.stdout.hasColors?.()),getErrHasColors:()=>g()??(a.stderr.isTTY&&a.stderr.hasColors?.()),stripColor:e=>u(e)},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(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let t=this;t;t=t.parent)e.push(t);return e}command(e,t,n){let r=t,i=n;typeof r==`object`&&r&&(i=r,r=null),i||={};let[,a,o]=e.match(/([^ ]+) *(.*)/),s=this.createCommand(a);return r&&(s.description(r),s._executableHandler=!0),i.isDefault&&(this._defaultCommandName=s._name),s._hidden=!!(i.noHelp||i.hidden),s._executableFile=i.executableFile||null,o&&s.arguments(o),this._registerCommand(s),s.parent=this,s.copyInheritedSettings(this),r?this:s}createCommand(t){return new e(t)}createHelp(){return Object.assign(new l,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...e},this)}showHelpAfterError(e=!0){return typeof e!=`string`&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,t){if(!e._name)throw Error(`Command passed to .addCommand() must have a name
43
43
  - specify the name in Command constructor or using .name()`);return t||={},t.isDefault&&(this._defaultCommandName=e._name),(t.noHelp||t.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,t){return new o(e,t)}argument(e,t,n,r){let i=this.createArgument(e,t);return typeof n==`function`?i.default(r).argParser(n):i.default(n),this.addArgument(i),this}arguments(e){return e.trim().split(/ +/).forEach(e=>{this.argument(e)}),this}addArgument(e){let t=this.registeredArguments.slice(-1)[0];if(t?.variadic)throw Error(`only the last argument can be variadic '${t.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,t){if(typeof e==`boolean`)return this._addImplicitHelpCommand=e,e&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let[,n,r]=(e??`help [command]`).match(/([^ ]+) *(.*)/),i=t??`display help for command`,a=this.createCommand(n);return a.helpOption(!1),r&&a.arguments(r),i&&a.description(i),this._addImplicitHelpCommand=!0,this._helpCommand=a,(e||t)&&this._initCommandGroup(a),this}addHelpCommand(e,t){return typeof e==`object`?(this._addImplicitHelpCommand=!0,this._helpCommand=e,this._initCommandGroup(e),this):(this.helpCommand(e,t),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand(`help`))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,t){let n=[`preSubcommand`,`preAction`,`postAction`];if(!n.includes(e))throw Error(`Unexpected value for event passed to hook : '${e}'.
44
44
  Expecting one of '${n.join(`', '`)}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(t):this._lifeCycleHooks[e]=[t],this}exitOverride(e){return this._exitCallback=e||(e=>{if(e.code!==`commander.executeSubCommandAsync`)throw e}),this}_exit(e,t,n){this._exitCallback&&this._exitCallback(new c(e,t,n)),a.exit(e)}action(e){let t=t=>{let n=this.registeredArguments.length,r=t.slice(0,n);return r[n]=this._storeOptionsAsProperties?this:this.opts(),r.push(this),e.apply(this,r)};return this._actionHandler=t,this}createOption(e,t){return new d(e,t)}_callParseArg(e,t,n,r){try{return e.parseArg(t,n)}catch(e){if(e.code===`commander.invalidArgument`){let t=`${r} ${e.message}`;this.error(t,{exitCode:e.exitCode,code:e.code})}throw e}}_registerOption(e){let t=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(t){let n=e.long&&this._findOption(e.long)?e.long:e.short;throw Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${n}'
45
45
  - already used by option '${t.flags}'`)}this._initOptionGroup(e),this.options.push(e)}_registerCommand(e){let t=e=>[e.name()].concat(e.aliases()),n=t(e).find(e=>this._findCommand(e));if(n){let r=t(this._findCommand(n)).join(`|`),i=t(e).join(`|`);throw Error(`cannot add command '${i}' as already have command '${r}'`)}this._initCommandGroup(e),this.commands.push(e)}addOption(e){this._registerOption(e);let t=e.name(),n=e.attributeName();if(e.negate){let t=e.long.replace(/^--no-/,`--`);this._findOption(t)||this.setOptionValueWithSource(n,e.defaultValue===void 0||e.defaultValue,`default`)}else e.defaultValue!==void 0&&this.setOptionValueWithSource(n,e.defaultValue,`default`);let r=(t,r,i)=>{t==null&&e.presetArg!==void 0&&(t=e.presetArg);let a=this.getOptionValue(n);t!==null&&e.parseArg?t=this._callParseArg(e,t,a,r):t!==null&&e.variadic&&(t=e._collectValue(t,a)),t??=e.negate?!1:e.isBoolean()||e.optional?!0:``,this.setOptionValueWithSource(n,t,i)};return this.on(`option:`+t,t=>{let n=`error: option '${e.flags}' argument '${t}' is invalid.`;r(t,n,`cli`)}),e.envVar&&this.on(`optionEnv:`+t,t=>{let n=`error: option '${e.flags}' value '${t}' from env '${e.envVar}' is invalid.`;r(t,n,`env`)}),this}_optionEx(e,t,n,r,i){if(typeof t==`object`&&t instanceof d)throw Error(`To add an Option object use addOption() instead of option() or requiredOption()`);let a=this.createOption(t,n);if(a.makeOptionMandatory(!!e.mandatory),typeof r==`function`)a.default(i).argParser(r);else if(r instanceof RegExp){let e=r;r=(t,n)=>{let r=e.exec(t);return r?r[0]:n},a.default(i).argParser(r)}else a.default(r);return this.addOption(a)}option(e,t,n,r){return this._optionEx({},e,t,n,r)}requiredOption(e,t,n,r){return this._optionEx({mandatory:!0},e,t,n,r)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,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(e=!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=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,t){return this.setOptionValueWithSource(e,t,void 0)}setOptionValueWithSource(e,t,n){return this._storeOptionsAsProperties?this[e]=t:this._optionValues[e]=t,this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let t;return this._getCommandAndAncestors().forEach(n=>{n.getOptionValueSource(e)!==void 0&&(t=n.getOptionValueSource(e))}),t}_prepareUserArgs(e,t){if(e!==void 0&&!Array.isArray(e))throw Error(`first parameter to parse must be array or undefined`);if(t||={},e===void 0&&t.from===void 0){a.versions?.electron&&(t.from=`electron`);let e=a.execArgv??[];(e.includes(`-e`)||e.includes(`--eval`)||e.includes(`-p`)||e.includes(`--print`))&&(t.from=`eval`)}e===void 0&&(e=a.argv),this.rawArgs=e.slice();let n;switch(t.from){case void 0:case`node`:this._scriptPath=e[1],n=e.slice(2);break;case`electron`:a.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case`user`:n=e.slice(0);break;case`eval`:n=e.slice(1);break;default:throw Error(`unexpected parse option { from: '${t.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||`program`,n}parse(e,t){this._prepareForParse();let n=this._prepareUserArgs(e,t);return this._parseCommand([],n),this}async parseAsync(e,t){this._prepareForParse();let n=this._prepareUserArgs(e,t);return await this._parseCommand([],n),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():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.
@@ -48,11 +48,11 @@ Expecting one of '${n.join(`', '`)}'`);return this._lifeCycleHooks[e]?this._life
48
48
  - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
49
49
  - ${t?`searched for local subcommand relative to directory '${t}'`:`no directory for search for local subcommand, use .executableDir() to supply a custom directory`}`;throw Error(r)}_executeSubCommand(e,t){t=t.slice();let o=!1,s=[`.js`,`.ts`,`.tsx`,`.mjs`,`.cjs`];function l(e,t){let n=r.resolve(e,t);if(i.existsSync(n))return n;if(s.includes(r.extname(t)))return;let a=s.find(e=>i.existsSync(`${n}${e}`));if(a)return`${n}${a}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let u=e._executableFile||`${this._name}-${e._name}`,d=this._executableDir||``;if(this._scriptPath){let e;try{e=i.realpathSync(this._scriptPath)}catch{e=this._scriptPath}d=r.resolve(r.dirname(e),d)}if(d){let t=l(d,u);if(!t&&!e._executableFile&&this._scriptPath){let n=r.basename(this._scriptPath,r.extname(this._scriptPath));n!==this._name&&(t=l(d,`${n}-${e._name}`))}u=t||u}o=s.includes(r.extname(u));let f;a.platform===`win32`?(this._checkForMissingExecutable(u,d,e._name),t.unshift(u),t=h(a.execArgv).concat(t),f=n.spawn(a.execPath,t,{stdio:`inherit`})):o?(t.unshift(u),t=h(a.execArgv).concat(t),f=n.spawn(a.argv[0],t,{stdio:`inherit`})):f=n.spawn(u,t,{stdio:`inherit`}),f.killed||[`SIGUSR1`,`SIGUSR2`,`SIGTERM`,`SIGINT`,`SIGHUP`].forEach(e=>{a.on(e,()=>{f.killed===!1&&f.exitCode===null&&f.kill(e)})});let p=this._exitCallback;f.on(`close`,e=>{e??=1,p?p(new c(e,`commander.executeSubCommandAsync`,`(close)`)):a.exit(e)}),f.on(`error`,t=>{if(t.code===`ENOENT`)this._checkForMissingExecutable(u,d,e._name);else if(t.code===`EACCES`)throw Error(`'${u}' not executable`);if(!p)a.exit(1);else{let e=new c(1,`commander.executeSubCommandAsync`,`(error)`);e.nestedError=t,p(e)}}),this.runningCommand=f}_dispatchSubcommand(e,t,n){let r=this._findCommand(e);r||this.help({error:!0}),r._prepareForParse();let i;return i=this._chainOrCallSubCommandHook(i,r,`preSubcommand`),i=this._chainOrCall(i,()=>{if(r._executableHandler)this._executeSubCommand(r,t.concat(n));else return r._parseCommand(t,n)}),i}_dispatchHelpCommand(e){e||this.help();let t=this._findCommand(e);return t&&!t._executableHandler&&t.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??`--help`])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,t)=>{e.required&&this.args[t]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(e,t,n)=>{let r=t;if(t!==null&&e.parseArg){let i=`error: command-argument value '${t}' is invalid for argument '${e.name()}'.`;r=this._callParseArg(e,t,n,i)}return r};this._checkNumberOfArguments();let t=[];this.registeredArguments.forEach((n,r)=>{let i=n.defaultValue;n.variadic?r<this.args.length?(i=this.args.slice(r),n.parseArg&&(i=i.reduce((t,r)=>e(n,r,t),n.defaultValue))):i===void 0&&(i=[]):r<this.args.length&&(i=this.args[r],n.parseArg&&(i=e(n,i,n.defaultValue))),t[r]=i}),this.processedArgs=t}_chainOrCall(e,t){return e?.then&&typeof e.then==`function`?e.then(()=>t()):t()}_chainOrCallHooks(e,t){let n=e,r=[];return this._getCommandAndAncestors().reverse().filter(e=>e._lifeCycleHooks[t]!==void 0).forEach(e=>{e._lifeCycleHooks[t].forEach(t=>{r.push({hookedCommand:e,callback:t})})}),t===`postAction`&&r.reverse(),r.forEach(e=>{n=this._chainOrCall(n,()=>e.callback(e.hookedCommand,this))}),n}_chainOrCallSubCommandHook(e,t,n){let r=e;return this._lifeCycleHooks[n]!==void 0&&this._lifeCycleHooks[n].forEach(e=>{r=this._chainOrCall(r,()=>e(this,t))}),r}_parseCommand(e,t){let n=this.parseOptions(t);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(n.operands),t=n.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(t),this._dispatchSubcommand(this._defaultCommandName,e,t);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let r=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},i=`command:${this.name()}`;if(this._actionHandler){r(),this._processArguments();let n;return n=this._chainOrCallHooks(n,`preAction`),n=this._chainOrCall(n,()=>this._actionHandler(this.processedArgs)),this.parent&&(n=this._chainOrCall(n,()=>{this.parent.emit(i,e,t)})),n=this._chainOrCallHooks(n,`postAction`),n}if(this.parent?.listenerCount(i))r(),this._processArguments(),this.parent.emit(i,e,t);else if(e.length){if(this._findCommand(`*`))return this._dispatchSubcommand(`*`,e,t);this.listenerCount(`command:*`)?this.emit(`command:*`,e,t):this.commands.length?this.unknownCommand():(r(),this._processArguments())}else this.commands.length?(r(),this.help({error:!0})):(r(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(t=>t._name===e||t._aliases.includes(e))}_findOption(e){return this.options.find(t=>t.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(t=>{t.mandatory&&e.getOptionValue(t.attributeName())===void 0&&e.missingMandatoryOptionValue(t)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(e=>{let t=e.attributeName();return this.getOptionValue(t)!==void 0&&this.getOptionValueSource(t)!=="default"});e.filter(e=>e.conflictsWith.length>0).forEach(t=>{let n=e.find(e=>t.conflictsWith.includes(e.attributeName()));n&&this._conflictingOption(t,n)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let t=[],n=[],r=t;function i(e){return e.length>1&&e[0]===`-`}let a=e=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(e)?!this._getCommandAndAncestors().some(e=>e.options.map(e=>e.short).some(e=>/^-\d$/.test(e))):!1,o=null,s=null,c=0;for(;c<e.length||s;){let l=s??e[c++];if(s=null,l===`--`){r===n&&r.push(l),r.push(...e.slice(c));break}if(o&&(!i(l)||a(l)))this.emit(`option:${o.name()}`,l);else{if(o=null,i(l)){let t=this._findOption(l);if(t){if(t.required){let n=e[c++];n===void 0&&this.optionMissingArgument(t),this.emit(`option:${t.name()}`,n)}else if(t.optional){let n=null;c<e.length&&(!i(e[c])||a(e[c]))&&(n=e[c++]),this.emit(`option:${t.name()}`,n)}else this.emit(`option:${t.name()}`);o=t.variadic?t:null;continue}}if(l.length>2&&l[0]===`-`&&l[1]!==`-`){let e=this._findOption(`-${l[1]}`);if(e){e.required||e.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${e.name()}`,l.slice(2)):(this.emit(`option:${e.name()}`),s=`-${l.slice(2)}`);continue}}if(/^--[^=]+=/.test(l)){let e=l.indexOf(`=`),t=this._findOption(l.slice(0,e));if(t&&(t.required||t.optional)){this.emit(`option:${t.name()}`,l.slice(e+1));continue}}if(r===t&&i(l)&&!(this.commands.length===0&&a(l))&&(r=n),(this._enablePositionalOptions||this._passThroughOptions)&&t.length===0&&n.length===0){if(this._findCommand(l)){t.push(l),n.push(...e.slice(c));break}if(this._getHelpCommand()&&l===this._getHelpCommand().name()){t.push(l,...e.slice(c));break}if(this._defaultCommandName){n.push(l,...e.slice(c));break}}if(this._passThroughOptions){r.push(l,...e.slice(c));break}r.push(l)}}return{operands:t,unknown:n}}opts(){if(this._storeOptionsAsProperties){let e={},t=this.options.length;for(let n=0;n<t;n++){let t=this.options[n].attributeName();e[t]=t===this._versionOptionName?this._version:this[t]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,t)=>Object.assign(e,t.opts()),{})}error(e,t){this._outputConfiguration.outputError(`${e}\n`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError==`string`?this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
50
50
  `),this.outputHelp({error:!0}));let n=t||{},r=n.exitCode||1,i=n.code||`commander.error`;this._exit(r,i,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in a.env){let t=e.attributeName();(this.getOptionValue(t)===void 0||[`default`,`config`,`env`].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,a.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new f(this.options),t=e=>this.getOptionValue(e)!==void 0&&![`default`,`implied`].includes(this.getOptionValueSource(e));this.options.filter(n=>n.implied!==void 0&&t(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(e=>{Object.keys(e.implied).filter(e=>!t(e)).forEach(t=>{this.setOptionValueWithSource(t,e.implied[t],`implied`)})})}missingArgument(e){let t=`error: missing required argument '${e}'`;this.error(t,{code:`commander.missingArgument`})}optionMissingArgument(e){let t=`error: option '${e.flags}' argument missing`;this.error(t,{code:`commander.optionMissingArgument`})}missingMandatoryOptionValue(e){let t=`error: required option '${e.flags}' not specified`;this.error(t,{code:`commander.missingMandatoryOptionValue`})}_conflictingOption(e,t){let n=e=>{let t=e.attributeName(),n=this.getOptionValue(t),r=this.options.find(e=>e.negate&&t===e.attributeName()),i=this.options.find(e=>!e.negate&&t===e.attributeName());return r&&(r.presetArg===void 0&&n===!1||r.presetArg!==void 0&&n===r.presetArg)?r:i||e},r=e=>{let t=n(e),r=t.attributeName();return this.getOptionValueSource(r)===`env`?`environment variable '${t.envVar}'`:`option '${t.flags}'`},i=`error: ${r(e)} cannot be used with ${r(t)}`;this.error(i,{code:`commander.conflictingOption`})}unknownOption(e){if(this._allowUnknownOption)return;let t=``;if(e.startsWith(`--`)&&this._showSuggestionAfterError){let n=[],r=this;do{let e=r.createHelp().visibleOptions(r).filter(e=>e.long).map(e=>e.long);n=n.concat(e),r=r.parent}while(r&&!r._enablePositionalOptions);t=p(e,n)}let n=`error: unknown option '${e}'${t}`;this.error(n,{code:`commander.unknownOption`})}_excessArguments(e){if(this._allowExcessArguments)return;let t=this.registeredArguments.length,n=t===1?``:`s`,r=`error: too many arguments${this.parent?` for '${this.name()}'`:``}. Expected ${t} argument${n} but got ${e.length}.`;this.error(r,{code:`commander.excessArguments`})}unknownCommand(){let e=this.args[0],t=``;if(this._showSuggestionAfterError){let n=[];this.createHelp().visibleCommands(this).forEach(e=>{n.push(e.name()),e.alias()&&n.push(e.alias())}),t=p(e,n)}let n=`error: unknown command '${e}'${t}`;this.error(n,{code:`commander.unknownCommand`})}version(e,t,n){if(e===void 0)return this._version;this._version=e,t||=`-V, --version`,n||=`output the version number`;let r=this.createOption(t,n);return this._versionOptionName=r.attributeName(),this._registerOption(r),this.on(`option:`+r.name(),()=>{this._outputConfiguration.writeOut(`${e}\n`),this._exit(0,`commander.version`,e)}),this}description(e,t){return e===void 0&&t===void 0?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let t=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw Error(`Command alias can't be the same as its name`);let n=this.parent?._findCommand(e);if(n){let t=[n.name()].concat(n.aliases()).join(`|`);throw Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${t}'`)}return t._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(e=>this.alias(e)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let e=this.registeredArguments.map(e=>s(e));return[].concat(this.options.length||this._helpOption!==null?`[options]`:[],this.commands.length?`[command]`:[],this.registeredArguments.length?e:[]).join(` `)}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}helpGroup(e){return e===void 0?this._helpGroupHeading??``:(this._helpGroupHeading=e,this)}commandsGroup(e){return e===void 0?this._defaultCommandGroup??``:(this._defaultCommandGroup=e,this)}optionsGroup(e){return e===void 0?this._defaultOptionGroup??``:(this._defaultOptionGroup=e,this)}_initOptionGroup(e){this._defaultOptionGroup&&!e.helpGroupHeading&&e.helpGroup(this._defaultOptionGroup)}_initCommandGroup(e){this._defaultCommandGroup&&!e.helpGroup()&&e.helpGroup(this._defaultCommandGroup)}nameFromFilename(e){return this._name=r.basename(e,r.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let t=this.createHelp(),n=this._getOutputContext(e);t.prepareContext({error:n.error,helpWidth:n.helpWidth,outputHasColors:n.hasColors});let r=t.formatHelp(this,t);return n.hasColors?r:this._outputConfiguration.stripColor(r)}_getOutputContext(e){e||={};let t=!!e.error,n,r,i;return t?(n=e=>this._outputConfiguration.writeErr(e),r=this._outputConfiguration.getErrHasColors(),i=this._outputConfiguration.getErrHelpWidth()):(n=e=>this._outputConfiguration.writeOut(e),r=this._outputConfiguration.getOutHasColors(),i=this._outputConfiguration.getOutHelpWidth()),{error:t,write:e=>(r||(e=this._outputConfiguration.stripColor(e)),n(e)),hasColors:r,helpWidth:i}}outputHelp(e){let t;typeof e==`function`&&(t=e,e=void 0);let n=this._getOutputContext(e),r={error:n.error,write:n.write,command:this};this._getCommandAndAncestors().reverse().forEach(e=>e.emit(`beforeAllHelp`,r)),this.emit(`beforeHelp`,r);let i=this.helpInformation({error:n.error});if(t&&(i=t(i),typeof i!=`string`&&!Buffer.isBuffer(i)))throw Error(`outputHelp callback must return a string or a Buffer`);n.write(i),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit(`afterHelp`,r),this._getCommandAndAncestors().forEach(e=>e.emit(`afterAllHelp`,r))}helpOption(e,t){return typeof e==`boolean`?(e?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(e??`-h, --help`,t??`display help for command`),(e||t)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this._initOptionGroup(e),this}help(e){this.outputHelp(e);let t=Number(a.exitCode??0);t===0&&e&&typeof e!=`function`&&e.error&&(t=1),this._exit(t,`commander.help`,`(outputHelp)`)}addHelpText(e,t){let n=[`beforeAll`,`before`,`after`,`afterAll`];if(!n.includes(e))throw Error(`Unexpected value for position to addHelpText.
51
- Expecting one of '${n.join(`', '`)}'`);let r=`${e}Help`;return this.on(r,e=>{let n;n=typeof t==`function`?t({error:e.error,command:e.command}):t,n&&e.write(`${n}\n`)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(e=>t.is(e))&&(this.outputHelp(),this._exit(0,`commander.helpDisplayed`,`(outputHelp)`))}};function h(e){return e.map(e=>{if(!e.startsWith(`--inspect`))return e;let t,n=`127.0.0.1`,r=`9229`,i;return(i=e.match(/^(--inspect(-brk)?)$/))===null?(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))===null?(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=i[1],n=i[3],r=i[4]):(t=i[1],/^\d+$/.test(i[3])?r=i[3]:n=i[3]):t=i[1],t&&r!==`0`?`${t}=${n}:${parseInt(r)+1}`:e})}function g(){if(a.env.NO_COLOR||a.env.FORCE_COLOR===`0`||a.env.FORCE_COLOR===`false`)return!1;if(a.env.FORCE_COLOR||a.env.CLICOLOR_FORCE!==void 0)return!0}e.Command=m,e.useColor=g}));const{program:Kt,createCommand:qt,createArgument:Jt,createOption:Yt,CommanderError:Xt,InvalidArgumentError:Zt,InvalidOptionArgumentError:Qt,Command:$t,Argument:en,Option:tn,Help:nn}=(/* @__PURE__ */ w((/* @__PURE__ */ S((e=>{let{Argument:t}=Vt(),{Command:n}=Gt(),{CommanderError:r,InvalidArgumentError:i}=Bt(),{Help:a}=Ht(),{Option:o}=Ut();e.program=new n,e.createCommand=e=>new n(e),e.createOption=(e,t)=>new o(e,t),e.createArgument=(e,n)=>new t(e,n),e.Command=n,e.Option=o,e.Argument=t,e.Help=a,e.CommanderError=r,e.InvalidArgumentError=i,e.InvalidOptionArgumentError=i})))(),1)).default;function rn(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function an(e,t=`|`){return e.map(e=>On(e)).join(t)}function on(e,t){return typeof t==`bigint`?t.toString():t}var sn=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function cn(e){return new sn(e)}function ln(e){return e==null}function un(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function dn(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function fn(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function pn(e){return fn(e._zod.def)??e._zod.def.shape}function mn(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return dn(this,t,e),e},enumerable:!0,configurable:!0})}function hn(e,t,n){t in e?dn(e,t,n):e[t]=n}function gn(e,t,n,r){let i=pn(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?mn(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):hn(e,a,r?r(n.value,a):n.value))}}function _n(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?mn(e,n,()=>t[n]):hn(e,n,r.value))}}function L(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function vn(e){return JSON.stringify(e)}function yn(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}const bn=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function xn(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const Sn=/* @__PURE__*/ cn(()=>{if(gr.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function Cn(e){if(xn(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return xn(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function wn(e){return Cn(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const Tn=/* @__PURE__*/ new Set([`string`,`number`,`symbol`]);function En(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Dn(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function R(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function On(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function kn(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}const An={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},jn={int64:[/* @__PURE__*/ BigInt(`-9223372036854775808`),/* @__PURE__*/ BigInt(`9223372036854775807`)],uint64:[/* @__PURE__*/ BigInt(0),/* @__PURE__*/ BigInt(`18446744073709551615`)]};function Mn(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);let i={};return gn(i,e,Nn(e,t)),Dn(e,L(n,{shape:i,checks:[]}))}function Nn(e,t){let n=pn(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function Pn(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);let i=new Set(Nn(e,t)),a={};return gn(a,e,Reflect.ownKeys(pn(e)).filter(e=>!i.has(e))),Dn(e,L(n,{shape:a,checks:[]}))}function Fn(e,t){if(!Cn(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=pn(e);for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Dn(e,L(e._zod.def,{shape:In(e,t)}))}function In(e,t){let n={};return gn(n,e,Reflect.ownKeys(pn(e))),_n(n,t),n}function Ln(e,t){if(!Cn(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Dn(e,L(e._zod.def,{shape:In(e,t)}))}function Rn(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);let n={};return gn(n,e,Reflect.ownKeys(pn(e))),gn(n,t,Reflect.ownKeys(pn(t))),Dn(e,L(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function zn(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(Nn(t,n)):void 0,o={};return gn(o,t,Reflect.ownKeys(pn(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),Dn(t,L(t._zod.def,{shape:o,checks:[]}))}function Bn(e,t,n){let r=n?new Set(Nn(t,n)):void 0,i={};return gn(i,t,Reflect.ownKeys(pn(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),Dn(t,L(t._zod.def,{shape:i}))}function Vn(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Hn(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function Un(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Wn(e){return typeof e==`string`?e:e?.message}function Gn(e){let t=[];for(let n of e??[]){let e=n._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let r=e.maximum??e.length??e.size;r>=0&&t.push([r,n])}return t}function Kn(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function qn(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:Wn(e.inst?._zod.def?.error?.(e))??Wn(a?.(e))??Wn(t?.error?.(e))??Wn(n.customError?.(e))??Wn(n.localeError?.(e))??`Invalid input`,s={};for(let t of Object.keys(e))t!==`inst`&&t!==`schema`&&t!==`continue`&&t!==`input`&&t!==`__proto__`&&(s[t]=e[t]);return s.path??=[],s.message=o,t?.reportInput&&(s.input=e.input),s}const Jn=/[\uD800-\uDBFF]/;function Yn(e){let t=e.length;if(!Jn.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function Xn(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Zn(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function Qn(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function $n(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):rr(e,n,r.value)}}function er(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function tr(e,t,n){return er(e,t,n,!1)}/* @__NO_SIDE_EFFECTS__ */
52
- function nr(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return er(this,n,r(this))},set(e){er(this,n,e)}})}return t}function rr(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:er(this,t,n.bind(this))},set(e){er(this,t,e)}})}function ir(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}let ar,or=!1;const sr={configurable:!0,get(){or=!0}};function z(e,t,n){let r=Object.getPrototypeOf(e._zod);t in r&&ar!==e._zod?ar=void 0:(ar=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,sr);let e=or;or=!1;try{let r=n(this);return or?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),or||=e,r}catch(n){throw delete this[t],or||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}}))}function cr(e,t,n,r){let i=ir(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}function lr(e){let t=()=>e;return t[`~constantCatch`]=!0,t}var ur;const dr={value:void 0,enumerable:!1};let fr=`captureStackTrace`in Error?Error:null;function pr(e){let t=fr;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return fr=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}/* @__NO_SIDE_EFFECTS__ */
53
- function B(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=/* @__PURE__ */ new Set}a.prototype=i;let o=n,s=o&&/* @__PURE__ */ new WeakSet;function c(n,r){if(!n._zod){dr.value=new a(r);try{Object.defineProperty(n,"_zod",dr)}finally{dr.value=void 0}}else if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),$n(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?pr(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var mr=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},hr=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(ur=globalThis).__zod_globalConfig??(ur.__zod_globalConfig={});const gr=globalThis.__zod_globalConfig;function _r(e){return e&&Object.assign(gr,e),gr}function vr(){let e=this._zod;return e.message??=JSON.stringify(e.def,on,2),e.message}function yr(e){this._zod.message=e}const br={get:vr,set:yr,enumerable:!0,configurable:!0},xr={value:void 0,enumerable:!1},Sr=/* @__PURE__ */ new WeakSet([Object.prototype,Error.prototype]),Cr=/* @__PURE__ */ B(`$ZodError`,(e,t)=>{e.name=`$ZodError`,xr.value=t,Object.defineProperty(e,"issues",xr),xr.value=void 0,Object.defineProperty(e,"message",br);let n=Object.getPrototypeOf(e);Sr.has(n)||(Sr.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))});function wr(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function Tr(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?wr(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Er(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function Dr(e,t){return{callee:t?.callee??e,Err:t?.Err}}const Or=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new mr;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>qn(e,o,_r())));throw bn(n,a?.callee??t),n}return s.value};return t},kr=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>qn(e,o,_r())));throw bn(n,a?.callee??t),n}return s.value};return t},Ar=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new mr;return a.issues.length?jr(e,a.issues,i):{success:!0,data:a.value}};function jr(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>qn(e,n,_r()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}const Mr=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?jr(e,a.issues,i):{success:!0,data:a.value}},Nr=/* @__PURE__ */ Symbol.for(`zod.compile.invalid`),Pr=/* @__PURE__ */ Symbol.for(`zod.compile.fallback`),Fr=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==Nr)return!0;if(r.definite===!0&&n===void 0)return!1}return Ir(e,t,n)});function Ir(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[Pr]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new mr;return a.issues.length===0}const Lr=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},Rr=e=>{let t=Or(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,Dr(n,a))};return n},zr=e=>{let t=Or(e),n=(e,r,i,a)=>t(e,r,i,Dr(n,a));return n},Br=e=>{let t=kr(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,Dr(n,a))};return n},Vr=e=>{let t=kr(e),n=async(e,r,i,a)=>await t(e,r,i,Dr(n,a));return n},Hr=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Ar(e)(t,n,i)},Ur=e=>(t,n,r)=>Ar(e)(t,n,r),Wr=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Mr(e)(t,n,i)},Gr=e=>async(t,n,r)=>Mr(e)(t,n,r),Kr=/^[cC][0-9a-z]{6,}$/,qr=/^[0-9a-z]+$/,Jr=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Yr=/^[0-9a-vA-V]{20}$/,Xr=/^[A-Za-z0-9]{27}$/,Zr=/^[a-zA-Z0-9_-]{21}$/;function Qr(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}const $r=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ei=/^([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})$/,ti=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([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|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,ni=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;function ri(){return RegExp(`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`,`u`)}const ii=/^(?:(?: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])$/,ai=/^(([0-9a-fA-F]{1,4}:){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}|:))$/,oi=/^((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])$/,si=/^(([0-9a-fA-F]{1,4}:){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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ci=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,li=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,ui=/^https?$/,di=/^\+[1-9]\d{6,14}$/,fi=`(?:(?:\\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])))`;function pi(e){return RegExp(`^${e}$`)}const mi=/*@__PURE__*/ pi(fi);function hi(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function gi(e){return RegExp(`^${hi(e)}$`)}function _i(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${hi({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${hi({precision:e.precision})}`:n;return RegExp(`^${fi}T(?:${r})$`)}const vi=/^[\s\S]{0,}$/,yi=/^-?\d+$/,bi=/^-?\d+(?:\.\d+)?$/,xi=/^[^A-Z]*$/,Si=/^[^a-z]*$/,Ci=/*@__PURE__*/ B(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),wi=e=>{let t=e.value;return!ln(t)&&t.length!==void 0},Ti=/*@__PURE__*/ B(`$ZodCheckMaxLength`,(e,t)=>{var n;Ci.init(e,t),(n=e._zod.def).when??(n.when=wi),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?Yn(r):i)<=t.maximum)return;let a=Xn(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Ei=/*@__PURE__*/ B(`$ZodCheckMinLength`,(e,t)=>{var n;Ci.init(e,t),(n=e._zod.def).when??(n.when=wi),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?Yn(r):i)>=t.minimum)return;let a=Xn(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Di=/*@__PURE__*/ B(`$ZodCheckLengthEquals`,(e,t)=>{var n;Ci.init(e,t),(n=e._zod.def).when??(n.when=wi),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?Yn(r):i;if(a===t.length)return;let o=Xn(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Oi=/*@__PURE__*/ B(`$ZodCheckStringFormat`,(e,t)=>{var n,r;Ci.init(e,t),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),ki=/*@__PURE__*/ B(`$ZodCheckRegex`,(e,t)=>{Oi.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Ai=/*@__PURE__*/ B(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=xi,Oi.init(e,t)}),ji=/*@__PURE__*/ B(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Si,Oi.init(e,t)}),Mi=/*@__PURE__*/ B(`$ZodCheckIncludes`,(e,t)=>{Ci.init(e,t);let n=En(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Ni=/*@__PURE__*/ B(`$ZodCheckStartsWith`,(e,t)=>{Ci.init(e,t);let n=RegExp(`^${En(t.prefix)}.*`);t.pattern??=n,e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Pi=/*@__PURE__*/ B(`$ZodCheckEndsWith`,(e,t)=>{Ci.init(e,t);let n=RegExp(`.*${En(t.suffix)}$`);t.pattern??=n,e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Fi=/*@__PURE__*/ B(`$ZodCheckOverwrite`,(e,t)=>{Ci.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});var Ii=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{--this.indent}}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
51
+ Expecting one of '${n.join(`', '`)}'`);let r=`${e}Help`;return this.on(r,e=>{let n;n=typeof t==`function`?t({error:e.error,command:e.command}):t,n&&e.write(`${n}\n`)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(e=>t.is(e))&&(this.outputHelp(),this._exit(0,`commander.helpDisplayed`,`(outputHelp)`))}};function h(e){return e.map(e=>{if(!e.startsWith(`--inspect`))return e;let t,n=`127.0.0.1`,r=`9229`,i;return(i=e.match(/^(--inspect(-brk)?)$/))===null?(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))===null?(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=i[1],n=i[3],r=i[4]):(t=i[1],/^\d+$/.test(i[3])?r=i[3]:n=i[3]):t=i[1],t&&r!==`0`?`${t}=${n}:${parseInt(r)+1}`:e})}function g(){if(a.env.NO_COLOR||a.env.FORCE_COLOR===`0`||a.env.FORCE_COLOR===`false`)return!1;if(a.env.FORCE_COLOR||a.env.CLICOLOR_FORCE!==void 0)return!0}e.Command=m,e.useColor=g}));const{program:Jt,createCommand:Yt,createArgument:Xt,createOption:Zt,CommanderError:Qt,InvalidArgumentError:$t,InvalidOptionArgumentError:en,Command:tn,Argument:nn,Option:rn,Help:an}=(/* @__PURE__ */ w((/* @__PURE__ */ S((e=>{let{Argument:t}=Ut(),{Command:n}=qt(),{CommanderError:r,InvalidArgumentError:i}=Ht(),{Help:a}=Wt(),{Option:o}=Gt();e.program=new n,e.createCommand=e=>new n(e),e.createOption=(e,t)=>new o(e,t),e.createArgument=(e,n)=>new t(e,n),e.Command=n,e.Option=o,e.Argument=t,e.Help=a,e.CommanderError=r,e.InvalidArgumentError=i,e.InvalidOptionArgumentError=i})))(),1)).default;function on(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function sn(e,t=`|`){return e.map(e=>An(e)).join(t)}function cn(e,t){return typeof t==`bigint`?t.toString():t}var ln=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function un(e){return new ln(e)}function dn(e){return e==null}function fn(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function pn(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function mn(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function hn(e){return mn(e._zod.def)??e._zod.def.shape}function gn(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return pn(this,t,e),e},enumerable:!0,configurable:!0})}function _n(e,t,n){t in e?pn(e,t,n):e[t]=n}function vn(e,t,n,r){let i=hn(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?gn(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):_n(e,a,r?r(n.value,a):n.value))}}function yn(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?gn(e,n,()=>t[n]):_n(e,n,r.value))}}function L(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function bn(e){return JSON.stringify(e)}function xn(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}const Sn=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function Cn(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const wn=/* @__PURE__*/ un(()=>{if(vr.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function Tn(e){if(Cn(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return Cn(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function En(e){return Tn(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const Dn=/* @__PURE__*/ new Set([`string`,`number`,`symbol`]);function On(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function kn(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function R(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function An(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function jn(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}const Mn={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Nn={int64:[/* @__PURE__*/ BigInt(`-9223372036854775808`),/* @__PURE__*/ BigInt(`9223372036854775807`)],uint64:[/* @__PURE__*/ BigInt(0),/* @__PURE__*/ BigInt(`18446744073709551615`)]};function Pn(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);let i={};return vn(i,e,Fn(e,t)),kn(e,L(n,{shape:i,checks:[]}))}function Fn(e,t){let n=hn(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function In(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);let i=new Set(Fn(e,t)),a={};return vn(a,e,Reflect.ownKeys(hn(e)).filter(e=>!i.has(e))),kn(e,L(n,{shape:a,checks:[]}))}function Ln(e,t){if(!Tn(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=hn(e);for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return kn(e,L(e._zod.def,{shape:Rn(e,t)}))}function Rn(e,t){let n={};return vn(n,e,Reflect.ownKeys(hn(e))),yn(n,t),n}function zn(e,t){if(!Tn(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return kn(e,L(e._zod.def,{shape:Rn(e,t)}))}function Bn(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);let n={};return vn(n,e,Reflect.ownKeys(hn(e))),vn(n,t,Reflect.ownKeys(hn(t))),kn(e,L(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function Vn(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(Fn(t,n)):void 0,o={};return vn(o,t,Reflect.ownKeys(hn(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),kn(t,L(t._zod.def,{shape:o,checks:[]}))}function Hn(e,t,n){let r=n?new Set(Fn(t,n)):void 0,i={};return vn(i,t,Reflect.ownKeys(hn(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),kn(t,L(t._zod.def,{shape:i}))}function Un(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Wn(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function Gn(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Kn(e){return typeof e==`string`?e:e?.message}function qn(e){let t=[];for(let n of e??[]){let e=n._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let r=e.maximum??e.length??e.size;r>=0&&t.push([r,n])}return t}function Jn(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function Yn(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:Kn(e.inst?._zod.def?.error?.(e))??Kn(a?.(e))??Kn(t?.error?.(e))??Kn(n.customError?.(e))??Kn(n.localeError?.(e))??`Invalid input`,s={};for(let t of Object.keys(e))t!==`inst`&&t!==`schema`&&t!==`continue`&&t!==`input`&&t!==`__proto__`&&(s[t]=e[t]);return s.path??=[],s.message=o,t?.reportInput&&(s.input=e.input),s}const Xn=/[\uD800-\uDBFF]/;function Zn(e){let t=e.length;if(!Xn.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function Qn(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function $n(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function er(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function tr(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):ar(e,n,r.value)}}function nr(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function rr(e,t,n){return nr(e,t,n,!1)}/* @__NO_SIDE_EFFECTS__ */
52
+ function ir(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return nr(this,n,r(this))},set(e){nr(this,n,e)}})}return t}function ar(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:nr(this,t,n.bind(this))},set(e){nr(this,t,e)}})}function or(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}let sr,cr=!1;const lr={configurable:!0,get(){cr=!0}};function z(e,t,n){let r=Object.getPrototypeOf(e._zod);t in r&&sr!==e._zod?sr=void 0:(sr=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,lr);let e=cr;cr=!1;try{let r=n(this);return cr?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),cr||=e,r}catch(n){throw delete this[t],cr||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}}))}function ur(e,t,n,r){let i=or(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}function dr(e){let t=()=>e;return t[`~constantCatch`]=!0,t}var fr;const pr={value:void 0,enumerable:!1};let mr=`captureStackTrace`in Error?Error:null;function hr(e){let t=mr;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return mr=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}/* @__NO_SIDE_EFFECTS__ */
53
+ function B(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=/* @__PURE__ */ new Set}a.prototype=i;let o=n,s=o&&/* @__PURE__ */ new WeakSet;function c(n,r){if(!n._zod){pr.value=new a(r);try{Object.defineProperty(n,"_zod",pr)}finally{pr.value=void 0}}else if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),tr(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?hr(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var gr=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},_r=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(fr=globalThis).__zod_globalConfig??(fr.__zod_globalConfig={});const vr=globalThis.__zod_globalConfig;function yr(e){return e&&Object.assign(vr,e),vr}function br(){let e=this._zod;return e.message??=JSON.stringify(e.def,cn,2),e.message}function xr(e){this._zod.message=e}const Sr={get:br,set:xr,enumerable:!0,configurable:!0},Cr={value:void 0,enumerable:!1},wr=/* @__PURE__ */ new WeakSet([Object.prototype,Error.prototype]),Tr=/* @__PURE__ */ B(`$ZodError`,(e,t)=>{e.name=`$ZodError`,Cr.value=t,Object.defineProperty(e,"issues",Cr),Cr.value=void 0,Object.defineProperty(e,"message",Sr);let n=Object.getPrototypeOf(e);wr.has(n)||(wr.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))});function Er(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function Dr(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?Er(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Or(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function kr(e,t){return{callee:t?.callee??e,Err:t?.Err}}const Ar=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new gr;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>Yn(e,o,yr())));throw Sn(n,a?.callee??t),n}return s.value};return t},jr=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>Yn(e,o,yr())));throw Sn(n,a?.callee??t),n}return s.value};return t},Mr=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new gr;return a.issues.length?Nr(e,a.issues,i):{success:!0,data:a.value}};function Nr(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>Yn(e,n,yr()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}const Pr=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?Nr(e,a.issues,i):{success:!0,data:a.value}},Fr=/* @__PURE__ */ Symbol.for(`zod.compile.invalid`),Ir=/* @__PURE__ */ Symbol.for(`zod.compile.fallback`),Lr=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==Fr)return!0;if(r.definite===!0&&n===void 0)return!1}return Rr(e,t,n)});function Rr(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[Ir]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new gr;return a.issues.length===0}const zr=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},Br=e=>{let t=Ar(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,kr(n,a))};return n},Vr=e=>{let t=Ar(e),n=(e,r,i,a)=>t(e,r,i,kr(n,a));return n},Hr=e=>{let t=jr(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,kr(n,a))};return n},Ur=e=>{let t=jr(e),n=async(e,r,i,a)=>await t(e,r,i,kr(n,a));return n},Wr=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Mr(e)(t,n,i)},Gr=e=>(t,n,r)=>Mr(e)(t,n,r),Kr=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Pr(e)(t,n,i)},qr=e=>async(t,n,r)=>Pr(e)(t,n,r),Jr=/^[cC][0-9a-z]{6,}$/,Yr=/^[0-9a-z]+$/,Xr=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Zr=/^[0-9a-vA-V]{20}$/,Qr=/^[A-Za-z0-9]{27}$/,$r=/^[a-zA-Z0-9_-]{21}$/;function ei(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}const ti=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ni=/^([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})$/,ri=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([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|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,ii=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;function ai(){return RegExp(`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`,`u`)}const oi=/^(?:(?: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])$/,si=/^(([0-9a-fA-F]{1,4}:){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}|:))$/,ci=/^((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])$/,li=/^(([0-9a-fA-F]{1,4}:){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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ui=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,di=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,fi=/^https?$/,pi=/^\+[1-9]\d{6,14}$/,mi=`(?:(?:\\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])))`;function hi(e){return RegExp(`^${e}$`)}const gi=/*@__PURE__*/ hi(mi);function _i(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function vi(e){return RegExp(`^${_i(e)}$`)}function yi(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${_i({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${_i({precision:e.precision})}`:n;return RegExp(`^${mi}T(?:${r})$`)}const bi=/^[\s\S]{0,}$/,xi=/^-?\d+$/,Si=/^-?\d+(?:\.\d+)?$/,Ci=/^[^A-Z]*$/,wi=/^[^a-z]*$/,Ti=/*@__PURE__*/ B(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Ei=e=>{let t=e.value;return!dn(t)&&t.length!==void 0},Di=/*@__PURE__*/ B(`$ZodCheckMaxLength`,(e,t)=>{var n;Ti.init(e,t),(n=e._zod.def).when??(n.when=Ei),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?Zn(r):i)<=t.maximum)return;let a=Qn(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Oi=/*@__PURE__*/ B(`$ZodCheckMinLength`,(e,t)=>{var n;Ti.init(e,t),(n=e._zod.def).when??(n.when=Ei),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?Zn(r):i)>=t.minimum)return;let a=Qn(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ki=/*@__PURE__*/ B(`$ZodCheckLengthEquals`,(e,t)=>{var n;Ti.init(e,t),(n=e._zod.def).when??(n.when=Ei),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?Zn(r):i;if(a===t.length)return;let o=Qn(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Ai=/*@__PURE__*/ B(`$ZodCheckStringFormat`,(e,t)=>{var n,r;Ti.init(e,t),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),ji=/*@__PURE__*/ B(`$ZodCheckRegex`,(e,t)=>{Ai.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Mi=/*@__PURE__*/ B(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Ci,Ai.init(e,t)}),Ni=/*@__PURE__*/ B(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=wi,Ai.init(e,t)}),Pi=/*@__PURE__*/ B(`$ZodCheckIncludes`,(e,t)=>{Ti.init(e,t);let n=On(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Fi=/*@__PURE__*/ B(`$ZodCheckStartsWith`,(e,t)=>{Ti.init(e,t);let n=RegExp(`^${On(t.prefix)}.*`);t.pattern??=n,e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Ii=/*@__PURE__*/ B(`$ZodCheckEndsWith`,(e,t)=>{Ti.init(e,t);let n=RegExp(`.*${On(t.suffix)}$`);t.pattern??=n,e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Li=/*@__PURE__*/ B(`$ZodCheckOverwrite`,(e,t)=>{Ti.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});var Ri=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{--this.indent}}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
54
54
  `).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.content??[``];return new e(...Object.keys(this.closed),`return function (${this.args.join(`, `)}) {\n${t.join(`
55
- `)}\n};`)(...Object.values(this.closed))}};const Li={major:4,minor:6,patch:7},V=/*@__PURE__*/ B(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Li;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=Vn(t),a;for(let o of n){if(o._zod.def.when){if(Hn(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new mr;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(Kn(t.issues,n,e),i||=Vn(t,n))});else{if(t.issues.length===n)continue;Kn(t.issues,n,e),i||=Vn(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(Vn(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new mr;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new mr;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return tr(this,`~standard`,Bi(this))},set"~standard"(e){er(this,`~standard`,e)}}),Ri=(e,t)=>e.issues.length?{issues:e.issues.map(e=>qn(e,t,_r()))}:{value:e.value};async function zi(e,t){let n={async:!0};return Ri(await e._zod.run({value:t,issues:[]},n),n)}function Bi(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return Ri(r,n)}catch{}return zi(e,t)},vendor:`zod`,version:1}}const Vi=/*@__PURE__*/ B(`$ZodString`,(e,t)=>{V.init(e,t),e._zod.pattern=t.pattern??vi,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),H=/*@__PURE__*/ B(`$ZodStringFormat`,(e,t)=>{Oi.init(e,t),Vi.init(e,t)}),Hi=/*@__PURE__*/ B(`$ZodGUID`,(e,t)=>{t.pattern??=ei,H.init(e,t)}),Ui=/*@__PURE__*/ B(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=ti(e)}else t.pattern??=ti();H.init(e,t)}),Wi=/*@__PURE__*/ B(`$ZodEmail`,(e,t)=>{t.pattern??=ni,H.init(e,t)});function Gi(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function Ki(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?Gi(e)||2:qi(e,t)}function qi(e,t){if(!t.normalize&&t.protocol?.source===ui.source&&!/^https?:\/\//i.test(e))return 1;try{if(typeof URL<`u`){let t=URL;if(typeof t.parse==`function`)return t.parse(e)??2}return new URL(e)}catch{return 2}}const Ji=/[\t\n\r]/g;function Yi(e){return e.replace(Ji,``)}function Xi(e,t){return t.lastIndex=0,t.test(e.hostname)}function Zi(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}const Qi=/*@__PURE__*/ B(`$ZodURL`,(e,t)=>{H.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=Ki(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}if(i===!0){n.value=Yi(r);return}t.hostname&&!Xi(i,t.hostname)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!Zi(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:Yi(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),$i=/*@__PURE__*/ B(`$ZodEmoji`,(e,t)=>{t.pattern??=ri(),H.init(e,t)}),ea=/*@__PURE__*/ B(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?Zr:Qr(t.length),H.init(e,t)}),ta=/*@__PURE__*/ B(`$ZodCUID`,(e,t)=>{t.pattern??=Kr,H.init(e,t)}),na=/*@__PURE__*/ B(`$ZodCUID2`,(e,t)=>{t.pattern??=qr,H.init(e,t)}),ra=/*@__PURE__*/ B(`$ZodULID`,(e,t)=>{t.pattern??=Jr,H.init(e,t)}),ia=/*@__PURE__*/ B(`$ZodXID`,(e,t)=>{t.pattern??=Yr,H.init(e,t)}),aa=/*@__PURE__*/ B(`$ZodKSUID`,(e,t)=>{t.pattern??=Xr,H.init(e,t)}),oa=/*@__PURE__*/ B(`$ZodISODateTime`,(e,t)=>{t.pattern??=_i(t),H.init(e,t)}),sa=/*@__PURE__*/ B(`$ZodISODate`,(e,t)=>{t.pattern??=mi,H.init(e,t)}),ca=/*@__PURE__*/ B(`$ZodISOTime`,(e,t)=>{t.pattern??=gi(t),H.init(e,t)}),la=/*@__PURE__*/ B(`$ZodISODuration`,(e,t)=>{t.pattern??=$r,H.init(e,t)}),ua=/*@__PURE__*/ B(`$ZodIPv4`,(e,t)=>{t.pattern??=ii,H.init(e,t)}),da=/^[0-9a-fA-F:.]+$/;function fa(e){return da.test(e)?Gi(`http://[${e}]`):!1}const pa=/*@__PURE__*/ B(`$ZodIPv6`,(e,t)=>{t.pattern??=ai,H.init(e,t),e._zod.check=n=>{fa(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),ma=/*@__PURE__*/ B(`$ZodCIDRv4`,(e,t)=>{t.pattern??=oi,H.init(e,t)});function ha(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:fa(n)}const ga=/*@__PURE__*/ B(`$ZodCIDRv6`,(e,t)=>{t.pattern??=si,H.init(e,t),e._zod.check=n=>{ha(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function _a(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const va=/^[0-9a-zA-Z+/]*={0,2}$/,ya=/*@__PURE__*/ B(`$ZodBase64`,(e,t)=>{t.pattern??=va,H.init(e,t),e._zod.check=n=>{_a(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),ba=/^[A-Za-z0-9_-]*$/;function xa(e){if(!ba.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return _a(t.padEnd(Math.ceil(t.length/4)*4,`=`))}const Sa=/*@__PURE__*/ B(`$ZodBase64URL`,(e,t)=>{t.pattern??=ba,H.init(e,t),e._zod.check=n=>{xa(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Ca=/*@__PURE__*/ B(`$ZodE164`,(e,t)=>{t.pattern??=di,H.init(e,t)});function wa(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}const Ta=/*@__PURE__*/ B(`$ZodJWT`,(e,t)=>{H.init(e,t),e._zod.check=n=>{wa(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),Ea=/*@__PURE__*/ B(`$ZodUnknown`,(e,t)=>{V.init(e,t),e._zod.parse=e=>e}),Da=/*@__PURE__*/ B(`$ZodNever`,(e,t)=>{V.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function Oa(e,t){let n=Gn(e._zod.def.checks);if(!n.length)return;let r=Math.min(...n.map(e=>e[0])),i=e._zod.parse;e._zod.parse=(n,a)=>{let o=t(n.value);if(o>r&&!a?.skipChecks&&a?.direction!==`backward`){for(let[t,r]of Gn(e._zod.def.checks))if(o>t&&r._zod.def.when(n)){let t=n.issues.length;return r._zod.check(n),n.issues[t].continue=!1,Kn(n.issues,t,e),n}}return i(n,a)}}const ka=e=>Array.isArray(e)?e.length:-1;function Aa(e,t,n){e.issues.length&&t.issues.push(...Un(n,e.issues)),t.value[n]=e.value}const ja=/*@__PURE__*/ B(`$ZodArray`,(e,t)=>{V.init(e,t);let n=gr.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[],s=i?.abortEarly;for(let e=0;e<a.length;e++){let n=a[e],c=t.element._zod.run({value:n,issues:[]},i);if(c instanceof Promise)o.push(c.then(t=>Aa(t,r,e)));else if(Aa(c,r,e),s&&c.issues.length!==0&&Vn(c))break}return o.length?Promise.all(o).then(()=>r):r},Oa(e,ka)});function Ma(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(o||!s||i!==`optional`){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...Un(n,e.issues))}!o&&i===void 0?e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]}):e.value===void 0?(o||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}const Na=[];function Pa(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:Na,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=kn(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function Fa(e,t,n,r,i,a,o){let s=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,f=l.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(Vn(n,p))break;p=n.issues.length}if(c.has(i))continue;if(i===`__proto__`){u===`never`&&s.push(i);continue}if(u===`never`){s.push(i);continue}let a=l.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>Ma(e,n,i,t,d,f))):Ma(a,n,i,t,d,f)}return s.length&&n.issues.push({code:`unrecognized_keys`,keys:s,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}const Ia=/*@__PURE__*/ B(`$ZodObject`,(e,t)=>{V.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=n?.get?n.get.raw:t.shape??{};if(r){let e=()=>{let n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let i=cn(()=>Pa(t));z(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||dn(n,e,/* @__PURE__ */ new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let a=xn,o=t.catchall,s,c=gr.memoizer;c?.attach(e),e._zod.parse=(t,n)=>{s??=i.value;let r=t.value;if(!a(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value=c?c.alloc(e,t,{},n):{};let l=[],u=s.shape,d=n?.abortEarly,f=t.issues.length;for(let e of s.allKeys){if(d&&t.issues.length!==f){if(Vn(t,f))break;f=t.issues.length}if(e===`__proto__`)continue;let i=u[e],a=i._zod.optin,o=i._zod.optout,s=i._zod.run({value:r[e],issues:[]},n);s instanceof Promise?l.push(s.then(n=>Ma(n,t,e,r,a,o))):Ma(s,t,e,r,a,o)}return o?Fa(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),La=/*@__PURE__*/ B(`$ZodObjectJIT`,(e,t)=>{Ia.init(e,t);let n=e._zod.parse,r=cn(()=>Pa(t)),i=gr.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new Ii([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
55
+ `)}\n};`)(...Object.values(this.closed))}};const zi={major:4,minor:6,patch:7},V=/*@__PURE__*/ B(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=zi;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=Un(t),a;for(let o of n){if(o._zod.def.when){if(Wn(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new gr;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(Jn(t.issues,n,e),i||=Un(t,n))});else{if(t.issues.length===n)continue;Jn(t.issues,n,e),i||=Un(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(Un(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new gr;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new gr;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return rr(this,`~standard`,Hi(this))},set"~standard"(e){nr(this,`~standard`,e)}}),Bi=(e,t)=>e.issues.length?{issues:e.issues.map(e=>Yn(e,t,yr()))}:{value:e.value};async function Vi(e,t){let n={async:!0};return Bi(await e._zod.run({value:t,issues:[]},n),n)}function Hi(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return Bi(r,n)}catch{}return Vi(e,t)},vendor:`zod`,version:1}}const Ui=/*@__PURE__*/ B(`$ZodString`,(e,t)=>{V.init(e,t),e._zod.pattern=t.pattern??bi,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),H=/*@__PURE__*/ B(`$ZodStringFormat`,(e,t)=>{Ai.init(e,t),Ui.init(e,t)}),Wi=/*@__PURE__*/ B(`$ZodGUID`,(e,t)=>{t.pattern??=ni,H.init(e,t)}),Gi=/*@__PURE__*/ B(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=ri(e)}else t.pattern??=ri();H.init(e,t)}),Ki=/*@__PURE__*/ B(`$ZodEmail`,(e,t)=>{t.pattern??=ii,H.init(e,t)});function qi(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function Ji(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?qi(e)||2:Yi(e,t)}function Yi(e,t){if(!t.normalize&&t.protocol?.source===fi.source&&!/^https?:\/\//i.test(e))return 1;try{if(typeof URL<`u`){let t=URL;if(typeof t.parse==`function`)return t.parse(e)??2}return new URL(e)}catch{return 2}}const Xi=/[\t\n\r]/g;function Zi(e){return e.replace(Xi,``)}function Qi(e,t){return t.lastIndex=0,t.test(e.hostname)}function $i(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}const ea=/*@__PURE__*/ B(`$ZodURL`,(e,t)=>{H.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=Ji(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}if(i===!0){n.value=Zi(r);return}t.hostname&&!Qi(i,t.hostname)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!$i(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:Zi(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),ta=/*@__PURE__*/ B(`$ZodEmoji`,(e,t)=>{t.pattern??=ai(),H.init(e,t)}),na=/*@__PURE__*/ B(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?$r:ei(t.length),H.init(e,t)}),ra=/*@__PURE__*/ B(`$ZodCUID`,(e,t)=>{t.pattern??=Jr,H.init(e,t)}),ia=/*@__PURE__*/ B(`$ZodCUID2`,(e,t)=>{t.pattern??=Yr,H.init(e,t)}),aa=/*@__PURE__*/ B(`$ZodULID`,(e,t)=>{t.pattern??=Xr,H.init(e,t)}),oa=/*@__PURE__*/ B(`$ZodXID`,(e,t)=>{t.pattern??=Zr,H.init(e,t)}),sa=/*@__PURE__*/ B(`$ZodKSUID`,(e,t)=>{t.pattern??=Qr,H.init(e,t)}),ca=/*@__PURE__*/ B(`$ZodISODateTime`,(e,t)=>{t.pattern??=yi(t),H.init(e,t)}),la=/*@__PURE__*/ B(`$ZodISODate`,(e,t)=>{t.pattern??=gi,H.init(e,t)}),ua=/*@__PURE__*/ B(`$ZodISOTime`,(e,t)=>{t.pattern??=vi(t),H.init(e,t)}),da=/*@__PURE__*/ B(`$ZodISODuration`,(e,t)=>{t.pattern??=ti,H.init(e,t)}),fa=/*@__PURE__*/ B(`$ZodIPv4`,(e,t)=>{t.pattern??=oi,H.init(e,t)}),pa=/^[0-9a-fA-F:.]+$/;function ma(e){return pa.test(e)?qi(`http://[${e}]`):!1}const ha=/*@__PURE__*/ B(`$ZodIPv6`,(e,t)=>{t.pattern??=si,H.init(e,t),e._zod.check=n=>{ma(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),ga=/*@__PURE__*/ B(`$ZodCIDRv4`,(e,t)=>{t.pattern??=ci,H.init(e,t)});function _a(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:ma(n)}const va=/*@__PURE__*/ B(`$ZodCIDRv6`,(e,t)=>{t.pattern??=li,H.init(e,t),e._zod.check=n=>{_a(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function ya(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const ba=/^[0-9a-zA-Z+/]*={0,2}$/,xa=/*@__PURE__*/ B(`$ZodBase64`,(e,t)=>{t.pattern??=ba,H.init(e,t),e._zod.check=n=>{ya(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),Sa=/^[A-Za-z0-9_-]*$/;function Ca(e){if(!Sa.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return ya(t.padEnd(Math.ceil(t.length/4)*4,`=`))}const wa=/*@__PURE__*/ B(`$ZodBase64URL`,(e,t)=>{t.pattern??=Sa,H.init(e,t),e._zod.check=n=>{Ca(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Ta=/*@__PURE__*/ B(`$ZodE164`,(e,t)=>{t.pattern??=pi,H.init(e,t)});function Ea(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}const Da=/*@__PURE__*/ B(`$ZodJWT`,(e,t)=>{H.init(e,t),e._zod.check=n=>{Ea(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),Oa=/*@__PURE__*/ B(`$ZodUnknown`,(e,t)=>{V.init(e,t),e._zod.parse=e=>e}),ka=/*@__PURE__*/ B(`$ZodNever`,(e,t)=>{V.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function Aa(e,t){let n=qn(e._zod.def.checks);if(!n.length)return;let r=Math.min(...n.map(e=>e[0])),i=e._zod.parse;e._zod.parse=(n,a)=>{let o=t(n.value);if(o>r&&!a?.skipChecks&&a?.direction!==`backward`){for(let[t,r]of qn(e._zod.def.checks))if(o>t&&r._zod.def.when(n)){let t=n.issues.length;return r._zod.check(n),n.issues[t].continue=!1,Jn(n.issues,t,e),n}}return i(n,a)}}const ja=e=>Array.isArray(e)?e.length:-1;function Ma(e,t,n){e.issues.length&&t.issues.push(...Gn(n,e.issues)),t.value[n]=e.value}const Na=/*@__PURE__*/ B(`$ZodArray`,(e,t)=>{V.init(e,t);let n=vr.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[],s=i?.abortEarly;for(let e=0;e<a.length;e++){let n=a[e],c=t.element._zod.run({value:n,issues:[]},i);if(c instanceof Promise)o.push(c.then(t=>Ma(t,r,e)));else if(Ma(c,r,e),s&&c.issues.length!==0&&Un(c))break}return o.length?Promise.all(o).then(()=>r):r},Aa(e,ja)});function Pa(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(o||!s||i!==`optional`){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...Gn(n,e.issues))}!o&&i===void 0?e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]}):e.value===void 0?(o||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}const Fa=[];function Ia(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:Fa,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=jn(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function La(e,t,n,r,i,a,o){let s=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,f=l.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(Un(n,p))break;p=n.issues.length}if(c.has(i))continue;if(i===`__proto__`){u===`never`&&s.push(i);continue}if(u===`never`){s.push(i);continue}let a=l.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>Pa(e,n,i,t,d,f))):Pa(a,n,i,t,d,f)}return s.length&&n.issues.push({code:`unrecognized_keys`,keys:s,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}const Ra=/*@__PURE__*/ B(`$ZodObject`,(e,t)=>{V.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=n?.get?n.get.raw:t.shape??{};if(r){let e=()=>{let n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let i=un(()=>Ia(t));z(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||pn(n,e,/* @__PURE__ */ new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let a=Cn,o=t.catchall,s,c=vr.memoizer;c?.attach(e),e._zod.parse=(t,n)=>{s??=i.value;let r=t.value;if(!a(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value=c?c.alloc(e,t,{},n):{};let l=[],u=s.shape,d=n?.abortEarly,f=t.issues.length;for(let e of s.allKeys){if(d&&t.issues.length!==f){if(Un(t,f))break;f=t.issues.length}if(e===`__proto__`)continue;let i=u[e],a=i._zod.optin,o=i._zod.optout,s=i._zod.run({value:r[e],issues:[]},n);s instanceof Promise?l.push(s.then(n=>Pa(n,t,e,r,a,o))):Pa(s,t,e,r,a,o)}return o?La(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),za=/*@__PURE__*/ B(`$ZodObjectJIT`,(e,t)=>{Ra.init(e,t);let n=e._zod.parse,r=un(()=>Ia(t)),i=vr.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new Ri([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
56
56
  let ${e}_ab = false;
57
57
  for (let i = 0; i < ${e}.issues.length; i++) {
58
58
  const iss = ${e}.issues[i];
@@ -63,7 +63,7 @@ function B(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=
63
63
  if (${e}_ab && ctx && ctx.abortEarly) {
64
64
  payload.value = newResult;
65
65
  return payload;
66
- }`;o.write(`const input = payload.value;`);let l=Object.create(null),u=0;for(let e of n.allKeys)l[e]=`key_${u++}`;o.write(i?`const newResult = memo.alloc(inst, payload, {}, ctx);`:`const newResult = {};`);for(let e of n.allKeys){if(e===`__proto__`)continue;let n=l[e],r=typeof e==`symbol`?`syms[${a.indexOf(e)}]`:vn(e),i=`${r} in input`,u=t[e],d=u?._zod?.optin,f=d!==void 0,p=u?._zod?.optout===`optional`;if(o.write(`const ${n} = ${s(r)};`),f&&p){let e=d===`optional`?`${n}_present`:`${n}.value !== undefined || ${n}_present`;o.write(`
66
+ }`;o.write(`const input = payload.value;`);let l=Object.create(null),u=0;for(let e of n.allKeys)l[e]=`key_${u++}`;o.write(i?`const newResult = memo.alloc(inst, payload, {}, ctx);`:`const newResult = {};`);for(let e of n.allKeys){if(e===`__proto__`)continue;let n=l[e],r=typeof e==`symbol`?`syms[${a.indexOf(e)}]`:bn(e),i=`${r} in input`,u=t[e],d=u?._zod?.optin,f=d!==void 0,p=u?._zod?.optout===`optional`;if(o.write(`const ${n} = ${s(r)};`),f&&p){let e=d===`optional`?`${n}_present`:`${n}.value !== undefined || ${n}_present`;o.write(`
67
67
  const ${n}_present = ${i};
68
68
  if (!${n}.issues.length || ${n}_present) {
69
69
  if (${n}.issues.length) {${c(n,r)}
@@ -102,104 +102,104 @@ function B(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=
102
102
  newResult[${r}] = ${n}.value;
103
103
  }
104
104
 
105
- `)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=xn,c=!gr.jitless,l=c&&Sn.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?Fa([],p,i,f,d,e,f?.abortEarly===!0):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function Ra(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!Vn(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>qn(e,r,_r())))}),t)}const za=/*@__PURE__*/ B(`$ZodUnion`,(e,t)=>{V.init(e,t),z(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),z(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),z(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),z(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>un(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>Ra(t,r,e,i)):Ra(o,r,e,i)}}),Ba=/*@__PURE__*/ B(`$ZodIntersection`,(e,t)=>{V.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Ha(e,t,n)):Ha(e,i,a)}});function Va(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Cn(e)&&Cn(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=Va(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Va(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Ha(e,t,n){let r=/* @__PURE__ */ new Map,i,a=/* @__PURE__ */ new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=Va(t.value,n.value);if(!c.valid){if(Vn(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}const Ua=/*@__PURE__*/ B(`$ZodRecord`,(e,t)=>{V.init(e,t);let n=gr.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Cn(a))return r.issues.push({expected:`record`,code:`invalid_type`,input:a,inst:e}),r;let o=[],s=t.keyType._zod.values;if(s&&!t.partial){r.value=n?n.alloc(e,r,{},i):{};let c=/* @__PURE__ */ new Set;for(let n of s)if(typeof n==`string`||typeof n==`number`||typeof n==`symbol`){if(c.add(typeof n==`number`?n.toString():n),n===`__proto__`)continue;let s=t.keyType._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){r.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>qn(e,i,_r())),input:n,path:[n],inst:e});continue}let l=s.value;if(l===`__proto__`)continue;let u=t.valueType._zod.run({value:a[n],issues:[]},i);u instanceof Promise?o.push(u.then(e=>{e.issues.length&&r.issues.push(...Un(n,e.issues)),r.value[l]=e.value})):(u.issues.length&&r.issues.push(...Un(n,u.issues)),r.value[l]=u.value)}let l;for(let e in a)if(!c.has(e)){if(t.mode===`loose`){if(e===`__proto__`)continue;r.value[e]=a[e]}else l??=[],l.push(e)}l&&l.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:l,continue:!0})}else{r.value=n?n.alloc(e,r,{},i):{};let c;for(let n of Reflect.ownKeys(a)){if(n===`__proto__`||!Object.prototype.propertyIsEnumerable.call(a,n))continue;let l=t.keyType._zod.run({value:n,issues:[]},i);if(l instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof n==`string`&&bi.test(n)&&l.issues.length){let e=t.keyType._zod.run({value:Number(n),issues:[]},i);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(l=e)}if(l.issues.length){t.mode===`loose`?r.value[n]=a[n]:s?(c??=[],c.push(n)):r.issues.push({code:`invalid_key`,origin:`record`,issues:l.issues.map(e=>qn(e,i,_r())),input:n,path:[n],inst:e});continue}let u=l.value;if(u===`__proto__`)continue;let d=t.valueType._zod.run({value:a[n],issues:[]},i);d instanceof Promise?o.push(d.then(e=>{e.issues.length&&r.issues.push(...Un(n,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...Un(n,d.issues)),r.value[u]=d.value)}c&&c.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:c,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}}),Wa=/*@__PURE__*/ B(`$ZodEnum`,(e,t)=>{V.init(e,t);let n=rn(t.entries),r=new Set(n);e._zod.values=r,z(e,`pattern`,e=>{let t=rn(e.def.entries).filter(e=>Tn.has(typeof e));return RegExp(t.length?`^(${t.map(e=>En(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),Ga=/*@__PURE__*/ B(`$ZodTransform`,(e,t)=>{V.init(e,t),e._zod.optin=`optional`,gr.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new hr(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new mr;return n.value=i,n}});function Ka(e,t){return e.value=t.issues.length?void 0:t.value,e}const qa=/*@__PURE__*/ B(`$ZodOptional`,(e,t)=>{V.init(e,t),z(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,z(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?/* @__PURE__ */ new Set([...t,void 0]):void 0}),z(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${un(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>Ka(e,t)):Ka(e,r)}return t.innerType._zod.run(e,n)}}),Ja=/*@__PURE__*/ B(`$ZodExactOptional`,(e,t)=>{qa.init(e,t),z(e,`values`,e=>e.def.innerType._zod.values),z(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Ya=/*@__PURE__*/ B(`$ZodNullable`,(e,t)=>{V.init(e,t),z(e,`optin`,e=>e.def.innerType._zod.optin),z(e,`optout`,e=>e.def.innerType._zod.optout),z(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${un(t.source)}|null)$`):void 0}),z(e,`values`,e=>e.def.innerType._zod.values?/* @__PURE__ */ new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Xa=/*@__PURE__*/ B(`$ZodDefault`,(e,t)=>{V.init(e,t),e._zod.optin=`defaulted`,z(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Za(e,t)):Za(r,t)}});function Za(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Qa=/*@__PURE__*/ B(`$ZodPrefault`,(e,t)=>{V.init(e,t),e._zod.optin=`defaulted`,z(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),$a=/*@__PURE__*/ B(`$ZodNonOptional`,(e,t)=>{V.init(e,t),z(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>eo(t,e)):eo(i,e)}});function eo(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function to(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>qn(e,r,_r()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}const no=/*@__PURE__*/ B(`$ZodCatch`,(e,t)=>{V.init(e,t),z(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),z(e,`optout`,e=>e.def.innerType._zod.optout),z(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>to(e,r,t,n)):to(e,r,t,n)}}),ro=/*@__PURE__*/ B(`$ZodPipe`,(e,t)=>{V.init(e,t),z(e,`values`,e=>e.def.in._zod.values),z(e,`optin`,e=>e.def.in._zod.optin),z(e,`optout`,e=>e.def.out._zod.optout),z(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>io(e,t.in,n)):io(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>io(e,t.out,n)):io(r,t.out,n)}});function io(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const ao=/*@__PURE__*/ B(`$ZodReadonly`,(e,t)=>{V.init(e,t),z(e,`propValues`,e=>e.def.innerType._zod.propValues),z(e,`values`,e=>e.def.innerType._zod.values),z(e,`optin`,e=>e.def.innerType?._zod?.optin),z(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(oo):oo(r)}});function oo(e){return e.memo||(e.value=Object.freeze(e.value)),e}const so=/*@__PURE__*/ B(`$ZodCustom`,(e,t)=>{Ci.init(e,t),V.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>co(t,n,r,e));co(i,n,r,e)}});function co(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(Qn(e))}}var lo=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}};const uo=`~memo`,fo=[];function po(e){return typeof e==`object`&&!!e}function mo(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}const ho=/*@__PURE__*/ new WeakMap;function go(e,t,n){let r=ho.get(e);if(r!==void 0)return r?2:0;if(t.has(e))return 2;t.add(e);let i=0,a=e=>{if(i!==2&&e?._zod){let r=go(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=0;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?1:o.value?._zod?go(o.value,t,n):0;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=fn(c);s(e?o(e,!0):1),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?go(r,t,!1):1);break}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),_o(e,i)}function _o(e,t){return t!==1&&ho.set(e,t===2),t}function vo(e,t){let n=e.buckets.get(t);return n||(n=/* @__PURE__ */ new WeakMap,e.buckets.set(t,n)),n}let yo;const bo=[],xo={alloc(e,t,n){let r=yo;if(!r)return n;yo=void 0;let i={value:n,issues:null};return r.set(t.value,i),bo.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&Co(n,e.value))throw new lo;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=go(e,/* @__PURE__ */ new Set,!1);if(i===0)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===2||r?n=!0:r=!0}let l=s.value;if(!po(l))return t(s,c);let u=c[uo];u||(u={buckets:/* @__PURE__ */ new WeakMap,backEdges:void 0},c[uo]=u);let d;i===c?d=a:(d=vo(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...mo(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=/* @__PURE__ */ new WeakSet),u.backEdges.add(f.value)),s;yo=d;let p=bo.length,m=t(s,c);yo=void 0;let h=bo.length>p?bo.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?mo(e.issues):fo),e)):(h&&(h.issues=m.issues.length?mo(m.issues):fo),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function So(){return xo}function Co(e,t){let n=e[uo]?.backEdges;return n!==void 0&&po(t)&&n.has(t)}const wo=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={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`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,currency_code:`currency code`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(Zn(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${On(e.values[0])}`:`Invalid option: expected one of ${an(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${an(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function To(){return{localeError:wo()}}var Eo,Do=class{constructor(){this._map=/* @__PURE__ */ new WeakMap,this._idmap=/* @__PURE__ */ new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=/* @__PURE__ */ new WeakMap,this._idmap=/* @__PURE__ */ new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Oo(){return new Do}(Eo=globalThis).__zod_globalRegistry??(Eo.__zod_globalRegistry=Oo());const ko=globalThis.__zod_globalRegistry;function Ao(e){return e.checks&&=[...e.checks],e}// @__NO_SIDE_EFFECTS__
106
- function jo(e,t){return new e(Ao({type:`string`,...R(t)}))}// @__NO_SIDE_EFFECTS__
107
- function Mo(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...R(t)})}// @__NO_SIDE_EFFECTS__
108
- function No(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...R(t)})}// @__NO_SIDE_EFFECTS__
109
- function Po(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...R(t)})}// @__NO_SIDE_EFFECTS__
110
- function Fo(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...R(t)})}// @__NO_SIDE_EFFECTS__
111
- function Io(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...R(t)})}// @__NO_SIDE_EFFECTS__
112
- function Lo(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...R(t)})}// @__NO_SIDE_EFFECTS__
113
- function Ro(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...R(t)})}// @__NO_SIDE_EFFECTS__
114
- function zo(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...R(t)})}// @__NO_SIDE_EFFECTS__
115
- function Bo(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...R(t)})}// @__NO_SIDE_EFFECTS__
116
- function Vo(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...R(t)})}// @__NO_SIDE_EFFECTS__
117
- function Ho(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...R(t)})}// @__NO_SIDE_EFFECTS__
118
- function Uo(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...R(t)})}// @__NO_SIDE_EFFECTS__
119
- function Wo(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...R(t)})}// @__NO_SIDE_EFFECTS__
120
- function Go(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...R(t)})}// @__NO_SIDE_EFFECTS__
121
- function Ko(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...R(t)})}// @__NO_SIDE_EFFECTS__
122
- function qo(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...R(t)})}// @__NO_SIDE_EFFECTS__
123
- function Jo(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...R(t)})}// @__NO_SIDE_EFFECTS__
124
- function Yo(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...R(t)})}// @__NO_SIDE_EFFECTS__
125
- function Xo(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...R(t)})}// @__NO_SIDE_EFFECTS__
126
- function Zo(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...R(t)})}// @__NO_SIDE_EFFECTS__
127
- function Qo(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...R(t)})}// @__NO_SIDE_EFFECTS__
128
- function $o(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...R(t)})}// @__NO_SIDE_EFFECTS__
129
- function es(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...R(t)})}// @__NO_SIDE_EFFECTS__
130
- function ts(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...R(t)})}// @__NO_SIDE_EFFECTS__
131
- function ns(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...R(t)})}// @__NO_SIDE_EFFECTS__
132
- function rs(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...R(t)})}// @__NO_SIDE_EFFECTS__
133
- function is(e){return new e({type:`unknown`})}// @__NO_SIDE_EFFECTS__
134
- function as(e,t){return new e({type:`never`,...R(t)})}// @__NO_SIDE_EFFECTS__
135
- function os(e,t){return new Ti({check:`max_length`,...R(t),maximum:e})}// @__NO_SIDE_EFFECTS__
136
- function ss(e,t){return new Ei({check:`min_length`,...R(t),minimum:e})}// @__NO_SIDE_EFFECTS__
137
- function cs(e,t){return new Di({check:`length_equals`,...R(t),length:e})}// @__NO_SIDE_EFFECTS__
138
- function ls(e,t){return new ki({check:`string_format`,format:`regex`,...R(t),pattern:e})}// @__NO_SIDE_EFFECTS__
139
- function us(e){return new Ai({check:`string_format`,format:`lowercase`,...R(e)})}// @__NO_SIDE_EFFECTS__
140
- function ds(e){return new ji({check:`string_format`,format:`uppercase`,...R(e)})}// @__NO_SIDE_EFFECTS__
141
- function fs(e,t){return new Mi({check:`string_format`,format:`includes`,...R(t),includes:e})}// @__NO_SIDE_EFFECTS__
142
- function ps(e,t){return new Ni({check:`string_format`,format:`starts_with`,...R(t),prefix:e})}// @__NO_SIDE_EFFECTS__
143
- function ms(e,t){return new Pi({check:`string_format`,format:`ends_with`,...R(t),suffix:e})}// @__NO_SIDE_EFFECTS__
144
- function hs(e){return new Fi({check:`overwrite`,tx:e})}// @__NO_SIDE_EFFECTS__
145
- function gs(e){return/* @__PURE__ */ hs(t=>t.normalize(e))}// @__NO_SIDE_EFFECTS__
146
- function _s(){return/* @__PURE__ */ hs(e=>e.trim())}// @__NO_SIDE_EFFECTS__
147
- function vs(){return/* @__PURE__ */ hs(e=>e.toLowerCase())}// @__NO_SIDE_EFFECTS__
148
- function ys(){return/* @__PURE__ */ hs(e=>e.toUpperCase())}// @__NO_SIDE_EFFECTS__
149
- function bs(){return/* @__PURE__ */ hs(e=>yn(e))}// @__NO_SIDE_EFFECTS__
150
- function xs(e,t,n){return new e({type:`array`,element:t,...R(n)})}// @__NO_SIDE_EFFECTS__
151
- function Ss(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...R(n)})}// @__NO_SIDE_EFFECTS__
152
- function Cs(e,t){let n=/* @__PURE__ */ ws(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Qn(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(Qn(r))}},e(t.value,t)),t);return n}// @__NO_SIDE_EFFECTS__
153
- function ws(e,t){let n=new Ci({check:`custom`,...R(t)});return n._zod.check=e,n}function Ts(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&dn(e,t,n[t]);return e}function Es(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??ko,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:/* @__PURE__ */ new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function Ds(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function U(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,U(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Ts(o.schema,c),t.io===`input`&&W(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function Os(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function ks(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=/* @__PURE__ */ new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${Os(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+Os(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
105
+ `)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=Cn,c=!vr.jitless,l=c&&wn.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?La([],p,i,f,d,e,f?.abortEarly===!0):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function Ba(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!Un(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>Yn(e,r,yr())))}),t)}const Va=/*@__PURE__*/ B(`$ZodUnion`,(e,t)=>{V.init(e,t),z(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),z(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),z(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),z(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>fn(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>Ba(t,r,e,i)):Ba(o,r,e,i)}}),Ha=/*@__PURE__*/ B(`$ZodIntersection`,(e,t)=>{V.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Wa(e,t,n)):Wa(e,i,a)}});function Ua(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Tn(e)&&Tn(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=Ua(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Ua(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Wa(e,t,n){let r=/* @__PURE__ */ new Map,i,a=/* @__PURE__ */ new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=Ua(t.value,n.value);if(!c.valid){if(Un(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}const Ga=/*@__PURE__*/ B(`$ZodRecord`,(e,t)=>{V.init(e,t);let n=vr.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Tn(a))return r.issues.push({expected:`record`,code:`invalid_type`,input:a,inst:e}),r;let o=[],s=t.keyType._zod.values;if(s&&!t.partial){r.value=n?n.alloc(e,r,{},i):{};let c=/* @__PURE__ */ new Set;for(let n of s)if(typeof n==`string`||typeof n==`number`||typeof n==`symbol`){if(c.add(typeof n==`number`?n.toString():n),n===`__proto__`)continue;let s=t.keyType._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){r.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>Yn(e,i,yr())),input:n,path:[n],inst:e});continue}let l=s.value;if(l===`__proto__`)continue;let u=t.valueType._zod.run({value:a[n],issues:[]},i);u instanceof Promise?o.push(u.then(e=>{e.issues.length&&r.issues.push(...Gn(n,e.issues)),r.value[l]=e.value})):(u.issues.length&&r.issues.push(...Gn(n,u.issues)),r.value[l]=u.value)}let l;for(let e in a)if(!c.has(e)){if(t.mode===`loose`){if(e===`__proto__`)continue;r.value[e]=a[e]}else l??=[],l.push(e)}l&&l.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:l,continue:!0})}else{r.value=n?n.alloc(e,r,{},i):{};let c;for(let n of Reflect.ownKeys(a)){if(n===`__proto__`||!Object.prototype.propertyIsEnumerable.call(a,n))continue;let l=t.keyType._zod.run({value:n,issues:[]},i);if(l instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof n==`string`&&Si.test(n)&&l.issues.length){let e=t.keyType._zod.run({value:Number(n),issues:[]},i);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(l=e)}if(l.issues.length){t.mode===`loose`?r.value[n]=a[n]:s?(c??=[],c.push(n)):r.issues.push({code:`invalid_key`,origin:`record`,issues:l.issues.map(e=>Yn(e,i,yr())),input:n,path:[n],inst:e});continue}let u=l.value;if(u===`__proto__`)continue;let d=t.valueType._zod.run({value:a[n],issues:[]},i);d instanceof Promise?o.push(d.then(e=>{e.issues.length&&r.issues.push(...Gn(n,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...Gn(n,d.issues)),r.value[u]=d.value)}c&&c.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:c,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}}),Ka=/*@__PURE__*/ B(`$ZodEnum`,(e,t)=>{V.init(e,t);let n=on(t.entries),r=new Set(n);e._zod.values=r,z(e,`pattern`,e=>{let t=on(e.def.entries).filter(e=>Dn.has(typeof e));return RegExp(t.length?`^(${t.map(e=>On(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),qa=/*@__PURE__*/ B(`$ZodTransform`,(e,t)=>{V.init(e,t),e._zod.optin=`optional`,vr.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new _r(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new gr;return n.value=i,n}});function Ja(e,t){return e.value=t.issues.length?void 0:t.value,e}const Ya=/*@__PURE__*/ B(`$ZodOptional`,(e,t)=>{V.init(e,t),z(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,z(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?/* @__PURE__ */ new Set([...t,void 0]):void 0}),z(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${fn(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>Ja(e,t)):Ja(e,r)}return t.innerType._zod.run(e,n)}}),Xa=/*@__PURE__*/ B(`$ZodExactOptional`,(e,t)=>{Ya.init(e,t),z(e,`values`,e=>e.def.innerType._zod.values),z(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Za=/*@__PURE__*/ B(`$ZodNullable`,(e,t)=>{V.init(e,t),z(e,`optin`,e=>e.def.innerType._zod.optin),z(e,`optout`,e=>e.def.innerType._zod.optout),z(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${fn(t.source)}|null)$`):void 0}),z(e,`values`,e=>e.def.innerType._zod.values?/* @__PURE__ */ new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Qa=/*@__PURE__*/ B(`$ZodDefault`,(e,t)=>{V.init(e,t),e._zod.optin=`defaulted`,z(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>$a(e,t)):$a(r,t)}});function $a(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const eo=/*@__PURE__*/ B(`$ZodPrefault`,(e,t)=>{V.init(e,t),e._zod.optin=`defaulted`,z(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),to=/*@__PURE__*/ B(`$ZodNonOptional`,(e,t)=>{V.init(e,t),z(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>no(t,e)):no(i,e)}});function no(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function ro(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>Yn(e,r,yr()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}const io=/*@__PURE__*/ B(`$ZodCatch`,(e,t)=>{V.init(e,t),z(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),z(e,`optout`,e=>e.def.innerType._zod.optout),z(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>ro(e,r,t,n)):ro(e,r,t,n)}}),ao=/*@__PURE__*/ B(`$ZodPipe`,(e,t)=>{V.init(e,t),z(e,`values`,e=>e.def.in._zod.values),z(e,`optin`,e=>e.def.in._zod.optin),z(e,`optout`,e=>e.def.out._zod.optout),z(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>oo(e,t.in,n)):oo(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>oo(e,t.out,n)):oo(r,t.out,n)}});function oo(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const so=/*@__PURE__*/ B(`$ZodReadonly`,(e,t)=>{V.init(e,t),z(e,`propValues`,e=>e.def.innerType._zod.propValues),z(e,`values`,e=>e.def.innerType._zod.values),z(e,`optin`,e=>e.def.innerType?._zod?.optin),z(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(co):co(r)}});function co(e){return e.memo||(e.value=Object.freeze(e.value)),e}const lo=/*@__PURE__*/ B(`$ZodCustom`,(e,t)=>{Ti.init(e,t),V.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>uo(t,n,r,e));uo(i,n,r,e)}});function uo(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(er(e))}}var fo=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}};const po=`~memo`,mo=[];function ho(e){return typeof e==`object`&&!!e}function go(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}const _o=/*@__PURE__*/ new WeakMap;function vo(e,t,n){let r=_o.get(e);if(r!==void 0)return r?2:0;if(t.has(e))return 2;t.add(e);let i=0,a=e=>{if(i!==2&&e?._zod){let r=vo(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=0;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?1:o.value?._zod?vo(o.value,t,n):0;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=mn(c);s(e?o(e,!0):1),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?vo(r,t,!1):1);break}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),yo(e,i)}function yo(e,t){return t!==1&&_o.set(e,t===2),t}function bo(e,t){let n=e.buckets.get(t);return n||(n=/* @__PURE__ */ new WeakMap,e.buckets.set(t,n)),n}let xo;const So=[],Co={alloc(e,t,n){let r=xo;if(!r)return n;xo=void 0;let i={value:n,issues:null};return r.set(t.value,i),So.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&To(n,e.value))throw new fo;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=vo(e,/* @__PURE__ */ new Set,!1);if(i===0)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===2||r?n=!0:r=!0}let l=s.value;if(!ho(l))return t(s,c);let u=c[po];u||(u={buckets:/* @__PURE__ */ new WeakMap,backEdges:void 0},c[po]=u);let d;i===c?d=a:(d=bo(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...go(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=/* @__PURE__ */ new WeakSet),u.backEdges.add(f.value)),s;xo=d;let p=So.length,m=t(s,c);xo=void 0;let h=So.length>p?So.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?go(e.issues):mo),e)):(h&&(h.issues=m.issues.length?go(m.issues):mo),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function wo(){return Co}function To(e,t){let n=e[po]?.backEdges;return n!==void 0&&ho(t)&&n.has(t)}const Eo=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={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`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,currency_code:`currency code`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i($n(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${An(e.values[0])}`:`Invalid option: expected one of ${sn(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${sn(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function Do(){return{localeError:Eo()}}var Oo,ko=class{constructor(){this._map=/* @__PURE__ */ new WeakMap,this._idmap=/* @__PURE__ */ new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=/* @__PURE__ */ new WeakMap,this._idmap=/* @__PURE__ */ new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Ao(){return new ko}(Oo=globalThis).__zod_globalRegistry??(Oo.__zod_globalRegistry=Ao());const jo=globalThis.__zod_globalRegistry;function Mo(e){return e.checks&&=[...e.checks],e}// @__NO_SIDE_EFFECTS__
106
+ function No(e,t){return new e(Mo({type:`string`,...R(t)}))}// @__NO_SIDE_EFFECTS__
107
+ function Po(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...R(t)})}// @__NO_SIDE_EFFECTS__
108
+ function Fo(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...R(t)})}// @__NO_SIDE_EFFECTS__
109
+ function Io(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...R(t)})}// @__NO_SIDE_EFFECTS__
110
+ function Lo(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...R(t)})}// @__NO_SIDE_EFFECTS__
111
+ function Ro(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...R(t)})}// @__NO_SIDE_EFFECTS__
112
+ function zo(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...R(t)})}// @__NO_SIDE_EFFECTS__
113
+ function Bo(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...R(t)})}// @__NO_SIDE_EFFECTS__
114
+ function Vo(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...R(t)})}// @__NO_SIDE_EFFECTS__
115
+ function Ho(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...R(t)})}// @__NO_SIDE_EFFECTS__
116
+ function Uo(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...R(t)})}// @__NO_SIDE_EFFECTS__
117
+ function Wo(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...R(t)})}// @__NO_SIDE_EFFECTS__
118
+ function Go(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...R(t)})}// @__NO_SIDE_EFFECTS__
119
+ function Ko(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...R(t)})}// @__NO_SIDE_EFFECTS__
120
+ function qo(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...R(t)})}// @__NO_SIDE_EFFECTS__
121
+ function Jo(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...R(t)})}// @__NO_SIDE_EFFECTS__
122
+ function Yo(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...R(t)})}// @__NO_SIDE_EFFECTS__
123
+ function Xo(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...R(t)})}// @__NO_SIDE_EFFECTS__
124
+ function Zo(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...R(t)})}// @__NO_SIDE_EFFECTS__
125
+ function Qo(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...R(t)})}// @__NO_SIDE_EFFECTS__
126
+ function $o(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...R(t)})}// @__NO_SIDE_EFFECTS__
127
+ function es(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...R(t)})}// @__NO_SIDE_EFFECTS__
128
+ function ts(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...R(t)})}// @__NO_SIDE_EFFECTS__
129
+ function ns(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...R(t)})}// @__NO_SIDE_EFFECTS__
130
+ function rs(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...R(t)})}// @__NO_SIDE_EFFECTS__
131
+ function is(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...R(t)})}// @__NO_SIDE_EFFECTS__
132
+ function as(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...R(t)})}// @__NO_SIDE_EFFECTS__
133
+ function os(e){return new e({type:`unknown`})}// @__NO_SIDE_EFFECTS__
134
+ function ss(e,t){return new e({type:`never`,...R(t)})}// @__NO_SIDE_EFFECTS__
135
+ function cs(e,t){return new Di({check:`max_length`,...R(t),maximum:e})}// @__NO_SIDE_EFFECTS__
136
+ function ls(e,t){return new Oi({check:`min_length`,...R(t),minimum:e})}// @__NO_SIDE_EFFECTS__
137
+ function us(e,t){return new ki({check:`length_equals`,...R(t),length:e})}// @__NO_SIDE_EFFECTS__
138
+ function ds(e,t){return new ji({check:`string_format`,format:`regex`,...R(t),pattern:e})}// @__NO_SIDE_EFFECTS__
139
+ function fs(e){return new Mi({check:`string_format`,format:`lowercase`,...R(e)})}// @__NO_SIDE_EFFECTS__
140
+ function ps(e){return new Ni({check:`string_format`,format:`uppercase`,...R(e)})}// @__NO_SIDE_EFFECTS__
141
+ function ms(e,t){return new Pi({check:`string_format`,format:`includes`,...R(t),includes:e})}// @__NO_SIDE_EFFECTS__
142
+ function hs(e,t){return new Fi({check:`string_format`,format:`starts_with`,...R(t),prefix:e})}// @__NO_SIDE_EFFECTS__
143
+ function gs(e,t){return new Ii({check:`string_format`,format:`ends_with`,...R(t),suffix:e})}// @__NO_SIDE_EFFECTS__
144
+ function _s(e){return new Li({check:`overwrite`,tx:e})}// @__NO_SIDE_EFFECTS__
145
+ function vs(e){return/* @__PURE__ */ _s(t=>t.normalize(e))}// @__NO_SIDE_EFFECTS__
146
+ function ys(){return/* @__PURE__ */ _s(e=>e.trim())}// @__NO_SIDE_EFFECTS__
147
+ function bs(){return/* @__PURE__ */ _s(e=>e.toLowerCase())}// @__NO_SIDE_EFFECTS__
148
+ function xs(){return/* @__PURE__ */ _s(e=>e.toUpperCase())}// @__NO_SIDE_EFFECTS__
149
+ function Ss(){return/* @__PURE__ */ _s(e=>xn(e))}// @__NO_SIDE_EFFECTS__
150
+ function Cs(e,t,n){return new e({type:`array`,element:t,...R(n)})}// @__NO_SIDE_EFFECTS__
151
+ function ws(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...R(n)})}// @__NO_SIDE_EFFECTS__
152
+ function Ts(e,t){let n=/* @__PURE__ */ Es(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(er(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(er(r))}},e(t.value,t)),t);return n}// @__NO_SIDE_EFFECTS__
153
+ function Es(e,t){let n=new Ti({check:`custom`,...R(t)});return n._zod.check=e,n}function Ds(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&pn(e,t,n[t]);return e}function Os(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??jo,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:/* @__PURE__ */ new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function ks(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function U(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,U(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Ds(o.schema,c),t.io===`input`&&W(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function As(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function js(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=/* @__PURE__ */ new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${As(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+As(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
154
154
 
155
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0])a(n);else{if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&e.reused===`ref`)&&a(n)}}e.external&&(e.sharedDefsExtractedFor=e.external)}function As(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;As(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}const js=/* @__PURE__ */ new Set([`type`,`properties`,`required`,`additionalProperties`]),Ms=[`oneOf`,`anyOf`];function Ns(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function Ps(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!js.has(e))return null;t.push(n)}let n={},r=/* @__PURE__ */ new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??Ns(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}dn(n,r,e.length===1?e[0]:Ps(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=Ns(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function Fs(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of js)if(t in e)return;let n=t.filter(e=>Ms.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=Ps(t);else{let e=n[0],i=Ms.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>Ps([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,Ts(e,r))}function Is(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Ts(i,s),Ts(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())As(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=/* @__PURE__ */ new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])Fs(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Ts(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,dn(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:Rs(t,`input`,e.processors),output:Rs(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function W(e,t){let n=t??{seen:/* @__PURE__ */ new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return W(r.element,n);if(r.type===`set`)return W(r.valueType,n);if(r.type===`lazy`)return W(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return W(r.innerType,n);if(r.type===`intersection`)return W(r.left,n)||W(r.right,n);if(r.type===`record`||r.type===`map`)return W(r.keyType,n)||W(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:W(r.in,n)||W(r.out,n);if(r.type===`object`){for(let e in r.shape)if(W(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(W(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(W(e,n))return!0;return!!(r.rest&&W(r.rest,n))}return!1}const Ls=(e,t={})=>n=>{let r=Es({...n,processors:t});return U(e,r),ks(r,e),Is(r,e)},Rs=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Es({...i??{},target:a,io:t,processors:n});return U(e,o),ks(o,e),Is(o,e)},zs=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},Bs=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},Vs=(e,t)=>{zs(e,`minimum`,t),Bs(e,`maximum`,t)},Hs=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},Us=(e,t)=>{e.patterns??=/* @__PURE__ */ new Set,e.patterns.add(t)},Ws=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},Gs=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},Ks=(e,t)=>zs(e,`minimum`,t.minimum),qs=(e,t)=>Bs(e,`maximum`,t.maximum),Js=e=>(t,n)=>{Gs(t,n.format);let[r,i]=e[n.format];zs(t,`minimum`,r),Bs(t,`maximum`,i)},Ys={greater_than:(e,t)=>zs(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>Bs(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>Hs(e,t.value),number_format:Js(An),bigint_format:Js(jn),min_length:Ks,max_length:qs,length_equals:(e,t)=>Vs(e,t.length),min_size:Ks,max_size:qs,size_equals:(e,t)=>Vs(e,t.size),string_format:(e,t)=>{Gs(e,t.format),t.pattern&&Us(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>Ws(e,t.mime)};function Xs(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)Ys[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&zs(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&zs(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&Bs(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&Bs(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&Hs(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&Ws(t,i.mime);for(let e of i.patterns??[])Us(t,e);return t}const Zs={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Qs=/* @__PURE__ */ new Map([[va,ci],[ba,li]]),$s=e=>Qs.get(e)??e,ec=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=Xs(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Zs[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map($s);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},tc=(e,t,n,r)=>{n.not={}},nc=(e,t,n,r)=>{let i=e._zod.def,a=rn(i.entries);a.length===0?n.not={}:(a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a)},rc=(e,t,n,r)=>{Ds(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},ic=(e,t,n,r)=>{Ds(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},ac=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=Xs(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=U(a.element,t,{...r,path:[...r.path,`items`]})};function oc(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?oc(t.out):t.type===`catch`?oc(t.innerType):e._zod.optin}const sc=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&Ds(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)dn(i.properties,e,U(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?oc(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=U(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},cc=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>U(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},lc=(e,t,n,r)=>{let i=e._zod.def,a=U(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=U(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)};function uc(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let r=e.get(t)?.def;if(!r)return t;let i=uc(e,r,n);return i===r?t:i}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>uc(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes(`string`)&&r.some(e=>e===`number`||e===`integer`),a=t.enum??(t.const===void 0?void 0:[t.const]);if(!i&&!a?.some(e=>typeof e==`number`))return t;let{minimum:o,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(e=>typeof e==`number`?String(e):e):typeof p.const==`number`&&(p.const=String(p.const)),i&&(p.type=`string`,a||(p.pattern=(r.includes(`number`)?bi:yi).source)),p}const dc=/* @__PURE__ */ new WeakMap;function fc(e){let t=/* @__PURE__ */ new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=/* @__PURE__ */ new Map;for(let r of dc.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=uc(t,a,/* @__PURE__ */ new Set);o!==a&&n.set(a,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}const pc=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=Xs(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=U(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)dn(i.patternProperties,$s(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=U(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=dc.get(t);n||(n=[],dc.set(t,n),t.deferred.push(()=>fc(t))),n.push(e)}i.additionalProperties=U(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&oc(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e.map(String))}},mc=(e,t,n,r)=>{let i=e._zod.def,a=U(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},hc=(e,t,n,r)=>{let i=e._zod.def;U(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},gc=Symbol();function _c(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(Ds(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),gc):JSON.parse(o)}const vc=(e,t,n,r)=>{let i=e._zod.def;U(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=_c(i.defaultValue,e,t,n,r);o!==gc&&(n.default=o)},yc=(e,t,n,r)=>{let i=e._zod.def;U(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=_c(i.defaultValue,e,t,n,r);o!==gc&&(n._prefault=o)},bc=(e,t,n,r)=>{let i=e._zod.def;U(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{Ds(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},xc=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;U(o,t,r);let s=t.seen.get(e);s.ref=o},Sc=(e,t,n,r)=>{let i=e._zod.def;U(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Cc=(e,t,n,r)=>{let i=e._zod.def;U(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},wc=/* @__PURE__ */ new WeakSet([Object.prototype,Error.prototype]);function Tc(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}const Ec=/*@__PURE__*/ B(`ZodError`,(e,t)=>{Cr.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);wc.has(n)||(wc.add(n),Tc(n,`format`,e=>t=>Er(e,t)),Tc(n,`flatten`,e=>t=>Tr(e,t)),Tc(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,on,2)}),Tc(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,on,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),Dc=/* @__PURE__ */ Or(Ec),Oc=/* @__PURE__ */ kr(Ec),kc=/* @__PURE__ */ Ar(Ec),Ac=/* @__PURE__ */ Mr(Ec),jc=/* @__PURE__ */ Rr(Ec),Mc=/* @__PURE__ */ zr(Ec),Nc=/* @__PURE__ */ Br(Ec),Pc=/* @__PURE__ */ Vr(Ec),Fc=/* @__PURE__ */ Hr(Ec),Ic=/* @__PURE__ */ Ur(Ec),Lc=/* @__PURE__ */ Wr(Ec),Rc=/* @__PURE__ */ Gr(Ec);function zc(){gr.localeError||_r(To())}function Bc(){gr.memoizer||_r({memoizer:So()})}const G=/*@__PURE__*/ B(`ZodType`,(e,t)=>(zc(),V.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(L(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return Dn(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Xl(e,t))},superRefine(e,t){return this.check(Zl(e,t))},overwrite(e){return this.check(/* @__PURE__ */ hs(e))},optional(){return Ml(this)},exactOptional(){return Pl(this)},nullable(){return Il(this)},nullish(){return Ml(Il(this))},nonoptional(e){return Hl(this,e)},array(){return _l(this)},or(e){return Sl([this,e])},and(e){return wl(this,e)},transform(e){return Kl(this,Al(e))},default(e){return Rl(this,e)},prefault(e){return Bl(this,e)},catch(e){return Wl(this,e)},pipe(e){return Kl(this,e)},readonly(){return Jl(this)},describe(e){let t=this.clone();return ko.add(t,{description:e}),t},meta(...e){if(e.length===0)return ko.get(this);let t=this.clone();return ko.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return tr(this,`~standard`,{...Bi(this),jsonSchema:{input:Rs(this,`input`),output:Rs(this,`output`)}})},set"~standard"(e){er(this,`~standard`,e)},parse:function e(t,n){return Dc(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await Oc(this,t,n,{callee:e})},safeParse(e,t){return kc(this,e,t)},async safeParseAsync(e,t){return Ac(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){er(this,`spa`,e)},validate(e,t){return Fr(this,e,t)},validateAsync(e,t){return Lr(this,e,t)},encode:function e(t,n){return jc(this,t,n,{callee:e})},decode:function e(t,n){return Mc(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await Nc(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await Pc(this,t,n,{callee:e})},safeEncode(e,t){return Fc(this,e,t)},safeDecode(e,t){return Ic(this,e,t)},async safeEncodeAsync(e,t){return Lc(this,e,t)},async safeDecodeAsync(e,t){return Rc(this,e,t)},toJSONSchema(e){return Ls(this,{})(e)},get description(){return ko.get(this)?.description},get _def(){return this._zod.def}}),Vc=/*@__PURE__*/ B(`_ZodString`,(e,t)=>{Vi.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ec(e,t,n,r)},/*@__PURE__*/ nr({format:e=>Xs(e).format??null,minLength:e=>Xs(e).minimum??null,maxLength:e=>Xs(e).maximum??null},{regex(...e){return this.check(/* @__PURE__ */ ls(...e))},includes(...e){return this.check(/* @__PURE__ */ fs(...e))},startsWith(...e){return this.check(/* @__PURE__ */ ps(...e))},endsWith(...e){return this.check(/* @__PURE__ */ ms(...e))},min(...e){return this.check(/* @__PURE__ */ ss(...e))},max(...e){return this.check(/* @__PURE__ */ os(...e))},length(...e){return this.check(/* @__PURE__ */ cs(...e))},nonempty(...e){return this.check(/* @__PURE__ */ ss(1,...e))},lowercase(e){return this.check(/* @__PURE__ */ us(e))},uppercase(e){return this.check(/* @__PURE__ */ ds(e))},trim(){return this.check(/* @__PURE__ */ _s())},normalize(...e){return this.check(/* @__PURE__ */ gs(...e))},toLowerCase(){return this.check(/* @__PURE__ */ vs())},toUpperCase(){return this.check(/* @__PURE__ */ ys())},slugify(){return this.check(/* @__PURE__ */ bs())}})),Hc=/*@__PURE__*/ B(`ZodString`,(e,t)=>{Vi.init(e,t),Vc.init(e,t)},{email(e){return this.check(/* @__PURE__ */ Mo(qc,e))},url(e){return this.check(/* @__PURE__ */ Ro(Xc,e))},jwt(e){return this.check(/* @__PURE__ */ $o(dl,e))},emoji(e){return this.check(/* @__PURE__ */ zo(Zc,e))},guid(e){return this.check(/* @__PURE__ */ No(Jc,e))},uuid(e){return this.check(/* @__PURE__ */ Po(Yc,e))},uuidv4(e){return this.check(/* @__PURE__ */ Fo(Yc,e))},uuidv6(e){return this.check(/* @__PURE__ */ Io(Yc,e))},uuidv7(e){return this.check(/* @__PURE__ */ Lo(Yc,e))},nanoid(e){return this.check(/* @__PURE__ */ Bo(Qc,e))},cuid(e){return this.check(/* @__PURE__ */ Vo($c,e))},cuid2(e){return this.check(/* @__PURE__ */ Ho(el,e))},ulid(e){return this.check(/* @__PURE__ */ Uo(tl,e))},base64(e){return this.check(/* @__PURE__ */ Xo(cl,e))},base64url(e){return this.check(/* @__PURE__ */ Zo(ll,e))},xid(e){return this.check(/* @__PURE__ */ Wo(nl,e))},ksuid(e){return this.check(/* @__PURE__ */ Go(rl,e))},ipv4(e){return this.check(/* @__PURE__ */ Ko(il,e))},ipv6(e){return this.check(/* @__PURE__ */ qo(al,e))},cidrv4(e){return this.check(/* @__PURE__ */ Jo(ol,e))},cidrv6(e){return this.check(/* @__PURE__ */ Yo(sl,e))},e164(e){return this.check(/* @__PURE__ */ Qo(ul,e))},datetime(e){return this.check(/* @__PURE__ */ es(Uc,e))},date(e){return this.check(/* @__PURE__ */ ts(Wc,e))},time(e){return this.check(/* @__PURE__ */ ns(Gc,e))},duration(e){return this.check(/* @__PURE__ */ rs(Kc,e))}});function K(e){return/* @__PURE__ */ jo(Hc,e)}const q=/*@__PURE__*/ B(`ZodStringFormat`,(e,t)=>{H.init(e,t),Vc.init(e,t)}),Uc=/*@__PURE__*/ B(`ZodISODateTime`,(e,t)=>{oa.init(e,t),q.init(e,t)}),Wc=/*@__PURE__*/ B(`ZodISODate`,(e,t)=>{sa.init(e,t),q.init(e,t)}),Gc=/*@__PURE__*/ B(`ZodISOTime`,(e,t)=>{ca.init(e,t),q.init(e,t)}),Kc=/*@__PURE__*/ B(`ZodISODuration`,(e,t)=>{la.init(e,t),q.init(e,t)}),qc=/*@__PURE__*/ B(`ZodEmail`,(e,t)=>{Wi.init(e,t),q.init(e,t)}),Jc=/*@__PURE__*/ B(`ZodGUID`,(e,t)=>{Hi.init(e,t),q.init(e,t)}),Yc=/*@__PURE__*/ B(`ZodUUID`,(e,t)=>{Ui.init(e,t),q.init(e,t)}),Xc=/*@__PURE__*/ B(`ZodURL`,(e,t)=>{Qi.init(e,t),q.init(e,t)}),Zc=/*@__PURE__*/ B(`ZodEmoji`,(e,t)=>{$i.init(e,t),q.init(e,t)}),Qc=/*@__PURE__*/ B(`ZodNanoID`,(e,t)=>{ea.init(e,t),q.init(e,t)}),$c=/*@__PURE__*/ B(`ZodCUID`,(e,t)=>{ta.init(e,t),q.init(e,t)}),el=/*@__PURE__*/ B(`ZodCUID2`,(e,t)=>{na.init(e,t),q.init(e,t)}),tl=/*@__PURE__*/ B(`ZodULID`,(e,t)=>{ra.init(e,t),q.init(e,t)}),nl=/*@__PURE__*/ B(`ZodXID`,(e,t)=>{ia.init(e,t),q.init(e,t)}),rl=/*@__PURE__*/ B(`ZodKSUID`,(e,t)=>{aa.init(e,t),q.init(e,t)}),il=/*@__PURE__*/ B(`ZodIPv4`,(e,t)=>{ua.init(e,t),q.init(e,t)}),al=/*@__PURE__*/ B(`ZodIPv6`,(e,t)=>{pa.init(e,t),q.init(e,t)}),ol=/*@__PURE__*/ B(`ZodCIDRv4`,(e,t)=>{ma.init(e,t),q.init(e,t)}),sl=/*@__PURE__*/ B(`ZodCIDRv6`,(e,t)=>{ga.init(e,t),q.init(e,t)}),cl=/*@__PURE__*/ B(`ZodBase64`,(e,t)=>{ya.init(e,t),q.init(e,t)}),ll=/*@__PURE__*/ B(`ZodBase64URL`,(e,t)=>{Sa.init(e,t),q.init(e,t)}),ul=/*@__PURE__*/ B(`ZodE164`,(e,t)=>{Ca.init(e,t),q.init(e,t)}),dl=/*@__PURE__*/ B(`ZodJWT`,(e,t)=>{Ta.init(e,t),q.init(e,t)}),fl=/*@__PURE__*/ B(`ZodUnknown`,(e,t)=>{Ea.init(e,t),G.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function pl(){return/* @__PURE__ */ is(fl)}const ml=/*@__PURE__*/ B(`ZodNever`,(e,t)=>{Da.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>tc(e,t,n,r)});function hl(e){return/* @__PURE__ */ as(ml,e)}const gl=/*@__PURE__*/ B(`ZodArray`,(e,t)=>{Bc(),ja.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ac(e,t,n,r),e.element=t.element},{min(e,t){return this.check(/* @__PURE__ */ ss(e,t))},nonempty(e){return this.check(/* @__PURE__ */ ss(1,e))},max(e,t){return this.check(/* @__PURE__ */ os(e,t))},length(e,t){return this.check(/* @__PURE__ */ cs(e,t))},unwrap(){return this.element}});function _l(e,t){return/* @__PURE__ */ xs(gl,e,t)}const vl=/*@__PURE__*/ B(`ZodObject`,(e,t)=>{Bc(),La.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>sc(e,t,n,r),cr(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return Ol(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(L(this._zod.def,{catchall:e}))},passthrough(){return this.clone(L(this._zod.def,{catchall:pl()}))},loose(){return this.clone(L(this._zod.def,{catchall:pl()}))},strict(){return this.clone(L(this._zod.def,{catchall:hl()}))},strip(){return this.clone(L(this._zod.def,{catchall:void 0}))},extend(e){return Fn(this,e)},safeExtend(e){return Ln(this,e)},merge(e){return Rn(this,e)},pick(e){return Mn(this,e)},omit(e){return Pn(this,e)},partial(...e){return zn(jl,this,e[0])},exactPartial(...e){return zn(Nl,this,e[0],`exactPartial`)},required(...e){return Bn(Vl,this,e[0])}});function yl(e,t){let n={type:`object`,shape:e??{},...R(t)};return new vl(n)}function bl(e,t){return new vl({type:`object`,shape:e,catchall:pl(),...R(t)})}const xl=/*@__PURE__*/ B(`ZodUnion`,(e,t)=>{za.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>cc(e,t,n,r),e.options=t.options});function Sl(e,t){return new xl({type:`union`,options:e,...R(t)})}const Cl=/*@__PURE__*/ B(`ZodIntersection`,(e,t)=>{Ba.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lc(e,t,n,r)});function wl(e,t){return new Cl({type:`intersection`,left:e,right:t})}const Tl=/*@__PURE__*/ B(`ZodRecord`,(e,t)=>{Bc(),Ua.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pc(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function El(e,t,n){return!t||!t._zod?new Tl({type:`record`,keyType:K(),valueType:e,...R(t)}):new Tl({type:`record`,keyType:e,valueType:t,...R(n)})}const Dl=/*@__PURE__*/ B(`ZodEnum`,(e,t)=>{Wa.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>nc(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Dl({...t,checks:[],...R(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Dl({...t,checks:[],...R(r),entries:i})}});function Ol(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new Dl({type:`enum`,entries:n,...R(t)})}const kl=/*@__PURE__*/ B(`ZodTransform`,(e,t)=>{Bc(),Ga.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ic(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new hr(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Qn(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(Qn(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Al(e){return new kl({type:`transform`,transform:e})}const jl=/*@__PURE__*/ B(`ZodOptional`,(e,t)=>{qa.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Cc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ml(e){return new jl({type:`optional`,innerType:e})}const Nl=/*@__PURE__*/ B(`ZodExactOptional`,(e,t)=>{Ja.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Cc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Pl(e){return new Nl({type:`optional`,innerType:e})}const Fl=/*@__PURE__*/ B(`ZodNullable`,(e,t)=>{Ya.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Il(e){return new Fl({type:`nullable`,innerType:e})}const Ll=/*@__PURE__*/ B(`ZodDefault`,(e,t)=>{Xa.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Rl(e,t){return new Ll({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():wn(t)}})}const zl=/*@__PURE__*/ B(`ZodPrefault`,(e,t)=>{Qa.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Bl(e,t){return new zl({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():wn(t)}})}const Vl=/*@__PURE__*/ B(`ZodNonOptional`,(e,t)=>{$a.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Hl(e,t){return new Vl({type:`nonoptional`,innerType:e,...R(t)})}const Ul=/*@__PURE__*/ B(`ZodCatch`,(e,t)=>{no.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Wl(e,t){return new Ul({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:lr(t)})}const Gl=/*@__PURE__*/ B(`ZodPipe`,(e,t)=>{ro.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xc(e,t,n,r),e.in=t.in,e.out=t.out});function Kl(e,t){return new Gl({type:`pipe`,in:e,out:t})}const ql=/*@__PURE__*/ B(`ZodReadonly`,(e,t)=>{ao.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Sc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Jl(e){return new ql({type:`readonly`,innerType:e})}const Yl=/*@__PURE__*/ B(`ZodCustom`,(e,t)=>{so.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>rc(e,t,n,r)});function Xl(e,t={}){return/* @__PURE__ */ Ss(Yl,e,t)}function Zl(e,t){return/* @__PURE__ */ Cs(e,t)}let Ql;function $l(){return Ql??=zt(`@longzai-intelligence-cli/core/provider`),Ql}const eu={red:e=>e,green:e=>e,yellow:e=>e,blue:e=>e,cyan:e=>e,magenta:e=>e,gray:e=>e,bold:e=>e,dim:e=>e};let tu={select:async(e,t)=>t[0]?.value??``,textInput:async(e,t)=>t?.defaultValue??``,confirm:async(e,t)=>t?.defaultValue??!1,spinner:()=>({start:e=>$l().info(e),stop:e=>$l().info(e)}),note:(e,t)=>{t?$l().info(`${t}: ${e}`):$l().info(e)},log:{info:e=>$l().info(e),success:e=>$l().info(e),warn:e=>$l().warn(e),error:e=>$l().error(e),step:e=>$l().info(e)}},nu=eu;function ru(e){tu=e}function iu(e){nu=e}function au(){return tu}function ou(){return nu}const su=()=>`0.2.4`;function cu(e){let t=e.version??su();e.interaction&&ru(e.interaction),e.color&&iu(e.color);let n=new $t;return n.name(e.name).version(t,`-v, --version`,`输出 ${e.name} 的版本号`),e.description&&n.description(e.description),n}let lu;function uu(){return lu??=zt(`@longzai-intelligence-cli/core/output`),lu}var du=class{format;constructor(e=`text`){this.format=e}get colors(){return ou()}success(e,t){this.format===`json`?uu().info(JSON.stringify({success:!0,data:e},null,2)):uu().info(t?this.colors.green(t):this.colors.green(this.formatData(e)))}error(e){if(this.format===`json`){let t=e instanceof Error?{message:e.message,name:e.name}:{message:String(e)};uu().info(JSON.stringify({success:!1,error:t},null,2))}else{let t=e instanceof Error?e.message:String(e);uu().error(this.colors.red(`错误: ${t}`))}}info(e){this.format===`json`?uu().info(JSON.stringify({success:!0,message:e},null,2)):uu().info(this.colors.blue(e))}warn(e){this.format===`json`?uu().info(JSON.stringify({success:!0,warning:e},null,2)):uu().info(this.colors.yellow(e))}table(e,t){if(this.format===`json`){let n=t.map(t=>{let n={};return e.forEach((e,r)=>{n[e]=t[r]??``}),n});uu().info(JSON.stringify({success:!0,data:n},null,2))}else{let n=e.map((e,n)=>Math.min(60,Math.max(e.length,...t.map(e=>(e[n]??``).length))));uu().info(e.map((e,t)=>this.colors.bold(e.padEnd(n[t]??0))).join(` `)),uu().info(n.map(e=>`─`.repeat(e??0)).join(` `));for(let e of t)uu().info(e.map((e,t)=>{let r=n[t]??0,i=e??``;return i.length>r?i.slice(0,Math.max(0,r-1))+`…`:i.padEnd(r)}).join(` `))}}formatData(e){return typeof e==`string`?e:typeof e==`number`||typeof e==`boolean`?String(e):JSON.stringify(e,null,2)}};function fu(e){return e===`json`?`json`:`text`}async function pu(e,t){return au().select(e,t)}async function mu(e,t){return au().textInput(e,t)}async function hu(e,t){return au().confirm(e,t)}const gu={info(e){au().log.info(e)},success(e){au().log.success(e)},warn(e){au().log.warn(e)},error(e){au().log.error(e)},step(e){au().log.step(e)}};let _u;function vu(){return _u??=zt(`@longzai-intelligence-cli/core/define-command`),_u}function yu(e,t){let n=e.commands.find(e=>e.name()===t);return n===void 0?e.command(t):n}function bu(e,t){if(t.length===1){let n=t[0];if(n===void 0)throw Error(`defineCommand: segments 为空,无法解析命令名`);return e.command(n)}let[n,...r]=t;if(n===void 0)throw Error(`defineCommand: segments 首段为空,无法解析父命令名`);let i=r.pop();if(i===void 0)throw Error(`defineCommand: segments 末段为空,无法解析子命令名`);let a=yu(e,n);for(let e of r)a=yu(a,e);return a.command(i)}function xu(e,t){let n=bu(e,t.name.split(` `).filter(e=>e.length>0));t.description&&n.description(t.description);for(let e of t.arguments??[])e.description?n.argument(e.signature,e.description):n.argument(e.signature);for(let e of t.options??[])e.defaultValue===void 0?n.option(e.flags,e.description??``):n.option(e.flags,e.description??``,e.defaultValue);n.action(async(...e)=>{let n=e[e.length-1];if(!(n instanceof $t))return;let r=n.opts(),i=n.args,a=t.schema.safeParse(r);if(!a.success){let e=a.error.issues.map(e=>e.message).join(`, `);vu().error(ou().red(`参数校验失败: ${e}`)),au().log.error(`参数校验失败: ${e}`),process.exit(1)}await t.action(a.data,i)})}var Su=/* @__PURE__ */ S(((e,t)=>{let n={to(e,t){return t?`[${t+1};${e+1}H`:`[${e+1}G`},move(e,t){let n=``;return e<0?n+=`[${-e}D`:e>0&&(n+=`[${e}C`),t<0?n+=`[${-t}A`:t>0&&(n+=`[${t}B`),n},up:(e=1)=>`[${e}A`,down:(e=1)=>`[${e}B`,forward:(e=1)=>`[${e}C`,backward:(e=1)=>`[${e}D`,nextLine:(e=1)=>`\x1B[E`.repeat(e),prevLine:(e=1)=>`\x1B[F`.repeat(e),left:`\x1B[G`,hide:`\x1B[?25l`,show:`\x1B[?25h`,save:`\x1B7`,restore:`\x1B8`};t.exports={cursor:n,scroll:{up:(e=1)=>`\x1B[S`.repeat(e),down:(e=1)=>`\x1B[T`.repeat(e)},erase:{screen:`\x1B[2J`,up:(e=1)=>`\x1B[1J`.repeat(e),down:(e=1)=>`\x1B[J`.repeat(e),line:`\x1B[2K`,lineEnd:`\x1B[K`,lineStart:`\x1B[1K`,lines(e){let t=``;for(let r=0;r<e;r++)t+=this.line+(r<e-1?n.up():``);return e&&(t+=n.left),t}},beep:`\x07`}})),Cu=/* @__PURE__ */ S(((e,t)=>{let n=process||{},r=n.argv||[],i=n.env||{},a=!(i.NO_COLOR||r.includes(`--no-color`))&&(!!i.FORCE_COLOR||r.includes(`--color`)||n.platform===`win32`||(n.stdout||{}).isTTY&&i.TERM!==`dumb`||!!i.CI),o=(e,t,n=e)=>r=>{let i=``+r,a=i.indexOf(t,e.length);return~a?e+s(i,t,n,a)+t:e+i+t},s=(e,t,n,r)=>{let i=``,a=0;do i+=e.substring(a,r)+n,a=r+t.length,r=e.indexOf(t,a);while(~r);return i+e.substring(a)},c=(e=a)=>{let t=e?o:()=>String;return{isColorSupported:e,reset:t(`\x1B[0m`,`\x1B[0m`),bold:t(`\x1B[1m`,`\x1B[22m`,`\x1B[22m\x1B[1m`),dim:t(`\x1B[2m`,`\x1B[22m`,`\x1B[22m\x1B[2m`),italic:t(`\x1B[3m`,`\x1B[23m`),underline:t(`\x1B[4m`,`\x1B[24m`),inverse:t(`\x1B[7m`,`\x1B[27m`),hidden:t(`\x1B[8m`,`\x1B[28m`),strikethrough:t(`\x1B[9m`,`\x1B[29m`),black:t(`\x1B[30m`,`\x1B[39m`),red:t(`\x1B[31m`,`\x1B[39m`),green:t(`\x1B[32m`,`\x1B[39m`),yellow:t(`\x1B[33m`,`\x1B[39m`),blue:t(`\x1B[34m`,`\x1B[39m`),magenta:t(`\x1B[35m`,`\x1B[39m`),cyan:t(`\x1B[36m`,`\x1B[39m`),white:t(`\x1B[37m`,`\x1B[39m`),gray:t(`\x1B[90m`,`\x1B[39m`),bgBlack:t(`\x1B[40m`,`\x1B[49m`),bgRed:t(`\x1B[41m`,`\x1B[49m`),bgGreen:t(`\x1B[42m`,`\x1B[49m`),bgYellow:t(`\x1B[43m`,`\x1B[49m`),bgBlue:t(`\x1B[44m`,`\x1B[49m`),bgMagenta:t(`\x1B[45m`,`\x1B[49m`),bgCyan:t(`\x1B[46m`,`\x1B[49m`),bgWhite:t(`\x1B[47m`,`\x1B[49m`),blackBright:t(`\x1B[90m`,`\x1B[39m`),redBright:t(`\x1B[91m`,`\x1B[39m`),greenBright:t(`\x1B[92m`,`\x1B[39m`),yellowBright:t(`\x1B[93m`,`\x1B[39m`),blueBright:t(`\x1B[94m`,`\x1B[39m`),magentaBright:t(`\x1B[95m`,`\x1B[39m`),cyanBright:t(`\x1B[96m`,`\x1B[39m`),whiteBright:t(`\x1B[97m`,`\x1B[39m`),bgBlackBright:t(`\x1B[100m`,`\x1B[49m`),bgRedBright:t(`\x1B[101m`,`\x1B[49m`),bgGreenBright:t(`\x1B[102m`,`\x1B[49m`),bgYellowBright:t(`\x1B[103m`,`\x1B[49m`),bgBlueBright:t(`\x1B[104m`,`\x1B[49m`),bgMagentaBright:t(`\x1B[105m`,`\x1B[49m`),bgCyanBright:t(`\x1B[106m`,`\x1B[49m`),bgWhiteBright:t(`\x1B[107m`,`\x1B[49m`)}};t.exports=c(),t.exports.createColors=c})),J=Su(),Y=/* @__PURE__ */ w(Cu(),1);function wu({onlyFirst:e=!1}={}){let t=[`[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))`,`(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))`].join(`|`);return new RegExp(t,e?void 0:`g`)}const Tu=wu();function Eu(e){if(typeof e!=`string`)throw TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(Tu,``)}function Du(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var Ou={exports:{}};(function(e){var t={};e.exports=t,t.eastAsianWidth=function(e){var t=e.charCodeAt(0),n=e.length==2?e.charCodeAt(1):0,r=t;return 55296<=t&&t<=56319&&56320<=n&&n<=57343&&(t&=1023,n&=1023,r=t<<10|n,r+=65536),r==12288||65281<=r&&r<=65376||65504<=r&&r<=65510?`F`:r==8361||65377<=r&&r<=65470||65474<=r&&r<=65479||65482<=r&&r<=65487||65490<=r&&r<=65495||65498<=r&&r<=65500||65512<=r&&r<=65518?`H`:4352<=r&&r<=4447||4515<=r&&r<=4519||4602<=r&&r<=4607||9001<=r&&r<=9002||11904<=r&&r<=11929||11931<=r&&r<=12019||12032<=r&&r<=12245||12272<=r&&r<=12283||12289<=r&&r<=12350||12353<=r&&r<=12438||12441<=r&&r<=12543||12549<=r&&r<=12589||12593<=r&&r<=12686||12688<=r&&r<=12730||12736<=r&&r<=12771||12784<=r&&r<=12830||12832<=r&&r<=12871||12880<=r&&r<=13054||13056<=r&&r<=19903||19968<=r&&r<=42124||42128<=r&&r<=42182||43360<=r&&r<=43388||44032<=r&&r<=55203||55216<=r&&r<=55238||55243<=r&&r<=55291||63744<=r&&r<=64255||65040<=r&&r<=65049||65072<=r&&r<=65106||65108<=r&&r<=65126||65128<=r&&r<=65131||110592<=r&&r<=110593||127488<=r&&r<=127490||127504<=r&&r<=127546||127552<=r&&r<=127560||127568<=r&&r<=127569||131072<=r&&r<=194367||177984<=r&&r<=196605||196608<=r&&r<=262141?`W`:32<=r&&r<=126||162<=r&&r<=163||165<=r&&r<=166||r==172||r==175||10214<=r&&r<=10221||10629<=r&&r<=10630?`Na`:r==161||r==164||167<=r&&r<=168||r==170||173<=r&&r<=174||176<=r&&r<=180||182<=r&&r<=186||188<=r&&r<=191||r==198||r==208||215<=r&&r<=216||222<=r&&r<=225||r==230||232<=r&&r<=234||236<=r&&r<=237||r==240||242<=r&&r<=243||247<=r&&r<=250||r==252||r==254||r==257||r==273||r==275||r==283||294<=r&&r<=295||r==299||305<=r&&r<=307||r==312||319<=r&&r<=322||r==324||328<=r&&r<=331||r==333||338<=r&&r<=339||358<=r&&r<=359||r==363||r==462||r==464||r==466||r==468||r==470||r==472||r==474||r==476||r==593||r==609||r==708||r==711||713<=r&&r<=715||r==717||r==720||728<=r&&r<=731||r==733||r==735||768<=r&&r<=879||913<=r&&r<=929||931<=r&&r<=937||945<=r&&r<=961||963<=r&&r<=969||r==1025||1040<=r&&r<=1103||r==1105||r==8208||8211<=r&&r<=8214||8216<=r&&r<=8217||8220<=r&&r<=8221||8224<=r&&r<=8226||8228<=r&&r<=8231||r==8240||8242<=r&&r<=8243||r==8245||r==8251||r==8254||r==8308||r==8319||8321<=r&&r<=8324||r==8364||r==8451||r==8453||r==8457||r==8467||r==8470||8481<=r&&r<=8482||r==8486||r==8491||8531<=r&&r<=8532||8539<=r&&r<=8542||8544<=r&&r<=8555||8560<=r&&r<=8569||r==8585||8592<=r&&r<=8601||8632<=r&&r<=8633||r==8658||r==8660||r==8679||r==8704||8706<=r&&r<=8707||8711<=r&&r<=8712||r==8715||r==8719||r==8721||r==8725||r==8730||8733<=r&&r<=8736||r==8739||r==8741||8743<=r&&r<=8748||r==8750||8756<=r&&r<=8759||8764<=r&&r<=8765||r==8776||r==8780||r==8786||8800<=r&&r<=8801||8804<=r&&r<=8807||8810<=r&&r<=8811||8814<=r&&r<=8815||8834<=r&&r<=8835||8838<=r&&r<=8839||r==8853||r==8857||r==8869||r==8895||r==8978||9312<=r&&r<=9449||9451<=r&&r<=9547||9552<=r&&r<=9587||9600<=r&&r<=9615||9618<=r&&r<=9621||9632<=r&&r<=9633||9635<=r&&r<=9641||9650<=r&&r<=9651||9654<=r&&r<=9655||9660<=r&&r<=9661||9664<=r&&r<=9665||9670<=r&&r<=9672||r==9675||9678<=r&&r<=9681||9698<=r&&r<=9701||r==9711||9733<=r&&r<=9734||r==9737||9742<=r&&r<=9743||9748<=r&&r<=9749||r==9756||r==9758||r==9792||r==9794||9824<=r&&r<=9825||9827<=r&&r<=9829||9831<=r&&r<=9834||9836<=r&&r<=9837||r==9839||9886<=r&&r<=9887||9918<=r&&r<=9919||9924<=r&&r<=9933||9935<=r&&r<=9953||r==9955||9960<=r&&r<=9983||r==10045||r==10071||10102<=r&&r<=10111||11093<=r&&r<=11097||12872<=r&&r<=12879||57344<=r&&r<=63743||65024<=r&&r<=65039||r==65533||127232<=r&&r<=127242||127248<=r&&r<=127277||127280<=r&&r<=127337||127344<=r&&r<=127386||917760<=r&&r<=917999||983040<=r&&r<=1048573||1048576<=r&&r<=1114109?`A`:`N`},t.characterLength=function(e){var t=this.eastAsianWidth(e);return t==`F`||t==`W`||t==`A`?2:1};function n(e){return e.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}t.length=function(e){for(var t=n(e),r=0,i=0;i<t.length;i++)r+=this.characterLength(t[i]);return r},t.slice=function(e,r,i){textLen=t.length(e),r||=0,i||=1,r<0&&(r=textLen+r),i<0&&(i=textLen+i);for(var a=``,o=0,s=n(e),c=0;c<s.length;c++){var l=s[c],u=t.length(l);if(o>=r-+(u==2)){if(o+u<=i)a+=l;else break}o+=u}return a}})(Ou);var ku=Ou.exports;const Au=Du(ku),ju=Du(function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g});function Mu(e,t={}){if(typeof e!=`string`||e.length===0||(t={ambiguousIsNarrow:!0,...t},e=Eu(e),e.length===0))return 0;e=e.replace(ju(),` `);let n=t.ambiguousIsNarrow?1:2,r=0;for(let t of e){let e=t.codePointAt(0);if(!(e<=31||e>=127&&e<=159||e>=768&&e<=879))switch(Au.eastAsianWidth(t)){case`F`:case`W`:r+=2;break;case`A`:r+=n;break;default:r+=1}}return r}const Nu=(e=0)=>t=>`\x1B[${t+e}m`,Pu=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,Fu=(e=0)=>(t,n,r)=>`\x1B[${38+e};2;${t};${n};${r}m`,X={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]}};Object.keys(X.modifier);const Iu=Object.keys(X.color),Lu=Object.keys(X.bgColor);[...Iu,...Lu];function Ru(){let e=/* @__PURE__ */ new Map;for(let[t,n]of Object.entries(X)){for(let[t,r]of Object.entries(n))X[t]={open:`\x1B[${r[0]}m`,close:`\x1B[${r[1]}m`},n[t]=X[t],e.set(r[0],r[1]);Object.defineProperty(X,t,{value:n,enumerable:!1})}return Object.defineProperty(X,"codes",{value:e,enumerable:!1}),X.color.close=`\x1B[39m`,X.bgColor.close=`\x1B[49m`,X.color.ansi=Nu(),X.color.ansi256=Pu(),X.color.ansi16m=Fu(),X.bgColor.ansi=Nu(10),X.bgColor.ansi256=Pu(10),X.bgColor.ansi16m=Fu(10),Object.defineProperties(X,{rgbToAnsi256:{value:(e,t,n)=>e===t&&t===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value:e=>{let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[n]=t;n.length===3&&(n=[...n].map(e=>e+e).join(``));let r=Number.parseInt(n,16);return[r>>16&255,r>>8&255,r&255]},enumerable:!1},hexToAnsi256:{value:e=>X.rgbToAnsi256(...X.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value:e=>{if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,n,r;if(e>=232)t=((e-232)*10+8)/255,n=t,r=t;else{e-=16;let i=e%36;t=Math.floor(e/36)/5,n=Math.floor(i/6)/5,r=i%6/5}let i=Math.max(t,n,r)*2;if(i===0)return 30;let a=30+(Math.round(r)<<2|Math.round(n)<<1|Math.round(t));return i===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(e,t,n)=>X.ansi256ToAnsi(X.rgbToAnsi256(e,t,n)),enumerable:!1},hexToAnsi:{value:e=>X.ansi256ToAnsi(X.hexToAnsi256(e)),enumerable:!1}}),X}const zu=Ru(),Bu=/* @__PURE__ */ new Set([`\x1B`,`›`]),Vu=`]8;;`,Hu=e=>`${Bu.values().next().value}[${e}m`,Uu=e=>`${Bu.values().next().value}${Vu}${e}`,Wu=e=>e.split(` `).map(e=>Mu(e)),Gu=(e,t,n)=>{let r=[...t],i=!1,a=!1,o=Mu(Eu(e[e.length-1]));for(let[t,s]of r.entries()){let c=Mu(s);o+c<=n?e[e.length-1]+=s:(e.push(s),o=0),Bu.has(s)&&(i=!0,a=r.slice(t+1).join(``).startsWith(Vu)),i?a?s===`\x07`&&(i=!1,a=!1):s===`m`&&(i=!1):(o+=c,o===n&&t<r.length-1&&(e.push(``),o=0))}!o&&e[e.length-1].length>0&&e.length>1&&(e[e.length-2]+=e.pop())},Ku=e=>{let t=e.split(` `),n=t.length;for(;n>0&&!(Mu(t[n-1])>0);)n--;return n===t.length?e:t.slice(0,n).join(` `)+t.slice(n).join(``)},qu=(e,t,n={})=>{if(n.trim!==!1&&e.trim()===``)return``;let r=``,i,a,o=Wu(e),s=[``];for(let[r,i]of e.split(` `).entries()){n.trim!==!1&&(s[s.length-1]=s[s.length-1].trimStart());let e=Mu(s[s.length-1]);if(r!==0&&(e>=t&&(n.wordWrap===!1||n.trim===!1)&&(s.push(``),e=0),(e>0||n.trim===!1)&&(s[s.length-1]+=` `,e++)),n.hard&&o[r]>t){let n=t-e,a=1+Math.floor((o[r]-n-1)/t);Math.floor((o[r]-1)/t)<a&&s.push(``),Gu(s,i,t)}else{if(e+o[r]>t&&e>0&&o[r]>0){if(n.wordWrap===!1&&e<t){Gu(s,i,t);continue}s.push(``)}e+o[r]>t&&n.wordWrap===!1?Gu(s,i,t):s[s.length-1]+=i}}n.trim!==!1&&(s=s.map(e=>Ku(e)));let c=[...s.join(`
156
- `)];for(let[e,t]of c.entries()){if(r+=t,Bu.has(t)){let{groups:t}=RegExp(`(?:\\[(?<code>\\d+)m|\\${Vu}(?<uri>.*))`).exec(c.slice(e).join(``))||{groups:{}};if(t.code!==void 0){let e=Number.parseFloat(t.code);i=e===39?void 0:e}else t.uri!==void 0&&(a=t.uri.length===0?void 0:t.uri)}let n=zu.codes.get(Number(i));c[e+1]===`
157
- `?(a&&(r+=Uu(``)),i&&n&&(r+=Hu(n))):t===`
158
- `&&(i&&n&&(r+=Hu(i)),a&&(r+=Uu(a)))}return r};function Ju(e,t,n){return String(e).normalize().replace(/\r\n/g,`
155
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0])a(n);else{if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&e.reused===`ref`)&&a(n)}}e.external&&(e.sharedDefsExtractedFor=e.external)}function Ms(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;Ms(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}const Ns=/* @__PURE__ */ new Set([`type`,`properties`,`required`,`additionalProperties`]),Ps=[`oneOf`,`anyOf`];function Fs(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function Is(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!Ns.has(e))return null;t.push(n)}let n={},r=/* @__PURE__ */ new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??Fs(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}pn(n,r,e.length===1?e[0]:Is(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=Fs(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function Ls(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of Ns)if(t in e)return;let n=t.filter(e=>Ps.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=Is(t);else{let e=n[0],i=Ps.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>Is([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,Ds(e,r))}function Rs(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Ds(i,s),Ds(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())Ms(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=/* @__PURE__ */ new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])Ls(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Ds(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,pn(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:Bs(t,`input`,e.processors),output:Bs(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function W(e,t){let n=t??{seen:/* @__PURE__ */ new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return W(r.element,n);if(r.type===`set`)return W(r.valueType,n);if(r.type===`lazy`)return W(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return W(r.innerType,n);if(r.type===`intersection`)return W(r.left,n)||W(r.right,n);if(r.type===`record`||r.type===`map`)return W(r.keyType,n)||W(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:W(r.in,n)||W(r.out,n);if(r.type===`object`){for(let e in r.shape)if(W(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(W(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(W(e,n))return!0;return!!(r.rest&&W(r.rest,n))}return!1}const zs=(e,t={})=>n=>{let r=Os({...n,processors:t});return U(e,r),js(r,e),Rs(r,e)},Bs=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Os({...i??{},target:a,io:t,processors:n});return U(e,o),js(o,e),Rs(o,e)},Vs=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},Hs=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},Us=(e,t)=>{Vs(e,`minimum`,t),Hs(e,`maximum`,t)},Ws=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},Gs=(e,t)=>{e.patterns??=/* @__PURE__ */ new Set,e.patterns.add(t)},Ks=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},qs=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},Js=(e,t)=>Vs(e,`minimum`,t.minimum),Ys=(e,t)=>Hs(e,`maximum`,t.maximum),Xs=e=>(t,n)=>{qs(t,n.format);let[r,i]=e[n.format];Vs(t,`minimum`,r),Hs(t,`maximum`,i)},Zs={greater_than:(e,t)=>Vs(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>Hs(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>Ws(e,t.value),number_format:Xs(Mn),bigint_format:Xs(Nn),min_length:Js,max_length:Ys,length_equals:(e,t)=>Us(e,t.length),min_size:Js,max_size:Ys,size_equals:(e,t)=>Us(e,t.size),string_format:(e,t)=>{qs(e,t.format),t.pattern&&Gs(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>Ks(e,t.mime)};function Qs(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)Zs[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&Vs(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&Vs(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&Hs(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&Hs(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&Ws(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&Ks(t,i.mime);for(let e of i.patterns??[])Gs(t,e);return t}const $s={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},ec=/* @__PURE__ */ new Map([[ba,ui],[Sa,di]]),tc=e=>ec.get(e)??e,nc=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=Qs(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=$s[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(tc);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},rc=(e,t,n,r)=>{n.not={}},ic=(e,t,n,r)=>{let i=e._zod.def,a=on(i.entries);a.length===0?n.not={}:(a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a)},ac=(e,t,n,r)=>{ks(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},oc=(e,t,n,r)=>{ks(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},sc=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=Qs(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=U(a.element,t,{...r,path:[...r.path,`items`]})};function cc(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?cc(t.out):t.type===`catch`?cc(t.innerType):e._zod.optin}const lc=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&ks(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)pn(i.properties,e,U(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?cc(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=U(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},uc=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>U(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},dc=(e,t,n,r)=>{let i=e._zod.def,a=U(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=U(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)};function fc(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let r=e.get(t)?.def;if(!r)return t;let i=fc(e,r,n);return i===r?t:i}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>fc(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes(`string`)&&r.some(e=>e===`number`||e===`integer`),a=t.enum??(t.const===void 0?void 0:[t.const]);if(!i&&!a?.some(e=>typeof e==`number`))return t;let{minimum:o,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(e=>typeof e==`number`?String(e):e):typeof p.const==`number`&&(p.const=String(p.const)),i&&(p.type=`string`,a||(p.pattern=(r.includes(`number`)?Si:xi).source)),p}const pc=/* @__PURE__ */ new WeakMap;function mc(e){let t=/* @__PURE__ */ new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=/* @__PURE__ */ new Map;for(let r of pc.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=fc(t,a,/* @__PURE__ */ new Set);o!==a&&n.set(a,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}const hc=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=Qs(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=U(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)pn(i.patternProperties,tc(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=U(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=pc.get(t);n||(n=[],pc.set(t,n),t.deferred.push(()=>mc(t))),n.push(e)}i.additionalProperties=U(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&cc(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e.map(String))}},gc=(e,t,n,r)=>{let i=e._zod.def,a=U(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},_c=(e,t,n,r)=>{let i=e._zod.def;U(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},vc=Symbol();function yc(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(ks(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),vc):JSON.parse(o)}const bc=(e,t,n,r)=>{let i=e._zod.def;U(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=yc(i.defaultValue,e,t,n,r);o!==vc&&(n.default=o)},xc=(e,t,n,r)=>{let i=e._zod.def;U(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=yc(i.defaultValue,e,t,n,r);o!==vc&&(n._prefault=o)},Sc=(e,t,n,r)=>{let i=e._zod.def;U(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{ks(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},Cc=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;U(o,t,r);let s=t.seen.get(e);s.ref=o},wc=(e,t,n,r)=>{let i=e._zod.def;U(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Tc=(e,t,n,r)=>{let i=e._zod.def;U(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Ec=/* @__PURE__ */ new WeakSet([Object.prototype,Error.prototype]);function Dc(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}const Oc=/*@__PURE__*/ B(`ZodError`,(e,t)=>{Tr.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);Ec.has(n)||(Ec.add(n),Dc(n,`format`,e=>t=>Or(e,t)),Dc(n,`flatten`,e=>t=>Dr(e,t)),Dc(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,cn,2)}),Dc(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,cn,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),kc=/* @__PURE__ */ Ar(Oc),Ac=/* @__PURE__ */ jr(Oc),jc=/* @__PURE__ */ Mr(Oc),Mc=/* @__PURE__ */ Pr(Oc),Nc=/* @__PURE__ */ Br(Oc),Pc=/* @__PURE__ */ Vr(Oc),Fc=/* @__PURE__ */ Hr(Oc),Ic=/* @__PURE__ */ Ur(Oc),Lc=/* @__PURE__ */ Wr(Oc),Rc=/* @__PURE__ */ Gr(Oc),zc=/* @__PURE__ */ Kr(Oc),Bc=/* @__PURE__ */ qr(Oc);function Vc(){vr.localeError||yr(Do())}function Hc(){vr.memoizer||yr({memoizer:wo()})}const G=/*@__PURE__*/ B(`ZodType`,(e,t)=>(Vc(),V.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(L(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return kn(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Ql(e,t))},superRefine(e,t){return this.check($l(e,t))},overwrite(e){return this.check(/* @__PURE__ */ _s(e))},optional(){return Pl(this)},exactOptional(){return Il(this)},nullable(){return Rl(this)},nullish(){return Pl(Rl(this))},nonoptional(e){return Wl(this,e)},array(){return yl(this)},or(e){return wl([this,e])},and(e){return El(this,e)},transform(e){return Jl(this,Ml(e))},default(e){return Bl(this,e)},prefault(e){return Hl(this,e)},catch(e){return Kl(this,e)},pipe(e){return Jl(this,e)},readonly(){return Xl(this)},describe(e){let t=this.clone();return jo.add(t,{description:e}),t},meta(...e){if(e.length===0)return jo.get(this);let t=this.clone();return jo.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return rr(this,`~standard`,{...Hi(this),jsonSchema:{input:Bs(this,`input`),output:Bs(this,`output`)}})},set"~standard"(e){nr(this,`~standard`,e)},parse:function e(t,n){return kc(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await Ac(this,t,n,{callee:e})},safeParse(e,t){return jc(this,e,t)},async safeParseAsync(e,t){return Mc(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){nr(this,`spa`,e)},validate(e,t){return Lr(this,e,t)},validateAsync(e,t){return zr(this,e,t)},encode:function e(t,n){return Nc(this,t,n,{callee:e})},decode:function e(t,n){return Pc(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await Fc(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await Ic(this,t,n,{callee:e})},safeEncode(e,t){return Lc(this,e,t)},safeDecode(e,t){return Rc(this,e,t)},async safeEncodeAsync(e,t){return zc(this,e,t)},async safeDecodeAsync(e,t){return Bc(this,e,t)},toJSONSchema(e){return zs(this,{})(e)},get description(){return jo.get(this)?.description},get _def(){return this._zod.def}}),Uc=/*@__PURE__*/ B(`_ZodString`,(e,t)=>{Ui.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>nc(e,t,n,r)},/*@__PURE__*/ ir({format:e=>Qs(e).format??null,minLength:e=>Qs(e).minimum??null,maxLength:e=>Qs(e).maximum??null},{regex(...e){return this.check(/* @__PURE__ */ ds(...e))},includes(...e){return this.check(/* @__PURE__ */ ms(...e))},startsWith(...e){return this.check(/* @__PURE__ */ hs(...e))},endsWith(...e){return this.check(/* @__PURE__ */ gs(...e))},min(...e){return this.check(/* @__PURE__ */ ls(...e))},max(...e){return this.check(/* @__PURE__ */ cs(...e))},length(...e){return this.check(/* @__PURE__ */ us(...e))},nonempty(...e){return this.check(/* @__PURE__ */ ls(1,...e))},lowercase(e){return this.check(/* @__PURE__ */ fs(e))},uppercase(e){return this.check(/* @__PURE__ */ ps(e))},trim(){return this.check(/* @__PURE__ */ ys())},normalize(...e){return this.check(/* @__PURE__ */ vs(...e))},toLowerCase(){return this.check(/* @__PURE__ */ bs())},toUpperCase(){return this.check(/* @__PURE__ */ xs())},slugify(){return this.check(/* @__PURE__ */ Ss())}})),Wc=/*@__PURE__*/ B(`ZodString`,(e,t)=>{Ui.init(e,t),Uc.init(e,t)},{email(e){return this.check(/* @__PURE__ */ Po(Yc,e))},url(e){return this.check(/* @__PURE__ */ Bo(Qc,e))},jwt(e){return this.check(/* @__PURE__ */ ts(pl,e))},emoji(e){return this.check(/* @__PURE__ */ Vo($c,e))},guid(e){return this.check(/* @__PURE__ */ Fo(Xc,e))},uuid(e){return this.check(/* @__PURE__ */ Io(Zc,e))},uuidv4(e){return this.check(/* @__PURE__ */ Lo(Zc,e))},uuidv6(e){return this.check(/* @__PURE__ */ Ro(Zc,e))},uuidv7(e){return this.check(/* @__PURE__ */ zo(Zc,e))},nanoid(e){return this.check(/* @__PURE__ */ Ho(el,e))},cuid(e){return this.check(/* @__PURE__ */ Uo(tl,e))},cuid2(e){return this.check(/* @__PURE__ */ Wo(nl,e))},ulid(e){return this.check(/* @__PURE__ */ Go(rl,e))},base64(e){return this.check(/* @__PURE__ */ Qo(ul,e))},base64url(e){return this.check(/* @__PURE__ */ $o(dl,e))},xid(e){return this.check(/* @__PURE__ */ Ko(il,e))},ksuid(e){return this.check(/* @__PURE__ */ qo(al,e))},ipv4(e){return this.check(/* @__PURE__ */ Jo(ol,e))},ipv6(e){return this.check(/* @__PURE__ */ Yo(sl,e))},cidrv4(e){return this.check(/* @__PURE__ */ Xo(cl,e))},cidrv6(e){return this.check(/* @__PURE__ */ Zo(ll,e))},e164(e){return this.check(/* @__PURE__ */ es(fl,e))},datetime(e){return this.check(/* @__PURE__ */ ns(Gc,e))},date(e){return this.check(/* @__PURE__ */ rs(Kc,e))},time(e){return this.check(/* @__PURE__ */ is(qc,e))},duration(e){return this.check(/* @__PURE__ */ as(Jc,e))}});function K(e){return/* @__PURE__ */ No(Wc,e)}const q=/*@__PURE__*/ B(`ZodStringFormat`,(e,t)=>{H.init(e,t),Uc.init(e,t)}),Gc=/*@__PURE__*/ B(`ZodISODateTime`,(e,t)=>{ca.init(e,t),q.init(e,t)}),Kc=/*@__PURE__*/ B(`ZodISODate`,(e,t)=>{la.init(e,t),q.init(e,t)}),qc=/*@__PURE__*/ B(`ZodISOTime`,(e,t)=>{ua.init(e,t),q.init(e,t)}),Jc=/*@__PURE__*/ B(`ZodISODuration`,(e,t)=>{da.init(e,t),q.init(e,t)}),Yc=/*@__PURE__*/ B(`ZodEmail`,(e,t)=>{Ki.init(e,t),q.init(e,t)}),Xc=/*@__PURE__*/ B(`ZodGUID`,(e,t)=>{Wi.init(e,t),q.init(e,t)}),Zc=/*@__PURE__*/ B(`ZodUUID`,(e,t)=>{Gi.init(e,t),q.init(e,t)}),Qc=/*@__PURE__*/ B(`ZodURL`,(e,t)=>{ea.init(e,t),q.init(e,t)}),$c=/*@__PURE__*/ B(`ZodEmoji`,(e,t)=>{ta.init(e,t),q.init(e,t)}),el=/*@__PURE__*/ B(`ZodNanoID`,(e,t)=>{na.init(e,t),q.init(e,t)}),tl=/*@__PURE__*/ B(`ZodCUID`,(e,t)=>{ra.init(e,t),q.init(e,t)}),nl=/*@__PURE__*/ B(`ZodCUID2`,(e,t)=>{ia.init(e,t),q.init(e,t)}),rl=/*@__PURE__*/ B(`ZodULID`,(e,t)=>{aa.init(e,t),q.init(e,t)}),il=/*@__PURE__*/ B(`ZodXID`,(e,t)=>{oa.init(e,t),q.init(e,t)}),al=/*@__PURE__*/ B(`ZodKSUID`,(e,t)=>{sa.init(e,t),q.init(e,t)}),ol=/*@__PURE__*/ B(`ZodIPv4`,(e,t)=>{fa.init(e,t),q.init(e,t)}),sl=/*@__PURE__*/ B(`ZodIPv6`,(e,t)=>{ha.init(e,t),q.init(e,t)}),cl=/*@__PURE__*/ B(`ZodCIDRv4`,(e,t)=>{ga.init(e,t),q.init(e,t)}),ll=/*@__PURE__*/ B(`ZodCIDRv6`,(e,t)=>{va.init(e,t),q.init(e,t)}),ul=/*@__PURE__*/ B(`ZodBase64`,(e,t)=>{xa.init(e,t),q.init(e,t)}),dl=/*@__PURE__*/ B(`ZodBase64URL`,(e,t)=>{wa.init(e,t),q.init(e,t)}),fl=/*@__PURE__*/ B(`ZodE164`,(e,t)=>{Ta.init(e,t),q.init(e,t)}),pl=/*@__PURE__*/ B(`ZodJWT`,(e,t)=>{Da.init(e,t),q.init(e,t)}),ml=/*@__PURE__*/ B(`ZodUnknown`,(e,t)=>{Oa.init(e,t),G.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function hl(){return/* @__PURE__ */ os(ml)}const gl=/*@__PURE__*/ B(`ZodNever`,(e,t)=>{ka.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>rc(e,t,n,r)});function _l(e){return/* @__PURE__ */ ss(gl,e)}const vl=/*@__PURE__*/ B(`ZodArray`,(e,t)=>{Hc(),Na.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>sc(e,t,n,r),e.element=t.element},{min(e,t){return this.check(/* @__PURE__ */ ls(e,t))},nonempty(e){return this.check(/* @__PURE__ */ ls(1,e))},max(e,t){return this.check(/* @__PURE__ */ cs(e,t))},length(e,t){return this.check(/* @__PURE__ */ us(e,t))},unwrap(){return this.element}});function yl(e,t){return/* @__PURE__ */ Cs(vl,e,t)}const bl=/*@__PURE__*/ B(`ZodObject`,(e,t)=>{Hc(),za.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lc(e,t,n,r),ur(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return Al(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(L(this._zod.def,{catchall:e}))},passthrough(){return this.clone(L(this._zod.def,{catchall:hl()}))},loose(){return this.clone(L(this._zod.def,{catchall:hl()}))},strict(){return this.clone(L(this._zod.def,{catchall:_l()}))},strip(){return this.clone(L(this._zod.def,{catchall:void 0}))},extend(e){return Ln(this,e)},safeExtend(e){return zn(this,e)},merge(e){return Bn(this,e)},pick(e){return Pn(this,e)},omit(e){return In(this,e)},partial(...e){return Vn(Nl,this,e[0])},exactPartial(...e){return Vn(Fl,this,e[0],`exactPartial`)},required(...e){return Hn(Ul,this,e[0])}});function xl(e,t){let n={type:`object`,shape:e??{},...R(t)};return new bl(n)}function Sl(e,t){return new bl({type:`object`,shape:e,catchall:hl(),...R(t)})}const Cl=/*@__PURE__*/ B(`ZodUnion`,(e,t)=>{Va.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>uc(e,t,n,r),e.options=t.options});function wl(e,t){return new Cl({type:`union`,options:e,...R(t)})}const Tl=/*@__PURE__*/ B(`ZodIntersection`,(e,t)=>{Ha.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>dc(e,t,n,r)});function El(e,t){return new Tl({type:`intersection`,left:e,right:t})}const Dl=/*@__PURE__*/ B(`ZodRecord`,(e,t)=>{Hc(),Ga.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hc(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function Ol(e,t,n){return!t||!t._zod?new Dl({type:`record`,keyType:K(),valueType:e,...R(t)}):new Dl({type:`record`,keyType:e,valueType:t,...R(n)})}const kl=/*@__PURE__*/ B(`ZodEnum`,(e,t)=>{Ka.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ic(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new kl({...t,checks:[],...R(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new kl({...t,checks:[],...R(r),entries:i})}});function Al(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new kl({type:`enum`,entries:n,...R(t)})}const jl=/*@__PURE__*/ B(`ZodTransform`,(e,t)=>{Hc(),qa.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oc(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new _r(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(er(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(er(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Ml(e){return new jl({type:`transform`,transform:e})}const Nl=/*@__PURE__*/ B(`ZodOptional`,(e,t)=>{Ya.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Tc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Pl(e){return new Nl({type:`optional`,innerType:e})}const Fl=/*@__PURE__*/ B(`ZodExactOptional`,(e,t)=>{Xa.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Tc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Il(e){return new Fl({type:`optional`,innerType:e})}const Ll=/*@__PURE__*/ B(`ZodNullable`,(e,t)=>{Za.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Rl(e){return new Ll({type:`nullable`,innerType:e})}const zl=/*@__PURE__*/ B(`ZodDefault`,(e,t)=>{Qa.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Bl(e,t){return new zl({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():En(t)}})}const Vl=/*@__PURE__*/ B(`ZodPrefault`,(e,t)=>{eo.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Hl(e,t){return new Vl({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():En(t)}})}const Ul=/*@__PURE__*/ B(`ZodNonOptional`,(e,t)=>{to.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_c(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Wl(e,t){return new Ul({type:`nonoptional`,innerType:e,...R(t)})}const Gl=/*@__PURE__*/ B(`ZodCatch`,(e,t)=>{io.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Sc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Kl(e,t){return new Gl({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:dr(t)})}const ql=/*@__PURE__*/ B(`ZodPipe`,(e,t)=>{ao.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Cc(e,t,n,r),e.in=t.in,e.out=t.out});function Jl(e,t){return new ql({type:`pipe`,in:e,out:t})}const Yl=/*@__PURE__*/ B(`ZodReadonly`,(e,t)=>{so.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Xl(e){return new Yl({type:`readonly`,innerType:e})}const Zl=/*@__PURE__*/ B(`ZodCustom`,(e,t)=>{lo.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ac(e,t,n,r)});function Ql(e,t={}){return/* @__PURE__ */ ws(Zl,e,t)}function $l(e,t){return/* @__PURE__ */ Ts(e,t)}let eu;function tu(){return eu??=Vt(`@longzai-intelligence-cli/core/provider`),eu}const nu={red:e=>e,green:e=>e,yellow:e=>e,blue:e=>e,cyan:e=>e,magenta:e=>e,gray:e=>e,bold:e=>e,dim:e=>e};let ru={select:async(e,t)=>t[0]?.value??``,textInput:async(e,t)=>t?.defaultValue??``,confirm:async(e,t)=>t?.defaultValue??!1,spinner:()=>({start:e=>tu().info(e),stop:e=>tu().info(e)}),note:(e,t)=>{t?tu().info(`${t}: ${e}`):tu().info(e)},log:{info:e=>tu().info(e),success:e=>tu().info(e),warn:e=>tu().warn(e),error:e=>tu().error(e),step:e=>tu().info(e)}},iu=nu;function au(e){ru=e}function ou(e){iu=e}function su(){return ru}function cu(){return iu}const lu=()=>`0.2.6`;function uu(e){let t=e.version??lu();e.interaction&&au(e.interaction),e.color&&ou(e.color);let n=new tn;return n.name(e.name).version(t,`-v, --version`,`输出 ${e.name} 的版本号`),e.description&&n.description(e.description),n}let du;function fu(){return du??=Vt(`@longzai-intelligence-cli/core/output`),du}var pu=class{format;constructor(e=`text`){this.format=e}get colors(){return cu()}success(e,t){this.format===`json`?fu().info(JSON.stringify({success:!0,data:e},null,2)):fu().info(t?this.colors.green(t):this.colors.green(this.formatData(e)))}error(e){if(this.format===`json`){let t=e instanceof Error?{message:e.message,name:e.name}:{message:String(e)};fu().info(JSON.stringify({success:!1,error:t},null,2))}else{let t=e instanceof Error?e.message:String(e);fu().error(this.colors.red(`错误: ${t}`))}}info(e){this.format===`json`?fu().info(JSON.stringify({success:!0,message:e},null,2)):fu().info(this.colors.blue(e))}warn(e){this.format===`json`?fu().info(JSON.stringify({success:!0,warning:e},null,2)):fu().info(this.colors.yellow(e))}table(e,t){if(this.format===`json`){let n=t.map(t=>{let n={};return e.forEach((e,r)=>{n[e]=t[r]??``}),n});fu().info(JSON.stringify({success:!0,data:n},null,2))}else{let n=e.map((e,n)=>Math.min(60,Math.max(e.length,...t.map(e=>(e[n]??``).length))));fu().info(e.map((e,t)=>this.colors.bold(e.padEnd(n[t]??0))).join(` `)),fu().info(n.map(e=>`─`.repeat(e??0)).join(` `));for(let e of t)fu().info(e.map((e,t)=>{let r=n[t]??0,i=e??``;return i.length>r?i.slice(0,Math.max(0,r-1))+`…`:i.padEnd(r)}).join(` `))}}formatData(e){return typeof e==`string`?e:typeof e==`number`||typeof e==`boolean`?String(e):JSON.stringify(e,null,2)}};function mu(e){return e===`json`?`json`:`text`}async function hu(e,t){return su().select(e,t)}async function gu(e,t){return su().textInput(e,t)}async function _u(e,t){return su().confirm(e,t)}const vu={info(e){su().log.info(e)},success(e){su().log.success(e)},warn(e){su().log.warn(e)},error(e){su().log.error(e)},step(e){su().log.step(e)}};let yu;function bu(){return yu??=Vt(`@longzai-intelligence-cli/core/define-command`),yu}function xu(e,t){let n=e.commands.find(e=>e.name()===t);return n===void 0?e.command(t):n}function Su(e,t){if(t.length===1){let n=t[0];if(n===void 0)throw Error(`defineCommand: segments 为空,无法解析命令名`);return e.command(n)}let[n,...r]=t;if(n===void 0)throw Error(`defineCommand: segments 首段为空,无法解析父命令名`);let i=r.pop();if(i===void 0)throw Error(`defineCommand: segments 末段为空,无法解析子命令名`);let a=xu(e,n);for(let e of r)a=xu(a,e);return a.command(i)}function Cu(e,t){let n=Su(e,t.name.split(` `).filter(e=>e.length>0));t.description&&n.description(t.description);for(let e of t.arguments??[])e.description?n.argument(e.signature,e.description):n.argument(e.signature);for(let e of t.options??[])e.defaultValue===void 0?n.option(e.flags,e.description??``):n.option(e.flags,e.description??``,e.defaultValue);n.action(async(...e)=>{let n=e[e.length-1];if(!(n instanceof tn))return;let r=n.opts(),i=n.args,a=t.schema.safeParse(r);if(!a.success){let e=a.error.issues.map(e=>e.message).join(`, `);bu().error(cu().red(`参数校验失败: ${e}`)),su().log.error(`参数校验失败: ${e}`),process.exit(1)}await t.action(a.data,i)})}var wu=/* @__PURE__ */ S(((e,t)=>{let n={to(e,t){return t?`[${t+1};${e+1}H`:`[${e+1}G`},move(e,t){let n=``;return e<0?n+=`[${-e}D`:e>0&&(n+=`[${e}C`),t<0?n+=`[${-t}A`:t>0&&(n+=`[${t}B`),n},up:(e=1)=>`[${e}A`,down:(e=1)=>`[${e}B`,forward:(e=1)=>`[${e}C`,backward:(e=1)=>`[${e}D`,nextLine:(e=1)=>`\x1B[E`.repeat(e),prevLine:(e=1)=>`\x1B[F`.repeat(e),left:`\x1B[G`,hide:`\x1B[?25l`,show:`\x1B[?25h`,save:`\x1B7`,restore:`\x1B8`};t.exports={cursor:n,scroll:{up:(e=1)=>`\x1B[S`.repeat(e),down:(e=1)=>`\x1B[T`.repeat(e)},erase:{screen:`\x1B[2J`,up:(e=1)=>`\x1B[1J`.repeat(e),down:(e=1)=>`\x1B[J`.repeat(e),line:`\x1B[2K`,lineEnd:`\x1B[K`,lineStart:`\x1B[1K`,lines(e){let t=``;for(let r=0;r<e;r++)t+=this.line+(r<e-1?n.up():``);return e&&(t+=n.left),t}},beep:`\x07`}})),Tu=/* @__PURE__ */ S(((e,t)=>{let n=process||{},r=n.argv||[],i=n.env||{},a=!(i.NO_COLOR||r.includes(`--no-color`))&&(!!i.FORCE_COLOR||r.includes(`--color`)||n.platform===`win32`||(n.stdout||{}).isTTY&&i.TERM!==`dumb`||!!i.CI),o=(e,t,n=e)=>r=>{let i=``+r,a=i.indexOf(t,e.length);return~a?e+s(i,t,n,a)+t:e+i+t},s=(e,t,n,r)=>{let i=``,a=0;do i+=e.substring(a,r)+n,a=r+t.length,r=e.indexOf(t,a);while(~r);return i+e.substring(a)},c=(e=a)=>{let t=e?o:()=>String;return{isColorSupported:e,reset:t(`\x1B[0m`,`\x1B[0m`),bold:t(`\x1B[1m`,`\x1B[22m`,`\x1B[22m\x1B[1m`),dim:t(`\x1B[2m`,`\x1B[22m`,`\x1B[22m\x1B[2m`),italic:t(`\x1B[3m`,`\x1B[23m`),underline:t(`\x1B[4m`,`\x1B[24m`),inverse:t(`\x1B[7m`,`\x1B[27m`),hidden:t(`\x1B[8m`,`\x1B[28m`),strikethrough:t(`\x1B[9m`,`\x1B[29m`),black:t(`\x1B[30m`,`\x1B[39m`),red:t(`\x1B[31m`,`\x1B[39m`),green:t(`\x1B[32m`,`\x1B[39m`),yellow:t(`\x1B[33m`,`\x1B[39m`),blue:t(`\x1B[34m`,`\x1B[39m`),magenta:t(`\x1B[35m`,`\x1B[39m`),cyan:t(`\x1B[36m`,`\x1B[39m`),white:t(`\x1B[37m`,`\x1B[39m`),gray:t(`\x1B[90m`,`\x1B[39m`),bgBlack:t(`\x1B[40m`,`\x1B[49m`),bgRed:t(`\x1B[41m`,`\x1B[49m`),bgGreen:t(`\x1B[42m`,`\x1B[49m`),bgYellow:t(`\x1B[43m`,`\x1B[49m`),bgBlue:t(`\x1B[44m`,`\x1B[49m`),bgMagenta:t(`\x1B[45m`,`\x1B[49m`),bgCyan:t(`\x1B[46m`,`\x1B[49m`),bgWhite:t(`\x1B[47m`,`\x1B[49m`),blackBright:t(`\x1B[90m`,`\x1B[39m`),redBright:t(`\x1B[91m`,`\x1B[39m`),greenBright:t(`\x1B[92m`,`\x1B[39m`),yellowBright:t(`\x1B[93m`,`\x1B[39m`),blueBright:t(`\x1B[94m`,`\x1B[39m`),magentaBright:t(`\x1B[95m`,`\x1B[39m`),cyanBright:t(`\x1B[96m`,`\x1B[39m`),whiteBright:t(`\x1B[97m`,`\x1B[39m`),bgBlackBright:t(`\x1B[100m`,`\x1B[49m`),bgRedBright:t(`\x1B[101m`,`\x1B[49m`),bgGreenBright:t(`\x1B[102m`,`\x1B[49m`),bgYellowBright:t(`\x1B[103m`,`\x1B[49m`),bgBlueBright:t(`\x1B[104m`,`\x1B[49m`),bgMagentaBright:t(`\x1B[105m`,`\x1B[49m`),bgCyanBright:t(`\x1B[106m`,`\x1B[49m`),bgWhiteBright:t(`\x1B[107m`,`\x1B[49m`)}};t.exports=c(),t.exports.createColors=c})),J=wu(),Y=/* @__PURE__ */ w(Tu(),1);function Eu({onlyFirst:e=!1}={}){let t=[`[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))`,`(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))`].join(`|`);return new RegExp(t,e?void 0:`g`)}const Du=Eu();function Ou(e){if(typeof e!=`string`)throw TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(Du,``)}function ku(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var Au={exports:{}};(function(e){var t={};e.exports=t,t.eastAsianWidth=function(e){var t=e.charCodeAt(0),n=e.length==2?e.charCodeAt(1):0,r=t;return 55296<=t&&t<=56319&&56320<=n&&n<=57343&&(t&=1023,n&=1023,r=t<<10|n,r+=65536),r==12288||65281<=r&&r<=65376||65504<=r&&r<=65510?`F`:r==8361||65377<=r&&r<=65470||65474<=r&&r<=65479||65482<=r&&r<=65487||65490<=r&&r<=65495||65498<=r&&r<=65500||65512<=r&&r<=65518?`H`:4352<=r&&r<=4447||4515<=r&&r<=4519||4602<=r&&r<=4607||9001<=r&&r<=9002||11904<=r&&r<=11929||11931<=r&&r<=12019||12032<=r&&r<=12245||12272<=r&&r<=12283||12289<=r&&r<=12350||12353<=r&&r<=12438||12441<=r&&r<=12543||12549<=r&&r<=12589||12593<=r&&r<=12686||12688<=r&&r<=12730||12736<=r&&r<=12771||12784<=r&&r<=12830||12832<=r&&r<=12871||12880<=r&&r<=13054||13056<=r&&r<=19903||19968<=r&&r<=42124||42128<=r&&r<=42182||43360<=r&&r<=43388||44032<=r&&r<=55203||55216<=r&&r<=55238||55243<=r&&r<=55291||63744<=r&&r<=64255||65040<=r&&r<=65049||65072<=r&&r<=65106||65108<=r&&r<=65126||65128<=r&&r<=65131||110592<=r&&r<=110593||127488<=r&&r<=127490||127504<=r&&r<=127546||127552<=r&&r<=127560||127568<=r&&r<=127569||131072<=r&&r<=194367||177984<=r&&r<=196605||196608<=r&&r<=262141?`W`:32<=r&&r<=126||162<=r&&r<=163||165<=r&&r<=166||r==172||r==175||10214<=r&&r<=10221||10629<=r&&r<=10630?`Na`:r==161||r==164||167<=r&&r<=168||r==170||173<=r&&r<=174||176<=r&&r<=180||182<=r&&r<=186||188<=r&&r<=191||r==198||r==208||215<=r&&r<=216||222<=r&&r<=225||r==230||232<=r&&r<=234||236<=r&&r<=237||r==240||242<=r&&r<=243||247<=r&&r<=250||r==252||r==254||r==257||r==273||r==275||r==283||294<=r&&r<=295||r==299||305<=r&&r<=307||r==312||319<=r&&r<=322||r==324||328<=r&&r<=331||r==333||338<=r&&r<=339||358<=r&&r<=359||r==363||r==462||r==464||r==466||r==468||r==470||r==472||r==474||r==476||r==593||r==609||r==708||r==711||713<=r&&r<=715||r==717||r==720||728<=r&&r<=731||r==733||r==735||768<=r&&r<=879||913<=r&&r<=929||931<=r&&r<=937||945<=r&&r<=961||963<=r&&r<=969||r==1025||1040<=r&&r<=1103||r==1105||r==8208||8211<=r&&r<=8214||8216<=r&&r<=8217||8220<=r&&r<=8221||8224<=r&&r<=8226||8228<=r&&r<=8231||r==8240||8242<=r&&r<=8243||r==8245||r==8251||r==8254||r==8308||r==8319||8321<=r&&r<=8324||r==8364||r==8451||r==8453||r==8457||r==8467||r==8470||8481<=r&&r<=8482||r==8486||r==8491||8531<=r&&r<=8532||8539<=r&&r<=8542||8544<=r&&r<=8555||8560<=r&&r<=8569||r==8585||8592<=r&&r<=8601||8632<=r&&r<=8633||r==8658||r==8660||r==8679||r==8704||8706<=r&&r<=8707||8711<=r&&r<=8712||r==8715||r==8719||r==8721||r==8725||r==8730||8733<=r&&r<=8736||r==8739||r==8741||8743<=r&&r<=8748||r==8750||8756<=r&&r<=8759||8764<=r&&r<=8765||r==8776||r==8780||r==8786||8800<=r&&r<=8801||8804<=r&&r<=8807||8810<=r&&r<=8811||8814<=r&&r<=8815||8834<=r&&r<=8835||8838<=r&&r<=8839||r==8853||r==8857||r==8869||r==8895||r==8978||9312<=r&&r<=9449||9451<=r&&r<=9547||9552<=r&&r<=9587||9600<=r&&r<=9615||9618<=r&&r<=9621||9632<=r&&r<=9633||9635<=r&&r<=9641||9650<=r&&r<=9651||9654<=r&&r<=9655||9660<=r&&r<=9661||9664<=r&&r<=9665||9670<=r&&r<=9672||r==9675||9678<=r&&r<=9681||9698<=r&&r<=9701||r==9711||9733<=r&&r<=9734||r==9737||9742<=r&&r<=9743||9748<=r&&r<=9749||r==9756||r==9758||r==9792||r==9794||9824<=r&&r<=9825||9827<=r&&r<=9829||9831<=r&&r<=9834||9836<=r&&r<=9837||r==9839||9886<=r&&r<=9887||9918<=r&&r<=9919||9924<=r&&r<=9933||9935<=r&&r<=9953||r==9955||9960<=r&&r<=9983||r==10045||r==10071||10102<=r&&r<=10111||11093<=r&&r<=11097||12872<=r&&r<=12879||57344<=r&&r<=63743||65024<=r&&r<=65039||r==65533||127232<=r&&r<=127242||127248<=r&&r<=127277||127280<=r&&r<=127337||127344<=r&&r<=127386||917760<=r&&r<=917999||983040<=r&&r<=1048573||1048576<=r&&r<=1114109?`A`:`N`},t.characterLength=function(e){var t=this.eastAsianWidth(e);return t==`F`||t==`W`||t==`A`?2:1};function n(e){return e.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}t.length=function(e){for(var t=n(e),r=0,i=0;i<t.length;i++)r+=this.characterLength(t[i]);return r},t.slice=function(e,r,i){textLen=t.length(e),r||=0,i||=1,r<0&&(r=textLen+r),i<0&&(i=textLen+i);for(var a=``,o=0,s=n(e),c=0;c<s.length;c++){var l=s[c],u=t.length(l);if(o>=r-+(u==2)){if(o+u<=i)a+=l;else break}o+=u}return a}})(Au);var ju=Au.exports;const Mu=ku(ju),Nu=ku(function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g});function Pu(e,t={}){if(typeof e!=`string`||e.length===0||(t={ambiguousIsNarrow:!0,...t},e=Ou(e),e.length===0))return 0;e=e.replace(Nu(),` `);let n=t.ambiguousIsNarrow?1:2,r=0;for(let t of e){let e=t.codePointAt(0);if(!(e<=31||e>=127&&e<=159||e>=768&&e<=879))switch(Mu.eastAsianWidth(t)){case`F`:case`W`:r+=2;break;case`A`:r+=n;break;default:r+=1}}return r}const Fu=(e=0)=>t=>`\x1B[${t+e}m`,Iu=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,Lu=(e=0)=>(t,n,r)=>`\x1B[${38+e};2;${t};${n};${r}m`,X={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]}};Object.keys(X.modifier);const Ru=Object.keys(X.color),zu=Object.keys(X.bgColor);[...Ru,...zu];function Bu(){let e=/* @__PURE__ */ new Map;for(let[t,n]of Object.entries(X)){for(let[t,r]of Object.entries(n))X[t]={open:`\x1B[${r[0]}m`,close:`\x1B[${r[1]}m`},n[t]=X[t],e.set(r[0],r[1]);Object.defineProperty(X,t,{value:n,enumerable:!1})}return Object.defineProperty(X,"codes",{value:e,enumerable:!1}),X.color.close=`\x1B[39m`,X.bgColor.close=`\x1B[49m`,X.color.ansi=Fu(),X.color.ansi256=Iu(),X.color.ansi16m=Lu(),X.bgColor.ansi=Fu(10),X.bgColor.ansi256=Iu(10),X.bgColor.ansi16m=Lu(10),Object.defineProperties(X,{rgbToAnsi256:{value:(e,t,n)=>e===t&&t===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value:e=>{let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[n]=t;n.length===3&&(n=[...n].map(e=>e+e).join(``));let r=Number.parseInt(n,16);return[r>>16&255,r>>8&255,r&255]},enumerable:!1},hexToAnsi256:{value:e=>X.rgbToAnsi256(...X.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value:e=>{if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,n,r;if(e>=232)t=((e-232)*10+8)/255,n=t,r=t;else{e-=16;let i=e%36;t=Math.floor(e/36)/5,n=Math.floor(i/6)/5,r=i%6/5}let i=Math.max(t,n,r)*2;if(i===0)return 30;let a=30+(Math.round(r)<<2|Math.round(n)<<1|Math.round(t));return i===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(e,t,n)=>X.ansi256ToAnsi(X.rgbToAnsi256(e,t,n)),enumerable:!1},hexToAnsi:{value:e=>X.ansi256ToAnsi(X.hexToAnsi256(e)),enumerable:!1}}),X}const Vu=Bu(),Hu=/* @__PURE__ */ new Set([`\x1B`,`›`]),Uu=`]8;;`,Wu=e=>`${Hu.values().next().value}[${e}m`,Gu=e=>`${Hu.values().next().value}${Uu}${e}`,Ku=e=>e.split(` `).map(e=>Pu(e)),qu=(e,t,n)=>{let r=[...t],i=!1,a=!1,o=Pu(Ou(e[e.length-1]));for(let[t,s]of r.entries()){let c=Pu(s);o+c<=n?e[e.length-1]+=s:(e.push(s),o=0),Hu.has(s)&&(i=!0,a=r.slice(t+1).join(``).startsWith(Uu)),i?a?s===`\x07`&&(i=!1,a=!1):s===`m`&&(i=!1):(o+=c,o===n&&t<r.length-1&&(e.push(``),o=0))}!o&&e[e.length-1].length>0&&e.length>1&&(e[e.length-2]+=e.pop())},Ju=e=>{let t=e.split(` `),n=t.length;for(;n>0&&!(Pu(t[n-1])>0);)n--;return n===t.length?e:t.slice(0,n).join(` `)+t.slice(n).join(``)},Yu=(e,t,n={})=>{if(n.trim!==!1&&e.trim()===``)return``;let r=``,i,a,o=Ku(e),s=[``];for(let[r,i]of e.split(` `).entries()){n.trim!==!1&&(s[s.length-1]=s[s.length-1].trimStart());let e=Pu(s[s.length-1]);if(r!==0&&(e>=t&&(n.wordWrap===!1||n.trim===!1)&&(s.push(``),e=0),(e>0||n.trim===!1)&&(s[s.length-1]+=` `,e++)),n.hard&&o[r]>t){let n=t-e,a=1+Math.floor((o[r]-n-1)/t);Math.floor((o[r]-1)/t)<a&&s.push(``),qu(s,i,t)}else{if(e+o[r]>t&&e>0&&o[r]>0){if(n.wordWrap===!1&&e<t){qu(s,i,t);continue}s.push(``)}e+o[r]>t&&n.wordWrap===!1?qu(s,i,t):s[s.length-1]+=i}}n.trim!==!1&&(s=s.map(e=>Ju(e)));let c=[...s.join(`
156
+ `)];for(let[e,t]of c.entries()){if(r+=t,Hu.has(t)){let{groups:t}=RegExp(`(?:\\[(?<code>\\d+)m|\\${Uu}(?<uri>.*))`).exec(c.slice(e).join(``))||{groups:{}};if(t.code!==void 0){let e=Number.parseFloat(t.code);i=e===39?void 0:e}else t.uri!==void 0&&(a=t.uri.length===0?void 0:t.uri)}let n=Vu.codes.get(Number(i));c[e+1]===`
157
+ `?(a&&(r+=Gu(``)),i&&n&&(r+=Wu(n))):t===`
158
+ `&&(i&&n&&(r+=Wu(i)),a&&(r+=Gu(a)))}return r};function Xu(e,t,n){return String(e).normalize().replace(/\r\n/g,`
159
159
  `).split(`
160
- `).map(e=>qu(e,t,n)).join(`
161
- `)}const Yu={actions:/* @__PURE__ */ new Set([`up`,`down`,`left`,`right`,`space`,`enter`,`cancel`]),aliases:/* @__PURE__ */ new Map([[`k`,`up`],[`j`,`down`],[`h`,`left`],[`l`,`right`],[``,`cancel`],[`escape`,`cancel`]])};function Xu(e,t){if(typeof e==`string`)return Yu.aliases.get(e)===t;for(let n of e)if(n!==void 0&&Xu(n,t))return!0;return!1}function Zu(e,t){if(e===t)return;let n=e.split(`
160
+ `).map(e=>Yu(e,t,n)).join(`
161
+ `)}const Zu={actions:/* @__PURE__ */ new Set([`up`,`down`,`left`,`right`,`space`,`enter`,`cancel`]),aliases:/* @__PURE__ */ new Map([[`k`,`up`],[`j`,`down`],[`h`,`left`],[`l`,`right`],[``,`cancel`],[`escape`,`cancel`]])};function Qu(e,t){if(typeof e==`string`)return Zu.aliases.get(e)===t;for(let n of e)if(n!==void 0&&Qu(n,t))return!0;return!1}function $u(e,t){if(e===t)return;let n=e.split(`
162
162
  `),r=t.split(`
163
- `),i=[];for(let e=0;e<Math.max(n.length,r.length);e++)n[e]!==r[e]&&i.push(e);return i}const Qu=globalThis.process.platform.startsWith(`win`),$u=Symbol(`clack:cancel`);function ed(e){return e===$u}function td(e,t){let n=e;n.isTTY&&n.setRawMode(t)}function nd({input:e=f,output:t=p,overwrite:n=!0,hideCursor:r=!0}={}){let i=h.createInterface({input:e,output:t,prompt:``,tabSize:1});h.emitKeypressEvents(e,i),e.isTTY&&e.setRawMode(!0);let a=(i,{name:o,sequence:s})=>{if(Xu([String(i),o,s],`cancel`)){r&&t.write(J.cursor.show),process.exit(0);return}if(!n)return;let c=o===`return`?0:-1,l=o===`return`?-1:0;h.moveCursor(t,c,l,()=>{h.clearLine(t,1,()=>{e.once(`keypress`,a)})})};return r&&t.write(J.cursor.hide),e.once(`keypress`,a),()=>{e.off(`keypress`,a),r&&t.write(J.cursor.show),e.isTTY&&!Qu&&e.setRawMode(!1),i.terminal=!1,i.close()}}var rd=Object.defineProperty,id=(e,t,n)=>t in e?rd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Z=(e,t,n)=>(id(e,typeof t==`symbol`?t:t+``,n),n),ad=class{constructor(e,t=!0){Z(this,`input`),Z(this,`output`),Z(this,`_abortSignal`),Z(this,`rl`),Z(this,`opts`),Z(this,`_render`),Z(this,`_track`,!1),Z(this,`_prevFrame`,``),Z(this,`_subscribers`,/* @__PURE__ */ new Map),Z(this,`_cursor`,0),Z(this,`state`,`initial`),Z(this,`error`,``),Z(this,`value`);let{input:n=f,output:r=p,render:i,signal:a,...o}=e;this.opts=o,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=i.bind(this),this._track=t,this._abortSignal=a,this.input=n,this.output=r}unsubscribe(){this._subscribers.clear()}setSubscriber(e,t){let n=this._subscribers.get(e)??[];n.push(t),this._subscribers.set(e,n)}on(e,t){this.setSubscriber(e,{cb:t})}once(e,t){this.setSubscriber(e,{cb:t,once:!0})}emit(e,...t){let n=this._subscribers.get(e)??[],r=[];for(let e of n)e.cb(...t),e.once&&r.push(()=>n.splice(n.indexOf(e),1));for(let e of r)e()}prompt(){return new Promise((e,t)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state=`cancel`,this.close(),e($u);this._abortSignal.addEventListener(`abort`,()=>{this.state=`cancel`,this.close()},{once:!0})}let n=new u;n._write=(e,t,n)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,``),this._cursor=this.rl?.cursor??0,this.emit(`value`,this.value)),n()},this.input.pipe(n),this.rl=m.createInterface({input:this.input,output:n,tabSize:2,prompt:``,escapeCodeTimeout:50,terminal:!0}),m.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on(`keypress`,this.onKeypress),td(this.input,!0),this.output.on(`resize`,this.render),this.render(),this.once(`submit`,()=>{this.output.write(J.cursor.show),this.output.off(`resize`,this.render),td(this.input,!1),e(this.value)}),this.once(`cancel`,()=>{this.output.write(J.cursor.show),this.output.off(`resize`,this.render),td(this.input,!1),e($u)})})}onKeypress(e,t){if(this.state===`error`&&(this.state=`active`),t?.name&&(!this._track&&Yu.aliases.has(t.name)&&this.emit(`cursor`,Yu.aliases.get(t.name)),Yu.actions.has(t.name)&&this.emit(`cursor`,t.name)),e&&(e.toLowerCase()===`y`||e.toLowerCase()===`n`)&&this.emit(`confirm`,e.toLowerCase()===`y`),e===` `&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit(`value`,this.opts.placeholder))),e&&this.emit(`key`,e.toLowerCase()),t?.name===`return`){if(this.opts.validate){let e=this.opts.validate(this.value);e&&(this.error=e instanceof Error?e.message:e,this.state=`error`,this.rl?.write(this.value))}this.state!==`error`&&(this.state=`submit`)}Xu([e,t?.name,t?.sequence],`cancel`)&&(this.state=`cancel`),(this.state===`submit`||this.state===`cancel`)&&this.emit(`finalize`),this.render(),(this.state===`submit`||this.state===`cancel`)&&this.close()}close(){this.input.unpipe(),this.input.removeListener(`keypress`,this.onKeypress),this.output.write(`
164
- `),td(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let e=Ju(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
165
- `).length-1;this.output.write(J.cursor.move(-999,e*-1))}render(){let e=Ju(this._render(this)??``,process.stdout.columns,{hard:!0});if(e!==this._prevFrame){if(this.state===`initial`)this.output.write(J.cursor.hide);else{let t=Zu(this._prevFrame,e);if(this.restoreCursor(),t&&t?.length===1){let n=t[0];this.output.write(J.cursor.move(0,n)),this.output.write(J.erase.lines(1));let r=e.split(`
163
+ `),i=[];for(let e=0;e<Math.max(n.length,r.length);e++)n[e]!==r[e]&&i.push(e);return i}const ed=globalThis.process.platform.startsWith(`win`),td=Symbol(`clack:cancel`);function nd(e){return e===td}function rd(e,t){let n=e;n.isTTY&&n.setRawMode(t)}function id({input:e=f,output:t=p,overwrite:n=!0,hideCursor:r=!0}={}){let i=h.createInterface({input:e,output:t,prompt:``,tabSize:1});h.emitKeypressEvents(e,i),e.isTTY&&e.setRawMode(!0);let a=(i,{name:o,sequence:s})=>{if(Qu([String(i),o,s],`cancel`)){r&&t.write(J.cursor.show),process.exit(0);return}if(!n)return;let c=o===`return`?0:-1,l=o===`return`?-1:0;h.moveCursor(t,c,l,()=>{h.clearLine(t,1,()=>{e.once(`keypress`,a)})})};return r&&t.write(J.cursor.hide),e.once(`keypress`,a),()=>{e.off(`keypress`,a),r&&t.write(J.cursor.show),e.isTTY&&!ed&&e.setRawMode(!1),i.terminal=!1,i.close()}}var ad=Object.defineProperty,od=(e,t,n)=>t in e?ad(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Z=(e,t,n)=>(od(e,typeof t==`symbol`?t:t+``,n),n),sd=class{constructor(e,t=!0){Z(this,`input`),Z(this,`output`),Z(this,`_abortSignal`),Z(this,`rl`),Z(this,`opts`),Z(this,`_render`),Z(this,`_track`,!1),Z(this,`_prevFrame`,``),Z(this,`_subscribers`,/* @__PURE__ */ new Map),Z(this,`_cursor`,0),Z(this,`state`,`initial`),Z(this,`error`,``),Z(this,`value`);let{input:n=f,output:r=p,render:i,signal:a,...o}=e;this.opts=o,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=i.bind(this),this._track=t,this._abortSignal=a,this.input=n,this.output=r}unsubscribe(){this._subscribers.clear()}setSubscriber(e,t){let n=this._subscribers.get(e)??[];n.push(t),this._subscribers.set(e,n)}on(e,t){this.setSubscriber(e,{cb:t})}once(e,t){this.setSubscriber(e,{cb:t,once:!0})}emit(e,...t){let n=this._subscribers.get(e)??[],r=[];for(let e of n)e.cb(...t),e.once&&r.push(()=>n.splice(n.indexOf(e),1));for(let e of r)e()}prompt(){return new Promise((e,t)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state=`cancel`,this.close(),e(td);this._abortSignal.addEventListener(`abort`,()=>{this.state=`cancel`,this.close()},{once:!0})}let n=new u;n._write=(e,t,n)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,``),this._cursor=this.rl?.cursor??0,this.emit(`value`,this.value)),n()},this.input.pipe(n),this.rl=m.createInterface({input:this.input,output:n,tabSize:2,prompt:``,escapeCodeTimeout:50,terminal:!0}),m.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on(`keypress`,this.onKeypress),rd(this.input,!0),this.output.on(`resize`,this.render),this.render(),this.once(`submit`,()=>{this.output.write(J.cursor.show),this.output.off(`resize`,this.render),rd(this.input,!1),e(this.value)}),this.once(`cancel`,()=>{this.output.write(J.cursor.show),this.output.off(`resize`,this.render),rd(this.input,!1),e(td)})})}onKeypress(e,t){if(this.state===`error`&&(this.state=`active`),t?.name&&(!this._track&&Zu.aliases.has(t.name)&&this.emit(`cursor`,Zu.aliases.get(t.name)),Zu.actions.has(t.name)&&this.emit(`cursor`,t.name)),e&&(e.toLowerCase()===`y`||e.toLowerCase()===`n`)&&this.emit(`confirm`,e.toLowerCase()===`y`),e===` `&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit(`value`,this.opts.placeholder))),e&&this.emit(`key`,e.toLowerCase()),t?.name===`return`){if(this.opts.validate){let e=this.opts.validate(this.value);e&&(this.error=e instanceof Error?e.message:e,this.state=`error`,this.rl?.write(this.value))}this.state!==`error`&&(this.state=`submit`)}Qu([e,t?.name,t?.sequence],`cancel`)&&(this.state=`cancel`),(this.state===`submit`||this.state===`cancel`)&&this.emit(`finalize`),this.render(),(this.state===`submit`||this.state===`cancel`)&&this.close()}close(){this.input.unpipe(),this.input.removeListener(`keypress`,this.onKeypress),this.output.write(`
164
+ `),rd(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let e=Xu(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
165
+ `).length-1;this.output.write(J.cursor.move(-999,e*-1))}render(){let e=Xu(this._render(this)??``,process.stdout.columns,{hard:!0});if(e!==this._prevFrame){if(this.state===`initial`)this.output.write(J.cursor.hide);else{let t=$u(this._prevFrame,e);if(this.restoreCursor(),t&&t?.length===1){let n=t[0];this.output.write(J.cursor.move(0,n)),this.output.write(J.erase.lines(1));let r=e.split(`
166
166
  `);this.output.write(r[n]),this._prevFrame=e,this.output.write(J.cursor.move(0,r.length-n-1));return}if(t&&t?.length>1){let n=t[0];this.output.write(J.cursor.move(0,n)),this.output.write(J.erase.down());let r=e.split(`
167
167
  `).slice(n);this.output.write(r.join(`
168
- `)),this._prevFrame=e;return}this.output.write(J.erase.down())}this.output.write(e),this.state===`initial`&&(this.state=`active`),this._prevFrame=e}}},od=class extends ad{get cursor(){return+!this.value}get _value(){return this.cursor===0}constructor(e){super(e,!1),this.value=!!e.initialValue,this.on(`value`,()=>{this.value=this._value}),this.on(`confirm`,e=>{this.output.write(J.cursor.move(0,-1)),this.value=e,this.state=`submit`,this.close()}),this.on(`cursor`,()=>{this.value=!this.value})}},sd=Object.defineProperty,cd=(e,t,n)=>t in e?sd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ld=(e,t,n)=>(cd(e,typeof t==`symbol`?t:t+``,n),n),ud=class extends ad{constructor(e){super(e,!1),ld(this,`options`),ld(this,`cursor`,0),this.options=e.options,this.cursor=this.options.findIndex(({value:t})=>t===e.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on(`cursor`,e=>{switch(e){case`left`:case`up`:this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case`down`:case`right`:this.cursor=this.cursor===this.options.length-1?0:this.cursor+1}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}},dd=class extends ad{get valueWithCursor(){if(this.state===`submit`)return this.value;if(this.cursor>=this.value.length)return`${this.value}\u2588`;let e=this.value.slice(0,this.cursor),[t,...n]=this.value.slice(this.cursor);return`${e}${Y.default.inverse(t)}${n.join(``)}`}get cursor(){return this._cursor}constructor(e){super(e),this.on(`finalize`,()=>{this.value||=e.defaultValue})}};function fd(){return d.platform===`win32`?!!d.env.CI||!!d.env.WT_SESSION||!!d.env.TERMINUS_SUBLIME||d.env.ConEmuTask===`{cmd::Cmder}`||d.env.TERM_PROGRAM===`Terminus-Sublime`||d.env.TERM_PROGRAM===`vscode`||d.env.TERM===`xterm-256color`||d.env.TERM===`alacritty`||d.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`:d.env.TERM!==`linux`}const pd=fd(),Q=(e,t)=>pd?e:t,md=Q(`◆`,`*`),hd=Q(`■`,`x`),gd=Q(`▲`,`x`),_d=Q(`◇`,`o`),$=Q(`│`,`|`),vd=Q(`└`,`—`),yd=Q(`●`,`>`),bd=Q(`○`,` `),xd=Q(`─`,`-`),Sd=Q(`╮`,`+`),Cd=Q(`├`,`+`),wd=Q(`╯`,`+`),Td=Q(`●`,`•`),Ed=Q(`◆`,`*`),Dd=Q(`▲`,`!`),Od=Q(`■`,`x`),kd=e=>{switch(e){case`initial`:case`active`:return Y.default.cyan(md);case`cancel`:return Y.default.red(hd);case`error`:return Y.default.yellow(gd);case`submit`:return Y.default.green(_d)}},Ad=e=>{let{cursor:t,options:n,style:r}=e,i=e.maxItems??1/0,a=Math.max(process.stdout.rows-4,0),o=Math.min(a,Math.max(i,5)),s=0;t>=s+o-3?s=Math.max(Math.min(t-o+3,n.length-o),0):t<s+2&&(s=Math.max(t-2,0));let c=o<n.length&&s>0,l=o<n.length&&s+o<n.length;return n.slice(s,s+o).map((e,n,i)=>{let a=n===0&&c,o=n===i.length-1&&l;return a||o?Y.default.dim(`...`):r(e,n+s===t)})},jd=e=>new dd({validate:e.validate,placeholder:e.placeholder,defaultValue:e.defaultValue,initialValue:e.initialValue,render(){let t=`${Y.default.gray($)}
169
- ${kd(this.state)} ${e.message}
168
+ `)),this._prevFrame=e;return}this.output.write(J.erase.down())}this.output.write(e),this.state===`initial`&&(this.state=`active`),this._prevFrame=e}}},cd=class extends sd{get cursor(){return+!this.value}get _value(){return this.cursor===0}constructor(e){super(e,!1),this.value=!!e.initialValue,this.on(`value`,()=>{this.value=this._value}),this.on(`confirm`,e=>{this.output.write(J.cursor.move(0,-1)),this.value=e,this.state=`submit`,this.close()}),this.on(`cursor`,()=>{this.value=!this.value})}},ld=Object.defineProperty,ud=(e,t,n)=>t in e?ld(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dd=(e,t,n)=>(ud(e,typeof t==`symbol`?t:t+``,n),n),fd=class extends sd{constructor(e){super(e,!1),dd(this,`options`),dd(this,`cursor`,0),this.options=e.options,this.cursor=this.options.findIndex(({value:t})=>t===e.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on(`cursor`,e=>{switch(e){case`left`:case`up`:this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case`down`:case`right`:this.cursor=this.cursor===this.options.length-1?0:this.cursor+1}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}},pd=class extends sd{get valueWithCursor(){if(this.state===`submit`)return this.value;if(this.cursor>=this.value.length)return`${this.value}\u2588`;let e=this.value.slice(0,this.cursor),[t,...n]=this.value.slice(this.cursor);return`${e}${Y.default.inverse(t)}${n.join(``)}`}get cursor(){return this._cursor}constructor(e){super(e),this.on(`finalize`,()=>{this.value||=e.defaultValue})}};function md(){return d.platform===`win32`?!!d.env.CI||!!d.env.WT_SESSION||!!d.env.TERMINUS_SUBLIME||d.env.ConEmuTask===`{cmd::Cmder}`||d.env.TERM_PROGRAM===`Terminus-Sublime`||d.env.TERM_PROGRAM===`vscode`||d.env.TERM===`xterm-256color`||d.env.TERM===`alacritty`||d.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`:d.env.TERM!==`linux`}const hd=md(),Q=(e,t)=>hd?e:t,gd=Q(`◆`,`*`),_d=Q(`■`,`x`),vd=Q(`▲`,`x`),yd=Q(`◇`,`o`),$=Q(`│`,`|`),bd=Q(`└`,`—`),xd=Q(`●`,`>`),Sd=Q(`○`,` `),Cd=Q(`─`,`-`),wd=Q(`╮`,`+`),Td=Q(`├`,`+`),Ed=Q(`╯`,`+`),Dd=Q(`●`,`•`),Od=Q(`◆`,`*`),kd=Q(`▲`,`!`),Ad=Q(`■`,`x`),jd=e=>{switch(e){case`initial`:case`active`:return Y.default.cyan(gd);case`cancel`:return Y.default.red(_d);case`error`:return Y.default.yellow(vd);case`submit`:return Y.default.green(yd)}},Md=e=>{let{cursor:t,options:n,style:r}=e,i=e.maxItems??1/0,a=Math.max(process.stdout.rows-4,0),o=Math.min(a,Math.max(i,5)),s=0;t>=s+o-3?s=Math.max(Math.min(t-o+3,n.length-o),0):t<s+2&&(s=Math.max(t-2,0));let c=o<n.length&&s>0,l=o<n.length&&s+o<n.length;return n.slice(s,s+o).map((e,n,i)=>{let a=n===0&&c,o=n===i.length-1&&l;return a||o?Y.default.dim(`...`):r(e,n+s===t)})},Nd=e=>new pd({validate:e.validate,placeholder:e.placeholder,defaultValue:e.defaultValue,initialValue:e.initialValue,render(){let t=`${Y.default.gray($)}
169
+ ${jd(this.state)} ${e.message}
170
170
  `,n=e.placeholder?Y.default.inverse(e.placeholder[0])+Y.default.dim(e.placeholder.slice(1)):Y.default.inverse(Y.default.hidden(`_`)),r=this.value?this.valueWithCursor:n;switch(this.state){case`error`:return`${t.trim()}
171
171
  ${Y.default.yellow($)} ${r}
172
- ${Y.default.yellow(vd)} ${Y.default.yellow(this.error)}
172
+ ${Y.default.yellow(bd)} ${Y.default.yellow(this.error)}
173
173
  `;case`submit`:return`${t}${Y.default.gray($)} ${Y.default.dim(this.value||e.placeholder)}`;case`cancel`:return`${t}${Y.default.gray($)} ${Y.default.strikethrough(Y.default.dim(this.value??``))}${this.value?.trim()?`
174
174
  ${Y.default.gray($)}`:``}`;default:return`${t}${Y.default.cyan($)} ${r}
175
- ${Y.default.cyan(vd)}
176
- `}}}).prompt(),Md=e=>{let t=e.active??`Yes`,n=e.inactive??`No`;return new od({active:t,inactive:n,initialValue:e.initialValue??!0,render(){let r=`${Y.default.gray($)}
177
- ${kd(this.state)} ${e.message}
175
+ ${Y.default.cyan(bd)}
176
+ `}}}).prompt(),Pd=e=>{let t=e.active??`Yes`,n=e.inactive??`No`;return new cd({active:t,inactive:n,initialValue:e.initialValue??!0,render(){let r=`${Y.default.gray($)}
177
+ ${jd(this.state)} ${e.message}
178
178
  `,i=this.value?t:n;switch(this.state){case`submit`:return`${r}${Y.default.gray($)} ${Y.default.dim(i)}`;case`cancel`:return`${r}${Y.default.gray($)} ${Y.default.strikethrough(Y.default.dim(i))}
179
- ${Y.default.gray($)}`;default:return`${r}${Y.default.cyan($)} ${this.value?`${Y.default.green(yd)} ${t}`:`${Y.default.dim(bd)} ${Y.default.dim(t)}`} ${Y.default.dim(`/`)} ${this.value?`${Y.default.dim(bd)} ${Y.default.dim(n)}`:`${Y.default.green(yd)} ${n}`}
180
- ${Y.default.cyan(vd)}
181
- `}}}).prompt()},Nd=e=>{let t=(e,t)=>{let n=e.label??String(e.value);switch(t){case`selected`:return`${Y.default.dim(n)}`;case`active`:return`${Y.default.green(yd)} ${n} ${e.hint?Y.default.dim(`(${e.hint})`):``}`;case`cancelled`:return`${Y.default.strikethrough(Y.default.dim(n))}`;default:return`${Y.default.dim(bd)} ${Y.default.dim(n)}`}};return new ud({options:e.options,initialValue:e.initialValue,render(){let n=`${Y.default.gray($)}
182
- ${kd(this.state)} ${e.message}
179
+ ${Y.default.gray($)}`;default:return`${r}${Y.default.cyan($)} ${this.value?`${Y.default.green(xd)} ${t}`:`${Y.default.dim(Sd)} ${Y.default.dim(t)}`} ${Y.default.dim(`/`)} ${this.value?`${Y.default.dim(Sd)} ${Y.default.dim(n)}`:`${Y.default.green(xd)} ${n}`}
180
+ ${Y.default.cyan(bd)}
181
+ `}}}).prompt()},Fd=e=>{let t=(e,t)=>{let n=e.label??String(e.value);switch(t){case`selected`:return`${Y.default.dim(n)}`;case`active`:return`${Y.default.green(xd)} ${n} ${e.hint?Y.default.dim(`(${e.hint})`):``}`;case`cancelled`:return`${Y.default.strikethrough(Y.default.dim(n))}`;default:return`${Y.default.dim(Sd)} ${Y.default.dim(n)}`}};return new fd({options:e.options,initialValue:e.initialValue,render(){let n=`${Y.default.gray($)}
182
+ ${jd(this.state)} ${e.message}
183
183
  `;switch(this.state){case`submit`:return`${n}${Y.default.gray($)} ${t(this.options[this.cursor],`selected`)}`;case`cancel`:return`${n}${Y.default.gray($)} ${t(this.options[this.cursor],`cancelled`)}
184
- ${Y.default.gray($)}`;default:return`${n}${Y.default.cyan($)} ${Ad({cursor:this.cursor,options:this.options,maxItems:e.maxItems,style:(e,n)=>t(e,n?`active`:`inactive`)}).join(`
184
+ ${Y.default.gray($)}`;default:return`${n}${Y.default.cyan($)} ${Md({cursor:this.cursor,options:this.options,maxItems:e.maxItems,style:(e,n)=>t(e,n?`active`:`inactive`)}).join(`
185
185
  ${Y.default.cyan($)} `)}
186
- ${Y.default.cyan(vd)}
187
- `}}}).prompt()},Pd=(e=``,t=``)=>{let r=`
186
+ ${Y.default.cyan(bd)}
187
+ `}}}).prompt()},Id=(e=``,t=``)=>{let r=`
188
188
  ${e}
189
189
  `.split(`
190
190
  `),i=n(t).length,a=Math.max(r.reduce((e,t)=>{let r=n(t);return r.length>e?r.length:e},0),i)+2,o=r.map(e=>`${Y.default.gray($)} ${Y.default.dim(e)}${` `.repeat(a-n(e).length)}${Y.default.gray($)}`).join(`
191
191
  `);process.stdout.write(`${Y.default.gray($)}
192
- ${Y.default.green(_d)} ${Y.default.reset(t)} ${Y.default.gray(xd.repeat(Math.max(a-i-1,1))+Sd)}
192
+ ${Y.default.green(yd)} ${Y.default.reset(t)} ${Y.default.gray(Cd.repeat(Math.max(a-i-1,1))+wd)}
193
193
  ${o}
194
- ${Y.default.gray(Cd+xd.repeat(a+2)+wd)}
195
- `)},Fd=(e=``)=>{process.stdout.write(`${Y.default.gray(vd)} ${Y.default.red(e)}
194
+ ${Y.default.gray(Td+Cd.repeat(a+2)+Ed)}
195
+ `)},Ld=(e=``)=>{process.stdout.write(`${Y.default.gray(bd)} ${Y.default.red(e)}
196
196
 
197
- `)},Id={message:(e=``,{symbol:t=Y.default.gray($)}={})=>{let n=[`${Y.default.gray($)}`];if(e){let[r,...i]=e.split(`
197
+ `)},Rd={message:(e=``,{symbol:t=Y.default.gray($)}={})=>{let n=[`${Y.default.gray($)}`];if(e){let[r,...i]=e.split(`
198
198
  `);n.push(`${t} ${r}`,...i.map(e=>`${Y.default.gray($)} ${e}`))}process.stdout.write(`${n.join(`
199
199
  `)}
200
- `)},info:e=>{Id.message(e,{symbol:Y.default.blue(Td)})},success:e=>{Id.message(e,{symbol:Y.default.green(Ed)})},step:e=>{Id.message(e,{symbol:Y.default.green(_d)})},warn:e=>{Id.message(e,{symbol:Y.default.yellow(Dd)})},warning:e=>{Id.warn(e)},error:e=>{Id.message(e,{symbol:Y.default.red(Od)})}};`${Y.default.gray($)}`;const Ld=({indicator:e=`dots`}={})=>{let t=pd?[`◒`,`◐`,`◓`,`◑`]:[`•`,`o`,`O`,`0`],n=pd?80:120,r=process.env.CI===`true`,i,a,o=!1,s=``,c,l=performance.now(),u=e=>{o&&y(e>1?`Something went wrong`:`Canceled`,e)},d=()=>u(2),f=()=>u(1),p=()=>{process.on(`uncaughtExceptionMonitor`,d),process.on(`unhandledRejection`,d),process.on(`SIGINT`,f),process.on(`SIGTERM`,f),process.on(`exit`,u)},m=()=>{process.removeListener(`uncaughtExceptionMonitor`,d),process.removeListener(`unhandledRejection`,d),process.removeListener(`SIGINT`,f),process.removeListener(`SIGTERM`,f),process.removeListener(`exit`,u)},h=()=>{if(c===void 0)return;r&&process.stdout.write(`
200
+ `)},info:e=>{Rd.message(e,{symbol:Y.default.blue(Dd)})},success:e=>{Rd.message(e,{symbol:Y.default.green(Od)})},step:e=>{Rd.message(e,{symbol:Y.default.green(yd)})},warn:e=>{Rd.message(e,{symbol:Y.default.yellow(kd)})},warning:e=>{Rd.warn(e)},error:e=>{Rd.message(e,{symbol:Y.default.red(Ad)})}};`${Y.default.gray($)}`;const zd=({indicator:e=`dots`}={})=>{let t=hd?[`◒`,`◐`,`◓`,`◑`]:[`•`,`o`,`O`,`0`],n=hd?80:120,r=process.env.CI===`true`,i,a,o=!1,s=``,c,l=performance.now(),u=e=>{o&&y(e>1?`Something went wrong`:`Canceled`,e)},d=()=>u(2),f=()=>u(1),p=()=>{process.on(`uncaughtExceptionMonitor`,d),process.on(`unhandledRejection`,d),process.on(`SIGINT`,f),process.on(`SIGTERM`,f),process.on(`exit`,u)},m=()=>{process.removeListener(`uncaughtExceptionMonitor`,d),process.removeListener(`unhandledRejection`,d),process.removeListener(`SIGINT`,f),process.removeListener(`SIGTERM`,f),process.removeListener(`exit`,u)},h=()=>{if(c===void 0)return;r&&process.stdout.write(`
201
201
  `);let e=c.split(`
202
- `);process.stdout.write(J.cursor.move(-999,e.length-1)),process.stdout.write(J.erase.down(e.length))},g=e=>e.replace(/\.+$/,``),_=e=>{let t=(performance.now()-e)/1e3,n=Math.floor(t/60),r=Math.floor(t%60);return n>0?`[${n}m ${r}s]`:`[${r}s]`},v=(u=``)=>{o=!0,i=nd(),s=g(u),l=performance.now(),process.stdout.write(`${Y.default.gray($)}
203
- `);let d=0,f=0;p(),a=setInterval(()=>{if(r&&s===c)return;h(),c=s;let n=Y.default.magenta(t[d]);if(r)process.stdout.write(`${n} ${s}...`);else if(e===`timer`)process.stdout.write(`${n} ${s} ${_(l)}`);else{let e=`.`.repeat(Math.floor(f)).slice(0,3);process.stdout.write(`${n} ${s}${e}`)}d=d+1<t.length?d+1:0,f=f<t.length?f+.125:0},n)},y=(t=``,n=0)=>{o=!1,clearInterval(a),h();let r=n===0?Y.default.green(_d):n===1?Y.default.red(hd):Y.default.red(gd);s=g(t??s),e===`timer`?process.stdout.write(`${r} ${s} ${_(l)}
202
+ `);process.stdout.write(J.cursor.move(-999,e.length-1)),process.stdout.write(J.erase.down(e.length))},g=e=>e.replace(/\.+$/,``),_=e=>{let t=(performance.now()-e)/1e3,n=Math.floor(t/60),r=Math.floor(t%60);return n>0?`[${n}m ${r}s]`:`[${r}s]`},v=(u=``)=>{o=!0,i=id(),s=g(u),l=performance.now(),process.stdout.write(`${Y.default.gray($)}
203
+ `);let d=0,f=0;p(),a=setInterval(()=>{if(r&&s===c)return;h(),c=s;let n=Y.default.magenta(t[d]);if(r)process.stdout.write(`${n} ${s}...`);else if(e===`timer`)process.stdout.write(`${n} ${s} ${_(l)}`);else{let e=`.`.repeat(Math.floor(f)).slice(0,3);process.stdout.write(`${n} ${s}${e}`)}d=d+1<t.length?d+1:0,f=f<t.length?f+.125:0},n)},y=(t=``,n=0)=>{o=!1,clearInterval(a),h();let r=n===0?Y.default.green(yd):n===1?Y.default.red(_d):Y.default.red(vd);s=g(t??s),e===`timer`?process.stdout.write(`${r} ${s} ${_(l)}
204
204
  `):process.stdout.write(`${r} ${s}
205
- `),m(),i()};return{start:v,stop:y,message:(e=``)=>{s=g(e??s)}}},Rd={red:e=>Y.default.red(e),green:e=>Y.default.green(e),yellow:e=>Y.default.yellow(e),blue:e=>Y.default.blue(e),cyan:e=>Y.default.cyan(e),magenta:e=>Y.default.magenta(e),gray:e=>Y.default.gray(e),bold:e=>Y.default.bold(e),dim:e=>Y.default.dim(e)},zd={async select(e,t){let n=await Nd({message:e,options:t.map(e=>({value:e.value,label:e.label,hint:e.hint}))});return ed(n)&&(Fd(`操作已取消`),process.exit(0)),typeof n==`string`?n:String(n)},async textInput(e,t){let n=await jd({message:e,placeholder:t?.placeholder,defaultValue:t?.defaultValue});return ed(n)&&(Fd(`操作已取消`),process.exit(0)),typeof n==`string`?n:String(n)},async confirm(e,t){let n=await Md({message:e,initialValue:t?.defaultValue??!1});return ed(n)&&(Fd(`操作已取消`),process.exit(0)),typeof n==`boolean`?n:!!n},spinner(){let e=Ld();return{start(t){e.start(t)},stop(t){e.stop(t)}}},note(e,t){Pd(e,t)},log:{info(e){Id.info(Y.default.blue(e))},success(e){Id.success(Y.default.green(e))},warn(e){Id.warn(Y.default.yellow(e))},error(e){Id.error(Y.default.red(e))},step(e){Id.step(e)}}},Bd=[`dependencies`,`devDependencies`,`peerDependencies`,`optionalDependencies`],Vd=[`dependencies`,`peerDependencies`,`optionalDependencies`],Hd=El(K(),K()),Ud=bl({name:K().optional(),workspaces:Sl([_l(K()),yl({packages:_l(K()).optional()})]).optional(),dependencies:Hd.optional(),devDependencies:Hd.optional(),peerDependencies:Hd.optional(),optionalDependencies:Hd.optional()});function Wd(e){let t=a(e,`utf8`),n=Ud.safeParse(JSON.parse(t));if(!n.success)throw Error(`package.json 结构不符合预期:${e}`);return n.data}function Gd(e){return Object.entries(e??{}).filter(([e])=>e.startsWith(`@longzai-intelligence-oxlint/`))}function Kd(e,t){let n=Array.isArray(t)?t:t?.packages??[],r=/* @__PURE__ */ new Set;for(let t of n){let n=new Bun.Glob(`${t}/package.json`);for(let t of n.scanSync({cwd:e}))t.includes(`node_modules/`)||r.add(t)}return[...r].sort()}async function qd(e,t){let n=Wd(s(e,`package.json`));if(n.name===`@longzai-intelligence-oxlint/root`)return{applicable:!1,versionChecked:[],violations:[]};let r=Kd(e,n.workspaces),i=[];for(let t of r){let n=Wd(s(e,t));for(let e of Bd)for(let[r,a]of Gd(n[e]))i.push({kind:`non-root`,manifestPath:t,field:e,name:r,specifier:a})}for(let e of Vd)for(let[t,r]of Gd(n[e]))i.push({kind:`root-placement`,manifestPath:`package.json`,field:e,name:t,specifier:r});let a=[],o=Gd(n.devDependencies);return await Promise.all(o.map(async([e,n])=>{if(n.startsWith(`workspace:`))return;a.push(e);let r=await t(e);n!==r&&i.push({kind:`version`,manifestPath:`package.json`,field:`devDependencies`,name:e,specifier:n,expected:r})})),{applicable:!0,versionChecked:a,violations:i}}const Jd=yl({"dist-tags":yl({latest:K().optional()})});async function Yd(e){let t=`https://registry.npmjs.org/${encodeURIComponent(e)}`,n=await fetch(t);if(!n.ok)throw Error(`registry 查询失败:${e} 响应状态 ${n.status}`);let r=Jd.safeParse(await n.json());if(!r.success)throw Error(`registry 元数据结构异常:${e}`);let i=r.data[`dist-tags`]?.latest;if(!i)throw Error(`registry 元数据缺失 latest 标签:${e}`);return i}const Xd=bl({cwd:K().optional(),format:Ol([`text`,`json`]).optional()}),Zd={"non-root":`非根声明`,"root-placement":`根位置误置`,version:`版本非最新`};function Qd(e){xu(e,{name:`check`,description:`插件域依赖声明检查——仅根 devDependencies 合法且须为 registry 最新版`,options:[{flags:`--cwd <v>`,description:`目标仓根目录,默认当前目录`},{flags:`--format <text|json>`,defaultValue:`text`,description:`输出格式,默认 text`}],schema:Xd,action:async e=>{let t=new du(fu(e.format)),n=c(e.cwd??`.`),r;try{r=await qd(n,Yd)}catch(e){t.error(e),process.exit(1)}if(!r.applicable)t.info(`当前仓为插件源仓,声明政策不适用,跳过检查`);else if(r.violations.length===0)t.success({versionChecked:r.versionChecked.length},`[SUCCESS] lzi-oxlint check 通过|根开发依赖 ${r.versionChecked.length} 项全部为最新版且无非根声明`);else{if(e.format===`json`)process.stdout.write(`${JSON.stringify({success:!1,data:{violations:r.violations}},null,2)}\n`);else{let e=r.violations.map(e=>[e.manifestPath,Zd[e.kind]??e.kind,e.name,e.specifier,e.expected??`—`]);t.table([`位置`,`判据`,`包名`,`声明值`,`应然值`],e)}process.stderr.write(`错误: lzi-oxlint check 发现 ${r.violations.length} 项违规|政策:插件域依赖只能声明在根 devDependencies 且必须为最新版\n`),process.exit(1)}}})}const $d={apiEndpoint:`http://localhost:3000`,defaultSeverity:`warn`,logLevel:`info`};function ef(){return s(t(),`.lzi`,`oxlint`,`config.json`)}const tf=yl({format:Ol([`text`,`json`]).default(`text`)});function nf(e){let t=e.command(`config`).description(`管理 CLI 配置`);xu(t,{name:`init`,description:`初始化默认配置`,options:[{flags:`--format <text|json>`,defaultValue:`text`}],schema:tf,action:async e=>{let t=new du(fu(e.format)),n=ef(),a=s(n,`..`);r(a)||i(a,{recursive:!0}),o(n,JSON.stringify($d,null,2),`utf-8`),gu.success(`配置已初始化`),t.success({configPath:n,config:$d},`配置初始化成功`)}}),xu(t,{name:`show`,description:`显示当前配置`,options:[{flags:`--format <text|json>`,defaultValue:`text`}],schema:tf,action:async e=>{let t=new du(fu(e.format)),n=ef();if(!r(n)){t.warn(`配置文件不存在,请先运行 config init`);return}let i=a(n,`utf-8`);t.success(JSON.parse(i),`当前配置`)}})}function rf(e){return Array.isArray(e)}var af=class{filePath;constructor(e){this.filePath=e;let t=s(e,`..`);r(t)||i(t,{recursive:!0}),r(this.filePath)||o(this.filePath,`[]`,`utf-8`)}read(){let e=a(this.filePath,`utf-8`);try{let t=JSON.parse(e);return rf(t)?t:[]}catch{return[]}}write(e){o(this.filePath,JSON.stringify(e,null,2),`utf-8`)}add(e){let t=this.read();t.push(e),this.write(t)}find(e){return this.read().find(e)}remove(e){let t=this.read().filter(t=>!e(t));this.write(t)}};function of(){let e=t();return s(e,`.lzi`,`oxlint`,`rules.json`)}const sf=yl({format:Ol([`text`,`json`]).default(`text`),id:K().min(1),name:K().min(1),plugin:K().min(1),severity:K().min(1),description:K(),createdAt:K()}),cf=yl({format:Ol([`text`,`json`]).default(`text`),id:K().optional(),name:K().optional(),n:K().optional(),plugin:K().optional(),p:K().optional(),severity:K().optional(),description:K().optional(),d:K().optional()});function lf(e){let t=e.command(`rule`).description(`管理 oxlint 规则记录`);xu(t,{name:`list`,description:`列出所有规则记录`,options:[{flags:`--format <text|json>`,defaultValue:`text`}],schema:yl({format:Ol([`text`,`json`]).default(`text`)}),action:async e=>{let t=new du(fu(e.format)),n=new af(of()).read();n.length===0?t.info(`暂无规则记录`):t.table([`规则标识`,`规则名称`,`插件`,`严重级别`,`创建时间`],n.map(e=>[e.id,e.name,e.plugin,e.severity,e.createdAt]))}}),xu(t,{name:`add`,description:`添加规则记录`,options:[{flags:`--id <id>`,description:`规则标识`},{flags:`-n, --name <name>`,description:`规则名称`},{flags:`-p, --plugin <plugin>`,description:`所属插件`},{flags:`--severity <severity>`,description:`严重级别`},{flags:`-d, --description <description>`,description:`规则描述`},{flags:`--format <text|json>`,defaultValue:`text`}],schema:cf,action:async e=>{let t=new du(fu(e.format)),n={id:e.id||await mu(`请输入规则标识`),name:e.name||e.n||await mu(`请输入规则名称`),plugin:e.plugin||e.p||await pu(`请选择所属插件`,[{value:`typescript`,label:`TypeScript`},{value:`unicorn`,label:`Unicorn`},{value:`import`,label:`Import`},{value:`eslint-core`,label:`ESLint Core`},{value:`react`,label:`React`}]),severity:e.severity||await pu(`请选择严重级别`,[{value:`error`,label:`错误`},{value:`warn`,label:`警告`},{value:`off`,label:`关闭`}]),description:e.description||e.d||await mu(`请输入规则描述`),createdAt:(/* @__PURE__ */ new Date()).toISOString()},r=sf.safeParse(n);r.success?(new af(of()).add(r.data),gu.success(`规则记录已添加`),t.success(r.data,`规则记录创建成功`)):t.error(/* @__PURE__ */ Error(`规则记录校验失败`))}}),xu(t,{name:`remove`,description:`删除规则记录`,arguments:[{signature:`[id]`,description:`规则标识`}],options:[{flags:`--id <id>`,description:`规则标识`},{flags:`--format <text|json>`,defaultValue:`text`}],schema:yl({format:Ol([`text`,`json`]).default(`text`),id:K().optional()}),action:async(e,t)=>{let n=new du(fu(e.format)),r=e.id||t[0]||await mu(`请输入要删除的规则标识`),i=new af(of());i.find(e=>e.id===r)?await hu(`确认删除规则 ${r} 吗?`)?(i.remove(e=>e.id===r),gu.success(`规则记录已删除`),n.success({id:r},`规则记录删除成功`)):n.info(`已取消删除`):n.warn(`未找到规则标识: ${r}`)}}),t.action(async()=>{await uf()})}async function uf(){let e=await pu(`请选择操作`,[{value:`list`,label:`查看规则列表`,hint:`列出所有 oxlint 规则`},{value:`add`,label:`添加规则记录`,hint:`录入新的 oxlint 规则`},{value:`remove`,label:`删除规则记录`,hint:`移除指定规则`}]),t=new du(`text`),n=new af(of());if(e===`list`){let e=n.read();if(e.length===0){t.info(`暂无规则记录`);return}t.table([`规则标识`,`规则名称`,`插件`,`严重级别`,`创建时间`],e.map(e=>[e.id,e.name,e.plugin,e.severity,e.createdAt]))}else if(e===`add`){let e={id:await mu(`请输入规则标识`),name:await mu(`请输入规则名称`),plugin:await pu(`请选择所属插件`,[{value:`typescript`,label:`TypeScript`},{value:`unicorn`,label:`Unicorn`},{value:`import`,label:`Import`},{value:`eslint-core`,label:`ESLint Core`},{value:`react`,label:`React`}]),severity:await pu(`请选择严重级别`,[{value:`error`,label:`错误`},{value:`warn`,label:`警告`},{value:`off`,label:`关闭`}]),description:await mu(`请输入规则描述`),createdAt:(/* @__PURE__ */ new Date()).toISOString()},r=sf.safeParse(e);if(!r.success){t.error(/* @__PURE__ */ Error(`规则记录校验失败`));return}n.add(r.data),gu.success(`规则记录已添加`),t.success(r.data,`规则记录创建成功`)}else if(e===`remove`){let e=await mu(`请输入要删除的规则标识`);if(!n.find(t=>t.id===e)){t.warn(`未找到规则标识: ${e}`);return}if(!await hu(`确认删除规则 ${e} 吗?`)){t.info(`已取消删除`);return}n.remove(t=>t.id===e),gu.success(`规则记录已删除`),t.success({id:e},`规则记录删除成功`)}}function df(e){lf(e),nf(e),Qd(e)}async function ff(){let e=cu({name:`lzi-oxlint`,description:`Longzai Intelligence oxlint CLI`,interaction:zd,color:Rd});df(e),await e.parseAsync(process.argv)}await ff();export{};
205
+ `),m(),i()};return{start:v,stop:y,message:(e=``)=>{s=g(e??s)}}},Bd={red:e=>Y.default.red(e),green:e=>Y.default.green(e),yellow:e=>Y.default.yellow(e),blue:e=>Y.default.blue(e),cyan:e=>Y.default.cyan(e),magenta:e=>Y.default.magenta(e),gray:e=>Y.default.gray(e),bold:e=>Y.default.bold(e),dim:e=>Y.default.dim(e)},Vd={async select(e,t){let n=await Fd({message:e,options:t.map(e=>({value:e.value,label:e.label,hint:e.hint}))});return nd(n)&&(Ld(`操作已取消`),process.exit(0)),typeof n==`string`?n:String(n)},async textInput(e,t){let n=await Nd({message:e,placeholder:t?.placeholder,defaultValue:t?.defaultValue});return nd(n)&&(Ld(`操作已取消`),process.exit(0)),typeof n==`string`?n:String(n)},async confirm(e,t){let n=await Pd({message:e,initialValue:t?.defaultValue??!1});return nd(n)&&(Ld(`操作已取消`),process.exit(0)),typeof n==`boolean`?n:!!n},spinner(){let e=zd();return{start(t){e.start(t)},stop(t){e.stop(t)}}},note(e,t){Id(e,t)},log:{info(e){Rd.info(Y.default.blue(e))},success(e){Rd.success(Y.default.green(e))},warn(e){Rd.warn(Y.default.yellow(e))},error(e){Rd.error(Y.default.red(e))},step(e){Rd.step(e)}}},Hd=[`dependencies`,`devDependencies`,`peerDependencies`,`optionalDependencies`],Ud=[`dependencies`,`peerDependencies`,`optionalDependencies`],Wd=Ol(K(),K()),Gd=Sl({name:K().optional(),workspaces:wl([yl(K()),xl({packages:yl(K()).optional()})]).optional(),dependencies:Wd.optional(),devDependencies:Wd.optional(),peerDependencies:Wd.optional(),optionalDependencies:Wd.optional()});function Kd(e){let t=a(e,`utf8`),n=Gd.safeParse(JSON.parse(t));if(!n.success)throw Error(`package.json 结构不符合预期:${e}`);return n.data}function qd(e){return Object.entries(e??{}).filter(([e])=>e.startsWith(`@longzai-intelligence-oxlint/`))}function Jd(e,t){let n=Array.isArray(t)?t:t?.packages??[],r=/* @__PURE__ */ new Set;for(let t of n){let n=new Bun.Glob(`${t}/package.json`);for(let t of n.scanSync({cwd:e}))t.includes(`node_modules/`)||r.add(t)}return[...r].sort()}async function Yd(e,t){let n=Kd(s(e,`package.json`));if(n.name===`@longzai-intelligence-oxlint/root`)return{applicable:!1,versionChecked:[],violations:[]};let r=Jd(e,n.workspaces),i=[];for(let t of r){let n=Kd(s(e,t));for(let e of Hd)for(let[r,a]of qd(n[e]))i.push({kind:`non-root`,manifestPath:t,field:e,name:r,specifier:a})}for(let e of Ud)for(let[t,r]of qd(n[e]))i.push({kind:`root-placement`,manifestPath:`package.json`,field:e,name:t,specifier:r});let a=[],o=qd(n.devDependencies);return await Promise.all(o.map(async([e,n])=>{if(n.startsWith(`workspace:`))return;a.push(e);let r=await t(e);n!==r&&i.push({kind:`version`,manifestPath:`package.json`,field:`devDependencies`,name:e,specifier:n,expected:r})})),{applicable:!0,versionChecked:a,violations:i}}const Xd=xl({"dist-tags":xl({latest:K().optional()})});async function Zd(e){let t=`https://registry.npmjs.org/${encodeURIComponent(e)}`,n=await fetch(t);if(!n.ok)throw Error(`registry 查询失败:${e} 响应状态 ${n.status}`);let r=Xd.safeParse(await n.json());if(!r.success)throw Error(`registry 元数据结构异常:${e}`);let i=r.data[`dist-tags`]?.latest;if(!i)throw Error(`registry 元数据缺失 latest 标签:${e}`);return i}const Qd=Sl({cwd:K().optional(),format:Al([`text`,`json`]).optional()}),$d={"non-root":`非根声明`,"root-placement":`根位置误置`,version:`版本非最新`};function ef(e){Cu(e,{name:`check`,description:`插件域依赖声明检查——仅根 devDependencies 合法且须为 registry 最新版`,options:[{flags:`--cwd <v>`,description:`目标仓根目录,默认当前目录`},{flags:`--format <text|json>`,defaultValue:`text`,description:`输出格式,默认 text`}],schema:Qd,action:async e=>{let t=new pu(mu(e.format)),n=c(e.cwd??`.`),r;try{r=await Yd(n,Zd)}catch(e){t.error(e),process.exit(1)}if(!r.applicable)t.info(`当前仓为插件源仓,声明政策不适用,跳过检查`);else if(r.violations.length===0)t.success({versionChecked:r.versionChecked.length},`[SUCCESS] lzi-oxlint check 通过|根开发依赖 ${r.versionChecked.length} 项全部为最新版且无非根声明`);else{if(e.format===`json`)process.stdout.write(`${JSON.stringify({success:!1,data:{violations:r.violations}},null,2)}\n`);else{let e=r.violations.map(e=>[e.manifestPath,$d[e.kind]??e.kind,e.name,e.specifier,e.expected??`—`]);t.table([`位置`,`判据`,`包名`,`声明值`,`应然值`],e)}process.stderr.write(`错误: lzi-oxlint check 发现 ${r.violations.length} 项违规|政策:插件域依赖只能声明在根 devDependencies 且必须为最新版\n`),process.exit(1)}}})}const tf={apiEndpoint:`http://localhost:3000`,defaultSeverity:`warn`,logLevel:`info`};function nf(){return s(t(),`.lzi`,`oxlint`,`config.json`)}const rf=xl({format:Al([`text`,`json`]).default(`text`)});function af(e){let t=e.command(`config`).description(`管理 CLI 配置`);Cu(t,{name:`init`,description:`初始化默认配置`,options:[{flags:`--format <text|json>`,defaultValue:`text`}],schema:rf,action:async e=>{let t=new pu(mu(e.format)),n=nf(),a=s(n,`..`);r(a)||i(a,{recursive:!0}),o(n,JSON.stringify(tf,null,2),`utf-8`),vu.success(`配置已初始化`),t.success({configPath:n,config:tf},`配置初始化成功`)}}),Cu(t,{name:`show`,description:`显示当前配置`,options:[{flags:`--format <text|json>`,defaultValue:`text`}],schema:rf,action:async e=>{let t=new pu(mu(e.format)),n=nf();if(!r(n)){t.warn(`配置文件不存在,请先运行 config init`);return}let i=a(n,`utf-8`);t.success(JSON.parse(i),`当前配置`)}})}function of(e){return Array.isArray(e)}var sf=class{filePath;constructor(e){this.filePath=e;let t=s(e,`..`);r(t)||i(t,{recursive:!0}),r(this.filePath)||o(this.filePath,`[]`,`utf-8`)}read(){let e=a(this.filePath,`utf-8`);try{let t=JSON.parse(e);return of(t)?t:[]}catch{return[]}}write(e){o(this.filePath,JSON.stringify(e,null,2),`utf-8`)}add(e){let t=this.read();t.push(e),this.write(t)}find(e){return this.read().find(e)}remove(e){let t=this.read().filter(t=>!e(t));this.write(t)}};function cf(){let e=t();return s(e,`.lzi`,`oxlint`,`rules.json`)}const lf=xl({format:Al([`text`,`json`]).default(`text`),id:K().min(1),name:K().min(1),plugin:K().min(1),severity:K().min(1),description:K(),createdAt:K()}),uf=xl({format:Al([`text`,`json`]).default(`text`),id:K().optional(),name:K().optional(),n:K().optional(),plugin:K().optional(),p:K().optional(),severity:K().optional(),description:K().optional(),d:K().optional()});function df(e){let t=e.command(`rule`).description(`管理 oxlint 规则记录`);Cu(t,{name:`list`,description:`列出所有规则记录`,options:[{flags:`--format <text|json>`,defaultValue:`text`}],schema:xl({format:Al([`text`,`json`]).default(`text`)}),action:async e=>{let t=new pu(mu(e.format)),n=new sf(cf()).read();n.length===0?t.info(`暂无规则记录`):t.table([`规则标识`,`规则名称`,`插件`,`严重级别`,`创建时间`],n.map(e=>[e.id,e.name,e.plugin,e.severity,e.createdAt]))}}),Cu(t,{name:`add`,description:`添加规则记录`,options:[{flags:`--id <id>`,description:`规则标识`},{flags:`-n, --name <name>`,description:`规则名称`},{flags:`-p, --plugin <plugin>`,description:`所属插件`},{flags:`--severity <severity>`,description:`严重级别`},{flags:`-d, --description <description>`,description:`规则描述`},{flags:`--format <text|json>`,defaultValue:`text`}],schema:uf,action:async e=>{let t=new pu(mu(e.format)),n={id:e.id||await gu(`请输入规则标识`),name:e.name||e.n||await gu(`请输入规则名称`),plugin:e.plugin||e.p||await hu(`请选择所属插件`,[{value:`typescript`,label:`TypeScript`},{value:`unicorn`,label:`Unicorn`},{value:`import`,label:`Import`},{value:`eslint-core`,label:`ESLint Core`},{value:`react`,label:`React`}]),severity:e.severity||await hu(`请选择严重级别`,[{value:`error`,label:`错误`},{value:`warn`,label:`警告`},{value:`off`,label:`关闭`}]),description:e.description||e.d||await gu(`请输入规则描述`),createdAt:(/* @__PURE__ */ new Date()).toISOString()},r=lf.safeParse(n);r.success?(new sf(cf()).add(r.data),vu.success(`规则记录已添加`),t.success(r.data,`规则记录创建成功`)):t.error(/* @__PURE__ */ Error(`规则记录校验失败`))}}),Cu(t,{name:`remove`,description:`删除规则记录`,arguments:[{signature:`[id]`,description:`规则标识`}],options:[{flags:`--id <id>`,description:`规则标识`},{flags:`--format <text|json>`,defaultValue:`text`}],schema:xl({format:Al([`text`,`json`]).default(`text`),id:K().optional()}),action:async(e,t)=>{let n=new pu(mu(e.format)),r=e.id||t[0]||await gu(`请输入要删除的规则标识`),i=new sf(cf());i.find(e=>e.id===r)?await _u(`确认删除规则 ${r} 吗?`)?(i.remove(e=>e.id===r),vu.success(`规则记录已删除`),n.success({id:r},`规则记录删除成功`)):n.info(`已取消删除`):n.warn(`未找到规则标识: ${r}`)}}),t.action(async()=>{await ff()})}async function ff(){let e=await hu(`请选择操作`,[{value:`list`,label:`查看规则列表`,hint:`列出所有 oxlint 规则`},{value:`add`,label:`添加规则记录`,hint:`录入新的 oxlint 规则`},{value:`remove`,label:`删除规则记录`,hint:`移除指定规则`}]),t=new pu(`text`),n=new sf(cf());if(e===`list`){let e=n.read();if(e.length===0){t.info(`暂无规则记录`);return}t.table([`规则标识`,`规则名称`,`插件`,`严重级别`,`创建时间`],e.map(e=>[e.id,e.name,e.plugin,e.severity,e.createdAt]))}else if(e===`add`){let e={id:await gu(`请输入规则标识`),name:await gu(`请输入规则名称`),plugin:await hu(`请选择所属插件`,[{value:`typescript`,label:`TypeScript`},{value:`unicorn`,label:`Unicorn`},{value:`import`,label:`Import`},{value:`eslint-core`,label:`ESLint Core`},{value:`react`,label:`React`}]),severity:await hu(`请选择严重级别`,[{value:`error`,label:`错误`},{value:`warn`,label:`警告`},{value:`off`,label:`关闭`}]),description:await gu(`请输入规则描述`),createdAt:(/* @__PURE__ */ new Date()).toISOString()},r=lf.safeParse(e);if(!r.success){t.error(/* @__PURE__ */ Error(`规则记录校验失败`));return}n.add(r.data),vu.success(`规则记录已添加`),t.success(r.data,`规则记录创建成功`)}else if(e===`remove`){let e=await gu(`请输入要删除的规则标识`);if(!n.find(t=>t.id===e)){t.warn(`未找到规则标识: ${e}`);return}if(!await _u(`确认删除规则 ${e} 吗?`)){t.info(`已取消删除`);return}n.remove(t=>t.id===e),vu.success(`规则记录已删除`),t.success({id:e},`规则记录删除成功`)}}function pf(e){df(e),af(e),ef(e)}async function mf(){let e=uu({name:`lzi-oxlint`,description:`Longzai Intelligence oxlint CLI`,interaction:Vd,color:Bd});pf(e),await e.parseAsync(process.argv)}await mf();export{};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longzai-intelligence-oxlint/cli",
3
- "version": "0.2.4",
3
+ "version": "0.2.6",
4
4
  "private": false,
5
5
  "description": "Longzai Intelligence oxlint 工具 CLI",
6
6
  "keywords": [
@@ -29,9 +29,9 @@
29
29
  "test": "bun test"
30
30
  },
31
31
  "dependencies": {
32
- "@longzai-intelligence-cli/core": "^0.0.12",
33
- "@longzai-intelligence-cli/standard": "^0.0.12",
34
- "@longzai-intelligence-logger/node": "^0.1.7",
32
+ "@longzai-intelligence-cli/core": "^0.0.13",
33
+ "@longzai-intelligence-cli/standard": "^0.0.13",
34
+ "@longzai-intelligence-logger/node": "^0.1.8",
35
35
  "zod": "^4.4.3"
36
36
  }
37
37
  }