@modern-js/module-tools 2.2.1-beta.0 → 2.4.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.
- package/CHANGELOG.md +53 -0
- package/README.md +14 -18
- package/compiled/rollup-plugin-dts/dist/rollup-plugin-dts.d.ts +4 -0
- package/compiled/rollup-plugin-dts/index.js +1 -1
- package/compiled/rollup-plugin-dts/package.json +1 -1
- package/dist/builder/build.js +3 -3
- package/dist/builder/build.js.map +1 -1
- package/dist/builder/dts/rollup.js +1 -1
- package/dist/builder/dts/rollup.js.map +1 -1
- package/dist/command.js +0 -10
- package/dist/command.js.map +1 -1
- package/dist/config/defineConfig.d.ts +2 -1
- package/dist/config/defineConfig.js.map +1 -1
- package/dist/constants/colors.d.ts +1 -1
- package/dist/constants/colors.js +3 -3
- package/dist/constants/colors.js.map +1 -1
- package/dist/dev.d.ts +0 -9
- package/dist/dev.js +7 -61
- package/dist/dev.js.map +1 -1
- package/package.json +17 -17
- package/dist/builder/dts/tsc-node.d.ts +0 -1
- package/dist/builder/dts/tsc-node.js +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,58 @@
|
|
|
1
1
|
# @modern-js/module-tools
|
|
2
2
|
|
|
3
|
+
## 2.4.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 72f837e: update rollup-plugin-dts version, support cts and mts file
|
|
8
|
+
更新 rollup-plugin-dts 版本,支持 cts 和 mts 文件
|
|
9
|
+
- 76e15dc: feat: change dev log color
|
|
10
|
+
feat: 修改 dev 展示的内容颜色
|
|
11
|
+
- 8c2db5f: feat(core): improve support for exporting a function in config file
|
|
12
|
+
|
|
13
|
+
feat(core): 完善对配置文件中导出函数的支持
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [98a2733]
|
|
16
|
+
- Updated dependencies [8c2db5f]
|
|
17
|
+
- @modern-js/utils@2.4.0
|
|
18
|
+
- @modern-js/core@2.4.0
|
|
19
|
+
- @modern-js/new-action@2.4.0
|
|
20
|
+
- @modern-js/plugin-changeset@2.4.0
|
|
21
|
+
- @modern-js/plugin-i18n@2.4.0
|
|
22
|
+
- @modern-js/plugin-lint@2.4.0
|
|
23
|
+
- @modern-js/upgrade@2.4.0
|
|
24
|
+
- @modern-js/plugin@2.4.0
|
|
25
|
+
|
|
26
|
+
## 2.3.0
|
|
27
|
+
|
|
28
|
+
### Minor Changes
|
|
29
|
+
|
|
30
|
+
- 7736171: feat: add watch hooks
|
|
31
|
+
feat: 添加 watch hooks
|
|
32
|
+
- 7736171: feat: Remove the listening mode build task before Storybook starts
|
|
33
|
+
feat: 在 Storybook 启动之前,移除监听模式的构建任务
|
|
34
|
+
|
|
35
|
+
### Patch Changes
|
|
36
|
+
|
|
37
|
+
- cdb8cd5: update libuild version
|
|
38
|
+
升级 libuild 版本
|
|
39
|
+
- 7ad838e: fix umd code can not support es5 target
|
|
40
|
+
修复 umd 的代码不能被转换成 es5 的问题
|
|
41
|
+
- Updated dependencies [65f1322]
|
|
42
|
+
- Updated dependencies [fd5a3ed]
|
|
43
|
+
- Updated dependencies [7b2cdcb]
|
|
44
|
+
- Updated dependencies [6ca1c0b]
|
|
45
|
+
- Updated dependencies [89b6739]
|
|
46
|
+
- Updated dependencies [7736171]
|
|
47
|
+
- @modern-js/core@2.3.0
|
|
48
|
+
- @modern-js/utils@2.3.0
|
|
49
|
+
- @modern-js/plugin-changeset@2.3.0
|
|
50
|
+
- @modern-js/plugin-lint@2.3.0
|
|
51
|
+
- @modern-js/plugin-i18n@2.3.0
|
|
52
|
+
- @modern-js/new-action@2.3.0
|
|
53
|
+
- @modern-js/upgrade@2.3.0
|
|
54
|
+
- @modern-js/plugin@2.3.0
|
|
55
|
+
|
|
3
56
|
## 2.2.0
|
|
4
57
|
|
|
5
58
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -1,30 +1,26 @@
|
|
|
1
|
-
|
|
2
1
|
<p align="center">
|
|
3
2
|
<a href="https://modernjs.dev" target="blank"><img src="https://lf3-static.bytednsdoc.com/obj/eden-cn/ylaelkeh7nuhfnuhf/modernjs-cover.png" width="300" alt="Modern.js Logo" /></a>
|
|
4
3
|
</p>
|
|
4
|
+
|
|
5
|
+
<h1 align="center">Modern.js</h1>
|
|
6
|
+
|
|
5
7
|
<p align="center">
|
|
6
|
-
|
|
7
|
-
<br/>
|
|
8
|
-
<a href="https://modernjs.dev" target="blank">
|
|
9
|
-
modernjs.dev
|
|
10
|
-
</a>
|
|
11
|
-
</p>
|
|
12
|
-
<p align="center">
|
|
13
|
-
The meta-framework suite designed from scratch for frontend-focused modern web development
|
|
8
|
+
A Progressive React Framework for modern web development.
|
|
14
9
|
</p>
|
|
15
10
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
> The doc site ([modernjs.dev](https://modernjs.dev)) and articles are only available in Chinese for now, we are planning to add English versions soon.
|
|
11
|
+
## Getting Started
|
|
19
12
|
|
|
20
|
-
|
|
13
|
+
Please follow [Quick Start](https://modernjs.dev/en/guides/get-started/quick-start) to get started with Modern.js.
|
|
21
14
|
|
|
22
|
-
##
|
|
15
|
+
## Documentation
|
|
23
16
|
|
|
24
|
-
- [
|
|
25
|
-
- [
|
|
26
|
-
- [API References](https://modernjs.dev/docs/apis)
|
|
17
|
+
- [English Documentation](https://modernjs.dev/en/)
|
|
18
|
+
- [中文文档](https://modernjs.dev)
|
|
27
19
|
|
|
28
20
|
## Contributing
|
|
29
21
|
|
|
30
|
-
|
|
22
|
+
Please read the [Contributing Guide](https://github.com/modern-js-dev/modern.js/blob/main/CONTRIBUTING.md).
|
|
23
|
+
|
|
24
|
+
## License
|
|
25
|
+
|
|
26
|
+
Modern.js is [MIT licensed](https://github.com/modern-js-dev/modern.js/blob/main/LICENSE).
|
|
@@ -15,6 +15,10 @@ interface Options {
|
|
|
15
15
|
* `baseUrl` and `paths` properties, you can pass in `compilerOptions`.
|
|
16
16
|
*/
|
|
17
17
|
compilerOptions?: ts.CompilerOptions;
|
|
18
|
+
/**
|
|
19
|
+
* Path to tsconfig.json, by default, will try to load 'tsconfig.json'
|
|
20
|
+
*/
|
|
21
|
+
tsconfig?: string;
|
|
18
22
|
}
|
|
19
23
|
declare const plugin: PluginImpl<Options>;
|
|
20
24
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var e={571:(e,t,r)=>{"use strict";e=r.nmd(e);const n=r(755);const wrapAnsi16=(e,t)=>function(){const r=e.apply(n,arguments);return`[${r+t}m`};const wrapAnsi256=(e,t)=>function(){const r=e.apply(n,arguments);return`[${38+t};5;${r}m`};const wrapAnsi16m=(e,t)=>function(){const r=e.apply(n,arguments);return`[${38+t};2;${r[0]};${r[1]};${r[2]}m`};function assembleStyles(){const e=new Map;const t={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};t.color.grey=t.color.gray;for(const r of Object.keys(t)){const n=t[r];for(const r of Object.keys(n)){const i=n[r];t[r]={open:`[${i[0]}m`,close:`[${i[1]}m`};n[r]=t[r];e.set(i[0],i[1])}Object.defineProperty(t,r,{value:n,enumerable:false});Object.defineProperty(t,"codes",{value:e,enumerable:false})}const ansi2ansi=e=>e;const rgb2rgb=(e,t,r)=>[e,t,r];t.color.close="[39m";t.bgColor.close="[49m";t.color.ansi={ansi:wrapAnsi16(ansi2ansi,0)};t.color.ansi256={ansi256:wrapAnsi256(ansi2ansi,0)};t.color.ansi16m={rgb:wrapAnsi16m(rgb2rgb,0)};t.bgColor.ansi={ansi:wrapAnsi16(ansi2ansi,10)};t.bgColor.ansi256={ansi256:wrapAnsi256(ansi2ansi,10)};t.bgColor.ansi16m={rgb:wrapAnsi16m(rgb2rgb,10)};for(let e of Object.keys(n)){if(typeof n[e]!=="object"){continue}const r=n[e];if(e==="ansi16"){e="ansi"}if("ansi16"in r){t.color.ansi[e]=wrapAnsi16(r.ansi16,0);t.bgColor.ansi[e]=wrapAnsi16(r.ansi16,10)}if("ansi256"in r){t.color.ansi256[e]=wrapAnsi256(r.ansi256,0);t.bgColor.ansi256[e]=wrapAnsi256(r.ansi256,10)}if("rgb"in r){t.color.ansi16m[e]=wrapAnsi16m(r.rgb,0);t.bgColor.ansi16m[e]=wrapAnsi16m(r.rgb,10)}}return t}Object.defineProperty(e,"exports",{enumerable:true,get:assembleStyles})},673:(e,t,r)=>{"use strict";const n=r(434);const i=r(571);const s=r(332).stdout;const o=r(956);const a=process.platform==="win32"&&!(process.env.TERM||"").toLowerCase().startsWith("xterm");const l=["ansi","ansi","ansi256","ansi16m"];const c=new Set(["gray"]);const u=Object.create(null);function applyOptions(e,t){t=t||{};const r=s?s.level:0;e.level=t.level===undefined?r:t.level;e.enabled="enabled"in t?t.enabled:e.level>0}function Chalk(e){if(!this||!(this instanceof Chalk)||this.template){const t={};applyOptions(t,e);t.template=function(){const e=[].slice.call(arguments);return chalkTag.apply(null,[t.template].concat(e))};Object.setPrototypeOf(t,Chalk.prototype);Object.setPrototypeOf(t.template,t);t.template.constructor=Chalk;return t.template}applyOptions(this,e)}if(a){i.blue.open="[94m"}for(const e of Object.keys(i)){i[e].closeRe=new RegExp(n(i[e].close),"g");u[e]={get(){const t=i[e];return build.call(this,this._styles?this._styles.concat(t):[t],this._empty,e)}}}u.visible={get(){return build.call(this,this._styles||[],true,"visible")}};i.color.closeRe=new RegExp(n(i.color.close),"g");for(const e of Object.keys(i.color.ansi)){if(c.has(e)){continue}u[e]={get(){const t=this.level;return function(){const r=i.color[l[t]][e].apply(null,arguments);const n={open:r,close:i.color.close,closeRe:i.color.closeRe};return build.call(this,this._styles?this._styles.concat(n):[n],this._empty,e)}}}}i.bgColor.closeRe=new RegExp(n(i.bgColor.close),"g");for(const e of Object.keys(i.bgColor.ansi)){if(c.has(e)){continue}const t="bg"+e[0].toUpperCase()+e.slice(1);u[t]={get(){const t=this.level;return function(){const r=i.bgColor[l[t]][e].apply(null,arguments);const n={open:r,close:i.bgColor.close,closeRe:i.bgColor.closeRe};return build.call(this,this._styles?this._styles.concat(n):[n],this._empty,e)}}}}const f=Object.defineProperties((()=>{}),u);function build(e,t,r){const builder=function(){return applyStyle.apply(builder,arguments)};builder._styles=e;builder._empty=t;const n=this;Object.defineProperty(builder,"level",{enumerable:true,get(){return n.level},set(e){n.level=e}});Object.defineProperty(builder,"enabled",{enumerable:true,get(){return n.enabled},set(e){n.enabled=e}});builder.hasGrey=this.hasGrey||r==="gray"||r==="grey";builder.__proto__=f;return builder}function applyStyle(){const e=arguments;const t=e.length;let r=String(arguments[0]);if(t===0){return""}if(t>1){for(let n=1;n<t;n++){r+=" "+e[n]}}if(!this.enabled||this.level<=0||!r){return this._empty?"":r}const n=i.dim.open;if(a&&this.hasGrey){i.dim.open=""}for(const e of this._styles.slice().reverse()){r=e.open+r.replace(e.closeRe,e.open)+e.close;r=r.replace(/\r?\n/g,`${e.close}$&${e.open}`)}i.dim.open=n;return r}function chalkTag(e,t){if(!Array.isArray(t)){return[].slice.call(arguments,1).join(" ")}const r=[].slice.call(arguments,2);const n=[t.raw[0]];for(let e=1;e<t.length;e++){n.push(String(r[e-1]).replace(/[{}\\]/g,"\\$&"));n.push(String(t.raw[e]))}return o(e,n.join(""))}Object.defineProperties(Chalk.prototype,u);e.exports=Chalk();e.exports.supportsColor=s;e.exports["default"]=e.exports},956:e=>{"use strict";const t=/(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;const r=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;const n=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;const i=/\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi;const s=new Map([["n","\n"],["r","\r"],["t","\t"],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e",""],["a",""]]);function unescape(e){if(e[0]==="u"&&e.length===5||e[0]==="x"&&e.length===3){return String.fromCharCode(parseInt(e.slice(1),16))}return s.get(e)||e}function parseArguments(e,t){const r=[];const s=t.trim().split(/\s*,\s*/g);let o;for(const t of s){if(!isNaN(t)){r.push(Number(t))}else if(o=t.match(n)){r.push(o[2].replace(i,((e,t,r)=>t?unescape(t):r)))}else{throw new Error(`Invalid Chalk template style argument: ${t} (in style '${e}')`)}}return r}function parseStyle(e){r.lastIndex=0;const t=[];let n;while((n=r.exec(e))!==null){const e=n[1];if(n[2]){const r=parseArguments(e,n[2]);t.push([e].concat(r))}else{t.push([e])}}return t}function buildStyle(e,t){const r={};for(const e of t){for(const t of e.styles){r[t[0]]=e.inverse?null:t.slice(1)}}let n=e;for(const e of Object.keys(r)){if(Array.isArray(r[e])){if(!(e in n)){throw new Error(`Unknown Chalk style: ${e}`)}if(r[e].length>0){n=n[e].apply(n,r[e])}else{n=n[e]}}}return n}e.exports=(e,r)=>{const n=[];const i=[];let s=[];r.replace(t,((t,r,o,a,l,c)=>{if(r){s.push(unescape(r))}else if(a){const t=s.join("");s=[];i.push(n.length===0?t:buildStyle(e,n)(t));n.push({inverse:o,styles:parseStyle(a)})}else if(l){if(n.length===0){throw new Error("Found extraneous } in Chalk template literal")}i.push(buildStyle(e,n)(s.join("")));s=[];n.pop()}else{s.push(c)}}));i.push(s.join(""));if(n.length>0){const e=`Chalk template literal is missing ${n.length} closing bracket${n.length===1?"":"s"} (\`}\`)`;throw new Error(e)}return i.join("")}},461:(e,t,r)=>{var n=r(391);var i={};for(var s in n){if(n.hasOwnProperty(s)){i[n[s]]=s}}var o=e.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var a in o){if(o.hasOwnProperty(a)){if(!("channels"in o[a])){throw new Error("missing channels property: "+a)}if(!("labels"in o[a])){throw new Error("missing channel labels property: "+a)}if(o[a].labels.length!==o[a].channels){throw new Error("channel and label counts mismatch: "+a)}var l=o[a].channels;var c=o[a].labels;delete o[a].channels;delete o[a].labels;Object.defineProperty(o[a],"channels",{value:l});Object.defineProperty(o[a],"labels",{value:c})}}o.rgb.hsl=function(e){var t=e[0]/255;var r=e[1]/255;var n=e[2]/255;var i=Math.min(t,r,n);var s=Math.max(t,r,n);var o=s-i;var a;var l;var c;if(s===i){a=0}else if(t===s){a=(r-n)/o}else if(r===s){a=2+(n-t)/o}else if(n===s){a=4+(t-r)/o}a=Math.min(a*60,360);if(a<0){a+=360}c=(i+s)/2;if(s===i){l=0}else if(c<=.5){l=o/(s+i)}else{l=o/(2-s-i)}return[a,l*100,c*100]};o.rgb.hsv=function(e){var t;var r;var n;var i;var s;var o=e[0]/255;var a=e[1]/255;var l=e[2]/255;var c=Math.max(o,a,l);var u=c-Math.min(o,a,l);var diffc=function(e){return(c-e)/6/u+1/2};if(u===0){i=s=0}else{s=u/c;t=diffc(o);r=diffc(a);n=diffc(l);if(o===c){i=n-r}else if(a===c){i=1/3+t-n}else if(l===c){i=2/3+r-t}if(i<0){i+=1}else if(i>1){i-=1}}return[i*360,s*100,c*100]};o.rgb.hwb=function(e){var t=e[0];var r=e[1];var n=e[2];var i=o.rgb.hsl(e)[0];var s=1/255*Math.min(t,Math.min(r,n));n=1-1/255*Math.max(t,Math.max(r,n));return[i,s*100,n*100]};o.rgb.cmyk=function(e){var t=e[0]/255;var r=e[1]/255;var n=e[2]/255;var i;var s;var o;var a;a=Math.min(1-t,1-r,1-n);i=(1-t-a)/(1-a)||0;s=(1-r-a)/(1-a)||0;o=(1-n-a)/(1-a)||0;return[i*100,s*100,o*100,a*100]};function comparativeDistance(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)+Math.pow(e[2]-t[2],2)}o.rgb.keyword=function(e){var t=i[e];if(t){return t}var r=Infinity;var s;for(var o in n){if(n.hasOwnProperty(o)){var a=n[o];var l=comparativeDistance(e,a);if(l<r){r=l;s=o}}}return s};o.keyword.rgb=function(e){return n[e]};o.rgb.xyz=function(e){var t=e[0]/255;var r=e[1]/255;var n=e[2]/255;t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92;r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92;n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92;var i=t*.4124+r*.3576+n*.1805;var s=t*.2126+r*.7152+n*.0722;var o=t*.0193+r*.1192+n*.9505;return[i*100,s*100,o*100]};o.rgb.lab=function(e){var t=o.rgb.xyz(e);var r=t[0];var n=t[1];var i=t[2];var s;var a;var l;r/=95.047;n/=100;i/=108.883;r=r>.008856?Math.pow(r,1/3):7.787*r+16/116;n=n>.008856?Math.pow(n,1/3):7.787*n+16/116;i=i>.008856?Math.pow(i,1/3):7.787*i+16/116;s=116*n-16;a=500*(r-n);l=200*(n-i);return[s,a,l]};o.hsl.rgb=function(e){var t=e[0]/360;var r=e[1]/100;var n=e[2]/100;var i;var s;var o;var a;var l;if(r===0){l=n*255;return[l,l,l]}if(n<.5){s=n*(1+r)}else{s=n+r-n*r}i=2*n-s;a=[0,0,0];for(var c=0;c<3;c++){o=t+1/3*-(c-1);if(o<0){o++}if(o>1){o--}if(6*o<1){l=i+(s-i)*6*o}else if(2*o<1){l=s}else if(3*o<2){l=i+(s-i)*(2/3-o)*6}else{l=i}a[c]=l*255}return a};o.hsl.hsv=function(e){var t=e[0];var r=e[1]/100;var n=e[2]/100;var i=r;var s=Math.max(n,.01);var o;var a;n*=2;r*=n<=1?n:2-n;i*=s<=1?s:2-s;a=(n+r)/2;o=n===0?2*i/(s+i):2*r/(n+r);return[t,o*100,a*100]};o.hsv.rgb=function(e){var t=e[0]/60;var r=e[1]/100;var n=e[2]/100;var i=Math.floor(t)%6;var s=t-Math.floor(t);var o=255*n*(1-r);var a=255*n*(1-r*s);var l=255*n*(1-r*(1-s));n*=255;switch(i){case 0:return[n,l,o];case 1:return[a,n,o];case 2:return[o,n,l];case 3:return[o,a,n];case 4:return[l,o,n];case 5:return[n,o,a]}};o.hsv.hsl=function(e){var t=e[0];var r=e[1]/100;var n=e[2]/100;var i=Math.max(n,.01);var s;var o;var a;a=(2-r)*n;s=(2-r)*i;o=r*i;o/=s<=1?s:2-s;o=o||0;a/=2;return[t,o*100,a*100]};o.hwb.rgb=function(e){var t=e[0]/360;var r=e[1]/100;var n=e[2]/100;var i=r+n;var s;var o;var a;var l;if(i>1){r/=i;n/=i}s=Math.floor(6*t);o=1-n;a=6*t-s;if((s&1)!==0){a=1-a}l=r+a*(o-r);var c;var u;var f;switch(s){default:case 6:case 0:c=o;u=l;f=r;break;case 1:c=l;u=o;f=r;break;case 2:c=r;u=o;f=l;break;case 3:c=r;u=l;f=o;break;case 4:c=l;u=r;f=o;break;case 5:c=o;u=r;f=l;break}return[c*255,u*255,f*255]};o.cmyk.rgb=function(e){var t=e[0]/100;var r=e[1]/100;var n=e[2]/100;var i=e[3]/100;var s;var o;var a;s=1-Math.min(1,t*(1-i)+i);o=1-Math.min(1,r*(1-i)+i);a=1-Math.min(1,n*(1-i)+i);return[s*255,o*255,a*255]};o.xyz.rgb=function(e){var t=e[0]/100;var r=e[1]/100;var n=e[2]/100;var i;var s;var o;i=t*3.2406+r*-1.5372+n*-.4986;s=t*-.9689+r*1.8758+n*.0415;o=t*.0557+r*-.204+n*1.057;i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:i*12.92;s=s>.0031308?1.055*Math.pow(s,1/2.4)-.055:s*12.92;o=o>.0031308?1.055*Math.pow(o,1/2.4)-.055:o*12.92;i=Math.min(Math.max(0,i),1);s=Math.min(Math.max(0,s),1);o=Math.min(Math.max(0,o),1);return[i*255,s*255,o*255]};o.xyz.lab=function(e){var t=e[0];var r=e[1];var n=e[2];var i;var s;var o;t/=95.047;r/=100;n/=108.883;t=t>.008856?Math.pow(t,1/3):7.787*t+16/116;r=r>.008856?Math.pow(r,1/3):7.787*r+16/116;n=n>.008856?Math.pow(n,1/3):7.787*n+16/116;i=116*r-16;s=500*(t-r);o=200*(r-n);return[i,s,o]};o.lab.xyz=function(e){var t=e[0];var r=e[1];var n=e[2];var i;var s;var o;s=(t+16)/116;i=r/500+s;o=s-n/200;var a=Math.pow(s,3);var l=Math.pow(i,3);var c=Math.pow(o,3);s=a>.008856?a:(s-16/116)/7.787;i=l>.008856?l:(i-16/116)/7.787;o=c>.008856?c:(o-16/116)/7.787;i*=95.047;s*=100;o*=108.883;return[i,s,o]};o.lab.lch=function(e){var t=e[0];var r=e[1];var n=e[2];var i;var s;var o;i=Math.atan2(n,r);s=i*360/2/Math.PI;if(s<0){s+=360}o=Math.sqrt(r*r+n*n);return[t,o,s]};o.lch.lab=function(e){var t=e[0];var r=e[1];var n=e[2];var i;var s;var o;o=n/360*2*Math.PI;i=r*Math.cos(o);s=r*Math.sin(o);return[t,i,s]};o.rgb.ansi16=function(e){var t=e[0];var r=e[1];var n=e[2];var i=1 in arguments?arguments[1]:o.rgb.hsv(e)[2];i=Math.round(i/50);if(i===0){return 30}var s=30+(Math.round(n/255)<<2|Math.round(r/255)<<1|Math.round(t/255));if(i===2){s+=60}return s};o.hsv.ansi16=function(e){return o.rgb.ansi16(o.hsv.rgb(e),e[2])};o.rgb.ansi256=function(e){var t=e[0];var r=e[1];var n=e[2];if(t===r&&r===n){if(t<8){return 16}if(t>248){return 231}return Math.round((t-8)/247*24)+232}var i=16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5);return i};o.ansi16.rgb=function(e){var t=e%10;if(t===0||t===7){if(e>50){t+=3.5}t=t/10.5*255;return[t,t,t]}var r=(~~(e>50)+1)*.5;var n=(t&1)*r*255;var i=(t>>1&1)*r*255;var s=(t>>2&1)*r*255;return[n,i,s]};o.ansi256.rgb=function(e){if(e>=232){var t=(e-232)*10+8;return[t,t,t]}e-=16;var r;var n=Math.floor(e/36)/5*255;var i=Math.floor((r=e%36)/6)/5*255;var s=r%6/5*255;return[n,i,s]};o.rgb.hex=function(e){var t=((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255);var r=t.toString(16).toUpperCase();return"000000".substring(r.length)+r};o.hex.rgb=function(e){var t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t){return[0,0,0]}var r=t[0];if(t[0].length===3){r=r.split("").map((function(e){return e+e})).join("")}var n=parseInt(r,16);var i=n>>16&255;var s=n>>8&255;var o=n&255;return[i,s,o]};o.rgb.hcg=function(e){var t=e[0]/255;var r=e[1]/255;var n=e[2]/255;var i=Math.max(Math.max(t,r),n);var s=Math.min(Math.min(t,r),n);var o=i-s;var a;var l;if(o<1){a=s/(1-o)}else{a=0}if(o<=0){l=0}else if(i===t){l=(r-n)/o%6}else if(i===r){l=2+(n-t)/o}else{l=4+(t-r)/o+4}l/=6;l%=1;return[l*360,o*100,a*100]};o.hsl.hcg=function(e){var t=e[1]/100;var r=e[2]/100;var n=1;var i=0;if(r<.5){n=2*t*r}else{n=2*t*(1-r)}if(n<1){i=(r-.5*n)/(1-n)}return[e[0],n*100,i*100]};o.hsv.hcg=function(e){var t=e[1]/100;var r=e[2]/100;var n=t*r;var i=0;if(n<1){i=(r-n)/(1-n)}return[e[0],n*100,i*100]};o.hcg.rgb=function(e){var t=e[0]/360;var r=e[1]/100;var n=e[2]/100;if(r===0){return[n*255,n*255,n*255]}var i=[0,0,0];var s=t%1*6;var o=s%1;var a=1-o;var l=0;switch(Math.floor(s)){case 0:i[0]=1;i[1]=o;i[2]=0;break;case 1:i[0]=a;i[1]=1;i[2]=0;break;case 2:i[0]=0;i[1]=1;i[2]=o;break;case 3:i[0]=0;i[1]=a;i[2]=1;break;case 4:i[0]=o;i[1]=0;i[2]=1;break;default:i[0]=1;i[1]=0;i[2]=a}l=(1-r)*n;return[(r*i[0]+l)*255,(r*i[1]+l)*255,(r*i[2]+l)*255]};o.hcg.hsv=function(e){var t=e[1]/100;var r=e[2]/100;var n=t+r*(1-t);var i=0;if(n>0){i=t/n}return[e[0],i*100,n*100]};o.hcg.hsl=function(e){var t=e[1]/100;var r=e[2]/100;var n=r*(1-t)+.5*t;var i=0;if(n>0&&n<.5){i=t/(2*n)}else if(n>=.5&&n<1){i=t/(2*(1-n))}return[e[0],i*100,n*100]};o.hcg.hwb=function(e){var t=e[1]/100;var r=e[2]/100;var n=t+r*(1-t);return[e[0],(n-t)*100,(1-n)*100]};o.hwb.hcg=function(e){var t=e[1]/100;var r=e[2]/100;var n=1-r;var i=n-t;var s=0;if(i<1){s=(n-i)/(1-i)}return[e[0],i*100,s*100]};o.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};o.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};o.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};o.gray.hsl=o.gray.hsv=function(e){return[0,0,e[0]]};o.gray.hwb=function(e){return[0,100,e[0]]};o.gray.cmyk=function(e){return[0,0,0,e[0]]};o.gray.lab=function(e){return[e[0],0,0]};o.gray.hex=function(e){var t=Math.round(e[0]/100*255)&255;var r=(t<<16)+(t<<8)+t;var n=r.toString(16).toUpperCase();return"000000".substring(n.length)+n};o.rgb.gray=function(e){var t=(e[0]+e[1]+e[2])/3;return[t/255*100]}},755:(e,t,r)=>{var n=r(461);var i=r(974);var s={};var o=Object.keys(n);function wrapRaw(e){var wrappedFn=function(t){if(t===undefined||t===null){return t}if(arguments.length>1){t=Array.prototype.slice.call(arguments)}return e(t)};if("conversion"in e){wrappedFn.conversion=e.conversion}return wrappedFn}function wrapRounded(e){var wrappedFn=function(t){if(t===undefined||t===null){return t}if(arguments.length>1){t=Array.prototype.slice.call(arguments)}var r=e(t);if(typeof r==="object"){for(var n=r.length,i=0;i<n;i++){r[i]=Math.round(r[i])}}return r};if("conversion"in e){wrappedFn.conversion=e.conversion}return wrappedFn}o.forEach((function(e){s[e]={};Object.defineProperty(s[e],"channels",{value:n[e].channels});Object.defineProperty(s[e],"labels",{value:n[e].labels});var t=i(e);var r=Object.keys(t);r.forEach((function(r){var n=t[r];s[e][r]=wrapRounded(n);s[e][r].raw=wrapRaw(n)}))}));e.exports=s},974:(e,t,r)=>{var n=r(461);function buildGraph(){var e={};var t=Object.keys(n);for(var r=t.length,i=0;i<r;i++){e[t[i]]={distance:-1,parent:null}}return e}function deriveBFS(e){var t=buildGraph();var r=[e];t[e].distance=0;while(r.length){var i=r.pop();var s=Object.keys(n[i]);for(var o=s.length,a=0;a<o;a++){var l=s[a];var c=t[l];if(c.distance===-1){c.distance=t[i].distance+1;c.parent=i;r.unshift(l)}}}return t}function link(e,t){return function(r){return t(e(r))}}function wrapConversion(e,t){var r=[t[e].parent,e];var i=n[t[e].parent][e];var s=t[e].parent;while(t[s].parent){r.unshift(t[s].parent);i=link(n[t[s].parent][s],i);s=t[s].parent}i.conversion=r;return i}e.exports=function(e){var t=deriveBFS(e);var r={};var n=Object.keys(t);for(var i=n.length,s=0;s<i;s++){var o=n[s];var a=t[o];if(a.parent===null){continue}r[o]=wrapConversion(o,t)}return r}},391:e=>{"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},434:e=>{"use strict";var t=/[|\\{}()[\]^$+*?.]/g;e.exports=function(e){if(typeof e!=="string"){throw new TypeError("Expected a string")}return e.replace(t,"\\$&")}},419:e=>{"use strict";e.exports=(e,t)=>{t=t||process.argv;const r=e.startsWith("-")?"":e.length===1?"-":"--";const n=t.indexOf(r+e);const i=t.indexOf("--");return n!==-1&&(i===-1?true:n<i)}},629:(e,t)=>{Object.defineProperty(t,"__esModule",{value:true});t["default"]=/((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyus]{1,6}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g;t.matchToToken=function(e){var t={type:"invalid",value:e[0],closed:undefined};if(e[1])t.type="string",t.closed=!!(e[3]||e[4]);else if(e[5])t.type="comment";else if(e[6])t.type="comment",t.closed=!!e[7];else if(e[8])t.type="regex";else if(e[9])t.type="number";else if(e[10])t.type="name";else if(e[11])t.type="punctuator";else if(e[12])t.type="whitespace";return t}},877:(e,t,r)=>{"use strict";var n=r(417);class BitSet{constructor(e){this.bits=e instanceof BitSet?e.bits.slice():[]}add(e){this.bits[e>>5]|=1<<(e&31)}has(e){return!!(this.bits[e>>5]&1<<(e&31))}}class Chunk{constructor(e,t,r){this.start=e;this.end=t;this.original=r;this.intro="";this.outro="";this.content=r;this.storeName=false;this.edited=false;{this.previous=null;this.next=null}}appendLeft(e){this.outro+=e}appendRight(e){this.intro=this.intro+e}clone(){const e=new Chunk(this.start,this.end,this.original);e.intro=this.intro;e.outro=this.outro;e.content=this.content;e.storeName=this.storeName;e.edited=this.edited;return e}contains(e){return this.start<e&&e<this.end}eachNext(e){let t=this;while(t){e(t);t=t.next}}eachPrevious(e){let t=this;while(t){e(t);t=t.previous}}edit(e,t,r){this.content=e;if(!r){this.intro="";this.outro=""}this.storeName=t;this.edited=true;return this}prependLeft(e){this.outro=e+this.outro}prependRight(e){this.intro=e+this.intro}split(e){const t=e-this.start;const r=this.original.slice(0,t);const n=this.original.slice(t);this.original=r;const i=new Chunk(e,this.end,n);i.outro=this.outro;this.outro="";this.end=e;if(this.edited){i.edit("",false);this.content=""}else{this.content=r}i.next=this.next;if(i.next)i.next.previous=i;i.previous=this;this.next=i;return i}toString(){return this.intro+this.content+this.outro}trimEnd(e){this.outro=this.outro.replace(e,"");if(this.outro.length)return true;const t=this.content.replace(e,"");if(t.length){if(t!==this.content){this.split(this.start+t.length).edit("",undefined,true)}return true}else{this.edit("",undefined,true);this.intro=this.intro.replace(e,"");if(this.intro.length)return true}}trimStart(e){this.intro=this.intro.replace(e,"");if(this.intro.length)return true;const t=this.content.replace(e,"");if(t.length){if(t!==this.content){this.split(this.end-t.length);this.edit("",undefined,true)}return true}else{this.edit("",undefined,true);this.outro=this.outro.replace(e,"");if(this.outro.length)return true}}}function getBtoa(){if(typeof window!=="undefined"&&typeof window.btoa==="function"){return e=>window.btoa(unescape(encodeURIComponent(e)))}else if(typeof Buffer==="function"){return e=>Buffer.from(e,"utf-8").toString("base64")}else{return()=>{throw new Error("Unsupported environment: `window.btoa` or `Buffer` should be supported.")}}}const i=getBtoa();class SourceMap{constructor(e){this.version=3;this.file=e.file;this.sources=e.sources;this.sourcesContent=e.sourcesContent;this.names=e.names;this.mappings=n.encode(e.mappings)}toString(){return JSON.stringify(this)}toUrl(){return"data:application/json;charset=utf-8;base64,"+i(this.toString())}}function guessIndent(e){const t=e.split("\n");const r=t.filter((e=>/^\t+/.test(e)));const n=t.filter((e=>/^ {2,}/.test(e)));if(r.length===0&&n.length===0){return null}if(r.length>=n.length){return"\t"}const i=n.reduce(((e,t)=>{const r=/^ +/.exec(t)[0].length;return Math.min(r,e)}),Infinity);return new Array(i+1).join(" ")}function getRelativePath(e,t){const r=e.split(/[/\\]/);const n=t.split(/[/\\]/);r.pop();while(r[0]===n[0]){r.shift();n.shift()}if(r.length){let e=r.length;while(e--)r[e]=".."}return r.concat(n).join("/")}const s=Object.prototype.toString;function isObject(e){return s.call(e)==="[object Object]"}function getLocator(e){const t=e.split("\n");const r=[];for(let e=0,n=0;e<t.length;e++){r.push(n);n+=t[e].length+1}return function locate(e){let t=0;let n=r.length;while(t<n){const i=t+n>>1;if(e<r[i]){n=i}else{t=i+1}}const i=t-1;const s=e-r[i];return{line:i,column:s}}}class Mappings{constructor(e){this.hires=e;this.generatedCodeLine=0;this.generatedCodeColumn=0;this.raw=[];this.rawSegments=this.raw[this.generatedCodeLine]=[];this.pending=null}addEdit(e,t,r,n){if(t.length){const t=[this.generatedCodeColumn,e,r.line,r.column];if(n>=0){t.push(n)}this.rawSegments.push(t)}else if(this.pending){this.rawSegments.push(this.pending)}this.advance(t);this.pending=null}addUneditedChunk(e,t,r,n,i){let s=t.start;let o=true;while(s<t.end){if(this.hires||o||i.has(s)){this.rawSegments.push([this.generatedCodeColumn,e,n.line,n.column])}if(r[s]==="\n"){n.line+=1;n.column=0;this.generatedCodeLine+=1;this.raw[this.generatedCodeLine]=this.rawSegments=[];this.generatedCodeColumn=0;o=true}else{n.column+=1;this.generatedCodeColumn+=1;o=false}s+=1}this.pending=null}advance(e){if(!e)return;const t=e.split("\n");if(t.length>1){for(let e=0;e<t.length-1;e++){this.generatedCodeLine++;this.raw[this.generatedCodeLine]=this.rawSegments=[]}this.generatedCodeColumn=0}this.generatedCodeColumn+=t[t.length-1].length}}const o="\n";const a={insertLeft:false,insertRight:false,storeName:false};class MagicString{constructor(e,t={}){const r=new Chunk(0,e.length,e);Object.defineProperties(this,{original:{writable:true,value:e},outro:{writable:true,value:""},intro:{writable:true,value:""},firstChunk:{writable:true,value:r},lastChunk:{writable:true,value:r},lastSearchedChunk:{writable:true,value:r},byStart:{writable:true,value:{}},byEnd:{writable:true,value:{}},filename:{writable:true,value:t.filename},indentExclusionRanges:{writable:true,value:t.indentExclusionRanges},sourcemapLocations:{writable:true,value:new BitSet},storedNames:{writable:true,value:{}},indentStr:{writable:true,value:undefined}});this.byStart[0]=r;this.byEnd[e.length]=r}addSourcemapLocation(e){this.sourcemapLocations.add(e)}append(e){if(typeof e!=="string")throw new TypeError("outro content must be a string");this.outro+=e;return this}appendLeft(e,t){if(typeof t!=="string")throw new TypeError("inserted content must be a string");this._split(e);const r=this.byEnd[e];if(r){r.appendLeft(t)}else{this.intro+=t}return this}appendRight(e,t){if(typeof t!=="string")throw new TypeError("inserted content must be a string");this._split(e);const r=this.byStart[e];if(r){r.appendRight(t)}else{this.outro+=t}return this}clone(){const e=new MagicString(this.original,{filename:this.filename});let t=this.firstChunk;let r=e.firstChunk=e.lastSearchedChunk=t.clone();while(t){e.byStart[r.start]=r;e.byEnd[r.end]=r;const n=t.next;const i=n&&n.clone();if(i){r.next=i;i.previous=r;r=i}t=n}e.lastChunk=r;if(this.indentExclusionRanges){e.indentExclusionRanges=this.indentExclusionRanges.slice()}e.sourcemapLocations=new BitSet(this.sourcemapLocations);e.intro=this.intro;e.outro=this.outro;return e}generateDecodedMap(e){e=e||{};const t=0;const r=Object.keys(this.storedNames);const n=new Mappings(e.hires);const i=getLocator(this.original);if(this.intro){n.advance(this.intro)}this.firstChunk.eachNext((e=>{const s=i(e.start);if(e.intro.length)n.advance(e.intro);if(e.edited){n.addEdit(t,e.content,s,e.storeName?r.indexOf(e.original):-1)}else{n.addUneditedChunk(t,e,this.original,s,this.sourcemapLocations)}if(e.outro.length)n.advance(e.outro)}));return{file:e.file?e.file.split(/[/\\]/).pop():null,sources:[e.source?getRelativePath(e.file||"",e.source):null],sourcesContent:e.includeContent?[this.original]:[null],names:r,mappings:n.raw}}generateMap(e){return new SourceMap(this.generateDecodedMap(e))}_ensureindentStr(){if(this.indentStr===undefined){this.indentStr=guessIndent(this.original)}}_getRawIndentString(){this._ensureindentStr();return this.indentStr}getIndentString(){this._ensureindentStr();return this.indentStr===null?"\t":this.indentStr}indent(e,t){const r=/^[^\r\n]/gm;if(isObject(e)){t=e;e=undefined}if(e===undefined){this._ensureindentStr();e=this.indentStr||"\t"}if(e==="")return this;t=t||{};const n={};if(t.exclude){const e=typeof t.exclude[0]==="number"?[t.exclude]:t.exclude;e.forEach((e=>{for(let t=e[0];t<e[1];t+=1){n[t]=true}}))}let i=t.indentStart!==false;const replacer=t=>{if(i)return`${e}${t}`;i=true;return t};this.intro=this.intro.replace(r,replacer);let s=0;let o=this.firstChunk;while(o){const t=o.end;if(o.edited){if(!n[s]){o.content=o.content.replace(r,replacer);if(o.content.length){i=o.content[o.content.length-1]==="\n"}}}else{s=o.start;while(s<t){if(!n[s]){const t=this.original[s];if(t==="\n"){i=true}else if(t!=="\r"&&i){i=false;if(s===o.start){o.prependRight(e)}else{this._splitChunk(o,s);o=o.next;o.prependRight(e)}}}s+=1}}s=o.end;o=o.next}this.outro=this.outro.replace(r,replacer);return this}insert(){throw new Error("magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)")}insertLeft(e,t){if(!a.insertLeft){console.warn("magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead");a.insertLeft=true}return this.appendLeft(e,t)}insertRight(e,t){if(!a.insertRight){console.warn("magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead");a.insertRight=true}return this.prependRight(e,t)}move(e,t,r){if(r>=e&&r<=t)throw new Error("Cannot move a selection inside itself");this._split(e);this._split(t);this._split(r);const n=this.byStart[e];const i=this.byEnd[t];const s=n.previous;const o=i.next;const a=this.byStart[r];if(!a&&i===this.lastChunk)return this;const l=a?a.previous:this.lastChunk;if(s)s.next=o;if(o)o.previous=s;if(l)l.next=n;if(a)a.previous=i;if(!n.previous)this.firstChunk=i.next;if(!i.next){this.lastChunk=n.previous;this.lastChunk.next=null}n.previous=l;i.next=a||null;if(!l)this.firstChunk=n;if(!a)this.lastChunk=i;return this}overwrite(e,t,r,n){n=n||{};return this.update(e,t,r,{...n,overwrite:!n.contentOnly})}update(e,t,r,n){if(typeof r!=="string")throw new TypeError("replacement content must be a string");while(e<0)e+=this.original.length;while(t<0)t+=this.original.length;if(t>this.original.length)throw new Error("end is out of bounds");if(e===t)throw new Error("Cannot overwrite a zero-length range – use appendLeft or prependRight instead");this._split(e);this._split(t);if(n===true){if(!a.storeName){console.warn("The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string");a.storeName=true}n={storeName:true}}const i=n!==undefined?n.storeName:false;const s=n!==undefined?n.overwrite:false;if(i){const r=this.original.slice(e,t);Object.defineProperty(this.storedNames,r,{writable:true,value:true,enumerable:true})}const o=this.byStart[e];const l=this.byEnd[t];if(o){let e=o;while(e!==l){if(e.next!==this.byStart[e.end]){throw new Error("Cannot overwrite across a split point")}e=e.next;e.edit("",false)}o.edit(r,i,!s)}else{const n=new Chunk(e,t,"").edit(r,i);l.next=n;n.previous=l}return this}prepend(e){if(typeof e!=="string")throw new TypeError("outro content must be a string");this.intro=e+this.intro;return this}prependLeft(e,t){if(typeof t!=="string")throw new TypeError("inserted content must be a string");this._split(e);const r=this.byEnd[e];if(r){r.prependLeft(t)}else{this.intro=t+this.intro}return this}prependRight(e,t){if(typeof t!=="string")throw new TypeError("inserted content must be a string");this._split(e);const r=this.byStart[e];if(r){r.prependRight(t)}else{this.outro=t+this.outro}return this}remove(e,t){while(e<0)e+=this.original.length;while(t<0)t+=this.original.length;if(e===t)return this;if(e<0||t>this.original.length)throw new Error("Character is out of bounds");if(e>t)throw new Error("end must be greater than start");this._split(e);this._split(t);let r=this.byStart[e];while(r){r.intro="";r.outro="";r.edit("");r=t>r.end?this.byStart[r.end]:null}return this}lastChar(){if(this.outro.length)return this.outro[this.outro.length-1];let e=this.lastChunk;do{if(e.outro.length)return e.outro[e.outro.length-1];if(e.content.length)return e.content[e.content.length-1];if(e.intro.length)return e.intro[e.intro.length-1]}while(e=e.previous);if(this.intro.length)return this.intro[this.intro.length-1];return""}lastLine(){let e=this.outro.lastIndexOf(o);if(e!==-1)return this.outro.substr(e+1);let t=this.outro;let r=this.lastChunk;do{if(r.outro.length>0){e=r.outro.lastIndexOf(o);if(e!==-1)return r.outro.substr(e+1)+t;t=r.outro+t}if(r.content.length>0){e=r.content.lastIndexOf(o);if(e!==-1)return r.content.substr(e+1)+t;t=r.content+t}if(r.intro.length>0){e=r.intro.lastIndexOf(o);if(e!==-1)return r.intro.substr(e+1)+t;t=r.intro+t}}while(r=r.previous);e=this.intro.lastIndexOf(o);if(e!==-1)return this.intro.substr(e+1)+t;return this.intro+t}slice(e=0,t=this.original.length){while(e<0)e+=this.original.length;while(t<0)t+=this.original.length;let r="";let n=this.firstChunk;while(n&&(n.start>e||n.end<=e)){if(n.start<t&&n.end>=t){return r}n=n.next}if(n&&n.edited&&n.start!==e)throw new Error(`Cannot use replaced character ${e} as slice start anchor.`);const i=n;while(n){if(n.intro&&(i!==n||n.start===e)){r+=n.intro}const s=n.start<t&&n.end>=t;if(s&&n.edited&&n.end!==t)throw new Error(`Cannot use replaced character ${t} as slice end anchor.`);const o=i===n?e-n.start:0;const a=s?n.content.length+t-n.end:n.content.length;r+=n.content.slice(o,a);if(n.outro&&(!s||n.end===t)){r+=n.outro}if(s){break}n=n.next}return r}snip(e,t){const r=this.clone();r.remove(0,e);r.remove(t,r.original.length);return r}_split(e){if(this.byStart[e]||this.byEnd[e])return;let t=this.lastSearchedChunk;const r=e>t.end;while(t){if(t.contains(e))return this._splitChunk(t,e);t=r?this.byStart[t.end]:this.byEnd[t.start]}}_splitChunk(e,t){if(e.edited&&e.content.length){const r=getLocator(this.original)(t);throw new Error(`Cannot split a chunk that has already been edited (${r.line}:${r.column} – "${e.original}")`)}const r=e.split(t);this.byEnd[t]=e;this.byStart[t]=r;this.byEnd[r.end]=r;if(e===this.lastChunk)this.lastChunk=r;this.lastSearchedChunk=e;return true}toString(){let e=this.intro;let t=this.firstChunk;while(t){e+=t.toString();t=t.next}return e+this.outro}isEmpty(){let e=this.firstChunk;do{if(e.intro.length&&e.intro.trim()||e.content.length&&e.content.trim()||e.outro.length&&e.outro.trim())return false}while(e=e.next);return true}length(){let e=this.firstChunk;let t=0;do{t+=e.intro.length+e.content.length+e.outro.length}while(e=e.next);return t}trimLines(){return this.trim("[\\r\\n]")}trim(e){return this.trimStart(e).trimEnd(e)}trimEndAborted(e){const t=new RegExp((e||"\\s")+"+$");this.outro=this.outro.replace(t,"");if(this.outro.length)return true;let r=this.lastChunk;do{const e=r.end;const n=r.trimEnd(t);if(r.end!==e){if(this.lastChunk===r){this.lastChunk=r.next}this.byEnd[r.end]=r;this.byStart[r.next.start]=r.next;this.byEnd[r.next.end]=r.next}if(n)return true;r=r.previous}while(r);return false}trimEnd(e){this.trimEndAborted(e);return this}trimStartAborted(e){const t=new RegExp("^"+(e||"\\s")+"+");this.intro=this.intro.replace(t,"");if(this.intro.length)return true;let r=this.firstChunk;do{const e=r.end;const n=r.trimStart(t);if(r.end!==e){if(r===this.lastChunk)this.lastChunk=r.next;this.byEnd[r.end]=r;this.byStart[r.next.start]=r.next;this.byEnd[r.next.end]=r.next}if(n)return true;r=r.next}while(r);return false}trimStart(e){this.trimStartAborted(e);return this}hasChanged(){return this.original!==this.toString()}_replaceRegexp(e,t){function getReplacement(e,r){if(typeof t==="string"){return t.replace(/\$(\$|&|\d+)/g,((t,r)=>{if(r==="$")return"$";if(r==="&")return e[0];const n=+r;if(n<e.length)return e[+r];return`$${r}`}))}else{return t(...e,e.index,r,e.groups)}}function matchAll(e,t){let r;const n=[];while(r=e.exec(t)){n.push(r)}return n}if(e.global){const t=matchAll(e,this.original);t.forEach((e=>{if(e.index!=null)this.overwrite(e.index,e.index+e[0].length,getReplacement(e,this.original))}))}else{const t=this.original.match(e);if(t&&t.index!=null)this.overwrite(t.index,t.index+t[0].length,getReplacement(t,this.original))}return this}_replaceString(e,t){const{original:r}=this;const n=r.indexOf(e);if(n!==-1){this.overwrite(n,n+e.length,t)}return this}replace(e,t){if(typeof e==="string"){return this._replaceString(e,t)}return this._replaceRegexp(e,t)}_replaceAllString(e,t){const{original:r}=this;const n=e.length;for(let i=r.indexOf(e);i!==-1;i=r.indexOf(e,i+n)){this.overwrite(i,i+n,t)}return this}replaceAll(e,t){if(typeof e==="string"){return this._replaceAllString(e,t)}if(!e.global){throw new TypeError("MagicString.prototype.replaceAll called with a non-global RegExp argument")}return this._replaceRegexp(e,t)}}const l=Object.prototype.hasOwnProperty;class Bundle{constructor(e={}){this.intro=e.intro||"";this.separator=e.separator!==undefined?e.separator:"\n";this.sources=[];this.uniqueSources=[];this.uniqueSourceIndexByFilename={}}addSource(e){if(e instanceof MagicString){return this.addSource({content:e,filename:e.filename,separator:this.separator})}if(!isObject(e)||!e.content){throw new Error("bundle.addSource() takes an object with a `content` property, which should be an instance of MagicString, and an optional `filename`")}["filename","indentExclusionRanges","separator"].forEach((t=>{if(!l.call(e,t))e[t]=e.content[t]}));if(e.separator===undefined){e.separator=this.separator}if(e.filename){if(!l.call(this.uniqueSourceIndexByFilename,e.filename)){this.uniqueSourceIndexByFilename[e.filename]=this.uniqueSources.length;this.uniqueSources.push({filename:e.filename,content:e.content.original})}else{const t=this.uniqueSources[this.uniqueSourceIndexByFilename[e.filename]];if(e.content.original!==t.content){throw new Error(`Illegal source: same filename (${e.filename}), different contents`)}}}this.sources.push(e);return this}append(e,t){this.addSource({content:new MagicString(e),separator:t&&t.separator||""});return this}clone(){const e=new Bundle({intro:this.intro,separator:this.separator});this.sources.forEach((t=>{e.addSource({filename:t.filename,content:t.content.clone(),separator:t.separator})}));return e}generateDecodedMap(e={}){const t=[];this.sources.forEach((e=>{Object.keys(e.content.storedNames).forEach((e=>{if(!~t.indexOf(e))t.push(e)}))}));const r=new Mappings(e.hires);if(this.intro){r.advance(this.intro)}this.sources.forEach(((e,n)=>{if(n>0){r.advance(this.separator)}const i=e.filename?this.uniqueSourceIndexByFilename[e.filename]:-1;const s=e.content;const o=getLocator(s.original);if(s.intro){r.advance(s.intro)}s.firstChunk.eachNext((n=>{const a=o(n.start);if(n.intro.length)r.advance(n.intro);if(e.filename){if(n.edited){r.addEdit(i,n.content,a,n.storeName?t.indexOf(n.original):-1)}else{r.addUneditedChunk(i,n,s.original,a,s.sourcemapLocations)}}else{r.advance(n.content)}if(n.outro.length)r.advance(n.outro)}));if(s.outro){r.advance(s.outro)}}));return{file:e.file?e.file.split(/[/\\]/).pop():null,sources:this.uniqueSources.map((t=>e.file?getRelativePath(e.file,t.filename):t.filename)),sourcesContent:this.uniqueSources.map((t=>e.includeContent?t.content:null)),names:t,mappings:r.raw}}generateMap(e){return new SourceMap(this.generateDecodedMap(e))}getIndentString(){const e={};this.sources.forEach((t=>{const r=t.content._getRawIndentString();if(r===null)return;if(!e[r])e[r]=0;e[r]+=1}));return Object.keys(e).sort(((t,r)=>e[t]-e[r]))[0]||"\t"}indent(e){if(!arguments.length){e=this.getIndentString()}if(e==="")return this;let t=!this.intro||this.intro.slice(-1)==="\n";this.sources.forEach(((r,n)=>{const i=r.separator!==undefined?r.separator:this.separator;const s=t||n>0&&/\r?\n$/.test(i);r.content.indent(e,{exclude:r.indentExclusionRanges,indentStart:s});t=r.content.lastChar()==="\n"}));if(this.intro){this.intro=e+this.intro.replace(/^[^\n]/gm,((t,r)=>r>0?e+t:t))}return this}prepend(e){this.intro=e+this.intro;return this}toString(){const e=this.sources.map(((e,t)=>{const r=e.separator!==undefined?e.separator:this.separator;const n=(t>0?r:"")+e.content.toString();return n})).join("");return this.intro+e}isEmpty(){if(this.intro.length&&this.intro.trim())return false;if(this.sources.some((e=>!e.content.isEmpty())))return false;return true}length(){return this.sources.reduce(((e,t)=>e+t.content.length()),this.intro.length)}trimLines(){return this.trim("[\\r\\n]")}trim(e){return this.trimStart(e).trimEnd(e)}trimStart(e){const t=new RegExp("^"+(e||"\\s")+"+");this.intro=this.intro.replace(t,"");if(!this.intro){let t;let r=0;do{t=this.sources[r++];if(!t){break}}while(!t.content.trimStartAborted(e))}return this}trimEnd(e){const t=new RegExp((e||"\\s")+"+$");let r;let n=this.sources.length-1;do{r=this.sources[n--];if(!r){this.intro=this.intro.replace(t,"");break}}while(!r.content.trimEndAborted(e));return this}}MagicString.Bundle=Bundle;MagicString.SourceMap=SourceMap;MagicString.default=MagicString;e.exports=MagicString},417:function(e,t){(function(e,r){true?r(t):0})(this,(function(e){"use strict";var t={};var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";for(var n=0;n<r.length;n++){t[r.charCodeAt(n)]=n}function decode(e){var r=[];var n=[];var i=[0,0,0,0,0];var s=0;for(var o=0,a=0,l=0;o<e.length;o++){var c=e.charCodeAt(o);if(c===44){segmentify(n,i,s);s=0}else if(c===59){segmentify(n,i,s);s=0;r.push(n);n=[];i[0]=0}else{var u=t[c];if(u===undefined){throw new Error("Invalid character ("+String.fromCharCode(c)+")")}var f=u&32;u&=31;l+=u<<a;if(f){a+=5}else{var d=l&1;l>>>=1;if(d){l=l===0?-2147483648:-l}i[s]+=l;s++;l=a=0}}}segmentify(n,i,s);r.push(n);return r}function segmentify(e,t,r){if(r===4)e.push([t[0],t[1],t[2],t[3]]);else if(r===5)e.push([t[0],t[1],t[2],t[3],t[4]]);else if(r===1)e.push([t[0]])}function encode(e){var t=0;var r=0;var n=0;var i=0;var s="";for(var o=0;o<e.length;o++){var a=e[o];if(o>0)s+=";";if(a.length===0)continue;var l=0;var c=[];for(var u=0,f=a;u<f.length;u++){var d=f[u];var h=encodeInteger(d[0]-l);l=d[0];if(d.length>1){h+=encodeInteger(d[1]-t)+encodeInteger(d[2]-r)+encodeInteger(d[3]-n);t=d[1];r=d[2];n=d[3]}if(d.length===5){h+=encodeInteger(d[4]-i);i=d[4]}c.push(h)}s+=c.join(",")}return s}function encodeInteger(e){var t="";e=e<0?-e<<1|1:e<<1;do{var n=e&31;e>>>=5;if(e>0){n|=32}t+=r[n]}while(e>0);return t}e.decode=decode;e.encode=encode;Object.defineProperty(e,"__esModule",{value:true})}))},332:(e,t,r)=>{"use strict";const n=r(37);const i=r(419);const s=process.env;let o;if(i("no-color")||i("no-colors")||i("color=false")){o=false}else if(i("color")||i("colors")||i("color=true")||i("color=always")){o=true}if("FORCE_COLOR"in s){o=s.FORCE_COLOR.length===0||parseInt(s.FORCE_COLOR,10)!==0}function translateLevel(e){if(e===0){return false}return{level:e,hasBasic:true,has256:e>=2,has16m:e>=3}}function supportsColor(e){if(o===false){return 0}if(i("color=16m")||i("color=full")||i("color=truecolor")){return 3}if(i("color=256")){return 2}if(e&&!e.isTTY&&o!==true){return 0}const t=o?1:0;if(process.platform==="win32"){const e=n.release().split(".");if(Number(process.versions.node.split(".")[0])>=8&&Number(e[0])>=10&&Number(e[2])>=10586){return Number(e[2])>=14931?3:2}return 1}if("CI"in s){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((e=>e in s))||s.CI_NAME==="codeship"){return 1}return t}if("TEAMCITY_VERSION"in s){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(s.TEAMCITY_VERSION)?1:0}if(s.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in s){const e=parseInt((s.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(s.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(s.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(s.TERM)){return 1}if("COLORTERM"in s){return 1}if(s.TERM==="dumb"){return t}return t}function getSupportLevel(e){const t=supportsColor(e);return translateLevel(t)}e.exports={supportsColor:getSupportLevel,stdout:getSupportLevel(process.stdout),stderr:getSupportLevel(process.stderr)}},188:e=>{"use strict";e.exports=require("module")},37:e=>{"use strict";e.exports=require("os")},17:e=>{"use strict";e.exports=require("path")},440:e=>{"use strict";e.exports=require("typescript")},310:e=>{"use strict";e.exports=require("url")},588:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.codeFrameColumns=codeFrameColumns;t["default"]=_default;var n=r(512);let i=false;function getDefs(e){return{gutter:e.grey,marker:e.red.bold,message:e.red.bold}}const s=/\r\n|[\n\r\u2028\u2029]/;function getMarkerLines(e,t,r){const n=Object.assign({column:0,line:-1},e.start);const i=Object.assign({},n,e.end);const{linesAbove:s=2,linesBelow:o=3}=r||{};const a=n.line;const l=n.column;const c=i.line;const u=i.column;let f=Math.max(a-(s+1),0);let d=Math.min(t.length,c+o);if(a===-1){f=0}if(c===-1){d=t.length}const h=c-a;const p={};if(h){for(let e=0;e<=h;e++){const r=e+a;if(!l){p[r]=true}else if(e===0){const e=t[r-1].length;p[r]=[l,e-l+1]}else if(e===h){p[r]=[0,u]}else{const n=t[r-e].length;p[r]=[0,n]}}}else{if(l===u){if(l){p[a]=[l,0]}else{p[a]=true}}else{p[a]=[l,u-l]}}return{start:f,end:d,markerLines:p}}function codeFrameColumns(e,t,r={}){const i=(r.highlightCode||r.forceColor)&&(0,n.shouldHighlight)(r);const o=(0,n.getChalk)(r);const a=getDefs(o);const maybeHighlight=(e,t)=>i?e(t):t;const l=e.split(s);const{start:c,end:u,markerLines:f}=getMarkerLines(t,l,r);const d=t.start&&typeof t.start.column==="number";const h=String(u).length;const p=i?(0,n.default)(e,r):e;let g=p.split(s,u).slice(c,u).map(((e,t)=>{const n=c+1+t;const i=` ${n}`.slice(-h);const s=` ${i} |`;const o=f[n];const l=!f[n+1];if(o){let t="";if(Array.isArray(o)){const n=e.slice(0,Math.max(o[0]-1,0)).replace(/[^\t]/g," ");const i=o[1]||1;t=["\n ",maybeHighlight(a.gutter,s.replace(/\d/g," "))," ",n,maybeHighlight(a.marker,"^").repeat(i)].join("");if(l&&r.message){t+=" "+maybeHighlight(a.message,r.message)}}return[maybeHighlight(a.marker,">"),maybeHighlight(a.gutter,s),e.length>0?` ${e}`:"",t].join("")}else{return` ${maybeHighlight(a.gutter,s)}${e.length>0?` ${e}`:""}`}})).join("\n");if(r.message&&!d){g=`${" ".repeat(h+1)}${r.message}\n${g}`}if(i){return o.reset(g)}else{return g}}function _default(e,t,r,n={}){if(!i){i=true;const e="Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";if(process.emitWarning){process.emitWarning(e,"DeprecationWarning")}else{const t=new Error(e);t.name="DeprecationWarning";console.warn(new Error(e))}}r=Math.max(r,0);const s={start:{column:r,line:t}};return codeFrameColumns(e,s,n)}},266:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.isIdentifierChar=isIdentifierChar;t.isIdentifierName=isIdentifierName;t.isIdentifierStart=isIdentifierStart;let r="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꟊꟐꟑꟓꟕ-ꟙꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ";let n="·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࢘-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_";const i=new RegExp("["+r+"]");const s=new RegExp("["+r+n+"]");r=n=null;const o=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,3104,541,1507,4938,6,4191];const a=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239];function isInAstralSet(e,t){let r=65536;for(let n=0,i=t.length;n<i;n+=2){r+=t[n];if(r>e)return false;r+=t[n+1];if(r>=e)return true}return false}function isIdentifierStart(e){if(e<65)return e===36;if(e<=90)return true;if(e<97)return e===95;if(e<=122)return true;if(e<=65535){return e>=170&&i.test(String.fromCharCode(e))}return isInAstralSet(e,o)}function isIdentifierChar(e){if(e<48)return e===36;if(e<58)return true;if(e<65)return false;if(e<=90)return true;if(e<97)return e===95;if(e<=122)return true;if(e<=65535){return e>=170&&s.test(String.fromCharCode(e))}return isInAstralSet(e,o)||isInAstralSet(e,a)}function isIdentifierName(e){let t=true;for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);if((n&64512)===55296&&r+1<e.length){const t=e.charCodeAt(++r);if((t&64512)===56320){n=65536+((n&1023)<<10)+(t&1023)}}if(t){t=false;if(!isIdentifierStart(n)){return false}}else if(!isIdentifierChar(n)){return false}}return!t}},740:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});Object.defineProperty(t,"isIdentifierChar",{enumerable:true,get:function(){return n.isIdentifierChar}});Object.defineProperty(t,"isIdentifierName",{enumerable:true,get:function(){return n.isIdentifierName}});Object.defineProperty(t,"isIdentifierStart",{enumerable:true,get:function(){return n.isIdentifierStart}});Object.defineProperty(t,"isKeyword",{enumerable:true,get:function(){return i.isKeyword}});Object.defineProperty(t,"isReservedWord",{enumerable:true,get:function(){return i.isReservedWord}});Object.defineProperty(t,"isStrictBindOnlyReservedWord",{enumerable:true,get:function(){return i.isStrictBindOnlyReservedWord}});Object.defineProperty(t,"isStrictBindReservedWord",{enumerable:true,get:function(){return i.isStrictBindReservedWord}});Object.defineProperty(t,"isStrictReservedWord",{enumerable:true,get:function(){return i.isStrictReservedWord}});var n=r(266);var i=r(563)},563:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.isKeyword=isKeyword;t.isReservedWord=isReservedWord;t.isStrictBindOnlyReservedWord=isStrictBindOnlyReservedWord;t.isStrictBindReservedWord=isStrictBindReservedWord;t.isStrictReservedWord=isStrictReservedWord;const r={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"],strictBind:["eval","arguments"]};const n=new Set(r.keyword);const i=new Set(r.strict);const s=new Set(r.strictBind);function isReservedWord(e,t){return t&&e==="await"||e==="enum"}function isStrictReservedWord(e,t){return isReservedWord(e,t)||i.has(e)}function isStrictBindOnlyReservedWord(e){return s.has(e)}function isStrictBindReservedWord(e,t){return isStrictReservedWord(e,t)||isStrictBindOnlyReservedWord(e)}function isKeyword(e){return n.has(e)}},512:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=highlight;t.getChalk=getChalk;t.shouldHighlight=shouldHighlight;var n=r(629);var i=r(740);var s=r(673);const o=new Set(["as","async","from","get","of","set"]);function getDefs(e){return{keyword:e.cyan,capitalized:e.yellow,jsxIdentifier:e.yellow,punctuator:e.yellow,number:e.magenta,string:e.green,regex:e.magenta,comment:e.grey,invalid:e.white.bgRed.bold}}const a=/\r\n|[\n\r\u2028\u2029]/;const l=/^[()[\]{}]$/;let c;{const e=/^[a-z][\w-]*$/i;const getTokenType=function(t,r,n){if(t.type==="name"){if((0,i.isKeyword)(t.value)||(0,i.isStrictReservedWord)(t.value,true)||o.has(t.value)){return"keyword"}if(e.test(t.value)&&(n[r-1]==="<"||n.slice(r-2,r)=="</")){return"jsxIdentifier"}if(t.value[0]!==t.value[0].toLowerCase()){return"capitalized"}}if(t.type==="punctuator"&&l.test(t.value)){return"bracket"}if(t.type==="invalid"&&(t.value==="@"||t.value==="#")){return"punctuator"}return t.type};c=function*(e){let t;while(t=n.default.exec(e)){const r=n.matchToToken(t);yield{type:getTokenType(r,t.index,e),value:r.value}}}}function highlightTokens(e,t){let r="";for(const{type:n,value:i}of c(t)){const t=e[n];if(t){r+=i.split(a).map((e=>t(e))).join("\n")}else{r+=i}}return r}function shouldHighlight(e){return!!s.supportsColor||e.forceColor}function getChalk(e){return e.forceColor?new s.constructor({enabled:true,level:1}):s}function highlight(e,t={}){if(e!==""&&shouldHighlight(t)){const r=getChalk(t);const n=getDefs(r);return highlightTokens(n,e)}else{return e}}}};var t={};function __nccwpck_require__(r){var n=t[r];if(n!==undefined){return n.exports}var i=t[r]={id:r,loaded:false,exports:{}};var s=true;try{e[r].call(i.exports,i,i.exports,__nccwpck_require__);s=false}finally{if(s)delete t[r]}i.loaded=true;return i.exports}(()=>{__nccwpck_require__.nmd=e=>{e.paths=[];if(!e.children)e.children=[];return e}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var r={};(()=>{"use strict";var e=r;Object.defineProperty(e,"__esModule",{value:true});var t=__nccwpck_require__(17);var n=__nccwpck_require__(440);var i=__nccwpck_require__(188);var s=__nccwpck_require__(877);function _interopDefaultLegacy(e){return e&&typeof e==="object"&&"default"in e?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var t=Object.create(null);if(e){Object.keys(e).forEach((function(r){if(r!=="default"){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:true,get:function(){return e[r]}})}}))}t["default"]=e;return Object.freeze(t)}var o=_interopNamespace(t);var a=_interopDefaultLegacy(n);var l=_interopDefaultLegacy(s);const c=".d.ts";const u={getCurrentDirectory:()=>a["default"].sys.getCurrentDirectory(),getNewLine:()=>a["default"].sys.newLine,getCanonicalFileName:a["default"].sys.useCaseSensitiveFileNames?e=>e:e=>e.toLowerCase()};const f={declaration:true,noEmit:false,emitDeclarationOnly:true,noEmitOnError:true,checkJs:false,declarationMap:false,skipLibCheck:true,preserveSymlinks:true,target:a["default"].ScriptTarget.ESNext};function getCompilerOptions(e,t){const r={...f,...t};let n=o.dirname(e);let i=[];const s=a["default"].findConfigFile(n,a["default"].sys.fileExists);if(!s){return{dtsFiles:i,dirName:n,compilerOptions:r}}n=o.dirname(s);const{config:l,error:d}=a["default"].readConfigFile(s,a["default"].sys.readFile);if(d){console.error(a["default"].formatDiagnostic(d,u));return{dtsFiles:i,dirName:n,compilerOptions:r}}const{fileNames:h,options:p,errors:g}=a["default"].parseJsonConfigFileContent(l,a["default"].sys,n);i=h.filter((e=>e.endsWith(c)));if(g.length){console.error(a["default"].formatDiagnostics(g,u));return{dtsFiles:i,dirName:n,compilerOptions:r}}return{dtsFiles:i,dirName:n,compilerOptions:{...p,...r}}}function createProgram$1(e,t){const{dtsFiles:r,compilerOptions:n}=getCompilerOptions(e,t);return a["default"].createProgram([e].concat(Array.from(r)),n,a["default"].createCompilerHost(n,true))}function createPrograms(e,t){const r=[];let n=[];let i=new Set;let s="";let l={};for(let u of e){if(u.endsWith(c)){continue}u=o.resolve(u);const e=getCompilerOptions(u,t);e.dtsFiles.forEach(i.add,i);if(!n.length){n.push(u);({dirName:s,compilerOptions:l}=e);continue}if(e.dirName===s){n.push(u)}else{const t=a["default"].createCompilerHost(l,true);const o=a["default"].createProgram(n.concat(Array.from(i)),l,t);r.push(o);n=[u];({dirName:s,compilerOptions:l}=e)}}if(n.length){const e=a["default"].createCompilerHost(l,true);const t=a["default"].createProgram(n.concat(Array.from(i)),l,e);r.push(t)}return r}function getCodeFrame(){let e=undefined;try{({codeFrameColumns:e}=__nccwpck_require__(588));return e}catch{try{const t=i.createRequire(typeof document==="undefined"?new(__nccwpck_require__(310).URL)("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("rollup-plugin-dts.cjs",document.baseURI).href);({codeFrameColumns:e}=t("@babel/code-frame"));return e}catch{}}return undefined}function getLocation(e){const t=e.getSourceFile();const r=t.getLineAndCharacterOfPosition(e.getStart());const n=t.getLineAndCharacterOfPosition(e.getEnd());return{start:{line:r.line+1,column:r.character+1},end:{line:n.line+1,column:n.character+1}}}function frameNode(e){const t=getCodeFrame();const r=e.getSourceFile();const n=r.getFullText();const i=getLocation(e);if(t){return"\n"+t(n,i,{highlightCode:true})}else{return`\n${i.start.line}:${i.start.column}: \`${e.getFullText().trim()}\``}}class UnsupportedSyntaxError extends Error{constructor(e,t="Syntax not yet supported"){super(`${t}\n${frameNode(e)}`)}}class NamespaceFixer{constructor(e){this.sourceFile=e}findNamespaces(){const e=[];const t={};for(const r of this.sourceFile.statements){const n={start:r.getStart(),end:r.getEnd()};if(a["default"].isEmptyStatement(r)){e.unshift({name:"",exports:[],location:n});continue}if((a["default"].isImportDeclaration(r)||a["default"].isExportDeclaration(r))&&r.moduleSpecifier&&a["default"].isStringLiteral(r.moduleSpecifier)){let{text:t}=r.moduleSpecifier;if(t.startsWith(".")&&(t.endsWith(".d.ts")||t.endsWith(".d.cts")||t.endsWith(".d.mts"))){let n=r.moduleSpecifier.getStart()+1;let i=r.moduleSpecifier.getEnd()-1;e.unshift({name:"",exports:[],location:{start:n,end:i},textBeforeCodeAfter:t.replace(/\.d\.ts$/,".js").replace(/\.d\.cts$/,".cjs").replace(/\.d\.mts$/,".mjs")})}}if(a["default"].isModuleDeclaration(r)&&r.body&&a["default"].isModuleBlock(r.body)){for(const t of r.body.statements){if(a["default"].isExportDeclaration(t)&&t.exportClause){if(a["default"].isNamespaceExport(t.exportClause)){continue}for(const r of t.exportClause.elements){if(r.propertyName&&r.propertyName.getText()==r.name.getText()){e.unshift({name:"",exports:[],location:{start:r.propertyName.getEnd(),end:r.name.getEnd()}})}}}}}if(a["default"].isClassDeclaration(r)){t[r.name.getText()]={type:"class",generics:r.typeParameters}}else if(a["default"].isFunctionDeclaration(r)){t[r.name.getText()]={type:"function"}}else if(a["default"].isInterfaceDeclaration(r)){t[r.name.getText()]={type:"interface",generics:r.typeParameters}}else if(a["default"].isTypeAliasDeclaration(r)){t[r.name.getText()]={type:"type",generics:r.typeParameters}}else if(a["default"].isModuleDeclaration(r)&&a["default"].isIdentifier(r.name)){t[r.name.getText()]={type:"namespace"}}else if(a["default"].isEnumDeclaration(r)){t[r.name.getText()]={type:"enum"}}if(!a["default"].isVariableStatement(r)){continue}const{declarations:i}=r.declarationList;if(i.length!==1){continue}const s=i[0];const o=s.name.getText();if(!s.initializer||!a["default"].isCallExpression(s.initializer)){t[o]={type:"var"};continue}const l=s.initializer.arguments[0];if(!s.initializer.expression.getFullText().includes("/*#__PURE__*/Object.freeze")||!a["default"].isObjectLiteralExpression(l)){continue}const c=[];for(const e of l.properties){if(!a["default"].isPropertyAssignment(e)||!(a["default"].isIdentifier(e.name)||a["default"].isStringLiteral(e.name))||e.name.text!=="__proto__"&&!a["default"].isIdentifier(e.initializer)){throw new UnsupportedSyntaxError(e,"Expected a property assignment")}if(e.name.text==="__proto__"){continue}c.push({exportedName:e.name.text,localName:e.initializer.getText()})}e.unshift({name:o,exports:c,location:n})}return{namespaces:e,itemTypes:t}}fix(){var e;let t=this.sourceFile.getFullText();const{namespaces:r,itemTypes:n}=this.findNamespaces();for(const i of r){const r=t.slice(i.location.end);t=t.slice(0,i.location.start);for(const{exportedName:e,localName:r}of i.exports){if(e===r){const{type:s,generics:o}=n[r]||{};if(s==="interface"||s==="type"){const n=renderTypeParams(o);t+=`type ${i.name}_${e}${n.in} = ${r}${n.out};\n`}else if(s==="enum"||s==="class"){const n=renderTypeParams(o);t+=`type ${i.name}_${e}${n.in} = ${r}${n.out};\n`;t+=`declare const ${i.name}_${e}: typeof ${r};\n`}else{t+=`declare const ${i.name}_${e}: typeof ${r};\n`}}}if(i.name){t+=`declare namespace ${i.name} {\n`;t+=` export {\n`;for(const{exportedName:e,localName:r}of i.exports){if(e===r){t+=` ${i.name}_${e} as ${e},\n`}else{t+=` ${r} as ${e},\n`}}t+=` };\n`;t+=`}`}t+=(e=i.textBeforeCodeAfter)!==null&&e!==void 0?e:"";t+=r}return t}}function renderTypeParams(e){if(!e||!e.length){return{in:"",out:""}}return{in:`<${e.map((e=>e.getText())).join(", ")}>`,out:`<${e.map((e=>e.name.getText())).join(", ")}>`}}let d=1;function createProgram(e){return withStartEnd({type:"Program",sourceType:"module",body:[]},{start:e.getFullStart(),end:e.getEnd()})}function createReference(e){const t={type:"Identifier",name:String(d++)};return{ident:t,expr:{type:"AssignmentPattern",left:t,right:e}}}function createIdentifier(e){return withStartEnd({type:"Identifier",name:e.getText()},e)}function createIIFE(e){const t=withStartEnd({type:"FunctionExpression",id:null,params:[],body:{type:"BlockStatement",body:[]}},e);const r=withStartEnd({type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"Identifier",name:String(d++)},arguments:[t],optional:false}},e);return{fn:t,iife:r}}function createReturn(){const e={type:"ArrayExpression",elements:[]};return{expr:e,stmt:{type:"ReturnStatement",argument:e}}}function createDeclaration(e,t){return withStartEnd({type:"FunctionDeclaration",id:withStartEnd({type:"Identifier",name:a["default"].idText(e)},e),params:[],body:{type:"BlockStatement",body:[]}},t)}function convertExpression(e){if(a["default"].isLiteralExpression(e)){return{type:"Literal",value:e.text}}if(a["default"].isPropertyAccessExpression(e)){if(a["default"].isPrivateIdentifier(e.name)){throw new UnsupportedSyntaxError(e.name)}return withStartEnd({type:"MemberExpression",computed:false,optional:false,object:convertExpression(e.expression),property:convertExpression(e.name)},{start:e.expression.getStart(),end:e.name.getEnd()})}if(a["default"].isIdentifier(e)){return createIdentifier(e)}else if(e.kind==a["default"].SyntaxKind.NullKeyword){return{type:"Literal",value:null}}else{throw new UnsupportedSyntaxError(e)}}function withStartEnd(e,t){let r="start"in t?t:{start:t.getStart(),end:t.getEnd()};return Object.assign(e,r)}function matchesModifier(e,t){const r=a["default"].getCombinedModifierFlags(e);return(r&t)===t}function preProcess({sourceFile:e}){const t=new l["default"](e.getFullText());const r=new Set;const n=new Set;let i="";const s=new Map;const o=new Map;for(const s of e.statements){if(a["default"].isEmptyStatement(s)){t.remove(s.getStart(),s.getEnd());continue}if(a["default"].isEnumDeclaration(s)||a["default"].isFunctionDeclaration(s)||a["default"].isInterfaceDeclaration(s)||a["default"].isClassDeclaration(s)||a["default"].isTypeAliasDeclaration(s)||a["default"].isModuleDeclaration(s)){if(s.name){const e=s.name.getText();r.add(e);if(matchesModifier(s,a["default"].ModifierFlags.ExportDefault)){i=e}else if(matchesModifier(s,a["default"].ModifierFlags.Export)){n.add(e)}if(!(s.flags&a["default"].NodeFlags.GlobalAugmentation)){pushNamedNode(e,[getStart(s),getEnd(s)])}}if(a["default"].isModuleDeclaration(s)){duplicateExports(t,s)}fixModifiers(t,s)}else if(a["default"].isVariableStatement(s)){const{declarations:e}=s.declarationList;const i=matchesModifier(s,a["default"].ModifierFlags.Export);for(const e of s.declarationList.declarations){if(a["default"].isIdentifier(e.name)){const t=e.name.getText();r.add(t);if(i){n.add(t)}}}fixModifiers(t,s);if(e.length==1){const t=e[0];if(a["default"].isIdentifier(t.name)){pushNamedNode(t.name.getText(),[getStart(s),getEnd(s)])}}else{const t=e.slice();const r=t.shift();pushNamedNode(r.name.getText(),[getStart(s),r.getEnd()]);for(const e of t){if(a["default"].isIdentifier(e.name)){pushNamedNode(e.name.getText(),[e.getFullStart(),e.getEnd()])}}}const{flags:o}=s.declarationList;const l=o&a["default"].NodeFlags.Let?"let":o&a["default"].NodeFlags.Const?"const":"var";const c=`declare ${l} `;const u=s.declarationList.getChildren().find((e=>e.kind===a["default"].SyntaxKind.SyntaxList)).getChildren();let f=0;for(const e of u){if(e.kind===a["default"].SyntaxKind.CommaToken){f=e.getStart();t.remove(f,e.getEnd())}else if(f){t.appendLeft(f,";\n");const r=e.getFullStart();const n=t.slice(r,e.getStart());let i=n.length-n.trimStart().length;if(i){t.overwrite(r,r+i,c)}else{t.appendLeft(r,c)}}}}}for(const r of e.statements){checkInlineImport(r);if(!matchesModifier(r,a["default"].ModifierFlags.ExportDefault)){continue}if(a["default"].isFunctionDeclaration(r)||a["default"].isClassDeclaration(r)){if(r.name){continue}if(!i){i=uniqName("export_default")}const e=r.getChildren();const n=e.findIndex((e=>e.kind===a["default"].SyntaxKind.ClassKeyword||e.kind===a["default"].SyntaxKind.FunctionKeyword));const s=e[n];const o=e[n+1];const l=o.kind>=a["default"].SyntaxKind.FirstPunctuation&&o.kind<=a["default"].SyntaxKind.LastPunctuation;if(l){t.appendLeft(o.getStart(),i)}else{t.appendRight(s.getEnd(),` ${i}`)}}}for(const e of o.values()){const r=e.pop();const n=r[0];for(const r of e){t.move(r[0],r[1],n)}}if(i){t.append(`\nexport default ${i};\n`)}if(n.size){t.append(`\nexport { ${[...n].join(", ")} };\n`)}for(const[e,r]of s.entries()){t.prepend(`import * as ${r} from "${e}";\n`)}const c=e.getLineStarts();const u=new Set;for(const r of e.typeReferenceDirectives){u.add(r.fileName);const{line:n}=e.getLineAndCharacterOfPosition(r.pos);const i=c[n];let s=e.getLineEndOfPosition(r.pos);if(t.slice(s,s+1)=="\n"){s+=1}t.remove(i,s)}const f=new Set;for(const r of e.referencedFiles){f.add(r.fileName);const{line:n}=e.getLineAndCharacterOfPosition(r.pos);const i=c[n];let s=e.getLineEndOfPosition(r.pos);if(t.slice(s,s+1)=="\n"){s+=1}t.remove(i,s)}return{code:t,typeReferences:u,fileReferences:f};function checkInlineImport(e){a["default"].forEachChild(e,checkInlineImport);if(a["default"].isImportTypeNode(e)){if(!a["default"].isLiteralTypeNode(e.argument)||!a["default"].isStringLiteral(e.argument.literal)){throw new UnsupportedSyntaxError(e,"inline imports should have a literal argument")}const r=e.argument.literal.text;const n=e.getChildren();const i=n.find((e=>e.kind===a["default"].SyntaxKind.ImportKeyword)).getStart();let s=e.getEnd();const o=n.find((e=>e.kind===a["default"].SyntaxKind.DotToken||e.kind===a["default"].SyntaxKind.LessThanToken));if(o){s=o.getStart()}const l=createNamespaceImport(r);t.overwrite(i,s,l)}}function createNamespaceImport(e){let t=s.get(e);if(!t){t=uniqName(e.replace(/[^a-zA-Z0-9_$]/g,(()=>"_")));s.set(e,t)}return t}function uniqName(e){let t=e;while(r.has(t)){t=`_${t}`}r.add(t);return t}function pushNamedNode(e,t){let r=o.get(e);if(!r){r=[t];o.set(e,r)}else{const e=r[r.length-1];if(e[1]===t[0]){e[1]=t[1]}else{r.push(t)}}}}function fixModifiers(e,t){var r;let n=false;const i=a["default"].isClassDeclaration(t)||a["default"].isFunctionDeclaration(t)||a["default"].isModuleDeclaration(t)||a["default"].isVariableStatement(t);for(const i of(r=t.modifiers)!==null&&r!==void 0?r:[]){switch(i.kind){case a["default"].SyntaxKind.ExportKeyword:case a["default"].SyntaxKind.DefaultKeyword:e.remove(i.getStart(),i.getEnd()+1);break;case a["default"].SyntaxKind.DeclareKeyword:n=true}}if(i&&!n){e.appendRight(t.getStart(),"declare ")}}function duplicateExports(e,t){if(!t.body||!a["default"].isModuleBlock(t.body)){return}for(const r of t.body.statements){if(a["default"].isExportDeclaration(r)&&r.exportClause){if(a["default"].isNamespaceExport(r.exportClause)){continue}for(const t of r.exportClause.elements){if(!t.propertyName){e.appendLeft(t.name.getEnd(),` as ${t.name.getText()}`)}}}}}function getStart(e){const t=e.getFullStart();return t+(newlineAt(e,t)?1:0)}function getEnd(e){const t=e.getEnd();return t+(newlineAt(e,t)?1:0)}function newlineAt(e,t){return e.getSourceFile().getFullText()[t]=="\n"}const h=new Set([a["default"].SyntaxKind.LiteralType,a["default"].SyntaxKind.VoidKeyword,a["default"].SyntaxKind.UnknownKeyword,a["default"].SyntaxKind.AnyKeyword,a["default"].SyntaxKind.BooleanKeyword,a["default"].SyntaxKind.NumberKeyword,a["default"].SyntaxKind.StringKeyword,a["default"].SyntaxKind.ObjectKeyword,a["default"].SyntaxKind.NullKeyword,a["default"].SyntaxKind.UndefinedKeyword,a["default"].SyntaxKind.SymbolKeyword,a["default"].SyntaxKind.NeverKeyword,a["default"].SyntaxKind.ThisKeyword,a["default"].SyntaxKind.ThisType,a["default"].SyntaxKind.BigIntKeyword]);class DeclarationScope{constructor({id:e,range:t}){this.scopes=[];if(e){this.declaration=createDeclaration(e,t)}else{const{iife:e,fn:r}=createIIFE(t);this.iife=e;this.declaration=r}const r=createReturn();this.declaration.body.body.push(r.stmt);this.returnExpr=r.expr}pushScope(){this.scopes.push(new Set)}popScope(e=1){for(let t=0;t<e;t++){this.scopes.pop()}}pushTypeVariable(e){var t;const r=e.getText();(t=this.scopes[this.scopes.length-1])===null||t===void 0?void 0:t.add(r)}pushReference(e){let t;if(e.type==="Identifier"){t=e.name}else if(e.type==="MemberExpression"){if(e.object.type==="Identifier"){t=e.object.name}}if(t){for(const e of this.scopes){if(e.has(t)){return}}}const{ident:r,expr:n}=createReference(e);this.declaration.params.push(n);this.returnExpr.elements.push(r)}pushIdentifierReference(e){this.pushReference(createIdentifier(e))}convertEntityName(e){if(a["default"].isIdentifier(e)){return createIdentifier(e)}return withStartEnd({type:"MemberExpression",computed:false,optional:false,object:this.convertEntityName(e.left),property:createIdentifier(e.right)},e)}convertPropertyAccess(e){if(!a["default"].isIdentifier(e.expression)&&!a["default"].isPropertyAccessExpression(e.expression)){throw new UnsupportedSyntaxError(e.expression)}if(a["default"].isPrivateIdentifier(e.name)){throw new UnsupportedSyntaxError(e.name)}let t=a["default"].isIdentifier(e.expression)?createIdentifier(e.expression):this.convertPropertyAccess(e.expression);return withStartEnd({type:"MemberExpression",computed:false,optional:false,object:t,property:createIdentifier(e.name)},e)}convertComputedPropertyName(e){if(!e.name||!a["default"].isComputedPropertyName(e.name)){return}const{expression:t}=e.name;if(a["default"].isLiteralExpression(t)||a["default"].isPrefixUnaryExpression(t)){return}if(a["default"].isIdentifier(t)){return this.pushReference(createIdentifier(t))}if(a["default"].isPropertyAccessExpression(t)){return this.pushReference(this.convertPropertyAccess(t))}throw new UnsupportedSyntaxError(t)}convertParametersAndType(e){this.convertComputedPropertyName(e);const t=this.convertTypeParameters(e.typeParameters);for(const t of e.parameters){this.convertTypeNode(t.type)}this.convertTypeNode(e.type);this.popScope(t)}convertHeritageClauses(e){for(const t of e.heritageClauses||[]){for(const e of t.types){this.pushReference(convertExpression(e.expression));this.convertTypeArguments(e)}}}convertTypeArguments(e){if(!e.typeArguments){return}for(const t of e.typeArguments){this.convertTypeNode(t)}}convertMembers(e){for(const t of e){if(a["default"].isPropertyDeclaration(t)||a["default"].isPropertySignature(t)||a["default"].isIndexSignatureDeclaration(t)){if(a["default"].isPropertyDeclaration(t)&&t.initializer&&a["default"].isPropertyAccessExpression(t.initializer)){this.pushReference(this.convertPropertyAccess(t.initializer))}this.convertComputedPropertyName(t);this.convertTypeNode(t.type);continue}if(a["default"].isMethodDeclaration(t)||a["default"].isMethodSignature(t)||a["default"].isConstructorDeclaration(t)||a["default"].isConstructSignatureDeclaration(t)||a["default"].isCallSignatureDeclaration(t)||a["default"].isGetAccessorDeclaration(t)||a["default"].isSetAccessorDeclaration(t)){this.convertParametersAndType(t)}else{throw new UnsupportedSyntaxError(t)}}}convertTypeParameters(e){if(!e){return 0}for(const t of e){this.convertTypeNode(t.constraint);this.convertTypeNode(t.default);this.pushScope();this.pushTypeVariable(t.name)}return e.length}convertTypeNode(e){if(!e){return}if(h.has(e.kind)){return}if(a["default"].isTypeReferenceNode(e)){this.pushReference(this.convertEntityName(e.typeName));this.convertTypeArguments(e);return}if(a["default"].isTypeLiteralNode(e)){return this.convertMembers(e.members)}if(a["default"].isArrayTypeNode(e)){return this.convertTypeNode(e.elementType)}if(a["default"].isTupleTypeNode(e)){for(const t of e.elements){this.convertTypeNode(t)}return}if(a["default"].isNamedTupleMember(e)||a["default"].isParenthesizedTypeNode(e)||a["default"].isTypeOperatorNode(e)||a["default"].isTypePredicateNode(e)){return this.convertTypeNode(e.type)}if(a["default"].isUnionTypeNode(e)||a["default"].isIntersectionTypeNode(e)){for(const t of e.types){this.convertTypeNode(t)}return}if(a["default"].isMappedTypeNode(e)){const{typeParameter:t,type:r,nameType:n}=e;this.convertTypeNode(t.constraint);this.pushScope();this.pushTypeVariable(t.name);this.convertTypeNode(r);if(n){this.convertTypeNode(n)}this.popScope();return}if(a["default"].isConditionalTypeNode(e)){this.convertTypeNode(e.checkType);this.pushScope();this.convertTypeNode(e.extendsType);this.convertTypeNode(e.trueType);this.convertTypeNode(e.falseType);this.popScope();return}if(a["default"].isIndexedAccessTypeNode(e)){this.convertTypeNode(e.objectType);this.convertTypeNode(e.indexType);return}if(a["default"].isFunctionOrConstructorTypeNode(e)){this.convertParametersAndType(e);return}if(a["default"].isTypeQueryNode(e)){this.pushReference(this.convertEntityName(e.exprName));return}if(a["default"].isRestTypeNode(e)){this.convertTypeNode(e.type);return}if(a["default"].isOptionalTypeNode(e)){this.convertTypeNode(e.type);return}if(a["default"].isTemplateLiteralTypeNode(e)){for(const t of e.templateSpans){this.convertTypeNode(t.type)}return}if(a["default"].isInferTypeNode(e)){const{typeParameter:t}=e;this.convertTypeNode(t.constraint);this.pushTypeVariable(t.name);return}else{throw new UnsupportedSyntaxError(e)}}convertNamespace(e,t=false){this.pushScope();if(t&&e.body&&a["default"].isModuleDeclaration(e.body)){this.convertNamespace(e.body,true);return}if(!e.body||!a["default"].isModuleBlock(e.body)){throw new UnsupportedSyntaxError(e,`namespace must have a "ModuleBlock" body.`)}const{statements:r}=e.body;for(const e of r){if(a["default"].isEnumDeclaration(e)||a["default"].isFunctionDeclaration(e)||a["default"].isClassDeclaration(e)||a["default"].isInterfaceDeclaration(e)||a["default"].isTypeAliasDeclaration(e)||a["default"].isModuleDeclaration(e)){if(e.name&&a["default"].isIdentifier(e.name)){this.pushTypeVariable(e.name)}else{throw new UnsupportedSyntaxError(e,`non-Identifier name not supported`)}continue}if(a["default"].isVariableStatement(e)){for(const t of e.declarationList.declarations){if(a["default"].isIdentifier(t.name)){this.pushTypeVariable(t.name)}else{throw new UnsupportedSyntaxError(t,`non-Identifier name not supported`)}}continue}if(a["default"].isExportDeclaration(e));else{throw new UnsupportedSyntaxError(e,`namespace child (hoisting) not supported yet`)}}for(const e of r){if(a["default"].isVariableStatement(e)){for(const t of e.declarationList.declarations){if(t.type){this.convertTypeNode(t.type)}}continue}if(a["default"].isFunctionDeclaration(e)){this.convertParametersAndType(e);continue}if(a["default"].isInterfaceDeclaration(e)||a["default"].isClassDeclaration(e)){const t=this.convertTypeParameters(e.typeParameters);this.convertHeritageClauses(e);this.convertMembers(e.members);this.popScope(t);continue}if(a["default"].isTypeAliasDeclaration(e)){const t=this.convertTypeParameters(e.typeParameters);this.convertTypeNode(e.type);this.popScope(t);continue}if(a["default"].isModuleDeclaration(e)){this.convertNamespace(e,t);continue}if(a["default"].isEnumDeclaration(e)){continue}if(a["default"].isExportDeclaration(e)){if(e.exportClause){if(a["default"].isNamespaceExport(e.exportClause)){throw new UnsupportedSyntaxError(e.exportClause)}for(const t of e.exportClause.elements){const e=t.propertyName||t.name;this.pushIdentifierReference(e)}}}else{throw new UnsupportedSyntaxError(e,`namespace child (walking) not supported yet`)}}this.popScope()}}function convert({sourceFile:e}){const t=new Transformer(e);return t.transform()}class Transformer{constructor(e){this.sourceFile=e;this.declarations=new Map;this.ast=createProgram(e);for(const t of e.statements){this.convertStatement(t)}}transform(){return{ast:this.ast}}pushStatement(e){this.ast.body.push(e)}createDeclaration(e,t){const r={start:e.getFullStart(),end:e.getEnd()};if(!t){const e=new DeclarationScope({range:r});this.pushStatement(e.iife);return e}const n=t.getText();const i=new DeclarationScope({id:t,range:r});const s=this.declarations.get(n);if(s){s.pushIdentifierReference(t);s.declaration.end=r.end;let e=this.ast.body.findIndex((e=>e==s.declaration));for(let t=e+1;t<this.ast.body.length;t++){const e=this.ast.body[t];e.start=e.end=r.end}}else{this.pushStatement(i.declaration);this.declarations.set(n,i)}return s||i}convertStatement(e){if(a["default"].isEnumDeclaration(e)){return this.convertEnumDeclaration(e)}if(a["default"].isFunctionDeclaration(e)){return this.convertFunctionDeclaration(e)}if(a["default"].isInterfaceDeclaration(e)||a["default"].isClassDeclaration(e)){return this.convertClassOrInterfaceDeclaration(e)}if(a["default"].isTypeAliasDeclaration(e)){return this.convertTypeAliasDeclaration(e)}if(a["default"].isVariableStatement(e)){return this.convertVariableStatement(e)}if(a["default"].isExportDeclaration(e)||a["default"].isExportAssignment(e)){return this.convertExportDeclaration(e)}if(a["default"].isModuleDeclaration(e)){return this.convertNamespaceDeclaration(e)}if(e.kind==a["default"].SyntaxKind.NamespaceExportDeclaration){return this.removeStatement(e)}if(a["default"].isImportDeclaration(e)||a["default"].isImportEqualsDeclaration(e)){return this.convertImportDeclaration(e)}else{throw new UnsupportedSyntaxError(e)}}removeStatement(e){this.pushStatement(withStartEnd({type:"ExpressionStatement",expression:{type:"Literal",value:"pls remove me"}},e))}convertNamespaceDeclaration(e){const t=e.flags&a["default"].NodeFlags.GlobalAugmentation;if(t||!a["default"].isIdentifier(e.name)){const t=this.createDeclaration(e);t.convertNamespace(e,true);return}const r=this.createDeclaration(e,e.name);r.pushIdentifierReference(e.name);r.convertNamespace(e)}convertEnumDeclaration(e){const t=this.createDeclaration(e,e.name);t.pushIdentifierReference(e.name)}convertFunctionDeclaration(e){if(!e.name){throw new UnsupportedSyntaxError(e,`FunctionDeclaration should have a name`)}const t=this.createDeclaration(e,e.name);t.pushIdentifierReference(e.name);t.convertParametersAndType(e)}convertClassOrInterfaceDeclaration(e){if(!e.name){throw new UnsupportedSyntaxError(e,`ClassDeclaration / InterfaceDeclaration should have a name`)}const t=this.createDeclaration(e,e.name);const r=t.convertTypeParameters(e.typeParameters);t.convertHeritageClauses(e);t.convertMembers(e.members);t.popScope(r)}convertTypeAliasDeclaration(e){const t=this.createDeclaration(e,e.name);const r=t.convertTypeParameters(e.typeParameters);t.convertTypeNode(e.type);t.popScope(r)}convertVariableStatement(e){const{declarations:t}=e.declarationList;if(t.length!==1){throw new UnsupportedSyntaxError(e,`VariableStatement with more than one declaration not yet supported`)}for(const r of t){if(!a["default"].isIdentifier(r.name)){throw new UnsupportedSyntaxError(e,`VariableDeclaration must have a name`)}const t=this.createDeclaration(e,r.name);t.convertTypeNode(r.type)}}convertExportDeclaration(e){if(a["default"].isExportAssignment(e)){this.pushStatement(withStartEnd({type:"ExportDefaultDeclaration",declaration:convertExpression(e.expression)},e));return}const t=e.moduleSpecifier?convertExpression(e.moduleSpecifier):undefined;if(!e.exportClause){this.pushStatement(withStartEnd({type:"ExportAllDeclaration",source:t,exported:null},e))}else if(a["default"].isNamespaceExport(e.exportClause)){this.pushStatement(withStartEnd({type:"ExportAllDeclaration",source:t,exported:createIdentifier(e.exportClause.name)},e))}else{const r=[];for(const t of e.exportClause.elements){r.push(this.convertExportSpecifier(t))}this.pushStatement(withStartEnd({type:"ExportNamedDeclaration",declaration:null,specifiers:r,source:t},e))}}convertImportDeclaration(e){if(a["default"].isImportEqualsDeclaration(e)){if(!a["default"].isExternalModuleReference(e.moduleReference)){throw new UnsupportedSyntaxError(e,"ImportEquals should have a literal source.")}this.pushStatement(withStartEnd({type:"ImportDeclaration",specifiers:[{type:"ImportDefaultSpecifier",local:createIdentifier(e.name)}],source:convertExpression(e.moduleReference.expression)},e));return}const t=convertExpression(e.moduleSpecifier);const r=e.importClause&&e.importClause.namedBindings?this.convertNamedImportBindings(e.importClause.namedBindings):[];if(e.importClause&&e.importClause.name){r.push({type:"ImportDefaultSpecifier",local:createIdentifier(e.importClause.name)})}this.pushStatement(withStartEnd({type:"ImportDeclaration",specifiers:r,source:t},e))}convertNamedImportBindings(e){if(a["default"].isNamedImports(e)){return e.elements.map((e=>{const t=createIdentifier(e.name);const r=e.propertyName?createIdentifier(e.propertyName):t;return{type:"ImportSpecifier",local:t,imported:r}}))}return[{type:"ImportNamespaceSpecifier",local:createIdentifier(e.name)}]}convertExportSpecifier(e){const t=createIdentifier(e.name);return{type:"ExportSpecifier",exported:t,local:e.propertyName?createIdentifier(e.propertyName):t}}}function parse(e,t){return a["default"].createSourceFile(e,t,a["default"].ScriptTarget.Latest,true)}const transform=()=>{const e=new Map;const t=new Map;return{name:"dts-transform",options(e){const{onwarn:t}=e;return{...e,onwarn(e,r){if(e.code!="CIRCULAR_DEPENDENCY"){if(t){t(e,r)}else{r(e)}}},treeshake:{moduleSideEffects:"no-external",propertyReadSideEffects:true,unknownGlobalSideEffects:false}}},outputOptions(e){return{...e,chunkFileNames:e.chunkFileNames||"[name]-[hash].d.ts",entryFileNames:e.entryFileNames||"[name].d.ts",format:"es",exports:"named",compact:false,freeze:true,interop:false,namespaceToStringTag:false,strict:false}},transform(r,n){let i=parse(n,r);const s=preProcess({sourceFile:i});e.set(i.fileName,s.typeReferences);t.set(i.fileName,s.fileReferences);r=s.code.toString();i=parse(n,r);const o=convert({sourceFile:i});if(process.env.DTS_DUMP_AST){console.log(n);console.log(r);console.log(JSON.stringify(o.ast.body,undefined,2))}return{code:r,ast:o.ast,map:s.code.generateMap()}},renderChunk(r,n,i){const s=parse(n.fileName,r);const a=new NamespaceFixer(s);const l=new Set;const c=new Set;for(const r of Object.keys(n.modules)){for(const t of e.get(r.split("\\").join("/"))||[]){l.add(t)}for(const e of t.get(r.split("\\").join("/"))||[]){if(e.startsWith(".")){const t=o.join(o.dirname(r),e);const s=i.file&&o.dirname(i.file)||n.facadeModuleId&&o.dirname(n.facadeModuleId)||".";let a=o.relative(s,t).split("\\").join("/");if(a[0]!=="."){a="./"+a}c.add(a)}else{c.add(e)}}}r=writeBlock(Array.from(c,(e=>`/// <reference path="${e}" />`)));r+=writeBlock(Array.from(l,(e=>`/// <reference types="${e}" />`)));r+=a.fix();return{code:r,map:{mappings:""}}}}};function writeBlock(e){if(e.length){return e.join("\n")+"\n"}return""}const p=/\.(t|j)sx?$/;const plugin=(e={})=>{const t=transform();const{respectExternal:r=false,compilerOptions:n={}}=e;let i=[];function getModule(e){let t;let r;if(!i.length&&e.endsWith(c)){t=true}else{r=i.find((r=>t=r.getSourceFile(e)));if(!r&&a["default"].sys.fileExists(e)){i.push(r=createProgram$1(e,n));t=r.getSourceFile(e)}}return{source:t,program:r}}return{name:"dts",options(e){let{input:r=[]}=e;if(!Array.isArray(r)){r=typeof r==="string"?[r]:Object.values(r)}else if(r.length>1){e.input={};for(const t of r){let r=t.replace(/((\.d)?\.(t|j)sx?)$/,"");if(o.isAbsolute(t)){r=o.basename(r)}else{r=o.normalize(r)}e.input[r]=t}}i=createPrograms(Object.values(r),n);return t.options.call(this,e)},outputOptions:t.outputOptions,transform(e,r){const transformFile=(r,n)=>{if(typeof r==="object"){e=r.getFullText()}return t.transform.call(this,e,n)};if(!p.test(r)){return null}if(r.endsWith(c)){const{source:e}=getModule(r);return e?transformFile(e,r):null}const n=r.replace(p,c);let i=getModule(n);if(i.source){return transformFile(i.source,n)}i=getModule(r);if(typeof i.source!="object"||!i.program){return null}let s;const{emitSkipped:o,diagnostics:l}=i.program.emit(i.source,((t,r)=>{e=r;s=transformFile(true,n)}),undefined,true);if(o){const e=l.filter((e=>e.category===a["default"].DiagnosticCategory.Error));if(e.length){console.error(a["default"].formatDiagnostics(e,u));this.error("Failed to compile. Check the logs above.")}}return s},resolveId(e,t){if(!t){return}t=t.split("\\").join("/");const{resolvedModule:i}=a["default"].nodeModuleNameResolver(e,t,n,a["default"].sys);if(!i){return}if(!r&&i.isExternalLibraryImport){return{id:e,external:true}}else{return{id:o.resolve(i.resolvedFileName)}}},renderChunk:t.renderChunk}};e["default"]=plugin})();module.exports=r})();
|
|
1
|
+
(()=>{var e={248:function(e,t){(function(e,r){true?r(t):0})(this,(function(e){"use strict";const t=",".charCodeAt(0);const r=";".charCodeAt(0);const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";const i=new Uint8Array(64);const s=new Uint8Array(128);for(let e=0;e<n.length;e++){const t=n.charCodeAt(e);i[e]=t;s[t]=e}const o=typeof TextDecoder!=="undefined"?new TextDecoder:typeof Buffer!=="undefined"?{decode(e){const t=Buffer.from(e.buffer,e.byteOffset,e.byteLength);return t.toString()}}:{decode(e){let t="";for(let r=0;r<e.length;r++){t+=String.fromCharCode(e[r])}return t}};function decode(e){const t=new Int32Array(5);const r=[];let n=0;do{const i=indexOf(e,n);const s=[];let o=true;let a=0;t[0]=0;for(let r=n;r<i;r++){let n;r=decodeInteger(e,r,t,0);const c=t[0];if(c<a)o=false;a=c;if(hasMoreVlq(e,r,i)){r=decodeInteger(e,r,t,1);r=decodeInteger(e,r,t,2);r=decodeInteger(e,r,t,3);if(hasMoreVlq(e,r,i)){r=decodeInteger(e,r,t,4);n=[c,t[1],t[2],t[3],t[4]]}else{n=[c,t[1],t[2],t[3]]}}else{n=[c]}s.push(n)}if(!o)sort(s);r.push(s);n=i+1}while(n<=e.length);return r}function indexOf(e,t){const r=e.indexOf(";",t);return r===-1?e.length:r}function decodeInteger(e,t,r,n){let i=0;let o=0;let a=0;do{const r=e.charCodeAt(t++);a=s[r];i|=(a&31)<<o;o+=5}while(a&32);const c=i&1;i>>>=1;if(c){i=-2147483648|-i}r[n]+=i;return t}function hasMoreVlq(e,r,n){if(r>=n)return false;return e.charCodeAt(r)!==t}function sort(e){e.sort(sortComparator)}function sortComparator(e,t){return e[0]-t[0]}function encode(e){const n=new Int32Array(5);const i=1024*16;const s=i-36;const a=new Uint8Array(i);const c=a.subarray(0,s);let l=0;let u="";for(let f=0;f<e.length;f++){const d=e[f];if(f>0){if(l===i){u+=o.decode(a);l=0}a[l++]=r}if(d.length===0)continue;n[0]=0;for(let e=0;e<d.length;e++){const r=d[e];if(l>s){u+=o.decode(c);a.copyWithin(0,s,l);l-=s}if(e>0)a[l++]=t;l=encodeInteger(a,l,n,r,0);if(r.length===1)continue;l=encodeInteger(a,l,n,r,1);l=encodeInteger(a,l,n,r,2);l=encodeInteger(a,l,n,r,3);if(r.length===4)continue;l=encodeInteger(a,l,n,r,4)}}return u+o.decode(a.subarray(0,l))}function encodeInteger(e,t,r,n,s){const o=n[s];let a=o-r[s];r[s]=o;a=a<0?-a<<1|1:a<<1;do{let r=a&31;a>>>=5;if(a>0)r|=32;e[t++]=i[r]}while(a>0);return t}e.decode=decode;e.encode=encode;Object.defineProperty(e,"__esModule",{value:true})}))},571:(e,t,r)=>{"use strict";e=r.nmd(e);const n=r(755);const wrapAnsi16=(e,t)=>function(){const r=e.apply(n,arguments);return`[${r+t}m`};const wrapAnsi256=(e,t)=>function(){const r=e.apply(n,arguments);return`[${38+t};5;${r}m`};const wrapAnsi16m=(e,t)=>function(){const r=e.apply(n,arguments);return`[${38+t};2;${r[0]};${r[1]};${r[2]}m`};function assembleStyles(){const e=new Map;const t={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};t.color.grey=t.color.gray;for(const r of Object.keys(t)){const n=t[r];for(const r of Object.keys(n)){const i=n[r];t[r]={open:`[${i[0]}m`,close:`[${i[1]}m`};n[r]=t[r];e.set(i[0],i[1])}Object.defineProperty(t,r,{value:n,enumerable:false});Object.defineProperty(t,"codes",{value:e,enumerable:false})}const ansi2ansi=e=>e;const rgb2rgb=(e,t,r)=>[e,t,r];t.color.close="[39m";t.bgColor.close="[49m";t.color.ansi={ansi:wrapAnsi16(ansi2ansi,0)};t.color.ansi256={ansi256:wrapAnsi256(ansi2ansi,0)};t.color.ansi16m={rgb:wrapAnsi16m(rgb2rgb,0)};t.bgColor.ansi={ansi:wrapAnsi16(ansi2ansi,10)};t.bgColor.ansi256={ansi256:wrapAnsi256(ansi2ansi,10)};t.bgColor.ansi16m={rgb:wrapAnsi16m(rgb2rgb,10)};for(let e of Object.keys(n)){if(typeof n[e]!=="object"){continue}const r=n[e];if(e==="ansi16"){e="ansi"}if("ansi16"in r){t.color.ansi[e]=wrapAnsi16(r.ansi16,0);t.bgColor.ansi[e]=wrapAnsi16(r.ansi16,10)}if("ansi256"in r){t.color.ansi256[e]=wrapAnsi256(r.ansi256,0);t.bgColor.ansi256[e]=wrapAnsi256(r.ansi256,10)}if("rgb"in r){t.color.ansi16m[e]=wrapAnsi16m(r.rgb,0);t.bgColor.ansi16m[e]=wrapAnsi16m(r.rgb,10)}}return t}Object.defineProperty(e,"exports",{enumerable:true,get:assembleStyles})},673:(e,t,r)=>{"use strict";const n=r(434);const i=r(571);const s=r(332).stdout;const o=r(956);const a=process.platform==="win32"&&!(process.env.TERM||"").toLowerCase().startsWith("xterm");const c=["ansi","ansi","ansi256","ansi16m"];const l=new Set(["gray"]);const u=Object.create(null);function applyOptions(e,t){t=t||{};const r=s?s.level:0;e.level=t.level===undefined?r:t.level;e.enabled="enabled"in t?t.enabled:e.level>0}function Chalk(e){if(!this||!(this instanceof Chalk)||this.template){const t={};applyOptions(t,e);t.template=function(){const e=[].slice.call(arguments);return chalkTag.apply(null,[t.template].concat(e))};Object.setPrototypeOf(t,Chalk.prototype);Object.setPrototypeOf(t.template,t);t.template.constructor=Chalk;return t.template}applyOptions(this,e)}if(a){i.blue.open="[94m"}for(const e of Object.keys(i)){i[e].closeRe=new RegExp(n(i[e].close),"g");u[e]={get(){const t=i[e];return build.call(this,this._styles?this._styles.concat(t):[t],this._empty,e)}}}u.visible={get(){return build.call(this,this._styles||[],true,"visible")}};i.color.closeRe=new RegExp(n(i.color.close),"g");for(const e of Object.keys(i.color.ansi)){if(l.has(e)){continue}u[e]={get(){const t=this.level;return function(){const r=i.color[c[t]][e].apply(null,arguments);const n={open:r,close:i.color.close,closeRe:i.color.closeRe};return build.call(this,this._styles?this._styles.concat(n):[n],this._empty,e)}}}}i.bgColor.closeRe=new RegExp(n(i.bgColor.close),"g");for(const e of Object.keys(i.bgColor.ansi)){if(l.has(e)){continue}const t="bg"+e[0].toUpperCase()+e.slice(1);u[t]={get(){const t=this.level;return function(){const r=i.bgColor[c[t]][e].apply(null,arguments);const n={open:r,close:i.bgColor.close,closeRe:i.bgColor.closeRe};return build.call(this,this._styles?this._styles.concat(n):[n],this._empty,e)}}}}const f=Object.defineProperties((()=>{}),u);function build(e,t,r){const builder=function(){return applyStyle.apply(builder,arguments)};builder._styles=e;builder._empty=t;const n=this;Object.defineProperty(builder,"level",{enumerable:true,get(){return n.level},set(e){n.level=e}});Object.defineProperty(builder,"enabled",{enumerable:true,get(){return n.enabled},set(e){n.enabled=e}});builder.hasGrey=this.hasGrey||r==="gray"||r==="grey";builder.__proto__=f;return builder}function applyStyle(){const e=arguments;const t=e.length;let r=String(arguments[0]);if(t===0){return""}if(t>1){for(let n=1;n<t;n++){r+=" "+e[n]}}if(!this.enabled||this.level<=0||!r){return this._empty?"":r}const n=i.dim.open;if(a&&this.hasGrey){i.dim.open=""}for(const e of this._styles.slice().reverse()){r=e.open+r.replace(e.closeRe,e.open)+e.close;r=r.replace(/\r?\n/g,`${e.close}$&${e.open}`)}i.dim.open=n;return r}function chalkTag(e,t){if(!Array.isArray(t)){return[].slice.call(arguments,1).join(" ")}const r=[].slice.call(arguments,2);const n=[t.raw[0]];for(let e=1;e<t.length;e++){n.push(String(r[e-1]).replace(/[{}\\]/g,"\\$&"));n.push(String(t.raw[e]))}return o(e,n.join(""))}Object.defineProperties(Chalk.prototype,u);e.exports=Chalk();e.exports.supportsColor=s;e.exports["default"]=e.exports},956:e=>{"use strict";const t=/(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;const r=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;const n=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;const i=/\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi;const s=new Map([["n","\n"],["r","\r"],["t","\t"],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e",""],["a",""]]);function unescape(e){if(e[0]==="u"&&e.length===5||e[0]==="x"&&e.length===3){return String.fromCharCode(parseInt(e.slice(1),16))}return s.get(e)||e}function parseArguments(e,t){const r=[];const s=t.trim().split(/\s*,\s*/g);let o;for(const t of s){if(!isNaN(t)){r.push(Number(t))}else if(o=t.match(n)){r.push(o[2].replace(i,((e,t,r)=>t?unescape(t):r)))}else{throw new Error(`Invalid Chalk template style argument: ${t} (in style '${e}')`)}}return r}function parseStyle(e){r.lastIndex=0;const t=[];let n;while((n=r.exec(e))!==null){const e=n[1];if(n[2]){const r=parseArguments(e,n[2]);t.push([e].concat(r))}else{t.push([e])}}return t}function buildStyle(e,t){const r={};for(const e of t){for(const t of e.styles){r[t[0]]=e.inverse?null:t.slice(1)}}let n=e;for(const e of Object.keys(r)){if(Array.isArray(r[e])){if(!(e in n)){throw new Error(`Unknown Chalk style: ${e}`)}if(r[e].length>0){n=n[e].apply(n,r[e])}else{n=n[e]}}}return n}e.exports=(e,r)=>{const n=[];const i=[];let s=[];r.replace(t,((t,r,o,a,c,l)=>{if(r){s.push(unescape(r))}else if(a){const t=s.join("");s=[];i.push(n.length===0?t:buildStyle(e,n)(t));n.push({inverse:o,styles:parseStyle(a)})}else if(c){if(n.length===0){throw new Error("Found extraneous } in Chalk template literal")}i.push(buildStyle(e,n)(s.join("")));s=[];n.pop()}else{s.push(l)}}));i.push(s.join(""));if(n.length>0){const e=`Chalk template literal is missing ${n.length} closing bracket${n.length===1?"":"s"} (\`}\`)`;throw new Error(e)}return i.join("")}},461:(e,t,r)=>{var n=r(391);var i={};for(var s in n){if(n.hasOwnProperty(s)){i[n[s]]=s}}var o=e.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var a in o){if(o.hasOwnProperty(a)){if(!("channels"in o[a])){throw new Error("missing channels property: "+a)}if(!("labels"in o[a])){throw new Error("missing channel labels property: "+a)}if(o[a].labels.length!==o[a].channels){throw new Error("channel and label counts mismatch: "+a)}var c=o[a].channels;var l=o[a].labels;delete o[a].channels;delete o[a].labels;Object.defineProperty(o[a],"channels",{value:c});Object.defineProperty(o[a],"labels",{value:l})}}o.rgb.hsl=function(e){var t=e[0]/255;var r=e[1]/255;var n=e[2]/255;var i=Math.min(t,r,n);var s=Math.max(t,r,n);var o=s-i;var a;var c;var l;if(s===i){a=0}else if(t===s){a=(r-n)/o}else if(r===s){a=2+(n-t)/o}else if(n===s){a=4+(t-r)/o}a=Math.min(a*60,360);if(a<0){a+=360}l=(i+s)/2;if(s===i){c=0}else if(l<=.5){c=o/(s+i)}else{c=o/(2-s-i)}return[a,c*100,l*100]};o.rgb.hsv=function(e){var t;var r;var n;var i;var s;var o=e[0]/255;var a=e[1]/255;var c=e[2]/255;var l=Math.max(o,a,c);var u=l-Math.min(o,a,c);var diffc=function(e){return(l-e)/6/u+1/2};if(u===0){i=s=0}else{s=u/l;t=diffc(o);r=diffc(a);n=diffc(c);if(o===l){i=n-r}else if(a===l){i=1/3+t-n}else if(c===l){i=2/3+r-t}if(i<0){i+=1}else if(i>1){i-=1}}return[i*360,s*100,l*100]};o.rgb.hwb=function(e){var t=e[0];var r=e[1];var n=e[2];var i=o.rgb.hsl(e)[0];var s=1/255*Math.min(t,Math.min(r,n));n=1-1/255*Math.max(t,Math.max(r,n));return[i,s*100,n*100]};o.rgb.cmyk=function(e){var t=e[0]/255;var r=e[1]/255;var n=e[2]/255;var i;var s;var o;var a;a=Math.min(1-t,1-r,1-n);i=(1-t-a)/(1-a)||0;s=(1-r-a)/(1-a)||0;o=(1-n-a)/(1-a)||0;return[i*100,s*100,o*100,a*100]};function comparativeDistance(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)+Math.pow(e[2]-t[2],2)}o.rgb.keyword=function(e){var t=i[e];if(t){return t}var r=Infinity;var s;for(var o in n){if(n.hasOwnProperty(o)){var a=n[o];var c=comparativeDistance(e,a);if(c<r){r=c;s=o}}}return s};o.keyword.rgb=function(e){return n[e]};o.rgb.xyz=function(e){var t=e[0]/255;var r=e[1]/255;var n=e[2]/255;t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92;r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92;n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92;var i=t*.4124+r*.3576+n*.1805;var s=t*.2126+r*.7152+n*.0722;var o=t*.0193+r*.1192+n*.9505;return[i*100,s*100,o*100]};o.rgb.lab=function(e){var t=o.rgb.xyz(e);var r=t[0];var n=t[1];var i=t[2];var s;var a;var c;r/=95.047;n/=100;i/=108.883;r=r>.008856?Math.pow(r,1/3):7.787*r+16/116;n=n>.008856?Math.pow(n,1/3):7.787*n+16/116;i=i>.008856?Math.pow(i,1/3):7.787*i+16/116;s=116*n-16;a=500*(r-n);c=200*(n-i);return[s,a,c]};o.hsl.rgb=function(e){var t=e[0]/360;var r=e[1]/100;var n=e[2]/100;var i;var s;var o;var a;var c;if(r===0){c=n*255;return[c,c,c]}if(n<.5){s=n*(1+r)}else{s=n+r-n*r}i=2*n-s;a=[0,0,0];for(var l=0;l<3;l++){o=t+1/3*-(l-1);if(o<0){o++}if(o>1){o--}if(6*o<1){c=i+(s-i)*6*o}else if(2*o<1){c=s}else if(3*o<2){c=i+(s-i)*(2/3-o)*6}else{c=i}a[l]=c*255}return a};o.hsl.hsv=function(e){var t=e[0];var r=e[1]/100;var n=e[2]/100;var i=r;var s=Math.max(n,.01);var o;var a;n*=2;r*=n<=1?n:2-n;i*=s<=1?s:2-s;a=(n+r)/2;o=n===0?2*i/(s+i):2*r/(n+r);return[t,o*100,a*100]};o.hsv.rgb=function(e){var t=e[0]/60;var r=e[1]/100;var n=e[2]/100;var i=Math.floor(t)%6;var s=t-Math.floor(t);var o=255*n*(1-r);var a=255*n*(1-r*s);var c=255*n*(1-r*(1-s));n*=255;switch(i){case 0:return[n,c,o];case 1:return[a,n,o];case 2:return[o,n,c];case 3:return[o,a,n];case 4:return[c,o,n];case 5:return[n,o,a]}};o.hsv.hsl=function(e){var t=e[0];var r=e[1]/100;var n=e[2]/100;var i=Math.max(n,.01);var s;var o;var a;a=(2-r)*n;s=(2-r)*i;o=r*i;o/=s<=1?s:2-s;o=o||0;a/=2;return[t,o*100,a*100]};o.hwb.rgb=function(e){var t=e[0]/360;var r=e[1]/100;var n=e[2]/100;var i=r+n;var s;var o;var a;var c;if(i>1){r/=i;n/=i}s=Math.floor(6*t);o=1-n;a=6*t-s;if((s&1)!==0){a=1-a}c=r+a*(o-r);var l;var u;var f;switch(s){default:case 6:case 0:l=o;u=c;f=r;break;case 1:l=c;u=o;f=r;break;case 2:l=r;u=o;f=c;break;case 3:l=r;u=c;f=o;break;case 4:l=c;u=r;f=o;break;case 5:l=o;u=r;f=c;break}return[l*255,u*255,f*255]};o.cmyk.rgb=function(e){var t=e[0]/100;var r=e[1]/100;var n=e[2]/100;var i=e[3]/100;var s;var o;var a;s=1-Math.min(1,t*(1-i)+i);o=1-Math.min(1,r*(1-i)+i);a=1-Math.min(1,n*(1-i)+i);return[s*255,o*255,a*255]};o.xyz.rgb=function(e){var t=e[0]/100;var r=e[1]/100;var n=e[2]/100;var i;var s;var o;i=t*3.2406+r*-1.5372+n*-.4986;s=t*-.9689+r*1.8758+n*.0415;o=t*.0557+r*-.204+n*1.057;i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:i*12.92;s=s>.0031308?1.055*Math.pow(s,1/2.4)-.055:s*12.92;o=o>.0031308?1.055*Math.pow(o,1/2.4)-.055:o*12.92;i=Math.min(Math.max(0,i),1);s=Math.min(Math.max(0,s),1);o=Math.min(Math.max(0,o),1);return[i*255,s*255,o*255]};o.xyz.lab=function(e){var t=e[0];var r=e[1];var n=e[2];var i;var s;var o;t/=95.047;r/=100;n/=108.883;t=t>.008856?Math.pow(t,1/3):7.787*t+16/116;r=r>.008856?Math.pow(r,1/3):7.787*r+16/116;n=n>.008856?Math.pow(n,1/3):7.787*n+16/116;i=116*r-16;s=500*(t-r);o=200*(r-n);return[i,s,o]};o.lab.xyz=function(e){var t=e[0];var r=e[1];var n=e[2];var i;var s;var o;s=(t+16)/116;i=r/500+s;o=s-n/200;var a=Math.pow(s,3);var c=Math.pow(i,3);var l=Math.pow(o,3);s=a>.008856?a:(s-16/116)/7.787;i=c>.008856?c:(i-16/116)/7.787;o=l>.008856?l:(o-16/116)/7.787;i*=95.047;s*=100;o*=108.883;return[i,s,o]};o.lab.lch=function(e){var t=e[0];var r=e[1];var n=e[2];var i;var s;var o;i=Math.atan2(n,r);s=i*360/2/Math.PI;if(s<0){s+=360}o=Math.sqrt(r*r+n*n);return[t,o,s]};o.lch.lab=function(e){var t=e[0];var r=e[1];var n=e[2];var i;var s;var o;o=n/360*2*Math.PI;i=r*Math.cos(o);s=r*Math.sin(o);return[t,i,s]};o.rgb.ansi16=function(e){var t=e[0];var r=e[1];var n=e[2];var i=1 in arguments?arguments[1]:o.rgb.hsv(e)[2];i=Math.round(i/50);if(i===0){return 30}var s=30+(Math.round(n/255)<<2|Math.round(r/255)<<1|Math.round(t/255));if(i===2){s+=60}return s};o.hsv.ansi16=function(e){return o.rgb.ansi16(o.hsv.rgb(e),e[2])};o.rgb.ansi256=function(e){var t=e[0];var r=e[1];var n=e[2];if(t===r&&r===n){if(t<8){return 16}if(t>248){return 231}return Math.round((t-8)/247*24)+232}var i=16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5);return i};o.ansi16.rgb=function(e){var t=e%10;if(t===0||t===7){if(e>50){t+=3.5}t=t/10.5*255;return[t,t,t]}var r=(~~(e>50)+1)*.5;var n=(t&1)*r*255;var i=(t>>1&1)*r*255;var s=(t>>2&1)*r*255;return[n,i,s]};o.ansi256.rgb=function(e){if(e>=232){var t=(e-232)*10+8;return[t,t,t]}e-=16;var r;var n=Math.floor(e/36)/5*255;var i=Math.floor((r=e%36)/6)/5*255;var s=r%6/5*255;return[n,i,s]};o.rgb.hex=function(e){var t=((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255);var r=t.toString(16).toUpperCase();return"000000".substring(r.length)+r};o.hex.rgb=function(e){var t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t){return[0,0,0]}var r=t[0];if(t[0].length===3){r=r.split("").map((function(e){return e+e})).join("")}var n=parseInt(r,16);var i=n>>16&255;var s=n>>8&255;var o=n&255;return[i,s,o]};o.rgb.hcg=function(e){var t=e[0]/255;var r=e[1]/255;var n=e[2]/255;var i=Math.max(Math.max(t,r),n);var s=Math.min(Math.min(t,r),n);var o=i-s;var a;var c;if(o<1){a=s/(1-o)}else{a=0}if(o<=0){c=0}else if(i===t){c=(r-n)/o%6}else if(i===r){c=2+(n-t)/o}else{c=4+(t-r)/o+4}c/=6;c%=1;return[c*360,o*100,a*100]};o.hsl.hcg=function(e){var t=e[1]/100;var r=e[2]/100;var n=1;var i=0;if(r<.5){n=2*t*r}else{n=2*t*(1-r)}if(n<1){i=(r-.5*n)/(1-n)}return[e[0],n*100,i*100]};o.hsv.hcg=function(e){var t=e[1]/100;var r=e[2]/100;var n=t*r;var i=0;if(n<1){i=(r-n)/(1-n)}return[e[0],n*100,i*100]};o.hcg.rgb=function(e){var t=e[0]/360;var r=e[1]/100;var n=e[2]/100;if(r===0){return[n*255,n*255,n*255]}var i=[0,0,0];var s=t%1*6;var o=s%1;var a=1-o;var c=0;switch(Math.floor(s)){case 0:i[0]=1;i[1]=o;i[2]=0;break;case 1:i[0]=a;i[1]=1;i[2]=0;break;case 2:i[0]=0;i[1]=1;i[2]=o;break;case 3:i[0]=0;i[1]=a;i[2]=1;break;case 4:i[0]=o;i[1]=0;i[2]=1;break;default:i[0]=1;i[1]=0;i[2]=a}c=(1-r)*n;return[(r*i[0]+c)*255,(r*i[1]+c)*255,(r*i[2]+c)*255]};o.hcg.hsv=function(e){var t=e[1]/100;var r=e[2]/100;var n=t+r*(1-t);var i=0;if(n>0){i=t/n}return[e[0],i*100,n*100]};o.hcg.hsl=function(e){var t=e[1]/100;var r=e[2]/100;var n=r*(1-t)+.5*t;var i=0;if(n>0&&n<.5){i=t/(2*n)}else if(n>=.5&&n<1){i=t/(2*(1-n))}return[e[0],i*100,n*100]};o.hcg.hwb=function(e){var t=e[1]/100;var r=e[2]/100;var n=t+r*(1-t);return[e[0],(n-t)*100,(1-n)*100]};o.hwb.hcg=function(e){var t=e[1]/100;var r=e[2]/100;var n=1-r;var i=n-t;var s=0;if(i<1){s=(n-i)/(1-i)}return[e[0],i*100,s*100]};o.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};o.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};o.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};o.gray.hsl=o.gray.hsv=function(e){return[0,0,e[0]]};o.gray.hwb=function(e){return[0,100,e[0]]};o.gray.cmyk=function(e){return[0,0,0,e[0]]};o.gray.lab=function(e){return[e[0],0,0]};o.gray.hex=function(e){var t=Math.round(e[0]/100*255)&255;var r=(t<<16)+(t<<8)+t;var n=r.toString(16).toUpperCase();return"000000".substring(n.length)+n};o.rgb.gray=function(e){var t=(e[0]+e[1]+e[2])/3;return[t/255*100]}},755:(e,t,r)=>{var n=r(461);var i=r(974);var s={};var o=Object.keys(n);function wrapRaw(e){var wrappedFn=function(t){if(t===undefined||t===null){return t}if(arguments.length>1){t=Array.prototype.slice.call(arguments)}return e(t)};if("conversion"in e){wrappedFn.conversion=e.conversion}return wrappedFn}function wrapRounded(e){var wrappedFn=function(t){if(t===undefined||t===null){return t}if(arguments.length>1){t=Array.prototype.slice.call(arguments)}var r=e(t);if(typeof r==="object"){for(var n=r.length,i=0;i<n;i++){r[i]=Math.round(r[i])}}return r};if("conversion"in e){wrappedFn.conversion=e.conversion}return wrappedFn}o.forEach((function(e){s[e]={};Object.defineProperty(s[e],"channels",{value:n[e].channels});Object.defineProperty(s[e],"labels",{value:n[e].labels});var t=i(e);var r=Object.keys(t);r.forEach((function(r){var n=t[r];s[e][r]=wrapRounded(n);s[e][r].raw=wrapRaw(n)}))}));e.exports=s},974:(e,t,r)=>{var n=r(461);function buildGraph(){var e={};var t=Object.keys(n);for(var r=t.length,i=0;i<r;i++){e[t[i]]={distance:-1,parent:null}}return e}function deriveBFS(e){var t=buildGraph();var r=[e];t[e].distance=0;while(r.length){var i=r.pop();var s=Object.keys(n[i]);for(var o=s.length,a=0;a<o;a++){var c=s[a];var l=t[c];if(l.distance===-1){l.distance=t[i].distance+1;l.parent=i;r.unshift(c)}}}return t}function link(e,t){return function(r){return t(e(r))}}function wrapConversion(e,t){var r=[t[e].parent,e];var i=n[t[e].parent][e];var s=t[e].parent;while(t[s].parent){r.unshift(t[s].parent);i=link(n[t[s].parent][s],i);s=t[s].parent}i.conversion=r;return i}e.exports=function(e){var t=deriveBFS(e);var r={};var n=Object.keys(t);for(var i=n.length,s=0;s<i;s++){var o=n[s];var a=t[o];if(a.parent===null){continue}r[o]=wrapConversion(o,t)}return r}},391:e=>{"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},434:e=>{"use strict";var t=/[|\\{}()[\]^$+*?.]/g;e.exports=function(e){if(typeof e!=="string"){throw new TypeError("Expected a string")}return e.replace(t,"\\$&")}},419:e=>{"use strict";e.exports=(e,t)=>{t=t||process.argv;const r=e.startsWith("-")?"":e.length===1?"-":"--";const n=t.indexOf(r+e);const i=t.indexOf("--");return n!==-1&&(i===-1?true:n<i)}},629:(e,t)=>{Object.defineProperty(t,"__esModule",{value:true});t["default"]=/((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyus]{1,6}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g;t.matchToToken=function(e){var t={type:"invalid",value:e[0],closed:undefined};if(e[1])t.type="string",t.closed=!!(e[3]||e[4]);else if(e[5])t.type="comment";else if(e[6])t.type="comment",t.closed=!!e[7];else if(e[8])t.type="regex";else if(e[9])t.type="number";else if(e[10])t.type="name";else if(e[11])t.type="punctuator";else if(e[12])t.type="whitespace";return t}},712:(e,t,r)=>{"use strict";var n=r(248);class BitSet{constructor(e){this.bits=e instanceof BitSet?e.bits.slice():[]}add(e){this.bits[e>>5]|=1<<(e&31)}has(e){return!!(this.bits[e>>5]&1<<(e&31))}}class Chunk{constructor(e,t,r){this.start=e;this.end=t;this.original=r;this.intro="";this.outro="";this.content=r;this.storeName=false;this.edited=false;{this.previous=null;this.next=null}}appendLeft(e){this.outro+=e}appendRight(e){this.intro=this.intro+e}clone(){const e=new Chunk(this.start,this.end,this.original);e.intro=this.intro;e.outro=this.outro;e.content=this.content;e.storeName=this.storeName;e.edited=this.edited;return e}contains(e){return this.start<e&&e<this.end}eachNext(e){let t=this;while(t){e(t);t=t.next}}eachPrevious(e){let t=this;while(t){e(t);t=t.previous}}edit(e,t,r){this.content=e;if(!r){this.intro="";this.outro=""}this.storeName=t;this.edited=true;return this}prependLeft(e){this.outro=e+this.outro}prependRight(e){this.intro=e+this.intro}split(e){const t=e-this.start;const r=this.original.slice(0,t);const n=this.original.slice(t);this.original=r;const i=new Chunk(e,this.end,n);i.outro=this.outro;this.outro="";this.end=e;if(this.edited){i.edit("",false);this.content=""}else{this.content=r}i.next=this.next;if(i.next)i.next.previous=i;i.previous=this;this.next=i;return i}toString(){return this.intro+this.content+this.outro}trimEnd(e){this.outro=this.outro.replace(e,"");if(this.outro.length)return true;const t=this.content.replace(e,"");if(t.length){if(t!==this.content){this.split(this.start+t.length).edit("",undefined,true)}return true}else{this.edit("",undefined,true);this.intro=this.intro.replace(e,"");if(this.intro.length)return true}}trimStart(e){this.intro=this.intro.replace(e,"");if(this.intro.length)return true;const t=this.content.replace(e,"");if(t.length){if(t!==this.content){this.split(this.end-t.length);this.edit("",undefined,true)}return true}else{this.edit("",undefined,true);this.outro=this.outro.replace(e,"");if(this.outro.length)return true}}}function getBtoa(){if(typeof window!=="undefined"&&typeof window.btoa==="function"){return e=>window.btoa(unescape(encodeURIComponent(e)))}else if(typeof Buffer==="function"){return e=>Buffer.from(e,"utf-8").toString("base64")}else{return()=>{throw new Error("Unsupported environment: `window.btoa` or `Buffer` should be supported.")}}}const i=getBtoa();class SourceMap{constructor(e){this.version=3;this.file=e.file;this.sources=e.sources;this.sourcesContent=e.sourcesContent;this.names=e.names;this.mappings=n.encode(e.mappings)}toString(){return JSON.stringify(this)}toUrl(){return"data:application/json;charset=utf-8;base64,"+i(this.toString())}}function guessIndent(e){const t=e.split("\n");const r=t.filter((e=>/^\t+/.test(e)));const n=t.filter((e=>/^ {2,}/.test(e)));if(r.length===0&&n.length===0){return null}if(r.length>=n.length){return"\t"}const i=n.reduce(((e,t)=>{const r=/^ +/.exec(t)[0].length;return Math.min(r,e)}),Infinity);return new Array(i+1).join(" ")}function getRelativePath(e,t){const r=e.split(/[/\\]/);const n=t.split(/[/\\]/);r.pop();while(r[0]===n[0]){r.shift();n.shift()}if(r.length){let e=r.length;while(e--)r[e]=".."}return r.concat(n).join("/")}const s=Object.prototype.toString;function isObject(e){return s.call(e)==="[object Object]"}function getLocator(e){const t=e.split("\n");const r=[];for(let e=0,n=0;e<t.length;e++){r.push(n);n+=t[e].length+1}return function locate(e){let t=0;let n=r.length;while(t<n){const i=t+n>>1;if(e<r[i]){n=i}else{t=i+1}}const i=t-1;const s=e-r[i];return{line:i,column:s}}}class Mappings{constructor(e){this.hires=e;this.generatedCodeLine=0;this.generatedCodeColumn=0;this.raw=[];this.rawSegments=this.raw[this.generatedCodeLine]=[];this.pending=null}addEdit(e,t,r,n){if(t.length){const t=[this.generatedCodeColumn,e,r.line,r.column];if(n>=0){t.push(n)}this.rawSegments.push(t)}else if(this.pending){this.rawSegments.push(this.pending)}this.advance(t);this.pending=null}addUneditedChunk(e,t,r,n,i){let s=t.start;let o=true;while(s<t.end){if(this.hires||o||i.has(s)){this.rawSegments.push([this.generatedCodeColumn,e,n.line,n.column])}if(r[s]==="\n"){n.line+=1;n.column=0;this.generatedCodeLine+=1;this.raw[this.generatedCodeLine]=this.rawSegments=[];this.generatedCodeColumn=0;o=true}else{n.column+=1;this.generatedCodeColumn+=1;o=false}s+=1}this.pending=null}advance(e){if(!e)return;const t=e.split("\n");if(t.length>1){for(let e=0;e<t.length-1;e++){this.generatedCodeLine++;this.raw[this.generatedCodeLine]=this.rawSegments=[]}this.generatedCodeColumn=0}this.generatedCodeColumn+=t[t.length-1].length}}const o="\n";const a={insertLeft:false,insertRight:false,storeName:false};class MagicString{constructor(e,t={}){const r=new Chunk(0,e.length,e);Object.defineProperties(this,{original:{writable:true,value:e},outro:{writable:true,value:""},intro:{writable:true,value:""},firstChunk:{writable:true,value:r},lastChunk:{writable:true,value:r},lastSearchedChunk:{writable:true,value:r},byStart:{writable:true,value:{}},byEnd:{writable:true,value:{}},filename:{writable:true,value:t.filename},indentExclusionRanges:{writable:true,value:t.indentExclusionRanges},sourcemapLocations:{writable:true,value:new BitSet},storedNames:{writable:true,value:{}},indentStr:{writable:true,value:undefined}});this.byStart[0]=r;this.byEnd[e.length]=r}addSourcemapLocation(e){this.sourcemapLocations.add(e)}append(e){if(typeof e!=="string")throw new TypeError("outro content must be a string");this.outro+=e;return this}appendLeft(e,t){if(typeof t!=="string")throw new TypeError("inserted content must be a string");this._split(e);const r=this.byEnd[e];if(r){r.appendLeft(t)}else{this.intro+=t}return this}appendRight(e,t){if(typeof t!=="string")throw new TypeError("inserted content must be a string");this._split(e);const r=this.byStart[e];if(r){r.appendRight(t)}else{this.outro+=t}return this}clone(){const e=new MagicString(this.original,{filename:this.filename});let t=this.firstChunk;let r=e.firstChunk=e.lastSearchedChunk=t.clone();while(t){e.byStart[r.start]=r;e.byEnd[r.end]=r;const n=t.next;const i=n&&n.clone();if(i){r.next=i;i.previous=r;r=i}t=n}e.lastChunk=r;if(this.indentExclusionRanges){e.indentExclusionRanges=this.indentExclusionRanges.slice()}e.sourcemapLocations=new BitSet(this.sourcemapLocations);e.intro=this.intro;e.outro=this.outro;return e}generateDecodedMap(e){e=e||{};const t=0;const r=Object.keys(this.storedNames);const n=new Mappings(e.hires);const i=getLocator(this.original);if(this.intro){n.advance(this.intro)}this.firstChunk.eachNext((e=>{const s=i(e.start);if(e.intro.length)n.advance(e.intro);if(e.edited){n.addEdit(t,e.content,s,e.storeName?r.indexOf(e.original):-1)}else{n.addUneditedChunk(t,e,this.original,s,this.sourcemapLocations)}if(e.outro.length)n.advance(e.outro)}));return{file:e.file?e.file.split(/[/\\]/).pop():null,sources:[e.source?getRelativePath(e.file||"",e.source):null],sourcesContent:e.includeContent?[this.original]:[null],names:r,mappings:n.raw}}generateMap(e){return new SourceMap(this.generateDecodedMap(e))}_ensureindentStr(){if(this.indentStr===undefined){this.indentStr=guessIndent(this.original)}}_getRawIndentString(){this._ensureindentStr();return this.indentStr}getIndentString(){this._ensureindentStr();return this.indentStr===null?"\t":this.indentStr}indent(e,t){const r=/^[^\r\n]/gm;if(isObject(e)){t=e;e=undefined}if(e===undefined){this._ensureindentStr();e=this.indentStr||"\t"}if(e==="")return this;t=t||{};const n={};if(t.exclude){const e=typeof t.exclude[0]==="number"?[t.exclude]:t.exclude;e.forEach((e=>{for(let t=e[0];t<e[1];t+=1){n[t]=true}}))}let i=t.indentStart!==false;const replacer=t=>{if(i)return`${e}${t}`;i=true;return t};this.intro=this.intro.replace(r,replacer);let s=0;let o=this.firstChunk;while(o){const t=o.end;if(o.edited){if(!n[s]){o.content=o.content.replace(r,replacer);if(o.content.length){i=o.content[o.content.length-1]==="\n"}}}else{s=o.start;while(s<t){if(!n[s]){const t=this.original[s];if(t==="\n"){i=true}else if(t!=="\r"&&i){i=false;if(s===o.start){o.prependRight(e)}else{this._splitChunk(o,s);o=o.next;o.prependRight(e)}}}s+=1}}s=o.end;o=o.next}this.outro=this.outro.replace(r,replacer);return this}insert(){throw new Error("magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)")}insertLeft(e,t){if(!a.insertLeft){console.warn("magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead");a.insertLeft=true}return this.appendLeft(e,t)}insertRight(e,t){if(!a.insertRight){console.warn("magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead");a.insertRight=true}return this.prependRight(e,t)}move(e,t,r){if(r>=e&&r<=t)throw new Error("Cannot move a selection inside itself");this._split(e);this._split(t);this._split(r);const n=this.byStart[e];const i=this.byEnd[t];const s=n.previous;const o=i.next;const a=this.byStart[r];if(!a&&i===this.lastChunk)return this;const c=a?a.previous:this.lastChunk;if(s)s.next=o;if(o)o.previous=s;if(c)c.next=n;if(a)a.previous=i;if(!n.previous)this.firstChunk=i.next;if(!i.next){this.lastChunk=n.previous;this.lastChunk.next=null}n.previous=c;i.next=a||null;if(!c)this.firstChunk=n;if(!a)this.lastChunk=i;return this}overwrite(e,t,r,n){n=n||{};return this.update(e,t,r,{...n,overwrite:!n.contentOnly})}update(e,t,r,n){if(typeof r!=="string")throw new TypeError("replacement content must be a string");while(e<0)e+=this.original.length;while(t<0)t+=this.original.length;if(t>this.original.length)throw new Error("end is out of bounds");if(e===t)throw new Error("Cannot overwrite a zero-length range – use appendLeft or prependRight instead");this._split(e);this._split(t);if(n===true){if(!a.storeName){console.warn("The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string");a.storeName=true}n={storeName:true}}const i=n!==undefined?n.storeName:false;const s=n!==undefined?n.overwrite:false;if(i){const r=this.original.slice(e,t);Object.defineProperty(this.storedNames,r,{writable:true,value:true,enumerable:true})}const o=this.byStart[e];const c=this.byEnd[t];if(o){let e=o;while(e!==c){if(e.next!==this.byStart[e.end]){throw new Error("Cannot overwrite across a split point")}e=e.next;e.edit("",false)}o.edit(r,i,!s)}else{const n=new Chunk(e,t,"").edit(r,i);c.next=n;n.previous=c}return this}prepend(e){if(typeof e!=="string")throw new TypeError("outro content must be a string");this.intro=e+this.intro;return this}prependLeft(e,t){if(typeof t!=="string")throw new TypeError("inserted content must be a string");this._split(e);const r=this.byEnd[e];if(r){r.prependLeft(t)}else{this.intro=t+this.intro}return this}prependRight(e,t){if(typeof t!=="string")throw new TypeError("inserted content must be a string");this._split(e);const r=this.byStart[e];if(r){r.prependRight(t)}else{this.outro=t+this.outro}return this}remove(e,t){while(e<0)e+=this.original.length;while(t<0)t+=this.original.length;if(e===t)return this;if(e<0||t>this.original.length)throw new Error("Character is out of bounds");if(e>t)throw new Error("end must be greater than start");this._split(e);this._split(t);let r=this.byStart[e];while(r){r.intro="";r.outro="";r.edit("");r=t>r.end?this.byStart[r.end]:null}return this}lastChar(){if(this.outro.length)return this.outro[this.outro.length-1];let e=this.lastChunk;do{if(e.outro.length)return e.outro[e.outro.length-1];if(e.content.length)return e.content[e.content.length-1];if(e.intro.length)return e.intro[e.intro.length-1]}while(e=e.previous);if(this.intro.length)return this.intro[this.intro.length-1];return""}lastLine(){let e=this.outro.lastIndexOf(o);if(e!==-1)return this.outro.substr(e+1);let t=this.outro;let r=this.lastChunk;do{if(r.outro.length>0){e=r.outro.lastIndexOf(o);if(e!==-1)return r.outro.substr(e+1)+t;t=r.outro+t}if(r.content.length>0){e=r.content.lastIndexOf(o);if(e!==-1)return r.content.substr(e+1)+t;t=r.content+t}if(r.intro.length>0){e=r.intro.lastIndexOf(o);if(e!==-1)return r.intro.substr(e+1)+t;t=r.intro+t}}while(r=r.previous);e=this.intro.lastIndexOf(o);if(e!==-1)return this.intro.substr(e+1)+t;return this.intro+t}slice(e=0,t=this.original.length){while(e<0)e+=this.original.length;while(t<0)t+=this.original.length;let r="";let n=this.firstChunk;while(n&&(n.start>e||n.end<=e)){if(n.start<t&&n.end>=t){return r}n=n.next}if(n&&n.edited&&n.start!==e)throw new Error(`Cannot use replaced character ${e} as slice start anchor.`);const i=n;while(n){if(n.intro&&(i!==n||n.start===e)){r+=n.intro}const s=n.start<t&&n.end>=t;if(s&&n.edited&&n.end!==t)throw new Error(`Cannot use replaced character ${t} as slice end anchor.`);const o=i===n?e-n.start:0;const a=s?n.content.length+t-n.end:n.content.length;r+=n.content.slice(o,a);if(n.outro&&(!s||n.end===t)){r+=n.outro}if(s){break}n=n.next}return r}snip(e,t){const r=this.clone();r.remove(0,e);r.remove(t,r.original.length);return r}_split(e){if(this.byStart[e]||this.byEnd[e])return;let t=this.lastSearchedChunk;const r=e>t.end;while(t){if(t.contains(e))return this._splitChunk(t,e);t=r?this.byStart[t.end]:this.byEnd[t.start]}}_splitChunk(e,t){if(e.edited&&e.content.length){const r=getLocator(this.original)(t);throw new Error(`Cannot split a chunk that has already been edited (${r.line}:${r.column} – "${e.original}")`)}const r=e.split(t);this.byEnd[t]=e;this.byStart[t]=r;this.byEnd[r.end]=r;if(e===this.lastChunk)this.lastChunk=r;this.lastSearchedChunk=e;return true}toString(){let e=this.intro;let t=this.firstChunk;while(t){e+=t.toString();t=t.next}return e+this.outro}isEmpty(){let e=this.firstChunk;do{if(e.intro.length&&e.intro.trim()||e.content.length&&e.content.trim()||e.outro.length&&e.outro.trim())return false}while(e=e.next);return true}length(){let e=this.firstChunk;let t=0;do{t+=e.intro.length+e.content.length+e.outro.length}while(e=e.next);return t}trimLines(){return this.trim("[\\r\\n]")}trim(e){return this.trimStart(e).trimEnd(e)}trimEndAborted(e){const t=new RegExp((e||"\\s")+"+$");this.outro=this.outro.replace(t,"");if(this.outro.length)return true;let r=this.lastChunk;do{const e=r.end;const n=r.trimEnd(t);if(r.end!==e){if(this.lastChunk===r){this.lastChunk=r.next}this.byEnd[r.end]=r;this.byStart[r.next.start]=r.next;this.byEnd[r.next.end]=r.next}if(n)return true;r=r.previous}while(r);return false}trimEnd(e){this.trimEndAborted(e);return this}trimStartAborted(e){const t=new RegExp("^"+(e||"\\s")+"+");this.intro=this.intro.replace(t,"");if(this.intro.length)return true;let r=this.firstChunk;do{const e=r.end;const n=r.trimStart(t);if(r.end!==e){if(r===this.lastChunk)this.lastChunk=r.next;this.byEnd[r.end]=r;this.byStart[r.next.start]=r.next;this.byEnd[r.next.end]=r.next}if(n)return true;r=r.next}while(r);return false}trimStart(e){this.trimStartAborted(e);return this}hasChanged(){return this.original!==this.toString()}_replaceRegexp(e,t){function getReplacement(e,r){if(typeof t==="string"){return t.replace(/\$(\$|&|\d+)/g,((t,r)=>{if(r==="$")return"$";if(r==="&")return e[0];const n=+r;if(n<e.length)return e[+r];return`$${r}`}))}else{return t(...e,e.index,r,e.groups)}}function matchAll(e,t){let r;const n=[];while(r=e.exec(t)){n.push(r)}return n}if(e.global){const t=matchAll(e,this.original);t.forEach((e=>{if(e.index!=null)this.overwrite(e.index,e.index+e[0].length,getReplacement(e,this.original))}))}else{const t=this.original.match(e);if(t&&t.index!=null)this.overwrite(t.index,t.index+t[0].length,getReplacement(t,this.original))}return this}_replaceString(e,t){const{original:r}=this;const n=r.indexOf(e);if(n!==-1){this.overwrite(n,n+e.length,t)}return this}replace(e,t){if(typeof e==="string"){return this._replaceString(e,t)}return this._replaceRegexp(e,t)}_replaceAllString(e,t){const{original:r}=this;const n=e.length;for(let i=r.indexOf(e);i!==-1;i=r.indexOf(e,i+n)){this.overwrite(i,i+n,t)}return this}replaceAll(e,t){if(typeof e==="string"){return this._replaceAllString(e,t)}if(!e.global){throw new TypeError("MagicString.prototype.replaceAll called with a non-global RegExp argument")}return this._replaceRegexp(e,t)}}const c=Object.prototype.hasOwnProperty;class Bundle{constructor(e={}){this.intro=e.intro||"";this.separator=e.separator!==undefined?e.separator:"\n";this.sources=[];this.uniqueSources=[];this.uniqueSourceIndexByFilename={}}addSource(e){if(e instanceof MagicString){return this.addSource({content:e,filename:e.filename,separator:this.separator})}if(!isObject(e)||!e.content){throw new Error("bundle.addSource() takes an object with a `content` property, which should be an instance of MagicString, and an optional `filename`")}["filename","indentExclusionRanges","separator"].forEach((t=>{if(!c.call(e,t))e[t]=e.content[t]}));if(e.separator===undefined){e.separator=this.separator}if(e.filename){if(!c.call(this.uniqueSourceIndexByFilename,e.filename)){this.uniqueSourceIndexByFilename[e.filename]=this.uniqueSources.length;this.uniqueSources.push({filename:e.filename,content:e.content.original})}else{const t=this.uniqueSources[this.uniqueSourceIndexByFilename[e.filename]];if(e.content.original!==t.content){throw new Error(`Illegal source: same filename (${e.filename}), different contents`)}}}this.sources.push(e);return this}append(e,t){this.addSource({content:new MagicString(e),separator:t&&t.separator||""});return this}clone(){const e=new Bundle({intro:this.intro,separator:this.separator});this.sources.forEach((t=>{e.addSource({filename:t.filename,content:t.content.clone(),separator:t.separator})}));return e}generateDecodedMap(e={}){const t=[];this.sources.forEach((e=>{Object.keys(e.content.storedNames).forEach((e=>{if(!~t.indexOf(e))t.push(e)}))}));const r=new Mappings(e.hires);if(this.intro){r.advance(this.intro)}this.sources.forEach(((e,n)=>{if(n>0){r.advance(this.separator)}const i=e.filename?this.uniqueSourceIndexByFilename[e.filename]:-1;const s=e.content;const o=getLocator(s.original);if(s.intro){r.advance(s.intro)}s.firstChunk.eachNext((n=>{const a=o(n.start);if(n.intro.length)r.advance(n.intro);if(e.filename){if(n.edited){r.addEdit(i,n.content,a,n.storeName?t.indexOf(n.original):-1)}else{r.addUneditedChunk(i,n,s.original,a,s.sourcemapLocations)}}else{r.advance(n.content)}if(n.outro.length)r.advance(n.outro)}));if(s.outro){r.advance(s.outro)}}));return{file:e.file?e.file.split(/[/\\]/).pop():null,sources:this.uniqueSources.map((t=>e.file?getRelativePath(e.file,t.filename):t.filename)),sourcesContent:this.uniqueSources.map((t=>e.includeContent?t.content:null)),names:t,mappings:r.raw}}generateMap(e){return new SourceMap(this.generateDecodedMap(e))}getIndentString(){const e={};this.sources.forEach((t=>{const r=t.content._getRawIndentString();if(r===null)return;if(!e[r])e[r]=0;e[r]+=1}));return Object.keys(e).sort(((t,r)=>e[t]-e[r]))[0]||"\t"}indent(e){if(!arguments.length){e=this.getIndentString()}if(e==="")return this;let t=!this.intro||this.intro.slice(-1)==="\n";this.sources.forEach(((r,n)=>{const i=r.separator!==undefined?r.separator:this.separator;const s=t||n>0&&/\r?\n$/.test(i);r.content.indent(e,{exclude:r.indentExclusionRanges,indentStart:s});t=r.content.lastChar()==="\n"}));if(this.intro){this.intro=e+this.intro.replace(/^[^\n]/gm,((t,r)=>r>0?e+t:t))}return this}prepend(e){this.intro=e+this.intro;return this}toString(){const e=this.sources.map(((e,t)=>{const r=e.separator!==undefined?e.separator:this.separator;const n=(t>0?r:"")+e.content.toString();return n})).join("");return this.intro+e}isEmpty(){if(this.intro.length&&this.intro.trim())return false;if(this.sources.some((e=>!e.content.isEmpty())))return false;return true}length(){return this.sources.reduce(((e,t)=>e+t.content.length()),this.intro.length)}trimLines(){return this.trim("[\\r\\n]")}trim(e){return this.trimStart(e).trimEnd(e)}trimStart(e){const t=new RegExp("^"+(e||"\\s")+"+");this.intro=this.intro.replace(t,"");if(!this.intro){let t;let r=0;do{t=this.sources[r++];if(!t){break}}while(!t.content.trimStartAborted(e))}return this}trimEnd(e){const t=new RegExp((e||"\\s")+"+$");let r;let n=this.sources.length-1;do{r=this.sources[n--];if(!r){this.intro=this.intro.replace(t,"");break}}while(!r.content.trimEndAborted(e));return this}}MagicString.Bundle=Bundle;MagicString.SourceMap=SourceMap;MagicString.default=MagicString;e.exports=MagicString},332:(e,t,r)=>{"use strict";const n=r(37);const i=r(419);const s=process.env;let o;if(i("no-color")||i("no-colors")||i("color=false")){o=false}else if(i("color")||i("colors")||i("color=true")||i("color=always")){o=true}if("FORCE_COLOR"in s){o=s.FORCE_COLOR.length===0||parseInt(s.FORCE_COLOR,10)!==0}function translateLevel(e){if(e===0){return false}return{level:e,hasBasic:true,has256:e>=2,has16m:e>=3}}function supportsColor(e){if(o===false){return 0}if(i("color=16m")||i("color=full")||i("color=truecolor")){return 3}if(i("color=256")){return 2}if(e&&!e.isTTY&&o!==true){return 0}const t=o?1:0;if(process.platform==="win32"){const e=n.release().split(".");if(Number(process.versions.node.split(".")[0])>=8&&Number(e[0])>=10&&Number(e[2])>=10586){return Number(e[2])>=14931?3:2}return 1}if("CI"in s){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((e=>e in s))||s.CI_NAME==="codeship"){return 1}return t}if("TEAMCITY_VERSION"in s){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(s.TEAMCITY_VERSION)?1:0}if(s.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in s){const e=parseInt((s.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(s.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(s.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(s.TERM)){return 1}if("COLORTERM"in s){return 1}if(s.TERM==="dumb"){return t}return t}function getSupportLevel(e){const t=supportsColor(e);return translateLevel(t)}e.exports={supportsColor:getSupportLevel,stdout:getSupportLevel(process.stdout),stderr:getSupportLevel(process.stderr)}},188:e=>{"use strict";e.exports=require("module")},37:e=>{"use strict";e.exports=require("os")},17:e=>{"use strict";e.exports=require("path")},440:e=>{"use strict";e.exports=require("typescript")},310:e=>{"use strict";e.exports=require("url")},588:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.codeFrameColumns=codeFrameColumns;t["default"]=_default;var n=r(505);let i=false;function getDefs(e){return{gutter:e.grey,marker:e.red.bold,message:e.red.bold}}const s=/\r\n|[\n\r\u2028\u2029]/;function getMarkerLines(e,t,r){const n=Object.assign({column:0,line:-1},e.start);const i=Object.assign({},n,e.end);const{linesAbove:s=2,linesBelow:o=3}=r||{};const a=n.line;const c=n.column;const l=i.line;const u=i.column;let f=Math.max(a-(s+1),0);let d=Math.min(t.length,l+o);if(a===-1){f=0}if(l===-1){d=t.length}const h=l-a;const p={};if(h){for(let e=0;e<=h;e++){const r=e+a;if(!c){p[r]=true}else if(e===0){const e=t[r-1].length;p[r]=[c,e-c+1]}else if(e===h){p[r]=[0,u]}else{const n=t[r-e].length;p[r]=[0,n]}}}else{if(c===u){if(c){p[a]=[c,0]}else{p[a]=true}}else{p[a]=[c,u-c]}}return{start:f,end:d,markerLines:p}}function codeFrameColumns(e,t,r={}){const i=(r.highlightCode||r.forceColor)&&(0,n.shouldHighlight)(r);const o=(0,n.getChalk)(r);const a=getDefs(o);const maybeHighlight=(e,t)=>i?e(t):t;const c=e.split(s);const{start:l,end:u,markerLines:f}=getMarkerLines(t,c,r);const d=t.start&&typeof t.start.column==="number";const h=String(u).length;const p=i?(0,n.default)(e,r):e;let g=p.split(s,u).slice(l,u).map(((e,t)=>{const n=l+1+t;const i=` ${n}`.slice(-h);const s=` ${i} |`;const o=f[n];const c=!f[n+1];if(o){let t="";if(Array.isArray(o)){const n=e.slice(0,Math.max(o[0]-1,0)).replace(/[^\t]/g," ");const i=o[1]||1;t=["\n ",maybeHighlight(a.gutter,s.replace(/\d/g," "))," ",n,maybeHighlight(a.marker,"^").repeat(i)].join("");if(c&&r.message){t+=" "+maybeHighlight(a.message,r.message)}}return[maybeHighlight(a.marker,">"),maybeHighlight(a.gutter,s),e.length>0?` ${e}`:"",t].join("")}else{return` ${maybeHighlight(a.gutter,s)}${e.length>0?` ${e}`:""}`}})).join("\n");if(r.message&&!d){g=`${" ".repeat(h+1)}${r.message}\n${g}`}if(i){return o.reset(g)}else{return g}}function _default(e,t,r,n={}){if(!i){i=true;const e="Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";if(process.emitWarning){process.emitWarning(e,"DeprecationWarning")}else{const t=new Error(e);t.name="DeprecationWarning";console.warn(new Error(e))}}r=Math.max(r,0);const s={start:{column:r,line:t}};return codeFrameColumns(e,s,n)}},266:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.isIdentifierChar=isIdentifierChar;t.isIdentifierName=isIdentifierName;t.isIdentifierStart=isIdentifierStart;let r="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꟊꟐꟑꟓꟕ-ꟙꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ";let n="·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࢘-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_";const i=new RegExp("["+r+"]");const s=new RegExp("["+r+n+"]");r=n=null;const o=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,3104,541,1507,4938,6,4191];const a=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239];function isInAstralSet(e,t){let r=65536;for(let n=0,i=t.length;n<i;n+=2){r+=t[n];if(r>e)return false;r+=t[n+1];if(r>=e)return true}return false}function isIdentifierStart(e){if(e<65)return e===36;if(e<=90)return true;if(e<97)return e===95;if(e<=122)return true;if(e<=65535){return e>=170&&i.test(String.fromCharCode(e))}return isInAstralSet(e,o)}function isIdentifierChar(e){if(e<48)return e===36;if(e<58)return true;if(e<65)return false;if(e<=90)return true;if(e<97)return e===95;if(e<=122)return true;if(e<=65535){return e>=170&&s.test(String.fromCharCode(e))}return isInAstralSet(e,o)||isInAstralSet(e,a)}function isIdentifierName(e){let t=true;for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);if((n&64512)===55296&&r+1<e.length){const t=e.charCodeAt(++r);if((t&64512)===56320){n=65536+((n&1023)<<10)+(t&1023)}}if(t){t=false;if(!isIdentifierStart(n)){return false}}else if(!isIdentifierChar(n)){return false}}return!t}},740:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});Object.defineProperty(t,"isIdentifierChar",{enumerable:true,get:function(){return n.isIdentifierChar}});Object.defineProperty(t,"isIdentifierName",{enumerable:true,get:function(){return n.isIdentifierName}});Object.defineProperty(t,"isIdentifierStart",{enumerable:true,get:function(){return n.isIdentifierStart}});Object.defineProperty(t,"isKeyword",{enumerable:true,get:function(){return i.isKeyword}});Object.defineProperty(t,"isReservedWord",{enumerable:true,get:function(){return i.isReservedWord}});Object.defineProperty(t,"isStrictBindOnlyReservedWord",{enumerable:true,get:function(){return i.isStrictBindOnlyReservedWord}});Object.defineProperty(t,"isStrictBindReservedWord",{enumerable:true,get:function(){return i.isStrictBindReservedWord}});Object.defineProperty(t,"isStrictReservedWord",{enumerable:true,get:function(){return i.isStrictReservedWord}});var n=r(266);var i=r(563)},563:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.isKeyword=isKeyword;t.isReservedWord=isReservedWord;t.isStrictBindOnlyReservedWord=isStrictBindOnlyReservedWord;t.isStrictBindReservedWord=isStrictBindReservedWord;t.isStrictReservedWord=isStrictReservedWord;const r={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"],strictBind:["eval","arguments"]};const n=new Set(r.keyword);const i=new Set(r.strict);const s=new Set(r.strictBind);function isReservedWord(e,t){return t&&e==="await"||e==="enum"}function isStrictReservedWord(e,t){return isReservedWord(e,t)||i.has(e)}function isStrictBindOnlyReservedWord(e){return s.has(e)}function isStrictBindReservedWord(e,t){return isStrictReservedWord(e,t)||isStrictBindOnlyReservedWord(e)}function isKeyword(e){return n.has(e)}},505:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=highlight;t.getChalk=getChalk;t.shouldHighlight=shouldHighlight;var n=r(629);var i=r(740);var s=r(673);const o=new Set(["as","async","from","get","of","set"]);function getDefs(e){return{keyword:e.cyan,capitalized:e.yellow,jsxIdentifier:e.yellow,punctuator:e.yellow,number:e.magenta,string:e.green,regex:e.magenta,comment:e.grey,invalid:e.white.bgRed.bold}}const a=/\r\n|[\n\r\u2028\u2029]/;const c=/^[()[\]{}]$/;let l;{const e=/^[a-z][\w-]*$/i;const getTokenType=function(t,r,n){if(t.type==="name"){if((0,i.isKeyword)(t.value)||(0,i.isStrictReservedWord)(t.value,true)||o.has(t.value)){return"keyword"}if(e.test(t.value)&&(n[r-1]==="<"||n.slice(r-2,r)=="</")){return"jsxIdentifier"}if(t.value[0]!==t.value[0].toLowerCase()){return"capitalized"}}if(t.type==="punctuator"&&c.test(t.value)){return"bracket"}if(t.type==="invalid"&&(t.value==="@"||t.value==="#")){return"punctuator"}return t.type};l=function*(e){let t;while(t=n.default.exec(e)){const r=n.matchToToken(t);yield{type:getTokenType(r,t.index,e),value:r.value}}}}function highlightTokens(e,t){let r="";for(const{type:n,value:i}of l(t)){const t=e[n];if(t){r+=i.split(a).map((e=>t(e))).join("\n")}else{r+=i}}return r}function shouldHighlight(e){return!!s.supportsColor||e.forceColor}function getChalk(e){return e.forceColor?new s.constructor({enabled:true,level:1}):s}function highlight(e,t={}){if(e!==""&&shouldHighlight(t)){const r=getChalk(t);const n=getDefs(r);return highlightTokens(n,e)}else{return e}}}};var t={};function __nccwpck_require__(r){var n=t[r];if(n!==undefined){return n.exports}var i=t[r]={id:r,loaded:false,exports:{}};var s=true;try{e[r].call(i.exports,i,i.exports,__nccwpck_require__);s=false}finally{if(s)delete t[r]}i.loaded=true;return i.exports}(()=>{__nccwpck_require__.nmd=e=>{e.paths=[];if(!e.children)e.children=[];return e}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var r={};(()=>{"use strict";var e=r;Object.defineProperty(e,"__esModule",{value:true});var t=__nccwpck_require__(17);var n=__nccwpck_require__(440);var i=__nccwpck_require__(188);var s=__nccwpck_require__(712);function _interopNamespaceDefault(e){var t=Object.create(null);if(e){Object.keys(e).forEach((function(r){if(r!=="default"){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:true,get:function(){return e[r]}})}}))}t.default=e;return Object.freeze(t)}var o=_interopNamespaceDefault(t);const a=".d.ts";const c={getCurrentDirectory:()=>n.sys.getCurrentDirectory(),getNewLine:()=>n.sys.newLine,getCanonicalFileName:n.sys.useCaseSensitiveFileNames?e=>e:e=>e.toLowerCase()};const l={declaration:true,noEmit:false,emitDeclarationOnly:true,noEmitOnError:true,checkJs:false,declarationMap:false,skipLibCheck:true,preserveSymlinks:true,target:n.ScriptTarget.ESNext};const u=new Map;const logCache=(...e)=>process.env.DTS_LOG_CACHE?console.log("[cache]",...e):null;function cacheConfig([e,t],r){logCache(e);u.set(e,r);while(e!==t&&e!==o.dirname(e)){e=o.dirname(e);logCache("up",e);if(u.has(e))return logCache("has",e);u.set(e,r)}}function getCompilerOptions(e,t,r){const i={...l,...t};let s=o.dirname(e);let f=[];const d=r||s;if(!u.has(d)){logCache("miss",d);const e=r?o.resolve(process.cwd(),r):n.findConfigFile(s,n.sys.fileExists);if(!e){return{dtsFiles:f,dirName:s,compilerOptions:i}}let t=s;s=o.dirname(e);const{config:a,error:l}=n.readConfigFile(e,n.sys.readFile);if(l){console.error(n.formatDiagnostic(l,c));return{dtsFiles:f,dirName:s,compilerOptions:i}}logCache("tsconfig",a);const u=n.parseJsonConfigFileContent(a,n.sys,s);if(r){cacheConfig([r,r],u)}else{cacheConfig([t,s],u)}}else{logCache("HIT",d)}const{fileNames:h,options:p,errors:g}=u.get(d);f=h.filter((e=>e.endsWith(a)));if(g.length){console.error(n.formatDiagnostics(g,c));return{dtsFiles:f,dirName:s,compilerOptions:i}}return{dtsFiles:f,dirName:s,compilerOptions:{...p,...i}}}function createProgram$1(e,t,r){const{dtsFiles:i,compilerOptions:s}=getCompilerOptions(e,t,r);return n.createProgram([e].concat(Array.from(i)),s,n.createCompilerHost(s,true))}function createPrograms(e,t,r){const i=[];let s=[];let c=new Set;let l="";let u={};for(let f of e){if(f.endsWith(a)){continue}f=o.resolve(f);const e=getCompilerOptions(f,t,r);e.dtsFiles.forEach(c.add,c);if(!s.length){s.push(f);({dirName:l,compilerOptions:u}=e);continue}if(e.dirName===l){s.push(f)}else{const t=n.createCompilerHost(u,true);const r=n.createProgram(s.concat(Array.from(c)),u,t);i.push(r);s=[f];({dirName:l,compilerOptions:u}=e)}}if(s.length){const e=n.createCompilerHost(u,true);const t=n.createProgram(s.concat(Array.from(c)),u,e);i.push(t)}return i}function getCodeFrame(){let e=undefined;try{({codeFrameColumns:e}=__nccwpck_require__(588));return e}catch{try{const t=i.createRequire(typeof document==="undefined"?new(__nccwpck_require__(310).URL)("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("rollup-plugin-dts.cjs",document.baseURI).href);({codeFrameColumns:e}=t("@babel/code-frame"));return e}catch{}}return undefined}function getLocation(e){const t=e.getSourceFile();const r=t.getLineAndCharacterOfPosition(e.getStart());const n=t.getLineAndCharacterOfPosition(e.getEnd());return{start:{line:r.line+1,column:r.character+1},end:{line:n.line+1,column:n.character+1}}}function frameNode(e){const t=getCodeFrame();const r=e.getSourceFile();const n=r.getFullText();const i=getLocation(e);if(t){return"\n"+t(n,i,{highlightCode:true})}else{return`\n${i.start.line}:${i.start.column}: \`${e.getFullText().trim()}\``}}class UnsupportedSyntaxError extends Error{constructor(e,t="Syntax not yet supported"){super(`${t}\n${frameNode(e)}`)}}class NamespaceFixer{constructor(e){this.sourceFile=e}findNamespaces(){const e=[];const t={};for(const r of this.sourceFile.statements){const i={start:r.getStart(),end:r.getEnd()};if(n.isEmptyStatement(r)){e.unshift({name:"",exports:[],location:i});continue}if((n.isImportDeclaration(r)||n.isExportDeclaration(r))&&r.moduleSpecifier&&n.isStringLiteral(r.moduleSpecifier)){let{text:t}=r.moduleSpecifier;if(t.startsWith(".")&&(t.endsWith(".d.ts")||t.endsWith(".d.cts")||t.endsWith(".d.mts"))){let n=r.moduleSpecifier.getStart()+1;let i=r.moduleSpecifier.getEnd()-1;e.unshift({name:"",exports:[],location:{start:n,end:i},textBeforeCodeAfter:t.replace(/\.d\.ts$/,".js").replace(/\.d\.cts$/,".cjs").replace(/\.d\.mts$/,".mjs")})}}if(n.isModuleDeclaration(r)&&r.body&&n.isModuleBlock(r.body)){for(const t of r.body.statements){if(n.isExportDeclaration(t)&&t.exportClause){if(n.isNamespaceExport(t.exportClause)){continue}for(const r of t.exportClause.elements){if(r.propertyName&&r.propertyName.getText()==r.name.getText()){e.unshift({name:"",exports:[],location:{start:r.propertyName.getEnd(),end:r.name.getEnd()}})}}}}}if(n.isClassDeclaration(r)){t[r.name.getText()]={type:"class",generics:r.typeParameters}}else if(n.isFunctionDeclaration(r)){t[r.name.getText()]={type:"function"}}else if(n.isInterfaceDeclaration(r)){t[r.name.getText()]={type:"interface",generics:r.typeParameters}}else if(n.isTypeAliasDeclaration(r)){t[r.name.getText()]={type:"type",generics:r.typeParameters}}else if(n.isModuleDeclaration(r)&&n.isIdentifier(r.name)){t[r.name.getText()]={type:"namespace"}}else if(n.isEnumDeclaration(r)){t[r.name.getText()]={type:"enum"}}if(!n.isVariableStatement(r)){continue}const{declarations:s}=r.declarationList;if(s.length!==1){continue}const o=s[0];const a=o.name.getText();if(!o.initializer||!n.isCallExpression(o.initializer)){t[a]={type:"var"};continue}const c=o.initializer.arguments[0];if(!o.initializer.expression.getFullText().includes("/*#__PURE__*/Object.freeze")||!n.isObjectLiteralExpression(c)){continue}const l=[];for(const e of c.properties){if(!n.isPropertyAssignment(e)||!(n.isIdentifier(e.name)||n.isStringLiteral(e.name))||e.name.text!=="__proto__"&&!n.isIdentifier(e.initializer)){throw new UnsupportedSyntaxError(e,"Expected a property assignment")}if(e.name.text==="__proto__"){continue}l.push({exportedName:e.name.text,localName:e.initializer.getText()})}e.unshift({name:a,exports:l,location:i})}return{namespaces:e,itemTypes:t}}fix(){let e=this.sourceFile.getFullText();const{namespaces:t,itemTypes:r}=this.findNamespaces();for(const n of t){const t=e.slice(n.location.end);e=e.slice(0,n.location.start);for(const{exportedName:t,localName:i}of n.exports){if(t===i){const{type:s,generics:o}=r[i]||{};if(s==="interface"||s==="type"){const r=renderTypeParams(o);e+=`type ${n.name}_${t}${r.in} = ${i}${r.out};\n`}else if(s==="enum"||s==="class"){const r=renderTypeParams(o);e+=`type ${n.name}_${t}${r.in} = ${i}${r.out};\n`;e+=`declare const ${n.name}_${t}: typeof ${i};\n`}else{e+=`declare const ${n.name}_${t}: typeof ${i};\n`}}}if(n.name){e+=`declare namespace ${n.name} {\n`;e+=` export {\n`;for(const{exportedName:t,localName:r}of n.exports){if(t===r){e+=` ${n.name}_${t} as ${t},\n`}else{e+=` ${r} as ${t},\n`}}e+=` };\n`;e+=`}`}e+=n.textBeforeCodeAfter??"";e+=t}return e}}function renderTypeParams(e){if(!e||!e.length){return{in:"",out:""}}return{in:`<${e.map((e=>e.getText())).join(", ")}>`,out:`<${e.map((e=>e.name.getText())).join(", ")}>`}}let f=1;function createProgram(e){return withStartEnd({type:"Program",sourceType:"module",body:[]},{start:e.getFullStart(),end:e.getEnd()})}function createReference(e){const t={type:"Identifier",name:String(f++)};return{ident:t,expr:{type:"AssignmentPattern",left:t,right:e}}}function createIdentifier(e){return withStartEnd({type:"Identifier",name:e.getText()},e)}function createIIFE(e){const t=withStartEnd({type:"FunctionExpression",id:null,params:[],body:{type:"BlockStatement",body:[]}},e);const r=withStartEnd({type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"Identifier",name:String(f++)},arguments:[t],optional:false}},e);return{fn:t,iife:r}}function createReturn(){const e={type:"ArrayExpression",elements:[]};return{expr:e,stmt:{type:"ReturnStatement",argument:e}}}function createDeclaration(e,t){return withStartEnd({type:"FunctionDeclaration",id:withStartEnd({type:"Identifier",name:n.idText(e)},e),params:[],body:{type:"BlockStatement",body:[]}},t)}function convertExpression(e){if(n.isLiteralExpression(e)){return{type:"Literal",value:e.text}}if(n.isPropertyAccessExpression(e)){if(n.isPrivateIdentifier(e.name)){throw new UnsupportedSyntaxError(e.name)}return withStartEnd({type:"MemberExpression",computed:false,optional:false,object:convertExpression(e.expression),property:convertExpression(e.name)},{start:e.expression.getStart(),end:e.name.getEnd()})}if(n.isIdentifier(e)){return createIdentifier(e)}else if(e.kind==n.SyntaxKind.NullKeyword){return{type:"Literal",value:null}}else{throw new UnsupportedSyntaxError(e)}}function withStartEnd(e,t){let r="start"in t?t:{start:t.getStart(),end:t.getEnd()};return Object.assign(e,r)}function matchesModifier(e,t){const r=n.getCombinedModifierFlags(e);return(r&t)===t}function preProcess({sourceFile:e}){const t=new s(e.getFullText());const r=new Set;const i=new Set;let o="";const a=new Map;const c=new Map;for(const s of e.statements){if(n.isEmptyStatement(s)){t.remove(s.getStart(),s.getEnd());continue}if(n.isEnumDeclaration(s)||n.isFunctionDeclaration(s)||n.isInterfaceDeclaration(s)||n.isClassDeclaration(s)||n.isTypeAliasDeclaration(s)||n.isModuleDeclaration(s)){if(s.name){const e=s.name.getText();r.add(e);if(matchesModifier(s,n.ModifierFlags.ExportDefault)){o=e}else if(matchesModifier(s,n.ModifierFlags.Export)){i.add(e)}if(!(s.flags&n.NodeFlags.GlobalAugmentation)){pushNamedNode(e,[getStart(s),getEnd(s)])}}if(n.isModuleDeclaration(s)){duplicateExports(t,s)}fixModifiers(t,s)}else if(n.isVariableStatement(s)){const{declarations:e}=s.declarationList;const o=matchesModifier(s,n.ModifierFlags.Export);for(const e of s.declarationList.declarations){if(n.isIdentifier(e.name)){const t=e.name.getText();r.add(t);if(o){i.add(t)}}}fixModifiers(t,s);if(e.length==1){const t=e[0];if(n.isIdentifier(t.name)){pushNamedNode(t.name.getText(),[getStart(s),getEnd(s)])}}else{const t=e.slice();const r=t.shift();pushNamedNode(r.name.getText(),[getStart(s),r.getEnd()]);for(const e of t){if(n.isIdentifier(e.name)){pushNamedNode(e.name.getText(),[e.getFullStart(),e.getEnd()])}}}const{flags:a}=s.declarationList;const c=a&n.NodeFlags.Let?"let":a&n.NodeFlags.Const?"const":"var";const l=`declare ${c} `;const u=s.declarationList.getChildren().find((e=>e.kind===n.SyntaxKind.SyntaxList)).getChildren();let f=0;for(const e of u){if(e.kind===n.SyntaxKind.CommaToken){f=e.getStart();t.remove(f,e.getEnd())}else if(f){t.appendLeft(f,";\n");const r=e.getFullStart();const n=t.slice(r,e.getStart());let i=n.length-n.trimStart().length;if(i){t.overwrite(r,r+i,l)}else{t.appendLeft(r,l)}}}}}for(const r of e.statements){checkInlineImport(r);if(!matchesModifier(r,n.ModifierFlags.ExportDefault)){continue}if(n.isFunctionDeclaration(r)||n.isClassDeclaration(r)){if(r.name){continue}if(!o){o=uniqName("export_default")}const e=r.getChildren();const i=e.findIndex((e=>e.kind===n.SyntaxKind.ClassKeyword||e.kind===n.SyntaxKind.FunctionKeyword));const s=e[i];const a=e[i+1];const c=a.kind>=n.SyntaxKind.FirstPunctuation&&a.kind<=n.SyntaxKind.LastPunctuation;if(c){t.appendLeft(a.getStart(),o)}else{t.appendRight(s.getEnd(),` ${o}`)}}}for(const e of c.values()){const r=e.pop();const n=r[0];for(const r of e){t.move(r[0],r[1],n)}}if(o){t.append(`\nexport default ${o};\n`)}if(i.size){t.append(`\nexport { ${[...i].join(", ")} };\n`)}for(const[e,r]of a.entries()){t.prepend(`import * as ${r} from "${e}";\n`)}const l=e.getLineStarts();const u=new Set;for(const r of e.typeReferenceDirectives){u.add(r.fileName);const{line:n}=e.getLineAndCharacterOfPosition(r.pos);const i=l[n];let s=e.getLineEndOfPosition(r.pos);if(t.slice(s,s+1)=="\n"){s+=1}t.remove(i,s)}const f=new Set;for(const r of e.referencedFiles){f.add(r.fileName);const{line:n}=e.getLineAndCharacterOfPosition(r.pos);const i=l[n];let s=e.getLineEndOfPosition(r.pos);if(t.slice(s,s+1)=="\n"){s+=1}t.remove(i,s)}return{code:t,typeReferences:u,fileReferences:f};function checkInlineImport(e){n.forEachChild(e,checkInlineImport);if(n.isImportTypeNode(e)){if(!n.isLiteralTypeNode(e.argument)||!n.isStringLiteral(e.argument.literal)){throw new UnsupportedSyntaxError(e,"inline imports should have a literal argument")}const r=e.argument.literal.text;const i=e.getChildren();const s=i.find((e=>e.kind===n.SyntaxKind.ImportKeyword)).getStart();let o=e.getEnd();const a=i.find((e=>e.kind===n.SyntaxKind.DotToken||e.kind===n.SyntaxKind.LessThanToken));if(a){o=a.getStart()}const c=createNamespaceImport(r);t.overwrite(s,o,c)}}function createNamespaceImport(e){let t=a.get(e);if(!t){t=uniqName(e.replace(/[^a-zA-Z0-9_$]/g,(()=>"_")));a.set(e,t)}return t}function uniqName(e){let t=e;while(r.has(t)){t=`_${t}`}r.add(t);return t}function pushNamedNode(e,t){let r=c.get(e);if(!r){r=[t];c.set(e,r)}else{const e=r[r.length-1];if(e[1]===t[0]){e[1]=t[1]}else{r.push(t)}}}}function fixModifiers(e,t){let r=false;const i=n.isClassDeclaration(t)||n.isFunctionDeclaration(t)||n.isModuleDeclaration(t)||n.isVariableStatement(t);for(const i of t.modifiers??[]){switch(i.kind){case n.SyntaxKind.ExportKeyword:case n.SyntaxKind.DefaultKeyword:e.remove(i.getStart(),i.getEnd()+1);break;case n.SyntaxKind.DeclareKeyword:r=true}}if(i&&!r){e.appendRight(t.getStart(),"declare ")}}function duplicateExports(e,t){if(!t.body||!n.isModuleBlock(t.body)){return}for(const r of t.body.statements){if(n.isExportDeclaration(r)&&r.exportClause){if(n.isNamespaceExport(r.exportClause)){continue}for(const t of r.exportClause.elements){if(!t.propertyName){e.appendLeft(t.name.getEnd(),` as ${t.name.getText()}`)}}}}}function getStart(e){const t=e.getFullStart();return t+(newlineAt(e,t)?1:0)}function getEnd(e){const t=e.getEnd();return t+(newlineAt(e,t)?1:0)}function newlineAt(e,t){return e.getSourceFile().getFullText()[t]=="\n"}const d=new Set([n.SyntaxKind.LiteralType,n.SyntaxKind.VoidKeyword,n.SyntaxKind.UnknownKeyword,n.SyntaxKind.AnyKeyword,n.SyntaxKind.BooleanKeyword,n.SyntaxKind.NumberKeyword,n.SyntaxKind.StringKeyword,n.SyntaxKind.ObjectKeyword,n.SyntaxKind.NullKeyword,n.SyntaxKind.UndefinedKeyword,n.SyntaxKind.SymbolKeyword,n.SyntaxKind.NeverKeyword,n.SyntaxKind.ThisKeyword,n.SyntaxKind.ThisType,n.SyntaxKind.BigIntKeyword]);class DeclarationScope{constructor({id:e,range:t}){this.scopes=[];if(e){this.declaration=createDeclaration(e,t)}else{const{iife:e,fn:r}=createIIFE(t);this.iife=e;this.declaration=r}const r=createReturn();this.declaration.body.body.push(r.stmt);this.returnExpr=r.expr}pushScope(){this.scopes.push(new Set)}popScope(e=1){for(let t=0;t<e;t++){this.scopes.pop()}}pushTypeVariable(e){const t=e.getText();this.scopes[this.scopes.length-1]?.add(t)}pushReference(e){let t;if(e.type==="Identifier"){t=e.name}else if(e.type==="MemberExpression"){if(e.object.type==="Identifier"){t=e.object.name}}if(t){for(const e of this.scopes){if(e.has(t)){return}}}const{ident:r,expr:n}=createReference(e);this.declaration.params.push(n);this.returnExpr.elements.push(r)}pushIdentifierReference(e){this.pushReference(createIdentifier(e))}convertEntityName(e){if(n.isIdentifier(e)){return createIdentifier(e)}return withStartEnd({type:"MemberExpression",computed:false,optional:false,object:this.convertEntityName(e.left),property:createIdentifier(e.right)},e)}convertPropertyAccess(e){if(!n.isIdentifier(e.expression)&&!n.isPropertyAccessExpression(e.expression)){throw new UnsupportedSyntaxError(e.expression)}if(n.isPrivateIdentifier(e.name)){throw new UnsupportedSyntaxError(e.name)}let t=n.isIdentifier(e.expression)?createIdentifier(e.expression):this.convertPropertyAccess(e.expression);return withStartEnd({type:"MemberExpression",computed:false,optional:false,object:t,property:createIdentifier(e.name)},e)}convertComputedPropertyName(e){if(!e.name||!n.isComputedPropertyName(e.name)){return}const{expression:t}=e.name;if(n.isLiteralExpression(t)||n.isPrefixUnaryExpression(t)){return}if(n.isIdentifier(t)){return this.pushReference(createIdentifier(t))}if(n.isPropertyAccessExpression(t)){return this.pushReference(this.convertPropertyAccess(t))}throw new UnsupportedSyntaxError(t)}convertParametersAndType(e){this.convertComputedPropertyName(e);const t=this.convertTypeParameters(e.typeParameters);for(const t of e.parameters){this.convertTypeNode(t.type)}this.convertTypeNode(e.type);this.popScope(t)}convertHeritageClauses(e){for(const t of e.heritageClauses||[]){for(const e of t.types){this.pushReference(convertExpression(e.expression));this.convertTypeArguments(e)}}}convertTypeArguments(e){if(!e.typeArguments){return}for(const t of e.typeArguments){this.convertTypeNode(t)}}convertMembers(e){for(const t of e){if(n.isPropertyDeclaration(t)||n.isPropertySignature(t)||n.isIndexSignatureDeclaration(t)){if(n.isPropertyDeclaration(t)&&t.initializer&&n.isPropertyAccessExpression(t.initializer)){this.pushReference(this.convertPropertyAccess(t.initializer))}this.convertComputedPropertyName(t);this.convertTypeNode(t.type);continue}if(n.isMethodDeclaration(t)||n.isMethodSignature(t)||n.isConstructorDeclaration(t)||n.isConstructSignatureDeclaration(t)||n.isCallSignatureDeclaration(t)||n.isGetAccessorDeclaration(t)||n.isSetAccessorDeclaration(t)){this.convertParametersAndType(t)}else{throw new UnsupportedSyntaxError(t)}}}convertTypeParameters(e){if(!e){return 0}for(const t of e){this.convertTypeNode(t.constraint);this.convertTypeNode(t.default);this.pushScope();this.pushTypeVariable(t.name)}return e.length}convertTypeNode(e){if(!e){return}if(d.has(e.kind)){return}if(n.isTypeReferenceNode(e)){this.pushReference(this.convertEntityName(e.typeName));this.convertTypeArguments(e);return}if(n.isTypeLiteralNode(e)){return this.convertMembers(e.members)}if(n.isArrayTypeNode(e)){return this.convertTypeNode(e.elementType)}if(n.isTupleTypeNode(e)){for(const t of e.elements){this.convertTypeNode(t)}return}if(n.isNamedTupleMember(e)||n.isParenthesizedTypeNode(e)||n.isTypeOperatorNode(e)||n.isTypePredicateNode(e)){return this.convertTypeNode(e.type)}if(n.isUnionTypeNode(e)||n.isIntersectionTypeNode(e)){for(const t of e.types){this.convertTypeNode(t)}return}if(n.isMappedTypeNode(e)){const{typeParameter:t,type:r,nameType:n}=e;this.convertTypeNode(t.constraint);this.pushScope();this.pushTypeVariable(t.name);this.convertTypeNode(r);if(n){this.convertTypeNode(n)}this.popScope();return}if(n.isConditionalTypeNode(e)){this.convertTypeNode(e.checkType);this.pushScope();this.convertTypeNode(e.extendsType);this.convertTypeNode(e.trueType);this.convertTypeNode(e.falseType);this.popScope();return}if(n.isIndexedAccessTypeNode(e)){this.convertTypeNode(e.objectType);this.convertTypeNode(e.indexType);return}if(n.isFunctionOrConstructorTypeNode(e)){this.convertParametersAndType(e);return}if(n.isTypeQueryNode(e)){this.pushReference(this.convertEntityName(e.exprName));return}if(n.isRestTypeNode(e)){this.convertTypeNode(e.type);return}if(n.isOptionalTypeNode(e)){this.convertTypeNode(e.type);return}if(n.isTemplateLiteralTypeNode(e)){for(const t of e.templateSpans){this.convertTypeNode(t.type)}return}if(n.isInferTypeNode(e)){const{typeParameter:t}=e;this.convertTypeNode(t.constraint);this.pushTypeVariable(t.name);return}else{throw new UnsupportedSyntaxError(e)}}convertNamespace(e,t=false){this.pushScope();if(t&&e.body&&n.isModuleDeclaration(e.body)){this.convertNamespace(e.body,true);return}if(!e.body||!n.isModuleBlock(e.body)){throw new UnsupportedSyntaxError(e,`namespace must have a "ModuleBlock" body.`)}const{statements:r}=e.body;for(const e of r){if(n.isEnumDeclaration(e)||n.isFunctionDeclaration(e)||n.isClassDeclaration(e)||n.isInterfaceDeclaration(e)||n.isTypeAliasDeclaration(e)||n.isModuleDeclaration(e)){if(e.name&&n.isIdentifier(e.name)){this.pushTypeVariable(e.name)}else{throw new UnsupportedSyntaxError(e,`non-Identifier name not supported`)}continue}if(n.isVariableStatement(e)){for(const t of e.declarationList.declarations){if(n.isIdentifier(t.name)){this.pushTypeVariable(t.name)}else{throw new UnsupportedSyntaxError(t,`non-Identifier name not supported`)}}continue}if(n.isExportDeclaration(e));else{throw new UnsupportedSyntaxError(e,`namespace child (hoisting) not supported yet`)}}for(const e of r){if(n.isVariableStatement(e)){for(const t of e.declarationList.declarations){if(t.type){this.convertTypeNode(t.type)}}continue}if(n.isFunctionDeclaration(e)){this.convertParametersAndType(e);continue}if(n.isInterfaceDeclaration(e)||n.isClassDeclaration(e)){const t=this.convertTypeParameters(e.typeParameters);this.convertHeritageClauses(e);this.convertMembers(e.members);this.popScope(t);continue}if(n.isTypeAliasDeclaration(e)){const t=this.convertTypeParameters(e.typeParameters);this.convertTypeNode(e.type);this.popScope(t);continue}if(n.isModuleDeclaration(e)){this.convertNamespace(e,t);continue}if(n.isEnumDeclaration(e)){continue}if(n.isExportDeclaration(e)){if(e.exportClause){if(n.isNamespaceExport(e.exportClause)){throw new UnsupportedSyntaxError(e.exportClause)}for(const t of e.exportClause.elements){const e=t.propertyName||t.name;this.pushIdentifierReference(e)}}}else{throw new UnsupportedSyntaxError(e,`namespace child (walking) not supported yet`)}}this.popScope()}}function convert({sourceFile:e}){const t=new Transformer(e);return t.transform()}class Transformer{constructor(e){this.sourceFile=e;this.declarations=new Map;this.ast=createProgram(e);for(const t of e.statements){this.convertStatement(t)}}transform(){return{ast:this.ast}}pushStatement(e){this.ast.body.push(e)}createDeclaration(e,t){const r={start:e.getFullStart(),end:e.getEnd()};if(!t){const e=new DeclarationScope({range:r});this.pushStatement(e.iife);return e}const n=t.getText();const i=new DeclarationScope({id:t,range:r});const s=this.declarations.get(n);if(s){s.pushIdentifierReference(t);s.declaration.end=r.end;let e=this.ast.body.findIndex((e=>e==s.declaration));for(let t=e+1;t<this.ast.body.length;t++){const e=this.ast.body[t];e.start=e.end=r.end}}else{this.pushStatement(i.declaration);this.declarations.set(n,i)}return s||i}convertStatement(e){if(n.isEnumDeclaration(e)){return this.convertEnumDeclaration(e)}if(n.isFunctionDeclaration(e)){return this.convertFunctionDeclaration(e)}if(n.isInterfaceDeclaration(e)||n.isClassDeclaration(e)){return this.convertClassOrInterfaceDeclaration(e)}if(n.isTypeAliasDeclaration(e)){return this.convertTypeAliasDeclaration(e)}if(n.isVariableStatement(e)){return this.convertVariableStatement(e)}if(n.isExportDeclaration(e)||n.isExportAssignment(e)){return this.convertExportDeclaration(e)}if(n.isModuleDeclaration(e)){return this.convertNamespaceDeclaration(e)}if(e.kind==n.SyntaxKind.NamespaceExportDeclaration){return this.removeStatement(e)}if(n.isImportDeclaration(e)||n.isImportEqualsDeclaration(e)){return this.convertImportDeclaration(e)}else{throw new UnsupportedSyntaxError(e)}}removeStatement(e){this.pushStatement(withStartEnd({type:"ExpressionStatement",expression:{type:"Literal",value:"pls remove me"}},e))}convertNamespaceDeclaration(e){const t=e.flags&n.NodeFlags.GlobalAugmentation;if(t||!n.isIdentifier(e.name)){const t=this.createDeclaration(e);t.convertNamespace(e,true);return}const r=this.createDeclaration(e,e.name);r.pushIdentifierReference(e.name);r.convertNamespace(e)}convertEnumDeclaration(e){const t=this.createDeclaration(e,e.name);t.pushIdentifierReference(e.name)}convertFunctionDeclaration(e){if(!e.name){throw new UnsupportedSyntaxError(e,`FunctionDeclaration should have a name`)}const t=this.createDeclaration(e,e.name);t.pushIdentifierReference(e.name);t.convertParametersAndType(e)}convertClassOrInterfaceDeclaration(e){if(!e.name){throw new UnsupportedSyntaxError(e,`ClassDeclaration / InterfaceDeclaration should have a name`)}const t=this.createDeclaration(e,e.name);const r=t.convertTypeParameters(e.typeParameters);t.convertHeritageClauses(e);t.convertMembers(e.members);t.popScope(r)}convertTypeAliasDeclaration(e){const t=this.createDeclaration(e,e.name);const r=t.convertTypeParameters(e.typeParameters);t.convertTypeNode(e.type);t.popScope(r)}convertVariableStatement(e){const{declarations:t}=e.declarationList;if(t.length!==1){throw new UnsupportedSyntaxError(e,`VariableStatement with more than one declaration not yet supported`)}for(const r of t){if(!n.isIdentifier(r.name)){throw new UnsupportedSyntaxError(e,`VariableDeclaration must have a name`)}const t=this.createDeclaration(e,r.name);t.convertTypeNode(r.type)}}convertExportDeclaration(e){if(n.isExportAssignment(e)){this.pushStatement(withStartEnd({type:"ExportDefaultDeclaration",declaration:convertExpression(e.expression)},e));return}const t=e.moduleSpecifier?convertExpression(e.moduleSpecifier):undefined;if(!e.exportClause){this.pushStatement(withStartEnd({type:"ExportAllDeclaration",source:t,exported:null},e))}else if(n.isNamespaceExport(e.exportClause)){this.pushStatement(withStartEnd({type:"ExportAllDeclaration",source:t,exported:createIdentifier(e.exportClause.name)},e))}else{const r=[];for(const t of e.exportClause.elements){r.push(this.convertExportSpecifier(t))}this.pushStatement(withStartEnd({type:"ExportNamedDeclaration",declaration:null,specifiers:r,source:t},e))}}convertImportDeclaration(e){if(n.isImportEqualsDeclaration(e)){if(!n.isExternalModuleReference(e.moduleReference)){throw new UnsupportedSyntaxError(e,"ImportEquals should have a literal source.")}this.pushStatement(withStartEnd({type:"ImportDeclaration",specifiers:[{type:"ImportDefaultSpecifier",local:createIdentifier(e.name)}],source:convertExpression(e.moduleReference.expression)},e));return}const t=convertExpression(e.moduleSpecifier);const r=e.importClause&&e.importClause.namedBindings?this.convertNamedImportBindings(e.importClause.namedBindings):[];if(e.importClause&&e.importClause.name){r.push({type:"ImportDefaultSpecifier",local:createIdentifier(e.importClause.name)})}this.pushStatement(withStartEnd({type:"ImportDeclaration",specifiers:r,source:t},e))}convertNamedImportBindings(e){if(n.isNamedImports(e)){return e.elements.map((e=>{const t=createIdentifier(e.name);const r=e.propertyName?createIdentifier(e.propertyName):t;return{type:"ImportSpecifier",local:t,imported:r}}))}return[{type:"ImportNamespaceSpecifier",local:createIdentifier(e.name)}]}convertExportSpecifier(e){const t=createIdentifier(e.name);return{type:"ExportSpecifier",exported:t,local:e.propertyName?createIdentifier(e.propertyName):t}}}function parse(e,t){return n.createSourceFile(e,t,n.ScriptTarget.Latest,true)}const transform=()=>{const e=new Map;const t=new Map;return{name:"dts-transform",options(e){const{onwarn:t}=e;return{...e,onwarn(e,r){if(e.code!="CIRCULAR_DEPENDENCY"){if(t){t(e,r)}else{r(e)}}},treeshake:{moduleSideEffects:"no-external",propertyReadSideEffects:true,unknownGlobalSideEffects:false}}},outputOptions(e){return{...e,chunkFileNames:e.chunkFileNames||"[name]-[hash].d.ts",entryFileNames:e.entryFileNames||"[name].d.ts",format:"es",exports:"named",compact:false,freeze:true,interop:"esModule",generatedCode:Object.assign({symbols:false},e.generatedCode),strict:false}},transform(r,n){let i=parse(n,r);const s=preProcess({sourceFile:i});e.set(i.fileName,s.typeReferences);t.set(i.fileName,s.fileReferences);r=s.code.toString();i=parse(n,r);const o=convert({sourceFile:i});if(process.env.DTS_DUMP_AST){console.log(n);console.log(r);console.log(JSON.stringify(o.ast.body,undefined,2))}return{code:r,ast:o.ast,map:s.code.generateMap()}},renderChunk(r,n,i){const s=parse(n.fileName,r);const a=new NamespaceFixer(s);const c=new Set;const l=new Set;for(const r of Object.keys(n.modules)){for(const t of e.get(r.split("\\").join("/"))||[]){c.add(t)}for(const e of t.get(r.split("\\").join("/"))||[]){if(e.startsWith(".")){const t=o.join(o.dirname(r),e);const s=i.file&&o.dirname(i.file)||n.facadeModuleId&&o.dirname(n.facadeModuleId)||".";let a=o.relative(s,t).split("\\").join("/");if(a[0]!=="."){a="./"+a}l.add(a)}else{l.add(e)}}}r=writeBlock(Array.from(l,(e=>`/// <reference path="${e}" />`)));r+=writeBlock(Array.from(c,(e=>`/// <reference types="${e}" />`)));r+=a.fix();if(!r){r+="\nexport { }"}return{code:r,map:{mappings:""}}}}};function writeBlock(e){if(e.length){return e.join("\n")+"\n"}return""}const h=/\.([cm]ts|[tj]sx?)$/;const plugin=(e={})=>{const t=transform();const{respectExternal:r=false,compilerOptions:i={},tsconfig:s}=e;let l=[];function getModule(e){let t;let r;if(!l.length&&e.endsWith(a)){t=true}else{r=l.find((r=>t=r.getSourceFile(e)));if(!r&&n.sys.fileExists(e)){l.push(r=createProgram$1(e,i,s));t=r.getSourceFile(e)}}return{source:t,program:r}}return{name:"dts",options(e){let{input:r=[]}=e;if(!Array.isArray(r)){r=typeof r==="string"?[r]:Object.values(r)}else if(r.length>1){e.input={};for(const t of r){let r=t.replace(/((\.d)?\.(t|j)sx?)$/,"");if(o.isAbsolute(t)){r=o.basename(r)}else{r=o.normalize(r)}e.input[r]=t}}l=createPrograms(Object.values(r),i,s);return t.options.call(this,e)},outputOptions:t.outputOptions,transform(e,r){const transformFile=(r,n)=>{if(typeof r==="object"){e=r.getFullText()}return t.transform.call(this,e,n)};if(!h.test(r)){return null}if(r.endsWith(a)){const{source:e}=getModule(r);return e?transformFile(e,r):null}const i=r.replace(h,a);let s=getModule(i);if(s.source){return transformFile(s.source,i)}s=getModule(r);if(typeof s.source!="object"||!s.program){return null}let o;const{emitSkipped:l,diagnostics:u}=s.program.emit(s.source,((t,r)=>{e=r;o=transformFile(true,i)}),undefined,true);if(l){const e=u.filter((e=>e.category===n.DiagnosticCategory.Error));if(e.length){console.error(n.formatDiagnostics(e,c));this.error("Failed to compile. Check the logs above.")}}return o},resolveId(e,t){if(!t){return}t=t.split("\\").join("/");let a=i;if(s){const r=e.startsWith(".")?o.resolve(o.dirname(t),e):e;a=getCompilerOptions(r,i,s).compilerOptions}const{resolvedModule:c}=n.nodeModuleNameResolver(e,t,a,n.sys);if(!c){return}if(!r&&c.isExternalLibraryImport){return{id:e,external:true}}else{return{id:o.resolve(c.resolvedFileName)}}},renderChunk:t.renderChunk}};e["default"]=plugin})();module.exports=r})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"rollup-plugin-dts","author":"Arpad Borsos <arpad.borsos@googlemail.com>","version":"
|
|
1
|
+
{"name":"rollup-plugin-dts","author":"Arpad Borsos <arpad.borsos@googlemail.com>","version":"5.1.1","funding":{"url":"https://github.com/sponsors/Swatinem"},"license":"LGPL-3.0","types":"./dist/rollup-plugin-dts.d.ts"}
|
package/dist/builder/build.js
CHANGED
|
@@ -165,9 +165,9 @@ const buildLib = (config, api, options) => __async(void 0, null, function* () {
|
|
|
165
165
|
const assetOutDir = asset.path ? slash(asset.path) : asset.path;
|
|
166
166
|
const { less, sass, postcss, inject, modules, autoModules } = style;
|
|
167
167
|
const { es5Plugin, umdPlugin, transformPlugin } = yield Promise.resolve().then(() => __toESM(require("@modern-js/libuild-plugin-swc")));
|
|
168
|
-
const plugins =
|
|
169
|
-
if (
|
|
170
|
-
plugins.push(
|
|
168
|
+
const plugins = format === "umd" ? [umdPlugin(umdModuleName)] : [];
|
|
169
|
+
if (target === "es5") {
|
|
170
|
+
plugins.push(es5Plugin());
|
|
171
171
|
}
|
|
172
172
|
const { getProjectTsconfig } = yield Promise.resolve().then(() => __toESM(require("./dts/tsc")));
|
|
173
173
|
const tsconfigPath = dts ? dts.tsconfigPath : (0, import_path.join)(appDirectory, "./tsconfig.json");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"mappings":"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","names":["options"],"sources":["../../src/builder/build.ts"],"sourcesContent":["import { join } from 'path';\nimport type { CLIConfig } from '@modern-js/libuild';\nimport type {\n BuildCommandOptions,\n BaseBuildConfig,\n ModuleTools,\n PluginAPI,\n DTSOptions,\n ModuleContext,\n} from '../types';\n\nexport const runBuildTask = async (\n options: {\n buildConfig: BaseBuildConfig;\n buildCmdOptions: BuildCommandOptions;\n context: ModuleContext;\n },\n api: PluginAPI<ModuleTools>,\n) => {\n const { buildConfig, context } = options;\n const { appDirectory, isTsProject } = context;\n\n if (isTsProject) {\n await buildInTsProject(options, api);\n } else {\n await buildInJsProject(options, api);\n }\n\n const { copyTask } = await import('./copy');\n await copyTask(buildConfig, { appDirectory });\n};\n\nexport const buildInTsProject = async (\n options: {\n buildConfig: BaseBuildConfig;\n buildCmdOptions: BuildCommandOptions;\n context: ModuleContext;\n },\n api: PluginAPI<ModuleTools>,\n) => {\n const { buildConfig, buildCmdOptions } = options;\n const dts = buildCmdOptions.dts ? buildConfig.dts : false;\n const skipBuildLib = buildConfig.dts ? buildConfig.dts.only : false;\n const watch = buildCmdOptions.watch ?? false;\n\n if (dts === false) {\n // --no-dts and buildConfig is `{ dts: { only: true } }`, then skip.\n !skipBuildLib && (await buildLib(buildConfig, api, { watch }));\n } else {\n const tasks = dts.only ? [generatorDts] : [buildLib, generatorDts];\n const { default: pMap } = await import('../../compiled/p-map');\n await pMap(tasks, async task => {\n await task(buildConfig, api as any, { watch, dts });\n });\n }\n};\n\nexport const buildInJsProject = async (\n options: {\n buildConfig: BaseBuildConfig;\n buildCmdOptions: BuildCommandOptions;\n context: ModuleContext;\n },\n api: PluginAPI<ModuleTools>,\n) => {\n const { buildConfig, buildCmdOptions } = options;\n const dts = buildCmdOptions.dts ? buildConfig.dts : false;\n const watch = buildCmdOptions.watch ?? false;\n\n if (dts !== false && dts.only) {\n return;\n }\n\n await buildLib(buildConfig, api, { watch });\n};\n\nexport const generatorDts = async (\n config: BaseBuildConfig,\n api: PluginAPI<ModuleTools>,\n options: {\n watch: boolean;\n dts: DTSOptions;\n },\n) => {\n const { runRollup, runTsc } = await import('./dts');\n const { watch, dts } = options;\n const { buildType, input, sourceDir, alias } = config;\n const { appDirectory } = api.useAppContext();\n const { tsconfigPath, distPath } = dts;\n if (buildType === 'bundle') {\n const { getFinalExternals } = await import('../utils/builder');\n const finalExternals = await getFinalExternals(config, { appDirectory });\n\n await runRollup(api, {\n distDir: distPath,\n watch,\n externals: finalExternals,\n input,\n tsconfigPath,\n });\n } else {\n await runTsc(api, {\n appDirectory,\n alias,\n distAbsPath: distPath,\n watch,\n tsconfigPath,\n sourceDir,\n });\n }\n};\n\nexport const buildLib = async (\n config: BaseBuildConfig,\n api: PluginAPI<ModuleTools>,\n options: {\n watch: boolean;\n },\n) => {\n const { watch } = options;\n const {\n target,\n buildType,\n sourceMap,\n format,\n outDir: distPath,\n asset,\n jsx,\n input,\n platform,\n splitting,\n minify,\n sourceDir,\n umdGlobals,\n umdModuleName,\n define,\n alias,\n style,\n externals,\n autoExternal,\n dts,\n metafile,\n } = config;\n const { appDirectory } = api.useAppContext();\n const { slash } = await import('@modern-js/utils');\n const root = slash(appDirectory);\n const outdir = slash(distPath);\n const assetOutDir = asset.path ? slash(asset.path) : asset.path;\n const { less, sass, postcss, inject, modules, autoModules } = style;\n\n // support es5,umd and emitDecoratorMetadata by swc\n const { es5Plugin, umdPlugin, transformPlugin } = await import(\n '@modern-js/libuild-plugin-swc'\n );\n const plugins = target === 'es5' ? [es5Plugin()] : [];\n if (format === 'umd') {\n plugins.push(umdPlugin(umdModuleName));\n }\n const { getProjectTsconfig } = await import('./dts/tsc');\n const tsconfigPath = dts\n ? dts.tsconfigPath\n : join(appDirectory, './tsconfig.json');\n const userTsconfig = await getProjectTsconfig(tsconfigPath);\n if (userTsconfig?.compilerOptions?.emitDecoratorMetadata) {\n plugins.push(\n transformPlugin({\n jsc: {\n transform: {\n legacyDecorator: true,\n decoratorMetadata: true,\n },\n },\n }),\n );\n }\n\n // support svgr\n if (asset.svgr) {\n const { svgrPlugin } = await import('@modern-js/libuild-plugin-svgr');\n const options = typeof asset.svgr === 'boolean' ? {} : asset.svgr;\n plugins.push(svgrPlugin(options));\n }\n\n // adapt module tools\n const { watchPlugin, externalPlugin } = await import(\n '../utils/libuild-plugins'\n );\n plugins.push(watchPlugin(api, config));\n plugins.push(externalPlugin(config, { appDirectory }));\n\n const buildConfig: CLIConfig = {\n root,\n watch,\n target,\n sourceMap,\n format,\n outdir,\n define,\n style: {\n less,\n sass,\n postcss,\n inject,\n modules,\n autoModules,\n },\n resolve: {\n alias,\n },\n asset: {\n ...asset,\n outdir: assetOutDir,\n },\n plugins,\n jsx,\n input,\n platform,\n splitting,\n minify,\n sourceDir,\n metafile: metafile && buildType === 'bundle',\n globals: umdGlobals,\n external: externals,\n autoExternal,\n bundle: buildType === 'bundle',\n // outbase for [dir]/[name]\n outbase: sourceDir,\n logLevel: 'error',\n esbuildOptions: (options: any) => ({\n ...options,\n supported: {\n 'dynamic-import': !(\n ['cjs', 'umd'].includes(format) && buildType === 'bundleless'\n ),\n },\n }),\n };\n\n try {\n const { Libuilder } = await import('@modern-js/libuild');\n\n const runner = api.useHookRunners();\n const modifiedBuildConfig = await runner.modifyLibuild(buildConfig, {\n onLast: c => c,\n });\n\n const builder = await Libuilder.create(modifiedBuildConfig);\n await builder.build();\n\n if (watch) {\n const { watchSectionTitle } = await import('../utils/log');\n const { SectionTitleStatus } = await import('../constants/log');\n const titleText = `[${\n buildType === 'bundle' ? 'Bundle' : 'Bundleless'\n }: ${format}_${target}]`;\n\n console.info(\n await watchSectionTitle(titleText, SectionTitleStatus.Success),\n );\n }\n } catch (e: any) {\n const { InternalBuildError } = await import('../error');\n throw new InternalBuildError(e, {\n target,\n format,\n buildType,\n });\n }\n};\n"]}
|
|
1
|
+
{"version":3,"file":null,"mappings":"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","names":["options"],"sources":["../../src/builder/build.ts"],"sourcesContent":["import { join } from 'path';\nimport type { CLIConfig } from '@modern-js/libuild';\nimport type {\n BuildCommandOptions,\n BaseBuildConfig,\n ModuleTools,\n PluginAPI,\n DTSOptions,\n ModuleContext,\n} from '../types';\n\nexport const runBuildTask = async (\n options: {\n buildConfig: BaseBuildConfig;\n buildCmdOptions: BuildCommandOptions;\n context: ModuleContext;\n },\n api: PluginAPI<ModuleTools>,\n) => {\n const { buildConfig, context } = options;\n const { appDirectory, isTsProject } = context;\n\n if (isTsProject) {\n await buildInTsProject(options, api);\n } else {\n await buildInJsProject(options, api);\n }\n\n const { copyTask } = await import('./copy');\n await copyTask(buildConfig, { appDirectory });\n};\n\nexport const buildInTsProject = async (\n options: {\n buildConfig: BaseBuildConfig;\n buildCmdOptions: BuildCommandOptions;\n context: ModuleContext;\n },\n api: PluginAPI<ModuleTools>,\n) => {\n const { buildConfig, buildCmdOptions } = options;\n const dts = buildCmdOptions.dts ? buildConfig.dts : false;\n const skipBuildLib = buildConfig.dts ? buildConfig.dts.only : false;\n const watch = buildCmdOptions.watch ?? false;\n\n if (dts === false) {\n // --no-dts and buildConfig is `{ dts: { only: true } }`, then skip.\n !skipBuildLib && (await buildLib(buildConfig, api, { watch }));\n } else {\n const tasks = dts.only ? [generatorDts] : [buildLib, generatorDts];\n const { default: pMap } = await import('../../compiled/p-map');\n await pMap(tasks, async task => {\n await task(buildConfig, api as any, { watch, dts });\n });\n }\n};\n\nexport const buildInJsProject = async (\n options: {\n buildConfig: BaseBuildConfig;\n buildCmdOptions: BuildCommandOptions;\n context: ModuleContext;\n },\n api: PluginAPI<ModuleTools>,\n) => {\n const { buildConfig, buildCmdOptions } = options;\n const dts = buildCmdOptions.dts ? buildConfig.dts : false;\n const watch = buildCmdOptions.watch ?? false;\n\n if (dts !== false && dts.only) {\n return;\n }\n\n await buildLib(buildConfig, api, { watch });\n};\n\nexport const generatorDts = async (\n config: BaseBuildConfig,\n api: PluginAPI<ModuleTools>,\n options: {\n watch: boolean;\n dts: DTSOptions;\n },\n) => {\n const { runRollup, runTsc } = await import('./dts');\n const { watch, dts } = options;\n const { buildType, input, sourceDir, alias } = config;\n const { appDirectory } = api.useAppContext();\n const { tsconfigPath, distPath } = dts;\n if (buildType === 'bundle') {\n const { getFinalExternals } = await import('../utils/builder');\n const finalExternals = await getFinalExternals(config, { appDirectory });\n\n await runRollup(api, {\n distDir: distPath,\n watch,\n externals: finalExternals,\n input,\n tsconfigPath,\n });\n } else {\n await runTsc(api, {\n appDirectory,\n alias,\n distAbsPath: distPath,\n watch,\n tsconfigPath,\n sourceDir,\n });\n }\n};\n\nexport const buildLib = async (\n config: BaseBuildConfig,\n api: PluginAPI<ModuleTools>,\n options: {\n watch: boolean;\n },\n) => {\n const { watch } = options;\n const {\n target,\n buildType,\n sourceMap,\n format,\n outDir: distPath,\n asset,\n jsx,\n input,\n platform,\n splitting,\n minify,\n sourceDir,\n umdGlobals,\n umdModuleName,\n define,\n alias,\n style,\n externals,\n autoExternal,\n dts,\n metafile,\n } = config;\n const { appDirectory } = api.useAppContext();\n const { slash } = await import('@modern-js/utils');\n const root = slash(appDirectory);\n const outdir = slash(distPath);\n const assetOutDir = asset.path ? slash(asset.path) : asset.path;\n const { less, sass, postcss, inject, modules, autoModules } = style;\n\n // support es5,umd and emitDecoratorMetadata by swc\n const { es5Plugin, umdPlugin, transformPlugin } = await import(\n '@modern-js/libuild-plugin-swc'\n );\n const plugins = format === 'umd' ? [umdPlugin(umdModuleName)] : [];\n if (target === 'es5') {\n plugins.push(es5Plugin());\n }\n const { getProjectTsconfig } = await import('./dts/tsc');\n const tsconfigPath = dts\n ? dts.tsconfigPath\n : join(appDirectory, './tsconfig.json');\n const userTsconfig = await getProjectTsconfig(tsconfigPath);\n if (userTsconfig?.compilerOptions?.emitDecoratorMetadata) {\n plugins.push(\n transformPlugin({\n jsc: {\n transform: {\n legacyDecorator: true,\n decoratorMetadata: true,\n },\n },\n }),\n );\n }\n\n // support svgr\n if (asset.svgr) {\n const { svgrPlugin } = await import('@modern-js/libuild-plugin-svgr');\n const options = typeof asset.svgr === 'boolean' ? {} : asset.svgr;\n plugins.push(svgrPlugin(options));\n }\n\n // adapt module tools\n const { watchPlugin, externalPlugin } = await import(\n '../utils/libuild-plugins'\n );\n plugins.push(watchPlugin(api, config));\n plugins.push(externalPlugin(config, { appDirectory }));\n\n const buildConfig: CLIConfig = {\n root,\n watch,\n target,\n sourceMap,\n format,\n outdir,\n define,\n style: {\n less,\n sass,\n postcss,\n inject,\n modules,\n autoModules,\n },\n resolve: {\n alias,\n },\n asset: {\n ...asset,\n outdir: assetOutDir,\n },\n plugins,\n jsx,\n input,\n platform,\n splitting,\n minify,\n sourceDir,\n metafile: metafile && buildType === 'bundle',\n globals: umdGlobals,\n external: externals,\n autoExternal,\n bundle: buildType === 'bundle',\n // outbase for [dir]/[name]\n outbase: sourceDir,\n logLevel: 'error',\n esbuildOptions: (options: any) => ({\n ...options,\n supported: {\n 'dynamic-import': !(\n ['cjs', 'umd'].includes(format) && buildType === 'bundleless'\n ),\n },\n }),\n };\n\n try {\n const { Libuilder } = await import('@modern-js/libuild');\n\n const runner = api.useHookRunners();\n const modifiedBuildConfig = await runner.modifyLibuild(buildConfig, {\n onLast: c => c,\n });\n\n const builder = await Libuilder.create(modifiedBuildConfig);\n await builder.build();\n\n if (watch) {\n const { watchSectionTitle } = await import('../utils/log');\n const { SectionTitleStatus } = await import('../constants/log');\n const titleText = `[${\n buildType === 'bundle' ? 'Bundle' : 'Bundleless'\n }: ${format}_${target}]`;\n\n console.info(\n await watchSectionTitle(titleText, SectionTitleStatus.Success),\n );\n }\n } catch (e: any) {\n const { InternalBuildError } = await import('../error');\n throw new InternalBuildError(e, {\n target,\n format,\n buildType,\n });\n }\n};\n"]}
|
|
@@ -68,7 +68,7 @@ const runRollup = (_0, _1) => __async(void 0, [_0, _1], function* (api, { distDi
|
|
|
68
68
|
const ignoreFiles = {
|
|
69
69
|
name: "ignore-files",
|
|
70
70
|
load(id) {
|
|
71
|
-
if (!/\.(js|jsx|ts|tsx|json)$/.test(id)) {
|
|
71
|
+
if (!/\.(js|jsx|ts|tsx|json|cts|mts)$/.test(id)) {
|
|
72
72
|
return "";
|
|
73
73
|
}
|
|
74
74
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAwBV,MAAM,YAAY,CACvB,IACA,OACG,iBAFH,IACA,KACG,WAFH,KACA,EAAE,SAAS,cAAc,WAAW,OAAO,MAAM,GAC9C;AACH,QAAM,cAAsB;AAAA,IAC1B,MAAM;AAAA,IACN,KAAK,IAAI;AACP,UAAI,CAAC,
|
|
1
|
+
{"version":3,"file":null,"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAwBV,MAAM,YAAY,CACvB,IACA,OACG,iBAFH,IACA,KACG,WAFH,KACA,EAAE,SAAS,cAAc,WAAW,OAAO,MAAM,GAC9C;AACH,QAAM,cAAsB;AAAA,IAC1B,MAAM;AAAA,IACN,KAAK,IAAI;AACP,UAAI,CAAC,kCAAkC,KAAK,EAAE,GAAG;AAC/C,eAAO;AAAA,MACT;AACA,aAAO;AAAA,IACT;AAAA,EACF;AACA,QAAM,KAAK,MAAM,6CAAO;AACxB,QAAM,aAAa,GAAG,eAAe,cAAc,GAAG,IAAI,QAAQ;AAClE,QAAM,EAAE,QAAQ,IAAI,GAAG;AAAA,IACrB,WAAW;AAAA,IACX,GAAG;AAAA,IACH;AAAA,EACF;AAEA,QAAM,EAAE,SAAS,WAAW,IAAI,MAAM,6CACpC;AAEF,QAAM,EAAE,SAAS,UAAU,IAAI,MAAM,6CACnC;AAEF,QAAM,UAAU,oBAAK,WAAW,QAAQ,WAAW,GAAG,IAClD,QAAQ,UACR,oBAAK,KAAK,oBAAK,QAAQ,YAAY,GAAG,QAAQ,WAAW,GAAG;AAChE,QAAM,cAA4B;AAAA,IAChC;AAAA,IACA,UAAU;AAAA,IACV,SAAS;AAAA,MACP,WAAW;AAAA,MACX;AAAA,MACA,UAAU;AAAA,QAER,iBAAiB;AAAA,QACjB,iBAAiB;AAAA,UACf,gBAAgB;AAAA,UAChB,cAAc;AAAA,UAGd,kBAAkB;AAAA,WACf,UANY;AAAA,UAQf;AAAA,UAEA,aAAa;AAAA,UAEb,QAAQ;AAAA,UACR,qBAAqB;AAAA,UAErB,eAAe;AAAA,UAEf,SAAS;AAAA,UAET,QAAQ,GAAG,aAAa;AAAA,QAC1B;AAAA,MACF,CAAC;AAAA,IACH,EAAE,OAAO,OAAO;AAAA,EAClB;AACA,QAAM,eAA8B;AAAA,IAClC,KAAK;AAAA,IACL,QAAQ;AAAA,IACR,SAAS;AAAA,EACX;AACA,MAAI,OAAO;AACT,UAAM,EAAE,cAAM,IAAI,MAAM,6CAAO;AAC/B,UAAM,EAAE,kBAAkB,IAAI,MAAM,6CAAO;AAC3C,UAAM,EAAE,oBAAoB,mBAAmB,IAAI,MAAM,6CACvD;AAEF,UAAM,SAAS,IAAI,eAAe;AAClC,UAAM,UAAUA,OAAM,iCACjB,cADiB;AAAA,MAEpB,SAAS,YAAY;AAAA,MACrB,QAAQ;AAAA,IACV,EAAC,EAAE,GAAG,SAAS,CAAM,UAAS;AAC5B,UAAI,MAAM,SAAS,SAAS;AAC1B,gBAAQ;AAAA,UACN,MAAM,kBAAkB,oBAAoB,mBAAmB,GAAG;AAAA,QACpE;AAAA,MACF,WAAW,MAAM,SAAS,cAAc;AACtC,gBAAQ;AAAA,UACN,MAAM;AAAA,YACJ;AAAA,YACA,mBAAmB;AAAA,UACrB;AAAA,QACF;AACA,eAAO,cAAc,EAAE,WAAW,SAAS,CAAC;AAAA,MAC9C,WAAW,MAAM,SAAS,SAAS;AAAA,MAEnC;AAAA,IACF,EAAC;AACD,WAAO;AAAA,EACT,OAAO;AACL,QAAI;AACF,YAAM,EAAE,OAAO,IAAI,MAAM,6CAAO;AAChC,YAAM,SAAS,MAAM,OAAO,WAAW;AACvC,YAAM,OAAO,MAAM,YAAY;AAC/B,aAAO;AAAA,IACT,SAAS,GAAP;AACA,UAAI,aAAa,OAAO;AACtB,cAAM,EAAE,iBAAiB,IAAI,MAAM,6CAAO;AAC1C,cAAM,IAAI,iBAAiB,GAAG;AAAA,UAC5B,WAAW;AAAA,QACb,CAAC;AAAA,MACH;AACA,YAAM;AAAA,IACR;AAAA,EACF;AACF;;;;;","names":["watch"],"sources":["../../../src/builder/dts/rollup.ts"],"sourcesContent":["import path from 'path';\nimport type {\n InputOptions,\n OutputOptions,\n Plugin,\n RollupWatcher,\n} from '../../../compiled/rollup';\nimport type {\n BaseBuildConfig,\n Input,\n PluginAPI,\n ModuleTools,\n} from '../../types';\n\nexport type { RollupWatcher };\n\ntype Config = {\n distDir: string;\n tsconfigPath: string;\n externals: BaseBuildConfig['externals'];\n input: Input;\n watch: boolean;\n};\n\nexport const runRollup = async (\n api: PluginAPI<ModuleTools>,\n { distDir, tsconfigPath, externals, input, watch }: Config,\n) => {\n const ignoreFiles: Plugin = {\n name: 'ignore-files',\n load(id) {\n if (!/\\.(js|jsx|ts|tsx|json|cts|mts)$/.test(id)) {\n return '';\n }\n return null;\n },\n };\n const ts = await import('typescript');\n const configFile = ts.readConfigFile(tsconfigPath, ts.sys.readFile);\n const { options } = ts.parseJsonConfigFileContent(\n configFile.config,\n ts.sys,\n './',\n );\n\n const { default: jsonPlugin } = await import(\n '../../../compiled/@rollup/plugin-json'\n );\n const { default: dtsPlugin } = await import(\n '../../../compiled/rollup-plugin-dts'\n );\n const baseUrl = path.isAbsolute(options.baseUrl || '.')\n ? options.baseUrl\n : path.join(path.dirname(tsconfigPath), options.baseUrl || '.');\n const inputConfig: InputOptions = {\n input,\n external: externals,\n plugins: [\n jsonPlugin(),\n ignoreFiles,\n dtsPlugin({\n // use external to prevent them which come from node_modules from be bundled.\n respectExternal: true,\n compilerOptions: {\n declarationMap: false,\n skipLibCheck: true,\n // https://github.com/Swatinem/rollup-plugin-dts/issues/143,\n // but it will cause error when bundle ts which import another ts file.\n preserveSymlinks: false,\n ...options,\n // isAbsolute\n baseUrl,\n // Ensure \".d.ts\" modules are generated\n declaration: true,\n // Skip \".js\" generation\n noEmit: false,\n emitDeclarationOnly: true,\n // Skip code generation when error occurs\n noEmitOnError: true,\n // Avoid extra work\n checkJs: false,\n // Ensure we can parse the latest code\n target: ts.ScriptTarget.ESNext,\n },\n }),\n ].filter(Boolean),\n };\n const outputConfig: OutputOptions = {\n dir: distDir,\n format: 'esm',\n exports: 'named',\n };\n if (watch) {\n const { watch } = await import('../../../compiled/rollup');\n const { watchSectionTitle } = await import('../../utils/log');\n const { SectionTitleStatus, BundleDtsLogPrefix } = await import(\n '../../constants/log'\n );\n const runner = api.useHookRunners();\n const watcher = watch({\n ...inputConfig,\n plugins: inputConfig.plugins,\n output: outputConfig,\n }).on('event', async event => {\n if (event.code === 'START') {\n console.info(\n await watchSectionTitle(BundleDtsLogPrefix, SectionTitleStatus.Log),\n );\n } else if (event.code === 'BUNDLE_END') {\n console.info(\n await watchSectionTitle(\n BundleDtsLogPrefix,\n SectionTitleStatus.Success,\n ),\n );\n runner.buildWatchDts({ buildType: 'bundle' });\n } else if (event.code === 'ERROR') {\n // this is dts rollup plugin bug, error not complete message\n }\n });\n return watcher;\n } else {\n try {\n const { rollup } = await import('../../../compiled/rollup');\n const bundle = await rollup(inputConfig);\n await bundle.write(outputConfig);\n return bundle;\n } catch (e) {\n if (e instanceof Error) {\n const { InternalDTSError } = await import('../../error');\n throw new InternalDTSError(e, {\n buildType: 'bundle',\n });\n }\n throw e;\n }\n }\n};\n"]}
|
package/dist/command.js
CHANGED
|
@@ -108,20 +108,10 @@ const devCommand = (program, api) => __async(void 0, null, function* () {
|
|
|
108
108
|
}
|
|
109
109
|
for (const subCmd of meta.subCommands) {
|
|
110
110
|
devProgram.command(subCmd).action((options) => __async(void 0, null, function* () {
|
|
111
|
-
var _a, _b;
|
|
112
111
|
const { initModuleContext } = yield Promise.resolve().then(() => __toESM(require("./utils/context")));
|
|
113
112
|
const context = yield initModuleContext(api);
|
|
114
|
-
const { ensureFirstBuild, watchBuild } = yield Promise.resolve().then(() => __toESM(require("./dev")));
|
|
115
|
-
yield ensureFirstBuild(api, context, options, {
|
|
116
|
-
disableRunBuild: (_a = meta.disableRunBuild) != null ? _a : false,
|
|
117
|
-
appDirectory: context.appDirectory
|
|
118
|
-
});
|
|
119
113
|
yield runner.beforeDevTask(meta);
|
|
120
114
|
yield meta.action(options, { isTsProject: context.isTsProject });
|
|
121
|
-
yield watchBuild(api, context, options, {
|
|
122
|
-
disableRunBuild: (_b = meta.disableRunBuild) != null ? _b : false,
|
|
123
|
-
appDirectory: context.appDirectory
|
|
124
|
-
});
|
|
125
115
|
}));
|
|
126
116
|
}
|
|
127
117
|
}
|
package/dist/command.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKO,MAAM,eAAe,CAC1B,SACA,QACG;AACH,QAAM,QAAQ,MAAM,6CAAO;AAC3B,QAAM,EAAE,oBAAoB,IAAI,MAAM,6CAAO;AAE7C,UACG,QAAQ,OAAO,EACf,MAAM,WAAW,EACjB,YAAY,MAAM,KAAK,EAAE,MAAM,WAAW,QAAQ,MAAM,QAAQ,CAAC,EACjE,OAAO,eAAe,MAAM,KAAK,EAAE,MAAM,WAAW,QAAQ,MAAM,KAAK,CAAC,EACxE;AAAA,IACC;AAAA,IACA,MAAM,KAAK,EAAE,MAAM,WAAW,QAAQ,MAAM,QAAQ;AAAA,IACpD;AAAA,EACF,EACC;AAAA,IACC;AAAA,IACA,MAAM,KAAK,EAAE,MAAM,WAAW,QAAQ,MAAM,QAAQ;AAAA,EACtD,EACC,OAAO,YAAY,MAAM,KAAK,EAAE,MAAM,WAAW,QAAQ,MAAM,GAAG,CAAC,EACnE,OAAO,cAAc,MAAM,KAAK,EAAE,MAAM,WAAW,QAAQ,MAAM,QAAQ,CAAC,EAC1E;AAAA,IACC;AAAA,IACA,MAAM,KAAK,EAAE,MAAM,WAAW,QAAQ,MAAM,MAAM;AAAA,EACpD,EACC,OAAO,CAAO,YAAiC;AAC9C,UAAM,EAAE,kBAAkB,IAAI,MAAM,6CAAO;AAC3C,UAAM,UAAU,MAAM,kBAAkB,GAAG;AAC3C,UAAM,EAAE,MAAM,IAAI,MAAM,6CAAO;AAC/B,UAAM,MAAM,KAAK,SAAS,OAAO;AAAA,EACnC,EAAC;AACL;AAEO,MAAM,aAAa,CACxB,SACA,QACG;AACH,QAAM,QAAQ,MAAM,6CAAO;AAC3B,QAAM,EAAE,oBAAoB,IAAI,MAAM,6CAAO;AAC7C,QAAM,SAAS,IAAI,eAAe;AAClC,QAAM,eAAe,MAAM,OAAO,YAAY;AAE9C,QAAM,OAAO,UAAU,YAAY;AAEnC,QAAM,aAAa,QAChB,QAAQ,KAAK,EACb,MAAM,WAAW,EACjB,YAAY,MAAM,KAAK,EAAE,MAAM,WAAW,QAAQ,IAAI,QAAQ,CAAC,EAC/D;AAAA,IACC;AAAA,IACA,MAAM,KAAK,EAAE,MAAM,WAAW,QAAQ,IAAI,QAAQ;AAAA,IAClD;AAAA,EACF,EACC,OAAO,CAAO,YAA+B;AAC5C,UAAM,EAAE,kBAAkB,IAAI,MAAM,6CAAO;AAC3C,UAAM,UAAU,MAAM,kBAAkB,GAAG;AAC3C,UAAM,EAAE,IAAI,IAAI,MAAM,6CAAO;AAC7B,UAAM,IAAI,SAAS,cAAc,KAAK,OAAO;AAAA,EAC/C,EAAC;AAEH,aAAW,QAAQ,cAAc;AAC/B,QAAI,CAAC,KAAK,aAAa;AACrB;AAAA,IACF;AAEA,eAAW,UAAU,KAAK,aAAa;AACrC,iBAAW,QAAQ,MAAM,EAAE,OAAO,CAAO,YAA+B;
|
|
1
|
+
{"version":3,"file":null,"mappings":"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","names":[],"sources":["../src/command.ts"],"sourcesContent":["import type { Command } from '@modern-js/utils';\nimport type { PluginAPI } from '@modern-js/core';\nimport type { ModuleTools } from './types';\nimport type { DevCommandOptions, BuildCommandOptions } from './types/command';\n\nexport const buildCommand = async (\n program: Command,\n api: PluginAPI<ModuleTools>,\n) => {\n const local = await import('./locale');\n const { defaultTsConfigPath } = await import('./constants/dts');\n\n program\n .command('build')\n .usage('[options]')\n .description(local.i18n.t(local.localeKeys.command.build.describe))\n .option('-w, --watch', local.i18n.t(local.localeKeys.command.build.watch))\n .option(\n '--tsconfig [tsconfig]',\n local.i18n.t(local.localeKeys.command.build.tsconfig),\n defaultTsConfigPath,\n )\n .option(\n '-p, --platform [platform...]',\n local.i18n.t(local.localeKeys.command.build.platform),\n )\n .option('--no-dts', local.i18n.t(local.localeKeys.command.build.dts))\n .option('--no-clear', local.i18n.t(local.localeKeys.command.build.no_clear))\n .option(\n '-c --config <config>',\n local.i18n.t(local.localeKeys.command.build.config),\n )\n .action(async (options: BuildCommandOptions) => {\n const { initModuleContext } = await import('./utils/context');\n const context = await initModuleContext(api);\n const { build } = await import('./build');\n await build(api, options, context);\n });\n};\n\nexport const devCommand = async (\n program: Command,\n api: PluginAPI<ModuleTools>,\n) => {\n const local = await import('./locale');\n const { defaultTsConfigPath } = await import('./constants/dts');\n const runner = api.useHookRunners();\n const devToolMetas = await runner.registerDev();\n\n await runner.beforeDev(devToolMetas);\n\n const devProgram = program\n .command('dev')\n .usage('[options]')\n .description(local.i18n.t(local.localeKeys.command.dev.describe))\n .option(\n '--tsconfig [tsconfig]',\n local.i18n.t(local.localeKeys.command.dev.tsconfig),\n defaultTsConfigPath,\n )\n .action(async (options: DevCommandOptions) => {\n const { initModuleContext } = await import('./utils/context');\n const context = await initModuleContext(api);\n const { dev } = await import('./dev');\n await dev(options, devToolMetas, api, context);\n });\n\n for (const meta of devToolMetas) {\n if (!meta.subCommands) {\n continue;\n }\n\n for (const subCmd of meta.subCommands) {\n devProgram.command(subCmd).action(async (options: DevCommandOptions) => {\n const { initModuleContext } = await import('./utils/context');\n const context = await initModuleContext(api);\n\n // TODO: watch build\n // const { ensureFirstBuild, watchBuild } = await import('./dev');\n // await ensureFirstBuild(api, context, options, {\n // disableRunBuild: meta.disableRunBuild ?? false,\n // appDirectory: context.appDirectory,\n // });\n\n await runner.beforeDevTask(meta);\n await meta.action(options, { isTsProject: context.isTsProject });\n // TODO: watch build\n // await watchBuild(api, context, options, {\n // disableRunBuild: meta.disableRunBuild ?? false,\n // appDirectory: context.appDirectory,\n // });\n });\n }\n }\n};\n\nexport const newCommand = async (program: Command) => {\n const local = await import('./locale');\n\n program\n .command('new')\n .usage('[options]')\n .description(local.i18n.t(local.localeKeys.command.new.describe))\n .option(\n '-d, --debug',\n local.i18n.t(local.localeKeys.command.new.debug),\n false,\n )\n .option(\n '-c, --config <config>',\n local.i18n.t(local.localeKeys.command.new.config),\n )\n .option(\n '--dist-tag <tag>',\n local.i18n.t(local.localeKeys.command.new.distTag),\n )\n .option('--lang <lang>', local.i18n.t(local.localeKeys.command.new.lang))\n .option('--registry', local.i18n.t(local.localeKeys.command.new.registry))\n .action(async options => {\n const { ModuleNewAction } = await import('@modern-js/new-action');\n const { getLocaleLanguage } = await import('./utils/language');\n const locale = getLocaleLanguage();\n\n await ModuleNewAction({ ...options, locale: options.lang || locale });\n });\n};\n\nexport const upgradCommand = async (program: Command) => {\n const { defineCommand } = await import('@modern-js/upgrade');\n defineCommand(program.command('upgrade'));\n};\n"]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { UserConfigExport } from '@modern-js/core';
|
|
1
2
|
import type { ModuleConfigParams, ModuleLegacyUserConfig } from '../types';
|
|
2
|
-
export declare const defineConfig: (config: ModuleConfigParams) => ModuleConfigParams
|
|
3
|
+
export declare const defineConfig: (config: UserConfigExport<ModuleConfigParams>) => UserConfigExport<ModuleConfigParams>;
|
|
3
4
|
/**
|
|
4
5
|
* @deprecated
|
|
5
6
|
* Using defineConfig first.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
1
|
+
{"version":3,"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGO,MAAM,eAAe,CAAC,WAC3B;AAMK,MAAM,qBAAqB,CAChC,WAC4B,iCACzB,SADyB;AAAA,EAE5B,QAAQ;AAAA,EACR,iBAAiB;AACnB;","names":[],"sources":["../../src/config/defineConfig.ts"],"sourcesContent":["import type { UserConfigExport } from '@modern-js/core';\nimport type { ModuleConfigParams, ModuleLegacyUserConfig } from '../types';\n\nexport const defineConfig = (config: UserConfigExport<ModuleConfigParams>) =>\n config;\n\n/**\n * @deprecated\n * Using defineConfig first.\n */\nexport const defineLegacyConfig = (\n config: ModuleLegacyUserConfig,\n): ModuleLegacyUserConfig => ({\n ...config,\n legacy: true,\n autoLoadPlugins: true,\n});\n"]}
|
package/dist/constants/colors.js
CHANGED
|
@@ -19,17 +19,17 @@ var colors_exports = {};
|
|
|
19
19
|
__export(colors_exports, {
|
|
20
20
|
blue: () => blue,
|
|
21
21
|
gray: () => gray,
|
|
22
|
-
|
|
22
|
+
green: () => green
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(colors_exports);
|
|
25
|
-
const
|
|
25
|
+
const green = [96, 186, 154];
|
|
26
26
|
const blue = [82, 221, 252];
|
|
27
27
|
const gray = [36, 2, 45];
|
|
28
28
|
// Annotate the CommonJS export names for ESM import in node:
|
|
29
29
|
0 && (module.exports = {
|
|
30
30
|
blue,
|
|
31
31
|
gray,
|
|
32
|
-
|
|
32
|
+
green
|
|
33
33
|
});
|
|
34
34
|
|
|
35
35
|
//# sourceMappingURL=colors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,MAAM,
|
|
1
|
+
{"version":3,"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,MAAM,QAAa,CAAC,IAAI,KAAK,GAAG;AAChC,MAAM,OAAY,CAAC,IAAI,KAAK,GAAG;AAC/B,MAAM,OAAY,CAAC,IAAI,GAAG,EAAE;","names":[],"sources":["../../src/constants/colors.ts"],"sourcesContent":["import type { RGB } from '../types/color';\n\nexport const green: RGB = [96, 186, 154];\nexport const blue: RGB = [82, 221, 252];\nexport const gray: RGB = [36, 2, 45];\n"]}
|
package/dist/dev.d.ts
CHANGED
|
@@ -2,14 +2,5 @@ import type { PluginAPI } from '@modern-js/core';
|
|
|
2
2
|
import type { DevCommandOptions } from './types/command';
|
|
3
3
|
import type { ModuleContext } from './types/context';
|
|
4
4
|
import type { DevToolData, ModuleTools } from './types';
|
|
5
|
-
export declare const ensureFirstBuild: (api: PluginAPI<ModuleTools>, context: ModuleContext, cliOptions: DevCommandOptions, options: {
|
|
6
|
-
watch?: boolean;
|
|
7
|
-
disableRunBuild: boolean;
|
|
8
|
-
appDirectory: string;
|
|
9
|
-
}) => Promise<void>;
|
|
10
|
-
export declare const watchBuild: (api: PluginAPI<ModuleTools>, context: ModuleContext, cliOptions: DevCommandOptions, options: {
|
|
11
|
-
disableRunBuild: boolean;
|
|
12
|
-
appDirectory: string;
|
|
13
|
-
}) => Promise<void>;
|
|
14
5
|
export declare const showMenu: (metas: DevToolData[], devCmdOptions: DevCommandOptions, api: PluginAPI<ModuleTools>, context: ModuleContext) => Promise<void>;
|
|
15
6
|
export declare const dev: (options: DevCommandOptions, metas: DevToolData[], api: PluginAPI<ModuleTools>, context: ModuleContext) => Promise<void>;
|
package/dist/dev.js
CHANGED
|
@@ -1,26 +1,9 @@
|
|
|
1
1
|
var __create = Object.create;
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
|
-
var __defProps = Object.defineProperties;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
9
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
-
var __spreadValues = (a, b) => {
|
|
13
|
-
for (var prop in b || (b = {}))
|
|
14
|
-
if (__hasOwnProp.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
if (__getOwnPropSymbols)
|
|
17
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
-
if (__propIsEnum.call(b, prop))
|
|
19
|
-
__defNormalProp(a, prop, b[prop]);
|
|
20
|
-
}
|
|
21
|
-
return a;
|
|
22
|
-
};
|
|
23
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
7
|
var __export = (target, all) => {
|
|
25
8
|
for (var name in all)
|
|
26
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -61,29 +44,10 @@ var __async = (__this, __arguments, generator) => {
|
|
|
61
44
|
var dev_exports = {};
|
|
62
45
|
__export(dev_exports, {
|
|
63
46
|
dev: () => dev,
|
|
64
|
-
|
|
65
|
-
showMenu: () => showMenu,
|
|
66
|
-
watchBuild: () => watchBuild
|
|
47
|
+
showMenu: () => showMenu
|
|
67
48
|
});
|
|
68
49
|
module.exports = __toCommonJS(dev_exports);
|
|
69
|
-
const ensureFirstBuild = (api, context, cliOptions, options) => __async(void 0, null, function* () {
|
|
70
|
-
var _a;
|
|
71
|
-
if (!options.disableRunBuild) {
|
|
72
|
-
const { build } = yield Promise.resolve().then(() => __toESM(require("./build")));
|
|
73
|
-
const defaultCmdOptions = {
|
|
74
|
-
tsconfig: cliOptions.tsconfig,
|
|
75
|
-
watch: (_a = options.watch) != null ? _a : false,
|
|
76
|
-
dts: true,
|
|
77
|
-
clear: true
|
|
78
|
-
};
|
|
79
|
-
yield build(api, defaultCmdOptions, context);
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
const watchBuild = (api, context, cliOptions, options) => __async(void 0, null, function* () {
|
|
83
|
-
yield ensureFirstBuild(api, context, cliOptions, __spreadProps(__spreadValues({}, options), { watch: true }));
|
|
84
|
-
});
|
|
85
50
|
const showMenu = (metas, devCmdOptions, api, context) => __async(void 0, null, function* () {
|
|
86
|
-
var _a, _b;
|
|
87
51
|
const { chalk, inquirer } = yield Promise.resolve().then(() => __toESM(require("@modern-js/utils")));
|
|
88
52
|
const runner = api.useHookRunners();
|
|
89
53
|
const menuTitle = chalk.rgb(255, 153, 0);
|
|
@@ -103,29 +67,21 @@ const showMenu = (metas, devCmdOptions, api, context) => __async(void 0, null, f
|
|
|
103
67
|
yield runner.afterDevMenu({ result, devTools: metas });
|
|
104
68
|
const currentDevTool = metas.find(
|
|
105
69
|
(meta) => {
|
|
106
|
-
var
|
|
107
|
-
return ((
|
|
70
|
+
var _a;
|
|
71
|
+
return ((_a = meta.menuItem) == null ? void 0 : _a.value) === result.choiceDevTool;
|
|
108
72
|
}
|
|
109
73
|
);
|
|
110
74
|
if (currentDevTool) {
|
|
111
|
-
yield ensureFirstBuild(api, context, devCmdOptions, {
|
|
112
|
-
disableRunBuild: (_a = currentDevTool.disableRunBuild) != null ? _a : false,
|
|
113
|
-
appDirectory: context.appDirectory
|
|
114
|
-
});
|
|
115
75
|
yield runner.beforeDevTask(currentDevTool);
|
|
116
76
|
yield currentDevTool.action(devCmdOptions, {
|
|
117
77
|
isTsProject: context.isTsProject
|
|
118
78
|
});
|
|
119
|
-
yield watchBuild(api, context, devCmdOptions, {
|
|
120
|
-
disableRunBuild: (_b = currentDevTool.disableRunBuild) != null ? _b : false,
|
|
121
|
-
appDirectory: context.appDirectory
|
|
122
|
-
});
|
|
123
79
|
}
|
|
124
80
|
});
|
|
125
81
|
const dev = (options, metas, api, context) => __async(void 0, null, function* () {
|
|
126
|
-
var _a, _b
|
|
82
|
+
var _a, _b;
|
|
127
83
|
const { chalk } = yield Promise.resolve().then(() => __toESM(require("@modern-js/utils")));
|
|
128
|
-
const {
|
|
84
|
+
const { green } = yield Promise.resolve().then(() => __toESM(require("./constants/colors")));
|
|
129
85
|
if (metas.length === 0) {
|
|
130
86
|
console.info("No dev tools found available");
|
|
131
87
|
process.exit(0);
|
|
@@ -133,21 +89,13 @@ const dev = (options, metas, api, context) => __async(void 0, null, function* ()
|
|
|
133
89
|
const runner = api.useHookRunners();
|
|
134
90
|
if (metas.length === 1) {
|
|
135
91
|
console.info(
|
|
136
|
-
chalk.rgb(...
|
|
92
|
+
chalk.rgb(...green)(
|
|
137
93
|
`Only one dev tooling is currently detected as available, run it directly [${(_b = (_a = metas[0].menuItem) == null ? void 0 : _a.name) != null ? _b : metas[0].name}]`
|
|
138
94
|
)
|
|
139
95
|
);
|
|
140
96
|
const meta = metas[0];
|
|
141
|
-
yield ensureFirstBuild(api, context, options, {
|
|
142
|
-
disableRunBuild: (_c = meta.disableRunBuild) != null ? _c : false,
|
|
143
|
-
appDirectory: context.appDirectory
|
|
144
|
-
});
|
|
145
97
|
yield runner.beforeDevTask(meta);
|
|
146
98
|
yield meta.action(options, { isTsProject: context.isTsProject });
|
|
147
|
-
yield watchBuild(api, context, options, {
|
|
148
|
-
disableRunBuild: (_d = meta.disableRunBuild) != null ? _d : false,
|
|
149
|
-
appDirectory: context.appDirectory
|
|
150
|
-
});
|
|
151
99
|
} else if (metas.length > 1) {
|
|
152
100
|
yield showMenu(metas, options, api, context);
|
|
153
101
|
}
|
|
@@ -155,9 +103,7 @@ const dev = (options, metas, api, context) => __async(void 0, null, function* ()
|
|
|
155
103
|
// Annotate the CommonJS export names for ESM import in node:
|
|
156
104
|
0 && (module.exports = {
|
|
157
105
|
dev,
|
|
158
|
-
|
|
159
|
-
showMenu,
|
|
160
|
-
watchBuild
|
|
106
|
+
showMenu
|
|
161
107
|
});
|
|
162
108
|
|
|
163
109
|
//# sourceMappingURL=dev.js.map
|
package/dist/dev.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"mappings":"
|
|
1
|
+
{"version":3,"file":null,"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAwCO,MAAM,WAAW,CACtB,OACA,eACA,KACA,YACG;AACH,QAAM,EAAE,OAAO,SAAS,IAAI,MAAM,6CAAO;AACzC,QAAM,SAAS,IAAI,eAAe;AAElC,QAAM,YAAY,MAAM,IAAI,KAAK,KAAK,CAAC;AACvC,QAAM,UAAU,MACb,IAAI,UAAQ,KAAK,QAAQ,EACzB,OAAO,cAAY,OAAO,aAAa,QAAQ;AAClD,QAAM,YAAY;AAAA,IAChB;AAAA,MACE,MAAM;AAAA,MACN,SAAS,UAAU,QAAQ;AAAA,MAC3B,MAAM;AAAA,MACN;AAAA,IACF;AAAA,EACF;AAEA,QAAM,eAAe,MAAM,OAAO,cAAc,SAAS;AACzD,QAAM,SAAoC,MAAM,SAAS;AAAA,IACvD,aAAa,WAAW,IAAI,eAAe;AAAA,EAC7C;AACA,QAAM,OAAO,aAAa,EAAE,QAAQ,UAAU,MAAM,CAAC;AAErD,QAAM,iBAAiB,MAAM;AAAA,IAC3B,UAAK;AArET;AAqEY,yBAAK,aAAL,mBAAe,WAAU,OAAO;AAAA;AAAA,EAC1C;AACA,MAAI,gBAAgB;AAOlB,UAAM,OAAO,cAAc,cAAc;AACzC,UAAM,eAAe,OAAO,eAAe;AAAA,MACzC,aAAa,QAAQ;AAAA,IACvB,CAAC;AAAA,EAOH;AACF;AAEO,MAAM,MAAM,CACjB,SACA,OACA,KACA,YACG;AAhGL;AAiGE,QAAM,EAAE,MAAM,IAAI,MAAM,6CAAO;AAC/B,QAAM,EAAE,MAAM,IAAI,MAAM,6CAAO;AAC/B,MAAI,MAAM,WAAW,GAAG;AACtB,YAAQ,KAAK,8BAA8B;AAE3C,YAAQ,KAAK,CAAC;AAAA,EAChB;AAEA,QAAM,SAAS,IAAI,eAAe;AAClC,MAAI,MAAM,WAAW,GAAG;AACtB,YAAQ;AAAA,MACN,MAAM,IAAI,GAAG,KAAK;AAAA,QAChB,8EACE,iBAAM,GAAG,aAAT,mBAAmB,SAAnB,YAA2B,MAAM,GAAG;AAAA,MAExC;AAAA,IACF;AACA,UAAM,OAAO,MAAM;AAQnB,UAAM,OAAO,cAAc,IAAI;AAC/B,UAAM,KAAK,OAAO,SAAS,EAAE,aAAa,QAAQ,YAAY,CAAC;AAAA,EAMjE,WAAW,MAAM,SAAS,GAAG;AAC3B,UAAM,SAAS,OAAO,SAAS,KAAK,OAAO;AAAA,EAC7C;AACF;;;;;;","names":[],"sources":["../src/dev.ts"],"sourcesContent":["import type { PluginAPI } from '@modern-js/core';\nimport type { DevCommandOptions } from './types/command';\nimport type { ModuleContext } from './types/context';\nimport type { DevToolData, ModuleTools } from './types';\n\n// TODO: watch build\n// export const ensureFirstBuild = async (\n// api: PluginAPI<ModuleTools>,\n// context: ModuleContext,\n// cliOptions: DevCommandOptions,\n// options: {\n// watch?: boolean;\n// disableRunBuild: boolean;\n// appDirectory: string;\n// },\n// ) => {\n// if (!options.disableRunBuild) {\n// const { build } = await import('./build');\n// const defaultCmdOptions: BuildCommandOptions = {\n// tsconfig: cliOptions.tsconfig,\n// watch: options.watch ?? false,\n// dts: true,\n// clear: true,\n// };\n// await build(api, defaultCmdOptions, context);\n// }\n// };\n\n// export const watchBuild = async (\n// api: PluginAPI<ModuleTools>,\n// context: ModuleContext,\n// cliOptions: DevCommandOptions,\n// options: {\n// disableRunBuild: boolean;\n// appDirectory: string;\n// },\n// ) => {\n// await ensureFirstBuild(api, context, cliOptions, { ...options, watch: true });\n// };\n\nexport const showMenu = async (\n metas: DevToolData[],\n devCmdOptions: DevCommandOptions,\n api: PluginAPI<ModuleTools>,\n context: ModuleContext,\n) => {\n const { chalk, inquirer } = await import('@modern-js/utils');\n const runner = api.useHookRunners();\n\n const menuTitle = chalk.rgb(255, 153, 0);\n const choices = metas\n .map(meta => meta.menuItem)\n .filter(menuItem => typeof menuItem === 'object');\n const questions = [\n {\n name: 'choiceDevTool',\n message: menuTitle('选择调试工具'),\n type: 'list',\n choices,\n },\n ];\n\n const newQuestions = await runner.beforeDevMenu(questions);\n const result: { choiceDevTool: string } = await inquirer.prompt(\n newQuestions.length !== 0 ? newQuestions : questions,\n );\n await runner.afterDevMenu({ result, devTools: metas });\n\n const currentDevTool = metas.find(\n meta => meta.menuItem?.value === result.choiceDevTool,\n );\n if (currentDevTool) {\n // TODO: watch build\n // await ensureFirstBuild(api, context, devCmdOptions, {\n // disableRunBuild: currentDevTool.disableRunBuild ?? false,\n // appDirectory: context.appDirectory,\n // });\n\n await runner.beforeDevTask(currentDevTool);\n await currentDevTool.action(devCmdOptions, {\n isTsProject: context.isTsProject,\n });\n\n // TODO: watch build\n // await watchBuild(api, context, devCmdOptions, {\n // disableRunBuild: currentDevTool.disableRunBuild ?? false,\n // appDirectory: context.appDirectory,\n // });\n }\n};\n\nexport const dev = async (\n options: DevCommandOptions,\n metas: DevToolData[],\n api: PluginAPI<ModuleTools>,\n context: ModuleContext,\n) => {\n const { chalk } = await import('@modern-js/utils');\n const { green } = await import('./constants/colors');\n if (metas.length === 0) {\n console.info('No dev tools found available');\n // eslint-disable-next-line no-process-exit\n process.exit(0);\n }\n\n const runner = api.useHookRunners();\n if (metas.length === 1) {\n console.info(\n chalk.rgb(...green)(\n `Only one dev tooling is currently detected as available, run it directly [${\n metas[0].menuItem?.name ?? metas[0].name\n }]`,\n ),\n );\n const meta = metas[0];\n\n // TODO: watch build\n // await ensureFirstBuild(api, context, options, {\n // disableRunBuild: meta.disableRunBuild ?? false,\n // appDirectory: context.appDirectory,\n // });\n\n await runner.beforeDevTask(meta);\n await meta.action(options, { isTsProject: context.isTsProject });\n // TODO: watch build\n // await watchBuild(api, context, options, {\n // disableRunBuild: meta.disableRunBuild ?? false,\n // appDirectory: context.appDirectory,\n // });\n } else if (metas.length > 1) {\n await showMenu(metas, options, api, context);\n }\n};\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@modern-js/module-tools",
|
|
3
|
-
"description": "
|
|
3
|
+
"description": "A Progressive React Framework for modern web development.",
|
|
4
4
|
"homepage": "https://modernjs.dev",
|
|
5
5
|
"bugs": "https://github.com/modern-js-dev/modern.js/issues",
|
|
6
6
|
"repository": "modern-js-dev/modern.js",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"module-tools",
|
|
12
12
|
"lib-tools"
|
|
13
13
|
],
|
|
14
|
-
"version": "2.
|
|
14
|
+
"version": "2.4.0",
|
|
15
15
|
"bin": {
|
|
16
16
|
"modern": "./bin/modern.js",
|
|
17
17
|
"modern-module": "./bin/modern.js"
|
|
@@ -36,20 +36,19 @@
|
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@modern-js/libuild": "~0.
|
|
40
|
-
"@modern-js/libuild-plugin-svgr": "~0.
|
|
41
|
-
"@modern-js/libuild-plugin-swc": "~0.
|
|
42
|
-
"@modern-js/core": "2.
|
|
43
|
-
"@modern-js/
|
|
44
|
-
"@modern-js/plugin": "2.
|
|
45
|
-
"@modern-js/plugin-
|
|
46
|
-
"@modern-js/upgrade": "2.
|
|
47
|
-
"@modern-js/utils": "2.
|
|
48
|
-
"@modern-js/plugin-
|
|
49
|
-
"@modern-js/
|
|
39
|
+
"@modern-js/libuild": "~0.9.0",
|
|
40
|
+
"@modern-js/libuild-plugin-svgr": "~0.9.0",
|
|
41
|
+
"@modern-js/libuild-plugin-swc": "~0.9.0",
|
|
42
|
+
"@modern-js/core": "2.4.0",
|
|
43
|
+
"@modern-js/new-action": "2.4.0",
|
|
44
|
+
"@modern-js/plugin": "2.4.0",
|
|
45
|
+
"@modern-js/plugin-i18n": "2.4.0",
|
|
46
|
+
"@modern-js/upgrade": "2.4.0",
|
|
47
|
+
"@modern-js/utils": "2.4.0",
|
|
48
|
+
"@modern-js/plugin-changeset": "2.4.0",
|
|
49
|
+
"@modern-js/plugin-lint": "2.4.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@modern-js/self": "npm:@modern-js/module-tools@*",
|
|
53
52
|
"@types/jest": "^27",
|
|
54
53
|
"@types/node": "^14",
|
|
55
54
|
"@types/fs-extra": "9.0.13",
|
|
@@ -60,9 +59,10 @@
|
|
|
60
59
|
"postcss-alias": "2.0.0",
|
|
61
60
|
"react": "17",
|
|
62
61
|
"typescript": "^4",
|
|
63
|
-
"@modern-js/
|
|
64
|
-
"@
|
|
65
|
-
"@scripts/jest-config": "2.
|
|
62
|
+
"@modern-js/self": "npm:@modern-js/module-tools@2.4.0",
|
|
63
|
+
"@modern-js/builder-webpack-provider": "2.4.0",
|
|
64
|
+
"@scripts/jest-config": "2.4.0",
|
|
65
|
+
"@scripts/build": "2.4.0"
|
|
66
66
|
},
|
|
67
67
|
"publishConfig": {
|
|
68
68
|
"registry": "https://registry.npmjs.org/",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
File without changes
|