@dtsx/dtsx 0.11.57 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (244) hide show
  1. package/dist/bin/cli.js +1 -1
  2. package/dist/{chunk-s9937pks.js → chunk-07c41ffx.js} +7 -7
  3. package/dist/{chunk-qhbdh4gy.js → chunk-0mj07j66.js} +3 -3
  4. package/dist/chunk-0zwa1tag.js +31 -0
  5. package/dist/chunk-16rpzfwq.js +10 -0
  6. package/dist/chunk-253e6nb4.js +3 -0
  7. package/dist/chunk-27hrxxsh.js +9 -0
  8. package/dist/{chunk-1b003vaa.js → chunk-27rxm6hh.js} +6 -6
  9. package/dist/chunk-30ffarqm.js +4 -0
  10. package/dist/{chunk-kqyqbrcv.js → chunk-37jcvx0v.js} +3 -3
  11. package/dist/chunk-44a6zpxs.js +3 -0
  12. package/dist/{chunk-xvp60m78.js → chunk-4ce9a877.js} +2 -2
  13. package/dist/{chunk-587w6ktw.js → chunk-4th0w19y.js} +3 -3
  14. package/dist/{chunk-mew3f4wh.js → chunk-50r5qs7t.js} +2 -2
  15. package/dist/chunk-5fgakmq9.js +3 -0
  16. package/dist/chunk-5tcpge5e.js +56 -0
  17. package/dist/{chunk-wmzg12wb.js → chunk-5vk2x8ee.js} +2 -2
  18. package/dist/{chunk-ered54kd.js → chunk-7116bytq.js} +8 -8
  19. package/dist/{chunk-hqytpz18.js → chunk-78ft65vf.js} +2 -2
  20. package/dist/{chunk-p023fhce.js → chunk-795w1bb2.js} +3 -3
  21. package/dist/chunk-7vjbc4z7.js +6 -0
  22. package/dist/chunk-85r70e8z.js +3 -0
  23. package/dist/chunk-8t9qp0mq.js +5 -0
  24. package/dist/chunk-9axwjcna.js +21 -0
  25. package/dist/{chunk-s3mxfatw.js → chunk-9wgk5qp1.js} +2 -2
  26. package/dist/{chunk-b1wmavr8.js → chunk-am4b9zt0.js} +3 -3
  27. package/dist/chunk-b5wcbnb8.js +9 -0
  28. package/dist/{chunk-ss3na6s0.js → chunk-bd048mjd.js} +2 -2
  29. package/dist/chunk-be7f8t6b.js +3 -0
  30. package/dist/chunk-bwb12r8r.js +3 -0
  31. package/dist/chunk-cb5dj4qy.js +3 -0
  32. package/dist/chunk-chj3hn6f.js +3 -0
  33. package/dist/chunk-cnb2rfmv.js +21 -0
  34. package/dist/{chunk-jb43rwce.js → chunk-cs6538bw.js} +2 -2
  35. package/dist/chunk-d99qykzn.js +6 -0
  36. package/dist/{chunk-31t6c3q1.js → chunk-e12f4mpd.js} +21 -21
  37. package/dist/chunk-e21ap86b.js +3 -0
  38. package/dist/{chunk-vs6ay4t3.js → chunk-ezhvnzja.js} +2 -2
  39. package/dist/chunk-fnd5bvfd.js +3 -0
  40. package/dist/chunk-fwqdc8fd.js +3 -0
  41. package/dist/{chunk-yd8rwwzf.js → chunk-gkfchhnr.js} +2 -2
  42. package/dist/chunk-h9gwg4kt.js +9 -0
  43. package/dist/chunk-hd2bq1j5.js +6 -0
  44. package/dist/{chunk-14zb70ca.js → chunk-hpdmtzhk.js} +3 -3
  45. package/dist/{chunk-v6fwy63g.js → chunk-j2bapmng.js} +2 -2
  46. package/dist/{chunk-aa3k6rcj.js → chunk-j41nnny5.js} +2 -2
  47. package/dist/{chunk-c094c8jt.js → chunk-j60x598n.js} +3 -3
  48. package/dist/{chunk-8z4tvwyd.js → chunk-javyer70.js} +2 -2
  49. package/dist/chunk-ke1h5m7f.js +5 -0
  50. package/dist/chunk-kp395d2p.js +44 -0
  51. package/dist/{chunk-naweq349.js → chunk-mzw42cv7.js} +2 -2
  52. package/dist/chunk-n2fm08w5.js +2 -0
  53. package/dist/chunk-n73yp5s4.js +6 -0
  54. package/dist/{chunk-zf6qpv30.js → chunk-ne7q6jf2.js} +2 -2
  55. package/dist/{chunk-srbye4cm.js → chunk-ngb87w7x.js} +7 -7
  56. package/dist/{chunk-6yvk3q1e.js → chunk-nnayqrp5.js} +2 -2
  57. package/dist/chunk-p15wwraa.js +3 -0
  58. package/dist/{chunk-q8dtn1qf.js → chunk-pb7p64tn.js} +2 -2
  59. package/dist/chunk-peg2exva.js +3 -0
  60. package/dist/chunk-pjrnfmwm.js +3 -0
  61. package/dist/{chunk-fnncnk59.js → chunk-pkmjprad.js} +4 -4
  62. package/dist/{chunk-k2axmtyh.js → chunk-pq6j9bkd.js} +5 -5
  63. package/dist/chunk-r1t34d75.js +3 -0
  64. package/dist/chunk-r48h4anw.js +3 -0
  65. package/dist/chunk-r6bagvr6.js +18 -0
  66. package/dist/chunk-rnm8937h.js +3 -0
  67. package/dist/chunk-rv597vq5.js +3 -0
  68. package/dist/chunk-s7d3d1wx.js +3 -0
  69. package/dist/{chunk-hnjv8zsq.js → chunk-sqhmhd08.js} +2 -2
  70. package/dist/{chunk-6bsft59m.js → chunk-t5x9cy8y.js} +5 -5
  71. package/dist/chunk-t9w6e58q.js +22 -0
  72. package/dist/chunk-v0gpmwh9.js +8 -0
  73. package/dist/{chunk-8j311f4n.js → chunk-ves5kf6r.js} +4 -4
  74. package/dist/{chunk-4rchw3mn.js → chunk-veys7ggd.js} +4 -4
  75. package/dist/chunk-vjmwxye4.js +3 -0
  76. package/dist/chunk-war78wdt.js +22 -0
  77. package/dist/chunk-wfkkp4tx.js +29 -0
  78. package/dist/{chunk-qg691xj0.js → chunk-x4pxkg7c.js} +4 -4
  79. package/dist/chunk-xrtfb38p.js +14 -0
  80. package/dist/chunk-xz57d151.js +3 -0
  81. package/dist/chunk-y7bcjjqd.js +3 -0
  82. package/dist/{chunk-5af6meh8.js → chunk-yfgm2ccr.js} +2 -2
  83. package/dist/{chunk-ysgfcqvf.js → chunk-yje9ebc0.js} +4 -4
  84. package/dist/chunk-yjkhep5n.js +3 -0
  85. package/dist/{chunk-ppybvpk4.js → chunk-ykxeeekb.js} +3 -3
  86. package/dist/{chunk-5egg62em.js → chunk-ypbjr2b6.js} +3 -3
  87. package/dist/src/augmentation-graph.js +1 -1
  88. package/dist/src/binding-patterns.js +1 -1
  89. package/dist/src/branded-types.js +1 -1
  90. package/dist/src/bundle-linker.d.ts +4 -2
  91. package/dist/src/bundle-linker.js +1 -1
  92. package/dist/src/bundler.js +1 -1
  93. package/dist/src/cache.js +1 -1
  94. package/dist/src/call-signatures.d.ts +2 -0
  95. package/dist/src/call-signatures.js +1 -1
  96. package/dist/src/circular.js +1 -1
  97. package/dist/src/compat.js +1 -1
  98. package/dist/src/computed-keys.js +1 -1
  99. package/dist/src/concurrency.js +1 -1
  100. package/dist/src/config.js +1 -1
  101. package/dist/src/dangling-refs.js +1 -1
  102. package/dist/src/declaration-project.d.ts +4 -2
  103. package/dist/src/declaration-project.js +1 -1
  104. package/dist/src/declaration-publication.d.ts +1 -1
  105. package/dist/src/declaration-publication.js +1 -1
  106. package/dist/src/declaration-references.js +1 -1
  107. package/dist/src/diff.js +1 -1
  108. package/dist/src/docs.js +1 -1
  109. package/dist/src/enum-declarations.js +1 -1
  110. package/dist/src/errors.js +1 -1
  111. package/dist/src/extractor/directives.js +1 -1
  112. package/dist/src/extractor/extract.js +1 -1
  113. package/dist/src/extractor/hash.js +1 -1
  114. package/dist/src/extractor/scanner.d.ts +2 -0
  115. package/dist/src/extractor/scanner.js +1 -1
  116. package/dist/src/extractor.js +1 -1
  117. package/dist/src/formats.js +1 -1
  118. package/dist/src/formatter.js +1 -1
  119. package/dist/src/function-properties.js +1 -1
  120. package/dist/src/generator.js +1 -1
  121. package/dist/src/global-types.js +1 -1
  122. package/dist/src/import-sorter.d.ts +6 -6
  123. package/dist/src/import-sorter.js +1 -1
  124. package/dist/src/incremental.js +1 -1
  125. package/dist/src/index.js +1 -1
  126. package/dist/src/inferred-imports.d.ts +5 -1
  127. package/dist/src/inferred-imports.js +1 -1
  128. package/dist/src/initializer-type-spans.js +1 -1
  129. package/dist/src/json-config.js +1 -1
  130. package/dist/src/lexical.d.ts +3 -0
  131. package/dist/src/lexical.js +1 -1
  132. package/dist/src/logger.js +1 -1
  133. package/dist/src/lsp.js +1 -1
  134. package/dist/src/memory.js +1 -1
  135. package/dist/src/merger.js +1 -1
  136. package/dist/src/module-graph.d.ts +9 -3
  137. package/dist/src/module-graph.js +1 -1
  138. package/dist/src/module-references.d.ts +2 -0
  139. package/dist/src/module-references.js +1 -1
  140. package/dist/src/native-checker.js +1 -1
  141. package/dist/src/native-engine.d.ts +24 -0
  142. package/dist/src/native-engine.js +1 -1
  143. package/dist/src/native-extractor.js +1 -1
  144. package/dist/src/native-generation.js +1 -1
  145. package/dist/src/native-project.js +1 -1
  146. package/dist/src/numeric-literals.js +1 -1
  147. package/dist/src/optimizer.js +1 -1
  148. package/dist/src/output-normalizer.d.ts +5 -5
  149. package/dist/src/output-normalizer.js +1 -1
  150. package/dist/src/parallel-processor.js +1 -1
  151. package/dist/src/parameters.js +1 -1
  152. package/dist/src/parser.js +1 -1
  153. package/dist/src/plugins/bun.js +1 -1
  154. package/dist/src/plugins/esbuild.js +1 -1
  155. package/dist/src/plugins/index.js +1 -1
  156. package/dist/src/plugins/tsdown.js +1 -1
  157. package/dist/src/plugins/tsup.js +1 -1
  158. package/dist/src/plugins/vite.js +1 -1
  159. package/dist/src/plugins/webpack.js +1 -1
  160. package/dist/src/plugins.d.ts +2 -0
  161. package/dist/src/plugins.js +1 -1
  162. package/dist/src/process-source.js +1 -1
  163. package/dist/src/processor/cache.js +1 -1
  164. package/dist/src/processor/comments.js +1 -1
  165. package/dist/src/processor/declarations.js +1 -1
  166. package/dist/src/processor/import-usage.js +1 -1
  167. package/dist/src/processor/imports.d.ts +3 -1
  168. package/dist/src/processor/imports.js +1 -1
  169. package/dist/src/processor/index.js +1 -1
  170. package/dist/src/processor/type-inference.d.ts +27 -7
  171. package/dist/src/processor/type-inference.js +1 -1
  172. package/dist/src/processor.js +1 -1
  173. package/dist/src/profiling.js +1 -1
  174. package/dist/src/return-type-scope.js +1 -1
  175. package/dist/src/security.js +1 -1
  176. package/dist/src/source-cache.js +1 -1
  177. package/dist/src/sourcemap.js +1 -1
  178. package/dist/src/stx.js +1 -1
  179. package/dist/src/syntax-validator.js +1 -1
  180. package/dist/src/tracking.js +1 -1
  181. package/dist/src/transformers.js +1 -1
  182. package/dist/src/tree-shaker.js +1 -1
  183. package/dist/src/tsconfig.js +1 -1
  184. package/dist/src/type-mappings.js +1 -1
  185. package/dist/src/utils.js +1 -1
  186. package/dist/src/value-inference.js +1 -1
  187. package/dist/src/vue.js +1 -1
  188. package/dist/src/watcher.js +1 -1
  189. package/dist/src/worker-thread.js +1 -1
  190. package/dist/src/worker.js +1 -1
  191. package/dist/src/workspace.js +1 -1
  192. package/native/darwin-arm64/libzig-dtsx.dylib +0 -0
  193. package/native/darwin-x64/libzig-dtsx.dylib +0 -0
  194. package/native/freebsd-x64/libzig-dtsx.so +0 -0
  195. package/native/linux-arm64/libzig-dtsx.so +0 -0
  196. package/native/linux-x64/libzig-dtsx.so +0 -0
  197. package/native/windows-x64/zig-dtsx.dll +0 -0
  198. package/package.json +1 -1
  199. package/dist/chunk-3phg2e1n.js +0 -3
  200. package/dist/chunk-4tk9w4ms.js +0 -2
  201. package/dist/chunk-59q0p96t.js +0 -3
  202. package/dist/chunk-5ncggctz.js +0 -3
  203. package/dist/chunk-5t69y2qj.js +0 -18
  204. package/dist/chunk-5zcampnz.js +0 -3
  205. package/dist/chunk-6m4fpfzj.js +0 -31
  206. package/dist/chunk-6mg1pbfj.js +0 -19
  207. package/dist/chunk-6rxhkcx0.js +0 -3
  208. package/dist/chunk-6vhzmpy0.js +0 -8
  209. package/dist/chunk-7061vwkq.js +0 -4
  210. package/dist/chunk-72txgcxc.js +0 -3
  211. package/dist/chunk-93jzvstf.js +0 -3
  212. package/dist/chunk-9hz32qxh.js +0 -3
  213. package/dist/chunk-a018gbxq.js +0 -6
  214. package/dist/chunk-abe0mchv.js +0 -6
  215. package/dist/chunk-ctpxwa1v.js +0 -3
  216. package/dist/chunk-dc6thsdb.js +0 -3
  217. package/dist/chunk-f27fd50q.js +0 -3
  218. package/dist/chunk-fcx6r0m1.js +0 -22
  219. package/dist/chunk-fpbcgcwd.js +0 -6
  220. package/dist/chunk-fxx9zbtq.js +0 -3
  221. package/dist/chunk-g2s10ehd.js +0 -8
  222. package/dist/chunk-gzjccs8y.js +0 -27
  223. package/dist/chunk-h3m1vfa2.js +0 -5
  224. package/dist/chunk-jhjj15ey.js +0 -38
  225. package/dist/chunk-mzpbqdd2.js +0 -10
  226. package/dist/chunk-n8044s0h.js +0 -3
  227. package/dist/chunk-qhsgmwcm.js +0 -3
  228. package/dist/chunk-qxkvzznc.js +0 -3
  229. package/dist/chunk-r7qq9579.js +0 -7
  230. package/dist/chunk-rb602c8k.js +0 -21
  231. package/dist/chunk-rcmdt2gs.js +0 -3
  232. package/dist/chunk-rzjj16rb.js +0 -9
  233. package/dist/chunk-s28gyv8z.js +0 -3
  234. package/dist/chunk-s5rja20d.js +0 -3
  235. package/dist/chunk-szxyqpfq.js +0 -3
  236. package/dist/chunk-try1hmvs.js +0 -3
  237. package/dist/chunk-vdt9x6h8.js +0 -29
  238. package/dist/chunk-vej5fnnp.js +0 -3
  239. package/dist/chunk-w482p1x8.js +0 -14
  240. package/dist/chunk-y18th8yp.js +0 -3
  241. package/dist/chunk-ynpxjf6d.js +0 -4
  242. package/dist/chunk-ywzc3ym6.js +0 -40
  243. package/dist/chunk-z03w2v8h.js +0 -3
  244. package/dist/chunk-zddtg858.js +0 -3
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import{l}from"./chunk-0zwa1tag.js";import w from"process";import{dirname as x,relative as y,resolve as B,sep as d}from"path";function Ye(p={}){let{preBuild:a=!1,postBuild:r=!0,onGenerated:n,onError:o,failOnError:E=!0,...e}=p,v=async(i)=>{try{let t=await l(i);n?.(t)}catch(t){let c=t instanceof Error?t:Error(String(t));if(o?.(c),!o)console.error("[dtsx] Generation failed:",c.message);if(E)throw c}};return{name:"dtsx",async setup(i){if(!a&&!r)return;let t=e.cwd||w.cwd(),u=(i.config.entrypoints||[]).map((s)=>B(t,s)),g=e.root||i.config.root||(u.length>0?y(t,G(u))||".":"./src"),f=B(t,g),m=e.entrypoints||u.filter((s)=>s===f||s.startsWith(`${f}${d}`)).map((s)=>y(f,s));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 a=p.map((n)=>x(n).split(d)),r=a[0];for(let n of a.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(d)||d}var Ya=Ye,Xa=Ye;
3
+ export{Ye,Ya,Xa};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{s}from"./chunk-6m4fpfzj.js";class qe{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 Jt(t={}){return new qe(t)}var pr=Jt,Fa=qe;
3
- export{qe,Jt,pr,Fa};
2
+ import{l}from"./chunk-0zwa1tag.js";class Qe{options;generateOptions;constructor(t={}){let{onCompile:s=!1,afterEmit:e=!0,onWatchRun:n=!1,onGenerated:o,onError:i,...r}=t;this.options={onCompile:s,afterEmit:e,onWatchRun:n,onGenerated:o,onError:i},this.generateOptions=r}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 l(this.generateOptions);this.options.onGenerated?.(t)}catch(t){let s=t instanceof Error?t:Error(String(t));if(this.options.onError?.(s),!this.options.onError)console.error("[dtsx] Generation failed:",s.message)}}}function ln(t={}){return new Qe(t)}var Or=ln,ec=Qe;
3
+ export{Qe,ln,Or,ec};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import{f}from"./chunk-b5wcbnb8.js";import{T}from"./chunk-cb5dj4qy.js";import{V}from"./chunk-5tcpge5e.js";function kn(n,r){let s=new Set;for(let c of V(n,"imports.ts",!1)){if(c.kind!=="import")continue;let i=T(c.text),d=i&&r.get(i.source);if(!i||i.isTypeOnly||!d)continue;let e=tt(d);for(let o of i.namedItems)if(!o.isTypeOnly&&e.some((l)=>l.name===o.originalName))s.add(o.name);if(i.defaultName&&e.some((o)=>o.isDefault))s.add(i.defaultName)}return s}function tt(n){if(!n.includes("function")||!n.includes("export"))return[];let r=f(n),s=new Map,c=[],i=0;for(let e=0;e<r.length;e++){let o=r[e],l=o.start,x=o.end-l;if(x===1&&o.kind==="punctuation"){let t=n.charCodeAt(l);if(t===123||t===40||t===91)i++;else if(t===125||t===41||t===93)i--;continue}if(i!==0||x!==8||o.kind!=="word"||n.slice(l,o.end)!=="function")continue;let g=r[e+1];if(g?.kind!=="word")continue;let k=n.slice(g.start,g.end);s.set(k,(s.get(k)??0)+1);let p=r[e+2];if(p&&p.kind==="punctuation"&&p.end-p.start===1&&n.charCodeAt(p.start)===60)continue;let h=!1,b=!1,a=e-1;while(a>=0){let t=r[a];if(t.kind!=="word")break;let m=t.end-t.start;if(m===5&&n.slice(t.start,t.end)==="async"){a--;continue}if(m===7&&n.slice(t.start,t.end)==="declare"){a--;continue}if(m===7&&n.slice(t.start,t.end)==="default"){b=!0,a--;continue}if(m===6&&n.slice(t.start,t.end)==="export"){let u=a>0?r[a-1]:void 0,y=u&&u.kind==="punctuation"&&u.end-u.start===1?n.charCodeAt(u.start):0;if(y!==46&&y!==58)h=!0;break}break}if(h)c.push({name:k,isDefault:b})}if(c.length===0)return[];let d=[];for(let e of c)if(s.get(e.name)===1)d.push(e);return d.sort((e,o)=>e.name.localeCompare(o.name))}
3
+ export{kn,tt};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import{Pr}from"./chunk-b5wcbnb8.js";import{N,j}from"./chunk-9axwjcna.js";import{I,_}from"./chunk-pq6j9bkd.js";import{g}from"./chunk-j2bapmng.js";import{V,U}from"./chunk-5tcpge5e.js";var y=100,p=0,e=new Map;function Be(n,s,c=!0,i=!1,l){if(N(s??""))n=j(n);else if(I(s??""))n=_(n);let f=g(n),m=JSON.stringify([s,c,i,[...l??[]].sort()]),a=e.get(m);if(a&&a.contentHash===f)return a.lastAccess=++p,a.declarations;let h=i?V(n,s,c):U(n,s,c,l);if(e.set(m,{declarations:h,contentHash:f,lastAccess:++p}),e.size>y){let S=Math.max(1,Math.ceil(e.size*0.1)),r=[];for(let[t,o]of e)r.push([t,o.lastAccess]);r.sort((t,o)=>t[1]-o[1]);for(let t=0;t<S&&t<r.length;t++)e.delete(r[t][0])}return h}function Ln(){e.clear(),Pr()}
3
+ export{Be,Ln};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{t}from"./chunk-r7qq9579.js";function C(n,o){if(o.kind!=="punctuation")return 0;let r=n.slice(o.start,o.end);if("([{<".includes(r))return 1;if(")]}".includes(r)||r===">"&&n[o.start-1]!=="=")return-1;return 0}function je(n){if(!n.includes("?"))return n;let o=n.trim(),r=o.startsWith("(")&&o.endsWith(")"),u=n.indexOf(o)+(r?1:0),s=r?o.slice(1,-1):o,a=[[]],h=0;for(let i of t(s)){if(i.kind==="punctuation"&&s[i.start]===","&&h===0)a.push([]);else a[a.length-1].push(i);h+=C(s,i)}let m=a.map((i)=>{let l=0,d=-1;for(let[D,A]of i.entries()){if(l===0&&A.kind==="punctuation"&&s[A.start]===":"){d=D;break}l+=C(s,A)}let f=d>0&&s[i[d-1].start]==="?"?i[d-1]:void 0,y=i[0]?s.slice(i[0].start,i[0].end):"",q=i[0]&&s.startsWith("...",i[0].start);return{tokens:i,colon:d,question:f,required:i.length>0&&!f&&!q&&y!=="this"}}),c=-1;for(let[i,l]of m.entries())if(l.required)c=i;let e=[];for(let[i,l]of m.entries()){if(i>=c||!l.question||l.colon<0)continue;let d=l.tokens[l.colon+1],f=l.tokens.at(-1);if(!d||!f)continue;e.push({start:u+l.question.start,end:u+l.question.end,text:""},{start:u+d.start,end:u+d.start,text:"("},{start:u+f.end,end:u+f.end,text:") | undefined"})}if(!e.length)return n;let g=[],p=0;for(let i of e)g.push(n.slice(p,i.start),i.text),p=i.end;return g.push(n.slice(p)),g.join("")}function x(n){return n>=65&&n<=90||n>=97&&n<=122||n===95||n===36}function k(n,o){if(o>=n.length||!x(n.charCodeAt(o)))return o;let r=o+1;while(r<n.length&&(x(n.charCodeAt(r))||n.charCodeAt(r)>=48&&n.charCodeAt(r)<=57))r++;return r}function b(n,o){let r=o;while(r<n.length&&n.charCodeAt(r)<=32)r++;return r}function we(n,o){if(o.trim()!=="{}")return null;let r=n.trim();if(r.length<2||r[0]!=="{"||r[r.length-1]!=="}")return null;let u=r.slice(1,-1),s=[],a=0,h=0;for(let c=0;c<u.length;c++){let e=u.charCodeAt(c);if(e===34||e===39||e===96){c++;while(c<u.length&&u.charCodeAt(c)!==e){if(u.charCodeAt(c)===92)c++;c++}if(c>=u.length)return null;continue}if(e===47&&(u.charCodeAt(c+1)===47||u.charCodeAt(c+1)===42))return null;if(e===40||e===91||e===123)a++;else if(e===41||e===93||e===125){if(--a<0)return null}else if(e===44&&a===0)s.push(u.slice(h,c)),h=c+1}if(a!==0)return null;if(u.slice(h).trim()||s.length===0)s.push(u.slice(h));let m=[];for(let c of s){let e=c.trim(),g=k(e,0);if(g===0)return null;let p=e.slice(0,g),i=p,l=b(e,g);if(e.charCodeAt(l)===58){let f=b(e,l+1),y=k(e,f);if(y===f)return null;i=e.slice(f,y),l=b(e,y)}if(e.charCodeAt(l)!==61||e.charCodeAt(l+1)===61||e.charCodeAt(l+1)===62)return null;let d=e.slice(l+1).trim();if(!d)return null;m.push({key:p,alias:i,value:d})}return m}function Ge(n,o){let r=n.map((s)=>s.key===s.alias?s.key:`${s.key}: ${s.alias}`).join(", "),u=n.map((s)=>{let a=o(s.value),h=a==="unknown"||a==="any"?a:`${a.includes("=>")?`(${a})`:a} | undefined`;return`${s.key}?: ${h}`}).join("; ");return`{ ${r} }?: { ${u} }`}
3
- export{je,we,Ge};
2
+ import{n}from"./chunk-b5wcbnb8.js";function C(t,o){if(o.kind!=="punctuation")return 0;let r=t.slice(o.start,o.end);if("([{<".includes(r))return 1;if(")]}".includes(r)||r===">"&&t[o.start-1]!=="=")return-1;return 0}function ze(t){if(!t.includes("?"))return t;let o=t.trim(),r=o.startsWith("(")&&o.endsWith(")"),u=t.indexOf(o)+(r?1:0),s=r?o.slice(1,-1):o,a=[[]],h=0;for(let i of n(s)){if(i.kind==="punctuation"&&s[i.start]===","&&h===0)a.push([]);else a[a.length-1].push(i);h+=C(s,i)}let m=a.map((i)=>{let l=0,d=-1;for(let[D,A]of i.entries()){if(l===0&&A.kind==="punctuation"&&s[A.start]===":"){d=D;break}l+=C(s,A)}let f=d>0&&s[i[d-1].start]==="?"?i[d-1]:void 0,y=i[0]?s.slice(i[0].start,i[0].end):"",q=i[0]&&s.startsWith("...",i[0].start);return{tokens:i,colon:d,question:f,required:i.length>0&&!f&&!q&&y!=="this"}}),c=-1;for(let[i,l]of m.entries())if(l.required)c=i;let e=[];for(let[i,l]of m.entries()){if(i>=c||!l.question||l.colon<0)continue;let d=l.tokens[l.colon+1],f=l.tokens.at(-1);if(!d||!f)continue;e.push({start:u+l.question.start,end:u+l.question.end,text:""},{start:u+d.start,end:u+d.start,text:"("},{start:u+f.end,end:u+f.end,text:") | undefined"})}if(!e.length)return t;let g=[],p=0;for(let i of e)g.push(t.slice(p,i.start),i.text),p=i.end;return g.push(t.slice(p)),g.join("")}function x(t){return t>=65&&t<=90||t>=97&&t<=122||t===95||t===36}function k(t,o){if(o>=t.length||!x(t.charCodeAt(o)))return o;let r=o+1;while(r<t.length&&(x(t.charCodeAt(r))||t.charCodeAt(r)>=48&&t.charCodeAt(r)<=57))r++;return r}function b(t,o){let r=o;while(r<t.length&&t.charCodeAt(r)<=32)r++;return r}function Ae(t,o){if(o.trim()!=="{}")return null;let r=t.trim();if(r.length<2||r[0]!=="{"||r[r.length-1]!=="}")return null;let u=r.slice(1,-1),s=[],a=0,h=0;for(let c=0;c<u.length;c++){let e=u.charCodeAt(c);if(e===34||e===39||e===96){c++;while(c<u.length&&u.charCodeAt(c)!==e){if(u.charCodeAt(c)===92)c++;c++}if(c>=u.length)return null;continue}if(e===47&&(u.charCodeAt(c+1)===47||u.charCodeAt(c+1)===42))return null;if(e===40||e===91||e===123)a++;else if(e===41||e===93||e===125){if(--a<0)return null}else if(e===44&&a===0)s.push(u.slice(h,c)),h=c+1}if(a!==0)return null;if(u.slice(h).trim()||s.length===0)s.push(u.slice(h));let m=[];for(let c of s){let e=c.trim(),g=k(e,0);if(g===0)return null;let p=e.slice(0,g),i=p,l=b(e,g);if(e.charCodeAt(l)===58){let f=b(e,l+1),y=k(e,f);if(y===f)return null;i=e.slice(f,y),l=b(e,y)}if(e.charCodeAt(l)!==61||e.charCodeAt(l+1)===61||e.charCodeAt(l+1)===62)return null;let d=e.slice(l+1).trim();if(!d)return null;m.push({key:p,alias:i,value:d})}return m}function He(t,o){let r=t.map((s)=>s.key===s.alias?s.key:`${s.key}: ${s.alias}`).join(", "),u=t.map((s)=>{let a=o(s.value),h=a==="unknown"||a==="any"?a:`${a.includes("=>")?`(${a})`:a} | undefined`;return`${s.key}?: ${h}`}).join("; ");return`{ ${r} }?: { ${u} }`}
3
+ export{ze,Ae,He};
@@ -0,0 +1,9 @@
1
+ // @bun
2
+ class Me{plugins=[];config=null;register(n){if(this.plugins.some((e)=>e.name===n.name))throw Error(`Plugin "${n.name}" is already registered`);this.plugins.push(n)}hasDeclarationHooks(){return this.plugins.some((n)=>n.onDeclarations!==void 0)}hasBeforeFileHooks(){return this.plugins.some((n)=>n.onBeforeFile!==void 0)}hasAfterFileHooks(){return this.plugins.some((n)=>n.onAfterFile!==void 0)}unregister(n){let e=this.plugins.findIndex((r)=>r.name===n);if(e>=0)return this.plugins.splice(e,1),!0;return!1}getPlugins(){return this.plugins}createLogger(n){return{debug:(e)=>console.debug(`[${n}] ${e}`),info:(e)=>console.info(`[${n}] ${e}`),warn:(e)=>console.warn(`[${n}] ${e}`),error:(e)=>console.error(`[${n}] ${e}`)}}async runOnStart(n){let e=n;for(let r of this.plugins)if(r.onStart){let t=await r.onStart(e);if(t)e=t}return this.config=e,e}async runOnBeforeFile(n,e){let r=e;for(let t of this.plugins)if(t.onBeforeFile){let i={filePath:n,sourceCode:e,content:r,config:this.config,log:this.createLogger(t.name)},o=await t.onBeforeFile(i);if(typeof o==="string")r=o}return r}async runOnDeclarations(n,e,r){let t=r;for(let i of this.plugins)if(i.onDeclarations){let o={filePath:n,sourceCode:e,declarations:t,config:this.config,log:this.createLogger(i.name)},s=await i.onDeclarations(o);if(s)t=s}return t}async runOnAfterFile(n,e,r){let t=r;for(let i of this.plugins)if(i.onAfterFile){let o={filePath:n,sourceCode:e,content:t,config:this.config,log:this.createLogger(i.name)},s=await i.onAfterFile(o);if(typeof s==="string")t=s}return t}async runOnEnd(n){for(let e of this.plugins)if(e.onEnd)await e.onEnd(n)}async runOnError(n,e,r){for(let t of this.plugins)if(t.onError){let i={filePath:e,sourceCode:r,config:this.config,log:this.createLogger(t.name)};await t.onError(n,i)}}}var bo=new Me;function de(n){return n}var wo=de({name:"strip-internal",version:"1.0.0",description:"Removes declarations marked with @internal",onDeclarations:(n)=>n.declarations.filter((e)=>{if(e.leadingComments){if(e.leadingComments.some((t)=>t.includes("@internal")))return n.log.debug(`Stripping internal declaration: ${e.name}`),!1}return!0})});function xo(n){return de({name:"banner",version:"1.0.0",description:"Adds a banner comment to generated files",onAfterFile:(e)=>`/**
3
+ * ${n.split(`
4
+ `).join(`
5
+ * `)}
6
+ */
7
+
8
+ `+e.content})}function Co(n){return de({name:"filter",version:"1.0.0",description:"Filters declarations by name",onDeclarations:(e)=>e.declarations.filter((r)=>{if(r.kind==="import")return!0;return n(r.name)})})}
9
+ export{Me,bo,de,wo,xo,Co};
@@ -0,0 +1,6 @@
1
+ // @bun
2
+ var di=[{pattern:/^Promise<void>$/,replacement:"Promise<void>",priority:-1},{pattern:/^Record<string,\s*any>$/,replacement:"Record<string, unknown>",priority:0},{pattern:/^Array<([^<>]+)>$/,replacement:"$1[]",priority:0}],pi=[{pattern:/\bany\b/,replacement:"unknown",global:!0,priority:10},{pattern:/^object$/,replacement:"Record<string, unknown>",priority:10},{pattern:/^Function$/,replacement:"(...args: unknown[]) => unknown",priority:10}],mi=[{pattern:/^(\w+)\[\]$/,replacement:"readonly $1[]",priority:5},{pattern:/^Array<(.+)>$/,replacement:"ReadonlyArray<$1>",priority:5},{pattern:/^Map<(.+),\s*(.+)>$/,replacement:"ReadonlyMap<$1, $2>",priority:5},{pattern:/^Set<(.+)>$/,replacement:"ReadonlySet<$1>",priority:5}],hi=[{pattern:/^Partial<Partial<(.+)>>$/,replacement:"Partial<$1>",priority:5},{pattern:/^Required<Required<(.+)>>$/,replacement:"Required<$1>",priority:5},{pattern:/^Pick<Omit<(.+),\s*(.+)>,\s*(.+)>$/,replacement:"Pick<$1, $3>",priority:5}];function gi(e){switch(e){case"strict":return pi;case"readonly":return mi;case"simplified":return hi;case"nullable":return[{pattern:/^(.+)\s*\|\s*undefined$/,replacement:"$1 | undefined",priority:5}];case"branded":return[{pattern:/^string$/,replacement:"string",condition:(r)=>r.declarationKind==="variable"&&(r.declarationName?.includes("path")??!1),priority:5}];default:return[]}}var h=/[.*+?^${}()|[\]\\]/g,f=2048;class En{rules;compiled=[];cache=new Map;constructor(e={rules:[]}){if(this.rules=[],e.includeDefaults!==!1)this.rules.push(...di);if(e.presets)for(let r of e.presets)this.rules.push(...gi(r));this.rules.push(...e.rules),this.rules.sort((r,p)=>(p.priority||0)-(r.priority||0)),this.recompile()}recompile(){let e=Array(this.rules.length);for(let r=0;r<this.rules.length;r++){let p=this.rules[r],s=typeof p.pattern==="string"?new RegExp(p.pattern.replace(h,"\\$&"),p.global?"g":""):p.global&&!p.pattern.global?new RegExp(p.pattern.source,`${p.pattern.flags}g`):p.pattern;e[r]={rule:p,regex:s}}this.compiled=e}map(e,r={}){let s=!r.declarationName&&!r.declarationKind&&!r.filePath&&!r.isReturnType&&!r.isParameterType&&!r.isPropertyType?e:`${e}\x00${r.declarationName??""}\x00${r.declarationKind??""}\x00${r.filePath??""}\x00${r.isReturnType?"r":""}${r.isParameterType?"p":""}${r.isPropertyType?"P":""}`,y=this.cache.get(s);if(y!==void 0)return y;let o=e,n=null;for(let l=0;l<this.compiled.length;l++){let{rule:a,regex:t}=this.compiled[l];if(a.condition){if(!n)n={type:e,...r};if(!a.condition(n))continue}if(t.lastIndex=0,t.test(o)){if(t.lastIndex=0,o=o.replace(t,a.replacement),t.lastIndex=0,!a.global)break}}if(this.cache.size>=f){let l=Math.ceil(f*0.1),a=0;for(let t of this.cache.keys()){if(a++>=l)break;this.cache.delete(t)}}return this.cache.set(s,o),o}mapAll(e,r={}){return e.map((p)=>this.map(p,{...r,type:p}))}addRule(e){this.rules.push(e),this.rules.sort((r,p)=>(p.priority||0)-(r.priority||0)),this.recompile(),this.cache.clear()}removeRules(e){let r=this.rules.length;return this.rules=this.rules.filter((p)=>{let s=typeof p.pattern==="string"?p.pattern:p.pattern.source;if(e instanceof RegExp)e.lastIndex=0;return typeof e==="string"?s!==e:!e.test(s)}),this.recompile(),this.cache.clear(),r-this.rules.length}clearCache(){this.cache.clear()}getRules(){return this.rules}}function ce(e={rules:[]}){return new En(e)}var to=ce({rules:[]}),no=ce({rules:[],presets:["strict"]});function kt(e,r,p={}){let s=e.length,y="",o=0,n=0;while(n<s){let l=e[n];if(l==="/"&&e[n+1]==="/"){let i=e.indexOf(`
3
+ `,n+2);n=i===-1?s:i+1;continue}if(l==="/"&&e[n+1]==="*"){let i=e.indexOf("*/",n+2);n=i===-1?s:i+2;continue}if(l==="'"||l==='"'||l==="`"){let i=l;n++;while(n<s){if(e[n]==="\\"){n+=2;continue}if(e[n]===i){n++;break}n++}continue}if(l!==":"){n++;continue}let a=n+1;while(a<s&&(e[a]===" "||e[a]==="\t"))a++;if(a>=s){n++;continue}if(e[a]==="{"){n=a+1;continue}let t=a,c=0;while(t<s){let i=e[t];if(i==="/"&&e[t+1]==="/"){if(c===0)break;let u=e.indexOf(`
4
+ `,t+2);t=u===-1?s:u+1;continue}if(i==="/"&&e[t+1]==="*"){let u=e.indexOf("*/",t+2);t=u===-1?s:u+2;continue}if(i==="'"||i==='"'||i==="`"){let u=i;t++;while(t<s){if(e[t]==="\\"){t+=2;continue}if(e[t]===u){t++;break}t++}continue}if(i==="("||i==="["||i==="{"||i==="<"){c++,t++;continue}if(i===")"||i==="]"||i==="}"){if(c===0)break;c--,t++;continue}if(i===">"&&e[t-1]!=="="){if(c>0)c--;t++;continue}if(c===0&&(i===";"||i===","||i===`
5
+ `||i==="\r"||i==="="&&e[t+1]!==">"))break;t++}let g=t;while(g>a&&(e[g-1]===" "||e[g-1]==="\t"))g--;if(g>a){let i=e.slice(a,g),u=r.map(i,p);y+=`${e.slice(o,n)}: ${u}`,o=g}n=t}return o===0?e:y+e.slice(o)}var ro={makeReadonly:(e)=>{if(e.endsWith("[]"))return`readonly ${e}`;if(e.startsWith("Array<"))return e.replace("Array<","ReadonlyArray<");return e},makeNullable:(e)=>{if(e.includes("| null")||e.includes("| undefined"))return e;return`${e} | null`},makeOptional:(e)=>{if(e.includes("| undefined"))return e;return`${e} | undefined`},makeRequired:(e)=>e.replace(/\s*\|\s*null/g,"").replace(/\s*\|\s*undefined/g,"").trim(),promisify:(e)=>{if(e.startsWith("Promise<"))return e;return`Promise<${e}>`},unpromisify:(e)=>{let r=e.match(/^Promise<(.+)>$/);return r?r[1]:e},arrayify:(e)=>{if(e.endsWith("[]")||e.startsWith("Array<"))return e;return`${e}[]`},unarrayify:(e)=>{if(e.endsWith("[]"))return e.slice(0,-2);let r=e.match(/^(?:Readonly)?Array<(.+)>$/);return r?r[1]:e}};
6
+ export{di,pi,mi,hi,gi,En,ce,to,no,kt,ro};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{r}from"./chunk-59q0p96t.js";import{existsSync as g,readFileSync as h,writeFileSync as b}from"fs";function d(t){let e=[],s=/\b([A-Z][a-zA-Z0-9]*)\b/g,o;while((o=s.exec(t))!==null){let i=o[1];if(!D(i))e.push(i)}return[...new Set(e)]}function D(t){return new Set(["Array","Object","String","Number","Boolean","Symbol","BigInt","Function","Promise","Map","Set","WeakMap","WeakSet","Date","RegExp","Error","TypeError","RangeError","SyntaxError","Partial","Required","Readonly","Pick","Omit","Record","Exclude","Extract","NonNullable","ReturnType","Parameters","ConstructorParameters","InstanceType","ThisType","Uppercase","Lowercase","Capitalize","Uncapitalize","Awaited","NoInfer","Generator","AsyncGenerator","IterableIterator","AsyncIterableIterator","PropertyKey","Iterable","AsyncIterable","ArrayLike","PromiseLike","ArrayBuffer","SharedArrayBuffer","DataView","Int8Array","Uint8Array","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"]).has(t)}function x(t){if(t.kind!=="type")return!1;let e=t.typeAnnotation||"";if(t.generics)return!1;if(e.includes("{")||e.includes("(")||e.includes("<"))return!1;return/^[\w\s|&]+$/.test(e)}function v(t){if(t.kind!=="interface")return!1;if(!t.members||t.members.length===0){if(!t.extends)return!0}return!1}function I(t,e){let s={...t,members:[...t.members||[],...e.members||[]],leadingComments:[...t.leadingComments||[],...e.leadingComments||[]]};if(t.extends&&e.extends){let o=t.extends.split(",").map((n)=>n.trim()),i=e.extends.split(",").map((n)=>n.trim());s.extends=[...new Set([...o,...i])].join(", ")}else s.extends=t.extends||e.extends;return s}function A(t){let e={import:0,interface:1,type:2,class:3,enum:4,function:5,variable:6,export:7};return[...t].sort((s,o)=>{let i=e[s.kind]??99,n=e[o.kind]??99;if(i!==n)return i-n;return s.name.localeCompare(o.name)})}function T(t){let e=[],s=[];for(let i=0;i<t.length;i++){let n=t[i];if(n.kind==="import")e.push(n);else s.push(n)}return[...[...e].sort((i,n)=>{let a=i.source||"",c=n.source||"",p=a.startsWith("node:")||a==="bun",m=c.startsWith("node:")||c==="bun";if(p&&!m)return-1;if(!p&&m)return 1;let l=!a.startsWith("."),u=!c.startsWith(".");if(l&&!u)return-1;if(!l&&u)return 1;return a.localeCompare(c)}),...s]}function S(t){let e=new Set;for(let i of t){if(i.kind==="import")continue;let n=i.text||"",a=i.typeAnnotation||"",c=i.returnType||"",p=i.extends||"",m=i.implements?.join(" ")||"",l=`${n} ${a} ${c} ${p} ${m}`;for(let u of d(l))e.add(u);if(i.members)for(let u of i.members){let f=`${u.typeAnnotation||""} ${u.returnType||""}`;for(let y of d(f))e.add(y)}if(i.parameters){for(let u of i.parameters)if(u.type)for(let f of d(u.type))e.add(f)}}let s=0;return{declarations:t.map((i)=>{if(i.kind!=="import"||!i.specifiers)return i;let n=i.specifiers.filter((a)=>{let c=a.alias||a.name;return e.has(c)});if(n.length===0){if(!i.isSideEffect)return s++,null}if(n.length<(i.specifiers?.length||0))return s+=(i.specifiers?.length||0)-n.length,{...i,specifiers:n};return i}).filter((i)=>i!==null),removed:s}}function k(t){let e=new Map,s=0;for(let o of t){if(o.kind==="import"){let n=`import:${o.source}`;if(e.has(n)){let a=e.get(n),c=[...a.specifiers||[],...o.specifiers||[]],p=Array.from(new Map(c.map((m)=>[m.alias||m.name,m])).values());e.set(n,{...a,specifiers:p}),s++}else e.set(n,o);continue}let i=`${o.kind}:${o.name}`;if(e.has(i))s++;else e.set(i,o)}return{declarations:Array.from(e.values()),removed:s}}function z(t){let e=new Map,s=[];for(let n of t)if(n.kind==="interface"){let a=n.name;if(!e.has(a))e.set(a,[]);e.get(a).push(n)}else s.push(n);let o=0,i=[];for(let[n,a]of e)if(a.length>1){let c=a[0];for(let p=1;p<a.length;p++)c=I(c,a[p]),o++;i.push(c)}else i.push(a[0]);return{declarations:[...s,...i],merged:o}}function w(t){let e=new Map,s=new Set;for(let n of t)if(x(n))e.set(n.name,n.typeAnnotation||""),s.add(n.name);if(e.size===0)return{declarations:t,inlined:0};function o(n){let a=n;for(let[c,p]of e){let m=new RegExp(`\\b${c}\\b`,"g");a=a.replace(m,p)}return a}return{declarations:t.filter((n)=>n.kind!=="type"||!s.has(n.name)).map((n)=>{if(n.typeAnnotation)n={...n,typeAnnotation:o(n.typeAnnotation)};if(n.returnType)n={...n,returnType:o(n.returnType)};if(n.extends)n={...n,extends:o(n.extends)};return n}),inlined:e.size}}function R(t){let e=t.length,s=t.filter((o)=>!v(o));return{declarations:s,removed:e-s.length}}function Mr(t,e={}){let s=[...t],o={originalSize:0,optimizedSize:0,savings:0,savingsPercent:0,removedImports:0,removedDeclarations:0,mergedInterfaces:0,inlinedTypes:0};if(e.removeUnusedImports){let{declarations:i,removed:n}=S(s);s=i,o.removedImports=n}if(e.deduplicateDeclarations){let{declarations:i,removed:n}=k(s);s=i,o.removedDeclarations+=n}if(e.mergeInterfaces){let{declarations:i,merged:n}=z(s);s=i,o.mergedInterfaces=n}if(e.removeEmptyInterfaces){let{declarations:i,removed:n}=R(s);s=i,o.removedDeclarations+=n}if(e.inlineSimpleTypes){let{declarations:i,inlined:n}=w(s);s=i,o.inlinedTypes=n}if(e.sortImports)s=T(s);if(e.sortDeclarations)s=A(s);return{declarations:s,result:o}}async function bs(t,e={}){if(!g(t))throw Error(`File not found: ${t}`);let s=h(t,"utf-8"),o=Buffer.byteLength(s,"utf-8"),i=r(s,t,!e.removeComments),{declarations:n,result:a}=Mr(i,e),c=C(n,e);if(e.minify)c=Or(c);let p=Buffer.byteLength(c,"utf-8");return a.originalSize=o,a.optimizedSize=p,a.savings=o-p,a.savingsPercent=Math.round(a.savings/o*100),b(t,c),a}function C(t,e){let s=[];for(let o of t){if(!e.removeComments&&o.leadingComments)for(let i of o.leadingComments)s.push(i);if(o.text)s.push(o.text);else s.push(E(o));s.push("")}return s.join(`
3
- `)}function E(t){let e=[];if(t.isExported)e.push("export");if(t.isDefault)e.push("default");switch(t.kind){case"import":if(t.isTypeOnly)e.push("import type");else e.push("import");if(t.specifiers&&t.specifiers.length>0){let s=t.specifiers.map((o)=>{let i=o.isType?"type ":"";return o.alias?`${i}${o.name} as ${o.alias}`:`${i}${o.name}`}).join(", ");e.push(`{ ${s} }`)}e.push("from"),e.push(`'${t.source}'`);break;case"function":if(e.push("declare function"),e.push(t.name),t.generics)e.push(t.generics);if(e.push(`(${B(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 s of t.members)e.push(` ${s.name}${s.typeAnnotation?`: ${s.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?.length)e.push(`implements ${t.implements.join(", ")}`);e.push("{ }");break;case"enum":e.push("declare enum"),e.push(t.name),e.push("{ }");break;default:return t.text||""}return e.join(" ")}function B(t){if(!t)return"";return t.map((e)=>{let s="";if(e.rest)s+="...";if(s+=e.name,e.optional)s+="?";if(e.type)s+=`: ${e.type}`;return s}).join(", ")}function Or(t){return t.replace(/(?<!\/\*\*)\/\/[^\n]*/g,"").replace(/^\s*[\r\n]/gm,"").replace(/ {2,}/g," ").replace(/\s*([{}[\]();,:])\s*/g,"$1").replace(/(\w)(\{)/g,"$1 $2").replace(/(\})([a-z])/gi,"$1 $2").replace(/(export|import|type|interface|class|function|const|let|var|extends|implements|declare)\s*/g,"$1 ").trim()}
4
- export{Mr,bs,Or};
2
+ import{s}from"./chunk-vjmwxye4.js";import{existsSync as g,readFileSync as h,writeFileSync as b}from"fs";function d(t){let e=[],r=/\b([A-Z][a-zA-Z0-9]*)\b/g,o;while((o=r.exec(t))!==null){let i=o[1];if(!D(i))e.push(i)}return[...new Set(e)]}function D(t){return new Set(["Array","Object","String","Number","Boolean","Symbol","BigInt","Function","Promise","Map","Set","WeakMap","WeakSet","Date","RegExp","Error","TypeError","RangeError","SyntaxError","Partial","Required","Readonly","Pick","Omit","Record","Exclude","Extract","NonNullable","ReturnType","Parameters","ConstructorParameters","InstanceType","ThisType","Uppercase","Lowercase","Capitalize","Uncapitalize","Awaited","NoInfer","Generator","AsyncGenerator","IterableIterator","AsyncIterableIterator","PropertyKey","Iterable","AsyncIterable","ArrayLike","PromiseLike","ArrayBuffer","SharedArrayBuffer","DataView","Int8Array","Uint8Array","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"]).has(t)}function x(t){if(t.kind!=="type")return!1;let e=t.typeAnnotation||"";if(t.generics)return!1;if(e.includes("{")||e.includes("(")||e.includes("<"))return!1;return/^[\w\s|&]+$/.test(e)}function v(t){if(t.kind!=="interface")return!1;if(!t.members||t.members.length===0){if(!t.extends)return!0}return!1}function I(t,e){let r={...t,members:[...t.members||[],...e.members||[]],leadingComments:[...t.leadingComments||[],...e.leadingComments||[]]};if(t.extends&&e.extends){let o=t.extends.split(",").map((n)=>n.trim()),i=e.extends.split(",").map((n)=>n.trim());r.extends=[...new Set([...o,...i])].join(", ")}else r.extends=t.extends||e.extends;return r}function A(t){let e={import:0,interface:1,type:2,class:3,enum:4,function:5,variable:6,export:7};return[...t].sort((r,o)=>{let i=e[r.kind]??99,n=e[o.kind]??99;if(i!==n)return i-n;return r.name.localeCompare(o.name)})}function T(t){let e=[],r=[];for(let i=0;i<t.length;i++){let n=t[i];if(n.kind==="import")e.push(n);else r.push(n)}return[...[...e].sort((i,n)=>{let a=i.source||"",c=n.source||"",p=a.startsWith("node:")||a==="bun",m=c.startsWith("node:")||c==="bun";if(p&&!m)return-1;if(!p&&m)return 1;let l=!a.startsWith("."),u=!c.startsWith(".");if(l&&!u)return-1;if(!l&&u)return 1;return a.localeCompare(c)}),...r]}function S(t){let e=new Set;for(let i of t){if(i.kind==="import")continue;let n=i.text||"",a=i.typeAnnotation||"",c=i.returnType||"",p=i.extends||"",m=i.implements?.join(" ")||"",l=`${n} ${a} ${c} ${p} ${m}`;for(let u of d(l))e.add(u);if(i.members)for(let u of i.members){let f=`${u.typeAnnotation||""} ${u.returnType||""}`;for(let y of d(f))e.add(y)}if(i.parameters){for(let u of i.parameters)if(u.type)for(let f of d(u.type))e.add(f)}}let r=0;return{declarations:t.map((i)=>{if(i.kind!=="import"||!i.specifiers)return i;let n=i.specifiers.filter((a)=>{let c=a.alias||a.name;return e.has(c)});if(n.length===0){if(!i.isSideEffect)return r++,null}if(n.length<(i.specifiers?.length||0))return r+=(i.specifiers?.length||0)-n.length,{...i,specifiers:n};return i}).filter((i)=>i!==null),removed:r}}function k(t){let e=new Map,r=0;for(let o of t){if(o.kind==="import"){let n=`import:${o.source}`;if(e.has(n)){let a=e.get(n),c=[...a.specifiers||[],...o.specifiers||[]],p=Array.from(new Map(c.map((m)=>[m.alias||m.name,m])).values());e.set(n,{...a,specifiers:p}),r++}else e.set(n,o);continue}let i=`${o.kind}:${o.name}`;if(e.has(i))r++;else e.set(i,o)}return{declarations:Array.from(e.values()),removed:r}}function z(t){let e=new Map,r=[];for(let n of t)if(n.kind==="interface"){let a=n.name;if(!e.has(a))e.set(a,[]);e.get(a).push(n)}else r.push(n);let o=0,i=[];for(let[n,a]of e)if(a.length>1){let c=a[0];for(let p=1;p<a.length;p++)c=I(c,a[p]),o++;i.push(c)}else i.push(a[0]);return{declarations:[...r,...i],merged:o}}function w(t){let e=new Map,r=new Set;for(let n of t)if(x(n))e.set(n.name,n.typeAnnotation||""),r.add(n.name);if(e.size===0)return{declarations:t,inlined:0};function o(n){let a=n;for(let[c,p]of e){let m=new RegExp(`\\b${c}\\b`,"g");a=a.replace(m,p)}return a}return{declarations:t.filter((n)=>n.kind!=="type"||!r.has(n.name)).map((n)=>{if(n.typeAnnotation)n={...n,typeAnnotation:o(n.typeAnnotation)};if(n.returnType)n={...n,returnType:o(n.returnType)};if(n.extends)n={...n,extends:o(n.extends)};return n}),inlined:e.size}}function R(t){let e=t.length,r=t.filter((o)=>!v(o));return{declarations:r,removed:e-r.length}}function Xr(t,e={}){let r=[...t],o={originalSize:0,optimizedSize:0,savings:0,savingsPercent:0,removedImports:0,removedDeclarations:0,mergedInterfaces:0,inlinedTypes:0};if(e.removeUnusedImports){let{declarations:i,removed:n}=S(r);r=i,o.removedImports=n}if(e.deduplicateDeclarations){let{declarations:i,removed:n}=k(r);r=i,o.removedDeclarations+=n}if(e.mergeInterfaces){let{declarations:i,merged:n}=z(r);r=i,o.mergedInterfaces=n}if(e.removeEmptyInterfaces){let{declarations:i,removed:n}=R(r);r=i,o.removedDeclarations+=n}if(e.inlineSimpleTypes){let{declarations:i,inlined:n}=w(r);r=i,o.inlinedTypes=n}if(e.sortImports)r=T(r);if(e.sortDeclarations)r=A(r);return{declarations:r,result:o}}async function Ls(t,e={}){if(!g(t))throw Error(`File not found: ${t}`);let r=h(t,"utf-8"),o=Buffer.byteLength(r,"utf-8"),i=s(r,t,!e.removeComments),{declarations:n,result:a}=Xr(i,e),c=C(n,e);if(e.minify)c=Qr(c);let p=Buffer.byteLength(c,"utf-8");return a.originalSize=o,a.optimizedSize=p,a.savings=o-p,a.savingsPercent=Math.round(a.savings/o*100),b(t,c),a}function C(t,e){let r=[];for(let o of t){if(!e.removeComments&&o.leadingComments)for(let i of o.leadingComments)r.push(i);if(o.text)r.push(o.text);else r.push(E(o));r.push("")}return r.join(`
3
+ `)}function E(t){let e=[];if(t.isExported)e.push("export");if(t.isDefault)e.push("default");switch(t.kind){case"import":if(t.isTypeOnly)e.push("import type");else e.push("import");if(t.specifiers&&t.specifiers.length>0){let r=t.specifiers.map((o)=>{let i=o.isType?"type ":"";return o.alias?`${i}${o.name} as ${o.alias}`:`${i}${o.name}`}).join(", ");e.push(`{ ${r} }`)}e.push("from"),e.push(`'${t.source}'`);break;case"function":if(e.push("declare function"),e.push(t.name),t.generics)e.push(t.generics);if(e.push(`(${B(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 r of t.members)e.push(` ${r.name}${r.typeAnnotation?`: ${r.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?.length)e.push(`implements ${t.implements.join(", ")}`);e.push("{ }");break;case"enum":e.push("declare enum"),e.push(t.name),e.push("{ }");break;default:return t.text||""}return e.join(" ")}function B(t){if(!t)return"";return t.map((e)=>{let r="";if(e.rest)r+="...";if(r+=e.name,e.optional)r+="?";if(e.type)r+=`: ${e.type}`;return r}).join(", ")}function Qr(t){return t.replace(/(?<!\/\*\*)\/\/[^\n]*/g,"").replace(/^\s*[\r\n]/gm,"").replace(/ {2,}/g," ").replace(/\s*([{}[\]();,:])\s*/g,"$1").replace(/(\w)(\{)/g,"$1 $2").replace(/(\})([a-z])/gi,"$1 $2").replace(/(export|import|type|interface|class|function|const|let|var|extends|implements|declare)\s*/g,"$1 ").trim()}
4
+ export{Xr,Ls,Qr};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- var s=typeof globalThis.Bun?.hash==="function";function p(n){if(s)return Bun.hash(n);let h=0;for(let t=0;t<n.length;t++){let r=n.charCodeAt(t);h=(h<<5)-h+r,h=h&h}return h}
3
- export{p};
2
+ var s=typeof globalThis.Bun?.hash==="function";function g(n){if(s)return Bun.hash(n);let h=0;for(let t=0;t<n.length;t++){let r=n.charCodeAt(t);h=(h<<5)-h+r,h=h&h}return h}
3
+ export{g};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- var r=/^\/\/\/\s*<reference\s+(?:path|types|lib|no-default-lib)\s*=\s*["'][^"']+["']\s*\/>/,E=/^\/\/\/\s*<amd-module\s+name\s*=\s*["'][^"']+["']\s*\/>/,f=/^\/\/\/\s*<amd-dependency\s+path\s*=\s*["'][^"']+["']/;function gn(t){let l=[],a=0;for(let e=0;e<=t.length;e++)if(e===t.length||t[e]===`
2
+ var r=/^\/\/\/\s*<reference\s+(?:path|types|lib|no-default-lib)\s*=\s*["'][^"']+["']\s*\/>/,E=/^\/\/\/\s*<amd-module\s+name\s*=\s*["'][^"']+["']\s*\/>/,f=/^\/\/\/\s*<amd-dependency\s+path\s*=\s*["'][^"']+["']/;function Dn(t){let l=[],a=0;for(let e=0;e<=t.length;e++)if(e===t.length||t[e]===`
3
3
  `){let n=a,i=e;while(n<i&&(t[n]===" "||t[n]==="\t"||t[n]==="\r"))n++;while(i>n&&(t[i-1]===" "||t[i-1]==="\t"||t[i-1]==="\r"))i--;let s=t.slice(n,i);if(a=e+1,s.startsWith("///")){if(s.indexOf("<")===-1)continue;if(r.test(s)||E.test(s)||f.test(s))l.push(s)}else if(s===""||s.startsWith("//"))continue;else break}return l}
4
- export{gn};
4
+ export{Dn};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{p}from"./chunk-v6fwy63g.js";import{createHash as g}from"crypto";import{mkdir as y,readFile as l,stat as m,writeFile as v}from"fs/promises";import{dirname as C,join as o}from"path";var c="1.0.0",b=".dtsx-cache",d="manifest.json";class $r{config;manifest=null;dirty=!1;stats={totalEntries:0,hits:0,misses:0,hitRatio:0,sizeBytes:0,timeSavedMs:0};constructor(t={}){this.config={enabled:t.enabled??!0,cacheDir:t.cacheDir??b,format:t.format??"json",maxAge:t.maxAge??86400000,force:t.force??!1,validateCache:t.validateCache??!0}}async init(){if(!this.config.enabled)return;try{await y(this.config.cacheDir,{recursive:!0}),await this.loadManifest()}catch{this.manifest={version:c,entries:{},createdAt:Date.now(),updatedAt:Date.now()}}}async loadManifest(){let t=o(this.config.cacheDir,d);try{let e=await l(t,"utf-8");if(this.manifest=JSON.parse(e),this.manifest.version!==c){await this.clear();return}this.stats.totalEntries=Object.keys(this.manifest.entries).length}catch{this.manifest={version:c,entries:{},createdAt:Date.now(),updatedAt:Date.now()}}}async save(){if(!this.config.enabled||!this.manifest||!this.dirty)return;let t=o(this.config.cacheDir,d);this.manifest.updatedAt=Date.now(),await v(t,JSON.stringify(this.manifest,null,2)),this.dirty=!1}async get(t,e){if(!this.config.enabled||!this.manifest||this.config.force)return this.stats.misses++,null;let s=this.manifest.entries[t];if(!s)return this.stats.misses++,null;if(s.configHash!==e)return this.stats.misses++,null;if(Date.now()-s.cachedAt>this.config.maxAge)return this.stats.misses++,delete this.manifest.entries[t],this.dirty=!0,null;if(this.config.validateCache)try{let a=(await m(t)).mtimeMs;if(a!==s.mtime){let i=await l(t,"utf-8");if(this.hashContent(i)!==s.hash)return this.stats.misses++,null;s.mtime=a,this.dirty=!0}}catch{return this.stats.misses++,delete this.manifest.entries[t],this.dirty=!0,null}if(s.dependencies.length>0){if((await Promise.all(s.dependencies.map(async(a)=>{let i=this.manifest.entries[a];if(!i)return!0;try{return(await m(a)).mtimeMs===i.mtime}catch{return!1}}))).some((a)=>!a))return this.stats.misses++,null}return this.stats.hits++,this.stats.timeSavedMs+=50,this.updateHitRatio(),s}async set(t,e,s,r,a,i){if(!this.config.enabled||!this.manifest)return;let n=Date.now();try{n=(await m(t)).mtimeMs}catch{}let h={filePath:t,hash:this.hashContent(e),mtime:n,declarations:s,dtsContent:r,dependencies:a,cachedAt:Date.now(),configHash:i};if(!(t in this.manifest.entries))this.stats.totalEntries++;this.manifest.entries[t]=h,this.dirty=!0}invalidate(t){if(!this.manifest)return;delete this.manifest.entries[t],this.dirty=!0;for(let[e,s]of Object.entries(this.manifest.entries))if(s.dependencies.includes(t))delete this.manifest.entries[e]}async clear(){this.manifest={version:c,entries:{},createdAt:Date.now(),updatedAt:Date.now()},this.stats={totalEntries:0,hits:0,misses:0,hitRatio:0,sizeBytes:0,timeSavedMs:0},this.dirty=!0,await this.save()}getStats(){return{...this.stats}}hashContent(t){return String(p(t))}updateHitRatio(){let t=this.stats.hits+this.stats.misses;this.stats.hitRatio=t>0?this.stats.hits/t:0}static hashConfig(t){let e={outdir:t.outdir,clean:t.clean,tsconfigPath:t.tsconfigPath};return g("sha256").update(JSON.stringify(e)).digest("hex").slice(0,16)}}function cs(t,e){let s=[],r=[],a=[];return{async needsRebuild(i){return await t.get(i,e)===null},async getCachedDeclarations(i){let n=await t.get(i,e);if(n)return r.push(i),n.declarations;return null},async getCachedDts(i){let n=await t.get(i,e);if(n)return n.dtsContent;return null},async cacheResult(i,n,h,u,f=[]){await t.set(i,n,h,u,f,e),s.push(i)},skip(i){a.push(i)},getResult(){return{rebuilt:s,cached:r,skipped:a,stats:t.getStats()}},async save(){await t.save()}}}async function ls(t,e=604800000){let s=t.getStats();if(s.totalEntries>1000)return await t.clear(),s.totalEntries;return 0}function us(t){let e=[];return e.push("Incremental Build Results:"),e.push(` Rebuilt: ${t.rebuilt.length} files`),e.push(` From cache: ${t.cached.length} files`),e.push(` Skipped: ${t.skipped.length} files`),e.push(""),e.push("Cache Statistics:"),e.push(` Total entries: ${t.stats.totalEntries}`),e.push(` Hit ratio: ${(t.stats.hitRatio*100).toFixed(1)}%`),e.push(` Time saved: ~${t.stats.timeSavedMs}ms`),e.join(`
3
- `)}function fs(t,e){let s=[],r=/import\s+(?:type\s+)?(?:.+(?:[\n\r\u2028\u2029]\s*|[\t\v\f \xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF])from\s+)?['"]([^'"]+)['"]/g,a;while((a=r.exec(t))!==null){let i=a[1];if(i.startsWith(".")){let n=o(C(e),i);s.push(n),s.push(`${n}.ts`),s.push(`${n}.tsx`),s.push(o(n,"index.ts")),s.push(o(n,"index.tsx"))}}return s}
4
- export{$r,cs,ls,us,fs};
2
+ import{g}from"./chunk-j2bapmng.js";import{createHash as p}from"crypto";import{mkdir as y,readFile as l,stat as m,writeFile as v}from"fs/promises";import{dirname as C,join as o}from"path";var c="1.0.0",b=".dtsx-cache",d="manifest.json";class Vr{config;manifest=null;dirty=!1;stats={totalEntries:0,hits:0,misses:0,hitRatio:0,sizeBytes:0,timeSavedMs:0};constructor(t={}){this.config={enabled:t.enabled??!0,cacheDir:t.cacheDir??b,format:t.format??"json",maxAge:t.maxAge??86400000,force:t.force??!1,validateCache:t.validateCache??!0}}async init(){if(!this.config.enabled)return;try{await y(this.config.cacheDir,{recursive:!0}),await this.loadManifest()}catch{this.manifest={version:c,entries:{},createdAt:Date.now(),updatedAt:Date.now()}}}async loadManifest(){let t=o(this.config.cacheDir,d);try{let e=await l(t,"utf-8");if(this.manifest=JSON.parse(e),this.manifest.version!==c){await this.clear();return}this.stats.totalEntries=Object.keys(this.manifest.entries).length}catch{this.manifest={version:c,entries:{},createdAt:Date.now(),updatedAt:Date.now()}}}async save(){if(!this.config.enabled||!this.manifest||!this.dirty)return;let t=o(this.config.cacheDir,d);this.manifest.updatedAt=Date.now(),await v(t,JSON.stringify(this.manifest,null,2)),this.dirty=!1}async get(t,e){if(!this.config.enabled||!this.manifest||this.config.force)return this.stats.misses++,null;let s=this.manifest.entries[t];if(!s)return this.stats.misses++,null;if(s.configHash!==e)return this.stats.misses++,null;if(Date.now()-s.cachedAt>this.config.maxAge)return this.stats.misses++,delete this.manifest.entries[t],this.dirty=!0,null;if(this.config.validateCache)try{let a=(await m(t)).mtimeMs;if(a!==s.mtime){let i=await l(t,"utf-8");if(this.hashContent(i)!==s.hash)return this.stats.misses++,null;s.mtime=a,this.dirty=!0}}catch{return this.stats.misses++,delete this.manifest.entries[t],this.dirty=!0,null}if(s.dependencies.length>0){if((await Promise.all(s.dependencies.map(async(a)=>{let i=this.manifest.entries[a];if(!i)return!0;try{return(await m(a)).mtimeMs===i.mtime}catch{return!1}}))).some((a)=>!a))return this.stats.misses++,null}return this.stats.hits++,this.stats.timeSavedMs+=50,this.updateHitRatio(),s}async set(t,e,s,r,a,i){if(!this.config.enabled||!this.manifest)return;let n=Date.now();try{n=(await m(t)).mtimeMs}catch{}let h={filePath:t,hash:this.hashContent(e),mtime:n,declarations:s,dtsContent:r,dependencies:a,cachedAt:Date.now(),configHash:i};if(!(t in this.manifest.entries))this.stats.totalEntries++;this.manifest.entries[t]=h,this.dirty=!0}invalidate(t){if(!this.manifest)return;delete this.manifest.entries[t],this.dirty=!0;for(let[e,s]of Object.entries(this.manifest.entries))if(s.dependencies.includes(t))delete this.manifest.entries[e]}async clear(){this.manifest={version:c,entries:{},createdAt:Date.now(),updatedAt:Date.now()},this.stats={totalEntries:0,hits:0,misses:0,hitRatio:0,sizeBytes:0,timeSavedMs:0},this.dirty=!0,await this.save()}getStats(){return{...this.stats}}hashContent(t){return String(g(t))}updateHitRatio(){let t=this.stats.hits+this.stats.misses;this.stats.hitRatio=t>0?this.stats.hits/t:0}static hashConfig(t){let e={outdir:t.outdir,clean:t.clean,tsconfigPath:t.tsconfigPath};return p("sha256").update(JSON.stringify(e)).digest("hex").slice(0,16)}}function As(t,e){let s=[],r=[],a=[];return{async needsRebuild(i){return await t.get(i,e)===null},async getCachedDeclarations(i){let n=await t.get(i,e);if(n)return r.push(i),n.declarations;return null},async getCachedDts(i){let n=await t.get(i,e);if(n)return n.dtsContent;return null},async cacheResult(i,n,h,u,f=[]){await t.set(i,n,h,u,f,e),s.push(i)},skip(i){a.push(i)},getResult(){return{rebuilt:s,cached:r,skipped:a,stats:t.getStats()}},async save(){await t.save()}}}async function Ts(t,e=604800000){let s=t.getStats();if(s.totalEntries>1000)return await t.clear(),s.totalEntries;return 0}function Ps(t){let e=[];return e.push("Incremental Build Results:"),e.push(` Rebuilt: ${t.rebuilt.length} files`),e.push(` From cache: ${t.cached.length} files`),e.push(` Skipped: ${t.skipped.length} files`),e.push(""),e.push("Cache Statistics:"),e.push(` Total entries: ${t.stats.totalEntries}`),e.push(` Hit ratio: ${(t.stats.hitRatio*100).toFixed(1)}%`),e.push(` Time saved: ~${t.stats.timeSavedMs}ms`),e.join(`
3
+ `)}function Ds(t,e){let s=[],r=/import\s+(?:type\s+)?(?:.+(?:[\n\r\u2028\u2029]\s*|[\t\v\f \xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF])from\s+)?['"]([^'"]+)['"]/g,a;while((a=r.exec(t))!==null){let i=a[1];if(i.startsWith(".")){let n=o(C(e),i);s.push(n),s.push(`${n}.ts`),s.push(`${n}.tsx`),s.push(o(n,"index.ts")),s.push(o(n,"index.tsx"))}}return s}
4
+ export{Vr,As,Ts,Ps,Ds};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{t}from"./chunk-r7qq9579.js";function j(n){let s=t(n),r=(e)=>s[e]?n.slice(s[e].start,s[e].end):"",d=new Map,k=[];for(let e=0;e<s.length;e++)if(["(","[","{"].includes(r(e)))k.push(e);else if([")","]","}"].includes(r(e))){let i=k.pop();if(i===void 0||!["()","[]","{}"].includes(r(i)+r(e)))throw Error("Unbalanced binding pattern");d.set(i,e)}if(k.length)throw Error("Unbalanced binding pattern");for(let e=0;e<s.length;e++){if(r(e)!=="<")continue;let i=["=",",","(",":","?","[","{"].includes(r(e-1)),f=1;for(let a=e+1;a<s.length;a++){if(r(a)==="="&&r(a+1)!==">"&&f===1&&!i)break;if(r(a)==="<")f++;else if(r(a)===">"&&r(a-1)!=="="&&--f===0){if(a+1===s.length||["(","[",".",",","}","]",")","?",":",";","=",">"].includes(r(a+1)))d.set(e,a);break}let u=d.get(a);if(u!==void 0)a=u}}let g=(e,i)=>({text:e<i?n.slice(s[e].start,s[i-1].end):"",offset:s[e]?.start??n.length}),w=(e,i,f)=>{for(let a=e;a<i;a++){if(r(a)===f)return a;let u=d.get(a);if(u!==void 0)a=u}return},b=(e,i)=>{let f=w(e,i,"="),a=f===void 0?void 0:g(f+1,i);if(f!==void 0)i=f;if(e+1===i&&s[e]?.kind==="word")return{kind:"name",name:r(e),defaultValue:a};let u=r(e)==="{"?"object":r(e)==="["?"array":void 0;if(!u||d.get(e)!==i-1)throw Error(`Invalid binding target: ${g(e,i).text}`);let m=[],o=e+1;while(o<i-1){let h=w(o,i-1,","),p=h??i-1;if(o===p)m.push(void 0);else if(r(o)==="."&&r(o+1)==="."&&r(o+2)===".")m.push({rest:!0,target:b(o+3,p)});else if(u==="array")m.push({rest:!1,target:b(o,p)});else if(r(o)==="["){let c=d.get(o);if(c===void 0||r(c+1)!==":")throw Error("Computed binding needs a target");m.push({computed:g(o+1,c),rest:!1,target:b(c+2,p)})}else{let c=o+1;if(s[o].kind!=="word"&&s[o].kind!=="quoted")while(c<p&&r(c)!==":")c++;let l=r(c)===":";if(!l&&s[o].kind!=="word")throw Error("Invalid object binding key");m.push({key:g(o,l?c:o+1).text,rest:!1,target:b(l?c+1:o,p)})}if(h===void 0)break;o=h+1}return{kind:u,elements:m,defaultValue:a}};return b(0,s.length)}function y(n,s){if(n.kind==="name")s.push(n.name);else for(let r of n.elements)if(r)y(r.target,s)}function Ve(n){let s=[];return y(j(n),s),s}function ir(n){let s=j(n.pattern),r=[];if(y(s,r),!r.length)return[];let d=[n.root],k=!1,g={start:n.root.start,end:n.root.end},w=(e,i)=>{let f=n.allocateName();return d.push({kind:"variable",name:f,text:`declare ${i} ${f}: unknown;`,value:e.text,initializerStart:n.patternOffset+e.offset,modifiers:[i],isExported:!1,...g}),f},b=(e,i)=>{if(e.defaultValue){let l=w(e.defaultValue,n.kind),x=n.allocateName();i=`(${i}) extends infer ${x} ? ${x} extends undefined ? typeof ${l} : ${x} : never`}if(e.kind==="name"){let l=k?void 0:n.comments;k=!0,d.push({kind:"variable",name:e.name,text:`${n.exported?"export ":""}declare ${n.kind} ${e.name}: ${i};`,typeAnnotation:i,modifiers:[n.kind],isExported:n.exported,leadingComments:l,...g});return}let f=e.elements,a=[],u=[],m=[];for(let l of f){if(!l){a.push("");continue}let x=n.allocateName(),E=l.key;if(l.computed)E=`[${w(l.computed,"const")}]`;a.push(l.rest?`...${x}`:e.kind==="object"?`${E}: ${x}`:x),u.push({target:l.target,index:m.length}),m.push(`typeof ${x}`)}let o=n.allocateName(),h=n.allocateName(),p=n.allocateName(),c=e.kind==="object"?`{ ${a.join(", ")} }`:`[${a.join(", ")}]`;d.push({kind:"function",name:o,text:`declare function ${o}(${c}: ${i}): [${m.join(", ")}];`,isExported:!1,...g}),d.push({kind:"type",name:h,text:`type ${h} = (typeof ${o}) extends (...args: never[]) => infer ${p} ? ${p} : never;`,isExported:!1,...g});for(let l of u)b(l.target,`${h}[${l.index}]`)};return b(s,`typeof ${n.root.name}`),d}
3
- export{Ve,ir};
2
+ import{n}from"./chunk-b5wcbnb8.js";function j(t){let s=n(t),r=(e)=>s[e]?t.slice(s[e].start,s[e].end):"",d=new Map,k=[];for(let e=0;e<s.length;e++)if(["(","[","{"].includes(r(e)))k.push(e);else if([")","]","}"].includes(r(e))){let i=k.pop();if(i===void 0||!["()","[]","{}"].includes(r(i)+r(e)))throw Error("Unbalanced binding pattern");d.set(i,e)}if(k.length)throw Error("Unbalanced binding pattern");for(let e=0;e<s.length;e++){if(r(e)!=="<")continue;let i=["=",",","(",":","?","[","{"].includes(r(e-1)),f=1;for(let a=e+1;a<s.length;a++){if(r(a)==="="&&r(a+1)!==">"&&f===1&&!i)break;if(r(a)==="<")f++;else if(r(a)===">"&&r(a-1)!=="="&&--f===0){if(a+1===s.length||["(","[",".",",","}","]",")","?",":",";","=",">"].includes(r(a+1)))d.set(e,a);break}let u=d.get(a);if(u!==void 0)a=u}}let g=(e,i)=>({text:e<i?t.slice(s[e].start,s[i-1].end):"",offset:s[e]?.start??t.length}),w=(e,i,f)=>{for(let a=e;a<i;a++){if(r(a)===f)return a;let u=d.get(a);if(u!==void 0)a=u}return},b=(e,i)=>{let f=w(e,i,"="),a=f===void 0?void 0:g(f+1,i);if(f!==void 0)i=f;if(e+1===i&&s[e]?.kind==="word")return{kind:"name",name:r(e),defaultValue:a};let u=r(e)==="{"?"object":r(e)==="["?"array":void 0;if(!u||d.get(e)!==i-1)throw Error(`Invalid binding target: ${g(e,i).text}`);let m=[],o=e+1;while(o<i-1){let h=w(o,i-1,","),p=h??i-1;if(o===p)m.push(void 0);else if(r(o)==="."&&r(o+1)==="."&&r(o+2)===".")m.push({rest:!0,target:b(o+3,p)});else if(u==="array")m.push({rest:!1,target:b(o,p)});else if(r(o)==="["){let c=d.get(o);if(c===void 0||r(c+1)!==":")throw Error("Computed binding needs a target");m.push({computed:g(o+1,c),rest:!1,target:b(c+2,p)})}else{let c=o+1;if(s[o].kind!=="word"&&s[o].kind!=="quoted")while(c<p&&r(c)!==":")c++;let l=r(c)===":";if(!l&&s[o].kind!=="word")throw Error("Invalid object binding key");m.push({key:g(o,l?c:o+1).text,rest:!1,target:b(l?c+1:o,p)})}if(h===void 0)break;o=h+1}return{kind:u,elements:m,defaultValue:a}};return b(0,s.length)}function y(t,s){if(t.kind==="name")s.push(t.name);else for(let r of t.elements)if(r)y(r.target,s)}function Ke(t){let s=[];return y(j(t),s),s}function vr(t){let s=j(t.pattern),r=[];if(y(s,r),!r.length)return[];let d=[t.root],k=!1,g={start:t.root.start,end:t.root.end},w=(e,i)=>{let f=t.allocateName();return d.push({kind:"variable",name:f,text:`declare ${i} ${f}: unknown;`,value:e.text,initializerStart:t.patternOffset+e.offset,modifiers:[i],isExported:!1,...g}),f},b=(e,i)=>{if(e.defaultValue){let l=w(e.defaultValue,t.kind),x=t.allocateName();i=`(${i}) extends infer ${x} ? ${x} extends undefined ? typeof ${l} : ${x} : never`}if(e.kind==="name"){let l=k?void 0:t.comments;k=!0,d.push({kind:"variable",name:e.name,text:`${t.exported?"export ":""}declare ${t.kind} ${e.name}: ${i};`,typeAnnotation:i,modifiers:[t.kind],isExported:t.exported,leadingComments:l,...g});return}let f=e.elements,a=[],u=[],m=[];for(let l of f){if(!l){a.push("");continue}let x=t.allocateName(),E=l.key;if(l.computed)E=`[${w(l.computed,"const")}]`;a.push(l.rest?`...${x}`:e.kind==="object"?`${E}: ${x}`:x),u.push({target:l.target,index:m.length}),m.push(`typeof ${x}`)}let o=t.allocateName(),h=t.allocateName(),p=t.allocateName(),c=e.kind==="object"?`{ ${a.join(", ")} }`:`[${a.join(", ")}]`;d.push({kind:"function",name:o,text:`declare function ${o}(${c}: ${i}): [${m.join(", ")}];`,isExported:!1,...g}),d.push({kind:"type",name:h,text:`type ${h} = (typeof ${o}) extends (...args: never[]) => infer ${p} ? ${p} : never;`,isExported:!1,...g});for(let l of u)b(l.target,`${h}[${l.index}]`)};return b(s,`typeof ${t.root.name}`),d}
3
+ export{Ke,vr};
@@ -0,0 +1,5 @@
1
+ // @bun
2
+ function a(e){return e>=65&&e<=90||e>=97&&e<=122||e===95||e===36||e>127}function i(e){return a(e)||e>=48&&e<=57}function O(e,f){let t=f;for(;;){while(t>=0&&(e.charCodeAt(t)===32||e.charCodeAt(t)===9||e.charCodeAt(t)===10||e.charCodeAt(t)===13))t--;if(t<0)return-1;if(e.charCodeAt(t)===47&&t>0&&e.charCodeAt(t-1)===42){let r=e.lastIndexOf("/*",t-2);if(r===-1)return-1;t=r-1;continue}let n=e.lastIndexOf(`
3
+ `,t)+1,C=U(e,n,t);if(C!==-1){t=C-1;continue}return t}}function U(e,f,t){if(!e.slice(f,t+1).includes("//"))return-1;return N(e,t).lineCommentStart??-1}function yt(e){return e===61||e===40||e===91||e===33||e===38||e===124||e===63||e===58||e===44||e===59||e===123||e===125||e===94||e===126||e===43||e===45||e===42||e===37||e===60||e===62}function bt(e){return e==="return"||e==="typeof"||e==="void"||e==="delete"||e==="throw"||e==="new"||e==="in"||e==="of"||e==="case"||e==="instanceof"||e==="yield"||e==="await"||e==="else"||e==="do"}var P,w=[],T=[],b=0,E=!1,d="",B="",L=!0,l=0,x=-1,S={regexAllowed:!0,closesControlHeader:!1};function G(e){P=e,w=[],T=[],b=0,E=!1,d="",B="",L=!0,l=0,x=-1}function N(e,f){if(P!==e)G(e);else if(x===f)return S;else if(f<l)G(e);let t=(n,C=!1)=>{B=d,d=n,L=C};while(l<=f&&l<e.length){let n=e.charCodeAt(l);if(E){if(n===92){l+=2;continue}if(n===96)E=!1,t("literal");else if(n===36&&e.charCodeAt(l+1)===123)T.push(b++),E=!1,t("{",!0),l++;l++;continue}if(n===32||n===9||n===10||n===13){l++;continue}if(n===47&&e.charCodeAt(l+1)===47){let C=e.indexOf(`
4
+ `,l+2);if(C===-1||C>f)return x=f,S={regexAllowed:L,closesControlHeader:!1,lineCommentStart:l},S;l=C+1;continue}if(n===47&&e.charCodeAt(l+1)===42){let C=e.indexOf("*/",l+2);l=C===-1?e.length:C+2;continue}if(n===39||n===34){let C=n;l++;while(l<e.length){let r=e.charCodeAt(l++);if(r===92)l++;else if(r===C)break}t("literal");continue}if(n===96){E=!0,l++;continue}if(a(n)||n===35&&a(e.charCodeAt(l+1))){let C=l++;while(i(e.charCodeAt(l)))l++;let r=e.slice(C,l);t(r,d!=="."&&bt(r));continue}if((n===43||n===45)&&e.charCodeAt(l+1)===n){t(e.slice(l,l+2),L),l+=2;continue}if(n===33&&e.charCodeAt(l+1)!==61){t("!",L),l++;continue}if(n===40){let C=B!=="."&&(d==="if"||d==="while"||d==="for"||d==="with"||d==="switch"||d==="catch"||d==="await"&&B==="for");w.push(C),t("(",!0),l++;continue}if(n===41){let C=w.pop()??!1,r=l;if(t(")",C),l++,r===f)return x=f,S={regexAllowed:C,closesControlHeader:C},S;continue}if(n===47&&L){l=c(e,l),t("literal");continue}if(n===123)b++;else if(n===125){if(b--,T.at(-1)===b)T.pop(),E=!0}t(e[l],n===47||yt(n)),l++}return x=f,S={regexAllowed:L,closesControlHeader:!1},S}function u(e,f,t){let n=t===void 0?O(e,f-1):t-1;if(n<0)return!0;let C=e.charCodeAt(n);if(C===33||(C===43||C===45)&&e.charCodeAt(n-1)===C)return N(e,n).regexAllowed;if(C===41)return N(e,n).closesControlHeader;if(yt(C))return!0;if(i(C)){let r=n;while(r>=0&&i(e.charCodeAt(r)))r--;let A=e.charCodeAt(O(e,r));if(A===46||A===35)return!1;return bt(e.slice(r+1,n+1))}return!1}function c(e,f){let t=f,n=e.length;t++;let C=!1;while(t<n){let r=e.charCodeAt(t);if(r===92){t+=2;continue}if(C){if(r===93)C=!1;t++;continue}if(r===91){C=!0,t++;continue}if(r===47){t++;break}if(r===10||r===13)break;t++}while(t<n&&i(e.charCodeAt(t)))t++;return t}function Te(e,f,t){let n=t===void 0?O(e,f-1):t-1;if(n<0)return!0;let C=e[n];if("=([{,:;!?+-*/%&|^~<".includes(C))return!0;if(C===">"&&e[n-1]==="=")return!0;let r=n;while(r>=0&&i(e.charCodeAt(r)))r--;return["return","throw","yield","await","case","void","typeof","delete","new","else","do"].includes(e.slice(r+1,n+1))}function K(e,f,t,n){let C=e.length;if(e.charCodeAt(f)!==60||f+1>=C)return null;let r=e.charCodeAt(f+1);if(r===62)return{delta:1,end:f+1};if(r===47){let o=f+2;if(e.charCodeAt(o)!==62){if(!a(e.charCodeAt(o)))return null;while(o<C&&(i(e.charCodeAt(o))||".:-".includes(e[o])))o++;while(o<C&&/\s/.test(e[o]))o++}return e.charCodeAt(o)===62?{delta:-1,end:o}:null}if(!a(r))return null;let A=f+2;while(A<C){let o=e.charCodeAt(A);if(!i(o)&&o!==46&&o!==58&&o!==45)break;A++}let _=e.slice(f+1,A),R=e.charCodeAt(A);if(R>32&&R!==62&&R!==47)return null;let s=0,m=0,H=A,h=A;for(;H<C;H++){let o=e.charCodeAt(H);if(m!==0){if(o===92)H++;else if(o===m)m=0,h=H+1;continue}if(o===60&&s>0&&(e[H+1]==="/"||Te(e,H,h))){let g=n?n(H):K(e,H,t);if(g){H=g.end,h=H+1;continue}}if(o===47&&s>0){let g=e.charCodeAt(H+1);if(g===47){while(H<C&&e.charCodeAt(H)!==10&&e.charCodeAt(H)!==13)H++;continue}if(g===42){let I=e.indexOf("*/",H+2);if(I===-1)return null;H=I+1;continue}if(u(e,H,h)){H=c(e,H)-1,h=H+1;continue}}if(o===39||o===34||o===96)m=o;else if(o===123)s++;else if(o===125&&s>0)s--;else if(o===60&&s===0)return null;else if(o===62&&s===0)break;if(o>32)h=H+1}if(H>=C)return null;let p=H-1;while(p>f&&e.charCodeAt(p)<=32)p--;if(e.charCodeAt(p)===47)return{delta:0,end:H};return(t?t.get(_)??-1:e.indexOf(`</${_}`,H+1))>H?{delta:1,end:H}:null}function Je(e,f){if(!e.includes("</")&&!e.includes("/>"))return()=>null;let t,n=new Map;function C(r){if(n.has(r))return n.get(r);if(!t){t=new Map;let _=e.indexOf("</");while(_!==-1){let R=K(e,_);if(R){let s=_+2;while(s<R.end&&!/\s/.test(e[s]))s++;t.set(e.slice(_+2,s),_)}_=e.indexOf("</",_+2)}}let A=K(e,r,t,C);if(n.set(r,A),A&&e[A.end-1]==="/")f?.add(A.end-1);return A}return C}
5
+ export{a,i,yt,bt,u,c,Te,Je};
@@ -0,0 +1,44 @@
1
+ // @bun
2
+ import{u,c}from"./chunk-ke1h5m7f.js";import{n}from"./chunk-b5wcbnb8.js";import{Ke}from"./chunk-javyer70.js";import{kr,Er,Ar}from"./chunk-xz57d151.js";import{b,v,z}from"./chunk-cs6538bw.js";import{D}from"./chunk-pjrnfmwm.js";import{ze,Ae,He}from"./chunk-gkfchhnr.js";import{Ee}from"./chunk-4th0w19y.js";var xt=20,Y=!1,F=null;function et(e){return Yt(e).replace(/\n[ \t]*(?=\n)/g,"")}function Yt(e){if(e.indexOf("/*")===-1)return e.trim();let f=[],a=0,i=0,l=e.length;while(i<l)if(e.charCodeAt(i)===47&&i+1<l&&e.charCodeAt(i+1)===42){if(i>a)f.push(e.substring(a,i));i+=2;while(i<l-1){if(e.charCodeAt(i)===42&&e.charCodeAt(i+1)===47){i+=2;break}i++}a=i}else i++;if(a<l)f.push(e.substring(a));return f.join("").trim()}function Xt(){Y=!0,F=null}function Qt(){Y=!1;let e=F;return F=null,e}function St(e,s){let f=0,a=0;while((a=e.indexOf(s,a))!==-1)f++,a+=s.length;return f}function Mt(e){return e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===36||e===95||e===46||e===58||e===45}function Ct(e){let s=e.trim();if(s.length<3||s.charCodeAt(0)!==60)return!1;if(s.startsWith("<>"))return s.endsWith("</>");let f=s.charCodeAt(1);if(!(f>=65&&f<=90||f>=97&&f<=122||f===36||f===95))return!1;let i=2;while(i<s.length&&Mt(s.charCodeAt(i)))i++;let l=s.slice(1,i),h=i;if(h<s.length&&s.charCodeAt(h)===60){let m=t(s,h,"<",">");if(m===-1)return!1;h=m+1}let g=s.charCodeAt(h);if(g>32&&g!==62&&g!==47)return!1;if(s.endsWith("/>"))return!0;let d=s.lastIndexOf("</");if(d===-1)return!1;let p=d+2;while(p<s.length&&Mt(s.charCodeAt(p)))p++;return s.slice(d+2,p)===l&&s.charCodeAt(p)===62&&p===s.length-1}function wt(e){let s=e.length,f=!1;for(let h=1;h<s;h++)if(e.charCodeAt(h)<=32&&e.charCodeAt(h-1)<=32){f=!0;break}if(!f)for(let h=0;h<s;h++){let g=e.charCodeAt(h);if(g===10||g===13||g===9){f=!0;break}}if(!f)return e;let a=[],i=-1,l=!1;for(let h=0;h<s;h++)if(e.charCodeAt(h)<=32){if(!l){if(i>=0)a.push(e.substring(i,h));a.push(" "),l=!0,i=-1}}else{if(l||i<0)i=h;l=!1}if(i>=0)a.push(e.substring(i));return a.join("")}function r(e,s=!1,f=!1,a=0,i){if(!e||typeof e!=="string")return"unknown";if(a>=xt)return"unknown";let l=e.trim(),h=l.length;if(h===0)return"unknown";let g=l.charCodeAt(0),d=l.charCodeAt(h-1);if(l==="true"||l==="false")return s?l:"boolean";if(l==="null")return"null";if(l==="undefined")return"undefined";if(g>=48&&g<=57||g===45&&h>1&&l.charCodeAt(1)>=48&&l.charCodeAt(1)<=57||g===46&&h>1&&l.charCodeAt(1)>=48&&l.charCodeAt(1)<=57){if(b(l))return s?z(l):"number"}if(g===91&&d===93&&t(l,0,"[","]")===h-1)return ie(l,s,a+1,i);if(g===123&&d===125&&t(l,0,"{","}")===h-1)return se(l,s,a+1,i);if(h>=2&&g===40&&d===41&&t(l,0,"(",")")===h-1)return r(l.slice(1,-1),s,f,a+1,i);if(Ct(l))return"JSX.Element";let p=ne(l);if(p)return p;if(!ae(l)){let A=ge(l);if(A!==-1)return r(l.slice(A+1),s,f,a+1,i)}if(l.startsWith("BigInt(")&&l.endsWith(")")&&t(l,6,"(",")")===l.length-1)return"bigint";if(l.startsWith("Symbol.for(")&&l.endsWith(")")&&t(l,10,"(",")")===l.length-1)return s&&!f&&a===0?"unique symbol":"symbol";let m=je(l,a,i);if(m)return m;if(!(g===91&&d===93||g===123&&d===125)&&d===96&&(l.includes(".raw`")||l.includes("String.raw`"))){let A=l.indexOf("`");if(A!==-1&&G(l,A,96)===l.length)return"string"}if(g===96&&d===96){if(!s||l.includes("${")||l.includes(`
3
+ `)||l.includes("\r"))return"string";return l}if(g===39||g===34){let A=me(l);if(A!==null){if(A==="string"||!s)return"string";return A}}if(b(l)){if(!s)return"number";return z(l)}if(l.startsWith("class ")||l.startsWith("class{"))return Qe(l);if(l.startsWith("new "))return Se(l);let T=!ae(l)?oe(l):null;if(T!==null){if(T.startsWith("[")&&T.endsWith("]")){let A=T.slice(1,-1).trim();if(!A)return"readonly []";let x=o(A),S=[];for(let I=0;I<x.length;I++){let M=x[I].trim();if(M.startsWith("...")){let R=M.slice(3).trim();if(X(R))S.push(`...typeof ${R}`);else{let L=r(R,!0,!1,a+1,i);S.push(L.startsWith("readonly [")||L.endsWith("[]")?`...${L}`:"...unknown[]")}}else S.push(r(M,!0,!1,a+1,i))}return`readonly [${S.join(", ")}]`}return r(T,!0,f,a+1,i)}if(ae(l))return ee(l,f,a,s);if(l.startsWith("`")&&l.endsWith("`"))return Ye(l,s);if(l.startsWith("Promise."))return ce(l,s,a,i);if(l.startsWith("await "))return mt(r(l.slice(6).trim(),!1,!1,a+1,i));if(l.startsWith("typeof ")&&rt(l.slice(7)))return"string";if(l.startsWith("void ")&&rt(l.slice(5)))return"undefined";if(l.startsWith("delete ")&&rt(l.slice(7)))return"boolean";if(l[0]==="!"&&l.length>1&&rt(l.slice(1)))return"boolean";if((l[0]==="+"||l[0]==="~")&&l.length>1&&rt(l.slice(1))){if(l[0]==="~"){if(r(l.slice(1).trim(),!1,!1,a+1,i)==="bigint")return"bigint"}return"number"}if(l[0]==="-"&&l.length>1&&!(l[1]>="0"&&l[1]<="9")&&rt(l.slice(1))){if(r(l.slice(1).trim(),!1,!1,a+1,i)==="bigint")return"bigint";return"number"}if(sn(l))return"RegExp";if(l==="NaN"||l==="Infinity")return"number";if(v(l)){if(s)return z(l);return"bigint"}if(l.startsWith("Symbol(")&&l.endsWith(")")&&t(l,6,"(",")")===l.length-1)return s&&!f&&a===0?"unique symbol":"symbol";let y=en(l,a,i);if(y!==null)return y;let k=Z(l);if(k!==null)return k;let W=Zt(l);if(W!==null)return W;let w=nn(l);if(w!==null)return w;let N=ct(l,"?",0);if(N!==-1&&N+1<l.length&&l[N+1]!=="?"&&l[N+1]!=="."){let A=de(l,N+1);if(A!==-1){let x=Ot(l.slice(0,N).trim());if(x==="truthy")return r(l.slice(N+1,A),s,f,a+1,i);if(x==="falsy")return r(l.slice(A+1),s,f,a+1,i);let S=r(l.slice(N+1,A),!0,!0,a+1,i),I=r(l.slice(A+1),!0,!0,a+1,i);if(S===I)return S;return`${S} | ${I}`}}for(let A of["??","||","&&"]){let x=ct(l,A,0);if(x!==-1){let S=l.slice(0,x).trim(),I=l.slice(x+A.length).trim(),M=r(S,s,!0,a+1,i),R=r(I,s,!0,a+1,i);if(A==="??"){if(M==="null"||M==="undefined")return R;if(Ot(S)!=="unknown")return M;let K=Re(M);if(!K)return R;return Nt(K,R)}let L=Ot(S);if(A==="&&"){if(L==="truthy")return r(I,s,f,a+1,i);if(L==="falsy")return M}if(A==="||"){if(L==="truthy")return M;if(L==="falsy")return r(I,s,f,a+1,i)}return Nt(M,R)}}if(l.includes("satisfies")){let A=P(l);if(A)return A}if(l.includes("as")){let A=Ut(l);if(A)return A}if(Ht(l))return"boolean";if(ct(l," instanceof ",0)!==-1||ct(l," in ",0)!==-1)return"boolean";for(let A of[">>>","<<",">>","**","&","|","^"]){let x=ct(l,A,0);if(x!==-1&&x>0&&x+A.length<l.length){if((A==="&"||A==="|")&&(l[x-1]===A||l[x+1]===A))continue;if(A===">>>")return"number";let S=r(l.slice(0,x),!1,!1,a+1,i),I=r(l.slice(x+A.length),!1,!1,a+1,i);return S==="bigint"||I==="bigint"?"bigint":"number"}}if(We(l))return"number";for(let A of["+","-","*","/","%"]){let x=ct(l,A,0);if(x!==-1&&x>0&&x+1<l.length){let S=l[x-1],I=l[x+1];if(I!=="="&&I!==A&&S!==A){let M=r(l.slice(0,x),!1,!1,a+1,i),R=r(l.slice(x+1),!1,!1,a+1,i);if(A==="+"&&(M==="string"||R==="string"))return"string";if(M==="bigint"||R==="bigint")return"bigint";return"number"}}}let E=tn(l,s,a,i);if(E!==null)return E;return"unknown"}var yt=new Set(["new","typeof","void","delete","await","return","yield","throw","class","function","case","in","instanceof","true","false","null"]);function Zt(e){let s=e.trim();if(s.length<4||!s.endsWith(">"))return null;let f=s.indexOf("<");if(f<=0)return null;let a=s.slice(0,f).trim();if(!X(a))return null;let i=a.indexOf("."),l=i===-1?a:a.slice(0,i);if(yt.has(l))return null;let h=D(s)(f,0);if(!h||!h.completeOperand||h.parameters||h.end!==s.length)return null;return`typeof ${a}${s.slice(f,h.end)}`}function Wt(e){let s=e.indexOf("."),f=s===-1?e:e.slice(0,s);return yt.has(f)||f==="undefined"||f==="this"||f==="super"}function pt(e){if(e.length===0)return"never[]";if(e.length===1){let s=e[0];if(s.includes(" | ")||s.includes(" & ")||s.includes(" => "))return`(${s})[]`;return`${s}[]`}return`(${e.join(" | ")})[]`}function en(e,s=0,f){let a=e.trim();if(a.length<4||!a.endsWith(")"))return null;if(a.startsWith("Object.freeze(")){if(t(a,13,"(",")")!==a.length-1)return null;let i=a.slice(14,-1).trim();if(!i)return null;let l=Y,h=F;Y=!1;try{if(i.endsWith("as const"))return r(i,!0,!1,s+1,f);if(i.startsWith("[")&&i.endsWith("]")&&t(i,0,"[","]")===i.length-1){let g=ie(i,!1,s+1,f);return g.startsWith("readonly ")?g:`readonly ${g}`}if(i.startsWith("{")&&i.endsWith("}")&&t(i,0,"{","}")===i.length-1)return`Readonly<${et(se(i,!1,s+1,f))}>`;if(X(i)&&!Wt(i))return`Readonly<typeof ${i}>`;return null}finally{Y=l,F=h}}if(a.startsWith("Object.assign(")){if(t(a,13,"(",")")!==a.length-1)return null;let i=a.slice(14,-1).trim();if(!i)return null;let l=Y,h=F;Y=!1;try{let g=o(i);if(g.length===0)return null;let d=[];for(let p of g){let m=p.trim();if(!m||m.startsWith("..."))return null;if(m.startsWith("{")&&m.endsWith("}")&&t(m,0,"{","}")===m.length-1){if(!m.slice(1,-1).trim()&&g.length>1)continue;let C=et(se(m,!1,s+1,f));if(!d.includes(C))d.push(C)}else if(X(m)&&!Wt(m)){let C=`typeof ${m}`;if(!d.includes(C))d.push(C)}else{let C=et(r(m,!1,!1,s+1,f));if(C==="unknown")return null;if(!d.includes(C))d.push(C)}}if(d.length===0)return"Record<string, never>";return d.join(" & ")}finally{Y=l,F=h}}if(a.startsWith("Array.of(")){if(t(a,8,"(",")")!==a.length-1)return null;let i=a.slice(9,-1).trim();if(!i)return"never[]";let l=Y,h=F;Y=!1;try{let g=o(i),d=[];for(let p of g){let m=p.trim();if(!m||m.startsWith("..."))return null;let C=et(r(m,!1,!0,s+1,f));if(C==="unknown")return null;if(!d.includes(C))d.push(C)}return pt(d)}finally{Y=l,F=h}}if(a.startsWith("Array.from")){let i=a.slice(10);if(i.length>=4&&i[0]==="<"){let l=t(i,0,"<",">");if(l!==-1){let h=i.slice(l+1).trim();if(h.length>=2&&h[0]==="("&&t(h,0,"(",")")===h.length-1){let g=o(i.slice(1,l));if(g.length===1){let d=g[0].trim();if(d)return pt([d])}}}}if(i.length>=2&&i[0]==="("&&t(i,0,"(",")")===i.length-1){let l=i.slice(1,-1).trim();if(!l)return null;let h=o(l);if(h.length!==1)return null;let g=h[0].trim(),d=Y,p=F;Y=!1;try{if(g.startsWith("[")&&g.endsWith("]")&&t(g,0,"[","]")===g.length-1)return et(ie(g,!1,s+1,f));if(g.length>=2&&(g[0]==="'"&&g[g.length-1]==="'"||g[0]==='"'&&g[g.length-1]==='"'||g[0]==="`"&&g[g.length-1]==="`"))return"string[]";if(g.startsWith("new Set(")||g.startsWith("new Set<")){let m=Se(g);if(m.startsWith("Set<")&&m.endsWith(">")){let C=m.slice(4,-1).trim();if(C)return pt([C])}}if(g.startsWith("new Map(")||g.startsWith("new Map<")){let m=Se(g);if(m.startsWith("Map<")&&m.endsWith(">")){let C=m.slice(4,-1).trim();if(C)return`[${C}][]`}}}finally{Y=d,F=p}}}return null}function tn(e,s=!1,f=0,a){let i=e.trim();if(i.length<2||!i.endsWith("!"))return null;let l=i.length;while(l>0&&i.charCodeAt(l-1)===33)l--;let h=i.slice(0,l).trim();if(!h)return null;let g=r(h,s,!1,f+1,a);if(g!=="unknown")return`NonNullable<${g}>`;if(X(h)){let d=h.indexOf("."),p=d===-1?h:h.slice(0,d);if(yt.has(p)||p==="undefined"||p==="this"||p==="super")return null;return`NonNullable<typeof ${h}>`}return null}function nn(e){let s=e.trim();if(s.length<3||!s.endsWith("`"))return null;let f=s.charCodeAt(0);if(!(f>=65&&f<=90||f>=97&&f<=122||f===95||f===36))return null;let a=0;while(a<s.length){let d=s.charCodeAt(a);if(d>=65&&d<=90||d>=97&&d<=122||d>=48&&d<=57||d===95||d===36||d===46)a++;else break}let i=s.slice(0,a);if(!X(i))return null;let l=i.indexOf("."),h=l===-1?i:i.slice(0,l);if(yt.has(h))return null;let g="";if(a<s.length&&s.charCodeAt(a)===60){let d=D(s)(a,0);if(!d||!d.completeOperand||d.parameters)return null;g=s.slice(a,d.end),a=d.end}if(a>=s.length||s.charCodeAt(a)!==96)return null;if(G(s,a,96)!==s.length)return null;if(i==="String.raw"||i.endsWith(".raw"))return"string";return`ReturnType<typeof ${i}${g}>`}function Nt(e,s){if(e===s)return e;if(e==="unknown"||s==="unknown")return"unknown";let f=[];for(let a of[e,s]){let i=0,l=0;for(let h=0;h<=a.length;h++){let g=h===a.length?"|":a[h];if(g==="("||g==="["||g==="{"||g==="<")i++;else if(g===")"||g==="]"||g==="}"||g===">")i--;else if(g==="|"&&i===0){let d=a.slice(l,h).trim();if(d){if(d==="unknown")return"unknown";if(!f.includes(d))f.push(d)}l=h+1}}}return f.length>0?f.join(" | "):"unknown"}function Ot(e){let s=e.trim();if(!s)return"unknown";if(s==="true")return"truthy";if(s==="false"||s==="null"||s==="undefined"||s==="NaN"||s==="0"||s==="0n"||s==="''"||s==='""'||s==="``")return"falsy";if(s.startsWith("'")&&s.endsWith("'")&&s.length>2||s.startsWith('"')&&s.endsWith('"')&&s.length>2)return"truthy";return"unknown"}function ct(e,s,f){if(e.indexOf(s,f)===-1)return-1;let a=0,i=0,l=0;for(let h=f;h+s.length<=e.length;h++){let g=e.charCodeAt(h);if(g===34||g===39||g===96){h=G(e,h,g)-1;continue}if(g===47){if(e[h+1]==="/"){let d=e.indexOf(`
4
+ `,h+2);h=d===-1?e.length:d;continue}if(e[h+1]==="*"){let d=e.indexOf("*/",h+2);h=d===-1?e.length:d+1;continue}if(u(e,h)){h=c(e,h)-1;continue}}if(a===0&&i===0&&l===0&&e.startsWith(s,h))return h;if(g===40)a++;else if(g===41)a--;else if(g===91)i++;else if(g===93)i--;else if(g===123)l++;else if(g===125)l--}return-1}function de(e,s){let f=0,a=0,i=0,l=0;for(let h=s;h<e.length;h++){let g=e.charCodeAt(h);if(g===34||g===39||g===96){h=G(e,h,g)-1;continue}if(g===47){if(e[h+1]==="/"){let d=e.indexOf(`
5
+ `,h+2);h=d===-1?e.length:d;continue}if(e[h+1]==="*"){let d=e.indexOf("*/",h+2);h=d===-1?e.length:d+1;continue}if(u(e,h)){h=c(e,h)-1;continue}}if(g===40)f++;else if(g===41)f--;else if(g===91)a++;else if(g===93)a--;else if(g===123)i++;else if(g===125)i--;else if(f===0&&a===0&&i===0){if(g===63){let d=e[h+1];if(d==="?"){h++;continue}if(d!==".")l++}else if(g===58){if(l===0)return h;l--}}}return-1}function ge(e){if(!e.includes(","))return-1;let s=0,f=0,a=0,i=-1,l;for(let h=0;h<e.length;h++){let g=e.charCodeAt(h);if(g===34||g===39||g===96){h=G(e,h,g)-1;continue}if(g===47){if(e[h+1]==="/"){let d=e.indexOf(`
6
+ `,h+2);h=d===-1?e.length:d;continue}if(e[h+1]==="*"){let d=e.indexOf("*/",h+2);h=d===-1?e.length:d+1;continue}if(u(e,h)){h=c(e,h)-1;continue}}if(g===60&&s===0&&f===0&&a===0){l??=D(e);let d=l(h,0);if(d){h=d.end-1;continue}}if(g===40)s++;else if(g===41)s--;else if(g===91)f++;else if(g===93)f--;else if(g===123)a++;else if(g===125)a--;else if(g===44&&s===0&&f===0&&a===0)i=h}return i}function Lt(e){let s=e.charCodeAt(0);if(s!==39&&s!==34)return!1;return G(e,0,s)===e.length}function me(e){if(Lt(e))return e;let s=pe(e);if(s.length<2)return null;let f=!1,a=!0,i="";for(let l of s){let h=l.trim();if(Lt(h))f=!0,i+=Ce(h);else a=!1}if(a)return we(i);if(f)return"string";return null}function pe(e){let s=[],f=0,a=0,i=0;while(i<e.length){let l=e.charCodeAt(i);if(l===39||l===34||l===96){i=G(e,i,l);continue}if(l===40||l===91||l===123)f++;else if(l===41||l===93||l===125)f--;else if(l===43&&f===0)s.push(e.slice(a,i)),a=i+1;i++}return s.push(e.slice(a)),s}function Ce(e){return e.slice(1,-1).replace(/\\(.)/g,(f,a)=>{if(a==="n")return`
7
+ `;if(a==="t")return"\t";if(a==="r")return"\r";if(a==="0")return"\x00";return a})}function we(e){return`'${e.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}'`}function We(e){if(e==="")return!1;let s=!1,f=!1;for(let a=0;a<e.length;a++){let i=e.charCodeAt(a);if(i>=48&&i<=57){s=!0;continue}if(i===43||i===45||i===42||i===47||i===37){f=!0;continue}if(i===60||i===62){let l=a+1;while(l<e.length&&e.charCodeAt(l)===i)l++;let h=l-a;if(h!==2&&!(i===62&&h===3))return!1;f=!0,a=l-1;continue}if(i===46||i===40||i===41||i<=32)continue;return!1}return s&&f}function Ht(e){let s=0,f;for(let a=0;a<e.length;a++){let i=e.charCodeAt(a);if(i===34||i===39||i===96){a=G(e,a,i)-1;continue}if(i===47){if(e[a+1]==="/"){let l=e.indexOf(`
8
+ `,a+2);a=l===-1?e.length:l;continue}if(e[a+1]==="*"){let l=e.indexOf("*/",a+2);a=l===-1?e.length:l+1;continue}if(u(e,a)){a=c(e,a)-1;continue}}if(i===40||i===91||i===123){s++;continue}if(i===41||i===93||i===125){s--;continue}if(s!==0)continue;if(i===60){f??=D(e);let l=f(a,0);if(l){a=l.end-1;continue}}if(e.startsWith("===",a)||e.startsWith("!==",a)||e.startsWith("==",a)||e.startsWith("!=",a)||e.startsWith(">=",a)||e.startsWith("<=",a))return!0;if((i===62||i===60)&&e.charCodeAt(a+1)===i){while(e.charCodeAt(a+1)===i)a++;continue}if((i===62||i===60)&&e.charCodeAt(a-1)!==61&&e.charCodeAt(a+1)!==61)return!0}return!1}function rn(e,s=!1,f=0,a){return r(e,s,!0,f,a)}function Te(e,s){if(s>=e.length)return!0;let f=e.charCodeAt(s);if(f===125)return!0;if(f===114&&e.startsWith("return",s)&&!j(e.charCodeAt(s+6)))return!0;if(f===99){if(e.startsWith("case",s)&&!j(e.charCodeAt(s+4)))return!0;if(e.startsWith("const",s)&&!j(e.charCodeAt(s+5)))return!0;if(e.startsWith("continue",s)&&!j(e.charCodeAt(s+8)))return!0;if(e.startsWith("catch",s)&&!j(e.charCodeAt(s+5)))return!0;if(e.startsWith("class",s)&&!j(e.charCodeAt(s+5)))return!0}else if(f===100){if(e.startsWith("default",s)&&!j(e.charCodeAt(s+7)))return!0;if(e.startsWith("do",s)&&!j(e.charCodeAt(s+2)))return!0}else if(f===98&&e.startsWith("break",s)&&!j(e.charCodeAt(s+5)))return!0;else if(f===108&&e.startsWith("let",s)&&!j(e.charCodeAt(s+3)))return!0;else if(f===118&&e.startsWith("var",s)&&!j(e.charCodeAt(s+3)))return!0;else if(f===105&&e.startsWith("if",s)&&!j(e.charCodeAt(s+2)))return!0;else if(f===101&&e.startsWith("else",s)&&!j(e.charCodeAt(s+4)))return!0;else if(f===102){if(e.startsWith("for",s)&&!j(e.charCodeAt(s+3)))return!0;if(e.startsWith("finally",s)&&!j(e.charCodeAt(s+7)))return!0;if(e.startsWith("function",s)&&!j(e.charCodeAt(s+8)))return!0}else if(f===119&&e.startsWith("while",s)&&!j(e.charCodeAt(s+5)))return!0;else if(f===115&&e.startsWith("switch",s)&&!j(e.charCodeAt(s+6)))return!0;else if(f===116){if(e.startsWith("try",s)&&!j(e.charCodeAt(s+3)))return!0;if(e.startsWith("throw",s)&&!j(e.charCodeAt(s+5)))return!0}return!1}var xe=new Set(["if","for","while","switch","catch","with","function","class","return","else","do","try","finally","case","default","typeof","void","delete","await","yield","throw","new","in","instanceof","of"]);function ye(e,s){let f=s-1;while(f>=0&&e.charCodeAt(f)<=32)f--;if(f<0)return-1;let a=e.charCodeAt(f);if(a===42){let m=f-1;while(m>=0&&e.charCodeAt(m)<=32)m--;if(m<0)return-1;let C=e.charCodeAt(m);if(C!==123&&C!==44)return-1}else if(a!==123&&a!==44)return-1;let i=s,l=i;while(l<e.length&&j(e.charCodeAt(l)))l++;if(l===i)return-1;let h=e.slice(i,l);if(xe.has(h))return-1;if(i=l,h==="get"||h==="set"||h==="async"){let m=tt(e,i);if(m<e.length&&e.charCodeAt(m)!==40&&e.charCodeAt(m)!==60){if(i=m,e.charCodeAt(i)===42)i=tt(e,i+1);if(i<e.length&&j(e.charCodeAt(i)))while(i<e.length&&j(e.charCodeAt(i)))i++;else if(i<e.length&&e.charCodeAt(i)===91){let C=1;i++;while(i<e.length&&C>0){let T=e.charCodeAt(i);if(T===34||T===39||T===96){i=G(e,i,T);continue}if(T===91)C++;else if(T===93)C--;i++}}}}if(i=tt(e,i),i<e.length&&e.charCodeAt(i)===60){let m=1;i++;while(i<e.length&&m>0){let C=e.charCodeAt(i);if(C===34||C===39||C===96){i=G(e,i,C);continue}if(C===60)m++;else if(C===62&&e.charCodeAt(i-1)!==61)m--;i++}i=tt(e,i)}if(i>=e.length||e.charCodeAt(i)!==40)return-1;let g=1;i++;while(i<e.length&&g>0){let m=e.charCodeAt(i);if(m===34||m===39||m===96){i=G(e,i,m);continue}if(m===47&&e.charCodeAt(i+1)===47){while(i<e.length&&e.charCodeAt(i)!==10)i++;continue}if(m===47&&e.charCodeAt(i+1)===42){let C=e.indexOf("*/",i+2);i=C===-1?e.length:C+2;continue}if(m===40)g++;else if(m===41)g--;i++}if(g!==0)return-1;let d=!1,p=!1;while(i<e.length){let m=e.charCodeAt(i);if(m===10||m===13){d=!0,i++;continue}if(m<=32){i++;continue}if(m===47&&e.charCodeAt(i+1)===47){while(i<e.length&&e.charCodeAt(i)!==10)i++;continue}if(m===47&&e.charCodeAt(i+1)===42){let C=e.indexOf("*/",i+2);i=C===-1?e.length:C+2;continue}break}if(i<e.length&&e.charCodeAt(i)===58){p=!0,i++;let m=0;while(i<e.length){let C=e.charCodeAt(i);if(C===34||C===39||C===96){i=G(e,i,C);continue}if(C===40||C===91||C===60)m++;else if(C===41||C===93||C===62&&e.charCodeAt(i-1)!==61){if(m>0)m--}else if(C===123&&m===0)break;else if(C===59&&m===0)return-1;i++}}if(i>=e.length||e.charCodeAt(i)!==123)return-1;if(d&&!p)return-1;return st(e,i)}function O(e,s=!1,f="",a,i){let l=Tt(f,a);Jt(e,l);let h=[],g=!1,d=0;while(d<e.length){let m=e.charCodeAt(d);if(m===34||m===39||m===96){d=G(e,d,m);continue}if(m===47&&e.charCodeAt(d+1)===47){d+=2;while(d<e.length&&e.charCodeAt(d)!==10&&e.charCodeAt(d)!==13)d++;continue}if(m===47&&e.charCodeAt(d+1)===42){let T=e.indexOf("*/",d+2);d=T===-1?e.length:T+2;continue}if(m===47){let T=$t(e,0,d);if(T!==-1){d=T;continue}}if(e.startsWith("function",d)&&gt(e,d,8)||e.startsWith("class",d)&&gt(e,d,5)){let T=le(e,d);if(T!==-1){d=st(e,T);continue}}if(m===61&&e.charCodeAt(d+1)===62){let T=tt(e,d+2);if(e.charCodeAt(T)===123){d=st(e,T);continue}}if(j(m)&&(d===0||!j(e.charCodeAt(d-1)))){let T=ye(e,d);if(T!==-1){d=T;continue}}if(e.startsWith("return",d)&&(d===0||!j(e.charCodeAt(d-1)))&&!j(e.charCodeAt(d+6))){let T=d-1;while(T>=0&&e.charCodeAt(T)<=32)T--;if(T>=0&&e.charCodeAt(T)===46){d+=6;continue}let y=d+6;while(y<e.length&&(e.charCodeAt(y)===32||e.charCodeAt(y)===9))y++;if(y<e.length&&e.charCodeAt(y)===58){d+=6;continue}d+=6;let k=!1;while(d<e.length&&e.charCodeAt(d)<=32){let S=e.charCodeAt(d);if(S===10||S===13)k=!0;d++}if(k||d>=e.length||e.charCodeAt(d)===59||e.charCodeAt(d)===125){g=!0;continue}let W=d,w=0,N=0,E=0;while(d<e.length){let S=e.charCodeAt(d);if(S===34||S===39||S===96){d=G(e,d,S);continue}if(S===47&&e.charCodeAt(d+1)===47){if(w===0&&N===0&&E===0)break;while(d<e.length&&e.charCodeAt(d)!==10&&e.charCodeAt(d)!==13)d++;continue}if(S===47&&e.charCodeAt(d+1)===42){let I=e.indexOf("*/",d+2);d=I===-1?e.length:I+2;continue}if(S===47){let I=$t(e,W,d);if(I!==-1){d=I;continue}}if(S===40)w++;else if(S===41)w--;else if(S===91)N++;else if(S===93)N--;else if(S===123)E++;else if(S===125){if(E===0&&w===0&&N===0)break;E--}else if(S===59&&w===0&&N===0&&E===0)break;else if((S===10||S===13)&&w===0&&N===0&&E===0){let I=d+1;while(I<e.length&&e.charCodeAt(I)<=32)I++;if(Te(e,I))break}d++}let A=e.slice(W,d).trim(),x=et(H(A,l,a,i,W));if(!h.includes(x))h.push(x);continue}d++}if(g&&!h.includes("undefined"))h.push("undefined");let p=h.includes("unknown")?"unknown":h.length===0?"void":Et(h);return s?an(p):p}function Oe(e,s,f,a){let i=e.trim();if(!i)return null;if(i.startsWith("readonly "))i=i.slice(9).trim();if(i.length>=2&&i[0]==="["&&i[i.length-1]==="]"&&t(i,0,"[","]")===i.length-1){let l=i.slice(1,-1).trim();if(!l)return null;let h=o(l);if(f){if(s>=h.length)return"[]";let g=h[s].trim();if(s+1===h.length&&g.startsWith("..."))return g.slice(3).trim();return`[${h.slice(s).map((d)=>d.trim()).join(", ")}]`}for(let g=0;g<h.length;g++){let d=h[g].trim(),p=!1;if(!d.startsWith("...")){let m=0;for(let C=0;C<d.length;C++){let T=d[C];if(T==="("||T==="["||T==="{"||T==="<")m++;else if(T===")"||T==="]"||T==="}"||T===">")m--;else if(m===0&&T===":"){let y=d.slice(0,C).trim();if(y.endsWith("?"))p=!0,y=y.slice(0,-1).trim();if(nt(y))d=d.slice(C+1).trim();break}}}if(d.startsWith("...")){let m=d.slice(3).trim();if(m.endsWith("[]"))return m.slice(0,-2).trim();if(m.startsWith("readonly ")&&m.endsWith("[]"))return m.slice(9,-2).trim();return null}if(g===s){let m=p;if(d.endsWith("?"))m=!0,d=d.slice(0,-1).trim();if(!d)return null;return m&&!a?`(${d}) | undefined`:d}}return null}if(i.endsWith("[]")){let l=i.slice(0,-2).trim();if(!l)return null;if(f)return`${l}[]`;if(l.length>=2&&l[0]==="("&&l[l.length-1]===")"&&t(l,0,"(",")")===l.length-1)return l.slice(1,-1).trim();return l}if((i.startsWith("Array<")||i.startsWith("ReadonlyArray<"))&&i.endsWith(">")){let l=i.indexOf("<");if(t(i,l,"<",">")===i.length-1){let h=i.slice(l+1,-1).trim();if(!h)return null;return f?`(${h})[]`:h}}return f?null:`(${e.trim()})[${s}]`}function be(e){let s=e.trim();if(s.startsWith("readonly "))s=s.slice(9).trim();if(s.endsWith("[]")){let f=s.slice(0,-2).trim();if(f.length>=2&&f[0]==="("&&f[f.length-1]===")"&&t(f,0,"(",")")===f.length-1)return f.slice(1,-1).trim();return f}if((s.startsWith("Set<")||s.startsWith("Iterable<")||s.startsWith("AsyncIterable<")||s.startsWith("Array<")||s.startsWith("ReadonlyArray<"))&&s.endsWith(">")){let f=s.indexOf("<");if(t(s,f,"<",">")===s.length-1)return s.slice(f+1,-1).trim()}if((s.startsWith("Generator<")||s.startsWith("AsyncGenerator<"))&&s.endsWith(">")){let f=s.indexOf("<");if(t(s,f,"<",">")===s.length-1){let a=o(s.slice(f+1,-1));if(a.length>0)return a[0].trim()}}if(s==="string")return"string";return"unknown"}function U(e,s,f){return e.startsWith(f,s)&&(s===0||!j(e.charCodeAt(s-1)))&&!j(e.charCodeAt(s+f.length))}function at(e,s){let f=e.trim();if(!f)return;if(f.startsWith("..."))f=f.slice(3).trim();if(nt(f)){s.push(f);return}if(f.length>=2&&f[0]==="["&&f[f.length-1]==="]"){for(let a of o(f.slice(1,-1))){let i=a.trim();if(!i)continue;let l=0;for(let h=0;h<i.length;h++){let g=i[h];if(g==="("||g==="["||g==="{"||g==="<")l++;else if(g===")"||g==="]"||g==="}"||g===">")l--;else if(l===0&&g==="="){i=i.slice(0,h).trim();break}}at(i,s)}return}if(f.length>=2&&f[0]==="{"&&f[f.length-1]==="}")for(let a of o(f.slice(1,-1))){let i=a.trim();if(!i)continue;let l=0,h=-1;for(let g=0;g<i.length;g++){let d=i[g];if(d==="("||d==="["||d==="{"||d==="<")l++;else if(d===")"||d==="]"||d==="}"||d===">")l--;else if(l===0&&d===":"&&h===-1)h=g;else if(l===0&&d==="="){i=i.slice(0,g).trim();break}}if(h!==-1&&h<i.length)i=i.slice(h+1).trim();at(i,s)}}function Jt(e,s){if(!e.includes("for")&&!e.includes("catch"))return;let f=[],a=0;while(a<e.length){let i=e.charCodeAt(a);if(i===34||i===39||i===96){a=G(e,a,i);continue}if(i===47&&e.charCodeAt(a+1)===47){while(a<e.length&&e.charCodeAt(a)!==10)a++;continue}if(i===47&&e.charCodeAt(a+1)===42){let l=e.indexOf("*/",a+2);a=l===-1?e.length:l+2;continue}if(U(e,a,"for")){let l=tt(e,a+3);if(U(e,l,"await"))l=tt(e,l+5);if(e.charCodeAt(l)===40){let h=t(e,l,"(",")");if(h!==-1){let g=tt(e,l+1),d=U(e,g,"const")?5:U(e,g,"let")?3:U(e,g,"var")?3:U(e,g,"using")?5:0;if(d>0){g=tt(e,g+d);let p=e.slice(g,h),m=0,C=-1,T=-1,y=0;while(y<p.length){let k=p.charCodeAt(y);if(k===34||k===39||k===96){y=G(p,y,k);continue}if(k===40||k===91||k===123||k===60)m++;else if(k===41||k===93||k===125||k===62)m--;else if(m===0){if(k===59){C=y;break}if(U(p,y,"of")||U(p,y,"in")){T=y;break}}y++}if(T!==-1)at(p.slice(0,T),f);else{let k=C===-1?p:p.slice(0,C);for(let W of o(k)){let w=W.trim(),N=0;for(let E=0;E<w.length;E++){let A=w[E];if(A==="("||A==="["||A==="{"||A==="<")N++;else if(A===")"||A==="]"||A==="}"||A===">")N--;else if(N===0&&(A==="="||A===":")){w=w.slice(0,E).trim();break}}at(w,f)}}}a=h+1;continue}}}else if(U(e,a,"catch")){let l=tt(e,a+5);if(e.charCodeAt(l)===40){let h=t(e,l,"(",")");if(h!==-1){let g=e.slice(l+1,h).trim(),d=0;for(let p=0;p<g.length;p++){let m=g[p];if(m==="("||m==="["||m==="{"||m==="<")d++;else if(m===")"||m==="]"||m==="}"||m===">")d--;else if(d===0&&m===":"){g=g.slice(0,p).trim();break}}at(g,f),a=h+1;continue}}}a++}for(let i of f)if(!s.has(i))s.set(i,"unknown")}var Pe=new Set(["PI","E","LN2","LN10","LOG2E","LOG10E","SQRT1_2","SQRT2"]),Ne=new Set(["MAX_SAFE_INTEGER","MIN_SAFE_INTEGER","MAX_VALUE","MIN_VALUE","EPSILON","POSITIVE_INFINITY","NEGATIVE_INFINITY","NaN"]),Ie=new Set(["iterator","asyncIterator","dispose","asyncDispose","toStringTag","hasInstance","isConcatSpreadable","match","matchAll","replace","search","species","split","toPrimitive","unscopables"]);function $t(e,s,f){if(f>=e.length||e.charCodeAt(f)!==47)return-1;let a=e.charCodeAt(f+1);if(a===47||a===42)return-1;let i=!1,l=f;while(l>s&&e.charCodeAt(l-1)<=32)l--;if(l===s)i=!0;else{let d=e[l-1];if("([{,;:=!?&|^~+-*%<>".includes(d))i=!0;else if(j(e.charCodeAt(l-1))){let p=l-1;while(p>s&&j(e.charCodeAt(p-1)))p--;let m=e.slice(p,l);if(m==="return"||m==="yield"||m==="typeof"||m==="void"||m==="in"||m==="of"||m==="await")i=!0}}if(!i)return-1;let h=f+1,g=!1;while(h<e.length){let d=e.charCodeAt(h);if(d===10||d===13)return-1;if(d===92){h+=2;continue}if(d===91)g=!0;else if(d===93)g=!1;else if(d===47&&!g){h++;while(h<e.length&&j(e.charCodeAt(h)))h++;return h}h++}return-1}function Re(e){if(e==="null"||e==="undefined")return"";if(!e.includes("|"))return e;let s=te(e);if(!s)return e;return s.filter((a)=>a!=="null"&&a!=="undefined").join(" | ")}function je(e,s,f){if(e.length<6)return;let a=e.charCodeAt(0);if(a===47){let i=$t(e,0,0);if(i!==-1&&i<e.length&&e.charCodeAt(i)===46){let l=e.slice(i+1);if(l.startsWith("test(")&&t(l,4,"(",")")===l.length-1)return"boolean";if(l.startsWith("exec(")&&t(l,4,"(",")")===l.length-1)return"RegExpExecArray | null"}}if(a===66&&e.startsWith("Boolean(")&&t(e,7,"(",")")===e.length-1)return"boolean";if(a===78){if(e.startsWith("Number(")&&t(e,6,"(",")")===e.length-1)return"number";if(e.startsWith("Number.")&&Ne.has(e.slice(7)))return"number"}if(a===83){if(e.startsWith("String(")&&t(e,6,"(",")")===e.length-1)return"string";if(e.startsWith("Symbol.")){let i=e.slice(7);if(i==="for"||i==="keyFor"||Ie.has(i))return`typeof ${e}`}}if(a===77&&e.startsWith("Math.")&&Pe.has(e.slice(5)))return"number";if(a===115&&e.startsWith("structuredClone(")&&t(e,15,"(",")")===e.length-1){let l=o(e.slice(16,-1).trim())[0]?.trim();if(l){if(X(l)&&!Wt(l))return`typeof ${l}`;let h=r(l,!1,!1,s+1,f);if(h!=="unknown")return h}}if(a===79&&e.startsWith("Object.seal(")&&t(e,11,"(",")")===e.length-1){let i=e.slice(12,-1).trim();if(i){if(X(i)&&!Wt(i))return`typeof ${i}`;let l=r(i,!1,!1,s+1,f);if(l!=="unknown")return l}}return}function Ue(e,s=!1,f="",a,i){let l=Tt(f,a);Jt(e,l);let h=[],g=!1,d=0;while(d<e.length){let C=e.charCodeAt(d);if(C===34||C===39||C===96){d=G(e,d,C);continue}if(C===47&&e.charCodeAt(d+1)===47){while(d<e.length&&e.charCodeAt(d)!==10)d++;continue}if(C===47&&e.charCodeAt(d+1)===42){let T=e.indexOf("*/",d+2);d=T===-1?e.length:T+2;continue}if(U(e,d,"function")||U(e,d,"class")){let T=le(e,d);if(T!==-1){d=st(e,T);continue}}if(C===61&&e.charCodeAt(d+1)===62){let T=tt(e,d+2);if(e.charCodeAt(T)===123){d=st(e,T);continue}}if(e.startsWith("yield",d)&&(d===0||!j(e.charCodeAt(d-1)))&&!j(e.charCodeAt(d+5))){d+=5;let T=!1;while(d<e.length&&e.charCodeAt(d)<=32){let x=e.charCodeAt(d);if(x===10||x===13)T=!0;d++}if(T||d>=e.length||e.charCodeAt(d)===59||e.charCodeAt(d)===125||e.charCodeAt(d)===41||e.charCodeAt(d)===93||e.charCodeAt(d)===44){g=!0;continue}let y=!1;if(e.charCodeAt(d)===42){y=!0,d++;while(d<e.length&&e.charCodeAt(d)<=32)d++}let k=d,W=0,w=0,N=0;while(d<e.length){let x=e.charCodeAt(d);if(x===34||x===39||x===96){d=G(e,d,x);continue}if(x===47&&e.charCodeAt(d+1)===47){if(W===0&&w===0&&N===0)break;while(d<e.length&&e.charCodeAt(d)!==10&&e.charCodeAt(d)!==13)d++;continue}if(x===47&&e.charCodeAt(d+1)===42){let S=e.indexOf("*/",d+2);d=S===-1?e.length:S+2;continue}if(x===47){let S=$t(e,k,d);if(S!==-1){d=S;continue}}if(x===40)W++;else if(x===41){if(W===0&&w===0&&N===0)break;W--}else if(x===91)w++;else if(x===93){if(w===0&&W===0&&N===0)break;w--}else if(x===123)N++;else if(x===125){if(N===0&&W===0&&w===0)break;N--}else if(x===59&&W===0&&w===0&&N===0)break;else if((x===10||x===13)&&W===0&&w===0&&N===0){let S=d+1;while(S<e.length&&e.charCodeAt(S)<=32)S++;if(S>=e.length||U(e,S,"yield")||U(e,S,"return")||e.charCodeAt(S)===125)break}d++}let E=e.slice(k,d).trim();if(!E){g=!0;continue}let A=et(H(E,l,a,i,k));if(y)A=be(A);if(s)A=mt(A);if(!h.includes(A))h.push(A);continue}d++}if(g&&!h.includes("undefined"))h.push("undefined");let p=h.length===0||h.includes("unknown")?"unknown":Et(h),m=O(e,!1,f,a,i);return`${s?"AsyncGenerator":"Generator"}<${p}, ${m}, unknown>`}function Tt(e,s){let f=new Map,a=e.startsWith("(")&&e.endsWith(")")?e.slice(1,-1):e,i=n(a),l=0,h=0,g=[];for(let d of i){let p=a.slice(d.start,d.end);if(p===","&&h===0)g.push(a.slice(l,d.start)),l=d.end;if(["(","[","{","<"].includes(p))h++;else if([")","]","}"].includes(p)||p===">"&&a[d.start-1]!=="=")h--}g.push(a.slice(l));for(let d of g){let p=n(d),m=-1,C=-1,T=0;for(let w of p){let N=d.slice(w.start,w.end);if(T===0&&N===":"&&m===-1)m=w.start;if(T===0&&N==="="&&d[w.end]!==">"){C=w.start;break}if(["(","[","{","<"].includes(N))T++;else if([")","]","}"].includes(N)||N===">"&&d[w.start-1]!=="=")T--}let y=d.slice(0,m!==-1?m:C!==-1?C:void 0).trim().replace(/^\.\.\./,"").replace(/\?$/,""),k=m===-1&&C!==-1&&!d.trim().startsWith("...")?Ae(y,d.slice(C+1)):null;if(k){for(let w of k)f.set(w.alias,s?.(w.value)??r(w.value,!1));continue}if(!nt(y)){if(y.startsWith("{")&&y.endsWith("}")&&m!==-1){let w=d.slice(m+1,C!==-1?C:void 0).trim();if(w)for(let N of o(y.slice(1,-1).trim())){let E=N.trim();if(!E||E.startsWith("..."))continue;let A=-1,x=-1,S=0;for(let _=0;_<E.length;_++){let K=E[_];if(K==="("||K==="["||K==="{")S++;else if(K===")"||K==="]"||K==="}")S--;else if(S===0){if(K===":"&&x===-1&&A===-1)x=_;else if(K==="="&&A===-1){A=_;break}}}let I=(A===-1?E:E.slice(0,A)).trim(),M=x===-1?I:I.slice(0,x).trim(),R=x===-1?I:I.slice(x+1).trim();if(!nt(M)||!nt(R))continue;let L=Me(w,M,A!==-1);if(L)f.set(R,L)}}else if(y.startsWith("[")&&y.endsWith("]")&&m!==-1){let w=d.slice(m+1,C!==-1?C:void 0).trim();if(w){let N=o(y.slice(1,-1).trim());for(let E=0;E<N.length;E++){let A=N[E].trim();if(!A)continue;let x=A.startsWith("..."),S=x?A.slice(3).trim():A,I=-1,M=0;for(let _=0;_<S.length;_++){let K=S[_];if(K==="("||K==="["||K==="{")M++;else if(K===")"||K==="]"||K==="}")M--;else if(M===0&&K==="="){I=_;break}}let R=(I===-1?S:S.slice(0,I)).trim();if(!nt(R))continue;let L=Oe(w,E,x,I!==-1);if(L)f.set(R,L)}}}if(y.startsWith("{")||y.startsWith("[")){for(let w of Ke(y))if(!f.has(w))f.set(w,"unknown")}continue}let W=m!==-1?d.slice(m+1,C!==-1?C:void 0).trim():"";if(!W&&C!==-1){let w=d.slice(C+1).trim();W=s?.(w)??r(w,!1)}if(W){if(C===-1&&d.slice(0,m).trim().endsWith("?"))W=`(${W}) | undefined`;f.set(y,W)}else f.set(y,"unknown")}return f}var Bt={string:{at:"string | undefined",charAt:"string",charCodeAt:"number",codePointAt:"number | undefined",concat:"string",endsWith:"boolean",includes:"boolean",indexOf:"number",lastIndexOf:"number",localeCompare:"number",normalize:"string",padEnd:"string",padStart:"string",repeat:"string",replace:"string",replaceAll:"string",search:"number",slice:"string",split:"string[]",startsWith:"boolean",substring:"string",toLocaleLowerCase:"string",toLocaleUpperCase:"string",toLowerCase:"string",toString:"string",toUpperCase:"string",trim:"string",trimEnd:"string",trimStart:"string",valueOf:"string"},number:{toExponential:"string",toFixed:"string",toLocaleString:"string",toPrecision:"string",toString:"string",valueOf:"number"},bigint:{toLocaleString:"string",toString:"string",valueOf:"bigint"},boolean:{toString:"string",valueOf:"boolean"}};function ts(e,s){let f=Object.hasOwn(Bt,e)?Bt[e]:void 0;return f&&Object.hasOwn(f,s)?f[s]:void 0}function B(e){return e.includes(`
9
+ `)?e.replaceAll(`
10
+ `,`
11
+ `):e}function Me(e,s,f){let a=e.trim();if(!a)return;if(a.startsWith("{")&&a.endsWith("}")&&t(a,0,"{","}")===a.length-1){let i=a.slice(1,-1),l=n(i),h=0,g=0;for(let d=0;d<=l.length;d++){let p=l[d],m=p?i.slice(p.start,p.end):";";if(g===0&&(m===";"||m===",")){let C=i.slice(h,p?.start).trim(),T=C.indexOf(":");if(T!==-1){let y=C.slice(0,T).trim();if(y.startsWith("readonly ")||y.startsWith("readonly\t"))y=y.slice(8).trim();let k=y.endsWith("?");if(k)y=y.slice(0,-1).trim();if(y===s){let W=C.slice(T+1).trim();if(!W)return;return k&&!f?`(${W}) | undefined`:W}}h=p?.end??i.length}if(["(","[","{","<"].includes(m))g++;else if([")","]","}"].includes(m)||m===">"&&p&&i[p.start-1]!=="=")g--}return}return f?`Exclude<(${a})["${s}"], undefined>`:`(${a})["${s}"]`}function Le(e,s){if(e=e.trim(),!e.startsWith("{")||!e.endsWith("}"))return;let f=e.slice(1,-1),a=n(f),i=0,l=0;for(let h=0;h<=a.length;h++){let g=a[h],d=g?f.slice(g.start,g.end):";";if(l===0&&(d===";"||d===",")){let p=f.slice(i,g?.start).trim(),m=p.indexOf(":");if(m!==-1&&p.slice(0,m).trim()===s)return p.slice(m+1).trim();i=g?.end??f.length}if(["(","[","{","<"].includes(d))l++;else if([")","]","}"].includes(d)||d===">"&&g&&f[g.start-1]!=="=")l--}return}function mt(e){let s=e;while(s.startsWith("Promise<")&&s.length>9&&s.endsWith(">")&&t(s,7,"<",">")===s.length-1)s=s.slice(8,-1);return s}function Be(e){if(!e)return!1;if(e==="true"||e==="false"||e==="null"||e==="undefined")return!0;let s=e.charCodeAt(0);if((s===39||s===34||s===96)&&e.length>=2&&e.charCodeAt(e.length-1)===s&&G(e,0,s)===e.length)return!0;if(b(e))return!0;if(v(e))return!0;return!1}function De(e,s){if(e.length<3||!e.endsWith(")"))return;let f=e.indexOf("(");if(f===-1||t(e,f,"(",")")!==e.length-1)return;let a=e.slice(0,f).trim();if(!X(a))return;let i=a.indexOf("."),l=i===-1?a:a.slice(0,i),h=s.get(l);if(!h)return;if(i===-1)return`ReturnType<${h}>`;let g=a.slice(i+1),d=ts(h.trim(),g);if(d)return d;let p=h;for(let m of g.split(".")){if(!nt(m))return"unknown";p=`(${p})["${m}"]`}return`ReturnType<${p}>`}function H(e,s,f,a,i=0,l=0){if(l>=xt)return"unknown";let h=e.trim();while(Rt(h))h=h.slice(1,-1).trim();let g=f?.(h);if(g)return g;if(Ct(h))return"JSX.Element";if(h.startsWith("await ")){let A=H(h.slice(6),s,f,a,i,l+1);return mt(A)}if(s.has(h))return s.get(h);let d=/^([\w$]+)\.([\w$]+(?:\.[\w$]+)*)$/.exec(h),p;if(d){let A=s.get(d[1]),x=A&&Le(A,d[2]);if(x)return x;if(A)p=`typeof ${h}`}if(h.length>1&&h.startsWith("!")&&rt(h.slice(1)))return"boolean";if(h.startsWith("fetch("))return"Promise<Response>";let m=De(h,s);if(m)return m;if(ae(h))return r(h,!1);let C=re(h);if(C){let A=H(C.whenTrue,s,f,a,i,l+1),x=H(C.whenFalse,s,f,a,i,l+1);return A===x?A:Et([A,x])}for(let A of["??","||","&&"]){let x=vt(h,A);if(x!==-1){let S=H(h.slice(0,x),s,f,a,i,l+1),I=H(h.slice(x+A.length),s,f,a,i,l+1);return _e(S,I,A)}}let T=Ut(h);if(T&&a)return a(T,i);let y=ne(h);if(y)return a?a(y,i):y;if(Ht(h))return"boolean";let k=0;for(let A=h.length-1;A>=0;A--){let x=h.charCodeAt(A);if(x===41||x===93||x===125)k++;else if(x===40||x===91||x===123)k--;else if(k===0&&(x===43||x===45||x===42||x===47||x===37)){if(h.slice(0,A).trim().length===0)break;let S=H(h.slice(0,A),s,f,a,i,l+1),I=H(h.slice(A+1),s,f,a,i,l+1);if(x===43&&(S==="string"||I==="string"))return"string";if(S==="number"&&I==="number")return"number";break}}if(h.length>=2&&h.endsWith("!")){let A=h.length;while(A>0&&h.charCodeAt(A-1)===33)A--;let x=h.slice(0,A).trim();if(x){let S=H(x,s,f,a,i,l+1);if(S!=="unknown")return`NonNullable<${S}>`}}if(h.length>8&&h.endsWith("as const")&&!j(h.charCodeAt(h.length-9))){let A=h.slice(0,-8).trim();if(A.startsWith("[")&&A.endsWith("]")&&t(A,0,"[","]")===A.length-1){let x=A.slice(1,-1).trim();if(!x)return"readonly []";let S=o(x),I=[];for(let M of S){let R=M.trim();if(R.startsWith("...")){let L=H(R.slice(3).trim(),s,f,a,i,l+1);I.push(L.startsWith("readonly [")||L.startsWith("[")||L.endsWith("[]")?`...${L}`:"...unknown[]")}else if(Be(R))I.push(r(R,!0));else I.push(H(R,s,f,a,i,l+1))}return`readonly [${I.join(", ")}]`}if(A.startsWith("{")&&A.endsWith("}")&&t(A,0,"{","}")===A.length-1)return se(A,!0,l+1,void 0,(x)=>H(x,s,f,a,i,l+1))}if(h.startsWith("[")&&h.endsWith("]")&&t(h,0,"[","]")===h.length-1){let A=h.slice(1,-1).trim();if(!A)return"never[]";let x=o(A);if(x.some((I)=>I.trim().startsWith("..."))){let I=x.map((M)=>{let R=M.trim();if(!R)return"undefined";let L=R.startsWith("..."),_=H(L?R.slice(3):R,s,f,a,i,l+1);return L?`(NonNullable<${_}> extends Iterable<infer Element> ? Element : never)`:_});return`(${[...new Set(I)].join(" | ")||"never"})[]`}let S;for(let I of x){let M=I.trim(),R=M?H(M,s,f,a,i,l+1):"undefined";S=S?Nt(S,R):R}if(!S)return"never[]";return pt([S])}let W=p??(h.startsWith("{")&&h.endsWith("}")&&t(h,0,"{","}")===h.length-1?se(h,!1,l+1,void 0,(A)=>H(A,s,f,a,i,l+1)):r(h,!1));if(W==="unknown"&&nt(h)&&a)return a(`typeof ${h}`,i);let w=n(W),N="",E=0;for(let A=0;A<w.length;A++){let x=w[A];if(x.kind!=="word"||W.slice(x.start,x.end)!=="typeof")continue;let S=w[A+1];if(!S||S.kind!=="word")continue;let I=s.get(W.slice(S.start,S.end)),M=I,R=!I,L=x.start,_=S.end,K=A,q=[];A++;while(w[A+1]&&W.slice(w[A+1].start,w[A+1].end)==="."&&w[A+2]?.kind==="word"){let V=w[A+2];if(q.push(W.slice(V.start,V.end)),!R)I=`(${I})["${W.slice(V.start,V.end)}"]`;_=V.end,A+=2}let J=w[A+1];if(J&&W.slice(J.start,J.end)==="<"){let V=t(W,J.start,"<",">");if(V!==-1){_=V+1;while(w[A+1]&&w[A+1].start<=V)A++;I=void 0,M=void 0,R=!0}}let ft=K>=2&&W.slice(w[K-2].start,w[K-2].end)==="ReturnType"&&W.slice(w[K-1].start,w[K-1].end)==="<"&&w[A+1]&&W.slice(w[A+1].start,w[A+1].end)===">",lt=M&&ft&&q.length===1?ts(M.trim(),q[0]):void 0;if(lt){L=w[K-2].start,_=w[++A].end;let V=L===0&&_===W.length;N+=W.slice(E,L)+(V||!lt.includes("|")?lt:`(${lt})`),E=_;continue}if(R&&ft)L=w[K-2].start,_=w[++A].end;N+=W.slice(E,L)+(I??"unknown"),E=_}return N+W.slice(E)}function Ut(e){let s=n(e),f=0,a=-1;for(let l=0;l<s.length;l++){let h=s[l],g=e.slice(h.start,h.end);if(h.kind!=="punctuation"&&h.kind!=="word")continue;if(["(","[","{"].includes(g))f++;else if([")","]","}"].includes(g))f--;else if(!f&&g==="as"&&l>0&&e.slice(s[l-1].start,s[l-1].end)!==".")a=l}if(a===-1||a+1===s.length)return;let i=e.slice(s[a].end).trim();if(i==="const")return;f=0;for(let l of s.slice(a+1)){let h=e.slice(l.start,l.end);if(l.kind==="word"){if(!f&&(h==="instanceof"||h==="in"||h==="satisfies"))return;continue}if(l.kind!=="punctuation")continue;if(!f&&["??","||","&&"].some((g)=>e.startsWith(g,l.start)))return;if(["(","[","{","<"].includes(h))f++;else if([")","]","}",">"].includes(h)){if(!f&&h===">"&&e[l.start-1]!=="=")return;if(f--,f<0)return}else if(!f&&["+","-","*","/","%","=","!",";"].includes(h))return}return i}function vt(e,s){let f=0;for(let a of n(e)){if(a.kind!=="punctuation")continue;let i=e.slice(a.start,a.end);if(["(","[","{"].includes(i))f++;else if([")","]","}"].includes(i))f--;if(!f&&e.startsWith(s,a.start))return a.start}return-1}function te(e){if(e.includes("=>"))return null;let s=[],f=0,a=0;for(let i=0;i<=e.length;i++){let l=i===e.length?"|":e[i];if(l==="'"||l==='"'||l==="`"){i++;while(i<e.length&&e[i]!==l)i+=e[i]==="\\"?2:1;if(i>=e.length)return null}else if(l==="("||l==="["||l==="{"||l==="<")f++;else if(l===")"||l==="]"||l==="}"||l===">")f--;else if(l==="|"&&f===0){let h=e.slice(a,i).trim();if(h)s.push(h);a=i+1}if(f<0)return null}return f===0?s:null}function Fe(e,s){let f=te(s);if(!f)return`${e} | ${s}`;let a=[];for(let p of[e,...f]){if(p==="unknown")return"unknown";if(!a.includes(p))a.push(p)}let i=a.includes("boolean")||a.includes("true")&&a.includes("false"),l=a.includes("string"),h=a.includes("number"),g=[],d=!1;for(let p of a)if(i&&(p==="true"||p==="false"||p==="boolean")){if(!d)g.push("boolean");d=!0}else if(l&&Ve(p))continue;else if(h&&/^-?\d+(?:\.\d+)?$/.test(p))continue;else g.push(p);return g.join(" | ")}function Ve(e){let s=e[0];return e.length>=2&&(s==="'"||s==='"')&&e.endsWith(s)&&!e.slice(1,-1).includes(s)}function _e(e,s,f){let a=ot(s)!==-1?`(${s.trim()})`:s;if(e.trim()==="unknown")return f==="&&"||a.trim()==="unknown"?"unknown":`{} | ${a}`;let i=e.trim();if(i==="boolean"||i==="string"||i==="number"){if(f==="??")return i;return Fe(f==="||"?i==="boolean"?"true":i:i==="boolean"?"false":i==="string"?"''":"0",a)}let l="false | 0 | 0n | '' | null | undefined";if(f==="??")return`([${e}] extends [NonNullable<${e}>] ? ${e} : NonNullable<${e}> | ${a})`;if(f==="||")return`([${e}] extends [object] ? ${e} : [Exclude<${e}, object> & (${l})] extends [never] ? ${e} : Exclude<NonNullable<${e}>, ${l}> | ${a})`;return`([${e}] extends [object] ? ${a} : [${e}] extends [${l}] ? ${e} : unknown extends (${e}) ? ${e} : (Exclude<${e}, object> & (${l})) | ${a})`}function Ge(e){let s=`(NonNullable<${e}> extends infer __dtsx_spread_value ? { -readonly [__dtsx_spread_key in keyof __dtsx_spread_value]: __dtsx_spread_value[__dtsx_spread_key] } : never)`,f=`(NonNullable<${e}> extends infer __dtsx_spread_value ? { -readonly [__dtsx_spread_key in keyof __dtsx_spread_value]?: __dtsx_spread_value[__dtsx_spread_key] } : never)`;return`([${e}] extends [null | undefined] ? {} : [${e}] extends [NonNullable<${e}>] ? ${s} : ${f})`}function qe(e,s){let f=e.trim();while(Rt(f))f=f.slice(1,-1).trim();let a=vt(f,"??");if(a!==-1&&f.slice(a+2).trim()==="{}")return Ge(s(f.slice(0,a)));let i=re(f);if(i){if(i.whenFalse.trim()==="{}")return`Partial<${s(i.whenTrue)}>`;if(i.whenTrue.trim()==="{}")return`Partial<${s(i.whenFalse)}>`}return s(f)}function Et(e){return e.map((s)=>e.length>1&&ot(s)!==-1?`(${s})`:s).join(" | ")}function ht(e){let s=0;while(s<e.length){let i=e.charCodeAt(s);if(i<=32)s++;else if(i===47&&e.charCodeAt(s+1)===47){s+=2;while(s<e.length&&e.charCodeAt(s)!==10&&e.charCodeAt(s)!==13)s++}else if(i===47&&e.charCodeAt(s+1)===42){let l=e.indexOf("*/",s+2);s=l===-1?e.length:l+2}else break}let f=s,a=s;while(a<e.length){let i=e.charCodeAt(a);if(i===34||i===39||i===96){a=G(e,a,i),f=a;continue}if(i===92){a=Math.min(a+2,e.length),f=a;continue}if(i===47&&e.charCodeAt(a+1)===47){while(a<e.length&&e.charCodeAt(a)!==10&&e.charCodeAt(a)!==13)a++;continue}if(i===47&&e.charCodeAt(a+1)===42){let l=e.indexOf("*/",a+2);a=l===-1?e.length:l+2;continue}if(a++,i>32)f=a}return e.slice(s,f)}function ne(e){if(!e.startsWith("<"))return;let s=D(e)(0,0);if(!s||s.parameters||s.completeOperand||!e.slice(s.end).trim()||!rt(e.slice(s.end).trim()))return;return e.slice(1,s.end-1).trim()}function sn(e){if(e.length<2||e[0]!=="/")return!1;let s=!1;for(let f=1;f<e.length;f++){let a=e[f];if(a==="\\"){f++;continue}if(a==="[")s=!0;else if(a==="]")s=!1;else if(a==="/"&&!s){for(let i=f+1;i<e.length;i++)if(!/[\w$]/.test(e[i]))return!1;return!0}}return!1}function rt(e){e=ht(e);while(e.length>0&&(e[0]==="!"||e[0]==="+"||e[0]==="-"||e[0]==="~"))e=ht(e.slice(1));if(!e)return!1;let s=0,f;for(let a=0;a<e.length;a++){let i=e[a];if(i==="'"||i==='"'||i==="`"){let l=a+1;while(l<e.length&&e[l]!==i){if(e[l]==="\\")l++;l++}a=l;continue}if(i==="/"){if(e[a+1]==="/"){let l=e.indexOf(`
12
+ `,a+2);a=l===-1?e.length:l;continue}if(e[a+1]==="*"){let l=e.indexOf("*/",a+2);a=l===-1?e.length:l+1;continue}if(u(e,a)){a=c(e,a)-1;continue}}if(i==="<"&&s===0){f??=D(e);let l=f(a,0);if(l){a=l.end-1;continue}}if(i==="("||i==="["||i==="{")s++;else if(i===")"||i==="]"||i==="}")s--;else if(s!==0)continue;else if(i==="?"){if(e[a+1]!==".")return!1}else if("=!<>&|+-*/%,:".includes(i))return!1;else if(i===" "||i==="\t"||i===`
13
+ `||i==="\r"){let l=e.slice(a).trimStart(),h=/[A-Za-z]+$/.exec(ht(e.slice(0,a)))?.[0];if(a=e.length-l.length-1,h&&["new","void","typeof","delete","await","yield"].includes(h))continue;if(l&&l[0]!=="."&&l[0]!=="?"&&l[0]!=="("&&l[0]!=="[")return!1}}return!0}function Rt(e){if(!e.startsWith("(")||!e.endsWith(")"))return!1;let s=0;for(let f=0;f<e.length;f++){let a=e.charCodeAt(f);if(a===40)s++;else if(a===41&&--s===0)return f===e.length-1}return!1}function re(e){let s=0,f=-1;for(let a=0;a<e.length;a++){let i=e.charCodeAt(a);if(i===34||i===39||i===96){a=G(e,a,i)-1;continue}if(i===47&&(e.charCodeAt(a+1)===47||e.charCodeAt(a+1)===42)){if(e.charCodeAt(a+1)===47)while(a+1<e.length&&e.charCodeAt(a+1)!==10&&e.charCodeAt(a+1)!==13)a++;else{let l=e.indexOf("*/",a+2);a=l===-1?e.length:l+1}continue}if(i===40||i===91||i===123)s++;else if(i===41||i===93||i===125)s--;else if(i===63&&s===0&&e.charCodeAt(a+1)!==63)f=a;else if(i===58&&s===0&&f!==-1)return{whenTrue:ht(e.slice(f+1,a)),whenFalse:ht(e.slice(a+1))}}return null}function gt(e,s,f){return(s===0||!j(e.charCodeAt(s-1)))&&!j(e.charCodeAt(s+f))}function tt(e,s){let f=s;while(f<e.length){if(e.charCodeAt(f)<=32){f++;continue}if(e.startsWith("//",f)){while(f<e.length&&e.charCodeAt(f)!==10&&e.charCodeAt(f)!==13)f++;continue}if(e.startsWith("/*",f)){let a=e.indexOf("*/",f+2);f=a<0?e.length:a+2;continue}break}return f}function le(e,s){let f=0,a=0,i=0,l=!1,h=!1;for(let g=s;g<e.length;g++){if(g=tt(e,g),g>=e.length)break;let d=e.charCodeAt(g);if(d===34||d===39||d===96){g=G(e,g,d)-1,h=!1;continue}if(j(d)||d>=128){let p=g;while(g+1<e.length&&(j(e.charCodeAt(g+1))||e.charCodeAt(g+1)>=128))g++;h=l&&["keyof","typeof","readonly","unique","new","abstract","infer","extends"].includes(e.slice(p,g+1));continue}if(d===61&&e.charCodeAt(g+1)===62){g++,h=l;continue}if(d===40)f++;else if(d===41)f--,h=!1;else if(d===91)a++;else if(d===93)a--,h=!1;else if(d===60&&f===0&&a===0)i++;else if(d===62&&i>0&&f===0&&a===0)i--,h=!1;else if(d===123)if(f||a||i||l&&h)g=st(e,g)-1,h=!1;else return g;else if(f===0&&a===0&&i===0){if(d===58)l=!0,h=!0;else if(l&&[124,38,63].includes(d))h=!0;else if(d===59)return-1}}return-1}function st(e,s){let f=1,a=s+1;while(a<e.length&&f>0){let i=e.charCodeAt(a);if(i===34||i===39||i===96){a=G(e,a,i);continue}if(i===47&&e.charCodeAt(a+1)===47){a+=2;while(a<e.length&&e.charCodeAt(a)!==10&&e.charCodeAt(a)!==13)a++;continue}if(i===47&&e.charCodeAt(a+1)===42){let l=e.indexOf("*/",a+2);a=l===-1?e.length:l+2;continue}if(i===123)f++;else if(i===125)f--;a++}return a}function G(e,s,f){let a=s+1;while(a<e.length){let i=e.charCodeAt(a);if(i===92){a+=2;continue}if(f===96&&i===36&&e.charCodeAt(a+1)===123){a=st(e,a+1);continue}if(a++,i===f)break}return a}function Ye(e,s){if(e.includes(".raw`")||e.includes("String.raw`"))return"string";if(!s||e.includes("${")||e.includes(`
14
+ `)||e.includes("\r"))return"string";return e}function Se(e,s,f){let a=n(e),i=(m)=>a[m]?e.slice(a[m].start,a[m].end):"";if(i(0)!=="new"||a[1]?.kind!=="word"||["class","function","new","super"].includes(i(1)))return"unknown";let l=2,h=[i(1)];while(i(l)==="."&&a[l+1]?.kind==="word")h.push(i(l+1)),l+=2;let g=h.join(".");if(!s&&(g.charCodeAt(0)<65||g.charCodeAt(0)>90))return"unknown";let d="";if(i(l)==="<"){let m=a[l].start,C=D(e)(m,0);if(!C||!C.completeOperand||C.parameters)return"unknown";d=e.slice(m,C.end);while(l<a.length&&a[l].start<C.end)l++}let p="";if(l<a.length){if(i(l)!=="(")return"unknown";let m=a[l].end,C=0,T=!1;for(;l<a.length;l++)if(i(l)==="(")C++;else if(i(l)===")"&&--C===0){T=l===a.length-1,p=e.slice(m,a[l].start).trim();break}if(!T)return"unknown"}if(s){if(!d&&p.length>=2){if(g==="Map"&&!f?.("Map")){let m=Kt(p);if(m)return m}else if(g==="Set"&&!f?.("Set")){let m=Dt(p);if(m)return m}}return s(g)?g+d:`InstanceType<typeof ${g}${d}>`}if(d)return g+d;switch(g){case"Map":return Kt(p)??"Map<any, any>";case"Set":return Dt(p)??"Set<any>";case"WeakMap":return"WeakMap<any, any>";case"WeakSet":return"WeakSet<any>";case"Array":return"any[]";case"Object":return"object";case"Promise":return"Promise<any>";default:return g}}function Dt(e){if(e.length<2||e[0]!=="["||e[e.length-1]!=="]")return null;if(t(e,0,"[","]")!==e.length-1)return null;let s=o(e.slice(1,-1));if(s.length===0)return null;let f=Y,a=F;Y=!1;try{let i=[];for(let l of s){let h=l.trim();if(!h||h.startsWith("..."))return null;let g=r(h,!1,!0,1);if(g==="unknown")return null;if(!i.includes(g))i.push(g)}return i.length>0?`Set<${i.join(" | ")}>`:null}finally{Y=f,F=a}}function Kt(e){if(e.length<2||e[0]!=="["||e[e.length-1]!=="]")return null;if(t(e,0,"[","]")!==e.length-1)return null;let s=o(e.slice(1,-1));if(s.length===0)return null;let f=Y,a=F;Y=!1;try{let i=[],l=[];for(let h of s){let g=h.trim();if(g.length<2||g[0]!=="["||g[g.length-1]!=="]")return null;if(t(g,0,"[","]")!==g.length-1)return null;let d=o(g.slice(1,-1));if(d.length!==2)return null;let p=d[0].trim(),m=d[1].trim();if(!p||!m||p.startsWith("...")||m.startsWith("..."))return null;let C=r(p,!1,!0,1),T=r(m,!1,!0,1);if(C==="unknown"||T==="unknown")return null;if(!i.includes(C))i.push(C);if(!l.includes(T))l.push(T)}return i.length>0&&l.length>0?`Map<${i.join(" | ")}, ${l.join(" | ")}>`:null}finally{Y=f,F=a}}function Qe(e){return"{ new (...args: any[]): any }"}function Je(e,s,f){let a=e.indexOf("(");if(a===-1)return"Promise<unknown>";let i=t(e,a,"(",")");if(i!==e.length-1)return"Promise<unknown>";if(i<=a+1)return"Promise<never>";let l=e.slice(a+1,i).trim();if(l.length<2||l[0]!=="["||l[l.length-1]!=="]")return"Promise<unknown>";let h=o(l.slice(1,-1));if(h.length===0)return"Promise<never>";let g=[];for(let d of h){let p=r(d,!1,!0,s+1,f);if(p.startsWith("Promise<")&&p.endsWith(">")&&t(p,7,"<",">")===p.length-1)p=p.slice(8,-1);if(p!=="never"&&!g.includes(p))g.push(p)}return g.length===0?"Promise<never>":`Promise<${g.join(" | ")}>`}function Xe(e,s,f){let a=e.indexOf("(");if(a===-1)return"Promise<PromiseSettledResult<unknown>[]>";let i=t(e,a,"(",")");if(i!==e.length-1)return"Promise<unknown>";if(i<=a+1)return"Promise<[]>";let l=e.slice(a+1,i).trim();if(l.length<2||l[0]!=="["||l[l.length-1]!=="]")return"Promise<PromiseSettledResult<unknown>[]>";let h=o(l.slice(1,-1)),g=[];for(let d of h){let p=mt(r(d,!1,!1,s+1,f));g.push(`PromiseSettledResult<${p}>`)}return`Promise<[${g.join(", ")}]>`}function ce(e,s,f=0,a){if(e.startsWith("Promise.withResolvers")){let i=e.slice(21);if(i.length>=2&&i[0]==="("&&t(i,0,"(",")")===i.length-1)return"PromiseWithResolvers<unknown>";if(i.length>=4&&i[0]==="<"){let l=t(i,0,"<",">");if(l!==-1){let h=i.slice(l+1).trim();if(h.length>=2&&h[0]==="("&&t(h,0,"(",")")===h.length-1){let g=i.slice(1,l).trim();return g?`PromiseWithResolvers<${g}>`:"PromiseWithResolvers<unknown>"}}}}if(e.startsWith("Promise.resolve<")){let l=t(e,15,"<",">");if(l!==-1){let h=e.slice(l+1).trim();if(h.length>=2&&h[0]==="("&&t(h,0,"(",")")===h.length-1){let g=e.slice(16,l).trim();if(g)return`Promise<${g}>`}}}if(e.startsWith("Promise.resolve(")){let l=t(e,15,"(",")");if(l!==e.length-1)return"Promise<unknown>";let h=e.slice(16,l).trim();if(!h)return"Promise<void>";return`Promise<${r(h,s,!1,f+1,a)}>`}if(e.startsWith("Promise.reject(")){if(t(e,14,"(",")")!==e.length-1)return"Promise<unknown>";return"Promise<never>"}if(e.startsWith("Promise.race(")||e.startsWith("Promise.any("))return Je(e,f,a);if(e.startsWith("Promise.allSettled("))return Xe(e,f,a);if(e.startsWith("Promise.all(")){let l=t(e,11,"(",")");if(l!==e.length-1)return"Promise<unknown>";let h=e.slice(12,l).trim();if(h.length>1&&h[0]==="["&&h[h.length-1]==="]"){let g=h.slice(1,-1).trim(),d=o(g);if(d.length>0){let p=[];for(let m=0;m<d.length;m++){let C=d[m].trim();if(C.startsWith("Promise.resolve(")||C.startsWith("Promise.resolve<"))p.push(mt(ce(C,s,f+1,a)));else p.push(r(C,s,!1,f+1,a))}return`Promise<[${p.join(", ")}]>`}}return"Promise<unknown[]>"}return"Promise<unknown>"}function ie(e,s,f=0,a){let i=e.slice(1,-1).trim();if(!i)return"never[]";if(f>=xt)return"unknown[]";let l=o(i),h=!1;for(let y=0;y<l.length;y++){let k=l[y],W=k.length;while(W>0&&k.charCodeAt(W-1)<=32)W--;if(W>=8&&k.slice(W-8,W)==="as const"){h=!0;break}}if(h){let y=[];for(let k=0;k<l.length;k++){let W=l[k].trim();if(W.endsWith("as const")){let w=W.slice(0,-8).trim();if(w.startsWith("[")&&w.endsWith("]")){let N=w.slice(1,-1).trim(),E=o(N),A=[];for(let x=0;x<E.length;x++)A.push(r(E[x].trim(),!0,!1,f+1,a));y.push(`readonly [${A.join(", ")}]`)}else y.push(r(w,!0,!1,f+1,a))}else if(W.startsWith("[")&&W.endsWith("]"))y.push(ie(W,!0,f+1,a));else y.push(r(W,!0,!1,f+1,a))}return`readonly [
15
+ ${y.join(` |
16
+ `)}
17
+ ]`}let g=Y&&!s,d=[],p=[];for(let y of l){let k=y.trim(),W=F;if(F=null,k.startsWith("...")){let w=k.slice(3).trim(),N=r(w,!1,!1,f+1,a);if(N.endsWith("[]"))d.push(N.slice(0,-2));else if(N.startsWith("readonly [")&&N.endsWith("]"))d.push(N.slice(10,-1));else if(X(w))d.push(`(typeof ${w})[number]`);else d.push("unknown")}else if(k.startsWith("[")&&k.endsWith("]"))d.push(ie(k,s,f+1,a));else d.push(rn(k,s,f+1,a));if(g)p.push(F);F=W}if(g)if(It(e))F=wt(e);else{let y=[];for(let k=0;k<l.length;k++){let W=l[k].trim();if(W.endsWith("as const"))continue;if(kt(W)||W==="null"||W==="undefined")y.push(W);else if(W.startsWith("...")&&W.length>3)y.push(W);else if(W.startsWith("[")&&It(W))y.push(wt(W));else if(W.startsWith("{")){if(p[k])y.push(p[k])}else{let w=r(W,!1,!1,0,a);if(w!=="unknown")y.push(w)}}if(y.length>0)F=`[${y.join(", ")}]`}if(s)return`readonly [${d.join(", ")}]`;let m=new Set,C=[],T=!0;for(let y of d){if(!m.has(y))m.add(y),C.push(y);if(T){if(!(b(y)||y==="true"||y==="false"||y.charCodeAt(0)===34&&y.charCodeAt(y.length-1)===34||y.charCodeAt(0)===39&&y.charCodeAt(y.length-1)===39))T=!1}}if(T&&d.length<=10)return`readonly [${d.join(", ")}]`;if(C.length===1)return`${C[0]}[]`;return`(${C.join(" | ")})[]`}function o(e){let s=[],f=0,a=!1,i=0,l=-1,h=0;for(let g=0;g<e.length;g++){let d=e.charCodeAt(g);if(a){if(d===92)g++;else if(d===i)a=!1;h=g+1;continue}if(d===47&&e.charCodeAt(g+1)===47){let p=e.indexOf(`
18
+ `,g+2);g=(p===-1?e.length:p)-1;continue}if(d===47&&e.charCodeAt(g+1)===42){let p=e.indexOf("*/",g+2);g=(p===-1?e.length:p+2)-1;continue}if(d===47&&u(e,g)){if(l===-1)l=g;let p=c(e,g);h=p,g=p-1;continue}if(d===32||d===9||d===10||d===13)continue;if(d===44&&f===0){if(l!==-1)s.push(e.slice(l,h));l=-1;continue}if(d===34||d===39||d===96)a=!0,i=d;else if(d===91||d===123||d===40)f++;else if(d===93||d===125||d===41)f--;if(l===-1)l=g;h=g+1}if(l!==-1)s.push(e.slice(l,h));return s}function kt(e){if(b(e))return!0;if(e==="true"||e==="false")return!0;if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return!0;return!1}function fe(e){return e==="number"||e==="string"||e==="boolean"}function xr(e){let s=[],f=0;while(f<e.length){while(f<e.length&&e.charCodeAt(f)<=32)f++;if(e.startsWith("/*",f)){let a=e.indexOf("*/",f+2);if(a===-1)break;s.push(e.slice(f,a+2)),f=a+2}else if(e.startsWith("//",f)){let a=f;while(a<e.length&&e.charCodeAt(a)!==10&&e.charCodeAt(a)!==13)a++;s.push(e.slice(f,a).trimEnd()),f=a}else break}return s}function on(e,s,f){let a=s.trim();if(!fe(f)||!kt(a))return"";let i=(e??[]).map((h)=>h.trim()).filter((h)=>h.startsWith("/**")||h.startsWith("//")).join(`
19
+ `),l;if(i.includes("@defaultValue"))l=i;else{let h=`@defaultValue ${Ee(a)}`;if(!i)l=`/** ${h} */`;else{let g=i.lastIndexOf("*/");if(g!==-1){let d=i.slice(0,g).trimEnd();if(d.startsWith("/** ")&&!d.includes(`
20
+ `))d=`/**
21
+ * ${d.slice(4)}`;l=`${d}
22
+ * ${h}
23
+ */`}else l=`/**
24
+ * ${i.startsWith("// ")?i.slice(3):i.startsWith("//")?i.slice(2):i}
25
+ * ${h}
26
+ */`}}return l.split(`
27
+ `).map((h)=>{let g=h.trim();if(!g)return"";return g.startsWith("*")?` ${g}`:` ${g}`}).join(`
28
+ `)+`
29
+ `}function It(e){let s=!1,f=0,a=e.length;for(let i=0;i<a;i++){let l=e.charCodeAt(i);if(s){if(l===92){i++;continue}if(l===f)s=!1;continue}if(l===34||l===39||l===96){s=!0,f=l;continue}if(l===61&&i+1<a&&e.charCodeAt(i+1)===62)return!1;if(l===47&&(e.charCodeAt(i+1)===47||e.charCodeAt(i+1)===42))return!1;if(l>=97&&l<=122||l>=65&&l<=90||l===95||l===36){let h=i;while(i<a&&(e.charCodeAt(i)>=97&&e.charCodeAt(i)<=122||e.charCodeAt(i)>=65&&e.charCodeAt(i)<=90||e.charCodeAt(i)>=48&&e.charCodeAt(i)<=57||e.charCodeAt(i)===95||e.charCodeAt(i)===36))i++;let g=e.slice(h,i),d=i;while(d<a&&e.charCodeAt(d)<=32)d++;if(d<a&&e.charCodeAt(d)===58){i--;continue}if(d<a&&e.charCodeAt(d)===40)return!1;if(g!=="true"&&g!=="false"&&g!=="null"&&g!=="undefined"&&g!=="const"&&g!=="as")return!1;i--}}return!0}function se(e,s,f=0,a,i){let l=e.slice(1,-1).trim();if(!l)return"{}";if(f>=xt)return"Record<string, unknown>";let h=ln(l),g=new Set,d=!1;for(let[A]of h){let x=bt(At(A).key);if(x?.kind==="get")g.add(x.name);else if(x?.kind==="set")d=!0}let p=new Map;if(d&&g.size>0)for(let[A,x]of h){let S=At(A).key,I=bt(S);if(I?.kind!=="get")continue;let M=x.trim(),R=qt(M)?Pt(S,M):i?.(x)??r(x,s,!1,f+1,a),L=Gt("get",R);if(L&&L!=="unknown")p.set(I.name,L)}let m=[],C=[],T=[],y=!1,k=Y&&!s,W=[],w=0;for(let[A,x]of h){let{comments:S,key:I}=At(A),M=S?`${S}
30
+ `:"",R=bt(I);if(R&&Ar(R.name))continue;let L=I,_=!1;if(I==="..."){let Q=x.trim(),it=i?qe(Q,i):X(Q)?`typeof ${Q}`:r(Q,s,!1,f+1,a);if(it!=="unknown")C.push(it);if(k&&(X(Q)||Q.startsWith("{")))W.push(`...${wt(Q)}`);continue}let K=F;F=null;let q,J=x.trim();if(J===I&&nt(J))q=i?.(x)??(s?void 0:a?.mutableBindingTypes?.get(J))??`typeof ${J}`;else if(qt(J)){_=!0;let Q=hn(I);if(Q){L=Q.name;let it="";if(J.startsWith("async "))it="async ";if(J.charCodeAt(it.length)===42)it+="*";q=Pt(Q.name,it+Q.typeParams+J.slice(it.length))}else q=Pt(I,J)}else{if(q=i?.(x)??r(x,s,!1,f+1,a),q==="unknown"&&X(J))q=(s?void 0:a?.mutableBindingTypes?.get(J))??`typeof ${J}`;if(q.includes("=>")||q.includes("function")||q.includes("async"))q=Ft(q)}let ft=F;F=K;let lt=L,V=x.trim(),ut=kr(L,a);if(!Er(R?.name??L,a)&&!(R?.kind==="set"&&g.has(R.name)))T.push(R?Gt(R.kind,q):q);if(ut&&"index"in ut)y=!0;else{if(ut&&"name"in ut)L=ut.name;if(R){let Q=un(R.kind,R.name,q,R.kind==="set"?p.get(R.name):void 0);if(Q){m.push(`${M}${B(Q)}`);continue}}if(!s&&fe(q)&&kt(V))m.push(`${M}/** @defaultValue ${Ee(V)} */
31
+ ${L}: ${B(q)}`);else m.push(`${M}${s?"readonly ":""}${L}: ${B(q)}`)}if(k){let Q=Yt(lt);if(V.endsWith("as const"));else if(kt(V))W.push(`${Q}: ${V}`);else if(V.startsWith("[")&&It(V))W.push(`${Q}: ${wt(V)}`);else if(V.startsWith("{")){if(ft)W.push(`${Q}: ${ft}`)}else if(_)W.push(`${Q}: ${et(Ft(q))}`),w++;else if(!V.startsWith("[")&&(V.includes("=>")||V.startsWith("function")||V.startsWith("async"))){let it=ee(V,!1,0,!0);W.push(`${Q}: ${et(it)}`),w++}}}if(k&&W.length>w){let A=f>0?(f-1)/2:0,x=`{ ${W.join(", ")} }`;if(x.length<=80)F=x;else{let S=" ".repeat((A+1)*2),I=" ".repeat(A*2);F=`{
32
+ ${S}${W.join(`,
33
+ ${S}`)}
34
+ ${I}}`}}if(y&&C.length===0){let A=[...new Set(T)].map((x)=>x.includes("=>")||x.includes(" & ")?`(${x})`:x);m.unshift(`${s?"readonly ":""}[x: string]: ${B(A.join(" | "))}`)}let N=m.length>0?`{
35
+ ${m.join(`;
36
+ `)}
37
+ }`:"{}";if(C.length===0)return N;let E=C[0];for(let A=1;A<C.length;A++)E=`Omit<${E}, keyof ${C[A]}> & ${C[A]}`;return m.length>0?`Omit<${E}, keyof ${N}> & ${N}`:E}function nt(e){if(!e)return!1;let s=e.charCodeAt(0);if(!(s>=65&&s<=90||s>=97&&s<=122||s===95||s===36||s>127))return!1;for(let f=1;f<e.length;f++)if(!j(e.charCodeAt(f)))return!1;return!0}function X(e){let s=e.split(".");return s.length>0&&s.every(nt)}function Ze(e){let s=!1,f="";for(let a=0;a<e.length;a++){let i=e[a];if(s){if(i==="\\")a++;else if(i===f)s=!1;continue}if(i==='"'||i==="'"||i==="`"){s=!0,f=i;continue}if(i==="(")return a;if(i==="<"){let l=t(e,a,"<",">");if(l!==-1)a=l}}return-1}function Z(e){if(e.length<3||!e.endsWith(")"))return null;let s=Ze(e);if(s===-1||t(e,s,"(",")")!==e.length-1)return null;let f=e.slice(0,s).trim(),a=!1;if(f.endsWith("?."))a=!0,f=f.slice(0,-2).trim();let i=f,l=!1,h=f.indexOf("<");if(h!==-1){if(t(f,h,"<",">")!==f.length-1)return null;i=f.slice(0,h).trim(),l=!0}if(i.endsWith("?.")){a=!0;let y=f.slice(i.length);i=i.slice(0,-2).trim(),f=i+y}if(!X(i))return null;let g=e.slice(s+1,-1).trim(),d=ot(g)!==-1||g.startsWith("function")||g.startsWith("async function"),p=X(g),m=!d&&g.endsWith(")")&&Z(g)!==null,C=i.indexOf(".");if(C!==-1){if(i.indexOf(".",C+1)!==-1)return null}else if(!l&&!a&&!d&&!p&&!m)return null;let T=`ReturnType<typeof ${f}>`;return a?`ReturnType<NonNullable<typeof ${f}>> | (null extends typeof ${i} ? undefined : undefined extends typeof ${i} ? undefined : never)`:T}function Ft(e){let f=e.split(`
38
+ `).map((m)=>ue(m)).join(`
39
+ `),a=f.indexOf("async");if(a!==-1){let m=a>0?f.charCodeAt(a-1):32,C=a+5<f.length?f.charCodeAt(a+5):32;if(!j(m)&&!j(C))f=(f.slice(0,a)+f.slice(a+5)).trim()}let i=f.indexOf("(");if(i!==-1){let m=t(f,i,"(",")");if(m!==-1){let C=f.slice(i,m+1),T=$e(C);f=f.slice(0,i)+T+f.slice(m+1)}}let l=f.length,h="",g=[],d=!1,p=!1;for(let m=0;m<l;m++){let C=f.charCodeAt(m);if(C===123||C===40)g.push(C);else if(C===125||C===41)g.pop();if(C<=32){if(d=!0,C===10||C===13)p=!0;continue}if(d&&h.length>0){let y=(g.length>0?g[g.length-1]:0)===123;if(p&&y){let k=h.charCodeAt(h.length-1),W=k===59||k===44||k===123||C===125,w=h.length>=2&&h.charCodeAt(h.length-1)===47&&h.charCodeAt(h.length-2)===42;if(!W&&!w)h+="; ";else h+=" "}else h+=" "}d=!1,p=!1,h+=f[m]}return h.trim()}function j(e){return e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===95||e===36}function $e(e){let s=e.trim(),f,a=!1;if(s.startsWith("(")&&s.endsWith(")"))f=s.slice(1,-1),a=!0;else f=s;let i=f.trim();if(!i)return a?"()":"";let l=!1;{let k=0,W=!1;for(let w=0;w<i.length;w++){let N=i.charCodeAt(w);if(k===0&&(N===91||N===123))W=!0;if(N===40||N===60||N===91||N===123)k++;else if(N===41||N===93||N===125||N===62&&i.charCodeAt(w-1)!==61){if(k--,k===0)W=!1}else if((k===0||W)&&N===61){let E=w>0?i.charCodeAt(w-1):0,A=w+1<i.length?i.charCodeAt(w+1):0;if(E!==61&&E!==33&&E!==60&&E!==62&&A!==61&&A!==62){l=!0;break}}}}if(!l)return s;let h=[],g=[],d=0,p=0,m=!1,C=0;for(let k=0;k<=i.length;k++){if(k===i.length){h.push(i.slice(d));break}let W=i.charCodeAt(k);if(m){if(W===92){k++;continue}if(W===C)m=!1;continue}if(W===47&&k+1<i.length){let w=i.charCodeAt(k+1);if(w===42){k+=2;while(k+1<i.length&&!(i.charCodeAt(k)===42&&i.charCodeAt(k+1)===47))k++;k++;continue}if(w===47){while(k<i.length&&i.charCodeAt(k)!==10)k++;continue}}if(W===39||W===34||W===96){m=!0,C=W;continue}if(W===40||W===60||W===91||W===123)p++;else if(W===41||W===93||W===125||W===62&&i.charCodeAt(k-1)!==61)p--;else if(W===44&&p===0){h.push(i.slice(d,k));let w=",",N=k+1;while(N<i.length&&i.charCodeAt(N)<=32)w+=i[N],N++;g.push(w),d=N}}let T=[];for(let k of h){let W=k.trim();if(!W){T.push(k);continue}if(W.startsWith("//"))continue;let w=ue(W),N=k.slice(0,k.length-k.trimStart().length);T.push(N+he(w))}let y=T[0]||"";for(let k=1;k<T.length;k++)y+=(g[k-1]||", ")+T[k];return ze(a?`(${y})`:y)}function ue(e){let s=!1,f=0;for(let a=0;a<e.length-1;a++){let i=e.charCodeAt(a);if(s){if(i===92){a++;continue}if(i===f)s=!1;continue}if(i===39||i===34||i===96){s=!0,f=i;continue}if(i===47&&e.charCodeAt(a+1)===47)return e.slice(0,a).trimEnd()}return e}function dt(e){if(!e.includes("="))return e;let s=e.trim();if(s.length<2)return e;let f=s[0],a=f==="{"?"}":f==="["?"]":"";if(!a||s[s.length-1]!==a)return e;let i=s.slice(1,-1).trim();if(!i)return s;let l=o(i),h=[];for(let g of l){let d=g.trim();if(!d)continue;let p=-1,m=-1,C=0,T=!1,y=0;for(let W=0;W<d.length;W++){let w=d.charCodeAt(W);if(T){if(w===92){W++;continue}if(w===y)T=!1;continue}if(w===39||w===34||w===96){T=!0,y=w;continue}if(w===40||w===60||w===91||w===123)C++;else if(w===41||w===93||w===125||w===62&&d.charCodeAt(W-1)!==61)C--;else if(C===0){if(w===58&&m===-1&&p===-1)m=W;else if(w===61&&(W===0||d.charCodeAt(W-1)!==61)&&(W+1>=d.length||d.charCodeAt(W+1)!==61&&d.charCodeAt(W+1)!==62)){p=W;break}}}let k=(p===-1?d:d.slice(0,p)).trim();if(f==="{")if(m!==-1){let W=k.slice(0,m).trim(),w=k.slice(m+1).trim();h.push(`${W}: ${w.length>=2&&(w[0]==="{"||w[0]==="[")?dt(w):w}`)}else h.push(k);else h.push(k.length>=2&&(k[0]==="{"||k[0]==="[")?dt(k):k)}return f==="{"?`{ ${h.join(", ")} }`:`[${h.join(", ")}]`}function he(e){if(e.startsWith("...")){let g=e.slice(3).trim();if(g.length>0&&(g[0]==="["||g[0]==="{")&&g.includes("="))return`...${he(g)}`;return e}let s=-1,f=-1,a=0,i=!1,l=0;for(let g=0;g<e.length;g++){let d=e.charCodeAt(g);if(i){if(d===92){g++;continue}if(d===l)i=!1;continue}if(d===47&&g+1<e.length){let p=e.charCodeAt(g+1);if(p===42){g+=2;while(g+1<e.length&&!(e.charCodeAt(g)===42&&e.charCodeAt(g+1)===47))g++;g++;continue}if(p===47){while(g<e.length&&e.charCodeAt(g)!==10)g++;continue}}if(d===39||d===34||d===96){i=!0,l=d;continue}if(d===40||d===60||d===91||d===123)a++;else if(d===41||d===93||d===125||d===62&&e.charCodeAt(g-1)!==61)a--;else if(a===0){if(d===58&&s===-1)s=g;else if(d===61&&f===-1&&(g===0||e.charCodeAt(g-1)!==61)&&(g+1>=e.length||e.charCodeAt(g+1)!==61&&e.charCodeAt(g+1)!==62))f=g}}let h=f!==-1;if(s!==-1&&(f===-1||s<f)){let g=e.slice(0,s).trim(),d=g.endsWith("?"),p=d?g.slice(0,-1).trim():g;if(p.length>=2&&(p[0]==="["||p[0]==="{")&&p.includes("=")){let T=dt(p);g=d?`${T}?`:T}let m=f!==-1?e.slice(s+1,f).trim():e.slice(s+1).trim(),C=h&&!g.endsWith("?")?"?":"";return`${g}${C}: ${m}`}else if(f!==-1){let g=e.slice(0,f).trim(),d=Ae(g,e.slice(f+1));if(d)return He(d,Vt);let p=g.length>=2&&(g[0]==="["||g[0]==="{")&&g.includes("=")?dt(g):g,m=!p.endsWith("?")?"?":"";return`${p}${m}: ${Vt(e.slice(f+1))}`}if(e.length>=2&&(e[0]==="["||e[0]==="{")&&e.includes("="))return dt(e);return e}function Vt(e){let s=e.trim();if(s==="true"||s==="false")return"boolean";if(b(s))return"number";if(s.startsWith("'")&&s.endsWith("'")||s.startsWith('"')&&s.endsWith('"'))return"string";if(s.startsWith("["))return"unknown[]";if(s.startsWith("{"))return"Record<string, unknown>";return"unknown"}function ve(e){let s=0,f=e.length;while(s<f){while(s<f&&(e.charCodeAt(s)===32||e.charCodeAt(s)===9||e.charCodeAt(s)===10||e.charCodeAt(s)===13))s++;if(s+1<f&&e.charCodeAt(s)===47&&e.charCodeAt(s+1)===42){s+=2;while(s+1<f&&!(e.charCodeAt(s)===42&&e.charCodeAt(s+1)===47))s++;s+=2;continue}break}return s}function At(e){let s=[],f=0,a=e.length;while(f<a){while(f<a&&e.charCodeAt(f)<=32)f++;if(f+1>=a||e.charCodeAt(f)!==47||e.charCodeAt(f+1)!==42)break;let i=f;f+=2;while(f+1<a&&!(e.charCodeAt(f)===42&&e.charCodeAt(f+1)===47))f++;f=Math.min(f+2,a),s.push(e.slice(i,f).trim())}return{comments:s.join(`
40
+ `),key:e.slice(f).trim()}}function ln(e){let s=[],f="",a="",i=0,l=!1,h="",g=!0,d=!1,p=0,m=!1,C=!1,T=0,y=!1,k=!1;for(let W=0;W<e.length;W++){let w=e.charCodeAt(W),N=W>0?e.charCodeAt(W-1):0,E=W<e.length-1?e.charCodeAt(W+1):0;if(!l&&!d&&w===47&&E===47){f=f.replace(/[ \t]+$/,""),W+=2;while(W<e.length&&e.charCodeAt(W)!==10)W++;W--;continue}if(!l&&!d&&w===47&&E===42){d=!0,p=1,f+="/*",W++;continue}else if(!l&&!d&&w===47&&u(e,W)){let x=c(e,W);f+=e.slice(W,x),W=x-1;continue}else if(d&&w===42&&E===47){if(p--,f+="*/",W++,p===0)d=!1;continue}else if(d&&w===47&&E===42){p++,f+="/*",W++;continue}let A=e[W];if(!l&&!d&&(w===34||w===39||w===96))l=!0,h=A,f+=A;else if(l&&A===h&&N!==92)l=!1,f+=A;else if(!l&&!d)if(w===46&&E===46&&e.charCodeAt(W+2)===46&&i===0&&g)a=`${f.trim()}...`,f="",g=!1,y=!1,W+=2;else if(w===40&&i===0&&g&&T===0){a=f.trim();let x=ve(a),S=x>0?a.slice(0,x):"",I=a.slice(x),M="";if(I.startsWith("async ")||I.startsWith("async\t")||I.startsWith(`async
41
+ `))I=I.slice(6).trimStart(),M="async ";if(I.startsWith("*"))I=I.slice(1).trimStart(),M+="*";a=S+I,f=M+A,g=!1,y=!0,k=!1,i=1}else if(w===123||w===91||w===40){if(i++,f+=A,k&&w===123)k=!1}else if(w===125||w===93||w===41){if(i--,f+=A,w===41&&i===0&&!g&&!y)m=!0;if(y){if(w===41&&i===0&&!k)k=!0;else if(w===125&&i===0)y=!1,k=!1}}else if(w===58&&i===0&&g&&T===0)a=f.trim(),f="",g=!1;else if(w===58&&i===0&&m)C=!0,f+=A;else if(w===60&&C)T++,f+=A;else if(w===60&&g&&i===0)T++,f+=A;else if(w===62&&T>0&&N!==61)T--,f+=A;else if(w===61&&E===62&&C&&T===0)C=!1,m=!1,f+=A;else if(w===44&&i===0&&T===0&&!k){if(a&&f.trim()){let x=f.trim();s.push([a,x])}else if(g&&f.trim())_t(s,f.trim());f="",a="",g=!0,m=!1,C=!1,T=0}else f+=A;else f+=A}if(a&&f.trim()){let W=f.trim();s.push([a,W])}else if(g&&f.trim())_t(s,f.trim());return s}function _t(e,s){let{comments:f,key:a}=At(s);if(nt(a))e.push([f?`${f}
42
+ ${a}`:a,a]);else if(a.startsWith("...")&&a.length>3)e.push(["...",a.slice(3).trim()])}function bt(e){let s=e.trim();if(s.startsWith("get ")&&s.length>4){let f=s.slice(4).trim();if(f)return{kind:"get",name:f}}if(s.startsWith("set ")&&s.length>4){let f=s.slice(4).trim();if(f)return{kind:"set",name:f}}return null}function fn(e){let s=0;for(let f=0;f<e.length;f++){let a=e.charCodeAt(f);if(a===39||a===34||a===96){f++;while(f<e.length){if(e.charCodeAt(f)===92){f+=2;continue}if(e.charCodeAt(f)===a)break;f++}continue}if(a===40||a===91||a===123||a===60)s++;else if(a===41||a===93||a===125||a===62){if(s>0)s--}else if(a===58&&s===0)return!0}return!1}function un(e,s,f,a){let i=f.trim();if(i.charCodeAt(0)!==40)return null;let l=t(i,0,"(",")");if(l===-1)return null;let h=i.slice(1,l).trim(),g=i.slice(l+1).trimStart();if(!g.startsWith("=>"))return null;let d=g.slice(2).trim();if(e==="get")return`get ${s}(): ${d||"unknown"}`;let p=h&&!fn(h)?`${h}: ${a||"any"}`:h;return`set ${s}(${p})`}function Gt(e,s){let f=s.trim(),a=t(f,0,"(",")");if(!f.startsWith("(")||a===-1)return"unknown";if(e==="get"){let g=f.slice(a+1).trim();return g.startsWith("=>")?g.slice(2).trim():"unknown"}let i=f.slice(1,a).trim(),l=i.startsWith("{")?t(i,0,"{","}"):i.startsWith("[")?t(i,0,"[","]"):0,h=i.indexOf(":",Math.max(0,l));return h===-1?"unknown":i.slice(h+1).trim()}function qt(e){let s=e;if(s.startsWith("async ")||s.startsWith("async\t"))s=s.slice(5).trimStart();if(s.startsWith("*"))s=s.slice(1).trimStart();if(!s.startsWith("("))return!1;let f=0;for(let a=0;a<s.length;a++){let i=s.charCodeAt(a);if(i===40)f++;else if(i===41){if(f--,f===0){let l=s.slice(a+1).trimStart();if(l.startsWith("{"))return!0;if(l.startsWith(":")){let h=jt(l,1);if(h?.kind==="arrow")return!1;if(h?.kind==="body")return!0}return!1}}}return!1}function hn(e){let s=e.trimEnd();if(!s.endsWith(">"))return null;let f=0,a=-1;for(let l=s.length-1;l>=0;l--){let h=s.charCodeAt(l);if(h===62){if(l>0&&s.charCodeAt(l-1)===61)continue;f++}else if(h===60){if(f--,f===0){a=l;break}}}if(a===-1)return null;let i=s.slice(0,a).trimEnd();if(!i)return null;return{name:i,typeParams:s.slice(a)}}function Pt(e,s){let f=s.trimStart(),a=!1,i=!1;if(f.startsWith("async ")||f.startsWith("async\t"))a=!0,f=f.slice(5).trimStart();if(f.startsWith("*"))i=!0,f=f.slice(1).trimStart();let l="";if(f.charCodeAt(0)===60){let T=0,y=-1;for(let k=0;k<f.length;k++)if(f.charCodeAt(k)===60)T++;else if(f.charCodeAt(k)===62&&!(k>0&&f.charCodeAt(k-1)===61)){if(T--,T===0){y=k;break}}if(y!==-1)l=f.slice(0,y+1),f=f.slice(y+1).trimStart()}let h=f.indexOf("("),g=t(f,h,"(",")");if(h===-1||g===-1)return"() => unknown";let d=f.slice(h,g+1),p="unknown",m=f.slice(g+1).trimStart();if(m.charCodeAt(0)===58){let T=m.slice(1),y=jt(T,0);if(y)p=T.slice(0,y.index).trim();else p=T.trim()}if(p==="unknown"&&!i&&m.charCodeAt(0)===123){let T=t(m,0,"{","}");if(T!==-1){let y=O(m.slice(1,T),a,d);if(y!=="unknown"&&y!=="Promise<unknown>")p=a&&Cr(y)?y.slice(8,-1):y;else if(a)p="Promise<unknown>"}}if(p==="unknown"){if(a&&i)p="AsyncGenerator<unknown, void, unknown>";else if(i)p="Generator<unknown, void, unknown>";else if(a)p="Promise<void>"}else if(a)p=an(p);let C=$e(d);return`${l}${C} => ${p}`}function jt(e,s){let f=0,a=0,i=0,l=0,h=!1,g=0;for(let d=s;d<e.length;d++){let p=e.charCodeAt(d);if(h){if(p===92)d++;else if(p===g)h=!1;continue}if(p===34||p===39||p===96){h=!0,g=p;continue}if(p===40)f++;else if(p===41&&f>0)f--;else if(p===91)a++;else if(p===93&&a>0)a--;else if(p===60)i++;else if(p===62&&i>0&&e.charCodeAt(d-1)!==61)i--;else if(p===125&&l>0)l--;else if(p===123){let m=f>0||a>0||i>0||l>0,C=e.slice(s,d).trimEnd(),T=C.charCodeAt(C.length-1),y=C.length===0||T===38||T===124||T===40||T===44||T===58||T===61||T===91;if(m||y)l++;else return{index:d,kind:"body"}}else if(p===61&&d+1<e.length&&e.charCodeAt(d+1)===62&&f===0&&a===0&&i===0&&l===0)return{index:d,kind:"arrow"}}return null}function t(e,s,f,a){let i=0;for(let l=s;l<e.length;l++){let h=e[l];if(h==="'"||h==='"'||h==="`"){l++;while(l<e.length){if(e[l]==="\\"){l+=2;continue}if(e[l]===h)break;l++}continue}if(h==="/"&&l+1<e.length&&e[l+1]==="/"){let g=e.indexOf(`
43
+ `,l+2);if(g===-1)break;l=g;continue}if(h==="/"&&l+1<e.length&&e[l+1]==="*"){let g=e.indexOf("*/",l+2);if(g===-1)break;l=g+1;continue}if(h==="/"&&f!=="<"&&u(e,l)){l=c(e,l)-1;continue}if(h===f)i++;else if(h===a){if(a===">"&&l>0&&e[l-1]==="=")continue;if(i--,i===0)return l}}return-1}function oe(e){let s=e.trim();if(s.length<9||!s.endsWith("const"))return null;let f=s.length-5;if(f===0||s.charCodeAt(f-1)>32)return null;while(f>0&&s.charCodeAt(f-1)<=32)f--;if(f<3||s[f-2]!=="a"||s[f-1]!=="s")return null;if(j(s.charCodeAt(f-3)))return null;return s.slice(0,f-2).trim()}function Cr(e){let s=e.trim();return s.startsWith("Promise<")&&s.length>9&&s.endsWith(">")&&t(s,7,"<",">")===s.length-1}function dn(e){let s=[],f=0,a=0,i=0,l=0,h=0;for(let g=0;g<e.length;g++){let d=e[g];if(d==='"'||d==="'"||d==="`"){g++;while(g<e.length){if(e[g]==="\\"){g+=2;continue}if(e[g]===d)break;g++}continue}if(d==="(")f++;else if(d===")")f--;else if(d==="[")a++;else if(d==="]")a--;else if(d==="{")i++;else if(d==="}")i--;else if(d==="<")l++;else if(d===">"&&(g===0||e[g-1]!=="=")){if(l>0)l--}else if(d==="|"&&f===0&&a===0&&i===0&&l===0)s.push(e.slice(h,g).trim()),h=g+1}return s.push(e.slice(h).trim()),s}function an(e){let s=e.trim();if(Cr(s)||s.startsWith("AsyncGenerator<"))return s;if(s.includes("|")){let f=dn(s);if(f.length>1){let a=[];for(let i of f){let l=i.trim();while(Cr(l))l=l.slice(8,-1).trim();if(l&&!a.includes(l))a.push(l)}if(a.length>0)return`Promise<${a.join(" | ")}>`}}return`Promise<${s}>`}function ae(e){let s=e.trim();if(s.length<4)return!1;if(s.startsWith("async")&&s.length>5&&/\s/.test(s[5])){if(s=s.slice(5).trim(),s.length<4)return!1}if(s.startsWith("function")){if(s.length>8){let f=s[8];if(/\s/.test(f)||f==="("||f==="*"||f==="<")return!0}return!1}if(s[0]==="<"){let f=t(s,0,"<",">");if(f===-1)return!1;if(s=s.slice(f+1).trim(),s.length===0||s[0]!=="(")return!1}if(s[0]==="("){let f=t(s,0,"(",")");if(f===-1)return!1;let a=s.slice(f+1).trim();if(a.startsWith("=>"))return!0;if(a.startsWith(":"))return ot(a)!==-1;return!1}if(/[A-Za-z_$]/.test(s[0])){let f=1;while(f<s.length&&/[\w$]/.test(s[f]))f++;return s.slice(f).trimStart().startsWith("=>")}return!1}function ot(e){let s=0,f=0,a=!1,i="";for(let l=0;l<e.length-1;l++){let h=e[l],g=e[l+1],d=l>0?e[l-1]:"";if(!a&&(h==='"'||h==="'"||h==="`"))a=!0,i=h;else if(a&&h===i&&d!=="\\")a=!1;if(!a){if(h==="<"){let p=t(e,l,"<",">");if(p!==-1){l=p;continue}}if(h==="(")s++;else if(h===")")s--;else if(h==="[")f++;else if(h==="]")f--;if(h==="="&&g===">"&&s===0&&f===0)return l}}return-1}function ee(e,s=!1,f=0,a=!0){let i=e.trim();if(i.startsWith("async function")){let h=ee(i.slice(6).trim(),!1,f+1,a),g=h.lastIndexOf(" => ");if(g===-1)return s?"((...args: any[]) => Promise<unknown>)":"(...args: any[]) => Promise<unknown>";let d=h.slice(g+4).trim(),p=d.startsWith("Generator<")?`AsyncGenerator<${d.slice(10)}`:an(d),m=`${h.slice(0,g+4)}${p}`;return s?`(${m})`:m}if(i.length>200&&St(i,"=>")>2&&St(i,"<")>5&&!i.startsWith("function"))return s?"((...args: any[]) => any)":"(...args: any[]) => any";if(i.startsWith("async ")&&i.includes("=>")){let h=i.slice(5).trim(),g="";if(h.startsWith("<")){let w=t(h,0,"<",">");if(w!==-1)g=h.substring(0,w+1),h=h.substring(w+1).trim()}let d=ot(h);if(d===-1)return s?"(() => Promise<unknown>)":"() => Promise<unknown>";let p=h.substring(0,d).trim(),m=h.substring(d+2).trim(),C=zt(p),{params:T,returnType:y}=C;if(T=$e(T),T==="()"||T==="")T="()";else if(!T.startsWith("("))T=`(${T})`;let k=y;if(k);else if(m.startsWith("{"))k=O(m.slice(1,m.endsWith("}")?-1:void 0),!0,C.params);else k=et(H(m,Tt(C.params)));let W=`${g}${T} => ${y?k:an(k)}`;return s?`(${W})`:W}if(i.includes("=>")){let h="",g=i;if(i.startsWith("<")){let w=t(i,0,"<",">");if(w!==-1)h=i.substring(0,w+1),g=i.substring(w+1).trim()}let d=ot(g);if(d===-1)return s?"(() => unknown)":"() => unknown";let p=g.substring(0,d).trim(),m=g.substring(d+2).trim(),C=zt(p),{params:T,returnType:y}=C;if(T=$e(T),T==="()"||T==="")T="()";else if(!T.startsWith("("))T=`(${T})`;let k="unknown";if(y)k=y;else if(m.startsWith("{"))k=O(m.slice(1,m.endsWith("}")?-1:void 0),!1,C.params);else if(Ct(m)||Rt(m)&&Ct(m.slice(1,-1).trim()))k="JSX.Element";else if(m.includes("=>")){let w=m.trimStart(),N=w.indexOf("("),E=N!==-1?t(w,N,"(",")"):-1,A=E!==-1?w.indexOf("=>",E):-1;if(N===0&&E!==-1&&A!==-1){let x=w.substring(N+1,E).trim(),S=$e(x);if(h.includes("T")&&S.includes("T"))k=`(${S}) => T`;else k=`(${S}) => any`}else k="any"}else k=et(H(m,Tt(C.params)));let W=`${h}${T} => ${k}`;return s?`(${W})`:W}if(i.startsWith("function")){let h=8,g=i.length;while(h<g&&i.charCodeAt(h)<=32)h++;let d=!1;if(h<g&&i.charCodeAt(h)===42){d=!0,h++;while(h<g&&i.charCodeAt(h)<=32)h++}if(h<g&&(j(i.charCodeAt(h))||i.charCodeAt(h)===36)){while(h<g&&(j(i.charCodeAt(h))||i.charCodeAt(h)===36))h++;while(h<g&&i.charCodeAt(h)<=32)h++}let p="";if(h<g&&i.charCodeAt(h)===60){let T=t(i,h,"<",">");if(T!==-1){p=i.substring(h,T+1),h=T+1;while(h<g&&i.charCodeAt(h)<=32)h++}}let m=i.indexOf("(",h);if(m!==-1){let T=1,y=m+1;while(y<g&&T>0){let A=i.charCodeAt(y);if(A===40)T++;else if(A===41)T--;y++}let k=i.substring(m+1,y-1).trim(),W=k?$e(`(${k})`):"()";if(d){let A=i.substring(y).trim(),x=A.indexOf("Generator<");if(x!==-1){let I=x+10,M=A.indexOf(">",I);if(M!==-1){let R=A.substring(I,M),L=`${p}${W} => Generator<${R}>`;return s?`(${L})`:L}}let S=`${p}${W} => Generator<any, any, any>`;return s?`(${S})`:S}let w="unknown",N=i.substring(y).trimStart();if(N.charCodeAt(0)===58){let A=N.slice(1),x=jt(A,0),S=(x?A.slice(0,x.index):A).trim();if(S)w=S}else if(N.startsWith("{"))w=O(N.slice(1,N.endsWith("}")?-1:void 0),!1,W);let E=`${p}${W} => ${w}`;return s?`(${E})`:E}let C="(...args: any[]) => unknown";return s?`(${C})`:C}if(i.includes("=>")&&i.includes("(")&&i.includes(")")){if(i.length>100||St(i,"=>")>2){let h="";if(i.charCodeAt(0)===60){let C=t(i,0,"<",">");if(C!==-1)h=i.substring(0,C+1)}let g=i.indexOf("("),d=g!==-1?t(i,g,"(",")"):-1,p=g!==-1&&d!==-1?i.substring(g,d+1):"(...args: any[])";p=$e(p);let m=`${h}${p} => any`;return s?`(${m})`:m}return s?`(${i})`:i}let l="() => unknown";return s?`(${l})`:l}function zt(e){let s=e.trim();if(!s.startsWith("("))return{params:s,returnType:""};let f=t(s,0,"(",")");if(f===-1)return{params:s,returnType:""};let a=s.slice(f+1).trim();return{params:s.slice(0,f+1),returnType:a.startsWith(":")?a.slice(1).trim():""}}function ke(e){let s=e.trim();if(s==="any"||s==="object"||s==="unknown")return!0;if(s.startsWith("Record<")&&s.endsWith(">"))return!0;if(s.startsWith("Array<")&&s.endsWith(">"))return!0;if(/^\{\s*\[[^\]]*\]:\s*(any|string|number|unknown)\s*\}$/.test(s))return!0;return!1}function cn(e){if(!e.length)return!1;let s=0,f=0,a=!1,i=!1;for(let l=0;l<e.length;l++){let h=e.charCodeAt(l);if(h===34||h===39||h===96){l=G(e,l,h)-1;continue}if(h===47&&e.charCodeAt(l+1)===47){while(l<e.length&&e.charCodeAt(l)!==10)l++;continue}if(h===47&&e.charCodeAt(l+1)===42){let g=e.indexOf("*/",l+2);l=g===-1?e.length:g+1;continue}if(h===40||h===91||h===123){s++;continue}if(h===41||h===93||h===125){if(s--,s<0)return!1;continue}if(s===0){if(h===60){f++;continue}if(h===62){if(l>0&&e.charCodeAt(l-1)===61)continue;if(f>0)f--;continue}if(f===0){let g=e.charCodeAt(l+1);if(h===43||h===42||h===47||h===37||h===94||h===126||h===33||h===44)return!1;if(h===61){if(g!==62)return!1;l++;continue}if(h===124&&g===124||h===38&&g===38)return!1;if(h===63){if(g===63||g===46)return!1;i=!0;continue}if(h===58){if(!a&&!i)return!1;continue}if(h===101&&e.startsWith("extends",l)&&gt(e,l,7)){a=!0,l+=6;continue}if(h===115&&e.startsWith("satisfies",l)&&gt(e,l,9))return!1}}}return s===0&&f===0}function P(e){let s=-1,f=0;for(let i=0;i<e.length;i++){let l=e.charCodeAt(i);if(l===34||l===39||l===96){i=G(e,i,l)-1;continue}if(l===47&&e.charCodeAt(i+1)===47){while(i<e.length&&e.charCodeAt(i)!==10)i++;continue}if(l===47&&e.charCodeAt(i+1)===42){let h=e.indexOf("*/",i+2);i=h===-1?e.length:h+1;continue}if(l===47){let h=i-1;while(h>=0&&e.charCodeAt(h)<=32)h--;if(h<0||"([{:;,=!?&|+*-~>".includes(e[h])){let g=!1;for(i++;i<e.length;i++){let d=e.charCodeAt(i);if(d===92)i++;else if(d===91)g=!0;else if(d===93)g=!1;else if(d===47&&!g)break}continue}}if(l===40||l===91||l===123)f++;else if(l===41||l===93||l===125)f--;else if(f===0){if(s===-1){let h=e.charCodeAt(i+1);if(l===61&&h===62)return null;if(l===63&&h!==46)return null;if(l===58||l===44||l===124||l===38||l===94)return null;if((l===61||l===33)&&h===61)return null}if(l===115&&e.startsWith("satisfies",i)&&gt(e,i,9)&&e[i-1]!==".")s=i}}if(s===-1)return null;let a=e.slice(s+9).trim();if(a.endsWith(";"))a=a.slice(0,-1).trim();return a&&cn(a)?a:null}function cc(e){let s=e.trim(),f=s.match(/^\{\s*\[(\w+)\s+in\s+(.+?)\](\?)?\s*:\s*(.+)\s*\}$/);if(f){let[,l,h,g,d]=f;return`{ [${l} in ${h}]${g?"?":""}: ${d} }`}let a=s.match(/^\{\s*readonly\s+\[(\w+)\s+in\s+(.+?)\](\?)?\s*:\s*(.+)\s*\}$/);if(a){let[,l,h,g,d]=a;return`{ readonly [${l} in ${h}]${g?"?":""}: ${d} }`}let i=s.match(/^\{\s*(-?readonly\s+)?\[(\w+)\s+in\s+(.+?)\](-?\?)?\s*:\s*(.+)\s*\}$/);if(i){let[,l,h,g,d,p]=i;return`{ ${l?`${l.trim()} `:""}[${h} in ${g}]${d||""}: ${p} }`}return null}function lc(e){let s=e.trim(),f=s.indexOf(" extends ");if(f===-1)return null;let a=s.slice(f+9),i=gn(a);if(i===-1)return null;let l=mn(a,i);if(l===-1)return null;let h=s.slice(0,f).trim(),g=a.slice(0,i).trim(),d=a.slice(i+1,l).trim(),p=a.slice(l+1).trim();return`${h} extends ${g} ? ${d} : ${p}`}function gn(e){let s=0,f=!1,a="";for(let i=0;i<e.length;i++){let l=e[i],h=i>0?e[i-1]:"";if(!f&&(l==='"'||l==="'"||l==="`"))f=!0,a=l;else if(f&&l===a&&h!=="\\")f=!1;if(!f){if(l==="<"||l==="("||l==="["||l==="{")s++;if(l===">"||l===")"||l==="]"||l==="}")s--;if(l==="?"&&s===0)return i}}return-1}function mn(e,s){let f=0,a=!1,i="";for(let l=s+1;l<e.length;l++){let h=e[l],g=l>0?e[l-1]:"";if(!a&&(h==='"'||h==="'"||h==="`"))a=!0,i=h;else if(a&&h===i&&g!=="\\")a=!1;if(!a){if(h==="<"||h==="("||h==="["||h==="{")f++;if(h===">"||h===")"||h==="]"||h==="}")f--;if(h==="?"&&f===0)f++;if(h===":"&&f===0)return l;if(h===":"&&f>0)f--}}return-1}function uc(e){let s=e.trim();if(!s.startsWith("`")||!s.endsWith("`"))return null;let f=s.slice(1,-1);if(!f.includes("${"))return s;let a=[],i="",l=0;while(l<f.length)if(f[l]==="$"&&f[l+1]==="{"){if(i)a.push(`"${i}"`),i="";let h=1,g="";l+=2;while(l<f.length&&h>0){if(f[l]==="{")h++;if(f[l]==="}")h--;if(h>0)g+=f[l];l++}a.push(g.trim())}else i+=f[l],l++;if(i)a.push(`"${i}"`);return s}function fc(e){let s=[],f=/infer\s+(\w+)/g,a;while((a=f.exec(e))!==null)s.push(a[1]);return s}function dc(e){let f=e.trim(),a=f.indexOf("[");if(a!==-1){if(f.indexOf(" in ",a)!==-1)return!0}let i=f.indexOf(" extends ");if(i!==-1){let h=f.indexOf(" ? ",i);if(h!==-1&&f.indexOf(" : ",h)!==-1)return!0}if(f.charCodeAt(0)===96&&f.charCodeAt(f.length-1)===96){if(f.indexOf("${")!==-1)return!0}let l=f.indexOf("infer ");if(l!==-1){if(l===0||!j(f.charCodeAt(l-1)))return!0}return!1}function pc(e,s=3){let f=e.trim(),a=0,i=0;for(let l of f){if(l==="<"||l==="("||l==="["||l==="{")a++,i=Math.max(i,a);if(l===">"||l===")"||l==="]"||l==="}")a--}if(i>s){let l=f.match(/^(\w+)</);if(l)return`${l[1]}<any>`;return"unknown"}return f}function mc(e){let f=e.trim().match(/^(\w+)<(.+)>$/);if(!f)return null;let a=f[1],i=f[2],l=Ba(i);if(["Partial","Required","Readonly","Pick","Omit","Record","Exclude","Extract","NonNullable","ReturnType","Parameters","ConstructorParameters","InstanceType","ThisParameterType","OmitThisParameter","ThisType","Uppercase","Lowercase","Capitalize","Uncapitalize","Awaited","NoInfer"].includes(a))return{name:a,params:l};return null}function Ba(e){let s=[],f="",a=0,i=!1,l="";for(let h=0;h<e.length;h++){let g=e[h],d=h>0?e[h-1]:"";if(!i&&(g==='"'||g==="'"||g==="`"))i=!0,l=g;else if(i&&g===l&&d!=="\\")i=!1;if(!i){if(g==="<"||g==="("||g==="["||g==="{")a++;if(g===">"||g===")"||g==="]"||g==="}")a--;if(g===","&&a===0){s.push(f.trim()),f="";continue}}f+=g}if(f.trim())s.push(f.trim());return s}function hc(e){let s=e.trim();if(s.startsWith("keyof "))return s;return null}function gc(e){let s=e.trim();if(s.startsWith("typeof "))return s;return null}function yc(e){let s=e.trim();if(s.length===0||s.charCodeAt(0)===91)return!1;if(s.charCodeAt(s.length-1)!==93)return!1;let f=s.indexOf("[");if(f<=0)return!1;for(let a=0;a<f;a++){let i=s.charCodeAt(a);if(!j(i)&&i!==46)return!1}return!0}
44
+ export{Xt,Qt,r,Zt,en,tn,nn,rn,O,Ue,ts,B,sn,Se,ie,o,xr,on,se,Z,$e,t,oe,Cr,an,ae,ee,ke,cn,P,cc,lc,uc,fc,dc,pc,mc,Ba,hc,gc,yc};
@@ -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 co(t){if(!t||typeof t!=="string")throw Error("Invalid file path: must be a non-empty string");return t}function lo(t){if(!t||typeof t!=="string")throw Error("Invalid directory path: must be a non-empty string");return t}function uo(t){if(!t||typeof t!=="string")throw Error("Invalid glob pattern: must be a non-empty string");return t}function fo(t){if(typeof t!=="string")throw TypeError("Invalid source code: must be a string");return t}function po(t){if(typeof t!=="string")throw TypeError("Invalid DTS content: must be a string");return t}function mo(t){if(!t||typeof t!=="string")throw Error("Invalid module specifier: must be a non-empty string");return t}function go(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 ho(t){if(!t||typeof t!=="string")throw Error("Invalid declaration name: must be a non-empty string");return t}function yo(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 bo(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 wo(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 xo(t,r){return typeof t==="string"||typeof t==="number"}function Co(t){return t}var vo={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{co,lo,uo,fo,po,mo,go,ho,yo,bo,wo,xo,Co,vo};
2
+ import{basename as e,dirname as n,isAbsolute as i,join as o,relative as a,resolve as s}from"path";function To(t){if(!t||typeof t!=="string")throw Error("Invalid file path: must be a non-empty string");return t}function Po(t){if(!t||typeof t!=="string")throw Error("Invalid directory path: must be a non-empty string");return t}function Do(t){if(!t||typeof t!=="string")throw Error("Invalid glob pattern: must be a non-empty string");return t}function Ro(t){if(typeof t!=="string")throw TypeError("Invalid source code: must be a string");return t}function Oo(t){if(typeof t!=="string")throw TypeError("Invalid DTS content: must be a string");return t}function Mo(t){if(!t||typeof t!=="string")throw Error("Invalid module specifier: must be a non-empty string");return t}function Io(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 No(t){if(!t||typeof t!=="string")throw Error("Invalid declaration name: must be a non-empty string");return t}function Wo(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 Lo(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 Fo(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 Bo(t,r){return typeof t==="string"||typeof t==="number"}function _o(t){return t}var jo={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{To,Po,Do,Ro,Oo,Mo,Io,No,Wo,Lo,Fo,Bo,_o,jo};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ var e="@dtsx/dtsx",i="module",n="0.12.0",r=!0,c="A modern, fast .d.ts generation tool, powered by Bun.",u="Chris Breuer <chris@stacksjs.org>",b="MIT",a="https://github.com/stacksjs/dtsx#readme",p={type:"git",url:"git+https://github.com/stacksjs/dtsx.git"},o={url:"https://github.com/stacksjs/dtsx/issues"},d=["dts","generation","isolated declarations","development","bun","stacks","typescript","javascript"],m={".":{import:"./dist/index.js"},"./*":{import:"./dist/*"}},k="./dist/index.js",l="./dist/index.d.ts",x={dtsx:"./dist/cli.js"},h=["dist"],g={benchmark:"bun benchmark/index.ts","benchmark:prepare":"bun benchmark/prepare.ts","benchmark:publish":"bun benchmark/index.ts --json benchmark/results.json --runs 3 && bun benchmark/render.ts","benchmark:tsdown":"bun benchmark/tsdown.ts",build:"bun --filter './packages/dtsx' build",test:"find packages -name '*.test.ts' -print | xargs bun test","test:public-sdk":"bun scripts/verify-public-sdk.ts","test:ffi-sdk":"bun scripts/verify-ffi-sdk.ts","test:standalone":"bun scripts/verify-standalone.ts","typecheck:public-sdk":"bun x tsc --project tsconfig.public-sdk.json",lint:"bun x --bun pickier .","lint:fix":"bun x --bun pickier . --fix",format:"bun x --bun pickier . --format","format:fix":"bun x --bun pickier . --format --write",changelog:"bun x @stacksjs/logsmith --verbose","changelog:generate":"bun x @stacksjs/logsmith --output CHANGELOG.md",release:"bun x --bun @stacksjs/bumpx prompt --recursive","release:patch":"bun x --bun @stacksjs/bumpx patch --recursive --commit --tag --push --yes","release:minor":"bun x --bun @stacksjs/bumpx minor --recursive --commit --tag --push --yes",typecheck:"bun x tsc --noEmit","dev:docs":"bun --bun bunpress dev docs","build:docs":"bun --bun bunpress build docs","preview:docs":"bun --bun bunpress preview docs"},j={"@stacksjs/bumpx":"^0.2.35","@stacksjs/bunpress":"^0.2.31","@stacksjs/clapp":"^0.2.17",pickier:"^0.1.93","@stacksjs/gitlint":"^0.1.8","@stacksjs/logsmith":"^0.2.16","@types/bun":"^1.4.4","buddy-bot":"^0.10.5","bun-git-hooks":"^0.3.3","@dtsx/bun":"workspace:*",mitata:"^1.0.34","oxc-transform":"^0.158.0","oxc-parser":"^0.158.0",tsdown:"^0.23.7",typescript:"^7.0.2"},f=["packages/*"],y={typescript:"^7.0.2"},v={name:e,type:i,version:n,private:r,description:c,author:u,license:b,homepage:a,repository:p,bugs:o,keywords:d,exports:m,module:k,types:l,bin:x,files:h,scripts:g,devDependencies:j,workspaces:f,overrides:y,"git-hooks":{"pre-commit":{"staged-lint":{"*.{js,ts,json,yaml,yml,md}":"bun x --bun pickier lint --fix"}},"commit-msg":"bun x gitlint --edit .git/COMMIT_EDITMSG"}};export{u as author,x as bin,o as bugs,v as default,c as description,j as devDependencies,m as exports,h as files,a as homepage,d as keywords,b as license,k as module,e as name,y as overrides,r as private,p as repository,g as scripts,i as type,l as types,n as version,f as workspaces};