agentica 0.13.1 → 0.13.2

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.
package/bin/index.mjs ADDED
@@ -0,0 +1,93 @@
1
+ #!/usr/bin/env node
2
+ import w,{stdin as je,stdout as ke}from"node:process";import{promisify as Ct}from"node:util";import*as K from"node:readline";import Pe from"node:readline";import{WriteStream as ft}from"node:tty";import gt from"events";import Et from"child_process";import bt from"path";import At from"fs";import _t from"process";import{existsSync as ne}from"node:fs";import{rm as Bt,appendFile as vt,readFile as De,writeFile as oe}from"node:fs/promises";import{join as N}from"node:path";import{exec as $t}from"node:child_process";import{downloadTemplate as yt}from"giget";function Ve(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function wt(i){if(Object.prototype.hasOwnProperty.call(i,"__esModule"))return i;var t=i.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(i).forEach(function(r){var s=Object.getOwnPropertyDescriptor(i,r);Object.defineProperty(n,r,s.get?s:{enumerable:!0,get:function(){return i[r]}})}),n}var ae,Te;function xt(){if(Te)return ae;Te=1;const i="\x1B",t=`${i}[`,n="\x07",r={to(e,a){return a?`${t}${a+1};${e+1}H`:`${t}${e+1}G`},move(e,a){let h="";return e<0?h+=`${t}${-e}D`:e>0&&(h+=`${t}${e}C`),a<0?h+=`${t}${-a}A`:a>0&&(h+=`${t}${a}B`),h},up:(e=1)=>`${t}${e}A`,down:(e=1)=>`${t}${e}B`,forward:(e=1)=>`${t}${e}C`,backward:(e=1)=>`${t}${e}D`,nextLine:(e=1)=>`${t}E`.repeat(e),prevLine:(e=1)=>`${t}F`.repeat(e),left:`${t}G`,hide:`${t}?25l`,show:`${t}?25h`,save:`${i}7`,restore:`${i}8`},s={up:(e=1)=>`${t}S`.repeat(e),down:(e=1)=>`${t}T`.repeat(e)},D={screen:`${t}2J`,up:(e=1)=>`${t}1J`.repeat(e),down:(e=1)=>`${t}J`.repeat(e),line:`${t}2K`,lineEnd:`${t}K`,lineStart:`${t}1K`,lines(e){let a="";for(let h=0;h<e;h++)a+=this.line+(h<e-1?r.up():"");return e&&(a+=r.left),a}};return ae={cursor:r,scroll:s,erase:D,beep:n},ae}var j=xt(),U={exports:{}},Ie;function Ot(){if(Ie)return U.exports;Ie=1;let i=process||{},t=i.argv||[],n=i.env||{},r=!(n.NO_COLOR||t.includes("--no-color"))&&(!!n.FORCE_COLOR||t.includes("--color")||i.platform==="win32"||(i.stdout||{}).isTTY&&n.TERM!=="dumb"||!!n.CI),s=(a,h,d=a)=>g=>{let f=""+g,_=f.indexOf(h,a.length);return~_?a+D(f,h,d,_)+h:a+f+h},D=(a,h,d,g)=>{let f="",_=0;do f+=a.substring(_,g)+d,_=g+h.length,g=a.indexOf(h,_);while(~g);return f+a.substring(_)},e=(a=r)=>{let h=a?s:()=>String;return{isColorSupported:a,reset:h("\x1B[0m","\x1B[0m"),bold:h("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:h("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:h("\x1B[3m","\x1B[23m"),underline:h("\x1B[4m","\x1B[24m"),inverse:h("\x1B[7m","\x1B[27m"),hidden:h("\x1B[8m","\x1B[28m"),strikethrough:h("\x1B[9m","\x1B[29m"),black:h("\x1B[30m","\x1B[39m"),red:h("\x1B[31m","\x1B[39m"),green:h("\x1B[32m","\x1B[39m"),yellow:h("\x1B[33m","\x1B[39m"),blue:h("\x1B[34m","\x1B[39m"),magenta:h("\x1B[35m","\x1B[39m"),cyan:h("\x1B[36m","\x1B[39m"),white:h("\x1B[37m","\x1B[39m"),gray:h("\x1B[90m","\x1B[39m"),bgBlack:h("\x1B[40m","\x1B[49m"),bgRed:h("\x1B[41m","\x1B[49m"),bgGreen:h("\x1B[42m","\x1B[49m"),bgYellow:h("\x1B[43m","\x1B[49m"),bgBlue:h("\x1B[44m","\x1B[49m"),bgMagenta:h("\x1B[45m","\x1B[49m"),bgCyan:h("\x1B[46m","\x1B[49m"),bgWhite:h("\x1B[47m","\x1B[49m"),blackBright:h("\x1B[90m","\x1B[39m"),redBright:h("\x1B[91m","\x1B[39m"),greenBright:h("\x1B[92m","\x1B[39m"),yellowBright:h("\x1B[93m","\x1B[39m"),blueBright:h("\x1B[94m","\x1B[39m"),magentaBright:h("\x1B[95m","\x1B[39m"),cyanBright:h("\x1B[96m","\x1B[39m"),whiteBright:h("\x1B[97m","\x1B[39m"),bgBlackBright:h("\x1B[100m","\x1B[49m"),bgRedBright:h("\x1B[101m","\x1B[49m"),bgGreenBright:h("\x1B[102m","\x1B[49m"),bgYellowBright:h("\x1B[103m","\x1B[49m"),bgBlueBright:h("\x1B[104m","\x1B[49m"),bgMagentaBright:h("\x1B[105m","\x1B[49m"),bgCyanBright:h("\x1B[106m","\x1B[49m"),bgWhiteBright:h("\x1B[107m","\x1B[49m")}};return U.exports=e(),U.exports.createColors=e,U.exports}var V=Ot();const m=Ve(V);function St({onlyFirst:i=!1}={}){const 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,i?void 0:"g")}const jt=St();function Me(i){if(typeof i!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof i}\``);return i.replace(jt,"")}function Ne(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var He={exports:{}};(function(i){var t={};i.exports=t,t.eastAsianWidth=function(r){var s=r.charCodeAt(0),D=r.length==2?r.charCodeAt(1):0,e=s;return 55296<=s&&s<=56319&&56320<=D&&D<=57343&&(s&=1023,D&=1023,e=s<<10|D,e+=65536),e==12288||65281<=e&&e<=65376||65504<=e&&e<=65510?"F":e==8361||65377<=e&&e<=65470||65474<=e&&e<=65479||65482<=e&&e<=65487||65490<=e&&e<=65495||65498<=e&&e<=65500||65512<=e&&e<=65518?"H":4352<=e&&e<=4447||4515<=e&&e<=4519||4602<=e&&e<=4607||9001<=e&&e<=9002||11904<=e&&e<=11929||11931<=e&&e<=12019||12032<=e&&e<=12245||12272<=e&&e<=12283||12289<=e&&e<=12350||12353<=e&&e<=12438||12441<=e&&e<=12543||12549<=e&&e<=12589||12593<=e&&e<=12686||12688<=e&&e<=12730||12736<=e&&e<=12771||12784<=e&&e<=12830||12832<=e&&e<=12871||12880<=e&&e<=13054||13056<=e&&e<=19903||19968<=e&&e<=42124||42128<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||55216<=e&&e<=55238||55243<=e&&e<=55291||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65106||65108<=e&&e<=65126||65128<=e&&e<=65131||110592<=e&&e<=110593||127488<=e&&e<=127490||127504<=e&&e<=127546||127552<=e&&e<=127560||127568<=e&&e<=127569||131072<=e&&e<=194367||177984<=e&&e<=196605||196608<=e&&e<=262141?"W":32<=e&&e<=126||162<=e&&e<=163||165<=e&&e<=166||e==172||e==175||10214<=e&&e<=10221||10629<=e&&e<=10630?"Na":e==161||e==164||167<=e&&e<=168||e==170||173<=e&&e<=174||176<=e&&e<=180||182<=e&&e<=186||188<=e&&e<=191||e==198||e==208||215<=e&&e<=216||222<=e&&e<=225||e==230||232<=e&&e<=234||236<=e&&e<=237||e==240||242<=e&&e<=243||247<=e&&e<=250||e==252||e==254||e==257||e==273||e==275||e==283||294<=e&&e<=295||e==299||305<=e&&e<=307||e==312||319<=e&&e<=322||e==324||328<=e&&e<=331||e==333||338<=e&&e<=339||358<=e&&e<=359||e==363||e==462||e==464||e==466||e==468||e==470||e==472||e==474||e==476||e==593||e==609||e==708||e==711||713<=e&&e<=715||e==717||e==720||728<=e&&e<=731||e==733||e==735||768<=e&&e<=879||913<=e&&e<=929||931<=e&&e<=937||945<=e&&e<=961||963<=e&&e<=969||e==1025||1040<=e&&e<=1103||e==1105||e==8208||8211<=e&&e<=8214||8216<=e&&e<=8217||8220<=e&&e<=8221||8224<=e&&e<=8226||8228<=e&&e<=8231||e==8240||8242<=e&&e<=8243||e==8245||e==8251||e==8254||e==8308||e==8319||8321<=e&&e<=8324||e==8364||e==8451||e==8453||e==8457||e==8467||e==8470||8481<=e&&e<=8482||e==8486||e==8491||8531<=e&&e<=8532||8539<=e&&e<=8542||8544<=e&&e<=8555||8560<=e&&e<=8569||e==8585||8592<=e&&e<=8601||8632<=e&&e<=8633||e==8658||e==8660||e==8679||e==8704||8706<=e&&e<=8707||8711<=e&&e<=8712||e==8715||e==8719||e==8721||e==8725||e==8730||8733<=e&&e<=8736||e==8739||e==8741||8743<=e&&e<=8748||e==8750||8756<=e&&e<=8759||8764<=e&&e<=8765||e==8776||e==8780||e==8786||8800<=e&&e<=8801||8804<=e&&e<=8807||8810<=e&&e<=8811||8814<=e&&e<=8815||8834<=e&&e<=8835||8838<=e&&e<=8839||e==8853||e==8857||e==8869||e==8895||e==8978||9312<=e&&e<=9449||9451<=e&&e<=9547||9552<=e&&e<=9587||9600<=e&&e<=9615||9618<=e&&e<=9621||9632<=e&&e<=9633||9635<=e&&e<=9641||9650<=e&&e<=9651||9654<=e&&e<=9655||9660<=e&&e<=9661||9664<=e&&e<=9665||9670<=e&&e<=9672||e==9675||9678<=e&&e<=9681||9698<=e&&e<=9701||e==9711||9733<=e&&e<=9734||e==9737||9742<=e&&e<=9743||9748<=e&&e<=9749||e==9756||e==9758||e==9792||e==9794||9824<=e&&e<=9825||9827<=e&&e<=9829||9831<=e&&e<=9834||9836<=e&&e<=9837||e==9839||9886<=e&&e<=9887||9918<=e&&e<=9919||9924<=e&&e<=9933||9935<=e&&e<=9953||e==9955||9960<=e&&e<=9983||e==10045||e==10071||10102<=e&&e<=10111||11093<=e&&e<=11097||12872<=e&&e<=12879||57344<=e&&e<=63743||65024<=e&&e<=65039||e==65533||127232<=e&&e<=127242||127248<=e&&e<=127277||127280<=e&&e<=127337||127344<=e&&e<=127386||917760<=e&&e<=917999||983040<=e&&e<=1048573||1048576<=e&&e<=1114109?"A":"N"},t.characterLength=function(r){var s=this.eastAsianWidth(r);return s=="F"||s=="W"||s=="A"?2:1};function n(r){return r.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}t.length=function(r){for(var s=n(r),D=0,e=0;e<s.length;e++)D=D+this.characterLength(s[e]);return D},t.slice=function(r,s,D){textLen=t.length(r),s=s||0,D=D||1,s<0&&(s=textLen+s),D<0&&(D=textLen+D);for(var e="",a=0,h=n(r),d=0;d<h.length;d++){var g=h[d],f=t.length(g);if(a>=s-(f==2?1:0))if(a+f<=D)e+=g;else break;a+=f}return e}})(He);var kt=He.exports;const Pt=Ne(kt);var Vt=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};const Tt=Ne(Vt);function W(i,t={}){if(typeof i!="string"||i.length===0||(t={ambiguousIsNarrow:!0,...t},i=Me(i),i.length===0))return 0;i=i.replace(Tt()," ");const n=t.ambiguousIsNarrow?1:2;let r=0;for(const s of i){const D=s.codePointAt(0);if(!(D<=31||D>=127&&D<=159||D>=768&&D<=879))switch(Pt.eastAsianWidth(s)){case"F":case"W":r+=2;break;case"A":r+=n;break;default:r+=1}}return r}const le=10,Re=(i=0)=>t=>`\x1B[${t+i}m`,Ge=(i=0)=>t=>`\x1B[${38+i};5;${t}m`,We=(i=0)=>(t,n,r)=>`\x1B[${38+i};2;${t};${n};${r}m`,$={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($.modifier);const It=Object.keys($.color),Mt=Object.keys($.bgColor);[...It,...Mt];function Nt(){const i=new Map;for(const[t,n]of Object.entries($)){for(const[r,s]of Object.entries(n))$[r]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},n[r]=$[r],i.set(s[0],s[1]);Object.defineProperty($,t,{value:n,enumerable:!1})}return Object.defineProperty($,"codes",{value:i,enumerable:!1}),$.color.close="\x1B[39m",$.bgColor.close="\x1B[49m",$.color.ansi=Re(),$.color.ansi256=Ge(),$.color.ansi16m=We(),$.bgColor.ansi=Re(le),$.bgColor.ansi256=Ge(le),$.bgColor.ansi16m=We(le),Object.defineProperties($,{rgbToAnsi256:{value:(t,n,r)=>t===n&&n===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5),enumerable:!1},hexToRgb:{value:t=>{const n=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!n)return[0,0,0];let[r]=n;r.length===3&&(r=[...r].map(D=>D+D).join(""));const s=Number.parseInt(r,16);return[s>>16&255,s>>8&255,s&255]},enumerable:!1},hexToAnsi256:{value:t=>$.rgbToAnsi256(...$.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value:t=>{if(t<8)return 30+t;if(t<16)return 90+(t-8);let n,r,s;if(t>=232)n=((t-232)*10+8)/255,r=n,s=n;else{t-=16;const a=t%36;n=Math.floor(t/36)/5,r=Math.floor(a/6)/5,s=a%6/5}const D=Math.max(n,r,s)*2;if(D===0)return 30;let e=30+(Math.round(s)<<2|Math.round(r)<<1|Math.round(n));return D===2&&(e+=60),e},enumerable:!1},rgbToAnsi:{value:(t,n,r)=>$.ansi256ToAnsi($.rgbToAnsi256(t,n,r)),enumerable:!1},hexToAnsi:{value:t=>$.ansi256ToAnsi($.hexToAnsi256(t)),enumerable:!1}}),$}const Ht=Nt(),z=new Set(["\x1B","\x9B"]),Rt=39,ce="\x07",qe="[",Gt="]",Le="m",he=`${Gt}8;;`,Ke=i=>`${z.values().next().value}${qe}${i}${Le}`,Ue=i=>`${z.values().next().value}${he}${i}${ce}`,Wt=i=>i.split(" ").map(t=>W(t)),pe=(i,t,n)=>{const r=[...t];let s=!1,D=!1,e=W(Me(i[i.length-1]));for(const[a,h]of r.entries()){const d=W(h);if(e+d<=n?i[i.length-1]+=h:(i.push(h),e=0),z.has(h)&&(s=!0,D=r.slice(a+1).join("").startsWith(he)),s){D?h===ce&&(s=!1,D=!1):h===Le&&(s=!1);continue}e+=d,e===n&&a<r.length-1&&(i.push(""),e=0)}!e&&i[i.length-1].length>0&&i.length>1&&(i[i.length-2]+=i.pop())},qt=i=>{const t=i.split(" ");let n=t.length;for(;n>0&&!(W(t[n-1])>0);)n--;return n===t.length?i:t.slice(0,n).join(" ")+t.slice(n).join("")},Lt=(i,t,n={})=>{if(n.trim!==!1&&i.trim()==="")return"";let r="",s,D;const e=Wt(i);let a=[""];for(const[d,g]of i.split(" ").entries()){n.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let f=W(a[a.length-1]);if(d!==0&&(f>=t&&(n.wordWrap===!1||n.trim===!1)&&(a.push(""),f=0),(f>0||n.trim===!1)&&(a[a.length-1]+=" ",f++)),n.hard&&e[d]>t){const _=t-f,S=1+Math.floor((e[d]-_-1)/t);Math.floor((e[d]-1)/t)<S&&a.push(""),pe(a,g,t);continue}if(f+e[d]>t&&f>0&&e[d]>0){if(n.wordWrap===!1&&f<t){pe(a,g,t);continue}a.push("")}if(f+e[d]>t&&n.wordWrap===!1){pe(a,g,t);continue}a[a.length-1]+=g}n.trim!==!1&&(a=a.map(d=>qt(d)));const h=[...a.join(`
3
+ `)];for(const[d,g]of h.entries()){if(r+=g,z.has(g)){const{groups:_}=new RegExp(`(?:\\${qe}(?<code>\\d+)m|\\${he}(?<uri>.*)${ce})`).exec(h.slice(d).join(""))||{groups:{}};if(_.code!==void 0){const S=Number.parseFloat(_.code);s=S===Rt?void 0:S}else _.uri!==void 0&&(D=_.uri.length===0?void 0:_.uri)}const f=Ht.codes.get(Number(s));h[d+1]===`
4
+ `?(D&&(r+=Ue("")),s&&f&&(r+=Ke(f))):g===`
5
+ `&&(s&&f&&(r+=Ke(s)),D&&(r+=Ue(D)))}return r};function ze(i,t,n){return String(i).normalize().replace(/\r\n/g,`
6
+ `).split(`
7
+ `).map(r=>Lt(r,t,n)).join(`
8
+ `)}const Kt=["up","down","left","right","space","enter","cancel"],Y={actions:new Set(Kt),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]])};function me(i,t){if(typeof i=="string")return Y.aliases.get(i)===t;for(const n of i)if(n!==void 0&&me(n,t))return!0;return!1}function Ut(i,t){if(i===t)return;const n=i.split(`
9
+ `),r=t.split(`
10
+ `),s=[];for(let D=0;D<Math.max(n.length,r.length);D++)n[D]!==r[D]&&s.push(D);return s}const zt=globalThis.process.platform.startsWith("win"),de=Symbol("clack:cancel");function H(i){return i===de}function J(i,t){const n=i;n.isTTY&&n.setRawMode(t)}function Yt({input:i=je,output:t=ke,overwrite:n=!0,hideCursor:r=!0}={}){const s=K.createInterface({input:i,output:t,prompt:"",tabSize:1});K.emitKeypressEvents(i,s),i.isTTY&&i.setRawMode(!0);const D=(e,{name:a,sequence:h})=>{const d=String(e);if(me([d,a,h],"cancel")){r&&t.write(j.cursor.show),process.exit(0);return}if(!n)return;const g=a==="return"?0:-1,f=a==="return"?-1:0;K.moveCursor(t,g,f,()=>{K.clearLine(t,1,()=>{i.once("keypress",D)})})};return r&&t.write(j.cursor.hide),i.once("keypress",D),()=>{i.off("keypress",D),r&&t.write(j.cursor.show),i.isTTY&&!zt&&i.setRawMode(!1),s.terminal=!1,s.close()}}var Jt=Object.defineProperty,Zt=(i,t,n)=>t in i?Jt(i,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):i[t]=n,I=(i,t,n)=>(Zt(i,typeof t!="symbol"?t+"":t,n),n);class Z{constructor(t,n=!0){I(this,"input"),I(this,"output"),I(this,"_abortSignal"),I(this,"rl"),I(this,"opts"),I(this,"_render"),I(this,"_track",!1),I(this,"_prevFrame",""),I(this,"_subscribers",new Map),I(this,"_cursor",0),I(this,"state","initial"),I(this,"error",""),I(this,"value");const{input:r=je,output:s=ke,render:D,signal:e,...a}=t;this.opts=a,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=D.bind(this),this._track=n,this._abortSignal=e,this.input=r,this.output=s}unsubscribe(){this._subscribers.clear()}setSubscriber(t,n){const r=this._subscribers.get(t)??[];r.push(n),this._subscribers.set(t,r)}on(t,n){this.setSubscriber(t,{cb:n})}once(t,n){this.setSubscriber(t,{cb:n,once:!0})}emit(t,...n){const r=this._subscribers.get(t)??[],s=[];for(const D of r)D.cb(...n),D.once&&s.push(()=>r.splice(r.indexOf(D),1));for(const D of s)D()}prompt(){return new Promise((t,n)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),t(de);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}const r=new ft(0);r._write=(s,D,e)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,""),this._cursor=this.rl?.cursor??0,this.emit("value",this.value)),e()},this.input.pipe(r),this.rl=Pe.createInterface({input:this.input,output:r,tabSize:2,prompt:"",escapeCodeTimeout:50}),Pe.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),J(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),J(this.input,!1),t(this.value)}),this.once("cancel",()=>{this.output.write(j.cursor.show),this.output.off("resize",this.render),J(this.input,!1),t(de)})})}onKeypress(t,n){if(this.state==="error"&&(this.state="active"),n?.name&&(!this._track&&Y.aliases.has(n.name)&&this.emit("cursor",Y.aliases.get(n.name)),Y.actions.has(n.name)&&this.emit("cursor",n.name)),t&&(t.toLowerCase()==="y"||t.toLowerCase()==="n")&&this.emit("confirm",t.toLowerCase()==="y"),t===" "&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),t&&this.emit("key",t.toLowerCase()),n?.name==="return"){if(this.opts.validate){const r=this.opts.validate(this.value);r&&(this.error=r instanceof Error?r.message:r,this.state="error",this.rl?.write(this.value))}this.state!=="error"&&(this.state="submit")}me([t,n?.name,n?.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(`
11
+ `),J(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){const t=ze(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
12
+ `).length-1;this.output.write(j.cursor.move(-999,t*-1))}render(){const t=ze(this._render(this)??"",process.stdout.columns,{hard:!0});if(t!==this._prevFrame){if(this.state==="initial")this.output.write(j.cursor.hide);else{const n=Ut(this._prevFrame,t);if(this.restoreCursor(),n&&n?.length===1){const r=n[0];this.output.write(j.cursor.move(0,r)),this.output.write(j.erase.lines(1));const s=t.split(`
13
+ `);this.output.write(s[r]),this._prevFrame=t,this.output.write(j.cursor.move(0,s.length-r-1));return}if(n&&n?.length>1){const r=n[0];this.output.write(j.cursor.move(0,r)),this.output.write(j.erase.down());const s=t.split(`
14
+ `).slice(r);this.output.write(s.join(`
15
+ `)),this._prevFrame=t;return}this.output.write(j.erase.down())}this.output.write(t),this.state==="initial"&&(this.state="active"),this._prevFrame=t}}}class Qt extends Z{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(t){super(t,!1),this.value=!!t.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",n=>{this.output.write(j.cursor.move(0,-1)),this.value=n,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}}var Xt=Object.defineProperty,eu=(i,t,n)=>t in i?Xt(i,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):i[t]=n,Ye=(i,t,n)=>(eu(i,typeof t!="symbol"?t+"":t,n),n);let tu=class extends Z{constructor(i){super(i,!1),Ye(this,"options"),Ye(this,"cursor",0),this.options=i.options,this.value=[...i.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:t})=>t===i.cursorAt),0),this.on("key",t=>{t==="a"&&this.toggleAll()}),this.on("cursor",t=>{switch(t){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;break;case"space":this.toggleValue();break}})}get _value(){return this.options[this.cursor].value}toggleAll(){const i=this.value.length===this.options.length;this.value=i?[]:this.options.map(t=>t.value)}toggleValue(){const i=this.value.includes(this._value);this.value=i?this.value.filter(t=>t!==this._value):[...this.value,this._value]}};var uu=Object.defineProperty,ru=(i,t,n)=>t in i?uu(i,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):i[t]=n,Je=(i,t,n)=>(ru(i,typeof t!="symbol"?t+"":t,n),n);class su extends Z{constructor(t){super(t,!1),Je(this,"options"),Je(this,"cursor",0),this.options=t.options,this.cursor=this.options.findIndex(({value:n})=>n===t.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",n=>{switch(n){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;break}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}}class iu extends Z{get valueWithCursor(){if(this.state==="submit")return this.value;if(this.cursor>=this.value.length)return`${this.value}\u2588`;const t=this.value.slice(0,this.cursor),[n,...r]=this.value.slice(this.cursor);return`${t}${m.inverse(n)}${r.join("")}`}get cursor(){return this._cursor}constructor(t){super(t),this.on("finalize",()=>{this.value||(this.value=t.defaultValue)})}}function nu(){return w.platform!=="win32"?w.env.TERM!=="linux":!!w.env.CI||!!w.env.WT_SESSION||!!w.env.TERMINUS_SUBLIME||w.env.ConEmuTask==="{cmd::Cmder}"||w.env.TERM_PROGRAM==="Terminus-Sublime"||w.env.TERM_PROGRAM==="vscode"||w.env.TERM==="xterm-256color"||w.env.TERM==="alacritty"||w.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}const Fe=nu(),k=(i,t)=>Fe?i:t,Du=k("\u25C6","*"),Ze=k("\u25A0","x"),Qe=k("\u25B2","x"),Ce=k("\u25C7","o"),ou=k("\u250C","T"),B=k("\u2502","|"),R=k("\u2514","\u2014"),fe=k("\u25CF",">"),ge=k("\u25CB"," "),au=k("\u25FB","[\u2022]"),Xe=k("\u25FC","[+]"),lu=k("\u25FB","[ ]"),cu=k("\u25CF","\u2022"),hu=k("\u25C6","*"),pu=k("\u25B2","!"),mu=k("\u25A0","x"),Q=i=>{switch(i){case"initial":case"active":return m.cyan(Du);case"cancel":return m.red(Ze);case"error":return m.yellow(Qe);case"submit":return m.green(Ce)}},Ee=i=>{const{cursor:t,options:n,style:r}=i,s=i.maxItems??Number.POSITIVE_INFINITY,D=Math.max(process.stdout.rows-4,0),e=Math.min(D,Math.max(s,5));let a=0;t>=a+e-3?a=Math.max(Math.min(t-e+3,n.length-e),0):t<a+2&&(a=Math.max(t-2,0));const h=e<n.length&&a>0,d=e<n.length&&a+e<n.length;return n.slice(a,a+e).map((g,f,_)=>{const S=f===0&&h,T=f===_.length-1&&d;return S||T?m.dim("..."):r(g,f+a===t)})},be=i=>new iu({validate:i.validate,placeholder:i.placeholder,defaultValue:i.defaultValue,initialValue:i.initialValue,render(){const t=`${m.gray(B)}
16
+ ${Q(this.state)} ${i.message}
17
+ `,n=i.placeholder?m.inverse(i.placeholder[0])+m.dim(i.placeholder.slice(1)):m.inverse(m.hidden("_")),r=this.value?this.valueWithCursor:n;switch(this.state){case"error":return`${t.trim()}
18
+ ${m.yellow(B)} ${r}
19
+ ${m.yellow(R)} ${m.yellow(this.error)}
20
+ `;case"submit":return`${t}${m.gray(B)} ${m.dim(this.value||i.placeholder)}`;case"cancel":return`${t}${m.gray(B)} ${m.strikethrough(m.dim(this.value??""))}${this.value?.trim()?`
21
+ ${m.gray(B)}`:""}`;default:return`${t}${m.cyan(B)} ${r}
22
+ ${m.cyan(R)}
23
+ `}}}).prompt(),du=i=>{const t=i.active??"Yes",n=i.inactive??"No";return new Qt({active:t,inactive:n,initialValue:i.initialValue??!0,render(){const r=`${m.gray(B)}
24
+ ${Q(this.state)} ${i.message}
25
+ `,s=this.value?t:n;switch(this.state){case"submit":return`${r}${m.gray(B)} ${m.dim(s)}`;case"cancel":return`${r}${m.gray(B)} ${m.strikethrough(m.dim(s))}
26
+ ${m.gray(B)}`;default:return`${r}${m.cyan(B)} ${this.value?`${m.green(fe)} ${t}`:`${m.dim(ge)} ${m.dim(t)}`} ${m.dim("/")} ${this.value?`${m.dim(ge)} ${m.dim(n)}`:`${m.green(fe)} ${n}`}
27
+ ${m.cyan(R)}
28
+ `}}}).prompt()},et=i=>{const t=(n,r)=>{const s=n.label??String(n.value);switch(r){case"selected":return`${m.dim(s)}`;case"active":return`${m.green(fe)} ${s} ${n.hint?m.dim(`(${n.hint})`):""}`;case"cancelled":return`${m.strikethrough(m.dim(s))}`;default:return`${m.dim(ge)} ${m.dim(s)}`}};return new su({options:i.options,initialValue:i.initialValue,render(){const n=`${m.gray(B)}
29
+ ${Q(this.state)} ${i.message}
30
+ `;switch(this.state){case"submit":return`${n}${m.gray(B)} ${t(this.options[this.cursor],"selected")}`;case"cancel":return`${n}${m.gray(B)} ${t(this.options[this.cursor],"cancelled")}
31
+ ${m.gray(B)}`;default:return`${n}${m.cyan(B)} ${Ee({cursor:this.cursor,options:this.options,maxItems:i.maxItems,style:(r,s)=>t(r,s?"active":"inactive")}).join(`
32
+ ${m.cyan(B)} `)}
33
+ ${m.cyan(R)}
34
+ `}}}).prompt()},Fu=i=>{const t=(n,r)=>{const s=n.label??String(n.value);return r==="active"?`${m.cyan(au)} ${s} ${n.hint?m.dim(`(${n.hint})`):""}`:r==="selected"?`${m.green(Xe)} ${m.dim(s)}`:r==="cancelled"?`${m.strikethrough(m.dim(s))}`:r==="active-selected"?`${m.green(Xe)} ${s} ${n.hint?m.dim(`(${n.hint})`):""}`:r==="submitted"?`${m.dim(s)}`:`${m.dim(lu)} ${m.dim(s)}`};return new tu({options:i.options,initialValues:i.initialValues,required:i.required??!0,cursorAt:i.cursorAt,validate(n){if(this.required&&n.length===0)return`Please select at least one option.
35
+ ${m.reset(m.dim(`Press ${m.gray(m.bgWhite(m.inverse(" space ")))} to select, ${m.gray(m.bgWhite(m.inverse(" enter ")))} to submit`))}`},render(){const n=`${m.gray(B)}
36
+ ${Q(this.state)} ${i.message}
37
+ `,r=(s,D)=>{const e=this.value.includes(s.value);return D&&e?t(s,"active-selected"):e?t(s,"selected"):t(s,D?"active":"inactive")};switch(this.state){case"submit":return`${n}${m.gray(B)} ${this.options.filter(({value:s})=>this.value.includes(s)).map(s=>t(s,"submitted")).join(m.dim(", "))||m.dim("none")}`;case"cancel":{const s=this.options.filter(({value:D})=>this.value.includes(D)).map(D=>t(D,"cancelled")).join(m.dim(", "));return`${n}${m.gray(B)} ${s.trim()?`${s}
38
+ ${m.gray(B)}`:""}`}case"error":{const s=this.error.split(`
39
+ `).map((D,e)=>e===0?`${m.yellow(R)} ${m.yellow(D)}`:` ${D}`).join(`
40
+ `);return`${n+m.yellow(B)} ${Ee({options:this.options,cursor:this.cursor,maxItems:i.maxItems,style:r}).join(`
41
+ ${m.yellow(B)} `)}
42
+ ${s}
43
+ `}default:return`${n}${m.cyan(B)} ${Ee({options:this.options,cursor:this.cursor,maxItems:i.maxItems,style:r}).join(`
44
+ ${m.cyan(B)} `)}
45
+ ${m.cyan(R)}
46
+ `}}}).prompt()},tt=(i="")=>{process.stdout.write(`${m.gray(ou)} ${i}
47
+ `)},Cu=(i="")=>{process.stdout.write(`${m.gray(B)}
48
+ ${m.gray(R)} ${i}
49
+
50
+ `)},O={message:(i="",{symbol:t=m.gray(B)}={})=>{const n=[`${m.gray(B)}`];if(i){const[r,...s]=i.split(`
51
+ `);n.push(`${t} ${r}`,...s.map(D=>`${m.gray(B)} ${D}`))}process.stdout.write(`${n.join(`
52
+ `)}
53
+ `)},info:i=>{O.message(i,{symbol:m.blue(cu)})},success:i=>{O.message(i,{symbol:m.green(hu)})},step:i=>{O.message(i,{symbol:m.green(Ce)})},warn:i=>{O.message(i,{symbol:m.yellow(pu)})},warning:i=>{O.warn(i)},error:i=>{O.message(i,{symbol:m.red(mu)})}};`${m.gray(B)}`;const fu=({indicator:i="dots"}={})=>{const t=Fe?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],n=Fe?80:120,r=process.env.CI==="true";let s,D,e=!1,a="",h,d=performance.now();const g=l=>{const p=l>1?"Something went wrong":"Canceled";e&&o(p,l)},f=()=>g(2),_=()=>g(1),S=()=>{process.on("uncaughtExceptionMonitor",f),process.on("unhandledRejection",f),process.on("SIGINT",_),process.on("SIGTERM",_),process.on("exit",g)},T=()=>{process.removeListener("uncaughtExceptionMonitor",f),process.removeListener("unhandledRejection",f),process.removeListener("SIGINT",_),process.removeListener("SIGTERM",_),process.removeListener("exit",g)},M=()=>{if(h===void 0)return;r&&process.stdout.write(`
54
+ `);const l=h.split(`
55
+ `);process.stdout.write(j.cursor.move(-999,l.length-1)),process.stdout.write(j.erase.down(l.length))},v=l=>l.replace(/\.+$/,""),y=l=>{const p=(performance.now()-l)/1e3,c=Math.floor(p/60),F=Math.floor(p%60);return c>0?`[${c}m ${F}s]`:`[${F}s]`},u=(l="")=>{e=!0,s=Yt(),a=v(l),d=performance.now(),process.stdout.write(`${m.gray(B)}
56
+ `);let p=0,c=0;S(),D=setInterval(()=>{if(r&&a===h)return;M(),h=a;const F=m.magenta(t[p]);if(r)process.stdout.write(`${F} ${a}...`);else if(i==="timer")process.stdout.write(`${F} ${a} ${y(d)}`);else{const E=".".repeat(Math.floor(c)).slice(0,3);process.stdout.write(`${F} ${a}${E}`)}p=p+1<t.length?p+1:0,c=c<t.length?c+.125:0},n)},o=(l="",p=0)=>{e=!1,clearInterval(D),M();const c=p===0?m.green(Ce):p===1?m.red(Ze):m.red(Qe);a=v(l??a),i==="timer"?process.stdout.write(`${c} ${a} ${y(d)}
57
+ `):process.stdout.write(`${c} ${a}
58
+ `),T(),s()};return{start:u,stop:o,message:(l="")=>{a=v(l??a)}}};var X={exports:{}},ee={},te={},ut;function ue(){if(ut)return te;ut=1;class i extends Error{constructor(r,s,D){super(D),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=s,this.exitCode=r,this.nestedError=void 0}}class t extends i{constructor(r){super(1,"commander.invalidArgument",r),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}return te.CommanderError=i,te.InvalidArgumentError=t,te}var rt;function Ae(){if(rt)return ee;rt=1;const{InvalidArgumentError:i}=ue();class t{constructor(s,D){switch(this.description=D||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,s[0]){case"<":this.required=!0,this._name=s.slice(1,-1);break;case"[":this.required=!1,this._name=s.slice(1,-1);break;default:this.required=!0,this._name=s;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(s,D){return D===this.defaultValue||!Array.isArray(D)?[s]:D.concat(s)}default(s,D){return this.defaultValue=s,this.defaultValueDescription=D,this}argParser(s){return this.parseArg=s,this}choices(s){return this.argChoices=s.slice(),this.parseArg=(D,e)=>{if(!this.argChoices.includes(D))throw new i(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(D,e):D},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function n(r){const s=r.name()+(r.variadic===!0?"...":"");return r.required?"<"+s+">":"["+s+"]"}return ee.Argument=t,ee.humanReadableArgName=n,ee}var _e={},Be={},st;function it(){if(st)return Be;st=1;const{humanReadableArgName:i}=Ae();class t{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}visibleCommands(r){const s=r.commands.filter(D=>!D._hidden);if(r._hasImplicitHelpCommand()){const[,D,e]=r._helpCommandnameAndArgs.match(/([^ ]+) *(.*)/),a=r.createCommand(D).helpOption(!1);a.description(r._helpCommandDescription),e&&a.arguments(e),s.push(a)}return this.sortSubcommands&&s.sort((D,e)=>D.name().localeCompare(e.name())),s}compareOptions(r,s){const D=e=>e.short?e.short.replace(/^-/,""):e.long.replace(/^--/,"");return D(r).localeCompare(D(s))}visibleOptions(r){const s=r.options.filter(a=>!a.hidden),D=r._hasHelpOption&&r._helpShortFlag&&!r._findOption(r._helpShortFlag),e=r._hasHelpOption&&!r._findOption(r._helpLongFlag);if(D||e){let a;D?e?a=r.createOption(r._helpFlags,r._helpDescription):a=r.createOption(r._helpShortFlag,r._helpDescription):a=r.createOption(r._helpLongFlag,r._helpDescription),s.push(a)}return this.sortOptions&&s.sort(this.compareOptions),s}visibleGlobalOptions(r){if(!this.showGlobalOptions)return[];const s=[];for(let D=r.parent;D;D=D.parent){const e=D.options.filter(a=>!a.hidden);s.push(...e)}return this.sortOptions&&s.sort(this.compareOptions),s}visibleArguments(r){return r._argsDescription&&r._args.forEach(s=>{s.description=s.description||r._argsDescription[s.name()]||""}),r._args.find(s=>s.description)?r._args:[]}subcommandTerm(r){const s=r._args.map(D=>i(D)).join(" ");return r._name+(r._aliases[0]?"|"+r._aliases[0]:"")+(r.options.length?" [options]":"")+(s?" "+s:"")}optionTerm(r){return r.flags}argumentTerm(r){return r.name()}longestSubcommandTermLength(r,s){return s.visibleCommands(r).reduce((D,e)=>Math.max(D,s.subcommandTerm(e).length),0)}longestOptionTermLength(r,s){return s.visibleOptions(r).reduce((D,e)=>Math.max(D,s.optionTerm(e).length),0)}longestGlobalOptionTermLength(r,s){return s.visibleGlobalOptions(r).reduce((D,e)=>Math.max(D,s.optionTerm(e).length),0)}longestArgumentTermLength(r,s){return s.visibleArguments(r).reduce((D,e)=>Math.max(D,s.argumentTerm(e).length),0)}commandUsage(r){let s=r._name;r._aliases[0]&&(s=s+"|"+r._aliases[0]);let D="";for(let e=r.parent;e;e=e.parent)D=e.name()+" "+D;return D+s+" "+r.usage()}commandDescription(r){return r.description()}subcommandDescription(r){return r.summary()||r.description()}optionDescription(r){const s=[];return r.argChoices&&s.push(`choices: ${r.argChoices.map(D=>JSON.stringify(D)).join(", ")}`),r.defaultValue!==void 0&&(r.required||r.optional||r.isBoolean()&&typeof r.defaultValue=="boolean")&&s.push(`default: ${r.defaultValueDescription||JSON.stringify(r.defaultValue)}`),r.presetArg!==void 0&&r.optional&&s.push(`preset: ${JSON.stringify(r.presetArg)}`),r.envVar!==void 0&&s.push(`env: ${r.envVar}`),s.length>0?`${r.description} (${s.join(", ")})`:r.description}argumentDescription(r){const s=[];if(r.argChoices&&s.push(`choices: ${r.argChoices.map(D=>JSON.stringify(D)).join(", ")}`),r.defaultValue!==void 0&&s.push(`default: ${r.defaultValueDescription||JSON.stringify(r.defaultValue)}`),s.length>0){const D=`(${s.join(", ")})`;return r.description?`${r.description} ${D}`:D}return r.description}formatHelp(r,s){const D=s.padWidth(r,s),e=s.helpWidth||80,a=2,h=2;function d(v,y){if(y){const u=`${v.padEnd(D+h)}${y}`;return s.wrap(u,e-a,D+h)}return v}function g(v){return v.join(`
59
+ `).replace(/^/gm," ".repeat(a))}let f=[`Usage: ${s.commandUsage(r)}`,""];const _=s.commandDescription(r);_.length>0&&(f=f.concat([s.wrap(_,e,0),""]));const S=s.visibleArguments(r).map(v=>d(s.argumentTerm(v),s.argumentDescription(v)));S.length>0&&(f=f.concat(["Arguments:",g(S),""]));const T=s.visibleOptions(r).map(v=>d(s.optionTerm(v),s.optionDescription(v)));if(T.length>0&&(f=f.concat(["Options:",g(T),""])),this.showGlobalOptions){const v=s.visibleGlobalOptions(r).map(y=>d(s.optionTerm(y),s.optionDescription(y)));v.length>0&&(f=f.concat(["Global Options:",g(v),""]))}const M=s.visibleCommands(r).map(v=>d(s.subcommandTerm(v),s.subcommandDescription(v)));return M.length>0&&(f=f.concat(["Commands:",g(M),""])),f.join(`
60
+ `)}padWidth(r,s){return Math.max(s.longestOptionTermLength(r,s),s.longestGlobalOptionTermLength(r,s),s.longestSubcommandTermLength(r,s),s.longestArgumentTermLength(r,s))}wrap(r,s,D,e=40){const a=" \\f\\t\\v\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF",h=new RegExp(`[\\n][${a}]+`);if(r.match(h))return r;const d=s-D;if(d<e)return r;const g=r.slice(0,D),f=r.slice(D).replace(`\r
61
+ `,`
62
+ `),_=" ".repeat(D),T="\\s\u200B",M=new RegExp(`
63
+ |.{1,${d-1}}([${T}]|$)|[^${T}]+?([${T}]|$)`,"g"),v=f.match(M)||[];return g+v.map((y,u)=>y===`
64
+ `?"":(u>0?_:"")+y.trimEnd()).join(`
65
+ `)}}return Be.Help=t,Be}var q={},nt;function Dt(){if(nt)return q;nt=1;const{InvalidArgumentError:i}=ue();class t{constructor(e,a){this.flags=e,this.description=a||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;const h=s(e);this.short=h.shortFlag,this.long=h.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}default(e,a){return this.defaultValue=e,this.defaultValueDescription=a,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let a=e;return typeof e=="string"&&(a={[e]:!0}),this.implied=Object.assign(this.implied||{},a),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}_concatValue(e,a){return a===this.defaultValue||!Array.isArray(a)?[e]:a.concat(e)}choices(e){return this.argChoices=e.slice(),this.parseArg=(a,h)=>{if(!this.argChoices.includes(a))throw new i(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(a,h):a},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return r(this.name().replace(/^no-/,""))}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class n{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(a=>{a.negate?this.negativeOptions.set(a.attributeName(),a):this.positiveOptions.set(a.attributeName(),a)}),this.negativeOptions.forEach((a,h)=>{this.positiveOptions.has(h)&&this.dualOptions.add(h)})}valueFromOption(e,a){const h=a.attributeName();if(!this.dualOptions.has(h))return!0;const d=this.negativeOptions.get(h).presetArg,g=d!==void 0?d:!1;return a.negate===(g===e)}}function r(D){return D.split("-").reduce((e,a)=>e+a[0].toUpperCase()+a.slice(1))}function s(D){let e,a;const h=D.split(/[ |,]+/);return h.length>1&&!/^[[<]/.test(h[1])&&(e=h.shift()),a=h.shift(),!e&&/^-[^-]$/.test(a)&&(e=a,a=void 0),{shortFlag:e,longFlag:a}}return q.Option=t,q.splitOptionFlags=s,q.DualOptions=n,q}var ve={},ot;function gu(){if(ot)return ve;ot=1;const i=3;function t(r,s){if(Math.abs(r.length-s.length)>i)return Math.max(r.length,s.length);const D=[];for(let e=0;e<=r.length;e++)D[e]=[e];for(let e=0;e<=s.length;e++)D[0][e]=e;for(let e=1;e<=s.length;e++)for(let a=1;a<=r.length;a++){let h=1;r[a-1]===s[e-1]?h=0:h=1,D[a][e]=Math.min(D[a-1][e]+1,D[a][e-1]+1,D[a-1][e-1]+h),a>1&&e>1&&r[a-1]===s[e-2]&&r[a-2]===s[e-1]&&(D[a][e]=Math.min(D[a][e],D[a-2][e-2]+1))}return D[r.length][s.length]}function n(r,s){if(!s||s.length===0)return"";s=Array.from(new Set(s));const D=r.startsWith("--");D&&(r=r.slice(2),s=s.map(d=>d.slice(2)));let e=[],a=i;const h=.4;return s.forEach(d=>{if(d.length<=1)return;const g=t(r,d),f=Math.max(r.length,d.length);(f-g)/f>h&&(g<a?(a=g,e=[d]):g===a&&e.push(d))}),e.sort((d,g)=>d.localeCompare(g)),D&&(e=e.map(d=>`--${d}`)),e.length>1?`
66
+ (Did you mean one of ${e.join(", ")}?)`:e.length===1?`
67
+ (Did you mean ${e[0]}?)`:""}return ve.suggestSimilar=n,ve}var at;function Eu(){if(at)return _e;at=1;const i=gt.EventEmitter,t=Et,n=bt,r=At,s=_t,{Argument:D,humanReadableArgName:e}=Ae(),{CommanderError:a}=ue(),{Help:h}=it(),{Option:d,splitOptionFlags:g,DualOptions:f}=Dt(),{suggestSimilar:_}=gu();class S extends i{constructor(u){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this._args=[],this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=u||"",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._outputConfiguration={writeOut:o=>s.stdout.write(o),writeErr:o=>s.stderr.write(o),getOutHelpWidth:()=>s.stdout.isTTY?s.stdout.columns:void 0,getErrHelpWidth:()=>s.stderr.isTTY?s.stderr.columns:void 0,outputError:(o,l)=>l(o)},this._hidden=!1,this._hasHelpOption=!0,this._helpFlags="-h, --help",this._helpDescription="display help for command",this._helpShortFlag="-h",this._helpLongFlag="--help",this._addImplicitHelpCommand=void 0,this._helpCommandName="help",this._helpCommandnameAndArgs="help [command]",this._helpCommandDescription="display help for command",this._helpConfiguration={}}copyInheritedSettings(u){return this._outputConfiguration=u._outputConfiguration,this._hasHelpOption=u._hasHelpOption,this._helpFlags=u._helpFlags,this._helpDescription=u._helpDescription,this._helpShortFlag=u._helpShortFlag,this._helpLongFlag=u._helpLongFlag,this._helpCommandName=u._helpCommandName,this._helpCommandnameAndArgs=u._helpCommandnameAndArgs,this._helpCommandDescription=u._helpCommandDescription,this._helpConfiguration=u._helpConfiguration,this._exitCallback=u._exitCallback,this._storeOptionsAsProperties=u._storeOptionsAsProperties,this._combineFlagAndOptionalValue=u._combineFlagAndOptionalValue,this._allowExcessArguments=u._allowExcessArguments,this._enablePositionalOptions=u._enablePositionalOptions,this._showHelpAfterError=u._showHelpAfterError,this._showSuggestionAfterError=u._showSuggestionAfterError,this}command(u,o,l){let p=o,c=l;typeof p=="object"&&p!==null&&(c=p,p=null),c=c||{};const[,F,E]=u.match(/([^ ]+) *(.*)/),C=this.createCommand(F);return p&&(C.description(p),C._executableHandler=!0),c.isDefault&&(this._defaultCommandName=C._name),C._hidden=!!(c.noHelp||c.hidden),C._executableFile=c.executableFile||null,E&&C.arguments(E),this.commands.push(C),C.parent=this,C.copyInheritedSettings(this),p?this:C}createCommand(u){return new S(u)}createHelp(){return Object.assign(new h,this.configureHelp())}configureHelp(u){return u===void 0?this._helpConfiguration:(this._helpConfiguration=u,this)}configureOutput(u){return u===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,u),this)}showHelpAfterError(u=!0){return typeof u!="string"&&(u=!!u),this._showHelpAfterError=u,this}showSuggestionAfterError(u=!0){return this._showSuggestionAfterError=!!u,this}addCommand(u,o){if(!u._name)throw new Error(`Command passed to .addCommand() must have a name
68
+ - specify the name in Command constructor or using .name()`);return o=o||{},o.isDefault&&(this._defaultCommandName=u._name),(o.noHelp||o.hidden)&&(u._hidden=!0),this.commands.push(u),u.parent=this,this}createArgument(u,o){return new D(u,o)}argument(u,o,l,p){const c=this.createArgument(u,o);return typeof l=="function"?c.default(p).argParser(l):c.default(l),this.addArgument(c),this}arguments(u){return u.split(/ +/).forEach(o=>{this.argument(o)}),this}addArgument(u){const o=this._args.slice(-1)[0];if(o&&o.variadic)throw new Error(`only the last argument can be variadic '${o.name()}'`);if(u.required&&u.defaultValue!==void 0&&u.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${u.name()}'`);return this._args.push(u),this}addHelpCommand(u,o){return u===!1?this._addImplicitHelpCommand=!1:(this._addImplicitHelpCommand=!0,typeof u=="string"&&(this._helpCommandName=u.split(" ")[0],this._helpCommandnameAndArgs=u),this._helpCommandDescription=o||this._helpCommandDescription),this}_hasImplicitHelpCommand(){return this._addImplicitHelpCommand===void 0?this.commands.length&&!this._actionHandler&&!this._findCommand("help"):this._addImplicitHelpCommand}hook(u,o){const l=["preSubcommand","preAction","postAction"];if(!l.includes(u))throw new Error(`Unexpected value for event passed to hook : '${u}'.
69
+ Expecting one of '${l.join("', '")}'`);return this._lifeCycleHooks[u]?this._lifeCycleHooks[u].push(o):this._lifeCycleHooks[u]=[o],this}exitOverride(u){return u?this._exitCallback=u:this._exitCallback=o=>{if(o.code!=="commander.executeSubCommandAsync")throw o},this}_exit(u,o,l){this._exitCallback&&this._exitCallback(new a(u,o,l)),s.exit(u)}action(u){const o=l=>{const p=this._args.length,c=l.slice(0,p);return this._storeOptionsAsProperties?c[p]=this:c[p]=this.opts(),c.push(this),u.apply(this,c)};return this._actionHandler=o,this}createOption(u,o){return new d(u,o)}addOption(u){const o=u.name(),l=u.attributeName();if(u.negate){const c=u.long.replace(/^--no-/,"--");this._findOption(c)||this.setOptionValueWithSource(l,u.defaultValue===void 0?!0:u.defaultValue,"default")}else u.defaultValue!==void 0&&this.setOptionValueWithSource(l,u.defaultValue,"default");this.options.push(u);const p=(c,F,E)=>{c==null&&u.presetArg!==void 0&&(c=u.presetArg);const C=this.getOptionValue(l);if(c!==null&&u.parseArg)try{c=u.parseArg(c,C)}catch(b){if(b.code==="commander.invalidArgument"){const A=`${F} ${b.message}`;this.error(A,{exitCode:b.exitCode,code:b.code})}throw b}else c!==null&&u.variadic&&(c=u._concatValue(c,C));c==null&&(u.negate?c=!1:u.isBoolean()||u.optional?c=!0:c=""),this.setOptionValueWithSource(l,c,E)};return this.on("option:"+o,c=>{const F=`error: option '${u.flags}' argument '${c}' is invalid.`;p(c,F,"cli")}),u.envVar&&this.on("optionEnv:"+o,c=>{const F=`error: option '${u.flags}' value '${c}' from env '${u.envVar}' is invalid.`;p(c,F,"env")}),this}_optionEx(u,o,l,p,c){if(typeof o=="object"&&o instanceof d)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");const F=this.createOption(o,l);if(F.makeOptionMandatory(!!u.mandatory),typeof p=="function")F.default(c).argParser(p);else if(p instanceof RegExp){const E=p;p=(C,b)=>{const A=E.exec(C);return A?A[0]:b},F.default(c).argParser(p)}else F.default(p);return this.addOption(F)}option(u,o,l,p){return this._optionEx({},u,o,l,p)}requiredOption(u,o,l,p){return this._optionEx({mandatory:!0},u,o,l,p)}combineFlagAndOptionalValue(u=!0){return this._combineFlagAndOptionalValue=!!u,this}allowUnknownOption(u=!0){return this._allowUnknownOption=!!u,this}allowExcessArguments(u=!0){return this._allowExcessArguments=!!u,this}enablePositionalOptions(u=!0){return this._enablePositionalOptions=!!u,this}passThroughOptions(u=!0){if(this._passThroughOptions=!!u,this.parent&&u&&!this.parent._enablePositionalOptions)throw new Error("passThroughOptions can not be used without turning on enablePositionalOptions for parent command(s)");return this}storeOptionsAsProperties(u=!0){if(this._storeOptionsAsProperties=!!u,this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");return this}getOptionValue(u){return this._storeOptionsAsProperties?this[u]:this._optionValues[u]}setOptionValue(u,o){return this.setOptionValueWithSource(u,o,void 0)}setOptionValueWithSource(u,o,l){return this._storeOptionsAsProperties?this[u]=o:this._optionValues[u]=o,this._optionValueSources[u]=l,this}getOptionValueSource(u){return this._optionValueSources[u]}getOptionValueSourceWithGlobals(u){let o;return v(this).forEach(l=>{l.getOptionValueSource(u)!==void 0&&(o=l.getOptionValueSource(u))}),o}_prepareUserArgs(u,o){if(u!==void 0&&!Array.isArray(u))throw new Error("first parameter to parse must be array or undefined");o=o||{},u===void 0&&(u=s.argv,s.versions&&s.versions.electron&&(o.from="electron")),this.rawArgs=u.slice();let l;switch(o.from){case void 0:case"node":this._scriptPath=u[1],l=u.slice(2);break;case"electron":s.defaultApp?(this._scriptPath=u[1],l=u.slice(2)):l=u.slice(1);break;case"user":l=u.slice(0);break;default:throw new Error(`unexpected parse option { from: '${o.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",l}parse(u,o){const l=this._prepareUserArgs(u,o);return this._parseCommand([],l),this}async parseAsync(u,o){const l=this._prepareUserArgs(u,o);return await this._parseCommand([],l),this}_executeSubCommand(u,o){o=o.slice();let l=!1;const p=[".js",".ts",".tsx",".mjs",".cjs"];function c(A,x){const G=n.resolve(A,x);if(r.existsSync(G))return G;if(p.includes(n.extname(x)))return;const Se=p.find(Ft=>r.existsSync(`${G}${Ft}`));if(Se)return`${G}${Se}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let F=u._executableFile||`${this._name}-${u._name}`,E=this._executableDir||"";if(this._scriptPath){let A;try{A=r.realpathSync(this._scriptPath)}catch{A=this._scriptPath}E=n.resolve(n.dirname(A),E)}if(E){let A=c(E,F);if(!A&&!u._executableFile&&this._scriptPath){const x=n.basename(this._scriptPath,n.extname(this._scriptPath));x!==this._name&&(A=c(E,`${x}-${u._name}`))}F=A||F}l=p.includes(n.extname(F));let C;s.platform!=="win32"?l?(o.unshift(F),o=M(s.execArgv).concat(o),C=t.spawn(s.argv[0],o,{stdio:"inherit"})):C=t.spawn(F,o,{stdio:"inherit"}):(o.unshift(F),o=M(s.execArgv).concat(o),C=t.spawn(s.execPath,o,{stdio:"inherit"})),C.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(x=>{s.on(x,()=>{C.killed===!1&&C.exitCode===null&&C.kill(x)})});const b=this._exitCallback;b?C.on("close",()=>{b(new a(s.exitCode||0,"commander.executeSubCommandAsync","(close)"))}):C.on("close",s.exit.bind(s)),C.on("error",A=>{if(A.code==="ENOENT"){const x=E?`searched for local subcommand relative to directory '${E}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",G=`'${F}' does not exist
70
+ - if '${u._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
71
+ - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
72
+ - ${x}`;throw new Error(G)}else if(A.code==="EACCES")throw new Error(`'${F}' not executable`);if(!b)s.exit(1);else{const x=new a(1,"commander.executeSubCommandAsync","(error)");x.nestedError=A,b(x)}}),this.runningCommand=C}_dispatchSubcommand(u,o,l){const p=this._findCommand(u);p||this.help({error:!0});let c;return c=this._chainOrCallSubCommandHook(c,p,"preSubcommand"),c=this._chainOrCall(c,()=>{if(p._executableHandler)this._executeSubCommand(p,o.concat(l));else return p._parseCommand(o,l)}),c}_checkNumberOfArguments(){this._args.forEach((u,o)=>{u.required&&this.args[o]==null&&this.missingArgument(u.name())}),!(this._args.length>0&&this._args[this._args.length-1].variadic)&&this.args.length>this._args.length&&this._excessArguments(this.args)}_processArguments(){const u=(l,p,c)=>{let F=p;if(p!==null&&l.parseArg)try{F=l.parseArg(p,c)}catch(E){if(E.code==="commander.invalidArgument"){const C=`error: command-argument value '${p}' is invalid for argument '${l.name()}'. ${E.message}`;this.error(C,{exitCode:E.exitCode,code:E.code})}throw E}return F};this._checkNumberOfArguments();const o=[];this._args.forEach((l,p)=>{let c=l.defaultValue;l.variadic?p<this.args.length?(c=this.args.slice(p),l.parseArg&&(c=c.reduce((F,E)=>u(l,E,F),l.defaultValue))):c===void 0&&(c=[]):p<this.args.length&&(c=this.args[p],l.parseArg&&(c=u(l,c,l.defaultValue))),o[p]=c}),this.processedArgs=o}_chainOrCall(u,o){return u&&u.then&&typeof u.then=="function"?u.then(()=>o()):o()}_chainOrCallHooks(u,o){let l=u;const p=[];return v(this).reverse().filter(c=>c._lifeCycleHooks[o]!==void 0).forEach(c=>{c._lifeCycleHooks[o].forEach(F=>{p.push({hookedCommand:c,callback:F})})}),o==="postAction"&&p.reverse(),p.forEach(c=>{l=this._chainOrCall(l,()=>c.callback(c.hookedCommand,this))}),l}_chainOrCallSubCommandHook(u,o,l){let p=u;return this._lifeCycleHooks[l]!==void 0&&this._lifeCycleHooks[l].forEach(c=>{p=this._chainOrCall(p,()=>c(this,o))}),p}_parseCommand(u,o){const l=this.parseOptions(o);if(this._parseOptionsEnv(),this._parseOptionsImplied(),u=u.concat(l.operands),o=l.unknown,this.args=u.concat(o),u&&this._findCommand(u[0]))return this._dispatchSubcommand(u[0],u.slice(1),o);if(this._hasImplicitHelpCommand()&&u[0]===this._helpCommandName)return u.length===1&&this.help(),this._dispatchSubcommand(u[1],[],[this._helpLongFlag]);if(this._defaultCommandName)return T(this,o),this._dispatchSubcommand(this._defaultCommandName,u,o);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),T(this,l.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();const p=()=>{l.unknown.length>0&&this.unknownOption(l.unknown[0])},c=`command:${this.name()}`;if(this._actionHandler){p(),this._processArguments();let F;return F=this._chainOrCallHooks(F,"preAction"),F=this._chainOrCall(F,()=>this._actionHandler(this.processedArgs)),this.parent&&(F=this._chainOrCall(F,()=>{this.parent.emit(c,u,o)})),F=this._chainOrCallHooks(F,"postAction"),F}if(this.parent&&this.parent.listenerCount(c))p(),this._processArguments(),this.parent.emit(c,u,o);else if(u.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",u,o);this.listenerCount("command:*")?this.emit("command:*",u,o):this.commands.length?this.unknownCommand():(p(),this._processArguments())}else this.commands.length?(p(),this.help({error:!0})):(p(),this._processArguments())}_findCommand(u){if(u)return this.commands.find(o=>o._name===u||o._aliases.includes(u))}_findOption(u){return this.options.find(o=>o.is(u))}_checkForMissingMandatoryOptions(){for(let u=this;u;u=u.parent)u.options.forEach(o=>{o.mandatory&&u.getOptionValue(o.attributeName())===void 0&&u.missingMandatoryOptionValue(o)})}_checkForConflictingLocalOptions(){const u=this.options.filter(l=>{const p=l.attributeName();return this.getOptionValue(p)===void 0?!1:this.getOptionValueSource(p)!=="default"});u.filter(l=>l.conflictsWith.length>0).forEach(l=>{const p=u.find(c=>l.conflictsWith.includes(c.attributeName()));p&&this._conflictingOption(l,p)})}_checkForConflictingOptions(){for(let u=this;u;u=u.parent)u._checkForConflictingLocalOptions()}parseOptions(u){const o=[],l=[];let p=o;const c=u.slice();function F(C){return C.length>1&&C[0]==="-"}let E=null;for(;c.length;){const C=c.shift();if(C==="--"){p===l&&p.push(C),p.push(...c);break}if(E&&!F(C)){this.emit(`option:${E.name()}`,C);continue}if(E=null,F(C)){const b=this._findOption(C);if(b){if(b.required){const A=c.shift();A===void 0&&this.optionMissingArgument(b),this.emit(`option:${b.name()}`,A)}else if(b.optional){let A=null;c.length>0&&!F(c[0])&&(A=c.shift()),this.emit(`option:${b.name()}`,A)}else this.emit(`option:${b.name()}`);E=b.variadic?b:null;continue}}if(C.length>2&&C[0]==="-"&&C[1]!=="-"){const b=this._findOption(`-${C[1]}`);if(b){b.required||b.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${b.name()}`,C.slice(2)):(this.emit(`option:${b.name()}`),c.unshift(`-${C.slice(2)}`));continue}}if(/^--[^=]+=/.test(C)){const b=C.indexOf("="),A=this._findOption(C.slice(0,b));if(A&&(A.required||A.optional)){this.emit(`option:${A.name()}`,C.slice(b+1));continue}}if(F(C)&&(p=l),(this._enablePositionalOptions||this._passThroughOptions)&&o.length===0&&l.length===0){if(this._findCommand(C)){o.push(C),c.length>0&&l.push(...c);break}else if(C===this._helpCommandName&&this._hasImplicitHelpCommand()){o.push(C),c.length>0&&o.push(...c);break}else if(this._defaultCommandName){l.push(C),c.length>0&&l.push(...c);break}}if(this._passThroughOptions){p.push(C),c.length>0&&p.push(...c);break}p.push(C)}return{operands:o,unknown:l}}opts(){if(this._storeOptionsAsProperties){const u={},o=this.options.length;for(let l=0;l<o;l++){const p=this.options[l].attributeName();u[p]=p===this._versionOptionName?this._version:this[p]}return u}return this._optionValues}optsWithGlobals(){return v(this).reduce((u,o)=>Object.assign(u,o.opts()),{})}error(u,o){this._outputConfiguration.outputError(`${u}
73
+ `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
74
+ `):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
75
+ `),this.outputHelp({error:!0}));const l=o||{},p=l.exitCode||1,c=l.code||"commander.error";this._exit(p,c,u)}_parseOptionsEnv(){this.options.forEach(u=>{if(u.envVar&&u.envVar in s.env){const o=u.attributeName();(this.getOptionValue(o)===void 0||["default","config","env"].includes(this.getOptionValueSource(o)))&&(u.required||u.optional?this.emit(`optionEnv:${u.name()}`,s.env[u.envVar]):this.emit(`optionEnv:${u.name()}`))}})}_parseOptionsImplied(){const u=new f(this.options),o=l=>this.getOptionValue(l)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(l));this.options.filter(l=>l.implied!==void 0&&o(l.attributeName())&&u.valueFromOption(this.getOptionValue(l.attributeName()),l)).forEach(l=>{Object.keys(l.implied).filter(p=>!o(p)).forEach(p=>{this.setOptionValueWithSource(p,l.implied[p],"implied")})})}missingArgument(u){const o=`error: missing required argument '${u}'`;this.error(o,{code:"commander.missingArgument"})}optionMissingArgument(u){const o=`error: option '${u.flags}' argument missing`;this.error(o,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(u){const o=`error: required option '${u.flags}' not specified`;this.error(o,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(u,o){const l=F=>{const E=F.attributeName(),C=this.getOptionValue(E),b=this.options.find(x=>x.negate&&E===x.attributeName()),A=this.options.find(x=>!x.negate&&E===x.attributeName());return b&&(b.presetArg===void 0&&C===!1||b.presetArg!==void 0&&C===b.presetArg)?b:A||F},p=F=>{const E=l(F),C=E.attributeName();return this.getOptionValueSource(C)==="env"?`environment variable '${E.envVar}'`:`option '${E.flags}'`},c=`error: ${p(u)} cannot be used with ${p(o)}`;this.error(c,{code:"commander.conflictingOption"})}unknownOption(u){if(this._allowUnknownOption)return;let o="";if(u.startsWith("--")&&this._showSuggestionAfterError){let p=[],c=this;do{const F=c.createHelp().visibleOptions(c).filter(E=>E.long).map(E=>E.long);p=p.concat(F),c=c.parent}while(c&&!c._enablePositionalOptions);o=_(u,p)}const l=`error: unknown option '${u}'${o}`;this.error(l,{code:"commander.unknownOption"})}_excessArguments(u){if(this._allowExcessArguments)return;const o=this._args.length,l=o===1?"":"s",c=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${o} argument${l} but got ${u.length}.`;this.error(c,{code:"commander.excessArguments"})}unknownCommand(){const u=this.args[0];let o="";if(this._showSuggestionAfterError){const p=[];this.createHelp().visibleCommands(this).forEach(c=>{p.push(c.name()),c.alias()&&p.push(c.alias())}),o=_(u,p)}const l=`error: unknown command '${u}'${o}`;this.error(l,{code:"commander.unknownCommand"})}version(u,o,l){if(u===void 0)return this._version;this._version=u,o=o||"-V, --version",l=l||"output the version number";const p=this.createOption(o,l);return this._versionOptionName=p.attributeName(),this.options.push(p),this.on("option:"+p.name(),()=>{this._outputConfiguration.writeOut(`${u}
76
+ `),this._exit(0,"commander.version",u)}),this}description(u,o){return u===void 0&&o===void 0?this._description:(this._description=u,o&&(this._argsDescription=o),this)}summary(u){return u===void 0?this._summary:(this._summary=u,this)}alias(u){if(u===void 0)return this._aliases[0];let o=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(o=this.commands[this.commands.length-1]),u===o._name)throw new Error("Command alias can't be the same as its name");return o._aliases.push(u),this}aliases(u){return u===void 0?this._aliases:(u.forEach(o=>this.alias(o)),this)}usage(u){if(u===void 0){if(this._usage)return this._usage;const o=this._args.map(l=>e(l));return[].concat(this.options.length||this._hasHelpOption?"[options]":[],this.commands.length?"[command]":[],this._args.length?o:[]).join(" ")}return this._usage=u,this}name(u){return u===void 0?this._name:(this._name=u,this)}nameFromFilename(u){return this._name=n.basename(u,n.extname(u)),this}executableDir(u){return u===void 0?this._executableDir:(this._executableDir=u,this)}helpInformation(u){const o=this.createHelp();return o.helpWidth===void 0&&(o.helpWidth=u&&u.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),o.formatHelp(this,o)}_getHelpContext(u){u=u||{};const o={error:!!u.error};let l;return o.error?l=p=>this._outputConfiguration.writeErr(p):l=p=>this._outputConfiguration.writeOut(p),o.write=u.write||l,o.command=this,o}outputHelp(u){let o;typeof u=="function"&&(o=u,u=void 0);const l=this._getHelpContext(u);v(this).reverse().forEach(c=>c.emit("beforeAllHelp",l)),this.emit("beforeHelp",l);let p=this.helpInformation(l);if(o&&(p=o(p),typeof p!="string"&&!Buffer.isBuffer(p)))throw new Error("outputHelp callback must return a string or a Buffer");l.write(p),this.emit(this._helpLongFlag),this.emit("afterHelp",l),v(this).forEach(c=>c.emit("afterAllHelp",l))}helpOption(u,o){if(typeof u=="boolean")return this._hasHelpOption=u,this;this._helpFlags=u||this._helpFlags,this._helpDescription=o||this._helpDescription;const l=g(this._helpFlags);return this._helpShortFlag=l.shortFlag,this._helpLongFlag=l.longFlag,this}help(u){this.outputHelp(u);let o=s.exitCode||0;o===0&&u&&typeof u!="function"&&u.error&&(o=1),this._exit(o,"commander.help","(outputHelp)")}addHelpText(u,o){const l=["beforeAll","before","after","afterAll"];if(!l.includes(u))throw new Error(`Unexpected value for position to addHelpText.
77
+ Expecting one of '${l.join("', '")}'`);const p=`${u}Help`;return this.on(p,c=>{let F;typeof o=="function"?F=o({error:c.error,command:c.command}):F=o,F&&c.write(`${F}
78
+ `)}),this}}function T(y,u){y._hasHelpOption&&u.find(l=>l===y._helpLongFlag||l===y._helpShortFlag)&&(y.outputHelp(),y._exit(0,"commander.helpDisplayed","(outputHelp)"))}function M(y){return y.map(u=>{if(!u.startsWith("--inspect"))return u;let o,l="127.0.0.1",p="9229",c;return(c=u.match(/^(--inspect(-brk)?)$/))!==null?o=c[1]:(c=u.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(o=c[1],/^\d+$/.test(c[3])?p=c[3]:l=c[3]):(c=u.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(o=c[1],l=c[3],p=c[4]),o&&p!=="0"?`${o}=${l}:${parseInt(p)+1}`:u})}function v(y){const u=[];for(let o=y;o;o=o.parent)u.push(o);return u}return _e.Command=S,_e}var lt;function bu(){return lt||(lt=1,function(i,t){const{Argument:n}=Ae(),{Command:r}=Eu(),{CommanderError:s,InvalidArgumentError:D}=ue(),{Help:e}=it(),{Option:a}=Dt();t=i.exports=new r,t.program=t,t.Argument=n,t.Command=r,t.CommanderError=s,t.Help=e,t.InvalidArgumentError=D,t.InvalidOptionArgumentError=D,t.Option=a}(X,X.exports)),X.exports}var Au=bu();const _u=Ve(Au),{program:tr,createCommand:ur,createArgument:rr,createOption:sr,CommanderError:ir,InvalidArgumentError:nr,InvalidOptionArgumentError:Dr,Command:Bu,Argument:or,Option:ar,Help:lr}=_u;var L={};class vu extends Error{method;path;expected;value;fake_expected_typed_value_;constructor(t){super(t.message||`Error on ${t.method}(): invalid type${t.path?` on ${t.path}`:""}, expect to be ${t.expected}`);const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.method=t.method,this.path=t.path,this.expected=t.expected,this.value=t.value}}const $u={__proto__:null,TypeGuardError:vu},yu=wt($u);var ct;function wu(){if(ct)return L;ct=1,Object.defineProperty(L,"__esModule",{value:!0}),L._assertGuard=void 0;const i=yu,t=(n,r,s)=>{if(n===!0)throw s?s(r):new i.TypeGuardError(r);return!1};return L._assertGuard=t,L}var P=wu();function ht(i){return i.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join("")}async function $e(i){try{return await(await import("prettier")).format(i,{parser:"typescript"})}catch{return i}}const xu=Ct($t),Ou="https://raw.githubusercontent.com/wrtnlabs/connectors/refs/heads/main/connectors-list.json",ye="@wrtnlabs/connector-";function Su(i){return`${ye}${i}`}function ju(i){return i.replace(ye,"")}async function ku(){const i=await(await fetch(Ou)).json();return(()=>{const t=D=>Array.isArray(D.connectors)&&D.connectors.every(e=>typeof e=="string"&&RegExp(/^@wrtnlabs\/connector\x2d(.*)/).test(e))&&typeof D.version=="string",n=(D,e,a=!0)=>((Array.isArray(D.connectors)||P._assertGuard(a,{method:"typia.assert",path:e+".connectors",expected:"Array<`@wrtnlabs/connector-${string}`>",value:D.connectors},s))&&D.connectors.every((h,d)=>typeof h=="string"&&RegExp(/^@wrtnlabs\/connector\x2d(.*)/).test(h)||P._assertGuard(a,{method:"typia.assert",path:e+".connectors["+d+"]",expected:"`@wrtnlabs/connector-${string}`",value:h},s))||P._assertGuard(a,{method:"typia.assert",path:e+".connectors",expected:"Array<`@wrtnlabs/connector-${string}`>",value:D.connectors},s))&&(typeof D.version=="string"||P._assertGuard(a,{method:"typia.assert",path:e+".version",expected:"string",value:D.version},s)),r=D=>typeof D=="object"&&D!==null&&t(D);let s;return(D,e)=>(r(D)===!1&&(s=e,((a,h,d=!0)=>(typeof a=="object"&&a!==null||P._assertGuard(!0,{method:"typia.assert",path:h+"",expected:"UnwrapTaggedConnectors",value:a},s))&&n(a,h+"",!0)||P._assertGuard(!0,{method:"typia.assert",path:h+"",expected:"UnwrapTaggedConnectors",value:a},s))(D,"$input",!0)),D)})()(i)}async function Pu(){return(await ku()).connectors.map(i=>{const t=ju(i),n=t.replace("-"," ").toUpperCase();return{packageName:i,serviceName:t,displayName:n}})}function we(i){return i.map(t=>{const n=ht(t);return`{
79
+ name: "${n} Connector",
80
+ protocol: "class",
81
+ application: typia.llm.application<${n}Service, "chatgpt">(),
82
+ execute: new ${n}Service(),
83
+ }`}).join(`,
84
+ `)}function xe(i){return i.map(t=>`import { ${ht(t)}Service } from "${ye}${t}";`).join(`
85
+ `)}function Oe({content:i,importCode:t,connectorCode:n}){return i.replace("/// INSERT IMPORT HERE",t).replace("/// INSERT CONTROLLER HERE",n)}async function re({template:i,project:t}){await yt(`github:wrtnlabs/agentica.template.${i}`,{dir:t}),await Bt(N(t,".github/dependabot.yml"),{force:!0})}async function se({projectPath:i,dotEnvfileName:t,apiKeys:n}){if(!ne(i))throw new Error(`${i} directory does not exist.`);const r=N(i,t??".env"),s=(ne(r)?`
86
+ `:"")+n.map(({key:D,value:e})=>`${D}=${e}`).join(`
87
+ `);await vt(r,s)}function Vu({packageManager:i,pkg:t}){switch(i){case"npm":return`npm install ${t}`;case"yarn":return`yarn add ${t}`;case"pnpm":return`pnpm add ${t}`;case"bun":return`bun add ${t}`;default:throw new Error(`Unsupported package manager: ${i}`)}}function Tu(){const i=w.env.npm_config_user_agent;switch(!0){case i?.startsWith("npm"):return"npm";case i?.startsWith("yarn"):return"yarn";case i?.startsWith("pnpm"):return"pnpm";case i?.startsWith("bun"):return"bun";default:return"npm"}}async function ie({packageManager:i,projectAbsolutePath:t,services:n}){const r=[...n.map(e=>Su(e)),"typescript"].join(" "),s=Vu({packageManager:i,pkg:r}),D=fu();D.start("\u{1F4E6} Package installation in progress..."),await xu(s,{cwd:t}),D.stop("\u2705 Package installation completed")}async function Iu({template:i}){const t={template:i};{const n=await be({message:"Enter the project directory path:",placeholder:"./my-agentica-project",validate(s){if(s==="")return"Please enter a directory path";if(s[0]!==".")return"Please enter a relative path.";if(ne(s))return"Directory already exists"}});H(n)&&w.exit(0);const r=N(w.cwd(),n);t.projectAbsolutePath=r}{const n=await et({message:"Which package manager do you want to use?",initialValue:Tu(),options:[{value:"npm",label:"npm"},{value:"pnpm",label:"pnpm"},{value:"yarn",label:`yarn (${V.blueBright("berry is not supported")})`},{value:"bun",label:"bun"}]});H(n)&&w.exit(0),O.info(`\u{1F4E6} Using ${n} as package manager`),t.packageManager=n}if(t.template==null){const n=await et({message:"Which project type do you want to start?",options:[{value:"standalone",label:`Standalone ${V.blueBright("Agent Server")}`},{value:"nodejs",label:`NodeJS ${V.blueBright("Agent Server")}`},{value:"nestjs",label:`NestJS ${V.blueBright("Agent Server")}`},{value:"react",label:`React ${V.blueBright("Application")}`},{value:"nestjs+react",label:`NestJS + React ${V.blueBright("Agent Server + Client Application")}`}]});H(n)&&w.exit(0),t.template=n}if(t.template!=="standalone"){const n=await be({message:"Server Port(if project is client app, this port mean ws server port):",initialValue:"3000",validate(r){if(Number.isNaN(Number.parseInt(r)))return"Port must be an integer"}});H(n)&&w.exit(0),t.port=Number(n)}if(t.template!=="react"){const n=(await Pu()).sort((s,D)=>s.displayName.localeCompare(D.displayName)).map(({displayName:s,serviceName:D})=>({label:s,value:D})),r=await Fu({message:`Which connectors do you want to include? (Press ${V.cyan("<space>")} to select, ${V.cyan("<a>")} to select all, ${V.cyan("<enter>")} to proceed)`,options:n,required:!1});H(r)&&w.exit(0),t.services=r}{const n=await du({message:"Enter your OpenAI API key?",initialValue:!1});if(H(n)&&w.exit(0),n){const r=await be({message:"Please enter your OPENAI API key:"});H(r)&&w.exit(0),t.openAIKey=r}else t.openAIKey=null}try{(()=>{const n=e=>(e.packageManager==="npm"||e.packageManager==="yarn"||e.packageManager==="pnpm"||e.packageManager==="bun")&&typeof e.projectAbsolutePath=="string"&&(e.template==="nodejs"||e.template==="nestjs"||e.template==="react"||e.template==="standalone"||e.template==="nestjs+react")&&(e.openAIKey===null||typeof e.openAIKey=="string")&&(e.port===void 0||typeof e.port=="number")&&Array.isArray(e.services)&&e.services.every(a=>typeof a=="string"),r=(e,a,h=!0)=>(e.packageManager==="npm"||e.packageManager==="yarn"||e.packageManager==="pnpm"||e.packageManager==="bun"||P._assertGuard(h,{method:"typia.assertGuard",path:a+".packageManager",expected:'("bun" | "npm" | "pnpm" | "yarn")',value:e.packageManager},D))&&(typeof e.projectAbsolutePath=="string"||P._assertGuard(h,{method:"typia.assertGuard",path:a+".projectAbsolutePath",expected:"string",value:e.projectAbsolutePath},D))&&(e.template==="nodejs"||e.template==="nestjs"||e.template==="react"||e.template==="standalone"||e.template==="nestjs+react"||P._assertGuard(h,{method:"typia.assertGuard",path:a+".template",expected:'("nestjs" | "nestjs+react" | "nodejs" | "react" | "standalone")',value:e.template},D))&&(e.openAIKey===null||typeof e.openAIKey=="string"||P._assertGuard(h,{method:"typia.assertGuard",path:a+".openAIKey",expected:"(null | string)",value:e.openAIKey},D))&&(e.port===void 0||typeof e.port=="number"||P._assertGuard(h,{method:"typia.assertGuard",path:a+".port",expected:"(number | undefined)",value:e.port},D))&&((Array.isArray(e.services)||P._assertGuard(h,{method:"typia.assertGuard",path:a+".services",expected:"Array<string>",value:e.services},D))&&e.services.every((d,g)=>typeof d=="string"||P._assertGuard(h,{method:"typia.assertGuard",path:a+".services["+g+"]",expected:"string",value:d},D))||P._assertGuard(h,{method:"typia.assertGuard",path:a+".services",expected:"Array<string>",value:e.services},D)),s=e=>typeof e=="object"&&e!==null&&n(e);let D;return(e,a)=>{s(e)===!1&&(D=a,((h,d,g=!0)=>(typeof h=="object"&&h!==null||P._assertGuard(!0,{method:"typia.assertGuard",path:d+"",expected:"__type",value:h},D))&&r(h,d+"",!0)||P._assertGuard(!0,{method:"typia.assertGuard",path:d+"",expected:"__type",value:h},D))(e,"$input",!0))}})()(t)}catch(n){throw new Error(`\u274C ${n.toString()}`)}return t}async function Mu({projectAbsolutePath:i,context:t}){await re({template:"standalone",project:i}),O.success("\u2705 Template downloaded");const n=xe(t.services),r=we(t.services),s=N(i,"src/index.ts"),D=await De(s,"utf-8"),e=Oe({content:D,importCode:n,connectorCode:r}),a=await $e(e);await oe(s,a),await se({projectPath:i,apiKeys:[{key:"OPENAI_API_KEY",value:t.openAIKey??""}]}),O.success("\u2705 .env created"),await ie({packageManager:t.packageManager,projectAbsolutePath:i,services:t.services})}async function Nu({projectAbsolutePath:i,context:t}){await re({template:"nodejs",project:i}),O.success("\u2705 Template downloaded");const n=xe(t.services),r=we(t.services),s=N(i,"src/index.ts");let D=await De(s,"utf-8");D=D.replace(/import \{ BbsArticleService \}.*;\n/g,"").replace(/controllers:\s*\[[\s\S]*?\],\n/,`controllers: [/// INSERT CONTROLLER HERE],
88
+ `);const e=Oe({content:D,importCode:n,connectorCode:r}),a=await $e(e);await oe(s,a),await se({projectPath:i,apiKeys:[{key:"OPENAI_API_KEY",value:t.openAIKey??""},{key:"PORT",value:t.port?.toString()??"3000"}]}),O.success("\u2705 .env created"),await ie({packageManager:t.packageManager,projectAbsolutePath:i,services:t.services})}async function pt({projectAbsolutePath:i,context:t}){await re({template:"nestjs",project:i}),O.success("\u2705 Template downloaded");const n=xe(t.services),r=we(t.services),s=N(i,"src/controllers/chat/ChatController.ts"),D=await De(s,"utf-8"),e=Oe({content:D,importCode:n,connectorCode:r}),a=await $e(e);await oe(s,a),await se({projectPath:i,apiKeys:[{key:"OPENAI_API_KEY",value:t.openAIKey??""},{key:"API_PORT",value:t.port?.toString()??"3000"}]}),O.success("\u2705 .env created"),await ie({packageManager:t.packageManager,projectAbsolutePath:i,services:t.services})}async function mt({projectAbsolutePath:i,context:t}){await re({template:"react",project:i}),O.success("\u2705 Template downloaded"),await se({projectPath:i,apiKeys:[{key:"OPENAI_API_KEY",value:t.openAIKey??""},{key:"VITE_AGENTICA_WS_URL",value:`ws://localhost:${t.port}/chat`}]}),O.success("\u2705 .env created"),await ie({packageManager:t.packageManager,projectAbsolutePath:i,services:t.services})}async function Hu({template:i}){tt("Agentica Start Wizard");const t=await Iu({template:i}),{projectAbsolutePath:n}=t;switch(t.template){case"standalone":await Mu({projectAbsolutePath:n,context:t});break;case"nodejs":await Nu({projectAbsolutePath:n,context:t});break;case"nestjs":await pt({projectAbsolutePath:n,context:t});break;case"react":await mt({projectAbsolutePath:n,context:t});break;case"nestjs+react":await pt({projectAbsolutePath:N(n,"server"),context:t}),await mt({projectAbsolutePath:N(n,"client"),context:t});break;default:throw t.template,new Error(`\u274C Template ${t.template} not supported`)}Cu(`
89
+ \u{1F389} Project ${n} created
90
+ \u26A0\uFE0F ${V.yellow("Note:")} Please implement constructor values for each controller generated in agent.ts or index.ts
91
+ `)}const dt=new Bu;dt.command("start").description("Start a new project").option("-p, --project [nodejs|nestjs|react|nestjs+react|standalone]","The project type").action(async i=>{if(i.project===!0){O.error(`
92
+ \u274C The value of ${V.redBright("--project")} is required`);return}if(!(t=>t===void 0||t==="nodejs"||t==="nestjs"||t==="react"||t==="standalone"||t==="nestjs+react")(i.project)){O.error(`
93
+ \u274C The value of ${V.redBright("--project")} is invalid`);return}await Hu({template:i.project})}),tt(`\u{1F680} ${V.blueBright("Agentica")} Setup Wizard`),dt.parse(w.argv);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "agentica",
3
3
  "type": "module",
4
- "version": "0.13.1",
4
+ "version": "0.13.2",
5
5
  "description": "Agentic AI Library specialized in LLM Function Calling",
6
6
  "author": "Wrtn Technologies",
7
7
  "license": "MIT",
@@ -25,10 +25,10 @@
25
25
  "openapi"
26
26
  ],
27
27
  "exports": {
28
- ".": "./bin/index.js"
28
+ ".": "./bin/index.mjs"
29
29
  },
30
- "main": "bin/index.js",
31
- "bin": "bin/index.js",
30
+ "main": "bin/index.mjs",
31
+ "bin": "bin/index.mjs",
32
32
  "files": [
33
33
  "LICENSE",
34
34
  "README.md",
@@ -46,7 +46,6 @@
46
46
  },
47
47
  "devDependencies": {
48
48
  "@clack/prompts": "^0.10.0",
49
- "@rslib/core": "^0.5.4",
50
49
  "@ryoppippi/unplugin-typia": "^2.1.3",
51
50
  "@types/node": "^20.14.8",
52
51
  "@wrtnlabs/eslint-config": "^0.3.1",
@@ -59,12 +58,13 @@
59
58
  "ts-patch": "^3.3.0",
60
59
  "type-fest": "^4.37.0",
61
60
  "typescript": "~5.8.2",
62
- "typia": "^8.0.0",
61
+ "typia": "^8.0.4",
62
+ "unbuild": "^3.5.0",
63
63
  "vitest": "^3.0.9"
64
64
  },
65
65
  "scripts": {
66
- "build": "rslib build",
67
- "dev": "rslib build --watch",
66
+ "build": "unbuild",
67
+ "dev": "unbuild --watch",
68
68
  "typecheck": "tsc --noEmit",
69
69
  "lint": "eslint .",
70
70
  "format": "eslint --fix .",
package/bin/index.js DELETED
@@ -1,81 +0,0 @@
1
- #!/usr/bin/env node
2
- import*as e from"child_process";import*as t from"events";import*as u from"fs";import*as r from"path";import*as i from"process";import*as D from"node:process";import*as s from"node:util";import*as n from"node:readline";import*as o from"node:tty";import*as a from"node:fs";import*as l from"node:fs/promises";import*as h from"node:path";import*as c from"node:child_process";import*as p from"giget";var m={"../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js":function(e){let t=process||{},u=t.argv||[],r=t.env||{},i=!(r.NO_COLOR||u.includes("--no-color"))&&(!!r.FORCE_COLOR||u.includes("--color")||"win32"===t.platform||(t.stdout||{}).isTTY&&"dumb"!==r.TERM||!!r.CI),D=(e,t,u=e)=>r=>{let i=""+r,D=i.indexOf(t,e.length);return~D?e+s(i,t,u,D)+t:e+i+t},s=(e,t,u,r)=>{let i="",D=0;do i+=e.substring(D,r)+u,D=r+t.length,r=e.indexOf(t,D);while(~r);return i+e.substring(D)},n=(e=i)=>{let t=e?D:()=>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")}};e.exports=n(),e.exports.createColors=n},"../../node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js":function(e){let t=`\x1b[`,u={to:(e,u)=>u?`${t}${u+1};${e+1}H`:`${t}${e+1}G`,move(e,u){let r="";return e<0?r+=`${t}${-e}D`:e>0&&(r+=`${t}${e}C`),u<0?r+=`${t}${-u}A`:u>0&&(r+=`${t}${u}B`),r},up:(e=1)=>`${t}${e}A`,down:(e=1)=>`${t}${e}B`,forward:(e=1)=>`${t}${e}C`,backward:(e=1)=>`${t}${e}D`,nextLine:(e=1)=>`${t}E`.repeat(e),prevLine:(e=1)=>`${t}F`.repeat(e),left:`${t}G`,hide:`${t}?25l`,show:`${t}?25h`,save:`\x1b7`,restore:`\x1b8`},r={screen:`${t}2J`,up:(e=1)=>`${t}1J`.repeat(e),down:(e=1)=>`${t}J`.repeat(e),line:`${t}2K`,lineEnd:`${t}K`,lineStart:`${t}1K`,lines(e){let t="";for(let r=0;r<e;r++)t+=this.line+(r<e-1?u.up():"");return e&&(t+=u.left),t}};e.exports={cursor:u,scroll:{up:(e=1)=>`${t}S`.repeat(e),down:(e=1)=>`${t}T`.repeat(e)},erase:r,beep:"\x07"}},"../../node_modules/.pnpm/typia@8.0.3_@samchon+openapi@3.1.0_typescript@5.8.2/node_modules/typia/lib/internal/_assertGuard.js":function(e,t,u){t._assertGuard=void 0;let r=u("../../node_modules/.pnpm/typia@8.0.3_@samchon+openapi@3.1.0_typescript@5.8.2/node_modules/typia/lib/TypeGuardError.mjs");t._assertGuard=(e,t,u)=>{if(!0===e){if(u)throw u(t);throw new r.TypeGuardError(t)}return!1}},child_process:function(t){t.exports=e},events:function(e){e.exports=t},fs:function(e){e.exports=u},path:function(e){e.exports=r},process:function(e){e.exports=i},"../../node_modules/.pnpm/commander@10.0.1/node_modules/commander/index.js":function(e,t,u){let{Argument:r}=u("../../node_modules/.pnpm/commander@10.0.1/node_modules/commander/lib/argument.js"),{Command:i}=u("../../node_modules/.pnpm/commander@10.0.1/node_modules/commander/lib/command.js"),{CommanderError:D,InvalidArgumentError:s}=u("../../node_modules/.pnpm/commander@10.0.1/node_modules/commander/lib/error.js"),{Help:n}=u("../../node_modules/.pnpm/commander@10.0.1/node_modules/commander/lib/help.js"),{Option:o}=u("../../node_modules/.pnpm/commander@10.0.1/node_modules/commander/lib/option.js");(t=e.exports=new i).program=t,t.Argument=r,t.Command=i,t.CommanderError=D,t.Help=n,t.InvalidArgumentError=s,t.InvalidOptionArgumentError=s,t.Option=o},"../../node_modules/.pnpm/commander@10.0.1/node_modules/commander/lib/argument.js":function(e,t,u){let{InvalidArgumentError:r}=u("../../node_modules/.pnpm/commander@10.0.1/node_modules/commander/lib/error.js");t.Argument=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.length>3&&"..."===this._name.slice(-3)&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(e,t){return t!==this.defaultValue&&Array.isArray(t)?t.concat(e):[e]}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,t)=>{if(!this.argChoices.includes(e))throw new r(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(e,t):e},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}},t.humanReadableArgName=function(e){let t=e.name()+(!0===e.variadic?"...":"");return e.required?"<"+t+">":"["+t+"]"}},"../../node_modules/.pnpm/commander@10.0.1/node_modules/commander/lib/command.js":function(e,t,u){let r=u("events").EventEmitter,i=u("child_process"),D=u("path"),s=u("fs"),n=u("process"),{Argument:o,humanReadableArgName:a}=u("../../node_modules/.pnpm/commander@10.0.1/node_modules/commander/lib/argument.js"),{CommanderError:l}=u("../../node_modules/.pnpm/commander@10.0.1/node_modules/commander/lib/error.js"),{Help:h}=u("../../node_modules/.pnpm/commander@10.0.1/node_modules/commander/lib/help.js"),{Option:c,splitOptionFlags:p,DualOptions:m}=u("../../node_modules/.pnpm/commander@10.0.1/node_modules/commander/lib/option.js"),{suggestSimilar:d}=u("../../node_modules/.pnpm/commander@10.0.1/node_modules/commander/lib/suggestSimilar.js");class F extends r{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this._args=[],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._outputConfiguration={writeOut:e=>n.stdout.write(e),writeErr:e=>n.stderr.write(e),getOutHelpWidth:()=>n.stdout.isTTY?n.stdout.columns:void 0,getErrHelpWidth:()=>n.stderr.isTTY?n.stderr.columns:void 0,outputError:(e,t)=>t(e)},this._hidden=!1,this._hasHelpOption=!0,this._helpFlags="-h, --help",this._helpDescription="display help for command",this._helpShortFlag="-h",this._helpLongFlag="--help",this._addImplicitHelpCommand=void 0,this._helpCommandName="help",this._helpCommandnameAndArgs="help [command]",this._helpCommandDescription="display help for command",this._helpConfiguration={}}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._hasHelpOption=e._hasHelpOption,this._helpFlags=e._helpFlags,this._helpDescription=e._helpDescription,this._helpShortFlag=e._helpShortFlag,this._helpLongFlag=e._helpLongFlag,this._helpCommandName=e._helpCommandName,this._helpCommandnameAndArgs=e._helpCommandnameAndArgs,this._helpCommandDescription=e._helpCommandDescription,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}command(e,t,u){let r=t,i=u;"object"==typeof r&&null!==r&&(i=r,r=null),i=i||{};let[,D,s]=e.match(/([^ ]+) *(.*)/),n=this.createCommand(D);return(r&&(n.description(r),n._executableHandler=!0),i.isDefault&&(this._defaultCommandName=n._name),n._hidden=!!(i.noHelp||i.hidden),n._executableFile=i.executableFile||null,s&&n.arguments(s),this.commands.push(n),n.parent=this,n.copyInheritedSettings(this),r)?this:n}createCommand(e){return new F(e)}createHelp(){return Object.assign(new h,this.configureHelp())}configureHelp(e){return void 0===e?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return void 0===e?this._outputConfiguration:(Object.assign(this._outputConfiguration,e),this)}showHelpAfterError(e=!0){return"string"!=typeof e&&(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
3
- - 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.commands.push(e),e.parent=this,this}createArgument(e,t){return new o(e,t)}argument(e,t,u,r){let i=this.createArgument(e,t);return"function"==typeof u?i.default(r).argParser(u):i.default(u),this.addArgument(i),this}arguments(e){return e.split(/ +/).forEach(e=>{this.argument(e)}),this}addArgument(e){let t=this._args.slice(-1)[0];if(t&&t.variadic)throw Error(`only the last argument can be variadic '${t.name()}'`);if(e.required&&void 0!==e.defaultValue&&void 0===e.parseArg)throw Error(`a default value for a required argument is never used: '${e.name()}'`);return this._args.push(e),this}addHelpCommand(e,t){return!1===e?this._addImplicitHelpCommand=!1:(this._addImplicitHelpCommand=!0,"string"==typeof e&&(this._helpCommandName=e.split(" ")[0],this._helpCommandnameAndArgs=e),this._helpCommandDescription=t||this._helpCommandDescription),this}_hasImplicitHelpCommand(){return void 0===this._addImplicitHelpCommand?this.commands.length&&!this._actionHandler&&!this._findCommand("help"):this._addImplicitHelpCommand}hook(e,t){let u=["preSubcommand","preAction","postAction"];if(!u.includes(e))throw Error(`Unexpected value for event passed to hook : '${e}'.
4
- Expecting one of '${u.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(t):this._lifeCycleHooks[e]=[t],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=e=>{if("commander.executeSubCommandAsync"!==e.code)throw e},this}_exit(e,t,u){this._exitCallback&&this._exitCallback(new l(e,t,u)),n.exit(e)}action(e){return this._actionHandler=t=>{let u=this._args.length,r=t.slice(0,u);return this._storeOptionsAsProperties?r[u]=this:r[u]=this.opts(),r.push(this),e.apply(this,r)},this}createOption(e,t){return new c(e,t)}addOption(e){let t=e.name(),u=e.attributeName();if(e.negate){let t=e.long.replace(/^--no-/,"--");this._findOption(t)||this.setOptionValueWithSource(u,void 0===e.defaultValue||e.defaultValue,"default")}else void 0!==e.defaultValue&&this.setOptionValueWithSource(u,e.defaultValue,"default");this.options.push(e);let r=(t,r,i)=>{null==t&&void 0!==e.presetArg&&(t=e.presetArg);let D=this.getOptionValue(u);if(null!==t&&e.parseArg)try{t=e.parseArg(t,D)}catch(e){if("commander.invalidArgument"===e.code){let t=`${r} ${e.message}`;this.error(t,{exitCode:e.exitCode,code:e.code})}throw e}else null!==t&&e.variadic&&(t=e._concatValue(t,D));null==t&&(t=!e.negate&&(!!e.isBoolean()||!!e.optional||"")),this.setOptionValueWithSource(u,t,i)};return this.on("option:"+t,t=>{let u=`error: option '${e.flags}' argument '${t}' is invalid.`;r(t,u,"cli")}),e.envVar&&this.on("optionEnv:"+t,t=>{let u=`error: option '${e.flags}' value '${t}' from env '${e.envVar}' is invalid.`;r(t,u,"env")}),this}_optionEx(e,t,u,r,i){if("object"==typeof t&&t instanceof c)throw Error("To add an Option object use addOption() instead of option() or requiredOption()");let D=this.createOption(t,u);if(D.makeOptionMandatory(!!e.mandatory),"function"==typeof r)D.default(i).argParser(r);else if(r instanceof RegExp){let e=r;r=(t,u)=>{let r=e.exec(t);return r?r[0]:u},D.default(i).argParser(r)}else D.default(r);return this.addOption(D)}option(e,t,u,r){return this._optionEx({},e,t,u,r)}requiredOption(e,t,u,r){return this._optionEx({mandatory:!0},e,t,u,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){if(this._passThroughOptions=!!e,this.parent&&e&&!this.parent._enablePositionalOptions)throw Error("passThroughOptions can not be used without turning on enablePositionalOptions for parent command(s)");return this}storeOptionsAsProperties(e=!0){if(this._storeOptionsAsProperties=!!e,this.options.length)throw Error("call .storeOptionsAsProperties() before adding options");return this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,t){return this.setOptionValueWithSource(e,t,void 0)}setOptionValueWithSource(e,t,u){return this._storeOptionsAsProperties?this[e]=t:this._optionValues[e]=t,this._optionValueSources[e]=u,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let t;return E(this).forEach(u=>{void 0!==u.getOptionValueSource(e)&&(t=u.getOptionValueSource(e))}),t}_prepareUserArgs(e,t){let u;if(void 0!==e&&!Array.isArray(e))throw Error("first parameter to parse must be array or undefined");switch(t=t||{},void 0===e&&(e=n.argv,n.versions&&n.versions.electron&&(t.from="electron")),this.rawArgs=e.slice(),t.from){case void 0:case"node":this._scriptPath=e[1],u=e.slice(2);break;case"electron":n.defaultApp?(this._scriptPath=e[1],u=e.slice(2)):u=e.slice(1);break;case"user":u=e.slice(0);break;default:throw Error(`unexpected parse option { from: '${t.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",u}parse(e,t){let u=this._prepareUserArgs(e,t);return this._parseCommand([],u),this}async parseAsync(e,t){let u=this._prepareUserArgs(e,t);return await this._parseCommand([],u),this}_executeSubCommand(e,t){let u;t=t.slice();let r=!1,o=[".js",".ts",".tsx",".mjs",".cjs"];function a(e,t){let u=D.resolve(e,t);if(s.existsSync(u))return u;if(o.includes(D.extname(t)))return;let r=o.find(e=>s.existsSync(`${u}${e}`));if(r)return`${u}${r}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let h=e._executableFile||`${this._name}-${e._name}`,c=this._executableDir||"";if(this._scriptPath){let e;try{e=s.realpathSync(this._scriptPath)}catch(t){e=this._scriptPath}c=D.resolve(D.dirname(e),c)}if(c){let t=a(c,h);if(!t&&!e._executableFile&&this._scriptPath){let u=D.basename(this._scriptPath,D.extname(this._scriptPath));u!==this._name&&(t=a(c,`${u}-${e._name}`))}h=t||h}r=o.includes(D.extname(h)),"win32"!==n.platform?r?(t.unshift(h),t=g(n.execArgv).concat(t),u=i.spawn(n.argv[0],t,{stdio:"inherit"})):u=i.spawn(h,t,{stdio:"inherit"}):(t.unshift(h),t=g(n.execArgv).concat(t),u=i.spawn(n.execPath,t,{stdio:"inherit"})),u.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(e=>{n.on(e,()=>{!1===u.killed&&null===u.exitCode&&u.kill(e)})});let p=this._exitCallback;p?u.on("close",()=>{p(new l(n.exitCode||0,"commander.executeSubCommandAsync","(close)"))}):u.on("close",n.exit.bind(n)),u.on("error",t=>{if("ENOENT"===t.code){let t=c?`searched for local subcommand relative to directory '${c}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory";throw Error(`'${h}' does not exist
5
- - if '${e._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
6
- - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
7
- - ${t}`)}if("EACCES"===t.code)throw Error(`'${h}' not executable`);if(p){let e=new l(1,"commander.executeSubCommandAsync","(error)");e.nestedError=t,p(e)}else n.exit(1)}),this.runningCommand=u}_dispatchSubcommand(e,t,u){let r;let i=this._findCommand(e);return i||this.help({error:!0}),r=this._chainOrCallSubCommandHook(r,i,"preSubcommand"),r=this._chainOrCall(r,()=>{if(!i._executableHandler)return i._parseCommand(t,u);this._executeSubCommand(i,t.concat(u))})}_checkNumberOfArguments(){this._args.forEach((e,t)=>{e.required&&null==this.args[t]&&this.missingArgument(e.name())}),(!(this._args.length>0)||!this._args[this._args.length-1].variadic)&&this.args.length>this._args.length&&this._excessArguments(this.args)}_processArguments(){let e=(e,t,u)=>{let r=t;if(null!==t&&e.parseArg)try{r=e.parseArg(t,u)}catch(u){if("commander.invalidArgument"===u.code){let r=`error: command-argument value '${t}' is invalid for argument '${e.name()}'. ${u.message}`;this.error(r,{exitCode:u.exitCode,code:u.code})}throw u}return r};this._checkNumberOfArguments();let t=[];this._args.forEach((u,r)=>{let i=u.defaultValue;u.variadic?r<this.args.length?(i=this.args.slice(r),u.parseArg&&(i=i.reduce((t,r)=>e(u,r,t),u.defaultValue))):void 0===i&&(i=[]):r<this.args.length&&(i=this.args[r],u.parseArg&&(i=e(u,i,u.defaultValue))),t[r]=i}),this.processedArgs=t}_chainOrCall(e,t){return e&&e.then&&"function"==typeof e.then?e.then(()=>t()):t()}_chainOrCallHooks(e,t){let u=e,r=[];return E(this).reverse().filter(e=>void 0!==e._lifeCycleHooks[t]).forEach(e=>{e._lifeCycleHooks[t].forEach(t=>{r.push({hookedCommand:e,callback:t})})}),"postAction"===t&&r.reverse(),r.forEach(e=>{u=this._chainOrCall(u,()=>e.callback(e.hookedCommand,this))}),u}_chainOrCallSubCommandHook(e,t,u){let r=e;return void 0!==this._lifeCycleHooks[u]&&this._lifeCycleHooks[u].forEach(e=>{r=this._chainOrCall(r,()=>e(this,t))}),r}_parseCommand(e,t){let u=this.parseOptions(t);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(u.operands),t=u.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._hasImplicitHelpCommand()&&e[0]===this._helpCommandName)return 1===e.length&&this.help(),this._dispatchSubcommand(e[1],[],[this._helpLongFlag]);if(this._defaultCommandName)return C(this,t),this._dispatchSubcommand(this._defaultCommandName,e,t);!this.commands.length||0!==this.args.length||this._actionHandler||this._defaultCommandName||this.help({error:!0}),C(this,u.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let r=()=>{u.unknown.length>0&&this.unknownOption(u.unknown[0])},i=`command:${this.name()}`;if(this._actionHandler){let u;return r(),this._processArguments(),u=this._chainOrCallHooks(u,"preAction"),u=this._chainOrCall(u,()=>this._actionHandler(this.processedArgs)),this.parent&&(u=this._chainOrCall(u,()=>{this.parent.emit(i,e,t)})),u=this._chainOrCallHooks(u,"postAction")}if(this.parent&&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(){for(let e=this;e;e=e.parent)e.options.forEach(t=>{t.mandatory&&void 0===e.getOptionValue(t.attributeName())&&e.missingMandatoryOptionValue(t)})}_checkForConflictingLocalOptions(){let e=this.options.filter(e=>{let t=e.attributeName();return void 0!==this.getOptionValue(t)&&"default"!==this.getOptionValueSource(t)});e.filter(e=>e.conflictsWith.length>0).forEach(t=>{let u=e.find(e=>t.conflictsWith.includes(e.attributeName()));u&&this._conflictingOption(t,u)})}_checkForConflictingOptions(){for(let e=this;e;e=e.parent)e._checkForConflictingLocalOptions()}parseOptions(e){let t=[],u=[],r=t,i=e.slice();function D(e){return e.length>1&&"-"===e[0]}let s=null;for(;i.length;){let e=i.shift();if("--"===e){r===u&&r.push(e),r.push(...i);break}if(s&&!D(e)){this.emit(`option:${s.name()}`,e);continue}if(s=null,D(e)){let t=this._findOption(e);if(t){if(t.required){let e=i.shift();void 0===e&&this.optionMissingArgument(t),this.emit(`option:${t.name()}`,e)}else if(t.optional){let e=null;i.length>0&&!D(i[0])&&(e=i.shift()),this.emit(`option:${t.name()}`,e)}else this.emit(`option:${t.name()}`);s=t.variadic?t:null;continue}}if(e.length>2&&"-"===e[0]&&"-"!==e[1]){let t=this._findOption(`-${e[1]}`);if(t){t.required||t.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${t.name()}`,e.slice(2)):(this.emit(`option:${t.name()}`),i.unshift(`-${e.slice(2)}`));continue}}if(/^--[^=]+=/.test(e)){let t=e.indexOf("="),u=this._findOption(e.slice(0,t));if(u&&(u.required||u.optional)){this.emit(`option:${u.name()}`,e.slice(t+1));continue}}if(D(e)&&(r=u),(this._enablePositionalOptions||this._passThroughOptions)&&0===t.length&&0===u.length){if(this._findCommand(e)){t.push(e),i.length>0&&u.push(...i);break}if(e===this._helpCommandName&&this._hasImplicitHelpCommand()){t.push(e),i.length>0&&t.push(...i);break}if(this._defaultCommandName){u.push(e),i.length>0&&u.push(...i);break}}if(this._passThroughOptions){r.push(e),i.length>0&&r.push(...i);break}r.push(e)}return{operands:t,unknown:u}}opts(){if(this._storeOptionsAsProperties){let e={},t=this.options.length;for(let u=0;u<t;u++){let t=this.options[u].attributeName();e[t]=t===this._versionOptionName?this._version:this[t]}return e}return this._optionValues}optsWithGlobals(){return E(this).reduce((e,t)=>Object.assign(e,t.opts()),{})}error(e,t){this._outputConfiguration.outputError(`${e}
8
- `,this._outputConfiguration.writeErr),"string"==typeof this._showHelpAfterError?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
9
- `):this._showHelpAfterError&&(this._outputConfiguration.writeErr("\n"),this.outputHelp({error:!0}));let u=t||{},r=u.exitCode||1,i=u.code||"commander.error";this._exit(r,i,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in n.env){let t=e.attributeName();(void 0===this.getOptionValue(t)||["default","config","env"].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,n.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new m(this.options),t=e=>void 0!==this.getOptionValue(e)&&!["default","implied"].includes(this.getOptionValueSource(e));this.options.filter(u=>void 0!==u.implied&&t(u.attributeName())&&e.valueFromOption(this.getOptionValue(u.attributeName()),u)).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 u=e=>{let t=e.attributeName(),u=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&&(void 0===r.presetArg&&!1===u||void 0!==r.presetArg&&u===r.presetArg)?r:i||e},r=e=>{let t=u(e),r=t.attributeName();return"env"===this.getOptionValueSource(r)?`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 u=[],r=this;do{let e=r.createHelp().visibleOptions(r).filter(e=>e.long).map(e=>e.long);u=u.concat(e),r=r.parent}while(r&&!r._enablePositionalOptions);t=d(e,u)}let u=`error: unknown option '${e}'${t}`;this.error(u,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let t=this._args.length,u=this.parent?` for '${this.name()}'`:"",r=`error: too many arguments${u}. Expected ${t} argument${1===t?"":"s"} but got ${e.length}.`;this.error(r,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],t="";if(this._showSuggestionAfterError){let u=[];this.createHelp().visibleCommands(this).forEach(e=>{u.push(e.name()),e.alias()&&u.push(e.alias())}),t=d(e,u)}let u=`error: unknown command '${e}'${t}`;this.error(u,{code:"commander.unknownCommand"})}version(e,t,u){if(void 0===e)return this._version;this._version=e,t=t||"-V, --version",u=u||"output the version number";let r=this.createOption(t,u);return this._versionOptionName=r.attributeName(),this.options.push(r),this.on("option:"+r.name(),()=>{this._outputConfiguration.writeOut(`${e}
10
- `),this._exit(0,"commander.version",e)}),this}description(e,t){return void 0===e&&void 0===t?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return void 0===e?this._summary:(this._summary=e,this)}alias(e){if(void 0===e)return this._aliases[0];let t=this;if(0!==this.commands.length&&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");return t._aliases.push(e),this}aliases(e){return void 0===e?this._aliases:(e.forEach(e=>this.alias(e)),this)}usage(e){if(void 0===e){if(this._usage)return this._usage;let e=this._args.map(e=>a(e));return[].concat(this.options.length||this._hasHelpOption?"[options]":[],this.commands.length?"[command]":[],this._args.length?e:[]).join(" ")}return this._usage=e,this}name(e){return void 0===e?this._name:(this._name=e,this)}nameFromFilename(e){return this._name=D.basename(e,D.extname(e)),this}executableDir(e){return void 0===e?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let t=this.createHelp();return void 0===t.helpWidth&&(t.helpWidth=e&&e.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),t.formatHelp(this,t)}_getHelpContext(e){let t;let u={error:!!(e=e||{}).error};return t=u.error?e=>this._outputConfiguration.writeErr(e):e=>this._outputConfiguration.writeOut(e),u.write=e.write||t,u.command=this,u}outputHelp(e){let t;"function"==typeof e&&(t=e,e=void 0);let u=this._getHelpContext(e);E(this).reverse().forEach(e=>e.emit("beforeAllHelp",u)),this.emit("beforeHelp",u);let r=this.helpInformation(u);if(t&&"string"!=typeof(r=t(r))&&!Buffer.isBuffer(r))throw Error("outputHelp callback must return a string or a Buffer");u.write(r),this.emit(this._helpLongFlag),this.emit("afterHelp",u),E(this).forEach(e=>e.emit("afterAllHelp",u))}helpOption(e,t){if("boolean"==typeof e)return this._hasHelpOption=e,this;this._helpFlags=e||this._helpFlags,this._helpDescription=t||this._helpDescription;let u=p(this._helpFlags);return this._helpShortFlag=u.shortFlag,this._helpLongFlag=u.longFlag,this}help(e){this.outputHelp(e);let t=n.exitCode||0;0===t&&e&&"function"!=typeof e&&e.error&&(t=1),this._exit(t,"commander.help","(outputHelp)")}addHelpText(e,t){let u=["beforeAll","before","after","afterAll"];if(!u.includes(e))throw Error(`Unexpected value for position to addHelpText.
11
- Expecting one of '${u.join("', '")}'`);let r=`${e}Help`;return this.on(r,e=>{let u;(u="function"==typeof t?t({error:e.error,command:e.command}):t)&&e.write(`${u}
12
- `)}),this}}function C(e,t){e._hasHelpOption&&t.find(t=>t===e._helpLongFlag||t===e._helpShortFlag)&&(e.outputHelp(),e._exit(0,"commander.helpDisplayed","(outputHelp)"))}function g(e){return e.map(e=>{let t,u;if(!e.startsWith("--inspect"))return e;let r="127.0.0.1",i="9229";return(null!==(u=e.match(/^(--inspect(-brk)?)$/))?t=u[1]:null!==(u=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))?(t=u[1],/^\d+$/.test(u[3])?i=u[3]:r=u[3]):null!==(u=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))&&(t=u[1],r=u[3],i=u[4]),t&&"0"!==i)?`${t}=${r}:${parseInt(i)+1}`:e})}function E(e){let t=[];for(let u=e;u;u=u.parent)t.push(u);return t}t.Command=F},"../../node_modules/.pnpm/commander@10.0.1/node_modules/commander/lib/error.js":function(e,t){class u extends Error{constructor(e,t,u){super(u),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}}t.CommanderError=u,t.InvalidArgumentError=class extends u{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}},"../../node_modules/.pnpm/commander@10.0.1/node_modules/commander/lib/help.js":function(e,t,u){let{humanReadableArgName:r}=u("../../node_modules/.pnpm/commander@10.0.1/node_modules/commander/lib/argument.js");t.Help=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}visibleCommands(e){let t=e.commands.filter(e=>!e._hidden);if(e._hasImplicitHelpCommand()){let[,u,r]=e._helpCommandnameAndArgs.match(/([^ ]+) *(.*)/),i=e.createCommand(u).helpOption(!1);i.description(e._helpCommandDescription),r&&i.arguments(r),t.push(i)}return this.sortSubcommands&&t.sort((e,t)=>e.name().localeCompare(t.name())),t}compareOptions(e,t){let u=e=>e.short?e.short.replace(/^-/,""):e.long.replace(/^--/,"");return u(e).localeCompare(u(t))}visibleOptions(e){let t=e.options.filter(e=>!e.hidden),u=e._hasHelpOption&&e._helpShortFlag&&!e._findOption(e._helpShortFlag),r=e._hasHelpOption&&!e._findOption(e._helpLongFlag);if(u||r){let i;i=u?r?e.createOption(e._helpFlags,e._helpDescription):e.createOption(e._helpShortFlag,e._helpDescription):e.createOption(e._helpLongFlag,e._helpDescription),t.push(i)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let u=e.parent;u;u=u.parent){let e=u.options.filter(e=>!e.hidden);t.push(...e)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return(e._argsDescription&&e._args.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||""}),e._args.find(e=>e.description))?e._args:[]}subcommandTerm(e){let t=e._args.map(e=>r(e)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(t?" "+t:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((e,u)=>Math.max(e,t.subcommandTerm(u).length),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((e,u)=>Math.max(e,t.optionTerm(u).length),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((e,u)=>Math.max(e,t.optionTerm(u).length),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((e,u)=>Math.max(e,t.argumentTerm(u).length),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+"|"+e._aliases[0]);let u="";for(let t=e.parent;t;t=t.parent)u=t.name()+" "+u;return u+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];return(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(", ")}`),void 0!==e.defaultValue&&(e.required||e.optional||e.isBoolean()&&"boolean"==typeof e.defaultValue)&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),void 0!==e.presetArg&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),void 0!==e.envVar&&t.push(`env: ${e.envVar}`),t.length>0)?`${e.description} (${t.join(", ")})`:e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(", ")}`),void 0!==e.defaultValue&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let u=`(${t.join(", ")})`;return e.description?`${e.description} ${u}`:u}return e.description}formatHelp(e,t){let u=t.padWidth(e,t),r=t.helpWidth||80;function i(e,i){if(i){let D=`${e.padEnd(u+2)}${i}`;return t.wrap(D,r-2,u+2)}return e}function D(e){return e.join("\n").replace(/^/gm," ".repeat(2))}let s=[`Usage: ${t.commandUsage(e)}`,""],n=t.commandDescription(e);n.length>0&&(s=s.concat([t.wrap(n,r,0),""]));let o=t.visibleArguments(e).map(e=>i(t.argumentTerm(e),t.argumentDescription(e)));o.length>0&&(s=s.concat(["Arguments:",D(o),""]));let a=t.visibleOptions(e).map(e=>i(t.optionTerm(e),t.optionDescription(e)));if(a.length>0&&(s=s.concat(["Options:",D(a),""])),this.showGlobalOptions){let u=t.visibleGlobalOptions(e).map(e=>i(t.optionTerm(e),t.optionDescription(e)));u.length>0&&(s=s.concat(["Global Options:",D(u),""]))}let l=t.visibleCommands(e).map(e=>i(t.subcommandTerm(e),t.subcommandDescription(e)));return l.length>0&&(s=s.concat(["Commands:",D(l),""])),s.join("\n")}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}wrap(e,t,u,r=40){let i=RegExp(`[\\n][ \\f\\t\\v\u00a0\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]+`);if(e.match(i))return e;let D=t-u;if(D<r)return e;let s=e.slice(0,u),n=e.slice(u).replace("\r\n","\n"),o=" ".repeat(u),a=`\\s\u200B`,l=RegExp(`
13
- |.{1,${D-1}}([${a}]|$)|[^${a}]+?([${a}]|$)`,"g");return s+(n.match(l)||[]).map((e,t)=>"\n"===e?"":(t>0?o:"")+e.trimEnd()).join("\n")}}},"../../node_modules/.pnpm/commander@10.0.1/node_modules/commander/lib/option.js":function(e,t,u){let{InvalidArgumentError:r}=u("../../node_modules/.pnpm/commander@10.0.1/node_modules/commander/lib/error.js");function i(e){let t,u;let r=e.split(/[ |,]+/);return r.length>1&&!/^[[<]/.test(r[1])&&(t=r.shift()),u=r.shift(),!t&&/^-[^-]$/.test(u)&&(t=u,u=void 0),{shortFlag:t,longFlag:u}}t.Option=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 u=i(e);this.short=u.shortFlag,this.long=u.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}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"string"==typeof e&&(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}_concatValue(e,t){return t!==this.defaultValue&&Array.isArray(t)?t.concat(e):[e]}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,t)=>{if(!this.argChoices.includes(e))throw new r(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(e,t):e},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.name().replace(/^no-/,"").split("-").reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},t.splitOptionFlags=i,t.DualOptions=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=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 u=t.attributeName();if(!this.dualOptions.has(u))return!0;let r=this.negativeOptions.get(u).presetArg;return t.negate===((void 0!==r&&r)===e)}}},"../../node_modules/.pnpm/commander@10.0.1/node_modules/commander/lib/suggestSimilar.js":function(e,t){t.suggestSimilar=function(e,t){if(!t||0===t.length)return"";t=Array.from(new Set(t));let u=e.startsWith("--");u&&(e=e.slice(2),t=t.map(e=>e.slice(2)));let r=[],i=3;return(t.forEach(t=>{if(t.length<=1)return;let u=function(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);let u=[];for(let t=0;t<=e.length;t++)u[t]=[t];for(let e=0;e<=t.length;e++)u[0][e]=e;for(let r=1;r<=t.length;r++)for(let i=1;i<=e.length;i++){let D=1;D=+(e[i-1]!==t[r-1]),u[i][r]=Math.min(u[i-1][r]+1,u[i][r-1]+1,u[i-1][r-1]+D),i>1&&r>1&&e[i-1]===t[r-2]&&e[i-2]===t[r-1]&&(u[i][r]=Math.min(u[i][r],u[i-2][r-2]+1))}return u[e.length][t.length]}(e,t),D=Math.max(e.length,t.length);(D-u)/D>.4&&(u<i?(i=u,r=[t]):u===i&&r.push(t))}),r.sort((e,t)=>e.localeCompare(t)),u&&(r=r.map(e=>`--${e}`)),r.length>1)?`
14
- (Did you mean one of ${r.join(", ")}?)`:1===r.length?`
15
- (Did you mean ${r[0]}?)`:""}},"../../node_modules/.pnpm/typia@8.0.3_@samchon+openapi@3.1.0_typescript@5.8.2/node_modules/typia/lib/TypeGuardError.mjs":function(e,t,u){u.r(t),u.d(t,{TypeGuardError:()=>r});class r extends Error{method;path;expected;value;fake_expected_typed_value_;constructor(e){super(e.message||`Error on ${e.method}(): invalid type${e.path?` on ${e.path}`:""}, expect to be ${e.expected}`);let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.method=e.method,this.path=e.path,this.expected=e.expected,this.value=e.value}}}},d={};function F(e){var t=d[e];if(void 0!==t)return t.exports;var u=d[e]={exports:{}};return m[e](u,u.exports,F),u.exports}F.d=(e,t)=>{for(var u in t)F.o(t,u)&&!F.o(e,u)&&Object.defineProperty(e,u,{enumerable:!0,get:t[u]})},F.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),F.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var C=F("../../node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js"),g=F("../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");let E=function({onlyFirst:e=!1}={}){return RegExp("[\\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=><~]))",e?void 0:"g")}();function f(e){if("string"!=typeof e)throw TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(E,"")}function b(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var _={exports:{}};!function(e){var t={};function u(e){return e.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}e.exports=t,t.eastAsianWidth=function(e){var t=e.charCodeAt(0),u=2==e.length?e.charCodeAt(1):0,r=t;return 55296<=t&&t<=56319&&56320<=u&&u<=57343&&(t&=1023,u&=1023,r=(t<<10|u)+65536),12288==r||65281<=r&&r<=65376||65504<=r&&r<=65510?"F":8361==r||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||172==r||175==r||10214<=r&&r<=10221||10629<=r&&r<=10630?"Na":161==r||164==r||167<=r&&r<=168||170==r||173<=r&&r<=174||176<=r&&r<=180||182<=r&&r<=186||188<=r&&r<=191||198==r||208==r||215<=r&&r<=216||222<=r&&r<=225||230==r||232<=r&&r<=234||236<=r&&r<=237||240==r||242<=r&&r<=243||247<=r&&r<=250||252==r||254==r||257==r||273==r||275==r||283==r||294<=r&&r<=295||299==r||305<=r&&r<=307||312==r||319<=r&&r<=322||324==r||328<=r&&r<=331||333==r||338<=r&&r<=339||358<=r&&r<=359||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==r||713<=r&&r<=715||717==r||720==r||728<=r&&r<=731||733==r||735==r||768<=r&&r<=879||913<=r&&r<=929||931<=r&&r<=937||945<=r&&r<=961||963<=r&&r<=969||1025==r||1040<=r&&r<=1103||1105==r||8208==r||8211<=r&&r<=8214||8216<=r&&r<=8217||8220<=r&&r<=8221||8224<=r&&r<=8226||8228<=r&&r<=8231||8240==r||8242<=r&&r<=8243||8245==r||8251==r||8254==r||8308==r||8319==r||8321<=r&&r<=8324||8364==r||8451==r||8453==r||8457==r||8467==r||8470==r||8481<=r&&r<=8482||8486==r||8491==r||8531<=r&&r<=8532||8539<=r&&r<=8542||8544<=r&&r<=8555||8560<=r&&r<=8569||8585==r||8592<=r&&r<=8601||8632<=r&&r<=8633||8658==r||8660==r||8679==r||8704==r||8706<=r&&r<=8707||8711<=r&&r<=8712||8715==r||8719==r||8721==r||8725==r||8730==r||8733<=r&&r<=8736||8739==r||8741==r||8743<=r&&r<=8748||8750==r||8756<=r&&r<=8759||8764<=r&&r<=8765||8776==r||8780==r||8786==r||8800<=r&&r<=8801||8804<=r&&r<=8807||8810<=r&&r<=8811||8814<=r&&r<=8815||8834<=r&&r<=8835||8838<=r&&r<=8839||8853==r||8857==r||8869==r||8895==r||8978==r||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||9675==r||9678<=r&&r<=9681||9698<=r&&r<=9701||9711==r||9733<=r&&r<=9734||9737==r||9742<=r&&r<=9743||9748<=r&&r<=9749||9756==r||9758==r||9792==r||9794==r||9824<=r&&r<=9825||9827<=r&&r<=9829||9831<=r&&r<=9834||9836<=r&&r<=9837||9839==r||9886<=r&&r<=9887||9918<=r&&r<=9919||9924<=r&&r<=9933||9935<=r&&r<=9953||9955==r||9960<=r&&r<=9983||10045==r||10071==r||10102<=r&&r<=10111||11093<=r&&r<=11097||12872<=r&&r<=12879||57344<=r&&r<=63743||65024<=r&&r<=65039||65533==r||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"F"==t||"W"==t||"A"==t?2:1},t.length=function(e){for(var t=u(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),i=i||1,(r=r||0)<0&&(r=textLen+r),i<0&&(i=textLen+i);for(var D="",s=0,n=u(e),o=0;o<n.length;o++){var a=n[o],l=t.length(a);if(s>=r-+(2==l)){if(s+l<=i)D+=a;else break}s+=l}return D}}(_);let v=b(_.exports),A=b(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 B(e,t={}){if("string"!=typeof e||0===e.length||(t={ambiguousIsNarrow:!0,...t},0===(e=f(e)).length))return 0;e=e.replace(A()," ");let u=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(v.eastAsianWidth(t)){case"F":case"W":r+=2;break;case"A":r+=u;break;default:r+=1}}return r}let y=(e=0)=>t=>`\x1b[${t+e}m`,$=(e=0)=>t=>`\x1b[${38+e};5;${t}m`,w=(e=0)=>(t,u,r)=>`\x1b[${38+e};2;${t};${u};${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),[...Object.keys(x.color),...Object.keys(x.bgColor)];let O=function(){let e=new Map;for(let[t,u]of Object.entries(x)){for(let[t,r]of Object.entries(u))x[t]={open:`\x1b[${r[0]}m`,close:`\x1b[${r[1]}m`},u[t]=x[t],e.set(r[0],r[1]);Object.defineProperty(x,t,{value:u,enumerable:!1})}return Object.defineProperty(x,"codes",{value:e,enumerable:!1}),x.color.close="\x1b[39m",x.bgColor.close="\x1b[49m",x.color.ansi=y(),x.color.ansi256=$(),x.color.ansi16m=w(),x.bgColor.ansi=y(10),x.bgColor.ansi256=$(10),x.bgColor.ansi16m=w(10),Object.defineProperties(x,{rgbToAnsi256:{value:(e,t,u)=>e===t&&t===u?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(u/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[u]=t;3===u.length&&(u=[...u].map(e=>e+e).join(""));let r=Number.parseInt(u,16);return[r>>16&255,r>>8&255,255&r]},enumerable:!1},hexToAnsi256:{value:e=>x.rgbToAnsi256(...x.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value:e=>{let t,u,r;if(e<8)return 30+e;if(e<16)return 90+(e-8);if(e>=232)u=t=((e-232)*10+8)/255,r=t;else{let i=(e-=16)%36;t=Math.floor(e/36)/5,u=Math.floor(i/6)/5,r=i%6/5}let i=2*Math.max(t,u,r);if(0===i)return 30;let D=30+(Math.round(r)<<2|Math.round(u)<<1|Math.round(t));return 2===i&&(D+=60),D},enumerable:!1},rgbToAnsi:{value:(e,t,u)=>x.ansi256ToAnsi(x.rgbToAnsi256(e,t,u)),enumerable:!1},hexToAnsi:{value:e=>x.ansi256ToAnsi(x.hexToAnsi256(e)),enumerable:!1}}),x}(),j=new Set(["\x1b","\x9b"]),k="]8;;",S=e=>`${j.values().next().value}[${e}m`,T=e=>`${j.values().next().value}${k}${e}\x07`,V=e=>e.split(" ").map(e=>B(e)),M=(e,t,u)=>{let r=[...t],i=!1,D=!1,s=B(f(e[e.length-1]));for(let[t,n]of r.entries()){let o=B(n);if(s+o<=u?e[e.length-1]+=n:(e.push(n),s=0),j.has(n)&&(i=!0,D=r.slice(t+1).join("").startsWith(k)),i){D?"\x07"===n&&(i=!1,D=!1):"m"===n&&(i=!1);continue}(s+=o)===u&&t<r.length-1&&(e.push(""),s=0)}!s&&e[e.length-1].length>0&&e.length>1&&(e[e.length-2]+=e.pop())},P=e=>{let t=e.split(" "),u=t.length;for(;u>0&&!(B(t[u-1])>0);)u--;return u===t.length?e:t.slice(0,u).join(" ")+t.slice(u).join("")},I=(e,t,u={})=>{if(!1!==u.trim&&""===e.trim())return"";let r="",i,D,s=V(e),n=[""];for(let[r,i]of e.split(" ").entries()){!1!==u.trim&&(n[n.length-1]=n[n.length-1].trimStart());let e=B(n[n.length-1]);if(0!==r&&(e>=t&&(!1===u.wordWrap||!1===u.trim)&&(n.push(""),e=0),(e>0||!1===u.trim)&&(n[n.length-1]+=" ",e++)),u.hard&&s[r]>t){let u=t-e,D=1+Math.floor((s[r]-u-1)/t);Math.floor((s[r]-1)/t)<D&&n.push(""),M(n,i,t);continue}if(e+s[r]>t&&e>0&&s[r]>0){if(!1===u.wordWrap&&e<t){M(n,i,t);continue}n.push("")}if(e+s[r]>t&&!1===u.wordWrap){M(n,i,t);continue}n[n.length-1]+=i}!1!==u.trim&&(n=n.map(e=>P(e)));let o=[...n.join(`
16
- `)];for(let[e,t]of o.entries()){if(r+=t,j.has(t)){let{groups:t}=RegExp(`(?:\\[(?<code>\\d+)m|\\${k}(?<uri>.*)\x07)`).exec(o.slice(e).join(""))||{groups:{}};if(void 0!==t.code){let e=Number.parseFloat(t.code);i=39===e?void 0:e}else void 0!==t.uri&&(D=0===t.uri.length?void 0:t.uri)}let u=O.codes.get(Number(i));o[e+1]===`
17
- `?(D&&(r+=T("")),i&&u&&(r+=S(u))):t===`
18
- `&&(i&&u&&(r+=S(i)),D&&(r+=T(D)))}return r};function H(e,t,u){return String(e).normalize().replace(/\r\n/g,`
19
- `).split(`
20
- `).map(e=>I(e,t,u)).join(`
21
- `)}let N={actions:new Set(["up","down","left","right","space","enter","cancel"]),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]])};function G(e,t){if("string"==typeof e)return N.aliases.get(e)===t;for(let u of e)if(void 0!==u&&G(u,t))return!0;return!1}let R=globalThis.process.platform.startsWith("win"),W=Symbol("clack:cancel");function L(e,t){e.isTTY&&e.setRawMode(t)}var K=Object.defineProperty,q=(e,t,u)=>t in e?K(e,t,{enumerable:!0,configurable:!0,writable:!0,value:u}):e[t]=u,U=(e,t,u)=>(q(e,"symbol"!=typeof t?t+"":t,u),u);class Y{constructor(e,t=!0){U(this,"input"),U(this,"output"),U(this,"_abortSignal"),U(this,"rl"),U(this,"opts"),U(this,"_render"),U(this,"_track",!1),U(this,"_prevFrame",""),U(this,"_subscribers",new Map),U(this,"_cursor",0),U(this,"state","initial"),U(this,"error",""),U(this,"value");let{input:u=D.stdin,output:r=D.stdout,render:i,signal:s,...n}=e;this.opts=n,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=s,this.input=u,this.output=r}unsubscribe(){this._subscribers.clear()}setSubscriber(e,t){let u=this._subscribers.get(e)??[];u.push(t),this._subscribers.set(e,u)}on(e,t){this.setSubscriber(e,{cb:t})}once(e,t){this.setSubscriber(e,{cb:t,once:!0})}emit(e,...t){let u=this._subscribers.get(e)??[],r=[];for(let e of u)e.cb(...t),e.once&&r.push(()=>u.splice(u.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(W);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}let u=new o.WriteStream(0);u._write=(e,t,u)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,""),this._cursor=this.rl?.cursor??0,this.emit("value",this.value)),u()},this.input.pipe(u),this.rl=n.default.createInterface({input:this.input,output:u,tabSize:2,prompt:"",escapeCodeTimeout:50}),n.default.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),void 0!==this.opts.initialValue&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),L(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(C.cursor.show),this.output.off("resize",this.render),L(this.input,!1),e(this.value)}),this.once("cancel",()=>{this.output.write(C.cursor.show),this.output.off("resize",this.render),L(this.input,!1),e(W)})})}onKeypress(e,t){if("error"===this.state&&(this.state="active"),t?.name&&(!this._track&&N.aliases.has(t.name)&&this.emit("cursor",N.aliases.get(t.name)),N.actions.has(t.name)&&this.emit("cursor",t.name)),e&&("y"===e.toLowerCase()||"n"===e.toLowerCase())&&this.emit("confirm","y"===e.toLowerCase())," "===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))}"error"!==this.state&&(this.state="submit")}G([e,t?.name,t?.sequence],"cancel")&&(this.state="cancel"),("submit"===this.state||"cancel"===this.state)&&this.emit("finalize"),this.render(),("submit"===this.state||"cancel"===this.state)&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
22
- `),L(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let e=H(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
23
- `).length-1;this.output.write(C.cursor.move(-999,-1*e))}render(){let e=H(this._render(this)??"",process.stdout.columns,{hard:!0});if(e!==this._prevFrame){if("initial"===this.state)this.output.write(C.cursor.hide);else{let t=function(e,t){if(e===t)return;let u=e.split(`
24
- `),r=t.split(`
25
- `),i=[];for(let e=0;e<Math.max(u.length,r.length);e++)u[e]!==r[e]&&i.push(e);return i}(this._prevFrame,e);if(this.restoreCursor(),t&&t?.length===1){let u=t[0];this.output.write(C.cursor.move(0,u)),this.output.write(C.erase.lines(1));let r=e.split(`
26
- `);this.output.write(r[u]),this._prevFrame=e,this.output.write(C.cursor.move(0,r.length-u-1));return}if(t&&t?.length>1){let u=t[0];this.output.write(C.cursor.move(0,u)),this.output.write(C.erase.down());let r=e.split(`
27
- `).slice(u);this.output.write(r.join(`
28
- `)),this._prevFrame=e;return}this.output.write(C.erase.down())}this.output.write(e),"initial"===this.state&&(this.state="active"),this._prevFrame=e}}}class z extends Y{get cursor(){return+!this.value}get _value(){return 0===this.cursor}constructor(e){super(e,!1),this.value=!!e.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",e=>{this.output.write(C.cursor.move(0,-1)),this.value=e,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}}var J=Object.defineProperty,Z=(e,t,u)=>t in e?J(e,t,{enumerable:!0,configurable:!0,writable:!0,value:u}):e[t]=u,Q=(e,t,u)=>(Z(e,"symbol"!=typeof t?t+"":t,u),u);let X=class extends Y{constructor(e){super(e,!1),Q(this,"options"),Q(this,"cursor",0),this.options=e.options,this.value=[...e.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:t})=>t===e.cursorAt),0),this.on("key",e=>{"a"===e&&this.toggleAll()}),this.on("cursor",e=>{switch(e){case"left":case"up":this.cursor=0===this.cursor?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break;case"space":this.toggleValue()}})}get _value(){return this.options[this.cursor].value}toggleAll(){let e=this.value.length===this.options.length;this.value=e?[]:this.options.map(e=>e.value)}toggleValue(){let e=this.value.includes(this._value);this.value=e?this.value.filter(e=>e!==this._value):[...this.value,this._value]}};var ee=Object.defineProperty,et=(e,t,u)=>t in e?ee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:u}):e[t]=u,eu=(e,t,u)=>(et(e,"symbol"!=typeof t?t+"":t,u),u);class er extends Y{constructor(e){super(e,!1),eu(this,"options"),eu(this,"cursor",0),this.options=e.options,this.cursor=this.options.findIndex(({value:t})=>t===e.initialValue),-1===this.cursor&&(this.cursor=0),this.changeValue(),this.on("cursor",e=>{switch(e){case"left":case"up":this.cursor=0===this.cursor?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}}class ei extends Y{get valueWithCursor(){if("submit"===this.state)return this.value;if(this.cursor>=this.value.length)return`${this.value}\u2588`;let e=this.value.slice(0,this.cursor),[t,...u]=this.value.slice(this.cursor);return`${e}${g.inverse(t)}${u.join("")}`}get cursor(){return this._cursor}constructor(e){super(e),this.on("finalize",()=>{this.value||(this.value=e.defaultValue)})}}let eD="win32"!==D.default.platform?"linux"!==D.default.env.TERM:!!D.default.env.CI||!!D.default.env.WT_SESSION||!!D.default.env.TERMINUS_SUBLIME||"{cmd::Cmder}"===D.default.env.ConEmuTask||"Terminus-Sublime"===D.default.env.TERM_PROGRAM||"vscode"===D.default.env.TERM_PROGRAM||"xterm-256color"===D.default.env.TERM||"alacritty"===D.default.env.TERM||"JetBrains-JediTerm"===D.default.env.TERMINAL_EMULATOR,es=(e,t)=>eD?e:t,en=es("◆","*"),eo=es("■","x"),ea=es("▲","x"),el=es("◇","o"),eh=es("┌","T"),ec=es("│","|"),ep=es("└","—"),em=es("●",">"),ed=es("○"," "),eF=es("◻","[•]"),eC=es("◼","[+]"),eg=es("◻","[ ]"),eE=(es("▪","•"),es("─","-"),es("╮","+"),es("├","+"),es("╯","+"),es("●","•")),ef=es("◆","*"),eb=es("▲","!"),e_=es("■","x"),ev=e=>{switch(e){case"initial":case"active":return g.cyan(en);case"cancel":return g.red(eo);case"error":return g.yellow(ea);case"submit":return g.green(el)}},eA=e=>{let{cursor:t,options:u,style:r}=e,i=e.maxItems??Number.POSITIVE_INFINITY,D=Math.min(Math.max(process.stdout.rows-4,0),Math.max(i,5)),s=0;t>=0+D-3?s=Math.max(Math.min(t-D+3,u.length-D),0):t<s+2&&(s=Math.max(t-2,0));let n=D<u.length&&s>0,o=D<u.length&&s+D<u.length;return u.slice(s,s+D).map((e,u,i)=>{let D=u===i.length-1&&o;return 0===u&&n||D?g.dim("..."):r(e,u+s===t)})},eB=e=>new ei({validate:e.validate,placeholder:e.placeholder,defaultValue:e.defaultValue,initialValue:e.initialValue,render(){let t=`${g.gray(ec)}
29
- ${ev(this.state)} ${e.message}
30
- `,u=e.placeholder?g.inverse(e.placeholder[0])+g.dim(e.placeholder.slice(1)):g.inverse(g.hidden("_")),r=this.value?this.valueWithCursor:u;switch(this.state){case"error":return`${t.trim()}
31
- ${g.yellow(ec)} ${r}
32
- ${g.yellow(ep)} ${g.yellow(this.error)}
33
- `;case"submit":return`${t}${g.gray(ec)} ${g.dim(this.value||e.placeholder)}`;case"cancel":return`${t}${g.gray(ec)} ${g.strikethrough(g.dim(this.value??""))}${this.value?.trim()?`
34
- ${g.gray(ec)}`:""}`;default:return`${t}${g.cyan(ec)} ${r}
35
- ${g.cyan(ep)}
36
- `}}}).prompt(),ey=e=>{let t=e.active??"Yes",u=e.inactive??"No";return new z({active:t,inactive:u,initialValue:e.initialValue??!0,render(){let r=`${g.gray(ec)}
37
- ${ev(this.state)} ${e.message}
38
- `,i=this.value?t:u;switch(this.state){case"submit":return`${r}${g.gray(ec)} ${g.dim(i)}`;case"cancel":return`${r}${g.gray(ec)} ${g.strikethrough(g.dim(i))}
39
- ${g.gray(ec)}`;default:return`${r}${g.cyan(ec)} ${this.value?`${g.green(em)} ${t}`:`${g.dim(ed)} ${g.dim(t)}`} ${g.dim("/")} ${this.value?`${g.dim(ed)} ${g.dim(u)}`:`${g.green(em)} ${u}`}
40
- ${g.cyan(ep)}
41
- `}}}).prompt()},e$=e=>{let t=(e,t)=>{let u=e.label??String(e.value);switch(t){case"selected":return`${g.dim(u)}`;case"active":return`${g.green(em)} ${u} ${e.hint?g.dim(`(${e.hint})`):""}`;case"cancelled":return`${g.strikethrough(g.dim(u))}`;default:return`${g.dim(ed)} ${g.dim(u)}`}};return new er({options:e.options,initialValue:e.initialValue,render(){let u=`${g.gray(ec)}
42
- ${ev(this.state)} ${e.message}
43
- `;switch(this.state){case"submit":return`${u}${g.gray(ec)} ${t(this.options[this.cursor],"selected")}`;case"cancel":return`${u}${g.gray(ec)} ${t(this.options[this.cursor],"cancelled")}
44
- ${g.gray(ec)}`;default:return`${u}${g.cyan(ec)} ${eA({cursor:this.cursor,options:this.options,maxItems:e.maxItems,style:(e,u)=>t(e,u?"active":"inactive")}).join(`
45
- ${g.cyan(ec)} `)}
46
- ${g.cyan(ep)}
47
- `}}}).prompt()},ew=e=>{let t=(e,t)=>{let u=e.label??String(e.value);return"active"===t?`${g.cyan(eF)} ${u} ${e.hint?g.dim(`(${e.hint})`):""}`:"selected"===t?`${g.green(eC)} ${g.dim(u)}`:"cancelled"===t?`${g.strikethrough(g.dim(u))}`:"active-selected"===t?`${g.green(eC)} ${u} ${e.hint?g.dim(`(${e.hint})`):""}`:"submitted"===t?`${g.dim(u)}`:`${g.dim(eg)} ${g.dim(u)}`};return new X({options:e.options,initialValues:e.initialValues,required:e.required??!0,cursorAt:e.cursorAt,validate(e){if(this.required&&0===e.length)return`Please select at least one option.
48
- ${g.reset(g.dim(`Press ${g.gray(g.bgWhite(g.inverse(" space ")))} to select, ${g.gray(g.bgWhite(g.inverse(" enter ")))} to submit`))}`},render(){let u=`${g.gray(ec)}
49
- ${ev(this.state)} ${e.message}
50
- `,r=(e,u)=>{let r=this.value.includes(e.value);return u&&r?t(e,"active-selected"):r?t(e,"selected"):t(e,u?"active":"inactive")};switch(this.state){case"submit":return`${u}${g.gray(ec)} ${this.options.filter(({value:e})=>this.value.includes(e)).map(e=>t(e,"submitted")).join(g.dim(", "))||g.dim("none")}`;case"cancel":{let e=this.options.filter(({value:e})=>this.value.includes(e)).map(e=>t(e,"cancelled")).join(g.dim(", "));return`${u}${g.gray(ec)} ${e.trim()?`${e}
51
- ${g.gray(ec)}`:""}`}case"error":{let t=this.error.split(`
52
- `).map((e,t)=>0===t?`${g.yellow(ep)} ${g.yellow(e)}`:` ${e}`).join(`
53
- `);return`${u+g.yellow(ec)} ${eA({options:this.options,cursor:this.cursor,maxItems:e.maxItems,style:r}).join(`
54
- ${g.yellow(ec)} `)}
55
- ${t}
56
- `}default:return`${u}${g.cyan(ec)} ${eA({options:this.options,cursor:this.cursor,maxItems:e.maxItems,style:r}).join(`
57
- ${g.cyan(ec)} `)}
58
- ${g.cyan(ep)}
59
- `}}}).prompt()},ex=(e="")=>{process.stdout.write(`${g.gray(eh)} ${e}
60
- `)},eO=(e="")=>{process.stdout.write(`${g.gray(ec)}
61
- ${g.gray(ep)} ${e}
62
-
63
- `)},ej={message:(e="",{symbol:t=g.gray(ec)}={})=>{let u=[`${g.gray(ec)}`];if(e){let[r,...i]=e.split(`
64
- `);u.push(`${t} ${r}`,...i.map(e=>`${g.gray(ec)} ${e}`))}process.stdout.write(`${u.join(`
65
- `)}
66
- `)},info:e=>{ej.message(e,{symbol:g.blue(eE)})},success:e=>{ej.message(e,{symbol:g.green(ef)})},step:e=>{ej.message(e,{symbol:g.green(el)})},warn:e=>{ej.message(e,{symbol:g.yellow(eb)})},warning:e=>{ej.warn(e)},error:e=>{ej.message(e,{symbol:g.red(e_)})}},ek=(g.gray(ec),({indicator:e="dots"}={})=>{let t=eD?["◒","◐","◓","◑"]:["•","o","O","0"],u=eD?80:120,r="true"===process.env.CI,i,s,o=!1,a="",l,h=performance.now(),c=e=>{o&&_(e>1?"Something went wrong":"Canceled",e)},p=()=>c(2),m=()=>c(1),d=()=>{process.on("uncaughtExceptionMonitor",p),process.on("unhandledRejection",p),process.on("SIGINT",m),process.on("SIGTERM",m),process.on("exit",c)},F=()=>{process.removeListener("uncaughtExceptionMonitor",p),process.removeListener("unhandledRejection",p),process.removeListener("SIGINT",m),process.removeListener("SIGTERM",m),process.removeListener("exit",c)},E=()=>{if(void 0===l)return;r&&process.stdout.write(`
67
- `);let e=l.split(`
68
- `);process.stdout.write(C.cursor.move(-999,e.length-1)),process.stdout.write(C.erase.down(e.length))},f=e=>e.replace(/\.+$/,""),b=e=>{let t=(performance.now()-e)/1e3,u=Math.floor(t/60),r=Math.floor(t%60);return u>0?`[${u}m ${r}s]`:`[${r}s]`},_=(t="",u=0)=>{o=!1,clearInterval(s),E();let r=0===u?g.green(el):1===u?g.red(eo):g.red(ea);a=f(t??a),"timer"===e?process.stdout.write(`${r} ${a} ${b(h)}
69
- `):process.stdout.write(`${r} ${a}
70
- `),F(),i()};return{start:(c="")=>{o=!0,i=function({input:e=D.stdin,output:t=D.stdout,overwrite:u=!0,hideCursor:r=!0}={}){let i=n.createInterface({input:e,output:t,prompt:"",tabSize:1});n.emitKeypressEvents(e,i),e.isTTY&&e.setRawMode(!0);let s=(i,{name:D,sequence:o})=>{if(G([String(i),D,o],"cancel")){r&&t.write(C.cursor.show),process.exit(0);return}u&&n.moveCursor(t,"return"===D?0:-1,"return"===D?-1:0,()=>{n.clearLine(t,1,()=>{e.once("keypress",s)})})};return r&&t.write(C.cursor.hide),e.once("keypress",s),()=>{e.off("keypress",s),r&&t.write(C.cursor.show),e.isTTY&&!R&&e.setRawMode(!1),i.terminal=!1,i.close()}}(),a=f(c),h=performance.now(),process.stdout.write(`${g.gray(ec)}
71
- `);let p=0,m=0;d(),s=setInterval(()=>{if(r&&a===l)return;E(),l=a;let u=g.magenta(t[p]);if(r)process.stdout.write(`${u} ${a}...`);else if("timer"===e)process.stdout.write(`${u} ${a} ${b(h)}`);else{let e=".".repeat(Math.floor(m)).slice(0,3);process.stdout.write(`${u} ${a}${e}`)}p=p+1<t.length?p+1:0,m=m<t.length?m+.125:0},u)},stop:_,message:(e="")=>{a=f(e??a)}}}),{program:eS,createCommand:eT,createArgument:eV,createOption:eM,CommanderError:eP,InvalidArgumentError:eI,InvalidOptionArgumentError:eH,Command:eN,Argument:eG,Option:eR,Help:eW}=F("../../node_modules/.pnpm/commander@10.0.1/node_modules/commander/index.js");var eL=F("../../node_modules/.pnpm/typia@8.0.3_@samchon+openapi@3.1.0_typescript@5.8.2/node_modules/typia/lib/internal/_assertGuard.js");function eK(e){return e.split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join("")}async function eq(e){try{let t=await import("prettier");return await t.format(e,{parser:"typescript"})}catch{return e}}let eU=(0,s.promisify)(c.exec),eY="@wrtnlabs/connector-";async function ez(){let e=await fetch("https://raw.githubusercontent.com/wrtnlabs/connectors/refs/heads/main/connectors-list.json"),t=await e.json();return(()=>{let e;let t=e=>Array.isArray(e.connectors)&&e.connectors.every(e=>"string"==typeof e&&RegExp(/^@wrtnlabs\/connector\x2d(.*)/).test(e))&&"string"==typeof e.version,u=(t,u,r=!0)=>((Array.isArray(t.connectors)||eL._assertGuard(r,{method:"typia.assert",path:u+".connectors",expected:"Array<`@wrtnlabs/connector-${string}`>",value:t.connectors},e))&&t.connectors.every((t,i)=>"string"==typeof t&&RegExp(/^@wrtnlabs\/connector\x2d(.*)/).test(t)||eL._assertGuard(r,{method:"typia.assert",path:u+".connectors["+i+"]",expected:"`@wrtnlabs/connector-${string}`",value:t},e))||eL._assertGuard(r,{method:"typia.assert",path:u+".connectors",expected:"Array<`@wrtnlabs/connector-${string}`>",value:t.connectors},e))&&("string"==typeof t.version||eL._assertGuard(r,{method:"typia.assert",path:u+".version",expected:"string",value:t.version},e)),r=e=>"object"==typeof e&&null!==e&&t(e);return(t,i)=>(!1===r(t)&&(e=i,((t,r,i=!0)=>("object"==typeof t&&null!==t||eL._assertGuard(!0,{method:"typia.assert",path:r+"",expected:"UnwrapTaggedConnectors",value:t},e))&&u(t,r+"",!0)||eL._assertGuard(!0,{method:"typia.assert",path:r+"",expected:"UnwrapTaggedConnectors",value:t},e))(t,"$input",!0)),t)})()(t)}async function eJ(){return(await ez()).connectors.map(e=>{let t=e.replace(eY,""),u=t.replace("-"," ").toUpperCase();return{packageName:e,serviceName:t,displayName:u}})}function eZ(e){return e.map(e=>{let t=eK(e);return`{
72
- name: "${t} Connector",
73
- protocol: "class",
74
- application: typia.llm.application<${t}Service, "chatgpt">(),
75
- execute: new ${t}Service(),
76
- }`}).join(",\n")}function eQ(e){return e.map(e=>`import { ${eK(e)}Service } from "${eY}${e}";`).join("\n")}function eX({content:e,importCode:t,connectorCode:u}){return e.replace("/// INSERT IMPORT HERE",t).replace("/// INSERT CONTROLLER HERE",u)}async function e0({template:e,project:t}){await (0,p.downloadTemplate)(`github:wrtnlabs/agentica.template.${e}`,{dir:t}),await (0,l.rm)((0,h.join)(t,".github/dependabot.yml"),{force:!0})}async function e2({projectPath:e,dotEnvfileName:t,apiKeys:u}){if(!(0,a.existsSync)(e))throw Error(`${e} directory does not exist.`);let r=(0,h.join)(e,t??".env"),i=((0,a.existsSync)(r)?"\n":"")+u.map(({key:e,value:t})=>`${e}=${t}`).join("\n");await (0,l.appendFile)(r,i)}async function e3({packageManager:e,projectAbsolutePath:t,services:u}){let r=function({packageManager:e,pkg:t}){switch(e){case"npm":return`npm install ${t}`;case"yarn":return`yarn add ${t}`;case"pnpm":return`pnpm add ${t}`;case"bun":return`bun add ${t}`;default:throw Error(`Unsupported package manager: ${e}`)}}({packageManager:e,pkg:[...u.map(e=>`${eY}${e}`),"typescript"].join(" ")}),i=ek();i.start("\uD83D\uDCE6 Package installation in progress..."),await eU(r,{cwd:t}),i.stop("✅ Package installation completed")}async function e8({template:e}){let t={template:e};{let e=await eB({message:"Enter the project directory path:",placeholder:"./my-agentica-project",validate:e=>""===e?"Please enter a directory path":"."!==e[0]?"Please enter a relative path.":(0,a.existsSync)(e)?"Directory already exists":void 0});e===W&&D.default.exit(0);let u=(0,h.join)(D.default.cwd(),e);t.projectAbsolutePath=u}{let e=await e$({message:"Which package manager do you want to use?",initialValue:function(){let e=D.default.env.npm_config_user_agent;switch(!0){case e?.startsWith("npm"):return"npm";case e?.startsWith("yarn"):return"yarn";case e?.startsWith("pnpm"):return"pnpm";case e?.startsWith("bun"):return"bun";default:return"npm"}}(),options:[{value:"npm",label:"npm"},{value:"pnpm",label:"pnpm"},{value:"yarn",label:`yarn (${g.blueBright("berry is not supported")})`},{value:"bun",label:"bun"}]});e===W&&D.default.exit(0),ej.info(`📦 Using ${e} as package manager`),t.packageManager=e}if(null==t.template){let e=await e$({message:"Which project type do you want to start?",options:[{value:"standalone",label:`Standalone ${g.blueBright("Agent Server")}`},{value:"nodejs",label:`NodeJS ${g.blueBright("Agent Server")}`},{value:"nestjs",label:`NestJS ${g.blueBright("Agent Server")}`},{value:"react",label:`React ${g.blueBright("Application")}`},{value:"nestjs+react",label:`NestJS + React ${g.blueBright("Agent Server + Client Application")}`}]});e===W&&D.default.exit(0),t.template=e}if("standalone"!==t.template){let e=await eB({message:"Server Port(if project is client app, this port mean ws server port):",initialValue:"3000",validate(e){if(Number.isNaN(Number.parseInt(e)))return"Port must be an integer"}});e===W&&D.default.exit(0),t.port=Number(e)}if("react"!==t.template){let e=(await eJ()).sort((e,t)=>e.displayName.localeCompare(t.displayName)).map(({displayName:e,serviceName:t})=>({label:e,value:t})),u=await ew({message:"Which connectors do you want to include?",options:e,required:!1});u===W&&D.default.exit(0),t.services=u}{let e=await ey({message:"Enter your OpenAI API key?",initialValue:!1});if(e===W&&D.default.exit(0),e){let e=await eB({message:"Please enter your OPENAI API key:"});e===W&&D.default.exit(0),t.openAIKey=e}else t.openAIKey=null}try{(()=>{let e;let t=e=>("npm"===e.packageManager||"yarn"===e.packageManager||"pnpm"===e.packageManager||"bun"===e.packageManager)&&"string"==typeof e.projectAbsolutePath&&("nodejs"===e.template||"nestjs"===e.template||"react"===e.template||"standalone"===e.template||"nestjs+react"===e.template)&&(null===e.openAIKey||"string"==typeof e.openAIKey)&&(void 0===e.port||"number"==typeof e.port)&&Array.isArray(e.services)&&e.services.every(e=>"string"==typeof e),u=(t,u,r=!0)=>("npm"===t.packageManager||"yarn"===t.packageManager||"pnpm"===t.packageManager||"bun"===t.packageManager||eL._assertGuard(r,{method:"typia.assertGuard",path:u+".packageManager",expected:'("bun" | "npm" | "pnpm" | "yarn")',value:t.packageManager},e))&&("string"==typeof t.projectAbsolutePath||eL._assertGuard(r,{method:"typia.assertGuard",path:u+".projectAbsolutePath",expected:"string",value:t.projectAbsolutePath},e))&&("nodejs"===t.template||"nestjs"===t.template||"react"===t.template||"standalone"===t.template||"nestjs+react"===t.template||eL._assertGuard(r,{method:"typia.assertGuard",path:u+".template",expected:'("nestjs" | "nestjs+react" | "nodejs" | "react" | "standalone")',value:t.template},e))&&(null===t.openAIKey||"string"==typeof t.openAIKey||eL._assertGuard(r,{method:"typia.assertGuard",path:u+".openAIKey",expected:"(null | string)",value:t.openAIKey},e))&&(void 0===t.port||"number"==typeof t.port||eL._assertGuard(r,{method:"typia.assertGuard",path:u+".port",expected:"(number | undefined)",value:t.port},e))&&((Array.isArray(t.services)||eL._assertGuard(r,{method:"typia.assertGuard",path:u+".services",expected:"Array<string>",value:t.services},e))&&t.services.every((t,i)=>"string"==typeof t||eL._assertGuard(r,{method:"typia.assertGuard",path:u+".services["+i+"]",expected:"string",value:t},e))||eL._assertGuard(r,{method:"typia.assertGuard",path:u+".services",expected:"Array<string>",value:t.services},e)),r=e=>"object"==typeof e&&null!==e&&t(e);return(t,i)=>{!1===r(t)&&(e=i,((t,r,i=!0)=>("object"==typeof t&&null!==t||eL._assertGuard(!0,{method:"typia.assertGuard",path:r+"",expected:"__type",value:t},e))&&u(t,r+"",!0)||eL._assertGuard(!0,{method:"typia.assertGuard",path:r+"",expected:"__type",value:t},e))(t,"$input",!0))}})()(t)}catch(e){throw Error(`❌ ${e.toString()}`)}return t}async function e1({projectAbsolutePath:e,context:t}){await e0({template:"standalone",project:e}),ej.success("✅ Template downloaded");let u=eQ(t.services),r=eZ(t.services),i=(0,h.join)(e,"src/index.ts"),D=eX({content:await (0,l.readFile)(i,"utf-8"),importCode:u,connectorCode:r}),s=await eq(D);await (0,l.writeFile)(i,s),await e2({projectPath:e,apiKeys:[{key:"OPENAI_API_KEY",value:t.openAIKey??""}]}),ej.success("✅ .env created"),await e3({packageManager:t.packageManager,projectAbsolutePath:e,services:t.services})}async function e6({projectAbsolutePath:e,context:t}){await e0({template:"nodejs",project:e}),ej.success("✅ Template downloaded");let u=eQ(t.services),r=eZ(t.services),i=(0,h.join)(e,"src/index.ts"),D=await (0,l.readFile)(i,"utf-8"),s=eX({content:D=D.replace(/import \{ BbsArticleService \}.*;\n/g,"").replace(/controllers:\s*\[[\s\S]*?\],\n/,"controllers: [/// INSERT CONTROLLER HERE],\n"),importCode:u,connectorCode:r}),n=await eq(s);await (0,l.writeFile)(i,n),await e2({projectPath:e,apiKeys:[{key:"OPENAI_API_KEY",value:t.openAIKey??""},{key:"PORT",value:t.port?.toString()??"3000"}]}),ej.success("✅ .env created"),await e3({packageManager:t.packageManager,projectAbsolutePath:e,services:t.services})}async function e7({projectAbsolutePath:e,context:t}){await e0({template:"nestjs",project:e}),ej.success("✅ Template downloaded");let u=eQ(t.services),r=eZ(t.services),i=(0,h.join)(e,"src/controllers/chat/ChatController.ts"),D=eX({content:await (0,l.readFile)(i,"utf-8"),importCode:u,connectorCode:r}),s=await eq(D);await (0,l.writeFile)(i,s),await e2({projectPath:e,apiKeys:[{key:"OPENAI_API_KEY",value:t.openAIKey??""},{key:"API_PORT",value:t.port?.toString()??"3000"}]}),ej.success("✅ .env created"),await e3({packageManager:t.packageManager,projectAbsolutePath:e,services:t.services})}async function e9({projectAbsolutePath:e,context:t}){await e0({template:"react",project:e}),ej.success("✅ Template downloaded"),await e2({projectPath:e,apiKeys:[{key:"OPENAI_API_KEY",value:t.openAIKey??""},{key:"VITE_AGENTICA_WS_URL",value:`ws://localhost:${t.port}/chat`}]}),ej.success("✅ .env created"),await e3({packageManager:t.packageManager,projectAbsolutePath:e,services:t.services})}async function e4({template:e}){ex("Agentica Start Wizard");let t=await e8({template:e}),{projectAbsolutePath:u}=t;switch(t.template){case"standalone":await e1({projectAbsolutePath:u,context:t});break;case"nodejs":await e6({projectAbsolutePath:u,context:t});break;case"nestjs":await e7({projectAbsolutePath:u,context:t});break;case"react":await e9({projectAbsolutePath:u,context:t});break;case"nestjs+react":await e7({projectAbsolutePath:(0,h.join)(u,"server"),context:t}),await e9({projectAbsolutePath:(0,h.join)(u,"client"),context:t});break;default:throw t.template,Error(`❌ Template ${t.template} not supported`)}eO(`
77
- 🎉 Project ${u} created
78
- ⚠️ ${g.yellow("Note:")} Please implement constructor values for each controller generated in agent.ts or index.ts
79
- `)}let e5=new eN;e5.command("start").description("Start a new project").option("-p, --project [nodejs|nestjs|react|nestjs+react|standalone]","The project type").action(async e=>{let t;if(!0===e.project){ej.error(`
80
- ❌ The value of ${g.redBright("--project")} is required`);return}if(void 0!==(t=e.project)&&"nodejs"!==t&&"nestjs"!==t&&"react"!==t&&"standalone"!==t&&"nestjs+react"!==t){ej.error(`
81
- ❌ The value of ${g.redBright("--project")} is invalid`);return}await e4({template:e.project})}),ex(`🚀 ${g.blueBright("Agentica")} Setup Wizard`),e5.parse(D.default.argv);