create-playcanvas 0.2.5 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs
CHANGED
|
@@ -1,47 +1,52 @@
|
|
|
1
|
-
import"node:util";import b,{stdin as pD,stdout as fD}from"node:process";import Y from"node:readline";import{Writable as bD}from"node:stream";import B from"node:fs";import m from"node:path";import{fileURLToPath as dD}from"node:url";import{promises as AD}from"fs";import vD from"path";function P(e){return e==null?[]:Array.isArray(e)?e:[e]}function xD(e,u,t,r){var i,s=e[u],D=~r.string.indexOf(u)?t==null||t===!0?"":String(t):typeof t=="boolean"?t:~r.boolean.indexOf(u)?t==="false"?!1:t==="true"||(e._.push((i=+t,i*0===0?i:t)),!!t):(i=+t,i*0===0?i:t);e[u]=s==null?D:Array.isArray(s)?s.concat(D):[s,D]}function $D(e,u){e=e||[],u=u||{};var t,r,i,s,D,n={_:[]},F=0,a=0,o=0,l=e.length;const c=u.alias!==void 0,p=u.unknown!==void 0,v=u.default!==void 0;if(u.alias=u.alias||{},u.string=P(u.string),u.boolean=P(u.boolean),c)for(t in u.alias)for(r=u.alias[t]=P(u.alias[t]),F=0;F<r.length;F++)(u.alias[r[F]]=r.concat(t)).splice(F,1);for(F=u.boolean.length;F-- >0;)for(r=u.alias[u.boolean[F]]||[],a=r.length;a-- >0;)u.boolean.push(r[a]);for(F=u.string.length;F-- >0;)for(r=u.alias[u.string[F]]||[],a=r.length;a-- >0;)u.string.push(r[a]);if(v){for(t in u.default)if(s=typeof u.default[t],r=u.alias[t]=u.alias[t]||[],u[s]!==void 0)for(u[s].push(t),F=0;F<r.length;F++)u[s].push(r[F])}const d=p?Object.keys(u.alias):[];for(F=0;F<l;F++){if(i=e[F],i==="--"){n._=n._.concat(e.slice(++F));break}for(a=0;a<i.length&&i.charCodeAt(a)===45;a++);if(a===0)n._.push(i);else if(i.substring(a,a+3)==="no-"){if(s=i.substring(a+3),p&&!~d.indexOf(s))return u.unknown(i);n[s]=!1}else{for(o=a+1;o<i.length&&i.charCodeAt(o)!==61;o++);for(s=i.substring(a,o),D=i.substring(++o)||F+1===l||(""+e[F+1]).charCodeAt(0)===45||e[++F],r=a===2?[s]:s,o=0;o<r.length;o++){if(s=r[o],p&&!~d.indexOf(s))return u.unknown("-".repeat(a)+s);xD(n,s,o+1<r.length||D,u)}}}if(v)for(t in u.default)n[t]===void 0&&(n[t]=u.default[t]);if(c)for(t in n)for(r=u.alias[t]||[];r.length>0;)n[r.shift()]=n[t];return n}function yD(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var I,q;function wD(){if(q)return I;q=1;const e="\x1B",u=`${e}[`,t="\x07",r={to(D,n){return n?`${u}${n+1};${D+1}H`:`${u}${D+1}G`},move(D,n){let F="";return D<0?F+=`${u}${-D}D`:D>0&&(F+=`${u}${D}C`),n<0?F+=`${u}${-n}A`:n>0&&(F+=`${u}${n}B`),F},up:(D=1)=>`${u}${D}A`,down:(D=1)=>`${u}${D}B`,forward:(D=1)=>`${u}${D}C`,backward:(D=1)=>`${u}${D}D`,nextLine:(D=1)=>`${u}E`.repeat(D),prevLine:(D=1)=>`${u}F`.repeat(D),left:`${u}G`,hide:`${u}?25l`,show:`${u}?25h`,save:`${e}7`,restore:`${e}8`},i={up:(D=1)=>`${u}S`.repeat(D),down:(D=1)=>`${u}T`.repeat(D)},s={screen:`${u}2J`,up:(D=1)=>`${u}1J`.repeat(D),down:(D=1)=>`${u}J`.repeat(D),line:`${u}2K`,lineEnd:`${u}K`,lineStart:`${u}1K`,lines(D){let n="";for(let F=0;F<D;F++)n+=this.line+(F<D-1?r.up():"");return D&&(n+=r.left),n}};return I={cursor:r,scroll:i,erase:s,beep:t},I}var A=wD(),T={exports:{}},U;function SD(){if(U)return T.exports;U=1;let e=process||{},u=e.argv||[],t=e.env||{},r=!(t.NO_COLOR||u.includes("--no-color"))&&(!!t.FORCE_COLOR||u.includes("--color")||e.platform==="win32"||(e.stdout||{}).isTTY&&t.TERM!=="dumb"||!!t.CI),i=(n,F,a=n)=>o=>{let l=""+o,c=l.indexOf(F,n.length);return~c?n+s(l,F,a,c)+F:n+l+F},s=(n,F,a,o)=>{let l="",c=0;do l+=n.substring(c,o)+a,c=o+F.length,o=n.indexOf(F,c);while(~o);return l+n.substring(c)},D=(n=r)=>{let F=n?i:()=>String;return{isColorSupported:n,reset:F("\x1B[0m","\x1B[0m"),bold:F("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:F("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:F("\x1B[3m","\x1B[23m"),underline:F("\x1B[4m","\x1B[24m"),inverse:F("\x1B[7m","\x1B[27m"),hidden:F("\x1B[8m","\x1B[28m"),strikethrough:F("\x1B[9m","\x1B[29m"),black:F("\x1B[30m","\x1B[39m"),red:F("\x1B[31m","\x1B[39m"),green:F("\x1B[32m","\x1B[39m"),yellow:F("\x1B[33m","\x1B[39m"),blue:F("\x1B[34m","\x1B[39m"),magenta:F("\x1B[35m","\x1B[39m"),cyan:F("\x1B[36m","\x1B[39m"),white:F("\x1B[37m","\x1B[39m"),gray:F("\x1B[90m","\x1B[39m"),bgBlack:F("\x1B[40m","\x1B[49m"),bgRed:F("\x1B[41m","\x1B[49m"),bgGreen:F("\x1B[42m","\x1B[49m"),bgYellow:F("\x1B[43m","\x1B[49m"),bgBlue:F("\x1B[44m","\x1B[49m"),bgMagenta:F("\x1B[45m","\x1B[49m"),bgCyan:F("\x1B[46m","\x1B[49m"),bgWhite:F("\x1B[47m","\x1B[49m"),blackBright:F("\x1B[90m","\x1B[39m"),redBright:F("\x1B[91m","\x1B[39m"),greenBright:F("\x1B[92m","\x1B[39m"),yellowBright:F("\x1B[93m","\x1B[39m"),blueBright:F("\x1B[94m","\x1B[39m"),magentaBright:F("\x1B[95m","\x1B[39m"),cyanBright:F("\x1B[96m","\x1B[39m"),whiteBright:F("\x1B[97m","\x1B[39m"),bgBlackBright:F("\x1B[100m","\x1B[49m"),bgRedBright:F("\x1B[101m","\x1B[49m"),bgGreenBright:F("\x1B[102m","\x1B[49m"),bgYellowBright:F("\x1B[103m","\x1B[49m"),bgBlueBright:F("\x1B[104m","\x1B[49m"),bgMagentaBright:F("\x1B[105m","\x1B[49m"),bgCyanBright:F("\x1B[106m","\x1B[49m"),bgWhiteBright:F("\x1B[107m","\x1B[49m")}};return T.exports=D(),T.exports.createColors=D,T.exports}var Z=SD();const C=yD(Z);function _D({onlyFirst:e=!1}={}){const u=["[\\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(u,e?void 0:"g")}const TD=_D();function H(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(TD,"")}function Q(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var X={exports:{}};(function(e){var u={};e.exports=u,u.eastAsianWidth=function(r){var i=r.charCodeAt(0),s=r.length==2?r.charCodeAt(1):0,D=i;return 55296<=i&&i<=56319&&56320<=s&&s<=57343&&(i&=1023,s&=1023,D=i<<10|s,D+=65536),D==12288||65281<=D&&D<=65376||65504<=D&&D<=65510?"F":D==8361||65377<=D&&D<=65470||65474<=D&&D<=65479||65482<=D&&D<=65487||65490<=D&&D<=65495||65498<=D&&D<=65500||65512<=D&&D<=65518?"H":4352<=D&&D<=4447||4515<=D&&D<=4519||4602<=D&&D<=4607||9001<=D&&D<=9002||11904<=D&&D<=11929||11931<=D&&D<=12019||12032<=D&&D<=12245||12272<=D&&D<=12283||12289<=D&&D<=12350||12353<=D&&D<=12438||12441<=D&&D<=12543||12549<=D&&D<=12589||12593<=D&&D<=12686||12688<=D&&D<=12730||12736<=D&&D<=12771||12784<=D&&D<=12830||12832<=D&&D<=12871||12880<=D&&D<=13054||13056<=D&&D<=19903||19968<=D&&D<=42124||42128<=D&&D<=42182||43360<=D&&D<=43388||44032<=D&&D<=55203||55216<=D&&D<=55238||55243<=D&&D<=55291||63744<=D&&D<=64255||65040<=D&&D<=65049||65072<=D&&D<=65106||65108<=D&&D<=65126||65128<=D&&D<=65131||110592<=D&&D<=110593||127488<=D&&D<=127490||127504<=D&&D<=127546||127552<=D&&D<=127560||127568<=D&&D<=127569||131072<=D&&D<=194367||177984<=D&&D<=196605||196608<=D&&D<=262141?"W":32<=D&&D<=126||162<=D&&D<=163||165<=D&&D<=166||D==172||D==175||10214<=D&&D<=10221||10629<=D&&D<=10630?"Na":D==161||D==164||167<=D&&D<=168||D==170||173<=D&&D<=174||176<=D&&D<=180||182<=D&&D<=186||188<=D&&D<=191||D==198||D==208||215<=D&&D<=216||222<=D&&D<=225||D==230||232<=D&&D<=234||236<=D&&D<=237||D==240||242<=D&&D<=243||247<=D&&D<=250||D==252||D==254||D==257||D==273||D==275||D==283||294<=D&&D<=295||D==299||305<=D&&D<=307||D==312||319<=D&&D<=322||D==324||328<=D&&D<=331||D==333||338<=D&&D<=339||358<=D&&D<=359||D==363||D==462||D==464||D==466||D==468||D==470||D==472||D==474||D==476||D==593||D==609||D==708||D==711||713<=D&&D<=715||D==717||D==720||728<=D&&D<=731||D==733||D==735||768<=D&&D<=879||913<=D&&D<=929||931<=D&&D<=937||945<=D&&D<=961||963<=D&&D<=969||D==1025||1040<=D&&D<=1103||D==1105||D==8208||8211<=D&&D<=8214||8216<=D&&D<=8217||8220<=D&&D<=8221||8224<=D&&D<=8226||8228<=D&&D<=8231||D==8240||8242<=D&&D<=8243||D==8245||D==8251||D==8254||D==8308||D==8319||8321<=D&&D<=8324||D==8364||D==8451||D==8453||D==8457||D==8467||D==8470||8481<=D&&D<=8482||D==8486||D==8491||8531<=D&&D<=8532||8539<=D&&D<=8542||8544<=D&&D<=8555||8560<=D&&D<=8569||D==8585||8592<=D&&D<=8601||8632<=D&&D<=8633||D==8658||D==8660||D==8679||D==8704||8706<=D&&D<=8707||8711<=D&&D<=8712||D==8715||D==8719||D==8721||D==8725||D==8730||8733<=D&&D<=8736||D==8739||D==8741||8743<=D&&D<=8748||D==8750||8756<=D&&D<=8759||8764<=D&&D<=8765||D==8776||D==8780||D==8786||8800<=D&&D<=8801||8804<=D&&D<=8807||8810<=D&&D<=8811||8814<=D&&D<=8815||8834<=D&&D<=8835||8838<=D&&D<=8839||D==8853||D==8857||D==8869||D==8895||D==8978||9312<=D&&D<=9449||9451<=D&&D<=9547||9552<=D&&D<=9587||9600<=D&&D<=9615||9618<=D&&D<=9621||9632<=D&&D<=9633||9635<=D&&D<=9641||9650<=D&&D<=9651||9654<=D&&D<=9655||9660<=D&&D<=9661||9664<=D&&D<=9665||9670<=D&&D<=9672||D==9675||9678<=D&&D<=9681||9698<=D&&D<=9701||D==9711||9733<=D&&D<=9734||D==9737||9742<=D&&D<=9743||9748<=D&&D<=9749||D==9756||D==9758||D==9792||D==9794||9824<=D&&D<=9825||9827<=D&&D<=9829||9831<=D&&D<=9834||9836<=D&&D<=9837||D==9839||9886<=D&&D<=9887||9918<=D&&D<=9919||9924<=D&&D<=9933||9935<=D&&D<=9953||D==9955||9960<=D&&D<=9983||D==10045||D==10071||10102<=D&&D<=10111||11093<=D&&D<=11097||12872<=D&&D<=12879||57344<=D&&D<=63743||65024<=D&&D<=65039||D==65533||127232<=D&&D<=127242||127248<=D&&D<=127277||127280<=D&&D<=127337||127344<=D&&D<=127386||917760<=D&&D<=917999||983040<=D&&D<=1048573||1048576<=D&&D<=1114109?"A":"N"},u.characterLength=function(r){var i=this.eastAsianWidth(r);return i=="F"||i=="W"||i=="A"?2:1};function t(r){return r.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}u.length=function(r){for(var i=t(r),s=0,D=0;D<i.length;D++)s=s+this.characterLength(i[D]);return s},u.slice=function(r,i,s){textLen=u.length(r),i=i||0,s=s||1,i<0&&(i=textLen+i),s<0&&(s=textLen+s);for(var D="",n=0,F=t(r),a=0;a<F.length;a++){var o=F[a],l=u.length(o);if(n>=i-(l==2?1:0))if(n+l<=s)D+=o;else break;n+=l}return D}})(X);var kD=X.exports;const MD=Q(kD);var jD=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g};const OD=Q(jD);function y(e,u={}){if(typeof e!="string"||e.length===0||(u={ambiguousIsNarrow:!0,...u},e=H(e),e.length===0))return 0;e=e.replace(OD()," ");const t=u.ambiguousIsNarrow?1:2;let r=0;for(const i of e){const s=i.codePointAt(0);if(!(s<=31||s>=127&&s<=159||s>=768&&s<=879))switch(MD.eastAsianWidth(i)){case"F":case"W":r+=2;break;case"A":r+=t;break;default:r+=1}}return r}const L=10,DD=(e=0)=>u=>`\x1B[${u+e}m`,uD=(e=0)=>u=>`\x1B[${38+e};5;${u}m`,eD=(e=0)=>(u,t,r)=>`\x1B[${38+e};2;${u};${t};${r}m`,E={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(E.modifier);const RD=Object.keys(E.color),PD=Object.keys(E.bgColor);[...RD,...PD];function ID(){const e=new Map;for(const[u,t]of Object.entries(E)){for(const[r,i]of Object.entries(t))E[r]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},t[r]=E[r],e.set(i[0],i[1]);Object.defineProperty(E,u,{value:t,enumerable:!1})}return Object.defineProperty(E,"codes",{value:e,enumerable:!1}),E.color.close="\x1B[39m",E.bgColor.close="\x1B[49m",E.color.ansi=DD(),E.color.ansi256=uD(),E.color.ansi16m=eD(),E.bgColor.ansi=DD(L),E.bgColor.ansi256=uD(L),E.bgColor.ansi16m=eD(L),Object.defineProperties(E,{rgbToAnsi256:{value:(u,t,r)=>u===t&&t===r?u<8?16:u>248?231:Math.round((u-8)/247*24)+232:16+36*Math.round(u/255*5)+6*Math.round(t/255*5)+Math.round(r/255*5),enumerable:!1},hexToRgb:{value:u=>{const t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(u.toString(16));if(!t)return[0,0,0];let[r]=t;r.length===3&&(r=[...r].map(s=>s+s).join(""));const i=Number.parseInt(r,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:u=>E.rgbToAnsi256(...E.hexToRgb(u)),enumerable:!1},ansi256ToAnsi:{value:u=>{if(u<8)return 30+u;if(u<16)return 90+(u-8);let t,r,i;if(u>=232)t=((u-232)*10+8)/255,r=t,i=t;else{u-=16;const n=u%36;t=Math.floor(u/36)/5,r=Math.floor(n/6)/5,i=n%6/5}const s=Math.max(t,r,i)*2;if(s===0)return 30;let D=30+(Math.round(i)<<2|Math.round(r)<<1|Math.round(t));return s===2&&(D+=60),D},enumerable:!1},rgbToAnsi:{value:(u,t,r)=>E.ansi256ToAnsi(E.rgbToAnsi256(u,t,r)),enumerable:!1},hexToAnsi:{value:u=>E.ansi256ToAnsi(E.hexToAnsi256(u)),enumerable:!1}}),E}const LD=ID(),k=new Set(["\x1B","\x9B"]),ND=39,N="\x07",tD="[",WD="]",rD="m",W=`${WD}8;;`,iD=e=>`${k.values().next().value}${tD}${e}${rD}`,FD=e=>`${k.values().next().value}${W}${e}${N}`,VD=e=>e.split(" ").map(u=>y(u)),V=(e,u,t)=>{const r=[...u];let i=!1,s=!1,D=y(H(e[e.length-1]));for(const[n,F]of r.entries()){const a=y(F);if(D+a<=t?e[e.length-1]+=F:(e.push(F),D=0),k.has(F)&&(i=!0,s=r.slice(n+1).join("").startsWith(W)),i){s?F===N&&(i=!1,s=!1):F===rD&&(i=!1);continue}D+=a,D===t&&n<r.length-1&&(e.push(""),D=0)}!D&&e[e.length-1].length>0&&e.length>1&&(e[e.length-2]+=e.pop())},zD=e=>{const u=e.split(" ");let t=u.length;for(;t>0&&!(y(u[t-1])>0);)t--;return t===u.length?e:u.slice(0,t).join(" ")+u.slice(t).join("")},KD=(e,u,t={})=>{if(t.trim!==!1&&e.trim()==="")return"";let r="",i,s;const D=VD(e);let n=[""];for(const[a,o]of e.split(" ").entries()){t.trim!==!1&&(n[n.length-1]=n[n.length-1].trimStart());let l=y(n[n.length-1]);if(a!==0&&(l>=u&&(t.wordWrap===!1||t.trim===!1)&&(n.push(""),l=0),(l>0||t.trim===!1)&&(n[n.length-1]+=" ",l++)),t.hard&&D[a]>u){const c=u-l,p=1+Math.floor((D[a]-c-1)/u);Math.floor((D[a]-1)/u)<p&&n.push(""),V(n,o,u);continue}if(l+D[a]>u&&l>0&&D[a]>0){if(t.wordWrap===!1&&l<u){V(n,o,u);continue}n.push("")}if(l+D[a]>u&&t.wordWrap===!1){V(n,o,u);continue}n[n.length-1]+=o}t.trim!==!1&&(n=n.map(a=>zD(a)));const F=[...n.join(`
|
|
2
|
-
`)
|
|
3
|
-
|
|
4
|
-
`&&(
|
|
5
|
-
`).split(`
|
|
6
|
-
`)
|
|
7
|
-
`)
|
|
8
|
-
`),r
|
|
9
|
-
`)
|
|
10
|
-
`),
|
|
11
|
-
`).length-1;this.output.write(
|
|
12
|
-
`);this.output.write(
|
|
13
|
-
`).slice(
|
|
14
|
-
`)),this._prevFrame=
|
|
15
|
-
${
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
`;case"submit":return`${u}${C.gray(h)} ${C.dim(this.value||e.placeholder)}`;case"cancel":return`${u}${C.gray(h)} ${C.strikethrough(C.dim(this.value??""))}${this.value?.trim()?`
|
|
20
|
-
${C.gray(h)}`:""}`;default:return`${u}${C.cyan(h)} ${r}
|
|
21
|
-
${C.cyan(w)}
|
|
22
|
-
`}}}).prompt(),K=e=>{const u=(t,r)=>{const i=t.label??String(t.value);switch(r){case"selected":return`${C.dim(i)}`;case"active":return`${C.green(ru)} ${i} ${t.hint?C.dim(`(${t.hint})`):""}`;case"cancelled":return`${C.strikethrough(C.dim(i))}`;default:return`${C.dim(iu)} ${C.dim(i)}`}};return new HD({options:e.options,initialValue:e.initialValue,render(){const t=`${C.gray(h)}
|
|
23
|
-
${lD(this.state)} ${e.message}
|
|
24
|
-
`;switch(this.state){case"submit":return`${t}${C.gray(h)} ${u(this.options[this.cursor],"selected")}`;case"cancel":return`${t}${C.gray(h)} ${u(this.options[this.cursor],"cancelled")}
|
|
25
|
-
${C.gray(h)}`;default:return`${t}${C.cyan(h)} ${Cu({cursor:this.cursor,options:this.options,maxItems:e.maxItems,style:(r,i)=>u(r,i?"active":"inactive")}).join(`
|
|
26
|
-
${C.cyan(h)} `)}
|
|
27
|
-
${C.cyan(w)}
|
|
28
|
-
`}}}).prompt()},ou=(e="")=>{process.stdout.write(`${C.gray(w)} ${C.red(e)}
|
|
1
|
+
import{styleText as m}from"node:util";import D,{stdin as Te,stdout as oe}from"node:process";import ke from"node:readline";import"node:tty";import B from"node:fs";import _ from"node:path";import{fileURLToPath as Me}from"node:url";import{promises as Re}from"fs";import Le from"path";function Y(e){return e==null?[]:Array.isArray(e)?e:[e]}function Oe(e,t,r,s){var o,l=e[t],n=~s.string.indexOf(t)?r==null||r===!0?"":String(r):typeof r=="boolean"?r:~s.boolean.indexOf(t)?r==="false"?!1:r==="true"||(e._.push((o=+r,o*0===0?o:r)),!!r):(o=+r,o*0===0?o:r);e[t]=l==null?n:Array.isArray(l)?l.concat(n):[l,n]}function je(e,t){e=e||[],t=t||{};var r,s,o,l,n,a={_:[]},i=0,c=0,d=0,u=e.length;const f=t.alias!==void 0,g=t.unknown!==void 0,p=t.default!==void 0;if(t.alias=t.alias||{},t.string=Y(t.string),t.boolean=Y(t.boolean),f)for(r in t.alias)for(s=t.alias[r]=Y(t.alias[r]),i=0;i<s.length;i++)(t.alias[s[i]]=s.concat(r)).splice(i,1);for(i=t.boolean.length;i-- >0;)for(s=t.alias[t.boolean[i]]||[],c=s.length;c-- >0;)t.boolean.push(s[c]);for(i=t.string.length;i-- >0;)for(s=t.alias[t.string[i]]||[],c=s.length;c-- >0;)t.string.push(s[c]);if(p){for(r in t.default)if(l=typeof t.default[r],s=t.alias[r]=t.alias[r]||[],t[l]!==void 0)for(t[l].push(r),i=0;i<s.length;i++)t[l].push(s[i])}const h=g?Object.keys(t.alias):[];for(i=0;i<u;i++){if(o=e[i],o==="--"){a._=a._.concat(e.slice(++i));break}for(c=0;c<o.length&&o.charCodeAt(c)===45;c++);if(c===0)a._.push(o);else if(o.substring(c,c+3)==="no-"){if(l=o.substring(c+3),g&&!~h.indexOf(l))return t.unknown(o);a[l]=!1}else{for(d=c+1;d<o.length&&o.charCodeAt(d)!==61;d++);for(l=o.substring(c,d),n=o.substring(++d)||i+1===u||(""+e[i+1]).charCodeAt(0)===45||e[++i],s=c===2?[l]:l,d=0;d<s.length;d++){if(l=s[d],g&&!~h.indexOf(l))return t.unknown("-".repeat(c)+l);Oe(a,l,d+1<s.length||n,t)}}}if(p)for(r in t.default)a[r]===void 0&&(a[r]=t.default[r]);if(f)for(r in a)for(s=t.alias[r]||[];s.length>0;)a[s.shift()]=a[r];return a}const We=e=>e===161||e===164||e===167||e===168||e===170||e===173||e===174||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||e===198||e===208||e===215||e===216||e>=222&&e<=225||e===230||e>=232&&e<=234||e===236||e===237||e===240||e===242||e===243||e>=247&&e<=250||e===252||e===254||e===257||e===273||e===275||e===283||e===294||e===295||e===299||e>=305&&e<=307||e===312||e>=319&&e<=322||e===324||e>=328&&e<=331||e===333||e===338||e===339||e===358||e===359||e===363||e===462||e===464||e===466||e===468||e===470||e===472||e===474||e===476||e===593||e===609||e===708||e===711||e>=713&&e<=715||e===717||e===720||e>=728&&e<=731||e===733||e===735||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||e===1025||e>=1040&&e<=1103||e===1105||e===8208||e>=8211&&e<=8214||e===8216||e===8217||e===8220||e===8221||e>=8224&&e<=8226||e>=8228&&e<=8231||e===8240||e===8242||e===8243||e===8245||e===8251||e===8254||e===8308||e===8319||e>=8321&&e<=8324||e===8364||e===8451||e===8453||e===8457||e===8467||e===8470||e===8481||e===8482||e===8486||e===8491||e===8531||e===8532||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||e===8585||e>=8592&&e<=8601||e===8632||e===8633||e===8658||e===8660||e===8679||e===8704||e===8706||e===8707||e===8711||e===8712||e===8715||e===8719||e===8721||e===8725||e===8730||e>=8733&&e<=8736||e===8739||e===8741||e>=8743&&e<=8748||e===8750||e>=8756&&e<=8759||e===8764||e===8765||e===8776||e===8780||e===8786||e===8800||e===8801||e>=8804&&e<=8807||e===8810||e===8811||e===8814||e===8815||e===8834||e===8835||e===8838||e===8839||e===8853||e===8857||e===8869||e===8895||e===8978||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||e===9632||e===9633||e>=9635&&e<=9641||e===9650||e===9651||e===9654||e===9655||e===9660||e===9661||e===9664||e===9665||e>=9670&&e<=9672||e===9675||e>=9678&&e<=9681||e>=9698&&e<=9701||e===9711||e===9733||e===9734||e===9737||e===9742||e===9743||e===9756||e===9758||e===9792||e===9794||e===9824||e===9825||e>=9827&&e<=9829||e>=9831&&e<=9834||e===9836||e===9837||e===9839||e===9886||e===9887||e===9919||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||e===9955||e===9960||e===9961||e>=9963&&e<=9969||e===9972||e>=9974&&e<=9977||e===9979||e===9980||e===9982||e===9983||e===10045||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||e===65533||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||e===127375||e===127376||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109,Ne=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,Pe=e=>e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9800&&e<=9811||e===9855||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e===94192||e===94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101632&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129672||e>=129680&&e<=129725||e>=129727&&e<=129733||e>=129742&&e<=129755||e>=129760&&e<=129768||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141,Z=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y,N=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,P=/\t{1,1000}/y,X=new RegExp("[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation}|\\p{Emoji}\\uFE0F\\u20E3?))*","yu"),V=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,Ve=new RegExp("\\p{M}+","gu"),Ue={limit:1/0,ellipsis:""},le=(e,t={},r={})=>{const s=t.limit??1/0,o=t.ellipsis??"",l=t?.ellipsisWidth??(o?le(o,Ue,r).width:0),n=r.ansiWidth??0,a=r.controlWidth??0,i=r.tabWidth??8,c=r.ambiguousWidth??1,d=r.emojiWidth??2,u=r.fullWidthWidth??2,f=r.regularWidth??1,g=r.wideWidth??2;let p=0,h=0,y=e.length,x=0,w=!1,v=y,C=Math.max(0,s-l),E=0,$=0,F=0,b=0;e:for(;;){if($>E||h>=y&&h>p){const R=e.slice(E,$)||e.slice(p,h);x=0;for(const W of R.replaceAll(Ve,"")){const L=W.codePointAt(0)||0;if(Ne(L)?b=u:Pe(L)?b=g:c!==f&&We(L)?b=c:b=f,F+b>C&&(v=Math.min(v,Math.max(E,p)+x)),F+b>s){w=!0;break e}x+=W.length,F+=b}E=$=0}if(h>=y)break;if(V.lastIndex=h,V.test(e)){if(x=V.lastIndex-h,b=x*f,F+b>C&&(v=Math.min(v,h+Math.floor((C-F)/f))),F+b>s){w=!0;break}F+=b,E=p,$=h,h=p=V.lastIndex;continue}if(Z.lastIndex=h,Z.test(e)){if(F+n>C&&(v=Math.min(v,h)),F+n>s){w=!0;break}F+=n,E=p,$=h,h=p=Z.lastIndex;continue}if(N.lastIndex=h,N.test(e)){if(x=N.lastIndex-h,b=x*a,F+b>C&&(v=Math.min(v,h+Math.floor((C-F)/a))),F+b>s){w=!0;break}F+=b,E=p,$=h,h=p=N.lastIndex;continue}if(P.lastIndex=h,P.test(e)){if(x=P.lastIndex-h,b=x*i,F+b>C&&(v=Math.min(v,h+Math.floor((C-F)/i))),F+b>s){w=!0;break}F+=b,E=p,$=h,h=p=P.lastIndex;continue}if(X.lastIndex=h,X.test(e)){if(F+d>C&&(v=Math.min(v,h)),F+d>s){w=!0;break}F+=d,E=p,$=h,h=p=X.lastIndex;continue}h+=1}return{width:w?C:F,index:w?v:y,truncated:w,ellipsed:w&&s>=l}},Ge={limit:1/0,ellipsis:"",ellipsisWidth:0},T=(e,t={})=>le(e,Ge,t).width,U="\x1B",ce="\x9B",Ke=39,Q="\x07",ue="[",ze="]",he="m",ee=`${ze}8;;`,me=new RegExp(`(?:\\${ue}(?<code>\\d+)m|\\${ee}(?<uri>.*)${Q})`,"y"),fe=e=>{if(e>=30&&e<=37||e>=90&&e<=97)return 39;if(e>=40&&e<=47||e>=100&&e<=107)return 49;if(e===1||e===2)return 22;if(e===3)return 23;if(e===4)return 24;if(e===7)return 27;if(e===8)return 28;if(e===9)return 29;if(e===0)return 0},de=e=>`${U}${ue}${e}${he}`,pe=e=>`${U}${ee}${e}${Q}`,te=(e,t,r)=>{const s=t[Symbol.iterator]();let o=!1,l=!1,n=e.at(-1),a=n===void 0?0:T(n),i=s.next(),c=s.next(),d=0;for(;!i.done;){const u=i.value,f=T(u);a+f<=r?e[e.length-1]+=u:(e.push(u),a=0),(u===U||u===ce)&&(o=!0,l=t.startsWith(ee,d+1)),o?l?u===Q&&(o=!1,l=!1):u===he&&(o=!1):(a+=f,a===r&&!c.done&&(e.push(""),a=0)),i=c,c=s.next(),d+=u.length}n=e.at(-1),!a&&n!==void 0&&n.length&&e.length>1&&(e[e.length-2]+=e.pop())},He=e=>{const t=e.split(" ");let r=t.length;for(;r&&!T(t[r-1]);)r--;return r===t.length?e:t.slice(0,r).join(" ")+t.slice(r).join("")},Je=(e,t,r={})=>{if(r.trim!==!1&&e.trim()==="")return"";let s="",o,l;const n=e.split(" ");let a=[""],i=0;for(let u=0;u<n.length;u++){const f=n[u];if(r.trim!==!1){const p=a.at(-1)??"",h=p.trimStart();p.length!==h.length&&(a[a.length-1]=h,i=T(h))}u!==0&&(i>=t&&(r.wordWrap===!1||r.trim===!1)&&(a.push(""),i=0),(i||r.trim===!1)&&(a[a.length-1]+=" ",i++));const g=T(f);if(r.hard&&g>t){const p=t-i,h=1+Math.floor((g-p-1)/t);Math.floor((g-1)/t)<h&&a.push(""),te(a,f,t),i=T(a.at(-1)??"");continue}if(i+g>t&&i&&g){if(r.wordWrap===!1&&i<t){te(a,f,t),i=T(a.at(-1)??"");continue}a.push(""),i=0}if(i+g>t&&r.wordWrap===!1){te(a,f,t),i=T(a.at(-1)??"");continue}a[a.length-1]+=f,i+=g}r.trim!==!1&&(a=a.map(u=>He(u)));const c=a.join(`
|
|
2
|
+
`);let d=!1;for(let u=0;u<c.length;u++){const f=c[u];if(s+=f,!d)d=f>="\uD800"&&f<="\uDBFF";else continue;if(f===U||f===ce){me.lastIndex=u+1;const p=me.exec(c)?.groups;if(p?.code!==void 0){const h=Number.parseFloat(p.code);o=h===Ke?void 0:h}else p?.uri!==void 0&&(l=p.uri.length===0?void 0:p.uri)}if(c[u+1]===`
|
|
3
|
+
`){l&&(s+=pe(""));const g=o?fe(o):void 0;o&&g&&(s+=de(g))}else f===`
|
|
4
|
+
`&&(o&&fe(o)&&(s+=de(o)),l&&(s+=pe(l)))}return s},qe=/\r?\n/;function G(e,t,r){return String(e).normalize().split(qe).map(s=>Je(s,t,r)).join(`
|
|
5
|
+
`)}function Ye(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var re,Fe;function Ze(){if(Fe)return re;Fe=1;const e="\x1B",t=`${e}[`,r="\x07",s={to(n,a){return a?`${t}${a+1};${n+1}H`:`${t}${n+1}G`},move(n,a){let i="";return n<0?i+=`${t}${-n}D`:n>0&&(i+=`${t}${n}C`),a<0?i+=`${t}${-a}A`:a>0&&(i+=`${t}${a}B`),i},up:(n=1)=>`${t}${n}A`,down:(n=1)=>`${t}${n}B`,forward:(n=1)=>`${t}${n}C`,backward:(n=1)=>`${t}${n}D`,nextLine:(n=1)=>`${t}E`.repeat(n),prevLine:(n=1)=>`${t}F`.repeat(n),left:`${t}G`,hide:`${t}?25l`,show:`${t}?25h`,save:`${e}7`,restore:`${e}8`},o={up:(n=1)=>`${t}S`.repeat(n),down:(n=1)=>`${t}T`.repeat(n)},l={screen:`${t}2J`,up:(n=1)=>`${t}1J`.repeat(n),down:(n=1)=>`${t}J`.repeat(n),line:`${t}2K`,lineEnd:`${t}K`,lineStart:`${t}1K`,lines(n){let a="";for(let i=0;i<n;i++)a+=this.line+(i<n-1?s.up():"");return n&&(a+=s.left),a}};return re={cursor:s,scroll:o,erase:l,beep:r},re}var S=Ze();function K(e,t,r){if(!r.some(n=>!n.disabled))return e;const s=e+t,o=Math.max(r.length-1,0),l=s<0?o:s>o?0:s;return r[l].disabled?K(l,t<0?-1:1,r):l}const Xe=["up","down","left","right","space","enter","cancel"],k={actions:new Set(Xe),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]]),withGuide:!0};function ge(e,t){if(typeof e=="string")return k.aliases.get(e)===t;for(const r of e)if(r!==void 0&&ge(r,t))return!0;return!1}function Qe(e,t){if(e===t)return;const r=e.split(`
|
|
6
|
+
`),s=t.split(`
|
|
7
|
+
`),o=Math.max(r.length,s.length),l=[];for(let n=0;n<o;n++)r[n]!==s[n]&&l.push(n);return{lines:l,numLinesBefore:r.length,numLinesAfter:s.length,numLines:o}}globalThis.process.platform.startsWith("win");const ie=Symbol("clack:cancel");function z(e){return e===ie}function H(e,t){const r=e;r.isTTY&&r.setRawMode(t)}const be=e=>"columns"in e&&typeof e.columns=="number"?e.columns:80,xe=e=>"rows"in e&&typeof e.rows=="number"?e.rows:20;function se(e,t,r,s=r){const o=be(e??oe);return G(t,o-r.length,{hard:!0,trim:!1}).split(`
|
|
8
|
+
`).map((l,n)=>`${n===0?s:r}${l}`).join(`
|
|
9
|
+
`)}let Ee=class{input;output;_abortSignal;rl;opts;_render;_track=!1;_prevFrame="";_subscribers=new Map;_cursor=0;state="initial";error="";value;userInput="";constructor(e,t=!0){const{input:r=Te,output:s=oe,render:o,signal:l,...n}=e;this.opts=n,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=o.bind(this),this._track=t,this._abortSignal=l,this.input=r,this.output=s}unsubscribe(){this._subscribers.clear()}setSubscriber(e,t){const r=this._subscribers.get(e)??[];r.push(t),this._subscribers.set(e,r)}on(e,t){this.setSubscriber(e,{cb:t})}once(e,t){this.setSubscriber(e,{cb:t,once:!0})}emit(e,...t){const r=this._subscribers.get(e)??[],s=[];for(const o of r)o.cb(...t),o.once&&s.push(()=>r.splice(r.indexOf(o),1));for(const o of s)o()}prompt(){return new Promise(e=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),e(ie);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}this.rl=ke.createInterface({input:this.input,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),this.rl.prompt(),this.opts.initialUserInput!==void 0&&this._setUserInput(this.opts.initialUserInput,!0),this.input.on("keypress",this.onKeypress),H(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(S.cursor.show),this.output.off("resize",this.render),H(this.input,!1),e(this.value)}),this.once("cancel",()=>{this.output.write(S.cursor.show),this.output.off("resize",this.render),H(this.input,!1),e(ie)})})}_isActionKey(e,t){return e===" "}_setValue(e){this.value=e,this.emit("value",this.value)}_setUserInput(e,t){this.userInput=e??"",this.emit("userInput",this.userInput),t&&this._track&&this.rl&&(this.rl.write(this.userInput),this._cursor=this.rl.cursor)}_clearUserInput(){this.rl?.write(null,{ctrl:!0,name:"u"}),this._setUserInput("")}onKeypress(e,t){if(this._track&&t.name!=="return"&&(t.name&&this._isActionKey(e,t)&&this.rl?.write(null,{ctrl:!0,name:"h"}),this._cursor=this.rl?.cursor??0,this._setUserInput(this.rl?.line)),this.state==="error"&&(this.state="active"),t?.name&&(!this._track&&k.aliases.has(t.name)&&this.emit("cursor",k.aliases.get(t.name)),k.actions.has(t.name)&&this.emit("cursor",t.name)),e&&(e.toLowerCase()==="y"||e.toLowerCase()==="n")&&this.emit("confirm",e.toLowerCase()==="y"),this.emit("key",e?.toLowerCase(),t),t?.name==="return"){if(this.opts.validate){const r=this.opts.validate(this.value);r&&(this.error=r instanceof Error?r.message:r,this.state="error",this.rl?.write(this.userInput))}this.state!=="error"&&(this.state="submit")}ge([e,t?.name,t?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
|
|
10
|
+
`),H(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){const e=G(this._prevFrame,process.stdout.columns,{hard:!0,trim:!1}).split(`
|
|
11
|
+
`).length-1;this.output.write(S.cursor.move(-999,e*-1))}render(){const e=G(this._render(this)??"",process.stdout.columns,{hard:!0,trim:!1});if(e!==this._prevFrame){if(this.state==="initial")this.output.write(S.cursor.hide);else{const t=Qe(this._prevFrame,e),r=xe(this.output);if(this.restoreCursor(),t){const s=Math.max(0,t.numLinesAfter-r),o=Math.max(0,t.numLinesBefore-r);let l=t.lines.find(n=>n>=s);if(l===void 0){this._prevFrame=e;return}if(t.lines.length===1){this.output.write(S.cursor.move(0,l-o)),this.output.write(S.erase.lines(1));const n=e.split(`
|
|
12
|
+
`);this.output.write(n[l]),this._prevFrame=e,this.output.write(S.cursor.move(0,n.length-l-1));return}else if(t.lines.length>1){if(s<o)l=s;else{const a=l-o;a>0&&this.output.write(S.cursor.move(0,a))}this.output.write(S.erase.down());const n=e.split(`
|
|
13
|
+
`).slice(l);this.output.write(n.join(`
|
|
14
|
+
`)),this._prevFrame=e;return}}this.output.write(S.erase.down())}this.output.write(e),this.state==="initial"&&(this.state="active"),this._prevFrame=e}}};class et extends Ee{options;cursor=0;get _selectedValue(){return this.options[this.cursor]}changeValue(){this.value=this._selectedValue.value}constructor(t){super(t,!1),this.options=t.options;const r=this.options.findIndex(({value:o})=>o===t.initialValue),s=r===-1?0:r;this.cursor=this.options[s].disabled?K(s,1,this.options):s,this.changeValue(),this.on("cursor",o=>{switch(o){case"left":case"up":this.cursor=K(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=K(this.cursor,1,this.options);break}this.changeValue()})}}class tt extends Ee{get userInputWithCursor(){if(this.state==="submit")return this.userInput;const t=this.userInput;if(this.cursor>=t.length)return`${this.userInput}\u2588`;const r=t.slice(0,this.cursor),[s,...o]=t.slice(this.cursor);return`${r}${m("inverse",s)}${o.join("")}`}get cursor(){return this._cursor}constructor(t){super({...t,initialUserInput:t.initialUserInput??t.initialValue}),this.on("userInput",r=>{this._setValue(r)}),this.on("finalize",()=>{this.value||(this.value=t.defaultValue),this.value===void 0&&(this.value="")})}}function rt(){return D.platform!=="win32"?D.env.TERM!=="linux":!!D.env.CI||!!D.env.WT_SESSION||!!D.env.TERMINUS_SUBLIME||D.env.ConEmuTask==="{cmd::Cmder}"||D.env.TERM_PROGRAM==="Terminus-Sublime"||D.env.TERM_PROGRAM==="vscode"||D.env.TERM==="xterm-256color"||D.env.TERM==="alacritty"||D.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}const it=rt(),I=(e,t)=>it?e:t,st=I("\u25C6","*"),nt=I("\u25A0","x"),at=I("\u25B2","x"),$e=I("\u25C7","o"),A=I("\u2502","|"),O=I("\u2514","\u2014"),ot=I("\u25CF",">"),ye=I("\u25CB"," "),lt=I("\u25CF","\u2022"),ct=I("\u25C6","*"),ut=I("\u25B2","!"),ht=I("\u25A0","x"),we=e=>{switch(e){case"initial":case"active":return m("cyan",st);case"cancel":return m("red",nt);case"error":return m("yellow",at);case"submit":return m("green",$e)}},mt=e=>{switch(e){case"initial":case"active":return m("cyan",A);case"cancel":return m("red",A);case"error":return m("yellow",A);case"submit":return m("green",A)}},ft=(e,t,r,s,o)=>{let l=t,n=0;for(let a=r;a<s;a++){const i=e[a];if(l=l-i.length,n++,l<=o)break}return{lineCount:l,removals:n}},dt=({cursor:e,options:t,style:r,output:s=process.stdout,maxItems:o=Number.POSITIVE_INFINITY,columnPadding:l=0,rowPadding:n=4})=>{const a=be(s)-l,i=xe(s),c=m("dim","..."),d=Math.max(i-n,0),u=Math.max(Math.min(o,d),5);let f=0;e>=u-3&&(f=Math.max(Math.min(e-u+3,t.length-u),0));let g=u<t.length&&f>0,p=u<t.length&&f+u<t.length;const h=Math.min(f+u,t.length),y=[];let x=0;g&&x++,p&&x++;const w=f+(g?1:0),v=h-(p?1:0);for(let E=w;E<v;E++){const $=G(r(t[E],E===e),a,{hard:!0,trim:!1}).split(`
|
|
15
|
+
`);y.push($),x+=$.length}if(x>d){let E=0,$=0,F=x;const b=e-w,R=(W,L)=>ft(y,F,W,L,d);g?({lineCount:F,removals:E}=R(0,b),F>d&&({lineCount:F,removals:$}=R(b+1,y.length))):({lineCount:F,removals:$}=R(b+1,y.length),F>d&&({lineCount:F,removals:E}=R(0,b))),E>0&&(g=!0,y.splice(0,E)),$>0&&(p=!0,y.splice(y.length-$,$))}const C=[];g&&C.push(c);for(const E of y)for(const $ of E)C.push($);return p&&C.push(c),C},M={message:(e=[],{symbol:t=m("gray",A),secondarySymbol:r=m("gray",A),output:s=process.stdout,spacing:o=1,withGuide:l}={})=>{const n=[],a=l??k.withGuide,i=a?r:"",c=a?`${t} `:"",d=a?`${r} `:"";for(let f=0;f<o;f++)n.push(i);const u=Array.isArray(e)?e:e.split(`
|
|
16
|
+
`);if(u.length>0){const[f,...g]=u;f.length>0?n.push(`${c}${f}`):n.push(a?t:"");for(const p of g)p.length>0?n.push(`${d}${p}`):n.push(a?r:"")}s.write(`${n.join(`
|
|
17
|
+
`)}
|
|
18
|
+
`)},info:(e,t)=>{M.message(e,{...t,symbol:m("blue",lt)})},success:(e,t)=>{M.message(e,{...t,symbol:m("green",ct)})},step:(e,t)=>{M.message(e,{...t,symbol:m("green",$e)})},warn:(e,t)=>{M.message(e,{...t,symbol:m("yellow",ut)})},warning:(e,t)=>{M.warn(e,t)},error:(e,t)=>{M.message(e,{...t,symbol:m("red",ht)})}},pt=(e="",t)=>{const r=process.stdout,s=`${m("gray",O)} `;r.write(`${s}${m("red",e)}
|
|
29
19
|
|
|
30
|
-
`)},
|
|
31
|
-
${
|
|
20
|
+
`)},Ft=(e="",t)=>{const r=process.stdout,s=`${m("gray",A)}
|
|
21
|
+
${m("gray",O)} `;r.write(`${s}${e}
|
|
32
22
|
|
|
33
|
-
`)}
|
|
34
|
-
`)
|
|
35
|
-
`)
|
|
36
|
-
`)
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
23
|
+
`)},J=(e,t)=>e.includes(`
|
|
24
|
+
`)?e.split(`
|
|
25
|
+
`).map(r=>t(r)).join(`
|
|
26
|
+
`):t(e),ne=e=>{const t=(r,s)=>{const o=r.label??String(r.value);switch(s){case"disabled":return`${m("gray",ye)} ${J(o,l=>m("gray",l))}${r.hint?` ${m("dim",`(${r.hint??"disabled"})`)}`:""}`;case"selected":return`${J(o,l=>m("dim",l))}`;case"active":return`${m("green",ot)} ${o}${r.hint?` ${m("dim",`(${r.hint})`)}`:""}`;case"cancelled":return`${J(o,l=>m(["strikethrough","dim"],l))}`;default:return`${m("dim",ye)} ${J(o,l=>m("dim",l))}`}};return new et({options:e.options,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue,render(){const r=e.withGuide??k.withGuide,s=`${we(this.state)} `,o=`${mt(this.state)} `,l=se(e.output,e.message,o,s),n=`${r?`${m("gray",A)}
|
|
27
|
+
`:""}${l}
|
|
28
|
+
`;switch(this.state){case"submit":{const a=r?`${m("gray",A)} `:"",i=se(e.output,t(this.options[this.cursor],"selected"),a);return`${n}${i}`}case"cancel":{const a=r?`${m("gray",A)} `:"",i=se(e.output,t(this.options[this.cursor],"cancelled"),a);return`${n}${i}${r?`
|
|
29
|
+
${m("gray",A)}`:""}`}default:{const a=r?`${m("cyan",A)} `:"",i=r?m("cyan",O):"",c=n.split(`
|
|
30
|
+
`).length,d=r?2:1;return`${n}${a}${dt({output:e.output,cursor:this.cursor,options:this.options,maxItems:e.maxItems,columnPadding:a.length,rowPadding:c+d,style:(u,f)=>t(u,u.disabled?"disabled":f?"active":"inactive")}).join(`
|
|
31
|
+
${a}`)}
|
|
32
|
+
${i}
|
|
33
|
+
`}}}}).prompt()};`${m("gray",A)}`;const ve=e=>new tt({validate:e.validate,placeholder:e.placeholder,defaultValue:e.defaultValue,initialValue:e.initialValue,output:e.output,signal:e.signal,input:e.input,render(){const t=e?.withGuide??k.withGuide,r=`${`${t?`${m("gray",A)}
|
|
34
|
+
`:""}${we(this.state)} `}${e.message}
|
|
35
|
+
`,s=e.placeholder?m("inverse",e.placeholder[0])+m("dim",e.placeholder.slice(1)):m(["inverse","hidden"],"_"),o=this.userInput?this.userInputWithCursor:s,l=this.value??"";switch(this.state){case"error":{const n=this.error?` ${m("yellow",this.error)}`:"",a=t?`${m("yellow",A)} `:"",i=t?m("yellow",O):"";return`${r.trim()}
|
|
36
|
+
${a}${o}
|
|
37
|
+
${i}${n}
|
|
38
|
+
`}case"submit":{const n=l?` ${m("dim",l)}`:"",a=t?m("gray",A):"";return`${r}${a}${n}`}case"cancel":{const n=l?` ${m(["strikethrough","dim"],l)}`:"",a=t?m("gray",A):"";return`${r}${a}${n}${l.trim()?`
|
|
39
|
+
${a}`:""}`}default:{const n=t?`${m("cyan",A)} `:"",a=t?m("cyan",O):"";return`${r}${n}${o}
|
|
40
|
+
${a}
|
|
41
|
+
`}}}}).prompt();function ae(e){return e.trim().replace(/\/+$/g,"")}function gt(e){const t=B.readdirSync(e);return t.length===0||t.length===1&&t[0]===".git"}function bt(e){if(B.existsSync(e))for(const t of B.readdirSync(e))t!==".git"&&B.rmSync(_.resolve(e,t),{recursive:!0,force:!0})}function Ae(e,t){B.statSync(e).isDirectory()?xt(e,t):B.copyFileSync(e,t)}function xt(e,t){B.mkdirSync(t,{recursive:!0});for(const r of B.readdirSync(e)){const s=_.resolve(e,r),o=_.resolve(t,r);Ae(s,o)}}function Et(e,t){const r=t?t.name:"npm",s=r==="yarn"&&t?.version.startsWith("1.");return e.replace(/^npm create /,()=>r==="bun"?"bun x create-":`${r} create `).replace("@latest",()=>s?"":"@latest").replace(/^npm exec/,()=>r==="pnpm"?"pnpm dlx":r==="yarn"&&!s?"yarn dlx":r==="bun"?"bun x":"npm exec")}async function $t(e,t,r="VITE_"){const s=Object.entries(e).map(([l,n])=>`${r}${l.toUpperCase()}=${JSON.stringify(n)}`).join(`
|
|
42
|
+
`),o=Le.join(t,".env");await Re.writeFile(o,s,"utf8")}async function yt(e){const{cwd:t,targetDir:r,template:s,packageName:o,renameFiles:l,pkgInfo:n}=e,a=_.join(t,r);B.mkdirSync(a,{recursive:!0}),await $t({},a);const i=n?n.name:"npm";M.step(`Creating project in ${a}...`);const c=Me(import.meta.url),d=_.dirname(c),u=[_.resolve(d,"../templates",s),_.resolve(d,"../../templates",s)].find(x=>B.existsSync(x));if(!u)throw new Error(`Template directory not found for: ${s}`);const f=(x,w)=>{const v=_.join(a,l[x]??x);w?B.writeFileSync(v,w):Ae(_.join(u,x),v)},g=B.readdirSync(u);for(const x of g.filter(w=>w!=="package.json"))f(x);const p=JSON.parse(B.readFileSync(_.join(u,"package.json"),"utf-8"));p.name=o,f("package.json",JSON.stringify(p,null,2)+`
|
|
43
|
+
`);let h="";const y=_.relative(t,a);switch(h+=`Project created. Now run:
|
|
44
|
+
`,a!==t&&(h+=`
|
|
45
|
+
cd ${y.includes(" ")?`"${y}"`:y}`),i){case"yarn":h+=`
|
|
46
|
+
yarn`,h+=`
|
|
47
|
+
yarn dev`;break;default:h+=`
|
|
48
|
+
${i} install`,h+=`
|
|
49
|
+
${i} run dev`;break}Ft(h)}var q={exports:{}},Ce;function wt(){if(Ce)return q.exports;Ce=1;let e=process||{},t=e.argv||[],r=e.env||{},s=!(r.NO_COLOR||t.includes("--no-color"))&&(!!r.FORCE_COLOR||t.includes("--color")||e.platform==="win32"||(e.stdout||{}).isTTY&&r.TERM!=="dumb"||!!r.CI),o=(a,i,c=a)=>d=>{let u=""+d,f=u.indexOf(i,a.length);return~f?a+l(u,i,c,f)+i:a+u+i},l=(a,i,c,d)=>{let u="",f=0;do u+=a.substring(f,d)+c,f=d+i.length,d=a.indexOf(i,f);while(~d);return u+a.substring(f)},n=(a=s)=>{let i=a?o:()=>String;return{isColorSupported:a,reset:i("\x1B[0m","\x1B[0m"),bold:i("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:i("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:i("\x1B[3m","\x1B[23m"),underline:i("\x1B[4m","\x1B[24m"),inverse:i("\x1B[7m","\x1B[27m"),hidden:i("\x1B[8m","\x1B[28m"),strikethrough:i("\x1B[9m","\x1B[29m"),black:i("\x1B[30m","\x1B[39m"),red:i("\x1B[31m","\x1B[39m"),green:i("\x1B[32m","\x1B[39m"),yellow:i("\x1B[33m","\x1B[39m"),blue:i("\x1B[34m","\x1B[39m"),magenta:i("\x1B[35m","\x1B[39m"),cyan:i("\x1B[36m","\x1B[39m"),white:i("\x1B[37m","\x1B[39m"),gray:i("\x1B[90m","\x1B[39m"),bgBlack:i("\x1B[40m","\x1B[49m"),bgRed:i("\x1B[41m","\x1B[49m"),bgGreen:i("\x1B[42m","\x1B[49m"),bgYellow:i("\x1B[43m","\x1B[49m"),bgBlue:i("\x1B[44m","\x1B[49m"),bgMagenta:i("\x1B[45m","\x1B[49m"),bgCyan:i("\x1B[46m","\x1B[49m"),bgWhite:i("\x1B[47m","\x1B[49m"),blackBright:i("\x1B[90m","\x1B[39m"),redBright:i("\x1B[91m","\x1B[39m"),greenBright:i("\x1B[92m","\x1B[39m"),yellowBright:i("\x1B[93m","\x1B[39m"),blueBright:i("\x1B[94m","\x1B[39m"),magentaBright:i("\x1B[95m","\x1B[39m"),cyanBright:i("\x1B[96m","\x1B[39m"),whiteBright:i("\x1B[97m","\x1B[39m"),bgBlackBright:i("\x1B[100m","\x1B[49m"),bgRedBright:i("\x1B[101m","\x1B[49m"),bgGreenBright:i("\x1B[102m","\x1B[49m"),bgYellowBright:i("\x1B[103m","\x1B[49m"),bgBlueBright:i("\x1B[104m","\x1B[49m"),bgMagentaBright:i("\x1B[105m","\x1B[49m"),bgCyanBright:i("\x1B[106m","\x1B[49m"),bgWhiteBright:i("\x1B[107m","\x1B[49m")}};return q.exports=n(),q.exports.createColors=n,q.exports}var Be=wt();const vt=Ye(Be),{blue:_e,cyan:At}=vt,Ie=[{name:"vanilla",display:"Vanilla",description:"with playcanvas engine",color:Be.yellow,variants:[{name:"vanilla-ts",display:"TypeScript",color:_e}]},{name:"react",display:"React",description:"with @playcanvas/react",color:At,variants:[{name:"react-ts",display:"TypeScript",color:_e}]}],Ct=Ie.flatMap(e=>e.variants.map(t=>t.name));async function Bt({argTargetDir:e,defaultTargetDir:t,cancel:r}){let s=e?ae(String(e)):void 0;if(!s){const o=await ve({message:"Project name:",defaultValue:t,placeholder:t});z(o)&&r(),s=ae(o)}return s}async function _t({targetDir:e,argOverwrite:t,cancel:r}){if(B.existsSync(e)&&!gt(e)){const s=t?"yes":await ne({message:(e==="."?"Current directory":`Target directory "${e}"`)+" is not empty. Please choose how to proceed:",options:[{label:"Cancel operation",value:"no"},{label:"Remove existing files and continue",value:"yes"},{label:"Ignore files and continue",value:"ignore"}]});if(z(s))return r();switch(s){case"yes":bt(e);break;case"no":r();return}}}function De(e){return/^(?:@[a-z\d\-*~][a-z\d\-*._~]*\/)?[a-z\d\-~][a-z\d\-._~]*$/.test(e)}function Se(e){return e.trim().toLowerCase().replace(/\s+/g,"-").replace(/^[._]/,"").replace(/[^a-z\d\-~]+/g,"-")}async function It({targetDir:e,cancel:t}){let r=_.basename(_.resolve(e));if(!De(r)){const s=await ve({message:"Package name:",defaultValue:Se(r),placeholder:Se(r),validate(o){if(!o||!De(o))return"Invalid package.json name"}});if(z(s))return t();r=s}return r}async function Dt({argTemplate:e,FRAMEWORKS:t,TEMPLATES:r,pkgInfo:s,getFullCustomCommand:o,cancel:l}){let n=e,a=!1;if(e&&!r.includes(e)&&(n=void 0,a=!0),!n){const i=await ne({message:a?`"${e}" isn't a valid template. Please choose from below: `:"Select a framework:",options:t.map(c=>{const d=c.color;return{label:d(c.display||c.name),value:c,hint:c.description}})});if(z(i))return l();await ne({message:"Select a variant:",options:i.variants.map(c=>{const d=c.color,u=c.customCommand?o(c.customCommand,s).replace(/ TARGET_DIR$/,""):void 0;return{label:d(c.display||c.name),value:c.name,hint:u}})}),n=i.variants[0].name}return n}const j=je(process.argv.slice(2),{alias:{h:"help",t:"template",d:"delete"},boolean:["help","overwrite"],string:["template"]}),St=process.cwd(),Tt=`Usage: npm create playcanvas@latest [OPTION]...
|
|
45
50
|
|
|
46
51
|
Create a new PlayCanvas project in JavaScript or TypeScript.
|
|
47
52
|
With no arguments, start the CLI in interactive mode.
|
|
@@ -50,4 +55,4 @@ Options:
|
|
|
50
55
|
-t, --template NAME use a specific template
|
|
51
56
|
-h, --help show help
|
|
52
57
|
-d, --delete delete the project directory if it exists
|
|
53
|
-
`,
|
|
58
|
+
`,kt={_gitignore:".gitignore"},Mt="playcanvas-project";async function Rt(){const e=j._[0]?ae(String(j._[0])):void 0,t=j.template,r=j.overwrite;if(j.help){console.log(Tt);return}const s=Lt(process.env.npm_config_user_agent),o=()=>pt("Operation cancelled"),l=await Bt({argTargetDir:e,defaultTargetDir:Mt,cancel:o});await _t({targetDir:l,argOverwrite:r,cancel:o});const n=await It({targetDir:l,cancel:o}),a=await Dt({argTemplate:t,FRAMEWORKS:Ie,TEMPLATES:Ct,pkgInfo:s,getFullCustomCommand:Et,cancel:o});await yt({cwd:St,targetDir:l,template:a,packageName:n,renameFiles:kt,pkgInfo:s})}function Lt(e){if(!e)return;const t=e.split(" ")[0].split("/");return{name:t[0],version:t[1]}}Rt().catch(e=>{console.error(e)});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-playcanvas",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
4
4
|
"author": "PlayCanvas <support@playcanvas.com>",
|
|
5
5
|
"homepage": "https://github.com/playcanvas/create-playcanvas#readme",
|
|
6
6
|
"description": "Scaffold a PlayCanvas project",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
},
|
|
39
39
|
"license": "MIT",
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@clack/prompts": "^
|
|
42
|
-
"@types/node": "^25.0
|
|
41
|
+
"@clack/prompts": "^1.2.0",
|
|
42
|
+
"@types/node": "^25.6.0",
|
|
43
43
|
"cross-spawn": "^7.0.6",
|
|
44
44
|
"mri": "^1.2.0",
|
|
45
45
|
"picocolors": "^1.1.1",
|
|
@@ -14,16 +14,16 @@
|
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@playcanvas/react": "^0.11.3",
|
|
17
|
-
"playcanvas": "^2.
|
|
18
|
-
"react": "^19.2.
|
|
19
|
-
"react-dom": "^19.2.
|
|
17
|
+
"playcanvas": "^2.17.2",
|
|
18
|
+
"react": "^19.2.5",
|
|
19
|
+
"react-dom": "^19.2.5"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@types/react": "^19.2.
|
|
22
|
+
"@types/react": "^19.2.14",
|
|
23
23
|
"@types/react-dom": "^19.2.3",
|
|
24
|
-
"@vitejs/plugin-react": "^
|
|
25
|
-
"semver": "^7.7.
|
|
26
|
-
"typescript": "~
|
|
27
|
-
"vite": "^
|
|
24
|
+
"@vitejs/plugin-react": "^6.0.1",
|
|
25
|
+
"semver": "^7.7.4",
|
|
26
|
+
"typescript": "~6.0.2",
|
|
27
|
+
"vite": "^8.0.8"
|
|
28
28
|
}
|
|
29
29
|
}
|
|
@@ -10,12 +10,12 @@
|
|
|
10
10
|
"preview": "vite preview"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"playcanvas": "^2.
|
|
13
|
+
"playcanvas": "^2.17.2"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"semver": "^7.7.
|
|
17
|
-
"typescript": "~
|
|
18
|
-
"vite": "^
|
|
16
|
+
"semver": "^7.7.4",
|
|
17
|
+
"typescript": "~6.0.2",
|
|
18
|
+
"vite": "^8.0.8"
|
|
19
19
|
},
|
|
20
20
|
"engines": {
|
|
21
21
|
"node": "^20.19.0 || >=22.12.0"
|