agentica 0.19.0 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.mjs +18 -20
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import ae,{stdin as Si,stdout as Oi}from"node:process";import{promisify as Ri}from"node:util";import*as qe from"node:readline";import Bi from"node:readline";import{WriteStream as yr}from"node:tty";import xe from"events";import br from"child_process";import fe from"path";import ge from"fs";import xi from"process";import Se,{existsSync as ot}from"node:fs";import Oe,{rm as _r,appendFile as wr,readFile as at,writeFile as ht}from"node:fs/promises";import we,{join as be}from"node:path";import{exec as vr}from"node:child_process";import Ar from"node:os";import{pipeline as Sr}from"node:stream";import Ti from"stream";import $i from"string_decoder";import lt from"assert";import Or from"buffer";import Ni from"zlib";import Rr from"util";import Br from"crypto";var ct=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ii(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}function xr(u){if(Object.prototype.hasOwnProperty.call(u,"__esModule"))return u;var t=u.default;if(typeof t=="function"){var s=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};s.prototype=t.prototype}else s={};return Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(u).forEach(function(r){var i=Object.getOwnPropertyDescriptor(u,r);Object.defineProperty(s,r,i.get?i:{enumerable:!0,get:function(){return u[r]}})}),s}var Dt,Li;function Tr(){if(Li)return Dt;Li=1;const u="\x1B",t=`${u}[`,s="\x07",r={to(e,o){return o?`${t}${o+1};${e+1}H`:`${t}${e+1}G`},move(e,o){let h="";return e<0?h+=`${t}${-e}D`:e>0&&(h+=`${t}${e}C`),o<0?h+=`${t}${-o}A`:o>0&&(h+=`${t}${o}B`),h},up:(e=1)=>`${t}${e}A`,down:(e=1)=>`${t}${e}B`,forward:(e=1)=>`${t}${e}C`,backward:(e=1)=>`${t}${e}D`,nextLine:(e=1)=>`${t}E`.repeat(e),prevLine:(e=1)=>`${t}F`.repeat(e),left:`${t}G`,hide:`${t}?25l`,show:`${t}?25h`,save:`${u}7`,restore:`${u}8`},i={up:(e=1)=>`${t}S`.repeat(e),down:(e=1)=>`${t}T`.repeat(e)},a={screen:`${t}2J`,up:(e=1)=>`${t}1J`.repeat(e),down:(e=1)=>`${t}J`.repeat(e),line:`${t}2K`,lineEnd:`${t}K`,lineStart:`${t}1K`,lines(e){let o="";for(let h=0;h<e;h++)o+=this.line+(h<e-1?r.up():"");return e&&(o+=r.left),o}};return Dt={cursor:r,scroll:i,erase:a,beep:s},Dt}var me=Tr(),Ve={exports:{}},Mi;function $r(){if(Mi)return Ve.exports;Mi=1;let u=process||{},t=u.argv||[],s=u.env||{},r=!(s.NO_COLOR||t.includes("--no-color"))&&(!!s.FORCE_COLOR||t.includes("--color")||u.platform==="win32"||(u.stdout||{}).isTTY&&s.TERM!=="dumb"||!!s.CI),i=(o,h,E=o)=>y=>{let m=""+y,C=m.indexOf(h,o.length);return~C?o+a(m,h,E,C)+h:o+m+h},a=(o,h,E,y)=>{let m="",C=0;do m+=o.substring(C,y)+E,C=y+h.length,y=o.indexOf(h,C);while(~y);return m+o.substring(C)},e=(o=r)=>{let h=o?i:()=>String;return{isColorSupported:o,reset:h("\x1B[0m","\x1B[0m"),bold:h("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:h("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:h("\x1B[3m","\x1B[23m"),underline:h("\x1B[4m","\x1B[24m"),inverse:h("\x1B[7m","\x1B[27m"),hidden:h("\x1B[8m","\x1B[28m"),strikethrough:h("\x1B[9m","\x1B[29m"),black:h("\x1B[30m","\x1B[39m"),red:h("\x1B[31m","\x1B[39m"),green:h("\x1B[32m","\x1B[39m"),yellow:h("\x1B[33m","\x1B[39m"),blue:h("\x1B[34m","\x1B[39m"),magenta:h("\x1B[35m","\x1B[39m"),cyan:h("\x1B[36m","\x1B[39m"),white:h("\x1B[37m","\x1B[39m"),gray:h("\x1B[90m","\x1B[39m"),bgBlack:h("\x1B[40m","\x1B[49m"),bgRed:h("\x1B[41m","\x1B[49m"),bgGreen:h("\x1B[42m","\x1B[49m"),bgYellow:h("\x1B[43m","\x1B[49m"),bgBlue:h("\x1B[44m","\x1B[49m"),bgMagenta:h("\x1B[45m","\x1B[49m"),bgCyan:h("\x1B[46m","\x1B[49m"),bgWhite:h("\x1B[47m","\x1B[49m"),blackBright:h("\x1B[90m","\x1B[39m"),redBright:h("\x1B[91m","\x1B[39m"),greenBright:h("\x1B[92m","\x1B[39m"),yellowBright:h("\x1B[93m","\x1B[39m"),blueBright:h("\x1B[94m","\x1B[39m"),magentaBright:h("\x1B[95m","\x1B[39m"),cyanBright:h("\x1B[96m","\x1B[39m"),whiteBright:h("\x1B[97m","\x1B[39m"),bgBlackBright:h("\x1B[100m","\x1B[49m"),bgRedBright:h("\x1B[101m","\x1B[49m"),bgGreenBright:h("\x1B[102m","\x1B[49m"),bgYellowBright:h("\x1B[103m","\x1B[49m"),bgBlueBright:h("\x1B[104m","\x1B[49m"),bgMagentaBright:h("\x1B[105m","\x1B[49m"),bgCyanBright:h("\x1B[106m","\x1B[49m"),bgWhiteBright:h("\x1B[107m","\x1B[49m")}};return Ve.exports=e(),Ve.exports.createColors=e,Ve.exports}var de=$r();const I=Ii(de);function Nr({onlyFirst:u=!1}={}){const t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(t,u?void 0:"g")}const Ir=Nr();function Pi(u){if(typeof u!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof u}\``);return u.replace(Ir,"")}function ki(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}var ji={exports:{}};(function(u){var t={};u.exports=t,t.eastAsianWidth=function(r){var i=r.charCodeAt(0),a=r.length==2?r.charCodeAt(1):0,e=i;return 55296<=i&&i<=56319&&56320<=a&&a<=57343&&(i&=1023,a&=1023,e=i<<10|a,e+=65536),e==12288||65281<=e&&e<=65376||65504<=e&&e<=65510?"F":e==8361||65377<=e&&e<=65470||65474<=e&&e<=65479||65482<=e&&e<=65487||65490<=e&&e<=65495||65498<=e&&e<=65500||65512<=e&&e<=65518?"H":4352<=e&&e<=4447||4515<=e&&e<=4519||4602<=e&&e<=4607||9001<=e&&e<=9002||11904<=e&&e<=11929||11931<=e&&e<=12019||12032<=e&&e<=12245||12272<=e&&e<=12283||12289<=e&&e<=12350||12353<=e&&e<=12438||12441<=e&&e<=12543||12549<=e&&e<=12589||12593<=e&&e<=12686||12688<=e&&e<=12730||12736<=e&&e<=12771||12784<=e&&e<=12830||12832<=e&&e<=12871||12880<=e&&e<=13054||13056<=e&&e<=19903||19968<=e&&e<=42124||42128<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||55216<=e&&e<=55238||55243<=e&&e<=55291||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65106||65108<=e&&e<=65126||65128<=e&&e<=65131||110592<=e&&e<=110593||127488<=e&&e<=127490||127504<=e&&e<=127546||127552<=e&&e<=127560||127568<=e&&e<=127569||131072<=e&&e<=194367||177984<=e&&e<=196605||196608<=e&&e<=262141?"W":32<=e&&e<=126||162<=e&&e<=163||165<=e&&e<=166||e==172||e==175||10214<=e&&e<=10221||10629<=e&&e<=10630?"Na":e==161||e==164||167<=e&&e<=168||e==170||173<=e&&e<=174||176<=e&&e<=180||182<=e&&e<=186||188<=e&&e<=191||e==198||e==208||215<=e&&e<=216||222<=e&&e<=225||e==230||232<=e&&e<=234||236<=e&&e<=237||e==240||242<=e&&e<=243||247<=e&&e<=250||e==252||e==254||e==257||e==273||e==275||e==283||294<=e&&e<=295||e==299||305<=e&&e<=307||e==312||319<=e&&e<=322||e==324||328<=e&&e<=331||e==333||338<=e&&e<=339||358<=e&&e<=359||e==363||e==462||e==464||e==466||e==468||e==470||e==472||e==474||e==476||e==593||e==609||e==708||e==711||713<=e&&e<=715||e==717||e==720||728<=e&&e<=731||e==733||e==735||768<=e&&e<=879||913<=e&&e<=929||931<=e&&e<=937||945<=e&&e<=961||963<=e&&e<=969||e==1025||1040<=e&&e<=1103||e==1105||e==8208||8211<=e&&e<=8214||8216<=e&&e<=8217||8220<=e&&e<=8221||8224<=e&&e<=8226||8228<=e&&e<=8231||e==8240||8242<=e&&e<=8243||e==8245||e==8251||e==8254||e==8308||e==8319||8321<=e&&e<=8324||e==8364||e==8451||e==8453||e==8457||e==8467||e==8470||8481<=e&&e<=8482||e==8486||e==8491||8531<=e&&e<=8532||8539<=e&&e<=8542||8544<=e&&e<=8555||8560<=e&&e<=8569||e==8585||8592<=e&&e<=8601||8632<=e&&e<=8633||e==8658||e==8660||e==8679||e==8704||8706<=e&&e<=8707||8711<=e&&e<=8712||e==8715||e==8719||e==8721||e==8725||e==8730||8733<=e&&e<=8736||e==8739||e==8741||8743<=e&&e<=8748||e==8750||8756<=e&&e<=8759||8764<=e&&e<=8765||e==8776||e==8780||e==8786||8800<=e&&e<=8801||8804<=e&&e<=8807||8810<=e&&e<=8811||8814<=e&&e<=8815||8834<=e&&e<=8835||8838<=e&&e<=8839||e==8853||e==8857||e==8869||e==8895||e==8978||9312<=e&&e<=9449||9451<=e&&e<=9547||9552<=e&&e<=9587||9600<=e&&e<=9615||9618<=e&&e<=9621||9632<=e&&e<=9633||9635<=e&&e<=9641||9650<=e&&e<=9651||9654<=e&&e<=9655||9660<=e&&e<=9661||9664<=e&&e<=9665||9670<=e&&e<=9672||e==9675||9678<=e&&e<=9681||9698<=e&&e<=9701||e==9711||9733<=e&&e<=9734||e==9737||9742<=e&&e<=9743||9748<=e&&e<=9749||e==9756||e==9758||e==9792||e==9794||9824<=e&&e<=9825||9827<=e&&e<=9829||9831<=e&&e<=9834||9836<=e&&e<=9837||e==9839||9886<=e&&e<=9887||9918<=e&&e<=9919||9924<=e&&e<=9933||9935<=e&&e<=9953||e==9955||9960<=e&&e<=9983||e==10045||e==10071||10102<=e&&e<=10111||11093<=e&&e<=11097||12872<=e&&e<=12879||57344<=e&&e<=63743||65024<=e&&e<=65039||e==65533||127232<=e&&e<=127242||127248<=e&&e<=127277||127280<=e&&e<=127337||127344<=e&&e<=127386||917760<=e&&e<=917999||983040<=e&&e<=1048573||1048576<=e&&e<=1114109?"A":"N"},t.characterLength=function(r){var i=this.eastAsianWidth(r);return i=="F"||i=="W"||i=="A"?2:1};function s(r){return r.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}t.length=function(r){for(var i=s(r),a=0,e=0;e<i.length;e++)a=a+this.characterLength(i[e]);return a},t.slice=function(r,i,a){textLen=t.length(r),i=i||0,a=a||1,i<0&&(i=textLen+i),a<0&&(a=textLen+a);for(var e="",o=0,h=s(r),E=0;E<h.length;E++){var y=h[E],m=t.length(y);if(o>=i-(m==2?1:0))if(o+m<=a)e+=y;else break;o+=m}return e}})(ji);var Lr=ji.exports;const Mr=ki(Lr);var Pr=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 kr=ki(Pr);function Te(u,t={}){if(typeof u!="string"||u.length===0||(t={ambiguousIsNarrow:!0,...t},u=Pi(u),u.length===0))return 0;u=u.replace(kr()," ");const s=t.ambiguousIsNarrow?1:2;let r=0;for(const i of u){const a=i.codePointAt(0);if(!(a<=31||a>=127&&a<=159||a>=768&&a<=879))switch(Mr.eastAsianWidth(i)){case"F":case"W":r+=2;break;case"A":r+=s;break;default:r+=1}}return r}const ft=10,Hi=(u=0)=>t=>`\x1B[${t+u}m`,Ui=(u=0)=>t=>`\x1B[${38+u};5;${t}m`,zi=(u=0)=>(t,s,r)=>`\x1B[${38+u};2;${t};${s};${r}m`,ne={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(ne.modifier);const jr=Object.keys(ne.color),Hr=Object.keys(ne.bgColor);[...jr,...Hr];function Ur(){const u=new Map;for(const[t,s]of Object.entries(ne)){for(const[r,i]of Object.entries(s))ne[r]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},s[r]=ne[r],u.set(i[0],i[1]);Object.defineProperty(ne,t,{value:s,enumerable:!1})}return Object.defineProperty(ne,"codes",{value:u,enumerable:!1}),ne.color.close="\x1B[39m",ne.bgColor.close="\x1B[49m",ne.color.ansi=Hi(),ne.color.ansi256=Ui(),ne.color.ansi16m=zi(),ne.bgColor.ansi=Hi(ft),ne.bgColor.ansi256=Ui(ft),ne.bgColor.ansi16m=zi(ft),Object.defineProperties(ne,{rgbToAnsi256:{value:(t,s,r)=>t===s&&s===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(s/255*5)+Math.round(r/255*5),enumerable:!1},hexToRgb:{value:t=>{const s=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!s)return[0,0,0];let[r]=s;r.length===3&&(r=[...r].map(a=>a+a).join(""));const i=Number.parseInt(r,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:t=>ne.rgbToAnsi256(...ne.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value:t=>{if(t<8)return 30+t;if(t<16)return 90+(t-8);let s,r,i;if(t>=232)s=((t-232)*10+8)/255,r=s,i=s;else{t-=16;const o=t%36;s=Math.floor(t/36)/5,r=Math.floor(o/6)/5,i=o%6/5}const a=Math.max(s,r,i)*2;if(a===0)return 30;let e=30+(Math.round(i)<<2|Math.round(r)<<1|Math.round(s));return a===2&&(e+=60),e},enumerable:!1},rgbToAnsi:{value:(t,s,r)=>ne.ansi256ToAnsi(ne.rgbToAnsi256(t,s,r)),enumerable:!1},hexToAnsi:{value:t=>ne.ansi256ToAnsi(ne.hexToAnsi256(t)),enumerable:!1}}),ne}const zr=Ur(),We=new Set(["\x1B","\x9B"]),Gr=39,dt="\x07",Gi="[",qr="]",qi="m",mt=`${qr}8;;`,Vi=u=>`${We.values().next().value}${Gi}${u}${qi}`,Wi=u=>`${We.values().next().value}${mt}${u}${dt}`,Vr=u=>u.split(" ").map(t=>Te(t)),pt=(u,t,s)=>{const r=[...t];let i=!1,a=!1,e=Te(Pi(u[u.length-1]));for(const[o,h]of r.entries()){const E=Te(h);if(e+E<=s?u[u.length-1]+=h:(u.push(h),e=0),We.has(h)&&(i=!0,a=r.slice(o+1).join("").startsWith(mt)),i){a?h===dt&&(i=!1,a=!1):h===qi&&(i=!1);continue}e+=E,e===s&&o<r.length-1&&(u.push(""),e=0)}!e&&u[u.length-1].length>0&&u.length>1&&(u[u.length-2]+=u.pop())},Wr=u=>{const t=u.split(" ");let s=t.length;for(;s>0&&!(Te(t[s-1])>0);)s--;return s===t.length?u:t.slice(0,s).join(" ")+t.slice(s).join("")},Kr=(u,t,s={})=>{if(s.trim!==!1&&u.trim()==="")return"";let r="",i,a;const e=Vr(u);let o=[""];for(const[E,y]of u.split(" ").entries()){s.trim!==!1&&(o[o.length-1]=o[o.length-1].trimStart());let m=Te(o[o.length-1]);if(E!==0&&(m>=t&&(s.wordWrap===!1||s.trim===!1)&&(o.push(""),m=0),(m>0||s.trim===!1)&&(o[o.length-1]+=" ",m++)),s.hard&&e[E]>t){const C=t-m,_=1+Math.floor((e[E]-C-1)/t);Math.floor((e[E]-1)/t)<_&&o.push(""),pt(o,y,t);continue}if(m+e[E]>t&&m>0&&e[E]>0){if(s.wordWrap===!1&&m<t){pt(o,y,t);continue}o.push("")}if(m+e[E]>t&&s.wordWrap===!1){pt(o,y,t);continue}o[o.length-1]+=y}s.trim!==!1&&(o=o.map(E=>Wr(E)));const h=[...o.join(`
1
+ import ae,{stdin as Si,stdout as Oi}from"node:process";import{promisify as Ri}from"node:util";import*as qe from"node:readline";import Bi from"node:readline";import{WriteStream as yr}from"node:tty";import xe from"events";import br from"child_process";import De from"path";import ge from"fs";import xi from"process";import Se,{existsSync as ot}from"node:fs";import Oe,{rm as _r,appendFile as wr,readFile as at,writeFile as ht}from"node:fs/promises";import we,{join as be}from"node:path";import{exec as vr}from"node:child_process";import Ar from"node:os";import{pipeline as Sr}from"node:stream";import Ti from"stream";import $i from"string_decoder";import lt from"assert";import Or from"buffer";import Ni from"zlib";import Rr from"util";import Br from"crypto";var ct=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ii(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}function xr(u){if(Object.prototype.hasOwnProperty.call(u,"__esModule"))return u;var t=u.default;if(typeof t=="function"){var s=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};s.prototype=t.prototype}else s={};return Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(u).forEach(function(r){var i=Object.getOwnPropertyDescriptor(u,r);Object.defineProperty(s,r,i.get?i:{enumerable:!0,get:function(){return u[r]}})}),s}var Dt,Li;function Tr(){if(Li)return Dt;Li=1;const u="\x1B",t=`${u}[`,s="\x07",r={to(e,o){return o?`${t}${o+1};${e+1}H`:`${t}${e+1}G`},move(e,o){let h="";return e<0?h+=`${t}${-e}D`:e>0&&(h+=`${t}${e}C`),o<0?h+=`${t}${-o}A`:o>0&&(h+=`${t}${o}B`),h},up:(e=1)=>`${t}${e}A`,down:(e=1)=>`${t}${e}B`,forward:(e=1)=>`${t}${e}C`,backward:(e=1)=>`${t}${e}D`,nextLine:(e=1)=>`${t}E`.repeat(e),prevLine:(e=1)=>`${t}F`.repeat(e),left:`${t}G`,hide:`${t}?25l`,show:`${t}?25h`,save:`${u}7`,restore:`${u}8`},i={up:(e=1)=>`${t}S`.repeat(e),down:(e=1)=>`${t}T`.repeat(e)},a={screen:`${t}2J`,up:(e=1)=>`${t}1J`.repeat(e),down:(e=1)=>`${t}J`.repeat(e),line:`${t}2K`,lineEnd:`${t}K`,lineStart:`${t}1K`,lines(e){let o="";for(let h=0;h<e;h++)o+=this.line+(h<e-1?r.up():"");return e&&(o+=r.left),o}};return Dt={cursor:r,scroll:i,erase:a,beep:s},Dt}var de=Tr(),Ve={exports:{}},Mi;function $r(){if(Mi)return Ve.exports;Mi=1;let u=process||{},t=u.argv||[],s=u.env||{},r=!(s.NO_COLOR||t.includes("--no-color"))&&(!!s.FORCE_COLOR||t.includes("--color")||u.platform==="win32"||(u.stdout||{}).isTTY&&s.TERM!=="dumb"||!!s.CI),i=(o,h,E=o)=>y=>{let m=""+y,C=m.indexOf(h,o.length);return~C?o+a(m,h,E,C)+h:o+m+h},a=(o,h,E,y)=>{let m="",C=0;do m+=o.substring(C,y)+E,C=y+h.length,y=o.indexOf(h,C);while(~y);return m+o.substring(C)},e=(o=r)=>{let h=o?i:()=>String;return{isColorSupported:o,reset:h("\x1B[0m","\x1B[0m"),bold:h("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:h("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:h("\x1B[3m","\x1B[23m"),underline:h("\x1B[4m","\x1B[24m"),inverse:h("\x1B[7m","\x1B[27m"),hidden:h("\x1B[8m","\x1B[28m"),strikethrough:h("\x1B[9m","\x1B[29m"),black:h("\x1B[30m","\x1B[39m"),red:h("\x1B[31m","\x1B[39m"),green:h("\x1B[32m","\x1B[39m"),yellow:h("\x1B[33m","\x1B[39m"),blue:h("\x1B[34m","\x1B[39m"),magenta:h("\x1B[35m","\x1B[39m"),cyan:h("\x1B[36m","\x1B[39m"),white:h("\x1B[37m","\x1B[39m"),gray:h("\x1B[90m","\x1B[39m"),bgBlack:h("\x1B[40m","\x1B[49m"),bgRed:h("\x1B[41m","\x1B[49m"),bgGreen:h("\x1B[42m","\x1B[49m"),bgYellow:h("\x1B[43m","\x1B[49m"),bgBlue:h("\x1B[44m","\x1B[49m"),bgMagenta:h("\x1B[45m","\x1B[49m"),bgCyan:h("\x1B[46m","\x1B[49m"),bgWhite:h("\x1B[47m","\x1B[49m"),blackBright:h("\x1B[90m","\x1B[39m"),redBright:h("\x1B[91m","\x1B[39m"),greenBright:h("\x1B[92m","\x1B[39m"),yellowBright:h("\x1B[93m","\x1B[39m"),blueBright:h("\x1B[94m","\x1B[39m"),magentaBright:h("\x1B[95m","\x1B[39m"),cyanBright:h("\x1B[96m","\x1B[39m"),whiteBright:h("\x1B[97m","\x1B[39m"),bgBlackBright:h("\x1B[100m","\x1B[49m"),bgRedBright:h("\x1B[101m","\x1B[49m"),bgGreenBright:h("\x1B[102m","\x1B[49m"),bgYellowBright:h("\x1B[103m","\x1B[49m"),bgBlueBright:h("\x1B[104m","\x1B[49m"),bgMagentaBright:h("\x1B[105m","\x1B[49m"),bgCyanBright:h("\x1B[106m","\x1B[49m"),bgWhiteBright:h("\x1B[107m","\x1B[49m")}};return Ve.exports=e(),Ve.exports.createColors=e,Ve.exports}var pe=$r();const I=Ii(pe);function Nr({onlyFirst:u=!1}={}){const t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(t,u?void 0:"g")}const Ir=Nr();function Pi(u){if(typeof u!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof u}\``);return u.replace(Ir,"")}function ki(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}var Hi={exports:{}};(function(u){var t={};u.exports=t,t.eastAsianWidth=function(r){var i=r.charCodeAt(0),a=r.length==2?r.charCodeAt(1):0,e=i;return 55296<=i&&i<=56319&&56320<=a&&a<=57343&&(i&=1023,a&=1023,e=i<<10|a,e+=65536),e==12288||65281<=e&&e<=65376||65504<=e&&e<=65510?"F":e==8361||65377<=e&&e<=65470||65474<=e&&e<=65479||65482<=e&&e<=65487||65490<=e&&e<=65495||65498<=e&&e<=65500||65512<=e&&e<=65518?"H":4352<=e&&e<=4447||4515<=e&&e<=4519||4602<=e&&e<=4607||9001<=e&&e<=9002||11904<=e&&e<=11929||11931<=e&&e<=12019||12032<=e&&e<=12245||12272<=e&&e<=12283||12289<=e&&e<=12350||12353<=e&&e<=12438||12441<=e&&e<=12543||12549<=e&&e<=12589||12593<=e&&e<=12686||12688<=e&&e<=12730||12736<=e&&e<=12771||12784<=e&&e<=12830||12832<=e&&e<=12871||12880<=e&&e<=13054||13056<=e&&e<=19903||19968<=e&&e<=42124||42128<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||55216<=e&&e<=55238||55243<=e&&e<=55291||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65106||65108<=e&&e<=65126||65128<=e&&e<=65131||110592<=e&&e<=110593||127488<=e&&e<=127490||127504<=e&&e<=127546||127552<=e&&e<=127560||127568<=e&&e<=127569||131072<=e&&e<=194367||177984<=e&&e<=196605||196608<=e&&e<=262141?"W":32<=e&&e<=126||162<=e&&e<=163||165<=e&&e<=166||e==172||e==175||10214<=e&&e<=10221||10629<=e&&e<=10630?"Na":e==161||e==164||167<=e&&e<=168||e==170||173<=e&&e<=174||176<=e&&e<=180||182<=e&&e<=186||188<=e&&e<=191||e==198||e==208||215<=e&&e<=216||222<=e&&e<=225||e==230||232<=e&&e<=234||236<=e&&e<=237||e==240||242<=e&&e<=243||247<=e&&e<=250||e==252||e==254||e==257||e==273||e==275||e==283||294<=e&&e<=295||e==299||305<=e&&e<=307||e==312||319<=e&&e<=322||e==324||328<=e&&e<=331||e==333||338<=e&&e<=339||358<=e&&e<=359||e==363||e==462||e==464||e==466||e==468||e==470||e==472||e==474||e==476||e==593||e==609||e==708||e==711||713<=e&&e<=715||e==717||e==720||728<=e&&e<=731||e==733||e==735||768<=e&&e<=879||913<=e&&e<=929||931<=e&&e<=937||945<=e&&e<=961||963<=e&&e<=969||e==1025||1040<=e&&e<=1103||e==1105||e==8208||8211<=e&&e<=8214||8216<=e&&e<=8217||8220<=e&&e<=8221||8224<=e&&e<=8226||8228<=e&&e<=8231||e==8240||8242<=e&&e<=8243||e==8245||e==8251||e==8254||e==8308||e==8319||8321<=e&&e<=8324||e==8364||e==8451||e==8453||e==8457||e==8467||e==8470||8481<=e&&e<=8482||e==8486||e==8491||8531<=e&&e<=8532||8539<=e&&e<=8542||8544<=e&&e<=8555||8560<=e&&e<=8569||e==8585||8592<=e&&e<=8601||8632<=e&&e<=8633||e==8658||e==8660||e==8679||e==8704||8706<=e&&e<=8707||8711<=e&&e<=8712||e==8715||e==8719||e==8721||e==8725||e==8730||8733<=e&&e<=8736||e==8739||e==8741||8743<=e&&e<=8748||e==8750||8756<=e&&e<=8759||8764<=e&&e<=8765||e==8776||e==8780||e==8786||8800<=e&&e<=8801||8804<=e&&e<=8807||8810<=e&&e<=8811||8814<=e&&e<=8815||8834<=e&&e<=8835||8838<=e&&e<=8839||e==8853||e==8857||e==8869||e==8895||e==8978||9312<=e&&e<=9449||9451<=e&&e<=9547||9552<=e&&e<=9587||9600<=e&&e<=9615||9618<=e&&e<=9621||9632<=e&&e<=9633||9635<=e&&e<=9641||9650<=e&&e<=9651||9654<=e&&e<=9655||9660<=e&&e<=9661||9664<=e&&e<=9665||9670<=e&&e<=9672||e==9675||9678<=e&&e<=9681||9698<=e&&e<=9701||e==9711||9733<=e&&e<=9734||e==9737||9742<=e&&e<=9743||9748<=e&&e<=9749||e==9756||e==9758||e==9792||e==9794||9824<=e&&e<=9825||9827<=e&&e<=9829||9831<=e&&e<=9834||9836<=e&&e<=9837||e==9839||9886<=e&&e<=9887||9918<=e&&e<=9919||9924<=e&&e<=9933||9935<=e&&e<=9953||e==9955||9960<=e&&e<=9983||e==10045||e==10071||10102<=e&&e<=10111||11093<=e&&e<=11097||12872<=e&&e<=12879||57344<=e&&e<=63743||65024<=e&&e<=65039||e==65533||127232<=e&&e<=127242||127248<=e&&e<=127277||127280<=e&&e<=127337||127344<=e&&e<=127386||917760<=e&&e<=917999||983040<=e&&e<=1048573||1048576<=e&&e<=1114109?"A":"N"},t.characterLength=function(r){var i=this.eastAsianWidth(r);return i=="F"||i=="W"||i=="A"?2:1};function s(r){return r.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}t.length=function(r){for(var i=s(r),a=0,e=0;e<i.length;e++)a=a+this.characterLength(i[e]);return a},t.slice=function(r,i,a){textLen=t.length(r),i=i||0,a=a||1,i<0&&(i=textLen+i),a<0&&(a=textLen+a);for(var e="",o=0,h=s(r),E=0;E<h.length;E++){var y=h[E],m=t.length(y);if(o>=i-(m==2?1:0))if(o+m<=a)e+=y;else break;o+=m}return e}})(Hi);var Lr=Hi.exports;const Mr=ki(Lr);var Pr=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 kr=ki(Pr);function Te(u,t={}){if(typeof u!="string"||u.length===0||(t={ambiguousIsNarrow:!0,...t},u=Pi(u),u.length===0))return 0;u=u.replace(kr()," ");const s=t.ambiguousIsNarrow?1:2;let r=0;for(const i of u){const a=i.codePointAt(0);if(!(a<=31||a>=127&&a<=159||a>=768&&a<=879))switch(Mr.eastAsianWidth(i)){case"F":case"W":r+=2;break;case"A":r+=s;break;default:r+=1}}return r}const ft=10,ji=(u=0)=>t=>`\x1B[${t+u}m`,Ui=(u=0)=>t=>`\x1B[${38+u};5;${t}m`,zi=(u=0)=>(t,s,r)=>`\x1B[${38+u};2;${t};${s};${r}m`,ne={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(ne.modifier);const Hr=Object.keys(ne.color),jr=Object.keys(ne.bgColor);[...Hr,...jr];function Ur(){const u=new Map;for(const[t,s]of Object.entries(ne)){for(const[r,i]of Object.entries(s))ne[r]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},s[r]=ne[r],u.set(i[0],i[1]);Object.defineProperty(ne,t,{value:s,enumerable:!1})}return Object.defineProperty(ne,"codes",{value:u,enumerable:!1}),ne.color.close="\x1B[39m",ne.bgColor.close="\x1B[49m",ne.color.ansi=ji(),ne.color.ansi256=Ui(),ne.color.ansi16m=zi(),ne.bgColor.ansi=ji(ft),ne.bgColor.ansi256=Ui(ft),ne.bgColor.ansi16m=zi(ft),Object.defineProperties(ne,{rgbToAnsi256:{value:(t,s,r)=>t===s&&s===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(s/255*5)+Math.round(r/255*5),enumerable:!1},hexToRgb:{value:t=>{const s=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!s)return[0,0,0];let[r]=s;r.length===3&&(r=[...r].map(a=>a+a).join(""));const i=Number.parseInt(r,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:t=>ne.rgbToAnsi256(...ne.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value:t=>{if(t<8)return 30+t;if(t<16)return 90+(t-8);let s,r,i;if(t>=232)s=((t-232)*10+8)/255,r=s,i=s;else{t-=16;const o=t%36;s=Math.floor(t/36)/5,r=Math.floor(o/6)/5,i=o%6/5}const a=Math.max(s,r,i)*2;if(a===0)return 30;let e=30+(Math.round(i)<<2|Math.round(r)<<1|Math.round(s));return a===2&&(e+=60),e},enumerable:!1},rgbToAnsi:{value:(t,s,r)=>ne.ansi256ToAnsi(ne.rgbToAnsi256(t,s,r)),enumerable:!1},hexToAnsi:{value:t=>ne.ansi256ToAnsi(ne.hexToAnsi256(t)),enumerable:!1}}),ne}const zr=Ur(),We=new Set(["\x1B","\x9B"]),Gr=39,dt="\x07",Gi="[",qr="]",qi="m",mt=`${qr}8;;`,Vi=u=>`${We.values().next().value}${Gi}${u}${qi}`,Wi=u=>`${We.values().next().value}${mt}${u}${dt}`,Vr=u=>u.split(" ").map(t=>Te(t)),pt=(u,t,s)=>{const r=[...t];let i=!1,a=!1,e=Te(Pi(u[u.length-1]));for(const[o,h]of r.entries()){const E=Te(h);if(e+E<=s?u[u.length-1]+=h:(u.push(h),e=0),We.has(h)&&(i=!0,a=r.slice(o+1).join("").startsWith(mt)),i){a?h===dt&&(i=!1,a=!1):h===qi&&(i=!1);continue}e+=E,e===s&&o<r.length-1&&(u.push(""),e=0)}!e&&u[u.length-1].length>0&&u.length>1&&(u[u.length-2]+=u.pop())},Wr=u=>{const t=u.split(" ");let s=t.length;for(;s>0&&!(Te(t[s-1])>0);)s--;return s===t.length?u:t.slice(0,s).join(" ")+t.slice(s).join("")},Kr=(u,t,s={})=>{if(s.trim!==!1&&u.trim()==="")return"";let r="",i,a;const e=Vr(u);let o=[""];for(const[E,y]of u.split(" ").entries()){s.trim!==!1&&(o[o.length-1]=o[o.length-1].trimStart());let m=Te(o[o.length-1]);if(E!==0&&(m>=t&&(s.wordWrap===!1||s.trim===!1)&&(o.push(""),m=0),(m>0||s.trim===!1)&&(o[o.length-1]+=" ",m++)),s.hard&&e[E]>t){const C=t-m,_=1+Math.floor((e[E]-C-1)/t);Math.floor((e[E]-1)/t)<_&&o.push(""),pt(o,y,t);continue}if(m+e[E]>t&&m>0&&e[E]>0){if(s.wordWrap===!1&&m<t){pt(o,y,t);continue}o.push("")}if(m+e[E]>t&&s.wordWrap===!1){pt(o,y,t);continue}o[o.length-1]+=y}s.trim!==!1&&(o=o.map(E=>Wr(E)));const h=[...o.join(`
2
2
  `)];for(const[E,y]of h.entries()){if(r+=y,We.has(y)){const{groups:C}=new RegExp(`(?:\\${Gi}(?<code>\\d+)m|\\${mt}(?<uri>.*)${dt})`).exec(h.slice(E).join(""))||{groups:{}};if(C.code!==void 0){const _=Number.parseFloat(C.code);i=_===Gr?void 0:_}else C.uri!==void 0&&(a=C.uri.length===0?void 0:C.uri)}const m=zr.codes.get(Number(i));h[E+1]===`
3
3
  `?(a&&(r+=Wi("")),i&&m&&(r+=Vi(m))):y===`
4
4
  `&&(i&&m&&(r+=Vi(i)),a&&(r+=Wi(a)))}return r};function Ki(u,t,s){return String(u).normalize().replace(/\r\n/g,`
@@ -6,12 +6,12 @@ import ae,{stdin as Si,stdout as Oi}from"node:process";import{promisify as Ri}fr
6
6
  `).map(r=>Kr(r,t,s)).join(`
7
7
  `)}const Yr=["up","down","left","right","space","enter","cancel"],Ke={actions:new Set(Yr),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]])};function Et(u,t){if(typeof u=="string")return Ke.aliases.get(u)===t;for(const s of u)if(s!==void 0&&Et(s,t))return!0;return!1}function Zr(u,t){if(u===t)return;const s=u.split(`
8
8
  `),r=t.split(`
9
- `),i=[];for(let a=0;a<Math.max(s.length,r.length);a++)s[a]!==r[a]&&i.push(a);return i}const Xr=globalThis.process.platform.startsWith("win"),gt=Symbol("clack:cancel");function _e(u){return u===gt}function Ye(u,t){const s=u;s.isTTY&&s.setRawMode(t)}function Jr({input:u=Si,output:t=Oi,overwrite:s=!0,hideCursor:r=!0}={}){const i=qe.createInterface({input:u,output:t,prompt:"",tabSize:1});qe.emitKeypressEvents(u,i),u.isTTY&&u.setRawMode(!0);const a=(e,{name:o,sequence:h})=>{const E=String(e);if(Et([E,o,h],"cancel")){r&&t.write(me.cursor.show),process.exit(0);return}if(!s)return;const y=o==="return"?0:-1,m=o==="return"?-1:0;qe.moveCursor(t,y,m,()=>{qe.clearLine(t,1,()=>{u.once("keypress",a)})})};return r&&t.write(me.cursor.hide),u.once("keypress",a),()=>{u.off("keypress",a),r&&t.write(me.cursor.show),u.isTTY&&!Xr&&u.setRawMode(!1),i.terminal=!1,i.close()}}var Qr=Object.defineProperty,en=(u,t,s)=>t in u?Qr(u,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):u[t]=s,Ce=(u,t,s)=>(en(u,typeof t!="symbol"?t+"":t,s),s);class Ze{constructor(t,s=!0){Ce(this,"input"),Ce(this,"output"),Ce(this,"_abortSignal"),Ce(this,"rl"),Ce(this,"opts"),Ce(this,"_render"),Ce(this,"_track",!1),Ce(this,"_prevFrame",""),Ce(this,"_subscribers",new Map),Ce(this,"_cursor",0),Ce(this,"state","initial"),Ce(this,"error",""),Ce(this,"value");const{input:r=Si,output:i=Oi,render:a,signal:e,...o}=t;this.opts=o,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=a.bind(this),this._track=s,this._abortSignal=e,this.input=r,this.output=i}unsubscribe(){this._subscribers.clear()}setSubscriber(t,s){const r=this._subscribers.get(t)??[];r.push(s),this._subscribers.set(t,r)}on(t,s){this.setSubscriber(t,{cb:s})}once(t,s){this.setSubscriber(t,{cb:s,once:!0})}emit(t,...s){const r=this._subscribers.get(t)??[],i=[];for(const a of r)a.cb(...s),a.once&&i.push(()=>r.splice(r.indexOf(a),1));for(const a of i)a()}prompt(){return new Promise((t,s)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),t(gt);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}const r=new yr(0);r._write=(i,a,e)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,""),this._cursor=this.rl?.cursor??0,this.emit("value",this.value)),e()},this.input.pipe(r),this.rl=Bi.createInterface({input:this.input,output:r,tabSize:2,prompt:"",escapeCodeTimeout:50}),Bi.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),Ye(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(me.cursor.show),this.output.off("resize",this.render),Ye(this.input,!1),t(this.value)}),this.once("cancel",()=>{this.output.write(me.cursor.show),this.output.off("resize",this.render),Ye(this.input,!1),t(gt)})})}onKeypress(t,s){if(this.state==="error"&&(this.state="active"),s?.name&&(!this._track&&Ke.aliases.has(s.name)&&this.emit("cursor",Ke.aliases.get(s.name)),Ke.actions.has(s.name)&&this.emit("cursor",s.name)),t&&(t.toLowerCase()==="y"||t.toLowerCase()==="n")&&this.emit("confirm",t.toLowerCase()==="y"),t===" "&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),t&&this.emit("key",t.toLowerCase()),s?.name==="return"){if(this.opts.validate){const r=this.opts.validate(this.value);r&&(this.error=r instanceof Error?r.message:r,this.state="error",this.rl?.write(this.value))}this.state!=="error"&&(this.state="submit")}Et([t,s?.name,s?.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(`
9
+ `),i=[];for(let a=0;a<Math.max(s.length,r.length);a++)s[a]!==r[a]&&i.push(a);return i}const Xr=globalThis.process.platform.startsWith("win"),gt=Symbol("clack:cancel");function _e(u){return u===gt}function Ye(u,t){const s=u;s.isTTY&&s.setRawMode(t)}function Jr({input:u=Si,output:t=Oi,overwrite:s=!0,hideCursor:r=!0}={}){const i=qe.createInterface({input:u,output:t,prompt:"",tabSize:1});qe.emitKeypressEvents(u,i),u.isTTY&&u.setRawMode(!0);const a=(e,{name:o,sequence:h})=>{const E=String(e);if(Et([E,o,h],"cancel")){r&&t.write(de.cursor.show),process.exit(0);return}if(!s)return;const y=o==="return"?0:-1,m=o==="return"?-1:0;qe.moveCursor(t,y,m,()=>{qe.clearLine(t,1,()=>{u.once("keypress",a)})})};return r&&t.write(de.cursor.hide),u.once("keypress",a),()=>{u.off("keypress",a),r&&t.write(de.cursor.show),u.isTTY&&!Xr&&u.setRawMode(!1),i.terminal=!1,i.close()}}var Qr=Object.defineProperty,en=(u,t,s)=>t in u?Qr(u,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):u[t]=s,Ce=(u,t,s)=>(en(u,typeof t!="symbol"?t+"":t,s),s);class Ze{constructor(t,s=!0){Ce(this,"input"),Ce(this,"output"),Ce(this,"_abortSignal"),Ce(this,"rl"),Ce(this,"opts"),Ce(this,"_render"),Ce(this,"_track",!1),Ce(this,"_prevFrame",""),Ce(this,"_subscribers",new Map),Ce(this,"_cursor",0),Ce(this,"state","initial"),Ce(this,"error",""),Ce(this,"value");const{input:r=Si,output:i=Oi,render:a,signal:e,...o}=t;this.opts=o,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=a.bind(this),this._track=s,this._abortSignal=e,this.input=r,this.output=i}unsubscribe(){this._subscribers.clear()}setSubscriber(t,s){const r=this._subscribers.get(t)??[];r.push(s),this._subscribers.set(t,r)}on(t,s){this.setSubscriber(t,{cb:s})}once(t,s){this.setSubscriber(t,{cb:s,once:!0})}emit(t,...s){const r=this._subscribers.get(t)??[],i=[];for(const a of r)a.cb(...s),a.once&&i.push(()=>r.splice(r.indexOf(a),1));for(const a of i)a()}prompt(){return new Promise((t,s)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),t(gt);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}const r=new yr(0);r._write=(i,a,e)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,""),this._cursor=this.rl?.cursor??0,this.emit("value",this.value)),e()},this.input.pipe(r),this.rl=Bi.createInterface({input:this.input,output:r,tabSize:2,prompt:"",escapeCodeTimeout:50}),Bi.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),Ye(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(de.cursor.show),this.output.off("resize",this.render),Ye(this.input,!1),t(this.value)}),this.once("cancel",()=>{this.output.write(de.cursor.show),this.output.off("resize",this.render),Ye(this.input,!1),t(gt)})})}onKeypress(t,s){if(this.state==="error"&&(this.state="active"),s?.name&&(!this._track&&Ke.aliases.has(s.name)&&this.emit("cursor",Ke.aliases.get(s.name)),Ke.actions.has(s.name)&&this.emit("cursor",s.name)),t&&(t.toLowerCase()==="y"||t.toLowerCase()==="n")&&this.emit("confirm",t.toLowerCase()==="y"),t===" "&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),t&&this.emit("key",t.toLowerCase()),s?.name==="return"){if(this.opts.validate){const r=this.opts.validate(this.value);r&&(this.error=r instanceof Error?r.message:r,this.state="error",this.rl?.write(this.value))}this.state!=="error"&&(this.state="submit")}Et([t,s?.name,s?.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
10
  `),Ye(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){const t=Ki(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
11
- `).length-1;this.output.write(me.cursor.move(-999,t*-1))}render(){const t=Ki(this._render(this)??"",process.stdout.columns,{hard:!0});if(t!==this._prevFrame){if(this.state==="initial")this.output.write(me.cursor.hide);else{const s=Zr(this._prevFrame,t);if(this.restoreCursor(),s&&s?.length===1){const r=s[0];this.output.write(me.cursor.move(0,r)),this.output.write(me.erase.lines(1));const i=t.split(`
12
- `);this.output.write(i[r]),this._prevFrame=t,this.output.write(me.cursor.move(0,i.length-r-1));return}if(s&&s?.length>1){const r=s[0];this.output.write(me.cursor.move(0,r)),this.output.write(me.erase.down());const i=t.split(`
11
+ `).length-1;this.output.write(de.cursor.move(-999,t*-1))}render(){const t=Ki(this._render(this)??"",process.stdout.columns,{hard:!0});if(t!==this._prevFrame){if(this.state==="initial")this.output.write(de.cursor.hide);else{const s=Zr(this._prevFrame,t);if(this.restoreCursor(),s&&s?.length===1){const r=s[0];this.output.write(de.cursor.move(0,r)),this.output.write(de.erase.lines(1));const i=t.split(`
12
+ `);this.output.write(i[r]),this._prevFrame=t,this.output.write(de.cursor.move(0,i.length-r-1));return}if(s&&s?.length>1){const r=s[0];this.output.write(de.cursor.move(0,r)),this.output.write(de.erase.down());const i=t.split(`
13
13
  `).slice(r);this.output.write(i.join(`
14
- `)),this._prevFrame=t;return}this.output.write(me.erase.down())}this.output.write(t),this.state==="initial"&&(this.state="active"),this._prevFrame=t}}}class tn extends Ze{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",s=>{this.output.write(me.cursor.move(0,-1)),this.value=s,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}}var sn=Object.defineProperty,rn=(u,t,s)=>t in u?sn(u,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):u[t]=s,Yi=(u,t,s)=>(rn(u,typeof t!="symbol"?t+"":t,s),s);let nn=class extends Ze{constructor(u){super(u,!1),Yi(this,"options"),Yi(this,"cursor",0),this.options=u.options,this.value=[...u.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:t})=>t===u.cursorAt),0),this.on("key",t=>{t==="a"&&this.toggleAll()}),this.on("cursor",t=>{switch(t){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break;case"space":this.toggleValue();break}})}get _value(){return this.options[this.cursor].value}toggleAll(){const u=this.value.length===this.options.length;this.value=u?[]:this.options.map(t=>t.value)}toggleValue(){const u=this.value.includes(this._value);this.value=u?this.value.filter(t=>t!==this._value):[...this.value,this._value]}};var un=Object.defineProperty,on=(u,t,s)=>t in u?un(u,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):u[t]=s,Zi=(u,t,s)=>(on(u,typeof t!="symbol"?t+"":t,s),s);class an extends Ze{constructor(t){super(t,!1),Zi(this,"options"),Zi(this,"cursor",0),this.options=t.options,this.cursor=this.options.findIndex(({value:s})=>s===t.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",s=>{switch(s){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}}class hn extends Ze{get valueWithCursor(){if(this.state==="submit")return this.value;if(this.cursor>=this.value.length)return`${this.value}\u2588`;const t=this.value.slice(0,this.cursor),[s,...r]=this.value.slice(this.cursor);return`${t}${I.inverse(s)}${r.join("")}`}get cursor(){return this._cursor}constructor(t){super(t),this.on("finalize",()=>{this.value||(this.value=t.defaultValue)})}}function ln(){return ae.platform!=="win32"?ae.env.TERM!=="linux":!!ae.env.CI||!!ae.env.WT_SESSION||!!ae.env.TERMINUS_SUBLIME||ae.env.ConEmuTask==="{cmd::Cmder}"||ae.env.TERM_PROGRAM==="Terminus-Sublime"||ae.env.TERM_PROGRAM==="vscode"||ae.env.TERM==="xterm-256color"||ae.env.TERM==="alacritty"||ae.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}const Ct=ln(),pe=(u,t)=>Ct?u:t,cn=pe("\u25C6","*"),Xi=pe("\u25A0","x"),Ji=pe("\u25B2","x"),Ft=pe("\u25C7","o"),Dn=pe("\u250C","T"),Q=pe("\u2502","|"),ve=pe("\u2514","\u2014"),yt=pe("\u25CF",">"),bt=pe("\u25CB"," "),fn=pe("\u25FB","[\u2022]"),Qi=pe("\u25FC","[+]"),dn=pe("\u25FB","[ ]"),mn=pe("\u25CF","\u2022"),pn=pe("\u25C6","*"),En=pe("\u25B2","!"),gn=pe("\u25A0","x"),Xe=u=>{switch(u){case"initial":case"active":return I.cyan(cn);case"cancel":return I.red(Xi);case"error":return I.yellow(Ji);case"submit":return I.green(Ft)}},_t=u=>{const{cursor:t,options:s,style:r}=u,i=u.maxItems??Number.POSITIVE_INFINITY,a=Math.max(process.stdout.rows-4,0),e=Math.min(a,Math.max(i,5));let o=0;t>=o+e-3?o=Math.max(Math.min(t-e+3,s.length-e),0):t<o+2&&(o=Math.max(t-2,0));const h=e<s.length&&o>0,E=e<s.length&&o+e<s.length;return s.slice(o,o+e).map((y,m,C)=>{const _=m===0&&h,b=m===C.length-1&&E;return _||b?I.dim("..."):r(y,m+o===t)})},Je=u=>new hn({validate:u.validate,placeholder:u.placeholder,defaultValue:u.defaultValue,initialValue:u.initialValue,render(){const t=`${I.gray(Q)}
14
+ `)),this._prevFrame=t;return}this.output.write(de.erase.down())}this.output.write(t),this.state==="initial"&&(this.state="active"),this._prevFrame=t}}}class tn extends Ze{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",s=>{this.output.write(de.cursor.move(0,-1)),this.value=s,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}}var sn=Object.defineProperty,rn=(u,t,s)=>t in u?sn(u,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):u[t]=s,Yi=(u,t,s)=>(rn(u,typeof t!="symbol"?t+"":t,s),s);let nn=class extends Ze{constructor(u){super(u,!1),Yi(this,"options"),Yi(this,"cursor",0),this.options=u.options,this.value=[...u.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:t})=>t===u.cursorAt),0),this.on("key",t=>{t==="a"&&this.toggleAll()}),this.on("cursor",t=>{switch(t){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break;case"space":this.toggleValue();break}})}get _value(){return this.options[this.cursor].value}toggleAll(){const u=this.value.length===this.options.length;this.value=u?[]:this.options.map(t=>t.value)}toggleValue(){const u=this.value.includes(this._value);this.value=u?this.value.filter(t=>t!==this._value):[...this.value,this._value]}};var un=Object.defineProperty,on=(u,t,s)=>t in u?un(u,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):u[t]=s,Zi=(u,t,s)=>(on(u,typeof t!="symbol"?t+"":t,s),s);class an extends Ze{constructor(t){super(t,!1),Zi(this,"options"),Zi(this,"cursor",0),this.options=t.options,this.cursor=this.options.findIndex(({value:s})=>s===t.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",s=>{switch(s){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}}class hn extends Ze{get valueWithCursor(){if(this.state==="submit")return this.value;if(this.cursor>=this.value.length)return`${this.value}\u2588`;const t=this.value.slice(0,this.cursor),[s,...r]=this.value.slice(this.cursor);return`${t}${I.inverse(s)}${r.join("")}`}get cursor(){return this._cursor}constructor(t){super(t),this.on("finalize",()=>{this.value||(this.value=t.defaultValue)})}}function ln(){return ae.platform!=="win32"?ae.env.TERM!=="linux":!!ae.env.CI||!!ae.env.WT_SESSION||!!ae.env.TERMINUS_SUBLIME||ae.env.ConEmuTask==="{cmd::Cmder}"||ae.env.TERM_PROGRAM==="Terminus-Sublime"||ae.env.TERM_PROGRAM==="vscode"||ae.env.TERM==="xterm-256color"||ae.env.TERM==="alacritty"||ae.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}const Ct=ln(),me=(u,t)=>Ct?u:t,cn=me("\u25C6","*"),Xi=me("\u25A0","x"),Ji=me("\u25B2","x"),Ft=me("\u25C7","o"),Dn=me("\u250C","T"),Q=me("\u2502","|"),ve=me("\u2514","\u2014"),yt=me("\u25CF",">"),bt=me("\u25CB"," "),fn=me("\u25FB","[\u2022]"),Qi=me("\u25FC","[+]"),dn=me("\u25FB","[ ]"),mn=me("\u25CF","\u2022"),pn=me("\u25C6","*"),En=me("\u25B2","!"),gn=me("\u25A0","x"),Xe=u=>{switch(u){case"initial":case"active":return I.cyan(cn);case"cancel":return I.red(Xi);case"error":return I.yellow(Ji);case"submit":return I.green(Ft)}},_t=u=>{const{cursor:t,options:s,style:r}=u,i=u.maxItems??Number.POSITIVE_INFINITY,a=Math.max(process.stdout.rows-4,0),e=Math.min(a,Math.max(i,5));let o=0;t>=o+e-3?o=Math.max(Math.min(t-e+3,s.length-e),0):t<o+2&&(o=Math.max(t-2,0));const h=e<s.length&&o>0,E=e<s.length&&o+e<s.length;return s.slice(o,o+e).map((y,m,C)=>{const _=m===0&&h,b=m===C.length-1&&E;return _||b?I.dim("..."):r(y,m+o===t)})},Je=u=>new hn({validate:u.validate,placeholder:u.placeholder,defaultValue:u.defaultValue,initialValue:u.initialValue,render(){const t=`${I.gray(Q)}
15
15
  ${Xe(this.state)} ${u.message}
16
16
  `,s=u.placeholder?I.inverse(u.placeholder[0])+I.dim(u.placeholder.slice(1)):I.inverse(I.hidden("_")),r=this.value?this.valueWithCursor:s;switch(this.state){case"error":return`${t.trim()}
17
17
  ${I.yellow(Q)} ${r}
@@ -48,12 +48,12 @@ ${I.cyan(ve)}
48
48
  `)},Fn=(u="")=>{process.stdout.write(`${I.gray(Q)}
49
49
  ${I.gray(ve)} ${u}
50
50
 
51
- `)},ce={message:(u="",{symbol:t=I.gray(Q)}={})=>{const s=[`${I.gray(Q)}`];if(u){const[r,...i]=u.split(`
51
+ `)},fe={message:(u="",{symbol:t=I.gray(Q)}={})=>{const s=[`${I.gray(Q)}`];if(u){const[r,...i]=u.split(`
52
52
  `);s.push(`${t} ${r}`,...i.map(a=>`${I.gray(Q)} ${a}`))}process.stdout.write(`${s.join(`
53
53
  `)}
54
- `)},info:u=>{ce.message(u,{symbol:I.blue(mn)})},success:u=>{ce.message(u,{symbol:I.green(pn)})},step:u=>{ce.message(u,{symbol:I.green(Ft)})},warn:u=>{ce.message(u,{symbol:I.yellow(En)})},warning:u=>{ce.warn(u)},error:u=>{ce.message(u,{symbol:I.red(gn)})}};`${I.gray(Q)}`;const rs=({indicator:u="dots"}={})=>{const t=Ct?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],s=Ct?80:120,r=process.env.CI==="true";let i,a,e=!1,o="",h,E=performance.now();const y=f=>{const d=f>1?"Something went wrong":"Canceled";e&&l(d,f)},m=()=>y(2),C=()=>y(1),_=()=>{process.on("uncaughtExceptionMonitor",m),process.on("unhandledRejection",m),process.on("SIGINT",C),process.on("SIGTERM",C),process.on("exit",y)},b=()=>{process.removeListener("uncaughtExceptionMonitor",m),process.removeListener("unhandledRejection",m),process.removeListener("SIGINT",C),process.removeListener("SIGTERM",C),process.removeListener("exit",y)},A=()=>{if(h===void 0)return;r&&process.stdout.write(`
54
+ `)},info:u=>{fe.message(u,{symbol:I.blue(mn)})},success:u=>{fe.message(u,{symbol:I.green(pn)})},step:u=>{fe.message(u,{symbol:I.green(Ft)})},warn:u=>{fe.message(u,{symbol:I.yellow(En)})},warning:u=>{fe.warn(u)},error:u=>{fe.message(u,{symbol:I.red(gn)})}};`${I.gray(Q)}`;const rs=({indicator:u="dots"}={})=>{const t=Ct?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],s=Ct?80:120,r=process.env.CI==="true";let i,a,e=!1,o="",h,E=performance.now();const y=f=>{const d=f>1?"Something went wrong":"Canceled";e&&l(d,f)},m=()=>y(2),C=()=>y(1),_=()=>{process.on("uncaughtExceptionMonitor",m),process.on("unhandledRejection",m),process.on("SIGINT",C),process.on("SIGTERM",C),process.on("exit",y)},b=()=>{process.removeListener("uncaughtExceptionMonitor",m),process.removeListener("unhandledRejection",m),process.removeListener("SIGINT",C),process.removeListener("SIGTERM",C),process.removeListener("exit",y)},A=()=>{if(h===void 0)return;r&&process.stdout.write(`
55
55
  `);const f=h.split(`
56
- `);process.stdout.write(me.cursor.move(-999,f.length-1)),process.stdout.write(me.erase.down(f.length))},S=f=>f.replace(/\.+$/,""),v=f=>{const d=(performance.now()-f)/1e3,D=Math.floor(d/60),F=Math.floor(d%60);return D>0?`[${D}m ${F}s]`:`[${F}s]`},n=(f="")=>{e=!0,i=Jr(),o=S(f),E=performance.now(),process.stdout.write(`${I.gray(Q)}
56
+ `);process.stdout.write(de.cursor.move(-999,f.length-1)),process.stdout.write(de.erase.down(f.length))},S=f=>f.replace(/\.+$/,""),v=f=>{const d=(performance.now()-f)/1e3,D=Math.floor(d/60),F=Math.floor(d%60);return D>0?`[${D}m ${F}s]`:`[${F}s]`},n=(f="")=>{e=!0,i=Jr(),o=S(f),E=performance.now(),process.stdout.write(`${I.gray(Q)}
57
57
  `);let d=0,D=0;_(),a=setInterval(()=>{if(r&&o===h)return;A(),h=o;const F=I.magenta(t[d]);if(r)process.stdout.write(`${F} ${o}...`);else if(u==="timer")process.stdout.write(`${F} ${o} ${v(E)}`);else{const R=".".repeat(Math.floor(D)).slice(0,3);process.stdout.write(`${F} ${o}${R}`)}d=d+1<t.length?d+1:0,D=D<t.length?D+.125:0},s)},l=(f="",d=0)=>{e=!1,clearInterval(a),A();const D=d===0?I.green(Ft):d===1?I.red(Xi):I.red(Ji);o=S(f??o),u==="timer"?process.stdout.write(`${D} ${o} ${v(E)}
58
58
  `):process.stdout.write(`${D} ${o}
59
59
  `),b(),i()};return{start:n,stop:l,message:(f="")=>{o=S(f??o)}}};var Qe={exports:{}},et={},tt={},ns;function it(){if(ns)return tt;ns=1;class u extends Error{constructor(r,i,a){super(a),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=i,this.exitCode=r,this.nestedError=void 0}}class t extends u{constructor(r){super(1,"commander.invalidArgument",r),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}return tt.CommanderError=u,tt.InvalidArgumentError=t,tt}var us;function wt(){if(us)return et;us=1;const{InvalidArgumentError:u}=it();class t{constructor(i,a){switch(this.description=a||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,i[0]){case"<":this.required=!0,this._name=i.slice(1,-1);break;case"[":this.required=!1,this._name=i.slice(1,-1);break;default:this.required=!0,this._name=i;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(i,a){return a===this.defaultValue||!Array.isArray(a)?[i]:a.concat(i)}default(i,a){return this.defaultValue=i,this.defaultValueDescription=a,this}argParser(i){return this.parseArg=i,this}choices(i){return this.argChoices=i.slice(),this.parseArg=(a,e)=>{if(!this.argChoices.includes(a))throw new u(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(a,e):a},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function s(r){const i=r.name()+(r.variadic===!0?"...":"");return r.required?"<"+i+">":"["+i+"]"}return et.Argument=t,et.humanReadableArgName=s,et}var vt={},At={},os;function as(){if(os)return At;os=1;const{humanReadableArgName:u}=wt();class t{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}visibleCommands(r){const i=r.commands.filter(a=>!a._hidden);if(r._hasImplicitHelpCommand()){const[,a,e]=r._helpCommandnameAndArgs.match(/([^ ]+) *(.*)/),o=r.createCommand(a).helpOption(!1);o.description(r._helpCommandDescription),e&&o.arguments(e),i.push(o)}return this.sortSubcommands&&i.sort((a,e)=>a.name().localeCompare(e.name())),i}compareOptions(r,i){const a=e=>e.short?e.short.replace(/^-/,""):e.long.replace(/^--/,"");return a(r).localeCompare(a(i))}visibleOptions(r){const i=r.options.filter(o=>!o.hidden),a=r._hasHelpOption&&r._helpShortFlag&&!r._findOption(r._helpShortFlag),e=r._hasHelpOption&&!r._findOption(r._helpLongFlag);if(a||e){let o;a?e?o=r.createOption(r._helpFlags,r._helpDescription):o=r.createOption(r._helpShortFlag,r._helpDescription):o=r.createOption(r._helpLongFlag,r._helpDescription),i.push(o)}return this.sortOptions&&i.sort(this.compareOptions),i}visibleGlobalOptions(r){if(!this.showGlobalOptions)return[];const i=[];for(let a=r.parent;a;a=a.parent){const e=a.options.filter(o=>!o.hidden);i.push(...e)}return this.sortOptions&&i.sort(this.compareOptions),i}visibleArguments(r){return r._argsDescription&&r._args.forEach(i=>{i.description=i.description||r._argsDescription[i.name()]||""}),r._args.find(i=>i.description)?r._args:[]}subcommandTerm(r){const i=r._args.map(a=>u(a)).join(" ");return r._name+(r._aliases[0]?"|"+r._aliases[0]:"")+(r.options.length?" [options]":"")+(i?" "+i:"")}optionTerm(r){return r.flags}argumentTerm(r){return r.name()}longestSubcommandTermLength(r,i){return i.visibleCommands(r).reduce((a,e)=>Math.max(a,i.subcommandTerm(e).length),0)}longestOptionTermLength(r,i){return i.visibleOptions(r).reduce((a,e)=>Math.max(a,i.optionTerm(e).length),0)}longestGlobalOptionTermLength(r,i){return i.visibleGlobalOptions(r).reduce((a,e)=>Math.max(a,i.optionTerm(e).length),0)}longestArgumentTermLength(r,i){return i.visibleArguments(r).reduce((a,e)=>Math.max(a,i.argumentTerm(e).length),0)}commandUsage(r){let i=r._name;r._aliases[0]&&(i=i+"|"+r._aliases[0]);let a="";for(let e=r.parent;e;e=e.parent)a=e.name()+" "+a;return a+i+" "+r.usage()}commandDescription(r){return r.description()}subcommandDescription(r){return r.summary()||r.description()}optionDescription(r){const i=[];return r.argChoices&&i.push(`choices: ${r.argChoices.map(a=>JSON.stringify(a)).join(", ")}`),r.defaultValue!==void 0&&(r.required||r.optional||r.isBoolean()&&typeof r.defaultValue=="boolean")&&i.push(`default: ${r.defaultValueDescription||JSON.stringify(r.defaultValue)}`),r.presetArg!==void 0&&r.optional&&i.push(`preset: ${JSON.stringify(r.presetArg)}`),r.envVar!==void 0&&i.push(`env: ${r.envVar}`),i.length>0?`${r.description} (${i.join(", ")})`:r.description}argumentDescription(r){const i=[];if(r.argChoices&&i.push(`choices: ${r.argChoices.map(a=>JSON.stringify(a)).join(", ")}`),r.defaultValue!==void 0&&i.push(`default: ${r.defaultValueDescription||JSON.stringify(r.defaultValue)}`),i.length>0){const a=`(${i.join(", ")})`;return r.description?`${r.description} ${a}`:a}return r.description}formatHelp(r,i){const a=i.padWidth(r,i),e=i.helpWidth||80,o=2,h=2;function E(S,v){if(v){const n=`${S.padEnd(a+h)}${v}`;return i.wrap(n,e-o,a+h)}return S}function y(S){return S.join(`
@@ -65,7 +65,7 @@ ${I.gray(ve)} ${u}
65
65
  `?"":(n>0?C:"")+v.trimEnd()).join(`
66
66
  `)}}return At.Help=t,At}var $e={},hs;function ls(){if(hs)return $e;hs=1;const{InvalidArgumentError:u}=it();class t{constructor(e,o){this.flags=e,this.description=o||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;const h=i(e);this.short=h.shortFlag,this.long=h.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0}default(e,o){return this.defaultValue=e,this.defaultValueDescription=o,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let o=e;return typeof e=="string"&&(o={[e]:!0}),this.implied=Object.assign(this.implied||{},o),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_concatValue(e,o){return o===this.defaultValue||!Array.isArray(o)?[e]:o.concat(e)}choices(e){return this.argChoices=e.slice(),this.parseArg=(o,h)=>{if(!this.argChoices.includes(o))throw new u(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(o,h):o},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return r(this.name().replace(/^no-/,""))}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class s{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(o=>{o.negate?this.negativeOptions.set(o.attributeName(),o):this.positiveOptions.set(o.attributeName(),o)}),this.negativeOptions.forEach((o,h)=>{this.positiveOptions.has(h)&&this.dualOptions.add(h)})}valueFromOption(e,o){const h=o.attributeName();if(!this.dualOptions.has(h))return!0;const E=this.negativeOptions.get(h).presetArg,y=E!==void 0?E:!1;return o.negate===(y===e)}}function r(a){return a.split("-").reduce((e,o)=>e+o[0].toUpperCase()+o.slice(1))}function i(a){let e,o;const h=a.split(/[ |,]+/);return h.length>1&&!/^[[<]/.test(h[1])&&(e=h.shift()),o=h.shift(),!e&&/^-[^-]$/.test(o)&&(e=o,o=void 0),{shortFlag:e,longFlag:o}}return $e.Option=t,$e.splitOptionFlags=i,$e.DualOptions=s,$e}var St={},cs;function yn(){if(cs)return St;cs=1;const u=3;function t(r,i){if(Math.abs(r.length-i.length)>u)return Math.max(r.length,i.length);const a=[];for(let e=0;e<=r.length;e++)a[e]=[e];for(let e=0;e<=i.length;e++)a[0][e]=e;for(let e=1;e<=i.length;e++)for(let o=1;o<=r.length;o++){let h=1;r[o-1]===i[e-1]?h=0:h=1,a[o][e]=Math.min(a[o-1][e]+1,a[o][e-1]+1,a[o-1][e-1]+h),o>1&&e>1&&r[o-1]===i[e-2]&&r[o-2]===i[e-1]&&(a[o][e]=Math.min(a[o][e],a[o-2][e-2]+1))}return a[r.length][i.length]}function s(r,i){if(!i||i.length===0)return"";i=Array.from(new Set(i));const a=r.startsWith("--");a&&(r=r.slice(2),i=i.map(E=>E.slice(2)));let e=[],o=u;const h=.4;return i.forEach(E=>{if(E.length<=1)return;const y=t(r,E),m=Math.max(r.length,E.length);(m-y)/m>h&&(y<o?(o=y,e=[E]):y===o&&e.push(E))}),e.sort((E,y)=>E.localeCompare(y)),a&&(e=e.map(E=>`--${E}`)),e.length>1?`
67
67
  (Did you mean one of ${e.join(", ")}?)`:e.length===1?`
68
- (Did you mean ${e[0]}?)`:""}return St.suggestSimilar=s,St}var Ds;function bn(){if(Ds)return vt;Ds=1;const u=xe.EventEmitter,t=br,s=fe,r=ge,i=xi,{Argument:a,humanReadableArgName:e}=wt(),{CommanderError:o}=it(),{Help:h}=as(),{Option:E,splitOptionFlags:y,DualOptions:m}=ls(),{suggestSimilar:C}=yn();class _ extends u{constructor(n){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this._args=[],this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=n||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._outputConfiguration={writeOut:l=>i.stdout.write(l),writeErr:l=>i.stderr.write(l),getOutHelpWidth:()=>i.stdout.isTTY?i.stdout.columns:void 0,getErrHelpWidth:()=>i.stderr.isTTY?i.stderr.columns:void 0,outputError:(l,f)=>f(l)},this._hidden=!1,this._hasHelpOption=!0,this._helpFlags="-h, --help",this._helpDescription="display help for command",this._helpShortFlag="-h",this._helpLongFlag="--help",this._addImplicitHelpCommand=void 0,this._helpCommandName="help",this._helpCommandnameAndArgs="help [command]",this._helpCommandDescription="display help for command",this._helpConfiguration={}}copyInheritedSettings(n){return this._outputConfiguration=n._outputConfiguration,this._hasHelpOption=n._hasHelpOption,this._helpFlags=n._helpFlags,this._helpDescription=n._helpDescription,this._helpShortFlag=n._helpShortFlag,this._helpLongFlag=n._helpLongFlag,this._helpCommandName=n._helpCommandName,this._helpCommandnameAndArgs=n._helpCommandnameAndArgs,this._helpCommandDescription=n._helpCommandDescription,this._helpConfiguration=n._helpConfiguration,this._exitCallback=n._exitCallback,this._storeOptionsAsProperties=n._storeOptionsAsProperties,this._combineFlagAndOptionalValue=n._combineFlagAndOptionalValue,this._allowExcessArguments=n._allowExcessArguments,this._enablePositionalOptions=n._enablePositionalOptions,this._showHelpAfterError=n._showHelpAfterError,this._showSuggestionAfterError=n._showSuggestionAfterError,this}command(n,l,f){let d=l,D=f;typeof d=="object"&&d!==null&&(D=d,d=null),D=D||{};const[,F,R]=n.match(/([^ ]+) *(.*)/),B=this.createCommand(F);return d&&(B.description(d),B._executableHandler=!0),D.isDefault&&(this._defaultCommandName=B._name),B._hidden=!!(D.noHelp||D.hidden),B._executableFile=D.executableFile||null,R&&B.arguments(R),this.commands.push(B),B.parent=this,B.copyInheritedSettings(this),d?this:B}createCommand(n){return new _(n)}createHelp(){return Object.assign(new h,this.configureHelp())}configureHelp(n){return n===void 0?this._helpConfiguration:(this._helpConfiguration=n,this)}configureOutput(n){return n===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,n),this)}showHelpAfterError(n=!0){return typeof n!="string"&&(n=!!n),this._showHelpAfterError=n,this}showSuggestionAfterError(n=!0){return this._showSuggestionAfterError=!!n,this}addCommand(n,l){if(!n._name)throw new Error(`Command passed to .addCommand() must have a name
68
+ (Did you mean ${e[0]}?)`:""}return St.suggestSimilar=s,St}var Ds;function bn(){if(Ds)return vt;Ds=1;const u=xe.EventEmitter,t=br,s=De,r=ge,i=xi,{Argument:a,humanReadableArgName:e}=wt(),{CommanderError:o}=it(),{Help:h}=as(),{Option:E,splitOptionFlags:y,DualOptions:m}=ls(),{suggestSimilar:C}=yn();class _ extends u{constructor(n){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this._args=[],this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=n||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._outputConfiguration={writeOut:l=>i.stdout.write(l),writeErr:l=>i.stderr.write(l),getOutHelpWidth:()=>i.stdout.isTTY?i.stdout.columns:void 0,getErrHelpWidth:()=>i.stderr.isTTY?i.stderr.columns:void 0,outputError:(l,f)=>f(l)},this._hidden=!1,this._hasHelpOption=!0,this._helpFlags="-h, --help",this._helpDescription="display help for command",this._helpShortFlag="-h",this._helpLongFlag="--help",this._addImplicitHelpCommand=void 0,this._helpCommandName="help",this._helpCommandnameAndArgs="help [command]",this._helpCommandDescription="display help for command",this._helpConfiguration={}}copyInheritedSettings(n){return this._outputConfiguration=n._outputConfiguration,this._hasHelpOption=n._hasHelpOption,this._helpFlags=n._helpFlags,this._helpDescription=n._helpDescription,this._helpShortFlag=n._helpShortFlag,this._helpLongFlag=n._helpLongFlag,this._helpCommandName=n._helpCommandName,this._helpCommandnameAndArgs=n._helpCommandnameAndArgs,this._helpCommandDescription=n._helpCommandDescription,this._helpConfiguration=n._helpConfiguration,this._exitCallback=n._exitCallback,this._storeOptionsAsProperties=n._storeOptionsAsProperties,this._combineFlagAndOptionalValue=n._combineFlagAndOptionalValue,this._allowExcessArguments=n._allowExcessArguments,this._enablePositionalOptions=n._enablePositionalOptions,this._showHelpAfterError=n._showHelpAfterError,this._showSuggestionAfterError=n._showSuggestionAfterError,this}command(n,l,f){let d=l,D=f;typeof d=="object"&&d!==null&&(D=d,d=null),D=D||{};const[,F,R]=n.match(/([^ ]+) *(.*)/),B=this.createCommand(F);return d&&(B.description(d),B._executableHandler=!0),D.isDefault&&(this._defaultCommandName=B._name),B._hidden=!!(D.noHelp||D.hidden),B._executableFile=D.executableFile||null,R&&B.arguments(R),this.commands.push(B),B.parent=this,B.copyInheritedSettings(this),d?this:B}createCommand(n){return new _(n)}createHelp(){return Object.assign(new h,this.configureHelp())}configureHelp(n){return n===void 0?this._helpConfiguration:(this._helpConfiguration=n,this)}configureOutput(n){return n===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,n),this)}showHelpAfterError(n=!0){return typeof n!="string"&&(n=!!n),this._showHelpAfterError=n,this}showSuggestionAfterError(n=!0){return this._showSuggestionAfterError=!!n,this}addCommand(n,l){if(!n._name)throw new Error(`Command passed to .addCommand() must have a name
69
69
  - specify the name in Command constructor or using .name()`);return l=l||{},l.isDefault&&(this._defaultCommandName=n._name),(l.noHelp||l.hidden)&&(n._hidden=!0),this.commands.push(n),n.parent=this,this}createArgument(n,l){return new a(n,l)}argument(n,l,f,d){const D=this.createArgument(n,l);return typeof f=="function"?D.default(d).argParser(f):D.default(f),this.addArgument(D),this}arguments(n){return n.split(/ +/).forEach(l=>{this.argument(l)}),this}addArgument(n){const l=this._args.slice(-1)[0];if(l&&l.variadic)throw new Error(`only the last argument can be variadic '${l.name()}'`);if(n.required&&n.defaultValue!==void 0&&n.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${n.name()}'`);return this._args.push(n),this}addHelpCommand(n,l){return n===!1?this._addImplicitHelpCommand=!1:(this._addImplicitHelpCommand=!0,typeof n=="string"&&(this._helpCommandName=n.split(" ")[0],this._helpCommandnameAndArgs=n),this._helpCommandDescription=l||this._helpCommandDescription),this}_hasImplicitHelpCommand(){return this._addImplicitHelpCommand===void 0?this.commands.length&&!this._actionHandler&&!this._findCommand("help"):this._addImplicitHelpCommand}hook(n,l){const f=["preSubcommand","preAction","postAction"];if(!f.includes(n))throw new Error(`Unexpected value for event passed to hook : '${n}'.
70
70
  Expecting one of '${f.join("', '")}'`);return this._lifeCycleHooks[n]?this._lifeCycleHooks[n].push(l):this._lifeCycleHooks[n]=[l],this}exitOverride(n){return n?this._exitCallback=n:this._exitCallback=l=>{if(l.code!=="commander.executeSubCommandAsync")throw l},this}_exit(n,l,f){this._exitCallback&&this._exitCallback(new o(n,l,f)),i.exit(n)}action(n){const l=f=>{const d=this._args.length,D=f.slice(0,d);return this._storeOptionsAsProperties?D[d]=this:D[d]=this.opts(),D.push(this),n.apply(this,D)};return this._actionHandler=l,this}createOption(n,l){return new E(n,l)}addOption(n){const l=n.name(),f=n.attributeName();if(n.negate){const D=n.long.replace(/^--no-/,"--");this._findOption(D)||this.setOptionValueWithSource(f,n.defaultValue===void 0?!0:n.defaultValue,"default")}else n.defaultValue!==void 0&&this.setOptionValueWithSource(f,n.defaultValue,"default");this.options.push(n);const d=(D,F,R)=>{D==null&&n.presetArg!==void 0&&(D=n.presetArg);const B=this.getOptionValue(f);if(D!==null&&n.parseArg)try{D=n.parseArg(D,B)}catch(x){if(x.code==="commander.invalidArgument"){const M=`${F} ${x.message}`;this.error(M,{exitCode:x.exitCode,code:x.code})}throw x}else D!==null&&n.variadic&&(D=n._concatValue(D,B));D==null&&(n.negate?D=!1:n.isBoolean()||n.optional?D=!0:D=""),this.setOptionValueWithSource(f,D,R)};return this.on("option:"+l,D=>{const F=`error: option '${n.flags}' argument '${D}' is invalid.`;d(D,F,"cli")}),n.envVar&&this.on("optionEnv:"+l,D=>{const F=`error: option '${n.flags}' value '${D}' from env '${n.envVar}' is invalid.`;d(D,F,"env")}),this}_optionEx(n,l,f,d,D){if(typeof l=="object"&&l instanceof E)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");const F=this.createOption(l,f);if(F.makeOptionMandatory(!!n.mandatory),typeof d=="function")F.default(D).argParser(d);else if(d instanceof RegExp){const R=d;d=(B,x)=>{const M=R.exec(B);return M?M[0]:x},F.default(D).argParser(d)}else F.default(d);return this.addOption(F)}option(n,l,f,d){return this._optionEx({},n,l,f,d)}requiredOption(n,l,f,d){return this._optionEx({mandatory:!0},n,l,f,d)}combineFlagAndOptionalValue(n=!0){return this._combineFlagAndOptionalValue=!!n,this}allowUnknownOption(n=!0){return this._allowUnknownOption=!!n,this}allowExcessArguments(n=!0){return this._allowExcessArguments=!!n,this}enablePositionalOptions(n=!0){return this._enablePositionalOptions=!!n,this}passThroughOptions(n=!0){if(this._passThroughOptions=!!n,this.parent&&n&&!this.parent._enablePositionalOptions)throw new Error("passThroughOptions can not be used without turning on enablePositionalOptions for parent command(s)");return this}storeOptionsAsProperties(n=!0){if(this._storeOptionsAsProperties=!!n,this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");return this}getOptionValue(n){return this._storeOptionsAsProperties?this[n]:this._optionValues[n]}setOptionValue(n,l){return this.setOptionValueWithSource(n,l,void 0)}setOptionValueWithSource(n,l,f){return this._storeOptionsAsProperties?this[n]=l:this._optionValues[n]=l,this._optionValueSources[n]=f,this}getOptionValueSource(n){return this._optionValueSources[n]}getOptionValueSourceWithGlobals(n){let l;return S(this).forEach(f=>{f.getOptionValueSource(n)!==void 0&&(l=f.getOptionValueSource(n))}),l}_prepareUserArgs(n,l){if(n!==void 0&&!Array.isArray(n))throw new Error("first parameter to parse must be array or undefined");l=l||{},n===void 0&&(n=i.argv,i.versions&&i.versions.electron&&(l.from="electron")),this.rawArgs=n.slice();let f;switch(l.from){case void 0:case"node":this._scriptPath=n[1],f=n.slice(2);break;case"electron":i.defaultApp?(this._scriptPath=n[1],f=n.slice(2)):f=n.slice(1);break;case"user":f=n.slice(0);break;default:throw new Error(`unexpected parse option { from: '${l.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",f}parse(n,l){const f=this._prepareUserArgs(n,l);return this._parseCommand([],f),this}async parseAsync(n,l){const f=this._prepareUserArgs(n,l);return await this._parseCommand([],f),this}_executeSubCommand(n,l){l=l.slice();let f=!1;const d=[".js",".ts",".tsx",".mjs",".cjs"];function D(M,P){const U=s.resolve(M,P);if(r.existsSync(U))return U;if(d.includes(s.extname(P)))return;const G=d.find(Y=>r.existsSync(`${U}${Y}`));if(G)return`${U}${G}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let F=n._executableFile||`${this._name}-${n._name}`,R=this._executableDir||"";if(this._scriptPath){let M;try{M=r.realpathSync(this._scriptPath)}catch{M=this._scriptPath}R=s.resolve(s.dirname(M),R)}if(R){let M=D(R,F);if(!M&&!n._executableFile&&this._scriptPath){const P=s.basename(this._scriptPath,s.extname(this._scriptPath));P!==this._name&&(M=D(R,`${P}-${n._name}`))}F=M||F}f=d.includes(s.extname(F));let B;i.platform!=="win32"?f?(l.unshift(F),l=A(i.execArgv).concat(l),B=t.spawn(i.argv[0],l,{stdio:"inherit"})):B=t.spawn(F,l,{stdio:"inherit"}):(l.unshift(F),l=A(i.execArgv).concat(l),B=t.spawn(i.execPath,l,{stdio:"inherit"})),B.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(P=>{i.on(P,()=>{B.killed===!1&&B.exitCode===null&&B.kill(P)})});const x=this._exitCallback;x?B.on("close",()=>{x(new o(i.exitCode||0,"commander.executeSubCommandAsync","(close)"))}):B.on("close",i.exit.bind(i)),B.on("error",M=>{if(M.code==="ENOENT"){const P=R?`searched for local subcommand relative to directory '${R}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",U=`'${F}' does not exist
71
71
  - if '${n._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
@@ -76,23 +76,21 @@ Expecting one of '${f.join("', '")}'`);return this._lifeCycleHooks[n]?this._life
76
76
  `),this.outputHelp({error:!0}));const f=l||{},d=f.exitCode||1,D=f.code||"commander.error";this._exit(d,D,n)}_parseOptionsEnv(){this.options.forEach(n=>{if(n.envVar&&n.envVar in i.env){const l=n.attributeName();(this.getOptionValue(l)===void 0||["default","config","env"].includes(this.getOptionValueSource(l)))&&(n.required||n.optional?this.emit(`optionEnv:${n.name()}`,i.env[n.envVar]):this.emit(`optionEnv:${n.name()}`))}})}_parseOptionsImplied(){const n=new m(this.options),l=f=>this.getOptionValue(f)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(f));this.options.filter(f=>f.implied!==void 0&&l(f.attributeName())&&n.valueFromOption(this.getOptionValue(f.attributeName()),f)).forEach(f=>{Object.keys(f.implied).filter(d=>!l(d)).forEach(d=>{this.setOptionValueWithSource(d,f.implied[d],"implied")})})}missingArgument(n){const l=`error: missing required argument '${n}'`;this.error(l,{code:"commander.missingArgument"})}optionMissingArgument(n){const l=`error: option '${n.flags}' argument missing`;this.error(l,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(n){const l=`error: required option '${n.flags}' not specified`;this.error(l,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(n,l){const f=F=>{const R=F.attributeName(),B=this.getOptionValue(R),x=this.options.find(P=>P.negate&&R===P.attributeName()),M=this.options.find(P=>!P.negate&&R===P.attributeName());return x&&(x.presetArg===void 0&&B===!1||x.presetArg!==void 0&&B===x.presetArg)?x:M||F},d=F=>{const R=f(F),B=R.attributeName();return this.getOptionValueSource(B)==="env"?`environment variable '${R.envVar}'`:`option '${R.flags}'`},D=`error: ${d(n)} cannot be used with ${d(l)}`;this.error(D,{code:"commander.conflictingOption"})}unknownOption(n){if(this._allowUnknownOption)return;let l="";if(n.startsWith("--")&&this._showSuggestionAfterError){let d=[],D=this;do{const F=D.createHelp().visibleOptions(D).filter(R=>R.long).map(R=>R.long);d=d.concat(F),D=D.parent}while(D&&!D._enablePositionalOptions);l=C(n,d)}const f=`error: unknown option '${n}'${l}`;this.error(f,{code:"commander.unknownOption"})}_excessArguments(n){if(this._allowExcessArguments)return;const l=this._args.length,f=l===1?"":"s",D=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${l} argument${f} but got ${n.length}.`;this.error(D,{code:"commander.excessArguments"})}unknownCommand(){const n=this.args[0];let l="";if(this._showSuggestionAfterError){const d=[];this.createHelp().visibleCommands(this).forEach(D=>{d.push(D.name()),D.alias()&&d.push(D.alias())}),l=C(n,d)}const f=`error: unknown command '${n}'${l}`;this.error(f,{code:"commander.unknownCommand"})}version(n,l,f){if(n===void 0)return this._version;this._version=n,l=l||"-V, --version",f=f||"output the version number";const d=this.createOption(l,f);return this._versionOptionName=d.attributeName(),this.options.push(d),this.on("option:"+d.name(),()=>{this._outputConfiguration.writeOut(`${n}
77
77
  `),this._exit(0,"commander.version",n)}),this}description(n,l){return n===void 0&&l===void 0?this._description:(this._description=n,l&&(this._argsDescription=l),this)}summary(n){return n===void 0?this._summary:(this._summary=n,this)}alias(n){if(n===void 0)return this._aliases[0];let l=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(l=this.commands[this.commands.length-1]),n===l._name)throw new Error("Command alias can't be the same as its name");return l._aliases.push(n),this}aliases(n){return n===void 0?this._aliases:(n.forEach(l=>this.alias(l)),this)}usage(n){if(n===void 0){if(this._usage)return this._usage;const l=this._args.map(f=>e(f));return[].concat(this.options.length||this._hasHelpOption?"[options]":[],this.commands.length?"[command]":[],this._args.length?l:[]).join(" ")}return this._usage=n,this}name(n){return n===void 0?this._name:(this._name=n,this)}nameFromFilename(n){return this._name=s.basename(n,s.extname(n)),this}executableDir(n){return n===void 0?this._executableDir:(this._executableDir=n,this)}helpInformation(n){const l=this.createHelp();return l.helpWidth===void 0&&(l.helpWidth=n&&n.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),l.formatHelp(this,l)}_getHelpContext(n){n=n||{};const l={error:!!n.error};let f;return l.error?f=d=>this._outputConfiguration.writeErr(d):f=d=>this._outputConfiguration.writeOut(d),l.write=n.write||f,l.command=this,l}outputHelp(n){let l;typeof n=="function"&&(l=n,n=void 0);const f=this._getHelpContext(n);S(this).reverse().forEach(D=>D.emit("beforeAllHelp",f)),this.emit("beforeHelp",f);let d=this.helpInformation(f);if(l&&(d=l(d),typeof d!="string"&&!Buffer.isBuffer(d)))throw new Error("outputHelp callback must return a string or a Buffer");f.write(d),this.emit(this._helpLongFlag),this.emit("afterHelp",f),S(this).forEach(D=>D.emit("afterAllHelp",f))}helpOption(n,l){if(typeof n=="boolean")return this._hasHelpOption=n,this;this._helpFlags=n||this._helpFlags,this._helpDescription=l||this._helpDescription;const f=y(this._helpFlags);return this._helpShortFlag=f.shortFlag,this._helpLongFlag=f.longFlag,this}help(n){this.outputHelp(n);let l=i.exitCode||0;l===0&&n&&typeof n!="function"&&n.error&&(l=1),this._exit(l,"commander.help","(outputHelp)")}addHelpText(n,l){const f=["beforeAll","before","after","afterAll"];if(!f.includes(n))throw new Error(`Unexpected value for position to addHelpText.
78
78
  Expecting one of '${f.join("', '")}'`);const d=`${n}Help`;return this.on(d,D=>{let F;typeof l=="function"?F=l({error:D.error,command:D.command}):F=l,F&&D.write(`${F}
79
- `)}),this}}function b(v,n){v._hasHelpOption&&n.find(f=>f===v._helpLongFlag||f===v._helpShortFlag)&&(v.outputHelp(),v._exit(0,"commander.helpDisplayed","(outputHelp)"))}function A(v){return v.map(n=>{if(!n.startsWith("--inspect"))return n;let l,f="127.0.0.1",d="9229",D;return(D=n.match(/^(--inspect(-brk)?)$/))!==null?l=D[1]:(D=n.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(l=D[1],/^\d+$/.test(D[3])?d=D[3]:f=D[3]):(D=n.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(l=D[1],f=D[3],d=D[4]),l&&d!=="0"?`${l}=${f}:${parseInt(d)+1}`:n})}function S(v){const n=[];for(let l=v;l;l=l.parent)n.push(l);return n}return vt.Command=_,vt}var fs;function _n(){return fs||(fs=1,function(u,t){const{Argument:s}=wt(),{Command:r}=bn(),{CommanderError:i,InvalidArgumentError:a}=it(),{Help:e}=as(),{Option:o}=ls();t=u.exports=new r,t.program=t,t.Argument=s,t.Command=r,t.CommanderError=i,t.Help=e,t.InvalidArgumentError=a,t.InvalidOptionArgumentError=a,t.Option=o}(Qe,Qe.exports)),Qe.exports}var wn=_n();const vn=Ii(wn),{program:Vu,createCommand:Wu,createArgument:Ku,createOption:Yu,CommanderError:Zu,InvalidArgumentError:Xu,InvalidOptionArgumentError:Ju,Command:An,Argument:Qu,Option:eo,Help:to}=vn;var Ne={};class Sn extends Error{method;path;expected;value;fake_expected_typed_value_;constructor(t){super(t.message||`Error on ${t.method}(): invalid type${t.path?` on ${t.path}`:""}, expect to be ${t.expected}`);const s=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,s):this.__proto__=s,this.method=t.method,this.path=t.path,this.expected=t.expected,this.value=t.value}}const On={__proto__:null,TypeGuardError:Sn},Rn=xr(On);var ds;function Bn(){if(ds)return Ne;ds=1,Object.defineProperty(Ne,"__esModule",{value:!0}),Ne._assertGuard=void 0;const u=Rn,t=(s,r,i)=>{if(s===!0)throw i?i(r):new u.TypeGuardError(r);return!1};return Ne._assertGuard=t,Ne}var re=Bn();function ms(u){return u.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join("")}async function Ot(u){try{return await(await import("prettier")).format(u,{parser:"typescript"})}catch{return u}}const ps=Ri(vr),xn="https://raw.githubusercontent.com/wrtnlabs/connectors/refs/heads/main/connectors-list.json",Rt="@wrtnlabs/connector-";function Tn(u){return`${Rt}${u}`}function $n(u){return u.replace(Rt,"")}async function Nn(){const u=await(await fetch(xn)).json();return(()=>{const t=o=>Array.isArray(o.connectors)&&o.connectors.every(h=>typeof h=="object"&&h!==null&&s(h))&&typeof o.version=="string",s=o=>typeof o.name=="string"&&RegExp(/^@wrtnlabs\/connector\x2d(.*)/).test(o.name)&&Array.isArray(o.envList)&&o.envList.every(h=>typeof h=="string"),r=(o,h,E=!0)=>((Array.isArray(o.connectors)||re._assertGuard(E,{method:"typia.assert",path:h+".connectors",expected:"Array<UnwrapTaggedConnectorInfo>",value:o.connectors},e))&&o.connectors.every((y,m)=>(typeof y=="object"&&y!==null||re._assertGuard(E,{method:"typia.assert",path:h+".connectors["+m+"]",expected:"UnwrapTaggedConnectorInfo",value:y},e))&&i(y,h+".connectors["+m+"]",E)||re._assertGuard(E,{method:"typia.assert",path:h+".connectors["+m+"]",expected:"UnwrapTaggedConnectorInfo",value:y},e))||re._assertGuard(E,{method:"typia.assert",path:h+".connectors",expected:"Array<UnwrapTaggedConnectorInfo>",value:o.connectors},e))&&(typeof o.version=="string"||re._assertGuard(E,{method:"typia.assert",path:h+".version",expected:"string",value:o.version},e)),i=(o,h,E=!0)=>(typeof o.name=="string"&&RegExp(/^@wrtnlabs\/connector\x2d(.*)/).test(o.name)||re._assertGuard(E,{method:"typia.assert",path:h+".name",expected:"`@wrtnlabs/connector-${string}`",value:o.name},e))&&((Array.isArray(o.envList)||re._assertGuard(E,{method:"typia.assert",path:h+".envList",expected:"Array<string>",value:o.envList},e))&&o.envList.every((y,m)=>typeof y=="string"||re._assertGuard(E,{method:"typia.assert",path:h+".envList["+m+"]",expected:"string",value:y},e))||re._assertGuard(E,{method:"typia.assert",path:h+".envList",expected:"Array<string>",value:o.envList},e)),a=o=>typeof o=="object"&&o!==null&&t(o);let e;return(o,h)=>(a(o)===!1&&(e=h,((E,y,m=!0)=>(typeof E=="object"&&E!==null||re._assertGuard(!0,{method:"typia.assert",path:y+"",expected:"UnwrapTaggedConnectors",value:E},e))&&r(E,y+"",!0)||re._assertGuard(!0,{method:"typia.assert",path:y+"",expected:"UnwrapTaggedConnectors",value:E},e))(o,"$input",!0)),o)})()(u)}async function In(){return(await Nn()).connectors.map(({name:u,envList:t})=>{const s=$n(u),r=s.replace("-"," ").toUpperCase();return{packageName:u,serviceName:s,displayName:r,envList:t}})}function Bt(u){return u.map(t=>{const s=ms(t);return`{
79
+ `)}),this}}function b(v,n){v._hasHelpOption&&n.find(f=>f===v._helpLongFlag||f===v._helpShortFlag)&&(v.outputHelp(),v._exit(0,"commander.helpDisplayed","(outputHelp)"))}function A(v){return v.map(n=>{if(!n.startsWith("--inspect"))return n;let l,f="127.0.0.1",d="9229",D;return(D=n.match(/^(--inspect(-brk)?)$/))!==null?l=D[1]:(D=n.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(l=D[1],/^\d+$/.test(D[3])?d=D[3]:f=D[3]):(D=n.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(l=D[1],f=D[3],d=D[4]),l&&d!=="0"?`${l}=${f}:${parseInt(d)+1}`:n})}function S(v){const n=[];for(let l=v;l;l=l.parent)n.push(l);return n}return vt.Command=_,vt}var fs;function _n(){return fs||(fs=1,function(u,t){const{Argument:s}=wt(),{Command:r}=bn(),{CommanderError:i,InvalidArgumentError:a}=it(),{Help:e}=as(),{Option:o}=ls();t=u.exports=new r,t.program=t,t.Argument=s,t.Command=r,t.CommanderError=i,t.Help=e,t.InvalidArgumentError=a,t.InvalidOptionArgumentError=a,t.Option=o}(Qe,Qe.exports)),Qe.exports}var wn=_n();const vn=Ii(wn),{program:Ku,createCommand:Yu,createArgument:Zu,createOption:Xu,CommanderError:Ju,InvalidArgumentError:Qu,InvalidOptionArgumentError:eo,Command:An,Argument:to,Option:Sn,Help:io}=vn;var Ne={};class On extends Error{method;path;expected;value;fake_expected_typed_value_;constructor(t){super(t.message||`Error on ${t.method}(): invalid type${t.path?` on ${t.path}`:""}, expect to be ${t.expected}`);const s=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,s):this.__proto__=s,this.method=t.method,this.path=t.path,this.expected=t.expected,this.value=t.value}}const Rn={__proto__:null,TypeGuardError:On},Bn=xr(Rn);var ds;function xn(){if(ds)return Ne;ds=1,Object.defineProperty(Ne,"__esModule",{value:!0}),Ne._assertGuard=void 0;const u=Bn,t=(s,r,i)=>{if(s===!0)throw i?i(r):new u.TypeGuardError(r);return!1};return Ne._assertGuard=t,Ne}var re=xn();function ms(u){return u.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join("")}async function Ot(u){try{return await(await import("prettier")).format(u,{parser:"typescript"})}catch{return u}}const ps=Ri(vr),Tn="https://raw.githubusercontent.com/wrtnlabs/connectors/refs/heads/main/connectors-list.json",Rt="@wrtnlabs/connector-";function $n(u){return`${Rt}${u}`}function Nn(u){return u.replace(Rt,"")}async function In(){const u=await(await fetch(Tn)).json();return(()=>{const t=o=>Array.isArray(o.connectors)&&o.connectors.every(h=>typeof h=="object"&&h!==null&&s(h))&&typeof o.version=="string",s=o=>typeof o.name=="string"&&RegExp(/^@wrtnlabs\/connector\x2d(.*)/).test(o.name)&&Array.isArray(o.envList)&&o.envList.every(h=>typeof h=="string"),r=(o,h,E=!0)=>((Array.isArray(o.connectors)||re._assertGuard(E,{method:"typia.assert",path:h+".connectors",expected:"Array<UnwrapTaggedConnectorInfo>",value:o.connectors},e))&&o.connectors.every((y,m)=>(typeof y=="object"&&y!==null||re._assertGuard(E,{method:"typia.assert",path:h+".connectors["+m+"]",expected:"UnwrapTaggedConnectorInfo",value:y},e))&&i(y,h+".connectors["+m+"]",E)||re._assertGuard(E,{method:"typia.assert",path:h+".connectors["+m+"]",expected:"UnwrapTaggedConnectorInfo",value:y},e))||re._assertGuard(E,{method:"typia.assert",path:h+".connectors",expected:"Array<UnwrapTaggedConnectorInfo>",value:o.connectors},e))&&(typeof o.version=="string"||re._assertGuard(E,{method:"typia.assert",path:h+".version",expected:"string",value:o.version},e)),i=(o,h,E=!0)=>(typeof o.name=="string"&&RegExp(/^@wrtnlabs\/connector\x2d(.*)/).test(o.name)||re._assertGuard(E,{method:"typia.assert",path:h+".name",expected:"`@wrtnlabs/connector-${string}`",value:o.name},e))&&((Array.isArray(o.envList)||re._assertGuard(E,{method:"typia.assert",path:h+".envList",expected:"Array<string>",value:o.envList},e))&&o.envList.every((y,m)=>typeof y=="string"||re._assertGuard(E,{method:"typia.assert",path:h+".envList["+m+"]",expected:"string",value:y},e))||re._assertGuard(E,{method:"typia.assert",path:h+".envList",expected:"Array<string>",value:o.envList},e)),a=o=>typeof o=="object"&&o!==null&&t(o);let e;return(o,h)=>(a(o)===!1&&(e=h,((E,y,m=!0)=>(typeof E=="object"&&E!==null||re._assertGuard(!0,{method:"typia.assert",path:y+"",expected:"UnwrapTaggedConnectors",value:E},e))&&r(E,y+"",!0)||re._assertGuard(!0,{method:"typia.assert",path:y+"",expected:"UnwrapTaggedConnectors",value:E},e))(o,"$input",!0)),o)})()(u)}async function Ln(){return(await In()).connectors.map(({name:u,envList:t})=>{const s=Nn(u),r=s.replace("-"," ").toUpperCase();return{packageName:u,serviceName:s,displayName:r,envList:t}})}function Bt(u){return u.map(t=>{const s=ms(t);return`{
80
80
  name: "${s} Connector",
81
81
  protocol: "class",
82
82
  application: typia.llm.application<${s}Service, "chatgpt">(),
83
83
  execute: new ${s}Service(),
84
84
  }`}).join(`,
85
85
  `)}function xt(u){return u.map(t=>`import { ${ms(t)}Service } from "${Rt}${t}";`).join(`
86
- `)}function Tt({content:u,importCode:t,connectorCode:s}){return u.replace("/// INSERT IMPORT HERE",t).replace("/// INSERT CONTROLLER HERE",s)}var he={},$t,Es;function Ie(){if(Es)return $t;Es=1;const u=new Map([["C","cwd"],["f","file"],["z","gzip"],["P","preservePaths"],["U","unlink"],["strip-components","strip"],["stripComponents","strip"],["keep-newer","newer"],["keepNewer","newer"],["keep-newer-files","newer"],["keepNewerFiles","newer"],["k","keep"],["keep-existing","keep"],["keepExisting","keep"],["m","noMtime"],["no-mtime","noMtime"],["p","preserveOwner"],["L","follow"],["h","follow"]]);return $t=t=>t?Object.keys(t).map(s=>[u.has(s)?u.get(s):s,t[s]]).reduce((s,r)=>(s[r[0]]=r[1],s),Object.create(null)):{},$t}var Nt={},gs;function It(){if(gs)return Nt;gs=1;const u=typeof process=="object"&&process?process:{stdout:null,stderr:null},t=xe,s=Ti,i=$i.StringDecoder,a=Symbol("EOF"),e=Symbol("maybeEmitEnd"),o=Symbol("emittedEnd"),h=Symbol("emittingEnd"),E=Symbol("emittedError"),y=Symbol("closed"),m=Symbol("read"),C=Symbol("flush"),_=Symbol("flushChunk"),b=Symbol("encoding"),A=Symbol("decoder"),S=Symbol("flowing"),v=Symbol("paused"),n=Symbol("resume"),l=Symbol("buffer"),f=Symbol("pipes"),d=Symbol("bufferLength"),D=Symbol("bufferPush"),F=Symbol("bufferShift"),R=Symbol("objectMode"),B=Symbol("destroyed"),x=Symbol("error"),M=Symbol("emitData"),P=Symbol("emitEnd"),U=Symbol("emitEnd2"),G=Symbol("async"),Y=Symbol("abort"),N=Symbol("aborted"),V=Symbol("signal"),W=z=>Promise.resolve().then(z),ee=ct._MP_NO_ITERATOR_SYMBOLS_!=="1",w=ee&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),c=ee&&Symbol.iterator||Symbol("iterator not implemented"),g=z=>z==="end"||z==="finish"||z==="prefinish",L=z=>z instanceof ArrayBuffer||typeof z=="object"&&z.constructor&&z.constructor.name==="ArrayBuffer"&&z.byteLength>=0,j=z=>!Buffer.isBuffer(z)&&ArrayBuffer.isView(z);class J{constructor(O,T,K){this.src=O,this.dest=T,this.opts=K,this.ondrain=()=>O[n](),T.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}}class $ extends J{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(O,T,K){super(O,T,K),this.proxyErrors=oe=>T.emit("error",oe),O.on("error",this.proxyErrors)}}class q extends s{constructor(O){super(),this[S]=!1,this[v]=!1,this[f]=[],this[l]=[],this[R]=O&&O.objectMode||!1,this[R]?this[b]=null:this[b]=O&&O.encoding||null,this[b]==="buffer"&&(this[b]=null),this[G]=O&&!!O.async||!1,this[A]=this[b]?new i(this[b]):null,this[a]=!1,this[o]=!1,this[h]=!1,this[y]=!1,this[E]=null,this.writable=!0,this.readable=!0,this[d]=0,this[B]=!1,O&&O.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[l]}),O&&O.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[f]}),this[V]=O&&O.signal,this[N]=!1,this[V]&&(this[V].addEventListener("abort",()=>this[Y]()),this[V].aborted&&this[Y]())}get bufferLength(){return this[d]}get encoding(){return this[b]}set encoding(O){if(this[R])throw new Error("cannot set encoding in objectMode");if(this[b]&&O!==this[b]&&(this[A]&&this[A].lastNeed||this[d]))throw new Error("cannot change encoding");this[b]!==O&&(this[A]=O?new i(O):null,this[l].length&&(this[l]=this[l].map(T=>this[A].write(T)))),this[b]=O}setEncoding(O){this.encoding=O}get objectMode(){return this[R]}set objectMode(O){this[R]=this[R]||!!O}get async(){return this[G]}set async(O){this[G]=this[G]||!!O}[Y](){this[N]=!0,this.emit("abort",this[V].reason),this.destroy(this[V].reason)}get aborted(){return this[N]}set aborted(O){}write(O,T,K){if(this[N])return!1;if(this[a])throw new Error("write after end");if(this[B])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof T=="function"&&(K=T,T="utf8"),T||(T="utf8");const oe=this[G]?W:De=>De();return!this[R]&&!Buffer.isBuffer(O)&&(j(O)?O=Buffer.from(O.buffer,O.byteOffset,O.byteLength):L(O)?O=Buffer.from(O):typeof O!="string"&&(this.objectMode=!0)),this[R]?(this.flowing&&this[d]!==0&&this[C](!0),this.flowing?this.emit("data",O):this[D](O),this[d]!==0&&this.emit("readable"),K&&oe(K),this.flowing):O.length?(typeof O=="string"&&!(T===this[b]&&!this[A].lastNeed)&&(O=Buffer.from(O,T)),Buffer.isBuffer(O)&&this[b]&&(O=this[A].write(O)),this.flowing&&this[d]!==0&&this[C](!0),this.flowing?this.emit("data",O):this[D](O),this[d]!==0&&this.emit("readable"),K&&oe(K),this.flowing):(this[d]!==0&&this.emit("readable"),K&&oe(K),this.flowing)}read(O){if(this[B])return null;if(this[d]===0||O===0||O>this[d])return this[e](),null;this[R]&&(O=null),this[l].length>1&&!this[R]&&(this.encoding?this[l]=[this[l].join("")]:this[l]=[Buffer.concat(this[l],this[d])]);const T=this[m](O||null,this[l][0]);return this[e](),T}[m](O,T){return O===T.length||O===null?this[F]():(this[l][0]=T.slice(O),T=T.slice(0,O),this[d]-=O),this.emit("data",T),!this[l].length&&!this[a]&&this.emit("drain"),T}end(O,T,K){return typeof O=="function"&&(K=O,O=null),typeof T=="function"&&(K=T,T="utf8"),O&&this.write(O,T),K&&this.once("end",K),this[a]=!0,this.writable=!1,(this.flowing||!this[v])&&this[e](),this}[n](){this[B]||(this[v]=!1,this[S]=!0,this.emit("resume"),this[l].length?this[C]():this[a]?this[e]():this.emit("drain"))}resume(){return this[n]()}pause(){this[S]=!1,this[v]=!0}get destroyed(){return this[B]}get flowing(){return this[S]}get paused(){return this[v]}[D](O){this[R]?this[d]+=1:this[d]+=O.length,this[l].push(O)}[F](){return this[R]?this[d]-=1:this[d]-=this[l][0].length,this[l].shift()}[C](O){do;while(this[_](this[F]())&&this[l].length);!O&&!this[l].length&&!this[a]&&this.emit("drain")}[_](O){return this.emit("data",O),this.flowing}pipe(O,T){if(this[B])return;const K=this[o];return T=T||{},O===u.stdout||O===u.stderr?T.end=!1:T.end=T.end!==!1,T.proxyErrors=!!T.proxyErrors,K?T.end&&O.end():(this[f].push(T.proxyErrors?new $(this,O,T):new J(this,O,T)),this[G]?W(()=>this[n]()):this[n]()),O}unpipe(O){const T=this[f].find(K=>K.dest===O);T&&(this[f].splice(this[f].indexOf(T),1),T.unpipe())}addListener(O,T){return this.on(O,T)}on(O,T){const K=super.on(O,T);return O==="data"&&!this[f].length&&!this.flowing?this[n]():O==="readable"&&this[d]!==0?super.emit("readable"):g(O)&&this[o]?(super.emit(O),this.removeAllListeners(O)):O==="error"&&this[E]&&(this[G]?W(()=>T.call(this,this[E])):T.call(this,this[E])),K}get emittedEnd(){return this[o]}[e](){!this[h]&&!this[o]&&!this[B]&&this[l].length===0&&this[a]&&(this[h]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[y]&&this.emit("close"),this[h]=!1)}emit(O,T,...K){if(O!=="error"&&O!=="close"&&O!==B&&this[B])return;if(O==="data")return!this[R]&&!T?!1:this[G]?W(()=>this[M](T)):this[M](T);if(O==="end")return this[P]();if(O==="close"){if(this[y]=!0,!this[o]&&!this[B])return;const De=super.emit("close");return this.removeAllListeners("close"),De}else if(O==="error"){this[E]=T,super.emit(x,T);const De=!this[V]||this.listeners("error").length?super.emit("error",T):!1;return this[e](),De}else if(O==="resume"){const De=super.emit("resume");return this[e](),De}else if(O==="finish"||O==="prefinish"){const De=super.emit(O);return this.removeAllListeners(O),De}const oe=super.emit(O,T,...K);return this[e](),oe}[M](O){for(const K of this[f])K.dest.write(O)===!1&&this.pause();const T=super.emit("data",O);return this[e](),T}[P](){this[o]||(this[o]=!0,this.readable=!1,this[G]?W(()=>this[U]()):this[U]())}[U](){if(this[A]){const T=this[A].end();if(T){for(const K of this[f])K.dest.write(T);super.emit("data",T)}}for(const T of this[f])T.end();const O=super.emit("end");return this.removeAllListeners("end"),O}collect(){const O=[];this[R]||(O.dataLength=0);const T=this.promise();return this.on("data",K=>{O.push(K),this[R]||(O.dataLength+=K.length)}),T.then(()=>O)}concat(){return this[R]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(O=>this[R]?Promise.reject(new Error("cannot concat in objectMode")):this[b]?O.join(""):Buffer.concat(O,O.dataLength))}promise(){return new Promise((O,T)=>{this.on(B,()=>T(new Error("stream destroyed"))),this.on("error",K=>T(K)),this.on("end",()=>O())})}[w](){let O=!1;const T=()=>(this.pause(),O=!0,Promise.resolve({done:!0}));return{next:()=>{if(O)return T();const oe=this.read();if(oe!==null)return Promise.resolve({done:!1,value:oe});if(this[a])return T();let De=null,Ge=null;const te=Z=>{this.removeListener("data",p),this.removeListener("end",k),this.removeListener(B,H),T(),Ge(Z)},p=Z=>{this.removeListener("error",te),this.removeListener("end",k),this.removeListener(B,H),this.pause(),De({value:Z,done:!!this[a]})},k=()=>{this.removeListener("error",te),this.removeListener("data",p),this.removeListener(B,H),T(),De({done:!0})},H=()=>te(new Error("stream destroyed"));return new Promise((Z,X)=>{Ge=X,De=Z,this.once(B,H),this.once("error",te),this.once("end",k),this.once("data",p)})},throw:T,return:T,[w](){return this}}}[c](){let O=!1;const T=()=>(this.pause(),this.removeListener(x,T),this.removeListener(B,T),this.removeListener("end",T),O=!0,{done:!0}),K=()=>{if(O)return T();const oe=this.read();return oe===null?T():{value:oe}};return this.once("end",T),this.once(x,T),this.once(B,T),{next:K,throw:T,return:T,[c](){return this}}}destroy(O){return this[B]?(O?this.emit("error",O):this.emit(B),this):(this[B]=!0,this[l].length=0,this[d]=0,typeof this.close=="function"&&!this[y]&&this.close(),O?this.emit("error",O):this.emit(B),this)}static isStream(O){return!!O&&(O instanceof q||O instanceof s||O instanceof t&&(typeof O.pipe=="function"||typeof O.write=="function"&&typeof O.end=="function"))}}return Nt.Minipass=q,Nt}var Ee={},Lt,Cs;function Ln(){if(Cs)return Lt;Cs=1;const u=Ni.constants||{ZLIB_VERNUM:4736};return Lt=Object.freeze(Object.assign(Object.create(null),{Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,BROTLI_DECODE:8,BROTLI_ENCODE:9,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:1/0,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1,BROTLI_OPERATION_PROCESS:0,BROTLI_OPERATION_FLUSH:1,BROTLI_OPERATION_FINISH:2,BROTLI_OPERATION_EMIT_METADATA:3,BROTLI_MODE_GENERIC:0,BROTLI_MODE_TEXT:1,BROTLI_MODE_FONT:2,BROTLI_DEFAULT_MODE:0,BROTLI_MIN_QUALITY:0,BROTLI_MAX_QUALITY:11,BROTLI_DEFAULT_QUALITY:11,BROTLI_MIN_WINDOW_BITS:10,BROTLI_MAX_WINDOW_BITS:24,BROTLI_LARGE_MAX_WINDOW_BITS:30,BROTLI_DEFAULT_WINDOW:22,BROTLI_MIN_INPUT_BLOCK_BITS:16,BROTLI_MAX_INPUT_BLOCK_BITS:24,BROTLI_PARAM_MODE:0,BROTLI_PARAM_QUALITY:1,BROTLI_PARAM_LGWIN:2,BROTLI_PARAM_LGBLOCK:3,BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING:4,BROTLI_PARAM_SIZE_HINT:5,BROTLI_PARAM_LARGE_WINDOW:6,BROTLI_PARAM_NPOSTFIX:7,BROTLI_PARAM_NDIRECT:8,BROTLI_DECODER_RESULT_ERROR:0,BROTLI_DECODER_RESULT_SUCCESS:1,BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT:2,BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION:0,BROTLI_DECODER_PARAM_LARGE_WINDOW:1,BROTLI_DECODER_NO_ERROR:0,BROTLI_DECODER_SUCCESS:1,BROTLI_DECODER_NEEDS_MORE_INPUT:2,BROTLI_DECODER_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE:-1,BROTLI_DECODER_ERROR_FORMAT_RESERVED:-2,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE:-3,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET:-4,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME:-5,BROTLI_DECODER_ERROR_FORMAT_CL_SPACE:-6,BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE:-7,BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT:-8,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1:-9,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2:-10,BROTLI_DECODER_ERROR_FORMAT_TRANSFORM:-11,BROTLI_DECODER_ERROR_FORMAT_DICTIONARY:-12,BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS:-13,BROTLI_DECODER_ERROR_FORMAT_PADDING_1:-14,BROTLI_DECODER_ERROR_FORMAT_PADDING_2:-15,BROTLI_DECODER_ERROR_FORMAT_DISTANCE:-16,BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET:-19,BROTLI_DECODER_ERROR_INVALID_ARGUMENTS:-20,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES:-21,BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS:-22,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP:-25,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1:-26,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2:-27,BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES:-30,BROTLI_DECODER_ERROR_UNREACHABLE:-31},u)),Lt}var Mt,Fs;function ys(){if(Fs)return Mt;Fs=1;const u=typeof process=="object"&&process?process:{stdout:null,stderr:null},t=xe,s=Ti,r=$i.StringDecoder,i=Symbol("EOF"),a=Symbol("maybeEmitEnd"),e=Symbol("emittedEnd"),o=Symbol("emittingEnd"),h=Symbol("emittedError"),E=Symbol("closed"),y=Symbol("read"),m=Symbol("flush"),C=Symbol("flushChunk"),_=Symbol("encoding"),b=Symbol("decoder"),A=Symbol("flowing"),S=Symbol("paused"),v=Symbol("resume"),n=Symbol("bufferLength"),l=Symbol("bufferPush"),f=Symbol("bufferShift"),d=Symbol("objectMode"),D=Symbol("destroyed"),F=Symbol("emitData"),R=Symbol("emitEnd"),B=Symbol("emitEnd2"),x=Symbol("async"),M=w=>Promise.resolve().then(w),P=ct._MP_NO_ITERATOR_SYMBOLS_!=="1",U=P&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),G=P&&Symbol.iterator||Symbol("iterator not implemented"),Y=w=>w==="end"||w==="finish"||w==="prefinish",N=w=>w instanceof ArrayBuffer||typeof w=="object"&&w.constructor&&w.constructor.name==="ArrayBuffer"&&w.byteLength>=0,V=w=>!Buffer.isBuffer(w)&&ArrayBuffer.isView(w);class W{constructor(c,g,L){this.src=c,this.dest=g,this.opts=L,this.ondrain=()=>c[v](),g.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}}class ee extends W{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(c,g,L){super(c,g,L),this.proxyErrors=j=>g.emit("error",j),c.on("error",this.proxyErrors)}}return Mt=class Fr extends s{constructor(c){super(),this[A]=!1,this[S]=!1,this.pipes=[],this.buffer=[],this[d]=c&&c.objectMode||!1,this[d]?this[_]=null:this[_]=c&&c.encoding||null,this[_]==="buffer"&&(this[_]=null),this[x]=c&&!!c.async||!1,this[b]=this[_]?new r(this[_]):null,this[i]=!1,this[e]=!1,this[o]=!1,this[E]=!1,this[h]=null,this.writable=!0,this.readable=!0,this[n]=0,this[D]=!1}get bufferLength(){return this[n]}get encoding(){return this[_]}set encoding(c){if(this[d])throw new Error("cannot set encoding in objectMode");if(this[_]&&c!==this[_]&&(this[b]&&this[b].lastNeed||this[n]))throw new Error("cannot change encoding");this[_]!==c&&(this[b]=c?new r(c):null,this.buffer.length&&(this.buffer=this.buffer.map(g=>this[b].write(g)))),this[_]=c}setEncoding(c){this.encoding=c}get objectMode(){return this[d]}set objectMode(c){this[d]=this[d]||!!c}get async(){return this[x]}set async(c){this[x]=this[x]||!!c}write(c,g,L){if(this[i])throw new Error("write after end");if(this[D])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof g=="function"&&(L=g,g="utf8"),g||(g="utf8");const j=this[x]?M:J=>J();return!this[d]&&!Buffer.isBuffer(c)&&(V(c)?c=Buffer.from(c.buffer,c.byteOffset,c.byteLength):N(c)?c=Buffer.from(c):typeof c!="string"&&(this.objectMode=!0)),this[d]?(this.flowing&&this[n]!==0&&this[m](!0),this.flowing?this.emit("data",c):this[l](c),this[n]!==0&&this.emit("readable"),L&&j(L),this.flowing):c.length?(typeof c=="string"&&!(g===this[_]&&!this[b].lastNeed)&&(c=Buffer.from(c,g)),Buffer.isBuffer(c)&&this[_]&&(c=this[b].write(c)),this.flowing&&this[n]!==0&&this[m](!0),this.flowing?this.emit("data",c):this[l](c),this[n]!==0&&this.emit("readable"),L&&j(L),this.flowing):(this[n]!==0&&this.emit("readable"),L&&j(L),this.flowing)}read(c){if(this[D])return null;if(this[n]===0||c===0||c>this[n])return this[a](),null;this[d]&&(c=null),this.buffer.length>1&&!this[d]&&(this.encoding?this.buffer=[this.buffer.join("")]:this.buffer=[Buffer.concat(this.buffer,this[n])]);const g=this[y](c||null,this.buffer[0]);return this[a](),g}[y](c,g){return c===g.length||c===null?this[f]():(this.buffer[0]=g.slice(c),g=g.slice(0,c),this[n]-=c),this.emit("data",g),!this.buffer.length&&!this[i]&&this.emit("drain"),g}end(c,g,L){return typeof c=="function"&&(L=c,c=null),typeof g=="function"&&(L=g,g="utf8"),c&&this.write(c,g),L&&this.once("end",L),this[i]=!0,this.writable=!1,(this.flowing||!this[S])&&this[a](),this}[v](){this[D]||(this[S]=!1,this[A]=!0,this.emit("resume"),this.buffer.length?this[m]():this[i]?this[a]():this.emit("drain"))}resume(){return this[v]()}pause(){this[A]=!1,this[S]=!0}get destroyed(){return this[D]}get flowing(){return this[A]}get paused(){return this[S]}[l](c){this[d]?this[n]+=1:this[n]+=c.length,this.buffer.push(c)}[f](){return this.buffer.length&&(this[d]?this[n]-=1:this[n]-=this.buffer[0].length),this.buffer.shift()}[m](c){do;while(this[C](this[f]()));!c&&!this.buffer.length&&!this[i]&&this.emit("drain")}[C](c){return c?(this.emit("data",c),this.flowing):!1}pipe(c,g){if(this[D])return;const L=this[e];return g=g||{},c===u.stdout||c===u.stderr?g.end=!1:g.end=g.end!==!1,g.proxyErrors=!!g.proxyErrors,L?g.end&&c.end():(this.pipes.push(g.proxyErrors?new ee(this,c,g):new W(this,c,g)),this[x]?M(()=>this[v]()):this[v]()),c}unpipe(c){const g=this.pipes.find(L=>L.dest===c);g&&(this.pipes.splice(this.pipes.indexOf(g),1),g.unpipe())}addListener(c,g){return this.on(c,g)}on(c,g){const L=super.on(c,g);return c==="data"&&!this.pipes.length&&!this.flowing?this[v]():c==="readable"&&this[n]!==0?super.emit("readable"):Y(c)&&this[e]?(super.emit(c),this.removeAllListeners(c)):c==="error"&&this[h]&&(this[x]?M(()=>g.call(this,this[h])):g.call(this,this[h])),L}get emittedEnd(){return this[e]}[a](){!this[o]&&!this[e]&&!this[D]&&this.buffer.length===0&&this[i]&&(this[o]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[E]&&this.emit("close"),this[o]=!1)}emit(c,g,...L){if(c!=="error"&&c!=="close"&&c!==D&&this[D])return;if(c==="data")return g?this[x]?M(()=>this[F](g)):this[F](g):!1;if(c==="end")return this[R]();if(c==="close"){if(this[E]=!0,!this[e]&&!this[D])return;const J=super.emit("close");return this.removeAllListeners("close"),J}else if(c==="error"){this[h]=g;const J=super.emit("error",g);return this[a](),J}else if(c==="resume"){const J=super.emit("resume");return this[a](),J}else if(c==="finish"||c==="prefinish"){const J=super.emit(c);return this.removeAllListeners(c),J}const j=super.emit(c,g,...L);return this[a](),j}[F](c){for(const L of this.pipes)L.dest.write(c)===!1&&this.pause();const g=super.emit("data",c);return this[a](),g}[R](){this[e]||(this[e]=!0,this.readable=!1,this[x]?M(()=>this[B]()):this[B]())}[B](){if(this[b]){const g=this[b].end();if(g){for(const L of this.pipes)L.dest.write(g);super.emit("data",g)}}for(const g of this.pipes)g.end();const c=super.emit("end");return this.removeAllListeners("end"),c}collect(){const c=[];this[d]||(c.dataLength=0);const g=this.promise();return this.on("data",L=>{c.push(L),this[d]||(c.dataLength+=L.length)}),g.then(()=>c)}concat(){return this[d]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(c=>this[d]?Promise.reject(new Error("cannot concat in objectMode")):this[_]?c.join(""):Buffer.concat(c,c.dataLength))}promise(){return new Promise((c,g)=>{this.on(D,()=>g(new Error("stream destroyed"))),this.on("error",L=>g(L)),this.on("end",()=>c())})}[U](){return{next:()=>{const g=this.read();if(g!==null)return Promise.resolve({done:!1,value:g});if(this[i])return Promise.resolve({done:!0});let L=null,j=null;const J=O=>{this.removeListener("data",$),this.removeListener("end",q),j(O)},$=O=>{this.removeListener("error",J),this.removeListener("end",q),this.pause(),L({value:O,done:!!this[i]})},q=()=>{this.removeListener("error",J),this.removeListener("data",$),L({done:!0})},z=()=>J(new Error("stream destroyed"));return new Promise((O,T)=>{j=T,L=O,this.once(D,z),this.once("error",J),this.once("end",q),this.once("data",$)})}}}[G](){return{next:()=>{const g=this.read();return{value:g,done:g===null}}}}destroy(c){return this[D]?(c?this.emit("error",c):this.emit(D),this):(this[D]=!0,this.buffer.length=0,this[n]=0,typeof this.close=="function"&&!this[E]&&this.close(),c?this.emit("error",c):this.emit(D),this)}static isStream(c){return!!c&&(c instanceof Fr||c instanceof s||c instanceof t&&(typeof c.pipe=="function"||typeof c.write=="function"&&typeof c.end=="function"))}},Mt}var bs;function _s(){if(bs)return Ee;bs=1;const u=lt,t=Or.Buffer,s=Ni,r=Ee.constants=Ln(),i=ys(),a=t.concat,e=Symbol("_superWrite");class o extends Error{constructor(N){super("zlib: "+N.message),this.code=N.code,this.errno=N.errno,this.code||(this.code="ZLIB_ERROR"),this.message="zlib: "+N.message,Error.captureStackTrace(this,this.constructor)}get name(){return"ZlibError"}}const h=Symbol("opts"),E=Symbol("flushFlag"),y=Symbol("finishFlushFlag"),m=Symbol("fullFlushFlag"),C=Symbol("handle"),_=Symbol("onError"),b=Symbol("sawError"),A=Symbol("level"),S=Symbol("strategy"),v=Symbol("ended");class n extends i{constructor(N,V){if(!N||typeof N!="object")throw new TypeError("invalid options for ZlibBase constructor");super(N),this[b]=!1,this[v]=!1,this[h]=N,this[E]=N.flush,this[y]=N.finishFlush;try{this[C]=new s[V](N)}catch(W){throw new o(W)}this[_]=W=>{this[b]||(this[b]=!0,this.close(),this.emit("error",W))},this[C].on("error",W=>this[_](new o(W))),this.once("end",()=>this.close)}close(){this[C]&&(this[C].close(),this[C]=null,this.emit("close"))}reset(){if(!this[b])return u(this[C],"zlib binding closed"),this[C].reset()}flush(N){this.ended||(typeof N!="number"&&(N=this[m]),this.write(Object.assign(t.alloc(0),{[E]:N})))}end(N,V,W){return N&&this.write(N,V),this.flush(this[y]),this[v]=!0,super.end(null,null,W)}get ended(){return this[v]}write(N,V,W){if(typeof V=="function"&&(W=V,V="utf8"),typeof N=="string"&&(N=t.from(N,V)),this[b])return;u(this[C],"zlib binding closed");const ee=this[C]._handle,w=ee.close;ee.close=()=>{};const c=this[C].close;this[C].close=()=>{},t.concat=j=>j;let g;try{const j=typeof N[E]=="number"?N[E]:this[E];g=this[C]._processChunk(N,j),t.concat=a}catch(j){t.concat=a,this[_](new o(j))}finally{this[C]&&(this[C]._handle=ee,ee.close=w,this[C].close=c,this[C].removeAllListeners("error"))}this[C]&&this[C].on("error",j=>this[_](new o(j)));let L;if(g)if(Array.isArray(g)&&g.length>0){L=this[e](t.from(g[0]));for(let j=1;j<g.length;j++)L=this[e](g[j])}else L=this[e](t.from(g));return W&&W(),L}[e](N){return super.write(N)}}class l extends n{constructor(N,V){N=N||{},N.flush=N.flush||r.Z_NO_FLUSH,N.finishFlush=N.finishFlush||r.Z_FINISH,super(N,V),this[m]=r.Z_FULL_FLUSH,this[A]=N.level,this[S]=N.strategy}params(N,V){if(!this[b]){if(!this[C])throw new Error("cannot switch params when binding is closed");if(!this[C].params)throw new Error("not supported in this implementation");if(this[A]!==N||this[S]!==V){this.flush(r.Z_SYNC_FLUSH),u(this[C],"zlib binding closed");const W=this[C].flush;this[C].flush=(ee,w)=>{this.flush(ee),w()};try{this[C].params(N,V)}finally{this[C].flush=W}this[C]&&(this[A]=N,this[S]=V)}}}}class f extends l{constructor(N){super(N,"Deflate")}}class d extends l{constructor(N){super(N,"Inflate")}}const D=Symbol("_portable");class F extends l{constructor(N){super(N,"Gzip"),this[D]=N&&!!N.portable}[e](N){return this[D]?(this[D]=!1,N[9]=255,super[e](N)):super[e](N)}}class R extends l{constructor(N){super(N,"Gunzip")}}class B extends l{constructor(N){super(N,"DeflateRaw")}}class x extends l{constructor(N){super(N,"InflateRaw")}}class M extends l{constructor(N){super(N,"Unzip")}}class P extends n{constructor(N,V){N=N||{},N.flush=N.flush||r.BROTLI_OPERATION_PROCESS,N.finishFlush=N.finishFlush||r.BROTLI_OPERATION_FINISH,super(N,V),this[m]=r.BROTLI_OPERATION_FLUSH}}class U extends P{constructor(N){super(N,"BrotliCompress")}}class G extends P{constructor(N){super(N,"BrotliDecompress")}}return Ee.Deflate=f,Ee.Inflate=d,Ee.Gzip=F,Ee.Gunzip=R,Ee.DeflateRaw=B,Ee.InflateRaw=x,Ee.Unzip=M,typeof s.BrotliCompress=="function"?(Ee.BrotliCompress=U,Ee.BrotliDecompress=G):Ee.BrotliCompress=Ee.BrotliDecompress=class{constructor(){throw new Error("Brotli is not supported in this version of Node.js")}},Ee}var Pt,ws;function Le(){return ws||(ws=1,Pt=(process.env.TESTING_TAR_FAKE_PLATFORM||process.platform)!=="win32"?t=>t:t=>t&&t.replace(/\\/g,"/")),Pt}var kt,vs;function jt(){if(vs)return kt;vs=1;const{Minipass:u}=It(),t=Le(),s=Symbol("slurp");return kt=class extends u{constructor(i,a,e){switch(super(),this.pause(),this.extended=a,this.globalExtended=e,this.header=i,this.startBlockSize=512*Math.ceil(i.size/512),this.blockRemain=this.startBlockSize,this.remain=i.size,this.type=i.type,this.meta=!1,this.ignore=!1,this.type){case"File":case"OldFile":case"Link":case"SymbolicLink":case"CharacterDevice":case"BlockDevice":case"Directory":case"FIFO":case"ContiguousFile":case"GNUDumpDir":break;case"NextFileHasLongLinkpath":case"NextFileHasLongPath":case"OldGnuLongPath":case"GlobalExtendedHeader":case"ExtendedHeader":case"OldExtendedHeader":this.meta=!0;break;default:this.ignore=!0}this.path=t(i.path),this.mode=i.mode,this.mode&&(this.mode=this.mode&4095),this.uid=i.uid,this.gid=i.gid,this.uname=i.uname,this.gname=i.gname,this.size=i.size,this.mtime=i.mtime,this.atime=i.atime,this.ctime=i.ctime,this.linkpath=t(i.linkpath),this.uname=i.uname,this.gname=i.gname,a&&this[s](a),e&&this[s](e,!0)}write(i){const a=i.length;if(a>this.blockRemain)throw new Error("writing more to entry than is appropriate");const e=this.remain,o=this.blockRemain;return this.remain=Math.max(0,e-a),this.blockRemain=Math.max(0,o-a),this.ignore?!0:e>=a?super.write(i):super.write(i.slice(0,e))}[s](i,a){for(const e in i)i[e]!==null&&i[e]!==void 0&&!(a&&e==="path")&&(this[e]=e==="path"||e==="linkpath"?t(i[e]):i[e])}},kt}var Ht={},As;function Ss(){return As||(As=1,function(u){u.name=new Map([["0","File"],["","OldFile"],["1","Link"],["2","SymbolicLink"],["3","CharacterDevice"],["4","BlockDevice"],["5","Directory"],["6","FIFO"],["7","ContiguousFile"],["g","GlobalExtendedHeader"],["x","ExtendedHeader"],["A","SolarisACL"],["D","GNUDumpDir"],["I","Inode"],["K","NextFileHasLongLinkpath"],["L","NextFileHasLongPath"],["M","ContinuationFile"],["N","OldGnuLongPath"],["S","SparseFile"],["V","TapeVolumeHeader"],["X","OldExtendedHeader"]]),u.code=new Map(Array.from(u.name).map(t=>[t[1],t[0]]))}(Ht)),Ht}var Ut,Os;function Mn(){if(Os)return Ut;Os=1;const u=(h,E)=>{if(Number.isSafeInteger(h))h<0?s(h,E):t(h,E);else throw Error("cannot encode number outside of javascript safe integer range");return E},t=(h,E)=>{E[0]=128;for(var y=E.length;y>1;y--)E[y-1]=h&255,h=Math.floor(h/256)},s=(h,E)=>{E[0]=255;var y=!1;h=h*-1;for(var m=E.length;m>1;m--){var C=h&255;h=Math.floor(h/256),y?E[m-1]=e(C):C===0?E[m-1]=0:(y=!0,E[m-1]=o(C))}},r=h=>{const E=h[0],y=E===128?a(h.slice(1,h.length)):E===255?i(h):null;if(y===null)throw Error("invalid base256 encoding");if(!Number.isSafeInteger(y))throw Error("parsed number outside of javascript safe integer range");return y},i=h=>{for(var E=h.length,y=0,m=!1,C=E-1;C>-1;C--){var _=h[C],b;m?b=e(_):_===0?b=_:(m=!0,b=o(_)),b!==0&&(y-=b*Math.pow(256,E-C-1))}return y},a=h=>{for(var E=h.length,y=0,m=E-1;m>-1;m--){var C=h[m];C!==0&&(y+=C*Math.pow(256,E-m-1))}return y},e=h=>(255^h)&255,o=h=>(255^h)+1&255;return Ut={encode:u,parse:r},Ut}var zt,Rs;function Me(){if(Rs)return zt;Rs=1;const u=Ss(),t=fe.posix,s=Mn(),r=Symbol("slurp"),i=Symbol("type");class a{constructor(D,F,R,B){this.cksumValid=!1,this.needPax=!1,this.nullBlock=!1,this.block=null,this.path=null,this.mode=null,this.uid=null,this.gid=null,this.size=null,this.mtime=null,this.cksum=null,this[i]="0",this.linkpath=null,this.uname=null,this.gname=null,this.devmaj=0,this.devmin=0,this.atime=null,this.ctime=null,Buffer.isBuffer(D)?this.decode(D,F||0,R,B):D&&this.set(D)}decode(D,F,R,B){if(F||(F=0),!D||!(D.length>=F+512))throw new Error("need 512 bytes for header");if(this.path=o(D,F,100),this.mode=y(D,F+100,8),this.uid=y(D,F+108,8),this.gid=y(D,F+116,8),this.size=y(D,F+124,12),this.mtime=h(D,F+136,12),this.cksum=y(D,F+148,12),this[r](R),this[r](B,!0),this[i]=o(D,F+156,1),this[i]===""&&(this[i]="0"),this[i]==="0"&&this.path.slice(-1)==="/"&&(this[i]="5"),this[i]==="5"&&(this.size=0),this.linkpath=o(D,F+157,100),D.slice(F+257,F+265).toString()==="ustar\x0000")if(this.uname=o(D,F+265,32),this.gname=o(D,F+297,32),this.devmaj=y(D,F+329,8),this.devmin=y(D,F+337,8),D[F+475]!==0){const M=o(D,F+345,155);this.path=M+"/"+this.path}else{const M=o(D,F+345,130);M&&(this.path=M+"/"+this.path),this.atime=h(D,F+476,12),this.ctime=h(D,F+488,12)}let x=8*32;for(let M=F;M<F+148;M++)x+=D[M];for(let M=F+156;M<F+512;M++)x+=D[M];this.cksumValid=x===this.cksum,this.cksum===null&&x===8*32&&(this.nullBlock=!0)}[r](D,F){for(const R in D)D[R]!==null&&D[R]!==void 0&&!(F&&R==="path")&&(this[R]=D[R])}encode(D,F){if(D||(D=this.block=Buffer.alloc(512),F=0),F||(F=0),!(D.length>=F+512))throw new Error("need 512 bytes for header");const R=this.ctime||this.atime?130:155,B=e(this.path||"",R),x=B[0],M=B[1];this.needPax=B[2],this.needPax=f(D,F,100,x)||this.needPax,this.needPax=b(D,F+100,8,this.mode)||this.needPax,this.needPax=b(D,F+108,8,this.uid)||this.needPax,this.needPax=b(D,F+116,8,this.gid)||this.needPax,this.needPax=b(D,F+124,12,this.size)||this.needPax,this.needPax=n(D,F+136,12,this.mtime)||this.needPax,D[F+156]=this[i].charCodeAt(0),this.needPax=f(D,F+157,100,this.linkpath)||this.needPax,D.write("ustar\x0000",F+257,8),this.needPax=f(D,F+265,32,this.uname)||this.needPax,this.needPax=f(D,F+297,32,this.gname)||this.needPax,this.needPax=b(D,F+329,8,this.devmaj)||this.needPax,this.needPax=b(D,F+337,8,this.devmin)||this.needPax,this.needPax=f(D,F+345,R,M)||this.needPax,D[F+475]!==0?this.needPax=f(D,F+345,155,M)||this.needPax:(this.needPax=f(D,F+345,130,M)||this.needPax,this.needPax=n(D,F+476,12,this.atime)||this.needPax,this.needPax=n(D,F+488,12,this.ctime)||this.needPax);let P=8*32;for(let U=F;U<F+148;U++)P+=D[U];for(let U=F+156;U<F+512;U++)P+=D[U];return this.cksum=P,b(D,F+148,8,this.cksum),this.cksumValid=!0,this.needPax}set(D){for(const F in D)D[F]!==null&&D[F]!==void 0&&(this[F]=D[F])}get type(){return u.name.get(this[i])||this[i]}get typeKey(){return this[i]}set type(D){u.code.has(D)?this[i]=u.code.get(D):this[i]=D}}const e=(d,D)=>{let R=d,B="",x;const M=t.parse(d).root||".";if(Buffer.byteLength(R)<100)x=[R,B,!1];else{B=t.dirname(R),R=t.basename(R);do Buffer.byteLength(R)<=100&&Buffer.byteLength(B)<=D?x=[R,B,!1]:Buffer.byteLength(R)>100&&Buffer.byteLength(B)<=D?x=[R.slice(0,99),B,!0]:(R=t.join(t.basename(B),R),B=t.dirname(B));while(B!==M&&!x);x||(x=[d.slice(0,99),"",!0])}return x},o=(d,D,F)=>d.slice(D,D+F).toString("utf8").replace(/\0.*/,""),h=(d,D,F)=>E(y(d,D,F)),E=d=>d===null?null:new Date(d*1e3),y=(d,D,F)=>d[D]&128?s.parse(d.slice(D,D+F)):C(d,D,F),m=d=>isNaN(d)?null:d,C=(d,D,F)=>m(parseInt(d.slice(D,D+F).toString("utf8").replace(/\0.*$/,"").trim(),8)),_={12:8589934591,8:2097151},b=(d,D,F,R)=>R===null?!1:R>_[F]||R<0?(s.encode(R,d.slice(D,D+F)),!0):(A(d,D,F,R),!1),A=(d,D,F,R)=>d.write(S(R,F),D,F,"ascii"),S=(d,D)=>v(Math.floor(d).toString(8),D),v=(d,D)=>(d.length===D-1?d:new Array(D-d.length-1).join("0")+d+" ")+"\0",n=(d,D,F,R)=>R===null?!1:b(d,D,F,R.getTime()/1e3),l=new Array(156).join("\0"),f=(d,D,F,R)=>R===null?!1:(d.write(R+l,D,F,"utf8"),R.length!==Buffer.byteLength(R)||R.length>F);return zt=a,zt}var Gt,Bs;function qt(){if(Bs)return Gt;Bs=1;const u=Me(),t=fe;class s{constructor(o,h){this.atime=o.atime||null,this.charset=o.charset||null,this.comment=o.comment||null,this.ctime=o.ctime||null,this.gid=o.gid||null,this.gname=o.gname||null,this.linkpath=o.linkpath||null,this.mtime=o.mtime||null,this.path=o.path||null,this.size=o.size||null,this.uid=o.uid||null,this.uname=o.uname||null,this.dev=o.dev||null,this.ino=o.ino||null,this.nlink=o.nlink||null,this.global=h||!1}encode(){const o=this.encodeBody();if(o==="")return null;const h=Buffer.byteLength(o),E=512*Math.ceil(1+h/512),y=Buffer.allocUnsafe(E);for(let m=0;m<512;m++)y[m]=0;new u({path:("PaxHeader/"+t.basename(this.path)).slice(0,99),mode:this.mode||420,uid:this.uid||null,gid:this.gid||null,size:h,mtime:this.mtime||null,type:this.global?"GlobalExtendedHeader":"ExtendedHeader",linkpath:"",uname:this.uname||"",gname:this.gname||"",devmaj:0,devmin:0,atime:this.atime||null,ctime:this.ctime||null}).encode(y),y.write(o,512,h,"utf8");for(let m=h+512;m<y.length;m++)y[m]=0;return y}encodeBody(){return this.encodeField("path")+this.encodeField("ctime")+this.encodeField("atime")+this.encodeField("dev")+this.encodeField("ino")+this.encodeField("nlink")+this.encodeField("charset")+this.encodeField("comment")+this.encodeField("gid")+this.encodeField("gname")+this.encodeField("linkpath")+this.encodeField("mtime")+this.encodeField("size")+this.encodeField("uid")+this.encodeField("uname")}encodeField(o){if(this[o]===null||this[o]===void 0)return"";const h=this[o]instanceof Date?this[o].getTime()/1e3:this[o],E=" "+(o==="dev"||o==="ino"||o==="nlink"?"SCHILY.":"")+o+"="+h+`
86
+ `)}function Tt({content:u,importCode:t,connectorCode:s}){return u.replace("/// INSERT IMPORT HERE",t).replace("/// INSERT CONTROLLER HERE",s)}var he={},$t,Es;function Ie(){if(Es)return $t;Es=1;const u=new Map([["C","cwd"],["f","file"],["z","gzip"],["P","preservePaths"],["U","unlink"],["strip-components","strip"],["stripComponents","strip"],["keep-newer","newer"],["keepNewer","newer"],["keep-newer-files","newer"],["keepNewerFiles","newer"],["k","keep"],["keep-existing","keep"],["keepExisting","keep"],["m","noMtime"],["no-mtime","noMtime"],["p","preserveOwner"],["L","follow"],["h","follow"]]);return $t=t=>t?Object.keys(t).map(s=>[u.has(s)?u.get(s):s,t[s]]).reduce((s,r)=>(s[r[0]]=r[1],s),Object.create(null)):{},$t}var Nt={},gs;function It(){if(gs)return Nt;gs=1;const u=typeof process=="object"&&process?process:{stdout:null,stderr:null},t=xe,s=Ti,i=$i.StringDecoder,a=Symbol("EOF"),e=Symbol("maybeEmitEnd"),o=Symbol("emittedEnd"),h=Symbol("emittingEnd"),E=Symbol("emittedError"),y=Symbol("closed"),m=Symbol("read"),C=Symbol("flush"),_=Symbol("flushChunk"),b=Symbol("encoding"),A=Symbol("decoder"),S=Symbol("flowing"),v=Symbol("paused"),n=Symbol("resume"),l=Symbol("buffer"),f=Symbol("pipes"),d=Symbol("bufferLength"),D=Symbol("bufferPush"),F=Symbol("bufferShift"),R=Symbol("objectMode"),B=Symbol("destroyed"),x=Symbol("error"),M=Symbol("emitData"),P=Symbol("emitEnd"),U=Symbol("emitEnd2"),G=Symbol("async"),Y=Symbol("abort"),N=Symbol("aborted"),V=Symbol("signal"),W=z=>Promise.resolve().then(z),ee=ct._MP_NO_ITERATOR_SYMBOLS_!=="1",w=ee&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),c=ee&&Symbol.iterator||Symbol("iterator not implemented"),g=z=>z==="end"||z==="finish"||z==="prefinish",L=z=>z instanceof ArrayBuffer||typeof z=="object"&&z.constructor&&z.constructor.name==="ArrayBuffer"&&z.byteLength>=0,H=z=>!Buffer.isBuffer(z)&&ArrayBuffer.isView(z);class J{constructor(O,T,K){this.src=O,this.dest=T,this.opts=K,this.ondrain=()=>O[n](),T.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}}class $ extends J{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(O,T,K){super(O,T,K),this.proxyErrors=oe=>T.emit("error",oe),O.on("error",this.proxyErrors)}}class q extends s{constructor(O){super(),this[S]=!1,this[v]=!1,this[f]=[],this[l]=[],this[R]=O&&O.objectMode||!1,this[R]?this[b]=null:this[b]=O&&O.encoding||null,this[b]==="buffer"&&(this[b]=null),this[G]=O&&!!O.async||!1,this[A]=this[b]?new i(this[b]):null,this[a]=!1,this[o]=!1,this[h]=!1,this[y]=!1,this[E]=null,this.writable=!0,this.readable=!0,this[d]=0,this[B]=!1,O&&O.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[l]}),O&&O.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[f]}),this[V]=O&&O.signal,this[N]=!1,this[V]&&(this[V].addEventListener("abort",()=>this[Y]()),this[V].aborted&&this[Y]())}get bufferLength(){return this[d]}get encoding(){return this[b]}set encoding(O){if(this[R])throw new Error("cannot set encoding in objectMode");if(this[b]&&O!==this[b]&&(this[A]&&this[A].lastNeed||this[d]))throw new Error("cannot change encoding");this[b]!==O&&(this[A]=O?new i(O):null,this[l].length&&(this[l]=this[l].map(T=>this[A].write(T)))),this[b]=O}setEncoding(O){this.encoding=O}get objectMode(){return this[R]}set objectMode(O){this[R]=this[R]||!!O}get async(){return this[G]}set async(O){this[G]=this[G]||!!O}[Y](){this[N]=!0,this.emit("abort",this[V].reason),this.destroy(this[V].reason)}get aborted(){return this[N]}set aborted(O){}write(O,T,K){if(this[N])return!1;if(this[a])throw new Error("write after end");if(this[B])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof T=="function"&&(K=T,T="utf8"),T||(T="utf8");const oe=this[G]?W:ce=>ce();return!this[R]&&!Buffer.isBuffer(O)&&(H(O)?O=Buffer.from(O.buffer,O.byteOffset,O.byteLength):L(O)?O=Buffer.from(O):typeof O!="string"&&(this.objectMode=!0)),this[R]?(this.flowing&&this[d]!==0&&this[C](!0),this.flowing?this.emit("data",O):this[D](O),this[d]!==0&&this.emit("readable"),K&&oe(K),this.flowing):O.length?(typeof O=="string"&&!(T===this[b]&&!this[A].lastNeed)&&(O=Buffer.from(O,T)),Buffer.isBuffer(O)&&this[b]&&(O=this[A].write(O)),this.flowing&&this[d]!==0&&this[C](!0),this.flowing?this.emit("data",O):this[D](O),this[d]!==0&&this.emit("readable"),K&&oe(K),this.flowing):(this[d]!==0&&this.emit("readable"),K&&oe(K),this.flowing)}read(O){if(this[B])return null;if(this[d]===0||O===0||O>this[d])return this[e](),null;this[R]&&(O=null),this[l].length>1&&!this[R]&&(this.encoding?this[l]=[this[l].join("")]:this[l]=[Buffer.concat(this[l],this[d])]);const T=this[m](O||null,this[l][0]);return this[e](),T}[m](O,T){return O===T.length||O===null?this[F]():(this[l][0]=T.slice(O),T=T.slice(0,O),this[d]-=O),this.emit("data",T),!this[l].length&&!this[a]&&this.emit("drain"),T}end(O,T,K){return typeof O=="function"&&(K=O,O=null),typeof T=="function"&&(K=T,T="utf8"),O&&this.write(O,T),K&&this.once("end",K),this[a]=!0,this.writable=!1,(this.flowing||!this[v])&&this[e](),this}[n](){this[B]||(this[v]=!1,this[S]=!0,this.emit("resume"),this[l].length?this[C]():this[a]?this[e]():this.emit("drain"))}resume(){return this[n]()}pause(){this[S]=!1,this[v]=!0}get destroyed(){return this[B]}get flowing(){return this[S]}get paused(){return this[v]}[D](O){this[R]?this[d]+=1:this[d]+=O.length,this[l].push(O)}[F](){return this[R]?this[d]-=1:this[d]-=this[l][0].length,this[l].shift()}[C](O){do;while(this[_](this[F]())&&this[l].length);!O&&!this[l].length&&!this[a]&&this.emit("drain")}[_](O){return this.emit("data",O),this.flowing}pipe(O,T){if(this[B])return;const K=this[o];return T=T||{},O===u.stdout||O===u.stderr?T.end=!1:T.end=T.end!==!1,T.proxyErrors=!!T.proxyErrors,K?T.end&&O.end():(this[f].push(T.proxyErrors?new $(this,O,T):new J(this,O,T)),this[G]?W(()=>this[n]()):this[n]()),O}unpipe(O){const T=this[f].find(K=>K.dest===O);T&&(this[f].splice(this[f].indexOf(T),1),T.unpipe())}addListener(O,T){return this.on(O,T)}on(O,T){const K=super.on(O,T);return O==="data"&&!this[f].length&&!this.flowing?this[n]():O==="readable"&&this[d]!==0?super.emit("readable"):g(O)&&this[o]?(super.emit(O),this.removeAllListeners(O)):O==="error"&&this[E]&&(this[G]?W(()=>T.call(this,this[E])):T.call(this,this[E])),K}get emittedEnd(){return this[o]}[e](){!this[h]&&!this[o]&&!this[B]&&this[l].length===0&&this[a]&&(this[h]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[y]&&this.emit("close"),this[h]=!1)}emit(O,T,...K){if(O!=="error"&&O!=="close"&&O!==B&&this[B])return;if(O==="data")return!this[R]&&!T?!1:this[G]?W(()=>this[M](T)):this[M](T);if(O==="end")return this[P]();if(O==="close"){if(this[y]=!0,!this[o]&&!this[B])return;const ce=super.emit("close");return this.removeAllListeners("close"),ce}else if(O==="error"){this[E]=T,super.emit(x,T);const ce=!this[V]||this.listeners("error").length?super.emit("error",T):!1;return this[e](),ce}else if(O==="resume"){const ce=super.emit("resume");return this[e](),ce}else if(O==="finish"||O==="prefinish"){const ce=super.emit(O);return this.removeAllListeners(O),ce}const oe=super.emit(O,T,...K);return this[e](),oe}[M](O){for(const K of this[f])K.dest.write(O)===!1&&this.pause();const T=super.emit("data",O);return this[e](),T}[P](){this[o]||(this[o]=!0,this.readable=!1,this[G]?W(()=>this[U]()):this[U]())}[U](){if(this[A]){const T=this[A].end();if(T){for(const K of this[f])K.dest.write(T);super.emit("data",T)}}for(const T of this[f])T.end();const O=super.emit("end");return this.removeAllListeners("end"),O}collect(){const O=[];this[R]||(O.dataLength=0);const T=this.promise();return this.on("data",K=>{O.push(K),this[R]||(O.dataLength+=K.length)}),T.then(()=>O)}concat(){return this[R]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(O=>this[R]?Promise.reject(new Error("cannot concat in objectMode")):this[b]?O.join(""):Buffer.concat(O,O.dataLength))}promise(){return new Promise((O,T)=>{this.on(B,()=>T(new Error("stream destroyed"))),this.on("error",K=>T(K)),this.on("end",()=>O())})}[w](){let O=!1;const T=()=>(this.pause(),O=!0,Promise.resolve({done:!0}));return{next:()=>{if(O)return T();const oe=this.read();if(oe!==null)return Promise.resolve({done:!1,value:oe});if(this[a])return T();let ce=null,Ge=null;const te=Z=>{this.removeListener("data",p),this.removeListener("end",k),this.removeListener(B,j),T(),Ge(Z)},p=Z=>{this.removeListener("error",te),this.removeListener("end",k),this.removeListener(B,j),this.pause(),ce({value:Z,done:!!this[a]})},k=()=>{this.removeListener("error",te),this.removeListener("data",p),this.removeListener(B,j),T(),ce({done:!0})},j=()=>te(new Error("stream destroyed"));return new Promise((Z,X)=>{Ge=X,ce=Z,this.once(B,j),this.once("error",te),this.once("end",k),this.once("data",p)})},throw:T,return:T,[w](){return this}}}[c](){let O=!1;const T=()=>(this.pause(),this.removeListener(x,T),this.removeListener(B,T),this.removeListener("end",T),O=!0,{done:!0}),K=()=>{if(O)return T();const oe=this.read();return oe===null?T():{value:oe}};return this.once("end",T),this.once(x,T),this.once(B,T),{next:K,throw:T,return:T,[c](){return this}}}destroy(O){return this[B]?(O?this.emit("error",O):this.emit(B),this):(this[B]=!0,this[l].length=0,this[d]=0,typeof this.close=="function"&&!this[y]&&this.close(),O?this.emit("error",O):this.emit(B),this)}static isStream(O){return!!O&&(O instanceof q||O instanceof s||O instanceof t&&(typeof O.pipe=="function"||typeof O.write=="function"&&typeof O.end=="function"))}}return Nt.Minipass=q,Nt}var Ee={},Lt,Cs;function Mn(){if(Cs)return Lt;Cs=1;const u=Ni.constants||{ZLIB_VERNUM:4736};return Lt=Object.freeze(Object.assign(Object.create(null),{Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,BROTLI_DECODE:8,BROTLI_ENCODE:9,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:1/0,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1,BROTLI_OPERATION_PROCESS:0,BROTLI_OPERATION_FLUSH:1,BROTLI_OPERATION_FINISH:2,BROTLI_OPERATION_EMIT_METADATA:3,BROTLI_MODE_GENERIC:0,BROTLI_MODE_TEXT:1,BROTLI_MODE_FONT:2,BROTLI_DEFAULT_MODE:0,BROTLI_MIN_QUALITY:0,BROTLI_MAX_QUALITY:11,BROTLI_DEFAULT_QUALITY:11,BROTLI_MIN_WINDOW_BITS:10,BROTLI_MAX_WINDOW_BITS:24,BROTLI_LARGE_MAX_WINDOW_BITS:30,BROTLI_DEFAULT_WINDOW:22,BROTLI_MIN_INPUT_BLOCK_BITS:16,BROTLI_MAX_INPUT_BLOCK_BITS:24,BROTLI_PARAM_MODE:0,BROTLI_PARAM_QUALITY:1,BROTLI_PARAM_LGWIN:2,BROTLI_PARAM_LGBLOCK:3,BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING:4,BROTLI_PARAM_SIZE_HINT:5,BROTLI_PARAM_LARGE_WINDOW:6,BROTLI_PARAM_NPOSTFIX:7,BROTLI_PARAM_NDIRECT:8,BROTLI_DECODER_RESULT_ERROR:0,BROTLI_DECODER_RESULT_SUCCESS:1,BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT:2,BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION:0,BROTLI_DECODER_PARAM_LARGE_WINDOW:1,BROTLI_DECODER_NO_ERROR:0,BROTLI_DECODER_SUCCESS:1,BROTLI_DECODER_NEEDS_MORE_INPUT:2,BROTLI_DECODER_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE:-1,BROTLI_DECODER_ERROR_FORMAT_RESERVED:-2,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE:-3,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET:-4,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME:-5,BROTLI_DECODER_ERROR_FORMAT_CL_SPACE:-6,BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE:-7,BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT:-8,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1:-9,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2:-10,BROTLI_DECODER_ERROR_FORMAT_TRANSFORM:-11,BROTLI_DECODER_ERROR_FORMAT_DICTIONARY:-12,BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS:-13,BROTLI_DECODER_ERROR_FORMAT_PADDING_1:-14,BROTLI_DECODER_ERROR_FORMAT_PADDING_2:-15,BROTLI_DECODER_ERROR_FORMAT_DISTANCE:-16,BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET:-19,BROTLI_DECODER_ERROR_INVALID_ARGUMENTS:-20,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES:-21,BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS:-22,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP:-25,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1:-26,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2:-27,BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES:-30,BROTLI_DECODER_ERROR_UNREACHABLE:-31},u)),Lt}var Mt,Fs;function ys(){if(Fs)return Mt;Fs=1;const u=typeof process=="object"&&process?process:{stdout:null,stderr:null},t=xe,s=Ti,r=$i.StringDecoder,i=Symbol("EOF"),a=Symbol("maybeEmitEnd"),e=Symbol("emittedEnd"),o=Symbol("emittingEnd"),h=Symbol("emittedError"),E=Symbol("closed"),y=Symbol("read"),m=Symbol("flush"),C=Symbol("flushChunk"),_=Symbol("encoding"),b=Symbol("decoder"),A=Symbol("flowing"),S=Symbol("paused"),v=Symbol("resume"),n=Symbol("bufferLength"),l=Symbol("bufferPush"),f=Symbol("bufferShift"),d=Symbol("objectMode"),D=Symbol("destroyed"),F=Symbol("emitData"),R=Symbol("emitEnd"),B=Symbol("emitEnd2"),x=Symbol("async"),M=w=>Promise.resolve().then(w),P=ct._MP_NO_ITERATOR_SYMBOLS_!=="1",U=P&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),G=P&&Symbol.iterator||Symbol("iterator not implemented"),Y=w=>w==="end"||w==="finish"||w==="prefinish",N=w=>w instanceof ArrayBuffer||typeof w=="object"&&w.constructor&&w.constructor.name==="ArrayBuffer"&&w.byteLength>=0,V=w=>!Buffer.isBuffer(w)&&ArrayBuffer.isView(w);class W{constructor(c,g,L){this.src=c,this.dest=g,this.opts=L,this.ondrain=()=>c[v](),g.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}}class ee extends W{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(c,g,L){super(c,g,L),this.proxyErrors=H=>g.emit("error",H),c.on("error",this.proxyErrors)}}return Mt=class Fr extends s{constructor(c){super(),this[A]=!1,this[S]=!1,this.pipes=[],this.buffer=[],this[d]=c&&c.objectMode||!1,this[d]?this[_]=null:this[_]=c&&c.encoding||null,this[_]==="buffer"&&(this[_]=null),this[x]=c&&!!c.async||!1,this[b]=this[_]?new r(this[_]):null,this[i]=!1,this[e]=!1,this[o]=!1,this[E]=!1,this[h]=null,this.writable=!0,this.readable=!0,this[n]=0,this[D]=!1}get bufferLength(){return this[n]}get encoding(){return this[_]}set encoding(c){if(this[d])throw new Error("cannot set encoding in objectMode");if(this[_]&&c!==this[_]&&(this[b]&&this[b].lastNeed||this[n]))throw new Error("cannot change encoding");this[_]!==c&&(this[b]=c?new r(c):null,this.buffer.length&&(this.buffer=this.buffer.map(g=>this[b].write(g)))),this[_]=c}setEncoding(c){this.encoding=c}get objectMode(){return this[d]}set objectMode(c){this[d]=this[d]||!!c}get async(){return this[x]}set async(c){this[x]=this[x]||!!c}write(c,g,L){if(this[i])throw new Error("write after end");if(this[D])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof g=="function"&&(L=g,g="utf8"),g||(g="utf8");const H=this[x]?M:J=>J();return!this[d]&&!Buffer.isBuffer(c)&&(V(c)?c=Buffer.from(c.buffer,c.byteOffset,c.byteLength):N(c)?c=Buffer.from(c):typeof c!="string"&&(this.objectMode=!0)),this[d]?(this.flowing&&this[n]!==0&&this[m](!0),this.flowing?this.emit("data",c):this[l](c),this[n]!==0&&this.emit("readable"),L&&H(L),this.flowing):c.length?(typeof c=="string"&&!(g===this[_]&&!this[b].lastNeed)&&(c=Buffer.from(c,g)),Buffer.isBuffer(c)&&this[_]&&(c=this[b].write(c)),this.flowing&&this[n]!==0&&this[m](!0),this.flowing?this.emit("data",c):this[l](c),this[n]!==0&&this.emit("readable"),L&&H(L),this.flowing):(this[n]!==0&&this.emit("readable"),L&&H(L),this.flowing)}read(c){if(this[D])return null;if(this[n]===0||c===0||c>this[n])return this[a](),null;this[d]&&(c=null),this.buffer.length>1&&!this[d]&&(this.encoding?this.buffer=[this.buffer.join("")]:this.buffer=[Buffer.concat(this.buffer,this[n])]);const g=this[y](c||null,this.buffer[0]);return this[a](),g}[y](c,g){return c===g.length||c===null?this[f]():(this.buffer[0]=g.slice(c),g=g.slice(0,c),this[n]-=c),this.emit("data",g),!this.buffer.length&&!this[i]&&this.emit("drain"),g}end(c,g,L){return typeof c=="function"&&(L=c,c=null),typeof g=="function"&&(L=g,g="utf8"),c&&this.write(c,g),L&&this.once("end",L),this[i]=!0,this.writable=!1,(this.flowing||!this[S])&&this[a](),this}[v](){this[D]||(this[S]=!1,this[A]=!0,this.emit("resume"),this.buffer.length?this[m]():this[i]?this[a]():this.emit("drain"))}resume(){return this[v]()}pause(){this[A]=!1,this[S]=!0}get destroyed(){return this[D]}get flowing(){return this[A]}get paused(){return this[S]}[l](c){this[d]?this[n]+=1:this[n]+=c.length,this.buffer.push(c)}[f](){return this.buffer.length&&(this[d]?this[n]-=1:this[n]-=this.buffer[0].length),this.buffer.shift()}[m](c){do;while(this[C](this[f]()));!c&&!this.buffer.length&&!this[i]&&this.emit("drain")}[C](c){return c?(this.emit("data",c),this.flowing):!1}pipe(c,g){if(this[D])return;const L=this[e];return g=g||{},c===u.stdout||c===u.stderr?g.end=!1:g.end=g.end!==!1,g.proxyErrors=!!g.proxyErrors,L?g.end&&c.end():(this.pipes.push(g.proxyErrors?new ee(this,c,g):new W(this,c,g)),this[x]?M(()=>this[v]()):this[v]()),c}unpipe(c){const g=this.pipes.find(L=>L.dest===c);g&&(this.pipes.splice(this.pipes.indexOf(g),1),g.unpipe())}addListener(c,g){return this.on(c,g)}on(c,g){const L=super.on(c,g);return c==="data"&&!this.pipes.length&&!this.flowing?this[v]():c==="readable"&&this[n]!==0?super.emit("readable"):Y(c)&&this[e]?(super.emit(c),this.removeAllListeners(c)):c==="error"&&this[h]&&(this[x]?M(()=>g.call(this,this[h])):g.call(this,this[h])),L}get emittedEnd(){return this[e]}[a](){!this[o]&&!this[e]&&!this[D]&&this.buffer.length===0&&this[i]&&(this[o]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[E]&&this.emit("close"),this[o]=!1)}emit(c,g,...L){if(c!=="error"&&c!=="close"&&c!==D&&this[D])return;if(c==="data")return g?this[x]?M(()=>this[F](g)):this[F](g):!1;if(c==="end")return this[R]();if(c==="close"){if(this[E]=!0,!this[e]&&!this[D])return;const J=super.emit("close");return this.removeAllListeners("close"),J}else if(c==="error"){this[h]=g;const J=super.emit("error",g);return this[a](),J}else if(c==="resume"){const J=super.emit("resume");return this[a](),J}else if(c==="finish"||c==="prefinish"){const J=super.emit(c);return this.removeAllListeners(c),J}const H=super.emit(c,g,...L);return this[a](),H}[F](c){for(const L of this.pipes)L.dest.write(c)===!1&&this.pause();const g=super.emit("data",c);return this[a](),g}[R](){this[e]||(this[e]=!0,this.readable=!1,this[x]?M(()=>this[B]()):this[B]())}[B](){if(this[b]){const g=this[b].end();if(g){for(const L of this.pipes)L.dest.write(g);super.emit("data",g)}}for(const g of this.pipes)g.end();const c=super.emit("end");return this.removeAllListeners("end"),c}collect(){const c=[];this[d]||(c.dataLength=0);const g=this.promise();return this.on("data",L=>{c.push(L),this[d]||(c.dataLength+=L.length)}),g.then(()=>c)}concat(){return this[d]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(c=>this[d]?Promise.reject(new Error("cannot concat in objectMode")):this[_]?c.join(""):Buffer.concat(c,c.dataLength))}promise(){return new Promise((c,g)=>{this.on(D,()=>g(new Error("stream destroyed"))),this.on("error",L=>g(L)),this.on("end",()=>c())})}[U](){return{next:()=>{const g=this.read();if(g!==null)return Promise.resolve({done:!1,value:g});if(this[i])return Promise.resolve({done:!0});let L=null,H=null;const J=O=>{this.removeListener("data",$),this.removeListener("end",q),H(O)},$=O=>{this.removeListener("error",J),this.removeListener("end",q),this.pause(),L({value:O,done:!!this[i]})},q=()=>{this.removeListener("error",J),this.removeListener("data",$),L({done:!0})},z=()=>J(new Error("stream destroyed"));return new Promise((O,T)=>{H=T,L=O,this.once(D,z),this.once("error",J),this.once("end",q),this.once("data",$)})}}}[G](){return{next:()=>{const g=this.read();return{value:g,done:g===null}}}}destroy(c){return this[D]?(c?this.emit("error",c):this.emit(D),this):(this[D]=!0,this.buffer.length=0,this[n]=0,typeof this.close=="function"&&!this[E]&&this.close(),c?this.emit("error",c):this.emit(D),this)}static isStream(c){return!!c&&(c instanceof Fr||c instanceof s||c instanceof t&&(typeof c.pipe=="function"||typeof c.write=="function"&&typeof c.end=="function"))}},Mt}var bs;function _s(){if(bs)return Ee;bs=1;const u=lt,t=Or.Buffer,s=Ni,r=Ee.constants=Mn(),i=ys(),a=t.concat,e=Symbol("_superWrite");class o extends Error{constructor(N){super("zlib: "+N.message),this.code=N.code,this.errno=N.errno,this.code||(this.code="ZLIB_ERROR"),this.message="zlib: "+N.message,Error.captureStackTrace(this,this.constructor)}get name(){return"ZlibError"}}const h=Symbol("opts"),E=Symbol("flushFlag"),y=Symbol("finishFlushFlag"),m=Symbol("fullFlushFlag"),C=Symbol("handle"),_=Symbol("onError"),b=Symbol("sawError"),A=Symbol("level"),S=Symbol("strategy"),v=Symbol("ended");class n extends i{constructor(N,V){if(!N||typeof N!="object")throw new TypeError("invalid options for ZlibBase constructor");super(N),this[b]=!1,this[v]=!1,this[h]=N,this[E]=N.flush,this[y]=N.finishFlush;try{this[C]=new s[V](N)}catch(W){throw new o(W)}this[_]=W=>{this[b]||(this[b]=!0,this.close(),this.emit("error",W))},this[C].on("error",W=>this[_](new o(W))),this.once("end",()=>this.close)}close(){this[C]&&(this[C].close(),this[C]=null,this.emit("close"))}reset(){if(!this[b])return u(this[C],"zlib binding closed"),this[C].reset()}flush(N){this.ended||(typeof N!="number"&&(N=this[m]),this.write(Object.assign(t.alloc(0),{[E]:N})))}end(N,V,W){return N&&this.write(N,V),this.flush(this[y]),this[v]=!0,super.end(null,null,W)}get ended(){return this[v]}write(N,V,W){if(typeof V=="function"&&(W=V,V="utf8"),typeof N=="string"&&(N=t.from(N,V)),this[b])return;u(this[C],"zlib binding closed");const ee=this[C]._handle,w=ee.close;ee.close=()=>{};const c=this[C].close;this[C].close=()=>{},t.concat=H=>H;let g;try{const H=typeof N[E]=="number"?N[E]:this[E];g=this[C]._processChunk(N,H),t.concat=a}catch(H){t.concat=a,this[_](new o(H))}finally{this[C]&&(this[C]._handle=ee,ee.close=w,this[C].close=c,this[C].removeAllListeners("error"))}this[C]&&this[C].on("error",H=>this[_](new o(H)));let L;if(g)if(Array.isArray(g)&&g.length>0){L=this[e](t.from(g[0]));for(let H=1;H<g.length;H++)L=this[e](g[H])}else L=this[e](t.from(g));return W&&W(),L}[e](N){return super.write(N)}}class l extends n{constructor(N,V){N=N||{},N.flush=N.flush||r.Z_NO_FLUSH,N.finishFlush=N.finishFlush||r.Z_FINISH,super(N,V),this[m]=r.Z_FULL_FLUSH,this[A]=N.level,this[S]=N.strategy}params(N,V){if(!this[b]){if(!this[C])throw new Error("cannot switch params when binding is closed");if(!this[C].params)throw new Error("not supported in this implementation");if(this[A]!==N||this[S]!==V){this.flush(r.Z_SYNC_FLUSH),u(this[C],"zlib binding closed");const W=this[C].flush;this[C].flush=(ee,w)=>{this.flush(ee),w()};try{this[C].params(N,V)}finally{this[C].flush=W}this[C]&&(this[A]=N,this[S]=V)}}}}class f extends l{constructor(N){super(N,"Deflate")}}class d extends l{constructor(N){super(N,"Inflate")}}const D=Symbol("_portable");class F extends l{constructor(N){super(N,"Gzip"),this[D]=N&&!!N.portable}[e](N){return this[D]?(this[D]=!1,N[9]=255,super[e](N)):super[e](N)}}class R extends l{constructor(N){super(N,"Gunzip")}}class B extends l{constructor(N){super(N,"DeflateRaw")}}class x extends l{constructor(N){super(N,"InflateRaw")}}class M extends l{constructor(N){super(N,"Unzip")}}class P extends n{constructor(N,V){N=N||{},N.flush=N.flush||r.BROTLI_OPERATION_PROCESS,N.finishFlush=N.finishFlush||r.BROTLI_OPERATION_FINISH,super(N,V),this[m]=r.BROTLI_OPERATION_FLUSH}}class U extends P{constructor(N){super(N,"BrotliCompress")}}class G extends P{constructor(N){super(N,"BrotliDecompress")}}return Ee.Deflate=f,Ee.Inflate=d,Ee.Gzip=F,Ee.Gunzip=R,Ee.DeflateRaw=B,Ee.InflateRaw=x,Ee.Unzip=M,typeof s.BrotliCompress=="function"?(Ee.BrotliCompress=U,Ee.BrotliDecompress=G):Ee.BrotliCompress=Ee.BrotliDecompress=class{constructor(){throw new Error("Brotli is not supported in this version of Node.js")}},Ee}var Pt,ws;function Le(){return ws||(ws=1,Pt=(process.env.TESTING_TAR_FAKE_PLATFORM||process.platform)!=="win32"?t=>t:t=>t&&t.replace(/\\/g,"/")),Pt}var kt,vs;function Ht(){if(vs)return kt;vs=1;const{Minipass:u}=It(),t=Le(),s=Symbol("slurp");return kt=class extends u{constructor(i,a,e){switch(super(),this.pause(),this.extended=a,this.globalExtended=e,this.header=i,this.startBlockSize=512*Math.ceil(i.size/512),this.blockRemain=this.startBlockSize,this.remain=i.size,this.type=i.type,this.meta=!1,this.ignore=!1,this.type){case"File":case"OldFile":case"Link":case"SymbolicLink":case"CharacterDevice":case"BlockDevice":case"Directory":case"FIFO":case"ContiguousFile":case"GNUDumpDir":break;case"NextFileHasLongLinkpath":case"NextFileHasLongPath":case"OldGnuLongPath":case"GlobalExtendedHeader":case"ExtendedHeader":case"OldExtendedHeader":this.meta=!0;break;default:this.ignore=!0}this.path=t(i.path),this.mode=i.mode,this.mode&&(this.mode=this.mode&4095),this.uid=i.uid,this.gid=i.gid,this.uname=i.uname,this.gname=i.gname,this.size=i.size,this.mtime=i.mtime,this.atime=i.atime,this.ctime=i.ctime,this.linkpath=t(i.linkpath),this.uname=i.uname,this.gname=i.gname,a&&this[s](a),e&&this[s](e,!0)}write(i){const a=i.length;if(a>this.blockRemain)throw new Error("writing more to entry than is appropriate");const e=this.remain,o=this.blockRemain;return this.remain=Math.max(0,e-a),this.blockRemain=Math.max(0,o-a),this.ignore?!0:e>=a?super.write(i):super.write(i.slice(0,e))}[s](i,a){for(const e in i)i[e]!==null&&i[e]!==void 0&&!(a&&e==="path")&&(this[e]=e==="path"||e==="linkpath"?t(i[e]):i[e])}},kt}var jt={},As;function Ss(){return As||(As=1,function(u){u.name=new Map([["0","File"],["","OldFile"],["1","Link"],["2","SymbolicLink"],["3","CharacterDevice"],["4","BlockDevice"],["5","Directory"],["6","FIFO"],["7","ContiguousFile"],["g","GlobalExtendedHeader"],["x","ExtendedHeader"],["A","SolarisACL"],["D","GNUDumpDir"],["I","Inode"],["K","NextFileHasLongLinkpath"],["L","NextFileHasLongPath"],["M","ContinuationFile"],["N","OldGnuLongPath"],["S","SparseFile"],["V","TapeVolumeHeader"],["X","OldExtendedHeader"]]),u.code=new Map(Array.from(u.name).map(t=>[t[1],t[0]]))}(jt)),jt}var Ut,Os;function Pn(){if(Os)return Ut;Os=1;const u=(h,E)=>{if(Number.isSafeInteger(h))h<0?s(h,E):t(h,E);else throw Error("cannot encode number outside of javascript safe integer range");return E},t=(h,E)=>{E[0]=128;for(var y=E.length;y>1;y--)E[y-1]=h&255,h=Math.floor(h/256)},s=(h,E)=>{E[0]=255;var y=!1;h=h*-1;for(var m=E.length;m>1;m--){var C=h&255;h=Math.floor(h/256),y?E[m-1]=e(C):C===0?E[m-1]=0:(y=!0,E[m-1]=o(C))}},r=h=>{const E=h[0],y=E===128?a(h.slice(1,h.length)):E===255?i(h):null;if(y===null)throw Error("invalid base256 encoding");if(!Number.isSafeInteger(y))throw Error("parsed number outside of javascript safe integer range");return y},i=h=>{for(var E=h.length,y=0,m=!1,C=E-1;C>-1;C--){var _=h[C],b;m?b=e(_):_===0?b=_:(m=!0,b=o(_)),b!==0&&(y-=b*Math.pow(256,E-C-1))}return y},a=h=>{for(var E=h.length,y=0,m=E-1;m>-1;m--){var C=h[m];C!==0&&(y+=C*Math.pow(256,E-m-1))}return y},e=h=>(255^h)&255,o=h=>(255^h)+1&255;return Ut={encode:u,parse:r},Ut}var zt,Rs;function Me(){if(Rs)return zt;Rs=1;const u=Ss(),t=De.posix,s=Pn(),r=Symbol("slurp"),i=Symbol("type");class a{constructor(D,F,R,B){this.cksumValid=!1,this.needPax=!1,this.nullBlock=!1,this.block=null,this.path=null,this.mode=null,this.uid=null,this.gid=null,this.size=null,this.mtime=null,this.cksum=null,this[i]="0",this.linkpath=null,this.uname=null,this.gname=null,this.devmaj=0,this.devmin=0,this.atime=null,this.ctime=null,Buffer.isBuffer(D)?this.decode(D,F||0,R,B):D&&this.set(D)}decode(D,F,R,B){if(F||(F=0),!D||!(D.length>=F+512))throw new Error("need 512 bytes for header");if(this.path=o(D,F,100),this.mode=y(D,F+100,8),this.uid=y(D,F+108,8),this.gid=y(D,F+116,8),this.size=y(D,F+124,12),this.mtime=h(D,F+136,12),this.cksum=y(D,F+148,12),this[r](R),this[r](B,!0),this[i]=o(D,F+156,1),this[i]===""&&(this[i]="0"),this[i]==="0"&&this.path.slice(-1)==="/"&&(this[i]="5"),this[i]==="5"&&(this.size=0),this.linkpath=o(D,F+157,100),D.slice(F+257,F+265).toString()==="ustar\x0000")if(this.uname=o(D,F+265,32),this.gname=o(D,F+297,32),this.devmaj=y(D,F+329,8),this.devmin=y(D,F+337,8),D[F+475]!==0){const M=o(D,F+345,155);this.path=M+"/"+this.path}else{const M=o(D,F+345,130);M&&(this.path=M+"/"+this.path),this.atime=h(D,F+476,12),this.ctime=h(D,F+488,12)}let x=8*32;for(let M=F;M<F+148;M++)x+=D[M];for(let M=F+156;M<F+512;M++)x+=D[M];this.cksumValid=x===this.cksum,this.cksum===null&&x===8*32&&(this.nullBlock=!0)}[r](D,F){for(const R in D)D[R]!==null&&D[R]!==void 0&&!(F&&R==="path")&&(this[R]=D[R])}encode(D,F){if(D||(D=this.block=Buffer.alloc(512),F=0),F||(F=0),!(D.length>=F+512))throw new Error("need 512 bytes for header");const R=this.ctime||this.atime?130:155,B=e(this.path||"",R),x=B[0],M=B[1];this.needPax=B[2],this.needPax=f(D,F,100,x)||this.needPax,this.needPax=b(D,F+100,8,this.mode)||this.needPax,this.needPax=b(D,F+108,8,this.uid)||this.needPax,this.needPax=b(D,F+116,8,this.gid)||this.needPax,this.needPax=b(D,F+124,12,this.size)||this.needPax,this.needPax=n(D,F+136,12,this.mtime)||this.needPax,D[F+156]=this[i].charCodeAt(0),this.needPax=f(D,F+157,100,this.linkpath)||this.needPax,D.write("ustar\x0000",F+257,8),this.needPax=f(D,F+265,32,this.uname)||this.needPax,this.needPax=f(D,F+297,32,this.gname)||this.needPax,this.needPax=b(D,F+329,8,this.devmaj)||this.needPax,this.needPax=b(D,F+337,8,this.devmin)||this.needPax,this.needPax=f(D,F+345,R,M)||this.needPax,D[F+475]!==0?this.needPax=f(D,F+345,155,M)||this.needPax:(this.needPax=f(D,F+345,130,M)||this.needPax,this.needPax=n(D,F+476,12,this.atime)||this.needPax,this.needPax=n(D,F+488,12,this.ctime)||this.needPax);let P=8*32;for(let U=F;U<F+148;U++)P+=D[U];for(let U=F+156;U<F+512;U++)P+=D[U];return this.cksum=P,b(D,F+148,8,this.cksum),this.cksumValid=!0,this.needPax}set(D){for(const F in D)D[F]!==null&&D[F]!==void 0&&(this[F]=D[F])}get type(){return u.name.get(this[i])||this[i]}get typeKey(){return this[i]}set type(D){u.code.has(D)?this[i]=u.code.get(D):this[i]=D}}const e=(d,D)=>{let R=d,B="",x;const M=t.parse(d).root||".";if(Buffer.byteLength(R)<100)x=[R,B,!1];else{B=t.dirname(R),R=t.basename(R);do Buffer.byteLength(R)<=100&&Buffer.byteLength(B)<=D?x=[R,B,!1]:Buffer.byteLength(R)>100&&Buffer.byteLength(B)<=D?x=[R.slice(0,99),B,!0]:(R=t.join(t.basename(B),R),B=t.dirname(B));while(B!==M&&!x);x||(x=[d.slice(0,99),"",!0])}return x},o=(d,D,F)=>d.slice(D,D+F).toString("utf8").replace(/\0.*/,""),h=(d,D,F)=>E(y(d,D,F)),E=d=>d===null?null:new Date(d*1e3),y=(d,D,F)=>d[D]&128?s.parse(d.slice(D,D+F)):C(d,D,F),m=d=>isNaN(d)?null:d,C=(d,D,F)=>m(parseInt(d.slice(D,D+F).toString("utf8").replace(/\0.*$/,"").trim(),8)),_={12:8589934591,8:2097151},b=(d,D,F,R)=>R===null?!1:R>_[F]||R<0?(s.encode(R,d.slice(D,D+F)),!0):(A(d,D,F,R),!1),A=(d,D,F,R)=>d.write(S(R,F),D,F,"ascii"),S=(d,D)=>v(Math.floor(d).toString(8),D),v=(d,D)=>(d.length===D-1?d:new Array(D-d.length-1).join("0")+d+" ")+"\0",n=(d,D,F,R)=>R===null?!1:b(d,D,F,R.getTime()/1e3),l=new Array(156).join("\0"),f=(d,D,F,R)=>R===null?!1:(d.write(R+l,D,F,"utf8"),R.length!==Buffer.byteLength(R)||R.length>F);return zt=a,zt}var Gt,Bs;function qt(){if(Bs)return Gt;Bs=1;const u=Me(),t=De;class s{constructor(o,h){this.atime=o.atime||null,this.charset=o.charset||null,this.comment=o.comment||null,this.ctime=o.ctime||null,this.gid=o.gid||null,this.gname=o.gname||null,this.linkpath=o.linkpath||null,this.mtime=o.mtime||null,this.path=o.path||null,this.size=o.size||null,this.uid=o.uid||null,this.uname=o.uname||null,this.dev=o.dev||null,this.ino=o.ino||null,this.nlink=o.nlink||null,this.global=h||!1}encode(){const o=this.encodeBody();if(o==="")return null;const h=Buffer.byteLength(o),E=512*Math.ceil(1+h/512),y=Buffer.allocUnsafe(E);for(let m=0;m<512;m++)y[m]=0;new u({path:("PaxHeader/"+t.basename(this.path)).slice(0,99),mode:this.mode||420,uid:this.uid||null,gid:this.gid||null,size:h,mtime:this.mtime||null,type:this.global?"GlobalExtendedHeader":"ExtendedHeader",linkpath:"",uname:this.uname||"",gname:this.gname||"",devmaj:0,devmin:0,atime:this.atime||null,ctime:this.ctime||null}).encode(y),y.write(o,512,h,"utf8");for(let m=h+512;m<y.length;m++)y[m]=0;return y}encodeBody(){return this.encodeField("path")+this.encodeField("ctime")+this.encodeField("atime")+this.encodeField("dev")+this.encodeField("ino")+this.encodeField("nlink")+this.encodeField("charset")+this.encodeField("comment")+this.encodeField("gid")+this.encodeField("gname")+this.encodeField("linkpath")+this.encodeField("mtime")+this.encodeField("size")+this.encodeField("uid")+this.encodeField("uname")}encodeField(o){if(this[o]===null||this[o]===void 0)return"";const h=this[o]instanceof Date?this[o].getTime()/1e3:this[o],E=" "+(o==="dev"||o==="ino"||o==="nlink"?"SCHILY.":"")+o+"="+h+`
87
87
  `,y=Buffer.byteLength(E);let m=Math.floor(Math.log(y)/Math.log(10))+1;return y+m>=Math.pow(10,m)&&(m+=1),m+y+E}}s.parse=(e,o,h)=>new s(r(i(e),o),h);const r=(e,o)=>o?Object.keys(e).reduce((h,E)=>(h[E]=e[E],h),o):e,i=e=>e.replace(/\n$/,"").split(`
88
- `).reduce(a,Object.create(null)),a=(e,o)=>{const h=parseInt(o,10);if(h!==Buffer.byteLength(o)+1)return e;o=o.slice((h+" ").length);const E=o.split("="),y=E.shift().replace(/^SCHILY\.(dev|ino|nlink)/,"$1");if(!y)return e;const m=E.join("=");return e[y]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(y)?new Date(m*1e3):/^[0-9]+$/.test(m)?+m:m,e};return Gt=s,Gt}var Vt,xs;function Pe(){return xs||(xs=1,Vt=u=>{let t=u.length-1,s=-1;for(;t>-1&&u.charAt(t)==="/";)s=t,t--;return s===-1?u:u.slice(0,s)}),Vt}var Wt,Ts;function Kt(){return Ts||(Ts=1,Wt=u=>class extends u{warn(t,s,r={}){this.file&&(r.file=this.file),this.cwd&&(r.cwd=this.cwd),r.code=s instanceof Error&&s.code||t,r.tarCode=t,!this.strict&&r.recoverable!==!1?(s instanceof Error&&(r=Object.assign(s,r),s=s.message),this.emit("warn",r.tarCode,s,r)):s instanceof Error?this.emit("error",Object.assign(s,r)):this.emit("error",Object.assign(new Error(`${t}: ${s}`),r))}}),Wt}var Yt,$s;function Ns(){if($s)return Yt;$s=1;const u=["|","<",">","?",":"],t=u.map(i=>String.fromCharCode(61440+i.charCodeAt(0))),s=new Map(u.map((i,a)=>[i,t[a]])),r=new Map(t.map((i,a)=>[i,u[a]]));return Yt={encode:i=>u.reduce((a,e)=>a.split(e).join(s.get(e)),i),decode:i=>t.reduce((a,e)=>a.split(e).join(r.get(e)),i)},Yt}var Zt,Is;function Ls(){if(Is)return Zt;Is=1;const{isAbsolute:u,parse:t}=fe.win32;return Zt=s=>{let r="",i=t(s);for(;u(s)||i.root;){const a=s.charAt(0)==="/"&&s.slice(0,4)!=="//?/"?"/":i.root;s=s.slice(a.length),r+=a,i=t(s)}return[r,s]},Zt}var Xt,Ms;function Pn(){return Ms||(Ms=1,Xt=(u,t,s)=>(u&=4095,s&&(u=(u|384)&-19),t&&(u&256&&(u|=64),u&32&&(u|=8),u&4&&(u|=1)),u)),Xt}var Jt,Ps;function ks(){if(Ps)return Jt;Ps=1;const{Minipass:u}=It(),t=qt(),s=Me(),r=ge,i=fe,a=Le(),e=Pe(),o=(w,c)=>c?(w=a(w).replace(/^\.(\/|$)/,""),e(c)+"/"+w):a(w),h=16*1024*1024,E=Symbol("process"),y=Symbol("file"),m=Symbol("directory"),C=Symbol("symlink"),_=Symbol("hardlink"),b=Symbol("header"),A=Symbol("read"),S=Symbol("lstat"),v=Symbol("onlstat"),n=Symbol("onread"),l=Symbol("onreadlink"),f=Symbol("openfile"),d=Symbol("onopenfile"),D=Symbol("close"),F=Symbol("mode"),R=Symbol("awaitDrain"),B=Symbol("ondrain"),x=Symbol("prefix"),M=Symbol("hadError"),P=Kt(),U=Ns(),G=Ls(),Y=Pn(),N=P(class extends u{constructor(c,g){if(g=g||{},super(g),typeof c!="string")throw new TypeError("path is required");this.path=a(c),this.portable=!!g.portable,this.myuid=process.getuid&&process.getuid()||0,this.myuser=process.env.USER||"",this.maxReadSize=g.maxReadSize||h,this.linkCache=g.linkCache||new Map,this.statCache=g.statCache||new Map,this.preservePaths=!!g.preservePaths,this.cwd=a(g.cwd||process.cwd()),this.strict=!!g.strict,this.noPax=!!g.noPax,this.noMtime=!!g.noMtime,this.mtime=g.mtime||null,this.prefix=g.prefix?a(g.prefix):null,this.fd=null,this.blockLen=null,this.blockRemain=null,this.buf=null,this.offset=null,this.length=null,this.pos=null,this.remain=null,typeof g.onwarn=="function"&&this.on("warn",g.onwarn);let L=!1;if(!this.preservePaths){const[j,J]=G(this.path);j&&(this.path=J,L=j)}this.win32=!!g.win32||process.platform==="win32",this.win32&&(this.path=U.decode(this.path.replace(/\\/g,"/")),c=c.replace(/\\/g,"/")),this.absolute=a(g.absolute||i.resolve(this.cwd,c)),this.path===""&&(this.path="./"),L&&this.warn("TAR_ENTRY_INFO",`stripping ${L} from absolute path`,{entry:this,path:L+this.path}),this.statCache.has(this.absolute)?this[v](this.statCache.get(this.absolute)):this[S]()}emit(c,...g){return c==="error"&&(this[M]=!0),super.emit(c,...g)}[S](){r.lstat(this.absolute,(c,g)=>{if(c)return this.emit("error",c);this[v](g)})}[v](c){this.statCache.set(this.absolute,c),this.stat=c,c.isFile()||(c.size=0),this.type=ee(c),this.emit("stat",c),this[E]()}[E](){switch(this.type){case"File":return this[y]();case"Directory":return this[m]();case"SymbolicLink":return this[C]();default:return this.end()}}[F](c){return Y(c,this.type==="Directory",this.portable)}[x](c){return o(c,this.prefix)}[b](){this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.header=new s({path:this[x](this.path),linkpath:this.type==="Link"?this[x](this.linkpath):this.linkpath,mode:this[F](this.stat.mode),uid:this.portable?null:this.stat.uid,gid:this.portable?null:this.stat.gid,size:this.stat.size,mtime:this.noMtime?null:this.mtime||this.stat.mtime,type:this.type,uname:this.portable?null:this.stat.uid===this.myuid?this.myuser:"",atime:this.portable?null:this.stat.atime,ctime:this.portable?null:this.stat.ctime}),this.header.encode()&&!this.noPax&&super.write(new t({atime:this.portable?null:this.header.atime,ctime:this.portable?null:this.header.ctime,gid:this.portable?null:this.header.gid,mtime:this.noMtime?null:this.mtime||this.header.mtime,path:this[x](this.path),linkpath:this.type==="Link"?this[x](this.linkpath):this.linkpath,size:this.header.size,uid:this.portable?null:this.header.uid,uname:this.portable?null:this.header.uname,dev:this.portable?null:this.stat.dev,ino:this.portable?null:this.stat.ino,nlink:this.portable?null:this.stat.nlink}).encode()),super.write(this.header.block)}[m](){this.path.slice(-1)!=="/"&&(this.path+="/"),this.stat.size=0,this[b](),this.end()}[C](){r.readlink(this.absolute,(c,g)=>{if(c)return this.emit("error",c);this[l](g)})}[l](c){this.linkpath=a(c),this[b](),this.end()}[_](c){this.type="Link",this.linkpath=a(i.relative(this.cwd,c)),this.stat.size=0,this[b](),this.end()}[y](){if(this.stat.nlink>1){const c=this.stat.dev+":"+this.stat.ino;if(this.linkCache.has(c)){const g=this.linkCache.get(c);if(g.indexOf(this.cwd)===0)return this[_](g)}this.linkCache.set(c,this.absolute)}if(this[b](),this.stat.size===0)return this.end();this[f]()}[f](){r.open(this.absolute,"r",(c,g)=>{if(c)return this.emit("error",c);this[d](g)})}[d](c){if(this.fd=c,this[M])return this[D]();this.blockLen=512*Math.ceil(this.stat.size/512),this.blockRemain=this.blockLen;const g=Math.min(this.blockLen,this.maxReadSize);this.buf=Buffer.allocUnsafe(g),this.offset=0,this.pos=0,this.remain=this.stat.size,this.length=this.buf.length,this[A]()}[A](){const{fd:c,buf:g,offset:L,length:j,pos:J}=this;r.read(c,g,L,j,J,($,q)=>{if($)return this[D](()=>this.emit("error",$));this[n](q)})}[D](c){r.close(this.fd,c)}[n](c){if(c<=0&&this.remain>0){const j=new Error("encountered unexpected EOF");return j.path=this.absolute,j.syscall="read",j.code="EOF",this[D](()=>this.emit("error",j))}if(c>this.remain){const j=new Error("did not encounter expected EOF");return j.path=this.absolute,j.syscall="read",j.code="EOF",this[D](()=>this.emit("error",j))}if(c===this.remain)for(let j=c;j<this.length&&c<this.blockRemain;j++)this.buf[j+this.offset]=0,c++,this.remain++;const g=this.offset===0&&c===this.buf.length?this.buf:this.buf.slice(this.offset,this.offset+c);this.write(g)?this[B]():this[R](()=>this[B]())}[R](c){this.once("drain",c)}write(c){if(this.blockRemain<c.length){const g=new Error("writing more data than expected");return g.path=this.absolute,this.emit("error",g)}return this.remain-=c.length,this.blockRemain-=c.length,this.pos+=c.length,this.offset+=c.length,super.write(c)}[B](){if(!this.remain)return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),this[D](c=>c?this.emit("error",c):this.end());this.offset>=this.length&&(this.buf=Buffer.allocUnsafe(Math.min(this.blockRemain,this.buf.length)),this.offset=0),this.length=this.buf.length-this.offset,this[A]()}});class V extends N{[S](){this[v](r.lstatSync(this.absolute))}[C](){this[l](r.readlinkSync(this.absolute))}[f](){this[d](r.openSync(this.absolute,"r"))}[A](){let c=!0;try{const{fd:g,buf:L,offset:j,length:J,pos:$}=this,q=r.readSync(g,L,j,J,$);this[n](q),c=!1}finally{if(c)try{this[D](()=>{})}catch{}}}[R](c){c()}[D](c){r.closeSync(this.fd),c()}}const W=P(class extends u{constructor(c,g){g=g||{},super(g),this.preservePaths=!!g.preservePaths,this.portable=!!g.portable,this.strict=!!g.strict,this.noPax=!!g.noPax,this.noMtime=!!g.noMtime,this.readEntry=c,this.type=c.type,this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.prefix=g.prefix||null,this.path=a(c.path),this.mode=this[F](c.mode),this.uid=this.portable?null:c.uid,this.gid=this.portable?null:c.gid,this.uname=this.portable?null:c.uname,this.gname=this.portable?null:c.gname,this.size=c.size,this.mtime=this.noMtime?null:g.mtime||c.mtime,this.atime=this.portable?null:c.atime,this.ctime=this.portable?null:c.ctime,this.linkpath=a(c.linkpath),typeof g.onwarn=="function"&&this.on("warn",g.onwarn);let L=!1;if(!this.preservePaths){const[j,J]=G(this.path);j&&(this.path=J,L=j)}this.remain=c.size,this.blockRemain=c.startBlockSize,this.header=new s({path:this[x](this.path),linkpath:this.type==="Link"?this[x](this.linkpath):this.linkpath,mode:this.mode,uid:this.portable?null:this.uid,gid:this.portable?null:this.gid,size:this.size,mtime:this.noMtime?null:this.mtime,type:this.type,uname:this.portable?null:this.uname,atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime}),L&&this.warn("TAR_ENTRY_INFO",`stripping ${L} from absolute path`,{entry:this,path:L+this.path}),this.header.encode()&&!this.noPax&&super.write(new t({atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime,gid:this.portable?null:this.gid,mtime:this.noMtime?null:this.mtime,path:this[x](this.path),linkpath:this.type==="Link"?this[x](this.linkpath):this.linkpath,size:this.size,uid:this.portable?null:this.uid,uname:this.portable?null:this.uname,dev:this.portable?null:this.readEntry.dev,ino:this.portable?null:this.readEntry.ino,nlink:this.portable?null:this.readEntry.nlink}).encode()),super.write(this.header.block),c.pipe(this)}[x](c){return o(c,this.prefix)}[F](c){return Y(c,this.type==="Directory",this.portable)}write(c){const g=c.length;if(g>this.blockRemain)throw new Error("writing more to entry than is appropriate");return this.blockRemain-=g,super.write(c)}end(){return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),super.end()}});N.Sync=V,N.Tar=W;const ee=w=>w.isFile()?"File":w.isDirectory()?"Directory":w.isSymbolicLink()?"SymbolicLink":"Unsupported";return Jt=N,Jt}var Qt,js;function kn(){return js||(js=1,Qt=function(u){u.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}),Qt}var ei,Hs;function Us(){if(Hs)return ei;Hs=1,ei=u,u.Node=i,u.create=u;function u(a){var e=this;if(e instanceof u||(e=new u),e.tail=null,e.head=null,e.length=0,a&&typeof a.forEach=="function")a.forEach(function(E){e.push(E)});else if(arguments.length>0)for(var o=0,h=arguments.length;o<h;o++)e.push(arguments[o]);return e}u.prototype.removeNode=function(a){if(a.list!==this)throw new Error("removing node which does not belong to this list");var e=a.next,o=a.prev;return e&&(e.prev=o),o&&(o.next=e),a===this.head&&(this.head=e),a===this.tail&&(this.tail=o),a.list.length--,a.next=null,a.prev=null,a.list=null,e},u.prototype.unshiftNode=function(a){if(a!==this.head){a.list&&a.list.removeNode(a);var e=this.head;a.list=this,a.next=e,e&&(e.prev=a),this.head=a,this.tail||(this.tail=a),this.length++}},u.prototype.pushNode=function(a){if(a!==this.tail){a.list&&a.list.removeNode(a);var e=this.tail;a.list=this,a.prev=e,e&&(e.next=a),this.tail=a,this.head||(this.head=a),this.length++}},u.prototype.push=function(){for(var a=0,e=arguments.length;a<e;a++)s(this,arguments[a]);return this.length},u.prototype.unshift=function(){for(var a=0,e=arguments.length;a<e;a++)r(this,arguments[a]);return this.length},u.prototype.pop=function(){if(this.tail){var a=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,a}},u.prototype.shift=function(){if(this.head){var a=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,a}},u.prototype.forEach=function(a,e){e=e||this;for(var o=this.head,h=0;o!==null;h++)a.call(e,o.value,h,this),o=o.next},u.prototype.forEachReverse=function(a,e){e=e||this;for(var o=this.tail,h=this.length-1;o!==null;h--)a.call(e,o.value,h,this),o=o.prev},u.prototype.get=function(a){for(var e=0,o=this.head;o!==null&&e<a;e++)o=o.next;if(e===a&&o!==null)return o.value},u.prototype.getReverse=function(a){for(var e=0,o=this.tail;o!==null&&e<a;e++)o=o.prev;if(e===a&&o!==null)return o.value},u.prototype.map=function(a,e){e=e||this;for(var o=new u,h=this.head;h!==null;)o.push(a.call(e,h.value,this)),h=h.next;return o},u.prototype.mapReverse=function(a,e){e=e||this;for(var o=new u,h=this.tail;h!==null;)o.push(a.call(e,h.value,this)),h=h.prev;return o},u.prototype.reduce=function(a,e){var o,h=this.head;if(arguments.length>1)o=e;else if(this.head)h=this.head.next,o=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var E=0;h!==null;E++)o=a(o,h.value,E),h=h.next;return o},u.prototype.reduceReverse=function(a,e){var o,h=this.tail;if(arguments.length>1)o=e;else if(this.tail)h=this.tail.prev,o=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var E=this.length-1;h!==null;E--)o=a(o,h.value,E),h=h.prev;return o},u.prototype.toArray=function(){for(var a=new Array(this.length),e=0,o=this.head;o!==null;e++)a[e]=o.value,o=o.next;return a},u.prototype.toArrayReverse=function(){for(var a=new Array(this.length),e=0,o=this.tail;o!==null;e++)a[e]=o.value,o=o.prev;return a},u.prototype.slice=function(a,e){e=e||this.length,e<0&&(e+=this.length),a=a||0,a<0&&(a+=this.length);var o=new u;if(e<a||e<0)return o;a<0&&(a=0),e>this.length&&(e=this.length);for(var h=0,E=this.head;E!==null&&h<a;h++)E=E.next;for(;E!==null&&h<e;h++,E=E.next)o.push(E.value);return o},u.prototype.sliceReverse=function(a,e){e=e||this.length,e<0&&(e+=this.length),a=a||0,a<0&&(a+=this.length);var o=new u;if(e<a||e<0)return o;a<0&&(a=0),e>this.length&&(e=this.length);for(var h=this.length,E=this.tail;E!==null&&h>e;h--)E=E.prev;for(;E!==null&&h>a;h--,E=E.prev)o.push(E.value);return o},u.prototype.splice=function(a,e,...o){a>this.length&&(a=this.length-1),a<0&&(a=this.length+a);for(var h=0,E=this.head;E!==null&&h<a;h++)E=E.next;for(var y=[],h=0;E&&h<e;h++)y.push(E.value),E=this.removeNode(E);E===null&&(E=this.tail),E!==this.head&&E!==this.tail&&(E=E.prev);for(var h=0;h<o.length;h++)E=t(this,E,o[h]);return y},u.prototype.reverse=function(){for(var a=this.head,e=this.tail,o=a;o!==null;o=o.prev){var h=o.prev;o.prev=o.next,o.next=h}return this.head=e,this.tail=a,this};function t(a,e,o){var h=e===a.head?new i(o,null,e,a):new i(o,e,e.next,a);return h.next===null&&(a.tail=h),h.prev===null&&(a.head=h),a.length++,h}function s(a,e){a.tail=new i(e,a.tail,null,a),a.head||(a.head=a.tail),a.length++}function r(a,e){a.head=new i(e,null,a.head,a),a.tail||(a.tail=a.head),a.length++}function i(a,e,o,h){if(!(this instanceof i))return new i(a,e,o,h);this.list=h,this.value=a,e?(e.next=this,this.prev=e):this.prev=null,o?(o.prev=this,this.next=o):this.next=null}try{kn()(u)}catch{}return ei}var ti,zs;function ii(){if(zs)return ti;zs=1;class u{constructor(w,c){this.path=w||"./",this.absolute=c,this.entry=null,this.stat=null,this.readdir=null,this.pending=!1,this.ignore=!1,this.piped=!1}}const{Minipass:t}=It(),s=_s(),r=jt(),i=ks(),a=i.Sync,e=i.Tar,o=Us(),h=Buffer.alloc(1024),E=Symbol("onStat"),y=Symbol("ended"),m=Symbol("queue"),C=Symbol("current"),_=Symbol("process"),b=Symbol("processing"),A=Symbol("processJob"),S=Symbol("jobs"),v=Symbol("jobDone"),n=Symbol("addFSEntry"),l=Symbol("addTarEntry"),f=Symbol("stat"),d=Symbol("readdir"),D=Symbol("onreaddir"),F=Symbol("pipe"),R=Symbol("entry"),B=Symbol("entryOpt"),x=Symbol("writeEntryClass"),M=Symbol("write"),P=Symbol("ondrain"),U=ge,G=fe,Y=Kt(),N=Le(),V=Y(class extends t{constructor(w){if(super(w),w=w||Object.create(null),this.opt=w,this.file=w.file||"",this.cwd=w.cwd||process.cwd(),this.maxReadSize=w.maxReadSize,this.preservePaths=!!w.preservePaths,this.strict=!!w.strict,this.noPax=!!w.noPax,this.prefix=N(w.prefix||""),this.linkCache=w.linkCache||new Map,this.statCache=w.statCache||new Map,this.readdirCache=w.readdirCache||new Map,this[x]=i,typeof w.onwarn=="function"&&this.on("warn",w.onwarn),this.portable=!!w.portable,this.zip=null,w.gzip||w.brotli){if(w.gzip&&w.brotli)throw new TypeError("gzip and brotli are mutually exclusive");w.gzip&&(typeof w.gzip!="object"&&(w.gzip={}),this.portable&&(w.gzip.portable=!0),this.zip=new s.Gzip(w.gzip)),w.brotli&&(typeof w.brotli!="object"&&(w.brotli={}),this.zip=new s.BrotliCompress(w.brotli)),this.zip.on("data",c=>super.write(c)),this.zip.on("end",c=>super.end()),this.zip.on("drain",c=>this[P]()),this.on("resume",c=>this.zip.resume())}else this.on("drain",this[P]);this.noDirRecurse=!!w.noDirRecurse,this.follow=!!w.follow,this.noMtime=!!w.noMtime,this.mtime=w.mtime||null,this.filter=typeof w.filter=="function"?w.filter:c=>!0,this[m]=new o,this[S]=0,this.jobs=+w.jobs||4,this[b]=!1,this[y]=!1}[M](w){return super.write(w)}add(w){return this.write(w),this}end(w){return w&&this.write(w),this[y]=!0,this[_](),this}write(w){if(this[y])throw new Error("write after end");return w instanceof r?this[l](w):this[n](w),this.flowing}[l](w){const c=N(G.resolve(this.cwd,w.path));if(!this.filter(w.path,w))w.resume();else{const g=new u(w.path,c,!1);g.entry=new e(w,this[B](g)),g.entry.on("end",L=>this[v](g)),this[S]+=1,this[m].push(g)}this[_]()}[n](w){const c=N(G.resolve(this.cwd,w));this[m].push(new u(w,c)),this[_]()}[f](w){w.pending=!0,this[S]+=1;const c=this.follow?"stat":"lstat";U[c](w.absolute,(g,L)=>{w.pending=!1,this[S]-=1,g?this.emit("error",g):this[E](w,L)})}[E](w,c){this.statCache.set(w.absolute,c),w.stat=c,this.filter(w.path,c)||(w.ignore=!0),this[_]()}[d](w){w.pending=!0,this[S]+=1,U.readdir(w.absolute,(c,g)=>{if(w.pending=!1,this[S]-=1,c)return this.emit("error",c);this[D](w,g)})}[D](w,c){this.readdirCache.set(w.absolute,c),w.readdir=c,this[_]()}[_](){if(!this[b]){this[b]=!0;for(let w=this[m].head;w!==null&&this[S]<this.jobs;w=w.next)if(this[A](w.value),w.value.ignore){const c=w.next;this[m].removeNode(w),w.next=c}this[b]=!1,this[y]&&!this[m].length&&this[S]===0&&(this.zip?this.zip.end(h):(super.write(h),super.end()))}}get[C](){return this[m]&&this[m].head&&this[m].head.value}[v](w){this[m].shift(),this[S]-=1,this[_]()}[A](w){if(!w.pending){if(w.entry){w===this[C]&&!w.piped&&this[F](w);return}if(w.stat||(this.statCache.has(w.absolute)?this[E](w,this.statCache.get(w.absolute)):this[f](w)),!!w.stat&&!w.ignore&&!(!this.noDirRecurse&&w.stat.isDirectory()&&!w.readdir&&(this.readdirCache.has(w.absolute)?this[D](w,this.readdirCache.get(w.absolute)):this[d](w),!w.readdir))){if(w.entry=this[R](w),!w.entry){w.ignore=!0;return}w===this[C]&&!w.piped&&this[F](w)}}}[B](w){return{onwarn:(c,g,L)=>this.warn(c,g,L),noPax:this.noPax,cwd:this.cwd,absolute:w.absolute,preservePaths:this.preservePaths,maxReadSize:this.maxReadSize,strict:this.strict,portable:this.portable,linkCache:this.linkCache,statCache:this.statCache,noMtime:this.noMtime,mtime:this.mtime,prefix:this.prefix}}[R](w){this[S]+=1;try{return new this[x](w.path,this[B](w)).on("end",()=>this[v](w)).on("error",c=>this.emit("error",c))}catch(c){this.emit("error",c)}}[P](){this[C]&&this[C].entry&&this[C].entry.resume()}[F](w){w.piped=!0,w.readdir&&w.readdir.forEach(L=>{const j=w.path,J=j==="./"?"":j.replace(/\/*$/,"/");this[n](J+L)});const c=w.entry,g=this.zip;g?c.on("data",L=>{g.write(L)||c.pause()}):c.on("data",L=>{super.write(L)||c.pause()})}pause(){return this.zip&&this.zip.pause(),super.pause()}});class W extends V{constructor(w){super(w),this[x]=a}pause(){}resume(){}[f](w){const c=this.follow?"statSync":"lstatSync";this[E](w,U[c](w.absolute))}[d](w,c){this[D](w,U.readdirSync(w.absolute))}[F](w){const c=w.entry,g=this.zip;w.readdir&&w.readdir.forEach(L=>{const j=w.path,J=j==="./"?"":j.replace(/\/*$/,"/");this[n](J+L)}),g?c.on("data",L=>{g.write(L)}):c.on("data",L=>{super[M](L)})}}return V.Sync=W,ti=V,ti}var Re={},Gs;function ke(){if(Gs)return Re;Gs=1;const u=ys(),t=xe.EventEmitter,s=ge;let r=s.writev;if(!r){const w=process.binding("fs"),c=w.FSReqWrap||w.FSReqCallback;r=(g,L,j,J)=>{const $=(z,O)=>J(z,O,L),q=new c;q.oncomplete=$,w.writeBuffers(g,L,j,q)}}const i=Symbol("_autoClose"),a=Symbol("_close"),e=Symbol("_ended"),o=Symbol("_fd"),h=Symbol("_finished"),E=Symbol("_flags"),y=Symbol("_flush"),m=Symbol("_handleChunk"),C=Symbol("_makeBuf"),_=Symbol("_mode"),b=Symbol("_needDrain"),A=Symbol("_onerror"),S=Symbol("_onopen"),v=Symbol("_onread"),n=Symbol("_onwrite"),l=Symbol("_open"),f=Symbol("_path"),d=Symbol("_pos"),D=Symbol("_queue"),F=Symbol("_read"),R=Symbol("_readSize"),B=Symbol("_reading"),x=Symbol("_remain"),M=Symbol("_size"),P=Symbol("_write"),U=Symbol("_writing"),G=Symbol("_defaultFlag"),Y=Symbol("_errored");class N extends u{constructor(c,g){if(g=g||{},super(g),this.readable=!0,this.writable=!1,typeof c!="string")throw new TypeError("path must be a string");this[Y]=!1,this[o]=typeof g.fd=="number"?g.fd:null,this[f]=c,this[R]=g.readSize||16*1024*1024,this[B]=!1,this[M]=typeof g.size=="number"?g.size:1/0,this[x]=this[M],this[i]=typeof g.autoClose=="boolean"?g.autoClose:!0,typeof this[o]=="number"?this[F]():this[l]()}get fd(){return this[o]}get path(){return this[f]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[l](){s.open(this[f],"r",(c,g)=>this[S](c,g))}[S](c,g){c?this[A](c):(this[o]=g,this.emit("open",g),this[F]())}[C](){return Buffer.allocUnsafe(Math.min(this[R],this[x]))}[F](){if(!this[B]){this[B]=!0;const c=this[C]();if(c.length===0)return process.nextTick(()=>this[v](null,0,c));s.read(this[o],c,0,c.length,null,(g,L,j)=>this[v](g,L,j))}}[v](c,g,L){this[B]=!1,c?this[A](c):this[m](g,L)&&this[F]()}[a](){if(this[i]&&typeof this[o]=="number"){const c=this[o];this[o]=null,s.close(c,g=>g?this.emit("error",g):this.emit("close"))}}[A](c){this[B]=!0,this[a](),this.emit("error",c)}[m](c,g){let L=!1;return this[x]-=c,c>0&&(L=super.write(c<g.length?g.slice(0,c):g)),(c===0||this[x]<=0)&&(L=!1,this[a](),super.end()),L}emit(c,g){switch(c){case"prefinish":case"finish":break;case"drain":typeof this[o]=="number"&&this[F]();break;case"error":return this[Y]?void 0:(this[Y]=!0,super.emit(c,g));default:return super.emit(c,g)}}}class V extends N{[l](){let c=!0;try{this[S](null,s.openSync(this[f],"r")),c=!1}finally{c&&this[a]()}}[F](){let c=!0;try{if(!this[B]){this[B]=!0;do{const g=this[C](),L=g.length===0?0:s.readSync(this[o],g,0,g.length,null);if(!this[m](L,g))break}while(!0);this[B]=!1}c=!1}finally{c&&this[a]()}}[a](){if(this[i]&&typeof this[o]=="number"){const c=this[o];this[o]=null,s.closeSync(c),this.emit("close")}}}class W extends t{constructor(c,g){g=g||{},super(g),this.readable=!1,this.writable=!0,this[Y]=!1,this[U]=!1,this[e]=!1,this[b]=!1,this[D]=[],this[f]=c,this[o]=typeof g.fd=="number"?g.fd:null,this[_]=g.mode===void 0?438:g.mode,this[d]=typeof g.start=="number"?g.start:null,this[i]=typeof g.autoClose=="boolean"?g.autoClose:!0;const L=this[d]!==null?"r+":"w";this[G]=g.flags===void 0,this[E]=this[G]?L:g.flags,this[o]===null&&this[l]()}emit(c,g){if(c==="error"){if(this[Y])return;this[Y]=!0}return super.emit(c,g)}get fd(){return this[o]}get path(){return this[f]}[A](c){this[a](),this[U]=!0,this.emit("error",c)}[l](){s.open(this[f],this[E],this[_],(c,g)=>this[S](c,g))}[S](c,g){this[G]&&this[E]==="r+"&&c&&c.code==="ENOENT"?(this[E]="w",this[l]()):c?this[A](c):(this[o]=g,this.emit("open",g),this[y]())}end(c,g){return c&&this.write(c,g),this[e]=!0,!this[U]&&!this[D].length&&typeof this[o]=="number"&&this[n](null,0),this}write(c,g){return typeof c=="string"&&(c=Buffer.from(c,g)),this[e]?(this.emit("error",new Error("write() after end()")),!1):this[o]===null||this[U]||this[D].length?(this[D].push(c),this[b]=!0,!1):(this[U]=!0,this[P](c),!0)}[P](c){s.write(this[o],c,0,c.length,this[d],(g,L)=>this[n](g,L))}[n](c,g){c?this[A](c):(this[d]!==null&&(this[d]+=g),this[D].length?this[y]():(this[U]=!1,this[e]&&!this[h]?(this[h]=!0,this[a](),this.emit("finish")):this[b]&&(this[b]=!1,this.emit("drain"))))}[y](){if(this[D].length===0)this[e]&&this[n](null,0);else if(this[D].length===1)this[P](this[D].pop());else{const c=this[D];this[D]=[],r(this[o],c,this[d],(g,L)=>this[n](g,L))}}[a](){if(this[i]&&typeof this[o]=="number"){const c=this[o];this[o]=null,s.close(c,g=>g?this.emit("error",g):this.emit("close"))}}}class ee extends W{[l](){let c;if(this[G]&&this[E]==="r+")try{c=s.openSync(this[f],this[E],this[_])}catch(g){if(g.code==="ENOENT")return this[E]="w",this[l]();throw g}else c=s.openSync(this[f],this[E],this[_]);this[S](null,c)}[a](){if(this[i]&&typeof this[o]=="number"){const c=this[o];this[o]=null,s.closeSync(c),this.emit("close")}}[P](c){let g=!0;try{this[n](null,s.writeSync(this[o],c,0,c.length,this[d])),g=!1}finally{if(g)try{this[a]()}catch{}}}}return Re.ReadStream=N,Re.ReadStreamSync=V,Re.WriteStream=W,Re.WriteStreamSync=ee,Re}var si,qs;function ri(){if(qs)return si;qs=1;const u=Kt(),t=Me(),s=xe,r=Us(),i=1024*1024,a=jt(),e=qt(),o=_s(),{nextTick:h}=xi,E=Buffer.from([31,139]),y=Symbol("state"),m=Symbol("writeEntry"),C=Symbol("readEntry"),_=Symbol("nextEntry"),b=Symbol("processEntry"),A=Symbol("extendedHeader"),S=Symbol("globalExtendedHeader"),v=Symbol("meta"),n=Symbol("emitMeta"),l=Symbol("buffer"),f=Symbol("queue"),d=Symbol("ended"),D=Symbol("emittedEnd"),F=Symbol("emit"),R=Symbol("unzip"),B=Symbol("consumeChunk"),x=Symbol("consumeChunkSub"),M=Symbol("consumeBody"),P=Symbol("consumeMeta"),U=Symbol("consumeHeader"),G=Symbol("consuming"),Y=Symbol("bufferConcat"),N=Symbol("maybeEnd"),V=Symbol("writing"),W=Symbol("aborted"),ee=Symbol("onDone"),w=Symbol("sawValidEntry"),c=Symbol("sawNullBlock"),g=Symbol("sawEOF"),L=Symbol("closeStream"),j=J=>!0;return si=u(class extends s{constructor($){$=$||{},super($),this.file=$.file||"",this[w]=null,this.on(ee,z=>{(this[y]==="begin"||this[w]===!1)&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),$.ondone?this.on(ee,$.ondone):this.on(ee,z=>{this.emit("prefinish"),this.emit("finish"),this.emit("end")}),this.strict=!!$.strict,this.maxMetaEntrySize=$.maxMetaEntrySize||i,this.filter=typeof $.filter=="function"?$.filter:j;const q=$.file&&($.file.endsWith(".tar.br")||$.file.endsWith(".tbr"));this.brotli=!$.gzip&&$.brotli!==void 0?$.brotli:q?void 0:!1,this.writable=!0,this.readable=!1,this[f]=new r,this[l]=null,this[C]=null,this[m]=null,this[y]="begin",this[v]="",this[A]=null,this[S]=null,this[d]=!1,this[R]=null,this[W]=!1,this[c]=!1,this[g]=!1,this.on("end",()=>this[L]()),typeof $.onwarn=="function"&&this.on("warn",$.onwarn),typeof $.onentry=="function"&&this.on("entry",$.onentry)}[U]($,q){this[w]===null&&(this[w]=!1);let z;try{z=new t($,q,this[A],this[S])}catch(O){return this.warn("TAR_ENTRY_INVALID",O)}if(z.nullBlock)this[c]?(this[g]=!0,this[y]==="begin"&&(this[y]="header"),this[F]("eof")):(this[c]=!0,this[F]("nullBlock"));else if(this[c]=!1,!z.cksumValid)this.warn("TAR_ENTRY_INVALID","checksum failure",{header:z});else if(!z.path)this.warn("TAR_ENTRY_INVALID","path is required",{header:z});else{const O=z.type;if(/^(Symbolic)?Link$/.test(O)&&!z.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:z});else if(!/^(Symbolic)?Link$/.test(O)&&z.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:z});else{const T=this[m]=new a(z,this[A],this[S]);if(!this[w])if(T.remain){const K=()=>{T.invalid||(this[w]=!0)};T.on("end",K)}else this[w]=!0;T.meta?T.size>this.maxMetaEntrySize?(T.ignore=!0,this[F]("ignoredEntry",T),this[y]="ignore",T.resume()):T.size>0&&(this[v]="",T.on("data",K=>this[v]+=K),this[y]="meta"):(this[A]=null,T.ignore=T.ignore||!this.filter(T.path,T),T.ignore?(this[F]("ignoredEntry",T),this[y]=T.remain?"ignore":"header",T.resume()):(T.remain?this[y]="body":(this[y]="header",T.end()),this[C]?this[f].push(T):(this[f].push(T),this[_]())))}}}[L](){h(()=>this.emit("close"))}[b]($){let q=!0;return $?Array.isArray($)?this.emit.apply(this,$):(this[C]=$,this.emit("entry",$),$.emittedEnd||($.on("end",z=>this[_]()),q=!1)):(this[C]=null,q=!1),q}[_](){do;while(this[b](this[f].shift()));if(!this[f].length){const $=this[C];!$||$.flowing||$.size===$.remain?this[V]||this.emit("drain"):$.once("drain",z=>this.emit("drain"))}}[M]($,q){const z=this[m],O=z.blockRemain,T=O>=$.length&&q===0?$:$.slice(q,q+O);return z.write(T),z.blockRemain||(this[y]="header",this[m]=null,z.end()),T.length}[P]($,q){const z=this[m],O=this[M]($,q);return this[m]||this[n](z),O}[F]($,q,z){!this[f].length&&!this[C]?this.emit($,q,z):this[f].push([$,q,z])}[n]($){switch(this[F]("meta",this[v]),$.type){case"ExtendedHeader":case"OldExtendedHeader":this[A]=e.parse(this[v],this[A],!1);break;case"GlobalExtendedHeader":this[S]=e.parse(this[v],this[S],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":this[A]=this[A]||Object.create(null),this[A].path=this[v].replace(/\0.*/,"");break;case"NextFileHasLongLinkpath":this[A]=this[A]||Object.create(null),this[A].linkpath=this[v].replace(/\0.*/,"");break;default:throw new Error("unknown meta: "+$.type)}}abort($){this[W]=!0,this.emit("abort",$),this.warn("TAR_ABORT",$,{recoverable:!1})}write($){if(this[W])return;if((this[R]===null||this.brotli===void 0&&this[R]===!1)&&$){if(this[l]&&($=Buffer.concat([this[l],$]),this[l]=null),$.length<E.length)return this[l]=$,!0;for(let T=0;this[R]===null&&T<E.length;T++)$[T]!==E[T]&&(this[R]=!1);const O=this.brotli===void 0;if(this[R]===!1&&O)if($.length<512)if(this[d])this.brotli=!0;else return this[l]=$,!0;else try{new t($.slice(0,512)),this.brotli=!1}catch{this.brotli=!0}if(this[R]===null||this[R]===!1&&this.brotli){const T=this[d];this[d]=!1,this[R]=this[R]===null?new o.Unzip:new o.BrotliDecompress,this[R].on("data",oe=>this[B](oe)),this[R].on("error",oe=>this.abort(oe)),this[R].on("end",oe=>{this[d]=!0,this[B]()}),this[V]=!0;const K=this[R][T?"end":"write"]($);return this[V]=!1,K}}this[V]=!0,this[R]?this[R].write($):this[B]($),this[V]=!1;const z=this[f].length?!1:this[C]?this[C].flowing:!0;return!z&&!this[f].length&&this[C].once("drain",O=>this.emit("drain")),z}[Y]($){$&&!this[W]&&(this[l]=this[l]?Buffer.concat([this[l],$]):$)}[N](){if(this[d]&&!this[D]&&!this[W]&&!this[G]){this[D]=!0;const $=this[m];if($&&$.blockRemain){const q=this[l]?this[l].length:0;this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${$.blockRemain} more bytes, only ${q} available)`,{entry:$}),this[l]&&$.write(this[l]),$.end()}this[F](ee)}}[B]($){if(this[G])this[Y]($);else if(!$&&!this[l])this[N]();else{if(this[G]=!0,this[l]){this[Y]($);const q=this[l];this[l]=null,this[x](q)}else this[x]($);for(;this[l]&&this[l].length>=512&&!this[W]&&!this[g];){const q=this[l];this[l]=null,this[x](q)}this[G]=!1}(!this[l]||this[d])&&this[N]()}[x]($){let q=0;const z=$.length;for(;q+512<=z&&!this[W]&&!this[g];)switch(this[y]){case"begin":case"header":this[U]($,q),q+=512;break;case"ignore":case"body":q+=this[M]($,q);break;case"meta":q+=this[P]($,q);break;default:throw new Error("invalid state: "+this[y])}q<z&&(this[l]?this[l]=Buffer.concat([$.slice(q),this[l]]):this[l]=$.slice(q))}end($){this[W]||(this[R]?this[R].end($):(this[d]=!0,this.brotli===void 0&&($=$||Buffer.alloc(0)),this.write($)))}}),si}var ni,Vs;function ui(){if(Vs)return ni;Vs=1;const u=Ie(),t=ri(),s=ge,r=ke(),i=fe,a=Pe();ni=(m,C,_)=>{typeof m=="function"?(_=m,C=null,m={}):Array.isArray(m)&&(C=m,m={}),typeof C=="function"&&(_=C,C=null),C?C=Array.from(C):C=[];const b=u(m);if(b.sync&&typeof _=="function")throw new TypeError("callback not supported for sync tar functions");if(!b.file&&typeof _=="function")throw new TypeError("callback only supported with file option");return C.length&&o(b,C),b.noResume||e(b),b.file&&b.sync?h(b):b.file?E(b,_):y(b)};const e=m=>{const C=m.onentry;m.onentry=C?_=>{C(_),_.resume()}:_=>_.resume()},o=(m,C)=>{const _=new Map(C.map(S=>[a(S),!0])),b=m.filter,A=(S,v)=>{const n=v||i.parse(S).root||".",l=S===n?!1:_.has(S)?_.get(S):A(i.dirname(S),n);return _.set(S,l),l};m.filter=b?(S,v)=>b(S,v)&&A(a(S)):S=>A(a(S))},h=m=>{const C=y(m),_=m.file;let b=!0,A;try{const S=s.statSync(_),v=m.maxReadSize||16*1024*1024;if(S.size<v)C.end(s.readFileSync(_));else{let n=0;const l=Buffer.allocUnsafe(v);for(A=s.openSync(_,"r");n<S.size;){const f=s.readSync(A,l,0,v,n);n+=f,C.write(l.slice(0,f))}C.end()}b=!1}finally{if(b&&A)try{s.closeSync(A)}catch{}}},E=(m,C)=>{const _=new t(m),b=m.maxReadSize||16*1024*1024,A=m.file,S=new Promise((v,n)=>{_.on("error",n),_.on("end",v),s.stat(A,(l,f)=>{if(l)n(l);else{const d=new r.ReadStream(A,{readSize:b,size:f.size});d.on("error",n),d.pipe(_)}})});return C?S.then(C,C):S},y=m=>new t(m);return ni}var oi,Ws;function jn(){if(Ws)return oi;Ws=1;const u=Ie(),t=ii(),s=ke(),r=ui(),i=fe;oi=(m,C,_)=>{if(typeof C=="function"&&(_=C),Array.isArray(m)&&(C=m,m={}),!C||!Array.isArray(C)||!C.length)throw new TypeError("no files or directories specified");C=Array.from(C);const b=u(m);if(b.sync&&typeof _=="function")throw new TypeError("callback not supported for sync tar functions");if(!b.file&&typeof _=="function")throw new TypeError("callback only supported with file option");return b.file&&b.sync?a(b,C):b.file?e(b,C,_):b.sync?E(b,C):y(b,C)};const a=(m,C)=>{const _=new t.Sync(m),b=new s.WriteStreamSync(m.file,{mode:m.mode||438});_.pipe(b),o(_,C)},e=(m,C,_)=>{const b=new t(m),A=new s.WriteStream(m.file,{mode:m.mode||438});b.pipe(A);const S=new Promise((v,n)=>{A.on("error",n),A.on("close",v),b.on("error",n)});return h(b,C),_?S.then(_,_):S},o=(m,C)=>{C.forEach(_=>{_.charAt(0)==="@"?r({file:i.resolve(m.cwd,_.slice(1)),sync:!0,noResume:!0,onentry:b=>m.add(b)}):m.add(_)}),m.end()},h=(m,C)=>{for(;C.length;){const _=C.shift();if(_.charAt(0)==="@")return r({file:i.resolve(m.cwd,_.slice(1)),noResume:!0,onentry:b=>m.add(b)}).then(b=>h(m,C));m.add(_)}m.end()},E=(m,C)=>{const _=new t.Sync(m);return o(_,C),_},y=(m,C)=>{const _=new t(m);return h(_,C),_};return oi}var ai,Ks;function Ys(){if(Ks)return ai;Ks=1;const u=Ie(),t=ii(),s=ge,r=ke(),i=ui(),a=fe,e=Me();ai=(C,_,b)=>{const A=u(C);if(!A.file)throw new TypeError("file is required");if(A.gzip||A.brotli||A.file.endsWith(".br")||A.file.endsWith(".tbr"))throw new TypeError("cannot append to compressed archives");if(!_||!Array.isArray(_)||!_.length)throw new TypeError("no files or directories specified");return _=Array.from(_),A.sync?o(A,_):E(A,_,b)};const o=(C,_)=>{const b=new t.Sync(C);let A=!0,S,v;try{try{S=s.openSync(C.file,"r+")}catch(f){if(f.code==="ENOENT")S=s.openSync(C.file,"w+");else throw f}const n=s.fstatSync(S),l=Buffer.alloc(512);e:for(v=0;v<n.size;v+=512){for(let D=0,F=0;D<512;D+=F){if(F=s.readSync(S,l,D,l.length-D,v+D),v===0&&l[0]===31&&l[1]===139)throw new Error("cannot append to compressed archives");if(!F)break e}const f=new e(l);if(!f.cksumValid)break;const d=512*Math.ceil(f.size/512);if(v+d+512>n.size)break;v+=d,C.mtimeCache&&C.mtimeCache.set(f.path,f.mtime)}A=!1,h(C,b,v,S,_)}finally{if(A)try{s.closeSync(S)}catch{}}},h=(C,_,b,A,S)=>{const v=new r.WriteStreamSync(C.file,{fd:A,start:b});_.pipe(v),y(_,S)},E=(C,_,b)=>{_=Array.from(_);const A=new t(C),S=(n,l,f)=>{const d=(x,M)=>{x?s.close(n,P=>f(x)):f(null,M)};let D=0;if(l===0)return d(null,0);let F=0;const R=Buffer.alloc(512),B=(x,M)=>{if(x)return d(x);if(F+=M,F<512&&M)return s.read(n,R,F,R.length-F,D+F,B);if(D===0&&R[0]===31&&R[1]===139)return d(new Error("cannot append to compressed archives"));if(F<512)return d(null,D);const P=new e(R);if(!P.cksumValid)return d(null,D);const U=512*Math.ceil(P.size/512);if(D+U+512>l||(D+=U+512,D>=l))return d(null,D);C.mtimeCache&&C.mtimeCache.set(P.path,P.mtime),F=0,s.read(n,R,0,512,D,B)};s.read(n,R,0,512,D,B)},v=new Promise((n,l)=>{A.on("error",l);let f="r+";const d=(D,F)=>{if(D&&D.code==="ENOENT"&&f==="r+")return f="w+",s.open(C.file,f,d);if(D)return l(D);s.fstat(F,(R,B)=>{if(R)return s.close(F,()=>l(R));S(F,B.size,(x,M)=>{if(x)return l(x);const P=new r.WriteStream(C.file,{fd:F,start:M});A.pipe(P),P.on("error",l),P.on("close",n),m(A,_)})})};s.open(C.file,f,d)});return b?v.then(b,b):v},y=(C,_)=>{_.forEach(b=>{b.charAt(0)==="@"?i({file:a.resolve(C.cwd,b.slice(1)),sync:!0,noResume:!0,onentry:A=>C.add(A)}):C.add(b)}),C.end()},m=(C,_)=>{for(;_.length;){const b=_.shift();if(b.charAt(0)==="@")return i({file:a.resolve(C.cwd,b.slice(1)),noResume:!0,onentry:A=>C.add(A)}).then(A=>m(C,_));C.add(b)}C.end()};return ai}var hi,Zs;function Hn(){if(Zs)return hi;Zs=1;const u=Ie(),t=Ys();hi=(r,i,a)=>{const e=u(r);if(!e.file)throw new TypeError("file is required");if(e.gzip||e.brotli||e.file.endsWith(".br")||e.file.endsWith(".tbr"))throw new TypeError("cannot append to compressed archives");if(!i||!Array.isArray(i)||!i.length)throw new TypeError("no files or directories specified");return i=Array.from(i),s(e),t(e,i,a)};const s=r=>{const i=r.filter;r.mtimeCache||(r.mtimeCache=new Map),r.filter=i?(a,e)=>i(a,e)&&!(r.mtimeCache.get(a)>e.mtime):(a,e)=>!(r.mtimeCache.get(a)>e.mtime)};return hi}var st={exports:{}},li,Xs;function Un(){if(Xs)return li;Xs=1;const{promisify:u}=Rr,t=ge;return li=r=>{if(!r)r={mode:511,fs:t};else if(typeof r=="object")r={mode:511,fs:t,...r};else if(typeof r=="number")r={mode:r,fs:t};else if(typeof r=="string")r={mode:parseInt(r,8),fs:t};else throw new TypeError("invalid options argument");return r.mkdir=r.mkdir||r.fs.mkdir||t.mkdir,r.mkdirAsync=u(r.mkdir),r.stat=r.stat||r.fs.stat||t.stat,r.statAsync=u(r.stat),r.statSync=r.statSync||r.fs.statSync||t.statSync,r.mkdirSync=r.mkdirSync||r.fs.mkdirSync||t.mkdirSync,r},li}var ci,Js;function zn(){if(Js)return ci;Js=1;const u=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform,{resolve:t,parse:s}=fe;return ci=i=>{if(/\0/.test(i))throw Object.assign(new TypeError("path must be a string without null bytes"),{path:i,code:"ERR_INVALID_ARG_VALUE"});if(i=t(i),u==="win32"){const a=/[*|"<>?:]/,{root:e}=s(i);if(a.test(i.substr(e.length)))throw Object.assign(new Error("Illegal characters in path."),{path:i,code:"EINVAL"})}return i},ci}var Di,Qs;function Gn(){if(Qs)return Di;Qs=1;const{dirname:u}=fe,t=(r,i,a=void 0)=>a===i?Promise.resolve():r.statAsync(i).then(e=>e.isDirectory()?a:void 0,e=>e.code==="ENOENT"?t(r,u(i),i):void 0),s=(r,i,a=void 0)=>{if(a!==i)try{return r.statSync(i).isDirectory()?a:void 0}catch(e){return e.code==="ENOENT"?s(r,u(i),i):void 0}};return Di={findMade:t,findMadeSync:s},Di}var fi,er;function tr(){if(er)return fi;er=1;const{dirname:u}=fe,t=(r,i,a)=>{i.recursive=!1;const e=u(r);return e===r?i.mkdirAsync(r,i).catch(o=>{if(o.code!=="EISDIR")throw o}):i.mkdirAsync(r,i).then(()=>a||r,o=>{if(o.code==="ENOENT")return t(e,i).then(h=>t(r,i,h));if(o.code!=="EEXIST"&&o.code!=="EROFS")throw o;return i.statAsync(r).then(h=>{if(h.isDirectory())return a;throw o},()=>{throw o})})},s=(r,i,a)=>{const e=u(r);if(i.recursive=!1,e===r)try{return i.mkdirSync(r,i)}catch(o){if(o.code!=="EISDIR")throw o;return}try{return i.mkdirSync(r,i),a||r}catch(o){if(o.code==="ENOENT")return s(r,i,s(e,i,a));if(o.code!=="EEXIST"&&o.code!=="EROFS")throw o;try{if(!i.statSync(r).isDirectory())throw o}catch{throw o}}};return fi={mkdirpManual:t,mkdirpManualSync:s},fi}var di,ir;function qn(){if(ir)return di;ir=1;const{dirname:u}=fe,{findMade:t,findMadeSync:s}=Gn(),{mkdirpManual:r,mkdirpManualSync:i}=tr();return di={mkdirpNative:(o,h)=>(h.recursive=!0,u(o)===o?h.mkdirAsync(o,h):t(h,o).then(y=>h.mkdirAsync(o,h).then(()=>y).catch(m=>{if(m.code==="ENOENT")return r(o,h);throw m}))),mkdirpNativeSync:(o,h)=>{if(h.recursive=!0,u(o)===o)return h.mkdirSync(o,h);const y=s(h,o);try{return h.mkdirSync(o,h),y}catch(m){if(m.code==="ENOENT")return i(o,h);throw m}}},di}var mi,sr;function Vn(){if(sr)return mi;sr=1;const u=ge,s=(process.env.__TESTING_MKDIRP_NODE_VERSION__||process.version).replace(/^v/,"").split("."),r=+s[0]>10||+s[0]==10&&+s[1]>=12;return mi={useNative:r?e=>e.mkdir===u.mkdir:()=>!1,useNativeSync:r?e=>e.mkdirSync===u.mkdirSync:()=>!1},mi}var pi,rr;function Wn(){if(rr)return pi;rr=1;const u=Un(),t=zn(),{mkdirpNative:s,mkdirpNativeSync:r}=qn(),{mkdirpManual:i,mkdirpManualSync:a}=tr(),{useNative:e,useNativeSync:o}=Vn(),h=(y,m)=>(y=t(y),m=u(m),e(m)?s(y,m):i(y,m)),E=(y,m)=>(y=t(y),m=u(m),o(m)?r(y,m):a(y,m));return h.sync=E,h.native=(y,m)=>s(t(y),u(m)),h.manual=(y,m)=>i(t(y),u(m)),h.nativeSync=(y,m)=>r(t(y),u(m)),h.manualSync=(y,m)=>a(t(y),u(m)),pi=h,pi}var Ei,nr;function Kn(){if(nr)return Ei;nr=1;const u=ge,t=fe,s=u.lchown?"lchown":"chown",r=u.lchownSync?"lchownSync":"chownSync",i=u.lchown&&!process.version.match(/v1[1-9]+\./)&&!process.version.match(/v10\.[6-9]/),a=(v,n,l)=>{try{return u[r](v,n,l)}catch(f){if(f.code!=="ENOENT")throw f}},e=(v,n,l)=>{try{return u.chownSync(v,n,l)}catch(f){if(f.code!=="ENOENT")throw f}},o=i?(v,n,l,f)=>d=>{!d||d.code!=="EISDIR"?f(d):u.chown(v,n,l,f)}:(v,n,l,f)=>f,h=i?(v,n,l)=>{try{return a(v,n,l)}catch(f){if(f.code!=="EISDIR")throw f;e(v,n,l)}}:(v,n,l)=>a(v,n,l),E=process.version;let y=(v,n,l)=>u.readdir(v,n,l),m=(v,n)=>u.readdirSync(v,n);/^v4\./.test(E)&&(y=(v,n,l)=>u.readdir(v,l));const C=(v,n,l,f)=>{u[s](v,n,l,o(v,n,l,d=>{f(d&&d.code!=="ENOENT"?d:null)}))},_=(v,n,l,f,d)=>{if(typeof n=="string")return u.lstat(t.resolve(v,n),(D,F)=>{if(D)return d(D.code!=="ENOENT"?D:null);F.name=n,_(v,F,l,f,d)});if(n.isDirectory())b(t.resolve(v,n.name),l,f,D=>{if(D)return d(D);const F=t.resolve(v,n.name);C(F,l,f,d)});else{const D=t.resolve(v,n.name);C(D,l,f,d)}},b=(v,n,l,f)=>{y(v,{withFileTypes:!0},(d,D)=>{if(d){if(d.code==="ENOENT")return f();if(d.code!=="ENOTDIR"&&d.code!=="ENOTSUP")return f(d)}if(d||!D.length)return C(v,n,l,f);let F=D.length,R=null;const B=x=>{if(!R){if(x)return f(R=x);if(--F===0)return C(v,n,l,f)}};D.forEach(x=>_(v,x,n,l,B))})},A=(v,n,l,f)=>{if(typeof n=="string")try{const d=u.lstatSync(t.resolve(v,n));d.name=n,n=d}catch(d){if(d.code==="ENOENT")return;throw d}n.isDirectory()&&S(t.resolve(v,n.name),l,f),h(t.resolve(v,n.name),l,f)},S=(v,n,l)=>{let f;try{f=m(v,{withFileTypes:!0})}catch(d){if(d.code==="ENOENT")return;if(d.code==="ENOTDIR"||d.code==="ENOTSUP")return h(v,n,l);throw d}return f&&f.length&&f.forEach(d=>A(v,d,n,l)),h(v,n,l)};return Ei=b,b.sync=S,Ei}var ur;function Yn(){if(ur)return st.exports;ur=1;const u=Wn(),t=ge,s=fe,r=Kn(),i=Le();class a extends Error{constructor(b,A){super("Cannot extract through symbolic link"),this.path=A,this.symlink=b}get name(){return"SylinkError"}}class e extends Error{constructor(b,A){super(A+": Cannot cd into '"+b+"'"),this.path=b,this.code=A}get name(){return"CwdError"}}const o=(_,b)=>_.get(i(b)),h=(_,b,A)=>_.set(i(b),A),E=(_,b)=>{t.stat(_,(A,S)=>{(A||!S.isDirectory())&&(A=new e(_,A&&A.code||"ENOTDIR")),b(A)})};st.exports=(_,b,A)=>{_=i(_);const S=b.umask,v=b.mode|448,n=(v&S)!==0,l=b.uid,f=b.gid,d=typeof l=="number"&&typeof f=="number"&&(l!==b.processUid||f!==b.processGid),D=b.preserve,F=b.unlink,R=b.cache,B=i(b.cwd),x=(U,G)=>{U?A(U):(h(R,_,!0),G&&d?r(G,l,f,Y=>x(Y)):n?t.chmod(_,v,A):A())};if(R&&o(R,_)===!0)return x();if(_===B)return E(_,x);if(D)return u(_,{mode:v}).then(U=>x(null,U),x);const P=i(s.relative(B,_)).split("/");y(B,P,v,R,F,B,null,x)};const y=(_,b,A,S,v,n,l,f)=>{if(!b.length)return f(null,l);const d=b.shift(),D=i(s.resolve(_+"/"+d));if(o(S,D))return y(D,b,A,S,v,n,l,f);t.mkdir(D,A,m(D,b,A,S,v,n,l,f))},m=(_,b,A,S,v,n,l,f)=>d=>{d?t.lstat(_,(D,F)=>{if(D)D.path=D.path&&i(D.path),f(D);else if(F.isDirectory())y(_,b,A,S,v,n,l,f);else if(v)t.unlink(_,R=>{if(R)return f(R);t.mkdir(_,A,m(_,b,A,S,v,n,l,f))});else{if(F.isSymbolicLink())return f(new a(_,_+"/"+b.join("/")));f(d)}}):(l=l||_,y(_,b,A,S,v,n,l,f))},C=_=>{let b=!1,A="ENOTDIR";try{b=t.statSync(_).isDirectory()}catch(S){A=S.code}finally{if(!b)throw new e(_,A)}};return st.exports.sync=(_,b)=>{_=i(_);const A=b.umask,S=b.mode|448,v=(S&A)!==0,n=b.uid,l=b.gid,f=typeof n=="number"&&typeof l=="number"&&(n!==b.processUid||l!==b.processGid),d=b.preserve,D=b.unlink,F=b.cache,R=i(b.cwd),B=U=>{h(F,_,!0),U&&f&&r.sync(U,n,l),v&&t.chmodSync(_,S)};if(F&&o(F,_)===!0)return B();if(_===R)return C(R),B();if(d)return B(u.sync(_,S));const M=i(s.relative(R,_)).split("/");let P=null;for(let U=M.shift(),G=R;U&&(G+="/"+U);U=M.shift())if(G=i(s.resolve(G)),!o(F,G))try{t.mkdirSync(G,S),P=P||G,h(F,G,!0)}catch{const N=t.lstatSync(G);if(N.isDirectory()){h(F,G,!0);continue}else if(D){t.unlinkSync(G),t.mkdirSync(G,S),P=P||G,h(F,G,!0);continue}else if(N.isSymbolicLink())return new a(G,G+"/"+M.join("/"))}return B(P)},st.exports}var gi,or;function ar(){if(or)return gi;or=1;const u=Object.create(null),{hasOwnProperty:t}=Object.prototype;return gi=s=>(t.call(u,s)||(u[s]=s.normalize("NFD")),u[s]),gi}var Ci,hr;function Zn(){if(hr)return Ci;hr=1;const u=lt,t=ar(),s=Pe(),{join:r}=fe,a=(process.env.TESTING_TAR_FAKE_PLATFORM||process.platform)==="win32";return Ci=()=>{const e=new Map,o=new Map,h=A=>A.split("/").slice(0,-1).reduce((v,n)=>(v.length&&(n=r(v[v.length-1],n)),v.push(n||"/"),v),[]),E=new Set,y=A=>{const S=o.get(A);if(!S)throw new Error("function does not have any path reservations");return{paths:S.paths.map(v=>e.get(v)),dirs:[...S.dirs].map(v=>e.get(v))}},m=A=>{const{paths:S,dirs:v}=y(A);return S.every(n=>n[0]===A)&&v.every(n=>n[0]instanceof Set&&n[0].has(A))},C=A=>E.has(A)||!m(A)?!1:(E.add(A),A(()=>_(A)),!0),_=A=>{if(!E.has(A))return!1;const{paths:S,dirs:v}=o.get(A),n=new Set;return S.forEach(l=>{const f=e.get(l);u.equal(f[0],A),f.length===1?e.delete(l):(f.shift(),typeof f[0]=="function"?n.add(f[0]):f[0].forEach(d=>n.add(d)))}),v.forEach(l=>{const f=e.get(l);u(f[0]instanceof Set),f[0].size===1&&f.length===1?e.delete(l):f[0].size===1?(f.shift(),n.add(f[0])):f[0].delete(A)}),E.delete(A),n.forEach(l=>C(l)),!0};return{check:m,reserve:(A,S)=>{A=a?["win32 parallelization disabled"]:A.map(n=>s(r(t(n))).toLowerCase());const v=new Set(A.map(n=>h(n)).reduce((n,l)=>n.concat(l)));return o.set(S,{dirs:v,paths:A}),A.forEach(n=>{const l=e.get(n);l?l.push(S):e.set(n,[S])}),v.forEach(n=>{const l=e.get(n);l?l[l.length-1]instanceof Set?l[l.length-1].add(S):l.push(new Set([S])):e.set(n,[new Set([S])])}),C(S)}}},Ci}var Fi,lr;function Xn(){if(lr)return Fi;lr=1;const t=(process.env.__FAKE_PLATFORM__||process.platform)==="win32",s=ct.__FAKE_TESTING_FS__||ge,{O_CREAT:r,O_TRUNC:i,O_WRONLY:a,UV_FS_O_FILEMAP:e=0}=s.constants,o=t&&!!e,h=512*1024,E=e|i|r|a;return Fi=o?y=>y<h?E:"w":()=>"w",Fi}var yi,cr;function Dr(){if(cr)return yi;cr=1;const u=lt,t=ri(),s=ge,r=ke(),i=fe,a=Yn(),e=Ns(),o=Zn(),h=Ls(),E=Le(),y=Pe(),m=ar(),C=Symbol("onEntry"),_=Symbol("checkFs"),b=Symbol("checkFs2"),A=Symbol("pruneCache"),S=Symbol("isReusable"),v=Symbol("makeFs"),n=Symbol("file"),l=Symbol("directory"),f=Symbol("link"),d=Symbol("symlink"),D=Symbol("hardlink"),F=Symbol("unsupported"),R=Symbol("checkPath"),B=Symbol("mkdir"),x=Symbol("onError"),M=Symbol("pending"),P=Symbol("pend"),U=Symbol("unpend"),G=Symbol("ended"),Y=Symbol("maybeClose"),N=Symbol("skip"),V=Symbol("doChown"),W=Symbol("uid"),ee=Symbol("gid"),w=Symbol("checkedCwd"),c=Br,g=Xn(),j=(process.env.TESTING_TAR_FAKE_PLATFORM||process.platform)==="win32",J=1024,$=(te,p)=>{if(!j)return s.unlink(te,p);const k=te+".DELETE."+c.randomBytes(16).toString("hex");s.rename(te,k,H=>{if(H)return p(H);s.unlink(k,p)})},q=te=>{if(!j)return s.unlinkSync(te);const p=te+".DELETE."+c.randomBytes(16).toString("hex");s.renameSync(te,p),s.unlinkSync(p)},z=(te,p,k)=>te===te>>>0?te:p===p>>>0?p:k,O=te=>y(E(m(te))).toLowerCase(),T=(te,p)=>{p=O(p);for(const k of te.keys()){const H=O(k);(H===p||H.indexOf(p+"/")===0)&&te.delete(k)}},K=te=>{for(const p of te.keys())te.delete(p)};class oe extends t{constructor(p){if(p||(p={}),p.ondone=k=>{this[G]=!0,this[Y]()},super(p),this[w]=!1,this.reservations=o(),this.transform=typeof p.transform=="function"?p.transform:null,this.writable=!0,this.readable=!1,this[M]=0,this[G]=!1,this.dirCache=p.dirCache||new Map,typeof p.uid=="number"||typeof p.gid=="number"){if(typeof p.uid!="number"||typeof p.gid!="number")throw new TypeError("cannot set owner without number uid and gid");if(p.preserveOwner)throw new TypeError("cannot preserve owner in archive and also set owner explicitly");this.uid=p.uid,this.gid=p.gid,this.setOwner=!0}else this.uid=null,this.gid=null,this.setOwner=!1;p.preserveOwner===void 0&&typeof p.uid!="number"?this.preserveOwner=process.getuid&&process.getuid()===0:this.preserveOwner=!!p.preserveOwner,this.processUid=(this.preserveOwner||this.setOwner)&&process.getuid?process.getuid():null,this.processGid=(this.preserveOwner||this.setOwner)&&process.getgid?process.getgid():null,this.maxDepth=typeof p.maxDepth=="number"?p.maxDepth:J,this.forceChown=p.forceChown===!0,this.win32=!!p.win32||j,this.newer=!!p.newer,this.keep=!!p.keep,this.noMtime=!!p.noMtime,this.preservePaths=!!p.preservePaths,this.unlink=!!p.unlink,this.cwd=E(i.resolve(p.cwd||process.cwd())),this.strip=+p.strip||0,this.processUmask=p.noChmod?0:process.umask(),this.umask=typeof p.umask=="number"?p.umask:this.processUmask,this.dmode=p.dmode||511&~this.umask,this.fmode=p.fmode||438&~this.umask,this.on("entry",k=>this[C](k))}warn(p,k,H={}){return(p==="TAR_BAD_ARCHIVE"||p==="TAR_ABORT")&&(H.recoverable=!1),super.warn(p,k,H)}[Y](){this[G]&&this[M]===0&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"))}[R](p){const k=E(p.path),H=k.split("/");if(this.strip){if(H.length<this.strip)return!1;if(p.type==="Link"){const Z=E(p.linkpath).split("/");if(Z.length>=this.strip)p.linkpath=Z.slice(this.strip).join("/");else return!1}H.splice(0,this.strip),p.path=H.join("/")}if(isFinite(this.maxDepth)&&H.length>this.maxDepth)return this.warn("TAR_ENTRY_ERROR","path excessively deep",{entry:p,path:k,depth:H.length,maxDepth:this.maxDepth}),!1;if(!this.preservePaths){if(H.includes("..")||j&&/^[a-z]:\.\.$/i.test(H[0]))return this.warn("TAR_ENTRY_ERROR","path contains '..'",{entry:p,path:k}),!1;const[Z,X]=h(k);Z&&(p.path=X,this.warn("TAR_ENTRY_INFO",`stripping ${Z} from absolute path`,{entry:p,path:k}))}if(i.isAbsolute(p.path)?p.absolute=E(i.resolve(p.path)):p.absolute=E(i.resolve(this.cwd,p.path)),!this.preservePaths&&p.absolute.indexOf(this.cwd+"/")!==0&&p.absolute!==this.cwd)return this.warn("TAR_ENTRY_ERROR","path escaped extraction target",{entry:p,path:E(p.path),resolvedPath:p.absolute,cwd:this.cwd}),!1;if(p.absolute===this.cwd&&p.type!=="Directory"&&p.type!=="GNUDumpDir")return!1;if(this.win32){const{root:Z}=i.win32.parse(p.absolute);p.absolute=Z+e.encode(p.absolute.slice(Z.length));const{root:X}=i.win32.parse(p.path);p.path=X+e.encode(p.path.slice(X.length))}return!0}[C](p){if(!this[R](p))return p.resume();switch(u.equal(typeof p.absolute,"string"),p.type){case"Directory":case"GNUDumpDir":p.mode&&(p.mode=p.mode|448);case"File":case"OldFile":case"ContiguousFile":case"Link":case"SymbolicLink":return this[_](p);case"CharacterDevice":case"BlockDevice":case"FIFO":default:return this[F](p)}}[x](p,k){p.name==="CwdError"?this.emit("error",p):(this.warn("TAR_ENTRY_ERROR",p,{entry:k}),this[U](),k.resume())}[B](p,k,H){a(E(p),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:k,noChmod:this.noChmod},H)}[V](p){return this.forceChown||this.preserveOwner&&(typeof p.uid=="number"&&p.uid!==this.processUid||typeof p.gid=="number"&&p.gid!==this.processGid)||typeof this.uid=="number"&&this.uid!==this.processUid||typeof this.gid=="number"&&this.gid!==this.processGid}[W](p){return z(this.uid,p.uid,this.processUid)}[ee](p){return z(this.gid,p.gid,this.processGid)}[n](p,k){const H=p.mode&4095||this.fmode,Z=new r.WriteStream(p.absolute,{flags:g(p.size),mode:H,autoClose:!1});Z.on("error",se=>{Z.fd&&s.close(Z.fd,()=>{}),Z.write=()=>!0,this[x](se,p),k()});let X=1;const ue=se=>{if(se){Z.fd&&s.close(Z.fd,()=>{}),this[x](se,p),k();return}--X===0&&s.close(Z.fd,le=>{le?this[x](le,p):this[U](),k()})};Z.on("finish",se=>{const le=p.absolute,Fe=Z.fd;if(p.mtime&&!this.noMtime){X++;const ye=p.atime||new Date,Ae=p.mtime;s.futimes(Fe,ye,Ae,Be=>Be?s.utimes(le,ye,Ae,ut=>ue(ut&&Be)):ue())}if(this[V](p)){X++;const ye=this[W](p),Ae=this[ee](p);s.fchown(Fe,ye,Ae,Be=>Be?s.chown(le,ye,Ae,ut=>ue(ut&&Be)):ue())}ue()});const ie=this.transform&&this.transform(p)||p;ie!==p&&(ie.on("error",se=>{this[x](se,p),k()}),p.pipe(ie)),ie.pipe(Z)}[l](p,k){const H=p.mode&4095||this.dmode;this[B](p.absolute,H,Z=>{if(Z){this[x](Z,p),k();return}let X=1;const ue=ie=>{--X===0&&(k(),this[U](),p.resume())};p.mtime&&!this.noMtime&&(X++,s.utimes(p.absolute,p.atime||new Date,p.mtime,ue)),this[V](p)&&(X++,s.chown(p.absolute,this[W](p),this[ee](p),ue)),ue()})}[F](p){p.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${p.type}`,{entry:p}),p.resume()}[d](p,k){this[f](p,p.linkpath,"symlink",k)}[D](p,k){const H=E(i.resolve(this.cwd,p.linkpath));this[f](p,H,"link",k)}[P](){this[M]++}[U](){this[M]--,this[Y]()}[N](p){this[U](),p.resume()}[S](p,k){return p.type==="File"&&!this.unlink&&k.isFile()&&k.nlink<=1&&!j}[_](p){this[P]();const k=[p.path];p.linkpath&&k.push(p.linkpath),this.reservations.reserve(k,H=>this[b](p,H))}[A](p){p.type==="SymbolicLink"?K(this.dirCache):p.type!=="Directory"&&T(this.dirCache,p.absolute)}[b](p,k){this[A](p);const H=ie=>{this[A](p),k(ie)},Z=()=>{this[B](this.cwd,this.dmode,ie=>{if(ie){this[x](ie,p),H();return}this[w]=!0,X()})},X=()=>{if(p.absolute!==this.cwd){const ie=E(i.dirname(p.absolute));if(ie!==this.cwd)return this[B](ie,this.dmode,se=>{if(se){this[x](se,p),H();return}ue()})}ue()},ue=()=>{s.lstat(p.absolute,(ie,se)=>{if(se&&(this.keep||this.newer&&se.mtime>p.mtime)){this[N](p),H();return}if(ie||this[S](p,se))return this[v](null,p,H);if(se.isDirectory()){if(p.type==="Directory"){const le=!this.noChmod&&p.mode&&(se.mode&4095)!==p.mode,Fe=ye=>this[v](ye,p,H);return le?s.chmod(p.absolute,p.mode,Fe):Fe()}if(p.absolute!==this.cwd)return s.rmdir(p.absolute,le=>this[v](le,p,H))}if(p.absolute===this.cwd)return this[v](null,p,H);$(p.absolute,le=>this[v](le,p,H))})};this[w]?X():Z()}[v](p,k,H){if(p){this[x](p,k),H();return}switch(k.type){case"File":case"OldFile":case"ContiguousFile":return this[n](k,H);case"Link":return this[D](k,H);case"SymbolicLink":return this[d](k,H);case"Directory":case"GNUDumpDir":return this[l](k,H)}}[f](p,k,H,Z){s[H](k,p.absolute,X=>{X?this[x](X,p):(this[U](),p.resume()),Z()})}}const De=te=>{try{return[null,te()]}catch(p){return[p,null]}};class Ge extends oe{[v](p,k){return super[v](p,k,()=>{})}[_](p){if(this[A](p),!this[w]){const X=this[B](this.cwd,this.dmode);if(X)return this[x](X,p);this[w]=!0}if(p.absolute!==this.cwd){const X=E(i.dirname(p.absolute));if(X!==this.cwd){const ue=this[B](X,this.dmode);if(ue)return this[x](ue,p)}}const[k,H]=De(()=>s.lstatSync(p.absolute));if(H&&(this.keep||this.newer&&H.mtime>p.mtime))return this[N](p);if(k||this[S](p,H))return this[v](null,p);if(H.isDirectory()){if(p.type==="Directory"){const ue=!this.noChmod&&p.mode&&(H.mode&4095)!==p.mode,[ie]=ue?De(()=>{s.chmodSync(p.absolute,p.mode)}):[];return this[v](ie,p)}const[X]=De(()=>s.rmdirSync(p.absolute));this[v](X,p)}const[Z]=p.absolute===this.cwd?[]:De(()=>q(p.absolute));this[v](Z,p)}[n](p,k){const H=p.mode&4095||this.fmode,Z=ie=>{let se;try{s.closeSync(X)}catch(le){se=le}(ie||se)&&this[x](ie||se,p),k()};let X;try{X=s.openSync(p.absolute,g(p.size),H)}catch(ie){return Z(ie)}const ue=this.transform&&this.transform(p)||p;ue!==p&&(ue.on("error",ie=>this[x](ie,p)),p.pipe(ue)),ue.on("data",ie=>{try{s.writeSync(X,ie,0,ie.length)}catch(se){Z(se)}}),ue.on("end",ie=>{let se=null;if(p.mtime&&!this.noMtime){const le=p.atime||new Date,Fe=p.mtime;try{s.futimesSync(X,le,Fe)}catch(ye){try{s.utimesSync(p.absolute,le,Fe)}catch{se=ye}}}if(this[V](p)){const le=this[W](p),Fe=this[ee](p);try{s.fchownSync(X,le,Fe)}catch(ye){try{s.chownSync(p.absolute,le,Fe)}catch{se=se||ye}}}Z(se)})}[l](p,k){const H=p.mode&4095||this.dmode,Z=this[B](p.absolute,H);if(Z){this[x](Z,p),k();return}if(p.mtime&&!this.noMtime)try{s.utimesSync(p.absolute,p.atime||new Date,p.mtime)}catch{}if(this[V](p))try{s.chownSync(p.absolute,this[W](p),this[ee](p))}catch{}k(),p.resume()}[B](p,k){try{return a.sync(E(p),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:k})}catch(H){return H}}[f](p,k,H,Z){try{s[H+"Sync"](k,p.absolute),Z(),p.resume()}catch(X){return this[x](X,p)}}}return oe.Sync=Ge,yi=oe,yi}var bi,fr;function Jn(){if(fr)return bi;fr=1;const u=Ie(),t=Dr(),s=ge,r=ke(),i=fe,a=Pe();bi=(m,C,_)=>{typeof m=="function"?(_=m,C=null,m={}):Array.isArray(m)&&(C=m,m={}),typeof C=="function"&&(_=C,C=null),C?C=Array.from(C):C=[];const b=u(m);if(b.sync&&typeof _=="function")throw new TypeError("callback not supported for sync tar functions");if(!b.file&&typeof _=="function")throw new TypeError("callback only supported with file option");return C.length&&e(b,C),b.file&&b.sync?o(b):b.file?h(b,_):b.sync?E(b):y(b)};const e=(m,C)=>{const _=new Map(C.map(S=>[a(S),!0])),b=m.filter,A=(S,v)=>{const n=v||i.parse(S).root||".",l=S===n?!1:_.has(S)?_.get(S):A(i.dirname(S),n);return _.set(S,l),l};m.filter=b?(S,v)=>b(S,v)&&A(a(S)):S=>A(a(S))},o=m=>{const C=new t.Sync(m),_=m.file,b=s.statSync(_),A=m.maxReadSize||16*1024*1024;new r.ReadStreamSync(_,{readSize:A,size:b.size}).pipe(C)},h=(m,C)=>{const _=new t(m),b=m.maxReadSize||16*1024*1024,A=m.file,S=new Promise((v,n)=>{_.on("error",n),_.on("close",v),s.stat(A,(l,f)=>{if(l)n(l);else{const d=new r.ReadStream(A,{readSize:b,size:f.size});d.on("error",n),d.pipe(_)}})});return C?S.then(C,C):S},E=m=>new t.Sync(m),y=m=>new t(m);return bi}var dr;function Qn(){return dr||(dr=1,he.c=he.create=jn(),he.r=he.replace=Ys(),he.t=he.list=ui(),he.u=he.update=Hn(),he.x=he.extract=Jn(),he.Pack=ii(),he.Unpack=Dr(),he.Parse=ri(),he.ReadEntry=jt(),he.WriteEntry=ks(),he.Header=Me(),he.Pax=qt(),he.types=Ss()),he}var eu=Qn();class tu extends Error{}class mr extends Error{}class iu extends Error{}class su extends Error{}const pr=async(u,t)=>{const s=new URL(u),r=we.basename(s.pathname);return{name:r,version:void 0,subdir:void 0,url:s.href,tar:s.href,defaultDir:r,headers:t.auth?{Authorization:`Bearer ${t.auth}`}:void 0}},Er=async(u,t)=>{const s=rt(u),r=await _i(s,t,async()=>(await(await je(`https://api.github.com/repos/${s.repo}`)).json())?.default_branch);return{name:s.repo.replace("/","-"),version:r,subdir:s.subdir,headers:{...t.auth?{Authorization:`Bearer ${t.auth}`}:{},Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"},url:`https://github.com/${s.repo}/tree/${r}${s.subdir}`,tar:`https://api.github.com/repos/${s.repo}/tarball/${r}`}},ru=async(u,t)=>{const s=rt(u),r=await _i(s,t,async()=>(await(await je(`https://gitlab.com/api/v4/projects/${encodeURIComponent(s.repo)}`)).json())?.default_branch);return{name:s.repo.replace("/","-"),version:r,subdir:s.subdir,headers:{...t.auth?{Authorization:`Bearer ${t.auth}`}:{},"sec-fetch-mode":"same-origin"},url:`https://gitlab.com/${s.repo}/tree/${r}${s.subdir}`,tar:`https://gitlab.com/${s.repo}/-/archive/${r}.tar.gz`}},nu=async(u,t)=>{const s=rt(u),r=await _i(s,t,async()=>(await(await je(`https://api.bitbucket.org/2.0/repositories/${s.repo}`)).json())?.mainbranch?.name);return{name:s.repo.replace("/","-"),version:r,subdir:s.subdir,headers:t.auth?{Authorization:`Bearer ${t.auth}`}:{},url:`https://bitbucket.com/${s.repo}/src/${r}${s.subdir}`,tar:`https://bitbucket.org/${s.repo}/get/${r}.tar.gz`}},uu=(u,t)=>{const s=rt(u),r=s.ref||"main";return{name:s.repo.replace("/","-"),version:r,subdir:s.subdir,headers:t.auth?{Authorization:`Bearer ${t.auth}`}:{},url:`https://git.sr.ht/~${s.repo}/tree/${r}/item${s.subdir}`,tar:`https://git.sr.ht/~${s.repo}/archive/${r}.tar.gz`}},ou={http:pr,https:pr,github:Er,gh:Er,gitlab:ru,bitbucket:nu,sourcehut:uu};async function _i(u,t,s){if(u.ref)return u.ref;if(t.offline!==!0)try{const r=await s();if(r)return r}catch(r){wi(`Failed to fetch ref for ${u.repo}`,r)}return"main"}const au=/^([\w-.]+):/;function hu(u,t,s){t||="github";let r=u;const i=u.match(au);i&&(t=i[1],t!=="http"&&t!=="https"&&(r=u.slice(i[0].length)));const a=s?.[t]||ou[t];return{source:r,providerName:t,provider:a}}async function lu(u,t,s={}){const r=t+".json",i=JSON.parse(await Oe.readFile(r,"utf8").catch(()=>"{}")),e=(await je(u,{...s,method:"HEAD"}).catch(()=>{}))?.headers.get("etag");if(i.etag===e&&Se.existsSync(t))return;typeof e=="string"&&(i.etag=e);const o=await je(u,{headers:s.headers});if(o.status>=400)throw new mr(`Failed to download ${u}: ${o.status} ${o.statusText}`);if(o.body==null)throw new mr(`Failed to download ${u}: empty response body`);await Oe.mkdir(we.dirname(t),{recursive:!0});const h=Se.createWriteStream(t);await Ri(Sr)(o.body,h),await Oe.writeFile(r,JSON.stringify(i),"utf8")}const cu=/^(?<repo>[\w\-.]+\/[\w\-.]+)(?<subdir>[^#]+)?(?<ref>#[\w\-./@]+)?/;function rt(u){const t=u.match(cu)?.groups||{};return{repo:t.repo,subdir:t.subdir||"/",ref:t.ref?.slice(1)}}function wi(...u){process.env.DEBUG&&console.debug("[giget]",...u)}async function je(u,t={}){t.headers?.["sec-fetch-mode"]&&(t.mode=t.headers["sec-fetch-mode"]);const s=await fetch(u,t).catch(r=>{throw new Error(`Failed to fetch ${u}`,{cause:r})});if(t.validateStatus&&s.status>=400)throw new Error(`Failed to fetch ${u}: ${s.status} ${s.statusText}`);return s}function Du(){return process.env.XDG_CACHE_HOME?we.resolve(process.env.XDG_CACHE_HOME,"bluwy-giget"):we.resolve(Ar.homedir(),".cache/bluwy-giget")}async function fu(u,t,s){s==="/"&&(s=void 0),s&&(s.startsWith("/")&&(s=s.slice(1)),s.endsWith("/")||(s+="/"));let r=!1;if(await Oe.mkdir(t,{recursive:!0}),await eu.extract({file:u,cwd:t,onentry(i){i.path=i.path.split("/").splice(1).join("/"),s&&(i.path.startsWith(s)?(i.path=i.path.slice(s.length-1),r=!0):i.path="")}}),s&&!r)throw await Oe.rm(t,{recursive:!0,force:!0}),new iu(`Subdirectory not found in tar: ${s}`)}async function du(u,t={}){const{source:s,providerName:r,provider:i}=hu(u,t.provider,t.providers);if(!i)throw new tu(`Unsupported provider: ${r}`);const a={...t.providerOptions,offline:t.offline},e=await Promise.resolve().then(()=>i(s,a)).catch(m=>{throw new Error(`The ${r} provider failed with errors`,{cause:m})});e.name=(e.name||"template").replace(/[^\da-z-]/gi,"-"),e.defaultDir=(e.defaultDir||e.name).replace(/[^\da-z-]/gi,"-");const o=we.resolve(Du(),r,e.name),h=we.resolve(o,(e.version||e.name)+".tar.gz");if((t.offline==="prefer"?!Se.existsSync(h):!t.offline)&&(await lu(e.tar,h,{headers:e.headers}).catch(m=>{if(!Se.existsSync(h))throw m;wi("Download error. Using cached version:",m)}),wi(`Downloaded ${e.tar} to ${h}`)),!Se.existsSync(h))throw new Error(`Tarball not found: ${h} (offline: ${t.offline})`);const E=we.resolve(t.cwd||"."),y=we.resolve(E,t.dir||e.defaultDir);if(t.force==="clean")await Oe.rm(y,{recursive:!0,force:!0});else if(!t.force&&Se.existsSync(y)&&Se.readdirSync(y).length>0)throw new su(`Destination ${y} already exists.`);return await fu(h,y,e.subdir),{info:e,source:s,dir:y}}async function He({template:u,project:t}){await du(`wrtnlabs/agentica.template.${u}`,{provider:"github",dir:t}),await _r(be(t,".github"),{force:!0,recursive:!0})}async function Ue({projectPath:u,dotEnvfileName:t,apiKeys:s}){if(!ot(u))throw new Error(`${u} directory does not exist.`);const r=be(u,t??".env"),i=(ot(r)?`
88
+ `).reduce(a,Object.create(null)),a=(e,o)=>{const h=parseInt(o,10);if(h!==Buffer.byteLength(o)+1)return e;o=o.slice((h+" ").length);const E=o.split("="),y=E.shift().replace(/^SCHILY\.(dev|ino|nlink)/,"$1");if(!y)return e;const m=E.join("=");return e[y]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(y)?new Date(m*1e3):/^[0-9]+$/.test(m)?+m:m,e};return Gt=s,Gt}var Vt,xs;function Pe(){return xs||(xs=1,Vt=u=>{let t=u.length-1,s=-1;for(;t>-1&&u.charAt(t)==="/";)s=t,t--;return s===-1?u:u.slice(0,s)}),Vt}var Wt,Ts;function Kt(){return Ts||(Ts=1,Wt=u=>class extends u{warn(t,s,r={}){this.file&&(r.file=this.file),this.cwd&&(r.cwd=this.cwd),r.code=s instanceof Error&&s.code||t,r.tarCode=t,!this.strict&&r.recoverable!==!1?(s instanceof Error&&(r=Object.assign(s,r),s=s.message),this.emit("warn",r.tarCode,s,r)):s instanceof Error?this.emit("error",Object.assign(s,r)):this.emit("error",Object.assign(new Error(`${t}: ${s}`),r))}}),Wt}var Yt,$s;function Ns(){if($s)return Yt;$s=1;const u=["|","<",">","?",":"],t=u.map(i=>String.fromCharCode(61440+i.charCodeAt(0))),s=new Map(u.map((i,a)=>[i,t[a]])),r=new Map(t.map((i,a)=>[i,u[a]]));return Yt={encode:i=>u.reduce((a,e)=>a.split(e).join(s.get(e)),i),decode:i=>t.reduce((a,e)=>a.split(e).join(r.get(e)),i)},Yt}var Zt,Is;function Ls(){if(Is)return Zt;Is=1;const{isAbsolute:u,parse:t}=De.win32;return Zt=s=>{let r="",i=t(s);for(;u(s)||i.root;){const a=s.charAt(0)==="/"&&s.slice(0,4)!=="//?/"?"/":i.root;s=s.slice(a.length),r+=a,i=t(s)}return[r,s]},Zt}var Xt,Ms;function kn(){return Ms||(Ms=1,Xt=(u,t,s)=>(u&=4095,s&&(u=(u|384)&-19),t&&(u&256&&(u|=64),u&32&&(u|=8),u&4&&(u|=1)),u)),Xt}var Jt,Ps;function ks(){if(Ps)return Jt;Ps=1;const{Minipass:u}=It(),t=qt(),s=Me(),r=ge,i=De,a=Le(),e=Pe(),o=(w,c)=>c?(w=a(w).replace(/^\.(\/|$)/,""),e(c)+"/"+w):a(w),h=16*1024*1024,E=Symbol("process"),y=Symbol("file"),m=Symbol("directory"),C=Symbol("symlink"),_=Symbol("hardlink"),b=Symbol("header"),A=Symbol("read"),S=Symbol("lstat"),v=Symbol("onlstat"),n=Symbol("onread"),l=Symbol("onreadlink"),f=Symbol("openfile"),d=Symbol("onopenfile"),D=Symbol("close"),F=Symbol("mode"),R=Symbol("awaitDrain"),B=Symbol("ondrain"),x=Symbol("prefix"),M=Symbol("hadError"),P=Kt(),U=Ns(),G=Ls(),Y=kn(),N=P(class extends u{constructor(c,g){if(g=g||{},super(g),typeof c!="string")throw new TypeError("path is required");this.path=a(c),this.portable=!!g.portable,this.myuid=process.getuid&&process.getuid()||0,this.myuser=process.env.USER||"",this.maxReadSize=g.maxReadSize||h,this.linkCache=g.linkCache||new Map,this.statCache=g.statCache||new Map,this.preservePaths=!!g.preservePaths,this.cwd=a(g.cwd||process.cwd()),this.strict=!!g.strict,this.noPax=!!g.noPax,this.noMtime=!!g.noMtime,this.mtime=g.mtime||null,this.prefix=g.prefix?a(g.prefix):null,this.fd=null,this.blockLen=null,this.blockRemain=null,this.buf=null,this.offset=null,this.length=null,this.pos=null,this.remain=null,typeof g.onwarn=="function"&&this.on("warn",g.onwarn);let L=!1;if(!this.preservePaths){const[H,J]=G(this.path);H&&(this.path=J,L=H)}this.win32=!!g.win32||process.platform==="win32",this.win32&&(this.path=U.decode(this.path.replace(/\\/g,"/")),c=c.replace(/\\/g,"/")),this.absolute=a(g.absolute||i.resolve(this.cwd,c)),this.path===""&&(this.path="./"),L&&this.warn("TAR_ENTRY_INFO",`stripping ${L} from absolute path`,{entry:this,path:L+this.path}),this.statCache.has(this.absolute)?this[v](this.statCache.get(this.absolute)):this[S]()}emit(c,...g){return c==="error"&&(this[M]=!0),super.emit(c,...g)}[S](){r.lstat(this.absolute,(c,g)=>{if(c)return this.emit("error",c);this[v](g)})}[v](c){this.statCache.set(this.absolute,c),this.stat=c,c.isFile()||(c.size=0),this.type=ee(c),this.emit("stat",c),this[E]()}[E](){switch(this.type){case"File":return this[y]();case"Directory":return this[m]();case"SymbolicLink":return this[C]();default:return this.end()}}[F](c){return Y(c,this.type==="Directory",this.portable)}[x](c){return o(c,this.prefix)}[b](){this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.header=new s({path:this[x](this.path),linkpath:this.type==="Link"?this[x](this.linkpath):this.linkpath,mode:this[F](this.stat.mode),uid:this.portable?null:this.stat.uid,gid:this.portable?null:this.stat.gid,size:this.stat.size,mtime:this.noMtime?null:this.mtime||this.stat.mtime,type:this.type,uname:this.portable?null:this.stat.uid===this.myuid?this.myuser:"",atime:this.portable?null:this.stat.atime,ctime:this.portable?null:this.stat.ctime}),this.header.encode()&&!this.noPax&&super.write(new t({atime:this.portable?null:this.header.atime,ctime:this.portable?null:this.header.ctime,gid:this.portable?null:this.header.gid,mtime:this.noMtime?null:this.mtime||this.header.mtime,path:this[x](this.path),linkpath:this.type==="Link"?this[x](this.linkpath):this.linkpath,size:this.header.size,uid:this.portable?null:this.header.uid,uname:this.portable?null:this.header.uname,dev:this.portable?null:this.stat.dev,ino:this.portable?null:this.stat.ino,nlink:this.portable?null:this.stat.nlink}).encode()),super.write(this.header.block)}[m](){this.path.slice(-1)!=="/"&&(this.path+="/"),this.stat.size=0,this[b](),this.end()}[C](){r.readlink(this.absolute,(c,g)=>{if(c)return this.emit("error",c);this[l](g)})}[l](c){this.linkpath=a(c),this[b](),this.end()}[_](c){this.type="Link",this.linkpath=a(i.relative(this.cwd,c)),this.stat.size=0,this[b](),this.end()}[y](){if(this.stat.nlink>1){const c=this.stat.dev+":"+this.stat.ino;if(this.linkCache.has(c)){const g=this.linkCache.get(c);if(g.indexOf(this.cwd)===0)return this[_](g)}this.linkCache.set(c,this.absolute)}if(this[b](),this.stat.size===0)return this.end();this[f]()}[f](){r.open(this.absolute,"r",(c,g)=>{if(c)return this.emit("error",c);this[d](g)})}[d](c){if(this.fd=c,this[M])return this[D]();this.blockLen=512*Math.ceil(this.stat.size/512),this.blockRemain=this.blockLen;const g=Math.min(this.blockLen,this.maxReadSize);this.buf=Buffer.allocUnsafe(g),this.offset=0,this.pos=0,this.remain=this.stat.size,this.length=this.buf.length,this[A]()}[A](){const{fd:c,buf:g,offset:L,length:H,pos:J}=this;r.read(c,g,L,H,J,($,q)=>{if($)return this[D](()=>this.emit("error",$));this[n](q)})}[D](c){r.close(this.fd,c)}[n](c){if(c<=0&&this.remain>0){const H=new Error("encountered unexpected EOF");return H.path=this.absolute,H.syscall="read",H.code="EOF",this[D](()=>this.emit("error",H))}if(c>this.remain){const H=new Error("did not encounter expected EOF");return H.path=this.absolute,H.syscall="read",H.code="EOF",this[D](()=>this.emit("error",H))}if(c===this.remain)for(let H=c;H<this.length&&c<this.blockRemain;H++)this.buf[H+this.offset]=0,c++,this.remain++;const g=this.offset===0&&c===this.buf.length?this.buf:this.buf.slice(this.offset,this.offset+c);this.write(g)?this[B]():this[R](()=>this[B]())}[R](c){this.once("drain",c)}write(c){if(this.blockRemain<c.length){const g=new Error("writing more data than expected");return g.path=this.absolute,this.emit("error",g)}return this.remain-=c.length,this.blockRemain-=c.length,this.pos+=c.length,this.offset+=c.length,super.write(c)}[B](){if(!this.remain)return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),this[D](c=>c?this.emit("error",c):this.end());this.offset>=this.length&&(this.buf=Buffer.allocUnsafe(Math.min(this.blockRemain,this.buf.length)),this.offset=0),this.length=this.buf.length-this.offset,this[A]()}});class V extends N{[S](){this[v](r.lstatSync(this.absolute))}[C](){this[l](r.readlinkSync(this.absolute))}[f](){this[d](r.openSync(this.absolute,"r"))}[A](){let c=!0;try{const{fd:g,buf:L,offset:H,length:J,pos:$}=this,q=r.readSync(g,L,H,J,$);this[n](q),c=!1}finally{if(c)try{this[D](()=>{})}catch{}}}[R](c){c()}[D](c){r.closeSync(this.fd),c()}}const W=P(class extends u{constructor(c,g){g=g||{},super(g),this.preservePaths=!!g.preservePaths,this.portable=!!g.portable,this.strict=!!g.strict,this.noPax=!!g.noPax,this.noMtime=!!g.noMtime,this.readEntry=c,this.type=c.type,this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.prefix=g.prefix||null,this.path=a(c.path),this.mode=this[F](c.mode),this.uid=this.portable?null:c.uid,this.gid=this.portable?null:c.gid,this.uname=this.portable?null:c.uname,this.gname=this.portable?null:c.gname,this.size=c.size,this.mtime=this.noMtime?null:g.mtime||c.mtime,this.atime=this.portable?null:c.atime,this.ctime=this.portable?null:c.ctime,this.linkpath=a(c.linkpath),typeof g.onwarn=="function"&&this.on("warn",g.onwarn);let L=!1;if(!this.preservePaths){const[H,J]=G(this.path);H&&(this.path=J,L=H)}this.remain=c.size,this.blockRemain=c.startBlockSize,this.header=new s({path:this[x](this.path),linkpath:this.type==="Link"?this[x](this.linkpath):this.linkpath,mode:this.mode,uid:this.portable?null:this.uid,gid:this.portable?null:this.gid,size:this.size,mtime:this.noMtime?null:this.mtime,type:this.type,uname:this.portable?null:this.uname,atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime}),L&&this.warn("TAR_ENTRY_INFO",`stripping ${L} from absolute path`,{entry:this,path:L+this.path}),this.header.encode()&&!this.noPax&&super.write(new t({atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime,gid:this.portable?null:this.gid,mtime:this.noMtime?null:this.mtime,path:this[x](this.path),linkpath:this.type==="Link"?this[x](this.linkpath):this.linkpath,size:this.size,uid:this.portable?null:this.uid,uname:this.portable?null:this.uname,dev:this.portable?null:this.readEntry.dev,ino:this.portable?null:this.readEntry.ino,nlink:this.portable?null:this.readEntry.nlink}).encode()),super.write(this.header.block),c.pipe(this)}[x](c){return o(c,this.prefix)}[F](c){return Y(c,this.type==="Directory",this.portable)}write(c){const g=c.length;if(g>this.blockRemain)throw new Error("writing more to entry than is appropriate");return this.blockRemain-=g,super.write(c)}end(){return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),super.end()}});N.Sync=V,N.Tar=W;const ee=w=>w.isFile()?"File":w.isDirectory()?"Directory":w.isSymbolicLink()?"SymbolicLink":"Unsupported";return Jt=N,Jt}var Qt,Hs;function Hn(){return Hs||(Hs=1,Qt=function(u){u.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}),Qt}var ei,js;function Us(){if(js)return ei;js=1,ei=u,u.Node=i,u.create=u;function u(a){var e=this;if(e instanceof u||(e=new u),e.tail=null,e.head=null,e.length=0,a&&typeof a.forEach=="function")a.forEach(function(E){e.push(E)});else if(arguments.length>0)for(var o=0,h=arguments.length;o<h;o++)e.push(arguments[o]);return e}u.prototype.removeNode=function(a){if(a.list!==this)throw new Error("removing node which does not belong to this list");var e=a.next,o=a.prev;return e&&(e.prev=o),o&&(o.next=e),a===this.head&&(this.head=e),a===this.tail&&(this.tail=o),a.list.length--,a.next=null,a.prev=null,a.list=null,e},u.prototype.unshiftNode=function(a){if(a!==this.head){a.list&&a.list.removeNode(a);var e=this.head;a.list=this,a.next=e,e&&(e.prev=a),this.head=a,this.tail||(this.tail=a),this.length++}},u.prototype.pushNode=function(a){if(a!==this.tail){a.list&&a.list.removeNode(a);var e=this.tail;a.list=this,a.prev=e,e&&(e.next=a),this.tail=a,this.head||(this.head=a),this.length++}},u.prototype.push=function(){for(var a=0,e=arguments.length;a<e;a++)s(this,arguments[a]);return this.length},u.prototype.unshift=function(){for(var a=0,e=arguments.length;a<e;a++)r(this,arguments[a]);return this.length},u.prototype.pop=function(){if(this.tail){var a=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,a}},u.prototype.shift=function(){if(this.head){var a=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,a}},u.prototype.forEach=function(a,e){e=e||this;for(var o=this.head,h=0;o!==null;h++)a.call(e,o.value,h,this),o=o.next},u.prototype.forEachReverse=function(a,e){e=e||this;for(var o=this.tail,h=this.length-1;o!==null;h--)a.call(e,o.value,h,this),o=o.prev},u.prototype.get=function(a){for(var e=0,o=this.head;o!==null&&e<a;e++)o=o.next;if(e===a&&o!==null)return o.value},u.prototype.getReverse=function(a){for(var e=0,o=this.tail;o!==null&&e<a;e++)o=o.prev;if(e===a&&o!==null)return o.value},u.prototype.map=function(a,e){e=e||this;for(var o=new u,h=this.head;h!==null;)o.push(a.call(e,h.value,this)),h=h.next;return o},u.prototype.mapReverse=function(a,e){e=e||this;for(var o=new u,h=this.tail;h!==null;)o.push(a.call(e,h.value,this)),h=h.prev;return o},u.prototype.reduce=function(a,e){var o,h=this.head;if(arguments.length>1)o=e;else if(this.head)h=this.head.next,o=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var E=0;h!==null;E++)o=a(o,h.value,E),h=h.next;return o},u.prototype.reduceReverse=function(a,e){var o,h=this.tail;if(arguments.length>1)o=e;else if(this.tail)h=this.tail.prev,o=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var E=this.length-1;h!==null;E--)o=a(o,h.value,E),h=h.prev;return o},u.prototype.toArray=function(){for(var a=new Array(this.length),e=0,o=this.head;o!==null;e++)a[e]=o.value,o=o.next;return a},u.prototype.toArrayReverse=function(){for(var a=new Array(this.length),e=0,o=this.tail;o!==null;e++)a[e]=o.value,o=o.prev;return a},u.prototype.slice=function(a,e){e=e||this.length,e<0&&(e+=this.length),a=a||0,a<0&&(a+=this.length);var o=new u;if(e<a||e<0)return o;a<0&&(a=0),e>this.length&&(e=this.length);for(var h=0,E=this.head;E!==null&&h<a;h++)E=E.next;for(;E!==null&&h<e;h++,E=E.next)o.push(E.value);return o},u.prototype.sliceReverse=function(a,e){e=e||this.length,e<0&&(e+=this.length),a=a||0,a<0&&(a+=this.length);var o=new u;if(e<a||e<0)return o;a<0&&(a=0),e>this.length&&(e=this.length);for(var h=this.length,E=this.tail;E!==null&&h>e;h--)E=E.prev;for(;E!==null&&h>a;h--,E=E.prev)o.push(E.value);return o},u.prototype.splice=function(a,e,...o){a>this.length&&(a=this.length-1),a<0&&(a=this.length+a);for(var h=0,E=this.head;E!==null&&h<a;h++)E=E.next;for(var y=[],h=0;E&&h<e;h++)y.push(E.value),E=this.removeNode(E);E===null&&(E=this.tail),E!==this.head&&E!==this.tail&&(E=E.prev);for(var h=0;h<o.length;h++)E=t(this,E,o[h]);return y},u.prototype.reverse=function(){for(var a=this.head,e=this.tail,o=a;o!==null;o=o.prev){var h=o.prev;o.prev=o.next,o.next=h}return this.head=e,this.tail=a,this};function t(a,e,o){var h=e===a.head?new i(o,null,e,a):new i(o,e,e.next,a);return h.next===null&&(a.tail=h),h.prev===null&&(a.head=h),a.length++,h}function s(a,e){a.tail=new i(e,a.tail,null,a),a.head||(a.head=a.tail),a.length++}function r(a,e){a.head=new i(e,null,a.head,a),a.tail||(a.tail=a.head),a.length++}function i(a,e,o,h){if(!(this instanceof i))return new i(a,e,o,h);this.list=h,this.value=a,e?(e.next=this,this.prev=e):this.prev=null,o?(o.prev=this,this.next=o):this.next=null}try{Hn()(u)}catch{}return ei}var ti,zs;function ii(){if(zs)return ti;zs=1;class u{constructor(w,c){this.path=w||"./",this.absolute=c,this.entry=null,this.stat=null,this.readdir=null,this.pending=!1,this.ignore=!1,this.piped=!1}}const{Minipass:t}=It(),s=_s(),r=Ht(),i=ks(),a=i.Sync,e=i.Tar,o=Us(),h=Buffer.alloc(1024),E=Symbol("onStat"),y=Symbol("ended"),m=Symbol("queue"),C=Symbol("current"),_=Symbol("process"),b=Symbol("processing"),A=Symbol("processJob"),S=Symbol("jobs"),v=Symbol("jobDone"),n=Symbol("addFSEntry"),l=Symbol("addTarEntry"),f=Symbol("stat"),d=Symbol("readdir"),D=Symbol("onreaddir"),F=Symbol("pipe"),R=Symbol("entry"),B=Symbol("entryOpt"),x=Symbol("writeEntryClass"),M=Symbol("write"),P=Symbol("ondrain"),U=ge,G=De,Y=Kt(),N=Le(),V=Y(class extends t{constructor(w){if(super(w),w=w||Object.create(null),this.opt=w,this.file=w.file||"",this.cwd=w.cwd||process.cwd(),this.maxReadSize=w.maxReadSize,this.preservePaths=!!w.preservePaths,this.strict=!!w.strict,this.noPax=!!w.noPax,this.prefix=N(w.prefix||""),this.linkCache=w.linkCache||new Map,this.statCache=w.statCache||new Map,this.readdirCache=w.readdirCache||new Map,this[x]=i,typeof w.onwarn=="function"&&this.on("warn",w.onwarn),this.portable=!!w.portable,this.zip=null,w.gzip||w.brotli){if(w.gzip&&w.brotli)throw new TypeError("gzip and brotli are mutually exclusive");w.gzip&&(typeof w.gzip!="object"&&(w.gzip={}),this.portable&&(w.gzip.portable=!0),this.zip=new s.Gzip(w.gzip)),w.brotli&&(typeof w.brotli!="object"&&(w.brotli={}),this.zip=new s.BrotliCompress(w.brotli)),this.zip.on("data",c=>super.write(c)),this.zip.on("end",c=>super.end()),this.zip.on("drain",c=>this[P]()),this.on("resume",c=>this.zip.resume())}else this.on("drain",this[P]);this.noDirRecurse=!!w.noDirRecurse,this.follow=!!w.follow,this.noMtime=!!w.noMtime,this.mtime=w.mtime||null,this.filter=typeof w.filter=="function"?w.filter:c=>!0,this[m]=new o,this[S]=0,this.jobs=+w.jobs||4,this[b]=!1,this[y]=!1}[M](w){return super.write(w)}add(w){return this.write(w),this}end(w){return w&&this.write(w),this[y]=!0,this[_](),this}write(w){if(this[y])throw new Error("write after end");return w instanceof r?this[l](w):this[n](w),this.flowing}[l](w){const c=N(G.resolve(this.cwd,w.path));if(!this.filter(w.path,w))w.resume();else{const g=new u(w.path,c,!1);g.entry=new e(w,this[B](g)),g.entry.on("end",L=>this[v](g)),this[S]+=1,this[m].push(g)}this[_]()}[n](w){const c=N(G.resolve(this.cwd,w));this[m].push(new u(w,c)),this[_]()}[f](w){w.pending=!0,this[S]+=1;const c=this.follow?"stat":"lstat";U[c](w.absolute,(g,L)=>{w.pending=!1,this[S]-=1,g?this.emit("error",g):this[E](w,L)})}[E](w,c){this.statCache.set(w.absolute,c),w.stat=c,this.filter(w.path,c)||(w.ignore=!0),this[_]()}[d](w){w.pending=!0,this[S]+=1,U.readdir(w.absolute,(c,g)=>{if(w.pending=!1,this[S]-=1,c)return this.emit("error",c);this[D](w,g)})}[D](w,c){this.readdirCache.set(w.absolute,c),w.readdir=c,this[_]()}[_](){if(!this[b]){this[b]=!0;for(let w=this[m].head;w!==null&&this[S]<this.jobs;w=w.next)if(this[A](w.value),w.value.ignore){const c=w.next;this[m].removeNode(w),w.next=c}this[b]=!1,this[y]&&!this[m].length&&this[S]===0&&(this.zip?this.zip.end(h):(super.write(h),super.end()))}}get[C](){return this[m]&&this[m].head&&this[m].head.value}[v](w){this[m].shift(),this[S]-=1,this[_]()}[A](w){if(!w.pending){if(w.entry){w===this[C]&&!w.piped&&this[F](w);return}if(w.stat||(this.statCache.has(w.absolute)?this[E](w,this.statCache.get(w.absolute)):this[f](w)),!!w.stat&&!w.ignore&&!(!this.noDirRecurse&&w.stat.isDirectory()&&!w.readdir&&(this.readdirCache.has(w.absolute)?this[D](w,this.readdirCache.get(w.absolute)):this[d](w),!w.readdir))){if(w.entry=this[R](w),!w.entry){w.ignore=!0;return}w===this[C]&&!w.piped&&this[F](w)}}}[B](w){return{onwarn:(c,g,L)=>this.warn(c,g,L),noPax:this.noPax,cwd:this.cwd,absolute:w.absolute,preservePaths:this.preservePaths,maxReadSize:this.maxReadSize,strict:this.strict,portable:this.portable,linkCache:this.linkCache,statCache:this.statCache,noMtime:this.noMtime,mtime:this.mtime,prefix:this.prefix}}[R](w){this[S]+=1;try{return new this[x](w.path,this[B](w)).on("end",()=>this[v](w)).on("error",c=>this.emit("error",c))}catch(c){this.emit("error",c)}}[P](){this[C]&&this[C].entry&&this[C].entry.resume()}[F](w){w.piped=!0,w.readdir&&w.readdir.forEach(L=>{const H=w.path,J=H==="./"?"":H.replace(/\/*$/,"/");this[n](J+L)});const c=w.entry,g=this.zip;g?c.on("data",L=>{g.write(L)||c.pause()}):c.on("data",L=>{super.write(L)||c.pause()})}pause(){return this.zip&&this.zip.pause(),super.pause()}});class W extends V{constructor(w){super(w),this[x]=a}pause(){}resume(){}[f](w){const c=this.follow?"statSync":"lstatSync";this[E](w,U[c](w.absolute))}[d](w,c){this[D](w,U.readdirSync(w.absolute))}[F](w){const c=w.entry,g=this.zip;w.readdir&&w.readdir.forEach(L=>{const H=w.path,J=H==="./"?"":H.replace(/\/*$/,"/");this[n](J+L)}),g?c.on("data",L=>{g.write(L)}):c.on("data",L=>{super[M](L)})}}return V.Sync=W,ti=V,ti}var Re={},Gs;function ke(){if(Gs)return Re;Gs=1;const u=ys(),t=xe.EventEmitter,s=ge;let r=s.writev;if(!r){const w=process.binding("fs"),c=w.FSReqWrap||w.FSReqCallback;r=(g,L,H,J)=>{const $=(z,O)=>J(z,O,L),q=new c;q.oncomplete=$,w.writeBuffers(g,L,H,q)}}const i=Symbol("_autoClose"),a=Symbol("_close"),e=Symbol("_ended"),o=Symbol("_fd"),h=Symbol("_finished"),E=Symbol("_flags"),y=Symbol("_flush"),m=Symbol("_handleChunk"),C=Symbol("_makeBuf"),_=Symbol("_mode"),b=Symbol("_needDrain"),A=Symbol("_onerror"),S=Symbol("_onopen"),v=Symbol("_onread"),n=Symbol("_onwrite"),l=Symbol("_open"),f=Symbol("_path"),d=Symbol("_pos"),D=Symbol("_queue"),F=Symbol("_read"),R=Symbol("_readSize"),B=Symbol("_reading"),x=Symbol("_remain"),M=Symbol("_size"),P=Symbol("_write"),U=Symbol("_writing"),G=Symbol("_defaultFlag"),Y=Symbol("_errored");class N extends u{constructor(c,g){if(g=g||{},super(g),this.readable=!0,this.writable=!1,typeof c!="string")throw new TypeError("path must be a string");this[Y]=!1,this[o]=typeof g.fd=="number"?g.fd:null,this[f]=c,this[R]=g.readSize||16*1024*1024,this[B]=!1,this[M]=typeof g.size=="number"?g.size:1/0,this[x]=this[M],this[i]=typeof g.autoClose=="boolean"?g.autoClose:!0,typeof this[o]=="number"?this[F]():this[l]()}get fd(){return this[o]}get path(){return this[f]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[l](){s.open(this[f],"r",(c,g)=>this[S](c,g))}[S](c,g){c?this[A](c):(this[o]=g,this.emit("open",g),this[F]())}[C](){return Buffer.allocUnsafe(Math.min(this[R],this[x]))}[F](){if(!this[B]){this[B]=!0;const c=this[C]();if(c.length===0)return process.nextTick(()=>this[v](null,0,c));s.read(this[o],c,0,c.length,null,(g,L,H)=>this[v](g,L,H))}}[v](c,g,L){this[B]=!1,c?this[A](c):this[m](g,L)&&this[F]()}[a](){if(this[i]&&typeof this[o]=="number"){const c=this[o];this[o]=null,s.close(c,g=>g?this.emit("error",g):this.emit("close"))}}[A](c){this[B]=!0,this[a](),this.emit("error",c)}[m](c,g){let L=!1;return this[x]-=c,c>0&&(L=super.write(c<g.length?g.slice(0,c):g)),(c===0||this[x]<=0)&&(L=!1,this[a](),super.end()),L}emit(c,g){switch(c){case"prefinish":case"finish":break;case"drain":typeof this[o]=="number"&&this[F]();break;case"error":return this[Y]?void 0:(this[Y]=!0,super.emit(c,g));default:return super.emit(c,g)}}}class V extends N{[l](){let c=!0;try{this[S](null,s.openSync(this[f],"r")),c=!1}finally{c&&this[a]()}}[F](){let c=!0;try{if(!this[B]){this[B]=!0;do{const g=this[C](),L=g.length===0?0:s.readSync(this[o],g,0,g.length,null);if(!this[m](L,g))break}while(!0);this[B]=!1}c=!1}finally{c&&this[a]()}}[a](){if(this[i]&&typeof this[o]=="number"){const c=this[o];this[o]=null,s.closeSync(c),this.emit("close")}}}class W extends t{constructor(c,g){g=g||{},super(g),this.readable=!1,this.writable=!0,this[Y]=!1,this[U]=!1,this[e]=!1,this[b]=!1,this[D]=[],this[f]=c,this[o]=typeof g.fd=="number"?g.fd:null,this[_]=g.mode===void 0?438:g.mode,this[d]=typeof g.start=="number"?g.start:null,this[i]=typeof g.autoClose=="boolean"?g.autoClose:!0;const L=this[d]!==null?"r+":"w";this[G]=g.flags===void 0,this[E]=this[G]?L:g.flags,this[o]===null&&this[l]()}emit(c,g){if(c==="error"){if(this[Y])return;this[Y]=!0}return super.emit(c,g)}get fd(){return this[o]}get path(){return this[f]}[A](c){this[a](),this[U]=!0,this.emit("error",c)}[l](){s.open(this[f],this[E],this[_],(c,g)=>this[S](c,g))}[S](c,g){this[G]&&this[E]==="r+"&&c&&c.code==="ENOENT"?(this[E]="w",this[l]()):c?this[A](c):(this[o]=g,this.emit("open",g),this[y]())}end(c,g){return c&&this.write(c,g),this[e]=!0,!this[U]&&!this[D].length&&typeof this[o]=="number"&&this[n](null,0),this}write(c,g){return typeof c=="string"&&(c=Buffer.from(c,g)),this[e]?(this.emit("error",new Error("write() after end()")),!1):this[o]===null||this[U]||this[D].length?(this[D].push(c),this[b]=!0,!1):(this[U]=!0,this[P](c),!0)}[P](c){s.write(this[o],c,0,c.length,this[d],(g,L)=>this[n](g,L))}[n](c,g){c?this[A](c):(this[d]!==null&&(this[d]+=g),this[D].length?this[y]():(this[U]=!1,this[e]&&!this[h]?(this[h]=!0,this[a](),this.emit("finish")):this[b]&&(this[b]=!1,this.emit("drain"))))}[y](){if(this[D].length===0)this[e]&&this[n](null,0);else if(this[D].length===1)this[P](this[D].pop());else{const c=this[D];this[D]=[],r(this[o],c,this[d],(g,L)=>this[n](g,L))}}[a](){if(this[i]&&typeof this[o]=="number"){const c=this[o];this[o]=null,s.close(c,g=>g?this.emit("error",g):this.emit("close"))}}}class ee extends W{[l](){let c;if(this[G]&&this[E]==="r+")try{c=s.openSync(this[f],this[E],this[_])}catch(g){if(g.code==="ENOENT")return this[E]="w",this[l]();throw g}else c=s.openSync(this[f],this[E],this[_]);this[S](null,c)}[a](){if(this[i]&&typeof this[o]=="number"){const c=this[o];this[o]=null,s.closeSync(c),this.emit("close")}}[P](c){let g=!0;try{this[n](null,s.writeSync(this[o],c,0,c.length,this[d])),g=!1}finally{if(g)try{this[a]()}catch{}}}}return Re.ReadStream=N,Re.ReadStreamSync=V,Re.WriteStream=W,Re.WriteStreamSync=ee,Re}var si,qs;function ri(){if(qs)return si;qs=1;const u=Kt(),t=Me(),s=xe,r=Us(),i=1024*1024,a=Ht(),e=qt(),o=_s(),{nextTick:h}=xi,E=Buffer.from([31,139]),y=Symbol("state"),m=Symbol("writeEntry"),C=Symbol("readEntry"),_=Symbol("nextEntry"),b=Symbol("processEntry"),A=Symbol("extendedHeader"),S=Symbol("globalExtendedHeader"),v=Symbol("meta"),n=Symbol("emitMeta"),l=Symbol("buffer"),f=Symbol("queue"),d=Symbol("ended"),D=Symbol("emittedEnd"),F=Symbol("emit"),R=Symbol("unzip"),B=Symbol("consumeChunk"),x=Symbol("consumeChunkSub"),M=Symbol("consumeBody"),P=Symbol("consumeMeta"),U=Symbol("consumeHeader"),G=Symbol("consuming"),Y=Symbol("bufferConcat"),N=Symbol("maybeEnd"),V=Symbol("writing"),W=Symbol("aborted"),ee=Symbol("onDone"),w=Symbol("sawValidEntry"),c=Symbol("sawNullBlock"),g=Symbol("sawEOF"),L=Symbol("closeStream"),H=J=>!0;return si=u(class extends s{constructor($){$=$||{},super($),this.file=$.file||"",this[w]=null,this.on(ee,z=>{(this[y]==="begin"||this[w]===!1)&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),$.ondone?this.on(ee,$.ondone):this.on(ee,z=>{this.emit("prefinish"),this.emit("finish"),this.emit("end")}),this.strict=!!$.strict,this.maxMetaEntrySize=$.maxMetaEntrySize||i,this.filter=typeof $.filter=="function"?$.filter:H;const q=$.file&&($.file.endsWith(".tar.br")||$.file.endsWith(".tbr"));this.brotli=!$.gzip&&$.brotli!==void 0?$.brotli:q?void 0:!1,this.writable=!0,this.readable=!1,this[f]=new r,this[l]=null,this[C]=null,this[m]=null,this[y]="begin",this[v]="",this[A]=null,this[S]=null,this[d]=!1,this[R]=null,this[W]=!1,this[c]=!1,this[g]=!1,this.on("end",()=>this[L]()),typeof $.onwarn=="function"&&this.on("warn",$.onwarn),typeof $.onentry=="function"&&this.on("entry",$.onentry)}[U]($,q){this[w]===null&&(this[w]=!1);let z;try{z=new t($,q,this[A],this[S])}catch(O){return this.warn("TAR_ENTRY_INVALID",O)}if(z.nullBlock)this[c]?(this[g]=!0,this[y]==="begin"&&(this[y]="header"),this[F]("eof")):(this[c]=!0,this[F]("nullBlock"));else if(this[c]=!1,!z.cksumValid)this.warn("TAR_ENTRY_INVALID","checksum failure",{header:z});else if(!z.path)this.warn("TAR_ENTRY_INVALID","path is required",{header:z});else{const O=z.type;if(/^(Symbolic)?Link$/.test(O)&&!z.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:z});else if(!/^(Symbolic)?Link$/.test(O)&&z.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:z});else{const T=this[m]=new a(z,this[A],this[S]);if(!this[w])if(T.remain){const K=()=>{T.invalid||(this[w]=!0)};T.on("end",K)}else this[w]=!0;T.meta?T.size>this.maxMetaEntrySize?(T.ignore=!0,this[F]("ignoredEntry",T),this[y]="ignore",T.resume()):T.size>0&&(this[v]="",T.on("data",K=>this[v]+=K),this[y]="meta"):(this[A]=null,T.ignore=T.ignore||!this.filter(T.path,T),T.ignore?(this[F]("ignoredEntry",T),this[y]=T.remain?"ignore":"header",T.resume()):(T.remain?this[y]="body":(this[y]="header",T.end()),this[C]?this[f].push(T):(this[f].push(T),this[_]())))}}}[L](){h(()=>this.emit("close"))}[b]($){let q=!0;return $?Array.isArray($)?this.emit.apply(this,$):(this[C]=$,this.emit("entry",$),$.emittedEnd||($.on("end",z=>this[_]()),q=!1)):(this[C]=null,q=!1),q}[_](){do;while(this[b](this[f].shift()));if(!this[f].length){const $=this[C];!$||$.flowing||$.size===$.remain?this[V]||this.emit("drain"):$.once("drain",z=>this.emit("drain"))}}[M]($,q){const z=this[m],O=z.blockRemain,T=O>=$.length&&q===0?$:$.slice(q,q+O);return z.write(T),z.blockRemain||(this[y]="header",this[m]=null,z.end()),T.length}[P]($,q){const z=this[m],O=this[M]($,q);return this[m]||this[n](z),O}[F]($,q,z){!this[f].length&&!this[C]?this.emit($,q,z):this[f].push([$,q,z])}[n]($){switch(this[F]("meta",this[v]),$.type){case"ExtendedHeader":case"OldExtendedHeader":this[A]=e.parse(this[v],this[A],!1);break;case"GlobalExtendedHeader":this[S]=e.parse(this[v],this[S],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":this[A]=this[A]||Object.create(null),this[A].path=this[v].replace(/\0.*/,"");break;case"NextFileHasLongLinkpath":this[A]=this[A]||Object.create(null),this[A].linkpath=this[v].replace(/\0.*/,"");break;default:throw new Error("unknown meta: "+$.type)}}abort($){this[W]=!0,this.emit("abort",$),this.warn("TAR_ABORT",$,{recoverable:!1})}write($){if(this[W])return;if((this[R]===null||this.brotli===void 0&&this[R]===!1)&&$){if(this[l]&&($=Buffer.concat([this[l],$]),this[l]=null),$.length<E.length)return this[l]=$,!0;for(let T=0;this[R]===null&&T<E.length;T++)$[T]!==E[T]&&(this[R]=!1);const O=this.brotli===void 0;if(this[R]===!1&&O)if($.length<512)if(this[d])this.brotli=!0;else return this[l]=$,!0;else try{new t($.slice(0,512)),this.brotli=!1}catch{this.brotli=!0}if(this[R]===null||this[R]===!1&&this.brotli){const T=this[d];this[d]=!1,this[R]=this[R]===null?new o.Unzip:new o.BrotliDecompress,this[R].on("data",oe=>this[B](oe)),this[R].on("error",oe=>this.abort(oe)),this[R].on("end",oe=>{this[d]=!0,this[B]()}),this[V]=!0;const K=this[R][T?"end":"write"]($);return this[V]=!1,K}}this[V]=!0,this[R]?this[R].write($):this[B]($),this[V]=!1;const z=this[f].length?!1:this[C]?this[C].flowing:!0;return!z&&!this[f].length&&this[C].once("drain",O=>this.emit("drain")),z}[Y]($){$&&!this[W]&&(this[l]=this[l]?Buffer.concat([this[l],$]):$)}[N](){if(this[d]&&!this[D]&&!this[W]&&!this[G]){this[D]=!0;const $=this[m];if($&&$.blockRemain){const q=this[l]?this[l].length:0;this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${$.blockRemain} more bytes, only ${q} available)`,{entry:$}),this[l]&&$.write(this[l]),$.end()}this[F](ee)}}[B]($){if(this[G])this[Y]($);else if(!$&&!this[l])this[N]();else{if(this[G]=!0,this[l]){this[Y]($);const q=this[l];this[l]=null,this[x](q)}else this[x]($);for(;this[l]&&this[l].length>=512&&!this[W]&&!this[g];){const q=this[l];this[l]=null,this[x](q)}this[G]=!1}(!this[l]||this[d])&&this[N]()}[x]($){let q=0;const z=$.length;for(;q+512<=z&&!this[W]&&!this[g];)switch(this[y]){case"begin":case"header":this[U]($,q),q+=512;break;case"ignore":case"body":q+=this[M]($,q);break;case"meta":q+=this[P]($,q);break;default:throw new Error("invalid state: "+this[y])}q<z&&(this[l]?this[l]=Buffer.concat([$.slice(q),this[l]]):this[l]=$.slice(q))}end($){this[W]||(this[R]?this[R].end($):(this[d]=!0,this.brotli===void 0&&($=$||Buffer.alloc(0)),this.write($)))}}),si}var ni,Vs;function ui(){if(Vs)return ni;Vs=1;const u=Ie(),t=ri(),s=ge,r=ke(),i=De,a=Pe();ni=(m,C,_)=>{typeof m=="function"?(_=m,C=null,m={}):Array.isArray(m)&&(C=m,m={}),typeof C=="function"&&(_=C,C=null),C?C=Array.from(C):C=[];const b=u(m);if(b.sync&&typeof _=="function")throw new TypeError("callback not supported for sync tar functions");if(!b.file&&typeof _=="function")throw new TypeError("callback only supported with file option");return C.length&&o(b,C),b.noResume||e(b),b.file&&b.sync?h(b):b.file?E(b,_):y(b)};const e=m=>{const C=m.onentry;m.onentry=C?_=>{C(_),_.resume()}:_=>_.resume()},o=(m,C)=>{const _=new Map(C.map(S=>[a(S),!0])),b=m.filter,A=(S,v)=>{const n=v||i.parse(S).root||".",l=S===n?!1:_.has(S)?_.get(S):A(i.dirname(S),n);return _.set(S,l),l};m.filter=b?(S,v)=>b(S,v)&&A(a(S)):S=>A(a(S))},h=m=>{const C=y(m),_=m.file;let b=!0,A;try{const S=s.statSync(_),v=m.maxReadSize||16*1024*1024;if(S.size<v)C.end(s.readFileSync(_));else{let n=0;const l=Buffer.allocUnsafe(v);for(A=s.openSync(_,"r");n<S.size;){const f=s.readSync(A,l,0,v,n);n+=f,C.write(l.slice(0,f))}C.end()}b=!1}finally{if(b&&A)try{s.closeSync(A)}catch{}}},E=(m,C)=>{const _=new t(m),b=m.maxReadSize||16*1024*1024,A=m.file,S=new Promise((v,n)=>{_.on("error",n),_.on("end",v),s.stat(A,(l,f)=>{if(l)n(l);else{const d=new r.ReadStream(A,{readSize:b,size:f.size});d.on("error",n),d.pipe(_)}})});return C?S.then(C,C):S},y=m=>new t(m);return ni}var oi,Ws;function jn(){if(Ws)return oi;Ws=1;const u=Ie(),t=ii(),s=ke(),r=ui(),i=De;oi=(m,C,_)=>{if(typeof C=="function"&&(_=C),Array.isArray(m)&&(C=m,m={}),!C||!Array.isArray(C)||!C.length)throw new TypeError("no files or directories specified");C=Array.from(C);const b=u(m);if(b.sync&&typeof _=="function")throw new TypeError("callback not supported for sync tar functions");if(!b.file&&typeof _=="function")throw new TypeError("callback only supported with file option");return b.file&&b.sync?a(b,C):b.file?e(b,C,_):b.sync?E(b,C):y(b,C)};const a=(m,C)=>{const _=new t.Sync(m),b=new s.WriteStreamSync(m.file,{mode:m.mode||438});_.pipe(b),o(_,C)},e=(m,C,_)=>{const b=new t(m),A=new s.WriteStream(m.file,{mode:m.mode||438});b.pipe(A);const S=new Promise((v,n)=>{A.on("error",n),A.on("close",v),b.on("error",n)});return h(b,C),_?S.then(_,_):S},o=(m,C)=>{C.forEach(_=>{_.charAt(0)==="@"?r({file:i.resolve(m.cwd,_.slice(1)),sync:!0,noResume:!0,onentry:b=>m.add(b)}):m.add(_)}),m.end()},h=(m,C)=>{for(;C.length;){const _=C.shift();if(_.charAt(0)==="@")return r({file:i.resolve(m.cwd,_.slice(1)),noResume:!0,onentry:b=>m.add(b)}).then(b=>h(m,C));m.add(_)}m.end()},E=(m,C)=>{const _=new t.Sync(m);return o(_,C),_},y=(m,C)=>{const _=new t(m);return h(_,C),_};return oi}var ai,Ks;function Ys(){if(Ks)return ai;Ks=1;const u=Ie(),t=ii(),s=ge,r=ke(),i=ui(),a=De,e=Me();ai=(C,_,b)=>{const A=u(C);if(!A.file)throw new TypeError("file is required");if(A.gzip||A.brotli||A.file.endsWith(".br")||A.file.endsWith(".tbr"))throw new TypeError("cannot append to compressed archives");if(!_||!Array.isArray(_)||!_.length)throw new TypeError("no files or directories specified");return _=Array.from(_),A.sync?o(A,_):E(A,_,b)};const o=(C,_)=>{const b=new t.Sync(C);let A=!0,S,v;try{try{S=s.openSync(C.file,"r+")}catch(f){if(f.code==="ENOENT")S=s.openSync(C.file,"w+");else throw f}const n=s.fstatSync(S),l=Buffer.alloc(512);e:for(v=0;v<n.size;v+=512){for(let D=0,F=0;D<512;D+=F){if(F=s.readSync(S,l,D,l.length-D,v+D),v===0&&l[0]===31&&l[1]===139)throw new Error("cannot append to compressed archives");if(!F)break e}const f=new e(l);if(!f.cksumValid)break;const d=512*Math.ceil(f.size/512);if(v+d+512>n.size)break;v+=d,C.mtimeCache&&C.mtimeCache.set(f.path,f.mtime)}A=!1,h(C,b,v,S,_)}finally{if(A)try{s.closeSync(S)}catch{}}},h=(C,_,b,A,S)=>{const v=new r.WriteStreamSync(C.file,{fd:A,start:b});_.pipe(v),y(_,S)},E=(C,_,b)=>{_=Array.from(_);const A=new t(C),S=(n,l,f)=>{const d=(x,M)=>{x?s.close(n,P=>f(x)):f(null,M)};let D=0;if(l===0)return d(null,0);let F=0;const R=Buffer.alloc(512),B=(x,M)=>{if(x)return d(x);if(F+=M,F<512&&M)return s.read(n,R,F,R.length-F,D+F,B);if(D===0&&R[0]===31&&R[1]===139)return d(new Error("cannot append to compressed archives"));if(F<512)return d(null,D);const P=new e(R);if(!P.cksumValid)return d(null,D);const U=512*Math.ceil(P.size/512);if(D+U+512>l||(D+=U+512,D>=l))return d(null,D);C.mtimeCache&&C.mtimeCache.set(P.path,P.mtime),F=0,s.read(n,R,0,512,D,B)};s.read(n,R,0,512,D,B)},v=new Promise((n,l)=>{A.on("error",l);let f="r+";const d=(D,F)=>{if(D&&D.code==="ENOENT"&&f==="r+")return f="w+",s.open(C.file,f,d);if(D)return l(D);s.fstat(F,(R,B)=>{if(R)return s.close(F,()=>l(R));S(F,B.size,(x,M)=>{if(x)return l(x);const P=new r.WriteStream(C.file,{fd:F,start:M});A.pipe(P),P.on("error",l),P.on("close",n),m(A,_)})})};s.open(C.file,f,d)});return b?v.then(b,b):v},y=(C,_)=>{_.forEach(b=>{b.charAt(0)==="@"?i({file:a.resolve(C.cwd,b.slice(1)),sync:!0,noResume:!0,onentry:A=>C.add(A)}):C.add(b)}),C.end()},m=(C,_)=>{for(;_.length;){const b=_.shift();if(b.charAt(0)==="@")return i({file:a.resolve(C.cwd,b.slice(1)),noResume:!0,onentry:A=>C.add(A)}).then(A=>m(C,_));C.add(b)}C.end()};return ai}var hi,Zs;function Un(){if(Zs)return hi;Zs=1;const u=Ie(),t=Ys();hi=(r,i,a)=>{const e=u(r);if(!e.file)throw new TypeError("file is required");if(e.gzip||e.brotli||e.file.endsWith(".br")||e.file.endsWith(".tbr"))throw new TypeError("cannot append to compressed archives");if(!i||!Array.isArray(i)||!i.length)throw new TypeError("no files or directories specified");return i=Array.from(i),s(e),t(e,i,a)};const s=r=>{const i=r.filter;r.mtimeCache||(r.mtimeCache=new Map),r.filter=i?(a,e)=>i(a,e)&&!(r.mtimeCache.get(a)>e.mtime):(a,e)=>!(r.mtimeCache.get(a)>e.mtime)};return hi}var st={exports:{}},li,Xs;function zn(){if(Xs)return li;Xs=1;const{promisify:u}=Rr,t=ge;return li=r=>{if(!r)r={mode:511,fs:t};else if(typeof r=="object")r={mode:511,fs:t,...r};else if(typeof r=="number")r={mode:r,fs:t};else if(typeof r=="string")r={mode:parseInt(r,8),fs:t};else throw new TypeError("invalid options argument");return r.mkdir=r.mkdir||r.fs.mkdir||t.mkdir,r.mkdirAsync=u(r.mkdir),r.stat=r.stat||r.fs.stat||t.stat,r.statAsync=u(r.stat),r.statSync=r.statSync||r.fs.statSync||t.statSync,r.mkdirSync=r.mkdirSync||r.fs.mkdirSync||t.mkdirSync,r},li}var ci,Js;function Gn(){if(Js)return ci;Js=1;const u=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform,{resolve:t,parse:s}=De;return ci=i=>{if(/\0/.test(i))throw Object.assign(new TypeError("path must be a string without null bytes"),{path:i,code:"ERR_INVALID_ARG_VALUE"});if(i=t(i),u==="win32"){const a=/[*|"<>?:]/,{root:e}=s(i);if(a.test(i.substr(e.length)))throw Object.assign(new Error("Illegal characters in path."),{path:i,code:"EINVAL"})}return i},ci}var Di,Qs;function qn(){if(Qs)return Di;Qs=1;const{dirname:u}=De,t=(r,i,a=void 0)=>a===i?Promise.resolve():r.statAsync(i).then(e=>e.isDirectory()?a:void 0,e=>e.code==="ENOENT"?t(r,u(i),i):void 0),s=(r,i,a=void 0)=>{if(a!==i)try{return r.statSync(i).isDirectory()?a:void 0}catch(e){return e.code==="ENOENT"?s(r,u(i),i):void 0}};return Di={findMade:t,findMadeSync:s},Di}var fi,er;function tr(){if(er)return fi;er=1;const{dirname:u}=De,t=(r,i,a)=>{i.recursive=!1;const e=u(r);return e===r?i.mkdirAsync(r,i).catch(o=>{if(o.code!=="EISDIR")throw o}):i.mkdirAsync(r,i).then(()=>a||r,o=>{if(o.code==="ENOENT")return t(e,i).then(h=>t(r,i,h));if(o.code!=="EEXIST"&&o.code!=="EROFS")throw o;return i.statAsync(r).then(h=>{if(h.isDirectory())return a;throw o},()=>{throw o})})},s=(r,i,a)=>{const e=u(r);if(i.recursive=!1,e===r)try{return i.mkdirSync(r,i)}catch(o){if(o.code!=="EISDIR")throw o;return}try{return i.mkdirSync(r,i),a||r}catch(o){if(o.code==="ENOENT")return s(r,i,s(e,i,a));if(o.code!=="EEXIST"&&o.code!=="EROFS")throw o;try{if(!i.statSync(r).isDirectory())throw o}catch{throw o}}};return fi={mkdirpManual:t,mkdirpManualSync:s},fi}var di,ir;function Vn(){if(ir)return di;ir=1;const{dirname:u}=De,{findMade:t,findMadeSync:s}=qn(),{mkdirpManual:r,mkdirpManualSync:i}=tr();return di={mkdirpNative:(o,h)=>(h.recursive=!0,u(o)===o?h.mkdirAsync(o,h):t(h,o).then(y=>h.mkdirAsync(o,h).then(()=>y).catch(m=>{if(m.code==="ENOENT")return r(o,h);throw m}))),mkdirpNativeSync:(o,h)=>{if(h.recursive=!0,u(o)===o)return h.mkdirSync(o,h);const y=s(h,o);try{return h.mkdirSync(o,h),y}catch(m){if(m.code==="ENOENT")return i(o,h);throw m}}},di}var mi,sr;function Wn(){if(sr)return mi;sr=1;const u=ge,s=(process.env.__TESTING_MKDIRP_NODE_VERSION__||process.version).replace(/^v/,"").split("."),r=+s[0]>10||+s[0]==10&&+s[1]>=12;return mi={useNative:r?e=>e.mkdir===u.mkdir:()=>!1,useNativeSync:r?e=>e.mkdirSync===u.mkdirSync:()=>!1},mi}var pi,rr;function Kn(){if(rr)return pi;rr=1;const u=zn(),t=Gn(),{mkdirpNative:s,mkdirpNativeSync:r}=Vn(),{mkdirpManual:i,mkdirpManualSync:a}=tr(),{useNative:e,useNativeSync:o}=Wn(),h=(y,m)=>(y=t(y),m=u(m),e(m)?s(y,m):i(y,m)),E=(y,m)=>(y=t(y),m=u(m),o(m)?r(y,m):a(y,m));return h.sync=E,h.native=(y,m)=>s(t(y),u(m)),h.manual=(y,m)=>i(t(y),u(m)),h.nativeSync=(y,m)=>r(t(y),u(m)),h.manualSync=(y,m)=>a(t(y),u(m)),pi=h,pi}var Ei,nr;function Yn(){if(nr)return Ei;nr=1;const u=ge,t=De,s=u.lchown?"lchown":"chown",r=u.lchownSync?"lchownSync":"chownSync",i=u.lchown&&!process.version.match(/v1[1-9]+\./)&&!process.version.match(/v10\.[6-9]/),a=(v,n,l)=>{try{return u[r](v,n,l)}catch(f){if(f.code!=="ENOENT")throw f}},e=(v,n,l)=>{try{return u.chownSync(v,n,l)}catch(f){if(f.code!=="ENOENT")throw f}},o=i?(v,n,l,f)=>d=>{!d||d.code!=="EISDIR"?f(d):u.chown(v,n,l,f)}:(v,n,l,f)=>f,h=i?(v,n,l)=>{try{return a(v,n,l)}catch(f){if(f.code!=="EISDIR")throw f;e(v,n,l)}}:(v,n,l)=>a(v,n,l),E=process.version;let y=(v,n,l)=>u.readdir(v,n,l),m=(v,n)=>u.readdirSync(v,n);/^v4\./.test(E)&&(y=(v,n,l)=>u.readdir(v,l));const C=(v,n,l,f)=>{u[s](v,n,l,o(v,n,l,d=>{f(d&&d.code!=="ENOENT"?d:null)}))},_=(v,n,l,f,d)=>{if(typeof n=="string")return u.lstat(t.resolve(v,n),(D,F)=>{if(D)return d(D.code!=="ENOENT"?D:null);F.name=n,_(v,F,l,f,d)});if(n.isDirectory())b(t.resolve(v,n.name),l,f,D=>{if(D)return d(D);const F=t.resolve(v,n.name);C(F,l,f,d)});else{const D=t.resolve(v,n.name);C(D,l,f,d)}},b=(v,n,l,f)=>{y(v,{withFileTypes:!0},(d,D)=>{if(d){if(d.code==="ENOENT")return f();if(d.code!=="ENOTDIR"&&d.code!=="ENOTSUP")return f(d)}if(d||!D.length)return C(v,n,l,f);let F=D.length,R=null;const B=x=>{if(!R){if(x)return f(R=x);if(--F===0)return C(v,n,l,f)}};D.forEach(x=>_(v,x,n,l,B))})},A=(v,n,l,f)=>{if(typeof n=="string")try{const d=u.lstatSync(t.resolve(v,n));d.name=n,n=d}catch(d){if(d.code==="ENOENT")return;throw d}n.isDirectory()&&S(t.resolve(v,n.name),l,f),h(t.resolve(v,n.name),l,f)},S=(v,n,l)=>{let f;try{f=m(v,{withFileTypes:!0})}catch(d){if(d.code==="ENOENT")return;if(d.code==="ENOTDIR"||d.code==="ENOTSUP")return h(v,n,l);throw d}return f&&f.length&&f.forEach(d=>A(v,d,n,l)),h(v,n,l)};return Ei=b,b.sync=S,Ei}var ur;function Zn(){if(ur)return st.exports;ur=1;const u=Kn(),t=ge,s=De,r=Yn(),i=Le();class a extends Error{constructor(b,A){super("Cannot extract through symbolic link"),this.path=A,this.symlink=b}get name(){return"SylinkError"}}class e extends Error{constructor(b,A){super(A+": Cannot cd into '"+b+"'"),this.path=b,this.code=A}get name(){return"CwdError"}}const o=(_,b)=>_.get(i(b)),h=(_,b,A)=>_.set(i(b),A),E=(_,b)=>{t.stat(_,(A,S)=>{(A||!S.isDirectory())&&(A=new e(_,A&&A.code||"ENOTDIR")),b(A)})};st.exports=(_,b,A)=>{_=i(_);const S=b.umask,v=b.mode|448,n=(v&S)!==0,l=b.uid,f=b.gid,d=typeof l=="number"&&typeof f=="number"&&(l!==b.processUid||f!==b.processGid),D=b.preserve,F=b.unlink,R=b.cache,B=i(b.cwd),x=(U,G)=>{U?A(U):(h(R,_,!0),G&&d?r(G,l,f,Y=>x(Y)):n?t.chmod(_,v,A):A())};if(R&&o(R,_)===!0)return x();if(_===B)return E(_,x);if(D)return u(_,{mode:v}).then(U=>x(null,U),x);const P=i(s.relative(B,_)).split("/");y(B,P,v,R,F,B,null,x)};const y=(_,b,A,S,v,n,l,f)=>{if(!b.length)return f(null,l);const d=b.shift(),D=i(s.resolve(_+"/"+d));if(o(S,D))return y(D,b,A,S,v,n,l,f);t.mkdir(D,A,m(D,b,A,S,v,n,l,f))},m=(_,b,A,S,v,n,l,f)=>d=>{d?t.lstat(_,(D,F)=>{if(D)D.path=D.path&&i(D.path),f(D);else if(F.isDirectory())y(_,b,A,S,v,n,l,f);else if(v)t.unlink(_,R=>{if(R)return f(R);t.mkdir(_,A,m(_,b,A,S,v,n,l,f))});else{if(F.isSymbolicLink())return f(new a(_,_+"/"+b.join("/")));f(d)}}):(l=l||_,y(_,b,A,S,v,n,l,f))},C=_=>{let b=!1,A="ENOTDIR";try{b=t.statSync(_).isDirectory()}catch(S){A=S.code}finally{if(!b)throw new e(_,A)}};return st.exports.sync=(_,b)=>{_=i(_);const A=b.umask,S=b.mode|448,v=(S&A)!==0,n=b.uid,l=b.gid,f=typeof n=="number"&&typeof l=="number"&&(n!==b.processUid||l!==b.processGid),d=b.preserve,D=b.unlink,F=b.cache,R=i(b.cwd),B=U=>{h(F,_,!0),U&&f&&r.sync(U,n,l),v&&t.chmodSync(_,S)};if(F&&o(F,_)===!0)return B();if(_===R)return C(R),B();if(d)return B(u.sync(_,S));const M=i(s.relative(R,_)).split("/");let P=null;for(let U=M.shift(),G=R;U&&(G+="/"+U);U=M.shift())if(G=i(s.resolve(G)),!o(F,G))try{t.mkdirSync(G,S),P=P||G,h(F,G,!0)}catch{const N=t.lstatSync(G);if(N.isDirectory()){h(F,G,!0);continue}else if(D){t.unlinkSync(G),t.mkdirSync(G,S),P=P||G,h(F,G,!0);continue}else if(N.isSymbolicLink())return new a(G,G+"/"+M.join("/"))}return B(P)},st.exports}var gi,or;function ar(){if(or)return gi;or=1;const u=Object.create(null),{hasOwnProperty:t}=Object.prototype;return gi=s=>(t.call(u,s)||(u[s]=s.normalize("NFD")),u[s]),gi}var Ci,hr;function Xn(){if(hr)return Ci;hr=1;const u=lt,t=ar(),s=Pe(),{join:r}=De,a=(process.env.TESTING_TAR_FAKE_PLATFORM||process.platform)==="win32";return Ci=()=>{const e=new Map,o=new Map,h=A=>A.split("/").slice(0,-1).reduce((v,n)=>(v.length&&(n=r(v[v.length-1],n)),v.push(n||"/"),v),[]),E=new Set,y=A=>{const S=o.get(A);if(!S)throw new Error("function does not have any path reservations");return{paths:S.paths.map(v=>e.get(v)),dirs:[...S.dirs].map(v=>e.get(v))}},m=A=>{const{paths:S,dirs:v}=y(A);return S.every(n=>n[0]===A)&&v.every(n=>n[0]instanceof Set&&n[0].has(A))},C=A=>E.has(A)||!m(A)?!1:(E.add(A),A(()=>_(A)),!0),_=A=>{if(!E.has(A))return!1;const{paths:S,dirs:v}=o.get(A),n=new Set;return S.forEach(l=>{const f=e.get(l);u.equal(f[0],A),f.length===1?e.delete(l):(f.shift(),typeof f[0]=="function"?n.add(f[0]):f[0].forEach(d=>n.add(d)))}),v.forEach(l=>{const f=e.get(l);u(f[0]instanceof Set),f[0].size===1&&f.length===1?e.delete(l):f[0].size===1?(f.shift(),n.add(f[0])):f[0].delete(A)}),E.delete(A),n.forEach(l=>C(l)),!0};return{check:m,reserve:(A,S)=>{A=a?["win32 parallelization disabled"]:A.map(n=>s(r(t(n))).toLowerCase());const v=new Set(A.map(n=>h(n)).reduce((n,l)=>n.concat(l)));return o.set(S,{dirs:v,paths:A}),A.forEach(n=>{const l=e.get(n);l?l.push(S):e.set(n,[S])}),v.forEach(n=>{const l=e.get(n);l?l[l.length-1]instanceof Set?l[l.length-1].add(S):l.push(new Set([S])):e.set(n,[new Set([S])])}),C(S)}}},Ci}var Fi,lr;function Jn(){if(lr)return Fi;lr=1;const t=(process.env.__FAKE_PLATFORM__||process.platform)==="win32",s=ct.__FAKE_TESTING_FS__||ge,{O_CREAT:r,O_TRUNC:i,O_WRONLY:a,UV_FS_O_FILEMAP:e=0}=s.constants,o=t&&!!e,h=512*1024,E=e|i|r|a;return Fi=o?y=>y<h?E:"w":()=>"w",Fi}var yi,cr;function Dr(){if(cr)return yi;cr=1;const u=lt,t=ri(),s=ge,r=ke(),i=De,a=Zn(),e=Ns(),o=Xn(),h=Ls(),E=Le(),y=Pe(),m=ar(),C=Symbol("onEntry"),_=Symbol("checkFs"),b=Symbol("checkFs2"),A=Symbol("pruneCache"),S=Symbol("isReusable"),v=Symbol("makeFs"),n=Symbol("file"),l=Symbol("directory"),f=Symbol("link"),d=Symbol("symlink"),D=Symbol("hardlink"),F=Symbol("unsupported"),R=Symbol("checkPath"),B=Symbol("mkdir"),x=Symbol("onError"),M=Symbol("pending"),P=Symbol("pend"),U=Symbol("unpend"),G=Symbol("ended"),Y=Symbol("maybeClose"),N=Symbol("skip"),V=Symbol("doChown"),W=Symbol("uid"),ee=Symbol("gid"),w=Symbol("checkedCwd"),c=Br,g=Jn(),H=(process.env.TESTING_TAR_FAKE_PLATFORM||process.platform)==="win32",J=1024,$=(te,p)=>{if(!H)return s.unlink(te,p);const k=te+".DELETE."+c.randomBytes(16).toString("hex");s.rename(te,k,j=>{if(j)return p(j);s.unlink(k,p)})},q=te=>{if(!H)return s.unlinkSync(te);const p=te+".DELETE."+c.randomBytes(16).toString("hex");s.renameSync(te,p),s.unlinkSync(p)},z=(te,p,k)=>te===te>>>0?te:p===p>>>0?p:k,O=te=>y(E(m(te))).toLowerCase(),T=(te,p)=>{p=O(p);for(const k of te.keys()){const j=O(k);(j===p||j.indexOf(p+"/")===0)&&te.delete(k)}},K=te=>{for(const p of te.keys())te.delete(p)};class oe extends t{constructor(p){if(p||(p={}),p.ondone=k=>{this[G]=!0,this[Y]()},super(p),this[w]=!1,this.reservations=o(),this.transform=typeof p.transform=="function"?p.transform:null,this.writable=!0,this.readable=!1,this[M]=0,this[G]=!1,this.dirCache=p.dirCache||new Map,typeof p.uid=="number"||typeof p.gid=="number"){if(typeof p.uid!="number"||typeof p.gid!="number")throw new TypeError("cannot set owner without number uid and gid");if(p.preserveOwner)throw new TypeError("cannot preserve owner in archive and also set owner explicitly");this.uid=p.uid,this.gid=p.gid,this.setOwner=!0}else this.uid=null,this.gid=null,this.setOwner=!1;p.preserveOwner===void 0&&typeof p.uid!="number"?this.preserveOwner=process.getuid&&process.getuid()===0:this.preserveOwner=!!p.preserveOwner,this.processUid=(this.preserveOwner||this.setOwner)&&process.getuid?process.getuid():null,this.processGid=(this.preserveOwner||this.setOwner)&&process.getgid?process.getgid():null,this.maxDepth=typeof p.maxDepth=="number"?p.maxDepth:J,this.forceChown=p.forceChown===!0,this.win32=!!p.win32||H,this.newer=!!p.newer,this.keep=!!p.keep,this.noMtime=!!p.noMtime,this.preservePaths=!!p.preservePaths,this.unlink=!!p.unlink,this.cwd=E(i.resolve(p.cwd||process.cwd())),this.strip=+p.strip||0,this.processUmask=p.noChmod?0:process.umask(),this.umask=typeof p.umask=="number"?p.umask:this.processUmask,this.dmode=p.dmode||511&~this.umask,this.fmode=p.fmode||438&~this.umask,this.on("entry",k=>this[C](k))}warn(p,k,j={}){return(p==="TAR_BAD_ARCHIVE"||p==="TAR_ABORT")&&(j.recoverable=!1),super.warn(p,k,j)}[Y](){this[G]&&this[M]===0&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"))}[R](p){const k=E(p.path),j=k.split("/");if(this.strip){if(j.length<this.strip)return!1;if(p.type==="Link"){const Z=E(p.linkpath).split("/");if(Z.length>=this.strip)p.linkpath=Z.slice(this.strip).join("/");else return!1}j.splice(0,this.strip),p.path=j.join("/")}if(isFinite(this.maxDepth)&&j.length>this.maxDepth)return this.warn("TAR_ENTRY_ERROR","path excessively deep",{entry:p,path:k,depth:j.length,maxDepth:this.maxDepth}),!1;if(!this.preservePaths){if(j.includes("..")||H&&/^[a-z]:\.\.$/i.test(j[0]))return this.warn("TAR_ENTRY_ERROR","path contains '..'",{entry:p,path:k}),!1;const[Z,X]=h(k);Z&&(p.path=X,this.warn("TAR_ENTRY_INFO",`stripping ${Z} from absolute path`,{entry:p,path:k}))}if(i.isAbsolute(p.path)?p.absolute=E(i.resolve(p.path)):p.absolute=E(i.resolve(this.cwd,p.path)),!this.preservePaths&&p.absolute.indexOf(this.cwd+"/")!==0&&p.absolute!==this.cwd)return this.warn("TAR_ENTRY_ERROR","path escaped extraction target",{entry:p,path:E(p.path),resolvedPath:p.absolute,cwd:this.cwd}),!1;if(p.absolute===this.cwd&&p.type!=="Directory"&&p.type!=="GNUDumpDir")return!1;if(this.win32){const{root:Z}=i.win32.parse(p.absolute);p.absolute=Z+e.encode(p.absolute.slice(Z.length));const{root:X}=i.win32.parse(p.path);p.path=X+e.encode(p.path.slice(X.length))}return!0}[C](p){if(!this[R](p))return p.resume();switch(u.equal(typeof p.absolute,"string"),p.type){case"Directory":case"GNUDumpDir":p.mode&&(p.mode=p.mode|448);case"File":case"OldFile":case"ContiguousFile":case"Link":case"SymbolicLink":return this[_](p);case"CharacterDevice":case"BlockDevice":case"FIFO":default:return this[F](p)}}[x](p,k){p.name==="CwdError"?this.emit("error",p):(this.warn("TAR_ENTRY_ERROR",p,{entry:k}),this[U](),k.resume())}[B](p,k,j){a(E(p),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:k,noChmod:this.noChmod},j)}[V](p){return this.forceChown||this.preserveOwner&&(typeof p.uid=="number"&&p.uid!==this.processUid||typeof p.gid=="number"&&p.gid!==this.processGid)||typeof this.uid=="number"&&this.uid!==this.processUid||typeof this.gid=="number"&&this.gid!==this.processGid}[W](p){return z(this.uid,p.uid,this.processUid)}[ee](p){return z(this.gid,p.gid,this.processGid)}[n](p,k){const j=p.mode&4095||this.fmode,Z=new r.WriteStream(p.absolute,{flags:g(p.size),mode:j,autoClose:!1});Z.on("error",se=>{Z.fd&&s.close(Z.fd,()=>{}),Z.write=()=>!0,this[x](se,p),k()});let X=1;const ue=se=>{if(se){Z.fd&&s.close(Z.fd,()=>{}),this[x](se,p),k();return}--X===0&&s.close(Z.fd,le=>{le?this[x](le,p):this[U](),k()})};Z.on("finish",se=>{const le=p.absolute,Fe=Z.fd;if(p.mtime&&!this.noMtime){X++;const ye=p.atime||new Date,Ae=p.mtime;s.futimes(Fe,ye,Ae,Be=>Be?s.utimes(le,ye,Ae,ut=>ue(ut&&Be)):ue())}if(this[V](p)){X++;const ye=this[W](p),Ae=this[ee](p);s.fchown(Fe,ye,Ae,Be=>Be?s.chown(le,ye,Ae,ut=>ue(ut&&Be)):ue())}ue()});const ie=this.transform&&this.transform(p)||p;ie!==p&&(ie.on("error",se=>{this[x](se,p),k()}),p.pipe(ie)),ie.pipe(Z)}[l](p,k){const j=p.mode&4095||this.dmode;this[B](p.absolute,j,Z=>{if(Z){this[x](Z,p),k();return}let X=1;const ue=ie=>{--X===0&&(k(),this[U](),p.resume())};p.mtime&&!this.noMtime&&(X++,s.utimes(p.absolute,p.atime||new Date,p.mtime,ue)),this[V](p)&&(X++,s.chown(p.absolute,this[W](p),this[ee](p),ue)),ue()})}[F](p){p.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${p.type}`,{entry:p}),p.resume()}[d](p,k){this[f](p,p.linkpath,"symlink",k)}[D](p,k){const j=E(i.resolve(this.cwd,p.linkpath));this[f](p,j,"link",k)}[P](){this[M]++}[U](){this[M]--,this[Y]()}[N](p){this[U](),p.resume()}[S](p,k){return p.type==="File"&&!this.unlink&&k.isFile()&&k.nlink<=1&&!H}[_](p){this[P]();const k=[p.path];p.linkpath&&k.push(p.linkpath),this.reservations.reserve(k,j=>this[b](p,j))}[A](p){p.type==="SymbolicLink"?K(this.dirCache):p.type!=="Directory"&&T(this.dirCache,p.absolute)}[b](p,k){this[A](p);const j=ie=>{this[A](p),k(ie)},Z=()=>{this[B](this.cwd,this.dmode,ie=>{if(ie){this[x](ie,p),j();return}this[w]=!0,X()})},X=()=>{if(p.absolute!==this.cwd){const ie=E(i.dirname(p.absolute));if(ie!==this.cwd)return this[B](ie,this.dmode,se=>{if(se){this[x](se,p),j();return}ue()})}ue()},ue=()=>{s.lstat(p.absolute,(ie,se)=>{if(se&&(this.keep||this.newer&&se.mtime>p.mtime)){this[N](p),j();return}if(ie||this[S](p,se))return this[v](null,p,j);if(se.isDirectory()){if(p.type==="Directory"){const le=!this.noChmod&&p.mode&&(se.mode&4095)!==p.mode,Fe=ye=>this[v](ye,p,j);return le?s.chmod(p.absolute,p.mode,Fe):Fe()}if(p.absolute!==this.cwd)return s.rmdir(p.absolute,le=>this[v](le,p,j))}if(p.absolute===this.cwd)return this[v](null,p,j);$(p.absolute,le=>this[v](le,p,j))})};this[w]?X():Z()}[v](p,k,j){if(p){this[x](p,k),j();return}switch(k.type){case"File":case"OldFile":case"ContiguousFile":return this[n](k,j);case"Link":return this[D](k,j);case"SymbolicLink":return this[d](k,j);case"Directory":case"GNUDumpDir":return this[l](k,j)}}[f](p,k,j,Z){s[j](k,p.absolute,X=>{X?this[x](X,p):(this[U](),p.resume()),Z()})}}const ce=te=>{try{return[null,te()]}catch(p){return[p,null]}};class Ge extends oe{[v](p,k){return super[v](p,k,()=>{})}[_](p){if(this[A](p),!this[w]){const X=this[B](this.cwd,this.dmode);if(X)return this[x](X,p);this[w]=!0}if(p.absolute!==this.cwd){const X=E(i.dirname(p.absolute));if(X!==this.cwd){const ue=this[B](X,this.dmode);if(ue)return this[x](ue,p)}}const[k,j]=ce(()=>s.lstatSync(p.absolute));if(j&&(this.keep||this.newer&&j.mtime>p.mtime))return this[N](p);if(k||this[S](p,j))return this[v](null,p);if(j.isDirectory()){if(p.type==="Directory"){const ue=!this.noChmod&&p.mode&&(j.mode&4095)!==p.mode,[ie]=ue?ce(()=>{s.chmodSync(p.absolute,p.mode)}):[];return this[v](ie,p)}const[X]=ce(()=>s.rmdirSync(p.absolute));this[v](X,p)}const[Z]=p.absolute===this.cwd?[]:ce(()=>q(p.absolute));this[v](Z,p)}[n](p,k){const j=p.mode&4095||this.fmode,Z=ie=>{let se;try{s.closeSync(X)}catch(le){se=le}(ie||se)&&this[x](ie||se,p),k()};let X;try{X=s.openSync(p.absolute,g(p.size),j)}catch(ie){return Z(ie)}const ue=this.transform&&this.transform(p)||p;ue!==p&&(ue.on("error",ie=>this[x](ie,p)),p.pipe(ue)),ue.on("data",ie=>{try{s.writeSync(X,ie,0,ie.length)}catch(se){Z(se)}}),ue.on("end",ie=>{let se=null;if(p.mtime&&!this.noMtime){const le=p.atime||new Date,Fe=p.mtime;try{s.futimesSync(X,le,Fe)}catch(ye){try{s.utimesSync(p.absolute,le,Fe)}catch{se=ye}}}if(this[V](p)){const le=this[W](p),Fe=this[ee](p);try{s.fchownSync(X,le,Fe)}catch(ye){try{s.chownSync(p.absolute,le,Fe)}catch{se=se||ye}}}Z(se)})}[l](p,k){const j=p.mode&4095||this.dmode,Z=this[B](p.absolute,j);if(Z){this[x](Z,p),k();return}if(p.mtime&&!this.noMtime)try{s.utimesSync(p.absolute,p.atime||new Date,p.mtime)}catch{}if(this[V](p))try{s.chownSync(p.absolute,this[W](p),this[ee](p))}catch{}k(),p.resume()}[B](p,k){try{return a.sync(E(p),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:k})}catch(j){return j}}[f](p,k,j,Z){try{s[j+"Sync"](k,p.absolute),Z(),p.resume()}catch(X){return this[x](X,p)}}}return oe.Sync=Ge,yi=oe,yi}var bi,fr;function Qn(){if(fr)return bi;fr=1;const u=Ie(),t=Dr(),s=ge,r=ke(),i=De,a=Pe();bi=(m,C,_)=>{typeof m=="function"?(_=m,C=null,m={}):Array.isArray(m)&&(C=m,m={}),typeof C=="function"&&(_=C,C=null),C?C=Array.from(C):C=[];const b=u(m);if(b.sync&&typeof _=="function")throw new TypeError("callback not supported for sync tar functions");if(!b.file&&typeof _=="function")throw new TypeError("callback only supported with file option");return C.length&&e(b,C),b.file&&b.sync?o(b):b.file?h(b,_):b.sync?E(b):y(b)};const e=(m,C)=>{const _=new Map(C.map(S=>[a(S),!0])),b=m.filter,A=(S,v)=>{const n=v||i.parse(S).root||".",l=S===n?!1:_.has(S)?_.get(S):A(i.dirname(S),n);return _.set(S,l),l};m.filter=b?(S,v)=>b(S,v)&&A(a(S)):S=>A(a(S))},o=m=>{const C=new t.Sync(m),_=m.file,b=s.statSync(_),A=m.maxReadSize||16*1024*1024;new r.ReadStreamSync(_,{readSize:A,size:b.size}).pipe(C)},h=(m,C)=>{const _=new t(m),b=m.maxReadSize||16*1024*1024,A=m.file,S=new Promise((v,n)=>{_.on("error",n),_.on("close",v),s.stat(A,(l,f)=>{if(l)n(l);else{const d=new r.ReadStream(A,{readSize:b,size:f.size});d.on("error",n),d.pipe(_)}})});return C?S.then(C,C):S},E=m=>new t.Sync(m),y=m=>new t(m);return bi}var dr;function eu(){return dr||(dr=1,he.c=he.create=jn(),he.r=he.replace=Ys(),he.t=he.list=ui(),he.u=he.update=Un(),he.x=he.extract=Qn(),he.Pack=ii(),he.Unpack=Dr(),he.Parse=ri(),he.ReadEntry=Ht(),he.WriteEntry=ks(),he.Header=Me(),he.Pax=qt(),he.types=Ss()),he}var tu=eu();class iu extends Error{}class mr extends Error{}class su extends Error{}class ru extends Error{}const pr=async(u,t)=>{const s=new URL(u),r=we.basename(s.pathname);return{name:r,version:void 0,subdir:void 0,url:s.href,tar:s.href,defaultDir:r,headers:t.auth?{Authorization:`Bearer ${t.auth}`}:void 0}},Er=async(u,t)=>{const s=rt(u),r=await _i(s,t,async()=>(await(await He(`https://api.github.com/repos/${s.repo}`)).json())?.default_branch);return{name:s.repo.replace("/","-"),version:r,subdir:s.subdir,headers:{...t.auth?{Authorization:`Bearer ${t.auth}`}:{},Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"},url:`https://github.com/${s.repo}/tree/${r}${s.subdir}`,tar:`https://api.github.com/repos/${s.repo}/tarball/${r}`}},nu=async(u,t)=>{const s=rt(u),r=await _i(s,t,async()=>(await(await He(`https://gitlab.com/api/v4/projects/${encodeURIComponent(s.repo)}`)).json())?.default_branch);return{name:s.repo.replace("/","-"),version:r,subdir:s.subdir,headers:{...t.auth?{Authorization:`Bearer ${t.auth}`}:{},"sec-fetch-mode":"same-origin"},url:`https://gitlab.com/${s.repo}/tree/${r}${s.subdir}`,tar:`https://gitlab.com/${s.repo}/-/archive/${r}.tar.gz`}},uu=async(u,t)=>{const s=rt(u),r=await _i(s,t,async()=>(await(await He(`https://api.bitbucket.org/2.0/repositories/${s.repo}`)).json())?.mainbranch?.name);return{name:s.repo.replace("/","-"),version:r,subdir:s.subdir,headers:t.auth?{Authorization:`Bearer ${t.auth}`}:{},url:`https://bitbucket.com/${s.repo}/src/${r}${s.subdir}`,tar:`https://bitbucket.org/${s.repo}/get/${r}.tar.gz`}},ou=(u,t)=>{const s=rt(u),r=s.ref||"main";return{name:s.repo.replace("/","-"),version:r,subdir:s.subdir,headers:t.auth?{Authorization:`Bearer ${t.auth}`}:{},url:`https://git.sr.ht/~${s.repo}/tree/${r}/item${s.subdir}`,tar:`https://git.sr.ht/~${s.repo}/archive/${r}.tar.gz`}},au={http:pr,https:pr,github:Er,gh:Er,gitlab:nu,bitbucket:uu,sourcehut:ou};async function _i(u,t,s){if(u.ref)return u.ref;if(t.offline!==!0)try{const r=await s();if(r)return r}catch(r){wi(`Failed to fetch ref for ${u.repo}`,r)}return"main"}const hu=/^([\w-.]+):/;function lu(u,t,s){t||="github";let r=u;const i=u.match(hu);i&&(t=i[1],t!=="http"&&t!=="https"&&(r=u.slice(i[0].length)));const a=s?.[t]||au[t];return{source:r,providerName:t,provider:a}}async function cu(u,t,s={}){const r=t+".json",i=JSON.parse(await Oe.readFile(r,"utf8").catch(()=>"{}")),e=(await He(u,{...s,method:"HEAD"}).catch(()=>{}))?.headers.get("etag");if(i.etag===e&&Se.existsSync(t))return;typeof e=="string"&&(i.etag=e);const o=await He(u,{headers:s.headers});if(o.status>=400)throw new mr(`Failed to download ${u}: ${o.status} ${o.statusText}`);if(o.body==null)throw new mr(`Failed to download ${u}: empty response body`);await Oe.mkdir(we.dirname(t),{recursive:!0});const h=Se.createWriteStream(t);await Ri(Sr)(o.body,h),await Oe.writeFile(r,JSON.stringify(i),"utf8")}const Du=/^(?<repo>[\w\-.]+\/[\w\-.]+)(?<subdir>[^#]+)?(?<ref>#[\w\-./@]+)?/;function rt(u){const t=u.match(Du)?.groups||{};return{repo:t.repo,subdir:t.subdir||"/",ref:t.ref?.slice(1)}}function wi(...u){process.env.DEBUG&&console.debug("[giget]",...u)}async function He(u,t={}){t.headers?.["sec-fetch-mode"]&&(t.mode=t.headers["sec-fetch-mode"]);const s=await fetch(u,t).catch(r=>{throw new Error(`Failed to fetch ${u}`,{cause:r})});if(t.validateStatus&&s.status>=400)throw new Error(`Failed to fetch ${u}: ${s.status} ${s.statusText}`);return s}function fu(){return process.env.XDG_CACHE_HOME?we.resolve(process.env.XDG_CACHE_HOME,"bluwy-giget"):we.resolve(Ar.homedir(),".cache/bluwy-giget")}async function du(u,t,s){s==="/"&&(s=void 0),s&&(s.startsWith("/")&&(s=s.slice(1)),s.endsWith("/")||(s+="/"));let r=!1;if(await Oe.mkdir(t,{recursive:!0}),await tu.extract({file:u,cwd:t,onentry(i){i.path=i.path.split("/").splice(1).join("/"),s&&(i.path.startsWith(s)?(i.path=i.path.slice(s.length-1),r=!0):i.path="")}}),s&&!r)throw await Oe.rm(t,{recursive:!0,force:!0}),new su(`Subdirectory not found in tar: ${s}`)}async function mu(u,t={}){const{source:s,providerName:r,provider:i}=lu(u,t.provider,t.providers);if(!i)throw new iu(`Unsupported provider: ${r}`);const a={...t.providerOptions,offline:t.offline},e=await Promise.resolve().then(()=>i(s,a)).catch(m=>{throw new Error(`The ${r} provider failed with errors`,{cause:m})});e.name=(e.name||"template").replace(/[^\da-z-]/gi,"-"),e.defaultDir=(e.defaultDir||e.name).replace(/[^\da-z-]/gi,"-");const o=we.resolve(fu(),r,e.name),h=we.resolve(o,(e.version||e.name)+".tar.gz");if((t.offline==="prefer"?!Se.existsSync(h):!t.offline)&&(await cu(e.tar,h,{headers:e.headers}).catch(m=>{if(!Se.existsSync(h))throw m;wi("Download error. Using cached version:",m)}),wi(`Downloaded ${e.tar} to ${h}`)),!Se.existsSync(h))throw new Error(`Tarball not found: ${h} (offline: ${t.offline})`);const E=we.resolve(t.cwd||"."),y=we.resolve(E,t.dir||e.defaultDir);if(t.force==="clean")await Oe.rm(y,{recursive:!0,force:!0});else if(!t.force&&Se.existsSync(y)&&Se.readdirSync(y).length>0)throw new ru(`Destination ${y} already exists.`);return await du(h,y,e.subdir),{info:e,source:s,dir:y}}async function je({template:u,project:t}){await mu(`wrtnlabs/agentica.template.${u}`,{provider:"github",dir:t}),await _r(be(t,".github"),{force:!0,recursive:!0})}async function Ue({projectPath:u,dotEnvfileName:t,apiKeys:s}){if(!ot(u))throw new Error(`${u} directory does not exist.`);const r=be(u,t??".env"),i=(ot(r)?`
89
89
  `:"")+s.map(({key:a,value:e})=>`${a}=${e}`).join(`
90
- `);await wr(r,i)}function mu({packageManager:u,pkg:t}){switch(u){case"npm":return`npm install ${t??""}`;case"yarn":return t!=null?`yarn add ${t}`:"yarn";case"pnpm":return`pnpm install ${t??""}`;case"bun":return`bun install ${t??""}`;default:throw new Error(`Unsupported package manager: ${u}`)}}function pu({packageManager:u,command:t}){switch(u){case"npm":return`npm run ${t}`;case"yarn":return`yarn ${t}`;case"pnpm":return`pnpm ${t}`;case"bun":return`bun ${t}`;default:throw new Error(`Unsupported package manager: ${u}`)}}function Eu(){const u=ae.env.npm_config_user_agent;switch(!0){case u?.startsWith("npm"):return"npm";case u?.startsWith("yarn"):return"yarn";case u?.startsWith("pnpm"):return"pnpm";case u?.startsWith("bun"):return"bun";default:return"npm"}}async function ze({packageManager:u,projectAbsolutePath:t,services:s}){const r=s.length>0?[...s.map(e=>Tn(e))].join(" "):void 0,i=mu({packageManager:u,pkg:r}),a=rs();a.start("\u{1F4E6} Package installation in progress..."),await ps(i,{cwd:t}),a.stop("\u2705 Package installation completed")}async function vi({packageManager:u,projectAbsolutePath:t}){const s=pu({packageManager:u,command:"prepare"}),r=rs();r.start("\u{1F4E6} Package installation in progress..."),await ps(s,{cwd:t}),r.stop("\u2705 Package installation completed")}async function gu({template:u}){const t={template:u,services:[]};{const s=await Je({message:"Enter the project directory path:",placeholder:"./my-agentica-project",validate(i){if(i==="")return"Please enter a directory path";if(i[0]!==".")return"Please enter a relative path.";if(ot(i))return"Directory already exists"}});_e(s)&&ae.exit(0);const r=be(ae.cwd(),s);t.projectAbsolutePath=r}{const s=await ts({message:"Which package manager do you want to use?",initialValue:Eu(),options:[{value:"npm",label:"npm"},{value:"pnpm",label:"pnpm"},{value:"yarn",label:`yarn (${de.blueBright("berry is not supported")})`},{value:"bun",label:"bun"}]});_e(s)&&ae.exit(0),ce.info(`\u{1F4E6} Using ${s} as package manager`),t.packageManager=s}if(t.template==null){const s=await ts({message:"Which project type do you want to start?",options:[{value:"standalone",label:`Standalone ${de.blueBright("Agent Server")}`},{value:"nodejs",label:`NodeJS ${de.blueBright("Agent Server")}`},{value:"nestjs",label:`NestJS ${de.blueBright("Agent Server")}`},{value:"react",label:`React ${de.blueBright("Application")}`},{value:"react-native",label:`React Native ${de.blueBright("Application")}`},{value:"nestjs+react",label:`NestJS + React ${de.blueBright("Agent Server + Client Application")}`},{value:"nodejs+react",label:`NodeJS + React ${de.blueBright("Agent Server + Client Application")}`}]});_e(s)&&ae.exit(0),t.template=s}if(t.template!=="standalone"){const s=await Je({message:"Server Port(if project is client app, this port mean ws server port):",initialValue:"3000",validate(r){if(Number.isNaN(Number.parseInt(r)))return"Port must be an integer"}});_e(s)&&ae.exit(0),t.port=Number(s)}if(t.template!=="react"){const s=await In(),r=s.sort((h,E)=>h.displayName.localeCompare(E.displayName)).map(({displayName:h,serviceName:E})=>({label:h,value:E})),i=await Cn({message:`Which connectors do you want to include? (Press ${de.cyan("<space>")} to select, ${de.cyan("<a>")} to select all, ${de.cyan("<enter>")} to proceed)`,options:r,required:!1});_e(i)&&ae.exit(0),t.services=i;const a=Array.from(new Set(s.filter(h=>i.includes(h.serviceName)).flatMap(h=>h.envList))),e=await es({message:`Do you want to enter environment variables? (Number of environment variables to enter: ${a.length})
91
- ${de.cyan("If you press <ctrl+c>, you can skip this step.")}`,initialValue:!1}),o=[];if(_e(e)||!e)a.forEach(h=>{o.push({key:h,value:""})}),is("Skipping environment variables input.");else for(let h=0;h<a.length;h++){const E=a[h],y=await Je({message:`${E}: `,defaultValue:""});if(_e(y)){const m=a.splice(h);m.forEach(C=>{o.push({key:C,value:""})}),is(`Skipping environment variables input: ${m.slice(0,3).join(", ")}... (count: ${m.length})`);break}o.push({key:E,value:y})}t.envList=o}{const s=await es({message:"Enter your OpenAI API key?",initialValue:!1});if(_e(s)&&ae.exit(0),s){const r=await Je({message:"Please enter your OPENAI API key:"});_e(r)&&ae.exit(0),t.openAIKey=r}else t.openAIKey=null}try{(()=>{const s=h=>(h.packageManager==="npm"||h.packageManager==="yarn"||h.packageManager==="pnpm"||h.packageManager==="bun")&&typeof h.projectAbsolutePath=="string"&&(h.template==="nodejs"||h.template==="nestjs"||h.template==="react"||h.template==="react-native"||h.template==="standalone"||h.template==="nestjs+react"||h.template==="nodejs+react")&&(h.openAIKey===null||typeof h.openAIKey=="string")&&(h.port===void 0||typeof h.port=="number")&&Array.isArray(h.services)&&h.services.every(E=>typeof E=="string")&&(h.envList===void 0||Array.isArray(h.envList)&&h.envList.every(E=>typeof E=="object"&&E!==null&&r(E))),r=h=>typeof h.key=="string"&&typeof h.value=="string",i=(h,E,y=!0)=>(h.packageManager==="npm"||h.packageManager==="yarn"||h.packageManager==="pnpm"||h.packageManager==="bun"||re._assertGuard(y,{method:"typia.assertGuard",path:E+".packageManager",expected:'("bun" | "npm" | "pnpm" | "yarn")',value:h.packageManager},o))&&(typeof h.projectAbsolutePath=="string"||re._assertGuard(y,{method:"typia.assertGuard",path:E+".projectAbsolutePath",expected:"string",value:h.projectAbsolutePath},o))&&(h.template==="nodejs"||h.template==="nestjs"||h.template==="react"||h.template==="react-native"||h.template==="standalone"||h.template==="nestjs+react"||h.template==="nodejs+react"||re._assertGuard(y,{method:"typia.assertGuard",path:E+".template",expected:'("nestjs" | "nestjs+react" | "nodejs" | "nodejs+react" | "react" | "react-native" | "standalone")',value:h.template},o))&&(h.openAIKey===null||typeof h.openAIKey=="string"||re._assertGuard(y,{method:"typia.assertGuard",path:E+".openAIKey",expected:"(null | string)",value:h.openAIKey},o))&&(h.port===void 0||typeof h.port=="number"||re._assertGuard(y,{method:"typia.assertGuard",path:E+".port",expected:"(number | undefined)",value:h.port},o))&&((Array.isArray(h.services)||re._assertGuard(y,{method:"typia.assertGuard",path:E+".services",expected:"Array<string>",value:h.services},o))&&h.services.every((m,C)=>typeof m=="string"||re._assertGuard(y,{method:"typia.assertGuard",path:E+".services["+C+"]",expected:"string",value:m},o))||re._assertGuard(y,{method:"typia.assertGuard",path:E+".services",expected:"Array<string>",value:h.services},o))&&(h.envList===void 0||(Array.isArray(h.envList)||re._assertGuard(y,{method:"typia.assertGuard",path:E+".envList",expected:"(Array<__type> | undefined)",value:h.envList},o))&&h.envList.every((m,C)=>(typeof m=="object"&&m!==null||re._assertGuard(y,{method:"typia.assertGuard",path:E+".envList["+C+"]",expected:"__type.o1",value:m},o))&&a(m,E+".envList["+C+"]",y)||re._assertGuard(y,{method:"typia.assertGuard",path:E+".envList["+C+"]",expected:"__type.o1",value:m},o))||re._assertGuard(y,{method:"typia.assertGuard",path:E+".envList",expected:"(Array<__type> | undefined)",value:h.envList},o)),a=(h,E,y=!0)=>(typeof h.key=="string"||re._assertGuard(y,{method:"typia.assertGuard",path:E+".key",expected:"string",value:h.key},o))&&(typeof h.value=="string"||re._assertGuard(y,{method:"typia.assertGuard",path:E+".value",expected:"string",value:h.value},o)),e=h=>typeof h=="object"&&h!==null&&s(h);let o;return(h,E)=>{e(h)===!1&&(o=E,((y,m,C=!0)=>(typeof y=="object"&&y!==null||re._assertGuard(!0,{method:"typia.assertGuard",path:m+"",expected:"__type",value:y},o))&&i(y,m+"",!0)||re._assertGuard(!0,{method:"typia.assertGuard",path:m+"",expected:"__type",value:y},o))(h,"$input",!0))}})()(t)}catch(s){throw new Error(`\u274C ${s.toString()}`)}return t}async function Cu({projectAbsolutePath:u,context:t}){await He({template:"standalone",project:u}),ce.success("\u2705 Template downloaded");const s=xt(t.services),r=Bt(t.services),i=be(u,"src/index.ts"),a=await at(i,"utf-8"),e=Tt({content:a,importCode:s,connectorCode:r}),o=await Ot(e);await ht(i,o),await Ue({projectPath:u,apiKeys:[{key:"OPENAI_API_KEY",value:t.openAIKey??""},...t.envList??[]]}),ce.success("\u2705 .env created"),await ze({packageManager:t.packageManager,projectAbsolutePath:u,services:t.services}),await vi({packageManager:t.packageManager,projectAbsolutePath:u})}async function gr({projectAbsolutePath:u,context:t}){await He({template:"nodejs",project:u}),ce.success("\u2705 Template downloaded");const s=xt(t.services),r=Bt(t.services),i=be(u,"src/index.ts"),a=await at(i,"utf-8").then(h=>t.services.length===0?h:h.replace(/import \{ BbsArticleService \}.*;\n/g,"").replace(/controllers:\s*\[[\s\S]*?\],\n/,`controllers: [/// INSERT CONTROLLER HERE],
92
- `)),e=Tt({content:a,importCode:s,connectorCode:r}),o=await Ot(e);await ht(i,o),await Ue({projectPath:u,apiKeys:[{key:"OPENAI_API_KEY",value:t.openAIKey??""},{key:"PORT",value:t.port?.toString()??"3000"},...t.envList??[]]}),ce.success("\u2705 .env created"),await ze({packageManager:t.packageManager,projectAbsolutePath:u,services:t.services}),await vi({packageManager:t.packageManager,projectAbsolutePath:u})}async function Cr({projectAbsolutePath:u,context:t}){await He({template:"nestjs",project:u}),ce.success("\u2705 Template downloaded");const s=xt(t.services),r=Bt(t.services),i=be(u,"src/controllers/chat/ChatController.ts"),a=await at(i,"utf-8").then(h=>t.services.length===0?h:h.replace(/import \{ BbsArticleService \}.*;\n/g,"").replace(/controllers:\s*\[[\s\S]*?\],\n/,`controllers: [/// INSERT CONTROLLER HERE],
93
- `)),e=Tt({content:a,importCode:s,connectorCode:r}),o=await Ot(e);await ht(i,o),await Ue({projectPath:u,apiKeys:[{key:"OPENAI_API_KEY",value:t.openAIKey??""},{key:"API_PORT",value:t.port?.toString()??"3000"},...t.envList??[]]}),ce.success("\u2705 .env created"),await ze({packageManager:t.packageManager,projectAbsolutePath:u,services:t.services}),await vi({packageManager:t.packageManager,projectAbsolutePath:u})}async function Ai({projectAbsolutePath:u,context:t}){await He({template:"react",project:u}),ce.success("\u2705 Template downloaded"),await Ue({projectPath:u,apiKeys:[{key:"OPENAI_API_KEY",value:t.openAIKey??""},{key:"VITE_AGENTICA_WS_URL",value:`ws://localhost:${t.port}/chat`}]}),ce.success("\u2705 .env created"),await ze({packageManager:t.packageManager,projectAbsolutePath:u,services:t.services})}async function Fu({projectAbsolutePath:u,context:t}){await He({template:"react-native",project:u}),ce.success("\u2705 Template downloaded"),await Ue({projectPath:u,apiKeys:[{key:"OPENAI_API_KEY",value:t.openAIKey??""}]}),ce.success("\u2705 .env created"),await ze({packageManager:t.packageManager,projectAbsolutePath:u,services:t.services})}async function yu({template:u}){ss("Agentica Start Wizard");const t=await gu({template:u}),{projectAbsolutePath:s}=t;switch(t.template){case"standalone":await Cu({projectAbsolutePath:s,context:t});break;case"nodejs":await gr({projectAbsolutePath:s,context:t});break;case"nestjs":await Cr({projectAbsolutePath:s,context:t});break;case"react":await Ai({projectAbsolutePath:s,context:t});break;case"react-native":await Fu({projectAbsolutePath:s,context:t});break;case"nestjs+react":await Cr({projectAbsolutePath:be(s,"server"),context:t}),await Ai({projectAbsolutePath:be(s,"client"),context:t});break;case"nodejs+react":await gr({projectAbsolutePath:be(s,"server"),context:t}),await Ai({projectAbsolutePath:be(s,"client"),context:t});break;default:throw t.template,new Error(`\u274C Template ${t.template} not supported`)}Fn(`
90
+ `);await wr(r,i)}function pu({packageManager:u,pkg:t}){switch(u){case"npm":return`npm install ${t??""}`;case"yarn":return t!=null?`yarn add ${t}`:"yarn";case"pnpm":return`pnpm install ${t??""}`;case"bun":return`bun install ${t??""}`;default:throw new Error(`Unsupported package manager: ${u}`)}}function Eu({packageManager:u,command:t}){switch(u){case"npm":return`npm run ${t}`;case"yarn":return`yarn ${t}`;case"pnpm":return`pnpm ${t}`;case"bun":return`bun ${t}`;default:throw new Error(`Unsupported package manager: ${u}`)}}function gu(){const u=ae.env.npm_config_user_agent;switch(!0){case u?.startsWith("npm"):return"npm";case u?.startsWith("yarn"):return"yarn";case u?.startsWith("pnpm"):return"pnpm";case u?.startsWith("bun"):return"bun";default:return"npm"}}const Cu=["nodejs","nestjs","react","react-native","standalone","nestjs+react","nodejs+react"];async function ze({packageManager:u,projectAbsolutePath:t,services:s}){const r=s.length>0?[...s.map(e=>$n(e))].join(" "):void 0,i=pu({packageManager:u,pkg:r}),a=rs();a.start("\u{1F4E6} Package installation in progress..."),await ps(i,{cwd:t}),a.stop("\u2705 Package installation completed")}async function vi({packageManager:u,projectAbsolutePath:t}){const s=Eu({packageManager:u,command:"prepare"}),r=rs();r.start("\u{1F4E6} Package installation in progress..."),await ps(s,{cwd:t}),r.stop("\u2705 Package installation completed")}async function Fu({template:u}){const t={template:u,services:[]};{const s=await Je({message:"Enter the project directory path:",placeholder:"./my-agentica-project",validate(i){if(i==="")return"Please enter a directory path";if(i[0]!==".")return"Please enter a relative path.";if(ot(i))return"Directory already exists"}});_e(s)&&ae.exit(0);const r=be(ae.cwd(),s);t.projectAbsolutePath=r}{const s=await ts({message:"Which package manager do you want to use?",initialValue:gu(),options:[{value:"npm",label:"npm"},{value:"pnpm",label:"pnpm"},{value:"yarn",label:`yarn (${pe.blueBright("berry is not supported")})`},{value:"bun",label:"bun"}]});_e(s)&&ae.exit(0),fe.info(`\u{1F4E6} Using ${s} as package manager`),t.packageManager=s}if(t.template==null){const s=await ts({message:"Which project type do you want to start?",options:[{value:"standalone",label:`Standalone ${pe.blueBright("Agent Server")}`},{value:"nodejs",label:`NodeJS ${pe.blueBright("Agent Server")}`},{value:"nestjs",label:`NestJS ${pe.blueBright("Agent Server")}`},{value:"react",label:`React ${pe.blueBright("Application")}`},{value:"react-native",label:`React Native ${pe.blueBright("Application")}`},{value:"nestjs+react",label:`NestJS + React ${pe.blueBright("Agent Server + Client Application")}`},{value:"nodejs+react",label:`NodeJS + React ${pe.blueBright("Agent Server + Client Application")}`}]});_e(s)&&ae.exit(0),t.template=s}if(t.template!=="standalone"){const s=await Je({message:"Server Port(if project is client app, this port mean ws server port):",initialValue:"3000",validate(r){if(Number.isNaN(Number.parseInt(r)))return"Port must be an integer"}});_e(s)&&ae.exit(0),t.port=Number(s)}if(t.template!=="react"){const s=await Ln(),r=s.sort((h,E)=>h.displayName.localeCompare(E.displayName)).map(({displayName:h,serviceName:E})=>({label:h,value:E})),i=await Cn({message:`Which connectors do you want to include? (Press ${pe.cyan("<space>")} to select, ${pe.cyan("<a>")} to select all, ${pe.cyan("<enter>")} to proceed)`,options:r,required:!1});_e(i)&&ae.exit(0),t.services=i;const a=Array.from(new Set(s.filter(h=>i.includes(h.serviceName)).flatMap(h=>h.envList))),e=await es({message:`Do you want to enter environment variables? (Number of environment variables to enter: ${a.length})
91
+ ${pe.cyan("If you press <ctrl+c>, you can skip this step.")}`,initialValue:!1}),o=[];if(_e(e)||!e)a.forEach(h=>{o.push({key:h,value:""})}),is("Skipping environment variables input.");else for(let h=0;h<a.length;h++){const E=a[h],y=await Je({message:`${E}: `,defaultValue:""});if(_e(y)){const m=a.splice(h);m.forEach(C=>{o.push({key:C,value:""})}),is(`Skipping environment variables input: ${m.slice(0,3).join(", ")}... (count: ${m.length})`);break}o.push({key:E,value:y})}t.envList=o}{const s=await es({message:"Enter your OpenAI API key?",initialValue:!1});if(_e(s)&&ae.exit(0),s){const r=await Je({message:"Please enter your OPENAI API key:"});_e(r)&&ae.exit(0),t.openAIKey=r}else t.openAIKey=null}try{(()=>{const s=h=>(h.packageManager==="npm"||h.packageManager==="yarn"||h.packageManager==="pnpm"||h.packageManager==="bun")&&typeof h.projectAbsolutePath=="string"&&(h.template==="nodejs"||h.template==="nestjs"||h.template==="react"||h.template==="react-native"||h.template==="standalone"||h.template==="nestjs+react"||h.template==="nodejs+react")&&(h.openAIKey===null||typeof h.openAIKey=="string")&&(h.port===void 0||typeof h.port=="number")&&Array.isArray(h.services)&&h.services.every(E=>typeof E=="string")&&(h.envList===void 0||Array.isArray(h.envList)&&h.envList.every(E=>typeof E=="object"&&E!==null&&r(E))),r=h=>typeof h.key=="string"&&typeof h.value=="string",i=(h,E,y=!0)=>(h.packageManager==="npm"||h.packageManager==="yarn"||h.packageManager==="pnpm"||h.packageManager==="bun"||re._assertGuard(y,{method:"typia.assertGuard",path:E+".packageManager",expected:'("bun" | "npm" | "pnpm" | "yarn")',value:h.packageManager},o))&&(typeof h.projectAbsolutePath=="string"||re._assertGuard(y,{method:"typia.assertGuard",path:E+".projectAbsolutePath",expected:"string",value:h.projectAbsolutePath},o))&&(h.template==="nodejs"||h.template==="nestjs"||h.template==="react"||h.template==="react-native"||h.template==="standalone"||h.template==="nestjs+react"||h.template==="nodejs+react"||re._assertGuard(y,{method:"typia.assertGuard",path:E+".template",expected:'("nestjs" | "nestjs+react" | "nodejs" | "nodejs+react" | "react" | "react-native" | "standalone")',value:h.template},o))&&(h.openAIKey===null||typeof h.openAIKey=="string"||re._assertGuard(y,{method:"typia.assertGuard",path:E+".openAIKey",expected:"(null | string)",value:h.openAIKey},o))&&(h.port===void 0||typeof h.port=="number"||re._assertGuard(y,{method:"typia.assertGuard",path:E+".port",expected:"(number | undefined)",value:h.port},o))&&((Array.isArray(h.services)||re._assertGuard(y,{method:"typia.assertGuard",path:E+".services",expected:"Array<string>",value:h.services},o))&&h.services.every((m,C)=>typeof m=="string"||re._assertGuard(y,{method:"typia.assertGuard",path:E+".services["+C+"]",expected:"string",value:m},o))||re._assertGuard(y,{method:"typia.assertGuard",path:E+".services",expected:"Array<string>",value:h.services},o))&&(h.envList===void 0||(Array.isArray(h.envList)||re._assertGuard(y,{method:"typia.assertGuard",path:E+".envList",expected:"(Array<__type> | undefined)",value:h.envList},o))&&h.envList.every((m,C)=>(typeof m=="object"&&m!==null||re._assertGuard(y,{method:"typia.assertGuard",path:E+".envList["+C+"]",expected:"__type.o1",value:m},o))&&a(m,E+".envList["+C+"]",y)||re._assertGuard(y,{method:"typia.assertGuard",path:E+".envList["+C+"]",expected:"__type.o1",value:m},o))||re._assertGuard(y,{method:"typia.assertGuard",path:E+".envList",expected:"(Array<__type> | undefined)",value:h.envList},o)),a=(h,E,y=!0)=>(typeof h.key=="string"||re._assertGuard(y,{method:"typia.assertGuard",path:E+".key",expected:"string",value:h.key},o))&&(typeof h.value=="string"||re._assertGuard(y,{method:"typia.assertGuard",path:E+".value",expected:"string",value:h.value},o)),e=h=>typeof h=="object"&&h!==null&&s(h);let o;return(h,E)=>{e(h)===!1&&(o=E,((y,m,C=!0)=>(typeof y=="object"&&y!==null||re._assertGuard(!0,{method:"typia.assertGuard",path:m+"",expected:"__type",value:y},o))&&i(y,m+"",!0)||re._assertGuard(!0,{method:"typia.assertGuard",path:m+"",expected:"__type",value:y},o))(h,"$input",!0))}})()(t)}catch(s){throw new Error(`\u274C ${s.toString()}`)}return t}async function yu({projectAbsolutePath:u,context:t}){await je({template:"standalone",project:u}),fe.success("\u2705 Template downloaded");const s=xt(t.services),r=Bt(t.services),i=be(u,"src/index.ts"),a=await at(i,"utf-8"),e=Tt({content:a,importCode:s,connectorCode:r}),o=await Ot(e);await ht(i,o),await Ue({projectPath:u,apiKeys:[{key:"OPENAI_API_KEY",value:t.openAIKey??""},...t.envList??[]]}),fe.success("\u2705 .env created"),await ze({packageManager:t.packageManager,projectAbsolutePath:u,services:t.services}),await vi({packageManager:t.packageManager,projectAbsolutePath:u})}async function gr({projectAbsolutePath:u,context:t}){await je({template:"nodejs",project:u}),fe.success("\u2705 Template downloaded");const s=xt(t.services),r=Bt(t.services),i=be(u,"src/index.ts"),a=await at(i,"utf-8").then(h=>t.services.length===0?h:h.replace(/import \{ BbsArticleService \}.*;\n/g,"").replace(/controllers:\s*\[[\s\S]*?\],\n/,`controllers: [/// INSERT CONTROLLER HERE],
92
+ `)),e=Tt({content:a,importCode:s,connectorCode:r}),o=await Ot(e);await ht(i,o),await Ue({projectPath:u,apiKeys:[{key:"OPENAI_API_KEY",value:t.openAIKey??""},{key:"PORT",value:t.port?.toString()??"3000"},...t.envList??[]]}),fe.success("\u2705 .env created"),await ze({packageManager:t.packageManager,projectAbsolutePath:u,services:t.services}),await vi({packageManager:t.packageManager,projectAbsolutePath:u})}async function Cr({projectAbsolutePath:u,context:t}){await je({template:"nestjs",project:u}),fe.success("\u2705 Template downloaded");const s=xt(t.services),r=Bt(t.services),i=be(u,"src/controllers/chat/ChatController.ts"),a=await at(i,"utf-8").then(h=>t.services.length===0?h:h.replace(/import \{ BbsArticleService \}.*;\n/g,"").replace(/controllers:\s*\[[\s\S]*?\],\n/,`controllers: [/// INSERT CONTROLLER HERE],
93
+ `)),e=Tt({content:a,importCode:s,connectorCode:r}),o=await Ot(e);await ht(i,o),await Ue({projectPath:u,apiKeys:[{key:"OPENAI_API_KEY",value:t.openAIKey??""},{key:"API_PORT",value:t.port?.toString()??"3000"},...t.envList??[]]}),fe.success("\u2705 .env created"),await ze({packageManager:t.packageManager,projectAbsolutePath:u,services:t.services}),await vi({packageManager:t.packageManager,projectAbsolutePath:u})}async function Ai({projectAbsolutePath:u,context:t}){await je({template:"react",project:u}),fe.success("\u2705 Template downloaded"),await Ue({projectPath:u,apiKeys:[{key:"OPENAI_API_KEY",value:t.openAIKey??""},{key:"VITE_AGENTICA_WS_URL",value:`ws://localhost:${t.port}/chat`}]}),fe.success("\u2705 .env created"),await ze({packageManager:t.packageManager,projectAbsolutePath:u,services:t.services})}async function bu({projectAbsolutePath:u,context:t}){await je({template:"react-native",project:u}),fe.success("\u2705 Template downloaded"),await Ue({projectPath:u,apiKeys:[{key:"OPENAI_API_KEY",value:t.openAIKey??""}]}),fe.success("\u2705 .env created"),await ze({packageManager:t.packageManager,projectAbsolutePath:u,services:t.services})}async function _u({template:u}){ss("Agentica Start Wizard");const t=await Fu({template:u}),{projectAbsolutePath:s}=t;switch(t.template){case"standalone":await yu({projectAbsolutePath:s,context:t});break;case"nodejs":await gr({projectAbsolutePath:s,context:t});break;case"nestjs":await Cr({projectAbsolutePath:s,context:t});break;case"react":await Ai({projectAbsolutePath:s,context:t});break;case"react-native":await bu({projectAbsolutePath:s,context:t});break;case"nestjs+react":await Cr({projectAbsolutePath:be(s,"server"),context:t}),await Ai({projectAbsolutePath:be(s,"client"),context:t});break;case"nodejs+react":await gr({projectAbsolutePath:be(s,"server"),context:t}),await Ai({projectAbsolutePath:be(s,"client"),context:t});break;default:throw t.template,new Error(`\u274C Template ${t.template} not supported`)}Fn(`
94
94
  \u{1F389} Project ${s} created
95
- \u26A0\uFE0F ${de.yellow("Note:")} Please implement constructor values for each controller generated in index.ts
96
- `)}const bu="0.19.0",nt=new An;nt.version(bu),nt.command("start").description("Start a new project").option("-p, --project [nodejs|nestjs|react|nestjs+react|standalone]","The project type").action(async u=>{if(u.project===!0){ce.error(`
97
- \u274C The value of ${de.redBright("--project")} is required`);return}if(!(t=>t===void 0||t==="nodejs"||t==="nestjs"||t==="react"||t==="react-native"||t==="standalone"||t==="nestjs+react"||t==="nodejs+react")(u.project)){ce.error(`
98
- \u274C The value of ${de.redBright("--project")} is invalid`);return}ss(`\u{1F680} ${de.blueBright("Agentica")} Setup Wizard`),await yu({template:u.project})});function _u(){nt.parse(ae.argv)}export{nt as program,_u as run};
95
+ \u26A0\uFE0F ${pe.yellow("Note:")} Please implement constructor values for each controller generated in index.ts
96
+ `)}const wu="0.20.0",nt=new An;nt.version(wu),nt.command("start").description("Start a new project").addOption(new Sn("-p, --project <project>","The project type").choices(Cu)).action(async u=>{ss(`\u{1F680} ${pe.blueBright("Agentica")} Setup Wizard`),await _u({template:u.project})});function vu(){nt.parse(ae.argv)}export{nt as program,vu as run};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "agentica",
3
3
  "type": "module",
4
- "version": "0.19.0",
4
+ "version": "0.20.0",
5
5
  "description": "Agentic AI Library specialized in LLM Function Calling",
6
6
  "author": "Wrtn Technologies",
7
7
  "license": "MIT",