pkgroll 1.0.0 → 1.0.3
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/README.md +18 -14
- package/dist/cli.js +17 -17
- package/dist/rollup-plugin-dts-4870e282.js +24 -0
- package/package.json +6 -5
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# pkgroll
|
|
2
2
|
|
|
3
|
-
Write your code in ESM
|
|
3
|
+
Write your code in ESM & TypeScript and bundle it to get ESM, CommonJS, and type declaration outputs with a single command!
|
|
4
4
|
|
|
5
5
|
### Features
|
|
6
6
|
- **Zero config** Configuration automatically inferred from `package.json`
|
|
@@ -34,11 +34,9 @@ npm install --save-dev pkgroll
|
|
|
34
34
|
|
|
35
35
|
// Define output files for Node.js export maps (https://nodejs.org/api/packages.html#exports)
|
|
36
36
|
"exports": {
|
|
37
|
-
"
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
"types": "./dist/file.d.ts"
|
|
41
|
-
}
|
|
37
|
+
"require": "./dist/file.js",
|
|
38
|
+
"import": "./dist/file.mjs",
|
|
39
|
+
"types": "./dist/file.d.ts"
|
|
42
40
|
},
|
|
43
41
|
|
|
44
42
|
// bin files will be compiled to be executable with the Node.js hashbang
|
|
@@ -94,7 +92,7 @@ _Auto-detect_ infers the type by extension or `package.json#type`:
|
|
|
94
92
|
|
|
95
93
|
Packages to externalize are detected by reading dependency types in `package.json`. Only dependencies listed in `devDependencies` are bundled in.
|
|
96
94
|
|
|
97
|
-
When generating type declarations, this also
|
|
95
|
+
When generating type declarations (`.d.ts` files), this also bundles and tree-shakes type dependencies declared in `devDependencies` as well.
|
|
98
96
|
|
|
99
97
|
```json5
|
|
100
98
|
// package.json
|
|
@@ -117,13 +115,13 @@ When generating type declarations, this also applies to dependencies referenced
|
|
|
117
115
|
```
|
|
118
116
|
|
|
119
117
|
### Aliases
|
|
120
|
-
Aliases
|
|
118
|
+
Aliases can be configured in the [import map](https://nodejs.org/api/packages.html#imports), defined in `package.json#imports`.
|
|
121
119
|
|
|
122
120
|
For native Node.js import mapping, all entries must be prefixed with `#` to indicate an internal [subpath import](https://nodejs.org/api/packages.html#subpath-imports). _Pkgroll_ takes advantage of this behavior to define entries that are _not prefixed_ with `#` as an alias.
|
|
123
121
|
|
|
124
122
|
Native Node.js import mapping supports conditional imports (eg. resolving different paths for Node.js and browser), but _Pkgroll_ does not.
|
|
125
123
|
|
|
126
|
-
> ⚠️ Aliases are not supported in type declaration generation. If you need type
|
|
124
|
+
> ⚠️ Aliases are not supported in type declaration generation. If you need type support, do not use aliases.
|
|
127
125
|
|
|
128
126
|
```json5
|
|
129
127
|
{
|
|
@@ -143,7 +141,7 @@ Native Node.js import mapping supports conditional imports (eg. resolving differ
|
|
|
143
141
|
|
|
144
142
|
_Pkgroll_ uses [esbuild](https://esbuild.github.io/) to handle TypeScript and JavaScript transformation and minification.
|
|
145
143
|
|
|
146
|
-
The target specifies the environments the output should support. Depending on the target, it
|
|
144
|
+
The target specifies the environments the output should support. Depending on how new the target is, it can generate less code using newer syntax. Read more about it in the [esbuild docs](https://esbuild.github.io/api/#target).
|
|
147
145
|
|
|
148
146
|
|
|
149
147
|
By default, the target is set to the version of Node.js used. It can be overwritten with the `--target` flag:
|
|
@@ -178,7 +176,7 @@ Because _pkgroll_ uses Rollup, it's able to produce CJS modules that are minimal
|
|
|
178
176
|
|
|
179
177
|
This means you can technically output in CommonJS to get ESM and CommonJS support.
|
|
180
178
|
|
|
181
|
-
####
|
|
179
|
+
#### `require()` in ESM
|
|
182
180
|
Sometimes it's useful to use `require()` or `require.resolve()` in ESM. This can be seamlessly compiled to CommonJS. But when compiling to ESM, Node.js will error because `require` doesn't exist in the module scope.
|
|
183
181
|
|
|
184
182
|
When compiling to ESM, _Pkgroll_ detects `require()` usages and shims it with [`createRequire(import.meta.url)`](https://nodejs.org/api/module.html#modulecreaterequirefilename).
|
|
@@ -199,7 +197,7 @@ pkgroll --watch
|
|
|
199
197
|
## FAQ
|
|
200
198
|
|
|
201
199
|
### Why bundle with Rollup?
|
|
202
|
-
[Rollup](https://rollupjs.org/) has the best tree-shaking performance, outputs simpler code, and produces seamless CommonJS and ESM formats (minimal interop code). Notably, CJS outputs generated by Rollup supports named exports so it can be parsed by Node.js ESM.
|
|
200
|
+
[Rollup](https://rollupjs.org/) has the best tree-shaking performance, outputs simpler code, and produces seamless CommonJS and ESM formats (minimal interop code). Notably, CJS outputs generated by Rollup supports named exports so it can be parsed by Node.js ESM. TypeScript & minification transformations are handled by [esbuild](https://esbuild.github.io/) for speed.
|
|
203
201
|
|
|
204
202
|
### Why bundle Node.js packages?
|
|
205
203
|
|
|
@@ -209,11 +207,17 @@ pkgroll --watch
|
|
|
209
207
|
|
|
210
208
|
- **Dependency bundling** yields smaller and faster installation.
|
|
211
209
|
|
|
212
|
-
Tree-shaking only pulls in used code from dependencies, preventing unused code and unnecessary files (eg. `README.md`) from getting downloaded.
|
|
210
|
+
Tree-shaking only pulls in used code from dependencies, preventing unused code and unnecessary files (eg. `README.md`, `package.json`, etc.) from getting downloaded.
|
|
213
211
|
|
|
214
212
|
Removing dependencies also eliminates dependency tree traversal, which is [one of the biggest bottlenecks](https://dev.to/atian25/in-depth-of-tnpm-rapid-mode-how-could-we-fast-10s-than-pnpm-3bpp#:~:text=The%20first%20optimization%20comes%20from%20%27dependencies%20graph%27%3A).
|
|
215
213
|
|
|
216
|
-
- **
|
|
214
|
+
- **Inadvertent breaking changes**
|
|
215
|
+
|
|
216
|
+
Dependencies can introduce breaking changes due to a discrepancy in environment support criteria, by accident, or in rare circumstances, [maliciously](https://snyk.io/blog/peacenotwar-malicious-npm-node-ipc-package-vulnerability/).
|
|
217
|
+
|
|
218
|
+
Compiling dependencies will make sure new syntax & features are downgraded to support the same environments. And also prevent any unexpected changes from sneaking in during installation.
|
|
219
|
+
|
|
220
|
+
- **Type dependencies** must be declared in the `dependencies` object in `package.json` for it to be resolved by the consumer.
|
|
217
221
|
|
|
218
222
|
This can be unintuitive because types are a development enhancement and also adds installation bloat. Bundling filters out unused types and allows type dependencies to be declared in `devDependencies`.
|
|
219
223
|
|
package/dist/cli.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";var fs$1=require("fs"),require$$1=require("tty"),rollup=require("rollup"),path$1=require("path"),require$$2=require("module"),nodeResolve=require("@rollup/plugin-node-resolve"),commonjs=require("@rollup/plugin-commonjs"),json=require("@rollup/plugin-json"),alias=require("@rollup/plugin-alias"),replace=require("@rollup/plugin-replace"),inject=require("@rollup/plugin-inject"),pluginutils=require("@rollup/pluginutils"),esbuild=require("esbuild"),MagicString=require("magic-string");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var fs__default$1=_interopDefaultLegacy(fs$1),require$$1__default=_interopDefaultLegacy(require$$1),path__default$1=_interopDefaultLegacy(path$1),nodeResolve__default=_interopDefaultLegacy(nodeResolve),commonjs__default=_interopDefaultLegacy(commonjs),json__default=_interopDefaultLegacy(json),alias__default=_interopDefaultLegacy(alias),replace__default=_interopDefaultLegacy(replace),inject__default=_interopDefaultLegacy(inject),MagicString__default=_interopDefaultLegacy(MagicString);function commonjsRequire(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var m$1=Object.defineProperty,I$2=Object.getOwnPropertyDescriptor,D$1=Object.getOwnPropertyNames,K$2=Object.prototype.hasOwnProperty,L$2=e=>m$1(e,"__esModule",{value:!0}),M$1=(e,t)=>{for(var r in t)m$1(e,r,{get:t[r],enumerable:!0})},R$2=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of D$1(t))!K$2.call(e,a)&&(r||a!=="default")&&m$1(e,a,{get:()=>t[a],enumerable:!(n=I$2(t,a))||n.enumerable});return e},z$2=(e=>(t,r)=>e&&e.get(t)||(r=R$2(L$2({}),t,1),e&&e.set(t,r),r))(typeof WeakMap!="undefined"?new WeakMap:0),X$2={};M$1(X$2,{default:()=>j$2});var P$2=/-(\w)/g,A$1=e=>e.replace(P$2,(t,r)=>r.toUpperCase()),$$1=/\B([A-Z])/g,B$1=e=>e.replace($$1,"-$1").toLowerCase(),{stringify:u}=JSON,{hasOwnProperty:U$2}=Object.prototype,F=(e,t)=>U$2.call(e,t),W$2=/^--?/,q$2=/[.:=]/,C=e=>{let t=e.replace(W$2,""),r,n=t.match(q$2);if(n!=null&&n.index){let a=n.index;r=t.slice(a+1),t=t.slice(0,a)}return{flagName:t,flagValue:r}},G$2=/[\s.:=]/,J$2=(e,t)=>{let r=`Invalid flag name ${u(t)}:`;if(t.length===0)throw new Error(`${r} flag name cannot be empty}`);if(t.length===1)throw new Error(`${r} single characters are reserved for aliases`);let n=t.match(G$2);if(n)throw new Error(`${r} flag name cannot contain the character ${u(n==null?void 0:n[0])}`);let a;if(P$2.test(t)?a=A$1(t):$$1.test(t)&&(a=B$1(t)),a&&F(e,a))throw new Error(`${r} collides with flag ${u(a)}`)};function E$1(e){let t=new Map;for(let r in e){if(!F(e,r))continue;J$2(e,r);let n=e[r];if(n&&typeof n=="object"){let{alias:a}=n;if(typeof a=="string"){if(a.length===0)throw new Error(`Invalid flag alias ${u(r)}: flag alias cannot be empty`);if(a.length>1)throw new Error(`Invalid flag alias ${u(r)}: flag aliases can only be a single-character`);if(t.has(a))throw new Error(`Flag collision: Alias "${a}" is already used`);t.set(a,{name:r,schema:n})}}}return t}var Z$2=e=>!e||typeof e=="function"?!1:Array.isArray(e)||Array.isArray(e.type),v$2=e=>{let t={};for(let r in e)F(e,r)&&(t[r]=Z$2(e[r])?[]:void 0);return t},h$2=(e,t)=>e===Number&&t===""?Number.NaN:e===Boolean?t!=="false":t,_$2=(e,t)=>{for(let r in e){if(!F(e,r))continue;let n=e[r];if(!n)continue;let a=t[r];if(!(a!==void 0&&!(Array.isArray(a)&&a.length===0))&&"default"in n){let o=n.default;typeof o=="function"&&(o=o()),t[r]=o}}},x$2=(e,t)=>{if(!t)throw new Error(`Missing type on flag "${e}"`);return typeof t=="function"?t:Array.isArray(t)?t[0]:x$2(e,t.type)},H$1=/^-[\da-z]+/i,Q$2=/^--[\w-]{2,}/,S$2="--";function j$2(e,t=process.argv.slice(2)){let r=E$1(e),n={flags:v$2(e),unknownFlags:{},_:Object.assign([],{[S$2]:[]})},a,o=(g,s,uu)=>{let Du=x$2(g,s);uu=h$2(Du,uu),uu!==void 0&&!Number.isNaN(uu)?Array.isArray(n.flags[g])?n.flags[g].push(Du(uu)):n.flags[g]=Du(uu):a=eu=>{Array.isArray(n.flags[g])?n.flags[g].push(Du(h$2(Du,eu||""))):n.flags[g]=Du(h$2(Du,eu||"")),a=void 0}},l=(g,s)=>{g in n.unknownFlags||(n.unknownFlags[g]=[]),s!==void 0?n.unknownFlags[g].push(s):a=(uu=!0)=>{n.unknownFlags[g].push(uu),a=void 0}};for(let g=0;g<t.length;g+=1){let s=t[g];if(s===S$2){let Du=t.slice(g+1);n._[S$2]=Du,n._.push(...Du);break}let uu=H$1.test(s);if(Q$2.test(s)||uu){a&&a();let Du=C(s),{flagValue:eu}=Du,{flagName:tu}=Du;if(uu){for(let nu=0;nu<tu.length;nu+=1){let lu=tu[nu],cu=r.get(lu),su=nu===tu.length-1;cu?o(cu.name,cu.schema,su?eu:!0):l(lu,su?eu:!0)}continue}let au=e[tu];if(!au){let nu=A$1(tu);au=e[nu],au&&(tu=nu)}if(!au){l(tu,eu);continue}o(tu,au,eu)}else a?a(s):n._.push(s)}return a&&a(),_$2(e,n.flags),n}var dist$3=z$2(X$2),CD=Object.create,p$1=Object.defineProperty,tD=Object.defineProperties,eD=Object.getOwnPropertyDescriptor,ED=Object.getOwnPropertyDescriptors,nD=Object.getOwnPropertyNames,I$1=Object.getOwnPropertySymbols,rD=Object.getPrototypeOf,L$1=Object.prototype.hasOwnProperty,iD=Object.prototype.propertyIsEnumerable,T$1=(e,t,r)=>t in e?p$1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,c=(e,t)=>{for(var r in t||(t={}))L$1.call(t,r)&&T$1(e,r,t[r]);if(I$1)for(var r of I$1(t))iD.call(t,r)&&T$1(e,r,t[r]);return e},d=(e,t)=>tD(e,ED(t)),W$1=e=>p$1(e,"__esModule",{value:!0}),oD=(e,t)=>()=>(e&&(t=e(e=0)),t),BD=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),sD=(e,t)=>{for(var r in t)p$1(e,r,{get:t[r],enumerable:!0})},v$1=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of nD(t))!L$1.call(e,a)&&(r||a!=="default")&&p$1(e,a,{get:()=>t[a],enumerable:!(n=eD(t,a))||n.enumerable});return e},aD=(e,t)=>v$1(W$1(p$1(e!=null?CD(rD(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),lD=(e=>(t,r)=>e&&e.get(t)||(r=v$1(W$1({}),t,1),e&&e.set(t,r),r))(typeof WeakMap!="undefined"?new WeakMap:0),i=oD(()=>{}),j$1=BD((e,t)=>{i(),t.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|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7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDF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\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u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DD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}}),RD={};sD(RD,{breakpoints:()=>FD,default:()=>uD}),i(),i(),i();var N$1=e=>{var t,r,n;let a=(t=process.stdout.columns)!=null?t:Number.POSITIVE_INFINITY;return typeof e=="function"&&(e=e(a)),e||(e={}),Array.isArray(e)?{columns:e,stdoutColumns:a}:{columns:(r=e.columns)!=null?r:[],stdoutColumns:(n=e.stdoutColumns)!=null?n:a}};i(),i(),i(),i(),i();function x$1({onlyFirst:e=!1}={}){let t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?void 0:"g")}function h$1(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(x$1(),"")}i();function w(e){return Number.isInteger(e)?e>=4352&&(e<=4447||e===9001||e===9002||11904<=e&&e<=12871&&e!==12351||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141):!1}var k=aD(j$1(),1);function f$1(e){if(typeof e!="string"||e.length===0||(e=h$1(e),e.length===0))return 0;e=e.replace((0,k.default)()," ");let t=0;for(let r=0;r<e.length;r++){let n=e.codePointAt(r);n<=31||n>=127&&n<=159||n>=768&&n<=879||(n>65535&&r++,t+=w(n)?2:1)}return t}var m=e=>Math.max(...e.split(`
|
|
3
|
-
`).map(f$1)),_$1=e=>{let t=[];for(let r of e){let{length:n}=r,
|
|
4
|
-
`)];for(let[uu
|
|
5
|
-
`?(
|
|
6
|
-
`&&(
|
|
2
|
+
"use strict";var fs$1=require("fs"),require$$1=require("tty"),rollup=require("rollup"),path$1=require("path"),nodeResolve=require("@rollup/plugin-node-resolve"),commonjs=require("@rollup/plugin-commonjs"),json=require("@rollup/plugin-json"),alias=require("@rollup/plugin-alias"),replace=require("@rollup/plugin-replace"),inject=require("@rollup/plugin-inject"),pluginutils=require("@rollup/pluginutils"),esbuild=require("esbuild"),require$$2=require("module"),MagicString=require("magic-string");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var fs__default$1=_interopDefaultLegacy(fs$1),require$$1__default=_interopDefaultLegacy(require$$1),path__default$1=_interopDefaultLegacy(path$1),nodeResolve__default=_interopDefaultLegacy(nodeResolve),commonjs__default=_interopDefaultLegacy(commonjs),json__default=_interopDefaultLegacy(json),alias__default=_interopDefaultLegacy(alias),replace__default=_interopDefaultLegacy(replace),inject__default=_interopDefaultLegacy(inject),MagicString__default=_interopDefaultLegacy(MagicString);function commonjsRequire(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var m$1=Object.defineProperty,I$2=Object.getOwnPropertyDescriptor,D$1=Object.getOwnPropertyNames,K$2=Object.prototype.hasOwnProperty,L$2=e=>m$1(e,"__esModule",{value:!0}),M$1=(e,t)=>{for(var r in t)m$1(e,r,{get:t[r],enumerable:!0})},R$2=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of D$1(t))!K$2.call(e,o)&&(r||o!=="default")&&m$1(e,o,{get:()=>t[o],enumerable:!(n=I$2(t,o))||n.enumerable});return e},z$2=(e=>(t,r)=>e&&e.get(t)||(r=R$2(L$2({}),t,1),e&&e.set(t,r),r))(typeof WeakMap!="undefined"?new WeakMap:0),X$2={};M$1(X$2,{default:()=>j$2});var P$2=/-(\w)/g,A$1=e=>e.replace(P$2,(t,r)=>r.toUpperCase()),$$1=/\B([A-Z])/g,B$1=e=>e.replace($$1,"-$1").toLowerCase(),{stringify:u}=JSON,{hasOwnProperty:U$2}=Object.prototype,F=(e,t)=>U$2.call(e,t),W$2=/^--?/,q$2=/[.:=]/,C=e=>{let t=e.replace(W$2,""),r,n=t.match(q$2);if(n!=null&&n.index){let o=n.index;r=t.slice(o+1),t=t.slice(0,o)}return{flagName:t,flagValue:r}},G$2=/[\s.:=]/,J$2=(e,t)=>{let r=`Invalid flag name ${u(t)}:`;if(t.length===0)throw new Error(`${r} flag name cannot be empty}`);if(t.length===1)throw new Error(`${r} single characters are reserved for aliases`);let n=t.match(G$2);if(n)throw new Error(`${r} flag name cannot contain the character ${u(n==null?void 0:n[0])}`);let o;if(P$2.test(t)?o=A$1(t):$$1.test(t)&&(o=B$1(t)),o&&F(e,o))throw new Error(`${r} collides with flag ${u(o)}`)};function E$1(e){let t=new Map;for(let r in e){if(!F(e,r))continue;J$2(e,r);let n=e[r];if(n&&typeof n=="object"){let{alias:o}=n;if(typeof o=="string"){if(o.length===0)throw new Error(`Invalid flag alias ${u(r)}: flag alias cannot be empty`);if(o.length>1)throw new Error(`Invalid flag alias ${u(r)}: flag aliases can only be a single-character`);if(t.has(o))throw new Error(`Flag collision: Alias "${o}" is already used`);t.set(o,{name:r,schema:n})}}}return t}var Z$2=e=>!e||typeof e=="function"?!1:Array.isArray(e)||Array.isArray(e.type),v$2=e=>{let t={};for(let r in e)F(e,r)&&(t[r]=Z$2(e[r])?[]:void 0);return t},h$2=(e,t)=>e===Number&&t===""?Number.NaN:e===Boolean?t!=="false":t,_$2=(e,t)=>{for(let r in e){if(!F(e,r))continue;let n=e[r];if(!n)continue;let o=t[r];if(!(o!==void 0&&!(Array.isArray(o)&&o.length===0))&&"default"in n){let a=n.default;typeof a=="function"&&(a=a()),t[r]=a}}},x$2=(e,t)=>{if(!t)throw new Error(`Missing type on flag "${e}"`);return typeof t=="function"?t:Array.isArray(t)?t[0]:x$2(e,t.type)},H$1=/^-[\da-z]+/i,Q$2=/^--[\w-]{2,}/,S$2="--";function j$2(e,t=process.argv.slice(2)){let r=E$1(e),n={flags:v$2(e),unknownFlags:{},_:Object.assign([],{[S$2]:[]})},o,a=(g,l,Du)=>{let uu=x$2(g,l);Du=h$2(uu,Du),Du!==void 0&&!Number.isNaN(Du)?Array.isArray(n.flags[g])?n.flags[g].push(uu(Du)):n.flags[g]=uu(Du):o=eu=>{Array.isArray(n.flags[g])?n.flags[g].push(uu(h$2(uu,eu||""))):n.flags[g]=uu(h$2(uu,eu||"")),o=void 0}},s=(g,l)=>{g in n.unknownFlags||(n.unknownFlags[g]=[]),l!==void 0?n.unknownFlags[g].push(l):o=(Du=!0)=>{n.unknownFlags[g].push(Du),o=void 0}};for(let g=0;g<t.length;g+=1){let l=t[g];if(l===S$2){let uu=t.slice(g+1);n._[S$2]=uu,n._.push(...uu);break}let Du=H$1.test(l);if(Q$2.test(l)||Du){o&&o();let uu=C(l),{flagValue:eu}=uu,{flagName:tu}=uu;if(Du){for(let nu=0;nu<tu.length;nu+=1){let lu=tu[nu],Cu=r.get(lu),su=nu===tu.length-1;Cu?a(Cu.name,Cu.schema,su?eu:!0):s(lu,su?eu:!0)}continue}let ou=e[tu];if(!ou){let nu=A$1(tu);ou=e[nu],ou&&(tu=nu)}if(!ou){s(tu,eu);continue}a(tu,ou,eu)}else o?o(l):n._.push(l)}return o&&o(),_$2(e,n.flags),n}var dist$3=z$2(X$2),CD=Object.create,p$1=Object.defineProperty,tD=Object.defineProperties,eD=Object.getOwnPropertyDescriptor,ED=Object.getOwnPropertyDescriptors,nD=Object.getOwnPropertyNames,I$1=Object.getOwnPropertySymbols,rD=Object.getPrototypeOf,L$1=Object.prototype.hasOwnProperty,iD=Object.prototype.propertyIsEnumerable,T$1=(e,t,r)=>t in e?p$1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,c=(e,t)=>{for(var r in t||(t={}))L$1.call(t,r)&&T$1(e,r,t[r]);if(I$1)for(var r of I$1(t))iD.call(t,r)&&T$1(e,r,t[r]);return e},d=(e,t)=>tD(e,ED(t)),W$1=e=>p$1(e,"__esModule",{value:!0}),oD=(e,t)=>()=>(e&&(t=e(e=0)),t),BD=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),sD=(e,t)=>{for(var r in t)p$1(e,r,{get:t[r],enumerable:!0})},v$1=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of nD(t))!L$1.call(e,o)&&(r||o!=="default")&&p$1(e,o,{get:()=>t[o],enumerable:!(n=eD(t,o))||n.enumerable});return e},aD=(e,t)=>v$1(W$1(p$1(e!=null?CD(rD(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),lD=(e=>(t,r)=>e&&e.get(t)||(r=v$1(W$1({}),t,1),e&&e.set(t,r),r))(typeof WeakMap!="undefined"?new WeakMap:0),i=oD(()=>{}),j$1=BD((e,t)=>{i(),t.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDD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80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\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36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\u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-\uDDDD])/g}}),RD={};sD(RD,{breakpoints:()=>FD,default:()=>uD}),i(),i(),i();var N$1=e=>{var t,r,n;let o=(t=process.stdout.columns)!=null?t:Number.POSITIVE_INFINITY;return typeof e=="function"&&(e=e(o)),e||(e={}),Array.isArray(e)?{columns:e,stdoutColumns:o}:{columns:(r=e.columns)!=null?r:[],stdoutColumns:(n=e.stdoutColumns)!=null?n:o}};i(),i(),i(),i(),i();function x$1({onlyFirst:e=!1}={}){let t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?void 0:"g")}function h$1(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(x$1(),"")}i();function w(e){return Number.isInteger(e)?e>=4352&&(e<=4447||e===9001||e===9002||11904<=e&&e<=12871&&e!==12351||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141):!1}var k=aD(j$1(),1);function f$1(e){if(typeof e!="string"||e.length===0||(e=h$1(e),e.length===0))return 0;e=e.replace((0,k.default)()," ");let t=0;for(let r=0;r<e.length;r++){let n=e.codePointAt(r);n<=31||n>=127&&n<=159||n>=768&&n<=879||(n>65535&&r++,t+=w(n)?2:1)}return t}var m=e=>Math.max(...e.split(`
|
|
3
|
+
`).map(f$1)),_$1=e=>{let t=[];for(let r of e){let{length:n}=r,o=n-t.length;for(let a=0;a<o;a+=1)t.push(0);for(let a=0;a<n;a+=1){let s=m(r[a]);s>t[a]&&(t[a]=s)}}return t};i();var z$1=/^\d+%$/,U$1={width:"auto",align:"left",contentWidth:0,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,horizontalPadding:0,paddingLeftString:"",paddingRightString:""},AD=(e,t)=>{var r;let n=[];for(let o=0;o<e.length;o+=1){let a=(r=t[o])!=null?r:"auto";if(typeof a=="number"||a==="auto"||a==="content-width"||typeof a=="string"&&z$1.test(a)){n.push(d(c({},U$1),{width:a,contentWidth:e[o]}));continue}if(a&&typeof a=="object"){let s=d(c(c({},U$1),a),{contentWidth:e[o]});s.horizontalPadding=s.paddingLeft+s.paddingRight,n.push(s);continue}throw new Error(`Invalid column width: ${JSON.stringify(a)}`)}return n};function fD(e,t){for(let r of e){let{width:n}=r;if(n==="content-width"&&(r.width=r.contentWidth),n==="auto"){let l=Math.min(20,r.contentWidth);r.width=l,r.autoOverflow=r.contentWidth-l}if(typeof n=="string"&&z$1.test(n)){let l=Number.parseFloat(n.slice(0,-1))/100;r.width=Math.floor(t*l)-(r.paddingLeft+r.paddingRight)}let{horizontalPadding:o}=r,a=1,s=a+o;if(s>=t){let l=s-t,Du=Math.ceil(r.paddingLeft/o*l),uu=l-Du;r.paddingLeft-=Du,r.paddingRight-=uu,r.horizontalPadding=r.paddingLeft+r.paddingRight}r.paddingLeftString=r.paddingLeft?" ".repeat(r.paddingLeft):"",r.paddingRightString=r.paddingRight?" ".repeat(r.paddingRight):"";let g=t-r.horizontalPadding;r.width=Math.max(Math.min(r.width,g),a)}}var G$1=()=>Object.assign([],{columns:0});function cD(e,t){let r=[G$1()],[n]=r;for(let o of e){let a=o.width+o.horizontalPadding;n.columns+a>t&&(n=G$1(),r.push(n)),n.push(o),n.columns+=a}for(let o of r){let a=o.reduce((tu,ou)=>tu+ou.width+ou.horizontalPadding,0),s=t-a;if(s===0)continue;let g=o.filter(tu=>"autoOverflow"in tu),l=g.filter(tu=>tu.autoOverflow>0),Du=l.reduce((tu,ou)=>tu+ou.autoOverflow,0),uu=Math.min(Du,s);for(let tu of l){let ou=Math.floor(tu.autoOverflow/Du*uu);tu.width+=ou,s-=ou}let eu=Math.floor(s/g.length);for(let tu=0;tu<g.length;tu+=1){let ou=g[tu];tu===g.length-1?ou.width+=s:ou.width+=eu,s-=eu}}return r}function Z$1(e,t,r){let n=AD(r,t);return fD(n,e),cD(n,e)}i(),i(),i();var y=10,V$1=(e=0)=>t=>`\x1B[${t+e}m`,Y$1=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,K$1=(e=0)=>(t,r,n)=>`\x1B[${38+e};2;${t};${r};${n}m`;function gD(){let e=new Map,t={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],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.gray=t.color.blackBright,t.bgColor.bgGray=t.bgColor.bgBlackBright,t.color.grey=t.color.blackBright,t.bgColor.bgGrey=t.bgColor.bgBlackBright;for(let[r,n]of Object.entries(t)){for(let[o,a]of Object.entries(n))t[o]={open:`\x1B[${a[0]}m`,close:`\x1B[${a[1]}m`},n[o]=t[o],e.set(a[0],a[1]);Object.defineProperty(t,r,{value:n,enumerable:!1})}return Object.defineProperty(t,"codes",{value:e,enumerable:!1}),t.color.close="\x1B[39m",t.bgColor.close="\x1B[49m",t.color.ansi=V$1(),t.color.ansi256=Y$1(),t.color.ansi16m=K$1(),t.bgColor.ansi=V$1(y),t.bgColor.ansi256=Y$1(y),t.bgColor.ansi16m=K$1(y),Object.defineProperties(t,{rgbToAnsi256:{value:(r,n,o)=>r===n&&n===o?r<8?16:r>248?231:Math.round((r-8)/247*24)+232:16+36*Math.round(r/255*5)+6*Math.round(n/255*5)+Math.round(o/255*5),enumerable:!1},hexToRgb:{value:r=>{let n=/(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(r.toString(16));if(!n)return[0,0,0];let{colorString:o}=n.groups;o.length===3&&(o=o.split("").map(s=>s+s).join(""));let a=Number.parseInt(o,16);return[a>>16&255,a>>8&255,a&255]},enumerable:!1},hexToAnsi256:{value:r=>t.rgbToAnsi256(...t.hexToRgb(r)),enumerable:!1},ansi256ToAnsi:{value:r=>{if(r<8)return 30+r;if(r<16)return 90+(r-8);let n,o,a;if(r>=232)n=((r-232)*10+8)/255,o=n,a=n;else{r-=16;let l=r%36;n=Math.floor(r/36)/5,o=Math.floor(l/6)/5,a=l%6/5}let s=Math.max(n,o,a)*2;if(s===0)return 30;let g=30+(Math.round(a)<<2|Math.round(o)<<1|Math.round(n));return s===2&&(g+=60),g},enumerable:!1},rgbToAnsi:{value:(r,n,o)=>t.ansi256ToAnsi(t.rgbToAnsi256(r,n,o)),enumerable:!1},hexToAnsi:{value:r=>t.ansi256ToAnsi(t.hexToAnsi256(r)),enumerable:!1}}),t}var pD=gD(),q$1=pD,b$1=new Set(["\x1B","\x9B"]),dD=39,R$1="\x07",H="[",hD="]",J$1="m",O$1=`${hD}8;;`,Q$1=e=>`${b$1.values().next().value}${H}${e}${J$1}`,X$1=e=>`${b$1.values().next().value}${O$1}${e}${R$1}`,mD=e=>e.split(" ").map(t=>f$1(t)),M=(e,t,r)=>{let n=[...t],o=!1,a=!1,s=f$1(h$1(e[e.length-1]));for(let[g,l]of n.entries()){let Du=f$1(l);if(s+Du<=r?e[e.length-1]+=l:(e.push(l),s=0),b$1.has(l)&&(o=!0,a=n.slice(g+1).join("").startsWith(O$1)),o){a?l===R$1&&(o=!1,a=!1):l===J$1&&(o=!1);continue}s+=Du,s===r&&g<n.length-1&&(e.push(""),s=0)}!s&&e[e.length-1].length>0&&e.length>1&&(e[e.length-2]+=e.pop())},bD=e=>{let t=e.split(" "),r=t.length;for(;r>0&&!(f$1(t[r-1])>0);)r--;return r===t.length?e:t.slice(0,r).join(" ")+t.slice(r).join("")},xD=(e,t,r={})=>{if(r.trim!==!1&&e.trim()==="")return"";let n="",o,a,s=mD(e),g=[""];for(let[Du,uu]of e.split(" ").entries()){r.trim!==!1&&(g[g.length-1]=g[g.length-1].trimStart());let eu=f$1(g[g.length-1]);if(Du!==0&&(eu>=t&&(r.wordWrap===!1||r.trim===!1)&&(g.push(""),eu=0),(eu>0||r.trim===!1)&&(g[g.length-1]+=" ",eu++)),r.hard&&s[Du]>t){let tu=t-eu,ou=1+Math.floor((s[Du]-tu-1)/t);Math.floor((s[Du]-1)/t)<ou&&g.push(""),M(g,uu,t);continue}if(eu+s[Du]>t&&eu>0&&s[Du]>0){if(r.wordWrap===!1&&eu<t){M(g,uu,t);continue}g.push("")}if(eu+s[Du]>t&&r.wordWrap===!1){M(g,uu,t);continue}g[g.length-1]+=uu}r.trim!==!1&&(g=g.map(Du=>bD(Du)));let l=[...g.join(`
|
|
4
|
+
`)];for(let[Du,uu]of l.entries()){if(n+=uu,b$1.has(uu)){let{groups:tu}=new RegExp(`(?:\\${H}(?<code>\\d+)m|\\${O$1}(?<uri>.*)${R$1})`).exec(l.slice(Du).join(""))||{groups:{}};if(tu.code!==void 0){let ou=Number.parseFloat(tu.code);o=ou===dD?void 0:ou}else tu.uri!==void 0&&(a=tu.uri.length===0?void 0:tu.uri)}let eu=q$1.codes.get(Number(o));l[Du+1]===`
|
|
5
|
+
`?(a&&(n+=X$1("")),o&&eu&&(n+=Q$1(eu))):uu===`
|
|
6
|
+
`&&(o&&eu&&(n+=Q$1(o)),a&&(n+=X$1(a)))}return n};function S$1(e,t,r){return String(e).normalize().replace(/\r\n/g,`
|
|
7
7
|
`).split(`
|
|
8
8
|
`).map(n=>xD(n,t,r)).join(`
|
|
9
|
-
`)}var P$1=e=>Array.from({length:e}).fill("");function DD(e,t){let r=[],n=0;for(let
|
|
10
|
-
`);if(
|
|
9
|
+
`)}var P$1=e=>Array.from({length:e}).fill("");function DD(e,t){let r=[],n=0;for(let o of e){let a=0,s=o.map(l=>{var Du;let uu=(Du=t[n])!=null?Du:"";n+=1,l.preprocess&&(uu=l.preprocess(uu)),m(uu)>l.width&&(uu=S$1(uu,l.width,{hard:!0}));let eu=uu.split(`
|
|
10
|
+
`);if(l.postprocess){let{postprocess:tu}=l;eu=eu.map((ou,nu)=>tu.call(l,ou,nu))}return l.paddingTop&&eu.unshift(...P$1(l.paddingTop)),l.paddingBottom&&eu.push(...P$1(l.paddingBottom)),eu.length>a&&(a=eu.length),d(c({},l),{lines:eu})}),g=[];for(let l=0;l<a;l+=1){let Du=s.map(uu=>{var eu;let tu=(eu=uu.lines[l])!=null?eu:"",ou=Number.isFinite(uu.width)?" ".repeat(uu.width-f$1(tu)):"",nu=uu.paddingLeftString;return uu.align==="right"&&(nu+=ou),nu+=tu,uu.align==="left"&&(nu+=ou),nu+uu.paddingRightString}).join("");g.push(Du)}r.push(g.join(`
|
|
11
11
|
`))}return r.join(`
|
|
12
|
-
`)}function uD(e,t){if(!e||e.length===0)return"";let r=_$1(e),n=r.length;if(n===0)return"";let{stdoutColumns:
|
|
13
|
-
`)}i();var wD=["<",">","=",">=","<="];function yD(e){if(!wD.includes(e))throw new TypeError(`Invalid breakpoint operator: ${e}`)}function FD(e){let t=Object.keys(e).map(r=>{let[n,
|
|
12
|
+
`)}function uD(e,t){if(!e||e.length===0)return"";let r=_$1(e),n=r.length;if(n===0)return"";let{stdoutColumns:o,columns:a}=N$1(t);if(a.length>n)throw new Error(`${a.length} columns defined, but only ${n} columns found`);let s=Z$1(o,a,r);return e.map(g=>DD(s,g)).join(`
|
|
13
|
+
`)}i();var wD=["<",">","=",">=","<="];function yD(e){if(!wD.includes(e))throw new TypeError(`Invalid breakpoint operator: ${e}`)}function FD(e){let t=Object.keys(e).map(r=>{let[n,o]=r.split(" ");yD(n);let a=Number.parseInt(o,10);if(Number.isNaN(a))throw new TypeError(`Invalid breakpoint value: ${o}`);let s=e[r];return{operator:n,breakpoint:a,value:s}}).sort((r,n)=>n.breakpoint-r.breakpoint);return r=>{var n;return(n=t.find(({operator:o,breakpoint:a})=>o==="="&&r===a||o===">"&&r>a||o==="<"&&r<a||o===">="&&r>=a||o==="<="&&r<=a))==null?void 0:n.value}}var dist$2=lD(RD),W=Object.create,h=Object.defineProperty,Z=Object.defineProperties,z=Object.getOwnPropertyDescriptor,G=Object.getOwnPropertyDescriptors,Q=Object.getOwnPropertyNames,D=Object.getOwnPropertySymbols,X=Object.getPrototypeOf,T=Object.prototype.hasOwnProperty,Y=Object.prototype.propertyIsEnumerable,E=(e,t,r)=>t in e?h(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,f=(e,t)=>{for(var r in t||(t={}))T.call(t,r)&&E(e,r,t[r]);if(D)for(var r of D(t))Y.call(t,r)&&E(e,r,t[r]);return e},b=(e,t)=>Z(e,G(t)),S=e=>h(e,"__esModule",{value:!0}),ee=(e,t)=>{for(var r in t)h(e,r,{get:t[r],enumerable:!0})},B=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Q(t))!T.call(e,o)&&(r||o!=="default")&&h(e,o,{get:()=>t[o],enumerable:!(n=z(t,o))||n.enumerable});return e},v=(e,t)=>B(S(h(e!=null?W(X(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),te=(e=>(t,r)=>e&&e.get(t)||(r=B(S({}),t,1),e&&e.set(t,r),r))(typeof WeakMap!="undefined"?new WeakMap:0),ue={};ee(ue,{cli:()=>_,command:()=>J});var V=v(dist$3),R=e=>e.replace(/[-_ ](\w)/g,(t,r)=>r.toUpperCase()),I=e=>e.replace(/\B([A-Z])/g,"-$1").toLowerCase(),ne={"> 80":[{width:"content-width",paddingLeft:2,paddingRight:8},{width:"auto"}],"> 40":[{width:"auto",paddingLeft:2,paddingRight:8,preprocess:e=>e.trim()},{width:"100%",paddingLeft:2,paddingBottom:1}],"> 0":{stdoutColumns:1e3,columns:[{width:"content-width",paddingLeft:2,paddingRight:8},{width:"content-width"}]}};function j(e){let t=!1,r=Object.keys(e).sort((n,o)=>n.localeCompare(o)).map(n=>{let o=e[n],a="alias"in o;return a&&(t=!0),{name:n,flag:o,flagFormatted:`--${I(n)}`,aliasesEnabled:t,aliasFormatted:a?`-${o.alias}`:void 0}}).map(n=>(n.aliasesEnabled=t,[{type:"flagName",data:n},{type:"flagDescription",data:n}]));return{type:"table",data:{tableData:r,tableBreakpoints:ne}}}var K=e=>{var t;return!e||((t=e.version)!=null?t:e.help?e.help.version:void 0)},q=e=>{var t;let r="parent"in e&&((t=e.parent)==null?void 0:t.name);return(r?`${r} `:"")+e.name};function re(e){var t;let r=[];e.name&&r.push(q(e));let n=(t=K(e))!=null?t:"parent"in e&&K(e.parent);if(n&&r.push(`v${n}`),r.length!==0)return{id:"name",type:"text",data:`${r.join(" ")}
|
|
14
14
|
`}}function ae(e){let{help:t}=e;if(!(!t||!t.description))return{id:"description",type:"text",data:`${t.description}
|
|
15
15
|
`}}function se(e){var t;let r=e.help||{};if("usage"in r)return r.usage?{id:"usage",type:"section",data:{title:"Usage:",body:Array.isArray(r.usage)?r.usage.join(`
|
|
16
|
-
`):r.usage}}:void 0;if(e.name){let n=[],
|
|
16
|
+
`):r.usage}}:void 0;if(e.name){let n=[],o=[q(e)];if(e.flags&&Object.keys(e.flags).length>0&&o.push("[flags...]"),e.parameters&&e.parameters.length>0){let{parameters:a}=e,s=a.indexOf("--"),g=s>-1&&a.slice(s+1).some(l=>l.startsWith("<"));o.push(a.map(l=>l!=="--"?l:g?"--":"[--]").join(" "))}if(o.length>1&&n.push(o.join(" ")),"commands"in e&&((t=e.commands)==null?void 0:t.length)&&n.push(`${e.name} <command>`),n.length>0)return{id:"usage",type:"section",data:{title:"Usage:",body:n.join(`
|
|
17
17
|
`)}}}}function ie(e){var t;if(!("commands"in e)||!((t=e.commands)!=null&&t.length))return;let r=e.commands.map(n=>[n.options.name,n.options.help?n.options.help.description:""]);return{id:"commands",type:"section",data:{title:"Commands:",body:{type:"table",data:{tableData:r,tableOptions:[{width:"content-width",paddingLeft:2,paddingRight:8}]}},indentBody:0}}}function oe(e){if(!(!e.flags||Object.keys(e.flags).length===0))return{id:"flags",type:"section",data:{title:"Flags:",body:j(e.flags),indentBody:0}}}function me(e){let{help:t}=e;if(!t||!t.examples||t.examples.length===0)return;let{examples:r}=t;if(Array.isArray(r)&&(r=r.join(`
|
|
18
18
|
`)),r)return{id:"examples",type:"section",data:{title:"Examples:",body:r}}}function le(e){if(!("alias"in e)||!e.alias)return;let{alias:t}=e,r=Array.isArray(t)?t.join(", "):t;return{id:"aliases",type:"section",data:{title:"Aliases:",body:r}}}var A=e=>[re,ae,se,ie,oe,me,le].map(t=>t(e)).filter(t=>Boolean(t)),L=v(require$$1__default.default),P=v(dist$2),pe=L.default.WriteStream.prototype.hasColors(),x=class{text(e){return e}bold(e){return pe?`\x1B[1m${e}\x1B[22m`:e.toLocaleUpperCase()}indentText({text:e,spaces:t}){return e.replace(/^/gm," ".repeat(t))}heading(e){return this.bold(e)}section({title:e,body:t,indentBody:r=2}){return`${(e?`${this.heading(e)}
|
|
19
19
|
`:"")+(t?this.indentText({text:this.render(t),spaces:r}):"")}
|
|
20
|
-
`}table({tableData:e,tableOptions:t,tableBreakpoints:r}){return(0,P.default)(e.map(n=>n.map(
|
|
21
|
-
`);if("type"in e&&this[e.type]){let t=this[e.type];if(typeof t=="function")return t.call(this,e.data)}throw new Error(`Invalid node type: ${JSON.stringify(e)}`)}},O=/^[\w.-]+$/,{stringify:p}=JSON,de=/[|\\{}()[\]^$+*?.]/;function $(e){let t=[],r,n;for(let
|
|
22
|
-
`),n(),process.exit(1);e[
|
|
20
|
+
`}table({tableData:e,tableOptions:t,tableBreakpoints:r}){return(0,P.default)(e.map(n=>n.map(o=>this.render(o))),r?(0,P.breakpoints)(r):t)}flagParameter(e){return e===Boolean?"":e===String?"<string>":e===Number?"<number>":Array.isArray(e)?this.flagParameter(e[0]):"<value>"}flagOperator(){return" "}flagName({flag:e,flagFormatted:t,aliasesEnabled:r,aliasFormatted:n}){let o="";if(n?o+=`${n}, `:r&&(o+=" "),o+=t,"placeholder"in e&&typeof e.placeholder=="string")o+=`${this.flagOperator()}${e.placeholder}`;else{let a=this.flagParameter("type"in e?e.type:e);a&&(o+=`${this.flagOperator()}${a}`)}return o}flagDefault(e){return JSON.stringify(e)}flagDescription({flag:e}){var t;let r="description"in e&&(t=e.description)!=null?t:"";if("default"in e){let{default:n}=e;typeof n=="function"&&(n=n()),n&&(r+=` (default: ${this.flagDefault(n)})`)}return r}render(e){if(typeof e=="string")return e;if(Array.isArray(e))return e.map(t=>this.render(t)).join(`
|
|
21
|
+
`);if("type"in e&&this[e.type]){let t=this[e.type];if(typeof t=="function")return t.call(this,e.data)}throw new Error(`Invalid node type: ${JSON.stringify(e)}`)}},O=/^[\w.-]+$/,{stringify:p}=JSON,de=/[|\\{}()[\]^$+*?.]/;function $(e){let t=[],r,n;for(let o of e){if(n)throw new Error(`Invalid parameter: Spread parameter ${p(n)} must be last`);let a=o[0],s=o[o.length-1],g;if(a==="<"&&s===">"&&(g=!0,r))throw new Error(`Invalid parameter: Required parameter ${p(o)} cannot come after optional parameter ${p(r)}`);if(a==="["&&s==="]"&&(g=!1,r=o),g===void 0)throw new Error(`Invalid parameter: ${p(o)}. Must be wrapped in <> (required parameter) or [] (optional parameter)`);let l=o.slice(1,-1),Du=l.slice(-3)==="...";Du&&(n=o,l=l.slice(0,-3));let uu=l.match(de);if(uu)throw new Error(`Invalid parameter: ${p(o)}. Invalid character found ${p(uu[0])}`);t.push({name:l,required:g,spread:Du})}return t}function N(e,t,r,n){for(let o=0;o<t.length;o+=1){let{name:a,required:s,spread:g}=t[o],l=R(a);if(l in e)throw new Error(`Invalid parameter: ${p(a)} is used more than once.`);let Du=g?r.slice(o):r[o];if(g&&(o=t.length),s&&(!Du||g&&Du.length===0))return console.error(`Error: Missing required parameter ${p(a)}
|
|
22
|
+
`),n(),process.exit(1);e[l]=Du}}function ce(e){return e===void 0||e!==!1}function U(e,t,r,n){let o=f({},t.flags),a=t.version;a&&(o.version={type:Boolean,description:"Show version"});let{help:s}=t,g=ce(s);g&&!("help"in o)&&(o.help={type:Boolean,alias:"h",description:"Show help"});let l=(0,V.default)(o,n),Du=()=>{console.log(t.version)};if(a&&l.flags.version===!0)return Du(),process.exit(0);let uu=new x,eu=g&&(s==null?void 0:s.render)?s.render:nu=>uu.render(nu),tu=nu=>{let lu=A(b(f(f({},t),nu?{help:nu}:{}),{flags:o}));console.log(eu(lu,uu))};if(g&&l.flags.help===!0)return tu(),process.exit(0);if(t.parameters){let{parameters:nu}=t,lu=l._,Cu=nu.indexOf("--"),su=nu.slice(Cu+1),au=Object.create(null);if(Cu>-1&&su.length>0){nu=nu.slice(0,Cu);let ru=l._["--"];lu=lu.slice(0,-ru.length||void 0),N(au,$(nu),lu,tu),N(au,$(su),ru,tu)}else N(au,$(nu),lu,tu);Object.assign(l._,au)}let ou=b(f({},l),{showVersion:Du,showHelp:tu});return typeof r=="function"&&r(ou),f({command:e},ou)}function fe(e,t){let r=new Map;for(let n of t){let o=[n.options.name],{alias:a}=n.options;a&&(Array.isArray(a)?o.push(...a):o.push(a));for(let s of o){if(r.has(s))throw new Error(`Duplicate command name found: ${p(s)}`);r.set(s,n)}}return r.get(e)}function _(e,t,r=process.argv.slice(2)){if(!e)throw new Error("Options is required");if("name"in e&&(!e.name||!O.test(e.name)))throw new Error(`Invalid script name: ${p(e.name)}`);let n=r[0];if(e.commands&&O.test(n)){let o=fe(n,e.commands);if(o)return U(o.options.name,b(f({},o.options),{parent:e}),o.callback,r.slice(1))}return U(void 0,e,t,r)}function J(e,t){if(!e)throw new Error("Command options are required");let{name:r}=e;if(e.name===void 0)throw new Error("Command name is required");if(!O.test(r))throw new Error(`Invalid command name ${JSON.stringify(r)}. Command names must be one word.`);return{options:e,callback:t}}var dist$1=te(ue);const fsExists=e=>fs__default$1.default.promises.access(e).then(()=>!0,()=>!1),readPackageJson=async e=>{const t=path__default$1.default.join(e,"package.json");if(!await fsExists(t))throw new Error(`package.json not found at: ${t}`);const n=await fs__default$1.default.promises.readFile(t,"utf8");try{return JSON.parse(n)}catch(o){throw new Error(`Cannot parse package.json: ${o.message}`)}},hasPathPrefixPattern=/^[/.]/,normalizePath$1=(e,t)=>(hasPathPrefixPattern.test(e)||(e=`./${e}`),t&&!e.endsWith("/")&&(e+="/"),e);var __defProp$3=Object.defineProperty,__defProps$3=Object.defineProperties,__getOwnPropDescs$3=Object.getOwnPropertyDescriptors,__getOwnPropSymbols$3=Object.getOwnPropertySymbols,__hasOwnProp$3=Object.prototype.hasOwnProperty,__propIsEnum$3=Object.prototype.propertyIsEnumerable,__defNormalProp$3=(e,t,r)=>t in e?__defProp$3(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,__spreadValues$3=(e,t)=>{for(var r in t||(t={}))__hasOwnProp$3.call(t,r)&&__defNormalProp$3(e,r,t[r]);if(__getOwnPropSymbols$3)for(var r of __getOwnPropSymbols$3(t))__propIsEnum$3.call(t,r)&&__defNormalProp$3(e,r,t[r]);return e},__spreadProps$3=(e,t)=>__defProps$3(e,__getOwnPropDescs$3(t));const getFileType=e=>{if(e.endsWith(".mjs"))return"module";if(e.endsWith(".cjs"))return"commonjs"},isPath=e=>e.startsWith(".");function parseExportsMap(e,t,r="exports"){if(e){if(typeof e=="string")return isPath(e)?[{outputPath:e,type:getFileType(e)||t,from:r}]:[];if(Array.isArray(e))return e.filter(isPath).map((o,a)=>({outputPath:o,type:getFileType(o)||t,from:`${r}[${a}]`}));if(typeof e=="object")return Object.entries(e).flatMap(([n,o])=>{if(typeof o=="string"){const a={outputPath:o,from:`${r}.${n}`};if(n==="require")return __spreadProps$3(__spreadValues$3({},a),{type:"commonjs"});if(n==="import")return __spreadProps$3(__spreadValues$3({},a),{type:getFileType(o)||t});if(n==="types")return __spreadProps$3(__spreadValues$3({},a),{type:"types"});if(n==="node")return __spreadProps$3(__spreadValues$3({},a),{type:getFileType(o)||t,platform:"node"});if(n==="default")return __spreadProps$3(__spreadValues$3({},a),{type:getFileType(o)||t})}return parseExportsMap(o,t,`${r}.${n}`)})}return[]}function addExportPath(e,t){t.outputPath=normalizePath$1(t.outputPath);const{outputPath:r,type:n,platform:o}=t,a=e[r];if(a){if(a.type!==n)throw new Error(`Conflicting export types "${a.type}" & "${n}" found for ${r}`);if(a.platform!==o)throw new Error(`Conflicting export platforms "${a.platform}" & "${o}" found for ${r}`)}e[r]=t}const getExportEntries=e=>{var t,r,n,o;const a={},s=(t=e.type)!=null?t:"commonjs";if(e.main){const g=e.main;addExportPath(a,{outputPath:g,type:(r=getFileType(g))!=null?r:s,from:"main"})}if(e.module&&addExportPath(a,{outputPath:e.module,type:"module",from:"module"}),e.types&&addExportPath(a,{outputPath:e.types,type:"types",from:"types"}),e.bin){const{bin:g}=e;if(typeof g=="string")addExportPath(a,{outputPath:g,type:(n=getFileType(g))!=null?n:s,isExecutable:!0,from:"bin"});else for(const[l,Du]of Object.entries(g))addExportPath(a,{outputPath:Du,type:(o=getFileType(Du))!=null?o:s,isExecutable:!0,from:`bin.${l}`})}if(e.exports){const g=parseExportsMap(e.exports,s);for(const l of g)addExportPath(a,l)}return Object.values(a)},externalProperties=["peerDependencies","dependencies","optionalDependencies"],getExternalDependencies=e=>{const t=[];for(const r of externalProperties){const n=e[r];n&&t.push(...Object.keys(n))}return t},getAliases=({imports:e},t)=>{const r={};if(e)for(const n in e){if(n.startsWith("#"))continue;const o=e[n];typeof o=="string"&&(r[n]=path__default$1.default.join(t,o))}return r},{stringify}=JSON;async function tryExtensions(e,t){for(const r of t){const n=e+r;if(await fsExists(n))return n}}const sourceExtensions={".d.ts":[".d.ts",".ts"],".js":[".js",".ts",".tsx"],".mjs":[".mjs",".js",".mts",".ts"],".cjs":[".cjs",".js",".cts",".ts"]};async function getSourcePath(e,t,r){if(!e.outputPath.startsWith(r))throw new Error(`Export path ${stringify(e.outputPath)} from ${stringify(`package.json#${e.from}`)} is not in directory ${r}`);const n=t+e.outputPath.slice(r.length);for(const o of Object.keys(sourceExtensions))if(e.outputPath.endsWith(o)){const a=await tryExtensions(n.slice(0,-o.length),sourceExtensions[o]);if(a)return a}throw new Error(`Could not find mathing source file for export path ${stringify(e.outputPath)}`)}var __defProp$2=Object.defineProperty,__defProps$2=Object.defineProperties,__getOwnPropDescs$2=Object.getOwnPropertyDescriptors,__getOwnPropSymbols$2=Object.getOwnPropertySymbols,__hasOwnProp$2=Object.prototype.hasOwnProperty,__propIsEnum$2=Object.prototype.propertyIsEnumerable,__defNormalProp$2=(e,t,r)=>t in e?__defProp$2(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,__spreadValues$2=(e,t)=>{for(var r in t||(t={}))__hasOwnProp$2.call(t,r)&&__defNormalProp$2(e,r,t[r]);if(__getOwnPropSymbols$2)for(var r of __getOwnPropSymbols$2(t))__propIsEnum$2.call(t,r)&&__defNormalProp$2(e,r,t[r]);return e},__spreadProps$2=(e,t)=>__defProps$2(e,__getOwnPropDescs$2(t));const virtualModuleName="pkgroll:create-require",isEsmVariableName=`IS_ESM${Math.random().toString(36).slice(2)}`,createRequire=()=>__spreadProps$2(__spreadValues$2({},inject__default.default({require:virtualModuleName})),{name:"create-require",resolveId:e=>e===virtualModuleName?e:null,load(e){return e!==virtualModuleName?null:`
|
|
23
23
|
import { createRequire } from 'module';
|
|
24
24
|
|
|
25
25
|
export default (
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
? createRequire(import.meta.url)
|
|
28
28
|
: require
|
|
29
29
|
);
|
|
30
|
-
`}}),isFormatEsm=e=>({name:"create-require-insert-format",renderChunk:replace__default.default({[isEsmVariableName]:e}).renderChunk});var path=path__default$1.default,fs=fs__default$1.default;function _interopDefaultLegacy$1(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var path__default=_interopDefaultLegacy$1(path),fs__default=_interopDefaultLegacy$1(fs);function slash(e){const t=/^\\\\\?\\/.test(e),r=/[^\u0000-\u0080]+/.test(e);return t||r?e:e.replace(/\\/g,"/")}function findConfigFile(e,t){for(;;){const r=path__default.default.join(e,t);if(fs__default.default.existsSync(r))return slash(r);const n=path__default.default.dirname(e);if(n===e)return;e=n}}var require$1=commonjsRequire;function createScanner(e,t){t===void 0&&(t=!1);var r=e.length,n=0,
|
|
31
|
-
`;break;case 114:ru+="\r";break;case 116:ru+=" ";break;case 117:var Fu=tu(4,!0);Fu>=0?ru+=String.fromCharCode(Fu):eu=4;break;default:eu=5}
|
|
32
|
-
`),g++,
|
|
33
|
-
`),{code:
|
|
30
|
+
`}}),isFormatEsm=e=>({name:"create-require-insert-format",renderChunk:replace__default.default({[isEsmVariableName]:e}).renderChunk});var path=path__default$1.default,fs=fs__default$1.default;function _interopDefaultLegacy$1(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var path__default=_interopDefaultLegacy$1(path),fs__default=_interopDefaultLegacy$1(fs);function slash(e){const t=/^\\\\\?\\/.test(e),r=/[^\u0000-\u0080]+/.test(e);return t||r?e:e.replace(/\\/g,"/")}function findConfigFile(e,t){for(;;){const r=path__default.default.join(e,t);if(fs__default.default.existsSync(r))return slash(r);const n=path__default.default.dirname(e);if(n===e)return;e=n}}var require$1=commonjsRequire;function createScanner(e,t){t===void 0&&(t=!1);var r=e.length,n=0,o="",a=0,s=16,g=0,l=0,Du=0,uu=0,eu=0;function tu(ru,cu){for(var pu=0,fu=0;pu<ru||!cu;){var Fu=e.charCodeAt(n);if(Fu>=48&&Fu<=57)fu=fu*16+Fu-48;else if(Fu>=65&&Fu<=70)fu=fu*16+Fu-65+10;else if(Fu>=97&&Fu<=102)fu=fu*16+Fu-97+10;else break;n++,pu++}return pu<ru&&(fu=-1),fu}function ou(ru){n=ru,o="",a=0,s=16,eu=0}function nu(){var ru=n;if(e.charCodeAt(n)===48)n++;else for(n++;n<e.length&&isDigit(e.charCodeAt(n));)n++;if(n<e.length&&e.charCodeAt(n)===46)if(n++,n<e.length&&isDigit(e.charCodeAt(n)))for(n++;n<e.length&&isDigit(e.charCodeAt(n));)n++;else return eu=3,e.substring(ru,n);var cu=n;if(n<e.length&&(e.charCodeAt(n)===69||e.charCodeAt(n)===101))if(n++,(n<e.length&&e.charCodeAt(n)===43||e.charCodeAt(n)===45)&&n++,n<e.length&&isDigit(e.charCodeAt(n))){for(n++;n<e.length&&isDigit(e.charCodeAt(n));)n++;cu=n}else eu=3;return e.substring(ru,cu)}function lu(){for(var ru="",cu=n;;){if(n>=r){ru+=e.substring(cu,n),eu=2;break}var pu=e.charCodeAt(n);if(pu===34){ru+=e.substring(cu,n),n++;break}if(pu===92){if(ru+=e.substring(cu,n),n++,n>=r){eu=2;break}var fu=e.charCodeAt(n++);switch(fu){case 34:ru+='"';break;case 92:ru+="\\";break;case 47:ru+="/";break;case 98:ru+="\b";break;case 102:ru+="\f";break;case 110:ru+=`
|
|
31
|
+
`;break;case 114:ru+="\r";break;case 116:ru+=" ";break;case 117:var Fu=tu(4,!0);Fu>=0?ru+=String.fromCharCode(Fu):eu=4;break;default:eu=5}cu=n;continue}if(pu>=0&&pu<=31)if(isLineBreak(pu)){ru+=e.substring(cu,n),eu=2;break}else eu=6;n++}return ru}function Cu(){if(o="",eu=0,a=n,l=g,uu=Du,n>=r)return a=r,s=17;var ru=e.charCodeAt(n);if(isWhiteSpace(ru)){do n++,o+=String.fromCharCode(ru),ru=e.charCodeAt(n);while(isWhiteSpace(ru));return s=15}if(isLineBreak(ru))return n++,o+=String.fromCharCode(ru),ru===13&&e.charCodeAt(n)===10&&(n++,o+=`
|
|
32
|
+
`),g++,Du=n,s=14;switch(ru){case 123:return n++,s=1;case 125:return n++,s=2;case 91:return n++,s=3;case 93:return n++,s=4;case 58:return n++,s=6;case 44:return n++,s=5;case 34:return n++,o=lu(),s=10;case 47:var cu=n-1;if(e.charCodeAt(n+1)===47){for(n+=2;n<r&&!isLineBreak(e.charCodeAt(n));)n++;return o=e.substring(cu,n),s=12}if(e.charCodeAt(n+1)===42){n+=2;for(var pu=r-1,fu=!1;n<pu;){var Fu=e.charCodeAt(n);if(Fu===42&&e.charCodeAt(n+1)===47){n+=2,fu=!0;break}n++,isLineBreak(Fu)&&(Fu===13&&e.charCodeAt(n)===10&&n++,g++,Du=n)}return fu||(n++,eu=1),o=e.substring(cu,n),s=13}return o+=String.fromCharCode(ru),n++,s=16;case 45:if(o+=String.fromCharCode(ru),n++,n===r||!isDigit(e.charCodeAt(n)))return s=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return o+=nu(),s=11;default:for(;n<r&&su(ru);)n++,ru=e.charCodeAt(n);if(a!==n){switch(o=e.substring(a,n),o){case"true":return s=8;case"false":return s=9;case"null":return s=7}return s=16}return o+=String.fromCharCode(ru),n++,s=16}}function su(ru){if(isWhiteSpace(ru)||isLineBreak(ru))return!1;switch(ru){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function au(){var ru;do ru=Cu();while(ru>=12&&ru<=15);return ru}return{setPosition:ou,getPosition:function(){return n},scan:t?au:Cu,getToken:function(){return s},getTokenValue:function(){return o},getTokenOffset:function(){return a},getTokenLength:function(){return n-a},getTokenStartLine:function(){return l},getTokenStartCharacter:function(){return a-uu},getTokenError:function(){return eu}}}function isWhiteSpace(e){return e===32||e===9||e===11||e===12||e===160||e===5760||e>=8192&&e<=8203||e===8239||e===8287||e===12288||e===65279}function isLineBreak(e){return e===10||e===13||e===8232||e===8233}function isDigit(e){return e>=48&&e<=57}var ParseOptions;(function(e){e.DEFAULT={allowTrailingComma:!1}})(ParseOptions||(ParseOptions={}));function parse$1(e,t,r){t===void 0&&(t=[]),r===void 0&&(r=ParseOptions.DEFAULT);var n=null,o=[],a=[];function s(l){Array.isArray(o)?o.push(l):n!==null&&(o[n]=l)}var g={onObjectBegin:function(){var l={};s(l),a.push(o),o=l,n=null},onObjectProperty:function(l){n=l},onObjectEnd:function(){o=a.pop()},onArrayBegin:function(){var l=[];s(l),a.push(o),o=l,n=null},onArrayEnd:function(){o=a.pop()},onLiteralValue:s,onError:function(l,Du,uu){t.push({error:l,offset:Du,length:uu})}};return visit(e,g,r),o[0]}function visit(e,t,r){r===void 0&&(r=ParseOptions.DEFAULT);var n=createScanner(e,!1);function o(iu){return iu?function(){return iu(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter())}:function(){return!0}}function a(iu){return iu?function(du){return iu(du,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter())}:function(){return!0}}var s=o(t.onObjectBegin),g=a(t.onObjectProperty),l=o(t.onObjectEnd),Du=o(t.onArrayBegin),uu=o(t.onArrayEnd),eu=a(t.onLiteralValue),tu=a(t.onSeparator),ou=o(t.onComment),nu=a(t.onError),lu=r&&r.disallowComments,Cu=r&&r.allowTrailingComma;function su(){for(;;){var iu=n.scan();switch(n.getTokenError()){case 4:au(14);break;case 5:au(15);break;case 3:au(13);break;case 1:lu||au(11);break;case 2:au(12);break;case 6:au(16);break}switch(iu){case 12:case 13:lu?au(10):ou();break;case 16:au(1);break;case 15:case 14:break;default:return iu}}}function au(iu,du,Eu){if(du===void 0&&(du=[]),Eu===void 0&&(Eu=[]),nu(iu),du.length+Eu.length>0)for(var gu=n.getToken();gu!==17;){if(du.indexOf(gu)!==-1){su();break}else if(Eu.indexOf(gu)!==-1)break;gu=su()}}function ru(iu){var du=n.getTokenValue();return iu?eu(du):g(du),su(),!0}function cu(){switch(n.getToken()){case 11:var iu=n.getTokenValue(),du=Number(iu);isNaN(du)&&(au(2),du=0),eu(du);break;case 7:eu(null);break;case 8:eu(!0);break;case 9:eu(!1);break;default:return!1}return su(),!0}function pu(){return n.getToken()!==10?(au(3,[],[2,5]),!1):(ru(!1),n.getToken()===6?(tu(":"),su(),hu()||au(4,[],[2,5])):au(5,[],[2,5]),!0)}function fu(){s(),su();for(var iu=!1;n.getToken()!==2&&n.getToken()!==17;){if(n.getToken()===5){if(iu||au(4,[],[]),tu(","),su(),n.getToken()===2&&Cu)break}else iu&&au(6,[],[]);pu()||au(4,[],[2,5]),iu=!0}return l(),n.getToken()!==2?au(7,[2],[]):su(),!0}function Fu(){Du(),su();for(var iu=!1;n.getToken()!==4&&n.getToken()!==17;){if(n.getToken()===5){if(iu||au(4,[],[]),tu(","),su(),n.getToken()===4&&Cu)break}else iu&&au(6,[],[]);hu()||au(4,[],[4,5]),iu=!0}return uu(),n.getToken()!==4?au(8,[4],[]):su(),!0}function hu(){switch(n.getToken()){case 3:return Fu();case 1:return fu();case 10:return ru(!0);default:return cu()}}return su(),n.getToken()===17?r.allowEmptyContent?!0:(au(4,[],[]),!1):hu()?(n.getToken()!==17&&au(9,[],[]),!0):(au(4,[],[]),!1)}var parse=parse$1;const normalizePath=e=>slash(/^[./]/.test(e)?e:`./${e}`);var __defProp$1=Object.defineProperty,__defProps$1=Object.defineProperties,__getOwnPropDescs$1=Object.getOwnPropertyDescriptors,__getOwnPropSymbols$1=Object.getOwnPropertySymbols,__hasOwnProp$1=Object.prototype.hasOwnProperty,__propIsEnum$1=Object.prototype.propertyIsEnumerable,__defNormalProp$1=(e,t,r)=>t in e?__defProp$1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,__spreadValues$1=(e,t)=>{for(var r in t||(t={}))__hasOwnProp$1.call(t,r)&&__defNormalProp$1(e,r,t[r]);if(__getOwnPropSymbols$1)for(var r of __getOwnPropSymbols$1(t))__propIsEnum$1.call(t,r)&&__defNormalProp$1(e,r,t[r]);return e},__spreadProps$1=(e,t)=>__defProps$1(e,__getOwnPropDescs$1(t));function readTsconfig(e){var t,r;const n=fs__default.default.realpathSync(e),o=path__default.default.dirname(n),a=fs__default.default.readFileSync(e,"utf8").trim();let s={};if(a&&(s=parse(a),!s||typeof s!="object"))throw new SyntaxError(`Failed to parse JSON: ${e}`);if(s.extends){let g=s.extends;try{g=require$1.resolve(g,{paths:[path__default.default.dirname(e)]})}catch(uu){if(uu.code==="MODULE_NOT_FOUND")try{g=require$1.resolve(path__default.default.join(g,"tsconfig.json"),{paths:[path__default.default.dirname(e)]})}catch{}}const l=readTsconfig(g);if(delete l.references,(t=l.compilerOptions)!=null&&t.baseUrl){const{compilerOptions:uu}=l;uu.baseUrl=path__default.default.relative(o,path__default.default.join(path__default.default.dirname(g),uu.baseUrl))}l.files&&(l.files=l.files.map(uu=>path__default.default.relative(o,path__default.default.join(path__default.default.dirname(g),uu)))),l.include&&(l.include=l.include.map(uu=>path__default.default.relative(o,path__default.default.join(path__default.default.dirname(g),uu)))),delete s.extends;const Du=__spreadProps$1(__spreadValues$1(__spreadValues$1({},l),s),{compilerOptions:__spreadValues$1(__spreadValues$1({},l.compilerOptions),s.compilerOptions)});l.watchOptions&&(Du.watchOptions=__spreadValues$1(__spreadValues$1({},l.watchOptions),s.watchOptions)),s=Du}if((r=s.compilerOptions)!=null&&r.baseUrl){const{compilerOptions:g}=s;g.baseUrl=normalizePath(g.baseUrl)}if(s.files&&(s.files=s.files.map(normalizePath)),s.include&&(s.include=s.include.map(slash)),s.watchOptions){const{watchOptions:g}=s;g.excludeDirectories&&(g.excludeDirectories=g.excludeDirectories.map(l=>slash(path__default.default.resolve(o,l))))}return s}function getTsconfig(e=process.cwd(),t="tsconfig.json"){const r=findConfigFile(e,t);if(!r)return null;const n=readTsconfig(r);return{path:r,config:n}}var dist=getTsconfig;const tsconfig=dist();var __defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,r)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,__spreadValues=(e,t)=>{for(var r in t||(t={}))__hasOwnProp.call(t,r)&&__defNormalProp(e,r,t[r]);if(__getOwnPropSymbols)for(var r of __getOwnPropSymbols(t))__propIsEnum.call(t,r)&&__defNormalProp(e,r,t[r]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t));function esbuildTransform(e){const t=pluginutils.createFilter(/\.([cm]?ts|[jt]sx)$/);return{name:"esbuild-transform",async transform(r,n){var o;if(!t(n))return null;const a=await esbuild.transform(r,__spreadProps(__spreadValues({},e),{loader:"default",sourcefile:n.replace(/\.[cm]ts/,".ts"),tsconfigRaw:(o=tsconfig)==null?void 0:o.config}));return{code:a.code,map:a.map||null}}}}function esbuildMinify(e){return{name:"esbuild-minify",async renderChunk(t){const r=await esbuild.transform(t,__spreadProps(__spreadValues({},e),{minify:!0}));return{code:r.code,map:r.map||null}}}}const compareSemver=(e,t)=>e[0]-t[0]||e[1]-t[1]||e[2]-t[2],externalizeNodeBuiltins=({target:e})=>{const t=e.some(r=>{var n,o;if(r=r.trim(),!r.startsWith("node"))return;const a=r.slice(4).split(".").map(Number),s=[a[0],(n=a[1])!=null?n:0,(o=a[2])!=null?o:0];return!(compareSemver(s,[12,20,0])>=0&&compareSemver(s,[13,0,0])<0||compareSemver(s,[14,13,1])>=0)});return{name:"externalize-node-builtins",resolveId:r=>{const n=r.startsWith("node:");if(t&&n&&(r=r.slice(5)),require$$2.builtinModules.includes(r)||n)return{id:r,external:!0}}}},patchBinary=e=>({name:"patch-binary",renderChunk(t,r,n){if(!r.isEntry||!r.facadeModuleId)return;const o=n.entryFileNames,a=`./${path__default$1.default.join(n.dir,o(r))}`;if(e.includes(a)){const s=new MagicString__default.default(t);return s.prepend(`#!/usr/bin/env node
|
|
33
|
+
`),{code:s.toString(),map:n.sourcemap?s.generateMap({hires:!0}):void 0}}},async writeBundle(t,r){const n=t.entryFileNames,o=Object.values(r).map(async a=>{const s=a;if(s.isEntry&&s.facadeModuleId){const g=path__default$1.default.join(t.dir,n(s));await fs__default$1.default.promises.chmod(g,493)}});await Promise.all(o)}});function resolveTypescriptMjsCts(){const e=/\.(?:mjs|cjs)$/,t=/\.(?:mts|cts)$/;return{name:"resolve-typescript-mjs-cjs",resolveId(r,n,o){return e.test(r)&&n&&t.test(n)?this.resolve(r.replace(/js$/,"ts"),n,o):null}}}const getConfig={async type(e){const t=await Promise.resolve().then(function(){return require("./rollup-plugin-dts-4870e282.js")});return{input:[],preserveEntrySignatures:"strict",plugins:[externalizeNodeBuiltins(e),resolveTypescriptMjsCts(),t.default({respectExternal:!0})],output:[],external:[]}},app(e,t,r){const n={target:e.target};return{input:[],preserveEntrySignatures:"strict",plugins:[externalizeNodeBuiltins(e),resolveTypescriptMjsCts(),alias__default.default({entries:t}),nodeResolve__default.default({extensions:[".mjs",".js",".ts",".jsx",".tsx",".json"],exportConditions:["node","import","require","default"]}),commonjs__default.default(),json__default.default(),esbuildTransform(n),createRequire(),...e.minify?[esbuildMinify(n)]:[],patchBinary(r)],output:[],external:[]}}};async function getRollupConfigs(e,t,r,n,o,a){const s=r.filter(({exportEntry:l})=>l.isExecutable).map(({exportEntry:l})=>l.outputPath),g=Object.create(null);for(const{input:l,exportEntry:Du}of r){if(Du.type==="types"){let nu=g.type;nu||(nu=await getConfig.type(n),nu.external=a,g.type=nu),nu.input.push(l);const lu=".d.ts";nu.output=[{dir:t,entryFileNames:Cu=>fs__default$1.default.realpathSync(Cu.facadeModuleId).slice(e.length).replace(/\.\w+$/,lu),exports:"auto",format:"esm"}];continue}let uu=g.app;uu||(uu=getConfig.app(n,o,s),uu.external=a,g.app=uu),uu.input.includes(l)||uu.input.push(l);const eu=uu.output,tu=path__default$1.default.extname(Du.outputPath),ou=`${Du.type}-${tu}`;if(!eu[ou]){const nu={dir:t,exports:"auto",format:Du.type,chunkFileNames:`[name]-[hash]${tu}`,plugins:[isFormatEsm(Du.type==="module")],entryFileNames:lu=>lu.facadeModuleId.slice(e.length).replace(/\.\w+$/,tu)};eu.push(nu),eu[ou]=nu}}return g}let enabled=!0;const globalVar=typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:{};let supportLevel=0;if(globalVar.process&&globalVar.process.env&&globalVar.process.stdout){const{FORCE_COLOR:e,NODE_DISABLE_COLORS:t,TERM:r}=globalVar.process.env;t||e==="0"?enabled=!1:e==="1"?enabled=!0:r==="dumb"?enabled=!1:"CI"in globalVar.process.env&&["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(n=>n in globalVar.process.env)?enabled=!0:enabled=process.stdout.isTTY,enabled&&(supportLevel=r&&r.endsWith("-256color")?2:1)}let options={enabled,supportLevel};function kolorist(e,t,r=1){const n=`\x1B[${e}m`,o=`\x1B[${t}m`,a=new RegExp(`\\x1b\\[${t}m`,"g");return s=>options.enabled&&options.supportLevel>=r?n+(""+s).replace(a,n)+o:""+s}const gray=kolorist(90,39),currentTime=()=>new Date().toLocaleTimeString(),log=(...e)=>console.log(`[${gray(currentTime())}]`,...e);var _a,_b;const argv=dist$1.cli({name:"pkgroll",flags:{src:{type:String,description:"Source directory",default:"./src"},dist:{type:String,description:"Distribution directory",default:"./dist"},minify:{type:Boolean,description:"Minify output",alias:"m",default:!1},target:{type:[String],default:[`node${process.versions.node}`],description:"Environments to support. `target` in tsconfig.json is automatically added. Defaults to the current Node.js version.",alias:"t"},watch:{type:Boolean,description:"Watch mode",alias:"w",default:!1}},help:{description:"Minimalistic package bundler"}}),cwd=process.cwd(),sourcePath=normalizePath$1(argv.flags.src,!0),distPath=normalizePath$1(argv.flags.dist,!0),tsconfigTarget=(_b=(_a=tsconfig)==null?void 0:_a.config.compilerOptions)==null?void 0:_b.target;tsconfigTarget&&argv.flags.target.push(tsconfigTarget),(async()=>{const e=await readPackageJson(cwd),t=getExportEntries(e);if(t.length===0)throw new Error("No export entries found in package.json");const r=await Promise.all(t.map(async s=>({input:await getSourcePath(s,sourcePath,distPath),exportEntry:s}))),n=getAliases(e,cwd),o=getExternalDependencies(e).filter(s=>!(s in n)).flatMap(s=>[s,new RegExp(`^${s}/`)]),a=await getRollupConfigs(normalizePath$1(fs__default$1.default.realpathSync(sourcePath),!0),distPath,r,argv.flags,n,o);argv.flags.watch?(log("Watch initialized"),Object.values(a).map(async s=>{rollup.watch(s).on("event",async l=>{l.code==="BUNDLE_START"&&log("Building",...Array.isArray(l.input)?l.input:[l.input]),l.code==="BUNDLE_END"&&(await Promise.all(s.output.map(Du=>l.result.write(Du))),log("Built",...Array.isArray(l.input)?l.input:[l.input])),l.code==="ERROR"&&log("Error:",l.error.message)})})):await Promise.all(Object.values(a).map(async s=>{const g=await rollup.rollup(s);return Promise.all(s.output.map(l=>g.write(l)))}))})().catch(e=>{console.error("Error:",e.message),process.exit(1)});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";var F=Object.defineProperty,A=Object.defineProperties;var $=Object.getOwnPropertyDescriptors;var I=Object.getOwnPropertySymbols;var L=Object.prototype.hasOwnProperty,K=Object.prototype.propertyIsEnumerable;var P=(n,e,t)=>e in n?F(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,N=(n,e)=>{for(var t in e||(e={}))L.call(e,t)&&P(n,t,e[t]);if(I)for(var t of I(e))K.call(e,t)&&P(n,t,e[t]);return n},b=(n,e)=>A(n,$(e));var require$$2=require("module"),path=require("path"),MagicString=require("magic-string");function _interopDefaultLegacy(n){return n&&typeof n=="object"&&"default"in n?n:{default:n}}function _interopNamespace(n){if(n&&n.__esModule)return n;var e=Object.create(null);return n&&Object.keys(n).forEach(function(t){if(t!=="default"){var r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:function(){return n[t]}})}}),e.default=n,Object.freeze(e)}var path__namespace=_interopNamespace(path),MagicString__default=_interopDefaultLegacy(MagicString),require$1=require;function getLocalTypescriptPath(){const n=process.cwd();try{return require$1.resolve("typescript",{paths:[n]})}catch{throw new Error(`Could not find \`typescript\` in ${n}`)}}var ts=require$1(getLocalTypescriptPath());const dts=".d.ts",formatHost={getCurrentDirectory:()=>ts.sys.getCurrentDirectory(),getNewLine:()=>ts.sys.newLine,getCanonicalFileName:ts.sys.useCaseSensitiveFileNames?n=>n:n=>n.toLowerCase()},DEFAULT_OPTIONS={declaration:!0,noEmit:!1,emitDeclarationOnly:!0,noEmitOnError:!0,checkJs:!1,declarationMap:!1,skipLibCheck:!0,preserveSymlinks:!0,target:ts.ScriptTarget.ESNext};function getCompilerOptions(n,e){const t=N(N({},DEFAULT_OPTIONS),e);let r=path__namespace.dirname(n),i=[];const a=ts.findConfigFile(r,ts.sys.fileExists);if(!a)return{dtsFiles:i,dirName:r,compilerOptions:t};r=path__namespace.dirname(a);const{config:c,error:o}=ts.readConfigFile(a,ts.sys.readFile);if(o)return console.error(ts.formatDiagnostic(o,formatHost)),{dtsFiles:i,dirName:r,compilerOptions:t};const{fileNames:l,options:u,errors:p}=ts.parseJsonConfigFileContent(c,ts.sys,r);return i=l.filter(m=>m.endsWith(dts)),p.length?(console.error(ts.formatDiagnostics(p,formatHost)),{dtsFiles:i,dirName:r,compilerOptions:t}):{dtsFiles:i,dirName:r,compilerOptions:N(N({},u),t)}}function createProgram$1(n,e){const{dtsFiles:t,compilerOptions:r}=getCompilerOptions(n,e);return ts.createProgram([n].concat(Array.from(t)),r,ts.createCompilerHost(r,!0))}function createPrograms(n,e){const t=[];let r=[],i=new Set,a="",c={};for(let o of n){if(o.endsWith(dts))continue;o=path__namespace.resolve(o);const l=getCompilerOptions(o,e);if(l.dtsFiles.forEach(i.add,i),!r.length){r.push(o),{dirName:a,compilerOptions:c}=l;continue}if(l.dirName===a)r.push(o);else{const u=ts.createCompilerHost(c,!0),p=ts.createProgram(r.concat(Array.from(i)),c,u);t.push(p),r=[o],{dirName:a,compilerOptions:c}=l}}if(r.length){const o=ts.createCompilerHost(c,!0),l=ts.createProgram(r.concat(Array.from(i)),c,o);t.push(l)}return t}function getCodeFrame(){let n;try{return{codeFrameColumns:n}=require$1("@babel/code-frame"),n}catch{try{return{codeFrameColumns:n}=require$$2.createRequire(typeof document=="undefined"?new(require("url")).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("rollup-plugin-dts-4870e282.js",document.baseURI).href)("@babel/code-frame"),n}catch{}}}function getLocation(n){const e=n.getSourceFile(),t=e.getLineAndCharacterOfPosition(n.getStart()),r=e.getLineAndCharacterOfPosition(n.getEnd());return{start:{line:t.line+1,column:t.character+1},end:{line:r.line+1,column:r.character+1}}}function frameNode(n){const e=getCodeFrame(),r=n.getSourceFile().getFullText(),i=getLocation(n);return e?`
|
|
2
|
+
`+e(r,i,{highlightCode:!0}):`
|
|
3
|
+
${i.start.line}:${i.start.column}: \`${n.getFullText().trim()}\``}class UnsupportedSyntaxError extends Error{constructor(e,t="Syntax not yet supported"){super(`${t}
|
|
4
|
+
${frameNode(e)}`)}}class NamespaceFixer{constructor(e){this.sourceFile=e}findNamespaces(){const e=[],t={};for(const r of this.sourceFile.statements){const i={start:r.getStart(),end:r.getEnd()};if(ts.isEmptyStatement(r)){e.unshift({name:"",exports:[],location:i});continue}if((ts.isImportDeclaration(r)||ts.isExportDeclaration(r))&&r.moduleSpecifier&&ts.isStringLiteral(r.moduleSpecifier)){let{text:p}=r.moduleSpecifier;if(p.startsWith(".")&&(p.endsWith(".d.ts")||p.endsWith(".d.cts")||p.endsWith(".d.mts"))){let m=r.moduleSpecifier.getStart()+1,g=r.moduleSpecifier.getEnd()-1;e.unshift({name:"",exports:[],location:{start:m,end:g},textBeforeCodeAfter:p.replace(/\.d\.ts$/,".js").replace(/\.d\.cts$/,".cjs").replace(/\.d\.mts$/,".mjs")})}}if(ts.isModuleDeclaration(r)&&r.body&&ts.isModuleBlock(r.body)){for(const p of r.body.statements)if(ts.isExportDeclaration(p)&&p.exportClause){if(ts.isNamespaceExport(p.exportClause))continue;for(const m of p.exportClause.elements)m.propertyName&&m.propertyName.getText()==m.name.getText()&&e.unshift({name:"",exports:[],location:{start:m.propertyName.getEnd(),end:m.name.getEnd()}})}}if(ts.isClassDeclaration(r)?t[r.name.getText()]={type:"class",generics:r.typeParameters}:ts.isFunctionDeclaration(r)?t[r.name.getText()]={type:"function"}:ts.isInterfaceDeclaration(r)?t[r.name.getText()]={type:"interface",generics:r.typeParameters}:ts.isTypeAliasDeclaration(r)?t[r.name.getText()]={type:"type",generics:r.typeParameters}:ts.isModuleDeclaration(r)&&ts.isIdentifier(r.name)?t[r.name.getText()]={type:"namespace"}:ts.isEnumDeclaration(r)&&(t[r.name.getText()]={type:"enum"}),!ts.isVariableStatement(r))continue;const{declarations:a}=r.declarationList;if(a.length!==1)continue;const c=a[0],o=c.name.getText();if(!c.initializer||!ts.isCallExpression(c.initializer)){t[o]={type:"var"};continue}const l=c.initializer.arguments[0];if(!c.initializer.expression.getFullText().includes("/*#__PURE__*/Object.freeze")||!ts.isObjectLiteralExpression(l))continue;const u=[];for(const p of l.properties){if(!ts.isPropertyAssignment(p)||!(ts.isIdentifier(p.name)||ts.isStringLiteral(p.name))||p.name.text!=="__proto__"&&!ts.isIdentifier(p.initializer))throw new UnsupportedSyntaxError(p,"Expected a property assignment");p.name.text!=="__proto__"&&u.push({exportedName:p.name.text,localName:p.initializer.getText()})}e.unshift({name:o,exports:u,location:i})}return{namespaces:e,itemTypes:t}}fix(){var e;let t=this.sourceFile.getFullText();const{namespaces:r,itemTypes:i}=this.findNamespaces();for(const a of r){const c=t.slice(a.location.end);t=t.slice(0,a.location.start);for(const{exportedName:o,localName:l}of a.exports)if(o===l){const{type:u,generics:p}=i[l]||{};if(u==="interface"||u==="type"){const m=renderTypeParams(p);t+=`type ${a.name}_${o}${m.in} = ${l}${m.out};
|
|
5
|
+
`}else if(u==="enum"||u==="class"){const m=renderTypeParams(p);t+=`type ${a.name}_${o}${m.in} = ${l}${m.out};
|
|
6
|
+
`,t+=`declare const ${a.name}_${o}: typeof ${l};
|
|
7
|
+
`}else t+=`declare const ${a.name}_${o}: typeof ${l};
|
|
8
|
+
`}if(a.name){t+=`declare namespace ${a.name} {
|
|
9
|
+
`,t+=` export {
|
|
10
|
+
`;for(const{exportedName:o,localName:l}of a.exports)o===l?t+=` ${a.name}_${o} as ${o},
|
|
11
|
+
`:t+=` ${l} as ${o},
|
|
12
|
+
`;t+=` };
|
|
13
|
+
`,t+="}"}t+=(e=a.textBeforeCodeAfter)!==null&&e!==void 0?e:"",t+=c}return t}}function renderTypeParams(n){return!n||!n.length?{in:"",out:""}:{in:`<${n.map(e=>e.getText()).join(", ")}>`,out:`<${n.map(e=>e.name.getText()).join(", ")}>`}}let IDs=1;function createProgram(n){return withStartEnd({type:"Program",sourceType:"module",body:[]},{start:n.getFullStart(),end:n.getEnd()})}function createReference(n){return{type:"AssignmentPattern",left:{type:"Identifier",name:String(IDs++)},right:n}}function createIdentifier(n){return withStartEnd({type:"Identifier",name:n.getText()},n)}function createIIFE(n){const e=withStartEnd({type:"FunctionExpression",id:null,params:[],body:{type:"BlockStatement",body:[]}},n),t=withStartEnd({type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"Identifier",name:String(IDs++)},arguments:[e],optional:!1}},n);return{fn:e,iife:t}}function createDeclaration(n,e){return withStartEnd({type:"FunctionDeclaration",id:withStartEnd({type:"Identifier",name:ts.idText(n)},n),params:[],body:{type:"BlockStatement",body:[]}},e)}function convertExpression(n){if(ts.isLiteralExpression(n))return{type:"Literal",value:n.text};if(ts.isPropertyAccessExpression(n)){if(ts.isPrivateIdentifier(n.name))throw new UnsupportedSyntaxError(n.name);return withStartEnd({type:"MemberExpression",computed:!1,optional:!1,object:convertExpression(n.expression),property:convertExpression(n.name)},{start:n.expression.getStart(),end:n.name.getEnd()})}if(ts.isIdentifier(n))return createIdentifier(n);if(n.kind==ts.SyntaxKind.NullKeyword)return{type:"Literal",value:null};throw new UnsupportedSyntaxError(n)}function withStartEnd(n,e){let t="start"in e?e:{start:e.getStart(),end:e.getEnd()};return Object.assign(n,t)}function matchesModifier(n,e){return(ts.getCombinedModifierFlags(n)&e)===e}function preProcess({sourceFile:n}){const e=new MagicString__default.default(n.getFullText()),t=new Set,r=new Set;let i="";const a=new Map,c=new Map;for(const s of n.statements){if(ts.isEmptyStatement(s)){e.remove(s.getStart(),s.getEnd());continue}if(ts.isEnumDeclaration(s)||ts.isFunctionDeclaration(s)||ts.isInterfaceDeclaration(s)||ts.isClassDeclaration(s)||ts.isTypeAliasDeclaration(s)||ts.isModuleDeclaration(s)){if(s.name){const f=s.name.getText();t.add(f),matchesModifier(s,ts.ModifierFlags.ExportDefault)?i=f:matchesModifier(s,ts.ModifierFlags.Export)&&r.add(f),s.flags&ts.NodeFlags.GlobalAugmentation||D(f,[getStart(s),getEnd(s)])}ts.isModuleDeclaration(s)&&duplicateExports(e,s),fixModifiers(e,s)}else if(ts.isVariableStatement(s)){const{declarations:f}=s.declarationList,y=matchesModifier(s,ts.ModifierFlags.Export);for(const h of s.declarationList.declarations)if(ts.isIdentifier(h.name)){const x=h.name.getText();t.add(x),y&&r.add(x)}if(fixModifiers(e,s),f.length==1){const h=f[0];ts.isIdentifier(h.name)&&D(h.name.getText(),[getStart(s),getEnd(s)])}else{const h=f.slice(),x=h.shift();D(x.name.getText(),[getStart(s),x.getEnd()]);for(const T of h)ts.isIdentifier(T.name)&&D(T.name.getText(),[T.getFullStart(),T.getEnd()])}const{flags:d}=s.declarationList,E=`declare ${d&ts.NodeFlags.Let?"let":d&ts.NodeFlags.Const?"const":"var"} `,w=s.declarationList.getChildren().find(h=>h.kind===ts.SyntaxKind.SyntaxList).getChildren();let S=0;for(const h of w)if(h.kind===ts.SyntaxKind.CommaToken)S=h.getStart(),e.remove(S,h.getEnd());else if(S){e.appendLeft(S,`;
|
|
14
|
+
`);const x=h.getFullStart(),T=e.slice(x,h.getStart());let C=T.length-T.trimStart().length;C?e.overwrite(x,x+C,E):e.appendLeft(x,E)}}}for(const s of n.statements)if(p(s),!!matchesModifier(s,ts.ModifierFlags.ExportDefault)&&(ts.isFunctionDeclaration(s)||ts.isClassDeclaration(s))){if(s.name)continue;i||(i=g("export_default"));const f=s.getChildren(),y=f.findIndex(w=>w.kind===ts.SyntaxKind.ClassKeyword||w.kind===ts.SyntaxKind.FunctionKeyword),d=f[y],v=f[y+1];v.kind>=ts.SyntaxKind.FirstPunctuation&&v.kind<=ts.SyntaxKind.LastPunctuation?e.appendLeft(v.getStart(),i):e.appendRight(d.getEnd(),` ${i}`)}for(const s of c.values()){const y=s.pop()[0];for(const d of s)e.move(d[0],d[1],y)}i&&e.append(`
|
|
15
|
+
export default ${i};
|
|
16
|
+
`),r.size&&e.append(`
|
|
17
|
+
export { ${[...r].join(", ")} };
|
|
18
|
+
`);for(const[s,f]of a.entries())e.prepend(`import * as ${f} from "${s}";
|
|
19
|
+
`);const o=n.getLineStarts(),l=new Set;for(const s of n.typeReferenceDirectives){l.add(s.fileName);const{line:f}=n.getLineAndCharacterOfPosition(s.pos),y=o[f];let d=n.getLineEndOfPosition(s.pos);e.slice(d,d+1)==`
|
|
20
|
+
`&&(d+=1),e.remove(y,d)}const u=new Set;for(const s of n.referencedFiles){u.add(path__namespace.join(path__namespace.dirname(n.fileName),s.fileName));const{line:f}=n.getLineAndCharacterOfPosition(s.pos),y=o[f];let d=n.getLineEndOfPosition(s.pos);e.slice(d,d+1)==`
|
|
21
|
+
`&&(d+=1),e.remove(y,d)}return{code:e,typeReferences:l,fileReferences:u};function p(s){if(ts.forEachChild(s,p),ts.isImportTypeNode(s)){if(!ts.isLiteralTypeNode(s.argument)||!ts.isStringLiteral(s.argument.literal))throw new UnsupportedSyntaxError(s,"inline imports should have a literal argument");const f=s.argument.literal.text,y=s.getChildren(),d=y.find(S=>S.kind===ts.SyntaxKind.ImportKeyword).getStart();let v=s.getEnd();const E=y.find(S=>S.kind===ts.SyntaxKind.DotToken||S.kind===ts.SyntaxKind.LessThanToken);E&&(v=E.getStart());const w=m(f);e.overwrite(d,v,w)}}function m(s){let f=a.get(s);return f||(f=g(s.replace(/[^a-zA-Z0-9_$]/g,()=>"_")),a.set(s,f)),f}function g(s){let f=s;for(;t.has(f);)f=`_${f}`;return t.add(f),f}function D(s,f){let y=c.get(s);if(!y)y=[f],c.set(s,y);else{const d=y[y.length-1];d[1]===f[0]?d[1]=f[1]:y.push(f)}}}function fixModifiers(n,e){var t;let r=!1;const i=ts.isClassDeclaration(e)||ts.isFunctionDeclaration(e)||ts.isModuleDeclaration(e)||ts.isVariableStatement(e);for(const a of(t=e.modifiers)!==null&&t!==void 0?t:[])switch(a.kind){case ts.SyntaxKind.ExportKeyword:case ts.SyntaxKind.DefaultKeyword:n.remove(a.getStart(),a.getEnd()+1);break;case ts.SyntaxKind.DeclareKeyword:r=!0}i&&!r&&n.appendRight(e.getStart(),"declare ")}function duplicateExports(n,e){if(!(!e.body||!ts.isModuleBlock(e.body))){for(const t of e.body.statements)if(ts.isExportDeclaration(t)&&t.exportClause){if(ts.isNamespaceExport(t.exportClause))continue;for(const r of t.exportClause.elements)r.propertyName||n.appendLeft(r.name.getEnd(),` as ${r.name.getText()}`)}}}function getStart(n){const e=n.getFullStart();return e+(newlineAt(n,e)?1:0)}function getEnd(n){const e=n.getEnd();return e+(newlineAt(n,e)?1:0)}function newlineAt(n,e){return n.getSourceFile().getFullText()[e]==`
|
|
22
|
+
`}const IGNORE_TYPENODES=new Set([ts.SyntaxKind.LiteralType,ts.SyntaxKind.VoidKeyword,ts.SyntaxKind.UnknownKeyword,ts.SyntaxKind.AnyKeyword,ts.SyntaxKind.BooleanKeyword,ts.SyntaxKind.NumberKeyword,ts.SyntaxKind.StringKeyword,ts.SyntaxKind.ObjectKeyword,ts.SyntaxKind.NullKeyword,ts.SyntaxKind.UndefinedKeyword,ts.SyntaxKind.SymbolKeyword,ts.SyntaxKind.NeverKeyword,ts.SyntaxKind.ThisKeyword,ts.SyntaxKind.ThisType,ts.SyntaxKind.BigIntKeyword]);class DeclarationScope{constructor({id:e,range:t}){if(this.scopes=[],e)this.declaration=createDeclaration(e,t);else{const{iife:r,fn:i}=createIIFE(t);this.iife=r,this.declaration=i}}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||t.add(r)}pushRaw(e){this.declaration.params.push(e)}pushReference(e){let t;if(e.type==="Identifier"?t=e.name:e.type==="MemberExpression"&&e.object.type==="Identifier"&&(t=e.object.name),t){for(const r of this.scopes)if(r.has(t))return}this.pushRaw(createReference(e))}pushIdentifierReference(e){this.pushReference(createIdentifier(e))}convertEntityName(e){return ts.isIdentifier(e)?createIdentifier(e):withStartEnd({type:"MemberExpression",computed:!1,optional:!1,object:this.convertEntityName(e.left),property:createIdentifier(e.right)},e)}convertPropertyAccess(e){if(!ts.isIdentifier(e.expression)&&!ts.isPropertyAccessExpression(e.expression))throw new UnsupportedSyntaxError(e.expression);if(ts.isPrivateIdentifier(e.name))throw new UnsupportedSyntaxError(e.name);let t=ts.isIdentifier(e.expression)?createIdentifier(e.expression):this.convertPropertyAccess(e.expression);return withStartEnd({type:"MemberExpression",computed:!1,optional:!1,object:t,property:createIdentifier(e.name)},e)}convertComputedPropertyName(e){if(!e.name||!ts.isComputedPropertyName(e.name))return;const{expression:t}=e.name;if(!ts.isLiteralExpression(t)){if(ts.isIdentifier(t))return this.pushReference(createIdentifier(t));if(ts.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 r of e.parameters)this.convertTypeNode(r.type);this.convertTypeNode(e.type),this.popScope(t)}convertHeritageClauses(e){for(const t of e.heritageClauses||[])for(const r of t.types)this.pushReference(convertExpression(r.expression)),this.convertTypeArguments(r)}convertTypeArguments(e){if(!!e.typeArguments)for(const t of e.typeArguments)this.convertTypeNode(t)}convertMembers(e){for(const t of e){if(ts.isPropertyDeclaration(t)||ts.isPropertySignature(t)||ts.isIndexSignatureDeclaration(t)){this.convertComputedPropertyName(t),this.convertTypeNode(t.type);continue}if(ts.isMethodDeclaration(t)||ts.isMethodSignature(t)||ts.isConstructorDeclaration(t)||ts.isConstructSignatureDeclaration(t)||ts.isCallSignatureDeclaration(t)||ts.isGetAccessorDeclaration(t)||ts.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&&!IGNORE_TYPENODES.has(e.kind)){if(ts.isTypeReferenceNode(e)){this.pushReference(this.convertEntityName(e.typeName)),this.convertTypeArguments(e);return}if(ts.isTypeLiteralNode(e))return this.convertMembers(e.members);if(ts.isArrayTypeNode(e))return this.convertTypeNode(e.elementType);if(ts.isTupleTypeNode(e)){for(const t of e.elements)this.convertTypeNode(t);return}if(ts.isNamedTupleMember(e)||ts.isParenthesizedTypeNode(e)||ts.isTypeOperatorNode(e)||ts.isTypePredicateNode(e))return this.convertTypeNode(e.type);if(ts.isUnionTypeNode(e)||ts.isIntersectionTypeNode(e)){for(const t of e.types)this.convertTypeNode(t);return}if(ts.isMappedTypeNode(e)){const{typeParameter:t,type:r,nameType:i}=e;this.convertTypeNode(t.constraint),this.pushScope(),this.pushTypeVariable(t.name),this.convertTypeNode(r),i&&this.convertTypeNode(i),this.popScope();return}if(ts.isConditionalTypeNode(e)){this.convertTypeNode(e.checkType),this.pushScope(),this.convertTypeNode(e.extendsType),this.convertTypeNode(e.trueType),this.convertTypeNode(e.falseType),this.popScope();return}if(ts.isIndexedAccessTypeNode(e)){this.convertTypeNode(e.objectType),this.convertTypeNode(e.indexType);return}if(ts.isFunctionOrConstructorTypeNode(e)){this.convertParametersAndType(e);return}if(ts.isTypeQueryNode(e)){this.pushReference(this.convertEntityName(e.exprName));return}if(ts.isRestTypeNode(e)){this.convertTypeNode(e.type);return}if(ts.isOptionalTypeNode(e)){this.convertTypeNode(e.type);return}if(ts.isTemplateLiteralTypeNode(e)){for(const t of e.templateSpans)this.convertTypeNode(t.type);return}if(ts.isInferTypeNode(e)){this.pushTypeVariable(e.typeParameter.name);return}else throw new UnsupportedSyntaxError(e)}}convertNamespace(e,t=!1){if(this.pushScope(),t&&e.body&&ts.isModuleDeclaration(e.body)){this.convertNamespace(e.body,!0);return}if(!e.body||!ts.isModuleBlock(e.body))throw new UnsupportedSyntaxError(e,'namespace must have a "ModuleBlock" body.');const{statements:r}=e.body;for(const i of r){if(ts.isEnumDeclaration(i)||ts.isFunctionDeclaration(i)||ts.isClassDeclaration(i)||ts.isInterfaceDeclaration(i)||ts.isTypeAliasDeclaration(i)||ts.isModuleDeclaration(i)){if(i.name&&ts.isIdentifier(i.name))this.pushTypeVariable(i.name);else throw new UnsupportedSyntaxError(i,"non-Identifier name not supported");continue}if(ts.isVariableStatement(i)){for(const a of i.declarationList.declarations)if(ts.isIdentifier(a.name))this.pushTypeVariable(a.name);else throw new UnsupportedSyntaxError(a,"non-Identifier name not supported");continue}if(!ts.isExportDeclaration(i))throw new UnsupportedSyntaxError(i,"namespace child (hoisting) not supported yet")}for(const i of r){if(ts.isVariableStatement(i)){for(const a of i.declarationList.declarations)a.type&&this.convertTypeNode(a.type);continue}if(ts.isFunctionDeclaration(i)){this.convertParametersAndType(i);continue}if(ts.isInterfaceDeclaration(i)||ts.isClassDeclaration(i)){const a=this.convertTypeParameters(i.typeParameters);this.convertHeritageClauses(i),this.convertMembers(i.members),this.popScope(a);continue}if(ts.isTypeAliasDeclaration(i)){const a=this.convertTypeParameters(i.typeParameters);this.convertTypeNode(i.type),this.popScope(a);continue}if(ts.isModuleDeclaration(i)){this.convertNamespace(i,t);continue}if(!ts.isEnumDeclaration(i))if(ts.isExportDeclaration(i)){if(i.exportClause){if(ts.isNamespaceExport(i.exportClause))throw new UnsupportedSyntaxError(i.exportClause);for(const a of i.exportClause.elements){const c=a.propertyName||a.name;this.pushIdentifierReference(c)}}}else throw new UnsupportedSyntaxError(i,"namespace child (walking) not supported yet")}this.popScope()}}function convert({sourceFile:n}){return new Transformer(n).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 o=new DeclarationScope({range:r});return this.pushStatement(o.iife),o}const i=t.getText(),a=new DeclarationScope({id:t,range:r}),c=this.declarations.get(i);if(c){c.pushIdentifierReference(t),c.declaration.end=r.end;let o=this.ast.body.findIndex(l=>l==c.declaration);for(let l=o+1;l<this.ast.body.length;l++){const u=this.ast.body[l];u.start=u.end=r.end}}else this.pushStatement(a.declaration),this.declarations.set(i,a);return c||a}convertStatement(e){if(ts.isEnumDeclaration(e))return this.convertEnumDeclaration(e);if(ts.isFunctionDeclaration(e))return this.convertFunctionDeclaration(e);if(ts.isInterfaceDeclaration(e)||ts.isClassDeclaration(e))return this.convertClassOrInterfaceDeclaration(e);if(ts.isTypeAliasDeclaration(e))return this.convertTypeAliasDeclaration(e);if(ts.isVariableStatement(e))return this.convertVariableStatement(e);if(ts.isExportDeclaration(e)||ts.isExportAssignment(e))return this.convertExportDeclaration(e);if(ts.isModuleDeclaration(e))return this.convertNamespaceDeclaration(e);if(e.kind==ts.SyntaxKind.NamespaceExportDeclaration)return this.removeStatement(e);if(ts.isImportDeclaration(e)||ts.isImportEqualsDeclaration(e))return this.convertImportDeclaration(e);throw new UnsupportedSyntaxError(e)}removeStatement(e){this.pushStatement(withStartEnd({type:"ExpressionStatement",expression:{type:"Literal",value:"pls remove me"}},e))}convertNamespaceDeclaration(e){if(e.flags&ts.NodeFlags.GlobalAugmentation||!ts.isIdentifier(e.name)){this.createDeclaration(e).convertNamespace(e,!0);return}const r=this.createDeclaration(e,e.name);r.pushIdentifierReference(e.name),r.convertNamespace(e)}convertEnumDeclaration(e){this.createDeclaration(e,e.name).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),r=t.convertTypeParameters(e.typeParameters);t.convertHeritageClauses(e),t.convertMembers(e.members),t.popScope(r)}convertTypeAliasDeclaration(e){const t=this.createDeclaration(e,e.name),r=t.convertTypeParameters(e.typeParameters);t.convertTypeNode(e.type),t.popScope(r)}convertVariableStatement(e){const{declarations:t}=e.declarationList;if(t.length!==1)throw new UnsupportedSyntaxError(e,"VariableStatement with more than one declaration not yet supported");for(const r of t){if(!ts.isIdentifier(r.name))throw new UnsupportedSyntaxError(e,"VariableDeclaration must have a name");this.createDeclaration(e,r.name).convertTypeNode(r.type)}}convertExportDeclaration(e){if(ts.isExportAssignment(e)){this.pushStatement(withStartEnd({type:"ExportDefaultDeclaration",declaration:convertExpression(e.expression)},e));return}const t=e.moduleSpecifier?convertExpression(e.moduleSpecifier):void 0;if(!e.exportClause)this.pushStatement(withStartEnd({type:"ExportAllDeclaration",source:t,exported:null},e));else if(ts.isNamespaceExport(e.exportClause))this.pushStatement(withStartEnd({type:"ExportAllDeclaration",source:t,exported:createIdentifier(e.exportClause.name)},e));else{const r=[];for(const i of e.exportClause.elements)r.push(this.convertExportSpecifier(i));this.pushStatement(withStartEnd({type:"ExportNamedDeclaration",declaration:null,specifiers:r,source:t},e))}}convertImportDeclaration(e){if(ts.isImportEqualsDeclaration(e)){if(!ts.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),r=e.importClause&&e.importClause.namedBindings?this.convertNamedImportBindings(e.importClause.namedBindings):[];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){return ts.isNamedImports(e)?e.elements.map(t=>{const r=createIdentifier(t.name),i=t.propertyName?createIdentifier(t.propertyName):r;return{type:"ImportSpecifier",local:r,imported:i}}):[{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(n,e){return ts.createSourceFile(n,e,ts.ScriptTarget.Latest,!0)}const transform=()=>{const n=new Map,e=new Map;return{name:"dts-transform",options(t){const{onwarn:r}=t;return b(N({},t),{onwarn(i,a){i.code!="CIRCULAR_DEPENDENCY"&&(r?r(i,a):a(i))},treeshake:{moduleSideEffects:"no-external",propertyReadSideEffects:!0,unknownGlobalSideEffects:!1}})},outputOptions(t){return b(N({},t),{chunkFileNames:t.chunkFileNames||"[name]-[hash].d.ts",entryFileNames:t.entryFileNames||"[name].d.ts",format:"es",exports:"named",compact:!1,freeze:!0,interop:!1,namespaceToStringTag:!1,strict:!1})},transform(t,r){let i=parse(r,t);const a=preProcess({sourceFile:i});n.set(i.fileName,a.typeReferences),e.set(i.fileName,a.fileReferences),t=a.code.toString(),i=parse(r,t);const c=convert({sourceFile:i});return process.env.DTS_DUMP_AST&&(console.log(r),console.log(t),console.log(JSON.stringify(c.ast.body,void 0,2))),{code:t,ast:c.ast,map:a.code.generateMap()}},renderChunk(t,r,i){const a=parse(r.fileName,t),c=new NamespaceFixer(a),o=new Set,l=new Set;for(const u of Object.keys(r.modules)){for(const p of n.get(u.split("\\").join("/"))||[])o.add(p);for(const p of e.get(u.split("\\").join("/"))||[]){const m=i.file&&path__namespace.dirname(i.file)||r.facadeModuleId&&path__namespace.dirname(r.facadeModuleId)||".";let g=path__namespace.relative(m,p).split("\\").join("/");g[0]!=="."&&(g="./"+g),l.add(g)}}return t=writeBlock(Array.from(l,u=>`/// <reference path="${u}" />`)),t+=writeBlock(Array.from(o,u=>`/// <reference types="${u}" />`)),t+=c.fix(),{code:t,map:{mappings:""}}}}};function writeBlock(n){return n.length?n.join(`
|
|
23
|
+
`)+`
|
|
24
|
+
`:""}const tsx=/\.(t|j)sx?$/,plugin=(n={})=>{const e=transform(),{respectExternal:t=!1,compilerOptions:r={}}=n;let i=[];function a(c){let o,l;return!i.length&&c.endsWith(dts)?o=!0:(l=i.find(u=>o=u.getSourceFile(c)),!l&&ts.sys.fileExists(c)&&(i.push(l=createProgram$1(c,r)),o=l.getSourceFile(c))),{source:o,program:l}}return{name:"dts",options(c){let{input:o=[]}=c;if(!Array.isArray(o))o=typeof o=="string"?[o]:Object.values(o);else if(o.length>1){c.input={};for(const l of o){let u=l.replace(/((\.d)?\.(t|j)sx?)$/,"");path__namespace.isAbsolute(l)?u=path__namespace.basename(u):u=path__namespace.normalize(u),c.input[u]=l}}return i=createPrograms(Object.values(o),r),e.options.call(this,c)},outputOptions:e.outputOptions,transform(c,o){const l=(s,f)=>(typeof s=="object"&&(c=s.getFullText()),e.transform.call(this,c,f));if(!tsx.test(o))return null;if(o.endsWith(dts)){const{source:s}=a(o);return s?l(s,o):null}const u=o.replace(tsx,dts);let p=a(u);if(p.source)return l(p.source,u);if(p=a(o),typeof p.source!="object"||!p.program)return null;let m;const{emitSkipped:g,diagnostics:D}=p.program.emit(p.source,(s,f)=>{c=f,m=l(!0,u)},void 0,!0);if(g){const s=D.filter(f=>f.category===ts.DiagnosticCategory.Error);s.length&&(console.error(ts.formatDiagnostics(s,formatHost)),this.error("Failed to compile. Check the logs above."))}return m},resolveId(c,o){if(!o)return;o=o.split("\\").join("/");const{resolvedModule:l}=ts.nodeModuleNameResolver(c,o,r,ts.sys);if(!!l)return!t&&l.isExternalLibraryImport?{id:c,external:!0}:{id:path__namespace.resolve(l.resolvedFileName)}},renderChunk:e.renderChunk}};exports.default=plugin;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pkgroll",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Zero-config rollup bundler",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"zero config",
|
|
@@ -25,7 +25,8 @@
|
|
|
25
25
|
],
|
|
26
26
|
"bin": "dist/cli.js",
|
|
27
27
|
"scripts": {
|
|
28
|
-
"
|
|
28
|
+
"Target is 12.20 for import(), node: prefix is not used": "",
|
|
29
|
+
"build": "esno src/cli.ts --minify --target node12.20",
|
|
29
30
|
"pretest": "npm run build",
|
|
30
31
|
"test": "esno tests/index.ts",
|
|
31
32
|
"lint": "eslint --cache ."
|
|
@@ -45,7 +46,7 @@
|
|
|
45
46
|
"typescript": "./src/local-typescript-loader.ts"
|
|
46
47
|
},
|
|
47
48
|
"peerDependencies": {
|
|
48
|
-
"typescript": "
|
|
49
|
+
"typescript": "^4.1"
|
|
49
50
|
},
|
|
50
51
|
"peerDependenciesMeta": {
|
|
51
52
|
"typescript": {
|
|
@@ -73,14 +74,14 @@
|
|
|
73
74
|
"esno": "^0.14.1",
|
|
74
75
|
"execa": "^6.1.0",
|
|
75
76
|
"get-node": "^12.1.0",
|
|
76
|
-
"get-tsconfig": "^3.0.
|
|
77
|
+
"get-tsconfig": "^3.0.1",
|
|
77
78
|
"husky": "^4.3.8",
|
|
78
79
|
"kolorist": "^1.5.1",
|
|
79
80
|
"lint-staged": "^12.3.7",
|
|
80
81
|
"manten": "^0.0.3",
|
|
81
82
|
"rimraf": "^3.0.2",
|
|
82
83
|
"rollup-plugin-dts": "^4.2.0",
|
|
83
|
-
"type-fest": "^2.12.
|
|
84
|
+
"type-fest": "^2.12.2",
|
|
84
85
|
"typescript": "^4.6.3"
|
|
85
86
|
},
|
|
86
87
|
"eslintConfig": {
|