tako-cli 0.1.22 → 0.1.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.js +53 -38
  2. package/install.sh +32 -4
  3. package/package.json +10 -2
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- var wr=Object.create;var{getPrototypeOf:nr,defineProperty:y$,getOwnPropertyNames:pr}=Object;var Sr=Object.prototype.hasOwnProperty;var q=(r,m,a)=>{a=r!=null?wr(nr(r)):{};let e=m||!r||!r.__esModule?y$(a,"default",{value:r,enumerable:!0}):a;for(let t of pr(r))if(!Sr.call(e,t))y$(e,t,{get:()=>r[t],enumerable:!0});return e};var w$=(r,m)=>()=>(m||r((m={exports:{}}).exports,m),m.exports);var T=import.meta.require;var r$=w$((s1,Q$)=>{var $$={to(r,m){if(!m)return`\x1B[${r+1}G`;return`\x1B[${m+1};${r+1}H`},move(r,m){let a="";if(r<0)a+=`\x1B[${-r}D`;else if(r>0)a+=`\x1B[${r}C`;if(m<0)a+=`\x1B[${-m}A`;else if(m>0)a+=`\x1B[${m}B`;return a},up:(r=1)=>`\x1B[${r}A`,down:(r=1)=>`\x1B[${r}B`,forward:(r=1)=>`\x1B[${r}C`,backward:(r=1)=>`\x1B[${r}D`,nextLine:(r=1)=>"\x1B[E".repeat(r),prevLine:(r=1)=>"\x1B[F".repeat(r),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},Yr={up:(r=1)=>"\x1B[S".repeat(r),down:(r=1)=>"\x1B[T".repeat(r)},Hr={screen:"\x1B[2J",up:(r=1)=>"\x1B[1J".repeat(r),down:(r=1)=>"\x1B[J".repeat(r),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(r){let m="";for(let a=0;a<r;a++)m+=this.line+(a<r-1?$$.up():"");if(r)m+=$$.left;return m}};Q$.exports={cursor:$$,scroll:Yr,erase:Hr,beep:"\x07"}});var a$=w$((b1,m$)=>{var O=process||{},j$=O.argv||[],K=O.env||{},Lr=!(!!K.NO_COLOR||j$.includes("--no-color"))&&(!!K.FORCE_COLOR||j$.includes("--color")||O.platform==="win32"||(O.stdout||{}).isTTY&&K.TERM!=="dumb"||!!K.CI),Vr=(r,m,a=r)=>(e)=>{let t=""+e,h=t.indexOf(m,r.length);return~h?r+Xr(t,m,a,h)+m:r+t+m},Xr=(r,m,a,e)=>{let t="",h=0;do t+=r.substring(h,e)+a,h=e+m.length,e=r.indexOf(m,h);while(~e);return t+r.substring(h)},Y$=(r=Lr)=>{let m=r?Vr:()=>String;return{isColorSupported:r,reset:m("\x1B[0m","\x1B[0m"),bold:m("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:m("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:m("\x1B[3m","\x1B[23m"),underline:m("\x1B[4m","\x1B[24m"),inverse:m("\x1B[7m","\x1B[27m"),hidden:m("\x1B[8m","\x1B[28m"),strikethrough:m("\x1B[9m","\x1B[29m"),black:m("\x1B[30m","\x1B[39m"),red:m("\x1B[31m","\x1B[39m"),green:m("\x1B[32m","\x1B[39m"),yellow:m("\x1B[33m","\x1B[39m"),blue:m("\x1B[34m","\x1B[39m"),magenta:m("\x1B[35m","\x1B[39m"),cyan:m("\x1B[36m","\x1B[39m"),white:m("\x1B[37m","\x1B[39m"),gray:m("\x1B[90m","\x1B[39m"),bgBlack:m("\x1B[40m","\x1B[49m"),bgRed:m("\x1B[41m","\x1B[49m"),bgGreen:m("\x1B[42m","\x1B[49m"),bgYellow:m("\x1B[43m","\x1B[49m"),bgBlue:m("\x1B[44m","\x1B[49m"),bgMagenta:m("\x1B[45m","\x1B[49m"),bgCyan:m("\x1B[46m","\x1B[49m"),bgWhite:m("\x1B[47m","\x1B[49m"),blackBright:m("\x1B[90m","\x1B[39m"),redBright:m("\x1B[91m","\x1B[39m"),greenBright:m("\x1B[92m","\x1B[39m"),yellowBright:m("\x1B[93m","\x1B[39m"),blueBright:m("\x1B[94m","\x1B[39m"),magentaBright:m("\x1B[95m","\x1B[39m"),cyanBright:m("\x1B[96m","\x1B[39m"),whiteBright:m("\x1B[97m","\x1B[39m"),bgBlackBright:m("\x1B[100m","\x1B[49m"),bgRedBright:m("\x1B[101m","\x1B[49m"),bgGreenBright:m("\x1B[102m","\x1B[49m"),bgYellowBright:m("\x1B[103m","\x1B[49m"),bgBlueBright:m("\x1B[104m","\x1B[49m"),bgMagentaBright:m("\x1B[105m","\x1B[49m"),bgCyanBright:m("\x1B[106m","\x1B[49m"),bgWhiteBright:m("\x1B[107m","\x1B[49m")}};m$.exports=Y$();m$.exports.createColors=Y$});import{join as f$}from"path";import{homedir as Mr}from"os";import{join as L}from"path";var Q=L(Mr(),".tako"),p$=L(Q,"config.json"),u=L(Q,"tools"),Z=L(Q,"bun"),p=L(Z,"bin",process.platform==="win32"?"bun.exe":"bun");var M="https://claude-proxy.shiroha.tech",n$={apiKey:"",apiId:"",installedClients:{}};async function S$(){let r=await import("fs/promises");try{await r.mkdir(Q,{recursive:!0}),await r.mkdir(u,{recursive:!0})}catch{}}async function z(){await S$();try{let r=Bun.file(p$);if(await r.exists()){let m=await r.json();return{...n$,...m}}}catch{}return{...n$}}async function qr(r){await S$(),await Bun.write(p$,JSON.stringify(r,null,2))}async function P(r){let a={...await z(),...r};return await qr(a),a}async function M$(){return!!(await z()).apiKey}async function q$(){return(await z()).apiKey}async function W$(){return(await z()).apiId}function G$(r,m){if(!r.startsWith(Q))throw Error(`\u5B89\u5168\u68C0\u67E5\u5931\u8D25: ${m} \u8DEF\u5F84 "${r}" \u4E0D\u5728 Tako \u76EE\u5F55\u4E0B`)}function I(r){let m=f$(u,r);return G$(m,"\u5BA2\u6237\u7AEF\u5B89\u88C5\u76EE\u5F55"),m}function Z$(r){let m=I(r.id),a=f$(m,"node_modules",".bin",r.command);return G$(a,"\u5BA2\u6237\u7AEF\u53EF\u6267\u884C\u6587\u4EF6"),a}var z$=new Map;function U(r){z$.set(r.id,r)}function J$(){return Array.from(z$.values())}var Wr={id:"claude-code",name:"Claude Code",package:"@anthropic-ai/claude-code",command:"claude",runtime:"bun",getEnvVars(r){return{ANTHROPIC_BASE_URL:`${M}/api`,ANTHROPIC_AUTH_TOKEN:r}}};U(Wr);import{homedir as fr}from"os";import{join as F}from"path";var D=F(fr(),".codex"),Gr=F(D,"config.toml"),Zr=F(D,"auth.json"),zr=`model_provider = "crs"
1
+ var Wr=Object.create;var{defineProperty:Z$,getPrototypeOf:Gr,getOwnPropertyNames:Zr}=Object;var zr=Object.prototype.hasOwnProperty;var U=(r,m,a)=>{a=r!=null?Wr(Gr(r)):{};const b=m||!r||!r.__esModule?Z$(a,"default",{value:r,enumerable:!0}):a;for(let h of Zr(r))if(!zr.call(b,h))Z$(b,h,{get:()=>r[h],enumerable:!0});return b};var z$=(r,m)=>()=>(m||r((m={exports:{}}).exports,m),m.exports);var v$=z$((e1,X$)=>{var i=`${"\x1B"}[`,s$={to(r,m){if(!m)return`${i}${r+1}G`;return`${i}${m+1};${r+1}H`},move(r,m){let a="";if(r<0)a+=`${i}${-r}D`;else if(r>0)a+=`${i}${r}C`;if(m<0)a+=`${i}${-m}A`;else if(m>0)a+=`${i}${m}B`;return a},up:(r=1)=>`${i}${r}A`,down:(r=1)=>`${i}${r}B`,forward:(r=1)=>`${i}${r}C`,backward:(r=1)=>`${i}${r}D`,nextLine:(r=1)=>`${i}E`.repeat(r),prevLine:(r=1)=>`${i}F`.repeat(r),left:`${i}G`,hide:`${i}?25l`,show:`${i}?25h`,save:`${"\x1B"}7`,restore:`${"\x1B"}8`},Vr={up:(r=1)=>`${i}S`.repeat(r),down:(r=1)=>`${i}T`.repeat(r)},Br={screen:`${i}2J`,up:(r=1)=>`${i}1J`.repeat(r),down:(r=1)=>`${i}J`.repeat(r),line:`${i}2K`,lineEnd:`${i}K`,lineStart:`${i}1K`,lines(r){let m="";for(let a=0;a<r;a++)m+=this.line+(a<r-1?s$.up():"");if(r)m+=s$.left;return m}};X$.exports={cursor:s$,scroll:Vr,erase:Br,beep:"\x07"}});var x$=z$((g1,c$)=>{var R=process||{},V$=R.argv||[],N=R.env||{},kr=!(!!N.NO_COLOR||V$.includes("--no-color"))&&(!!N.FORCE_COLOR||V$.includes("--color")||R.platform==="win32"||(R.stdout||{}).isTTY&&N.TERM!=="dumb"||!!N.CI),Er=(r,m,a=r)=>(b)=>{let h=""+b,o=h.indexOf(m,r.length);return~o?r+Tr(h,m,a,o)+m:r+h+m},Tr=(r,m,a,b)=>{let h="",o=0;do h+=r.substring(o,b)+a,o=b+m.length,b=r.indexOf(m,o);while(~b);return h+r.substring(o)},B$=(r=kr)=>{let m=r?Er:()=>String;return{isColorSupported:r,reset:m("\x1B[0m","\x1B[0m"),bold:m("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:m("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:m("\x1B[3m","\x1B[23m"),underline:m("\x1B[4m","\x1B[24m"),inverse:m("\x1B[7m","\x1B[27m"),hidden:m("\x1B[8m","\x1B[28m"),strikethrough:m("\x1B[9m","\x1B[29m"),black:m("\x1B[30m","\x1B[39m"),red:m("\x1B[31m","\x1B[39m"),green:m("\x1B[32m","\x1B[39m"),yellow:m("\x1B[33m","\x1B[39m"),blue:m("\x1B[34m","\x1B[39m"),magenta:m("\x1B[35m","\x1B[39m"),cyan:m("\x1B[36m","\x1B[39m"),white:m("\x1B[37m","\x1B[39m"),gray:m("\x1B[90m","\x1B[39m"),bgBlack:m("\x1B[40m","\x1B[49m"),bgRed:m("\x1B[41m","\x1B[49m"),bgGreen:m("\x1B[42m","\x1B[49m"),bgYellow:m("\x1B[43m","\x1B[49m"),bgBlue:m("\x1B[44m","\x1B[49m"),bgMagenta:m("\x1B[45m","\x1B[49m"),bgCyan:m("\x1B[46m","\x1B[49m"),bgWhite:m("\x1B[47m","\x1B[49m"),blackBright:m("\x1B[90m","\x1B[39m"),redBright:m("\x1B[91m","\x1B[39m"),greenBright:m("\x1B[92m","\x1B[39m"),yellowBright:m("\x1B[93m","\x1B[39m"),blueBright:m("\x1B[94m","\x1B[39m"),magentaBright:m("\x1B[95m","\x1B[39m"),cyanBright:m("\x1B[96m","\x1B[39m"),whiteBright:m("\x1B[97m","\x1B[39m"),bgBlackBright:m("\x1B[100m","\x1B[49m"),bgRedBright:m("\x1B[101m","\x1B[49m"),bgGreenBright:m("\x1B[102m","\x1B[49m"),bgYellowBright:m("\x1B[103m","\x1B[49m"),bgBlueBright:m("\x1B[104m","\x1B[49m"),bgMagentaBright:m("\x1B[105m","\x1B[49m"),bgCyanBright:m("\x1B[106m","\x1B[49m"),bgWhiteBright:m("\x1B[107m","\x1B[49m")}};c$.exports=B$();c$.exports.createColors=B$});import{join as O} from"path";import{homedir as Jr} from"os";import{join as Y} from"path";async function f$(){const r=await import("fs/promises");try{await r.mkdir(S,{recursive:!0}),await r.mkdir($$,{recursive:!0})}catch{}}async function Q(){await f$();try{const r=Bun.file(S$);if(await r.exists()){const m=await r.json();return{...J$,...m}}}catch{}return{...J$}}async function Sr(r){await f$(),await Bun.write(S$,JSON.stringify(r,null,2))}async function K(r){const a={...await Q(),...r};return await Sr(a),a}async function Q$(){return!!(await Q()).apiKey}async function n$(){return(await Q()).apiKey}async function Y$(){return(await Q()).apiId}var S=Y(Jr(),".tako"),S$=Y(S,"config.json"),$$=Y(S,"tools"),r$=Y(S,"cli"),f=Y(S,"bun"),q=Y(f,"bin",process.platform==="win32"?"bun.exe":"bun");var G="https://claude-proxy.shiroha.tech",J$={apiKey:"",apiId:"",installedClients:{}};var m$=function(r,m){if(!r.startsWith(S))throw new Error(`\u5B89\u5168\u68C0\u67E5\u5931\u8D25: ${m} \u8DEF\u5F84 "${r}" \u4E0D\u5728 Tako \u76EE\u5F55\u4E0B`)};function X(r){const m=O($$,r);return m$(m,"\u5BA2\u6237\u7AEF\u5B89\u88C5\u76EE\u5F55"),m}async function j$(r){const m=X(r.id),a=O(m,"node_modules",r.package,"package.json");try{const b=Bun.file(a);if(!await b.exists())return null;const o=(await b.json()).bin;if(!o)return null;let $=null;if(typeof o==="string")$=o;else if(typeof o==="object"&&o[r.command])$=o[r.command];if(!$)return null;const v=O(m,"node_modules",r.package,$);return m$(v,"\u5BA2\u6237\u7AEF\u5165\u53E3\u6587\u4EF6"),v}catch{return null}}function H$(r){const m=X(r.id),a=O(m,"node_modules",".bin",r.command);return m$(a,"\u5BA2\u6237\u7AEF\u53EF\u6267\u884C\u6587\u4EF6"),a}function A(r){a$.set(r.id,r)}function L$(){return Array.from(a$.values())}function b$(r){return a$.get(r)}var a$=new Map;var fr={id:"claude-code",name:"Claude Code",package:"@anthropic-ai/claude-code",command:"claude",runtime:"bun",getEnvVars(r){return{ANTHROPIC_BASE_URL:`${G}/api`,ANTHROPIC_AUTH_TOKEN:r}}};A(fr);import{homedir as Qr} from"os";import{join as h$} from"path";async function Lr(r){const m=await import("fs/promises");try{await m.mkdir(o$,{recursive:!0})}catch{}await Bun.write(nr,jr),await Bun.write(Yr,Hr)}var o$=h$(Qr(),".codex"),nr=h$(o$,"config.toml"),Yr=h$(o$,"auth.json"),jr=`model_provider = "crs"
2
2
  model = "gpt-5-codex"
3
3
  model_reasoning_effort = "high"
4
4
  disable_response_storage = true
@@ -6,48 +6,63 @@ preferred_auth_method = "apikey"
6
6
 
7
7
  [model_providers.crs]
8
8
  name = "crs"
9
- base_url = "${M}/openai"
9
+ base_url = "${G}/openai"
10
10
  wire_api = "responses"
11
11
  requires_openai_auth = true
12
12
  env_key = "CRS_OAI_KEY"
13
- `,Jr=`{
13
+ `,Hr=`{
14
14
  "OPENAI_API_KEY": null
15
15
  }
16
- `;async function Qr(r){let m=await import("fs/promises");try{await m.mkdir(D,{recursive:!0})}catch{}await Bun.write(Gr,zr),await Bun.write(Zr,Jr)}var jr={id:"codex",name:"Codex",package:"@openai/codex",command:"codex",runtime:"bun",getEnvVars(r){return{CRS_OAI_KEY:r}},setupConfigFiles:Qr};U(jr);var w=q(r$(),1),N=q(a$(),1);import{stdin as I$,stdout as U$}from"process";import*as W from"readline";import H$ from"readline";import{WriteStream as kr}from"tty";function Br({onlyFirst:r=!1}={}){let m=["[\\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(m,r?void 0:"g")}var Er=Br();function K$(r){if(typeof r!="string")throw TypeError(`Expected a \`string\`, got \`${typeof r}\``);return r.replace(Er,"")}function O$(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var A$={exports:{}};(function(r){var m={};r.exports=m,m.eastAsianWidth=function(e){var t=e.charCodeAt(0),h=e.length==2?e.charCodeAt(1):0,$=t;return 55296<=t&&t<=56319&&56320<=h&&h<=57343&&(t&=1023,h&=1023,$=t<<10|h,$+=65536),$==12288||65281<=$&&$<=65376||65504<=$&&$<=65510?"F":$==8361||65377<=$&&$<=65470||65474<=$&&$<=65479||65482<=$&&$<=65487||65490<=$&&$<=65495||65498<=$&&$<=65500||65512<=$&&$<=65518?"H":4352<=$&&$<=4447||4515<=$&&$<=4519||4602<=$&&$<=4607||9001<=$&&$<=9002||11904<=$&&$<=11929||11931<=$&&$<=12019||12032<=$&&$<=12245||12272<=$&&$<=12283||12289<=$&&$<=12350||12353<=$&&$<=12438||12441<=$&&$<=12543||12549<=$&&$<=12589||12593<=$&&$<=12686||12688<=$&&$<=12730||12736<=$&&$<=12771||12784<=$&&$<=12830||12832<=$&&$<=12871||12880<=$&&$<=13054||13056<=$&&$<=19903||19968<=$&&$<=42124||42128<=$&&$<=42182||43360<=$&&$<=43388||44032<=$&&$<=55203||55216<=$&&$<=55238||55243<=$&&$<=55291||63744<=$&&$<=64255||65040<=$&&$<=65049||65072<=$&&$<=65106||65108<=$&&$<=65126||65128<=$&&$<=65131||110592<=$&&$<=110593||127488<=$&&$<=127490||127504<=$&&$<=127546||127552<=$&&$<=127560||127568<=$&&$<=127569||131072<=$&&$<=194367||177984<=$&&$<=196605||196608<=$&&$<=262141?"W":32<=$&&$<=126||162<=$&&$<=163||165<=$&&$<=166||$==172||$==175||10214<=$&&$<=10221||10629<=$&&$<=10630?"Na":$==161||$==164||167<=$&&$<=168||$==170||173<=$&&$<=174||176<=$&&$<=180||182<=$&&$<=186||188<=$&&$<=191||$==198||$==208||215<=$&&$<=216||222<=$&&$<=225||$==230||232<=$&&$<=234||236<=$&&$<=237||$==240||242<=$&&$<=243||247<=$&&$<=250||$==252||$==254||$==257||$==273||$==275||$==283||294<=$&&$<=295||$==299||305<=$&&$<=307||$==312||319<=$&&$<=322||$==324||328<=$&&$<=331||$==333||338<=$&&$<=339||358<=$&&$<=359||$==363||$==462||$==464||$==466||$==468||$==470||$==472||$==474||$==476||$==593||$==609||$==708||$==711||713<=$&&$<=715||$==717||$==720||728<=$&&$<=731||$==733||$==735||768<=$&&$<=879||913<=$&&$<=929||931<=$&&$<=937||945<=$&&$<=961||963<=$&&$<=969||$==1025||1040<=$&&$<=1103||$==1105||$==8208||8211<=$&&$<=8214||8216<=$&&$<=8217||8220<=$&&$<=8221||8224<=$&&$<=8226||8228<=$&&$<=8231||$==8240||8242<=$&&$<=8243||$==8245||$==8251||$==8254||$==8308||$==8319||8321<=$&&$<=8324||$==8364||$==8451||$==8453||$==8457||$==8467||$==8470||8481<=$&&$<=8482||$==8486||$==8491||8531<=$&&$<=8532||8539<=$&&$<=8542||8544<=$&&$<=8555||8560<=$&&$<=8569||$==8585||8592<=$&&$<=8601||8632<=$&&$<=8633||$==8658||$==8660||$==8679||$==8704||8706<=$&&$<=8707||8711<=$&&$<=8712||$==8715||$==8719||$==8721||$==8725||$==8730||8733<=$&&$<=8736||$==8739||$==8741||8743<=$&&$<=8748||$==8750||8756<=$&&$<=8759||8764<=$&&$<=8765||$==8776||$==8780||$==8786||8800<=$&&$<=8801||8804<=$&&$<=8807||8810<=$&&$<=8811||8814<=$&&$<=8815||8834<=$&&$<=8835||8838<=$&&$<=8839||$==8853||$==8857||$==8869||$==8895||$==8978||9312<=$&&$<=9449||9451<=$&&$<=9547||9552<=$&&$<=9587||9600<=$&&$<=9615||9618<=$&&$<=9621||9632<=$&&$<=9633||9635<=$&&$<=9641||9650<=$&&$<=9651||9654<=$&&$<=9655||9660<=$&&$<=9661||9664<=$&&$<=9665||9670<=$&&$<=9672||$==9675||9678<=$&&$<=9681||9698<=$&&$<=9701||$==9711||9733<=$&&$<=9734||$==9737||9742<=$&&$<=9743||9748<=$&&$<=9749||$==9756||$==9758||$==9792||$==9794||9824<=$&&$<=9825||9827<=$&&$<=9829||9831<=$&&$<=9834||9836<=$&&$<=9837||$==9839||9886<=$&&$<=9887||9918<=$&&$<=9919||9924<=$&&$<=9933||9935<=$&&$<=9953||$==9955||9960<=$&&$<=9983||$==10045||$==10071||10102<=$&&$<=10111||11093<=$&&$<=11097||12872<=$&&$<=12879||57344<=$&&$<=63743||65024<=$&&$<=65039||$==65533||127232<=$&&$<=127242||127248<=$&&$<=127277||127280<=$&&$<=127337||127344<=$&&$<=127386||917760<=$&&$<=917999||983040<=$&&$<=1048573||1048576<=$&&$<=1114109?"A":"N"},m.characterLength=function(e){var t=this.eastAsianWidth(e);return t=="F"||t=="W"||t=="A"?2:1};function a(e){return e.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}m.length=function(e){for(var t=a(e),h=0,$=0;$<t.length;$++)h=h+this.characterLength(t[$]);return h},m.slice=function(e,t,h){textLen=m.length(e),t=t||0,h=h||1,t<0&&(t=textLen+t),h<0&&(h=textLen+h);for(var $="",b=0,i=a(e),c=0;c<i.length;c++){var v=i[c],o=m.length(v);if(b>=t-(o==2?1:0))if(b+o<=h)$+=v;else break;b+=o}return $}})(A$);var Tr=A$.exports,Pr=O$(Tr),Ir=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},Ur=O$(Ir);function V(r,m={}){if(typeof r!="string"||r.length===0||(m={ambiguousIsNarrow:!0,...m},r=K$(r),r.length===0))return 0;r=r.replace(Ur()," ");let a=m.ambiguousIsNarrow?1:2,e=0;for(let t of r){let h=t.codePointAt(0);if(h<=31||h>=127&&h<=159||h>=768&&h<=879)continue;switch(Pr.eastAsianWidth(t)){case"F":case"W":e+=2;break;case"A":e+=a;break;default:e+=1}}return e}var e$=10,L$=(r=0)=>(m)=>`\x1B[${m+r}m`,V$=(r=0)=>(m)=>`\x1B[${38+r};5;${m}m`,X$=(r=0)=>(m,a,e)=>`\x1B[${38+r};2;${m};${a};${e}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);var Kr=Object.keys(x.color),Or=Object.keys(x.bgColor);[...Kr,...Or];function Ar(){let r=new Map;for(let[m,a]of Object.entries(x)){for(let[e,t]of Object.entries(a))x[e]={open:`\x1B[${t[0]}m`,close:`\x1B[${t[1]}m`},a[e]=x[e],r.set(t[0],t[1]);Object.defineProperty(x,m,{value:a,enumerable:!1})}return Object.defineProperty(x,"codes",{value:r,enumerable:!1}),x.color.close="\x1B[39m",x.bgColor.close="\x1B[49m",x.color.ansi=L$(),x.color.ansi256=V$(),x.color.ansi16m=X$(),x.bgColor.ansi=L$(e$),x.bgColor.ansi256=V$(e$),x.bgColor.ansi16m=X$(e$),Object.defineProperties(x,{rgbToAnsi256:{value:(m,a,e)=>m===a&&a===e?m<8?16:m>248?231:Math.round((m-8)/247*24)+232:16+36*Math.round(m/255*5)+6*Math.round(a/255*5)+Math.round(e/255*5),enumerable:!1},hexToRgb:{value:(m)=>{let a=/[a-f\d]{6}|[a-f\d]{3}/i.exec(m.toString(16));if(!a)return[0,0,0];let[e]=a;e.length===3&&(e=[...e].map((h)=>h+h).join(""));let t=Number.parseInt(e,16);return[t>>16&255,t>>8&255,t&255]},enumerable:!1},hexToAnsi256:{value:(m)=>x.rgbToAnsi256(...x.hexToRgb(m)),enumerable:!1},ansi256ToAnsi:{value:(m)=>{if(m<8)return 30+m;if(m<16)return 90+(m-8);let a,e,t;if(m>=232)a=((m-232)*10+8)/255,e=a,t=a;else{m-=16;let b=m%36;a=Math.floor(m/36)/5,e=Math.floor(b/6)/5,t=b%6/5}let h=Math.max(a,e,t)*2;if(h===0)return 30;let $=30+(Math.round(t)<<2|Math.round(e)<<1|Math.round(a));return h===2&&($+=60),$},enumerable:!1},rgbToAnsi:{value:(m,a,e)=>x.ansi256ToAnsi(x.rgbToAnsi256(m,a,e)),enumerable:!1},hexToAnsi:{value:(m)=>x.ansi256ToAnsi(x.hexToAnsi256(m)),enumerable:!1}}),x}var Nr=Ar(),R=new Set(["\x1B","\x9B"]),Rr=39,h$="\x07",N$="[",Cr="]",R$="m",s$=`${Cr}8;;`,k$=(r)=>`${R.values().next().value}${N$}${r}${R$}`,B$=(r)=>`${R.values().next().value}${s$}${r}${h$}`,_r=(r)=>r.split(" ").map((m)=>V(m)),t$=(r,m,a)=>{let e=[...m],t=!1,h=!1,$=V(K$(r[r.length-1]));for(let[b,i]of e.entries()){let c=V(i);if($+c<=a?r[r.length-1]+=i:(r.push(i),$=0),R.has(i)&&(t=!0,h=e.slice(b+1).join("").startsWith(s$)),t){h?i===h$&&(t=!1,h=!1):i===R$&&(t=!1);continue}$+=c,$===a&&b<e.length-1&&(r.push(""),$=0)}!$&&r[r.length-1].length>0&&r.length>1&&(r[r.length-2]+=r.pop())},ur=(r)=>{let m=r.split(" "),a=m.length;for(;a>0&&!(V(m[a-1])>0);)a--;return a===m.length?r:m.slice(0,a).join(" ")+m.slice(a).join("")},Fr=(r,m,a={})=>{if(a.trim!==!1&&r.trim()==="")return"";let e="",t,h,$=_r(r),b=[""];for(let[c,v]of r.split(" ").entries()){a.trim!==!1&&(b[b.length-1]=b[b.length-1].trimStart());let o=V(b[b.length-1]);if(c!==0&&(o>=m&&(a.wordWrap===!1||a.trim===!1)&&(b.push(""),o=0),(o>0||a.trim===!1)&&(b[b.length-1]+=" ",o++)),a.hard&&$[c]>m){let d=m-o,G=1+Math.floor(($[c]-d-1)/m);Math.floor(($[c]-1)/m)<G&&b.push(""),t$(b,v,m);continue}if(o+$[c]>m&&o>0&&$[c]>0){if(a.wordWrap===!1&&o<m){t$(b,v,m);continue}b.push("")}if(o+$[c]>m&&a.wordWrap===!1){t$(b,v,m);continue}b[b.length-1]+=v}a.trim!==!1&&(b=b.map((c)=>ur(c)));let i=[...b.join(`
17
- `)];for(let[c,v]of i.entries()){if(e+=v,R.has(v)){let{groups:d}=new RegExp(`(?:\\${N$}(?<code>\\d+)m|\\${s$}(?<uri>.*)${h$})`).exec(i.slice(c).join(""))||{groups:{}};if(d.code!==void 0){let G=Number.parseFloat(d.code);t=G===Rr?void 0:G}else d.uri!==void 0&&(h=d.uri.length===0?void 0:d.uri)}let o=Nr.codes.get(Number(t));i[c+1]===`
18
- `?(h&&(e+=B$("")),t&&o&&(e+=k$(o))):v===`
19
- `&&(t&&o&&(e+=k$(t)),h&&(e+=B$(h)))}return e};function E$(r,m,a){return String(r).normalize().replace(/\r\n/g,`
16
+ `,Xr={id:"codex",name:"Codex",package:"@openai/codex",command:"codex",runtime:"bun",getEnvVars(r){return{CRS_OAI_KEY:r}},setupConfigFiles:Lr};A(Xr);var l=U(v$(),1),_=U(x$(),1);import{stdin as R$,stdout as I$} from"process";import*as Z from"readline";import k$ from"readline";import{WriteStream as Pr} from"tty";var Ur=function({onlyFirst:r=!1}={}){const m=["[\\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(m,r?void 0:"g")},_$=function(r){if(typeof r!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof r}\``);return r.replace(Kr,"")},C$=function(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r},V=function(r,m={}){if(typeof r!="string"||r.length===0||(m={ambiguousIsNarrow:!0,...m},r=_$(r),r.length===0))return 0;r=r.replace(Rr()," ");const a=m.ambiguousIsNarrow?1:2;let b=0;for(let h of r){const o=h.codePointAt(0);if(o<=31||o>=127&&o<=159||o>=768&&o<=879)continue;switch(Ar.eastAsianWidth(h)){case"F":case"W":b+=2;break;case"A":b+=a;break;default:b+=1}}return b},Cr=function(){const r=new Map;for(let[m,a]of Object.entries(g)){for(let[b,h]of Object.entries(a))g[b]={open:`\x1B[${h[0]}m`,close:`\x1B[${h[1]}m`},a[b]=g[b],r.set(h[0],h[1]);Object.defineProperty(g,m,{value:a,enumerable:!1})}return Object.defineProperty(g,"codes",{value:r,enumerable:!1}),g.color.close="\x1B[39m",g.bgColor.close="\x1B[49m",g.color.ansi=E$(),g.color.ansi256=T$(),g.color.ansi16m=P$(),g.bgColor.ansi=E$(t$),g.bgColor.ansi256=T$(t$),g.bgColor.ansi16m=P$(t$),Object.defineProperties(g,{rgbToAnsi256:{value:(m,a,b)=>m===a&&a===b?m<8?16:m>248?231:Math.round((m-8)/247*24)+232:16+36*Math.round(m/255*5)+6*Math.round(a/255*5)+Math.round(b/255*5),enumerable:!1},hexToRgb:{value:(m)=>{const a=/[a-f\d]{6}|[a-f\d]{3}/i.exec(m.toString(16));if(!a)return[0,0,0];let[b]=a;b.length===3&&(b=[...b].map((o)=>o+o).join(""));const h=Number.parseInt(b,16);return[h>>16&255,h>>8&255,h&255]},enumerable:!1},hexToAnsi256:{value:(m)=>g.rgbToAnsi256(...g.hexToRgb(m)),enumerable:!1},ansi256ToAnsi:{value:(m)=>{if(m<8)return 30+m;if(m<16)return 90+(m-8);let a,b,h;if(m>=232)a=((m-232)*10+8)/255,b=a,h=a;else{m-=16;const v=m%36;a=Math.floor(m/36)/5,b=Math.floor(v/6)/5,h=v%6/5}const o=Math.max(a,b,h)*2;if(o===0)return 30;let $=30+(Math.round(h)<<2|Math.round(b)<<1|Math.round(a));return o===2&&($+=60),$},enumerable:!1},rgbToAnsi:{value:(m,a,b)=>g.ansi256ToAnsi(g.rgbToAnsi256(m,a,b)),enumerable:!1},hexToAnsi:{value:(m)=>g.ansi256ToAnsi(g.hexToAnsi256(m)),enumerable:!1}}),g},O$=function(r,m,a){return String(r).normalize().replace(/\r\n/g,`
20
17
  `).split(`
21
- `).map((e)=>Fr(e,m,a)).join(`
22
- `)}var Dr=Object.defineProperty,$m=(r,m,a)=>(m in r)?Dr(r,m,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[m]=a,n=(r,m,a)=>($m(r,typeof m!="symbol"?m+"":m,a),a);function rm(r,m){if(r===m)return;let a=r.split(`
23
- `),e=m.split(`
24
- `),t=[];for(let h=0;h<Math.max(a.length,e.length);h++)a[h]!==e[h]&&t.push(h);return t}var C$=Symbol("clack:cancel");function X(r){return r===C$}function A(r,m){r.isTTY&&r.setRawMode(m)}var T$=new Map([["k","up"],["j","down"],["h","left"],["l","right"]]),mm=new Set(["up","down","left","right","space","enter"]);class b${constructor({render:r,input:m=I$,output:a=U$,...e},t=!0){n(this,"input"),n(this,"output"),n(this,"rl"),n(this,"opts"),n(this,"_track",!1),n(this,"_render"),n(this,"_cursor",0),n(this,"state","initial"),n(this,"value"),n(this,"error",""),n(this,"subscribers",new Map),n(this,"_prevFrame",""),this.opts=e,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=r.bind(this),this._track=t,this.input=m,this.output=a}prompt(){let r=new kr(0);return r._write=(m,a,e)=>{this._track&&(this.value=this.rl.line.replace(/\t/g,""),this._cursor=this.rl.cursor,this.emit("value",this.value)),e()},this.input.pipe(r),this.rl=H$.createInterface({input:this.input,output:r,tabSize:2,prompt:"",escapeCodeTimeout:50}),H$.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),A(this.input,!0),this.output.on("resize",this.render),this.render(),new Promise((m,a)=>{this.once("submit",()=>{this.output.write(w.cursor.show),this.output.off("resize",this.render),A(this.input,!1),m(this.value)}),this.once("cancel",()=>{this.output.write(w.cursor.show),this.output.off("resize",this.render),A(this.input,!1),m(C$)})})}on(r,m){let a=this.subscribers.get(r)??[];a.push({cb:m}),this.subscribers.set(r,a)}once(r,m){let a=this.subscribers.get(r)??[];a.push({cb:m,once:!0}),this.subscribers.set(r,a)}emit(r,...m){let a=this.subscribers.get(r)??[],e=[];for(let t of a)t.cb(...m),t.once&&e.push(()=>a.splice(a.indexOf(t),1));for(let t of e)t()}unsubscribe(){this.subscribers.clear()}onKeypress(r,m){if(this.state==="error"&&(this.state="active"),m?.name&&!this._track&&T$.has(m.name)&&this.emit("cursor",T$.get(m.name)),m?.name&&mm.has(m.name)&&this.emit("cursor",m.name),r&&(r.toLowerCase()==="y"||r.toLowerCase()==="n")&&this.emit("confirm",r.toLowerCase()==="y"),r==="\t"&&this.opts.placeholder&&(this.value||(this.rl.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),r&&this.emit("key",r.toLowerCase()),m?.name==="return"){if(this.opts.validate){let a=this.opts.validate(this.value);a&&(this.error=a,this.state="error",this.rl.write(this.value))}this.state!=="error"&&(this.state="submit")}r==="\x03"&&(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(`
25
- `),A(this.input,!1),this.rl.close(),this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let r=E$(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
26
- `).length-1;this.output.write(w.cursor.move(-999,r*-1))}render(){let r=E$(this._render(this)??"",process.stdout.columns,{hard:!0});if(r!==this._prevFrame){if(this.state==="initial")this.output.write(w.cursor.hide);else{let m=rm(this._prevFrame,r);if(this.restoreCursor(),m&&m?.length===1){let a=m[0];this.output.write(w.cursor.move(0,a)),this.output.write(w.erase.lines(1));let e=r.split(`
27
- `);this.output.write(e[a]),this._prevFrame=r,this.output.write(w.cursor.move(0,e.length-a-1));return}else if(m&&m?.length>1){let a=m[0];this.output.write(w.cursor.move(0,a)),this.output.write(w.erase.down());let e=r.split(`
28
- `).slice(a);this.output.write(e.join(`
29
- `)),this._prevFrame=r;return}this.output.write(w.erase.down())}this.output.write(r),this.state==="initial"&&(this.state="active"),this._prevFrame=r}}}var am=Object.defineProperty,em=(r,m,a)=>(m in r)?am(r,m,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[m]=a,P$=(r,m,a)=>(em(r,typeof m!="symbol"?m+"":m,a),a),_$=class extends b${constructor(r){super(r,!1),P$(this,"options"),P$(this,"cursor",0),this.options=r.options,this.cursor=this.options.findIndex(({value:m})=>m===r.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",(m)=>{switch(m){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}};var tm=Object.defineProperty,hm=(r,m,a)=>(m in r)?tm(r,m,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[m]=a,sm=(r,m,a)=>(hm(r,typeof m!="symbol"?m+"":m,a),a);class c$ extends b${constructor(r){super(r),sm(this,"valueWithCursor",""),this.on("finalize",()=>{this.value||(this.value=r.defaultValue),this.valueWithCursor=this.value}),this.on("value",()=>{if(this.cursor>=this.value.length)this.valueWithCursor=`${this.value}${N.default.inverse(N.default.hidden("_"))}`;else{let m=this.value.slice(0,this.cursor),a=this.value.slice(this.cursor);this.valueWithCursor=`${m}${N.default.inverse(a[0])}${a.slice(1)}`}})}get cursor(){return this._cursor}}var bm=globalThis.process.platform.startsWith("win");function u$({input:r=I$,output:m=U$,overwrite:a=!0,hideCursor:e=!0}={}){let t=W.createInterface({input:r,output:m,prompt:"",tabSize:1});W.emitKeypressEvents(r,t),r.isTTY&&r.setRawMode(!0);let h=($,{name:b})=>{if(String($)==="\x03"){e&&m.write(w.cursor.show),process.exit(0);return}if(!a)return;W.moveCursor(m,b==="return"?0:-1,b==="return"?-1:0,()=>{W.clearLine(m,1,()=>{r.once("keypress",h)})})};return e&&m.write(w.cursor.hide),r.once("keypress",h),()=>{r.off("keypress",h),e&&m.write(w.cursor.show),r.isTTY&&!bm&&r.setRawMode(!1),t.terminal=!1,t.close()}}var s=q(a$(),1),j=q(r$(),1);import S from"process";function cm(){return S.platform!=="win32"?S.env.TERM!=="linux":Boolean(S.env.CI)||Boolean(S.env.WT_SESSION)||Boolean(S.env.TERMINUS_SUBLIME)||S.env.ConEmuTask==="{cmd::Cmder}"||S.env.TERM_PROGRAM==="Terminus-Sublime"||S.env.TERM_PROGRAM==="vscode"||S.env.TERM==="xterm-256color"||S.env.TERM==="alacritty"||S.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var o$=cm(),l=(r,m)=>o$?r:m,om=l("\u25C6","*"),F$=l("\u25A0","x"),D$=l("\u25B2","x"),i$=l("\u25C7","o"),S1=l("\u250C","T"),y=l("\u2502","|"),C=l("\u2514","\u2014"),im=l("\u25CF",">"),vm=l("\u25CB"," "),M1=l("\u25FB","[\u2022]"),q1=l("\u25FC","[+]"),W1=l("\u25FB","[ ]"),f1=l("\u25AA","\u2022"),G1=l("\u2500","-"),Z1=l("\u256E","+"),z1=l("\u251C","+"),J1=l("\u256F","+"),xm=l("\u25CF","\u2022"),gm=l("\u25C6","*"),lm=l("\u25B2","!"),dm=l("\u25A0","x"),$r=(r)=>{switch(r){case"initial":case"active":return s.default.cyan(om);case"cancel":return s.default.red(F$);case"error":return s.default.yellow(D$);case"submit":return s.default.green(i$)}},rr=(r)=>new c$({validate:r.validate,placeholder:r.placeholder,defaultValue:r.defaultValue,initialValue:r.initialValue,render(){let m=`${s.default.gray(y)}
30
- ${$r(this.state)} ${r.message}
31
- `,a=r.placeholder?s.default.inverse(r.placeholder[0])+s.default.dim(r.placeholder.slice(1)):s.default.inverse(s.default.hidden("_")),e=this.value?this.valueWithCursor:a;switch(this.state){case"error":return`${m.trim()}
32
- ${s.default.yellow(y)} ${e}
33
- ${s.default.yellow(C)} ${s.default.yellow(this.error)}
34
- `;case"submit":return`${m}${s.default.gray(y)} ${s.default.dim(this.value||r.placeholder)}`;case"cancel":return`${m}${s.default.gray(y)} ${s.default.strikethrough(s.default.dim(this.value??""))}${this.value?.trim()?`
35
- `+s.default.gray(y):""}`;default:return`${m}${s.default.cyan(y)} ${e}
36
- ${s.default.cyan(C)}
37
- `}}}).prompt();var mr=(r)=>{let m=(e,t)=>{let h=e.label??String(e.value);return t==="active"?`${s.default.green(im)} ${h} ${e.hint?s.default.dim(`(${e.hint})`):""}`:t==="selected"?`${s.default.dim(h)}`:t==="cancelled"?`${s.default.strikethrough(s.default.dim(h))}`:`${s.default.dim(vm)} ${s.default.dim(h)}`},a=0;return new _$({options:r.options,initialValue:r.initialValue,render(){let e=`${s.default.gray(y)}
38
- ${$r(this.state)} ${r.message}
39
- `;switch(this.state){case"submit":return`${e}${s.default.gray(y)} ${m(this.options[this.cursor],"selected")}`;case"cancel":return`${e}${s.default.gray(y)} ${m(this.options[this.cursor],"cancelled")}
40
- ${s.default.gray(y)}`;default:{let t=r.maxItems===void 0?1/0:Math.max(r.maxItems,5);this.cursor>=a+t-3?a=Math.max(Math.min(this.cursor-t+3,this.options.length-t),0):this.cursor<a+2&&(a=Math.max(this.cursor-2,0));let h=t<this.options.length&&a>0,$=t<this.options.length&&a+t<this.options.length;return`${e}${s.default.cyan(y)} ${this.options.slice(a,a+t).map((b,i,c)=>i===0&&h?s.default.dim("..."):i===c.length-1&&$?s.default.dim("..."):m(b,i+a===this.cursor?"active":"inactive")).join(`
41
- ${s.default.cyan(y)} `)}
42
- ${s.default.cyan(C)}
43
- `}}}}).prompt()};var v$=(r="")=>{process.stdout.write(`${s.default.gray(y)}
44
- ${s.default.gray(C)} ${r}
18
+ `).map((b)=>mm(b,m,a)).join(`
19
+ `)},hm=function(r,m){if(r===m)return;const a=r.split(`
20
+ `),b=m.split(`
21
+ `),h=[];for(let o=0;o<Math.max(a.length,b.length);o++)a[o]!==b[o]&&h.push(o);return h},B=function(r){return r===$r},I=function(r,m){r.isTTY&&r.setRawMode(m)},mr=function({input:r=R$,output:m=I$,overwrite:a=!0,hideCursor:b=!0}={}){const h=Z.createInterface({input:r,output:m,prompt:"",tabSize:1});Z.emitKeypressEvents(r,h),r.isTTY&&r.setRawMode(!0);const o=($,{name:v})=>{if(String($)===""){b&&m.write(l.cursor.show),process.exit(0);return}if(!a)return;Z.moveCursor(m,v==="return"?0:-1,v==="return"?-1:0,()=>{Z.clearLine(m,1,()=>{r.once("keypress",o)})})};return b&&m.write(l.cursor.hide),r.once("keypress",o),()=>{r.off("keypress",o),b&&m.write(l.cursor.show),r.isTTY&&!em&&r.setRawMode(!1),h.terminal=!1,h.close()}},Kr=Ur(),u$={exports:{}};(function(r){var m={};r.exports=m,m.eastAsianWidth=function(b){var h=b.charCodeAt(0),o=b.length==2?b.charCodeAt(1):0,$=h;return 55296<=h&&h<=56319&&56320<=o&&o<=57343&&(h&=1023,o&=1023,$=h<<10|o,$+=65536),$==12288||65281<=$&&$<=65376||65504<=$&&$<=65510?"F":$==8361||65377<=$&&$<=65470||65474<=$&&$<=65479||65482<=$&&$<=65487||65490<=$&&$<=65495||65498<=$&&$<=65500||65512<=$&&$<=65518?"H":4352<=$&&$<=4447||4515<=$&&$<=4519||4602<=$&&$<=4607||9001<=$&&$<=9002||11904<=$&&$<=11929||11931<=$&&$<=12019||12032<=$&&$<=12245||12272<=$&&$<=12283||12289<=$&&$<=12350||12353<=$&&$<=12438||12441<=$&&$<=12543||12549<=$&&$<=12589||12593<=$&&$<=12686||12688<=$&&$<=12730||12736<=$&&$<=12771||12784<=$&&$<=12830||12832<=$&&$<=12871||12880<=$&&$<=13054||13056<=$&&$<=19903||19968<=$&&$<=42124||42128<=$&&$<=42182||43360<=$&&$<=43388||44032<=$&&$<=55203||55216<=$&&$<=55238||55243<=$&&$<=55291||63744<=$&&$<=64255||65040<=$&&$<=65049||65072<=$&&$<=65106||65108<=$&&$<=65126||65128<=$&&$<=65131||110592<=$&&$<=110593||127488<=$&&$<=127490||127504<=$&&$<=127546||127552<=$&&$<=127560||127568<=$&&$<=127569||131072<=$&&$<=194367||177984<=$&&$<=196605||196608<=$&&$<=262141?"W":32<=$&&$<=126||162<=$&&$<=163||165<=$&&$<=166||$==172||$==175||10214<=$&&$<=10221||10629<=$&&$<=10630?"Na":$==161||$==164||167<=$&&$<=168||$==170||173<=$&&$<=174||176<=$&&$<=180||182<=$&&$<=186||188<=$&&$<=191||$==198||$==208||215<=$&&$<=216||222<=$&&$<=225||$==230||232<=$&&$<=234||236<=$&&$<=237||$==240||242<=$&&$<=243||247<=$&&$<=250||$==252||$==254||$==257||$==273||$==275||$==283||294<=$&&$<=295||$==299||305<=$&&$<=307||$==312||319<=$&&$<=322||$==324||328<=$&&$<=331||$==333||338<=$&&$<=339||358<=$&&$<=359||$==363||$==462||$==464||$==466||$==468||$==470||$==472||$==474||$==476||$==593||$==609||$==708||$==711||713<=$&&$<=715||$==717||$==720||728<=$&&$<=731||$==733||$==735||768<=$&&$<=879||913<=$&&$<=929||931<=$&&$<=937||945<=$&&$<=961||963<=$&&$<=969||$==1025||1040<=$&&$<=1103||$==1105||$==8208||8211<=$&&$<=8214||8216<=$&&$<=8217||8220<=$&&$<=8221||8224<=$&&$<=8226||8228<=$&&$<=8231||$==8240||8242<=$&&$<=8243||$==8245||$==8251||$==8254||$==8308||$==8319||8321<=$&&$<=8324||$==8364||$==8451||$==8453||$==8457||$==8467||$==8470||8481<=$&&$<=8482||$==8486||$==8491||8531<=$&&$<=8532||8539<=$&&$<=8542||8544<=$&&$<=8555||8560<=$&&$<=8569||$==8585||8592<=$&&$<=8601||8632<=$&&$<=8633||$==8658||$==8660||$==8679||$==8704||8706<=$&&$<=8707||8711<=$&&$<=8712||$==8715||$==8719||$==8721||$==8725||$==8730||8733<=$&&$<=8736||$==8739||$==8741||8743<=$&&$<=8748||$==8750||8756<=$&&$<=8759||8764<=$&&$<=8765||$==8776||$==8780||$==8786||8800<=$&&$<=8801||8804<=$&&$<=8807||8810<=$&&$<=8811||8814<=$&&$<=8815||8834<=$&&$<=8835||8838<=$&&$<=8839||$==8853||$==8857||$==8869||$==8895||$==8978||9312<=$&&$<=9449||9451<=$&&$<=9547||9552<=$&&$<=9587||9600<=$&&$<=9615||9618<=$&&$<=9621||9632<=$&&$<=9633||9635<=$&&$<=9641||9650<=$&&$<=9651||9654<=$&&$<=9655||9660<=$&&$<=9661||9664<=$&&$<=9665||9670<=$&&$<=9672||$==9675||9678<=$&&$<=9681||9698<=$&&$<=9701||$==9711||9733<=$&&$<=9734||$==9737||9742<=$&&$<=9743||9748<=$&&$<=9749||$==9756||$==9758||$==9792||$==9794||9824<=$&&$<=9825||9827<=$&&$<=9829||9831<=$&&$<=9834||9836<=$&&$<=9837||$==9839||9886<=$&&$<=9887||9918<=$&&$<=9919||9924<=$&&$<=9933||9935<=$&&$<=9953||$==9955||9960<=$&&$<=9983||$==10045||$==10071||10102<=$&&$<=10111||11093<=$&&$<=11097||12872<=$&&$<=12879||57344<=$&&$<=63743||65024<=$&&$<=65039||$==65533||127232<=$&&$<=127242||127248<=$&&$<=127277||127280<=$&&$<=127337||127344<=$&&$<=127386||917760<=$&&$<=917999||983040<=$&&$<=1048573||1048576<=$&&$<=1114109?"A":"N"},m.characterLength=function(b){var h=this.eastAsianWidth(b);return h=="F"||h=="W"||h=="A"?2:1};function a(b){return b.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}m.length=function(b){for(var h=a(b),o=0,$=0;$<h.length;$++)o=o+this.characterLength(h[$]);return o},m.slice=function(b,h,o){textLen=m.length(b),h=h||0,o=o||1,h<0&&(h=textLen+h),o<0&&(o=textLen+o);for(var $="",v=0,t=a(b),c=0;c<t.length;c++){var e=t[c],x=m.length(e);if(v>=h-(x==2?1:0))if(v+x<=o)$+=e;else break;v+=x}return $}})(u$);var Or=u$.exports,Ar=C$(Or),Nr=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},Rr=C$(Nr),t$=10,E$=(r=0)=>(m)=>`\x1B[${m+r}m`,T$=(r=0)=>(m)=>`\x1B[${38+r};5;${m}m`,P$=(r=0)=>(m,a,b)=>`\x1B[${38+r};2;${m};${a};${b}m`,g={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(g.modifier);var Ir=Object.keys(g.color),_r=Object.keys(g.bgColor);[...Ir];var ur=Cr(),C=new Set(["\x1B","\x9B"]),Fr=39,g$="\x07",F$="[",Dr="]",D$="m",d$=`${Dr}8;;`,U$=(r)=>`${C.values().next().value}${F$}${r}${D$}`,K$=(r)=>`${C.values().next().value}${d$}${r}${g$}`,$m=(r)=>r.split(" ").map((m)=>V(m)),e$=(r,m,a)=>{const b=[...m];let h=!1,o=!1,$=V(_$(r[r.length-1]));for(let[v,t]of b.entries()){const c=V(t);if($+c<=a?r[r.length-1]+=t:(r.push(t),$=0),C.has(t)&&(h=!0,o=b.slice(v+1).join("").startsWith(d$)),h){o?t===g$&&(h=!1,o=!1):t===D$&&(h=!1);continue}$+=c,$===a&&v<b.length-1&&(r.push(""),$=0)}!$&&r[r.length-1].length>0&&r.length>1&&(r[r.length-2]+=r.pop())},rm=(r)=>{const m=r.split(" ");let a=m.length;for(;a>0&&!(V(m[a-1])>0);)a--;return a===m.length?r:m.slice(0,a).join(" ")+m.slice(a).join("")},mm=(r,m,a={})=>{if(a.trim!==!1&&r.trim()==="")return"";let b="",h,o;const $=$m(r);let v=[""];for(let[c,e]of r.split(" ").entries()){a.trim!==!1&&(v[v.length-1]=v[v.length-1].trimStart());let x=V(v[v.length-1]);if(c!==0&&(x>=m&&(a.wordWrap===!1||a.trim===!1)&&(v.push(""),x=0),(x>0||a.trim===!1)&&(v[v.length-1]+=" ",x++)),a.hard&&$[c]>m){const y=m-x,J=1+Math.floor(($[c]-y-1)/m);Math.floor(($[c]-1)/m)<J&&v.push(""),e$(v,e,m);continue}if(x+$[c]>m&&x>0&&$[c]>0){if(a.wordWrap===!1&&x<m){e$(v,e,m);continue}v.push("")}if(x+$[c]>m&&a.wordWrap===!1){e$(v,e,m);continue}v[v.length-1]+=e}a.trim!==!1&&(v=v.map((c)=>rm(c)));const t=[...v.join(`
22
+ `)];for(let[c,e]of t.entries()){if(b+=e,C.has(e)){const{groups:y}=new RegExp(`(?:\\${F$}(?<code>\\d+)m|\\${d$}(?<uri>.*)${g$})`).exec(t.slice(c).join(""))||{groups:{}};if(y.code!==void 0){const J=Number.parseFloat(y.code);h=J===Fr?void 0:J}else y.uri!==void 0&&(o=y.uri.length===0?void 0:y.uri)}const x=ur.codes.get(Number(h));t[c+1]===`
23
+ `?(o&&(b+=K$("")),h&&x&&(b+=U$(x))):e===`
24
+ `&&(h&&x&&(b+=U$(h)),o&&(b+=K$(o)))}return b},am=Object.defineProperty,bm=(r,m,a)=>(m in r)?am(r,m,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[m]=a,M=(r,m,a)=>(bm(r,typeof m!="symbol"?m+"":m,a),a),$r=Symbol("clack:cancel"),A$=new Map([["k","up"],["j","down"],["h","left"],["l","right"]]),om=new Set(["up","down","left","right","space","enter"]);class i${constructor({render:r,input:m=R$,output:a=I$,...b},h=!0){M(this,"input"),M(this,"output"),M(this,"rl"),M(this,"opts"),M(this,"_track",!1),M(this,"_render"),M(this,"_cursor",0),M(this,"state","initial"),M(this,"value"),M(this,"error",""),M(this,"subscribers",new Map),M(this,"_prevFrame",""),this.opts=b,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=r.bind(this),this._track=h,this.input=m,this.output=a}prompt(){const r=new Pr(0);return r._write=(m,a,b)=>{this._track&&(this.value=this.rl.line.replace(/\t/g,""),this._cursor=this.rl.cursor,this.emit("value",this.value)),b()},this.input.pipe(r),this.rl=k$.createInterface({input:this.input,output:r,tabSize:2,prompt:"",escapeCodeTimeout:50}),k$.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),I(this.input,!0),this.output.on("resize",this.render),this.render(),new Promise((m,a)=>{this.once("submit",()=>{this.output.write(l.cursor.show),this.output.off("resize",this.render),I(this.input,!1),m(this.value)}),this.once("cancel",()=>{this.output.write(l.cursor.show),this.output.off("resize",this.render),I(this.input,!1),m($r)})})}on(r,m){const a=this.subscribers.get(r)??[];a.push({cb:m}),this.subscribers.set(r,a)}once(r,m){const a=this.subscribers.get(r)??[];a.push({cb:m,once:!0}),this.subscribers.set(r,a)}emit(r,...m){const a=this.subscribers.get(r)??[],b=[];for(let h of a)h.cb(...m),h.once&&b.push(()=>a.splice(a.indexOf(h),1));for(let h of b)h()}unsubscribe(){this.subscribers.clear()}onKeypress(r,m){if(this.state==="error"&&(this.state="active"),m?.name&&!this._track&&A$.has(m.name)&&this.emit("cursor",A$.get(m.name)),m?.name&&om.has(m.name)&&this.emit("cursor",m.name),r&&(r.toLowerCase()==="y"||r.toLowerCase()==="n")&&this.emit("confirm",r.toLowerCase()==="y"),r===" "&&this.opts.placeholder&&(this.value||(this.rl.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),r&&this.emit("key",r.toLowerCase()),m?.name==="return"){if(this.opts.validate){const a=this.opts.validate(this.value);a&&(this.error=a,this.state="error",this.rl.write(this.value))}this.state!=="error"&&(this.state="submit")}r===""&&(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(`
25
+ `),I(this.input,!1),this.rl.close(),this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){const r=O$(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
26
+ `).length-1;this.output.write(l.cursor.move(-999,r*-1))}render(){const r=O$(this._render(this)??"",process.stdout.columns,{hard:!0});if(r!==this._prevFrame){if(this.state==="initial")this.output.write(l.cursor.hide);else{const m=hm(this._prevFrame,r);if(this.restoreCursor(),m&&m?.length===1){const a=m[0];this.output.write(l.cursor.move(0,a)),this.output.write(l.erase.lines(1));const b=r.split(`
27
+ `);this.output.write(b[a]),this._prevFrame=r,this.output.write(l.cursor.move(0,b.length-a-1));return}else if(m&&m?.length>1){const a=m[0];this.output.write(l.cursor.move(0,a)),this.output.write(l.erase.down());const b=r.split(`
28
+ `).slice(a);this.output.write(b.join(`
29
+ `)),this._prevFrame=r;return}this.output.write(l.erase.down())}this.output.write(r),this.state==="initial"&&(this.state="active"),this._prevFrame=r}}}var sm=Object.defineProperty,vm=(r,m,a)=>(m in r)?sm(r,m,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[m]=a,N$=(r,m,a)=>(vm(r,typeof m!="symbol"?m+"":m,a),a),rr=class extends i${constructor(r){super(r,!1),N$(this,"options"),N$(this,"cursor",0),this.options=r.options,this.cursor=this.options.findIndex(({value:m})=>m===r.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",(m)=>{switch(m){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}};var cm=Object.defineProperty,xm=(r,m,a)=>(m in r)?cm(r,m,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[m]=a,tm=(r,m,a)=>(xm(r,typeof m!="symbol"?m+"":m,a),a);class w$ extends i${constructor(r){super(r),tm(this,"valueWithCursor",""),this.on("finalize",()=>{this.value||(this.value=r.defaultValue),this.valueWithCursor=this.value}),this.on("value",()=>{if(this.cursor>=this.value.length)this.valueWithCursor=`${this.value}${_.default.inverse(_.default.hidden("_"))}`;else{const m=this.value.slice(0,this.cursor),a=this.value.slice(this.cursor);this.valueWithCursor=`${m}${_.default.inverse(a[0])}${a.slice(1)}`}})}get cursor(){return this._cursor}}var em=globalThis.process.platform.startsWith("win");var s=U(x$(),1),j=U(v$(),1);import W from"process";var gm=function(){return W.platform!=="win32"?W.env.TERM!=="linux":Boolean(W.env.CI)||Boolean(W.env.WT_SESSION)||Boolean(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"};var y$=gm(),w=(r,m)=>y$?r:m,dm=w("\u25C6","*"),ar=w("\u25A0","x"),br=w("\u25B2","x"),p$=w("\u25C7","o"),J1=w("\u250C","T"),p=w("\u2502","|"),u=w("\u2514","\u2014"),im=w("\u25CF",">"),wm=w("\u25CB"," "),S1=w("\u25FB","[\u2022]"),f1=w("\u25FC","[+]"),Q1=w("\u25FB","[ ]"),n1=w("\u25AA","\u2022"),Y1=w("\u2500","-"),j1=w("\u256E","+"),H1=w("\u251C","+"),L1=w("\u256F","+"),ym=w("\u25CF","\u2022"),pm=w("\u25C6","*"),lm=w("\u25B2","!"),Mm=w("\u25A0","x"),hr=(r)=>{switch(r){case"initial":case"active":return s.default.cyan(dm);case"cancel":return s.default.red(ar);case"error":return s.default.yellow(br);case"submit":return s.default.green(p$)}},or=(r)=>new w$({validate:r.validate,placeholder:r.placeholder,defaultValue:r.defaultValue,initialValue:r.initialValue,render(){const m=`${s.default.gray(p)}
30
+ ${hr(this.state)} ${r.message}
31
+ `,a=r.placeholder?s.default.inverse(r.placeholder[0])+s.default.dim(r.placeholder.slice(1)):s.default.inverse(s.default.hidden("_")),b=this.value?this.valueWithCursor:a;switch(this.state){case"error":return`${m.trim()}
32
+ ${s.default.yellow(p)} ${b}
33
+ ${s.default.yellow(u)} ${s.default.yellow(this.error)}
34
+ `;case"submit":return`${m}${s.default.gray(p)} ${s.default.dim(this.value||r.placeholder)}`;case"cancel":return`${m}${s.default.gray(p)} ${s.default.strikethrough(s.default.dim(this.value??""))}${this.value?.trim()?`
35
+ `+s.default.gray(p):""}`;default:return`${m}${s.default.cyan(p)} ${b}
36
+ ${s.default.cyan(u)}
37
+ `}}}).prompt();var sr=(r)=>{const m=(b,h)=>{const o=b.label??String(b.value);return h==="active"?`${s.default.green(im)} ${o} ${b.hint?s.default.dim(`(${b.hint})`):""}`:h==="selected"?`${s.default.dim(o)}`:h==="cancelled"?`${s.default.strikethrough(s.default.dim(o))}`:`${s.default.dim(wm)} ${s.default.dim(o)}`};let a=0;return new rr({options:r.options,initialValue:r.initialValue,render(){const b=`${s.default.gray(p)}
38
+ ${hr(this.state)} ${r.message}
39
+ `;switch(this.state){case"submit":return`${b}${s.default.gray(p)} ${m(this.options[this.cursor],"selected")}`;case"cancel":return`${b}${s.default.gray(p)} ${m(this.options[this.cursor],"cancelled")}
40
+ ${s.default.gray(p)}`;default:{const h=r.maxItems===void 0?1/0:Math.max(r.maxItems,5);this.cursor>=a+h-3?a=Math.max(Math.min(this.cursor-h+3,this.options.length-h),0):this.cursor<a+2&&(a=Math.max(this.cursor-2,0));const o=h<this.options.length&&a>0,$=h<this.options.length&&a+h<this.options.length;return`${b}${s.default.cyan(p)} ${this.options.slice(a,a+h).map((v,t,c)=>t===0&&o?s.default.dim("..."):t===c.length-1&&$?s.default.dim("..."):m(v,t+a===this.cursor?"active":"inactive")).join(`
41
+ ${s.default.cyan(p)} `)}
42
+ ${s.default.cyan(u)}
43
+ `}}}}).prompt()};var l$=(r="")=>{process.stdout.write(`${s.default.gray(p)}
44
+ ${s.default.gray(u)} ${r}
45
45
 
46
- `)},g={message:(r="",{symbol:m=s.default.gray(y)}={})=>{let a=[`${s.default.gray(y)}`];if(r){let[e,...t]=r.split(`
47
- `);a.push(`${m} ${e}`,...t.map((h)=>`${s.default.gray(y)} ${h}`))}process.stdout.write(`${a.join(`
46
+ `)},d={message:(r="",{symbol:m=s.default.gray(p)}={})=>{const a=[`${s.default.gray(p)}`];if(r){const[b,...h]=r.split(`
47
+ `);a.push(`${m} ${b}`,...h.map((o)=>`${s.default.gray(p)} ${o}`))}process.stdout.write(`${a.join(`
48
48
  `)}
49
- `)},info:(r)=>{g.message(r,{symbol:s.default.blue(xm)})},success:(r)=>{g.message(r,{symbol:s.default.green(gm)})},step:(r)=>{g.message(r,{symbol:s.default.green(i$)})},warn:(r)=>{g.message(r,{symbol:s.default.yellow(lm)})},warning:(r)=>{g.warn(r)},error:(r)=>{g.message(r,{symbol:s.default.red(dm)})}},f=()=>{let r=o$?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],m=o$?80:120,a,e,t=!1,h="",$=(v="")=>{t=!0,a=u$(),h=v.replace(/\.+$/,""),process.stdout.write(`${s.default.gray(y)}
50
- `);let o=0,d=0;e=setInterval(()=>{let G=s.default.magenta(r[o]),B=".".repeat(Math.floor(d)).slice(0,3);process.stdout.write(j.cursor.move(-999,0)),process.stdout.write(j.erase.down(1)),process.stdout.write(`${G} ${h}${B}`),o=o+1<r.length?o+1:0,d=d<r.length?d+0.125:0},m)},b=(v="",o=0)=>{h=v??h,t=!1,clearInterval(e);let d=o===0?s.default.green(i$):o===1?s.default.red(F$):s.default.red(D$);process.stdout.write(j.cursor.move(-999,0)),process.stdout.write(j.erase.down(1)),process.stdout.write(`${d} ${h}
51
- `),a()},i=(v="")=>{h=v??h},c=(v)=>{let o=v>1?"Something went wrong":"Canceled";t&&b(o,v)};return process.on("uncaughtExceptionMonitor",()=>c(2)),process.on("unhandledRejection",()=>c(2)),process.on("SIGINT",()=>c(1)),process.on("SIGTERM",()=>c(1)),process.on("exit",c),{start:$,stop:b,message:i}};function wm(r){return r.startsWith("cr_")&&r.length>10}async function nm(r){try{let a=await(await fetch(`${M}/apiStats/api/get-key-id`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:r})})).json();if(a.success&&a.data?.id)return{valid:!0,apiId:a.data.id};return{valid:!1,error:a.error||"Key \u9A8C\u8BC1\u5931\u8D25"}}catch(m){return{valid:!1,error:m instanceof Error?m.message:"\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25"}}}async function ar(r){if(!wm(r))return{success:!1,error:"Key \u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u5FC5\u987B\u4EE5 cr_ \u5F00\u5934"};let m=await nm(r);if(!m.valid)return{success:!1,error:m.error};return await P({apiKey:r,apiId:m.apiId}),{success:!0}}import{join as sr}from"path";var _=null,x$={cn:{npm:"https://registry.npmmirror.com",bun:"https://bun.sh/install",bunMirror:"https://registry.npmmirror.com/-/binary/bun"},global:{npm:"https://registry.npmjs.org",bun:"https://bun.sh/install",bunMirror:null}};async function k(){if(_)return _;let r=[pm,Sm,Mm];for(let m of r)try{let a=await Promise.race([m(),new Promise((e,t)=>setTimeout(()=>t(Error("timeout")),3000))]);if(a)return _=a,a}catch{}return _="cn","cn"}async function pm(){try{let r=await fetch("http://ip-api.com/json/?fields=countryCode",{signal:AbortSignal.timeout(2000)});if(!r.ok)return null;return(await r.json()).countryCode==="CN"?"cn":"global"}catch{return null}}async function Sm(){try{let r=await fetch("https://ipinfo.io/json",{signal:AbortSignal.timeout(2000)});if(!r.ok)return null;return(await r.json()).country==="CN"?"cn":"global"}catch{return null}}async function Mm(){try{let r=await fetch("https://api.ip.sb/geoip",{signal:AbortSignal.timeout(2000)});if(!r.ok)return null;return(await r.json()).country_code==="CN"?"cn":"global"}catch{return null}}async function qm(){let r=await k();return x$[r]}async function Y(){return(await qm()).npm}async function er(){if(await k()==="cn")return`curl -fsSL https://bun.sh/install | BUN_INSTALL_MIRROR="${x$.cn.bunMirror}" bash`;return"curl -fsSL https://bun.sh/install | bash"}async function tr(){let r=await k(),m=x$[r];if(r==="cn")g.info("\u68C0\u6D4B\u5230\u4E2D\u56FD\u5927\u9646\u7F51\u7EDC\uFF0C\u4F7F\u7528\u56FD\u5185\u955C\u50CF\u6E90"),g.message(` npm: ${m.npm}`);else g.info("\u4F7F\u7528\u56FD\u9645\u6E90")}var J=null;function Wm(r){return r.startsWith(Z)}async function br(){try{if(!await Bun.file(p).exists())return!1;let m=Bun.spawn([p,"--version"],{stdout:"pipe",stderr:"pipe"});return await m.exited,m.exitCode===0}catch{return!1}}async function fm(){if(process.platform==="win32")return!0;try{let m=Bun.spawn(["which","unzip"],{stdout:"pipe",stderr:"pipe"});if(await m.exited,m.exitCode===0)return!0}catch{}g.warn("\u6B63\u5728\u5B89\u88C5\u7CFB\u7EDF\u4F9D\u8D56 (unzip)...");let r=["apt-get update -qq && apt-get install -y -qq unzip","yum install -y -q unzip","dnf install -y -q unzip","pacman -S --noconfirm unzip","apk add --quiet unzip"];for(let m of r)try{let a=Bun.spawn(["bash","-c",`sudo ${m} 2>/dev/null || ${m}`],{stdout:"pipe",stderr:"pipe"});if(await a.exited,a.exitCode===0)return!0}catch{}return!1}async function Gm(){let r=f();if(!await fm())return g.error("\u8BF7\u5148\u624B\u52A8\u5B89\u88C5 unzip: apt install unzip / yum install unzip"),!1;await tr(),r.start("\u6B63\u5728\u5B89\u88C5 Tako \u4E13\u5C5E Bun \u8FD0\u884C\u65F6...");try{await(await import("fs/promises")).mkdir(Z,{recursive:!0});let a;if(process.platform==="win32"){let t=await k()==="cn"?'$env:BUN_INSTALL_MIRROR="https://registry.npmmirror.com/-/binary/bun"; ':"",h=`$env:BUN_INSTALL="${Z}"; ${t}irm bun.sh/install.ps1 | iex`;a=await Bun.spawn(["powershell","-Command",h],{stdout:"inherit",stderr:"inherit"}).exited}else{let e=await er(),t=`BUN_INSTALL="${Z}" ${e}`;a=await Bun.spawn(["bash","-c",t],{stdout:"inherit",stderr:"inherit"}).exited}if(a!==0)return r.stop("Bun \u5B89\u88C5\u5931\u8D25"),!1;return J=p,r.stop("Tako \u4E13\u5C5E Bun \u5B89\u88C5\u5B8C\u6210"),g.info(`\u5B89\u88C5\u4F4D\u7F6E: ${Z}`),!0}catch(m){return r.stop("Bun \u5B89\u88C5\u5931\u8D25"),!1}}async function Zm(){if(await br())return J=p,!0;return g.warn("\u672A\u68C0\u6D4B\u5230 Tako \u4E13\u5C5E Bun\uFF0C\u6B63\u5728\u81EA\u52A8\u5B89\u88C5..."),g.info("\uFF08\u4E0D\u4F1A\u5F71\u54CD\u60A8\u7CFB\u7EDF\u4E2D\u5DF2\u5B89\u88C5\u7684 Node.js \u6216 Bun\uFF09"),await Gm()}async function g$(){if(J){if(!Wm(J))J=p;return J}if(await br())return J=p,p;return p}async function cr(r){try{let m=await Y(),a=await fetch(`${m}/${r}/latest`);if(!a.ok)return null;return(await a.json()).version}catch{return null}}async function zm(r){return(await z()).installedClients[r.id]?.version||null}async function or(r){let m=I(r.id),a=sr(m,"package.json");try{return await Bun.file(a).exists()}catch{return!1}}async function ir(r){let m=await zm(r);if(!m)return!0;let a=await cr(r.package);if(!a)return!1;return m!==a}async function hr(r,m=!1){let a=f(),e=I(r.id);try{if(!await Zm())return{success:!1,error:"Tako \u4E13\u5C5E Bun \u5B89\u88C5\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u7F51\u7EDC\u6216\u624B\u52A8\u5220\u9664 ~/.tako/bun \u76EE\u5F55\u540E\u91CD\u8BD5"};let t=await or(r),h=m||await ir(r);if(t&&!h)return{success:!0};let $=t?"\u66F4\u65B0":"\u5B89\u88C5";a.start(`\u6B63\u5728${$} ${r.name}...`),await(await import("fs/promises")).mkdir(e,{recursive:!0});let i=sr(e,"package.json");if(!await Bun.file(i).exists())await Bun.write(i,JSON.stringify({name:`tako-${r.id}`,private:!0,dependencies:{}},null,2));let v=await g$(),o=await Y(),d=Bun.spawn([v,"add",r.package,"--registry",o],{cwd:e,stdout:"pipe",stderr:"pipe"});if(await d.exited!==0){let E=await new Response(d.stderr).text();return a.stop(`${$} ${r.name} \u5931\u8D25`),{success:!1,error:E}}let B=await cr(r.package);if(B){let E=await z();E.installedClients[r.id]={version:B,installedAt:new Date().toISOString()},await P(E)}return a.stop(`${r.name} ${$}\u5B8C\u6210`),{success:!0}}catch(t){return a.stop("\u64CD\u4F5C\u5931\u8D25"),{success:!1,error:t instanceof Error?t.message:"\u672A\u77E5\u9519\u8BEF"}}}async function vr(r){if(!await or(r))return await hr(r);if(await ir(r))return await hr(r,!0);return{success:!0}}async function xr(r){try{let m=await vr(r);if(!m.success)return m;let a=await q$();if(!a)return{success:!1,error:"\u672A\u914D\u7F6E API Key"};if(r.setupConfigFiles)await r.setupConfigFiles(a);let e=Z$(r);if(!await Bun.file(e).exists())return{success:!1,error:`\u627E\u4E0D\u5230\u53EF\u6267\u884C\u6587\u4EF6: ${e}`};let h=r.getEnvVars(a),$={...process.env,...h};g.info(`\u542F\u52A8 ${r.name}...`);let b;if(r.runtime==="native")b=[e];else b=[await g$(),e];return await Bun.spawn(b,{env:$,stdio:["inherit","inherit","inherit"],cwd:process.cwd()}).exited,{success:!0}}catch(m){return{success:!1,error:m instanceof Error?m.message:"\u542F\u52A8\u5931\u8D25"}}}async function l$(){try{let r=await W$();if(!r)return{success:!1,error:"\u672A\u627E\u5230 API ID\uFF0C\u8BF7\u91CD\u65B0\u914D\u7F6E Key"};let a=await(await fetch(`${M}/apiStats/api/user-stats`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiId:r})})).json(),t=await(await fetch(`${M}/apiStats/api/user-model-stats`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiId:r,period:"daily"})})).json();if(!a.success)return{success:!1,error:a.error||a.message||"\u83B7\u53D6\u7EDF\u8BA1\u5931\u8D25"};let h=(t.data||[]).map(($)=>({model:$.model,requests:$.requests,cost:$.formatted?.total||"$0.00"}));return{success:!0,data:{totalRequests:a.data?.usage?.total?.requests||0,totalCost:a.data?.usage?.total?.formattedCost||"$0.00",todayCost:`$${(a.data?.limits?.currentDailyCost||0).toFixed(2)}`,modelStats:h}}}catch(r){return{success:!1,error:r instanceof Error?r.message:"\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25"}}}function d$(r){return r.toLocaleString("en-US")}var gr="tako-cli",H="0.1.22";function Jm(r,m){let a=r.split(".").map(Number),e=m.split(".").map(Number);for(let t=0;t<3;t++){let h=a[t]||0,$=e[t]||0;if(h>$)return 1;if(h<$)return-1}return 0}async function Qm(){try{let r=await Y(),m=await fetch(`${r}/${gr}/latest`,{signal:AbortSignal.timeout(5000)});if(!m.ok)return null;return(await m.json()).version||null}catch{return null}}async function jm(){let r=await Qm();if(!r)return{hasUpdate:!1,currentVersion:H};return{hasUpdate:Jm(r,H)>0,latestVersion:r,currentVersion:H}}async function Ym(r){let m=f();m.start(`\u6B63\u5728\u66F4\u65B0\u5230 v${r}...`);try{let a=await Y(),e=Bun.spawn([p,"add","-g",`${gr}@latest`,"--registry",a],{stdout:"pipe",stderr:"pipe"});if(await e.exited,e.exitCode===0)return m.stop(`\u66F4\u65B0\u6210\u529F\uFF01\u5DF2\u66F4\u65B0\u5230 v${r}`),!0;else{let t=await new Response(e.stderr).text();return m.stop(`\u66F4\u65B0\u5931\u8D25: ${t||"\u672A\u77E5\u9519\u8BEF"}`),!1}}catch(a){return m.stop(`\u66F4\u65B0\u5931\u8D25: ${a instanceof Error?a.message:"\u672A\u77E5\u9519\u8BEF"}`),!1}}async function lr(){try{let r=await jm();if(r.hasUpdate&&r.latestVersion){if(g.warn(`\u53D1\u73B0\u65B0\u7248\u672C v${r.latestVersion}\uFF08\u5F53\u524D v${H}\uFF09`),await Ym(r.latestVersion))g.info("\u8BF7\u91CD\u65B0\u542F\u52A8 Tako CLI \u4EE5\u4F7F\u7528\u65B0\u7248\u672C"),process.exit(0)}}catch{}}function Hm(){console.log(),console.log(` \uD83D\uDC19 Tako CLI v${H}`),console.log(" \x1B[90m\u6B22\u8FCE\u4F7F\u7528\uFF01\x1B[0m"),console.log()}async function dr(r=!1){if(!r)g.warn("\u672A\u68C0\u6D4B\u5230 API Key"),console.log();let m=await rr({message:r?"\u8BF7\u8F93\u5165\u65B0\u7684 API Key (cr_xxx):":"\u8BF7\u8F93\u5165\u4F60\u7684 API Key (cr_xxx):",placeholder:"cr_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",validate(t){if(!t)return"\u8BF7\u8F93\u5165 API Key";if(!t.startsWith("cr_"))return"Key \u5FC5\u987B\u4EE5 cr_ \u5F00\u5934";if(t.length<10)return"Key \u683C\u5F0F\u4E0D\u6B63\u786E"}});if(X(m))return!1;let a=f();a.start("\u9A8C\u8BC1 Key \u4E2D...");let e=await ar(m);if(e.success)return a.stop("Key \u9A8C\u8BC1\u6210\u529F\uFF01\u5DF2\u4FDD\u5B58\u5230\u914D\u7F6E\u6587\u4EF6"),!0;else return a.stop(`\u9A8C\u8BC1\u5931\u8D25: ${e.error}`),!1}function Lm(r,m){let a=[];if(a.push(""),a.push(" \uD83D\uDCCA \u7528\u91CF\u7EDF\u8BA1"),a.push(""),a.push(` \u603B\u8C03\u7528\u6B21\u6570: ${d$(r.totalRequests)} \u6B21`),a.push(` \u603B\u6D88\u8D39: ${r.totalCost}`),a.push(` \u4ECA\u65E5\u6D88\u8D39: ${r.todayCost}`),r.modelStats.length>0)a.push(""),a.push(" \u6A21\u578B\u4F7F\u7528\u5206\u5E03 (\u4ECA\u65E5):"),r.modelStats.forEach((e,t)=>{let h=t===r.modelStats.length-1?"\u2514\u2500":"\u251C\u2500",$=e.model.length>25?e.model.slice(0,22)+"...":e.model;a.push(` ${h} ${$.padEnd(25)} ${d$(e.requests).padStart(6)} \u6B21 ${e.cost.padStart(8)}`)});return a.push(""),a.push(` \x1B[90m${m}s \u540E\u5237\u65B0 | \u6309\u4EFB\u610F\u952E\u8FD4\u56DE\x1B[0m`),a.join(`
52
- `)}async function Vm(){let m=f();m.start("\u83B7\u53D6\u7528\u91CF\u7EDF\u8BA1...");let a=await l$();if(!a.success){m.stop(`\u83B7\u53D6\u5931\u8D25: ${a.error}`);return}m.stop("");let e=10,t="",h=()=>{if(t){let b=t.split(`
53
- `).length;process.stdout.write(`\x1B[${b}A\x1B[0J`)}t=Lm(a.data,e),console.log(t)};h();let $=process.stdin.isRaw;if(process.stdin.isTTY)process.stdin.setRawMode(!0);return process.stdin.resume(),new Promise((b)=>{let i=!0,c=()=>{if(!i)return;i=!1,o(),b()},v=setInterval(async()=>{if(!i)return;if(e--,e<=0){e=10;let d=await l$();if(d.success)a=d}h()},1000),o=()=>{if(clearInterval(v),process.stdin.removeListener("data",c),process.stdin.isTTY)process.stdin.setRawMode($??!1);process.stdin.pause()};process.stdin.on("data",c)})}async function Xm(){let m=[...J$().map((e)=>({value:{type:"launch",client:e},label:`\u542F\u52A8 ${e.name}`,hint:e.package})),{value:{type:"stats"},label:"\u67E5\u770B\u7528\u91CF\u7EDF\u8BA1"},{value:{type:"config"},label:"\u914D\u7F6E API Key"},{value:{type:"exit"},label:"\u9000\u51FA"}],a=await mr({message:"\u8BF7\u9009\u62E9\u64CD\u4F5C:",options:m});if(X(a))return null;return a}async function km(r){switch(r.type){case"launch":let m=await xr(r.client);if(!m.success)g.error(m.error||"\u542F\u52A8\u5931\u8D25");return!0;case"stats":return await Vm(),!0;case"config":return await dr(!0),!0;case"exit":return!1}}async function yr(){if(Hm(),!await M$()){if(!await dr()){v$("\u518D\u89C1\uFF01");return}}while(!0){let m=await Xm();if(m===null)break;if(!await km(m))break}v$("\u518D\u89C1\uFF01")}async function Bm(){await lr(),await yr()}Bm().catch((r)=>{console.error("Tako CLI \u53D1\u751F\u9519\u8BEF:",r),process.exit(1)});
49
+ `)},info:(r)=>{d.message(r,{symbol:s.default.blue(ym)})},success:(r)=>{d.message(r,{symbol:s.default.green(pm)})},step:(r)=>{d.message(r,{symbol:s.default.green(p$)})},warn:(r)=>{d.message(r,{symbol:s.default.yellow(lm)})},warning:(r)=>{d.warn(r)},error:(r)=>{d.message(r,{symbol:s.default.red(Mm)})}},z=()=>{const r=y$?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],m=y$?80:120;let a,b,h=!1,o="";const $=(e="")=>{h=!0,a=mr(),o=e.replace(/\.+$/,""),process.stdout.write(`${s.default.gray(p)}
50
+ `);let x=0,y=0;b=setInterval(()=>{const J=s.default.magenta(r[x]),T=".".repeat(Math.floor(y)).slice(0,3);process.stdout.write(j.cursor.move(-999,0)),process.stdout.write(j.erase.down(1)),process.stdout.write(`${J} ${o}${T}`),x=x+1<r.length?x+1:0,y=y<r.length?y+0.125:0},m)},v=(e="",x=0)=>{o=e??o,h=!1,clearInterval(b);const y=x===0?s.default.green(p$):x===1?s.default.red(ar):s.default.red(br);process.stdout.write(j.cursor.move(-999,0)),process.stdout.write(j.erase.down(1)),process.stdout.write(`${y} ${o}
51
+ `),a()},t=(e="")=>{o=e??o},c=(e)=>{const x=e>1?"Something went wrong":"Canceled";h&&v(x,e)};return process.on("uncaughtExceptionMonitor",()=>c(2)),process.on("unhandledRejection",()=>c(2)),process.on("SIGINT",()=>c(1)),process.on("SIGTERM",()=>c(1)),process.on("exit",c),{start:$,stop:v,message:t}};function Wm(r){return r.startsWith("cr_")&&r.length>10}async function Gm(r){try{const a=await(await fetch(`${G}/apiStats/api/get-key-id`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:r})})).json();if(a.success&&a.data?.id)return{valid:!0,apiId:a.data.id};return{valid:!1,error:a.error||"Key \u9A8C\u8BC1\u5931\u8D25"}}catch(m){return{valid:!1,error:m instanceof Error?m.message:"\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25"}}}async function vr(r){if(!Wm(r))return{success:!1,error:"Key \u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u5FC5\u987B\u4EE5 cr_ \u5F00\u5934"};const m=await Gm(r);if(!m.valid)return{success:!1,error:m.error};return await K({apiKey:r,apiId:m.apiId}),{success:!0}}import{join as er} from"path";async function k(){if(F)return F;const r=[Zm,zm,Jm];for(let m of r)try{const a=await Promise.race([m(),new Promise((b,h)=>setTimeout(()=>h(new Error("timeout")),3000))]);if(a)return F=a,a}catch{}return F="cn","cn"}async function Zm(){try{const r=await fetch("http://ip-api.com/json/?fields=countryCode",{signal:AbortSignal.timeout(2000)});if(!r.ok)return null;return(await r.json()).countryCode==="CN"?"cn":"global"}catch{return null}}async function zm(){try{const r=await fetch("https://ipinfo.io/json",{signal:AbortSignal.timeout(2000)});if(!r.ok)return null;return(await r.json()).country==="CN"?"cn":"global"}catch{return null}}async function Jm(){try{const r=await fetch("https://api.ip.sb/geoip",{signal:AbortSignal.timeout(2000)});if(!r.ok)return null;return(await r.json()).country_code==="CN"?"cn":"global"}catch{return null}}async function Sm(){const r=await k();return M$[r]}async function H(){return(await Sm()).npm}async function cr(){if(await k()==="cn")return`curl -fsSL https://bun.sh/install | BUN_INSTALL_MIRROR="${M$.cn.bunMirror}" bash`;return"curl -fsSL https://bun.sh/install | bash"}async function xr(){const r=await k(),m=M$[r];if(r==="cn")d.info("\u68C0\u6D4B\u5230\u4E2D\u56FD\u5927\u9646\u7F51\u7EDC\uFF0C\u4F7F\u7528\u56FD\u5185\u955C\u50CF\u6E90"),d.message(` npm: ${m.npm}`);else d.info("\u4F7F\u7528\u56FD\u9645\u6E90")}var F=null,M$={cn:{npm:"https://registry.npmmirror.com",bun:"https://bun.sh/install",bunMirror:"https://registry.npmmirror.com/-/binary/bun"},global:{npm:"https://registry.npmjs.org",bun:"https://bun.sh/install",bunMirror:null}};var fm=function(r){return r.startsWith(f)};async function gr(){try{if(!await Bun.file(q).exists())return!1;const m=Bun.spawn([q,"--version"],{stdout:"pipe",stderr:"pipe"});return await m.exited,m.exitCode===0}catch{return!1}}async function Qm(){if(process.platform==="win32")return!0;try{const m=Bun.spawn(["which","unzip"],{stdout:"pipe",stderr:"pipe"});if(await m.exited,m.exitCode===0)return!0}catch{}d.warn("\u6B63\u5728\u5B89\u88C5\u7CFB\u7EDF\u4F9D\u8D56 (unzip)...");const r=["apt-get update -qq && apt-get install -y -qq unzip","yum install -y -q unzip","dnf install -y -q unzip","pacman -S --noconfirm unzip","apk add --quiet unzip"];for(let m of r)try{const a=Bun.spawn(["bash","-c",`sudo ${m} 2>/dev/null || ${m}`],{stdout:"pipe",stderr:"pipe"});if(await a.exited,a.exitCode===0)return!0}catch{}return!1}async function nm(){const r=z();if(!await Qm())return d.error("\u8BF7\u5148\u624B\u52A8\u5B89\u88C5 unzip: apt install unzip / yum install unzip"),!1;await xr(),r.start("\u6B63\u5728\u5B89\u88C5 Tako \u4E13\u5C5E Bun \u8FD0\u884C\u65F6...");try{await(await import("fs/promises")).mkdir(f,{recursive:!0});let a;if(process.platform==="win32"){const h=await k()==="cn"?'$env:BUN_INSTALL_MIRROR="https://registry.npmmirror.com/-/binary/bun"; ':"",o=`\$env:BUN_INSTALL="${f}"; ${h}irm bun.sh/install.ps1 | iex`;a=await Bun.spawn(["powershell","-Command",o],{stdout:"inherit",stderr:"inherit"}).exited}else{const b=await cr(),h=`BUN_INSTALL="${f}" ${b}`;a=await Bun.spawn(["bash","-c",h],{stdout:"inherit",stderr:"inherit"}).exited}if(a!==0)return r.stop("Bun \u5B89\u88C5\u5931\u8D25"),!1;return n=q,r.stop("Tako \u4E13\u5C5E Bun \u5B89\u88C5\u5B8C\u6210"),d.info(`\u5B89\u88C5\u4F4D\u7F6E: ${f}`),!0}catch(m){return r.stop("Bun \u5B89\u88C5\u5931\u8D25"),!1}}async function Ym(){if(await gr())return n=q,!0;return d.warn("\u672A\u68C0\u6D4B\u5230 Tako \u4E13\u5C5E Bun\uFF0C\u6B63\u5728\u81EA\u52A8\u5B89\u88C5..."),d.info("\uFF08\u4E0D\u4F1A\u5F71\u54CD\u60A8\u7CFB\u7EDF\u4E2D\u5DF2\u5B89\u88C5\u7684 Node.js \u6216 Bun\uFF09"),await nm()}async function q$(){if(n){if(!fm(n))n=q;return n}if(await gr())return n=q,q;return q}async function dr(r){try{const m=await H(),a=await fetch(`${m}/${r}/latest`);if(!a.ok)return null;return(await a.json()).version}catch{return null}}async function jm(r){return(await Q()).installedClients[r.id]?.version||null}async function ir(r){const m=X(r.id),a=er(m,"package.json");try{return await Bun.file(a).exists()}catch{return!1}}async function wr(r){const m=await jm(r);if(!m)return!0;const a=await dr(r.package);if(!a)return!1;return m!==a}async function tr(r,m=!1){const a=z(),b=X(r.id);try{if(!await Ym())return{success:!1,error:"Tako \u4E13\u5C5E Bun \u5B89\u88C5\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u7F51\u7EDC\u6216\u624B\u52A8\u5220\u9664 ~/.tako/bun \u76EE\u5F55\u540E\u91CD\u8BD5"};const h=await ir(r),o=m||await wr(r);if(h&&!o)return{success:!0};const $=h?"\u66F4\u65B0":"\u5B89\u88C5";a.start(`\u6B63\u5728${$} ${r.name}...`),await(await import("fs/promises")).mkdir(b,{recursive:!0});const t=er(b,"package.json");if(!await Bun.file(t).exists())await Bun.write(t,JSON.stringify({name:`tako-${r.id}`,private:!0,dependencies:{}},null,2));const e=await q$(),x=await H(),y=Bun.spawn([e,"add",r.package,"--registry",x],{cwd:b,stdout:"pipe",stderr:"pipe"});if(await y.exited!==0){const P=await new Response(y.stderr).text();return a.stop(`${$} ${r.name} \u5931\u8D25`),{success:!1,error:P}}const T=await dr(r.package);if(T){const P=await Q();P.installedClients[r.id]={version:T,installedAt:(new Date()).toISOString()},await K(P)}return a.stop(`${r.name} ${$}\u5B8C\u6210`),{success:!0}}catch(h){return a.stop("\u64CD\u4F5C\u5931\u8D25"),{success:!1,error:h instanceof Error?h.message:"\u672A\u77E5\u9519\u8BEF"}}}async function yr(r){if(!await ir(r))return await tr(r);if(await wr(r))return await tr(r,!0);return{success:!0}}var n=null;async function E(r){try{const m=await yr(r);if(!m.success)return m;const a=await n$();if(!a)return{success:!1,error:"\u672A\u914D\u7F6E API Key"};if(r.setupConfigFiles)await r.setupConfigFiles(a);let b=await j$(r);if(!b)b=H$(r);if(!await Bun.file(b).exists())return{success:!1,error:`\u627E\u4E0D\u5230\u53EF\u6267\u884C\u6587\u4EF6: ${b}`};const o=r.getEnvVars(a),$={...process.env,...o};d.info(`\u542F\u52A8 ${r.name}...`);let v;if(r.runtime==="native")v=[b];else v=[await q$(),b];return await Bun.spawn(v,{env:$,stdio:["inherit","inherit","inherit"],cwd:process.cwd()}).exited,{success:!0}}catch(m){return{success:!1,error:m instanceof Error?m.message:"\u542F\u52A8\u5931\u8D25"}}}async function W$(){try{const r=await Y$();if(!r)return{success:!1,error:"\u672A\u627E\u5230 API ID\uFF0C\u8BF7\u91CD\u65B0\u914D\u7F6E Key"};const a=await(await fetch(`${G}/apiStats/api/user-stats`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiId:r})})).json(),h=await(await fetch(`${G}/apiStats/api/user-model-stats`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiId:r,period:"daily"})})).json();if(!a.success)return{success:!1,error:a.error||a.message||"\u83B7\u53D6\u7EDF\u8BA1\u5931\u8D25"};const o=(h.data||[]).map(($)=>({model:$.model,requests:$.requests,cost:$.formatted?.total||"$0.00"}));return{success:!0,data:{totalRequests:a.data?.usage?.total?.requests||0,totalCost:a.data?.usage?.total?.formattedCost||"$0.00",todayCost:`\$${(a.data?.limits?.currentDailyCost||0).toFixed(2)}`,modelStats:o}}}catch(r){return{success:!1,error:r instanceof Error?r.message:"\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25"}}}function G$(r){return r.toLocaleString("en-US")}var Hm=function(r,m){const a=r.split(".").map(Number),b=m.split(".").map(Number);for(let h=0;h<3;h++){const o=a[h]||0,$=b[h]||0;if(o>$)return 1;if(o<$)return-1}return 0};async function Lm(){try{const r=await H(),m=await fetch(`${r}/${pr}/latest`,{signal:AbortSignal.timeout(5000)});if(!m.ok)return null;return(await m.json()).version||null}catch{return null}}async function Xm(){const r=await Lm();if(!r)return{hasUpdate:!1,currentVersion:L};return{hasUpdate:Hm(r,L)>0,latestVersion:r,currentVersion:L}}async function Vm(r){const m=z();m.start(`\u6B63\u5728\u66F4\u65B0\u5230 v${r}...`);try{const a=await H();await(await import("fs/promises")).mkdir(r$,{recursive:!0});const h=Bun.spawn([q,"add",`${pr}@latest`,"--registry",a],{cwd:r$,stdout:"pipe",stderr:"pipe"});if(await h.exited,h.exitCode===0)return m.stop(`\u66F4\u65B0\u6210\u529F\uFF01\u5DF2\u66F4\u65B0\u5230 v${r}`),!0;else{const o=await new Response(h.stderr).text();return m.stop(`\u66F4\u65B0\u5931\u8D25: ${o||"\u672A\u77E5\u9519\u8BEF"}`),!1}}catch(a){return m.stop(`\u66F4\u65B0\u5931\u8D25: ${a instanceof Error?a.message:"\u672A\u77E5\u9519\u8BEF"}`),!1}}async function D(){try{const r=await Xm();if(r.hasUpdate&&r.latestVersion){if(d.warn(`\u53D1\u73B0\u65B0\u7248\u672C v${r.latestVersion}\uFF08\u5F53\u524D v${L}\uFF09`),await Vm(r.latestVersion))d.info("\u8BF7\u91CD\u65B0\u542F\u52A8 Tako CLI \u4EE5\u4F7F\u7528\u65B0\u7248\u672C"),process.exit(0)}}catch{}}var pr="tako-cli",L="0.1.27";var Bm=function(){console.log(),console.log(` \uD83D\uDC19 Tako CLI v${L}`),console.log(" \x1B[90m\u6B22\u8FCE\u4F7F\u7528\uFF01\x1B[0m"),console.log()};async function lr(r=!1){if(!r)d.warn("\u672A\u68C0\u6D4B\u5230 API Key"),console.log();const m=await or({message:r?"\u8BF7\u8F93\u5165\u65B0\u7684 API Key (cr_xxx):":"\u8BF7\u8F93\u5165\u4F60\u7684 API Key (cr_xxx):",placeholder:"cr_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",validate(h){if(!h)return"\u8BF7\u8F93\u5165 API Key";if(!h.startsWith("cr_"))return"Key \u5FC5\u987B\u4EE5 cr_ \u5F00\u5934";if(h.length<10)return"Key \u683C\u5F0F\u4E0D\u6B63\u786E"}});if(B(m))return!1;const a=z();a.start("\u9A8C\u8BC1 Key \u4E2D...");const b=await vr(m);if(b.success)return a.stop("Key \u9A8C\u8BC1\u6210\u529F\uFF01\u5DF2\u4FDD\u5B58\u5230\u914D\u7F6E\u6587\u4EF6"),!0;else return a.stop(`\u9A8C\u8BC1\u5931\u8D25: ${b.error}`),!1}var km=function(r,m){const a=[];if(a.push(""),a.push(" \uD83D\uDCCA \u7528\u91CF\u7EDF\u8BA1"),a.push(""),a.push(` \u603B\u8C03\u7528\u6B21\u6570: ${G$(r.totalRequests)} \u6B21`),a.push(` \u603B\u6D88\u8D39: ${r.totalCost}`),a.push(` \u4ECA\u65E5\u6D88\u8D39: ${r.todayCost}`),r.modelStats.length>0)a.push(""),a.push(" \u6A21\u578B\u4F7F\u7528\u5206\u5E03 (\u4ECA\u65E5):"),r.modelStats.forEach((b,h)=>{const o=h===r.modelStats.length-1?"\u2514\u2500":"\u251C\u2500",$=b.model.length>25?b.model.slice(0,22)+"...":b.model;a.push(` ${o} ${$.padEnd(25)} ${G$(b.requests).padStart(6)} \u6B21 ${b.cost.padStart(8)}`)});return a.push(""),a.push(` \x1B[90m${m}s \u540E\u5237\u65B0 | \u6309\u4EFB\u610F\u952E\u8FD4\u56DE\x1B[0m`),a.join("\n")};async function Em(){const m=z();m.start("\u83B7\u53D6\u7528\u91CF\u7EDF\u8BA1...");let a=await W$();if(!a.success){m.stop(`\u83B7\u53D6\u5931\u8D25: ${a.error}`);return}m.stop("");let b=10,h="";const o=()=>{if(h){const v=h.split("\n").length;process.stdout.write(`\x1B[${v}A\x1B[0J`)}h=km(a.data,b),console.log(h)};o();const $=process.stdin.isRaw;if(process.stdin.isTTY)process.stdin.setRawMode(!0);return process.stdin.resume(),new Promise((v)=>{let t=!0;const c=()=>{if(!t)return;t=!1,x(),v()},e=setInterval(async()=>{if(!t)return;if(b--,b<=0){b=10;const y=await W$();if(y.success)a=y}o()},1000),x=()=>{if(clearInterval(e),process.stdin.removeListener("data",c),process.stdin.isTTY)process.stdin.setRawMode($??!1);process.stdin.pause()};process.stdin.on("data",c)})}async function Tm(){const m=[...L$().map((b)=>({value:{type:"launch",client:b},label:`\u542F\u52A8 ${b.name}`,hint:b.package})),{value:{type:"stats"},label:"\u67E5\u770B\u7528\u91CF\u7EDF\u8BA1"},{value:{type:"config"},label:"\u914D\u7F6E API Key"},{value:{type:"exit"},label:"\u9000\u51FA"}],a=await sr({message:"\u8BF7\u9009\u62E9\u64CD\u4F5C:",options:m});if(B(a))return null;return a}async function Pm(r){switch(r.type){case"launch":const m=await E(r.client);if(!m.success)d.error(m.error||"\u542F\u52A8\u5931\u8D25");return!0;case"stats":return await Em(),!0;case"config":return await lr(!0),!0;case"exit":return!1}}async function Mr(){if(Bm(),!await Q$()){if(!await lr()){l$("\u518D\u89C1\uFF01");return}}while(!0){const m=await Tm();if(m===null)break;if(!await Pm(m))break}l$("\u518D\u89C1\uFF01")}var Um=function(){console.log(`
52
+ Tako CLI v${qr}
53
+
54
+ \u7528\u6CD5: tako [\u9009\u9879] [\u547D\u4EE4]
55
+
56
+ \u9009\u9879:
57
+ -v, --version \u663E\u793A\u7248\u672C\u53F7
58
+ -h, --help \u663E\u793A\u5E2E\u52A9\u4FE1\u606F
59
+
60
+ \u5FEB\u6377\u547D\u4EE4:
61
+ --claude \u76F4\u63A5\u542F\u52A8 Claude Code
62
+ --codex \u76F4\u63A5\u542F\u52A8 Codex
63
+
64
+ \u793A\u4F8B:
65
+ tako \u4EA4\u4E92\u5F0F\u9009\u62E9\u5DE5\u5177
66
+ tako --claude \u76F4\u63A5\u542F\u52A8 Claude Code
67
+ tako --codex \u76F4\u63A5\u542F\u52A8 Codex
68
+ `)};async function Km(){const r=process.argv.slice(2);if(r.includes("-v")||r.includes("--version")){console.log(`Tako CLI v${qr}`);return}if(r.includes("-h")||r.includes("--help")){Um();return}if(r.includes("--claude")){const m=b$("claude-code");if(!m)console.error("Claude Code \u5BA2\u6237\u7AEF\u672A\u627E\u5230"),process.exit(1);await D();const a=await E(m);if(!a.success)console.error(a.error),process.exit(1);return}if(r.includes("--codex")){const m=b$("codex");if(!m)console.error("Codex \u5BA2\u6237\u7AEF\u672A\u627E\u5230"),process.exit(1);await D();const a=await E(m);if(!a.success)console.error(a.error),process.exit(1);return}await D(),await Mr()}var qr="0.1.27";Km().catch((r)=>{console.error("Tako CLI \u53D1\u751F\u9519\u8BEF:",r),process.exit(1)});
package/install.sh CHANGED
@@ -3,10 +3,12 @@ set -e
3
3
 
4
4
  # Tako CLI 一键安装脚本
5
5
  # 用法: curl -fsSL https://cdn.jsdelivr.net/npm/tako-cli/install.sh | bash
6
+ # 本地测试: bash install.sh --local /path/to/tako-cli.tgz
6
7
 
7
8
  TAKO_DIR="$HOME/.tako"
8
9
  TAKO_BUN_DIR="$TAKO_DIR/bun"
9
10
  INSTALL_DIR="/usr/local/bin"
11
+ LOCAL_TARBALL=""
10
12
 
11
13
  # 颜色
12
14
  RED='\033[0;31m'
@@ -141,9 +143,18 @@ install_tako() {
141
143
  echo '{"name":"tako-local","private":true}' > package.json
142
144
  fi
143
145
 
144
- # 安装 tako-cli 到本地目录
145
- if ! "$bun" add tako-cli --registry "$registry"; then
146
- error "Tako CLI 安装失败"
146
+ # 安装 tako-cli
147
+ if [ -n "$LOCAL_TARBALL" ]; then
148
+ # 本地测试模式:从 tgz 文件安装
149
+ info "从本地文件安装: $LOCAL_TARBALL"
150
+ if ! "$bun" add "$LOCAL_TARBALL"; then
151
+ error "Tako CLI 安装失败"
152
+ fi
153
+ else
154
+ # 正常模式:从 npm 安装
155
+ if ! "$bun" add tako-cli --registry "$registry"; then
156
+ error "Tako CLI 安装失败"
157
+ fi
147
158
  fi
148
159
 
149
160
  # 设置 tako 可执行文件路径
@@ -297,8 +308,25 @@ verify_installation() {
297
308
  fi
298
309
  }
299
310
 
311
+ # 解析命令行参数
312
+ parse_args() {
313
+ while [[ $# -gt 0 ]]; do
314
+ case $1 in
315
+ --local)
316
+ LOCAL_TARBALL="$2"
317
+ shift 2
318
+ ;;
319
+ *)
320
+ shift
321
+ ;;
322
+ esac
323
+ done
324
+ }
325
+
300
326
  # 主流程
301
327
  main() {
328
+ parse_args "$@"
329
+
302
330
  echo ""
303
331
  echo " ╔════════════════════════════════════╗"
304
332
  echo " ║ Tako CLI 安装程序 ║"
@@ -315,4 +343,4 @@ main() {
315
343
  echo ""
316
344
  }
317
345
 
318
- main
346
+ main "$@"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tako-cli",
3
- "version": "0.1.22",
3
+ "version": "0.1.27",
4
4
  "description": "Tako CLI - AI coding tools launcher",
5
5
  "type": "module",
6
6
  "bin": {
@@ -14,7 +14,15 @@
14
14
  "scripts": {
15
15
  "build": "bun run scripts/build.ts",
16
16
  "bump": "bun scripts/bump.ts",
17
- "release": "bun scripts/bump.ts patch && npm publish && bun scripts/sync-gitee.ts",
17
+ "test": "bun test",
18
+ "test:unit": "bun test tests/unit.*.test.ts",
19
+ "test:integration": "bun test tests/integration.*.test.ts",
20
+ "test:platform": "bun test tests/platform.*.test.ts",
21
+ "test:pre-release": "bun test tests/pre-release.test.ts",
22
+ "test:e2e": "bash scripts/test-install.sh",
23
+ "test:watch": "bun test --watch",
24
+ "test:coverage": "bun test --coverage",
25
+ "release": "bun run test:pre-release && bun scripts/bump.ts patch && npm publish --registry https://registry.npmjs.org && bun scripts/sync-gitee.ts",
18
26
  "prepublishOnly": "bun run build"
19
27
  },
20
28
  "devDependencies": {