pkgroll 2.26.2 → 2.27.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.
@@ -19,7 +19,7 @@ var Tu=Object.defineProperty;var c=(e,t)=>Tu(e,"name",{value:t,configurable:!0})
19
19
  `:"")+(u?this.indentText({text:this.render(u),spaces:n}):"")}
20
20
  `}table({tableData:t,tableOptions:u,tableBreakpoints:n}){return Nr(t.map(r=>r.map(s=>this.render(s))),n?Hr(n):u)}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:u,flagFormatted:n,aliasesEnabled:r,aliasFormatted:s}=t;let o="";if(s?o+=`${s}, `:r&&(o+=" "),o+=n,"placeholder"in u&&typeof u.placeholder=="string")o+=`${this.flagOperator(t)}${u.placeholder}`;else{const i=this.flagParameter("type"in u?u.type:u);i&&(o+=`${this.flagOperator(t)}${i}`)}return o}flagDefault(t){return JSON.stringify(t)}flagDescription({flag:t}){let u="description"in t?t.description??"":"";if("default"in t){let{default:n}=t;typeof n=="function"&&(n=n()),n&&(u+=` (default: ${this.flagDefault(n)})`)}return u}render(t){if(typeof t=="string")return t;if(Array.isArray(t))return t.map(u=>this.render(u)).join(`
21
21
  `);if("type"in t&&this[t.type]){const u=this[t.type];if(typeof u=="function")return u.call(this,t.data)}throw new Error(`Invalid node type: ${JSON.stringify(t)}`)}};const ft=I(e=>e.length>0&&!e.includes(" "),"isValidScriptName"),{stringify:Fe}=JSON,Zr=/[|\\{}()[\]^$+*?.]/;function pt(e){const t=[];let u,n;for(const r of e){if(n)throw new Error(`Invalid parameter: Spread parameter ${Fe(n)} must be last`);const s=r[0],o=r.at(-1);let i;if(s==="<"&&o===">"&&(i=!0,u))throw new Error(`Invalid parameter: Required parameter ${Fe(r)} cannot come after optional parameter ${Fe(u)}`);if(s==="["&&o==="]"&&(i=!1,u=r),i===void 0)throw new Error(`Invalid parameter: ${Fe(r)}. Must be wrapped in <> (required parameter) or [] (optional parameter)`);let a=r.slice(1,-1);const D=a.slice(-3)==="...";D&&(n=r,a=a.slice(0,-3));const f=a.match(Zr);if(f)throw new Error(`Invalid parameter: ${Fe(r)}. Invalid character found ${Fe(f[0])}`);t.push({name:a,required:i,spread:D})}return t}c(pt,"P$1"),I(pt,"parseParameters");function dt(e,t,u,n){for(let r=0;r<t.length;r+=1){const{name:s,required:o,spread:i}=t[r],a=Kr(s);if(a in e)throw new Error(`Invalid parameter: ${Fe(s)} is used more than once.`);const D=i?u.slice(r):u[r];if(i&&(r=t.length),o&&(!D||i&&D.length===0))return console.error(`Error: Missing required parameter ${Fe(s)}
22
- `),n(),process.exit(1);e[a]=D}}c(dt,"S"),I(dt,"mapParametersToArguments");function xn(e){return e!==!1}c(xn,"se$1"),I(xn,"helpEnabled");const Yr=I(e=>{const t=[];for(const[u,n]of Object.entries(e))if(t.push(u),n&&typeof n=="object"&&"alias"in n){const{alias:r}=n;typeof r=="string"&&r?t.push(r):Array.isArray(r)&&t.push(...r.filter(Boolean))}return t},"getKnownFlagNames"),es=I((e,t)=>{if(e.length<3||t.length===0)return;const u=qr(e,t);return Fn(e,u)<=2?u:void 0},"findClosestFlag"),ts=I((e,t)=>{const u=Object.keys(e);if(u.length!==0){for(const n of u){const r=es(n,t),s=r?` (Did you mean --${r}?)`:"";console.error(`Error: Unknown flag: --${n}.${s}`)}process.exit(1)}},"handleUnknownFlags");function ht(e,t,u,n){const r={...t.flags},s=t.version&&!("version"in r);s&&(r.version={type:Boolean,description:"Show version"});const{help:o}=t,i=xn(o);i&&!("help"in r)&&(r.help={type:Boolean,alias:"h",description:"Show help"});const a=gr(r,n,{ignore:t.ignoreArgv}),D=I(()=>{console.log(t.version)},"showVersion");if(s&&a.flags.version===!0)return D(),process.exit(0);const f=new Qr,p=i&&o?.render?o.render:E=>f.render(E),l=I(E=>{const A=Jr({...t,...E?{help:E}:{},flags:r});console.log(p(A,f))},"showHelp");if(i&&a.flags.help===!0)return l(),process.exit(0);if((t.strictFlags??t.parent?.strictFlags)&&ts(a.unknownFlags,Yr(r)),t.parameters){let{parameters:E}=t,A=a._;const _=E.indexOf("--"),x=E.slice(_+1),m=Object.create(null);let $=[];_>-1&&x.length>0&&(E=E.slice(0,_),$=a._["--"],A=A.slice(0,-$.length||void 0)),dt(m,pt(E),A,l),_>-1&&x.length>0&&dt(m,pt(x),$,l),Object.assign(a._,m)}const g={...a,showVersion:D,showHelp:l},C={command:e,...g};if(typeof u=="function"){const E=u(g);if(E&&"then"in E)return Object.assign(Promise.resolve(E),C)}return C}c(ht,"I$2"),I(ht,"cliBase");function $n(e,t){const u=new Map;for(const n of t){const r=[n.options.name],{alias:s}=n.options;s&&(Array.isArray(s)?r.push(...s):r.push(s));for(const o of r){if(u.has(o))throw new Error(`Duplicate command name found: ${Fe(o)}`);u.set(o,n)}}return u.get(e)}c($n,"ce$1"),I($n,"getCommand");function kn(e,t,u=process.argv.slice(2)){if(!e)throw new Error("Options is required");if("name"in e&&(!e.name||!ft(e.name)))throw new Error(`Invalid script name: ${Fe(e.name)}`);const n=u[0];if(e.commands&&n&&ft(n)){const r=$n(n,e.commands);if(r)return ht(r.options.name,{...r.options,parent:e},r.callback,u.slice(1))}return ht(void 0,e,t,u)}c(kn,"fe$1"),I(kn,"cli");function ns(e,t){if(!e)throw new Error("Command options are required");const{name:u}=e;if(u===void 0)throw new Error("Command name is required");if(!ft(u))throw new Error(`Invalid command name ${JSON.stringify(u)}. Command names must be one word.`);return{options:e,callback:t}}c(ns,"de$1"),I(ns,"command");var us="2.26.2",rs={version:us};const Ae=c(e=>he.promises.access(e).then(()=>!0,()=>!1),"fsExists");let Be=!0;const $e=typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{};let je=0;if($e.process&&$e.process.env&&$e.process.stdout){const{FORCE_COLOR:e,NODE_DISABLE_COLORS:t,NO_COLOR:u,TERM:n,COLORTERM:r}=$e.process.env;t||u||e==="0"?Be=!1:e==="1"||e==="2"||e==="3"?Be=!0:n==="dumb"?Be=!1:"CI"in $e.process.env&&["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(s=>s in $e.process.env)?Be=!0:Be=process.stdout.isTTY,Be&&(process.platform==="win32"||r&&(r==="truecolor"||r==="24bit")?je=3:n&&(n.endsWith("-256color")||n.endsWith("256"))?je=2:je=1)}let Rn={enabled:Be,supportLevel:je};function ss(e,t,u=1){const n=`\x1B[${e}m`,r=`\x1B[${t}m`,s=new RegExp(`\\x1b\\[${t}m`,"g");return o=>Rn.enabled&&Rn.supportLevel>=u?n+(""+o).replace(s,n)+r:""+o}c(ss,"kolorist");const os=ss(2,22),Ge=c(e=>e.replaceAll("\\","/"),"slash"),Y=c((e,t)=>(!b.isAbsolute(e)&&!e.startsWith(".")&&!e.startsWith("/")&&(e=`./${e}`),t&&!e.endsWith("/")&&(e+="/"),e),"normalizePath"),is=c(()=>new Date().toLocaleTimeString(),"currentTime"),ke=c((...e)=>console.log(os(is()),...e),"log"),as=process.cwd(),qe=c(e=>Y(b.relative(as,e)),"formatPath"),cs=c(async e=>{const t=await ue.readFile(e,"utf8");try{return Gu(t)}catch(u){throw new Error(`Failed to parse ${qe(e)}: ${u.message}`)}},"readPackageYaml"),_n=c(async e=>{const t=await ue.readFile(e,"utf8");try{return JSON.parse(t)}catch(u){throw new Error(`Failed to parse ${qe(e)}: ${u.message}`)}},"readPackageJson"),ls=c(async e=>{const t=b.join(e,"package.yaml");if(await Ae(t))return{packageJson:await cs(t),packageJsonPath:t};const u=b.join(e,"package.json");if(await Ae(u))return{packageJson:await _n(u),packageJsonPath:u};throw new Error(`package.json not found at: ${u} (also checked for package.yaml)`)},"readPackage"),Ds=c(e=>{let t=!1;if(e.includes("=")){const[u,n]=e.split("=");e=n,t=u==="bin"||u==="binary"}return{type:"legacy",source:"cli",outputPath:Y(e),isExecutable:t}},"parseCliInputFlag"),fs=c(({imports:e},t)=>{const u={};if(e)for(const n in e){if(n.startsWith("#"))continue;const r=e[n];typeof r=="string"&&(u[n]=b.join(t,r))}return u},"getAliases");function Sn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}c(Sn,"getDefaultExportFromCjs");var Ft={},gt,On;function Ke(){if(On)return gt;On=1;const e="\\\\/",t=`[^${e}]`,u="\\.",n="\\+",r="\\?",s="\\/",o="(?=.)",i="[^/]",a=`(?:${s}|$)`,D=`(?:^|${s})`,f=`${u}{1,2}${a}`,p=`(?!${u})`,l=`(?!${D}${f})`,g=`(?!${u}{0,1}${a})`,C=`(?!${f})`,E=`[^.${s}]`,A=`${i}*?`,x={DOT_LITERAL:u,PLUS_LITERAL:n,QMARK_LITERAL:r,SLASH_LITERAL:s,ONE_CHAR:o,QMARK:i,END_ANCHOR:a,DOTS_SLASH:f,NO_DOT:p,NO_DOTS:l,NO_DOT_SLASH:g,NO_DOTS_SLASH:C,QMARK_NO_DOT:E,STAR:A,START_ANCHOR:D,SEP:"/"},m={...x,SLASH_LITERAL:`[${e}]`,QMARK:t,STAR:`${t}*?`,DOTS_SLASH:`${u}{1,2}(?:[${e}]|$)`,NO_DOT:`(?!${u})`,NO_DOTS:`(?!(?:^|[${e}])${u}{1,2}(?:[${e}]|$))`,NO_DOT_SLASH:`(?!${u}{0,1}(?:[${e}]|$))`,NO_DOTS_SLASH:`(?!${u}{1,2}(?:[${e}]|$))`,QMARK_NO_DOT:`[^.${e}]`,START_ANCHOR:`(?:^|[${e}])`,END_ANCHOR:`(?:[${e}]|$)`,SEP:"\\"},$={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};return gt={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:$,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(B){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${B.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(B){return B===!0?m:x}},gt}c(Ke,"requireConstants");var Tn;function Ve(){return Tn||(Tn=1,(function(e){const{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:u,REGEX_SPECIAL_CHARS:n,REGEX_SPECIAL_CHARS_GLOBAL:r}=Ke();e.isObject=s=>s!==null&&typeof s=="object"&&!Array.isArray(s),e.hasRegexChars=s=>n.test(s),e.isRegexChar=s=>s.length===1&&e.hasRegexChars(s),e.escapeRegex=s=>s.replace(r,"\\$1"),e.toPosixSlashes=s=>s.replace(t,"/"),e.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){const s=navigator.platform.toLowerCase();return s==="win32"||s==="windows"}return typeof process<"u"&&process.platform?process.platform==="win32":!1},e.removeBackslashes=s=>s.replace(u,o=>o==="\\"?"":o),e.escapeLast=(s,o,i)=>{const a=s.lastIndexOf(o,i);return a===-1?s:s[a-1]==="\\"?e.escapeLast(s,o,a-1):`${s.slice(0,a)}\\${s.slice(a)}`},e.removePrefix=(s,o={})=>{let i=s;return i.startsWith("./")&&(i=i.slice(2),o.prefix="./"),i},e.wrapOutput=(s,o={},i={})=>{const a=i.contains?"":"^",D=i.contains?"":"$";let f=`${a}(?:${s})${D}`;return o.negated===!0&&(f=`(?:^(?!${f}).*$)`),f},e.basename=(s,{windows:o}={})=>{const i=s.split(o?/[\\/]/:"/"),a=i[i.length-1];return a===""?i[i.length-2]:a}})(Ft)),Ft}c(Ve,"requireUtils");var mt,jn;function ps(){if(jn)return mt;jn=1;const e=Ve(),{CHAR_ASTERISK:t,CHAR_AT:u,CHAR_BACKWARD_SLASH:n,CHAR_COMMA:r,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:o,CHAR_FORWARD_SLASH:i,CHAR_LEFT_CURLY_BRACE:a,CHAR_LEFT_PARENTHESES:D,CHAR_LEFT_SQUARE_BRACKET:f,CHAR_PLUS:p,CHAR_QUESTION_MARK:l,CHAR_RIGHT_CURLY_BRACE:g,CHAR_RIGHT_PARENTHESES:C,CHAR_RIGHT_SQUARE_BRACKET:E}=Ke(),A=c(m=>m===i||m===n,"isPathSeparator"),_=c(m=>{m.isPrefix!==!0&&(m.depth=m.isGlobstar?1/0:1)},"depth");return mt=c((m,$)=>{const B=$||{},R=m.length-1,k=B.parts===!0||B.scanToEnd===!0,q=[],M=[],De=[];let z=m,L=-1,G=0,T=0,U=!1,ee=!1,H=!1,ge=!1,re=!1,F=!1,J=!1,fe=!1,we=!1,d=!1,h=0,Ce,S,N={value:"",depth:0,isGlob:!1};const le=c(()=>L>=R,"eos"),pe=c(()=>z.charCodeAt(L+1),"peek"),te=c(()=>(Ce=S,z.charCodeAt(++L)),"advance");for(;L<R;){S=te();let se;if(S===n){J=N.backslashes=!0,S=te(),S===a&&(F=!0);continue}if(F===!0||S===a){for(h++;le()!==!0&&(S=te());){if(S===n){J=N.backslashes=!0,te();continue}if(S===a){h++;continue}if(F!==!0&&S===s&&(S=te())===s){if(U=N.isBrace=!0,H=N.isGlob=!0,d=!0,k===!0)continue;break}if(F!==!0&&S===r){if(U=N.isBrace=!0,H=N.isGlob=!0,d=!0,k===!0)continue;break}if(S===g&&(h--,h===0)){F=!1,U=N.isBrace=!0,d=!0;break}}if(k===!0)continue;break}if(S===i){if(q.push(L),M.push(N),N={value:"",depth:0,isGlob:!1},d===!0)continue;if(Ce===s&&L===G+1){G+=2;continue}T=L+1;continue}if(B.noext!==!0&&(S===p||S===u||S===t||S===l||S===o)===!0&&pe()===D){if(H=N.isGlob=!0,ge=N.isExtglob=!0,d=!0,S===o&&L===G&&(we=!0),k===!0){for(;le()!==!0&&(S=te());){if(S===n){J=N.backslashes=!0,S=te();continue}if(S===C){H=N.isGlob=!0,d=!0;break}}continue}break}if(S===t){if(Ce===t&&(re=N.isGlobstar=!0),H=N.isGlob=!0,d=!0,k===!0)continue;break}if(S===l){if(H=N.isGlob=!0,d=!0,k===!0)continue;break}if(S===f){for(;le()!==!0&&(se=te());){if(se===n){J=N.backslashes=!0,te();continue}if(se===E){ee=N.isBracket=!0,H=N.isGlob=!0,d=!0;break}}if(k===!0)continue;break}if(B.nonegate!==!0&&S===o&&L===G){fe=N.negated=!0,G++;continue}if(B.noparen!==!0&&S===D){if(H=N.isGlob=!0,k===!0){for(;le()!==!0&&(S=te());){if(S===D){J=N.backslashes=!0,S=te();continue}if(S===C){d=!0;break}}continue}break}if(H===!0){if(d=!0,k===!0)continue;break}}B.noext===!0&&(ge=!1,H=!1);let Z=z,Ee="",ie="";G>0&&(Ee=z.slice(0,G),z=z.slice(G),T-=G),Z&&H===!0&&T>0?(Z=z.slice(0,T),ie=z.slice(T)):H===!0?(Z="",ie=z):Z=z,Z&&Z!==""&&Z!=="/"&&Z!==z&&A(Z.charCodeAt(Z.length-1))&&(Z=Z.slice(0,-1)),B.unescape===!0&&(ie&&(ie=e.removeBackslashes(ie)),Z&&J===!0&&(Z=e.removeBackslashes(Z)));const O={prefix:Ee,input:m,start:G,base:Z,glob:ie,isBrace:U,isBracket:ee,isGlob:H,isExtglob:ge,isGlobstar:re,negated:fe,negatedExtglob:we};if(B.tokens===!0&&(O.maxDepth=0,A(S)||M.push(N),O.tokens=M),B.parts===!0||B.tokens===!0){let se;for(let ne=0;ne<q.length;ne++){const w=se?se+1:G,W=q[ne],y=m.slice(w,W);B.tokens&&(ne===0&&G!==0?(M[ne].isPrefix=!0,M[ne].value=Ee):M[ne].value=y,_(M[ne]),O.maxDepth+=M[ne].depth),(ne!==0||y!=="")&&De.push(y),se=W}if(se&&se+1<m.length){const ne=m.slice(se+1);De.push(ne),B.tokens&&(M[M.length-1].value=ne,_(M[M.length-1]),O.maxDepth+=M[M.length-1].depth)}O.slashes=q,O.parts=De}return O},"scan"),mt}c(ps,"requireScan");var Ct,Pn;function ds(){if(Pn)return Ct;Pn=1;const e=Ke(),t=Ve(),{MAX_LENGTH:u,POSIX_REGEX_SOURCE:n,REGEX_NON_SPECIAL_CHARS:r,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:o}=e,i=c((f,p)=>{if(typeof p.expandRange=="function")return p.expandRange(...f,p);f.sort();const l=`[${f.join("-")}]`;try{new RegExp(l)}catch{return f.map(C=>t.escapeRegex(C)).join("..")}return l},"expandRange"),a=c((f,p)=>`Missing ${f}: "${p}" - use "\\\\${p}" to match literal characters`,"syntaxError"),D=c((f,p)=>{if(typeof f!="string")throw new TypeError("Expected a string");f=o[f]||f;const l={...p},g=typeof l.maxLength=="number"?Math.min(u,l.maxLength):u;let C=f.length;if(C>g)throw new SyntaxError(`Input length: ${C}, exceeds maximum allowed length: ${g}`);const E={type:"bos",value:"",output:l.prepend||""},A=[E],_=l.capture?"":"?:",x=e.globChars(l.windows),m=e.extglobChars(x),{DOT_LITERAL:$,PLUS_LITERAL:B,SLASH_LITERAL:R,ONE_CHAR:k,DOTS_SLASH:q,NO_DOT:M,NO_DOT_SLASH:De,NO_DOTS_SLASH:z,QMARK:L,QMARK_NO_DOT:G,STAR:T,START_ANCHOR:U}=x,ee=c(w=>`(${_}(?:(?!${U}${w.dot?q:$}).)*?)`,"globstar"),H=l.dot?"":M,ge=l.dot?L:G;let re=l.bash===!0?ee(l):T;l.capture&&(re=`(${re})`),typeof l.noext=="boolean"&&(l.noextglob=l.noext);const F={input:f,index:-1,start:0,dot:l.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:A};f=t.removePrefix(f,F),C=f.length;const J=[],fe=[],we=[];let d=E,h;const Ce=c(()=>F.index===C-1,"eos"),S=F.peek=(w=1)=>f[F.index+w],N=F.advance=()=>f[++F.index]||"",le=c(()=>f.slice(F.index+1),"remaining"),pe=c((w="",W=0)=>{F.consumed+=w,F.index+=W},"consume"),te=c(w=>{F.output+=w.output!=null?w.output:w.value,pe(w.value)},"append"),Z=c(()=>{let w=1;for(;S()==="!"&&(S(2)!=="("||S(3)==="?");)N(),F.start++,w++;return w%2===0?!1:(F.negated=!0,F.start++,!0)},"negate"),Ee=c(w=>{F[w]++,we.push(w)},"increment"),ie=c(w=>{F[w]--,we.pop()},"decrement"),O=c(w=>{if(d.type==="globstar"){const W=F.braces>0&&(w.type==="comma"||w.type==="brace"),y=w.extglob===!0||J.length&&(w.type==="pipe"||w.type==="paren");w.type!=="slash"&&w.type!=="paren"&&!W&&!y&&(F.output=F.output.slice(0,-d.output.length),d.type="star",d.value="*",d.output=re,F.output+=d.output)}if(J.length&&w.type!=="paren"&&(J[J.length-1].inner+=w.value),(w.value||w.output)&&te(w),d&&d.type==="text"&&w.type==="text"){d.output=(d.output||d.value)+w.value,d.value+=w.value;return}w.prev=d,A.push(w),d=w},"push"),se=c((w,W)=>{const y={...m[W],conditions:1,inner:""};y.prev=d,y.parens=F.parens,y.output=F.output;const P=(l.capture?"(":"")+y.open;Ee("parens"),O({type:w,value:W,output:F.output?"":k}),O({type:"paren",extglob:!0,value:N(),output:P}),J.push(y)},"extglobOpen"),ne=c(w=>{let W=w.close+(l.capture?")":""),y;if(w.type==="negate"){let P=re;if(w.inner&&w.inner.length>1&&w.inner.includes("/")&&(P=ee(l)),(P!==re||Ce()||/^\)+$/.test(le()))&&(W=w.close=`)$))${P}`),w.inner.includes("*")&&(y=le())&&/^\.[^\\/.]+$/.test(y)){const V=D(y,{...p,fastpaths:!1}).output;W=w.close=`)${V})${P})`}w.prev.type==="bos"&&(F.negatedExtglob=!0)}O({type:"paren",extglob:!0,value:h,output:W}),ie("parens")},"extglobClose");if(l.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(f)){let w=!1,W=f.replace(s,(y,P,V,oe,X,st)=>oe==="\\"?(w=!0,y):oe==="?"?P?P+oe+(X?L.repeat(X.length):""):st===0?ge+(X?L.repeat(X.length):""):L.repeat(V.length):oe==="."?$.repeat(V.length):oe==="*"?P?P+oe+(X?re:""):re:P?y:`\\${y}`);return w===!0&&(l.unescape===!0?W=W.replace(/\\/g,""):W=W.replace(/\\+/g,y=>y.length%2===0?"\\\\":y?"\\":"")),W===f&&l.contains===!0?(F.output=f,F):(F.output=t.wrapOutput(W,F,p),F)}for(;!Ce();){if(h=N(),h==="\0")continue;if(h==="\\"){const y=S();if(y==="/"&&l.bash!==!0||y==="."||y===";")continue;if(!y){h+="\\",O({type:"text",value:h});continue}const P=/^\\+/.exec(le());let V=0;if(P&&P[0].length>2&&(V=P[0].length,F.index+=V,V%2!==0&&(h+="\\")),l.unescape===!0?h=N():h+=N(),F.brackets===0){O({type:"text",value:h});continue}}if(F.brackets>0&&(h!=="]"||d.value==="["||d.value==="[^")){if(l.posix!==!1&&h===":"){const y=d.value.slice(1);if(y.includes("[")&&(d.posix=!0,y.includes(":"))){const P=d.value.lastIndexOf("["),V=d.value.slice(0,P),oe=d.value.slice(P+2),X=n[oe];if(X){d.value=V+X,F.backtrack=!0,N(),!E.output&&A.indexOf(d)===1&&(E.output=k);continue}}}(h==="["&&S()!==":"||h==="-"&&S()==="]")&&(h=`\\${h}`),h==="]"&&(d.value==="["||d.value==="[^")&&(h=`\\${h}`),l.posix===!0&&h==="!"&&d.value==="["&&(h="^"),d.value+=h,te({value:h});continue}if(F.quotes===1&&h!=='"'){h=t.escapeRegex(h),d.value+=h,te({value:h});continue}if(h==='"'){F.quotes=F.quotes===1?0:1,l.keepQuotes===!0&&O({type:"text",value:h});continue}if(h==="("){Ee("parens"),O({type:"paren",value:h});continue}if(h===")"){if(F.parens===0&&l.strictBrackets===!0)throw new SyntaxError(a("opening","("));const y=J[J.length-1];if(y&&F.parens===y.parens+1){ne(J.pop());continue}O({type:"paren",value:h,output:F.parens?")":"\\)"}),ie("parens");continue}if(h==="["){if(l.nobracket===!0||!le().includes("]")){if(l.nobracket!==!0&&l.strictBrackets===!0)throw new SyntaxError(a("closing","]"));h=`\\${h}`}else Ee("brackets");O({type:"bracket",value:h});continue}if(h==="]"){if(l.nobracket===!0||d&&d.type==="bracket"&&d.value.length===1){O({type:"text",value:h,output:`\\${h}`});continue}if(F.brackets===0){if(l.strictBrackets===!0)throw new SyntaxError(a("opening","["));O({type:"text",value:h,output:`\\${h}`});continue}ie("brackets");const y=d.value.slice(1);if(d.posix!==!0&&y[0]==="^"&&!y.includes("/")&&(h=`/${h}`),d.value+=h,te({value:h}),l.literalBrackets===!1||t.hasRegexChars(y))continue;const P=t.escapeRegex(d.value);if(F.output=F.output.slice(0,-d.value.length),l.literalBrackets===!0){F.output+=P,d.value=P;continue}d.value=`(${_}${P}|${d.value})`,F.output+=d.value;continue}if(h==="{"&&l.nobrace!==!0){Ee("braces");const y={type:"brace",value:h,output:"(",outputIndex:F.output.length,tokensIndex:F.tokens.length};fe.push(y),O(y);continue}if(h==="}"){const y=fe[fe.length-1];if(l.nobrace===!0||!y){O({type:"text",value:h,output:h});continue}let P=")";if(y.dots===!0){const V=A.slice(),oe=[];for(let X=V.length-1;X>=0&&(A.pop(),V[X].type!=="brace");X--)V[X].type!=="dots"&&oe.unshift(V[X].value);P=i(oe,l),F.backtrack=!0}if(y.comma!==!0&&y.dots!==!0){const V=F.output.slice(0,y.outputIndex),oe=F.tokens.slice(y.tokensIndex);y.value=y.output="\\{",h=P="\\}",F.output=V;for(const X of oe)F.output+=X.output||X.value}O({type:"brace",value:h,output:P}),ie("braces"),fe.pop();continue}if(h==="|"){J.length>0&&J[J.length-1].conditions++,O({type:"text",value:h});continue}if(h===","){let y=h;const P=fe[fe.length-1];P&&we[we.length-1]==="braces"&&(P.comma=!0,y="|"),O({type:"comma",value:h,output:y});continue}if(h==="/"){if(d.type==="dot"&&F.index===F.start+1){F.start=F.index+1,F.consumed="",F.output="",A.pop(),d=E;continue}O({type:"slash",value:h,output:R});continue}if(h==="."){if(F.braces>0&&d.type==="dot"){d.value==="."&&(d.output=$);const y=fe[fe.length-1];d.type="dots",d.output+=h,d.value+=h,y.dots=!0;continue}if(F.braces+F.parens===0&&d.type!=="bos"&&d.type!=="slash"){O({type:"text",value:h,output:$});continue}O({type:"dot",value:h,output:$});continue}if(h==="?"){if(!(d&&d.value==="(")&&l.noextglob!==!0&&S()==="("&&S(2)!=="?"){se("qmark",h);continue}if(d&&d.type==="paren"){const P=S();let V=h;(d.value==="("&&!/[!=<:]/.test(P)||P==="<"&&!/<([!=]|\w+>)/.test(le()))&&(V=`\\${h}`),O({type:"text",value:h,output:V});continue}if(l.dot!==!0&&(d.type==="slash"||d.type==="bos")){O({type:"qmark",value:h,output:G});continue}O({type:"qmark",value:h,output:L});continue}if(h==="!"){if(l.noextglob!==!0&&S()==="("&&(S(2)!=="?"||!/[!=<:]/.test(S(3)))){se("negate",h);continue}if(l.nonegate!==!0&&F.index===0){Z();continue}}if(h==="+"){if(l.noextglob!==!0&&S()==="("&&S(2)!=="?"){se("plus",h);continue}if(d&&d.value==="("||l.regex===!1){O({type:"plus",value:h,output:B});continue}if(d&&(d.type==="bracket"||d.type==="paren"||d.type==="brace")||F.parens>0){O({type:"plus",value:h});continue}O({type:"plus",value:B});continue}if(h==="@"){if(l.noextglob!==!0&&S()==="("&&S(2)!=="?"){O({type:"at",extglob:!0,value:h,output:""});continue}O({type:"text",value:h});continue}if(h!=="*"){(h==="$"||h==="^")&&(h=`\\${h}`);const y=r.exec(le());y&&(h+=y[0],F.index+=y[0].length),O({type:"text",value:h});continue}if(d&&(d.type==="globstar"||d.star===!0)){d.type="star",d.star=!0,d.value+=h,d.output=re,F.backtrack=!0,F.globstar=!0,pe(h);continue}let w=le();if(l.noextglob!==!0&&/^\([^?]/.test(w)){se("star",h);continue}if(d.type==="star"){if(l.noglobstar===!0){pe(h);continue}const y=d.prev,P=y.prev,V=y.type==="slash"||y.type==="bos",oe=P&&(P.type==="star"||P.type==="globstar");if(l.bash===!0&&(!V||w[0]&&w[0]!=="/")){O({type:"star",value:h,output:""});continue}const X=F.braces>0&&(y.type==="comma"||y.type==="brace"),st=J.length&&(y.type==="pipe"||y.type==="paren");if(!V&&y.type!=="paren"&&!X&&!st){O({type:"star",value:h,output:""});continue}for(;w.slice(0,3)==="/**";){const Ie=f[F.index+4];if(Ie&&Ie!=="/")break;w=w.slice(3),pe("/**",3)}if(y.type==="bos"&&Ce()){d.type="globstar",d.value+=h,d.output=ee(l),F.output=d.output,F.globstar=!0,pe(h);continue}if(y.type==="slash"&&y.prev.type!=="bos"&&!oe&&Ce()){F.output=F.output.slice(0,-(y.output+d.output).length),y.output=`(?:${y.output}`,d.type="globstar",d.output=ee(l)+(l.strictSlashes?")":"|$)"),d.value+=h,F.globstar=!0,F.output+=y.output+d.output,pe(h);continue}if(y.type==="slash"&&y.prev.type!=="bos"&&w[0]==="/"){const Ie=w[1]!==void 0?"|$":"";F.output=F.output.slice(0,-(y.output+d.output).length),y.output=`(?:${y.output}`,d.type="globstar",d.output=`${ee(l)}${R}|${R}${Ie})`,d.value+=h,F.output+=y.output+d.output,F.globstar=!0,pe(h+N()),O({type:"slash",value:"/",output:""});continue}if(y.type==="bos"&&w[0]==="/"){d.type="globstar",d.value+=h,d.output=`(?:^|${R}|${ee(l)}${R})`,F.output=d.output,F.globstar=!0,pe(h+N()),O({type:"slash",value:"/",output:""});continue}F.output=F.output.slice(0,-d.output.length),d.type="globstar",d.output=ee(l),d.value+=h,F.output+=d.output,F.globstar=!0,pe(h);continue}const W={type:"star",value:h,output:re};if(l.bash===!0){W.output=".*?",(d.type==="bos"||d.type==="slash")&&(W.output=H+W.output),O(W);continue}if(d&&(d.type==="bracket"||d.type==="paren")&&l.regex===!0){W.output=h,O(W);continue}(F.index===F.start||d.type==="slash"||d.type==="dot")&&(d.type==="dot"?(F.output+=De,d.output+=De):l.dot===!0?(F.output+=z,d.output+=z):(F.output+=H,d.output+=H),S()!=="*"&&(F.output+=k,d.output+=k)),O(W)}for(;F.brackets>0;){if(l.strictBrackets===!0)throw new SyntaxError(a("closing","]"));F.output=t.escapeLast(F.output,"["),ie("brackets")}for(;F.parens>0;){if(l.strictBrackets===!0)throw new SyntaxError(a("closing",")"));F.output=t.escapeLast(F.output,"("),ie("parens")}for(;F.braces>0;){if(l.strictBrackets===!0)throw new SyntaxError(a("closing","}"));F.output=t.escapeLast(F.output,"{"),ie("braces")}if(l.strictSlashes!==!0&&(d.type==="star"||d.type==="bracket")&&O({type:"maybe_slash",value:"",output:`${R}?`}),F.backtrack===!0){F.output="";for(const w of F.tokens)F.output+=w.output!=null?w.output:w.value,w.suffix&&(F.output+=w.suffix)}return F},"parse");return D.fastpaths=(f,p)=>{const l={...p},g=typeof l.maxLength=="number"?Math.min(u,l.maxLength):u,C=f.length;if(C>g)throw new SyntaxError(`Input length: ${C}, exceeds maximum allowed length: ${g}`);f=o[f]||f;const{DOT_LITERAL:E,SLASH_LITERAL:A,ONE_CHAR:_,DOTS_SLASH:x,NO_DOT:m,NO_DOTS:$,NO_DOTS_SLASH:B,STAR:R,START_ANCHOR:k}=e.globChars(l.windows),q=l.dot?$:m,M=l.dot?B:m,De=l.capture?"":"?:",z={negated:!1,prefix:""};let L=l.bash===!0?".*?":R;l.capture&&(L=`(${L})`);const G=c(H=>H.noglobstar===!0?L:`(${De}(?:(?!${k}${H.dot?x:E}).)*?)`,"globstar"),T=c(H=>{switch(H){case"*":return`${q}${_}${L}`;case".*":return`${E}${_}${L}`;case"*.*":return`${q}${L}${E}${_}${L}`;case"*/*":return`${q}${L}${A}${_}${M}${L}`;case"**":return q+G(l);case"**/*":return`(?:${q}${G(l)}${A})?${M}${_}${L}`;case"**/*.*":return`(?:${q}${G(l)}${A})?${M}${L}${E}${_}${L}`;case"**/.*":return`(?:${q}${G(l)}${A})?${E}${_}${L}`;default:{const ge=/^(.*?)\.(\w+)$/.exec(H);if(!ge)return;const re=T(ge[1]);return re?re+E+ge[2]:void 0}}},"create"),U=t.removePrefix(f,z);let ee=T(U);return ee&&l.strictSlashes!==!0&&(ee+=`${A}?`),ee},Ct=D,Ct}c(ds,"requireParse");var Et,Ln;function hs(){if(Ln)return Et;Ln=1;const e=ps(),t=ds(),u=Ve(),n=Ke(),r=c(o=>o&&typeof o=="object"&&!Array.isArray(o),"isObject"),s=c((o,i,a=!1)=>{if(Array.isArray(o)){const A=o.map(x=>s(x,i,a));return c(x=>{for(const m of A){const $=m(x);if($)return $}return!1},"arrayMatcher")}const D=r(o)&&o.tokens&&o.input;if(o===""||typeof o!="string"&&!D)throw new TypeError("Expected pattern to be a non-empty string");const f=i||{},p=f.windows,l=D?s.compileRe(o,i):s.makeRe(o,i,!1,!0),g=l.state;delete l.state;let C=c(()=>!1,"isIgnored");if(f.ignore){const A={...i,ignore:null,onMatch:null,onResult:null};C=s(f.ignore,A,a)}const E=c((A,_=!1)=>{const{isMatch:x,match:m,output:$}=s.test(A,l,i,{glob:o,posix:p}),B={glob:o,state:g,regex:l,posix:p,input:A,output:$,match:m,isMatch:x};return typeof f.onResult=="function"&&f.onResult(B),x===!1?(B.isMatch=!1,_?B:!1):C(A)?(typeof f.onIgnore=="function"&&f.onIgnore(B),B.isMatch=!1,_?B:!1):(typeof f.onMatch=="function"&&f.onMatch(B),_?B:!0)},"matcher");return a&&(E.state=g),E},"picomatch");return s.test=(o,i,a,{glob:D,posix:f}={})=>{if(typeof o!="string")throw new TypeError("Expected input to be a string");if(o==="")return{isMatch:!1,output:""};const p=a||{},l=p.format||(f?u.toPosixSlashes:null);let g=o===D,C=g&&l?l(o):o;return g===!1&&(C=l?l(o):o,g=C===D),(g===!1||p.capture===!0)&&(p.matchBase===!0||p.basename===!0?g=s.matchBase(o,i,a,f):g=i.exec(C)),{isMatch:!!g,match:g,output:C}},s.matchBase=(o,i,a)=>(i instanceof RegExp?i:s.makeRe(i,a)).test(u.basename(o)),s.isMatch=(o,i,a)=>s(i,a)(o),s.parse=(o,i)=>Array.isArray(o)?o.map(a=>s.parse(a,i)):t(o,{...i,fastpaths:!1}),s.scan=(o,i)=>e(o,i),s.compileRe=(o,i,a=!1,D=!1)=>{if(a===!0)return o.output;const f=i||{},p=f.contains?"":"^",l=f.contains?"":"$";let g=`${p}(?:${o.output})${l}`;o&&o.negated===!0&&(g=`^(?!${g}).*$`);const C=s.toRegex(g,i);return D===!0&&(C.state=o),C},s.makeRe=(o,i={},a=!1,D=!1)=>{if(!o||typeof o!="string")throw new TypeError("Expected a non-empty string");let f={negated:!1,fastpaths:!0};return i.fastpaths!==!1&&(o[0]==="."||o[0]==="*")&&(f.output=t.fastpaths(o,i)),f.output||(f=t(o,i)),s.compileRe(f,i,a,D)},s.toRegex=(o,i)=>{try{const a=i||{};return new RegExp(o,a.flags||(a.nocase?"i":""))}catch(a){if(i&&i.debug===!0)throw a;return/$^/}},s.constants=n,Et=s,Et}c(hs,"requirePicomatch$1");var yt,Nn;function Fs(){if(Nn)return yt;Nn=1;const e=hs(),t=Ve();function u(n,r,s=!1){return r&&(r.windows===null||r.windows===void 0)&&(r={...r,windows:t.isWindows()}),e(n,r,s)}return c(u,"picomatch"),Object.assign(u,e),yt=u,yt}c(Fs,"requirePicomatch");var gs=Fs(),ms=Sn(gs);const Cs=c(e=>{const{publishConfig:t}=e;if(!t)return;const u=["bin","main","exports","types","module"];for(const n of u)t[n]&&(e[n]=t[n])},"applyPublishConfig"),ve=c(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"),Es=c(e=>e[0]===".","isPath"),In=c(e=>e.slice(1).filter(t=>typeof t=="string"&&t[0]!=="."),"getConditions"),ze=c((e,t,u,n=[u])=>{if(!e)return[];if(typeof e=="string")return[{source:{type:"package.json",path:[...n]},type:u,conditions:[],format:ve(e)||t,outputPath:Y(e)}];if(Array.isArray(e))return e.flatMap((s,o)=>{const i=[...n,o];return typeof s=="string"?Es(s)?{source:{type:"package.json",path:[...i]},type:u,conditions:In(i),format:ve(s)||t,outputPath:Y(s)}:[]:ze(s,t,u,i)});const r=u==="imports"&&n.length===1;return Object.entries(e).flatMap(([s,o])=>{if(r&&s[0]!=="#")return[];const i=[...n,s];if(typeof o=="string"){const a=In(i),D={type:u,source:{type:"package.json",path:i},outputPath:Y(o),conditions:a};return a.includes("types")?{...D,format:"types"}:{...D,format:ve(o)||t}}return ze(o,t,u,i)})},"parsePackageMap"),ys=c((e,t)=>{const u=[],n=e.main;n&&u.push({source:{type:"package.json",path:["main"]},type:"legacy",format:ve(n)??t,outputPath:Y(n)});const r=e.module;r&&u.push({source:{type:"package.json",path:["module"]},type:"legacy",format:"module",outputPath:Y(r)});const s=e.types;s&&u.push({source:{type:"package.json",path:["types"]},type:"legacy",format:"types",outputPath:Y(s)});const{bin:o}=e;if(o)if(typeof o=="string")u.push({source:{type:"package.json",path:["bin"]},type:"binary",format:ve(o)??t,outputPath:Y(o)});else for(const[i,a]of Object.entries(o))u.push({source:{type:"package.json",path:["bin",i]},type:"binary",format:ve(a)??t,outputPath:Y(a)});if(e.exports){const i=ze(e.exports,t,"exports");u.push(...i)}if(e.imports){const i=ze(e.imports,t,"imports");u.push(...i)}return u},"getPkgEntryPoints"),As=c(async(e,t)=>{for(const u of t){const n=e+u;if(await Ae(n))return{srcExtension:u,sourcePath:n}}},"tryExtensions"),At={".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"]},Mn=Object.keys(At),bs=c(async(e,t)=>{const{outputPath:u}=e,n=Mn.find(o=>u.endsWith(o));if(!n)return{error:`Unsupported extension (must be ${Mn.join("|")})`,exportEntry:e};const r=u.slice(t.dist.length,-n.length),s=await As(Oe.join(t.srcResolved,r),At[n]);return s?{exportEntry:e,distExtension:n,srcdist:t,...s}:{error:`Source file not found: ${Oe.join(t.src,r)}(${At[n].join("|")})`,exportEntry:e}},"getSourcePath"),ws=c(async e=>{try{return await ue.readdir(e,{withFileTypes:!0})}catch(t){const{code:u}=t;if(u==="ENOENT")return[];throw t}},"safeReaddir"),Hn=c(async(e,t)=>{const u=await ws(e);return(await Promise.all(u.map(async r=>{const s=Oe.join(e,r.name);return r.isDirectory()?Hn(s,t):r.isFile()?Oe.relative(t,s):[]}))).flat()},"getDirectoryFilesRecursive"),Wn=new Map,Un=c(async e=>{let t=Wn.get(e);return t||(t=Hn(e,e),Wn.set(e,t)),t},"getDirectoryFiles"),Je=/\.[^./]+$/,Gn=c((e,t)=>{const u=t.at(-1);if(!e.endsWith(u))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"),Bs=c(async(e,t)=>{const u=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(Je);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,...f]=a.split("*"),p=D.lastIndexOf("/"),l=p===-1?D:D.slice(0,p+1),g=p>=0?D.slice(p+1):"",C=c(x=>{const m=x.replace(Je,""),$=m.split("/").at(-1)||"";if(g&&!$.startsWith(g))return!1;if(f.length===1){const R=f[0];return!(R&&!(R.includes("/")?m:$).endsWith(R))}const B=g?$.slice(g.length):m;return!!Gn(B,f)},"matchesPattern");if(l==="./")return(await Promise.all(u.map(async m=>{const $=m.srcResolved;return(await Un($)).flatMap(R=>{if(!C(R))return[];const k=R.replace(Je,"");return[{...r,outputPath:m.dist+k+i}]})}))).flat();const E=u.find(({dist:x})=>l===x||l.startsWith(x));if(!E)return[];const A=b.posix.join(E.srcResolved,l.slice(E.dist.length));return(await Un(A)).flatMap(x=>{if(!C(x))return[];const m=x.replace(Je,"");if(f.length>1){const $=Gn(m,f);return[{...r,outputPath:l+$+i}]}return[{...r,outputPath:l+m+i}]})}))).flat()},"expandBuildOutputWildcards"),vs=c(async(e,t,u,n)=>{Cs(t);const r=t.type??"commonjs",s=n?.includes("false");let o=[];if(!s){o=await Bs(ys(t,r),e);const a=n?.filter(D=>D!=="false");if(a&&a.length>0){const D=a.map(f=>ms(f,f.includes("/")?{}:{matchBase:!0}));o=o.filter(f=>{const l=("error"in f?f.exportEntry:f).outputPath.replace(/^\.\//,"");return D.some(g=>g(l))})}}u.length>0&&o.push(...u.map(a=>({...a,format:ve(a.outputPath)??r})));const i=new Map;return await Promise.all(o.map(async a=>{if("error"in a)return a;const D=e.find(({dist:p})=>a.outputPath.startsWith(p));if(!D)return{exportEntry:a,error:"Ignoring file outside of dist directories"};const f=i.get(a.outputPath);if(f){if(f.format!==a.format)throw new Error(`Conflicting export types "${f.format}" & "${a.format}" found for ${a.outputPath}`)}else i.set(a.outputPath,a);return await bs(a,D)}))},"getBuildEntryPoints"),Pe=Symbol("entry"),xs=c(e=>({name:"esbuild-transform",transform:{filter:{id:/\.([cm]?[jt]s|[jt]sx)$/},async handler(t,u){const n=await Ut(t,{...e,supported:{"import-meta":!0,"import-attributes":!0},loader:"default",sourcefile:u.replace(/\.[cm]ts/,".ts")});return{code:n.code,map:n.map||null}}}}),"esbuildTransform"),$s=c(e=>{if(e==="es")return"esm";if(e==="cjs"||e==="iife")return e},"getEsbuildFormat"),ks=c(e=>({name:"esbuild-minify",renderChunk:c(async(t,u,n)=>{const r=await Ut(t,{...e,format:$s(n.format),minify:!0,keepNames:!0});return{code:r.code,map:r.map||null}},"renderChunk")}),"esbuildMinify"),bt=c((e,t)=>e[0]-t[0]||e[1]-t[1]||e[2]-t[2],"compareSemver"),qn=c(({target:e})=>{const t=e.some(u=>{if(u=u.trim(),!u.startsWith("node"))return;const n=u.slice(4).split(".").map(Number),r=[n[0],n[1]??0,n[2]??0];return!(bt(r,[12,20,0])>=0&&bt(r,[13,0,0])<0||bt(r,[14,13,1])>=0)});return{name:"node-builtins",resolveId:c(u=>{const n=u.startsWith("node:");if(t&&n&&(u=u.slice(5)),Qu.includes(u)||n)return{id:u,external:!0}},"resolveId")}},"nodeBuiltins"),Rs=c(e=>{const t=e.filter(n=>n.exportEntry.type==="binary");if(t.length===0)return{name:"patch-binary"};let u;return{name:"patch-binary",options:c(()=>{u=new Set(t.flatMap(n=>n.inputNames))},"options"),renderChunk:c((n,r,s)=>{if(!r.isEntry||!r.facadeModuleId||!u.has(r.name))return;const o=new Me(n);return o.prepend(`#!/usr/bin/env node
22
+ `),n(),process.exit(1);e[a]=D}}c(dt,"S"),I(dt,"mapParametersToArguments");function xn(e){return e!==!1}c(xn,"se$1"),I(xn,"helpEnabled");const Yr=I(e=>{const t=[];for(const[u,n]of Object.entries(e))if(t.push(u),n&&typeof n=="object"&&"alias"in n){const{alias:r}=n;typeof r=="string"&&r?t.push(r):Array.isArray(r)&&t.push(...r.filter(Boolean))}return t},"getKnownFlagNames"),es=I((e,t)=>{if(e.length<3||t.length===0)return;const u=qr(e,t);return Fn(e,u)<=2?u:void 0},"findClosestFlag"),ts=I((e,t)=>{const u=Object.keys(e);if(u.length!==0){for(const n of u){const r=es(n,t),s=r?` (Did you mean --${r}?)`:"";console.error(`Error: Unknown flag: --${n}.${s}`)}process.exit(1)}},"handleUnknownFlags");function ht(e,t,u,n){const r={...t.flags},s=t.version&&!("version"in r);s&&(r.version={type:Boolean,description:"Show version"});const{help:o}=t,i=xn(o);i&&!("help"in r)&&(r.help={type:Boolean,alias:"h",description:"Show help"});const a=gr(r,n,{ignore:t.ignoreArgv}),D=I(()=>{console.log(t.version)},"showVersion");if(s&&a.flags.version===!0)return D(),process.exit(0);const f=new Qr,p=i&&o?.render?o.render:E=>f.render(E),l=I(E=>{const A=Jr({...t,...E?{help:E}:{},flags:r});console.log(p(A,f))},"showHelp");if(i&&a.flags.help===!0)return l(),process.exit(0);if((t.strictFlags??t.parent?.strictFlags)&&ts(a.unknownFlags,Yr(r)),t.parameters){let{parameters:E}=t,A=a._;const _=E.indexOf("--"),x=E.slice(_+1),m=Object.create(null);let $=[];_>-1&&x.length>0&&(E=E.slice(0,_),$=a._["--"],A=A.slice(0,-$.length||void 0)),dt(m,pt(E),A,l),_>-1&&x.length>0&&dt(m,pt(x),$,l),Object.assign(a._,m)}const g={...a,showVersion:D,showHelp:l},C={command:e,...g};if(typeof u=="function"){const E=u(g);if(E&&"then"in E)return Object.assign(Promise.resolve(E),C)}return C}c(ht,"I$2"),I(ht,"cliBase");function $n(e,t){const u=new Map;for(const n of t){const r=[n.options.name],{alias:s}=n.options;s&&(Array.isArray(s)?r.push(...s):r.push(s));for(const o of r){if(u.has(o))throw new Error(`Duplicate command name found: ${Fe(o)}`);u.set(o,n)}}return u.get(e)}c($n,"ce$1"),I($n,"getCommand");function kn(e,t,u=process.argv.slice(2)){if(!e)throw new Error("Options is required");if("name"in e&&(!e.name||!ft(e.name)))throw new Error(`Invalid script name: ${Fe(e.name)}`);const n=u[0];if(e.commands&&n&&ft(n)){const r=$n(n,e.commands);if(r)return ht(r.options.name,{...r.options,parent:e},r.callback,u.slice(1))}return ht(void 0,e,t,u)}c(kn,"fe$1"),I(kn,"cli");function ns(e,t){if(!e)throw new Error("Command options are required");const{name:u}=e;if(u===void 0)throw new Error("Command name is required");if(!ft(u))throw new Error(`Invalid command name ${JSON.stringify(u)}. Command names must be one word.`);return{options:e,callback:t}}c(ns,"de$1"),I(ns,"command");var us="2.27.0",rs={version:us};const Ae=c(e=>he.promises.access(e).then(()=>!0,()=>!1),"fsExists");let Be=!0;const $e=typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{};let je=0;if($e.process&&$e.process.env&&$e.process.stdout){const{FORCE_COLOR:e,NODE_DISABLE_COLORS:t,NO_COLOR:u,TERM:n,COLORTERM:r}=$e.process.env;t||u||e==="0"?Be=!1:e==="1"||e==="2"||e==="3"?Be=!0:n==="dumb"?Be=!1:"CI"in $e.process.env&&["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(s=>s in $e.process.env)?Be=!0:Be=process.stdout.isTTY,Be&&(process.platform==="win32"||r&&(r==="truecolor"||r==="24bit")?je=3:n&&(n.endsWith("-256color")||n.endsWith("256"))?je=2:je=1)}let Rn={enabled:Be,supportLevel:je};function ss(e,t,u=1){const n=`\x1B[${e}m`,r=`\x1B[${t}m`,s=new RegExp(`\\x1b\\[${t}m`,"g");return o=>Rn.enabled&&Rn.supportLevel>=u?n+(""+o).replace(s,n)+r:""+o}c(ss,"kolorist");const os=ss(2,22),Ge=c(e=>e.replaceAll("\\","/"),"slash"),Y=c((e,t)=>(!b.isAbsolute(e)&&!e.startsWith(".")&&!e.startsWith("/")&&(e=`./${e}`),t&&!e.endsWith("/")&&(e+="/"),e),"normalizePath"),is=c(()=>new Date().toLocaleTimeString(),"currentTime"),ke=c((...e)=>console.log(os(is()),...e),"log"),as=process.cwd(),qe=c(e=>Y(b.relative(as,e)),"formatPath"),cs=c(async e=>{const t=await ue.readFile(e,"utf8");try{return Gu(t)}catch(u){throw new Error(`Failed to parse ${qe(e)}: ${u.message}`)}},"readPackageYaml"),_n=c(async e=>{const t=await ue.readFile(e,"utf8");try{return JSON.parse(t)}catch(u){throw new Error(`Failed to parse ${qe(e)}: ${u.message}`)}},"readPackageJson"),ls=c(async e=>{const t=b.join(e,"package.yaml");if(await Ae(t))return{packageJson:await cs(t),packageJsonPath:t};const u=b.join(e,"package.json");if(await Ae(u))return{packageJson:await _n(u),packageJsonPath:u};throw new Error(`package.json not found at: ${u} (also checked for package.yaml)`)},"readPackage"),Ds=c(e=>{let t=!1;if(e.includes("=")){const[u,n]=e.split("=");e=n,t=u==="bin"||u==="binary"}return{type:"legacy",source:"cli",outputPath:Y(e),isExecutable:t}},"parseCliInputFlag"),fs=c(({imports:e},t)=>{const u={};if(e)for(const n in e){if(n.startsWith("#"))continue;const r=e[n];typeof r=="string"&&(u[n]=b.join(t,r))}return u},"getAliases");function Sn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}c(Sn,"getDefaultExportFromCjs");var Ft={},gt,On;function Ke(){if(On)return gt;On=1;const e="\\\\/",t=`[^${e}]`,u="\\.",n="\\+",r="\\?",s="\\/",o="(?=.)",i="[^/]",a=`(?:${s}|$)`,D=`(?:^|${s})`,f=`${u}{1,2}${a}`,p=`(?!${u})`,l=`(?!${D}${f})`,g=`(?!${u}{0,1}${a})`,C=`(?!${f})`,E=`[^.${s}]`,A=`${i}*?`,x={DOT_LITERAL:u,PLUS_LITERAL:n,QMARK_LITERAL:r,SLASH_LITERAL:s,ONE_CHAR:o,QMARK:i,END_ANCHOR:a,DOTS_SLASH:f,NO_DOT:p,NO_DOTS:l,NO_DOT_SLASH:g,NO_DOTS_SLASH:C,QMARK_NO_DOT:E,STAR:A,START_ANCHOR:D,SEP:"/"},m={...x,SLASH_LITERAL:`[${e}]`,QMARK:t,STAR:`${t}*?`,DOTS_SLASH:`${u}{1,2}(?:[${e}]|$)`,NO_DOT:`(?!${u})`,NO_DOTS:`(?!(?:^|[${e}])${u}{1,2}(?:[${e}]|$))`,NO_DOT_SLASH:`(?!${u}{0,1}(?:[${e}]|$))`,NO_DOTS_SLASH:`(?!${u}{1,2}(?:[${e}]|$))`,QMARK_NO_DOT:`[^.${e}]`,START_ANCHOR:`(?:^|[${e}])`,END_ANCHOR:`(?:[${e}]|$)`,SEP:"\\"},$={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};return gt={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:$,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(B){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${B.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(B){return B===!0?m:x}},gt}c(Ke,"requireConstants");var Tn;function Ve(){return Tn||(Tn=1,(function(e){const{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:u,REGEX_SPECIAL_CHARS:n,REGEX_SPECIAL_CHARS_GLOBAL:r}=Ke();e.isObject=s=>s!==null&&typeof s=="object"&&!Array.isArray(s),e.hasRegexChars=s=>n.test(s),e.isRegexChar=s=>s.length===1&&e.hasRegexChars(s),e.escapeRegex=s=>s.replace(r,"\\$1"),e.toPosixSlashes=s=>s.replace(t,"/"),e.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){const s=navigator.platform.toLowerCase();return s==="win32"||s==="windows"}return typeof process<"u"&&process.platform?process.platform==="win32":!1},e.removeBackslashes=s=>s.replace(u,o=>o==="\\"?"":o),e.escapeLast=(s,o,i)=>{const a=s.lastIndexOf(o,i);return a===-1?s:s[a-1]==="\\"?e.escapeLast(s,o,a-1):`${s.slice(0,a)}\\${s.slice(a)}`},e.removePrefix=(s,o={})=>{let i=s;return i.startsWith("./")&&(i=i.slice(2),o.prefix="./"),i},e.wrapOutput=(s,o={},i={})=>{const a=i.contains?"":"^",D=i.contains?"":"$";let f=`${a}(?:${s})${D}`;return o.negated===!0&&(f=`(?:^(?!${f}).*$)`),f},e.basename=(s,{windows:o}={})=>{const i=s.split(o?/[\\/]/:"/"),a=i[i.length-1];return a===""?i[i.length-2]:a}})(Ft)),Ft}c(Ve,"requireUtils");var mt,jn;function ps(){if(jn)return mt;jn=1;const e=Ve(),{CHAR_ASTERISK:t,CHAR_AT:u,CHAR_BACKWARD_SLASH:n,CHAR_COMMA:r,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:o,CHAR_FORWARD_SLASH:i,CHAR_LEFT_CURLY_BRACE:a,CHAR_LEFT_PARENTHESES:D,CHAR_LEFT_SQUARE_BRACKET:f,CHAR_PLUS:p,CHAR_QUESTION_MARK:l,CHAR_RIGHT_CURLY_BRACE:g,CHAR_RIGHT_PARENTHESES:C,CHAR_RIGHT_SQUARE_BRACKET:E}=Ke(),A=c(m=>m===i||m===n,"isPathSeparator"),_=c(m=>{m.isPrefix!==!0&&(m.depth=m.isGlobstar?1/0:1)},"depth");return mt=c((m,$)=>{const B=$||{},R=m.length-1,k=B.parts===!0||B.scanToEnd===!0,q=[],M=[],De=[];let z=m,L=-1,G=0,T=0,U=!1,ee=!1,H=!1,ge=!1,re=!1,F=!1,J=!1,fe=!1,we=!1,d=!1,h=0,Ce,S,N={value:"",depth:0,isGlob:!1};const le=c(()=>L>=R,"eos"),pe=c(()=>z.charCodeAt(L+1),"peek"),te=c(()=>(Ce=S,z.charCodeAt(++L)),"advance");for(;L<R;){S=te();let se;if(S===n){J=N.backslashes=!0,S=te(),S===a&&(F=!0);continue}if(F===!0||S===a){for(h++;le()!==!0&&(S=te());){if(S===n){J=N.backslashes=!0,te();continue}if(S===a){h++;continue}if(F!==!0&&S===s&&(S=te())===s){if(U=N.isBrace=!0,H=N.isGlob=!0,d=!0,k===!0)continue;break}if(F!==!0&&S===r){if(U=N.isBrace=!0,H=N.isGlob=!0,d=!0,k===!0)continue;break}if(S===g&&(h--,h===0)){F=!1,U=N.isBrace=!0,d=!0;break}}if(k===!0)continue;break}if(S===i){if(q.push(L),M.push(N),N={value:"",depth:0,isGlob:!1},d===!0)continue;if(Ce===s&&L===G+1){G+=2;continue}T=L+1;continue}if(B.noext!==!0&&(S===p||S===u||S===t||S===l||S===o)===!0&&pe()===D){if(H=N.isGlob=!0,ge=N.isExtglob=!0,d=!0,S===o&&L===G&&(we=!0),k===!0){for(;le()!==!0&&(S=te());){if(S===n){J=N.backslashes=!0,S=te();continue}if(S===C){H=N.isGlob=!0,d=!0;break}}continue}break}if(S===t){if(Ce===t&&(re=N.isGlobstar=!0),H=N.isGlob=!0,d=!0,k===!0)continue;break}if(S===l){if(H=N.isGlob=!0,d=!0,k===!0)continue;break}if(S===f){for(;le()!==!0&&(se=te());){if(se===n){J=N.backslashes=!0,te();continue}if(se===E){ee=N.isBracket=!0,H=N.isGlob=!0,d=!0;break}}if(k===!0)continue;break}if(B.nonegate!==!0&&S===o&&L===G){fe=N.negated=!0,G++;continue}if(B.noparen!==!0&&S===D){if(H=N.isGlob=!0,k===!0){for(;le()!==!0&&(S=te());){if(S===D){J=N.backslashes=!0,S=te();continue}if(S===C){d=!0;break}}continue}break}if(H===!0){if(d=!0,k===!0)continue;break}}B.noext===!0&&(ge=!1,H=!1);let Z=z,Ee="",ie="";G>0&&(Ee=z.slice(0,G),z=z.slice(G),T-=G),Z&&H===!0&&T>0?(Z=z.slice(0,T),ie=z.slice(T)):H===!0?(Z="",ie=z):Z=z,Z&&Z!==""&&Z!=="/"&&Z!==z&&A(Z.charCodeAt(Z.length-1))&&(Z=Z.slice(0,-1)),B.unescape===!0&&(ie&&(ie=e.removeBackslashes(ie)),Z&&J===!0&&(Z=e.removeBackslashes(Z)));const O={prefix:Ee,input:m,start:G,base:Z,glob:ie,isBrace:U,isBracket:ee,isGlob:H,isExtglob:ge,isGlobstar:re,negated:fe,negatedExtglob:we};if(B.tokens===!0&&(O.maxDepth=0,A(S)||M.push(N),O.tokens=M),B.parts===!0||B.tokens===!0){let se;for(let ne=0;ne<q.length;ne++){const w=se?se+1:G,W=q[ne],y=m.slice(w,W);B.tokens&&(ne===0&&G!==0?(M[ne].isPrefix=!0,M[ne].value=Ee):M[ne].value=y,_(M[ne]),O.maxDepth+=M[ne].depth),(ne!==0||y!=="")&&De.push(y),se=W}if(se&&se+1<m.length){const ne=m.slice(se+1);De.push(ne),B.tokens&&(M[M.length-1].value=ne,_(M[M.length-1]),O.maxDepth+=M[M.length-1].depth)}O.slashes=q,O.parts=De}return O},"scan"),mt}c(ps,"requireScan");var Ct,Pn;function ds(){if(Pn)return Ct;Pn=1;const e=Ke(),t=Ve(),{MAX_LENGTH:u,POSIX_REGEX_SOURCE:n,REGEX_NON_SPECIAL_CHARS:r,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:o}=e,i=c((f,p)=>{if(typeof p.expandRange=="function")return p.expandRange(...f,p);f.sort();const l=`[${f.join("-")}]`;try{new RegExp(l)}catch{return f.map(C=>t.escapeRegex(C)).join("..")}return l},"expandRange"),a=c((f,p)=>`Missing ${f}: "${p}" - use "\\\\${p}" to match literal characters`,"syntaxError"),D=c((f,p)=>{if(typeof f!="string")throw new TypeError("Expected a string");f=o[f]||f;const l={...p},g=typeof l.maxLength=="number"?Math.min(u,l.maxLength):u;let C=f.length;if(C>g)throw new SyntaxError(`Input length: ${C}, exceeds maximum allowed length: ${g}`);const E={type:"bos",value:"",output:l.prepend||""},A=[E],_=l.capture?"":"?:",x=e.globChars(l.windows),m=e.extglobChars(x),{DOT_LITERAL:$,PLUS_LITERAL:B,SLASH_LITERAL:R,ONE_CHAR:k,DOTS_SLASH:q,NO_DOT:M,NO_DOT_SLASH:De,NO_DOTS_SLASH:z,QMARK:L,QMARK_NO_DOT:G,STAR:T,START_ANCHOR:U}=x,ee=c(w=>`(${_}(?:(?!${U}${w.dot?q:$}).)*?)`,"globstar"),H=l.dot?"":M,ge=l.dot?L:G;let re=l.bash===!0?ee(l):T;l.capture&&(re=`(${re})`),typeof l.noext=="boolean"&&(l.noextglob=l.noext);const F={input:f,index:-1,start:0,dot:l.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:A};f=t.removePrefix(f,F),C=f.length;const J=[],fe=[],we=[];let d=E,h;const Ce=c(()=>F.index===C-1,"eos"),S=F.peek=(w=1)=>f[F.index+w],N=F.advance=()=>f[++F.index]||"",le=c(()=>f.slice(F.index+1),"remaining"),pe=c((w="",W=0)=>{F.consumed+=w,F.index+=W},"consume"),te=c(w=>{F.output+=w.output!=null?w.output:w.value,pe(w.value)},"append"),Z=c(()=>{let w=1;for(;S()==="!"&&(S(2)!=="("||S(3)==="?");)N(),F.start++,w++;return w%2===0?!1:(F.negated=!0,F.start++,!0)},"negate"),Ee=c(w=>{F[w]++,we.push(w)},"increment"),ie=c(w=>{F[w]--,we.pop()},"decrement"),O=c(w=>{if(d.type==="globstar"){const W=F.braces>0&&(w.type==="comma"||w.type==="brace"),y=w.extglob===!0||J.length&&(w.type==="pipe"||w.type==="paren");w.type!=="slash"&&w.type!=="paren"&&!W&&!y&&(F.output=F.output.slice(0,-d.output.length),d.type="star",d.value="*",d.output=re,F.output+=d.output)}if(J.length&&w.type!=="paren"&&(J[J.length-1].inner+=w.value),(w.value||w.output)&&te(w),d&&d.type==="text"&&w.type==="text"){d.output=(d.output||d.value)+w.value,d.value+=w.value;return}w.prev=d,A.push(w),d=w},"push"),se=c((w,W)=>{const y={...m[W],conditions:1,inner:""};y.prev=d,y.parens=F.parens,y.output=F.output;const P=(l.capture?"(":"")+y.open;Ee("parens"),O({type:w,value:W,output:F.output?"":k}),O({type:"paren",extglob:!0,value:N(),output:P}),J.push(y)},"extglobOpen"),ne=c(w=>{let W=w.close+(l.capture?")":""),y;if(w.type==="negate"){let P=re;if(w.inner&&w.inner.length>1&&w.inner.includes("/")&&(P=ee(l)),(P!==re||Ce()||/^\)+$/.test(le()))&&(W=w.close=`)$))${P}`),w.inner.includes("*")&&(y=le())&&/^\.[^\\/.]+$/.test(y)){const V=D(y,{...p,fastpaths:!1}).output;W=w.close=`)${V})${P})`}w.prev.type==="bos"&&(F.negatedExtglob=!0)}O({type:"paren",extglob:!0,value:h,output:W}),ie("parens")},"extglobClose");if(l.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(f)){let w=!1,W=f.replace(s,(y,P,V,oe,X,st)=>oe==="\\"?(w=!0,y):oe==="?"?P?P+oe+(X?L.repeat(X.length):""):st===0?ge+(X?L.repeat(X.length):""):L.repeat(V.length):oe==="."?$.repeat(V.length):oe==="*"?P?P+oe+(X?re:""):re:P?y:`\\${y}`);return w===!0&&(l.unescape===!0?W=W.replace(/\\/g,""):W=W.replace(/\\+/g,y=>y.length%2===0?"\\\\":y?"\\":"")),W===f&&l.contains===!0?(F.output=f,F):(F.output=t.wrapOutput(W,F,p),F)}for(;!Ce();){if(h=N(),h==="\0")continue;if(h==="\\"){const y=S();if(y==="/"&&l.bash!==!0||y==="."||y===";")continue;if(!y){h+="\\",O({type:"text",value:h});continue}const P=/^\\+/.exec(le());let V=0;if(P&&P[0].length>2&&(V=P[0].length,F.index+=V,V%2!==0&&(h+="\\")),l.unescape===!0?h=N():h+=N(),F.brackets===0){O({type:"text",value:h});continue}}if(F.brackets>0&&(h!=="]"||d.value==="["||d.value==="[^")){if(l.posix!==!1&&h===":"){const y=d.value.slice(1);if(y.includes("[")&&(d.posix=!0,y.includes(":"))){const P=d.value.lastIndexOf("["),V=d.value.slice(0,P),oe=d.value.slice(P+2),X=n[oe];if(X){d.value=V+X,F.backtrack=!0,N(),!E.output&&A.indexOf(d)===1&&(E.output=k);continue}}}(h==="["&&S()!==":"||h==="-"&&S()==="]")&&(h=`\\${h}`),h==="]"&&(d.value==="["||d.value==="[^")&&(h=`\\${h}`),l.posix===!0&&h==="!"&&d.value==="["&&(h="^"),d.value+=h,te({value:h});continue}if(F.quotes===1&&h!=='"'){h=t.escapeRegex(h),d.value+=h,te({value:h});continue}if(h==='"'){F.quotes=F.quotes===1?0:1,l.keepQuotes===!0&&O({type:"text",value:h});continue}if(h==="("){Ee("parens"),O({type:"paren",value:h});continue}if(h===")"){if(F.parens===0&&l.strictBrackets===!0)throw new SyntaxError(a("opening","("));const y=J[J.length-1];if(y&&F.parens===y.parens+1){ne(J.pop());continue}O({type:"paren",value:h,output:F.parens?")":"\\)"}),ie("parens");continue}if(h==="["){if(l.nobracket===!0||!le().includes("]")){if(l.nobracket!==!0&&l.strictBrackets===!0)throw new SyntaxError(a("closing","]"));h=`\\${h}`}else Ee("brackets");O({type:"bracket",value:h});continue}if(h==="]"){if(l.nobracket===!0||d&&d.type==="bracket"&&d.value.length===1){O({type:"text",value:h,output:`\\${h}`});continue}if(F.brackets===0){if(l.strictBrackets===!0)throw new SyntaxError(a("opening","["));O({type:"text",value:h,output:`\\${h}`});continue}ie("brackets");const y=d.value.slice(1);if(d.posix!==!0&&y[0]==="^"&&!y.includes("/")&&(h=`/${h}`),d.value+=h,te({value:h}),l.literalBrackets===!1||t.hasRegexChars(y))continue;const P=t.escapeRegex(d.value);if(F.output=F.output.slice(0,-d.value.length),l.literalBrackets===!0){F.output+=P,d.value=P;continue}d.value=`(${_}${P}|${d.value})`,F.output+=d.value;continue}if(h==="{"&&l.nobrace!==!0){Ee("braces");const y={type:"brace",value:h,output:"(",outputIndex:F.output.length,tokensIndex:F.tokens.length};fe.push(y),O(y);continue}if(h==="}"){const y=fe[fe.length-1];if(l.nobrace===!0||!y){O({type:"text",value:h,output:h});continue}let P=")";if(y.dots===!0){const V=A.slice(),oe=[];for(let X=V.length-1;X>=0&&(A.pop(),V[X].type!=="brace");X--)V[X].type!=="dots"&&oe.unshift(V[X].value);P=i(oe,l),F.backtrack=!0}if(y.comma!==!0&&y.dots!==!0){const V=F.output.slice(0,y.outputIndex),oe=F.tokens.slice(y.tokensIndex);y.value=y.output="\\{",h=P="\\}",F.output=V;for(const X of oe)F.output+=X.output||X.value}O({type:"brace",value:h,output:P}),ie("braces"),fe.pop();continue}if(h==="|"){J.length>0&&J[J.length-1].conditions++,O({type:"text",value:h});continue}if(h===","){let y=h;const P=fe[fe.length-1];P&&we[we.length-1]==="braces"&&(P.comma=!0,y="|"),O({type:"comma",value:h,output:y});continue}if(h==="/"){if(d.type==="dot"&&F.index===F.start+1){F.start=F.index+1,F.consumed="",F.output="",A.pop(),d=E;continue}O({type:"slash",value:h,output:R});continue}if(h==="."){if(F.braces>0&&d.type==="dot"){d.value==="."&&(d.output=$);const y=fe[fe.length-1];d.type="dots",d.output+=h,d.value+=h,y.dots=!0;continue}if(F.braces+F.parens===0&&d.type!=="bos"&&d.type!=="slash"){O({type:"text",value:h,output:$});continue}O({type:"dot",value:h,output:$});continue}if(h==="?"){if(!(d&&d.value==="(")&&l.noextglob!==!0&&S()==="("&&S(2)!=="?"){se("qmark",h);continue}if(d&&d.type==="paren"){const P=S();let V=h;(d.value==="("&&!/[!=<:]/.test(P)||P==="<"&&!/<([!=]|\w+>)/.test(le()))&&(V=`\\${h}`),O({type:"text",value:h,output:V});continue}if(l.dot!==!0&&(d.type==="slash"||d.type==="bos")){O({type:"qmark",value:h,output:G});continue}O({type:"qmark",value:h,output:L});continue}if(h==="!"){if(l.noextglob!==!0&&S()==="("&&(S(2)!=="?"||!/[!=<:]/.test(S(3)))){se("negate",h);continue}if(l.nonegate!==!0&&F.index===0){Z();continue}}if(h==="+"){if(l.noextglob!==!0&&S()==="("&&S(2)!=="?"){se("plus",h);continue}if(d&&d.value==="("||l.regex===!1){O({type:"plus",value:h,output:B});continue}if(d&&(d.type==="bracket"||d.type==="paren"||d.type==="brace")||F.parens>0){O({type:"plus",value:h});continue}O({type:"plus",value:B});continue}if(h==="@"){if(l.noextglob!==!0&&S()==="("&&S(2)!=="?"){O({type:"at",extglob:!0,value:h,output:""});continue}O({type:"text",value:h});continue}if(h!=="*"){(h==="$"||h==="^")&&(h=`\\${h}`);const y=r.exec(le());y&&(h+=y[0],F.index+=y[0].length),O({type:"text",value:h});continue}if(d&&(d.type==="globstar"||d.star===!0)){d.type="star",d.star=!0,d.value+=h,d.output=re,F.backtrack=!0,F.globstar=!0,pe(h);continue}let w=le();if(l.noextglob!==!0&&/^\([^?]/.test(w)){se("star",h);continue}if(d.type==="star"){if(l.noglobstar===!0){pe(h);continue}const y=d.prev,P=y.prev,V=y.type==="slash"||y.type==="bos",oe=P&&(P.type==="star"||P.type==="globstar");if(l.bash===!0&&(!V||w[0]&&w[0]!=="/")){O({type:"star",value:h,output:""});continue}const X=F.braces>0&&(y.type==="comma"||y.type==="brace"),st=J.length&&(y.type==="pipe"||y.type==="paren");if(!V&&y.type!=="paren"&&!X&&!st){O({type:"star",value:h,output:""});continue}for(;w.slice(0,3)==="/**";){const Ie=f[F.index+4];if(Ie&&Ie!=="/")break;w=w.slice(3),pe("/**",3)}if(y.type==="bos"&&Ce()){d.type="globstar",d.value+=h,d.output=ee(l),F.output=d.output,F.globstar=!0,pe(h);continue}if(y.type==="slash"&&y.prev.type!=="bos"&&!oe&&Ce()){F.output=F.output.slice(0,-(y.output+d.output).length),y.output=`(?:${y.output}`,d.type="globstar",d.output=ee(l)+(l.strictSlashes?")":"|$)"),d.value+=h,F.globstar=!0,F.output+=y.output+d.output,pe(h);continue}if(y.type==="slash"&&y.prev.type!=="bos"&&w[0]==="/"){const Ie=w[1]!==void 0?"|$":"";F.output=F.output.slice(0,-(y.output+d.output).length),y.output=`(?:${y.output}`,d.type="globstar",d.output=`${ee(l)}${R}|${R}${Ie})`,d.value+=h,F.output+=y.output+d.output,F.globstar=!0,pe(h+N()),O({type:"slash",value:"/",output:""});continue}if(y.type==="bos"&&w[0]==="/"){d.type="globstar",d.value+=h,d.output=`(?:^|${R}|${ee(l)}${R})`,F.output=d.output,F.globstar=!0,pe(h+N()),O({type:"slash",value:"/",output:""});continue}F.output=F.output.slice(0,-d.output.length),d.type="globstar",d.output=ee(l),d.value+=h,F.output+=d.output,F.globstar=!0,pe(h);continue}const W={type:"star",value:h,output:re};if(l.bash===!0){W.output=".*?",(d.type==="bos"||d.type==="slash")&&(W.output=H+W.output),O(W);continue}if(d&&(d.type==="bracket"||d.type==="paren")&&l.regex===!0){W.output=h,O(W);continue}(F.index===F.start||d.type==="slash"||d.type==="dot")&&(d.type==="dot"?(F.output+=De,d.output+=De):l.dot===!0?(F.output+=z,d.output+=z):(F.output+=H,d.output+=H),S()!=="*"&&(F.output+=k,d.output+=k)),O(W)}for(;F.brackets>0;){if(l.strictBrackets===!0)throw new SyntaxError(a("closing","]"));F.output=t.escapeLast(F.output,"["),ie("brackets")}for(;F.parens>0;){if(l.strictBrackets===!0)throw new SyntaxError(a("closing",")"));F.output=t.escapeLast(F.output,"("),ie("parens")}for(;F.braces>0;){if(l.strictBrackets===!0)throw new SyntaxError(a("closing","}"));F.output=t.escapeLast(F.output,"{"),ie("braces")}if(l.strictSlashes!==!0&&(d.type==="star"||d.type==="bracket")&&O({type:"maybe_slash",value:"",output:`${R}?`}),F.backtrack===!0){F.output="";for(const w of F.tokens)F.output+=w.output!=null?w.output:w.value,w.suffix&&(F.output+=w.suffix)}return F},"parse");return D.fastpaths=(f,p)=>{const l={...p},g=typeof l.maxLength=="number"?Math.min(u,l.maxLength):u,C=f.length;if(C>g)throw new SyntaxError(`Input length: ${C}, exceeds maximum allowed length: ${g}`);f=o[f]||f;const{DOT_LITERAL:E,SLASH_LITERAL:A,ONE_CHAR:_,DOTS_SLASH:x,NO_DOT:m,NO_DOTS:$,NO_DOTS_SLASH:B,STAR:R,START_ANCHOR:k}=e.globChars(l.windows),q=l.dot?$:m,M=l.dot?B:m,De=l.capture?"":"?:",z={negated:!1,prefix:""};let L=l.bash===!0?".*?":R;l.capture&&(L=`(${L})`);const G=c(H=>H.noglobstar===!0?L:`(${De}(?:(?!${k}${H.dot?x:E}).)*?)`,"globstar"),T=c(H=>{switch(H){case"*":return`${q}${_}${L}`;case".*":return`${E}${_}${L}`;case"*.*":return`${q}${L}${E}${_}${L}`;case"*/*":return`${q}${L}${A}${_}${M}${L}`;case"**":return q+G(l);case"**/*":return`(?:${q}${G(l)}${A})?${M}${_}${L}`;case"**/*.*":return`(?:${q}${G(l)}${A})?${M}${L}${E}${_}${L}`;case"**/.*":return`(?:${q}${G(l)}${A})?${E}${_}${L}`;default:{const ge=/^(.*?)\.(\w+)$/.exec(H);if(!ge)return;const re=T(ge[1]);return re?re+E+ge[2]:void 0}}},"create"),U=t.removePrefix(f,z);let ee=T(U);return ee&&l.strictSlashes!==!0&&(ee+=`${A}?`),ee},Ct=D,Ct}c(ds,"requireParse");var Et,Ln;function hs(){if(Ln)return Et;Ln=1;const e=ps(),t=ds(),u=Ve(),n=Ke(),r=c(o=>o&&typeof o=="object"&&!Array.isArray(o),"isObject"),s=c((o,i,a=!1)=>{if(Array.isArray(o)){const A=o.map(x=>s(x,i,a));return c(x=>{for(const m of A){const $=m(x);if($)return $}return!1},"arrayMatcher")}const D=r(o)&&o.tokens&&o.input;if(o===""||typeof o!="string"&&!D)throw new TypeError("Expected pattern to be a non-empty string");const f=i||{},p=f.windows,l=D?s.compileRe(o,i):s.makeRe(o,i,!1,!0),g=l.state;delete l.state;let C=c(()=>!1,"isIgnored");if(f.ignore){const A={...i,ignore:null,onMatch:null,onResult:null};C=s(f.ignore,A,a)}const E=c((A,_=!1)=>{const{isMatch:x,match:m,output:$}=s.test(A,l,i,{glob:o,posix:p}),B={glob:o,state:g,regex:l,posix:p,input:A,output:$,match:m,isMatch:x};return typeof f.onResult=="function"&&f.onResult(B),x===!1?(B.isMatch=!1,_?B:!1):C(A)?(typeof f.onIgnore=="function"&&f.onIgnore(B),B.isMatch=!1,_?B:!1):(typeof f.onMatch=="function"&&f.onMatch(B),_?B:!0)},"matcher");return a&&(E.state=g),E},"picomatch");return s.test=(o,i,a,{glob:D,posix:f}={})=>{if(typeof o!="string")throw new TypeError("Expected input to be a string");if(o==="")return{isMatch:!1,output:""};const p=a||{},l=p.format||(f?u.toPosixSlashes:null);let g=o===D,C=g&&l?l(o):o;return g===!1&&(C=l?l(o):o,g=C===D),(g===!1||p.capture===!0)&&(p.matchBase===!0||p.basename===!0?g=s.matchBase(o,i,a,f):g=i.exec(C)),{isMatch:!!g,match:g,output:C}},s.matchBase=(o,i,a)=>(i instanceof RegExp?i:s.makeRe(i,a)).test(u.basename(o)),s.isMatch=(o,i,a)=>s(i,a)(o),s.parse=(o,i)=>Array.isArray(o)?o.map(a=>s.parse(a,i)):t(o,{...i,fastpaths:!1}),s.scan=(o,i)=>e(o,i),s.compileRe=(o,i,a=!1,D=!1)=>{if(a===!0)return o.output;const f=i||{},p=f.contains?"":"^",l=f.contains?"":"$";let g=`${p}(?:${o.output})${l}`;o&&o.negated===!0&&(g=`^(?!${g}).*$`);const C=s.toRegex(g,i);return D===!0&&(C.state=o),C},s.makeRe=(o,i={},a=!1,D=!1)=>{if(!o||typeof o!="string")throw new TypeError("Expected a non-empty string");let f={negated:!1,fastpaths:!0};return i.fastpaths!==!1&&(o[0]==="."||o[0]==="*")&&(f.output=t.fastpaths(o,i)),f.output||(f=t(o,i)),s.compileRe(f,i,a,D)},s.toRegex=(o,i)=>{try{const a=i||{};return new RegExp(o,a.flags||(a.nocase?"i":""))}catch(a){if(i&&i.debug===!0)throw a;return/$^/}},s.constants=n,Et=s,Et}c(hs,"requirePicomatch$1");var yt,Nn;function Fs(){if(Nn)return yt;Nn=1;const e=hs(),t=Ve();function u(n,r,s=!1){return r&&(r.windows===null||r.windows===void 0)&&(r={...r,windows:t.isWindows()}),e(n,r,s)}return c(u,"picomatch"),Object.assign(u,e),yt=u,yt}c(Fs,"requirePicomatch");var gs=Fs(),ms=Sn(gs);const Cs=c(e=>{const{publishConfig:t}=e;if(!t)return;const u=["bin","main","exports","types","module"];for(const n of u)t[n]&&(e[n]=t[n])},"applyPublishConfig"),ve=c(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"),Es=c(e=>e[0]===".","isPath"),In=c(e=>e.slice(1).filter(t=>typeof t=="string"&&t[0]!=="."),"getConditions"),ze=c((e,t,u,n=[u])=>{if(!e)return[];if(typeof e=="string")return[{source:{type:"package.json",path:[...n]},type:u,conditions:[],format:ve(e)||t,outputPath:Y(e)}];if(Array.isArray(e))return e.flatMap((s,o)=>{const i=[...n,o];return typeof s=="string"?Es(s)?{source:{type:"package.json",path:[...i]},type:u,conditions:In(i),format:ve(s)||t,outputPath:Y(s)}:[]:ze(s,t,u,i)});const r=u==="imports"&&n.length===1;return Object.entries(e).flatMap(([s,o])=>{if(r&&s[0]!=="#")return[];const i=[...n,s];if(typeof o=="string"){const a=In(i),D={type:u,source:{type:"package.json",path:i},outputPath:Y(o),conditions:a};return a.includes("types")?{...D,format:"types"}:{...D,format:ve(o)||t}}return ze(o,t,u,i)})},"parsePackageMap"),ys=c((e,t)=>{const u=[],n=e.main;n&&u.push({source:{type:"package.json",path:["main"]},type:"legacy",format:ve(n)??t,outputPath:Y(n)});const r=e.module;r&&u.push({source:{type:"package.json",path:["module"]},type:"legacy",format:"module",outputPath:Y(r)});const s=e.types;s&&u.push({source:{type:"package.json",path:["types"]},type:"legacy",format:"types",outputPath:Y(s)});const{bin:o}=e;if(o)if(typeof o=="string")u.push({source:{type:"package.json",path:["bin"]},type:"binary",format:ve(o)??t,outputPath:Y(o)});else for(const[i,a]of Object.entries(o))u.push({source:{type:"package.json",path:["bin",i]},type:"binary",format:ve(a)??t,outputPath:Y(a)});if(e.exports){const i=ze(e.exports,t,"exports");u.push(...i)}if(e.imports){const i=ze(e.imports,t,"imports");u.push(...i)}return u},"getPkgEntryPoints"),As=c(async(e,t)=>{for(const u of t){const n=e+u;if(await Ae(n))return{srcExtension:u,sourcePath:n}}},"tryExtensions"),At={".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"]},Mn=Object.keys(At),bs=c(async(e,t)=>{const{outputPath:u}=e,n=Mn.find(o=>u.endsWith(o));if(!n)return{error:`Unsupported extension (must be ${Mn.join("|")})`,exportEntry:e};const r=u.slice(t.dist.length,-n.length),s=await As(Oe.join(t.srcResolved,r),At[n]);return s?{exportEntry:e,distExtension:n,srcdist:t,...s}:{error:`Source file not found: ${Oe.join(t.src,r)}(${At[n].join("|")})`,exportEntry:e}},"getSourcePath"),ws=c(async e=>{try{return await ue.readdir(e,{withFileTypes:!0})}catch(t){const{code:u}=t;if(u==="ENOENT")return[];throw t}},"safeReaddir"),Hn=c(async(e,t)=>{const u=await ws(e);return(await Promise.all(u.map(async r=>{const s=Oe.join(e,r.name);return r.isDirectory()?Hn(s,t):r.isFile()?Oe.relative(t,s):[]}))).flat()},"getDirectoryFilesRecursive"),Wn=new Map,Un=c(async e=>{let t=Wn.get(e);return t||(t=Hn(e,e),Wn.set(e,t)),t},"getDirectoryFiles"),Je=/\.[^./]+$/,Gn=c((e,t)=>{const u=t.at(-1);if(!e.endsWith(u))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"),Bs=c(async(e,t)=>{const u=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(Je);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,...f]=a.split("*"),p=D.lastIndexOf("/"),l=p===-1?D:D.slice(0,p+1),g=p>=0?D.slice(p+1):"",C=c(x=>{const m=x.replace(Je,""),$=m.split("/").at(-1)||"";if(g&&!$.startsWith(g))return!1;if(f.length===1){const R=f[0];return!(R&&!(R.includes("/")?m:$).endsWith(R))}const B=g?$.slice(g.length):m;return!!Gn(B,f)},"matchesPattern");if(l==="./")return(await Promise.all(u.map(async m=>{const $=m.srcResolved;return(await Un($)).flatMap(R=>{if(!C(R))return[];const k=R.replace(Je,"");return[{...r,outputPath:m.dist+k+i}]})}))).flat();const E=u.find(({dist:x})=>l===x||l.startsWith(x));if(!E)return[];const A=b.posix.join(E.srcResolved,l.slice(E.dist.length));return(await Un(A)).flatMap(x=>{if(!C(x))return[];const m=x.replace(Je,"");if(f.length>1){const $=Gn(m,f);return[{...r,outputPath:l+$+i}]}return[{...r,outputPath:l+m+i}]})}))).flat()},"expandBuildOutputWildcards"),vs=c(async(e,t,u,n)=>{Cs(t);const r=t.type??"commonjs",s=n?.includes("false");let o=[];if(!s){o=await Bs(ys(t,r),e);const a=n?.filter(D=>D!=="false");if(a&&a.length>0){const D=a.map(f=>ms(f,f.includes("/")?{}:{matchBase:!0}));o=o.filter(f=>{const l=("error"in f?f.exportEntry:f).outputPath.replace(/^\.\//,"");return D.some(g=>g(l))})}}u.length>0&&o.push(...u.map(a=>({...a,format:ve(a.outputPath)??r})));const i=new Map;return await Promise.all(o.map(async a=>{if("error"in a)return a;const D=e.find(({dist:p})=>a.outputPath.startsWith(p));if(!D)return{exportEntry:a,error:"Ignoring file outside of dist directories"};const f=i.get(a.outputPath);if(f){if(f.format!==a.format)throw new Error(`Conflicting export types "${f.format}" & "${a.format}" found for ${a.outputPath}`)}else i.set(a.outputPath,a);return await bs(a,D)}))},"getBuildEntryPoints"),Pe=Symbol("entry"),xs=c(e=>({name:"esbuild-transform",transform:{filter:{id:/\.([cm]?[jt]s|[jt]sx)$/},async handler(t,u){const n=await Ut(t,{...e,supported:{"import-meta":!0,"import-attributes":!0},loader:"default",sourcefile:u.replace(/\.[cm]ts/,".ts")});return{code:n.code,map:n.map||null}}}}),"esbuildTransform"),$s=c(e=>{if(e==="es")return"esm";if(e==="cjs"||e==="iife")return e},"getEsbuildFormat"),ks=c(e=>({name:"esbuild-minify",renderChunk:c(async(t,u,n)=>{const r=await Ut(t,{...e,format:$s(n.format),minify:!0,keepNames:!0});return{code:r.code,map:r.map||null}},"renderChunk")}),"esbuildMinify"),bt=c((e,t)=>e[0]-t[0]||e[1]-t[1]||e[2]-t[2],"compareSemver"),qn=c(({target:e})=>{const t=e.some(u=>{if(u=u.trim(),!u.startsWith("node"))return;const n=u.slice(4).split(".").map(Number),r=[n[0],n[1]??0,n[2]??0];return!(bt(r,[12,20,0])>=0&&bt(r,[13,0,0])<0||bt(r,[14,13,1])>=0)});return{name:"node-builtins",resolveId:c(u=>{const n=u.startsWith("node:");if(t&&n&&(u=u.slice(5)),Qu.includes(u)||n)return{id:u,external:!0}},"resolveId")}},"nodeBuiltins"),Rs=c(e=>{const t=e.filter(n=>n.exportEntry.type==="binary");if(t.length===0)return{name:"patch-binary"};let u;return{name:"patch-binary",options:c(()=>{u=new Set(t.flatMap(n=>n.inputNames))},"options"),renderChunk:c((n,r,s)=>{if(!r.isEntry||!r.facadeModuleId||!u.has(r.name))return;const o=new Me(n);return o.prepend(`#!/usr/bin/env node
23
23
  `),{code:o.toString(),map:s.sourcemap?o.generateMap({hires:!0}):void 0}},"renderChunk"),writeBundle:c(async(n,r)=>{const s=new Set(Object.keys(r).map(o=>Y(Oe.join(n.dir,o))));await Promise.all(t.map(async({exportEntry:o})=>{const{outputPath:i}=o;s.has(i)&&await he.promises.chmod(i,493)}))},"writeBundle")}},"patchBinary"),Kn=c(e=>{const t=e.indexOf("/");if(t===-1)return[e,void 0];if(e[0]==="@"){const u=e.indexOf("/",t+1);return u===-1?[e,void 0]:[e.slice(0,u),e.slice(u+1)]}return[e.slice(0,t),e.slice(t+1)]},"parseSpecifier"),wt=c(e=>{const t=e[0];return!(t==="."||t==="/"||t==="#"||b.isAbsolute(e))},"isBareSpecifier"),Bt=c((e,t=process.cwd())=>Ge(b.relative(t,e)).split("/").includes("node_modules"),"isFromNodeModules"),Vn=c(()=>{const e=/\.(?:[mc]?js|jsx)$/,t={".js":[".ts",".tsx"],".jsx":[".tsx",".ts"],".mjs":[".mts"],".cjs":[".cts"]};return{name:"resolve-js-to-ts",async resolveId(u,n,r){if(!n||!e.test(u))return null;const s=u.match(e)[0],o=t[s];if(!o)return null;const i=u.slice(0,-s.length),a={...r,skipSelf:!0};if(!wt(u)&&!Bt(n)){for(const f of o){const p=await this.resolve(i+f,n,a);if(p)return p}return null}const D=await this.resolve(u,n,a);if(D)return D;for(const f of o)try{const p=await this.resolve(i+f,n,a);if(p)return p}catch{}return null}}},"resolveJsToTs"),zn=c(e=>e!==null&&typeof e=="object","A"),Re=c((e,t)=>Object.assign(new Error(`[${e}]: ${t}`),{code:e}),"a"),Jn="ERR_INVALID_PACKAGE_CONFIG",vt="ERR_INVALID_PACKAGE_TARGET",_s="ERR_PACKAGE_PATH_NOT_EXPORTED",Ss=/^\d+$/,Os=/^(\.{1,2}|node_modules)$/i,Ts=/\/|\\/;var Xn=(e=>(e.Export="exports",e.Import="imports",e))(Xn||{});const xt=c((e,t,u,n,r)=>{if(t==null)return[];if(typeof t=="string"){const[s,...o]=t.split(Ts);if(s===".."||o.some(i=>Os.test(i)))throw Re(vt,`Invalid "${e}" target "${t}" defined in the package config`);return[r?t.replace(/\*/g,r):t]}if(Array.isArray(t))return t.flatMap(s=>xt(e,s,u,n,r));if(zn(t)){for(const s of Object.keys(t)){if(Ss.test(s))throw Re(Jn,"Cannot contain numeric property keys");if(s==="default"||n.includes(s))return xt(e,t[s],u,n,r)}return[]}throw Re(vt,`Invalid "${e}" target "${t}"`)},"f"),Le="*",js=c((e,t)=>{const u=e.indexOf(Le),n=t.indexOf(Le);return u===n?t.length>e.length:n>u},"m");function Ps(e,t){if(!t.includes(Le)&&e.hasOwnProperty(t))return[t];let u,n;for(const r of Object.keys(e))if(r.includes(Le)){const[s,o,i]=r.split(Le);if(i===void 0&&t.startsWith(s)&&t.endsWith(o)){const a=t.slice(s.length,-o.length||void 0);a&&(!u||js(u,r))&&(u=r,n=a)}}return[u,n]}c(Ps,"d");const Ls=c(e=>Object.keys(e).reduce((t,u)=>{const n=u===""||u[0]!==".";if(t===void 0||t===n)return n;throw Re(Jn,'"exports" cannot contain some keys starting with "." and some not')},void 0),"p"),Ns=/^\w+:/,Is=c((e,t,u)=>{if(!e)throw new Error('"exports" is required');t=t===""?".":`./${t}`,(typeof e=="string"||Array.isArray(e)||zn(e)&&Ls(e))&&(e={".":e});const[n,r]=Ps(e,t),s=xt(Xn.Export,e[n],t,u,r);if(s.length===0)throw Re(_s,t==="."?'No "exports" main defined':`Package subpath '${t}' is not defined by "exports"`);for(const o of s)if(!o.startsWith("./")&&!Ns.test(o))throw Re(vt,`Invalid "exports" target "${o}" defined in the package config`);return s},"v");var Ms=Object.defineProperty,v=c((e,t)=>Ms(e,"name",{value:t,configurable:!0}),"i");function ae(e){return e.startsWith("\\\\?\\")?e:e.replace(/\\/g,"/")}c(ae,"h"),v(ae,"slash");const $t=v(e=>{const t=he[e];return(u,...n)=>{const r=`${e}:${n.join(":")}`;let s=u?.get(r);return s===void 0&&(s=Reflect.apply(t,he,n),u?.set(r,s)),s}},"cacheFs"),de=$t("existsSync"),Hs=$t("readFileSync"),Xe=$t("statSync"),Qn=v((e,t,u)=>{for(;;){const n=b.posix.join(e,t);if(de(u,n))return n;const r=b.dirname(e);if(r===e)return;e=r}},"findUp"),kt=/^\.{1,2}(\/.*)?$/,Rt=v(e=>{const t=ae(e);return kt.test(t)?t:`./${t}`},"normalizeRelativePath");function Zn(e,t=!1){const u=e.length;let n=0,r="",s=0,o=16,i=0,a=0,D=0,f=0,p=0;function l(m,$){let B=0,R=0;for(;B<m;){let k=e.charCodeAt(n);if(k>=48&&k<=57)R=R*16+k-48;else if(k>=65&&k<=70)R=R*16+k-65+10;else if(k>=97&&k<=102)R=R*16+k-97+10;else break;n++,B++}return B<m&&(R=-1),R}c(l,"_"),v(l,"scanHexDigits");function g(m){n=m,r="",s=0,o=16,p=0}c(g,"p"),v(g,"setPosition");function C(){let m=n;if(e.charCodeAt(n)===48)n++;else for(n++;n<e.length&&xe(e.charCodeAt(n));)n++;if(n<e.length&&e.charCodeAt(n)===46)if(n++,n<e.length&&xe(e.charCodeAt(n)))for(n++;n<e.length&&xe(e.charCodeAt(n));)n++;else return p=3,e.substring(m,n);let $=n;if(n<e.length&&(e.charCodeAt(n)===69||e.charCodeAt(n)===101))if(n++,(n<e.length&&e.charCodeAt(n)===43||e.charCodeAt(n)===45)&&n++,n<e.length&&xe(e.charCodeAt(n))){for(n++;n<e.length&&xe(e.charCodeAt(n));)n++;$=n}else p=3;return e.substring(m,$)}c(C,"D"),v(C,"scanNumber");function E(){let m="",$=n;for(;;){if(n>=u){m+=e.substring($,n),p=2;break}const B=e.charCodeAt(n);if(B===34){m+=e.substring($,n),n++;break}if(B===92){if(m+=e.substring($,n),n++,n>=u){p=2;break}switch(e.charCodeAt(n++)){case 34:m+='"';break;case 92:m+="\\";break;case 47:m+="/";break;case 98:m+="\b";break;case 102:m+="\f";break;case 110:m+=`
24
24
  `;break;case 114:m+="\r";break;case 116:m+=" ";break;case 117:const R=l(4);R>=0?m+=String.fromCharCode(R):p=4;break;default:p=5}$=n;continue}if(B>=0&&B<=31)if(_e(B)){m+=e.substring($,n),p=2;break}else p=6;n++}return m}c(E,"L"),v(E,"scanString");function A(){if(r="",p=0,s=n,a=i,f=D,n>=u)return s=u,o=17;let m=e.charCodeAt(n);if(Qe(m)){do n++,r+=String.fromCharCode(m),m=e.charCodeAt(n);while(Qe(m));return o=15}if(_e(m))return n++,r+=String.fromCharCode(m),m===13&&e.charCodeAt(n)===10&&(n++,r+=`
25
25
  `),i++,D=n,o=14;switch(m){case 123:return n++,o=1;case 125:return n++,o=2;case 91:return n++,o=3;case 93:return n++,o=4;case 58:return n++,o=6;case 44:return n++,o=5;case 34:return n++,r=E(),o=10;case 47:const $=n-1;if(e.charCodeAt(n+1)===47){for(n+=2;n<u&&!_e(e.charCodeAt(n));)n++;return r=e.substring($,n),o=12}if(e.charCodeAt(n+1)===42){n+=2;const B=u-1;let R=!1;for(;n<B;){const k=e.charCodeAt(n);if(k===42&&e.charCodeAt(n+1)===47){n+=2,R=!0;break}n++,_e(k)&&(k===13&&e.charCodeAt(n)===10&&n++,i++,D=n)}return R||(n++,p=1),r=e.substring($,n),o=13}return r+=String.fromCharCode(m),n++,o=16;case 45:if(r+=String.fromCharCode(m),n++,n===u||!xe(e.charCodeAt(n)))return o=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return r+=C(),o=11;default:for(;n<u&&_(m);)n++,m=e.charCodeAt(n);if(s!==n){switch(r=e.substring(s,n),r){case"true":return o=8;case"false":return o=9;case"null":return o=7}return o=16}return r+=String.fromCharCode(m),n++,o=16}}c(A,"T"),v(A,"scanNext");function _(m){if(Qe(m)||_e(m))return!1;switch(m){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}c(_,"F"),v(_,"isUnknownContentCharacter");function x(){let m;do m=A();while(m>=12&&m<=15);return m}return c(x,"x"),v(x,"scanNextNonTrivia"),{setPosition:g,getPosition:v(()=>n,"getPosition"),scan:t?x:A,getToken:v(()=>o,"getToken"),getTokenValue:v(()=>r,"getTokenValue"),getTokenOffset:v(()=>s,"getTokenOffset"),getTokenLength:v(()=>n-s,"getTokenLength"),getTokenStartLine:v(()=>a,"getTokenStartLine"),getTokenStartCharacter:v(()=>s-f,"getTokenStartCharacter"),getTokenError:v(()=>p,"getTokenError")}}c(Zn,"Ue"),v(Zn,"createScanner");function Qe(e){return e===32||e===9}c(Qe,"O"),v(Qe,"isWhiteSpace");function _e(e){return e===10||e===13}c(_e,"J"),v(_e,"isLineBreak");function xe(e){return e>=48&&e<=57}c(xe,"N"),v(xe,"isDigit");var Yn;(function(e){e[e.lineFeed=10]="lineFeed",e[e.carriageReturn=13]="carriageReturn",e[e.space=32]="space",e[e._0=48]="_0",e[e._1=49]="_1",e[e._2=50]="_2",e[e._3=51]="_3",e[e._4=52]="_4",e[e._5=53]="_5",e[e._6=54]="_6",e[e._7=55]="_7",e[e._8=56]="_8",e[e._9=57]="_9",e[e.a=97]="a",e[e.b=98]="b",e[e.c=99]="c",e[e.d=100]="d",e[e.e=101]="e",e[e.f=102]="f",e[e.g=103]="g",e[e.h=104]="h",e[e.i=105]="i",e[e.j=106]="j",e[e.k=107]="k",e[e.l=108]="l",e[e.m=109]="m",e[e.n=110]="n",e[e.o=111]="o",e[e.p=112]="p",e[e.q=113]="q",e[e.r=114]="r",e[e.s=115]="s",e[e.t=116]="t",e[e.u=117]="u",e[e.v=118]="v",e[e.w=119]="w",e[e.x=120]="x",e[e.y=121]="y",e[e.z=122]="z",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.asterisk=42]="asterisk",e[e.backslash=92]="backslash",e[e.closeBrace=125]="closeBrace",e[e.closeBracket=93]="closeBracket",e[e.colon=58]="colon",e[e.comma=44]="comma",e[e.dot=46]="dot",e[e.doubleQuote=34]="doubleQuote",e[e.minus=45]="minus",e[e.openBrace=123]="openBrace",e[e.openBracket=91]="openBracket",e[e.plus=43]="plus",e[e.slash=47]="slash",e[e.formFeed=12]="formFeed",e[e.tab=9]="tab"})(Yn||(Yn={})),new Array(20).fill(0).map((e,t)=>" ".repeat(t));const Se=200;new Array(Se).fill(0).map((e,t)=>`
@@ -41,4 +41,4 @@ No bundled dependencies.`;const n=e.slice().sort((r,s)=>r.name!==s.name?r.name<s
41
41
 
42
42
  ${n}`},"formatLicenseContent"),To=c(async(e,t)=>{const u=Oo(t);if(!await Mt(e)){await ue.mkdir(b.dirname(e),{recursive:!0}),await ue.writeFile(e,u,"utf8"),console.log(`License file created: ${e}`);return}const n=await ue.readFile(e,"utf8"),r=xo.exec(n);let s;r?s=n.slice(0,r.index)+u:s=`${n.trimEnd()}
43
43
 
44
- ${u}`,n!==s&&(await ue.writeFile(e,s,"utf8"),console.log(`License file updated: ${e}`))},"writeLicenseFile"),jo=c(e=>{const t=process.cwd();let u=!1;return{name:"pkgroll-license",async generateBundle(n,r){if(this.meta.watchMode||u)return;u=!0;const s=await _o(r);let o;typeof e=="string"?o=b.resolve(t,e):o=await xu(t)??b.join(t,"LICENSE"),await To(o,s)}}},"licensePlugin"),Po=c((e,t,u,n,r,s)=>{const o=Object.fromEntries(e.env.map(({key:D,value:f})=>[`process.env.${D}`,JSON.stringify(f)])),i=Object.fromEntries(e.define.map(({key:D,value:f})=>[D,f])),a={target:e.target,sourcemap:e.sourcemap,tsconfigRaw:r?.config,define:{...o,...i}};return{input:{},preserveEntrySignatures:"strict",plugins:[Wt(),qn(e),...r?[Cu(r)]:[],zu({entries:u}),Au(),yo(),Bu(t),go(),Vn(),qu({extensions:[".mjs",".js",".ts",".jsx",".tsx",".json"],exportConditions:e.exportCondition}),lo(),Vu(),xs(a),Bo(),Ku({ignoreDynamicRequires:!0,extensions:[".js",".ts",".jsx",".tsx"],transformMixedEsModules:!0}),Ju({warnOnError:!0}),ho(),Fo(s),...e.minify?[ks(a)]:[],Rs(n),...e.license?[jo(e.license)]:[]],output:[]}},"getPkgConfig"),Lo=c(async(e,t,u)=>{const[n,r]=await Promise.all([import("./rollup-plugin-dts-eXFE_I7F.mjs"),import("./local-typescript-loader-CSvrvK-x.mjs")]);return{input:{},preserveEntrySignatures:"strict",plugins:[Wt(),Au(),qn(e),...u?[Cu(u)]:[],Bu(t,{skipUnlistedWarnings:!0,forTypes:!0}),Vn(),n.default({respectExternal:!0,compilerOptions:{composite:!1,preserveSymlinks:!1,module:r.default.ModuleKind.Preserve,moduleResolution:r.default.ModuleResolutionKind.Bundler},tsconfig:u?.path,sourcemap:!!(e.sourcemap||u?.config.compilerOptions?.declarationMap)})],output:[]}},"getDtsConfig"),No=c(e=>{if(e.length===0)return"";const t=e.map(s=>s.split("/")),u=t[0],n=Math.min(...t.map(s=>s.length)),r=[];for(let s=0;s<n;s+=1){const o=u[s];if(t.every(i=>i[s]===o))r.push(o);else break}return r.length===0?"/":r.join("/")||"/"},"getCommonPath"),Io=c(async(e,t,u,n,r,s)=>{const o=Y(No(e.map(({dist:p})=>p)),!0);for(const p of e)p.distPrefix=p.dist.slice(o.length);const i=e;let a;const D=new Map;for(const p of t){const{sourcePath:l,srcExtension:g,distExtension:C,exportEntry:E}=p,A=p.srcdist,_=A.distPrefix+l.slice(A.srcResolved.length,-g.length);if(p.inputNames=[_],E.format==="types"){a||(a=await Lo(u,r,s)),a.input[_]||(a.input[_]=l);const B=a.output;if(B[C])B[C][Pe].inputNames.push(_);else{const R={dir:o,entryFileNames:`[name]${C}`,chunkFileNames:`${A.distPrefix}[name]-[hash]${C}`,exports:"auto",format:"esm",sourcemap:u.sourcemap||s?.config.compilerOptions?.declarationMap,[Pe]:p};B.push(R),B[C]=R}continue}const x=`${E.format}-${C}`;let m=D.get(x);if(!m){const B=i[0].dist;m=Po(u,r,n,t,s,B),D.set(x,m)}m.input[_]||(m.input[_]=l);const $=m.output;if($[x])$[x][Pe].inputNames.push(_);else{const B={dir:o,exports:"auto",format:E.format,sourcemap:u.sourcemap,entryFileNames:`[name]${C}`,chunkFileNames:`${A.distPrefix}[name]-[hash]${C}`,[Pe]:p};$.push(B),$[x]=B}}const f=[...D.values()];return a&&f.push(a),f},"getRollupConfigs"),Mo=c(e=>{if(!e)return Js();const t=b.resolve(e),u=lu(t);return{path:t,config:u}},"getTsconfig"),Ho=c(async e=>{await Ae(e)&&await he.promises.rm(e,{recursive:!0,force:!0})},"cleanDist"),Wo=/^[$_\p{ID_Start}][$\u200C\u200D\p{ID_Continue}]*$/u,Uo=new Set(["do","if","in","for","int","new","try","var","byte","case","char","else","enum","goto","long","null","this","true","void","with","break","catch","class","const","false","final","float","short","super","throw","while","delete","double","export","import","native","public","return","static","switch","throws","typeof","boolean","default","extends","finally","package","private","abstract","continue","debugger","function","volatile","interface","protected","transient","implements","instanceof","synchronized"]),Go=c(e=>!Wo.test(e)||Uo.has(e),"propertyNeedsQuotes"),qo=c(e=>e.map((t,u)=>typeof t=="number"?`[${t}]`:Go(t)?`[${JSON.stringify(t)}]`:u>0?`.${t}`:t).join(""),"prettyPath"),Ko=c(e=>({name:"filter-unnecessary-outputs",generateBundle:c((t,u)=>{const n=Object.keys(u).filter(o=>u[o].type==="chunk"),r=[];for(const o of n){const i=u[o];i.isEntry&&e.includes(i.name)&&r.push(o)}const s=new Set;for(;r.length>0;){const o=r.shift(),i=u[o];if(!i||s.has(o))continue;s.add(o);const a=[...i.imports,...i.dynamicImports];for(const D of a)r.push(D)}for(const o of n)s.has(o)||delete u[o]},"generateBundle")}),"filterUnnecessaryOutputs"),{stringify:ku}=JSON,Ru=c(e=>{const[t,u]=e.split("=",2);return{key:t,value:u}},"keyValue"),ce=kn({name:"pkgroll",version:rs.version,flags:{input:{type:[Ds],alias:"i",description:"Dist paths for source files to bundle (Only use if you cannot use package.json entries)"},src:{type:String,description:"Source directory (Deprecated, use `srcdist` instead)",default:"./src"},dist:{type:String,description:"Distribution directory (Deprecated, use `srcdist` instead)",default:"./dist"},srcdist:{type:[String],description:"Source and distribution folder pairs (eg. default `src:dist`)"},minify:{type:Boolean,description:"Minify output",alias:"m",default:!1},target:{type:[String],default:[`node${process.versions.node}`],description:"Environments to support. `target` in tsconfig.json is automatically added. Defaults to the current Node.js version.",alias:"t"},tsconfig:{type:String,description:"Custom tsconfig.json file path",alias:"p"},watch:{type:Boolean,description:"Watch mode",alias:"w",default:!1},env:{type:[Ru],description:"Compile-time environment variables (eg. --env.NODE_ENV=production)"},define:{type:[Ru],description:"Targeted strings to replace (eg. --define.process.env.NODE_ENV='production')"},exportCondition:{type:[String],description:"Export conditions for resolving dependency export and import maps (eg. --export-condition=node)"},sourcemap:{type:c(e=>{if(e==="")return!0;if(e==="inline")return e;throw new Error(`Invalid sourcemap option ${ku(e)}`)},"type"),description:"Sourcemap generation. Provide `inline` option for inline sourcemap (eg. --sourcemap, --sourcemap=inline)"},packagejson:{type:[String],description:"Filter package.json entry points by glob pattern on output path (eg. --packagejson='*.d.ts'). Use --packagejson=false to skip all."},cleanDist:{type:Boolean,description:"Clean dist before bundling",default:!1},license:{type:c(e=>e===""?!0:e,"type"),description:"Generate licenses for bundled dependencies. Optionally specify output path (eg. --license, --license=NOTICES.txt)"}},help:{description:"Minimalistic package bundler",render:c((e,t)=>(t.flagOperator=u=>u.name==="env"?".key=":" ",t.render(e)),"render")}}),Ht=process.cwd(),Ne=[];if(ce.flags.srcdist.length>0)for(const e of ce.flags.srcdist){const[t,u]=e.split(":",2);if(!t||!u)throw new Error(`Invalid src:dist pair ${ku(e)}. Expected format: src:dist`);Ne.push({src:Y(t,!0),srcResolved:Y(he.realpathSync.native(t),!0),dist:Y(u,!0)})}else Ne.push({src:Y(ce.flags.src,!0),srcResolved:Y(he.realpathSync.native(ce.flags.src),!0),dist:Y(ce.flags.dist,!0)});const _u=Mo(ce.flags.tsconfig),Su=_u?.config.compilerOptions?.target;Su&&ce.flags.target.push(Su);const Ou=c(async()=>{const{packageJson:e}=await ls(Ht),t=ce.flags.packagejson.length>0?ce.flags.packagejson:void 0,u=await vs(Ne,e,ce.flags.input,t);for(const r of u)if("error"in r){const{exportEntry:s}=r,o=typeof s.source=="string"?s.source:`${s.source.type}#${qo(s.source.path)}`;console.warn(`Warning (${o}):`,r.error)}const n=u.filter(r=>!("error"in r));if(n.length===0)throw new Error("No entry points found");return Io(Ne,n,ce.flags,fs(e,Ht),e,_u)},"generateRollupConfigs");(async()=>{if(ce.flags.cleanDist&&await Promise.all(Ne.map(({dist:e})=>Ho(e))),ce.flags.watch){ke("Watch initialized");let e=[];const t=c(async()=>{e=(await Ou()).map(s=>{const o=Wu(s);return o.on("event",async i=>{if(i.code==="BUNDLE_START"){const a=Array.isArray(i.input)?i.input:Object.values(i.input);ke("Building",...a.map(qe))}if(i.code==="BUNDLE_END")try{await Promise.all(s.output.map(D=>i.result.write(D)));const a=Array.isArray(i.input)?i.input:Object.values(i.input);ke("Built",...a.map(qe))}finally{await i.result.close()}i.code==="ERROR"&&(ke("Error:",i.error.message),await i.result?.close())}),o})},"startWatchers"),u=c(async()=>{await Promise.all(e.map(r=>r.close())),e=[]},"closeWatchers");await t();let n;he.watch(b.join(Ht,"package.json"),()=>{clearTimeout(n),n=setTimeout(async()=>{ke("package.json changed, restarting...");try{await u(),await t()}catch(r){ke("Error:",r.message)}},100)})}else{const e=await Ou();await Promise.all(e.map(async t=>{const u=await Hu(t);try{await Promise.all(t.output.map(n=>{const r=n[Pe].inputNames;return n.plugins=[Ko(r)],u.write(n)}))}finally{await u.close()}}))}})().catch(e=>{Uu(e),console.error("Error:",e instanceof Error?e.message:String(e)),process.exit(1)});export{Sn as g};
44
+ ${u}`,n!==s&&(await ue.writeFile(e,s,"utf8"),console.log(`License file updated: ${e}`))},"writeLicenseFile"),jo=c(e=>{const t=process.cwd();let u=!1;return{name:"pkgroll-license",async generateBundle(n,r){if(this.meta.watchMode||u)return;u=!0;const s=await _o(r);let o;typeof e=="string"?o=b.resolve(t,e):o=await xu(t)??b.join(t,"LICENSE"),await To(o,s)}}},"licensePlugin"),Po=c((e,t,u,n,r,s)=>{const o=Object.fromEntries(e.env.map(({key:D,value:f})=>[`process.env.${D}`,JSON.stringify(f)])),i=Object.fromEntries(e.define.map(({key:D,value:f})=>[D,f])),a={target:e.target,sourcemap:e.sourcemap,tsconfigRaw:r?.config,define:{...o,...i}};return{input:{},preserveEntrySignatures:"strict",plugins:[Wt(),qn(e),...r?[Cu(r)]:[],zu({entries:u}),Au(),yo(),Bu(t),go(),Vn(),qu({extensions:[".mjs",".js",".ts",".jsx",".tsx",".json"],exportConditions:e.exportCondition}),lo(),Vu(),xs(a),Bo(),Ku({ignoreDynamicRequires:!0,extensions:[".js",".ts",".jsx",".tsx"],transformMixedEsModules:!0}),Ju({warnOnError:!0}),ho(),Fo(s),...e.minify?[ks(a)]:[],Rs(n),...e.license?[jo(e.license)]:[]],output:[]}},"getPkgConfig"),Lo=c(async(e,t,u)=>{const[n,r]=await Promise.all([import("./rollup-plugin-dts-p72JBgnA.mjs"),import("./local-typescript-loader-CSvrvK-x.mjs")]);return{input:{},preserveEntrySignatures:"strict",plugins:[Wt(),Au(),qn(e),...u?[Cu(u)]:[],Bu(t,{skipUnlistedWarnings:!0,forTypes:!0}),Vn(),n.default({respectExternal:!0,compilerOptions:{composite:!1,preserveSymlinks:!1,module:r.default.ModuleKind.Preserve,moduleResolution:r.default.ModuleResolutionKind.Bundler},tsconfig:u?.path,sourcemap:!!(e.sourcemap||u?.config.compilerOptions?.declarationMap)})],output:[]}},"getDtsConfig"),No=c(e=>{if(e.length===0)return"";const t=e.map(s=>s.split("/")),u=t[0],n=Math.min(...t.map(s=>s.length)),r=[];for(let s=0;s<n;s+=1){const o=u[s];if(t.every(i=>i[s]===o))r.push(o);else break}return r.length===0?"/":r.join("/")||"/"},"getCommonPath"),Io=c(async(e,t,u,n,r,s)=>{const o=Y(No(e.map(({dist:p})=>p)),!0);for(const p of e)p.distPrefix=p.dist.slice(o.length);const i=e;let a;const D=new Map;for(const p of t){const{sourcePath:l,srcExtension:g,distExtension:C,exportEntry:E}=p,A=p.srcdist,_=A.distPrefix+l.slice(A.srcResolved.length,-g.length);if(p.inputNames=[_],E.format==="types"){a||(a=await Lo(u,r,s)),a.input[_]||(a.input[_]=l);const B=a.output;if(B[C])B[C][Pe].inputNames.push(_);else{const R={dir:o,entryFileNames:`[name]${C}`,chunkFileNames:`${A.distPrefix}[name]-[hash]${C}`,exports:"auto",format:"esm",sourcemap:u.sourcemap||s?.config.compilerOptions?.declarationMap,[Pe]:p};B.push(R),B[C]=R}continue}const x=`${E.format}-${C}`;let m=D.get(x);if(!m){const B=i[0].dist;m=Po(u,r,n,t,s,B),D.set(x,m)}m.input[_]||(m.input[_]=l);const $=m.output;if($[x])$[x][Pe].inputNames.push(_);else{const B={dir:o,exports:"auto",format:E.format,sourcemap:u.sourcemap,entryFileNames:`[name]${C}`,chunkFileNames:`${A.distPrefix}[name]-[hash]${C}`,[Pe]:p};$.push(B),$[x]=B}}const f=[...D.values()];return a&&f.push(a),f},"getRollupConfigs"),Mo=c(e=>{if(!e)return Js();const t=b.resolve(e),u=lu(t);return{path:t,config:u}},"getTsconfig"),Ho=c(async e=>{await Ae(e)&&await he.promises.rm(e,{recursive:!0,force:!0})},"cleanDist"),Wo=/^[$_\p{ID_Start}][$\u200C\u200D\p{ID_Continue}]*$/u,Uo=new Set(["do","if","in","for","int","new","try","var","byte","case","char","else","enum","goto","long","null","this","true","void","with","break","catch","class","const","false","final","float","short","super","throw","while","delete","double","export","import","native","public","return","static","switch","throws","typeof","boolean","default","extends","finally","package","private","abstract","continue","debugger","function","volatile","interface","protected","transient","implements","instanceof","synchronized"]),Go=c(e=>!Wo.test(e)||Uo.has(e),"propertyNeedsQuotes"),qo=c(e=>e.map((t,u)=>typeof t=="number"?`[${t}]`:Go(t)?`[${JSON.stringify(t)}]`:u>0?`.${t}`:t).join(""),"prettyPath"),Ko=c(e=>({name:"filter-unnecessary-outputs",generateBundle:c((t,u)=>{const n=Object.keys(u).filter(o=>u[o].type==="chunk"),r=[];for(const o of n){const i=u[o];i.isEntry&&e.includes(i.name)&&r.push(o)}const s=new Set;for(;r.length>0;){const o=r.shift(),i=u[o];if(!i||s.has(o))continue;s.add(o);const a=[...i.imports,...i.dynamicImports];for(const D of a)r.push(D)}for(const o of n)s.has(o)||delete u[o]},"generateBundle")}),"filterUnnecessaryOutputs"),{stringify:ku}=JSON,Ru=c(e=>{const[t,u]=e.split("=",2);return{key:t,value:u}},"keyValue"),ce=kn({name:"pkgroll",version:rs.version,flags:{input:{type:[Ds],alias:"i",description:"Dist paths for source files to bundle (Only use if you cannot use package.json entries)"},src:{type:String,description:"Source directory (Deprecated, use `srcdist` instead)",default:"./src"},dist:{type:String,description:"Distribution directory (Deprecated, use `srcdist` instead)",default:"./dist"},srcdist:{type:[String],description:"Source and distribution folder pairs (eg. default `src:dist`)"},minify:{type:Boolean,description:"Minify output",alias:"m",default:!1},target:{type:[String],default:[`node${process.versions.node}`],description:"Environments to support. `target` in tsconfig.json is automatically added. Defaults to the current Node.js version.",alias:"t"},tsconfig:{type:String,description:"Custom tsconfig.json file path",alias:"p"},watch:{type:Boolean,description:"Watch mode",alias:"w",default:!1},env:{type:[Ru],description:"Compile-time environment variables (eg. --env.NODE_ENV=production)"},define:{type:[Ru],description:"Targeted strings to replace (eg. --define.process.env.NODE_ENV='production')"},exportCondition:{type:[String],description:"Export conditions for resolving dependency export and import maps (eg. --export-condition=node)"},sourcemap:{type:c(e=>{if(e==="")return!0;if(e==="inline")return e;throw new Error(`Invalid sourcemap option ${ku(e)}`)},"type"),description:"Sourcemap generation. Provide `inline` option for inline sourcemap (eg. --sourcemap, --sourcemap=inline)"},packagejson:{type:[String],description:"Filter package.json entry points by glob pattern on output path (eg. --packagejson='*.d.ts'). Use --packagejson=false to skip all."},cleanDist:{type:Boolean,description:"Clean dist before bundling",default:!1},license:{type:c(e=>e===""?!0:e,"type"),description:"Generate licenses for bundled dependencies. Optionally specify output path (eg. --license, --license=NOTICES.txt)"}},help:{description:"Minimalistic package bundler",render:c((e,t)=>(t.flagOperator=u=>u.name==="env"?".key=":" ",t.render(e)),"render")}}),Ht=process.cwd(),Ne=[];if(ce.flags.srcdist.length>0)for(const e of ce.flags.srcdist){const[t,u]=e.split(":",2);if(!t||!u)throw new Error(`Invalid src:dist pair ${ku(e)}. Expected format: src:dist`);Ne.push({src:Y(t,!0),srcResolved:Y(he.realpathSync.native(t),!0),dist:Y(u,!0)})}else Ne.push({src:Y(ce.flags.src,!0),srcResolved:Y(he.realpathSync.native(ce.flags.src),!0),dist:Y(ce.flags.dist,!0)});const _u=Mo(ce.flags.tsconfig),Su=_u?.config.compilerOptions?.target;Su&&ce.flags.target.push(Su);const Ou=c(async()=>{const{packageJson:e}=await ls(Ht),t=ce.flags.packagejson.length>0?ce.flags.packagejson:void 0,u=await vs(Ne,e,ce.flags.input,t);for(const r of u)if("error"in r){const{exportEntry:s}=r,o=typeof s.source=="string"?s.source:`${s.source.type}#${qo(s.source.path)}`;console.warn(`Warning (${o}):`,r.error)}const n=u.filter(r=>!("error"in r));if(n.length===0)throw new Error("No entry points found");return Io(Ne,n,ce.flags,fs(e,Ht),e,_u)},"generateRollupConfigs");(async()=>{if(ce.flags.cleanDist&&await Promise.all(Ne.map(({dist:e})=>Ho(e))),ce.flags.watch){ke("Watch initialized");let e=[];const t=c(async()=>{e=(await Ou()).map(s=>{const o=Wu(s);return o.on("event",async i=>{if(i.code==="BUNDLE_START"){const a=Array.isArray(i.input)?i.input:Object.values(i.input);ke("Building",...a.map(qe))}if(i.code==="BUNDLE_END")try{await Promise.all(s.output.map(D=>i.result.write(D)));const a=Array.isArray(i.input)?i.input:Object.values(i.input);ke("Built",...a.map(qe))}finally{await i.result.close()}i.code==="ERROR"&&(ke("Error:",i.error.message),await i.result?.close())}),o})},"startWatchers"),u=c(async()=>{await Promise.all(e.map(r=>r.close())),e=[]},"closeWatchers");await t();let n;he.watch(b.join(Ht,"package.json"),()=>{clearTimeout(n),n=setTimeout(async()=>{ke("package.json changed, restarting...");try{await u(),await t()}catch(r){ke("Error:",r.message)}},100)})}else{const e=await Ou();await Promise.all(e.map(async t=>{const u=await Hu(t);try{await Promise.all(t.output.map(n=>{const r=n[Pe].inputNames;return n.plugins=[Ko(r)],u.write(n)}))}finally{await u.close()}}))}})().catch(e=>{Uu(e),console.error("Error:",e instanceof Error?e.message:String(e)),process.exit(1)});export{Sn as g};
package/dist/cli.mjs CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import"node:fs";import"node:path";import"./cli-C0ikXwcS.mjs";import"rollup";import"rollup-plugin-import-trace";import"tty";import"node:fs/promises";import"yaml";import"node:path/posix";import"@rollup/plugin-node-resolve";import"@rollup/plugin-commonjs";import"@rollup/plugin-json";import"@rollup/plugin-alias";import"@rollup/plugin-dynamic-import-vars";import"esbuild";import"node:module";import"magic-string";import"fs";import"os";import"path";import"rollup-pluginutils";import"node:url";import"cjs-module-lexer";
2
+ import"node:fs";import"node:path";import"./cli-DrYwvddJ.mjs";import"rollup";import"rollup-plugin-import-trace";import"tty";import"node:fs/promises";import"yaml";import"node:path/posix";import"@rollup/plugin-node-resolve";import"@rollup/plugin-commonjs";import"@rollup/plugin-json";import"@rollup/plugin-alias";import"@rollup/plugin-dynamic-import-vars";import"esbuild";import"node:module";import"magic-string";import"fs";import"os";import"path";import"rollup-pluginutils";import"node:url";import"cjs-module-lexer";
@@ -1,6 +1,6 @@
1
- var Qe=Object.defineProperty;var c=(n,e)=>Qe(n,"name",{value:e,configurable:!0});import{createRequire as Ye}from"node:module";const Ze=Ye(import.meta.url);import*as T from"node:path";import i from"typescript";import{createRequire as et}from"node:module";import X from"magic-string";import le from"node:fs/promises";import{g as tt}from"./cli-C0ikXwcS.mjs";import"node:fs";import"tty";import"rollup";import"rollup-plugin-import-trace";import"yaml";import"node:path/posix";import"@rollup/plugin-node-resolve";import"@rollup/plugin-commonjs";import"@rollup/plugin-json";import"@rollup/plugin-alias";import"@rollup/plugin-dynamic-import-vars";import"esbuild";import"fs";import"os";import"path";import"rollup-pluginutils";import"node:url";import"cjs-module-lexer";var ue=44,nt=59,pe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",fe=new Uint8Array(64),me=new Uint8Array(128);for(let n=0;n<pe.length;n++){const e=pe.charCodeAt(n);fe[n]=e,me[e]=n}function K(n,e){let t=0,r=0,s=0;do{const a=n.next();s=me[a],t|=(s&31)<<r,r+=5}while(s&32);const o=t&1;return t>>>=1,o&&(t=-2147483648|-t),e+t}c(K,"decodeInteger");function z(n,e,t){let r=e-t;r=r<0?-r<<1|1:r<<1;do{let s=r&31;r>>>=5,r>0&&(s|=32),n.write(fe[s])}while(r>0);return e}c(z,"encodeInteger");function de(n,e){return n.pos>=e?!1:n.peek()!==ue}c(de,"hasMoreVlq");var he=1024*16,ye=typeof TextDecoder<"u"?new TextDecoder:typeof Buffer<"u"?{decode(n){return Buffer.from(n.buffer,n.byteOffset,n.byteLength).toString()}}:{decode(n){let e="";for(let t=0;t<n.length;t++)e+=String.fromCharCode(n[t]);return e}},rt=class{static{c(this,"StringWriter")}constructor(){this.pos=0,this.out="",this.buffer=new Uint8Array(he)}write(n){const{buffer:e}=this;e[this.pos++]=n,this.pos===he&&(this.out+=ye.decode(e),this.pos=0)}flush(){const{buffer:n,out:e,pos:t}=this;return t>0?e+ye.decode(n.subarray(0,t)):e}},st=class{static{c(this,"StringReader")}constructor(n){this.pos=0,this.buffer=n}next(){return this.buffer.charCodeAt(this.pos++)}peek(){return this.buffer.charCodeAt(this.pos)}indexOf(n){const{buffer:e,pos:t}=this,r=e.indexOf(n,t);return r===-1?e.length:r}};function Q(n){const{length:e}=n,t=new st(n),r=[];let s=0,o=0,a=0,u=0,m=0;do{const p=t.indexOf(";"),d=[];let h=!0,l=0;for(s=0;t.pos<p;){let y;s=K(t,s),s<l&&(h=!1),l=s,de(t,p)?(o=K(t,o),a=K(t,a),u=K(t,u),de(t,p)?(m=K(t,m),y=[s,o,a,u,m]):y=[s,o,a,u]):y=[s],d.push(y),t.pos++}h||it(d),r.push(d),t.pos=p+1}while(t.pos<=e);return r}c(Q,"decode");function it(n){n.sort(ot)}c(it,"sort");function ot(n,e){return n[0]-e[0]}c(ot,"sortComparator$1");function ge(n){const e=new rt;let t=0,r=0,s=0,o=0;for(let a=0;a<n.length;a++){const u=n[a];if(a>0&&e.write(nt),u.length===0)continue;let m=0;for(let p=0;p<u.length;p++){const d=u[p];p>0&&e.write(ue),m=z(e,d[0],m),d.length!==1&&(t=z(e,d[1],t),r=z(e,d[2],r),s=z(e,d[3],s),d.length!==4&&(o=z(e,d[4],o)))}}return e.flush()}c(ge,"encode");const at=/^[\w+.-]+:\/\//,ct=/^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/,lt=/^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;function ut(n){return at.test(n)}c(ut,"isAbsoluteUrl");function pt(n){return n.startsWith("//")}c(pt,"isSchemeRelativeUrl");function xe(n){return n.startsWith("/")}c(xe,"isAbsolutePath");function ft(n){return n.startsWith("file:")}c(ft,"isFileUrl");function Se(n){return/^[.?#]/.test(n)}c(Se,"isRelative");function q(n){const e=ct.exec(n);return ve(e[1],e[2]||"",e[3],e[4]||"",e[5]||"/",e[6]||"",e[7]||"")}c(q,"parseAbsoluteUrl");function mt(n){const e=lt.exec(n),t=e[2];return ve("file:","",e[1]||"","",xe(t)?t:"/"+t,e[3]||"",e[4]||"")}c(mt,"parseFileUrl");function ve(n,e,t,r,s,o,a){return{scheme:n,user:e,host:t,port:r,path:s,query:o,hash:a,type:7}}c(ve,"makeUrl");function Ee(n){if(pt(n)){const t=q("http:"+n);return t.scheme="",t.type=6,t}if(xe(n)){const t=q("http://foo.com"+n);return t.scheme="",t.host="",t.type=5,t}if(ft(n))return mt(n);if(ut(n))return q(n);const e=q("http://foo.com/"+n);return e.scheme="",e.host="",e.type=n?n.startsWith("?")?3:n.startsWith("#")?2:4:1,e}c(Ee,"parseUrl");function dt(n){if(n.endsWith("/.."))return n;const e=n.lastIndexOf("/");return n.slice(0,e+1)}c(dt,"stripPathFilename");function ht(n,e){Te(e,e.type),n.path==="/"?n.path=e.path:n.path=dt(e.path)+n.path}c(ht,"mergePaths");function Te(n,e){const t=e<=4,r=n.path.split("/");let s=1,o=0,a=!1;for(let m=1;m<r.length;m++){const p=r[m];if(!p){a=!0;continue}if(a=!1,p!=="."){if(p===".."){o?(a=!0,o--,s--):t&&(r[s++]=p);continue}r[s++]=p,o++}}let u="";for(let m=1;m<s;m++)u+="/"+r[m];(!u||a&&!u.endsWith("/.."))&&(u+="/"),n.path=u}c(Te,"normalizePath");function yt(n,e){if(!n&&!e)return"";const t=Ee(n);let r=t.type;if(e&&r!==7){const o=Ee(e),a=o.type;switch(r){case 1:t.hash=o.hash;case 2:t.query=o.query;case 3:case 4:ht(t,o);case 5:t.user=o.user,t.host=o.host,t.port=o.port;case 6:t.scheme=o.scheme}a>r&&(r=a)}Te(t,r);const s=t.query+t.hash;switch(r){case 2:case 3:return s;case 4:{const o=t.path.slice(1);return o?Se(e||n)&&!Se(o)?"./"+o+s:o+s:s||"."}case 5:return t.path+s;default:return t.scheme+"//"+t.user+t.host+t.port+t.path+s}}c(yt,"resolve");function gt(n){if(!n)return"";const e=n.lastIndexOf("/");return n.slice(0,e+1)}c(gt,"stripFilename");function xt(n,e){const t=gt(n),r=e?e+"/":"";return s=>yt(r+(s||""),t)}c(xt,"resolver");var k=0;function St(n,e){const t=Ne(n,0);if(t===n.length)return n;e||(n=n.slice());for(let r=t;r<n.length;r=Ne(n,r+1))n[r]=Et(n[r],e);return n}c(St,"maybeSort");function Ne(n,e){for(let t=e;t<n.length;t++)if(!vt(n[t]))return t;return n.length}c(Ne,"nextUnsortedSegmentLine");function vt(n){for(let e=1;e<n.length;e++)if(n[e][k]<n[e-1][k])return!1;return!0}c(vt,"isSorted");function Et(n,e){return e||(n=n.slice()),n.sort(Tt)}c(Et,"sortSegments");function Tt(n,e){return n[k]-e[k]}c(Tt,"sortComparator");var H=!1;function Nt(n,e,t,r){for(;t<=r;){const s=t+(r-t>>1),o=n[s][k]-e;if(o===0)return H=!0,s;o<0?t=s+1:r=s-1}return H=!1,t-1}c(Nt,"binarySearch");function Ct(n,e,t){for(let r=t-1;r>=0&&n[r][k]===e;t=r--);return t}c(Ct,"lowerBound");function wt(){return{lastKey:-1,lastNeedle:-1,lastIndex:-1}}c(wt,"memoizedState");function Dt(n,e,t,r){const{lastKey:s,lastNeedle:o,lastIndex:a}=t;let u=0,m=n.length-1;if(r===s){if(e===o)return H=a!==-1&&n[a][k]===e,a;e>=o?u=a===-1?0:a:m=a}return t.lastKey=r,t.lastNeedle=e,t.lastIndex=Nt(n,e,u,m)}c(Dt,"memoizedBinarySearch");function bt(n){return typeof n=="string"?JSON.parse(n):n}c(bt,"parse$1");var Ce=class{static{c(this,"TraceMap")}constructor(n,e){const t=typeof n=="string";if(!t&&n._decodedMemo)return n;const r=bt(n),{version:s,file:o,names:a,sourceRoot:u,sources:m,sourcesContent:p}=r;this.version=s,this.file=o,this.names=a||[],this.sourceRoot=u,this.sources=m,this.sourcesContent=p,this.ignoreList=r.ignoreList||r.x_google_ignoreList||void 0;const d=xt(e,u);this.resolvedSources=m.map(d);const{mappings:h}=r;if(typeof h=="string")this._encoded=h,this._decoded=void 0;else if(Array.isArray(h))this._encoded=void 0,this._decoded=St(h,t);else throw r.sections?new Error("TraceMap passed sectioned source map, please use FlattenMap export instead"):new Error(`invalid source map: ${JSON.stringify(r)}`);this._decodedMemo=wt(),this._bySources=void 0,this._bySourceMemos=void 0}};function er(n){return n}c(er,"cast$1");function we(n){var e;return(e=n)._decoded||(e._decoded=Q(n._encoded))}c(we,"decodedMappings");function It(n,e,t){const r=we(n);if(e>=r.length)return null;const s=r[e],o=Mt(s,n._decodedMemo,e,t);return o===-1?null:s[o]}c(It,"traceSegment");function Mt(n,e,t,r,s){let o=Dt(n,r,e,t);return H&&(o=Ct(n,r,o)),o===-1||o===n.length?-1:o}c(Mt,"traceSegmentInternal");var Y=class{static{c(this,"SetArray")}constructor(){this._indexes={__proto__:null},this.array=[]}};function tr(n){return n}c(tr,"cast");function De(n,e){return n._indexes[e]}c(De,"get");function V(n,e){const t=De(n,e);if(t!==void 0)return t;const{array:r,_indexes:s}=n,o=r.push(e);return s[e]=o-1}c(V,"put");function Ft(n,e){const t=De(n,e);if(t===void 0)return;const{array:r,_indexes:s}=n;for(let o=t+1;o<r.length;o++){const a=r[o];r[o-1]=a,s[a]--}s[e]=void 0,r.pop()}c(Ft,"remove");var Ot=0,Rt=1,At=2,Lt=3,Pt=4,be=-1,_t=class{static{c(this,"GenMapping")}constructor({file:n,sourceRoot:e}={}){this._names=new Y,this._sources=new Y,this._sourcesContent=[],this._mappings=[],this.file=n,this.sourceRoot=e,this._ignoreList=new Y}};function nr(n){return n}c(nr,"cast2");var $t=c((n,e,t,r,s,o,a,u)=>Ut(!0,n,e,t,r,s,o,a),"maybeAddSegment");function Bt(n,e,t){const{_sources:r,_sourcesContent:s}=n,o=V(r,e);s[o]=t}c(Bt,"setSourceContent");function kt(n,e,t=!0){const{_sources:r,_sourcesContent:s,_ignoreList:o}=n,a=V(r,e);a===s.length&&(s[a]=null),t?V(o,a):Ft(o,a)}c(kt,"setIgnore");function Ie(n){const{_mappings:e,_sources:t,_sourcesContent:r,_names:s,_ignoreList:o}=n;return Vt(e),{version:3,file:n.file||void 0,names:s.array,sourceRoot:n.sourceRoot||void 0,sources:t.array,sourcesContent:r,mappings:e,ignoreList:o.array}}c(Ie,"toDecodedMap");function jt(n){const e=Ie(n);return Object.assign({},e,{mappings:ge(e.mappings)})}c(jt,"toEncodedMap");function Ut(n,e,t,r,s,o,a,u,m){const{_mappings:p,_sources:d,_sourcesContent:h,_names:l}=e,y=Kt(p,t),x=zt(y,r);if(!s)return Jt(y,x)?void 0:Me(y,x,[r]);const S=V(d,s),E=u?V(l,u):be;if(S===h.length&&(h[S]=null),!Wt(y,x,S,o,a,E))return Me(y,x,u?[r,S,o,a,E]:[r,S,o,a])}c(Ut,"addSegmentInternal");function Kt(n,e){for(let t=n.length;t<=e;t++)n[t]=[];return n[e]}c(Kt,"getIndex");function zt(n,e){let t=n.length;for(let r=t-1;r>=0;t=r--){const s=n[r];if(e>=s[Ot])break}return t}c(zt,"getColumnIndex");function Me(n,e,t){for(let r=n.length;r>e;r--)n[r]=n[r-1];n[e]=t}c(Me,"insert");function Vt(n){const{length:e}=n;let t=e;for(let r=t-1;r>=0&&!(n[r].length>0);t=r,r--);t<e&&(n.length=t)}c(Vt,"removeEmptyFinalLines");function Jt(n,e){return e===0?!0:n[e-1].length===1}c(Jt,"skipSourceless");function Wt(n,e,t,r,s,o){if(e===0)return!1;const a=n[e-1];return a.length===1?!1:t===a[Rt]&&r===a[At]&&s===a[Lt]&&o===(a.length===5?a[Pt]:be)}c(Wt,"skipSource");var Fe=Oe("",-1,-1,"",null,!1),Gt=[];function Oe(n,e,t,r,s,o){return{source:n,line:e,column:t,name:r,content:s,ignore:o}}c(Oe,"SegmentObject");function Re(n,e,t,r,s){return{map:n,sources:e,source:t,content:r,ignore:s}}c(Re,"Source");function Ae(n,e){return Re(n,e,"",null,!1)}c(Ae,"MapSource");function qt(n,e,t){return Re(null,Gt,n,e,t)}c(qt,"OriginalSource");function Ht(n){const e=new _t({file:n.map.file}),{sources:t,map:r}=n,s=r.names,o=we(r);for(let a=0;a<o.length;a++){const u=o[a];for(let m=0;m<u.length;m++){const p=u[m],d=p[0];let h=Fe;if(p.length!==1){const D=t[p[1]];if(h=Le(D,p[2],p[3],p.length===5?s[p[4]]:""),h==null)continue}const{column:l,line:y,name:x,content:S,source:E,ignore:N}=h;$t(e,a,d,E,y,l,x),E&&S!=null&&Bt(e,E,S),N&&kt(e,E,!0)}}return e}c(Ht,"traceMappings");function Le(n,e,t,r){if(!n.map)return Oe(n.source,e,t,r,n.content,n.ignore);const s=It(n.map,e,t);return s==null?null:s.length===1?Fe:Le(n.sources[s[1]],s[2],s[3],s.length===5?n.map.names[s[4]]:r)}c(Le,"originalPositionFor");function Xt(n){return Array.isArray(n)?n:[n]}c(Xt,"asArray");function Qt(n,e){const t=Xt(n).map(o=>new Ce(o,"")),r=t.pop();for(let o=0;o<t.length;o++)if(t[o].sources.length>1)throw new Error(`Transformation map ${o} must have exactly one source file.
2
- Did you specify these with the most recent transformation maps first?`);let s=Pe(r,e,"",0);for(let o=t.length-1;o>=0;o--)s=Ae(t[o],[s]);return s}c(Qt,"buildSourceMapTree");function Pe(n,e,t,r){const{resolvedSources:s,sourcesContent:o,ignoreList:a}=n,u=r+1,m=s.map((p,d)=>{const h={importer:t,depth:u,source:p||"",content:void 0,ignore:void 0},l=e(h.source,h),{source:y}=h;if(l)return Pe(new Ce(l,y),e,y,u);const x=o?o[d]:null,S=a?a.includes(d):!1;return qt(y,x,S)});return Ae(n,m)}c(Pe,"build");var Yt=class{static{c(this,"SourceMap")}constructor(n,e){const t=e.decodedMappings?Ie(n):jt(n);this.version=t.version,this.file=t.file,this.mappings=t.mappings,this.names=t.names,this.ignoreList=t.ignoreList,this.sourceRoot=t.sourceRoot,this.sources=t.sources,e.excludeContent||(this.sourcesContent=t.sourcesContent)}toString(){return JSON.stringify(this)}};function Zt(n,e,t){const r={excludeContent:!1,decodedMappings:!1},s=Qt(n,e);return new Yt(Ht(s),r)}c(Zt,"remapping");var Z={},_e;function en(){return _e||(_e=1,(function(n){Object.defineProperty(n,"commentRegex",{get:c(function(){return/^\s*?\/[\/\*][@#]\s+?sourceMappingURL=data:(((?:application|text)\/json)(?:;charset=([^;,]+?)?)?)?(?:;(base64))?,(.*?)$/mg},"getCommentRegex")}),Object.defineProperty(n,"mapFileCommentRegex",{get:c(function(){return/(?:\/\/[@#][ \t]+?sourceMappingURL=([^\s'"`]+?)[ \t]*?$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^*]+?)[ \t]*?(?:\*\/){1}[ \t]*?$)/mg},"getMapFileCommentRegex")});var e;typeof Buffer<"u"?typeof Buffer.from=="function"?e=t:e=r:e=s;function t(l){return Buffer.from(l,"base64").toString()}c(t,"decodeBase64WithBufferFrom");function r(l){if(typeof value=="number")throw new TypeError("The value to decode must not be of type number.");return new Buffer(l,"base64").toString()}c(r,"decodeBase64WithNewBuffer");function s(l){return decodeURIComponent(escape(atob(l)))}c(s,"decodeBase64WithAtob");function o(l){return l.split(",").pop()}c(o,"stripComment");function a(l,y){var x=n.mapFileCommentRegex.exec(l),S=x[1]||x[2];try{var l=y(S);return l!=null&&typeof l.catch=="function"?l.catch(E):l}catch(N){E(N)}function E(N){throw new Error("An error occurred while trying to read the map file at "+S+`
3
- `+N.stack)}c(E,"throwError")}c(a,"readFromFileMap");function u(l,y){y=y||{},y.hasComment&&(l=o(l)),y.encoding==="base64"?l=e(l):y.encoding==="uri"&&(l=decodeURIComponent(l)),(y.isJSON||y.encoding)&&(l=JSON.parse(l)),this.sourcemap=l}c(u,"Converter"),u.prototype.toJSON=function(l){return JSON.stringify(this.sourcemap,null,l)},typeof Buffer<"u"?typeof Buffer.from=="function"?u.prototype.toBase64=m:u.prototype.toBase64=p:u.prototype.toBase64=d;function m(){var l=this.toJSON();return Buffer.from(l,"utf8").toString("base64")}c(m,"encodeBase64WithBufferFrom");function p(){var l=this.toJSON();if(typeof l=="number")throw new TypeError("The json to encode must not be of type number.");return new Buffer(l,"utf8").toString("base64")}c(p,"encodeBase64WithNewBuffer");function d(){var l=this.toJSON();return btoa(unescape(encodeURIComponent(l)))}c(d,"encodeBase64WithBtoa"),u.prototype.toURI=function(){var l=this.toJSON();return encodeURIComponent(l)},u.prototype.toComment=function(l){var y,x,S;return l!=null&&l.encoding==="uri"?(y="",x=this.toURI()):(y=";base64",x=this.toBase64()),S="sourceMappingURL=data:application/json;charset=utf-8"+y+","+x,l!=null&&l.multiline?"/*# "+S+" */":"//# "+S},u.prototype.toObject=function(){return JSON.parse(this.toJSON())},u.prototype.addProperty=function(l,y){if(this.sourcemap.hasOwnProperty(l))throw new Error('property "'+l+'" already exists on the sourcemap, use set property instead');return this.setProperty(l,y)},u.prototype.setProperty=function(l,y){return this.sourcemap[l]=y,this},u.prototype.getProperty=function(l){return this.sourcemap[l]},n.fromObject=function(l){return new u(l)},n.fromJSON=function(l){return new u(l,{isJSON:!0})},n.fromURI=function(l){return new u(l,{encoding:"uri"})},n.fromBase64=function(l){return new u(l,{encoding:"base64"})},n.fromComment=function(l){var y,x;return l=l.replace(/^\/\*/g,"//").replace(/\*\/$/g,""),y=n.commentRegex.exec(l),x=y&&y[4]||"uri",new u(l,{encoding:x,hasComment:!0})};function h(l){return new u(l,{isJSON:!0})}c(h,"makeConverter"),n.fromMapFileComment=function(l,y){if(typeof y=="string")throw new Error("String directory paths are no longer supported with `fromMapFileComment`\nPlease review the Upgrading documentation at https://github.com/thlorenz/convert-source-map#upgrading");var x=a(l,y);return x!=null&&typeof x.then=="function"?x.then(h):h(x)},n.fromSource=function(l){var y=l.match(n.commentRegex);return y?n.fromComment(y.pop()):null},n.fromMapFileSource=function(l,y){if(typeof y=="string")throw new Error("String directory paths are no longer supported with `fromMapFileSource`\nPlease review the Upgrading documentation at https://github.com/thlorenz/convert-source-map#upgrading");var x=l.match(n.mapFileCommentRegex);return x?n.fromMapFileComment(x.pop(),y):null},n.removeComments=function(l){return l.replace(n.commentRegex,"")},n.removeMapFileComments=function(l){return l.replace(n.mapFileCommentRegex,"")},n.generateMapFileComment=function(l,y){var x="sourceMappingURL="+l;return y&&y.multiline?"/*# "+x+" */":"//# "+x}})(Z)),Z}c(en,"requireConvertSourceMap");var tn=en(),$e=tt(tn);function nn(n){return{...n,compilerOptions:n.compilerOptions??{},respectExternal:n.respectExternal??!1,includeExternal:n.includeExternal??[],sourcemap:n.sourcemap??!1}}c(nn,"resolveDefaultOptions");const j=/\.d\.(c|m)?tsx?$/,ee=/\.json$/,Be=/((\.d)?\.(c|m)?(t|j)sx?|\.json)$/;function te(n){return n.replace(Be,"")}c(te,"trimExtension");function ke(n){return n.replace(Be,".d.ts")}c(ke,"getDeclarationId");function J(n,e){return i.createSourceFile(n,e,i.ScriptTarget.Latest,!0)}c(J,"parse");const ne={getCurrentDirectory:c(()=>i.sys.getCurrentDirectory(),"getCurrentDirectory"),getNewLine:c(()=>i.sys.newLine,"getNewLine"),getCanonicalFileName:i.sys.useCaseSensitiveFileNames?n=>n:n=>n.toLowerCase()},rn={declaration:!0,noEmit:!1,emitDeclarationOnly:!0,noEmitOnError:!0,checkJs:!1,declarationMap:!1,skipLibCheck:!0,preserveSymlinks:!0,target:i.ScriptTarget.ESNext,resolveJsonModule:!0},W=new Map,U=c((...n)=>process.env.DTS_LOG_CACHE?console.log("[cache]",...n):null,"logCache");function je([n,e],t){for(U(n),W.set(n,t);n!==e&&n!==T.dirname(n);){if(n=T.dirname(n),U("up",n),W.has(n))return U("has",n);W.set(n,t)}}c(je,"cacheConfig");function re(n,e,t,r){const s={...rn,...e,...r===!0&&{declarationMap:!0}};let o=T.dirname(n),a=[];const u=t||o;if(W.has(u))U("HIT",u);else{U("miss",u);const h=t?T.resolve(process.cwd(),t):i.findConfigFile(o,i.sys.fileExists);if(!h)return{dtsFiles:a,dirName:o,compilerOptions:s};const l=o;o=T.dirname(h);const{config:y,error:x}=i.readConfigFile(h,i.sys.readFile);if(x)return console.error(i.formatDiagnostic(x,ne)),{dtsFiles:a,dirName:o,compilerOptions:s};U("tsconfig",y);const S=i.parseJsonConfigFileContent(y,i.sys,o);je(t?[t,t]:[l,o],S)}const{fileNames:m,options:p,errors:d}=W.get(u);return a=m.filter(h=>j.test(h)),d.length?(console.error(i.formatDiagnostics(d,ne)),{dtsFiles:a,dirName:o,compilerOptions:s}):{dtsFiles:a,dirName:o,compilerOptions:{...p,...s}}}c(re,"getCompilerOptions");function sn(n,e,t,r){const{dtsFiles:s,compilerOptions:o}=re(n,e,t,r);return i.createProgram([n].concat(Array.from(s)),o,i.createCompilerHost(o,!0))}c(sn,"createProgram$1");function on(n,e,t,r){const s=[],o=new Set;let a=[],u="",m={};for(let p of n){if(j.test(p))continue;p=T.resolve(p);const d=re(p,e,t,r);if(d.dtsFiles.forEach(o.add,o),!a.length){a.push(p),{dirName:u,compilerOptions:m}=d;continue}if(d.dirName===u)a.push(p);else{const h=i.createCompilerHost(m,!0),l=i.createProgram(a.concat(Array.from(o)),m,h);s.push(l),a=[p],{dirName:u,compilerOptions:m}=d}}if(a.length){const p=i.createCompilerHost(m,!0),d=i.createProgram(a.concat(Array.from(o)),m,p);s.push(d)}return s}c(on,"createPrograms");function an(){let n;try{return{codeFrameColumns:n}=Ze("@babel/code-frame"),n}catch{try{return{codeFrameColumns:n}=et(import.meta.url)("@babel/code-frame"),n}catch{}}}c(an,"getCodeFrame");function cn(n){const e=n.getSourceFile(),t=e.getLineAndCharacterOfPosition(n.getStart()),r=e.getLineAndCharacterOfPosition(n.getEnd());return{start:{line:t.line+1,column:t.character+1},end:{line:r.line+1,column:r.character+1}}}c(cn,"getLocation");function ln(n){const e=an(),r=n.getSourceFile().getFullText(),s=cn(n);return e?`
1
+ var Qe=Object.defineProperty;var c=(n,e)=>Qe(n,"name",{value:e,configurable:!0});import{createRequire as Ye}from"node:module";const Ze=Ye(import.meta.url);import*as T from"node:path";import i from"typescript";import{createRequire as et}from"node:module";import X from"magic-string";import le from"node:fs/promises";import{g as tt}from"./cli-DrYwvddJ.mjs";import"node:fs";import"tty";import"rollup";import"rollup-plugin-import-trace";import"yaml";import"node:path/posix";import"@rollup/plugin-node-resolve";import"@rollup/plugin-commonjs";import"@rollup/plugin-json";import"@rollup/plugin-alias";import"@rollup/plugin-dynamic-import-vars";import"esbuild";import"fs";import"os";import"path";import"rollup-pluginutils";import"node:url";import"cjs-module-lexer";var ue=44,nt=59,pe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",fe=new Uint8Array(64),me=new Uint8Array(128);for(let n=0;n<pe.length;n++){const e=pe.charCodeAt(n);fe[n]=e,me[e]=n}function K(n,e){let t=0,r=0,s=0;do{const a=n.next();s=me[a],t|=(s&31)<<r,r+=5}while(s&32);const o=t&1;return t>>>=1,o&&(t=-2147483648|-t),e+t}c(K,"decodeInteger");function z(n,e,t){let r=e-t;r=r<0?-r<<1|1:r<<1;do{let s=r&31;r>>>=5,r>0&&(s|=32),n.write(fe[s])}while(r>0);return e}c(z,"encodeInteger");function de(n,e){return n.pos>=e?!1:n.peek()!==ue}c(de,"hasMoreVlq");var he=1024*16,ge=typeof TextDecoder<"u"?new TextDecoder:typeof Buffer<"u"?{decode(n){return Buffer.from(n.buffer,n.byteOffset,n.byteLength).toString()}}:{decode(n){let e="";for(let t=0;t<n.length;t++)e+=String.fromCharCode(n[t]);return e}},rt=class{static{c(this,"StringWriter")}constructor(){this.pos=0,this.out="",this.buffer=new Uint8Array(he)}write(n){const{buffer:e}=this;e[this.pos++]=n,this.pos===he&&(this.out+=ge.decode(e),this.pos=0)}flush(){const{buffer:n,out:e,pos:t}=this;return t>0?e+ge.decode(n.subarray(0,t)):e}},st=class{static{c(this,"StringReader")}constructor(n){this.pos=0,this.buffer=n}next(){return this.buffer.charCodeAt(this.pos++)}peek(){return this.buffer.charCodeAt(this.pos)}indexOf(n){const{buffer:e,pos:t}=this,r=e.indexOf(n,t);return r===-1?e.length:r}};function Q(n){const{length:e}=n,t=new st(n),r=[];let s=0,o=0,a=0,u=0,m=0;do{const p=t.indexOf(";"),d=[];let h=!0,l=0;for(s=0;t.pos<p;){let g;s=K(t,s),s<l&&(h=!1),l=s,de(t,p)?(o=K(t,o),a=K(t,a),u=K(t,u),de(t,p)?(m=K(t,m),g=[s,o,a,u,m]):g=[s,o,a,u]):g=[s],d.push(g),t.pos++}h||it(d),r.push(d),t.pos=p+1}while(t.pos<=e);return r}c(Q,"decode");function it(n){n.sort(ot)}c(it,"sort");function ot(n,e){return n[0]-e[0]}c(ot,"sortComparator$1");function ye(n){const e=new rt;let t=0,r=0,s=0,o=0;for(let a=0;a<n.length;a++){const u=n[a];if(a>0&&e.write(nt),u.length===0)continue;let m=0;for(let p=0;p<u.length;p++){const d=u[p];p>0&&e.write(ue),m=z(e,d[0],m),d.length!==1&&(t=z(e,d[1],t),r=z(e,d[2],r),s=z(e,d[3],s),d.length!==4&&(o=z(e,d[4],o)))}}return e.flush()}c(ye,"encode");const at=/^[\w+.-]+:\/\//,ct=/^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/,lt=/^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;function ut(n){return at.test(n)}c(ut,"isAbsoluteUrl");function pt(n){return n.startsWith("//")}c(pt,"isSchemeRelativeUrl");function xe(n){return n.startsWith("/")}c(xe,"isAbsolutePath");function ft(n){return n.startsWith("file:")}c(ft,"isFileUrl");function Se(n){return/^[.?#]/.test(n)}c(Se,"isRelative");function q(n){const e=ct.exec(n);return ve(e[1],e[2]||"",e[3],e[4]||"",e[5]||"/",e[6]||"",e[7]||"")}c(q,"parseAbsoluteUrl");function mt(n){const e=lt.exec(n),t=e[2];return ve("file:","",e[1]||"","",xe(t)?t:"/"+t,e[3]||"",e[4]||"")}c(mt,"parseFileUrl");function ve(n,e,t,r,s,o,a){return{scheme:n,user:e,host:t,port:r,path:s,query:o,hash:a,type:7}}c(ve,"makeUrl");function Ee(n){if(pt(n)){const t=q("http:"+n);return t.scheme="",t.type=6,t}if(xe(n)){const t=q("http://foo.com"+n);return t.scheme="",t.host="",t.type=5,t}if(ft(n))return mt(n);if(ut(n))return q(n);const e=q("http://foo.com/"+n);return e.scheme="",e.host="",e.type=n?n.startsWith("?")?3:n.startsWith("#")?2:4:1,e}c(Ee,"parseUrl");function dt(n){if(n.endsWith("/.."))return n;const e=n.lastIndexOf("/");return n.slice(0,e+1)}c(dt,"stripPathFilename");function ht(n,e){Te(e,e.type),n.path==="/"?n.path=e.path:n.path=dt(e.path)+n.path}c(ht,"mergePaths");function Te(n,e){const t=e<=4,r=n.path.split("/");let s=1,o=0,a=!1;for(let m=1;m<r.length;m++){const p=r[m];if(!p){a=!0;continue}if(a=!1,p!=="."){if(p===".."){o?(a=!0,o--,s--):t&&(r[s++]=p);continue}r[s++]=p,o++}}let u="";for(let m=1;m<s;m++)u+="/"+r[m];(!u||a&&!u.endsWith("/.."))&&(u+="/"),n.path=u}c(Te,"normalizePath");function gt(n,e){if(!n&&!e)return"";const t=Ee(n);let r=t.type;if(e&&r!==7){const o=Ee(e),a=o.type;switch(r){case 1:t.hash=o.hash;case 2:t.query=o.query;case 3:case 4:ht(t,o);case 5:t.user=o.user,t.host=o.host,t.port=o.port;case 6:t.scheme=o.scheme}a>r&&(r=a)}Te(t,r);const s=t.query+t.hash;switch(r){case 2:case 3:return s;case 4:{const o=t.path.slice(1);return o?Se(e||n)&&!Se(o)?"./"+o+s:o+s:s||"."}case 5:return t.path+s;default:return t.scheme+"//"+t.user+t.host+t.port+t.path+s}}c(gt,"resolve");function yt(n){if(!n)return"";const e=n.lastIndexOf("/");return n.slice(0,e+1)}c(yt,"stripFilename");function xt(n,e){const t=yt(n),r=e?e+"/":"";return s=>gt(r+(s||""),t)}c(xt,"resolver");var k=0;function St(n,e){const t=Ne(n,0);if(t===n.length)return n;e||(n=n.slice());for(let r=t;r<n.length;r=Ne(n,r+1))n[r]=Et(n[r],e);return n}c(St,"maybeSort");function Ne(n,e){for(let t=e;t<n.length;t++)if(!vt(n[t]))return t;return n.length}c(Ne,"nextUnsortedSegmentLine");function vt(n){for(let e=1;e<n.length;e++)if(n[e][k]<n[e-1][k])return!1;return!0}c(vt,"isSorted");function Et(n,e){return e||(n=n.slice()),n.sort(Tt)}c(Et,"sortSegments");function Tt(n,e){return n[k]-e[k]}c(Tt,"sortComparator");var H=!1;function Nt(n,e,t,r){for(;t<=r;){const s=t+(r-t>>1),o=n[s][k]-e;if(o===0)return H=!0,s;o<0?t=s+1:r=s-1}return H=!1,t-1}c(Nt,"binarySearch");function Ct(n,e,t){for(let r=t-1;r>=0&&n[r][k]===e;t=r--);return t}c(Ct,"lowerBound");function wt(){return{lastKey:-1,lastNeedle:-1,lastIndex:-1}}c(wt,"memoizedState");function Dt(n,e,t,r){const{lastKey:s,lastNeedle:o,lastIndex:a}=t;let u=0,m=n.length-1;if(r===s){if(e===o)return H=a!==-1&&n[a][k]===e,a;e>=o?u=a===-1?0:a:m=a}return t.lastKey=r,t.lastNeedle=e,t.lastIndex=Nt(n,e,u,m)}c(Dt,"memoizedBinarySearch");function bt(n){return typeof n=="string"?JSON.parse(n):n}c(bt,"parse$1");var Ce=class{static{c(this,"TraceMap")}constructor(n,e){const t=typeof n=="string";if(!t&&n._decodedMemo)return n;const r=bt(n),{version:s,file:o,names:a,sourceRoot:u,sources:m,sourcesContent:p}=r;this.version=s,this.file=o,this.names=a||[],this.sourceRoot=u,this.sources=m,this.sourcesContent=p,this.ignoreList=r.ignoreList||r.x_google_ignoreList||void 0;const d=xt(e,u);this.resolvedSources=m.map(d);const{mappings:h}=r;if(typeof h=="string")this._encoded=h,this._decoded=void 0;else if(Array.isArray(h))this._encoded=void 0,this._decoded=St(h,t);else throw r.sections?new Error("TraceMap passed sectioned source map, please use FlattenMap export instead"):new Error(`invalid source map: ${JSON.stringify(r)}`);this._decodedMemo=wt(),this._bySources=void 0,this._bySourceMemos=void 0}};function er(n){return n}c(er,"cast$1");function we(n){var e;return(e=n)._decoded||(e._decoded=Q(n._encoded))}c(we,"decodedMappings");function It(n,e,t){const r=we(n);if(e>=r.length)return null;const s=r[e],o=Mt(s,n._decodedMemo,e,t);return o===-1?null:s[o]}c(It,"traceSegment");function Mt(n,e,t,r,s){let o=Dt(n,r,e,t);return H&&(o=Ct(n,r,o)),o===-1||o===n.length?-1:o}c(Mt,"traceSegmentInternal");var Y=class{static{c(this,"SetArray")}constructor(){this._indexes={__proto__:null},this.array=[]}};function tr(n){return n}c(tr,"cast");function De(n,e){return n._indexes[e]}c(De,"get");function V(n,e){const t=De(n,e);if(t!==void 0)return t;const{array:r,_indexes:s}=n,o=r.push(e);return s[e]=o-1}c(V,"put");function Ft(n,e){const t=De(n,e);if(t===void 0)return;const{array:r,_indexes:s}=n;for(let o=t+1;o<r.length;o++){const a=r[o];r[o-1]=a,s[a]--}s[e]=void 0,r.pop()}c(Ft,"remove");var Rt=0,Ot=1,At=2,Lt=3,Pt=4,be=-1,_t=class{static{c(this,"GenMapping")}constructor({file:n,sourceRoot:e}={}){this._names=new Y,this._sources=new Y,this._sourcesContent=[],this._mappings=[],this.file=n,this.sourceRoot=e,this._ignoreList=new Y}};function nr(n){return n}c(nr,"cast2");var $t=c((n,e,t,r,s,o,a,u)=>Ut(!0,n,e,t,r,s,o,a),"maybeAddSegment");function Bt(n,e,t){const{_sources:r,_sourcesContent:s}=n,o=V(r,e);s[o]=t}c(Bt,"setSourceContent");function kt(n,e,t=!0){const{_sources:r,_sourcesContent:s,_ignoreList:o}=n,a=V(r,e);a===s.length&&(s[a]=null),t?V(o,a):Ft(o,a)}c(kt,"setIgnore");function Ie(n){const{_mappings:e,_sources:t,_sourcesContent:r,_names:s,_ignoreList:o}=n;return Vt(e),{version:3,file:n.file||void 0,names:s.array,sourceRoot:n.sourceRoot||void 0,sources:t.array,sourcesContent:r,mappings:e,ignoreList:o.array}}c(Ie,"toDecodedMap");function jt(n){const e=Ie(n);return Object.assign({},e,{mappings:ye(e.mappings)})}c(jt,"toEncodedMap");function Ut(n,e,t,r,s,o,a,u,m){const{_mappings:p,_sources:d,_sourcesContent:h,_names:l}=e,g=Kt(p,t),x=zt(g,r);if(!s)return Jt(g,x)?void 0:Me(g,x,[r]);const S=V(d,s),E=u?V(l,u):be;if(S===h.length&&(h[S]=null),!Wt(g,x,S,o,a,E))return Me(g,x,u?[r,S,o,a,E]:[r,S,o,a])}c(Ut,"addSegmentInternal");function Kt(n,e){for(let t=n.length;t<=e;t++)n[t]=[];return n[e]}c(Kt,"getIndex");function zt(n,e){let t=n.length;for(let r=t-1;r>=0;t=r--){const s=n[r];if(e>=s[Rt])break}return t}c(zt,"getColumnIndex");function Me(n,e,t){for(let r=n.length;r>e;r--)n[r]=n[r-1];n[e]=t}c(Me,"insert");function Vt(n){const{length:e}=n;let t=e;for(let r=t-1;r>=0&&!(n[r].length>0);t=r,r--);t<e&&(n.length=t)}c(Vt,"removeEmptyFinalLines");function Jt(n,e){return e===0?!0:n[e-1].length===1}c(Jt,"skipSourceless");function Wt(n,e,t,r,s,o){if(e===0)return!1;const a=n[e-1];return a.length===1?!1:t===a[Ot]&&r===a[At]&&s===a[Lt]&&o===(a.length===5?a[Pt]:be)}c(Wt,"skipSource");var Fe=Re("",-1,-1,"",null,!1),Gt=[];function Re(n,e,t,r,s,o){return{source:n,line:e,column:t,name:r,content:s,ignore:o}}c(Re,"SegmentObject");function Oe(n,e,t,r,s){return{map:n,sources:e,source:t,content:r,ignore:s}}c(Oe,"Source");function Ae(n,e){return Oe(n,e,"",null,!1)}c(Ae,"MapSource");function qt(n,e,t){return Oe(null,Gt,n,e,t)}c(qt,"OriginalSource");function Ht(n){const e=new _t({file:n.map.file}),{sources:t,map:r}=n,s=r.names,o=we(r);for(let a=0;a<o.length;a++){const u=o[a];for(let m=0;m<u.length;m++){const p=u[m],d=p[0];let h=Fe;if(p.length!==1){const D=t[p[1]];if(h=Le(D,p[2],p[3],p.length===5?s[p[4]]:""),h==null)continue}const{column:l,line:g,name:x,content:S,source:E,ignore:N}=h;$t(e,a,d,E,g,l,x),E&&S!=null&&Bt(e,E,S),N&&kt(e,E,!0)}}return e}c(Ht,"traceMappings");function Le(n,e,t,r){if(!n.map)return Re(n.source,e,t,r,n.content,n.ignore);const s=It(n.map,e,t);return s==null?null:s.length===1?Fe:Le(n.sources[s[1]],s[2],s[3],s.length===5?n.map.names[s[4]]:r)}c(Le,"originalPositionFor");function Xt(n){return Array.isArray(n)?n:[n]}c(Xt,"asArray");function Qt(n,e){const t=Xt(n).map(o=>new Ce(o,"")),r=t.pop();for(let o=0;o<t.length;o++)if(t[o].sources.length>1)throw new Error(`Transformation map ${o} must have exactly one source file.
2
+ Did you specify these with the most recent transformation maps first?`);let s=Pe(r,e,"",0);for(let o=t.length-1;o>=0;o--)s=Ae(t[o],[s]);return s}c(Qt,"buildSourceMapTree");function Pe(n,e,t,r){const{resolvedSources:s,sourcesContent:o,ignoreList:a}=n,u=r+1,m=s.map((p,d)=>{const h={importer:t,depth:u,source:p||"",content:void 0,ignore:void 0},l=e(h.source,h),{source:g}=h;if(l)return Pe(new Ce(l,g),e,g,u);const x=o?o[d]:null,S=a?a.includes(d):!1;return qt(g,x,S)});return Ae(n,m)}c(Pe,"build");var Yt=class{static{c(this,"SourceMap")}constructor(n,e){const t=e.decodedMappings?Ie(n):jt(n);this.version=t.version,this.file=t.file,this.mappings=t.mappings,this.names=t.names,this.ignoreList=t.ignoreList,this.sourceRoot=t.sourceRoot,this.sources=t.sources,e.excludeContent||(this.sourcesContent=t.sourcesContent)}toString(){return JSON.stringify(this)}};function Zt(n,e,t){const r={excludeContent:!1,decodedMappings:!1},s=Qt(n,e);return new Yt(Ht(s),r)}c(Zt,"remapping");var Z={},_e;function en(){return _e||(_e=1,(function(n){Object.defineProperty(n,"commentRegex",{get:c(function(){return/^\s*?\/[\/\*][@#]\s+?sourceMappingURL=data:(((?:application|text)\/json)(?:;charset=([^;,]+?)?)?)?(?:;(base64))?,(.*?)$/mg},"getCommentRegex")}),Object.defineProperty(n,"mapFileCommentRegex",{get:c(function(){return/(?:\/\/[@#][ \t]+?sourceMappingURL=([^\s'"`]+?)[ \t]*?$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^*]+?)[ \t]*?(?:\*\/){1}[ \t]*?$)/mg},"getMapFileCommentRegex")});var e;typeof Buffer<"u"?typeof Buffer.from=="function"?e=t:e=r:e=s;function t(l){return Buffer.from(l,"base64").toString()}c(t,"decodeBase64WithBufferFrom");function r(l){if(typeof value=="number")throw new TypeError("The value to decode must not be of type number.");return new Buffer(l,"base64").toString()}c(r,"decodeBase64WithNewBuffer");function s(l){return decodeURIComponent(escape(atob(l)))}c(s,"decodeBase64WithAtob");function o(l){return l.split(",").pop()}c(o,"stripComment");function a(l,g){var x=n.mapFileCommentRegex.exec(l),S=x[1]||x[2];try{var l=g(S);return l!=null&&typeof l.catch=="function"?l.catch(E):l}catch(N){E(N)}function E(N){throw new Error("An error occurred while trying to read the map file at "+S+`
3
+ `+N.stack)}c(E,"throwError")}c(a,"readFromFileMap");function u(l,g){g=g||{},g.hasComment&&(l=o(l)),g.encoding==="base64"?l=e(l):g.encoding==="uri"&&(l=decodeURIComponent(l)),(g.isJSON||g.encoding)&&(l=JSON.parse(l)),this.sourcemap=l}c(u,"Converter"),u.prototype.toJSON=function(l){return JSON.stringify(this.sourcemap,null,l)},typeof Buffer<"u"?typeof Buffer.from=="function"?u.prototype.toBase64=m:u.prototype.toBase64=p:u.prototype.toBase64=d;function m(){var l=this.toJSON();return Buffer.from(l,"utf8").toString("base64")}c(m,"encodeBase64WithBufferFrom");function p(){var l=this.toJSON();if(typeof l=="number")throw new TypeError("The json to encode must not be of type number.");return new Buffer(l,"utf8").toString("base64")}c(p,"encodeBase64WithNewBuffer");function d(){var l=this.toJSON();return btoa(unescape(encodeURIComponent(l)))}c(d,"encodeBase64WithBtoa"),u.prototype.toURI=function(){var l=this.toJSON();return encodeURIComponent(l)},u.prototype.toComment=function(l){var g,x,S;return l!=null&&l.encoding==="uri"?(g="",x=this.toURI()):(g=";base64",x=this.toBase64()),S="sourceMappingURL=data:application/json;charset=utf-8"+g+","+x,l!=null&&l.multiline?"/*# "+S+" */":"//# "+S},u.prototype.toObject=function(){return JSON.parse(this.toJSON())},u.prototype.addProperty=function(l,g){if(this.sourcemap.hasOwnProperty(l))throw new Error('property "'+l+'" already exists on the sourcemap, use set property instead');return this.setProperty(l,g)},u.prototype.setProperty=function(l,g){return this.sourcemap[l]=g,this},u.prototype.getProperty=function(l){return this.sourcemap[l]},n.fromObject=function(l){return new u(l)},n.fromJSON=function(l){return new u(l,{isJSON:!0})},n.fromURI=function(l){return new u(l,{encoding:"uri"})},n.fromBase64=function(l){return new u(l,{encoding:"base64"})},n.fromComment=function(l){var g,x;return l=l.replace(/^\/\*/g,"//").replace(/\*\/$/g,""),g=n.commentRegex.exec(l),x=g&&g[4]||"uri",new u(l,{encoding:x,hasComment:!0})};function h(l){return new u(l,{isJSON:!0})}c(h,"makeConverter"),n.fromMapFileComment=function(l,g){if(typeof g=="string")throw new Error("String directory paths are no longer supported with `fromMapFileComment`\nPlease review the Upgrading documentation at https://github.com/thlorenz/convert-source-map#upgrading");var x=a(l,g);return x!=null&&typeof x.then=="function"?x.then(h):h(x)},n.fromSource=function(l){var g=l.match(n.commentRegex);return g?n.fromComment(g.pop()):null},n.fromMapFileSource=function(l,g){if(typeof g=="string")throw new Error("String directory paths are no longer supported with `fromMapFileSource`\nPlease review the Upgrading documentation at https://github.com/thlorenz/convert-source-map#upgrading");var x=l.match(n.mapFileCommentRegex);return x?n.fromMapFileComment(x.pop(),g):null},n.removeComments=function(l){return l.replace(n.commentRegex,"")},n.removeMapFileComments=function(l){return l.replace(n.mapFileCommentRegex,"")},n.generateMapFileComment=function(l,g){var x="sourceMappingURL="+l;return g&&g.multiline?"/*# "+x+" */":"//# "+x}})(Z)),Z}c(en,"requireConvertSourceMap");var tn=en(),$e=tt(tn);function nn(n){return{...n,compilerOptions:n.compilerOptions??{},respectExternal:n.respectExternal??!1,includeExternal:n.includeExternal??[],sourcemap:n.sourcemap??!1}}c(nn,"resolveDefaultOptions");const j=/\.d\.(c|m)?tsx?$/,ee=/\.json$/,Be=/((\.d)?\.(c|m)?(t|j)sx?|\.json)$/;function te(n){return n.replace(Be,"")}c(te,"trimExtension");function ke(n){return n.replace(Be,".d.ts")}c(ke,"getDeclarationId");function J(n,e){return i.createSourceFile(n,e,i.ScriptTarget.Latest,!0)}c(J,"parse");const ne={getCurrentDirectory:c(()=>i.sys.getCurrentDirectory(),"getCurrentDirectory"),getNewLine:c(()=>i.sys.newLine,"getNewLine"),getCanonicalFileName:i.sys.useCaseSensitiveFileNames?n=>n:n=>n.toLowerCase()},rn={declaration:!0,noEmit:!1,emitDeclarationOnly:!0,noEmitOnError:!0,checkJs:!1,declarationMap:!1,skipLibCheck:!0,preserveSymlinks:!0,target:i.ScriptTarget.ESNext,resolveJsonModule:!0},W=new Map,U=c((...n)=>process.env.DTS_LOG_CACHE?console.log("[cache]",...n):null,"logCache");function je([n,e],t){for(U(n),W.set(n,t);n!==e&&n!==T.dirname(n);){if(n=T.dirname(n),U("up",n),W.has(n))return U("has",n);W.set(n,t)}}c(je,"cacheConfig");function re(n,e,t,r){const s={...rn,...e,...r===!0&&{declarationMap:!0}};let o=T.dirname(n),a=[];const u=t||o;if(W.has(u))U("HIT",u);else{U("miss",u);const h=t?T.resolve(process.cwd(),t):i.findConfigFile(o,i.sys.fileExists);if(!h)return{dtsFiles:a,dirName:o,compilerOptions:s};const l=o;o=T.dirname(h);const{config:g,error:x}=i.readConfigFile(h,i.sys.readFile);if(x)return console.error(i.formatDiagnostic(x,ne)),{dtsFiles:a,dirName:o,compilerOptions:s};U("tsconfig",g);const S=i.parseJsonConfigFileContent(g,i.sys,o);je(t?[t,t]:[l,o],S)}const{fileNames:m,options:p,errors:d}=W.get(u);return a=m.filter(h=>j.test(h)),d.length?(console.error(i.formatDiagnostics(d,ne)),{dtsFiles:a,dirName:o,compilerOptions:s}):{dtsFiles:a,dirName:o,compilerOptions:{...p,...s}}}c(re,"getCompilerOptions");function sn(n,e,t,r){const{dtsFiles:s,compilerOptions:o}=re(n,e,t,r);return i.createProgram([n].concat(Array.from(s)),o,i.createCompilerHost(o,!0))}c(sn,"createProgram$1");function on(n,e,t,r){const s=[],o=new Set;let a=[],u="",m={};for(let p of n){if(j.test(p))continue;p=T.resolve(p);const d=re(p,e,t,r);if(d.dtsFiles.forEach(o.add,o),!a.length){a.push(p),{dirName:u,compilerOptions:m}=d;continue}if(d.dirName===u)a.push(p);else{const h=i.createCompilerHost(m,!0),l=i.createProgram(a.concat(Array.from(o)),m,h);s.push(l),a=[p],{dirName:u,compilerOptions:m}=d}}if(a.length){const p=i.createCompilerHost(m,!0),d=i.createProgram(a.concat(Array.from(o)),m,p);s.push(d)}return s}c(on,"createPrograms");function an(){let n;try{return{codeFrameColumns:n}=Ze("@babel/code-frame"),n}catch{try{return{codeFrameColumns:n}=et(import.meta.url)("@babel/code-frame"),n}catch{}}}c(an,"getCodeFrame");function cn(n){const e=n.getSourceFile(),t=e.getLineAndCharacterOfPosition(n.getStart()),r=e.getLineAndCharacterOfPosition(n.getEnd());return{start:{line:t.line+1,column:t.character+1},end:{line:r.line+1,column:r.character+1}}}c(cn,"getLocation");function ln(n){const e=an(),r=n.getSourceFile().getFullText(),s=cn(n);return e?`
4
4
  `+e(r,s,{highlightCode:!0}):`
5
5
  ${s.start.line}:${s.start.column}: \`${n.getFullText().trim()}\``}c(ln,"frameNode");class w extends Error{static{c(this,"UnsupportedSyntaxError")}constructor(e,t="Syntax not yet supported"){super(`${t}
6
6
  ${ln(e)}`)}}class un{static{c(this,"NamespaceFixer")}constructor(e){this.sourceFile=e}findNamespaces(){const e=[],t={};for(const r of this.sourceFile.statements){const s={start:r.getStart(),end:r.getEnd()};if(i.isEmptyStatement(r)){e.unshift({name:"",exports:[],location:s});continue}if((i.isImportDeclaration(r)||i.isExportDeclaration(r))&&r.moduleSpecifier&&i.isStringLiteral(r.moduleSpecifier)){const{text:d}=r.moduleSpecifier;if(d.startsWith(".")&&(d.endsWith(".d.ts")||d.endsWith(".d.cts")||d.endsWith(".d.mts"))){const h=r.moduleSpecifier.getStart()+1,l=r.moduleSpecifier.getEnd()-1;e.unshift({name:"",exports:[],location:{start:h,end:l},textBeforeCodeAfter:d.replace(/\.d\.ts$/,".js").replace(/\.d\.cts$/,".cjs").replace(/\.d\.mts$/,".mjs")})}}if(i.isModuleDeclaration(r)&&r.body){let d=r.body;for(;i.isModuleDeclaration(d)&&d.body;)d=d.body;if(!i.isModuleBlock(d))continue;for(const h of d.statements)if(i.isExportDeclaration(h)&&h.exportClause){if(i.isNamespaceExport(h.exportClause))continue;for(const l of h.exportClause.elements)l.propertyName&&l.propertyName.getText()==l.name.getText()&&e.unshift({name:"",exports:[],location:{start:l.propertyName.getEnd(),end:l.name.getEnd()}})}}if(i.isClassDeclaration(r)?t[r.name.getText()]={type:"class",generics:r.typeParameters}:i.isFunctionDeclaration(r)?t[r.name.getText()]={type:"function"}:i.isInterfaceDeclaration(r)?t[r.name.getText()]={type:"interface",generics:r.typeParameters}:i.isTypeAliasDeclaration(r)?t[r.name.getText()]={type:"type",generics:r.typeParameters}:i.isModuleDeclaration(r)&&i.isIdentifier(r.name)?t[r.name.getText()]={type:"namespace"}:i.isEnumDeclaration(r)&&(t[r.name.getText()]={type:"enum"}),!i.isVariableStatement(r))continue;const{declarations:o}=r.declarationList;if(o.length!==1)continue;const a=o[0],u=a.name.getText();if(!a.initializer||!i.isCallExpression(a.initializer)){t[u]={type:"var"};continue}const m=a.initializer.arguments[0];if(!a.initializer.expression.getFullText().includes("/*#__PURE__*/Object.freeze")||!i.isObjectLiteralExpression(m))continue;const p=[];for(const d of m.properties){if(!i.isPropertyAssignment(d)||!(i.isIdentifier(d.name)||i.isStringLiteral(d.name))||d.name.text!=="__proto__"&&!i.isIdentifier(d.initializer))throw new w(d,"Expected a property assignment");d.name.text!=="__proto__"&&p.push({exportedName:d.name.text,localName:d.initializer.getText()})}e.unshift({name:u,exports:p,location:s})}return{namespaces:e,itemTypes:t}}fix(){let e=this.sourceFile.getFullText();const{namespaces:t,itemTypes:r}=this.findNamespaces();for(const s of t){const o=e.slice(s.location.end);e=e.slice(0,s.location.start);for(const{exportedName:a,localName:u}of s.exports)if(a===u){const{type:m,generics:p}=r[u]||{};if(m==="interface"||m==="type"){const d=Ue(p);e+=`type ${s.name}_${a}${d.in} = ${u}${d.out};
@@ -13,10 +13,10 @@ ${ln(e)}`)}}class un{static{c(this,"NamespaceFixer")}constructor(e){this.sourceF
13
13
  `;for(const{exportedName:a,localName:u}of s.exports)a===u?e+=` ${s.name}_${a} as ${a},
14
14
  `:e+=` ${u} as ${a},
15
15
  `;e+=` };
16
- `,e+="}"}e+=s.textBeforeCodeAfter??"",e+=o}return e}}function Ue(n){return!n||!n.length?{in:"",out:""}:{in:`<${n.map(e=>e.getText()).join(", ")}>`,out:`<${n.map(e=>e.name.getText()).join(", ")}>`}}c(Ue,"renderTypeParams");let Ke=1;function pn(n){return I({type:"Program",sourceType:"module",body:[]},{start:n.getFullStart(),end:n.getEnd()})}c(pn,"createProgram");function fn(n){const e={type:"Identifier",name:String(Ke++)};return{ident:e,expr:{type:"AssignmentPattern",left:e,right:n}}}c(fn,"createReference");function M(n){return I({type:"Identifier",name:n.getText()},n)}c(M,"createIdentifier");function mn(n){const e=I({type:"FunctionExpression",id:null,params:[],body:{type:"BlockStatement",body:[]}},n),t=I({type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"Identifier",name:String(Ke++)},arguments:[e],optional:!1}},n);return{fn:e,iife:t}}c(mn,"createIIFE");function dn(){const n={type:"ArrayExpression",elements:[]};return{expr:n,stmt:{type:"ReturnStatement",argument:n}}}c(dn,"createReturn");function hn(n,e){return I({type:"FunctionDeclaration",id:I({type:"Identifier",name:i.idText(n)},n),params:[],body:{type:"BlockStatement",body:[]}},e)}c(hn,"createDeclaration");function A(n){if(i.isLiteralExpression(n))return{type:"Literal",value:n.text};if(i.isPropertyAccessExpression(n)){if(i.isPrivateIdentifier(n.name))throw new w(n.name);return I({type:"MemberExpression",computed:!1,optional:!1,object:A(n.expression),property:A(n.name)},{start:n.expression.getStart(),end:n.name.getEnd()})}if(i.isObjectLiteralExpression(n))return I({type:"ObjectExpression",properties:n.properties.map(e=>{if(i.isPropertyAssignment(e))return I({type:"Property",key:i.isIdentifier(e.name)?M(e.name):A(e.name),value:A(e.initializer),kind:"init",method:!1,shorthand:!1,computed:i.isComputedPropertyName(e.name)},e);if(i.isShorthandPropertyAssignment(e))return I({type:"Property",key:M(e.name),value:M(e.name),kind:"init",method:!1,shorthand:!0,computed:!1},e);throw new w(e,"Unsupported property type in object literal")})},n);if(i.isArrayLiteralExpression(n))return I({type:"ArrayExpression",elements:n.elements.map(e=>{if(i.isExpression(e))return A(e);throw new w(e,"Unsupported element type in array literal")})},n);if(i.isIdentifier(n))return M(n);if(n.kind==i.SyntaxKind.NullKeyword)return{type:"Literal",value:null};throw new w(n)}c(A,"convertExpression");function I(n,e){const t="start"in e?e:{start:e.getStart(),end:e.getEnd()};return Object.assign(n,t)}c(I,"withStartEnd");function G(n,e){return(i.getCombinedModifierFlags(n)&e)===e}c(G,"matchesModifier");class yn{static{c(this,"LanguageService")}constructor(e){this.fileName="index.d.ts";const t={getCompilationSettings:c(()=>({noEmit:!0,noResolve:!0,skipLibCheck:!0,declaration:!1,checkJs:!1,declarationMap:!1,target:i.ScriptTarget.ESNext}),"getCompilationSettings"),getScriptFileNames:c(()=>[this.fileName],"getScriptFileNames"),getScriptVersion:c(()=>"1","getScriptVersion"),getScriptSnapshot:c(r=>r===this.fileName?i.ScriptSnapshot.fromString(e):void 0,"getScriptSnapshot"),getCurrentDirectory:c(()=>"","getCurrentDirectory"),getDefaultLibFileName:c(()=>"","getDefaultLibFileName"),fileExists:c(r=>r===this.fileName,"fileExists"),readFile:c(r=>r===this.fileName?e:void 0,"readFile")};this.service=i.createLanguageService(t,i.createDocumentRegistry(void 0,""),i.LanguageServiceMode.PartialSemantic)}findReferenceCount(e){const t=this.service.findReferences(this.fileName,e.getStart());return t?.length?t.reduce((r,s)=>r+s.references.length,0):0}}class gn{static{c(this,"TypeOnlyFixer")}constructor(e,t){this.DEBUG=!!process.env.DTS_EXPORTS_FIXER_DEBUG,this.types=new Set,this.values=new Set,this.typeHints=new Map,this.reExportTypeHints=new Map,this.importNodes=[],this.exportNodes=[],this.rawCode=t,this.source=J(e,t),this.code=new X(t)}fix(){return this.analyze(this.source.statements),(this.typeHints.size||this.reExportTypeHints.size)&&(this.service=new yn(this.rawCode),this.importNodes.forEach(e=>this.fixTypeOnlyImport(e))),this.types.size&&this.exportNodes.forEach(e=>this.fixTypeOnlyExport(e)),this.types.size?{magicCode:this.code}:{code:this.rawCode,map:null}}fixTypeOnlyImport(e){let t=!1;const r=[],s=[],o=e.moduleSpecifier.getText(),a=e.importClause.name,u=e.importClause.namedBindings;if(a){const m=a.text;this.isTypeOnly(m)?this.isUselessImport(a)?t=!0:r.push(`import type ${m} from ${o};`):s.push(`import ${m} from ${o};`)}if(u&&i.isNamespaceImport(u)){const m=u.name.text;this.isTypeOnly(m)?this.isUselessImport(u.name)?t=!0:r.push(`import type * as ${m} from ${o};`):s.push(`import * as ${m} from ${o};`)}if(u&&i.isNamedImports(u)){const m=[],p=[];for(const d of u.elements)this.isTypeOnly(d.name.text)?this.isUselessImport(d.name)?t=!0:m.push(d.getText()):p.push(d.getText());m.length&&r.push(`import type { ${m.join(", ")} } from ${o};`),p.length&&s.push(`import { ${p.join(", ")} } from ${o};`)}(r.length||t)&&this.code.overwrite(e.getStart(),e.getEnd(),[...s,...r].join(`
16
+ `,e+="}"}e+=s.textBeforeCodeAfter??"",e+=o}return e}}function Ue(n){return!n||!n.length?{in:"",out:""}:{in:`<${n.map(e=>e.getText()).join(", ")}>`,out:`<${n.map(e=>e.name.getText()).join(", ")}>`}}c(Ue,"renderTypeParams");let Ke=1;function pn(n){return I({type:"Program",sourceType:"module",body:[]},{start:n.getFullStart(),end:n.getEnd()})}c(pn,"createProgram");function fn(n){const e={type:"Identifier",name:String(Ke++)};return{ident:e,expr:{type:"AssignmentPattern",left:e,right:n}}}c(fn,"createReference");function M(n){return I({type:"Identifier",name:n.getText()},n)}c(M,"createIdentifier");function mn(n){const e=I({type:"FunctionExpression",id:null,params:[],body:{type:"BlockStatement",body:[]}},n),t=I({type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"Identifier",name:String(Ke++)},arguments:[e],optional:!1}},n);return{fn:e,iife:t}}c(mn,"createIIFE");function dn(){const n={type:"ArrayExpression",elements:[]};return{expr:n,stmt:{type:"ReturnStatement",argument:n}}}c(dn,"createReturn");function hn(n,e){return I({type:"FunctionDeclaration",id:I({type:"Identifier",name:i.idText(n)},n),params:[],body:{type:"BlockStatement",body:[]}},e)}c(hn,"createDeclaration");function A(n){if(i.isLiteralExpression(n))return{type:"Literal",value:n.text};if(i.isPropertyAccessExpression(n)){if(i.isPrivateIdentifier(n.name))throw new w(n.name);return I({type:"MemberExpression",computed:!1,optional:!1,object:A(n.expression),property:A(n.name)},{start:n.expression.getStart(),end:n.name.getEnd()})}if(i.isObjectLiteralExpression(n))return I({type:"ObjectExpression",properties:n.properties.map(e=>{if(i.isPropertyAssignment(e))return I({type:"Property",key:i.isIdentifier(e.name)?M(e.name):A(e.name),value:A(e.initializer),kind:"init",method:!1,shorthand:!1,computed:i.isComputedPropertyName(e.name)},e);if(i.isShorthandPropertyAssignment(e))return I({type:"Property",key:M(e.name),value:M(e.name),kind:"init",method:!1,shorthand:!0,computed:!1},e);throw new w(e,"Unsupported property type in object literal")})},n);if(i.isArrayLiteralExpression(n))return I({type:"ArrayExpression",elements:n.elements.map(e=>{if(i.isExpression(e))return A(e);throw new w(e,"Unsupported element type in array literal")})},n);if(i.isIdentifier(n))return M(n);if(n.kind==i.SyntaxKind.NullKeyword)return{type:"Literal",value:null};throw new w(n)}c(A,"convertExpression");function I(n,e){const t="start"in e?e:{start:e.getStart(),end:e.getEnd()};return Object.assign(n,t)}c(I,"withStartEnd");function G(n,e){return(i.getCombinedModifierFlags(n)&e)===e}c(G,"matchesModifier");class gn{static{c(this,"LanguageService")}constructor(e){this.fileName="index.d.ts";const t={getCompilationSettings:c(()=>({noEmit:!0,noResolve:!0,skipLibCheck:!0,declaration:!1,checkJs:!1,declarationMap:!1,target:i.ScriptTarget.ESNext}),"getCompilationSettings"),getScriptFileNames:c(()=>[this.fileName],"getScriptFileNames"),getScriptVersion:c(()=>"1","getScriptVersion"),getScriptSnapshot:c(r=>r===this.fileName?i.ScriptSnapshot.fromString(e):void 0,"getScriptSnapshot"),getCurrentDirectory:c(()=>"","getCurrentDirectory"),getDefaultLibFileName:c(()=>"","getDefaultLibFileName"),fileExists:c(r=>r===this.fileName,"fileExists"),readFile:c(r=>r===this.fileName?e:void 0,"readFile")};this.service=i.createLanguageService(t,i.createDocumentRegistry(void 0,""),i.LanguageServiceMode.PartialSemantic)}findReferenceCount(e){const t=this.service.findReferences(this.fileName,e.getStart());return t?.length?t.reduce((r,s)=>r+s.references.length,0):0}}class yn{static{c(this,"TypeOnlyFixer")}constructor(e,t){this.DEBUG=!!process.env.DTS_EXPORTS_FIXER_DEBUG,this.types=new Set,this.values=new Set,this.typeHints=new Map,this.reExportTypeHints=new Map,this.importNodes=[],this.exportNodes=[],this.rawCode=t,this.source=J(e,t),this.code=new X(t)}fix(){return this.analyze(this.source.statements),(this.typeHints.size||this.reExportTypeHints.size)&&(this.service=new gn(this.rawCode),this.importNodes.forEach(e=>this.fixTypeOnlyImport(e))),this.types.size&&this.exportNodes.forEach(e=>this.fixTypeOnlyExport(e)),this.types.size?{magicCode:this.code}:{code:this.rawCode,map:null}}fixTypeOnlyImport(e){let t=!1;const r=[],s=[],o=e.moduleSpecifier.getText(),a=e.importClause.name,u=e.importClause.namedBindings;if(a){const m=a.text;this.isTypeOnly(m)?this.isUselessImport(a)?t=!0:r.push(`import type ${m} from ${o};`):s.push(`import ${m} from ${o};`)}if(u&&i.isNamespaceImport(u)){const m=u.name.text;this.isTypeOnly(m)?this.isUselessImport(u.name)?t=!0:r.push(`import type * as ${m} from ${o};`):s.push(`import * as ${m} from ${o};`)}if(u&&i.isNamedImports(u)){const m=[],p=[];for(const d of u.elements)this.isTypeOnly(d.name.text)?this.isUselessImport(d.name)?t=!0:m.push(d.getText()):p.push(d.getText());m.length&&r.push(`import type { ${m.join(", ")} } from ${o};`),p.length&&s.push(`import { ${p.join(", ")} } from ${o};`)}(r.length||t)&&this.code.overwrite(e.getStart(),e.getEnd(),[...s,...r].join(`
17
17
  ${ze(e)}`))}fixTypeOnlyExport(e){const t=[],r=[],s=e.moduleSpecifier?.getText();if(i.isNamespaceExport(e.exportClause)){const o=e.exportClause.name.text;this.isReExportTypeOnly(o)?t.push(`export type * as ${o} from ${s};`):r.push(`export * as ${o} from ${s};`)}if(i.isNamedExports(e.exportClause)){const o=[],a=[];for(const u of e.exportClause.elements){const m=u.propertyName?.text||u.name.text;(e.moduleSpecifier?this.isReExportTypeOnly(u.name.text):this.isTypeOnly(m))?o.push(u.getText()):a.push(u.getText())}o.length&&t.push(`export type { ${o.join(", ")} }${s?` from ${s}`:""};`),a.length&&r.push(`export { ${a.join(", ")} }${s?` from ${s}`:""};`)}t.length&&this.code.overwrite(e.getStart(),e.getEnd(),[...r,...t].join(`
18
- ${ze(e)}`))}analyze(e){for(const t of e){if(this.DEBUG&&console.log(t.getText(),t.kind),i.isImportDeclaration(t)&&t.importClause){this.importNodes.push(t);continue}if(i.isExportDeclaration(t)&&t.exportClause){this.exportNodes.push(t);continue}if(i.isInterfaceDeclaration(t)){this.DEBUG&&console.log(`${t.name.getFullText()} is a type`),this.types.add(t.name.text);continue}if(i.isTypeAliasDeclaration(t)){const r=t.name.text;this.DEBUG&&console.log(`${t.name.getFullText()} is a type`),this.types.add(r);continue}if(i.isEnumDeclaration(t)||i.isFunctionDeclaration(t)||i.isClassDeclaration(t)||i.isVariableStatement(t)){if(i.isVariableStatement(t))for(const r of t.declarationList.declarations)i.isIdentifier(r.name)&&(this.DEBUG&&console.log(`${r.name.getFullText()} is a value (from var statement)`),this.values.add(r.name.text));else t.name&&(this.DEBUG&&console.log(`${t.name.getFullText()} is a value (from declaration)`),this.values.add(t.name.text));continue}if(i.isModuleBlock(t)){this.analyze(t.statements);continue}if(i.isModuleDeclaration(t)){t.name&&i.isIdentifier(t.name)&&(this.DEBUG&&console.log(`${t.name.getFullText()} is a value (from module declaration)`),this.values.add(t.name.text)),this.analyze(t.getChildren());continue}this.DEBUG&&console.log("unhandled statement",t.getFullText(),t.kind)}}isUselessImport(e){const t=this.service.findReferenceCount(e),r=this.typeHints.get(e.text);return r&&r+1>=t}isTypeOnly(e){return this.typeHints.has(e)||this.types.has(e)&&!this.values.has(e)}isReExportTypeOnly(e){return this.reExportTypeHints.has(e)}}function ze(n){const e=n.getFullText().match(/^(?:\n*)([ ]*)/);return" ".repeat(e?.[1]?.length||0)}c(ze,"getNodeIndent");function se(n,e,t){if(i.isModuleDeclaration(n)){n.body&&(i.isModuleBlock(n.body)||i.isModuleDeclaration(n.body))&&se(n.body,e);return}for(const r of n.statements)ie(e,r),i.isModuleDeclaration(r)&&r.body&&(i.isModuleBlock(r.body)||i.isModuleDeclaration(r.body))&&se(r.body,e)}c(se,"preProcessNamespaceBody");function xn({sourceFile:n,isEntry:e,isJSON:t}){const r=new X(n.getFullText()),s=!e&&Sn(n),o=new Set,a=new Set;let u="";const m=new Map,p=new Map;for(const f of n.statements){if(i.isEmptyStatement(f)){r.remove(f.getStart(),f.getEnd());continue}if(i.isImportDeclaration(f)){if(!f.importClause)continue;f.importClause.name&&o.add(f.importClause.name.text),f.importClause.namedBindings&&(i.isNamespaceImport(f.importClause.namedBindings)?o.add(f.importClause.namedBindings.name.text):f.importClause.namedBindings.elements.forEach(g=>o.add(g.name.text)))}else if(i.isEnumDeclaration(f)||i.isFunctionDeclaration(f)||i.isInterfaceDeclaration(f)||i.isClassDeclaration(f)||i.isTypeAliasDeclaration(f)||i.isModuleDeclaration(f)){if(f.name){const g=f.name.getText();o.add(g),G(f,i.ModifierFlags.ExportDefault)?u=g:(s&&i.isIdentifier(f.name)||G(f,i.ModifierFlags.Export))&&a.add(g),f.flags&i.NodeFlags.GlobalAugmentation||L(g,[oe(f),Je(f)])}i.isModuleDeclaration(f)&&(f.body&&(i.isModuleBlock(f.body)||i.isModuleDeclaration(f.body))&&se(f.body,r),Ve(r,f)),ie(r,f)}else if(i.isVariableStatement(f)){const{declarations:g}=f.declarationList,v=G(f,i.ModifierFlags.Export);for(const F of f.declarationList.declarations)if(i.isIdentifier(F.name)){const R=F.name.getText();o.add(R),(s||v)&&a.add(R)}if(ie(r,f),g.length===1){const F=g[0];i.isIdentifier(F.name)&&L(F.name.getText(),[oe(f),Je(f)])}else{const F=g.slice(),R=F.shift();L(R.name.getText(),[oe(f),R.getEnd()]);for(const B of F)i.isIdentifier(B.name)&&L(B.name.getText(),[B.getFullStart(),B.getEnd()])}const{flags:C}=f.declarationList,P=`declare ${C&i.NodeFlags.Let?"let":C&i.NodeFlags.Const?"const":"var"} `,$=f.declarationList.getChildren().find(F=>F.kind===i.SyntaxKind.SyntaxList).getChildren();let _=0;for(const F of $)if(F.kind===i.SyntaxKind.CommaToken)_=F.getStart(),r.remove(_,F.getEnd());else if(_){r.appendLeft(_,`;
19
- `);const R=F.getFullStart(),B=r.slice(R,F.getStart()),ce=B.length-B.trimStart().length;ce?r.overwrite(R,R+ce,P):r.appendLeft(R,P)}}}for(const f of n.statements){if(N(f),i.isExportAssignment(f)&&!f.isExportEquals&&(i.isObjectLiteralExpression(f.expression)||i.isArrayLiteralExpression(f.expression))){u||(u=b("export_default")),r.overwrite(f.getStart(),f.expression.getStart(),`declare var ${u} = `);continue}if(G(f,i.ModifierFlags.ExportDefault)&&(i.isFunctionDeclaration(f)||i.isClassDeclaration(f))){if(f.name)continue;u||(u=b("export_default"));const g=f.getChildren(),v=g.findIndex($=>$.kind===i.SyntaxKind.ClassKeyword||$.kind===i.SyntaxKind.FunctionKeyword),C=g[v],O=g[v+1];if(O.kind>=i.SyntaxKind.FirstPunctuation&&O.kind<=i.SyntaxKind.LastPunctuation){const $=r.slice(C.getEnd(),O.getStart())!=" ";r.appendLeft(O.getStart(),`${$?" ":""}${u}`)}else r.appendRight(C.getEnd(),` ${u}`)}}for(const f of p.values()){const v=f.pop()[0];for(const C of f)r.move(C[0],C[1],v)}u&&r.append(`
18
+ ${ze(e)}`))}analyze(e){for(const t of e){if(this.DEBUG&&console.log(t.getText(),t.kind),i.isImportDeclaration(t)&&t.importClause){this.importNodes.push(t);continue}if(i.isExportDeclaration(t)&&t.exportClause){this.exportNodes.push(t);continue}if(i.isInterfaceDeclaration(t)){this.DEBUG&&console.log(`${t.name.getFullText()} is a type`),this.types.add(t.name.text);continue}if(i.isTypeAliasDeclaration(t)){const r=t.name.text;this.DEBUG&&console.log(`${t.name.getFullText()} is a type`),this.types.add(r);continue}if(i.isEnumDeclaration(t)||i.isFunctionDeclaration(t)||i.isClassDeclaration(t)||i.isVariableStatement(t)){if(i.isVariableStatement(t))for(const r of t.declarationList.declarations)i.isIdentifier(r.name)&&(this.DEBUG&&console.log(`${r.name.getFullText()} is a value (from var statement)`),this.values.add(r.name.text));else t.name&&(this.DEBUG&&console.log(`${t.name.getFullText()} is a value (from declaration)`),this.values.add(t.name.text));continue}if(i.isModuleBlock(t)){this.analyze(t.statements);continue}if(i.isModuleDeclaration(t)){t.name&&i.isIdentifier(t.name)&&(this.DEBUG&&console.log(`${t.name.getFullText()} is a value (from module declaration)`),this.values.add(t.name.text)),this.analyze(t.getChildren());continue}this.DEBUG&&console.log("unhandled statement",t.getFullText(),t.kind)}}isUselessImport(e){const t=this.service.findReferenceCount(e),r=this.typeHints.get(e.text);return r&&r+1>=t}isTypeOnly(e){return this.typeHints.has(e)||this.types.has(e)&&!this.values.has(e)}isReExportTypeOnly(e){return this.reExportTypeHints.has(e)}}function ze(n){const e=n.getFullText().match(/^(?:\n*)([ ]*)/);return" ".repeat(e?.[1]?.length||0)}c(ze,"getNodeIndent");function se(n,e,t){if(i.isModuleDeclaration(n)){n.body&&(i.isModuleBlock(n.body)||i.isModuleDeclaration(n.body))&&se(n.body,e);return}for(const r of n.statements)ie(e,r),i.isModuleDeclaration(r)&&r.body&&(i.isModuleBlock(r.body)||i.isModuleDeclaration(r.body))&&se(r.body,e)}c(se,"preProcessNamespaceBody");function xn({sourceFile:n,isEntry:e,isJSON:t}){const r=new X(n.getFullText()),s=!e&&Sn(n),o=new Set,a=new Set;let u="";const m=new Map,p=new Map;for(const f of n.statements){if(i.isEmptyStatement(f)){r.remove(f.getStart(),f.getEnd());continue}if(i.isImportDeclaration(f)){if(!f.importClause)continue;f.importClause.name&&o.add(f.importClause.name.text),f.importClause.namedBindings&&(i.isNamespaceImport(f.importClause.namedBindings)?o.add(f.importClause.namedBindings.name.text):f.importClause.namedBindings.elements.forEach(y=>o.add(y.name.text)))}else if(i.isEnumDeclaration(f)||i.isFunctionDeclaration(f)||i.isInterfaceDeclaration(f)||i.isClassDeclaration(f)||i.isTypeAliasDeclaration(f)||i.isModuleDeclaration(f)){if(f.name){const y=f.name.getText();o.add(y),f.flags&i.NodeFlags.GlobalAugmentation||(G(f,i.ModifierFlags.ExportDefault)?u=y:(s&&i.isIdentifier(f.name)||G(f,i.ModifierFlags.Export))&&a.add(y)),f.flags&i.NodeFlags.GlobalAugmentation||L(y,[oe(f),Je(f)])}i.isModuleDeclaration(f)&&(f.body&&(i.isModuleBlock(f.body)||i.isModuleDeclaration(f.body))&&se(f.body,r),Ve(r,f)),ie(r,f)}else if(i.isVariableStatement(f)){const{declarations:y}=f.declarationList,v=G(f,i.ModifierFlags.Export);for(const F of f.declarationList.declarations)if(i.isIdentifier(F.name)){const O=F.name.getText();o.add(O),(s||v)&&a.add(O)}if(ie(r,f),y.length===1){const F=y[0];i.isIdentifier(F.name)&&L(F.name.getText(),[oe(f),Je(f)])}else{const F=y.slice(),O=F.shift();L(O.name.getText(),[oe(f),O.getEnd()]);for(const B of F)i.isIdentifier(B.name)&&L(B.name.getText(),[B.getFullStart(),B.getEnd()])}const{flags:C}=f.declarationList,P=`declare ${C&i.NodeFlags.Let?"let":C&i.NodeFlags.Const?"const":"var"} `,$=f.declarationList.getChildren().find(F=>F.kind===i.SyntaxKind.SyntaxList).getChildren();let _=0;for(const F of $)if(F.kind===i.SyntaxKind.CommaToken)_=F.getStart(),r.remove(_,F.getEnd());else if(_){r.appendLeft(_,`;
19
+ `);const O=F.getFullStart(),B=r.slice(O,F.getStart()),ce=B.length-B.trimStart().length;ce?r.overwrite(O,O+ce,P):r.appendLeft(O,P)}}}for(const f of n.statements){if(N(f),i.isExportAssignment(f)&&!f.isExportEquals&&(i.isObjectLiteralExpression(f.expression)||i.isArrayLiteralExpression(f.expression))){u||(u=b("export_default")),r.overwrite(f.getStart(),f.expression.getStart(),`declare var ${u} = `);continue}if(G(f,i.ModifierFlags.ExportDefault)&&(i.isFunctionDeclaration(f)||i.isClassDeclaration(f))){if(f.name)continue;u||(u=b("export_default"));const y=f.getChildren(),v=y.findIndex($=>$.kind===i.SyntaxKind.ClassKeyword||$.kind===i.SyntaxKind.FunctionKeyword),C=y[v],R=y[v+1];if(R.kind>=i.SyntaxKind.FirstPunctuation&&R.kind<=i.SyntaxKind.LastPunctuation){const $=r.slice(C.getEnd(),R.getStart())!=" ";r.appendLeft(R.getStart(),`${$?" ":""}${u}`)}else r.appendRight(C.getEnd(),` ${u}`)}}for(const f of p.values()){const v=f.pop()[0];for(const C of f)r.move(C[0],C[1],v)}u&&r.append(`
20
20
  export default ${u};
21
21
  `),a.size&&r.append(`
22
22
  export { ${[...a].join(", ")} };
@@ -24,13 +24,13 @@ export { ${[...a].join(", ")} };
24
24
  declare const ${u}: {`,[...a].map(f=>` ${f}: typeof ${f};`).join(`
25
25
  `),"};",`export default ${u};
26
26
  `].join(`
27
- `)));for(const[f,g]of m.entries())r.prepend(`import * as ${g} from "${f}";
28
- `);const d=n.getLineStarts(),h=new Set;for(const f of n.typeReferenceDirectives){h.add(f.fileName);const{line:g}=n.getLineAndCharacterOfPosition(f.pos),v=d[g];let C=n.getLineEndOfPosition(f.pos);r.slice(C,C+1)===`
29
- `&&(C+=1),r.remove(v,C)}const l=new Set;for(const f of n.referencedFiles){l.add(f.fileName);const{line:g}=n.getLineAndCharacterOfPosition(f.pos),v=d[g];let C=n.getLineEndOfPosition(f.pos);r.slice(C,C+1)===`
30
- `&&(C+=1),r.remove(v,C)}const y=n.getFullText(),x=i.getLeadingCommentRanges(y,n.endOfFileToken.getFullStart()),S=n.statements[n.statements.length-1],E=S?i.getTrailingCommentRanges(y,S.getEnd()):void 0;for(const f of[...x??[],...E??[]]){if(f.kind!==i.SyntaxKind.SingleLineCommentTrivia)continue;const g=y.slice(f.pos,f.end);if(!/\/\/[#@]\s*sourceMappingURL=/.test(g))continue;let v=f.pos;v>0&&y[v-1]===`
31
- `&&(v-=1),r.remove(v,f.end);break}return{code:r,typeReferences:h,fileReferences:l};function N(f){if(i.forEachChild(f,N),i.isImportTypeNode(f)){if(!i.isLiteralTypeNode(f.argument)||!i.isStringLiteral(f.argument.literal))throw new w(f,"inline imports should have a literal argument");const g=f.argument.literal.text,v=f.getChildren(),C=v.find(_=>_.kind===i.SyntaxKind.ImportKeyword).getStart();let O=f.getEnd();const P=v.find(_=>_.kind===i.SyntaxKind.DotToken||_.kind===i.SyntaxKind.LessThanToken);P&&(O=P.getStart());const $=D(g);r.overwrite(C,O,$)}}function D(f){let g=m.get(f);return g||(g=b(vn(f)),m.set(f,g)),g}function b(f){let g=f;for(;o.has(g);)g=`_${g}`;return o.add(g),g}function L(f,g){let v=p.get(f);if(!v)v=[g],p.set(f,v);else{const C=v[v.length-1];C[1]===g[0]?C[1]=g[1]:v.push(g)}}}c(xn,"preProcess");function Sn(n){let e=!1;for(const t of n.statements){if(i.isExportDeclaration(t)||i.isExportAssignment(t))return!1;(e||i.isImportDeclaration(t)||G(t,i.ModifierFlags.Export))&&(e=!0)}return e}c(Sn,"isGlobalModule");function ie(n,e){if(!i.canHaveModifiers(e))return;if(e.parent.kind===i.SyntaxKind.SourceFile){let r=!1;const s=i.isEnumDeclaration(e)||i.isClassDeclaration(e)||i.isFunctionDeclaration(e)||i.isModuleDeclaration(e)||i.isVariableStatement(e);for(const o of e.modifiers??[])switch(o.kind){case i.SyntaxKind.ExportKeyword:case i.SyntaxKind.DefaultKeyword:n.remove(o.getStart(),o.getEnd()+1);break;case i.SyntaxKind.DeclareKeyword:r=!0}s&&!r&&n.appendRight(e.getStart(),"declare ")}}c(ie,"fixModifiers");function Ve(n,e){if(e.body){if(i.isModuleDeclaration(e.body)){Ve(n,e.body);return}if(i.isModuleBlock(e.body)){for(const t of e.body.statements)if(i.isExportDeclaration(t)&&t.exportClause){if(i.isNamespaceExport(t.exportClause))continue;for(const r of t.exportClause.elements)r.propertyName||n.appendLeft(r.name.getEnd(),` as ${r.name.getText()}`)}}}}c(Ve,"duplicateExports");function vn(n){return n.replace(/[^a-zA-Z0-9_$]/g,()=>"_")}c(vn,"getSafeName");function oe(n){const e=n.getFullStart();return e+(We(n,e)?1:0)}c(oe,"getStart");function Je(n){const e=n.getEnd();return e+(We(n,e)?1:0)}c(Je,"getEnd");function We(n,e){return n.getSourceFile().getFullText()[e]===`
27
+ `)));for(const[f,y]of m.entries())r.prepend(`import * as ${y} from "${f}";
28
+ `);const d=n.getLineStarts(),h=new Set;for(const f of n.typeReferenceDirectives){h.add(f.fileName);const{line:y}=n.getLineAndCharacterOfPosition(f.pos),v=d[y];let C=n.getLineEndOfPosition(f.pos);r.slice(C,C+1)===`
29
+ `&&(C+=1),r.remove(v,C)}const l=new Set;for(const f of n.referencedFiles){l.add(f.fileName);const{line:y}=n.getLineAndCharacterOfPosition(f.pos),v=d[y];let C=n.getLineEndOfPosition(f.pos);r.slice(C,C+1)===`
30
+ `&&(C+=1),r.remove(v,C)}const g=n.getFullText(),x=i.getLeadingCommentRanges(g,n.endOfFileToken.getFullStart()),S=n.statements[n.statements.length-1],E=S?i.getTrailingCommentRanges(g,S.getEnd()):void 0;for(const f of[...x??[],...E??[]]){if(f.kind!==i.SyntaxKind.SingleLineCommentTrivia)continue;const y=g.slice(f.pos,f.end);if(!/\/\/[#@]\s*sourceMappingURL=/.test(y))continue;let v=f.pos;v>0&&g[v-1]===`
31
+ `&&(v-=1),r.remove(v,f.end);break}return{code:r,typeReferences:h,fileReferences:l};function N(f){if(i.forEachChild(f,N),i.isImportTypeNode(f)){if(!i.isLiteralTypeNode(f.argument)||!i.isStringLiteral(f.argument.literal))throw new w(f,"inline imports should have a literal argument");const y=f.argument.literal.text,v=f.getChildren(),C=v.find(_=>_.kind===i.SyntaxKind.ImportKeyword).getStart();let R=f.getEnd();const P=v.find(_=>_.kind===i.SyntaxKind.DotToken||_.kind===i.SyntaxKind.LessThanToken);P&&(R=P.getStart());const $=D(y);r.overwrite(C,R,$)}}function D(f){let y=m.get(f);return y||(y=b(vn(f)),m.set(f,y)),y}function b(f){let y=f;for(;o.has(y);)y=`_${y}`;return o.add(y),y}function L(f,y){let v=p.get(f);if(!v)v=[y],p.set(f,v);else{const C=v[v.length-1];C[1]===y[0]?C[1]=y[1]:v.push(y)}}}c(xn,"preProcess");function Sn(n){let e=!1;for(const t of n.statements){if(i.isExportDeclaration(t)||i.isExportAssignment(t))return!1;(e||i.isImportDeclaration(t)||G(t,i.ModifierFlags.Export))&&(e=!0)}return e}c(Sn,"isGlobalModule");function ie(n,e){if(!i.canHaveModifiers(e))return;if(e.parent.kind===i.SyntaxKind.SourceFile){let r=!1;const s=i.isEnumDeclaration(e)||i.isClassDeclaration(e)||i.isFunctionDeclaration(e)||i.isModuleDeclaration(e)||i.isVariableStatement(e);for(const o of e.modifiers??[])switch(o.kind){case i.SyntaxKind.ExportKeyword:case i.SyntaxKind.DefaultKeyword:n.remove(o.getStart(),o.getEnd()+1);break;case i.SyntaxKind.DeclareKeyword:r=!0}s&&!r&&n.appendRight(e.getStart(),"declare ")}}c(ie,"fixModifiers");function Ve(n,e){if(e.body){if(i.isModuleDeclaration(e.body)){Ve(n,e.body);return}if(i.isModuleBlock(e.body)){for(const t of e.body.statements)if(i.isExportDeclaration(t)&&t.exportClause){if(i.isNamespaceExport(t.exportClause))continue;for(const r of t.exportClause.elements)r.propertyName||n.appendLeft(r.name.getEnd(),` as ${r.name.getText()}`)}}}}c(Ve,"duplicateExports");function vn(n){return n.replace(/[^a-zA-Z0-9_$]/g,()=>"_")}c(vn,"getSafeName");function oe(n){const e=n.getFullStart();return e+(We(n,e)?1:0)}c(oe,"getStart");function Je(n){const e=n.getEnd();return e+(We(n,e)?1:0)}c(Je,"getEnd");function We(n,e){return n.getSourceFile().getFullText()[e]===`
32
32
  `}c(We,"newlineAt");const En=new Set([i.SyntaxKind.LiteralType,i.SyntaxKind.VoidKeyword,i.SyntaxKind.UnknownKeyword,i.SyntaxKind.AnyKeyword,i.SyntaxKind.BooleanKeyword,i.SyntaxKind.NumberKeyword,i.SyntaxKind.StringKeyword,i.SyntaxKind.ObjectKeyword,i.SyntaxKind.NullKeyword,i.SyntaxKind.UndefinedKeyword,i.SyntaxKind.SymbolKeyword,i.SyntaxKind.NeverKeyword,i.SyntaxKind.ThisKeyword,i.SyntaxKind.ThisType,i.SyntaxKind.BigIntKeyword]);class Ge{static{c(this,"DeclarationScope")}constructor({id:e,range:t}){if(this.scopes=[],e)this.declaration=hn(e,t);else{const{iife:s,fn:o}=mn(t);this.iife=s,this.declaration=o}const r=dn();this.declaration.body.body.push(r.stmt),this.returnExpr=r.expr}pushScope(){this.scopes.push(new Set)}popScope(e=1){for(let t=0;t<e;t++)this.scopes.pop()}pushTypeVariable(e){const t=e.getText();this.scopes[this.scopes.length-1]?.add(t)}pushReference(e){let t;if(e.type==="Identifier"?t=e.name:e.type==="MemberExpression"&&e.object.type==="Identifier"&&(t=e.object.name),t){for(const o of this.scopes)if(o.has(t))return}if(t==="this")return;const{ident:r,expr:s}=fn(e);this.declaration.params.push(s),this.returnExpr.elements.push(r)}pushIdentifierReference(e){this.pushReference(M(e))}convertEntityName(e){return i.isIdentifier(e)?M(e):I({type:"MemberExpression",computed:!1,optional:!1,object:this.convertEntityName(e.left),property:M(e.right)},e)}convertPropertyAccess(e){if(!i.isIdentifier(e.expression)&&!i.isPropertyAccessExpression(e.expression))throw new w(e.expression);if(i.isPrivateIdentifier(e.name))throw new w(e.name);const t=i.isIdentifier(e.expression)?M(e.expression):this.convertPropertyAccess(e.expression);return I({type:"MemberExpression",computed:!1,optional:!1,object:t,property:M(e.name)},e)}convertComputedPropertyName(e){if(!e.name||!i.isComputedPropertyName(e.name))return;const{expression:t}=e.name;if(!(i.isLiteralExpression(t)||i.isPrefixUnaryExpression(t))){if(i.isIdentifier(t))return this.pushReference(M(t));if(i.isPropertyAccessExpression(t))return this.pushReference(this.convertPropertyAccess(t));throw new w(t)}}convertParametersAndType(e){this.convertComputedPropertyName(e);const t=this.convertTypeParameters(e.typeParameters);for(const r of e.parameters)this.convertTypeNode(r.type);this.convertTypeNode(e.type),this.popScope(t)}convertHeritageClauses(e){for(const t of e.heritageClauses||[])for(const r of t.types)this.pushReference(A(r.expression)),this.convertTypeArguments(r)}convertTypeArguments(e){if(e.typeArguments)for(const t of e.typeArguments)this.convertTypeNode(t)}convertMembers(e){for(const t of e){if(i.isPropertyDeclaration(t)||i.isPropertySignature(t)||i.isIndexSignatureDeclaration(t)){i.isPropertyDeclaration(t)&&t.initializer&&i.isPropertyAccessExpression(t.initializer)&&this.pushReference(this.convertPropertyAccess(t.initializer)),this.convertComputedPropertyName(t),this.convertTypeNode(t.type);continue}if(i.isMethodDeclaration(t)||i.isMethodSignature(t)||i.isConstructorDeclaration(t)||i.isConstructSignatureDeclaration(t)||i.isCallSignatureDeclaration(t)||i.isGetAccessorDeclaration(t)||i.isSetAccessorDeclaration(t))this.convertParametersAndType(t);else throw new w(t)}}convertTypeParameters(e){if(!e)return 0;for(const t of e)this.convertTypeNode(t.constraint),this.convertTypeNode(t.default),this.pushScope(),this.pushTypeVariable(t.name);return e.length}convertTypeNode(e){if(e&&!En.has(e.kind)){if(i.isTypeReferenceNode(e)){this.pushReference(this.convertEntityName(e.typeName)),this.convertTypeArguments(e);return}if(i.isTypeLiteralNode(e)){this.convertMembers(e.members);return}if(i.isArrayTypeNode(e)){this.convertTypeNode(e.elementType);return}if(i.isTupleTypeNode(e)){for(const t of e.elements)this.convertTypeNode(t);return}if(i.isNamedTupleMember(e)||i.isParenthesizedTypeNode(e)||i.isTypeOperatorNode(e)||i.isTypePredicateNode(e)){this.convertTypeNode(e.type);return}if(i.isUnionTypeNode(e)||i.isIntersectionTypeNode(e)){for(const t of e.types)this.convertTypeNode(t);return}if(i.isMappedTypeNode(e)){const{typeParameter:t,type:r,nameType:s}=e;this.convertTypeNode(t.constraint),this.pushScope(),this.pushTypeVariable(t.name),this.convertTypeNode(r),s&&this.convertTypeNode(s),this.popScope();return}if(i.isConditionalTypeNode(e)){this.convertTypeNode(e.checkType),this.pushScope(),this.convertTypeNode(e.extendsType),this.convertTypeNode(e.trueType),this.convertTypeNode(e.falseType),this.popScope();return}if(i.isIndexedAccessTypeNode(e)){this.convertTypeNode(e.objectType),this.convertTypeNode(e.indexType);return}if(i.isFunctionOrConstructorTypeNode(e)){this.convertParametersAndType(e);return}if(i.isTypeQueryNode(e)){const t=this.convertEntityName(e.exprName);this.pushReference(t),this.convertTypeArguments(e);return}if(i.isRestTypeNode(e)){this.convertTypeNode(e.type);return}if(i.isOptionalTypeNode(e)){this.convertTypeNode(e.type);return}if(i.isTemplateLiteralTypeNode(e)){for(const t of e.templateSpans)this.convertTypeNode(t.type);return}if(i.isInferTypeNode(e)){const{typeParameter:t}=e;this.convertTypeNode(t.constraint),this.pushTypeVariable(t.name);return}else throw new w(e)}}convertNamespace(e,t=!1){if(this.pushScope(),t&&e.body&&i.isModuleDeclaration(e.body)){this.convertNamespace(e.body,!0);return}if(!e.body||!i.isModuleBlock(e.body))throw new w(e,'namespace must have a "ModuleBlock" body.');const{statements:r}=e.body;for(const s of r){if(i.isEnumDeclaration(s)||i.isFunctionDeclaration(s)||i.isClassDeclaration(s)||i.isInterfaceDeclaration(s)||i.isTypeAliasDeclaration(s)||i.isModuleDeclaration(s)){if(s.name&&i.isIdentifier(s.name))this.pushTypeVariable(s.name);else throw new w(s,"non-Identifier name not supported");continue}if(i.isVariableStatement(s)){for(const o of s.declarationList.declarations)if(i.isIdentifier(o.name))this.pushTypeVariable(o.name);else throw new w(o,"non-Identifier name not supported");continue}if(i.isImportDeclaration(s)){if(s.importClause&&(s.importClause.name&&this.pushTypeVariable(s.importClause.name),s.importClause.namedBindings))if(i.isNamespaceImport(s.importClause.namedBindings))this.pushTypeVariable(s.importClause.namedBindings.name);else for(const o of s.importClause.namedBindings.elements)this.pushTypeVariable(o.name);continue}if(i.isImportEqualsDeclaration(s)){this.pushTypeVariable(s.name);continue}if(!i.isExportDeclaration(s))throw new w(s,"namespace child (hoisting) not supported yet")}for(const s of r){if(i.isVariableStatement(s)){for(const o of s.declarationList.declarations)o.type&&this.convertTypeNode(o.type);continue}if(i.isFunctionDeclaration(s)){this.convertParametersAndType(s);continue}if(i.isInterfaceDeclaration(s)||i.isClassDeclaration(s)){const o=this.convertTypeParameters(s.typeParameters);this.convertHeritageClauses(s),this.convertMembers(s.members),this.popScope(o);continue}if(i.isTypeAliasDeclaration(s)){const o=this.convertTypeParameters(s.typeParameters);this.convertTypeNode(s.type),this.popScope(o);continue}if(i.isModuleDeclaration(s)){this.convertNamespace(s,t);continue}if(!i.isEnumDeclaration(s)&&!i.isImportDeclaration(s)){if(i.isImportEqualsDeclaration(s)){i.isEntityName(s.moduleReference)&&this.pushReference(this.convertEntityName(s.moduleReference));continue}if(i.isExportDeclaration(s)){if(s.exportClause){if(i.isNamespaceExport(s.exportClause))throw new w(s.exportClause);for(const o of s.exportClause.elements){const a=o.propertyName||o.name;this.pushIdentifierReference(a)}}}else throw new w(s,"namespace child (walking) not supported yet")}}this.popScope()}}function Tn({sourceFile:n}){return new Nn(n).transform()}c(Tn,"convert");class Nn{static{c(this,"Transformer")}constructor(e){this.sourceFile=e,this.declarations=new Map,this.ast=pn(e);for(const t of e.statements)this.convertStatement(t)}transform(){return{ast:this.ast}}pushStatement(e){this.ast.body.push(e)}createDeclaration(e,t){const r={start:e.getFullStart(),end:e.getEnd()};if(!t){const u=new Ge({range:r});return this.pushStatement(u.iife),u}const s=t.getText(),o=new Ge({id:t,range:r}),a=this.declarations.get(s);if(a){a.pushIdentifierReference(t),a.declaration.end=r.end;const u=this.ast.body.findIndex(m=>m==a.declaration);for(let m=u+1;m<this.ast.body.length;m++){const p=this.ast.body[m];p.start=p.end=r.end}}else this.pushStatement(o.declaration),this.declarations.set(s,o);return a||o}convertStatement(e){if(i.isEnumDeclaration(e))return this.convertEnumDeclaration(e);if(i.isFunctionDeclaration(e))return this.convertFunctionDeclaration(e);if(i.isInterfaceDeclaration(e)||i.isClassDeclaration(e))return this.convertClassOrInterfaceDeclaration(e);if(i.isTypeAliasDeclaration(e))return this.convertTypeAliasDeclaration(e);if(i.isVariableStatement(e))return this.convertVariableStatement(e);if(i.isExportDeclaration(e)||i.isExportAssignment(e))return this.convertExportDeclaration(e);if(i.isModuleDeclaration(e))return this.convertNamespaceDeclaration(e);if(e.kind===i.SyntaxKind.NamespaceExportDeclaration)return this.removeStatement(e);if(i.isImportDeclaration(e)||i.isImportEqualsDeclaration(e))return this.convertImportDeclaration(e);throw new w(e)}removeStatement(e){this.pushStatement(I({type:"ExpressionStatement",expression:{type:"Literal",value:"pls remove me"}},e))}convertNamespaceDeclaration(e){if(e.flags&i.NodeFlags.GlobalAugmentation||!i.isIdentifier(e.name)){this.createDeclaration(e).convertNamespace(e,!0);return}const r=this.createDeclaration(e,e.name);r.pushIdentifierReference(e.name),r.convertNamespace(e,!0)}convertEnumDeclaration(e){this.createDeclaration(e,e.name).pushIdentifierReference(e.name)}convertFunctionDeclaration(e){if(!e.name)throw new w(e,"FunctionDeclaration should have a name");const t=this.createDeclaration(e,e.name);t.pushIdentifierReference(e.name),t.convertParametersAndType(e)}convertClassOrInterfaceDeclaration(e){if(!e.name)throw new w(e,"ClassDeclaration / InterfaceDeclaration should have a name");const t=this.createDeclaration(e,e.name),r=t.convertTypeParameters(e.typeParameters);t.convertHeritageClauses(e),t.convertMembers(e.members),t.popScope(r)}convertTypeAliasDeclaration(e){const t=this.createDeclaration(e,e.name),r=t.convertTypeParameters(e.typeParameters);t.convertTypeNode(e.type),t.popScope(r)}convertVariableStatement(e){const{declarations:t}=e.declarationList;if(t.length!==1)throw new w(e,"VariableStatement with more than one declaration not yet supported");for(const r of t){if(!i.isIdentifier(r.name))throw new w(e,"VariableDeclaration must have a name");const s=this.createDeclaration(e,r.name);s.convertTypeNode(r.type),r.initializer&&this.trackExpressionReferences(r.initializer,s)}}trackExpressionReferences(e,t){if(i.isIdentifier(e))t.pushIdentifierReference(e);else if(i.isObjectLiteralExpression(e))for(const r of e.properties)i.isShorthandPropertyAssignment(r)?t.pushIdentifierReference(r.name):i.isPropertyAssignment(r)&&this.trackExpressionReferences(r.initializer,t);else if(i.isArrayLiteralExpression(e))for(const r of e.elements)i.isExpression(r)&&this.trackExpressionReferences(r,t);else i.isPropertyAccessExpression(e)&&this.trackExpressionReferences(e.expression,t)}convertExportDeclaration(e){if(i.isExportAssignment(e)){this.pushStatement(I({type:"ExportDefaultDeclaration",declaration:A(e.expression)},e));return}const t=e.moduleSpecifier?A(e.moduleSpecifier):void 0;if(!e.exportClause)this.pushStatement(I({type:"ExportAllDeclaration",source:t,exported:null,attributes:[]},e));else if(i.isNamespaceExport(e.exportClause))this.pushStatement(I({type:"ExportAllDeclaration",source:t,exported:M(e.exportClause.name),attributes:[]},e));else{const r=[];for(const s of e.exportClause.elements)r.push(this.convertExportSpecifier(s));this.pushStatement(I({type:"ExportNamedDeclaration",declaration:null,specifiers:r,source:t,attributes:[]},e))}}convertImportDeclaration(e){if(i.isImportEqualsDeclaration(e)){if(i.isEntityName(e.moduleReference)){const s=this.createDeclaration(e,e.name);s.pushReference(s.convertEntityName(e.moduleReference));return}if(!i.isExternalModuleReference(e.moduleReference))throw new w(e,"ImportEquals should have a literal source.");this.pushStatement(I({type:"ImportDeclaration",specifiers:[{type:"ImportDefaultSpecifier",local:M(e.name)}],source:A(e.moduleReference.expression),attributes:[]},e));return}const t=A(e.moduleSpecifier),r=e.importClause&&e.importClause.namedBindings?this.convertNamedImportBindings(e.importClause.namedBindings):[];e.importClause&&e.importClause.name&&r.push({type:"ImportDefaultSpecifier",local:M(e.importClause.name)}),this.pushStatement(I({type:"ImportDeclaration",specifiers:r,source:t,attributes:[]},e))}convertNamedImportBindings(e){return i.isNamedImports(e)?e.elements.map(t=>{const r=M(t.name),s=t.propertyName?M(t.propertyName):r;return{type:"ImportSpecifier",local:r,imported:s}}):[{type:"ImportNamespaceSpecifier",local:M(e.name)}]}convertExportSpecifier(e){const t=M(e.name);return{type:"ExportSpecifier",exported:t,local:e.propertyName?M(e.propertyName):t}}}class Cn{static{c(this,"RelativeModuleDeclarationFixer")}constructor(e,t,r,s){this.sourcemap=r,this.DEBUG=!!process.env.DTS_EXPORTS_FIXER_DEBUG,this.relativeModuleDeclarations=[],this.source=J(e,t.toString()),this.code=t,this.name=s||"./index"}fix(){this.analyze(this.source.statements);for(const e of this.relativeModuleDeclarations){const t=e.getStart(),r=e.getEnd(),s=e.name.kind===i.SyntaxKind.StringLiteral&&"singleQuote"in e.name&&e.name.singleQuote?"'":'"',o=`declare module ${s}${this.name}${s} ${e.body.getText()}`;this.code.overwrite(t,r,o)}return{code:this.code.toString(),map:this.relativeModuleDeclarations.length&&this.sourcemap?this.code.generateMap():null}}analyze(e){for(const t of e)i.isModuleDeclaration(t)&&t.body&&i.isModuleBlock(t.body)&&/^\.\.?\//.test(t.name.text)&&(this.DEBUG&&console.log(`Found relative module declaration: ${t.name.text} in ${this.source.fileName}`),this.relativeModuleDeclarations.push(t))}}function wn(n,e,t){const r=Q(n),s=Q(e.mappings),o=t.split(`
33
- `),a=[];for(let u=0;u<r.length;u+=1){const m=r[u];if(!m||m.length===0){a.push([]);continue}const p=m.find(D=>D.length>=4);if(!p){a.push(m);continue}const[,d,h]=p;if(d!==0||h===void 0||h<0||h>=s.length){a.push(m);continue}const l=s[h];if(!l||l.length===0){a.push(m);continue}const y=p[0],x=p.length>=4?p[3]:0,S=y-(x??0),E=o[u]||"",N=[];for(const D of l){const b=D[0]+S;b<0||b>E.length||(D.length===5?N.push([b,D[1],D[2],D[3],D[4]]):D.length===4?N.push([b,D[1],D[2],D[3]]):N.push([b]))}N.sort((D,b)=>D[0]-b[0]),a.push(N)}return ge(a)}c(wn,"hydrateSourcemap");async function Dn(n){const{fileName:e,originalCode:t,inputMapText:r}=n;if(r)try{return JSON.parse(r)}catch{return null}const s=$e.fromSource(t);if(s)return s.toObject();const o=c(async a=>{const u=a.split(/[?#]/)[0],m=T.resolve(T.dirname(e),u);return le.readFile(m,"utf8")},"readMap");try{const a=await $e.fromMapFileSource(t,o);if(a)return a.toObject()}catch{}try{const a=await le.readFile(e+".map","utf8");return JSON.parse(a)}catch{return null}}c(Dn,"loadInputSourcemap");const bn=c(n=>{const e=new Map,t=new Map,r=new Map;return{name:"dts-transform",buildStart(){e.clear(),t.clear(),r.clear()},options({onLog:s,...o}){return{...o,onLog(a,u,m){a==="warn"&&u.code==="CIRCULAR_DEPENDENCY"||(s?s(a,u,m):m(a,u))},treeshake:{moduleSideEffects:"no-external",propertyReadSideEffects:!0,unknownGlobalSideEffects:!1}}},outputOptions(s){return{...s,chunkFileNames:s.chunkFileNames||"[name]-[hash].d.ts",entryFileNames:s.entryFileNames||"[name].d.ts",format:"es",exports:"named",compact:!1,freeze:!0,interop:"esModule",generatedCode:Object.assign({symbols:!1},s.generatedCode),strict:!1}},transform(s,o,a){const u=te(o),m=this.getModuleIds(),p=Array.from(m).find(N=>te(N)===u),d=!!(p&&this.getModuleInfo(p)?.isEntry),h=!!(p&&ee.test(p)),l=s;let y=J(o,s);const x=xn({sourceFile:y,isEntry:d,isJSON:h});e.set(y.fileName,x.typeReferences),t.set(y.fileName,x.fileReferences),s=x.code.toString(),y=J(o,s);const S=Tn({sourceFile:y});if(process.env.DTS_DUMP_AST&&(console.log(o),console.log(s),console.log(JSON.stringify(S.ast.body,void 0,2))),!n)return{code:s,ast:S.ast};const E=x.code.generateMap({hires:!0,source:o});return j.test(o)&&r.set(o,{fileName:o,originalCode:l,inputMapText:a}),{code:s,ast:S.ast,map:E}},renderChunk(s,o,a){const u=J(o.fileName,s),m=new un(u),p=new Set,d=new Set;for(const S of Object.keys(o.modules)){for(const E of e.get(S.split("\\").join("/"))||[])p.add(E);for(const E of t.get(S.split("\\").join("/"))||[])if(E.startsWith(".")){const N=T.join(T.dirname(S),E),D=a.file&&T.dirname(a.file)||o.facadeModuleId&&T.dirname(o.facadeModuleId)||".";let b=T.relative(D,N).split("\\").join("/");b[0]!=="."&&(b="./"+b),d.add(b)}else d.add(E)}let h=qe(Array.from(d,S=>`/// <reference path="${S}" />`));h+=qe(Array.from(p,S=>`/// <reference types="${S}" />`)),h+=m.fix(),h||(h+=`
34
- export { };`);const y=new gn(o.fileName,h).fix();return new Cn(o.fileName,"magicCode"in y&&y.magicCode?y.magicCode:new X(h),!!a.sourcemap,"./"+T.basename(o.fileName,".d.ts")).fix()},async generateBundle(s,o){if(!s.sourcemap)return;const a=new Map,u=Array.from(r.entries()),m=await Promise.all(u.map(async([h,l])=>({fileName:h,inputMap:await Dn(l)}))),p=c(h=>/^[a-z][a-z0-9+.-]*:\/\//i.test(h),"isUrl");for(const{fileName:h,inputMap:l}of m)if(l&&l.sources){const y=T.dirname(h);let x;l.sourceRoot?x=p(l.sourceRoot)?l.sourceRoot:T.resolve(y,l.sourceRoot):x=y;const S=p(x);a.set(h,{version:l.version??3,sources:l.sources.map(E=>{if(E===null)return null;if(p(E))return E;if(S){const N=x.endsWith("/")?x:x+"/";return new URL(E,N).toString()}return T.isAbsolute(E)?E:T.resolve(x,E)}),mappings:l.mappings,names:l.names})}const d=s.dir||(s.file?T.dirname(s.file):process.cwd());for(const h of Object.values(o)){if(h.type!=="chunk"||!h.map)continue;const l=T.join(d,T.dirname(h.fileName)),y=c(g=>p(g)?g:(T.isAbsolute(g)?T.relative(l,g):g).replaceAll("\\","/"),"toRelativeSourcePath"),x=c(g=>g===null?null:y(g),"toRelativeSourcePathOrNull"),S=new Map;for(const g of h.map.sources){if(!g||p(g))continue;const v=T.resolve(l,g);let C=a.get(v);if(!C&&/\.[cm]?[tj]sx?$/.test(v)&&!v.endsWith(".d.ts")){const O=v.replace(/\.[cm]?[tj]sx?$/,".d.ts");C=a.get(O)}C&&S.set(v,C)}if(S.size===0){if(delete h.map.sourcesContent,h.map.sources.length===0&&h.facadeModuleId){const g=a.get(h.facadeModuleId);if(g&&g.sources.length>0){const v=g.sources.map(x);h.map.sources=v}}He(o,h.fileName,{sources:h.map.sources.map(x),mappings:h.map.mappings,names:h.map.names||[]});continue}const N=h.map.sources.length===1&&S.size===1?Array.from(S.values())[0]:null,D=N&&N.sources.length===1;let b,L,f;if(D&&N)b=N.sources.map(x),L=wn(h.map.mappings,N,h.code),f=N.names||[];else{const g=new Set,v=Zt(h.map,C=>{const O=T.resolve(l,C);if(g.has(O))return null;g.add(O);const P=S.get(O);return P||null});b=v.sources.map(x),L=typeof v.mappings=="string"?v.mappings:"",f=v.names||[]}h.map.sources=b,delete h.map.sourcesContent,h.map.mappings=L,h.map.names=f,He(o,h.fileName,{sources:b,mappings:L,names:f})}}}},"transform");function qe(n){return n.length?n.join(`
33
+ `),a=[];for(let u=0;u<r.length;u+=1){const m=r[u];if(!m||m.length===0){a.push([]);continue}const p=m.find(D=>D.length>=4);if(!p){a.push(m);continue}const[,d,h]=p;if(d!==0||h===void 0||h<0||h>=s.length){a.push(m);continue}const l=s[h];if(!l||l.length===0){a.push(m);continue}const g=p[0],x=p.length>=4?p[3]:0,S=g-(x??0),E=o[u]||"",N=[];for(const D of l){const b=D[0]+S;b<0||b>E.length||(D.length===5?N.push([b,D[1],D[2],D[3],D[4]]):D.length===4?N.push([b,D[1],D[2],D[3]]):N.push([b]))}N.sort((D,b)=>D[0]-b[0]),a.push(N)}return ye(a)}c(wn,"hydrateSourcemap");async function Dn(n){const{fileName:e,originalCode:t,inputMapText:r}=n;if(r)try{return JSON.parse(r)}catch{return null}const s=$e.fromSource(t);if(s)return s.toObject();const o=c(async a=>{const u=a.split(/[?#]/)[0],m=T.resolve(T.dirname(e),u);return le.readFile(m,"utf8")},"readMap");try{const a=await $e.fromMapFileSource(t,o);if(a)return a.toObject()}catch{}try{const a=await le.readFile(e+".map","utf8");return JSON.parse(a)}catch{return null}}c(Dn,"loadInputSourcemap");const bn=c(n=>{const e=new Map,t=new Map,r=new Map;return{name:"dts-transform",buildStart(){e.clear(),t.clear(),r.clear()},options({onLog:s,...o}){return{...o,onLog(a,u,m){a==="warn"&&u.code==="CIRCULAR_DEPENDENCY"||(s?s(a,u,m):m(a,u))},treeshake:{moduleSideEffects:"no-external",propertyReadSideEffects:!0,unknownGlobalSideEffects:!1}}},outputOptions(s){return{...s,chunkFileNames:s.chunkFileNames||"[name]-[hash].d.ts",entryFileNames:s.entryFileNames||"[name].d.ts",format:"es",exports:"named",compact:!1,freeze:!0,interop:"esModule",generatedCode:Object.assign({symbols:!1},s.generatedCode),strict:!1}},transform(s,o,a){const u=te(o),m=this.getModuleIds(),p=Array.from(m).find(N=>te(N)===u),d=!!(p&&this.getModuleInfo(p)?.isEntry),h=!!(p&&ee.test(p)),l=s;let g=J(o,s);const x=xn({sourceFile:g,isEntry:d,isJSON:h});e.set(g.fileName,x.typeReferences),t.set(g.fileName,x.fileReferences),s=x.code.toString(),g=J(o,s);const S=Tn({sourceFile:g});if(process.env.DTS_DUMP_AST&&(console.log(o),console.log(s),console.log(JSON.stringify(S.ast.body,void 0,2))),!n)return{code:s,ast:S.ast};const E=x.code.generateMap({hires:!0,source:o});return j.test(o)&&r.set(o,{fileName:o,originalCode:l,inputMapText:a}),{code:s,ast:S.ast,map:E}},renderChunk(s,o,a){const u=J(o.fileName,s),m=new un(u),p=new Set,d=new Set;for(const S of Object.keys(o.modules)){for(const E of e.get(S.split("\\").join("/"))||[])p.add(E);for(const E of t.get(S.split("\\").join("/"))||[])if(E.startsWith(".")){const N=T.join(T.dirname(S),E),D=a.file&&T.dirname(a.file)||o.facadeModuleId&&T.dirname(o.facadeModuleId)||".";let b=T.relative(D,N).split("\\").join("/");b[0]!=="."&&(b="./"+b),d.add(b)}else d.add(E)}let h=qe(Array.from(d,S=>`/// <reference path="${S}" />`));h+=qe(Array.from(p,S=>`/// <reference types="${S}" />`)),h+=m.fix(),h||(h+=`
34
+ export { };`);const g=new yn(o.fileName,h).fix();return new Cn(o.fileName,"magicCode"in g&&g.magicCode?g.magicCode:new X(h),!!a.sourcemap,"./"+T.basename(o.fileName,".d.ts")).fix()},async generateBundle(s,o){if(!s.sourcemap)return;const a=new Map,u=Array.from(r.entries()),m=await Promise.all(u.map(async([h,l])=>({fileName:h,inputMap:await Dn(l)}))),p=c(h=>/^[a-z][a-z0-9+.-]*:\/\//i.test(h),"isUrl");for(const{fileName:h,inputMap:l}of m)if(l&&l.sources){const g=T.dirname(h);let x;l.sourceRoot?x=p(l.sourceRoot)?l.sourceRoot:T.resolve(g,l.sourceRoot):x=g;const S=p(x);a.set(h,{version:l.version??3,sources:l.sources.map(E=>{if(E===null)return null;if(p(E))return E;if(S){const N=x.endsWith("/")?x:x+"/";return new URL(E,N).toString()}return T.isAbsolute(E)?E:T.resolve(x,E)}),mappings:l.mappings,names:l.names})}const d=s.dir||(s.file?T.dirname(s.file):process.cwd());for(const h of Object.values(o)){if(h.type!=="chunk"||!h.map)continue;const l=T.join(d,T.dirname(h.fileName)),g=c(y=>p(y)?y:(T.isAbsolute(y)?T.relative(l,y):y).replaceAll("\\","/"),"toRelativeSourcePath"),x=c(y=>y===null?null:g(y),"toRelativeSourcePathOrNull"),S=new Map;for(const y of h.map.sources){if(!y||p(y))continue;const v=T.resolve(l,y);let C=a.get(v);if(!C&&/\.[cm]?[tj]sx?$/.test(v)&&!v.endsWith(".d.ts")){const R=v.replace(/\.[cm]?[tj]sx?$/,".d.ts");C=a.get(R)}C&&S.set(v,C)}if(S.size===0){if(delete h.map.sourcesContent,h.map.sources.length===0&&h.facadeModuleId){const y=a.get(h.facadeModuleId);if(y&&y.sources.length>0){const v=y.sources.map(x);h.map.sources=v}}He(o,h.fileName,{sources:h.map.sources.map(x),mappings:h.map.mappings,names:h.map.names||[]});continue}const N=h.map.sources.length===1&&S.size===1?Array.from(S.values())[0]:null,D=N&&N.sources.length===1;let b,L,f;if(D&&N)b=N.sources.map(x),L=wn(h.map.mappings,N,h.code),f=N.names||[];else{const y=new Set,v=Zt(h.map,C=>{const R=T.resolve(l,C);if(y.has(R))return null;y.add(R);const P=S.get(R);return P||null});b=v.sources.map(x),L=typeof v.mappings=="string"?v.mappings:"",f=v.names||[]}h.map.sources=b,delete h.map.sourcesContent,h.map.mappings=L,h.map.names=f,He(o,h.fileName,{sources:b,mappings:L,names:f})}}}},"transform");function qe(n){return n.length?n.join(`
35
35
  `)+`
36
- `:""}c(qe,"writeBlock");function He(n,e,t){const r=`${e}.map`,s=n[r];s&&s.type==="asset"&&(s.source=JSON.stringify({version:3,file:T.basename(e),...t}))}c(He,"updateSourcemapAsset");const In=/\.([cm]ts|[tj]sx?)$/;function ae({entries:n,programs:e,resolvedOptions:t},r,s){const{compilerOptions:o,tsconfig:a}=t;if(!e.length&&j.test(r))return{code:s};const u=n.includes(r),m=e.find(p=>{if(u)return p.getRootFileNames().includes(r);{const d=p.getSourceFile(r);return d&&p.isSourceFileFromExternalLibrary(d)?!1:!!d}});if(m){const p=m.getSourceFile(r);return{code:p?.getFullText(),source:p,program:m}}else if(i.sys.fileExists(r)){if(e.length>0&&j.test(r)&&(t.includeExternal.length>0||t.respectExternal))return{code:s};const p=sn(r,o,a,t.sourcemap);e.push(p);const d=p.getSourceFile(r);return{code:d?.getFullText(),source:d,program:p}}else return null}c(ae,"getModule");const Xe=c((n={})=>{const e={entries:[],programs:[],resolvedOptions:nn(n)},t=bn(e.resolvedOptions.sourcemap);return{name:"dts",outputOptions:t.outputOptions,renderChunk:t.renderChunk,generateBundle:t.generateBundle,options(r){let{input:s=[]}=r;if(!Array.isArray(s))s=typeof s=="string"?[s]:Object.values(s);else if(s.length>1){r.input={};for(const o of s){let a=te(o);T.isAbsolute(o)?a=T.basename(a):a=T.normalize(a),r.input[a]=o}}return e.programs=on(Object.values(s),e.resolvedOptions.compilerOptions,e.resolvedOptions.tsconfig,e.resolvedOptions.sourcemap),t.options.call(this,r)},transform(r,s){if(!In.test(s)&&!ee.test(s))return null;const o=c(p=>{if(p.program){const d=T.dirname(s);p.program.getSourceFiles().map(l=>l.fileName).filter(l=>l.startsWith(d)).forEach(this.addWatchFile)}},"watchFiles"),a=c(()=>{const p=ae(e,s,r);return p?(o(p),t.transform.call(this,p.code,s)):null},"handleDtsFile"),u=c(()=>{const p=ke(s),d=ae(e,p,r);return d?(o(d),t.transform.call(this,d.code,p)):null},"treatTsAsDts"),m=c(()=>{const p=ae(e,s,r);if(!p||!p.source||!p.program)return null;o(p);const d=ke(s);let h,l;const{emitSkipped:y,diagnostics:x}=p.program.emit(p.source,(E,N)=>{E.endsWith(".map")?l=N:h=N},void 0,!0,void 0,!0);if(y){const E=x.filter(N=>N.category===i.DiagnosticCategory.Error);E.length&&(console.error(i.formatDiagnostics(E,ne)),this.error("Failed to compile. Check the logs above."))}if(!h)return null;const S=h.replace(/\n?\/\/# sourceMappingURL=[^\n]+/,"");return t.transform.call(this,S,d,l)},"generateDts");return j.test(s)?a():ee.test(s)?m():u()??m()},resolveId(r,s){if(!s){e.entries.push(T.resolve(r));return}s=s.split("\\").join("/");let o=e.resolvedOptions.compilerOptions;if(e.resolvedOptions.tsconfig){const u=r.startsWith(".")?T.resolve(T.dirname(s),r):r;o=re(u,e.resolvedOptions.compilerOptions,e.resolvedOptions.tsconfig,e.resolvedOptions.sourcemap).compilerOptions}const{resolvedModule:a}=i.resolveModuleName(r,s,o,i.sys);if(a)return a.isExternalLibraryImport&&a.packageId&&e.resolvedOptions.includeExternal.includes(a.packageId.name)?{id:T.resolve(a.resolvedFileName)}:!e.resolvedOptions.respectExternal&&a.isExternalLibraryImport?{id:r,external:!0}:{id:T.resolve(a.resolvedFileName)}}}},"plugin");export{Xe as default,Xe as dts};
36
+ `:""}c(qe,"writeBlock");function He(n,e,t){const r=`${e}.map`,s=n[r];s&&s.type==="asset"&&(s.source=JSON.stringify({version:3,file:T.basename(e),...t}))}c(He,"updateSourcemapAsset");const In=/\.([cm]ts|[tj]sx?)$/;function ae({entries:n,programs:e,resolvedOptions:t},r,s){const{compilerOptions:o,tsconfig:a}=t;if(!e.length&&j.test(r))return{code:s};const u=n.includes(r),m=e.find(p=>{if(u)return p.getRootFileNames().includes(r);{const d=p.getSourceFile(r);return d&&p.isSourceFileFromExternalLibrary(d)?!1:!!d}});if(m){const p=m.getSourceFile(r);return{code:p?.getFullText(),source:p,program:m}}else if(i.sys.fileExists(r)){if(e.length>0&&j.test(r)&&(t.includeExternal.length>0||t.respectExternal))return{code:s};const p=sn(r,o,a,t.sourcemap);e.push(p);const d=p.getSourceFile(r);return{code:d?.getFullText(),source:d,program:p}}else return null}c(ae,"getModule");const Xe=c((n={})=>{const e={entries:[],programs:[],resolvedOptions:nn(n)},t=bn(e.resolvedOptions.sourcemap);return{name:"dts",outputOptions:t.outputOptions,renderChunk:t.renderChunk,generateBundle:t.generateBundle,options(r){let{input:s=[]}=r;if(!Array.isArray(s))s=typeof s=="string"?[s]:Object.values(s);else if(s.length>1){r.input={};for(const o of s){let a=te(o);T.isAbsolute(o)?a=T.basename(a):a=T.normalize(a),r.input[a]=o}}return e.programs=on(Object.values(s),e.resolvedOptions.compilerOptions,e.resolvedOptions.tsconfig,e.resolvedOptions.sourcemap),t.options.call(this,r)},transform(r,s){if(!In.test(s)&&!ee.test(s))return null;const o=c(p=>{if(p.program){const d=T.dirname(s);p.program.getSourceFiles().map(l=>l.fileName).filter(l=>l.startsWith(d)).forEach(this.addWatchFile)}},"watchFiles"),a=c(()=>{const p=ae(e,s,r);return p?(o(p),t.transform.call(this,p.code,s)):null},"handleDtsFile"),u=c(()=>{const p=ke(s),d=ae(e,p,r);return d?(o(d),t.transform.call(this,d.code,p)):null},"treatTsAsDts"),m=c(()=>{const p=ae(e,s,r);if(!p||!p.source||!p.program)return null;o(p);const d=ke(s);let h,l;const{emitSkipped:g,diagnostics:x}=p.program.emit(p.source,(E,N)=>{E.endsWith(".map")?l=N:h=N},void 0,!0,void 0,!0);if(g){const E=x.filter(N=>N.category===i.DiagnosticCategory.Error);E.length&&(console.error(i.formatDiagnostics(E,ne)),this.error("Failed to compile. Check the logs above."))}if(!h)return null;const S=h.replace(/\n?\/\/# sourceMappingURL=[^\n]+/,"");return t.transform.call(this,S,d,l)},"generateDts");return j.test(s)?a():ee.test(s)?m():u()??m()},resolveId(r,s){if(!s){e.entries.push(T.resolve(r));return}s=s.split("\\").join("/");let o=e.resolvedOptions.compilerOptions;if(e.resolvedOptions.tsconfig){const u=r.startsWith(".")?T.resolve(T.dirname(s),r):r;o=re(u,e.resolvedOptions.compilerOptions,e.resolvedOptions.tsconfig,e.resolvedOptions.sourcemap).compilerOptions}const{resolvedModule:a}=i.resolveModuleName(r,s,{moduleResolution:i.ModuleResolutionKind.Node10,...o},i.sys);if(a)return a.isExternalLibraryImport&&a.packageId&&e.resolvedOptions.includeExternal.includes(a.packageId.name)?{id:T.resolve(a.resolvedFileName)}:!e.resolvedOptions.respectExternal&&a.isExternalLibraryImport?{id:r,external:!0}:{id:T.resolve(a.resolvedFileName)}}}},"plugin");export{Xe as default,Xe as dts};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pkgroll",
3
- "version": "2.26.2",
3
+ "version": "2.27.0",
4
4
  "description": "Zero-config rollup bundler",
5
5
  "keywords": [
6
6
  "zero config",
@@ -34,13 +34,13 @@
34
34
  "@rollup/plugin-dynamic-import-vars": "^2.1.5",
35
35
  "@rollup/plugin-json": "^6.1.0",
36
36
  "@rollup/plugin-node-resolve": "^16.0.3",
37
- "cjs-module-lexer": "^2.1.1",
37
+ "cjs-module-lexer": "^2.2.0",
38
38
  "esbuild": "^0.26.0",
39
39
  "magic-string": "^0.30.21",
40
- "rollup": "^4.53.1",
41
- "rollup-plugin-import-trace": "^1.0.0",
40
+ "rollup": "^4.53.5",
41
+ "rollup-plugin-import-trace": "^1.0.1",
42
42
  "rollup-pluginutils": "^2.8.2",
43
- "yaml": "^2.8.1"
43
+ "yaml": "^2.8.2"
44
44
  },
45
45
  "peerDependencies": {
46
46
  "typescript": "^4.1 || ^5.0"