mmx-cli 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/mmx.mjs +93 -95
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<img src="https://
|
|
2
|
+
<img src="https://filecdn.minimax.chat/public/6335add6-5bff-42c8-89bf-0a505aa61c5a.png" alt="MiniMax" width="320" />
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
5
|
<p align="center">
|
package/dist/mmx.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{createRequire as $i}from"node:module";var si=Object.create;var{getPrototypeOf:pi,defineProperty:It,getOwnPropertyNames:mi}=Object;var ai=Object.prototype.hasOwnProperty;var Y=(t,e,i)=>{i=t!=null?si(pi(t)):{};let r=e||!t||!t.__esModule?It(i,"default",{value:t,enumerable:!0}):i;for(let o of mi(t))if(!ai.call(r,o))It(r,o,{get:()=>t[o],enumerable:!0});return r};var ce=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var ui=(t,e)=>{for(var i in e)It(t,i,{get:e[i],enumerable:!0,configurable:!0,set:(r)=>e[i]=()=>r})};var ye=(t,e)=>()=>(t&&(e=t(t=0)),e);var it=$i(import.meta.url);var Ht=ce((Is,Qe)=>{var Wt={to(t,e){if(!e)return`\x1B[${t+1}G`;return`\x1B[${e+1};${t+1}H`},move(t,e){let i="";if(t<0)i+=`\x1B[${-t}D`;else if(t>0)i+=`\x1B[${t}C`;if(e<0)i+=`\x1B[${-e}A`;else if(e>0)i+=`\x1B[${e}B`;return i},up:(t=1)=>`\x1B[${t}A`,down:(t=1)=>`\x1B[${t}B`,forward:(t=1)=>`\x1B[${t}C`,backward:(t=1)=>`\x1B[${t}D`,nextLine:(t=1)=>"\x1B[E".repeat(t),prevLine:(t=1)=>"\x1B[F".repeat(t),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},Xi={up:(t=1)=>"\x1B[S".repeat(t),down:(t=1)=>"\x1B[T".repeat(t)},Qi={screen:"\x1B[2J",up:(t=1)=>"\x1B[1J".repeat(t),down:(t=1)=>"\x1B[J".repeat(t),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(t){let e="";for(let i=0;i<t;i++)e+=this.line+(i<t-1?Wt.up():"");if(t)e+=Wt.left;return e}};Qe.exports={cursor:Wt,scroll:Xi,erase:Qi,beep:"\x07"}});var Ct=ce((zs,Ut)=>{var kt=process||{},Ve=kt.argv||[],Rt=kt.env||{},Vi=!(!!Rt.NO_COLOR||Ve.includes("--no-color"))&&(!!Rt.FORCE_COLOR||Ve.includes("--color")||kt.platform==="win32"||(kt.stdout||{}).isTTY&&Rt.TERM!=="dumb"||!!Rt.CI),Zi=(t,e,i=t)=>(r)=>{let o=""+r,s=o.indexOf(e,t.length);return~s?t+Wi(o,e,i,s)+e:t+o+e},Wi=(t,e,i,r)=>{let o="",s=0;do o+=t.substring(s,r)+i,s=r+e.length,r=t.indexOf(e,s);while(~r);return o+t.substring(s)},Ze=(t=Vi)=>{let e=t?Zi:()=>String;return{isColorSupported:t,reset:e("\x1B[0m","\x1B[0m"),bold:e("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:e("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:e("\x1B[3m","\x1B[23m"),underline:e("\x1B[4m","\x1B[24m"),inverse:e("\x1B[7m","\x1B[27m"),hidden:e("\x1B[8m","\x1B[28m"),strikethrough:e("\x1B[9m","\x1B[29m"),black:e("\x1B[30m","\x1B[39m"),red:e("\x1B[31m","\x1B[39m"),green:e("\x1B[32m","\x1B[39m"),yellow:e("\x1B[33m","\x1B[39m"),blue:e("\x1B[34m","\x1B[39m"),magenta:e("\x1B[35m","\x1B[39m"),cyan:e("\x1B[36m","\x1B[39m"),white:e("\x1B[37m","\x1B[39m"),gray:e("\x1B[90m","\x1B[39m"),bgBlack:e("\x1B[40m","\x1B[49m"),bgRed:e("\x1B[41m","\x1B[49m"),bgGreen:e("\x1B[42m","\x1B[49m"),bgYellow:e("\x1B[43m","\x1B[49m"),bgBlue:e("\x1B[44m","\x1B[49m"),bgMagenta:e("\x1B[45m","\x1B[49m"),bgCyan:e("\x1B[46m","\x1B[49m"),bgWhite:e("\x1B[47m","\x1B[49m"),blackBright:e("\x1B[90m","\x1B[39m"),redBright:e("\x1B[91m","\x1B[39m"),greenBright:e("\x1B[92m","\x1B[39m"),yellowBright:e("\x1B[93m","\x1B[39m"),blueBright:e("\x1B[94m","\x1B[39m"),magentaBright:e("\x1B[95m","\x1B[39m"),cyanBright:e("\x1B[96m","\x1B[39m"),whiteBright:e("\x1B[97m","\x1B[39m"),bgBlackBright:e("\x1B[100m","\x1B[49m"),bgRedBright:e("\x1B[101m","\x1B[49m"),bgGreenBright:e("\x1B[102m","\x1B[49m"),bgYellowBright:e("\x1B[103m","\x1B[49m"),bgBlueBright:e("\x1B[104m","\x1B[49m"),bgMagentaBright:e("\x1B[105m","\x1B[49m"),bgCyanBright:e("\x1B[106m","\x1B[49m"),bgWhiteBright:e("\x1B[107m","\x1B[49m")}};Ut.exports=Ze();Ut.exports.createColors=Ze});import{stdin as on,stdout as sn}from"node:process";import*as H from"node:readline";import We from"node:readline";import{WriteStream as Hi}from"node:tty";function Ui({onlyFirst:t=!1}={}){let e=["[\\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(e,t?void 0:"g")}function pn(t){if(typeof t!="string")throw TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(Ci,"")}function mn(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function ut(t,e={}){if(typeof t!="string"||t.length===0||(e={ambiguousIsNarrow:!0,...e},t=pn(t),t.length===0))return 0;t=t.replace(Fi()," ");let i=e.ambiguousIsNarrow?1:2,r=0;for(let o of t){let s=o.codePointAt(0);if(s<=31||s>=127&&s<=159||s>=768&&s<=879)continue;switch(
|
|
2
|
+
import{createRequire as $i}from"node:module";var si=Object.create;var{getPrototypeOf:pi,defineProperty:It,getOwnPropertyNames:mi}=Object;var ai=Object.prototype.hasOwnProperty;var Y=(t,e,i)=>{i=t!=null?si(pi(t)):{};let r=e||!t||!t.__esModule?It(i,"default",{value:t,enumerable:!0}):i;for(let o of mi(t))if(!ai.call(r,o))It(r,o,{get:()=>t[o],enumerable:!0});return r};var ce=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var ui=(t,e)=>{for(var i in e)It(t,i,{get:e[i],enumerable:!0,configurable:!0,set:(r)=>e[i]=()=>r})};var ye=(t,e)=>()=>(t&&(e=t(t=0)),e);var it=$i(import.meta.url);var Ht=ce((Is,Qe)=>{var Wt={to(t,e){if(!e)return`\x1B[${t+1}G`;return`\x1B[${e+1};${t+1}H`},move(t,e){let i="";if(t<0)i+=`\x1B[${-t}D`;else if(t>0)i+=`\x1B[${t}C`;if(e<0)i+=`\x1B[${-e}A`;else if(e>0)i+=`\x1B[${e}B`;return i},up:(t=1)=>`\x1B[${t}A`,down:(t=1)=>`\x1B[${t}B`,forward:(t=1)=>`\x1B[${t}C`,backward:(t=1)=>`\x1B[${t}D`,nextLine:(t=1)=>"\x1B[E".repeat(t),prevLine:(t=1)=>"\x1B[F".repeat(t),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},Xi={up:(t=1)=>"\x1B[S".repeat(t),down:(t=1)=>"\x1B[T".repeat(t)},Qi={screen:"\x1B[2J",up:(t=1)=>"\x1B[1J".repeat(t),down:(t=1)=>"\x1B[J".repeat(t),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(t){let e="";for(let i=0;i<t;i++)e+=this.line+(i<t-1?Wt.up():"");if(t)e+=Wt.left;return e}};Qe.exports={cursor:Wt,scroll:Xi,erase:Qi,beep:"\x07"}});var Ct=ce((zs,Ut)=>{var kt=process||{},Ve=kt.argv||[],Rt=kt.env||{},Vi=!(!!Rt.NO_COLOR||Ve.includes("--no-color"))&&(!!Rt.FORCE_COLOR||Ve.includes("--color")||kt.platform==="win32"||(kt.stdout||{}).isTTY&&Rt.TERM!=="dumb"||!!Rt.CI),Zi=(t,e,i=t)=>(r)=>{let o=""+r,s=o.indexOf(e,t.length);return~s?t+Wi(o,e,i,s)+e:t+o+e},Wi=(t,e,i,r)=>{let o="",s=0;do o+=t.substring(s,r)+i,s=r+e.length,r=t.indexOf(e,s);while(~r);return o+t.substring(s)},Ze=(t=Vi)=>{let e=t?Zi:()=>String;return{isColorSupported:t,reset:e("\x1B[0m","\x1B[0m"),bold:e("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:e("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:e("\x1B[3m","\x1B[23m"),underline:e("\x1B[4m","\x1B[24m"),inverse:e("\x1B[7m","\x1B[27m"),hidden:e("\x1B[8m","\x1B[28m"),strikethrough:e("\x1B[9m","\x1B[29m"),black:e("\x1B[30m","\x1B[39m"),red:e("\x1B[31m","\x1B[39m"),green:e("\x1B[32m","\x1B[39m"),yellow:e("\x1B[33m","\x1B[39m"),blue:e("\x1B[34m","\x1B[39m"),magenta:e("\x1B[35m","\x1B[39m"),cyan:e("\x1B[36m","\x1B[39m"),white:e("\x1B[37m","\x1B[39m"),gray:e("\x1B[90m","\x1B[39m"),bgBlack:e("\x1B[40m","\x1B[49m"),bgRed:e("\x1B[41m","\x1B[49m"),bgGreen:e("\x1B[42m","\x1B[49m"),bgYellow:e("\x1B[43m","\x1B[49m"),bgBlue:e("\x1B[44m","\x1B[49m"),bgMagenta:e("\x1B[45m","\x1B[49m"),bgCyan:e("\x1B[46m","\x1B[49m"),bgWhite:e("\x1B[47m","\x1B[49m"),blackBright:e("\x1B[90m","\x1B[39m"),redBright:e("\x1B[91m","\x1B[39m"),greenBright:e("\x1B[92m","\x1B[39m"),yellowBright:e("\x1B[93m","\x1B[39m"),blueBright:e("\x1B[94m","\x1B[39m"),magentaBright:e("\x1B[95m","\x1B[39m"),cyanBright:e("\x1B[96m","\x1B[39m"),whiteBright:e("\x1B[97m","\x1B[39m"),bgBlackBright:e("\x1B[100m","\x1B[49m"),bgRedBright:e("\x1B[101m","\x1B[49m"),bgGreenBright:e("\x1B[102m","\x1B[49m"),bgYellowBright:e("\x1B[103m","\x1B[49m"),bgBlueBright:e("\x1B[104m","\x1B[49m"),bgMagentaBright:e("\x1B[105m","\x1B[49m"),bgCyanBright:e("\x1B[106m","\x1B[49m"),bgWhiteBright:e("\x1B[107m","\x1B[49m")}};Ut.exports=Ze();Ut.exports.createColors=Ze});import{stdin as on,stdout as sn}from"node:process";import*as H from"node:readline";import We from"node:readline";import{WriteStream as Hi}from"node:tty";function Ui({onlyFirst:t=!1}={}){let e=["[\\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(e,t?void 0:"g")}function pn(t){if(typeof t!="string")throw TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(Ci,"")}function mn(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function ut(t,e={}){if(typeof t!="string"||t.length===0||(e={ambiguousIsNarrow:!0,...e},t=pn(t),t.length===0))return 0;t=t.replace(Fi()," ");let i=e.ambiguousIsNarrow?1:2,r=0;for(let o of t){let s=o.codePointAt(0);if(s<=31||s>=127&&s<=159||s>=768&&s<=879)continue;switch(Ei.eastAsianWidth(o)){case"F":case"W":r+=2;break;case"A":r+=i;break;default:r+=1}}return r}function er(){let t=new Map;for(let[e,i]of Object.entries(S)){for(let[r,o]of Object.entries(i))S[r]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},i[r]=S[r],t.set(o[0],o[1]);Object.defineProperty(S,e,{value:i,enumerable:!1})}return Object.defineProperty(S,"codes",{value:t,enumerable:!1}),S.color.close="\x1B[39m",S.bgColor.close="\x1B[49m",S.color.ansi=He(),S.color.ansi256=Ue(),S.color.ansi16m=Ce(),S.bgColor.ansi=He(Pt),S.bgColor.ansi256=Ue(Pt),S.bgColor.ansi16m=Ce(Pt),Object.defineProperties(S,{rgbToAnsi256:{value:(e,i,r)=>e===i&&i===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(i/255*5)+Math.round(r/255*5),enumerable:!1},hexToRgb:{value:(e)=>{let i=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!i)return[0,0,0];let[r]=i;r.length===3&&(r=[...r].map((s)=>s+s).join(""));let o=Number.parseInt(r,16);return[o>>16&255,o>>8&255,o&255]},enumerable:!1},hexToAnsi256:{value:(e)=>S.rgbToAnsi256(...S.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value:(e)=>{if(e<8)return 30+e;if(e<16)return 90+(e-8);let i,r,o;if(e>=232)i=((e-232)*10+8)/255,r=i,o=i;else{e-=16;let m=e%36;i=Math.floor(e/36)/5,r=Math.floor(m/6)/5,o=m%6/5}let s=Math.max(i,r,o)*2;if(s===0)return 30;let n=30+(Math.round(o)<<2|Math.round(r)<<1|Math.round(i));return s===2&&(n+=60),n},enumerable:!1},rgbToAnsi:{value:(e,i,r)=>S.ansi256ToAnsi(S.rgbToAnsi256(e,i,r)),enumerable:!1},hexToAnsi:{value:(e)=>S.ansi256ToAnsi(S.hexToAnsi256(e)),enumerable:!1}}),S}function Le(t,e,i){return String(t).normalize().replace(/\r\n/g,`
|
|
3
3
|
`).split(`
|
|
4
4
|
`).map((r)=>pr(r,e,i)).join(`
|
|
5
5
|
`)}function ur(t,e){if(t===e)return;let i=t.split(`
|
|
@@ -9,10 +9,10 @@ import{createRequire as $i}from"node:module";var si=Object.create;var{getPrototy
|
|
|
9
9
|
`).length-1;this.output.write(j.cursor.move(-999,t*-1))}render(){let t=Le(this._render(this)??"",process.stdout.columns,{hard:!0});if(t!==this._prevFrame){if(this.state==="initial")this.output.write(j.cursor.hide);else{let e=ur(this._prevFrame,t);if(this.restoreCursor(),e&&e?.length===1){let i=e[0];this.output.write(j.cursor.move(0,i)),this.output.write(j.erase.lines(1));let r=t.split(`
|
|
10
10
|
`);this.output.write(r[i]),this._prevFrame=t,this.output.write(j.cursor.move(0,r.length-i-1));return}else if(e&&e?.length>1){let i=e[0];this.output.write(j.cursor.move(0,i)),this.output.write(j.erase.down());let r=t.split(`
|
|
11
11
|
`).slice(i);this.output.write(r.join(`
|
|
12
|
-
`)),this._prevFrame=t;return}this.output.write(j.erase.down())}this.output.write(t),this.state==="initial"&&(this.state="active"),this._prevFrame=t}}}function xn({input:t=on,output:e=sn,overwrite:i=!0,hideCursor:r=!0}={}){let o=H.createInterface({input:t,output:e,prompt:"",tabSize:1});H.emitKeypressEvents(t,o),t.isTTY&&t.setRawMode(!0);let s=(n,{name:m})=>{if(String(n)==="\x03"){r&&e.write(j.cursor.show),process.exit(0);return}if(!i)return;H.moveCursor(e,m==="return"?0:-1,m==="return"?-1:0,()=>{H.clearLine(e,1,()=>{t.once("keypress",s)})})};return r&&e.write(j.cursor.hide),t.once("keypress",s),()=>{t.off("keypress",s),r&&e.write(j.cursor.show),t.isTTY&&!kr&&t.setRawMode(!1),o.terminal=!1,o.close()}}var j,L,Ci,an,Ei,Pi,Li=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},Fi,Et=10,He=(t=0)=>(e)=>`\x1B[${e+t}m`,Ue=(t=0)=>(e)=>`\x1B[${38+t};5;${e}m`,Ce=(t=0)=>(e,i,r)=>`\x1B[${38+t};2;${e};${i};${r}m`,S,Di,tr,nr,At,ir=39,Lt="\x07",un="[",rr="]",$n="m",Ft,Ee=(t)=>`${At.values().next().value}${un}${t}${$n}`,Pe=(t)=>`${At.values().next().value}${Ft}${t}${Lt}`,or=(t)=>t.split(" ").map((e)=>ut(e)),Pt=(t,e,i)=>{let r=[...e],o=!1,s=!1,n=ut(pn(t[t.length-1]));for(let[m,a]of r.entries()){let u=ut(a);if(n+u<=i?t[t.length-1]+=a:(t.push(a),n=0),At.has(a)&&(o=!0,s=r.slice(m+1).join("").startsWith(Ft)),o){s?a===Lt&&(o=!1,s=!1):a===$n&&(o=!1);continue}n+=u,n===i&&m<r.length-1&&(t.push(""),n=0)}!n&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},sr=(t)=>{let e=t.split(" "),i=e.length;for(;i>0&&!(ut(e[i-1])>0);)i--;return i===e.length?t:e.slice(0,i).join(" ")+e.slice(i).join("")},pr=(t,e,i={})=>{if(i.trim!==!1&&t.trim()==="")return"";let r="",o,s,n=or(t),m=[""];for(let[u,y]of t.split(" ").entries()){i.trim!==!1&&(m[m.length-1]=m[m.length-1].trimStart());let $=ut(m[m.length-1]);if(u!==0&&($>=e&&(i.wordWrap===!1||i.trim===!1)&&(m.push(""),$=0),($>0||i.trim===!1)&&(m[m.length-1]+=" ",$++)),i.hard&&n[u]>e){let h=e-$,b=1+Math.floor((n[u]-h-1)/e);Math.floor((n[u]-1)/e)<b&&m.push(""),Pt(m,y,e);continue}if($+n[u]>e&&$>0&&n[u]>0){if(i.wordWrap===!1&&$<e){Pt(m,y,e);continue}m.push("")}if($+n[u]>e&&i.wordWrap===!1){Pt(m,y,e);continue}m[m.length-1]+=y}i.trim!==!1&&(m=m.map((u)=>sr(u)));let a=[...m.join(`
|
|
13
|
-
`)];for(let[u,y]of a.entries()){if(r+=y,At.has(y)){let{groups:h}=new RegExp(`(?:\\${un}(?<code>\\d+)m|\\${Ft}(?<uri>.*)${Lt})`).exec(a.slice(u).join(""))||{groups:{}};if(h.code!==void 0){let
|
|
14
|
-
`?(s&&(r+=
|
|
15
|
-
`&&(o&&$&&(r+=Ee(o)),s&&(r+=Pe(s)))}return r},mr,ar=(t,e,i)=>(e in t)?mr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,N=(t,e,i)=>(ar(t,typeof e!="symbol"?e+"":e,i),i),ln,Fe,$r,Dt,lr,cr=(t,e,i)=>(e in t)?lr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,De=(t,e,i)=>(cr(t,typeof e!="symbol"?e+"":e,i),i),te,yr,xr=(t,e,i)=>(e in t)?yr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,tn=(t,e,i)=>(xr(t,typeof e!="symbol"?e+"":e,i),i),cn,hr,br=(t,e,i)=>(e in t)?hr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,en=(t,e,i)=>(br(t,typeof e!="symbol"?e+"":e,i),i),ee,wr,dr=(t,e,i)=>(e in t)?wr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,nn=(t,e,i)=>(dr(t,typeof e!="symbol"?e+"":e,i),i),yn,_r,vr=(t,e,i)=>(e in t)?_r(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,rn=(t,e,i)=>(vr(t,typeof e!="symbol"?e+"":e,i),i),ne,fr,Sr=(t,e,i)=>(e in t)?fr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Rr=(t,e,i)=>(Sr(t,typeof e!="symbol"?e+"":e,i),i),ie,kr;var re=ye(()=>{j=Y(Ht(),1),L=Y(Ct(),1);Ci=Ui();an={exports:{}};(function(t){var e={};t.exports=e,e.eastAsianWidth=function(r){var o=r.charCodeAt(0),s=r.length==2?r.charCodeAt(1):0,n=o;return 55296<=o&&o<=56319&&56320<=s&&s<=57343&&(o&=1023,s&=1023,n=o<<10|s,n+=65536),n==12288||65281<=n&&n<=65376||65504<=n&&n<=65510?"F":n==8361||65377<=n&&n<=65470||65474<=n&&n<=65479||65482<=n&&n<=65487||65490<=n&&n<=65495||65498<=n&&n<=65500||65512<=n&&n<=65518?"H":4352<=n&&n<=4447||4515<=n&&n<=4519||4602<=n&&n<=4607||9001<=n&&n<=9002||11904<=n&&n<=11929||11931<=n&&n<=12019||12032<=n&&n<=12245||12272<=n&&n<=12283||12289<=n&&n<=12350||12353<=n&&n<=12438||12441<=n&&n<=12543||12549<=n&&n<=12589||12593<=n&&n<=12686||12688<=n&&n<=12730||12736<=n&&n<=12771||12784<=n&&n<=12830||12832<=n&&n<=12871||12880<=n&&n<=13054||13056<=n&&n<=19903||19968<=n&&n<=42124||42128<=n&&n<=42182||43360<=n&&n<=43388||44032<=n&&n<=55203||55216<=n&&n<=55238||55243<=n&&n<=55291||63744<=n&&n<=64255||65040<=n&&n<=65049||65072<=n&&n<=65106||65108<=n&&n<=65126||65128<=n&&n<=65131||110592<=n&&n<=110593||127488<=n&&n<=127490||127504<=n&&n<=127546||127552<=n&&n<=127560||127568<=n&&n<=127569||131072<=n&&n<=194367||177984<=n&&n<=196605||196608<=n&&n<=262141?"W":32<=n&&n<=126||162<=n&&n<=163||165<=n&&n<=166||n==172||n==175||10214<=n&&n<=10221||10629<=n&&n<=10630?"Na":n==161||n==164||167<=n&&n<=168||n==170||173<=n&&n<=174||176<=n&&n<=180||182<=n&&n<=186||188<=n&&n<=191||n==198||n==208||215<=n&&n<=216||222<=n&&n<=225||n==230||232<=n&&n<=234||236<=n&&n<=237||n==240||242<=n&&n<=243||247<=n&&n<=250||n==252||n==254||n==257||n==273||n==275||n==283||294<=n&&n<=295||n==299||305<=n&&n<=307||n==312||319<=n&&n<=322||n==324||328<=n&&n<=331||n==333||338<=n&&n<=339||358<=n&&n<=359||n==363||n==462||n==464||n==466||n==468||n==470||n==472||n==474||n==476||n==593||n==609||n==708||n==711||713<=n&&n<=715||n==717||n==720||728<=n&&n<=731||n==733||n==735||768<=n&&n<=879||913<=n&&n<=929||931<=n&&n<=937||945<=n&&n<=961||963<=n&&n<=969||n==1025||1040<=n&&n<=1103||n==1105||n==8208||8211<=n&&n<=8214||8216<=n&&n<=8217||8220<=n&&n<=8221||8224<=n&&n<=8226||8228<=n&&n<=8231||n==8240||8242<=n&&n<=8243||n==8245||n==8251||n==8254||n==8308||n==8319||8321<=n&&n<=8324||n==8364||n==8451||n==8453||n==8457||n==8467||n==8470||8481<=n&&n<=8482||n==8486||n==8491||8531<=n&&n<=8532||8539<=n&&n<=8542||8544<=n&&n<=8555||8560<=n&&n<=8569||n==8585||8592<=n&&n<=8601||8632<=n&&n<=8633||n==8658||n==8660||n==8679||n==8704||8706<=n&&n<=8707||8711<=n&&n<=8712||n==8715||n==8719||n==8721||n==8725||n==8730||8733<=n&&n<=8736||n==8739||n==8741||8743<=n&&n<=8748||n==8750||8756<=n&&n<=8759||8764<=n&&n<=8765||n==8776||n==8780||n==8786||8800<=n&&n<=8801||8804<=n&&n<=8807||8810<=n&&n<=8811||8814<=n&&n<=8815||8834<=n&&n<=8835||8838<=n&&n<=8839||n==8853||n==8857||n==8869||n==8895||n==8978||9312<=n&&n<=9449||9451<=n&&n<=9547||9552<=n&&n<=9587||9600<=n&&n<=9615||9618<=n&&n<=9621||9632<=n&&n<=9633||9635<=n&&n<=9641||9650<=n&&n<=9651||9654<=n&&n<=9655||9660<=n&&n<=9661||9664<=n&&n<=9665||9670<=n&&n<=9672||n==9675||9678<=n&&n<=9681||9698<=n&&n<=9701||n==9711||9733<=n&&n<=9734||n==9737||9742<=n&&n<=9743||9748<=n&&n<=9749||n==9756||n==9758||n==9792||n==9794||9824<=n&&n<=9825||9827<=n&&n<=9829||9831<=n&&n<=9834||9836<=n&&n<=9837||n==9839||9886<=n&&n<=9887||9918<=n&&n<=9919||9924<=n&&n<=9933||9935<=n&&n<=9953||n==9955||9960<=n&&n<=9983||n==10045||n==10071||10102<=n&&n<=10111||11093<=n&&n<=11097||12872<=n&&n<=12879||57344<=n&&n<=63743||65024<=n&&n<=65039||n==65533||127232<=n&&n<=127242||127248<=n&&n<=127277||127280<=n&&n<=127337||127344<=n&&n<=127386||917760<=n&&n<=917999||983040<=n&&n<=1048573||1048576<=n&&n<=1114109?"A":"N"},e.characterLength=function(r){var o=this.eastAsianWidth(r);return o=="F"||o=="W"||o=="A"?2:1};function i(r){return r.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}e.length=function(r){for(var o=i(r),s=0,n=0;n<o.length;n++)s=s+this.characterLength(o[n]);return s},e.slice=function(r,o,s){textLen=e.length(r),o=o||0,s=s||1,o<0&&(o=textLen+o),s<0&&(s=textLen+s);for(var n="",m=0,a=i(r),u=0;u<a.length;u++){var y=a[u],$=e.length(y);if(m>=o-($==2?1:0))if(m+$<=s)n+=y;else break;m+=$}return n}})(an);Ei=an.exports,Pi=mn(Ei),Fi=mn(Li);S={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(S.modifier);Di=Object.keys(S.color),tr=Object.keys(S.bgColor);[...Di,...tr];nr=er(),At=new Set(["\x1B",""]),Ft=`${rr}8;;`;mr=Object.defineProperty;ln=Symbol("clack:cancel");Fe=new Map([["k","up"],["j","down"],["h","left"],["l","right"]]),$r=new Set(["up","down","left","right","space","enter"]);Dt=class Dt extends U{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(t){super(t,!1),this.value=!!t.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",(e)=>{this.output.write(j.cursor.move(0,-1)),this.value=e,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};lr=Object.defineProperty;te=class te extends U{constructor(t){super(t,!1),De(this,"options"),De(this,"cursor",0);let{options:e}=t;this.options=Object.entries(e).flatMap(([i,r])=>[{value:i,group:!0,label:i},...r.map((o)=>({...o,group:i}))]),this.value=[...t.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:i})=>i===t.cursorAt),0),this.on("cursor",(i)=>{switch(i){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break;case"space":this.toggleValue();break}})}getGroupItems(t){return this.options.filter((e)=>e.group===t)}isGroupSelected(t){return this.getGroupItems(t).every((e)=>this.value.includes(e.value))}toggleValue(){let t=this.options[this.cursor];if(t.group===!0){let e=t.value,i=this.getGroupItems(e);this.isGroupSelected(e)?this.value=this.value.filter((r)=>i.findIndex((o)=>o.value===r)===-1):this.value=[...this.value,...i.map((r)=>r.value)],this.value=Array.from(new Set(this.value))}else{let e=this.value.includes(t.value);this.value=e?this.value.filter((i)=>i!==t.value):[...this.value,t.value]}}};yr=Object.defineProperty,cn=class extends U{constructor(t){super(t,!1),tn(this,"options"),tn(this,"cursor",0),this.options=t.options,this.value=[...t.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:e})=>e===t.cursorAt),0),this.on("key",(e)=>{e==="a"&&this.toggleAll()}),this.on("cursor",(e)=>{switch(e){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break;case"space":this.toggleValue();break}})}get _value(){return this.options[this.cursor].value}toggleAll(){let t=this.value.length===this.options.length;this.value=t?[]:this.options.map((e)=>e.value)}toggleValue(){let t=this.value.includes(this._value);this.value=t?this.value.filter((e)=>e!==this._value):[...this.value,this._value]}},hr=Object.defineProperty;ee=class ee extends U{constructor({mask:t,...e}){super(e),en(this,"valueWithCursor",""),en(this,"_mask","•"),this._mask=t??"•",this.on("finalize",()=>{this.valueWithCursor=this.masked}),this.on("value",()=>{if(this.cursor>=this.value.length)this.valueWithCursor=`${this.masked}${L.default.inverse(L.default.hidden("_"))}`;else{let i=this.masked.slice(0,this.cursor),r=this.masked.slice(this.cursor);this.valueWithCursor=`${i}${L.default.inverse(r[0])}${r.slice(1)}`}})}get cursor(){return this._cursor}get masked(){return this.value.replaceAll(/./g,this._mask)}};wr=Object.defineProperty,yn=class extends U{constructor(t){super(t,!1),nn(this,"options"),nn(this,"cursor",0),this.options=t.options,this.cursor=this.options.findIndex(({value:e})=>e===t.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",(e)=>{switch(e){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}},_r=Object.defineProperty;ne=class ne extends U{constructor(t){super(t,!1),rn(this,"options"),rn(this,"cursor",0),this.options=t.options;let e=this.options.map(({value:[i]})=>i?.toLowerCase());this.cursor=Math.max(e.indexOf(t.initialValue),0),this.on("key",(i)=>{if(!e.includes(i))return;let r=this.options.find(({value:[o]})=>o?.toLowerCase()===i);r&&(this.value=r.value,this.state="submit",this.emit("submit"))})}};fr=Object.defineProperty;ie=class ie extends U{constructor(t){super(t),Rr(this,"valueWithCursor",""),this.on("finalize",()=>{this.value||(this.value=t.defaultValue),this.valueWithCursor=this.value}),this.on("value",()=>{if(this.cursor>=this.value.length)this.valueWithCursor=`${this.value}${L.default.inverse(L.default.hidden("_"))}`;else{let e=this.value.slice(0,this.cursor),i=this.value.slice(this.cursor);this.valueWithCursor=`${e}${L.default.inverse(i[0])}${i.slice(1)}`}})}get cursor(){return this._cursor}};kr=globalThis.process.platform.startsWith("win")});var qt={};ui(qt,{text:()=>zr,spinner:()=>Cr,selectKey:()=>Xr,select:()=>Kr,password:()=>Jr,outro:()=>Ur,note:()=>Zr,multiselect:()=>Qr,log:()=>F,isCancel:()=>jt,intro:()=>Hr,groupMultiselect:()=>Vr,group:()=>Pr,confirm:()=>Yr,cancel:()=>Wr});import z from"node:process";function gr(){return z.platform!=="win32"?z.env.TERM!=="linux":Boolean(z.env.CI)||Boolean(z.env.WT_SESSION)||Boolean(z.env.TERMINUS_SUBLIME)||z.env.ConEmuTask==="{cmd::Cmder}"||z.env.TERM_PROGRAM==="Terminus-Sublime"||z.env.TERM_PROGRAM==="vscode"||z.env.TERM==="xterm-256color"||z.env.TERM==="alacritty"||z.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}function Er(){let t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(t,"g")}var p,st,se,R=(t,e)=>se?t:e,Ar,bn,wn,Mt,jr,x,T,pe,me,ae,$t,dn,Mr,hn,qr,Tr,Or,Gr,Nr,Br,Ir,D=(t)=>{switch(t){case"initial":case"active":return p.default.cyan(Ar);case"cancel":return p.default.red(bn);case"error":return p.default.yellow(wn);case"submit":return p.default.green(Mt)}},zr=(t)=>new ie({validate:t.validate,placeholder:t.placeholder,defaultValue:t.defaultValue,initialValue:t.initialValue,render(){let e=`${p.default.gray(x)}
|
|
12
|
+
`)),this._prevFrame=t;return}this.output.write(j.erase.down())}this.output.write(t),this.state==="initial"&&(this.state="active"),this._prevFrame=t}}}function xn({input:t=on,output:e=sn,overwrite:i=!0,hideCursor:r=!0}={}){let o=H.createInterface({input:t,output:e,prompt:"",tabSize:1});H.emitKeypressEvents(t,o),t.isTTY&&t.setRawMode(!0);let s=(n,{name:m})=>{if(String(n)==="\x03"){r&&e.write(j.cursor.show),process.exit(0);return}if(!i)return;H.moveCursor(e,m==="return"?0:-1,m==="return"?-1:0,()=>{H.clearLine(e,1,()=>{t.once("keypress",s)})})};return r&&e.write(j.cursor.hide),t.once("keypress",s),()=>{t.off("keypress",s),r&&e.write(j.cursor.show),t.isTTY&&!kr&&t.setRawMode(!1),o.terminal=!1,o.close()}}var j,L,Ci,an,Pi,Ei,Li=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},Fi,Pt=10,He=(t=0)=>(e)=>`\x1B[${e+t}m`,Ue=(t=0)=>(e)=>`\x1B[${38+t};5;${e}m`,Ce=(t=0)=>(e,i,r)=>`\x1B[${38+t};2;${e};${i};${r}m`,S,Di,tr,nr,At,ir=39,Lt="\x07",un="[",rr="]",$n="m",Ft,Pe=(t)=>`${At.values().next().value}${un}${t}${$n}`,Ee=(t)=>`${At.values().next().value}${Ft}${t}${Lt}`,or=(t)=>t.split(" ").map((e)=>ut(e)),Et=(t,e,i)=>{let r=[...e],o=!1,s=!1,n=ut(pn(t[t.length-1]));for(let[m,a]of r.entries()){let u=ut(a);if(n+u<=i?t[t.length-1]+=a:(t.push(a),n=0),At.has(a)&&(o=!0,s=r.slice(m+1).join("").startsWith(Ft)),o){s?a===Lt&&(o=!1,s=!1):a===$n&&(o=!1);continue}n+=u,n===i&&m<r.length-1&&(t.push(""),n=0)}!n&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},sr=(t)=>{let e=t.split(" "),i=e.length;for(;i>0&&!(ut(e[i-1])>0);)i--;return i===e.length?t:e.slice(0,i).join(" ")+e.slice(i).join("")},pr=(t,e,i={})=>{if(i.trim!==!1&&t.trim()==="")return"";let r="",o,s,n=or(t),m=[""];for(let[u,y]of t.split(" ").entries()){i.trim!==!1&&(m[m.length-1]=m[m.length-1].trimStart());let $=ut(m[m.length-1]);if(u!==0&&($>=e&&(i.wordWrap===!1||i.trim===!1)&&(m.push(""),$=0),($>0||i.trim===!1)&&(m[m.length-1]+=" ",$++)),i.hard&&n[u]>e){let h=e-$,w=1+Math.floor((n[u]-h-1)/e);Math.floor((n[u]-1)/e)<w&&m.push(""),Et(m,y,e);continue}if($+n[u]>e&&$>0&&n[u]>0){if(i.wordWrap===!1&&$<e){Et(m,y,e);continue}m.push("")}if($+n[u]>e&&i.wordWrap===!1){Et(m,y,e);continue}m[m.length-1]+=y}i.trim!==!1&&(m=m.map((u)=>sr(u)));let a=[...m.join(`
|
|
13
|
+
`)];for(let[u,y]of a.entries()){if(r+=y,At.has(y)){let{groups:h}=new RegExp(`(?:\\${un}(?<code>\\d+)m|\\${Ft}(?<uri>.*)${Lt})`).exec(a.slice(u).join(""))||{groups:{}};if(h.code!==void 0){let w=Number.parseFloat(h.code);o=w===ir?void 0:w}else h.uri!==void 0&&(s=h.uri.length===0?void 0:h.uri)}let $=nr.codes.get(Number(o));a[u+1]===`
|
|
14
|
+
`?(s&&(r+=Ee("")),o&&$&&(r+=Pe($))):y===`
|
|
15
|
+
`&&(o&&$&&(r+=Pe(o)),s&&(r+=Ee(s)))}return r},mr,ar=(t,e,i)=>(e in t)?mr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,N=(t,e,i)=>(ar(t,typeof e!="symbol"?e+"":e,i),i),ln,Fe,$r,Dt,lr,cr=(t,e,i)=>(e in t)?lr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,De=(t,e,i)=>(cr(t,typeof e!="symbol"?e+"":e,i),i),te,yr,xr=(t,e,i)=>(e in t)?yr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,tn=(t,e,i)=>(xr(t,typeof e!="symbol"?e+"":e,i),i),cn,hr,wr=(t,e,i)=>(e in t)?hr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,en=(t,e,i)=>(wr(t,typeof e!="symbol"?e+"":e,i),i),ee,br,dr=(t,e,i)=>(e in t)?br(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,nn=(t,e,i)=>(dr(t,typeof e!="symbol"?e+"":e,i),i),yn,_r,vr=(t,e,i)=>(e in t)?_r(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,rn=(t,e,i)=>(vr(t,typeof e!="symbol"?e+"":e,i),i),ne,fr,Sr=(t,e,i)=>(e in t)?fr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Rr=(t,e,i)=>(Sr(t,typeof e!="symbol"?e+"":e,i),i),ie,kr;var re=ye(()=>{j=Y(Ht(),1),L=Y(Ct(),1);Ci=Ui();an={exports:{}};(function(t){var e={};t.exports=e,e.eastAsianWidth=function(r){var o=r.charCodeAt(0),s=r.length==2?r.charCodeAt(1):0,n=o;return 55296<=o&&o<=56319&&56320<=s&&s<=57343&&(o&=1023,s&=1023,n=o<<10|s,n+=65536),n==12288||65281<=n&&n<=65376||65504<=n&&n<=65510?"F":n==8361||65377<=n&&n<=65470||65474<=n&&n<=65479||65482<=n&&n<=65487||65490<=n&&n<=65495||65498<=n&&n<=65500||65512<=n&&n<=65518?"H":4352<=n&&n<=4447||4515<=n&&n<=4519||4602<=n&&n<=4607||9001<=n&&n<=9002||11904<=n&&n<=11929||11931<=n&&n<=12019||12032<=n&&n<=12245||12272<=n&&n<=12283||12289<=n&&n<=12350||12353<=n&&n<=12438||12441<=n&&n<=12543||12549<=n&&n<=12589||12593<=n&&n<=12686||12688<=n&&n<=12730||12736<=n&&n<=12771||12784<=n&&n<=12830||12832<=n&&n<=12871||12880<=n&&n<=13054||13056<=n&&n<=19903||19968<=n&&n<=42124||42128<=n&&n<=42182||43360<=n&&n<=43388||44032<=n&&n<=55203||55216<=n&&n<=55238||55243<=n&&n<=55291||63744<=n&&n<=64255||65040<=n&&n<=65049||65072<=n&&n<=65106||65108<=n&&n<=65126||65128<=n&&n<=65131||110592<=n&&n<=110593||127488<=n&&n<=127490||127504<=n&&n<=127546||127552<=n&&n<=127560||127568<=n&&n<=127569||131072<=n&&n<=194367||177984<=n&&n<=196605||196608<=n&&n<=262141?"W":32<=n&&n<=126||162<=n&&n<=163||165<=n&&n<=166||n==172||n==175||10214<=n&&n<=10221||10629<=n&&n<=10630?"Na":n==161||n==164||167<=n&&n<=168||n==170||173<=n&&n<=174||176<=n&&n<=180||182<=n&&n<=186||188<=n&&n<=191||n==198||n==208||215<=n&&n<=216||222<=n&&n<=225||n==230||232<=n&&n<=234||236<=n&&n<=237||n==240||242<=n&&n<=243||247<=n&&n<=250||n==252||n==254||n==257||n==273||n==275||n==283||294<=n&&n<=295||n==299||305<=n&&n<=307||n==312||319<=n&&n<=322||n==324||328<=n&&n<=331||n==333||338<=n&&n<=339||358<=n&&n<=359||n==363||n==462||n==464||n==466||n==468||n==470||n==472||n==474||n==476||n==593||n==609||n==708||n==711||713<=n&&n<=715||n==717||n==720||728<=n&&n<=731||n==733||n==735||768<=n&&n<=879||913<=n&&n<=929||931<=n&&n<=937||945<=n&&n<=961||963<=n&&n<=969||n==1025||1040<=n&&n<=1103||n==1105||n==8208||8211<=n&&n<=8214||8216<=n&&n<=8217||8220<=n&&n<=8221||8224<=n&&n<=8226||8228<=n&&n<=8231||n==8240||8242<=n&&n<=8243||n==8245||n==8251||n==8254||n==8308||n==8319||8321<=n&&n<=8324||n==8364||n==8451||n==8453||n==8457||n==8467||n==8470||8481<=n&&n<=8482||n==8486||n==8491||8531<=n&&n<=8532||8539<=n&&n<=8542||8544<=n&&n<=8555||8560<=n&&n<=8569||n==8585||8592<=n&&n<=8601||8632<=n&&n<=8633||n==8658||n==8660||n==8679||n==8704||8706<=n&&n<=8707||8711<=n&&n<=8712||n==8715||n==8719||n==8721||n==8725||n==8730||8733<=n&&n<=8736||n==8739||n==8741||8743<=n&&n<=8748||n==8750||8756<=n&&n<=8759||8764<=n&&n<=8765||n==8776||n==8780||n==8786||8800<=n&&n<=8801||8804<=n&&n<=8807||8810<=n&&n<=8811||8814<=n&&n<=8815||8834<=n&&n<=8835||8838<=n&&n<=8839||n==8853||n==8857||n==8869||n==8895||n==8978||9312<=n&&n<=9449||9451<=n&&n<=9547||9552<=n&&n<=9587||9600<=n&&n<=9615||9618<=n&&n<=9621||9632<=n&&n<=9633||9635<=n&&n<=9641||9650<=n&&n<=9651||9654<=n&&n<=9655||9660<=n&&n<=9661||9664<=n&&n<=9665||9670<=n&&n<=9672||n==9675||9678<=n&&n<=9681||9698<=n&&n<=9701||n==9711||9733<=n&&n<=9734||n==9737||9742<=n&&n<=9743||9748<=n&&n<=9749||n==9756||n==9758||n==9792||n==9794||9824<=n&&n<=9825||9827<=n&&n<=9829||9831<=n&&n<=9834||9836<=n&&n<=9837||n==9839||9886<=n&&n<=9887||9918<=n&&n<=9919||9924<=n&&n<=9933||9935<=n&&n<=9953||n==9955||9960<=n&&n<=9983||n==10045||n==10071||10102<=n&&n<=10111||11093<=n&&n<=11097||12872<=n&&n<=12879||57344<=n&&n<=63743||65024<=n&&n<=65039||n==65533||127232<=n&&n<=127242||127248<=n&&n<=127277||127280<=n&&n<=127337||127344<=n&&n<=127386||917760<=n&&n<=917999||983040<=n&&n<=1048573||1048576<=n&&n<=1114109?"A":"N"},e.characterLength=function(r){var o=this.eastAsianWidth(r);return o=="F"||o=="W"||o=="A"?2:1};function i(r){return r.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}e.length=function(r){for(var o=i(r),s=0,n=0;n<o.length;n++)s=s+this.characterLength(o[n]);return s},e.slice=function(r,o,s){textLen=e.length(r),o=o||0,s=s||1,o<0&&(o=textLen+o),s<0&&(s=textLen+s);for(var n="",m=0,a=i(r),u=0;u<a.length;u++){var y=a[u],$=e.length(y);if(m>=o-($==2?1:0))if(m+$<=s)n+=y;else break;m+=$}return n}})(an);Pi=an.exports,Ei=mn(Pi),Fi=mn(Li);S={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(S.modifier);Di=Object.keys(S.color),tr=Object.keys(S.bgColor);[...Di,...tr];nr=er(),At=new Set(["\x1B",""]),Ft=`${rr}8;;`;mr=Object.defineProperty;ln=Symbol("clack:cancel");Fe=new Map([["k","up"],["j","down"],["h","left"],["l","right"]]),$r=new Set(["up","down","left","right","space","enter"]);Dt=class Dt extends U{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(t){super(t,!1),this.value=!!t.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",(e)=>{this.output.write(j.cursor.move(0,-1)),this.value=e,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};lr=Object.defineProperty;te=class te extends U{constructor(t){super(t,!1),De(this,"options"),De(this,"cursor",0);let{options:e}=t;this.options=Object.entries(e).flatMap(([i,r])=>[{value:i,group:!0,label:i},...r.map((o)=>({...o,group:i}))]),this.value=[...t.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:i})=>i===t.cursorAt),0),this.on("cursor",(i)=>{switch(i){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break;case"space":this.toggleValue();break}})}getGroupItems(t){return this.options.filter((e)=>e.group===t)}isGroupSelected(t){return this.getGroupItems(t).every((e)=>this.value.includes(e.value))}toggleValue(){let t=this.options[this.cursor];if(t.group===!0){let e=t.value,i=this.getGroupItems(e);this.isGroupSelected(e)?this.value=this.value.filter((r)=>i.findIndex((o)=>o.value===r)===-1):this.value=[...this.value,...i.map((r)=>r.value)],this.value=Array.from(new Set(this.value))}else{let e=this.value.includes(t.value);this.value=e?this.value.filter((i)=>i!==t.value):[...this.value,t.value]}}};yr=Object.defineProperty,cn=class extends U{constructor(t){super(t,!1),tn(this,"options"),tn(this,"cursor",0),this.options=t.options,this.value=[...t.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:e})=>e===t.cursorAt),0),this.on("key",(e)=>{e==="a"&&this.toggleAll()}),this.on("cursor",(e)=>{switch(e){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break;case"space":this.toggleValue();break}})}get _value(){return this.options[this.cursor].value}toggleAll(){let t=this.value.length===this.options.length;this.value=t?[]:this.options.map((e)=>e.value)}toggleValue(){let t=this.value.includes(this._value);this.value=t?this.value.filter((e)=>e!==this._value):[...this.value,this._value]}},hr=Object.defineProperty;ee=class ee extends U{constructor({mask:t,...e}){super(e),en(this,"valueWithCursor",""),en(this,"_mask","•"),this._mask=t??"•",this.on("finalize",()=>{this.valueWithCursor=this.masked}),this.on("value",()=>{if(this.cursor>=this.value.length)this.valueWithCursor=`${this.masked}${L.default.inverse(L.default.hidden("_"))}`;else{let i=this.masked.slice(0,this.cursor),r=this.masked.slice(this.cursor);this.valueWithCursor=`${i}${L.default.inverse(r[0])}${r.slice(1)}`}})}get cursor(){return this._cursor}get masked(){return this.value.replaceAll(/./g,this._mask)}};br=Object.defineProperty,yn=class extends U{constructor(t){super(t,!1),nn(this,"options"),nn(this,"cursor",0),this.options=t.options,this.cursor=this.options.findIndex(({value:e})=>e===t.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",(e)=>{switch(e){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}},_r=Object.defineProperty;ne=class ne extends U{constructor(t){super(t,!1),rn(this,"options"),rn(this,"cursor",0),this.options=t.options;let e=this.options.map(({value:[i]})=>i?.toLowerCase());this.cursor=Math.max(e.indexOf(t.initialValue),0),this.on("key",(i)=>{if(!e.includes(i))return;let r=this.options.find(({value:[o]})=>o?.toLowerCase()===i);r&&(this.value=r.value,this.state="submit",this.emit("submit"))})}};fr=Object.defineProperty;ie=class ie extends U{constructor(t){super(t),Rr(this,"valueWithCursor",""),this.on("finalize",()=>{this.value||(this.value=t.defaultValue),this.valueWithCursor=this.value}),this.on("value",()=>{if(this.cursor>=this.value.length)this.valueWithCursor=`${this.value}${L.default.inverse(L.default.hidden("_"))}`;else{let e=this.value.slice(0,this.cursor),i=this.value.slice(this.cursor);this.valueWithCursor=`${e}${L.default.inverse(i[0])}${i.slice(1)}`}})}get cursor(){return this._cursor}};kr=globalThis.process.platform.startsWith("win")});var qt={};ui(qt,{text:()=>zr,spinner:()=>Cr,selectKey:()=>Xr,select:()=>Kr,password:()=>Jr,outro:()=>Ur,note:()=>Zr,multiselect:()=>Qr,log:()=>F,isCancel:()=>jt,intro:()=>Hr,groupMultiselect:()=>Vr,group:()=>Er,confirm:()=>Yr,cancel:()=>Wr});import z from"node:process";function gr(){return z.platform!=="win32"?z.env.TERM!=="linux":Boolean(z.env.CI)||Boolean(z.env.WT_SESSION)||Boolean(z.env.TERMINUS_SUBLIME)||z.env.ConEmuTask==="{cmd::Cmder}"||z.env.TERM_PROGRAM==="Terminus-Sublime"||z.env.TERM_PROGRAM==="vscode"||z.env.TERM==="xterm-256color"||z.env.TERM==="alacritty"||z.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}function Pr(){let t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(t,"g")}var p,st,se,R=(t,e)=>se?t:e,Ar,wn,bn,Mt,jr,x,T,pe,me,ae,$t,dn,Mr,hn,qr,Tr,Or,Gr,Nr,Br,Ir,D=(t)=>{switch(t){case"initial":case"active":return p.default.cyan(Ar);case"cancel":return p.default.red(wn);case"error":return p.default.yellow(bn);case"submit":return p.default.green(Mt)}},zr=(t)=>new ie({validate:t.validate,placeholder:t.placeholder,defaultValue:t.defaultValue,initialValue:t.initialValue,render(){let e=`${p.default.gray(x)}
|
|
16
16
|
${D(this.state)} ${t.message}
|
|
17
17
|
`,i=t.placeholder?p.default.inverse(t.placeholder[0])+p.default.dim(t.placeholder.slice(1)):p.default.inverse(p.default.hidden("_")),r=this.value?this.valueWithCursor:i;switch(this.state){case"error":return`${e.trim()}
|
|
18
18
|
${p.default.yellow(x)} ${r}
|
|
@@ -69,7 +69,7 @@ ${r}
|
|
|
69
69
|
`}default:return`${i}${p.default.cyan(x)} ${this.options.map((r,o,s)=>{let n=this.value.includes(r.value)||r.group===!0&&this.isGroupSelected(`${r.value}`),m=o===this.cursor;return!m&&typeof r.group=="string"&&this.options[this.cursor].value===r.group?e(r,n?"group-active-selected":"group-active",s):m&&n?e(r,"active-selected",s):n?e(r,"selected",s):e(r,m?"active":"inactive",s)}).join(`
|
|
70
70
|
${p.default.cyan(x)} `)}
|
|
71
71
|
${p.default.cyan(T)}
|
|
72
|
-
`}}}).prompt()},oe=(t)=>t.replace(
|
|
72
|
+
`}}}).prompt()},oe=(t)=>t.replace(Pr(),""),Zr=(t="",e="")=>{let i=`
|
|
73
73
|
${t}
|
|
74
74
|
`.split(`
|
|
75
75
|
`),r=oe(e).length,o=Math.max(i.reduce((n,m)=>(m=oe(m),m.length>n?m.length:n),0),r)+2,s=i.map((n)=>`${p.default.gray(x)} ${p.default.dim(n)}${" ".repeat(o-oe(n).length)}${p.default.gray(x)}`).join(`
|
|
@@ -84,15 +84,15 @@ ${p.default.gray(Tr+hn.repeat(o+2)+Or)}
|
|
|
84
84
|
${p.default.gray(T)} ${t}
|
|
85
85
|
|
|
86
86
|
`)},F,Cr=()=>{let t=se?["◒","◐","◓","◑"]:["•","o","O","0"],e=se?80:120,i,r,o=!1,s="",n=(y="")=>{o=!0,i=xn(),s=y.replace(/\.+$/,""),process.stdout.write(`${p.default.gray(x)}
|
|
87
|
-
`);let $=0,h=0;r=setInterval(()=>{let
|
|
88
|
-
`),i()},a=(y="")=>{s=y??s},u=(y)=>{let $=y>1?"Something went wrong":"Canceled";o&&m($,y)};return process.on("uncaughtExceptionMonitor",()=>u(2)),process.on("unhandledRejection",()=>u(2)),process.on("SIGINT",()=>u(1)),process.on("SIGTERM",()=>u(1)),process.on("exit",u),{start:n,stop:m,message:a}},
|
|
87
|
+
`);let $=0,h=0;r=setInterval(()=>{let w=p.default.magenta(t[$]),f=".".repeat(Math.floor(h)).slice(0,3);process.stdout.write(st.cursor.move(-999,0)),process.stdout.write(st.erase.down(1)),process.stdout.write(`${w} ${s}${f}`),$=$+1<t.length?$+1:0,h=h<t.length?h+0.125:0},e)},m=(y="",$=0)=>{s=y??s,o=!1,clearInterval(r);let h=$===0?p.default.green(Mt):$===1?p.default.red(wn):p.default.red(bn);process.stdout.write(st.cursor.move(-999,0)),process.stdout.write(st.erase.down(1)),process.stdout.write(`${h} ${s}
|
|
88
|
+
`),i()},a=(y="")=>{s=y??s},u=(y)=>{let $=y>1?"Something went wrong":"Canceled";o&&m($,y)};return process.on("uncaughtExceptionMonitor",()=>u(2)),process.on("unhandledRejection",()=>u(2)),process.on("SIGINT",()=>u(1)),process.on("SIGTERM",()=>u(1)),process.on("exit",u),{start:n,stop:m,message:a}},Er=async(t,e)=>{let i={},r=Object.keys(t);for(let o of r){let s=t[o],n=await s({results:i})?.catch((m)=>{throw m});if(typeof e?.onCancel=="function"&&jt(n)){i[o]="canceled",e.onCancel({results:i});continue}i[o]=n}return i};var Tt=ye(()=>{re();re();p=Y(Ct(),1),st=Y(Ht(),1);se=gr(),Ar=R("◆","*"),wn=R("■","x"),bn=R("▲","x"),Mt=R("◇","o"),jr=R("┌","T"),x=R("│","|"),T=R("└","—"),pe=R("●",">"),me=R("○"," "),ae=R("◻","[•]"),$t=R("◼","[+]"),dn=R("◻","[ ]"),Mr=R("▪","•"),hn=R("─","-"),qr=R("╮","+"),Tr=R("├","+"),Or=R("╯","+"),Gr=R("●","•"),Nr=R("◆","*"),Br=R("▲","!"),Ir=R("■","x"),F={message:(t="",{symbol:e=p.default.gray(x)}={})=>{let i=[`${p.default.gray(x)}`];if(t){let[r,...o]=t.split(`
|
|
89
89
|
`);i.push(`${e} ${r}`,...o.map((s)=>`${p.default.gray(x)} ${s}`))}process.stdout.write(`${i.join(`
|
|
90
90
|
`)}
|
|
91
|
-
`)},info:(t)=>{F.message(t,{symbol:p.default.blue(Gr)})},success:(t)=>{F.message(t,{symbol:p.default.green(Nr)})},step:(t)=>{F.message(t,{symbol:p.default.green(Mt)})},warn:(t)=>{F.message(t,{symbol:p.default.yellow(Br)})},warning:(t)=>{F.warn(t)},error:(t)=>{F.message(t,{symbol:p.default.red(Ir)})}}});function zt(t){return t.replace(/-([a-z])/g,(e,i)=>i.toUpperCase())}function li(t){let e=t.flag.match(/^--([a-z][a-z0-9-]*)/i);return e?zt(e[1]):null}function ci(t){if(t.type==="boolean")return!0;if(t.type==="string"||t.type==="number"||t.type==="array")return!1;return!t.flag.includes("<")&&!t.flag.includes("[")}function xe(t){let e=new Set,i=new Set,r=new Set;for(let o of t){let s=li(o);if(!s)continue;if(ci(o))e.add(s);else if(o.type==="number")i.add(s);else if(o.type==="array")r.add(s)}return{booleans:e,numbers:i,arrays:r}}function he(t,e=[]){let i=xe(e),r=[],o=0;while(o<t.length){let s=t[o];if(s==="--")break;if(s.startsWith("--")){let n=s.indexOf("="),m=n!==-1?s.slice(2,n):s.slice(2),a=zt(m);if(!i.booleans.has(a)&&n===-1)o+=2;else o+=1;continue}if(s.startsWith("-")){o++;continue}r.push(s),o++}return r}function Jt(t,e){let i=xe(e),r={quiet:!1,verbose:!1,noColor:!1,yes:!1,dryRun:!1,help:!1,nonInteractive:!1,async:!1},o=0;while(o<t.length){let s=t[o];if(s==="--help"||s==="-h"){r.help=!0,o++;continue}if(s==="--")break;if(s.startsWith("--")){let n=s.indexOf("="),m,a;if(n!==-1)m=s.slice(2,n),a=s.slice(n+1);else m=s.slice(2);let u=zt(m);if(i.booleans.has(u)){r[u]=!0,o++;continue}if(a===void 0)o++,a=t[o];if(a===void 0)throw Error(`Flag --${m} requires a value.`);if(i.arrays.has(u)){let y=r[u];if(y)y.push(a);else r[u]=[a]}else if(i.numbers.has(u))r[u]=Number(a);else r[u]=a}o++}return r}var l={SUCCESS:0,GENERAL:1,USAGE:2,AUTH:3,QUOTA:4,TIMEOUT:5,NETWORK:6,CONTENT_FILTER:10};class c extends Error{exitCode;hint;constructor(t,e=l.GENERAL,i){super(t);this.name="CLIError",this.exitCode=e,this.hint=i}toJSON(){return{error:{code:this.exitCode,message:this.message,...this.hint?{hint:this.hint}:{}}}}}function d(t){return{name:t.name,description:t.description,usage:t.usage,options:t.options,examples:t.examples,execute:t.run}}var ht=[{flag:"--api-key <key>",description:"API key"},{flag:"--region <region>",description:"API region: global, cn"},{flag:"--base-url <url>",description:"API base URL"},{flag:"--output <format>",description:"Output format: text, json"},{flag:"--timeout <seconds>",description:"Request timeout",type:"number"},{flag:"--quiet",description:"Suppress non-essential output"},{flag:"--verbose",description:"Print HTTP request/response details"},{flag:"--no-color",description:"Disable ANSI colors"},{flag:"--dry-run",description:"Dry run mode"},{flag:"--non-interactive",description:"Disable interactive prompts"},{flag:"--help",description:"Show help"},{flag:"--version",description:"Print version"}];import{readFileSync as hi,writeFileSync as
|
|
92
|
-
`);return null}}async function rt(t){await
|
|
93
|
-
`,{mode:384}),
|
|
91
|
+
`)},info:(t)=>{F.message(t,{symbol:p.default.blue(Gr)})},success:(t)=>{F.message(t,{symbol:p.default.green(Nr)})},step:(t)=>{F.message(t,{symbol:p.default.green(Mt)})},warn:(t)=>{F.message(t,{symbol:p.default.yellow(Br)})},warning:(t)=>{F.warn(t)},error:(t)=>{F.message(t,{symbol:p.default.red(Ir)})}}});function zt(t){return t.replace(/-([a-z])/g,(e,i)=>i.toUpperCase())}function li(t){let e=t.flag.match(/^--([a-z][a-z0-9-]*)/i);return e?zt(e[1]):null}function ci(t){if(t.type==="boolean")return!0;if(t.type==="string"||t.type==="number"||t.type==="array")return!1;return!t.flag.includes("<")&&!t.flag.includes("[")}function xe(t){let e=new Set,i=new Set,r=new Set;for(let o of t){let s=li(o);if(!s)continue;if(ci(o))e.add(s);else if(o.type==="number")i.add(s);else if(o.type==="array")r.add(s)}return{booleans:e,numbers:i,arrays:r}}function he(t,e=[]){let i=xe(e),r=[],o=0;while(o<t.length){let s=t[o];if(s==="--")break;if(s.startsWith("--")){let n=s.indexOf("="),m=n!==-1?s.slice(2,n):s.slice(2),a=zt(m);if(!i.booleans.has(a)&&n===-1)o+=2;else o+=1;continue}if(s.startsWith("-")){o++;continue}r.push(s),o++}return r}function Jt(t,e){let i=xe(e),r={quiet:!1,verbose:!1,noColor:!1,yes:!1,dryRun:!1,help:!1,nonInteractive:!1,async:!1},o=0;while(o<t.length){let s=t[o];if(s==="--help"||s==="-h"){r.help=!0,o++;continue}if(s==="--")break;if(s.startsWith("--")){let n=s.indexOf("="),m,a;if(n!==-1)m=s.slice(2,n),a=s.slice(n+1);else m=s.slice(2);let u=zt(m);if(i.booleans.has(u)){r[u]=!0,o++;continue}if(a===void 0)o++,a=t[o];if(a===void 0)throw Error(`Flag --${m} requires a value.`);if(i.arrays.has(u)){let y=r[u];if(y)y.push(a);else r[u]=[a]}else if(i.numbers.has(u))r[u]=Number(a);else r[u]=a}o++}return r}var l={SUCCESS:0,GENERAL:1,USAGE:2,AUTH:3,QUOTA:4,TIMEOUT:5,NETWORK:6,CONTENT_FILTER:10};class c extends Error{exitCode;hint;constructor(t,e=l.GENERAL,i){super(t);this.name="CLIError",this.exitCode=e,this.hint=i}toJSON(){return{error:{code:this.exitCode,message:this.message,...this.hint?{hint:this.hint}:{}}}}}function d(t){return{name:t.name,description:t.description,usage:t.usage,options:t.options,examples:t.examples,execute:t.run}}var ht=[{flag:"--api-key <key>",description:"API key"},{flag:"--region <region>",description:"API region: global, cn"},{flag:"--base-url <url>",description:"API base URL"},{flag:"--output <format>",description:"Output format: text, json"},{flag:"--timeout <seconds>",description:"Request timeout",type:"number"},{flag:"--quiet",description:"Suppress non-essential output"},{flag:"--verbose",description:"Print HTTP request/response details"},{flag:"--no-color",description:"Disable ANSI colors"},{flag:"--dry-run",description:"Dry run mode"},{flag:"--non-interactive",description:"Disable interactive prompts"},{flag:"--help",description:"Show help"},{flag:"--version",description:"Print version"}];import{readFileSync as hi,writeFileSync as wi,renameSync as bi,unlinkSync as di,existsSync as we,statSync as _i}from"fs";import{homedir as yi}from"os";import{join as Yt}from"path";var xi=".mmx";function at(){return Yt(yi(),xi)}function Q(){return Yt(at(),"config.json")}function wt(){return Yt(at(),"credentials.json")}async function bt(){let t=at();await(await import("fs/promises")).mkdir(t,{recursive:!0,mode:448})}async function B(){let t=wt();if(!we(t))return null;try{vi(t);let e=hi(t,"utf-8"),i=JSON.parse(e);if(!i.access_token||!i.refresh_token)return null;return i}catch(e){let i=e;if(i instanceof SyntaxError||i.message.includes("JSON"))process.stderr.write(`Warning: credentials file is corrupted. Run 'mmx auth logout' to reset.
|
|
92
|
+
`);return null}}async function rt(t){await bt();let e=wt(),i=e+".tmp";wi(i,JSON.stringify(t,null,2)+`
|
|
93
|
+
`,{mode:384}),bi(i,e)}async function be(){let t=wt();if(we(t))di(t)}function vi(t){try{let i=_i(t).mode&511;if(i!==384)process.stderr.write(`Warning: ${t} has permissions ${i.toString(8)}, expected 600.
|
|
94
94
|
`)}catch{}}var de={clientId:"mmx-cli",authorizationUrl:"https://platform.minimax.io/oauth/authorize",tokenUrl:"https://api.minimax.io/v1/oauth/token",deviceCodeUrl:"https://api.minimax.io/v1/oauth/device/code",scopes:["api"],callbackPort:18991};async function _e(t=de){let{randomBytes:e,createHash:i}=await import("crypto"),r=e(32).toString("base64url"),o=i("sha256").update(r).digest("base64url"),s=e(16).toString("hex"),n=new URLSearchParams({client_id:t.clientId,response_type:"code",redirect_uri:`http://localhost:${t.callbackPort}/callback`,scope:t.scopes.join(" "),state:s,code_challenge:o,code_challenge_method:"S256"}),m=`${t.authorizationUrl}?${n}`,{exec:a}=await import("child_process"),u=process.platform;a(`${u==="darwin"?"open":u==="win32"?"start":"xdg-open"} "${m}"`),process.stderr.write(`Opening browser to authenticate with MiniMax...
|
|
95
|
-
`);let $=await fi(t.callbackPort,s),h=await fetch(t.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({grant_type:"authorization_code",code:$,client_id:t.clientId,redirect_uri:`http://localhost:${t.callbackPort}/callback`,code_verifier:r})});if(!h.ok){let
|
|
95
|
+
`);let $=await fi(t.callbackPort,s),h=await fetch(t.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({grant_type:"authorization_code",code:$,client_id:t.clientId,redirect_uri:`http://localhost:${t.callbackPort}/callback`,code_verifier:r})});if(!h.ok){let w=await h.text();throw new c(`OAuth token exchange failed: ${w}`,l.AUTH)}return await h.json()}async function fi(t,e){return new Promise((i,r)=>{let o=setTimeout(()=>{s.stop(),r(new c("OAuth callback timed out.",l.TIMEOUT))},120000),s=Bun.serve({port:t,fetch(n){let m=new URL(n.url);if(m.pathname!=="/callback")return new Response("Not found",{status:404});let a=m.searchParams.get("code"),u=m.searchParams.get("state"),y=m.searchParams.get("error");if(y)return clearTimeout(o),s.stop(),r(new c(`OAuth error: ${y}`,l.AUTH)),new Response("<html><body><h1>Authentication Failed</h1><p>You can close this tab.</p></body></html>",{headers:{"Content-Type":"text/html"}});if(!a||u!==e)return clearTimeout(o),s.stop(),r(new c("Invalid OAuth callback.",l.AUTH)),new Response("Invalid callback",{status:400});return clearTimeout(o),s.stop(),i(a),new Response("<html><body><h1>Authentication Successful</h1><p>You can close this tab.</p></body></html>",{headers:{"Content-Type":"text/html"}})}})})}async function ve(t=de){let e=await fetch(t.deviceCodeUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({client_id:t.clientId,scope:t.scopes.join(" ")})});if(!e.ok)throw new c("Failed to start device code flow.",l.AUTH);let{device_code:i,user_code:r,verification_uri:o,interval:s,expires_in:n}=await e.json();process.stderr.write(`
|
|
96
96
|
Visit: ${o}
|
|
97
97
|
`),process.stderr.write(`Enter code: ${r}
|
|
98
98
|
`),process.stderr.write(`Waiting for authorization...
|
|
@@ -109,27 +109,27 @@ Music-2.5 requires the Max plan or above.`;return""}function Re(t){return`${t?.i
|
|
|
109
109
|
Re-authenticate: mmx auth login`);if(t===429)return new c(`Rate limit or quota exceeded. ${r}`,l.QUOTA,"Check usage: mmx quota show");if(t===408||t===504)return new c(`Request timed out (HTTP ${t}).`,l.TIMEOUT,"Try increasing --timeout or retry later.");if(o===1002||o===1039){let s=e.base_resp?.status_msg||"content sensitivity";return new c(`Input content flagged by sensitivity filter (${s}).`,l.CONTENT_FILTER)}if(o===1028||o===1030){let s=Se(i);return new c(`Quota exhausted. ${r}`,l.QUOTA,`Check usage: mmx quota show${s}
|
|
110
110
|
Upgrade plan: ${Re(i)}`)}if(o===2061){let s=Se(i);return new c(`This model is not available on your current Token Plan. ${r}`,l.QUOTA,`Check usage: mmx quota show${s}
|
|
111
111
|
Upgrade plan: ${Re(i)}`)}return new c(`API error: ${r} (HTTP ${t})`,l.GENERAL)}import{homedir as ke}from"os";function I(t){return t.length>8?`${t.slice(0,4)}...${t.slice(-4)}`:"***"}var ge=!1;var G="\x1B[0m",V="\x1B[2m",Ri="\x1B[1m",ki="\x1B[38;2;43;82;255m",gi="\x1B[38;2;147;51;234m",Ai="\x1B[38;2;6;184;212m",ji="\x1B[38;2;236;72;153m";function Mi(t){return t.startsWith(ke())?t.replace(ke(),"~"):t}function Ae(t,e,i){if(t.quiet||ge||!process.stderr.isTTY)return;ge=!0;let r=t.configPath?Mi(t.configPath):"~/.mmx/config.json",o=t.fileRegion?`${t.fileRegion} (file)`:"global (default)",s=t.apiKey?"(flag)":"(file)",n=I(e),m=i?` ${V}|${G} ${V}Model:${G} ${gi}${i}${G}`:"";process.stderr.write(`${Ri}${ki}MINIMAX${G} ${V}${r}${G} ${V}|${G} ${V}Region:${G} ${Ai}${o}${G} ${V}|${G} ${V}Key:${G} ${ji}${n}${G} ${V}${s}${G}${m}
|
|
112
|
-
`)}async function
|
|
112
|
+
`)}async function P(t,e){let i=typeof FormData<"u"&&e.body instanceof FormData,r="1.0.3",o={"User-Agent":"mmx-cli/1.0.3",...e.headers};if(!i&&!o["Content-Type"])o["Content-Type"]="application/json";if(!e.noAuth){let m=await dt(t);if(e.authStyle==="x-api-key")o["x-api-key"]=m.token;else o.Authorization=`Bearer ${m.token}`;if(t.verbose)process.stderr.write(`> ${e.method??"GET"} ${e.url}
|
|
113
113
|
`),process.stderr.write(`> Auth: ${m.token.slice(0,8)}...
|
|
114
114
|
`);let a=e.body&&typeof e.body==="object"&&"model"in e.body?String(e.body.model):void 0;Ae(t,m.token,a)}let s=(e.timeout??t.timeout)*1000,n=await fetch(e.url,{method:e.method??"GET",headers:o,body:e.body?i?e.body:JSON.stringify(e.body):void 0,signal:AbortSignal.timeout(s)});if(t.verbose)process.stderr.write(`< ${n.status} ${n.statusText}
|
|
115
|
-
`);if(!n.ok){let m={};try{m=await n.json()}catch{}throw Xt(n.status,m,e.url)}return n}async function v(t,e){let i=await
|
|
115
|
+
`);if(!n.ok){let m={};try{m=await n.json()}catch{}throw Xt(n.status,m,e.url)}return n}async function v(t,e){let i=await P(t,e),r;try{r=await i.json()}catch{let o=i.headers.get("content-type")||"";throw new c(`API returned non-JSON response (${o||"unknown type"}). Server may be experiencing issues.`,l.GENERAL)}if(r.base_resp?.status_code&&r.base_resp.status_code!==0)throw Xt(200,{base_resp:r.base_resp},e.url);return r}function je(t){return`${t}/anthropic/v1/messages`}function Me(t){return`${t}/v1/t2a_v2`}function qe(t){return`${t}/v1/get_voice`}function Te(t){return`${t}/v1/image_generation`}function Oe(t){return`${t}/v1/video_generation`}function _t(t,e){return`${t}/v1/query/video_generation?task_id=${e}`}function vt(t,e){return`${t}/v1/files/retrieve?file_id=${e}`}function Ge(t){return`${t}/v1/music_generation`}function Ne(t){return`${t}/v1/coding_plan/search`}function Be(t){return`${t}/v1/coding_plan/vlm`}function E(t){return`${t.includes("minimaxi.com")?"https://api.minimaxi.com":"https://api.minimax.io"}/v1/api/openplatform/coding_plan/remains`}function Je(t){if(t<50)return["\x1B[38;2;74;222;128m","\x1B[48;2;22;163;74m"];if(t<=80)return["\x1B[38;2;250;204;21m","\x1B[48;2;202;138;4m"];return["\x1B[38;2;248;113;113m","\x1B[48;2;220;38;38m"]}var qi={dashboard:"Quota Dashboard",week:"Week",weekly:"Weekly",resetsIn:"Resets in",noData:"No quota data available.",now:"now"},Ti={dashboard:"配额面板",week:"周期",weekly:"每周",resetsIn:"重置于",noData:"暂无配额数据",now:"即将"};function Oi(t,e){if(t<=0)return e;let i=Math.floor(t/3600000),r=Math.floor(t%3600000/60000);return i>0?`${i}h ${r}m`:`${r}m`}function Ie(t){return new Date(t).toISOString().slice(0,10)}function Gi(t){return t>=11904&&t<=40959||t>=63744&&t<=64255||t>=65072&&t<=65103||t>=65281&&t<=65376||t>=131072&&t<=195103}function Z(t){let e=t.replace(/\x1b\[[0-9;]*m/g,""),i=0;for(let r of e)i+=Gi(r.codePointAt(0))?2:1;return i}var St=16;function ze(t,e){let i=Math.max(0,Math.min(100,t))/100,r=Math.round(St*i),o=St-r,s=`${t}%`.padStart(4);if(!e)return`[${"█".repeat(r)}${".".repeat(o)}] ${s}`;let[n,m]=Je(t);return`${m}${" ".repeat(r)}\x1B[0m\x1B[48;2;55;65;81m${" ".repeat(o)}\x1B[0m ${n}\x1B[1m${s}\x1B[0m`}function ft(t,e,i,r,o){return o?`\x1B[2m${e}${i.repeat(t)}${r}\x1B[0m`:`+${"-".repeat(t)}+`}function Qt(t,e,i,r){let o=Math.max(0,e-2-i);return r?`${"\x1B[2m"}│${"\x1B[0m"} ${t}${" ".repeat(o)} ${"\x1B[2m"}│${"\x1B[0m"}`:`| ${t}${" ".repeat(o)} |`}function ot(t,e){let i=!e.noColor&&process.stdout.isTTY===!0,r=e.region==="cn"?Ti:qi,o=t.length>0?Math.max(...t.map((w)=>w.model_name.length)):16,s=i?St+5:St+7,n=Math.max(68,o+2+15+2+s+2),m=t.length>0?`${Ie(t[0].weekly_start_time)} — ${Ie(t[0].weekly_end_time)}`:"",a=`MINIMAX ${r.dashboard}`,u=`${r.week}: ${m}`,y=Math.max(2,n-2-Z(a)-Z(u)),$=i?`\x1B[1m\x1B[38;2;43;82;255mMINIMAX\x1B[0m \x1B[2m${r.dashboard}\x1B[0m${" ".repeat(y)}\x1B[2m${r.week}:\x1B[0m \x1B[38;2;6;184;212m${m}\x1B[0m`:`${a}${" ".repeat(y)}${u}`,h=Z(a)+y+Z(u);if(console.log(""),console.log(ft(n,"╭","─","╮",i)),console.log(Qt($,n,h,i)),t.length===0){console.log(ft(n,"╰","─","╯",i)),console.log(`
|
|
116
116
|
${r.noData}
|
|
117
|
-
`);return}for(let
|
|
117
|
+
`);return}for(let w of t){console.log(ft(n,"├","─","┤",i));let{current_interval_usage_count:f,current_interval_total_count:g}=w,M=Math.max(0,g-f),J=g>0?Math.round(M/g*100):0,nt=w.current_weekly_usage_count,q=w.current_weekly_total_count,k=Math.max(0,q-nt),mt=Oi(w.remains_time,r.now),lt=w.model_name.padEnd(o),ct=`${M.toLocaleString()} / ${g.toLocaleString()}`,ei=ze(J,i),ni=o+2+15+2+s,ii=i?`\x1B[1m\x1B[38;2;255;255;255m${lt}\x1B[0m ${Je(J)[0]}${ct.padStart(15)}\x1B[0m ${ei}`:`${lt} ${ct.padStart(15)} ${ze(J,!1)}`;console.log(Qt(ii,n,ni,i));let yt=`└ ${r.weekly} ${k.toLocaleString()} / ${q.toLocaleString()}`,xt=`${r.resetsIn} ${mt}`,Bt=Math.max(2,n-2-2-Z(yt)-Z(xt)),ri=2+Z(yt)+Bt+Z(xt),oi=i?` \x1B[2m${yt}${" ".repeat(Bt)}${xt}\x1B[0m`:` ${yt}${" ".repeat(Bt)}${xt}`;console.log(Qt(oi,n,ri,i))}console.log(ft(n,"╰","─","╯",i)),console.log("")}import{readFileSync as zi,writeFileSync as Ji,renameSync as Yi,existsSync as Ki}from"fs";var W={global:"https://api.minimax.io",cn:"https://api.minimaxi.com"},Ni=new Set(["global","cn"]),Bi=new Set(["text","json"]);function Ye(t){if(!t||typeof t!=="object"||Array.isArray(t))return{};let e=t,i={};if(typeof e.api_key==="string")i.api_key=e.api_key;if(typeof e.region==="string"&&Ni.has(e.region))i.region=e.region;if(typeof e.base_url==="string"&&e.base_url.startsWith("http"))i.base_url=e.base_url;if(typeof e.output==="string"&&Bi.has(e.output))i.output=e.output;if(typeof e.timeout==="number"&&e.timeout>0)i.timeout=e.timeout;return i}function Ke(t){if(t===null||t===void 0)return"";if(typeof t==="string")return t;if(typeof t==="number"||typeof t==="boolean")return String(t);if(Array.isArray(t)){if(t.length===0)return"(empty)";if(typeof t[0]==="object"&&t[0]!==null)return Ii(t);return t.map(String).join(`
|
|
118
118
|
`)}if(typeof t==="object")return Vt(t);return String(t)}function Vt(t,e=0){let i=" ".repeat(e),r=[];for(let[o,s]of Object.entries(t)){if(s===null||s===void 0)continue;if(Array.isArray(s)){r.push(`${i}${o}:`);for(let n of s)if(typeof n==="object"&&n!==null)r.push(`${i} - ${Vt(n,e+4).trimStart()}`);else r.push(`${i} - ${String(n)}`)}else if(typeof s==="object")r.push(`${i}${o}:`),r.push(Vt(s,e+2));else r.push(`${i}${o}: ${String(s)}`)}return r.join(`
|
|
119
119
|
`)}function Ii(t){if(t.length===0)return"(empty)";let e=Object.keys(t[0]),i=e.map((n)=>Math.max(n.length,...t.map((m)=>String(m[n]??"").length))),r=e.map((n,m)=>n.toUpperCase().padEnd(i[m])).join(" "),o=i.map((n)=>"-".repeat(n)).join(" "),s=t.map((n)=>e.map((m,a)=>String(n[m]??"").padEnd(i[a])).join(" "));return[r,o,...s].join(`
|
|
120
|
-
`)}function Xe(t){return JSON.stringify(t,null,2)}function _(t){if(t==="json"||t==="text")return t;if(!process.stdout.isTTY)return"json";return"text"}function
|
|
121
|
-
`);return{}}}async function K(t){await
|
|
122
|
-
`,{mode:384}),Yi(i,e)}function Zt(t){let e=O(),i=t.apiKey||void 0,r=e.api_key,o=t.region||process.env.MINIMAX_REGION||void 0,s=e.region,n=o||s||"global",m=i||r,a=!o&&(!s||m!==void 0&&m!==e.api_key),u=t.baseUrl||process.env.MINIMAX_BASE_URL||e.base_url||W[n]||W.global,y=_(t.output||process.env.MINIMAX_OUTPUT||e.output),$=process.env.MINIMAX_TIMEOUT?Number(process.env.MINIMAX_TIMEOUT):void 0,h=$!==void 0&&Number.isFinite($)&&$>0?$:void 0,
|
|
120
|
+
`)}function Xe(t){return JSON.stringify(t,null,2)}function _(t){if(t==="json"||t==="text")return t;if(!process.stdout.isTTY)return"json";return"text"}function b(t,e){switch(e){case"json":return Xe(t);case"text":return Ke(t)}}function O(){let t=Q();if(!Ki(t))return{};try{return Ye(JSON.parse(zi(t,"utf-8")))}catch(e){let i=e;if(i instanceof SyntaxError||i.message.includes("JSON"))process.stderr.write(`Warning: config file is corrupted. Run 'mmx config set' to reset.
|
|
121
|
+
`);return{}}}async function K(t){await bt();let e=Q(),i=e+".tmp";Ji(i,JSON.stringify(t,null,2)+`
|
|
122
|
+
`,{mode:384}),Yi(i,e)}function Zt(t){let e=O(),i=t.apiKey||void 0,r=e.api_key,o=t.region||process.env.MINIMAX_REGION||void 0,s=e.region,n=o||s||"global",m=i||r,a=!o&&(!s||m!==void 0&&m!==e.api_key),u=t.baseUrl||process.env.MINIMAX_BASE_URL||e.base_url||W[n]||W.global,y=_(t.output||process.env.MINIMAX_OUTPUT||e.output),$=process.env.MINIMAX_TIMEOUT?Number(process.env.MINIMAX_TIMEOUT):void 0,h=$!==void 0&&Number.isFinite($)&&$>0?$:void 0,w=t.timeout??h??e.timeout??300;return{apiKey:i,fileApiKey:r,fileRegion:e.region,configPath:Q(),region:n,baseUrl:u,output:y,timeout:w,verbose:t.verbose||process.env.MINIMAX_VERBOSE==="1",quiet:t.quiet||!1,noColor:t.noColor||process.env.NO_COLOR!==void 0||!process.stdout.isTTY,yes:t.yes||!1,dryRun:t.dryRun||!1,nonInteractive:t.nonInteractive||!1,async:t.async||!1,needsRegionDetection:a}}function A(t){if(t?.nonInteractive===!0)return!1;if(process.env.CI)return!1;return process.stdout.isTTY===!0&&process.stdin.isTTY===!0}async function _n(t){try{let e=E(t.baseUrl),i=await v(t,{url:e});ot(i.model_remains||[],t)}catch{}}var vn=d({name:"auth login",description:"Authenticate via OAuth or API key",usage:"mmx auth login [--method oauth|api-key] [--api-key <key>] [--no-browser]",options:[{flag:"--method <method>",description:"Auth method: oauth (default), api-key"},{flag:"--api-key <key>",description:"API key to store"},{flag:"--no-browser",description:"Use device-code flow instead of browser"}],examples:["mmx auth login","mmx auth login --no-browser","mmx auth login --api-key sk-xxxxx","mmx auth login --method api-key --api-key sk-xxxxx"],async run(t,e){let i=process.env.MINIMAX_API_KEY;if(i&&!e.apiKey){let n=I(i);if(A({nonInteractive:t.nonInteractive})){let{confirm:m}=await Promise.resolve().then(() => (Tt(),qt));if(!await m({message:`Detected MINIMAX_API_KEY in environment (${n}).
|
|
123
123
|
You are already authenticated via env.
|
|
124
124
|
Do you still want to configure local persistent credentials?`,initialValue:!1}))process.stdout.write(`Login skipped. Using environment variables.
|
|
125
125
|
`),process.exit(0)}else process.stderr.write(`Warning: MINIMAX_API_KEY is already set in environment.
|
|
126
|
-
`)}if((e.apiKey?"api-key":e.method||"oauth")==="api-key"){let n=e.apiKey||t.apiKey;if(!n)throw new c("--api-key is required when using --method api-key.",l.USAGE,"mmx auth login --api-key sk-xxxxx");if(!t.dryRun){process.stderr.write("Testing key... ");try{let a={...t,apiKey:n};await v(a,{url:
|
|
126
|
+
`)}if((e.apiKey?"api-key":e.method||"oauth")==="api-key"){let n=e.apiKey||t.apiKey;if(!n)throw new c("--api-key is required when using --method api-key.",l.USAGE,"mmx auth login --api-key sk-xxxxx");if(!t.dryRun){process.stderr.write("Testing key... ");try{let a={...t,apiKey:n};await v(a,{url:E(a.baseUrl)}),process.stderr.write(`Valid
|
|
127
127
|
`)}catch{throw new c("API key validation failed.",l.AUTH,"Check that your key is valid and belongs to a Token Plan.")}let m=O();m.api_key=n,await K(m),process.stderr.write(`API key saved to ${Q()}
|
|
128
128
|
`),await _n({...t,apiKey:n})}else console.log("Would validate and save API key.");return}if(t.dryRun){console.log("Would start OAuth login flow.");return}let o;if(e.noBrowser)o=await ve();else o=await _e();let s={access_token:o.access_token,refresh_token:o.refresh_token,expires_at:new Date(Date.now()+o.expires_in*1000).toISOString(),token_type:"Bearer"};await rt(s),process.stderr.write(`Logged in successfully.
|
|
129
129
|
`),process.stderr.write(`Credentials saved to ~/.mmx/credentials.json
|
|
130
|
-
`),await _n({...t,apiKey:s.access_token})}});var fn=d({name:"auth status",description:"Show current authentication state and quota snapshot",usage:"mmx auth status",examples:["mmx auth status","mmx auth status --output json"],async run(t,e){try{let i=await dt(t),r=_(t.output);if(r!=="text"){let s={method:i.method,source:i.source};if(i.method==="oauth"){let n=await B();if(n){if(s.token_expires=n.expires_at,n.account)s.account=n.account}}else s.key=I(i.token);console.log(
|
|
131
|
-
`);try{let s=
|
|
132
|
-
Or set $MINIMAX_API_KEY`},i))}}});var Sn=d({name:"auth refresh",description:"Manually refresh OAuth token",usage:"mmx auth refresh",examples:["mmx auth refresh"],async run(t,e){let i=await B();if(!i)throw new c("Not applicable: not authenticated via OAuth.",l.USAGE,"Run mmx auth login first.");if(t.dryRun){console.log("Would refresh OAuth token.");return}let r=await Kt(i.refresh_token),o={access_token:r.access_token,refresh_token:r.refresh_token,expires_at:new Date(Date.now()+r.expires_in*1000).toISOString(),token_type:"Bearer",account:i.account};await rt(o);let s=_(t.output);if(t.quiet){console.log(o.expires_at);return}console.log(
|
|
130
|
+
`),await _n({...t,apiKey:s.access_token})}});var fn=d({name:"auth status",description:"Show current authentication state and quota snapshot",usage:"mmx auth status",examples:["mmx auth status","mmx auth status --output json"],async run(t,e){try{let i=await dt(t),r=_(t.output);if(r!=="text"){let s={method:i.method,source:i.source};if(i.method==="oauth"){let n=await B();if(n){if(s.token_expires=n.expires_at,n.account)s.account=n.account}}else s.key=I(i.token);console.log(b(s,r));return}console.log("Authentication Status:"),console.log(` Method: ${i.method}`),console.log(` Source: ${i.source}`);let o=i.token;if(console.log(` Key: ${I(o)}`),i.method==="oauth"){let s=await B();if(s){if(s.account)console.log(` Account: ${s.account}`);let n=new Date(s.expires_at),m=Math.round((n.getTime()-Date.now())/60000);console.log(` Expires in: ${m} minutes`)}}process.stderr.write(`Fetching quota snapshot...
|
|
131
|
+
`);try{let s=E(t.baseUrl),n=await v(t,{url:s,method:"GET"});ot(n.model_remains||[],t)}catch(s){console.log(` Quota fetch failed: ${s.message}`)}}catch{let i=_(t.output);console.log(b({authenticated:!1,message:"Not authenticated.",hint:`Run: mmx auth login
|
|
132
|
+
Or set $MINIMAX_API_KEY`},i))}}});var Sn=d({name:"auth refresh",description:"Manually refresh OAuth token",usage:"mmx auth refresh",examples:["mmx auth refresh"],async run(t,e){let i=await B();if(!i)throw new c("Not applicable: not authenticated via OAuth.",l.USAGE,"Run mmx auth login first.");if(t.dryRun){console.log("Would refresh OAuth token.");return}let r=await Kt(i.refresh_token),o={access_token:r.access_token,refresh_token:r.refresh_token,expires_at:new Date(Date.now()+r.expires_in*1000).toISOString(),token_type:"Bearer",account:i.account};await rt(o);let s=_(t.output);if(t.quiet){console.log(o.expires_at);return}console.log(b({status:"Token refreshed",expires:o.expires_at},s))}});var Rn=d({name:"auth logout",description:"Revoke tokens and clear stored credentials",usage:"mmx auth logout [--yes] [--dry-run]",options:[{flag:"--yes",description:"Skip confirmation prompt"}],examples:["mmx auth logout","mmx auth logout --dry-run","mmx auth logout --yes"],async run(t,e){let i=await B(),r=O(),o=!!r.api_key;if(t.dryRun){if(i)console.log("Would remove ~/.mmx/credentials.json");if(o)console.log("Would clear api_key from ~/.mmx/config.json");if(!i&&!o)console.log("No credentials to clear.");console.log("No changes made.");return}if(i)await be(),process.stderr.write(`Removed ~/.mmx/credentials.json
|
|
133
133
|
`);if(o)try{let s=r;delete s.api_key,await K(s),process.stderr.write(`Cleared api_key from ~/.mmx/config.json
|
|
134
134
|
`)}catch{}if(!i&&!o)process.stderr.write(`No credentials to clear.
|
|
135
135
|
`)}});async function*kn(t){let e=t.body?.getReader();if(!e)return;let i=new TextDecoder,r="";try{while(!0){let{done:o,value:s}=await e.read();if(o)break;r+=i.decode(s,{stream:!0});let n=r.split(`
|
|
@@ -137,30 +137,30 @@ Or set $MINIMAX_API_KEY`},i))}}});var Sn=d({name:"auth refresh",description:"Man
|
|
|
137
137
|
${$}`:$;break;case"event":m.event=$;break;case"id":m.id=$;break}}}if(r.trim()&&r.includes("data:")){let o=r.indexOf(":");if(o!==-1)yield{data:r.slice(o+1).trimStart()}}}finally{e.releaseLock()}}import{readFileSync as ue}from"fs";async function X(t){if(!A())return;let{defaultValue:e,message:i}=t,o=await(await Promise.resolve().then(() => (Tt(),qt))).text({message:i,default:e,placeholder:e});if(typeof o==="symbol")return;return o}async function gn(t){if(!A())return;let{message:e}=t,r=await(await Promise.resolve().then(() => (Tt(),qt))).confirm({message:e});if(typeof r==="symbol")return;return r}function pt(t,e){throw new c(`Missing required argument: --${t}
|
|
138
138
|
Hint: In non-interactive (CI / agent) environments all required flags must be provided.
|
|
139
139
|
In an interactive terminal, run without --${t} and the CLI will prompt for it.`,l.USAGE,e)}function Lr(t){let e=[],i;if(t.system)i=t.system;if(t.messagesFile){let r=t.messagesFile,o=r==="-"?ue("/dev/stdin","utf-8"):ue(r,"utf-8"),s=JSON.parse(o);for(let n of s)if(n.role==="system")i=typeof n.content==="string"?n.content:"";else e.push(n)}if(t.message){let r=new Set(["system","user","assistant"]),o=t.message;for(let s of o){let n=s.indexOf(":"),m=n!==-1?s.slice(0,n):"";if(r.has(m)){let a=s.slice(n+1);if(m==="system")i=a;else e.push({role:m,content:a})}else e.push({role:"user",content:s})}}return{system:i,messages:e}}function Fr(t){return t.filter((e)=>e.type==="text").map((e)=>e.text).join("")}var An=d({name:"text chat",description:"Send a chat completion (MiniMax Messages API)",usage:"mmx text chat --message <text> [flags]",options:[{flag:"--model <model>",description:"Model ID (default: MiniMax-M2.7)"},{flag:"--message <text>",description:"Message text (repeatable, prefix role: to set role)",required:!0,type:"array"},{flag:"--messages-file <path>",description:"JSON file with messages array (use - for stdin)"},{flag:"--system <text>",description:"System prompt"},{flag:"--max-tokens <n>",description:"Maximum tokens to generate (default: 4096)",type:"number"},{flag:"--temperature <n>",description:"Sampling temperature (0.0, 1.0]",type:"number"},{flag:"--top-p <n>",description:"Nucleus sampling threshold",type:"number"},{flag:"--stream",description:"Stream response tokens (default: on in TTY)"},{flag:"--tool <json-or-path>",description:"Tool definition as JSON or file path (repeatable)",type:"array"}],examples:['mmx text chat --message "What is MiniMax?"','mmx text chat --model MiniMax-M2.7-highspeed --system "You are a coding assistant." --message "Write fizzbuzz in Python"','mmx text chat --message "Hello" --message "assistant:Hi!" --message "How are you?"',"cat conversation.json | mmx text chat --messages-file - --stream",'mmx text chat --message "Hello" --output json'],async run(t,e){let{system:i,messages:r}=Lr(e),o=r;if(o.length===0)if(A({nonInteractive:t.nonInteractive})){let y=await X({message:"Enter your message:"});if(!y)process.stderr.write(`Chat cancelled.
|
|
140
|
-
`),process.exit(1);o=[{role:"user",content:y}]}else pt("message","mmx text chat --message <text>");let s=e.model||"MiniMax-M2.7",n=e.stream===!0||e.stream===void 0&&process.stdout.isTTY,m=_(t.output),a={model:s,messages:o,max_tokens:e.maxTokens??4096,stream:n};if(i)a.system=i;if(e.temperature!==void 0)a.temperature=e.temperature;if(e.topP!==void 0)a.top_p=e.topP;if(e.tool){let y=e.tool.map(($)=>{try{return JSON.parse($)}catch{let h=ue($,"utf-8");return JSON.parse(h)}});a.tools=y}if(t.dryRun){console.log(
|
|
140
|
+
`),process.exit(1);o=[{role:"user",content:y}]}else pt("message","mmx text chat --message <text>");let s=e.model||"MiniMax-M2.7",n=e.stream===!0||e.stream===void 0&&process.stdout.isTTY,m=_(t.output),a={model:s,messages:o,max_tokens:e.maxTokens??4096,stream:n};if(i)a.system=i;if(e.temperature!==void 0)a.temperature=e.temperature;if(e.topP!==void 0)a.top_p=e.topP;if(e.tool){let y=e.tool.map(($)=>{try{return JSON.parse($)}catch{let h=ue($,"utf-8");return JSON.parse(h)}});a.tools=y}if(t.dryRun){console.log(b({request:a},m));return}let u=je(t.baseUrl);if(n){let y=await P(t,{url:u,method:"POST",body:a,stream:!0,authStyle:"x-api-key"}),$="",h=!1,w=t.noColor?"":"\x1B[2m",f=t.noColor?"":"\x1B[0m",M=process.stdout.isTTY?process.stdout:process.stderr,J=process.stdout;for await(let nt of kn(y)){if(nt.data==="[DONE]")break;try{let q=JSON.parse(nt.data);if(q.type==="content_block_start"){if(q.content_block.type==="thinking")h=!0,M.write(`${w}Thinking:
|
|
141
141
|
`);else if(q.content_block.type==="text"&&h)M.write(`${f}
|
|
142
142
|
|
|
143
143
|
Response:
|
|
144
144
|
`),h=!1}else if(q.type==="content_block_delta"){if(q.delta.type==="text_delta")$+=q.delta.text,J.write(q.delta.text);else if(q.delta.type==="thinking_delta")M.write(q.delta.thinking)}}catch{}}if(h)M.write(f);if(J.write(`
|
|
145
|
-
`),m==="json")console.log(
|
|
146
|
-
`);Ot($,n,a,t.quiet)}});function eo(t){let e=t.match(/^(.+?)_[A-Z]/);return e?e[1]:t}function no(t,e){let i=e.toLowerCase();return t.filter((r)=>eo(r.voice_id).toLowerCase().includes(i))}var Mn=d({name:"speech voices",description:"List available system voices",usage:"mmx speech voices [--language <lang>]",options:[{flag:"--language <lang>",description:"Filter voices by language (e.g. english, korean, japanese)"}],examples:["mmx speech voices","mmx speech voices --language english","mmx speech voices --language korean","mmx speech voices --output json"],async run(t,e){let i=_(t.output);if(t.dryRun){console.log(
|
|
145
|
+
`),m==="json")console.log(b({content:$},m))}else{let y=await v(t,{url:u,method:"POST",body:a,authStyle:"x-api-key"}),$=Fr(y.content);if(t.quiet||m==="text")console.log($);else console.log(b(y,m))}}});import{writeFileSync as Dr}from"fs";function Ot(t,e,i,r){if(e)if(Dr(e,Buffer.from(t.data.audio,"hex")),r)console.log(e);else console.log(b({saved:e,duration_ms:t.extra_info?.audio_length,size_bytes:t.extra_info?.audio_size,sample_rate:t.extra_info?.audio_sample_rate},i));else{let o=t.data.audio_url??t.data.audio;if(r)console.log(o);else console.log(b({url:o,duration_ms:t.extra_info?.audio_length,size_bytes:t.extra_info?.audio_size},i))}}import{readFileSync as to}from"fs";function Gt(t){return to(t==="-"?"/dev/stdin":t,"utf-8")}var jn=d({name:"speech synthesize",description:"Synchronous TTS, up to 10k chars (speech-2.8-hd / 2.6 / 02)",usage:"mmx speech synthesize --text <text> [--out <path>] [flags]",options:[{flag:"--model <model>",description:"Model ID (default: speech-2.8-hd)"},{flag:"--text <text>",description:"Text to synthesize"},{flag:"--text-file <path>",description:"Read text from file (use - for stdin)"},{flag:"--voice <id>",description:"Voice ID (default: English_expressive_narrator)"},{flag:"--speed <n>",description:"Speech speed multiplier",type:"number"},{flag:"--volume <n>",description:"Volume level",type:"number"},{flag:"--pitch <n>",description:"Pitch adjustment",type:"number"},{flag:"--format <fmt>",description:"Audio format (default: mp3)"},{flag:"--sample-rate <hz>",description:"Sample rate (default: 32000)",type:"number"},{flag:"--bitrate <bps>",description:"Bitrate (default: 128000)",type:"number"},{flag:"--channels <n>",description:"Audio channels (default: 1)",type:"number"},{flag:"--language <code>",description:"Language boost"},{flag:"--subtitles",description:"Include subtitle timing data"},{flag:"--pronunciation <from/to>",description:"Custom pronunciation (repeatable)",type:"array"},{flag:"--out <path>",description:"Save audio to file (uses hex decoding)"},{flag:"--stream",description:"Stream raw audio to stdout"}],examples:['mmx speech synthesize --text "Hello, world!"','mmx speech synthesize --text "Hello, world!" --out hello.mp3','echo "Breaking news." | mmx speech synthesize --text-file - --out news.mp3','mmx speech synthesize --text "Stream" --stream | mpv --no-terminal -'],async run(t,e){let i=e.text??e._positional?.[0];if(e.textFile)i=Gt(e.textFile);if(!i)throw new c("--text or --text-file is required.",l.USAGE,'mmx speech synthesize --text "Hello" --out hello.mp3');let r=e.model||"speech-2.8-hd",o=e.voice||"English_expressive_narrator",s=new Date().toISOString().slice(0,19).replace(/[T:]/g,"-"),n=e.out??`speech_${s}.mp3`,m="hex",a=_(t.output),u={model:r,text:i,voice_setting:{voice_id:o,speed:e.speed??void 0,vol:e.volume??void 0,pitch:e.pitch??void 0},audio_setting:{format:e.format||"mp3",sample_rate:e.sampleRate??32000,bitrate:e.bitrate??128000,channel:e.channels??1},output_format:m,stream:e.stream===!0};if(e.language)u.language_boost=e.language;if(e.subtitles)u.subtitle=!0;if(e.pronunciation)u.pronunciation_dict=e.pronunciation.map((h)=>{let[w,f]=h.split("/");return{tone:f||w,text:w}});if(t.dryRun){console.log(b({request:u},a));return}let y=Me(t.baseUrl);if(e.stream){let w=(await P(t,{url:y,method:"POST",body:u,stream:!0})).body?.getReader();if(!w)throw new c("No response body",l.GENERAL);while(!0){let{done:f,value:g}=await w.read();if(f)break;process.stdout.write(g)}w.releaseLock();return}let $=await v(t,{url:y,method:"POST",body:u});if(!t.quiet)process.stderr.write(`[Model: ${r}]
|
|
146
|
+
`);Ot($,n,a,t.quiet)}});function eo(t){let e=t.match(/^(.+?)_[A-Z]/);return e?e[1]:t}function no(t,e){let i=e.toLowerCase();return t.filter((r)=>eo(r.voice_id).toLowerCase().includes(i))}var Mn=d({name:"speech voices",description:"List available system voices",usage:"mmx speech voices [--language <lang>]",options:[{flag:"--language <lang>",description:"Filter voices by language (e.g. english, korean, japanese)"}],examples:["mmx speech voices","mmx speech voices --language english","mmx speech voices --language korean","mmx speech voices --output json"],async run(t,e){let i=_(t.output);if(t.dryRun){console.log(b({request:{voice_type:"system"}},i));return}let o=(await v(t,{url:qe(t.baseUrl),method:"POST",body:{voice_type:"system"}})).system_voice??[],s=e.language;if(s){let n=no(o,s);if(i!=="text"){console.log(b(n,i));return}for(let m of n){let a=m.description?.join("; ")||"",u=m.voice_name?` (${m.voice_name})`:"";if(console.log(` ${m.voice_id}${u}`),a)console.log(` ${a}`)}}else{if(i!=="text"){console.log(b(o.map((n)=>n.voice_id),i));return}for(let n of o)console.log(n.voice_id)}}});import{createWriteStream as io,unlinkSync as ro}from"fs";var qn=["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"];function Tn(t){let e=process.stderr.isTTY,i=0,r=null,o=t;return{start(){if(!e)return;r=setInterval(()=>{process.stderr.write(`\r${qn[i%qn.length]} ${o}`),i++},80)},update(s){o=s},stop(s){if(r)clearInterval(r),r=null;if(e){if(process.stderr.write("\r\x1B[K"),s)process.stderr.write(`${s}
|
|
147
147
|
`)}}}}function On(t,e=""){let i=process.stderr.isTTY,r=30;return{update(o){if(!i)return;let s=Math.min(1,o/t),n=Math.round(30*s),m=30-n,a="█".repeat(n)+"░".repeat(m),u=`${Math.round(s*100)}%`;process.stderr.write(`\r${e} ${a} ${u}`)},finish(){if(i)process.stderr.write(`
|
|
148
148
|
`)}}}async function tt(t,e,i){let r=await fetch(t);if(!r.ok)throw new c(`Download failed: HTTP ${r.status}`,l.GENERAL);let o=Number(r.headers.get("content-length")||0),s=r.body?.getReader();if(!s)throw new c("No response body",l.GENERAL);let n=io(e),m=o>0&&!i?.quiet?On(o,"Downloading"):null,a=0,u=!1;try{let y=new Promise(($,h)=>{n.on("error",h)});while(!0){let{done:$,value:h}=await Promise.race([s.read(),y]);if($)break;if(!n.write(h))await new Promise((f)=>n.once("drain",f));a+=h.byteLength,m?.update(a)}u=!0}finally{if(s.releaseLock(),m?.finish(),await new Promise((y,$)=>{n.on("finish",y),n.on("error",$),n.end()}),!u)try{ro(e)}catch{}}return{size:a}}function Nt(t){if(t<1024)return`${t} B`;if(t<1048576)return`${(t/1024).toFixed(1)} KB`;if(t<1073741824)return`${(t/1048576).toFixed(1)} MB`;return`${(t/1073741824).toFixed(1)} GB`}import{mkdirSync as oo,existsSync as so,readFileSync as po}from"fs";import{join as mo,resolve as ao,extname as uo}from"path";var $o={".jpg":"image/jpeg",".jpeg":"image/jpeg",".png":"image/png",".webp":"image/webp"},Gn=d({name:"image generate",description:"Generate images (image-01)",usage:"mmx image generate --prompt <text> [flags]",options:[{flag:"--prompt <text>",description:"Image description",required:!0},{flag:"--aspect-ratio <ratio>",description:"Aspect ratio (e.g. 16:9, 1:1)"},{flag:"--n <count>",description:"Number of images to generate (default: 1)",type:"number"},{flag:"--subject-ref <params>",description:"Subject reference (type=character,image=path)"},{flag:"--out-dir <dir>",description:"Download images to directory"},{flag:"--out-prefix <prefix>",description:"Filename prefix (default: image)"}],examples:['mmx image generate --prompt "A cat in a spacesuit on Mars" --aspect-ratio 16:9','mmx image generate --prompt "Logo design" --n 3 --out-dir ./generated/','mmx image generate --prompt "Mountain landscape" --quiet'],async run(t,e){let i=e.prompt??e._positional?.[0];if(!i)if(A({nonInteractive:t.nonInteractive})){let $=await X({message:"Enter your image prompt:"});if(!$)process.stderr.write(`Image generation cancelled.
|
|
149
|
-
`),process.exit(1);i=$}else pt("prompt","mmx image generate --prompt <text>");let r={model:"image-01",prompt:i,aspect_ratio:e.aspectRatio||void 0,n:e.n??1};if(e.subjectRef){let $=e.subjectRef,h=Object.fromEntries($.split(",").map((f)=>{let g=f.indexOf("=");if(g===-1)return[f,""];return[f.slice(0,g),f.slice(g+1)]})),
|
|
150
|
-
`);let a=e.outDir??".";if(!so(a))oo(a,{recursive:!0});let u=e.outPrefix||"image",y=[];for(let $=0;$<m.length;$++){let h=`${u}_${String($+1).padStart(3,"0")}.jpg`,
|
|
151
|
-
`));else console.log(
|
|
152
|
-
`),process.exit(1);i=k}else pt("prompt","mmx video generate --prompt <text>");let r=e.model||"MiniMax-Hailuo-2.3",o=_(t.output),s={model:r,prompt:i};if(e.firstFrame){let k=e.firstFrame;if(k.startsWith("http"))s.first_frame_image=k;else{let mt=lo(k),lt=co(k).toLowerCase(),ct=yo[lt]||"image/jpeg";s.first_frame_image=`data:${ct};base64,${mt.toString("base64")}`}}if(e.callbackUrl)s.callback_url=e.callbackUrl;if(t.dryRun){console.log(
|
|
149
|
+
`),process.exit(1);i=$}else pt("prompt","mmx image generate --prompt <text>");let r={model:"image-01",prompt:i,aspect_ratio:e.aspectRatio||void 0,n:e.n??1};if(e.subjectRef){let $=e.subjectRef,h=Object.fromEntries($.split(",").map((f)=>{let g=f.indexOf("=");if(g===-1)return[f,""];return[f.slice(0,g),f.slice(g+1)]})),w={type:h.type||"character"};if(h.image)if(h.image.startsWith("http"))w.image_url=h.image;else{let f=ao(h.image),g=po(f),M=uo(f).toLowerCase(),J=$o[M]||"image/jpeg";w.image_file=`data:${J};base64,${g.toString("base64")}`}r.subject_reference=[w]}let o=_(t.output);if(t.dryRun){console.log(b({request:r},o));return}let s=Te(t.baseUrl),n=await v(t,{url:s,method:"POST",body:r}),m=n.data.image_urls||[];if(!t.quiet)process.stderr.write(`[Model: image-01]
|
|
150
|
+
`);let a=e.outDir??".";if(!so(a))oo(a,{recursive:!0});let u=e.outPrefix||"image",y=[];for(let $=0;$<m.length;$++){let h=`${u}_${String($+1).padStart(3,"0")}.jpg`,w=mo(a,h);await tt(m[$],w,{quiet:t.quiet}),y.push(w)}if(t.quiet)console.log(y.join(`
|
|
151
|
+
`));else console.log(b({id:n.data.task_id,saved:y,success_count:n.data.success_count,failed_count:n.data.failed_count},o))}});async function Nn(t,e){let i=Date.now()+e.timeoutSec*1000,r=Tn("Polling...");if(!t.quiet)r.start();try{while(Date.now()<i){let o=await v(t,{url:e.url});if(e.getStatus&&!t.quiet)r.update(`Status: ${e.getStatus(o)}`);if(e.isComplete(o))return r.stop("Done."),o;if(e.isFailed(o))throw r.stop("Failed."),new c("Task failed.",l.GENERAL);await new Promise((s)=>setTimeout(s,e.intervalSec*1000))}}finally{r.stop()}throw new c("Polling timed out.",l.TIMEOUT,"Try increasing --timeout or check task status manually.")}import{readFileSync as lo}from"fs";import{extname as co}from"path";var yo={".jpg":"image/jpeg",".jpeg":"image/jpeg",".png":"image/png",".webp":"image/webp"},Bn=d({name:"video generate",description:"Generate a video (Hailuo-2.3 / 2.3-Fast)",usage:"mmx video generate --prompt <text> [flags]",options:[{flag:"--model <model>",description:"Model ID (default: MiniMax-Hailuo-2.3)"},{flag:"--prompt <text>",description:"Video description",required:!0},{flag:"--first-frame <path-or-url>",description:"First frame image"},{flag:"--callback-url <url>",description:"Webhook URL for completion notification"},{flag:"--download <path>",description:"Save video to file on completion"},{flag:"--no-wait",description:"Return task ID immediately without waiting"},{flag:"--async",description:"Return task ID immediately (agent/CI mode, same as --no-wait but explicit)"},{flag:"--poll-interval <seconds>",description:"Polling interval when waiting (default: 5)",type:"number"}],examples:['mmx video generate --prompt "A man reads a book. Static shot."','mmx video generate --prompt "Ocean waves at sunset." --download sunset.mp4','mmx video generate --prompt "A robot painting." --async --quiet','mmx video generate --prompt "A robot painting." --no-wait --quiet'],async run(t,e){let i=e.prompt;if(!i)if(A({nonInteractive:t.nonInteractive})){let k=await X({message:"Enter your video prompt:"});if(!k)process.stderr.write(`Video generation cancelled.
|
|
152
|
+
`),process.exit(1);i=k}else pt("prompt","mmx video generate --prompt <text>");let r=e.model||"MiniMax-Hailuo-2.3",o=_(t.output),s={model:r,prompt:i};if(e.firstFrame){let k=e.firstFrame;if(k.startsWith("http"))s.first_frame_image=k;else{let mt=lo(k),lt=co(k).toLowerCase(),ct=yo[lt]||"image/jpeg";s.first_frame_image=`data:${ct};base64,${mt.toString("base64")}`}}if(e.callbackUrl)s.callback_url=e.callbackUrl;if(t.dryRun){console.log(b({request:s},o));return}let n=Oe(t.baseUrl),a=(await v(t,{url:n,method:"POST",body:s})).task_id;if(!t.quiet&&!e.noWait&&!t.async)process.stderr.write(`[Model: ${r}]
|
|
153
153
|
`);else if(!t.quiet)process.stderr.write(`[Model: ${r}]
|
|
154
154
|
`);if(e.noWait||t.async){process.stdout.write(JSON.stringify({taskId:a})),process.stdout.write(`
|
|
155
|
-
`);return}let u=e.pollInterval??5,y=_t(t.baseUrl,a),$=await Nn(t,{url:y,intervalSec:u,timeoutSec:t.timeout,isComplete:(k)=>k.status==="Success",isFailed:(k)=>k.status==="Failed",getStatus:(k)=>k.status});if(!$.file_id)throw new c("Task completed but no file_id returned.",l.GENERAL);let
|
|
156
|
-
`)}});var In=d({name:"video task get",description:"Query video task status",usage:"mmx video task get --task-id <id>",options:[{flag:"--task-id <id>",description:"Video generation task ID"}],examples:["mmx video task get --task-id 106916112212032","mmx video task get --task-id 106916112212032 --output json"],async run(t,e){let i=e.taskId;if(!i)throw new c("--task-id is required.",l.USAGE,"mmx video task get --task-id <id>");if(t.dryRun){console.log(`Would query task: ${i}`);return}let r=_t(t.baseUrl,i),o=await v(t,{url:r}),s=_(t.output);if(t.quiet){console.log(o.status);return}console.log(
|
|
157
|
-
`);Ot(h,m,u,t.quiet)}});var Yn=d({name:"search query",description:"Search the web via MiniMax",usage:"mmx search query --q <query>",options:[{flag:"--q <query>",description:"Search query string"}],examples:['mmx search query --q "MiniMax AI"','mmx search query --q "latest news" --output json'],async run(t,e){let i=e.q??e._positional?.[0];if(!i)throw new c("--q is required.",l.USAGE,'mmx search query --q "your search query"');let r=_(t.output);if(t.dryRun){console.log(
|
|
158
|
-
`),process.exit(1);if(!u.includes(".")&&!u.startsWith("http"))r=u;else i=u}else throw new c("Missing required argument. Must provide either --image or --file-id.",l.USAGE,"mmx vision describe --image <path> OR --file-id <id>");else if(i&&r)throw new c("Conflicting arguments: cannot provide both --image and --file-id.",l.USAGE);let s=_(t.output);if(t.dryRun){process.stdout.write(
|
|
159
|
-
`);return}let n=Be(t.baseUrl),m={prompt:o};if(r)m.file_id=r;else if(i){let u=await _o(i);m.image_url=u}let a=await v(t,{url:n,method:"POST",body:m});if(s!=="text"){process.stdout.write(
|
|
155
|
+
`);return}let u=e.pollInterval??5,y=_t(t.baseUrl,a),$=await Nn(t,{url:y,intervalSec:u,timeoutSec:t.timeout,isComplete:(k)=>k.status==="Success",isFailed:(k)=>k.status==="Failed",getStatus:(k)=>k.status});if(!$.file_id)throw new c("Task completed but no file_id returned.",l.GENERAL);let w=(await v(t,{url:vt(t.baseUrl,$.file_id)})).file?.download_url;if(!w)throw new c("No download URL available for this file.",l.GENERAL);if(e.download){let k=e.download,{size:mt}=await tt(w,k,{quiet:t.quiet});if(t.quiet)console.log(k);else console.log(b({task_id:a,status:"Success",file_id:$.file_id,saved:k,size:Nt(mt)},o));return}let f=await import("os"),{join:g}=await import("path"),M=g(f.tmpdir(),"mmx-video"),{existsSync:J,mkdirSync:nt}=await import("fs");if(!J(M))nt(M,{recursive:!0});let q=g(M,`${a}.mp4`);await tt(w,q,{quiet:t.quiet}),process.stdout.write(q),process.stdout.write(`
|
|
156
|
+
`)}});var In=d({name:"video task get",description:"Query video task status",usage:"mmx video task get --task-id <id>",options:[{flag:"--task-id <id>",description:"Video generation task ID"}],examples:["mmx video task get --task-id 106916112212032","mmx video task get --task-id 106916112212032 --output json"],async run(t,e){let i=e.taskId;if(!i)throw new c("--task-id is required.",l.USAGE,"mmx video task get --task-id <id>");if(t.dryRun){console.log(`Would query task: ${i}`);return}let r=_t(t.baseUrl,i),o=await v(t,{url:r}),s=_(t.output);if(t.quiet){console.log(o.status);return}console.log(b({task_id:o.task_id,status:o.status,file_id:o.file_id,video_width:o.video_width,video_height:o.video_height},s))}});var zn=d({name:"video download",description:"Download a completed video by file ID",usage:"mmx video download --file-id <id> --out <path>",options:[{flag:"--file-id <id>",description:"File ID to download"},{flag:"--out <path>",description:"Output file path"}],examples:["mmx video download --file-id 176844028768320 --out video.mp4","mmx video download --file-id 176844028768320 --out video.mp4 --quiet"],async run(t,e){let i=e.fileId;if(!i)throw new c("--file-id is required.",l.USAGE,"mmx video download --file-id <id> --out <path>");let r=e.out;if(!r)throw new c("--out is required.",l.USAGE,"mmx video download --file-id <id> --out video.mp4");if(t.dryRun){console.log(`Would download file ${i} to ${r}`);return}let o=vt(t.baseUrl,i),n=(await v(t,{url:o})).file?.download_url;if(!n)throw new c("No download URL available for this file.",l.GENERAL,"The file may still be processing. Check task status first.");let{size:m}=await tt(n,r,{quiet:t.quiet}),a=_(t.output);if(t.quiet){console.log(r);return}console.log(b({saved:r,size:Nt(m)},a))}});var Jn=d({name:"music generate",description:"Generate a song (music-2.5)",usage:"mmx music generate --prompt <text> (--lyrics <text> | --instrumental) [--out <path>] [flags]",options:[{flag:"--prompt <text>",description:"Music style description (can be detailed — see examples)"},{flag:"--lyrics <text>",description:'Song lyrics with structure tags. Use "无歌词" for instrumental music. Cannot be used with --instrumental.'},{flag:"--lyrics-file <path>",description:'Read lyrics from file. Use "无歌词" for instrumental. (use - for stdin)'},{flag:"--vocals <text>",description:'Vocal style, e.g. "warm male baritone", "bright female soprano", "duet with harmonies"'},{flag:"--genre <text>",description:"Music genre, e.g. folk, pop, jazz"},{flag:"--mood <text>",description:"Mood or emotion, e.g. warm, melancholic, uplifting"},{flag:"--instruments <text>",description:'Instruments to feature, e.g. "acoustic guitar, piano"'},{flag:"--tempo <text>",description:"Tempo description, e.g. fast, slow, moderate"},{flag:"--bpm <number>",description:"Exact tempo in beats per minute",type:"number"},{flag:"--key <text>",description:"Musical key, e.g. C major, A minor, G sharp"},{flag:"--avoid <text>",description:"Elements to avoid in the generated music"},{flag:"--use-case <text>",description:'Use case context, e.g. "background music for video", "theme song"'},{flag:"--structure <text>",description:'Song structure, e.g. "verse-chorus-verse-bridge-chorus"'},{flag:"--references <text>",description:'Reference tracks or artists, e.g. "similar to Ed Sheeran, Taylor Swift"'},{flag:"--extra <text>",description:"Additional fine-grained requirements not covered above"},{flag:"--instrumental",description:"Generate instrumental music (no vocals)"},{flag:"--aigc-watermark",description:"Embed AI-generated content watermark in audio for content provenance"},{flag:"--format <fmt>",description:"Audio format (default: mp3)"},{flag:"--sample-rate <hz>",description:"Sample rate (default: 44100)",type:"number"},{flag:"--bitrate <bps>",description:"Bitrate (default: 256000)",type:"number"},{flag:"--stream",description:"Stream raw audio to stdout"},{flag:"--out <path>",description:"Save audio to file (uses hex decoding)"}],examples:['mmx music generate --prompt "Upbeat pop" --lyrics "La la la..." --out summer.mp3','mmx music generate --prompt "Indie folk, melancholic" --lyrics-file song.txt --out my_song.mp3',"# Detailed prompt with vocal characteristics — music-2.5 responds well to rich descriptions:",'mmx music generate --prompt "Warm morning folk" --vocals "male and female duet, harmonies in chorus" --instruments "acoustic guitar, piano" --bpm 95 --lyrics-file song.txt --out duet.mp3',"# Instrumental (use --instrumental flag):",'mmx music generate --prompt "Cinematic orchestral, building tension" --instrumental --out bgm.mp3','# Or specify "无歌词" in lyrics:','mmx music generate --prompt "Cinematic orchestral" --lyrics "无歌词" --out bgm.mp3'],async run(t,e){let{prompt:i,lyrics:r}=e;if(e.lyricsFile)r=Gt(e.lyricsFile);if(e.instrumental&&(r||e.lyricsFile))throw new c("Cannot use --instrumental with --lyrics or --lyrics-file. For instrumental music, simply use --instrumental without --lyrics.",l.USAGE,"mmx music generate --prompt <style> --instrumental");let o=[];if(e.vocals)o.push(`Vocals: ${e.vocals}`);if(e.genre)o.push(`Genre: ${e.genre}`);if(e.mood)o.push(`Mood: ${e.mood}`);if(e.instruments)o.push(`Instruments: ${e.instruments}`);if(e.tempo)o.push(`Tempo: ${e.tempo}`);if(e.bpm)o.push(`BPM: ${e.bpm}`);if(e.key)o.push(`Key: ${e.key}`);if(e.avoid)o.push(`Avoid: ${e.avoid}`);if(e.useCase)o.push(`Use case: ${e.useCase}`);if(e.structure)o.push(`Structure: ${e.structure}`);if(e.references)o.push(`References: ${e.references}`);if(e.extra)o.push(`Extra: ${e.extra}`);if(r==="无歌词"||r==="no lyrics")r="[intro] [outro]",o.push("Style: instrumental, no vocals, pure music");if(e.instrumental)r="[intro] [outro]",o.push("Style: instrumental, no vocals, pure music");if(!i&&!r)throw new c("At least one of --prompt or --lyrics is required.",l.USAGE,"mmx music generate --prompt <text> --lyrics <text>");if(!r?.trim())throw new c('The API requires lyrics. Add --lyrics or --lyrics-file, or use --instrumental (or --lyrics "无歌词") for instrumental output.',l.USAGE,"mmx music generate --prompt <text> --lyrics <text>");if(o.length>0){let w=o.join(". ");i=i?`${i}. ${w}`:w}let s=new Date().toISOString().slice(0,19).replace(/[T:]/g,"-"),n=e.format||"mp3",m=e.out??`music_${s}.${n}`,a="hex",u=_(t.output),y={model:"music-2.5",prompt:i,lyrics:r,audio_setting:{format:e.format||"mp3",sample_rate:e.sampleRate??44100,bitrate:e.bitrate??256000},output_format:a,stream:e.stream===!0};if(e.aigcWatermark)y.aigc_watermark=!0;if(t.dryRun){console.log(b({request:y},u));return}let $=Ge(t.baseUrl);if(e.stream){let f=(await P(t,{url:$,method:"POST",body:y,stream:!0})).body?.getReader();if(!f)throw new c("No response body",l.GENERAL);while(!0){let{done:g,value:M}=await f.read();if(g)break;process.stdout.write(M)}f.releaseLock();return}let h=await v(t,{url:$,method:"POST",body:y});if(!t.quiet)process.stderr.write(`[Model: music-2.5]
|
|
157
|
+
`);Ot(h,m,u,t.quiet)}});var Yn=d({name:"search query",description:"Search the web via MiniMax",usage:"mmx search query --q <query>",options:[{flag:"--q <query>",description:"Search query string"}],examples:['mmx search query --q "MiniMax AI"','mmx search query --q "latest news" --output json'],async run(t,e){let i=e.q??e._positional?.[0];if(!i)throw new c("--q is required.",l.USAGE,'mmx search query --q "your search query"');let r=_(t.output);if(t.dryRun){console.log(b({request:{q:i}},r));return}let o=Ne(t.baseUrl),s=await v(t,{url:o,method:"POST",body:{q:i}}),n=s.organic||[];if(r!=="text"){console.log(b(s,r));return}if(t.quiet){for(let m of n)console.log(`${m.title} ${m.link}`);return}if(n.length===0){console.log("No results found.");return}for(let m of n){if(console.log(`${m.title}`),console.log(` ${m.link}`),m.snippet)console.log(` ${m.snippet}`);if(m.date)console.log(` ${m.date}`);console.log("")}}});import{readFileSync as xo,existsSync as ho}from"fs";import{extname as wo}from"path";var bo={".jpg":"image/jpeg",".jpeg":"image/jpeg",".png":"image/png",".webp":"image/webp"};async function _o(t){if(t.startsWith("data:"))return t;if(t.startsWith("http://")||t.startsWith("https://")){let o=await fetch(t);if(!o.ok)throw new c(`Failed to download image: HTTP ${o.status}`,l.GENERAL);let n=(o.headers.get("content-type")||"image/jpeg").split(";")[0].trim(),m=await o.arrayBuffer(),a=Buffer.from(m).toString("base64");return`data:${n};base64,${a}`}if(!ho(t))throw new c(`File not found: ${t}`,l.USAGE);let e=wo(t).toLowerCase(),i=bo[e];if(!i)throw new c(`Unsupported image format "${e}". Supported: jpg, jpeg, png, webp`,l.USAGE);let r=xo(t);return`data:${i};base64,${r.toString("base64")}`}var Kn=d({name:"vision describe",description:"Describe an image using MiniMax VLM",usage:"mmx vision describe (--image <path-or-url> | --file-id <id>) [--prompt <text>]",options:[{flag:"--image <path-or-url>",description:"Local image path or URL (base64 encoded automatically)"},{flag:"--file-id <id>",description:"Pre-uploaded file ID (skips base64 conversion)"},{flag:"--prompt <text>",description:'Question about the image (default: "Describe the image.")'}],examples:["mmx vision describe --image photo.jpg",'mmx vision describe --image https://example.com/photo.jpg --prompt "What breed is this dog?"','mmx vision describe --file-id file-123456789 --prompt "Extract the text"'],async run(t,e){let i=e.image??e._positional?.[0],r=e.fileId,o=e.prompt||"Describe the image.";if(!i&&!r)if(A({nonInteractive:t.nonInteractive})){let u=await X({message:"Enter image path, URL, or File ID:"});if(!u)process.stderr.write(`Vision describe cancelled.
|
|
158
|
+
`),process.exit(1);if(!u.includes(".")&&!u.startsWith("http"))r=u;else i=u}else throw new c("Missing required argument. Must provide either --image or --file-id.",l.USAGE,"mmx vision describe --image <path> OR --file-id <id>");else if(i&&r)throw new c("Conflicting arguments: cannot provide both --image and --file-id.",l.USAGE);let s=_(t.output);if(t.dryRun){process.stdout.write(b({request:{prompt:o,image:i,fileId:r}},s)+`
|
|
159
|
+
`);return}let n=Be(t.baseUrl),m={prompt:o};if(r)m.file_id=r;else if(i){let u=await _o(i);m.image_url=u}let a=await v(t,{url:n,method:"POST",body:m});if(s!=="text"){process.stdout.write(b(a,s)+`
|
|
160
160
|
`);return}process.stdout.write(a.content+`
|
|
161
|
-
`)}});var Xn=d({name:"quota show",description:"Display Token Plan usage and remaining quotas",usage:"mmx quota show",examples:["mmx quota show","mmx quota show --output json"],async run(t,e){if(t.dryRun){console.log("Would fetch quota information.");return}let i=
|
|
161
|
+
`)}});var Xn=d({name:"quota show",description:"Display Token Plan usage and remaining quotas",usage:"mmx quota show",examples:["mmx quota show","mmx quota show --output json"],async run(t,e){if(t.dryRun){console.log("Would fetch quota information.");return}let i=E(t.baseUrl),r=await v(t,{url:i}),o=r.model_remains||[],s=_(e.output);if(s!=="text"){console.log(b(r,s));return}if(t.quiet){for(let n of o){let m=n.current_interval_total_count-n.current_interval_usage_count;console.log(`${n.model_name} ${n.current_interval_usage_count} ${n.current_interval_total_count} ${m}`)}return}ot(o,t)}});var Qn=d({name:"config show",description:"Display current configuration",usage:"mmx config show",examples:["mmx config show","mmx config show --output json"],async run(t,e){let i=O(),r=_(t.output),o={region:t.region,base_url:t.baseUrl,output:t.output,timeout:t.timeout,config_file:Q()};if(i.api_key)o.api_key=I(i.api_key);console.log(b(o,r))}});var Vn=["region","base_url","output","timeout","api_key"],Zn=d({name:"config set",description:"Set a config value",usage:"mmx config set --key <key> --value <value>",options:[{flag:"--key <key>",description:"Config key (region, base_url, output, timeout, api_key)"},{flag:"--value <value>",description:"Value to set"}],examples:["mmx config set --key output --value json","mmx config set --key timeout --value 600","mmx config set --key base_url --value https://api-uw.minimax.io"],async run(t,e){let{key:i,value:r}=e;if(!i||r===void 0)throw new c("--key and --value are required.",l.USAGE,"mmx config set --key <key> --value <value>");if(!Vn.includes(i))throw new c(`Invalid config key "${i}". Valid keys: ${Vn.join(", ")}`,l.USAGE);if(i==="region"&&!["global","cn"].includes(r))throw new c(`Invalid region "${r}". Valid values: global, cn`,l.USAGE);if(i==="output"&&!["text","json"].includes(r))throw new c(`Invalid output format "${r}". Valid values: text, json`,l.USAGE);if(i==="timeout"){let n=Number(r);if(isNaN(n)||n<=0)throw new c(`Invalid timeout "${r}". Must be a positive number.`,l.USAGE)}let o=_(t.output);if(t.dryRun){console.log(b({would_set:{[i]:r}},o));return}let s=O();if(s[i]=i==="timeout"?Number(r):r,await K(s),!t.quiet)console.log(b({[i]:s[i]},o))}});function vo(t){let e=t.match(/^--([a-zA-Z0-9-]+)/),i=e?e[1]:"",r=i.replace(/-([a-zA-Z0-9])/g,(n,m)=>m.toUpperCase()),o="string",s=!1;if(!t.includes("<")&&!t.includes("["))o="boolean";else if(t.includes("<n>")||t.includes("<hz>")||t.includes("<bps>")||t.includes("<count>"))o="number";if(t.toLowerCase().includes("repeatable"))s=!0;return{name:r,kebabName:i,inferredType:o,isArray:s}}function $e(t){let i={name:`mmx_${t.name.replace(/ /g,"_")}`,description:t.description,input_schema:{type:"object",properties:{},required:[]}};if(t.options)for(let r of t.options){let{name:o,inferredType:s,isArray:n}=vo(r.flag);if(!o)continue;let m=r.type,a=n?"array":m??s,u={description:r.description};if(a==="array")u.type="array",u.items={type:"string"};else u.type=a;let y=i.input_schema;if(y.properties[o]=u,r.required)y.required.push(o)}return i}var fo=["auth ","config ","update"],Wn=d({name:"config export-schema",description:"Export all (or one) CLI command(s) as Anthropic/OpenAI-compatible JSON tool schemas",usage:'mmx config export-schema [--command "<name>"]',options:[{flag:"--command <name>",description:'Export schema for a specific command only (e.g. "image generate")'}],examples:["mmx config export-schema",'mmx config export-schema --command "video generate"'],async run(t,e){let i=e.command;if(i){try{let{command:s}=C.resolve(i.split(" ")),n=$e(s);process.stdout.write(JSON.stringify(n,null,2)+`
|
|
162
162
|
`)}catch{throw new c(`Command "${i}" not found.`,l.USAGE)}return}let o=C.getAllCommands().filter((s)=>!fo.some((n)=>s.name.startsWith(n))).map((s)=>$e(s));process.stdout.write(JSON.stringify(o,null,2)+`
|
|
163
|
-
`)}});var So="1.0.
|
|
163
|
+
`)}});var So="1.0.3",Hn=d({name:"update",description:"Update mmx to the latest version",usage:"mmx update",examples:["mmx update"],async run(){process.stderr.write(`Current version: ${So}
|
|
164
164
|
|
|
165
165
|
`),process.stderr.write(`Run:
|
|
166
166
|
`),process.stderr.write(` npm update -g mmx-cli
|
|
@@ -169,62 +169,60 @@ Response:
|
|
|
169
169
|
`);throw new c(`Unknown command: mmx ${t.join(" ")}
|
|
170
170
|
|
|
171
171
|
Available commands:
|
|
172
|
-
${r}`,l.USAGE,`mmx ${i.join(" ")} --help`)}throw new c(`Unknown command: mmx ${t.join(" ")}`,l.USAGE,"mmx --help")}printHelp(t,e=process.stdout){if(t.length===0){this.printRootHelp(e);return}let i=this.root;for(let
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
`),e.write(
|
|
176
|
-
`),this.printChildren(i,
|
|
177
|
-
`)}printRootHelp(t){t.write(`
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
--
|
|
201
|
-
--
|
|
202
|
-
--
|
|
203
|
-
--
|
|
204
|
-
--
|
|
205
|
-
--
|
|
206
|
-
--
|
|
207
|
-
--
|
|
208
|
-
--
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
--help
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
Add --help after any command to see its full list of options, defaults,
|
|
215
|
-
and usage examples. For example: mmx text chat --help
|
|
216
|
-
`)}printCommandHelp(t,e){if(e.write(`
|
|
172
|
+
${r}`,l.USAGE,`mmx ${i.join(" ")} --help`)}throw new c(`Unknown command: mmx ${t.join(" ")}`,l.USAGE,"mmx --help")}bold=(t,e)=>e.isTTY?`\x1B[1m${t}\x1B[0m`:t;accent=(t,e)=>e.isTTY?`\x1B[38;2;248;103;58m${t}\x1B[0m`:t;dim=(t,e)=>e.isTTY?`\x1B[2m${t}\x1B[0m`:t;printHelp(t,e=process.stdout){if(t.length===0){this.printRootHelp(e);return}let i=this.root;for(let o of t){let s=i.children.get(o);if(!s){this.printRootHelp(e);return}i=s}if(i.command){this.printCommandHelp(i.command,e);return}let r=t.join(" ");e.write(`
|
|
173
|
+
${this.bold("Usage:",e)} mmx ${r} <command> [flags]
|
|
174
|
+
|
|
175
|
+
`),e.write(`${this.bold("Commands:",e)}
|
|
176
|
+
`),this.printChildren(i,r,e),e.write(`
|
|
177
|
+
`)}printRootHelp(t){let e=["███╗ ███╗███╗ ███╗██╗ ██╗","████╗ ████║████╗ ████║╚██╗██╔╝","██╔████╔██║██╔████╔██║ ╚███╔╝ ","██║╚██╔╝██║██║╚██╔╝██║ ██╔██╗ ","██║ ╚═╝ ██║██║ ╚═╝ ██║██╔╝ ██╗","╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝"],i=[[240,23,122],[242,43,106],[244,63,90],[246,83,74],[248,103,58],[250,123,42]];t.write(`
|
|
178
|
+
`);for(let n=0;n<e.length;n++)if(t.isTTY){let[m,a,u]=i[n];t.write(`\x1B[1;38;2;${m};${a};${u}m${e[n]}\x1B[0m
|
|
179
|
+
`)}else t.write(e[n]+`
|
|
180
|
+
`);let r=(n)=>this.bold(n,t),o=(n)=>this.accent(n,t),s=(n)=>this.dim(n,t);t.write(`
|
|
181
|
+
${r("Usage:")} mmx <resource> <command> [flags]
|
|
182
|
+
|
|
183
|
+
${r("Resources:")}
|
|
184
|
+
${o("auth")} ${s("Authentication (login, status, refresh, logout)")}
|
|
185
|
+
${o("text")} ${s("Text generation (chat)")}
|
|
186
|
+
${o("speech")} ${s("Speech synthesis (synthesize, voices)")}
|
|
187
|
+
${o("image")} ${s("Image generation (generate)")}
|
|
188
|
+
${o("video")} ${s("Video generation (generate, task get, download)")}
|
|
189
|
+
${o("music")} ${s("Music generation (generate)")}
|
|
190
|
+
${o("search")} ${s("Web search (query)")}
|
|
191
|
+
${o("vision")} ${s("Image understanding (describe)")}
|
|
192
|
+
${o("quota")} ${s("Usage quotas (show)")}
|
|
193
|
+
${o("config")} ${s("CLI configuration (show, set, export-schema)")}
|
|
194
|
+
${o("update")} ${s("Update mmx to a newer version")}
|
|
195
|
+
|
|
196
|
+
${r("Global Flags:")}
|
|
197
|
+
${o("--api-key <key>")} ${s("API key (overrides all other auth)")}
|
|
198
|
+
${o("--region <region>")} ${s("API region: global (default), cn")}
|
|
199
|
+
${o("--base-url <url>")} ${s("API base URL (overrides region)")}
|
|
200
|
+
${o("--output <format>")} ${s("Output format: text, json")}
|
|
201
|
+
${o("--quiet")} ${s("Suppress non-essential output")}
|
|
202
|
+
${o("--verbose")} ${s("Print HTTP request/response details")}
|
|
203
|
+
${o("--timeout <seconds>")} ${s("Request timeout (default: 300)")}
|
|
204
|
+
${o("--no-color")} ${s("Disable ANSI colors and spinners")}
|
|
205
|
+
${o("--dry-run")} ${s("Show what would happen without executing")}
|
|
206
|
+
${o("--non-interactive")} ${s("Disable interactive prompts (CI/agent mode)")}
|
|
207
|
+
${o("--version")} ${s("Print version and exit")}
|
|
208
|
+
${o("--help")} ${s("Show help")}
|
|
209
|
+
|
|
210
|
+
${r("Getting Help:")}
|
|
211
|
+
${s("Add --help after any command to see its full list of options, defaults,")}
|
|
212
|
+
${s("and usage examples. For example:")} mmx text chat --help
|
|
213
|
+
`)}printCommandHelp(t,e){let i=(s)=>this.bold(s,e),r=(s)=>this.accent(s,e),o=(s)=>this.dim(s,e);if(e.write(`
|
|
217
214
|
${t.description}
|
|
218
|
-
`),t.usage)e.write(
|
|
219
|
-
`);if(t.options&&t.options.length>0){let
|
|
220
|
-
|
|
221
|
-
`);e.write(`
|
|
222
|
-
`)}if(t.examples&&t.examples.length>0){e.write(`
|
|
223
|
-
|
|
224
|
-
`);e.write(`
|
|
225
|
-
`)}e.write(`
|
|
226
|
-
|
|
227
|
-
`)
|
|
215
|
+
`),t.usage)e.write(`${i("Usage:")} ${t.usage}
|
|
216
|
+
`);if(t.options&&t.options.length>0){let s=Math.max(...t.options.map((n)=>n.flag.length));e.write(`
|
|
217
|
+
${i("Options:")}
|
|
218
|
+
`);for(let n of t.options)e.write(` ${r(n.flag.padEnd(s+2))} ${o(n.description)}
|
|
219
|
+
`)}if(t.examples&&t.examples.length>0){e.write(`
|
|
220
|
+
${i("Examples:")}
|
|
221
|
+
`);for(let s of t.examples)e.write(` ${o(s)}
|
|
222
|
+
`)}e.write(`
|
|
223
|
+
${o("Global flags (--api-key, --output, --quiet, etc.) are always available.")}
|
|
224
|
+
`),e.write(`${o("Run")} mmx --help ${o("for the full list.")}
|
|
225
|
+
`)}printChildren(t,e,i){let r=[],o=(n,m)=>{for(let[a,u]of n.children){if(u.command)r.push({fullName:`${m} ${a}`,description:u.command.description});if(u.children.size>0)o(u,`${m} ${a}`)}};o(t,e);let s=Math.max(...r.map((n)=>n.fullName.length));for(let{fullName:n,description:m}of r)i.write(` ${this.accent(n.padEnd(s),i)} ${this.dim(m,i)}
|
|
228
226
|
`)}}var C=new Un({"auth login":vn,"auth status":fn,"auth refresh":Sn,"auth logout":Rn,"text chat":An,"speech synthesize":jn,"speech voices":Mn,"image generate":Gn,"video generate":Bn,"video task get":In,"video download":zn,"music generate":Jn,"search query":Yn,"vision describe":Kn,"quota show":Xn,"config show":Qn,"config set":Zn,"config export-schema":Wn,update:Hn});function et(t){if(t instanceof c){if(_(process.env.MINIMAX_OUTPUT)==="json")process.stderr.write(JSON.stringify(t.toJSON(),null,2)+`
|
|
229
227
|
`);else{if(process.stderr.write(`
|
|
230
228
|
Error: ${t.message}
|
|
@@ -241,14 +239,14 @@ Error: ${String(t)}
|
|
|
241
239
|
`);process.exit(l.GENERAL)}var Ro="/v1/api/openplatform/coding_plan/remains";function ko(t){return W[t]+Ro}async function go(t,e,i){try{let r=await fetch(ko(t),{headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"},signal:AbortSignal.timeout(i)});if(!r.ok)return!1;return(await r.json()).base_resp?.status_code===0}catch{return!1}}async function Cn(t){process.stderr.write("Detecting region...");let e=Object.keys(W),r=(await Promise.all(e.map(async(s)=>({region:s,ok:await go(s,t,5000)})))).find((s)=>s.ok);if(!r)return process.stderr.write(` failed
|
|
242
240
|
`),process.stderr.write(`Warning: API key failed validation against all regions. Falling back to global.
|
|
243
241
|
`),"global";let o=r.region;return process.stderr.write(` ${o}
|
|
244
|
-
`),o}async function
|
|
242
|
+
`),o}async function Pn(t){let e=O();e.region=t,await K(e)}import{join as Ao}from"path";import{readFileSync as jo,writeFileSync as Mo}from"fs";var En=()=>Ao(at(),"update-state.json"),qo=86400000,To=3000,Oo="MiniMax-AI-Dev/minimax-cli";function Go(){try{let t=jo(En(),"utf-8");return JSON.parse(t)}catch{return null}}function No(t){try{Mo(En(),JSON.stringify(t))}catch{}}async function Bo(){try{let t=await fetch(`https://api.github.com/repos/${Oo}/releases/latest`,{headers:{Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"},signal:AbortSignal.timeout(To)});if(!t.ok)return null;return(await t.json()).tag_name??null}catch{return null}}var le=null;function Ln(){return le}async function Fn(t){if(process.env.CI||!process.stderr.isTTY)return;let e=Go(),i=Date.now();if(e&&i-e.lastChecked<qo){if(e.latestVersion&&e.latestVersion!==`v${t}`)le=e.latestVersion;return}let r=await Bo();if(!r)return;if(No({lastChecked:i,latestVersion:r}),r!==`v${t}`)le=r}async function Dn(t){if(t.apiKey||t.fileApiKey)return;let e=process.env.MINIMAX_API_KEY,i;if(e){if(!A({nonInteractive:t.nonInteractive}))i=e;else if(await gn({message:`Found MINIMAX_API_KEY in environment (${I(e)}). Save it to config file?`}))i=e}if(!i){if(!A({nonInteractive:t.nonInteractive}))throw new c("No API key found.",l.AUTH,`Set env var: export MINIMAX_API_KEY=sk-xxxxx
|
|
245
243
|
Pass directly: --api-key sk-xxxxx`);let s=await X({message:"Enter your MiniMax API key:"});if(!s)throw new c("API key is required.",l.AUTH);i=s}let r={...O(),api_key:i};await K(r),t.fileApiKey=i;let o=t.configPath??"~/.mmx/config.json";process.stderr.write(`API key saved to ${o}
|
|
246
|
-
`)}var ti="1.0.
|
|
244
|
+
`)}var ti="1.0.3";process.on("SIGINT",()=>{process.stderr.write(`
|
|
247
245
|
Interrupted. Exiting.
|
|
248
|
-
`),process.exit(130)});var Io=[["auth","login"],["auth","logout"],["config","show"],["config","set"],["config","export-schema"],["update"]];async function zo(){let t=process.argv.slice(2);if(t.includes("--version")||t.includes("-v"))console.log(`mmx ${ti}`),process.exit(0);let e=he(t,ht);if(t.includes("--help")||t.includes("-h"))C.printHelp(e,process.stderr),process.exit(0);if(e.length===0){C.printHelp([],process.stderr);let{command:u}=C.resolve(["quota","show"]),y=Jt(t,[...ht,...u.options??[]]),$=Zt(y),h=!!($.apiKey||$.fileApiKey),
|
|
246
|
+
`),process.exit(130)});var Io=[["auth","login"],["auth","logout"],["config","show"],["config","set"],["config","export-schema"],["update"]];async function zo(){let t=process.argv.slice(2);if(t.includes("--version")||t.includes("-v"))console.log(`mmx ${ti}`),process.exit(0);let e=he(t,ht);if(t.includes("--help")||t.includes("-h"))C.printHelp(e,process.stderr),process.exit(0);if(e.length===0){C.printHelp([],process.stderr);let{command:u}=C.resolve(["quota","show"]),y=Jt(t,[...ht,...u.options??[]]),$=Zt(y),h=!!($.apiKey||$.fileApiKey),w=!!await B();if(h||w)await u.execute($,y);else process.stderr.write(` Not logged in.
|
|
249
247
|
`),process.stderr.write(` mmx auth login --api-key sk-xxxxx
|
|
250
248
|
|
|
251
|
-
`);process.exit(0)}let{command:i,extra:r}=C.resolve(e),o=Jt(t,[...ht,...i.options??[]]);if(r.length>0)o._positional=r;let s=Zt(o);if(!Io.some((u)=>u.every((y,$)=>e[$]===y)))await Dn(s);if(s.needsRegionDetection){let u=s.apiKey||s.fileApiKey;if(u){let y=await Cn(u);s.region=y,s.baseUrl=W[y],s.needsRegionDetection=!1,await
|
|
249
|
+
`);process.exit(0)}let{command:i,extra:r}=C.resolve(e),o=Jt(t,[...ht,...i.options??[]]);if(r.length>0)o._positional=r;let s=Zt(o);if(!Io.some((u)=>u.every((y,$)=>e[$]===y)))await Dn(s);if(s.needsRegionDetection){let u=s.apiKey||s.fileApiKey;if(u){let y=await Cn(u);s.region=y,s.baseUrl=W[y],s.needsRegionDetection=!1,await Pn(y)}}let m=Fn(ti).catch(()=>{});await i.execute(s,o),await m;let a=Ln();if(a&&!s.quiet)process.stderr.write(`
|
|
252
250
|
Update available: ${a}
|
|
253
251
|
`),process.stderr.write(` npm update -g mmx-cli
|
|
254
252
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mmx-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "CLI for the MiniMax AI Platform",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"scripts": {
|
|
16
16
|
"dev": "bun run src/main.ts",
|
|
17
17
|
"build": "bun run build.ts",
|
|
18
|
-
"build:dev": "bun build src/main.ts --outfile dist/mmx.mjs --target node --minify --define \"process.env.CLI_VERSION='1.0.
|
|
18
|
+
"build:dev": "bun build src/main.ts --outfile dist/mmx.mjs --target node --minify --define \"process.env.CLI_VERSION='1.0.3'\" && printf '#!/usr/bin/env node\\n' | cat - dist/mmx.mjs > dist/tmp && mv dist/tmp dist/mmx.mjs && chmod +x dist/mmx.mjs",
|
|
19
19
|
"prepublishOnly": "bun run build",
|
|
20
20
|
"lint": "eslint src/ test/",
|
|
21
21
|
"typecheck": "tsc --noEmit",
|