UNPKG

pkgroll

Version:
24 lines 90.1 kB
#!/usr/bin/env node var Tu=Object.defineProperty;var l=(e,t)=>Tu(e,"name",{value:t,configurable:!0});import _,{existsSync as Iu}from"node:fs";import Nu from"tty";import{watch as Ru,rollup as _u}from"rollup";import U from"node:fs/promises";import g,{resolve as Wu,isAbsolute as Lu,dirname as Mu,join as Uu}from"node:path";import{parse as Vu}from"yaml";import Y from"node:path/posix";import zu from"@rollup/plugin-node-resolve";import qu from"@rollup/plugin-commonjs";import Ju from"@rollup/plugin-json";import Ku from"@rollup/plugin-alias";import Gu from"@rollup/plugin-dynamic-import-vars";import{createFilter as Hu}from"@rollup/pluginutils";import{transform as ut}from"esbuild";import Yu,{builtinModules as Zu}from"node:module";import re from"magic-string";import Qu from"fs";import Xu from"os";import en from"path";import{attachScopes as tn}from"rollup-pluginutils";import"node:url";import{init as un,parse as nn}from"cjs-module-lexer";var rn=Object.defineProperty,j=l((e,t)=>rn(e,"name",{value:t,configurable:!0}),"a$1");const sn="known-flag",on="unknown-flag",an="argument",ln=/\B([A-Z])/g,Dn=j(e=>e.replaceAll(ln,"-$1").toLowerCase(),"camelToKebab"),{hasOwnProperty:cn}=Object.prototype,Z=j((e,t)=>cn.call(e,t),"hasOwn"),Ae=j(e=>typeof e=="function"?[e,!1]:Array.isArray(e)?[e[0],!0]:Ae(e.type),"parseFlagType"),nt=j((e,t)=>e===Boolean?t!=="false":t,"normalizeBoolean"),rt=j((e,t)=>typeof t=="boolean"?t:e===Number&&t===""?Number.NaN:e(t),"applyParser"),fn=/[\s.:=]/,pn=j(e=>{const t=`Flag name "${e}"`;if(e.length===0)throw new Error(`${t} cannot be empty`);if(e.length===1)throw new Error(`${t} must be longer than a character`);const n=e.match(fn);if(n)throw new Error(`${t} cannot contain "${n?.[0]}"`)},"validateFlagName"),$e=j((e,t,n)=>{if(Z(e,t))throw new Error(`Duplicate flags named "${t}"`);e[t]=n},"setFlag"),dn=j(e=>{const t={};for(const n in e){if(!Z(e,n))continue;pn(n);const u=e[n],r=[[],...Ae(u),u];$e(t,n,r);const s=Dn(n);if(n!==s&&$e(t,s,r),"alias"in u&&typeof u.alias=="string"){const{alias:o}=u,i=`Flag alias "${o}" for flag "${n}"`;if(o.length===0)throw new Error(`${i} cannot be empty`);if(o.length>1)throw new Error(`${i} must be a single character`);$e(t,o,r)}}return t},"createRegistry"),Fn=j((e,t)=>{const n={};for(const u in e){if(!Z(e,u))continue;const[r,,s,o]=t[u];if(r.length===0&&"default"in o){let{default:i}=o;typeof i=="function"&&(i=i()),n[u]=i}else n[u]=s?r:r.pop()}return n},"finalizeFlags"),se="--",hn=3,mn=/^-{1,2}\w/,st=j(e=>{if(!mn.test(e))return;const t=!e.startsWith(se);let n=e.slice(t?1:2),u,r=-1;for(const s of["=",":","."]){const o=n.indexOf(s);o!==-1&&(r===-1||o<r)&&(r=o)}return r!==-1&&(u=n.slice(r+1),n=n.slice(0,r)),[n,u,t]},"parseFlagArgv"),ot=j((e,{onFlag:t,onArgument:n})=>{let u;const r=j((s,o)=>{if(typeof u!="function")return!0;u(s,o),u=void 0},"triggerValueCallback");for(let s=0;s<e.length;s+=1){const o=e[s];if(o===se){r();const a=e.slice(s+1);n?.(a,[s],!0);break}const i=st(o);if(i){if(r(),!t)continue;const[a,D,c]=i;if(c)for(let F=0;F<a.length;F+=1){r();const f=F===a.length-1;u=t(a[F],f?D:void 0,[s,F+1,f])}else u=t(a,D,[s])}else r(o,[s])&&n?.([o],[s])}r()},"argvIterator"),it=j((e,t)=>{for(let n=t.length-1;n>=0;n-=1){const[u,r,s]=t[n];if(r){const o=e[u];let i=o.slice(0,r);if(s||(i+=o.slice(r+1)),i!=="-"){e[u]=i;continue}}e.splice(u,1)}},"spliceFromArgv"),gn=j((e,t=process.argv.slice(2),{ignore:n}={})=>{const u=[],r=dn(e),s={},o=[];return o[se]=[],ot(t,{onFlag(i,a,D){const c=(D.length===hn||i.length>1)&&Z(r,i);if(!n?.(c?sn:on,i,a)){if(c){const[F,f]=r[i],d=nt(f,a),C=j((m,w)=>{u.push(D),w&&u.push(w),F.push(rt(f,m||""))},"getFollowingValue");return d===void 0?C:C(d)}Z(s,i)||(s[i]=[]),s[i].push(a===void 0?!0:a),u.push(D)}},onArgument:j((i,a,D)=>{n?.(an,t[a[0]])||(o.push(...i),D?(o[se]=i,t.splice(a[0])):u.push(a))},"onArgument")}),it(t,u),{flags:Fn(e,r),unknownFlags:s,_:o}},"typeFlag");j((e,t,n=process.argv.slice(2))=>{const u=new Set(e.split(",").map(a=>st(a)?.[0])),[r,s]=Ae(t),o=[],i=[];return ot(n,{onFlag:j((a,D,c)=>{if(!u.has(a)||!s&&o.length>0)return;const F=nt(r,D),f=j((d,C)=>{i.push(c),C&&i.push(C),o.push(rt(r,d||""))},"getFollowingValue");return F===void 0?f:f(F)},"onFlag")}),it(n,i),s?o:o[0]},"getFlag");var Cn=Object.defineProperty,y=l((e,t)=>Cn(e,"name",{value:t,configurable:!0}),"n");const En=y(e=>{const t=process.stdout.columns??Number.POSITIVE_INFINITY;return typeof e=="function"&&(e=e(t)),e||(e={}),Array.isArray(e)?{columns:e,stdoutColumns:t}:{columns:e.columns??[],stdoutColumns:e.stdoutColumns??t}},"getOptions");function at({onlyFirst:e=!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,e?void 0:"g")}l(at,"j$1"),y(at,"ansiRegex");const yn=at();function xe(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(yn,"")}l(xe,"w$2"),y(xe,"stripAnsi");function lt(e){return e===161||e===164||e===167||e===168||e===170||e===173||e===174||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||e===198||e===208||e===215||e===216||e>=222&&e<=225||e===230||e>=232&&e<=234||e===236||e===237||e===240||e===242||e===243||e>=247&&e<=250||e===252||e===254||e===257||e===273||e===275||e===283||e===294||e===295||e===299||e>=305&&e<=307||e===312||e>=319&&e<=322||e===324||e>=328&&e<=331||e===333||e===338||e===339||e===358||e===359||e===363||e===462||e===464||e===466||e===468||e===470||e===472||e===474||e===476||e===593||e===609||e===708||e===711||e>=713&&e<=715||e===717||e===720||e>=728&&e<=731||e===733||e===735||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||e===1025||e>=1040&&e<=1103||e===1105||e===8208||e>=8211&&e<=8214||e===8216||e===8217||e===8220||e===8221||e>=8224&&e<=8226||e>=8228&&e<=8231||e===8240||e===8242||e===8243||e===8245||e===8251||e===8254||e===8308||e===8319||e>=8321&&e<=8324||e===8364||e===8451||e===8453||e===8457||e===8467||e===8470||e===8481||e===8482||e===8486||e===8491||e===8531||e===8532||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||e===8585||e>=8592&&e<=8601||e===8632||e===8633||e===8658||e===8660||e===8679||e===8704||e===8706||e===8707||e===8711||e===8712||e===8715||e===8719||e===8721||e===8725||e===8730||e>=8733&&e<=8736||e===8739||e===8741||e>=8743&&e<=8748||e===8750||e>=8756&&e<=8759||e===8764||e===8765||e===8776||e===8780||e===8786||e===8800||e===8801||e>=8804&&e<=8807||e===8810||e===8811||e===8814||e===8815||e===8834||e===8835||e===8838||e===8839||e===8853||e===8857||e===8869||e===8895||e===8978||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||e===9632||e===9633||e>=9635&&e<=9641||e===9650||e===9651||e===9654||e===9655||e===9660||e===9661||e===9664||e===9665||e>=9670&&e<=9672||e===9675||e>=9678&&e<=9681||e>=9698&&e<=9701||e===9711||e===9733||e===9734||e===9737||e===9742||e===9743||e===9756||e===9758||e===9792||e===9794||e===9824||e===9825||e>=9827&&e<=9829||e>=9831&&e<=9834||e===9836||e===9837||e===9839||e===9886||e===9887||e===9919||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||e===9955||e===9960||e===9961||e>=9963&&e<=9969||e===9972||e>=9974&&e<=9977||e===9979||e===9980||e===9982||e===9983||e===10045||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||e===65533||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||e===127375||e===127376||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109}l(lt,"P"),y(lt,"isAmbiguous");function Dt(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}l(Dt,"z$1"),y(Dt,"isFullWidth");function ct(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9776&&e<=9783||e>=9800&&e<=9811||e===9855||e>=9866&&e<=9871||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e===94192||e===94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}l(ct,"G$2"),y(ct,"isWide");function ft(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}l(ft,"Z$2"),y(ft,"validate");function pt(e,{ambiguousAsWide:t=!1}={}){return ft(e),Dt(e)||ct(e)||t&&lt(e)?2:1}l(pt,"V$2"),y(pt,"eastAsianWidth");var Bn=y(()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\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?|[\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](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\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-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g,"emojiRegex");const wn=new Intl.Segmenter,bn=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u");function W(e,t={}){if(typeof e!="string"||e.length===0)return 0;const{ambiguousIsNarrow:n=!0,countAnsiEscapeCodes:u=!1}=t;if(u||(e=xe(e)),e.length===0)return 0;let r=0;const s={ambiguousAsWide:!n};for(const{segment:o}of wn.segment(e)){const i=o.codePointAt(0);if(!(i<=31||i>=127&&i<=159)&&!(i>=8203&&i<=8207||i===65279)&&!(i>=768&&i<=879||i>=6832&&i<=6911||i>=7616&&i<=7679||i>=8400&&i<=8447||i>=65056&&i<=65071)&&!(i>=55296&&i<=57343)&&!(i>=65024&&i<=65039)&&!bn.test(o)){if(Bn().test(o)){r+=2;continue}r+=pt(i,s)}}return r}l(W,"d$1"),y(W,"stringWidth");const dt=y(e=>Math.max(...e.split(` `).map(t=>W(t))),"getLongestLineWidth"),vn=y(e=>{const t=[];for(const n of e){const{length:u}=n,r=u-t.length;for(let s=0;s<r;s+=1)t.push(0);for(let s=0;s<u;s+=1){const o=dt(n[s]);o>t[s]&&(t[s]=o)}}return t},"getColumnContentWidths"),Ft=/^\d+%$/,ht={width:"auto",align:"left",contentWidth:0,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,horizontalPadding:0,paddingLeftString:"",paddingRightString:""},An=y((e,t)=>{const n=[];for(let u=0;u<e.length;u+=1){const r=t[u]??"auto";if(typeof r=="number"||r==="auto"||r==="content-width"||typeof r=="string"&&Ft.test(r)){n.push({...ht,width:r,contentWidth:e[u]});continue}if(r&&typeof r=="object"){const s={...ht,...r,contentWidth:e[u]};s.horizontalPadding=s.paddingLeft+s.paddingRight,n.push(s);continue}throw new Error(`Invalid column width: ${JSON.stringify(r)}`)}return n},"initColumns"),$n=y((e,t)=>{for(const n of e){const{width:u}=n;if(u==="content-width"&&(n.width=n.contentWidth),u==="auto"){const a=Math.min(20,n.contentWidth);n.width=a,n.autoOverflow=n.contentWidth-a}if(typeof u=="string"&&Ft.test(u)){const a=Number.parseFloat(u.slice(0,-1))/100;n.width=Math.floor(t*a)-(n.paddingLeft+n.paddingRight)}const{horizontalPadding:r}=n,s=1,o=s+r;if(o>=t){const a=o-t,D=Math.ceil(n.paddingLeft/r*a),c=a-D;n.paddingLeft-=D,n.paddingRight-=c,n.horizontalPadding=n.paddingLeft+n.paddingRight}n.paddingLeftString=n.paddingLeft?" ".repeat(n.paddingLeft):"",n.paddingRightString=n.paddingRight?" ".repeat(n.paddingRight):"";const i=t-n.horizontalPadding;n.width=Math.max(Math.min(n.width,i),s)}},"resolveColumnWidths"),mt=y(()=>Object.assign([],{columns:0}),"makeRow"),xn=y((e,t)=>{const n=[mt()];let[u]=n;for(const r of e){const s=r.width+r.horizontalPadding;u.columns+s>t&&(u=mt(),n.push(u)),u.push(r),u.columns+=s}for(const r of n){const s=r.reduce((f,d)=>f+d.width+d.horizontalPadding,0);let o=t-s;if(o===0)continue;const i=r.filter(f=>"autoOverflow"in f),a=i.filter(f=>f.autoOverflow>0),D=a.reduce((f,d)=>f+d.autoOverflow,0),c=Math.min(D,o);for(const f of a){const d=Math.floor(f.autoOverflow/D*c);f.width+=d,o-=d}const F=Math.floor(o/i.length);for(let f=0;f<i.length;f+=1){const d=i[f];f===i.length-1?d.width+=o:d.width+=F,o-=F}}return n},"balanceAuto"),kn=y((e,t,n)=>{const u=An(n,t);return $n(u,e),xn(u,e)},"computeColumnWidths"),ke=10,gt=y((e=0)=>t=>`\x1B[${t+e}m`,"wrapAnsi16"),Ct=y((e=0)=>t=>`\x1B[${38+e};5;${t}m`,"wrapAnsi256"),Et=y((e=0)=>(t,n,u)=>`\x1B[${38+e};2;${t};${n};${u}m`,"wrapAnsi16m"),x={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(x.modifier);const jn=Object.keys(x.color),On=Object.keys(x.bgColor);[...jn,...On];function yt(){const e=new Map;for(const[t,n]of Object.entries(x)){for(const[u,r]of Object.entries(n))x[u]={open:`\x1B[${r[0]}m`,close:`\x1B[${r[1]}m`},n[u]=x[u],e.set(r[0],r[1]);Object.defineProperty(x,t,{value:n,enumerable:!1})}return Object.defineProperty(x,"codes",{value:e,enumerable:!1}),x.color.close="\x1B[39m",x.bgColor.close="\x1B[49m",x.color.ansi=gt(),x.color.ansi256=Ct(),x.color.ansi16m=Et(),x.bgColor.ansi=gt(ke),x.bgColor.ansi256=Ct(ke),x.bgColor.ansi16m=Et(ke),Object.defineProperties(x,{rgbToAnsi256:{value:y((t,n,u)=>t===n&&n===u?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(u/255*5),"value"),enumerable:!1},hexToRgb:{value:y(t=>{const n=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!n)return[0,0,0];let[u]=n;u.length===3&&(u=[...u].map(s=>s+s).join(""));const r=Number.parseInt(u,16);return[r>>16&255,r>>8&255,r&255]},"value"),enumerable:!1},hexToAnsi256:{value:y(t=>x.rgbToAnsi256(...x.hexToRgb(t)),"value"),enumerable:!1},ansi256ToAnsi:{value:y(t=>{if(t<8)return 30+t;if(t<16)return 90+(t-8);let n,u,r;if(t>=232)n=((t-232)*10+8)/255,u=n,r=n;else{t-=16;const i=t%36;n=Math.floor(t/36)/5,u=Math.floor(i/6)/5,r=i%6/5}const s=Math.max(n,u,r)*2;if(s===0)return 30;let o=30+(Math.round(r)<<2|Math.round(u)<<1|Math.round(n));return s===2&&(o+=60),o},"value"),enumerable:!1},rgbToAnsi:{value:y((t,n,u)=>x.ansi256ToAnsi(x.rgbToAnsi256(t,n,u)),"value"),enumerable:!1},hexToAnsi:{value:y(t=>x.ansi256ToAnsi(x.hexToAnsi256(t)),"value"),enumerable:!1}}),x}l(yt,"FD"),y(yt,"assembleStyles");const Sn=yt(),oe=new Set(["\x1B","\x9B"]),Pn=39,je="\x07",Bt="[",Tn="]",wt="m",ie=`${Tn}8;;`,bt=y(e=>`${oe.values().next().value}${Bt}${e}${wt}`,"wrapAnsiCode"),vt=y(e=>`${oe.values().next().value}${ie}${e}${je}`,"wrapAnsiHyperlink"),In=y(e=>e.split(" ").map(t=>W(t)),"wordLengths"),Oe=y((e,t,n)=>{const u=[...t];let r=!1,s=!1,o=W(xe(e.at(-1)));for(const[i,a]of u.entries()){const D=W(a);if(o+D<=n?e[e.length-1]+=a:(e.push(a),o=0),oe.has(a)&&(r=!0,s=u.slice(i+1,i+1+ie.length).join("")===ie),r){s?a===je&&(r=!1,s=!1):a===wt&&(r=!1);continue}o+=D,o===n&&i<u.length-1&&(e.push(""),o=0)}!o&&e.at(-1).length>0&&e.length>1&&(e[e.length-2]+=e.pop())},"wrapWord"),Nn=y(e=>{const t=e.split(" ");let n=t.length;for(;n>0&&!(W(t[n-1])>0);)n--;return n===t.length?e:t.slice(0,n).join(" ")+t.slice(n).join("")},"stringVisibleTrimSpacesRight"),Rn=y((e,t,n={})=>{if(n.trim!==!1&&e.trim()==="")return"";let u="",r,s;const o=In(e);let i=[""];for(const[F,f]of e.split(" ").entries()){n.trim!==!1&&(i[i.length-1]=i.at(-1).trimStart());let d=W(i.at(-1));if(F!==0&&(d>=t&&(n.wordWrap===!1||n.trim===!1)&&(i.push(""),d=0),(d>0||n.trim===!1)&&(i[i.length-1]+=" ",d++)),n.hard&&o[F]>t){const C=t-d,m=1+Math.floor((o[F]-C-1)/t);Math.floor((o[F]-1)/t)<m&&i.push(""),Oe(i,f,t);continue}if(d+o[F]>t&&d>0&&o[F]>0){if(n.wordWrap===!1&&d<t){Oe(i,f,t);continue}i.push("")}if(d+o[F]>t&&n.wordWrap===!1){Oe(i,f,t);continue}i[i.length-1]+=f}n.trim!==!1&&(i=i.map(F=>Nn(F)));const a=i.join(` `),D=[...a];let c=0;for(const[F,f]of D.entries()){if(u+=f,oe.has(f)){const{groups:C}=new RegExp(`(?:\\${Bt}(?<code>\\d+)m|\\${ie}(?<uri>.*)${je})`).exec(a.slice(c))||{groups:{}};if(C.code!==void 0){const m=Number.parseFloat(C.code);r=m===Pn?void 0:m}else C.uri!==void 0&&(s=C.uri.length===0?void 0:C.uri)}const d=Sn.codes.get(Number(r));D[F+1]===` `?(s&&(u+=vt("")),r&&d&&(u+=bt(d))):f===` `&&(r&&d&&(u+=bt(r)),s&&(u+=vt(s))),c+=f.length}return u},"exec");function At(e,t,n){return String(e).normalize().replaceAll(`\r `,` `).split(` `).map(u=>Rn(u,t,n)).join(` `)}l(At,"BD"),y(At,"wrapAnsi");const $t=y(e=>Array.from({length:e}).fill(""),"emptyLines"),_n=y((e,t)=>{const n=[];let u=0;for(const r of e){let s=0;const o=r.map(a=>{let D=t[u]??"";u+=1,a.preprocess&&(D=a.preprocess(D)),dt(D)>a.width&&(D=At(D,a.width,{hard:!0}));let c=D.split(` `);if(a.postprocess){const{postprocess:F}=a;c=c.map((f,d)=>F.call(a,f,d))}return a.paddingTop&&c.unshift(...$t(a.paddingTop)),a.paddingBottom&&c.push(...$t(a.paddingBottom)),c.length>s&&(s=c.length),{...a,lines:c}}),i=[];for(let a=0;a<s;a+=1){const D=o.map(c=>{const F=c.lines[a]??"",f=Number.isFinite(c.width)?" ".repeat(c.width-W(F)):"";let d=c.paddingLeftString;return c.align==="right"&&(d+=f),d+=F,c.align==="left"&&(d+=f),d+c.paddingRightString}).join("");i.push(D)}n.push(i.join(` `))}return n.join(` `)},"renderRow"),Wn=y((e,t)=>{if(!e||e.length===0)return"";const n=vn(e),u=n.length;if(u===0)return"";const{stdoutColumns:r,columns:s}=En(t);if(s.length>u)throw new Error(`${s.length} columns defined, but only ${u} columns found`);const o=kn(r,s,n);return e.map(i=>_n(o,i)).join(` `)},"terminalColumns"),Ln=["<",">","=",">=","<="],Mn=y(e=>{if(!Ln.includes(e))throw new TypeError(`Invalid breakpoint operator: ${e}`)},"assertOperator"),Un=y(e=>{const t=Object.keys(e).map(n=>{const[u,r]=n.split(" ");Mn(u);const s=Number.parseInt(r,10);if(Number.isNaN(s))throw new TypeError(`Invalid breakpoint value: ${r}`);const o=e[n];return{operator:u,breakpoint:s,value:o}}).sort((n,u)=>u.breakpoint-n.breakpoint);return n=>t.find(({operator:u,breakpoint:r})=>u==="="&&n===r||u===">"&&n>r||u==="<"&&n<r||u===">="&&n>=r||u==="<="&&n<=r)?.value},"breakpoints");var Vn=Object.defineProperty,A=l((e,t)=>Vn(e,"name",{value:t,configurable:!0}),"s$1");const zn=A(e=>e.replaceAll(/[\W_]([a-z\d])?/gi,(t,n)=>n?n.toUpperCase():""),"camelCase"),qn=A(e=>e.replaceAll(/\B([A-Z])/g,"-$1").toLowerCase(),"kebabCase"),Jn={"> 80":[{width:"content-width",paddingLeft:2,paddingRight:8},{width:"auto"}],"> 40":[{width:"auto",paddingLeft:2,paddingRight:8,preprocess:A(e=>e.trim(),"preprocess")},{width:"100%",paddingLeft:2,paddingBottom:1}],"> 0":{stdoutColumns:1e3,columns:[{width:"content-width",paddingLeft:2,paddingRight:8},{width:"content-width"}]}};function xt(e){let t=!1;return{type:"table",data:{tableData:Object.keys(e).sort((n,u)=>n.localeCompare(u)).map(n=>{const u=e[n],r="alias"in u;return r&&(t=!0),{name:n,flag:u,flagFormatted:`--${qn(n)}`,aliasesEnabled:t,aliasFormatted:r?`-${u.alias}`:void 0}}).map(n=>(n.aliasesEnabled=t,[{type:"flagName",data:n},{type:"flagDescription",data:n}])),tableBreakpoints:Jn}}}l(xt,"T"),A(xt,"renderFlags");const kt=A(e=>!e||(e.version??(e.help?e.help.version:void 0)),"getVersion"),jt=A(e=>{const t="parent"in e&&e.parent?.name;return(t?`${t} `:"")+e.name},"getName");function Ot(e){const t=[];e.name&&t.push(jt(e));const n=kt(e)??("parent"in e&&kt(e.parent));if(n&&t.push(`v${n}`),t.length!==0)return{id:"name",type:"text",data:`${t.join(" ")} `}}l(Ot,"k"),A(Ot,"getNameAndVersion");function St(e){const{help:t}=e;if(!(!t||!t.description))return{id:"description",type:"text",data:`${t.description} `}}l(St,"_$1"),A(St,"getDescription");function Pt(e){const t=e.help||{};if("usage"in t)return t.usage?{id:"usage",type:"section",data:{title:"Usage:",body:Array.isArray(t.usage)?t.usage.join(` `):t.usage}}:void 0;if(e.name){const n=[],u=[jt(e)];if(e.flags&&Object.keys(e.flags).length>0&&u.push("[flags...]"),e.parameters&&e.parameters.length>0){const{parameters:r}=e,s=r.indexOf("--"),o=s!==-1&&r.slice(s+1).some(i=>i.startsWith("<"));u.push(r.map(i=>i!=="--"?i:o?"--":"[--]").join(" "))}if(u.length>1&&n.push(u.join(" ")),"commands"in e&&e.commands?.length&&n.push(`${e.name} <command>`),n.length>0)return{id:"usage",type:"section",data:{title:"Usage:",body:n.join(` `)}}}}l(Pt,"F"),A(Pt,"getUsage");function Tt(e){return!("commands"in e)||!e.commands?.length?void 0:{id:"commands",type:"section",data:{title:"Commands:",body:{type:"table",data:{tableData:e.commands.map(t=>[t.options.name,t.options.help?t.options.help.description:""]),tableOptions:[{width:"content-width",paddingLeft:2,paddingRight:8}]}},indentBody:0}}}l(Tt,"H$1"),A(Tt,"getCommands");function It(e){if(!(!e.flags||Object.keys(e.flags).length===0))return{id:"flags",type:"section",data:{title:"Flags:",body:xt(e.flags),indentBody:0}}}l(It,"U"),A(It,"getFlags");function Nt(e){const{help:t}=e;if(!t||!t.examples||t.examples.length===0)return;let{examples:n}=t;if(Array.isArray(n)&&(n=n.join(` `)),n)return{id:"examples",type:"section",data:{title:"Examples:",body:n}}}l(Nt,"V$1"),A(Nt,"getExamples");function Rt(e){if(!("alias"in e)||!e.alias)return;const{alias:t}=e;return{id:"aliases",type:"section",data:{title:"Aliases:",body:Array.isArray(t)?t.join(", "):t}}}l(Rt,"J$1"),A(Rt,"getAliases");const Kn=A(e=>[Ot,St,Pt,Tt,It,Nt,Rt].map(t=>t(e)).filter(Boolean),"generateHelp"),Gn=Nu.WriteStream.prototype.hasColors();class Hn{static{l(this,"z")}static{A(this,"Renderers")}text(t){return t}bold(t){return Gn?`\x1B[1m${t}\x1B[22m`:t.toLocaleUpperCase()}indentText({text:t,spaces:n}){return t.replaceAll(/^/gm," ".repeat(n))}heading(t){return this.bold(t)}section({title:t,body:n,indentBody:u=2}){return`${(t?`${this.heading(t)} `:"")+(n?this.indentText({text:this.render(n),spaces:u}):"")} `}table({tableData:t,tableOptions:n,tableBreakpoints:u}){return Wn(t.map(r=>r.map(s=>this.render(s))),u?Un(u):n)}flagParameter(t){return t===Boolean?"":t===String?"<string>":t===Number?"<number>":Array.isArray(t)?this.flagParameter(t[0]):"<value>"}flagOperator(t){return" "}flagName(t){const{flag:n,flagFormatted:u,aliasesEnabled:r,aliasFormatted:s}=t;let o="";if(s?o+=`${s}, `:r&&(o+=" "),o+=u,"placeholder"in n&&typeof n.placeholder=="string")o+=`${this.flagOperator(t)}${n.placeholder}`;else{const i=this.flagParameter("type"in n?n.type:n);i&&(o+=`${this.flagOperator(t)}${i}`)}return o}flagDefault(t){return JSON.stringify(t)}flagDescription({flag:t}){let n="description"in t?t.description??"":"";if("default"in t){let{default:u}=t;typeof u=="function"&&(u=u()),u&&(n+=` (default: ${this.flagDefault(u)})`)}return n}render(t){if(typeof t=="string")return t;if(Array.isArray(t))return t.map(n=>this.render(n)).join(` `);if("type"in t&&this[t.type]){const n=this[t.type];if(typeof n=="function")return n.call(this,t.data)}throw new Error(`Invalid node type: ${JSON.stringify(t)}`)}}const Se=A(e=>e.length>0&&!e.includes(" "),"isValidScriptName"),{stringify:R}=JSON,Yn=/[|\\{}()[\]^$+*?.]/;function ae(e){const t=[];let n,u;for(const r of e){if(u)throw new Error(`Invalid parameter: Spread parameter ${R(u)} must be last`);const s=r[0],o=r.at(-1);let i;if(s==="<"&&o===">"&&(i=!0,n))throw new Error(`Invalid parameter: Required parameter ${R(r)} cannot come after optional parameter ${R(n)}`);if(s==="["&&o==="]"&&(i=!1,n=r),i===void 0)throw new Error(`Invalid parameter: ${R(r)}. Must be wrapped in <> (required parameter) or [] (optional parameter)`);let a=r.slice(1,-1);const D=a.slice(-3)==="...";D&&(u=r,a=a.slice(0,-3));const c=a.match(Yn);if(c)throw new Error(`Invalid parameter: ${R(r)}. Invalid character found ${R(c[0])}`);t.push({name:a,required:i,spread:D})}return t}l(ae,"b"),A(ae,"parseParameters");function le(e,t,n,u){for(let r=0;r<t.length;r+=1){const{name:s,required:o,spread:i}=t[r],a=zn(s);if(a in e)throw new Error(`Invalid parameter: ${R(s)} is used more than once.`);const D=i?n.slice(r):n[r];if(i&&(r=t.length),o&&(!D||i&&D.length===0))return console.error(`Error: Missing required parameter ${R(s)} `),u(),process.exit(1);e[a]=D}}l(le,"v$1"),A(le,"mapParametersToArguments");function _t(e){return e===void 0||e!==!1}l(_t,"G$1"),A(_t,"helpEnabled");function Pe(e,t,n,u){const r={...t.flags},s=t.version&&!("version"in r);s&&(r.version={type:Boolean,description:"Show version"});const{help:o}=t,i=_t(o);i&&!("help"in r)&&(r.help={type:Boolean,alias:"h",description:"Show help"});const a=gn(r,u,{ignore:t.ignoreArgv}),D=A(()=>{console.log(t.version)},"showVersion");if(s&&a.flags.version===!0)return D(),process.exit(0);const c=new Hn,F=i&&o?.render?o.render:m=>c.render(m),f=A(m=>{const w=Kn({...t,...m?{help:m}:{},flags:r});console.log(F(w,c))},"showHelp");if(i&&a.flags.help===!0)return f(),process.exit(0);if(t.parameters){let{parameters:m}=t,w=a._;const O=m.indexOf("--"),$=m.slice(O+1),p=Object.create(null);if(O>-1&&$.length>0){m=m.slice(0,O);const b=a._["--"];w=w.slice(0,-b.length||void 0),le(p,ae(m),w,f),le(p,ae($),b,f)}else le(p,ae(m),w,f);Object.assign(a._,p)}const d={...a,showVersion:D,showHelp:f},C={command:e,...d};if(typeof n=="function"){const m=n(d);if(m&&"then"in m)return Object.assign(Promise.resolve(m),C)}return C}l(Pe,"j"),A(Pe,"cliBase");function Wt(e,t){const n=new Map;for(const u of t){const r=[u.options.name],{alias:s}=u.options;s&&(Array.isArray(s)?r.push(...s):r.push(s));for(const o of r){if(n.has(o))throw new Error(`Duplicate command name found: ${R(o)}`);n.set(o,u)}}return n.get(e)}l(Wt,"K$1"),A(Wt,"getCommand");function Lt(e,t,n=process.argv.slice(2)){if(!e)throw new Error("Options is required");if("name"in e&&(!e.name||!Se(e.name)))throw new Error(`Invalid script name: ${R(e.name)}`);const u=n[0];if(e.commands&&u&&Se(u)){const r=Wt(u,e.commands);if(r)return Pe(r.options.name,{...r.options,parent:e},r.callback,n.slice(1))}return Pe(void 0,e,t,n)}l(Lt,"Q$1"),A(Lt,"cli");function Zn(e,t){if(!e)throw new Error("Command options are required");const{name:n}=e;if(n===void 0)throw new Error("Command name is required");if(!Se(n))throw new Error(`Invalid command name ${JSON.stringify(n)}. Command names must be one word.`);return{options:e,callback:t}}l(Zn,"X$1"),A(Zn,"command");var Qn="2.21.5";const L=l(e=>_.promises.access(e).then(()=>!0,()=>!1),"fsExists");let V=!0;const J=typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{};let Q=0;if(J.process&&J.process.env&&J.process.stdout){const{FORCE_COLOR:e,NODE_DISABLE_COLORS:t,NO_COLOR:n,TERM:u,COLORTERM:r}=J.process.env;t||n||e==="0"?V=!1:e==="1"||e==="2"||e==="3"?V=!0:u==="dumb"?V=!1:"CI"in J.process.env&&["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(s=>s in J.process.env)?V=!0:V=process.stdout.isTTY,V&&(process.platform==="win32"||r&&(r==="truecolor"||r==="24bit")?Q=3:u&&(u.endsWith("-256color")||u.endsWith("256"))?Q=2:Q=1)}let Mt={enabled:V,supportLevel:Q};function Xn(e,t,n=1){const u=`\x1B[${e}m`,r=`\x1B[${t}m`,s=new RegExp(`\\x1b\\[${t}m`,"g");return o=>Mt.enabled&&Mt.supportLevel>=n?u+(""+o).replace(s,u)+r:""+o}l(Xn,"kolorist");const er=Xn(2,22),De=l(e=>e.replaceAll("\\","/"),"slash"),P=l((e,t)=>(!g.isAbsolute(e)&&!e.startsWith(".")&&!e.startsWith("/")&&(e=`./${e}`),t&&!e.endsWith("/")&&(e+="/"),e),"normalizePath"),tr=l(()=>new Date().toLocaleTimeString(),"currentTime"),ce=l((...e)=>console.log(er(tr()),...e),"log"),ur=process.cwd(),fe=l(e=>P(g.relative(ur,e)),"formatPath"),nr=l(async e=>{const t=await U.readFile(e,"utf8");try{return Vu(t)}catch(n){throw new Error(`Failed to parse ${fe(e)}: ${n.message}`)}},"readPackageYaml"),Ut=l(async e=>{const t=await U.readFile(e,"utf8");try{return JSON.parse(t)}catch(n){throw new Error(`Failed to parse ${fe(e)}: ${n.message}`)}},"readPackageJson"),rr=l(async e=>{const t=g.join(e,"package.yaml");if(await L(t))return{packageJson:await nr(t),packageJsonPath:t};const n=g.join(e,"package.json");if(await L(n))return{packageJson:await Ut(n),packageJsonPath:n};throw new Error(`package.json not found at: ${n} (also checked for package.yaml)`)},"readPackage"),sr=l(e=>{let t=!1;if(e.includes("=")){const[n,u]=e.split("=");e=u,t=n==="bin"||n==="binary"}return{type:"legacy",source:"cli",outputPath:P(e),isExecutable:t}},"parseCliInputFlag"),or=l(({imports:e},t)=>{const n={};if(e)for(const u in e){if(u.startsWith("#"))continue;const r=e[u];typeof r=="string"&&(n[u]=g.join(t,r))}return n},"getAliases"),ir=l(e=>{const{publishConfig:t}=e;if(!t)return;const n=["bin","main","exports","types","module"];for(const u of n)t[u]&&(e[u]=t[u])},"applyPublishConfig"),z=l(e=>{if(e.endsWith(".mjs"))return"module";if(e.endsWith(".cjs"))return"commonjs";if(e.endsWith(".d.ts")||e.endsWith(".d.cts")||e.endsWith(".d.mts"))return"types"},"getFileType"),ar=l(e=>e[0]===".","isPath"),Vt=l(e=>e.slice(1).filter(t=>typeof t=="string"&&t[0]!=="."),"getConditions"),pe=l((e,t,n,u=[n])=>{if(!e)return[];if(typeof e=="string")return[{source:{type:"package.json",path:[...u]},type:n,conditions:[],format:z(e)||t,outputPath:P(e)}];if(Array.isArray(e))return e.flatMap((s,o)=>{const i=[...u,o];return typeof s=="string"?ar(s)?{source:{type:"package.json",path:[...i]},type:n,conditions:Vt(i),format:z(s)||t,outputPath:P(s)}:[]:pe(s,t,n,i)});const r=n==="imports"&&u.length===1;return Object.entries(e).flatMap(([s,o])=>{if(r&&s[0]!=="#")return[];const i=[...u,s];if(typeof o=="string"){const a=Vt(i),D={type:n,source:{type:"package.json",path:i},outputPath:P(o),conditions:a};return a.includes("types")?{...D,format:"types"}:{...D,format:z(o)||t}}return pe(o,t,n,i)})},"parsePackageMap"),lr=l((e,t)=>{const n=[],u=e.main;u&&n.push({source:{type:"package.json",path:["main"]},type:"legacy",format:z(u)??t,outputPath:P(u)});const r=e.module;r&&n.push({source:{type:"package.json",path:["module"]},type:"legacy",format:"module",outputPath:P(r)});const s=e.types;s&&n.push({source:{type:"package.json",path:["types"]},type:"legacy",format:"types",outputPath:P(s)});const{bin:o}=e;if(o)if(typeof o=="string")n.push({source:{type:"package.json",path:["bin"]},type:"binary",format:z(o)??t,outputPath:P(o)});else for(const[i,a]of Object.entries(o))n.push({source:{type:"package.json",path:["bin",i]},type:"binary",format:z(a)??t,outputPath:P(a)});if(e.exports){const i=pe(e.exports,t,"exports");n.push(...i)}if(e.imports){const i=pe(e.imports,t,"imports");n.push(...i)}return n},"getPkgEntryPoints"),Dr=l(async(e,t)=>{for(const n of t){const u=e+n;if(await L(u))return{srcExtension:n,sourcePath:u}}},"tryExtensions"),Te={".d.ts":[".d.ts",".d.mts",".d.cts",".ts",".tsx",".mts",".cts"],".d.mts":[".d.mts",".d.ts",".d.cts",".ts",".tsx",".mts",".cts"],".d.cts":[".d.cts",".d.ts",".d.mts",".ts",".tsx",".mts",".cts"],".js":[".js",".ts",".tsx",".mts",".cts"],".mjs":[".mjs",".js",".cjs",".mts",".cts",".ts",".tsx"],".cjs":[".cjs",".js",".mjs",".mts",".cts",".ts",".tsx"]},zt=Object.keys(Te),cr=l(async(e,t)=>{const{outputPath:n}=e,u=zt.find(o=>n.endsWith(o));if(!u)return{error:`Unsupported extension (must be ${zt.join("|")})`,exportEntry:e};const r=n.slice(t.dist.length,-u.length),s=await Dr(Y.join(t.srcResolved,r),Te[u]);return s?{exportEntry:e,distExtension:u,srcdist:t,...s}:{error:`Source file not found: ${Y.join(t.src,r)}(${Te[u].join("|")})`,exportEntry:e}},"getSourcePath"),fr=l(async e=>{try{return await U.readdir(e,{withFileTypes:!0})}catch(t){const{code:n}=t;if(n==="ENOENT")return[];throw t}},"safeReaddir"),qt=l(async(e,t)=>{const n=await fr(e);return(await Promise.all(n.map(async r=>{const s=Y.join(e,r.name);return r.isDirectory()?qt(s,t):r.isFile()?Y.relative(t,s):[]}))).flat()},"getDirectoryFilesRecursive"),Jt=new Map,Kt=l(async e=>{let t=Jt.get(e);return t||(t=qt(e,e),Jt.set(e,t)),t},"getDirectoryFiles"),de=/\.[^./]+$/,Gt=l((e,t)=>{const n=t.at(-1);if(!e.endsWith(n))return;if(t.some(r=>r.includes("/"))){const r=e.split("/").filter(Boolean);for(let s=1;s<=r.length;s+=1){const o=r.slice(0,s).join("/"),i=o+t.join(o);if(i===e)return i}}else for(let r=1;r<=e.length;r+=1){const s=e.slice(0,r),o=s+t.join(s);if(o===e)return o}},"extractWildcardMatch"),pr=l(async(e,t)=>{const n=Array.from(t).sort((r,s)=>s.dist.length-r.dist.length);return(await Promise.all(e.map(async r=>{if(typeof r.source=="string"||r.source.path[0]!=="exports"&&r.source.path[0]!=="imports"||!r.outputPath.includes("*"))return[r];const s=r.source.path[1];if(!s.includes("*"))return[r];const o=r.outputPath.match(/\.d\.[cm]?ts$/)||r.outputPath.match(de);if(!o)return[{exportEntry:r,error:`Wildcard pattern must include a file extension (e.g., ".mjs", ".cjs"). Pattern: ${s}`}];const[i]=o,a=r.outputPath.slice(0,-i.length),[D,...c]=a.split("*"),F=D.lastIndexOf("/"),f=F===-1?D:D.slice(0,F+1),d=F>=0?D.slice(F+1):"",C=l($=>{const p=$.replace(de,""),b=p.split("/").at(-1)||"";if(d&&!b.startsWith(d))return!1;if(c.length===1){const B=c[0];return!(B&&!(B.includes("/")?p:b).endsWith(B))}const k=d?b.slice(d.length):p;return!!Gt(k,c)},"matchesPattern");if(f==="./")return(await Promise.all(n.map(async p=>{const b=p.srcResolved;return(await Kt(b)).flatMap(B=>{if(!C(B))return[];const E=B.replace(de,"");return[{...r,outputPath:p.dist+E+i}]})}))).flat();const m=n.find(({dist:$})=>f===$||f.startsWith($));if(!m)return[];const w=g.posix.join(m.srcResolved,f.slice(m.dist.length));return(await Kt(w)).flatMap($=>{if(!C($))return[];const p=$.replace(de,"");if(c.length>1){const b=Gt(p,c);return[{...r,outputPath:f+b+i}]}return[{...r,outputPath:f+p+i}]})}))).flat()},"expandBuildOutputWildcards"),dr=l(async(e,t,n)=>{ir(t);const u=t.type??"commonjs",r=await pr(lr(t,u),e);n.length>0&&r.push(...n.map(o=>({...o,format:z(o.outputPath)??u})));const s=new Map;return await Promise.all(r.map(async o=>{if("error"in o)return o;const i=e.find(({dist:D})=>o.outputPath.startsWith(D));if(!i)return{exportEntry:o,error:"Ignoring file outside of dist directories"};const a=s.get(o.outputPath);if(a){if(a.format!==o.format)throw new Error(`Conflicting export types "${a.format}" & "${o.format}" found for ${o.outputPath}`)}else s.set(o.outputPath,o);return await cr(o,i)}))},"getBuildEntryPoints"),X=Symbol("entry"),Fr=l(e=>{const t=Hu(/\.([cm]?[jt]s|[jt]sx)$/);return{name:"esbuild-transform",transform:l(async(n,u)=>{if(!t(u))return null;const r=await ut(n,{...e,supported:{"import-meta":!0},loader:"default",sourcefile:u.replace(/\.[cm]ts/,".ts")});return{code:r.code,map:r.map||null}},"transform")}},"esbuildTransform"),hr=l(e=>{if(e==="es")return"esm";if(e==="cjs"||e==="iife")return e},"getEsbuildFormat"),mr=l(e=>({name:"esbuild-minify",renderChunk:l(async(t,n,u)=>{const r=await ut(t,{...e,format:hr(u.format),minify:!0,keepNames:!0});return{code:r.code,map:r.map||null}},"renderChunk")}),"esbuildMinify"),Ie=l((e,t)=>e[0]-t[0]||e[1]-t[1]||e[2]-t[2],"compareSemver"),Ht=l(({target:e})=>{const t=e.some(n=>{if(n=n.trim(),!n.startsWith("node"))return;const u=n.slice(4).split(".").map(Number),r=[u[0],u[1]??0,u[2]??0];return!(Ie(r,[12,20,0])>=0&&Ie(r,[13,0,0])<0||Ie(r,[14,13,1])>=0)});return{name:"node-builtins",resolveId:l(n=>{const u=n.startsWith("node:");if(t&&u&&(n=n.slice(5)),Zu.includes(n)||u)return{id:n,external:!0}},"resolveId")}},"nodeBuiltins"),gr=l(e=>{const t=e.filter(u=>u.exportEntry.type==="binary");if(t.length===0)return{name:"patch-binary"};let n;return{name:"patch-binary",options:l(()=>{n=new Set(t.flatMap(u=>u.inputNames))},"options"),renderChunk:l((u,r,s)=>{if(!r.isEntry||!r.facadeModuleId||!n.has(r.name))return;const o=new re(u);return o.prepend(`#!/usr/bin/env node `),{code:o.toString(),map:s.sourcemap?o.generateMap({hires:!0}):void 0}},"renderChunk"),writeBundle:l(async(u,r)=>{const s=new Set(Object.keys(r).map(o=>P(Y.join(u.dir,o))));await Promise.all(t.map(async({exportEntry:o})=>{const{outputPath:i}=o;s.has(i)&&await _.promises.chmod(i,493)}))},"writeBundle")}},"patchBinary"),Yt=l(e=>{const t=e.indexOf("/");if(t===-1)return[e,void 0];if(e[0]==="@"){con