@visulima/packem 1.8.1 → 1.8.2

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/packem.mjs CHANGED
@@ -1,18 +1,18 @@
1
- var Ei=Object.defineProperty;var f=(e,t)=>Ei(e,"name",{value:t,configurable:!0});import Je,{env as Si,versions as Oi}from"node:process";import{cyan as P,bold as L,gray as Y,green as Pi,yellow as Di,grey as Ni}from"@visulima/colorize";import{findCacheDirSync as Ci}from"@visulima/find-cache-dir";import{readFile as je,isAccessible as _e,writeFile as _i,readFileSync as et,writeFileSync as ae,readJsonSync as Mi,writeJsonSync as Ii,ensureDir as pt,walk as Ti,isAccessibleSync as U,collectSync as Ai,emptyDir as Fi,readJson as Ri,ensureDirSync as zi}from"@visulima/fs";import{formatBytes as G,duration as lt}from"@visulima/humanizer";import{normalize as q,join as $,relative as _,dirname as A,basename as Z,isAbsolute as ve,resolve as S,parse as We,toNamespacedPath as Ee,extname as Me}from"@visulima/path";import{readTsConfig as Ji,findTsConfig as Wi}from"@visulima/tsconfig";import Bi from"browserslist";import{defu as Li}from"defu";import{createHooks as qi}from"hookable";import{createJiti as Rt}from"jiti";import{rollup as zt,watch as ct,VERSION as Ui}from"rollup";import{exec as Ki}from"tinyexec";import{stat as tt,chmod as Vi,readFile as Hi,readdir as Gi,rm as Yi}from"node:fs/promises";import Jt from"@rollup/plugin-alias";import Xi from"@rollup/plugin-commonjs";import Qi from"@rollup/plugin-dynamic-import-vars";import{nodeResolve as Wt}from"@rollup/plugin-node-resolve";import Bt from"@rollup/plugin-replace";import{wasm as Zi}from"@rollup/plugin-wasm";import eo from"rollup-plugin-polyfill-node";import{visualizer as to}from"rollup-plugin-visualizer";import{minVersion as Lt,valid as io,coerce as oo}from"semver";import Se from"node:assert/strict";import{extractAssignedNames as no,createFilter as K}from"@rollup/pluginutils";import ee from"magic-string";import ao from"glob-parent";import{glob as so,isDynamicPattern as dt,globSync as ro}from"tinyglobby";import{isRelative as it,resolveAlias as po}from"@visulima/path/utils";import{d as lo,g as co}from"./packem_shared/index-CsX3kGje.mjs";import{SourceMapGenerator as uo}from"source-map-js";import{m as Ge}from"./packem_shared/sourcemap-DDVjvayf.mjs";import{i as mo,a as fo,b as ut,c as mt,e as Be,d as go,f as X,p as vo,g as ho}from"./packem_shared/Mime-CNzz9C62.mjs";import{n as Le}from"./packem_shared/ensure-auto-modules-9cmxx7iZ.mjs";import{findStaticImports as qt,fileURLToPath as xo,resolveModuleExportNames as yo,resolvePath as ft}from"mlly";import{parseAsync as bo}from"oxc-parser";import{E as te,D as Ie,C as wo,S as ko,R as Ut,a as Oe,P as fe,b as gt,c as re,A as pe}from"./packem_shared/constants-DSQIKVQe.mjs";import $o from"@rollup/plugin-json";import jo from"rollup-plugin-license";import{g as Eo,d as So}from"./packem_shared/create-or-update-key-storage-BxGi6kMH.mjs";import{readdirSync as Oo,createReadStream as Po,createWriteStream as Do,existsSync as No}from"node:fs";import vt,{isBuiltin as qe}from"node:module";import{fileURLToPath as Co}from"node:url";import{loadSourceMap as _o}from"@visulima/source-map";import{parse as Mo}from"@babel/parser";import Io from"node:crypto";import To from"node:child_process";import{parsePackageJson as Ao}from"@visulima/package/package-json";import{NotFoundError as Fo}from"@visulima/fs/error";import{distance as Ro}from"fastest-levenshtein";import __cjs_url__ from "node:url"; // -- packem CommonJS __filename shim --
1
+ var $i=Object.defineProperty;var g=(e,t)=>$i(e,"name",{value:t,configurable:!0});import Je,{env as ji,versions as Ei}from"node:process";import{cyan as P,bold as L,gray as Y,green as Si,yellow as Oi,grey as Di}from"@visulima/colorize";import{findCacheDirSync as Pi}from"@visulima/find-cache-dir";import{readFile as $e,isAccessible as Ce,writeFile as Ni,readFileSync as Ze,writeFileSync as ae,readJsonSync as Ci,writeJsonSync as _i,ensureDir as rt,walk as Mi,isAccessibleSync as U,collectSync as Ii,emptyDir as Ti,readJson as Ai,ensureDirSync as Fi}from"@visulima/fs";import{formatBytes as G,duration as pt}from"@visulima/humanizer";import{normalize as q,join as $,relative as _,dirname as A,basename as Z,isAbsolute as _e,resolve as O,parse as We,toNamespacedPath as je,extname as Me}from"@visulima/path";import{readTsConfig as Ri,findTsConfig as zi}from"@visulima/tsconfig";import Ji from"browserslist";import{defu as Wi}from"defu";import{createHooks as Bi}from"hookable";import{createJiti as At}from"jiti";import{rollup as Ft,watch as lt,VERSION as Li}from"rollup";import{exec as qi}from"tinyexec";import{stat as et,chmod as Ui,readFile as Ki,readdir as Vi,rm as Hi}from"node:fs/promises";import Rt from"@rollup/plugin-alias";import Gi from"@rollup/plugin-commonjs";import Yi from"@rollup/plugin-dynamic-import-vars";import{nodeResolve as zt}from"@rollup/plugin-node-resolve";import Jt from"@rollup/plugin-replace";import{wasm as Xi}from"@rollup/plugin-wasm";import Qi from"rollup-plugin-polyfill-node";import{visualizer as Zi}from"rollup-plugin-visualizer";import{minVersion as Wt,valid as eo,coerce as to}from"semver";import Ee from"node:assert/strict";import{extractAssignedNames as io,createFilter as K}from"@rollup/pluginutils";import ee from"magic-string";import oo from"glob-parent";import{glob as no,isDynamicPattern as ct,globSync as ao}from"tinyglobby";import{isRelative as tt,resolveAlias as so}from"@visulima/path/utils";import{d as ro,g as po}from"./packem_shared/index-CsX3kGje.mjs";import{SourceMapGenerator as lo}from"source-map-js";import{m as He}from"./packem_shared/sourcemap-DDVjvayf.mjs";import{i as co,a as uo,b as dt,c as ut,e as Be,d as mo,f as X,p as fo,g as go}from"./packem_shared/Mime-CNzz9C62.mjs";import{n as Le}from"./packem_shared/ensure-auto-modules-9cmxx7iZ.mjs";import{findStaticImports as Bt,fileURLToPath as vo,resolveModuleExportNames as ho,resolvePath as mt}from"mlly";import{parseAsync as xo}from"oxc-parser";import{E as te,D as Ie,C as yo,S as bo,R as Lt,a as Se,P as fe,b as ft,c as re,A as pe}from"./packem_shared/constants-DSQIKVQe.mjs";import wo from"@rollup/plugin-json";import ko from"rollup-plugin-license";import{g as $o,d as jo}from"./packem_shared/create-or-update-key-storage-BxGi6kMH.mjs";import{readdirSync as Eo,createReadStream as So,createWriteStream as Oo,existsSync as Do}from"node:fs";import gt,{isBuiltin as qe}from"node:module";import{fileURLToPath as Po}from"node:url";import{loadSourceMap as No}from"@visulima/source-map";import{parse as Co}from"@babel/parser";import _o from"node:crypto";import Mo from"child_process";import{parsePackageJson as Io}from"@visulima/package/package-json";import{NotFoundError as To}from"@visulima/fs/error";import{distance as Ao}from"fastest-levenshtein";import __cjs_url__ from "node:url"; // -- packem CommonJS __filename shim --
2
2
  import __cjs_path__ from "node:path"; // -- packem CommonJS __dirname shim --
3
3
  import __cjs_mod__ from "node:module"; // -- packem CommonJS require shim --
4
4
  const __filename = __cjs_url__.fileURLToPath(import.meta.url);
5
5
  const __dirname = __cjs_path__.dirname(__filename);
6
6
  const require = __cjs_mod__.createRequire(import.meta.url);
7
- var zo=Object.defineProperty,Jo=f((e,t)=>zo(e,"name",{value:t,configurable:!0}),"a$l");const ge=Jo(e=>e==null?[]:Array.isArray(e)?e:[e],"arrayify");var Wo=Object.defineProperty,Kt=f((e,t)=>Wo(e,"name",{value:t,configurable:!0}),"s$g");const Bo=Kt((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 r=e(...n);return o.set(a,r),r}},"memoize"),Lo=Kt(e=>{const t=new Map;return i=>Bo(e,i,t)},"memoizeByKey");var qo=Object.defineProperty,he=f((e,t)=>qo(e,"name",{value:t,configurable:!0}),"r$e");const Uo=he(function*(e){switch(e.declaration?.type){case"ClassDeclaration":case"FunctionDeclaration":{const{id:t}=e.declaration;Se(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 no(t.id))yield i;break}}},"exportName"),Ko=he(function*(e){if(e.declaration)for(const t of Uo(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"),Vo=he(function*(e){e.exported?yield{exportedName:e.exported.name,from:"self",type:"named"}:yield{from:"other",source:e.source.value,type:"barrel"}},"parseExportAll"),Ho=he(function*(){yield{exportedName:"default",from:"self",type:"named"}},"parseExportDefault"),Go=he(function*(e,t){Se(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*Vo(o);break}case"ExportDefaultDeclaration":{yield*Ho();break}case"ExportNamedDeclaration":{yield*Ko(o);break}}},"parseExports");var Yo=Object.defineProperty,xe=f((e,t)=>Yo(e,"name",{value:t,configurable:!0}),"n$b");const Vt=xe(async function(e,t,i){const o=await e.resolve(t,i.id);if(Se(o,`Rollup can't resolve ${t} from ${i.id}`),o.external)return null;const n=await e.load(o);return Se(n,`Rollup doesn't have a module for id ${o.id}`),n},"getImportedModule"),Xo=xe(async function*(e,t,i){const o=await Vt(e,t.source,i);o&&(yield*ot(e,o))},"gatherBarrelReExports"),Qo=xe(async function*(e,t,i){const o=await Vt(e,t.source,i);if(!o)return;const n=new Map(t.bindings.map(a=>[a.importedName,a]));for await(const a of ot(e,o)){const s=n.get(a.exportedName);s&&(yield{...a,exportedName:s.exportedName})}},"gatherNamedReExports"),Zo=xe(async function*(e,t){yield{exportedName:t.exportedName,id:e.id,sourceName:t.exportedName}},"gatherNamedSelfExports"),ot=xe(async function*(e,t){for(const i of Go(e,t))i.from==="self"?yield*Zo(t,i):i.type==="barrel"?yield*Xo(e,i,t):yield*Qo(e,i,t)},"gatherExports");var en=Object.defineProperty,tn=f((e,t)=>en(e,"name",{value:t,configurable:!0}),"r$d");const on=tn(()=>({moduleParsed:{async handler(e){if(e.isEntry)for await(const t of ot(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 nn=Object.defineProperty,an=f((e,t)=>nn(e,"name",{value:t,configurable:!0}),"r$c");const sn=an((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 rn=Object.defineProperty,pn=f((e,t)=>rn(e,"name",{value:t,configurable:!0}),"a$k");const Ht=pn(e=>{const t=sn(/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 ee(e);return n.replace(new RegExp(`(,s)?${o} as default(,)?`),""),n.replace(new RegExp(`export default ${o};
7
+ var Fo=Object.defineProperty,Ro=g((e,t)=>Fo(e,"name",{value:t,configurable:!0}),"a$n");const ge=Ro(e=>e==null?[]:Array.isArray(e)?e:[e],"arrayify");var zo=Object.defineProperty,qt=g((e,t)=>zo(e,"name",{value:t,configurable:!0}),"s$g");const Jo=qt((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 r=e(...n);return o.set(a,r),r}},"memoize"),Wo=qt(e=>{const t=new Map;return i=>Jo(e,i,t)},"memoizeByKey");var Bo=Object.defineProperty,ve=g((e,t)=>Bo(e,"name",{value:t,configurable:!0}),"r$e");const Lo=ve(function*(e){switch(e.declaration?.type){case"ClassDeclaration":case"FunctionDeclaration":{const{id:t}=e.declaration;Ee(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 io(t.id))yield i;break}}},"exportName"),qo=ve(function*(e){if(e.declaration)for(const t of Lo(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"),Uo=ve(function*(e){e.exported?yield{exportedName:e.exported.name,from:"self",type:"named"}:yield{from:"other",source:e.source.value,type:"barrel"}},"parseExportAll"),Ko=ve(function*(){yield{exportedName:"default",from:"self",type:"named"}},"parseExportDefault"),Vo=ve(function*(e,t){Ee(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*Uo(o);break}case"ExportDefaultDeclaration":{yield*Ko();break}case"ExportNamedDeclaration":{yield*qo(o);break}}},"parseExports");var Ho=Object.defineProperty,he=g((e,t)=>Ho(e,"name",{value:t,configurable:!0}),"n$b");const Ut=he(async function(e,t,i){const o=await e.resolve(t,i.id);if(Ee(o,`Rollup can't resolve ${t} from ${i.id}`),o.external)return null;const n=await e.load(o);return Ee(n,`Rollup doesn't have a module for id ${o.id}`),n},"getImportedModule"),Go=he(async function*(e,t,i){const o=await Ut(e,t.source,i);o&&(yield*it(e,o))},"gatherBarrelReExports"),Yo=he(async function*(e,t,i){const o=await Ut(e,t.source,i);if(!o)return;const n=new Map(t.bindings.map(a=>[a.importedName,a]));for await(const a of it(e,o)){const s=n.get(a.exportedName);s&&(yield{...a,exportedName:s.exportedName})}},"gatherNamedReExports"),Xo=he(async function*(e,t){yield{exportedName:t.exportedName,id:e.id,sourceName:t.exportedName}},"gatherNamedSelfExports"),it=he(async function*(e,t){for(const i of Vo(e,t))i.from==="self"?yield*Xo(t,i):i.type==="barrel"?yield*Go(e,i,t):yield*Yo(e,i,t)},"gatherExports");var Qo=Object.defineProperty,Zo=g((e,t)=>Qo(e,"name",{value:t,configurable:!0}),"r$d");const en=Zo(()=>({moduleParsed:{async handler(e){if(e.isEntry)for await(const t of it(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 tn=Object.defineProperty,on=g((e,t)=>tn(e,"name",{value:t,configurable:!0}),"r$c");const nn=on((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 an=Object.defineProperty,sn=g((e,t)=>an(e,"name",{value:t,configurable:!0}),"a$m");const Kt=sn(e=>{const t=nn(/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 ee(e);return n.replace(new RegExp(`(,s)?${o} as default(,)?`),""),n.replace(new RegExp(`export default ${o};
8
8
  ?`),""),n.append(`
9
9
 
10
- export = `+o+";"),{code:n.toString().replace(/export\s\{\s\s\};/,""),map:n.generateMap({hires:!0})}}return null},"patchCjsDefaultExport");var ln=Object.defineProperty,ht=f((e,t)=>ln(e,"name",{value:t,configurable:!0}),"i$b");const Gt=ht(({addDefaultProperty:e=!1,logger:t,type:i})=>({name:"packem:cjs-interop",renderChunk:ht(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 r=new ee(o);r.replace("Object.defineProperty(exports, '__esModule', { value: true });",""),r.replaceAll(/exports\.(.*) = (.*);/g,"module.exports.$1 = $2;"),e&&r.append(`
11
- module.exports.default = `+s[2]+";");let l=r.toString();return l=l.replace(/(?:module\.)?exports(?:\['default'\]|\.default)/i,"module.exports"),t.debug({message:"Applied CommonJS interop to entry chunk "+n.fileName+".",prefix:"plugin:cjs-interop"}),{code:l,map:r.generateMap({hires:!0})}}return a.format==="es"&&/\.d\.(?:ts|cts)$/.test(n.fileName)?i!=="commonjs"&&n.fileName.endsWith(".d.mts")?null:Ht(o):null},"renderChunk")}),"cjsInteropPlugin");var cn=Object.defineProperty,dn=f((e,t)=>cn(e,"name",{value:t,configurable:!0}),"f$f");const un=dn((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(r=>({...s,src:r})):s).map(async s=>await so(ge(s.src),{ignore:ge(s.exclude).filter(Boolean)}).then(r=>({dest:s.dest??"",parent:ao(s.src),src:r}))));for(const s of a)for(const r of s.src){let l;i.has(r)?l=i.get(r):(l={copied:[],dest:[],timestamp:0},i.set(r,l));const p=o.flatten?q(s.dest):$(s.dest,_(s.parent,A(r)));l.dest.includes(p)||l.dest.push(p),this.addWatchFile(r)}t.info({message:"Copying files...",prefix:"plugin:copy"}),await Promise.all([...i].map(async([s,r])=>{let l;try{const p=await tt(s);if(!p.isFile())return;const c=p.mtime.getTime();c>r.timestamp&&(r.timestamp=c,r.copied=[]),l=await je(s,{buffer:!0})}catch(p){t.error({context:[p],message:`error reading file ${s}`,prefix:"plugin:copy"});return}for(const p of r.dest){if(o.copyOnce&&r.copied.includes(p))continue;const c=Z(s),u=$(p,c);try{this.emitFile({[o.exactFileNames?"fileName":"name"]:u,source:l,type:"asset"}),t.debug({message:`copied ${s} → ${u}`,prefix:"plugin:copy"}),r.copied.push(p)}catch(d){t.error({context:[d],message:`error copying file ${s} → ${u}`,prefix:"plugin:copy"})}}}))},name:"packem:copy"}},"copyPlugin");var mn=Object.defineProperty,fn=f((e,t)=>mn(e,"name",{value:t,configurable:!0}),"r$b");const xt=fn((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 gn=Object.defineProperty,vn=f((e,t)=>gn(e,"name",{value:t,configurable:!0}),"a$j");const hn=4,xn=process.env.UV_THREADPOOL_SIZE?Number.parseInt(process.env.UV_THREADPOOL_SIZE,10):hn;let yn=class{static{f(this,"f")}static{vn(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(xt(t,i.test))return!0;return!1}async process(t,i){this.workQueue||(this.workQueue=new lo({concurrency:xn-1}));for await(const[o,n]of this.loaders){const a={...i,options:this.options[o]??{}};if(n.alwaysProcess||xt(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}};var bn=Object.defineProperty,wn=f((e,t)=>bn(e,"name",{value:t,configurable:!0}),"u$b");const kn=wn(async e=>{const t=new uo({file:""}),i=[];let o=0;for await(const{css:n,map:a}of e){i.push(n);const s=Ge(a),r=s.toObject();if(!r)continue;const l=s.toConsumer();if(l){if(l.eachMapping(p=>{t.addMapping({generated:{column:p.generatedColumn,line:o+p.generatedLine},name:p.name,original:{column:p.originalColumn,line:p.originalLine},source:p.source})}),r.sourcesContent)for(const p of r.sources)t.setSourceContent(p,l.sourceContentFor(p,!0));o+=n.split(`
10
+ export = `+o+";"),{code:n.toString().replace(/export\s\{\s\s\};/,""),map:n.generateMap({hires:!0})}}return null},"patchCjsDefaultExport");var rn=Object.defineProperty,vt=g((e,t)=>rn(e,"name",{value:t,configurable:!0}),"i$b");const Vt=vt(({addDefaultProperty:e=!1,logger:t,type:i})=>({name:"packem:cjs-interop",renderChunk:vt(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 r=new ee(o);r.replace("Object.defineProperty(exports, '__esModule', { value: true });",""),r.replaceAll(/exports\.(.*) = (.*);/g,"module.exports.$1 = $2;"),e&&r.append(`
11
+ module.exports.default = `+s[2]+";");let l=r.toString();return l=l.replace(/(?:module\.)?exports(?:\['default'\]|\.default)/i,"module.exports"),t.debug({message:"Applied CommonJS interop to entry chunk "+n.fileName+".",prefix:"plugin:cjs-interop"}),{code:l,map:r.generateMap({hires:!0})}}return a.format==="es"&&/\.d\.(?:ts|cts)$/.test(n.fileName)?i!=="commonjs"&&n.fileName.endsWith(".d.mts")?null:Kt(o):null},"renderChunk")}),"cjsInteropPlugin");var pn=Object.defineProperty,ln=g((e,t)=>pn(e,"name",{value:t,configurable:!0}),"f$f");const cn=ln((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(r=>({...s,src:r})):s).map(async s=>await no(ge(s.src),{ignore:ge(s.exclude).filter(Boolean)}).then(r=>({dest:s.dest??"",parent:oo(s.src),src:r}))));for(const s of a)for(const r of s.src){let l;i.has(r)?l=i.get(r):(l={copied:[],dest:[],timestamp:0},i.set(r,l));const p=o.flatten?q(s.dest):$(s.dest,_(s.parent,A(r)));l.dest.includes(p)||l.dest.push(p),this.addWatchFile(r)}t.info({message:"Copying files...",prefix:"plugin:copy"}),await Promise.all([...i].map(async([s,r])=>{let l;try{const p=await et(s);if(!p.isFile())return;const c=p.mtime.getTime();c>r.timestamp&&(r.timestamp=c,r.copied=[]),l=await $e(s,{buffer:!0})}catch(p){t.error({context:[p],message:`error reading file ${s}`,prefix:"plugin:copy"});return}for(const p of r.dest){if(o.copyOnce&&r.copied.includes(p))continue;const c=Z(s),u=$(p,c);try{this.emitFile({[o.exactFileNames?"fileName":"name"]:u,source:l,type:"asset"}),t.debug({message:`copied ${s} → ${u}`,prefix:"plugin:copy"}),r.copied.push(p)}catch(d){t.error({context:[d],message:`error copying file ${s} → ${u}`,prefix:"plugin:copy"})}}}))},name:"packem:copy"}},"copyPlugin");var dn=Object.defineProperty,un=g((e,t)=>dn(e,"name",{value:t,configurable:!0}),"r$b");const ht=un((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 mn=Object.defineProperty,fn=g((e,t)=>mn(e,"name",{value:t,configurable:!0}),"a$l");const gn=4,vn=process.env.UV_THREADPOOL_SIZE?Number.parseInt(process.env.UV_THREADPOOL_SIZE,10):gn;let hn=class{static{g(this,"f")}static{fn(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(ht(t,i.test))return!0;return!1}async process(t,i){this.workQueue||(this.workQueue=new ro({concurrency:vn-1}));for await(const[o,n]of this.loaders){const a={...i,options:this.options[o]??{}};if(n.alwaysProcess||ht(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}};var xn=Object.defineProperty,yn=g((e,t)=>xn(e,"name",{value:t,configurable:!0}),"u$c");const bn=yn(async e=>{const t=new lo({file:""}),i=[];let o=0;for await(const{css:n,map:a}of e){i.push(n);const s=He(a),r=s.toObject();if(!r)continue;const l=s.toConsumer();if(l){if(l.eachMapping(p=>{t.addMapping({generated:{column:p.generatedColumn,line:o+p.generatedLine},name:p.name,original:{column:p.originalColumn,line:p.originalLine},source:p.source})}),r.sourcesContent)for(const p of r.sources)t.setSourceContent(p,l.sourceContentFor(p,!0));o+=n.split(`
12
12
  `).length}}return{css:i.join(`
13
- `),map:t}},"concat");var $n=Object.defineProperty,ce=f((e,t)=>$n(e,"name",{value:t,configurable:!0}),"b$3");const jn=ce(async(e,t)=>e.sort((i,o)=>t.indexOf(i.name)-t.indexOf(o.name)),"sortByNameOrder"),En=ce(async(e,t,i,o,n,a,s,r,l,p)=>{const c={...p,...e.alias},u=K(e.include,e.exclude),d=mo(e.sourceMap),m={...fo(e.mode),autoModules:e.autoModules??!1,dts:e.dts,extensions:e.extensions,namedExports:e.namedExports};typeof m.inject=="object"&&m.inject.treeshakeable&&(m.namedExports=!1,t.info({message:"Disabling named exports due to `inject.treeshakeable` option",prefix:"css"}));let h=!1;if(e.loaders)for(const g of e.loaders)g.name==="postcss"&&(h=!0);else e.loaders=[];h&&(m.postcss={...e.postcss,config:ut(e.postcss?.config,{}),import:mt(e.postcss?.import,c),modules:ut(e.postcss?.modules,void 0),to:e.postcss?.to,url:mt(e.postcss?.url,c)},e.postcss?.parser&&(m.postcss.parser=await Be(e.postcss.parser,"parser",o)),e.postcss?.syntax&&(m.postcss.syntax=await Be(e.postcss.syntax,"syntax",o)),e.postcss?.stringifier&&(m.postcss.stringifier=await Be(e.postcss.stringifier,"stringifier",o)),e.postcss?.plugins&&(m.postcss.plugins=await go(e.postcss.plugins,o)));const y=new yn({extensions:m.extensions,loaders:await jn(e.loaders,["sourcemap","stylus","less","sass","postcss"]),logger:t,options:{...e,...m,alias:c}});let b=[];const v=ce((g,w)=>{const k=[];for(const x of Object.keys(g)){const D=new Set;let M=[x];do{const J=[];for(const F of M){if(D.has(F))continue;if(y.isSupported(F)){u(F)&&J.push(F);continue}D.add(F);const oe=w(F);oe&&J.push(...oe.importedIds)}M=J}while(M.some(J=>!y.isSupported(J)));k.push(...M)}return k},"traverseImportedModules");return{augmentChunkHash(g){if(b.length===0)return null;const w=v(g.modules,this.getModuleInfo),k=b.filter(x=>w.includes(x.id)).sort((x,D)=>w.lastIndexOf(x.id)-w.lastIndexOf(D.id)).map(x=>`${Z(x.id)}:${x.css}`);return k.length===0?null:k.join(":")},async generateBundle(g,w){if(b.length===0||!(g.dir||g.file))return;const k=Object.values(w),x=g.dir??A(g.file),D=k.filter(E=>E.type==="chunk"),M=D.filter(E=>!E.facadeModuleId),J=g.preserveModules?D:D.filter(E=>E.isEntry||E.isDynamicEntry),F=[],oe=ce(async(E,N)=>{const j=typeof m.extract=="string"?q(m.extract).replace(/^\.[/\\]/,""):q(`${E}.css`);ve(j)&&this.error(["Extraction path must be relative to the output directory,",`which is ${_(o,x)}`].join(`
14
- `)),it(j)&&this.error(["Extraction path must be nested inside output directory,",`which is ${_(o,x)}`].join(`
15
- `));const W=b.filter(B=>N.includes(B.id)).sort((B,ne)=>N.lastIndexOf(B.id)-N.lastIndexOf(ne.id)),ye=await kn(W);return{css:ye.css,map:Ge(ye.map.toString()).relative(A(S(x,j))).toString(),name:j}},"getExtractedData"),R=ce(E=>{if(g.file)return We(g.file).name;if(g.preserveModules){const{dir:N,name:j}=We(E.fileName);return N?$(N,j):j}return E.name},"getName"),H=[];if(typeof m.extract=="string"){t.debug({message:`Extracting to ${m.extract}`,prefix:"css"});const E=[];for(const j of M){const W=v(j.modules,this.getModuleInfo);H.push(...W),E.push(...W)}for(const j of J)E.push(...v(j.modules,this.getModuleInfo).filter(W=>!H.includes(W)));const N=R(D[0]);F.push([N,E])}else{t.debug({message:"Extracting to individual files",prefix:"css"});for(const E of M){const N=v(E.modules,this.getModuleInfo);if(N.length===0)continue;H.push(...N);const j=R(E);F.push([j,N])}for(const E of J){const N=v(E.modules,this.getModuleInfo).filter(W=>!H.includes(W));if(N.length===0)continue;const j=R(E);F.push([j,N])}}for await(const[E,N]of F){const j=await oe(E,N);if(typeof e.onExtract=="function"&&!e.onExtract(j))continue;if(l&&e.minifier){t.info({message:`Minifying ${j.name} with ${e.minifier.name}`,prefix:"css"});const{css:B,map:ne}=await e.minifier.handler.bind({browserTargets:i,warn:this.warn.bind(this)})(j,d,e[e.minifier.name]??{});j.css=B,j.map=ne}const W={fileName:j.name,name:j.name,names:[j.name],originalFileName:j.name,originalFileNames:[j.name],source:j.css,type:"asset"},ye=this.emitFile(W);if(j.map&&d){const B=this.getFileName(ye),ne=typeof g.assetFileNames=="string"?q(A(g.assetFileNames)):typeof g.assetFileNames=="function"?q(A(g.assetFileNames(W))):"assets",se=Ge(j.map).modify(C=>(C.file=Z(B),C)).modifySources(C=>{if(C==="<no source>"||ne.length<=1)return C;C=`../${C}`;for(const ze of ne)ze==="/"&&(C=`../${C}`);return C});if(d.inline)se.modify(C=>d.transform?.(C,q($(x,B)))),w[B].source+=se.toCommentData();else{const C=`${B}.map`;se.modify(ji=>d.transform?.(ji,q($(x,C)))),this.emitFile({fileName:C,source:se.toString(),type:"asset"});const{base:ze}=We(C);w[B].source+=se.toCommentFile(ze)}}}},name:"packem:css",async transform(g,w){if(!u(w)||!y.isSupported(w)||g.replaceAll(/\s/g,"")==="")return null;try{return this.parse(g,{}),this.warn(`Skipping processed file ${_(o,w)}`),null}catch{}typeof e.onImport=="function"&&e.onImport(g,w);const k={alias:c,assets:new Map,autoModules:m.autoModules,browserTargets:i,cwd:o,debug:r,deps:new Set,dts:m.dts,emit:m.emit,environment:a,extensions:m.extensions,extract:m.extract,id:w,inject:m.inject,logger:t,namedExports:m.namedExports,options:{},plugin:this,sourceDir:n,sourceMap:d,useSourcemap:s,warn:this.warn.bind(this)},x=await y.process({code:g},k);for(const D of k.deps)this.addWatchFile(D);for(const[D,M]of k.assets)this.emitFile({fileName:D,source:M,type:"asset"});if(x.extracted){const{id:D}=x.extracted;b=b.filter(M=>M.id!==D),b.push(x.extracted)}return{code:x.code,map:d&&x.map?x.map:{mappings:""},meta:{styles:x.meta},moduleSideEffects:x.extracted?!0:null}}}},"default");var Sn=Object.defineProperty,On=f((e,t)=>Sn(e,"name",{value:t,configurable:!0}),"u$a");const Pn=`
13
+ `),map:t}},"concat");var wn=Object.defineProperty,ce=g((e,t)=>wn(e,"name",{value:t,configurable:!0}),"b$3");const kn=ce(async(e,t)=>e.sort((i,o)=>t.indexOf(i.name)-t.indexOf(o.name)),"sortByNameOrder"),$n=ce(async(e,t,i,o,n,a,s,r,l,p)=>{const c={...p,...e.alias},u=K(e.include,e.exclude),d=co(e.sourceMap),m={...uo(e.mode),autoModules:e.autoModules??!1,dts:e.dts,extensions:e.extensions,namedExports:e.namedExports};typeof m.inject=="object"&&m.inject.treeshakeable&&(m.namedExports=!1,t.info({message:"Disabling named exports due to `inject.treeshakeable` option",prefix:"css"}));let b=!1;if(e.loaders)for(const v of e.loaders)v.name==="postcss"&&(b=!0);else e.loaders=[];b&&(m.postcss={...e.postcss,config:dt(e.postcss?.config,{}),import:ut(e.postcss?.import,c),modules:dt(e.postcss?.modules,void 0),to:e.postcss?.to,url:ut(e.postcss?.url,c)},e.postcss?.parser&&(m.postcss.parser=await Be(e.postcss.parser,"parser",o)),e.postcss?.syntax&&(m.postcss.syntax=await Be(e.postcss.syntax,"syntax",o)),e.postcss?.stringifier&&(m.postcss.stringifier=await Be(e.postcss.stringifier,"stringifier",o)),e.postcss?.plugins&&(m.postcss.plugins=await mo(e.postcss.plugins,o)));const w=new hn({extensions:m.extensions,loaders:await kn(e.loaders,["sourcemap","stylus","less","sass","postcss"]),logger:t,options:{...e,...m,alias:c}});let x=[];const f=ce((v,y)=>{const k=[];for(const h of Object.keys(v)){const E=new Set;let M=[h];do{const J=[];for(const F of M){if(E.has(F))continue;if(w.isSupported(F)){u(F)&&J.push(F);continue}E.add(F);const oe=y(F);oe&&J.push(...oe.importedIds)}M=J}while(M.some(J=>!w.isSupported(J)));k.push(...M)}return k},"traverseImportedModules");return{augmentChunkHash(v){if(x.length===0)return null;const y=f(v.modules,this.getModuleInfo),k=x.filter(h=>y.includes(h.id)).sort((h,E)=>y.lastIndexOf(h.id)-y.lastIndexOf(E.id)).map(h=>`${Z(h.id)}:${h.css}`);return k.length===0?null:k.join(":")},async generateBundle(v,y){if(x.length===0||!(v.dir||v.file))return;const k=Object.values(y),h=v.dir??A(v.file),E=k.filter(S=>S.type==="chunk"),M=E.filter(S=>!S.facadeModuleId),J=v.preserveModules?E:E.filter(S=>S.isEntry||S.isDynamicEntry),F=[],oe=ce(async(S,N)=>{const j=typeof m.extract=="string"?q(m.extract).replace(/^\.[/\\]/,""):q(`${S}.css`);_e(j)&&this.error(["Extraction path must be relative to the output directory,",`which is ${_(o,h)}`].join(`
14
+ `)),tt(j)&&this.error(["Extraction path must be nested inside output directory,",`which is ${_(o,h)}`].join(`
15
+ `));const W=x.filter(B=>N.includes(B.id)).sort((B,ne)=>N.lastIndexOf(B.id)-N.lastIndexOf(ne.id)),xe=await bn(W);return{css:xe.css,map:He(xe.map.toString()).relative(A(O(h,j))).toString(),name:j}},"getExtractedData"),R=ce(S=>{if(v.file)return We(v.file).name;if(v.preserveModules){const{dir:N,name:j}=We(S.fileName);return N?$(N,j):j}return S.name},"getName"),H=[];if(typeof m.extract=="string"){t.debug({message:`Extracting to ${m.extract}`,prefix:"css"});const S=[];for(const j of M){const W=f(j.modules,this.getModuleInfo);H.push(...W),S.push(...W)}for(const j of J)S.push(...f(j.modules,this.getModuleInfo).filter(W=>!H.includes(W)));const N=R(E[0]);F.push([N,S])}else{t.debug({message:"Extracting to individual files",prefix:"css"});for(const S of M){const N=f(S.modules,this.getModuleInfo);if(N.length===0)continue;H.push(...N);const j=R(S);F.push([j,N])}for(const S of J){const N=f(S.modules,this.getModuleInfo).filter(W=>!H.includes(W));if(N.length===0)continue;const j=R(S);F.push([j,N])}}for await(const[S,N]of F){const j=await oe(S,N);if(typeof e.onExtract=="function"&&!e.onExtract(j))continue;if(l&&e.minifier){t.info({message:`Minifying ${j.name} with ${e.minifier.name}`,prefix:"css"});const{css:B,map:ne}=await e.minifier.handler.bind({browserTargets:i,warn:this.warn.bind(this)})(j,d,e[e.minifier.name]??{});j.css=B,j.map=ne}const W={fileName:j.name,name:j.name,names:[j.name],originalFileName:j.name,originalFileNames:[j.name],source:j.css,type:"asset"},xe=this.emitFile(W);if(j.map&&d){const B=this.getFileName(xe),ne=typeof v.assetFileNames=="string"?q(A(v.assetFileNames)):typeof v.assetFileNames=="function"?q(A(v.assetFileNames(W))):"assets",se=He(j.map).modify(C=>(C.file=Z(B),C)).modifySources(C=>{if(C==="<no source>"||ne.length<=1)return C;C=`../${C}`;for(const ze of ne)ze==="/"&&(C=`../${C}`);return C});if(d.inline)se.modify(C=>d.transform?.(C,q($(h,B)))),y[B].source+=se.toCommentData();else{const C=`${B}.map`;se.modify(ki=>d.transform?.(ki,q($(h,C)))),this.emitFile({fileName:C,source:se.toString(),type:"asset"});const{base:ze}=We(C);y[B].source+=se.toCommentFile(ze)}}}},name:"packem:css",async transform(v,y){if(!u(y)||!w.isSupported(y)||v.replaceAll(/\s/g,"")==="")return null;try{return this.parse(v,{}),this.warn(`Skipping processed file ${_(o,y)}`),null}catch{}typeof e.onImport=="function"&&e.onImport(v,y);const k={alias:c,assets:new Map,autoModules:m.autoModules,browserTargets:i,cwd:o,debug:r,deps:new Set,dts:m.dts,emit:m.emit,environment:a,extensions:m.extensions,extract:m.extract,id:y,inject:m.inject,logger:t,namedExports:m.namedExports,options:{},plugin:this,sourceDir:n,sourceMap:d,useSourcemap:s,warn:this.warn.bind(this)},h=await w.process({code:v},k);for(const E of k.deps)this.addWatchFile(E);for(const[E,M]of k.assets)this.emitFile({fileName:E,source:M,type:"asset"});if(h.extracted){const{id:E}=h.extracted;x=x.filter(M=>M.id!==E),x.push(h.extracted)}return{code:h.code,map:d&&h.map?h.map:{mappings:""},meta:{styles:h.meta},moduleSideEffects:h.extracted?!0:null}}}},"default");var jn=Object.defineProperty,En=g((e,t)=>jn(e,"name",{value:t,configurable:!0}),"u$b");const Sn=`
16
16
  /* eslint-disable */
17
17
  /* prettier-ignore */
18
18
  // @ts-nocheck
@@ -20,49 +20,49 @@ module.exports.default = `+s[2]+";");let l=r.toString();return l=l.replace(/(?:m
20
20
  * Generated by packem
21
21
  * @see https://npmjs.com/@visulima/packem
22
22
  */
23
- `.trim(),Dn=On((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=Le(e.postcss.modules.include,a):e.lightningcss&&typeof e.lightningcss.modules=="object"&&(s=Le(e.lightningcss.modules.include,a)),e.autoModules&&s===void 0&&(s=Le(e.autoModules,a)),!s)return null;const{types:r}=this.getModuleInfo(a)?.meta.styles??{};return r===void 0||await _e(a)&&(await _i(a+".d.ts",`${Pn}
24
- ${r}`),i.info({message:`Generated types for ${q(a).replace(t+"/","")}`,prefix:"dts:css-modules"}),this.addWatchFile(a+".d.ts")),null}}},"cssModulesTypes");var Nn=Object.defineProperty,Te=f((e,t)=>Nn(e,"name",{value:t,configurable:!0}),"t$a");const Cn=/\Wrequire(?:\.resolve)?\(/,_n=Te((e,t)=>{if(Si.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),Cn.test(e)&&(n=!0),!i&&!o&&!n)return null;const a=qt(e).pop(),s=a?a.end:0,r=new ee(e);return r.appendRight(s,t(i,o,n)),{code:r.toString(),map:r.generateMap()}},"CJSToESM"),Mn=Te((e,t,i)=>{let o="";return(e||t)&&(o+=`import __cjs_url__ from "node:url"; // -- packem CommonJS __filename shim --
23
+ `.trim(),On=En((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=Le(e.postcss.modules.include,a):e.lightningcss&&typeof e.lightningcss.modules=="object"&&(s=Le(e.lightningcss.modules.include,a)),e.autoModules&&s===void 0&&(s=Le(e.autoModules,a)),!s)return null;const{types:r}=this.getModuleInfo(a)?.meta.styles??{};return r===void 0||await Ce(a)&&(await Ni(a+".d.ts",`${Sn}
24
+ ${r}`),i.info({message:`Generated types for ${q(a).replace(t+"/","")}`,prefix:"dts:css-modules"}),this.addWatchFile(a+".d.ts")),null}}},"cssModulesTypes");var Dn=Object.defineProperty,Te=g((e,t)=>Dn(e,"name",{value:t,configurable:!0}),"t$a");const Pn=/\Wrequire(?:\.resolve)?\(/,Nn=Te((e,t)=>{if(ji.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),Pn.test(e)&&(n=!0),!i&&!o&&!n)return null;const a=Bt(e).pop(),s=a?a.end:0,r=new ee(e);return r.appendRight(s,t(i,o,n)),{code:r.toString(),map:r.generateMap()}},"CJSToESM"),Cn=Te((e,t,i)=>{let o="";return(e||t)&&(o+=`import __cjs_url__ from "node:url"; // -- packem CommonJS __filename shim --
25
25
  `),t&&(o+=`import __cjs_path__ from "node:path"; // -- packem CommonJS __dirname shim --
26
26
  `),i&&(o+=`import __cjs_mod__ from "node:module"; // -- packem CommonJS require shim --
27
27
  `),(e||t)&&(o+=`const __filename = __cjs_url__.fileURLToPath(import.meta.url);
28
28
  `),t&&(o+=`const __dirname = __cjs_path__.dirname(__filename);
29
29
  `),i&&(o+=`const require = __cjs_mod__.createRequire(import.meta.url);
30
- `),o},"generateCJSShim"),In=Te((e,t,i)=>{let o="";return i&&(o+=`import __cjs_mod__ from "node:module"; // -- packem CommonJS require shim --
30
+ `),o},"generateCJSShim"),_n=Te((e,t,i)=>{let o="";return i&&(o+=`import __cjs_mod__ from "node:module"; // -- packem CommonJS require shim --
31
31
  `),e&&(o+=`const __filename = import.meta.filename; // -- packem CommonJS __filename shim --
32
32
  `),t&&(o+=`const __dirname = import.meta.dirname; // -- packem CommonJS __dirname shim --
33
33
  `),i&&(o+=`const require = __cjs_mod__.createRequire(import.meta.url);
34
- `),o},"generateCJSShimNode20_11"),Tn=Te((e,t)=>{const i=K(t.include,t.exclude);return{name:"packem:esm-shim-cjs-syntax",renderChunk(o,n,a){if(a.format==="es"&&i(n.fileName)){let s=Mn;if(e.engines?.node){const r=Lt(e.engines.node);r&&r.major>=20&&r.minor>=11&&(s=In)}return _n(o,s)}return null}}},"esmShimCjsSyntaxPlugin");var An=Object.defineProperty,Fn=f((e,t)=>An(e,"name",{value:t,configurable:!0}),"m$9");const Rn=Fn(()=>({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 zn=Object.defineProperty,Jn=f((e,t)=>zn(e,"name",{value:t,configurable:!0}),"e$7");const yt=/^([\w-]+):/,bt=Jn(e=>{if(!e||typeof e!="string")throw new Error("Invalid key: Key must be a non-empty string.");const t=[],i=yt.exec(e);i&&(t.push(i[1]),e=e.replace(yt,""));const o=e.split("/");for(const n of o)(n.includes("*")||n)&&t.push(n);return t},"splitTsconfigPathKey");var Wn=Object.defineProperty,Bn=f((e,t)=>Wn(e,"name",{value:t,configurable:!0}),"h$2");const Ln=Bn((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=bt(e),a=bt(t);let s=n.length-1,r=a.length-1;for(;s>=0&&r>=0&&n[s]===a[r];)s--,r--;let l=n.slice(0,s).join("/");const p=a.slice(r).join("/");return(!l.startsWith(".")||l==="")&&(l="./"+l),l+(p?"/"+p:"")},"extendString");var qn=Object.defineProperty,Un=f((e,t)=>qn(e,"name",{value:t,configurable:!0}),"s$d");const Kn=Un((...e)=>{if(e.length===0)return"";if(e.length===1)return A(e[0]);e=e.map(n=>Ee(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 r of a)if(r===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 Vn=Object.defineProperty,Ue=f((e,t)=>Vn(e,"name",{value:t,configurable:!0}),"m$7");const Hn=Ue((e,t,i,o,n,a)=>{const s=K(n.include,n.exclude),r={},l=Ue((u,d)=>{r[u.replace(te,"")]=d},"addOutput");let p=[];a?.config.compilerOptions&&(p=Object.entries(a.config.compilerOptions.paths??{}).map(([u])=>u.endsWith("*")?new RegExp(`^${u.replace("*","(.*)")}$`):new RegExp(`^${u}$`)));async function c(u,d){if(!s(d))return;let m;try{m=(await bo(u,{sourceFilename:d})).program}catch{}if(m){const v=m.body.filter(g=>g.type==="ImportDeclaration"||g.type==="ExportAllDeclaration"||g.type==="ExportNamedDeclaration");for await(const g of v){if(!g.source||Z(g.source.value).includes("."))continue;const w=await this.resolve(g.source.value,d);if(!(!w||w.external)&&(w.id.endsWith(".ts")||w.id.endsWith(".cts")||w.id.endsWith(".mts")||w.id.endsWith(".tsx")||w.id.endsWith(".ctsx")||w.id.endsWith(".mtsx"))){const k=w.id.replace(e+"/","");let x=g.source.value;p.some(D=>D.test(g.source.value))&&!g.source.value.startsWith(".")&&(x="./"+g.source.value),u=u.replaceAll('from "'+g.source.value+'"','from "'+Ln(x,k)+'"')}}}const{errors:h,sourceText:y}=await t(d,u);if(h.length>0){if(n.ignoreErrors){this.warn(h[0]);return}return this.error(h[0])}if(l(d,y),!m)return;const b=m.body.filter(v=>v.type==="ImportDeclaration"?v.importKind==="type"?!0:v.specifiers?.every(g=>g.type==="ImportSpecifier"&&g.importKind==="type"):v.type==="ExportNamedDeclaration"||v.type==="ExportAllDeclaration"?v.exportKind==="type"?!0:v.type==="ExportNamedDeclaration"&&v.specifiers?.every(g=>g.type==="ExportSpecifier"&&g.exportKind==="type"):!1);for await(const v of b){if(!v.source)continue;const g=await this.resolve(v.source.value,d);if(!g)return;const w=g.id;if(s(w)&&!r[w.replace(te,"")])try{const k=await je(w);await c.call(this,k,w)}catch{}}}return f(c,"N"),Ue(c,"transform"),{name:"packem:isolated-declarations",async renderStart(u,{input:d}){const m=Kn(...Array.isArray(d)?d:Object.values(d));typeof u.entryFileNames=="function"&&(u.entryFileNames=u.entryFileNames({name:u.name}));const h=u.entryFileNames.replace(/\.(.)?[jt]sx?$/,(y,b)=>`.d.${b||""}ts`);for await(let[y,b]of Object.entries(r)){if(o&&u.format==="cjs"){const g=Ht(b);g!==null&&(b=g.code)}const v=b.includes("from '")?"'":'"';(i===!0||i==="compatible")&&u.format==="cjs"&&this.emitFile({fileName:h.replace("[name]",_(m,y)).replace(".cts",".ts"),source:b.replaceAll(/(from\s)['|"]((.*)\..+|['|"].*)['|"];?/g,(g,w,k,x)=>w+v+(x||k)+".d.ts"+v+";"),type:"asset"}),this.emitFile({fileName:h.replace("[name]",_(m,y)),source:b.replaceAll(/(from\s)['|"]((.*)\..+|['|"].*)['|"];?/g,(g,w,k,x)=>w+v+(x||k)+(u.format==="cjs"?".d.cts":".d.mts")+v+";"),type:"asset"})}},transform:c}},"isolatedDeclarationsPlugin");var Gn=Object.defineProperty,Yn=f((e,t)=>Gn(e,"name",{value:t,configurable:!0}),"n$9");const wt="export default ",Yt=Yn(e=>{const t=$o(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(wt)&&(n.code=n.code.replace(wt,"module.exports = ")),n}}},"JSONPlugin");var Xn=Object.defineProperty,be=f((e,t)=>Xn(e,"name",{value:t,configurable:!0}),"i$8");class Xt{static{f(this,"WalkerBase")}static{be(this,"WalkerBase")}constructor(){this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:be(()=>this.should_skip=!0,"skip"),remove:be(()=>this.should_remove=!0,"remove"),replace:be(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 Qn=Object.defineProperty,de=f((e,t)=>Qn(e,"name",{value:t,configurable:!0}),"c$h");class Zn extends Xt{static{f(this,"SyncWalker")}static{de(this,"SyncWalker")}constructor(t,i){super(),this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:de(()=>this.should_skip=!0,"skip"),remove:de(()=>this.should_remove=!0,"remove"),replace:de(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,r=this.should_remove,l=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 p=this.should_skip,c=this.should_remove;if(this.should_skip=s,this.should_remove=r,this.replacement=l,p)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 r=s;for(let l=0;l<r.length;l+=1){const p=r[l];Ye(p)&&(this.visit(p,t,a,l)||l--)}}else Ye(s)&&this.visit(s,t,a,null)}if(this.leave){const s=this.replacement,r=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 l=this.should_remove;if(this.replacement=s,this.should_remove=r,l)return null}}return t}}function Ye(e){return e!==null&&typeof e=="object"&&"type"in e&&typeof e.type=="string"}f(Ye,"n$8");de(Ye,"isNode");var ea=Object.defineProperty,ue=f((e,t)=>ea(e,"name",{value:t,configurable:!0}),"c$g");class ta extends Xt{static{f(this,"AsyncWalker")}static{ue(this,"AsyncWalker")}constructor(t,i){super(),this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:ue(()=>this.should_skip=!0,"skip"),remove:ue(()=>this.should_remove=!0,"remove"),replace:ue(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,r=this.should_remove,l=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 p=this.should_skip,c=this.should_remove;if(this.should_skip=s,this.should_remove=r,this.replacement=l,p)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 r=s;for(let l=0;l<r.length;l+=1){const p=r[l];Xe(p)&&(await this.visit(p,t,a,l)||l--)}}else Xe(s)&&await this.visit(s,t,a,null)}if(this.leave){const s=this.replacement,r=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 l=this.should_remove;if(this.replacement=s,this.should_remove=r,l)return null}}return t}}function Xe(e){return e!==null&&typeof e=="object"&&"type"in e&&typeof e.type=="string"}f(Xe,"a$g");ue(Xe,"isNode");var ia=Object.defineProperty,Qt=f((e,t)=>ia(e,"name",{value:t,configurable:!0}),"a$f");function nt(e,{enter:t,leave:i}){return new Zn(t,i).visit(e,null)}f(nt,"walk");Qt(nt,"walk");async function oa(e,{enter:t,leave:i}){return await new ta(t,i).visit(e,null)}f(oa,"asyncWalk");Qt(oa,"asyncWalk");var na=Object.defineProperty,aa=f((e,t)=>na(e,"name",{value:t,configurable:!0}),"u$8");const sa=aa(({attributes:e,logger:t})=>{const i=K([/\.[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(l){return this.warn({code:"PARSE_ERROR",message:`[packem:jsx-remove-attributes]: failed to parse "${n}" and remove the jsx attribute.`}),t.warn(l),null}let s=!1;const r=new ee(o);return nt(a,{enter(l){if(l.type==="CallExpression"&&l.callee.type==="Identifier"&&l.callee.name==="jsx"){const p=l.arguments.filter(c=>c.type==="ObjectExpression"&&Array.isArray(c.properties));for(const c of p)for(const u of c.properties)u.type==="Property"&&u.key.type==="Literal"&&u.value.type==="Literal"&&e.includes(u.key.value)&&(r.overwrite(u.start-2,u.end,""),s=!0)}}}),s?{code:r.toString(),map:r.generateMap({hires:!0})}:null}}},"jsxRemoveAttributes");var ra=Object.defineProperty,Zt=f((e,t)=>ra(e,"name",{value:t,configurable:!0}),"d$a");const pa=Zt(e=>{const t=[],i=[];return e.forEach(o=>{o.startsWith("(")?t.push(o):i.push(o)}),[...i.sort(),...t.sort()]},"sortLicenses"),ei=Zt(({dtsMarker:e,licenseFilePath:t,licenseTemplate:i,logger:o,marker:n,mode:a,packageName:s})=>jo({thirdParty(r){const l=new Set,p=r.sort(({name:u},{name:d})=>(u||0)>(d||0)?1:(d||0)>(u||0)?-1:0).map(({author:u,contributors:d,license:m,licenseText:h,maintainers:y,name:b,repository:v})=>{let g="## "+b+`
35
- `;m&&(g+=`License: ${m}
36
- `);const w=new Set;for(const k of[u,...y,...d]){const x=typeof k=="string"?k:k?.name;x&&w.add(x)}return w.size>0&&(g+=`By: ${[...w].join(", ")}
37
- `),v&&(g+=`Repository: ${typeof v=="string"?v:v.url}
38
- `),h&&(g+=`
39
- `+h.trim().replaceAll(/\r\n|\r/g,`
34
+ `),o},"generateCJSShimNode20_11"),Mn=Te((e,t)=>{const i=K(t.include,t.exclude);return{name:"packem:esm-shim-cjs-syntax",renderChunk(o,n,a){if(a.format==="es"&&i(n.fileName)){let s=Cn;if(e.engines?.node){const r=Wt(e.engines.node);r&&r.major>=20&&r.minor>=11&&(s=_n)}return Nn(o,s)}return null}}},"esmShimCjsSyntaxPlugin");var In=Object.defineProperty,Tn=g((e,t)=>In(e,"name",{value:t,configurable:!0}),"m$9");const An=Tn(()=>({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 Fn=Object.defineProperty,Rn=g((e,t)=>Fn(e,"name",{value:t,configurable:!0}),"e$7");const xt=/^([\w-]+):/,yt=Rn(e=>{if(!e||typeof e!="string")throw new Error("Invalid key: Key must be a non-empty string.");const t=[],i=xt.exec(e);i&&(t.push(i[1]),e=e.replace(xt,""));const o=e.split("/");for(const n of o)(n.includes("*")||n)&&t.push(n);return t},"splitTsconfigPathKey");var zn=Object.defineProperty,Jn=g((e,t)=>zn(e,"name",{value:t,configurable:!0}),"h$2");const Wn=Jn((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=yt(e),a=yt(t);let s=n.length-1,r=a.length-1;for(;s>=0&&r>=0&&n[s]===a[r];)s--,r--;let l=n.slice(0,s).join("/");const p=a.slice(r).join("/");return(!l.startsWith(".")||l==="")&&(l="./"+l),l+(p?"/"+p:"")},"extendString");var Bn=Object.defineProperty,Ln=g((e,t)=>Bn(e,"name",{value:t,configurable:!0}),"s$d");const qn=Ln((...e)=>{if(e.length===0)return"";if(e.length===1)return A(e[0]);e=e.map(n=>je(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 r of a)if(r===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 Un=Object.defineProperty,Ue=g((e,t)=>Un(e,"name",{value:t,configurable:!0}),"m$7");const Kn=Ue((e,t,i,o,n,a)=>{const s=K(n.include,n.exclude),r={},l=Ue((u,d)=>{r[u.replace(te,"")]=d},"addOutput");let p=[];a?.config.compilerOptions&&(p=Object.entries(a.config.compilerOptions.paths??{}).map(([u])=>u.endsWith("*")?new RegExp(`^${u.replace("*","(.*)")}$`):new RegExp(`^${u}$`)));async function c(u,d){if(!s(d))return;let m;try{m=(await xo(u,{sourceFilename:d})).program}catch{}if(m){const f=m.body.filter(v=>v.type==="ImportDeclaration"||v.type==="ExportAllDeclaration"||v.type==="ExportNamedDeclaration");for await(const v of f){if(!v.source||Z(v.source.value).includes("."))continue;const y=await this.resolve(v.source.value,d);if(!(!y||y.external)&&(y.id.endsWith(".ts")||y.id.endsWith(".cts")||y.id.endsWith(".mts")||y.id.endsWith(".tsx")||y.id.endsWith(".ctsx")||y.id.endsWith(".mtsx"))){const k=y.id.replace(e+"/","");let h=v.source.value;p.some(E=>E.test(v.source.value))&&!v.source.value.startsWith(".")&&(h="./"+v.source.value),u=u.replaceAll('from "'+v.source.value+'"','from "'+Wn(h,k)+'"')}}}const{errors:b,sourceText:w}=await t(d,u);if(b.length>0){if(n.ignoreErrors){this.warn(b[0]);return}return this.error(b[0])}if(l(d,w),!m)return;const x=m.body.filter(f=>f.type==="ImportDeclaration"?f.importKind==="type"?!0:f.specifiers?.every(v=>v.type==="ImportSpecifier"&&v.importKind==="type"):f.type==="ExportNamedDeclaration"||f.type==="ExportAllDeclaration"?f.exportKind==="type"?!0:f.type==="ExportNamedDeclaration"&&f.specifiers?.every(v=>v.type==="ExportSpecifier"&&v.exportKind==="type"):!1);for await(const f of x){if(!f.source)continue;const v=await this.resolve(f.source.value,d);if(!v)return;const y=v.id;if(s(y)&&!r[y.replace(te,"")])try{const k=await $e(y);await c.call(this,k,y)}catch{}}}return g(c,"N"),Ue(c,"transform"),{name:"packem:isolated-declarations",async renderStart(u,{input:d}){const m=qn(...Array.isArray(d)?d:Object.values(d));typeof u.entryFileNames=="function"&&(u.entryFileNames=u.entryFileNames({name:u.name}));const b=u.entryFileNames.replace(/\.(.)?[jt]sx?$/,(w,x)=>`.d.${x||""}ts`);for await(let[w,x]of Object.entries(r)){if(o&&u.format==="cjs"){const v=Kt(x);v!==null&&(x=v.code)}const f=x.includes("from '")?"'":'"';(i===!0||i==="compatible")&&u.format==="cjs"&&this.emitFile({fileName:b.replace("[name]",_(m,w)).replace(".cts",".ts"),source:x.replaceAll(/(from\s)['|"]((.*)\..+|['|"].*)['|"];?/g,(v,y,k,h)=>y+f+(h||k)+".d.ts"+f+";"),type:"asset"}),this.emitFile({fileName:b.replace("[name]",_(m,w)),source:x.replaceAll(/(from\s)['|"]((.*)\..+|['|"].*)['|"];?/g,(v,y,k,h)=>y+f+(h||k)+(u.format==="cjs"?".d.cts":".d.mts")+f+";"),type:"asset"})}},transform:c}},"isolatedDeclarationsPlugin");var Vn=Object.defineProperty,Hn=g((e,t)=>Vn(e,"name",{value:t,configurable:!0}),"n$9");const bt="export default ",Ht=Hn(e=>{const t=wo(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(bt)&&(n.code=n.code.replace(bt,"module.exports = ")),n}}},"JSONPlugin");var Gn=Object.defineProperty,ye=g((e,t)=>Gn(e,"name",{value:t,configurable:!0}),"i$8");class Gt{static{g(this,"WalkerBase")}static{ye(this,"WalkerBase")}constructor(){this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:ye(()=>this.should_skip=!0,"skip"),remove:ye(()=>this.should_remove=!0,"remove"),replace:ye(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 Yn=Object.defineProperty,de=g((e,t)=>Yn(e,"name",{value:t,configurable:!0}),"c$g");class Xn extends Gt{static{g(this,"SyncWalker")}static{de(this,"SyncWalker")}constructor(t,i){super(),this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:de(()=>this.should_skip=!0,"skip"),remove:de(()=>this.should_remove=!0,"remove"),replace:de(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,r=this.should_remove,l=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 p=this.should_skip,c=this.should_remove;if(this.should_skip=s,this.should_remove=r,this.replacement=l,p)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 r=s;for(let l=0;l<r.length;l+=1){const p=r[l];Ge(p)&&(this.visit(p,t,a,l)||l--)}}else Ge(s)&&this.visit(s,t,a,null)}if(this.leave){const s=this.replacement,r=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 l=this.should_remove;if(this.replacement=s,this.should_remove=r,l)return null}}return t}}function Ge(e){return e!==null&&typeof e=="object"&&"type"in e&&typeof e.type=="string"}g(Ge,"n$8");de(Ge,"isNode");var Qn=Object.defineProperty,ue=g((e,t)=>Qn(e,"name",{value:t,configurable:!0}),"c$f");class Zn extends Gt{static{g(this,"AsyncWalker")}static{ue(this,"AsyncWalker")}constructor(t,i){super(),this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:ue(()=>this.should_skip=!0,"skip"),remove:ue(()=>this.should_remove=!0,"remove"),replace:ue(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,r=this.should_remove,l=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 p=this.should_skip,c=this.should_remove;if(this.should_skip=s,this.should_remove=r,this.replacement=l,p)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 r=s;for(let l=0;l<r.length;l+=1){const p=r[l];Ye(p)&&(await this.visit(p,t,a,l)||l--)}}else Ye(s)&&await this.visit(s,t,a,null)}if(this.leave){const s=this.replacement,r=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 l=this.should_remove;if(this.replacement=s,this.should_remove=r,l)return null}}return t}}function Ye(e){return e!==null&&typeof e=="object"&&"type"in e&&typeof e.type=="string"}g(Ye,"a$i");ue(Ye,"isNode");var ea=Object.defineProperty,Yt=g((e,t)=>ea(e,"name",{value:t,configurable:!0}),"a$h");function ot(e,{enter:t,leave:i}){return new Xn(t,i).visit(e,null)}g(ot,"walk");Yt(ot,"walk");async function ta(e,{enter:t,leave:i}){return await new Zn(t,i).visit(e,null)}g(ta,"asyncWalk");Yt(ta,"asyncWalk");var ia=Object.defineProperty,oa=g((e,t)=>ia(e,"name",{value:t,configurable:!0}),"u$9");const na=oa(({attributes:e,logger:t})=>{const i=K([/\.[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(l){return this.warn({code:"PARSE_ERROR",message:`[packem:jsx-remove-attributes]: failed to parse "${n}" and remove the jsx attribute.`}),t.warn(l),null}let s=!1;const r=new ee(o);return ot(a,{enter(l){if(l.type==="CallExpression"&&l.callee.type==="Identifier"&&l.callee.name==="jsx"){const p=l.arguments.filter(c=>c.type==="ObjectExpression"&&Array.isArray(c.properties));for(const c of p)for(const u of c.properties)u.type==="Property"&&u.key.type==="Literal"&&u.value.type==="Literal"&&e.includes(u.key.value)&&(r.overwrite(u.start-2,u.end,""),s=!0)}}}),s?{code:r.toString(),map:r.generateMap({hires:!0})}:null}}},"jsxRemoveAttributes");var aa=Object.defineProperty,Xt=g((e,t)=>aa(e,"name",{value:t,configurable:!0}),"d$a");const sa=Xt(e=>{const t=[],i=[];return e.forEach(o=>{o.startsWith("(")?t.push(o):i.push(o)}),[...i.sort(),...t.sort()]},"sortLicenses"),Qt=Xt(({dtsMarker:e,licenseFilePath:t,licenseTemplate:i,logger:o,marker:n,mode:a,packageName:s})=>ko({thirdParty(r){const l=new Set,p=r.sort(({name:u},{name:d})=>(u||0)>(d||0)?1:(d||0)>(u||0)?-1:0).map(({author:u,contributors:d,license:m,licenseText:b,maintainers:w,name:x,repository:f})=>{let v="## "+x+`
35
+ `;m&&(v+=`License: ${m}
36
+ `);const y=new Set;for(const k of[u,...w,...d]){const h=typeof k=="string"?k:k?.name;h&&y.add(h)}return y.size>0&&(v+=`By: ${[...y].join(", ")}
37
+ `),f&&(v+=`Repository: ${typeof f=="string"?f:f.url}
38
+ `),b&&(v+=`
39
+ `+b.trim().replaceAll(/\r\n|\r/g,`
40
40
  `).replaceAll(`<!-- ${n} -->`,"").replaceAll(e?`<!-- ${e} -->`:"","").replaceAll(`<!-- /${n} -->`,"").replaceAll(e?`<!-- /${e} -->`:"","").trim().split(`
41
41
  `).map(k=>k?`> ${k}`:">").join(`
42
42
  `)+`
43
- `),m&&l.add(m),g}).join(`
43
+ `),m&&l.add(m),v}).join(`
44
44
  ---------------------------------------
45
45
 
46
- `);if(p===""){o.info({message:"No dependencies license information found.",prefix:"plugin:license:"+a});return}const c=i(pa(l),p,s);try{const u=et(t),d=Eo(u,n,c);if(!d){o.error({message:`Could not find the license marker: <!-- ${n} --><!-- /${n} --> in ${t}`,prefix:"plugin:license:"+a});return}u!==d&&(ae(t,d),o.info({message:`${t} updated.`,prefix:"plugin:license:"+a}))}catch(u){o.error(u)}}}),"license");var la=Object.defineProperty,ca=f((e,t)=>la(e,"name",{value:t,configurable:!0}),"u$7");const da=ca(()=>({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(te,"")}-${e.format}.json`,source:JSON.stringify(i,null,2),type:"asset"})},name:"packem:metafile"}),"metafilePlugin");var ua=Object.defineProperty,ma=f((e,t)=>ua(e,"name",{value:t,configurable:!0}),"g$7");let kt=!1;const fa=ma((e,t,i,o,n,a)=>{if(a!=="*"&&io(oo(a))===null)throw new Error("Invalid typeScriptVersion option. It must be a valid semver range.");return{name:"packem:node10-compatibility",writeBundle(){kt||(e.info({message:"Declaration node10 compatibility mode is enabled.",prefix:"plugin:node10-compatibility"}),kt=!0);const s={};for(const p of t)for(const c of p.exportKey)c.includes("/*")?s[c]=["./"+$(i,A(p.name),"*.d.ts")]:s[c]=[...s[c]??[],"./"+$(i,p.name+".d.ts")];const r=$(o,"package.json"),l=Mi(r);n==="file"&&Object.keys(s).length>0?(Ii(r,{...l,typesVersions:{...l.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:
46
+ `);if(p===""){o.info({message:"No dependencies license information found.",prefix:"plugin:license:"+a});return}const c=i(sa(l),p,s);try{const u=Ze(t),d=$o(u,n,c);if(!d){o.error({message:`Could not find the license marker: <!-- ${n} --><!-- /${n} --> in ${t}`,prefix:"plugin:license:"+a});return}u!==d&&(ae(t,d),o.info({message:`${t} updated.`,prefix:"plugin:license:"+a}))}catch(u){o.error(u)}}}),"license");var ra=Object.defineProperty,pa=g((e,t)=>ra(e,"name",{value:t,configurable:!0}),"u$8");const la=pa(()=>({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(te,"")}-${e.format}.json`,source:JSON.stringify(i,null,2),type:"asset"})},name:"packem:metafile"}),"metafilePlugin");var ca=Object.defineProperty,da=g((e,t)=>ca(e,"name",{value:t,configurable:!0}),"g$7");let wt=!1;const ua=da((e,t,i,o,n,a)=>{if(a!=="*"&&eo(to(a))===null)throw new Error("Invalid typeScriptVersion option. It must be a valid semver range.");return{name:"packem:node10-compatibility",writeBundle(){wt||(e.info({message:"Declaration node10 compatibility mode is enabled.",prefix:"plugin:node10-compatibility"}),wt=!0);const s={};for(const p of t)for(const c of p.exportKey)c.includes("/*")?s[c]=["./"+$(i,A(p.name),"*.d.ts")]:s[c]=[...s[c]??[],"./"+$(i,p.name+".d.ts")];const r=$(o,"package.json"),l=Ci(r);n==="file"&&Object.keys(s).length>0?(_i(r,{...l,typesVersions:{...l.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:
47
47
 
48
48
  ${JSON.stringify({typesVersions:{"*":s}},null,4)}
49
- `,prefix:"plugin:node10-compatibility"})}}},"node10CompatibilityPlugin");var ga=Object.defineProperty,ti=f((e,t)=>ga(e,"name",{value:t,configurable:!0}),"d$9");const le=ti(e=>e.handler||e,"getHandler"),I=ti((e,t,i="")=>({...e,async buildEnd(o){e.buildEnd&&await le(e.buildEnd).call(this,o)},async buildStart(o){e.buildStart&&await le(e.buildStart).call(this,o)},async load(o){if(!e.load)return null;const n=$(i,e.name),a=$("load",X(o));if(t.has(a,n))return await t.get(a,n);const s=await le(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=$(i,e.name),r=$("resolveId",X(o),n?X(n):"",X(JSON.stringify(a)));if(t.has(r,s))return await t.get(r,s);const l=await le(e.resolveId).call(this,o,n,a);return t.set(r,l,s),l},async transform(o,n){if(!e.transform)return null;const a=$(i,e.name),s=$("transform",X(n),X(o));if(t.has(s,a))return await t.get(s,a);const r=await le(e.transform).call(this,o,n);return t.set(s,r,a),r}}),"cachingPlugin");var va=Object.defineProperty,ha=f((e,t)=>va(e,"name",{value:t,configurable:!0}),"n$7");const xa=ha(()=>({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}';
50
- `+e}return null},order:"post"}}),"prependDirectivePlugin");var ya=Object.defineProperty,ba=f((e,t)=>ya(e,"name",{value:t,configurable:!0}),"c$c");const wa=ba(({directiveRegex:e,exclude:t=[],include:i=[],logger:o})=>{const n={},a={},s=K(i,t);return{name:"packem:preserve-directives",onLog(r,l){return l.code==="MODULE_LEVEL_DIRECTIVE"&&r==="warn"?!1:null},renderChunk:{handler(r,l,{sourcemap:p}){const c=l.moduleIds.map(m=>n[m]?n[m]:null).reduce((m,h)=>(h&&h.forEach(y=>{m.add(y)}),m),new Set),u=new ee(r);c.size>0&&(o.debug({message:`directives for chunk "${l.fileName}" are preserved.`,prefix:"plugin:preserve-directives"}),u.prepend(`${[...c].map(m=>`'${m}';`).join(`
49
+ `,prefix:"plugin:node10-compatibility"})}}},"node10CompatibilityPlugin");var ma=Object.defineProperty,Zt=g((e,t)=>ma(e,"name",{value:t,configurable:!0}),"d$9");const le=Zt(e=>e.handler||e,"getHandler"),I=Zt((e,t,i="")=>({...e,async buildEnd(o){e.buildEnd&&await le(e.buildEnd).call(this,o)},async buildStart(o){e.buildStart&&await le(e.buildStart).call(this,o)},async load(o){if(!e.load)return null;const n=$(i,e.name),a=$("load",X(o));if(t.has(a,n))return await t.get(a,n);const s=await le(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=$(i,e.name),r=$("resolveId",X(o),n?X(n):"",X(JSON.stringify(a)));if(t.has(r,s))return await t.get(r,s);const l=await le(e.resolveId).call(this,o,n,a);return t.set(r,l,s),l},async transform(o,n){if(!e.transform)return null;const a=$(i,e.name),s=$("transform",X(n),X(o));if(t.has(s,a))return await t.get(s,a);const r=await le(e.transform).call(this,o,n);return t.set(s,r,a),r}}),"cachingPlugin");var fa=Object.defineProperty,ga=g((e,t)=>fa(e,"name",{value:t,configurable:!0}),"n$7");const va=ga(()=>({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}';
50
+ `+e}return null},order:"post"}}),"prependDirectivePlugin");var ha=Object.defineProperty,xa=g((e,t)=>ha(e,"name",{value:t,configurable:!0}),"c$b");const ya=xa(({directiveRegex:e,exclude:t=[],include:i=[],logger:o})=>{const n={},a={},s=K(i,t);return{name:"packem:preserve-directives",onLog(r,l){return l.code==="MODULE_LEVEL_DIRECTIVE"&&r==="warn"?!1:null},renderChunk:{handler(r,l,{sourcemap:p}){const c=l.moduleIds.map(m=>n[m]?n[m]:null).reduce((m,b)=>(b&&b.forEach(w=>{m.add(w)}),m),new Set),u=new ee(r);c.size>0&&(o.debug({message:`directives for chunk "${l.fileName}" are preserved.`,prefix:"plugin:preserve-directives"}),u.prepend(`${[...c].map(m=>`'${m}';`).join(`
51
51
  `)}
52
52
  `));let d;return l.facadeModuleId&&typeof a[l.facadeModuleId]=="string"&&(d=a[l.facadeModuleId]),d&&(o.debug({message:`shebang for chunk "${l.fileName}" is preserved.`,prefix:"plugin:preserve-directives"}),u.prepend(`${d}
53
- `)),c.size===0&&d===void 0?null:{code:u.toString(),map:p?u.generateMap({hires:!0}):null}},order:"post"},transform(r,l){if(!s(l))return null;let p=!1;const c=new ee(r);if(r.startsWith("#")&&r[1]==="!"){let d=0;for(let m=2,h=r.length;m<h;m++){const y=r.codePointAt(m);if(y===10||y===13||y===8232||y===8233){d=m;break}}d&&(a[l]=r.slice(0,d),c.remove(0,d+1),p=!0,o.debug({message:`shebang for module "${l}" is preserved.`,prefix:"plugin:preserve-directives"}))}let u=null;try{u=this.parse(c.toString(),{allowReturnOutsideFunction:!0})}catch(d){return this.warn({code:"PARSE_ERROR",message:`failed to parse "${l}" and extract the directives.`}),o.warn(d),null}if(u.type!=="Program")return null;for(const d of u.body.filter(Boolean)){if(d.type!=="ExpressionStatement")break;let m=null;"directive"in d?m=d.directive:d.expression.type==="Literal"&&typeof d.expression.value=="string"&&e.test(d.expression.value)&&(m=d.expression.value),m!=="use strict"&&m&&(n[l]||=new Set,n[l].add(m),"start"in d&&typeof d.start=="number"&&"end"in d&&typeof d.end=="number"&&(c.remove(d.start,d.end),p=!0),o.debug({message:`directive "${m}" for module "${l}" is preserved.`,prefix:"plugin:preserve-directives"}))}return p?{code:c.toString(),map:c.generateMap({hires:!0}),meta:{preserveDirectives:{directives:[...n[l]??[]],shebang:a[l]??null}}}:null}}},"preserveDirectives");var ka=Object.defineProperty,$a=f((e,t)=>ka(e,"name",{value:t,configurable:!0}),"n$6");const ja=$a(e=>{const t=K(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 Ea=Object.defineProperty,Sa=f((e,t)=>Ea(e,"name",{value:t,configurable:!0}),"i$7");const Ae=Sa((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 Oa=Object.defineProperty,me=f((e,t)=>Oa(e,"name",{value:t,configurable:!0}),"o$5");const $t=me((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"),jt=new Map,Ke=new Map,ii=me((e,t,i,o,n)=>{const a=$t([...i.externals],"include",o),s=$t([...n.exclude??[]],"exclude",o),r={};Object.assign(r,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 l=Object.keys(r);l.length>0&&a.push(new RegExp("^(?:"+l.join("|")+")(?:/.+)?$"));const p=me(m=>a.some(h=>h.test(m)),"isIncluded"),c=me(m=>s.some(h=>h.test(m)),"isExcluded");let u=[];t&&(u=Object.entries(t.config.compilerOptions?.paths??{}).map(([m])=>m.endsWith("*")?new RegExp(`^${m.replace("*","(.*)")}$`):new RegExp(`^${m}$`)));const d=Ae(e,i);return{name:"packem:resolve-externals",options:me(m=>{m.external=h=>{if(/^(?:\0|\.{1,2}\/)/.test(h)||ve(h)||e.name&&h.startsWith(e.name)||qe(h)||p(h)&&!c(h))return!1;if(e.imports)for(const[y,b]of Object.entries(e.imports)){if(y===h)return!1;if(y.includes("*")){let v;Ke.has(y)?v=Ke.get(y):(v=Oo($(i.rootDir,b.replace("/*","")),{withFileTypes:!0}).filter(g=>g.isFile()).map(g=>g.name),Ke.set(y,v));for(const g of v)if(g.replace(te,"")===h.replace(te,"").replace("#",""))return!1}}if(u.length>0){for(const y of u)if(y.test(h))return!1}return Object.keys(d).length>0&&po(h,d)!==h||(jt.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"}),jt.set(h,!0)),!1}},"options"),resolveId:{async handler(m,h,{isEntry:y}){if(y||/^(?:\0|\.{1,2}\/)/.test(m)||ve(m)||e.name&&m.startsWith(e.name))return null;if(qe(m)){const b=m.replace(/^node:/,"");return{external:(n.builtins||p(m))&&!c(m),id:n.builtinsPrefix==="ignore"?m:n.builtinsPrefix==="add"||!qe(b)?"node:"+b:b,moduleSideEffects:!1}}return p(m)&&!c(m)?!1:null},order:"pre"}}},"resolveExternalsPlugin");var Pa=Object.defineProperty,Da=f((e,t)=>Pa(e,"name",{value:t,configurable:!0}),"r$9");const oi=Da(()=>({name:"packem:resolve-file-url",resolveId(e){if(e.startsWith("file://"))return Co(e)}}),"resolveFileUrl");var Na=Object.defineProperty,Fe=f((e,t)=>Na(e,"name",{value:t,configurable:!0}),"i$5");const Pe=/^#![^\n]*/,Qe=Fe(async e=>{await Vi(e,493).catch(()=>{})},"makeExecutable"),Ca=Fe((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(Pe,t.shebang+`
53
+ `)),c.size===0&&d===void 0?null:{code:u.toString(),map:p?u.generateMap({hires:!0}):null}},order:"post"},transform(r,l){if(!s(l))return null;let p=!1;const c=new ee(r);if(r.startsWith("#")&&r[1]==="!"){let d=0;for(let m=2,b=r.length;m<b;m++){const w=r.codePointAt(m);if(w===10||w===13||w===8232||w===8233){d=m;break}}d&&(a[l]=r.slice(0,d),c.remove(0,d+1),p=!0,o.debug({message:`shebang for module "${l}" is preserved.`,prefix:"plugin:preserve-directives"}))}let u=null;try{u=this.parse(c.toString(),{allowReturnOutsideFunction:!0})}catch(d){return this.warn({code:"PARSE_ERROR",message:`failed to parse "${l}" and extract the directives.`}),o.warn(d),null}if(u.type!=="Program")return null;for(const d of u.body.filter(Boolean)){if(d.type!=="ExpressionStatement")break;let m=null;"directive"in d?m=d.directive:d.expression.type==="Literal"&&typeof d.expression.value=="string"&&e.test(d.expression.value)&&(m=d.expression.value),m!=="use strict"&&m&&(n[l]||=new Set,n[l].add(m),"start"in d&&typeof d.start=="number"&&"end"in d&&typeof d.end=="number"&&(c.remove(d.start,d.end),p=!0),o.debug({message:`directive "${m}" for module "${l}" is preserved.`,prefix:"plugin:preserve-directives"}))}return p?{code:c.toString(),map:c.generateMap({hires:!0}),meta:{preserveDirectives:{directives:[...n[l]??[]],shebang:a[l]??null}}}:null}}},"preserveDirectives");var ba=Object.defineProperty,wa=g((e,t)=>ba(e,"name",{value:t,configurable:!0}),"n$6");const ka=wa(e=>{const t=K(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 $a=Object.defineProperty,ja=g((e,t)=>$a(e,"name",{value:t,configurable:!0}),"i$7");const Ae=ja((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 Ea=Object.defineProperty,me=g((e,t)=>Ea(e,"name",{value:t,configurable:!0}),"a$f");const kt=me((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"),ei=me((e,t,i,o,n)=>{const a=new Map,s=new Map,r=new Map,l=new Set(kt([...i.externals],"include",o)),p=new Set(kt([...n.exclude??[]],"exclude",o)),c={};Object.assign(c,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 u=Object.keys(c);if(u.length>0&&l.add(new RegExp("^(?:"+u.join("|")+")(?:/.+)?$")),e.peerDependenciesMeta)for(const[x,f]of Object.entries(e.peerDependenciesMeta))f?.optional&&l.add(new RegExp(`^${x}(?:/.+)?$`));const d=me(x=>[...l].some(f=>f.test(x)),"isIncluded"),m=me(x=>[...p].some(f=>f.test(x)),"isExcluded");let b=[];t&&(b=Object.entries(t.config.compilerOptions?.paths??{}).map(([x])=>x.endsWith("*")?new RegExp(`^${x.replace("*","(.*)")}$`):new RegExp(`^${x}$`)));const w=Ae(e,i);return{name:"packem:resolve-externals",options:me(x=>{x.external=(f,v)=>{if(r.has(f))return r.get(f);if(Object.keys(w).length>0&&(f=so(f,w)),/^(?:\0|\.{1,2}\/)/.test(f)||_e(f)||e.name&&f.startsWith(e.name))return r.set(f,!1),!1;if(qe(f)){let y=n.builtins;return y===void 0&&v&&(y=d(v)&&!m(v)),r.set(f,y),y}if(d(f)&&!m(f))return r.set(f,!0),!0;if(e.imports)for(const[y,k]of Object.entries(e.imports)){if(y===f)return r.set(f,!1),!1;if(y.includes("*")){let h;s.has(y)?h=s.get(y):(h=Eo($(i.rootDir,k.replace("/*","")),{withFileTypes:!0}).filter(E=>E.isFile()).map(E=>E.name),s.set(y,h));for(const E of h)if(E.replace(te,"")===f.replace(te,"").replace("#",""))return r.set(f,!1),!1}}if(b.length>0){for(const y of b)if(y.test(f))return r.set(f,!1),!1}return a.has(f)||o.info({message:'Inlined implicit external "'+P(f)+'". If this is incorrect, add it to the "externals" option.',prefix:"plugin:packem:resolve-externals"}),a.set(f,!0),!1}},"options"),resolveId:{async handler(x,f,{isEntry:v}){if(v)return null;if(qe(x)){const y=x.replace(/^node:/,"");return{external:(n.builtins||d(x))&&!m(x),id:n.builtinsPrefix==="ignore"?x:n.builtinsPrefix==="add"||!qe(y)?"node:"+y:y,moduleSideEffects:!1}}return null},order:"pre"}}},"resolveExternalsPlugin");var Sa=Object.defineProperty,Oa=g((e,t)=>Sa(e,"name",{value:t,configurable:!0}),"r$9");const ti=Oa(()=>({name:"packem:resolve-file-url",resolveId(e){if(e.startsWith("file://"))return Po(e)}}),"resolveFileUrl");var Da=Object.defineProperty,Fe=g((e,t)=>Da(e,"name",{value:t,configurable:!0}),"i$5");const Oe=/^#![^\n]*/,Xe=Fe(async e=>{await Ui(e,493).catch(()=>{})},"makeExecutable"),Pa=Fe((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(Oe,t.shebang+`
54
54
  `);if(a)return null;if(e.includes(o.name)){const s=new ee(i);return s.prepend(t.shebang+`
55
- `),{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"&&Pe.test(a.code)&&i.dir){const s=S(i.dir,n);await Qe(s)}}}),"shebangPlugin"),_a=Fe(()=>({name:"packem:remove-shebang",renderChunk(e){return e.replace(Pe,"")}}),"removeShebangPlugin"),Ma=Fe((e,t=`
56
- `)=>{const i=Pe.exec(e);return i?i+t:""},"getShebang");var Ia=Object.defineProperty,Ta=f((e,t)=>Ia(e,"name",{value:t,configurable:!0}),"l$6");const Aa=Ta(({exclude:e,include:t}={})=>{const i=K(t,e);return{async load(o){if(!i(o))return null;let n;try{n=await je(o,{buffer:!1}),this.addWatchFile(o)}catch{try{const s=o.replace(/\?.*$/,"");n=await je(s,{buffer:!1}),this.addWatchFile(s)}catch{return this.warn("Failed reading file"),null}}let a;try{const s=_o(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 Fa=Object.defineProperty,ie=f((e,t)=>Fa(e,"name",{value:t,configurable:!0}),"r$8");const Ra=/\/\*[^*]*\*+(?:[^/*][^*]*\*+)*\//g,za=/MIT License|MIT license|BSD license/,Ja=/\n{2,}/g,Wa=/\b(\w+)\$\d+\b/g,Ba=/[-/\\^$*+?.()|[\]{}]/g,La=ie(e=>e.replaceAll(Ba,"\\$&"),"escapeRegex"),qa=ie(e=>[...new Set(e)],"unique"),Ua=ie(e=>e.replaceAll(Ra,t=>za.test(t)?"":t).replaceAll(Ja,`
55
+ `),{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"&&Oe.test(a.code)&&i.dir){const s=O(i.dir,n);await Xe(s)}}}),"shebangPlugin"),Na=Fe(()=>({name:"packem:remove-shebang",renderChunk(e){return e.replace(Oe,"")}}),"removeShebangPlugin"),Ca=Fe((e,t=`
56
+ `)=>{const i=Oe.exec(e);return i?i+t:""},"getShebang");var _a=Object.defineProperty,Ma=g((e,t)=>_a(e,"name",{value:t,configurable:!0}),"l$6");const Ia=Ma(({exclude:e,include:t}={})=>{const i=K(t,e);return{async load(o){if(!i(o))return null;let n;try{n=await $e(o,{buffer:!1}),this.addWatchFile(o)}catch{try{const s=o.replace(/\?.*$/,"");n=await $e(s,{buffer:!1}),this.addWatchFile(s)}catch{return this.warn("Failed reading file"),null}}let a;try{const s=No(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 Ta=Object.defineProperty,ie=g((e,t)=>Ta(e,"name",{value:t,configurable:!0}),"r$8");const Aa=/\/\*[^*]*\*+(?:[^/*][^*]*\*+)*\//g,Fa=/MIT License|MIT license|BSD license/,Ra=/\n{2,}/g,za=/\b(\w+)\$\d+\b/g,Ja=/[-/\\^$*+?.()|[\]{}]/g,Wa=ie(e=>e.replaceAll(Ja,"\\$&"),"escapeRegex"),Ba=ie(e=>[...new Set(e)],"unique"),La=ie(e=>e.replaceAll(Aa,t=>Fa.test(t)?"":t).replaceAll(Ra,`
57
57
 
58
- `),"cleanUnnecessaryComments"),Et=new Map;function ni(e,t,{identifierReplacements:i},o){const n=qt(e);for(const s in i){const r=n.find(p=>p.specifier===s&&p.imports.includes("{"));if(!r){this.warn(`${t.fileName} does not import "${s}" for replacement`),process.exitCode=1;continue}const l=i[s];for(const p in l){if(!r.imports.includes(p))throw new Error(`${t.fileName} does not import "${p}" from "${s}" for replacement`);const c=l[p],u=La(p);c.includes(".")&&(e=e.replace(new RegExp(`\\b\\w+\\b as ${u},?\\s?`),"")),e=e.replaceAll(new RegExp(`\\b${u}\\b`,"g"),c)}}const a=qa(Array.from(e.matchAll(Wa),s=>s[0]));if(a.length>0){const s=a.map(l=>`
59
- - ${l}`).join(""),r=t.fileName.replace(/\.[^/.]+$/,"");Et.has(r)||o.warn({message:`${t.fileName} contains confusing identifier names${s}
58
+ `),"cleanUnnecessaryComments"),$t=new Map;function ii(e,t,{identifierReplacements:i},o){const n=Bt(e);for(const s in i){const r=n.find(p=>p.specifier===s&&p.imports.includes("{"));if(!r){this.warn(`${t.fileName} does not import "${s}" for replacement`),process.exitCode=1;continue}const l=i[s];for(const p in l){if(!r.imports.includes(p))throw new Error(`${t.fileName} does not import "${p}" from "${s}" for replacement`);const c=l[p],u=Wa(p);c.includes(".")&&(e=e.replace(new RegExp(`\\b\\w+\\b as ${u},?\\s?`),"")),e=e.replaceAll(new RegExp(`\\b${u}\\b`,"g"),c)}}const a=Ba(Array.from(e.matchAll(za),s=>s[0]));if(a.length>0){const s=a.map(l=>`
59
+ - ${l}`).join(""),r=t.fileName.replace(/\.[^/.]+$/,"");$t.has(r)||o.warn({message:`${t.fileName} contains confusing identifier names${s}
60
60
 
61
- To replace these, add them to the "rollup -> patchTypes -> identifierReplacements" option in your packem config.`,prefix:"plugin:patch-types"}),Et.set(r,!0)}return e}f(ni,"I$1");ie(ni,"replaceConfusingTypeNames");const Ka=ie((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 ai(e,t){if(e.includes("@internal")){const i=new ee(e),o=Mo(e,{plugins:["typescript"],sourceType:"module"});if(nt(o,{enter(n){Ka(i,n)&&this.skip()}}),e=i.toString(),e.includes("@internal"))throw new Error(`${t.fileName} has unhandled @internal declarations`)}return e}f(ai,"S$3");ie(ai,"stripInternalTypes");const Va=ie((e,t)=>({name:"packem:patch-types",renderChunk(i,o){return i=ni.call(this,i,o,e,t),i=ai.call(this,i,o),i=Ua(i),i},resolveId(i){return i.startsWith("types/")?{external:!0,id:"../../"+(i.endsWith(".js")?i:i+".js")}:null}}),"patchTypescriptTypes");var Ha=Object.defineProperty,V=f((e,t)=>Ha(e,"name",{value:t,configurable:!0}),"o$4");const Ga=42,Ya=V(e=>{let t=!1;for(let i=0;i<e.length;i++)if(e.codePointAt(i)===Ga){if(t)return!1;t=!0}return!0},"hasZeroOrOneAsteriskCharacter"),Xa=V(e=>{const t=e.indexOf("*");return t===-1?void 0:{prefix:e.slice(0,t),suffix:e.slice(t+1)}},"tryParsePattern"),Qa=V(({prefix:e,suffix:t},i)=>i.length>=e.length+t.length&&i.startsWith(e)&&i.endsWith(t),"isPatternMatch"),Za=V((e,t,i)=>{let o,n=-1;for(const a of e){const s=t(a);Qa(s,i)&&s.prefix.length>n&&(n=s.prefix.length,o=a)}return o},"findBestPatternMatch"),es=V((e,t)=>{const i=[];for(const o of e){if(!Ya(o))continue;const n=Xa(o);if(n)i.push(n);else if(o===t)return o}return Za(i,o=>o,t)},"matchPatternOrExact"),ts=V((e,t)=>t.substring(e.prefix.length,t.length-e.suffix.length),"matchedText"),is=V(({prefix:e,suffix:t})=>`${e}*${t}`,"patternText"),os=V((e,t,i)=>{let o=A(t.path);t.config.compilerOptions?.baseUrl&&(o=S(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"),si=V((e,t,i,o)=>{const{paths:n,resolvedBaseUrl:a}=os(e,t,i),s=Object.keys(n);return{name:"packem:resolve-tsconfig-paths",async resolveId(r,l,p){if(s.length===0)return null;if(r.includes("\0"))return i.debug({message:`Skipping resolution of ${r} as it is a virtual module`,prefix:"plugin:packem:resolve-tsconfig-paths"}),null;if(r.includes("node_modules"))return i.debug({message:`Skipping request as it is inside node_modules ${r}`,prefix:"plugin:packem:resolve-tsconfig-paths"}),null;if(!o.resolveAbsolutePath&&ve(r))return i.debug({message:`Skipping request as it is an absolute path ${r}`,prefix:"plugin:packem:resolve-tsconfig-paths"}),null;if(it(r))return i.debug({message:`Skipping request as it is a relative path ${r}`,prefix:"plugin:packem:resolve-tsconfig-paths"}),null;const c=es(s,r);if(!c)return i.debug({message:`moduleName did not match any paths pattern ${r}`,prefix:"plugin:packem:resolve-tsconfig-paths"}),null;const u=typeof c=="string"?void 0:ts(c,r),d=typeof c=="string"?c:is(c);for await(const m of n[d]){const h=u?m.replace("*",u):m;if(h.endsWith(".d.ts")||h.endsWith(".d.cts")||h.endsWith(".d.mts"))continue;const y=$(a,h);try{const b=await this.resolve(y,l,{skipSelf:!0,...p});if(b)return b}catch(b){i.debug({context:b,message:`Failed to resolve ${y} from ${r}`,prefix:"plugin:packem:resolve-tsconfig-paths"})}}return null}}},"resolveTsconfigPathsPlugin");var ns=Object.defineProperty,ri=f((e,t)=>ns(e,"name",{value:t,configurable:!0}),"u$5");const as=ri((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(S(e,s))}return a},"getRootDirectories"),pi=ri((e,t,i)=>{const o=as(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 r of o){const l=$(r,n),p=await this.resolve(l,a,{skipSelf:!0,...s});if(p)return t.debug({message:`Resolved ${n} to ${p.id} using rootDirs from tsconfig.json.`,prefix:"plugin:resolve-tsconfig-root-dirs"}),p.id}return null}}},"resolveTsconfigRootDirectories");var ss=Object.defineProperty,rs=f((e,t)=>ss(e,"name",{value:t,configurable:!0}),"r$7");const li=rs(()=>{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"),ci={"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(ci);const ps=new vo(ho,ci)._freeze();var ls=Object.defineProperty,at=f((e,t)=>ls(e,"name",{value:t,configurable:!0}),"u$4");const cs=at(async(e,t)=>{await new Promise((i,o)=>{const n=Po(e);n.on("error",o);const a=Do(t);a.on("error",o),a.on("finish",i),n.pipe(a)})},"copy"),ds=at(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"),us=at(({destDir:e,emitFiles:t,exclude:i,fileName:o,include:n,limit:a,publicPath:s,sourceDir:r})=>{const l=K(n,i),p={};return{async generateBundle(c){if(!t)return;const u=e??c.dir??A(c.file??"");await pt(u),await Promise.all(Object.keys(p).map(async d=>{const m=p[d],h=$(u,A(m));await pt(h),await cs(d,$(u,m))}))},async load(c){if(!l(c))return null;this.addWatchFile(c);const[u,d]=await Promise.all([tt(c),Hi(c)]);let m;if(a&&u.size>a||a===0){const h=Io.createHash("sha1").update(d).digest("hex").slice(0,16),y=Me(c),b=Z(c,y),v=r?_(r,A(c)):Z(A(c)),g=o.replaceAll("[hash]",h).replaceAll("[extname]",y).replaceAll("[dirname]",v===""?"":`${v}/`).replaceAll("[name]",b);m=$(s??"",g),p[c]=g}else{const h=ps.getType(c);if(h===null)throw new Error(`Could not determine mimetype for ${c}`);const y=h==="image/svg+xml";m=y?ds(d):d.toString("base64"),m=`data:${h}${y?"":";base64"},${m}`}return`export default "${m}"`},name:"packem:url"}},"urlPlugin");var ms=Object.defineProperty,fs=f((e,t)=>ms(e,"name",{value:t,configurable:!0}),"s$8");const gs=fs(e=>{const t=Z(e).split(".");if(t.length>=2){const[i,o]=t.slice(-2),n=t[0],a=/^(\w+)-runtime$/.exec(i)?.[1];if(Ie.includes(o)&&a&&a.length>0)return n+"-"+a}},"getCustomModuleLayer");var vs=Object.defineProperty,hs=f((e,t)=>vs(e,"name",{value:t,configurable:!0}),"i$4");const Ve=hs(e=>(e.preserveDirectives||{directives:[]}).directives.map(t=>t.replace(/^use /,"")).find(t=>t!=="strict"),"getModuleLayer");var xs=Object.defineProperty,St=f((e,t)=>xs(e,"name",{value:t,configurable:!0}),"d$8");const ys=St((e,t)=>{const i=new Map;return St(function(o,n){const a=n.getModuleInfo(o);if(!a)return;const{isEntry:s}=a,r=a.meta,l=Ve(r);if(!s){const p=i.get(o);if(p)return p;const c=gs(o);if(c)return i.set(o,c),c}if(s){const p=n.getModuleIds();for(const c of p)n.getModuleInfo(c)&&Ve(r)===l&&(e.has(c)||e.set(c,new Set),e.get(c).add([o,l]))}if(l&&!s&&e.has(o)){const p=[...e.get(o)];if(p.some(([u])=>{if(t.some(d=>d.path===u)){const d=n.getModuleInfo(u);return Ve(d?d.meta:{})===l}return!1}))return;if(p.every(([,u])=>u===l))return i.has(o)?i.get(o):void 0;const c=Z(o,Me(o))+"-"+l;return i.set(o,c),c}},"splitChunks")},"createSplitChunks");var bs=Object.defineProperty,ws=f((e,t)=>bs(e,"name",{value:t,configurable:!0}),"n$4");const Q=ws((e,t)=>e.isDynamicEntry?`${wo}/[name].${t}`:`${ko}/${e.name}-[hash].${t}`,"getChunkFilename");var ks=Object.defineProperty,$s=f((e,t)=>ks(e,"name",{value:t,configurable:!0}),"o$3");const js=process.platform==="win32",Ot=$s((e,t)=>{const i=js?"\\":"/";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 Es=Object.defineProperty,T=f((e,t)=>Es(e,"name",{value:t,configurable:!0}),"e$5");const di=T((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"),Ss=T((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"+Oi.node.split(".")[0];if(t.pkg.engines?.node){const o=Lt(t.pkg.engines.node);o&&(i="node"+o.major)}if(t.options.rollup.esbuild.target){const o=ge(t.options.rollup.esbuild.target);o.some(n=>n.startsWith("node"))||(t.options.rollup.esbuild.target=[...new Set([...ge(i),...o])])}else t.options.rollup.esbuild.target=ge(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"),ui=T((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(_(S(),e.id))}"
61
+ To replace these, add them to the "rollup -> patchTypes -> identifierReplacements" option in your packem config.`,prefix:"plugin:patch-types"}),$t.set(r,!0)}return e}g(ii,"I$1");ie(ii,"replaceConfusingTypeNames");const qa=ie((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 oi(e,t){if(e.includes("@internal")){const i=new ee(e),o=Co(e,{plugins:["typescript"],sourceType:"module"});if(ot(o,{enter(n){qa(i,n)&&this.skip()}}),e=i.toString(),e.includes("@internal"))throw new Error(`${t.fileName} has unhandled @internal declarations`)}return e}g(oi,"S$3");ie(oi,"stripInternalTypes");const Ua=ie((e,t)=>({name:"packem:patch-types",renderChunk(i,o){return i=ii.call(this,i,o,e,t),i=oi.call(this,i,o),i=La(i),i},resolveId(i){return i.startsWith("types/")?{external:!0,id:"../../"+(i.endsWith(".js")?i:i+".js")}:null}}),"patchTypescriptTypes");var Ka=Object.defineProperty,V=g((e,t)=>Ka(e,"name",{value:t,configurable:!0}),"a$e");const Va=42,Ha=V(e=>{let t=!1;for(let i=0;i<e.length;i++)if(e.codePointAt(i)===Va){if(t)return!1;t=!0}return!0},"hasZeroOrOneAsteriskCharacter"),Ga=V(e=>{const t=e.indexOf("*");return t===-1?void 0:{prefix:e.slice(0,t),suffix:e.slice(t+1)}},"tryParsePattern"),Ya=V(({prefix:e,suffix:t},i)=>i.length>=e.length+t.length&&i.startsWith(e)&&i.endsWith(t),"isPatternMatch"),Xa=V((e,t,i)=>{let o,n=-1;for(const a of e){const s=t(a);Ya(s,i)&&s.prefix.length>n&&(n=s.prefix.length,o=a)}return o},"findBestPatternMatch"),Qa=V((e,t)=>{const i=[];for(const o of e){if(!Ha(o))continue;const n=Ga(o);if(n)i.push(n);else if(o===t)return o}return Xa(i,o=>o,t)},"matchPatternOrExact"),Za=V((e,t)=>t.substring(e.prefix.length,t.length-e.suffix.length),"matchedText"),es=V(({prefix:e,suffix:t})=>`${e}*${t}`,"patternText"),ts=V((e,t,i)=>{let o=A(t.path);t.config.compilerOptions?.baseUrl&&(o=O(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"),ni=V((e,t,i,o)=>{const{paths:n,resolvedBaseUrl:a}=ts(e,t,i),s=Object.keys(n);return{name:"packem:resolve-tsconfig-paths",async resolveId(r,l,p){if(s.length===0)return null;if(r.includes("\0"))return i.debug({message:`Skipping resolution of ${r} as it is a virtual module`,prefix:"plugin:packem:resolve-tsconfig-paths"}),null;if(r.includes("node_modules"))return i.debug({message:`Skipping request as it is inside node_modules ${r}`,prefix:"plugin:packem:resolve-tsconfig-paths"}),null;if(!o.resolveAbsolutePath&&_e(r))return i.debug({message:`Skipping request as it is an absolute path ${r}`,prefix:"plugin:packem:resolve-tsconfig-paths"}),null;if(tt(r))return i.debug({message:`Skipping request as it is a relative path ${r}`,prefix:"plugin:packem:resolve-tsconfig-paths"}),null;const c=Qa(s,r);if(!c)return i.debug({message:`moduleName did not match any paths pattern ${r}`,prefix:"plugin:packem:resolve-tsconfig-paths"}),null;const u=typeof c=="string"?void 0:Za(c,r),d=typeof c=="string"?c:es(c);for await(const m of n[d]){const b=u?m.replace("*",u):m;if(b.endsWith(".d.ts")||b.endsWith(".d.cts")||b.endsWith(".d.mts"))continue;const w=$(a,b);try{const x=await this.resolve(w,l,{skipSelf:!0,...p});if(x)return x}catch(x){i.debug({context:x,message:`Failed to resolve ${w} from ${r}`,prefix:"plugin:packem:resolve-tsconfig-paths"})}}return null}}},"resolveTsconfigPathsPlugin");var is=Object.defineProperty,ai=g((e,t)=>is(e,"name",{value:t,configurable:!0}),"u$6");const os=ai((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(O(e,s))}return a},"getRootDirectories"),si=ai((e,t,i)=>{const o=os(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 r of o){const l=$(r,n),p=await this.resolve(l,a,{skipSelf:!0,...s});if(p)return t.debug({message:`Resolved ${n} to ${p.id} using rootDirs from tsconfig.json.`,prefix:"plugin:resolve-tsconfig-root-dirs"}),p.id}return null}}},"resolveTsconfigRootDirectories");var ns=Object.defineProperty,as=g((e,t)=>ns(e,"name",{value:t,configurable:!0}),"r$7");const ri=as(()=>{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"),pi={"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(pi);const ss=new fo(go,pi)._freeze();var rs=Object.defineProperty,nt=g((e,t)=>rs(e,"name",{value:t,configurable:!0}),"u$5");const ps=nt(async(e,t)=>{await new Promise((i,o)=>{const n=So(e);n.on("error",o);const a=Oo(t);a.on("error",o),a.on("finish",i),n.pipe(a)})},"copy"),ls=nt(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"),cs=nt(({destDir:e,emitFiles:t,exclude:i,fileName:o,include:n,limit:a,publicPath:s,sourceDir:r})=>{const l=K(n,i),p={};return{async generateBundle(c){if(!t)return;const u=e??c.dir??A(c.file??"");await rt(u),await Promise.all(Object.keys(p).map(async d=>{const m=p[d],b=$(u,A(m));await rt(b),await ps(d,$(u,m))}))},async load(c){if(!l(c))return null;this.addWatchFile(c);const[u,d]=await Promise.all([et(c),Ki(c)]);let m;if(a&&u.size>a||a===0){const b=_o.createHash("sha1").update(d).digest("hex").slice(0,16),w=Me(c),x=Z(c,w),f=r?_(r,A(c)):Z(A(c)),v=o.replaceAll("[hash]",b).replaceAll("[extname]",w).replaceAll("[dirname]",f===""?"":`${f}/`).replaceAll("[name]",x);m=$(s??"",v),p[c]=v}else{const b=ss.getType(c);if(b===null)throw new Error(`Could not determine mimetype for ${c}`);const w=b==="image/svg+xml";m=w?ls(d):d.toString("base64"),m=`data:${b}${w?"":";base64"},${m}`}return`export default "${m}"`},name:"packem:url"}},"urlPlugin");var ds=Object.defineProperty,us=g((e,t)=>ds(e,"name",{value:t,configurable:!0}),"s$8");const ms=us(e=>{const t=Z(e).split(".");if(t.length>=2){const[i,o]=t.slice(-2),n=t[0],a=/^(\w+)-runtime$/.exec(i)?.[1];if(Ie.includes(o)&&a&&a.length>0)return n+"-"+a}},"getCustomModuleLayer");var fs=Object.defineProperty,gs=g((e,t)=>fs(e,"name",{value:t,configurable:!0}),"i$4");const Ke=gs(e=>(e.preserveDirectives||{directives:[]}).directives.map(t=>t.replace(/^use /,"")).find(t=>t!=="strict"),"getModuleLayer");var vs=Object.defineProperty,jt=g((e,t)=>vs(e,"name",{value:t,configurable:!0}),"d$8");const hs=jt((e,t)=>{const i=new Map;return jt(function(o,n){const a=n.getModuleInfo(o);if(!a)return;const{isEntry:s}=a,r=a.meta,l=Ke(r);if(!s){const p=i.get(o);if(p)return p;const c=ms(o);if(c)return i.set(o,c),c}if(s){const p=n.getModuleIds();for(const c of p)n.getModuleInfo(c)&&Ke(r)===l&&(e.has(c)||e.set(c,new Set),e.get(c).add([o,l]))}if(l&&!s&&e.has(o)){const p=[...e.get(o)];if(p.some(([u])=>{if(t.some(d=>d.path===u)){const d=n.getModuleInfo(u);return Ke(d?d.meta:{})===l}return!1}))return;if(p.every(([,u])=>u===l))return i.has(o)?i.get(o):void 0;const c=Z(o,Me(o))+"-"+l;return i.set(o,c),c}},"splitChunks")},"createSplitChunks");var xs=Object.defineProperty,ys=g((e,t)=>xs(e,"name",{value:t,configurable:!0}),"n$4");const Q=ys((e,t)=>e.isDynamicEntry?`${yo}/[name].${t}`:`${bo}/${e.name}-[hash].${t}`,"getChunkFilename");var bs=Object.defineProperty,ws=g((e,t)=>bs(e,"name",{value:t,configurable:!0}),"o$4");const ks=process.platform==="win32",Et=ws((e,t)=>{const i=ks?"\\":"/";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 $s=Object.defineProperty,T=g((e,t)=>$s(e,"name",{value:t,configurable:!0}),"e$5");const li=T((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"),js=T((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"+Ei.node.split(".")[0];if(t.pkg.engines?.node){const o=Wt(t.pkg.engines.node);o&&(i="node"+o.major)}if(t.options.rollup.esbuild.target){const o=ge(t.options.rollup.esbuild.target);o.some(n=>n.startsWith("node"))||(t.options.rollup.esbuild.target=[...new Set([...ge(i),...o])])}else t.options.rollup.esbuild.target=ge(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"),ci=T((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(_(O(),e.id))}"
62
62
  Is the module installed? Note:
63
63
  ↳ to inline a module into your bundle, install it to "devDependencies".
64
- ↳ 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"),mi=T((e,t)=>({input:Object.fromEntries(e.options.entries.map(i=>[i.name,S(e.options.rootDir,i.input)])),logLevel:e.options.debug?"debug":"info",onLog:T((i,o)=>{let n=o.message;switch(o.stack&&(n=`${n}
65
- ${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){ui(i,e)||i.code||o(i)},treeshake:{moduleSideEffects:!0,preset:"smallest"},watch:e.mode==="watch"?e.options.rollup.watch:!1}),"baseRollupOptions"),fi=T(async(e,t)=>{const i=Ae(e.pkg,e.options);let o;e.options.rollup.resolve&&(o=Wt({...e.options.rollup.resolve}));const n=e.options.rollup.output?.preserveModules?{preserveModules:!0,preserveModulesRoot:e.options.rollup.output.preserveModulesRoot??"src"}:{manualChunks:ys(e.dependencyGraphMap,e.buildEntries),preserveModules:!1},[a,s,r]=di(e.options.rollup.plugins,"build");return{...mi(e,"build"),output:[e.options.emitCJS&&{assetFileNames:"[name]-[hash][extname]",chunkFileNames:T(l=>Q(l,"cjs"),"chunkFileNames"),compact:e.options.minify,dir:S(e.options.rootDir,e.options.outDir),entryFileNames:T(l=>Ot(l,"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:T(l=>Q(l,"mjs"),"chunkFileNames"),compact:e.options.minify,dir:S(e.options.rootDir,e.options.outDir),entryFileNames:T(l=>Ot(l,"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(oi(),t),I(li(),t),e.tsconfig&&I(pi(e.options.rootDir,e.logger,e.tsconfig),t),e.tsconfig&&e.options.rollup.tsconfigPaths&&I(si(e.options.rootDir,e.tsconfig,e.logger,e.options.rollup.tsconfigPaths),t),I(ii(e.pkg,e.tsconfig,e.options,e.logger,e.options.rollup.resolveExternals??{}),t),e.options.rollup.replace&&Bt({sourcemap:e.options.sourcemap,...e.options.rollup.replace}),e.options.rollup.alias&&Jt({customResolver:o,...e.options.rollup.alias,entries:i}),...a,o,e.options.rollup.polyfillNode&&eo({sourceMap:e.options.sourcemap,...e.options.rollup.polyfillNode}),e.options.rollup.json&&Yt({...e.options.rollup.json}),on(),e.options.rollup.wasm&&Zi(e.options.rollup.wasm),e.options.rollup.url&&us(e.options.rollup.url),e.options.rollup.css&&e.options.rollup.css.loaders&&e.options.rollup.css.loaders.length>0&&await En({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&&Dn(e.options.rollup.css,e.options.rootDir,e.logger),e.options.rollup.raw&&I(ja(e.options.rollup.raw),t),e.options.sourcemap&&Aa(e.options.rollup.sourcemap),...s,e.options.declaration&&e.options.rollup.isolatedDeclarations&&e.options.isolatedDeclarationTransformer&&Hn($(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(Ss(e.options.transformerName,e)),I(wa({directiveRegex:/^['|"](use (\w+))['|"]$/,...e.options.rollup.preserveDirectives,logger:e.logger}),t),e.options.rollup.shebang&&Ca(e.options.entries.filter(l=>l.executable).map(l=>l.name).filter(Boolean),e.options.rollup.shebang),e.options.cjsInterop&&e.options.emitCJS&&Gt({...e.options.rollup.cjsInterop,logger:e.logger,type:e.pkg.type??"commonjs"}),e.options.rollup.dynamicVars&&Rn(),e.options.rollup.dynamicVars&&Qi(e.options.rollup.dynamicVars),e.options.rollup.commonjs&&I(Xi({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&&Tn(e.pkg,e.options.rollup.shim),e.options.rollup.jsxRemoveAttributes&&I(sa({attributes:e.options.rollup.jsxRemoveAttributes.attributes,logger:e.logger}),t),...r,e.options.rollup.metafile&&da(),e.options.rollup.copy&&un(e.options.rollup.copy,e.logger),e.options.rollup.license&&e.options.rollup.license.path&&typeof e.options.rollup.license.dependenciesTemplate=="function"&&ei({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}),xa(),e.options.emitCJS&&e.mode==="build"&&e.options.declaration==="compatible"&&e.options.rollup.node10Compatibility&&fa(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&&to({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"),Os=T(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"),Ps=Lo(Os),gi=T(async(e,t)=>{const i=Ae(e.pkg,e.options),o=e.tsconfig?.config.compilerOptions;delete o?.lib;let n;e.options.rollup.resolve&&(n=Wt({...e.options.rollup.resolve}));const a="dts-plugin:"+process.pid+e.tsconfig.path,[s,r,l]=di(e.options.rollup.plugins,"dts");return{...mi(e,"dts"),onwarn(p,c){ui(p,e)||p.code!=="EMPTY_BUNDLE"&&c(p)},output:[e.options.emitCJS&&{chunkFileNames:T(p=>Q(p,"d.cts"),"chunkFileNames"),compact:e.options.minify,dir:S(e.options.rootDir,e.options.outDir),entryFileNames:"[name].d.cts",format:"cjs",sourcemap:e.options.sourcemap,...e.options.rollup.output},e.options.emitESM&&{chunkFileNames:T(p=>Q(p,"d.mts"),"chunkFileNames"),compact:e.options.minify,dir:S(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:T(p=>Q(p,"d.ts"),"chunkFileNames"),compact:e.options.minify,dir:S(e.options.rootDir,e.options.outDir),entryFileNames:"[name].d.ts",format:"cjs",sourcemap:e.options.sourcemap,...e.options.rollup.output}].filter(Boolean),plugins:[I(oi(),t),I(li(),t),e.options.rollup.json&&Yt({...e.options.rollup.json}),{load(p){return/\.(?:js|cjs|mjs|jsx|ts|tsx|ctsx|mtsx|mts|json)$/.test(p)?null:""},name:"packem:ignore-files"},e.tsconfig&&I(pi(e.options.rootDir,e.logger,e.tsconfig),t),e.tsconfig&&e.options.rollup.tsconfigPaths&&I(si(e.options.rootDir,e.tsconfig,e.logger,e.options.rollup.tsconfigPaths),t),I(ii(e.pkg,e.tsconfig,e.options,e.logger,e.options.rollup.resolveExternals??{}),t),e.options.rollup.replace&&Bt({sourcemap:e.options.sourcemap,...e.options.rollup.replace}),e.options.rollup.alias&&Jt({customResolver:n,...e.options.rollup.alias,entries:i}),...s,n,...r,await Ps(a)(e),e.options.cjsInterop&&e.options.emitCJS&&Gt({...e.options.rollup.cjsInterop,logger:e.logger,type:e.pkg.type??"commonjs"}),e.options.rollup.patchTypes&&I(Va(e.options.rollup.patchTypes,e.logger),t),_a(),...l,e.options.rollup.license&&e.options.rollup.license.path&&typeof e.options.rollup.license.dtsTemplate=="function"&&ei({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 Ds=Object.defineProperty,Ns=f((e,t)=>Ds(e,"name",{value:t,configurable:!0}),"m$5");const Pt="rollup-build.json",Cs=Ns(async(e,t,i)=>{const o=await fi(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(Pt,i));const a=await zt(o);n&&t.set(Pt,a.cache,i),await e.hooks.callHook("rollup:build",e,a);const s=new Map;for(const r of o.output){const{output:l}=await a.write(r),p=new Set,c=l.filter(d=>d.type==="chunk");for(const d of c){p.add(d.fileName);for(const m of d.imports)e.usedImports.add(m);d.isEntry&&e.buildEntries.push({bytes:Buffer.byteLength(d.code,"utf8"),chunks:d.imports.filter(m=>c.find(h=>h.fileName===m)),exports:d.exports,modules:Object.entries(d.modules).map(([m,h])=>({bytes:h.renderedLength,id:m})),path:d.fileName,type:"entry"})}const u=l.filter(d=>d.type==="asset");for(const d of u)s.has(d.fileName)||s.set(d.fileName,{bytes:Buffer.byteLength(d.source,"utf8"),path:d.fileName,type:"asset"});for(const d of p)e.usedImports.delete(d)}e.buildEntries.push(...s.values())},"build");var _s=Object.defineProperty,we=f((e,t)=>_s(e,"name",{value:t,configurable:!0}),"a$9");const Dt="rollup-dts.json",Ms=we(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 gi(e,t);if(await e.hooks.callHook("rollup:dts:options",e,o),Object.keys(o.input).length===0)return;o.cache=t.get(Dt,i);const n=await zt(o);t.set(Dt,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:we(a=>Q(a,"d.cts"),"chunkFileNames"),dir:S(e.options.rootDir,e.options.outDir),entryFileNames:"[name].d.cts"}),e.options.emitESM&&await n.write({chunkFileNames:we(a=>Q(a,"d.mts"),"chunkFileNames"),dir:S(e.options.rootDir,e.options.outDir),entryFileNames:"[name].d.mts"}),e.options.declaration==="compatible"&&await n.write({chunkFileNames:we(a=>Q(a,"d.mjs"),"chunkFileNames"),dir:S(e.options.rootDir,e.options.outDir),entryFileNames:"[name].d.ts"}),await e.hooks.callHook("rollup:dts:done",e)},"buildTypes");var Is=Object.defineProperty,Ts=f((e,t)=>Is(e,"name",{value:t,configurable:!0}),"y$4");const As=Ts((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 Fs=Object.defineProperty,De=f((e,t)=>Fs(e,"name",{value:t,configurable:!0}),"j$1");const Rs=De((e,t)=>{const i=De(s=>_(t.options.rootDir,S(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:
64
+ ↳ 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"),di=T((e,t)=>({input:Object.fromEntries(e.options.entries.map(i=>[i.name,O(e.options.rootDir,i.input)])),logLevel:e.options.debug?"debug":"info",onLog:T((i,o)=>{let n=o.message;switch(o.stack&&(n=`${n}
65
+ ${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){ci(i,e)||i.code||o(i)},treeshake:{moduleSideEffects:!0,preset:"smallest"},watch:e.mode==="watch"?e.options.rollup.watch:!1}),"baseRollupOptions"),ui=T(async(e,t)=>{const i=Ae(e.pkg,e.options);let o;e.options.rollup.resolve&&(o=zt({...e.options.rollup.resolve}));const n=e.options.rollup.output?.preserveModules?{preserveModules:!0,preserveModulesRoot:e.options.rollup.output.preserveModulesRoot??"src"}:{manualChunks:hs(e.dependencyGraphMap,e.buildEntries),preserveModules:!1},[a,s,r]=li(e.options.rollup.plugins,"build");return{...di(e,"build"),output:[e.options.emitCJS&&{assetFileNames:"[name]-[hash][extname]",chunkFileNames:T(l=>Q(l,"cjs"),"chunkFileNames"),compact:e.options.minify,dir:O(e.options.rootDir,e.options.outDir),entryFileNames:T(l=>Et(l,"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:T(l=>Q(l,"mjs"),"chunkFileNames"),compact:e.options.minify,dir:O(e.options.rootDir,e.options.outDir),entryFileNames:T(l=>Et(l,"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(ti(),t),I(ri(),t),e.tsconfig&&I(si(e.options.rootDir,e.logger,e.tsconfig),t),e.tsconfig&&e.options.rollup.tsconfigPaths&&I(ni(e.options.rootDir,e.tsconfig,e.logger,e.options.rollup.tsconfigPaths),t),I(ei(e.pkg,e.tsconfig,e.options,e.logger,e.options.rollup.resolveExternals??{}),t),e.options.rollup.replace&&Jt({sourcemap:e.options.sourcemap,...e.options.rollup.replace}),e.options.rollup.alias&&Rt({customResolver:o,...e.options.rollup.alias,entries:i}),...a,o,e.options.rollup.polyfillNode&&Qi({sourceMap:e.options.sourcemap,...e.options.rollup.polyfillNode}),e.options.rollup.json&&Ht({...e.options.rollup.json}),en(),e.options.rollup.wasm&&Xi(e.options.rollup.wasm),e.options.rollup.url&&cs(e.options.rollup.url),e.options.rollup.css&&e.options.rollup.css.loaders&&e.options.rollup.css.loaders.length>0&&await $n({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&&On(e.options.rollup.css,e.options.rootDir,e.logger),e.options.rollup.raw&&I(ka(e.options.rollup.raw),t),e.options.sourcemap&&Ia(e.options.rollup.sourcemap),...s,e.options.declaration&&e.options.rollup.isolatedDeclarations&&e.options.isolatedDeclarationTransformer&&Kn($(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(js(e.options.transformerName,e)),I(ya({directiveRegex:/^['|"](use (\w+))['|"]$/,...e.options.rollup.preserveDirectives,logger:e.logger}),t),e.options.rollup.shebang&&Pa(e.options.entries.filter(l=>l.executable).map(l=>l.name).filter(Boolean),e.options.rollup.shebang),e.options.cjsInterop&&e.options.emitCJS&&Vt({...e.options.rollup.cjsInterop,logger:e.logger,type:e.pkg.type??"commonjs"}),e.options.rollup.dynamicVars&&An(),e.options.rollup.dynamicVars&&Yi(e.options.rollup.dynamicVars),e.options.rollup.commonjs&&I(Gi({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&&Mn(e.pkg,e.options.rollup.shim),e.options.rollup.jsxRemoveAttributes&&I(na({attributes:e.options.rollup.jsxRemoveAttributes.attributes,logger:e.logger}),t),...r,e.options.rollup.metafile&&la(),e.options.rollup.copy&&cn(e.options.rollup.copy,e.logger),e.options.rollup.license&&e.options.rollup.license.path&&typeof e.options.rollup.license.dependenciesTemplate=="function"&&Qt({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}),va(),e.options.emitCJS&&e.mode==="build"&&e.options.declaration==="compatible"&&e.options.rollup.node10Compatibility&&ua(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&&Zi({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"),Es=T(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"),Ss=Wo(Es),mi=T(async(e,t)=>{const i=Ae(e.pkg,e.options),o=e.tsconfig?.config.compilerOptions;delete o?.lib;let n;e.options.rollup.resolve&&(n=zt({...e.options.rollup.resolve}));const a="dts-plugin:"+process.pid+e.tsconfig.path,[s,r,l]=li(e.options.rollup.plugins,"dts");return{...di(e,"dts"),onwarn(p,c){ci(p,e)||p.code!=="EMPTY_BUNDLE"&&c(p)},output:[e.options.emitCJS&&{chunkFileNames:T(p=>Q(p,"d.cts"),"chunkFileNames"),compact:e.options.minify,dir:O(e.options.rootDir,e.options.outDir),entryFileNames:"[name].d.cts",format:"cjs",sourcemap:e.options.sourcemap,...e.options.rollup.output},e.options.emitESM&&{chunkFileNames:T(p=>Q(p,"d.mts"),"chunkFileNames"),compact:e.options.minify,dir:O(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:T(p=>Q(p,"d.ts"),"chunkFileNames"),compact:e.options.minify,dir:O(e.options.rootDir,e.options.outDir),entryFileNames:"[name].d.ts",format:"cjs",sourcemap:e.options.sourcemap,...e.options.rollup.output}].filter(Boolean),plugins:[I(ti(),t),I(ri(),t),e.options.rollup.json&&Ht({...e.options.rollup.json}),{load(p){return/\.(?:js|cjs|mjs|jsx|ts|tsx|ctsx|mtsx|mts|json)$/.test(p)?null:""},name:"packem:ignore-files"},e.tsconfig&&I(si(e.options.rootDir,e.logger,e.tsconfig),t),e.tsconfig&&e.options.rollup.tsconfigPaths&&I(ni(e.options.rootDir,e.tsconfig,e.logger,e.options.rollup.tsconfigPaths),t),I(ei(e.pkg,e.tsconfig,e.options,e.logger,e.options.rollup.resolveExternals??{}),t),e.options.rollup.replace&&Jt({sourcemap:e.options.sourcemap,...e.options.rollup.replace}),e.options.rollup.alias&&Rt({customResolver:n,...e.options.rollup.alias,entries:i}),...s,n,...r,await Ss(a)(e),e.options.cjsInterop&&e.options.emitCJS&&Vt({...e.options.rollup.cjsInterop,logger:e.logger,type:e.pkg.type??"commonjs"}),e.options.rollup.patchTypes&&I(Ua(e.options.rollup.patchTypes,e.logger),t),Na(),...l,e.options.rollup.license&&e.options.rollup.license.path&&typeof e.options.rollup.license.dtsTemplate=="function"&&Qt({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 Os=Object.defineProperty,Ds=g((e,t)=>Os(e,"name",{value:t,configurable:!0}),"m$5");const St="rollup-build.json",Ps=Ds(async(e,t,i)=>{const o=await ui(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(St,i));const a=await Ft(o);n&&t.set(St,a.cache,i),await e.hooks.callHook("rollup:build",e,a);const s=new Map;for(const r of o.output){const{output:l}=await a.write(r),p=new Set,c=l.filter(d=>d.type==="chunk");for(const d of c){p.add(d.fileName);for(const m of d.imports)e.usedImports.add(m);d.isEntry&&e.buildEntries.push({bytes:Buffer.byteLength(d.code,"utf8"),chunks:d.imports.filter(m=>c.find(b=>b.fileName===m)),exports:d.exports,modules:Object.entries(d.modules).map(([m,b])=>({bytes:b.renderedLength,id:m})),path:d.fileName,type:"entry"})}const u=l.filter(d=>d.type==="asset");for(const d of u)s.has(d.fileName)||s.set(d.fileName,{bytes:Buffer.byteLength(d.source,"utf8"),path:d.fileName,type:"asset"});for(const d of p)e.usedImports.delete(d)}e.buildEntries.push(...s.values())},"build");var Ns=Object.defineProperty,be=g((e,t)=>Ns(e,"name",{value:t,configurable:!0}),"a$9");const Ot="rollup-dts.json",Cs=be(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 mi(e,t);if(await e.hooks.callHook("rollup:dts:options",e,o),Object.keys(o.input).length===0)return;o.cache=t.get(Ot,i);const n=await Ft(o);t.set(Ot,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:be(a=>Q(a,"d.cts"),"chunkFileNames"),dir:O(e.options.rootDir,e.options.outDir),entryFileNames:"[name].d.cts"}),e.options.emitESM&&await n.write({chunkFileNames:be(a=>Q(a,"d.mts"),"chunkFileNames"),dir:O(e.options.rootDir,e.options.outDir),entryFileNames:"[name].d.mts"}),e.options.declaration==="compatible"&&await n.write({chunkFileNames:be(a=>Q(a,"d.mjs"),"chunkFileNames"),dir:O(e.options.rootDir,e.options.outDir),entryFileNames:"[name].d.ts"}),await e.hooks.callHook("rollup:dts:done",e)},"buildTypes");var _s=Object.defineProperty,Ms=g((e,t)=>_s(e,"name",{value:t,configurable:!0}),"y$4");const Is=Ms((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 Ts=Object.defineProperty,De=g((e,t)=>Ts(e,"name",{value:t,configurable:!0}),"j$1");const As=De((e,t)=>{const i=De(s=>_(t.options.rootDir,O(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:
66
66
  `);for(const s of a){let r=s.bytes??0;for(const p of s.chunks??[])r+=t.buildEntries.find(c=>c.path===p)?.bytes??0;let l=` ${L(i(s.path))} (${["total size: "+P(G(r)),s.bytes&&"chunk size: "+P(G(s.bytes))].filter(Boolean).join(", ")})`;if(l+=s.exports?.length?`
67
67
  exports: `+Y(s.exports.join(", ")):"",s.chunks?.length&&(l+=`
68
68
  ${s.chunks.map(p=>{const c=t.buildEntries.find(u=>u.path===p)??{};return Y(" └─ "+i(p)+L(c.bytes?" ("+G(c?.bytes)+")":""))}).join(`
@@ -79,29 +79,29 @@ ${s.chunks.map(p=>{const c=t.buildEntries.find(u=>u.path===p)??{};return Y("
79
79
  └─ `)+L(i(r.path))+" (total size: "+P(G(r.bytes??0))+")");s+=`
80
80
 
81
81
  `,e.raw(s)}return o&&e.raw("Σ Total dist size (byte size):",P(G(t.buildEntries.reduce((s,r)=>s+(r.bytes??0),0),{decimals:2})),`
82
- `),o},"showSizeInformation"),zs=De((e,t)=>{const i=As(e.options.entries,"environment","runtime"),o=new Set,n=new Set;for(const[a,s]of Object.entries(i))for(const[r,l]of Object.entries(s)){const p={...e};!e.options.dtsOnly&&(a!=="undefined"||r!=="undefined")&&e.logger.info("Preparing build for "+(a==="undefined"?"":P(a)+" environment"+(r==="undefined"?"":" with "))+(r==="undefined"?"":P(r)+" runtime"));const c={};p.options.rollup.replace?(p.options.rollup.replace.values===void 0&&(p.options.rollup.replace.values={}),a!=="undefined"&&(c[["process","env","NODE_ENV"].join(".")]=JSON.stringify(a)),c[["process","env","EdgeRuntime"].join(".")]=JSON.stringify(r==="edge-light"),Object.freeze(c)):e.logger.warn("'replace' plugin is disabled. You should enable it to replace 'process.env.*' environments.");let u="";a!=="undefined"&&(u+=a+"/"),r!=="undefined"&&(u+=r+"/");let d=!1;p.options.minify!==void 0&&(d=p.options.minify),a==="development"?d=!1:a==="production"&&(d=!0);const m=[],h=[],y=[],b=[];for(const v of l)v.cjs&&v.esm?m.push(v):v.cjs?y.push(v):v.esm?h.push(v):v.declaration&&b.push(v);if(m.length>0){const v={...p,options:{...p.options,emitCJS:!0,emitESM:!0,entries:m,minify:d,rollup:{...p.options.rollup,replace:p.options.rollup.replace?{...p.options.rollup.replace,values:{...p.options.rollup.replace.values,...c}}:!1}}};if(e.options.dtsOnly||o.add({context:v,fileCache:t,subDirectory:u}),e.options.declaration){const g=v.options.entries.filter(w=>w.declaration);g.length>0&&n.add({context:{...v,options:{...v.options,entries:g}},fileCache:t,subDirectory:u})}}if(h.length>0){const v={...p,options:{...p.options,emitCJS:!1,emitESM:!0,entries:h,minify:d,rollup:{...p.options.rollup,replace:p.options.rollup.replace?{...p.options.rollup.replace,values:{...p.options.rollup.replace.values,...c}}:!1}}};if(e.options.dtsOnly||o.add({context:v,fileCache:t,subDirectory:u}),e.options.declaration){const g=v.options.entries.filter(w=>w.declaration);g.length>0&&n.add({context:{...v,options:{...v.options,entries:g}},fileCache:t,subDirectory:u})}}if(y.length>0){const v={...p,options:{...p.options,emitCJS:!0,emitESM:!1,entries:y,minify:d,rollup:{...p.options.rollup,replace:p.options.rollup.replace?{...p.options.rollup.replace,values:{...p.options.rollup.replace.values,...c}}:!1}}};if(e.options.dtsOnly||o.add({context:v,fileCache:t,subDirectory:u}),e.options.declaration){const g=v.options.entries.filter(w=>w.declaration);g.length>0&&n.add({context:{...v,options:{...v.options,entries:g}},fileCache:t,subDirectory:u})}}p.options.declaration&&b.length>0&&n.add({context:{...p,options:{...p.options,emitCJS:!1,emitESM:!1,entries:b,minify:d,rollup:{...p.options.rollup,replace:p.options.rollup.replace?{...p.options.rollup.replace,values:{...p.options.rollup.replace.values,...c}}:!1}}},fileCache:t,subDirectory:u})}return{builders:o,typeBuilders:n}},"prepareRollupConfig"),Js=De(async(e,t)=>{await e.hooks.callHook("build:before",e);const{builders:i,typeBuilders:o}=zs(e,t);await Promise.all([...i].map(async({context:n,fileCache:a,subDirectory:s})=>await Cs(n,a,s))),await Promise.all([...o].map(async({context:n,fileCache:a,subDirectory:s})=>await Ms(n,a,s))),e.logger.success(Pi(e.options.name?"Build succeeded for "+e.options.name:"Build succeeded"));for await(const n of Ti($(e.options.rootDir,e.options.outDir))){let a=e.buildEntries.find(s=>$(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 tt(S(e.options.rootDir,e.options.outDir,n.path));a.bytes=s.size}}return await e.hooks.callHook("build:done",e),Rs(e.logger,e)},"build");var Ws=Object.defineProperty,Bs=f((e,t)=>Ws(e,"name",{value:t,configurable:!0}),"r$5");const O=Bs((e,t)=>{e.warnings.has(t)||e.warnings.add(t)},"warn");var Ls=Object.defineProperty,vi=f((e,t)=>Ls(e,"name",{value:t,configurable:!0}),"t$4");const Ne=vi(e=>{if(e.endsWith(".mjs")||e.endsWith(".d.mts"))return"esm";if(e.endsWith(".cjs")||e.endsWith(".d.cts"))return"cjs"},"inferExportTypeFromFileName"),Ze=vi((e,t,i,o)=>{if(e==="module-sync")return"esm";if(o){const s=Ne(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 Ze(n,a,i,o)},"inferExportType");var qs=Object.defineProperty,Us=f((e,t)=>qs(e,"name",{value:t,configurable:!0}),"y$3");const Ks=new Set(["electron","import","require","node","node-addons","default","types","deno","browser","module-sync","bun","workerd",...Ut,...Oe]),st=Us((e,t,i,o=[])=>{if(!e)return[];if(typeof e=="string"){const n=Ne(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,r]of n)if(typeof r=="string"){let l={};Number.isInteger(+s)?l={exportKey:"*"}:s.startsWith("./")?l={exportKey:s.replace("./","")}:l={exportKey:s==="."?".":"*",subKey:s},a.push({...l,file:r,key:"exports",type:Ze(s,o,t,r)})}else if(typeof r=="object"&&r!==null)for(const[l,p]of Object.entries(r)){if(i===!1&&l==="types")continue;const c=Number.isInteger(+s)?l:s;typeof p=="string"?a.push({exportKey:c.replace("./",""),file:p,key:"exports",...Ks.has(l)?{subKey:l}:{},type:Ze(l,o,t,p)}):a=[...a,...st({[c]:p},t,i,[...o,l])]}return a}return[]},"extractExportFilenames");var Vs=Object.defineProperty,Re=f((e,t)=>Vs(e,"name",{value:t,configurable:!0}),"y$2");const Hs=Re((e,t)=>e.key==="exports"&&e.subKey===fe?fe:e.key==="exports"&&e.subKey===gt?gt:t,"getEnvironment"),ke=Re((e,t,i,o,n,a,s)=>{const r=Hs(n,a.environment);let l="node";for(const u of Ut)if(n.file.includes("."+u+".")||n.subKey===u){l=u;break}let p=e.find(u=>u.input===t&&u.environment===r&&u.runtime===l);p===void 0?p=e[e.push({environment:r,exportKey:new Set([n.exportKey].filter(Boolean)),input:t,runtime:l})-1]:p.exportKey&&n.exportKey&&p.exportKey.add(n.exportKey),s&&(p.isGlob=!0),i&&(p.outDir=o),n.isExecutable?(p.executable=!0,p.declaration=!1,n.type==="cjs"?p.cjs=!0:n.type==="esm"&&(p.esm=!0)):(/\.d\.[mc]?ts$/.test(n.file)&&a.options.declaration!==!1&&(p.declaration=a.options.declaration),n.type==="cjs"?p.cjs=!0:n.type==="esm"&&(p.esm=!0));const c=n.file.replace(Me(n.file),"").replace(new RegExp(`^./${a.options.outDir.replace(/^\.\//,"")}/`),"");Oe.has(n.subKey)&&!t.includes(c)&&(p.fileAlias=c)},"createOrUpdateEntry");let Nt=!1;const Ct=Re(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"),Gs=Re((e,t,i)=>{const o=[];t.sort((r,l)=>r.split("/").length-l.split("/").length);const n=e.type==="module"?"esm":"cjs";n==="esm"&&(i.options.emitESM=!0),n==="cjs"&&(i.options.emitCJS=!0);const a=st(e.exports,n,i.options.declaration);if(e.bin){const r=(typeof e.bin=="string"?[e.bin]:Object.values(e.bin)).filter(Boolean);for(const l of r){const p=Ne(l);if(p&&p!==n)throw new Error(`Exported file "${l}" has an extension that does not match the package.json type "${e.type??"commonjs"}".`);a.push({file:l,isExecutable:!0,key:"bin",type:p??n})}}e.main&&a.push({file:e.main,key:"main",type:Ne(e.main)??n}),e.module&&a.push({file:e.module,key:"module",type:"esm"}),(e.types||e.typings)&&(Ct(i),i.options.declaration===void 0&&(i.options.declaration="compatible"),a.push({file:e.types??e.typings,key:"types"}));const s=[];for(const r of a){const l=Me(r.file);if(l!==""&&!Ie.includes(l))continue;i.options.declaration===void 0&&(r.key==="types"||r.subKey==="types")&&(i.options.declaration=r.file.includes(".d.ts")?"compatible":!0),i.options.emitCJS===void 0&&r.type==="cjs"&&(i.options.emitCJS=!0),i.options.emitESM===void 0&&r.type==="esm"&&(i.options.emitESM=!0);const p=r.file.replace(/(?:\*[^/\\]|\.d\.[mc]?ts|\.\w+)$/,""),c=p.endsWith("/");if(c&&["./","/"].includes(p))continue;const u=p.replace(new RegExp("(./)?"+i.options.outDir),i.options.sourceDir).replace("./",""),d="(?<=/|$)",m=c?"":"(\\.[cm]?[tj]sx?)$";if(r.file.includes("/*")&&r.key==="exports"){Nt||(i.logger.debug("Private subfolders are not supported, if you need this feature please open an issue on GitHub."),Nt=!0);const v=[],g=new RegExp(d+u.replace("*","(.*)")+m),w=new RegExp(d+u.replace(/(.*)\.[^.]*$/,"$1").replace("*","(.*)")+m);for(const k of t)(g.test(k)||Oe.has(r.subKey)&&w.test(k))&&v.push(k);if(v.length===0){o.push(`Could not find entrypoint for \`${r.file}\``);continue}for(const k of v)ke(s,k,c,p,r,i,!0);continue}const h=new RegExp(d+u+m);let y=t.find(v=>h.test(v));if(Oe.has(r.subKey)&&y===void 0){const v=new RegExp(d+u.replace(/(.*)\.[^.]*$/,"$1")+m);y=t.find(g=>v.test(g))}if(y===void 0){U(S(i.options.rootDir,r.file))||o.push(`Could not find entrypoint for \`${r.file}\``);continue}(y.endsWith(".ts")||y.endsWith(".cts")||y.endsWith(".mts"))&&U(y)&&Ct(i);const b=Ee(y.replace(te,""));U(b+".cts")&&U(b+".mts")?(ke(s,b+".cts",c,p,{...r,type:"cjs"},i,!1),ke(s,b+".mts",c,p,{...r,type:"esm"},i,!1)):ke(s,y,c,p,r,i,!1)}return{entries:s,warnings:o}},"inferEntries");var Ys=Object.defineProperty,Xs=f((e,t)=>Ys(e,"name",{value:t,configurable:!0}),"o$2");const Qs=Xs((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 Zs=Object.defineProperty,er=f((e,t)=>Zs(e,"name",{value:t,configurable:!0}),"t$3");const tr={hooks:{"build:prepare":er(function(e){if(e.options.entries.length>0)return;const t=$(e.options.rootDir,e.options.sourceDir);if(!U(t))throw new Error("No 'src' directory found. Please provide entries manually.");const i=Ai(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=Qs(o,e.options.declaration));const n=Gs(o,i,e);for(const a of n.warnings)O(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?L(a.fileAlias)+" => "+L(a.input.replace(`${e.options.rootDir}/`,"").replace(/\/$/,"/*")):L(a.input.replace(`${e.options.rootDir}/`,"").replace(/\/$/,"/*"))).join(", ")),Y([e.options.emitESM&&"esm",e.options.emitCJS&&"cjs",e.options.declaration&&"dts"].filter(Boolean).map(a=>`[${a}]`).join(" ")))},"build:prepare")}};var ir=Object.defineProperty,or=f((e,t)=>ir(e,"name",{value:t,configurable:!0}),"t$2");const nr=or(async(e,t)=>{if(e==="auto")e=tr;else{if(e==="none")return{};typeof e=="string"&&(e=await t.import(e)||{})}return typeof e=="function"&&(e=e()),e},"resolvePreset");var ar=Object.defineProperty,sr=f((e,t)=>ar(e,"name",{value:t,configurable:!0}),"j");const rr=sr(async e=>{const t=e.options.jiti.transformOptions?.babel?.plugins,i=[],o=JSON.stringify({...e.options.jiti,alias:{...Ae(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,...r]=n;return i.push(s),"["+["plugin"+a,...r.map(l=>JSON.stringify(l))].join(", ")+"]"}return i.push(n),"plugin"+a}).join(",")+"]":"[]");for(const n of e.options.entries){const a=S(e.options.rootDir,e.options.outDir,n.name),s=xo(e.jiti.esmResolve(n.input,{try:!0})??n.input),r=s.replace(te,""),l=et(s),p=Ma(l);let c=[];try{c=await yo(s,{extensions:Ie})}catch(d){O(e,`Cannot analyze ${s} for exports: ${d.toString()}`);return}const u=c.includes("default")||c.length===0;if(e.options.emitESM){const d=_(A(a),await ft("jiti",{conditions:["node","import"],url:import.meta.url})),m=r+".d.mts";ae(`${a}.mjs`,p+['import { createJiti } from "'+d+'";',...i.map((h,y)=>"import plugin"+y+' from "'+h+'";'),"","const jiti = createJiti(import.meta.url, "+o+");","",'/** @type {import("'+m+'")} */','const _module = await jiti.import("'+s+'");',u?`
83
- export default _module;`:"",...c.filter(h=>h!=="default").map(h=>`export const ${h} = _module.${h};`)].join(`
82
+ `),o},"showSizeInformation"),Fs=De((e,t)=>{const i=Is(e.options.entries,"environment","runtime"),o=new Set,n=new Set;for(const[a,s]of Object.entries(i))for(const[r,l]of Object.entries(s)){const p={...e};!e.options.dtsOnly&&(a!=="undefined"||r!=="undefined")&&e.logger.info("Preparing build for "+(a==="undefined"?"":P(a)+" environment"+(r==="undefined"?"":" with "))+(r==="undefined"?"":P(r)+" runtime"));const c={};p.options.rollup.replace?(p.options.rollup.replace.values===void 0&&(p.options.rollup.replace.values={}),a!=="undefined"&&(c[["process","env","NODE_ENV"].join(".")]=JSON.stringify(a)),c[["process","env","EdgeRuntime"].join(".")]=JSON.stringify(r==="edge-light"),Object.freeze(c)):e.logger.warn("'replace' plugin is disabled. You should enable it to replace 'process.env.*' environments.");let u="";a!=="undefined"&&(u+=a+"/"),r!=="undefined"&&(u+=r+"/");let d=!1;p.options.minify!==void 0&&(d=p.options.minify),a==="development"?d=!1:a==="production"&&(d=!0);const m=[],b=[],w=[],x=[];for(const f of l)f.cjs&&f.esm?m.push(f):f.cjs?w.push(f):f.esm?b.push(f):f.declaration&&x.push(f);if(m.length>0){const f={...p,options:{...p.options,emitCJS:!0,emitESM:!0,entries:m,minify:d,rollup:{...p.options.rollup,replace:p.options.rollup.replace?{...p.options.rollup.replace,values:{...p.options.rollup.replace.values,...c}}:!1}}};if(e.options.dtsOnly||o.add({context:f,fileCache:t,subDirectory:u}),e.options.declaration){const v=f.options.entries.filter(y=>y.declaration);v.length>0&&n.add({context:{...f,options:{...f.options,entries:v}},fileCache:t,subDirectory:u})}}if(b.length>0){const f={...p,options:{...p.options,emitCJS:!1,emitESM:!0,entries:b,minify:d,rollup:{...p.options.rollup,replace:p.options.rollup.replace?{...p.options.rollup.replace,values:{...p.options.rollup.replace.values,...c}}:!1}}};if(e.options.dtsOnly||o.add({context:f,fileCache:t,subDirectory:u}),e.options.declaration){const v=f.options.entries.filter(y=>y.declaration);v.length>0&&n.add({context:{...f,options:{...f.options,entries:v}},fileCache:t,subDirectory:u})}}if(w.length>0){const f={...p,options:{...p.options,emitCJS:!0,emitESM:!1,entries:w,minify:d,rollup:{...p.options.rollup,replace:p.options.rollup.replace?{...p.options.rollup.replace,values:{...p.options.rollup.replace.values,...c}}:!1}}};if(e.options.dtsOnly||o.add({context:f,fileCache:t,subDirectory:u}),e.options.declaration){const v=f.options.entries.filter(y=>y.declaration);v.length>0&&n.add({context:{...f,options:{...f.options,entries:v}},fileCache:t,subDirectory:u})}}p.options.declaration&&x.length>0&&n.add({context:{...p,options:{...p.options,emitCJS:!1,emitESM:!1,entries:x,minify:d,rollup:{...p.options.rollup,replace:p.options.rollup.replace?{...p.options.rollup.replace,values:{...p.options.rollup.replace.values,...c}}:!1}}},fileCache:t,subDirectory:u})}return{builders:o,typeBuilders:n}},"prepareRollupConfig"),Rs=De(async(e,t)=>{await e.hooks.callHook("build:before",e);const{builders:i,typeBuilders:o}=Fs(e,t);await Promise.all([...i].map(async({context:n,fileCache:a,subDirectory:s})=>await Ps(n,a,s))),await Promise.all([...o].map(async({context:n,fileCache:a,subDirectory:s})=>await Cs(n,a,s))),e.logger.success(Si(e.options.name?"Build succeeded for "+e.options.name:"Build succeeded"));for await(const n of Mi($(e.options.rootDir,e.options.outDir))){let a=e.buildEntries.find(s=>$(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 et(O(e.options.rootDir,e.options.outDir,n.path));a.bytes=s.size}}return await e.hooks.callHook("build:done",e),As(e.logger,e)},"build");var zs=Object.defineProperty,Js=g((e,t)=>zs(e,"name",{value:t,configurable:!0}),"r$5");const D=Js((e,t)=>{e.warnings.has(t)||e.warnings.add(t)},"warn");var Ws=Object.defineProperty,fi=g((e,t)=>Ws(e,"name",{value:t,configurable:!0}),"t$4");const Pe=fi(e=>{if(e.endsWith(".mjs")||e.endsWith(".d.mts"))return"esm";if(e.endsWith(".cjs")||e.endsWith(".d.cts"))return"cjs"},"inferExportTypeFromFileName"),Qe=fi((e,t,i,o)=>{if(e==="module-sync")return"esm";if(o){const s=Pe(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 Qe(n,a,i,o)},"inferExportType");var Bs=Object.defineProperty,Ls=g((e,t)=>Bs(e,"name",{value:t,configurable:!0}),"y$3");const qs=new Set(["electron","import","require","node","node-addons","default","types","deno","browser","module-sync","bun","workerd",...Lt,...Se]),at=Ls((e,t,i,o=[])=>{if(!e)return[];if(typeof e=="string"){const n=Pe(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,r]of n)if(typeof r=="string"){let l={};Number.isInteger(+s)?l={exportKey:"*"}:s.startsWith("./")?l={exportKey:s.replace("./","")}:l={exportKey:s==="."?".":"*",subKey:s},a.push({...l,file:r,key:"exports",type:Qe(s,o,t,r)})}else if(typeof r=="object"&&r!==null)for(const[l,p]of Object.entries(r)){if(i===!1&&l==="types")continue;const c=Number.isInteger(+s)?l:s;typeof p=="string"?a.push({exportKey:c.replace("./",""),file:p,key:"exports",...qs.has(l)?{subKey:l}:{},type:Qe(l,o,t,p)}):a=[...a,...at({[c]:p},t,i,[...o,l])]}return a}return[]},"extractExportFilenames");var Us=Object.defineProperty,Re=g((e,t)=>Us(e,"name",{value:t,configurable:!0}),"y$2");const Ks=Re((e,t)=>e.key==="exports"&&e.subKey===fe?fe:e.key==="exports"&&e.subKey===ft?ft:t,"getEnvironment"),we=Re((e,t,i,o,n,a,s)=>{const r=Ks(n,a.environment);let l="node";for(const u of Lt)if(n.file.includes("."+u+".")||n.subKey===u){l=u;break}let p=e.find(u=>u.input===t&&u.environment===r&&u.runtime===l);p===void 0?p=e[e.push({environment:r,exportKey:new Set([n.exportKey].filter(Boolean)),input:t,runtime:l})-1]:p.exportKey&&n.exportKey&&p.exportKey.add(n.exportKey),s&&(p.isGlob=!0),i&&(p.outDir=o),n.isExecutable?(p.executable=!0,p.declaration=!1,n.type==="cjs"?p.cjs=!0:n.type==="esm"&&(p.esm=!0)):(/\.d\.[mc]?ts$/.test(n.file)&&a.options.declaration!==!1&&(p.declaration=a.options.declaration),n.type==="cjs"?p.cjs=!0:n.type==="esm"&&(p.esm=!0));const c=n.file.replace(Me(n.file),"").replace(new RegExp(`^./${a.options.outDir.replace(/^\.\//,"")}/`),"");Se.has(n.subKey)&&!t.includes(c)&&(p.fileAlias=c)},"createOrUpdateEntry");let Dt=!1;const Pt=Re(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"),Vs=Re((e,t,i)=>{const o=[];t.sort((r,l)=>r.split("/").length-l.split("/").length);const n=e.type==="module"?"esm":"cjs";n==="esm"&&(i.options.emitESM=!0),n==="cjs"&&(i.options.emitCJS=!0);const a=at(e.exports,n,i.options.declaration);if(e.bin){const r=(typeof e.bin=="string"?[e.bin]:Object.values(e.bin)).filter(Boolean);for(const l of r){const p=Pe(l);if(p&&p!==n)throw new Error(`Exported file "${l}" has an extension that does not match the package.json type "${e.type??"commonjs"}".`);a.push({file:l,isExecutable:!0,key:"bin",type:p??n})}}e.main&&a.push({file:e.main,key:"main",type:Pe(e.main)??n}),e.module&&a.push({file:e.module,key:"module",type:"esm"}),(e.types||e.typings)&&(Pt(i),i.options.declaration===void 0&&(i.options.declaration="compatible"),a.push({file:e.types??e.typings,key:"types"}));const s=[];for(const r of a){const l=Me(r.file);if(l!==""&&!Ie.includes(l))continue;i.options.declaration===void 0&&(r.key==="types"||r.subKey==="types")&&(i.options.declaration=r.file.includes(".d.ts")?"compatible":!0),i.options.emitCJS===void 0&&r.type==="cjs"&&(i.options.emitCJS=!0),i.options.emitESM===void 0&&r.type==="esm"&&(i.options.emitESM=!0);const p=r.file.replace(/(?:\*[^/\\]|\.d\.[mc]?ts|\.\w+)$/,""),c=p.endsWith("/");if(c&&["./","/"].includes(p))continue;const u=p.replace(new RegExp("(./)?"+i.options.outDir),i.options.sourceDir).replace("./",""),d="(?<=/|$)",m=c?"":"(\\.[cm]?[tj]sx?)$";if(r.file.includes("/*")&&r.key==="exports"){Dt||(i.logger.debug("Private subfolders are not supported, if you need this feature please open an issue on GitHub."),Dt=!0);const f=[],v=new RegExp(d+u.replace("*","(.*)")+m),y=new RegExp(d+u.replace(/(.*)\.[^.]*$/,"$1").replace("*","(.*)")+m);for(const k of t)(v.test(k)||Se.has(r.subKey)&&y.test(k))&&f.push(k);if(f.length===0){o.push(`Could not find entrypoint for \`${r.file}\``);continue}for(const k of f)we(s,k,c,p,r,i,!0);continue}const b=new RegExp(d+u+m);let w=t.find(f=>b.test(f));if(Se.has(r.subKey)&&w===void 0){const f=new RegExp(d+u.replace(/(.*)\.[^.]*$/,"$1")+m);w=t.find(v=>f.test(v))}if(w===void 0){U(O(i.options.rootDir,r.file))||o.push(`Could not find entrypoint for \`${r.file}\``);continue}(w.endsWith(".ts")||w.endsWith(".cts")||w.endsWith(".mts"))&&U(w)&&Pt(i);const x=je(w.replace(te,""));U(x+".cts")&&U(x+".mts")?(we(s,x+".cts",c,p,{...r,type:"cjs"},i,!1),we(s,x+".mts",c,p,{...r,type:"esm"},i,!1)):we(s,w,c,p,r,i,!1)}return{entries:s,warnings:o}},"inferEntries");var Hs=Object.defineProperty,Gs=g((e,t)=>Hs(e,"name",{value:t,configurable:!0}),"o$3");const Ys=Gs((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 Xs=Object.defineProperty,Qs=g((e,t)=>Xs(e,"name",{value:t,configurable:!0}),"t$3");const Zs={hooks:{"build:prepare":Qs(function(e){if(e.options.entries.length>0)return;const t=$(e.options.rootDir,e.options.sourceDir);if(!U(t))throw new Error("No 'src' directory found. Please provide entries manually.");const i=Ii(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=Ys(o,e.options.declaration));const n=Vs(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?L(a.fileAlias)+" => "+L(a.input.replace(`${e.options.rootDir}/`,"").replace(/\/$/,"/*")):L(a.input.replace(`${e.options.rootDir}/`,"").replace(/\/$/,"/*"))).join(", ")),Y([e.options.emitESM&&"esm",e.options.emitCJS&&"cjs",e.options.declaration&&"dts"].filter(Boolean).map(a=>`[${a}]`).join(" ")))},"build:prepare")}};var er=Object.defineProperty,tr=g((e,t)=>er(e,"name",{value:t,configurable:!0}),"t$2");const ir=tr(async(e,t)=>{if(e==="auto")e=Zs;else{if(e==="none")return{};typeof e=="string"&&(e=await t.import(e)||{})}return typeof e=="function"&&(e=e()),e},"resolvePreset");var or=Object.defineProperty,nr=g((e,t)=>or(e,"name",{value:t,configurable:!0}),"j");const ar=nr(async e=>{const t=e.options.jiti.transformOptions?.babel?.plugins,i=[],o=JSON.stringify({...e.options.jiti,alias:{...Ae(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,...r]=n;return i.push(s),"["+["plugin"+a,...r.map(l=>JSON.stringify(l))].join(", ")+"]"}return i.push(n),"plugin"+a}).join(",")+"]":"[]");for(const n of e.options.entries){const a=O(e.options.rootDir,e.options.outDir,n.name),s=vo(e.jiti.esmResolve(n.input,{try:!0})??n.input),r=s.replace(te,""),l=Ze(s),p=Ca(l);let c=[];try{c=await ho(s,{extensions:Ie})}catch(d){D(e,`Cannot analyze ${s} for exports: ${d.toString()}`);return}const u=c.includes("default")||c.length===0;if(e.options.emitESM){const d=_(A(a),await mt("jiti",{conditions:["node","import"],url:import.meta.url})),m=r+".d.mts";ae(`${a}.mjs`,p+['import { createJiti } from "'+d+'";',...i.map((b,w)=>"import plugin"+w+' from "'+b+'";'),"","const jiti = createJiti(import.meta.url, "+o+");","",'/** @type {import("'+m+'")} */','const _module = await jiti.import("'+s+'");',u?`
83
+ export default _module;`:"",...c.filter(b=>b!=="default").map(b=>`export const ${b} = _module.${b};`)].join(`
84
84
  `)),e.options.declaration&&ae(`${a}.d.mts`,'export * from "'+m+`";
85
- `+(u?'export { default } from "'+m+'";':""))}if(e.options.emitCJS){const d=_(A(a),await ft("jiti",{conditions:["node","require"],url:import.meta.url})),m=r+".d.cts";ae(`${a}.cjs`,p+['const { createJiti } = require("'+d+'");',...i.map((h,y)=>"const plugin"+y+" = require("+JSON.stringify(h)+")"),"","const jiti = createJiti(__filename, "+o+");","",'/** @type {import("'+m+'")} */','module.exports = jiti("'+s+'")'].join(`
85
+ `+(u?'export { default } from "'+m+'";':""))}if(e.options.emitCJS){const d=_(A(a),await mt("jiti",{conditions:["node","require"],url:import.meta.url})),m=r+".d.cts";ae(`${a}.cjs`,p+['const { createJiti } = require("'+d+'");',...i.map((b,w)=>"const plugin"+w+" = require("+JSON.stringify(b)+")"),"","const jiti = createJiti(__filename, "+o+");","",'/** @type {import("'+m+'")} */','module.exports = jiti("'+s+'")'].join(`
86
86
  `)),e.options.declaration&&ae(a+".d.cts",'export * from "'+m+`";
87
- `+(u?'export { default } from "'+m+'";':""))}p&&(await Qe(`${a}.cjs`),await Qe(`${a}.mjs`))}await e.hooks.callHook("rollup:done",e)},"createStub");var pr=Object.defineProperty,rt=f((e,t)=>pr(e,"name",{value:t,configurable:!0}),"i$2");const lr=rt(e=>{const{message:t,name:i="Error",stack:o}=e;if(!o)return o;const n=`${i}: ${t}
88
- `;return o.startsWith(n)?o.slice(n.length):o},"extractStack"),cr=rt(e=>`
87
+ `+(u?'export { default } from "'+m+'";':""))}p&&(await Xe(`${a}.cjs`),await Xe(`${a}.mjs`))}await e.hooks.callHook("rollup:done",e)},"createStub");var sr=Object.defineProperty,st=g((e,t)=>sr(e,"name",{value:t,configurable:!0}),"i$2");const rr=st(e=>{const{message:t,name:i="Error",stack:o}=e;if(!o)return o;const n=`${i}: ${t}
88
+ `;return o.startsWith(n)?o.slice(n.length):o},"extractStack"),pr=st(e=>`
89
89
  ${e.replaceAll(/^\n|\n$/g,"")}
90
- `,"normalizeCodeFrame"),hi=rt(e=>{const t=lr(e);let i=(e.plugin?`[${e.plugin}] `:"")+e.message;e.id&&(i+=`
90
+ `,"normalizeCodeFrame"),gi=st(e=>{const t=rr(e);let i=(e.plugin?`[${e.plugin}] `:"")+e.message;e.id&&(i+=`
91
91
  file: ${P(e.id+(e.loc?":"+e.loc.line+":"+e.loc.column:""))}`),e.frame&&(i+=`
92
- `+Di(cr(e.frame))),e.message=i,t!==void 0&&(e.stack=`${e.message}
93
- ${t}`)},"enhanceRollupError");var dr=Object.defineProperty,xi=f((e,t)=>dr(e,"name",{value:t,configurable:!0}),"d$3");const Ce="rollup-watch.json",_t=xi(({context:e,doOnSuccessCleanup:t,fileCache:i,mode:o,runBuilder:n,runOnsuccess:a,useCache:s,watcher:r})=>{const l="watcher:"+o;r.on("change",async(p,{event:c})=>{await t?.(),e.logger.info({message:`${P(_(".",p))} was ${c}d`,prefix:l})}),r.on("restart",()=>{e.logger.info({message:"Rebuilding ...",prefix:l})}),r.on("event",async p=>{switch(p.code){case"END":{e.logger.success({message:"Rebuild finished",prefix:l}),await a?.();break}case"BUNDLE_START":{e.logger.info({message:P("build started..."),prefix:l});break}case"BUNDLE_END":{await p.result.close(),s&&i.set(o==="bundle"?Ce:"dts-"+Ce,p.result.cache),e.logger.raw(`
92
+ `+Oi(pr(e.frame))),e.message=i,t!==void 0&&(e.stack=`${e.message}
93
+ ${t}`)},"enhanceRollupError");var lr=Object.defineProperty,vi=g((e,t)=>lr(e,"name",{value:t,configurable:!0}),"d$3");const Ne="rollup-watch.json",Nt=vi(({context:e,doOnSuccessCleanup:t,fileCache:i,mode:o,runBuilder:n,runOnsuccess:a,useCache:s,watcher:r})=>{const l="watcher:"+o;r.on("change",async(p,{event:c})=>{await t?.(),e.logger.info({message:`${P(_(".",p))} was ${c}d`,prefix:l})}),r.on("restart",()=>{e.logger.info({message:"Rebuilding ...",prefix:l})}),r.on("event",async p=>{switch(p.code){case"END":{e.logger.success({message:"Rebuild finished",prefix:l}),await a?.();break}case"BUNDLE_START":{e.logger.info({message:P("build started..."),prefix:l});break}case"BUNDLE_END":{await p.result.close(),s&&i.set(o==="bundle"?Ne:"dts-"+Ne,p.result.cache),e.logger.raw(`
94
94
  ⚡️ Build run in `+p.duration+`ms
95
95
 
96
- `),await n?.(!0);break}case"ERROR":{hi(p.error),e.logger.error({context:[p.error],message:"Rebuild failed: "+p.error.message,prefix:l});break}}})},"watchHandler"),ur=xi(async(e,t,i,o,n)=>{const a=await fi(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(Ce)),e.options.rollup.watch&&typeof a.watch=="object"&&a.watch.include===void 0&&(a.watch={...a.watch,...e.options.rollup.watch},a.watch.include=[$(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 r=ct(a);await e.hooks.callHook("rollup:watch",e,r);const l=[...Array.isArray(a.input)?a.input:typeof a.input=="string"?[a.input]:Object.keys(a.input??{})];let p="Starting watcher for entries:";for(const c of l)p+=Y(`
97
- └─ ${_(process.cwd(),c)}`);if(e.logger.info(p),_t({context:e,doOnSuccessCleanup:n,fileCache:t,mode:"bundle",runBuilder:i,runOnsuccess:o,useCache:s,watcher:r}),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 gi(e,t);s&&(c.cache=t.get("dts-"+Ce)),await e.hooks.callHook("rollup:dts:options",e,c);const u=ct(c);await e.hooks.callHook("rollup:watch",e,u),_t({context:e,fileCache:t,mode:"types",useCache:s,watcher:u})}},"watch");var mr=Object.defineProperty,fr=f((e,t)=>mr(e,"name",{value:t,configurable:!0}),"s$5");const gr=fr(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 Fi(i))},"cleanDistributionDirectories");var vr=Object.defineProperty,yi=f((e,t)=>vr(e,"name",{value:t,configurable:!0}),"s$4");const hr=yi(e=>{try{JSON.parse(e)}catch{return!1}return!0},"isJson");let xr=class{static{f(this,"g")}static{yi(this,"FileCache")}#o;#e;#n;#t=!0;#i=new Map;constructor(t,i,o,n){this.#o=t,this.#n=o,i===void 0?n.debug({message:"Could not create cache directory.",prefix:"file-cache"}):(this.#e=i,n.debug({message:"Cache path is: "+this.#e,prefix:"file-cache"}))}set isEnabled(t){this.#t=t}has(t,i){return!this.#t||this.#e===void 0?!1:U(this.getFilePath(t,i))}get(t,i){if(!this.#t||this.#e===void 0)return;const o=this.getFilePath(t,i);if(this.#i.has(o))return this.#i.get(o);if(!U(o))return;const n=et(o);if(hr(n)){const a=JSON.parse(n);return this.#i.set(o,a),a}return this.#i.set(o,n),n}set(t,i,o){if(!this.#t||this.#e===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)),ae(n,i,{overwrite:!0})}getFilePath(t,i){let o=t.replaceAll(Ee(this.#o),"");return o=o.replaceAll(":","-"),$(this.#e,this.#n,i?.replaceAll(":","-")??"",Ee(o))}};var yr=Object.defineProperty,br=f((e,t)=>yr(e,"name",{value:t,configurable:!0}),"t$1");const wr=br(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 _e($(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");var kr=Object.defineProperty,$e=f((e,t)=>kr(e,"name",{value:t,configurable:!0}),"l$4");const $r=K,jr=$e((e,t)=>{const{sideEffects:i}=t;let o;if(typeof i=="boolean")o=$e(()=>i,"hasSideEffects");else if(Array.isArray(i))if(i.length<=0)o=$e(()=>!1,"hasSideEffects");else{const n=i.map(a=>a.includes("/")?a:`**/${a}`);o=$r(n,null,{resolve:e})}else o=$e(()=>null,"hasSideEffects");return o},"getPackageSideEffect");var He,Mt;function Er(){if(Mt)return He;Mt=1;var e=Object.defineProperty,t=f((l,p)=>e(l,"name",{value:p,configurable:!0}),"s"),i=To,o=i.spawn,n=i.exec;He=f(function(l,p,c){if(typeof p=="function"&&c===void 0&&(c=p,p=void 0),l=parseInt(l),Number.isNaN(l)){if(c)return c(new Error("pid must be a number"));throw new Error("pid must be a number")}var u={},d={};switch(u[l]=[],d[l]=1,process.platform){case"win32":n("taskkill /pid "+l+" /T /F",c);break;case"darwin":r(l,u,d,function(m){return o("pgrep",["-P",m])},function(){a(u,p,c)});break;default:r(l,u,d,function(m){return o("ps",["-o","pid","--no-headers","--ppid",m])},function(){a(u,p,c)});break}},"treeKill");function a(l,p,c){var u={};try{Object.keys(l).forEach(function(d){l[d].forEach(function(m){u[m]||(s(m,p),u[m]=1)}),u[d]||(s(d,p),u[d]=1)})}catch(d){if(c)return c(d);throw d}if(c)return c()}f(a,"killAll"),t(a,"killAll");function s(l,p){try{process.kill(parseInt(l,10),p)}catch(c){if(c.code!=="ESRCH")throw c}}f(s,"killPid"),t(s,"killPid");function r(l,p,c,u,d){var m=u(l),h="";m.stdout.on("data",function(v){var v=v.toString("ascii");h+=v});var y=t(function(b){if(delete c[l],b!=0){Object.keys(c).length==0&&d();return}h.match(/\d+/g).forEach(function(v){v=parseInt(v,10),p[l].push(v),p[v]=[],c[v]=1,r(v,p,c,u,d)})},"onClose");m.on("close",y)}return f(r,"buildProcessTree"),t(r,"buildProcessTree"),He}f(Er,"requireTreeKill");var Sr=Er();const Or=co(Sr);var Pr=Object.defineProperty,bi=f((e,t)=>Pr(e,"name",{value:t,configurable:!0}),"l$3");const Dr=bi(e=>process.platform==="win32"&&"cmd"in e&&"code"in e&&typeof e.cmd=="string"&&e.cmd.startsWith("taskkill")&&e.code===128,"isTaskKillCmdProcessNotFoundError"),Nr=bi(async({pid:e,signal:t})=>await new Promise((i,o)=>{if(!Number.isInteger(e)||e<=0){o(new Error("Invalid process ID"));return}Or(e,t,n=>{if(n&&!Dr(n)){o(n);return}i()})}),"killProcess");var Cr=Object.defineProperty,_r=f((e,t)=>Cr(e,"name",{value:t,configurable:!0}),"n$1");const wi=_r(e=>{const t=$(e,"package.json");if(!U(t))throw new Error("package.json not found at "+t);return{packageJson:Ao(t),packageJsonPath:t}},"loadPackageJson");var Mr=Object.defineProperty,Ir=f((e,t)=>Mr(e,"name",{value:t,configurable:!0}),"r$3");const It=Ir((e,t)=>{if(e.warnings.size>0&&(t&&e.logger.raw(`
96
+ `),await n?.(!0);break}case"ERROR":{gi(p.error),e.logger.error({context:[p.error],message:"Rebuild failed: "+p.error.message,prefix:l});break}}})},"watchHandler"),cr=vi(async(e,t,i,o,n)=>{const a=await ui(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(Ne)),e.options.rollup.watch&&typeof a.watch=="object"&&a.watch.include===void 0&&(a.watch={...a.watch,...e.options.rollup.watch},a.watch.include=[$(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 r=lt(a);await e.hooks.callHook("rollup:watch",e,r);const l=[...Array.isArray(a.input)?a.input:typeof a.input=="string"?[a.input]:Object.keys(a.input??{})];let p="Starting watcher for entries:";for(const c of l)p+=Y(`
97
+ └─ ${_(process.cwd(),c)}`);if(e.logger.info(p),Nt({context:e,doOnSuccessCleanup:n,fileCache:t,mode:"bundle",runBuilder:i,runOnsuccess:o,useCache:s,watcher:r}),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 mi(e,t);s&&(c.cache=t.get("dts-"+Ne)),await e.hooks.callHook("rollup:dts:options",e,c);const u=lt(c);await e.hooks.callHook("rollup:watch",e,u),Nt({context:e,fileCache:t,mode:"types",useCache:s,watcher:u})}},"watch");var dr=Object.defineProperty,ur=g((e,t)=>dr(e,"name",{value:t,configurable:!0}),"s$5");const mr=ur(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 Ti(i))},"cleanDistributionDirectories");var fr=Object.defineProperty,hi=g((e,t)=>fr(e,"name",{value:t,configurable:!0}),"s$4");const gr=hi(e=>{try{JSON.parse(e)}catch{return!1}return!0},"isJson");let vr=class{static{g(this,"g")}static{hi(this,"FileCache")}#o;#e;#n;#t=!0;#i=new Map;constructor(t,i,o,n){this.#o=t,this.#n=o,i===void 0?n.debug({message:"Could not create cache directory.",prefix:"file-cache"}):(this.#e=i,n.debug({message:"Cache path is: "+this.#e,prefix:"file-cache"}))}set isEnabled(t){this.#t=t}has(t,i){return!this.#t||this.#e===void 0?!1:U(this.getFilePath(t,i))}get(t,i){if(!this.#t||this.#e===void 0)return;const o=this.getFilePath(t,i);if(this.#i.has(o))return this.#i.get(o);if(!U(o))return;const n=Ze(o);if(gr(n)){const a=JSON.parse(n);return this.#i.set(o,a),a}return this.#i.set(o,n),n}set(t,i,o){if(!this.#t||this.#e===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)),ae(n,i,{overwrite:!0})}getFilePath(t,i){let o=t.replaceAll(je(this.#o),"");return o=o.replaceAll(":","-"),$(this.#e,this.#n,i?.replaceAll(":","-")??"",je(o))}};var hr=Object.defineProperty,xr=g((e,t)=>hr(e,"name",{value:t,configurable:!0}),"t$1");const yr=xr(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 Ce($(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");var br=Object.defineProperty,ke=g((e,t)=>br(e,"name",{value:t,configurable:!0}),"l$4");const wr=K,kr=ke((e,t)=>{const{sideEffects:i}=t;let o;if(typeof i=="boolean")o=ke(()=>i,"hasSideEffects");else if(Array.isArray(i))if(i.length<=0)o=ke(()=>!1,"hasSideEffects");else{const n=i.map(a=>a.includes("/")?a:`**/${a}`);o=wr(n,null,{resolve:e})}else o=ke(()=>null,"hasSideEffects");return o},"getPackageSideEffect");var Ve,Ct;function $r(){if(Ct)return Ve;Ct=1;var e=Object.defineProperty,t=g((l,p)=>e(l,"name",{value:p,configurable:!0}),"s"),i=Mo,o=i.spawn,n=i.exec;Ve=g(function(l,p,c){if(typeof p=="function"&&c===void 0&&(c=p,p=void 0),l=parseInt(l),Number.isNaN(l)){if(c)return c(new Error("pid must be a number"));throw new Error("pid must be a number")}var u={},d={};switch(u[l]=[],d[l]=1,process.platform){case"win32":n("taskkill /pid "+l+" /T /F",c);break;case"darwin":r(l,u,d,function(m){return o("pgrep",["-P",m])},function(){a(u,p,c)});break;default:r(l,u,d,function(m){return o("ps",["-o","pid","--no-headers","--ppid",m])},function(){a(u,p,c)});break}},"treeKill");function a(l,p,c){var u={};try{Object.keys(l).forEach(function(d){l[d].forEach(function(m){u[m]||(s(m,p),u[m]=1)}),u[d]||(s(d,p),u[d]=1)})}catch(d){if(c)return c(d);throw d}if(c)return c()}g(a,"killAll"),t(a,"killAll");function s(l,p){try{process.kill(parseInt(l,10),p)}catch(c){if(c.code!=="ESRCH")throw c}}g(s,"killPid"),t(s,"killPid");function r(l,p,c,u,d){var m=u(l),b="";m.stdout.on("data",function(f){var f=f.toString("ascii");b+=f});var w=t(function(x){if(delete c[l],x!=0){Object.keys(c).length==0&&d();return}b.match(/\d+/g).forEach(function(f){f=parseInt(f,10),p[l].push(f),p[f]=[],c[f]=1,r(f,p,c,u,d)})},"onClose");m.on("close",w)}return g(r,"buildProcessTree"),t(r,"buildProcessTree"),Ve}g($r,"requireTreeKill");var jr=$r();const Er=po(jr);var Sr=Object.defineProperty,xi=g((e,t)=>Sr(e,"name",{value:t,configurable:!0}),"l$3");const Or=xi(e=>process.platform==="win32"&&"cmd"in e&&"code"in e&&typeof e.cmd=="string"&&e.cmd.startsWith("taskkill")&&e.code===128,"isTaskKillCmdProcessNotFoundError"),Dr=xi(async({pid:e,signal:t})=>await new Promise((i,o)=>{if(!Number.isInteger(e)||e<=0){o(new Error("Invalid process ID"));return}Er(e,t,n=>{if(n&&!Or(n)){o(n);return}i()})}),"killProcess");var Pr=Object.defineProperty,Nr=g((e,t)=>Pr(e,"name",{value:t,configurable:!0}),"n$1");const yi=Nr(e=>{const t=$(e,"package.json");if(!U(t))throw new Error("package.json not found at "+t);return{packageJson:Io(t),packageJsonPath:t}},"loadPackageJson");var Cr=Object.defineProperty,_r=g((e,t)=>Cr(e,"name",{value:t,configurable:!0}),"r$3");const _t=_r((e,t)=>{if(e.warnings.size>0&&(t&&e.logger.raw(`
98
98
  `),e.logger.warn(`Build is done with some warnings:
99
99
 
100
100
  ${[...e.warnings].map(i=>`- ${i}`).join(`
101
- `)}`),e.options.failOnWarn))throw new Error("Exiting with code (1). You can change this behavior by setting `failOnWarn: false`.")},"logBuildErrors");var Tr=Object.defineProperty,ki=f((e,t)=>Tr(e,"name",{value:t,configurable:!0}),"r$2");const Tt=ki(async(e,t)=>{if(typeof e.name!="string"){let i=ve(e.input)?_(t.options.rootDir,e.input):q(e.input);i.startsWith("./")&&(i=i.slice(2)),e.name=i.replace(new RegExp(`^${t.options.sourceDir}/`),"").replace(te,"")}if(!e.input)throw new Error(`Missing entry input: ${JSON.stringify(e)}`);it(e.input)&&(e.input=S(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=S(t.options.rootDir,e.outDir??t.options.outDir)},"extendEntry"),Ar=ki(async e=>{e.options.entries=e.options.entries.map(t=>typeof t=="string"?{input:t,isGlob:dt(t)}:{...t,exportKey:t.exportKey??new Set,isGlob:dt(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=ro([o.input],{cwd:e.options.rootDir,dot:!1,ignore:n,onlyFiles:!0});if(a.length===0)throw new Fo("No files found in the glob pattern: "+P($(e.options.rootDir,o.input)));for(const s of a)e.options.entries.push({...o,input:S(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 Tt(t,e);for(const t of e.options.entries.filter(i=>i.fileAlias!==void 0))t.name=t.fileAlias,t.fileAlias=void 0,await Tt(t,e)},"prepareEntries");var Fr=Object.defineProperty,Rr=f((e,t)=>Fr(e,"name",{value:t,configurable:!0}),"a$4");const zr=Rr(async(e,t,i)=>{if(e&&await _e($(e,"keystore.json"))){const o=await Ri($(e,"keystore.json"));let n=await Gi(e,{withFileTypes:!0});n=n.filter(s=>s.isDirectory());let a=i;for(const s of n)if(!o[s.name]){try{await Yi($(e,s.name),{force:!0,recursive:!0})}catch(r){t.error({message:`Failed to remove cache directory ${s.name}: ${r instanceof Error?r.message:String(r)}`,prefix:"file-cache"});continue}a&&t.raw(`
101
+ `)}`),e.options.failOnWarn))throw new Error("Exiting with code (1). You can change this behavior by setting `failOnWarn: false`.")},"logBuildErrors");var Mr=Object.defineProperty,bi=g((e,t)=>Mr(e,"name",{value:t,configurable:!0}),"r$2");const Mt=bi(async(e,t)=>{if(typeof e.name!="string"){let i=_e(e.input)?_(t.options.rootDir,e.input):q(e.input);i.startsWith("./")&&(i=i.slice(2)),e.name=i.replace(new RegExp(`^${t.options.sourceDir}/`),"").replace(te,"")}if(!e.input)throw new Error(`Missing entry input: ${JSON.stringify(e)}`);tt(e.input)&&(e.input=O(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=O(t.options.rootDir,e.outDir??t.options.outDir)},"extendEntry"),Ir=bi(async e=>{e.options.entries=e.options.entries.map(t=>typeof t=="string"?{input:t,isGlob:ct(t)}:{...t,exportKey:t.exportKey??new Set,isGlob:ct(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=ao([o.input],{cwd:e.options.rootDir,dot:!1,ignore:n,onlyFiles:!0});if(a.length===0)throw new To("No files found in the glob pattern: "+P($(e.options.rootDir,o.input)));for(const s of a)e.options.entries.push({...o,input:O(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 Mt(t,e);for(const t of e.options.entries.filter(i=>i.fileAlias!==void 0))t.name=t.fileAlias,t.fileAlias=void 0,await Mt(t,e)},"prepareEntries");var Tr=Object.defineProperty,Ar=g((e,t)=>Tr(e,"name",{value:t,configurable:!0}),"a$4");const Fr=Ar(async(e,t,i)=>{if(e&&await Ce($(e,"keystore.json"))){const o=await Ai($(e,"keystore.json"));let n=await Vi(e,{withFileTypes:!0});n=n.filter(s=>s.isDirectory());let a=i;for(const s of n)if(!o[s.name]){try{await Hi($(e,s.name),{force:!0,recursive:!0})}catch(r){t.error({message:`Failed to remove cache directory ${s.name}: ${r instanceof Error?r.message:String(r)}`,prefix:"file-cache"});continue}a&&t.raw(`
102
102
 
103
- `),t.info({message:"Removing "+s.name+" file cache, the cache key is not used anymore.",prefix:"file-cache"}),a=!1}}},"removeOldCacheFolders");var Jr=Object.defineProperty,Wr=f((e,t)=>Jr(e,"name",{value:t,configurable:!0}),"a$3");const Br=Wr((e,t)=>e.some(i=>i instanceof RegExp?i.test(t):i===t),"arrayIncludes");var Lr=Object.defineProperty,qr=f((e,t)=>Lr(e,"name",{value:t,configurable:!0}),"a$2");const Ur=qr((e="")=>{const t=e.split("/");return t[0].startsWith("@")?t[0]+"/"+t[1]:t[0]},"getPackageName");var Kr=Object.defineProperty,Vr=f((e,t)=>Kr(e,"name",{value:t,configurable:!0}),"p");const Hr=Vr(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=Ur(n);!Br(e.options.externals,n)&&!n.startsWith("chunks/")&&![...vt.builtinModules,...vt.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&&O(e,`Potential unused dependencies found: ${[...i].map(n=>P(n)).join(", ")}`),o.size>0&&O(e,`Potential implicit dependencies found: ${[...o].map(n=>P(n)).join(", ")}`)},"validateDependencies");var Gr=Object.defineProperty,$i=f((e,t)=>Gr(e,"name",{value:t,configurable:!0}),"i$1");const Yr=$i((e,t)=>Ro(e,t)<=e.length/3||t.includes(e),"isSimilar"),Xr=$i((e,t)=>{const i=e.toLowerCase();return t.filter(o=>Yr(o.toLowerCase(),i))},"findAlternatives");var Qr=Object.defineProperty,At=f((e,t)=>Qr(e,"name",{value:t,configurable:!0}),"r");const Zr=At(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?[]:st(e.pkg.exports,e.pkg.type==="module"?"esm":"cjs",t.declaration).map(r=>t.dtsOnly?r.subKey==="types"?r.file:void 0:r.file)].filter(Boolean).map(r=>r&&S(t.rootDir,r.replace(/\/[^*/]*\*[^\n\r/\u2028\u2029]*(?:[\n\r\u2028\u2029][^*/]*\*[^\n\r/\u2028\u2029]*)*(?:\/.*)?$/,"")))),n=[];for(const r of o)r&&!r.includes("*")&&!No(r)&&n.push(r.replace(`${t.rootDir}/`,""));const a=At(r=>_(t.rootDir,S(t.outDir,r)),"rPath"),s=e.buildEntries.filter(r=>!r.chunk).map(r=>a(r.path));if(n.length>0){let r="Potential missing or wrong package.json files:";for(const l of n){const p=Xr(l,s);r+=`
104
- - `+P(l)+(p.length>0?Ni` (did you mean ${p.map(c=>`"${c}"`).join(", ")}?)`:"")}O(e,r)}},"validatePackageEntries");var ep=Object.defineProperty,tp=f((e,t)=>ep(e,"name",{value:t,configurable:!0}),"l$1");const ip=tp(e=>{const{options:{validation:t},pkg:i}=e;i.name===void 0&&t?.packageJson?.name!==!1&&O(e,"The 'name' field is missing in your package.json. Please provide a valid package name."),t?.packageJson?.files!==!1&&(i.files===void 0?O(e,"The 'files' field is missing in your package.json. Add the files to be included in the package."):i.files.length===0?O(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))||O(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&&O(e,"The 'main' field is missing in your package.json. This field should point to your main entry file."),i.main?.includes(".mjs")&&O(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&&O(e,"The 'module' field is missing in your package.json, but you are emitting ES modules."),i.module&&i.main&&i.module===i.main&&O(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")&&O(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&&O(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&&O(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&&O(e,"The 'module' field is missing in your package.json. This field is necessary when emitting ES modules."),i.module?.includes(".cjs")&&O(e,"The 'module' field should not use a '.cjs' extension for ES modules."),i.module&&i.main&&i.module===i.main&&O(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&&O(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"))O(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")&&O(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&&O(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)&&O(e,"No 'typesVersions' field found in your package.json. Consider adding this field, or change the declaration option to 'node16' or 'false'.")}},"validatePackageFields");var op=Object.defineProperty,np=f((e,t)=>op(e,"name",{value:t,configurable:!0}),"i");const ap=np(e=>{const{packageJson:t}=wi(e.options.rootDir);e.pkg=t,Hr(e),ip(e),Zr(e)},"validator");var sp=Object.defineProperty,rp=f((e,t)=>sp(e,"name",{value:t,configurable:!0}),"a");const pp=/^[^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"]),Ft=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(pp.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=S(i);if(!U(o))throw new Error(`Target path "${o}" for alias "${t}" does not exist.`)}},"validateAliasEntries");var cp=Object.defineProperty,z=f((e,t)=>cp(e,"name",{value:t,configurable:!0}),"c");const dp=z(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"),up=z((e,t,i,o,n,a,s,r,l)=>{const p=dp(l?.config.compilerOptions?.jsx),c=Li(a,n,s,{alias:{},browserTargets:Bi(),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===fe,name:(r.name??"").split("/").pop()??"default",outDir:l?.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:l?.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:re,include:/\bimport\s*[(/]/},esbuild:{charset:"utf8",jsx:p,jsxDev:l?.config.compilerOptions?.jsx==="react-jsxdev",jsxFactory:l?.config.compilerOptions?.jsxFactory,jsxFragment:l?.config.compilerOptions?.jsxFragmentFactory,jsxImportSource:l?.config.compilerOptions?.jsxImportSource,jsxSideEffects:!0,keepNames:!0,sourcesContent:!1,target:l?.config.compilerOptions?.target,treeShaking:!0,tsconfigRaw:l?.config},isolatedDeclarations:{exclude:re,ignoreErrors:!1,include:pe},json:{preferConst:!0},license:{dependenciesTemplate:z((u,d,m)=>`
103
+ `),t.info({message:"Removing "+s.name+" file cache, the cache key is not used anymore.",prefix:"file-cache"}),a=!1}}},"removeOldCacheFolders");var Rr=Object.defineProperty,zr=g((e,t)=>Rr(e,"name",{value:t,configurable:!0}),"a$3");const Jr=zr((e,t)=>e.some(i=>i instanceof RegExp?i.test(t):i===t),"arrayIncludes");var Wr=Object.defineProperty,Br=g((e,t)=>Wr(e,"name",{value:t,configurable:!0}),"a$2");const Lr=Br((e="")=>{const t=e.split("/");return t[0].startsWith("@")?t[0]+"/"+t[1]:t[0]},"getPackageName");var qr=Object.defineProperty,Ur=g((e,t)=>qr(e,"name",{value:t,configurable:!0}),"o");const Kr=Ur(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=Lr(n);!Jr(e.options.externals,n)&&!n.startsWith("chunks/")&&![...gt.builtinModules,...gt.builtinModules.map(s=>`node:${s}`)].includes(a)&&e.pkg?.dependencies?.[a]===void 0&&e.pkg?.peerDependencies?.[a]===void 0&&e.pkg.peerDependenciesMeta?.[a]?.optional!==!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 Vr=Object.defineProperty,wi=g((e,t)=>Vr(e,"name",{value:t,configurable:!0}),"i$1");const Hr=wi((e,t)=>Ao(e,t)<=e.length/3||t.includes(e),"isSimilar"),Gr=wi((e,t)=>{const i=e.toLowerCase();return t.filter(o=>Hr(o.toLowerCase(),i))},"findAlternatives");var Yr=Object.defineProperty,It=g((e,t)=>Yr(e,"name",{value:t,configurable:!0}),"r");const Xr=It(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?[]:at(e.pkg.exports,e.pkg.type==="module"?"esm":"cjs",t.declaration).map(r=>t.dtsOnly?r.subKey==="types"?r.file:void 0:r.file)].filter(Boolean).map(r=>r&&O(t.rootDir,r.replace(/\/[^*/]*\*[^\n\r/\u2028\u2029]*(?:[\n\r\u2028\u2029][^*/]*\*[^\n\r/\u2028\u2029]*)*(?:\/.*)?$/,"")))),n=[];for(const r of o)r&&!r.includes("*")&&!Do(r)&&n.push(r.replace(`${t.rootDir}/`,""));const a=It(r=>_(t.rootDir,O(t.outDir,r)),"rPath"),s=e.buildEntries.filter(r=>!r.chunk).map(r=>a(r.path));if(n.length>0){let r="Potential missing or wrong package.json files:";for(const l of n){const p=Gr(l,s);r+=`
104
+ - `+P(l)+(p.length>0?Di` (did you mean ${p.map(c=>`"${c}"`).join(", ")}?)`:"")}D(e,r)}},"validatePackageEntries");var Qr=Object.defineProperty,Zr=g((e,t)=>Qr(e,"name",{value:t,configurable:!0}),"l$1");const ep=Zr(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 tp=Object.defineProperty,ip=g((e,t)=>tp(e,"name",{value:t,configurable:!0}),"i");const op=ip(e=>{const{packageJson:t}=yi(e.options.rootDir);e.pkg=t,Kr(e),ep(e),Xr(e)},"validator");var np=Object.defineProperty,ap=g((e,t)=>np(e,"name",{value:t,configurable:!0}),"a");const sp=/^[^a-z_@#~]|[^\w/@#~-]|@\/|#\/|~\//i,rp=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"]),Tt=ap(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(sp.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(rp.has(t))throw new Error(`Alias name "${t}" is a reserved keyword and cannot be used.`);const o=O(i);if(!U(o))throw new Error(`Target path "${o}" for alias "${t}" does not exist.`)}},"validateAliasEntries");var pp=Object.defineProperty,z=g((e,t)=>pp(e,"name",{value:t,configurable:!0}),"c");const lp=z(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"),cp=z((e,t,i,o,n,a,s,r,l)=>{const p=lp(l?.config.compilerOptions?.jsx),c=Wi(a,n,s,{alias:{},browserTargets:Ji(),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===fe,name:(r.name??"").split("/").pop()??"default",outDir:l?.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:l?.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:re,include:/\bimport\s*[(/]/},esbuild:{charset:"utf8",jsx:p,jsxDev:l?.config.compilerOptions?.jsx==="react-jsxdev",jsxFactory:l?.config.compilerOptions?.jsxFactory,jsxFragment:l?.config.compilerOptions?.jsxFragmentFactory,jsxImportSource:l?.config.compilerOptions?.jsxImportSource,jsxSideEffects:!0,keepNames:!0,sourcesContent:!1,target:l?.config.compilerOptions?.target,treeShaking:!0,tsconfigRaw:l?.config},isolatedDeclarations:{exclude:re,ignoreErrors:!1,include:pe},json:{preferConst:!0},license:{dependenciesTemplate:z((u,d,m)=>`
105
105
  # Licenses of bundled dependencies
106
106
  The published ${m} artifact additionally contains code with the following licenses:
107
107
  `+(u.length>0?`${u.join(", ")}
@@ -115,13 +115,13 @@ The published ${m} artifact additionally contains code with the following licens
115
115
 
116
116
  `:`
117
117
  `)+`# Bundled types:
118
- `+d,"dtsTemplate")},node10Compatibility:{},patchTypes:{},polyfillNode:{},preserveDirectives:{include:pe},preserveDynamicImports:!0,raw:{exclude:re,include:[/\.(md|txt|htm|html|data)$/]},replace:{objectGuards:!0,preventAssignment:!0},resolve:{allowExportsFolderMapping:!1,exportConditions:["module-sync"],extensions:Ie,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:re,include:pe},sourcemap:{},sucrase:{disableESTransforms:!0,enableLegacyBabel5ModuleInterop:!1,enableLegacyTypeScriptModuleInterop:l?.config.compilerOptions?.esModuleInterop===!1,include:pe,injectCreateRequireForImportRequire:!1,preserveDynamicImport:!0,production:i===fe,...l?.config.compilerOptions?.jsx&&["react","react-jsx","react-jsxdev"].includes(l.config.compilerOptions.jsx)?{jsxFragmentPragma:l.config.compilerOptions.jsxFragmentFactory,jsxImportSource:l.config.compilerOptions.jsxImportSource,jsxPragma:l.config.compilerOptions.jsxFactory,jsxRuntime:p,transforms:["typescript","jsx",...l.config.compilerOptions.esModuleInterop?["imports"]:[]]}:{transforms:["typescript",...l?.config.compilerOptions?.esModuleInterop?["imports"]:[]]}},swc:{include:pe,inlineSourcesContent:!1,inputSourceMap:!1,isModule:!0,jsc:{experimental:{keepImportAttributes:!0},externalHelpers:!1,keepClassNames:!0,loose:!0,parser:{decorators:l?.config.compilerOptions?.experimentalDecorators,syntax:l?"typescript":"ecmascript",[l?"tsx":"jsx"]:!0},target:l?.config.compilerOptions?.target?.toLowerCase(),transform:{decoratorMetadata:l?.config.compilerOptions?.emitDecoratorMetadata,decoratorVersion:"2022-03",legacyDecorator:l?.config.compilerOptions?.experimentalDecorators,react:{development:i!==fe,pragma:l?.config.compilerOptions?.jsxFactory,pragmaFrag:l?.config.compilerOptions?.jsxFragmentFactory,runtime:p,throwIfNamespace:!0},treatConstEnumAsEnum:l?.config.compilerOptions?.preserveConstEnums,useDefineForClassFields:l?.config.compilerOptions?.useDefineForClassFields}},module:{ignoreDynamic:!0,importInterop:"none",preserveImportMeta:!0,strict:!1,strictMode:!1,type:"es6"}},treeshake:{moduleSideEffects:jr(t,r),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:re}},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:r.name??"unknown",pretty:!0,readme:"none",showConfig:o,tsconfig:l?.path}});if(!c.transformerName){const u=new Map([...Object.entries(r.dependencies??{}),...Object.entries(r.devDependencies??{})]);let d="0.0.0";if(u.has("esbuild"))c.transformerName="esbuild",d=u.get("esbuild");else if(u.has("@swc/core"))c.transformerName="swc",d=u.get("@swc/core");else if(u.has("sucrase"))c.transformerName="sucrase",d=u.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 ")+Ui),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(", ")),Ft(c.alias),c.rollup.alias&&c.rollup.alias.entries&&Ft(c.rollup.alias.entries),c},"generateOptions"),mp=z(async(e,t,i,o,n,a,s,r,l,p)=>{const c=await nr(s.preset??a.preset??"auto",p),u=up(e,t,o,n,a,s,c,r,l);zi($(u.rootDir,u.outDir));const d={buildEntries:[],dependencyGraphMap:new Map,environment:o,hooks:qi(),jiti:Rt(u.rootDir,u.jiti),logger:e,mode:i,options:u,pkg:r,tsconfig:l,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 m=r.dependencies?.typescript!==void 0||r.devDependencies?.typescript!==void 0;if(d.options.declaration&&d.tsconfig===void 0&&m)throw new Error("Cannot build declaration files without a tsconfig.json");return m?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(r.devDependencies?.typescript??r.dependencies?.typescript??"unknown")),d.options.declaration&&(r.dependencies?.typescript||r.devDependencies?.typescript)&&!d.tsconfig?.config.compilerOptions?.isolatedModules&&d.logger.warn(`'compilerOptions.isolatedModules' is not enabled in tsconfig.
118
+ `+d,"dtsTemplate")},node10Compatibility:{},patchTypes:{},polyfillNode:{},preserveDirectives:{include:pe},preserveDynamicImports:!0,raw:{exclude:re,include:[/\.(md|txt|htm|html|data)$/]},replace:{objectGuards:!0,preventAssignment:!0},resolve:{allowExportsFolderMapping:!1,exportConditions:["module-sync"],extensions:Ie,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:re,include:pe},sourcemap:{},sucrase:{disableESTransforms:!0,enableLegacyBabel5ModuleInterop:!1,enableLegacyTypeScriptModuleInterop:l?.config.compilerOptions?.esModuleInterop===!1,include:pe,injectCreateRequireForImportRequire:!1,preserveDynamicImport:!0,production:i===fe,...l?.config.compilerOptions?.jsx&&["react","react-jsx","react-jsxdev"].includes(l.config.compilerOptions.jsx)?{jsxFragmentPragma:l.config.compilerOptions.jsxFragmentFactory,jsxImportSource:l.config.compilerOptions.jsxImportSource,jsxPragma:l.config.compilerOptions.jsxFactory,jsxRuntime:p,transforms:["typescript","jsx",...l.config.compilerOptions.esModuleInterop?["imports"]:[]]}:{transforms:["typescript",...l?.config.compilerOptions?.esModuleInterop?["imports"]:[]]}},swc:{include:pe,inlineSourcesContent:!1,inputSourceMap:!1,isModule:!0,jsc:{experimental:{keepImportAttributes:!0},externalHelpers:!1,keepClassNames:!0,loose:!0,parser:{decorators:l?.config.compilerOptions?.experimentalDecorators,syntax:l?"typescript":"ecmascript",[l?"tsx":"jsx"]:!0},target:l?.config.compilerOptions?.target?.toLowerCase(),transform:{decoratorMetadata:l?.config.compilerOptions?.emitDecoratorMetadata,decoratorVersion:"2022-03",legacyDecorator:l?.config.compilerOptions?.experimentalDecorators,react:{development:i!==fe,pragma:l?.config.compilerOptions?.jsxFactory,pragmaFrag:l?.config.compilerOptions?.jsxFragmentFactory,runtime:p,throwIfNamespace:!0},treatConstEnumAsEnum:l?.config.compilerOptions?.preserveConstEnums,useDefineForClassFields:l?.config.compilerOptions?.useDefineForClassFields}},module:{ignoreDynamic:!0,importInterop:"none",preserveImportMeta:!0,strict:!1,strictMode:!1,type:"es6"}},treeshake:{moduleSideEffects:kr(t,r),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:re}},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:r.name??"unknown",pretty:!0,readme:"none",showConfig:o,tsconfig:l?.path}});if(!c.transformerName){const u=new Map([...Object.entries(r.dependencies??{}),...Object.entries(r.devDependencies??{})]);let d="0.0.0";if(u.has("esbuild"))c.transformerName="esbuild",d=u.get("esbuild");else if(u.has("@swc/core"))c.transformerName="swc",d=u.get("@swc/core");else if(u.has("sucrase"))c.transformerName="sucrase",d=u.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 ")+Li),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(", ")),Tt(c.alias),c.rollup.alias&&c.rollup.alias.entries&&Tt(c.rollup.alias.entries),c},"generateOptions"),dp=z(async(e,t,i,o,n,a,s,r,l,p)=>{const c=await ir(s.preset??a.preset??"auto",p),u=cp(e,t,o,n,a,s,c,r,l);Fi($(u.rootDir,u.outDir));const d={buildEntries:[],dependencyGraphMap:new Map,environment:o,hooks:Bi(),jiti:At(u.rootDir,u.jiti),logger:e,mode:i,options:u,pkg:r,tsconfig:l,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 m=r.dependencies?.typescript!==void 0||r.devDependencies?.typescript!==void 0;if(d.options.declaration&&d.tsconfig===void 0&&m)throw new Error("Cannot build declaration files without a tsconfig.json");return m?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(r.devDependencies?.typescript??r.dependencies?.typescript??"unknown")),d.options.declaration&&(r.dependencies?.typescript||r.devDependencies?.typescript)&&!d.tsconfig?.config.compilerOptions?.isolatedModules&&d.logger.warn(`'compilerOptions.isolatedModules' is not enabled in tsconfig.
119
119
  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.
120
- 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 Ar(d),d},"createContext"),fp=z(e=>{switch(e){case"jit":return"Stubbing";case"watch":return"Watching";case"tsdoc":return"Generating TSDoc";default:return"Building"}},"getMode"),fl=z(async(e,t,i,o,n={})=>{const{configPath:a,debug:s,tsconfigPath:r,...l}=n;o.wrapAll(),e=S(Je.cwd(),e),o.debug("Root directory:",e);const{packageJson:p,packageJsonPath:c}=wi(e);o.debug("Using package.json found at",c);let u;if(r){const b=$(e,r);if(!await _e(b))throw new Error("tsconfig.json not found at "+b);u={config:Ji(b),path:b},o.info("Using tsconfig settings at",b)}else if(p.dependencies?.typescript||p.devDependencies?.typescript)try{u=await Wi(e),o.debug("Using tsconfig settings found at",u.path)}catch{o.info("No tsconfig.json or jsconfig.json found.")}const d=Ci("@visulima/packem",{cwd:e});let m=!1,h,y;try{const b=await wr(e,a??""),v=Rt(e,{debug:s});let g=await v.import(b,{default:!0,try:!0})||{};typeof g=="function"&&(g=await g(i,t)),o.debug("Using packem config found at",$(e,b));const w=X(JSON.stringify({version:p.version,...p.dependencies,...p.devDependencies,...p.peerDependencies,...p.peerDependenciesMeta,browser:p.browser,eNode:p.engines?.node,exports:p.exports,main:p.main,module:p.module,type:p.type,types:p.types}))+X(JSON.stringify(g));d&&So(w,d,o);const k=new xr(e,d,w,o),x=await mp(o,e,t,i,s??!1,l,g,p,u,v);k.isEnabled=x.options.fileCache,x.logger.info(P(fp(t)+" "+x.options.name)),x.logger.debug({context:x.options.entries,message:`${L("Root dir:")} ${x.options.rootDir}
121
- ${L("Entries:")}`}),await gr(x);const D=z(async R=>{for await(const[H,E]of Object.entries(x.options.builder??{})){x.logger.raw(`
122
- `),await x.hooks.callHook("builder:before",H,x);const N=Date.now(),j=z(()=>lt(Math.floor(Date.now()-N)),"getBuilderDuration");await E(x,d,k,m),await x.hooks.callHook("builder:done",H,x),x.logger.raw(`
123
- ⚡️ `+H+" run in "+j()),R&&x.logger.raw(`
120
+ 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 Ir(d),d},"createContext"),up=z(e=>{switch(e){case"jit":return"Stubbing";case"watch":return"Watching";case"tsdoc":return"Generating TSDoc";default:return"Building"}},"getMode"),ul=z(async(e,t,i,o,n={})=>{const{configPath:a,debug:s,tsconfigPath:r,...l}=n;o.wrapAll(),e=O(Je.cwd(),e),o.debug("Root directory:",e);const{packageJson:p,packageJsonPath:c}=yi(e);o.debug("Using package.json found at",c);let u;if(r){const x=$(e,r);if(!await Ce(x))throw new Error("tsconfig.json not found at "+x);u={config:Ri(x),path:x},o.info("Using tsconfig settings at",x)}else if(p.dependencies?.typescript||p.devDependencies?.typescript)try{u=await zi(e),o.debug("Using tsconfig settings found at",u.path)}catch{o.info("No tsconfig.json or jsconfig.json found.")}const d=Pi("@visulima/packem",{cwd:e});let m=!1,b,w;try{const x=await yr(e,a??""),f=At(e,{debug:s});let v=await f.import(x,{default:!0,try:!0})||{};typeof v=="function"&&(v=await v(i,t)),o.debug("Using packem config found at",$(e,x));const y=X(JSON.stringify({version:p.version,...p.dependencies,...p.devDependencies,...p.peerDependencies,...p.peerDependenciesMeta,browser:p.browser,eNode:p.engines?.node,exports:p.exports,main:p.main,module:p.module,type:p.type,types:p.types}))+X(JSON.stringify(v));d&&jo(y,d,o);const k=new vr(e,d,y,o),h=await dp(o,e,t,i,s??!1,l,v,p,u,f);k.isEnabled=h.options.fileCache,h.logger.info(P(up(t)+" "+h.options.name)),h.logger.debug({context:h.options.entries,message:`${L("Root dir:")} ${h.options.rootDir}
121
+ ${L("Entries:")}`}),await mr(h);const E=z(async R=>{for await(const[H,S]of Object.entries(h.options.builder??{})){h.logger.raw(`
122
+ `),await h.hooks.callHook("builder:before",H,h);const N=Date.now(),j=z(()=>pt(Math.floor(Date.now()-N)),"getBuilderDuration");await S(h,d,k,m),await h.hooks.callHook("builder:done",H,h),h.logger.raw(`
123
+ ⚡️ `+H+" run in "+j()),R&&h.logger.raw(`
124
124
 
125
- `)}},"runBuilder"),M=z(async()=>{if(h!==void 0)await Nr({pid:h.pid,signal:l.killSignal??g.killSignal??"SIGTERM"});else if(y!==void 0)try{await y()}catch(R){throw new Error("onSuccess function cleanup failed: "+R.message,{cause:R})}h=void 0,y=void 0},"doOnSuccessCleanup"),J=z(async()=>{if(typeof x.options.onSuccess=="function")try{y=await x.options.onSuccess()}catch(R){throw new Error("onSuccess function failed: "+R.message,{cause:R})}else if(typeof x.options.onSuccess=="string"){const R=x.options.onSuccessTimeout??3e4;if(h=Ki(x.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(),oe=z(()=>lt(Math.floor(Date.now()-F)),"getDuration");if(t==="watch"){if(x.options.rollup.watch===!1)throw new Error("Rollup watch is disabled. You should check your packem.config file.");await ur(x,k,D,J,M),It(x,!1);return}t==="jit"?(await rr(x),await x.hooks.callHook("build:done",x)):(m=await Js(x,k),await x.hooks.callHook("validate:before",x),ap(x),await x.hooks.callHook("validate:done",x),It(x,m)),x.logger.raw(`
126
- ⚡️ Build run in `+oe()),await D(),await J(),Je.on("SIGINT",async()=>{await M()}),Je.on("SIGTERM",async()=>{await M()})}catch(b){throw o.raw(`
127
- `),hi(b),b}finally{o.restoreAll(),await zr(d,o,m)}},"packem");export{fl as default};
125
+ `)}},"runBuilder"),M=z(async()=>{if(b!==void 0)await Dr({pid:b.pid,signal:l.killSignal??v.killSignal??"SIGTERM"});else if(w!==void 0)try{await w()}catch(R){throw new Error("onSuccess function cleanup failed: "+R.message,{cause:R})}b=void 0,w=void 0},"doOnSuccessCleanup"),J=z(async()=>{if(typeof h.options.onSuccess=="function")try{w=await h.options.onSuccess()}catch(R){throw new Error("onSuccess function failed: "+R.message,{cause:R})}else if(typeof h.options.onSuccess=="string"){const R=h.options.onSuccessTimeout??3e4;if(b=qi(h.options.onSuccess,[],{nodeOptions:{shell:!0,stdio:"inherit",timeout:R}}),await b,b.exitCode&&b.exitCode!==0)throw new Error("onSuccess script failed with exit code "+b.exitCode+". Check the output above for details.")}},"runOnsuccess"),F=Date.now(),oe=z(()=>pt(Math.floor(Date.now()-F)),"getDuration");if(t==="watch"){if(h.options.rollup.watch===!1)throw new Error("Rollup watch is disabled. You should check your packem.config file.");await cr(h,k,E,J,M),_t(h,!1);return}t==="jit"?(await ar(h),await h.hooks.callHook("build:done",h)):(m=await Rs(h,k),await h.hooks.callHook("validate:before",h),op(h),await h.hooks.callHook("validate:done",h),_t(h,m)),h.logger.raw(`
126
+ ⚡️ Build run in `+oe()),await E(),await J(),Je.on("SIGINT",async()=>{await M()}),Je.on("SIGTERM",async()=>{await M()})}catch(x){throw o.raw(`
127
+ `),gi(x),x}finally{o.restoreAll(),await Fr(d,o,m)}},"packem");export{ul as default};