@dtsx/dtsx 0.11.44 → 0.11.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (213) hide show
  1. package/dist/bin/cli.js +1 -1
  2. package/dist/{chunk-g19c3m7s.js → chunk-013mp499.js} +2 -2
  3. package/dist/chunk-0af0hsfc.js +5 -0
  4. package/dist/{chunk-c8s4d7qk.js → chunk-0gwj2fct.js} +6 -6
  5. package/dist/{chunk-ns44qxdd.js → chunk-0kvy1dh8.js} +4 -4
  6. package/dist/{chunk-59jw51gg.js → chunk-0nw1w523.js} +5 -5
  7. package/dist/{chunk-an5ra7tr.js → chunk-1xgcs6aq.js} +4 -4
  8. package/dist/{chunk-vxghzchm.js → chunk-1y19tmb0.js} +3 -3
  9. package/dist/{chunk-ka22zwye.js → chunk-1z9550gn.js} +8 -8
  10. package/dist/{chunk-mhyqvwcg.js → chunk-290jpwny.js} +3 -3
  11. package/dist/{chunk-vv8e8pa3.js → chunk-2h5p8n7w.js} +2 -2
  12. package/dist/{chunk-cgaw8fsn.js → chunk-2wxgt73q.js} +3 -3
  13. package/dist/{chunk-cjhmmqxd.js → chunk-2xp48sa2.js} +2 -2
  14. package/dist/{chunk-65d3dga1.js → chunk-4kn7y9ns.js} +3 -3
  15. package/dist/chunk-4mrq1jdn.js +3 -0
  16. package/dist/{chunk-th9tcxga.js → chunk-587w6ktw.js} +2 -2
  17. package/dist/{chunk-vz4fc70e.js → chunk-5cgpcdsb.js} +3 -3
  18. package/dist/chunk-6bmr0e81.js +14 -0
  19. package/dist/{chunk-yqvn592m.js → chunk-6m8f0y7w.js} +2 -2
  20. package/dist/{chunk-mfp35a3b.js → chunk-8ab8793q.js} +14 -14
  21. package/dist/{chunk-mjzee617.js → chunk-8gksa73c.js} +17 -17
  22. package/dist/chunk-8qpzh9yc.js +4 -0
  23. package/dist/chunk-986k5306.js +3 -0
  24. package/dist/{chunk-njqzhkzy.js → chunk-9kfzjkd1.js} +10 -10
  25. package/dist/chunk-a0900w7b.js +3 -0
  26. package/dist/{chunk-9etacmfx.js → chunk-a8djrg2n.js} +3 -3
  27. package/dist/{chunk-2y5b6hdw.js → chunk-ac95p5v4.js} +6 -6
  28. package/dist/{chunk-s7k223zx.js → chunk-c7dw612y.js} +2 -2
  29. package/dist/{chunk-ptbd3dac.js → chunk-dhzr60ge.js} +2 -2
  30. package/dist/{chunk-der2ssgq.js → chunk-dpd2b7dd.js} +2 -2
  31. package/dist/{chunk-eptz3q7r.js → chunk-dw84pjmf.js} +4 -4
  32. package/dist/chunk-ehpz5rg3.js +31 -0
  33. package/dist/chunk-em9pz9s0.js +3 -0
  34. package/dist/{chunk-932kxt70.js → chunk-g2191y9b.js} +4 -4
  35. package/dist/{chunk-xgf6djk3.js → chunk-g9emajpc.js} +2 -2
  36. package/dist/{chunk-4hkf7dda.js → chunk-g9kqk7y0.js} +4 -4
  37. package/dist/{chunk-6mryvpxj.js → chunk-ga769zw5.js} +5 -5
  38. package/dist/{chunk-9qv34ymq.js → chunk-gqk2s9wt.js} +2 -2
  39. package/dist/{chunk-dzdwc2fh.js → chunk-gsvb5wey.js} +2 -2
  40. package/dist/chunk-h7tsf2qg.js +40 -0
  41. package/dist/chunk-hbe5sg17.js +3 -0
  42. package/dist/chunk-hcf0hd85.js +3 -0
  43. package/dist/{chunk-3rwbf45t.js → chunk-hgg4aqvf.js} +2 -2
  44. package/dist/{chunk-g4rmn34j.js → chunk-j0y149qx.js} +2 -2
  45. package/dist/chunk-j32xn94r.js +3 -0
  46. package/dist/chunk-jtq24yb8.js +3 -0
  47. package/dist/{chunk-5aqwt0a0.js → chunk-jwcw24cc.js} +4 -4
  48. package/dist/{chunk-cynfv4dt.js → chunk-k0exaspt.js} +3 -3
  49. package/dist/chunk-k472ve44.js +3 -0
  50. package/dist/chunk-k75z3nef.js +3 -0
  51. package/dist/chunk-kcbbz8t7.js +37 -0
  52. package/dist/{chunk-m3y5knzq.js → chunk-kcfc6zg6.js} +5 -5
  53. package/dist/{chunk-8v43ne8p.js → chunk-kdqckf54.js} +3 -3
  54. package/dist/{chunk-7x9tawkf.js → chunk-kp6qv2fb.js} +2 -2
  55. package/dist/{chunk-vgyjw95e.js → chunk-ktt2m4eh.js} +4 -4
  56. package/dist/{chunk-jbxb317g.js → chunk-nmjxxcvg.js} +6 -6
  57. package/dist/{chunk-hnckev96.js → chunk-nxqap7nx.js} +4 -4
  58. package/dist/chunk-pjqd38w1.js +8 -0
  59. package/dist/{chunk-gma09qy6.js → chunk-pp9aevcb.js} +2 -2
  60. package/dist/{chunk-9hjd6p38.js → chunk-qmg1535a.js} +2 -2
  61. package/dist/chunk-rdb7j1d6.js +3 -0
  62. package/dist/{chunk-qevb6d6j.js → chunk-rkpwmkrm.js} +2 -2
  63. package/dist/{chunk-zp93zcn5.js → chunk-rnvqc8st.js} +2 -2
  64. package/dist/{chunk-sqnhxtbk.js → chunk-rwdcmcx3.js} +3 -3
  65. package/dist/{chunk-7ez7gynw.js → chunk-ry1c863d.js} +2 -2
  66. package/dist/{chunk-6pr23q72.js → chunk-s9e2a0t7.js} +2 -2
  67. package/dist/{chunk-k5wz43yh.js → chunk-srfpcjtn.js} +2 -2
  68. package/dist/{chunk-rka9z03a.js → chunk-swmftav9.js} +4 -4
  69. package/dist/chunk-t03y036d.js +3 -0
  70. package/dist/{chunk-h1xwd278.js → chunk-t7jvkq9j.js} +2 -2
  71. package/dist/{chunk-q45jkpya.js → chunk-t89jepjk.js} +2 -2
  72. package/dist/{chunk-7krb9b1s.js → chunk-thzkm86y.js} +2 -2
  73. package/dist/chunk-trvp818c.js +4 -0
  74. package/dist/chunk-tsbthwf0.js +7 -0
  75. package/dist/chunk-v4z6808c.js +3 -0
  76. package/dist/chunk-vdhzc40m.js +10 -0
  77. package/dist/{chunk-2d3nbfth.js → chunk-wrjrwren.js} +2 -2
  78. package/dist/{chunk-ehgnwdn9.js → chunk-x6ddycvm.js} +2 -2
  79. package/dist/{chunk-d0aqaj02.js → chunk-xg8yhpe6.js} +2 -2
  80. package/dist/{chunk-3shq1bjr.js → chunk-xm63aee8.js} +2 -2
  81. package/dist/chunk-y1xq2hm4.js +3 -0
  82. package/dist/{chunk-3eb0gc0y.js → chunk-yaej6q2v.js} +1 -1
  83. package/dist/{chunk-waan03ga.js → chunk-yapmefw7.js} +11 -11
  84. package/dist/chunk-z0aa0gd8.js +3 -0
  85. package/dist/{chunk-0cynxv6w.js → chunk-zaka2jk1.js} +2 -2
  86. package/dist/src/augmentation-graph.js +1 -1
  87. package/dist/src/binding-patterns.js +1 -1
  88. package/dist/src/branded-types.js +1 -1
  89. package/dist/src/bundle-linker.js +1 -1
  90. package/dist/src/bundler.js +1 -1
  91. package/dist/src/cache.js +1 -1
  92. package/dist/src/call-signatures.js +1 -1
  93. package/dist/src/circular.js +1 -1
  94. package/dist/src/compat.d.ts +0 -29
  95. package/dist/src/compat.js +1 -1
  96. package/dist/src/computed-keys.js +1 -1
  97. package/dist/src/concurrency.js +1 -1
  98. package/dist/src/config.js +1 -1
  99. package/dist/src/dangling-refs.js +1 -1
  100. package/dist/src/declaration-project.js +1 -1
  101. package/dist/src/declaration-publication.js +1 -1
  102. package/dist/src/declaration-references.js +1 -1
  103. package/dist/src/diff.js +1 -1
  104. package/dist/src/docs.js +1 -1
  105. package/dist/src/enum-declarations.js +1 -1
  106. package/dist/src/errors.js +1 -1
  107. package/dist/src/extractor/directives.js +1 -1
  108. package/dist/src/extractor/extract.d.ts +1 -1
  109. package/dist/src/extractor/extract.js +1 -1
  110. package/dist/src/extractor/scanner.d.ts +4 -17
  111. package/dist/src/extractor/scanner.js +1 -1
  112. package/dist/src/extractor.js +1 -1
  113. package/dist/src/formats.js +1 -1
  114. package/dist/src/formatter.js +1 -1
  115. package/dist/src/function-properties.js +1 -1
  116. package/dist/src/generator.js +1 -1
  117. package/dist/src/global-types.js +1 -1
  118. package/dist/src/import-sorter.js +1 -1
  119. package/dist/src/incremental.js +1 -1
  120. package/dist/src/index.js +1 -1
  121. package/dist/src/inferred-imports.js +1 -1
  122. package/dist/src/initializer-type-spans.d.ts +7 -0
  123. package/dist/src/initializer-type-spans.js +2 -0
  124. package/dist/src/json-config.js +1 -1
  125. package/dist/src/lexical.d.ts +8 -1
  126. package/dist/src/lexical.js +1 -1
  127. package/dist/src/logger.js +1 -1
  128. package/dist/src/lsp.js +1 -1
  129. package/dist/src/memory.js +1 -1
  130. package/dist/src/merger.js +1 -1
  131. package/dist/src/module-graph.js +1 -1
  132. package/dist/src/module-references.js +1 -1
  133. package/dist/src/native-checker.js +1 -1
  134. package/dist/src/native-engine.js +1 -1
  135. package/dist/src/native-extractor.js +1 -1
  136. package/dist/src/native-generation.js +1 -1
  137. package/dist/src/native-project.js +1 -1
  138. package/dist/src/numeric-literals.d.ts +9 -0
  139. package/dist/src/numeric-literals.js +2 -0
  140. package/dist/src/optimizer.d.ts +0 -14
  141. package/dist/src/optimizer.js +1 -1
  142. package/dist/src/output-normalizer.js +1 -1
  143. package/dist/src/parallel-processor.js +1 -1
  144. package/dist/src/parameters.js +1 -1
  145. package/dist/src/parser.js +1 -1
  146. package/dist/src/plugins/bun.js +1 -1
  147. package/dist/src/plugins/esbuild.js +1 -1
  148. package/dist/src/plugins/index.js +1 -1
  149. package/dist/src/plugins/tsdown.js +1 -1
  150. package/dist/src/plugins/tsup.js +1 -1
  151. package/dist/src/plugins/vite.js +1 -1
  152. package/dist/src/plugins/webpack.js +1 -1
  153. package/dist/src/plugins.js +1 -1
  154. package/dist/src/process-source.d.ts +1 -1
  155. package/dist/src/process-source.js +1 -1
  156. package/dist/src/processor/cache.js +1 -1
  157. package/dist/src/processor/comments.js +1 -1
  158. package/dist/src/processor/declarations.js +1 -1
  159. package/dist/src/processor/import-usage.js +1 -1
  160. package/dist/src/processor/imports.js +1 -1
  161. package/dist/src/processor/index.js +1 -1
  162. package/dist/src/processor/type-inference.d.ts +6 -9
  163. package/dist/src/processor/type-inference.js +1 -1
  164. package/dist/src/processor.js +1 -1
  165. package/dist/src/profiling.js +1 -1
  166. package/dist/src/return-type-scope.js +1 -1
  167. package/dist/src/security.js +1 -1
  168. package/dist/src/source-cache.js +1 -1
  169. package/dist/src/sourcemap.js +1 -1
  170. package/dist/src/stx.js +1 -1
  171. package/dist/src/syntax-validator.js +1 -1
  172. package/dist/src/tracking.js +1 -1
  173. package/dist/src/transformers.js +1 -1
  174. package/dist/src/tree-shaker.js +1 -1
  175. package/dist/src/tsconfig.js +1 -1
  176. package/dist/src/type-mappings.js +1 -1
  177. package/dist/src/utils.js +1 -1
  178. package/dist/src/value-inference.js +1 -1
  179. package/dist/src/vue.js +1 -1
  180. package/dist/src/watcher.js +1 -1
  181. package/dist/src/worker-thread.js +1 -1
  182. package/dist/src/worker.js +1 -1
  183. package/dist/src/workspace.js +1 -1
  184. package/native/darwin-arm64/libzig-dtsx.dylib +0 -0
  185. package/native/darwin-x64/libzig-dtsx.dylib +0 -0
  186. package/native/freebsd-x64/libzig-dtsx.so +0 -0
  187. package/native/linux-arm64/libzig-dtsx.so +0 -0
  188. package/native/linux-x64/libzig-dtsx.so +0 -0
  189. package/native/windows-x64/zig-dtsx.dll +0 -0
  190. package/package.json +1 -1
  191. package/dist/chunk-1hz6j7bq.js +0 -37
  192. package/dist/chunk-3v0yh5dk.js +0 -3
  193. package/dist/chunk-4ece5g8t.js +0 -3
  194. package/dist/chunk-86xvq8km.js +0 -4
  195. package/dist/chunk-90f37xen.js +0 -3
  196. package/dist/chunk-976r899s.js +0 -10
  197. package/dist/chunk-anvhqbw8.js +0 -3
  198. package/dist/chunk-btmc3e8d.js +0 -3
  199. package/dist/chunk-d68r83t9.js +0 -3
  200. package/dist/chunk-erymqkk3.js +0 -14
  201. package/dist/chunk-hwgxwgsh.js +0 -4
  202. package/dist/chunk-hyszyzq2.js +0 -3
  203. package/dist/chunk-m2kzh519.js +0 -3
  204. package/dist/chunk-madfh88z.js +0 -3
  205. package/dist/chunk-mhz6xe61.js +0 -7
  206. package/dist/chunk-nek63555.js +0 -3
  207. package/dist/chunk-nxk4h5hy.js +0 -3
  208. package/dist/chunk-q4ebd4qe.js +0 -8
  209. package/dist/chunk-v3n9zzhm.js +0 -5
  210. package/dist/chunk-x1j88x37.js +0 -38
  211. package/dist/chunk-xa9vcbjj.js +0 -3
  212. package/dist/chunk-xb2nr89a.js +0 -3
  213. package/dist/chunk-ykrdzatr.js +0 -31
@@ -0,0 +1,37 @@
1
+ // @bun
2
+ import{a,i,R,S,xe,ze}from"./chunk-0af0hsfc.js";import{t,m,d,Ue,h}from"./chunk-tsbthwf0.js";import{cr}from"./chunk-gsvb5wey.js";import{Ve}from"./chunk-wrjrwren.js";import{ir}from"./chunk-xg8yhpe6.js";import{V,nr}from"./chunk-t89jepjk.js";import{Hn}from"./chunk-j32xn94r.js";import{g,K}from"./chunk-986k5306.js";import{H}from"./chunk-z0aa0gd8.js";import{_e,we,je}from"./chunk-c7dw612y.js";import{n,B,W,Ht,rr,Kt,U,z}from"./chunk-h7tsf2qg.js";import{zn}from"./chunk-pjqd38w1.js";import{b}from"./chunk-nmjxxcvg.js";import{Jn}from"./chunk-hbe5sg17.js";function Oi(E,ne,Q,X,ue=""){let fe=new Map,f={start:0,end:E.length,header:0,name:"",children:[],results:new Map},J=t(E),be=[],w=[],Ke=[],tt=new Map;for(let ee=0;ee<J.length;ee++){let e=J[ee];if(e.kind!=="punctuation")continue;let pe=E.slice(e.start,e.end);if(pe==="(")Ke.push(ee);else if(pe===")"){let me=Ke.pop();if(me!==void 0)tt.set(ee,me)}else if(pe==="{")w.push(ee);else if(pe==="}"){let me=w.pop();if(me===void 0)continue;let ae=J[me].start,ie=me-1,re=ie>=0?E.slice(J[ie].start,J[ie].end):"";if(re===")"){let Te=tt.get(ie);if(Te!==void 0&&Te>0&&["if","for","while","switch","catch","with"].includes(E.slice(J[Te-1].start,J[Te-1].end)))ae=J[Te-1].start}else if(["else","try","finally","do"].includes(re))ae=J[ie].start;be.push({open:J[me].start,close:e.start,header:ae})}}let N=0,j=(ee,e=new Set)=>{let pe=new Set(e),me=t(E.slice(ee.start,ee.end)),ae=0;for(let he=0;he+1<me.length;he++){let He=E.slice(ee.start+me[he].start,ee.start+me[he].end);if(He==="{")ae++;else if(He==="}")ae--;else if(!ae&&["type","interface"].includes(He))pe.add(E.slice(ee.start+me[he+1].start,ee.start+me[he+1].end))}let ie="",re=ee.start,Te=[...ee.results].map(([he,He])=>({type:he,name:He}));for(let he of ee.children.sort((He,ft)=>He.header-ft.header)){let He=j(he,pe);ie+=E.slice(re,he.header)+`
3
+ declare namespace ${he.name} {
4
+ ${He.text}
5
+ }
6
+ `,re=he.end+1;for(let ft of He.exports)Te.push({type:`${he.name}.${ft.name}`,name:ft.name})}ie+=`${E.slice(re,ee.end)}
7
+ ;
8
+ ${Te.map((he)=>`export type ${he.name} = ${he.type};`).join(`
9
+ `)}`;let Qe=F(ie,ne,!1);for(let he of Te)pe.add(he.name);let ge=ue?Gt(ue).map((he,He)=>[he,`${ce}_capture_${He}`]):[],st=Qe.map((he)=>ue&&["type","interface"].includes(he.kind)?Wn(he,ue,ge,pe):(he.kind==="variable"?b(he,!1):he.text).replace(/^export\s+/,"").replace(/^declare\s+/,"")).join(`
10
+ `);return{declarations:Qe,text:st,exports:Te}},ce;return{resolve(ee,e){ce??=Q();let pe=f;for(let ae of be.filter((ie)=>ie.open<e&&e<ie.close).sort((ie,re)=>ie.open-re.open)){let ie=pe.children.find((re)=>re.start===ae.open+1);if(!ie)ie={start:ae.open+1,end:ae.close,header:ae.header,name:`${ce}_scope_${N++}`,children:[],results:new Map},pe.children.push(ie);pe=ie}let me=pe.results.get(ee);if(!me)me=`${ce}_result_${fe.size}`,pe.results.set(ee,me),fe.set(me,ee);return`${ce}.${me}`},finish(ee){if(!ce)return ee;let e=j(f),pe=e.declarations,me=new Set(fe.keys());if(pe.every((ie)=>me.has(ie.name))){let ie=new Map(fe),re=t(ee),Te="",Qe=0;for(let ge=0;ge+2<re.length;ge++){if(ee.slice(re[ge].start,re[ge].end)!==ce||ee.slice(re[ge+1].start,re[ge+1].end)!==".")continue;let st=ie.get(ee.slice(re[ge+2].start,re[ge+2].end));if(!st)continue;Te+=ee.slice(Qe,re[ge].start)+`(${st})`,Qe=re[ge+2].end,ge+=2}return Te+ee.slice(Qe)}if(ue){let ie=Gt(ue).join(", "),re=t(ee),Te="",Qe=0;for(let ge=0;ge+2<re.length;ge++){if(ee.slice(re[ge].start,re[ge].end)!==ce||ee.slice(re[ge+1].start,re[ge+1].end)!=="."||!me.has(ee.slice(re[ge+2].start,re[ge+2].end)))continue;Te+=`${ee.slice(Qe,re[ge+2].end)}<${ie}>`,Qe=re[ge+2].end,ge+=2}ee=Te+ee.slice(Qe)}let ae=e.text;return X({kind:"module",name:ce,text:`declare namespace ${ce} {
11
+ ${ae}
12
+ }`,moduleForm:"namespace",isExported:!1}),ee}}}function Gt(E){let ne=t(E),Q=[],X=0,ue=0,fe=!1;for(let f of ne){let J=E.slice(f.start,f.end);if(J==="<"){if(X++,X===1)fe=!0}else if(J===">"&&E[f.start-1]!=="=")X--;else if(["(","[","{"].includes(J))ue++;else if([")","]","}"].includes(J))ue--;else if(J===","&&X===1&&!ue)fe=!0;else if(fe&&f.kind==="word"&&!["const","in","out"].includes(J))Q.push(J),fe=!1}return Q}function Wn(E,ne,Q,X){let ue=new Set(Gt(E.generics||"")),fe=(j,ce,ee)=>{let e=t(j),pe="",me=0;for(let ae=0;ae<e.length;ae++){let ie=e[ae],re=j.slice(ie.start,ie.end),Te=e[ae+1]&&j.slice(e[ae+1].start,e[ae+1].end),Qe=e[ae+2]&&j.slice(e[ae+2].start,e[ae+2].end),ge=e[ae-1]&&j.slice(e[ae-1].start,e[ae-1].end);if(ie.kind!=="word"||Te===":"||Te==="?"&&Qe===":")continue;let st=!ee.has(re)&&ge!=="."&&Q.find(([he])=>he===re)?.[1];if(st)pe+=j.slice(me,ie.start)+st,me=ie.end;else if(ce&&X.has(re)&&!ee.has(re)){let he=Q.map(([,He])=>He).join(", ");pe+=`${j.slice(me,ie.end)}<${he}${Te==="<"?", ":">"}`,me=Te==="<"?e[++ae].end:ie.end}}return pe+j.slice(me)},f=t(E.text),J=f.findIndex((j)=>["type","interface"].includes(E.text.slice(j.start,j.end))),be=f[J+1],w=E.generics||"",Ke=w?E.text.indexOf(w,be.end)+w.length:be.end,tt=fe(Bn(ne),!1,new Set),N=w?`, ${fe(w.slice(1,-1),!0,ue)}`:"";return`${E.text.slice(0,be.end)}<${tt}${N}>${fe(E.text.slice(Ke),!0,ue)}`.replace(/^export\s+/,"").replace(/^declare\s+/,"")}function Bn(E){let ne=E.slice(1,-1),Q=t(ne),X=0,ue=0,fe=!1,f="";for(let J=0;J<Q.length;J++){let be=Q[J],w=ne.slice(be.start,be.end);if(["(","[","{","<"].includes(w))X++;else if([")","]","}"].includes(w)||w===">"&&ne[be.start-1]!=="=")X--;else if(!X&&w==="const")f+=ne.slice(ue,be.start),ue=be.end;else if(!X&&w==="="&&ne.slice(Q[J+1]?.start,Q[J+1]?.end)!==">")f+=ne.slice(ue,be.start),fe=!0;else if(!X&&w===","&&fe)ue=be.start,fe=!1}return f+(fe?"":ne.slice(ue))}var Fe=32,Ge=9,$e=10,Ee=13,te=47,Se=42,Ae=39,ke=34,We=96,Ye=92,L=123,Y=125,le=40,Ce=41,De=91,Me=93,ve=60,Ie=62,oe=59,et=58,Oe=61,nt=44,ot=46,It=63,pn=35,Ln=64,Nn=36;function Ne(E){return E===Fe||E===Ge||E===$e||E===Ee}function qn(E){let ne=!0;for(let Q=0;Q<E.length;Q++){let X=E.charCodeAt(Q);if(X===ot){if(ne)return!1;ne=!0}else if(ne){if(!a(X))return!1;ne=!1}else if(!i(X))return!1}return E.length>0&&!ne}function $t(E,ne,Q){let X=ne+1;while(X<E.length){let ue=E.charCodeAt(X);if(ue===Ye){X+=2;continue}if(X++,ue===Q)break}return X}function jn(E){if(E==="any"||E==="object"||E==="unknown")return!0;if(E.startsWith("Record<")||E.startsWith("Array<"))return!0;return E.charCodeAt(0)===L&&E.includes("[")&&E.includes("]:")}var Ut=["public","protected","private","readonly","override"];function Ba(E,ne,Q=!0,X=!1){return X?D(E,ne,Q):F(E,ne,Q)}function D(E,ne,Q=!0){return Vt(E,ne,Q,!0)}function F(E,ne,Q=!0,X){return Vt(E,ne,Q,!1,!1,X)}function jt(E,ne,Q=!0){return Vt(E,ne,Q,!0,!0)}function Vt(E,ne,Q,X,ue=!1,fe){let f=E,J=Q,be=X,w=f.length,Ke=ze(f),tt=V(f),N=[],j=new Map,ce=new Map,ee=new Set,e=0,pe,me=0,ae=[],ie=[],re=[],Te=[],Qe;function ge(s){let o=`__dtsx_constructor_field_${Te.length}__`;Qe??=new Set(m(f).filter((r)=>r.kind==="word").map((r)=>f.slice(r.start,r.end)).filter((r)=>r.startsWith("__dtsx_constructor_field_")));while(Qe.has(o))o+="_";return Te.push({marker:o,initializer:s,classes:ae.map((r)=>r.name),namespaces:[...re]}),o}function st(s){let o=/^this\.([\w$]+)$/.exec(s);if(o){let p=ae.at(-1);return p?.fields.get(`${p.isStatic?"static:":""}${o[1]}`)}let r=/^([\w$]+)\s*\(/.exec(s);if(!r||!s.endsWith(")"))return;let c=t(s),l=0;for(let p=1;p<c.length;p++){let y=s.slice(c[p].start,c[p].end);if(y==="(")l++;else if(y===")"&&--l===0&&p!==c.length-1)return}let u=[...N,...j.values()].filter((p)=>p.kind==="function"&&p.name===r[1]);if(u.length!==1||u[0].generics||Ve(f,r[1])!==1)return;return u[0].returnType}function he(s){let o=s.trim(),r=st(o);if(r)return r;if(!o.startsWith("class"))return;let c=t(o);if(c[0]?.kind!=="word"||o.slice(c[0].start,c[0].end)!=="class")return;let l;do l=`__dtsx_class_${me++}`;while(f.includes(l));let u=c[1],p=u?o.slice(u.start,u.end):"",y=u?.kind==="word"&&!["extends","implements"].includes(p),A=y?p:`${l}_value`,C=y?`export ${o}`:`export class ${A} ${o.slice(5)}`,x=F(C,ne,J),O=x.find((k)=>k.kind==="class");if(!O)throw Error("Cannot extract the class expression declaration");if(t(C.slice(O.end??C.length)).some((k)=>C.slice((O.end??0)+k.start,(O.end??0)+k.end)!==";"))return;let M=x.map((k)=>k.text.replace(/^export\s+/,"").replace(/^declare\s+/,"")).join(`
13
+ `);return j.set(l,{kind:"module",name:l,text:`declare namespace ${l} {
14
+ ${M}
15
+ }`,moduleForm:"namespace",isExported:!1,start:e,end:e}),`typeof ${l}.${A}`}function He(s,o){let r=/^this\.([\w$]+)$/.exec(s);if(r)return ae.at(-1)?.fields.get(`${o?"static:":""}${r[1]}`);return he(s)}function ft(s){let o=ce.get(s.name);if(o)o.push(s);else ce.set(s.name,[s]);j.set(s.name,s)}if(e<w&&f.charCodeAt(e)===65279)e++;function ye(s,o){if(s<o){let r=f.charCodeAt(s),c=f.charCodeAt(o-1);if(r!==Fe&&r!==Ge&&r!==$e&&r!==Ee&&c!==Fe&&c!==Ge&&c!==$e&&c!==Ee)return f.slice(s,o)}while(s<o&&Ne(f.charCodeAt(s)))s++;while(o>s&&Ne(f.charCodeAt(o-1)))o--;return f.slice(s,o)}let Qt=/[\r\n]/g;function dt(s){return Qt.lastIndex=s,Qt.exec(f)?.index??w}function T(){if(e>=w)return;let s=f.charCodeAt(e);if(s!==Fe&&s!==Ge&&s!==$e&&s!==Ee&&s!==te)return;while(e<w){let o=f.charCodeAt(e);if(o===Fe||o===Ge||o===$e||o===Ee){e++;continue}if(o===te&&e+1<w){let r=f.charCodeAt(e+1);if(r===te){e=dt(e+2);continue}if(r===Se){let c=f.indexOf("*/",e+2);e=c===-1?w:c+2;continue}}break}}function Cn(s){if(s.indexOf("//")===-1&&s.indexOf("/*")===-1)return s;let o=0,r=0;while(r<s.length){let c=s.charCodeAt(r);if(c===Ae||c===ke||c===We){r=$t(s,r,c),o=r;continue}if(c===Ye){r+=2,o=Math.min(r,s.length);continue}if(c===te&&s.charCodeAt(r+1)===te){while(r<s.length&&s.charCodeAt(r)!==$e&&s.charCodeAt(r)!==Ee)r++;continue}if(c===te&&s.charCodeAt(r+1)===Se){let l=s.indexOf("*/",r+2);r=l===-1?s.length:l+2;continue}if(r++,c>32)o=r}return o<s.length?s.slice(0,o).trimEnd():s}function An(s){let o=s.length,r=0,c=o;for(let l=0;l<o;l++){let u=s.charCodeAt(l);if(r){if(u===Ye){l++;continue}if(u===r)r=0;continue}if(u===Ae||u===ke||u===We){r=u;continue}if(u===te&&l+1<o){let p=s.charCodeAt(l+1);if(p===te){c=l;while(c>0&&(s.charCodeAt(c-1)===Fe||s.charCodeAt(c-1)===Ge))c--;return s.slice(0,c)}if(p===Se){let y=s.indexOf("*/",l+2);if(y!==-1){s=`${s.slice(0,l)} ${s.slice(y+2)}`,l--;continue}}}}c=o;while(c>0&&(s.charCodeAt(c-1)===Fe||s.charCodeAt(c-1)===Ge||s.charCodeAt(c-1)===Ee))c--;return c<o?s.slice(0,c):s}function it(s){e++;let o=s===Ae?"'":'"';while(e<w){let r=f.indexOf(o,e);if(r===-1){e=w;return}let c=0,l=r-1;while(l>=0&&f.charCodeAt(l)===Ye)c++,l--;if(c%2===0){e=r+1;return}e=r+1}}function At(){e++;let s=[];while(e<w){let o=f.charCodeAt(e);if(s.length===0){if(o===Ye){e+=2;continue}if(o===We){e++;return}if(o===Nn&&e+1<w&&f.charCodeAt(e+1)===L){e+=2,s.push(0);continue}e++;continue}if(o===Ae||o===ke){it(o);continue}if(o===We){At();continue}if(o===te&&e+1<w){let r=f.charCodeAt(e+1);if(r===te){e=dt(e+2);continue}if(r===Se){let c=f.indexOf("*/",e+2);e=c===-1?w:c+2;continue}if(Jt()){Zt();continue}e++;continue}if(o===L){s[s.length-1]++,e++;continue}if(o===Y){let r=s[s.length-1];if(r===0){s.pop(),e++;continue}s[s.length-1]=r-1,e++;continue}e++}}let Ot=!1;function qe(){Ot=!1;let s=f.charCodeAt(e);if(s===Ae||s===ke)return it(s),!0;if(s===We)return At(),!0;if(s===te&&e+1<w){let o=f.charCodeAt(e+1);if(o===te)return e=dt(e+2),!0;if(o===Se){let r=f.indexOf("*/",e+2);return Ot=dt(e+2)<(r===-1?w:r),e=r===-1?w:r+2,!0}if(Jt())return Zt(),!0}return!1}function Jt(){return R(f,e)}function Zt(){e=S(f,e)}function Re(){let s=e;while(e<w&&i(f.charCodeAt(e)))e++;return f.slice(s,e)}function v(s){if(e+s.length>w)return!1;for(let o=0;o<s.length;o++)if(f.charCodeAt(e+o)!==s.charCodeAt(o))return!1;if(e+s.length<w&&i(f.charCodeAt(e+s.length)))return!1;return!0}function xt(s){let o=e+s;while(o<w){let r=f.charCodeAt(o);if(r===Fe||r===Ge||r===$e||r===Ee){o++;continue}return r!==ot&&r!==Oe}return!1}function Xt(){if(!Ot)return!1;let s=e;T();let o=e>=w||Et()||f.charCodeAt(e)===Y;return e=s,o}function Et(){if(e>=w)return!1;switch(f.charCodeAt(e)){case 101:return v("export")||v("enum");case 105:return v("import")||v("interface");case 102:return v("function");case 99:return v("class")||v("const");case 116:return v("type");case 108:return v("let");case 118:return v("var");case 100:return v("declare")||v("default");case 109:return v("module");case 110:return v("namespace");case 97:return v("abstract")||v("async");default:return!1}}function pt(){let s=f.charCodeAt(e);if(s!==$e&&s!==Ee)return!1;let o=e;if(e++,s===Ee&&e<w&&f.charCodeAt(e)===$e)e++;while(e<w){let c=f.charCodeAt(e);if(c===Fe||c===Ge||c===Ee||c===$e){e++;continue}if(c===te&&e+1<w){let l=f.charCodeAt(e+1);if(l===te){e=dt(e+2);continue}if(l===Se){let u=f.indexOf("*/",e+2);e=u===-1?w:u+2;continue}}break}let r=e>=w||Et()||f.charCodeAt(e)===Y;return e=o,r}function bn(s){let o=s-1;while(o>=0){let A=f.charCodeAt(o);if(A===Fe||A===Ge||A===Ee||A===$e){o--;continue}break}if(o<0)return!0;let r=f[o];if("+-*/%=<>&|^!~?:,.([{".includes(r))return!0;let c=o;while(c>0&&f.charCodeAt(c-1)!==$e)c--;let l=f.slice(c,o+1),u=l.lastIndexOf("<");if(u!==-1&&/^<[A-Za-z]/.test(l.slice(u))&&!l.slice(u).includes(">"))return!0;let p=o;while(p>=0&&/[a-z]/i.test(f[p]))p--;let y=f.slice(p+1,o+1);return["as","in","of","new","typeof","keyof","extends","instanceof","satisfies","await","return","yield","void"].includes(y)}function wn(s,o){let r=f.charCodeAt(e);if(r!==$e&&r!==Ee&&!(r===te&&(f[e+1]==="/"||f[e+1]==="*")))return!1;let c=m(f),l=0,u=c.length;while(l<u){let x=l+u>>>1;if(c[x].start<e)l=x+1;else u=x}let p=c[l-1],y=c[l];if(!p||p.start<s||!/[\r\n]/.test(f.slice(e,y?.start??w)))return!1;let A=f.slice(p.start,p.end);if(p.end!==o&&p.kind==="punctuation"&&"+-*/%=<>&|^!~?:,.([{".includes(A))return!1;if(p.kind==="word"&&["as","in","of","new","typeof","keyof","extends","instanceof","satisfies","await","return","yield","void"].includes(A))return!1;if(!y)return!0;let C=f.slice(y.start,y.end);return!(".?:)]},+-*/%<>=&|^`([".includes(C)||y.kind==="literal"&&f.charCodeAt(y.start)===We||["as","satisfies","instanceof","in"].includes(C))}function Yt(){let s=f.charCodeAt(e);if(s!==$e&&s!==Ee)return!1;if(bn(e))return!1;let o=e;e++;while(e<w){let l=f.charCodeAt(e);if(l===Fe||l===Ge||l===Ee||l===$e){e++;continue}if(l===te&&e+1<w){let u=f.charCodeAt(e+1);if(u===te){e=dt(e+2);continue}if(u===Se){let p=f.indexOf("*/",e+2);e=p===-1?w:p+2;continue}}break}let r=e<w?f[e]:"",c=r==="|"||r==="&"||r==="["||r==="."||r==="?"||r===":"||r===">"||r===")"||r===","||v("extends");return e=o,!c}function bt(){let s=f.charCodeAt(e);if(s!==$e&&s!==Ee)return!1;let o=e;if(e++,s===Ee&&e<w&&f.charCodeAt(e)===$e)e++;while(e<w){let c=f.charCodeAt(e);if(c===Fe||c===Ge||c===Ee||c===$e){e++;continue}if(c===te&&e+1<w&&f.charCodeAt(e+1)===te){e=dt(e+2);continue}break}if(e>=w)return e=o,!0;let r=f.charCodeAt(e);if(r===124||r===38||r===ot||r===It||r===et)return e=o,!1;if(v("extends")||v("keyof")||v("typeof")||v("infer")||v("is")||v("as")||v("in"))return e=o,!1;return e=o,!0}let kn=/[{}'"`\/]/g,$n=/[()'"`\/]/g,xn=/[[\]'"`\/]/g,yn=/[<>'"`\/]/g;function Be(s,o){let r=1;e++;let c=s===L?kn:s===le?$n:s===De?xn:yn;c.lastIndex=e;let l;while((l=c.exec(f))!==null){let u=l.index,p=f.charCodeAt(u);if(p===Ae||p===ke){e=u,it(p),c.lastIndex=e;continue}if(p===We){e=u,At(),c.lastIndex=e;continue}if(p===te){if(e=u,qe()){c.lastIndex=e;continue}c.lastIndex=u+1;continue}if(p===s)r++;else if(p===o){if(o===Ie&&u>0&&f.charCodeAt(u-1)===Oe){c.lastIndex=u+1;continue}if(r--,r===0)return e=u+1,e}c.lastIndex=u+1}return e=w,e}function Xe(){return e>0&&f.charCodeAt(e-1)===Oe}function Rt(){return e+1<w&&f.charCodeAt(e+1)===Ie}let Je=/[<{};'"`\/\n\r()[\]]/g;function Le(s=!1){let o=0,r=0,c=0,l=0,u=f.charCodeAt(e)===L;Je.lastIndex=e;let p;while((p=Je.exec(f))!==null){let y=p.index,A=f.charCodeAt(y);if(A===Ae||A===ke){e=y,it(A),Je.lastIndex=e;continue}if(A===We){e=y,At(),Je.lastIndex=e;continue}if(A===te){if(y>0&&f.charCodeAt(y-1)===ve){Je.lastIndex=y+1;continue}if(e=y,qe()){if(o===0&&r===0&&c===0&&l===0&&Xt())return;Je.lastIndex=e;continue}Je.lastIndex=y+1;continue}if(A===ve){let C=Ke(y)?.delta??null;if(C!==null)l=Math.max(0,l+C);Je.lastIndex=y+1;continue}if(A===le){r++,Je.lastIndex=y+1;continue}if(A===Ce){r--,Je.lastIndex=y+1;continue}if(A===De){c++,Je.lastIndex=y+1;continue}if(A===Me){c--,Je.lastIndex=y+1;continue}if(A===L){o++,Je.lastIndex=y+1;continue}if(A===Y){let C=o>0;if(!C&&s&&r===0&&c===0&&l===0){e=y;return}if(C)o--;if((!C||u)&&o===0&&r===0&&c===0&&l===0){e=y+1;return}if(C&&o===0&&r===0&&c===0&&l===0){e=y+1;let x=e;T();let O=Et();if(e=x,O)return}Je.lastIndex=y+1;continue}if(A===oe&&o===0&&r===0&&c===0&&l===0){e=y+1;return}if((A===$e||A===Ee)&&o===0&&r===0&&c===0&&l===0){if(e=y,pt())return}Je.lastIndex=y+1}e=w}function vn(){e++;while(e<w&&(f.charCodeAt(e)===Fe||f.charCodeAt(e)===Ge))e++;let s=f.indexOf(`
16
+ `,e),o=s===-1?w:s,r=f.indexOf(";",e);if(r!==-1&&r<o){let c=r-1;while(c>=e&&(f.charCodeAt(c)===Fe||f.charCodeAt(c)===Ge))c--;let l=f.charCodeAt(e),u=f.charCodeAt(c);if(l===L&&u===Y||l===De&&u===Me||l===Ae&&u===Ae||l===ke&&u===ke||l===We&&u===We){e=r+1;return}}Le()}function en(){Be(L,Y);while(e<w&&Ne(f.charCodeAt(e)))e++;if(v("from")){e+=4;while(e<w&&Ne(f.charCodeAt(e)))e++;if(e<w){let s=f.charCodeAt(e);if(s===Ae||s===ke)it(s)}}while(e<w&&(f.charCodeAt(e)===Fe||f.charCodeAt(e)===Ge))e++;if(e<w&&f.charCodeAt(e)===oe)e++}function tn(){e++;while(e<w&&Ne(f.charCodeAt(e)))e++;if(v("as")){e+=2;while(e<w&&Ne(f.charCodeAt(e)))e++;Re();while(e<w&&Ne(f.charCodeAt(e)))e++}if(v("from")){e+=4;while(e<w&&Ne(f.charCodeAt(e)))e++;if(e<w){let s=f.charCodeAt(e);if(s===Ae||s===ke)it(s)}}while(e<w&&(f.charCodeAt(e)===Fe||f.charCodeAt(e)===Ge))e++;if(e<w&&f.charCodeAt(e)===oe)e++}function yt(s){let o=s.indexOf("from ");if(o===-1)return;let r=o+5;while(r<s.length&&(s.charCodeAt(r)===32||s.charCodeAt(r)===9))r++;if(r>=s.length)return;let c=s.charCodeAt(r);if(c!==39&&c!==34)return;let l=s.indexOf(s[r],r+1);if(l===-1)return;return s.slice(r+1,l)}function Ze(s){if(!J)return;let o=s-1;while(o>=0&&Ne(f.charCodeAt(o)))o--;if(o<0)return;let r=[],c=!1;while(o>=0){if(o>=1&&f.charCodeAt(o)===te&&f.charCodeAt(o-1)===Se){let p=f.lastIndexOf("/*",o-2);if(p>=0){r.push(f.slice(p,o+1)),c=!0,o=p-1;while(o>=0&&Ne(f.charCodeAt(o)))o--;continue}break}let l=o;while(l>0&&f.charCodeAt(l-1)!==$e)l--;let u=ye(l,o+1);if(u.startsWith("//")){if(c)break;let p=[u];o=l-1;while(o>=0&&(f.charCodeAt(o)===$e||f.charCodeAt(o)===Ee))o--;while(o>=0){let y=o;while(y>0&&f.charCodeAt(y-1)!==$e)y--;let A=ye(y,o+1);if(A.startsWith("//")){p.push(A),o=y-1;while(o>=0&&(f.charCodeAt(o)===$e||f.charCodeAt(o)===Ee))o--}else if(A===""){o=y-1;while(o>=0&&(f.charCodeAt(o)===$e||f.charCodeAt(o)===Ee))o--}else break}p.reverse(),r.push(p.join(`
17
+ `));continue}break}if(r.length===0)return;return r.reverse(),r}function Sn(s){let o=s,r=!1,c=0,l;while(e<w){let I=f.charCodeAt(e);if(I===te&&(f.charCodeAt(e+1)===te||f.charCodeAt(e+1)===Se)){T();continue}if(I===oe){e++;break}if(I===L)c++;else if(I===Y&&c>0)c--;if(I===Ae||I===ke){if(it(I),c>0)continue;r=!0;let M=e;if(T(),f.charCodeAt(e)===Ce){let k=e+1;l=Ue(f.slice(o,k)),e=l?k:M}else e=M;while(e<w&&(f.charCodeAt(e)===Fe||f.charCodeAt(e)===Ge))e++;if(e<w&&f.charCodeAt(e)===oe)e++;break}if(I===$e&&r)break;e++}let u=ye(o,e),p=h(u).find((I)=>I.category==="static-import"),y=t(u),A=l?.isTypeOnly??p?.isTypeOnly??!1,C=y[1]?.kind==="quoted",x=l?.source??p?.specifier??"",O=Ze(o);return{kind:"import",name:"",text:u,isExported:!1,isTypeOnly:A,isSideEffect:C,source:x,leadingComments:O,start:o,end:e}}function Mt(){let s=e;return Be(L,Y),f.slice(s,e)}function nn(s){let o=s.indexOf("(");if(o===-1)return s;let r=s.slice(o);if(r.indexOf("=")===-1)return s;let c=!1;for(let A=0;A<r.length;A++)if(r.charCodeAt(A)===61){let x=A>0?r.charCodeAt(A-1):0,O=A+1<r.length?r.charCodeAt(A+1):0;if(x!==61&&x!==33&&x!==60&&x!==62&&O!==61&&O!==62){c=!0;break}}if(!c)return s;let l=0,u=-1;for(let A=o;A<s.length;A++){let C=s.charCodeAt(A);if(C===40)l++;else if(C===41){if(l--,l===0){u=A;break}}}if(u===-1)return s;let p=s.slice(o,u+1),y=mt(p);return s.slice(0,o)+y+s.slice(u+1)}function sn(s){let o=s.indexOf("//")!==-1||s.indexOf("/*")!==-1,r=s.split(`
18
+ `),c=[],l=[],u=[],p=!1,y=1/0;for(let x=0;x<r.length;x++){let O=r[x];if(o){if(p){if(O.includes("*/"))p=!1;continue}let I=O.trim();if(I.length===0)continue;let M=I.charCodeAt(0);if(M===te){let Z=I.charCodeAt(1);if(Z===te)continue;if(Z===Se){if(!I.includes("*/"))p=!0;continue}}if(M===Se)continue;let k=An(O);if(k.charCodeAt(k.length-1)===oe)k=k.slice(0,-1);k=nn(k);let _=k.trim();if(!_)continue;c.push(k),l.push(_);let G=0;while(G<k.length&&Ne(k.charCodeAt(G)))G++;if(_!=="{"&&_!=="}"){if(G<y)y=G}u.push(G)}else{let I=O.length;while(I>0&&(O.charCodeAt(I-1)===Fe||O.charCodeAt(I-1)===Ge||O.charCodeAt(I-1)===Ee))I--;if(I===0)continue;let M=I<O.length?O.slice(0,I):O;if(M.charCodeAt(M.length-1)===oe)M=M.slice(0,-1);M=nn(M);let k=M.trim();if(!k)continue;c.push(M),l.push(k);let _=0;while(_<M.length&&Ne(M.charCodeAt(_)))_++;if(k!=="{"&&k!=="}"){if(_<y)y=_}u.push(_)}}if(c.length===0)return"{}";if(y===1/0||y<=2)return c.join(`
19
+ `);let A=y-2,C=Array(c.length);for(let x=0;x<c.length;x++){let O=l[x];if(O==="{"){C[x]=O;continue}let I=u[x];if(I>y)C[x]=c[x];else if(I===y&&(O.charCodeAt(0)===Y||O.charCodeAt(0)===Me||O.charCodeAt(0)===Ce))C[x]=c[x];else{let M=Math.max(0,I-A);C[x]=" ".repeat(M)+O}}return C.join(`
20
+ `)}function rt(){if(e>=w||f.charCodeAt(e)!==ve)return"";let s=e;Be(ve,Ie);let o=f.slice(s,e);if(o.includes(`
21
+ `)){let r="",c=!1;for(let l=0;l<o.length;l++){let u=o.charCodeAt(l);if(u===32||u===9||u===10||u===13){if(!c&&r.length>0)r+=" ",c=!0}else r+=o[l],c=!1}if(r.charCodeAt(1)===32)r=`<${r.slice(2)}`;if(r.charCodeAt(r.length-2)===32)r=`${r.slice(0,-2)}>`;return r}return o}function ct(){if(e>=w||f.charCodeAt(e)!==le)return"()";let s=e;return Be(le,Ce),f.slice(s,e)}function vt(s){if(s.indexOf("/")===-1)return s;let o="",r=!1,c=0;for(let l=0;l<s.length;l++){let u=s.charCodeAt(l);if(r){if(o+=s[l],u===Ye&&l+1<s.length){o+=s[++l];continue}if(u===c)r=!1;continue}if(u===Ae||u===ke||u===We){r=!0,c=u,o+=s[l];continue}if(u===te&&l+1<s.length){let p=s.charCodeAt(l+1);if(p===Se){let y=s.indexOf("*/",l+2);l=y===-1?s.length:y+1,o+=" ";continue}if(p===te){let y=s.indexOf(`
22
+ `,l+2);l=y===-1?s.length:y-1;continue}}o+=s[l]}return o.trim()}function mt(s){let o=s.slice(1,-1).trim();if(!o)return"()";if(s.indexOf(`
23
+ `)===-1&&o.indexOf(":")!==-1&&o.indexOf("{")===-1&&o.indexOf("[")===-1&&o.indexOf("=")===-1&&o.indexOf("@")===-1&&o.indexOf("...")===-1){let A=0,C=0,x=0;for(let O=0;O<o.length;O++){let I=o.charCodeAt(O);if(I===le||I===ve||I===L)x++;else if(I===Ce||I===Ie||I===Y)x--;else if(x===0){if(I===et)A++;else if(I===nt)C++}}if(A>=C+1){let O=!1;for(let I=0;I<Ut.length;I++){let M=Ut[I],k=o.indexOf(M);if(k!==-1){let _=k+M.length;if((k===0||!i(o.charCodeAt(k-1)))&&(_>=o.length||!i(o.charCodeAt(_)))){O=!0;break}}}if(!O)return s}}let r=[],c=0,l=0,u=!1,p=0;for(let A=0;A<=o.length;A++){if(A===o.length){r.push(vt(o.slice(c).trim()));break}let C=o.charCodeAt(A);if(u){if(C===Ye){A++;continue}if(C===p)u=!1;continue}if(C===te&&A+1<o.length){let x=o.charCodeAt(A+1);if(x===Se){A+=2;while(A+1<o.length&&!(o.charCodeAt(A)===Se&&o.charCodeAt(A+1)===te))A++;A++;continue}if(x===te){while(A<o.length&&o.charCodeAt(A)!==10)A++;continue}}if(C===Ae||C===ke||C===We){u=!0,p=C;continue}if(C===le||C===L||C===De||C===ve)l++;else if(C===Ce||C===Y||C===Me||C===Ie&&!(A>0&&o.charCodeAt(A-1)===Oe))l--;else if(C===nt&&l===0)r.push(vt(o.slice(c,A).trim())),c=A+1}let y=[];for(let A of r){if(!A)continue;let C=A.trim();if(C.startsWith("//")||C.startsWith("/*"))continue;let x=A;{let O=!1,I=0,M=0,k=0;for(let _=0;_<x.length-1;_++){let G=x.charCodeAt(_);if(G===$e){k=_+1;continue}if(O){if(G===Ye){_++;continue}if(G===I)O=!1;continue}if(G===Ae||G===ke||G===We){O=!0,I=G;continue}if(G===L||G===De||G===le||G===ve){M++;continue}if(G===Y||G===Me||G===Ce||G===Ie){if(M>0)M--;continue}if(G===te&&x.charCodeAt(_+1)===te){if(M===0){x=x.slice(0,_).trimEnd();break}let Z=x.indexOf(`
24
+ `,_);if(Z===-1){x=x.slice(0,k).trimEnd();break}let q=x.slice(0,k),P=x.slice(Z+1);x=`${q}${P}`,_=k-1}}}if(!x.trim())continue;y.push(rn(x))}return _e(`(${y.join(", ")})`)}function _n(s){if(!s.startsWith("{")&&!s.startsWith("["))return s;let o="",r=0,c=0,l=!1,u=0;while(r<s.length){let p=s.charCodeAt(r);if(l){if(p===Ye&&r+1<s.length){o+=s[r]+s[r+1],r+=2;continue}if(p===u)l=!1;o+=s[r],r++;continue}if(p===te&&r+1<s.length){let y=s.charCodeAt(r+1);if(y===Se){let A=r;r+=2;while(r+1<s.length&&!(s.charCodeAt(r)===Se&&s.charCodeAt(r+1)===te))r++;r=Math.min(r+2,s.length),o+=s.slice(A,r);continue}if(y===te){let A=r;while(r<s.length&&s.charCodeAt(r)!==10)r++;o+=s.slice(A,r);continue}}if(p===Ae||p===ke||p===We){l=!0,u=p,o+=s[r],r++;continue}if(p===L||p===De||p===le)c++;else if(p===Y||p===Me||p===Ce)c--;if(c>=1&&p===Oe&&(r+1>=s.length||s.charCodeAt(r+1)!==Oe&&s.charCodeAt(r+1)!==Ie)){while(o.length>0&&(o[o.length-1]===" "||o[o.length-1]==="\t"||o[o.length-1]===`
25
+ `))o=o.slice(0,-1);r++;let y=0;while(r<s.length){let A=s.charCodeAt(r);if(A===Ae||A===ke||A===We){let C=A;r++;while(r<s.length){if(s.charCodeAt(r)===Ye){r+=2;continue}if(s.charCodeAt(r)===C){r++;break}r++}continue}if(A===L||A===De||A===le)y++;else if(A===Y||A===Me||A===Ce){if(y===0)break;y--}else if(A===nt&&y===0)break;r++}continue}if(c===1&&p===ot&&r+2<s.length&&s.charCodeAt(r+1)===ot&&s.charCodeAt(r+2)===ot){r+=3;continue}o+=s[r],r++}return o}function rn(s){let o=s.trim(),r=o.startsWith("...");if(r)o=o.slice(3).trim();while(o.startsWith("@")){let k=1;while(k<o.length&&i(o.charCodeAt(k)))k++;if(k<o.length&&o.charCodeAt(k)===le){let _=1;k++;while(k<o.length&&_>0){if(o.charCodeAt(k)===le)_++;else if(o.charCodeAt(k)===Ce)_--;k++}}o=o.slice(k).trim()}let c=!0;while(c){c=!1;for(let k of Ut)if(o.startsWith(k)&&o.length>k.length&&!i(o.charCodeAt(k.length))){let _=o.slice(k.length).trim();if(_.charCodeAt(0)===et||_.charCodeAt(0)===It&&_.length>1&&_.charCodeAt(1)===et)break;o=_,c=!0;break}}let l=-1,u=-1,p=0,y=!1,A=0;for(let k=0;k<o.length;k++){let _=o.charCodeAt(k);if(y){if(_===Ye){k++;continue}if(_===A)y=!1;continue}if(_===te&&k+1<o.length){let G=o.charCodeAt(k+1);if(G===Se){k+=2;while(k+1<o.length&&!(o.charCodeAt(k)===Se&&o.charCodeAt(k+1)===te))k++;k++;continue}if(G===te){while(k<o.length&&o.charCodeAt(k)!==10)k++;continue}}if(_===Ae||_===ke||_===We){y=!0,A=_;continue}if(_===le||_===L||_===De||_===ve)p++;else if(_===Ce||_===Y||_===Me||_===Ie&&!(k>0&&o.charCodeAt(k-1)===Oe))p--;else if(p===0){if(_===et&&l===-1)l=k;else if(_===Oe&&u===-1&&(k===0||o.charCodeAt(k-1)!==Oe)&&(k+1>=o.length||o.charCodeAt(k+1)!==Oe&&o.charCodeAt(k+1)!==Ie))u=k}}let C,x,O=u!==-1;if(l!==-1&&(u===-1||l<u))if(C=o.slice(0,l).trim(),u!==-1)x=o.slice(l+1,u).trim();else x=o.slice(l+1).trim();else if(u!==-1){C=o.slice(0,u).trim();let k=r?null:we(C,o.slice(u+1));if(k)return je(k,wt);x=wt(o.slice(u+1).trim())}else C=o,x="unknown";if(C=_n(C),(C.startsWith("{")||C.startsWith("["))&&C.includes(`
26
+ `)){let k=C.replace(/\s*\n\s*/g," ").replace(/\s+/g," ");if(k.length<=40)C=k;else C=C.split(`
27
+ `).map((G)=>{let Z=G.trim();if(!Z)return"";if(Z==="{"||Z==="}"||Z==="["||Z==="]"||Z.startsWith("}")||Z.startsWith("]"))return Z;return` ${Z}`}).join(`
28
+ `)}let I=C.endsWith("?")||O;if(C.endsWith("?"))C=C.slice(0,-1).trim();let M=I&&!r?"?":"";if(r)return`...${C}: ${x}`;return`${C}${M}: ${x}`}function wt(s){let o=s.trim(),r=st(o);if(r)return r;if(o==="true"||o==="false")return"boolean";if(g(o))return"number";if(o.startsWith("'")&&o.endsWith("'")||o.startsWith('"')&&o.endsWith('"'))return"string";if(o.startsWith("["))return"unknown[]";if(o.startsWith("{"))return"Record<string, unknown>";return U(o)??"unknown"}function Pt(s){let o=s.trim();if(o.endsWith("as const"))o=o.slice(0,-8).trim();if(o==="true"||o==="false")return o;if(g(o))return K(o);let r=Tn(o);if(r!==null)return r;return U(o)??"unknown"}function Tn(s){if(s==="")return null;if(s.charCodeAt(0)===Ae||s.charCodeAt(0)===ke){if($t(s,0,s.charCodeAt(0))===s.length)return s}let o=Dn(s,"+");if(o.length>1){let r=!1,c=!0,l=[];for(let u of o){let p=u.trim(),y=p.charCodeAt(0);if((y===Ae||y===ke)&&$t(p,0,y)===p.length)r=!0,l.push(In(p));else c=!1}if(c)return On(l.join(""));if(r)return"string";return null}if(/^[\d\s()+*/%.\-]+$/.test(s)&&/\d/.test(s)&&/[+*/%\-\s]/.test(s))return"number";return null}function Dn(s,o){let r=[],c=0,l="",u=0;while(u<s.length){let p=s.charCodeAt(u);if(p===Ae||p===ke||p===We){let y=$t(s,u,p);l+=s.slice(u,y),u=y;continue}if(p===te&&(s.charCodeAt(u+1)===te||s.charCodeAt(u+1)===42)){if(s.charCodeAt(u+1)===te){let C=s.indexOf(`
29
+ `,u+2),x=C===-1?s.length:C;l+=s.slice(u,x),u=x;continue}let y=s.indexOf("*/",u+2),A=y===-1?s.length:y+2;l+=s.slice(u,A),u=A;continue}if(p===le||p===De||p===L)c++;else if(p===Ce||p===Me||p===Y)c--;if(s[u]===o&&c===0){r.push(l),l="",u++;continue}l+=s[u],u++}return r.push(l),r}function In(s){return s.slice(1,-1).replace(/\\(.)/g,(r,c)=>{if(c==="n")return`
30
+ `;if(c==="t")return"\t";if(c==="r")return"\r";if(c==="0")return"\x00";return c})}function On(s){return`'${s.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}'`}function St(s){if(s.endsWith("as const"))return null;let o=0,r=-1;for(let l=0;l<s.length;l++){let u=s.charCodeAt(l);if(u===Ae||u===ke||u===We)l=$t(s,l,u)-1;else if(u===123||u===91||u===40)o++;else if(u===125||u===93||u===41)o--;else if(o===0&&u===32&&l+4<=s.length&&s.substring(l,l+4)===" as ")r=l}if(r===-1)return null;return s.slice(r+4).trim()||null}function kt(){if(T(),e<w&&f.charCodeAt(e)===et){let c=function(){let l=ye(s,r),u=(p)=>{let y=l.length-p.length;return y>=0&&l.endsWith(p)&&(y===0||!i(l.charCodeAt(y-1)))};return l.length===0||l.endsWith("=>")||l.endsWith("|")||l.endsWith("&")||u("is")||u("extends")};e++,T();let s=e,o=0,r=s;while(e<w){let l=e;if(qe()){if(f.charCodeAt(l)!==te)r=e;continue}let u=f.charCodeAt(e);if(u===le||u===De||u===ve)o++;else if(u===Ce||u===Me||u===Ie&&!Xe())o--;else if(u===L)if(o>0)o++;else if(c())o++;else break;else if(u===Y){if(o===0)break;o--}else if(o===0&&u===oe)break;if(o===0&&bt()&&!c())break;if(!Ne(u))r=e+1;e++}return ye(s,e)}return""}function at(s,o,r,c){e+=8,T();let l=e<w&&f.charCodeAt(e)===Se;if(l)e++,T();let u=Re();if(!u&&!c)return null;T();let p=rt();T();let y=ct();T();let A=kt(),C=A.length>0;if(!A)if(r&&l)A="AsyncGenerator<unknown, void, unknown>";else if(l)A="Generator<unknown, void, unknown>";else if(r)A="Promise<void>";else A="void";T();let x=!1;if(e<w&&f.charCodeAt(e)===L){x=!0;let Z=e+1;if(Be(L,Y),!C&&!l){let q=f.slice(Z,e-1),P=Oi(q,ne??"stdin.ts",()=>{let de;do de=`__dtsx_return_${me++}`;while(f.includes(de));return de},(de)=>j.set(de.name,{...de,start:e,end:e}),p);A=P.finish(B(q,r,y,he,P.resolve))}}else if(e<w&&f.charCodeAt(e)===oe)e++;let O=mt(y),k=`${o?c?"export default function ":"export declare function ":"declare function "}${u||(c?"":"default")}${p}${O}: ${A};`,_=Ze(s),G={kind:"function",name:u||"default",text:k,isExported:o,isDefault:c,isAsync:r,isGenerator:l,returnType:A,generics:p||void 0,leadingComments:_,start:s,end:e};if(x)ee.add(G);return G}let Wt,En=0;function on(){Wt??=new Set(t(f).filter((s)=>s.kind==="word").map((s)=>f.slice(s.start,s.end)));for(;;){let s=`__dtsx_binding_${En++}`;if(Wt.has(s))continue;return Wt.add(s),s}}function ut(s,o,r){e+=o.length,T();let c=[];do{if(T(),e>=w)break;let l=f.charCodeAt(e),u,p=e;if(l===L||l===De)Be(l,l===L?Y:Me),u=f.slice(p,e);let y=u?on():Re();if(!y)return Le(),c;T();let A,C,x,O=!1;if(e<w&&f.charCodeAt(e)===et){e++,T();let Z=e,q=0;while(e<w){if(qe()){if(q===0&&Xt())break;continue}let P=f.charCodeAt(e);if(P===le||P===L||P===De||P===ve)q++;else if(P===Ce||P===Y||P===Me||P===Ie&&!Xe())q--;else if(q===0&&(P===oe||P===nt))break;else if(q===0&&P===Oe&&!Rt())break;if(q===0&&(pt()||Yt()))break;e++}A=ye(Z,e)}if(e<w&&f.charCodeAt(e)===Oe)if(be&&A&&(!J||!jn(A)))vn();else{e++,T();let Z=e;x=Z;let q=0,P=0,de;while(e<w){if(q===0&&P===0&&wn(Z,de))break;if(qe())continue;let se=f.charCodeAt(e);if(se===le||se===L||se===De)q++;else if(se===Ce||se===Y||se===Me)q--;else if(se===ve){pe??=H(f);let Pe=q===0&&P===0?pe(e,Z,de):void 0;if(Pe?.parameters||Pe?.completeOperand||Pe&&ne!==void 0&&!/\.[jt]sx$/.test(ne)){e=Pe.end,de=Pe.completeOperand?Pe.end:void 0;continue}let ht=P>0||f[e+1]!=="/"&&xe(f,e)?Ke(e):null;if(ht){if(P=Math.max(0,P+ht.delta),e=ht.end+1,P===0)de=e;continue}else if(P===0){if(Pe){e=Pe.end,de=Pe.completeOperand?Pe.end:void 0;continue}}}else if(q===0&&P===0&&(se===oe||se===nt))break;e++}if(C=Cn(ye(Z,e)),C.endsWith(" as const")||C==="const"){if(O=!0,!A){let se=C.endsWith(" as const")?C.slice(0,-9).trim():C,Pe=Pt(se);A=Pe!=="unknown"?Pe:void 0}}else if(!A){let se=z(C)??St(C)??he(C);if(se)A=se}}let I=c.length===0?Ze(s):void 0,M=u?"const":o,k=u?!1:r,_=`${k?"export ":""}declare ${M} ${y}: ${A||"unknown"};`,G={kind:"variable",name:y,text:_,isExported:k,typeAnnotation:A,value:C,initializerStart:x,modifiers:O?[M,"const assertion"]:[M],leadingComments:u?void 0:I,start:s,end:e};if(u)c.push(...cr({pattern:u,patternOffset:p,root:G,kind:o,exported:r,comments:I,allocateName:on}));else c.push(G);if(f.charCodeAt(e)===nt){e++;continue}if(f.charCodeAt(e)===oe)e++;break}while(e<w);return c}function Bt(s,o){e+=9,T();let r=Re();T();let c=rt();T();let l="";if(v("extends")){e+=7,T();let C=e,x=0;while(e<w){if(qe())continue;let O=f.charCodeAt(e);if(O===ve)x++;else if(O===Ie&&!Xe())x--;else if(O===L&&x===0)break;e++}l=ye(C,e)}T();let u=e<w&&f.charCodeAt(e)===L?Mt():"{}",p=sn(u),y=`${o?"export ":""}declare interface ${r}${c}${l?` extends ${l}`:""} ${p}`,A=Ze(s);return{kind:"interface",name:r,text:y,isExported:o,extends:l||void 0,generics:c||void 0,leadingComments:A,start:s,end:e}}function Lt(s,o){e+=4,T();let r=Re();T();let c=rt();if(T(),e<w&&f.charCodeAt(e)===Oe)e++;T();let l=e,u=0;while(e<w){if(qe())continue;let C=f.charCodeAt(e);if(C===le||C===L||C===De||C===ve)u++;else if(C===Ce||C===Y||C===Me||C===Ie&&!Xe())u--;else if(u===0&&C===oe)break;if(u===0&&(pt()||Yt()))break;e++}let p=ye(l,e);if(e<w&&f.charCodeAt(e)===oe)e++;let y=`${o?"export ":""}type ${r}${c} = ${p}`,A=Ze(s);return{kind:"type",name:r,text:y,isExported:o,generics:c||void 0,leadingComments:A,start:s,end:e}}function gt(s,o,r){e+=4,T();let c=Re();T();let l=e;if(e<w&&f.charCodeAt(e)===L)Be(L,Y);let u=ye(s,e),p=Ze(s);return{kind:"enum",name:c,text:u,isExported:o,modifiers:r?["const"]:void 0,leadingComments:p,start:s,end:e}}function lt(s,o,r,c=!1){e+=5,T();let l=Re()||"AnonymousClass";T();let u=rt();T();let p="";if(v("extends")){e+=7,T();let I=e,M=0;while(e<w){if(qe())continue;let k=f.charCodeAt(e);if(k===ve)M++;else if(k===Ie&&!Xe())M--;else if(M===0&&(k===L||v("implements")))break;e++}p=ye(I,e)}let y;if(v("implements")){e+=10,T();let I=e,M=0;while(e<w){if(qe())continue;let _=f.charCodeAt(e);if(_===ve)M++;else if(_===Ie&&!Xe())M--;else if(M===0&&_===L)break;e++}let k=ye(I,e);if(k)y=k.split(",").map((_)=>_.trim())}T();let A=zt(l),x=`${o?c?"export default ":"export declare ":"declare "}${r?"abstract ":""}class ${l}${u}${p?` extends ${p}`:""}${y&&y.length>0?` implements ${y.join(", ")}`:""} ${A}`,O=Ze(s);return{kind:"class",name:l,text:x,isExported:o,isDefault:c,extends:p||void 0,implements:y,generics:u||void 0,modifiers:r?["abstract"]:void 0,leadingComments:O,start:s,end:e}}let Nt;function zt(s){if(e>=w||f.charCodeAt(e)!==L)return"{}";e++;let o={name:s,fields:new Map,pending:[],isStatic:!1};ae.push(o);let r=[],c=new Set;while(e<w){if(T(),e>=w)break;if(f.charCodeAt(e)===Y){e++;break}if(f.charCodeAt(e)===oe){e++;continue}if(Nt=Ze(e),v("static")&&Tt("static")===L){e+=6,T(),Be(L,Y);continue}let l=!1,u=!1,p=!1,y=!1,A=!1,C=!1,x=!1,O=!1,I=!0;while(I){T();let q=e,P=Re();if(e=q,P){let de=Tt(P);if(de===le||de===ve||de===It||de===33||de===et||de===Oe||de===oe||de===Y)break}if(v("private")){l=!0,e+=7;continue}if(v("protected")){u=!0,e+=9;continue}if(v("public")){e+=6;continue}if(v("static")){p=!0,e+=6;continue}if(v("abstract")){y=!0,e+=8;continue}if(v("readonly")){A=!0,e+=8;continue}if(v("override")){C=!0,e+=8;continue}if(v("accessor")){x=!0,e+=8;continue}if(v("async")){O=!0,e+=5;continue}if(v("declare")){e+=7;continue}break}if(T(),e>=w||f.charCodeAt(e)===Y)break;let M=e;if(o.isStatic=p,(v("get")||v("set"))&&qt(Tt(f.slice(e,e+3))))e+=3,T();if(f.charCodeAt(e)===Se)e++,T();let k=_t();e=M;let _=k.startsWith("#");if(_)l=!0;if(l&&k&&k!=="constructor"){let q=_?p?" static #private_static;":" #private;":` private ${p?"static ":""}${k};`,de=k[0]==="'"||k[0]==='"'?d(k)??k:k,se=_?`${p?"static":"instance"}#`:`${p?"static:":"instance:"}${de}`;if(!c.has(se))c.add(se),r.push(q)}let G=l?[]:r,Z=" ";if(u)Z+="protected ";if(p)Z+="static ";if(y)Z+="abstract ";if(A)Z+="readonly ";if(v("constructor")){e+=11,T();let q=ct();if(T(),Mn(q,r),e<w&&f.charCodeAt(e)===L)Be(L,Y);else if(e<w&&f.charCodeAt(e)===oe)e++;let P=mt(q);r.push(l?" private constructor();":` ${u?"protected ":""}constructor${P};`)}else if(v("get"))if(e+=3,T(),e<w&&qt(f.charCodeAt(e))){let q=_t();if(q.startsWith("#")){if(T(),e<w&&f.charCodeAt(e)===le)ct();if(T(),kt(),T(),e<w&&f.charCodeAt(e)===L)Be(L,Y);else if(e<w&&f.charCodeAt(e)===oe)e++;continue}T(),ct(),T();let P=kt(),de;if(T(),e<w&&f.charCodeAt(e)===L){let Pe=e+1;if(Be(L,Y),!P&&!be)de=f.slice(Pe,e-1),P=B(de,!1,"()",(ht)=>He(ht,p))}else if(e<w&&f.charCodeAt(e)===oe)e++;let se=G.length;if(G.push(`${Z}get ${q}(): ${de?W(P):P||"unknown"};`),de)o.pending.push(()=>{let Pe=B(de,!1,"()",(ht)=>He(ht,p));G[se]=`${Z}get ${q}(): ${W(Pe)};`})}else an("get",Z,p,A,O,G);else if(v("set"))if(e+=3,T(),e<w&&qt(f.charCodeAt(e))){let q=_t();if(q.startsWith("#")){if(T(),e<w&&f.charCodeAt(e)===le)ct();if(T(),e<w&&f.charCodeAt(e)===L)Be(L,Y);else if(e<w&&f.charCodeAt(e)===oe)e++;continue}T();let P=ct();if(T(),e<w&&f.charCodeAt(e)===L)Be(L,Y);else if(e<w&&f.charCodeAt(e)===oe)e++;let de=mt(P);G.push(`${Z}set ${q}${de};`)}else an("set",Z,p,A,O,G);else{let q=f.charCodeAt(e)===Se;if(q)e++,T();let P=_t();if(!P){cn();continue}ln(P,Z,p,A,q,y,O,G)}}for(let l of o.pending)l();return ae.pop(),`{
31
+ ${r.join(`
32
+ `)}
33
+ }`}function qt(s){return a(s)||s===De||s===pn||s===Ae||s===ke}function _t(){if(e>=w)return"";let s=f.charCodeAt(e);if(s===De){let o=e;return Be(De,Me),f.slice(o,e)}if(s===pn)return e++,`#${Re()}`;if(s===Ae||s===ke){let o=e;return it(s),f.slice(o,e)}return Re()}function Tt(s){let o=e;e+=s.length,T();let r=e<w?f.charCodeAt(e):0;return e=o,r}function cn(){let s=0;while(e<w){if(qe())continue;let o=f.charCodeAt(e);if(o===L||o===le)s++;else if(o===Y||o===Ce){if(s===0)return;s--}else if(o===oe&&s===0){e++;return}if(s===0&&bt())return;e++}}function an(s,o,r,c,l,u){ln(s,o,r,c,!1,!1,l,u)}function ln(s,o,r,c,l,u,p,y){let A=Nt;if(Nt=void 0,T(),e>=w)return;let C=f.charCodeAt(e),x=!1;if(C===It)x=!0,e++,T();if(e<w&&f.charCodeAt(e)===33)e++,T();let O=e<w?f.charCodeAt(e):0;if(O===le||O===ve){let I=O===ve?rt():"";T();let M=ct();T();let k=kt(),_,G=k.length>0;if(!k)if(p&&l)k="AsyncGenerator<unknown, void, unknown>";else if(l)k="Generator<unknown, void, unknown>";else if(p)k="Promise<void>";else k="void";if(T(),e<w&&f.charCodeAt(e)===L){let de=e+1;if(Be(L,Y),!G&&!l)_=f.slice(de,e-1),k=B(_,p,M,(se)=>He(se,r))}else if(e<w&&f.charCodeAt(e)===oe)e++;let Z=mt(M),q=x?"?":"",P=y.length;if(y.push(`${o}${s}${q}${I}${Z}: ${_?W(k):k};`),_)ae.at(-1)?.pending.push(()=>{let de=B(_,p,M,(se)=>He(se,r));y[P]=`${o}${s}${q}${I}${Z}: ${W(de)};`})}else if(O===et||O===Oe||O===oe||O===Y||O===$e||O===Ee){let I="";if(O===et){e++,T();let Z=e,q=0;while(e<w){if(qe())continue;let P=f.charCodeAt(e);if(P===le||P===L||P===De||P===ve)q++;else if(P===Ce||P===Y||P===Me||P===Ie&&!Xe()){if(q===0)break;q--}else if(q===0&&(P===oe||P===nt))break;else if(q===0&&P===Oe&&!Rt())break;if(q===0&&bt())break;e++}I=ye(Z,e)}let M="";if(e<w&&f.charCodeAt(e)===Oe)if(be&&I){e++;let Z=0;while(e<w){if(qe())continue;let q=f.charCodeAt(e);if(q===le||q===L||q===De)Z++;else if(q===Ce||q===Y||q===Me){if(Z===0&&q===Y)break;Z--}else if(Z===0&&q===oe)break;if(Z===0&&bt())break;e++}}else{e++,T();let Z=e,q=0;while(e<w){if(qe())continue;let P=f.charCodeAt(e);if(P===le||P===L||P===De)q++;else if(P===Ce||P===Y||P===Me){if(q===0&&P===Y)break;q--}else if(q===0&&P===oe)break;if(q===0&&bt())break;e++}M=ye(Z,e)}if(e<w&&f.charCodeAt(e)===oe)e++;let k=I.length>0;if(!I)if(M){let Z=St(M);if(Z)I=Z;else if(M.startsWith("new "))I=ge(M);else I=M.endsWith("as const")||r&&c?Pt(M):wt(M)}else I="unknown";let _=x?"?":"";ae.at(-1)?.fields.set(`${r?"static:":""}${s}`,x?`(${I}) | undefined`:I);let G=J&&!k&&M?Kt(A,M,I):"";y.push(`${G}${o}${s}${_}: ${I};`)}else cn()}function Rn(s){let o=0;for(let r=0;r<s.length;r++){let c=s.charCodeAt(r);if(c===le||c===L||c===De||c===ve)o++;else if(c===Ce||c===Y||c===Me||c===Ie&&s.charCodeAt(r-1)!==Oe)o--;else if(c===Oe&&o===0&&s.charCodeAt(r+1)!==Ie&&s.charCodeAt(r+1)!==Oe)return!0}return!1}function Mn(s,o){let r=s.slice(1,-1).trim();if(!r)return;let c=[],l=0,u=0,p=!1,y=0,A=[];for(let C=0;C<=r.length;C++){if(C===r.length){A.push(r.slice(l)),c.push(vt(r.slice(l).trim()));break}let x=r.charCodeAt(C);if(p){if(x===Ye){C++;continue}if(x===y)p=!1;continue}if(x===te&&C+1<r.length){let O=r.charCodeAt(C+1);if(O===Se){C+=2;while(C+1<r.length&&!(r.charCodeAt(C)===Se&&r.charCodeAt(C+1)===te))C++;C++;continue}if(O===te){while(C<r.length&&r.charCodeAt(C)!==10)C++;continue}}if(x===Ae||x===ke||x===We){p=!0,y=x;continue}if(x===le||x===L||x===De||x===ve)u++;else if(x===Ce||x===Y||x===Me||x===Ie&&!(C>0&&r.charCodeAt(C-1)===Oe))u--;else if(x===nt&&u===0)A.push(r.slice(l,C)),c.push(vt(r.slice(l,C).trim())),l=C+1}for(let[C,x]of c.entries()){let O=x.startsWith("public ")||x.startsWith("public\t"),I=x.startsWith("protected ")||x.startsWith("protected\t"),M=x.startsWith("private ")||x.startsWith("private\t"),k=x.includes("readonly ");if(!O&&!I&&!M&&!k)continue;let _=x,G=[];if(M){let se=7;while(se<_.length&&Ne(_.charCodeAt(se)))se++;_=_.slice(se),G.push("private")}if(O){let se=6;while(se<_.length&&Ne(_.charCodeAt(se)))se++;_=_.slice(se),G.push("public")}if(I){let se=9;while(se<_.length&&Ne(_.charCodeAt(se)))se++;_=_.slice(se),G.push("protected")}if(k){let se=_.indexOf("readonly ");if(se!==-1){let Pe=se+8;while(Pe<_.length&&Ne(_.charCodeAt(Pe)))Pe++;_=_.slice(0,se)+_.slice(Pe)}G.push("readonly")}let Z=G.length>0?`${G.join(" ")} `:"",q=rn(_),P=_.search(/[?:=]/);if(P!==-1&&_.charCodeAt(P)!==63&&Rn(_))q=q.replace(/^([\w$]+)\?:/,"$1:");let de="";if(J&&!M&&P!==-1&&_.charCodeAt(P)===Oe){let se=_.slice(P+1);de=Kt(rr(A[C]),se,wt(se))}o.push(M?` private ${q.split(/[?:]/,1)[0]};`:`${de} ${Z}${q};`)}}function Ft(s=" ",o="",r=!1){if(e>=w||f.charCodeAt(e)!==L)return"{}";e++;let c=re.at(-1)?.path,l={path:c?`${c}.${o}`:o,bindings:new Map,exports:new Set,ambient:r||re.at(-1)?.ambient===!0};ie.push(l),re.push(l);let u=[];while(e<w){if(T(),e>=w)break;if(f.charCodeAt(e)===Y){e++;break}if(f.charCodeAt(e)===oe){e++;continue}let p=!1;if(v("export"))p=!0,e+=6,T();let y=!1;if(v("declare"))y=!0,e+=7,T();let A=p?"export ":"";if(v("function")||v("async")&&Pn("async","function")){let C=!1;if(v("async"))C=!0,e+=5,T();if(e+=8,T(),e<w&&f.charCodeAt(e)===Se)e++,T();let O=Re();T();let I=rt();T();let M=ct();T();let k=kt();if(!k)k=C?"Promise<void>":"void";if(T(),e<w&&f.charCodeAt(e)===L)Be(L,Y);else if(e<w&&f.charCodeAt(e)===oe)e++;let _=mt(M);u.push(`${s}${A}function ${O}${I}${_}: ${k};`)}else if(v("const")||v("let")||v("var")){let C=v("const")?"const":v("let")?"let":"var";e+=C.length,T();let x=Re();if(l.bindings.set(x,"value"),p||l.ambient)l.exports.add(x);if(!x){Le(!0);continue}T();let O="";if(e<w&&f.charCodeAt(e)===et){e++,T();let M=e,k=0;while(e<w){if(qe())continue;let _=f.charCodeAt(e);if(_===le||_===L||_===De||_===ve)k++;else if(_===Y&&k===0)break;else if(_===Ce||_===Y||_===Me||_===Ie&&!Xe())k--;else if(k===0&&(_===oe||_===nt))break;else if(k===0&&_===Oe&&!Rt())break;if(k===0&&pt())break;e++}O=ye(M,e)}let I="";if(e<w&&f.charCodeAt(e)===Oe){e++,T();let M=e,k=0;while(e<w){if(qe())continue;let _=f.charCodeAt(e);if(_===le||_===L||_===De||_===ve)k++;else if(_===Y&&k===0)break;else if(_===Ce||_===Y||_===Me||_===Ie&&!Xe())k--;else if(k===0&&(_===oe||_===nt))break;if(k===0&&pt())break;e++}I=ye(M,e)}if(e<w&&f.charCodeAt(e)===oe)e++;if(!O&&I){let M=St(I);if(M)O=M;else if(C==="const")O=Pt(I);else O=wt(I)}if(!O)O="unknown";u.push(`${s}${A}${C} ${x}: ${O};`)}else if(v("interface")){e+=9,T();let C=Re();T();let x=rt();T();let O="";if(v("extends")){e+=7,T();let M=e,k=0;while(e<w){if(qe())continue;let _=f.charCodeAt(e);if(_===ve)k++;else if(_===Ie&&!Xe())k--;else if(_===L&&k===0)break;e++}O=ye(M,e)}let I=sn(Mt());u.push(`${s}${A}interface ${C}${x}${O?` extends ${O}`:""} ${I}`)}else if(v("type")){e+=4,T();let C=Re();T();let x=rt();if(T(),e<w&&f.charCodeAt(e)===Oe){e++,T();let O=e,I=0;while(e<w){if(qe())continue;let k=f.charCodeAt(e);if(k===le||k===L||k===De||k===ve)I++;else if(k===Y&&I===0)break;else if(k===Ce||k===Y||k===Me||k===Ie&&!Xe())I--;else if(I===0&&k===oe)break;if(I===0&&pt())break;e++}let M=ye(O,e);if(e<w&&f.charCodeAt(e)===oe)e++;u.push(`${s}${A}type ${C}${x} = ${M}`)}}else if(v("class")){e+=5,T();let C=Re();T();let x=rt();T();let O=e,I=0;while(e<w){if(qe())continue;let G=f.charCodeAt(e);if(G===ve)I++;else if(G===Ie&&!Xe())I--;else if(G===L&&I===0)break;e++}let M=ye(O,e),k=M?` ${M}`:"";if(l.bindings.set(C,"class"),p||l.ambient)l.exports.add(C);let _=zt(C);u.push(`${s}${A}class ${C}${x}${k} ${_}`)}else if(v("enum")){e+=4,T();let C=Re();T();let x=Mt();u.push(`${s}${A}enum ${C} ${x}`)}else if(v("namespace")||v("module")){let C=v("namespace")?"namespace":"module";e+=C.length,T();let x=Re();if(!l.bindings.has(x))l.bindings.set(x,"namespace");if(p||l.ambient)l.exports.add(x);T();let O=Ft(s,x,y);u.push(`${s}${A}${C} ${x} ${O}`)}else if(v("abstract"))if(e+=8,T(),v("class")){e+=5,T();let C=Re();T();let x=rt();T();let O=e,I=0;while(e<w){if(qe())continue;let G=f.charCodeAt(e);if(G===ve)I++;else if(G===Ie&&!Xe())I--;else if(G===L&&I===0)break;e++}let M=ye(O,e),k=M?` ${M}`:"";if(l.bindings.set(C,"class"),p||l.ambient)l.exports.add(C);let _=zt(C);u.push(`${s}${A}abstract class ${C}${x}${k} ${_}`)}else Le(!0);else if(p&&v("default")){e+=7,T();let C=e;Le(!0);let x=ye(C,e);if(x.charCodeAt(x.length-1)===oe)x=x.slice(0,-1);if(x)u.push(`${s}export default ${x};`)}else if(!p&&(f.charCodeAt(e)===Ae||f.charCodeAt(e)===ke||f.charCodeAt(e)===We))Le(!0);else Le(!0)}if(re.pop(),u.length===0)return"{}";return`{
34
+ ${u.join(`
35
+ `)}
36
+ }`}function Pn(s,o){let r=e+s.length;while(r<w&&Ne(f.charCodeAt(r)))r++;for(let c=0;c<o.length;c++)if(r+c>=w||f.charCodeAt(r+c)!==o.charCodeAt(c))return!1;return r+o.length>=w||!i(f.charCodeAt(r+o.length))}function Ct(s,o,r){e+=r.length,T();let c="",l=f.charCodeAt(e);if(l===Ae||l===ke){let I=e;it(l),c=f.slice(I,e)}else{c=Re();while(e<w&&f.charCodeAt(e)===ot)e++,c+=`.${Re()}`}T();let u=t(f.slice(s,e)),p=u.findIndex((I)=>I.kind==="word"&&["namespace","module"].includes(f.slice(s+I.start,s+I.end))),y=u.slice(0,p).some((I)=>I.kind==="word"&&f.slice(s+I.start,s+I.end)==="declare"),A=e<w&&f.charCodeAt(e)===L?Ft(" ",c,y):"{}",C=`${o?"export ":""}declare ${r} ${c} ${A}`,x=Ze(s),O=c.startsWith("'")||c.startsWith('"');return{kind:"module",name:c,text:C,isExported:o,moduleForm:O?"quoted":r==="namespace"?"namespace":"identifier",source:O?c.slice(1,-1):void 0,leadingComments:x,start:s,end:e}}function fn(s,o){Le();let r=ye(o,e);if(r.charCodeAt(r.length-1)===oe)r=r.slice(0,-1).trimEnd();if(!r)return;let c=a(r.charCodeAt(0));for(let x=1;c&&x<r.length;x++)c=i(r.charCodeAt(x));let l=Ze(s);if(c){N.push({kind:"export",name:"default",text:`export default ${r};`,isExported:!0,isTypeOnly:!1,leadingComments:l,start:s,end:e});return}let u="__dtsx_default_export__",p=1;while(f.includes(u))u=`__dtsx_default_export_${p++}__`;let A=St(r)||he(r)||n(r,!1),C=A==="unknown"&&qn(r)?`typeof ${r}`:A;N.push({kind:"variable",name:u,text:`declare const ${u}: ${C};`,isExported:!1,typeAnnotation:C,modifiers:["const"],start:s,end:e}),N.push({kind:"export",name:"default",text:`export default ${u};`,isExported:!0,isTypeOnly:!1,leadingComments:l,start:s,end:e})}function dn(){if(f.charCodeAt(e)===L)return Be(L,Y),!0;let s=v("if"),o=v("do"),r=v("try"),c=v("for");if(!s&&!o&&!r&&!c&&!v("while")&&!v("switch")&&!v("with"))return!1;if(Re(),T(),c&&v("await"))e+=5,T();if(!o&&!r&&f.charCodeAt(e)===le)Be(le,Ce);if(Dt(),T(),s&&v("else"))e+=4,Dt();else if(o&&v("while")){if(e+=5,T(),f.charCodeAt(e)===le)Be(le,Ce);if(T(),f.charCodeAt(e)===oe)e++}else if(r){if(v("catch")){if(e+=5,T(),f.charCodeAt(e)===le)Be(le,Ce);Dt(),T()}if(v("finally"))e+=7,Dt()}return!0}function Dt(){if(T(),!dn())Le()}while(e<w){if(T(),e>=w)break;if(dn())continue;let s=e,o=f.charCodeAt(e);if(o===105&&v("import"))N.push(Sn(s));else if(o===101&&v("export")){e+=6,T();let r=f.charCodeAt(e);if(r===100&&v("default")){e+=7,T();let c=e,l=f.charCodeAt(e);if(l===102&&v("function")){let u=at(s,!0,!1,!0);if(u)N.push(u)}else if(l===97&&v("async")&&Tt("async")!==oe)if(e+=5,T(),v("function")){let u=at(s,!0,!0,!0);if(u)N.push(u)}else fn(s,c);else if(l===99&&v("class")){let u=lt(s,!0,!1,!0);N.push(u)}else if(l===97&&v("abstract")){if(e+=8,T(),v("class")){let u=lt(s,!0,!0,!0);N.push(u)}}else fn(s,c)}else if(r===116&&v("type")){let c=e;if(e+=4,T(),e<w&&f.charCodeAt(e)===L){en();let l=ye(s,e),u=Ze(s);N.push({kind:"export",name:"",text:l,isExported:!0,isTypeOnly:!0,source:yt(l),leadingComments:u,start:s,end:e})}else if(e<w&&f.charCodeAt(e)===Se){tn();let l=ye(s,e);N.push({kind:"export",name:"",text:l,isExported:!0,isTypeOnly:!0,source:yt(l),start:s,end:e})}else{e=c;let l=Lt(s,!0);N.push(l)}}else if(r===105&&v("interface")){let c=Bt(s,!0);N.push(c)}else if(r===102&&v("function")){let c=at(s,!0,!1,!1);if(c)N.push(c)}else if(r===97&&v("async"))if(e+=5,T(),v("function")){let c=at(s,!0,!0,!1);if(c)N.push(c)}else Le();else if(r===99)if(v("class")){let c=lt(s,!0,!1);N.push(c)}else if(v("const")){let c=e;if(e+=5,T(),v("enum")){e=c+5,T();let l=gt(s,!0,!0);N.push(l)}else{e=c;let l=ut(s,"const",!0);for(let u=0;u<l.length;u++)N.push(l[u])}}else Le();else if(r===97&&v("abstract")){if(e+=8,T(),v("class")){let c=lt(s,!0,!0);N.push(c)}}else if(r===108&&v("let")){let c=ut(s,"let",!0);for(let l=0;l<c.length;l++)N.push(c[l])}else if(r===118&&v("var")){let c=ut(s,"var",!0);for(let l=0;l<c.length;l++)N.push(c[l])}else if(r===101&&v("enum")){let c=gt(s,!0,!1);N.push(c)}else if(r===100&&v("declare"))e+=7,T(),hn(s,!0);else if(r===110&&v("namespace")&&xt(9)){let c=Ct(s,!0,"namespace");N.push(c)}else if(r===109&&v("module")&&xt(6)){let c=Ct(s,!0,"module");N.push(c)}else if(r===L){en();let c=ye(s,e),l=c.includes("export type"),u=Ze(s);N.push({kind:"export",name:"",text:c,isExported:!0,isTypeOnly:l,source:yt(c),leadingComments:u,start:s,end:e})}else if(r===Se){tn();let c=ye(s,e),l=Ze(s);N.push({kind:"export",name:"",text:c,isExported:!0,isTypeOnly:!1,source:yt(c),leadingComments:l,start:s,end:e})}else{Le();let c=ye(s,e);if(c)N.push({kind:"export",name:"",text:c,isExported:!0,start:s,end:e})}}else if(o===100&&v("declare"))e+=7,T(),hn(s,!1);else if(o===105&&v("interface")){let r=Bt(s,!1);j.set(r.name,r)}else if(o===116&&v("type")){let r=Lt(s,!1);j.set(r.name,r),N.push(r)}else if(o===102&&v("function")){let r=at(s,!1,!1,!1);if(r)ft(r);else Le()}else if(o===97)if(v("async")){let r=e;if(e+=5,T(),v("function")){let c=at(s,!1,!0,!1);if(c)ft(c);else e=r,Le()}else e=r,Le()}else if(v("abstract"))if(e+=8,T(),v("class")){let r=lt(s,!1,!1);j.set(r.name,r),N.push(r)}else Le();else e++,Le();else if(o===99)if(v("class")){let r=lt(s,!1,!1);j.set(r.name,r),N.push(r)}else if(v("const")){let r=e;if(e+=5,T(),v("enum")){e=r+5,T();let c=gt(s,!1,!0);j.set(c.name,c),N.push(c)}else{e=r;let c=ut(s,"const",!1);for(let l=0;l<c.length;l++)j.set(c[l].name,c[l])}}else e++,Le();else if(o===101&&v("enum")){let r=gt(s,!1,!1);j.set(r.name,r),N.push(r)}else if(o===108&&v("let")||o===118&&v("var")){let r=v("let")?"let":"var",c=ut(s,r,!1);for(let l=0;l<c.length;l++)j.set(c[l].name,c[l])}else if(o===109&&v("module")&&xt(6)){let r=Ct(s,!1,"module");N.push(r)}else if(o===110&&v("namespace")&&xt(9)){let r=Ct(s,!1,"namespace");N.push(r)}else{let r=f.charCodeAt(e);if(r===oe)e++;else if(r===Ae||r===ke){if(it(r),e<w&&f.charCodeAt(e)===oe)e++}else if(r===We){if(At(),e<w&&f.charCodeAt(e)===oe)e++}else if(r===Ln){if(e++,Re(),T(),e<w&&f.charCodeAt(e)===ot)e++,Re(),T();if(e<w&&f.charCodeAt(e)===le)Be(le,Ce)}else e++,Le()}}if(Te.length){let s=new Set([...N,...j.values()]),o=new Set([...s].filter((u)=>u.kind==="class").map((u)=>u.name)),r=new Map;for(let u of ie)for(let[p,y]of u.bindings){let A=u.path?`${u.path}.${p}`:p;if(u.exports.has(p)&&(y!=="namespace"||!r.has(A)))r.set(A,y)}let c=new Map;for(let u of Te)c.set(u.marker,Ht(u.initializer,(p)=>{if(u.classes.includes(p))return!0;for(let y=u.namespaces.length-1;y>=0;y--){let A=u.namespaces[y],C=A.path?`${A.path}.${p}`:p,x=p.split(".")[0],O=A.bindings.get(x);if(O){if(p===x&&O!=="namespace")return O==="class";return r.get(C)==="class"}let I=A.path?`${A.path}.${x}`:x;if(r.has(I))return r.get(C)==="class"}return r.has(p)?r.get(p)==="class":o.has(p)}));let l=(u)=>{if(!u.includes("__dtsx_constructor_field_"))return u;let p="",y=0;for(let A of t(u)){if(A.kind!=="word")continue;let C=c.get(u.slice(A.start,A.end));if(!C)continue;p+=u.slice(y,A.start)+C,y=A.end}return p+u.slice(y)};for(let u of s){u.text=l(u.text);for(let p of["typeAnnotation","inferredType","returnType"])if(u[p])u[p]=l(u[p])}}if(ee.size>0){un(N);for(let s of ce.values())un(s)}if(zn(f,N,j,ce),Hn(N,j),ir(N,j),!be)Jn(f,N,j,fe);if(ue){let s=new Set(N);for(let o of[...j.values(),...[...ce.values()].flat()])if(!s.has(o))N.push(o),s.add(o);return N.sort((o,r)=>(o.start??0)-(r.start??0))}if(j.size>0)Fn(N,j,ce,tt);return N;function un(s){let o=new Map;for(let c of s)if(c.kind==="function")o.set(c.name,(o.get(c.name)||0)+1);let r=new Set;for(let[c,l]of o)if(l>1)r.add(c);if(r.size>0){let c=new Set;for(let l of r)for(let u=s.length-1;u>=0;u--)if(s[u].kind==="function"&&s[u].name===l&&ee.has(s[u])){c.add(u);break}if(c.size>0){let l=[...c].sort((u,p)=>p-u);for(let u of l)s.splice(u,1)}}}function hn(s,o){if(v("function")){let r=at(s,o,!1,!1);if(r)N.push(r)}else if(v("async")){if(e+=5,T(),v("function")){let r=at(s,o,!0,!1);if(r)N.push(r)}}else if(v("class")){let r=lt(s,o,!1);N.push(r)}else if(v("abstract")){if(e+=8,T(),v("class")){let r=lt(s,o,!0);N.push(r)}}else if(v("interface")){let r=Bt(s,o);N.push(r)}else if(v("type")){let r=Lt(s,o);N.push(r)}else if(v("enum")){let r=gt(s,o,!1);N.push(r)}else if(v("const")){let r=e;if(e+=5,T(),v("enum")){e=r+5,T();let c=gt(s,o,!0);N.push(c)}else{e=r;let c=ut(s,"const",o);for(let l=0;l<c.length;l++)if(o||!tt)N.push(c[l]);else j.set(c[l].name,c[l])}}else if(v("let")||v("var")){let r=v("let")?"let":"var",c=ut(s,r,o);for(let l=0;l<c.length;l++)if(o||!tt)N.push(c[l]);else j.set(c[l].name,c[l])}else if(v("module")){let r=Ct(s,o,"module");N.push(r)}else if(v("namespace")){let r=Ct(s,o,"namespace");N.push(r)}else if(v("global")){e+=6,T();let c=`declare global ${e<w&&f.charCodeAt(e)===L?Ft(" ","",!0):"{}"}`,l=Ze(s);N.push({kind:"module",name:"global",text:c,isExported:!1,moduleForm:"global",leadingComments:l,start:s,end:e})}else Le()}}class gn{names;lengths=new Uint8Array(65);firstUnits=new Uint8Array(65536);size;constructor(E){this.names=E;for(let ne of E.keys()){if(!ne)continue;this.lengths[Math.min(ne.length,64)]=1,this.firstUnits[ne.charCodeAt(0)]=1}this.size=E.size}scan(E,ne){if(this.size===0)return!1;let Q=!1,X=0,ue=E.length;while(X<ue){let fe=E.charCodeAt(X);if(fe>=65&&fe<=90||fe>=97&&fe<=122||fe===95||fe===36||fe>127){let f=X;X++;while(X<ue){let J=E.charCodeAt(X);if(J>=65&&J<=90||J>=97&&J<=122||J>=48&&J<=57||J===95||J===36||J>127)X++;else break}if(this.firstUnits[fe]===1&&this.lengths[Math.min(X-f,64)]===1){let J=E.substring(f,X),be=this.names.get(J);if(be!==void 0){if(ne.add(J),be.kind==="function"||be.kind==="variable")Q=!0}}}else X++}return Q}}function mn(E,ne){let Q=0;while(Q<E.length){let X=E.charCodeAt(Q);if(X===Ae||X===ke||X===We){let Ke=X;Q++;while(Q<E.length)if(E.charCodeAt(Q)===Ye)Q+=2;else if(E.charCodeAt(Q++)===Ke)break;continue}if(X===te&&E.charCodeAt(Q+1)===te){Q+=2;while(Q<E.length&&E.charCodeAt(Q)!==$e&&E.charCodeAt(Q)!==Ee)Q++;continue}if(X===te&&E.charCodeAt(Q+1)===Se){let Ke=E.indexOf("*/",Q+2);Q=Ke===-1?E.length:Ke+2;continue}if(!a(X)){Q++;continue}let ue=Q++;while(Q<E.length&&i(E.charCodeAt(Q)))Q++;let fe=ue-1,f=Q;while(fe>=0&&Ne(E.charCodeAt(fe)))fe--;while(f<E.length&&Ne(E.charCodeAt(f)))f++;let J=fe>=0?E.charCodeAt(fe):0,be=f<E.length?E.charCodeAt(f):0,w=ue>=3&&E.slice(ue-3,ue)==="...";if(be===et||J===ot&&!w)continue;if(be===le&&(J===L||J===nt))continue;ne.add(E.slice(ue,Q))}}function Fn(E,ne,Q,X){let ue=new Map;if(X){let j=0;for(let ce of E)if(ce.kind==="class"&&!ce.isExported){if(ue.set(ce.name,ce),!ne.has(ce.name))ne.set(ce.name,ce)}else E[j++]=ce;E.length=j}let fe=new Set(E),f=new Set,J=new Set;for(let j of E)J.add(j.name);let be=new gn(ne),w=new Set,Ke=new Set,tt=(j)=>{if(be.scan(j.text,w))nr(j,Ke)},N=new Set;for(let j=0;j<E.length;j++){let ce=E[j];if(ce.kind!=="import"){if(tt(ce),typeof ce.value==="string")mn(ce.value,N)}}for(;;){let j=[];for(let[e,pe]of ne){if(f.has(e))continue;if((pe.kind==="function"||pe.kind==="variable"?Ke:w).has(e)||pe.kind!=="function"&&N.has(e)){let ae=ue.get(e);if(ae){for(let ie of[ae,pe])if(!fe.has(ie))j.push(ie),fe.add(ie);J.add(e)}else if(!J.has(e)){let ie=pe.kind==="function"?Q.get(e):void 0;if(ie)for(let re of ie)j.push(re);else j.push(pe);J.add(e)}f.add(e)}}if(j.length===0)break;j.sort((e,pe)=>(e.start??1/0)-(pe.start??1/0));let ce=[],ee=0;for(let e=0;e<E.length;e++){let pe=E[e].start??1/0;while(ee<j.length&&(j[ee].start??1/0)<=pe)ce.push(j[ee++]);ce.push(E[e])}while(ee<j.length)ce.push(j[ee++]);E.length=0;for(let e=0;e<ce.length;e++)E.push(ce[e]);for(let e of j)if(e.kind!=="import"){if(tt(e),typeof e.value==="string")mn(e.value,N)}}}
37
+ export{Oi,Ba,D,F,jt};
@@ -1,7 +1,7 @@
1
1
  // @bun
2
- import{Dt,Pt,a,Pe,tt,Rt,Mt,nt,rt,it,Ot,st,It,Lt}from"./chunk-mjzee617.js";function D(t){return t.endsWith(".stx")}function h(t){let n=[],s=/<script\b([^>]*)>([\s\S]*?)<\/script\s*>/gi,o;while((o=s.exec(t))!==null){let r=o[1]??"",i=/\blang\s*=\s*["']([^"']+)["']/i.exec(r)?.[1]?.toLowerCase()??(/\b(?:type\s*=\s*["'](?:text\/)?typescript["']|typescript)\b/i.test(r)?"ts":"js"),e=/\bserver\b/i.test(r)?"server":/\bclient\b/i.test(r)?"client":"universal";n.push({content:o[2]??"",kind:"script",attrs:r,context:e,lang:i,start:o.index})}return n}function y(t){let n=[],s=/^[ \t]*@ts[ \t]*(?:\r?\n|$)/gm,o;while((o=s.exec(t))!==null){let r=s.lastIndex,i=/^[ \t]*@endts[ \t]*(?:\r?\n|$)/gm;i.lastIndex=r;let e=i.exec(t),l=e?.index??t.length;if(n.push({content:t.slice(r,l),kind:"ts",attrs:"",context:"universal",lang:"ts",start:o.index}),!e)break;s.lastIndex=i.lastIndex}return n}function ga(t){return[...h(t),...y(t)].sort((n,s)=>n.start-s.start)}function k(t){if(t.kind==="ts"||t.context!=="universal"||t.lang==="ts")return!0;return/\b(?:defineProps|defineEmits|defineExpose|defineSlots)\b|\bexport\s|\b(?:interface|type)\s+[A-Za-z_$]/.test(t.content)}function _(t){let n=/(?:\$?props)\s+as\s+/g,s;while((s=n.exec(t))!==null){let o=n.lastIndex;while(o<t.length&&/\s/.test(t[o]))o++;if(t[o]==="{"){let e=a(t,o,"{","}");if(e!==-1)return t.slice(o,e+1).trim();continue}let r=/^[A-Za-z_$][\w$]*/.exec(t.slice(o))?.[0];if(!r)continue;let i=o+r.length;while(i<t.length&&/\s/.test(t[i]))i++;if(t[i]==="<"){let e=a(t,i,"<",">");if(e!==-1)i=e+1}return t.slice(o,i).trim()}return null}function w(t){return/\b(?:const|let|var)\s+\$?props\s*:\s*([^=;\n]+)/.exec(t)?.[1]?.trim()??null}function T(t){let n=/^\s*(?:\|\||\?\?)\s*([^;\n]+)/.exec(t)?.[1]?.trim();if(/^['"`]/.test(n??""))return"string";if(/^(?:true|false)\b/.test(n??""))return"boolean";if(/^[+-]?(?:\d+(?:\.\d+)?|\.\d+)\b/.test(n??""))return"number";if(/^\[/.test(n??""))return"unknown[]";if(/^\{/.test(n??""))return"Record<string, unknown>";if(/^\s*(?:===?|!==?)\s*(?:true|false)\b/.test(t))return"boolean";return"unknown"}function E(t,n){if(!t||t==="unknown")return n;if(n==="unknown"||t===n)return t;return[...new Set([...t.split(" | "),...n.split(" | ")])].join(" | ")}function v(t){let n=Pt(t),s=new Map,o=/\$props(?:\.([A-Za-z_$][\w$]*)|\[\s*(['"])([^'"\n]+)\2\s*\])/g,r;while((r=o.exec(t))!==null){if(n.slice(r.index,r.index+6)!=="$props")continue;let e=r[1]??r[3],l=T(t.slice(o.lastIndex));s.set(e,E(s.get(e),l))}if(s.size===0)return null;return{type:`{ ${[...s].map(([e,l])=>`${/^[A-Za-z_$][\w$]*$/.test(e)?e:JSON.stringify(e)}?: ${l}`).join(", ")} }`}}function A(t){let n=st(t,null);if(n)return n;let s=_(t)??w(t);if(!s)return v(t);if(/^[A-Za-z_$][\w$]*$/.test(s)){let o=s.replace(/[$]/g,"\\$&");if(new RegExp(`\\bexport\\s+(?:declare\\s+)?(?:interface|type)\\s+${o}\\b`).test(t))return{type:s}}return st(`${t}
3
- defineProps<${s}>()`,null)}function C(t){return Rt(t)}function S(t){let n=Pt(t).trimStart();if(n==="")return!0;return/^(?:import\b|export\b|declare\b|interface\b|type\b|(?:export\s+)?namespace\b|(?:export\s+)?module\b|(?:abstract\s+)?class\b|const\b|let\b|var\b|(?:async\s+)?function\b)/.test(n)}function R(t){let n=[],s=0,o=0,r=0;while(r<t.length){let e=t[r],l=Dt(t,r);if(l>r){r=l;continue}if(e==="{"||e==="["||e==="(")o++;else if(e==="}"||e==="]"||e===")")o=Math.max(0,o-1);if((e===";"||e===`
4
- `)&&o===0){let c=r+1;if(!S(t.slice(s,c)))n.push([s,c]);s=c}r++}if(s<t.length&&!S(t.slice(s)))n.push([s,t.length]);let i=t;for(let e=n.length-1;e>=0;e--)i=i.slice(0,n[e][0])+i.slice(n[e][1]);return i}function P(t){let s=ga(t).filter(k).map((f)=>f.content).join(`
5
- `),o=null,r=Mt(s);if(r.passthrough)return s;if(s=r.script,r.options){let f=nt(r.options,"props");if(f)o=tt(f)}let i=s,e=C(s),l=A(i),c=l?.type??o??"{}",m=It(i,null),d=Lt(i,null),g=Pe(i,"defineSlots")?.generic??null,x=l?.inlinedLocal;if(x)e=it(e,x.name,x.declText);let p=`DefineComponent<${c}>`,u=[];if(m)u.push(`readonly __stxEmits?: ${m}`);if(g)u.push(`readonly __stxSlots?: ${g}`);if(d)u.push(`readonly __stxExposed?: ${d}`);if(u.length>0)p+=` & { ${u.join(", ")} }`;p=Ot(p),e=R(rt(e,p));let b=["import type { DefineComponent } from '@stacksjs/stx'",`type __DtsxStxComponentType = ${p}`,"const __dtsx_component__: __DtsxStxComponentType = null as unknown as __DtsxStxComponentType","export default __dtsx_component__"];if(e.trim()!=="")b.push(e);return b.join(`
2
+ import{Ot,It,c,Ne,ot,Lt,Nt,at,ct,lt,Ft,ut,Bt,Wt}from"./chunk-8gksa73c.js";function O(t){return t.endsWith(".stx")}function h(t){let n=[],s=/<script\b([^>]*)>([\s\S]*?)<\/script\s*>/gi,o;while((o=s.exec(t))!==null){let r=o[1]??"",i=/\blang\s*=\s*["']([^"']+)["']/i.exec(r)?.[1]?.toLowerCase()??(/\b(?:type\s*=\s*["'](?:text\/)?typescript["']|typescript)\b/i.test(r)?"ts":"js"),e=/\bserver\b/i.test(r)?"server":/\bclient\b/i.test(r)?"client":"universal";n.push({content:o[2]??"",kind:"script",attrs:r,context:e,lang:i,start:o.index})}return n}function y(t){let n=[],s=/^[ \t]*@ts[ \t]*(?:\r?\n|$)/gm,o;while((o=s.exec(t))!==null){let r=s.lastIndex,i=/^[ \t]*@endts[ \t]*(?:\r?\n|$)/gm;i.lastIndex=r;let e=i.exec(t),l=e?.index??t.length;if(n.push({content:t.slice(r,l),kind:"ts",attrs:"",context:"universal",lang:"ts",start:o.index}),!e)break;s.lastIndex=i.lastIndex}return n}function xa(t){return[...h(t),...y(t)].sort((n,s)=>n.start-s.start)}function k(t){if(t.kind==="ts"||t.context!=="universal"||t.lang==="ts")return!0;return/\b(?:defineProps|defineEmits|defineExpose|defineSlots)\b|\bexport\s|\b(?:interface|type)\s+[A-Za-z_$]/.test(t.content)}function _(t){let n=/(?:\$?props)\s+as\s+/g,s;while((s=n.exec(t))!==null){let o=n.lastIndex;while(o<t.length&&/\s/.test(t[o]))o++;if(t[o]==="{"){let e=c(t,o,"{","}");if(e!==-1)return t.slice(o,e+1).trim();continue}let r=/^[A-Za-z_$][\w$]*/.exec(t.slice(o))?.[0];if(!r)continue;let i=o+r.length;while(i<t.length&&/\s/.test(t[i]))i++;if(t[i]==="<"){let e=c(t,i,"<",">");if(e!==-1)i=e+1}return t.slice(o,i).trim()}return null}function w(t){return/\b(?:const|let|var)\s+\$?props\s*:\s*([^=;\n]+)/.exec(t)?.[1]?.trim()??null}function T(t){let n=/^\s*(?:\|\||\?\?)\s*([^;\n]+)/.exec(t)?.[1]?.trim();if(/^['"`]/.test(n??""))return"string";if(/^(?:true|false)\b/.test(n??""))return"boolean";if(/^[+-]?(?:\d+(?:\.\d+)?|\.\d+)\b/.test(n??""))return"number";if(/^\[/.test(n??""))return"unknown[]";if(/^\{/.test(n??""))return"Record<string, unknown>";if(/^\s*(?:===?|!==?)\s*(?:true|false)\b/.test(t))return"boolean";return"unknown"}function E(t,n){if(!t||t==="unknown")return n;if(n==="unknown"||t===n)return t;return[...new Set([...t.split(" | "),...n.split(" | ")])].join(" | ")}function P(t){let n=It(t),s=new Map,o=/\$props(?:\.([A-Za-z_$][\w$]*)|\[\s*(['"])([^'"\n]+)\2\s*\])/g,r;while((r=o.exec(t))!==null){if(n.slice(r.index,r.index+6)!=="$props")continue;let e=r[1]??r[3],l=T(t.slice(o.lastIndex));s.set(e,E(s.get(e),l))}if(s.size===0)return null;return{type:`{ ${[...s].map(([e,l])=>`${/^[A-Za-z_$][\w$]*$/.test(e)?e:JSON.stringify(e)}?: ${l}`).join(", ")} }`}}function v(t){let n=ut(t,null);if(n)return n;let s=_(t)??w(t);if(!s)return P(t);if(/^[A-Za-z_$][\w$]*$/.test(s)){let o=s.replace(/[$]/g,"\\$&");if(new RegExp(`\\bexport\\s+(?:declare\\s+)?(?:interface|type)\\s+${o}\\b`).test(t))return{type:s}}return ut(`${t}
3
+ defineProps<${s}>()`,null)}function A(t){return Lt(t)}function S(t){let n=It(t).trimStart();if(n==="")return!0;return/^(?:import\b|export\b|declare\b|interface\b|type\b|(?:export\s+)?namespace\b|(?:export\s+)?module\b|(?:abstract\s+)?class\b|const\b|let\b|var\b|(?:async\s+)?function\b)/.test(n)}function C(t){let n=[],s=0,o=0,r=0;while(r<t.length){let e=t[r],l=Ot(t,r);if(l>r){r=l;continue}if(e==="{"||e==="["||e==="(")o++;else if(e==="}"||e==="]"||e===")")o=Math.max(0,o-1);if((e===";"||e===`
4
+ `)&&o===0){let a=r+1;if(!S(t.slice(s,a)))n.push([s,a]);s=a}r++}if(s<t.length&&!S(t.slice(s)))n.push([s,t.length]);let i=t;for(let e=n.length-1;e>=0;e--)i=i.slice(0,n[e][0])+i.slice(n[e][1]);return i}function I(t){let s=xa(t).filter(k).map((f)=>f.content).join(`
5
+ `),o=null,r=Nt(s);if(r.passthrough)return s;if(s=r.script,r.options){let f=at(r.options,"props");if(f)o=ot(f)}let i=s,e=A(s),l=v(i),a=l?.type??o??"{}",m=Bt(i,null),d=Wt(i,null),g=Ne(i,"defineSlots")?.generic??null,x=l?.inlinedLocal;if(x)e=lt(e,x.name,x.declText);let p=`DefineComponent<${a}>`,u=[];if(m)u.push(`readonly __stxEmits?: ${m}`);if(g)u.push(`readonly __stxSlots?: ${g}`);if(d)u.push(`readonly __stxExposed?: ${d}`);if(u.length>0)p+=` & { ${u.join(", ")} }`;p=Ft(p),e=C(ct(e,p));let b=["import type { DefineComponent } from '@stacksjs/stx'",`type __DtsxStxComponentType = ${p}`,"const __dtsx_component__: __DtsxStxComponentType = null as unknown as __DtsxStxComponentType","export default __dtsx_component__"];if(e.trim()!=="")b.push(e);return b.join(`
6
6
  `)}
7
- export{D,ga,P};
7
+ export{O,xa,I};
@@ -1,6 +1,6 @@
1
1
  // @bun
2
- import{e,A}from"./chunk-9hjd6p38.js";import{Ae}from"./chunk-xgf6djk3.js";import{s}from"./chunk-ykrdzatr.js";import{existsSync as u,readFileSync as w}from"fs";import{dirname as W,join as d,resolve as v}from"path";async function Jr(i){let c=[],n=new Set;async function t(a,f){let o=v(a);if(n.has(o))return;if(n.add(o),!u(o)){e.warn(`tsconfig not found: ${o}`);return}try{let p=w(o,"utf-8"),r=JSON.parse(Ae(p)),l=W(o),g=P(l,f),m=[];if(r.references)for(let y of r.references){let h=v(l,y.path),C=u(d(h,"tsconfig.json"))?d(h,"tsconfig.json"):h;await t(C,g);let G=P(W(C),g);m.push(G)}let j="./src";if(r.compilerOptions?.rootDir)j=r.compilerOptions.rootDir;else if(r.include&&r.include.length>0){if(r.include[0].startsWith("src/"))j="./src"}let k="./dist";if(r.compilerOptions?.outDir)k=r.compilerOptions.outDir;else if(r.compilerOptions?.declarationDir)k=r.compilerOptions.declarationDir;c.push({name:g,root:l,tsconfigPath:o,references:m,config:{root:j,outdir:k}})}catch(p){let r=p instanceof Error?p.message:String(p);e.warn(`Failed to parse ${o}: ${r}`)}}return await t(i),c}function P(i,c){let n=d(i,"package.json");if(u(n))try{let a=w(n,"utf-8"),f=JSON.parse(a);if(f.name)return f.name}catch{}let t=i.split("/").pop()||"unknown";return c?`${c}/${t}`:t}function Yr(i){let c=new Map(i.map((o)=>[o.name,o])),n=[],t=new Set,a=new Set;function f(o){if(t.has(o))return;if(a.has(o)){e.warn(`Circular dependency detected involving: ${o}`);return}a.add(o);let p=c.get(o);if(p){for(let r of p.references)f(r);n.push(p)}a.delete(o),t.add(o)}for(let o of i)f(o.name);return n}async function dn(i){let c=Date.now(),n=Yr(i.projects);e.info(`Generating declarations for ${n.length} projects...`);let t=[],a=!0;for(let r of n){e.info(`
2
+ import{e,M}from"./chunk-qmg1535a.js";import{Ie}from"./chunk-g9emajpc.js";import{s}from"./chunk-ehpz5rg3.js";import{existsSync as u,readFileSync as w}from"fs";import{dirname as W,join as d,resolve as v}from"path";async function ei(i){let c=[],n=new Set;async function t(a,f){let o=v(a);if(n.has(o))return;if(n.add(o),!u(o)){e.warn(`tsconfig not found: ${o}`);return}try{let p=w(o,"utf-8"),r=JSON.parse(Ie(p)),l=W(o),g=P(l,f),m=[];if(r.references)for(let y of r.references){let h=v(l,y.path),C=u(d(h,"tsconfig.json"))?d(h,"tsconfig.json"):h;await t(C,g);let G=P(W(C),g);m.push(G)}let j="./src";if(r.compilerOptions?.rootDir)j=r.compilerOptions.rootDir;else if(r.include&&r.include.length>0){if(r.include[0].startsWith("src/"))j="./src"}let k="./dist";if(r.compilerOptions?.outDir)k=r.compilerOptions.outDir;else if(r.compilerOptions?.declarationDir)k=r.compilerOptions.declarationDir;c.push({name:g,root:l,tsconfigPath:o,references:m,config:{root:j,outdir:k}})}catch(p){let r=p instanceof Error?p.message:String(p);e.warn(`Failed to parse ${o}: ${r}`)}}return await t(i),c}function P(i,c){let n=d(i,"package.json");if(u(n))try{let a=w(n,"utf-8"),f=JSON.parse(a);if(f.name)return f.name}catch{}let t=i.split("/").pop()||"unknown";return c?`${c}/${t}`:t}function ti(i){let c=new Map(i.map((o)=>[o.name,o])),n=[],t=new Set,a=new Set;function f(o){if(t.has(o))return;if(a.has(o)){e.warn(`Circular dependency detected involving: ${o}`);return}a.add(o);let p=c.get(o);if(p){for(let r of p.references)f(r);n.push(p)}a.delete(o),t.add(o)}for(let o of i)f(o.name);return n}async function yn(i){let c=Date.now(),n=ti(i.projects);e.info(`Generating declarations for ${n.length} projects...`);let t=[],a=!0;for(let r of n){e.info(`
3
3
  [${r.name}] Generating...`);try{let l={...i.sharedConfig,...r.config,cwd:r.root,tsconfigPath:r.tsconfigPath},g=await s(l),m=g.filesFailed===0;if(!m)a=!1;t.push({name:r.name,stats:g,success:m}),e.info(`[${r.name}] Generated ${g.filesGenerated} files`)}catch(l){a=!1;let g=l instanceof Error?l.message:String(l);t.push({name:r.name,stats:{generationMode:r.config?.isolatedDeclarations||i.sharedConfig?.isolatedDeclarations?"isolated":"semantic",filesProcessed:0,filesGenerated:0,filesFailed:0,filesValidated:0,validationErrors:0,declarationsFound:0,importsProcessed:0,exportsProcessed:0,durationMs:0,errors:[]},success:!1,error:g}),e.error(`[${r.name}] Failed: ${g}`)}}let f=Date.now()-c,o=t.filter((r)=>r.success).length,p=t.length-o;if(e.info(`
4
4
  --- Workspace Generation Summary ---`),e.info(`Projects processed: ${t.length}`),e.info(`Successful: ${o}`),p>0)e.info(`Failed: ${p}`);return e.info(`Total duration: ${f}ms`),e.info(`------------------------------------
5
- `),{success:a,projects:t,durationMs:f}}async function io(i,c){if(c?.logLevel)A(c.logLevel);let n=d(i,"tsconfig.json");if(!u(n))throw Error(`Root tsconfig.json not found at: ${n}`);e.info("Discovering workspace projects...");let t=await Jr(n);if(t.length===0)return e.warn("No projects found in workspace"),{success:!0,projects:[],durationMs:0};return e.info(`Found ${t.length} projects`),dn({root:i,projects:t,sharedConfig:c})}async function Xr(i){let c=d(i,"package.json");if(!u(c))return[];try{let n=w(c,"utf-8"),t=JSON.parse(n),a=[];if(Array.isArray(t.workspaces))a=t.workspaces;else if(t.workspaces?.packages)a=t.workspaces.packages;return a}catch{return[]}}async function Zr(i,c){let{Glob:n}=await Promise.resolve(globalThis.Bun),t=[];for(let a of c){let f=new n(a);for await(let o of f.scan({cwd:i,absolute:!0,onlyFiles:!1})){let p=d(o,"package.json");if(u(p))t.push(o)}}return t}async function so(i,c){if(c?.logLevel)A(c.logLevel);let n=await Xr(i);if(n.length===0)return e.warn("No workspace patterns found in package.json"),{success:!0,projects:[],durationMs:0};e.info(`Found workspace patterns: ${n.join(", ")}`);let t=await Zr(i,n);if(t.length===0)return e.warn("No projects found matching workspace patterns"),{success:!0,projects:[],durationMs:0};e.info(`Found ${t.length} workspace packages`);let a=t.map((f)=>{let o=d(f,"tsconfig.json");return{name:P(f),root:f,tsconfigPath:u(o)?o:"",references:[]}});return dn({root:i,projects:a,sharedConfig:c})}
6
- export{Jr,Yr,dn,io,Xr,Zr,so};
5
+ `),{success:a,projects:t,durationMs:f}}async function lo(i,c){if(c?.logLevel)M(c.logLevel);let n=d(i,"tsconfig.json");if(!u(n))throw Error(`Root tsconfig.json not found at: ${n}`);e.info("Discovering workspace projects...");let t=await ei(n);if(t.length===0)return e.warn("No projects found in workspace"),{success:!0,projects:[],durationMs:0};return e.info(`Found ${t.length} projects`),yn({root:i,projects:t,sharedConfig:c})}async function ni(i){let c=d(i,"package.json");if(!u(c))return[];try{let n=w(c,"utf-8"),t=JSON.parse(n),a=[];if(Array.isArray(t.workspaces))a=t.workspaces;else if(t.workspaces?.packages)a=t.workspaces.packages;return a}catch{return[]}}async function ri(i,c){let{Glob:n}=await Promise.resolve(globalThis.Bun),t=[];for(let a of c){let f=new n(a);for await(let o of f.scan({cwd:i,absolute:!0,onlyFiles:!1})){let p=d(o,"package.json");if(u(p))t.push(o)}}return t}async function uo(i,c){if(c?.logLevel)M(c.logLevel);let n=await ni(i);if(n.length===0)return e.warn("No workspace patterns found in package.json"),{success:!0,projects:[],durationMs:0};e.info(`Found workspace patterns: ${n.join(", ")}`);let t=await ri(i,n);if(t.length===0)return e.warn("No projects found matching workspace patterns"),{success:!0,projects:[],durationMs:0};e.info(`Found ${t.length} workspace packages`);let a=t.map((f)=>{let o=d(f,"tsconfig.json");return{name:P(f),root:f,tsconfigPath:u(o)?o:"",references:[]}});return yn({root:i,projects:a,sharedConfig:c})}
6
+ export{ei,ti,yn,lo,ni,ri,uo};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{s}from"./chunk-ykrdzatr.js";import w from"process";import{dirname as x,relative as y,resolve as B,sep as l}from"path";function Ge(p={}){let{preBuild:c=!1,postBuild:r=!0,onGenerated:n,onError:o,failOnError:E=!0,...e}=p,v=async(i)=>{try{let t=await s(i);n?.(t)}catch(t){let d=t instanceof Error?t:Error(String(t));if(o?.(d),!o)console.error("[dtsx] Generation failed:",d.message);if(E)throw d}};return{name:"dtsx",async setup(i){if(!c&&!r)return;let t=e.cwd||w.cwd(),u=(i.config.entrypoints||[]).map((a)=>B(t,a)),g=e.root||i.config.root||(u.length>0?y(t,G(u))||".":"./src"),f=B(t,g),m=e.entrypoints||u.filter((a)=>a===f||a.startsWith(`${f}${l}`)).map((a)=>y(f,a));await v({...e,cwd:t,root:g,entrypoints:m.length>0?m:["index.ts"],outdir:e.outdir||i.config.outdir||"./dist",moduleSpecifierMode:e.moduleSpecifierMode??(i.config.target==="node"?"node":"preserve")})}}}function G(p){let c=p.map((n)=>x(n).split(l)),r=c[0];for(let n of c.slice(1)){let o=0;while(o<r.length&&o<n.length&&r[o]===n[o])o++;r=r.slice(0,o)}return r.join(l)||l}var Ea=Ge,ka=Ge;
3
- export{Ge,Ea,ka};
2
+ import{s}from"./chunk-ehpz5rg3.js";import w from"process";import{dirname as x,relative as y,resolve as B,sep as l}from"path";function qe(p={}){let{preBuild:c=!1,postBuild:r=!0,onGenerated:n,onError:o,failOnError:E=!0,...e}=p,v=async(i)=>{try{let t=await s(i);n?.(t)}catch(t){let d=t instanceof Error?t:Error(String(t));if(o?.(d),!o)console.error("[dtsx] Generation failed:",d.message);if(E)throw d}};return{name:"dtsx",async setup(i){if(!c&&!r)return;let t=e.cwd||w.cwd(),u=(i.config.entrypoints||[]).map((a)=>B(t,a)),g=e.root||i.config.root||(u.length>0?y(t,G(u))||".":"./src"),f=B(t,g),m=e.entrypoints||u.filter((a)=>a===f||a.startsWith(`${f}${l}`)).map((a)=>y(f,a));await v({...e,cwd:t,root:g,entrypoints:m.length>0?m:["index.ts"],outdir:e.outdir||i.config.outdir||"./dist",moduleSpecifierMode:e.moduleSpecifierMode??(i.config.target==="node"?"node":"preserve")})}}}function G(p){let c=p.map((n)=>x(n).split(l)),r=c[0];for(let n of c.slice(1)){let o=0;while(o<r.length&&o<n.length&&r[o]===n[o])o++;r=r.slice(0,o)}return r.join(l)||l}var Ma=qe,Oa=qe;
3
+ export{qe,Ma,Oa};
@@ -1,9 +1,9 @@
1
1
  // @bun
2
- function ft(e,r={}){let{entryPoints:n,keepExported:s=!0,keep:t=[],remove:l=[],shakableKinds:c=["type","interface"],debug:m=!1}=r,p=m?console.log.bind(console,"[tree-shake]"):()=>{},x=new Map;for(let a of e)x.set(a.name,a);let i=dt(e);p("Dependency graph:",Object.fromEntries(Array.from(i.entries()).map(([a,d])=>[a,Array.from(d)])));let o=new Set;if(n&&n.length>0){for(let a of n)if(x.has(a))o.add(a)}else{let a=new Set(c);for(let d of e){if(s&&d.isExported){o.add(d.name);continue}if(k(d.name,t)){o.add(d.name);continue}if(!a.has(d.kind))o.add(d.name)}}if(n&&n.length>0&&t.length>0){for(let a of e)if(k(a.name,t))o.add(a.name)}p("Entry points:",Array.from(o));let f=T(o,i);p("Reachable:",Array.from(f));let u=new Set,g=[];for(let a of e){let d=a.name;if(f.has(d)){u.add(d);continue}if(k(d,l)){g.push(d);continue}if(!c.includes(a.kind)){u.add(d);continue}g.push(d)}p("Keeping:",Array.from(u)),p("Removing:",g);let b=e.filter((a)=>u.has(a.name)),y={totalBefore:e.length,totalAfter:b.length,removedCount:g.length,reductionPercent:e.length>0?Math.round(g.length/e.length*100):0};return{declarations:b,removed:g,dependencyGraph:i,stats:y}}function dt(e){let r=new Map,n=new Set;for(let s=0;s<e.length;s++)n.add(e[s].name);for(let s of e){let t=new Set,l=pt(s);for(let c of l)if(n.has(c)&&c!==s.name)t.add(c);r.set(s.name,t)}return r}function pt(e){let r=new Set;if(e.typeAnnotation)h(e.typeAnnotation,r);if(e.extends)h(e.extends,r);if(e.text)R(e.text,r);if(e.members)for(let n of e.members){let s=pt(n);for(let t of s)r.add(t)}if(e.parameters){for(let n of e.parameters)if(n.type)h(n.type,r)}if(e.returnType)h(e.returnType,r);return r}var E=new Set(["string","number","boolean","object","any","unknown","never","void","null","undefined","symbol","bigint","true","false","Array","Object","String","Number","Boolean","Function","Symbol","Promise","Map","Set","WeakMap","WeakSet","Record","Partial","Required","Readonly","Pick","Omit","Exclude","Extract","NonNullable","Parameters","ReturnType","InstanceType","ConstructorParameters","ThisParameterType","OmitThisParameter","ThisType","Uppercase","Lowercase","Capitalize","Uncapitalize","Awaited","keyof","typeof","infer","extends","readonly","const","new"]),S=/\b([A-Z]\w*)\b/g,D=/\btypeof\s+([$A-Z_a-z][$\w]*)/g;function h(e,r){S.lastIndex=0;let n;while((n=S.exec(e))!==null){let s=n[1];if(!E.has(s))r.add(s)}D.lastIndex=0;while((n=D.exec(e))!==null)r.add(n[1])}function R(e,r){h(e,r)}function T(e,r){let n=new Set,s=Array.from(e);while(s.length>0){let t=s.pop();if(n.has(t))continue;n.add(t);let l=r.get(t);if(l){for(let c of l)if(!n.has(c))s.push(c)}}return n}function k(e,r){for(let n of r)if(typeof n==="string"){if(n.includes("*")){if(new RegExp(`^${n.replace(/\*/g,".*").replace(/\?/g,".")}$`).test(e))return!0}else if(e===n)return!0}else if(n.test(e))return!0;return!1}function ur(e,r={}){let n=e.split(`
2
+ function gt(e,r={}){let{entryPoints:n,keepExported:s=!0,keep:t=[],remove:l=[],shakableKinds:c=["type","interface"],debug:m=!1}=r,p=m?console.log.bind(console,"[tree-shake]"):()=>{},x=new Map;for(let a of e)x.set(a.name,a);let i=ht(e);p("Dependency graph:",Object.fromEntries(Array.from(i.entries()).map(([a,d])=>[a,Array.from(d)])));let o=new Set;if(n&&n.length>0){for(let a of n)if(x.has(a))o.add(a)}else{let a=new Set(c);for(let d of e){if(s&&d.isExported){o.add(d.name);continue}if(k(d.name,t)){o.add(d.name);continue}if(!a.has(d.kind))o.add(d.name)}}if(n&&n.length>0&&t.length>0){for(let a of e)if(k(a.name,t))o.add(a.name)}p("Entry points:",Array.from(o));let f=T(o,i);p("Reachable:",Array.from(f));let u=new Set,g=[];for(let a of e){let d=a.name;if(f.has(d)){u.add(d);continue}if(k(d,l)){g.push(d);continue}if(!c.includes(a.kind)){u.add(d);continue}g.push(d)}p("Keeping:",Array.from(u)),p("Removing:",g);let b=e.filter((a)=>u.has(a.name)),y={totalBefore:e.length,totalAfter:b.length,removedCount:g.length,reductionPercent:e.length>0?Math.round(g.length/e.length*100):0};return{declarations:b,removed:g,dependencyGraph:i,stats:y}}function ht(e){let r=new Map,n=new Set;for(let s=0;s<e.length;s++)n.add(e[s].name);for(let s of e){let t=new Set,l=yt(s);for(let c of l)if(n.has(c)&&c!==s.name)t.add(c);r.set(s.name,t)}return r}function yt(e){let r=new Set;if(e.typeAnnotation)h(e.typeAnnotation,r);if(e.extends)h(e.extends,r);if(e.text)R(e.text,r);if(e.members)for(let n of e.members){let s=yt(n);for(let t of s)r.add(t)}if(e.parameters){for(let n of e.parameters)if(n.type)h(n.type,r)}if(e.returnType)h(e.returnType,r);return r}var E=new Set(["string","number","boolean","object","any","unknown","never","void","null","undefined","symbol","bigint","true","false","Array","Object","String","Number","Boolean","Function","Symbol","Promise","Map","Set","WeakMap","WeakSet","Record","Partial","Required","Readonly","Pick","Omit","Exclude","Extract","NonNullable","Parameters","ReturnType","InstanceType","ConstructorParameters","ThisParameterType","OmitThisParameter","ThisType","Uppercase","Lowercase","Capitalize","Uncapitalize","Awaited","keyof","typeof","infer","extends","readonly","const","new"]),S=/\b([A-Z]\w*)\b/g,D=/\btypeof\s+([$A-Z_a-z][$\w]*)/g;function h(e,r){S.lastIndex=0;let n;while((n=S.exec(e))!==null){let s=n[1];if(!E.has(s))r.add(s)}D.lastIndex=0;while((n=D.exec(e))!==null)r.add(n[1])}function R(e,r){h(e,r)}function T(e,r){let n=new Set,s=Array.from(e);while(s.length>0){let t=s.pop();if(n.has(t))continue;n.add(t);let l=r.get(t);if(l){for(let c of l)if(!n.has(c))s.push(c)}}return n}function k(e,r){for(let n of r)if(typeof n==="string"){if(n.includes("*")){if(new RegExp(`^${n.replace(/\*/g,".*").replace(/\?/g,".")}$`).test(e))return!0}else if(e===n)return!0}else if(n.test(e))return!0;return!1}function hr(e,r={}){let n=e.split(`
3
3
  `),s=[],t=null;for(let i=0;i<n.length;i++){let o=n[i],f=o.trim();if(!t&&(f===""||f.startsWith("//")))continue;if(!t){let u=f.match(/^(export\s+)?(declare\s+)?(interface|type|enum|class|function|const|let|var)\s+(\w+)/);if(u){let[,g,,b,y]=u;if(t={name:y,kind:b,isExported:!!g,start:i,lines:[o],braceCount:0},t.braceCount+=(o.match(/\{/g)||[]).length,t.braceCount-=(o.match(/\}/g)||[]).length,t.braceCount===0&&(f.endsWith(";")||!f.includes("{")))s.push({name:t.name,kind:t.kind,isExported:t.isExported,start:t.start,end:i,text:t.lines.join(`
4
4
  `)}),t=null;continue}}if(t){if(t.lines.push(o),t.braceCount+=(o.match(/\{/g)||[]).length,t.braceCount-=(o.match(/\}/g)||[]).length,t.braceCount<=0&&(f.endsWith("}")||f.endsWith(";")))s.push({name:t.name,kind:t.kind,isExported:t.isExported,start:t.start,end:i,text:t.lines.join(`
5
- `)}),t=null}}if(s.length===0)return{content:e,removed:[]};let l=s.map((i)=>({name:i.name,kind:i.kind,isExported:i.isExported,text:i.text})),c=ft(l,r),m=new Set(c.declarations.map((i)=>i.name)),p=new Set;for(let i of s)if(!m.has(i.name))for(let o=i.start;o<=i.end;o++)p.add(o);return{content:n.filter((i,o)=>!p.has(o)).join(`
5
+ `)}),t=null}}if(s.length===0)return{content:e,removed:[]};let l=s.map((i)=>({name:i.name,kind:i.kind,isExported:i.isExported,text:i.text})),c=gt(l,r),m=new Set(c.declarations.map((i)=>i.name)),p=new Set;for(let i of s)if(!m.has(i.name))for(let o=i.start;o<=i.end;o++)p.add(o);return{content:n.filter((i,o)=>!p.has(o)).join(`
6
6
  `).replace(/\n{3,}/g,`
7
7
 
8
- `),removed:c.removed}}function fr(e,r={}){return ft(e,{...r,debug:!1}).removed}function dr(e,r){let n=dt(r),s=n.get(e)||new Set,t=T(new Set([e]),n);t.delete(e);let l=[];for(let[c,m]of n)if(c!==e&&m.has(e))l.push(c);return{directDependencies:Array.from(s),transitiveDependencies:Array.from(t),dependents:l}}function Yi(e={}){return{shake:(r)=>ft(r,e),shakeContent:(r)=>ur(r,e),findUnused:(r)=>fr(r,e),analyzeDependencies:(r,n)=>dr(r,n),buildGraph:dt,extractRefs:pt}}
9
- export{ft,dt,pt,ur,fr,dr,Yi};
8
+ `),removed:c.removed}}function yr(e,r={}){return gt(e,{...r,debug:!1}).removed}function br(e,r){let n=ht(r),s=n.get(e)||new Set,t=T(new Set([e]),n);t.delete(e);let l=[];for(let[c,m]of n)if(c!==e&&m.has(e))l.push(c);return{directDependencies:Array.from(s),transitiveDependencies:Array.from(t),dependents:l}}function os(e={}){return{shake:(r)=>gt(r,e),shakeContent:(r)=>hr(r,e),findUnused:(r)=>yr(r,e),analyzeDependencies:(r,n)=>br(r,n),buildGraph:ht,extractRefs:yt}}
9
+ export{gt,ht,yt,hr,yr,br,os};
@@ -1,22 +1,22 @@
1
1
  // @bun
2
- import{f,de}from"./chunk-th9tcxga.js";import{Wt,_t,n,Ie,j}from"./chunk-x1j88x37.js";function g(t){if(t.includes(`
2
+ import{f,be}from"./chunk-587w6ktw.js";import{Vt,Ut,n,We,z}from"./chunk-h7tsf2qg.js";function g(t){if(t.includes(`
3
3
  `))return`/**
4
4
  * ${t}
5
5
  */
6
6
  `;return`/** ${t} */
7
- `}function D(t){let o=t.indexOf("{");if(o===-1)return-1;let s=t.indexOf("<");if(s===-1||s>o)return o;let e=0,r=!1,a="";for(let i=0;i<t.length;i++){let l=t[i],u=i>0?t[i-1]:"";if(!r&&(l==='"'||l==="'"||l==="`"))r=!0,a=l;else if(r&&l===a&&u!=="\\")r=!1;if(!r){if(l==="<")e++;else if(l===">")e--;else if(l==="{"&&e===0)return i}}return-1}function se(t,o=!0){return f(t.leadingComments,o)+t.text}function h(t,o=!0){if(t.inferenceError)throw Object.assign(Error(`Cannot infer alias '${t.name}': unsupported source value flow`),{code:t.inferenceError});let s=f(t.leadingComments,o);if(!t.typeAnnotation&&t.inferredType)return s+t.text;if(t.typeAnnotation&&!t.value)return s+t.text;let e="";if(t.isExported)e+="export ";e+="declare ";let r=t.modifiers?.[0]||"const";e+=`${r} `,e+=t.name;let{typeAnnotation:a,value:i}=t,l=!a&&i?j(i):null;if(l)a=l;else if(!a&&i&&i.trim().endsWith("as const"))a=n(i,!0,!1,0,t.computedKeyConstants);else if(!a&&i&&r==="const"){let c=i.trim(),m=c.startsWith("{")||c.startsWith("[");if(m)Wt();a=n(i,!m,!1,0,t.computedKeyConstants)}else if(!a&&i)a=n(i,r==="const",!1,0,t.computedKeyConstants);if(!a)a="unknown";let u="";if(o&&i&&!t.typeAnnotation&&!i.trim().endsWith("as const")){let c=i.trim();if(r!=="const"){if((a==="string"||a==="number"||a==="boolean")&&c.length>0)u=`@defaultValue ${c}`}else if(c.startsWith("{")||c.startsWith("[")){let m=_t();if(m)if(m.includes(`
7
+ `}function h(t){let o=t.indexOf("{");if(o===-1)return-1;let s=t.indexOf("<");if(s===-1||s>o)return o;let e=0,r=!1,a="";for(let i=0;i<t.length;i++){let l=t[i],u=i>0?t[i-1]:"";if(!r&&(l==='"'||l==="'"||l==="`"))r=!0,a=l;else if(r&&l===a&&u!=="\\")r=!1;if(!r){if(l==="<")e++;else if(l===">")e--;else if(l==="{"&&e===0)return i}}return-1}function fe(t,o=!0){return f(t.leadingComments,o)+t.text}function b(t,o=!0){if(t.inferenceError)throw Object.assign(Error(`Cannot infer alias '${t.name}': unsupported source value flow`),{code:t.inferenceError});let s=f(t.leadingComments,o);if(!t.typeAnnotation&&t.inferredType)return s+t.text;if(t.typeAnnotation&&!t.value)return s+t.text;let e="";if(t.isExported)e+="export ";e+="declare ";let r=t.modifiers?.[0]||"const";e+=`${r} `,e+=t.name;let{typeAnnotation:a,value:i}=t,l=!a&&i?z(i):null;if(l)a=l;else if(!a&&i&&i.trim().endsWith("as const"))a=n(i,!0,!1,0,t.computedKeyConstants);else if(!a&&i&&r==="const"){let c=i.trim(),m=c.startsWith("{")||c.startsWith("[");if(m)Vt();a=n(i,!m,!1,0,t.computedKeyConstants)}else if(!a&&i)a=n(i,r==="const",!1,0,t.computedKeyConstants);if(!a)a="unknown";let u="";if(o&&i&&!t.typeAnnotation&&!i.trim().endsWith("as const")){let c=i.trim();if(r!=="const"){if((a==="string"||a==="number"||a==="boolean")&&c.length>0)u=`@defaultValue ${c}`}else if(c.startsWith("{")||c.startsWith("[")){let m=Ut();if(m)if(m.includes(`
8
8
  `))u=`@defaultValue
9
9
  * \`\`\`ts
10
10
  ${m.split(`
11
11
  `).map((p)=>` * ${p}`).join(`
12
12
  `)}
13
- * \`\`\``;else u=`@defaultValue \`${m}\``}}else if(o&&i&&t.typeAnnotation&&Ie(t.typeAnnotation)){Wt();let c=i.trim(),m=c.endsWith("as const")?c.slice(0,-8).trim():c;n(m,!1,!1,0,t.computedKeyConstants);let x=_t();if(x)if(x.includes(`
13
+ * \`\`\``;else u=`@defaultValue \`${m}\``}}else if(o&&i&&t.typeAnnotation&&We(t.typeAnnotation)){Vt();let c=i.trim(),m=c.endsWith("as const")?c.slice(0,-8).trim():c;n(m,!1,!1,0,t.computedKeyConstants);let x=Ut();if(x)if(x.includes(`
14
14
  `))u=`@defaultValue
15
15
  * \`\`\`ts
16
16
  ${x.split(`
17
17
  `).map((d)=>` * ${d}`).join(`
18
18
  `)}
19
- * \`\`\``;else u=`@defaultValue \`${x}\``}if(u=de(u),e+=`: ${a};`,u&&s&&s.includes("@defaultValue"))u="";if(u&&s){let c=s.trimEnd(),m=c.lastIndexOf("*/");if(m!==-1){let p=c.slice(0,m).trimEnd();if(p.startsWith("/** ")&&!p.includes(`
19
+ * \`\`\``;else u=`@defaultValue \`${x}\``}if(u=be(u),e+=`: ${a};`,u&&s&&s.includes("@defaultValue"))u="";if(u&&s){let c=s.trimEnd(),m=c.lastIndexOf("*/");if(m!==-1){let p=c.slice(0,m).trimEnd();if(p.startsWith("/** ")&&!p.includes(`
20
20
  `))p=`/**
21
21
  * ${p.slice(4)}`;return`${p}
22
22
  * ${u}
@@ -25,5 +25,5 @@ ${x.split(`
25
25
  * ${c.replace(/^\/\/\s*/,"")}
26
26
  * ${u}
27
27
  */
28
- ${e}`}if(u)return`${g(u)}${e}`;return s+e}function oe(t,o=!0){let s=f(t.leadingComments,o),e=t.text;if(e.startsWith("export declare interface")||e.startsWith("declare interface"))return s+e;let r="";if(t.isExported)r+="export ";if(r+="declare interface ",r+=t.name,t.generics)r+=t.generics;if(t.extends)r+=` extends ${t.extends}`;let a=D(t.text);if(a!==-1)r+=` ${t.text.slice(a)}`;else r+=" {}";return s+r}function ae(t,o=!0){let s=f(t.leadingComments,o);if(t.text.includes("{")&&t.text.includes("}")&&t.text.includes("from"))return s+t.text;let e="";if(t.isExported)e+="export ";if(!t.isExported&&!t.text.includes(" from "))e+="declare ";let r=t.text.indexOf("type ");if(r!==-1){let i=t.text.slice(r),l=i.length;while(l>0&&(i.charCodeAt(l-1)===59||i.charCodeAt(l-1)===32||i.charCodeAt(l-1)===10||i.charCodeAt(l-1)===13))l--;if(l<i.length)i=i.slice(0,l);e+=i}else{if(e+=`type ${t.name}`,t.generics)e+=t.generics;e+=" = any"}let a=e.trimEnd();if(!a.endsWith(";")&&!a.endsWith("}"))e+=";";return s+e}function ce(t,o=!0){return f(t.leadingComments,o)+t.text}function le(t,o=!0){let s=f(t.leadingComments,o),e="";if(t.isExported)e+="export ";if(e+="declare ",t.modifiers?.includes("const"))e+="const ";e+="enum ",e+=t.name;let r=t.text.indexOf("{");if(r!==-1)e+=` ${t.text.slice(r)}`;else e+=" {}";return s+e}function Gn(t){let o=t.text.trim(),s=o.length;while(s>0&&o.charCodeAt(s-1)===59)s--;if(s<o.length)o=o.slice(0,s);return o+=";",o}function Vn(t,o=!0){return f(t.leadingComments,o)+t.text.trim()}function ue(t,o=!0){let s=f(t.leadingComments,o);if(t.text.startsWith("declare global"))return s+t.text;if(t.source||(t.name.startsWith('"')||t.name.startsWith("'")||t.name.startsWith("`"))){let i="declare module ";i+=t.name;let l=t.text.indexOf("{");if(l!==-1)i+=` ${t.text.slice(l)}`;else i+=" {}";return s+i}let r="";if(t.isExported)r+="export ";if(!t.modifiers?.includes("declare"))r+="declare ";r+="namespace ",r+=t.name;let a=t.text.indexOf("{");if(a!==-1)r+=` ${t.text.slice(a)}`;else r+=" {}";return s+r}
29
- export{se,h,oe,ae,ce,le,Gn,Vn,ue};
28
+ ${e}`}if(u)return`${g(u)}${e}`;return s+e}function de(t,o=!0){let s=f(t.leadingComments,o),e=t.text;if(e.startsWith("export declare interface")||e.startsWith("declare interface"))return s+e;let r="";if(t.isExported)r+="export ";if(r+="declare interface ",r+=t.name,t.generics)r+=t.generics;if(t.extends)r+=` extends ${t.extends}`;let a=h(t.text);if(a!==-1)r+=` ${t.text.slice(a)}`;else r+=" {}";return s+r}function pe(t,o=!0){let s=f(t.leadingComments,o);if(t.text.includes("{")&&t.text.includes("}")&&t.text.includes("from"))return s+t.text;let e="";if(t.isExported)e+="export ";if(!t.isExported&&!t.text.includes(" from "))e+="declare ";let r=t.text.indexOf("type ");if(r!==-1){let i=t.text.slice(r),l=i.length;while(l>0&&(i.charCodeAt(l-1)===59||i.charCodeAt(l-1)===32||i.charCodeAt(l-1)===10||i.charCodeAt(l-1)===13))l--;if(l<i.length)i=i.slice(0,l);e+=i}else{if(e+=`type ${t.name}`,t.generics)e+=t.generics;e+=" = any"}let a=e.trimEnd();if(!a.endsWith(";")&&!a.endsWith("}"))e+=";";return s+e}function me(t,o=!0){return f(t.leadingComments,o)+t.text}function ge(t,o=!0){let s=f(t.leadingComments,o),e="";if(t.isExported)e+="export ";if(e+="declare ",t.modifiers?.includes("const"))e+="const ";e+="enum ",e+=t.name;let r=t.text.indexOf("{");if(r!==-1)e+=` ${t.text.slice(r)}`;else e+=" {}";return s+e}function Kn(t){let o=t.text.trim(),s=o.length;while(s>0&&o.charCodeAt(s-1)===59)s--;if(s<o.length)o=o.slice(0,s);return o+=";",o}function qn(t,o=!0){return f(t.leadingComments,o)+t.text.trim()}function he(t,o=!0){let s=f(t.leadingComments,o);if(t.text.startsWith("declare global"))return s+t.text;if(t.source||(t.name.startsWith('"')||t.name.startsWith("'")||t.name.startsWith("`"))){let i="declare module ";i+=t.name;let l=t.text.indexOf("{");if(l!==-1)i+=` ${t.text.slice(l)}`;else i+=" {}";return s+i}let r="";if(t.isExported)r+="export ";if(!t.modifiers?.includes("declare"))r+="declare ";r+="namespace ",r+=t.name;let a=t.text.indexOf("{");if(a!==-1)r+=` ${t.text.slice(a)}`;else r+=" {}";return s+r}
29
+ export{fe,b,de,pe,me,ge,Kn,qn,he};
@@ -1,10 +1,10 @@
1
1
  // @bun
2
- import{r}from"./chunk-90f37xen.js";import{existsSync as j,mkdirSync as N,readFileSync as z,writeFileSync as G}from"fs";import{dirname as K,relative as L,resolve as _}from"path";async function ds(t,e,n){let u=new Map,f=[],x=new Set,D=0,w=0,S=0,C=[];for(let i of t){let o=e.get(i);if(!o)continue;C.push({file:i,decls:r(o,i,n.keepComments)})}for(let{file:i,decls:o}of C){D+=o.length;for(let s of o)if(s.kind==="import"){w++;let c=s.source||"";if(c.startsWith("."))continue;if(!u.has(c))u.set(c,{source:c,specifiers:new Map,isTypeOnly:s.isTypeOnly||!1,isSideEffect:s.isSideEffect||!1});let l=u.get(c);if(s.specifiers)for(let h of s.specifiers){let W=h.alias||h.name;if(!l.specifiers.has(W))l.specifiers.set(W,{name:h.name,alias:h.alias,isType:h.isType||!1})}if(!s.isTypeOnly)l.isTypeOnly=!1}else if(s.isExported||s.kind==="export"){if(S++,s.kind==="export"&&s.source&&(s.source.startsWith(".")||s.source.startsWith("/")))continue;if(s.name&&x.has(s.name))continue;if(s.name)x.add(s.name);f.push({declaration:s,file:i})}}let a=[];a.push("/**"),a.push(" * Bundled TypeScript declarations"),a.push(` * Generated from ${t.length} source files`),a.push(" */"),a.push("");let T=n.importOrder||["bun"],y=Array.from(u.values()),p=Array(y.length);for(let i=0;i<y.length;i++){let o=y[i].source,s=T.length;for(let c=0;c<T.length;c++)if(o.startsWith(T[c])){s=c;break}p[i]=s}let g=y.map((i,o)=>o);g.sort((i,o)=>{let s=p[i],c=p[o];if(s!==c)return s-c;return y[i].source.localeCompare(y[o].source)});let b=g.map((i)=>y[i]);for(let i of b)if(i.isSideEffect)a.push(`import '${i.source}';`);else if(i.specifiers.size>0){let s=Array.from(i.specifiers.values()).map((l)=>{let h=l.isType?"type ":"";return l.alias?`${h}${l.name} as ${l.alias}`:`${h}${l.name}`}),c=i.isTypeOnly?"type ":"";a.push(`import ${c}{ ${s.join(", ")} } from '${i.source}';`)}if(b.length>0)a.push("");let m=new Map;for(let{declaration:i,file:o}of f){if(!m.has(o))m.set(o,[]);m.get(o).push(i)}for(let[i,o]of m){let s=L(n.cwd,i);a.push(`// From: ${s}`);for(let c of o){if(n.keepComments&&c.leadingComments)for(let l of c.leadingComments)a.push(l);a.push(F(c))}a.push("")}let d=a.join(`
2
+ import{r}from"./chunk-v4z6808c.js";import{existsSync as j,mkdirSync as N,readFileSync as z,writeFileSync as G}from"fs";import{dirname as K,relative as L,resolve as _}from"path";async function ys(t,e,n){let u=new Map,f=[],x=new Set,D=0,w=0,S=0,C=[];for(let i of t){let o=e.get(i);if(!o)continue;C.push({file:i,decls:r(o,i,n.keepComments)})}for(let{file:i,decls:o}of C){D+=o.length;for(let s of o)if(s.kind==="import"){w++;let c=s.source||"";if(c.startsWith("."))continue;if(!u.has(c))u.set(c,{source:c,specifiers:new Map,isTypeOnly:s.isTypeOnly||!1,isSideEffect:s.isSideEffect||!1});let l=u.get(c);if(s.specifiers)for(let h of s.specifiers){let W=h.alias||h.name;if(!l.specifiers.has(W))l.specifiers.set(W,{name:h.name,alias:h.alias,isType:h.isType||!1})}if(!s.isTypeOnly)l.isTypeOnly=!1}else if(s.isExported||s.kind==="export"){if(S++,s.kind==="export"&&s.source&&(s.source.startsWith(".")||s.source.startsWith("/")))continue;if(s.name&&x.has(s.name))continue;if(s.name)x.add(s.name);f.push({declaration:s,file:i})}}let a=[];a.push("/**"),a.push(" * Bundled TypeScript declarations"),a.push(` * Generated from ${t.length} source files`),a.push(" */"),a.push("");let T=n.importOrder||["bun"],y=Array.from(u.values()),p=Array(y.length);for(let i=0;i<y.length;i++){let o=y[i].source,s=T.length;for(let c=0;c<T.length;c++)if(o.startsWith(T[c])){s=c;break}p[i]=s}let g=y.map((i,o)=>o);g.sort((i,o)=>{let s=p[i],c=p[o];if(s!==c)return s-c;return y[i].source.localeCompare(y[o].source)});let b=g.map((i)=>y[i]);for(let i of b)if(i.isSideEffect)a.push(`import '${i.source}';`);else if(i.specifiers.size>0){let s=Array.from(i.specifiers.values()).map((l)=>{let h=l.isType?"type ":"";return l.alias?`${h}${l.name} as ${l.alias}`:`${h}${l.name}`}),c=i.isTypeOnly?"type ":"";a.push(`import ${c}{ ${s.join(", ")} } from '${i.source}';`)}if(b.length>0)a.push("");let m=new Map;for(let{declaration:i,file:o}of f){if(!m.has(o))m.set(o,[]);m.get(o).push(i)}for(let[i,o]of m){let s=L(n.cwd,i);a.push(`// From: ${s}`);for(let c of o){if(n.keepComments&&c.leadingComments)for(let l of c.leadingComments)a.push(l);a.push(F(c))}a.push("")}let d=a.join(`
3
3
  `);return{content:d,files:t,declarationCount:D,importCount:w,exportCount:S,size:Buffer.byteLength(d,"utf8"),warnings:[]}}function F(t){if(t.text){let n=t.text.trim();if(t.isExported&&!n.startsWith("export"))n=`export ${n}`;if(!n.endsWith(";")&&!n.endsWith("}"))n+=";";return n}let e=[];if(t.isExported)e.push("export");if(t.isDefault)e.push("default");switch(t.kind){case"function":if(e.push("declare function"),e.push(t.name),t.generics)e.push(t.generics);if(e.push(`(${V(t.parameters)})`),t.returnType)e.push(`: ${t.returnType}`);break;case"variable":if(e.push("declare const"),e.push(t.name),t.typeAnnotation)e.push(`: ${t.typeAnnotation}`);break;case"interface":if(e.push("interface"),e.push(t.name),t.generics)e.push(t.generics);if(t.extends)e.push(`extends ${t.extends}`);if(e.push("{"),t.members)for(let n of t.members)e.push(` ${n.name}${n.typeAnnotation?`: ${n.typeAnnotation}`:""};`);e.push("}");break;case"type":if(e.push("type"),e.push(t.name),t.generics)e.push(t.generics);e.push("="),e.push(t.typeAnnotation||"unknown");break;case"class":if(e.push("declare class"),e.push(t.name),t.generics)e.push(t.generics);if(t.extends)e.push(`extends ${t.extends}`);if(t.implements&&t.implements.length>0)e.push(`implements ${t.implements.join(", ")}`);if(e.push("{"),t.members)for(let n of t.members)e.push(` ${F(n)}`);e.push("}");break;case"enum":if(e.push("declare enum"),e.push(t.name),e.push("{"),t.members){let n=t.members.map((u)=>u.value!==void 0?`${u.name} = ${u.value}`:u.name);e.push(` ${n.join(`,
4
- `)}`)}e.push("}");break;default:return t.text||""}return e.join(" ")}function V(t){if(!t||t.length===0)return"";return t.map((e)=>{let n="";if(e.rest)n+="...";if(n+=e.name,e.optional)n+="?";if(e.type)n+=`: ${e.type}`;if(e.defaultValue)n+=` = ${e.defaultValue}`;return n}).join(", ")}async function Yt(t,e={}){let n=[],u=new Map,f=[],x=[],D=new Set,w=0,S=0,C=0;for(let p of t){if(!j(p)){n.push(`File not found: ${p}`);continue}let g=z(p,"utf-8");x.push(p);let b=g.split(`
4
+ `)}`)}e.push("}");break;default:return t.text||""}return e.join(" ")}function V(t){if(!t||t.length===0)return"";return t.map((e)=>{let n="";if(e.rest)n+="...";if(n+=e.name,e.optional)n+="?";if(e.type)n+=`: ${e.type}`;if(e.defaultValue)n+=` = ${e.defaultValue}`;return n}).join(", ")}async function tn(t,e={}){let n=[],u=new Map,f=[],x=[],D=new Set,w=0,S=0,C=0;for(let p of t){if(!j(p)){n.push(`File not found: ${p}`);continue}let g=z(p,"utf-8");x.push(p);let b=g.split(`
5
5
  `),m=[],d=0,i=!1;for(let o of b){let s=o.trim();if(!s&&!i)continue;if(s.startsWith("import ")){S++;let l=s.match(/import\s+(type\s+)?(?:\{([^}]+)\}|(\w+)|\*\s+as\s+(\w+))\s+from\s+['"]([^'"]+)['"]/);if(l){let[,h,W,q,H,A]=l;if(e.externals?.some((P)=>A.startsWith(P))){f.push(s);continue}if(A.startsWith("."))continue;if(!u.has(A))u.set(A,{source:A,specifiers:new Map,isTypeOnly:!!h,isSideEffect:!1});let E=u.get(A);if(W){let P=W.split(",").map((k)=>k.trim());for(let k of P){let[I,v]=k.split(/\s+as\s+/).map((M)=>M.trim()),R=I.startsWith("type "),O=R?I.replace("type ",""):I;E.specifiers.set(v||O,{name:O,alias:v!==O?v:void 0,isType:R})}}if(!h)E.isTypeOnly=!1}continue}if(/^(export\s+)?(declare\s+)?(interface|type|class|function|const|let|var|enum|namespace|module)\s/.test(s)){if(i=!0,m=[o],d=(o.match(/\{/g)||[]).length-(o.match(/\}/g)||[]).length,d===0&&(s.endsWith(";")||!s.includes("{"))){let l=B(s);if(!D.has(l)||!e.mergeDuplicates){if(D.add(l),f.push(o),w++,s.startsWith("export"))C++}i=!1,m=[]}}else if(i){if(m.push(o),d+=(o.match(/\{/g)||[]).length-(o.match(/\}/g)||[]).length,d<=0){let l=m.join(`
6
6
  `),h=B(m[0]);if(!D.has(h)||!e.mergeDuplicates){if(D.add(h),f.push(l),w++,m[0].trim().startsWith("export"))C++}i=!1,m=[]}}else if(s.startsWith("export ")&&!s.includes("declare"))f.push(o),C++}}let a=[];if(e.banner)a.push(e.banner),a.push("");if(e.includeReferences&&e.references){for(let p of e.references)a.push(`/// <reference types="${p}" />`);a.push("")}let T=Array.from(u.values()).sort((p,g)=>p.source.localeCompare(g.source));for(let p of T)if(p.specifiers.size>0){let b=Array.from(p.specifiers.values()).map((d)=>{let i=d.isType?"type ":"";return d.alias?`${i}${d.name} as ${d.alias}`:`${i}${d.name}`}),m=p.isTypeOnly?"type ":"";a.push(`import ${m}{ ${b.join(", ")} } from '${p.source}';`)}if(T.length>0)a.push("");if(e.ambient&&e.moduleName){a.push(`declare module '${e.moduleName}' {`);for(let p of f){let g=p.split(`
7
7
  `).map((b)=>` ${b.replace(/^(\s*)(export\s+)?declare\s+/,"$1$2")}`).join(`
8
8
  `);a.push(g)}a.push("}")}else{if(e.sortDeclarations)f.sort((p,g)=>{let b=B(p),m=B(g);return b.localeCompare(m)});for(let p of f)a.push(p)}if(e.footer)a.push(""),a.push(e.footer);let y=a.join(`
9
- `);return{content:y,files:x,declarationCount:w,importCount:S,exportCount:C,size:Buffer.byteLength(y,"utf-8"),warnings:n}}function B(t){let e=t.match(/(interface|type|class|function|const|let|var|enum|namespace|module)\s+(\w+)/);return e?`${e[1]}:${e[2]}`:t.trim()}async function vr(t,e,n={}){let u=await Yt(t,n),f=K(e);if(!j(f))N(f,{recursive:!0});return G(e,u.content),u}function ps(t={}){return{bundle:(e)=>Yt(e,t),bundleAndWrite:(e,n)=>vr(e,n,{...t,output:n})}}async function ms(t,e=process.cwd()){let n=Array.isArray(t)?t:[t],u=[];for(let f of n){if(f.includes("*"))continue;let x=_(e,f);if(j(x))u.push(x)}return u}
10
- export{ds,Yt,vr,ps,ms};
9
+ `);return{content:y,files:x,declarationCount:w,importCount:S,exportCount:C,size:Buffer.byteLength(y,"utf-8"),warnings:n}}function B(t){let e=t.match(/(interface|type|class|function|const|let|var|enum|namespace|module)\s+(\w+)/);return e?`${e[1]}:${e[2]}`:t.trim()}async function Tr(t,e,n={}){let u=await tn(t,n),f=K(e);if(!j(f))N(f,{recursive:!0});return G(e,u.content),u}function bs(t={}){return{bundle:(e)=>tn(e,t),bundleAndWrite:(e,n)=>Tr(e,n,{...t,output:n})}}async function ws(t,e=process.cwd()){let n=Array.isArray(t)?t:[t],u=[];for(let f of n){if(f.includes("*"))continue;let x=_(e,f);if(j(x))u.push(x)}return u}
10
+ export{ys,tn,Tr,bs,ws};
@@ -0,0 +1,8 @@
1
+ // @bun
2
+ import{t,m}from"./chunk-tsbthwf0.js";import{n}from"./chunk-h7tsf2qg.js";function zn(p,k,b,h){let r=new Map,i=new Map;for(let e of[...k,...b.values(),...[...h.values()].flat()])if(r.set(e.name,e),e.kind==="function"&&!i.has(e.name))i.set(e.name,e);for(let[e,o]of h)if(o.length)i.set(e,o[0]);if(!i.size)return;let u=new Set;for(let[e,o]of h)if(o.length>1)u.add(e);let a=new Map;for(let e of k)if(e.kind==="function"){let o=(a.get(e.name)??0)+1;if(a.set(e.name,o),o>1)u.add(e.name)}let s=m(p),d=(e)=>s[e]?p.slice(s[e].start,s[e].end):"",g=new Map,x=0;for(let e=0;e<s.length;e++){let o=s[e];if(o.kind==="punctuation"){let l=p.charCodeAt(o.start);if(l===40||l===91||l===123)x++;else if(l===41||l===93||l===125)x--;continue}if(x||s[e+2]?.kind!=="word"||d(e+1)!=="."||d(e+3)!=="=")continue;let c=d(e);if(!i.has(c))continue;let M=d(e+2),w=e+4,f=w,y=0;for(;f<s.length;f++){let l=d(f);if(!y&&l===";")break;if(!y&&f>w&&/[\r\n]/.test(p.slice(s[f-1].end,s[f].start))&&(["export","const","let","var","function","class"].includes(l)||i.has(l)&&d(f+1)==="."))break;if(["(","[","{"].includes(l))y++;else if([")","]","}"].includes(l))y--}if(f===w)continue;let D=R(p.slice(s[w].start,s[f-1].end),r,u),v=g.get(c);if(!v)g.set(c,v=new Map);let A=v.get(M);if(!A)v.set(M,A=[]);if(!A.includes(D))A.push(D);e=f-1}for(let[e,o]of g){let c=i.get(e),M=[...o].map(([f,y])=>` let ${f}: ${y.map((D)=>D.includes("=>")&&y.length>1?`(${D})`:D).join(" | ")};`).join(`
3
+ `),w=c.isExported&&!c.isDefault?"export ":"";if(c.isDefault)c.text=c.text.replace("export default function ","declare function ");if(c.text+=`
4
+ ${w}declare namespace ${e} {
5
+ ${M}
6
+ }`,c.isDefault)c.text+=`
7
+ export default ${e};`}}function R(p,k,b,h=0){let r=p.trim(),i=k.get(r);if(i?.kind==="variable"&&h<64){if(i.typeAnnotation)return i.typeAnnotation==="unique symbol"?`typeof ${r}`:i.typeAnnotation;if(typeof i.value==="string")return R(i.value,k,b,h+1)}let u=n(r,!1);if(u!=="unknown")return u;let a=t(r);if(a[0]?.kind==="word"&&a[1]&&r.slice(a[1].start,a[1].end)==="("&&r.endsWith(")")){let s=0,d=-1;for(let e=1;e<a.length;e++){let o=r.slice(a[e].start,a[e].end);if(o==="(")s++;else if(o===")"&&--s===0){d=e;break}}if(d!==a.length-1)return u;let g=r.slice(a[0].start,a[0].end),x=k.get(g);if(x?.kind==="function"&&!x.generics&&!b.has(g))return`ReturnType<typeof ${g}>`}if(/^[$A-Z_a-z][$\w]*(?:\.[$A-Z_a-z][$\w]*)*$/.test(r))return`typeof ${r}`;return u}
8
+ export{zn};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{basename as e,dirname as n,isAbsolute as i,join as o,relative as a,resolve as s}from"path";function Ii(t){if(!t||typeof t!=="string")throw Error("Invalid file path: must be a non-empty string");return t}function Li(t){if(!t||typeof t!=="string")throw Error("Invalid directory path: must be a non-empty string");return t}function Fi(t){if(!t||typeof t!=="string")throw Error("Invalid glob pattern: must be a non-empty string");return t}function Ni(t){if(typeof t!=="string")throw TypeError("Invalid source code: must be a string");return t}function Bi(t){if(typeof t!=="string")throw TypeError("Invalid DTS content: must be a string");return t}function Wi(t){if(!t||typeof t!=="string")throw Error("Invalid module specifier: must be a non-empty string");return t}function _i(t){if(!t||typeof t!=="string")throw Error("Invalid type name: must be a non-empty string");if(!["string","number","boolean","symbol","bigint","undefined","null","void","never","any","unknown","object"].includes(t)&&!/^[A-Z_$]/.test(t));return t}function ji(t){if(!t||typeof t!=="string")throw Error("Invalid declaration name: must be a non-empty string");return t}function Gi(t){if(!t||typeof t!=="string")throw Error("Invalid absolute path: must be a non-empty string");if(!t.startsWith("/")&&!/^[A-Z]:/i.test(t))throw Error("Invalid absolute path: must start with / or drive letter");return t}function Vi(t){if(!t||typeof t!=="string")throw Error("Invalid relative path: must be a non-empty string");if(t.startsWith("/")||/^[A-Z]:/i.test(t))throw Error("Invalid relative path: must not be absolute");return t}function Ui(t){if(typeof t!=="string")throw TypeError("Invalid JSON string: must be a string");try{JSON.parse(t)}catch{throw Error("Invalid JSON string: must be valid JSON")}return t}function zi(t,r){return typeof t==="string"||typeof t==="number"}function Hi(t){return t}var Ki={join(t,...r){return o(t,...r)},dirname(t){return n(t)},basename(t){return e(t)},resolve(...t){return s(...t)},isAbsolute(t){return i(t)},relative(t,r){return a(t,r)}};
3
- export{Ii,Li,Fi,Ni,Bi,Wi,_i,ji,Gi,Vi,Ui,zi,Hi,Ki};
2
+ import{basename as e,dirname as n,isAbsolute as i,join as o,relative as a,resolve as s}from"path";function Ui(t){if(!t||typeof t!=="string")throw Error("Invalid file path: must be a non-empty string");return t}function zi(t){if(!t||typeof t!=="string")throw Error("Invalid directory path: must be a non-empty string");return t}function Hi(t){if(!t||typeof t!=="string")throw Error("Invalid glob pattern: must be a non-empty string");return t}function Ki(t){if(typeof t!=="string")throw TypeError("Invalid source code: must be a string");return t}function qi(t){if(typeof t!=="string")throw TypeError("Invalid DTS content: must be a string");return t}function Ji(t){if(!t||typeof t!=="string")throw Error("Invalid module specifier: must be a non-empty string");return t}function Yi(t){if(!t||typeof t!=="string")throw Error("Invalid type name: must be a non-empty string");if(!["string","number","boolean","symbol","bigint","undefined","null","void","never","any","unknown","object"].includes(t)&&!/^[A-Z_$]/.test(t));return t}function Xi(t){if(!t||typeof t!=="string")throw Error("Invalid declaration name: must be a non-empty string");return t}function Zi(t){if(!t||typeof t!=="string")throw Error("Invalid absolute path: must be a non-empty string");if(!t.startsWith("/")&&!/^[A-Z]:/i.test(t))throw Error("Invalid absolute path: must start with / or drive letter");return t}function Qi(t){if(!t||typeof t!=="string")throw Error("Invalid relative path: must be a non-empty string");if(t.startsWith("/")||/^[A-Z]:/i.test(t))throw Error("Invalid relative path: must not be absolute");return t}function es(t){if(typeof t!=="string")throw TypeError("Invalid JSON string: must be a string");try{JSON.parse(t)}catch{throw Error("Invalid JSON string: must be valid JSON")}return t}function ts(t,r){return typeof t==="string"||typeof t==="number"}function ns(t){return t}var rs={join(t,...r){return o(t,...r)},dirname(t){return n(t)},basename(t){return e(t)},resolve(...t){return s(...t)},isAbsolute(t){return i(t)},relative(t,r){return a(t,r)}};
3
+ export{Ui,zi,Hi,Ki,qi,Ji,Yi,Xi,Zi,Qi,es,ts,ns,rs};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- var a={debug:0,info:1,warn:2,error:3,silent:4},i="info",u="[dtsx]",L=!1,l=null;function t(o){return a[o]>=a[i]}function d(){if(!L)return"";return`[${new Date().toISOString().slice(11,23)}] `}function v(o,s){let n=d();if(o||n)return[`${n}${o}`,...s];return s}function g(o,s,n){let r=v(s,n);if(l){l(o,...r);return}switch(o){case"debug":console.debug(...r);break;case"info":console.log(...r);break;case"warn":console.warn(...r);break;case"error":console.error(...r);break}}function c(o){return{debug:(...n)=>{if(t("debug"))g("debug",o,n)},info:(...n)=>{if(t("info"))g("info",o,n)},warn:(...n)=>{if(t("warn"))g("warn",o,n)},error:(...n)=>{if(t("error"))g("error",o,n)},setLevel:(n)=>{i=n},getLevel:()=>i,child:(n)=>{let r=o?`${o}:${n}`:`[${n}]`;return c(r)},time:(n)=>{let r=performance.now();return()=>{let f=performance.now()-r;if(t("debug"))g("debug",o,[`${n}: ${f.toFixed(2)}ms`])}},progress:(n)=>{if(t("info"))if(typeof process<"u"&&process.stdout?.isTTY)process.stdout.write(`\r${o} ${n}`);else g("info",o,[n])}}}function ua(o={}){if(o.level)i=o.level;if(o.prefix!==void 0)u=o.prefix;if(o.timestamps!==void 0)L=o.timestamps;if(o.output)l=o.output;return c(u)}var e=c(u);function fa(o){return e.child(o)}function A(o){i=o}function da(){return i}function pa(o){u=o}function ma(o){L=o}var Ei={debug:()=>{},info:()=>{},warn:()=>{},error:()=>{},setLevel:()=>{},getLevel:()=>"silent",child:()=>Ei,time:()=>()=>{},progress:()=>{}};
3
- export{ua,e,fa,A,da,pa,ma,Ei};
2
+ var a={debug:0,info:1,warn:2,error:3,silent:4},i="info",u="[dtsx]",L=!1,l=null;function t(o){return a[o]>=a[i]}function d(){if(!L)return"";return`[${new Date().toISOString().slice(11,23)}] `}function v(o,s){let n=d();if(o||n)return[`${n}${o}`,...s];return s}function g(o,s,n){let r=v(s,n);if(l){l(o,...r);return}switch(o){case"debug":console.debug(...r);break;case"info":console.log(...r);break;case"warn":console.warn(...r);break;case"error":console.error(...r);break}}function c(o){return{debug:(...n)=>{if(t("debug"))g("debug",o,n)},info:(...n)=>{if(t("info"))g("info",o,n)},warn:(...n)=>{if(t("warn"))g("warn",o,n)},error:(...n)=>{if(t("error"))g("error",o,n)},setLevel:(n)=>{i=n},getLevel:()=>i,child:(n)=>{let r=o?`${o}:${n}`:`[${n}]`;return c(r)},time:(n)=>{let r=performance.now();return()=>{let f=performance.now()-r;if(t("debug"))g("debug",o,[`${n}: ${f.toFixed(2)}ms`])}},progress:(n)=>{if(t("info"))if(typeof process<"u"&&process.stdout?.isTTY)process.stdout.write(`\r${o} ${n}`);else g("info",o,[n])}}}function ga(o={}){if(o.level)i=o.level;if(o.prefix!==void 0)u=o.prefix;if(o.timestamps!==void 0)L=o.timestamps;if(o.output)l=o.output;return c(u)}var e=c(u);function ha(o){return e.child(o)}function M(o){i=o}function ya(){return i}function ba(o){u=o}function wa(o){L=o}var Di={debug:()=>{},info:()=>{},warn:()=>{},error:()=>{},setLevel:()=>{},getLevel:()=>"silent",child:()=>Di,time:()=>()=>{},progress:()=>{}};
3
+ export{ga,e,ha,M,ya,ba,wa,Di};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import{lstat as d,realpath as f,stat as T}from"fs/promises";import{isAbsolute as l,normalize as g,relative as p,resolve as u}from"path";var _={rootDir:process.cwd(),maxFileSize:10485760,maxTotalSize:104857600,timeout:30000,followSymlinks:!1,maxFiles:1e4,blockedPatterns:["**/.git/**","**/node_modules/**","**/.env*","**/secrets/**","**/*.key","**/*.pem"]};class E extends Error{code;path;constructor(t,r,e){super(t);this.code=r;this.path=e;this.name="SecurityError"}}function Ye(t,r={}){let{rootDir:e=process.cwd()}=r,i=g(t),n=l(i)?i:u(e,i),o=u(n),s=p(e,o);if(s.startsWith("..")||l(s))throw new E(`Path traversal detected: "${t}" resolves outside root directory`,"PATH_TRAVERSAL",t);return o}function Jr(t,r={}){return t.map((e)=>Ye(e,r))}function gn(t,r={}){let e=r.blockedPatterns||_.blockedPatterns;for(let i of e)if(h(t,i))return!0;return!1}var m=new Map;function P(t){let r=m.get(t);if(r)return r;let e=t.replace(/\*\*/g,"<<GLOBSTAR>>").replace(/\*/g,"<<STAR>>").replace(/\?/g,"<<QUESTION>>");e=e.replace(/[.+^${}()|[\]\\]/g,"\\$&"),e=e.replace(/^<<GLOBSTAR>>\//,"(.*\\/)?"),e=e.replace(/\/<<GLOBSTAR>>$/,"(\\/.*)?"),e=e.replace(/\/<<GLOBSTAR>>\//g,"(\\/.*)?\\/"),e=e.replace(/<<GLOBSTAR>>/g,".*"),e=e.replace(/<<STAR>>/g,"[^/]*"),e=e.replace(/<<QUESTION>>/g,"[^/]");let i=new RegExp(`^${e}$`);return m.set(t,i),i}function h(t,r){let e=t.indexOf("\\")===-1?t:t.replace(/\\/g,"/");return P(r).test(e)}async function Yr(t,r={}){let e=r.maxFileSize??_.maxFileSize;try{let i=await T(t);if(i.size>e)throw new E(`File too large: "${t}" is ${a(i.size)}, max is ${a(e)}`,"FILE_TOO_LARGE",t);return i.size}catch(i){if(i instanceof E)throw i;throw new E(`Failed to check file size: ${t}`,"INVALID_PATH",t)}}async function Xr(t){try{return(await d(t)).isSymbolicLink()}catch{return!1}}async function Zr(t,r={}){let e=r.followSymlinks??_.followSymlinks;if(await Xr(t)){if(!e)throw new E(`Symbolic links not allowed: "${t}"`,"SYMLINK_NOT_ALLOWED",t);let i=await f(t);return Ye(i,r)}return t}async function vt(t,r={}){let e=Ye(t,r);if(gn(e,r))throw new E(`Path matches blocked pattern: "${t}"`,"BLOCKED_PATTERN",t);let i=await Zr(e,r),n=await Yr(i,r);return{path:i,size:n}}async function hn(t,r={}){let e=r.maxFiles??_.maxFiles,i=r.maxTotalSize??_.maxTotalSize;if(t.length>e)throw new E(`Too many files: ${t.length} exceeds maximum of ${e}`,"MAX_FILES_EXCEEDED");let n=[],o=0;for(let s of t){let c=await vt(s,r);if(n.push(c.path),o+=c.size,o>i)throw new E(`Total size exceeded: ${a(o)} exceeds maximum of ${a(i)}`,"TOTAL_SIZE_EXCEEDED")}return{paths:n,totalSize:o}}function St(t,r,e="Operation"){return new Promise((i,n)=>{let o=setTimeout(()=>{n(new E(`${e} timed out after ${r}ms`,"TIMEOUT"))},r);t.then((s)=>{clearTimeout(o),i(s)}).catch((s)=>{clearTimeout(o),n(s)})})}function Qr(t,r={}){let e=r.timeout??_.timeout;return async(i)=>{let{path:n}=await vt(i,r);return St(t(n),e,`Processing ${i}`)}}function so(t,r={}){let e=r.timeout??_.timeout;return async(i)=>{let{paths:n}=await hn(i,r);return St(t(n),e,`Processing ${i.length} files`)}}function oo(t){let r=t.replace(/\\/g,"/").replace(/\0/g,"").replace(/^\/+/,"").replace(/^[A-Z]:/i,""),e="";while(e!==r)e=r,r=r.replace(/\.\.\/|\.\.$/g,"").replace(/\/+/g,"/");return r.replace(/^\/+|\/+$/g,"")}function ao(t){if(t.includes("\x00"))return!1;if(g(t).includes(".."))return!1;if(l(t)&&!t.startsWith(process.cwd()))return!1;return!0}function a(t){if(t===0)return"0 B";let r=["B","KB","MB","GB"],e=1024,i=Math.floor(Math.log(t)/Math.log(e));return`${Number.parseFloat((t/e**i).toFixed(2))} ${r[i]}`}function co(t={}){let r={..._,...t};return{validatePath:(e)=>Ye(e,r),validatePaths:(e)=>Jr(e,r),validateFile:(e)=>vt(e,r),validateBatch:(e)=>hn(e,r),withTimeout:(e,i)=>St(e,r.timeout,i),secureProcessor:(e)=>Qr(e,r),isBlocked:(e)=>gn(e,r),getConfig:()=>r}}
3
+ export{_,E,Ye,Jr,gn,Yr,Xr,Zr,vt,hn,St,Qr,so,oo,ao,co};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{s}from"./chunk-ykrdzatr.js";class Ve{options;generateOptions;constructor(t={}){let{onCompile:r=!1,afterEmit:e=!0,onWatchRun:n=!1,onGenerated:o,onError:i,...a}=t;this.options={onCompile:r,afterEmit:e,onWatchRun:n,onGenerated:o,onError:i},this.generateOptions=a}apply(t){if(!this.generateOptions.outdir&&t.options.output?.path)this.generateOptions.outdir=t.options.output.path;if(!this.generateOptions.cwd&&t.options.context)this.generateOptions.cwd=t.options.context;if(!this.generateOptions.entrypoints&&t.options.entry){let e=t.options.entry;if(typeof e==="string")this.generateOptions.entrypoints=[e];else if(Array.isArray(e))this.generateOptions.entrypoints=e;else if(typeof e==="object"&&e!==null){let n=[];for(let o of Object.values(e))if(typeof o==="string")n.push(o);else if(Array.isArray(o))n.push(...o.filter((i)=>typeof i==="string"));else if(typeof o==="object"&&o!==null&&"import"in o){let i=o.import;if(typeof i==="string")n.push(i);else if(Array.isArray(i))n.push(...i)}if(n.length>0)this.generateOptions.entrypoints=n}}if(this.options.onCompile)t.hooks.compile.tap("DtsxWebpackPlugin",()=>{this.runGenerate()});if(this.options.afterEmit)t.hooks.afterEmit.tapAsync("DtsxWebpackPlugin",async(e,n)=>{await this.runGenerate(),n()});if(this.options.onWatchRun)t.hooks.watchRun.tapAsync("DtsxWebpackPlugin",async(e,n)=>{await this.runGenerate(),n()})}async runGenerate(){try{let t=await s(this.generateOptions);this.options.onGenerated?.(t)}catch(t){let r=t instanceof Error?t:Error(String(t));if(this.options.onError?.(r),!this.options.onError)console.error("[dtsx] Generation failed:",r.message)}}}function Vt(t={}){return new Ve(t)}var or=Vt,Pa=Ve;
3
- export{Ve,Vt,or,Pa};
2
+ import{s}from"./chunk-ehpz5rg3.js";class He{options;generateOptions;constructor(t={}){let{onCompile:r=!1,afterEmit:e=!0,onWatchRun:n=!1,onGenerated:o,onError:i,...a}=t;this.options={onCompile:r,afterEmit:e,onWatchRun:n,onGenerated:o,onError:i},this.generateOptions=a}apply(t){if(!this.generateOptions.outdir&&t.options.output?.path)this.generateOptions.outdir=t.options.output.path;if(!this.generateOptions.cwd&&t.options.context)this.generateOptions.cwd=t.options.context;if(!this.generateOptions.entrypoints&&t.options.entry){let e=t.options.entry;if(typeof e==="string")this.generateOptions.entrypoints=[e];else if(Array.isArray(e))this.generateOptions.entrypoints=e;else if(typeof e==="object"&&e!==null){let n=[];for(let o of Object.values(e))if(typeof o==="string")n.push(o);else if(Array.isArray(o))n.push(...o.filter((i)=>typeof i==="string"));else if(typeof o==="object"&&o!==null&&"import"in o){let i=o.import;if(typeof i==="string")n.push(i);else if(Array.isArray(i))n.push(...i)}if(n.length>0)this.generateOptions.entrypoints=n}}if(this.options.onCompile)t.hooks.compile.tap("DtsxWebpackPlugin",()=>{this.runGenerate()});if(this.options.afterEmit)t.hooks.afterEmit.tapAsync("DtsxWebpackPlugin",async(e,n)=>{await this.runGenerate(),n()});if(this.options.onWatchRun)t.hooks.watchRun.tapAsync("DtsxWebpackPlugin",async(e,n)=>{await this.runGenerate(),n()})}async runGenerate(){try{let t=await s(this.generateOptions);this.options.onGenerated?.(t)}catch(t){let r=t instanceof Error?t:Error(String(t));if(this.options.onError?.(r),!this.options.onError)console.error("[dtsx] Generation failed:",r.message)}}}function qt(t={}){return new He(t)}var ur=qt,Ta=He;
3
+ export{He,qt,ur,Ta};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{W}from"./chunk-k5wz43yh.js";import{p}from"./chunk-v6fwy63g.js";var f=100,c=new Map,a=new Map,u=new Map,g=0;function d(e,n,t){let r={fileName:e,text:n};c.delete(e),c.set(e,{file:r,hash:t});while(c.size>f){let s=c.keys().next().value;if(s===void 0)break;c.delete(s)}return r}function b(e,n,t){return u.set(e,(u.get(e)??0)+1),d(e,n,t)}function Ft(e,n,t=p(n)){let r=c.get(e);if(r?.hash===t)return c.delete(e),c.set(e,r),r.file;return b(e,n,t)}async function ie(e,n,t={}){let r=p(n);if(c.get(e)?.hash===r)return Ft(e,n,r);let o=`${e}\x00${String(r)}`,i=a.get(o);if(i)return i;let h=(u.get(e)??0)+1;u.set(e,h);let m=g,l;return l=Promise.resolve().then(async()=>{try{if(n.length>=(t.asyncThreshold??1e5))await new Promise((y)=>setTimeout(y,Math.max(0,t.yieldInterval??0)));if(m===g&&u.get(e)===h)return d(e,n,r);return{fileName:e,text:n}}finally{if(a.get(o)===l)a.delete(o)}}),a.set(o,l),l}async function Ln(e,n={}){let t=new Map,r=W(n.concurrency,4);for(let s=0;s<e.length;s+=r){let o=await Promise.all(e.slice(s,s+r).map(async(i)=>({path:i.filePath,file:await ie(i.filePath,i.sourceCode,n)})));for(let i of o)t.set(i.path,i.file)}return t}function Fn(){g++,c.clear(),a.clear(),u.clear()}function Nn(){return c.size}function Bn(){return a.size}function Wn(e,n={}){return e.length>=(n.asyncThreshold??1e5)}
3
- export{Ft,ie,Ln,Fn,Nn,Bn,Wn};
2
+ import{G}from"./chunk-srfpcjtn.js";import{p}from"./chunk-v6fwy63g.js";var f=100,c=new Map,a=new Map,u=new Map,g=0;function d(e,n,t){let r={fileName:e,text:n};c.delete(e),c.set(e,{file:r,hash:t});while(c.size>f){let s=c.keys().next().value;if(s===void 0)break;c.delete(s)}return r}function b(e,n,t){return u.set(e,(u.get(e)??0)+1),d(e,n,t)}function _t(e,n,t=p(n)){let r=c.get(e);if(r?.hash===t)return c.delete(e),c.set(e,r),r.file;return b(e,n,t)}async function ue(e,n,t={}){let r=p(n);if(c.get(e)?.hash===r)return _t(e,n,r);let o=`${e}\x00${String(r)}`,i=a.get(o);if(i)return i;let h=(u.get(e)??0)+1;u.set(e,h);let m=g,l;return l=Promise.resolve().then(async()=>{try{if(n.length>=(t.asyncThreshold??1e5))await new Promise((y)=>setTimeout(y,Math.max(0,t.yieldInterval??0)));if(m===g&&u.get(e)===h)return d(e,n,r);return{fileName:e,text:n}}finally{if(a.get(o)===l)a.delete(o)}}),a.set(o,l),l}async function _n(e,n={}){let t=new Map,r=G(n.concurrency,4);for(let s=0;s<e.length;s+=r){let o=await Promise.all(e.slice(s,s+r).map(async(i)=>({path:i.filePath,file:await ue(i.filePath,i.sourceCode,n)})));for(let i of o)t.set(i.path,i.file)}return t}function jn(){g++,c.clear(),a.clear(),u.clear()}function Gn(){return c.size}function Vn(){return a.size}function Un(e,n={}){return e.length>=(n.asyncThreshold??1e5)}
3
+ export{_t,ue,_n,jn,Gn,Vn,Un};
@@ -1,8 +1,8 @@
1
1
  // @bun
2
- import{An}from"./chunk-ptbd3dac.js";var g=new Set(["This","True","False","Null","Undefined","Void","Never","Any","Unknown","Object","Infinity","NaN"]);function f(e,o={strings:!0}){let c="",n=0;while(n<e.length){let t=e.slice(n,n+2);if(t==="//"){let s=e.indexOf(`
2
+ import{On}from"./chunk-dhzr60ge.js";var g=new Set(["This","True","False","Null","Undefined","Void","Never","Any","Unknown","Object","Infinity","NaN"]);function f(e,o={strings:!0}){let c="",n=0;while(n<e.length){let t=e.slice(n,n+2);if(t==="//"){let s=e.indexOf(`
3
3
  `,n),a=s===-1?e.length:s;c+=" ".repeat(a-n),n=a;continue}if(t==="/*"){let s=e.indexOf("*/",n+2),a=s===-1?e.length:s+2;for(let r=n;r<a;r++)c+=e[r]===`
4
4
  `?`
5
5
  `:" ";n=a;continue}let i=e[n];if(o.strings&&(i==='"'||i==="'"||i==="`")){let s=i;c+=" ",n++;while(n<e.length){if(e[n]==="\\"){c+=" ",n+=2;continue}if(e[n]===s){c+=" ",n++;break}c+=e[n]===`
6
6
  `?`
7
- `:" ",n++}continue}c+=i,n++}return c}function m(e){let o=new Set,c=[/\b(?:export\s+)?(?:declare\s+)?(?:abstract\s+)?(?:type|interface|class|enum|namespace|module)\s+([A-Za-z_$][\w$]*)/g,/\b(?:export\s+)?(?:declare\s+)?(?:async\s+)?function\s*\*?\s*([A-Za-z_$][\w$]*)/g,/\b(?:export\s+)?declare\s+(?:const|let|var)\s+([A-Za-z_$][\w$]*)/g];for(let n of c)for(let t of e.matchAll(n))o.add(t[1]);return o}function d(e){let o=new Set;for(let c of e.matchAll(/\bimport\s+(?:type\s+)?([\s\S]*?)\s+from\s*['"`]/g)){let n=c[1],t=/\*\s*as\s+([A-Za-z_$][\w$]*)/.exec(n);if(t)o.add(t[1]);let i=n.split("{")[0].replace(/\*\s*as\s+[A-Za-z_$][\w$]*/,"");for(let a of i.split(",")){let r=a.trim();if(/^[A-Za-z_$][\w$]*$/.test(r))o.add(r)}let s=/\{([\s\S]*?)\}/.exec(n);if(s)for(let a of s[1].split(",")){let r=a.trim().replace(/^type\s+/,"");if(!r)continue;let l=/\bas\s+([A-Za-z_$][\w$]*)$/.exec(r);o.add(l?l[1]:r.split(/\s+/)[0])}}for(let c of e.matchAll(/\bimport\s*\(\s*['"`][^'"`]*['"`]\s*\)\s*\.\s*([A-Za-z_$][\w$]*)/g))o.add(c[1]);return o}function p(e){let o=new Set,c=(t)=>{for(let i of t.split(",")){let s=i.trim().split(/\s+|=/)[0]?.trim();if(s&&/^[A-Za-z_$][\w$]*$/.test(s))o.add(s)}},n=/\b(?:type|interface|class|function)\s+[A-Za-z_$][\w$]*\s*<([^<>]*(?:<[^<>]*>[^<>]*)*)>/g;for(let t of e.matchAll(n))c(t[1]);for(let t of e.matchAll(/(?:\b[A-Za-z_$][\w$]*)?\s*<([^<>()]*)>\s*\(/g))c(t[1]);for(let t of e.matchAll(/\binfer\s+([A-Za-z_$][\w$]*)/g))o.add(t[1]);for(let t of e.matchAll(/\[\s*([A-Za-z_$][\w$]*)\s+in\b/g))o.add(t[1]);return o}function h(e){let o=new Map,c=(t)=>{let i=1;for(let s=0;s<t&&s<e.length;s++)if(e.charCodeAt(s)===10)i++;return i},n=(t,i,s)=>{for(let a of t.matchAll(/\b([A-Z][\w$]*)\b/g)){let r=a[1];if(o.has(r))continue;let l=t.slice(a.index+r.length);if(/^\s*\??:/.test(l))continue;o.set(r,{line:c(i),context:s.trim().slice(0,120)})}};for(let t of e.matchAll(/\btype\s+[A-Za-z_$][\w$]*\s*(?:<[^=]*?>)?\s*=([^;]*)/g))n(t[1],t.index+t[0].indexOf("="),t[0]);for(let t of e.matchAll(/\b(?:extends|implements)\s+([^{;]*)/g))n(t[1],t.index,t[0]);for(let t of e.matchAll(/:\s*([^;,){}\n=]+)/g))n(t[1],t.index,t[0]);for(let t of e.matchAll(/<([^<>()]*)>/g))n(t[1],t.index,t[0]);return o}function Tn(e){let o=f(e),c=f(e,{strings:!1}),n=new Set([...m(o),...d(c),...p(o),...An,...g]),t=[];for(let[i,s]of h(o)){if(n.has(i))continue;if(new RegExp(`[\\w$]\\s*\\.\\s*${i}\\b`).test(o))continue;t.push({name:i,line:s.line,context:s.context})}return t.sort((i,s)=>i.line-s.line||i.name.localeCompare(s.name))}
8
- export{Tn};
7
+ `:" ",n++}continue}c+=i,n++}return c}function m(e){let o=new Set,c=[/\b(?:export\s+)?(?:declare\s+)?(?:abstract\s+)?(?:type|interface|class|enum|namespace|module)\s+([A-Za-z_$][\w$]*)/g,/\b(?:export\s+)?(?:declare\s+)?(?:async\s+)?function\s*\*?\s*([A-Za-z_$][\w$]*)/g,/\b(?:export\s+)?declare\s+(?:const|let|var)\s+([A-Za-z_$][\w$]*)/g];for(let n of c)for(let t of e.matchAll(n))o.add(t[1]);return o}function d(e){let o=new Set;for(let c of e.matchAll(/\bimport\s+(?:type\s+)?([\s\S]*?)\s+from\s*['"`]/g)){let n=c[1],t=/\*\s*as\s+([A-Za-z_$][\w$]*)/.exec(n);if(t)o.add(t[1]);let i=n.split("{")[0].replace(/\*\s*as\s+[A-Za-z_$][\w$]*/,"");for(let a of i.split(",")){let r=a.trim();if(/^[A-Za-z_$][\w$]*$/.test(r))o.add(r)}let s=/\{([\s\S]*?)\}/.exec(n);if(s)for(let a of s[1].split(",")){let r=a.trim().replace(/^type\s+/,"");if(!r)continue;let l=/\bas\s+([A-Za-z_$][\w$]*)$/.exec(r);o.add(l?l[1]:r.split(/\s+/)[0])}}for(let c of e.matchAll(/\bimport\s*\(\s*['"`][^'"`]*['"`]\s*\)\s*\.\s*([A-Za-z_$][\w$]*)/g))o.add(c[1]);return o}function p(e){let o=new Set,c=(t)=>{for(let i of t.split(",")){let s=i.trim().split(/\s+|=/)[0]?.trim();if(s&&/^[A-Za-z_$][\w$]*$/.test(s))o.add(s)}},n=/\b(?:type|interface|class|function)\s+[A-Za-z_$][\w$]*\s*<([^<>]*(?:<[^<>]*>[^<>]*)*)>/g;for(let t of e.matchAll(n))c(t[1]);for(let t of e.matchAll(/(?:\b[A-Za-z_$][\w$]*)?\s*<([^<>()]*)>\s*\(/g))c(t[1]);for(let t of e.matchAll(/\binfer\s+([A-Za-z_$][\w$]*)/g))o.add(t[1]);for(let t of e.matchAll(/\[\s*([A-Za-z_$][\w$]*)\s+in\b/g))o.add(t[1]);return o}function h(e){let o=new Map,c=(t)=>{let i=1;for(let s=0;s<t&&s<e.length;s++)if(e.charCodeAt(s)===10)i++;return i},n=(t,i,s)=>{for(let a of t.matchAll(/\b([A-Z][\w$]*)\b/g)){let r=a[1];if(o.has(r))continue;let l=t.slice(a.index+r.length);if(/^\s*\??:/.test(l))continue;o.set(r,{line:c(i),context:s.trim().slice(0,120)})}};for(let t of e.matchAll(/\btype\s+[A-Za-z_$][\w$]*\s*(?:<[^=]*?>)?\s*=([^;]*)/g))n(t[1],t.index+t[0].indexOf("="),t[0]);for(let t of e.matchAll(/\b(?:extends|implements)\s+([^{;]*)/g))n(t[1],t.index,t[0]);for(let t of e.matchAll(/:\s*([^;,){}\n=]+)/g))n(t[1],t.index,t[0]);for(let t of e.matchAll(/<([^<>()]*)>/g))n(t[1],t.index,t[0]);return o}function Mn(e){let o=f(e),c=f(e,{strings:!1}),n=new Set([...m(o),...d(c),...p(o),...On,...g]),t=[];for(let[i,s]of h(o)){if(n.has(i))continue;if(new RegExp(`[\\w$]\\s*\\.\\s*${i}\\b`).test(o))continue;t.push({name:i,line:s.line,context:s.context})}return t.sort((i,s)=>i.line-s.line||i.name.localeCompare(s.name))}
8
+ export{Mn};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{B}from"./chunk-waan03ga.js";import{k}from"./chunk-m2kzh519.js";import{Se,$e}from"./chunk-59jw51gg.js";import{createHash as x}from"crypto";import{readFile as d}from"fs/promises";import{resolve as m}from"path";async function Rn(g){let e={...B,...g},n=e.moduleSpecifierMode??"preserve";if(n!=="node"&&n!=="preserve")throw Error("moduleSpecifierMode must be preserve or node");if(e.plugins?.length)throw Error("Native project planning does not support generation plugins");let o=await Se(e),l=[];for(let r of o.files){let s=await d(r),a=s.toString("utf8");if(!Buffer.from(a,"utf8").equals(s))throw Error(`Native declaration source must be valid UTF-8: ${r}`);let u=o.outputBySource.get(r),v=$e(r,e,o.resolver),i=[],S=new Set(k(a,{includeImports:!0}).map((t)=>t.specifier));for(let t of S){let p=v(t);if(p.kind!=="local")continue;let{resolvedSource:h,declarationOutput:w,emittedSpecifier:y}=p;i.push({specifier:t,resolvedSource:h,declarationOutput:w,emittedSpecifier:y})}let c={version:1,moduleSpecifierMode:n,sourceFile:r,outputFile:u,sourceHash:x("sha256").update(s).digest("hex"),rewrites:i};if(!e.isolatedDeclarations&&i.length)c.inferenceSources=await Promise.all(i.map(async(t)=>({specifier:t.specifier,source:await d(t.resolvedSource,"utf8")})));let f=o.augmentationImports.get(r);if(f?.size)c.augmentationImports=[...f];l.push(Object.freeze({sourceFile:r,outputFile:u,source:a,context:c}))}return Object.freeze({version:1,rootPath:m(e.cwd,e.root),outdirPath:m(e.cwd,e.outdir),files:Object.freeze(l)})}
3
- export{Rn};
2
+ import{j}from"./chunk-yapmefw7.js";import{P}from"./chunk-jtq24yb8.js";import{Pe,De}from"./chunk-0nw1w523.js";import{createHash as x}from"crypto";import{readFile as d}from"fs/promises";import{resolve as m}from"path";async function Nn(g){let e={...j,...g},n=e.moduleSpecifierMode??"preserve";if(n!=="node"&&n!=="preserve")throw Error("moduleSpecifierMode must be preserve or node");if(e.plugins?.length)throw Error("Native project planning does not support generation plugins");let o=await Pe(e),l=[];for(let r of o.files){let s=await d(r),a=s.toString("utf8");if(!Buffer.from(a,"utf8").equals(s))throw Error(`Native declaration source must be valid UTF-8: ${r}`);let u=o.outputBySource.get(r),v=De(r,e,o.resolver),i=[],S=new Set(P(a,{includeImports:!0}).map((t)=>t.specifier));for(let t of S){let p=v(t);if(p.kind!=="local")continue;let{resolvedSource:h,declarationOutput:w,emittedSpecifier:y}=p;i.push({specifier:t,resolvedSource:h,declarationOutput:w,emittedSpecifier:y})}let c={version:1,moduleSpecifierMode:n,sourceFile:r,outputFile:u,sourceHash:x("sha256").update(s).digest("hex"),rewrites:i};if(!e.isolatedDeclarations&&i.length)c.inferenceSources=await Promise.all(i.map(async(t)=>({specifier:t.specifier,source:await d(t.resolvedSource,"utf8")})));let f=o.augmentationImports.get(r);if(f?.size)c.augmentationImports=[...f];l.push(Object.freeze({sourceFile:r,outputFile:u,source:a,context:c}))}return Object.freeze({version:1,rootPath:m(e.cwd,e.root),outdirPath:m(e.cwd,e.outdir),files:Object.freeze(l)})}
3
+ export{Nn};
@@ -14,5 +14,5 @@ var d=null,m=null;async function P(){if(d!==null)return d;try{return m=await imp
14
14
  `),s=[],a=[],i=!1,u=0;for(let o=0;o<n.length;o++){let t=n[o],p=t.match(/^(import\s+(?:type\s+)?.*from\s+['"])([^'"]+)(['"].*)$/);if(p){i=!0,u=o;let c=p[1];s.push({line:t,source:p[2],isType:c.startsWith("import type ")||c.startsWith("import type\t")})}else if(i&&t.trim()==="")continue;else{if(i)i=!1;a.push(t)}}if(s.length===0)return r;if(e.sort)s.sort((o,t)=>{if(o.isType!==t.isType)return o.isType?1:-1;return M(o.source,t.source)});let l;if(e.group){let o=[],t=[],p=[],c=[],b=[];for(let f=0;f<s.length;f++){let g=s[f],h=g.source;if(h.charCodeAt(0)===46)b.push(g);else if(h.startsWith("node:"))o.push(g);else if(h.charCodeAt(0)===64)c.push(g);else if(h.includes("/"))p.push(g);else t.push(g)}l=[...o.map((f)=>f.line),...o.length>0&&t.length>0?[""]:[],...t.map((f)=>f.line),...(o.length>0||t.length>0)&&p.length>0?[""]:[],...p.map((f)=>f.line),...c.length>0&&(o.length>0||t.length>0||p.length>0)?[""]:[],...c.map((f)=>f.line),...b.length>0?[""]:[],...b.map((f)=>f.line)]}else l=s.map((o)=>o.line);return[...l,"",...a].join(`
15
15
  `)}function M(r,e){let n=r.startsWith("node:"),s=e.startsWith("node:");if(n!==s)return n?-1:1;let a=r.startsWith("."),i=e.startsWith(".");if(a!==i)return a?1:-1;return r.localeCompare(e)}function W(r,e,n){let s=r.split(`
16
16
  `),a=[];for(let i of s){if(i.length<=e){a.push(i);continue}if(i.trimStart().startsWith("import ")){a.push(i);continue}let u=i.match(/^(\s*)/)?.[1]||"",l=u+n,o=O(i,u,l);if(o){a.push(...o);continue}if(i.includes("{")&&i.includes("}")){let t=v(i,e,u,l);a.push(...t);continue}if(i.includes(" | ")){let t=R(i,e,u,l);a.push(...t);continue}a.push(i)}return a.join(`
17
- `)}var F=/^\s*(export|import)(\s+type)?\s*\{([^{}]*)\}\s*(from\s*(?:'[^']*'|"[^"]*")(?:\s*(?:with|assert)\s*\{[^{}]*\})?)?\s*;?\s*$/;function O(r,e,n){let s=r.match(F);if(!s)return null;let[,a,i,u,l]=s,o=u.split(",").map((c)=>c.trim()).filter(Boolean);if(o.length<=1)return[r];let t=`${e}${a}${i??""} {`,p=l?`${e}} ${l};`:`${e}};`;return[t,...o.map((c)=>`${n}${c},`),p]}function v(r,e,n,s){let a=r.match(/^(\s*)(.*?)(\{)(.+)(\}.*)$/);if(!a)return[r];let[,,i,u,l,o]=a,t=l.split(/;\s*|,\s*/).filter((c)=>c.trim());if(t.length<=1)return[r];return[`${n}${i}${u}`,...t.map((c)=>`${s}${c.trim()};`),`${n}${o.trim()}`]}function R(r,e,n,s){let a=r.match(/^(\s*)(.*?=\s*)(.+)$/);if(!a)return[r];let[,,i,u]=a,l=u.split(/\s*\|\s*/).filter((t)=>t.trim());if(l.length<=2)return[r];return[`${n}${i}`,...l.map((t,p)=>`${s}${p>0?"| ":" "}${t.trim()}`)]}async function J(r,e={},n){let s=[];if(e.usePrettier!==!1){if(await P())try{let l={...await y(e.prettierConfigPath,n),...e.prettierOptions,parser:"typescript"};return{content:await w(r,l),usedPrettier:!0}}catch(u){s.push(`Prettier formatting failed: ${u}. Using built-in formatter.`)}else if(e.usePrettier===!0)s.push("Prettier requested but not available. Using built-in formatter.")}return{content:C(r,e.builtIn),usedPrettier:!1,warnings:s.length>0?s:void 0}}async function Qr(r,e={}){let n=new Map;for(let[s,a]of r){let i=await J(a,e,s);n.set(s,i)}return n}function co(r={}){return{format:(e,n)=>J(e,r,n),formatMany:(e)=>Qr(e,r)}}async function lo(r){return(await J(r,{usePrettier:!0,builtIn:{indentSize:2,normalizeWhitespace:!0,sortImports:!0,trailingNewline:!0}})).content}
18
- export{J,Qr,co,lo};
17
+ `)}var F=/^\s*(export|import)(\s+type)?\s*\{([^{}]*)\}\s*(from\s*(?:'[^']*'|"[^"]*")(?:\s*(?:with|assert)\s*\{[^{}]*\})?)?\s*;?\s*$/;function O(r,e,n){let s=r.match(F);if(!s)return null;let[,a,i,u,l]=s,o=u.split(",").map((c)=>c.trim()).filter(Boolean);if(o.length<=1)return[r];let t=`${e}${a}${i??""} {`,p=l?`${e}} ${l};`:`${e}};`;return[t,...o.map((c)=>`${n}${c},`),p]}function v(r,e,n,s){let a=r.match(/^(\s*)(.*?)(\{)(.+)(\}.*)$/);if(!a)return[r];let[,,i,u,l,o]=a,t=l.split(/;\s*|,\s*/).filter((c)=>c.trim());if(t.length<=1)return[r];return[`${n}${i}${u}`,...t.map((c)=>`${s}${c.trim()};`),`${n}${o.trim()}`]}function R(r,e,n,s){let a=r.match(/^(\s*)(.*?=\s*)(.+)$/);if(!a)return[r];let[,,i,u]=a,l=u.split(/\s*\|\s*/).filter((t)=>t.trim());if(l.length<=2)return[r];return[`${n}${i}`,...l.map((t,p)=>`${s}${p>0?"| ":" "}${t.trim()}`)]}async function te(r,e={},n){let s=[];if(e.usePrettier!==!1){if(await P())try{let l={...await y(e.prettierConfigPath,n),...e.prettierOptions,parser:"typescript"};return{content:await w(r,l),usedPrettier:!0}}catch(u){s.push(`Prettier formatting failed: ${u}. Using built-in formatter.`)}else if(e.usePrettier===!0)s.push("Prettier requested but not available. Using built-in formatter.")}return{content:C(r,e.builtIn),usedPrettier:!1,warnings:s.length>0?s:void 0}}async function ii(r,e={}){let n=new Map;for(let[s,a]of r){let i=await te(a,e,s);n.set(s,i)}return n}function mo(r={}){return{format:(e,n)=>te(e,r,n),formatMany:(e)=>ii(e,r)}}async function go(r){return(await te(r,{usePrettier:!0,builtIn:{indentSize:2,normalizeWhitespace:!0,sortImports:!0,trailingNewline:!0}})).content}
18
+ export{te,ii,mo,go};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- function W(n,r){let e=Number.isFinite(r)?Math.max(1,Math.floor(r)):1;if(n===void 0||!Number.isFinite(n))return e;return Math.max(1,Math.floor(n))}
3
- export{W};
2
+ function G(n,r){let e=Number.isFinite(r)?Math.max(1,Math.floor(r)):1;if(n===void 0||!Number.isFinite(n))return e;return Math.max(1,Math.floor(n))}
3
+ export{G};