unimported-analyzer-webpack-plugin
Version:
A webpack plugin to analyze unimported files
1 lines • 91.9 kB
JavaScript
(()=>{var t={24:t=>{"use strict";t.exports=require("node:fs")},44:(t,e,s)=>{const i=s(24),r=s(760),n=s(708),o=s(220),{minimatch:h}=s(854),{getMergedOptions:a}=s(632);t.exports=class{constructor(t={}){this.validateOptions(t);const e=a(t);this.options=e,this.debugLog("🚀 ~ getMergedOptions ~ mergedOptions:",e)}apply(t){const e=t.hooks||t;(e.done||e.afterEmit).tap("UnimportedAnalyzerWebpackPlugin",(t=>{const e=t.compilation,s=r.resolve(n.cwd(),this.options.src);this.debugLog("🚀 ~ UnimportedAnalyzerWebpackPlugin ~ srcPath:",s);const i=this.getAllFiles(s);this.debugLog("🚀 ~ UnimportedAnalyzerWebpackPlugin ~ allFiles:",i);const o=this.getImportedFiles(e.modules);this.debugLog("🚀 ~ UnimportedAnalyzerWebpackPlugin ~ importedFiles:",o);const h=i.filter((t=>!o.has(t)));this.debugLog("🚀 ~ UnimportedAnalyzerWebpackPlugin ~ unimportedFiles:",h),this.saveResult(h)}))}validateOptions(t){if(!t||"object"!=typeof t)throw new Error("Plugin options should be an object.");if(t.preset&&"string"!=typeof t.preset)throw new Error("Option `preset` should be a string.");if(t.src){if("string"!=typeof t.src)throw new TypeError("Option `src` should be a string.");if(!i.existsSync(t.src))throw new Error(`Option \`src\`: Path "${t.src}" does not exist.`);if(!i.statSync(t.src).isDirectory())throw new Error(`Option \`src\`: Path "${t.src}" should be a directory.`)}if(t.ignores&&!Array.isArray(t.ignores))throw new Error("Option `ignores` should be an array.");if(t.important&&!Array.isArray(t.important))throw new Error("Option `important` should be an array.");if(t.output&&"string"!=typeof t.src)throw new Error("Option `output` should be a string.");if(t.debug&&"boolean"!=typeof t.debug)throw new Error("Option `debug` should be a boolean.")}getAllFiles(t){return o.sync("**/*",{cwd:t,nodir:!0,absolute:!0,dot:!0}).filter((e=>{const s=r.relative(t,e);return this.isImportantFile(s)||!this.isIgnoreFile(s)})).map((t=>this.normalizePath(t)))}isImportantFile(t){const{important:e=[]}=this.options;return e.length>0&&e.some((e=>h(t,e,{dot:!0})))}isIgnoreFile(t){const{ignores:e=[]}=this.options;return e.length>0&&e.some((e=>h(t,e,{dot:!0})))}getImportedFiles(t){const e=new Set;return t.forEach((t=>{t.resource&&!t.resource.includes("node_modules")&&(e.add(this.normalizePath(t.resource)),t.loaders&&t.loaders.some((t=>t.loader.includes("sass-loader")||t.loader.includes("scss-loader")))&&this.readModuleAndExtractSassDependencies(this.normalizePath(t.resource)).forEach((t=>e.add(this.normalizePath(t)))))})),e}readModuleAndExtractSassDependencies(t){try{if(!i.existsSync(t))return[];const e=i.readFileSync(t,"utf8"),s=this.extractSassImports(e),r=[];return s.forEach((e=>{const s=this.resolveSassPath(t,e);s&&i.existsSync(s)&&(r.push(...this.readModuleAndExtractSassDependencies(s)),r.push(this.normalizePath(s)))})),r}catch(t){return[]}}extractSassImports(t){const e=[],s=/@(?:import|use|forward)\s+['"]([^'"]+)['"]/g;let i=s.exec(t);for(;null!==i;)e.push(i[1]),i=s.exec(t);return e}resolveSassPath(t,e){const s=r.dirname(t),n=[];e.endsWith(".scss")||e.endsWith(".sass")?n.push(r.resolve(s,e)):(n.push(r.resolve(s,`${e}.scss`)),n.push(r.resolve(s,`${e}.sass`)));const o=r.basename(e),h=r.dirname(e);if(!o.startsWith("_")){const t=r.join(h,`_${o}`);t.endsWith(".scss")||t.endsWith(".sass")?n.push(r.resolve(s,t)):(n.push(r.resolve(s,`${t}.scss`)),n.push(r.resolve(s,`${t}.sass`)))}for(const t of n)if(i.existsSync(t))return this.normalizePath(t);return null}saveResult(t){const e=t.map((t=>this.normalizePath(r.relative(n.cwd(),t))));this.debugLog("🚀 ~ UnimportedAnalyzerWebpackPlugin ~ result (relative to srcPath):",e);const s=r.dirname(this.options.output);i.existsSync(s)||i.mkdirSync(s,{recursive:!0});const o=r.resolve(n.cwd(),this.options.output);i.writeFileSync(o,`${JSON.stringify(e,null,2)}\n`,"utf8"),this.debugLog("🚀 ~ UnimportedAnalyzerWebpackPlugin ~ Result saved to:",this.options.output)}normalizePath(t){return t.replace(/\\/g,"/").replace(/\?.*$/,"").toLowerCase()}debugLog(...t){this.options?.debug&&console.log(...t)}}},75:t=>{"use strict";t.exports=require("node:stream")},78:(t,e,s)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AST=void 0;const i=s(607),r=s(888),n=new Set(["!","?","+","*","@"]),o=t=>n.has(t),h="(?!\\.)",a=new Set(["[","."]),l=new Set(["..","."]),c=new Set("().*{}+?[]^$\\!"),p="[^/]",d=p+"*?",u=p+"+?";class f{type;#t;#e;#s=!1;#i=[];#r;#n;#o;#h=!1;#a;#l;#c=!1;constructor(t,e,s={}){this.type=t,t&&(this.#e=!0),this.#r=e,this.#t=this.#r?this.#r.#t:this,this.#a=this.#t===this?s:this.#t.#a,this.#o=this.#t===this?[]:this.#t.#o,"!"!==t||this.#t.#h||this.#o.push(this),this.#n=this.#r?this.#r.#i.length:0}get hasMagic(){if(void 0!==this.#e)return this.#e;for(const t of this.#i)if("string"!=typeof t&&(t.type||t.hasMagic))return this.#e=!0;return this.#e}toString(){return void 0!==this.#l?this.#l:this.type?this.#l=this.type+"("+this.#i.map((t=>String(t))).join("|")+")":this.#l=this.#i.map((t=>String(t))).join("")}#p(){if(this!==this.#t)throw new Error("should only call on root");if(this.#h)return this;let t;for(this.toString(),this.#h=!0;t=this.#o.pop();){if("!"!==t.type)continue;let e=t,s=e.#r;for(;s;){for(let i=e.#n+1;!s.type&&i<s.#i.length;i++)for(const e of t.#i){if("string"==typeof e)throw new Error("string part in extglob AST??");e.copyIn(s.#i[i])}e=s,s=e.#r}}return this}push(...t){for(const e of t)if(""!==e){if("string"!=typeof e&&!(e instanceof f&&e.#r===this))throw new Error("invalid part: "+e);this.#i.push(e)}}toJSON(){const t=null===this.type?this.#i.slice().map((t=>"string"==typeof t?t:t.toJSON())):[this.type,...this.#i.map((t=>t.toJSON()))];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#t||this.#t.#h&&"!"===this.#r?.type)&&t.push({}),t}isStart(){if(this.#t===this)return!0;if(!this.#r?.isStart())return!1;if(0===this.#n)return!0;const t=this.#r;for(let e=0;e<this.#n;e++){const s=t.#i[e];if(!(s instanceof f&&"!"===s.type))return!1}return!0}isEnd(){if(this.#t===this)return!0;if("!"===this.#r?.type)return!0;if(!this.#r?.isEnd())return!1;if(!this.type)return this.#r?.isEnd();const t=this.#r?this.#r.#i.length:0;return this.#n===t-1}copyIn(t){"string"==typeof t?this.push(t):this.push(t.clone(this))}clone(t){const e=new f(this.type,t);for(const t of this.#i)e.copyIn(t);return e}static#d(t,e,s,i){let r=!1,n=!1,h=-1,a=!1;if(null===e.type){let l=s,c="";for(;l<t.length;){const s=t.charAt(l++);if(r||"\\"===s)r=!r,c+=s;else if(n)l===h+1?"^"!==s&&"!"!==s||(a=!0):"]"!==s||l===h+2&&a||(n=!1),c+=s;else if("["!==s)if(i.noext||!o(s)||"("!==t.charAt(l))c+=s;else{e.push(c),c="";const r=new f(s,e);l=f.#d(t,r,l,i),e.push(r)}else n=!0,h=l,a=!1,c+=s}return e.push(c),l}let l=s+1,c=new f(null,e);const p=[];let d="";for(;l<t.length;){const s=t.charAt(l++);if(r||"\\"===s)r=!r,d+=s;else if(n)l===h+1?"^"!==s&&"!"!==s||(a=!0):"]"!==s||l===h+2&&a||(n=!1),d+=s;else if("["!==s)if(o(s)&&"("===t.charAt(l)){c.push(d),d="";const e=new f(s,c);c.push(e),l=f.#d(t,e,l,i)}else if("|"!==s){if(")"===s)return""===d&&0===e.#i.length&&(e.#c=!0),c.push(d),d="",e.push(...p,c),l;d+=s}else c.push(d),d="",p.push(c),c=new f(null,e);else n=!0,h=l,a=!1,d+=s}return e.type=null,e.#e=void 0,e.#i=[t.substring(s-1)],l}static fromGlob(t,e={}){const s=new f(null,void 0,e);return f.#d(t,s,0,e),s}toMMPattern(){if(this!==this.#t)return this.#t.toMMPattern();const t=this.toString(),[e,s,i,r]=this.toRegExpSource();if(!(i||this.#e||this.#a.nocase&&!this.#a.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return s;const n=(this.#a.nocase?"i":"")+(r?"u":"");return Object.assign(new RegExp(`^${e}$`,n),{_src:e,_glob:t})}get options(){return this.#a}toRegExpSource(t){const e=t??!!this.#a.dot;if(this.#t===this&&this.#p(),!this.type){const s=this.isStart()&&this.isEnd(),i=this.#i.map((e=>{const[i,r,n,o]="string"==typeof e?f.#u(e,this.#e,s):e.toRegExpSource(t);return this.#e=this.#e||n,this.#s=this.#s||o,i})).join("");let n="";if(this.isStart()&&"string"==typeof this.#i[0]&&(1!==this.#i.length||!l.has(this.#i[0]))){const s=a,r=e&&s.has(i.charAt(0))||i.startsWith("\\.")&&s.has(i.charAt(2))||i.startsWith("\\.\\.")&&s.has(i.charAt(4)),o=!e&&!t&&s.has(i.charAt(0));n=r?"(?!(?:^|/)\\.\\.?(?:$|/))":o?h:""}let o="";return this.isEnd()&&this.#t.#h&&"!"===this.#r?.type&&(o="(?:$|\\/)"),[n+i+o,(0,r.unescape)(i),this.#e=!!this.#e,this.#s]}const s="*"===this.type||"+"===this.type,i="!"===this.type?"(?:(?!(?:":"(?:";let n=this.#f(e);if(this.isStart()&&this.isEnd()&&!n&&"!"!==this.type){const t=this.toString();return this.#i=[t],this.type=null,this.#e=void 0,[t,(0,r.unescape)(this.toString()),!1,!1]}let o=!s||t||e?"":this.#f(!0);o===n&&(o=""),o&&(n=`(?:${n})(?:${o})*?`);let c="";return c="!"===this.type&&this.#c?(this.isStart()&&!e?h:"")+u:i+n+("!"===this.type?"))"+(!this.isStart()||e||t?"":h)+d+")":"@"===this.type?")":"?"===this.type?")?":"+"===this.type&&o?")":"*"===this.type&&o?")?":`)${this.type}`),[c,(0,r.unescape)(n),this.#e=!!this.#e,this.#s]}#f(t){return this.#i.map((e=>{if("string"==typeof e)throw new Error("string type in extglob ast??");const[s,i,r,n]=e.toRegExpSource(t);return this.#s=this.#s||n,s})).filter((t=>!(this.isStart()&&this.isEnd()&&!t))).join("|")}static#u(t,e,s=!1){let n=!1,o="",h=!1;for(let r=0;r<t.length;r++){const a=t.charAt(r);if(n)n=!1,o+=(c.has(a)?"\\":"")+a;else if("\\"!==a){if("["===a){const[s,n,a,l]=(0,i.parseClass)(t,r);if(a){o+=s,h=h||n,r+=a-1,e=e||l;continue}}"*"!==a?"?"!==a?o+=a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):(o+=p,e=!0):(o+=s&&"*"===t?u:d,e=!0)}else r===t.length-1?o+="\\\\":n=!0}return[o,(0,r.unescape)(t),!!e,h]}}e.AST=f},136:t=>{"use strict";t.exports=require("node:url")},193:t=>{"use strict";t.exports=require("node:string_decoder")},220:(t,e,s)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.glob=e.sync=e.iterate=e.iterateSync=e.stream=e.streamSync=e.Ignore=e.hasMagic=e.Glob=e.unescape=e.escape=void 0,e.globStreamSync=c,e.globStream=p,e.globSync=d,e.globIterateSync=f,e.globIterate=g;const i=s(854),r=s(652),n=s(294);var o=s(854);Object.defineProperty(e,"escape",{enumerable:!0,get:function(){return o.escape}}),Object.defineProperty(e,"unescape",{enumerable:!0,get:function(){return o.unescape}});var h=s(652);Object.defineProperty(e,"Glob",{enumerable:!0,get:function(){return h.Glob}});var a=s(294);Object.defineProperty(e,"hasMagic",{enumerable:!0,get:function(){return a.hasMagic}});var l=s(924);function c(t,e={}){return new r.Glob(t,e).streamSync()}function p(t,e={}){return new r.Glob(t,e).stream()}function d(t,e={}){return new r.Glob(t,e).walkSync()}async function u(t,e={}){return new r.Glob(t,e).walk()}function f(t,e={}){return new r.Glob(t,e).iterateSync()}function g(t,e={}){return new r.Glob(t,e).iterate()}Object.defineProperty(e,"Ignore",{enumerable:!0,get:function(){return l.Ignore}}),e.streamSync=c,e.stream=Object.assign(p,{sync:c}),e.iterateSync=f,e.iterate=Object.assign(g,{sync:f}),e.sync=Object.assign(d,{stream:c,iterate:f}),e.glob=Object.assign(u,{glob:u,globSync:d,sync:e.sync,globStream:p,stream:e.stream,globStreamSync:c,streamSync:e.streamSync,globIterate:g,iterate:e.iterate,globIterateSync:f,iterateSync:e.iterateSync,Glob:r.Glob,hasMagic:n.hasMagic,escape:i.escape,unescape:i.unescape}),e.glob.glob=e.glob},225:function(t,e,s){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Minipass=e.isWritable=e.isReadable=e.isStream=void 0;const r="object"==typeof process&&process?process:{stdout:null,stderr:null},n=s(474),o=i(s(75)),h=s(193);e.isStream=t=>!!t&&"object"==typeof t&&(t instanceof U||t instanceof o.default||(0,e.isReadable)(t)||(0,e.isWritable)(t)),e.isReadable=t=>!!t&&"object"==typeof t&&t instanceof n.EventEmitter&&"function"==typeof t.pipe&&t.pipe!==o.default.Writable.prototype.pipe,e.isWritable=t=>!!t&&"object"==typeof t&&t instanceof n.EventEmitter&&"function"==typeof t.write&&"function"==typeof t.end;const a=Symbol("EOF"),l=Symbol("maybeEmitEnd"),c=Symbol("emittedEnd"),p=Symbol("emittingEnd"),d=Symbol("emittedError"),u=Symbol("closed"),f=Symbol("read"),g=Symbol("flush"),m=Symbol("flushChunk"),y=Symbol("encoding"),w=Symbol("decoder"),b=Symbol("flowing"),v=Symbol("paused"),S=Symbol("resume"),k=Symbol("buffer"),x=Symbol("pipes"),E=Symbol("bufferLength"),L=Symbol("bufferPush"),A=Symbol("bufferShift"),T=Symbol("objectMode"),M=Symbol("destroyed"),C=Symbol("error"),O=Symbol("emitData"),P=Symbol("emitEnd"),F=Symbol("emitEnd2"),R=Symbol("async"),z=Symbol("abort"),_=Symbol("aborted"),D=Symbol("signal"),j=Symbol("dataListeners"),W=Symbol("discarded"),N=t=>Promise.resolve().then(t),B=t=>t();class I{src;dest;opts;ondrain;constructor(t,e,s){this.src=t,this.dest=e,this.opts=s,this.ondrain=()=>t[S](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(t){}end(){this.unpipe(),this.opts.end&&this.dest.end()}}class G extends I{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(t,e,s){super(t,e,s),this.proxyErrors=t=>e.emit("error",t),t.on("error",this.proxyErrors)}}class U extends n.EventEmitter{[b]=!1;[v]=!1;[x]=[];[k]=[];[T];[y];[R];[w];[a]=!1;[c]=!1;[p]=!1;[u]=!1;[d]=null;[E]=0;[M]=!1;[D];[_]=!1;[j]=0;[W]=!1;writable=!0;readable=!0;constructor(...t){const e=t[0]||{};if(super(),e.objectMode&&"string"==typeof e.encoding)throw new TypeError("Encoding and objectMode may not be used together");var s;e.objectMode?(this[T]=!0,this[y]=null):!(s=e).objectMode&&s.encoding&&"buffer"!==s.encoding?(this[y]=e.encoding,this[T]=!1):(this[T]=!1,this[y]=null),this[R]=!!e.async,this[w]=this[y]?new h.StringDecoder(this[y]):null,e&&!0===e.debugExposeBuffer&&Object.defineProperty(this,"buffer",{get:()=>this[k]}),e&&!0===e.debugExposePipes&&Object.defineProperty(this,"pipes",{get:()=>this[x]});const{signal:i}=e;i&&(this[D]=i,i.aborted?this[z]():i.addEventListener("abort",(()=>this[z]())))}get bufferLength(){return this[E]}get encoding(){return this[y]}set encoding(t){throw new Error("Encoding must be set at instantiation time")}setEncoding(t){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[T]}set objectMode(t){throw new Error("objectMode must be set at instantiation time")}get async(){return this[R]}set async(t){this[R]=this[R]||!!t}[z](){this[_]=!0,this.emit("abort",this[D]?.reason),this.destroy(this[D]?.reason)}get aborted(){return this[_]}set aborted(t){}write(t,e,s){if(this[_])return!1;if(this[a])throw new Error("write after end");if(this[M])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;"function"==typeof e&&(s=e,e="utf8"),e||(e="utf8");const i=this[R]?N:B;if(!this[T]&&!Buffer.isBuffer(t))if(r=t,!Buffer.isBuffer(r)&&ArrayBuffer.isView(r))t=Buffer.from(t.buffer,t.byteOffset,t.byteLength);else if((t=>t instanceof ArrayBuffer||!!t&&"object"==typeof t&&t.constructor&&"ArrayBuffer"===t.constructor.name&&t.byteLength>=0)(t))t=Buffer.from(t);else if("string"!=typeof t)throw new Error("Non-contiguous data written to non-objectMode stream");var r;return this[T]?(this[b]&&0!==this[E]&&this[g](!0),this[b]?this.emit("data",t):this[L](t),0!==this[E]&&this.emit("readable"),s&&i(s),this[b]):t.length?("string"!=typeof t||e===this[y]&&!this[w]?.lastNeed||(t=Buffer.from(t,e)),Buffer.isBuffer(t)&&this[y]&&(t=this[w].write(t)),this[b]&&0!==this[E]&&this[g](!0),this[b]?this.emit("data",t):this[L](t),0!==this[E]&&this.emit("readable"),s&&i(s),this[b]):(0!==this[E]&&this.emit("readable"),s&&i(s),this[b])}read(t){if(this[M])return null;if(this[W]=!1,0===this[E]||0===t||t&&t>this[E])return this[l](),null;this[T]&&(t=null),this[k].length>1&&!this[T]&&(this[k]=[this[y]?this[k].join(""):Buffer.concat(this[k],this[E])]);const e=this[f](t||null,this[k][0]);return this[l](),e}[f](t,e){if(this[T])this[A]();else{const s=e;t===s.length||null===t?this[A]():"string"==typeof s?(this[k][0]=s.slice(t),e=s.slice(0,t),this[E]-=t):(this[k][0]=s.subarray(t),e=s.subarray(0,t),this[E]-=t)}return this.emit("data",e),this[k].length||this[a]||this.emit("drain"),e}end(t,e,s){return"function"==typeof t&&(s=t,t=void 0),"function"==typeof e&&(s=e,e="utf8"),void 0!==t&&this.write(t,e),s&&this.once("end",s),this[a]=!0,this.writable=!1,!this[b]&&this[v]||this[l](),this}[S](){this[M]||(this[j]||this[x].length||(this[W]=!0),this[v]=!1,this[b]=!0,this.emit("resume"),this[k].length?this[g]():this[a]?this[l]():this.emit("drain"))}resume(){return this[S]()}pause(){this[b]=!1,this[v]=!0,this[W]=!1}get destroyed(){return this[M]}get flowing(){return this[b]}get paused(){return this[v]}[L](t){this[T]?this[E]+=1:this[E]+=t.length,this[k].push(t)}[A](){return this[T]?this[E]-=1:this[E]-=this[k][0].length,this[k].shift()}[g](t=!1){do{}while(this[m](this[A]())&&this[k].length);t||this[k].length||this[a]||this.emit("drain")}[m](t){return this.emit("data",t),this[b]}pipe(t,e){if(this[M])return t;this[W]=!1;const s=this[c];return e=e||{},t===r.stdout||t===r.stderr?e.end=!1:e.end=!1!==e.end,e.proxyErrors=!!e.proxyErrors,s?e.end&&t.end():(this[x].push(e.proxyErrors?new G(this,t,e):new I(this,t,e)),this[R]?N((()=>this[S]())):this[S]()),t}unpipe(t){const e=this[x].find((e=>e.dest===t));e&&(1===this[x].length?(this[b]&&0===this[j]&&(this[b]=!1),this[x]=[]):this[x].splice(this[x].indexOf(e),1),e.unpipe())}addListener(t,e){return this.on(t,e)}on(t,e){const s=super.on(t,e);if("data"===t)this[W]=!1,this[j]++,this[x].length||this[b]||this[S]();else if("readable"===t&&0!==this[E])super.emit("readable");else if((t=>"end"===t||"finish"===t||"prefinish"===t)(t)&&this[c])super.emit(t),this.removeAllListeners(t);else if("error"===t&&this[d]){const t=e;this[R]?N((()=>t.call(this,this[d]))):t.call(this,this[d])}return s}removeListener(t,e){return this.off(t,e)}off(t,e){const s=super.off(t,e);return"data"===t&&(this[j]=this.listeners("data").length,0!==this[j]||this[W]||this[x].length||(this[b]=!1)),s}removeAllListeners(t){const e=super.removeAllListeners(t);return"data"!==t&&void 0!==t||(this[j]=0,this[W]||this[x].length||(this[b]=!1)),e}get emittedEnd(){return this[c]}[l](){this[p]||this[c]||this[M]||0!==this[k].length||!this[a]||(this[p]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[u]&&this.emit("close"),this[p]=!1)}emit(t,...e){const s=e[0];if("error"!==t&&"close"!==t&&t!==M&&this[M])return!1;if("data"===t)return!(!this[T]&&!s)&&(this[R]?(N((()=>this[O](s))),!0):this[O](s));if("end"===t)return this[P]();if("close"===t){if(this[u]=!0,!this[c]&&!this[M])return!1;const t=super.emit("close");return this.removeAllListeners("close"),t}if("error"===t){this[d]=s,super.emit(C,s);const t=!(this[D]&&!this.listeners("error").length)&&super.emit("error",s);return this[l](),t}if("resume"===t){const t=super.emit("resume");return this[l](),t}if("finish"===t||"prefinish"===t){const e=super.emit(t);return this.removeAllListeners(t),e}const i=super.emit(t,...e);return this[l](),i}[O](t){for(const e of this[x])!1===e.dest.write(t)&&this.pause();const e=!this[W]&&super.emit("data",t);return this[l](),e}[P](){return!this[c]&&(this[c]=!0,this.readable=!1,this[R]?(N((()=>this[F]())),!0):this[F]())}[F](){if(this[w]){const t=this[w].end();if(t){for(const e of this[x])e.dest.write(t);this[W]||super.emit("data",t)}}for(const t of this[x])t.end();const t=super.emit("end");return this.removeAllListeners("end"),t}async collect(){const t=Object.assign([],{dataLength:0});this[T]||(t.dataLength=0);const e=this.promise();return this.on("data",(e=>{t.push(e),this[T]||(t.dataLength+=e.length)})),await e,t}async concat(){if(this[T])throw new Error("cannot concat in objectMode");const t=await this.collect();return this[y]?t.join(""):Buffer.concat(t,t.dataLength)}async promise(){return new Promise(((t,e)=>{this.on(M,(()=>e(new Error("stream destroyed")))),this.on("error",(t=>e(t))),this.on("end",(()=>t()))}))}[Symbol.asyncIterator](){this[W]=!1;let t=!1;const e=async()=>(this.pause(),t=!0,{value:void 0,done:!0});return{next:()=>{if(t)return e();const s=this.read();if(null!==s)return Promise.resolve({done:!1,value:s});if(this[a])return e();let i,r;const n=t=>{this.off("data",o),this.off("end",h),this.off(M,l),e(),r(t)},o=t=>{this.off("error",n),this.off("end",h),this.off(M,l),this.pause(),i({value:t,done:!!this[a]})},h=()=>{this.off("error",n),this.off("data",o),this.off(M,l),e(),i({done:!0,value:void 0})},l=()=>n(new Error("stream destroyed"));return new Promise(((t,e)=>{r=e,i=t,this.once(M,l),this.once("error",n),this.once("end",h),this.once("data",o)}))},throw:e,return:e,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[W]=!1;let t=!1;const e=()=>(this.pause(),this.off(C,e),this.off(M,e),this.off("end",e),t=!0,{done:!0,value:void 0});return this.once("end",e),this.once(C,e),this.once(M,e),{next:()=>{if(t)return e();const s=this.read();return null===s?e():{done:!1,value:s}},throw:e,return:e,[Symbol.iterator](){return this}}}destroy(t){return this[M]?(t?this.emit("error",t):this.emit(M),this):(this[M]=!0,this[W]=!0,this[k].length=0,this[E]=0,"function"!=typeof this.close||this[u]||this.close(),t?this.emit("error",t):this.emit(M),this)}static get isStream(){return e.isStream}}e.Minipass=U},294:(t,e,s)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hasMagic=void 0;const i=s(854);e.hasMagic=(t,e={})=>{Array.isArray(t)||(t=[t]);for(const s of t)if(new i.Minimatch(s,e).hasMagic())return!0;return!1}},399:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.escape=void 0,e.escape=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&")},455:t=>{"use strict";t.exports=require("node:fs/promises")},474:t=>{"use strict";t.exports=require("node:events")},484:t=>{"use strict";function e(t,e,r){t instanceof RegExp&&(t=s(t,r)),e instanceof RegExp&&(e=s(e,r));var n=i(t,e,r);return n&&{start:n[0],end:n[1],pre:r.slice(0,n[0]),body:r.slice(n[0]+t.length,n[1]),post:r.slice(n[1]+e.length)}}function s(t,e){var s=e.match(t);return s?s[0]:null}function i(t,e,s){var i,r,n,o,h,a=s.indexOf(t),l=s.indexOf(e,a+1),c=a;if(a>=0&&l>0){if(t===e)return[a,l];for(i=[],n=s.length;c>=0&&!h;)c==a?(i.push(c),a=s.indexOf(t,c+1)):1==i.length?h=[i.pop(),l]:((r=i.pop())<n&&(n=r,o=l),l=s.indexOf(e,c+1)),c=a<l&&a>=0?a:l;i.length&&(h=[n,o])}return h}t.exports=e,e.range=i},486:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.assertValidPattern=void 0,e.assertValidPattern=t=>{if("string"!=typeof t)throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")}},520:(t,e,s)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Processor=e.SubWalks=e.MatchRecord=e.HasWalkedCache=void 0;const i=s(854);class r{store;constructor(t=new Map){this.store=t}copy(){return new r(new Map(this.store))}hasWalked(t,e){return this.store.get(t.fullpath())?.has(e.globString())}storeWalked(t,e){const s=t.fullpath(),i=this.store.get(s);i?i.add(e.globString()):this.store.set(s,new Set([e.globString()]))}}e.HasWalkedCache=r;class n{store=new Map;add(t,e,s){const i=(e?2:0)|(s?1:0),r=this.store.get(t);this.store.set(t,void 0===r?i:i&r)}entries(){return[...this.store.entries()].map((([t,e])=>[t,!!(2&e),!!(1&e)]))}}e.MatchRecord=n;class o{store=new Map;add(t,e){if(!t.canReaddir())return;const s=this.store.get(t);s?s.find((t=>t.globString()===e.globString()))||s.push(e):this.store.set(t,[e])}get(t){const e=this.store.get(t);if(!e)throw new Error("attempting to walk unknown path");return e}entries(){return this.keys().map((t=>[t,this.store.get(t)]))}keys(){return[...this.store.keys()].filter((t=>t.canReaddir()))}}e.SubWalks=o;class h{hasWalkedCache;matches=new n;subwalks=new o;patterns;follow;dot;opts;constructor(t,e){this.opts=t,this.follow=!!t.follow,this.dot=!!t.dot,this.hasWalkedCache=e?e.copy():new r}processPatterns(t,e){this.patterns=e;const s=e.map((e=>[t,e]));for(let[t,e]of s){this.hasWalkedCache.storeWalked(t,e);const s=e.root(),r=e.isAbsolute()&&!1!==this.opts.absolute;if(s){t=t.resolve("/"===s&&void 0!==this.opts.root?this.opts.root:s);const i=e.rest();if(!i){this.matches.add(t,!0,!1);continue}e=i}if(t.isENOENT())continue;let n,o,h=!1;for(;"string"==typeof(n=e.pattern())&&(o=e.rest());){const s=t.resolve(n);t=s,e=o,h=!0}if(n=e.pattern(),o=e.rest(),h){if(this.hasWalkedCache.hasWalked(t,e))continue;this.hasWalkedCache.storeWalked(t,e)}if("string"!=typeof n)if(n===i.GLOBSTAR){(!t.isSymbolicLink()||this.follow||e.checkFollowGlobstar())&&this.subwalks.add(t,e);const s=o?.pattern(),i=o?.rest();if(o&&(""!==s&&"."!==s||i)){if(".."===s){const e=t.parent||t;i?this.hasWalkedCache.hasWalked(e,i)||this.subwalks.add(e,i):this.matches.add(e,r,!0)}}else this.matches.add(t,r,""===s||"."===s)}else n instanceof RegExp&&this.subwalks.add(t,e);else{const e=".."===n||""===n||"."===n;this.matches.add(t.resolve(n),r,e)}}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new h(this.opts,this.hasWalkedCache)}filterEntries(t,e){const s=this.subwalks.get(t),r=this.child();for(const t of e)for(const e of s){const s=e.isAbsolute(),n=e.pattern(),o=e.rest();n===i.GLOBSTAR?r.testGlobstar(t,e,o,s):n instanceof RegExp?r.testRegExp(t,n,o,s):r.testString(t,n,o,s)}return r}testGlobstar(t,e,s,i){if(!this.dot&&t.name.startsWith(".")||(e.hasMore()||this.matches.add(t,i,!1),t.canReaddir()&&(this.follow||!t.isSymbolicLink()?this.subwalks.add(t,e):t.isSymbolicLink()&&(s&&e.checkFollowGlobstar()?this.subwalks.add(t,s):e.markFollowGlobstar()&&this.subwalks.add(t,e)))),s){const e=s.pattern();if("string"==typeof e&&".."!==e&&""!==e&&"."!==e)this.testString(t,e,s.rest(),i);else if(".."===e){const e=t.parent||t;this.subwalks.add(e,s)}else e instanceof RegExp&&this.testRegExp(t,e,s.rest(),i)}}testRegExp(t,e,s,i){e.test(t.name)&&(s?this.subwalks.add(t,s):this.matches.add(t,i,!1))}testString(t,e,s,i){t.isNamed(e)&&(s?this.subwalks.add(t,s):this.matches.add(t,i,!1))}}e.Processor=h},558:(t,e,s)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Pattern=void 0;const i=s(854);class r{#g;#m;#y;length;#w;#b;#v;#S;#k;#x;#E=!0;constructor(t,e,s,i){if(!(t.length>=1))throw new TypeError("empty pattern list");if(!(e.length>=1))throw new TypeError("empty glob list");if(e.length!==t.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=t.length,s<0||s>=this.length)throw new TypeError("index out of range");if(this.#g=t,this.#m=e,this.#y=s,this.#w=i,0===this.#y)if(this.isUNC()){const[t,e,s,i,...r]=this.#g,[n,o,h,a,...l]=this.#m;""===r[0]&&(r.shift(),l.shift());const c=[t,e,s,i,""].join("/"),p=[n,o,h,a,""].join("/");this.#g=[c,...r],this.#m=[p,...l],this.length=this.#g.length}else if(this.isDrive()||this.isAbsolute()){const[t,...e]=this.#g,[s,...i]=this.#m;""===e[0]&&(e.shift(),i.shift());const r=t+"/",n=s+"/";this.#g=[r,...e],this.#m=[n,...i],this.length=this.#g.length}}pattern(){return this.#g[this.#y]}isString(){return"string"==typeof this.#g[this.#y]}isGlobstar(){return this.#g[this.#y]===i.GLOBSTAR}isRegExp(){return this.#g[this.#y]instanceof RegExp}globString(){return this.#v=this.#v||(0===this.#y?this.isAbsolute()?this.#m[0]+this.#m.slice(1).join("/"):this.#m.join("/"):this.#m.slice(this.#y).join("/"))}hasMore(){return this.length>this.#y+1}rest(){return void 0!==this.#b?this.#b:this.hasMore()?(this.#b=new r(this.#g,this.#m,this.#y+1,this.#w),this.#b.#x=this.#x,this.#b.#k=this.#k,this.#b.#S=this.#S,this.#b):this.#b=null}isUNC(){const t=this.#g;return void 0!==this.#k?this.#k:this.#k="win32"===this.#w&&0===this.#y&&""===t[0]&&""===t[1]&&"string"==typeof t[2]&&!!t[2]&&"string"==typeof t[3]&&!!t[3]}isDrive(){const t=this.#g;return void 0!==this.#S?this.#S:this.#S="win32"===this.#w&&0===this.#y&&this.length>1&&"string"==typeof t[0]&&/^[a-z]:$/i.test(t[0])}isAbsolute(){const t=this.#g;return void 0!==this.#x?this.#x:this.#x=""===t[0]&&t.length>1||this.isDrive()||this.isUNC()}root(){const t=this.#g[0];return"string"==typeof t&&this.isAbsolute()&&0===this.#y?t:""}checkFollowGlobstar(){return!(0===this.#y||!this.isGlobstar()||!this.#E)}markFollowGlobstar(){return!(0===this.#y||!this.isGlobstar()||!this.#E||(this.#E=!1,0))}}e.Pattern=r},606:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LRUCache=void 0;const s="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,i=new Set,r="object"==typeof process&&process?process:{},n=(t,e,s,i)=>{"function"==typeof r.emitWarning?r.emitWarning(t,e,s,i):console.error(`[${s}] ${e}: ${t}`)};let o=globalThis.AbortController,h=globalThis.AbortSignal;if(void 0===o){h=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(t,e){this._onabort.push(e)}},o=class{constructor(){e()}signal=new h;abort(t){if(!this.signal.aborted){this.signal.reason=t,this.signal.aborted=!0;for(const e of this.signal._onabort)e(t);this.signal.onabort?.(t)}}};let t="1"!==r.env?.LRU_CACHE_IGNORE_AC_WARNING;const e=()=>{t&&(t=!1,n("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}Symbol("type");const a=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),l=t=>a(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?c:null:null;class c extends Array{constructor(t){super(t),this.fill(0)}}class p{heap;length;static#L=!1;static create(t){const e=l(t);if(!e)return[];p.#L=!0;const s=new p(t,e);return p.#L=!1,s}constructor(t,e){if(!p.#L)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}}class d{#A;#T;#M;#C;#O;#P;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#F;#R;#z;#_;#D;#j;#W;#N;#B;#I;#G;#U;#$;#q;#H;#V;#Z;static unsafeExposeInternals(t){return{starts:t.#$,ttls:t.#q,sizes:t.#U,keyMap:t.#z,keyList:t.#_,valList:t.#D,next:t.#j,prev:t.#W,get head(){return t.#N},get tail(){return t.#B},free:t.#I,isBackgroundFetch:e=>t.#J(e),backgroundFetch:(e,s,i,r)=>t.#K(e,s,i,r),moveToTail:e=>t.#Y(e),indexes:e=>t.#X(e),rindexes:e=>t.#Q(e),isStale:e=>t.#tt(e)}}get max(){return this.#A}get maxSize(){return this.#T}get calculatedSize(){return this.#R}get size(){return this.#F}get fetchMethod(){return this.#O}get memoMethod(){return this.#P}get dispose(){return this.#M}get disposeAfter(){return this.#C}constructor(t){const{max:e=0,ttl:s,ttlResolution:r=1,ttlAutopurge:o,updateAgeOnGet:h,updateAgeOnHas:c,allowStale:u,dispose:f,disposeAfter:g,noDisposeOnSet:m,noUpdateTTL:y,maxSize:w=0,maxEntrySize:b=0,sizeCalculation:v,fetchMethod:S,memoMethod:k,noDeleteOnFetchRejection:x,noDeleteOnStaleGet:E,allowStaleOnFetchRejection:L,allowStaleOnFetchAbort:A,ignoreFetchAbort:T}=t;if(0!==e&&!a(e))throw new TypeError("max option must be a nonnegative integer");const M=e?l(e):Array;if(!M)throw new Error("invalid max value: "+e);if(this.#A=e,this.#T=w,this.maxEntrySize=b||this.#T,this.sizeCalculation=v,this.sizeCalculation){if(!this.#T&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if("function"!=typeof this.sizeCalculation)throw new TypeError("sizeCalculation set to non-function")}if(void 0!==k&&"function"!=typeof k)throw new TypeError("memoMethod must be a function if defined");if(this.#P=k,void 0!==S&&"function"!=typeof S)throw new TypeError("fetchMethod must be a function if specified");if(this.#O=S,this.#V=!!S,this.#z=new Map,this.#_=new Array(e).fill(void 0),this.#D=new Array(e).fill(void 0),this.#j=new M(e),this.#W=new M(e),this.#N=0,this.#B=0,this.#I=p.create(e),this.#F=0,this.#R=0,"function"==typeof f&&(this.#M=f),"function"==typeof g?(this.#C=g,this.#G=[]):(this.#C=void 0,this.#G=void 0),this.#H=!!this.#M,this.#Z=!!this.#C,this.noDisposeOnSet=!!m,this.noUpdateTTL=!!y,this.noDeleteOnFetchRejection=!!x,this.allowStaleOnFetchRejection=!!L,this.allowStaleOnFetchAbort=!!A,this.ignoreFetchAbort=!!T,0!==this.maxEntrySize){if(0!==this.#T&&!a(this.#T))throw new TypeError("maxSize must be a positive integer if specified");if(!a(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#et()}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!E,this.updateAgeOnGet=!!h,this.updateAgeOnHas=!!c,this.ttlResolution=a(r)||0===r?r:1,this.ttlAutopurge=!!o,this.ttl=s||0,this.ttl){if(!a(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#st()}if(0===this.#A&&0===this.ttl&&0===this.#T)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#A&&!this.#T){const t="LRU_CACHE_UNBOUNDED";(t=>!i.has(t))(t)&&(i.add(t),n("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",t,d))}}getRemainingTTL(t){return this.#z.has(t)?1/0:0}#st(){const t=new c(this.#A),e=new c(this.#A);this.#q=t,this.#$=e,this.#it=(i,r,n=s.now())=>{if(e[i]=0!==r?n:0,t[i]=r,0!==r&&this.ttlAutopurge){const t=setTimeout((()=>{this.#tt(i)&&this.#rt(this.#_[i],"expire")}),r+1);t.unref&&t.unref()}},this.#nt=i=>{e[i]=0!==t[i]?s.now():0},this.#ot=(s,n)=>{if(t[n]){const o=t[n],h=e[n];if(!o||!h)return;s.ttl=o,s.start=h,s.now=i||r();const a=s.now-h;s.remainingTTL=o-a}};let i=0;const r=()=>{const t=s.now();if(this.ttlResolution>0){i=t;const e=setTimeout((()=>i=0),this.ttlResolution);e.unref&&e.unref()}return t};this.getRemainingTTL=s=>{const n=this.#z.get(s);if(void 0===n)return 0;const o=t[n],h=e[n];return o&&h?o-((i||r())-h):1/0},this.#tt=s=>{const n=e[s],o=t[s];return!!o&&!!n&&(i||r())-n>o}}#nt=()=>{};#ot=()=>{};#it=()=>{};#tt=()=>!1;#et(){const t=new c(this.#A);this.#R=0,this.#U=t,this.#ht=e=>{this.#R-=t[e],t[e]=0},this.#at=(t,e,s,i)=>{if(this.#J(e))return 0;if(!a(s)){if(!i)throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");if("function"!=typeof i)throw new TypeError("sizeCalculation must be a function");if(s=i(e,t),!a(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return s},this.#lt=(e,s,i)=>{if(t[e]=s,this.#T){const s=this.#T-t[e];for(;this.#R>s;)this.#ct(!0)}this.#R+=t[e],i&&(i.entrySize=s,i.totalCalculatedSize=this.#R)}}#ht=t=>{};#lt=(t,e,s)=>{};#at=(t,e,s,i)=>{if(s||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#X({allowStale:t=this.allowStale}={}){if(this.#F)for(let e=this.#B;this.#pt(e)&&(!t&&this.#tt(e)||(yield e),e!==this.#N);)e=this.#W[e]}*#Q({allowStale:t=this.allowStale}={}){if(this.#F)for(let e=this.#N;this.#pt(e)&&(!t&&this.#tt(e)||(yield e),e!==this.#B);)e=this.#j[e]}#pt(t){return void 0!==t&&this.#z.get(this.#_[t])===t}*entries(){for(const t of this.#X())void 0===this.#D[t]||void 0===this.#_[t]||this.#J(this.#D[t])||(yield[this.#_[t],this.#D[t]])}*rentries(){for(const t of this.#Q())void 0===this.#D[t]||void 0===this.#_[t]||this.#J(this.#D[t])||(yield[this.#_[t],this.#D[t]])}*keys(){for(const t of this.#X()){const e=this.#_[t];void 0===e||this.#J(this.#D[t])||(yield e)}}*rkeys(){for(const t of this.#Q()){const e=this.#_[t];void 0===e||this.#J(this.#D[t])||(yield e)}}*values(){for(const t of this.#X())void 0===this.#D[t]||this.#J(this.#D[t])||(yield this.#D[t])}*rvalues(){for(const t of this.#Q())void 0===this.#D[t]||this.#J(this.#D[t])||(yield this.#D[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,e={}){for(const s of this.#X()){const i=this.#D[s],r=this.#J(i)?i.__staleWhileFetching:i;if(void 0!==r&&t(r,this.#_[s],this))return this.get(this.#_[s],e)}}forEach(t,e=this){for(const s of this.#X()){const i=this.#D[s],r=this.#J(i)?i.__staleWhileFetching:i;void 0!==r&&t.call(e,r,this.#_[s],this)}}rforEach(t,e=this){for(const s of this.#Q()){const i=this.#D[s],r=this.#J(i)?i.__staleWhileFetching:i;void 0!==r&&t.call(e,r,this.#_[s],this)}}purgeStale(){let t=!1;for(const e of this.#Q({allowStale:!0}))this.#tt(e)&&(this.#rt(this.#_[e],"expire"),t=!0);return t}info(t){const e=this.#z.get(t);if(void 0===e)return;const i=this.#D[e],r=this.#J(i)?i.__staleWhileFetching:i;if(void 0===r)return;const n={value:r};if(this.#q&&this.#$){const t=this.#q[e],i=this.#$[e];if(t&&i){const e=t-(s.now()-i);n.ttl=e,n.start=Date.now()}}return this.#U&&(n.size=this.#U[e]),n}dump(){const t=[];for(const e of this.#X({allowStale:!0})){const i=this.#_[e],r=this.#D[e],n=this.#J(r)?r.__staleWhileFetching:r;if(void 0===n||void 0===i)continue;const o={value:n};if(this.#q&&this.#$){o.ttl=this.#q[e];const t=s.now()-this.#$[e];o.start=Math.floor(Date.now()-t)}this.#U&&(o.size=this.#U[e]),t.unshift([i,o])}return t}load(t){this.clear();for(const[e,i]of t){if(i.start){const t=Date.now()-i.start;i.start=s.now()-t}this.set(e,i.value,i)}}set(t,e,s={}){if(void 0===e)return this.delete(t),this;const{ttl:i=this.ttl,start:r,noDisposeOnSet:n=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:h}=s;let{noUpdateTTL:a=this.noUpdateTTL}=s;const l=this.#at(t,e,s.size||0,o);if(this.maxEntrySize&&l>this.maxEntrySize)return h&&(h.set="miss",h.maxEntrySizeExceeded=!0),this.#rt(t,"set"),this;let c=0===this.#F?void 0:this.#z.get(t);if(void 0===c)c=0===this.#F?this.#B:0!==this.#I.length?this.#I.pop():this.#F===this.#A?this.#ct(!1):this.#F,this.#_[c]=t,this.#D[c]=e,this.#z.set(t,c),this.#j[this.#B]=c,this.#W[c]=this.#B,this.#B=c,this.#F++,this.#lt(c,l,h),h&&(h.set="add"),a=!1;else{this.#Y(c);const s=this.#D[c];if(e!==s){if(this.#V&&this.#J(s)){s.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:e}=s;void 0===e||n||(this.#H&&this.#M?.(e,t,"set"),this.#Z&&this.#G?.push([e,t,"set"]))}else n||(this.#H&&this.#M?.(s,t,"set"),this.#Z&&this.#G?.push([s,t,"set"]));if(this.#ht(c),this.#lt(c,l,h),this.#D[c]=e,h){h.set="replace";const t=s&&this.#J(s)?s.__staleWhileFetching:s;void 0!==t&&(h.oldValue=t)}}else h&&(h.set="update")}if(0===i||this.#q||this.#st(),this.#q&&(a||this.#it(c,i,r),h&&this.#ot(h,c)),!n&&this.#Z&&this.#G){const t=this.#G;let e;for(;e=t?.shift();)this.#C?.(...e)}return this}pop(){try{for(;this.#F;){const t=this.#D[this.#N];if(this.#ct(!0),this.#J(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(void 0!==t)return t}}finally{if(this.#Z&&this.#G){const t=this.#G;let e;for(;e=t?.shift();)this.#C?.(...e)}}}#ct(t){const e=this.#N,s=this.#_[e],i=this.#D[e];return this.#V&&this.#J(i)?i.__abortController.abort(new Error("evicted")):(this.#H||this.#Z)&&(this.#H&&this.#M?.(i,s,"evict"),this.#Z&&this.#G?.push([i,s,"evict"])),this.#ht(e),t&&(this.#_[e]=void 0,this.#D[e]=void 0,this.#I.push(e)),1===this.#F?(this.#N=this.#B=0,this.#I.length=0):this.#N=this.#j[e],this.#z.delete(s),this.#F--,e}has(t,e={}){const{updateAgeOnHas:s=this.updateAgeOnHas,status:i}=e,r=this.#z.get(t);if(void 0!==r){const t=this.#D[r];if(this.#J(t)&&void 0===t.__staleWhileFetching)return!1;if(!this.#tt(r))return s&&this.#nt(r),i&&(i.has="hit",this.#ot(i,r)),!0;i&&(i.has="stale",this.#ot(i,r))}else i&&(i.has="miss");return!1}peek(t,e={}){const{allowStale:s=this.allowStale}=e,i=this.#z.get(t);if(void 0===i||!s&&this.#tt(i))return;const r=this.#D[i];return this.#J(r)?r.__staleWhileFetching:r}#K(t,e,s,i){const r=void 0===e?void 0:this.#D[e];if(this.#J(r))return r;const n=new o,{signal:h}=s;h?.addEventListener("abort",(()=>n.abort(h.reason)),{signal:n.signal});const a={signal:n.signal,options:s,context:i},l=(i,r=!1)=>{const{aborted:o}=n.signal,h=s.ignoreFetchAbort&&void 0!==i;if(s.status&&(o&&!r?(s.status.fetchAborted=!0,s.status.fetchError=n.signal.reason,h&&(s.status.fetchAbortIgnored=!0)):s.status.fetchResolved=!0),o&&!h&&!r)return c(n.signal.reason);const l=p;return this.#D[e]===p&&(void 0===i?l.__staleWhileFetching?this.#D[e]=l.__staleWhileFetching:this.#rt(t,"fetch"):(s.status&&(s.status.fetchUpdated=!0),this.set(t,i,a.options))),i},c=i=>{const{aborted:r}=n.signal,o=r&&s.allowStaleOnFetchAbort,h=o||s.allowStaleOnFetchRejection,a=h||s.noDeleteOnFetchRejection,l=p;if(this.#D[e]===p&&(a&&void 0!==l.__staleWhileFetching?o||(this.#D[e]=l.__staleWhileFetching):this.#rt(t,"fetch")),h)return s.status&&void 0!==l.__staleWhileFetching&&(s.status.returnedStale=!0),l.__staleWhileFetching;if(l.__returned===l)throw i};s.status&&(s.status.fetchDispatched=!0);const p=new Promise(((e,i)=>{const o=this.#O?.(t,r,a);o&&o instanceof Promise&&o.then((t=>e(void 0===t?void 0:t)),i),n.signal.addEventListener("abort",(()=>{s.ignoreFetchAbort&&!s.allowStaleOnFetchAbort||(e(void 0),s.allowStaleOnFetchAbort&&(e=t=>l(t,!0)))}))})).then(l,(t=>(s.status&&(s.status.fetchRejected=!0,s.status.fetchError=t),c(t)))),d=Object.assign(p,{__abortController:n,__staleWhileFetching:r,__returned:void 0});return void 0===e?(this.set(t,d,{...a.options,status:void 0}),e=this.#z.get(t)):this.#D[e]=d,d}#J(t){if(!this.#V)return!1;const e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof o}async fetch(t,e={}){const{allowStale:s=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:n=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:h=0,sizeCalculation:a=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:c=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:p=this.allowStaleOnFetchRejection,ignoreFetchAbort:d=this.ignoreFetchAbort,allowStaleOnFetchAbort:u=this.allowStaleOnFetchAbort,context:f,forceRefresh:g=!1,status:m,signal:y}=e;if(!this.#V)return m&&(m.fetch="get"),this.get(t,{allowStale:s,updateAgeOnGet:i,noDeleteOnStaleGet:r,status:m});const w={allowStale:s,updateAgeOnGet:i,noDeleteOnStaleGet:r,ttl:n,noDisposeOnSet:o,size:h,sizeCalculation:a,noUpdateTTL:l,noDeleteOnFetchRejection:c,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:u,ignoreFetchAbort:d,status:m,signal:y};let b=this.#z.get(t);if(void 0===b){m&&(m.fetch="miss");const e=this.#K(t,b,w,f);return e.__returned=e}{const e=this.#D[b];if(this.#J(e)){const t=s&&void 0!==e.__staleWhileFetching;return m&&(m.fetch="inflight",t&&(m.returnedStale=!0)),t?e.__staleWhileFetching:e.__returned=e}const r=this.#tt(b);if(!g&&!r)return m&&(m.fetch="hit"),this.#Y(b),i&&this.#nt(b),m&&this.#ot(m,b),e;const n=this.#K(t,b,w,f),o=void 0!==n.__staleWhileFetching&&s;return m&&(m.fetch=r?"stale":"refresh",o&&r&&(m.returnedStale=!0)),o?n.__staleWhileFetching:n.__returned=n}}async forceFetch(t,e={}){const s=await this.fetch(t,e);if(void 0===s)throw new Error("fetch() returned undefined");return s}memo(t,e={}){const s=this.#P;if(!s)throw new Error("no memoMethod provided to constructor");const{context:i,forceRefresh:r,...n}=e,o=this.get(t,n);if(!r&&void 0!==o)return o;const h=s(t,o,{options:n,context:i});return this.set(t,h,n),h}get(t,e={}){const{allowStale:s=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:n}=e,o=this.#z.get(t);if(void 0!==o){const e=this.#D[o],h=this.#J(e);return n&&this.#ot(n,o),this.#tt(o)?(n&&(n.get="stale"),h?(n&&s&&void 0!==e.__staleWhileFetching&&(n.returnedStale=!0),s?e.__staleWhileFetching:void 0):(r||this.#rt(t,"expire"),n&&s&&(n.returnedStale=!0),s?e:void 0)):(n&&(n.get="hit"),h?e.__staleWhileFetching:(this.#Y(o),i&&this.#nt(o),e))}n&&(n.get="miss")}#dt(t,e){this.#W[e]=t,this.#j[t]=e}#Y(t){t!==this.#B&&(t===this.#N?this.#N=this.#j[t]:this.#dt(this.#W[t],this.#j[t]),this.#dt(this.#B,t),this.#B=t)}delete(t){return this.#rt(t,"delete")}#rt(t,e){let s=!1;if(0!==this.#F){const i=this.#z.get(t);if(void 0!==i)if(s=!0,1===this.#F)this.#ut(e);else{this.#ht(i);const s=this.#D[i];if(this.#J(s)?s.__abortController.abort(new Error("deleted")):(this.#H||this.#Z)&&(this.#H&&this.#M?.(s,t,e),this.#Z&&this.#G?.push([s,t,e])),this.#z.delete(t),this.#_[i]=void 0,this.#D[i]=void 0,i===this.#B)this.#B=this.#W[i];else if(i===this.#N)this.#N=this.#j[i];else{const t=this.#W[i];this.#j[t]=this.#j[i];const e=this.#j[i];this.#W[e]=this.#W[i]}this.#F--,this.#I.push(i)}}if(this.#Z&&this.#G?.length){const t=this.#G;let e;for(;e=t?.shift();)this.#C?.(...e)}return s}clear(){return this.#ut("delete")}#ut(t){for(const e of this.#Q({allowStale:!0})){const s=this.#D[e];if(this.#J(s))s.__abortController.abort(new Error("deleted"));else{const i=this.#_[e];this.#H&&this.#M?.(s,i,t),this.#Z&&this.#G?.push([s,i,t])}}if(this.#z.clear(),this.#D.fill(void 0),this.#_.fill(void 0),this.#q&&this.#$&&(this.#q.fill(0),this.#$.fill(0)),this.#U&&this.#U.fill(0),this.#N=0,this.#B=0,this.#I.length=0,this.#R=0,this.#F=0,this.#Z&&this.#G){const t=this.#G;let e;for(;e=t?.shift();)this.#C?.(...e)}}}e.LRUCache=d},607:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseClass=void 0;const s={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},i=t=>t.replace(/[[\]\\-]/g,"\\$&"),r=t=>t.join("");e.parseClass=(t,e)=>{const n=e;if("["!==t.charAt(n))throw new Error("not in a brace expression");const o=[],h=[];let a=n+1,l=!1,c=!1,p=!1,d=!1,u=n,f="";t:for(;a<t.length;){const e=t.charAt(a);if("!"!==e&&"^"!==e||a!==n+1){if("]"===e&&l&&!p){u=a+1;break}if(l=!0,"\\"!==e||p){if("["===e&&!p)for(const[e,[i,r,l]]of Object.entries(s))if(t.startsWith(e,a)){if(f)return["$.",!1,t.length-n,!0];a+=e.length,l?h.push(i):o.push(i),c=c||r;continue t}p=!1,f?(e>f?o.push(i(f)+"-"+i(e)):e===f&&o.push(i(e)),f="",a++):t.startsWith("-]",a+1)?(o.push(i(e+"-")),a+=2):t.startsWith("-",a+1)?(f=e,a+=2):(o.push(i(e)),a++)}else p=!0,a++}else d=!0,a++}if(u<a)return["",!1,0,!1];if(!o.length&&!h.length)return["$.",!1,t.length-n,!0];if(0===h.length&&1===o.length&&/^\\?.$/.test(o[0])&&!d){return[(g=2===o[0].length?o[0].slice(-1):o[0],g.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")),!1,u-n,!1]}var g;const m="["+(d?"^":"")+r(o)+"]",y="["+(d?"":"^")+r(h)+"]";return[o.length&&h.length?"("+m+"|"+y+")":o.length?m:y,c,u-n,!0]}},632:t=>{const e={preset:"common",ignores:["node_modules/**/*","dist/**/*","build/**/*","bin/**/*","*.config.*","*.properties","*.json","*.yaml","*.yml","*.toml","package.json","package-lock.json","yarn.lock","pnpm-lock.yaml","pnpm-workspace.yaml","bun.lockb",".*/**/*","**/.*","**/*.md","**/*.txt","**/LICENSE","**/*.sh","**/*.bat","**/*.ps1","sudo","**/*.d.ts","**/*.map","**/*.min.*"],important:[],output:".unimported/unimported-files.json",debug:!1},s={common:{src:"./",ignores:[...e.ignores],important:e.important,output:e.output,debug:e.debug},webpack:{src:"./src",ignores:[...e.ignores],important:e.important,output:e.output,debug:e.debug},vue:{src:"./src",ignores:[...e.ignores],important:e.important,output:e.output,debug:e.debug},nuxt:{src:"./",ignores:[...e.ignores,"app/**/*","modules/**/*","router/**/*","app.html"],important:e.important,output:e.output,debug:e.debug}};t.exports={getMergedOptions:function(t={}){const i=t.preset||e.preset;if(!s[i])throw new Error(`Preset "${i}" is not supported.`);const r=s[i];return{preset:i,src:t.src||r.src,ignores:[...r.ignores,...t.ignores||[]],important:t.important||r.important,output:t.output||r.output,debug:t.debug||r.debug}}}},642:function(t,e,s){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,s,i){void 0===i&&(i=s);var r=Object.getOwnPropertyDescriptor(e,s);r&&!("get"in r?!e.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return e[s]}}),Object.defineProperty(t,i,r)}:function(t,e,s,i){void 0===i&&(i=s),t[i]=e[s]}),r=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var s in t)"default"!==s&&Object.prototype.hasOwnProperty.call(t,s)&&i(e,t,s);return r(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.PathScurry=e.Path=e.PathScurryDarwin=e.PathScurryPosix=e.PathScurryWin32=e.PathScurryBase=e.PathPosix=e.PathWin32=e.PathBase=e.ChildrenCache=e.ResolveCache=void 0;const o=s(606),h=s(760),a=s(136),l=s(896),c=n(s(24)),p=l.realpathSync.native,d=s(455),u=s(225),f={lstatSync:l.lstatSync,readdir:l.readdir,readdirSync:l.readdirSync,readlinkSync:l.readlinkSync,realpathSync:p,promises:{lstat:d.lstat,readdir:d.readdir,readlink:d.readlink,realpath:d.realpath}},g=t=>t&&t!==f&&t!==c?{...f,...t,promises:{...f.promises,...t.promises||{}}}:f,m=/^\\\\\?\\([a-z]:)\\?$/i,y=/[\\\/]/,w=10,b=15,v=-16,S=128,k=t=>t.isFile()?8:t.isDirectory()?4:t.isSymbolicLink()?w:t.isCharacterDevice()?2:t.isBlockDevice()?6:t.isSocket()?12:t.isFIFO()?1:0,x=new Map,E=t=>{const e=x.get(t);if(e)return e;const s=t.normalize("NFKD");return x.set(t,s),s},L=new Map,A=t=>{const e=L.get(t);if(e)return e;const s=E(t.toLowerCase());return L.set(t,s),s};class T extends o.LRUCache{constructor(){super({max:256})}}e.ResolveCache=T;class M extends o.LRUCache{constructor(t=16384){super({maxSize:t,sizeCalculation:t=>t.length+1})}}e.ChildrenCache=M;const C=Symbol("PathScurry setAsCwd");class O{name;root;roots;parent;nocase;isCWD=!1;#ft;#gt;get dev(){return this.#gt}#mt;get mode(){return this.#mt}#yt;get nlink(){return this.#yt}#wt;get uid(){return this.#wt}#bt;get gid(){return this.#bt}#vt;get rdev(){return this.#vt}#St;get blksize(){return this.#S