@visulima/packem 1.17.2 → 1.17.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/cli.mjs +48 -48
- package/dist/packem.cjs +2 -2
- package/dist/packem.mjs +22 -22
- package/package.json +1 -1
package/dist/packem.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Ii=Object.defineProperty;var f=(e,t)=>Ii(e,"name",{value:t,configurable:!0});import we,{env as Fi,versions as Ti}from"node:process";import{cyan as P,bold as q,gray as Q,green as Ai,yellow as Ri,grey as Ji}from"@visulima/colorize";import{findCacheDirSync as Bi}from"@visulima/find-cache-dir";import{readFile as
|
|
1
|
+
var Ii=Object.defineProperty;var f=(e,t)=>Ii(e,"name",{value:t,configurable:!0});import we,{env as Fi,versions as Ti}from"node:process";import{cyan as P,bold as q,gray as Q,green as Ai,yellow as Ri,grey as Ji}from"@visulima/colorize";import{findCacheDirSync as Bi}from"@visulima/find-cache-dir";import{readFile as Se,isAccessible as ze,writeFile as Wi,readFileSync as it,writeFileSync as se,readJson as Vt,writeJsonSync as Li,ensureDir as dt,walk as qi,isAccessibleSync as X,collectSync as Ui,emptyDir as Ki,ensureDirSync as Vi}from"@visulima/fs";import{formatBytes as A,parseBytes as ut,duration as mt}from"@visulima/humanizer";import{hasPackageJsonAnyDependency as Ht}from"@visulima/package";import{normalize as G,join as j,relative as I,dirname as z,basename as U,isAbsolute as Ie,resolve as N,parse as We,toNamespacedPath as Oe,extname as he}from"@visulima/path";import{readTsConfig as Hi,findTsConfig as Gi}from"@visulima/tsconfig";import Xi from"browserslist";import{defu as Yi}from"defu";import{createHooks as Qi}from"hookable";import{createJiti as Gt}from"jiti";import{rollup as Xt,watch as ft,VERSION as Zi}from"rollup";import{exec as en}from"tinyexec";import{stat as nt,chmod as tn,readFile as nn,readdir as on,rm as an}from"node:fs/promises";import Yt from"@rollup/plugin-alias";import sn from"@rollup/plugin-commonjs";import rn from"@rollup/plugin-dynamic-import-vars";import{nodeResolve as Qt}from"@rollup/plugin-node-resolve";import Zt from"@rollup/plugin-replace";import{wasm as ln}from"@rollup/plugin-wasm";import pn from"rollup-plugin-polyfill-node";import{visualizer as cn}from"rollup-plugin-visualizer";import{minVersion as ei,valid as dn,coerce as un}from"semver";import Pe from"node:assert/strict";import{extractAssignedNames as mn,createFilter as K}from"@rollup/pluginutils";import te from"magic-string";import fn from"glob-parent";import{glob as gn,isDynamicPattern as gt,globSync as vn}from"tinyglobby";import{isRelative as ot,resolveAlias as hn}from"@visulima/path/utils";import{d as xn,g as yn}from"./packem_shared/index-D0PXAVC1.mjs";import{SourceMapGenerator as bn}from"source-map-js";import{m as Ge}from"./packem_shared/sourcemap-DDVjvayf.mjs";import{i as wn,a as kn,b as vt,c as ht,e as Le,d as $n,f as Z,p as jn,g as En}from"./packem_shared/Mime-Bx-qqQwc.mjs";import{n as qe}from"./packem_shared/ensure-auto-modules-DqEPN0fu.mjs";import{findStaticImports as ti,fileURLToPath as Sn,resolveModuleExportNames as On,resolvePath as xt}from"mlly";import{parseAsync as Pn}from"oxc-parser";import{E as ie,D as Fe,C as Dn,S as Nn,R as ii,a as De,P as ge,b as yt,c as pe,A as ce}from"./packem_shared/constants-DSQIKVQe.mjs";import Cn from"@rollup/plugin-json";import _n from"rollup-plugin-license";import{g as Mn,d as zn}from"./packem_shared/create-or-update-key-storage-CckGx9A8.mjs";import{findPackageJson as In,parsePackageJson as Fn}from"@visulima/package/package-json";import{ResolverFactory as Tn}from"oxc-resolver";import{readdirSync as An,createReadStream as at,createWriteStream as Rn,existsSync as Jn}from"node:fs";import bt,{isBuiltin as Ue}from"node:module";import{fileURLToPath as Bn}from"node:url";import{loadSourceMap as Wn}from"@visulima/source-map";import{parse as Ln}from"@babel/parser";import qn from"node:crypto";import{createBrotliCompress as Un,constants as Kn,createGzip as Vn}from"node:zlib";import Hn from"child_process";import{NotFoundError as Gn}from"@visulima/fs/error";import{distance as Xn}from"fastest-levenshtein";import Yn from"picomatch";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);
|
|
@@ -8,11 +8,11 @@ var Qn=Object.defineProperty,Zn=f((e,t)=>Qn(e,"name",{value:t,configurable:!0}),
|
|
|
8
8
|
?`),""),o.append(`
|
|
9
9
|
|
|
10
10
|
export = `+n+";"),{code:o.toString().replace(/export\s\{\s\s\};/,""),map:o.generateMap({hires:!0})}}return null},"patchCjsDefaultExport");var ko=Object.defineProperty,wt=f((e,t)=>ko(e,"name",{value:t,configurable:!0}),"i$d");const si=wt(({addDefaultProperty:e=!1,logger:t,type:i})=>({name:"packem:cjs-interop",renderChunk:wt(async(n,o,a)=>{if(o.type!=="chunk"||!o.isEntry)return null;if(a.format==="cjs"&&a.exports==="auto"){const s=/(exports(?:\['default'\]|\.default)) = (.*);/i.exec(n);if(s===null||s.length<3)return null;const r=new te(n);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 p=r.toString();return p=p.replace(/(?:module\.)?exports(?:\['default'\]|\.default)/i,"module.exports"),t.debug({message:"Applied CommonJS interop to entry chunk "+o.fileName+".",prefix:"plugin:cjs-interop"}),{code:p,map:r.generateMap({hires:!0})}}return a.format==="es"&&/\.d\.(?:ts|cts)$/.test(o.fileName)?i!=="commonjs"&&o.fileName.endsWith(".d.mts")?null:ai(n):null},"renderChunk")}),"cjsInteropPlugin");var $o=Object.defineProperty,jo=f((e,t)=>$o(e,"name",{value:t,configurable:!0}),"f$f");const Eo=jo((e,t)=>{const i=new Map,n={copyOnce:!0,exactFileNames:!0,flatten:!1,...e};let{targets:o}=n;return Array.isArray(o)?o=o.map(a=>{if(typeof a=="string")return{src:a};if(typeof a=="object"&&"src"in a)return a}).filter(Boolean):typeof o=="string"&&(o=[{src:o}]),{async buildStart(){const a=await Promise.all(o.flatMap(s=>Array.isArray(s.src)?s.src.map(r=>({...s,src:r})):s).map(async s=>await gn(Xe(s.src),{ignore:Xe(s.exclude).filter(Boolean)}).then(r=>({dest:s.dest??"",parent:fn(s.src),src:r}))));for(const s of a)for(const r of s.src){let p;i.has(r)?p=i.get(r):(p={copied:[],dest:[],timestamp:0},i.set(r,p));const l=n.flatten?G(s.dest):j(s.dest,I(s.parent,z(r)));p.dest.includes(l)||p.dest.push(l),this.addWatchFile(r)}t.info({message:"Copying files...",prefix:"plugin:copy"}),await Promise.all([...i].map(async([s,r])=>{let p;try{const l=await nt(s);if(!l.isFile())return;const c=l.mtime.getTime();c>r.timestamp&&(r.timestamp=c,r.copied=[]),p=await
|
|
11
|
+
module.exports.default = `+s[2]+";");let p=r.toString();return p=p.replace(/(?:module\.)?exports(?:\['default'\]|\.default)/i,"module.exports"),t.debug({message:"Applied CommonJS interop to entry chunk "+o.fileName+".",prefix:"plugin:cjs-interop"}),{code:p,map:r.generateMap({hires:!0})}}return a.format==="es"&&/\.d\.(?:ts|cts)$/.test(o.fileName)?i!=="commonjs"&&o.fileName.endsWith(".d.mts")?null:ai(n):null},"renderChunk")}),"cjsInteropPlugin");var $o=Object.defineProperty,jo=f((e,t)=>$o(e,"name",{value:t,configurable:!0}),"f$f");const Eo=jo((e,t)=>{const i=new Map,n={copyOnce:!0,exactFileNames:!0,flatten:!1,...e};let{targets:o}=n;return Array.isArray(o)?o=o.map(a=>{if(typeof a=="string")return{src:a};if(typeof a=="object"&&"src"in a)return a}).filter(Boolean):typeof o=="string"&&(o=[{src:o}]),{async buildStart(){const a=await Promise.all(o.flatMap(s=>Array.isArray(s.src)?s.src.map(r=>({...s,src:r})):s).map(async s=>await gn(Xe(s.src),{ignore:Xe(s.exclude).filter(Boolean)}).then(r=>({dest:s.dest??"",parent:fn(s.src),src:r}))));for(const s of a)for(const r of s.src){let p;i.has(r)?p=i.get(r):(p={copied:[],dest:[],timestamp:0},i.set(r,p));const l=n.flatten?G(s.dest):j(s.dest,I(s.parent,z(r)));p.dest.includes(l)||p.dest.push(l),this.addWatchFile(r)}t.info({message:"Copying files...",prefix:"plugin:copy"}),await Promise.all([...i].map(async([s,r])=>{let p;try{const l=await nt(s);if(!l.isFile())return;const c=l.mtime.getTime();c>r.timestamp&&(r.timestamp=c,r.copied=[]),p=await Se(s,{buffer:!0})}catch(l){t.error({context:[l],message:`error reading file ${s}`,prefix:"plugin:copy"});return}for(const l of r.dest){if(n.copyOnce&&r.copied.includes(l))continue;const c=U(s),m=j(l,c);try{this.emitFile({[n.exactFileNames?"fileName":"name"]:m,source:p,type:"asset"}),t.debug({message:`copied ${s} → ${m}`,prefix:"plugin:copy"}),r.copied.push(l)}catch(d){t.error({context:[d],message:`error copying file ${s} → ${m}`,prefix:"plugin:copy"})}}}))},name:"packem:copy"}},"copyPlugin");var So=Object.defineProperty,Oo=f((e,t)=>So(e,"name",{value:t,configurable:!0}),"r$b");const kt=Oo((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 Po=Object.defineProperty,Do=f((e,t)=>Po(e,"name",{value:t,configurable:!0}),"a$n");const No=4,Co=process.env.UV_THREADPOOL_SIZE?Number.parseInt(process.env.UV_THREADPOOL_SIZE,10):No;let _o=class{static{f(this,"f")}static{Do(this,"LoaderManager")}test;loaders=new Map;options;workQueue;logger;constructor({extensions:t,loaders:i,logger:n,options:o}){this.test=a=>t.some(s=>a.toLowerCase().endsWith(s)),i.length>0&&this.add(...i),this.options=o,this.logger=n}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(kt(t,i.test))return!0;return!1}async process(t,i){this.workQueue||(this.workQueue=new xn({concurrency:Co-1}));for await(const[n,o]of this.loaders){const a={...i,options:this.options[n]??{}};if(o.alwaysProcess||kt(a.id,o.test)){this.logger.debug(`Processing ${n} loader for ${a.id}`);const s=await this.workQueue.add(o.process.bind(a,t));s&&(t=s)}}return t}};var Mo=Object.defineProperty,zo=f((e,t)=>Mo(e,"name",{value:t,configurable:!0}),"u$c");const Io=zo(async e=>{const t=new bn({file:""}),i=[];let n=0;for await(const{css:o,map:a}of e){i.push(o);const s=Ge(a),r=s.toObject();if(!r)continue;const p=s.toConsumer();if(p){if(p.eachMapping(l=>{t.addMapping({generated:{column:l.generatedColumn,line:n+l.generatedLine},name:l.name,original:{column:l.originalColumn,line:l.originalLine},source:l.source})}),r.sourcesContent)for(const l of r.sources)t.setSourceContent(l,p.sourceContentFor(l,!0));n+=o.split(`
|
|
12
12
|
`).length}}return{css:i.join(`
|
|
13
|
-
`),map:t}},"concat");var Fo=Object.defineProperty,ue=f((e,t)=>Fo(e,"name",{value:t,configurable:!0}),"b$4");const To=ue(async(e,t)=>e.sort((i,n)=>t.indexOf(i.name)-t.indexOf(n.name)),"sortByNameOrder"),Ao=ue(async(e,t,i,n,o,a,s,r,p,l)=>{const c={...l,...e.alias},m=K(e.include,e.exclude),d=wn(e.sourceMap),u={...kn(e.mode),autoModules:e.autoModules??!1,dts:e.dts,extensions:e.extensions,namedExports:e.namedExports};typeof u.inject=="object"&&u.inject.treeshakeable&&(u.namedExports=!1,t.info({message:"Disabling named exports due to `inject.treeshakeable` option",prefix:"css"}));let g=!1;if(e.loaders)for(const b of e.loaders)b.name==="postcss"&&(g=!0);else e.loaders=[];g&&(u.postcss={...e.postcss,config:vt(e.postcss?.config,{}),import:ht(e.postcss?.import,c),modules:vt(e.postcss?.modules,void 0),to:e.postcss?.to,url:ht(e.postcss?.url,c)},e.postcss?.parser&&(u.postcss.parser=await Le(e.postcss.parser,"parser",n)),e.postcss?.syntax&&(u.postcss.syntax=await Le(e.postcss.syntax,"syntax",n)),e.postcss?.stringifier&&(u.postcss.stringifier=await Le(e.postcss.stringifier,"stringifier",n)),e.postcss?.plugins&&(u.postcss.plugins=await $n(e.postcss.plugins,n)));const v=new _o({extensions:u.extensions,loaders:await To(e.loaders,["sourcemap","stylus","less","sass","postcss"]),logger:t,options:{...e,...u,alias:c}});let $=[];const h=ue((b,w)=>{const y=[];for(const k of Object.keys(b)){const x=new Set;let
|
|
13
|
+
`),map:t}},"concat");var Fo=Object.defineProperty,ue=f((e,t)=>Fo(e,"name",{value:t,configurable:!0}),"b$4");const To=ue(async(e,t)=>e.sort((i,n)=>t.indexOf(i.name)-t.indexOf(n.name)),"sortByNameOrder"),Ao=ue(async(e,t,i,n,o,a,s,r,p,l)=>{const c={...l,...e.alias},m=K(e.include,e.exclude),d=wn(e.sourceMap),u={...kn(e.mode),autoModules:e.autoModules??!1,dts:e.dts,extensions:e.extensions,namedExports:e.namedExports};typeof u.inject=="object"&&u.inject.treeshakeable&&(u.namedExports=!1,t.info({message:"Disabling named exports due to `inject.treeshakeable` option",prefix:"css"}));let g=!1;if(e.loaders)for(const b of e.loaders)b.name==="postcss"&&(g=!0);else e.loaders=[];g&&(u.postcss={...e.postcss,config:vt(e.postcss?.config,{}),import:ht(e.postcss?.import,c),modules:vt(e.postcss?.modules,void 0),to:e.postcss?.to,url:ht(e.postcss?.url,c)},e.postcss?.parser&&(u.postcss.parser=await Le(e.postcss.parser,"parser",n)),e.postcss?.syntax&&(u.postcss.syntax=await Le(e.postcss.syntax,"syntax",n)),e.postcss?.stringifier&&(u.postcss.stringifier=await Le(e.postcss.stringifier,"stringifier",n)),e.postcss?.plugins&&(u.postcss.plugins=await $n(e.postcss.plugins,n)));const v=new _o({extensions:u.extensions,loaders:await To(e.loaders,["sourcemap","stylus","less","sass","postcss"]),logger:t,options:{...e,...u,alias:c}});let $=[];const h=ue((b,w)=>{const y=[];for(const k of Object.keys(b)){const x=new Set;let S=[k];do{const C=[];for(const _ of S){if(x.has(_))continue;if(v.isSupported(_)){m(_)&&C.push(_);continue}x.add(_);const V=w(_);V&&C.push(...V.importedIds)}S=C}while(S.some(C=>!v.isSupported(C)));y.push(...S)}return y},"traverseImportedModules");return{augmentChunkHash(b){if($.length===0)return null;const w=h(b.modules,this.getModuleInfo),y=$.filter(k=>w.includes(k.id)).sort((k,x)=>w.lastIndexOf(k.id)-w.lastIndexOf(x.id)).map(k=>`${U(k.id)}:${k.css}`);return y.length===0?null:y.join(":")},async generateBundle(b,w){if($.length===0||!(b.dir||b.file))return;const y=Object.values(w),k=b.dir??z(b.file),x=y.filter(O=>O.type==="chunk"),S=x.filter(O=>!O.facadeModuleId),C=b.preserveModules?x:x.filter(O=>O.isEntry||O.isDynamicEntry),_=[],V=ue(async(O,M)=>{const E=typeof u.extract=="string"?G(u.extract).replace(/^\.[/\\]/,""):G(`${O}.css`);Ie(E)&&this.error(["Extraction path must be relative to the output directory,",`which is ${I(n,k)}`].join(`
|
|
14
14
|
`)),ot(E)&&this.error(["Extraction path must be nested inside output directory,",`which is ${I(n,k)}`].join(`
|
|
15
|
-
`));const J=$.filter(L=>M.includes(L.id)).sort((L,ae)=>M.lastIndexOf(L.id)-M.lastIndexOf(ae.id)),be=await Io(J);return{css:be.css,map:Ge(be.map.toString()).relative(z(N(k,E))).toString(),name:E}},"getExtractedData"),H=ue(
|
|
15
|
+
`));const J=$.filter(L=>M.includes(L.id)).sort((L,ae)=>M.lastIndexOf(L.id)-M.lastIndexOf(ae.id)),be=await Io(J);return{css:be.css,map:Ge(be.map.toString()).relative(z(N(k,E))).toString(),name:E}},"getExtractedData"),H=ue(O=>{if(b.file)return We(b.file).name;if(b.preserveModules){const{dir:M,name:E}=We(O.fileName);return M?j(M,E):E}return O.name},"getName"),F=[];if(typeof u.extract=="string"){t.debug({message:`Extracting to ${u.extract}`,prefix:"css"});const O=[];for(const E of S){const J=h(E.modules,this.getModuleInfo);F.push(...J),O.push(...J)}for(const E of C)O.push(...h(E.modules,this.getModuleInfo).filter(J=>!F.includes(J)));const M=H(x[0]);_.push([M,O])}else{t.debug({message:"Extracting to individual files",prefix:"css"});for(const O of S){const M=h(O.modules,this.getModuleInfo);if(M.length===0)continue;F.push(...M);const E=H(O);_.push([E,M])}for(const O of C){const M=h(O.modules,this.getModuleInfo).filter(J=>!F.includes(J));if(M.length===0)continue;const E=H(O);_.push([E,M])}}for await(const[O,M]of _){const E=await V(O,M);if(typeof e.onExtract=="function"&&!e.onExtract(E))continue;if(p&&e.minifier){t.info({message:`Minifying ${E.name} with ${e.minifier.name}`,prefix:"css"});const{css:L,map:ae}=await e.minifier.handler.bind({browserTargets:i,warn:this.warn.bind(this)})(E,d,e[e.minifier.name]??{});E.css=L,E.map=ae}const J={fileName:E.name,name:E.name,names:[E.name],originalFileName:E.name,originalFileNames:[E.name],source:E.css,type:"asset"},be=this.emitFile(J);if(E.map&&d){const L=this.getFileName(be),ae=typeof b.assetFileNames=="string"?G(z(b.assetFileNames)):typeof b.assetFileNames=="function"?G(z(b.assetFileNames(J))):"assets",le=Ge(E.map).modify(T=>(T.file=U(L),T)).modifySources(T=>{if(T==="<no source>"||ae.length<=1)return T;T=`../${T}`;for(const Be of ae)Be==="/"&&(T=`../${T}`);return T});if(d.inline)le.modify(T=>d.transform?.(T,G(j(k,L)))),w[L].source+=le.toCommentData();else{const T=`${L}.map`;le.modify(zi=>d.transform?.(zi,G(j(k,T)))),this.emitFile({fileName:T,source:le.toString(),type:"asset"});const{base:Be}=We(T);w[L].source+=le.toCommentFile(Be)}}}},name:"packem:css",async transform(b,w){if(!m(w)||!v.isSupported(w)||b.replaceAll(/\s/g,"")==="")return null;try{return this.parse(b,{}),this.warn(`Skipping processed file ${I(n,w)}`),null}catch{}typeof e.onImport=="function"&&e.onImport(b,w);const y={alias:c,assets:new Map,autoModules:u.autoModules,browserTargets:i,cwd:n,debug:r,deps:new Set,dts:u.dts,emit:u.emit,environment:a,extensions:u.extensions,extract:u.extract,id:w,inject:u.inject,logger:t,namedExports:u.namedExports,options:{},plugin:this,sourceDir:o,sourceMap:d,useSourcemap:s,warn:this.warn.bind(this)},k=await v.process({code:b},y);for(const x of y.deps)this.addWatchFile(x);for(const[x,S]of y.assets)this.emitFile({fileName:x,source:S,type:"asset"});if(k.extracted){const{id:x}=k.extracted;$=$.filter(S=>S.id!==x),$.push(k.extracted)}return{code:k.code,map:d&&k.map?k.map:{mappings:""},meta:{styles:k.meta},moduleSideEffects:k.extracted?!0:null}}}},"default");var Ro=Object.defineProperty,Jo=f((e,t)=>Ro(e,"name",{value:t,configurable:!0}),"u$b");const Bo=`
|
|
16
16
|
/* eslint-disable */
|
|
17
17
|
/* prettier-ignore */
|
|
18
18
|
// @ts-nocheck
|
|
@@ -31,9 +31,9 @@ ${r}`),i.info({message:`Generated types for ${G(a).replace(t+"/","")}`,prefix:"d
|
|
|
31
31
|
`),e&&(n+=`const __filename = import.meta.filename; // -- packem CommonJS __filename shim --
|
|
32
32
|
`),t&&(n+=`const __dirname = import.meta.dirname; // -- packem CommonJS __dirname shim --
|
|
33
33
|
`),i&&(n+=`const require = __cjs_mod__.createRequire(import.meta.url);
|
|
34
|
-
`),n},"generateCJSShimNode20_11"),ea=Te((e,t)=>{const i=K(t.include,t.exclude);return{name:"packem:esm-shim-cjs-syntax",renderChunk(n,o,a){if(a.format==="es"&&i(o.fileName)){let s=Qo;if(e.engines?.node){const r=ei(e.engines.node);r&&r.major>=20&&r.minor>=11&&(s=Zo)}return Yo(n,s)}return null}}},"esmShimCjsSyntaxPlugin");var ta=Object.defineProperty,ia=f((e,t)=>ta(e,"name",{value:t,configurable:!0}),"m$8");const na=ia(()=>({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 oa=Object.defineProperty,aa=f((e,t)=>oa(e,"name",{value:t,configurable:!0}),"e$7");const jt=/^([\w-]+):/,Et=aa(e=>{if(!e||typeof e!="string")throw new Error("Invalid key: Key must be a non-empty string.");const t=[],i=jt.exec(e);i&&(t.push(i[1]),e=e.replace(jt,""));const n=e.split("/");for(const o of n)(o.includes("*")||o)&&t.push(o);return t},"splitTsconfigPathKey");var sa=Object.defineProperty,ra=f((e,t)=>sa(e,"name",{value:t,configurable:!0}),"h$2");const la=ra((e,t)=>{const i=e.replace(/^\.\//,""),n=t.replace(/^\.\//,"");if(n.startsWith(i))return e+n.slice(i.length);if(e.endsWith(t))return e;const o=Et(e),a=Et(t);let s=o.length-1,r=a.length-1;for(;s>=0&&r>=0&&o[s]===a[r];)s--,r--;let p=o.slice(0,s).join("/");const l=a.slice(r).join("/");return(!p.startsWith(".")||p==="")&&(p="./"+p),p+(l?"/"+l:"")},"extendString");var pa=Object.defineProperty,ca=f((e,t)=>pa(e,"name",{value:t,configurable:!0}),"s$f");const da=ca((...e)=>{if(e.length===0)return"";if(e.length===1)return z(e[0]);e=e.map(o=>
|
|
34
|
+
`),n},"generateCJSShimNode20_11"),ea=Te((e,t)=>{const i=K(t.include,t.exclude);return{name:"packem:esm-shim-cjs-syntax",renderChunk(n,o,a){if(a.format==="es"&&i(o.fileName)){let s=Qo;if(e.engines?.node){const r=ei(e.engines.node);r&&r.major>=20&&r.minor>=11&&(s=Zo)}return Yo(n,s)}return null}}},"esmShimCjsSyntaxPlugin");var ta=Object.defineProperty,ia=f((e,t)=>ta(e,"name",{value:t,configurable:!0}),"m$8");const na=ia(()=>({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 oa=Object.defineProperty,aa=f((e,t)=>oa(e,"name",{value:t,configurable:!0}),"e$7");const jt=/^([\w-]+):/,Et=aa(e=>{if(!e||typeof e!="string")throw new Error("Invalid key: Key must be a non-empty string.");const t=[],i=jt.exec(e);i&&(t.push(i[1]),e=e.replace(jt,""));const n=e.split("/");for(const o of n)(o.includes("*")||o)&&t.push(o);return t},"splitTsconfigPathKey");var sa=Object.defineProperty,ra=f((e,t)=>sa(e,"name",{value:t,configurable:!0}),"h$2");const la=ra((e,t)=>{const i=e.replace(/^\.\//,""),n=t.replace(/^\.\//,"");if(n.startsWith(i))return e+n.slice(i.length);if(e.endsWith(t))return e;const o=Et(e),a=Et(t);let s=o.length-1,r=a.length-1;for(;s>=0&&r>=0&&o[s]===a[r];)s--,r--;let p=o.slice(0,s).join("/");const l=a.slice(r).join("/");return(!p.startsWith(".")||p==="")&&(p="./"+p),p+(l?"/"+l:"")},"extendString");var pa=Object.defineProperty,ca=f((e,t)=>pa(e,"name",{value:t,configurable:!0}),"s$f");const da=ca((...e)=>{if(e.length===0)return"";if(e.length===1)return z(e[0]);e=e.map(o=>Oe(o));const[t,...i]=e;let n=t.split("/");for(const o of i){const a=o.split("/",n.length);let s=0;for(const r of a)if(r===n[s])s+=1;else{n=n.slice(0,s);break}n=n.slice(0,s)}return n.length<=1&&n[0]===""?`/${n[0]}`:n.join("/")},"lowestCommonAncestor");var ua=Object.defineProperty,ve=f((e,t)=>ua(e,"name",{value:t,configurable:!0}),"d$d");const St=ve((e,t)=>`${e}
|
|
35
35
|
//# sourceMappingURL=${U(t)}.map
|
|
36
|
-
`,"appendMapUrl"),
|
|
36
|
+
`,"appendMapUrl"),Ot=ve((e,t,i)=>JSON.stringify({file:U(i),mappings:e,names:[],sourceRoot:"",sources:[I(z(i),t)],version:3}),"generateDtsMap"),ma=ve((e,t,i,n,o,a,s,r)=>{const p=K(a.include,a.exclude);let l=Object.create(null);const c=ve((u,g)=>{l[u.replace(ie,"")]={...g,ext:he(u)}},"addOutput");let m=[];r?.config.compilerOptions&&(m=Object.entries(r.config.compilerOptions.paths??{}).map(([u])=>u.endsWith("*")?new RegExp(`^${u.replace("*","(.*)")}$`):new RegExp(`^${u}$`)));async function d(u,g){if(!p(g))return;let v;try{v=(await Pn(g,u)).program}catch(y){o.debug({message:y.message,prefix:"packem:isolated-declarations"})}if(v){const y=v.body.filter(k=>(k.type==="ImportDeclaration"||k.type==="ExportAllDeclaration"||k.type==="ExportNamedDeclaration")&&!!k.source);for await(const k of y){if(U(k.source.value).includes("."))continue;const x=await this.resolve(k.source.value,g);if(!(!x||x.external)&&(x.id.endsWith(".ts")||x.id.endsWith(".cts")||x.id.endsWith(".mts")||x.id.endsWith(".tsx")||x.id.endsWith(".ctsx")||x.id.endsWith(".mtsx"))){const S=x.id.replace(e+"/","");let C=k.source.value;m.some(_=>_.test(k.source.value))&&!k.source.value.startsWith(".")&&(C="./"+k.source.value),u=u.replaceAll('from "'+k.source.value+'"','from "'+la(C,S)+'"')}}}const{errors:$,map:h,sourceText:b}=await t(g,u,s,r?.config?.compilerOptions);if($.length>0){if(a.ignoreErrors){this.warn($[0]);return}return this.error($[0])}if(c(g,{map:h,source:b}),!v)return;const w=v.body.filter(y=>y.type==="ImportDeclaration"?y.importKind==="type"?!0:y.specifiers?.every(k=>k.type==="ImportSpecifier"&&k.importKind==="type"):y.type==="ExportNamedDeclaration"||y.type==="ExportAllDeclaration"?y.exportKind==="type"?!0:y.type==="ExportNamedDeclaration"&&y.specifiers?.every(k=>k.type==="ExportSpecifier"&&k.exportKind==="type"):!1);for await(const y of w){if(!y.source)continue;const k=await this.resolve(y.source.value,g);if(!k)return;const x=k.id;if(p(x)&&!l[x.replace(ie,"")])try{const S=await Se(x);await d.call(this,S,x)}catch{}}}return f(d,"w"),ve(d,"transform"),{buildStart(){l=Object.create(null)},name:"packem:isolated-declarations",async renderStart(u,{input:g}){const v=da(...Array.isArray(g)?g:Object.values(g));o.debug({message:"Input base:"+v,prefix:"packem:isolated-declarations"}),typeof u.entryFileNames=="function"&&(u.entryFileNames=u.entryFileNames({name:u.name}));const $=u.entryFileNames.replace(/\.(.)?[jt]sx?$/,(h,b)=>`.d.${b||""}ts`);for await(let[h,{ext:b,map:w,source:y}]of Object.entries(l)){if(n&&u.format==="cjs"){const C=ai(y);C!==null&&(y=C.code)}const k=y.includes("from '")?"'":'"',x=h+b;if((i===!0||i==="compatible")&&u.format==="cjs"){o.debug({message:"Emit compatible dts file: "+h,prefix:"packem:isolated-declarations"});const C=$.replace("[name]",I(v,h)).replace(".cts",".ts");let _=y;s&&w&&(_=St(_.trim(),C),this.emitFile({fileName:`${C}.map`,originalFileName:x,source:Ot(w,x,j(u.dir,C)),type:"asset"})),this.emitFile({fileName:C,originalFileName:x,source:_.replaceAll(/(from\s)['|"]((.*)\..+|['|"].*)['|"];?/g,(V,H,F,O)=>H+k+(O||F)+".d.ts"+k+";"),type:"asset"})}o.debug({message:"Emit dts file: "+h,prefix:"packem:isolated-declarations"});const S=$.replace("[name]",I(v,h));s&&w&&(y=St(y.trim(),S),this.emitFile({fileName:`${S}.map`,originalFileName:x,source:Ot(w,x,j(u.dir,S)),type:"asset"})),this.emitFile({fileName:S,originalFileName:x,source:y.replaceAll(/(from\s)['|"]((.*)\..+|['|"].*)['|"];?/g,(C,_,V,H)=>_+k+(H||V)+(u.format==="cjs"?".d.cts":".d.mts")+k+";"),type:"asset"})}},transform:d}},"isolatedDeclarationsPlugin");var fa=Object.defineProperty,ga=f((e,t)=>fa(e,"name",{value:t,configurable:!0}),"n$8");const Pt="export default ",ri=ga(e=>{const t=Cn(e);return{...t,name:"packem:json",transform(i,n){const o=t.transform?.call(this,i,n);return o&&typeof o!="string"&&"code"in o&&o.code?.startsWith(Pt)&&(o.code=o.code.replace(Pt,"module.exports = ")),o}}},"JSONPlugin");var va=Object.defineProperty,ke=f((e,t)=>va(e,"name",{value:t,configurable:!0}),"i$a");class li{static{f(this,"WalkerBase")}static{ke(this,"WalkerBase")}constructor(){this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:ke(()=>this.should_skip=!0,"skip"),remove:ke(()=>this.should_remove=!0,"remove"),replace:ke(t=>this.replacement=t,"replace")}}replace(t,i,n,o){t&&i&&(n!=null?t[i][n]=o:t[i]=o)}remove(t,i,n){t&&i&&(n!=null?t[i].splice(n,1):delete t[i])}}var ha=Object.defineProperty,me=f((e,t)=>ha(e,"name",{value:t,configurable:!0}),"c$h");class xa extends li{static{f(this,"SyncWalker")}static{me(this,"SyncWalker")}constructor(t,i){super(),this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:me(()=>this.should_skip=!0,"skip"),remove:me(()=>this.should_remove=!0,"remove"),replace:me(n=>this.replacement=n,"replace")},this.enter=t,this.leave=i}visit(t,i,n,o){if(t){if(this.enter){const s=this.should_skip,r=this.should_remove,p=this.replacement;this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.enter.call(this.context,t,i,n,o),this.replacement&&(t=this.replacement,this.replace(i,n,o,t)),this.should_remove&&this.remove(i,n,o);const l=this.should_skip,c=this.should_remove;if(this.should_skip=s,this.should_remove=r,this.replacement=p,l)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 p=0;p<r.length;p+=1){const l=r[p];Ye(l)&&(this.visit(l,t,a,p)||p--)}}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,n,o),this.replacement&&(t=this.replacement,this.replace(i,n,o,t)),this.should_remove&&this.remove(i,n,o);const p=this.should_remove;if(this.replacement=s,this.should_remove=r,p)return null}}return t}}function Ye(e){return e!==null&&typeof e=="object"&&"type"in e&&typeof e.type=="string"}f(Ye,"n$7");me(Ye,"isNode");var ya=Object.defineProperty,fe=f((e,t)=>ya(e,"name",{value:t,configurable:!0}),"c$g");class ba extends li{static{f(this,"AsyncWalker")}static{fe(this,"AsyncWalker")}constructor(t,i){super(),this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:fe(()=>this.should_skip=!0,"skip"),remove:fe(()=>this.should_remove=!0,"remove"),replace:fe(n=>this.replacement=n,"replace")},this.enter=t,this.leave=i}async visit(t,i,n,o){if(t){if(this.enter){const s=this.should_skip,r=this.should_remove,p=this.replacement;this.should_skip=!1,this.should_remove=!1,this.replacement=null,await this.enter.call(this.context,t,i,n,o),this.replacement&&(t=this.replacement,this.replace(i,n,o,t)),this.should_remove&&this.remove(i,n,o);const l=this.should_skip,c=this.should_remove;if(this.should_skip=s,this.should_remove=r,this.replacement=p,l)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 p=0;p<r.length;p+=1){const l=r[p];Qe(l)&&(await this.visit(l,t,a,p)||p--)}}else Qe(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,n,o),this.replacement&&(t=this.replacement,this.replace(i,n,o,t)),this.should_remove&&this.remove(i,n,o);const p=this.should_remove;if(this.replacement=s,this.should_remove=r,p)return null}}return t}}function Qe(e){return e!==null&&typeof e=="object"&&"type"in e&&typeof e.type=="string"}f(Qe,"a$j");fe(Qe,"isNode");var wa=Object.defineProperty,pi=f((e,t)=>wa(e,"name",{value:t,configurable:!0}),"a$i");function rt(e,{enter:t,leave:i}){return new xa(t,i).visit(e,null)}f(rt,"walk");pi(rt,"walk");async function ka(e,{enter:t,leave:i}){return await new ba(t,i).visit(e,null)}f(ka,"asyncWalk");pi(ka,"asyncWalk");var $a=Object.defineProperty,ja=f((e,t)=>$a(e,"name",{value:t,configurable:!0}),"u$9");const Ea=ja(({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(n,o){if(!i(o))return null;let a=null;try{a=this.parse(n,{allowReturnOutsideFunction:!0})}catch(p){return this.warn({code:"PARSE_ERROR",message:`[packem:jsx-remove-attributes]: failed to parse "${o}" and remove the jsx attribute.`}),t.warn(p),null}let s=!1;const r=new te(n);return rt(a,{enter(p){if(p.type==="CallExpression"&&p.callee.type==="Identifier"&&p.callee.name==="jsx"){const l=p.arguments.filter(c=>c.type==="ObjectExpression"&&Array.isArray(c.properties));for(const c of l)for(const m of c.properties)m.type==="Property"&&m.key.type==="Literal"&&m.value.type==="Literal"&&e.includes(m.key.value)&&(r.overwrite(m.start-2,m.end,""),s=!0)}}}),s?{code:r.toString(),map:r.generateMap({hires:!0})}:null}}},"jsxRemoveAttributes");var Sa=Object.defineProperty,ci=f((e,t)=>Sa(e,"name",{value:t,configurable:!0}),"d$c");const Oa=ci(e=>{const t=[],i=[];return e.forEach(n=>{n.startsWith("(")?t.push(n):i.push(n)}),[...i.sort(),...t.sort()]},"sortLicenses"),di=ci(({dtsMarker:e,licenseFilePath:t,licenseTemplate:i,logger:n,marker:o,mode:a,packageName:s})=>_n({thirdParty(r){const p=new Set,l=r.sort(({name:m},{name:d})=>(m||0)>(d||0)?1:(d||0)>(m||0)?-1:0).map(({author:m,contributors:d,license:u,licenseText:g,maintainers:v,name:$,repository:h})=>{let b="## "+$+`
|
|
37
37
|
`;u&&(b+=`License: ${u}
|
|
38
38
|
`);const w=new Set;for(const y of[m,...v,...d]){const k=typeof y=="string"?y:y?.name;k&&w.add(k)}return w.size>0&&(b+=`By: ${[...w].join(", ")}
|
|
39
39
|
`),h&&(b+=`Repository: ${typeof h=="string"?h:h.url}
|
|
@@ -45,21 +45,21 @@ ${r}`),i.info({message:`Generated types for ${G(a).replace(t+"/","")}`,prefix:"d
|
|
|
45
45
|
`),u&&p.add(u),b}).join(`
|
|
46
46
|
---------------------------------------
|
|
47
47
|
|
|
48
|
-
`);if(l===""){n.info({message:"No dependencies license information found.",prefix:"plugin:license:"+a});return}const c=i(
|
|
48
|
+
`);if(l===""){n.info({message:"No dependencies license information found.",prefix:"plugin:license:"+a});return}const c=i(Oa(p),l,s);try{const m=it(t),d=Mn(m,o,c);if(!d){n.error({message:`Could not find the license marker: <!-- ${o} --><!-- /${o} --> in ${t}`,prefix:"plugin:license:"+a});return}m!==d&&(se(t,d),n.info({message:`${t} updated.`,prefix:"plugin:license:"+a}))}catch(m){n.error(m)}}}),"license");var Pa=Object.defineProperty,Da=f((e,t)=>Pa(e,"name",{value:t,configurable:!0}),"u$8");const Na=Da(()=>({async generateBundle(e,t){const i=[];for(const o of this.getModuleIds()){const a=this.getModuleInfo(o);if(a!=null&&!a.isExternal)for(const s of a.importedIds)i.push({source:o,target:s})}if(Array.isArray(i)&&i.length===0)return;const n=Object.keys(t);this.emitFile({fileName:`metafile-${n[0].replace(ie,"")}-${e.format}.json`,source:JSON.stringify(i,null,2),type:"asset"})},name:"packem:metafile"}),"metafilePlugin");var Ca=Object.defineProperty,Ze=f((e,t)=>Ca(e,"name",{value:t,configurable:!0}),"a$h");let Dt=!1;const ne={},_a=Ze(e=>Object.fromEntries(Object.entries(e).map(([t,i])=>{if(!i)return[t,{}];const n=Object.fromEntries(Object.entries(i).map(([o,a])=>Array.isArray(a)?[o,[...new Set(a)]]:[o,[]]));return[t,n]})),"uniqueNestedValues"),Ma=Ze((e,t,i,n,o,a)=>{if(a!=="*"&&dn(un(a))===null)throw new Error("Invalid typeScriptVersion option. It must be a valid semver range.");return{name:"packem:node10-compatibility",writeBundle:Ze(async()=>{Dt||(e.info({message:"Declaration node10 compatibility mode is enabled.",prefix:"plugin:packem:node10-compatibility"}),Dt=!0);for(const p of t)for(const l of p.exportKey)l.includes("/*")?ne[l]=["./"+j(i,z(p.name),"*.d.ts")]:ne[l]=[...ne[l]??[],"./"+j(i,p.name+".d.ts")];const s=j(n,"package.json"),r=await Vt(s);o==="file"&&Object.keys(ne).length>0?(Li(s,{...r,typesVersions:_a({...r.typesVersions,[a]:ne})},{detectIndent:!0}),e.info({message:'Your package.json "typesVersions" field has been updated.',prefix:"plugin:packem:node10-compatibility"})):Object.keys(ne).length>0&&e.info({message:`Please add the following field into your package.json to enable node 10 compatibility:
|
|
49
49
|
|
|
50
50
|
${JSON.stringify({typesVersions:{"*":ne}},null,4)}
|
|
51
51
|
`,prefix:"plugin:packem:node10-compatibility"})},"writeBundle")}},"node10CompatibilityPlugin");var za=Object.defineProperty,Ke=f((e,t)=>za(e,"name",{value:t,configurable:!0}),"i$9");let Nt;const Ia=new Map,Fa=Ke((e,t,i,n)=>{const{ignoreSideEffectsForRoot:o,...a}=e;let s=Nt;return s||(s=Nt=new Tn({...a,roots:[...a.roots??[],t],tsconfig:n?{configFile:n,references:"auto"}:void 0})),{name:"oxc-resolve",resolveId:{async handler(r,p,{isEntry:l}){const c=l||!p?z(r):z(p),{error:m,path:d}=await s.async(c,r);if(m)return i.debug(m,{context:[{basedir:t,extensions:a.extensions,id:d}]}),null;let u=Ke(v=>!1,"hasModuleSideEffects");try{const{packageJson:v,path:$}=await In(z(d),{cache:Ia}),h=z($);if(!o||t!==h){const b=v.sideEffects;if(typeof b=="boolean")u=Ke(()=>b,"hasModuleSideEffects");else if(Array.isArray(b)){const w=b.map(y=>y.includes("/")?y:`**/${y}`);u=K(w,null,{resolve:h})}}}catch(v){console.debug(v.message,{context:[{basedir:c,caller:"Resolver",error:v,extensions:a.extensions,id:d}]})}const g=await this.resolve(d,p,{skipSelf:!0});return g?g.external?!1:g.id!==d?g:{id:d,meta:g.meta,moduleSideEffects:u(d)}:null},order:"post"}}},"oxcResolvePlugin");var Ta=Object.defineProperty,ui=f((e,t)=>Ta(e,"name",{value:t,configurable:!0}),"d$a");const de=ui(e=>e.handler||e,"getHandler"),B=ui((e,t,i="")=>({...e,async buildEnd(n){e.buildEnd&&await de(e.buildEnd).call(this,n)},async buildStart(n){e.buildStart&&await de(e.buildStart).call(this,n)},async load(n){if(!e.load)return null;const o=j(i,e.name),a=j("load",Z(n));if(t.has(a,o))return await t.get(a,o);const s=await de(e.load).call(this,n);return t.set(a,s,o),s},name:`cached(${e.name})`,async resolveId(n,o,a){if(!e.resolveId)return null;const s=j(i,e.name),r=j("resolveId",Z(n),o?Z(o):"",Z(JSON.stringify(a)));if(t.has(r,s))return await t.get(r,s);const p=await de(e.resolveId).call(this,n,o,a);return t.set(r,p,s),p},async transform(n,o){if(!e.transform)return null;const a=j(i,e.name),s=j("transform",Z(o),Z(n));if(t.has(s,a))return await t.get(s,a);const r=await de(e.transform).call(this,n,o);return t.set(s,r,a),r}}),"cachingPlugin");var Aa=Object.defineProperty,Ra=f((e,t)=>Aa(e,"name",{value:t,configurable:!0}),"c$e");const Ja=Ra(({directiveRegex:e,exclude:t=[],include:i=[],logger:n})=>{const o={},a={},s=K(i,t);return{name:"packem:preserve-directives",onLog(r,p){return p.code==="MODULE_LEVEL_DIRECTIVE"&&r==="warn"?!1:null},renderChunk:{handler(r,p,{sourcemap:l}){const c=p.moduleIds.map(u=>o[u]?o[u]:null).reduce((u,g)=>(g&&g.forEach(v=>{u.add(v)}),u),new Set),m=new te(r);c.size>0&&(n.debug({message:`directives for chunk "${p.fileName}" are preserved.`,prefix:"plugin:preserve-directives"}),m.prepend(`${[...c].map(u=>`'${u}';`).join(`
|
|
52
52
|
`)}
|
|
53
53
|
`));let d;return p.facadeModuleId&&typeof a[p.facadeModuleId]=="string"&&(d=a[p.facadeModuleId]),d&&(n.debug({message:`shebang for chunk "${p.fileName}" is preserved.`,prefix:"plugin:preserve-directives"}),m.prepend(`${d}
|
|
54
|
-
`)),c.size===0&&d===void 0?null:{code:m.toString(),map:l?m.generateMap({hires:!0}):null}},order:"post"},transform(r,p){if(!s(p))return null;let l=!1;const c=new te(r);if(r.startsWith("#")&&r[1]==="!"){let d=0;for(let u=2,g=r.length;u<g;u++){const v=r.codePointAt(u);if(v===10||v===13||v===8232||v===8233){d=u;break}}d&&(a[p]=r.slice(0,d),c.remove(0,d+1),l=!0,n.debug({message:`shebang for module "${p}" is preserved.`,prefix:"plugin:preserve-directives"}))}let m=null;try{m=this.parse(c.toString(),{allowReturnOutsideFunction:!0})}catch(d){return this.warn({code:"PARSE_ERROR",message:`failed to parse "${p}" and extract the directives.`}),n.warn(d),null}if(m.type!=="Program")return null;for(const d of m.body.filter(Boolean)){if(d.type!=="ExpressionStatement")break;let u=null;"directive"in d?u=d.directive:d.expression.type==="Literal"&&typeof d.expression.value=="string"&&e.test(d.expression.value)&&(u=d.expression.value),u!=="use strict"&&u&&(o[p]||=new Set,o[p].add(u),"start"in d&&typeof d.start=="number"&&"end"in d&&typeof d.end=="number"&&(c.remove(d.start,d.end),l=!0),n.debug({message:`directive "${u}" for module "${p}" is preserved.`,prefix:"plugin:preserve-directives"}))}return l?{code:c.toString(),map:c.generateMap({hires:!0}),meta:{preserveDirectives:{directives:[...o[p]??[]],shebang:a[p]??null}}}:null}}},"preserveDirectives");var Ba=Object.defineProperty,Wa=f((e,t)=>Ba(e,"name",{value:t,configurable:!0}),"n$6");const La=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,n){return!t(n)&&!n.includes("?raw")?null:(n.includes("?raw")||(i=`export default ${JSON.stringify(i)}`),{code:i,map:{mappings:""}})}}},"rawPlugin");var qa=Object.defineProperty,Ua=f((e,t)=>qa(e,"name",{value:t,configurable:!0}),"i$8");const Ae=Ua((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(n=>[n.find,n.replacement]))):Object.assign(i,t.rollup.alias.entries??t.rollup.alias)),i},"resolveAliases");var Ka=Object.defineProperty,re=f((e,t)=>Ka(e,"name",{value:t,configurable:!0}),"p$4");const Ct=re((e,t,i)=>e.reduce((n,o,a)=>(o instanceof RegExp?n.push(o):typeof o=="string"&&o.length>0?n.push(new RegExp("^"+o.replaceAll(/[.*+?^${}()|[\]\\]/g,"\\$&")+"$")):i.warn(`Ignoring wrong entry type #${a} in '${t}' option: ${JSON.stringify(o)}`),n),[]),"getRegExps"),_t=new Map,Va=re((e,t)=>{_t.has(e)||t.info({message:'Inlined implicit external "'+P(e)+'". If this is incorrect, add it to the "externals" option.',prefix:"plugin:packem:resolve-externals"}),_t.set(e,!0)},"logExternalMessage"),Mt=new Set(["node:test","node:sqlite"]),mi=re((e,t,i,n,o)=>{const a=new Map,s=new Map,r=new Set(Ct([...i.externals],"include",n)),p=new Set(Ct([...o.exclude??[]],"exclude",n)),l={};Object.assign(l,o.deps?e.dependencies:void 0,o.devDeps?e.devDependencies:void 0,o.peerDeps?e.peerDependencies:void 0,o.optDeps?e.optionalDependencies:void 0);const c=Object.keys(l);if(c.length>0&&r.add(new RegExp("^(?:"+c.join("|")+")(?:/.+)?$")),e.peerDependenciesMeta)for(const[v,$]of Object.entries(e.peerDependenciesMeta))$?.optional&&r.add(new RegExp(`^${v}(?:/.+)?$`));const m=re(v=>[...r].some($=>$.test(v)),"isIncluded"),d=re(v=>[...p].some($=>$.test(v)),"isExcluded");let u=[];t&&(u=Object.entries(t.config.compilerOptions?.paths??{}).map(([v])=>v.endsWith("*")?new RegExp(`^${v.replace("*","(.*)")}$`):new RegExp(`^${v}$`)));const g=Ae(e,i);return{name:"packem:resolve-externals",options:re(v=>{v.external=($,h)=>{if(s.has($))return s.get($);let b;Object.keys(g).length>0&&(b=hn($,g),b===$&&(b=void 0));for(const w of[$,b].filter(Boolean)){if(/^(?:\0|\.{1,2}\/)/.test(w)||Ie(w)||new RegExp(`${i.sourceDir}[/.*|\\.*]`).test(w)||e.name&&w.startsWith(e.name))return s.set(w,!1),!1;if(Ue(w)||Mt.has(w)){let y=o.builtins;return y===void 0&&h&&(y=m(h)&&!d(h)),s.set(w,y),y}if(w[0]==="#"&&e.imports)for(const[y,k]of Object.entries(e.imports)){if(y[0]!=="#"){n.debug({message:'Ignoring package.json import "'+P(y)+'" because it does not start with "#".',prefix:"plugin:packem:resolve-externals"});continue}if(y===w)return s.set(w,!1),!1;if(y.includes("*")){let x;a.has(y)?x=a.get(y):(x=An(j(i.rootDir,k.replace("/*","")),{withFileTypes:!0}).filter(
|
|
54
|
+
`)),c.size===0&&d===void 0?null:{code:m.toString(),map:l?m.generateMap({hires:!0}):null}},order:"post"},transform(r,p){if(!s(p))return null;let l=!1;const c=new te(r);if(r.startsWith("#")&&r[1]==="!"){let d=0;for(let u=2,g=r.length;u<g;u++){const v=r.codePointAt(u);if(v===10||v===13||v===8232||v===8233){d=u;break}}d&&(a[p]=r.slice(0,d),c.remove(0,d+1),l=!0,n.debug({message:`shebang for module "${p}" is preserved.`,prefix:"plugin:preserve-directives"}))}let m=null;try{m=this.parse(c.toString(),{allowReturnOutsideFunction:!0})}catch(d){return this.warn({code:"PARSE_ERROR",message:`failed to parse "${p}" and extract the directives.`}),n.warn(d),null}if(m.type!=="Program")return null;for(const d of m.body.filter(Boolean)){if(d.type!=="ExpressionStatement")break;let u=null;"directive"in d?u=d.directive:d.expression.type==="Literal"&&typeof d.expression.value=="string"&&e.test(d.expression.value)&&(u=d.expression.value),u!=="use strict"&&u&&(o[p]||=new Set,o[p].add(u),"start"in d&&typeof d.start=="number"&&"end"in d&&typeof d.end=="number"&&(c.remove(d.start,d.end),l=!0),n.debug({message:`directive "${u}" for module "${p}" is preserved.`,prefix:"plugin:preserve-directives"}))}return l?{code:c.toString(),map:c.generateMap({hires:!0}),meta:{preserveDirectives:{directives:[...o[p]??[]],shebang:a[p]??null}}}:null}}},"preserveDirectives");var Ba=Object.defineProperty,Wa=f((e,t)=>Ba(e,"name",{value:t,configurable:!0}),"n$6");const La=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,n){return!t(n)&&!n.includes("?raw")?null:(n.includes("?raw")||(i=`export default ${JSON.stringify(i)}`),{code:i,map:{mappings:""}})}}},"rawPlugin");var qa=Object.defineProperty,Ua=f((e,t)=>qa(e,"name",{value:t,configurable:!0}),"i$8");const Ae=Ua((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(n=>[n.find,n.replacement]))):Object.assign(i,t.rollup.alias.entries??t.rollup.alias)),i},"resolveAliases");var Ka=Object.defineProperty,re=f((e,t)=>Ka(e,"name",{value:t,configurable:!0}),"p$4");const Ct=re((e,t,i)=>e.reduce((n,o,a)=>(o instanceof RegExp?n.push(o):typeof o=="string"&&o.length>0?n.push(new RegExp("^"+o.replaceAll(/[.*+?^${}()|[\]\\]/g,"\\$&")+"$")):i.warn(`Ignoring wrong entry type #${a} in '${t}' option: ${JSON.stringify(o)}`),n),[]),"getRegExps"),_t=new Map,Va=re((e,t)=>{_t.has(e)||t.info({message:'Inlined implicit external "'+P(e)+'". If this is incorrect, add it to the "externals" option.',prefix:"plugin:packem:resolve-externals"}),_t.set(e,!0)},"logExternalMessage"),Mt=new Set(["node:test","node:sqlite"]),mi=re((e,t,i,n,o)=>{const a=new Map,s=new Map,r=new Set(Ct([...i.externals],"include",n)),p=new Set(Ct([...o.exclude??[]],"exclude",n)),l={};Object.assign(l,o.deps?e.dependencies:void 0,o.devDeps?e.devDependencies:void 0,o.peerDeps?e.peerDependencies:void 0,o.optDeps?e.optionalDependencies:void 0);const c=Object.keys(l);if(c.length>0&&r.add(new RegExp("^(?:"+c.join("|")+")(?:/.+)?$")),e.peerDependenciesMeta)for(const[v,$]of Object.entries(e.peerDependenciesMeta))$?.optional&&r.add(new RegExp(`^${v}(?:/.+)?$`));const m=re(v=>[...r].some($=>$.test(v)),"isIncluded"),d=re(v=>[...p].some($=>$.test(v)),"isExcluded");let u=[];t&&(u=Object.entries(t.config.compilerOptions?.paths??{}).map(([v])=>v.endsWith("*")?new RegExp(`^${v.replace("*","(.*)")}$`):new RegExp(`^${v}$`)));const g=Ae(e,i);return{name:"packem:resolve-externals",options:re(v=>{v.external=($,h)=>{if(s.has($))return s.get($);let b;Object.keys(g).length>0&&(b=hn($,g),b===$&&(b=void 0));for(const w of[$,b].filter(Boolean)){if(/^(?:\0|\.{1,2}\/)/.test(w)||Ie(w)||new RegExp(`${i.sourceDir}[/.*|\\.*]`).test(w)||e.name&&w.startsWith(e.name))return s.set(w,!1),!1;if(Ue(w)||Mt.has(w)){let y=o.builtins;return y===void 0&&h&&(y=m(h)&&!d(h)),s.set(w,y),y}if(w[0]==="#"&&e.imports)for(const[y,k]of Object.entries(e.imports)){if(y[0]!=="#"){n.debug({message:'Ignoring package.json import "'+P(y)+'" because it does not start with "#".',prefix:"plugin:packem:resolve-externals"});continue}if(y===w)return s.set(w,!1),!1;if(y.includes("*")){let x;a.has(y)?x=a.get(y):(x=An(j(i.rootDir,k.replace("/*","")),{withFileTypes:!0}).filter(S=>S.isFile()).map(S=>S.name),a.set(y,x));for(const S of x)if(S.replace(ie,"")===w.replace(ie,"").replace("#",""))return s.set(w,!1),!1}}if(u.length>0){for(const y of u)if(y.test(w))return s.set(w,!1),!1}if(m(w)&&!d(w))return s.set(w,!0),!0}return Va($,n),!1}},"options"),resolveId:{async handler(v,$,{isEntry:h}){if(h)return null;if(Mt.has(v))return{external:!0,id:v,moduleSideEffects:!1};if(Ue(v)){const b=v.replace(/^node:/,"");return{external:(o.builtins||m(v))&&!d(v),id:o.builtinsPrefix==="ignore"?v:o.builtinsPrefix==="add"||!Ue(b)?"node:"+b:b,moduleSideEffects:!1}}return null},order:"pre"}}},"resolveExternalsPlugin");var Ha=Object.defineProperty,Ga=f((e,t)=>Ha(e,"name",{value:t,configurable:!0}),"r$8");const fi=Ga(()=>({name:"packem:resolve-file-url",resolveId(e){if(e.startsWith("file://"))return Bn(e)}}),"resolveFileUrl");var Xa=Object.defineProperty,Re=f((e,t)=>Xa(e,"name",{value:t,configurable:!0}),"i$6");const Ne=/^#![^\n]*/,et=Re(async e=>{await tn(e,493).catch(()=>{})},"makeExecutable"),Ya=Re((e,t)=>({name:"packem:shebang",renderChunk:{handler(i,n,o){if(!n.isEntry||!n.facadeModuleId)return null;const a=i.startsWith("#")&&i[1]==="!";if(a&&t.replace)return i.replace(Ne,t.shebang+`
|
|
55
55
|
`);if(a)return null;if(e.includes(n.name)){const s=new te(i);return s.prepend(t.shebang+`
|
|
56
56
|
`),{code:s.toString(),map:o.sourcemap?s.generateMap({hires:!0}):void 0}}return null},order:"post"},async writeBundle(i,n){for(const[o,a]of Object.entries(n))if(a.type==="chunk"&&Ne.test(a.code)&&i.dir){const s=N(i.dir,o);await et(s)}}}),"shebangPlugin"),Qa=Re(()=>({name:"packem:remove-shebang",renderChunk(e){return e.replace(Ne,"")}}),"removeShebangPlugin"),Za=Re((e,t=`
|
|
57
|
-
`)=>{const i=Ne.exec(e);return i?i+t:""},"getShebang");var es=Object.defineProperty,ts=f((e,t)=>es(e,"name",{value:t,configurable:!0}),"l$8");const is=ts(({exclude:e,include:t}={})=>{const i=K(t,e);return{async load(n){if(!i(n))return null;let o;try{o=await
|
|
57
|
+
`)=>{const i=Ne.exec(e);return i?i+t:""},"getShebang");var es=Object.defineProperty,ts=f((e,t)=>es(e,"name",{value:t,configurable:!0}),"l$8");const is=ts(({exclude:e,include:t}={})=>{const i=K(t,e);return{async load(n){if(!i(n))return null;let o;try{o=await Se(n,{buffer:!1}),this.addWatchFile(n)}catch{try{const s=n.replace(/\?.*$/,"");o=await Se(s,{buffer:!1}),this.addWatchFile(s)}catch{return this.warn("Failed reading file"),null}}let a;try{const s=Wn(n);if(s===void 0)return o;a=s}catch{return this.warn("Failed resolving source map"),{code:o}}return{code:o,map:a}},name:"packem:sourcemaps"}},"sourcemapsPlugin");var ns=Object.defineProperty,oe=f((e,t)=>ns(e,"name",{value:t,configurable:!0}),"r$7");const os=/\/\*[^*]*\*+(?:[^/*][^*]*\*+)*\//g,as=/MIT License|MIT license|BSD license/,ss=/\n{2,}/g,rs=/\b(\w+)\$\d+\b/g,ls=/[-/\\^$*+?.()|[\]{}]/g,ps=oe(e=>e.replaceAll(ls,"\\$&"),"escapeRegex"),cs=oe(e=>[...new Set(e)],"unique"),ds=oe(e=>e.replaceAll(os,t=>as.test(t)?"":t).replaceAll(ss,`
|
|
58
58
|
|
|
59
59
|
`),"cleanUnnecessaryComments"),zt=new Map;function gi(e,t,{identifierReplacements:i},n){const o=ti(e);for(const s in i){const r=o.find(l=>l.specifier===s&&l.imports.includes("{"));if(!r){this.warn(`${t.fileName} does not import "${s}" for replacement`),process.exitCode=1;continue}const p=i[s];for(const l in p){if(!r.imports.includes(l))throw new Error(`${t.fileName} does not import "${l}" from "${s}" for replacement`);const c=p[l],m=ps(l);c.includes(".")&&(e=e.replace(new RegExp(`\\b\\w+\\b as ${m},?\\s?`),"")),e=e.replaceAll(new RegExp(`\\b${m}\\b`,"g"),c)}}const a=cs(Array.from(e.matchAll(rs),s=>s[0]));if(a.length>0){const s=a.map(p=>`
|
|
60
60
|
- ${p}`).join(""),r=t.fileName.replace(/\.[^/.]+$/,"");zt.has(r)||n.warn({message:`${t.fileName} contains confusing identifier names${s}
|
|
61
61
|
|
|
62
|
-
To replace these, add them to the "rollup -> patchTypes -> identifierReplacements" option in your packem config.`,prefix:"plugin:patch-types"}),zt.set(r,!0)}return e}f(gi,"I");oe(gi,"replaceConfusingTypeNames");const us=oe((e,t)=>{if(t.leadingComments?.some(i=>i.type==="CommentBlock"&&i.value.includes("@internal"))){const i=e.original[t.end]===","?t.end+1:t.end;return e.remove(t.leadingComments[0].start,i),!0}return!1},"removeInternal");function vi(e,t){if(e.includes("@internal")){const i=new te(e),n=Ln(e,{plugins:["typescript"],sourceType:"module"});if(rt(n,{enter(o){us(i,o)&&this.skip()}}),e=i.toString(),e.includes("@internal"))throw new Error(`${t.fileName} has unhandled @internal declarations`)}return e}f(vi,"S$3");oe(vi,"stripInternalTypes");const ms=oe((e,t)=>({name:"packem:patch-types",renderChunk(i,n){return i=gi.call(this,i,n,e,t),i=vi.call(this,i,n),i=ds(i),i}}),"patchTypescriptTypes");var fs=Object.defineProperty,Y=f((e,t)=>fs(e,"name",{value:t,configurable:!0}),"a$f");const gs=42,vs=Y(e=>{let t=!1;for(let i=0;i<e.length;i++)if(e.codePointAt(i)===gs){if(t)return!1;t=!0}return!0},"hasZeroOrOneAsteriskCharacter"),hs=Y(e=>{const t=e.indexOf("*");return t===-1?void 0:{prefix:e.slice(0,t),suffix:e.slice(t+1)}},"tryParsePattern"),xs=Y(({prefix:e,suffix:t},i)=>i.length>=e.length+t.length&&i.startsWith(e)&&i.endsWith(t),"isPatternMatch"),ys=Y((e,t,i)=>{let n,o=-1;for(const a of e){const s=t(a);xs(s,i)&&s.prefix.length>o&&(o=s.prefix.length,n=a)}return n},"findBestPatternMatch"),bs=Y((e,t)=>{const i=[];for(const n of e){if(!vs(n))continue;const o=hs(n);if(o)i.push(o);else if(n===t)return n}return ys(i,n=>n,t)},"matchPatternOrExact"),ws=Y((e,t)=>t.substring(e.prefix.length,t.length-e.suffix.length),"matchedText"),ks=Y(({prefix:e,suffix:t})=>`${e}*${t}`,"patternText"),$s=Y((e,t,i)=>{let n=z(t.path);t.config.compilerOptions?.baseUrl&&(n=N(e,t.config.compilerOptions.baseUrl)),i?.debug({message:`Resolved baseUrl to ${n}`,prefix:"plugin:packem:resolve-tsconfig-paths"});const o=t.config.compilerOptions?.paths??{};return Object.keys(o).length===0&&i?.debug({message:"No paths found in tsconfig.json",prefix:"plugin:packem:resolve-tsconfig-paths"}),{paths:o,resolvedBaseUrl:n}},"getTsconfigPaths"),hi=Y((e,t,i,n)=>{const{paths:o,resolvedBaseUrl:a}=$s(e,t,i),s=Object.keys(o);return{name:"packem:resolve-tsconfig-paths",async resolveId(r,p,l){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(!n.resolveAbsolutePath&&Ie(r))return i.debug({message:`Skipping request as it is an absolute path ${r}`,prefix:"plugin:packem:resolve-tsconfig-paths"}),null;if(ot(r))return i.debug({message:`Skipping request as it is a relative path ${r}`,prefix:"plugin:packem:resolve-tsconfig-paths"}),null;const c=bs(s,r);if(!c)return i.debug({message:`moduleName did not match any paths pattern ${r}`,prefix:"plugin:packem:resolve-tsconfig-paths"}),null;const m=typeof c=="string"?void 0:ws(c,r),d=typeof c=="string"?c:ks(c);for await(const u of o[d]){const g=m?u.replace("*",m):u;if(g.endsWith(".d.ts")||g.endsWith(".d.cts")||g.endsWith(".d.mts"))continue;const v=j(a,g);try{const $=await this.resolve(v,p,{skipSelf:!0,...l});if($)return $}catch($){i.debug({context:[$],message:`Failed to resolve ${v} from ${r}`,prefix:"plugin:packem:resolve-tsconfig-paths"})}}return null}}},"resolveTsconfigPathsPlugin");var js=Object.defineProperty,xi=f((e,t)=>js(e,"name",{value:t,configurable:!0}),"u$6");const Es=xi((e,t)=>{if(!t)return null;const{config:i,path:n}=t;if(!i.compilerOptions)return null;const{rootDirs:o}=i.compilerOptions;if(!o)return null;const a=[];for(const s of o){if(s.startsWith("."))throw new Error(`Invalid rootDir value '.' in ${n}.`);if(s.startsWith(".."))throw new Error(`Invalid rootDir value '..' in ${n}.`);a.push(N(e,s))}return a},"getRootDirectories"),yi=xi((e,t,i)=>{const n=Es(e,i);return{name:"packem:resolve-tsconfig-root-dirs",async resolveId(o,a,s){if(n===null||n.length===0)return null;if(o.startsWith("."))for(const r of n){const p=j(r,o),l=await this.resolve(p,a,{skipSelf:!0,...s});if(l)return t.debug({message:`Resolved ${o} to ${l.id} using rootDirs from tsconfig.json.`,prefix:"plugin:resolve-tsconfig-root-dirs"}),l.id}return null}}},"resolveTsconfigRootDirectories");var Os=Object.defineProperty,Ss=f((e,t)=>Os(e,"name",{value:t,configurable:!0}),"r$6");const Ps=Ss(()=>{const e=/\.(?:[mc]?js|jsx)$/;return{name:"packem:resolve-typescript-mjs-cjs",async resolveId(t,i,n){return e.test(t)&&i?await this.resolve(t.replace(/js(x?)$/,"ts$1"),i,n):null}}},"resolveTypescriptMjsCts"),bi={"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.slides":["ggs"],"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.gov.sk.xmldatacontainer+xml":["xdcf"],"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.nato.bindingdataobject+xml":["bdo"],"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.bary":["bary"],"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(bi);const Ds=new jn(En,bi)._freeze();var Ns=Object.defineProperty,lt=f((e,t)=>Ns(e,"name",{value:t,configurable:!0}),"u$5");const Cs=lt(async(e,t)=>{await new Promise((i,n)=>{const o=at(e);o.on("error",n);const a=Rn(t);a.on("error",n),a.on("finish",i),o.pipe(a)})},"copy"),_s=lt(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"),Ms=lt(({destDir:e,emitFiles:t,exclude:i,fileName:n,include:o,limit:a,publicPath:s,sourceDir:r})=>{const p=K(o,i),l={};return{async generateBundle(c){if(!t)return;const m=e??c.dir??z(c.file??"");await dt(m),await Promise.all(Object.keys(l).map(async d=>{const u=l[d],g=j(m,z(u));await dt(g),await Cs(d,j(m,u))}))},async load(c){if(!p(c))return null;this.addWatchFile(c);const[m,d]=await Promise.all([nt(c),nn(c)]);let u;if(a&&m.size>a||a===0){const g=qn.createHash("sha1").update(d).digest("hex").slice(0,16),v=he(c),$=U(c,v),h=r?I(r,z(c)):U(z(c)),b=n.replaceAll("[hash]",g).replaceAll("[extname]",v).replaceAll("[dirname]",h===""?"":`${h}/`).replaceAll("[name]",$);u=j(s??"",b),l[c]=b}else{const g=Ds.getType(c);if(g===null)throw new Error(`Could not determine mimetype for ${c}`);const v=g==="image/svg+xml";u=v?_s(d):d.toString("base64"),u=`data:${g}${v?"":";base64"},${u}`}return`export default "${u}"`},name:"packem:url"}},"urlPlugin");var zs=Object.defineProperty,Is=f((e,t)=>zs(e,"name",{value:t,configurable:!0}),"s$a");const Fs=Is(e=>{const t=U(e).split(".");if(t.length>=2){const[i,n]=t.slice(-2),o=t[0],a=/^(\w+)-runtime$/.exec(i)?.[1];if(Fe.includes(n)&&a&&a.length>0)return o+"-"+a}},"getCustomModuleLayer");var Ts=Object.defineProperty,As=f((e,t)=>Ts(e,"name",{value:t,configurable:!0}),"i$5");const Ve=As(e=>(e.preserveDirectives||{directives:[]}).directives.map(t=>t.replace(/^use /,"")).find(t=>t!=="strict"),"getModuleLayer");var Rs=Object.defineProperty,It=f((e,t)=>Rs(e,"name",{value:t,configurable:!0}),"d$9");const Js=It((e,t)=>{const i=new Map;return It(function(n,o){const a=o.getModuleInfo(n);if(!a)return;const{isEntry:s}=a,r=a.meta,p=Ve(r);if(!s){const l=i.get(n);if(l)return l;const c=Fs(n);if(c)return i.set(n,c),c}if(s){const l=o.getModuleIds();for(const c of l)o.getModuleInfo(c)&&Ve(r)===p&&(e.has(c)||e.set(c,new Set),e.get(c).add([n,p]))}if(p&&!s&&e.has(n)){const l=[...e.get(n)];if(l.some(([m])=>{if(t.some(d=>d.path===m)){const d=o.getModuleInfo(m);return Ve(d?d.meta:{})===p}return!1}))return;if(l.every(([,m])=>m===p))return i.has(n)?i.get(n):void 0;const c=U(n,he(n))+"-"+p;return i.set(n,c),c}},"splitChunks")},"createSplitChunks");var Bs=Object.defineProperty,Ws=f((e,t)=>Bs(e,"name",{value:t,configurable:!0}),"n$4");const ee=Ws((e,t)=>e.isDynamicEntry?`${Dn}/[name].${t}`:`${Nn}/${e.name}-[hash].${t}`,"getChunkFilename");var Ls=Object.defineProperty,qs=f((e,t)=>Ls(e,"name",{value:t,configurable:!0}),"o$4");const Us=process.platform==="win32",Ft=qs((e,t)=>{const i=Us?"\\":"/";for(let n of Array.isArray(e.names)?e.names:[]){if(n.includes("node_modules"+i+".pnpm"))return n=n.replace("node_modules"+i+".pnpm","external")+"."+t,n.replace("node_modules"+i,"");if(n.includes("node_modules"))return n.replace("node_modules","external")+"."+t}return"[name]."+t},"getEntryFileNames");var Ks=Object.defineProperty,Vs=f((e,t)=>Ks(e,"name",{value:t,configurable:!0}),"t$6");const wi=Vs((e,t)=>{const i=[],n=[],o=[];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"?n.push(a.plugin):o.push(a.plugin)}),[i,o,n]},"sortUserPlugins");var Hs=Object.defineProperty,R=f((e,t)=>Hs(e,"name",{value:t,configurable:!0}),"e$5");const Gs=R((e,t)=>{let i="node"+Ti.node.split(".")[0];if(t.pkg.engines?.node){const n=ei(t.pkg.engines.node);n&&(i="node"+n.major)}if(e==="esbuild"){if(!t.options.rollup.esbuild)throw new Error("No esbuild options found in your configuration.");if(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"),t.options.rollup.esbuild.target){const n=Xe(t.options.rollup.esbuild.target);t.options.runtime==="node"?t.options.rollup.esbuild.target=[...new Set([i,...n])]:t.options.runtime==="browser"&&(t.options.rollup.esbuild.target=[...new Set([...$t(t.options.browserTargets??[]),...n])])}else t.options.rollup.esbuild.target=t.options.runtime==="node"?[i]:$t(t.options.browserTargets??[]);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"),ki=R((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(I(N(),e.id))}"
|
|
62
|
+
To replace these, add them to the "rollup -> patchTypes -> identifierReplacements" option in your packem config.`,prefix:"plugin:patch-types"}),zt.set(r,!0)}return e}f(gi,"I");oe(gi,"replaceConfusingTypeNames");const us=oe((e,t)=>{if(t.leadingComments?.some(i=>i.type==="CommentBlock"&&i.value.includes("@internal"))){const i=e.original[t.end]===","?t.end+1:t.end;return e.remove(t.leadingComments[0].start,i),!0}return!1},"removeInternal");function vi(e,t){if(e.includes("@internal")){const i=new te(e),n=Ln(e,{plugins:["typescript"],sourceType:"module"});if(rt(n,{enter(o){us(i,o)&&this.skip()}}),e=i.toString(),e.includes("@internal"))throw new Error(`${t.fileName} has unhandled @internal declarations`)}return e}f(vi,"S$3");oe(vi,"stripInternalTypes");const ms=oe((e,t)=>({name:"packem:patch-types",renderChunk(i,n){return i=gi.call(this,i,n,e,t),i=vi.call(this,i,n),i=ds(i),i}}),"patchTypescriptTypes");var fs=Object.defineProperty,Y=f((e,t)=>fs(e,"name",{value:t,configurable:!0}),"a$f");const gs=42,vs=Y(e=>{let t=!1;for(let i=0;i<e.length;i++)if(e.codePointAt(i)===gs){if(t)return!1;t=!0}return!0},"hasZeroOrOneAsteriskCharacter"),hs=Y(e=>{const t=e.indexOf("*");return t===-1?void 0:{prefix:e.slice(0,t),suffix:e.slice(t+1)}},"tryParsePattern"),xs=Y(({prefix:e,suffix:t},i)=>i.length>=e.length+t.length&&i.startsWith(e)&&i.endsWith(t),"isPatternMatch"),ys=Y((e,t,i)=>{let n,o=-1;for(const a of e){const s=t(a);xs(s,i)&&s.prefix.length>o&&(o=s.prefix.length,n=a)}return n},"findBestPatternMatch"),bs=Y((e,t)=>{const i=[];for(const n of e){if(!vs(n))continue;const o=hs(n);if(o)i.push(o);else if(n===t)return n}return ys(i,n=>n,t)},"matchPatternOrExact"),ws=Y((e,t)=>t.substring(e.prefix.length,t.length-e.suffix.length),"matchedText"),ks=Y(({prefix:e,suffix:t})=>`${e}*${t}`,"patternText"),$s=Y((e,t,i)=>{let n=z(t.path);t.config.compilerOptions?.baseUrl&&(n=N(e,t.config.compilerOptions.baseUrl)),i?.debug({message:`Resolved baseUrl to ${n}`,prefix:"plugin:packem:resolve-tsconfig-paths"});const o=t.config.compilerOptions?.paths??{};return Object.keys(o).length===0&&i?.debug({message:"No paths found in tsconfig.json",prefix:"plugin:packem:resolve-tsconfig-paths"}),{paths:o,resolvedBaseUrl:n}},"getTsconfigPaths"),hi=Y((e,t,i,n)=>{const{paths:o,resolvedBaseUrl:a}=$s(e,t,i),s=Object.keys(o);return{name:"packem:resolve-tsconfig-paths",async resolveId(r,p,l){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(!n.resolveAbsolutePath&&Ie(r))return i.debug({message:`Skipping request as it is an absolute path ${r}`,prefix:"plugin:packem:resolve-tsconfig-paths"}),null;if(ot(r))return i.debug({message:`Skipping request as it is a relative path ${r}`,prefix:"plugin:packem:resolve-tsconfig-paths"}),null;const c=bs(s,r);if(!c)return i.debug({message:`moduleName did not match any paths pattern ${r}`,prefix:"plugin:packem:resolve-tsconfig-paths"}),null;const m=typeof c=="string"?void 0:ws(c,r),d=typeof c=="string"?c:ks(c);for await(const u of o[d]){const g=m?u.replace("*",m):u;if(g.endsWith(".d.ts")||g.endsWith(".d.cts")||g.endsWith(".d.mts"))continue;const v=j(a,g);try{const $=await this.resolve(v,p,{skipSelf:!0,...l});if($)return $}catch($){i.debug({context:[$],message:`Failed to resolve ${v} from ${r}`,prefix:"plugin:packem:resolve-tsconfig-paths"})}}return null}}},"resolveTsconfigPathsPlugin");var js=Object.defineProperty,xi=f((e,t)=>js(e,"name",{value:t,configurable:!0}),"u$6");const Es=xi((e,t)=>{if(!t)return null;const{config:i,path:n}=t;if(!i.compilerOptions)return null;const{rootDirs:o}=i.compilerOptions;if(!o)return null;const a=[];for(const s of o){if(s.startsWith("."))throw new Error(`Invalid rootDir value '.' in ${n}.`);if(s.startsWith(".."))throw new Error(`Invalid rootDir value '..' in ${n}.`);a.push(N(e,s))}return a},"getRootDirectories"),yi=xi((e,t,i)=>{const n=Es(e,i);return{name:"packem:resolve-tsconfig-root-dirs",async resolveId(o,a,s){if(n===null||n.length===0)return null;if(o.startsWith("."))for(const r of n){const p=j(r,o),l=await this.resolve(p,a,{skipSelf:!0,...s});if(l)return t.debug({message:`Resolved ${o} to ${l.id} using rootDirs from tsconfig.json.`,prefix:"plugin:resolve-tsconfig-root-dirs"}),l.id}return null}}},"resolveTsconfigRootDirectories");var Ss=Object.defineProperty,Os=f((e,t)=>Ss(e,"name",{value:t,configurable:!0}),"r$6");const Ps=Os(()=>{const e=/\.(?:[mc]?js|jsx)$/;return{name:"packem:resolve-typescript-mjs-cjs",async resolveId(t,i,n){return e.test(t)&&i?await this.resolve(t.replace(/js(x?)$/,"ts$1"),i,n):null}}},"resolveTypescriptMjsCts"),bi={"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.slides":["ggs"],"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.gov.sk.xmldatacontainer+xml":["xdcf"],"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.nato.bindingdataobject+xml":["bdo"],"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.bary":["bary"],"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(bi);const Ds=new jn(En,bi)._freeze();var Ns=Object.defineProperty,lt=f((e,t)=>Ns(e,"name",{value:t,configurable:!0}),"u$5");const Cs=lt(async(e,t)=>{await new Promise((i,n)=>{const o=at(e);o.on("error",n);const a=Rn(t);a.on("error",n),a.on("finish",i),o.pipe(a)})},"copy"),_s=lt(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"),Ms=lt(({destDir:e,emitFiles:t,exclude:i,fileName:n,include:o,limit:a,publicPath:s,sourceDir:r})=>{const p=K(o,i),l={};return{async generateBundle(c){if(!t)return;const m=e??c.dir??z(c.file??"");await dt(m),await Promise.all(Object.keys(l).map(async d=>{const u=l[d],g=j(m,z(u));await dt(g),await Cs(d,j(m,u))}))},async load(c){if(!p(c))return null;this.addWatchFile(c);const[m,d]=await Promise.all([nt(c),nn(c)]);let u;if(a&&m.size>a||a===0){const g=qn.createHash("sha1").update(d).digest("hex").slice(0,16),v=he(c),$=U(c,v),h=r?I(r,z(c)):U(z(c)),b=n.replaceAll("[hash]",g).replaceAll("[extname]",v).replaceAll("[dirname]",h===""?"":`${h}/`).replaceAll("[name]",$);u=j(s??"",b),l[c]=b}else{const g=Ds.getType(c);if(g===null)throw new Error(`Could not determine mimetype for ${c}`);const v=g==="image/svg+xml";u=v?_s(d):d.toString("base64"),u=`data:${g}${v?"":";base64"},${u}`}return`export default "${u}"`},name:"packem:url"}},"urlPlugin");var zs=Object.defineProperty,Is=f((e,t)=>zs(e,"name",{value:t,configurable:!0}),"s$a");const Fs=Is(e=>{const t=U(e).split(".");if(t.length>=2){const[i,n]=t.slice(-2),o=t[0],a=/^(\w+)-runtime$/.exec(i)?.[1];if(Fe.includes(n)&&a&&a.length>0)return o+"-"+a}},"getCustomModuleLayer");var Ts=Object.defineProperty,As=f((e,t)=>Ts(e,"name",{value:t,configurable:!0}),"i$5");const Ve=As(e=>(e.preserveDirectives||{directives:[]}).directives.map(t=>t.replace(/^use /,"")).find(t=>t!=="strict"),"getModuleLayer");var Rs=Object.defineProperty,It=f((e,t)=>Rs(e,"name",{value:t,configurable:!0}),"d$9");const Js=It((e,t)=>{const i=new Map;return It(function(n,o){const a=o.getModuleInfo(n);if(!a)return;const{isEntry:s}=a,r=a.meta,p=Ve(r);if(!s){const l=i.get(n);if(l)return l;const c=Fs(n);if(c)return i.set(n,c),c}if(s){const l=o.getModuleIds();for(const c of l)o.getModuleInfo(c)&&Ve(r)===p&&(e.has(c)||e.set(c,new Set),e.get(c).add([n,p]))}if(p&&!s&&e.has(n)){const l=[...e.get(n)];if(l.some(([m])=>{if(t.some(d=>d.path===m)){const d=o.getModuleInfo(m);return Ve(d?d.meta:{})===p}return!1}))return;if(l.every(([,m])=>m===p))return i.has(n)?i.get(n):void 0;const c=U(n,he(n))+"-"+p;return i.set(n,c),c}},"splitChunks")},"createSplitChunks");var Bs=Object.defineProperty,Ws=f((e,t)=>Bs(e,"name",{value:t,configurable:!0}),"n$4");const ee=Ws((e,t)=>e.isDynamicEntry?`${Dn}/[name].${t}`:`${Nn}/${e.name}-[hash].${t}`,"getChunkFilename");var Ls=Object.defineProperty,qs=f((e,t)=>Ls(e,"name",{value:t,configurable:!0}),"o$4");const Us=process.platform==="win32",Ft=qs((e,t)=>{const i=Us?"\\":"/";for(let n of Array.isArray(e.names)?e.names:[]){if(n.includes("node_modules"+i+".pnpm"))return n=n.replace("node_modules"+i+".pnpm","external")+"."+t,n.replace("node_modules"+i,"");if(n.includes("node_modules"))return n.replace("node_modules","external")+"."+t}return"[name]."+t},"getEntryFileNames");var Ks=Object.defineProperty,Vs=f((e,t)=>Ks(e,"name",{value:t,configurable:!0}),"t$6");const wi=Vs((e,t)=>{const i=[],n=[],o=[];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"?n.push(a.plugin):o.push(a.plugin)}),[i,o,n]},"sortUserPlugins");var Hs=Object.defineProperty,R=f((e,t)=>Hs(e,"name",{value:t,configurable:!0}),"e$5");const Gs=R((e,t)=>{let i="node"+Ti.node.split(".")[0];if(t.pkg.engines?.node){const n=ei(t.pkg.engines.node);n&&(i="node"+n.major)}if(e==="esbuild"){if(!t.options.rollup.esbuild)throw new Error("No esbuild options found in your configuration.");if(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"),t.options.rollup.esbuild.target){const n=Xe(t.options.rollup.esbuild.target);t.options.runtime==="node"?t.options.rollup.esbuild.target=[...new Set([i,...n])]:t.options.runtime==="browser"&&(t.options.rollup.esbuild.target=[...new Set([...$t(t.options.browserTargets??[]),...n])])}else t.options.rollup.esbuild.target=t.options.runtime==="node"?[i]:$t(t.options.browserTargets??[]);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"),ki=R((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(I(N(),e.id))}"
|
|
63
63
|
Is the module installed? Note:
|
|
64
64
|
↳ to inline a module into your bundle, install it to "devDependencies".
|
|
65
65
|
↳ 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"),$i=R((e,t)=>({input:Object.fromEntries(e.options.entries.map(i=>[i.name,N(e.options.rootDir,i.input)])),logLevel:e.options.debug?"debug":"info",onLog:R((i,n)=>{let o=n.message;switch(n.stack&&(o=`${o}
|
|
@@ -80,28 +80,28 @@ ${s.chunks.map(c=>{const m=t.buildEntries.find(d=>d.path===c)??{};return Q("
|
|
|
80
80
|
└─ `)+q(i(r.path))+" (total size: "+P(A(r.size?.bytes??0,{decimals:2}))+")";s+=`
|
|
81
81
|
|
|
82
82
|
`,e.raw(s)}return n&&e.raw("Σ Total dist size (byte size):",P(A(t.buildEntries.reduce((s,r)=>s+(r.size?.bytes??0),0),{decimals:2})),`
|
|
83
|
-
`),n},"showSizeInformation"),fr=Ce((e,t)=>{const i=lr(e.options.entries,"environment","runtime"),n=new Set,o=new Set;for(const[a,s]of Object.entries(i))for(const[r,p]of Object.entries(s)){const l={...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={};l.options.rollup.replace?(l.options.rollup.replace.values===void 0&&(l.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 m="";a!=="undefined"&&(m+=a+"/"),r!=="undefined"&&(m+=r+"/");let d=!1;l.options.minify!==void 0&&(d=l.options.minify),a==="development"?d=!1:a==="production"&&(d=!0);const u=[],g=[],v=[],$=[];for(const h of p)h.cjs&&h.esm?u.push(h):h.cjs?v.push(h):h.esm?g.push(h):h.declaration&&$.push(h);if(u.length>0){const h={...l,options:{...l.options,emitCJS:!0,emitESM:!0,entries:u,minify:d,rollup:{...l.options.rollup,replace:l.options.rollup.replace?{...l.options.rollup.replace,values:{...l.options.rollup.replace.values,...c}}:!1}}};if(e.options.dtsOnly||n.add({context:h,fileCache:t,subDirectory:m}),e.options.declaration){const b=h.options.entries.filter(w=>w.declaration);b.length>0&&o.add({context:{...h,options:{...h.options,entries:b}},fileCache:t,subDirectory:m})}}if(g.length>0){const h={...l,options:{...l.options,emitCJS:!1,emitESM:!0,entries:g,minify:d,rollup:{...l.options.rollup,replace:l.options.rollup.replace?{...l.options.rollup.replace,values:{...l.options.rollup.replace.values,...c}}:!1}}};if(e.options.dtsOnly||n.add({context:h,fileCache:t,subDirectory:m}),e.options.declaration){const b=h.options.entries.filter(w=>w.declaration);b.length>0&&o.add({context:{...h,options:{...h.options,entries:b}},fileCache:t,subDirectory:m})}}if(v.length>0){const h={...l,options:{...l.options,emitCJS:!0,emitESM:!1,entries:v,minify:d,rollup:{...l.options.rollup,replace:l.options.rollup.replace?{...l.options.rollup.replace,values:{...l.options.rollup.replace.values,...c}}:!1}}};if(e.options.dtsOnly||n.add({context:h,fileCache:t,subDirectory:m}),e.options.declaration){const b=h.options.entries.filter(w=>w.declaration);b.length>0&&o.add({context:{...h,options:{...h.options,entries:b}},fileCache:t,subDirectory:m})}}l.options.declaration&&$.length>0&&o.add({context:{...l,options:{...l.options,emitCJS:!1,emitESM:!1,entries:$,minify:d,rollup:{...l.options.rollup,replace:l.options.rollup.replace?{...l.options.rollup.replace,values:{...l.options.rollup.replace.values,...c}}:!1}}},fileCache:t,subDirectory:m})}return{builders:n,typeBuilders:o}},"prepareRollupConfig"),gr=Ce(async(e,t)=>{await e.hooks.callHook("build:before",e);const{builders:i,typeBuilders:n}=fr(e,t);await Promise.all([...i].map(async({context:o,fileCache:a,subDirectory:s})=>await er(o,a,s))),await Promise.all([...n].map(async({context:o,fileCache:a,subDirectory:s})=>await ir(o,a,s))),e.logger.success(Ai(e.options.name?"Build succeeded for "+e.options.name:"Build succeeded")),e.buildEntries=e.buildEntries.filter((o,a,s)=>s.findIndex(r=>r.path===o.path)===a);for await(const o of qi(j(e.options.rootDir,e.options.outDir),{includeDirs:!1,includeFiles:!0})){const a=j(e.options.rootDir,e.options.outDir);let s=e.buildEntries.find(p=>j(a,p.path)===o.path);s||(s={chunk:!0,path:o.path},e.buildEntries.push(s)),s.size===void 0&&(s.size={});const r=N(a,o.path);if(!s.size.bytes){const p=await nt(r);s.size.bytes=p.size}s.size.brotli||(s.size.brotli=await ar(r)),s.size.gzip||(s.size.gzip=await dr(r))}return await e.hooks.callHook("build:done",e),mr(e.logger,e)},"build");var vr=Object.defineProperty,hr=f((e,t)=>vr(e,"name",{value:t,configurable:!0}),"r$4");const D=hr((e,t)=>{e.warnings.has(t)||e.warnings.add(t)},"warn");var xr=Object.defineProperty,Oi=f((e,t)=>xr(e,"name",{value:t,configurable:!0}),"t$5");const _e=Oi(e=>{if(e.endsWith(".mjs")||e.endsWith(".d.mts"))return"esm";if(e.endsWith(".cjs")||e.endsWith(".d.cts"))return"cjs"},"inferExportTypeFromFileName"),tt=Oi((e,t,i,n)=>{if(e==="module-sync")return"esm";if(n){const s=_e(n);if(s)return s}if(e==="module"||e==="import")return"esm";if(e==="require")return"cjs";if(t.length===0)return i;const[o,...a]=t;return tt(o,a,i,n)},"inferExportType");var yr=Object.defineProperty,br=f((e,t)=>yr(e,"name",{value:t,configurable:!0}),"y$3");const wr=new Set(["electron","import","require","node","node-addons","default","types","deno","browser","module-sync","bun","workerd",...ii,...De]),pt=br((e,t,i,n=[])=>{if(!e)return[];if(typeof e=="string"){const o=_e(e);if(o&&o!==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:o??t}]}if(typeof e=="object"){const o=Object.entries(e).filter(([s])=>!s.endsWith(".json"));let a=[];for(const[s,r]of o)if(typeof r=="string"){let p={};Number.isInteger(+s)?p={exportKey:"*"}:s.startsWith("./")?p={exportKey:s.replace("./","")}:p={exportKey:s==="."?".":"*",subKey:s},a.push({...p,file:r,key:"exports",type:tt(s,n,t,r)})}else if(typeof r=="object"&&r!==null)for(const[p,l]of Object.entries(r)){if(i===!1&&p==="types")continue;const c=Number.isInteger(+s)?p:s;typeof l=="string"?a.push({exportKey:c.replace("./",""),file:l,key:"exports",...wr.has(p)?{subKey:p}:{},type:tt(p,n,t,l)}):a=[...a,...pt({[c]:l},t,i,[...n,p])]}return a}return[]},"extractExportFilenames");var kr=Object.defineProperty,Je=f((e,t)=>kr(e,"name",{value:t,configurable:!0}),"c$6");const $r=Je((e,t)=>e.key==="exports"&&e.subKey===ge?ge:e.key==="exports"&&e.subKey===yt?yt:t,"getEnvironment"),je=Je((e,t,i,n,o,a,s)=>{const r=$r(o,a.environment);let p=a.options.runtime;for(const m of ii)if(o.file.includes("."+m+".")||o.subKey===m){p=m;break}let l=e.find(m=>m.input===t&&m.environment===r&&m.runtime===p);l===void 0?l=e[e.push({environment:r,exportKey:new Set([o.exportKey].filter(Boolean)),input:t,runtime:p})-1]:l.exportKey&&o.exportKey&&l.exportKey.add(o.exportKey),s&&(l.isGlob=!0),i&&(l.outDir=n),o.isExecutable?(l.executable=!0,l.declaration=!1,o.type==="cjs"?l.cjs=!0:o.type==="esm"&&(l.esm=!0)):(/\.d\.[mc]?ts$/.test(o.file)&&a.options.declaration!==!1&&(l.declaration=a.options.declaration),o.type==="cjs"?l.cjs=!0:o.type==="esm"&&(l.esm=!0));const c=o.file.replace(he(o.file),"").replace(new RegExp(`^./${a.options.outDir.replace(/^\.\//,"")}/`),"");De.has(o.subKey)&&!t.includes(c)&&(l.fileAlias=c)},"createOrUpdateEntry");let Rt=!1;const Jt=Je(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"),jr=Je((e,t,i)=>{const n=[];t.sort((r,p)=>r.split("/").length-p.split("/").length);const o=e.type==="module"?"esm":"cjs";o==="esm"&&(i.options.emitESM=!0),o==="cjs"&&(i.options.emitCJS=!0);const a=pt(e.exports,o,i.options.declaration);if(e.bin){const r=(typeof e.bin=="string"?[e.bin]:Object.values(e.bin)).filter(Boolean);for(const p of r){const l=_e(p);if(l&&l!==o)throw new Error(`Exported file "${p}" has an extension that does not match the package.json type "${e.type??"commonjs"}".`);a.push({file:p,isExecutable:!0,key:"bin",type:l??o})}}e.main&&a.push({file:e.main,key:"main",type:_e(e.main)??o}),e.module&&a.push({file:e.module,key:"module",type:"esm"}),(e.types||e.typings)&&(Jt(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 p=he(r.file);if(p!==""&&!Fe.includes(p))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 l=r.file.replace(/(?:\*[^/\\]|\.d\.[mc]?ts|\.\w+)$/,""),c=l.endsWith("/");if(c&&["./","/"].includes(l))continue;const m=l.replace(new RegExp("(./)?"+i.options.outDir),i.options.sourceDir).replace("./",""),d="(?<=/|$)",u=c?"":"(\\.[cm]?[tj]sx?)$";if(r.file.includes("/*")&&r.key==="exports"){Rt||(i.logger.debug("Private subfolders are not supported, if you need this feature please open an issue on GitHub."),Rt=!0);const h=[],b=new RegExp(d+m.replace("*","(.*)")+u),w=new RegExp(d+m.replace(/(.*)\.[^.]*$/,"$1").replace("*","(.*)")+u);for(const y of t)(b.test(y)||De.has(r.subKey)&&w.test(y))&&h.push(y);if(h.length===0){n.push(`Could not find entrypoint for \`${r.file}\``);continue}for(const y of h)je(s,y,c,l,r,i,!0);continue}const g=new RegExp(d+m+u);let v=t.find(h=>g.test(h));if(De.has(r.subKey)&&v===void 0){const h=new RegExp(d+m.replace(/(.*)\.[^.]*$/,"$1")+u);v=t.find(b=>h.test(b))}if(v===void 0){X(N(i.options.rootDir,r.file))||n.push(`Could not find entrypoint for \`${r.file}\``);continue}(v.endsWith(".ts")||v.endsWith(".cts")||v.endsWith(".mts"))&&X(v)&&Jt(i);const $=Se(v.replace(ie,""));X($+".cts")&&X($+".mts")?(je(s,$+".cts",c,l,{...r,type:"cjs"},i,!1),je(s,$+".mts",c,l,{...r,type:"esm"},i,!1)):je(s,v,c,l,r,i,!1)}return{entries:s,warnings:n}},"inferEntries");var Er=Object.defineProperty,Or=f((e,t)=>Er(e,"name",{value:t,configurable:!0}),"o$2");const Sr=Or((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 Pr=Object.defineProperty,Dr=f((e,t)=>Pr(e,"name",{value:t,configurable:!0}),"t$4");const Nr={hooks:{"build:prepare":Dr(function(e){if(e.options.entries.length>0)return;const t=j(e.options.rootDir,e.options.sourceDir);if(!X(t))throw new Error("No 'src' directory found. Please provide entries manually.");const i=Ui(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 n={...e.pkg};n.publishConfig&&(e.logger.info('Using publishConfig found in package.json, to override the default key-value pairs of "'+Object.keys(n.publishConfig).join(", ")+'".'),e.logger.debug(n.publishConfig),n=Sr(n,e.options.declaration));const o=jr(n,i,e);for(const a of o.warnings)D(e,a);if(e.options.entries.push(...o.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?q(a.fileAlias)+" => "+q(a.input.replace(`${e.options.rootDir}/`,"").replace(/\/$/,"/*")):q(a.input.replace(`${e.options.rootDir}/`,"").replace(/\/$/,"/*"))).join(", ")),Q([e.options.emitESM&&"esm",e.options.emitCJS&&"cjs",e.options.declaration&&"dts"].filter(Boolean).map(a=>`[${a}]`).join(" ")))},"build:prepare")}};var Cr=Object.defineProperty,_r=f((e,t)=>Cr(e,"name",{value:t,configurable:!0}),"t$3");const Mr=_r(async(e,t)=>{if(e==="auto")e=Nr;else{if(e==="none")return{};typeof e=="string"&&(e=await t.import(e)||{})}return typeof e=="function"&&(e=e()),e},"resolvePreset");var zr=Object.defineProperty,Ir=f((e,t)=>zr(e,"name",{value:t,configurable:!0}),"j");const Fr=Ir(async e=>{const t=e.options.jiti.transformOptions?.babel?.plugins,i=[],n=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((o,a)=>{if(Array.isArray(o)){const[s,...r]=o;return i.push(s),"["+["plugin"+a,...r.map(p=>JSON.stringify(p))].join(", ")+"]"}return i.push(o),"plugin"+a}).join(",")+"]":"[]");for(const o of e.options.entries){const a=N(e.options.rootDir,e.options.outDir,o.name),s=On(e.jiti.esmResolve(o.input,{try:!0})??o.input),r=s.replace(ie,""),p=it(s),l=Za(p);let c=[];try{c=await Sn(s,{extensions:Fe})}catch(d){D(e,`Cannot analyze ${s} for exports: ${d.toString()}`);return}const m=c.includes("default")||c.length===0;if(e.options.emitESM){const d=I(z(a),await xt("jiti",{conditions:["node","import"],url:import.meta.url})),u=r+".d.mts";se(`${a}.mjs`,l+['import { createJiti } from "'+d+'";',...i.map((g,v)=>"import plugin"+v+' from "'+g+'";'),"","const jiti = createJiti(import.meta.url, "+n+");","",'/** @type {import("'+u+'")} */','const _module = await jiti.import("'+s+'");',m?`
|
|
83
|
+
`),n},"showSizeInformation"),fr=Ce((e,t)=>{const i=lr(e.options.entries,"environment","runtime"),n=new Set,o=new Set;for(const[a,s]of Object.entries(i))for(const[r,p]of Object.entries(s)){const l={...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={};l.options.rollup.replace?(l.options.rollup.replace.values===void 0&&(l.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 m="";a!=="undefined"&&(m+=a+"/"),r!=="undefined"&&(m+=r+"/");let d=!1;l.options.minify!==void 0&&(d=l.options.minify),a==="development"?d=!1:a==="production"&&(d=!0);const u=[],g=[],v=[],$=[];for(const h of p)h.cjs&&h.esm?u.push(h):h.cjs?v.push(h):h.esm?g.push(h):h.declaration&&$.push(h);if(u.length>0){const h={...l,options:{...l.options,emitCJS:!0,emitESM:!0,entries:u,minify:d,rollup:{...l.options.rollup,replace:l.options.rollup.replace?{...l.options.rollup.replace,values:{...l.options.rollup.replace.values,...c}}:!1}}};if(e.options.dtsOnly||n.add({context:h,fileCache:t,subDirectory:m}),e.options.declaration){const b=h.options.entries.filter(w=>w.declaration);b.length>0&&o.add({context:{...h,options:{...h.options,entries:b}},fileCache:t,subDirectory:m})}}if(g.length>0){const h={...l,options:{...l.options,emitCJS:!1,emitESM:!0,entries:g,minify:d,rollup:{...l.options.rollup,replace:l.options.rollup.replace?{...l.options.rollup.replace,values:{...l.options.rollup.replace.values,...c}}:!1}}};if(e.options.dtsOnly||n.add({context:h,fileCache:t,subDirectory:m}),e.options.declaration){const b=h.options.entries.filter(w=>w.declaration);b.length>0&&o.add({context:{...h,options:{...h.options,entries:b}},fileCache:t,subDirectory:m})}}if(v.length>0){const h={...l,options:{...l.options,emitCJS:!0,emitESM:!1,entries:v,minify:d,rollup:{...l.options.rollup,replace:l.options.rollup.replace?{...l.options.rollup.replace,values:{...l.options.rollup.replace.values,...c}}:!1}}};if(e.options.dtsOnly||n.add({context:h,fileCache:t,subDirectory:m}),e.options.declaration){const b=h.options.entries.filter(w=>w.declaration);b.length>0&&o.add({context:{...h,options:{...h.options,entries:b}},fileCache:t,subDirectory:m})}}l.options.declaration&&$.length>0&&o.add({context:{...l,options:{...l.options,emitCJS:!1,emitESM:!1,entries:$,minify:d,rollup:{...l.options.rollup,replace:l.options.rollup.replace?{...l.options.rollup.replace,values:{...l.options.rollup.replace.values,...c}}:!1}}},fileCache:t,subDirectory:m})}return{builders:n,typeBuilders:o}},"prepareRollupConfig"),gr=Ce(async(e,t)=>{await e.hooks.callHook("build:before",e);const{builders:i,typeBuilders:n}=fr(e,t);await Promise.all([...i].map(async({context:o,fileCache:a,subDirectory:s})=>await er(o,a,s))),await Promise.all([...n].map(async({context:o,fileCache:a,subDirectory:s})=>await ir(o,a,s))),e.logger.success(Ai(e.options.name?"Build succeeded for "+e.options.name:"Build succeeded")),e.buildEntries=e.buildEntries.filter((o,a,s)=>s.findIndex(r=>r.path===o.path)===a);for await(const o of qi(j(e.options.rootDir,e.options.outDir),{includeDirs:!1,includeFiles:!0})){const a=j(e.options.rootDir,e.options.outDir);let s=e.buildEntries.find(p=>j(a,p.path)===o.path);s||(s={chunk:!0,path:o.path},e.buildEntries.push(s)),s.size===void 0&&(s.size={});const r=N(a,o.path);if(!s.size.bytes){const p=await nt(r);s.size.bytes=p.size}s.size.brotli||(s.size.brotli=await ar(r)),s.size.gzip||(s.size.gzip=await dr(r))}return await e.hooks.callHook("build:done",e),mr(e.logger,e)},"build");var vr=Object.defineProperty,hr=f((e,t)=>vr(e,"name",{value:t,configurable:!0}),"r$4");const D=hr((e,t)=>{e.warnings.has(t)||e.warnings.add(t)},"warn");var xr=Object.defineProperty,Si=f((e,t)=>xr(e,"name",{value:t,configurable:!0}),"t$5");const _e=Si(e=>{if(e.endsWith(".mjs")||e.endsWith(".d.mts"))return"esm";if(e.endsWith(".cjs")||e.endsWith(".d.cts"))return"cjs"},"inferExportTypeFromFileName"),tt=Si((e,t,i,n)=>{if(e==="module-sync")return"esm";if(n){const s=_e(n);if(s)return s}if(e==="module"||e==="import")return"esm";if(e==="require")return"cjs";if(t.length===0)return i;const[o,...a]=t;return tt(o,a,i,n)},"inferExportType");var yr=Object.defineProperty,br=f((e,t)=>yr(e,"name",{value:t,configurable:!0}),"y$3");const wr=new Set(["electron","import","require","node","node-addons","default","types","deno","browser","module-sync","bun","workerd",...ii,...De]),pt=br((e,t,i,n=[])=>{if(!e)return[];if(typeof e=="string"){const o=_e(e);if(o&&o!==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:o??t}]}if(typeof e=="object"){const o=Object.entries(e).filter(([s])=>!s.endsWith(".json"));let a=[];for(const[s,r]of o)if(typeof r=="string"){let p={};Number.isInteger(+s)?p={exportKey:"*"}:s.startsWith("./")?p={exportKey:s.replace("./","")}:p={exportKey:s==="."?".":"*",subKey:s},a.push({...p,file:r,key:"exports",type:tt(s,n,t,r)})}else if(typeof r=="object"&&r!==null)for(const[p,l]of Object.entries(r)){if(i===!1&&p==="types")continue;const c=Number.isInteger(+s)?p:s;typeof l=="string"?a.push({exportKey:c.replace("./",""),file:l,key:"exports",...wr.has(p)?{subKey:p}:{},type:tt(p,n,t,l)}):a=[...a,...pt({[c]:l},t,i,[...n,p])]}return a}return[]},"extractExportFilenames");var kr=Object.defineProperty,Je=f((e,t)=>kr(e,"name",{value:t,configurable:!0}),"c$6");const $r=Je((e,t)=>e.key==="exports"&&e.subKey===ge?ge:e.key==="exports"&&e.subKey===yt?yt:t,"getEnvironment"),je=Je((e,t,i,n,o,a,s)=>{const r=$r(o,a.environment);let p=a.options.runtime;for(const m of ii)if(o.file.includes("."+m+".")||o.subKey===m){p=m;break}let l=e.find(m=>m.input===t&&m.environment===r&&m.runtime===p);l===void 0?l=e[e.push({environment:r,exportKey:new Set([o.exportKey].filter(Boolean)),input:t,runtime:p})-1]:l.exportKey&&o.exportKey&&l.exportKey.add(o.exportKey),s&&(l.isGlob=!0),i&&(l.outDir=n),o.isExecutable?(l.executable=!0,l.declaration=!1,o.type==="cjs"?l.cjs=!0:o.type==="esm"&&(l.esm=!0)):(/\.d\.[mc]?ts$/.test(o.file)&&a.options.declaration!==!1&&(l.declaration=a.options.declaration),o.type==="cjs"?l.cjs=!0:o.type==="esm"&&(l.esm=!0));const c=o.file.replace(he(o.file),"").replace(new RegExp(`^./${a.options.outDir.replace(/^\.\//,"")}/`),"");De.has(o.subKey)&&!t.includes(c)&&(l.fileAlias=c)},"createOrUpdateEntry");let Rt=!1;const Jt=Je(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"),jr=Je((e,t,i)=>{const n=[];t.sort((r,p)=>r.split("/").length-p.split("/").length);const o=e.type==="module"?"esm":"cjs";o==="esm"&&(i.options.emitESM=!0),o==="cjs"&&(i.options.emitCJS=!0);const a=pt(e.exports,o,i.options.declaration);if(e.bin){const r=(typeof e.bin=="string"?[e.bin]:Object.values(e.bin)).filter(Boolean);for(const p of r){const l=_e(p);if(l&&l!==o)throw new Error(`Exported file "${p}" has an extension that does not match the package.json type "${e.type??"commonjs"}".`);a.push({file:p,isExecutable:!0,key:"bin",type:l??o})}}e.main&&a.push({file:e.main,key:"main",type:_e(e.main)??o}),e.module&&a.push({file:e.module,key:"module",type:"esm"}),(e.types||e.typings)&&(Jt(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 p=he(r.file);if(p!==""&&!Fe.includes(p))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 l=r.file.replace(/(?:\*[^/\\]|\.d\.[mc]?ts|\.\w+)$/,""),c=l.endsWith("/");if(c&&["./","/"].includes(l))continue;const m=l.replace(new RegExp("(./)?"+i.options.outDir),i.options.sourceDir).replace("./",""),d="(?<=/|$)",u=c?"":"(\\.[cm]?[tj]sx?)$";if(r.file.includes("/*")&&r.key==="exports"){Rt||(i.logger.debug("Private subfolders are not supported, if you need this feature please open an issue on GitHub."),Rt=!0);const h=[],b=new RegExp(d+m.replace("*","(.*)")+u),w=new RegExp(d+m.replace(/(.*)\.[^.]*$/,"$1").replace("*","(.*)")+u);for(const y of t)(b.test(y)||De.has(r.subKey)&&w.test(y))&&h.push(y);if(h.length===0){n.push(`Could not find entrypoint for \`${r.file}\``);continue}for(const y of h)je(s,y,c,l,r,i,!0);continue}const g=new RegExp(d+m+u);let v=t.find(h=>g.test(h));if(De.has(r.subKey)&&v===void 0){const h=new RegExp(d+m.replace(/(.*)\.[^.]*$/,"$1")+u);v=t.find(b=>h.test(b))}if(v===void 0){X(N(i.options.rootDir,r.file))||n.push(`Could not find entrypoint for \`${r.file}\``);continue}(v.endsWith(".ts")||v.endsWith(".cts")||v.endsWith(".mts"))&&X(v)&&Jt(i);const $=Oe(v.replace(ie,""));X($+".cts")&&X($+".mts")?(je(s,$+".cts",c,l,{...r,type:"cjs"},i,!1),je(s,$+".mts",c,l,{...r,type:"esm"},i,!1)):je(s,v,c,l,r,i,!1)}return{entries:s,warnings:n}},"inferEntries");var Er=Object.defineProperty,Sr=f((e,t)=>Er(e,"name",{value:t,configurable:!0}),"o$2");const Or=Sr((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 Pr=Object.defineProperty,Dr=f((e,t)=>Pr(e,"name",{value:t,configurable:!0}),"t$4");const Nr={hooks:{"build:prepare":Dr(function(e){if(e.options.entries.length>0)return;const t=j(e.options.rootDir,e.options.sourceDir);if(!X(t))throw new Error("No 'src' directory found. Please provide entries manually.");const i=Ui(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 n={...e.pkg};n.publishConfig&&(e.logger.info('Using publishConfig found in package.json, to override the default key-value pairs of "'+Object.keys(n.publishConfig).join(", ")+'".'),e.logger.debug(n.publishConfig),n=Or(n,e.options.declaration));const o=jr(n,i,e);for(const a of o.warnings)D(e,a);if(e.options.entries.push(...o.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?q(a.fileAlias)+" => "+q(a.input.replace(`${e.options.rootDir}/`,"").replace(/\/$/,"/*")):q(a.input.replace(`${e.options.rootDir}/`,"").replace(/\/$/,"/*"))).join(", ")),Q([e.options.emitESM&&"esm",e.options.emitCJS&&"cjs",e.options.declaration&&"dts"].filter(Boolean).map(a=>`[${a}]`).join(" ")))},"build:prepare")}};var Cr=Object.defineProperty,_r=f((e,t)=>Cr(e,"name",{value:t,configurable:!0}),"t$3");const Mr=_r(async(e,t)=>{if(e==="auto")e=Nr;else{if(e==="none")return{};typeof e=="string"&&(e=await t.import(e)||{})}return typeof e=="function"&&(e=e()),e},"resolvePreset");var zr=Object.defineProperty,Ir=f((e,t)=>zr(e,"name",{value:t,configurable:!0}),"j");const Fr=Ir(async e=>{const t=e.options.jiti.transformOptions?.babel?.plugins,i=[],n=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((o,a)=>{if(Array.isArray(o)){const[s,...r]=o;return i.push(s),"["+["plugin"+a,...r.map(p=>JSON.stringify(p))].join(", ")+"]"}return i.push(o),"plugin"+a}).join(",")+"]":"[]");for(const o of e.options.entries){const a=N(e.options.rootDir,e.options.outDir,o.name),s=Sn(e.jiti.esmResolve(o.input,{try:!0})??o.input),r=s.replace(ie,""),p=it(s),l=Za(p);let c=[];try{c=await On(s,{extensions:Fe})}catch(d){D(e,`Cannot analyze ${s} for exports: ${d.toString()}`);return}const m=c.includes("default")||c.length===0;if(e.options.emitESM){const d=I(z(a),await xt("jiti",{conditions:["node","import"],url:import.meta.url})),u=r+".d.mts";se(`${a}.mjs`,l+['import { createJiti } from "'+d+'";',...i.map((g,v)=>"import plugin"+v+' from "'+g+'";'),"","const jiti = createJiti(import.meta.url, "+n+");","",'/** @type {import("'+u+'")} */','const _module = await jiti.import("'+s+'");',m?`
|
|
84
84
|
export default _module?.default ?? _module;`:"",...c.filter(g=>g!=="default").map(g=>`export const ${g} = _module.${g};`)].join(`
|
|
85
85
|
`)),e.options.declaration&&se(`${a}.d.mts`,'export * from "'+u+`";
|
|
86
86
|
`+(m?'export { default } from "'+u+'";':""))}if(e.options.emitCJS){const d=I(z(a),await xt("jiti",{conditions:["node","require"],url:import.meta.url})),u=r+".d.cts";se(`${a}.cjs`,l+['const { createJiti } = require("'+d+'");',...i.map((g,v)=>"const plugin"+v+" = require("+JSON.stringify(g)+")"),"","const jiti = createJiti(__filename, "+n+");","",'/** @type {import("'+u+'")} */','module.exports = jiti("'+s+'")'].join(`
|
|
87
87
|
`)),e.options.declaration&&se(a+".d.cts",'export * from "'+u+`";
|
|
88
|
-
`+(m?'export { default } from "'+u+'";':""))}l&&(await et(`${a}.cjs`),await et(`${a}.mjs`))}await e.hooks.callHook("rollup:done",e)},"createStub");var Tr=Object.defineProperty,ct=f((e,t)=>Tr(e,"name",{value:t,configurable:!0}),"i$2");const Ar=ct(e=>{const{message:t,name:i="Error",stack:n}=e;if(!n)return
|
|
88
|
+
`+(m?'export { default } from "'+u+'";':""))}l&&(await et(`${a}.cjs`),await et(`${a}.mjs`))}await e.hooks.callHook("rollup:done",e)},"createStub");var Tr=Object.defineProperty,ct=f((e,t)=>Tr(e,"name",{value:t,configurable:!0}),"i$2");const Ar=ct(e=>{const{message:t,name:i="Error",stack:n}=e;if(!n)return;const o=`${i}: ${t}
|
|
89
89
|
`;return n.startsWith(o)?n.slice(o.length):n},"extractStack"),Rr=ct(e=>`
|
|
90
90
|
${e.replaceAll(/^\n|\n$/g,"")}
|
|
91
|
-
`,"normalizeCodeFrame"),
|
|
91
|
+
`,"normalizeCodeFrame"),Oi=ct(e=>{const t=Ar(e);let i=(e.plugin?`[${e.plugin}] `:"")+e.message;e.id&&(i+=`
|
|
92
92
|
file: ${P(e.id+(e.loc?":"+e.loc.line+":"+e.loc.column:""))}`),e.frame&&(i+=`
|
|
93
93
|
`+Ri(Rr(e.frame))),e.message=i,t!==void 0&&(e.stack=`${e.message}
|
|
94
94
|
${t}`)},"enhanceRollupError");var Jr=Object.defineProperty,Pi=f((e,t)=>Jr(e,"name",{value:t,configurable:!0}),"d$4");const Me="rollup-watch.json",Bt=Pi(({context:e,doOnSuccessCleanup:t,fileCache:i,mode:n,runBuilder:o,runOnsuccess:a,useCache:s,watcher:r})=>{const p="watcher:"+n;r.on("change",async(l,{event:c})=>{await t?.(),e.logger.info({message:`${P(I(".",l))} was ${c}d`,prefix:p})}),r.on("restart",()=>{e.logger.info({message:"Rebuilding ...",prefix:p})}),r.on("event",async l=>{switch(l.code){case"END":{e.logger.success({message:"Rebuild finished",prefix:p}),await a?.();break}case"BUNDLE_START":{e.logger.info({message:P("build started..."),prefix:p});break}case"BUNDLE_END":{await l.result.close(),s&&i.set(n==="bundle"?Me:"dts-"+Me,l.result.cache),e.logger.raw(`
|
|
95
95
|
⚡️ Build run in `+l.duration+`ms
|
|
96
96
|
|
|
97
|
-
`),await o?.(!0);break}case"ERROR":{
|
|
98
|
-
└─ ${I(process.cwd(),c)}`);if(e.logger.info(l),Bt({context:e,doOnSuccessCleanup:o,fileCache:t,mode:"bundle",runBuilder:i,runOnsuccess:n,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 Ei(e,t);s&&(c.cache=t.get("dts-"+Me)),await e.hooks.callHook("rollup:dts:options",e,c);const m=ft(c);await e.hooks.callHook("rollup:watch",e,m),Bt({context:e,fileCache:t,mode:"types",useCache:s,watcher:m})}},"watch");var Wr=Object.defineProperty,Lr=f((e,t)=>Wr(e,"name",{value:t,configurable:!0}),"s$5");const qr=Lr(async e=>{const t=[];if(e.options.clean)for(const i of new Set(e.options.entries.map(n=>n.outDir).filter(Boolean).sort()))i===e.options.rootDir||i===e.options.sourceDir||e.options.rootDir.startsWith(i.endsWith("/")?i:`${i}/`)||t.some(n=>i.startsWith(n))||(t.push(i),e.logger.info(`Cleaning dist directory: \`./${I(e.options.rootDir,i)}\``),await Ki(i))},"cleanDistributionDirectories");var Ur=Object.defineProperty,Di=f((e,t)=>Ur(e,"name",{value:t,configurable:!0}),"s$4");const Kr=Di(e=>{try{JSON.parse(e)}catch{return!1}return!0},"isJson");let Vr=class{static{f(this,"g")}static{Di(this,"FileCache")}#n;#e;#o;#t=!0;#i=new Map;constructor(t,i,n,o){this.#n=t,this.#o=n,i===void 0?o.debug({message:"Could not create cache directory.",prefix:"file-cache"}):(this.#e=i,o.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:X(this.getFilePath(t,i))}get(t,i){if(!this.#t||this.#e===void 0)return;const n=this.getFilePath(t,i);if(this.#i.has(n))return this.#i.get(n);if(!X(n))return;const o=it(n);if(Kr(o)){const a=JSON.parse(o);return this.#i.set(n,a),a}return this.#i.set(n,o),o}set(t,i,n){if(!this.#t||this.#e===void 0||i===void 0)return;const o=this.getFilePath(t,n);(typeof i=="object"||typeof i=="number"||typeof i=="boolean")&&(i=JSON.stringify(i)),se(o,i,{overwrite:!0})}getFilePath(t,i){let n=t.replaceAll(
|
|
97
|
+
`),await o?.(!0);break}case"ERROR":{Oi(l.error),e.logger.error({context:[l.error],message:"Rebuild failed: "+l.error.message,prefix:p});break}}})},"watchHandler"),Br=Pi(async(e,t,i,n,o)=>{const a=await ji(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(Me)),e.options.rollup.watch&&typeof a.watch=="object"&&a.watch.include===void 0&&(a.watch={...a.watch,...e.options.rollup.watch},a.watch.include=[j(e.options.sourceDir,"**","*"),"package.json","packem.config.*","tsconfig.json","tsconfig.*.json"],Array.isArray(e.options.rollup.watch.include)?a.watch.include=[...a.watch.include,...e.options.rollup.watch.include]:e.options.rollup.watch.include&&a.watch.include.push(e.options.rollup.watch.include),a.watch.chokidar={cwd:e.options.rootDir,...a.watch.chokidar,ignored:["**/.git/**","**/node_modules/**","**/test-results/**",...a.watch.chokidar?.ignored??[]]});const r=ft(a);await e.hooks.callHook("rollup:watch",e,r);const p=[...Array.isArray(a.input)?a.input:typeof a.input=="string"?[a.input]:Object.keys(a.input??{})];let l="Starting watcher for entries:";for(const c of p)l+=Q(`
|
|
98
|
+
└─ ${I(process.cwd(),c)}`);if(e.logger.info(l),Bt({context:e,doOnSuccessCleanup:o,fileCache:t,mode:"bundle",runBuilder:i,runOnsuccess:n,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 Ei(e,t);s&&(c.cache=t.get("dts-"+Me)),await e.hooks.callHook("rollup:dts:options",e,c);const m=ft(c);await e.hooks.callHook("rollup:watch",e,m),Bt({context:e,fileCache:t,mode:"types",useCache:s,watcher:m})}},"watch");var Wr=Object.defineProperty,Lr=f((e,t)=>Wr(e,"name",{value:t,configurable:!0}),"s$5");const qr=Lr(async e=>{const t=[];if(e.options.clean)for(const i of new Set(e.options.entries.map(n=>n.outDir).filter(Boolean).sort()))i===e.options.rootDir||i===e.options.sourceDir||e.options.rootDir.startsWith(i.endsWith("/")?i:`${i}/`)||t.some(n=>i.startsWith(n))||(t.push(i),e.logger.info(`Cleaning dist directory: \`./${I(e.options.rootDir,i)}\``),await Ki(i))},"cleanDistributionDirectories");var Ur=Object.defineProperty,Di=f((e,t)=>Ur(e,"name",{value:t,configurable:!0}),"s$4");const Kr=Di(e=>{try{JSON.parse(e)}catch{return!1}return!0},"isJson");let Vr=class{static{f(this,"g")}static{Di(this,"FileCache")}#n;#e;#o;#t=!0;#i=new Map;constructor(t,i,n,o){this.#n=t,this.#o=n,i===void 0?o.debug({message:"Could not create cache directory.",prefix:"file-cache"}):(this.#e=i,o.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:X(this.getFilePath(t,i))}get(t,i){if(!this.#t||this.#e===void 0)return;const n=this.getFilePath(t,i);if(this.#i.has(n))return this.#i.get(n);if(!X(n))return;const o=it(n);if(Kr(o)){const a=JSON.parse(o);return this.#i.set(n,a),a}return this.#i.set(n,o),o}set(t,i,n){if(!this.#t||this.#e===void 0||i===void 0)return;const o=this.getFilePath(t,n);(typeof i=="object"||typeof i=="number"||typeof i=="boolean")&&(i=JSON.stringify(i)),se(o,i,{overwrite:!0})}getFilePath(t,i){let n=t.replaceAll(Oe(this.#n),"");return n=n.replaceAll(":","-"),j(this.#e,this.#o,i?.replaceAll(":","-")??"",Oe(n))}};var Hr=Object.defineProperty,Gr=f((e,t)=>Hr(e,"name",{value:t,configurable:!0}),"t$2");const Xr=Gr(async(e,t="")=>{let i=t;if(!i){const n=["packem.config.js","packem.config.mjs","packem.config.cjs","packem.config.ts","packem.config.cts","packem.config.mts"];for(const o of n)if(await ze(j(e,o))){i="./"+o;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 Yr=Object.defineProperty,Ee=f((e,t)=>Yr(e,"name",{value:t,configurable:!0}),"l$5");const Qr=K,Zr=Ee((e,t)=>{const{sideEffects:i}=t;let n;if(typeof i=="boolean")n=Ee(()=>i,"hasSideEffects");else if(Array.isArray(i))if(i.length<=0)n=Ee(()=>!1,"hasSideEffects");else{const o=i.map(a=>a.includes("/")?a:`**/${a}`);n=Qr(o,null,{resolve:e})}else n=Ee(()=>null,"hasSideEffects");return n},"getPackageSideEffect");var He,Wt;function el(){if(Wt)return He;Wt=1;var e=Object.defineProperty,t=f((p,l)=>e(p,"name",{value:l,configurable:!0}),"s"),i=Hn,n=i.spawn,o=i.exec;He=f(function(p,l,c){if(typeof l=="function"&&c===void 0&&(c=l,l=void 0),p=parseInt(p),Number.isNaN(p)){if(c)return c(new Error("pid must be a number"));throw new Error("pid must be a number")}var m={},d={};switch(m[p]=[],d[p]=1,process.platform){case"win32":o("taskkill /pid "+p+" /T /F",c);break;case"darwin":r(p,m,d,function(u){return n("pgrep",["-P",u])},function(){a(m,l,c)});break;default:r(p,m,d,function(u){return n("ps",["-o","pid","--no-headers","--ppid",u])},function(){a(m,l,c)});break}},"treeKill");function a(p,l,c){var m={};try{Object.keys(p).forEach(function(d){p[d].forEach(function(u){m[u]||(s(u,l),m[u]=1)}),m[d]||(s(d,l),m[d]=1)})}catch(d){if(c)return c(d);throw d}if(c)return c()}f(a,"killAll"),t(a,"killAll");function s(p,l){try{process.kill(parseInt(p,10),l)}catch(c){if(c.code!=="ESRCH")throw c}}f(s,"killPid"),t(s,"killPid");function r(p,l,c,m,d){var u=m(p),g="";u.stdout.on("data",function(h){var h=h.toString("ascii");g+=h});var v=t(function($){if(delete c[p],$!=0){Object.keys(c).length==0&&d();return}g.match(/\d+/g).forEach(function(h){h=parseInt(h,10),l[p].push(h),l[h]=[],c[h]=1,r(h,l,c,m,d)})},"onClose");u.on("close",v)}return f(r,"buildProcessTree"),t(r,"buildProcessTree"),He}f(el,"requireTreeKill");var tl=el();const il=yn(tl);var nl=Object.defineProperty,Ni=f((e,t)=>nl(e,"name",{value:t,configurable:!0}),"l$4");const ol=Ni(e=>process.platform==="win32"&&"cmd"in e&&"code"in e&&typeof e.cmd=="string"&&e.cmd.startsWith("taskkill")&&e.code===128,"isTaskKillCmdProcessNotFoundError"),al=Ni(async({pid:e,signal:t})=>await new Promise((i,n)=>{if(!Number.isInteger(e)||e<=0){n(new Error("Invalid process ID"));return}il(e,t,o=>{if(o&&!ol(o)){n(o);return}i()})}),"killProcess");var sl=Object.defineProperty,rl=f((e,t)=>sl(e,"name",{value:t,configurable:!0}),"n$1");const Ci=rl(e=>{const t=j(e,"package.json");if(!X(t))throw new Error("package.json not found at "+t);return{packageJson:Fn(t),packageJsonPath:t}},"loadPackageJson");var ll=Object.defineProperty,pl=f((e,t)=>ll(e,"name",{value:t,configurable:!0}),"r$2");const Lt=pl((e,t)=>{if(e.warnings.size>0&&(t&&e.logger.raw(`
|
|
99
99
|
`),e.logger.warn(`Build is done with some warnings:
|
|
100
100
|
|
|
101
101
|
${[...e.warnings].map(i=>`- ${i}`).join(`
|
|
102
102
|
`)}`),e.options.failOnWarn))throw new Error("Exiting with code (1). You can change this behavior by setting `failOnWarn: false`.")},"logBuildErrors");var cl=Object.defineProperty,_i=f((e,t)=>cl(e,"name",{value:t,configurable:!0}),"r$1");const qt=_i(async(e,t)=>{if(typeof e.name!="string"){let i=Ie(e.input)?I(t.options.rootDir,e.input):G(e.input);i.startsWith("./")&&(i=i.slice(2)),e.name=i.replace(new RegExp(`^${t.options.sourceDir}/`),"").replace(ie,"")}if(!e.input)throw new Error(`Missing entry input: ${JSON.stringify(e)}`);ot(e.input)&&(e.input=N(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=N(t.options.rootDir,e.outDir??t.options.outDir)},"extendEntry"),dl=_i(async e=>{e.options.entries=e.options.entries.map(t=>typeof t=="string"?{input:t,isGlob:gt(t)}:{...t,exportKey:t.exportKey??new Set,isGlob:gt(t.input)});for(const t of e.options.entries.filter(i=>i.isGlob)){const{isGlob:i,...n}=t,o=["**/.git/**","**/node_modules/**","**/test-results/**"];if(e.options.rollup.watch){if(typeof e.options.rollup.watch.exclude=="string")o.push(e.options.rollup.watch.exclude);else if(Array.isArray(e.options.rollup.watch.exclude))for(const s of e.options.rollup.watch.exclude)typeof s=="string"&&o.push(s)}const a=vn([n.input],{cwd:e.options.rootDir,dot:!1,ignore:o,onlyFiles:!0});if(a.length===0)throw new Gn("No files found in the glob pattern: "+P(j(e.options.rootDir,n.input)));for(const s of a)e.options.entries.push({...n,input:N(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 qt(t,e);for(const t of e.options.entries.filter(i=>i.fileAlias!==void 0))t.name=t.fileAlias,t.fileAlias=void 0,await qt(t,e)},"prepareEntries");var ul=Object.defineProperty,ml=f((e,t)=>ul(e,"name",{value:t,configurable:!0}),"a$4");const fl=ml(async(e,t,i)=>{if(e&&await ze(j(e,"keystore.json"))){const n=await Vt(j(e,"keystore.json"));let o=await on(e,{withFileTypes:!0});o=o.filter(s=>s.isDirectory());let a=i;for(const s of o)if(!n[s.name]){try{await an(j(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(`
|
|
103
103
|
|
|
104
|
-
`),t.info({message:"Removing "+s.name+" file cache, the cache key is not used anymore.",prefix:"file-cache"}),a=!1}}},"removeOldCacheFolders");var gl=Object.defineProperty,vl=f((e,t)=>gl(e,"name",{value:t,configurable:!0}),"a$3");const hl=vl((e,t)=>e.some(i=>i instanceof RegExp?i.test(t):i===t),"arrayIncludes");var xl=Object.defineProperty,yl=f((e,t)=>xl(e,"name",{value:t,configurable:!0}),"a$2");const bl=yl((e="")=>{const t=e.split("/");return t[0].startsWith("@")?t[0]+"/"+t[1]:t[0]},"getPackageName");var wl=Object.defineProperty,kl=f((e,t)=>wl(e,"name",{value:t,configurable:!0}),"p");const $l=kl(e=>{if(e.options.validation.packageJson?.dependencies===!1)return;const t=new Set,i=new Set(Object.keys(e.pkg?.dependencies??{})),n=new Set;for(const o of e.usedImports)i.delete(o),t.add(o);if(e.pkg?.dependencies)for(const o of Object.keys(e.pkg?.dependencies))i.delete(o);for(const o of t){const a=bl(o);!hl(e.options.externals,o)&&!o.startsWith("chunks/")&&![...bt.builtinModules,...bt.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&&n.add(o)}i.size>0&&D(e,`Potential unused dependencies found: ${[...i].map(o=>P(o)).join(", ")}`),n.size>0&&D(e,`Potential implicit dependencies found: ${[...n].map(o=>P(o)).join(", ")}`)},"validateDependencies");var jl=Object.defineProperty,Mi=f((e,t)=>jl(e,"name",{value:t,configurable:!0}),"i$1");const El=Mi((e,t)=>Xn(e,t)<=e.length/3||t.includes(e),"isSimilar"),
|
|
104
|
+
`),t.info({message:"Removing "+s.name+" file cache, the cache key is not used anymore.",prefix:"file-cache"}),a=!1}}},"removeOldCacheFolders");var gl=Object.defineProperty,vl=f((e,t)=>gl(e,"name",{value:t,configurable:!0}),"a$3");const hl=vl((e,t)=>e.some(i=>i instanceof RegExp?i.test(t):i===t),"arrayIncludes");var xl=Object.defineProperty,yl=f((e,t)=>xl(e,"name",{value:t,configurable:!0}),"a$2");const bl=yl((e="")=>{const t=e.split("/");return t[0].startsWith("@")?t[0]+"/"+t[1]:t[0]},"getPackageName");var wl=Object.defineProperty,kl=f((e,t)=>wl(e,"name",{value:t,configurable:!0}),"p");const $l=kl(e=>{if(e.options.validation.packageJson?.dependencies===!1)return;const t=new Set,i=new Set(Object.keys(e.pkg?.dependencies??{})),n=new Set;for(const o of e.usedImports)i.delete(o),t.add(o);if(e.pkg?.dependencies)for(const o of Object.keys(e.pkg?.dependencies))i.delete(o);for(const o of t){const a=bl(o);!hl(e.options.externals,o)&&!o.startsWith("chunks/")&&![...bt.builtinModules,...bt.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&&n.add(o)}i.size>0&&D(e,`Potential unused dependencies found: ${[...i].map(o=>P(o)).join(", ")}`),n.size>0&&D(e,`Potential implicit dependencies found: ${[...n].map(o=>P(o)).join(", ")}`)},"validateDependencies");var jl=Object.defineProperty,Mi=f((e,t)=>jl(e,"name",{value:t,configurable:!0}),"i$1");const El=Mi((e,t)=>Xn(e,t)<=e.length/3||t.includes(e),"isSimilar"),Sl=Mi((e,t)=>{const i=e.toLowerCase();return t.filter(n=>El(n.toLowerCase(),i))},"findAlternatives");var Ol=Object.defineProperty,Ut=f((e,t)=>Ol(e,"name",{value:t,configurable:!0}),"t");const Pl=Ut(e=>{const{options:t}=e,i=t.validation;if(i.packageJson?.exports===!1)return;const n=new Set([t.declaration&&i.packageJson?.types?e.pkg.types:"",t.declaration&&i.packageJson?.types?e.pkg.typings:"",...t.dtsOnly||i.packageJson?.bin===!1?[""]:typeof e.pkg.bin=="string"?[e.pkg.bin]:Object.values(e.pkg.bin??{}),t.dtsOnly&&i.packageJson?.main===!1?"":e.pkg.main,t.dtsOnly&&i.packageJson?.module===!1?"":e.pkg.module,...i.packageJson?.exports?pt(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&&N(t.rootDir,r.replace(/\/[^*/]*\*[^\n\r/\u2028\u2029]*(?:[\n\r\u2028\u2029][^*/]*\*[^\n\r/\u2028\u2029]*)*(?:\/.*)?$/,"")))),o=[];for(const r of n)r&&!r.includes("*")&&!Jn(r)&&o.push(r.replace(`${t.rootDir}/`,""));const a=Ut(r=>I(t.rootDir,N(t.outDir,r)),"rPath"),s=e.buildEntries.filter(r=>!r.chunk).map(r=>a(r.path));if(o.length>0){let r="Potential missing or wrong package.json files:";for(const p of o){const l=Sl(p,s);r+=`
|
|
105
105
|
- `+P(p)+(l.length>0?Ji` (did you mean ${l.map(c=>`"${c}"`).join(", ")}?)`:"")}D(e,r)}},"validatePackageEntries");var Dl=Object.defineProperty,Nl=f((e,t)=>Dl(e,"name",{value:t,configurable:!0}),"l$1");const Cl=Nl(e=>{const t=e.options.validation,{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&&Array.isArray(i.files)&&!i.files.includes("*")&&(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 n=i.type==="commonjs"||i.type===void 0,o=i.type==="module";if(n?(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."))):o&&(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(n?".mjs":".cjs"))D(e,`The 'bin' field in your package.json should not use a ${n?".mjs":".cjs"} extension for ${n?"CommonJS":"ES modules"} binaries.`);else if(typeof i.bin=="object")for(const[a,s]of Object.entries(i.bin))s&&s.includes(n?".mjs":".cjs")&&D(e,`The 'bin.${a}' field in your package.json should not use a ${n?".mjs":".cjs"} extension for ${n?"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 _l=Object.defineProperty,Ml=f((e,t)=>_l(e,"name",{value:t,configurable:!0}),"i");const zl=Ml(e=>{const{packageJson:t}=Ci(e.options.rootDir);e.pkg=t,$l(e),Cl(e),Pl(e)},"validator");var Il=Object.defineProperty,Fl=f((e,t)=>Il(e,"name",{value:t,configurable:!0}),"a");const Tl=/^[^a-z_@#~]|[^\w/@#~-]|@\/|#\/|~\//i,Al=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"]),Kt=Fl(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(Tl.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(Al.has(t))throw new Error(`Alias name "${t}" is a reserved keyword and cannot be used.`);const n=N(i);if(!X(n))throw new Error(`Target path "${n}" for alias "${t}" does not exist.`)}},"validateAliasEntries");var Rl=Object.defineProperty,Jl=f((e,t)=>Rl(e,"name",{value:t,configurable:!0}),"d");const Bl=Jl((e,t)=>{const i=e.options.validation,{allowFail:n=!1,limit:o,limits:a={}}=i.bundleLimit??{};for(const[s,r]of Object.entries(a)){const p=typeof r=="string"?ut(r):r;if(!Number.isFinite(p)||p<=0){e.logger.debug({message:`Invalid limit for ${s}: ${r}`,prefix:"Validation: File Size"});continue}const l=e.buildEntries.find(c=>{const m=s.replace(new RegExp(`^.?/?${e.options.outDir}/?`),"");return c.path.endsWith(m)||Yn(s)(c.path)});if(!l?.size?.bytes){e.logger.debug({message:l?`Entry file has no size information: ${s}.`:`Entry file not found: ${s}, please check your configuration.`,prefix:"Validation: File Size"});continue}if(l.size.bytes>p){const c=`File size exceeds the limit: ${j(e.options.outDir,l.path)} (${A(l.size.bytes)} / ${A(p,{decimals:2})})`;n?(t&&e.logger.raw(`
|
|
106
106
|
`),e.logger.warn({message:c,prefix:"validation:file-size"})):D(e,c)}}if(o){const s=e.buildEntries.reduce((p,l)=>{const c=l.size?.bytes;return p+(typeof c=="number"?c:0)},0),r=typeof o=="string"?ut(o):o;if(!Number.isFinite(r)||r<=0){e.logger.debug({message:`Invalid total limit: ${o}`,prefix:"Validation: File Size"});return}if(s>r){const p=`Total file size exceeds the limit: ${A(s)} / ${A(r,{decimals:2})}`;n?(t&&Object.keys(a).length===0&&e.logger.raw(`
|
|
107
107
|
`),e.logger.warn({message:p,prefix:"validation:file-size"})):D(e,p)}}},"validateBundleSize");var Wl=Object.defineProperty,W=f((e,t)=>Wl(e,"name",{value:t,configurable:!0}),"c");const Ll=W(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"),ql=W((e,t,i,n,o,a,s,r,p,l)=>{const c=Ll(p?.config.compilerOptions?.jsx),m=l.split("."),d=Yi(a,o,s,{alias:{},browserTargets:Xi(),cjsInterop:!1,clean:!0,debug:n,declaration:void 0,emitCJS:void 0,emitESM:void 0,entries:[],externals:[],failOnWarn:!0,fileCache:!0,jiti:{alias:{},debug:n,interopDefault:!0},minify:i===ge,name:(r.name??"").split("/").pop()??"default",outDir:p?.config.compilerOptions?.outDir??"dist",rollup:{alias:{},cjsInterop:{addDefaultProperty:!1},commonjs:{extensions:[".mjs",".js",".json",".node",".cjs"],ignoreTryCatch:!0,preserveSymlinks:!0,transformMixedEsModules:!0},css:{autoModules:!0,extensions:[".css",".pcss",".postcss",".sss"],namedExports:!0},dts:{compilerOptions:{baseUrl:p?.config.compilerOptions?.baseUrl??".",checkJs:!1,composite:!1,declaration:!0,declarationMap:!1,emitDeclarationOnly:!0,incremental:!1,moduleResolution:100,noEmit:!1,noEmitOnError:!0,preserveSymlinks:!1,skipLibCheck:!0,target:99},respectExternal:!0},dynamicVars:{errorWhenNoFilesFound:!0,exclude:pe,include:/\bimport\s*[(/]/},esbuild:{charset:"utf8",jsx:c,jsxDev:p?.config.compilerOptions?.jsx==="react-jsxdev",jsxFactory:p?.config.compilerOptions?.jsxFactory,jsxFragment:p?.config.compilerOptions?.jsxFragmentFactory,jsxImportSource:p?.config.compilerOptions?.jsxImportSource,jsxSideEffects:!0,keepNames:!0,sourcesContent:!1,target:p?.config.compilerOptions?.target,treeShaking:!0,tsconfigRaw:p?.config},experimental:{resolve:{aliasFields:[["browser"]],builtinModules:!1,conditionNames:["default","types","import","require","module-sync","node","node-addons","browser","esm2020","es2020","es2015"],extensionAlias:{".cjs":[".cts",".d.cts",".cjs"],".js":[".ts",".tsx",".d.ts",".js"],".jsx":[".tsx",".d.ts",".jsx"],".mjs":[".mts",".d.mts",".mjs"]},extensions:[".ts",".tsx",".d.ts",".js",".jsx",".json",".node"],mainFields:["types","typings","fesm2020","fesm2015","esm2020","es2020","main","module","browser","jsnext:main"]}},isolatedDeclarations:{exclude:pe,ignoreErrors:!1,include:ce},json:{preferConst:!0},license:{dependenciesTemplate:W((g,v,$)=>`
|
|
@@ -121,10 +121,10 @@ The published ${$} artifact additionally contains code with the following licens
|
|
|
121
121
|
`+v,"dtsTemplate")},node10Compatibility:{},output:{importAttributesKey:Number(m[0])>=22?"with":"assert"},patchTypes:{},polyfillNode:{},preserveDirectives:{include:ce},preserveDynamicImports:!0,raw:{exclude:pe,include:[/\.(md|txt|htm|html|data)$/]},replace:{objectGuards:!0,preventAssignment:!0},resolve:{allowExportsFolderMapping:!1,exportConditions:[i??"production","module-sync"],extensions:Fe,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:pe,include:ce},sourcemap:{},sucrase:{disableESTransforms:!0,enableLegacyBabel5ModuleInterop:!1,enableLegacyTypeScriptModuleInterop:p?.config.compilerOptions?.esModuleInterop===!1,include:ce,injectCreateRequireForImportRequire:!1,preserveDynamicImport:!0,production:i===ge,...p?.config.compilerOptions?.jsx&&["react","react-jsx","react-jsxdev"].includes(p.config.compilerOptions.jsx)?{jsxFragmentPragma:p.config.compilerOptions.jsxFragmentFactory,jsxImportSource:p.config.compilerOptions.jsxImportSource,jsxPragma:p.config.compilerOptions.jsxFactory,jsxRuntime:c,transforms:["typescript","jsx",...p.config.compilerOptions.esModuleInterop?["imports"]:[]]}:{transforms:["typescript",...p?.config.compilerOptions?.esModuleInterop?["imports"]:[]]}},swc:{include:ce,inlineSourcesContent:!1,inputSourceMap:!1,isModule:!0,jsc:{experimental:{keepImportAttributes:!0},externalHelpers:!1,keepClassNames:!0,loose:!0,parser:{decorators:p?.config.compilerOptions?.experimentalDecorators,syntax:p?"typescript":"ecmascript",[p?"tsx":"jsx"]:!0},target:p?.config.compilerOptions?.target?.toLowerCase(),transform:{decoratorMetadata:p?.config.compilerOptions?.emitDecoratorMetadata,decoratorVersion:"2022-03",legacyDecorator:p?.config.compilerOptions?.experimentalDecorators,react:{development:i!==ge,pragma:p?.config.compilerOptions?.jsxFactory,pragmaFrag:p?.config.compilerOptions?.jsxFragmentFactory,runtime:c,throwIfNamespace:!0},treatConstEnumAsEnum:p?.config.compilerOptions?.preserveConstEnums,useDefineForClassFields:p?.config.compilerOptions?.useDefineForClassFields}},module:{ignoreDynamic:!0,importInterop:"none",preserveImportMeta:!0,strict:!1,strictMode:!1,type:"es6"}},treeshake:{moduleSideEffects:Zr(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:pe}},rootDir:t,sourceDir:"src",sourcemap:!1,transformerName:void 0,typedoc:{excludePrivate:!0,format:"inline",githubPages:!1,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:n,tsconfig:p?.path}});d.runtime===void 0&&(e.warn("No runtime specified, defaulting to 'node'. This will change in packem v2 to 'browser', please add 'runtime: node' to your packem config or command call"),d.runtime="node");let u="0.0.0";if(d.transformer?.NAME!==void 0)d.transformerName=d.transformer.NAME;else if(!d.transformerName){const g=new Map([...Object.entries(r.dependencies??{}),...Object.entries(r.devDependencies??{})]);if(g.has("esbuild"))d.transformerName="esbuild",u=g.get("esbuild");else if(g.has("@swc/core"))d.transformerName="swc",u=g.get("@swc/core");else if(g.has("sucrase"))d.transformerName="sucrase",u=g.get("sucrase");else throw new Error("Unknown transformer, check your transformer options or install one of the supported transformers: esbuild, swc, sucrase")}return e.info({message:"Using "+P("node ")+l,prefix:"system"}),e.info({message:"Using "+P("rollup ")+Zi+" with "+P(d.runtime)+" build runtime",prefix:"bundler"}),e.info({message:"Using "+P(d.transformerName)+" "+u,prefix:"transformer"}),d.rollup.resolve&&(d.rollup.resolve.preferBuiltins=d.runtime==="node",d.rollup.resolve.preferBuiltins&&(d.rollup.polyfillNode=!1,e.debug("Disabling polyfillNode because preferBuiltins is set to true"))),d.runtime==="node"&&(d.browserTargets=[]),d.runtime==="browser"&&d.browserTargets&&d.browserTargets.length>0&&e.debug("Using browser targets: "+d.browserTargets.join(", ")),Kt(d.alias),d.rollup.alias&&d.rollup.alias.entries&&Kt(d.rollup.alias.entries),d},"generateOptions"),Ul=W(async(e,t,i,n,o,a,s,r,p,l,c)=>{const m=await Mr(s.preset??a.preset??"auto",l),d=ql(e,t,n,o,a,s,m,r,p,c);Vi(j(d.rootDir,d.outDir));const u={buildEntries:[],dependencyGraphMap:new Map,environment:n,hooks:Qi(),jiti:Gt(d.rootDir,d.jiti),logger:e,mode:i,options:d,pkg:r,tsconfig:p,usedImports:new Set,warnings:new Set};m.hooks&&u.hooks.addHooks(m.hooks),a.hooks&&u.hooks.addHooks(a.hooks),s.hooks&&u.hooks.addHooks(s.hooks),await u.hooks.callHook("build:prepare",u),u.options.emitESM===void 0&&u.logger.info("Emitting of ESM bundles, is disabled."),u.options.emitCJS===void 0&&u.logger.info("Emitting of CJS bundles, is disabled."),u.options.minify&&u.logger.info("Minification is enabled, the output will be minified");const g=Ht(r,["typescript"]);if(u.options.declaration&&u.tsconfig===void 0&&g)throw new Error("Cannot build declaration files without a tsconfig.json");return g?u.options.declaration===!1&&u.logger.info({message:"Generation of declaration files are disabled.",prefix:"dts"}):(u.options.declaration=!1,u.logger.info({message:"Typescript is not installed. Generation of declaration files are disabled.",prefix:"dts"})),u.options.declaration&&u.logger.info("Using typescript version: "+P(r.devDependencies?.typescript??r.dependencies?.typescript??"unknown")),u.options.declaration&&(r.dependencies?.typescript||r.devDependencies?.typescript)&&!u.tsconfig?.config.compilerOptions?.isolatedModules&&u.logger.warn(`'compilerOptions.isolatedModules' is not enabled in tsconfig.
|
|
122
122
|
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.
|
|
123
123
|
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 dl(u),u},"createContext"),Kl=W(e=>{switch(e){case"jit":return"Stubbing";case"watch":return"Watching";case"tsdoc":return"Generating TSDoc";case"build":return"Building";default:throw new Error("Unknown mode: "+e)}},"getMode"),Xp=W(async(e,t,i,n,o={})=>{const{configPath:a,debug:s,tsconfigPath:r,...p}=o,l=we.version.slice(1);n.wrapAll(),e=N(we.cwd(),e),n.debug("Root directory:",e);const{packageJson:c,packageJsonPath:m}=Ci(e);n.debug("Using package.json found at",m);let d;if(r){const h=j(e,r);if(!await ze(h))throw new Error("tsconfig.json not found at "+h);d={config:Hi(h),path:h},n.info("Using tsconfig settings at",h)}else if(Ht(c,["typescript"]))try{d=await Gi(e),n.debug("Using tsconfig settings found at",d.path)}catch{n.info("No tsconfig.json or jsconfig.json found.")}const u=Bi("@visulima/packem",{cwd:e});let g=!1,v,$;try{const h=await Xr(e,a??""),b=Gt(e,{debug:s});let w=await b.import(h,{default:!0,try:!0})||{};typeof w=="function"&&(w=await w(i,t)),n.debug("Using packem config found at",j(e,h));const y=Z(JSON.stringify({version:c.version,...c.dependencies,...c.devDependencies,...c.peerDependencies,...c.peerDependenciesMeta,browser:c.browser,eNode:c.engines?.node,exports:c.exports,main:c.main,module:c.module,nodeVersion:l,type:c.type,types:c.types}))+Z(JSON.stringify(w));u&&zn(y,u,n);const k=new Vr(e,u,y,n),x=await Ul(n,e,t,i,s??!1,p,w,c,d,b,l);k.isEnabled=x.options.fileCache,x.logger.info(P(Kl(t)+" "+x.options.name)),x.logger.debug({context:x.options.entries,message:`${q("Root dir:")} ${x.options.rootDir}
|
|
124
|
-
${q("Entries:")}`}),await qr(x);const
|
|
125
|
-
`),await x.hooks.callHook("builder:before",
|
|
126
|
-
⚡️ `+
|
|
124
|
+
${q("Entries:")}`}),await qr(x);const S=W(async F=>{for await(const[O,M]of Object.entries(x.options.builder??{})){x.logger.raw(`
|
|
125
|
+
`),await x.hooks.callHook("builder:before",O,x);const E=Date.now(),J=W(()=>mt(Math.floor(Date.now()-E)),"getBuilderDuration");await M(x,u,k,g),await x.hooks.callHook("builder:done",O,x),x.logger.raw(`
|
|
126
|
+
⚡️ `+O+" run in "+J()),F&&x.logger.raw(`
|
|
127
127
|
|
|
128
|
-
`)}},"runBuilder"),C=W(async()=>{if(v!==void 0)await al({pid:v.pid,signal:p.killSignal??w.killSignal??"SIGTERM"});else if($!==void 0)try{await $()}catch(F){throw new Error("onSuccess function cleanup failed: "+F.message,{cause:F})}v=void 0,$=void 0},"doOnSuccessCleanup"),_=W(async()=>{if(typeof x.options.onSuccess=="function")try{$=await x.options.onSuccess()}catch(F){throw new Error("onSuccess function failed: "+F.message,{cause:F})}else if(typeof x.options.onSuccess=="string"){const F=x.options.onSuccessTimeout??3e4;if(v=en(x.options.onSuccess,[],{nodeOptions:{shell:!0,stdio:"inherit",timeout:F}}),await v,v.exitCode&&v.exitCode!==0)throw new Error("onSuccess script failed with exit code "+v.exitCode+". Check the output above for details.")}},"runOnsuccess"),V=Date.now(),H=W(()=>mt(Math.floor(Date.now()-V)),"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 Br(x,k,
|
|
129
|
-
⚡️ Build run in `+H()),await
|
|
130
|
-
`),
|
|
128
|
+
`)}},"runBuilder"),C=W(async()=>{if(v!==void 0)await al({pid:v.pid,signal:p.killSignal??w.killSignal??"SIGTERM"});else if($!==void 0)try{await $()}catch(F){throw new Error("onSuccess function cleanup failed: "+F.message,{cause:F})}v=void 0,$=void 0},"doOnSuccessCleanup"),_=W(async()=>{if(typeof x.options.onSuccess=="function")try{$=await x.options.onSuccess()}catch(F){throw new Error("onSuccess function failed: "+F.message,{cause:F})}else if(typeof x.options.onSuccess=="string"){const F=x.options.onSuccessTimeout??3e4;if(v=en(x.options.onSuccess,[],{nodeOptions:{shell:!0,stdio:"inherit",timeout:F}}),await v,v.exitCode&&v.exitCode!==0)throw new Error("onSuccess script failed with exit code "+v.exitCode+". Check the output above for details.")}},"runOnsuccess"),V=Date.now(),H=W(()=>mt(Math.floor(Date.now()-V)),"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 Br(x,k,S,_,C),Lt(x,!1);return}t==="jit"?(await Fr(x),await x.hooks.callHook("build:done",x)):(g=await gr(x,k),await x.hooks.callHook("validate:before",x),x.options.validation!==!1&&(zl(x),Bl(x,g)),await x.hooks.callHook("validate:done",x),Lt(x,g)),x.logger.raw(`
|
|
129
|
+
⚡️ Build run in `+H()),await S(),await _(),we.on("SIGINT",async()=>{await C()}),we.on("SIGTERM",async()=>{await C()})}catch(h){throw n.raw(`
|
|
130
|
+
`),Oi(h),h}finally{n.restoreAll(),await fl(u,n,g)}},"packem");export{Xp as default};
|