@visulima/packem 1.7.3 → 1.8.1

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/dist/cli.mjs CHANGED
@@ -1,45 +1,45 @@
1
1
  #!/usr/bin/env node
2
- var vo=Object.defineProperty;var g=(e,t)=>vo(e,"name",{value:t,configurable:!0});import ho from"@visulima/cerebro";import{SimpleReporter as xo}from"@visulima/pail/reporter";import ot,{cwd as di,env as Fe,versions as yo,exit as bo}from"node:process";import{installPackage as mt}from"@antfu/install-pkg";import{spinner as ut,select as ie,multiselect as mi,confirm as U,intro as wo,log as Ct,cancel as ko,outro as jo}from"@clack/prompts";import{isAccessible as Ve,readFile as Oe,writeFile as ui,isAccessibleSync as z,readFileSync as Ke,writeFileSync as le,readJsonSync as fi,writeJsonSync as wt,ensureDir as Nt,walk as $o,collectSync as Eo,emptyDir as So,readJson as Oo,ensureDirSync as Do}from"@visulima/fs";import{join as j,resolve as E,normalize as K,relative as _,dirname as M,basename as ne,isAbsolute as fe,parse as nt,toNamespacedPath as Re,extname as He}from"@visulima/path";import Y from"magic-string";import _t,{isBuiltin as at}from"node:module";import{cyan as P,green as Po,bold as V,gray as ee,yellow as Co,grey as No}from"@visulima/colorize";import{findCacheDirSync as _o}from"@visulima/find-cache-dir";import{formatBytes as Z,duration as Tt}from"@visulima/humanizer";import{readTsConfig as To,findTsConfig as Mo}from"@visulima/tsconfig";import Io from"browserslist";import{defu as Ao}from"defu";import{createHooks as zo}from"hookable";import{createJiti as gi}from"jiti";import{rollup as vi,watch as Mt,VERSION as Fo}from"rollup";import{exec as Ro}from"tinyexec";import{stat as kt,chmod as Lo,readFile as Jo,readdir as Bo,rm as qo}from"node:fs/promises";import hi from"@rollup/plugin-alias";import Wo from"@rollup/plugin-commonjs";import Uo from"@rollup/plugin-dynamic-import-vars";import{nodeResolve as xi}from"@rollup/plugin-node-resolve";import yi from"@rollup/plugin-replace";import{wasm as Vo}from"@rollup/plugin-wasm";import Ko from"rollup-plugin-polyfill-node";import{visualizer as Ho}from"rollup-plugin-visualizer";import{minVersion as bi,valid as Go,coerce as Yo}from"semver";import Le from"node:assert/strict";import{extractAssignedNames as Xo,createFilter as X}from"@rollup/pluginutils";import Qo from"glob-parent";import{glob as Zo,isDynamicPattern as It,globSync as en}from"tinyglobby";import{isRelative as jt,resolveAlias as tn}from"@visulima/path/utils";import{SourceMapConsumer as on,SourceMapGenerator as nn}from"source-map-js";import{interopDefault as an,loadModule as sn,findStaticImports as wi,fileURLToPath as rn,resolveModuleExportNames as ln,resolvePath as At}from"mlly";import{fileURLToPath as ki}from"node:url";import{ResolverFactory as pn}from"oxc-resolver";import{parseAsync as cn}from"oxc-parser";import dn from"@rollup/plugin-json";import mn from"rollup-plugin-license";import un,{createHash as fn}from"node:crypto";import{readdirSync as gn,createReadStream as vn,createWriteStream as hn,existsSync as xn}from"node:fs";import{loadSourceMap as yn}from"@visulima/source-map";import{parse as bn}from"@babel/parser";import wn from"node:child_process";import{parsePackageJson as ji}from"@visulima/package/package-json";import{NotFoundError as kn}from"@visulima/fs/error";import{distance as jn}from"fastest-levenshtein";import __cjs_url__ from "node:url"; // -- packem CommonJS __filename shim --
2
+ var fo=Object.defineProperty;var g=(e,t)=>fo(e,"name",{value:t,configurable:!0});import go from"@visulima/cerebro";import{SimpleReporter as vo}from"@visulima/pail/reporter";import ot,{cwd as ci,env as Fe,versions as ho,exit as xo}from"node:process";import{installPackage as mt}from"@antfu/install-pkg";import{spinner as ut,select as ie,multiselect as di,confirm as U,intro as yo,log as Dt,cancel as bo,outro as wo}from"@clack/prompts";import{isAccessible as Ve,readFile as Oe,writeFile as mi,isAccessibleSync as z,readFileSync as Ke,writeFileSync as le,readJsonSync as ui,writeJsonSync as bt,ensureDir as Ct,walk as ko,collectSync as jo,emptyDir as $o,readJson as Eo,ensureDirSync as So}from"@visulima/fs";import{join as j,resolve as E,normalize as K,relative as N,dirname as M,basename as ne,isAbsolute as fe,parse as nt,toNamespacedPath as Re,extname as Ge}from"@visulima/path";import H from"magic-string";import{cyan as D,bold as V,gray as ee,green as Oo,yellow as Po,grey as Do}from"@visulima/colorize";import{findCacheDirSync as Co}from"@visulima/find-cache-dir";import{formatBytes as Z,duration as Nt}from"@visulima/humanizer";import{readTsConfig as No,findTsConfig as _o}from"@visulima/tsconfig";import Mo from"browserslist";import{defu as To}from"defu";import{createHooks as Io}from"hookable";import{createJiti as fi}from"jiti";import{rollup as gi,watch as _t,VERSION as Ao}from"rollup";import{exec as zo}from"tinyexec";import{stat as wt,chmod as Fo,readFile as Ro,readdir as Lo,rm as Jo}from"node:fs/promises";import vi from"@rollup/plugin-alias";import Bo from"@rollup/plugin-commonjs";import qo from"@rollup/plugin-dynamic-import-vars";import{nodeResolve as hi}from"@rollup/plugin-node-resolve";import xi from"@rollup/plugin-replace";import{wasm as Wo}from"@rollup/plugin-wasm";import Uo from"rollup-plugin-polyfill-node";import{visualizer as Vo}from"rollup-plugin-visualizer";import{minVersion as yi,valid as Ko,coerce as Go}from"semver";import Le from"node:assert/strict";import{extractAssignedNames as Ho,createFilter as Y}from"@rollup/pluginutils";import Yo from"glob-parent";import{glob as Xo,isDynamicPattern as Mt,globSync as Qo}from"tinyglobby";import{isRelative as kt,resolveAlias as Zo}from"@visulima/path/utils";import{SourceMapConsumer as en,SourceMapGenerator as tn}from"source-map-js";import{interopDefault as on,loadModule as nn,findStaticImports as bi,fileURLToPath as an,resolveModuleExportNames as sn,resolvePath as Tt}from"mlly";import{fileURLToPath as wi}from"node:url";import{ResolverFactory as rn}from"oxc-resolver";import{parseAsync as ln}from"oxc-parser";import pn from"@rollup/plugin-json";import cn from"rollup-plugin-license";import dn,{createHash as mn}from"node:crypto";import{readdirSync as un,createReadStream as fn,createWriteStream as gn,existsSync as vn}from"node:fs";import It,{isBuiltin as at}from"node:module";import{loadSourceMap as hn}from"@visulima/source-map";import{parse as xn}from"@babel/parser";import yn from"node:child_process";import{parsePackageJson as ki}from"@visulima/package/package-json";import{NotFoundError as bn}from"@visulima/fs/error";import{distance as wn}from"fastest-levenshtein";import __cjs_url__ from "node:url"; // -- packem CommonJS __filename shim --
3
3
  import __cjs_path__ from "node:path"; // -- packem CommonJS __dirname shim --
4
4
  import __cjs_mod__ from "node:module"; // -- packem CommonJS require shim --
5
5
  const __filename = __cjs_url__.fileURLToPath(import.meta.url);
6
6
  const __dirname = __cjs_path__.dirname(__filename);
7
7
  const require = __cjs_mod__.createRequire(import.meta.url);
8
- const $n="@visulima/packem",En="1.7.2";var Sn=Object.defineProperty,On=g((e,t)=>Sn(e,"name",{value:t,configurable:!0}),"t$d");const $i=On(async(e,t="")=>{let i=t;if(!i){const o=["packem.config.js","packem.config.mjs","packem.config.cjs","packem.config.ts","packem.config.cts","packem.config.mts"];for(const n of o)if(await Ve(j(e,n))){i="./"+n;break}}if(!/\.(?:js|mjs|cjs|ts|cts|mts)$/.test(i))throw new Error("Invalid packem config file extension. Only .js, .mjs, .cjs, .ts, .cts and .mts extensions are allowed.");return i},"findPackemFile"),Ei={less:["less"],lightningcss:["lightningcss"],"node-sass":["node-sass"],postcss:["postcss","postcss-load-config","postcss-modules-extract-imports","postcss-modules-local-by-default","postcss-modules-scope","postcss-modules-values","postcss-value-parser","icss-utils"],sass:["sass"],"sass-embedded":["sass-embedded"],stylus:["stylus"]};var Dn=Object.defineProperty,zt=g((e,t)=>Dn(e,"name",{value:t,configurable:!0}),"f$j");const Pn=["typedoc","typedoc-plugin-markdown","typedoc-plugin-rename-defaults","@ckeditor/typedoc-plugins"],Cn=zt(e=>{e.addCommand({argument:{description:"Add a packem feature to your project",name:"feature",required:!0},description:"Add a optional packem feature to your project",execute:zt(async({argument:t,logger:i,options:o})=>{const n=ut(),a=E(di(),o.dir??".");let s;try{s=await $i(a,o.config)}catch{i.error("Could not find a packem config file, please run `packem init` first.");return}const l=await Oe(s,{buffer:!1});let p="cjs";l.includes("import")&&(p="esm");const r=new Y(l);if(t.includes("typedoc")){if(l.includes("typedoc: typedocBuilder")||l.includes("@visulima/packem/builder/typedoc")){i.warn("Typedoc has already been added to the packem config.");return}p==="cjs"?r.prepend(`const typedocBuilder = require("@visulima/packem/builder/typedoc");
8
+ const kn="@visulima/packem",jn="1.8.0";var $n=Object.defineProperty,En=g((e,t)=>$n(e,"name",{value:t,configurable:!0}),"t$d");const ji=En(async(e,t="")=>{let i=t;if(!i){const o=["packem.config.js","packem.config.mjs","packem.config.cjs","packem.config.ts","packem.config.cts","packem.config.mts"];for(const n of o)if(await Ve(j(e,n))){i="./"+n;break}}if(!/\.(?:js|mjs|cjs|ts|cts|mts)$/.test(i))throw new Error("Invalid packem config file extension. Only .js, .mjs, .cjs, .ts, .cts and .mts extensions are allowed.");return i},"findPackemFile"),$i={less:["less"],lightningcss:["lightningcss"],"node-sass":["node-sass"],postcss:["postcss","postcss-load-config","postcss-modules-extract-imports","postcss-modules-local-by-default","postcss-modules-scope","postcss-modules-values","postcss-value-parser","icss-utils"],sass:["sass"],"sass-embedded":["sass-embedded"],stylus:["stylus"]};var Sn=Object.defineProperty,At=g((e,t)=>Sn(e,"name",{value:t,configurable:!0}),"f$j");const On=["typedoc","typedoc-plugin-markdown","typedoc-plugin-rename-defaults","@ckeditor/typedoc-plugins"],Pn=At(e=>{e.addCommand({argument:{description:"Add a packem feature to your project",name:"feature",required:!0},description:"Add a optional packem feature to your project",execute:At(async({argument:t,logger:i,options:o})=>{const n=ut(),a=E(ci(),o.dir??".");let s;try{s=await ji(a,o.config)}catch{i.error("Could not find a packem config file, please run `packem init` first.");return}const l=await Oe(s,{buffer:!1});let p="cjs";l.includes("import")&&(p="esm");const r=new H(l);if(t.includes("typedoc")){if(l.includes("typedoc: typedocBuilder")||l.includes("@visulima/packem/builder/typedoc")){i.warn("Typedoc has already been added to the packem config.");return}p==="cjs"?r.prepend(`const typedocBuilder = require("@visulima/packem/builder/typedoc");
9
9
  `):r.prepend(`import typedocBuilder from "@visulima/packem/builder/typedoc";
10
10
  `),l.includes("builder: {")?r.replace("builder: {",`builder: {
11
11
  typedoc: typedocBuilder,
12
12
  `):r.replace("transformer,",`transformer,
13
13
  builder: {
14
14
  typedoc: typedocBuilder,
15
- },`),i.info("Adding typedoc dependencies..."),n.start("Installing packages"),await mt(Pn,{cwd:a,dev:!0,silent:!0}),n.stop("Installed packages"),i.success(`
16
- Typedoc added!`)}if(t.includes("css")){if(l.includes("css: {")||l.includes("@visulima/packem/css")){i.warn("Css loaders have already been added to the packem config.");return}const c=[],m=await ie({message:"Pick a css loader",options:[{label:"PostCSS",value:"postcss"},{hint:"experimental",label:"Lightning CSS",value:"lightningcss"}]});c.push(m);let d=await mi({message:"Pick extra loaders",options:[{label:"Sass",value:"sass"},{label:"Stylus",value:"stylus"},{label:"Less",value:"less"}],required:!1});if(d.includes("sass")){const f=await ie({message:"Pick a sass loader",options:[{hint:"recommended",label:"Sass embedded",value:"sass-embedded"},{label:"Sass",value:"sass"},{hint:"legacy",label:"Node Sass",value:"node-sass"}]});f!=="sass"&&(d=d.filter(x=>x!=="sass"),d.push(f))}c.push(...d);const u=[];for(const f of c)u.push(...Ei[f]);c.push("sourceMap");for(let f of c)(f==="sass-embedded"||f==="node-sass")&&(f="sass"),p==="cjs"?r.prepend(`const ${f}Loader = require("@visulima/packem/css/loader/${f.toLowerCase()}");
15
+ },`),i.info("Adding typedoc dependencies..."),n.start("Installing packages"),await mt(On,{cwd:a,dev:!0,silent:!0}),n.stop("Installed packages"),i.success(`
16
+ Typedoc added!`)}if(t.includes("css")){if(l.includes("css: {")||l.includes("@visulima/packem/css")){i.warn("Css loaders have already been added to the packem config.");return}const c=[],m=await ie({message:"Pick a css loader",options:[{label:"PostCSS",value:"postcss"},{hint:"experimental",label:"Lightning CSS",value:"lightningcss"}]});c.push(m);let d=await di({message:"Pick extra loaders",options:[{label:"Sass",value:"sass"},{label:"Stylus",value:"stylus"},{label:"Less",value:"less"}],required:!1});if(d.includes("sass")){const f=await ie({message:"Pick a sass loader",options:[{hint:"recommended",label:"Sass embedded",value:"sass-embedded"},{label:"Sass",value:"sass"},{hint:"legacy",label:"Node Sass",value:"node-sass"}]});f!=="sass"&&(d=d.filter(y=>y!=="sass"),d.push(f))}c.push(...d);const u=[];for(const f of c)u.push(...$i[f]);c.push("sourceMap");for(let f of c)(f==="sass-embedded"||f==="node-sass")&&(f="sass"),p==="cjs"?r.prepend(`const ${f}Loader = require("@visulima/packem/css/loader/${f.toLowerCase()}");
17
17
  `):r.prepend(`import ${f}Loader from "@visulima/packem/css/loader/${f.toLowerCase()}";
18
18
  `);const h=await U({initialValue:!1,message:"Do you want to minify your css?"});let v;h&&(v=await ie({message:"Pick a css minifier",options:[{label:"CSSNano",value:"cssnano"},{label:"Lightning CSS",value:"lightningcss"}]}),c.includes("lightningcss")||u.push(v),p==="cjs"?r.prepend(`const ${v}Minifier = require("@visulima/packem/css/minifier/${v.toLowerCase()}");
19
19
  `):r.prepend(`import ${v}Minifier from "@visulima/packem/css/minifier/${v.toLowerCase()}";
20
- `));const y=c.map(f=>((f==="sass-embedded"||f==="node-sass")&&(f="sass"),`${f}Loader`)).join(", ");if(l.includes("rollup: {"))r.replace("rollup: {",`rollup: {
20
+ `));const x=c.map(f=>((f==="sass-embedded"||f==="node-sass")&&(f="sass"),`${f}Loader`)).join(", ");if(l.includes("rollup: {"))r.replace("rollup: {",`rollup: {
21
21
  css: {${v?`
22
22
  minifier: ${v}Minifier,`:""}
23
- loaders: [${y}],
23
+ loaders: [${x}],
24
24
  },
25
25
  `);else{const f=l.includes(" transformer,")?" transformer,":" transformer";r.replace(f,` transformer,
26
26
  rollup: {
27
27
  css: {${v?`
28
28
  minifier: ${v}Minifier,`:""}
29
- loaders: [${y}],
29
+ loaders: [${x}],
30
30
  },
31
31
  },`)}n.start("Installing packages"),await mt(u,{cwd:a,dev:!0,silent:!0}),n.stop("Installed packages"),i.success(`
32
- CSS loaders added!`)}await ui(s,r.toString(),{overwrite:!0})},"execute"),name:"add",options:[{defaultValue:".",description:"The directory to build",name:"dir",type:String},{description:"Use a custom config file",name:"config",type:String}]})},"createAddCommand"),Ge=[".mjs",".js",".json",".node",".cjs",".ts",".cts",".mts",".tsx",".ctsx",".mtsx",".jsx"],G="production",De="development",$t=new Set(["react-server","react-native","edge-light"]),Je=new Set([De,G,...$t]),xe=/node_modules/,ae=/(?:\.d\.[mc]?tsx?|\.\w+)$/,Nn="packem_chunks",_n="packem_shared",ye=/\.(?:m|c)?(?:j|t)sx?$/;var Tn=Object.defineProperty,Mn=g((e,t)=>Tn(e,"name",{value:t,configurable:!0}),"a$t");const Se=Mn(e=>e==null?[]:Array.isArray(e)?e:[e],"arrayify");var In=Object.defineProperty,Si=g((e,t)=>In(e,"name",{value:t,configurable:!0}),"s$j");const An=Si((e,t,i)=>{const o=i??new Map;return(...n)=>{const a=t?typeof t=="function"?t(...n):t:JSON.stringify({args:n}),s=o.get(a);if(s!==void 0)return s;const l=e(...n);return o.set(a,l),l}},"memoize"),zn=Si(e=>{const t=new Map;return i=>An(e,i,t)},"memoizeByKey");var Fn=Object.defineProperty,Pe=g((e,t)=>Fn(e,"name",{value:t,configurable:!0}),"r$j");const Rn=Pe(function*(e){switch(e.declaration?.type){case"ClassDeclaration":case"FunctionDeclaration":{const{id:t}=e.declaration;Le(t,"Expected class/function to have a name"),yield t.name;break}case"VariableDeclaration":{for(const t of e.declaration.declarations)for(const i of Xo(t.id))yield i;break}}},"exportName"),Ln=Pe(function*(e){if(e.declaration)for(const t of Rn(e))yield{exportedName:t,from:"self",type:"named"};else if(e.source)yield{bindings:e.specifiers.map(t=>({exportedName:t.exported.name,importedName:t.local.name})),from:"other",source:e.source.value,type:"named"};else for(const t of e.specifiers)yield{exportedName:t.exported.name,from:"self",type:"named"}},"parseExportNamed"),Jn=Pe(function*(e){e.exported?yield{exportedName:e.exported.name,from:"self",type:"named"}:yield{from:"other",source:e.source.value,type:"barrel"}},"parseExportAll"),Bn=Pe(function*(){yield{exportedName:"default",from:"self",type:"named"}},"parseExportDefault"),qn=Pe(function*(e,t){Le(t.code!=null,`Module ${t.id} doesn't have associated code`);const i=e.parse(t.code);for(const o of i.body)switch(o.type){case"ExportAllDeclaration":{yield*Jn(o);break}case"ExportDefaultDeclaration":{yield*Bn();break}case"ExportNamedDeclaration":{yield*Ln(o);break}}},"parseExports");var Wn=Object.defineProperty,Ce=g((e,t)=>Wn(e,"name",{value:t,configurable:!0}),"n$g");const Oi=Ce(async function(e,t,i){const o=await e.resolve(t,i.id);if(Le(o,`Rollup can't resolve ${t} from ${i.id}`),o.external)return null;const n=await e.load(o);return Le(n,`Rollup doesn't have a module for id ${o.id}`),n},"getImportedModule"),Un=Ce(async function*(e,t,i){const o=await Oi(e,t.source,i);o&&(yield*Et(e,o))},"gatherBarrelReExports"),Vn=Ce(async function*(e,t,i){const o=await Oi(e,t.source,i);if(!o)return;const n=new Map(t.bindings.map(a=>[a.importedName,a]));for await(const a of Et(e,o)){const s=n.get(a.exportedName);s&&(yield{...a,exportedName:s.exportedName})}},"gatherNamedReExports"),Kn=Ce(async function*(e,t){yield{exportedName:t.exportedName,id:e.id,sourceName:t.exportedName}},"gatherNamedSelfExports"),Et=Ce(async function*(e,t){for(const i of qn(e,t))i.from==="self"?yield*Kn(t,i):i.type==="barrel"?yield*Un(e,i,t):yield*Vn(e,i,t)},"gatherExports");var Hn=Object.defineProperty,Gn=g((e,t)=>Hn(e,"name",{value:t,configurable:!0}),"r$i");const Yn=Gn(()=>({moduleParsed:{async handler(e){if(e.isEntry)for await(const t of Et(this,e))t.id!==e.id&&this.emitFile({id:t.id,name:t.exportedName,preserveSignature:"exports-only",type:"chunk"})},order:"post"},name:"packem:chunk-splitter"}),"chunkSplitter");var Xn=Object.defineProperty,Qn=g((e,t)=>Xn(e,"name",{value:t,configurable:!0}),"r$h");const Zn=Qn((e,t)=>{const i=e,o=[];let n;for(;(n=i.exec(t))!==null;)n.index===i.lastIndex&&i.lastIndex++,n.forEach(a=>{o.push(a)});return o.filter(Boolean)},"getRegexMatches");var ea=Object.defineProperty,ta=g((e,t)=>ea(e,"name",{value:t,configurable:!0}),"a$s");const Di=ta(e=>{const t=Zn(/export\s(\{\s(.*)\s\}|default\s.*);/g,e);if(t.length===0)return null;const i=t.at(-1).split(", ");let o="";for(const n of i)if(!n.includes("type")&&(n.includes("default ")&&(o=n.split("default ")[1]),n.includes("as"))){const[a,s]=n.split(" as ");s==="default"&&(o=a)}if(o!==""){const n=new Y(e);return n.replace(new RegExp(`(,s)?${o} as default(,)?`),""),n.replace(new RegExp(`export default ${o};
32
+ CSS loaders added!`)}await mi(s,r.toString(),{overwrite:!0})},"execute"),name:"add",options:[{defaultValue:".",description:"The directory to build",name:"dir",type:String},{description:"Use a custom config file",name:"config",type:String}]})},"createAddCommand"),He=[".mjs",".js",".json",".node",".cjs",".ts",".cts",".mts",".tsx",".ctsx",".mtsx",".jsx"],G="production",Pe="development",jt=new Set(["react-server","react-native","edge-light"]),Je=new Set([Pe,G,...jt]),xe=/node_modules/,ae=/(?:\.d\.[mc]?tsx?|\.\w+)$/,Dn="packem_chunks",Cn="packem_shared",ye=/\.(?:m|c)?(?:j|t)sx?$/;var Nn=Object.defineProperty,_n=g((e,t)=>Nn(e,"name",{value:t,configurable:!0}),"a$r");const Se=_n(e=>e==null?[]:Array.isArray(e)?e:[e],"arrayify");var Mn=Object.defineProperty,Ei=g((e,t)=>Mn(e,"name",{value:t,configurable:!0}),"s$j");const Tn=Ei((e,t,i)=>{const o=i??new Map;return(...n)=>{const a=t?typeof t=="function"?t(...n):t:JSON.stringify({args:n}),s=o.get(a);if(s!==void 0)return s;const l=e(...n);return o.set(a,l),l}},"memoize"),In=Ei(e=>{const t=new Map;return i=>Tn(e,i,t)},"memoizeByKey");var An=Object.defineProperty,De=g((e,t)=>An(e,"name",{value:t,configurable:!0}),"r$j");const zn=De(function*(e){switch(e.declaration?.type){case"ClassDeclaration":case"FunctionDeclaration":{const{id:t}=e.declaration;Le(t,"Expected class/function to have a name"),yield t.name;break}case"VariableDeclaration":{for(const t of e.declaration.declarations)for(const i of Ho(t.id))yield i;break}}},"exportName"),Fn=De(function*(e){if(e.declaration)for(const t of zn(e))yield{exportedName:t,from:"self",type:"named"};else if(e.source)yield{bindings:e.specifiers.map(t=>({exportedName:t.exported.name,importedName:t.local.name})),from:"other",source:e.source.value,type:"named"};else for(const t of e.specifiers)yield{exportedName:t.exported.name,from:"self",type:"named"}},"parseExportNamed"),Rn=De(function*(e){e.exported?yield{exportedName:e.exported.name,from:"self",type:"named"}:yield{from:"other",source:e.source.value,type:"barrel"}},"parseExportAll"),Ln=De(function*(){yield{exportedName:"default",from:"self",type:"named"}},"parseExportDefault"),Jn=De(function*(e,t){Le(t.code!=null,`Module ${t.id} doesn't have associated code`);const i=e.parse(t.code);for(const o of i.body)switch(o.type){case"ExportAllDeclaration":{yield*Rn(o);break}case"ExportDefaultDeclaration":{yield*Ln();break}case"ExportNamedDeclaration":{yield*Fn(o);break}}},"parseExports");var Bn=Object.defineProperty,Ce=g((e,t)=>Bn(e,"name",{value:t,configurable:!0}),"n$g");const Si=Ce(async function(e,t,i){const o=await e.resolve(t,i.id);if(Le(o,`Rollup can't resolve ${t} from ${i.id}`),o.external)return null;const n=await e.load(o);return Le(n,`Rollup doesn't have a module for id ${o.id}`),n},"getImportedModule"),qn=Ce(async function*(e,t,i){const o=await Si(e,t.source,i);o&&(yield*$t(e,o))},"gatherBarrelReExports"),Wn=Ce(async function*(e,t,i){const o=await Si(e,t.source,i);if(!o)return;const n=new Map(t.bindings.map(a=>[a.importedName,a]));for await(const a of $t(e,o)){const s=n.get(a.exportedName);s&&(yield{...a,exportedName:s.exportedName})}},"gatherNamedReExports"),Un=Ce(async function*(e,t){yield{exportedName:t.exportedName,id:e.id,sourceName:t.exportedName}},"gatherNamedSelfExports"),$t=Ce(async function*(e,t){for(const i of Jn(e,t))i.from==="self"?yield*Un(t,i):i.type==="barrel"?yield*qn(e,i,t):yield*Wn(e,i,t)},"gatherExports");var Vn=Object.defineProperty,Kn=g((e,t)=>Vn(e,"name",{value:t,configurable:!0}),"r$i");const Gn=Kn(()=>({moduleParsed:{async handler(e){if(e.isEntry)for await(const t of $t(this,e))t.id!==e.id&&this.emitFile({id:t.id,name:t.exportedName,preserveSignature:"exports-only",type:"chunk"})},order:"post"},name:"packem:chunk-splitter"}),"chunkSplitter");var Hn=Object.defineProperty,Yn=g((e,t)=>Hn(e,"name",{value:t,configurable:!0}),"r$h");const Xn=Yn((e,t)=>{const i=e,o=[];let n;for(;(n=i.exec(t))!==null;)n.index===i.lastIndex&&i.lastIndex++,n.forEach(a=>{o.push(a)});return o.filter(Boolean)},"getRegexMatches");var Qn=Object.defineProperty,Zn=g((e,t)=>Qn(e,"name",{value:t,configurable:!0}),"a$q");const Oi=Zn(e=>{const t=Xn(/export\s(\{\s(.*)\s\}|default\s.*);/g,e);if(t.length===0)return null;const i=t.at(-1).split(", ");let o="";for(const n of i)if(!n.includes("type")&&(n.includes("default ")&&(o=n.split("default ")[1]),n.includes("as"))){const[a,s]=n.split(" as ");s==="default"&&(o=a)}if(o!==""){const n=new H(e);return n.replace(new RegExp(`(,s)?${o} as default(,)?`),""),n.replace(new RegExp(`export default ${o};
33
33
  ?`),""),n.append(`
34
34
 
35
- export = `+o+";"),{code:n.toString().replace(/export\s\{\s\s\};/,""),map:n.generateMap({hires:!0})}}return null},"patchCjsDefaultExport");var ia=Object.defineProperty,Ft=g((e,t)=>ia(e,"name",{value:t,configurable:!0}),"i$g");const Pi=Ft(({addDefaultProperty:e=!1,logger:t,type:i})=>({name:"packem:cjs-interop",renderChunk:Ft(async(o,n,a)=>{if(n.type!=="chunk"||!n.isEntry)return null;if(a.format==="cjs"&&a.exports==="auto"){const s=/(exports(?:\['default'\]|\.default)) = (.*);/i.exec(o);if(s===null||s.length<3)return null;const l=new Y(o);l.replace("Object.defineProperty(exports, '__esModule', { value: true });",""),l.replaceAll(/exports\.(.*) = (.*);/g,"module.exports.$1 = $2;"),e&&l.append(`
36
- module.exports.default = `+s[2]+";");let p=l.toString();return p=p.replace(/(?:module\.)?exports(?:\['default'\]|\.default)/i,"module.exports"),t.debug({message:"Applied CommonJS interop to entry chunk "+n.fileName+".",prefix:"plugin:cjs-interop"}),{code:p,map:l.generateMap({hires:!0})}}return a.format==="es"&&/\.d\.(?:ts|cts)$/.test(n.fileName)?i!=="commonjs"&&n.fileName.endsWith(".d.mts")?null:Di(o):null},"renderChunk")}),"cjsInteropPlugin");var oa=Object.defineProperty,na=g((e,t)=>oa(e,"name",{value:t,configurable:!0}),"f$g");const aa=na((e,t)=>{const i=new Map,o={copyOnce:!0,exactFileNames:!0,flatten:!1,...e};let{targets:n}=o;return Array.isArray(n)?n=n.map(a=>{if(typeof a=="string")return{src:a};if(typeof a=="object"&&"src"in a)return a}).filter(Boolean):typeof n=="string"&&(n=[{src:n}]),{async buildStart(){const a=await Promise.all(n.flatMap(s=>Array.isArray(s.src)?s.src.map(l=>({...s,src:l})):s).map(async s=>await Zo(Se(s.src),{ignore:Se(s.exclude).filter(Boolean)}).then(l=>({dest:s.dest??"",parent:Qo(s.src),src:l}))));for(const s of a)for(const l of s.src){let p;i.has(l)?p=i.get(l):(p={copied:[],dest:[],timestamp:0},i.set(l,p));const r=o.flatten?K(s.dest):j(s.dest,_(s.parent,M(l)));p.dest.includes(r)||p.dest.push(r),this.addWatchFile(l)}t.info({message:"Copying files...",prefix:"plugin:copy"}),await Promise.all([...i].map(async([s,l])=>{let p;try{const r=await kt(s);if(!r.isFile())return;const c=r.mtime.getTime();c>l.timestamp&&(l.timestamp=c,l.copied=[]),p=await Oe(s,{buffer:!0})}catch(r){t.error({context:[r],message:`error reading file ${s}`,prefix:"plugin:copy"});return}for(const r of l.dest){if(o.copyOnce&&l.copied.includes(r))continue;const c=ne(s),m=j(r,c);try{this.emitFile({[o.exactFileNames?"fileName":"name"]:m,source:p,type:"asset"}),t.debug({message:`copied ${s} → ${m}`,prefix:"plugin:copy"}),l.copied.push(r)}catch(d){t.error({context:[d],message:`error copying file ${s} → ${m}`,prefix:"plugin:copy"})}}}))},name:"packem:copy"}},"copyPlugin");function Ci(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}g(Ci,"getDefaultExportFromCjs");var st={exports:{}},Rt;function sa(){return Rt||(Rt=1,function(e){var t=Object.defineProperty,i=g((c,m)=>t(c,"name",{value:m,configurable:!0}),"c"),o=Object.prototype.hasOwnProperty,n="~";function a(){}g(a,"Events"),i(a,"Events"),Object.create&&(a.prototype=Object.create(null),new a().__proto__||(n=!1));function s(c,m,d){this.fn=c,this.context=m,this.once=d||!1}g(s,"EE"),i(s,"EE");function l(c,m,d,u,h){if(typeof d!="function")throw new TypeError("The listener must be a function");var v=new s(d,u||c,h),y=n?n+m:m;return c._events[y]?c._events[y].fn?c._events[y]=[c._events[y],v]:c._events[y].push(v):(c._events[y]=v,c._eventsCount++),c}g(l,"addListener"),i(l,"addListener");function p(c,m){--c._eventsCount===0?c._events=new a:delete c._events[m]}g(p,"clearEvent"),i(p,"clearEvent");function r(){this._events=new a,this._eventsCount=0}g(r,"EventEmitter"),i(r,"EventEmitter"),r.prototype.eventNames=i(function(){var c=[],m,d;if(this._eventsCount===0)return c;for(d in m=this._events)o.call(m,d)&&c.push(n?d.slice(1):d);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(m)):c},"eventNames"),r.prototype.listeners=i(function(c){var m=n?n+c:c,d=this._events[m];if(!d)return[];if(d.fn)return[d.fn];for(var u=0,h=d.length,v=new Array(h);u<h;u++)v[u]=d[u].fn;return v},"listeners"),r.prototype.listenerCount=i(function(c){var m=n?n+c:c,d=this._events[m];return d?d.fn?1:d.length:0},"listenerCount"),r.prototype.emit=i(function(c,m,d,u,h,v){var y=n?n+c:c;if(!this._events[y])return!1;var f=this._events[y],x=arguments.length,k,w;if(f.fn){switch(f.once&&this.removeListener(c,f.fn,void 0,!0),x){case 1:return f.fn.call(f.context),!0;case 2:return f.fn.call(f.context,m),!0;case 3:return f.fn.call(f.context,m,d),!0;case 4:return f.fn.call(f.context,m,d,u),!0;case 5:return f.fn.call(f.context,m,d,u,h),!0;case 6:return f.fn.call(f.context,m,d,u,h,v),!0}for(w=1,k=new Array(x-1);w<x;w++)k[w-1]=arguments[w];f.fn.apply(f.context,k)}else{var b=f.length,S;for(w=0;w<b;w++)switch(f[w].once&&this.removeListener(c,f[w].fn,void 0,!0),x){case 1:f[w].fn.call(f[w].context);break;case 2:f[w].fn.call(f[w].context,m);break;case 3:f[w].fn.call(f[w].context,m,d);break;case 4:f[w].fn.call(f[w].context,m,d,u);break;default:if(!k)for(S=1,k=new Array(x-1);S<x;S++)k[S-1]=arguments[S];f[w].fn.apply(f[w].context,k)}}return!0},"emit"),r.prototype.on=i(function(c,m,d){return l(this,c,m,d,!1)},"on"),r.prototype.once=i(function(c,m,d){return l(this,c,m,d,!0)},"once"),r.prototype.removeListener=i(function(c,m,d,u){var h=n?n+c:c;if(!this._events[h])return this;if(!m)return p(this,h),this;var v=this._events[h];if(v.fn)v.fn===m&&(!u||v.once)&&(!d||v.context===d)&&p(this,h);else{for(var y=0,f=[],x=v.length;y<x;y++)(v[y].fn!==m||u&&!v[y].once||d&&v[y].context!==d)&&f.push(v[y]);f.length?this._events[h]=f.length===1?f[0]:f:p(this,h)}return this},"removeListener"),r.prototype.removeAllListeners=i(function(c){var m;return c?(m=n?n+c:c,this._events[m]&&p(this,m)):(this._events=new a,this._eventsCount=0),this},"removeAllListeners"),r.prototype.off=r.prototype.removeListener,r.prototype.addListener=r.prototype.on,r.prefixed=n,r.EventEmitter=r,e.exports=r}(st)),st.exports}g(sa,"requireEventemitter3");var ra=sa();const la=Ci(ra);var pa=Object.defineProperty,ge=g((e,t)=>pa(e,"name",{value:t,configurable:!0}),"o$9");class Ni extends Error{static{g(this,"TimeoutError")}static{ge(this,"TimeoutError")}constructor(t){super(t),this.name="TimeoutError"}}class ca extends Error{static{g(this,"AbortError")}static{ge(this,"AbortError")}constructor(t){super(),this.name="AbortError",this.message=t}}const Lt=ge(e=>globalThis.DOMException===void 0?new ca(e):new DOMException(e),"getDOMException"),Jt=ge(e=>{const t=e.reason===void 0?Lt("This operation was aborted."):e.reason;return t instanceof Error?t:Lt(t)},"getAbortedReason");function _i(e,t){const{milliseconds:i,fallback:o,message:n,customTimers:a={setTimeout,clearTimeout}}=t;let s;const l=new Promise((p,r)=>{if(typeof i!="number"||Math.sign(i)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${i}\``);if(t.signal){const{signal:m}=t;m.aborted&&r(Jt(m));const d=ge(()=>{r(Jt(m))},"abortHandler");m.addEventListener("abort",d,{once:!0}),e.finally(()=>{m.removeEventListener("abort",d)})}if(i===Number.POSITIVE_INFINITY){e.then(p,r);return}const c=new Ni;s=a.setTimeout.call(void 0,()=>{if(o){try{p(o())}catch(m){r(m)}return}typeof e.cancel=="function"&&e.cancel(),n===!1?p():n instanceof Error?r(n):(c.message=n??`Promise timed out after ${i} milliseconds`,r(c))},i),(async()=>{try{p(await e)}catch(m){r(m)}})()}).finally(()=>{l.clear()});return l.clear=()=>{a.clearTimeout.call(void 0,s),s=void 0},l}g(_i,"T$1");ge(_i,"pTimeout");var da=Object.defineProperty,ma=g((e,t)=>da(e,"name",{value:t,configurable:!0}),"i$f");function Ti(e,t,i){let o=0,n=e.length;for(;n>0;){const a=Math.trunc(n/2);let s=o+a;i(e[s],t)<=0?(o=++s,n-=a+1):n=a}return o}g(Ti,"r$g");ma(Ti,"lowerBound");var ua=Object.defineProperty,fa=g((e,t)=>ua(e,"name",{value:t,configurable:!0}),"s$g");let ga=class{static{g(this,"y")}static{fa(this,"PriorityQueue")}#e=[];enqueue(t,i){i={priority:0,...i};const o={priority:i.priority,run:t};if(this.size&&this.#e[this.size-1].priority>=i.priority){this.#e.push(o);return}const n=Ti(this.#e,o,(a,s)=>s.priority-a.priority);this.#e.splice(n,0,o)}dequeue(){return this.#e.shift()?.run}filter(t){return this.#e.filter(i=>i.priority===t.priority).map(i=>i.run)}get size(){return this.#e.length}};var va=Object.defineProperty,Bt=g((e,t)=>va(e,"name",{value:t,configurable:!0}),"n$d");let ha=class extends la{static{g(this,"d")}static{Bt(this,"PQueue")}#e;#i;#a=0;#r;#s;#f=0;#o;#p;#t;#g;#n=0;#c;#l;#v;timeout;constructor(t){if(super(),t={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:ga,...t},!(typeof t.intervalCap=="number"&&t.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${t.intervalCap?.toString()??""}\` (${typeof t.intervalCap})`);if(t.interval===void 0||!(Number.isFinite(t.interval)&&t.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${t.interval?.toString()??""}\` (${typeof t.interval})`);this.#e=t.carryoverConcurrencyCount,this.#i=t.intervalCap===Number.POSITIVE_INFINITY||t.interval===0,this.#r=t.intervalCap,this.#s=t.interval,this.#t=new t.queueClass,this.#g=t.queueClass,this.concurrency=t.concurrency,this.timeout=t.timeout,this.#v=t.throwOnTimeout===!0,this.#l=t.autoStart===!1}get#y(){return this.#i||this.#a<this.#r}get#b(){return this.#n<this.#c}#w(){this.#n--,this.#d(),this.emit("next")}#k(){this.#x(),this.#h(),this.#p=void 0}get#j(){const t=Date.now();if(this.#o===void 0){const i=this.#f-t;if(i<0)this.#a=this.#e?this.#n:0;else return this.#p===void 0&&(this.#p=setTimeout(()=>{this.#k()},i)),!0}return!1}#d(){if(this.#t.size===0)return this.#o&&clearInterval(this.#o),this.#o=void 0,this.emit("empty"),this.#n===0&&this.emit("idle"),!1;if(!this.#l){const t=!this.#j;if(this.#y&&this.#b){const i=this.#t.dequeue();return i?(this.emit("active"),i(),t&&this.#h(),!0):!1}}return!1}#h(){this.#i||this.#o!==void 0||(this.#o=setInterval(()=>{this.#x()},this.#s),this.#f=Date.now()+this.#s)}#x(){this.#a===0&&this.#n===0&&this.#o&&(clearInterval(this.#o),this.#o=void 0),this.#a=this.#e?this.#n:0,this.#m()}#m(){for(;this.#d(););}get concurrency(){return this.#c}set concurrency(t){if(!(typeof t=="number"&&t>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${t}\` (${typeof t})`);this.#c=t,this.#m()}async#$(t){return new Promise((i,o)=>{t.addEventListener("abort",()=>{o(t.reason)},{once:!0})})}async add(t,i={}){return i={timeout:this.timeout,throwOnTimeout:this.#v,...i},new Promise((o,n)=>{this.#t.enqueue(async()=>{this.#n++,this.#a++;try{i.signal?.throwIfAborted();let a=t({signal:i.signal});i.timeout&&(a=_i(Promise.resolve(a),{milliseconds:i.timeout})),i.signal&&(a=Promise.race([a,this.#$(i.signal)]));const s=await a;o(s),this.emit("completed",s)}catch(a){if(a instanceof Ni&&!i.throwOnTimeout){o();return}n(a),this.emit("error",a)}finally{this.#w()}},i),this.emit("add"),this.#d()})}async addAll(t,i){return Promise.all(t.map(async o=>this.add(o,i)))}start(){return this.#l?(this.#l=!1,this.#m(),this):this}pause(){this.#l=!0}clear(){this.#t=new this.#g}async onEmpty(){this.#t.size!==0&&await this.#u("empty")}async onSizeLessThan(t){this.#t.size<t||await this.#u("next",()=>this.#t.size<t)}async onIdle(){this.#n===0&&this.#t.size===0||await this.#u("idle")}async#u(t,i){return new Promise(o=>{const n=Bt(()=>{i&&!i()||(this.off(t,n),o())},"listener");this.on(t,n)})}get size(){return this.#t.size}sizeBy(t){return this.#t.filter(t).length}get pending(){return this.#n}get isPaused(){return this.#l}};var xa=Object.defineProperty,ya=g((e,t)=>xa(e,"name",{value:t,configurable:!0}),"r$f");const qt=ya((e,t)=>{if(!t)return!1;if(typeof t=="function")return t(e);if(typeof t.test=="function")return t.test(e);throw new Error("Invalid condition type")},"matchFile");var ba=Object.defineProperty,wa=g((e,t)=>ba(e,"name",{value:t,configurable:!0}),"a$r");const ka=4,ja=process.env.UV_THREADPOOL_SIZE?Number.parseInt(process.env.UV_THREADPOOL_SIZE,10):ka;let $a=class{static{g(this,"f")}static{wa(this,"LoaderManager")}test;loaders=new Map;options;workQueue;logger;constructor({extensions:t,loaders:i,logger:o,options:n}){this.test=a=>t.some(s=>a.toLowerCase().endsWith(s)),i.length>0&&this.add(...i),this.options=n,this.logger=o}add(...t){for(const i of t)this.loaders.has(i.name)||this.loaders.set(i.name,i)}isSupported(t){if(this.test(t))return!0;for(const[,i]of this.loaders)if(qt(t,i.test))return!0;return!1}async process(t,i){this.workQueue||(this.workQueue=new ha({concurrency:ja-1}));for await(const[o,n]of this.loaders){const a={...i,options:this.options[o]??{}};if(n.alwaysProcess||qt(a.id,n.test)){this.logger.debug(`Processing ${o} loader for ${a.id}`);const s=await this.workQueue.add(n.process.bind(a,t));s&&(t=s)}}return t}};const Ea=/data:[^\n\r;]+(?:;charset=[^\n\r;]+)?;base64,([\d+/A-Za-z]+={0,2})/;var Sa=Object.defineProperty,Ye=g((e,t)=>Sa(e,"name",{value:t,configurable:!0}),"i$e");const Mi=/(?:\n|\r\n)?\/\*[#*@]+\s*sourceMappingURL\s*=\s*(\S+)\s*\*+\//g,Ii=/(?:\n|\r\n)?\/\/[#@]+\s*sourceMappingURL\s*=\s*(\S+)\s*?$/gm;let Oa=class{static{g(this,"S")}static{Ye(this,"MapModifier")}map;constructor(t){if(typeof t=="string")try{this.map=JSON.parse(t)}catch{}else this.map=t}modify(t){return this.map?(t(this.map),this):this}modifySources(t){return this.map?(this.map.sources&&(this.map.sources=this.map.sources.map(i=>t(i))),this):this}resolve(t=process.cwd()){return this.modifySources(i=>i==="<no source>"?i:E(t,i))}relative(t=process.cwd()){return this.modifySources(i=>i==="<no source>"?i:fe(i)?_(t,i):K(i))}toObject(){return this.map}toString(){return this.map?JSON.stringify(this.map):this.map}toConsumer(){return this.map?new on(this.map):this.map}toCommentData(){const t=this.toString();return t?`
35
+ export = `+o+";"),{code:n.toString().replace(/export\s\{\s\s\};/,""),map:n.generateMap({hires:!0})}}return null},"patchCjsDefaultExport");var ea=Object.defineProperty,zt=g((e,t)=>ea(e,"name",{value:t,configurable:!0}),"i$g");const Pi=zt(({addDefaultProperty:e=!1,logger:t,type:i})=>({name:"packem:cjs-interop",renderChunk:zt(async(o,n,a)=>{if(n.type!=="chunk"||!n.isEntry)return null;if(a.format==="cjs"&&a.exports==="auto"){const s=/(exports(?:\['default'\]|\.default)) = (.*);/i.exec(o);if(s===null||s.length<3)return null;const l=new H(o);l.replace("Object.defineProperty(exports, '__esModule', { value: true });",""),l.replaceAll(/exports\.(.*) = (.*);/g,"module.exports.$1 = $2;"),e&&l.append(`
36
+ module.exports.default = `+s[2]+";");let p=l.toString();return p=p.replace(/(?:module\.)?exports(?:\['default'\]|\.default)/i,"module.exports"),t.debug({message:"Applied CommonJS interop to entry chunk "+n.fileName+".",prefix:"plugin:cjs-interop"}),{code:p,map:l.generateMap({hires:!0})}}return a.format==="es"&&/\.d\.(?:ts|cts)$/.test(n.fileName)?i!=="commonjs"&&n.fileName.endsWith(".d.mts")?null:Oi(o):null},"renderChunk")}),"cjsInteropPlugin");var ta=Object.defineProperty,ia=g((e,t)=>ta(e,"name",{value:t,configurable:!0}),"f$g");const oa=ia((e,t)=>{const i=new Map,o={copyOnce:!0,exactFileNames:!0,flatten:!1,...e};let{targets:n}=o;return Array.isArray(n)?n=n.map(a=>{if(typeof a=="string")return{src:a};if(typeof a=="object"&&"src"in a)return a}).filter(Boolean):typeof n=="string"&&(n=[{src:n}]),{async buildStart(){const a=await Promise.all(n.flatMap(s=>Array.isArray(s.src)?s.src.map(l=>({...s,src:l})):s).map(async s=>await Xo(Se(s.src),{ignore:Se(s.exclude).filter(Boolean)}).then(l=>({dest:s.dest??"",parent:Yo(s.src),src:l}))));for(const s of a)for(const l of s.src){let p;i.has(l)?p=i.get(l):(p={copied:[],dest:[],timestamp:0},i.set(l,p));const r=o.flatten?K(s.dest):j(s.dest,N(s.parent,M(l)));p.dest.includes(r)||p.dest.push(r),this.addWatchFile(l)}t.info({message:"Copying files...",prefix:"plugin:copy"}),await Promise.all([...i].map(async([s,l])=>{let p;try{const r=await wt(s);if(!r.isFile())return;const c=r.mtime.getTime();c>l.timestamp&&(l.timestamp=c,l.copied=[]),p=await Oe(s,{buffer:!0})}catch(r){t.error({context:[r],message:`error reading file ${s}`,prefix:"plugin:copy"});return}for(const r of l.dest){if(o.copyOnce&&l.copied.includes(r))continue;const c=ne(s),m=j(r,c);try{this.emitFile({[o.exactFileNames?"fileName":"name"]:m,source:p,type:"asset"}),t.debug({message:`copied ${s} → ${m}`,prefix:"plugin:copy"}),l.copied.push(r)}catch(d){t.error({context:[d],message:`error copying file ${s} → ${m}`,prefix:"plugin:copy"})}}}))},name:"packem:copy"}},"copyPlugin");function Di(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}g(Di,"getDefaultExportFromCjs");var st={exports:{}},Ft;function na(){return Ft||(Ft=1,function(e){var t=Object.defineProperty,i=g((c,m)=>t(c,"name",{value:m,configurable:!0}),"c"),o=Object.prototype.hasOwnProperty,n="~";function a(){}g(a,"Events"),i(a,"Events"),Object.create&&(a.prototype=Object.create(null),new a().__proto__||(n=!1));function s(c,m,d){this.fn=c,this.context=m,this.once=d||!1}g(s,"EE"),i(s,"EE");function l(c,m,d,u,h){if(typeof d!="function")throw new TypeError("The listener must be a function");var v=new s(d,u||c,h),x=n?n+m:m;return c._events[x]?c._events[x].fn?c._events[x]=[c._events[x],v]:c._events[x].push(v):(c._events[x]=v,c._eventsCount++),c}g(l,"addListener"),i(l,"addListener");function p(c,m){--c._eventsCount===0?c._events=new a:delete c._events[m]}g(p,"clearEvent"),i(p,"clearEvent");function r(){this._events=new a,this._eventsCount=0}g(r,"EventEmitter"),i(r,"EventEmitter"),r.prototype.eventNames=i(function(){var c=[],m,d;if(this._eventsCount===0)return c;for(d in m=this._events)o.call(m,d)&&c.push(n?d.slice(1):d);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(m)):c},"eventNames"),r.prototype.listeners=i(function(c){var m=n?n+c:c,d=this._events[m];if(!d)return[];if(d.fn)return[d.fn];for(var u=0,h=d.length,v=new Array(h);u<h;u++)v[u]=d[u].fn;return v},"listeners"),r.prototype.listenerCount=i(function(c){var m=n?n+c:c,d=this._events[m];return d?d.fn?1:d.length:0},"listenerCount"),r.prototype.emit=i(function(c,m,d,u,h,v){var x=n?n+c:c;if(!this._events[x])return!1;var f=this._events[x],y=arguments.length,k,w;if(f.fn){switch(f.once&&this.removeListener(c,f.fn,void 0,!0),y){case 1:return f.fn.call(f.context),!0;case 2:return f.fn.call(f.context,m),!0;case 3:return f.fn.call(f.context,m,d),!0;case 4:return f.fn.call(f.context,m,d,u),!0;case 5:return f.fn.call(f.context,m,d,u,h),!0;case 6:return f.fn.call(f.context,m,d,u,h,v),!0}for(w=1,k=new Array(y-1);w<y;w++)k[w-1]=arguments[w];f.fn.apply(f.context,k)}else{var b=f.length,S;for(w=0;w<b;w++)switch(f[w].once&&this.removeListener(c,f[w].fn,void 0,!0),y){case 1:f[w].fn.call(f[w].context);break;case 2:f[w].fn.call(f[w].context,m);break;case 3:f[w].fn.call(f[w].context,m,d);break;case 4:f[w].fn.call(f[w].context,m,d,u);break;default:if(!k)for(S=1,k=new Array(y-1);S<y;S++)k[S-1]=arguments[S];f[w].fn.apply(f[w].context,k)}}return!0},"emit"),r.prototype.on=i(function(c,m,d){return l(this,c,m,d,!1)},"on"),r.prototype.once=i(function(c,m,d){return l(this,c,m,d,!0)},"once"),r.prototype.removeListener=i(function(c,m,d,u){var h=n?n+c:c;if(!this._events[h])return this;if(!m)return p(this,h),this;var v=this._events[h];if(v.fn)v.fn===m&&(!u||v.once)&&(!d||v.context===d)&&p(this,h);else{for(var x=0,f=[],y=v.length;x<y;x++)(v[x].fn!==m||u&&!v[x].once||d&&v[x].context!==d)&&f.push(v[x]);f.length?this._events[h]=f.length===1?f[0]:f:p(this,h)}return this},"removeListener"),r.prototype.removeAllListeners=i(function(c){var m;return c?(m=n?n+c:c,this._events[m]&&p(this,m)):(this._events=new a,this._eventsCount=0),this},"removeAllListeners"),r.prototype.off=r.prototype.removeListener,r.prototype.addListener=r.prototype.on,r.prefixed=n,r.EventEmitter=r,e.exports=r}(st)),st.exports}g(na,"requireEventemitter3");var aa=na();const sa=Di(aa);var ra=Object.defineProperty,ge=g((e,t)=>ra(e,"name",{value:t,configurable:!0}),"o$9");class Ci extends Error{static{g(this,"TimeoutError")}static{ge(this,"TimeoutError")}constructor(t){super(t),this.name="TimeoutError"}}class la extends Error{static{g(this,"AbortError")}static{ge(this,"AbortError")}constructor(t){super(),this.name="AbortError",this.message=t}}const Rt=ge(e=>globalThis.DOMException===void 0?new la(e):new DOMException(e),"getDOMException"),Lt=ge(e=>{const t=e.reason===void 0?Rt("This operation was aborted."):e.reason;return t instanceof Error?t:Rt(t)},"getAbortedReason");function Ni(e,t){const{milliseconds:i,fallback:o,message:n,customTimers:a={setTimeout,clearTimeout}}=t;let s;const l=new Promise((p,r)=>{if(typeof i!="number"||Math.sign(i)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${i}\``);if(t.signal){const{signal:m}=t;m.aborted&&r(Lt(m));const d=ge(()=>{r(Lt(m))},"abortHandler");m.addEventListener("abort",d,{once:!0}),e.finally(()=>{m.removeEventListener("abort",d)})}if(i===Number.POSITIVE_INFINITY){e.then(p,r);return}const c=new Ci;s=a.setTimeout.call(void 0,()=>{if(o){try{p(o())}catch(m){r(m)}return}typeof e.cancel=="function"&&e.cancel(),n===!1?p():n instanceof Error?r(n):(c.message=n??`Promise timed out after ${i} milliseconds`,r(c))},i),(async()=>{try{p(await e)}catch(m){r(m)}})()}).finally(()=>{l.clear()});return l.clear=()=>{a.clearTimeout.call(void 0,s),s=void 0},l}g(Ni,"T");ge(Ni,"pTimeout");var pa=Object.defineProperty,ca=g((e,t)=>pa(e,"name",{value:t,configurable:!0}),"i$f");function _i(e,t,i){let o=0,n=e.length;for(;n>0;){const a=Math.trunc(n/2);let s=o+a;i(e[s],t)<=0?(o=++s,n-=a+1):n=a}return o}g(_i,"r$g");ca(_i,"lowerBound");var da=Object.defineProperty,ma=g((e,t)=>da(e,"name",{value:t,configurable:!0}),"s$g");let ua=class{static{g(this,"y")}static{ma(this,"PriorityQueue")}#e=[];enqueue(t,i){i={priority:0,...i};const o={priority:i.priority,run:t};if(this.size&&this.#e[this.size-1].priority>=i.priority){this.#e.push(o);return}const n=_i(this.#e,o,(a,s)=>s.priority-a.priority);this.#e.splice(n,0,o)}dequeue(){return this.#e.shift()?.run}filter(t){return this.#e.filter(i=>i.priority===t.priority).map(i=>i.run)}get size(){return this.#e.length}};var fa=Object.defineProperty,Jt=g((e,t)=>fa(e,"name",{value:t,configurable:!0}),"n$d");let ga=class extends sa{static{g(this,"d")}static{Jt(this,"PQueue")}#e;#i;#a=0;#r;#s;#f=0;#o;#p;#t;#g;#n=0;#c;#l;#v;timeout;constructor(t){if(super(),t={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:ua,...t},!(typeof t.intervalCap=="number"&&t.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${t.intervalCap?.toString()??""}\` (${typeof t.intervalCap})`);if(t.interval===void 0||!(Number.isFinite(t.interval)&&t.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${t.interval?.toString()??""}\` (${typeof t.interval})`);this.#e=t.carryoverConcurrencyCount,this.#i=t.intervalCap===Number.POSITIVE_INFINITY||t.interval===0,this.#r=t.intervalCap,this.#s=t.interval,this.#t=new t.queueClass,this.#g=t.queueClass,this.concurrency=t.concurrency,this.timeout=t.timeout,this.#v=t.throwOnTimeout===!0,this.#l=t.autoStart===!1}get#y(){return this.#i||this.#a<this.#r}get#b(){return this.#n<this.#c}#w(){this.#n--,this.#d(),this.emit("next")}#k(){this.#x(),this.#h(),this.#p=void 0}get#j(){const t=Date.now();if(this.#o===void 0){const i=this.#f-t;if(i<0)this.#a=this.#e?this.#n:0;else return this.#p===void 0&&(this.#p=setTimeout(()=>{this.#k()},i)),!0}return!1}#d(){if(this.#t.size===0)return this.#o&&clearInterval(this.#o),this.#o=void 0,this.emit("empty"),this.#n===0&&this.emit("idle"),!1;if(!this.#l){const t=!this.#j;if(this.#y&&this.#b){const i=this.#t.dequeue();return i?(this.emit("active"),i(),t&&this.#h(),!0):!1}}return!1}#h(){this.#i||this.#o!==void 0||(this.#o=setInterval(()=>{this.#x()},this.#s),this.#f=Date.now()+this.#s)}#x(){this.#a===0&&this.#n===0&&this.#o&&(clearInterval(this.#o),this.#o=void 0),this.#a=this.#e?this.#n:0,this.#m()}#m(){for(;this.#d(););}get concurrency(){return this.#c}set concurrency(t){if(!(typeof t=="number"&&t>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${t}\` (${typeof t})`);this.#c=t,this.#m()}async#$(t){return new Promise((i,o)=>{t.addEventListener("abort",()=>{o(t.reason)},{once:!0})})}async add(t,i={}){return i={timeout:this.timeout,throwOnTimeout:this.#v,...i},new Promise((o,n)=>{this.#t.enqueue(async()=>{this.#n++,this.#a++;try{i.signal?.throwIfAborted();let a=t({signal:i.signal});i.timeout&&(a=Ni(Promise.resolve(a),{milliseconds:i.timeout})),i.signal&&(a=Promise.race([a,this.#$(i.signal)]));const s=await a;o(s),this.emit("completed",s)}catch(a){if(a instanceof Ci&&!i.throwOnTimeout){o();return}n(a),this.emit("error",a)}finally{this.#w()}},i),this.emit("add"),this.#d()})}async addAll(t,i){return Promise.all(t.map(async o=>this.add(o,i)))}start(){return this.#l?(this.#l=!1,this.#m(),this):this}pause(){this.#l=!0}clear(){this.#t=new this.#g}async onEmpty(){this.#t.size!==0&&await this.#u("empty")}async onSizeLessThan(t){this.#t.size<t||await this.#u("next",()=>this.#t.size<t)}async onIdle(){this.#n===0&&this.#t.size===0||await this.#u("idle")}async#u(t,i){return new Promise(o=>{const n=Jt(()=>{i&&!i()||(this.off(t,n),o())},"listener");this.on(t,n)})}get size(){return this.#t.size}sizeBy(t){return this.#t.filter(t).length}get pending(){return this.#n}get isPaused(){return this.#l}};var va=Object.defineProperty,ha=g((e,t)=>va(e,"name",{value:t,configurable:!0}),"r$f");const Bt=ha((e,t)=>{if(!t)return!1;if(typeof t=="function")return t(e);if(typeof t.test=="function")return t.test(e);throw new Error("Invalid condition type")},"matchFile");var xa=Object.defineProperty,ya=g((e,t)=>xa(e,"name",{value:t,configurable:!0}),"a$p");const ba=4,wa=process.env.UV_THREADPOOL_SIZE?Number.parseInt(process.env.UV_THREADPOOL_SIZE,10):ba;let ka=class{static{g(this,"f")}static{ya(this,"LoaderManager")}test;loaders=new Map;options;workQueue;logger;constructor({extensions:t,loaders:i,logger:o,options:n}){this.test=a=>t.some(s=>a.toLowerCase().endsWith(s)),i.length>0&&this.add(...i),this.options=n,this.logger=o}add(...t){for(const i of t)this.loaders.has(i.name)||this.loaders.set(i.name,i)}isSupported(t){if(this.test(t))return!0;for(const[,i]of this.loaders)if(Bt(t,i.test))return!0;return!1}async process(t,i){this.workQueue||(this.workQueue=new ga({concurrency:wa-1}));for await(const[o,n]of this.loaders){const a={...i,options:this.options[o]??{}};if(n.alwaysProcess||Bt(a.id,n.test)){this.logger.debug(`Processing ${o} loader for ${a.id}`);const s=await this.workQueue.add(n.process.bind(a,t));s&&(t=s)}}return t}};const ja=/data:[^\n\r;]+(?:;charset=[^\n\r;]+)?;base64,([\d+/A-Za-z]+={0,2})/;var $a=Object.defineProperty,Ye=g((e,t)=>$a(e,"name",{value:t,configurable:!0}),"i$e");const Mi=/(?:\n|\r\n)?\/\*[#*@]+\s*sourceMappingURL\s*=\s*(\S+)\s*\*+\//g,Ti=/(?:\n|\r\n)?\/\/[#@]+\s*sourceMappingURL\s*=\s*(\S+)\s*?$/gm;let Ea=class{static{g(this,"S")}static{Ye(this,"MapModifier")}map;constructor(t){if(typeof t=="string")try{this.map=JSON.parse(t)}catch{}else this.map=t}modify(t){return this.map?(t(this.map),this):this}modifySources(t){return this.map?(this.map.sources&&(this.map.sources=this.map.sources.map(i=>t(i))),this):this}resolve(t=process.cwd()){return this.modifySources(i=>i==="<no source>"?i:E(t,i))}relative(t=process.cwd()){return this.modifySources(i=>i==="<no source>"?i:fe(i)?N(t,i):K(i))}toObject(){return this.map}toString(){return this.map?JSON.stringify(this.map):this.map}toConsumer(){return this.map?new en(this.map):this.map}toCommentData(){const t=this.toString();return t?`
37
37
  /*# sourceMappingURL=data:application/json;base64,${Buffer.from(t).toString("base64")} */`:""}toCommentFile(t){return this.map?`
38
- /*# sourceMappingURL=${t} */`:""}};Ye(async(e,t)=>{const[,i]=Mi.exec(e)??Ii.exec(e)??[];if(!i)return;const[,o]=Ea.exec(i)??[];if(o)return Buffer.from(o,"base64").toString();if(!t)throw new Error("Extracted map detected, but no ID is provided");const n=E(M(t),i);if(z(n))return Ke(n)},"getMap");Ye(e=>e.replaceAll(Mi,"").replaceAll(Ii,""),"stripMap");const ft=Ye(e=>new Oa(e),"mm");var Da=Object.defineProperty,Pa=g((e,t)=>Da(e,"name",{value:t,configurable:!0}),"u$e");const Ca=Pa(async e=>{const t=new nn({file:""}),i=[];let o=0;for await(const{css:n,map:a}of e){i.push(n);const s=ft(a),l=s.toObject();if(!l)continue;const p=s.toConsumer();if(p){if(p.eachMapping(r=>{t.addMapping({generated:{column:r.generatedColumn,line:o+r.generatedLine},name:r.name,original:{column:r.originalColumn,line:r.originalLine},source:r.source})}),l.sourcesContent)for(const r of l.sources)t.setSourceContent(r,p.sourceContentFor(r,!0));o+=n.split(`
38
+ /*# sourceMappingURL=${t} */`:""}};Ye(async(e,t)=>{const[,i]=Mi.exec(e)??Ti.exec(e)??[];if(!i)return;const[,o]=ja.exec(i)??[];if(o)return Buffer.from(o,"base64").toString();if(!t)throw new Error("Extracted map detected, but no ID is provided");const n=E(M(t),i);if(z(n))return Ke(n)},"getMap");Ye(e=>e.replaceAll(Mi,"").replaceAll(Ti,""),"stripMap");const ft=Ye(e=>new Ea(e),"mm");var Sa=Object.defineProperty,Oa=g((e,t)=>Sa(e,"name",{value:t,configurable:!0}),"u$e");const Pa=Oa(async e=>{const t=new tn({file:""}),i=[];let o=0;for await(const{css:n,map:a}of e){i.push(n);const s=ft(a),l=s.toObject();if(!l)continue;const p=s.toConsumer();if(p){if(p.eachMapping(r=>{t.addMapping({generated:{column:r.generatedColumn,line:o+r.generatedLine},name:r.name,original:{column:r.originalColumn,line:r.originalLine},source:r.source})}),l.sourcesContent)for(const r of l.sources)t.setSourceContent(r,p.sourceContentFor(r,!0));o+=n.split(`
39
39
  `).length}}return{css:i.join(`
40
- `),map:t}},"concat");var Na=Object.defineProperty,_a=g((e,t)=>Na(e,"name",{value:t,configurable:!0}),"s$f");const Ai=_a(e=>e.map((t,i,o)=>{const n=`\`${t}\``;switch(i){case o.length-1:return`or ${n}`;case o.length-2:return n;default:return`${n},`}}).join(" "),"default");var Ta=Object.defineProperty,Ma=g((e,t)=>Ta(e,"name",{value:t,configurable:!0}),"l$d");const Ia=M(ki(import.meta.url)),Wt=Ma((e,t)=>{const i={baseDirs:[Ia],caller:"Resolver",extensions:[".mjs",".js",".cjs",".json"],symlinks:!0,...t},o=new pn({extensions:i.extensions,symlinks:i.symlinks});for(const n of i.baseDirs)for(const a of e)try{const{error:s,path:l}=o.sync(n,a);if(l)return l;s&&console.debug(s,{context:{basedir:n,caller:t.caller,extensions:t.extensions,id:a}})}catch(s){console.debug(s.message,{context:{basedir:n,caller:t.caller,error:s,extensions:t.extensions,id:a}})}throw new Error(`${i.caller} could not resolve ${Ai(e)}`)},"resolve");var Aa=Object.defineProperty,za=g((e,t)=>Aa(e,"name",{value:t,configurable:!0}),"t$c");const se={},Fa=[".js",".mjs",".cjs",".json"],Ra=za(async(e,t)=>{if(se[e])return se[e];if(se[e]===null)return;const i={baseDirs:[t],caller:"Module loader",extensions:Fa,symlinks:!1};try{se[e]=require(Wt([e,`./${e}`],i))}catch(o){if(o.code==="ERR_REQUIRE_ESM")try{se[e]=an(await sn(Wt([e,`./${e}`],i)))}catch{}else{se[e]=null;return}}return se[e]},"default");var La=Object.defineProperty,ve=g((e,t)=>La(e,"name",{value:t,configurable:!0}),"r$e");const zi=["inject","extract","emit"],Ja=Ai(zi),Ba=ve(e=>{const t=Array.isArray(e)?e:[e];if(t[0]&&!zi.includes(t[0]))throw new Error(`Incorrect mode provided, allowed modes are ${Ja}`);return{emit:t[0]==="emit",extract:t[0]==="extract"&&(t[1]??!0),inject:(!t[0]||t[0]==="inject")&&(t[1]??!0)}},"inferModeOption"),gt=ve((e,t)=>typeof e=="boolean"?e&&{}:typeof e=="object"?e:t,"inferOption"),qa=ve(e=>{const t=Array.isArray(e)?e:[e];return t[0]?{content:!0,...t[1],inline:t[0]==="inline"}:!1},"inferSourceMapOption"),Ut=ve((e,t)=>{const i=gt(e,{});return t&&typeof i=="object"&&!i.alias&&(i.alias=t),i},"inferHandlerOption"),ue=ve(async(e,t,i)=>{if(typeof e!="string")return e;const o=await Ra(e,i);if(!o)throw new Error(`Unable to load PostCSS ${t} \`${e}\``);return o},"ensurePCSSOption"),Wa=ve(async(e,t)=>{if(e===void 0)return[];if(e.length===0)return[];const i=[];for await(const o of e.filter(Boolean)){if(!Array.isArray(o)){i.push(await ue(o,"plugin",t));continue}const[n,a]=o;a?i.push((await ue(n,"plugin",t))(a)):i.push(await ue(n,"plugin",t))}return i},"ensurePCSSPlugins");var Ua=Object.defineProperty,we=g((e,t)=>Ua(e,"name",{value:t,configurable:!0}),"b$4");const Va=we(async(e,t)=>e.sort((i,o)=>t.indexOf(i.name)-t.indexOf(o.name)),"sortByNameOrder"),Ka=we(async(e,t,i,o,n,a,s,l,p,r)=>{const c={...r,...e.alias},m=X(e.include,e.exclude),d=qa(e.sourceMap),u={...Ba(e.mode),autoModules:e.autoModules??!1,dts:e.dts,extensions:e.extensions,namedExports:e.namedExports};typeof u.inject=="object"&&u.inject.treeshakeable&&(u.namedExports=!1,t.info({message:"Disabling named exports due to `inject.treeshakeable` option",prefix:"css"}));let h=!1;if(e.loaders)for(const x of e.loaders)x.name==="postcss"&&(h=!0);else e.loaders=[];h&&(u.postcss={...e.postcss,config:gt(e.postcss?.config,{}),import:Ut(e.postcss?.import,c),modules:gt(e.postcss?.modules,void 0),to:e.postcss?.to,url:Ut(e.postcss?.url,c)},e.postcss?.parser&&(u.postcss.parser=await ue(e.postcss.parser,"parser",o)),e.postcss?.syntax&&(u.postcss.syntax=await ue(e.postcss.syntax,"syntax",o)),e.postcss?.stringifier&&(u.postcss.stringifier=await ue(e.postcss.stringifier,"stringifier",o)),e.postcss?.plugins&&(u.postcss.plugins=await Wa(e.postcss.plugins,o)));const v=new $a({extensions:u.extensions,loaders:await Va(e.loaders,["sourcemap","stylus","less","sass","postcss"]),logger:t,options:{...e,...u,alias:c}});let y=[];const f=we((x,k)=>{const w=[];for(const b of Object.keys(x)){const S=new Set;let I=[b];do{const B=[];for(const F of I){if(S.has(F))continue;if(v.isSupported(F)){m(F)&&B.push(F);continue}S.add(F);const ce=k(F);ce&&B.push(...ce.importedIds)}I=B}while(I.some(B=>!v.isSupported(B)));w.push(...I)}return w},"traverseImportedModules");return{augmentChunkHash(x){if(y.length===0)return null;const k=f(x.modules,this.getModuleInfo),w=y.filter(b=>k.includes(b.id)).sort((b,S)=>k.lastIndexOf(b.id)-k.lastIndexOf(S.id)).map(b=>`${ne(b.id)}:${b.css}`);return w.length===0?null:w.join(":")},async generateBundle(x,k){if(y.length===0||!(x.dir||x.file))return;const w=Object.values(k),b=x.dir??M(x.file),S=w.filter(O=>O.type==="chunk"),I=S.filter(O=>!O.facadeModuleId),B=x.preserveModules?S:S.filter(O=>O.isEntry||O.isDynamicEntry),F=[],ce=we(async(O,C)=>{const $=typeof u.extract=="string"?K(u.extract).replace(/^\.[/\\]/,""):K(`${O}.css`);fe($)&&this.error(["Extraction path must be relative to the output directory,",`which is ${_(o,b)}`].join(`
41
- `)),jt($)&&this.error(["Extraction path must be nested inside output directory,",`which is ${_(o,b)}`].join(`
42
- `));const q=y.filter(W=>C.includes(W.id)).sort((W,de)=>C.lastIndexOf(W.id)-C.lastIndexOf(de.id)),Ne=await Ca(q);return{css:Ne.css,map:ft(Ne.map.toString()).relative(M(E(b,$))).toString(),name:$}},"getExtractedData"),R=we(O=>{if(x.file)return nt(x.file).name;if(x.preserveModules){const{dir:C,name:$}=nt(O.fileName);return C?j(C,$):$}return O.name},"getName"),Q=[];if(typeof u.extract=="string"){t.debug({message:`Extracting to ${u.extract}`,prefix:"css"});const O=[];for(const $ of I){const q=f($.modules,this.getModuleInfo);Q.push(...q),O.push(...q)}for(const $ of B)O.push(...f($.modules,this.getModuleInfo).filter(q=>!Q.includes(q)));const C=R(S[0]);F.push([C,O])}else{t.debug({message:"Extracting to individual files",prefix:"css"});for(const O of I){const C=f(O.modules,this.getModuleInfo);if(C.length===0)continue;Q.push(...C);const $=R(O);F.push([$,C])}for(const O of B){const C=f(O.modules,this.getModuleInfo).filter(q=>!Q.includes(q));if(C.length===0)continue;const $=R(O);F.push([$,C])}}for await(const[O,C]of F){const $=await ce(O,C);if(typeof e.onExtract=="function"&&!e.onExtract($))continue;if(p&&e.minifier){t.info({message:`Minifying ${$.name} with ${e.minifier.name}`,prefix:"css"});const{css:W,map:de}=await e.minifier.handler.bind({browserTargets:i,warn:this.warn.bind(this)})($,d,e[e.minifier.name]??{});$.css=W,$.map=de}const q={fileName:$.name,name:$.name,names:[$.name],originalFileName:$.name,originalFileNames:[$.name],source:$.css,type:"asset"},Ne=this.emitFile(q);if($.map&&d){const W=this.getFileName(Ne),de=typeof x.assetFileNames=="string"?K(M(x.assetFileNames)):typeof x.assetFileNames=="function"?K(M(x.assetFileNames(q))):"assets",he=ft($.map).modify(T=>(T.file=ne(W),T)).modifySources(T=>{if(T==="<no source>"||de.length<=1)return T;T=`../${T}`;for(const it of de)it==="/"&&(T=`../${T}`);return T});if(d.inline)he.modify(T=>d.transform?.(T,K(j(b,W)))),k[W].source+=he.toCommentData();else{const T=`${W}.map`;he.modify(go=>d.transform?.(go,K(j(b,T)))),this.emitFile({fileName:T,source:he.toString(),type:"asset"});const{base:it}=nt(T);k[W].source+=he.toCommentFile(it)}}}},name:"packem:css",async transform(x,k){if(!m(k)||!v.isSupported(k)||x.replaceAll(/\s/g,"")==="")return null;try{return this.parse(x,{}),this.warn(`Skipping processed file ${_(o,k)}`),null}catch{}typeof e.onImport=="function"&&e.onImport(x,k);const w={alias:c,assets:new Map,autoModules:u.autoModules,browserTargets:i,cwd:o,debug:l,deps:new Set,dts:u.dts,emit:u.emit,environment:a,extensions:u.extensions,extract:u.extract,id:k,inject:u.inject,logger:t,namedExports:u.namedExports,options:{},plugin:this,sourceDir:n,sourceMap:d,useSourcemap:s,warn:this.warn.bind(this)},b=await v.process({code:x},w);for(const S of w.deps)this.addWatchFile(S);for(const[S,I]of w.assets)this.emitFile({fileName:S,source:I,type:"asset"});if(b.extracted){const{id:S}=b.extracted;y=y.filter(I=>I.id!==S),y.push(b.extracted)}return{code:b.code,map:d&&b.map?b.map:{mappings:""},meta:{styles:b.meta},moduleSideEffects:b.extracted?!0:null}}}},"default");var Ha=Object.defineProperty,Ga=g((e,t)=>Ha(e,"name",{value:t,configurable:!0}),"t$b");const Ya=/\.module\.(css|less|sass|scss|styl|stylus|pcss|postcss|sss)(?:$|\?)/,rt=Ga((e,t)=>e===void 0?!0:typeof e=="function"?e(t):e instanceof RegExp?e.test(t):e&&Ya.test(t),"ensureAutoModules");var Xa=Object.defineProperty,Qa=g((e,t)=>Xa(e,"name",{value:t,configurable:!0}),"u$b");const Za=`
40
+ `),map:t}},"concat");var Da=Object.defineProperty,Ca=g((e,t)=>Da(e,"name",{value:t,configurable:!0}),"s$f");const Ii=Ca(e=>e.map((t,i,o)=>{const n=`\`${t}\``;switch(i){case o.length-1:return`or ${n}`;case o.length-2:return n;default:return`${n},`}}).join(" "),"default");var Na=Object.defineProperty,_a=g((e,t)=>Na(e,"name",{value:t,configurable:!0}),"l$c");const Ma=M(wi(import.meta.url)),qt=_a((e,t)=>{const i={baseDirs:[Ma],caller:"Resolver",extensions:[".mjs",".js",".cjs",".json"],symlinks:!0,...t},o=new rn({extensions:i.extensions,symlinks:i.symlinks});for(const n of i.baseDirs)for(const a of e)try{const{error:s,path:l}=o.sync(n,a);if(l)return l;s&&console.debug(s,{context:{basedir:n,caller:t.caller,extensions:t.extensions,id:a}})}catch(s){console.debug(s.message,{context:{basedir:n,caller:t.caller,error:s,extensions:t.extensions,id:a}})}throw new Error(`${i.caller} could not resolve ${Ii(e)}`)},"resolve");var Ta=Object.defineProperty,Ia=g((e,t)=>Ta(e,"name",{value:t,configurable:!0}),"t$c");const se={},Aa=[".js",".mjs",".cjs",".json"],za=Ia(async(e,t)=>{if(se[e])return se[e];if(se[e]===null)return;const i={baseDirs:[t],caller:"Module loader",extensions:Aa,symlinks:!1};try{se[e]=require(qt([e,`./${e}`],i))}catch(o){if(o.code==="ERR_REQUIRE_ESM")try{se[e]=on(await nn(qt([e,`./${e}`],i)))}catch{}else{se[e]=null;return}}return se[e]},"default");var Fa=Object.defineProperty,ve=g((e,t)=>Fa(e,"name",{value:t,configurable:!0}),"r$e");const Ai=["inject","extract","emit"],Ra=Ii(Ai),La=ve(e=>{const t=Array.isArray(e)?e:[e];if(t[0]&&!Ai.includes(t[0]))throw new Error(`Incorrect mode provided, allowed modes are ${Ra}`);return{emit:t[0]==="emit",extract:t[0]==="extract"&&(t[1]??!0),inject:(!t[0]||t[0]==="inject")&&(t[1]??!0)}},"inferModeOption"),gt=ve((e,t)=>typeof e=="boolean"?e&&{}:typeof e=="object"?e:t,"inferOption"),Ja=ve(e=>{const t=Array.isArray(e)?e:[e];return t[0]?{content:!0,...t[1],inline:t[0]==="inline"}:!1},"inferSourceMapOption"),Wt=ve((e,t)=>{const i=gt(e,{});return t&&typeof i=="object"&&!i.alias&&(i.alias=t),i},"inferHandlerOption"),ue=ve(async(e,t,i)=>{if(typeof e!="string")return e;const o=await za(e,i);if(!o)throw new Error(`Unable to load PostCSS ${t} \`${e}\``);return o},"ensurePCSSOption"),Ba=ve(async(e,t)=>{if(e===void 0)return[];if(e.length===0)return[];const i=[];for await(const o of e.filter(Boolean)){if(!Array.isArray(o)){i.push(await ue(o,"plugin",t));continue}const[n,a]=o;a?i.push((await ue(n,"plugin",t))(a)):i.push(await ue(n,"plugin",t))}return i},"ensurePCSSPlugins");var qa=Object.defineProperty,we=g((e,t)=>qa(e,"name",{value:t,configurable:!0}),"b$3");const Wa=we(async(e,t)=>e.sort((i,o)=>t.indexOf(i.name)-t.indexOf(o.name)),"sortByNameOrder"),Ua=we(async(e,t,i,o,n,a,s,l,p,r)=>{const c={...r,...e.alias},m=Y(e.include,e.exclude),d=Ja(e.sourceMap),u={...La(e.mode),autoModules:e.autoModules??!1,dts:e.dts,extensions:e.extensions,namedExports:e.namedExports};typeof u.inject=="object"&&u.inject.treeshakeable&&(u.namedExports=!1,t.info({message:"Disabling named exports due to `inject.treeshakeable` option",prefix:"css"}));let h=!1;if(e.loaders)for(const y of e.loaders)y.name==="postcss"&&(h=!0);else e.loaders=[];h&&(u.postcss={...e.postcss,config:gt(e.postcss?.config,{}),import:Wt(e.postcss?.import,c),modules:gt(e.postcss?.modules,void 0),to:e.postcss?.to,url:Wt(e.postcss?.url,c)},e.postcss?.parser&&(u.postcss.parser=await ue(e.postcss.parser,"parser",o)),e.postcss?.syntax&&(u.postcss.syntax=await ue(e.postcss.syntax,"syntax",o)),e.postcss?.stringifier&&(u.postcss.stringifier=await ue(e.postcss.stringifier,"stringifier",o)),e.postcss?.plugins&&(u.postcss.plugins=await Ba(e.postcss.plugins,o)));const v=new ka({extensions:u.extensions,loaders:await Wa(e.loaders,["sourcemap","stylus","less","sass","postcss"]),logger:t,options:{...e,...u,alias:c}});let x=[];const f=we((y,k)=>{const w=[];for(const b of Object.keys(y)){const S=new Set;let T=[b];do{const B=[];for(const F of T){if(S.has(F))continue;if(v.isSupported(F)){m(F)&&B.push(F);continue}S.add(F);const ce=k(F);ce&&B.push(...ce.importedIds)}T=B}while(T.some(B=>!v.isSupported(B)));w.push(...T)}return w},"traverseImportedModules");return{augmentChunkHash(y){if(x.length===0)return null;const k=f(y.modules,this.getModuleInfo),w=x.filter(b=>k.includes(b.id)).sort((b,S)=>k.lastIndexOf(b.id)-k.lastIndexOf(S.id)).map(b=>`${ne(b.id)}:${b.css}`);return w.length===0?null:w.join(":")},async generateBundle(y,k){if(x.length===0||!(y.dir||y.file))return;const w=Object.values(k),b=y.dir??M(y.file),S=w.filter(O=>O.type==="chunk"),T=S.filter(O=>!O.facadeModuleId),B=y.preserveModules?S:S.filter(O=>O.isEntry||O.isDynamicEntry),F=[],ce=we(async(O,C)=>{const $=typeof u.extract=="string"?K(u.extract).replace(/^\.[/\\]/,""):K(`${O}.css`);fe($)&&this.error(["Extraction path must be relative to the output directory,",`which is ${N(o,b)}`].join(`
41
+ `)),kt($)&&this.error(["Extraction path must be nested inside output directory,",`which is ${N(o,b)}`].join(`
42
+ `));const q=x.filter(W=>C.includes(W.id)).sort((W,de)=>C.lastIndexOf(W.id)-C.lastIndexOf(de.id)),Ne=await Pa(q);return{css:Ne.css,map:ft(Ne.map.toString()).relative(M(E(b,$))).toString(),name:$}},"getExtractedData"),R=we(O=>{if(y.file)return nt(y.file).name;if(y.preserveModules){const{dir:C,name:$}=nt(O.fileName);return C?j(C,$):$}return O.name},"getName"),Q=[];if(typeof u.extract=="string"){t.debug({message:`Extracting to ${u.extract}`,prefix:"css"});const O=[];for(const $ of T){const q=f($.modules,this.getModuleInfo);Q.push(...q),O.push(...q)}for(const $ of B)O.push(...f($.modules,this.getModuleInfo).filter(q=>!Q.includes(q)));const C=R(S[0]);F.push([C,O])}else{t.debug({message:"Extracting to individual files",prefix:"css"});for(const O of T){const C=f(O.modules,this.getModuleInfo);if(C.length===0)continue;Q.push(...C);const $=R(O);F.push([$,C])}for(const O of B){const C=f(O.modules,this.getModuleInfo).filter(q=>!Q.includes(q));if(C.length===0)continue;const $=R(O);F.push([$,C])}}for await(const[O,C]of F){const $=await ce(O,C);if(typeof e.onExtract=="function"&&!e.onExtract($))continue;if(p&&e.minifier){t.info({message:`Minifying ${$.name} with ${e.minifier.name}`,prefix:"css"});const{css:W,map:de}=await e.minifier.handler.bind({browserTargets:i,warn:this.warn.bind(this)})($,d,e[e.minifier.name]??{});$.css=W,$.map=de}const q={fileName:$.name,name:$.name,names:[$.name],originalFileName:$.name,originalFileNames:[$.name],source:$.css,type:"asset"},Ne=this.emitFile(q);if($.map&&d){const W=this.getFileName(Ne),de=typeof y.assetFileNames=="string"?K(M(y.assetFileNames)):typeof y.assetFileNames=="function"?K(M(y.assetFileNames(q))):"assets",he=ft($.map).modify(_=>(_.file=ne(W),_)).modifySources(_=>{if(_==="<no source>"||de.length<=1)return _;_=`../${_}`;for(const it of de)it==="/"&&(_=`../${_}`);return _});if(d.inline)he.modify(_=>d.transform?.(_,K(j(b,W)))),k[W].source+=he.toCommentData();else{const _=`${W}.map`;he.modify(uo=>d.transform?.(uo,K(j(b,_)))),this.emitFile({fileName:_,source:he.toString(),type:"asset"});const{base:it}=nt(_);k[W].source+=he.toCommentFile(it)}}}},name:"packem:css",async transform(y,k){if(!m(k)||!v.isSupported(k)||y.replaceAll(/\s/g,"")==="")return null;try{return this.parse(y,{}),this.warn(`Skipping processed file ${N(o,k)}`),null}catch{}typeof e.onImport=="function"&&e.onImport(y,k);const w={alias:c,assets:new Map,autoModules:u.autoModules,browserTargets:i,cwd:o,debug:l,deps:new Set,dts:u.dts,emit:u.emit,environment:a,extensions:u.extensions,extract:u.extract,id:k,inject:u.inject,logger:t,namedExports:u.namedExports,options:{},plugin:this,sourceDir:n,sourceMap:d,useSourcemap:s,warn:this.warn.bind(this)},b=await v.process({code:y},w);for(const S of w.deps)this.addWatchFile(S);for(const[S,T]of w.assets)this.emitFile({fileName:S,source:T,type:"asset"});if(b.extracted){const{id:S}=b.extracted;x=x.filter(T=>T.id!==S),x.push(b.extracted)}return{code:b.code,map:d&&b.map?b.map:{mappings:""},meta:{styles:b.meta},moduleSideEffects:b.extracted?!0:null}}}},"default");var Va=Object.defineProperty,Ka=g((e,t)=>Va(e,"name",{value:t,configurable:!0}),"t$b");const Ga=/\.module\.(css|less|sass|scss|styl|stylus|pcss|postcss|sss)(?:$|\?)/,rt=Ka((e,t)=>e===void 0?!0:typeof e=="function"?e(t):e instanceof RegExp?e.test(t):e&&Ga.test(t),"ensureAutoModules");var Ha=Object.defineProperty,Ya=g((e,t)=>Ha(e,"name",{value:t,configurable:!0}),"u$b");const Xa=`
43
43
  /* eslint-disable */
44
44
  /* prettier-ignore */
45
45
  // @ts-nocheck
@@ -47,52 +47,52 @@ module.exports.default = `+s[2]+";");let p=l.toString();return p=p.replace(/(?:m
47
47
  * Generated by packem
48
48
  * @see https://npmjs.com/@visulima/packem
49
49
  */
50
- `.trim(),es=Qa((e,t,i)=>{let o;return e.postcss&&typeof e.postcss.modules=="boolean"?o=e.postcss.modules:e.lightningcss&&typeof e.lightningcss.modules=="boolean"&&(o=e.lightningcss.modules),{async transform(n,a){let s=o;if(e.postcss&&typeof e.postcss.modules=="object"?s=rt(e.postcss.modules.include,a):e.lightningcss&&typeof e.lightningcss.modules=="object"&&(s=rt(e.lightningcss.modules.include,a)),e.autoModules&&s===void 0&&(s=rt(e.autoModules,a)),!s)return null;const{types:l}=this.getModuleInfo(a)?.meta.styles??{};return l===void 0||await Ve(a)&&(await ui(a+".d.ts",`${Za}
51
- ${l}`),i.info({message:`Generated types for ${K(a).replace(t+"/","")}`,prefix:"dts:css-modules"}),this.addWatchFile(a+".d.ts")),null}}},"cssModulesTypes");var ts=Object.defineProperty,Xe=g((e,t)=>ts(e,"name",{value:t,configurable:!0}),"t$a");const is=/\Wrequire(?:\.resolve)?\(/,os=Xe((e,t)=>{if(Fe.INTERNAL_PACKEM_BUILD!=="1"&&(e.includes("// -- packem CommonJS __filename shim")||e.includes("// -- packem CommonJS __dirname shim")||e.includes("// -- packem CommonJS require shim")))return null;let i=!1,o=!1,n=!1;if(e.includes("__filename")&&(i=!0),e.includes("__dirname")&&(o=!0),is.test(e)&&(n=!0),!i&&!o&&!n)return null;const a=wi(e).pop(),s=a?a.end:0,l=new Y(e);return l.appendRight(s,t(i,o,n)),{code:l.toString(),map:l.generateMap()}},"CJSToESM"),ns=Xe((e,t,i)=>{let o="";return(e||t)&&(o+=`import __cjs_url__ from "node:url"; // -- packem CommonJS __filename shim --
50
+ `.trim(),Qa=Ya((e,t,i)=>{let o;return e.postcss&&typeof e.postcss.modules=="boolean"?o=e.postcss.modules:e.lightningcss&&typeof e.lightningcss.modules=="boolean"&&(o=e.lightningcss.modules),{async transform(n,a){let s=o;if(e.postcss&&typeof e.postcss.modules=="object"?s=rt(e.postcss.modules.include,a):e.lightningcss&&typeof e.lightningcss.modules=="object"&&(s=rt(e.lightningcss.modules.include,a)),e.autoModules&&s===void 0&&(s=rt(e.autoModules,a)),!s)return null;const{types:l}=this.getModuleInfo(a)?.meta.styles??{};return l===void 0||await Ve(a)&&(await mi(a+".d.ts",`${Xa}
51
+ ${l}`),i.info({message:`Generated types for ${K(a).replace(t+"/","")}`,prefix:"dts:css-modules"}),this.addWatchFile(a+".d.ts")),null}}},"cssModulesTypes");var Za=Object.defineProperty,Xe=g((e,t)=>Za(e,"name",{value:t,configurable:!0}),"t$a");const es=/\Wrequire(?:\.resolve)?\(/,ts=Xe((e,t)=>{if(Fe.INTERNAL_PACKEM_BUILD!=="1"&&(e.includes("// -- packem CommonJS __filename shim")||e.includes("// -- packem CommonJS __dirname shim")||e.includes("// -- packem CommonJS require shim")))return null;let i=!1,o=!1,n=!1;if(e.includes("__filename")&&(i=!0),e.includes("__dirname")&&(o=!0),es.test(e)&&(n=!0),!i&&!o&&!n)return null;const a=bi(e).pop(),s=a?a.end:0,l=new H(e);return l.appendRight(s,t(i,o,n)),{code:l.toString(),map:l.generateMap()}},"CJSToESM"),is=Xe((e,t,i)=>{let o="";return(e||t)&&(o+=`import __cjs_url__ from "node:url"; // -- packem CommonJS __filename shim --
52
52
  `),t&&(o+=`import __cjs_path__ from "node:path"; // -- packem CommonJS __dirname shim --
53
53
  `),i&&(o+=`import __cjs_mod__ from "node:module"; // -- packem CommonJS require shim --
54
54
  `),(e||t)&&(o+=`const __filename = __cjs_url__.fileURLToPath(import.meta.url);
55
55
  `),t&&(o+=`const __dirname = __cjs_path__.dirname(__filename);
56
56
  `),i&&(o+=`const require = __cjs_mod__.createRequire(import.meta.url);
57
- `),o},"generateCJSShim"),as=Xe((e,t,i)=>{let o="";return i&&(o+=`import __cjs_mod__ from "node:module"; // -- packem CommonJS require shim --
57
+ `),o},"generateCJSShim"),os=Xe((e,t,i)=>{let o="";return i&&(o+=`import __cjs_mod__ from "node:module"; // -- packem CommonJS require shim --
58
58
  `),e&&(o+=`const __filename = import.meta.filename; // -- packem CommonJS __filename shim --
59
59
  `),t&&(o+=`const __dirname = import.meta.dirname; // -- packem CommonJS __dirname shim --
60
60
  `),i&&(o+=`const require = __cjs_mod__.createRequire(import.meta.url);
61
- `),o},"generateCJSShimNode20_11"),ss=Xe((e,t)=>{const i=X(t.include,t.exclude);return{name:"packem:esm-shim-cjs-syntax",renderChunk(o,n,a){if(a.format==="es"&&i(n.fileName)){let s=ns;if(e.engines?.node){const l=bi(e.engines.node);l&&l.major>=20&&l.minor>=11&&(s=as)}return os(o,s)}return null}}},"esmShimCjsSyntaxPlugin");var rs=Object.defineProperty,ls=g((e,t)=>rs(e,"name",{value:t,configurable:!0}),"m$c");const ps=ls(()=>({name:"packem:fix-dynamic-import-extension",renderChunk(e,t,i){return i.format==="es"||i.format==="cjs"?{code:e.replaceAll(/(import\(.*)(.ts)(['´"`]\))/g,"$1."+(i.format==="es"?"mjs":"cjs")+"$3"),map:null}:null}}),"fixDynamicImportExtension");var cs=Object.defineProperty,ds=g((e,t)=>cs(e,"name",{value:t,configurable:!0}),"e$6");const Vt=/^([\w-]+):/,Kt=ds(e=>{if(!e||typeof e!="string")throw new Error("Invalid key: Key must be a non-empty string.");const t=[],i=Vt.exec(e);i&&(t.push(i[1]),e=e.replace(Vt,""));const o=e.split("/");for(const n of o)(n.includes("*")||n)&&t.push(n);return t},"splitTsconfigPathKey");var ms=Object.defineProperty,us=g((e,t)=>ms(e,"name",{value:t,configurable:!0}),"h$3");const fs=us((e,t)=>{const i=e.replace(/^\.\//,""),o=t.replace(/^\.\//,"");if(o.startsWith(i))return e+o.slice(i.length);if(e.endsWith(t))return e;const n=Kt(e),a=Kt(t);let s=n.length-1,l=a.length-1;for(;s>=0&&l>=0&&n[s]===a[l];)s--,l--;let p=n.slice(0,s).join("/");const r=a.slice(l).join("/");return(!p.startsWith(".")||p==="")&&(p="./"+p),p+(r?"/"+r:"")},"extendString");var gs=Object.defineProperty,vs=g((e,t)=>gs(e,"name",{value:t,configurable:!0}),"s$e");const hs=vs((...e)=>{if(e.length===0)return"";if(e.length===1)return M(e[0]);e=e.map(n=>Re(n));const[t,...i]=e;let o=t.split("/");for(const n of i){const a=n.split("/",o.length);let s=0;for(const l of a)if(l===o[s])s+=1;else{o=o.slice(0,s);break}o=o.slice(0,s)}return o.length<=1&&o[0]===""?`/${o[0]}`:o.join("/")},"lowestCommonAncestor");var xs=Object.defineProperty,lt=g((e,t)=>xs(e,"name",{value:t,configurable:!0}),"m$a");const ys=lt((e,t,i,o,n,a)=>{const s=X(n.include,n.exclude),l={},p=lt((m,d)=>{l[m.replace(ae,"")]=d},"addOutput");let r=[];a?.config.compilerOptions&&(r=Object.entries(a.config.compilerOptions.paths??{}).map(([m])=>m.endsWith("*")?new RegExp(`^${m.replace("*","(.*)")}$`):new RegExp(`^${m}$`)));async function c(m,d){if(!s(d))return;let u;try{u=(await cn(m,{sourceFilename:d})).program}catch{}if(u){const f=u.body.filter(x=>x.type==="ImportDeclaration"||x.type==="ExportAllDeclaration"||x.type==="ExportNamedDeclaration");for await(const x of f){if(!x.source||ne(x.source.value).includes("."))continue;const k=await this.resolve(x.source.value,d);if(!(!k||k.external)&&(k.id.endsWith(".ts")||k.id.endsWith(".cts")||k.id.endsWith(".mts")||k.id.endsWith(".tsx")||k.id.endsWith(".ctsx")||k.id.endsWith(".mtsx"))){const w=k.id.replace(e+"/","");let b=x.source.value;r.some(S=>S.test(x.source.value))&&!x.source.value.startsWith(".")&&(b="./"+x.source.value),m=m.replaceAll('from "'+x.source.value+'"','from "'+fs(b,w)+'"')}}}const{errors:h,sourceText:v}=await t(d,m);if(h.length>0){if(n.ignoreErrors){this.warn(h[0]);return}return this.error(h[0])}if(p(d,v),!u)return;const y=u.body.filter(f=>f.type==="ImportDeclaration"?f.importKind==="type"?!0:f.specifiers?.every(x=>x.type==="ImportSpecifier"&&x.importKind==="type"):f.type==="ExportNamedDeclaration"||f.type==="ExportAllDeclaration"?f.exportKind==="type"?!0:f.type==="ExportNamedDeclaration"&&f.specifiers?.every(x=>x.type==="ExportSpecifier"&&x.exportKind==="type"):!1);for await(const f of y){if(!f.source)continue;const x=await this.resolve(f.source.value,d);if(!x)return;const k=x.id;if(s(k)&&!l[k.replace(ae,"")])try{const w=await Oe(k);await c.call(this,w,k)}catch{}}}return g(c,"N"),lt(c,"transform"),{name:"packem:isolated-declarations",async renderStart(m,{input:d}){const u=hs(...Array.isArray(d)?d:Object.values(d));typeof m.entryFileNames=="function"&&(m.entryFileNames=m.entryFileNames({name:m.name}));const h=m.entryFileNames.replace(/\.(.)?[jt]sx?$/,(v,y)=>`.d.${y||""}ts`);for await(let[v,y]of Object.entries(l)){if(o&&m.format==="cjs"){const x=Di(y);x!==null&&(y=x.code)}const f=y.includes("from '")?"'":'"';(i===!0||i==="compatible")&&m.format==="cjs"&&this.emitFile({fileName:h.replace("[name]",_(u,v)).replace(".cts",".ts"),source:y.replaceAll(/(from\s)['|"]((.*)\..+|['|"].*)['|"];?/g,(x,k,w,b)=>k+f+(b||w)+".d.ts"+f+";"),type:"asset"}),this.emitFile({fileName:h.replace("[name]",_(u,v)),source:y.replaceAll(/(from\s)['|"]((.*)\..+|['|"].*)['|"];?/g,(x,k,w,b)=>k+f+(b||w)+(m.format==="cjs"?".d.cts":".d.mts")+f+";"),type:"asset"})}},transform:c}},"isolatedDeclarationsPlugin");var bs=Object.defineProperty,ws=g((e,t)=>bs(e,"name",{value:t,configurable:!0}),"n$a");const Ht="export default ",Fi=ws(e=>{const t=dn(e);return{...t,name:"packem:json",transform(i,o){const n=t.transform?.call(this,i,o);return n&&typeof n!="string"&&"code"in n&&n.code?.startsWith(Ht)&&(n.code=n.code.replace(Ht,"module.exports = ")),n}}},"JSONPlugin");var ks=Object.defineProperty,_e=g((e,t)=>ks(e,"name",{value:t,configurable:!0}),"i$b");class Ri{static{g(this,"WalkerBase")}static{_e(this,"WalkerBase")}constructor(){this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:_e(()=>this.should_skip=!0,"skip"),remove:_e(()=>this.should_remove=!0,"remove"),replace:_e(t=>this.replacement=t,"replace")}}replace(t,i,o,n){t&&i&&(o!=null?t[i][o]=n:t[i]=n)}remove(t,i,o){t&&i&&(o!=null?t[i].splice(o,1):delete t[i])}}var js=Object.defineProperty,ke=g((e,t)=>js(e,"name",{value:t,configurable:!0}),"c$g");class $s extends Ri{static{g(this,"SyncWalker")}static{ke(this,"SyncWalker")}constructor(t,i){super(),this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:ke(()=>this.should_skip=!0,"skip"),remove:ke(()=>this.should_remove=!0,"remove"),replace:ke(o=>this.replacement=o,"replace")},this.enter=t,this.leave=i}visit(t,i,o,n){if(t){if(this.enter){const s=this.should_skip,l=this.should_remove,p=this.replacement;this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.enter.call(this.context,t,i,o,n),this.replacement&&(t=this.replacement,this.replace(i,o,n,t)),this.should_remove&&this.remove(i,o,n);const r=this.should_skip,c=this.should_remove;if(this.should_skip=s,this.should_remove=l,this.replacement=p,r)return t;if(c)return null}let a;for(a in t){const s=t[a];if(s&&typeof s=="object")if(Array.isArray(s)){const l=s;for(let p=0;p<l.length;p+=1){const r=l[p];vt(r)&&(this.visit(r,t,a,p)||p--)}}else vt(s)&&this.visit(s,t,a,null)}if(this.leave){const s=this.replacement,l=this.should_remove;this.replacement=null,this.should_remove=!1,this.leave.call(this.context,t,i,o,n),this.replacement&&(t=this.replacement,this.replace(i,o,n,t)),this.should_remove&&this.remove(i,o,n);const p=this.should_remove;if(this.replacement=s,this.should_remove=l,p)return null}}return t}}function vt(e){return e!==null&&typeof e=="object"&&"type"in e&&typeof e.type=="string"}g(vt,"n$9");ke(vt,"isNode");var Es=Object.defineProperty,je=g((e,t)=>Es(e,"name",{value:t,configurable:!0}),"c$f");class Ss extends Ri{static{g(this,"AsyncWalker")}static{je(this,"AsyncWalker")}constructor(t,i){super(),this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:je(()=>this.should_skip=!0,"skip"),remove:je(()=>this.should_remove=!0,"remove"),replace:je(o=>this.replacement=o,"replace")},this.enter=t,this.leave=i}async visit(t,i,o,n){if(t){if(this.enter){const s=this.should_skip,l=this.should_remove,p=this.replacement;this.should_skip=!1,this.should_remove=!1,this.replacement=null,await this.enter.call(this.context,t,i,o,n),this.replacement&&(t=this.replacement,this.replace(i,o,n,t)),this.should_remove&&this.remove(i,o,n);const r=this.should_skip,c=this.should_remove;if(this.should_skip=s,this.should_remove=l,this.replacement=p,r)return t;if(c)return null}let a;for(a in t){const s=t[a];if(s&&typeof s=="object")if(Array.isArray(s)){const l=s;for(let p=0;p<l.length;p+=1){const r=l[p];ht(r)&&(await this.visit(r,t,a,p)||p--)}}else ht(s)&&await this.visit(s,t,a,null)}if(this.leave){const s=this.replacement,l=this.should_remove;this.replacement=null,this.should_remove=!1,await this.leave.call(this.context,t,i,o,n),this.replacement&&(t=this.replacement,this.replace(i,o,n,t)),this.should_remove&&this.remove(i,o,n);const p=this.should_remove;if(this.replacement=s,this.should_remove=l,p)return null}}return t}}function ht(e){return e!==null&&typeof e=="object"&&"type"in e&&typeof e.type=="string"}g(ht,"a$l");je(ht,"isNode");var Os=Object.defineProperty,Li=g((e,t)=>Os(e,"name",{value:t,configurable:!0}),"a$k");function St(e,{enter:t,leave:i}){return new $s(t,i).visit(e,null)}g(St,"walk");Li(St,"walk");async function Ds(e,{enter:t,leave:i}){return await new Ss(t,i).visit(e,null)}g(Ds,"asyncWalk");Li(Ds,"asyncWalk");var Ps=Object.defineProperty,Cs=g((e,t)=>Ps(e,"name",{value:t,configurable:!0}),"u$9");const Ns=Cs(({attributes:e,logger:t})=>{const i=X([/\.[tj]sx$/],/node_modules/);if(!Array.isArray(e)||e.length===0)throw new Error("[packem:jsx-remove-attributes]: attributes must be a non-empty array of strings.");return{name:"packem:jsx-remove-attributes",transform(o,n){if(!i(n))return null;let a=null;try{a=this.parse(o,{allowReturnOutsideFunction:!0})}catch(p){return this.warn({code:"PARSE_ERROR",message:`[packem:jsx-remove-attributes]: failed to parse "${n}" and remove the jsx attribute.`}),t.warn(p),null}let s=!1;const l=new Y(o);return St(a,{enter(p){if(p.type==="CallExpression"&&p.callee.type==="Identifier"&&p.callee.name==="jsx"){const r=p.arguments.filter(c=>c.type==="ObjectExpression"&&Array.isArray(c.properties));for(const c of r)for(const m of c.properties)m.type==="Property"&&m.key.type==="Literal"&&m.value.type==="Literal"&&e.includes(m.key.value)&&(l.overwrite(m.start-2,m.end,""),s=!0)}}}),s?{code:l.toString(),map:l.generateMap({hires:!0})}:null}}},"jsxRemoveAttributes");var _s=Object.defineProperty,Ts=g((e,t)=>_s(e,"name",{value:t,configurable:!0}),"r$c");const Ms=Ts((e,t,i)=>{const o=new RegExp(`(<!-- ${t} -->)[\\s\\S]*?(<!-- /${t} -->)`,"g");if(o.test(e))return e.replace(o,`$1
61
+ `),o},"generateCJSShimNode20_11"),ns=Xe((e,t)=>{const i=Y(t.include,t.exclude);return{name:"packem:esm-shim-cjs-syntax",renderChunk(o,n,a){if(a.format==="es"&&i(n.fileName)){let s=is;if(e.engines?.node){const l=yi(e.engines.node);l&&l.major>=20&&l.minor>=11&&(s=os)}return ts(o,s)}return null}}},"esmShimCjsSyntaxPlugin");var as=Object.defineProperty,ss=g((e,t)=>as(e,"name",{value:t,configurable:!0}),"m$c");const rs=ss(()=>({name:"packem:fix-dynamic-import-extension",renderChunk(e,t,i){return i.format==="es"||i.format==="cjs"?{code:e.replaceAll(/(import\(.*)(.ts)(['´"`]\))/g,"$1."+(i.format==="es"?"mjs":"cjs")+"$3"),map:null}:null}}),"fixDynamicImportExtension");var ls=Object.defineProperty,ps=g((e,t)=>ls(e,"name",{value:t,configurable:!0}),"e$7");const Ut=/^([\w-]+):/,Vt=ps(e=>{if(!e||typeof e!="string")throw new Error("Invalid key: Key must be a non-empty string.");const t=[],i=Ut.exec(e);i&&(t.push(i[1]),e=e.replace(Ut,""));const o=e.split("/");for(const n of o)(n.includes("*")||n)&&t.push(n);return t},"splitTsconfigPathKey");var cs=Object.defineProperty,ds=g((e,t)=>cs(e,"name",{value:t,configurable:!0}),"h$2");const ms=ds((e,t)=>{const i=e.replace(/^\.\//,""),o=t.replace(/^\.\//,"");if(o.startsWith(i))return e+o.slice(i.length);if(e.endsWith(t))return e;const n=Vt(e),a=Vt(t);let s=n.length-1,l=a.length-1;for(;s>=0&&l>=0&&n[s]===a[l];)s--,l--;let p=n.slice(0,s).join("/");const r=a.slice(l).join("/");return(!p.startsWith(".")||p==="")&&(p="./"+p),p+(r?"/"+r:"")},"extendString");var us=Object.defineProperty,fs=g((e,t)=>us(e,"name",{value:t,configurable:!0}),"s$e");const gs=fs((...e)=>{if(e.length===0)return"";if(e.length===1)return M(e[0]);e=e.map(n=>Re(n));const[t,...i]=e;let o=t.split("/");for(const n of i){const a=n.split("/",o.length);let s=0;for(const l of a)if(l===o[s])s+=1;else{o=o.slice(0,s);break}o=o.slice(0,s)}return o.length<=1&&o[0]===""?`/${o[0]}`:o.join("/")},"lowestCommonAncestor");var vs=Object.defineProperty,lt=g((e,t)=>vs(e,"name",{value:t,configurable:!0}),"m$a");const hs=lt((e,t,i,o,n,a)=>{const s=Y(n.include,n.exclude),l={},p=lt((m,d)=>{l[m.replace(ae,"")]=d},"addOutput");let r=[];a?.config.compilerOptions&&(r=Object.entries(a.config.compilerOptions.paths??{}).map(([m])=>m.endsWith("*")?new RegExp(`^${m.replace("*","(.*)")}$`):new RegExp(`^${m}$`)));async function c(m,d){if(!s(d))return;let u;try{u=(await ln(m,{sourceFilename:d})).program}catch{}if(u){const f=u.body.filter(y=>y.type==="ImportDeclaration"||y.type==="ExportAllDeclaration"||y.type==="ExportNamedDeclaration");for await(const y of f){if(!y.source||ne(y.source.value).includes("."))continue;const k=await this.resolve(y.source.value,d);if(!(!k||k.external)&&(k.id.endsWith(".ts")||k.id.endsWith(".cts")||k.id.endsWith(".mts")||k.id.endsWith(".tsx")||k.id.endsWith(".ctsx")||k.id.endsWith(".mtsx"))){const w=k.id.replace(e+"/","");let b=y.source.value;r.some(S=>S.test(y.source.value))&&!y.source.value.startsWith(".")&&(b="./"+y.source.value),m=m.replaceAll('from "'+y.source.value+'"','from "'+ms(b,w)+'"')}}}const{errors:h,sourceText:v}=await t(d,m);if(h.length>0){if(n.ignoreErrors){this.warn(h[0]);return}return this.error(h[0])}if(p(d,v),!u)return;const x=u.body.filter(f=>f.type==="ImportDeclaration"?f.importKind==="type"?!0:f.specifiers?.every(y=>y.type==="ImportSpecifier"&&y.importKind==="type"):f.type==="ExportNamedDeclaration"||f.type==="ExportAllDeclaration"?f.exportKind==="type"?!0:f.type==="ExportNamedDeclaration"&&f.specifiers?.every(y=>y.type==="ExportSpecifier"&&y.exportKind==="type"):!1);for await(const f of x){if(!f.source)continue;const y=await this.resolve(f.source.value,d);if(!y)return;const k=y.id;if(s(k)&&!l[k.replace(ae,"")])try{const w=await Oe(k);await c.call(this,w,k)}catch{}}}return g(c,"N"),lt(c,"transform"),{name:"packem:isolated-declarations",async renderStart(m,{input:d}){const u=gs(...Array.isArray(d)?d:Object.values(d));typeof m.entryFileNames=="function"&&(m.entryFileNames=m.entryFileNames({name:m.name}));const h=m.entryFileNames.replace(/\.(.)?[jt]sx?$/,(v,x)=>`.d.${x||""}ts`);for await(let[v,x]of Object.entries(l)){if(o&&m.format==="cjs"){const y=Oi(x);y!==null&&(x=y.code)}const f=x.includes("from '")?"'":'"';(i===!0||i==="compatible")&&m.format==="cjs"&&this.emitFile({fileName:h.replace("[name]",N(u,v)).replace(".cts",".ts"),source:x.replaceAll(/(from\s)['|"]((.*)\..+|['|"].*)['|"];?/g,(y,k,w,b)=>k+f+(b||w)+".d.ts"+f+";"),type:"asset"}),this.emitFile({fileName:h.replace("[name]",N(u,v)),source:x.replaceAll(/(from\s)['|"]((.*)\..+|['|"].*)['|"];?/g,(y,k,w,b)=>k+f+(b||w)+(m.format==="cjs"?".d.cts":".d.mts")+f+";"),type:"asset"})}},transform:c}},"isolatedDeclarationsPlugin");var xs=Object.defineProperty,ys=g((e,t)=>xs(e,"name",{value:t,configurable:!0}),"n$a");const Kt="export default ",zi=ys(e=>{const t=pn(e);return{...t,name:"packem:json",transform(i,o){const n=t.transform?.call(this,i,o);return n&&typeof n!="string"&&"code"in n&&n.code?.startsWith(Kt)&&(n.code=n.code.replace(Kt,"module.exports = ")),n}}},"JSONPlugin");var bs=Object.defineProperty,_e=g((e,t)=>bs(e,"name",{value:t,configurable:!0}),"i$b");class Fi{static{g(this,"WalkerBase")}static{_e(this,"WalkerBase")}constructor(){this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:_e(()=>this.should_skip=!0,"skip"),remove:_e(()=>this.should_remove=!0,"remove"),replace:_e(t=>this.replacement=t,"replace")}}replace(t,i,o,n){t&&i&&(o!=null?t[i][o]=n:t[i]=n)}remove(t,i,o){t&&i&&(o!=null?t[i].splice(o,1):delete t[i])}}var ws=Object.defineProperty,ke=g((e,t)=>ws(e,"name",{value:t,configurable:!0}),"c$h");class ks extends Fi{static{g(this,"SyncWalker")}static{ke(this,"SyncWalker")}constructor(t,i){super(),this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:ke(()=>this.should_skip=!0,"skip"),remove:ke(()=>this.should_remove=!0,"remove"),replace:ke(o=>this.replacement=o,"replace")},this.enter=t,this.leave=i}visit(t,i,o,n){if(t){if(this.enter){const s=this.should_skip,l=this.should_remove,p=this.replacement;this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.enter.call(this.context,t,i,o,n),this.replacement&&(t=this.replacement,this.replace(i,o,n,t)),this.should_remove&&this.remove(i,o,n);const r=this.should_skip,c=this.should_remove;if(this.should_skip=s,this.should_remove=l,this.replacement=p,r)return t;if(c)return null}let a;for(a in t){const s=t[a];if(s&&typeof s=="object")if(Array.isArray(s)){const l=s;for(let p=0;p<l.length;p+=1){const r=l[p];vt(r)&&(this.visit(r,t,a,p)||p--)}}else vt(s)&&this.visit(s,t,a,null)}if(this.leave){const s=this.replacement,l=this.should_remove;this.replacement=null,this.should_remove=!1,this.leave.call(this.context,t,i,o,n),this.replacement&&(t=this.replacement,this.replace(i,o,n,t)),this.should_remove&&this.remove(i,o,n);const p=this.should_remove;if(this.replacement=s,this.should_remove=l,p)return null}}return t}}function vt(e){return e!==null&&typeof e=="object"&&"type"in e&&typeof e.type=="string"}g(vt,"n$9");ke(vt,"isNode");var js=Object.defineProperty,je=g((e,t)=>js(e,"name",{value:t,configurable:!0}),"c$g");class $s extends Fi{static{g(this,"AsyncWalker")}static{je(this,"AsyncWalker")}constructor(t,i){super(),this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:je(()=>this.should_skip=!0,"skip"),remove:je(()=>this.should_remove=!0,"remove"),replace:je(o=>this.replacement=o,"replace")},this.enter=t,this.leave=i}async visit(t,i,o,n){if(t){if(this.enter){const s=this.should_skip,l=this.should_remove,p=this.replacement;this.should_skip=!1,this.should_remove=!1,this.replacement=null,await this.enter.call(this.context,t,i,o,n),this.replacement&&(t=this.replacement,this.replace(i,o,n,t)),this.should_remove&&this.remove(i,o,n);const r=this.should_skip,c=this.should_remove;if(this.should_skip=s,this.should_remove=l,this.replacement=p,r)return t;if(c)return null}let a;for(a in t){const s=t[a];if(s&&typeof s=="object")if(Array.isArray(s)){const l=s;for(let p=0;p<l.length;p+=1){const r=l[p];ht(r)&&(await this.visit(r,t,a,p)||p--)}}else ht(s)&&await this.visit(s,t,a,null)}if(this.leave){const s=this.replacement,l=this.should_remove;this.replacement=null,this.should_remove=!1,await this.leave.call(this.context,t,i,o,n),this.replacement&&(t=this.replacement,this.replace(i,o,n,t)),this.should_remove&&this.remove(i,o,n);const p=this.should_remove;if(this.replacement=s,this.should_remove=l,p)return null}}return t}}function ht(e){return e!==null&&typeof e=="object"&&"type"in e&&typeof e.type=="string"}g(ht,"a$j");je(ht,"isNode");var Es=Object.defineProperty,Ri=g((e,t)=>Es(e,"name",{value:t,configurable:!0}),"a$i");function Et(e,{enter:t,leave:i}){return new ks(t,i).visit(e,null)}g(Et,"walk");Ri(Et,"walk");async function Ss(e,{enter:t,leave:i}){return await new $s(t,i).visit(e,null)}g(Ss,"asyncWalk");Ri(Ss,"asyncWalk");var Os=Object.defineProperty,Ps=g((e,t)=>Os(e,"name",{value:t,configurable:!0}),"u$9");const Ds=Ps(({attributes:e,logger:t})=>{const i=Y([/\.[tj]sx$/],/node_modules/);if(!Array.isArray(e)||e.length===0)throw new Error("[packem:jsx-remove-attributes]: attributes must be a non-empty array of strings.");return{name:"packem:jsx-remove-attributes",transform(o,n){if(!i(n))return null;let a=null;try{a=this.parse(o,{allowReturnOutsideFunction:!0})}catch(p){return this.warn({code:"PARSE_ERROR",message:`[packem:jsx-remove-attributes]: failed to parse "${n}" and remove the jsx attribute.`}),t.warn(p),null}let s=!1;const l=new H(o);return Et(a,{enter(p){if(p.type==="CallExpression"&&p.callee.type==="Identifier"&&p.callee.name==="jsx"){const r=p.arguments.filter(c=>c.type==="ObjectExpression"&&Array.isArray(c.properties));for(const c of r)for(const m of c.properties)m.type==="Property"&&m.key.type==="Literal"&&m.value.type==="Literal"&&e.includes(m.key.value)&&(l.overwrite(m.start-2,m.end,""),s=!0)}}}),s?{code:l.toString(),map:l.generateMap({hires:!0})}:null}}},"jsxRemoveAttributes");var Cs=Object.defineProperty,Ns=g((e,t)=>Cs(e,"name",{value:t,configurable:!0}),"r$c");const _s=Ns((e,t,i)=>{const o=new RegExp(`(<!-- ${t} -->)[\\s\\S]*?(<!-- /${t} -->)`,"g");if(o.test(e))return e.replace(o,`$1
62
62
  ${i}
63
- $2`)},"replaceContentWithin");var Is=Object.defineProperty,Ji=g((e,t)=>Is(e,"name",{value:t,configurable:!0}),"d$b");const As=Ji(e=>{const t=[],i=[];return e.forEach(o=>{o.startsWith("(")?t.push(o):i.push(o)}),[...i.sort(),...t.sort()]},"sortLicenses"),Bi=Ji(({dtsMarker:e,licenseFilePath:t,licenseTemplate:i,logger:o,marker:n,mode:a,packageName:s})=>mn({thirdParty(l){const p=new Set,r=l.sort(({name:m},{name:d})=>(m||0)>(d||0)?1:(d||0)>(m||0)?-1:0).map(({author:m,contributors:d,license:u,licenseText:h,maintainers:v,name:y,repository:f})=>{let x="## "+y+`
64
- `;u&&(x+=`License: ${u}
65
- `);const k=new Set;for(const w of[m,...v,...d]){const b=typeof w=="string"?w:w?.name;b&&k.add(b)}return k.size>0&&(x+=`By: ${[...k].join(", ")}
66
- `),f&&(x+=`Repository: ${typeof f=="string"?f:f.url}
67
- `),h&&(x+=`
63
+ $2`)},"replaceContentWithin");var Ms=Object.defineProperty,Li=g((e,t)=>Ms(e,"name",{value:t,configurable:!0}),"d$b");const Ts=Li(e=>{const t=[],i=[];return e.forEach(o=>{o.startsWith("(")?t.push(o):i.push(o)}),[...i.sort(),...t.sort()]},"sortLicenses"),Ji=Li(({dtsMarker:e,licenseFilePath:t,licenseTemplate:i,logger:o,marker:n,mode:a,packageName:s})=>cn({thirdParty(l){const p=new Set,r=l.sort(({name:m},{name:d})=>(m||0)>(d||0)?1:(d||0)>(m||0)?-1:0).map(({author:m,contributors:d,license:u,licenseText:h,maintainers:v,name:x,repository:f})=>{let y="## "+x+`
64
+ `;u&&(y+=`License: ${u}
65
+ `);const k=new Set;for(const w of[m,...v,...d]){const b=typeof w=="string"?w:w?.name;b&&k.add(b)}return k.size>0&&(y+=`By: ${[...k].join(", ")}
66
+ `),f&&(y+=`Repository: ${typeof f=="string"?f:f.url}
67
+ `),h&&(y+=`
68
68
  `+h.trim().replaceAll(/\r\n|\r/g,`
69
69
  `).replaceAll(`<!-- ${n} -->`,"").replaceAll(e?`<!-- ${e} -->`:"","").replaceAll(`<!-- /${n} -->`,"").replaceAll(e?`<!-- /${e} -->`:"","").trim().split(`
70
70
  `).map(w=>w?`> ${w}`:">").join(`
71
71
  `)+`
72
- `),u&&p.add(u),x}).join(`
72
+ `),u&&p.add(u),y}).join(`
73
73
  ---------------------------------------
74
74
 
75
- `);if(r===""){o.info({message:"No dependencies license information found.",prefix:"plugin:license:"+a});return}const c=i(As(p),r,s);try{const m=Ke(t),d=Ms(m,n,c);if(!d){o.error({message:`Could not find the license marker: <!-- ${n} --><!-- /${n} --> in ${t}`,prefix:"plugin:license:"+a});return}m!==d&&(le(t,d),o.info({message:`${t} updated.`,prefix:"plugin:license:"+a}))}catch(m){o.error(m)}}}),"license");var zs=Object.defineProperty,Fs=g((e,t)=>zs(e,"name",{value:t,configurable:!0}),"u$8");const Rs=Fs(()=>({async generateBundle(e,t){const i=[];for(const n of this.getModuleIds()){const a=this.getModuleInfo(n);if(a!=null&&!a.isExternal)for(const s of a.importedIds)i.push({source:n,target:s})}if(Array.isArray(i)&&i.length===0)return;const o=Object.keys(t);this.emitFile({fileName:`metafile-${o[0].replace(ae,"")}-${e.format}.json`,source:JSON.stringify(i,null,2),type:"asset"})},name:"packem:metafile"}),"metafilePlugin");var Ls=Object.defineProperty,Js=g((e,t)=>Ls(e,"name",{value:t,configurable:!0}),"g$8");let Gt=!1;const Bs=Js((e,t,i,o,n,a)=>{if(a!=="*"&&Go(Yo(a))===null)throw new Error("Invalid typeScriptVersion option. It must be a valid semver range.");return{name:"packem:node10-compatibility",writeBundle(){Gt||(e.info({message:"Declaration node10 compatibility mode is enabled.",prefix:"plugin:node10-compatibility"}),Gt=!0);const s={};for(const r of t)for(const c of r.exportKey)c.includes("/*")?s[c]=["./"+j(i,M(r.name),"*.d.ts")]:s[c]=[...s[c]??[],"./"+j(i,r.name+".d.ts")];const l=j(o,"package.json"),p=fi(l);n==="file"&&Object.keys(s).length>0?(wt(l,{...p,typesVersions:{...p.typesVersions,[a]:s}},{detectIndent:!0}),e.info({message:'Your package.json "typesVersions" field has been updated.',prefix:"plugin:node10-compatibility"})):Object.keys(s).length>0&&e.info({message:`Please add the following field into your package.json to enable node 10 compatibility:
75
+ `);if(r===""){o.info({message:"No dependencies license information found.",prefix:"plugin:license:"+a});return}const c=i(Ts(p),r,s);try{const m=Ke(t),d=_s(m,n,c);if(!d){o.error({message:`Could not find the license marker: <!-- ${n} --><!-- /${n} --> in ${t}`,prefix:"plugin:license:"+a});return}m!==d&&(le(t,d),o.info({message:`${t} updated.`,prefix:"plugin:license:"+a}))}catch(m){o.error(m)}}}),"license");var Is=Object.defineProperty,As=g((e,t)=>Is(e,"name",{value:t,configurable:!0}),"u$8");const zs=As(()=>({async generateBundle(e,t){const i=[];for(const n of this.getModuleIds()){const a=this.getModuleInfo(n);if(a!=null&&!a.isExternal)for(const s of a.importedIds)i.push({source:n,target:s})}if(Array.isArray(i)&&i.length===0)return;const o=Object.keys(t);this.emitFile({fileName:`metafile-${o[0].replace(ae,"")}-${e.format}.json`,source:JSON.stringify(i,null,2),type:"asset"})},name:"packem:metafile"}),"metafilePlugin");var Fs=Object.defineProperty,Rs=g((e,t)=>Fs(e,"name",{value:t,configurable:!0}),"g$8");let Gt=!1;const Ls=Rs((e,t,i,o,n,a)=>{if(a!=="*"&&Ko(Go(a))===null)throw new Error("Invalid typeScriptVersion option. It must be a valid semver range.");return{name:"packem:node10-compatibility",writeBundle(){Gt||(e.info({message:"Declaration node10 compatibility mode is enabled.",prefix:"plugin:node10-compatibility"}),Gt=!0);const s={};for(const r of t)for(const c of r.exportKey)c.includes("/*")?s[c]=["./"+j(i,M(r.name),"*.d.ts")]:s[c]=[...s[c]??[],"./"+j(i,r.name+".d.ts")];const l=j(o,"package.json"),p=ui(l);n==="file"&&Object.keys(s).length>0?(bt(l,{...p,typesVersions:{...p.typesVersions,[a]:s}},{detectIndent:!0}),e.info({message:'Your package.json "typesVersions" field has been updated.',prefix:"plugin:node10-compatibility"})):Object.keys(s).length>0&&e.info({message:`Please add the following field into your package.json to enable node 10 compatibility:
76
76
 
77
77
  ${JSON.stringify({typesVersions:{"*":s}},null,4)}
78
- `,prefix:"plugin:node10-compatibility"})}}},"node10CompatibilityPlugin");var qs=Object.defineProperty,Ws=g((e,t)=>qs(e,"name",{value:t,configurable:!0}),"t$8");const te=Ws(e=>fn("sha256").update(e).digest("hex"),"getHash");var Us=Object.defineProperty,qi=g((e,t)=>Us(e,"name",{value:t,configurable:!0}),"d$a");const be=qi(e=>e.handler||e,"getHandler"),N=qi((e,t,i="")=>({...e,async buildEnd(o){e.buildEnd&&await be(e.buildEnd).call(this,o)},async buildStart(o){e.buildStart&&await be(e.buildStart).call(this,o)},async load(o){if(!e.load)return null;const n=j(i,e.name),a=j("load",te(o));if(t.has(a,n))return await t.get(a,n);const s=await be(e.load).call(this,o);return t.set(a,s,n),s},name:`cached(${e.name})`,async resolveId(o,n,a){if(!e.resolveId)return null;const s=j(i,e.name),l=j("resolveId",te(o),n?te(n):"",te(JSON.stringify(a)));if(t.has(l,s))return await t.get(l,s);const p=await be(e.resolveId).call(this,o,n,a);return t.set(l,p,s),p},async transform(o,n){if(!e.transform)return null;const a=j(i,e.name),s=j("transform",te(n),te(o));if(t.has(s,a))return await t.get(s,a);const l=await be(e.transform).call(this,o,n);return t.set(s,l,a),l}}),"cachingPlugin");var Vs=Object.defineProperty,Ks=g((e,t)=>Vs(e,"name",{value:t,configurable:!0}),"n$8");const Hs=Ks(()=>({name:"packem:prepend-directive",transform:{handler(e,t){const i=this.getModuleInfo(t);if(i?.meta.preserveDirectives){const o=i.meta.preserveDirectives.directives[0];if(o)return`'${o.value}';
79
- `+e}return null},order:"post"}}),"prependDirectivePlugin");var Gs=Object.defineProperty,Ys=g((e,t)=>Gs(e,"name",{value:t,configurable:!0}),"c$b");const Xs=Ys(({directiveRegex:e,exclude:t=[],include:i=[],logger:o})=>{const n={},a={},s=X(i,t);return{name:"packem:preserve-directives",onLog(l,p){return p.code==="MODULE_LEVEL_DIRECTIVE"&&l==="warn"?!1:null},renderChunk:{handler(l,p,{sourcemap:r}){const c=p.moduleIds.map(u=>n[u]?n[u]:null).reduce((u,h)=>(h&&h.forEach(v=>{u.add(v)}),u),new Set),m=new Y(l);c.size>0&&(o.debug({message:`directives for chunk "${p.fileName}" are preserved.`,prefix:"plugin:preserve-directives"}),m.prepend(`${[...c].map(u=>`'${u}';`).join(`
78
+ `,prefix:"plugin:node10-compatibility"})}}},"node10CompatibilityPlugin");var Js=Object.defineProperty,Bs=g((e,t)=>Js(e,"name",{value:t,configurable:!0}),"t$8");const te=Bs(e=>mn("sha256").update(e).digest("hex"),"getHash");var qs=Object.defineProperty,Bi=g((e,t)=>qs(e,"name",{value:t,configurable:!0}),"d$a");const be=Bi(e=>e.handler||e,"getHandler"),I=Bi((e,t,i="")=>({...e,async buildEnd(o){e.buildEnd&&await be(e.buildEnd).call(this,o)},async buildStart(o){e.buildStart&&await be(e.buildStart).call(this,o)},async load(o){if(!e.load)return null;const n=j(i,e.name),a=j("load",te(o));if(t.has(a,n))return await t.get(a,n);const s=await be(e.load).call(this,o);return t.set(a,s,n),s},name:`cached(${e.name})`,async resolveId(o,n,a){if(!e.resolveId)return null;const s=j(i,e.name),l=j("resolveId",te(o),n?te(n):"",te(JSON.stringify(a)));if(t.has(l,s))return await t.get(l,s);const p=await be(e.resolveId).call(this,o,n,a);return t.set(l,p,s),p},async transform(o,n){if(!e.transform)return null;const a=j(i,e.name),s=j("transform",te(n),te(o));if(t.has(s,a))return await t.get(s,a);const l=await be(e.transform).call(this,o,n);return t.set(s,l,a),l}}),"cachingPlugin");var Ws=Object.defineProperty,Us=g((e,t)=>Ws(e,"name",{value:t,configurable:!0}),"n$8");const Vs=Us(()=>({name:"packem:prepend-directive",transform:{handler(e,t){const i=this.getModuleInfo(t);if(i?.meta.preserveDirectives){const o=i.meta.preserveDirectives.directives[0];if(o)return`'${o.value}';
79
+ `+e}return null},order:"post"}}),"prependDirectivePlugin");var Ks=Object.defineProperty,Gs=g((e,t)=>Ks(e,"name",{value:t,configurable:!0}),"c$c");const Hs=Gs(({directiveRegex:e,exclude:t=[],include:i=[],logger:o})=>{const n={},a={},s=Y(i,t);return{name:"packem:preserve-directives",onLog(l,p){return p.code==="MODULE_LEVEL_DIRECTIVE"&&l==="warn"?!1:null},renderChunk:{handler(l,p,{sourcemap:r}){const c=p.moduleIds.map(u=>n[u]?n[u]:null).reduce((u,h)=>(h&&h.forEach(v=>{u.add(v)}),u),new Set),m=new H(l);c.size>0&&(o.debug({message:`directives for chunk "${p.fileName}" are preserved.`,prefix:"plugin:preserve-directives"}),m.prepend(`${[...c].map(u=>`'${u}';`).join(`
80
80
  `)}
81
81
  `));let d;return p.facadeModuleId&&typeof a[p.facadeModuleId]=="string"&&(d=a[p.facadeModuleId]),d&&(o.debug({message:`shebang for chunk "${p.fileName}" is preserved.`,prefix:"plugin:preserve-directives"}),m.prepend(`${d}
82
- `)),c.size===0&&d===void 0?null:{code:m.toString(),map:r?m.generateMap({hires:!0}):null}},order:"post"},transform(l,p){if(!s(p))return null;let r=!1;const c=new Y(l);if(l.startsWith("#")&&l[1]==="!"){let d=0;for(let u=2,h=l.length;u<h;u++){const v=l.codePointAt(u);if(v===10||v===13||v===8232||v===8233){d=u;break}}d&&(a[p]=l.slice(0,d),c.remove(0,d+1),r=!0,o.debug({message:`shebang for module "${p}" is preserved.`,prefix:"plugin:preserve-directives"}))}let m=null;try{m=this.parse(c.toString(),{allowReturnOutsideFunction:!0})}catch(d){return this.warn({code:"PARSE_ERROR",message:`failed to parse "${p}" and extract the directives.`}),o.warn(d),null}if(m.type!=="Program")return null;for(const d of m.body.filter(Boolean)){if(d.type!=="ExpressionStatement")break;let u=null;"directive"in d?u=d.directive:d.expression.type==="Literal"&&typeof d.expression.value=="string"&&e.test(d.expression.value)&&(u=d.expression.value),u!=="use strict"&&u&&(n[p]||=new Set,n[p].add(u),"start"in d&&typeof d.start=="number"&&"end"in d&&typeof d.end=="number"&&(c.remove(d.start,d.end),r=!0),o.debug({message:`directive "${u}" for module "${p}" is preserved.`,prefix:"plugin:preserve-directives"}))}return r?{code:c.toString(),map:c.generateMap({hires:!0}),meta:{preserveDirectives:{directives:[...n[p]??[]],shebang:a[p]??null}}}:null}}},"preserveDirectives");var Qs=Object.defineProperty,Zs=g((e,t)=>Qs(e,"name",{value:t,configurable:!0}),"n$7");const er=Zs(e=>{const t=X(e.include,e.exclude);return{async load(i){return i.includes("?raw")?await this.load({id:i.replace(/\?raw$/,"")}):null},name:"packem:raw",transform(i,o){return!t(o)&&!o.includes("?raw")?null:(o.includes("?raw")||(i=`export default ${JSON.stringify(i)}`),{code:i,map:{mappings:""}})}}},"rawPlugin");var tr=Object.defineProperty,ir=g((e,t)=>tr(e,"name",{value:t,configurable:!0}),"a$h");const xt=ir((e,t)=>e.some(i=>i instanceof RegExp?i.test(t):i===t),"arrayIncludes");var or=Object.defineProperty,nr=g((e,t)=>or(e,"name",{value:t,configurable:!0}),"a$g");const Wi=nr((e="")=>{const t=e.split("/");return t[0].startsWith("@")?t[0]+"/"+t[1]:t[0]},"getPackageName");var ar=Object.defineProperty,sr=g((e,t)=>ar(e,"name",{value:t,configurable:!0}),"i$9");const Qe=sr((e,t)=>{let i={};return e.name&&(i[e.name]=t.rootDir),i={...i,...t.alias},t.rollup.alias&&(Array.isArray(t.rollup.alias.entries)?Object.assign(i,Object.fromEntries(t.rollup.alias.entries.map(o=>[o.find,o.replacement]))):Object.assign(i,t.rollup.alias.entries??t.rollup.alias)),i},"resolveAliases");var rr=Object.defineProperty,$e=g((e,t)=>rr(e,"name",{value:t,configurable:!0}),"a$f");const Yt=$e((e,t,i)=>e.reduce((o,n,a)=>(n instanceof RegExp?o.push(n):typeof n=="string"&&n.length>0?o.push(new RegExp("^"+n.replaceAll(/[.*+?^${}()|[\]\\]/g,"\\$&")+"$")):i.warn(`Ignoring wrong entry type #${a} in '${t}' option: ${JSON.stringify(n)}`),o),[]),"getRegExps"),Xt=new Map,pt=new Map,Ui=$e((e,t,i,o,n)=>{const a=Yt([...n.include??[]],"include",o),s=Yt([...n.exclude??[]],"exclude",o),l={};Object.assign(l,n.deps?e.dependencies:void 0,n.devDeps?e.devDependencies:void 0,n.peerDeps?e.peerDependencies:void 0,n.optDeps?e.optionalDependencies:void 0);const p=Object.keys(l);p.length>0&&a.push(new RegExp("^(?:"+p.join("|")+")(?:/.+)?$"));const r=$e(u=>a.some(h=>h.test(u)),"isIncluded"),c=$e(u=>s.some(h=>h.test(u)),"isExcluded");let m=[];t&&(m=Object.entries(t.config.compilerOptions?.paths??{}).map(([u])=>u.endsWith("*")?new RegExp(`^${u.replace("*","(.*)")}$`):new RegExp(`^${u}$`)));const d=Qe(e,i);return{name:"packem:resolve-externals",options:$e(u=>{u.external=h=>{if(/^(?:\0|\.{1,2}\/)/.test(h)||fe(h)||e.name&&h.startsWith(e.name)||at(h)||r(h)&&!c(h))return!1;if(xt(i.externals,Wi(h))||xt(i.externals,h))return!0;if(e.imports)for(const[v,y]of Object.entries(e.imports)){if(v===h)return!1;if(v.includes("*")){let f;pt.has(v)?f=pt.get(v):(f=gn(j(i.rootDir,y.replace("/*","")),{withFileTypes:!0}).filter(x=>x.isFile()).map(x=>x.name),pt.set(v,f));for(const x of f)if(x.replace(ae,"")===h.replace(ae,"").replace("#",""))return!1}}if(m.length>0){for(const v of m)if(v.test(h))return!1}return Object.keys(d).length>0&&tn(h,d)!==h||(Xt.has(h)||o.info({message:'Inlined implicit external "'+P(h)+'". If this is incorrect, add it to the "externals" option.',prefix:"plugin:packem:resolve-externals"}),Xt.set(h,!0)),!1}},"options"),resolveId:{async handler(u,h,{isEntry:v}){if(v||/^(?:\0|\.{1,2}\/)/.test(u)||fe(u)||e.name&&u.startsWith(e.name))return null;if(at(u)){const y=u.replace(/^node:/,"");return{external:(n.builtins||r(u))&&!c(u),id:n.builtinsPrefix==="ignore"?u:n.builtinsPrefix==="add"||!at(y)?"node:"+y:y,moduleSideEffects:!1}}return r(u)&&!c(u)?!1:null},order:"pre"}}},"resolveExternalsPlugin");var lr=Object.defineProperty,pr=g((e,t)=>lr(e,"name",{value:t,configurable:!0}),"r$a");const Vi=pr(()=>({name:"packem:resolve-file-url",resolveId(e){if(e.startsWith("file://"))return ki(e)}}),"resolveFileUrl");var cr=Object.defineProperty,Ze=g((e,t)=>cr(e,"name",{value:t,configurable:!0}),"i$7");const Be=/^#![^\n]*/,yt=Ze(async e=>{await Lo(e,493).catch(()=>{})},"makeExecutable"),dr=Ze((e,t)=>({name:"packem:shebang",renderChunk:{handler(i,o,n){if(!o.isEntry||!o.facadeModuleId)return null;const a=i.startsWith("#")&&i[1]==="!";if(a&&t.replace)return i.replace(Be,t.shebang+`
83
- `);if(a)return null;if(e.includes(o.name)){const s=new Y(i);return s.prepend(t.shebang+`
84
- `),{code:s.toString(),map:n.sourcemap?s.generateMap({hires:!0}):void 0}}return null},order:"post"},async writeBundle(i,o){for(const[n,a]of Object.entries(o))if(a.type==="chunk"&&Be.test(a.code)&&i.dir){const s=E(i.dir,n);await yt(s)}}}),"shebangPlugin"),mr=Ze(()=>({name:"packem:remove-shebang",renderChunk(e){return e.replace(Be,"")}}),"removeShebangPlugin"),ur=Ze((e,t=`
85
- `)=>{const i=Be.exec(e);return i?i+t:""},"getShebang");var fr=Object.defineProperty,gr=g((e,t)=>fr(e,"name",{value:t,configurable:!0}),"l$8");const vr=gr(({exclude:e,include:t}={})=>{const i=X(t,e);return{async load(o){if(!i(o))return null;let n;try{n=await Oe(o,{buffer:!1}),this.addWatchFile(o)}catch{try{const s=o.replace(/\?.*$/,"");n=await Oe(s,{buffer:!1}),this.addWatchFile(s)}catch{return this.warn("Failed reading file"),null}}let a;try{const s=yn(o);if(s===void 0)return n;a=s}catch{return this.warn("Failed resolving source map"),{code:n}}return{code:n,map:a}},name:"packem:sourcemaps"}},"sourcemapsPlugin");var hr=Object.defineProperty,pe=g((e,t)=>hr(e,"name",{value:t,configurable:!0}),"r$9");const xr=/\/\*[^*]*\*+(?:[^/*][^*]*\*+)*\//g,yr=/MIT License|MIT license|BSD license/,br=/\n{2,}/g,wr=/\b(\w+)\$\d+\b/g,kr=/[-/\\^$*+?.()|[\]{}]/g,jr=pe(e=>e.replaceAll(kr,"\\$&"),"escapeRegex"),$r=pe(e=>[...new Set(e)],"unique"),Er=pe(e=>e.replaceAll(xr,t=>yr.test(t)?"":t).replaceAll(br,`
82
+ `)),c.size===0&&d===void 0?null:{code:m.toString(),map:r?m.generateMap({hires:!0}):null}},order:"post"},transform(l,p){if(!s(p))return null;let r=!1;const c=new H(l);if(l.startsWith("#")&&l[1]==="!"){let d=0;for(let u=2,h=l.length;u<h;u++){const v=l.codePointAt(u);if(v===10||v===13||v===8232||v===8233){d=u;break}}d&&(a[p]=l.slice(0,d),c.remove(0,d+1),r=!0,o.debug({message:`shebang for module "${p}" is preserved.`,prefix:"plugin:preserve-directives"}))}let m=null;try{m=this.parse(c.toString(),{allowReturnOutsideFunction:!0})}catch(d){return this.warn({code:"PARSE_ERROR",message:`failed to parse "${p}" and extract the directives.`}),o.warn(d),null}if(m.type!=="Program")return null;for(const d of m.body.filter(Boolean)){if(d.type!=="ExpressionStatement")break;let u=null;"directive"in d?u=d.directive:d.expression.type==="Literal"&&typeof d.expression.value=="string"&&e.test(d.expression.value)&&(u=d.expression.value),u!=="use strict"&&u&&(n[p]||=new Set,n[p].add(u),"start"in d&&typeof d.start=="number"&&"end"in d&&typeof d.end=="number"&&(c.remove(d.start,d.end),r=!0),o.debug({message:`directive "${u}" for module "${p}" is preserved.`,prefix:"plugin:preserve-directives"}))}return r?{code:c.toString(),map:c.generateMap({hires:!0}),meta:{preserveDirectives:{directives:[...n[p]??[]],shebang:a[p]??null}}}:null}}},"preserveDirectives");var Ys=Object.defineProperty,Xs=g((e,t)=>Ys(e,"name",{value:t,configurable:!0}),"n$7");const Qs=Xs(e=>{const t=Y(e.include,e.exclude);return{async load(i){return i.includes("?raw")?await this.load({id:i.replace(/\?raw$/,"")}):null},name:"packem:raw",transform(i,o){return!t(o)&&!o.includes("?raw")?null:(o.includes("?raw")||(i=`export default ${JSON.stringify(i)}`),{code:i,map:{mappings:""}})}}},"rawPlugin");var Zs=Object.defineProperty,er=g((e,t)=>Zs(e,"name",{value:t,configurable:!0}),"i$9");const Qe=er((e,t)=>{let i={};return e.name&&(i[e.name]=t.rootDir),i={...i,...t.alias},t.rollup.alias&&(Array.isArray(t.rollup.alias.entries)?Object.assign(i,Object.fromEntries(t.rollup.alias.entries.map(o=>[o.find,o.replacement]))):Object.assign(i,t.rollup.alias.entries??t.rollup.alias)),i},"resolveAliases");var tr=Object.defineProperty,$e=g((e,t)=>tr(e,"name",{value:t,configurable:!0}),"o$5");const Ht=$e((e,t,i)=>e.reduce((o,n,a)=>(n instanceof RegExp?o.push(n):typeof n=="string"&&n.length>0?o.push(new RegExp("^"+n.replaceAll(/[.*+?^${}()|[\]\\]/g,"\\$&")+"$")):i.warn(`Ignoring wrong entry type #${a} in '${t}' option: ${JSON.stringify(n)}`),o),[]),"getRegExps"),Yt=new Map,pt=new Map,qi=$e((e,t,i,o,n)=>{const a=Ht([...i.externals],"include",o),s=Ht([...n.exclude??[]],"exclude",o),l={};Object.assign(l,n.deps?e.dependencies:void 0,n.devDeps?e.devDependencies:void 0,n.peerDeps?e.peerDependencies:void 0,n.optDeps?e.optionalDependencies:void 0);const p=Object.keys(l);p.length>0&&a.push(new RegExp("^(?:"+p.join("|")+")(?:/.+)?$"));const r=$e(u=>a.some(h=>h.test(u)),"isIncluded"),c=$e(u=>s.some(h=>h.test(u)),"isExcluded");let m=[];t&&(m=Object.entries(t.config.compilerOptions?.paths??{}).map(([u])=>u.endsWith("*")?new RegExp(`^${u.replace("*","(.*)")}$`):new RegExp(`^${u}$`)));const d=Qe(e,i);return{name:"packem:resolve-externals",options:$e(u=>{u.external=h=>{if(/^(?:\0|\.{1,2}\/)/.test(h)||fe(h)||e.name&&h.startsWith(e.name)||at(h)||r(h)&&!c(h))return!1;if(e.imports)for(const[v,x]of Object.entries(e.imports)){if(v===h)return!1;if(v.includes("*")){let f;pt.has(v)?f=pt.get(v):(f=un(j(i.rootDir,x.replace("/*","")),{withFileTypes:!0}).filter(y=>y.isFile()).map(y=>y.name),pt.set(v,f));for(const y of f)if(y.replace(ae,"")===h.replace(ae,"").replace("#",""))return!1}}if(m.length>0){for(const v of m)if(v.test(h))return!1}return Object.keys(d).length>0&&Zo(h,d)!==h||(Yt.has(h)||o.info({message:'Inlined implicit external "'+D(h)+'". If this is incorrect, add it to the "externals" option.',prefix:"plugin:packem:resolve-externals"}),Yt.set(h,!0)),!1}},"options"),resolveId:{async handler(u,h,{isEntry:v}){if(v||/^(?:\0|\.{1,2}\/)/.test(u)||fe(u)||e.name&&u.startsWith(e.name))return null;if(at(u)){const x=u.replace(/^node:/,"");return{external:(n.builtins||r(u))&&!c(u),id:n.builtinsPrefix==="ignore"?u:n.builtinsPrefix==="add"||!at(x)?"node:"+x:x,moduleSideEffects:!1}}return r(u)&&!c(u)?!1:null},order:"pre"}}},"resolveExternalsPlugin");var ir=Object.defineProperty,or=g((e,t)=>ir(e,"name",{value:t,configurable:!0}),"r$b");const Wi=or(()=>({name:"packem:resolve-file-url",resolveId(e){if(e.startsWith("file://"))return wi(e)}}),"resolveFileUrl");var nr=Object.defineProperty,Ze=g((e,t)=>nr(e,"name",{value:t,configurable:!0}),"i$7");const Be=/^#![^\n]*/,xt=Ze(async e=>{await Fo(e,493).catch(()=>{})},"makeExecutable"),ar=Ze((e,t)=>({name:"packem:shebang",renderChunk:{handler(i,o,n){if(!o.isEntry||!o.facadeModuleId)return null;const a=i.startsWith("#")&&i[1]==="!";if(a&&t.replace)return i.replace(Be,t.shebang+`
83
+ `);if(a)return null;if(e.includes(o.name)){const s=new H(i);return s.prepend(t.shebang+`
84
+ `),{code:s.toString(),map:n.sourcemap?s.generateMap({hires:!0}):void 0}}return null},order:"post"},async writeBundle(i,o){for(const[n,a]of Object.entries(o))if(a.type==="chunk"&&Be.test(a.code)&&i.dir){const s=E(i.dir,n);await xt(s)}}}),"shebangPlugin"),sr=Ze(()=>({name:"packem:remove-shebang",renderChunk(e){return e.replace(Be,"")}}),"removeShebangPlugin"),rr=Ze((e,t=`
85
+ `)=>{const i=Be.exec(e);return i?i+t:""},"getShebang");var lr=Object.defineProperty,pr=g((e,t)=>lr(e,"name",{value:t,configurable:!0}),"l$7");const cr=pr(({exclude:e,include:t}={})=>{const i=Y(t,e);return{async load(o){if(!i(o))return null;let n;try{n=await Oe(o,{buffer:!1}),this.addWatchFile(o)}catch{try{const s=o.replace(/\?.*$/,"");n=await Oe(s,{buffer:!1}),this.addWatchFile(s)}catch{return this.warn("Failed reading file"),null}}let a;try{const s=hn(o);if(s===void 0)return n;a=s}catch{return this.warn("Failed resolving source map"),{code:n}}return{code:n,map:a}},name:"packem:sourcemaps"}},"sourcemapsPlugin");var dr=Object.defineProperty,pe=g((e,t)=>dr(e,"name",{value:t,configurable:!0}),"r$a");const mr=/\/\*[^*]*\*+(?:[^/*][^*]*\*+)*\//g,ur=/MIT License|MIT license|BSD license/,fr=/\n{2,}/g,gr=/\b(\w+)\$\d+\b/g,vr=/[-/\\^$*+?.()|[\]{}]/g,hr=pe(e=>e.replaceAll(vr,"\\$&"),"escapeRegex"),xr=pe(e=>[...new Set(e)],"unique"),yr=pe(e=>e.replaceAll(mr,t=>ur.test(t)?"":t).replaceAll(fr,`
86
86
 
87
- `),"cleanUnnecessaryComments"),Qt=new Map;function Ki(e,t,{identifierReplacements:i},o){const n=wi(e);for(const s in i){const l=n.find(r=>r.specifier===s&&r.imports.includes("{"));if(!l){this.warn(`${t.fileName} does not import "${s}" for replacement`),process.exitCode=1;continue}const p=i[s];for(const r in p){if(!l.imports.includes(r))throw new Error(`${t.fileName} does not import "${r}" from "${s}" for replacement`);const c=p[r],m=jr(r);c.includes(".")&&(e=e.replace(new RegExp(`\\b\\w+\\b as ${m},?\\s?`),"")),e=e.replaceAll(new RegExp(`\\b${m}\\b`,"g"),c)}}const a=$r(Array.from(e.matchAll(wr),s=>s[0]));if(a.length>0){const s=a.map(p=>`
88
- - ${p}`).join(""),l=t.fileName.replace(/\.[^/.]+$/,"");Qt.has(l)||o.warn({message:`${t.fileName} contains confusing identifier names${s}
87
+ `),"cleanUnnecessaryComments"),Xt=new Map;function Ui(e,t,{identifierReplacements:i},o){const n=bi(e);for(const s in i){const l=n.find(r=>r.specifier===s&&r.imports.includes("{"));if(!l){this.warn(`${t.fileName} does not import "${s}" for replacement`),process.exitCode=1;continue}const p=i[s];for(const r in p){if(!l.imports.includes(r))throw new Error(`${t.fileName} does not import "${r}" from "${s}" for replacement`);const c=p[r],m=hr(r);c.includes(".")&&(e=e.replace(new RegExp(`\\b\\w+\\b as ${m},?\\s?`),"")),e=e.replaceAll(new RegExp(`\\b${m}\\b`,"g"),c)}}const a=xr(Array.from(e.matchAll(gr),s=>s[0]));if(a.length>0){const s=a.map(p=>`
88
+ - ${p}`).join(""),l=t.fileName.replace(/\.[^/.]+$/,"");Xt.has(l)||o.warn({message:`${t.fileName} contains confusing identifier names${s}
89
89
 
90
- To replace these, add them to the "rollup -> patchTypes -> identifierReplacements" option in your packem config.`,prefix:"plugin:patch-types"}),Qt.set(l,!0)}return e}g(Ki,"I$2");pe(Ki,"replaceConfusingTypeNames");const Sr=pe((e,t)=>{if(t.leadingComments?.some(i=>i.type==="CommentBlock"&&i.value.includes("@internal"))){const i=e.original[t.end]===","?t.end+1:t.end;return e.remove(t.leadingComments[0].start,i),!0}return!1},"removeInternal");function Hi(e,t){if(e.includes("@internal")){const i=new Y(e),o=bn(e,{plugins:["typescript"],sourceType:"module"});if(St(o,{enter(n){Sr(i,n)&&this.skip()}}),e=i.toString(),e.includes("@internal"))throw new Error(`${t.fileName} has unhandled @internal declarations`)}return e}g(Hi,"S$2");pe(Hi,"stripInternalTypes");const Or=pe((e,t)=>({name:"packem:patch-types",renderChunk(i,o){return i=Ki.call(this,i,o,e,t),i=Hi.call(this,i,o),i=Er(i),i},resolveId(i){return i.startsWith("types/")?{external:!0,id:"../../"+(i.endsWith(".js")?i:i+".js")}:null}}),"patchTypescriptTypes");var Dr=Object.defineProperty,H=g((e,t)=>Dr(e,"name",{value:t,configurable:!0}),"o$5");const Pr=42,Cr=H(e=>{let t=!1;for(let i=0;i<e.length;i++)if(e.codePointAt(i)===Pr){if(t)return!1;t=!0}return!0},"hasZeroOrOneAsteriskCharacter"),Nr=H(e=>{const t=e.indexOf("*");return t===-1?void 0:{prefix:e.slice(0,t),suffix:e.slice(t+1)}},"tryParsePattern"),_r=H(({prefix:e,suffix:t},i)=>i.length>=e.length+t.length&&i.startsWith(e)&&i.endsWith(t),"isPatternMatch"),Tr=H((e,t,i)=>{let o,n=-1;for(const a of e){const s=t(a);_r(s,i)&&s.prefix.length>n&&(n=s.prefix.length,o=a)}return o},"findBestPatternMatch"),Mr=H((e,t)=>{const i=[];for(const o of e){if(!Cr(o))continue;const n=Nr(o);if(n)i.push(n);else if(o===t)return o}return Tr(i,o=>o,t)},"matchPatternOrExact"),Ir=H((e,t)=>t.substring(e.prefix.length,t.length-e.suffix.length),"matchedText"),Ar=H(({prefix:e,suffix:t})=>`${e}*${t}`,"patternText"),zr=H((e,t,i)=>{let o=M(t.path);t.config.compilerOptions?.baseUrl&&(o=E(e,t.config.compilerOptions.baseUrl)),i?.debug({message:`Resolved baseUrl to ${o}`,prefix:"plugin:packem:resolve-tsconfig-paths"});const n=t.config.compilerOptions?.paths??{};return Object.keys(n).length===0&&i?.debug({message:"No paths found in tsconfig.json",prefix:"plugin:packem:resolve-tsconfig-paths"}),{paths:n,resolvedBaseUrl:o}},"getTsconfigPaths"),Fr=H(async(e,t,i,o,n,a)=>{if(t.length===0)return null;if(o.includes("\0"))return a?.debug({message:`Skipping resolution of ${o} as it is a virtual module`,prefix:"plugin:packem:resolve-tsconfig-paths"}),null;if(o.includes("node_modules"))return a?.debug({message:`Skipping request as it is inside node_modules ${o}`,prefix:"plugin:packem:resolve-tsconfig-paths"}),null;if(fe(o))return a?.debug({message:`Skipping request as it is an absolute path ${o}`,prefix:"plugin:packem:resolve-tsconfig-paths"}),null;if(jt(o))return a?.debug({message:`Skipping request as it is a relative path ${o}`,prefix:"plugin:packem:resolve-tsconfig-paths"}),null;const s=Mr(t,o);if(!s)return a?.debug({message:`moduleName did not match any paths pattern ${o}`,prefix:"plugin:packem:resolve-tsconfig-paths"}),null;const l=typeof s=="string"?void 0:Ir(s,o),p=typeof s=="string"?s:Ar(s);for await(const r of e[p]){const c=l?r.replace("*",l):r;if(c.endsWith(".d.ts")||c.endsWith(".d.cts")||c.endsWith(".d.mts"))continue;const m=j(i,c),d=await n(m);if(d)return d}return null},"resolvePathsToIds"),Gi=H((e,t,i)=>{const{paths:o,resolvedBaseUrl:n}=zr(e,t,i),a=Object.keys(o);return{name:"packem:resolve-tsconfig-paths",async resolveId(s,l,p){return await Fr(o,a,n,s,async r=>{try{const c=await this.resolve(r,l,{skipSelf:!0,...p});if(c)return c}catch(c){i.debug({context:c,message:`Failed to resolve ${r} from ${s}`,prefix:"plugin:packem:resolve-tsconfig-paths"})}return null},i)}}},"resolveTsconfigPathsPlugin");var Rr=Object.defineProperty,Yi=g((e,t)=>Rr(e,"name",{value:t,configurable:!0}),"u$6");const Lr=Yi((e,t)=>{if(!t)return null;const{config:i,path:o}=t;if(!i.compilerOptions)return null;const{rootDirs:n}=i.compilerOptions;if(!n)return null;const a=[];for(const s of n){if(s.startsWith("."))throw new Error(`Invalid rootDir value '.' in ${o}.`);if(s.startsWith(".."))throw new Error(`Invalid rootDir value '..' in ${o}.`);a.push(E(e,s))}return a},"getRootDirectories"),Xi=Yi((e,t,i)=>{const o=Lr(e,i);return{name:"packem:resolve-tsconfig-root-dirs",async resolveId(n,a,s){if(o===null||o.length===0)return null;if(n.startsWith("."))for(const l of o){const p=j(l,n),r=await this.resolve(p,a,{skipSelf:!0,...s});if(r)return t.debug({message:`Resolved ${n} to ${r.id} using rootDirs from tsconfig.json.`,prefix:"plugin:resolve-tsconfig-root-dirs"}),r.id}return null}}},"resolveTsconfigRootDirectories");var Jr=Object.defineProperty,Br=g((e,t)=>Jr(e,"name",{value:t,configurable:!0}),"r$8");const Qi=Br(()=>{const e=/\.(?:[mc]?js|jsx)$/;return{name:"packem:resolve-typescript-mjs-cjs",async resolveId(t,i,o){return e.test(t)&&i?await this.resolve(t.replace(/js(x?)$/,"ts$1"),i,o):null}}},"resolveTypescriptMjsCts"),Zi={"application/prs.cww":["cww"],"application/prs.xsf+xml":["xsf"],"application/vnd.1000minds.decision-model+xml":["1km"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["*xfdf"],"application/vnd.age":["age"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.keynote":["key"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.apple.numbers":["numbers"],"application/vnd.apple.pages":["pages"],"application/vnd.apple.pkpass":["pkpass"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.balsamiq.bmml+xml":["bmml"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.citationstyles.style+xml":["csl"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dbf":["dbf"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["*fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans.fnc":["fnc"],"application/vnd.frogans.ltf":["ltf"],"application/vnd.fsc.weblaunch":["fsc"],"application/vnd.fujitsu.oasys":["oas"],"application/vnd.fujitsu.oasys2":["oa2"],"application/vnd.fujitsu.oasys3":["oa3"],"application/vnd.fujitsu.oasysgp":["fg5"],"application/vnd.fujitsu.oasysprs":["bh2"],"application/vnd.fujixerox.ddd":["ddd"],"application/vnd.fujixerox.docuworks":["xdw"],"application/vnd.fujixerox.docuworks.binder":["xbd"],"application/vnd.fuzzysheet":["fzs"],"application/vnd.genomatix.tuxedo":["txd"],"application/vnd.geogebra.file":["ggb"],"application/vnd.geogebra.tool":["ggt"],"application/vnd.geometry-explorer":["gex","gre"],"application/vnd.geonext":["gxt"],"application/vnd.geoplan":["g2w"],"application/vnd.geospace":["g3w"],"application/vnd.gmx":["gmx"],"application/vnd.google-apps.document":["gdoc"],"application/vnd.google-apps.presentation":["gslides"],"application/vnd.google-apps.spreadsheet":["gsheet"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/vnd.grafeq":["gqf","gqs"],"application/vnd.groove-account":["gac"],"application/vnd.groove-help":["ghf"],"application/vnd.groove-identity-message":["gim"],"application/vnd.groove-injector":["grv"],"application/vnd.groove-tool-message":["gtm"],"application/vnd.groove-tool-template":["tpl"],"application/vnd.groove-vcard":["vcg"],"application/vnd.hal+xml":["hal"],"application/vnd.handheld-entertainment+xml":["zmm"],"application/vnd.hbci":["hbci"],"application/vnd.hhe.lesson-player":["les"],"application/vnd.hp-hpgl":["hpgl"],"application/vnd.hp-hpid":["hpid"],"application/vnd.hp-hps":["hps"],"application/vnd.hp-jlyt":["jlt"],"application/vnd.hp-pcl":["pcl"],"application/vnd.hp-pclxl":["pclxl"],"application/vnd.hydrostatix.sof-data":["sfd-hdstx"],"application/vnd.ibm.minipay":["mpy"],"application/vnd.ibm.modcap":["afp","listafp","list3820"],"application/vnd.ibm.rights-management":["irm"],"application/vnd.ibm.secure-container":["sc"],"application/vnd.iccprofile":["icc","icm"],"application/vnd.igloader":["igl"],"application/vnd.immervision-ivp":["ivp"],"application/vnd.immervision-ivu":["ivu"],"application/vnd.insors.igm":["igm"],"application/vnd.intercon.formnet":["xpw","xpx"],"application/vnd.intergeo":["i2g"],"application/vnd.intu.qbo":["qbo"],"application/vnd.intu.qfx":["qfx"],"application/vnd.ipunplugged.rcprofile":["rcprofile"],"application/vnd.irepository.package+xml":["irp"],"application/vnd.is-xpr":["xpr"],"application/vnd.isac.fcs":["fcs"],"application/vnd.jam":["jam"],"application/vnd.jcp.javame.midlet-rms":["rms"],"application/vnd.jisp":["jisp"],"application/vnd.joost.joda-archive":["joda"],"application/vnd.kahootz":["ktz","ktr"],"application/vnd.kde.karbon":["karbon"],"application/vnd.kde.kchart":["chrt"],"application/vnd.kde.kformula":["kfo"],"application/vnd.kde.kivio":["flw"],"application/vnd.kde.kontour":["kon"],"application/vnd.kde.kpresenter":["kpr","kpt"],"application/vnd.kde.kspread":["ksp"],"application/vnd.kde.kword":["kwd","kwt"],"application/vnd.kenameaapp":["htke"],"application/vnd.kidspiration":["kia"],"application/vnd.kinar":["kne","knp"],"application/vnd.koan":["skp","skd","skt","skm"],"application/vnd.kodak-descriptor":["sse"],"application/vnd.las.las+xml":["lasxml"],"application/vnd.llamagraphics.life-balance.desktop":["lbd"],"application/vnd.llamagraphics.life-balance.exchange+xml":["lbe"],"application/vnd.lotus-1-2-3":["123"],"application/vnd.lotus-approach":["apr"],"application/vnd.lotus-freelance":["pre"],"application/vnd.lotus-notes":["nsf"],"application/vnd.lotus-organizer":["org"],"application/vnd.lotus-screencam":["scm"],"application/vnd.lotus-wordpro":["lwp"],"application/vnd.macports.portpkg":["portpkg"],"application/vnd.mapbox-vector-tile":["mvt"],"application/vnd.mcd":["mcd"],"application/vnd.medcalcdata":["mc1"],"application/vnd.mediastation.cdkey":["cdkey"],"application/vnd.mfer":["mwf"],"application/vnd.mfmp":["mfm"],"application/vnd.micrografx.flo":["flo"],"application/vnd.micrografx.igx":["igx"],"application/vnd.mif":["mif"],"application/vnd.mobius.daf":["daf"],"application/vnd.mobius.dis":["dis"],"application/vnd.mobius.mbk":["mbk"],"application/vnd.mobius.mqy":["mqy"],"application/vnd.mobius.msl":["msl"],"application/vnd.mobius.plc":["plc"],"application/vnd.mobius.txf":["txf"],"application/vnd.mophun.application":["mpn"],"application/vnd.mophun.certificate":["mpc"],"application/vnd.mozilla.xul+xml":["xul"],"application/vnd.ms-artgalry":["cil"],"application/vnd.ms-cab-compressed":["cab"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.addin.macroenabled.12":["xlam"],"application/vnd.ms-excel.sheet.binary.macroenabled.12":["xlsb"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.ms-excel.template.macroenabled.12":["xltm"],"application/vnd.ms-fontobject":["eot"],"application/vnd.ms-htmlhelp":["chm"],"application/vnd.ms-ims":["ims"],"application/vnd.ms-lrm":["lrm"],"application/vnd.ms-officetheme":["thmx"],"application/vnd.ms-outlook":["msg"],"application/vnd.ms-pki.seccat":["cat"],"application/vnd.ms-pki.stl":["*stl"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.ms-powerpoint.addin.macroenabled.12":["ppam"],"application/vnd.ms-powerpoint.presentation.macroenabled.12":["pptm"],"application/vnd.ms-powerpoint.slide.macroenabled.12":["sldm"],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":["ppsm"],"application/vnd.ms-powerpoint.template.macroenabled.12":["potm"],"application/vnd.ms-project":["*mpp","mpt"],"application/vnd.ms-word.document.macroenabled.12":["docm"],"application/vnd.ms-word.template.macroenabled.12":["dotm"],"application/vnd.ms-works":["wps","wks","wcm","wdb"],"application/vnd.ms-wpl":["wpl"],"application/vnd.ms-xpsdocument":["xps"],"application/vnd.mseq":["mseq"],"application/vnd.musician":["mus"],"application/vnd.muvee.style":["msty"],"application/vnd.mynfc":["taglet"],"application/vnd.neurolanguage.nlu":["nlu"],"application/vnd.nitf":["ntf","nitf"],"application/vnd.noblenet-directory":["nnd"],"application/vnd.noblenet-sealer":["nns"],"application/vnd.noblenet-web":["nnw"],"application/vnd.nokia.n-gage.ac+xml":["*ac"],"application/vnd.nokia.n-gage.data":["ngdat"],"application/vnd.nokia.n-gage.symbian.install":["n-gage"],"application/vnd.nokia.radio-preset":["rpst"],"application/vnd.nokia.radio-presets":["rpss"],"application/vnd.novadigm.edm":["edm"],"application/vnd.novadigm.edx":["edx"],"application/vnd.novadigm.ext":["ext"],"application/vnd.oasis.opendocument.chart":["odc"],"application/vnd.oasis.opendocument.chart-template":["otc"],"application/vnd.oasis.opendocument.database":["odb"],"application/vnd.oasis.opendocument.formula":["odf"],"application/vnd.oasis.opendocument.formula-template":["odft"],"application/vnd.oasis.opendocument.graphics":["odg"],"application/vnd.oasis.opendocument.graphics-template":["otg"],"application/vnd.oasis.opendocument.image":["odi"],"application/vnd.oasis.opendocument.image-template":["oti"],"application/vnd.oasis.opendocument.presentation":["odp"],"application/vnd.oasis.opendocument.presentation-template":["otp"],"application/vnd.oasis.opendocument.spreadsheet":["ods"],"application/vnd.oasis.opendocument.spreadsheet-template":["ots"],"application/vnd.oasis.opendocument.text":["odt"],"application/vnd.oasis.opendocument.text-master":["odm"],"application/vnd.oasis.opendocument.text-template":["ott"],"application/vnd.oasis.opendocument.text-web":["oth"],"application/vnd.olpc-sugar":["xo"],"application/vnd.oma.dd2+xml":["dd2"],"application/vnd.openblox.game+xml":["obgx"],"application/vnd.openofficeorg.extension":["oxt"],"application/vnd.openstreetmap.data+xml":["osm"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.osgeo.mapguide.package":["mgp"],"application/vnd.osgi.dp":["dp"],"application/vnd.osgi.subsystem":["esa"],"application/vnd.palm":["pdb","pqa","oprc"],"application/vnd.pawaafile":["paw"],"application/vnd.pg.format":["str"],"application/vnd.pg.osasli":["ei6"],"application/vnd.picsel":["efif"],"application/vnd.pmi.widget":["wg"],"application/vnd.pocketlearn":["plf"],"application/vnd.powerbuilder6":["pbd"],"application/vnd.previewsystems.box":["box"],"application/vnd.proteus.magazine":["mgz"],"application/vnd.publishare-delta-tree":["qps"],"application/vnd.pvi.ptid1":["ptid"],"application/vnd.pwg-xhtml-print+xml":["xhtm"],"application/vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"application/vnd.rar":["rar"],"application/vnd.realvnc.bed":["bed"],"application/vnd.recordare.musicxml":["mxl"],"application/vnd.recordare.musicxml+xml":["musicxml"],"application/vnd.rig.cryptonote":["cryptonote"],"application/vnd.rim.cod":["cod"],"application/vnd.rn-realmedia":["rm"],"application/vnd.rn-realmedia-vbr":["rmvb"],"application/vnd.route66.link66+xml":["link66"],"application/vnd.sailingtracker.track":["st"],"application/vnd.seemail":["see"],"application/vnd.sema":["sema"],"application/vnd.semd":["semd"],"application/vnd.semf":["semf"],"application/vnd.shana.informed.formdata":["ifm"],"application/vnd.shana.informed.formtemplate":["itp"],"application/vnd.shana.informed.interchange":["iif"],"application/vnd.shana.informed.package":["ipk"],"application/vnd.simtech-mindmapper":["twd","twds"],"application/vnd.smaf":["mmf"],"application/vnd.smart.teacher":["teacher"],"application/vnd.software602.filler.form+xml":["fo"],"application/vnd.solent.sdkm+xml":["sdkm","sdkd"],"application/vnd.spotfire.dxp":["dxp"],"application/vnd.spotfire.sfs":["sfs"],"application/vnd.stardivision.calc":["sdc"],"application/vnd.stardivision.draw":["sda"],"application/vnd.stardivision.impress":["sdd"],"application/vnd.stardivision.math":["smf"],"application/vnd.stardivision.writer":["sdw","vor"],"application/vnd.stardivision.writer-global":["sgl"],"application/vnd.stepmania.package":["smzip"],"application/vnd.stepmania.stepchart":["sm"],"application/vnd.sun.wadl+xml":["wadl"],"application/vnd.sun.xml.calc":["sxc"],"application/vnd.sun.xml.calc.template":["stc"],"application/vnd.sun.xml.draw":["sxd"],"application/vnd.sun.xml.draw.template":["std"],"application/vnd.sun.xml.impress":["sxi"],"application/vnd.sun.xml.impress.template":["sti"],"application/vnd.sun.xml.math":["sxm"],"application/vnd.sun.xml.writer":["sxw"],"application/vnd.sun.xml.writer.global":["sxg"],"application/vnd.sun.xml.writer.template":["stw"],"application/vnd.sus-calendar":["sus","susp"],"application/vnd.svd":["svd"],"application/vnd.symbian.install":["sis","sisx"],"application/vnd.syncml+xml":["xsm"],"application/vnd.syncml.dm+wbxml":["bdm"],"application/vnd.syncml.dm+xml":["xdm"],"application/vnd.syncml.dmddf+xml":["ddf"],"application/vnd.tao.intent-module-archive":["tao"],"application/vnd.tcpdump.pcap":["pcap","cap","dmp"],"application/vnd.tmobile-livetv":["tmo"],"application/vnd.trid.tpt":["tpt"],"application/vnd.triscape.mxs":["mxs"],"application/vnd.trueapp":["tra"],"application/vnd.ufdl":["ufd","ufdl"],"application/vnd.uiq.theme":["utz"],"application/vnd.umajin":["umj"],"application/vnd.unity":["unityweb"],"application/vnd.uoml+xml":["uoml","uo"],"application/vnd.vcx":["vcx"],"application/vnd.visio":["vsd","vst","vss","vsw"],"application/vnd.visionary":["vis"],"application/vnd.vsf":["vsf"],"application/vnd.wap.wbxml":["wbxml"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.wap.wmlscriptc":["wmlsc"],"application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":["*dmg"],"application/x-arj":["arj"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bdoc":["*bdoc"],"application/x-bittorrent":["torrent"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-cocoa":["cco"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["*deb","udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-httpd-php":["php"],"application/x-install-instructions":["install"],"application/x-iso9660-image":["*iso"],"application/x-iwork-keynote-sffkey":["*key"],"application/x-iwork-numbers-sffnumbers":["*numbers"],"application/x-iwork-pages-sffpages":["*pages"],"application/x-java-archive-diff":["jardiff"],"application/x-java-jnlp-file":["jnlp"],"application/x-keepass2":["kdbx"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-makeself":["run"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["*prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdos-program":["*exe"],"application/x-msdownload":["*exe","*dll","com","bat","*msi"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["*wmf","*wmz","*emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-ns-proxy-autoconfig":["pac"],"application/x-nzb":["nzb"],"application/x-perl":["pl","pm"],"application/x-pilot":["*prc","*pdb"],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["*rar"],"application/x-redhat-package-manager":["rpm"],"application/x-research-info-systems":["ris"],"application/x-sea":["sea"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["*sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl","tk"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["*obj"],"application/x-ustar":["ustar"],"application/x-virtualbox-hdd":["hdd"],"application/x-virtualbox-ova":["ova"],"application/x-virtualbox-ovf":["ovf"],"application/x-virtualbox-vbox":["vbox"],"application/x-virtualbox-vbox-extpack":["vbox-extpack"],"application/x-virtualbox-vdi":["vdi"],"application/x-virtualbox-vhd":["vhd"],"application/x-virtualbox-vmdk":["vmdk"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt","pem"],"application/x-xfig":["fig"],"application/x-xliff+xml":["*xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/x-aac":["*aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-m4a":["*m4a"],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-realaudio":["*ra"],"audio/x-wav":["*wav"],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"image/prs.btif":["btif","btf"],"image/prs.pti":["pti"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.airzip.accelerator.azv":["azv"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":["*sub"],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.microsoft.icon":["ico"],"image/vnd.ms-dds":["dds"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.pco.b16":["b16"],"image/vnd.tencent.tap":["tap"],"image/vnd.valve.source.texture":["vtf"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/vnd.zbrush.pcx":["pcx"],"image/x-3ds":["3ds"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["*ico"],"image/x-jng":["jng"],"image/x-mrsid-image":["sid"],"image/x-ms-bmp":["*bmp"],"image/x-pcx":["*pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"message/vnd.wfa.wsc":["wsc"],"model/vnd.cld":["cld"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["mts"],"model/vnd.opengex":["ogex"],"model/vnd.parasolid.transmit.binary":["x_b"],"model/vnd.parasolid.transmit.text":["x_t"],"model/vnd.pytha.pyox":["pyo","pyox"],"model/vnd.sap.vds":["vds"],"model/vnd.usda":["usda"],"model/vnd.usdz+zip":["usdz"],"model/vnd.valve.source.compiled-map":["bsp"],"model/vnd.vtu":["vtu"],"text/prs.lines.tag":["dsc"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.familysearch.gedcom":["ged"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-org":["*org"],"text/x-pascal":["p","pas"],"text/x-processing":["pde"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-suse-ymp":["ymp"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]};Object.freeze(Zi);const eo={"application/andrew-inset":["ez"],"application/appinstaller":["appinstaller"],"application/applixware":["aw"],"application/appx":["appx"],"application/appxbundle":["appxbundle"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/automationml-aml+xml":["aml"],"application/automationml-amlx+zip":["amlx"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cpl+xml":["cpl"],"application/cu-seeme":["cu"],"application/cwl":["cwl"],"application/dash+xml":["mpd"],"application/dash-patch+xml":["mpp"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/express":["exp"],"application/fdf":["fdf"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["*js"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/media-policy-dataset+xml":["mpf"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["*mp4","*mpg4","mp4s","m4p"],"application/msix":["msix"],"application/msixbundle":["msixbundle"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-keys":["asc"],"application/pgp-signature":["sig","*asc"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/sql":["sql"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/trig":["trig"],"application/ttml+xml":["ttml"],"application/ubjson":["ubj"],"application/urc-ressheet+xml":["rsheet"],"application/urc-targetdesc+xml":["td"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/watcherinfo+xml":["wif"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xfdf":["xfdf"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["*xsl","xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":["*3gpp"],"audio/aac":["adts","aac"],"audio/adpcm":["adp"],"audio/amr":["amr"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx","opus"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/avci":["avci"],"image/avcs":["avcs"],"image/avif":["avif"],"image/bmp":["bmp","dib"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/dpx":["dpx"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/hsj2":["hsj2"],"image/ief":["ief"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm","jpgm"],"image/jpx":["jpx","jpf"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/ktx2":["ktx2"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/jt":["jt"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/prc":["prc"],"model/step+xml":["stpx"],"model/step+zip":["stpz"],"model/step-xml+zip":["stpxz"],"model/stl":["stl"],"model/u3d":["u3d"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/javascript":["js","mjs"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["md","markdown"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/spdx":["spdx"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/wgsl":["wgsl"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/iso.segment":["m4s"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","*jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]};Object.freeze(eo);var qr=Object.defineProperty,Wr=g((e,t)=>qr(e,"name",{value:t,configurable:!0}),"g$5"),L=g(function(e,t,i,o){if(i==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?o:i==="a"?o.call(e):o?o.value:t.get(e)},"n$4"),me,Ee,re;let Ur=class{static{g(this,"p")}static{Wr(this,"Mime")}constructor(...t){me.set(this,new Map),Ee.set(this,new Map),re.set(this,new Map);for(const i of t)this.define(i)}define(t,i=!1){for(let[o,n]of Object.entries(t)){o=o.toLowerCase(),n=n.map(l=>l.toLowerCase()),L(this,re,"f").has(o)||L(this,re,"f").set(o,new Set);const a=L(this,re,"f").get(o);let s=!0;for(let l of n){const p=l.startsWith("*");if(l=p?l.slice(1):l,a?.add(l),s&&L(this,Ee,"f").set(o,l),s=!1,p)continue;const r=L(this,me,"f").get(l);if(r&&r!=o&&!i)throw new Error(`"${o} -> ${l}" conflicts with "${r} -> ${l}". Pass \`force=true\` to override this definition.`);L(this,me,"f").set(l,o)}}return this}getType(t){if(typeof t!="string")return null;const i=t.replace(/^.*[/\\]/,"").toLowerCase(),o=i.replace(/^.*\./,"").toLowerCase(),n=i.length<t.length;return!(o.length<i.length-1)&&n?null:L(this,me,"f").get(o)??null}getExtension(t){return typeof t!="string"?null:(t=t?.split?.(";")[0],(t&&L(this,Ee,"f").get(t.trim().toLowerCase()))??null)}getAllExtensions(t){return typeof t!="string"?null:L(this,re,"f").get(t.toLowerCase())??null}_freeze(){this.define=()=>{throw new Error("define() not allowed for built-in Mime objects. See https://github.com/broofa/mime/blob/main/README.md#custom-mime-instances")},Object.freeze(this);for(const t of L(this,re,"f").values())Object.freeze(t);return this}_getTestState(){return{types:L(this,me,"f"),extensions:L(this,Ee,"f")}}};me=new WeakMap,Ee=new WeakMap,re=new WeakMap;const Vr=new Ur(eo,Zi)._freeze();var Kr=Object.defineProperty,Ot=g((e,t)=>Kr(e,"name",{value:t,configurable:!0}),"u$5");const Hr=Ot(async(e,t)=>{await new Promise((i,o)=>{const n=vn(e);n.on("error",o);const a=hn(t);a.on("error",o),a.on("finish",i),n.pipe(a)})},"copy"),Gr=Ot(e=>{let t=e.toString("utf8").replaceAll(/[\n\r]/g,"").replaceAll(" "," "),i;do i=t,t=t.replaceAll(/<!--(.*(?=-->))-->/g,"");while(t!==i);return encodeURIComponent(t.replaceAll("'","\\i")).replaceAll("(","%28").replaceAll(")","%29")},"encodeSVG"),Yr=Ot(({destDir:e,emitFiles:t,exclude:i,fileName:o,include:n,limit:a,publicPath:s,sourceDir:l})=>{const p=X(n,i),r={};return{async generateBundle(c){if(!t)return;const m=e??c.dir??M(c.file??"");await Nt(m),await Promise.all(Object.keys(r).map(async d=>{const u=r[d],h=j(m,M(u));await Nt(h),await Hr(d,j(m,u))}))},async load(c){if(!p(c))return null;this.addWatchFile(c);const[m,d]=await Promise.all([kt(c),Jo(c)]);let u;if(a&&m.size>a||a===0){const h=un.createHash("sha1").update(d).digest("hex").slice(0,16),v=He(c),y=ne(c,v),f=l?_(l,M(c)):ne(M(c)),x=o.replaceAll("[hash]",h).replaceAll("[extname]",v).replaceAll("[dirname]",f===""?"":`${f}/`).replaceAll("[name]",y);u=j(s??"",x),r[c]=x}else{const h=Vr.getType(c);if(h===null)throw new Error(`Could not determine mimetype for ${c}`);const v=h==="image/svg+xml";u=v?Gr(d):d.toString("base64"),u=`data:${h}${v?"":";base64"},${u}`}return`export default "${u}"`},name:"packem:url"}},"urlPlugin");var Xr=Object.defineProperty,Qr=g((e,t)=>Xr(e,"name",{value:t,configurable:!0}),"s$8");const Zr=Qr(e=>{const t=ne(e).split(".");if(t.length>=2){const[i,o]=t.slice(-2),n=t[0],a=/^(\w+)-runtime$/.exec(i)?.[1];if(Ge.includes(o)&&a&&a.length>0)return n+"-"+a}},"getCustomModuleLayer");var el=Object.defineProperty,tl=g((e,t)=>el(e,"name",{value:t,configurable:!0}),"i$5");const ct=tl(e=>(e.preserveDirectives||{directives:[]}).directives.map(t=>t.replace(/^use /,"")).find(t=>t!=="strict"),"getModuleLayer");var il=Object.defineProperty,Zt=g((e,t)=>il(e,"name",{value:t,configurable:!0}),"d$9");const ol=Zt((e,t)=>{const i=new Map;return Zt(function(o,n){const a=n.getModuleInfo(o);if(!a)return;const{isEntry:s}=a,l=a.meta,p=ct(l);if(!s){const r=i.get(o);if(r)return r;const c=Zr(o);if(c)return i.set(o,c),c}if(s){const r=n.getModuleIds();for(const c of r)n.getModuleInfo(c)&&ct(l)===p&&(e.has(c)||e.set(c,new Set),e.get(c).add([o,p]))}if(p&&!s&&e.has(o)){const r=[...e.get(o)];if(r.some(([m])=>{if(t.some(d=>d.path===m)){const d=n.getModuleInfo(m);return ct(d?d.meta:{})===p}return!1}))return;if(r.every(([,m])=>m===p))return i.has(o)?i.get(o):void 0;const c=ne(o,He(o))+"-"+p;return i.set(o,c),c}},"splitChunks")},"createSplitChunks");var nl=Object.defineProperty,al=g((e,t)=>nl(e,"name",{value:t,configurable:!0}),"n$3");const oe=al((e,t)=>e.isDynamicEntry?`${Nn}/[name].${t}`:`${_n}/${e.name}-[hash].${t}`,"getChunkFilename");var sl=Object.defineProperty,rl=g((e,t)=>sl(e,"name",{value:t,configurable:!0}),"o$4");const ll=process.platform==="win32",ei=rl((e,t)=>{const i=ll?"\\":"/";for(let o of Array.isArray(e.names)?e.names:[]){if(o.includes("node_modules"+i+".pnpm"))return o=o.replace("node_modules"+i+".pnpm","external")+"."+t,o.replace("node_modules"+i,"");if(o.includes("node_modules"))return o.replace("node_modules","external")+"."+t}return"[name]."+t},"getEntryFileNames");var pl=Object.defineProperty,A=g((e,t)=>pl(e,"name",{value:t,configurable:!0}),"l$5");const to=A((e,t)=>{const i=[],o=[],n=[];return e&&e.filter(Boolean).filter(a=>a.type===t?!0:t==="build"&&a.type===void 0).forEach(a=>{a.enforce==="pre"?i.push(a.plugin):a.enforce==="post"?o.push(a.plugin):n.push(a.plugin)}),[i,n,o]},"sortUserPlugins"),cl=A((e,t)=>{if(e==="esbuild"){if(!t.options.rollup.esbuild)throw new Error("No esbuild options found in your configuration.");t.tsconfig?.config.compilerOptions?.target?.toLowerCase()==="es3"&&(t.logger.warn(["ES3 target is not supported by esbuild, so ES5 will be used instead..","Please set 'target' option in tsconfig to at least ES5 to disable this error"].join(" ")),t.tsconfig.config.compilerOptions.target="es5",t.options.rollup.esbuild.target="es5");let i="node"+yo.node.split(".")[0];if(t.pkg.engines?.node){const o=bi(t.pkg.engines.node);o&&(i="node"+o.major)}if(t.options.rollup.esbuild.target){const o=Se(t.options.rollup.esbuild.target);o.some(n=>n.startsWith("node"))||(t.options.rollup.esbuild.target=[...new Set([...Se(i),...o])])}else t.options.rollup.esbuild.target=Se(i);return t.tsconfig?.config.compilerOptions?.target==="es5"&&(t.options.rollup.esbuild.keepNames=!1,t.logger.debug("Disabling keepNames because target is set to es5")),{logger:t.logger,minify:t.options.minify,minifyWhitespace:t.options.minify,sourceMap:t.options.sourcemap,...t.options.rollup.esbuild}}if(e==="swc"){if(!t.options.rollup.swc)throw new Error("No swc options found in your configuration.");return{minify:t.options.minify,...t.options.rollup.swc,jsc:{minify:{compress:{directives:!1},format:{comments:"some"},mangle:{topLevel:!0},sourceMap:t.options.sourcemap,toplevel:t.options.emitCJS??t.options.emitESM},...t.options.rollup.swc.jsc},sourceMaps:t.options.sourcemap}}if(e==="sucrase"){if(!t.options.rollup.sucrase)throw new Error("No sucrase options found in your configuration.");return t.options.rollup.sucrase}throw new Error("A Unknown transformer was provided")},"getTransformerConfig"),io=A((e,t)=>{if(e.code==="CIRCULAR_DEPENDENCY"&&/Circular dependency:[\s\S]*node_modules/.test(e.message))return!0;if(e.code==="UNRESOLVED_IMPORT")throw new Error(`Failed to resolve the module "${e.exporter}" imported by "${P(_(E(),e.id))}"
90
+ To replace these, add them to the "rollup -> patchTypes -> identifierReplacements" option in your packem config.`,prefix:"plugin:patch-types"}),Xt.set(l,!0)}return e}g(Ui,"I$2");pe(Ui,"replaceConfusingTypeNames");const br=pe((e,t)=>{if(t.leadingComments?.some(i=>i.type==="CommentBlock"&&i.value.includes("@internal"))){const i=e.original[t.end]===","?t.end+1:t.end;return e.remove(t.leadingComments[0].start,i),!0}return!1},"removeInternal");function Vi(e,t){if(e.includes("@internal")){const i=new H(e),o=xn(e,{plugins:["typescript"],sourceType:"module"});if(Et(o,{enter(n){br(i,n)&&this.skip()}}),e=i.toString(),e.includes("@internal"))throw new Error(`${t.fileName} has unhandled @internal declarations`)}return e}g(Vi,"S$3");pe(Vi,"stripInternalTypes");const wr=pe((e,t)=>({name:"packem:patch-types",renderChunk(i,o){return i=Ui.call(this,i,o,e,t),i=Vi.call(this,i,o),i=yr(i),i},resolveId(i){return i.startsWith("types/")?{external:!0,id:"../../"+(i.endsWith(".js")?i:i+".js")}:null}}),"patchTypescriptTypes");var kr=Object.defineProperty,X=g((e,t)=>kr(e,"name",{value:t,configurable:!0}),"o$4");const jr=42,$r=X(e=>{let t=!1;for(let i=0;i<e.length;i++)if(e.codePointAt(i)===jr){if(t)return!1;t=!0}return!0},"hasZeroOrOneAsteriskCharacter"),Er=X(e=>{const t=e.indexOf("*");return t===-1?void 0:{prefix:e.slice(0,t),suffix:e.slice(t+1)}},"tryParsePattern"),Sr=X(({prefix:e,suffix:t},i)=>i.length>=e.length+t.length&&i.startsWith(e)&&i.endsWith(t),"isPatternMatch"),Or=X((e,t,i)=>{let o,n=-1;for(const a of e){const s=t(a);Sr(s,i)&&s.prefix.length>n&&(n=s.prefix.length,o=a)}return o},"findBestPatternMatch"),Pr=X((e,t)=>{const i=[];for(const o of e){if(!$r(o))continue;const n=Er(o);if(n)i.push(n);else if(o===t)return o}return Or(i,o=>o,t)},"matchPatternOrExact"),Dr=X((e,t)=>t.substring(e.prefix.length,t.length-e.suffix.length),"matchedText"),Cr=X(({prefix:e,suffix:t})=>`${e}*${t}`,"patternText"),Nr=X((e,t,i)=>{let o=M(t.path);t.config.compilerOptions?.baseUrl&&(o=E(e,t.config.compilerOptions.baseUrl)),i?.debug({message:`Resolved baseUrl to ${o}`,prefix:"plugin:packem:resolve-tsconfig-paths"});const n=t.config.compilerOptions?.paths??{};return Object.keys(n).length===0&&i?.debug({message:"No paths found in tsconfig.json",prefix:"plugin:packem:resolve-tsconfig-paths"}),{paths:n,resolvedBaseUrl:o}},"getTsconfigPaths"),Ki=X((e,t,i,o)=>{const{paths:n,resolvedBaseUrl:a}=Nr(e,t,i),s=Object.keys(n);return{name:"packem:resolve-tsconfig-paths",async resolveId(l,p,r){if(s.length===0)return null;if(l.includes("\0"))return i.debug({message:`Skipping resolution of ${l} as it is a virtual module`,prefix:"plugin:packem:resolve-tsconfig-paths"}),null;if(l.includes("node_modules"))return i.debug({message:`Skipping request as it is inside node_modules ${l}`,prefix:"plugin:packem:resolve-tsconfig-paths"}),null;if(!o.resolveAbsolutePath&&fe(l))return i.debug({message:`Skipping request as it is an absolute path ${l}`,prefix:"plugin:packem:resolve-tsconfig-paths"}),null;if(kt(l))return i.debug({message:`Skipping request as it is a relative path ${l}`,prefix:"plugin:packem:resolve-tsconfig-paths"}),null;const c=Pr(s,l);if(!c)return i.debug({message:`moduleName did not match any paths pattern ${l}`,prefix:"plugin:packem:resolve-tsconfig-paths"}),null;const m=typeof c=="string"?void 0:Dr(c,l),d=typeof c=="string"?c:Cr(c);for await(const u of n[d]){const h=m?u.replace("*",m):u;if(h.endsWith(".d.ts")||h.endsWith(".d.cts")||h.endsWith(".d.mts"))continue;const v=j(a,h);try{const x=await this.resolve(v,p,{skipSelf:!0,...r});if(x)return x}catch(x){i.debug({context:x,message:`Failed to resolve ${v} from ${l}`,prefix:"plugin:packem:resolve-tsconfig-paths"})}}return null}}},"resolveTsconfigPathsPlugin");var _r=Object.defineProperty,Gi=g((e,t)=>_r(e,"name",{value:t,configurable:!0}),"u$6");const Mr=Gi((e,t)=>{if(!t)return null;const{config:i,path:o}=t;if(!i.compilerOptions)return null;const{rootDirs:n}=i.compilerOptions;if(!n)return null;const a=[];for(const s of n){if(s.startsWith("."))throw new Error(`Invalid rootDir value '.' in ${o}.`);if(s.startsWith(".."))throw new Error(`Invalid rootDir value '..' in ${o}.`);a.push(E(e,s))}return a},"getRootDirectories"),Hi=Gi((e,t,i)=>{const o=Mr(e,i);return{name:"packem:resolve-tsconfig-root-dirs",async resolveId(n,a,s){if(o===null||o.length===0)return null;if(n.startsWith("."))for(const l of o){const p=j(l,n),r=await this.resolve(p,a,{skipSelf:!0,...s});if(r)return t.debug({message:`Resolved ${n} to ${r.id} using rootDirs from tsconfig.json.`,prefix:"plugin:resolve-tsconfig-root-dirs"}),r.id}return null}}},"resolveTsconfigRootDirectories");var Tr=Object.defineProperty,Ir=g((e,t)=>Tr(e,"name",{value:t,configurable:!0}),"r$9");const Yi=Ir(()=>{const e=/\.(?:[mc]?js|jsx)$/;return{name:"packem:resolve-typescript-mjs-cjs",async resolveId(t,i,o){return e.test(t)&&i?await this.resolve(t.replace(/js(x?)$/,"ts$1"),i,o):null}}},"resolveTypescriptMjsCts"),Xi={"application/prs.cww":["cww"],"application/prs.xsf+xml":["xsf"],"application/vnd.1000minds.decision-model+xml":["1km"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["*xfdf"],"application/vnd.age":["age"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.keynote":["key"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.apple.numbers":["numbers"],"application/vnd.apple.pages":["pages"],"application/vnd.apple.pkpass":["pkpass"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.balsamiq.bmml+xml":["bmml"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.citationstyles.style+xml":["csl"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dbf":["dbf"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["*fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans.fnc":["fnc"],"application/vnd.frogans.ltf":["ltf"],"application/vnd.fsc.weblaunch":["fsc"],"application/vnd.fujitsu.oasys":["oas"],"application/vnd.fujitsu.oasys2":["oa2"],"application/vnd.fujitsu.oasys3":["oa3"],"application/vnd.fujitsu.oasysgp":["fg5"],"application/vnd.fujitsu.oasysprs":["bh2"],"application/vnd.fujixerox.ddd":["ddd"],"application/vnd.fujixerox.docuworks":["xdw"],"application/vnd.fujixerox.docuworks.binder":["xbd"],"application/vnd.fuzzysheet":["fzs"],"application/vnd.genomatix.tuxedo":["txd"],"application/vnd.geogebra.file":["ggb"],"application/vnd.geogebra.tool":["ggt"],"application/vnd.geometry-explorer":["gex","gre"],"application/vnd.geonext":["gxt"],"application/vnd.geoplan":["g2w"],"application/vnd.geospace":["g3w"],"application/vnd.gmx":["gmx"],"application/vnd.google-apps.document":["gdoc"],"application/vnd.google-apps.presentation":["gslides"],"application/vnd.google-apps.spreadsheet":["gsheet"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/vnd.grafeq":["gqf","gqs"],"application/vnd.groove-account":["gac"],"application/vnd.groove-help":["ghf"],"application/vnd.groove-identity-message":["gim"],"application/vnd.groove-injector":["grv"],"application/vnd.groove-tool-message":["gtm"],"application/vnd.groove-tool-template":["tpl"],"application/vnd.groove-vcard":["vcg"],"application/vnd.hal+xml":["hal"],"application/vnd.handheld-entertainment+xml":["zmm"],"application/vnd.hbci":["hbci"],"application/vnd.hhe.lesson-player":["les"],"application/vnd.hp-hpgl":["hpgl"],"application/vnd.hp-hpid":["hpid"],"application/vnd.hp-hps":["hps"],"application/vnd.hp-jlyt":["jlt"],"application/vnd.hp-pcl":["pcl"],"application/vnd.hp-pclxl":["pclxl"],"application/vnd.hydrostatix.sof-data":["sfd-hdstx"],"application/vnd.ibm.minipay":["mpy"],"application/vnd.ibm.modcap":["afp","listafp","list3820"],"application/vnd.ibm.rights-management":["irm"],"application/vnd.ibm.secure-container":["sc"],"application/vnd.iccprofile":["icc","icm"],"application/vnd.igloader":["igl"],"application/vnd.immervision-ivp":["ivp"],"application/vnd.immervision-ivu":["ivu"],"application/vnd.insors.igm":["igm"],"application/vnd.intercon.formnet":["xpw","xpx"],"application/vnd.intergeo":["i2g"],"application/vnd.intu.qbo":["qbo"],"application/vnd.intu.qfx":["qfx"],"application/vnd.ipunplugged.rcprofile":["rcprofile"],"application/vnd.irepository.package+xml":["irp"],"application/vnd.is-xpr":["xpr"],"application/vnd.isac.fcs":["fcs"],"application/vnd.jam":["jam"],"application/vnd.jcp.javame.midlet-rms":["rms"],"application/vnd.jisp":["jisp"],"application/vnd.joost.joda-archive":["joda"],"application/vnd.kahootz":["ktz","ktr"],"application/vnd.kde.karbon":["karbon"],"application/vnd.kde.kchart":["chrt"],"application/vnd.kde.kformula":["kfo"],"application/vnd.kde.kivio":["flw"],"application/vnd.kde.kontour":["kon"],"application/vnd.kde.kpresenter":["kpr","kpt"],"application/vnd.kde.kspread":["ksp"],"application/vnd.kde.kword":["kwd","kwt"],"application/vnd.kenameaapp":["htke"],"application/vnd.kidspiration":["kia"],"application/vnd.kinar":["kne","knp"],"application/vnd.koan":["skp","skd","skt","skm"],"application/vnd.kodak-descriptor":["sse"],"application/vnd.las.las+xml":["lasxml"],"application/vnd.llamagraphics.life-balance.desktop":["lbd"],"application/vnd.llamagraphics.life-balance.exchange+xml":["lbe"],"application/vnd.lotus-1-2-3":["123"],"application/vnd.lotus-approach":["apr"],"application/vnd.lotus-freelance":["pre"],"application/vnd.lotus-notes":["nsf"],"application/vnd.lotus-organizer":["org"],"application/vnd.lotus-screencam":["scm"],"application/vnd.lotus-wordpro":["lwp"],"application/vnd.macports.portpkg":["portpkg"],"application/vnd.mapbox-vector-tile":["mvt"],"application/vnd.mcd":["mcd"],"application/vnd.medcalcdata":["mc1"],"application/vnd.mediastation.cdkey":["cdkey"],"application/vnd.mfer":["mwf"],"application/vnd.mfmp":["mfm"],"application/vnd.micrografx.flo":["flo"],"application/vnd.micrografx.igx":["igx"],"application/vnd.mif":["mif"],"application/vnd.mobius.daf":["daf"],"application/vnd.mobius.dis":["dis"],"application/vnd.mobius.mbk":["mbk"],"application/vnd.mobius.mqy":["mqy"],"application/vnd.mobius.msl":["msl"],"application/vnd.mobius.plc":["plc"],"application/vnd.mobius.txf":["txf"],"application/vnd.mophun.application":["mpn"],"application/vnd.mophun.certificate":["mpc"],"application/vnd.mozilla.xul+xml":["xul"],"application/vnd.ms-artgalry":["cil"],"application/vnd.ms-cab-compressed":["cab"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.addin.macroenabled.12":["xlam"],"application/vnd.ms-excel.sheet.binary.macroenabled.12":["xlsb"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.ms-excel.template.macroenabled.12":["xltm"],"application/vnd.ms-fontobject":["eot"],"application/vnd.ms-htmlhelp":["chm"],"application/vnd.ms-ims":["ims"],"application/vnd.ms-lrm":["lrm"],"application/vnd.ms-officetheme":["thmx"],"application/vnd.ms-outlook":["msg"],"application/vnd.ms-pki.seccat":["cat"],"application/vnd.ms-pki.stl":["*stl"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.ms-powerpoint.addin.macroenabled.12":["ppam"],"application/vnd.ms-powerpoint.presentation.macroenabled.12":["pptm"],"application/vnd.ms-powerpoint.slide.macroenabled.12":["sldm"],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":["ppsm"],"application/vnd.ms-powerpoint.template.macroenabled.12":["potm"],"application/vnd.ms-project":["*mpp","mpt"],"application/vnd.ms-word.document.macroenabled.12":["docm"],"application/vnd.ms-word.template.macroenabled.12":["dotm"],"application/vnd.ms-works":["wps","wks","wcm","wdb"],"application/vnd.ms-wpl":["wpl"],"application/vnd.ms-xpsdocument":["xps"],"application/vnd.mseq":["mseq"],"application/vnd.musician":["mus"],"application/vnd.muvee.style":["msty"],"application/vnd.mynfc":["taglet"],"application/vnd.neurolanguage.nlu":["nlu"],"application/vnd.nitf":["ntf","nitf"],"application/vnd.noblenet-directory":["nnd"],"application/vnd.noblenet-sealer":["nns"],"application/vnd.noblenet-web":["nnw"],"application/vnd.nokia.n-gage.ac+xml":["*ac"],"application/vnd.nokia.n-gage.data":["ngdat"],"application/vnd.nokia.n-gage.symbian.install":["n-gage"],"application/vnd.nokia.radio-preset":["rpst"],"application/vnd.nokia.radio-presets":["rpss"],"application/vnd.novadigm.edm":["edm"],"application/vnd.novadigm.edx":["edx"],"application/vnd.novadigm.ext":["ext"],"application/vnd.oasis.opendocument.chart":["odc"],"application/vnd.oasis.opendocument.chart-template":["otc"],"application/vnd.oasis.opendocument.database":["odb"],"application/vnd.oasis.opendocument.formula":["odf"],"application/vnd.oasis.opendocument.formula-template":["odft"],"application/vnd.oasis.opendocument.graphics":["odg"],"application/vnd.oasis.opendocument.graphics-template":["otg"],"application/vnd.oasis.opendocument.image":["odi"],"application/vnd.oasis.opendocument.image-template":["oti"],"application/vnd.oasis.opendocument.presentation":["odp"],"application/vnd.oasis.opendocument.presentation-template":["otp"],"application/vnd.oasis.opendocument.spreadsheet":["ods"],"application/vnd.oasis.opendocument.spreadsheet-template":["ots"],"application/vnd.oasis.opendocument.text":["odt"],"application/vnd.oasis.opendocument.text-master":["odm"],"application/vnd.oasis.opendocument.text-template":["ott"],"application/vnd.oasis.opendocument.text-web":["oth"],"application/vnd.olpc-sugar":["xo"],"application/vnd.oma.dd2+xml":["dd2"],"application/vnd.openblox.game+xml":["obgx"],"application/vnd.openofficeorg.extension":["oxt"],"application/vnd.openstreetmap.data+xml":["osm"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.osgeo.mapguide.package":["mgp"],"application/vnd.osgi.dp":["dp"],"application/vnd.osgi.subsystem":["esa"],"application/vnd.palm":["pdb","pqa","oprc"],"application/vnd.pawaafile":["paw"],"application/vnd.pg.format":["str"],"application/vnd.pg.osasli":["ei6"],"application/vnd.picsel":["efif"],"application/vnd.pmi.widget":["wg"],"application/vnd.pocketlearn":["plf"],"application/vnd.powerbuilder6":["pbd"],"application/vnd.previewsystems.box":["box"],"application/vnd.proteus.magazine":["mgz"],"application/vnd.publishare-delta-tree":["qps"],"application/vnd.pvi.ptid1":["ptid"],"application/vnd.pwg-xhtml-print+xml":["xhtm"],"application/vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"application/vnd.rar":["rar"],"application/vnd.realvnc.bed":["bed"],"application/vnd.recordare.musicxml":["mxl"],"application/vnd.recordare.musicxml+xml":["musicxml"],"application/vnd.rig.cryptonote":["cryptonote"],"application/vnd.rim.cod":["cod"],"application/vnd.rn-realmedia":["rm"],"application/vnd.rn-realmedia-vbr":["rmvb"],"application/vnd.route66.link66+xml":["link66"],"application/vnd.sailingtracker.track":["st"],"application/vnd.seemail":["see"],"application/vnd.sema":["sema"],"application/vnd.semd":["semd"],"application/vnd.semf":["semf"],"application/vnd.shana.informed.formdata":["ifm"],"application/vnd.shana.informed.formtemplate":["itp"],"application/vnd.shana.informed.interchange":["iif"],"application/vnd.shana.informed.package":["ipk"],"application/vnd.simtech-mindmapper":["twd","twds"],"application/vnd.smaf":["mmf"],"application/vnd.smart.teacher":["teacher"],"application/vnd.software602.filler.form+xml":["fo"],"application/vnd.solent.sdkm+xml":["sdkm","sdkd"],"application/vnd.spotfire.dxp":["dxp"],"application/vnd.spotfire.sfs":["sfs"],"application/vnd.stardivision.calc":["sdc"],"application/vnd.stardivision.draw":["sda"],"application/vnd.stardivision.impress":["sdd"],"application/vnd.stardivision.math":["smf"],"application/vnd.stardivision.writer":["sdw","vor"],"application/vnd.stardivision.writer-global":["sgl"],"application/vnd.stepmania.package":["smzip"],"application/vnd.stepmania.stepchart":["sm"],"application/vnd.sun.wadl+xml":["wadl"],"application/vnd.sun.xml.calc":["sxc"],"application/vnd.sun.xml.calc.template":["stc"],"application/vnd.sun.xml.draw":["sxd"],"application/vnd.sun.xml.draw.template":["std"],"application/vnd.sun.xml.impress":["sxi"],"application/vnd.sun.xml.impress.template":["sti"],"application/vnd.sun.xml.math":["sxm"],"application/vnd.sun.xml.writer":["sxw"],"application/vnd.sun.xml.writer.global":["sxg"],"application/vnd.sun.xml.writer.template":["stw"],"application/vnd.sus-calendar":["sus","susp"],"application/vnd.svd":["svd"],"application/vnd.symbian.install":["sis","sisx"],"application/vnd.syncml+xml":["xsm"],"application/vnd.syncml.dm+wbxml":["bdm"],"application/vnd.syncml.dm+xml":["xdm"],"application/vnd.syncml.dmddf+xml":["ddf"],"application/vnd.tao.intent-module-archive":["tao"],"application/vnd.tcpdump.pcap":["pcap","cap","dmp"],"application/vnd.tmobile-livetv":["tmo"],"application/vnd.trid.tpt":["tpt"],"application/vnd.triscape.mxs":["mxs"],"application/vnd.trueapp":["tra"],"application/vnd.ufdl":["ufd","ufdl"],"application/vnd.uiq.theme":["utz"],"application/vnd.umajin":["umj"],"application/vnd.unity":["unityweb"],"application/vnd.uoml+xml":["uoml","uo"],"application/vnd.vcx":["vcx"],"application/vnd.visio":["vsd","vst","vss","vsw"],"application/vnd.visionary":["vis"],"application/vnd.vsf":["vsf"],"application/vnd.wap.wbxml":["wbxml"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.wap.wmlscriptc":["wmlsc"],"application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":["*dmg"],"application/x-arj":["arj"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bdoc":["*bdoc"],"application/x-bittorrent":["torrent"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-cocoa":["cco"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["*deb","udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-httpd-php":["php"],"application/x-install-instructions":["install"],"application/x-iso9660-image":["*iso"],"application/x-iwork-keynote-sffkey":["*key"],"application/x-iwork-numbers-sffnumbers":["*numbers"],"application/x-iwork-pages-sffpages":["*pages"],"application/x-java-archive-diff":["jardiff"],"application/x-java-jnlp-file":["jnlp"],"application/x-keepass2":["kdbx"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-makeself":["run"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["*prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdos-program":["*exe"],"application/x-msdownload":["*exe","*dll","com","bat","*msi"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["*wmf","*wmz","*emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-ns-proxy-autoconfig":["pac"],"application/x-nzb":["nzb"],"application/x-perl":["pl","pm"],"application/x-pilot":["*prc","*pdb"],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["*rar"],"application/x-redhat-package-manager":["rpm"],"application/x-research-info-systems":["ris"],"application/x-sea":["sea"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["*sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl","tk"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["*obj"],"application/x-ustar":["ustar"],"application/x-virtualbox-hdd":["hdd"],"application/x-virtualbox-ova":["ova"],"application/x-virtualbox-ovf":["ovf"],"application/x-virtualbox-vbox":["vbox"],"application/x-virtualbox-vbox-extpack":["vbox-extpack"],"application/x-virtualbox-vdi":["vdi"],"application/x-virtualbox-vhd":["vhd"],"application/x-virtualbox-vmdk":["vmdk"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt","pem"],"application/x-xfig":["fig"],"application/x-xliff+xml":["*xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/x-aac":["*aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-m4a":["*m4a"],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-realaudio":["*ra"],"audio/x-wav":["*wav"],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"image/prs.btif":["btif","btf"],"image/prs.pti":["pti"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.airzip.accelerator.azv":["azv"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":["*sub"],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.microsoft.icon":["ico"],"image/vnd.ms-dds":["dds"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.pco.b16":["b16"],"image/vnd.tencent.tap":["tap"],"image/vnd.valve.source.texture":["vtf"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/vnd.zbrush.pcx":["pcx"],"image/x-3ds":["3ds"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["*ico"],"image/x-jng":["jng"],"image/x-mrsid-image":["sid"],"image/x-ms-bmp":["*bmp"],"image/x-pcx":["*pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"message/vnd.wfa.wsc":["wsc"],"model/vnd.cld":["cld"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["mts"],"model/vnd.opengex":["ogex"],"model/vnd.parasolid.transmit.binary":["x_b"],"model/vnd.parasolid.transmit.text":["x_t"],"model/vnd.pytha.pyox":["pyo","pyox"],"model/vnd.sap.vds":["vds"],"model/vnd.usda":["usda"],"model/vnd.usdz+zip":["usdz"],"model/vnd.valve.source.compiled-map":["bsp"],"model/vnd.vtu":["vtu"],"text/prs.lines.tag":["dsc"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.familysearch.gedcom":["ged"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-org":["*org"],"text/x-pascal":["p","pas"],"text/x-processing":["pde"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-suse-ymp":["ymp"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]};Object.freeze(Xi);const Qi={"application/andrew-inset":["ez"],"application/appinstaller":["appinstaller"],"application/applixware":["aw"],"application/appx":["appx"],"application/appxbundle":["appxbundle"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/automationml-aml+xml":["aml"],"application/automationml-amlx+zip":["amlx"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cpl+xml":["cpl"],"application/cu-seeme":["cu"],"application/cwl":["cwl"],"application/dash+xml":["mpd"],"application/dash-patch+xml":["mpp"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/express":["exp"],"application/fdf":["fdf"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["*js"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/media-policy-dataset+xml":["mpf"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["*mp4","*mpg4","mp4s","m4p"],"application/msix":["msix"],"application/msixbundle":["msixbundle"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-keys":["asc"],"application/pgp-signature":["sig","*asc"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/sql":["sql"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/trig":["trig"],"application/ttml+xml":["ttml"],"application/ubjson":["ubj"],"application/urc-ressheet+xml":["rsheet"],"application/urc-targetdesc+xml":["td"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/watcherinfo+xml":["wif"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xfdf":["xfdf"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["*xsl","xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":["*3gpp"],"audio/aac":["adts","aac"],"audio/adpcm":["adp"],"audio/amr":["amr"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx","opus"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/avci":["avci"],"image/avcs":["avcs"],"image/avif":["avif"],"image/bmp":["bmp","dib"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/dpx":["dpx"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/hsj2":["hsj2"],"image/ief":["ief"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm","jpgm"],"image/jpx":["jpx","jpf"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/ktx2":["ktx2"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/jt":["jt"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/prc":["prc"],"model/step+xml":["stpx"],"model/step+zip":["stpz"],"model/step-xml+zip":["stpxz"],"model/stl":["stl"],"model/u3d":["u3d"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/javascript":["js","mjs"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["md","markdown"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/spdx":["spdx"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/wgsl":["wgsl"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/iso.segment":["m4s"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","*jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]};Object.freeze(Qi);var Ar=Object.defineProperty,zr=g((e,t)=>Ar(e,"name",{value:t,configurable:!0}),"g$6"),L=g(function(e,t,i,o){if(i==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?o:i==="a"?o.call(e):o?o.value:t.get(e)},"n$5"),me,Ee,re;let Fr=class{static{g(this,"p")}static{zr(this,"Mime")}constructor(...t){me.set(this,new Map),Ee.set(this,new Map),re.set(this,new Map);for(const i of t)this.define(i)}define(t,i=!1){for(let[o,n]of Object.entries(t)){o=o.toLowerCase(),n=n.map(l=>l.toLowerCase()),L(this,re,"f").has(o)||L(this,re,"f").set(o,new Set);const a=L(this,re,"f").get(o);let s=!0;for(let l of n){const p=l.startsWith("*");if(l=p?l.slice(1):l,a?.add(l),s&&L(this,Ee,"f").set(o,l),s=!1,p)continue;const r=L(this,me,"f").get(l);if(r&&r!=o&&!i)throw new Error(`"${o} -> ${l}" conflicts with "${r} -> ${l}". Pass \`force=true\` to override this definition.`);L(this,me,"f").set(l,o)}}return this}getType(t){if(typeof t!="string")return null;const i=t.replace(/^.*[/\\]/,"").toLowerCase(),o=i.replace(/^.*\./,"").toLowerCase(),n=i.length<t.length;return!(o.length<i.length-1)&&n?null:L(this,me,"f").get(o)??null}getExtension(t){return typeof t!="string"?null:(t=t?.split?.(";")[0],(t&&L(this,Ee,"f").get(t.trim().toLowerCase()))??null)}getAllExtensions(t){return typeof t!="string"?null:L(this,re,"f").get(t.toLowerCase())??null}_freeze(){this.define=()=>{throw new Error("define() not allowed for built-in Mime objects. See https://github.com/broofa/mime/blob/main/README.md#custom-mime-instances")},Object.freeze(this);for(const t of L(this,re,"f").values())Object.freeze(t);return this}_getTestState(){return{types:L(this,me,"f"),extensions:L(this,Ee,"f")}}};me=new WeakMap,Ee=new WeakMap,re=new WeakMap;const Rr=new Fr(Qi,Xi)._freeze();var Lr=Object.defineProperty,St=g((e,t)=>Lr(e,"name",{value:t,configurable:!0}),"u$5");const Jr=St(async(e,t)=>{await new Promise((i,o)=>{const n=fn(e);n.on("error",o);const a=gn(t);a.on("error",o),a.on("finish",i),n.pipe(a)})},"copy"),Br=St(e=>{let t=e.toString("utf8").replaceAll(/[\n\r]/g,"").replaceAll(" "," "),i;do i=t,t=t.replaceAll(/<!--(.*(?=-->))-->/g,"");while(t!==i);return encodeURIComponent(t.replaceAll("'","\\i")).replaceAll("(","%28").replaceAll(")","%29")},"encodeSVG"),qr=St(({destDir:e,emitFiles:t,exclude:i,fileName:o,include:n,limit:a,publicPath:s,sourceDir:l})=>{const p=Y(n,i),r={};return{async generateBundle(c){if(!t)return;const m=e??c.dir??M(c.file??"");await Ct(m),await Promise.all(Object.keys(r).map(async d=>{const u=r[d],h=j(m,M(u));await Ct(h),await Jr(d,j(m,u))}))},async load(c){if(!p(c))return null;this.addWatchFile(c);const[m,d]=await Promise.all([wt(c),Ro(c)]);let u;if(a&&m.size>a||a===0){const h=dn.createHash("sha1").update(d).digest("hex").slice(0,16),v=Ge(c),x=ne(c,v),f=l?N(l,M(c)):ne(M(c)),y=o.replaceAll("[hash]",h).replaceAll("[extname]",v).replaceAll("[dirname]",f===""?"":`${f}/`).replaceAll("[name]",x);u=j(s??"",y),r[c]=y}else{const h=Rr.getType(c);if(h===null)throw new Error(`Could not determine mimetype for ${c}`);const v=h==="image/svg+xml";u=v?Br(d):d.toString("base64"),u=`data:${h}${v?"":";base64"},${u}`}return`export default "${u}"`},name:"packem:url"}},"urlPlugin");var Wr=Object.defineProperty,Ur=g((e,t)=>Wr(e,"name",{value:t,configurable:!0}),"s$8");const Vr=Ur(e=>{const t=ne(e).split(".");if(t.length>=2){const[i,o]=t.slice(-2),n=t[0],a=/^(\w+)-runtime$/.exec(i)?.[1];if(He.includes(o)&&a&&a.length>0)return n+"-"+a}},"getCustomModuleLayer");var Kr=Object.defineProperty,Gr=g((e,t)=>Kr(e,"name",{value:t,configurable:!0}),"i$5");const ct=Gr(e=>(e.preserveDirectives||{directives:[]}).directives.map(t=>t.replace(/^use /,"")).find(t=>t!=="strict"),"getModuleLayer");var Hr=Object.defineProperty,Qt=g((e,t)=>Hr(e,"name",{value:t,configurable:!0}),"d$9");const Yr=Qt((e,t)=>{const i=new Map;return Qt(function(o,n){const a=n.getModuleInfo(o);if(!a)return;const{isEntry:s}=a,l=a.meta,p=ct(l);if(!s){const r=i.get(o);if(r)return r;const c=Vr(o);if(c)return i.set(o,c),c}if(s){const r=n.getModuleIds();for(const c of r)n.getModuleInfo(c)&&ct(l)===p&&(e.has(c)||e.set(c,new Set),e.get(c).add([o,p]))}if(p&&!s&&e.has(o)){const r=[...e.get(o)];if(r.some(([m])=>{if(t.some(d=>d.path===m)){const d=n.getModuleInfo(m);return ct(d?d.meta:{})===p}return!1}))return;if(r.every(([,m])=>m===p))return i.has(o)?i.get(o):void 0;const c=ne(o,Ge(o))+"-"+p;return i.set(o,c),c}},"splitChunks")},"createSplitChunks");var Xr=Object.defineProperty,Qr=g((e,t)=>Xr(e,"name",{value:t,configurable:!0}),"n$4");const oe=Qr((e,t)=>e.isDynamicEntry?`${Dn}/[name].${t}`:`${Cn}/${e.name}-[hash].${t}`,"getChunkFilename");var Zr=Object.defineProperty,el=g((e,t)=>Zr(e,"name",{value:t,configurable:!0}),"o$3");const tl=process.platform==="win32",Zt=el((e,t)=>{const i=tl?"\\":"/";for(let o of Array.isArray(e.names)?e.names:[]){if(o.includes("node_modules"+i+".pnpm"))return o=o.replace("node_modules"+i+".pnpm","external")+"."+t,o.replace("node_modules"+i,"");if(o.includes("node_modules"))return o.replace("node_modules","external")+"."+t}return"[name]."+t},"getEntryFileNames");var il=Object.defineProperty,A=g((e,t)=>il(e,"name",{value:t,configurable:!0}),"e$5");const Zi=A((e,t)=>{const i=[],o=[],n=[];return e&&e.filter(Boolean).filter(a=>a.type===t?!0:t==="build"&&a.type===void 0).forEach(a=>{a.enforce==="pre"?i.push(a.plugin):a.enforce==="post"?o.push(a.plugin):n.push(a.plugin)}),[i,n,o]},"sortUserPlugins"),ol=A((e,t)=>{if(e==="esbuild"){if(!t.options.rollup.esbuild)throw new Error("No esbuild options found in your configuration.");t.tsconfig?.config.compilerOptions?.target?.toLowerCase()==="es3"&&(t.logger.warn(["ES3 target is not supported by esbuild, so ES5 will be used instead..","Please set 'target' option in tsconfig to at least ES5 to disable this error"].join(" ")),t.tsconfig.config.compilerOptions.target="es5",t.options.rollup.esbuild.target="es5");let i="node"+ho.node.split(".")[0];if(t.pkg.engines?.node){const o=yi(t.pkg.engines.node);o&&(i="node"+o.major)}if(t.options.rollup.esbuild.target){const o=Se(t.options.rollup.esbuild.target);o.some(n=>n.startsWith("node"))||(t.options.rollup.esbuild.target=[...new Set([...Se(i),...o])])}else t.options.rollup.esbuild.target=Se(i);return t.tsconfig?.config.compilerOptions?.target==="es5"&&(t.options.rollup.esbuild.keepNames=!1,t.logger.debug("Disabling keepNames because target is set to es5")),{logger:t.logger,minify:t.options.minify,minifyWhitespace:t.options.minify,sourceMap:t.options.sourcemap,...t.options.rollup.esbuild}}if(e==="swc"){if(!t.options.rollup.swc)throw new Error("No swc options found in your configuration.");return{minify:t.options.minify,...t.options.rollup.swc,jsc:{minify:{compress:{directives:!1},format:{comments:"some"},mangle:{topLevel:!0},sourceMap:t.options.sourcemap,toplevel:t.options.emitCJS??t.options.emitESM},...t.options.rollup.swc.jsc},sourceMaps:t.options.sourcemap}}if(e==="sucrase"){if(!t.options.rollup.sucrase)throw new Error("No sucrase options found in your configuration.");return t.options.rollup.sucrase}throw new Error("A Unknown transformer was provided")},"getTransformerConfig"),eo=A((e,t)=>{if(e.code==="CIRCULAR_DEPENDENCY"&&/Circular dependency:[\s\S]*node_modules/.test(e.message))return!0;if(e.code==="UNRESOLVED_IMPORT")throw new Error(`Failed to resolve the module "${e.exporter}" imported by "${D(N(E(),e.id))}"
91
91
  Is the module installed? Note:
92
92
  ↳ to inline a module into your bundle, install it to "devDependencies".
93
- ↳ to depend on a module via import/require, install it to "dependencies".`);return e.code==="MODULE_LEVEL_DIRECTIVE"?!0:e.code==="MIXED_EXPORTS"&&t.options.cjsInterop===!0},"sharedOnWarn"),oo=A((e,t)=>({input:Object.fromEntries(e.options.entries.map(i=>[i.name,E(e.options.rootDir,i.input)])),logLevel:e.options.debug?"debug":"info",onLog:A((i,o)=>{let n=o.message;switch(o.stack&&(n=`${n}
94
- ${o.stack}`),i){case"info":{e.logger.info({message:n,prefix:t+(o.plugin?":plugin:"+o.plugin:"")});return}case"warn":{e.logger.warn({message:n,prefix:t+(o.plugin?":plugin:"+o.plugin:"")});return}case"debug":e.logger.debug({message:n,prefix:t+(o.plugin?":plugin:"+o.plugin:"")})}},"onLog"),onwarn(i,o){io(i,e)||i.code||o(i)},treeshake:{moduleSideEffects:!0,preset:"smallest"},watch:e.mode==="watch"?e.options.rollup.watch:!1}),"baseRollupOptions"),no=A(async(e,t)=>{const i=Qe(e.pkg,e.options);let o;e.options.rollup.resolve&&(o=N(xi({...e.options.rollup.resolve}),t));const n=e.options.rollup.output?.preserveModules?{preserveModules:!0,preserveModulesRoot:e.options.rollup.output.preserveModulesRoot??"src"}:{manualChunks:ol(e.dependencyGraphMap,e.buildEntries),preserveModules:!1},[a,s,l]=to(e.options.rollup.plugins,"build");return{...oo(e,"build"),output:[e.options.emitCJS&&{assetFileNames:"[name]-[hash][extname]",chunkFileNames:A(p=>oe(p,"cjs"),"chunkFileNames"),compact:e.options.minify,dir:E(e.options.rootDir,e.options.outDir),entryFileNames:A(p=>ei(p,"cjs"),"entryFileNames"),exports:"auto",externalLiveBindings:!1,format:"cjs",freeze:!1,generatedCode:{arrowFunctions:!0,constBindings:!0,objectShorthand:!0,preset:e.tsconfig?.config.compilerOptions?.target==="es5"?"es5":"es2015",reservedNamesAsProps:!0,symbols:!0},hoistTransitiveImports:!1,interop:"compat",sourcemap:e.options.sourcemap,validate:!0,...e.options.rollup.output,...n},e.options.emitESM&&{assetFileNames:"[name]-[hash][extname]",chunkFileNames:A(p=>oe(p,"mjs"),"chunkFileNames"),compact:e.options.minify,dir:E(e.options.rootDir,e.options.outDir),entryFileNames:A(p=>ei(p,"mjs"),"entryFileNames"),exports:"auto",externalLiveBindings:!1,format:"esm",freeze:!1,generatedCode:{arrowFunctions:!0,constBindings:!0,objectShorthand:!0,preset:e.tsconfig?.config.compilerOptions?.target==="es5"?"es5":"es2015",reservedNamesAsProps:!0,symbols:!0},hoistTransitiveImports:!1,sourcemap:e.options.sourcemap,validate:!0,...e.options.rollup.output,...n}].filter(Boolean),plugins:[N(Vi(),t),N(Qi(),t),e.tsconfig&&N(Xi(e.options.rootDir,e.logger,e.tsconfig),t),e.tsconfig&&N(Gi(e.options.rootDir,e.tsconfig,e.logger),t),N(Ui(e.pkg,e.tsconfig,e.options,e.logger,e.options.rollup.resolveExternals??{}),t),e.options.rollup.replace&&yi({sourcemap:e.options.sourcemap,...e.options.rollup.replace}),e.options.rollup.alias&&hi({customResolver:o,...e.options.rollup.alias,entries:i}),...a,o,e.options.rollup.polyfillNode&&Ko({sourceMap:e.options.sourcemap,...e.options.rollup.polyfillNode}),e.options.rollup.json&&Fi({...e.options.rollup.json}),Yn(),e.options.rollup.wasm&&Vo(e.options.rollup.wasm),e.options.rollup.url&&Yr(e.options.rollup.url),e.options.rollup.css&&e.options.rollup.css.loaders&&e.options.rollup.css.loaders.length>0&&await Ka({dts:!!e.options.declaration||e.options.isolatedDeclarationTransformer!==void 0,sourceMap:e.options.sourcemap,...e.options.rollup.css},e.logger,e.options.browserTargets,e.options.rootDir,e.options.sourceDir,e.environment,e.options.sourcemap,e.options.debug,e.options.minify??!1,i),e.options.rollup.css&&e.options.rollup.css.loaders&&e.options.rollup.css.loaders.length>0&&e.options.declaration&&es(e.options.rollup.css,e.options.rootDir,e.logger),e.options.rollup.raw&&N(er(e.options.rollup.raw),t),e.options.sourcemap&&vr(e.options.rollup.sourcemap),...s,e.options.declaration&&e.options.rollup.isolatedDeclarations&&e.options.isolatedDeclarationTransformer&&ys(j(e.options.rootDir,e.options.sourceDir),e.options.isolatedDeclarationTransformer,e.options.declaration,!!e.options.rollup.cjsInterop,e.options.rollup.isolatedDeclarations,e.tsconfig),e.options.transformer(cl(e.options.transformerName,e)),N(Xs({directiveRegex:/^['|"](use (\w+))['|"]$/,...e.options.rollup.preserveDirectives,logger:e.logger}),t),e.options.rollup.shebang&&dr(e.options.entries.filter(p=>p.executable).map(p=>p.name).filter(Boolean),e.options.rollup.shebang),e.options.cjsInterop&&e.options.emitCJS&&Pi({...e.options.rollup.cjsInterop,logger:e.logger,type:e.pkg.type??"commonjs"}),e.options.rollup.dynamicVars&&ps(),e.options.rollup.dynamicVars&&Uo(e.options.rollup.dynamicVars),e.options.rollup.commonjs&&N(Wo({sourceMap:e.options.sourcemap,...e.options.rollup.commonjs}),t),e.options.rollup.preserveDynamicImports&&{name:"packem:preserve-dynamic-imports",renderDynamicImport(){return{left:"import(",right:")"}}},e.options.cjsInterop&&e.options.rollup.shim&&ss(e.pkg,e.options.rollup.shim),e.options.rollup.jsxRemoveAttributes&&N(Ns({attributes:e.options.rollup.jsxRemoveAttributes.attributes,logger:e.logger}),t),...l,e.options.rollup.metafile&&Rs(),e.options.rollup.copy&&aa(e.options.rollup.copy,e.logger),e.options.rollup.license&&e.options.rollup.license.path&&typeof e.options.rollup.license.dependenciesTemplate=="function"&&Bi({dtsMarker:e.options.rollup.license.dtsMarker??"TYPE_DEPENDENCIES",licenseFilePath:e.options.rollup.license.path,licenseTemplate:e.options.rollup.license.dependenciesTemplate,logger:e.logger,marker:e.options.rollup.license.dependenciesMarker??"DEPENDENCIES",mode:"dependencies",packageName:e.pkg.name}),Hs(),e.options.emitCJS&&e.mode==="build"&&e.options.declaration==="compatible"&&e.options.rollup.node10Compatibility&&Bs(e.logger,e.options.entries,e.options.outDir,e.options.rootDir,e.options.rollup.node10Compatibility.writeToPackageJson?"file":"console",e.options.rollup.node10Compatibility.typeScriptVersion??"*"),e.options.analyze&&e.options.rollup.visualizer!==!1&&Ho({brotliSize:!0,gzipSize:!0,projectRoot:e.options.rootDir,sourcemap:e.options.sourcemap,...e.options.rollup.visualizer,filename:"packem-bundle-analyze.html",title:"Packem Visualizer"})].filter(Boolean)}},"getRollupOptions"),dl=A(async e=>{const{dts:t}=require("rollup-plugin-dts");return t({compilerOptions:{...e.options.rollup.dts.compilerOptions,incremental:void 0,inlineSources:void 0,sourceMap:void 0,tsBuildInfoFile:void 0},respectExternal:e.options.rollup.dts.respectExternal,tsconfig:e.tsconfig?.path})},"createDtsPlugin"),ml=zn(dl),ao=A(async(e,t)=>{const i=Qe(e.pkg,e.options),o=e.tsconfig?.config.compilerOptions;delete o?.lib;let n;e.options.rollup.resolve&&(n=N(xi({...e.options.rollup.resolve}),t));const a="dts-plugin:"+process.pid+e.tsconfig.path,[s,l,p]=to(e.options.rollup.plugins,"dts");return{...oo(e,"dts"),onwarn(r,c){io(r,e)||r.code!=="EMPTY_BUNDLE"&&c(r)},output:[e.options.emitCJS&&{chunkFileNames:A(r=>oe(r,"d.cts"),"chunkFileNames"),compact:e.options.minify,dir:E(e.options.rootDir,e.options.outDir),entryFileNames:"[name].d.cts",format:"cjs",sourcemap:e.options.sourcemap,...e.options.rollup.output},e.options.emitESM&&{chunkFileNames:A(r=>oe(r,"d.mts"),"chunkFileNames"),compact:e.options.minify,dir:E(e.options.rootDir,e.options.outDir),entryFileNames:"[name].d.mts",format:"esm",sourcemap:e.options.sourcemap,...e.options.rollup.output},e.options.declaration==="compatible"&&{chunkFileNames:A(r=>oe(r,"d.ts"),"chunkFileNames"),compact:e.options.minify,dir:E(e.options.rootDir,e.options.outDir),entryFileNames:"[name].d.ts",format:"cjs",sourcemap:e.options.sourcemap,...e.options.rollup.output}].filter(Boolean),plugins:[N(Vi(),t),N(Qi(),t),e.options.rollup.json&&Fi({...e.options.rollup.json}),{load(r){return/\.(?:js|cjs|mjs|jsx|ts|tsx|ctsx|mtsx|mts|json)$/.test(r)?null:""},name:"packem:ignore-files"},e.tsconfig&&N(Xi(e.options.rootDir,e.logger,e.tsconfig),t),e.tsconfig&&N(Gi(e.options.rootDir,e.tsconfig,e.logger),t),N(Ui(e.pkg,e.tsconfig,e.options,e.logger,e.options.rollup.resolveExternals??{}),t),e.options.rollup.replace&&yi({sourcemap:e.options.sourcemap,...e.options.rollup.replace}),e.options.rollup.alias&&hi({customResolver:n,...e.options.rollup.alias,entries:i}),...s,n,...l,await ml(a)(e),e.options.cjsInterop&&e.options.emitCJS&&Pi({...e.options.rollup.cjsInterop,logger:e.logger,type:e.pkg.type??"commonjs"}),e.options.rollup.patchTypes&&N(Or(e.options.rollup.patchTypes,e.logger),t),mr(),...p,e.options.rollup.license&&e.options.rollup.license.path&&typeof e.options.rollup.license.dtsTemplate=="function"&&Bi({licenseFilePath:e.options.rollup.license.path,licenseTemplate:e.options.rollup.license.dtsTemplate,logger:e.logger,marker:e.options.rollup.license.dtsMarker??"TYPE_DEPENDENCIES",mode:"types",packageName:e.pkg.name})].filter(Boolean)}},"getRollupDtsOptions");var ul=Object.defineProperty,fl=g((e,t)=>ul(e,"name",{value:t,configurable:!0}),"m$7");const ti="rollup-build.json",gl=fl(async(e,t,i)=>{const o=await no(e,t);if(await e.hooks.callHook("rollup:options",e,o),Object.keys(o.input).length===0)return;let n=!0;(e.options.rollup.isolatedDeclarations||e.options.isolatedDeclarationTransformer||e.options.rollup.css)&&(n=!1),n&&(o.cache=t.get(ti,i));const a=await vi(o);n&&t.set(ti,a.cache,i),await e.hooks.callHook("rollup:build",e,a);const s=new Map;for(const l of o.output){const{output:p}=await a.write(l),r=new Set,c=p.filter(d=>d.type==="chunk");for(const d of c){r.add(d.fileName);for(const u of d.imports)e.usedImports.add(u);d.isEntry&&e.buildEntries.push({bytes:Buffer.byteLength(d.code,"utf8"),chunks:d.imports.filter(u=>c.find(h=>h.fileName===u)),exports:d.exports,modules:Object.entries(d.modules).map(([u,h])=>({bytes:h.renderedLength,id:u})),path:d.fileName,type:"entry"})}const m=p.filter(d=>d.type==="asset");for(const d of m)s.has(d.fileName)||s.set(d.fileName,{bytes:Buffer.byteLength(d.source,"utf8"),path:d.fileName,type:"asset"});for(const d of r)e.usedImports.delete(d)}e.buildEntries.push(...s.values())},"build");var vl=Object.defineProperty,Te=g((e,t)=>vl(e,"name",{value:t,configurable:!0}),"a$9");const ii="rollup-dts.json",hl=Te(async(e,t,i)=>{if(e.options.declaration&&e.options.rollup.isolatedDeclarations&&e.options.isolatedDeclarationTransformer){e.logger.info({message:"Using isolated declaration transformer to generate declaration files...",prefix:"dts"});return}const o=await ao(e,t);if(await e.hooks.callHook("rollup:dts:options",e,o),Object.keys(o.input).length===0)return;o.cache=t.get(ii,i);const n=await vi(o);t.set(ii,n.cache,i),await e.hooks.callHook("rollup:dts:build",e,n),e.logger.info({message:"Building declaration files...",prefix:"dts"}),e.options.emitCJS&&await n.write({chunkFileNames:Te(a=>oe(a,"d.cts"),"chunkFileNames"),dir:E(e.options.rootDir,e.options.outDir),entryFileNames:"[name].d.cts"}),e.options.emitESM&&await n.write({chunkFileNames:Te(a=>oe(a,"d.mts"),"chunkFileNames"),dir:E(e.options.rootDir,e.options.outDir),entryFileNames:"[name].d.mts"}),e.options.declaration==="compatible"&&await n.write({chunkFileNames:Te(a=>oe(a,"d.mjs"),"chunkFileNames"),dir:E(e.options.rootDir,e.options.outDir),entryFileNames:"[name].d.ts"}),await e.hooks.callHook("rollup:dts:done",e)},"buildTypes");var xl=Object.defineProperty,yl=g((e,t)=>xl(e,"name",{value:t,configurable:!0}),"y$4");const bl=yl((e,t,i)=>e.reduce((o,n)=>{const a=n[t],s=n[i];return o[a]||(o[a]={}),o[a][s]||(o[a][s]=[]),o[a][s].push(n),o},{}),"groupByKeys");var wl=Object.defineProperty,qe=g((e,t)=>wl(e,"name",{value:t,configurable:!0}),"j$1");const kl=qe((e,t)=>{const i=qe(s=>_(t.options.rootDir,E(t.options.outDir,s)),"rPath");let o=!1;const n=[],a=t.buildEntries.filter(s=>s.type==="entry");if(a.length>0){e.raw(`Entries:
95
- `);for(const s of a){let l=s.bytes??0;for(const r of s.chunks??[])l+=t.buildEntries.find(c=>c.path===r)?.bytes??0;let p=` ${V(i(s.path))} (${["total size: "+P(Z(l)),s.bytes&&"chunk size: "+P(Z(s.bytes))].filter(Boolean).join(", ")})`;if(p+=s.exports?.length?`
93
+ ↳ to depend on a module via import/require, install it to "dependencies".`);return e.code==="MODULE_LEVEL_DIRECTIVE"?!0:e.code==="MIXED_EXPORTS"&&t.options.cjsInterop===!0},"sharedOnWarn"),to=A((e,t)=>({input:Object.fromEntries(e.options.entries.map(i=>[i.name,E(e.options.rootDir,i.input)])),logLevel:e.options.debug?"debug":"info",onLog:A((i,o)=>{let n=o.message;switch(o.stack&&(n=`${n}
94
+ ${o.stack}`),i){case"info":{e.logger.info({message:n,prefix:t+(o.plugin?":plugin:"+o.plugin:"")});return}case"warn":{e.logger.warn({message:n,prefix:t+(o.plugin?":plugin:"+o.plugin:"")});return}case"debug":e.logger.debug({message:n,prefix:t+(o.plugin?":plugin:"+o.plugin:"")})}},"onLog"),onwarn(i,o){eo(i,e)||i.code||o(i)},treeshake:{moduleSideEffects:!0,preset:"smallest"},watch:e.mode==="watch"?e.options.rollup.watch:!1}),"baseRollupOptions"),io=A(async(e,t)=>{const i=Qe(e.pkg,e.options);let o;e.options.rollup.resolve&&(o=hi({...e.options.rollup.resolve}));const n=e.options.rollup.output?.preserveModules?{preserveModules:!0,preserveModulesRoot:e.options.rollup.output.preserveModulesRoot??"src"}:{manualChunks:Yr(e.dependencyGraphMap,e.buildEntries),preserveModules:!1},[a,s,l]=Zi(e.options.rollup.plugins,"build");return{...to(e,"build"),output:[e.options.emitCJS&&{assetFileNames:"[name]-[hash][extname]",chunkFileNames:A(p=>oe(p,"cjs"),"chunkFileNames"),compact:e.options.minify,dir:E(e.options.rootDir,e.options.outDir),entryFileNames:A(p=>Zt(p,"cjs"),"entryFileNames"),exports:"auto",externalLiveBindings:!1,format:"cjs",freeze:!1,generatedCode:{arrowFunctions:!0,constBindings:!0,objectShorthand:!0,preset:e.tsconfig?.config.compilerOptions?.target==="es5"?"es5":"es2015",reservedNamesAsProps:!0,symbols:!0},hoistTransitiveImports:!1,interop:"compat",sourcemap:e.options.sourcemap,validate:!0,...e.options.rollup.output,...n},e.options.emitESM&&{assetFileNames:"[name]-[hash][extname]",chunkFileNames:A(p=>oe(p,"mjs"),"chunkFileNames"),compact:e.options.minify,dir:E(e.options.rootDir,e.options.outDir),entryFileNames:A(p=>Zt(p,"mjs"),"entryFileNames"),exports:"auto",externalLiveBindings:!1,format:"esm",freeze:!1,generatedCode:{arrowFunctions:!0,constBindings:!0,objectShorthand:!0,preset:e.tsconfig?.config.compilerOptions?.target==="es5"?"es5":"es2015",reservedNamesAsProps:!0,symbols:!0},hoistTransitiveImports:!1,sourcemap:e.options.sourcemap,validate:!0,...e.options.rollup.output,...n}].filter(Boolean),plugins:[I(Wi(),t),I(Yi(),t),e.tsconfig&&I(Hi(e.options.rootDir,e.logger,e.tsconfig),t),e.tsconfig&&e.options.rollup.tsconfigPaths&&I(Ki(e.options.rootDir,e.tsconfig,e.logger,e.options.rollup.tsconfigPaths),t),I(qi(e.pkg,e.tsconfig,e.options,e.logger,e.options.rollup.resolveExternals??{}),t),e.options.rollup.replace&&xi({sourcemap:e.options.sourcemap,...e.options.rollup.replace}),e.options.rollup.alias&&vi({customResolver:o,...e.options.rollup.alias,entries:i}),...a,o,e.options.rollup.polyfillNode&&Uo({sourceMap:e.options.sourcemap,...e.options.rollup.polyfillNode}),e.options.rollup.json&&zi({...e.options.rollup.json}),Gn(),e.options.rollup.wasm&&Wo(e.options.rollup.wasm),e.options.rollup.url&&qr(e.options.rollup.url),e.options.rollup.css&&e.options.rollup.css.loaders&&e.options.rollup.css.loaders.length>0&&await Ua({dts:!!e.options.declaration||e.options.isolatedDeclarationTransformer!==void 0,sourceMap:e.options.sourcemap,...e.options.rollup.css},e.logger,e.options.browserTargets,e.options.rootDir,e.options.sourceDir,e.environment,e.options.sourcemap,e.options.debug,e.options.minify??!1,i),e.options.rollup.css&&e.options.rollup.css.loaders&&e.options.rollup.css.loaders.length>0&&e.options.declaration&&Qa(e.options.rollup.css,e.options.rootDir,e.logger),e.options.rollup.raw&&I(Qs(e.options.rollup.raw),t),e.options.sourcemap&&cr(e.options.rollup.sourcemap),...s,e.options.declaration&&e.options.rollup.isolatedDeclarations&&e.options.isolatedDeclarationTransformer&&hs(j(e.options.rootDir,e.options.sourceDir),e.options.isolatedDeclarationTransformer,e.options.declaration,!!e.options.rollup.cjsInterop,e.options.rollup.isolatedDeclarations,e.tsconfig),e.options.transformer(ol(e.options.transformerName,e)),I(Hs({directiveRegex:/^['|"](use (\w+))['|"]$/,...e.options.rollup.preserveDirectives,logger:e.logger}),t),e.options.rollup.shebang&&ar(e.options.entries.filter(p=>p.executable).map(p=>p.name).filter(Boolean),e.options.rollup.shebang),e.options.cjsInterop&&e.options.emitCJS&&Pi({...e.options.rollup.cjsInterop,logger:e.logger,type:e.pkg.type??"commonjs"}),e.options.rollup.dynamicVars&&rs(),e.options.rollup.dynamicVars&&qo(e.options.rollup.dynamicVars),e.options.rollup.commonjs&&I(Bo({sourceMap:e.options.sourcemap,...e.options.rollup.commonjs}),t),e.options.rollup.preserveDynamicImports&&{name:"packem:preserve-dynamic-imports",renderDynamicImport(){return{left:"import(",right:")"}}},e.options.cjsInterop&&e.options.rollup.shim&&ns(e.pkg,e.options.rollup.shim),e.options.rollup.jsxRemoveAttributes&&I(Ds({attributes:e.options.rollup.jsxRemoveAttributes.attributes,logger:e.logger}),t),...l,e.options.rollup.metafile&&zs(),e.options.rollup.copy&&oa(e.options.rollup.copy,e.logger),e.options.rollup.license&&e.options.rollup.license.path&&typeof e.options.rollup.license.dependenciesTemplate=="function"&&Ji({dtsMarker:e.options.rollup.license.dtsMarker??"TYPE_DEPENDENCIES",licenseFilePath:e.options.rollup.license.path,licenseTemplate:e.options.rollup.license.dependenciesTemplate,logger:e.logger,marker:e.options.rollup.license.dependenciesMarker??"DEPENDENCIES",mode:"dependencies",packageName:e.pkg.name}),Vs(),e.options.emitCJS&&e.mode==="build"&&e.options.declaration==="compatible"&&e.options.rollup.node10Compatibility&&Ls(e.logger,e.options.entries,e.options.outDir,e.options.rootDir,e.options.rollup.node10Compatibility.writeToPackageJson?"file":"console",e.options.rollup.node10Compatibility.typeScriptVersion??"*"),e.options.analyze&&e.options.rollup.visualizer!==!1&&Vo({brotliSize:!0,gzipSize:!0,projectRoot:e.options.rootDir,sourcemap:e.options.sourcemap,...e.options.rollup.visualizer,filename:"packem-bundle-analyze.html",title:"Packem Visualizer"})].filter(Boolean)}},"getRollupOptions"),nl=A(async e=>{const{dts:t}=require("rollup-plugin-dts");return t({compilerOptions:{...e.options.rollup.dts.compilerOptions,incremental:void 0,inlineSources:void 0,sourceMap:void 0,tsBuildInfoFile:void 0},respectExternal:e.options.rollup.dts.respectExternal,tsconfig:e.tsconfig?.path})},"createDtsPlugin"),al=In(nl),oo=A(async(e,t)=>{const i=Qe(e.pkg,e.options),o=e.tsconfig?.config.compilerOptions;delete o?.lib;let n;e.options.rollup.resolve&&(n=hi({...e.options.rollup.resolve}));const a="dts-plugin:"+process.pid+e.tsconfig.path,[s,l,p]=Zi(e.options.rollup.plugins,"dts");return{...to(e,"dts"),onwarn(r,c){eo(r,e)||r.code!=="EMPTY_BUNDLE"&&c(r)},output:[e.options.emitCJS&&{chunkFileNames:A(r=>oe(r,"d.cts"),"chunkFileNames"),compact:e.options.minify,dir:E(e.options.rootDir,e.options.outDir),entryFileNames:"[name].d.cts",format:"cjs",sourcemap:e.options.sourcemap,...e.options.rollup.output},e.options.emitESM&&{chunkFileNames:A(r=>oe(r,"d.mts"),"chunkFileNames"),compact:e.options.minify,dir:E(e.options.rootDir,e.options.outDir),entryFileNames:"[name].d.mts",format:"esm",sourcemap:e.options.sourcemap,...e.options.rollup.output},e.options.declaration==="compatible"&&{chunkFileNames:A(r=>oe(r,"d.ts"),"chunkFileNames"),compact:e.options.minify,dir:E(e.options.rootDir,e.options.outDir),entryFileNames:"[name].d.ts",format:"cjs",sourcemap:e.options.sourcemap,...e.options.rollup.output}].filter(Boolean),plugins:[I(Wi(),t),I(Yi(),t),e.options.rollup.json&&zi({...e.options.rollup.json}),{load(r){return/\.(?:js|cjs|mjs|jsx|ts|tsx|ctsx|mtsx|mts|json)$/.test(r)?null:""},name:"packem:ignore-files"},e.tsconfig&&I(Hi(e.options.rootDir,e.logger,e.tsconfig),t),e.tsconfig&&e.options.rollup.tsconfigPaths&&I(Ki(e.options.rootDir,e.tsconfig,e.logger,e.options.rollup.tsconfigPaths),t),I(qi(e.pkg,e.tsconfig,e.options,e.logger,e.options.rollup.resolveExternals??{}),t),e.options.rollup.replace&&xi({sourcemap:e.options.sourcemap,...e.options.rollup.replace}),e.options.rollup.alias&&vi({customResolver:n,...e.options.rollup.alias,entries:i}),...s,n,...l,await al(a)(e),e.options.cjsInterop&&e.options.emitCJS&&Pi({...e.options.rollup.cjsInterop,logger:e.logger,type:e.pkg.type??"commonjs"}),e.options.rollup.patchTypes&&I(wr(e.options.rollup.patchTypes,e.logger),t),sr(),...p,e.options.rollup.license&&e.options.rollup.license.path&&typeof e.options.rollup.license.dtsTemplate=="function"&&Ji({licenseFilePath:e.options.rollup.license.path,licenseTemplate:e.options.rollup.license.dtsTemplate,logger:e.logger,marker:e.options.rollup.license.dtsMarker??"TYPE_DEPENDENCIES",mode:"types",packageName:e.pkg.name})].filter(Boolean)}},"getRollupDtsOptions");var sl=Object.defineProperty,rl=g((e,t)=>sl(e,"name",{value:t,configurable:!0}),"m$7");const ei="rollup-build.json",ll=rl(async(e,t,i)=>{const o=await io(e,t);if(await e.hooks.callHook("rollup:options",e,o),Object.keys(o.input).length===0)return;let n=!0;(e.options.rollup.isolatedDeclarations||e.options.isolatedDeclarationTransformer||e.options.rollup.css)&&(n=!1),n&&(o.cache=t.get(ei,i));const a=await gi(o);n&&t.set(ei,a.cache,i),await e.hooks.callHook("rollup:build",e,a);const s=new Map;for(const l of o.output){const{output:p}=await a.write(l),r=new Set,c=p.filter(d=>d.type==="chunk");for(const d of c){r.add(d.fileName);for(const u of d.imports)e.usedImports.add(u);d.isEntry&&e.buildEntries.push({bytes:Buffer.byteLength(d.code,"utf8"),chunks:d.imports.filter(u=>c.find(h=>h.fileName===u)),exports:d.exports,modules:Object.entries(d.modules).map(([u,h])=>({bytes:h.renderedLength,id:u})),path:d.fileName,type:"entry"})}const m=p.filter(d=>d.type==="asset");for(const d of m)s.has(d.fileName)||s.set(d.fileName,{bytes:Buffer.byteLength(d.source,"utf8"),path:d.fileName,type:"asset"});for(const d of r)e.usedImports.delete(d)}e.buildEntries.push(...s.values())},"build");var pl=Object.defineProperty,Me=g((e,t)=>pl(e,"name",{value:t,configurable:!0}),"a$a");const ti="rollup-dts.json",cl=Me(async(e,t,i)=>{if(e.options.declaration&&e.options.rollup.isolatedDeclarations&&e.options.isolatedDeclarationTransformer){e.logger.info({message:"Using isolated declaration transformer to generate declaration files...",prefix:"dts"});return}const o=await oo(e,t);if(await e.hooks.callHook("rollup:dts:options",e,o),Object.keys(o.input).length===0)return;o.cache=t.get(ti,i);const n=await gi(o);t.set(ti,n.cache,i),await e.hooks.callHook("rollup:dts:build",e,n),e.logger.info({message:"Building declaration files...",prefix:"dts"}),e.options.emitCJS&&await n.write({chunkFileNames:Me(a=>oe(a,"d.cts"),"chunkFileNames"),dir:E(e.options.rootDir,e.options.outDir),entryFileNames:"[name].d.cts"}),e.options.emitESM&&await n.write({chunkFileNames:Me(a=>oe(a,"d.mts"),"chunkFileNames"),dir:E(e.options.rootDir,e.options.outDir),entryFileNames:"[name].d.mts"}),e.options.declaration==="compatible"&&await n.write({chunkFileNames:Me(a=>oe(a,"d.mjs"),"chunkFileNames"),dir:E(e.options.rootDir,e.options.outDir),entryFileNames:"[name].d.ts"}),await e.hooks.callHook("rollup:dts:done",e)},"buildTypes");var dl=Object.defineProperty,ml=g((e,t)=>dl(e,"name",{value:t,configurable:!0}),"y$4");const ul=ml((e,t,i)=>e.reduce((o,n)=>{const a=n[t],s=n[i];return o[a]||(o[a]={}),o[a][s]||(o[a][s]=[]),o[a][s].push(n),o},{}),"groupByKeys");var fl=Object.defineProperty,qe=g((e,t)=>fl(e,"name",{value:t,configurable:!0}),"j$1");const gl=qe((e,t)=>{const i=qe(s=>N(t.options.rootDir,E(t.options.outDir,s)),"rPath");let o=!1;const n=[],a=t.buildEntries.filter(s=>s.type==="entry");if(a.length>0){e.raw(`Entries:
95
+ `);for(const s of a){let l=s.bytes??0;for(const r of s.chunks??[])l+=t.buildEntries.find(c=>c.path===r)?.bytes??0;let p=` ${V(i(s.path))} (${["total size: "+D(Z(l)),s.bytes&&"chunk size: "+D(Z(s.bytes))].filter(Boolean).join(", ")})`;if(p+=s.exports?.length?`
96
96
  exports: `+ee(s.exports.join(", ")):"",s.chunks?.length&&(p+=`
97
97
  ${s.chunks.map(r=>{const c=t.buildEntries.find(m=>m.path===r)??{};return ee(" └─ "+i(r)+V(c.bytes?" ("+Z(c?.bytes)+")":""))}).join(`
98
98
  `)}`),s.modules&&s.modules.length>0){const r=s.modules.filter(c=>c.id.includes("node_modules")).sort((c,m)=>(m.bytes||0)-(c.bytes||0)).map(c=>ee(" 📦 "+i(c.id)+V(c.bytes?" ("+Z(c.bytes)+")":""))).join(`
@@ -100,37 +100,37 @@ ${s.chunks.map(r=>{const c=t.buildEntries.find(m=>m.path===r)??{};return ee("
100
100
  inlined modules:
101
101
  `+r:""}if(t.options.declaration){let r=s.path.replace(/\.js$/,".d.ts"),c="commonjs";s.path.endsWith(".cjs")?r=s.path.replace(/\.cjs$/,".d.cts"):s.path.endsWith(".mjs")&&(c="module",r=s.path.replace(/\.mjs$/,".d.mts"));const m=t.buildEntries.find(d=>d.path.endsWith(r));if(m){n.push(m.path);let d;r.includes(".d.ts")||(r=r.replace(".d.c",".d."),d=t.buildEntries.find(u=>u.path.endsWith(r))),d&&(n.push(d.path),p+=c==="commonjs"?`
102
102
  types:
103
- `+[m,d].map(u=>ee(" └─ ")+V(i(u.path))+" (total size: "+P(Z(u.bytes??0))+")").join(`
103
+ `+[m,d].map(u=>ee(" └─ ")+V(i(u.path))+" (total size: "+D(Z(u.bytes??0))+")").join(`
104
104
  `):`
105
- types: `+V(i(m.path))+" (total size: "+P(Z(m.bytes??0))+")")}}o=!0,p+=`
105
+ types: `+V(i(m.path))+" (total size: "+D(Z(m.bytes??0))+")")}}o=!0,p+=`
106
106
 
107
107
  `,e.raw(s.chunk?ee(p):p)}}if(t.buildEntries.filter(s=>s.type==="asset").length>0){let s="Assets:";for(const l of t.buildEntries.filter(p=>p.type==="asset"))n.includes(l.path)||(s+=ee(`
108
- └─ `)+V(i(l.path))+" (total size: "+P(Z(l.bytes??0))+")");s+=`
108
+ └─ `)+V(i(l.path))+" (total size: "+D(Z(l.bytes??0))+")");s+=`
109
109
 
110
- `,e.raw(s)}return o&&e.raw("Σ Total dist size (byte size):",P(Z(t.buildEntries.reduce((s,l)=>s+(l.bytes??0),0),{decimals:2})),`
111
- `),o},"showSizeInformation"),jl=qe((e,t)=>{const i=bl(e.options.entries,"environment","runtime"),o=new Set,n=new Set;for(const[a,s]of Object.entries(i))for(const[l,p]of Object.entries(s)){const r={...e};!e.options.dtsOnly&&(a!=="undefined"||l!=="undefined")&&e.logger.info("Preparing build for "+(a==="undefined"?"":P(a)+" environment"+(l==="undefined"?"":" with "))+(l==="undefined"?"":P(l)+" runtime"));const c={};r.options.rollup.replace?(r.options.rollup.replace.values===void 0&&(r.options.rollup.replace.values={}),a!=="undefined"&&(c[["process","env","NODE_ENV"].join(".")]=JSON.stringify(a)),c[["process","env","EdgeRuntime"].join(".")]=JSON.stringify(l==="edge-light"),Object.freeze(c)):e.logger.warn("'replace' plugin is disabled. You should enable it to replace 'process.env.*' environments.");let m="";a!=="undefined"&&(m+=a+"/"),l!=="undefined"&&(m+=l+"/");let d=!1;r.options.minify!==void 0&&(d=r.options.minify),a==="development"?d=!1:a==="production"&&(d=!0);const u=[],h=[],v=[],y=[];for(const f of p)f.cjs&&f.esm?u.push(f):f.cjs?v.push(f):f.esm?h.push(f):f.declaration&&y.push(f);if(u.length>0){const f={...r,options:{...r.options,emitCJS:!0,emitESM:!0,entries:u,minify:d,rollup:{...r.options.rollup,replace:r.options.rollup.replace?{...r.options.rollup.replace,values:{...r.options.rollup.replace.values,...c}}:!1}}};if(e.options.dtsOnly||o.add({context:f,fileCache:t,subDirectory:m}),e.options.declaration){const x=f.options.entries.filter(k=>k.declaration);x.length>0&&n.add({context:{...f,options:{...f.options,entries:x}},fileCache:t,subDirectory:m})}}if(h.length>0){const f={...r,options:{...r.options,emitCJS:!1,emitESM:!0,entries:h,minify:d,rollup:{...r.options.rollup,replace:r.options.rollup.replace?{...r.options.rollup.replace,values:{...r.options.rollup.replace.values,...c}}:!1}}};if(e.options.dtsOnly||o.add({context:f,fileCache:t,subDirectory:m}),e.options.declaration){const x=f.options.entries.filter(k=>k.declaration);x.length>0&&n.add({context:{...f,options:{...f.options,entries:x}},fileCache:t,subDirectory:m})}}if(v.length>0){const f={...r,options:{...r.options,emitCJS:!0,emitESM:!1,entries:v,minify:d,rollup:{...r.options.rollup,replace:r.options.rollup.replace?{...r.options.rollup.replace,values:{...r.options.rollup.replace.values,...c}}:!1}}};if(e.options.dtsOnly||o.add({context:f,fileCache:t,subDirectory:m}),e.options.declaration){const x=f.options.entries.filter(k=>k.declaration);x.length>0&&n.add({context:{...f,options:{...f.options,entries:x}},fileCache:t,subDirectory:m})}}r.options.declaration&&y.length>0&&n.add({context:{...r,options:{...r.options,emitCJS:!1,emitESM:!1,entries:y,minify:d,rollup:{...r.options.rollup,replace:r.options.rollup.replace?{...r.options.rollup.replace,values:{...r.options.rollup.replace.values,...c}}:!1}}},fileCache:t,subDirectory:m})}return{builders:o,typeBuilders:n}},"prepareRollupConfig"),$l=qe(async(e,t)=>{await e.hooks.callHook("build:before",e);const{builders:i,typeBuilders:o}=jl(e,t);await Promise.all([...i].map(async({context:n,fileCache:a,subDirectory:s})=>await gl(n,a,s))),await Promise.all([...o].map(async({context:n,fileCache:a,subDirectory:s})=>await hl(n,a,s))),e.logger.success(Po(e.options.name?"Build succeeded for "+e.options.name:"Build succeeded"));for await(const n of $o(j(e.options.rootDir,e.options.outDir))){let a=e.buildEntries.find(s=>j(e.options.rootDir,e.options.outDir,s.path)===n.path);if(a||(a={chunk:!0,path:n.path},e.buildEntries.push(a)),!a.bytes){const s=await kt(E(e.options.rootDir,e.options.outDir,n.path));a.bytes=s.size}}return await e.hooks.callHook("build:done",e),kl(e.logger,e)},"build");var El=Object.defineProperty,Sl=g((e,t)=>El(e,"name",{value:t,configurable:!0}),"r$5");const D=Sl((e,t)=>{e.warnings.has(t)||e.warnings.add(t)},"warn");var Ol=Object.defineProperty,so=g((e,t)=>Ol(e,"name",{value:t,configurable:!0}),"t$3");const We=so(e=>{if(e.endsWith(".mjs")||e.endsWith(".d.mts"))return"esm";if(e.endsWith(".cjs")||e.endsWith(".d.cts"))return"cjs"},"inferExportTypeFromFileName"),bt=so((e,t,i,o)=>{if(e==="module-sync")return"esm";if(o){const s=We(o);if(s)return s}if(e==="module"||e==="import")return"esm";if(e==="require")return"cjs";if(t.length===0)return i;const[n,...a]=t;return bt(n,a,i,o)},"inferExportType");var Dl=Object.defineProperty,Pl=g((e,t)=>Dl(e,"name",{value:t,configurable:!0}),"y$3");const Cl=new Set(["electron","import","require","node","node-addons","default","types","deno","browser","module-sync","bun","workerd",...$t,...Je]),Dt=Pl((e,t,i,o=[])=>{if(!e)return[];if(typeof e=="string"){const n=We(e);if(n&&n!==t)throw new Error(`Exported file "${e}" has an extension that does not match the package.json type "${t==="esm"?"module":"commonjs"}".`);return[{file:e,key:"exports",type:n??t}]}if(typeof e=="object"){const n=Object.entries(e).filter(([s])=>!s.endsWith(".json"));let a=[];for(const[s,l]of n)if(typeof l=="string"){let p={};Number.isInteger(+s)?p={exportKey:"*"}:s.startsWith("./")?p={exportKey:s.replace("./","")}:p={exportKey:s==="."?".":"*",subKey:s},a.push({...p,file:l,key:"exports",type:bt(s,o,t,l)})}else if(typeof l=="object"&&l!==null)for(const[p,r]of Object.entries(l)){if(i===!1&&p==="types")continue;const c=Number.isInteger(+s)?p:s;typeof r=="string"?a.push({exportKey:c.replace("./",""),file:r,key:"exports",...Cl.has(p)?{subKey:p}:{},type:bt(p,o,t,r)}):a=[...a,...Dt({[c]:r},t,i,[...o,p])]}return a}return[]},"extractExportFilenames");var Nl=Object.defineProperty,et=g((e,t)=>Nl(e,"name",{value:t,configurable:!0}),"y$2");const _l=et((e,t)=>e.key==="exports"&&e.subKey===G?G:e.key==="exports"&&e.subKey===De?De:t,"getEnvironment"),Me=et((e,t,i,o,n,a,s)=>{const l=_l(n,a.environment);let p="node";for(const m of $t)if(n.file.includes("."+m+".")||n.subKey===m){p=m;break}let r=e.find(m=>m.input===t&&m.environment===l&&m.runtime===p);r===void 0?r=e[e.push({environment:l,exportKey:new Set([n.exportKey].filter(Boolean)),input:t,runtime:p})-1]:r.exportKey&&n.exportKey&&r.exportKey.add(n.exportKey),s&&(r.isGlob=!0),i&&(r.outDir=o),n.isExecutable?(r.executable=!0,r.declaration=!1,n.type==="cjs"?r.cjs=!0:n.type==="esm"&&(r.esm=!0)):(/\.d\.[mc]?ts$/.test(n.file)&&a.options.declaration!==!1&&(r.declaration=a.options.declaration),n.type==="cjs"?r.cjs=!0:n.type==="esm"&&(r.esm=!0));const c=n.file.replace(He(n.file),"").replace(new RegExp(`^./${a.options.outDir.replace(/^\.\//,"")}/`),"");Je.has(n.subKey)&&!t.includes(c)&&(r.fileAlias=c)},"createOrUpdateEntry");let oi=!1;const ni=et(e=>{if(e.pkg?.dependencies?.typescript===void 0&&e.pkg?.devDependencies?.typescript===void 0)throw new Error("You tried to use a `.ts`, `.cts` or `.mts` file but `typescript` was not found in your package.json.")},"validateIfTypescriptIsInstalled"),Tl=et((e,t,i)=>{const o=[];t.sort((l,p)=>l.split("/").length-p.split("/").length);const n=e.type==="module"?"esm":"cjs";n==="esm"&&(i.options.emitESM=!0),n==="cjs"&&(i.options.emitCJS=!0);const a=Dt(e.exports,n,i.options.declaration);if(e.bin){const l=(typeof e.bin=="string"?[e.bin]:Object.values(e.bin)).filter(Boolean);for(const p of l){const r=We(p);if(r&&r!==n)throw new Error(`Exported file "${p}" has an extension that does not match the package.json type "${e.type??"commonjs"}".`);a.push({file:p,isExecutable:!0,key:"bin",type:r??n})}}e.main&&a.push({file:e.main,key:"main",type:We(e.main)??n}),e.module&&a.push({file:e.module,key:"module",type:"esm"}),(e.types||e.typings)&&(ni(i),i.options.declaration===void 0&&(i.options.declaration="compatible"),a.push({file:e.types??e.typings,key:"types"}));const s=[];for(const l of a){const p=He(l.file);if(p!==""&&!Ge.includes(p))continue;i.options.declaration===void 0&&(l.key==="types"||l.subKey==="types")&&(i.options.declaration=l.file.includes(".d.ts")?"compatible":!0),i.options.emitCJS===void 0&&l.type==="cjs"&&(i.options.emitCJS=!0),i.options.emitESM===void 0&&l.type==="esm"&&(i.options.emitESM=!0);const r=l.file.replace(/(?:\*[^/\\]|\.d\.[mc]?ts|\.\w+)$/,""),c=r.endsWith("/");if(c&&["./","/"].includes(r))continue;const m=r.replace(new RegExp("(./)?"+i.options.outDir),i.options.sourceDir).replace("./",""),d="(?<=/|$)",u=c?"":"(\\.[cm]?[tj]sx?)$";if(l.file.includes("/*")&&l.key==="exports"){oi||(i.logger.debug("Private subfolders are not supported, if you need this feature please open an issue on GitHub."),oi=!0);const f=[],x=new RegExp(d+m.replace("*","(.*)")+u),k=new RegExp(d+m.replace(/(.*)\.[^.]*$/,"$1").replace("*","(.*)")+u);for(const w of t)(x.test(w)||Je.has(l.subKey)&&k.test(w))&&f.push(w);if(f.length===0){o.push(`Could not find entrypoint for \`${l.file}\``);continue}for(const w of f)Me(s,w,c,r,l,i,!0);continue}const h=new RegExp(d+m+u);let v=t.find(f=>h.test(f));if(Je.has(l.subKey)&&v===void 0){const f=new RegExp(d+m.replace(/(.*)\.[^.]*$/,"$1")+u);v=t.find(x=>f.test(x))}if(v===void 0){z(E(i.options.rootDir,l.file))||o.push(`Could not find entrypoint for \`${l.file}\``);continue}(v.endsWith(".ts")||v.endsWith(".cts")||v.endsWith(".mts"))&&z(v)&&ni(i);const y=Re(v.replace(ae,""));z(y+".cts")&&z(y+".mts")?(Me(s,y+".cts",c,r,{...l,type:"cjs"},i,!1),Me(s,y+".mts",c,r,{...l,type:"esm"},i,!1)):Me(s,v,c,r,l,i,!1)}return{entries:s,warnings:o}},"inferEntries");var Ml=Object.defineProperty,Il=g((e,t)=>Ml(e,"name",{value:t,configurable:!0}),"o$3");const Al=Il((e,t)=>{const{publishConfig:i}=e;return i&&(i.bin&&(typeof i.bin=="object"||typeof i.bin=="string")&&(e.bin=i.bin),i.type&&typeof i.type=="string"&&i.type!==""&&(e.type=i.type),i.main&&typeof i.main=="string"&&i.main!==""&&(e.main=i.main),i.module&&typeof i.module=="string"&&i.module!==""&&(e.module=i.module),t===void 0&&i.types&&typeof i.types=="string"&&i.types!==""?e.types=i.types:t===void 0&&i.typings&&typeof i.typings=="string"&&i.typings!==""&&(e.typings=i.typings),i.exports&&typeof i.exports=="object"&&(e.exports=i.exports)),e},"overwriteWithPublishConfig");var zl=Object.defineProperty,Fl=g((e,t)=>zl(e,"name",{value:t,configurable:!0}),"t$2");const Rl={hooks:{"build:prepare":Fl(function(e){if(e.options.entries.length>0)return;const t=j(e.options.rootDir,e.options.sourceDir);if(!z(t))throw new Error("No 'src' directory found. Please provide entries manually.");const i=Eo(t,{extensions:[],includeDirs:!1,includeSymlinks:!1});if(i.length===0)throw new Error("No source files found in 'src' directory. Please provide entries manually.");let o={...e.pkg};o.publishConfig&&(e.logger.info('Using publishConfig found in package.json, to override the default key-value pairs of "'+Object.keys(o.publishConfig).join(", ")+'".'),e.logger.debug(o.publishConfig),o=Al(o,e.options.declaration));const n=Tl(o,i,e);for(const a of n.warnings)D(e,a);if(e.options.entries.push(...n.entries),e.options.entries.length===0)throw new Error("No entries detected. Please provide entries manually.");e.logger.info("Automatically detected entries:",P(e.options.entries.map(a=>a.fileAlias?V(a.fileAlias)+" => "+V(a.input.replace(`${e.options.rootDir}/`,"").replace(/\/$/,"/*")):V(a.input.replace(`${e.options.rootDir}/`,"").replace(/\/$/,"/*"))).join(", ")),ee([e.options.emitESM&&"esm",e.options.emitCJS&&"cjs",e.options.declaration&&"dts"].filter(Boolean).map(a=>`[${a}]`).join(" ")))},"build:prepare")}};var Ll=Object.defineProperty,Jl=g((e,t)=>Ll(e,"name",{value:t,configurable:!0}),"t$1");const Bl=Jl(async(e,t)=>{if(e==="auto")e=Rl;else{if(e==="none")return{};typeof e=="string"&&(e=await t.import(e)||{})}return typeof e=="function"&&(e=e()),e},"resolvePreset");var ql=Object.defineProperty,Wl=g((e,t)=>ql(e,"name",{value:t,configurable:!0}),"j");const Ul=Wl(async e=>{const t=e.options.jiti.transformOptions?.babel?.plugins,i=[],o=JSON.stringify({...e.options.jiti,alias:{...Qe(e.pkg,e.options),...e.options.jiti.alias},transformOptions:{...e.options.jiti.transformOptions,babel:{...e.options.jiti.transformOptions?.babel,plugins:"__$BABEL_PLUGINS"}}},null,2).replace('"__$BABEL_PLUGINS"',Array.isArray(t)?"["+t.map((n,a)=>{if(Array.isArray(n)){const[s,...l]=n;return i.push(s),"["+["plugin"+a,...l.map(p=>JSON.stringify(p))].join(", ")+"]"}return i.push(n),"plugin"+a}).join(",")+"]":"[]");for(const n of e.options.entries){const a=E(e.options.rootDir,e.options.outDir,n.name),s=rn(e.jiti.esmResolve(n.input,{try:!0})??n.input),l=s.replace(ae,""),p=Ke(s),r=ur(p);let c=[];try{c=await ln(s,{extensions:Ge})}catch(d){D(e,`Cannot analyze ${s} for exports: ${d.toString()}`);return}const m=c.includes("default")||c.length===0;if(e.options.emitESM){const d=_(M(a),await At("jiti",{conditions:["node","import"],url:import.meta.url})),u=l+".d.mts";le(`${a}.mjs`,r+['import { createJiti } from "'+d+'";',...i.map((h,v)=>"import plugin"+v+' from "'+h+'";'),"","const jiti = createJiti(import.meta.url, "+o+");","",'/** @type {import("'+u+'")} */','const _module = await jiti.import("'+s+'");',m?`
110
+ `,e.raw(s)}return o&&e.raw("Σ Total dist size (byte size):",D(Z(t.buildEntries.reduce((s,l)=>s+(l.bytes??0),0),{decimals:2})),`
111
+ `),o},"showSizeInformation"),vl=qe((e,t)=>{const i=ul(e.options.entries,"environment","runtime"),o=new Set,n=new Set;for(const[a,s]of Object.entries(i))for(const[l,p]of Object.entries(s)){const r={...e};!e.options.dtsOnly&&(a!=="undefined"||l!=="undefined")&&e.logger.info("Preparing build for "+(a==="undefined"?"":D(a)+" environment"+(l==="undefined"?"":" with "))+(l==="undefined"?"":D(l)+" runtime"));const c={};r.options.rollup.replace?(r.options.rollup.replace.values===void 0&&(r.options.rollup.replace.values={}),a!=="undefined"&&(c[["process","env","NODE_ENV"].join(".")]=JSON.stringify(a)),c[["process","env","EdgeRuntime"].join(".")]=JSON.stringify(l==="edge-light"),Object.freeze(c)):e.logger.warn("'replace' plugin is disabled. You should enable it to replace 'process.env.*' environments.");let m="";a!=="undefined"&&(m+=a+"/"),l!=="undefined"&&(m+=l+"/");let d=!1;r.options.minify!==void 0&&(d=r.options.minify),a==="development"?d=!1:a==="production"&&(d=!0);const u=[],h=[],v=[],x=[];for(const f of p)f.cjs&&f.esm?u.push(f):f.cjs?v.push(f):f.esm?h.push(f):f.declaration&&x.push(f);if(u.length>0){const f={...r,options:{...r.options,emitCJS:!0,emitESM:!0,entries:u,minify:d,rollup:{...r.options.rollup,replace:r.options.rollup.replace?{...r.options.rollup.replace,values:{...r.options.rollup.replace.values,...c}}:!1}}};if(e.options.dtsOnly||o.add({context:f,fileCache:t,subDirectory:m}),e.options.declaration){const y=f.options.entries.filter(k=>k.declaration);y.length>0&&n.add({context:{...f,options:{...f.options,entries:y}},fileCache:t,subDirectory:m})}}if(h.length>0){const f={...r,options:{...r.options,emitCJS:!1,emitESM:!0,entries:h,minify:d,rollup:{...r.options.rollup,replace:r.options.rollup.replace?{...r.options.rollup.replace,values:{...r.options.rollup.replace.values,...c}}:!1}}};if(e.options.dtsOnly||o.add({context:f,fileCache:t,subDirectory:m}),e.options.declaration){const y=f.options.entries.filter(k=>k.declaration);y.length>0&&n.add({context:{...f,options:{...f.options,entries:y}},fileCache:t,subDirectory:m})}}if(v.length>0){const f={...r,options:{...r.options,emitCJS:!0,emitESM:!1,entries:v,minify:d,rollup:{...r.options.rollup,replace:r.options.rollup.replace?{...r.options.rollup.replace,values:{...r.options.rollup.replace.values,...c}}:!1}}};if(e.options.dtsOnly||o.add({context:f,fileCache:t,subDirectory:m}),e.options.declaration){const y=f.options.entries.filter(k=>k.declaration);y.length>0&&n.add({context:{...f,options:{...f.options,entries:y}},fileCache:t,subDirectory:m})}}r.options.declaration&&x.length>0&&n.add({context:{...r,options:{...r.options,emitCJS:!1,emitESM:!1,entries:x,minify:d,rollup:{...r.options.rollup,replace:r.options.rollup.replace?{...r.options.rollup.replace,values:{...r.options.rollup.replace.values,...c}}:!1}}},fileCache:t,subDirectory:m})}return{builders:o,typeBuilders:n}},"prepareRollupConfig"),hl=qe(async(e,t)=>{await e.hooks.callHook("build:before",e);const{builders:i,typeBuilders:o}=vl(e,t);await Promise.all([...i].map(async({context:n,fileCache:a,subDirectory:s})=>await ll(n,a,s))),await Promise.all([...o].map(async({context:n,fileCache:a,subDirectory:s})=>await cl(n,a,s))),e.logger.success(Oo(e.options.name?"Build succeeded for "+e.options.name:"Build succeeded"));for await(const n of ko(j(e.options.rootDir,e.options.outDir))){let a=e.buildEntries.find(s=>j(e.options.rootDir,e.options.outDir,s.path)===n.path);if(a||(a={chunk:!0,path:n.path},e.buildEntries.push(a)),!a.bytes){const s=await wt(E(e.options.rootDir,e.options.outDir,n.path));a.bytes=s.size}}return await e.hooks.callHook("build:done",e),gl(e.logger,e)},"build");var xl=Object.defineProperty,yl=g((e,t)=>xl(e,"name",{value:t,configurable:!0}),"r$6");const P=yl((e,t)=>{e.warnings.has(t)||e.warnings.add(t)},"warn");var bl=Object.defineProperty,no=g((e,t)=>bl(e,"name",{value:t,configurable:!0}),"t$3");const We=no(e=>{if(e.endsWith(".mjs")||e.endsWith(".d.mts"))return"esm";if(e.endsWith(".cjs")||e.endsWith(".d.cts"))return"cjs"},"inferExportTypeFromFileName"),yt=no((e,t,i,o)=>{if(e==="module-sync")return"esm";if(o){const s=We(o);if(s)return s}if(e==="module"||e==="import")return"esm";if(e==="require")return"cjs";if(t.length===0)return i;const[n,...a]=t;return yt(n,a,i,o)},"inferExportType");var wl=Object.defineProperty,kl=g((e,t)=>wl(e,"name",{value:t,configurable:!0}),"y$3");const jl=new Set(["electron","import","require","node","node-addons","default","types","deno","browser","module-sync","bun","workerd",...jt,...Je]),Ot=kl((e,t,i,o=[])=>{if(!e)return[];if(typeof e=="string"){const n=We(e);if(n&&n!==t)throw new Error(`Exported file "${e}" has an extension that does not match the package.json type "${t==="esm"?"module":"commonjs"}".`);return[{file:e,key:"exports",type:n??t}]}if(typeof e=="object"){const n=Object.entries(e).filter(([s])=>!s.endsWith(".json"));let a=[];for(const[s,l]of n)if(typeof l=="string"){let p={};Number.isInteger(+s)?p={exportKey:"*"}:s.startsWith("./")?p={exportKey:s.replace("./","")}:p={exportKey:s==="."?".":"*",subKey:s},a.push({...p,file:l,key:"exports",type:yt(s,o,t,l)})}else if(typeof l=="object"&&l!==null)for(const[p,r]of Object.entries(l)){if(i===!1&&p==="types")continue;const c=Number.isInteger(+s)?p:s;typeof r=="string"?a.push({exportKey:c.replace("./",""),file:r,key:"exports",...jl.has(p)?{subKey:p}:{},type:yt(p,o,t,r)}):a=[...a,...Ot({[c]:r},t,i,[...o,p])]}return a}return[]},"extractExportFilenames");var $l=Object.defineProperty,et=g((e,t)=>$l(e,"name",{value:t,configurable:!0}),"y$2");const El=et((e,t)=>e.key==="exports"&&e.subKey===G?G:e.key==="exports"&&e.subKey===Pe?Pe:t,"getEnvironment"),Te=et((e,t,i,o,n,a,s)=>{const l=El(n,a.environment);let p="node";for(const m of jt)if(n.file.includes("."+m+".")||n.subKey===m){p=m;break}let r=e.find(m=>m.input===t&&m.environment===l&&m.runtime===p);r===void 0?r=e[e.push({environment:l,exportKey:new Set([n.exportKey].filter(Boolean)),input:t,runtime:p})-1]:r.exportKey&&n.exportKey&&r.exportKey.add(n.exportKey),s&&(r.isGlob=!0),i&&(r.outDir=o),n.isExecutable?(r.executable=!0,r.declaration=!1,n.type==="cjs"?r.cjs=!0:n.type==="esm"&&(r.esm=!0)):(/\.d\.[mc]?ts$/.test(n.file)&&a.options.declaration!==!1&&(r.declaration=a.options.declaration),n.type==="cjs"?r.cjs=!0:n.type==="esm"&&(r.esm=!0));const c=n.file.replace(Ge(n.file),"").replace(new RegExp(`^./${a.options.outDir.replace(/^\.\//,"")}/`),"");Je.has(n.subKey)&&!t.includes(c)&&(r.fileAlias=c)},"createOrUpdateEntry");let ii=!1;const oi=et(e=>{if(e.pkg?.dependencies?.typescript===void 0&&e.pkg?.devDependencies?.typescript===void 0)throw new Error("You tried to use a `.ts`, `.cts` or `.mts` file but `typescript` was not found in your package.json.")},"validateIfTypescriptIsInstalled"),Sl=et((e,t,i)=>{const o=[];t.sort((l,p)=>l.split("/").length-p.split("/").length);const n=e.type==="module"?"esm":"cjs";n==="esm"&&(i.options.emitESM=!0),n==="cjs"&&(i.options.emitCJS=!0);const a=Ot(e.exports,n,i.options.declaration);if(e.bin){const l=(typeof e.bin=="string"?[e.bin]:Object.values(e.bin)).filter(Boolean);for(const p of l){const r=We(p);if(r&&r!==n)throw new Error(`Exported file "${p}" has an extension that does not match the package.json type "${e.type??"commonjs"}".`);a.push({file:p,isExecutable:!0,key:"bin",type:r??n})}}e.main&&a.push({file:e.main,key:"main",type:We(e.main)??n}),e.module&&a.push({file:e.module,key:"module",type:"esm"}),(e.types||e.typings)&&(oi(i),i.options.declaration===void 0&&(i.options.declaration="compatible"),a.push({file:e.types??e.typings,key:"types"}));const s=[];for(const l of a){const p=Ge(l.file);if(p!==""&&!He.includes(p))continue;i.options.declaration===void 0&&(l.key==="types"||l.subKey==="types")&&(i.options.declaration=l.file.includes(".d.ts")?"compatible":!0),i.options.emitCJS===void 0&&l.type==="cjs"&&(i.options.emitCJS=!0),i.options.emitESM===void 0&&l.type==="esm"&&(i.options.emitESM=!0);const r=l.file.replace(/(?:\*[^/\\]|\.d\.[mc]?ts|\.\w+)$/,""),c=r.endsWith("/");if(c&&["./","/"].includes(r))continue;const m=r.replace(new RegExp("(./)?"+i.options.outDir),i.options.sourceDir).replace("./",""),d="(?<=/|$)",u=c?"":"(\\.[cm]?[tj]sx?)$";if(l.file.includes("/*")&&l.key==="exports"){ii||(i.logger.debug("Private subfolders are not supported, if you need this feature please open an issue on GitHub."),ii=!0);const f=[],y=new RegExp(d+m.replace("*","(.*)")+u),k=new RegExp(d+m.replace(/(.*)\.[^.]*$/,"$1").replace("*","(.*)")+u);for(const w of t)(y.test(w)||Je.has(l.subKey)&&k.test(w))&&f.push(w);if(f.length===0){o.push(`Could not find entrypoint for \`${l.file}\``);continue}for(const w of f)Te(s,w,c,r,l,i,!0);continue}const h=new RegExp(d+m+u);let v=t.find(f=>h.test(f));if(Je.has(l.subKey)&&v===void 0){const f=new RegExp(d+m.replace(/(.*)\.[^.]*$/,"$1")+u);v=t.find(y=>f.test(y))}if(v===void 0){z(E(i.options.rootDir,l.file))||o.push(`Could not find entrypoint for \`${l.file}\``);continue}(v.endsWith(".ts")||v.endsWith(".cts")||v.endsWith(".mts"))&&z(v)&&oi(i);const x=Re(v.replace(ae,""));z(x+".cts")&&z(x+".mts")?(Te(s,x+".cts",c,r,{...l,type:"cjs"},i,!1),Te(s,x+".mts",c,r,{...l,type:"esm"},i,!1)):Te(s,v,c,r,l,i,!1)}return{entries:s,warnings:o}},"inferEntries");var Ol=Object.defineProperty,Pl=g((e,t)=>Ol(e,"name",{value:t,configurable:!0}),"o$2");const Dl=Pl((e,t)=>{const{publishConfig:i}=e;return i&&(i.bin&&(typeof i.bin=="object"||typeof i.bin=="string")&&(e.bin=i.bin),i.type&&typeof i.type=="string"&&i.type!==""&&(e.type=i.type),i.main&&typeof i.main=="string"&&i.main!==""&&(e.main=i.main),i.module&&typeof i.module=="string"&&i.module!==""&&(e.module=i.module),t===void 0&&i.types&&typeof i.types=="string"&&i.types!==""?e.types=i.types:t===void 0&&i.typings&&typeof i.typings=="string"&&i.typings!==""&&(e.typings=i.typings),i.exports&&typeof i.exports=="object"&&(e.exports=i.exports)),e},"overwriteWithPublishConfig");var Cl=Object.defineProperty,Nl=g((e,t)=>Cl(e,"name",{value:t,configurable:!0}),"t$2");const _l={hooks:{"build:prepare":Nl(function(e){if(e.options.entries.length>0)return;const t=j(e.options.rootDir,e.options.sourceDir);if(!z(t))throw new Error("No 'src' directory found. Please provide entries manually.");const i=jo(t,{extensions:[],includeDirs:!1,includeSymlinks:!1});if(i.length===0)throw new Error("No source files found in 'src' directory. Please provide entries manually.");let o={...e.pkg};o.publishConfig&&(e.logger.info('Using publishConfig found in package.json, to override the default key-value pairs of "'+Object.keys(o.publishConfig).join(", ")+'".'),e.logger.debug(o.publishConfig),o=Dl(o,e.options.declaration));const n=Sl(o,i,e);for(const a of n.warnings)P(e,a);if(e.options.entries.push(...n.entries),e.options.entries.length===0)throw new Error("No entries detected. Please provide entries manually.");e.logger.info("Automatically detected entries:",D(e.options.entries.map(a=>a.fileAlias?V(a.fileAlias)+" => "+V(a.input.replace(`${e.options.rootDir}/`,"").replace(/\/$/,"/*")):V(a.input.replace(`${e.options.rootDir}/`,"").replace(/\/$/,"/*"))).join(", ")),ee([e.options.emitESM&&"esm",e.options.emitCJS&&"cjs",e.options.declaration&&"dts"].filter(Boolean).map(a=>`[${a}]`).join(" ")))},"build:prepare")}};var Ml=Object.defineProperty,Tl=g((e,t)=>Ml(e,"name",{value:t,configurable:!0}),"t$1");const Il=Tl(async(e,t)=>{if(e==="auto")e=_l;else{if(e==="none")return{};typeof e=="string"&&(e=await t.import(e)||{})}return typeof e=="function"&&(e=e()),e},"resolvePreset");var Al=Object.defineProperty,zl=g((e,t)=>Al(e,"name",{value:t,configurable:!0}),"j");const Fl=zl(async e=>{const t=e.options.jiti.transformOptions?.babel?.plugins,i=[],o=JSON.stringify({...e.options.jiti,alias:{...Qe(e.pkg,e.options),...e.options.jiti.alias},transformOptions:{...e.options.jiti.transformOptions,babel:{...e.options.jiti.transformOptions?.babel,plugins:"__$BABEL_PLUGINS"}}},null,2).replace('"__$BABEL_PLUGINS"',Array.isArray(t)?"["+t.map((n,a)=>{if(Array.isArray(n)){const[s,...l]=n;return i.push(s),"["+["plugin"+a,...l.map(p=>JSON.stringify(p))].join(", ")+"]"}return i.push(n),"plugin"+a}).join(",")+"]":"[]");for(const n of e.options.entries){const a=E(e.options.rootDir,e.options.outDir,n.name),s=an(e.jiti.esmResolve(n.input,{try:!0})??n.input),l=s.replace(ae,""),p=Ke(s),r=rr(p);let c=[];try{c=await sn(s,{extensions:He})}catch(d){P(e,`Cannot analyze ${s} for exports: ${d.toString()}`);return}const m=c.includes("default")||c.length===0;if(e.options.emitESM){const d=N(M(a),await Tt("jiti",{conditions:["node","import"],url:import.meta.url})),u=l+".d.mts";le(`${a}.mjs`,r+['import { createJiti } from "'+d+'";',...i.map((h,v)=>"import plugin"+v+' from "'+h+'";'),"","const jiti = createJiti(import.meta.url, "+o+");","",'/** @type {import("'+u+'")} */','const _module = await jiti.import("'+s+'");',m?`
112
112
  export default _module;`:"",...c.filter(h=>h!=="default").map(h=>`export const ${h} = _module.${h};`)].join(`
113
113
  `)),e.options.declaration&&le(`${a}.d.mts`,'export * from "'+u+`";
114
- `+(m?'export { default } from "'+u+'";':""))}if(e.options.emitCJS){const d=_(M(a),await At("jiti",{conditions:["node","require"],url:import.meta.url})),u=l+".d.cts";le(`${a}.cjs`,r+['const { createJiti } = require("'+d+'");',...i.map((h,v)=>"const plugin"+v+" = require("+JSON.stringify(h)+")"),"","const jiti = createJiti(__filename, "+o+");","",'/** @type {import("'+u+'")} */','module.exports = jiti("'+s+'")'].join(`
114
+ `+(m?'export { default } from "'+u+'";':""))}if(e.options.emitCJS){const d=N(M(a),await Tt("jiti",{conditions:["node","require"],url:import.meta.url})),u=l+".d.cts";le(`${a}.cjs`,r+['const { createJiti } = require("'+d+'");',...i.map((h,v)=>"const plugin"+v+" = require("+JSON.stringify(h)+")"),"","const jiti = createJiti(__filename, "+o+");","",'/** @type {import("'+u+'")} */','module.exports = jiti("'+s+'")'].join(`
115
115
  `)),e.options.declaration&&le(a+".d.cts",'export * from "'+u+`";
116
- `+(m?'export { default } from "'+u+'";':""))}r&&(await yt(`${a}.cjs`),await yt(`${a}.mjs`))}await e.hooks.callHook("rollup:done",e)},"createStub");var Vl=Object.defineProperty,Pt=g((e,t)=>Vl(e,"name",{value:t,configurable:!0}),"i$3");const Kl=Pt(e=>{const{message:t,name:i="Error",stack:o}=e;if(!o)return o;const n=`${i}: ${t}
117
- `;return o.startsWith(n)?o.slice(n.length):o},"extractStack"),Hl=Pt(e=>`
116
+ `+(m?'export { default } from "'+u+'";':""))}r&&(await xt(`${a}.cjs`),await xt(`${a}.mjs`))}await e.hooks.callHook("rollup:done",e)},"createStub");var Rl=Object.defineProperty,Pt=g((e,t)=>Rl(e,"name",{value:t,configurable:!0}),"i$3");const Ll=Pt(e=>{const{message:t,name:i="Error",stack:o}=e;if(!o)return o;const n=`${i}: ${t}
117
+ `;return o.startsWith(n)?o.slice(n.length):o},"extractStack"),Jl=Pt(e=>`
118
118
  ${e.replaceAll(/^\n|\n$/g,"")}
119
- `,"normalizeCodeFrame"),ro=Pt(e=>{const t=Kl(e);let i=(e.plugin?`[${e.plugin}] `:"")+e.message;e.id&&(i+=`
120
- file: ${P(e.id+(e.loc?":"+e.loc.line+":"+e.loc.column:""))}`),e.frame&&(i+=`
121
- `+Co(Hl(e.frame))),e.message=i,t!==void 0&&(e.stack=`${e.message}
122
- ${t}`)},"enhanceRollupError");var Gl=Object.defineProperty,lo=g((e,t)=>Gl(e,"name",{value:t,configurable:!0}),"d$4");const Ue="rollup-watch.json",ai=lo(({context:e,doOnSuccessCleanup:t,fileCache:i,mode:o,runBuilder:n,runOnsuccess:a,useCache:s,watcher:l})=>{const p="watcher:"+o;l.on("change",async(r,{event:c})=>{await t?.(),e.logger.info({message:`${P(_(".",r))} was ${c}d`,prefix:p})}),l.on("restart",()=>{e.logger.info({message:"Rebuilding ...",prefix:p})}),l.on("event",async r=>{switch(r.code){case"END":{e.logger.success({message:"Rebuild finished",prefix:p}),await a?.();break}case"BUNDLE_START":{e.logger.info({message:P("build started..."),prefix:p});break}case"BUNDLE_END":{await r.result.close(),s&&i.set(o==="bundle"?Ue:"dts-"+Ue,r.result.cache),e.logger.raw(`
119
+ `,"normalizeCodeFrame"),ao=Pt(e=>{const t=Ll(e);let i=(e.plugin?`[${e.plugin}] `:"")+e.message;e.id&&(i+=`
120
+ file: ${D(e.id+(e.loc?":"+e.loc.line+":"+e.loc.column:""))}`),e.frame&&(i+=`
121
+ `+Po(Jl(e.frame))),e.message=i,t!==void 0&&(e.stack=`${e.message}
122
+ ${t}`)},"enhanceRollupError");var Bl=Object.defineProperty,so=g((e,t)=>Bl(e,"name",{value:t,configurable:!0}),"d$4");const Ue="rollup-watch.json",ni=so(({context:e,doOnSuccessCleanup:t,fileCache:i,mode:o,runBuilder:n,runOnsuccess:a,useCache:s,watcher:l})=>{const p="watcher:"+o;l.on("change",async(r,{event:c})=>{await t?.(),e.logger.info({message:`${D(N(".",r))} was ${c}d`,prefix:p})}),l.on("restart",()=>{e.logger.info({message:"Rebuilding ...",prefix:p})}),l.on("event",async r=>{switch(r.code){case"END":{e.logger.success({message:"Rebuild finished",prefix:p}),await a?.();break}case"BUNDLE_START":{e.logger.info({message:D("build started..."),prefix:p});break}case"BUNDLE_END":{await r.result.close(),s&&i.set(o==="bundle"?Ue:"dts-"+Ue,r.result.cache),e.logger.raw(`
123
123
  ⚡️ Build run in `+r.duration+`ms
124
124
 
125
- `),await n?.(!0);break}case"ERROR":{ro(r.error),e.logger.error({context:[r.error],message:"Rebuild failed: "+r.error.message,prefix:p});break}}})},"watchHandler"),Yl=lo(async(e,t,i,o,n)=>{const a=await no(e,t);if(await e.hooks.callHook("rollup:options",e,a),Object.keys(a.input).length===0)return;let s=!0;(e.options.rollup.isolatedDeclarations||e.options.isolatedDeclarationTransformer||e.options.rollup.css)&&(s=!1),s&&(a.cache=t.get(Ue)),e.options.rollup.watch&&typeof a.watch=="object"&&a.watch.include===void 0&&(a.watch={...a.watch,...e.options.rollup.watch},a.watch.include=[j(e.options.sourceDir,"**","*"),"package.json","packem.config.*"],Array.isArray(e.options.rollup.watch.include)?a.watch.include=[...a.watch.include,...e.options.rollup.watch.include]:e.options.rollup.watch.include&&a.watch.include.push(e.options.rollup.watch.include),a.watch.chokidar={cwd:e.options.rootDir,...a.watch.chokidar,ignored:["**/.git/**","**/node_modules/**","**/test-results/**",...a.watch.chokidar?.ignored??[]]});const l=Mt(a);await e.hooks.callHook("rollup:watch",e,l);const p=[...Array.isArray(a.input)?a.input:typeof a.input=="string"?[a.input]:Object.keys(a.input??{})];let r="Starting watcher for entries:";for(const c of p)r+=ee(`
126
- └─ ${_(process.cwd(),c)}`);if(e.logger.info(r),ai({context:e,doOnSuccessCleanup:n,fileCache:t,mode:"bundle",runBuilder:i,runOnsuccess:o,useCache:s,watcher:l}),e.options.declaration&&e.options.rollup.isolatedDeclarations&&e.options.isolatedDeclarationTransformer)e.logger.info({message:"Using isolated declaration transformer to generate declaration files...",prefix:"dts"});else if(e.options.declaration){const c=await ao(e,t);s&&(c.cache=t.get("dts-"+Ue)),await e.hooks.callHook("rollup:dts:options",e,c);const m=Mt(c);await e.hooks.callHook("rollup:watch",e,m),ai({context:e,fileCache:t,mode:"types",useCache:s,watcher:m})}},"watch");var Xl=Object.defineProperty,Ql=g((e,t)=>Xl(e,"name",{value:t,configurable:!0}),"s$5");const Zl=Ql(async e=>{const t=[];if(e.options.clean)for(const i of new Set(e.options.entries.map(o=>o.outDir).filter(Boolean).sort()))i===e.options.rootDir||i===e.options.sourceDir||e.options.rootDir.startsWith(i.endsWith("/")?i:`${i}/`)||t.some(o=>i.startsWith(o))||(t.push(i),e.logger.info(`Cleaning dist directory: \`./${_(e.options.rootDir,i)}\``),await So(i))},"cleanDistributionDirectories");var ep=Object.defineProperty,tp=g((e,t)=>ep(e,"name",{value:t,configurable:!0}),"i$2");const ip=tp((e,t,i,o)=>{try{let n={};const a=j(t,"keystore.json");o&&z(a)&&(n=fi(a)),n[e]===void 0&&(n[e]=new Date().toISOString()),wt(a,n,{overwrite:!0})}catch(n){i.debug({context:n,message:n.message,prefix:"cache-key-store"})}},"createOrUpdateKeyStorage");var op=Object.defineProperty,po=g((e,t)=>op(e,"name",{value:t,configurable:!0}),"s$4");const np=po(e=>{try{JSON.parse(e)}catch{return!1}return!0},"isJson");let ap=class{static{g(this,"g")}static{po(this,"FileCache")}#e;#i;#a;#r=!0;#s=new Map;constructor(t,i,o,n){this.#e=t,this.#a=o,i===void 0?n.debug({message:"Could not create cache directory.",prefix:"file-cache"}):(this.#i=i,n.debug({message:"Cache path is: "+this.#i,prefix:"file-cache"}))}set isEnabled(t){this.#r=t}has(t,i){return!this.#r||this.#i===void 0?!1:z(this.getFilePath(t,i))}get(t,i){if(!this.#r||this.#i===void 0)return;const o=this.getFilePath(t,i);if(this.#s.has(o))return this.#s.get(o);if(!z(o))return;const n=Ke(o);if(np(n)){const a=JSON.parse(n);return this.#s.set(o,a),a}return this.#s.set(o,n),n}set(t,i,o){if(!this.#r||this.#i===void 0||i===void 0)return;const n=this.getFilePath(t,o);(typeof i=="object"||typeof i=="number"||typeof i=="boolean")&&(i=JSON.stringify(i)),le(n,i,{overwrite:!0})}getFilePath(t,i){let o=t.replaceAll(Re(this.#e),"");return o=o.replaceAll(":","-"),j(this.#i,this.#a,i?.replaceAll(":","-")??"",Re(o))}};var sp=Object.defineProperty,Ie=g((e,t)=>sp(e,"name",{value:t,configurable:!0}),"l$4");const rp=X,lp=Ie((e,t)=>{const{sideEffects:i}=t;let o;if(typeof i=="boolean")o=Ie(()=>i,"hasSideEffects");else if(Array.isArray(i))if(i.length<=0)o=Ie(()=>!1,"hasSideEffects");else{const n=i.map(a=>a.includes("/")?a:`**/${a}`);o=rp(n,null,{resolve:e})}else o=Ie(()=>null,"hasSideEffects");return o},"getPackageSideEffect");var dt,si;function pp(){if(si)return dt;si=1;var e=Object.defineProperty,t=g((p,r)=>e(p,"name",{value:r,configurable:!0}),"s"),i=wn,o=i.spawn,n=i.exec;dt=g(function(p,r,c){if(typeof r=="function"&&c===void 0&&(c=r,r=void 0),p=parseInt(p),Number.isNaN(p)){if(c)return c(new Error("pid must be a number"));throw new Error("pid must be a number")}var m={},d={};switch(m[p]=[],d[p]=1,process.platform){case"win32":n("taskkill /pid "+p+" /T /F",c);break;case"darwin":l(p,m,d,function(u){return o("pgrep",["-P",u])},function(){a(m,r,c)});break;default:l(p,m,d,function(u){return o("ps",["-o","pid","--no-headers","--ppid",u])},function(){a(m,r,c)});break}},"treeKill");function a(p,r,c){var m={};try{Object.keys(p).forEach(function(d){p[d].forEach(function(u){m[u]||(s(u,r),m[u]=1)}),m[d]||(s(d,r),m[d]=1)})}catch(d){if(c)return c(d);throw d}if(c)return c()}g(a,"killAll"),t(a,"killAll");function s(p,r){try{process.kill(parseInt(p,10),r)}catch(c){if(c.code!=="ESRCH")throw c}}g(s,"killPid"),t(s,"killPid");function l(p,r,c,m,d){var u=m(p),h="";u.stdout.on("data",function(f){var f=f.toString("ascii");h+=f});var v=t(function(y){if(delete c[p],y!=0){Object.keys(c).length==0&&d();return}h.match(/\d+/g).forEach(function(f){f=parseInt(f,10),r[p].push(f),r[f]=[],c[f]=1,l(f,r,c,m,d)})},"onClose");u.on("close",v)}return g(l,"buildProcessTree"),t(l,"buildProcessTree"),dt}g(pp,"requireTreeKill");var cp=pp();const dp=Ci(cp);var mp=Object.defineProperty,co=g((e,t)=>mp(e,"name",{value:t,configurable:!0}),"l$3");const up=co(e=>process.platform==="win32"&&"cmd"in e&&"code"in e&&typeof e.cmd=="string"&&e.cmd.startsWith("taskkill")&&e.code===128,"isTaskKillCmdProcessNotFoundError"),fp=co(async({pid:e,signal:t})=>await new Promise((i,o)=>{if(!Number.isInteger(e)||e<=0){o(new Error("Invalid process ID"));return}dp(e,t,n=>{if(n&&!up(n)){o(n);return}i()})}),"killProcess");var gp=Object.defineProperty,vp=g((e,t)=>gp(e,"name",{value:t,configurable:!0}),"n");const mo=vp(e=>{const t=j(e,"package.json");if(!z(t))throw new Error("package.json not found at "+t);return{packageJson:ji(t),packageJsonPath:t}},"loadPackageJson");var hp=Object.defineProperty,xp=g((e,t)=>hp(e,"name",{value:t,configurable:!0}),"r$3");const ri=xp((e,t)=>{if(e.warnings.size>0&&(t&&e.logger.raw(`
125
+ `),await n?.(!0);break}case"ERROR":{ao(r.error),e.logger.error({context:[r.error],message:"Rebuild failed: "+r.error.message,prefix:p});break}}})},"watchHandler"),ql=so(async(e,t,i,o,n)=>{const a=await io(e,t);if(await e.hooks.callHook("rollup:options",e,a),Object.keys(a.input).length===0)return;let s=!0;(e.options.rollup.isolatedDeclarations||e.options.isolatedDeclarationTransformer||e.options.rollup.css)&&(s=!1),s&&(a.cache=t.get(Ue)),e.options.rollup.watch&&typeof a.watch=="object"&&a.watch.include===void 0&&(a.watch={...a.watch,...e.options.rollup.watch},a.watch.include=[j(e.options.sourceDir,"**","*"),"package.json","packem.config.*","tsconfig.json","tsconfig.*.json"],Array.isArray(e.options.rollup.watch.include)?a.watch.include=[...a.watch.include,...e.options.rollup.watch.include]:e.options.rollup.watch.include&&a.watch.include.push(e.options.rollup.watch.include),a.watch.chokidar={cwd:e.options.rootDir,...a.watch.chokidar,ignored:["**/.git/**","**/node_modules/**","**/test-results/**",...a.watch.chokidar?.ignored??[]]});const l=_t(a);await e.hooks.callHook("rollup:watch",e,l);const p=[...Array.isArray(a.input)?a.input:typeof a.input=="string"?[a.input]:Object.keys(a.input??{})];let r="Starting watcher for entries:";for(const c of p)r+=ee(`
126
+ └─ ${N(process.cwd(),c)}`);if(e.logger.info(r),ni({context:e,doOnSuccessCleanup:n,fileCache:t,mode:"bundle",runBuilder:i,runOnsuccess:o,useCache:s,watcher:l}),e.options.declaration&&e.options.rollup.isolatedDeclarations&&e.options.isolatedDeclarationTransformer)e.logger.info({message:"Using isolated declaration transformer to generate declaration files...",prefix:"dts"});else if(e.options.declaration){const c=await oo(e,t);s&&(c.cache=t.get("dts-"+Ue)),await e.hooks.callHook("rollup:dts:options",e,c);const m=_t(c);await e.hooks.callHook("rollup:watch",e,m),ni({context:e,fileCache:t,mode:"types",useCache:s,watcher:m})}},"watch");var Wl=Object.defineProperty,Ul=g((e,t)=>Wl(e,"name",{value:t,configurable:!0}),"s$5");const Vl=Ul(async e=>{const t=[];if(e.options.clean)for(const i of new Set(e.options.entries.map(o=>o.outDir).filter(Boolean).sort()))i===e.options.rootDir||i===e.options.sourceDir||e.options.rootDir.startsWith(i.endsWith("/")?i:`${i}/`)||t.some(o=>i.startsWith(o))||(t.push(i),e.logger.info(`Cleaning dist directory: \`./${N(e.options.rootDir,i)}\``),await $o(i))},"cleanDistributionDirectories");var Kl=Object.defineProperty,Gl=g((e,t)=>Kl(e,"name",{value:t,configurable:!0}),"i$2");const Hl=Gl((e,t,i,o)=>{try{let n={};const a=j(t,"keystore.json");o&&z(a)&&(n=ui(a)),n[e]===void 0&&(n[e]=new Date().toISOString()),bt(a,n,{overwrite:!0})}catch(n){i.debug({context:n,message:n.message,prefix:"cache-key-store"})}},"createOrUpdateKeyStorage");var Yl=Object.defineProperty,ro=g((e,t)=>Yl(e,"name",{value:t,configurable:!0}),"s$4");const Xl=ro(e=>{try{JSON.parse(e)}catch{return!1}return!0},"isJson");let Ql=class{static{g(this,"g")}static{ro(this,"FileCache")}#e;#i;#a;#r=!0;#s=new Map;constructor(t,i,o,n){this.#e=t,this.#a=o,i===void 0?n.debug({message:"Could not create cache directory.",prefix:"file-cache"}):(this.#i=i,n.debug({message:"Cache path is: "+this.#i,prefix:"file-cache"}))}set isEnabled(t){this.#r=t}has(t,i){return!this.#r||this.#i===void 0?!1:z(this.getFilePath(t,i))}get(t,i){if(!this.#r||this.#i===void 0)return;const o=this.getFilePath(t,i);if(this.#s.has(o))return this.#s.get(o);if(!z(o))return;const n=Ke(o);if(Xl(n)){const a=JSON.parse(n);return this.#s.set(o,a),a}return this.#s.set(o,n),n}set(t,i,o){if(!this.#r||this.#i===void 0||i===void 0)return;const n=this.getFilePath(t,o);(typeof i=="object"||typeof i=="number"||typeof i=="boolean")&&(i=JSON.stringify(i)),le(n,i,{overwrite:!0})}getFilePath(t,i){let o=t.replaceAll(Re(this.#e),"");return o=o.replaceAll(":","-"),j(this.#i,this.#a,i?.replaceAll(":","-")??"",Re(o))}};var Zl=Object.defineProperty,Ie=g((e,t)=>Zl(e,"name",{value:t,configurable:!0}),"l$4");const ep=Y,tp=Ie((e,t)=>{const{sideEffects:i}=t;let o;if(typeof i=="boolean")o=Ie(()=>i,"hasSideEffects");else if(Array.isArray(i))if(i.length<=0)o=Ie(()=>!1,"hasSideEffects");else{const n=i.map(a=>a.includes("/")?a:`**/${a}`);o=ep(n,null,{resolve:e})}else o=Ie(()=>null,"hasSideEffects");return o},"getPackageSideEffect");var dt,ai;function ip(){if(ai)return dt;ai=1;var e=Object.defineProperty,t=g((p,r)=>e(p,"name",{value:r,configurable:!0}),"s"),i=yn,o=i.spawn,n=i.exec;dt=g(function(p,r,c){if(typeof r=="function"&&c===void 0&&(c=r,r=void 0),p=parseInt(p),Number.isNaN(p)){if(c)return c(new Error("pid must be a number"));throw new Error("pid must be a number")}var m={},d={};switch(m[p]=[],d[p]=1,process.platform){case"win32":n("taskkill /pid "+p+" /T /F",c);break;case"darwin":l(p,m,d,function(u){return o("pgrep",["-P",u])},function(){a(m,r,c)});break;default:l(p,m,d,function(u){return o("ps",["-o","pid","--no-headers","--ppid",u])},function(){a(m,r,c)});break}},"treeKill");function a(p,r,c){var m={};try{Object.keys(p).forEach(function(d){p[d].forEach(function(u){m[u]||(s(u,r),m[u]=1)}),m[d]||(s(d,r),m[d]=1)})}catch(d){if(c)return c(d);throw d}if(c)return c()}g(a,"killAll"),t(a,"killAll");function s(p,r){try{process.kill(parseInt(p,10),r)}catch(c){if(c.code!=="ESRCH")throw c}}g(s,"killPid"),t(s,"killPid");function l(p,r,c,m,d){var u=m(p),h="";u.stdout.on("data",function(f){var f=f.toString("ascii");h+=f});var v=t(function(x){if(delete c[p],x!=0){Object.keys(c).length==0&&d();return}h.match(/\d+/g).forEach(function(f){f=parseInt(f,10),r[p].push(f),r[f]=[],c[f]=1,l(f,r,c,m,d)})},"onClose");u.on("close",v)}return g(l,"buildProcessTree"),t(l,"buildProcessTree"),dt}g(ip,"requireTreeKill");var op=ip();const np=Di(op);var ap=Object.defineProperty,lo=g((e,t)=>ap(e,"name",{value:t,configurable:!0}),"l$3");const sp=lo(e=>process.platform==="win32"&&"cmd"in e&&"code"in e&&typeof e.cmd=="string"&&e.cmd.startsWith("taskkill")&&e.code===128,"isTaskKillCmdProcessNotFoundError"),rp=lo(async({pid:e,signal:t})=>await new Promise((i,o)=>{if(!Number.isInteger(e)||e<=0){o(new Error("Invalid process ID"));return}np(e,t,n=>{if(n&&!sp(n)){o(n);return}i()})}),"killProcess");var lp=Object.defineProperty,pp=g((e,t)=>lp(e,"name",{value:t,configurable:!0}),"n$1");const po=pp(e=>{const t=j(e,"package.json");if(!z(t))throw new Error("package.json not found at "+t);return{packageJson:ki(t),packageJsonPath:t}},"loadPackageJson");var cp=Object.defineProperty,dp=g((e,t)=>cp(e,"name",{value:t,configurable:!0}),"r$4");const si=dp((e,t)=>{if(e.warnings.size>0&&(t&&e.logger.raw(`
127
127
  `),e.logger.warn(`Build is done with some warnings:
128
128
 
129
129
  ${[...e.warnings].map(i=>`- ${i}`).join(`
130
- `)}`),e.options.failOnWarn))throw new Error("Exiting with code (1). You can change this behavior by setting `failOnWarn: false`.")},"logBuildErrors");var yp=Object.defineProperty,uo=g((e,t)=>yp(e,"name",{value:t,configurable:!0}),"r$2");const li=uo(async(e,t)=>{if(typeof e.name!="string"){let i=fe(e.input)?_(t.options.rootDir,e.input):K(e.input);i.startsWith("./")&&(i=i.slice(2)),e.name=i.replace(new RegExp(`^${t.options.sourceDir}/`),"").replace(ae,"")}if(!e.input)throw new Error(`Missing entry input: ${JSON.stringify(e)}`);jt(e.input)&&(e.input=E(t.options.rootDir,e.input)),t.options.declaration&&e.declaration===void 0&&(e.declaration=t.options.declaration),e.executable&&(e.cjs===void 0||e.esm===void 0)?t.pkg.type==="commonjs"&&e.cjs===void 0&&t.options.emitCJS!==void 0?(e.cjs=t.options.emitCJS,e.esm=!1):t.pkg.type==="module"&&e.esm===void 0&&t.options.emitESM!==void 0&&(e.esm=t.options.emitESM,e.cjs=!1):e.cjs===void 0&&e.esm===void 0&&(t.options.emitCJS!==void 0&&(e.cjs=t.options.emitCJS),t.options.emitESM!==void 0&&(e.esm=t.options.emitESM)),e.outDir=E(t.options.rootDir,e.outDir??t.options.outDir)},"extendEntry"),bp=uo(async e=>{e.options.entries=e.options.entries.map(t=>typeof t=="string"?{input:t,isGlob:It(t)}:{...t,exportKey:t.exportKey??new Set,isGlob:It(t.input)});for(const t of e.options.entries.filter(i=>i.isGlob)){const{...i}=t,o=["**/.git/**","**/node_modules/**","**/test-results/**"];if(e.options.rollup.watch){if(typeof e.options.rollup.watch.exclude=="string")o.push(e.options.rollup.watch.exclude);else if(Array.isArray(e.options.rollup.watch.exclude))for(const a of e.options.rollup.watch.exclude)typeof a=="string"&&o.push(a)}const n=en([i.input],{cwd:e.options.rootDir,dot:!1,ignore:o,onlyFiles:!0});if(n.length===0)throw new kn("No files found in the glob pattern: "+P(j(e.options.rootDir,i.input)));for(const a of n)e.options.entries.push({...i,input:E(e.options.rootDir,a)});e.options.entries.splice(e.options.entries.indexOf(t),1)}for(const t of e.options.entries.filter(i=>i.fileAlias===void 0))await li(t,e);for(const t of e.options.entries.filter(i=>i.fileAlias!==void 0))t.name=t.fileAlias,t.fileAlias=void 0,await li(t,e)},"prepareEntries");var wp=Object.defineProperty,kp=g((e,t)=>wp(e,"name",{value:t,configurable:!0}),"a$3");const jp=kp(async(e,t,i)=>{if(e&&await Ve(j(e,"keystore.json"))){const o=await Oo(j(e,"keystore.json"));let n=await Bo(e,{withFileTypes:!0});n=n.filter(s=>s.isDirectory());let a=i;for(const s of n)if(!o[s.name]){try{await qo(j(e,s.name),{force:!0,recursive:!0})}catch(l){t.error({message:`Failed to remove cache directory ${s.name}: ${l instanceof Error?l.message:String(l)}`,prefix:"file-cache"});continue}a&&t.raw(`
130
+ `)}`),e.options.failOnWarn))throw new Error("Exiting with code (1). You can change this behavior by setting `failOnWarn: false`.")},"logBuildErrors");var mp=Object.defineProperty,co=g((e,t)=>mp(e,"name",{value:t,configurable:!0}),"r$3");const ri=co(async(e,t)=>{if(typeof e.name!="string"){let i=fe(e.input)?N(t.options.rootDir,e.input):K(e.input);i.startsWith("./")&&(i=i.slice(2)),e.name=i.replace(new RegExp(`^${t.options.sourceDir}/`),"").replace(ae,"")}if(!e.input)throw new Error(`Missing entry input: ${JSON.stringify(e)}`);kt(e.input)&&(e.input=E(t.options.rootDir,e.input)),t.options.declaration&&e.declaration===void 0&&(e.declaration=t.options.declaration),e.executable&&(e.cjs===void 0||e.esm===void 0)?t.pkg.type==="commonjs"&&e.cjs===void 0&&t.options.emitCJS!==void 0?(e.cjs=t.options.emitCJS,e.esm=!1):t.pkg.type==="module"&&e.esm===void 0&&t.options.emitESM!==void 0&&(e.esm=t.options.emitESM,e.cjs=!1):e.cjs===void 0&&e.esm===void 0&&(t.options.emitCJS!==void 0&&(e.cjs=t.options.emitCJS),t.options.emitESM!==void 0&&(e.esm=t.options.emitESM)),e.outDir=E(t.options.rootDir,e.outDir??t.options.outDir)},"extendEntry"),up=co(async e=>{e.options.entries=e.options.entries.map(t=>typeof t=="string"?{input:t,isGlob:Mt(t)}:{...t,exportKey:t.exportKey??new Set,isGlob:Mt(t.input)});for(const t of e.options.entries.filter(i=>i.isGlob)){const{isGlob:i,...o}=t,n=["**/.git/**","**/node_modules/**","**/test-results/**"];if(e.options.rollup.watch){if(typeof e.options.rollup.watch.exclude=="string")n.push(e.options.rollup.watch.exclude);else if(Array.isArray(e.options.rollup.watch.exclude))for(const s of e.options.rollup.watch.exclude)typeof s=="string"&&n.push(s)}const a=Qo([o.input],{cwd:e.options.rootDir,dot:!1,ignore:n,onlyFiles:!0});if(a.length===0)throw new bn("No files found in the glob pattern: "+D(j(e.options.rootDir,o.input)));for(const s of a)e.options.entries.push({...o,input:E(e.options.rootDir,s)});e.options.entries.splice(e.options.entries.indexOf(t),1)}for(const t of e.options.entries.filter(i=>i.fileAlias===void 0))await ri(t,e);for(const t of e.options.entries.filter(i=>i.fileAlias!==void 0))t.name=t.fileAlias,t.fileAlias=void 0,await ri(t,e)},"prepareEntries");var fp=Object.defineProperty,gp=g((e,t)=>fp(e,"name",{value:t,configurable:!0}),"a$4");const vp=gp(async(e,t,i)=>{if(e&&await Ve(j(e,"keystore.json"))){const o=await Eo(j(e,"keystore.json"));let n=await Lo(e,{withFileTypes:!0});n=n.filter(s=>s.isDirectory());let a=i;for(const s of n)if(!o[s.name]){try{await Jo(j(e,s.name),{force:!0,recursive:!0})}catch(l){t.error({message:`Failed to remove cache directory ${s.name}: ${l instanceof Error?l.message:String(l)}`,prefix:"file-cache"});continue}a&&t.raw(`
131
131
 
132
- `),t.info({message:"Removing "+s.name+" file cache, the cache key is not used anymore.",prefix:"file-cache"}),a=!1}}},"removeOldCacheFolders");var $p=Object.defineProperty,Ep=g((e,t)=>$p(e,"name",{value:t,configurable:!0}),"o$1");const Sp=Ep(e=>{if(e.options.validation?.packageJson?.dependencies===!1)return;const t=new Set,i=new Set(Object.keys(e.pkg?.dependencies??{})),o=new Set;for(const n of e.usedImports)i.delete(n),t.add(n);if(e.pkg?.dependencies)for(const n of Object.keys(e.pkg?.dependencies))i.delete(n);for(const n of t){const a=Wi(n);!xt(e.options.externals,n)&&!n.startsWith("chunks/")&&e.pkg?.dependencies?.[a]===void 0&&e.pkg?.peerDependencies?.[a]===void 0&&o.add(n)}i.size>0&&D(e,`Potential unused dependencies found: ${[...i].map(n=>P(n)).join(", ")}`),o.size>0&&D(e,`Potential implicit dependencies found: ${[...o].map(n=>P(n)).join(", ")}`)},"validateDependencies");var Op=Object.defineProperty,fo=g((e,t)=>Op(e,"name",{value:t,configurable:!0}),"i$1");const Dp=fo((e,t)=>jn(e,t)<=e.length/3||t.includes(e),"isSimilar"),Pp=fo((e,t)=>{const i=e.toLowerCase();return t.filter(o=>Dp(o.toLowerCase(),i))},"findAlternatives");var Cp=Object.defineProperty,pi=g((e,t)=>Cp(e,"name",{value:t,configurable:!0}),"r$1");const Np=pi(e=>{const{options:t}=e;if(t.validation?.packageJson?.exports===!1)return;const i=t.validation?.packageJson,o=new Set([t.declaration&&i?.types?e.pkg.types:"",t.declaration&&i?.types?e.pkg.typings:"",...t.dtsOnly||i?.bin===!1?[""]:typeof e.pkg.bin=="string"?[e.pkg.bin]:Object.values(e.pkg.bin??{}),t.dtsOnly&&i?.main===!1?"":e.pkg.main,t.dtsOnly&&i?.module===!1?"":e.pkg.module,...i?.exports===!1?[]:Dt(e.pkg.exports,e.pkg.type==="module"?"esm":"cjs",t.declaration).map(l=>t.dtsOnly?l.subKey==="types"?l.file:void 0:l.file)].filter(Boolean).map(l=>l&&E(t.rootDir,l.replace(/\/[^*/]*\*[^\n\r/\u2028\u2029]*(?:[\n\r\u2028\u2029][^*/]*\*[^\n\r/\u2028\u2029]*)*(?:\/.*)?$/,"")))),n=[];for(const l of o)l&&!l.includes("*")&&!xn(l)&&n.push(l.replace(`${t.rootDir}/`,""));const a=pi(l=>_(t.rootDir,E(t.outDir,l)),"rPath"),s=e.buildEntries.filter(l=>!l.chunk).map(l=>a(l.path));if(n.length>0){let l="Potential missing or wrong package.json files:";for(const p of n){const r=Pp(p,s);l+=`
133
- - `+P(p)+(r.length>0?No` (did you mean ${r.map(c=>`"${c}"`).join(", ")}?)`:"")}D(e,l)}},"validatePackageEntries");var _p=Object.defineProperty,Tp=g((e,t)=>_p(e,"name",{value:t,configurable:!0}),"l$1");const Mp=Tp(e=>{const{options:{validation:t},pkg:i}=e;i.name===void 0&&t?.packageJson?.name!==!1&&D(e,"The 'name' field is missing in your package.json. Please provide a valid package name."),t?.packageJson?.files!==!1&&(i.files===void 0?D(e,"The 'files' field is missing in your package.json. Add the files to be included in the package."):i.files.length===0?D(e,"The 'files' field in your package.json is empty. Please specify the files to be included in the package."):i.files.some(a=>a.includes(e.options.outDir))||D(e,`The 'files' field in your package.json is missing the '${e.options.outDir}' directory. Ensure the output directory is included.`));const o=i.type==="commonjs"||i.type===void 0,n=i.type==="module";if(o?(t?.packageJson?.main!==!1&&(i.main===void 0&&D(e,"The 'main' field is missing in your package.json. This field should point to your main entry file."),i.main?.includes(".mjs")&&D(e,"The 'main' field in your package.json should not use a '.mjs' extension for CommonJS modules.")),t?.packageJson?.module!==!1&&(i.module===void 0&&e.options.emitESM&&D(e,"The 'module' field is missing in your package.json, but you are emitting ES modules."),i.module&&i.main&&i.module===i.main&&D(e,`Conflict detected: The 'module' and 'main' fields both point to '${i.module}'. Please ensure they refer to different module types.`),e.options.emitESM&&i.module?.includes(".cjs")&&D(e,"The 'module' field in your package.json should not use a '.cjs' extension for ES modules."))):n&&(i.exports===void 0&&!e.options.emitCJS?t?.packageJson?.exports!==!1&&D(e,"The 'exports' field is missing in your package.json. Define module exports explicitly."):e.options.emitCJS&&(t?.packageJson?.main!==!1&&i.main===void 0&&D(e,"The 'main' field is missing in your package.json. This field is needed when emitting CommonJS modules."),t?.packageJson?.module!==!1&&(i.module===void 0&&D(e,"The 'module' field is missing in your package.json. This field is necessary when emitting ES modules."),i.module?.includes(".cjs")&&D(e,"The 'module' field should not use a '.cjs' extension for ES modules."),i.module&&i.main&&i.module===i.main&&D(e,`Conflict detected: The 'module' and 'main' fields both point to '${i.module}'. Please ensure they refer to different module types.`)),t?.packageJson?.exports!==!1&&i.exports===void 0&&D(e,"The 'exports' field is missing in your package.json. This field is required for defining explicit exports."))),t?.packageJson?.bin!==!1){if(typeof i.bin=="string"&&i.bin.includes(o?".mjs":".cjs"))D(e,`The 'bin' field in your package.json should not use a ${o?".mjs":".cjs"} extension for ${o?"CommonJS":"ES modules"} binaries.`);else if(typeof i.bin=="object")for(const[a,s]of Object.entries(i.bin))s&&s.includes(o?".mjs":".cjs")&&D(e,`The 'bin.${a}' field in your package.json should not use a ${o?".mjs":".cjs"} extension for ${o?"CommonJS":"ES modules"} binaries.`)}if(e.options.declaration){let a=!0;i.type==="module"&&(a=!!i.main?.endsWith(".cjs")),i.types===void 0&&i.typings===void 0&&a&&t?.packageJson?.types!==!1&&D(e,"The 'types' field is missing in your package.json. This field should point to your type definitions file."),(e.options.declaration===!0||e.options.declaration==="compatible")&&a&&t?.packageJson?.typesVersions!==!1&&(i.typesVersions===void 0||Object.keys(i.typesVersions).length===0)&&D(e,"No 'typesVersions' field found in your package.json. Consider adding this field, or change the declaration option to 'node16' or 'false'.")}},"validatePackageFields");var Ip=Object.defineProperty,Ap=g((e,t)=>Ip(e,"name",{value:t,configurable:!0}),"i");const zp=Ap(e=>{const{packageJson:t}=mo(e.options.rootDir);e.pkg=t,Sp(e),Mp(e),Np(e)},"validator");var Fp=Object.defineProperty,Rp=g((e,t)=>Fp(e,"name",{value:t,configurable:!0}),"a");const Lp=/^[^a-z_@#~]|[^\w/@#~-]|@\/|#\/|~\//i,Jp=new Set(["abstract","await","boolean","break","byte","case","catch","char","class","const","continue","debugger","default","delete","do","double","else","enum","export","extends","false","final","finally","float","for","function","goto","if","implements","import","in","instanceof","int","interface","let","long","native","new","null","package","private","protected","public","return","short","static","super","switch","synchronized","this","throw","throws","transient","true","try","typeof","var","void","volatile","while","with","yield"]),ci=Rp(e=>{if(!Array.isArray(e)&&e!==null)for(const[t,i]of Object.entries(e)){if(typeof t!="string"||t.trim()==="")throw new Error(`Alias name "${t}" is invalid. Alias names should be non-empty strings.`);if(Lp.test(t))throw new Error(`Alias name "${t}" is invalid. Alias names should start with a letter or underscore and only contain letters, numbers, underscores, and dashes.`);if(Jp.has(t))throw new Error(`Alias name "${t}" is a reserved keyword and cannot be used.`);const o=E(i);if(!z(o))throw new Error(`Target path "${o}" for alias "${t}" does not exist.`)}},"validateAliasEntries");var Bp=Object.defineProperty,J=g((e,t)=>Bp(e,"name",{value:t,configurable:!0}),"c");const qp=J(e=>{switch(e){case"preserve":case"react-native":return"preserve";case"react":return"transform";case"react-jsx":case"react-jsxdev":return"automatic";default:return}},"resolveTsconfigJsxToJsxRuntime"),Wp=J((e,t,i,o,n,a,s,l,p)=>{const r=qp(p?.config.compilerOptions?.jsx),c=Ao(a,n,s,{alias:{},browserTargets:Io(),cjsInterop:!1,clean:!0,debug:o,declaration:void 0,emitCJS:void 0,emitESM:void 0,entries:[],externals:[..._t.builtinModules,..._t.builtinModules.map(m=>`node:${m}`)],failOnWarn:!0,fileCache:!0,jiti:{alias:{},debug:o,interopDefault:!0},minify:i===G,name:(l.name??"").split("/").pop()??"default",outDir:p?.config.compilerOptions?.outDir??"dist",rollup:{alias:{},cjsInterop:{addDefaultProperty:!1},commonjs:{extensions:[".mjs",".js",".json",".node",".cjs"],ignoreTryCatch:!0,preserveSymlinks:!0,transformMixedEsModules:!1},css:{autoModules:!0,extensions:[".css",".pcss",".postcss",".sss"],namedExports:!0},dts:{compilerOptions:{baseUrl:p?.config.compilerOptions?.baseUrl??".",checkJs:!1,composite:!1,declaration:!0,declarationMap:!1,emitDeclarationOnly:!0,incremental:!1,moduleResolution:100,noEmit:!1,noEmitOnError:!0,preserveSymlinks:!1,skipLibCheck:!0,target:99},respectExternal:!0},dynamicVars:{errorWhenNoFilesFound:!0,exclude:xe,include:/\bimport\s*[(/]/},esbuild:{charset:"utf8",jsx:r,jsxDev:p?.config.compilerOptions?.jsx==="react-jsxdev",jsxFactory:p?.config.compilerOptions?.jsxFactory,jsxFragment:p?.config.compilerOptions?.jsxFragmentFactory,jsxImportSource:p?.config.compilerOptions?.jsxImportSource,jsxSideEffects:!0,keepNames:!0,sourcesContent:!1,target:p?.config.compilerOptions?.target,treeShaking:!0,tsconfigRaw:p?.config},isolatedDeclarations:{exclude:xe,ignoreErrors:!1,include:ye},json:{preferConst:!0},license:{dependenciesTemplate:J((m,d,u)=>`
132
+ `),t.info({message:"Removing "+s.name+" file cache, the cache key is not used anymore.",prefix:"file-cache"}),a=!1}}},"removeOldCacheFolders");var hp=Object.defineProperty,xp=g((e,t)=>hp(e,"name",{value:t,configurable:!0}),"a$3");const yp=xp((e,t)=>e.some(i=>i instanceof RegExp?i.test(t):i===t),"arrayIncludes");var bp=Object.defineProperty,wp=g((e,t)=>bp(e,"name",{value:t,configurable:!0}),"a$2");const kp=wp((e="")=>{const t=e.split("/");return t[0].startsWith("@")?t[0]+"/"+t[1]:t[0]},"getPackageName");var jp=Object.defineProperty,$p=g((e,t)=>jp(e,"name",{value:t,configurable:!0}),"p");const Ep=$p(e=>{if(e.options.validation?.packageJson?.dependencies===!1)return;const t=new Set,i=new Set(Object.keys(e.pkg?.dependencies??{})),o=new Set;for(const n of e.usedImports)i.delete(n),t.add(n);if(e.pkg?.dependencies)for(const n of Object.keys(e.pkg?.dependencies))i.delete(n);for(const n of t){const a=kp(n);!yp(e.options.externals,n)&&!n.startsWith("chunks/")&&![...It.builtinModules,...It.builtinModules.map(s=>`node:${s}`)].includes(a)&&e.pkg?.dependencies?.[a]===void 0&&e.pkg?.peerDependencies?.[a]===void 0&&o.add(n)}i.size>0&&P(e,`Potential unused dependencies found: ${[...i].map(n=>D(n)).join(", ")}`),o.size>0&&P(e,`Potential implicit dependencies found: ${[...o].map(n=>D(n)).join(", ")}`)},"validateDependencies");var Sp=Object.defineProperty,mo=g((e,t)=>Sp(e,"name",{value:t,configurable:!0}),"i$1");const Op=mo((e,t)=>wn(e,t)<=e.length/3||t.includes(e),"isSimilar"),Pp=mo((e,t)=>{const i=e.toLowerCase();return t.filter(o=>Op(o.toLowerCase(),i))},"findAlternatives");var Dp=Object.defineProperty,li=g((e,t)=>Dp(e,"name",{value:t,configurable:!0}),"r$1");const Cp=li(e=>{const{options:t}=e;if(t.validation?.packageJson?.exports===!1)return;const i=t.validation?.packageJson,o=new Set([t.declaration&&i?.types?e.pkg.types:"",t.declaration&&i?.types?e.pkg.typings:"",...t.dtsOnly||i?.bin===!1?[""]:typeof e.pkg.bin=="string"?[e.pkg.bin]:Object.values(e.pkg.bin??{}),t.dtsOnly&&i?.main===!1?"":e.pkg.main,t.dtsOnly&&i?.module===!1?"":e.pkg.module,...i?.exports===!1?[]:Ot(e.pkg.exports,e.pkg.type==="module"?"esm":"cjs",t.declaration).map(l=>t.dtsOnly?l.subKey==="types"?l.file:void 0:l.file)].filter(Boolean).map(l=>l&&E(t.rootDir,l.replace(/\/[^*/]*\*[^\n\r/\u2028\u2029]*(?:[\n\r\u2028\u2029][^*/]*\*[^\n\r/\u2028\u2029]*)*(?:\/.*)?$/,"")))),n=[];for(const l of o)l&&!l.includes("*")&&!vn(l)&&n.push(l.replace(`${t.rootDir}/`,""));const a=li(l=>N(t.rootDir,E(t.outDir,l)),"rPath"),s=e.buildEntries.filter(l=>!l.chunk).map(l=>a(l.path));if(n.length>0){let l="Potential missing or wrong package.json files:";for(const p of n){const r=Pp(p,s);l+=`
133
+ - `+D(p)+(r.length>0?Do` (did you mean ${r.map(c=>`"${c}"`).join(", ")}?)`:"")}P(e,l)}},"validatePackageEntries");var Np=Object.defineProperty,_p=g((e,t)=>Np(e,"name",{value:t,configurable:!0}),"l$1");const Mp=_p(e=>{const{options:{validation:t},pkg:i}=e;i.name===void 0&&t?.packageJson?.name!==!1&&P(e,"The 'name' field is missing in your package.json. Please provide a valid package name."),t?.packageJson?.files!==!1&&(i.files===void 0?P(e,"The 'files' field is missing in your package.json. Add the files to be included in the package."):i.files.length===0?P(e,"The 'files' field in your package.json is empty. Please specify the files to be included in the package."):i.files.some(a=>a.includes(e.options.outDir))||P(e,`The 'files' field in your package.json is missing the '${e.options.outDir}' directory. Ensure the output directory is included.`));const o=i.type==="commonjs"||i.type===void 0,n=i.type==="module";if(o?(t?.packageJson?.main!==!1&&(i.main===void 0&&P(e,"The 'main' field is missing in your package.json. This field should point to your main entry file."),i.main?.includes(".mjs")&&P(e,"The 'main' field in your package.json should not use a '.mjs' extension for CommonJS modules.")),t?.packageJson?.module!==!1&&(i.module===void 0&&e.options.emitESM&&P(e,"The 'module' field is missing in your package.json, but you are emitting ES modules."),i.module&&i.main&&i.module===i.main&&P(e,`Conflict detected: The 'module' and 'main' fields both point to '${i.module}'. Please ensure they refer to different module types.`),e.options.emitESM&&i.module?.includes(".cjs")&&P(e,"The 'module' field in your package.json should not use a '.cjs' extension for ES modules."))):n&&(i.exports===void 0&&!e.options.emitCJS?t?.packageJson?.exports!==!1&&P(e,"The 'exports' field is missing in your package.json. Define module exports explicitly."):e.options.emitCJS&&(t?.packageJson?.main!==!1&&i.main===void 0&&P(e,"The 'main' field is missing in your package.json. This field is needed when emitting CommonJS modules."),t?.packageJson?.module!==!1&&(i.module===void 0&&P(e,"The 'module' field is missing in your package.json. This field is necessary when emitting ES modules."),i.module?.includes(".cjs")&&P(e,"The 'module' field should not use a '.cjs' extension for ES modules."),i.module&&i.main&&i.module===i.main&&P(e,`Conflict detected: The 'module' and 'main' fields both point to '${i.module}'. Please ensure they refer to different module types.`)),t?.packageJson?.exports!==!1&&i.exports===void 0&&P(e,"The 'exports' field is missing in your package.json. This field is required for defining explicit exports."))),t?.packageJson?.bin!==!1){if(typeof i.bin=="string"&&i.bin.includes(o?".mjs":".cjs"))P(e,`The 'bin' field in your package.json should not use a ${o?".mjs":".cjs"} extension for ${o?"CommonJS":"ES modules"} binaries.`);else if(typeof i.bin=="object")for(const[a,s]of Object.entries(i.bin))s&&s.includes(o?".mjs":".cjs")&&P(e,`The 'bin.${a}' field in your package.json should not use a ${o?".mjs":".cjs"} extension for ${o?"CommonJS":"ES modules"} binaries.`)}if(e.options.declaration){let a=!0;i.type==="module"&&(a=!!i.main?.endsWith(".cjs")),i.types===void 0&&i.typings===void 0&&a&&t?.packageJson?.types!==!1&&P(e,"The 'types' field is missing in your package.json. This field should point to your type definitions file."),(e.options.declaration===!0||e.options.declaration==="compatible")&&a&&t?.packageJson?.typesVersions!==!1&&(i.typesVersions===void 0||Object.keys(i.typesVersions).length===0)&&P(e,"No 'typesVersions' field found in your package.json. Consider adding this field, or change the declaration option to 'node16' or 'false'.")}},"validatePackageFields");var Tp=Object.defineProperty,Ip=g((e,t)=>Tp(e,"name",{value:t,configurable:!0}),"i");const Ap=Ip(e=>{const{packageJson:t}=po(e.options.rootDir);e.pkg=t,Ep(e),Mp(e),Cp(e)},"validator");var zp=Object.defineProperty,Fp=g((e,t)=>zp(e,"name",{value:t,configurable:!0}),"a");const Rp=/^[^a-z_@#~]|[^\w/@#~-]|@\/|#\/|~\//i,Lp=new Set(["abstract","await","boolean","break","byte","case","catch","char","class","const","continue","debugger","default","delete","do","double","else","enum","export","extends","false","final","finally","float","for","function","goto","if","implements","import","in","instanceof","int","interface","let","long","native","new","null","package","private","protected","public","return","short","static","super","switch","synchronized","this","throw","throws","transient","true","try","typeof","var","void","volatile","while","with","yield"]),pi=Fp(e=>{if(!Array.isArray(e)&&e!==null)for(const[t,i]of Object.entries(e)){if(typeof t!="string"||t.trim()==="")throw new Error(`Alias name "${t}" is invalid. Alias names should be non-empty strings.`);if(Rp.test(t))throw new Error(`Alias name "${t}" is invalid. Alias names should start with a letter or underscore and only contain letters, numbers, underscores, and dashes.`);if(Lp.has(t))throw new Error(`Alias name "${t}" is a reserved keyword and cannot be used.`);const o=E(i);if(!z(o))throw new Error(`Target path "${o}" for alias "${t}" does not exist.`)}},"validateAliasEntries");var Jp=Object.defineProperty,J=g((e,t)=>Jp(e,"name",{value:t,configurable:!0}),"c");const Bp=J(e=>{switch(e){case"preserve":case"react-native":return"preserve";case"react":return"transform";case"react-jsx":case"react-jsxdev":return"automatic";default:return}},"resolveTsconfigJsxToJsxRuntime"),qp=J((e,t,i,o,n,a,s,l,p)=>{const r=Bp(p?.config.compilerOptions?.jsx),c=To(a,n,s,{alias:{},browserTargets:Mo(),cjsInterop:!1,clean:!0,debug:o,declaration:void 0,emitCJS:void 0,emitESM:void 0,entries:[],externals:[],failOnWarn:!0,fileCache:!0,jiti:{alias:{},debug:o,interopDefault:!0},minify:i===G,name:(l.name??"").split("/").pop()??"default",outDir:p?.config.compilerOptions?.outDir??"dist",rollup:{alias:{},cjsInterop:{addDefaultProperty:!1},commonjs:{extensions:[".mjs",".js",".json",".node",".cjs"],ignoreTryCatch:!0,preserveSymlinks:!0,transformMixedEsModules:!1},css:{autoModules:!0,extensions:[".css",".pcss",".postcss",".sss"],namedExports:!0},dts:{compilerOptions:{baseUrl:p?.config.compilerOptions?.baseUrl??".",checkJs:!1,composite:!1,declaration:!0,declarationMap:!1,emitDeclarationOnly:!0,incremental:!1,moduleResolution:100,noEmit:!1,noEmitOnError:!0,preserveSymlinks:!1,skipLibCheck:!0,target:99},respectExternal:!0},dynamicVars:{errorWhenNoFilesFound:!0,exclude:xe,include:/\bimport\s*[(/]/},esbuild:{charset:"utf8",jsx:r,jsxDev:p?.config.compilerOptions?.jsx==="react-jsxdev",jsxFactory:p?.config.compilerOptions?.jsxFactory,jsxFragment:p?.config.compilerOptions?.jsxFragmentFactory,jsxImportSource:p?.config.compilerOptions?.jsxImportSource,jsxSideEffects:!0,keepNames:!0,sourcesContent:!1,target:p?.config.compilerOptions?.target,treeShaking:!0,tsconfigRaw:p?.config},isolatedDeclarations:{exclude:xe,ignoreErrors:!1,include:ye},json:{preferConst:!0},license:{dependenciesTemplate:J((m,d,u)=>`
134
134
  # Licenses of bundled dependencies
135
135
  The published ${u} artifact additionally contains code with the following licenses:
136
136
  `+(m.length>0?`${m.join(", ")}
@@ -144,24 +144,24 @@ The published ${u} artifact additionally contains code with the following licens
144
144
 
145
145
  `:`
146
146
  `)+`# Bundled types:
147
- `+d,"dtsTemplate")},node10Compatibility:{},patchTypes:{},polyfillNode:{},preserveDirectives:{include:ye},preserveDynamicImports:!0,raw:{exclude:xe,include:[/\.(md|txt|htm|html|data)$/]},replace:{objectGuards:!0,preventAssignment:!0},resolve:{allowExportsFolderMapping:!1,exportConditions:["module-sync"],extensions:Ge,preferBuiltins:!1},resolveExternals:{builtins:!0,builtinsPrefix:"add",deps:!0,devDeps:!1,exclude:[],include:[],optDeps:!0,packagePath:[],peerDeps:!0},shebang:{replace:!1,shebang:"#!/usr/bin/env node"},shim:{exclude:xe,include:ye},sourcemap:{},sucrase:{disableESTransforms:!0,enableLegacyBabel5ModuleInterop:!1,enableLegacyTypeScriptModuleInterop:p?.config.compilerOptions?.esModuleInterop===!1,include:ye,injectCreateRequireForImportRequire:!1,preserveDynamicImport:!0,production:i===G,...p?.config.compilerOptions?.jsx&&["react","react-jsx","react-jsxdev"].includes(p.config.compilerOptions.jsx)?{jsxFragmentPragma:p.config.compilerOptions.jsxFragmentFactory,jsxImportSource:p.config.compilerOptions.jsxImportSource,jsxPragma:p.config.compilerOptions.jsxFactory,jsxRuntime:r,transforms:["typescript","jsx",...p.config.compilerOptions.esModuleInterop?["imports"]:[]]}:{transforms:["typescript",...p?.config.compilerOptions?.esModuleInterop?["imports"]:[]]}},swc:{include:ye,inlineSourcesContent:!1,inputSourceMap:!1,isModule:!0,jsc:{experimental:{keepImportAttributes:!0},externalHelpers:!1,keepClassNames:!0,loose:!0,parser:{decorators:p?.config.compilerOptions?.experimentalDecorators,syntax:p?"typescript":"ecmascript",[p?"tsx":"jsx"]:!0},target:p?.config.compilerOptions?.target?.toLowerCase(),transform:{decoratorMetadata:p?.config.compilerOptions?.emitDecoratorMetadata,decoratorVersion:"2022-03",legacyDecorator:p?.config.compilerOptions?.experimentalDecorators,react:{development:i!==G,pragma:p?.config.compilerOptions?.jsxFactory,pragmaFrag:p?.config.compilerOptions?.jsxFragmentFactory,runtime:r,throwIfNamespace:!0},treatConstEnumAsEnum:p?.config.compilerOptions?.preserveConstEnums,useDefineForClassFields:p?.config.compilerOptions?.useDefineForClassFields}},module:{ignoreDynamic:!0,importInterop:"none",preserveImportMeta:!0,strict:!1,strictMode:!1,type:"es6"}},treeshake:{moduleSideEffects:lp(t,l),preset:"recommended",propertyReadSideEffects:!0},url:{emitFiles:!0,fileName:"[hash][extname]",include:["**/*.svg","**/*.png","**/*.jp(e)?g","**/*.gif","**/*.webp"],limit:14*1024},visualizer:{},watch:{chokidar:{ignoreInitial:!0,ignorePermissionErrors:!0},clearScreen:!0,exclude:xe}},rootDir:t,sourceDir:"src",sourcemap:!1,transformerName:void 0,typedoc:{excludePrivate:!0,groupOrder:["Classes","Constructors","Accessors","Methods","Functions","Namespaces","Variables","Enumerations","Interfaces","Type Aliases","*"],kindSortOrder:["Project","Module","Class","Interface","Function","Namespace","Variable","Enum","EnumMember","TypeAlias","Reference","Constructor","Property","Accessor","Method","Parameter","TypeParameter","TypeLiteral","CallSignature","ConstructorSignature","IndexSignature","GetSignature","SetSignature"],marker:"TYPEDOC",name:l.name??"unknown",pretty:!0,readme:"none",showConfig:o,tsconfig:p?.path}});if(!c.transformerName){const m=new Map([...Object.entries(l.dependencies??{}),...Object.entries(l.devDependencies??{})]);let d="0.0.0";if(m.has("esbuild"))c.transformerName="esbuild",d=m.get("esbuild");else if(m.has("@swc/core"))c.transformerName="swc",d=m.get("@swc/core");else if(m.has("sucrase"))c.transformerName="sucrase",d=m.get("sucrase");else throw new Error("Unknown transformer, check your transformer options or install one of the supported transformers: esbuild, swc, sucrase");e.info("Using "+P("rollup ")+Fo),e.info({message:"Using "+P(c.transformerName)+" "+d,prefix:"transformer"})}return c.rollup.resolve&&c.rollup.resolve.preferBuiltins===!0&&(c.rollup.polyfillNode=!1,e.debug("Disabling polyfillNode because preferBuiltins is set to true")),c.browserTargets&&c.browserTargets.length>0&&e.debug("Using browser targets: "+c.browserTargets.join(", ")),l.dependencies&&c.externals.push(...Object.keys(l.dependencies)),l.peerDependencies&&c.externals.push(...Object.keys(l.peerDependencies)),l.optionalDependencies&&c.externals.push(...Object.keys(l.optionalDependencies)),ci(c.alias),c.rollup.alias&&c.rollup.alias.entries&&ci(c.rollup.alias.entries),c},"generateOptions"),Up=J(async(e,t,i,o,n,a,s,l,p,r)=>{const c=await Bl(s.preset??a.preset??"auto",r),m=Wp(e,t,o,n,a,s,c,l,p);Do(j(m.rootDir,m.outDir));const d={buildEntries:[],dependencyGraphMap:new Map,environment:o,hooks:zo(),jiti:gi(m.rootDir,m.jiti),logger:e,mode:i,options:m,pkg:l,tsconfig:p,usedImports:new Set,warnings:new Set};c.hooks&&d.hooks.addHooks(c.hooks),a.hooks&&d.hooks.addHooks(a.hooks),s.hooks&&d.hooks.addHooks(s.hooks),await d.hooks.callHook("build:prepare",d),d.options.emitESM===void 0&&d.logger.info("Emitting of ESM bundles, is disabled."),d.options.emitCJS===void 0&&d.logger.info("Emitting of CJS bundles, is disabled."),d.options.minify&&d.logger.info("Minification is enabled, the output will be minified");const u=l.dependencies?.typescript!==void 0||l.devDependencies?.typescript!==void 0;if(d.options.declaration&&d.tsconfig===void 0&&u)throw new Error("Cannot build declaration files without a tsconfig.json");return u?d.options.declaration===!1&&d.logger.info({message:"Generation of declaration files are disabled.",prefix:"dts"}):(d.options.declaration=!1,d.logger.info({message:"Typescript is not installed. Generation of declaration files are disabled.",prefix:"dts"})),d.options.declaration&&d.logger.info("Using typescript version: "+P(l.devDependencies?.typescript??l.dependencies?.typescript??"unknown")),d.options.declaration&&(l.dependencies?.typescript||l.devDependencies?.typescript)&&!d.tsconfig?.config.compilerOptions?.isolatedModules&&d.logger.warn(`'compilerOptions.isolatedModules' is not enabled in tsconfig.
147
+ `+d,"dtsTemplate")},node10Compatibility:{},patchTypes:{},polyfillNode:{},preserveDirectives:{include:ye},preserveDynamicImports:!0,raw:{exclude:xe,include:[/\.(md|txt|htm|html|data)$/]},replace:{objectGuards:!0,preventAssignment:!0},resolve:{allowExportsFolderMapping:!1,exportConditions:["module-sync"],extensions:He,preferBuiltins:!1},resolveExternals:{builtins:!0,builtinsPrefix:"add",deps:!0,devDeps:!1,exclude:[],optDeps:!0,peerDeps:!0},shebang:{replace:!1,shebang:"#!/usr/bin/env node"},shim:{exclude:xe,include:ye},sourcemap:{},sucrase:{disableESTransforms:!0,enableLegacyBabel5ModuleInterop:!1,enableLegacyTypeScriptModuleInterop:p?.config.compilerOptions?.esModuleInterop===!1,include:ye,injectCreateRequireForImportRequire:!1,preserveDynamicImport:!0,production:i===G,...p?.config.compilerOptions?.jsx&&["react","react-jsx","react-jsxdev"].includes(p.config.compilerOptions.jsx)?{jsxFragmentPragma:p.config.compilerOptions.jsxFragmentFactory,jsxImportSource:p.config.compilerOptions.jsxImportSource,jsxPragma:p.config.compilerOptions.jsxFactory,jsxRuntime:r,transforms:["typescript","jsx",...p.config.compilerOptions.esModuleInterop?["imports"]:[]]}:{transforms:["typescript",...p?.config.compilerOptions?.esModuleInterop?["imports"]:[]]}},swc:{include:ye,inlineSourcesContent:!1,inputSourceMap:!1,isModule:!0,jsc:{experimental:{keepImportAttributes:!0},externalHelpers:!1,keepClassNames:!0,loose:!0,parser:{decorators:p?.config.compilerOptions?.experimentalDecorators,syntax:p?"typescript":"ecmascript",[p?"tsx":"jsx"]:!0},target:p?.config.compilerOptions?.target?.toLowerCase(),transform:{decoratorMetadata:p?.config.compilerOptions?.emitDecoratorMetadata,decoratorVersion:"2022-03",legacyDecorator:p?.config.compilerOptions?.experimentalDecorators,react:{development:i!==G,pragma:p?.config.compilerOptions?.jsxFactory,pragmaFrag:p?.config.compilerOptions?.jsxFragmentFactory,runtime:r,throwIfNamespace:!0},treatConstEnumAsEnum:p?.config.compilerOptions?.preserveConstEnums,useDefineForClassFields:p?.config.compilerOptions?.useDefineForClassFields}},module:{ignoreDynamic:!0,importInterop:"none",preserveImportMeta:!0,strict:!1,strictMode:!1,type:"es6"}},treeshake:{moduleSideEffects:tp(t,l),preset:"recommended",propertyReadSideEffects:!0},tsconfigPaths:{resolveAbsolutePath:!1},url:{emitFiles:!0,fileName:"[hash][extname]",include:["**/*.svg","**/*.png","**/*.jp(e)?g","**/*.gif","**/*.webp"],limit:14*1024},visualizer:{},watch:{chokidar:{ignoreInitial:!0,ignorePermissionErrors:!0},clearScreen:!0,exclude:xe}},rootDir:t,sourceDir:"src",sourcemap:!1,transformerName:void 0,typedoc:{excludePrivate:!0,groupOrder:["Classes","Constructors","Accessors","Methods","Functions","Namespaces","Variables","Enumerations","Interfaces","Type Aliases","*"],kindSortOrder:["Project","Module","Class","Interface","Function","Namespace","Variable","Enum","EnumMember","TypeAlias","Reference","Constructor","Property","Accessor","Method","Parameter","TypeParameter","TypeLiteral","CallSignature","ConstructorSignature","IndexSignature","GetSignature","SetSignature"],marker:"TYPEDOC",name:l.name??"unknown",pretty:!0,readme:"none",showConfig:o,tsconfig:p?.path}});if(!c.transformerName){const m=new Map([...Object.entries(l.dependencies??{}),...Object.entries(l.devDependencies??{})]);let d="0.0.0";if(m.has("esbuild"))c.transformerName="esbuild",d=m.get("esbuild");else if(m.has("@swc/core"))c.transformerName="swc",d=m.get("@swc/core");else if(m.has("sucrase"))c.transformerName="sucrase",d=m.get("sucrase");else throw new Error("Unknown transformer, check your transformer options or install one of the supported transformers: esbuild, swc, sucrase");e.info("Using "+D("rollup ")+Ao),e.info({message:"Using "+D(c.transformerName)+" "+d,prefix:"transformer"})}return c.rollup.resolve&&c.rollup.resolve.preferBuiltins===!0&&(c.rollup.polyfillNode=!1,e.debug("Disabling polyfillNode because preferBuiltins is set to true")),c.browserTargets&&c.browserTargets.length>0&&e.debug("Using browser targets: "+c.browserTargets.join(", ")),pi(c.alias),c.rollup.alias&&c.rollup.alias.entries&&pi(c.rollup.alias.entries),c},"generateOptions"),Wp=J(async(e,t,i,o,n,a,s,l,p,r)=>{const c=await Il(s.preset??a.preset??"auto",r),m=qp(e,t,o,n,a,s,c,l,p);So(j(m.rootDir,m.outDir));const d={buildEntries:[],dependencyGraphMap:new Map,environment:o,hooks:Io(),jiti:fi(m.rootDir,m.jiti),logger:e,mode:i,options:m,pkg:l,tsconfig:p,usedImports:new Set,warnings:new Set};c.hooks&&d.hooks.addHooks(c.hooks),a.hooks&&d.hooks.addHooks(a.hooks),s.hooks&&d.hooks.addHooks(s.hooks),await d.hooks.callHook("build:prepare",d),d.options.emitESM===void 0&&d.logger.info("Emitting of ESM bundles, is disabled."),d.options.emitCJS===void 0&&d.logger.info("Emitting of CJS bundles, is disabled."),d.options.minify&&d.logger.info("Minification is enabled, the output will be minified");const u=l.dependencies?.typescript!==void 0||l.devDependencies?.typescript!==void 0;if(d.options.declaration&&d.tsconfig===void 0&&u)throw new Error("Cannot build declaration files without a tsconfig.json");return u?d.options.declaration===!1&&d.logger.info({message:"Generation of declaration files are disabled.",prefix:"dts"}):(d.options.declaration=!1,d.logger.info({message:"Typescript is not installed. Generation of declaration files are disabled.",prefix:"dts"})),d.options.declaration&&d.logger.info("Using typescript version: "+D(l.devDependencies?.typescript??l.dependencies?.typescript??"unknown")),d.options.declaration&&(l.dependencies?.typescript||l.devDependencies?.typescript)&&!d.tsconfig?.config.compilerOptions?.isolatedModules&&d.logger.warn(`'compilerOptions.isolatedModules' is not enabled in tsconfig.
148
148
  Because none of the third-party transpiler, packem uses under the hood is type-aware, some techniques or features often used in TypeScript are not properly checked and can cause mis-compilation or even runtime errors.
149
- To mitigate this, you should set the isolatedModules option to true in tsconfig and let your IDE warn you when such incompatible constructs are used.`),await bp(d),d},"createContext"),Vp=J(e=>{switch(e){case"jit":return"Stubbing";case"watch":return"Watching";case"tsdoc":return"Generating TSDoc";default:return"Building"}},"getMode"),Kp=J(async(e,t,i,o,n={})=>{const{configPath:a,debug:s,tsconfigPath:l,...p}=n;o.wrapAll(),e=E(ot.cwd(),e),o.debug("Root directory:",e);const{packageJson:r,packageJsonPath:c}=mo(e);o.debug("Using package.json found at",c);let m;if(l){const y=j(e,l);if(!await Ve(y))throw new Error("tsconfig.json not found at "+y);m={config:To(y),path:y},o.info("Using tsconfig settings at",y)}else if(r.dependencies?.typescript||r.devDependencies?.typescript)try{m=await Mo(e),o.debug("Using tsconfig settings found at",m.path)}catch{o.info("No tsconfig.json or jsconfig.json found.")}const d=_o("@visulima/packem",{cwd:e});let u=!1,h,v;try{const y=await $i(e,a??""),f=gi(e,{debug:s});let x=await f.import(y,{default:!0,try:!0})||{};typeof x=="function"&&(x=await x(i,t)),o.debug("Using packem config found at",j(e,y));const k=te(JSON.stringify({version:r.version,...r.dependencies,...r.devDependencies,...r.peerDependencies,...r.peerDependenciesMeta,browser:r.browser,eNode:r.engines?.node,exports:r.exports,main:r.main,module:r.module,type:r.type,types:r.types}))+te(JSON.stringify(x));d&&ip(k,d,o);const w=new ap(e,d,k,o),b=await Up(o,e,t,i,s??!1,p,x,r,m,f);w.isEnabled=b.options.fileCache,b.logger.info(P(Vp(t)+" "+b.options.name)),b.logger.debug({context:b.options.entries,message:`${V("Root dir:")} ${b.options.rootDir}
150
- ${V("Entries:")}`}),await Zl(b);const S=J(async R=>{for await(const[Q,O]of Object.entries(b.options.builder??{})){b.logger.raw(`
151
- `),await b.hooks.callHook("builder:before",Q,b);const C=Date.now(),$=J(()=>Tt(Math.floor(Date.now()-C)),"getBuilderDuration");await O(b,d,w,u),await b.hooks.callHook("builder:done",Q,b),b.logger.raw(`
149
+ To mitigate this, you should set the isolatedModules option to true in tsconfig and let your IDE warn you when such incompatible constructs are used.`),await up(d),d},"createContext"),Up=J(e=>{switch(e){case"jit":return"Stubbing";case"watch":return"Watching";case"tsdoc":return"Generating TSDoc";default:return"Building"}},"getMode"),Vp=J(async(e,t,i,o,n={})=>{const{configPath:a,debug:s,tsconfigPath:l,...p}=n;o.wrapAll(),e=E(ot.cwd(),e),o.debug("Root directory:",e);const{packageJson:r,packageJsonPath:c}=po(e);o.debug("Using package.json found at",c);let m;if(l){const x=j(e,l);if(!await Ve(x))throw new Error("tsconfig.json not found at "+x);m={config:No(x),path:x},o.info("Using tsconfig settings at",x)}else if(r.dependencies?.typescript||r.devDependencies?.typescript)try{m=await _o(e),o.debug("Using tsconfig settings found at",m.path)}catch{o.info("No tsconfig.json or jsconfig.json found.")}const d=Co("@visulima/packem",{cwd:e});let u=!1,h,v;try{const x=await ji(e,a??""),f=fi(e,{debug:s});let y=await f.import(x,{default:!0,try:!0})||{};typeof y=="function"&&(y=await y(i,t)),o.debug("Using packem config found at",j(e,x));const k=te(JSON.stringify({version:r.version,...r.dependencies,...r.devDependencies,...r.peerDependencies,...r.peerDependenciesMeta,browser:r.browser,eNode:r.engines?.node,exports:r.exports,main:r.main,module:r.module,type:r.type,types:r.types}))+te(JSON.stringify(y));d&&Hl(k,d,o);const w=new Ql(e,d,k,o),b=await Wp(o,e,t,i,s??!1,p,y,r,m,f);w.isEnabled=b.options.fileCache,b.logger.info(D(Up(t)+" "+b.options.name)),b.logger.debug({context:b.options.entries,message:`${V("Root dir:")} ${b.options.rootDir}
150
+ ${V("Entries:")}`}),await Vl(b);const S=J(async R=>{for await(const[Q,O]of Object.entries(b.options.builder??{})){b.logger.raw(`
151
+ `),await b.hooks.callHook("builder:before",Q,b);const C=Date.now(),$=J(()=>Nt(Math.floor(Date.now()-C)),"getBuilderDuration");await O(b,d,w,u),await b.hooks.callHook("builder:done",Q,b),b.logger.raw(`
152
152
  ⚡️ `+Q+" run in "+$()),R&&b.logger.raw(`
153
153
 
154
- `)}},"runBuilder"),I=J(async()=>{if(h!==void 0)await fp({pid:h.pid,signal:p.killSignal??x.killSignal??"SIGTERM"});else if(v!==void 0)try{await v()}catch(R){throw new Error("onSuccess function cleanup failed: "+R.message,{cause:R})}h=void 0,v=void 0},"doOnSuccessCleanup"),B=J(async()=>{if(typeof b.options.onSuccess=="function")try{v=await b.options.onSuccess()}catch(R){throw new Error("onSuccess function failed: "+R.message,{cause:R})}else if(typeof b.options.onSuccess=="string"){const R=b.options.onSuccessTimeout??3e4;if(h=Ro(b.options.onSuccess,[],{nodeOptions:{shell:!0,stdio:"inherit",timeout:R}}),await h,h.exitCode&&h.exitCode!==0)throw new Error("onSuccess script failed with exit code "+h.exitCode+". Check the output above for details.")}},"runOnsuccess"),F=Date.now(),ce=J(()=>Tt(Math.floor(Date.now()-F)),"getDuration");if(t==="watch"){if(b.options.rollup.watch===!1)throw new Error("Rollup watch is disabled. You should check your packem.config file.");await Yl(b,w,S,B,I),ri(b,!1);return}t==="jit"?(await Ul(b),await b.hooks.callHook("build:done",b)):(u=await $l(b,w),await b.hooks.callHook("validate:before",b),zp(b),await b.hooks.callHook("validate:done",b),ri(b,u)),b.logger.raw(`
155
- ⚡️ Build run in `+ce()),await S(),await B(),ot.on("SIGINT",async()=>{await I()}),ot.on("SIGTERM",async()=>{await I()})}catch(y){throw o.raw(`
156
- `),ro(y),y}finally{o.restoreAll(),await jp(d,o,u)}},"packem");var Hp=Object.defineProperty,Ae=g((e,t)=>Hp(e,"name",{value:t,configurable:!0}),"o");const Gp=Ae(e=>{e.addCommand({description:"Demonstrate options required",execute:Ae(async({logger:t,options:i})=>{let o="build";i.watch?o="watch":i.jit&&(o="jit");const n={};let a;if(Fe.NODE_ENV&&[De,G].includes(Fe.NODE_ENV)&&(a=Fe.NODE_ENV),i.env)for(const s of i.env)if(s.key==="NODE_ENV"){if(a)throw new Error("NODE_ENV was already set, this can't be overridden.");a=s.value}else n["process.env."+s.key]=JSON.stringify(s.value);a===void 0&&(i.production?a=G:i.development&&(a=De));try{await Kp(i.dir,o,a,t,{analyze:i.analyze,cjsInterop:i.cjsInterop,clean:i.clean,configPath:i.config??void 0,debug:i.debug,dtsOnly:i.dtsOnly,killSignal:i.killSignal,minify:i.minify===void 0?a===G:i.minify,onSuccess:i.onSuccess,rollup:{esbuild:{target:i.target},license:{path:i.license},metafile:i.metafile,replace:{values:n}},sourcemap:i.metafile||i.analyze||i.sourcemap,tsconfigPath:i.tsconfig??void 0,validation:i.validation===!1?{packageJson:{bin:!1,dependencies:!1,exports:!1,files:!1,main:!1,module:!1,name:!1,types:!1,typesVersions:!1}}:{},...i.typedoc?{typedoc:{format:"html"}}:{}})}catch(s){t.error(s),bo(1)}},"execute"),name:"build",options:[{defaultValue:".",description:"The directory to build",name:"dir",type:String},{alias:"t",description:"Environments to support. `target` in tsconfig.json is automatically added. Defaults to the current Node.js version.",name:"target"},{description:"Use a custom config file",name:"config",type:String},{description:"Path to the tsconfig.json file",name:"tsconfig",type:String},{description:"Minify the output",name:"minify",type:Boolean},{description:"Generate sourcemaps (experimental)",name:"sourcemap",type:Boolean},{conflicts:"jit",description:"Watch for changes",name:"watch",type:Boolean},{conflicts:"watch",description:"Stub the package for JIT compilation",name:"jit",type:Boolean},{description:"Compile-time environment variables (eg. --env.NODE_ENV=production)",multiple:!0,name:"env",type:Ae(t=>{const[i,o]=t.split("=");return{key:i,value:o}},"type")},{defaultValue:!1,description:"Generate meta file (experimental)",name:"metafile",type:Boolean},{description:"Path to the license file",name:"license",type:String},{conflicts:"watch",description:"Visualize and analyze the bundle",name:"analyze",type:Boolean},{description:"CJS interop mode, can export default and named export, (experimental).",name:"cjsInterop",type:Boolean},{conflicts:"development",description:"Run code in production environment",name:"production",type:Boolean},{conflicts:"production",description:"Run code in development environment",name:"development",type:Boolean},{description:"Do not clean the dist directory before building",name:"no-clean",type:Boolean},{description:"Only generate .d.ts files",name:"dts-only",type:Boolean},{description:"Enable or disable the output validation",name:"no-validation",type:Boolean},{description:"Generate type documentation",name:"typedoc",type:Boolean},{description:"Execute command after successful build, specially useful for watch mode",name:"onSuccess",type:String},{description:'Signal to kill child process, "SIGTERM" or "SIGKILL"',name:"killSignal",type:Ae(t=>{if(t==="SIGTERM"||t==="SIGKILL")return t;throw new Error("Invalid kill signal. Use 'SIGTERM' or 'SIGKILL'.")},"type")}]})},"createBuildCommand");var Yp=Object.defineProperty,ze=g((e,t)=>Yp(e,"name",{value:t,configurable:!0}),"m");const Xp=ze(e=>{e.addCommand({description:"Initialize packem configuration",execute:ze(async({logger:t,options:i})=>{if(wo("Welcome to packem setup"),z(j(i.dir,"packem.config.ts"))){t.info("Packem project already initialized, you can use `packem build` to build your project");return}const o=E(di(),i.dir??"."),n=j(o,"package.json");if(!z(n))throw new Error("No package.json found in the directory");const a=ji(n),s=[];a.dependencies&&s.push(...Object.keys(a.dependencies)),a.devDependencies&&s.push(...Object.keys(a.devDependencies));const l=!!(a.devDependencies?.typescript??a.dependencies?.typescript),p=[];if(i.typescript===void 0&&!l?(i.typescript=await U({message:"Do you want to install TypeScript?"}),i.typescript&&p.push("typescript@latest")):Ct.message("TypeScript version "+(a.devDependencies?.typescript??a.dependencies?.typescript)+" is already installed"),!z(j(o,"tsconfig.json"))){const v=await U({message:"Do you want to use generate a tsconfig.json?"}),y=await U({message:"Do you want to run your code in the DOM?"});if(v){const f=ut();f.start("Generating tsconfig.json"),wt(j(o,"tsconfig.json"),{compilerOptions:{esModuleInterop:!0,skipLibCheck:!0,target:"es2022",allowJs:!0,resolveJsonModule:!0,moduleDetection:"force",isolatedModules:!0,verbatimModuleSyntax:!0,strict:!0,noUncheckedIndexedAccess:!0,noImplicitOverride:!0,module:"NodeNext",outDir:"dist",sourceMap:!0,declaration:!0,lib:y?["es2022","dom","dom.iterable"]:["es2022"]}}),f.stop("")}}if(s.includes("esbuild")?i.transformer="esbuild":s.includes("@swc/core")?i.transformer="swc":s.includes("sucrase")&&(i.transformer="sucrase"),i.transformer===void 0?(i.transformer=await ie({message:"Pick a transformer",options:[{label:"esbuild",value:"esbuild"},{label:"swc",value:"swc"},{label:"Sucrase",value:"sucrase"}]}),i.transformer&&!s.includes(i.transformer)&&await U({message:"Do you want to install "+i.transformer+"?"})&&p.push(i.transformer==="swc"?"@swc/core":i.transformer)):Ct.message("Transformer "+i.transformer+" is already installed."),i.isolatedDeclarationTransformer===void 0&&(i.isolatedDeclarationTransformer=await U({message:"Do you want to use an isolated declaration types?",initialValue:!1})),i.isolatedDeclarationTransformer===void 0&&(i.isolatedDeclarationTransformer=await ie({message:"Pick a isolated declaration transformer",options:[{label:"Typescript",value:"typescript"},{label:"swc",value:"swc"},{label:"OXC",value:"oxc"},{label:"None",value:null}]}),i.isolatedDeclarationTransformer!==null)){let v;switch(i.isolatedDeclarationTransformer){case"typescript":{v="typescript";break}case"swc":{v="@swc/core";break}case"oxc":{v="oxc-transform";break}default:ko("Invalid isolated declaration transformer")}v!==void 0&&!s.includes(v)&&await U({message:"Do you want to install "+v+"?"})&&p.push(v)}i.css===void 0&&(i.css=await U({message:"Do you want to use css in your project?",initialValue:!1}));const r=[];if(i.css){const v=await ie({message:"Pick a css loader",options:[{label:"PostCSS",value:"postcss"},{hint:"experimental",label:"Lightning CSS",value:"lightningcss"}]});r.push(v);let y=await mi({message:"Pick your loaders",options:[{label:"Sass",value:"sass"},{label:"Stylus",value:"stylus"},{label:"Less",value:"less"}],required:!1});if(y.includes("sass")){const f=await ie({message:"Pick a sass loader",options:[{label:"Sass embedded",value:"sass-embedded",hint:"recommended"},{label:"Sass",value:"sass"},{label:"Node Sass",value:"node-sass",hint:"legacy"}]});f!=="sass"&&(y=y.filter(x=>x!=="sass"),y.push(f))}if(r.push(...y),await U({message:'Do you want to install "'+r.join('", "')+'"?'}))for(const f of r)p.push(...Ei[f]);r.push("sourceMap")}i.cssMinifier===void 0&&(i.cssMinifier=await U({message:"Do you want to minify your css?",initialValue:!1}));let c;i.cssMinifier&&(c=await ie({message:"Pick a css minifier",options:[{label:"CSSNano",value:"cssnano"},{label:"Lightning CSS",value:"lightningcss"}]}),r.includes("lightningcss")||await U({message:'Do you want to install "'+c+'"?'})&&p.push(c));let m="",d="";if(i.isolatedDeclarationTransformer&&(d+=`,
154
+ `)}},"runBuilder"),T=J(async()=>{if(h!==void 0)await rp({pid:h.pid,signal:p.killSignal??y.killSignal??"SIGTERM"});else if(v!==void 0)try{await v()}catch(R){throw new Error("onSuccess function cleanup failed: "+R.message,{cause:R})}h=void 0,v=void 0},"doOnSuccessCleanup"),B=J(async()=>{if(typeof b.options.onSuccess=="function")try{v=await b.options.onSuccess()}catch(R){throw new Error("onSuccess function failed: "+R.message,{cause:R})}else if(typeof b.options.onSuccess=="string"){const R=b.options.onSuccessTimeout??3e4;if(h=zo(b.options.onSuccess,[],{nodeOptions:{shell:!0,stdio:"inherit",timeout:R}}),await h,h.exitCode&&h.exitCode!==0)throw new Error("onSuccess script failed with exit code "+h.exitCode+". Check the output above for details.")}},"runOnsuccess"),F=Date.now(),ce=J(()=>Nt(Math.floor(Date.now()-F)),"getDuration");if(t==="watch"){if(b.options.rollup.watch===!1)throw new Error("Rollup watch is disabled. You should check your packem.config file.");await ql(b,w,S,B,T),si(b,!1);return}t==="jit"?(await Fl(b),await b.hooks.callHook("build:done",b)):(u=await hl(b,w),await b.hooks.callHook("validate:before",b),Ap(b),await b.hooks.callHook("validate:done",b),si(b,u)),b.logger.raw(`
155
+ ⚡️ Build run in `+ce()),await S(),await B(),ot.on("SIGINT",async()=>{await T()}),ot.on("SIGTERM",async()=>{await T()})}catch(x){throw o.raw(`
156
+ `),ao(x),x}finally{o.restoreAll(),await vp(d,o,u)}},"packem");var Kp=Object.defineProperty,Ae=g((e,t)=>Kp(e,"name",{value:t,configurable:!0}),"o");const Gp=Ae(e=>{e.addCommand({description:"Demonstrate options required",execute:Ae(async({logger:t,options:i})=>{let o="build";i.watch?o="watch":i.jit&&(o="jit");const n={};let a;if(Fe.NODE_ENV&&[Pe,G].includes(Fe.NODE_ENV)&&(a=Fe.NODE_ENV),i.env)for(const s of i.env)if(s.key==="NODE_ENV"){if(a)throw new Error("NODE_ENV was already set, this can't be overridden.");a=s.value}else n["process.env."+s.key]=JSON.stringify(s.value);a===void 0&&(i.production?a=G:i.development&&(a=Pe));try{await Vp(i.dir,o,a,t,{analyze:i.analyze,cjsInterop:i.cjsInterop,clean:i.clean,configPath:i.config??void 0,debug:i.debug,dtsOnly:i.dtsOnly,killSignal:i.killSignal,minify:i.minify===void 0?a===G:i.minify,onSuccess:i.onSuccess,rollup:{esbuild:{target:i.target},license:{path:i.license},metafile:i.metafile,replace:{values:n}},sourcemap:i.metafile||i.analyze||i.sourcemap,tsconfigPath:i.tsconfig??void 0,validation:i.validation===!1?{packageJson:{bin:!1,dependencies:!1,exports:!1,files:!1,main:!1,module:!1,name:!1,types:!1,typesVersions:!1}}:{},...i.typedoc?{typedoc:{format:"html"}}:{}})}catch(s){t.error(s),xo(1)}},"execute"),name:"build",options:[{defaultValue:".",description:"The directory to build",name:"dir",type:String},{alias:"t",description:"Environments to support. `target` in tsconfig.json is automatically added. Defaults to the current Node.js version.",name:"target"},{description:"Use a custom config file",name:"config",type:String},{description:"Path to the tsconfig.json file",name:"tsconfig",type:String},{description:"Minify the output",name:"minify",type:Boolean},{description:"Generate sourcemaps (experimental)",name:"sourcemap",type:Boolean},{conflicts:"jit",description:"Watch for changes",name:"watch",type:Boolean},{conflicts:"watch",description:"Stub the package for JIT compilation",name:"jit",type:Boolean},{description:"Compile-time environment variables (eg. --env.NODE_ENV=production)",multiple:!0,name:"env",type:Ae(t=>{const[i,o]=t.split("=");return{key:i,value:o}},"type")},{defaultValue:!1,description:"Generate meta file (experimental)",name:"metafile",type:Boolean},{description:"Path to the license file",name:"license",type:String},{conflicts:"watch",description:"Visualize and analyze the bundle",name:"analyze",type:Boolean},{description:"CJS interop mode, can export default and named export, (experimental).",name:"cjsInterop",type:Boolean},{conflicts:"development",description:"Run code in production environment",name:"production",type:Boolean},{conflicts:"production",description:"Run code in development environment",name:"development",type:Boolean},{description:"Do not clean the dist directory before building",name:"no-clean",type:Boolean},{description:"Only generate .d.ts files",name:"dts-only",type:Boolean},{description:"Enable or disable the output validation",name:"no-validation",type:Boolean},{description:"Generate type documentation",name:"typedoc",type:Boolean},{description:"Execute command after successful build, specially useful for watch mode",name:"onSuccess",type:String},{description:'Signal to kill child process, "SIGTERM" or "SIGKILL"',name:"killSignal",type:Ae(t=>{if(t==="SIGTERM"||t==="SIGKILL")return t;throw new Error("Invalid kill signal. Use 'SIGTERM' or 'SIGKILL'.")},"type")}]})},"createBuildCommand");var Hp=Object.defineProperty,ze=g((e,t)=>Hp(e,"name",{value:t,configurable:!0}),"m");const Yp=ze(e=>{e.addCommand({description:"Initialize packem configuration",execute:ze(async({logger:t,options:i})=>{if(yo("Welcome to packem setup"),z(j(i.dir,"packem.config.ts"))){t.info("Packem project already initialized, you can use `packem build` to build your project");return}const o=E(ci(),i.dir??"."),n=j(o,"package.json");if(!z(n))throw new Error("No package.json found in the directory");const a=ki(n),s=[];a.dependencies&&s.push(...Object.keys(a.dependencies)),a.devDependencies&&s.push(...Object.keys(a.devDependencies));const l=!!(a.devDependencies?.typescript??a.dependencies?.typescript),p=[];if(i.typescript===void 0&&!l?(i.typescript=await U({message:"Do you want to install TypeScript?"}),i.typescript&&p.push("typescript@latest")):Dt.message("TypeScript version "+(a.devDependencies?.typescript??a.dependencies?.typescript)+" is already installed"),!z(j(o,"tsconfig.json"))){const v=await U({message:"Do you want to use generate a tsconfig.json?"}),x=await U({message:"Do you want to run your code in the DOM?"});if(v){const f=ut();f.start("Generating tsconfig.json"),bt(j(o,"tsconfig.json"),{compilerOptions:{esModuleInterop:!0,skipLibCheck:!0,target:"es2022",allowJs:!0,resolveJsonModule:!0,moduleDetection:"force",isolatedModules:!0,verbatimModuleSyntax:!0,strict:!0,noUncheckedIndexedAccess:!0,noImplicitOverride:!0,module:"NodeNext",outDir:"dist",sourceMap:!0,declaration:!0,lib:x?["es2022","dom","dom.iterable"]:["es2022"]}}),f.stop("")}}if(s.includes("esbuild")?i.transformer="esbuild":s.includes("@swc/core")?i.transformer="swc":s.includes("sucrase")&&(i.transformer="sucrase"),i.transformer===void 0?(i.transformer=await ie({message:"Pick a transformer",options:[{label:"esbuild",value:"esbuild"},{label:"swc",value:"swc"},{label:"Sucrase",value:"sucrase"}]}),i.transformer&&!s.includes(i.transformer)&&await U({message:"Do you want to install "+i.transformer+"?"})&&p.push(i.transformer==="swc"?"@swc/core":i.transformer)):Dt.message("Transformer "+i.transformer+" is already installed."),i.isolatedDeclarationTransformer===void 0&&(i.isolatedDeclarationTransformer=await U({message:"Do you want to use an isolated declaration types?",initialValue:!1})),i.isolatedDeclarationTransformer===void 0&&(i.isolatedDeclarationTransformer=await ie({message:"Pick a isolated declaration transformer",options:[{label:"Typescript",value:"typescript"},{label:"swc",value:"swc"},{label:"OXC",value:"oxc"},{label:"None",value:null}]}),i.isolatedDeclarationTransformer!==null)){let v;switch(i.isolatedDeclarationTransformer){case"typescript":{v="typescript";break}case"swc":{v="@swc/core";break}case"oxc":{v="oxc-transform";break}default:bo("Invalid isolated declaration transformer")}v!==void 0&&!s.includes(v)&&await U({message:"Do you want to install "+v+"?"})&&p.push(v)}i.css===void 0&&(i.css=await U({message:"Do you want to use css in your project?",initialValue:!1}));const r=[];if(i.css){const v=await ie({message:"Pick a css loader",options:[{label:"PostCSS",value:"postcss"},{hint:"experimental",label:"Lightning CSS",value:"lightningcss"}]});r.push(v);let x=await di({message:"Pick your loaders",options:[{label:"Sass",value:"sass"},{label:"Stylus",value:"stylus"},{label:"Less",value:"less"}],required:!1});if(x.includes("sass")){const f=await ie({message:"Pick a sass loader",options:[{label:"Sass embedded",value:"sass-embedded",hint:"recommended"},{label:"Sass",value:"sass"},{label:"Node Sass",value:"node-sass",hint:"legacy"}]});f!=="sass"&&(x=x.filter(y=>y!=="sass"),x.push(f))}if(r.push(...x),await U({message:'Do you want to install "'+r.join('", "')+'"?'}))for(const f of r)p.push(...$i[f]);r.push("sourceMap")}i.cssMinifier===void 0&&(i.cssMinifier=await U({message:"Do you want to minify your css?",initialValue:!1}));let c;i.cssMinifier&&(c=await ie({message:"Pick a css minifier",options:[{label:"CSSNano",value:"cssnano"},{label:"Lightning CSS",value:"lightningcss"}]}),r.includes("lightningcss")||await U({message:'Do you want to install "'+c+'"?'})&&p.push(c));let m="",d="";if(i.isolatedDeclarationTransformer&&(d+=`,
157
157
  isolatedDeclarationTransformer`),(i.css||i.cssMinifier)&&(d+=`,
158
158
  rollup: {
159
- css: {`),i.css){const v=r.map(y=>((y==="sass-embedded"||y==="node-sass")&&(y="sass"),`${y}Loader`)).join(", ");d+=`
159
+ css: {`),i.css){const v=r.map(x=>((x==="sass-embedded"||x==="node-sass")&&(x="sass"),`${x}Loader`)).join(", ");d+=`
160
160
  loaders: [${v}],`}if(i.cssMinifier&&c&&(d+=`
161
161
  minifier: `+c+"Minifier,"),(i.css||i.cssMinifier)&&(d+=`
162
162
  }
163
163
  }`),l||a.type==="module"){let v="";if(i.isolatedDeclarationTransformer&&(v+=`import isolatedDeclarationTransformer from "@visulima/packem/dts/isolated/transformer/${i.isolatedDeclarationTransformer}";
164
- `),i.css)for(let y of r)(y==="sass-embedded"||y==="node-sass")&&(y="sass"),v+=`import ${y}Loader from "@visulima/packem/css/loader/${y.toLowerCase()}";
164
+ `),i.css)for(let x of r)(x==="sass-embedded"||x==="node-sass")&&(x="sass"),v+=`import ${x}Loader from "@visulima/packem/css/loader/${x.toLowerCase()}";
165
165
  `;i.cssMinifier&&c&&(v+=`import ${c}Minifier from "@visulima/packem/css/minifier/${c.toLowerCase()}";
166
166
  `),m=`import { defineConfig } from "@visulima/packem/config";
167
167
  import transformer from "@visulima/packem/transformer/${i.transformer}";
@@ -170,7 +170,7 @@ export default defineConfig({
170
170
  transformer${d}
171
171
  });
172
172
  `}else{let v="";if(i.isolatedDeclarationTransformer&&(v+=`const isolatedDeclarationTransformer = require("@visulima/packem/dts/isolated/transformer/${i.isolatedDeclarationTransformer}");
173
- `),i.css)for(let y of r)(y==="sass-embedded"||y==="node-sass")&&(y="sass"),v+=`const ${y}Loader = require("@visulima/packem/css/loader/${y.toLowerCase()}");
173
+ `),i.css)for(let x of r)(x==="sass-embedded"||x==="node-sass")&&(x="sass"),v+=`const ${x}Loader = require("@visulima/packem/css/loader/${x.toLowerCase()}");
174
174
  `;i.cssMinifier&&c&&(v+=`const ${c}Minifier = require("@visulima/packem/css/minifier/${c.toLowerCase()}");
175
175
  `),m=`const { defineConfig } = require("@visulima/packem/config");
176
176
  const transformer = require("@visulima/packem/transformer/${i.transformer}");
@@ -178,4 +178,4 @@ ${v}
178
178
  module.exports = defineConfig({
179
179
  transformer${d}
180
180
  });
181
- `}const u=ut(),h=l?"ts":"js";p.length>0&&(u.start("Installing packages"),await mt(p,{cwd:o,dev:!0,silent:!0}),u.stop("Installed packages")),u.start("Creating packem.config."+h),le(j(o,"packem.config."+h),m),u.stop("Created packem.config."+h),jo("Now you can run `packem build` to build your project")},"execute"),name:"init",options:[{defaultValue:".",description:"The directory to initialize",name:"dir",type:String},{description:"Choose a transformer",name:"transformer",type:ze(t=>{if(typeof t=="string"&&["esbuild","sucrase","swc"].includes(t))return t;throw new Error("Invalid transformer, please choose one of 'swc', 'sucrase' or 'esbuild'")},"type")},{description:"Choose a isolated declaration transformer",name:"isolated-declaration-transformer",type:ze(t=>{if(typeof t=="string"&&["none","oxc","swc","typescript"].includes(t))return t;throw new Error("Invalid isolated declaration isolated declaration, please choose one of 'none', 'oxc', 'swc' or 'typescript'")},"type")},{description:"Use CSS",name:"css",type:Boolean},{description:"Use CSS minifier",name:"css-minifier",type:Boolean},{Description:"Use TypeScript",name:"typescript",type:Boolean}]})},"createInitCommand"),tt=new ho("packem",{logger:{reporters:[new xo({error:{hideErrorCauseCodeView:!0,hideErrorCodeView:!0,hideErrorErrorsCodeView:!0}})],scope:"packem"},packageName:$n,packageVersion:En});Xp(tt);Gp(tt);Cn(tt);tt.run({shouldExitProcess:!1});
181
+ `}const u=ut(),h=l?"ts":"js";p.length>0&&(u.start("Installing packages"),await mt(p,{cwd:o,dev:!0,silent:!0}),u.stop("Installed packages")),u.start("Creating packem.config."+h),le(j(o,"packem.config."+h),m),u.stop("Created packem.config."+h),wo("Now you can run `packem build` to build your project")},"execute"),name:"init",options:[{defaultValue:".",description:"The directory to initialize",name:"dir",type:String},{description:"Choose a transformer",name:"transformer",type:ze(t=>{if(typeof t=="string"&&["esbuild","sucrase","swc"].includes(t))return t;throw new Error("Invalid transformer, please choose one of 'swc', 'sucrase' or 'esbuild'")},"type")},{description:"Choose a isolated declaration transformer",name:"isolated-declaration-transformer",type:ze(t=>{if(typeof t=="string"&&["none","oxc","swc","typescript"].includes(t))return t;throw new Error("Invalid isolated declaration isolated declaration, please choose one of 'none', 'oxc', 'swc' or 'typescript'")},"type")},{description:"Use CSS",name:"css",type:Boolean},{description:"Use CSS minifier",name:"css-minifier",type:Boolean},{Description:"Use TypeScript",name:"typescript",type:Boolean}]})},"createInitCommand"),tt=new go("packem",{logger:{reporters:[new vo({error:{hideErrorCauseCodeView:!0,hideErrorCodeView:!0,hideErrorErrorsCodeView:!0}})],scope:"packem"},packageName:kn,packageVersion:jn});Yp(tt);Gp(tt);Pn(tt);tt.run({shouldExitProcess:!1});