@easbot/utils 0.1.15 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ import {l,f,d,g,e,h,i}from'./chunk-3QJJWPMF.mjs';import Zi,{win32,posix}from'path';import ah,{realpath,readlink,readdir,lstat}from'fs/promises';import*as On from'fs';import {realpathSync,createWriteStream,readlinkSync,readdirSync,readdir as readdir$1,lstatSync}from'fs';import uo from'zod';import {fileURLToPath}from'url';import {EventEmitter}from'events';import Pr from'stream';import {StringDecoder}from'string_decoder';l();l();var wr=(e,t,i)=>{let s=e instanceof RegExp?Rs(e,i):e,h=t instanceof RegExp?Rs(t,i):t,n=s!==null&&h!=null&&fh(s,h,i);return n&&{start:n[0],end:n[1],pre:i.slice(0,n[0]),body:i.slice(n[0]+s.length,n[1]),post:i.slice(n[1]+h.length)}},Rs=(e,t)=>{let i=t.match(e);return i?i[0]:null},fh=(e,t,i)=>{let s,h,n,o,a,l=i.indexOf(e),u=i.indexOf(t,l+1),d=l;if(l>=0&&u>0){if(e===t)return [l,u];for(s=[],n=i.length;d>=0&&!a;){if(d===l)s.push(d),l=i.indexOf(e,d+1);else if(s.length===1){let f=s.pop();f!==void 0&&(a=[f,u]);}else h=s.pop(),h!==void 0&&h<n&&(n=h,o=u),u=i.indexOf(t,d+1);d=l<u&&l>=0?l:u;}s.length&&o!==void 0&&(a=[n,o]);}return a},yr="\0SLASH"+Math.random()+"\0",br="\0OPEN"+Math.random()+"\0",bs="\0CLOSE"+Math.random()+"\0",Sr="\0COMMA"+Math.random()+"\0",vr="\0PERIOD"+Math.random()+"\0",dh=new RegExp(yr,"g"),gh=new RegExp(br,"g"),mh=new RegExp(bs,"g"),wh=new RegExp(Sr,"g"),yh=new RegExp(vr,"g"),bh=/\\\\/g,Sh=/\\{/g,vh=/\\}/g,Eh=/\\,/g,xh=/\\./g,kh=1e5;function Ki(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}function Rh(e){return e.replace(bh,yr).replace(Sh,br).replace(vh,bs).replace(Eh,Sr).replace(xh,vr)}function Ch(e){return e.replace(dh,"\\").replace(gh,"{").replace(mh,"}").replace(wh,",").replace(yh,".")}function Er(e){if(!e)return [""];let t=[],i=wr("{","}",e);if(!i)return e.split(",");let{pre:s,body:h,post:n}=i,o=s.split(",");o[o.length-1]+="{"+h+"}";let a=Er(n);return n.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),t.push.apply(t,o),t}function Oh(e,t={}){if(!e)return [];let{max:i=kh}=t;return e.slice(0,2)==="{}"&&(e="\\{\\}"+e.slice(2)),Je(Rh(e),i,true).map(Ch)}function Ah(e){return "{"+e+"}"}function Fh(e){return /^-?0\d/.test(e)}function Th(e,t){return e<=t}function Mh(e,t){return e>=t}function Je(e,t,i){let s=[],h=wr("{","}",e);if(!h)return [e];let n=h.pre,o=h.post.length?Je(h.post,t,false):[""];if(/\$$/.test(h.pre))for(let a=0;a<o.length&&a<t;a++){let l=n+"{"+h.body+"}"+o[a];s.push(l);}else {let a=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(h.body),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(h.body),u=a||l,d=h.body.indexOf(",")>=0;if(!u&&!d)return h.post.match(/,(?!,).*\}/)?(e=h.pre+"{"+h.body+bs+h.post,Je(e,t,true)):[e];let f;if(u)f=h.body.split(/\.\./);else if(f=Er(h.body),f.length===1&&f[0]!==void 0&&(f=Je(f[0],t,false).map(Ah),f.length===1))return o.map(S=>h.pre+f[0]+S);let w;if(u&&f[0]!==void 0&&f[1]!==void 0){let S=Ki(f[0]),E=Ki(f[1]),b=Math.max(f[0].length,f[1].length),x=f.length===3&&f[2]!==void 0?Math.abs(Ki(f[2])):1,v=Th;E<S&&(x*=-1,v=Mh);let R=f.some(Fh);w=[];for(let A=S;v(A,E);A+=x){let T;if(l)T=String.fromCharCode(A),T==="\\"&&(T="");else if(T=String(A),R){let M=b-T.length;if(M>0){let F=new Array(M+1).join("0");A<0?T="-"+F+T.slice(1):T=F+T;}}w.push(T);}}else {w=[];for(let S=0;S<f.length;S++)w.push.apply(w,Je(f[S],t,false));}for(let S=0;S<w.length;S++)for(let E=0;E<o.length&&s.length<t;E++){let b=n+w[S]+o[E];(!i||u||b)&&s.push(b);}}return s}var Bi=e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},Lh={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",true],"[:alpha:]":["\\p{L}\\p{Nl}",true],"[:ascii:]":["\\x00-\\x7f",false],"[:blank:]":["\\p{Zs}\\t",true],"[:cntrl:]":["\\p{Cc}",true],"[:digit:]":["\\p{Nd}",true],"[:graph:]":["\\p{Z}\\p{C}",true,true],"[:lower:]":["\\p{Ll}",true],"[:print:]":["\\p{C}",true],"[:punct:]":["\\p{P}",true],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",true],"[:upper:]":["\\p{Lu}",true],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",true],"[:xdigit:]":["A-Fa-f0-9",false]},$e=e=>e.replace(/[[\]\\-]/g,"\\$&"),Wh=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Cs=e=>e.join(""),Dh=(e,t)=>{let i=t;if(e.charAt(i)!=="[")throw new Error("not in a brace expression");let s=[],h=[],n=i+1,o=false,a=false,l=false,u=false,d=i,f="";t:for(;n<e.length;){let E=e.charAt(n);if((E==="!"||E==="^")&&n===i+1){u=true,n++;continue}if(E==="]"&&o&&!l){d=n+1;break}if(o=true,E==="\\"&&!l){l=true,n++;continue}if(E==="["&&!l){for(let[b,[x,v,R]]of Object.entries(Lh))if(e.startsWith(b,n)){if(f)return ["$.",false,e.length-i,true];n+=b.length,R?h.push(x):s.push(x),a=a||v;continue t}}if(l=false,f){E>f?s.push($e(f)+"-"+$e(E)):E===f&&s.push($e(E)),f="",n++;continue}if(e.startsWith("-]",n+1)){s.push($e(E+"-")),n+=2;continue}if(e.startsWith("-",n+1)){f=E,n+=2;continue}s.push($e(E)),n++;}if(d<n)return ["",false,0,false];if(!s.length&&!h.length)return ["$.",false,e.length-i,true];if(h.length===0&&s.length===1&&/^\\?.$/.test(s[0])&&!u){let E=s[0].length===2?s[0].slice(-1):s[0];return [Wh(E),false,d-i,false]}let w="["+(u?"^":"")+Cs(s)+"]",S="["+(u?"":"^")+Cs(h)+"]";return [s.length&&h.length?"("+w+"|"+S+")":s.length?w:S,a,d-i,true]},Ce=(e,{windowsPathsNoEscape:t=false,magicalBraces:i=true}={})=>i?t?e.replace(/\[([^\/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"):t?e.replace(/\[([^\/\\{}])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^\/\\{}])\]/g,"$1$2").replace(/\\([^\/{}])/g,"$1"),Ph=new Set(["!","?","+","*","@"]),Os=e=>Ph.has(e),jh="(?!(?:^|/)\\.\\.?(?:$|/))",Ri="(?!\\.)",Nh=new Set(["[","."]),zh=new Set(["..","."]),_h=new Set("().*{}+?[]^$\\!"),$h=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Ss="[^/]",As=Ss+"*?",Fs=Ss+"+?",U,V,Bt,D,_,te,pe,ee,Pt,fe,Qe,Ee,kr,oe,X,Wi,hs,Rr,xr=(X=class{constructor(t,i,s={}){f(this,Ee);d(this,"type");f(this,U);f(this,V);f(this,Bt,false);f(this,D,[]);f(this,_);f(this,te);f(this,pe);f(this,ee,false);f(this,Pt);f(this,fe);f(this,Qe,false);this.type=t,t&&g(this,V,true),g(this,_,i),g(this,U,e(this,_)?e(e(this,_),U):this),g(this,Pt,e(this,U)===this?s:e(e(this,U),Pt)),g(this,pe,e(this,U)===this?[]:e(e(this,U),pe)),t==="!"&&!e(e(this,U),ee)&&e(this,pe).push(this),g(this,te,e(this,_)?e(e(this,_),D).length:0);}get hasMagic(){if(e(this,V)!==void 0)return e(this,V);for(let t of e(this,D))if(typeof t!="string"&&(t.type||t.hasMagic))return g(this,V,true);return e(this,V)}toString(){return e(this,fe)!==void 0?e(this,fe):this.type?g(this,fe,this.type+"("+e(this,D).map(t=>String(t)).join("|")+")"):g(this,fe,e(this,D).map(t=>String(t)).join(""))}push(...t){for(let i of t)if(i!==""){if(typeof i!="string"&&!(i instanceof X&&e(i,_)===this))throw new Error("invalid part: "+i);e(this,D).push(i);}}toJSON(){let t=this.type===null?e(this,D).slice().map(i=>typeof i=="string"?i:i.toJSON()):[this.type,...e(this,D).map(i=>i.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===e(this,U)||e(e(this,U),ee)&&e(this,_)?.type==="!")&&t.push({}),t}isStart(){if(e(this,U)===this)return true;if(!e(this,_)?.isStart())return false;if(e(this,te)===0)return true;let t=e(this,_);for(let i=0;i<e(this,te);i++){let s=e(t,D)[i];if(!(s instanceof X&&s.type==="!"))return false}return true}isEnd(){if(e(this,U)===this||e(this,_)?.type==="!")return true;if(!e(this,_)?.isEnd())return false;if(!this.type)return e(this,_)?.isEnd();let t=e(this,_)?e(e(this,_),D).length:0;return e(this,te)===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this));}clone(t){let i=new X(this.type,t);for(let s of e(this,D))i.copyIn(s);return i}static fromGlob(t,i={}){var h$1;let s=new X(null,void 0,i);return h(h$1=X,oe,Wi).call(h$1,t,s,0,i),s}toMMPattern(){if(this!==e(this,U))return e(this,U).toMMPattern();let t=this.toString(),[i,s,h,n]=this.toRegExpSource();if(!(h||e(this,V)||e(this,Pt).nocase&&!e(this,Pt).nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return s;let o=(e(this,Pt).nocase?"i":"")+(n?"u":"");return Object.assign(new RegExp(`^${i}$`,o),{_src:i,_glob:t})}get options(){return e(this,Pt)}toRegExpSource(t){let i=t??!!e(this,Pt).dot;if(e(this,U)===this&&h(this,Ee,kr).call(this),!this.type){let l=this.isStart()&&this.isEnd()&&!e(this,D).some(w=>typeof w!="string"),u=e(this,D).map(w=>{var v;let[S,E,b,x]=typeof w=="string"?h(v=X,oe,Rr).call(v,w,e(this,V),l):w.toRegExpSource(t);return g(this,V,e(this,V)||b),g(this,Bt,e(this,Bt)||x),S}).join(""),d="";if(this.isStart()&&typeof e(this,D)[0]=="string"&&!(e(this,D).length===1&&zh.has(e(this,D)[0]))){let w=Nh,S=i&&w.has(u.charAt(0))||u.startsWith("\\.")&&w.has(u.charAt(2))||u.startsWith("\\.\\.")&&w.has(u.charAt(4)),E=!i&&!t&&w.has(u.charAt(0));d=S?jh:E?Ri:"";}let f="";return this.isEnd()&&e(e(this,U),ee)&&e(this,_)?.type==="!"&&(f="(?:$|\\/)"),[d+u+f,Ce(u),g(this,V,!!e(this,V)),e(this,Bt)]}let s=this.type==="*"||this.type==="+",h$1=this.type==="!"?"(?:(?!(?:":"(?:",n=h(this,Ee,hs).call(this,i);if(this.isStart()&&this.isEnd()&&!n&&this.type!=="!"){let l=this.toString();return g(this,D,[l]),this.type=null,g(this,V,void 0),[l,Ce(this.toString()),false,false]}let o=!s||t||i||!Ri?"":h(this,Ee,hs).call(this,true);o===n&&(o=""),o&&(n=`(?:${n})(?:${o})*?`);let a="";if(this.type==="!"&&e(this,Qe))a=(this.isStart()&&!i?Ri:"")+Fs;else {let l=this.type==="!"?"))"+(this.isStart()&&!i&&!t?Ri:"")+As+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=h$1+n+l;}return [a,Ce(n),g(this,V,!!e(this,V)),e(this,Bt)]}},U=new WeakMap,V=new WeakMap,Bt=new WeakMap,D=new WeakMap,_=new WeakMap,te=new WeakMap,pe=new WeakMap,ee=new WeakMap,Pt=new WeakMap,fe=new WeakMap,Qe=new WeakMap,Ee=new WeakSet,kr=function(){if(this!==e(this,U))throw new Error("should only call on root");if(e(this,ee))return this;this.toString(),g(this,ee,true);let t;for(;t=e(this,pe).pop();){if(t.type!=="!")continue;let i=t,s=e(i,_);for(;s;){for(let h=e(i,te)+1;!s.type&&h<e(s,D).length;h++)for(let n of e(t,D)){if(typeof n=="string")throw new Error("string part in extglob AST??");n.copyIn(e(s,D)[h]);}i=s,s=e(i,_);}}return this},oe=new WeakSet,Wi=function(t,i,s,h$1){var S,E;let n=false,o=false,a=-1,l=false;if(i.type===null){let b=s,x="";for(;b<t.length;){let v=t.charAt(b++);if(n||v==="\\"){n=!n,x+=v;continue}if(o){b===a+1?(v==="^"||v==="!")&&(l=true):v==="]"&&!(b===a+2&&l)&&(o=false),x+=v;continue}else if(v==="["){o=true,a=b,l=false,x+=v;continue}if(!h$1.noext&&Os(v)&&t.charAt(b)==="("){i.push(x),x="";let R=new X(v,i);b=h(S=X,oe,Wi).call(S,t,R,b,h$1),i.push(R);continue}x+=v;}return i.push(x),b}let u=s+1,d=new X(null,i),f=[],w="";for(;u<t.length;){let b=t.charAt(u++);if(n||b==="\\"){n=!n,w+=b;continue}if(o){u===a+1?(b==="^"||b==="!")&&(l=true):b==="]"&&!(u===a+2&&l)&&(o=false),w+=b;continue}else if(b==="["){o=true,a=u,l=false,w+=b;continue}if(Os(b)&&t.charAt(u)==="("){d.push(w),w="";let x=new X(b,d);d.push(x),u=h(E=X,oe,Wi).call(E,t,x,u,h$1);continue}if(b==="|"){d.push(w),w="",f.push(d),d=new X(null,i);continue}if(b===")")return w===""&&e(i,D).length===0&&g(i,Qe,true),d.push(w),w="",i.push(...f,d),u;w+=b;}return i.type=null,g(i,V,void 0),g(i,D,[t.substring(s-1)]),u},hs=function(t){return e(this,D).map(i=>{if(typeof i=="string")throw new Error("string type in extglob ast??");let[s,h,n,o]=i.toRegExpSource(t);return g(this,Bt,e(this,Bt)||o),s}).filter(i=>!(this.isStart()&&this.isEnd())||!!i).join("|")},Rr=function(t,i,s=false){let h=false,n="",o=false,a=false;for(let l=0;l<t.length;l++){let u=t.charAt(l);if(h){h=false,n+=(_h.has(u)?"\\":"")+u;continue}if(u==="*"){if(a)continue;a=true,n+=s&&/^[*]+$/.test(t)?Fs:As,i=true;continue}else a=false;if(u==="\\"){l===t.length-1?n+="\\\\":h=true;continue}if(u==="["){let[d,f,w,S]=Dh(t,l);if(w){n+=d,o=o||f,l+=w-1,i=i||S;continue}}if(u==="?"){n+=Ss,i=true;continue}n+=$h(u);}return [n,Ce(t),!!i,o]},f(X,oe),X),Cr=(e,{windowsPathsNoEscape:t=false,magicalBraces:i=false}={})=>i?t?e.replace(/[?*()[\]{}]/g,"[$&]"):e.replace(/[?*()[\]\\{}]/g,"\\$&"):t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&"),nt=(e,t,i={})=>(Bi(t),!i.nocomment&&t.charAt(0)==="#"?false:new ae(t,i).match(e)),Bh=/^\*+([^+@!?\*\[\(]*)$/,Uh=e=>t=>!t.startsWith(".")&&t.endsWith(e),Gh=e=>t=>t.endsWith(e),Ih=e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),Hh=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),Jh=/^\*+\.\*+$/,qh=e=>!e.startsWith(".")&&e.includes("."),Zh=e=>e!=="."&&e!==".."&&e.includes("."),Vh=/^\.\*+$/,Yh=e=>e!=="."&&e!==".."&&e.startsWith("."),Kh=/^\*+$/,Xh=e=>e.length!==0&&!e.startsWith("."),Qh=e=>e.length!==0&&e!=="."&&e!=="..",tn=/^\?+([^+@!?\*\[\(]*)?$/,en=([e,t=""])=>{let i=Or([e]);return t?(t=t.toLowerCase(),s=>i(s)&&s.toLowerCase().endsWith(t)):i},sn=([e,t=""])=>{let i=Ar([e]);return t?(t=t.toLowerCase(),s=>i(s)&&s.toLowerCase().endsWith(t)):i},rn=([e,t=""])=>{let i=Ar([e]);return t?s=>i(s)&&s.endsWith(t):i},hn=([e,t=""])=>{let i=Or([e]);return t?s=>i(s)&&s.endsWith(t):i},Or=([e])=>{let t=e.length;return i=>i.length===t&&!i.startsWith(".")},Ar=([e])=>{let t=e.length;return i=>i.length===t&&i!=="."&&i!==".."},Fr=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Ts={win32:{sep:"\\"},posix:{sep:"/"}},nn=Fr==="win32"?Ts.win32.sep:Ts.posix.sep;nt.sep=nn;var ht=Symbol("globstar **");nt.GLOBSTAR=ht;var on="[^/]",an=on+"*?",ln="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",cn="(?:(?!(?:\\/|^)\\.).)*?",un=(e,t={})=>i=>nt(i,e,t);nt.filter=un;var mt=(e,t={})=>Object.assign({},e,t),pn=e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return nt;let t=nt;return Object.assign((i,s,h={})=>t(i,s,mt(e,h)),{Minimatch:class extends t.Minimatch{constructor(i,s={}){super(i,mt(e,s));}static defaults(i){return t.defaults(mt(e,i)).Minimatch}},AST:class extends t.AST{constructor(i,s,h={}){super(i,s,mt(e,h));}static fromGlob(i,s={}){return t.AST.fromGlob(i,mt(e,s))}},unescape:(i,s={})=>t.unescape(i,mt(e,s)),escape:(i,s={})=>t.escape(i,mt(e,s)),filter:(i,s={})=>t.filter(i,mt(e,s)),defaults:i=>t.defaults(mt(e,i)),makeRe:(i,s={})=>t.makeRe(i,mt(e,s)),braceExpand:(i,s={})=>t.braceExpand(i,mt(e,s)),match:(i,s,h={})=>t.match(i,s,mt(e,h)),sep:t.sep,GLOBSTAR:ht})};nt.defaults=pn;var Tr=(e,t={})=>(Bi(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:Oh(e,{max:t.braceExpandMax}));nt.braceExpand=Tr;var fn=(e,t={})=>new ae(e,t).makeRe();nt.makeRe=fn;var dn=(e,t,i={})=>{let s=new ae(t,i);return e=e.filter(h=>s.match(h)),s.options.nonull&&!e.length&&e.push(t),e};nt.match=dn;var Ms=/[?*]|[+@!]\(.*?\)|\[|\]/,gn=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),ae=class{constructor(e,t={}){d(this,"options");d(this,"set");d(this,"pattern");d(this,"windowsPathsNoEscape");d(this,"nonegate");d(this,"negate");d(this,"comment");d(this,"empty");d(this,"preserveMultipleSlashes");d(this,"partial");d(this,"globSet");d(this,"globParts");d(this,"nocase");d(this,"isWindows");d(this,"platform");d(this,"windowsNoMagicRoot");d(this,"regexp");Bi(e),t=t||{},this.options=t,this.pattern=e,this.platform=t.platform||Fr,this.isWindows=this.platform==="win32";let i="allowWindowsEscape";this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t[i]===false,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=false,this.nonegate=!!t.nonegate,this.comment=false,this.empty=false,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot!==void 0?t.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make();}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return true;for(let e of this.set)for(let t of e)if(typeof t!="string")return true;return false}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=true;return}if(!e){this.empty=true;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...h)=>console.error(...h)),this.debug(this.pattern,this.globSet);let i=this.globSet.map(h=>this.slashSplit(h));this.globParts=this.preprocess(i),this.debug(this.pattern,this.globParts);let s=this.globParts.map((h,n,o)=>{if(this.isWindows&&this.windowsNoMagicRoot){let a=h[0]===""&&h[1]===""&&(h[2]==="?"||!Ms.test(h[2]))&&!Ms.test(h[3]),l=/^[a-z]:/i.test(h[0]);if(a)return [...h.slice(0,4),...h.slice(4).map(u=>this.parse(u))];if(l)return [h[0],...h.slice(1).map(u=>this.parse(u))]}return h.map(a=>this.parse(a))});if(this.debug(this.pattern,s),this.set=s.filter(h=>h.indexOf(false)===-1),this.isWindows)for(let h=0;h<this.set.length;h++){let n=this.set[h];n[0]===""&&n[1]===""&&this.globParts[h][2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3])&&(n[2]="?");}this.debug(this.pattern,this.set);}preprocess(e){if(this.options.noglobstar)for(let i=0;i<e.length;i++)for(let s=0;s<e[i].length;s++)e[i][s]==="**"&&(e[i][s]="*");let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):t>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(t=>{let i=-1;for(;(i=t.indexOf("**",i+1))!==-1;){let s=i;for(;t[s+1]==="**";)s++;s!==i&&t.splice(i,s-i);}return t})}levelOneOptimize(e){return e.map(t=>(t=t.reduce((i,s)=>{let h=i[i.length-1];return s==="**"&&h==="**"?i:s===".."&&h&&h!==".."&&h!=="."&&h!=="**"?(i.pop(),i):(i.push(s),i)},[]),t.length===0?[""]:t))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=false;do{if(t=false,!this.preserveMultipleSlashes){for(let s=1;s<e.length-1;s++){let h=e[s];s===1&&h===""&&e[0]===""||(h==="."||h==="")&&(t=true,e.splice(s,1),s--);}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(t=true,e.pop());}let i=0;for(;(i=e.indexOf("..",i+1))!==-1;){let s=e[i-1];s&&s!=="."&&s!==".."&&s!=="**"&&(t=true,e.splice(i-1,2),i-=2);}}while(t);return e.length===0?[""]:e}firstPhasePreProcess(e){let t=false;do{t=false;for(let i of e){let s=-1;for(;(s=i.indexOf("**",s+1))!==-1;){let n=s;for(;i[n+1]==="**";)n++;n>s&&i.splice(s+1,n-s);let o=i[s+1],a=i[s+2],l=i[s+3];if(o!==".."||!a||a==="."||a===".."||!l||l==="."||l==="..")continue;t=true,i.splice(s,1);let u=i.slice(0);u[s]="**",e.push(u),s--;}if(!this.preserveMultipleSlashes){for(let n=1;n<i.length-1;n++){let o=i[n];n===1&&o===""&&i[0]===""||(o==="."||o==="")&&(t=true,i.splice(n,1),n--);}i[0]==="."&&i.length===2&&(i[1]==="."||i[1]==="")&&(t=true,i.pop());}let h=0;for(;(h=i.indexOf("..",h+1))!==-1;){let n=i[h-1];if(n&&n!=="."&&n!==".."&&n!=="**"){t=true;let o=h===1&&i[h+1]==="**"?["."]:[];i.splice(h-1,2,...o),i.length===0&&i.push(""),h-=2;}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let i=t+1;i<e.length;i++){let s=this.partsMatch(e[t],e[i],!this.preserveMultipleSlashes);if(s){e[t]=[],e[i]=s;break}}return e.filter(t=>t.length)}partsMatch(e,t,i=false){let s=0,h=0,n=[],o="";for(;s<e.length&&h<t.length;)if(e[s]===t[h])n.push(o==="b"?t[h]:e[s]),s++,h++;else if(i&&e[s]==="**"&&t[h]===e[s+1])n.push(e[s]),s++;else if(i&&t[h]==="**"&&e[s]===t[h+1])n.push(t[h]),h++;else if(e[s]==="*"&&t[h]&&(this.options.dot||!t[h].startsWith("."))&&t[h]!=="**"){if(o==="b")return false;o="a",n.push(e[s]),s++,h++;}else if(t[h]==="*"&&e[s]&&(this.options.dot||!e[s].startsWith("."))&&e[s]!=="**"){if(o==="a")return false;o="b",n.push(t[h]),s++,h++;}else return false;return e.length===t.length&&n}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=false,i=0;for(let s=0;s<e.length&&e.charAt(s)==="!";s++)t=!t,i++;i&&(this.pattern=e.slice(i)),this.negate=t;}matchOne(e,t,i=false){let s=this.options;if(this.isWindows){let E=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),b=!E&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),x=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),v=!x&&t[0]===""&&t[1]===""&&t[2]==="?"&&typeof t[3]=="string"&&/^[a-z]:$/i.test(t[3]),R=b?3:E?0:void 0,A=v?3:x?0:void 0;if(typeof R=="number"&&typeof A=="number"){let[T,M]=[e[R],t[A]];T.toLowerCase()===M.toLowerCase()&&(t[A]=T,A>R?t=t.slice(A):R>A&&(e=e.slice(R)));}}let{optimizationLevel:h=1}=this.options;h>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:t}),this.debug("matchOne",e.length,t.length);for(var n=0,o=0,a=e.length,l=t.length;n<a&&o<l;n++,o++){this.debug("matchOne loop");var u=t[o],d=e[n];if(this.debug(t,u,d),u===false)return false;if(u===ht){this.debug("GLOBSTAR",[t,u,d]);var f=n,w=o+1;if(w===l){for(this.debug("** at the end");n<a;n++)if(e[n]==="."||e[n]===".."||!s.dot&&e[n].charAt(0)===".")return false;return true}for(;f<a;){var S=e[f];if(this.debug(`
2
+ globstar while`,e,f,t,w,S),this.matchOne(e.slice(f),t.slice(w),i))return this.debug("globstar found match!",f,a,S),true;if(S==="."||S===".."||!s.dot&&S.charAt(0)==="."){this.debug("dot detected!",e,f,t,w);break}this.debug("globstar swallow a segment, and continue"),f++;}return !!(i&&(this.debug(`
3
+ >>> no match, partial?`,e,f,t,w),f===a))}let E;if(typeof u=="string"?(E=d===u,this.debug("string match",u,d,E)):(E=u.test(d),this.debug("pattern match",u,d,E)),!E)return false}if(n===a&&o===l)return true;if(n===a)return i;if(o===l)return n===a-1&&e[n]==="";throw new Error("wtf?")}braceExpand(){return Tr(this.pattern,this.options)}parse(e){Bi(e);let t=this.options;if(e==="**")return ht;if(e==="")return "";let i,s=null;(i=e.match(Kh))?s=t.dot?Qh:Xh:(i=e.match(Bh))?s=(t.nocase?t.dot?Hh:Ih:t.dot?Gh:Uh)(i[1]):(i=e.match(tn))?s=(t.nocase?t.dot?sn:en:t.dot?rn:hn)(i):(i=e.match(Jh))?s=t.dot?Zh:qh:(i=e.match(Vh))&&(s=Yh);let h=xr.fromGlob(e,this.options).toMMPattern();return s&&typeof h=="object"&&Reflect.defineProperty(h,"test",{value:s}),h}makeRe(){if(this.regexp||this.regexp===false)return this.regexp;let e=this.set;if(!e.length)return this.regexp=false,this.regexp;let t=this.options,i=t.noglobstar?an:t.dot?ln:cn,s=new Set(t.nocase?["i"]:[]),h=e.map(a=>{let l=a.map(d=>{if(d instanceof RegExp)for(let f of d.flags.split(""))s.add(f);return typeof d=="string"?gn(d):d===ht?ht:d._src});l.forEach((d,f)=>{let w=l[f+1],S=l[f-1];d!==ht||S===ht||(S===void 0?w!==void 0&&w!==ht?l[f+1]="(?:\\/|"+i+"\\/)?"+w:l[f]=i:w===void 0?l[f-1]=S+"(?:\\/|\\/"+i+")?":w!==ht&&(l[f-1]=S+"(?:\\/|\\/"+i+"\\/)"+w,l[f+1]=ht));});let u=l.filter(d=>d!==ht);if(this.partial&&u.length>=1){let d=[];for(let f=1;f<=u.length;f++)d.push(u.slice(0,f).join("/"));return "(?:"+d.join("|")+")"}return u.join("/")}).join("|"),[n,o]=e.length>1?["(?:",")"]:["",""];h="^"+n+h+o+"$",this.partial&&(h="^(?:\\/|"+n+h.slice(1,-1)+o+")$"),this.negate&&(h="^(?!"+h+").+$");try{this.regexp=new RegExp(h,[...s].join(""));}catch{this.regexp=false;}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug("match",e,this.pattern),this.comment)return false;if(this.empty)return e==="";if(e==="/"&&t)return true;let i=this.options;this.isWindows&&(e=e.split("\\").join("/"));let s=this.slashSplit(e);this.debug(this.pattern,"split",s);let h=this.set;this.debug(this.pattern,"set",h);let n=s[s.length-1];if(!n)for(let o=s.length-2;!n&&o>=0;o--)n=s[o];for(let o=0;o<h.length;o++){let a=h[o],l=s;if(i.matchBase&&a.length===1&&(l=[n]),this.matchOne(l,a,t))return i.flipNegate?true:!this.negate}return i.flipNegate?false:this.negate}static defaults(e){return nt.defaults(e).Minimatch}};nt.AST=xr;nt.Minimatch=ae;nt.escape=Cr;nt.unescape=Ce;var wn=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Mr=new Set,ns=typeof process=="object"&&process?process:{},Lr=(e,t,i,s)=>{typeof ns.emitWarning=="function"?ns.emitWarning(e,t,i,s):console.error(`[${i}] ${t}: ${e}`);},Ui=globalThis.AbortController,Ls=globalThis.AbortSignal;if(typeof Ui>"u"){Ls=class{constructor(){d(this,"onabort");d(this,"_onabort",[]);d(this,"reason");d(this,"aborted",false);}addEventListener(i,s){this._onabort.push(s);}},Ui=class{constructor(){d(this,"signal",new Ls);t();}abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=true;for(let s of this.signal._onabort)s(i);this.signal.onabort?.(i);}}};let e=ns.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",t=()=>{e&&(e=false,Lr("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",t));};}var yn=e=>!Mr.has(e),Yt=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),Wr=e=>Yt(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?Di:null:null,Di=class extends Array{constructor(e){super(e),this.fill(0);}},zt,Oe,bn=(zt=class{constructor(t,i){d(this,"heap");d(this,"length");if(!e(zt,Oe))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new i(t),this.length=0;}static create(t){let i=Wr(t);if(!i)return [];g(zt,Oe,true);let s=new zt(t,i);return g(zt,Oe,false),s}push(t){this.heap[this.length++]=t;}pop(){return this.heap[--this.length]}},Oe=new WeakMap,f(zt,Oe,false),zt),qs,Zs,yt,ut,kt,de,Rt,Ae,Fe,Ct,G,Ot,$,P,O,it,pt,tt,Y,At,K,Ft,Tt,ft,dt,Mt,ie,st,Te,y,os,ge,Ut,ti,gt,Dr,me,Me,ei,Kt,Xt,as,Pi,ji,W,ls,qe,Qt,cs,Le,Hi=(Le=class{constructor(t){f(this,y);f(this,yt);f(this,ut);f(this,kt);f(this,de);f(this,Rt);f(this,Ae);f(this,Fe);f(this,Ct);d(this,"ttl");d(this,"ttlResolution");d(this,"ttlAutopurge");d(this,"updateAgeOnGet");d(this,"updateAgeOnHas");d(this,"allowStale");d(this,"noDisposeOnSet");d(this,"noUpdateTTL");d(this,"maxEntrySize");d(this,"sizeCalculation");d(this,"noDeleteOnFetchRejection");d(this,"noDeleteOnStaleGet");d(this,"allowStaleOnFetchAbort");d(this,"allowStaleOnFetchRejection");d(this,"ignoreFetchAbort");f(this,G);f(this,Ot);f(this,$);f(this,P);f(this,O);f(this,it);f(this,pt);f(this,tt);f(this,Y);f(this,At);f(this,K);f(this,Ft);f(this,Tt);f(this,ft);f(this,dt);f(this,Mt);f(this,ie);f(this,st);f(this,Te);f(this,ge,()=>{});f(this,Ut,()=>{});f(this,ti,()=>{});f(this,gt,()=>false);f(this,me,t=>{});f(this,Me,(t,i,s)=>{});f(this,ei,(t,i,s,h)=>{if(s||h)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});d(this,qs,"LRUCache");let{max:i=0,ttl:s,ttlResolution:h$1=1,ttlAutopurge:n,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:l,dispose:u,onInsert:d$1,disposeAfter:f$1,noDisposeOnSet:w,noUpdateTTL:S,maxSize:E=0,maxEntrySize:b=0,sizeCalculation:x,fetchMethod:v,memoMethod:R,noDeleteOnFetchRejection:A,noDeleteOnStaleGet:T,allowStaleOnFetchRejection:M,allowStaleOnFetchAbort:F,ignoreFetchAbort:j,perf:N}=t;if(N!==void 0&&typeof N?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(g(this,Ct,N??wn),i!==0&&!Yt(i))throw new TypeError("max option must be a nonnegative integer");let B=i?Wr(i):Array;if(!B)throw new Error("invalid max value: "+i);if(g(this,yt,i),g(this,ut,E),this.maxEntrySize=b||e(this,ut),this.sizeCalculation=x,this.sizeCalculation){if(!e(this,ut)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(R!==void 0&&typeof R!="function")throw new TypeError("memoMethod must be a function if defined");if(g(this,Fe,R),v!==void 0&&typeof v!="function")throw new TypeError("fetchMethod must be a function if specified");if(g(this,Ae,v),g(this,ie,!!v),g(this,$,new Map),g(this,P,new Array(i).fill(void 0)),g(this,O,new Array(i).fill(void 0)),g(this,it,new B(i)),g(this,pt,new B(i)),g(this,tt,0),g(this,Y,0),g(this,At,bn.create(i)),g(this,G,0),g(this,Ot,0),typeof u=="function"&&g(this,kt,u),typeof d$1=="function"&&g(this,de,d$1),typeof f$1=="function"?(g(this,Rt,f$1),g(this,K,[])):(g(this,Rt,void 0),g(this,K,void 0)),g(this,Mt,!!e(this,kt)),g(this,Te,!!e(this,de)),g(this,st,!!e(this,Rt)),this.noDisposeOnSet=!!w,this.noUpdateTTL=!!S,this.noDeleteOnFetchRejection=!!A,this.allowStaleOnFetchRejection=!!M,this.allowStaleOnFetchAbort=!!F,this.ignoreFetchAbort=!!j,this.maxEntrySize!==0){if(e(this,ut)!==0&&!Yt(e(this,ut)))throw new TypeError("maxSize must be a positive integer if specified");if(!Yt(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");h(this,y,Dr).call(this);}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!T,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=Yt(h$1)||h$1===0?h$1:1,this.ttlAutopurge=!!n,this.ttl=s||0,this.ttl){if(!Yt(this.ttl))throw new TypeError("ttl must be a positive integer if specified");h(this,y,os).call(this);}if(e(this,yt)===0&&this.ttl===0&&e(this,ut)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!e(this,yt)&&!e(this,ut)){let L="LRU_CACHE_UNBOUNDED";yn(L)&&(Mr.add(L),Lr("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",L,Le));}}get perf(){return e(this,Ct)}static unsafeExposeInternals(t){return {starts:e(t,Tt),ttls:e(t,ft),autopurgeTimers:e(t,dt),sizes:e(t,Ft),keyMap:e(t,$),keyList:e(t,P),valList:e(t,O),next:e(t,it),prev:e(t,pt),get head(){return e(t,tt)},get tail(){return e(t,Y)},free:e(t,At),isBackgroundFetch:i=>{var s;return h(s=t,y,W).call(s,i)},backgroundFetch:(i,s,h$1,n)=>{var o;return h(o=t,y,ji).call(o,i,s,h$1,n)},moveToTail:i=>{var s;return h(s=t,y,qe).call(s,i)},indexes:i=>{var s;return h(s=t,y,Kt).call(s,i)},rindexes:i=>{var s;return h(s=t,y,Xt).call(s,i)},isStale:i=>{var s;return e(s=t,gt).call(s,i)}}}get max(){return e(this,yt)}get maxSize(){return e(this,ut)}get calculatedSize(){return e(this,Ot)}get size(){return e(this,G)}get fetchMethod(){return e(this,Ae)}get memoMethod(){return e(this,Fe)}get dispose(){return e(this,kt)}get onInsert(){return e(this,de)}get disposeAfter(){return e(this,Rt)}getRemainingTTL(t){return e(this,$).has(t)?1/0:0}*entries(){for(let t of h(this,y,Kt).call(this))e(this,O)[t]!==void 0&&e(this,P)[t]!==void 0&&!h(this,y,W).call(this,e(this,O)[t])&&(yield [e(this,P)[t],e(this,O)[t]]);}*rentries(){for(let t of h(this,y,Xt).call(this))e(this,O)[t]!==void 0&&e(this,P)[t]!==void 0&&!h(this,y,W).call(this,e(this,O)[t])&&(yield [e(this,P)[t],e(this,O)[t]]);}*keys(){for(let t of h(this,y,Kt).call(this)){let i=e(this,P)[t];i!==void 0&&!h(this,y,W).call(this,e(this,O)[t])&&(yield i);}}*rkeys(){for(let t of h(this,y,Xt).call(this)){let i=e(this,P)[t];i!==void 0&&!h(this,y,W).call(this,e(this,O)[t])&&(yield i);}}*values(){for(let t of h(this,y,Kt).call(this))e(this,O)[t]!==void 0&&!h(this,y,W).call(this,e(this,O)[t])&&(yield e(this,O)[t]);}*rvalues(){for(let t of h(this,y,Xt).call(this))e(this,O)[t]!==void 0&&!h(this,y,W).call(this,e(this,O)[t])&&(yield e(this,O)[t]);}[(Zs=Symbol.iterator,qs=Symbol.toStringTag,Zs)](){return this.entries()}find(t,i={}){for(let s of h(this,y,Kt).call(this)){let h$1=e(this,O)[s],n=h(this,y,W).call(this,h$1)?h$1.__staleWhileFetching:h$1;if(n!==void 0&&t(n,e(this,P)[s],this))return this.get(e(this,P)[s],i)}}forEach(t,i=this){for(let s of h(this,y,Kt).call(this)){let h$1=e(this,O)[s],n=h(this,y,W).call(this,h$1)?h$1.__staleWhileFetching:h$1;n!==void 0&&t.call(i,n,e(this,P)[s],this);}}rforEach(t,i=this){for(let s of h(this,y,Xt).call(this)){let h$1=e(this,O)[s],n=h(this,y,W).call(this,h$1)?h$1.__staleWhileFetching:h$1;n!==void 0&&t.call(i,n,e(this,P)[s],this);}}purgeStale(){let t=false;for(let i of h(this,y,Xt).call(this,{allowStale:true}))e(this,gt).call(this,i)&&(h(this,y,Qt).call(this,e(this,P)[i],"expire"),t=true);return t}info(t){let i=e(this,$).get(t);if(i===void 0)return;let s=e(this,O)[i],h$1=h(this,y,W).call(this,s)?s.__staleWhileFetching:s;if(h$1===void 0)return;let n={value:h$1};if(e(this,ft)&&e(this,Tt)){let o=e(this,ft)[i],a=e(this,Tt)[i];if(o&&a){let l=o-(e(this,Ct).now()-a);n.ttl=l,n.start=Date.now();}}return e(this,Ft)&&(n.size=e(this,Ft)[i]),n}dump(){let t=[];for(let i of h(this,y,Kt).call(this,{allowStale:true})){let s=e(this,P)[i],h$1=e(this,O)[i],n=h(this,y,W).call(this,h$1)?h$1.__staleWhileFetching:h$1;if(n===void 0||s===void 0)continue;let o={value:n};if(e(this,ft)&&e(this,Tt)){o.ttl=e(this,ft)[i];let a=e(this,Ct).now()-e(this,Tt)[i];o.start=Math.floor(Date.now()-a);}e(this,Ft)&&(o.size=e(this,Ft)[i]),t.unshift([s,o]);}return t}load(t){this.clear();for(let[i,s]of t){if(s.start){let h=Date.now()-s.start;s.start=e(this,Ct).now()-h;}this.set(i,s.value,s);}}set(t,i$1,s={}){var w,S,E,b;if(i$1===void 0)return this.delete(t),this;let{ttl:h$1=this.ttl,start:n,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:l}=s,{noUpdateTTL:u=this.noUpdateTTL}=s,d=e(this,ei).call(this,t,i$1,s.size||0,a);if(this.maxEntrySize&&d>this.maxEntrySize)return l&&(l.set="miss",l.maxEntrySizeExceeded=true),h(this,y,Qt).call(this,t,"set"),this;let f=e(this,G)===0?void 0:e(this,$).get(t);if(f===void 0)f=e(this,G)===0?e(this,Y):e(this,At).length!==0?e(this,At).pop():e(this,G)===e(this,yt)?h(this,y,Pi).call(this,false):e(this,G),e(this,P)[f]=t,e(this,O)[f]=i$1,e(this,$).set(t,f),e(this,it)[e(this,Y)]=f,e(this,pt)[f]=e(this,Y),g(this,Y,f),i(this,G)._++,e(this,Me).call(this,f,d,l),l&&(l.set="add"),u=false,e(this,Te)&&((w=e(this,de))==null||w.call(this,i$1,t,"add"));else {h(this,y,qe).call(this,f);let x=e(this,O)[f];if(i$1!==x){if(e(this,ie)&&h(this,y,W).call(this,x)){x.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:v}=x;v!==void 0&&!o&&(e(this,Mt)&&((S=e(this,kt))==null||S.call(this,v,t,"set")),e(this,st)&&e(this,K)?.push([v,t,"set"]));}else o||(e(this,Mt)&&((E=e(this,kt))==null||E.call(this,x,t,"set")),e(this,st)&&e(this,K)?.push([x,t,"set"]));if(e(this,me).call(this,f),e(this,Me).call(this,f,d,l),e(this,O)[f]=i$1,l){l.set="replace";let v=x&&h(this,y,W).call(this,x)?x.__staleWhileFetching:x;v!==void 0&&(l.oldValue=v);}}else l&&(l.set="update");e(this,Te)&&this.onInsert?.(i$1,t,i$1===x?"update":"replace");}if(h$1!==0&&!e(this,ft)&&h(this,y,os).call(this),e(this,ft)&&(u||e(this,ti).call(this,f,h$1,n),l&&e(this,Ut).call(this,l,f)),!o&&e(this,st)&&e(this,K)){let x=e(this,K),v;for(;v=x?.shift();)(b=e(this,Rt))==null||b.call(this,...v);}return this}pop(){var t;try{for(;e(this,G);){let i=e(this,O)[e(this,tt)];if(h(this,y,Pi).call(this,!0),h(this,y,W).call(this,i)){if(i.__staleWhileFetching)return i.__staleWhileFetching}else if(i!==void 0)return i}}finally{if(e(this,st)&&e(this,K)){let i=e(this,K),s;for(;s=i?.shift();)(t=e(this,Rt))==null||t.call(this,...s);}}}has(t,i={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:h$1}=i,n=e(this,$).get(t);if(n!==void 0){let o=e(this,O)[n];if(h(this,y,W).call(this,o)&&o.__staleWhileFetching===void 0)return false;if(e(this,gt).call(this,n))h$1&&(h$1.has="stale",e(this,Ut).call(this,h$1,n));else return s&&e(this,ge).call(this,n),h$1&&(h$1.has="hit",e(this,Ut).call(this,h$1,n)),true}else h$1&&(h$1.has="miss");return false}peek(t,i={}){let{allowStale:s=this.allowStale}=i,h$1=e(this,$).get(t);if(h$1===void 0||!s&&e(this,gt).call(this,h$1))return;let n=e(this,O)[h$1];return h(this,y,W).call(this,n)?n.__staleWhileFetching:n}async fetch(t,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:h$1=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:l=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:d=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:w=this.allowStaleOnFetchRejection,ignoreFetchAbort:S=this.ignoreFetchAbort,allowStaleOnFetchAbort:E=this.allowStaleOnFetchAbort,context:b,forceRefresh:x=false,status:v,signal:R}=i;if(!e(this,ie))return v&&(v.fetch="get"),this.get(t,{allowStale:s,updateAgeOnGet:h$1,noDeleteOnStaleGet:n,status:v});let A={allowStale:s,updateAgeOnGet:h$1,noDeleteOnStaleGet:n,ttl:o,noDisposeOnSet:a,size:l,sizeCalculation:u,noUpdateTTL:d,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:w,allowStaleOnFetchAbort:E,ignoreFetchAbort:S,status:v,signal:R},T=e(this,$).get(t);if(T===void 0){v&&(v.fetch="miss");let M=h(this,y,ji).call(this,t,T,A,b);return M.__returned=M}else {let M=e(this,O)[T];if(h(this,y,W).call(this,M)){let B=s&&M.__staleWhileFetching!==void 0;return v&&(v.fetch="inflight",B&&(v.returnedStale=true)),B?M.__staleWhileFetching:M.__returned=M}let F=e(this,gt).call(this,T);if(!x&&!F)return v&&(v.fetch="hit"),h(this,y,qe).call(this,T),h$1&&e(this,ge).call(this,T),v&&e(this,Ut).call(this,v,T),M;let j=h(this,y,ji).call(this,t,T,A,b),N=j.__staleWhileFetching!==void 0&&s;return v&&(v.fetch=F?"stale":"refresh",N&&F&&(v.returnedStale=true)),N?j.__staleWhileFetching:j.__returned=j}}async forceFetch(t,i={}){let s=await this.fetch(t,i);if(s===void 0)throw new Error("fetch() returned undefined");return s}memo(t,i={}){let s=e(this,Fe);if(!s)throw new Error("no memoMethod provided to constructor");let{context:h,forceRefresh:n,...o}=i,a=this.get(t,o);if(!n&&a!==void 0)return a;let l=s(t,a,{options:o,context:h});return this.set(t,l,o),l}get(t,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:h$1=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:o}=i,a=e(this,$).get(t);if(a!==void 0){let l=e(this,O)[a],u=h(this,y,W).call(this,l);return o&&e(this,Ut).call(this,o,a),e(this,gt).call(this,a)?(o&&(o.get="stale"),u?(o&&s&&l.__staleWhileFetching!==void 0&&(o.returnedStale=true),s?l.__staleWhileFetching:void 0):(n||h(this,y,Qt).call(this,t,"expire"),o&&s&&(o.returnedStale=true),s?l:void 0)):(o&&(o.get="hit"),u?l.__staleWhileFetching:(h(this,y,qe).call(this,a),h$1&&e(this,ge).call(this,a),l))}else o&&(o.get="miss");}delete(t){return h(this,y,Qt).call(this,t,"delete")}clear(){return h(this,y,cs).call(this,"delete")}},yt=new WeakMap,ut=new WeakMap,kt=new WeakMap,de=new WeakMap,Rt=new WeakMap,Ae=new WeakMap,Fe=new WeakMap,Ct=new WeakMap,G=new WeakMap,Ot=new WeakMap,$=new WeakMap,P=new WeakMap,O=new WeakMap,it=new WeakMap,pt=new WeakMap,tt=new WeakMap,Y=new WeakMap,At=new WeakMap,K=new WeakMap,Ft=new WeakMap,Tt=new WeakMap,ft=new WeakMap,dt=new WeakMap,Mt=new WeakMap,ie=new WeakMap,st=new WeakMap,Te=new WeakMap,y=new WeakSet,os=function(){let t=new Di(e(this,yt)),i=new Di(e(this,yt));g(this,ft,t),g(this,Tt,i);let s=this.ttlAutopurge?new Array(e(this,yt)):void 0;g(this,dt,s),g(this,ti,(o,a,l=e(this,Ct).now())=>{if(i[o]=a!==0?l:0,t[o]=a,s?.[o]&&(clearTimeout(s[o]),s[o]=void 0),a!==0&&s){let u=setTimeout(()=>{e(this,gt).call(this,o)&&h(this,y,Qt).call(this,e(this,P)[o],"expire");},a+1);u.unref&&u.unref(),s[o]=u;}}),g(this,ge,o=>{i[o]=t[o]!==0?e(this,Ct).now():0;}),g(this,Ut,(o,a)=>{if(t[a]){let l=t[a],u=i[a];if(!l||!u)return;o.ttl=l,o.start=u,o.now=h$1||n();let d=o.now-u;o.remainingTTL=l-d;}});let h$1=0,n=()=>{let o=e(this,Ct).now();if(this.ttlResolution>0){h$1=o;let a=setTimeout(()=>h$1=0,this.ttlResolution);a.unref&&a.unref();}return o};this.getRemainingTTL=o=>{let a=e(this,$).get(o);if(a===void 0)return 0;let l=t[a],u=i[a];if(!l||!u)return 1/0;let d=(h$1||n())-u;return l-d},g(this,gt,o=>{let a=i[o],l=t[o];return !!l&&!!a&&(h$1||n())-a>l});},ge=new WeakMap,Ut=new WeakMap,ti=new WeakMap,gt=new WeakMap,Dr=function(){let t=new Di(e(this,yt));g(this,Ot,0),g(this,Ft,t),g(this,me,i=>{g(this,Ot,e(this,Ot)-t[i]),t[i]=0;}),g(this,ei,(i,s,h$1,n)=>{if(h(this,y,W).call(this,s))return 0;if(!Yt(h$1))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(h$1=n(s,i),!Yt(h$1))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return h$1}),g(this,Me,(i,s,h$1)=>{if(t[i]=s,e(this,ut)){let n=e(this,ut)-t[i];for(;e(this,Ot)>n;)h(this,y,Pi).call(this,true);}g(this,Ot,e(this,Ot)+t[i]),h$1&&(h$1.entrySize=s,h$1.totalCalculatedSize=e(this,Ot));});},me=new WeakMap,Me=new WeakMap,ei=new WeakMap,Kt=function*({allowStale:t=this.allowStale}={}){if(e(this,G))for(let i=e(this,Y);!(!h(this,y,as).call(this,i)||((t||!e(this,gt).call(this,i))&&(yield i),i===e(this,tt)));)i=e(this,pt)[i];},Xt=function*({allowStale:t=this.allowStale}={}){if(e(this,G))for(let i=e(this,tt);!(!h(this,y,as).call(this,i)||((t||!e(this,gt).call(this,i))&&(yield i),i===e(this,Y)));)i=e(this,it)[i];},as=function(t){return t!==void 0&&e(this,$).get(e(this,P)[t])===t},Pi=function(t){var n;let i$1=e(this,tt),s=e(this,P)[i$1],h$1=e(this,O)[i$1];return e(this,ie)&&h(this,y,W).call(this,h$1)?h$1.__abortController.abort(new Error("evicted")):(e(this,Mt)||e(this,st))&&(e(this,Mt)&&((n=e(this,kt))==null||n.call(this,h$1,s,"evict")),e(this,st)&&e(this,K)?.push([h$1,s,"evict"])),e(this,me).call(this,i$1),e(this,dt)?.[i$1]&&(clearTimeout(e(this,dt)[i$1]),e(this,dt)[i$1]=void 0),t&&(e(this,P)[i$1]=void 0,e(this,O)[i$1]=void 0,e(this,At).push(i$1)),e(this,G)===1?(g(this,tt,g(this,Y,0)),e(this,At).length=0):g(this,tt,e(this,it)[i$1]),e(this,$).delete(s),i(this,G)._--,i$1},ji=function(t,i,s,h$1){let n=i===void 0?void 0:e(this,O)[i];if(h(this,y,W).call(this,n))return n;let o=new Ui,{signal:a}=s;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let l={signal:o.signal,options:s,context:h$1},u=(b,x=false)=>{let{aborted:v}=o.signal,R=s.ignoreFetchAbort&&b!==void 0,A=s.ignoreFetchAbort||!!(s.allowStaleOnFetchAbort&&b!==void 0);if(s.status&&(v&&!x?(s.status.fetchAborted=true,s.status.fetchError=o.signal.reason,R&&(s.status.fetchAbortIgnored=true)):s.status.fetchResolved=true),v&&!R&&!x)return f(o.signal.reason,A);let T=S,M=e(this,O)[i];return (M===S||R&&x&&M===void 0)&&(b===void 0?T.__staleWhileFetching!==void 0?e(this,O)[i]=T.__staleWhileFetching:h(this,y,Qt).call(this,t,"fetch"):(s.status&&(s.status.fetchUpdated=true),this.set(t,b,l.options))),b},d=b=>(s.status&&(s.status.fetchRejected=true,s.status.fetchError=b),f(b,false)),f=(b,x)=>{let{aborted:v}=o.signal,R=v&&s.allowStaleOnFetchAbort,A=R||s.allowStaleOnFetchRejection,T=A||s.noDeleteOnFetchRejection,M=S;if(e(this,O)[i]===S&&(!T||!x&&M.__staleWhileFetching===void 0?h(this,y,Qt).call(this,t,"fetch"):R||(e(this,O)[i]=M.__staleWhileFetching)),A)return s.status&&M.__staleWhileFetching!==void 0&&(s.status.returnedStale=true),M.__staleWhileFetching;if(M.__returned===M)throw b},w=(b,x)=>{var R;let v=(R=e(this,Ae))==null?void 0:R.call(this,t,n,l);v&&v instanceof Promise&&v.then(A=>b(A===void 0?void 0:A),x),o.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(b(void 0),s.allowStaleOnFetchAbort&&(b=A=>u(A,true)));});};s.status&&(s.status.fetchDispatched=true);let S=new Promise(w).then(u,d),E=Object.assign(S,{__abortController:o,__staleWhileFetching:n,__returned:void 0});return i===void 0?(this.set(t,E,{...l.options,status:void 0}),i=e(this,$).get(t)):e(this,O)[i]=E,E},W=function(t){if(!e(this,ie))return false;let i=t;return !!i&&i instanceof Promise&&i.hasOwnProperty("__staleWhileFetching")&&i.__abortController instanceof Ui},ls=function(t,i){e(this,pt)[i]=t,e(this,it)[t]=i;},qe=function(t){t!==e(this,Y)&&(t===e(this,tt)?g(this,tt,e(this,it)[t]):h(this,y,ls).call(this,e(this,pt)[t],e(this,it)[t]),h(this,y,ls).call(this,e(this,Y),t),g(this,Y,t));},Qt=function(t,i$1){var h$1,n;let s=false;if(e(this,G)!==0){let o=e(this,$).get(t);if(o!==void 0)if(e(this,dt)?.[o]&&(clearTimeout(e(this,dt)?.[o]),e(this,dt)[o]=void 0),s=true,e(this,G)===1)h(this,y,cs).call(this,i$1);else {e(this,me).call(this,o);let a=e(this,O)[o];if(h(this,y,W).call(this,a)?a.__abortController.abort(new Error("deleted")):(e(this,Mt)||e(this,st))&&(e(this,Mt)&&((h$1=e(this,kt))==null||h$1.call(this,a,t,i$1)),e(this,st)&&e(this,K)?.push([a,t,i$1])),e(this,$).delete(t),e(this,P)[o]=void 0,e(this,O)[o]=void 0,o===e(this,Y))g(this,Y,e(this,pt)[o]);else if(o===e(this,tt))g(this,tt,e(this,it)[o]);else {let l=e(this,pt)[o];e(this,it)[l]=e(this,it)[o];let u=e(this,it)[o];e(this,pt)[u]=e(this,pt)[o];}i(this,G)._--,e(this,At).push(o);}}if(e(this,st)&&e(this,K)?.length){let o=e(this,K),a;for(;a=o?.shift();)(n=e(this,Rt))==null||n.call(this,...a);}return s},cs=function(t){var i,s;for(let h$1 of h(this,y,Xt).call(this,{allowStale:true})){let n=e(this,O)[h$1];if(h(this,y,W).call(this,n))n.__abortController.abort(new Error("deleted"));else {let o=e(this,P)[h$1];e(this,Mt)&&((i=e(this,kt))==null||i.call(this,n,o,t)),e(this,st)&&e(this,K)?.push([n,o,t]);}}if(e(this,$).clear(),e(this,O).fill(void 0),e(this,P).fill(void 0),e(this,ft)&&e(this,Tt)){e(this,ft).fill(0),e(this,Tt).fill(0);for(let h of e(this,dt)??[])h!==void 0&&clearTimeout(h);e(this,dt)?.fill(void 0);}if(e(this,Ft)&&e(this,Ft).fill(0),g(this,tt,0),g(this,Y,0),e(this,At).length=0,g(this,Ot,0),g(this,G,0),e(this,st)&&e(this,K)){let h=e(this,K),n;for(;n=h?.shift();)(s=e(this,Rt))==null||s.call(this,...n);}},Le),Ws=typeof process=="object"&&process?process:{stdout:null,stderr:null},Wn=e=>!!e&&typeof e=="object"&&(e instanceof Gi||e instanceof Pr||Dn(e)||Pn(e)),Dn=e=>!!e&&typeof e=="object"&&e instanceof EventEmitter&&typeof e.pipe=="function"&&e.pipe!==Pr.Writable.prototype.pipe,Pn=e=>!!e&&typeof e=="object"&&e instanceof EventEmitter&&typeof e.write=="function"&&typeof e.end=="function",_t=Symbol("EOF"),$t=Symbol("maybeEmitEnd"),Vt=Symbol("emittedEnd"),Ci=Symbol("emittingEnd"),Be=Symbol("emittedError"),Oi=Symbol("closed"),Ds=Symbol("read"),Ai=Symbol("flush"),Ps=Symbol("flushChunk"),Et=Symbol("encoding"),ke=Symbol("decoder"),J=Symbol("flowing"),Ue=Symbol("paused"),Re=Symbol("resume"),q=Symbol("buffer"),et=Symbol("pipes"),Z=Symbol("bufferLength"),Xi=Symbol("bufferPush"),Fi=Symbol("bufferShift"),Q=Symbol("objectMode"),z=Symbol("destroyed"),Qi=Symbol("error"),ts=Symbol("emitData"),js=Symbol("emitEnd"),es=Symbol("emitEnd2"),Wt=Symbol("async"),is=Symbol("abort"),Ti=Symbol("aborted"),Ge=Symbol("signal"),le=Symbol("dataListeners"),ct=Symbol("discarded"),Ie=e=>Promise.resolve().then(e),jn=e=>e(),Nn=e=>e==="end"||e==="finish"||e==="prefinish",zn=e=>e instanceof ArrayBuffer||!!e&&typeof e=="object"&&e.constructor&&e.constructor.name==="ArrayBuffer"&&e.byteLength>=0,_n=e=>!Buffer.isBuffer(e)&&ArrayBuffer.isView(e),jr=class{constructor(e,t,i){d(this,"src");d(this,"dest");d(this,"opts");d(this,"ondrain");this.src=e,this.dest=t,this.opts=i,this.ondrain=()=>e[Re](),this.dest.on("drain",this.ondrain);}unpipe(){this.dest.removeListener("drain",this.ondrain);}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end();}},$n=class extends jr{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe();}constructor(e,t,i){super(e,t,i),this.proxyErrors=s=>this.dest.emit("error",s),e.on("error",this.proxyErrors);}},Bn=e=>!!e.objectMode,Un=e=>!e.objectMode&&!!e.encoding&&e.encoding!=="buffer",Vs,Ys,Ks,Xs,Qs,tr,er,ir,sr,rr,hr,nr,or,ar,lr,cr,ur,pr,fr,Gi=class extends EventEmitter{constructor(...t){let i=t[0]||{};super();d(this,fr,false);d(this,pr,false);d(this,ur,[]);d(this,cr,[]);d(this,lr);d(this,ar);d(this,or);d(this,nr);d(this,hr,false);d(this,rr,false);d(this,sr,false);d(this,ir,false);d(this,er,null);d(this,tr,0);d(this,Qs,false);d(this,Xs);d(this,Ks,false);d(this,Ys,0);d(this,Vs,false);d(this,"writable",true);d(this,"readable",true);if(i.objectMode&&typeof i.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");Bn(i)?(this[Q]=true,this[Et]=null):Un(i)?(this[Et]=i.encoding,this[Q]=false):(this[Q]=false,this[Et]=null),this[Wt]=!!i.async,this[ke]=this[Et]?new StringDecoder(this[Et]):null,i&&i.debugExposeBuffer===true&&Object.defineProperty(this,"buffer",{get:()=>this[q]}),i&&i.debugExposePipes===true&&Object.defineProperty(this,"pipes",{get:()=>this[et]});let{signal:s}=i;s&&(this[Ge]=s,s.aborted?this[is]():s.addEventListener("abort",()=>this[is]()));}get bufferLength(){return this[Z]}get encoding(){return this[Et]}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[Q]}set objectMode(t){throw new Error("objectMode must be set at instantiation time")}get async(){return this[Wt]}set async(t){this[Wt]=this[Wt]||!!t;}[(fr=J,pr=Ue,ur=et,cr=q,lr=Q,ar=Et,or=Wt,nr=ke,hr=_t,rr=Vt,sr=Ci,ir=Oi,er=Be,tr=Z,Qs=z,Xs=Ge,Ks=Ti,Ys=le,Vs=ct,is)](){this[Ti]=true,this.emit("abort",this[Ge]?.reason),this.destroy(this[Ge]?.reason);}get aborted(){return this[Ti]}set aborted(t){}write(t,i,s){if(this[Ti])return false;if(this[_t])throw new Error("write after end");if(this[z])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),true;typeof i=="function"&&(s=i,i="utf8"),i||(i="utf8");let h=this[Wt]?Ie:jn;if(!this[Q]&&!Buffer.isBuffer(t)){if(_n(t))t=Buffer.from(t.buffer,t.byteOffset,t.byteLength);else if(zn(t))t=Buffer.from(t);else if(typeof t!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[Q]?(this[J]&&this[Z]!==0&&this[Ai](true),this[J]?this.emit("data",t):this[Xi](t),this[Z]!==0&&this.emit("readable"),s&&h(s),this[J]):t.length?(typeof t=="string"&&!(i===this[Et]&&!this[ke]?.lastNeed)&&(t=Buffer.from(t,i)),Buffer.isBuffer(t)&&this[Et]&&(t=this[ke].write(t)),this[J]&&this[Z]!==0&&this[Ai](true),this[J]?this.emit("data",t):this[Xi](t),this[Z]!==0&&this.emit("readable"),s&&h(s),this[J]):(this[Z]!==0&&this.emit("readable"),s&&h(s),this[J])}read(t){if(this[z])return null;if(this[ct]=false,this[Z]===0||t===0||t&&t>this[Z])return this[$t](),null;this[Q]&&(t=null),this[q].length>1&&!this[Q]&&(this[q]=[this[Et]?this[q].join(""):Buffer.concat(this[q],this[Z])]);let i=this[Ds](t||null,this[q][0]);return this[$t](),i}[Ds](t,i){if(this[Q])this[Fi]();else {let s=i;t===s.length||t===null?this[Fi]():typeof s=="string"?(this[q][0]=s.slice(t),i=s.slice(0,t),this[Z]-=t):(this[q][0]=s.subarray(t),i=s.subarray(0,t),this[Z]-=t);}return this.emit("data",i),!this[q].length&&!this[_t]&&this.emit("drain"),i}end(t,i,s){return typeof t=="function"&&(s=t,t=void 0),typeof i=="function"&&(s=i,i="utf8"),t!==void 0&&this.write(t,i),s&&this.once("end",s),this[_t]=true,this.writable=false,(this[J]||!this[Ue])&&this[$t](),this}[Re](){this[z]||(!this[le]&&!this[et].length&&(this[ct]=true),this[Ue]=false,this[J]=true,this.emit("resume"),this[q].length?this[Ai]():this[_t]?this[$t]():this.emit("drain"));}resume(){return this[Re]()}pause(){this[J]=false,this[Ue]=true,this[ct]=false;}get destroyed(){return this[z]}get flowing(){return this[J]}get paused(){return this[Ue]}[Xi](t){this[Q]?this[Z]+=1:this[Z]+=t.length,this[q].push(t);}[Fi](){return this[Q]?this[Z]-=1:this[Z]-=this[q][0].length,this[q].shift()}[Ai](t=false){do;while(this[Ps](this[Fi]())&&this[q].length);!t&&!this[q].length&&!this[_t]&&this.emit("drain");}[Ps](t){return this.emit("data",t),this[J]}pipe(t,i){if(this[z])return t;this[ct]=false;let s=this[Vt];return i=i||{},t===Ws.stdout||t===Ws.stderr?i.end=false:i.end=i.end!==false,i.proxyErrors=!!i.proxyErrors,s?i.end&&t.end():(this[et].push(i.proxyErrors?new $n(this,t,i):new jr(this,t,i)),this[Wt]?Ie(()=>this[Re]()):this[Re]()),t}unpipe(t){let i=this[et].find(s=>s.dest===t);i&&(this[et].length===1?(this[J]&&this[le]===0&&(this[J]=false),this[et]=[]):this[et].splice(this[et].indexOf(i),1),i.unpipe());}addListener(t,i){return this.on(t,i)}on(t,i){let s=super.on(t,i);if(t==="data")this[ct]=false,this[le]++,!this[et].length&&!this[J]&&this[Re]();else if(t==="readable"&&this[Z]!==0)super.emit("readable");else if(Nn(t)&&this[Vt])super.emit(t),this.removeAllListeners(t);else if(t==="error"&&this[Be]){let h=i;this[Wt]?Ie(()=>h.call(this,this[Be])):h.call(this,this[Be]);}return s}removeListener(t,i){return this.off(t,i)}off(t,i){let s=super.off(t,i);return t==="data"&&(this[le]=this.listeners("data").length,this[le]===0&&!this[ct]&&!this[et].length&&(this[J]=false)),s}removeAllListeners(t){let i=super.removeAllListeners(t);return (t==="data"||t===void 0)&&(this[le]=0,!this[ct]&&!this[et].length&&(this[J]=false)),i}get emittedEnd(){return this[Vt]}[$t](){!this[Ci]&&!this[Vt]&&!this[z]&&this[q].length===0&&this[_t]&&(this[Ci]=true,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Oi]&&this.emit("close"),this[Ci]=false);}emit(t,...i){let s=i[0];if(t!=="error"&&t!=="close"&&t!==z&&this[z])return false;if(t==="data")return !this[Q]&&!s?false:this[Wt]?(Ie(()=>this[ts](s)),true):this[ts](s);if(t==="end")return this[js]();if(t==="close"){if(this[Oi]=true,!this[Vt]&&!this[z])return false;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(t==="error"){this[Be]=s,super.emit(Qi,s);let n=!this[Ge]||this.listeners("error").length?super.emit("error",s):false;return this[$t](),n}else if(t==="resume"){let n=super.emit("resume");return this[$t](),n}else if(t==="finish"||t==="prefinish"){let n=super.emit(t);return this.removeAllListeners(t),n}let h=super.emit(t,...i);return this[$t](),h}[ts](t){for(let s of this[et])s.dest.write(t)===false&&this.pause();let i=this[ct]?false:super.emit("data",t);return this[$t](),i}[js](){return this[Vt]?false:(this[Vt]=true,this.readable=false,this[Wt]?(Ie(()=>this[es]()),true):this[es]())}[es](){if(this[ke]){let i=this[ke].end();if(i){for(let s of this[et])s.dest.write(i);this[ct]||super.emit("data",i);}}for(let i of this[et])i.end();let t=super.emit("end");return this.removeAllListeners("end"),t}async collect(){let t=Object.assign([],{dataLength:0});this[Q]||(t.dataLength=0);let i=this.promise();return this.on("data",s=>{t.push(s),this[Q]||(t.dataLength+=s.length);}),await i,t}async concat(){if(this[Q])throw new Error("cannot concat in objectMode");let t=await this.collect();return this[Et]?t.join(""):Buffer.concat(t,t.dataLength)}async promise(){return new Promise((t,i)=>{this.on(z,()=>i(new Error("stream destroyed"))),this.on("error",s=>i(s)),this.on("end",()=>t());})}[Symbol.asyncIterator](){this[ct]=false;let t=false,i=async()=>(this.pause(),t=true,{value:void 0,done:true});return {next:()=>{if(t)return i();let s=this.read();if(s!==null)return Promise.resolve({done:false,value:s});if(this[_t])return i();let h,n,o=d=>{this.off("data",a),this.off("end",l),this.off(z,u),i(),n(d);},a=d=>{this.off("error",o),this.off("end",l),this.off(z,u),this.pause(),h({value:d,done:!!this[_t]});},l=()=>{this.off("error",o),this.off("data",a),this.off(z,u),i(),h({done:true,value:void 0});},u=()=>o(new Error("stream destroyed"));return new Promise((d,f)=>{n=f,h=d,this.once(z,u),this.once("error",o),this.once("end",l),this.once("data",a);})},throw:i,return:i,[Symbol.asyncIterator](){return this},[Symbol.asyncDispose]:async()=>{}}}[Symbol.iterator](){this[ct]=false;let t=false,i=()=>(this.pause(),this.off(Qi,i),this.off(z,i),this.off("end",i),t=true,{done:true,value:void 0}),s=()=>{if(t)return i();let h=this.read();return h===null?i():{done:false,value:h}};return this.once("end",i),this.once(Qi,i),this.once(z,i),{next:s,throw:i,return:i,[Symbol.iterator](){return this},[Symbol.dispose]:()=>{}}}destroy(t){if(this[z])return t?this.emit("error",t):this.emit(z),this;this[z]=true,this[ct]=true,this[q].length=0,this[Z]=0;let i=this;return typeof i.close=="function"&&!this[Oi]&&i.close(),t?this.emit("error",t):this.emit(z),this}static get isStream(){return Wn}},Gn=realpathSync.native,Ze={lstatSync:lstatSync,readdir:readdir$1,readdirSync:readdirSync,readlinkSync:readlinkSync,realpathSync:Gn,promises:{lstat:lstat,readdir:readdir,readlink:readlink,realpath:realpath}},Nr=e=>!e||e===Ze||e===On?Ze:{...Ze,...e,promises:{...Ze.promises,...e.promises||{}}},zr=/^\\\\\?\\([a-z]:)\\?$/i,In=e=>e.replace(/\//g,"\\").replace(zr,"$1\\"),Hn=/[\\\/]/,bt=0,_r=1,$r=2,Dt=4,Br=6,Ur=8,ce=10,Gr=12,wt=15,He=~wt,ss=16,Ns=32,Ve=64,xt=128,Mi=256,Ni=512,zs=Ve|xt|Ni,Jn=1023,rs=e=>e.isFile()?Ur:e.isDirectory()?Dt:e.isSymbolicLink()?ce:e.isCharacterDevice()?$r:e.isBlockDevice()?Br:e.isSocket()?Gr:e.isFIFO()?_r:bt,_s=new Hi({max:2**12}),Ye=e=>{let t=_s.get(e);if(t)return t;let i=e.normalize("NFKD");return _s.set(e,i),i},$s=new Hi({max:2**12}),Li=e=>{let t=$s.get(e);if(t)return t;let i=Ye(e.toLowerCase());return $s.set(e,i),i},Bs=class extends Hi{constructor(){super({max:256});}},qn=class extends Hi{constructor(e=16*1024){super({maxSize:e,sizeCalculation:t=>t.length+1});}},Ir=Symbol("PathScurry setAsCwd"),rt,ii,si,ri,hi,ni,oi,ai,li,ci,ui,pi,fi,di,gi,mi,wi,yi,bi,se,we,jt,Gt,It,Ht,C,ye,Jt,Nt,k,ps,zi,Ke,fs,ds,Xe,_i,gs,ms,$i,Hr,Jr,qr,ws,We,De,Zr,be,dr,at=(dr=class{constructor(e$1,t=bt,i,s,h,n,o){f(this,k);d(this,"name");d(this,"root");d(this,"roots");d(this,"parent");d(this,"nocase");d(this,"isCWD",false);f(this,rt);f(this,ii);f(this,si);f(this,ri);f(this,hi);f(this,ni);f(this,oi);f(this,ai);f(this,li);f(this,ci);f(this,ui);f(this,pi);f(this,fi);f(this,di);f(this,gi);f(this,mi);f(this,wi);f(this,yi);f(this,bi);f(this,se);f(this,we);f(this,jt);f(this,Gt);f(this,It);f(this,Ht);f(this,C);f(this,ye);f(this,Jt);f(this,Nt);f(this,We,[]);f(this,De,false);f(this,be);this.name=e$1,g(this,se,h?Li(e$1):Ye(e$1)),g(this,C,t&Jn),this.nocase=h,this.roots=s,this.root=i||this,g(this,ye,n),g(this,jt,o.fullpath),g(this,It,o.relative),g(this,Ht,o.relativePosix),this.parent=o.parent,this.parent?g(this,rt,e(this.parent,rt)):g(this,rt,Nr(o.fs));}get dev(){return e(this,ii)}get mode(){return e(this,si)}get nlink(){return e(this,ri)}get uid(){return e(this,hi)}get gid(){return e(this,ni)}get rdev(){return e(this,oi)}get blksize(){return e(this,ai)}get ino(){return e(this,li)}get size(){return e(this,ci)}get blocks(){return e(this,ui)}get atimeMs(){return e(this,pi)}get mtimeMs(){return e(this,fi)}get ctimeMs(){return e(this,di)}get birthtimeMs(){return e(this,gi)}get atime(){return e(this,mi)}get mtime(){return e(this,wi)}get ctime(){return e(this,yi)}get birthtime(){return e(this,bi)}get parentPath(){return (this.parent||this).fullpath()}get path(){return this.parentPath}depth(){return e(this,we)!==void 0?e(this,we):this.parent?g(this,we,this.parent.depth()+1):g(this,we,0)}childrenCache(){return e(this,ye)}resolve(e){var s;if(!e)return this;let t=this.getRootString(e),i=e.substring(t.length).split(this.splitSep);return t?h(s=this.getRoot(t),k,ps).call(s,i):h(this,k,ps).call(this,i)}children(){let e$1=e(this,ye).get(this);if(e$1)return e$1;let t=Object.assign([],{provisional:0});return e(this,ye).set(this,t),g(this,C,e(this,C)&~ss),t}child(e$1,t){if(e$1===""||e$1===".")return this;if(e$1==="..")return this.parent||this;let i=this.children(),s=this.nocase?Li(e$1):Ye(e$1);for(let a of i)if(e(a,se)===s)return a;let h=this.parent?this.sep:"",n=e(this,jt)?e(this,jt)+h+e$1:void 0,o=this.newChild(e$1,bt,{...t,parent:this,fullpath:n});return this.canReaddir()||g(o,C,e(o,C)|xt),i.push(o),o}relative(){if(this.isCWD)return "";if(e(this,It)!==void 0)return e(this,It);let e$1=this.name,t=this.parent;if(!t)return g(this,It,this.name);let i=t.relative();return i+(!i||!t.parent?"":this.sep)+e$1}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return "";if(e(this,Ht)!==void 0)return e(this,Ht);let e$1=this.name,t=this.parent;if(!t)return g(this,Ht,this.fullpathPosix());let i=t.relativePosix();return i+(!i||!t.parent?"":"/")+e$1}fullpath(){if(e(this,jt)!==void 0)return e(this,jt);let e$1=this.name,t=this.parent;if(!t)return g(this,jt,this.name);let i=t.fullpath()+(t.parent?this.sep:"")+e$1;return g(this,jt,i)}fullpathPosix(){if(e(this,Gt)!==void 0)return e(this,Gt);if(this.sep==="/")return g(this,Gt,this.fullpath());if(!this.parent){let s=this.fullpath().replace(/\\/g,"/");return /^[a-z]:\//i.test(s)?g(this,Gt,`//?/${s}`):g(this,Gt,s)}let e$1=this.parent,t=e$1.fullpathPosix(),i=t+(!t||!e$1.parent?"":"/")+this.name;return g(this,Gt,i)}isUnknown(){return (e(this,C)&wt)===bt}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return (e(this,C)&wt)===Ur}isDirectory(){return (e(this,C)&wt)===Dt}isCharacterDevice(){return (e(this,C)&wt)===$r}isBlockDevice(){return (e(this,C)&wt)===Br}isFIFO(){return (e(this,C)&wt)===_r}isSocket(){return (e(this,C)&wt)===Gr}isSymbolicLink(){return (e(this,C)&ce)===ce}lstatCached(){return e(this,C)&Ns?this:void 0}readlinkCached(){return e(this,Jt)}realpathCached(){return e(this,Nt)}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(e(this,Jt))return true;if(!this.parent)return false;let e$1=e(this,C)&wt;return !(e$1!==bt&&e$1!==ce||e(this,C)&Mi||e(this,C)&xt)}calledReaddir(){return !!(e(this,C)&ss)}isENOENT(){return !!(e(this,C)&xt)}isNamed(e$1){return this.nocase?e(this,se)===Li(e$1):e(this,se)===Ye(e$1)}async readlink(){let e$1=e(this,Jt);if(e$1)return e$1;if(this.canReadlink()&&this.parent)try{let t=await e(this,rt).promises.readlink(this.fullpath()),i=(await this.parent.realpath())?.resolve(t);if(i)return g(this,Jt,i)}catch(t){h(this,k,ms).call(this,t.code);return}}readlinkSync(){let e$1=e(this,Jt);if(e$1)return e$1;if(this.canReadlink()&&this.parent)try{let t=e(this,rt).readlinkSync(this.fullpath()),i=this.parent.realpathSync()?.resolve(t);if(i)return g(this,Jt,i)}catch(t){h(this,k,ms).call(this,t.code);return}}async lstat(){if((e(this,C)&xt)===0)try{return h(this,k,ws).call(this,await e(this,rt).promises.lstat(this.fullpath())),this}catch(e){h(this,k,gs).call(this,e.code);}}lstatSync(){if((e(this,C)&xt)===0)try{return h(this,k,ws).call(this,e(this,rt).lstatSync(this.fullpath())),this}catch(e){h(this,k,gs).call(this,e.code);}}readdirCB(e$1,t=false){if(!this.canReaddir()){t?e$1(null,[]):queueMicrotask(()=>e$1(null,[]));return}let i=this.children();if(this.calledReaddir()){let h=i.slice(0,i.provisional);t?e$1(null,h):queueMicrotask(()=>e$1(null,h));return}if(e(this,We).push(e$1),e(this,De))return;g(this,De,true);let s=this.fullpath();e(this,rt).readdir(s,{withFileTypes:true},(h$1,n)=>{if(h$1)h(this,k,_i).call(this,h$1.code),i.provisional=0;else {for(let o of n)h(this,k,$i).call(this,o,i);h(this,k,zi).call(this,i);}h(this,k,Zr).call(this,i.slice(0,i.provisional));});}async readdir(){if(!this.canReaddir())return [];let e$1=this.children();if(this.calledReaddir())return e$1.slice(0,e$1.provisional);let t=this.fullpath();if(e(this,be))await e(this,be);else {let i=()=>{};g(this,be,new Promise(s=>i=s));try{for(let s of await e(this,rt).promises.readdir(t,{withFileTypes:!0}))h(this,k,$i).call(this,s,e$1);h(this,k,zi).call(this,e$1);}catch(s){h(this,k,_i).call(this,s.code),e$1.provisional=0;}g(this,be,void 0),i();}return e$1.slice(0,e$1.provisional)}readdirSync(){if(!this.canReaddir())return [];let e$1=this.children();if(this.calledReaddir())return e$1.slice(0,e$1.provisional);let t=this.fullpath();try{for(let i of e(this,rt).readdirSync(t,{withFileTypes:!0}))h(this,k,$i).call(this,i,e$1);h(this,k,zi).call(this,e$1);}catch(i){h(this,k,_i).call(this,i.code),e$1.provisional=0;}return e$1.slice(0,e$1.provisional)}canReaddir(){if(e(this,C)&zs)return false;let e$1=wt&e(this,C);return e$1===bt||e$1===Dt||e$1===ce}shouldWalk(e$1,t){return (e(this,C)&Dt)===Dt&&!(e(this,C)&zs)&&!e$1.has(this)&&(!t||t(this))}async realpath(){if(e(this,Nt))return e(this,Nt);if(!((Ni|Mi|xt)&e(this,C)))try{let e$1=await e(this,rt).promises.realpath(this.fullpath());return g(this,Nt,this.resolve(e$1))}catch{h(this,k,ds).call(this);}}realpathSync(){if(e(this,Nt))return e(this,Nt);if(!((Ni|Mi|xt)&e(this,C)))try{let e$1=e(this,rt).realpathSync(this.fullpath());return g(this,Nt,this.resolve(e$1))}catch{h(this,k,ds).call(this);}}[Ir](e){if(e===this)return;e.isCWD=false,this.isCWD=true;let t=new Set([]),i=[],s=this;for(;s&&s.parent;)t.add(s),g(s,It,i.join(this.sep)),g(s,Ht,i.join("/")),s=s.parent,i.push("..");for(s=e;s&&s.parent&&!t.has(s);)g(s,It,void 0),g(s,Ht,void 0),s=s.parent;}},rt=new WeakMap,ii=new WeakMap,si=new WeakMap,ri=new WeakMap,hi=new WeakMap,ni=new WeakMap,oi=new WeakMap,ai=new WeakMap,li=new WeakMap,ci=new WeakMap,ui=new WeakMap,pi=new WeakMap,fi=new WeakMap,di=new WeakMap,gi=new WeakMap,mi=new WeakMap,wi=new WeakMap,yi=new WeakMap,bi=new WeakMap,se=new WeakMap,we=new WeakMap,jt=new WeakMap,Gt=new WeakMap,It=new WeakMap,Ht=new WeakMap,C=new WeakMap,ye=new WeakMap,Jt=new WeakMap,Nt=new WeakMap,k=new WeakSet,ps=function(e){let t=this;for(let i of e)t=t.child(i);return t},zi=function(e$1){var t;g(this,C,e(this,C)|ss);for(let i=e$1.provisional;i<e$1.length;i++){let s=e$1[i];s&&h(t=s,k,Ke).call(t);}},Ke=function(){e(this,C)&xt||(g(this,C,(e(this,C)|xt)&He),h(this,k,fs).call(this));},fs=function(){var t;let e=this.children();e.provisional=0;for(let i of e)h(t=i,k,Ke).call(t);},ds=function(){g(this,C,e(this,C)|Ni),h(this,k,Xe).call(this);},Xe=function(){if(e(this,C)&Ve)return;let e$1=e(this,C);(e$1&wt)===Dt&&(e$1&=He),g(this,C,e$1|Ve),h(this,k,fs).call(this);},_i=function(e=""){e==="ENOTDIR"||e==="EPERM"?h(this,k,Xe).call(this):e==="ENOENT"?h(this,k,Ke).call(this):this.children().provisional=0;},gs=function(e=""){var t;e==="ENOTDIR"?h(t=this.parent,k,Xe).call(t):e==="ENOENT"&&h(this,k,Ke).call(this);},ms=function(e$1=""){var i;let t=e(this,C);t|=Mi,e$1==="ENOENT"&&(t|=xt),(e$1==="EINVAL"||e$1==="UNKNOWN")&&(t&=He),g(this,C,t),e$1==="ENOTDIR"&&this.parent&&h(i=this.parent,k,Xe).call(i);},$i=function(e,t){return h(this,k,Jr).call(this,e,t)||h(this,k,Hr).call(this,e,t)},Hr=function(e$1,t){let i=rs(e$1),s=this.newChild(e$1.name,i,{parent:this}),h=e(s,C)&wt;return h!==Dt&&h!==ce&&h!==bt&&g(s,C,e(s,C)|Ve),t.unshift(s),t.provisional++,s},Jr=function(e$1,t){for(let i=t.provisional;i<t.length;i++){let s=t[i];if((this.nocase?Li(e$1.name):Ye(e$1.name))===e(s,se))return h(this,k,qr).call(this,e$1,s,i,t)}},qr=function(e$1,t,i,s){let h=t.name;return g(t,C,e(t,C)&He|rs(e$1)),h!==e$1.name&&(t.name=e$1.name),i!==s.provisional&&(i===s.length-1?s.pop():s.splice(i,1),s.unshift(t)),s.provisional++,t},ws=function(e$1){let{atime:t,atimeMs:i,birthtime:s,birthtimeMs:h,blksize:n,blocks:o,ctime:a,ctimeMs:l,dev:u,gid:d,ino:f,mode:w,mtime:S,mtimeMs:E,nlink:b,rdev:x,size:v,uid:R}=e$1;g(this,mi,t),g(this,pi,i),g(this,bi,s),g(this,gi,h),g(this,ai,n),g(this,ui,o),g(this,yi,a),g(this,di,l),g(this,ii,u),g(this,ni,d),g(this,li,f),g(this,si,w),g(this,wi,S),g(this,fi,E),g(this,ri,b),g(this,oi,x),g(this,ci,v),g(this,hi,R);let A=rs(e$1);g(this,C,e(this,C)&He|A|Ns),A!==bt&&A!==Dt&&A!==ce&&g(this,C,e(this,C)|Ve);},We=new WeakMap,De=new WeakMap,Zr=function(e$1){g(this,De,false);let t=e(this,We).slice();e(this,We).length=0,t.forEach(i=>i(null,e$1));},be=new WeakMap,dr),Vr=class Yr extends at{constructor(i,s=bt,h,n,o,a,l){super(i,s,h,n,o,a,l);d(this,"sep","\\");d(this,"splitSep",Hn);}newChild(i,s=bt,h={}){return new Yr(i,s,this.root,this.roots,this.nocase,this.childrenCache(),h)}getRootString(i){return win32.parse(i).root}getRoot(i){if(i=In(i.toUpperCase()),i===this.root.name)return this.root;for(let[s,h]of Object.entries(this.roots))if(this.sameRoot(i,s))return this.roots[i]=h;return this.roots[i]=new Es(i,this).root}sameRoot(i,s=this.root.name){return i=i.toUpperCase().replace(/\//g,"\\").replace(zr,"$1\\"),i===s}},Kr=class Xr extends at{constructor(i,s=bt,h,n,o,a,l){super(i,s,h,n,o,a,l);d(this,"splitSep","/");d(this,"sep","/");}getRootString(i){return i.startsWith("/")?"/":""}getRoot(i){return this.root}newChild(i,s=bt,h={}){return new Xr(i,s,this.root,this.roots,this.nocase,this.childrenCache(),h)}},Pe,je,Si,vi,gr,Qr=(gr=class{constructor(e$1=process.cwd(),t,i,{nocase:s,childrenCacheSize:h=16*1024,fs:n=Ze}={}){d(this,"root");d(this,"rootPath");d(this,"roots");d(this,"cwd");f(this,Pe);f(this,je);f(this,Si);d(this,"nocase");f(this,vi);g(this,vi,Nr(n)),(e$1 instanceof URL||e$1.startsWith("file://"))&&(e$1=fileURLToPath(e$1));let o=t.resolve(e$1);this.roots=Object.create(null),this.rootPath=this.parseRootPath(o),g(this,Pe,new Bs),g(this,je,new Bs),g(this,Si,new qn(h));let a=o.substring(this.rootPath.length).split(i);if(a.length===1&&!a[0]&&a.pop(),s===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=s,this.root=this.newRoot(e(this,vi)),this.roots[this.rootPath]=this.root;let l=this.root,u=a.length-1,d$1=t.sep,f$1=this.rootPath,w=false;for(let S of a){let E=u--;l=l.child(S,{relative:new Array(E).fill("..").join(d$1),relativePosix:new Array(E).fill("..").join("/"),fullpath:f$1+=(w?"":d$1)+S}),w=true;}this.cwd=l;}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return e(this,Si)}resolve(...e$1){let t="";for(let h=e$1.length-1;h>=0;h--){let n=e$1[h];if(!(!n||n===".")&&(t=t?`${n}/${t}`:n,this.isAbsolute(n)))break}let i=e(this,Pe).get(t);if(i!==void 0)return i;let s=this.cwd.resolve(t).fullpath();return e(this,Pe).set(t,s),s}resolvePosix(...e$1){let t="";for(let h=e$1.length-1;h>=0;h--){let n=e$1[h];if(!(!n||n===".")&&(t=t?`${n}/${t}`:n,this.isAbsolute(n)))break}let i=e(this,je).get(t);if(i!==void 0)return i;let s=this.cwd.resolve(t).fullpathPosix();return e(this,je).set(t,s),s}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,t={withFileTypes:true}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof at||(t=e,e=this.cwd);let{withFileTypes:i}=t;if(e.canReaddir()){let s=await e.readdir();return i?s:s.map(h=>h.name)}else return []}readdirSync(e=this.cwd,t={withFileTypes:true}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof at||(t=e,e=this.cwd);let{withFileTypes:i=true}=t;return e.canReaddir()?i?e.readdirSync():e.readdirSync().map(s=>s.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:t}={withFileTypes:false}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof at||(t=e.withFileTypes,e=this.cwd);let i=await e.readlink();return t?i:i?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:t}={withFileTypes:false}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof at||(t=e.withFileTypes,e=this.cwd);let i=e.readlinkSync();return t?i:i?.fullpath()}async realpath(e=this.cwd,{withFileTypes:t}={withFileTypes:false}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof at||(t=e.withFileTypes,e=this.cwd);let i=await e.realpath();return t?i:i?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:t}={withFileTypes:false}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof at||(t=e.withFileTypes,e=this.cwd);let i=e.realpathSync();return t?i:i?.fullpath()}async walk(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof at||(t=e,e=this.cwd);let{withFileTypes:i=true,follow:s=false,filter:h,walkFilter:n}=t,o=[];(!h||h(e))&&o.push(i?e:e.fullpath());let a=new Set,l=(d,f)=>{a.add(d),d.readdirCB((w,S)=>{if(w)return f(w);let E=S.length;if(!E)return f();let b=()=>{--E===0&&f();};for(let x of S)(!h||h(x))&&o.push(i?x:x.fullpath()),s&&x.isSymbolicLink()?x.realpath().then(v=>v?.isUnknown()?v.lstat():v).then(v=>v?.shouldWalk(a,n)?l(v,b):b()):x.shouldWalk(a,n)?l(x,b):b();},true);},u=e;return new Promise((d,f)=>{l(u,w=>{if(w)return f(w);d(o);});})}walkSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof at||(t=e,e=this.cwd);let{withFileTypes:i=true,follow:s=false,filter:h,walkFilter:n}=t,o=[];(!h||h(e))&&o.push(i?e:e.fullpath());let a=new Set([e]);for(let l of a){let u=l.readdirSync();for(let d of u){(!h||h(d))&&o.push(i?d:d.fullpath());let f=d;if(d.isSymbolicLink()){if(!(s&&(f=d.realpathSync())))continue;f.isUnknown()&&f.lstatSync();}f.shouldWalk(a,n)&&a.add(f);}}return o}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,t={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof at||(t=e,e=this.cwd),this.stream(e,t)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof at||(t=e,e=this.cwd);let{withFileTypes:i=true,follow:s=false,filter:h,walkFilter:n}=t;(!h||h(e))&&(yield i?e:e.fullpath());let o=new Set([e]);for(let a of o){let l=a.readdirSync();for(let u of l){(!h||h(u))&&(yield i?u:u.fullpath());let d=u;if(u.isSymbolicLink()){if(!(s&&(d=u.realpathSync())))continue;d.isUnknown()&&d.lstatSync();}d.shouldWalk(o,n)&&o.add(d);}}}stream(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof at||(t=e,e=this.cwd);let{withFileTypes:i=true,follow:s=false,filter:h,walkFilter:n}=t,o=new Gi({objectMode:true});(!h||h(e))&&o.write(i?e:e.fullpath());let a=new Set,l=[e],u=0,d=()=>{let f=false;for(;!f;){let w=l.shift();if(!w){u===0&&o.end();return}u++,a.add(w);let S=(b,x,v=false)=>{if(b)return o.emit("error",b);if(s&&!v){let R=[];for(let A of x)A.isSymbolicLink()&&R.push(A.realpath().then(T=>T?.isUnknown()?T.lstat():T));if(R.length){Promise.all(R).then(()=>S(null,x,true));return}}for(let R of x)R&&(!h||h(R))&&(o.write(i?R:R.fullpath())||(f=true));u--;for(let R of x){let A=R.realpathCached()||R;A.shouldWalk(a,n)&&l.push(A);}f&&!o.flowing?o.once("drain",d):E||d();},E=true;w.readdirCB(S,true),E=false;}};return d(),o}streamSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof at||(t=e,e=this.cwd);let{withFileTypes:i=true,follow:s=false,filter:h,walkFilter:n}=t,o=new Gi({objectMode:true}),a=new Set;(!h||h(e))&&o.write(i?e:e.fullpath());let l=[e],u=0,d=()=>{let f=false;for(;!f;){let w=l.shift();if(!w){u===0&&o.end();return}u++,a.add(w);let S=w.readdirSync();for(let E of S)(!h||h(E))&&(o.write(i?E:E.fullpath())||(f=true));u--;for(let E of S){let b=E;if(E.isSymbolicLink()){if(!(s&&(b=E.realpathSync())))continue;b.isUnknown()&&b.lstatSync();}b.shouldWalk(a,n)&&l.push(b);}}f&&!o.flowing&&o.once("drain",d);};return d(),o}chdir(e=this.cwd){let t=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[Ir](t);}},Pe=new WeakMap,je=new WeakMap,Si=new WeakMap,vi=new WeakMap,gr),Es=class extends Qr{constructor(t=process.cwd(),i={}){let{nocase:s=true}=i;super(t,win32,"\\",{...i,nocase:s});d(this,"sep","\\");this.nocase=s;for(let h=this.cwd;h;h=h.parent)h.nocase=this.nocase;}parseRootPath(t){return win32.parse(t).root.toUpperCase()}newRoot(t){return new Vr(this.rootPath,Dt,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")||t.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(t)}},xs=class extends Qr{constructor(t=process.cwd(),i={}){let{nocase:s=false}=i;super(t,posix,"/",{...i,nocase:s});d(this,"sep","/");this.nocase=s;}parseRootPath(t){return "/"}newRoot(t){return new Kr(this.rootPath,Dt,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")}},th=class extends xs{constructor(e=process.cwd(),t={}){let{nocase:i=true}=t;super(e,{...t,nocase:i});}};process.platform==="win32"?Vr:Kr;var Zn=process.platform==="win32"?Es:process.platform==="darwin"?th:xs,Vn=e=>e.length>=1,Yn=e=>e.length>=1,Kn=Symbol.for("nodejs.util.inspect.custom"),I,lt,H,Se,Lt,Ei,re,he,ne,Ne,ze,eh=(ze=class{constructor(t,i,s,h){f(this,I);f(this,lt);f(this,H);d(this,"length");f(this,Se);f(this,Lt);f(this,Ei);f(this,re);f(this,he);f(this,ne);f(this,Ne,true);if(!Vn(t))throw new TypeError("empty pattern list");if(!Yn(i))throw new TypeError("empty glob list");if(i.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(g(this,I,t),g(this,lt,i),g(this,H,s),g(this,Se,h),e(this,H)===0){if(this.isUNC()){let[n,o,a,l,...u]=e(this,I),[d,f,w,S,...E]=e(this,lt);u[0]===""&&(u.shift(),E.shift());let b=[n,o,a,l,""].join("/"),x=[d,f,w,S,""].join("/");g(this,I,[b,...u]),g(this,lt,[x,...E]),this.length=e(this,I).length;}else if(this.isDrive()||this.isAbsolute()){let[n,...o]=e(this,I),[a,...l]=e(this,lt);o[0]===""&&(o.shift(),l.shift());let u=n+"/",d=a+"/";g(this,I,[u,...o]),g(this,lt,[d,...l]),this.length=e(this,I).length;}}}[Kn](){return "Pattern <"+e(this,lt).slice(e(this,H)).join("/")+">"}pattern(){return e(this,I)[e(this,H)]}isString(){return typeof e(this,I)[e(this,H)]=="string"}isGlobstar(){return e(this,I)[e(this,H)]===ht}isRegExp(){return e(this,I)[e(this,H)]instanceof RegExp}globString(){return g(this,Ei,e(this,Ei)||(e(this,H)===0?this.isAbsolute()?e(this,lt)[0]+e(this,lt).slice(1).join("/"):e(this,lt).join("/"):e(this,lt).slice(e(this,H)).join("/")))}hasMore(){return this.length>e(this,H)+1}rest(){return e(this,Lt)!==void 0?e(this,Lt):this.hasMore()?(g(this,Lt,new ze(e(this,I),e(this,lt),e(this,H)+1,e(this,Se))),g(e(this,Lt),ne,e(this,ne)),g(e(this,Lt),he,e(this,he)),g(e(this,Lt),re,e(this,re)),e(this,Lt)):g(this,Lt,null)}isUNC(){let t=e(this,I);return e(this,he)!==void 0?e(this,he):g(this,he,e(this,Se)==="win32"&&e(this,H)===0&&t[0]===""&&t[1]===""&&typeof t[2]=="string"&&!!t[2]&&typeof t[3]=="string"&&!!t[3])}isDrive(){let t=e(this,I);return e(this,re)!==void 0?e(this,re):g(this,re,e(this,Se)==="win32"&&e(this,H)===0&&this.length>1&&typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]))}isAbsolute(){let t=e(this,I);return e(this,ne)!==void 0?e(this,ne):g(this,ne,t[0]===""&&t.length>1||this.isDrive()||this.isUNC())}root(){let t=e(this,I)[0];return typeof t=="string"&&this.isAbsolute()&&e(this,H)===0?t:""}checkFollowGlobstar(){return !(e(this,H)===0||!this.isGlobstar()||!e(this,Ne))}markFollowGlobstar(){return e(this,H)===0||!this.isGlobstar()||!e(this,Ne)?false:(g(this,Ne,false),true)}},I=new WeakMap,lt=new WeakMap,H=new WeakMap,Se=new WeakMap,Lt=new WeakMap,Ei=new WeakMap,re=new WeakMap,he=new WeakMap,ne=new WeakMap,Ne=new WeakMap,ze),Xn=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Us=class{constructor(e,{nobrace:t,nocase:i,noext:s,noglobstar:h,platform:n=Xn}){d(this,"relative");d(this,"relativeChildren");d(this,"absolute");d(this,"absoluteChildren");d(this,"platform");d(this,"mmopts");this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=n,this.mmopts={dot:true,nobrace:t,nocase:i,noext:s,noglobstar:h,optimizationLevel:2,platform:n,nocomment:true,nonegate:true};for(let o of e)this.add(o);}add(e){let t=new ae(e,this.mmopts);for(let i=0;i<t.set.length;i++){let s=t.set[i],h=t.globParts[i];if(!s||!h)throw new Error("invalid pattern object");for(;s[0]==="."&&h[0]===".";)s.shift(),h.shift();let n=new eh(s,h,0,this.platform),o=new ae(n.globString(),this.mmopts),a=h[h.length-1]==="**",l=n.isAbsolute();l?this.absolute.push(o):this.relative.push(o),a&&(l?this.absoluteChildren.push(o):this.relativeChildren.push(o));}}ignored(e){let t=e.fullpath(),i=`${t}/`,s=e.relative()||".",h=`${s}/`;for(let n of this.relative)if(n.match(s)||n.match(h))return true;for(let n of this.absolute)if(n.match(t)||n.match(i))return true;return false}childrenIgnored(e){let t=e.fullpath()+"/",i=(e.relative()||".")+"/";for(let s of this.relativeChildren)if(s.match(i))return true;for(let s of this.absoluteChildren)if(s.match(t))return true;return false}},Qn=class ih{constructor(t=new Map){d(this,"store");this.store=t;}copy(){return new ih(new Map(this.store))}hasWalked(t,i){return this.store.get(t.fullpath())?.has(i.globString())}storeWalked(t,i){let s=t.fullpath(),h=this.store.get(s);h?h.add(i.globString()):this.store.set(s,new Set([i.globString()]));}},to=class{constructor(){d(this,"store",new Map);}add(e,t,i){let s=(t?2:0)|(i?1:0),h=this.store.get(e);this.store.set(e,h===void 0?s:s&h);}entries(){return [...this.store.entries()].map(([e,t])=>[e,!!(t&2),!!(t&1)])}},eo=class{constructor(){d(this,"store",new Map);}add(e,t){if(!e.canReaddir())return;let i=this.store.get(e);i?i.find(s=>s.globString()===t.globString())||i.push(t):this.store.set(e,[t]);}get(e){let t=this.store.get(e);if(!t)throw new Error("attempting to walk unknown path");return t}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return [...this.store.keys()].filter(e=>e.canReaddir())}},Gs=class sh{constructor(t,i){d(this,"hasWalkedCache");d(this,"matches",new to);d(this,"subwalks",new eo);d(this,"patterns");d(this,"follow");d(this,"dot");d(this,"opts");this.opts=t,this.follow=!!t.follow,this.dot=!!t.dot,this.hasWalkedCache=i?i.copy():new Qn;}processPatterns(t,i){this.patterns=i;let s=i.map(h=>[t,h]);for(let[h,n]of s){this.hasWalkedCache.storeWalked(h,n);let o=n.root(),a=n.isAbsolute()&&this.opts.absolute!==false;if(o){h=h.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let f=n.rest();if(f)n=f;else {this.matches.add(h,true,false);continue}}if(h.isENOENT())continue;let l,u,d=false;for(;typeof(l=n.pattern())=="string"&&(u=n.rest());)h=h.resolve(l),n=u,d=true;if(l=n.pattern(),u=n.rest(),d){if(this.hasWalkedCache.hasWalked(h,n))continue;this.hasWalkedCache.storeWalked(h,n);}if(typeof l=="string"){let f=l===".."||l===""||l===".";this.matches.add(h.resolve(l),a,f);continue}else if(l===ht){(!h.isSymbolicLink()||this.follow||n.checkFollowGlobstar())&&this.subwalks.add(h,n);let f=u?.pattern(),w=u?.rest();if(!u||(f===""||f===".")&&!w)this.matches.add(h,a,f===""||f===".");else if(f===".."){let S=h.parent||h;w?this.hasWalkedCache.hasWalked(S,w)||this.subwalks.add(S,w):this.matches.add(S,a,true);}}else l instanceof RegExp&&this.subwalks.add(h,n);}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new sh(this.opts,this.hasWalkedCache)}filterEntries(t,i){let s=this.subwalks.get(t),h=this.child();for(let n of i)for(let o of s){let a=o.isAbsolute(),l=o.pattern(),u=o.rest();l===ht?h.testGlobstar(n,o,u,a):l instanceof RegExp?h.testRegExp(n,l,u,a):h.testString(n,l,u,a);}return h}testGlobstar(t,i,s,h){if((this.dot||!t.name.startsWith("."))&&(i.hasMore()||this.matches.add(t,h,false),t.canReaddir()&&(this.follow||!t.isSymbolicLink()?this.subwalks.add(t,i):t.isSymbolicLink()&&(s&&i.checkFollowGlobstar()?this.subwalks.add(t,s):i.markFollowGlobstar()&&this.subwalks.add(t,i)))),s){let n=s.pattern();if(typeof n=="string"&&n!==".."&&n!==""&&n!==".")this.testString(t,n,s.rest(),h);else if(n===".."){let o=t.parent||t;this.subwalks.add(o,s);}else n instanceof RegExp&&this.testRegExp(t,n,s.rest(),h);}}testRegExp(t,i,s,h){i.test(t.name)&&(s?this.subwalks.add(t,s):this.matches.add(t,h,false));}testString(t,i,s,h){t.isNamed(i)&&(s?this.subwalks.add(t,s):this.matches.add(t,h,false));}},io=(e,t)=>typeof e=="string"?new Us([e],t):Array.isArray(e)?new Us(e,t):e,_e,qt,ve,St,ue,ys,mr,rh=(mr=class{constructor(e$1,t,i){f(this,St);d(this,"path");d(this,"patterns");d(this,"opts");d(this,"seen",new Set);d(this,"paused",false);d(this,"aborted",false);f(this,_e,[]);f(this,qt);f(this,ve);d(this,"signal");d(this,"maxDepth");d(this,"includeChildMatches");if(this.patterns=e$1,this.path=t,this.opts=i,g(this,ve,!i.posix&&i.platform==="win32"?"\\":"/"),this.includeChildMatches=i.includeChildMatches!==false,(i.ignore||!this.includeChildMatches)&&(g(this,qt,io(i.ignore??[],i)),!this.includeChildMatches&&typeof e(this,qt).add!="function")){let s="cannot ignore child matches, ignore lacks add() method.";throw new Error(s)}this.maxDepth=i.maxDepth||1/0,i.signal&&(this.signal=i.signal,this.signal.addEventListener("abort",()=>{e(this,_e).length=0;}));}pause(){this.paused=true;}resume(){if(this.signal?.aborted)return;this.paused=false;let e$1;for(;!this.paused&&(e$1=e(this,_e).shift());)e$1();}onResume(e$1){this.signal?.aborted||(this.paused?e(this,_e).push(e$1):e$1());}async matchCheck(e,t){if(t&&this.opts.nodir)return;let i;if(this.opts.realpath){if(i=e.realpathCached()||await e.realpath(),!i)return;e=i;}let s=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let h=await s.realpath();h&&(h.isUnknown()||this.opts.stat)&&await h.lstat();}return this.matchCheckTest(s,t)}matchCheckTest(e,t){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!t||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!h(this,St,ue).call(this,e)?e:void 0}matchCheckSync(e,t){if(t&&this.opts.nodir)return;let i;if(this.opts.realpath){if(i=e.realpathCached()||e.realpathSync(),!i)return;e=i;}let s=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let h=s.realpathSync();h&&(h?.isUnknown()||this.opts.stat)&&h.lstatSync();}return this.matchCheckTest(s,t)}matchFinish(e$1,t){if(h(this,St,ue).call(this,e$1))return;if(!this.includeChildMatches&&e(this,qt)?.add){let h=`${e$1.relativePosix()}/**`;e(this,qt).add(h);}let i=this.opts.absolute===void 0?t:this.opts.absolute;this.seen.add(e$1);let s=this.opts.mark&&e$1.isDirectory()?e(this,ve):"";if(this.opts.withFileTypes)this.matchEmit(e$1);else if(i){let h=this.opts.posix?e$1.fullpathPosix():e$1.fullpath();this.matchEmit(h+s);}else {let h=this.opts.posix?e$1.relativePosix():e$1.relative(),n=this.opts.dotRelative&&!h.startsWith(".."+e(this,ve))?"."+e(this,ve):"";this.matchEmit(h?n+h+s:"."+s);}}async match(e,t,i){let s=await this.matchCheck(e,i);s&&this.matchFinish(s,t);}matchSync(e,t,i){let s=this.matchCheckSync(e,i);s&&this.matchFinish(s,t);}walkCB(e,t,i){this.signal?.aborted&&i(),this.walkCB2(e,t,new Gs(this.opts),i);}walkCB2(e,t,i,s){if(h(this,St,ys).call(this,e))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2(e,t,i,s));return}i.processPatterns(e,t);let h$1=1,n=()=>{--h$1===0&&s();};for(let[o,a,l]of i.matches.entries())h(this,St,ue).call(this,o)||(h$1++,this.match(o,a,l).then(()=>n()));for(let o of i.subwalkTargets()){if(this.maxDepth!==1/0&&o.depth()>=this.maxDepth)continue;h$1++;let a=o.readdirCached();o.calledReaddir()?this.walkCB3(o,a,i,n):o.readdirCB((l,u)=>this.walkCB3(o,u,i,n),true);}n();}walkCB3(e,t,i,s){i=i.filterEntries(e,t);let h$1=1,n=()=>{--h$1===0&&s();};for(let[o,a,l]of i.matches.entries())h(this,St,ue).call(this,o)||(h$1++,this.match(o,a,l).then(()=>n()));for(let[o,a]of i.subwalks.entries())h$1++,this.walkCB2(o,a,i.child(),n);n();}walkCBSync(e,t,i){this.signal?.aborted&&i(),this.walkCB2Sync(e,t,new Gs(this.opts),i);}walkCB2Sync(e,t,i,s){if(h(this,St,ys).call(this,e))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2Sync(e,t,i,s));return}i.processPatterns(e,t);let h$1=1,n=()=>{--h$1===0&&s();};for(let[o,a,l]of i.matches.entries())h(this,St,ue).call(this,o)||this.matchSync(o,a,l);for(let o of i.subwalkTargets()){if(this.maxDepth!==1/0&&o.depth()>=this.maxDepth)continue;h$1++;let a=o.readdirSync();this.walkCB3Sync(o,a,i,n);}n();}walkCB3Sync(e,t,i,s){i=i.filterEntries(e,t);let h$1=1,n=()=>{--h$1===0&&s();};for(let[o,a,l]of i.matches.entries())h(this,St,ue).call(this,o)||this.matchSync(o,a,l);for(let[o,a]of i.subwalks.entries())h$1++,this.walkCB2Sync(o,a,i.child(),n);n();}},_e=new WeakMap,qt=new WeakMap,ve=new WeakMap,St=new WeakSet,ue=function(e$1){return this.seen.has(e$1)||!!e(this,qt)?.ignored?.(e$1)},ys=function(e$1){return !!e(this,qt)?.childrenIgnored?.(e$1)},mr),Is=class extends rh{constructor(t,i,s){super(t,i,s);d(this,"matches",new Set);}matchEmit(t){this.matches.add(t);}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((t,i)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?i(this.signal.reason):t(this.matches);});}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},Hs=class extends rh{constructor(t,i,s){super(t,i,s);d(this,"results");this.results=new Gi({signal:this.signal,objectMode:true}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume());}matchEmit(t){this.results.write(t),this.results.flowing||this.pause();}stream(){let t=this.path;return t.isUnknown()?t.lstat().then(()=>{this.walkCB(t,this.patterns,()=>this.results.end());}):this.walkCB(t,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}},so=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",xe=class{constructor(e,t){d(this,"absolute");d(this,"cwd");d(this,"root");d(this,"dot");d(this,"dotRelative");d(this,"follow");d(this,"ignore");d(this,"magicalBraces");d(this,"mark");d(this,"matchBase");d(this,"maxDepth");d(this,"nobrace");d(this,"nocase");d(this,"nodir");d(this,"noext");d(this,"noglobstar");d(this,"pattern");d(this,"platform");d(this,"realpath");d(this,"scurry");d(this,"stat");d(this,"signal");d(this,"windowsPathsNoEscape");d(this,"withFileTypes");d(this,"includeChildMatches");d(this,"opts");d(this,"patterns");if(!t)throw new TypeError("glob options required");if(this.withFileTypes=!!t.withFileTypes,this.signal=t.signal,this.follow=!!t.follow,this.dot=!!t.dot,this.dotRelative=!!t.dotRelative,this.nodir=!!t.nodir,this.mark=!!t.mark,t.cwd?(t.cwd instanceof URL||t.cwd.startsWith("file://"))&&(t.cwd=fileURLToPath(t.cwd)):this.cwd="",this.cwd=t.cwd||"",this.root=t.root,this.magicalBraces=!!t.magicalBraces,this.nobrace=!!t.nobrace,this.noext=!!t.noext,this.realpath=!!t.realpath,this.absolute=t.absolute,this.includeChildMatches=t.includeChildMatches!==false,this.noglobstar=!!t.noglobstar,this.matchBase=!!t.matchBase,this.maxDepth=typeof t.maxDepth=="number"?t.maxDepth:1/0,this.stat=!!t.stat,this.ignore=t.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===false,this.windowsPathsNoEscape&&(e=e.map(a=>a.replace(/\\/g,"/"))),this.matchBase){if(t.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(a=>a.includes("/")?a:`./**/${a}`);}if(this.pattern=e,this.platform=t.platform||so,this.opts={...t,platform:this.platform},t.scurry){if(this.scurry=t.scurry,t.nocase!==void 0&&t.nocase!==t.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else {let a=t.platform==="win32"?Es:t.platform==="darwin"?th:t.platform?xs:Zn;this.scurry=new a(this.cwd,{nocase:t.nocase,fs:t.fs});}this.nocase=this.scurry.nocase;let i=this.platform==="darwin"||this.platform==="win32",s={braceExpandMax:1e4,...t,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:i,nocomment:true,noext:this.noext,nonegate:true,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},h=this.pattern.map(a=>new ae(a,s)),[n,o]=h.reduce((a,l)=>(a[0].push(...l.set),a[1].push(...l.globParts),a),[[],[]]);this.patterns=n.map((a,l)=>{let u=o[l];if(!u)throw new Error("invalid pattern object");return new eh(a,u,0,this.platform)});}async walk(){return [...await new Is(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return [...new Is(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new Hs(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new Hs(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}},ro=(e,t={})=>{Array.isArray(e)||(e=[e]);for(let i of e)if(new ae(i,t).hasMagic())return true;return false};function Ji(e,t={}){return new xe(e,t).streamSync()}function hh(e,t={}){return new xe(e,t).stream()}function nh(e,t={}){return new xe(e,t).walkSync()}async function Js(e,t={}){return new xe(e,t).walk()}function qi(e,t={}){return new xe(e,t).iterateSync()}function oh(e,t={}){return new xe(e,t).iterate()}var ho=Ji,no=Object.assign(hh,{sync:Ji}),oo=qi,ao=Object.assign(oh,{sync:qi}),lo=Object.assign(nh,{stream:Ji,iterate:qi}),Ii=Object.assign(Js,{glob:Js,globSync:nh,sync:lo,globStream:hh,stream:no,globStreamSync:Ji,streamSync:ho,globIterate:oh,iterate:ao,globIterateSync:qi,iterateSync:oo,Glob:xe,hasMagic:ro,escape:Cr,unescape:Ce});Ii.glob=Ii;var lh;(M=>{M.Level=uo.enum(["DEBUG","INFO","WARN","ERROR"]).meta({ref:"LogLevel",description:"Log level"});let t={DEBUG:0,INFO:1,WARN:2,ERROR:3},i="INFO";function s(F){return t[F]>=t[i]}function h(){return i}M.getLevel=h;let n=new Map;M.Default=T({service:"default"});let a="";function l(){return a}M.file=l;let u,d,f=false,w=()=>{},S=false,E=false;async function b(F){if(f)return;if(F.print){f=true;return}F.level&&(i=F.level);let j=F.logDir||Zi.join(process.env.EASBOT_LOG_PATH??process.cwd(),"logs");F.logFile?a=Zi.join(j,F.logFile??"utils.log"):a=Zi.join(j,"utils.log");try{await ah.mkdir(j,{recursive:!0}),u=await ah.open(a,"a"),d=createWriteStream("",{fd:u.fd,autoClose:!1}),w=N=>{if(!(S||E||!d||d.destroyed))try{if(!d.writable)return;d.write(N,B=>{if(B&&!S){let L=B;if(L.code==="EPIPE"||L.code==="EIO"){E=!0,d?.destroy();return}S=!0,setTimeout(()=>{S=!1;},1e3);}});}catch(B){let L=B;if(L.code==="EPIPE"||L.code==="EIO"){E=!0,d?.destroy();return}S||(S=!0,setTimeout(()=>{S=!1;},1e3));}},f=!0;}catch(N){process.stderr.write(`[LOG ERROR] Failed to init log file: ${N}
4
+ `),w=B=>{try{process.stderr.write(B);}catch{}},f=true;}}M.init=b;async function x(){f&&(d&&!d.destroyed&&(await new Promise((F,j)=>{d.end(N=>{N?j(N):F();});}).catch(F=>{process.stderr.write(`[LOG ERROR] Failed to close log stream: ${F}
5
+ `);}),d=void 0),u&&(await u.close().catch(F=>{process.stderr.write(`[LOG ERROR] Failed to close log file: ${F}
6
+ `);}),u=void 0),w=F=>{try{process.stderr.write(F);}catch{}},f=false);}M.close=x;function R(F,j=0){let N=F.message;return F.cause instanceof Error&&j<10?N+" Caused by: "+R(F.cause,j+1):N}let A=Date.now();function T(F){F=F||{};let j=F.service;if(j&&typeof j=="string"){let L=n.get(j);if(L)return L}function N(L,ot){let Vi=Object.entries({...F,...ot}).filter(([ks,Zt])=>Zt!=null).map(([ks,Zt])=>{let Yi=`${ks}=`;return Zt instanceof Error?Yi+R(Zt):typeof Zt=="object"?Yi+JSON.stringify(Zt):Yi+Zt}).join(" "),vt=new Date,ch=vt.getTime()-A;return A=vt.getTime(),[vt.getFullYear()+"-"+String(vt.getMonth()+1).padStart(2,"0")+"-"+String(vt.getDate()).padStart(2,"0")+"T"+String(vt.getHours()).padStart(2,"0")+":"+String(vt.getMinutes()).padStart(2,"0")+":"+String(vt.getSeconds()).padStart(2,"0"),"+"+ch+"ms",Vi,L].filter(Boolean).join(" ")+`
7
+ `}let B={debug(L,ot){s("DEBUG")&&w("DEBUG "+N(L,ot));},info(L,ot){s("INFO")&&w("INFO "+N(L,ot));},error(L,ot){s("ERROR")&&w("ERROR "+N(L,ot));},warn(L,ot){s("WARN")&&w("WARN "+N(L,ot));},tag(L,ot){return F&&(F[L]=ot),B},clone(){return M.create({...F})},time(L,ot){let Vi=Date.now();B.info(L,{status:"started",...ot});function vt(){B.info(L,{status:"completed",duration:Date.now()-Vi,...ot});}return {stop:vt,[Symbol.dispose](){vt();}}}};return j&&typeof j=="string"&&n.set(j,B),B}M.create=T;})(lh||(lh={}));export{nh as a,Ii as b,lh as c};
@@ -0,0 +1,7 @@
1
+ 'use strict';var chunkQBAJWPDZ_cjs=require('./chunk-QBAJWPDZ.cjs'),Zi=require('path'),ah=require('fs/promises'),Cn=require('fs'),co=require('zod'),url=require('url'),events=require('events'),Pr=require('stream'),string_decoder=require('string_decoder');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var Zi__default=/*#__PURE__*/_interopDefault(Zi);var ah__default=/*#__PURE__*/_interopDefault(ah);var Cn__namespace=/*#__PURE__*/_interopNamespace(Cn);var co__default=/*#__PURE__*/_interopDefault(co);var Pr__default=/*#__PURE__*/_interopDefault(Pr);chunkQBAJWPDZ_cjs.k();chunkQBAJWPDZ_cjs.k();var wr=(e,t,i)=>{let s=e instanceof RegExp?Rs(e,i):e,h=t instanceof RegExp?Rs(t,i):t,n=s!==null&&h!=null&&ph(s,h,i);return n&&{start:n[0],end:n[1],pre:i.slice(0,n[0]),body:i.slice(n[0]+s.length,n[1]),post:i.slice(n[1]+h.length)}},Rs=(e,t)=>{let i=t.match(e);return i?i[0]:null},ph=(e,t,i)=>{let s,h,n,o,a,l=i.indexOf(e),u=i.indexOf(t,l+1),d=l;if(l>=0&&u>0){if(e===t)return [l,u];for(s=[],n=i.length;d>=0&&!a;){if(d===l)s.push(d),l=i.indexOf(e,d+1);else if(s.length===1){let f=s.pop();f!==void 0&&(a=[f,u]);}else h=s.pop(),h!==void 0&&h<n&&(n=h,o=u),u=i.indexOf(t,d+1);d=l<u&&l>=0?l:u;}s.length&&o!==void 0&&(a=[n,o]);}return a},yr="\0SLASH"+Math.random()+"\0",br="\0OPEN"+Math.random()+"\0",bs="\0CLOSE"+Math.random()+"\0",Sr="\0COMMA"+Math.random()+"\0",vr="\0PERIOD"+Math.random()+"\0",fh=new RegExp(yr,"g"),dh=new RegExp(br,"g"),gh=new RegExp(bs,"g"),mh=new RegExp(Sr,"g"),wh=new RegExp(vr,"g"),yh=/\\\\/g,bh=/\\{/g,Sh=/\\}/g,vh=/\\,/g,Eh=/\\./g,xh=1e5;function Ki(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}function kh(e){return e.replace(yh,yr).replace(bh,br).replace(Sh,bs).replace(vh,Sr).replace(Eh,vr)}function Rh(e){return e.replace(fh,"\\").replace(dh,"{").replace(gh,"}").replace(mh,",").replace(wh,".")}function Er(e){if(!e)return [""];let t=[],i=wr("{","}",e);if(!i)return e.split(",");let{pre:s,body:h,post:n}=i,o=s.split(",");o[o.length-1]+="{"+h+"}";let a=Er(n);return n.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),t.push.apply(t,o),t}function Ch(e,t={}){if(!e)return [];let{max:i=xh}=t;return e.slice(0,2)==="{}"&&(e="\\{\\}"+e.slice(2)),Je(kh(e),i,true).map(Rh)}function Oh(e){return "{"+e+"}"}function Ah(e){return /^-?0\d/.test(e)}function Fh(e,t){return e<=t}function Th(e,t){return e>=t}function Je(e,t,i){let s=[],h=wr("{","}",e);if(!h)return [e];let n=h.pre,o=h.post.length?Je(h.post,t,false):[""];if(/\$$/.test(h.pre))for(let a=0;a<o.length&&a<t;a++){let l=n+"{"+h.body+"}"+o[a];s.push(l);}else {let a=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(h.body),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(h.body),u=a||l,d=h.body.indexOf(",")>=0;if(!u&&!d)return h.post.match(/,(?!,).*\}/)?(e=h.pre+"{"+h.body+bs+h.post,Je(e,t,true)):[e];let f;if(u)f=h.body.split(/\.\./);else if(f=Er(h.body),f.length===1&&f[0]!==void 0&&(f=Je(f[0],t,false).map(Oh),f.length===1))return o.map(S=>h.pre+f[0]+S);let w;if(u&&f[0]!==void 0&&f[1]!==void 0){let S=Ki(f[0]),E=Ki(f[1]),b=Math.max(f[0].length,f[1].length),x=f.length===3&&f[2]!==void 0?Math.abs(Ki(f[2])):1,v=Fh;E<S&&(x*=-1,v=Th);let R=f.some(Ah);w=[];for(let A=S;v(A,E);A+=x){let T;if(l)T=String.fromCharCode(A),T==="\\"&&(T="");else if(T=String(A),R){let M=b-T.length;if(M>0){let F=new Array(M+1).join("0");A<0?T="-"+F+T.slice(1):T=F+T;}}w.push(T);}}else {w=[];for(let S=0;S<f.length;S++)w.push.apply(w,Je(f[S],t,false));}for(let S=0;S<w.length;S++)for(let E=0;E<o.length&&s.length<t;E++){let b=n+w[S]+o[E];(!i||u||b)&&s.push(b);}}return s}var Bi=e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},Mh={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",true],"[:alpha:]":["\\p{L}\\p{Nl}",true],"[:ascii:]":["\\x00-\\x7f",false],"[:blank:]":["\\p{Zs}\\t",true],"[:cntrl:]":["\\p{Cc}",true],"[:digit:]":["\\p{Nd}",true],"[:graph:]":["\\p{Z}\\p{C}",true,true],"[:lower:]":["\\p{Ll}",true],"[:print:]":["\\p{C}",true],"[:punct:]":["\\p{P}",true],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",true],"[:upper:]":["\\p{Lu}",true],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",true],"[:xdigit:]":["A-Fa-f0-9",false]},$e=e=>e.replace(/[[\]\\-]/g,"\\$&"),Lh=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Cs=e=>e.join(""),Wh=(e,t)=>{let i=t;if(e.charAt(i)!=="[")throw new Error("not in a brace expression");let s=[],h=[],n=i+1,o=false,a=false,l=false,u=false,d=i,f="";t:for(;n<e.length;){let E=e.charAt(n);if((E==="!"||E==="^")&&n===i+1){u=true,n++;continue}if(E==="]"&&o&&!l){d=n+1;break}if(o=true,E==="\\"&&!l){l=true,n++;continue}if(E==="["&&!l){for(let[b,[x,v,R]]of Object.entries(Mh))if(e.startsWith(b,n)){if(f)return ["$.",false,e.length-i,true];n+=b.length,R?h.push(x):s.push(x),a=a||v;continue t}}if(l=false,f){E>f?s.push($e(f)+"-"+$e(E)):E===f&&s.push($e(E)),f="",n++;continue}if(e.startsWith("-]",n+1)){s.push($e(E+"-")),n+=2;continue}if(e.startsWith("-",n+1)){f=E,n+=2;continue}s.push($e(E)),n++;}if(d<n)return ["",false,0,false];if(!s.length&&!h.length)return ["$.",false,e.length-i,true];if(h.length===0&&s.length===1&&/^\\?.$/.test(s[0])&&!u){let E=s[0].length===2?s[0].slice(-1):s[0];return [Lh(E),false,d-i,false]}let w="["+(u?"^":"")+Cs(s)+"]",S="["+(u?"":"^")+Cs(h)+"]";return [s.length&&h.length?"("+w+"|"+S+")":s.length?w:S,a,d-i,true]},Ce=(e,{windowsPathsNoEscape:t=false,magicalBraces:i=true}={})=>i?t?e.replace(/\[([^\/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"):t?e.replace(/\[([^\/\\{}])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^\/\\{}])\]/g,"$1$2").replace(/\\([^\/{}])/g,"$1"),Dh=new Set(["!","?","+","*","@"]),Os=e=>Dh.has(e),Ph="(?!(?:^|/)\\.\\.?(?:$|/))",Ri="(?!\\.)",jh=new Set(["[","."]),Nh=new Set(["..","."]),zh=new Set("().*{}+?[]^$\\!"),_h=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Ss="[^/]",As=Ss+"*?",Fs=Ss+"+?",U,V,Bt,D,_,te,pe,ee,Pt,fe,Qe,Ee,kr,oe,X,Wi,hs,Rr,xr=(X=class{constructor(t,i,s={}){chunkQBAJWPDZ_cjs.f(this,Ee);chunkQBAJWPDZ_cjs.d(this,"type");chunkQBAJWPDZ_cjs.f(this,U);chunkQBAJWPDZ_cjs.f(this,V);chunkQBAJWPDZ_cjs.f(this,Bt,false);chunkQBAJWPDZ_cjs.f(this,D,[]);chunkQBAJWPDZ_cjs.f(this,_);chunkQBAJWPDZ_cjs.f(this,te);chunkQBAJWPDZ_cjs.f(this,pe);chunkQBAJWPDZ_cjs.f(this,ee,false);chunkQBAJWPDZ_cjs.f(this,Pt);chunkQBAJWPDZ_cjs.f(this,fe);chunkQBAJWPDZ_cjs.f(this,Qe,false);this.type=t,t&&chunkQBAJWPDZ_cjs.g(this,V,true),chunkQBAJWPDZ_cjs.g(this,_,i),chunkQBAJWPDZ_cjs.g(this,U,chunkQBAJWPDZ_cjs.e(this,_)?chunkQBAJWPDZ_cjs.e(chunkQBAJWPDZ_cjs.e(this,_),U):this),chunkQBAJWPDZ_cjs.g(this,Pt,chunkQBAJWPDZ_cjs.e(this,U)===this?s:chunkQBAJWPDZ_cjs.e(chunkQBAJWPDZ_cjs.e(this,U),Pt)),chunkQBAJWPDZ_cjs.g(this,pe,chunkQBAJWPDZ_cjs.e(this,U)===this?[]:chunkQBAJWPDZ_cjs.e(chunkQBAJWPDZ_cjs.e(this,U),pe)),t==="!"&&!chunkQBAJWPDZ_cjs.e(chunkQBAJWPDZ_cjs.e(this,U),ee)&&chunkQBAJWPDZ_cjs.e(this,pe).push(this),chunkQBAJWPDZ_cjs.g(this,te,chunkQBAJWPDZ_cjs.e(this,_)?chunkQBAJWPDZ_cjs.e(chunkQBAJWPDZ_cjs.e(this,_),D).length:0);}get hasMagic(){if(chunkQBAJWPDZ_cjs.e(this,V)!==void 0)return chunkQBAJWPDZ_cjs.e(this,V);for(let t of chunkQBAJWPDZ_cjs.e(this,D))if(typeof t!="string"&&(t.type||t.hasMagic))return chunkQBAJWPDZ_cjs.g(this,V,true);return chunkQBAJWPDZ_cjs.e(this,V)}toString(){return chunkQBAJWPDZ_cjs.e(this,fe)!==void 0?chunkQBAJWPDZ_cjs.e(this,fe):this.type?chunkQBAJWPDZ_cjs.g(this,fe,this.type+"("+chunkQBAJWPDZ_cjs.e(this,D).map(t=>String(t)).join("|")+")"):chunkQBAJWPDZ_cjs.g(this,fe,chunkQBAJWPDZ_cjs.e(this,D).map(t=>String(t)).join(""))}push(...t){for(let i of t)if(i!==""){if(typeof i!="string"&&!(i instanceof X&&chunkQBAJWPDZ_cjs.e(i,_)===this))throw new Error("invalid part: "+i);chunkQBAJWPDZ_cjs.e(this,D).push(i);}}toJSON(){let t=this.type===null?chunkQBAJWPDZ_cjs.e(this,D).slice().map(i=>typeof i=="string"?i:i.toJSON()):[this.type,...chunkQBAJWPDZ_cjs.e(this,D).map(i=>i.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===chunkQBAJWPDZ_cjs.e(this,U)||chunkQBAJWPDZ_cjs.e(chunkQBAJWPDZ_cjs.e(this,U),ee)&&chunkQBAJWPDZ_cjs.e(this,_)?.type==="!")&&t.push({}),t}isStart(){if(chunkQBAJWPDZ_cjs.e(this,U)===this)return true;if(!chunkQBAJWPDZ_cjs.e(this,_)?.isStart())return false;if(chunkQBAJWPDZ_cjs.e(this,te)===0)return true;let t=chunkQBAJWPDZ_cjs.e(this,_);for(let i=0;i<chunkQBAJWPDZ_cjs.e(this,te);i++){let s=chunkQBAJWPDZ_cjs.e(t,D)[i];if(!(s instanceof X&&s.type==="!"))return false}return true}isEnd(){if(chunkQBAJWPDZ_cjs.e(this,U)===this||chunkQBAJWPDZ_cjs.e(this,_)?.type==="!")return true;if(!chunkQBAJWPDZ_cjs.e(this,_)?.isEnd())return false;if(!this.type)return chunkQBAJWPDZ_cjs.e(this,_)?.isEnd();let t=chunkQBAJWPDZ_cjs.e(this,_)?chunkQBAJWPDZ_cjs.e(chunkQBAJWPDZ_cjs.e(this,_),D).length:0;return chunkQBAJWPDZ_cjs.e(this,te)===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this));}clone(t){let i=new X(this.type,t);for(let s of chunkQBAJWPDZ_cjs.e(this,D))i.copyIn(s);return i}static fromGlob(t,i={}){var h;let s=new X(null,void 0,i);return chunkQBAJWPDZ_cjs.h(h=X,oe,Wi).call(h,t,s,0,i),s}toMMPattern(){if(this!==chunkQBAJWPDZ_cjs.e(this,U))return chunkQBAJWPDZ_cjs.e(this,U).toMMPattern();let t=this.toString(),[i,s,h,n]=this.toRegExpSource();if(!(h||chunkQBAJWPDZ_cjs.e(this,V)||chunkQBAJWPDZ_cjs.e(this,Pt).nocase&&!chunkQBAJWPDZ_cjs.e(this,Pt).nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return s;let o=(chunkQBAJWPDZ_cjs.e(this,Pt).nocase?"i":"")+(n?"u":"");return Object.assign(new RegExp(`^${i}$`,o),{_src:i,_glob:t})}get options(){return chunkQBAJWPDZ_cjs.e(this,Pt)}toRegExpSource(t){let i=t??!!chunkQBAJWPDZ_cjs.e(this,Pt).dot;if(chunkQBAJWPDZ_cjs.e(this,U)===this&&chunkQBAJWPDZ_cjs.h(this,Ee,kr).call(this),!this.type){let l=this.isStart()&&this.isEnd()&&!chunkQBAJWPDZ_cjs.e(this,D).some(w=>typeof w!="string"),u=chunkQBAJWPDZ_cjs.e(this,D).map(w=>{var v;let[S,E,b,x]=typeof w=="string"?chunkQBAJWPDZ_cjs.h(v=X,oe,Rr).call(v,w,chunkQBAJWPDZ_cjs.e(this,V),l):w.toRegExpSource(t);return chunkQBAJWPDZ_cjs.g(this,V,chunkQBAJWPDZ_cjs.e(this,V)||b),chunkQBAJWPDZ_cjs.g(this,Bt,chunkQBAJWPDZ_cjs.e(this,Bt)||x),S}).join(""),d="";if(this.isStart()&&typeof chunkQBAJWPDZ_cjs.e(this,D)[0]=="string"&&!(chunkQBAJWPDZ_cjs.e(this,D).length===1&&Nh.has(chunkQBAJWPDZ_cjs.e(this,D)[0]))){let w=jh,S=i&&w.has(u.charAt(0))||u.startsWith("\\.")&&w.has(u.charAt(2))||u.startsWith("\\.\\.")&&w.has(u.charAt(4)),E=!i&&!t&&w.has(u.charAt(0));d=S?Ph:E?Ri:"";}let f="";return this.isEnd()&&chunkQBAJWPDZ_cjs.e(chunkQBAJWPDZ_cjs.e(this,U),ee)&&chunkQBAJWPDZ_cjs.e(this,_)?.type==="!"&&(f="(?:$|\\/)"),[d+u+f,Ce(u),chunkQBAJWPDZ_cjs.g(this,V,!!chunkQBAJWPDZ_cjs.e(this,V)),chunkQBAJWPDZ_cjs.e(this,Bt)]}let s=this.type==="*"||this.type==="+",h=this.type==="!"?"(?:(?!(?:":"(?:",n=chunkQBAJWPDZ_cjs.h(this,Ee,hs).call(this,i);if(this.isStart()&&this.isEnd()&&!n&&this.type!=="!"){let l=this.toString();return chunkQBAJWPDZ_cjs.g(this,D,[l]),this.type=null,chunkQBAJWPDZ_cjs.g(this,V,void 0),[l,Ce(this.toString()),false,false]}let o=!s||t||i||!Ri?"":chunkQBAJWPDZ_cjs.h(this,Ee,hs).call(this,true);o===n&&(o=""),o&&(n=`(?:${n})(?:${o})*?`);let a="";if(this.type==="!"&&chunkQBAJWPDZ_cjs.e(this,Qe))a=(this.isStart()&&!i?Ri:"")+Fs;else {let l=this.type==="!"?"))"+(this.isStart()&&!i&&!t?Ri:"")+As+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=h+n+l;}return [a,Ce(n),chunkQBAJWPDZ_cjs.g(this,V,!!chunkQBAJWPDZ_cjs.e(this,V)),chunkQBAJWPDZ_cjs.e(this,Bt)]}},U=new WeakMap,V=new WeakMap,Bt=new WeakMap,D=new WeakMap,_=new WeakMap,te=new WeakMap,pe=new WeakMap,ee=new WeakMap,Pt=new WeakMap,fe=new WeakMap,Qe=new WeakMap,Ee=new WeakSet,kr=function(){if(this!==chunkQBAJWPDZ_cjs.e(this,U))throw new Error("should only call on root");if(chunkQBAJWPDZ_cjs.e(this,ee))return this;this.toString(),chunkQBAJWPDZ_cjs.g(this,ee,true);let t;for(;t=chunkQBAJWPDZ_cjs.e(this,pe).pop();){if(t.type!=="!")continue;let i=t,s=chunkQBAJWPDZ_cjs.e(i,_);for(;s;){for(let h=chunkQBAJWPDZ_cjs.e(i,te)+1;!s.type&&h<chunkQBAJWPDZ_cjs.e(s,D).length;h++)for(let n of chunkQBAJWPDZ_cjs.e(t,D)){if(typeof n=="string")throw new Error("string part in extglob AST??");n.copyIn(chunkQBAJWPDZ_cjs.e(s,D)[h]);}i=s,s=chunkQBAJWPDZ_cjs.e(i,_);}}return this},oe=new WeakSet,Wi=function(t,i,s,h){var S,E;let n=false,o=false,a=-1,l=false;if(i.type===null){let b=s,x="";for(;b<t.length;){let v=t.charAt(b++);if(n||v==="\\"){n=!n,x+=v;continue}if(o){b===a+1?(v==="^"||v==="!")&&(l=true):v==="]"&&!(b===a+2&&l)&&(o=false),x+=v;continue}else if(v==="["){o=true,a=b,l=false,x+=v;continue}if(!h.noext&&Os(v)&&t.charAt(b)==="("){i.push(x),x="";let R=new X(v,i);b=chunkQBAJWPDZ_cjs.h(S=X,oe,Wi).call(S,t,R,b,h),i.push(R);continue}x+=v;}return i.push(x),b}let u=s+1,d=new X(null,i),f=[],w="";for(;u<t.length;){let b=t.charAt(u++);if(n||b==="\\"){n=!n,w+=b;continue}if(o){u===a+1?(b==="^"||b==="!")&&(l=true):b==="]"&&!(u===a+2&&l)&&(o=false),w+=b;continue}else if(b==="["){o=true,a=u,l=false,w+=b;continue}if(Os(b)&&t.charAt(u)==="("){d.push(w),w="";let x=new X(b,d);d.push(x),u=chunkQBAJWPDZ_cjs.h(E=X,oe,Wi).call(E,t,x,u,h);continue}if(b==="|"){d.push(w),w="",f.push(d),d=new X(null,i);continue}if(b===")")return w===""&&chunkQBAJWPDZ_cjs.e(i,D).length===0&&chunkQBAJWPDZ_cjs.g(i,Qe,true),d.push(w),w="",i.push(...f,d),u;w+=b;}return i.type=null,chunkQBAJWPDZ_cjs.g(i,V,void 0),chunkQBAJWPDZ_cjs.g(i,D,[t.substring(s-1)]),u},hs=function(t){return chunkQBAJWPDZ_cjs.e(this,D).map(i=>{if(typeof i=="string")throw new Error("string type in extglob ast??");let[s,h,n,o]=i.toRegExpSource(t);return chunkQBAJWPDZ_cjs.g(this,Bt,chunkQBAJWPDZ_cjs.e(this,Bt)||o),s}).filter(i=>!(this.isStart()&&this.isEnd())||!!i).join("|")},Rr=function(t,i,s=false){let h=false,n="",o=false,a=false;for(let l=0;l<t.length;l++){let u=t.charAt(l);if(h){h=false,n+=(zh.has(u)?"\\":"")+u;continue}if(u==="*"){if(a)continue;a=true,n+=s&&/^[*]+$/.test(t)?Fs:As,i=true;continue}else a=false;if(u==="\\"){l===t.length-1?n+="\\\\":h=true;continue}if(u==="["){let[d,f,w,S]=Wh(t,l);if(w){n+=d,o=o||f,l+=w-1,i=i||S;continue}}if(u==="?"){n+=Ss,i=true;continue}n+=_h(u);}return [n,Ce(t),!!i,o]},chunkQBAJWPDZ_cjs.f(X,oe),X),Cr=(e,{windowsPathsNoEscape:t=false,magicalBraces:i=false}={})=>i?t?e.replace(/[?*()[\]{}]/g,"[$&]"):e.replace(/[?*()[\]\\{}]/g,"\\$&"):t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&"),nt=(e,t,i={})=>(Bi(t),!i.nocomment&&t.charAt(0)==="#"?false:new ae(t,i).match(e)),$h=/^\*+([^+@!?\*\[\(]*)$/,Bh=e=>t=>!t.startsWith(".")&&t.endsWith(e),Uh=e=>t=>t.endsWith(e),Gh=e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),Ih=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),Hh=/^\*+\.\*+$/,Jh=e=>!e.startsWith(".")&&e.includes("."),qh=e=>e!=="."&&e!==".."&&e.includes("."),Zh=/^\.\*+$/,Vh=e=>e!=="."&&e!==".."&&e.startsWith("."),Yh=/^\*+$/,Kh=e=>e.length!==0&&!e.startsWith("."),Xh=e=>e.length!==0&&e!=="."&&e!=="..",Qh=/^\?+([^+@!?\*\[\(]*)?$/,tn=([e,t=""])=>{let i=Or([e]);return t?(t=t.toLowerCase(),s=>i(s)&&s.toLowerCase().endsWith(t)):i},en=([e,t=""])=>{let i=Ar([e]);return t?(t=t.toLowerCase(),s=>i(s)&&s.toLowerCase().endsWith(t)):i},sn=([e,t=""])=>{let i=Ar([e]);return t?s=>i(s)&&s.endsWith(t):i},rn=([e,t=""])=>{let i=Or([e]);return t?s=>i(s)&&s.endsWith(t):i},Or=([e])=>{let t=e.length;return i=>i.length===t&&!i.startsWith(".")},Ar=([e])=>{let t=e.length;return i=>i.length===t&&i!=="."&&i!==".."},Fr=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Ts={win32:{sep:"\\"},posix:{sep:"/"}},hn=Fr==="win32"?Ts.win32.sep:Ts.posix.sep;nt.sep=hn;var ht=Symbol("globstar **");nt.GLOBSTAR=ht;var nn="[^/]",on=nn+"*?",an="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",ln="(?:(?!(?:\\/|^)\\.).)*?",cn=(e,t={})=>i=>nt(i,e,t);nt.filter=cn;var mt=(e,t={})=>Object.assign({},e,t),un=e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return nt;let t=nt;return Object.assign((i,s,h={})=>t(i,s,mt(e,h)),{Minimatch:class extends t.Minimatch{constructor(i,s={}){super(i,mt(e,s));}static defaults(i){return t.defaults(mt(e,i)).Minimatch}},AST:class extends t.AST{constructor(i,s,h={}){super(i,s,mt(e,h));}static fromGlob(i,s={}){return t.AST.fromGlob(i,mt(e,s))}},unescape:(i,s={})=>t.unescape(i,mt(e,s)),escape:(i,s={})=>t.escape(i,mt(e,s)),filter:(i,s={})=>t.filter(i,mt(e,s)),defaults:i=>t.defaults(mt(e,i)),makeRe:(i,s={})=>t.makeRe(i,mt(e,s)),braceExpand:(i,s={})=>t.braceExpand(i,mt(e,s)),match:(i,s,h={})=>t.match(i,s,mt(e,h)),sep:t.sep,GLOBSTAR:ht})};nt.defaults=un;var Tr=(e,t={})=>(Bi(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:Ch(e,{max:t.braceExpandMax}));nt.braceExpand=Tr;var pn=(e,t={})=>new ae(e,t).makeRe();nt.makeRe=pn;var fn=(e,t,i={})=>{let s=new ae(t,i);return e=e.filter(h=>s.match(h)),s.options.nonull&&!e.length&&e.push(t),e};nt.match=fn;var Ms=/[?*]|[+@!]\(.*?\)|\[|\]/,dn=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),ae=class{constructor(e,t={}){chunkQBAJWPDZ_cjs.d(this,"options");chunkQBAJWPDZ_cjs.d(this,"set");chunkQBAJWPDZ_cjs.d(this,"pattern");chunkQBAJWPDZ_cjs.d(this,"windowsPathsNoEscape");chunkQBAJWPDZ_cjs.d(this,"nonegate");chunkQBAJWPDZ_cjs.d(this,"negate");chunkQBAJWPDZ_cjs.d(this,"comment");chunkQBAJWPDZ_cjs.d(this,"empty");chunkQBAJWPDZ_cjs.d(this,"preserveMultipleSlashes");chunkQBAJWPDZ_cjs.d(this,"partial");chunkQBAJWPDZ_cjs.d(this,"globSet");chunkQBAJWPDZ_cjs.d(this,"globParts");chunkQBAJWPDZ_cjs.d(this,"nocase");chunkQBAJWPDZ_cjs.d(this,"isWindows");chunkQBAJWPDZ_cjs.d(this,"platform");chunkQBAJWPDZ_cjs.d(this,"windowsNoMagicRoot");chunkQBAJWPDZ_cjs.d(this,"regexp");Bi(e),t=t||{},this.options=t,this.pattern=e,this.platform=t.platform||Fr,this.isWindows=this.platform==="win32";let i="allowWindowsEscape";this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t[i]===false,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=false,this.nonegate=!!t.nonegate,this.comment=false,this.empty=false,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot!==void 0?t.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make();}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return true;for(let e of this.set)for(let t of e)if(typeof t!="string")return true;return false}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=true;return}if(!e){this.empty=true;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...h)=>console.error(...h)),this.debug(this.pattern,this.globSet);let i=this.globSet.map(h=>this.slashSplit(h));this.globParts=this.preprocess(i),this.debug(this.pattern,this.globParts);let s=this.globParts.map((h,n,o)=>{if(this.isWindows&&this.windowsNoMagicRoot){let a=h[0]===""&&h[1]===""&&(h[2]==="?"||!Ms.test(h[2]))&&!Ms.test(h[3]),l=/^[a-z]:/i.test(h[0]);if(a)return [...h.slice(0,4),...h.slice(4).map(u=>this.parse(u))];if(l)return [h[0],...h.slice(1).map(u=>this.parse(u))]}return h.map(a=>this.parse(a))});if(this.debug(this.pattern,s),this.set=s.filter(h=>h.indexOf(false)===-1),this.isWindows)for(let h=0;h<this.set.length;h++){let n=this.set[h];n[0]===""&&n[1]===""&&this.globParts[h][2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3])&&(n[2]="?");}this.debug(this.pattern,this.set);}preprocess(e){if(this.options.noglobstar)for(let i=0;i<e.length;i++)for(let s=0;s<e[i].length;s++)e[i][s]==="**"&&(e[i][s]="*");let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):t>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(t=>{let i=-1;for(;(i=t.indexOf("**",i+1))!==-1;){let s=i;for(;t[s+1]==="**";)s++;s!==i&&t.splice(i,s-i);}return t})}levelOneOptimize(e){return e.map(t=>(t=t.reduce((i,s)=>{let h=i[i.length-1];return s==="**"&&h==="**"?i:s===".."&&h&&h!==".."&&h!=="."&&h!=="**"?(i.pop(),i):(i.push(s),i)},[]),t.length===0?[""]:t))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=false;do{if(t=false,!this.preserveMultipleSlashes){for(let s=1;s<e.length-1;s++){let h=e[s];s===1&&h===""&&e[0]===""||(h==="."||h==="")&&(t=true,e.splice(s,1),s--);}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(t=true,e.pop());}let i=0;for(;(i=e.indexOf("..",i+1))!==-1;){let s=e[i-1];s&&s!=="."&&s!==".."&&s!=="**"&&(t=true,e.splice(i-1,2),i-=2);}}while(t);return e.length===0?[""]:e}firstPhasePreProcess(e){let t=false;do{t=false;for(let i of e){let s=-1;for(;(s=i.indexOf("**",s+1))!==-1;){let n=s;for(;i[n+1]==="**";)n++;n>s&&i.splice(s+1,n-s);let o=i[s+1],a=i[s+2],l=i[s+3];if(o!==".."||!a||a==="."||a===".."||!l||l==="."||l==="..")continue;t=true,i.splice(s,1);let u=i.slice(0);u[s]="**",e.push(u),s--;}if(!this.preserveMultipleSlashes){for(let n=1;n<i.length-1;n++){let o=i[n];n===1&&o===""&&i[0]===""||(o==="."||o==="")&&(t=true,i.splice(n,1),n--);}i[0]==="."&&i.length===2&&(i[1]==="."||i[1]==="")&&(t=true,i.pop());}let h=0;for(;(h=i.indexOf("..",h+1))!==-1;){let n=i[h-1];if(n&&n!=="."&&n!==".."&&n!=="**"){t=true;let o=h===1&&i[h+1]==="**"?["."]:[];i.splice(h-1,2,...o),i.length===0&&i.push(""),h-=2;}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let i=t+1;i<e.length;i++){let s=this.partsMatch(e[t],e[i],!this.preserveMultipleSlashes);if(s){e[t]=[],e[i]=s;break}}return e.filter(t=>t.length)}partsMatch(e,t,i=false){let s=0,h=0,n=[],o="";for(;s<e.length&&h<t.length;)if(e[s]===t[h])n.push(o==="b"?t[h]:e[s]),s++,h++;else if(i&&e[s]==="**"&&t[h]===e[s+1])n.push(e[s]),s++;else if(i&&t[h]==="**"&&e[s]===t[h+1])n.push(t[h]),h++;else if(e[s]==="*"&&t[h]&&(this.options.dot||!t[h].startsWith("."))&&t[h]!=="**"){if(o==="b")return false;o="a",n.push(e[s]),s++,h++;}else if(t[h]==="*"&&e[s]&&(this.options.dot||!e[s].startsWith("."))&&e[s]!=="**"){if(o==="a")return false;o="b",n.push(t[h]),s++,h++;}else return false;return e.length===t.length&&n}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=false,i=0;for(let s=0;s<e.length&&e.charAt(s)==="!";s++)t=!t,i++;i&&(this.pattern=e.slice(i)),this.negate=t;}matchOne(e,t,i=false){let s=this.options;if(this.isWindows){let E=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),b=!E&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),x=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),v=!x&&t[0]===""&&t[1]===""&&t[2]==="?"&&typeof t[3]=="string"&&/^[a-z]:$/i.test(t[3]),R=b?3:E?0:void 0,A=v?3:x?0:void 0;if(typeof R=="number"&&typeof A=="number"){let[T,M]=[e[R],t[A]];T.toLowerCase()===M.toLowerCase()&&(t[A]=T,A>R?t=t.slice(A):R>A&&(e=e.slice(R)));}}let{optimizationLevel:h=1}=this.options;h>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:t}),this.debug("matchOne",e.length,t.length);for(var n=0,o=0,a=e.length,l=t.length;n<a&&o<l;n++,o++){this.debug("matchOne loop");var u=t[o],d=e[n];if(this.debug(t,u,d),u===false)return false;if(u===ht){this.debug("GLOBSTAR",[t,u,d]);var f=n,w=o+1;if(w===l){for(this.debug("** at the end");n<a;n++)if(e[n]==="."||e[n]===".."||!s.dot&&e[n].charAt(0)===".")return false;return true}for(;f<a;){var S=e[f];if(this.debug(`
2
+ globstar while`,e,f,t,w,S),this.matchOne(e.slice(f),t.slice(w),i))return this.debug("globstar found match!",f,a,S),true;if(S==="."||S===".."||!s.dot&&S.charAt(0)==="."){this.debug("dot detected!",e,f,t,w);break}this.debug("globstar swallow a segment, and continue"),f++;}return !!(i&&(this.debug(`
3
+ >>> no match, partial?`,e,f,t,w),f===a))}let E;if(typeof u=="string"?(E=d===u,this.debug("string match",u,d,E)):(E=u.test(d),this.debug("pattern match",u,d,E)),!E)return false}if(n===a&&o===l)return true;if(n===a)return i;if(o===l)return n===a-1&&e[n]==="";throw new Error("wtf?")}braceExpand(){return Tr(this.pattern,this.options)}parse(e){Bi(e);let t=this.options;if(e==="**")return ht;if(e==="")return "";let i,s=null;(i=e.match(Yh))?s=t.dot?Xh:Kh:(i=e.match($h))?s=(t.nocase?t.dot?Ih:Gh:t.dot?Uh:Bh)(i[1]):(i=e.match(Qh))?s=(t.nocase?t.dot?en:tn:t.dot?sn:rn)(i):(i=e.match(Hh))?s=t.dot?qh:Jh:(i=e.match(Zh))&&(s=Vh);let h=xr.fromGlob(e,this.options).toMMPattern();return s&&typeof h=="object"&&Reflect.defineProperty(h,"test",{value:s}),h}makeRe(){if(this.regexp||this.regexp===false)return this.regexp;let e=this.set;if(!e.length)return this.regexp=false,this.regexp;let t=this.options,i=t.noglobstar?on:t.dot?an:ln,s=new Set(t.nocase?["i"]:[]),h=e.map(a=>{let l=a.map(d=>{if(d instanceof RegExp)for(let f of d.flags.split(""))s.add(f);return typeof d=="string"?dn(d):d===ht?ht:d._src});l.forEach((d,f)=>{let w=l[f+1],S=l[f-1];d!==ht||S===ht||(S===void 0?w!==void 0&&w!==ht?l[f+1]="(?:\\/|"+i+"\\/)?"+w:l[f]=i:w===void 0?l[f-1]=S+"(?:\\/|\\/"+i+")?":w!==ht&&(l[f-1]=S+"(?:\\/|\\/"+i+"\\/)"+w,l[f+1]=ht));});let u=l.filter(d=>d!==ht);if(this.partial&&u.length>=1){let d=[];for(let f=1;f<=u.length;f++)d.push(u.slice(0,f).join("/"));return "(?:"+d.join("|")+")"}return u.join("/")}).join("|"),[n,o]=e.length>1?["(?:",")"]:["",""];h="^"+n+h+o+"$",this.partial&&(h="^(?:\\/|"+n+h.slice(1,-1)+o+")$"),this.negate&&(h="^(?!"+h+").+$");try{this.regexp=new RegExp(h,[...s].join(""));}catch{this.regexp=false;}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug("match",e,this.pattern),this.comment)return false;if(this.empty)return e==="";if(e==="/"&&t)return true;let i=this.options;this.isWindows&&(e=e.split("\\").join("/"));let s=this.slashSplit(e);this.debug(this.pattern,"split",s);let h=this.set;this.debug(this.pattern,"set",h);let n=s[s.length-1];if(!n)for(let o=s.length-2;!n&&o>=0;o--)n=s[o];for(let o=0;o<h.length;o++){let a=h[o],l=s;if(i.matchBase&&a.length===1&&(l=[n]),this.matchOne(l,a,t))return i.flipNegate?true:!this.negate}return i.flipNegate?false:this.negate}static defaults(e){return nt.defaults(e).Minimatch}};nt.AST=xr;nt.Minimatch=ae;nt.escape=Cr;nt.unescape=Ce;var mn=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Mr=new Set,ns=typeof process=="object"&&process?process:{},Lr=(e,t,i,s)=>{typeof ns.emitWarning=="function"?ns.emitWarning(e,t,i,s):console.error(`[${i}] ${t}: ${e}`);},Ui=globalThis.AbortController,Ls=globalThis.AbortSignal;if(typeof Ui>"u"){Ls=class{constructor(){chunkQBAJWPDZ_cjs.d(this,"onabort");chunkQBAJWPDZ_cjs.d(this,"_onabort",[]);chunkQBAJWPDZ_cjs.d(this,"reason");chunkQBAJWPDZ_cjs.d(this,"aborted",false);}addEventListener(i,s){this._onabort.push(s);}},Ui=class{constructor(){chunkQBAJWPDZ_cjs.d(this,"signal",new Ls);t();}abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=true;for(let s of this.signal._onabort)s(i);this.signal.onabort?.(i);}}};let e=ns.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",t=()=>{e&&(e=false,Lr("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",t));};}var wn=e=>!Mr.has(e),Yt=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),Wr=e=>Yt(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?Di:null:null,Di=class extends Array{constructor(e){super(e),this.fill(0);}},zt,Oe,yn=(zt=class{constructor(t,i){chunkQBAJWPDZ_cjs.d(this,"heap");chunkQBAJWPDZ_cjs.d(this,"length");if(!chunkQBAJWPDZ_cjs.e(zt,Oe))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new i(t),this.length=0;}static create(t){let i=Wr(t);if(!i)return [];chunkQBAJWPDZ_cjs.g(zt,Oe,true);let s=new zt(t,i);return chunkQBAJWPDZ_cjs.g(zt,Oe,false),s}push(t){this.heap[this.length++]=t;}pop(){return this.heap[--this.length]}},Oe=new WeakMap,chunkQBAJWPDZ_cjs.f(zt,Oe,false),zt),qs,Zs,yt,ut,kt,de,Rt,Ae,Fe,Ct,G,Ot,$,P,O,it,pt,tt,Y,At,K,Ft,Tt,ft,dt,Mt,ie,st,Te,y,os,ge,Ut,ti,gt,Dr,me,Me,ei,Kt,Xt,as,Pi,ji,W,ls,qe,Qt,cs,Le,Hi=(Le=class{constructor(t){chunkQBAJWPDZ_cjs.f(this,y);chunkQBAJWPDZ_cjs.f(this,yt);chunkQBAJWPDZ_cjs.f(this,ut);chunkQBAJWPDZ_cjs.f(this,kt);chunkQBAJWPDZ_cjs.f(this,de);chunkQBAJWPDZ_cjs.f(this,Rt);chunkQBAJWPDZ_cjs.f(this,Ae);chunkQBAJWPDZ_cjs.f(this,Fe);chunkQBAJWPDZ_cjs.f(this,Ct);chunkQBAJWPDZ_cjs.d(this,"ttl");chunkQBAJWPDZ_cjs.d(this,"ttlResolution");chunkQBAJWPDZ_cjs.d(this,"ttlAutopurge");chunkQBAJWPDZ_cjs.d(this,"updateAgeOnGet");chunkQBAJWPDZ_cjs.d(this,"updateAgeOnHas");chunkQBAJWPDZ_cjs.d(this,"allowStale");chunkQBAJWPDZ_cjs.d(this,"noDisposeOnSet");chunkQBAJWPDZ_cjs.d(this,"noUpdateTTL");chunkQBAJWPDZ_cjs.d(this,"maxEntrySize");chunkQBAJWPDZ_cjs.d(this,"sizeCalculation");chunkQBAJWPDZ_cjs.d(this,"noDeleteOnFetchRejection");chunkQBAJWPDZ_cjs.d(this,"noDeleteOnStaleGet");chunkQBAJWPDZ_cjs.d(this,"allowStaleOnFetchAbort");chunkQBAJWPDZ_cjs.d(this,"allowStaleOnFetchRejection");chunkQBAJWPDZ_cjs.d(this,"ignoreFetchAbort");chunkQBAJWPDZ_cjs.f(this,G);chunkQBAJWPDZ_cjs.f(this,Ot);chunkQBAJWPDZ_cjs.f(this,$);chunkQBAJWPDZ_cjs.f(this,P);chunkQBAJWPDZ_cjs.f(this,O);chunkQBAJWPDZ_cjs.f(this,it);chunkQBAJWPDZ_cjs.f(this,pt);chunkQBAJWPDZ_cjs.f(this,tt);chunkQBAJWPDZ_cjs.f(this,Y);chunkQBAJWPDZ_cjs.f(this,At);chunkQBAJWPDZ_cjs.f(this,K);chunkQBAJWPDZ_cjs.f(this,Ft);chunkQBAJWPDZ_cjs.f(this,Tt);chunkQBAJWPDZ_cjs.f(this,ft);chunkQBAJWPDZ_cjs.f(this,dt);chunkQBAJWPDZ_cjs.f(this,Mt);chunkQBAJWPDZ_cjs.f(this,ie);chunkQBAJWPDZ_cjs.f(this,st);chunkQBAJWPDZ_cjs.f(this,Te);chunkQBAJWPDZ_cjs.f(this,ge,()=>{});chunkQBAJWPDZ_cjs.f(this,Ut,()=>{});chunkQBAJWPDZ_cjs.f(this,ti,()=>{});chunkQBAJWPDZ_cjs.f(this,gt,()=>false);chunkQBAJWPDZ_cjs.f(this,me,t=>{});chunkQBAJWPDZ_cjs.f(this,Me,(t,i,s)=>{});chunkQBAJWPDZ_cjs.f(this,ei,(t,i,s,h)=>{if(s||h)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});chunkQBAJWPDZ_cjs.d(this,qs,"LRUCache");let{max:i=0,ttl:s,ttlResolution:h=1,ttlAutopurge:n,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:l,dispose:u,onInsert:d,disposeAfter:f,noDisposeOnSet:w,noUpdateTTL:S,maxSize:E=0,maxEntrySize:b=0,sizeCalculation:x,fetchMethod:v,memoMethod:R,noDeleteOnFetchRejection:A,noDeleteOnStaleGet:T,allowStaleOnFetchRejection:M,allowStaleOnFetchAbort:F,ignoreFetchAbort:j,perf:N}=t;if(N!==void 0&&typeof N?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(chunkQBAJWPDZ_cjs.g(this,Ct,N??mn),i!==0&&!Yt(i))throw new TypeError("max option must be a nonnegative integer");let B=i?Wr(i):Array;if(!B)throw new Error("invalid max value: "+i);if(chunkQBAJWPDZ_cjs.g(this,yt,i),chunkQBAJWPDZ_cjs.g(this,ut,E),this.maxEntrySize=b||chunkQBAJWPDZ_cjs.e(this,ut),this.sizeCalculation=x,this.sizeCalculation){if(!chunkQBAJWPDZ_cjs.e(this,ut)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(R!==void 0&&typeof R!="function")throw new TypeError("memoMethod must be a function if defined");if(chunkQBAJWPDZ_cjs.g(this,Fe,R),v!==void 0&&typeof v!="function")throw new TypeError("fetchMethod must be a function if specified");if(chunkQBAJWPDZ_cjs.g(this,Ae,v),chunkQBAJWPDZ_cjs.g(this,ie,!!v),chunkQBAJWPDZ_cjs.g(this,$,new Map),chunkQBAJWPDZ_cjs.g(this,P,new Array(i).fill(void 0)),chunkQBAJWPDZ_cjs.g(this,O,new Array(i).fill(void 0)),chunkQBAJWPDZ_cjs.g(this,it,new B(i)),chunkQBAJWPDZ_cjs.g(this,pt,new B(i)),chunkQBAJWPDZ_cjs.g(this,tt,0),chunkQBAJWPDZ_cjs.g(this,Y,0),chunkQBAJWPDZ_cjs.g(this,At,yn.create(i)),chunkQBAJWPDZ_cjs.g(this,G,0),chunkQBAJWPDZ_cjs.g(this,Ot,0),typeof u=="function"&&chunkQBAJWPDZ_cjs.g(this,kt,u),typeof d=="function"&&chunkQBAJWPDZ_cjs.g(this,de,d),typeof f=="function"?(chunkQBAJWPDZ_cjs.g(this,Rt,f),chunkQBAJWPDZ_cjs.g(this,K,[])):(chunkQBAJWPDZ_cjs.g(this,Rt,void 0),chunkQBAJWPDZ_cjs.g(this,K,void 0)),chunkQBAJWPDZ_cjs.g(this,Mt,!!chunkQBAJWPDZ_cjs.e(this,kt)),chunkQBAJWPDZ_cjs.g(this,Te,!!chunkQBAJWPDZ_cjs.e(this,de)),chunkQBAJWPDZ_cjs.g(this,st,!!chunkQBAJWPDZ_cjs.e(this,Rt)),this.noDisposeOnSet=!!w,this.noUpdateTTL=!!S,this.noDeleteOnFetchRejection=!!A,this.allowStaleOnFetchRejection=!!M,this.allowStaleOnFetchAbort=!!F,this.ignoreFetchAbort=!!j,this.maxEntrySize!==0){if(chunkQBAJWPDZ_cjs.e(this,ut)!==0&&!Yt(chunkQBAJWPDZ_cjs.e(this,ut)))throw new TypeError("maxSize must be a positive integer if specified");if(!Yt(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");chunkQBAJWPDZ_cjs.h(this,y,Dr).call(this);}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!T,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=Yt(h)||h===0?h:1,this.ttlAutopurge=!!n,this.ttl=s||0,this.ttl){if(!Yt(this.ttl))throw new TypeError("ttl must be a positive integer if specified");chunkQBAJWPDZ_cjs.h(this,y,os).call(this);}if(chunkQBAJWPDZ_cjs.e(this,yt)===0&&this.ttl===0&&chunkQBAJWPDZ_cjs.e(this,ut)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!chunkQBAJWPDZ_cjs.e(this,yt)&&!chunkQBAJWPDZ_cjs.e(this,ut)){let L="LRU_CACHE_UNBOUNDED";wn(L)&&(Mr.add(L),Lr("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",L,Le));}}get perf(){return chunkQBAJWPDZ_cjs.e(this,Ct)}static unsafeExposeInternals(t){return {starts:chunkQBAJWPDZ_cjs.e(t,Tt),ttls:chunkQBAJWPDZ_cjs.e(t,ft),autopurgeTimers:chunkQBAJWPDZ_cjs.e(t,dt),sizes:chunkQBAJWPDZ_cjs.e(t,Ft),keyMap:chunkQBAJWPDZ_cjs.e(t,$),keyList:chunkQBAJWPDZ_cjs.e(t,P),valList:chunkQBAJWPDZ_cjs.e(t,O),next:chunkQBAJWPDZ_cjs.e(t,it),prev:chunkQBAJWPDZ_cjs.e(t,pt),get head(){return chunkQBAJWPDZ_cjs.e(t,tt)},get tail(){return chunkQBAJWPDZ_cjs.e(t,Y)},free:chunkQBAJWPDZ_cjs.e(t,At),isBackgroundFetch:i=>{var s;return chunkQBAJWPDZ_cjs.h(s=t,y,W).call(s,i)},backgroundFetch:(i,s,h,n)=>{var o;return chunkQBAJWPDZ_cjs.h(o=t,y,ji).call(o,i,s,h,n)},moveToTail:i=>{var s;return chunkQBAJWPDZ_cjs.h(s=t,y,qe).call(s,i)},indexes:i=>{var s;return chunkQBAJWPDZ_cjs.h(s=t,y,Kt).call(s,i)},rindexes:i=>{var s;return chunkQBAJWPDZ_cjs.h(s=t,y,Xt).call(s,i)},isStale:i=>{var s;return chunkQBAJWPDZ_cjs.e(s=t,gt).call(s,i)}}}get max(){return chunkQBAJWPDZ_cjs.e(this,yt)}get maxSize(){return chunkQBAJWPDZ_cjs.e(this,ut)}get calculatedSize(){return chunkQBAJWPDZ_cjs.e(this,Ot)}get size(){return chunkQBAJWPDZ_cjs.e(this,G)}get fetchMethod(){return chunkQBAJWPDZ_cjs.e(this,Ae)}get memoMethod(){return chunkQBAJWPDZ_cjs.e(this,Fe)}get dispose(){return chunkQBAJWPDZ_cjs.e(this,kt)}get onInsert(){return chunkQBAJWPDZ_cjs.e(this,de)}get disposeAfter(){return chunkQBAJWPDZ_cjs.e(this,Rt)}getRemainingTTL(t){return chunkQBAJWPDZ_cjs.e(this,$).has(t)?1/0:0}*entries(){for(let t of chunkQBAJWPDZ_cjs.h(this,y,Kt).call(this))chunkQBAJWPDZ_cjs.e(this,O)[t]!==void 0&&chunkQBAJWPDZ_cjs.e(this,P)[t]!==void 0&&!chunkQBAJWPDZ_cjs.h(this,y,W).call(this,chunkQBAJWPDZ_cjs.e(this,O)[t])&&(yield [chunkQBAJWPDZ_cjs.e(this,P)[t],chunkQBAJWPDZ_cjs.e(this,O)[t]]);}*rentries(){for(let t of chunkQBAJWPDZ_cjs.h(this,y,Xt).call(this))chunkQBAJWPDZ_cjs.e(this,O)[t]!==void 0&&chunkQBAJWPDZ_cjs.e(this,P)[t]!==void 0&&!chunkQBAJWPDZ_cjs.h(this,y,W).call(this,chunkQBAJWPDZ_cjs.e(this,O)[t])&&(yield [chunkQBAJWPDZ_cjs.e(this,P)[t],chunkQBAJWPDZ_cjs.e(this,O)[t]]);}*keys(){for(let t of chunkQBAJWPDZ_cjs.h(this,y,Kt).call(this)){let i=chunkQBAJWPDZ_cjs.e(this,P)[t];i!==void 0&&!chunkQBAJWPDZ_cjs.h(this,y,W).call(this,chunkQBAJWPDZ_cjs.e(this,O)[t])&&(yield i);}}*rkeys(){for(let t of chunkQBAJWPDZ_cjs.h(this,y,Xt).call(this)){let i=chunkQBAJWPDZ_cjs.e(this,P)[t];i!==void 0&&!chunkQBAJWPDZ_cjs.h(this,y,W).call(this,chunkQBAJWPDZ_cjs.e(this,O)[t])&&(yield i);}}*values(){for(let t of chunkQBAJWPDZ_cjs.h(this,y,Kt).call(this))chunkQBAJWPDZ_cjs.e(this,O)[t]!==void 0&&!chunkQBAJWPDZ_cjs.h(this,y,W).call(this,chunkQBAJWPDZ_cjs.e(this,O)[t])&&(yield chunkQBAJWPDZ_cjs.e(this,O)[t]);}*rvalues(){for(let t of chunkQBAJWPDZ_cjs.h(this,y,Xt).call(this))chunkQBAJWPDZ_cjs.e(this,O)[t]!==void 0&&!chunkQBAJWPDZ_cjs.h(this,y,W).call(this,chunkQBAJWPDZ_cjs.e(this,O)[t])&&(yield chunkQBAJWPDZ_cjs.e(this,O)[t]);}[(Zs=Symbol.iterator,qs=Symbol.toStringTag,Zs)](){return this.entries()}find(t,i={}){for(let s of chunkQBAJWPDZ_cjs.h(this,y,Kt).call(this)){let h=chunkQBAJWPDZ_cjs.e(this,O)[s],n=chunkQBAJWPDZ_cjs.h(this,y,W).call(this,h)?h.__staleWhileFetching:h;if(n!==void 0&&t(n,chunkQBAJWPDZ_cjs.e(this,P)[s],this))return this.get(chunkQBAJWPDZ_cjs.e(this,P)[s],i)}}forEach(t,i=this){for(let s of chunkQBAJWPDZ_cjs.h(this,y,Kt).call(this)){let h=chunkQBAJWPDZ_cjs.e(this,O)[s],n=chunkQBAJWPDZ_cjs.h(this,y,W).call(this,h)?h.__staleWhileFetching:h;n!==void 0&&t.call(i,n,chunkQBAJWPDZ_cjs.e(this,P)[s],this);}}rforEach(t,i=this){for(let s of chunkQBAJWPDZ_cjs.h(this,y,Xt).call(this)){let h=chunkQBAJWPDZ_cjs.e(this,O)[s],n=chunkQBAJWPDZ_cjs.h(this,y,W).call(this,h)?h.__staleWhileFetching:h;n!==void 0&&t.call(i,n,chunkQBAJWPDZ_cjs.e(this,P)[s],this);}}purgeStale(){let t=false;for(let i of chunkQBAJWPDZ_cjs.h(this,y,Xt).call(this,{allowStale:true}))chunkQBAJWPDZ_cjs.e(this,gt).call(this,i)&&(chunkQBAJWPDZ_cjs.h(this,y,Qt).call(this,chunkQBAJWPDZ_cjs.e(this,P)[i],"expire"),t=true);return t}info(t){let i=chunkQBAJWPDZ_cjs.e(this,$).get(t);if(i===void 0)return;let s=chunkQBAJWPDZ_cjs.e(this,O)[i],h=chunkQBAJWPDZ_cjs.h(this,y,W).call(this,s)?s.__staleWhileFetching:s;if(h===void 0)return;let n={value:h};if(chunkQBAJWPDZ_cjs.e(this,ft)&&chunkQBAJWPDZ_cjs.e(this,Tt)){let o=chunkQBAJWPDZ_cjs.e(this,ft)[i],a=chunkQBAJWPDZ_cjs.e(this,Tt)[i];if(o&&a){let l=o-(chunkQBAJWPDZ_cjs.e(this,Ct).now()-a);n.ttl=l,n.start=Date.now();}}return chunkQBAJWPDZ_cjs.e(this,Ft)&&(n.size=chunkQBAJWPDZ_cjs.e(this,Ft)[i]),n}dump(){let t=[];for(let i of chunkQBAJWPDZ_cjs.h(this,y,Kt).call(this,{allowStale:true})){let s=chunkQBAJWPDZ_cjs.e(this,P)[i],h=chunkQBAJWPDZ_cjs.e(this,O)[i],n=chunkQBAJWPDZ_cjs.h(this,y,W).call(this,h)?h.__staleWhileFetching:h;if(n===void 0||s===void 0)continue;let o={value:n};if(chunkQBAJWPDZ_cjs.e(this,ft)&&chunkQBAJWPDZ_cjs.e(this,Tt)){o.ttl=chunkQBAJWPDZ_cjs.e(this,ft)[i];let a=chunkQBAJWPDZ_cjs.e(this,Ct).now()-chunkQBAJWPDZ_cjs.e(this,Tt)[i];o.start=Math.floor(Date.now()-a);}chunkQBAJWPDZ_cjs.e(this,Ft)&&(o.size=chunkQBAJWPDZ_cjs.e(this,Ft)[i]),t.unshift([s,o]);}return t}load(t){this.clear();for(let[i,s]of t){if(s.start){let h=Date.now()-s.start;s.start=chunkQBAJWPDZ_cjs.e(this,Ct).now()-h;}this.set(i,s.value,s);}}set(t,i,s={}){var w,S,E,b;if(i===void 0)return this.delete(t),this;let{ttl:h=this.ttl,start:n,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:l}=s,{noUpdateTTL:u=this.noUpdateTTL}=s,d=chunkQBAJWPDZ_cjs.e(this,ei).call(this,t,i,s.size||0,a);if(this.maxEntrySize&&d>this.maxEntrySize)return l&&(l.set="miss",l.maxEntrySizeExceeded=true),chunkQBAJWPDZ_cjs.h(this,y,Qt).call(this,t,"set"),this;let f=chunkQBAJWPDZ_cjs.e(this,G)===0?void 0:chunkQBAJWPDZ_cjs.e(this,$).get(t);if(f===void 0)f=chunkQBAJWPDZ_cjs.e(this,G)===0?chunkQBAJWPDZ_cjs.e(this,Y):chunkQBAJWPDZ_cjs.e(this,At).length!==0?chunkQBAJWPDZ_cjs.e(this,At).pop():chunkQBAJWPDZ_cjs.e(this,G)===chunkQBAJWPDZ_cjs.e(this,yt)?chunkQBAJWPDZ_cjs.h(this,y,Pi).call(this,false):chunkQBAJWPDZ_cjs.e(this,G),chunkQBAJWPDZ_cjs.e(this,P)[f]=t,chunkQBAJWPDZ_cjs.e(this,O)[f]=i,chunkQBAJWPDZ_cjs.e(this,$).set(t,f),chunkQBAJWPDZ_cjs.e(this,it)[chunkQBAJWPDZ_cjs.e(this,Y)]=f,chunkQBAJWPDZ_cjs.e(this,pt)[f]=chunkQBAJWPDZ_cjs.e(this,Y),chunkQBAJWPDZ_cjs.g(this,Y,f),chunkQBAJWPDZ_cjs.i(this,G)._++,chunkQBAJWPDZ_cjs.e(this,Me).call(this,f,d,l),l&&(l.set="add"),u=false,chunkQBAJWPDZ_cjs.e(this,Te)&&((w=chunkQBAJWPDZ_cjs.e(this,de))==null||w.call(this,i,t,"add"));else {chunkQBAJWPDZ_cjs.h(this,y,qe).call(this,f);let x=chunkQBAJWPDZ_cjs.e(this,O)[f];if(i!==x){if(chunkQBAJWPDZ_cjs.e(this,ie)&&chunkQBAJWPDZ_cjs.h(this,y,W).call(this,x)){x.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:v}=x;v!==void 0&&!o&&(chunkQBAJWPDZ_cjs.e(this,Mt)&&((S=chunkQBAJWPDZ_cjs.e(this,kt))==null||S.call(this,v,t,"set")),chunkQBAJWPDZ_cjs.e(this,st)&&chunkQBAJWPDZ_cjs.e(this,K)?.push([v,t,"set"]));}else o||(chunkQBAJWPDZ_cjs.e(this,Mt)&&((E=chunkQBAJWPDZ_cjs.e(this,kt))==null||E.call(this,x,t,"set")),chunkQBAJWPDZ_cjs.e(this,st)&&chunkQBAJWPDZ_cjs.e(this,K)?.push([x,t,"set"]));if(chunkQBAJWPDZ_cjs.e(this,me).call(this,f),chunkQBAJWPDZ_cjs.e(this,Me).call(this,f,d,l),chunkQBAJWPDZ_cjs.e(this,O)[f]=i,l){l.set="replace";let v=x&&chunkQBAJWPDZ_cjs.h(this,y,W).call(this,x)?x.__staleWhileFetching:x;v!==void 0&&(l.oldValue=v);}}else l&&(l.set="update");chunkQBAJWPDZ_cjs.e(this,Te)&&this.onInsert?.(i,t,i===x?"update":"replace");}if(h!==0&&!chunkQBAJWPDZ_cjs.e(this,ft)&&chunkQBAJWPDZ_cjs.h(this,y,os).call(this),chunkQBAJWPDZ_cjs.e(this,ft)&&(u||chunkQBAJWPDZ_cjs.e(this,ti).call(this,f,h,n),l&&chunkQBAJWPDZ_cjs.e(this,Ut).call(this,l,f)),!o&&chunkQBAJWPDZ_cjs.e(this,st)&&chunkQBAJWPDZ_cjs.e(this,K)){let x=chunkQBAJWPDZ_cjs.e(this,K),v;for(;v=x?.shift();)(b=chunkQBAJWPDZ_cjs.e(this,Rt))==null||b.call(this,...v);}return this}pop(){var t;try{for(;chunkQBAJWPDZ_cjs.e(this,G);){let i=chunkQBAJWPDZ_cjs.e(this,O)[chunkQBAJWPDZ_cjs.e(this,tt)];if(chunkQBAJWPDZ_cjs.h(this,y,Pi).call(this,!0),chunkQBAJWPDZ_cjs.h(this,y,W).call(this,i)){if(i.__staleWhileFetching)return i.__staleWhileFetching}else if(i!==void 0)return i}}finally{if(chunkQBAJWPDZ_cjs.e(this,st)&&chunkQBAJWPDZ_cjs.e(this,K)){let i=chunkQBAJWPDZ_cjs.e(this,K),s;for(;s=i?.shift();)(t=chunkQBAJWPDZ_cjs.e(this,Rt))==null||t.call(this,...s);}}}has(t,i={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:h}=i,n=chunkQBAJWPDZ_cjs.e(this,$).get(t);if(n!==void 0){let o=chunkQBAJWPDZ_cjs.e(this,O)[n];if(chunkQBAJWPDZ_cjs.h(this,y,W).call(this,o)&&o.__staleWhileFetching===void 0)return false;if(chunkQBAJWPDZ_cjs.e(this,gt).call(this,n))h&&(h.has="stale",chunkQBAJWPDZ_cjs.e(this,Ut).call(this,h,n));else return s&&chunkQBAJWPDZ_cjs.e(this,ge).call(this,n),h&&(h.has="hit",chunkQBAJWPDZ_cjs.e(this,Ut).call(this,h,n)),true}else h&&(h.has="miss");return false}peek(t,i={}){let{allowStale:s=this.allowStale}=i,h=chunkQBAJWPDZ_cjs.e(this,$).get(t);if(h===void 0||!s&&chunkQBAJWPDZ_cjs.e(this,gt).call(this,h))return;let n=chunkQBAJWPDZ_cjs.e(this,O)[h];return chunkQBAJWPDZ_cjs.h(this,y,W).call(this,n)?n.__staleWhileFetching:n}async fetch(t,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:h=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:l=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:d=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:w=this.allowStaleOnFetchRejection,ignoreFetchAbort:S=this.ignoreFetchAbort,allowStaleOnFetchAbort:E=this.allowStaleOnFetchAbort,context:b,forceRefresh:x=false,status:v,signal:R}=i;if(!chunkQBAJWPDZ_cjs.e(this,ie))return v&&(v.fetch="get"),this.get(t,{allowStale:s,updateAgeOnGet:h,noDeleteOnStaleGet:n,status:v});let A={allowStale:s,updateAgeOnGet:h,noDeleteOnStaleGet:n,ttl:o,noDisposeOnSet:a,size:l,sizeCalculation:u,noUpdateTTL:d,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:w,allowStaleOnFetchAbort:E,ignoreFetchAbort:S,status:v,signal:R},T=chunkQBAJWPDZ_cjs.e(this,$).get(t);if(T===void 0){v&&(v.fetch="miss");let M=chunkQBAJWPDZ_cjs.h(this,y,ji).call(this,t,T,A,b);return M.__returned=M}else {let M=chunkQBAJWPDZ_cjs.e(this,O)[T];if(chunkQBAJWPDZ_cjs.h(this,y,W).call(this,M)){let B=s&&M.__staleWhileFetching!==void 0;return v&&(v.fetch="inflight",B&&(v.returnedStale=true)),B?M.__staleWhileFetching:M.__returned=M}let F=chunkQBAJWPDZ_cjs.e(this,gt).call(this,T);if(!x&&!F)return v&&(v.fetch="hit"),chunkQBAJWPDZ_cjs.h(this,y,qe).call(this,T),h&&chunkQBAJWPDZ_cjs.e(this,ge).call(this,T),v&&chunkQBAJWPDZ_cjs.e(this,Ut).call(this,v,T),M;let j=chunkQBAJWPDZ_cjs.h(this,y,ji).call(this,t,T,A,b),N=j.__staleWhileFetching!==void 0&&s;return v&&(v.fetch=F?"stale":"refresh",N&&F&&(v.returnedStale=true)),N?j.__staleWhileFetching:j.__returned=j}}async forceFetch(t,i={}){let s=await this.fetch(t,i);if(s===void 0)throw new Error("fetch() returned undefined");return s}memo(t,i={}){let s=chunkQBAJWPDZ_cjs.e(this,Fe);if(!s)throw new Error("no memoMethod provided to constructor");let{context:h,forceRefresh:n,...o}=i,a=this.get(t,o);if(!n&&a!==void 0)return a;let l=s(t,a,{options:o,context:h});return this.set(t,l,o),l}get(t,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:h=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:o}=i,a=chunkQBAJWPDZ_cjs.e(this,$).get(t);if(a!==void 0){let l=chunkQBAJWPDZ_cjs.e(this,O)[a],u=chunkQBAJWPDZ_cjs.h(this,y,W).call(this,l);return o&&chunkQBAJWPDZ_cjs.e(this,Ut).call(this,o,a),chunkQBAJWPDZ_cjs.e(this,gt).call(this,a)?(o&&(o.get="stale"),u?(o&&s&&l.__staleWhileFetching!==void 0&&(o.returnedStale=true),s?l.__staleWhileFetching:void 0):(n||chunkQBAJWPDZ_cjs.h(this,y,Qt).call(this,t,"expire"),o&&s&&(o.returnedStale=true),s?l:void 0)):(o&&(o.get="hit"),u?l.__staleWhileFetching:(chunkQBAJWPDZ_cjs.h(this,y,qe).call(this,a),h&&chunkQBAJWPDZ_cjs.e(this,ge).call(this,a),l))}else o&&(o.get="miss");}delete(t){return chunkQBAJWPDZ_cjs.h(this,y,Qt).call(this,t,"delete")}clear(){return chunkQBAJWPDZ_cjs.h(this,y,cs).call(this,"delete")}},yt=new WeakMap,ut=new WeakMap,kt=new WeakMap,de=new WeakMap,Rt=new WeakMap,Ae=new WeakMap,Fe=new WeakMap,Ct=new WeakMap,G=new WeakMap,Ot=new WeakMap,$=new WeakMap,P=new WeakMap,O=new WeakMap,it=new WeakMap,pt=new WeakMap,tt=new WeakMap,Y=new WeakMap,At=new WeakMap,K=new WeakMap,Ft=new WeakMap,Tt=new WeakMap,ft=new WeakMap,dt=new WeakMap,Mt=new WeakMap,ie=new WeakMap,st=new WeakMap,Te=new WeakMap,y=new WeakSet,os=function(){let t=new Di(chunkQBAJWPDZ_cjs.e(this,yt)),i=new Di(chunkQBAJWPDZ_cjs.e(this,yt));chunkQBAJWPDZ_cjs.g(this,ft,t),chunkQBAJWPDZ_cjs.g(this,Tt,i);let s=this.ttlAutopurge?new Array(chunkQBAJWPDZ_cjs.e(this,yt)):void 0;chunkQBAJWPDZ_cjs.g(this,dt,s),chunkQBAJWPDZ_cjs.g(this,ti,(o,a,l=chunkQBAJWPDZ_cjs.e(this,Ct).now())=>{if(i[o]=a!==0?l:0,t[o]=a,s?.[o]&&(clearTimeout(s[o]),s[o]=void 0),a!==0&&s){let u=setTimeout(()=>{chunkQBAJWPDZ_cjs.e(this,gt).call(this,o)&&chunkQBAJWPDZ_cjs.h(this,y,Qt).call(this,chunkQBAJWPDZ_cjs.e(this,P)[o],"expire");},a+1);u.unref&&u.unref(),s[o]=u;}}),chunkQBAJWPDZ_cjs.g(this,ge,o=>{i[o]=t[o]!==0?chunkQBAJWPDZ_cjs.e(this,Ct).now():0;}),chunkQBAJWPDZ_cjs.g(this,Ut,(o,a)=>{if(t[a]){let l=t[a],u=i[a];if(!l||!u)return;o.ttl=l,o.start=u,o.now=h||n();let d=o.now-u;o.remainingTTL=l-d;}});let h=0,n=()=>{let o=chunkQBAJWPDZ_cjs.e(this,Ct).now();if(this.ttlResolution>0){h=o;let a=setTimeout(()=>h=0,this.ttlResolution);a.unref&&a.unref();}return o};this.getRemainingTTL=o=>{let a=chunkQBAJWPDZ_cjs.e(this,$).get(o);if(a===void 0)return 0;let l=t[a],u=i[a];if(!l||!u)return 1/0;let d=(h||n())-u;return l-d},chunkQBAJWPDZ_cjs.g(this,gt,o=>{let a=i[o],l=t[o];return !!l&&!!a&&(h||n())-a>l});},ge=new WeakMap,Ut=new WeakMap,ti=new WeakMap,gt=new WeakMap,Dr=function(){let t=new Di(chunkQBAJWPDZ_cjs.e(this,yt));chunkQBAJWPDZ_cjs.g(this,Ot,0),chunkQBAJWPDZ_cjs.g(this,Ft,t),chunkQBAJWPDZ_cjs.g(this,me,i=>{chunkQBAJWPDZ_cjs.g(this,Ot,chunkQBAJWPDZ_cjs.e(this,Ot)-t[i]),t[i]=0;}),chunkQBAJWPDZ_cjs.g(this,ei,(i,s,h,n)=>{if(chunkQBAJWPDZ_cjs.h(this,y,W).call(this,s))return 0;if(!Yt(h))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(h=n(s,i),!Yt(h))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return h}),chunkQBAJWPDZ_cjs.g(this,Me,(i,s,h)=>{if(t[i]=s,chunkQBAJWPDZ_cjs.e(this,ut)){let n=chunkQBAJWPDZ_cjs.e(this,ut)-t[i];for(;chunkQBAJWPDZ_cjs.e(this,Ot)>n;)chunkQBAJWPDZ_cjs.h(this,y,Pi).call(this,true);}chunkQBAJWPDZ_cjs.g(this,Ot,chunkQBAJWPDZ_cjs.e(this,Ot)+t[i]),h&&(h.entrySize=s,h.totalCalculatedSize=chunkQBAJWPDZ_cjs.e(this,Ot));});},me=new WeakMap,Me=new WeakMap,ei=new WeakMap,Kt=function*({allowStale:t=this.allowStale}={}){if(chunkQBAJWPDZ_cjs.e(this,G))for(let i=chunkQBAJWPDZ_cjs.e(this,Y);!(!chunkQBAJWPDZ_cjs.h(this,y,as).call(this,i)||((t||!chunkQBAJWPDZ_cjs.e(this,gt).call(this,i))&&(yield i),i===chunkQBAJWPDZ_cjs.e(this,tt)));)i=chunkQBAJWPDZ_cjs.e(this,pt)[i];},Xt=function*({allowStale:t=this.allowStale}={}){if(chunkQBAJWPDZ_cjs.e(this,G))for(let i=chunkQBAJWPDZ_cjs.e(this,tt);!(!chunkQBAJWPDZ_cjs.h(this,y,as).call(this,i)||((t||!chunkQBAJWPDZ_cjs.e(this,gt).call(this,i))&&(yield i),i===chunkQBAJWPDZ_cjs.e(this,Y)));)i=chunkQBAJWPDZ_cjs.e(this,it)[i];},as=function(t){return t!==void 0&&chunkQBAJWPDZ_cjs.e(this,$).get(chunkQBAJWPDZ_cjs.e(this,P)[t])===t},Pi=function(t){var n;let i=chunkQBAJWPDZ_cjs.e(this,tt),s=chunkQBAJWPDZ_cjs.e(this,P)[i],h=chunkQBAJWPDZ_cjs.e(this,O)[i];return chunkQBAJWPDZ_cjs.e(this,ie)&&chunkQBAJWPDZ_cjs.h(this,y,W).call(this,h)?h.__abortController.abort(new Error("evicted")):(chunkQBAJWPDZ_cjs.e(this,Mt)||chunkQBAJWPDZ_cjs.e(this,st))&&(chunkQBAJWPDZ_cjs.e(this,Mt)&&((n=chunkQBAJWPDZ_cjs.e(this,kt))==null||n.call(this,h,s,"evict")),chunkQBAJWPDZ_cjs.e(this,st)&&chunkQBAJWPDZ_cjs.e(this,K)?.push([h,s,"evict"])),chunkQBAJWPDZ_cjs.e(this,me).call(this,i),chunkQBAJWPDZ_cjs.e(this,dt)?.[i]&&(clearTimeout(chunkQBAJWPDZ_cjs.e(this,dt)[i]),chunkQBAJWPDZ_cjs.e(this,dt)[i]=void 0),t&&(chunkQBAJWPDZ_cjs.e(this,P)[i]=void 0,chunkQBAJWPDZ_cjs.e(this,O)[i]=void 0,chunkQBAJWPDZ_cjs.e(this,At).push(i)),chunkQBAJWPDZ_cjs.e(this,G)===1?(chunkQBAJWPDZ_cjs.g(this,tt,chunkQBAJWPDZ_cjs.g(this,Y,0)),chunkQBAJWPDZ_cjs.e(this,At).length=0):chunkQBAJWPDZ_cjs.g(this,tt,chunkQBAJWPDZ_cjs.e(this,it)[i]),chunkQBAJWPDZ_cjs.e(this,$).delete(s),chunkQBAJWPDZ_cjs.i(this,G)._--,i},ji=function(t,i,s,h){let n=i===void 0?void 0:chunkQBAJWPDZ_cjs.e(this,O)[i];if(chunkQBAJWPDZ_cjs.h(this,y,W).call(this,n))return n;let o=new Ui,{signal:a}=s;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let l={signal:o.signal,options:s,context:h},u=(b,x=false)=>{let{aborted:v}=o.signal,R=s.ignoreFetchAbort&&b!==void 0,A=s.ignoreFetchAbort||!!(s.allowStaleOnFetchAbort&&b!==void 0);if(s.status&&(v&&!x?(s.status.fetchAborted=true,s.status.fetchError=o.signal.reason,R&&(s.status.fetchAbortIgnored=true)):s.status.fetchResolved=true),v&&!R&&!x)return f(o.signal.reason,A);let T=S,M=chunkQBAJWPDZ_cjs.e(this,O)[i];return (M===S||R&&x&&M===void 0)&&(b===void 0?T.__staleWhileFetching!==void 0?chunkQBAJWPDZ_cjs.e(this,O)[i]=T.__staleWhileFetching:chunkQBAJWPDZ_cjs.h(this,y,Qt).call(this,t,"fetch"):(s.status&&(s.status.fetchUpdated=true),this.set(t,b,l.options))),b},d=b=>(s.status&&(s.status.fetchRejected=true,s.status.fetchError=b),f(b,false)),f=(b,x)=>{let{aborted:v}=o.signal,R=v&&s.allowStaleOnFetchAbort,A=R||s.allowStaleOnFetchRejection,T=A||s.noDeleteOnFetchRejection,M=S;if(chunkQBAJWPDZ_cjs.e(this,O)[i]===S&&(!T||!x&&M.__staleWhileFetching===void 0?chunkQBAJWPDZ_cjs.h(this,y,Qt).call(this,t,"fetch"):R||(chunkQBAJWPDZ_cjs.e(this,O)[i]=M.__staleWhileFetching)),A)return s.status&&M.__staleWhileFetching!==void 0&&(s.status.returnedStale=true),M.__staleWhileFetching;if(M.__returned===M)throw b},w=(b,x)=>{var R;let v=(R=chunkQBAJWPDZ_cjs.e(this,Ae))==null?void 0:R.call(this,t,n,l);v&&v instanceof Promise&&v.then(A=>b(A===void 0?void 0:A),x),o.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(b(void 0),s.allowStaleOnFetchAbort&&(b=A=>u(A,true)));});};s.status&&(s.status.fetchDispatched=true);let S=new Promise(w).then(u,d),E=Object.assign(S,{__abortController:o,__staleWhileFetching:n,__returned:void 0});return i===void 0?(this.set(t,E,{...l.options,status:void 0}),i=chunkQBAJWPDZ_cjs.e(this,$).get(t)):chunkQBAJWPDZ_cjs.e(this,O)[i]=E,E},W=function(t){if(!chunkQBAJWPDZ_cjs.e(this,ie))return false;let i=t;return !!i&&i instanceof Promise&&i.hasOwnProperty("__staleWhileFetching")&&i.__abortController instanceof Ui},ls=function(t,i){chunkQBAJWPDZ_cjs.e(this,pt)[i]=t,chunkQBAJWPDZ_cjs.e(this,it)[t]=i;},qe=function(t){t!==chunkQBAJWPDZ_cjs.e(this,Y)&&(t===chunkQBAJWPDZ_cjs.e(this,tt)?chunkQBAJWPDZ_cjs.g(this,tt,chunkQBAJWPDZ_cjs.e(this,it)[t]):chunkQBAJWPDZ_cjs.h(this,y,ls).call(this,chunkQBAJWPDZ_cjs.e(this,pt)[t],chunkQBAJWPDZ_cjs.e(this,it)[t]),chunkQBAJWPDZ_cjs.h(this,y,ls).call(this,chunkQBAJWPDZ_cjs.e(this,Y),t),chunkQBAJWPDZ_cjs.g(this,Y,t));},Qt=function(t,i){var h,n;let s=false;if(chunkQBAJWPDZ_cjs.e(this,G)!==0){let o=chunkQBAJWPDZ_cjs.e(this,$).get(t);if(o!==void 0)if(chunkQBAJWPDZ_cjs.e(this,dt)?.[o]&&(clearTimeout(chunkQBAJWPDZ_cjs.e(this,dt)?.[o]),chunkQBAJWPDZ_cjs.e(this,dt)[o]=void 0),s=true,chunkQBAJWPDZ_cjs.e(this,G)===1)chunkQBAJWPDZ_cjs.h(this,y,cs).call(this,i);else {chunkQBAJWPDZ_cjs.e(this,me).call(this,o);let a=chunkQBAJWPDZ_cjs.e(this,O)[o];if(chunkQBAJWPDZ_cjs.h(this,y,W).call(this,a)?a.__abortController.abort(new Error("deleted")):(chunkQBAJWPDZ_cjs.e(this,Mt)||chunkQBAJWPDZ_cjs.e(this,st))&&(chunkQBAJWPDZ_cjs.e(this,Mt)&&((h=chunkQBAJWPDZ_cjs.e(this,kt))==null||h.call(this,a,t,i)),chunkQBAJWPDZ_cjs.e(this,st)&&chunkQBAJWPDZ_cjs.e(this,K)?.push([a,t,i])),chunkQBAJWPDZ_cjs.e(this,$).delete(t),chunkQBAJWPDZ_cjs.e(this,P)[o]=void 0,chunkQBAJWPDZ_cjs.e(this,O)[o]=void 0,o===chunkQBAJWPDZ_cjs.e(this,Y))chunkQBAJWPDZ_cjs.g(this,Y,chunkQBAJWPDZ_cjs.e(this,pt)[o]);else if(o===chunkQBAJWPDZ_cjs.e(this,tt))chunkQBAJWPDZ_cjs.g(this,tt,chunkQBAJWPDZ_cjs.e(this,it)[o]);else {let l=chunkQBAJWPDZ_cjs.e(this,pt)[o];chunkQBAJWPDZ_cjs.e(this,it)[l]=chunkQBAJWPDZ_cjs.e(this,it)[o];let u=chunkQBAJWPDZ_cjs.e(this,it)[o];chunkQBAJWPDZ_cjs.e(this,pt)[u]=chunkQBAJWPDZ_cjs.e(this,pt)[o];}chunkQBAJWPDZ_cjs.i(this,G)._--,chunkQBAJWPDZ_cjs.e(this,At).push(o);}}if(chunkQBAJWPDZ_cjs.e(this,st)&&chunkQBAJWPDZ_cjs.e(this,K)?.length){let o=chunkQBAJWPDZ_cjs.e(this,K),a;for(;a=o?.shift();)(n=chunkQBAJWPDZ_cjs.e(this,Rt))==null||n.call(this,...a);}return s},cs=function(t){var i,s;for(let h of chunkQBAJWPDZ_cjs.h(this,y,Xt).call(this,{allowStale:true})){let n=chunkQBAJWPDZ_cjs.e(this,O)[h];if(chunkQBAJWPDZ_cjs.h(this,y,W).call(this,n))n.__abortController.abort(new Error("deleted"));else {let o=chunkQBAJWPDZ_cjs.e(this,P)[h];chunkQBAJWPDZ_cjs.e(this,Mt)&&((i=chunkQBAJWPDZ_cjs.e(this,kt))==null||i.call(this,n,o,t)),chunkQBAJWPDZ_cjs.e(this,st)&&chunkQBAJWPDZ_cjs.e(this,K)?.push([n,o,t]);}}if(chunkQBAJWPDZ_cjs.e(this,$).clear(),chunkQBAJWPDZ_cjs.e(this,O).fill(void 0),chunkQBAJWPDZ_cjs.e(this,P).fill(void 0),chunkQBAJWPDZ_cjs.e(this,ft)&&chunkQBAJWPDZ_cjs.e(this,Tt)){chunkQBAJWPDZ_cjs.e(this,ft).fill(0),chunkQBAJWPDZ_cjs.e(this,Tt).fill(0);for(let h of chunkQBAJWPDZ_cjs.e(this,dt)??[])h!==void 0&&clearTimeout(h);chunkQBAJWPDZ_cjs.e(this,dt)?.fill(void 0);}if(chunkQBAJWPDZ_cjs.e(this,Ft)&&chunkQBAJWPDZ_cjs.e(this,Ft).fill(0),chunkQBAJWPDZ_cjs.g(this,tt,0),chunkQBAJWPDZ_cjs.g(this,Y,0),chunkQBAJWPDZ_cjs.e(this,At).length=0,chunkQBAJWPDZ_cjs.g(this,Ot,0),chunkQBAJWPDZ_cjs.g(this,G,0),chunkQBAJWPDZ_cjs.e(this,st)&&chunkQBAJWPDZ_cjs.e(this,K)){let h=chunkQBAJWPDZ_cjs.e(this,K),n;for(;n=h?.shift();)(s=chunkQBAJWPDZ_cjs.e(this,Rt))==null||s.call(this,...n);}},Le),Ws=typeof process=="object"&&process?process:{stdout:null,stderr:null},Ln=e=>!!e&&typeof e=="object"&&(e instanceof Gi||e instanceof Pr__default.default||Wn(e)||Dn(e)),Wn=e=>!!e&&typeof e=="object"&&e instanceof events.EventEmitter&&typeof e.pipe=="function"&&e.pipe!==Pr__default.default.Writable.prototype.pipe,Dn=e=>!!e&&typeof e=="object"&&e instanceof events.EventEmitter&&typeof e.write=="function"&&typeof e.end=="function",_t=Symbol("EOF"),$t=Symbol("maybeEmitEnd"),Vt=Symbol("emittedEnd"),Ci=Symbol("emittingEnd"),Be=Symbol("emittedError"),Oi=Symbol("closed"),Ds=Symbol("read"),Ai=Symbol("flush"),Ps=Symbol("flushChunk"),Et=Symbol("encoding"),ke=Symbol("decoder"),J=Symbol("flowing"),Ue=Symbol("paused"),Re=Symbol("resume"),q=Symbol("buffer"),et=Symbol("pipes"),Z=Symbol("bufferLength"),Xi=Symbol("bufferPush"),Fi=Symbol("bufferShift"),Q=Symbol("objectMode"),z=Symbol("destroyed"),Qi=Symbol("error"),ts=Symbol("emitData"),js=Symbol("emitEnd"),es=Symbol("emitEnd2"),Wt=Symbol("async"),is=Symbol("abort"),Ti=Symbol("aborted"),Ge=Symbol("signal"),le=Symbol("dataListeners"),ct=Symbol("discarded"),Ie=e=>Promise.resolve().then(e),Pn=e=>e(),jn=e=>e==="end"||e==="finish"||e==="prefinish",Nn=e=>e instanceof ArrayBuffer||!!e&&typeof e=="object"&&e.constructor&&e.constructor.name==="ArrayBuffer"&&e.byteLength>=0,zn=e=>!Buffer.isBuffer(e)&&ArrayBuffer.isView(e),jr=class{constructor(e,t,i){chunkQBAJWPDZ_cjs.d(this,"src");chunkQBAJWPDZ_cjs.d(this,"dest");chunkQBAJWPDZ_cjs.d(this,"opts");chunkQBAJWPDZ_cjs.d(this,"ondrain");this.src=e,this.dest=t,this.opts=i,this.ondrain=()=>e[Re](),this.dest.on("drain",this.ondrain);}unpipe(){this.dest.removeListener("drain",this.ondrain);}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end();}},_n=class extends jr{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe();}constructor(e,t,i){super(e,t,i),this.proxyErrors=s=>this.dest.emit("error",s),e.on("error",this.proxyErrors);}},$n=e=>!!e.objectMode,Bn=e=>!e.objectMode&&!!e.encoding&&e.encoding!=="buffer",Vs,Ys,Ks,Xs,Qs,tr,er,ir,sr,rr,hr,nr,or,ar,lr,cr,ur,pr,fr,Gi=class extends events.EventEmitter{constructor(...t){let i=t[0]||{};super();chunkQBAJWPDZ_cjs.d(this,fr,false);chunkQBAJWPDZ_cjs.d(this,pr,false);chunkQBAJWPDZ_cjs.d(this,ur,[]);chunkQBAJWPDZ_cjs.d(this,cr,[]);chunkQBAJWPDZ_cjs.d(this,lr);chunkQBAJWPDZ_cjs.d(this,ar);chunkQBAJWPDZ_cjs.d(this,or);chunkQBAJWPDZ_cjs.d(this,nr);chunkQBAJWPDZ_cjs.d(this,hr,false);chunkQBAJWPDZ_cjs.d(this,rr,false);chunkQBAJWPDZ_cjs.d(this,sr,false);chunkQBAJWPDZ_cjs.d(this,ir,false);chunkQBAJWPDZ_cjs.d(this,er,null);chunkQBAJWPDZ_cjs.d(this,tr,0);chunkQBAJWPDZ_cjs.d(this,Qs,false);chunkQBAJWPDZ_cjs.d(this,Xs);chunkQBAJWPDZ_cjs.d(this,Ks,false);chunkQBAJWPDZ_cjs.d(this,Ys,0);chunkQBAJWPDZ_cjs.d(this,Vs,false);chunkQBAJWPDZ_cjs.d(this,"writable",true);chunkQBAJWPDZ_cjs.d(this,"readable",true);if(i.objectMode&&typeof i.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");$n(i)?(this[Q]=true,this[Et]=null):Bn(i)?(this[Et]=i.encoding,this[Q]=false):(this[Q]=false,this[Et]=null),this[Wt]=!!i.async,this[ke]=this[Et]?new string_decoder.StringDecoder(this[Et]):null,i&&i.debugExposeBuffer===true&&Object.defineProperty(this,"buffer",{get:()=>this[q]}),i&&i.debugExposePipes===true&&Object.defineProperty(this,"pipes",{get:()=>this[et]});let{signal:s}=i;s&&(this[Ge]=s,s.aborted?this[is]():s.addEventListener("abort",()=>this[is]()));}get bufferLength(){return this[Z]}get encoding(){return this[Et]}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[Q]}set objectMode(t){throw new Error("objectMode must be set at instantiation time")}get async(){return this[Wt]}set async(t){this[Wt]=this[Wt]||!!t;}[(fr=J,pr=Ue,ur=et,cr=q,lr=Q,ar=Et,or=Wt,nr=ke,hr=_t,rr=Vt,sr=Ci,ir=Oi,er=Be,tr=Z,Qs=z,Xs=Ge,Ks=Ti,Ys=le,Vs=ct,is)](){this[Ti]=true,this.emit("abort",this[Ge]?.reason),this.destroy(this[Ge]?.reason);}get aborted(){return this[Ti]}set aborted(t){}write(t,i,s){if(this[Ti])return false;if(this[_t])throw new Error("write after end");if(this[z])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),true;typeof i=="function"&&(s=i,i="utf8"),i||(i="utf8");let h=this[Wt]?Ie:Pn;if(!this[Q]&&!Buffer.isBuffer(t)){if(zn(t))t=Buffer.from(t.buffer,t.byteOffset,t.byteLength);else if(Nn(t))t=Buffer.from(t);else if(typeof t!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[Q]?(this[J]&&this[Z]!==0&&this[Ai](true),this[J]?this.emit("data",t):this[Xi](t),this[Z]!==0&&this.emit("readable"),s&&h(s),this[J]):t.length?(typeof t=="string"&&!(i===this[Et]&&!this[ke]?.lastNeed)&&(t=Buffer.from(t,i)),Buffer.isBuffer(t)&&this[Et]&&(t=this[ke].write(t)),this[J]&&this[Z]!==0&&this[Ai](true),this[J]?this.emit("data",t):this[Xi](t),this[Z]!==0&&this.emit("readable"),s&&h(s),this[J]):(this[Z]!==0&&this.emit("readable"),s&&h(s),this[J])}read(t){if(this[z])return null;if(this[ct]=false,this[Z]===0||t===0||t&&t>this[Z])return this[$t](),null;this[Q]&&(t=null),this[q].length>1&&!this[Q]&&(this[q]=[this[Et]?this[q].join(""):Buffer.concat(this[q],this[Z])]);let i=this[Ds](t||null,this[q][0]);return this[$t](),i}[Ds](t,i){if(this[Q])this[Fi]();else {let s=i;t===s.length||t===null?this[Fi]():typeof s=="string"?(this[q][0]=s.slice(t),i=s.slice(0,t),this[Z]-=t):(this[q][0]=s.subarray(t),i=s.subarray(0,t),this[Z]-=t);}return this.emit("data",i),!this[q].length&&!this[_t]&&this.emit("drain"),i}end(t,i,s){return typeof t=="function"&&(s=t,t=void 0),typeof i=="function"&&(s=i,i="utf8"),t!==void 0&&this.write(t,i),s&&this.once("end",s),this[_t]=true,this.writable=false,(this[J]||!this[Ue])&&this[$t](),this}[Re](){this[z]||(!this[le]&&!this[et].length&&(this[ct]=true),this[Ue]=false,this[J]=true,this.emit("resume"),this[q].length?this[Ai]():this[_t]?this[$t]():this.emit("drain"));}resume(){return this[Re]()}pause(){this[J]=false,this[Ue]=true,this[ct]=false;}get destroyed(){return this[z]}get flowing(){return this[J]}get paused(){return this[Ue]}[Xi](t){this[Q]?this[Z]+=1:this[Z]+=t.length,this[q].push(t);}[Fi](){return this[Q]?this[Z]-=1:this[Z]-=this[q][0].length,this[q].shift()}[Ai](t=false){do;while(this[Ps](this[Fi]())&&this[q].length);!t&&!this[q].length&&!this[_t]&&this.emit("drain");}[Ps](t){return this.emit("data",t),this[J]}pipe(t,i){if(this[z])return t;this[ct]=false;let s=this[Vt];return i=i||{},t===Ws.stdout||t===Ws.stderr?i.end=false:i.end=i.end!==false,i.proxyErrors=!!i.proxyErrors,s?i.end&&t.end():(this[et].push(i.proxyErrors?new _n(this,t,i):new jr(this,t,i)),this[Wt]?Ie(()=>this[Re]()):this[Re]()),t}unpipe(t){let i=this[et].find(s=>s.dest===t);i&&(this[et].length===1?(this[J]&&this[le]===0&&(this[J]=false),this[et]=[]):this[et].splice(this[et].indexOf(i),1),i.unpipe());}addListener(t,i){return this.on(t,i)}on(t,i){let s=super.on(t,i);if(t==="data")this[ct]=false,this[le]++,!this[et].length&&!this[J]&&this[Re]();else if(t==="readable"&&this[Z]!==0)super.emit("readable");else if(jn(t)&&this[Vt])super.emit(t),this.removeAllListeners(t);else if(t==="error"&&this[Be]){let h=i;this[Wt]?Ie(()=>h.call(this,this[Be])):h.call(this,this[Be]);}return s}removeListener(t,i){return this.off(t,i)}off(t,i){let s=super.off(t,i);return t==="data"&&(this[le]=this.listeners("data").length,this[le]===0&&!this[ct]&&!this[et].length&&(this[J]=false)),s}removeAllListeners(t){let i=super.removeAllListeners(t);return (t==="data"||t===void 0)&&(this[le]=0,!this[ct]&&!this[et].length&&(this[J]=false)),i}get emittedEnd(){return this[Vt]}[$t](){!this[Ci]&&!this[Vt]&&!this[z]&&this[q].length===0&&this[_t]&&(this[Ci]=true,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Oi]&&this.emit("close"),this[Ci]=false);}emit(t,...i){let s=i[0];if(t!=="error"&&t!=="close"&&t!==z&&this[z])return false;if(t==="data")return !this[Q]&&!s?false:this[Wt]?(Ie(()=>this[ts](s)),true):this[ts](s);if(t==="end")return this[js]();if(t==="close"){if(this[Oi]=true,!this[Vt]&&!this[z])return false;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(t==="error"){this[Be]=s,super.emit(Qi,s);let n=!this[Ge]||this.listeners("error").length?super.emit("error",s):false;return this[$t](),n}else if(t==="resume"){let n=super.emit("resume");return this[$t](),n}else if(t==="finish"||t==="prefinish"){let n=super.emit(t);return this.removeAllListeners(t),n}let h=super.emit(t,...i);return this[$t](),h}[ts](t){for(let s of this[et])s.dest.write(t)===false&&this.pause();let i=this[ct]?false:super.emit("data",t);return this[$t](),i}[js](){return this[Vt]?false:(this[Vt]=true,this.readable=false,this[Wt]?(Ie(()=>this[es]()),true):this[es]())}[es](){if(this[ke]){let i=this[ke].end();if(i){for(let s of this[et])s.dest.write(i);this[ct]||super.emit("data",i);}}for(let i of this[et])i.end();let t=super.emit("end");return this.removeAllListeners("end"),t}async collect(){let t=Object.assign([],{dataLength:0});this[Q]||(t.dataLength=0);let i=this.promise();return this.on("data",s=>{t.push(s),this[Q]||(t.dataLength+=s.length);}),await i,t}async concat(){if(this[Q])throw new Error("cannot concat in objectMode");let t=await this.collect();return this[Et]?t.join(""):Buffer.concat(t,t.dataLength)}async promise(){return new Promise((t,i)=>{this.on(z,()=>i(new Error("stream destroyed"))),this.on("error",s=>i(s)),this.on("end",()=>t());})}[Symbol.asyncIterator](){this[ct]=false;let t=false,i=async()=>(this.pause(),t=true,{value:void 0,done:true});return {next:()=>{if(t)return i();let s=this.read();if(s!==null)return Promise.resolve({done:false,value:s});if(this[_t])return i();let h,n,o=d=>{this.off("data",a),this.off("end",l),this.off(z,u),i(),n(d);},a=d=>{this.off("error",o),this.off("end",l),this.off(z,u),this.pause(),h({value:d,done:!!this[_t]});},l=()=>{this.off("error",o),this.off("data",a),this.off(z,u),i(),h({done:true,value:void 0});},u=()=>o(new Error("stream destroyed"));return new Promise((d,f)=>{n=f,h=d,this.once(z,u),this.once("error",o),this.once("end",l),this.once("data",a);})},throw:i,return:i,[Symbol.asyncIterator](){return this},[Symbol.asyncDispose]:async()=>{}}}[Symbol.iterator](){this[ct]=false;let t=false,i=()=>(this.pause(),this.off(Qi,i),this.off(z,i),this.off("end",i),t=true,{done:true,value:void 0}),s=()=>{if(t)return i();let h=this.read();return h===null?i():{done:false,value:h}};return this.once("end",i),this.once(Qi,i),this.once(z,i),{next:s,throw:i,return:i,[Symbol.iterator](){return this},[Symbol.dispose]:()=>{}}}destroy(t){if(this[z])return t?this.emit("error",t):this.emit(z),this;this[z]=true,this[ct]=true,this[q].length=0,this[Z]=0;let i=this;return typeof i.close=="function"&&!this[Oi]&&i.close(),t?this.emit("error",t):this.emit(z),this}static get isStream(){return Ln}},Un=Cn.realpathSync.native,Ze={lstatSync:Cn.lstatSync,readdir:Cn.readdir,readdirSync:Cn.readdirSync,readlinkSync:Cn.readlinkSync,realpathSync:Un,promises:{lstat:ah.lstat,readdir:ah.readdir,readlink:ah.readlink,realpath:ah.realpath}},Nr=e=>!e||e===Ze||e===Cn__namespace?Ze:{...Ze,...e,promises:{...Ze.promises,...e.promises||{}}},zr=/^\\\\\?\\([a-z]:)\\?$/i,Gn=e=>e.replace(/\//g,"\\").replace(zr,"$1\\"),In=/[\\\/]/,bt=0,_r=1,$r=2,Dt=4,Br=6,Ur=8,ce=10,Gr=12,wt=15,He=~wt,ss=16,Ns=32,Ve=64,xt=128,Mi=256,Ni=512,zs=Ve|xt|Ni,Hn=1023,rs=e=>e.isFile()?Ur:e.isDirectory()?Dt:e.isSymbolicLink()?ce:e.isCharacterDevice()?$r:e.isBlockDevice()?Br:e.isSocket()?Gr:e.isFIFO()?_r:bt,_s=new Hi({max:2**12}),Ye=e=>{let t=_s.get(e);if(t)return t;let i=e.normalize("NFKD");return _s.set(e,i),i},$s=new Hi({max:2**12}),Li=e=>{let t=$s.get(e);if(t)return t;let i=Ye(e.toLowerCase());return $s.set(e,i),i},Bs=class extends Hi{constructor(){super({max:256});}},Jn=class extends Hi{constructor(e=16*1024){super({maxSize:e,sizeCalculation:t=>t.length+1});}},Ir=Symbol("PathScurry setAsCwd"),rt,ii,si,ri,hi,ni,oi,ai,li,ci,ui,pi,fi,di,gi,mi,wi,yi,bi,se,we,jt,Gt,It,Ht,C,ye,Jt,Nt,k,ps,zi,Ke,fs,ds,Xe,_i,gs,ms,$i,Hr,Jr,qr,ws,We,De,Zr,be,dr,at=(dr=class{constructor(e,t=bt,i,s,h,n,o){chunkQBAJWPDZ_cjs.f(this,k);chunkQBAJWPDZ_cjs.d(this,"name");chunkQBAJWPDZ_cjs.d(this,"root");chunkQBAJWPDZ_cjs.d(this,"roots");chunkQBAJWPDZ_cjs.d(this,"parent");chunkQBAJWPDZ_cjs.d(this,"nocase");chunkQBAJWPDZ_cjs.d(this,"isCWD",false);chunkQBAJWPDZ_cjs.f(this,rt);chunkQBAJWPDZ_cjs.f(this,ii);chunkQBAJWPDZ_cjs.f(this,si);chunkQBAJWPDZ_cjs.f(this,ri);chunkQBAJWPDZ_cjs.f(this,hi);chunkQBAJWPDZ_cjs.f(this,ni);chunkQBAJWPDZ_cjs.f(this,oi);chunkQBAJWPDZ_cjs.f(this,ai);chunkQBAJWPDZ_cjs.f(this,li);chunkQBAJWPDZ_cjs.f(this,ci);chunkQBAJWPDZ_cjs.f(this,ui);chunkQBAJWPDZ_cjs.f(this,pi);chunkQBAJWPDZ_cjs.f(this,fi);chunkQBAJWPDZ_cjs.f(this,di);chunkQBAJWPDZ_cjs.f(this,gi);chunkQBAJWPDZ_cjs.f(this,mi);chunkQBAJWPDZ_cjs.f(this,wi);chunkQBAJWPDZ_cjs.f(this,yi);chunkQBAJWPDZ_cjs.f(this,bi);chunkQBAJWPDZ_cjs.f(this,se);chunkQBAJWPDZ_cjs.f(this,we);chunkQBAJWPDZ_cjs.f(this,jt);chunkQBAJWPDZ_cjs.f(this,Gt);chunkQBAJWPDZ_cjs.f(this,It);chunkQBAJWPDZ_cjs.f(this,Ht);chunkQBAJWPDZ_cjs.f(this,C);chunkQBAJWPDZ_cjs.f(this,ye);chunkQBAJWPDZ_cjs.f(this,Jt);chunkQBAJWPDZ_cjs.f(this,Nt);chunkQBAJWPDZ_cjs.f(this,We,[]);chunkQBAJWPDZ_cjs.f(this,De,false);chunkQBAJWPDZ_cjs.f(this,be);this.name=e,chunkQBAJWPDZ_cjs.g(this,se,h?Li(e):Ye(e)),chunkQBAJWPDZ_cjs.g(this,C,t&Hn),this.nocase=h,this.roots=s,this.root=i||this,chunkQBAJWPDZ_cjs.g(this,ye,n),chunkQBAJWPDZ_cjs.g(this,jt,o.fullpath),chunkQBAJWPDZ_cjs.g(this,It,o.relative),chunkQBAJWPDZ_cjs.g(this,Ht,o.relativePosix),this.parent=o.parent,this.parent?chunkQBAJWPDZ_cjs.g(this,rt,chunkQBAJWPDZ_cjs.e(this.parent,rt)):chunkQBAJWPDZ_cjs.g(this,rt,Nr(o.fs));}get dev(){return chunkQBAJWPDZ_cjs.e(this,ii)}get mode(){return chunkQBAJWPDZ_cjs.e(this,si)}get nlink(){return chunkQBAJWPDZ_cjs.e(this,ri)}get uid(){return chunkQBAJWPDZ_cjs.e(this,hi)}get gid(){return chunkQBAJWPDZ_cjs.e(this,ni)}get rdev(){return chunkQBAJWPDZ_cjs.e(this,oi)}get blksize(){return chunkQBAJWPDZ_cjs.e(this,ai)}get ino(){return chunkQBAJWPDZ_cjs.e(this,li)}get size(){return chunkQBAJWPDZ_cjs.e(this,ci)}get blocks(){return chunkQBAJWPDZ_cjs.e(this,ui)}get atimeMs(){return chunkQBAJWPDZ_cjs.e(this,pi)}get mtimeMs(){return chunkQBAJWPDZ_cjs.e(this,fi)}get ctimeMs(){return chunkQBAJWPDZ_cjs.e(this,di)}get birthtimeMs(){return chunkQBAJWPDZ_cjs.e(this,gi)}get atime(){return chunkQBAJWPDZ_cjs.e(this,mi)}get mtime(){return chunkQBAJWPDZ_cjs.e(this,wi)}get ctime(){return chunkQBAJWPDZ_cjs.e(this,yi)}get birthtime(){return chunkQBAJWPDZ_cjs.e(this,bi)}get parentPath(){return (this.parent||this).fullpath()}get path(){return this.parentPath}depth(){return chunkQBAJWPDZ_cjs.e(this,we)!==void 0?chunkQBAJWPDZ_cjs.e(this,we):this.parent?chunkQBAJWPDZ_cjs.g(this,we,this.parent.depth()+1):chunkQBAJWPDZ_cjs.g(this,we,0)}childrenCache(){return chunkQBAJWPDZ_cjs.e(this,ye)}resolve(e){var s;if(!e)return this;let t=this.getRootString(e),i=e.substring(t.length).split(this.splitSep);return t?chunkQBAJWPDZ_cjs.h(s=this.getRoot(t),k,ps).call(s,i):chunkQBAJWPDZ_cjs.h(this,k,ps).call(this,i)}children(){let e=chunkQBAJWPDZ_cjs.e(this,ye).get(this);if(e)return e;let t=Object.assign([],{provisional:0});return chunkQBAJWPDZ_cjs.e(this,ye).set(this,t),chunkQBAJWPDZ_cjs.g(this,C,chunkQBAJWPDZ_cjs.e(this,C)&~ss),t}child(e,t){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let i=this.children(),s=this.nocase?Li(e):Ye(e);for(let a of i)if(chunkQBAJWPDZ_cjs.e(a,se)===s)return a;let h=this.parent?this.sep:"",n=chunkQBAJWPDZ_cjs.e(this,jt)?chunkQBAJWPDZ_cjs.e(this,jt)+h+e:void 0,o=this.newChild(e,bt,{...t,parent:this,fullpath:n});return this.canReaddir()||chunkQBAJWPDZ_cjs.g(o,C,chunkQBAJWPDZ_cjs.e(o,C)|xt),i.push(o),o}relative(){if(this.isCWD)return "";if(chunkQBAJWPDZ_cjs.e(this,It)!==void 0)return chunkQBAJWPDZ_cjs.e(this,It);let e=this.name,t=this.parent;if(!t)return chunkQBAJWPDZ_cjs.g(this,It,this.name);let i=t.relative();return i+(!i||!t.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return "";if(chunkQBAJWPDZ_cjs.e(this,Ht)!==void 0)return chunkQBAJWPDZ_cjs.e(this,Ht);let e=this.name,t=this.parent;if(!t)return chunkQBAJWPDZ_cjs.g(this,Ht,this.fullpathPosix());let i=t.relativePosix();return i+(!i||!t.parent?"":"/")+e}fullpath(){if(chunkQBAJWPDZ_cjs.e(this,jt)!==void 0)return chunkQBAJWPDZ_cjs.e(this,jt);let e=this.name,t=this.parent;if(!t)return chunkQBAJWPDZ_cjs.g(this,jt,this.name);let i=t.fullpath()+(t.parent?this.sep:"")+e;return chunkQBAJWPDZ_cjs.g(this,jt,i)}fullpathPosix(){if(chunkQBAJWPDZ_cjs.e(this,Gt)!==void 0)return chunkQBAJWPDZ_cjs.e(this,Gt);if(this.sep==="/")return chunkQBAJWPDZ_cjs.g(this,Gt,this.fullpath());if(!this.parent){let s=this.fullpath().replace(/\\/g,"/");return /^[a-z]:\//i.test(s)?chunkQBAJWPDZ_cjs.g(this,Gt,`//?/${s}`):chunkQBAJWPDZ_cjs.g(this,Gt,s)}let e=this.parent,t=e.fullpathPosix(),i=t+(!t||!e.parent?"":"/")+this.name;return chunkQBAJWPDZ_cjs.g(this,Gt,i)}isUnknown(){return (chunkQBAJWPDZ_cjs.e(this,C)&wt)===bt}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return (chunkQBAJWPDZ_cjs.e(this,C)&wt)===Ur}isDirectory(){return (chunkQBAJWPDZ_cjs.e(this,C)&wt)===Dt}isCharacterDevice(){return (chunkQBAJWPDZ_cjs.e(this,C)&wt)===$r}isBlockDevice(){return (chunkQBAJWPDZ_cjs.e(this,C)&wt)===Br}isFIFO(){return (chunkQBAJWPDZ_cjs.e(this,C)&wt)===_r}isSocket(){return (chunkQBAJWPDZ_cjs.e(this,C)&wt)===Gr}isSymbolicLink(){return (chunkQBAJWPDZ_cjs.e(this,C)&ce)===ce}lstatCached(){return chunkQBAJWPDZ_cjs.e(this,C)&Ns?this:void 0}readlinkCached(){return chunkQBAJWPDZ_cjs.e(this,Jt)}realpathCached(){return chunkQBAJWPDZ_cjs.e(this,Nt)}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(chunkQBAJWPDZ_cjs.e(this,Jt))return true;if(!this.parent)return false;let e=chunkQBAJWPDZ_cjs.e(this,C)&wt;return !(e!==bt&&e!==ce||chunkQBAJWPDZ_cjs.e(this,C)&Mi||chunkQBAJWPDZ_cjs.e(this,C)&xt)}calledReaddir(){return !!(chunkQBAJWPDZ_cjs.e(this,C)&ss)}isENOENT(){return !!(chunkQBAJWPDZ_cjs.e(this,C)&xt)}isNamed(e){return this.nocase?chunkQBAJWPDZ_cjs.e(this,se)===Li(e):chunkQBAJWPDZ_cjs.e(this,se)===Ye(e)}async readlink(){let e=chunkQBAJWPDZ_cjs.e(this,Jt);if(e)return e;if(this.canReadlink()&&this.parent)try{let t=await chunkQBAJWPDZ_cjs.e(this,rt).promises.readlink(this.fullpath()),i=(await this.parent.realpath())?.resolve(t);if(i)return chunkQBAJWPDZ_cjs.g(this,Jt,i)}catch(t){chunkQBAJWPDZ_cjs.h(this,k,ms).call(this,t.code);return}}readlinkSync(){let e=chunkQBAJWPDZ_cjs.e(this,Jt);if(e)return e;if(this.canReadlink()&&this.parent)try{let t=chunkQBAJWPDZ_cjs.e(this,rt).readlinkSync(this.fullpath()),i=this.parent.realpathSync()?.resolve(t);if(i)return chunkQBAJWPDZ_cjs.g(this,Jt,i)}catch(t){chunkQBAJWPDZ_cjs.h(this,k,ms).call(this,t.code);return}}async lstat(){if((chunkQBAJWPDZ_cjs.e(this,C)&xt)===0)try{return chunkQBAJWPDZ_cjs.h(this,k,ws).call(this,await chunkQBAJWPDZ_cjs.e(this,rt).promises.lstat(this.fullpath())),this}catch(e){chunkQBAJWPDZ_cjs.h(this,k,gs).call(this,e.code);}}lstatSync(){if((chunkQBAJWPDZ_cjs.e(this,C)&xt)===0)try{return chunkQBAJWPDZ_cjs.h(this,k,ws).call(this,chunkQBAJWPDZ_cjs.e(this,rt).lstatSync(this.fullpath())),this}catch(e){chunkQBAJWPDZ_cjs.h(this,k,gs).call(this,e.code);}}readdirCB(e,t=false){if(!this.canReaddir()){t?e(null,[]):queueMicrotask(()=>e(null,[]));return}let i=this.children();if(this.calledReaddir()){let h=i.slice(0,i.provisional);t?e(null,h):queueMicrotask(()=>e(null,h));return}if(chunkQBAJWPDZ_cjs.e(this,We).push(e),chunkQBAJWPDZ_cjs.e(this,De))return;chunkQBAJWPDZ_cjs.g(this,De,true);let s=this.fullpath();chunkQBAJWPDZ_cjs.e(this,rt).readdir(s,{withFileTypes:true},(h,n)=>{if(h)chunkQBAJWPDZ_cjs.h(this,k,_i).call(this,h.code),i.provisional=0;else {for(let o of n)chunkQBAJWPDZ_cjs.h(this,k,$i).call(this,o,i);chunkQBAJWPDZ_cjs.h(this,k,zi).call(this,i);}chunkQBAJWPDZ_cjs.h(this,k,Zr).call(this,i.slice(0,i.provisional));});}async readdir(){if(!this.canReaddir())return [];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();if(chunkQBAJWPDZ_cjs.e(this,be))await chunkQBAJWPDZ_cjs.e(this,be);else {let i=()=>{};chunkQBAJWPDZ_cjs.g(this,be,new Promise(s=>i=s));try{for(let s of await chunkQBAJWPDZ_cjs.e(this,rt).promises.readdir(t,{withFileTypes:!0}))chunkQBAJWPDZ_cjs.h(this,k,$i).call(this,s,e);chunkQBAJWPDZ_cjs.h(this,k,zi).call(this,e);}catch(s){chunkQBAJWPDZ_cjs.h(this,k,_i).call(this,s.code),e.provisional=0;}chunkQBAJWPDZ_cjs.g(this,be,void 0),i();}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return [];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();try{for(let i of chunkQBAJWPDZ_cjs.e(this,rt).readdirSync(t,{withFileTypes:!0}))chunkQBAJWPDZ_cjs.h(this,k,$i).call(this,i,e);chunkQBAJWPDZ_cjs.h(this,k,zi).call(this,e);}catch(i){chunkQBAJWPDZ_cjs.h(this,k,_i).call(this,i.code),e.provisional=0;}return e.slice(0,e.provisional)}canReaddir(){if(chunkQBAJWPDZ_cjs.e(this,C)&zs)return false;let e=wt&chunkQBAJWPDZ_cjs.e(this,C);return e===bt||e===Dt||e===ce}shouldWalk(e,t){return (chunkQBAJWPDZ_cjs.e(this,C)&Dt)===Dt&&!(chunkQBAJWPDZ_cjs.e(this,C)&zs)&&!e.has(this)&&(!t||t(this))}async realpath(){if(chunkQBAJWPDZ_cjs.e(this,Nt))return chunkQBAJWPDZ_cjs.e(this,Nt);if(!((Ni|Mi|xt)&chunkQBAJWPDZ_cjs.e(this,C)))try{let e=await chunkQBAJWPDZ_cjs.e(this,rt).promises.realpath(this.fullpath());return chunkQBAJWPDZ_cjs.g(this,Nt,this.resolve(e))}catch{chunkQBAJWPDZ_cjs.h(this,k,ds).call(this);}}realpathSync(){if(chunkQBAJWPDZ_cjs.e(this,Nt))return chunkQBAJWPDZ_cjs.e(this,Nt);if(!((Ni|Mi|xt)&chunkQBAJWPDZ_cjs.e(this,C)))try{let e=chunkQBAJWPDZ_cjs.e(this,rt).realpathSync(this.fullpath());return chunkQBAJWPDZ_cjs.g(this,Nt,this.resolve(e))}catch{chunkQBAJWPDZ_cjs.h(this,k,ds).call(this);}}[Ir](e){if(e===this)return;e.isCWD=false,this.isCWD=true;let t=new Set([]),i=[],s=this;for(;s&&s.parent;)t.add(s),chunkQBAJWPDZ_cjs.g(s,It,i.join(this.sep)),chunkQBAJWPDZ_cjs.g(s,Ht,i.join("/")),s=s.parent,i.push("..");for(s=e;s&&s.parent&&!t.has(s);)chunkQBAJWPDZ_cjs.g(s,It,void 0),chunkQBAJWPDZ_cjs.g(s,Ht,void 0),s=s.parent;}},rt=new WeakMap,ii=new WeakMap,si=new WeakMap,ri=new WeakMap,hi=new WeakMap,ni=new WeakMap,oi=new WeakMap,ai=new WeakMap,li=new WeakMap,ci=new WeakMap,ui=new WeakMap,pi=new WeakMap,fi=new WeakMap,di=new WeakMap,gi=new WeakMap,mi=new WeakMap,wi=new WeakMap,yi=new WeakMap,bi=new WeakMap,se=new WeakMap,we=new WeakMap,jt=new WeakMap,Gt=new WeakMap,It=new WeakMap,Ht=new WeakMap,C=new WeakMap,ye=new WeakMap,Jt=new WeakMap,Nt=new WeakMap,k=new WeakSet,ps=function(e){let t=this;for(let i of e)t=t.child(i);return t},zi=function(e){var t;chunkQBAJWPDZ_cjs.g(this,C,chunkQBAJWPDZ_cjs.e(this,C)|ss);for(let i=e.provisional;i<e.length;i++){let s=e[i];s&&chunkQBAJWPDZ_cjs.h(t=s,k,Ke).call(t);}},Ke=function(){chunkQBAJWPDZ_cjs.e(this,C)&xt||(chunkQBAJWPDZ_cjs.g(this,C,(chunkQBAJWPDZ_cjs.e(this,C)|xt)&He),chunkQBAJWPDZ_cjs.h(this,k,fs).call(this));},fs=function(){var t;let e=this.children();e.provisional=0;for(let i of e)chunkQBAJWPDZ_cjs.h(t=i,k,Ke).call(t);},ds=function(){chunkQBAJWPDZ_cjs.g(this,C,chunkQBAJWPDZ_cjs.e(this,C)|Ni),chunkQBAJWPDZ_cjs.h(this,k,Xe).call(this);},Xe=function(){if(chunkQBAJWPDZ_cjs.e(this,C)&Ve)return;let e=chunkQBAJWPDZ_cjs.e(this,C);(e&wt)===Dt&&(e&=He),chunkQBAJWPDZ_cjs.g(this,C,e|Ve),chunkQBAJWPDZ_cjs.h(this,k,fs).call(this);},_i=function(e=""){e==="ENOTDIR"||e==="EPERM"?chunkQBAJWPDZ_cjs.h(this,k,Xe).call(this):e==="ENOENT"?chunkQBAJWPDZ_cjs.h(this,k,Ke).call(this):this.children().provisional=0;},gs=function(e=""){var t;e==="ENOTDIR"?chunkQBAJWPDZ_cjs.h(t=this.parent,k,Xe).call(t):e==="ENOENT"&&chunkQBAJWPDZ_cjs.h(this,k,Ke).call(this);},ms=function(e=""){var i;let t=chunkQBAJWPDZ_cjs.e(this,C);t|=Mi,e==="ENOENT"&&(t|=xt),(e==="EINVAL"||e==="UNKNOWN")&&(t&=He),chunkQBAJWPDZ_cjs.g(this,C,t),e==="ENOTDIR"&&this.parent&&chunkQBAJWPDZ_cjs.h(i=this.parent,k,Xe).call(i);},$i=function(e,t){return chunkQBAJWPDZ_cjs.h(this,k,Jr).call(this,e,t)||chunkQBAJWPDZ_cjs.h(this,k,Hr).call(this,e,t)},Hr=function(e,t){let i=rs(e),s=this.newChild(e.name,i,{parent:this}),h=chunkQBAJWPDZ_cjs.e(s,C)&wt;return h!==Dt&&h!==ce&&h!==bt&&chunkQBAJWPDZ_cjs.g(s,C,chunkQBAJWPDZ_cjs.e(s,C)|Ve),t.unshift(s),t.provisional++,s},Jr=function(e,t){for(let i=t.provisional;i<t.length;i++){let s=t[i];if((this.nocase?Li(e.name):Ye(e.name))===chunkQBAJWPDZ_cjs.e(s,se))return chunkQBAJWPDZ_cjs.h(this,k,qr).call(this,e,s,i,t)}},qr=function(e,t,i,s){let h=t.name;return chunkQBAJWPDZ_cjs.g(t,C,chunkQBAJWPDZ_cjs.e(t,C)&He|rs(e)),h!==e.name&&(t.name=e.name),i!==s.provisional&&(i===s.length-1?s.pop():s.splice(i,1),s.unshift(t)),s.provisional++,t},ws=function(e){let{atime:t,atimeMs:i,birthtime:s,birthtimeMs:h,blksize:n,blocks:o,ctime:a,ctimeMs:l,dev:u,gid:d,ino:f,mode:w,mtime:S,mtimeMs:E,nlink:b,rdev:x,size:v,uid:R}=e;chunkQBAJWPDZ_cjs.g(this,mi,t),chunkQBAJWPDZ_cjs.g(this,pi,i),chunkQBAJWPDZ_cjs.g(this,bi,s),chunkQBAJWPDZ_cjs.g(this,gi,h),chunkQBAJWPDZ_cjs.g(this,ai,n),chunkQBAJWPDZ_cjs.g(this,ui,o),chunkQBAJWPDZ_cjs.g(this,yi,a),chunkQBAJWPDZ_cjs.g(this,di,l),chunkQBAJWPDZ_cjs.g(this,ii,u),chunkQBAJWPDZ_cjs.g(this,ni,d),chunkQBAJWPDZ_cjs.g(this,li,f),chunkQBAJWPDZ_cjs.g(this,si,w),chunkQBAJWPDZ_cjs.g(this,wi,S),chunkQBAJWPDZ_cjs.g(this,fi,E),chunkQBAJWPDZ_cjs.g(this,ri,b),chunkQBAJWPDZ_cjs.g(this,oi,x),chunkQBAJWPDZ_cjs.g(this,ci,v),chunkQBAJWPDZ_cjs.g(this,hi,R);let A=rs(e);chunkQBAJWPDZ_cjs.g(this,C,chunkQBAJWPDZ_cjs.e(this,C)&He|A|Ns),A!==bt&&A!==Dt&&A!==ce&&chunkQBAJWPDZ_cjs.g(this,C,chunkQBAJWPDZ_cjs.e(this,C)|Ve);},We=new WeakMap,De=new WeakMap,Zr=function(e){chunkQBAJWPDZ_cjs.g(this,De,false);let t=chunkQBAJWPDZ_cjs.e(this,We).slice();chunkQBAJWPDZ_cjs.e(this,We).length=0,t.forEach(i=>i(null,e));},be=new WeakMap,dr),Vr=class Yr extends at{constructor(i,s=bt,h,n,o,a,l){super(i,s,h,n,o,a,l);chunkQBAJWPDZ_cjs.d(this,"sep","\\");chunkQBAJWPDZ_cjs.d(this,"splitSep",In);}newChild(i,s=bt,h={}){return new Yr(i,s,this.root,this.roots,this.nocase,this.childrenCache(),h)}getRootString(i){return Zi.win32.parse(i).root}getRoot(i){if(i=Gn(i.toUpperCase()),i===this.root.name)return this.root;for(let[s,h]of Object.entries(this.roots))if(this.sameRoot(i,s))return this.roots[i]=h;return this.roots[i]=new Es(i,this).root}sameRoot(i,s=this.root.name){return i=i.toUpperCase().replace(/\//g,"\\").replace(zr,"$1\\"),i===s}},Kr=class Xr extends at{constructor(i,s=bt,h,n,o,a,l){super(i,s,h,n,o,a,l);chunkQBAJWPDZ_cjs.d(this,"splitSep","/");chunkQBAJWPDZ_cjs.d(this,"sep","/");}getRootString(i){return i.startsWith("/")?"/":""}getRoot(i){return this.root}newChild(i,s=bt,h={}){return new Xr(i,s,this.root,this.roots,this.nocase,this.childrenCache(),h)}},Pe,je,Si,vi,gr,Qr=(gr=class{constructor(e=process.cwd(),t,i,{nocase:s,childrenCacheSize:h=16*1024,fs:n=Ze}={}){chunkQBAJWPDZ_cjs.d(this,"root");chunkQBAJWPDZ_cjs.d(this,"rootPath");chunkQBAJWPDZ_cjs.d(this,"roots");chunkQBAJWPDZ_cjs.d(this,"cwd");chunkQBAJWPDZ_cjs.f(this,Pe);chunkQBAJWPDZ_cjs.f(this,je);chunkQBAJWPDZ_cjs.f(this,Si);chunkQBAJWPDZ_cjs.d(this,"nocase");chunkQBAJWPDZ_cjs.f(this,vi);chunkQBAJWPDZ_cjs.g(this,vi,Nr(n)),(e instanceof URL||e.startsWith("file://"))&&(e=url.fileURLToPath(e));let o=t.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(o),chunkQBAJWPDZ_cjs.g(this,Pe,new Bs),chunkQBAJWPDZ_cjs.g(this,je,new Bs),chunkQBAJWPDZ_cjs.g(this,Si,new Jn(h));let a=o.substring(this.rootPath.length).split(i);if(a.length===1&&!a[0]&&a.pop(),s===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=s,this.root=this.newRoot(chunkQBAJWPDZ_cjs.e(this,vi)),this.roots[this.rootPath]=this.root;let l=this.root,u=a.length-1,d=t.sep,f=this.rootPath,w=false;for(let S of a){let E=u--;l=l.child(S,{relative:new Array(E).fill("..").join(d),relativePosix:new Array(E).fill("..").join("/"),fullpath:f+=(w?"":d)+S}),w=true;}this.cwd=l;}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return chunkQBAJWPDZ_cjs.e(this,Si)}resolve(...e){let t="";for(let h=e.length-1;h>=0;h--){let n=e[h];if(!(!n||n===".")&&(t=t?`${n}/${t}`:n,this.isAbsolute(n)))break}let i=chunkQBAJWPDZ_cjs.e(this,Pe).get(t);if(i!==void 0)return i;let s=this.cwd.resolve(t).fullpath();return chunkQBAJWPDZ_cjs.e(this,Pe).set(t,s),s}resolvePosix(...e){let t="";for(let h=e.length-1;h>=0;h--){let n=e[h];if(!(!n||n===".")&&(t=t?`${n}/${t}`:n,this.isAbsolute(n)))break}let i=chunkQBAJWPDZ_cjs.e(this,je).get(t);if(i!==void 0)return i;let s=this.cwd.resolve(t).fullpathPosix();return chunkQBAJWPDZ_cjs.e(this,je).set(t,s),s}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,t={withFileTypes:true}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof at||(t=e,e=this.cwd);let{withFileTypes:i}=t;if(e.canReaddir()){let s=await e.readdir();return i?s:s.map(h=>h.name)}else return []}readdirSync(e=this.cwd,t={withFileTypes:true}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof at||(t=e,e=this.cwd);let{withFileTypes:i=true}=t;return e.canReaddir()?i?e.readdirSync():e.readdirSync().map(s=>s.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:t}={withFileTypes:false}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof at||(t=e.withFileTypes,e=this.cwd);let i=await e.readlink();return t?i:i?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:t}={withFileTypes:false}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof at||(t=e.withFileTypes,e=this.cwd);let i=e.readlinkSync();return t?i:i?.fullpath()}async realpath(e=this.cwd,{withFileTypes:t}={withFileTypes:false}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof at||(t=e.withFileTypes,e=this.cwd);let i=await e.realpath();return t?i:i?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:t}={withFileTypes:false}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof at||(t=e.withFileTypes,e=this.cwd);let i=e.realpathSync();return t?i:i?.fullpath()}async walk(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof at||(t=e,e=this.cwd);let{withFileTypes:i=true,follow:s=false,filter:h,walkFilter:n}=t,o=[];(!h||h(e))&&o.push(i?e:e.fullpath());let a=new Set,l=(d,f)=>{a.add(d),d.readdirCB((w,S)=>{if(w)return f(w);let E=S.length;if(!E)return f();let b=()=>{--E===0&&f();};for(let x of S)(!h||h(x))&&o.push(i?x:x.fullpath()),s&&x.isSymbolicLink()?x.realpath().then(v=>v?.isUnknown()?v.lstat():v).then(v=>v?.shouldWalk(a,n)?l(v,b):b()):x.shouldWalk(a,n)?l(x,b):b();},true);},u=e;return new Promise((d,f)=>{l(u,w=>{if(w)return f(w);d(o);});})}walkSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof at||(t=e,e=this.cwd);let{withFileTypes:i=true,follow:s=false,filter:h,walkFilter:n}=t,o=[];(!h||h(e))&&o.push(i?e:e.fullpath());let a=new Set([e]);for(let l of a){let u=l.readdirSync();for(let d of u){(!h||h(d))&&o.push(i?d:d.fullpath());let f=d;if(d.isSymbolicLink()){if(!(s&&(f=d.realpathSync())))continue;f.isUnknown()&&f.lstatSync();}f.shouldWalk(a,n)&&a.add(f);}}return o}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,t={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof at||(t=e,e=this.cwd),this.stream(e,t)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof at||(t=e,e=this.cwd);let{withFileTypes:i=true,follow:s=false,filter:h,walkFilter:n}=t;(!h||h(e))&&(yield i?e:e.fullpath());let o=new Set([e]);for(let a of o){let l=a.readdirSync();for(let u of l){(!h||h(u))&&(yield i?u:u.fullpath());let d=u;if(u.isSymbolicLink()){if(!(s&&(d=u.realpathSync())))continue;d.isUnknown()&&d.lstatSync();}d.shouldWalk(o,n)&&o.add(d);}}}stream(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof at||(t=e,e=this.cwd);let{withFileTypes:i=true,follow:s=false,filter:h,walkFilter:n}=t,o=new Gi({objectMode:true});(!h||h(e))&&o.write(i?e:e.fullpath());let a=new Set,l=[e],u=0,d=()=>{let f=false;for(;!f;){let w=l.shift();if(!w){u===0&&o.end();return}u++,a.add(w);let S=(b,x,v=false)=>{if(b)return o.emit("error",b);if(s&&!v){let R=[];for(let A of x)A.isSymbolicLink()&&R.push(A.realpath().then(T=>T?.isUnknown()?T.lstat():T));if(R.length){Promise.all(R).then(()=>S(null,x,true));return}}for(let R of x)R&&(!h||h(R))&&(o.write(i?R:R.fullpath())||(f=true));u--;for(let R of x){let A=R.realpathCached()||R;A.shouldWalk(a,n)&&l.push(A);}f&&!o.flowing?o.once("drain",d):E||d();},E=true;w.readdirCB(S,true),E=false;}};return d(),o}streamSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof at||(t=e,e=this.cwd);let{withFileTypes:i=true,follow:s=false,filter:h,walkFilter:n}=t,o=new Gi({objectMode:true}),a=new Set;(!h||h(e))&&o.write(i?e:e.fullpath());let l=[e],u=0,d=()=>{let f=false;for(;!f;){let w=l.shift();if(!w){u===0&&o.end();return}u++,a.add(w);let S=w.readdirSync();for(let E of S)(!h||h(E))&&(o.write(i?E:E.fullpath())||(f=true));u--;for(let E of S){let b=E;if(E.isSymbolicLink()){if(!(s&&(b=E.realpathSync())))continue;b.isUnknown()&&b.lstatSync();}b.shouldWalk(a,n)&&l.push(b);}}f&&!o.flowing&&o.once("drain",d);};return d(),o}chdir(e=this.cwd){let t=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[Ir](t);}},Pe=new WeakMap,je=new WeakMap,Si=new WeakMap,vi=new WeakMap,gr),Es=class extends Qr{constructor(t=process.cwd(),i={}){let{nocase:s=true}=i;super(t,Zi.win32,"\\",{...i,nocase:s});chunkQBAJWPDZ_cjs.d(this,"sep","\\");this.nocase=s;for(let h=this.cwd;h;h=h.parent)h.nocase=this.nocase;}parseRootPath(t){return Zi.win32.parse(t).root.toUpperCase()}newRoot(t){return new Vr(this.rootPath,Dt,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")||t.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(t)}},xs=class extends Qr{constructor(t=process.cwd(),i={}){let{nocase:s=false}=i;super(t,Zi.posix,"/",{...i,nocase:s});chunkQBAJWPDZ_cjs.d(this,"sep","/");this.nocase=s;}parseRootPath(t){return "/"}newRoot(t){return new Kr(this.rootPath,Dt,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")}},th=class extends xs{constructor(e=process.cwd(),t={}){let{nocase:i=true}=t;super(e,{...t,nocase:i});}};process.platform==="win32"?Vr:Kr;var qn=process.platform==="win32"?Es:process.platform==="darwin"?th:xs,Zn=e=>e.length>=1,Vn=e=>e.length>=1,Yn=Symbol.for("nodejs.util.inspect.custom"),I,lt,H,Se,Lt,Ei,re,he,ne,Ne,ze,eh=(ze=class{constructor(t,i,s,h){chunkQBAJWPDZ_cjs.f(this,I);chunkQBAJWPDZ_cjs.f(this,lt);chunkQBAJWPDZ_cjs.f(this,H);chunkQBAJWPDZ_cjs.d(this,"length");chunkQBAJWPDZ_cjs.f(this,Se);chunkQBAJWPDZ_cjs.f(this,Lt);chunkQBAJWPDZ_cjs.f(this,Ei);chunkQBAJWPDZ_cjs.f(this,re);chunkQBAJWPDZ_cjs.f(this,he);chunkQBAJWPDZ_cjs.f(this,ne);chunkQBAJWPDZ_cjs.f(this,Ne,true);if(!Zn(t))throw new TypeError("empty pattern list");if(!Vn(i))throw new TypeError("empty glob list");if(i.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(chunkQBAJWPDZ_cjs.g(this,I,t),chunkQBAJWPDZ_cjs.g(this,lt,i),chunkQBAJWPDZ_cjs.g(this,H,s),chunkQBAJWPDZ_cjs.g(this,Se,h),chunkQBAJWPDZ_cjs.e(this,H)===0){if(this.isUNC()){let[n,o,a,l,...u]=chunkQBAJWPDZ_cjs.e(this,I),[d,f,w,S,...E]=chunkQBAJWPDZ_cjs.e(this,lt);u[0]===""&&(u.shift(),E.shift());let b=[n,o,a,l,""].join("/"),x=[d,f,w,S,""].join("/");chunkQBAJWPDZ_cjs.g(this,I,[b,...u]),chunkQBAJWPDZ_cjs.g(this,lt,[x,...E]),this.length=chunkQBAJWPDZ_cjs.e(this,I).length;}else if(this.isDrive()||this.isAbsolute()){let[n,...o]=chunkQBAJWPDZ_cjs.e(this,I),[a,...l]=chunkQBAJWPDZ_cjs.e(this,lt);o[0]===""&&(o.shift(),l.shift());let u=n+"/",d=a+"/";chunkQBAJWPDZ_cjs.g(this,I,[u,...o]),chunkQBAJWPDZ_cjs.g(this,lt,[d,...l]),this.length=chunkQBAJWPDZ_cjs.e(this,I).length;}}}[Yn](){return "Pattern <"+chunkQBAJWPDZ_cjs.e(this,lt).slice(chunkQBAJWPDZ_cjs.e(this,H)).join("/")+">"}pattern(){return chunkQBAJWPDZ_cjs.e(this,I)[chunkQBAJWPDZ_cjs.e(this,H)]}isString(){return typeof chunkQBAJWPDZ_cjs.e(this,I)[chunkQBAJWPDZ_cjs.e(this,H)]=="string"}isGlobstar(){return chunkQBAJWPDZ_cjs.e(this,I)[chunkQBAJWPDZ_cjs.e(this,H)]===ht}isRegExp(){return chunkQBAJWPDZ_cjs.e(this,I)[chunkQBAJWPDZ_cjs.e(this,H)]instanceof RegExp}globString(){return chunkQBAJWPDZ_cjs.g(this,Ei,chunkQBAJWPDZ_cjs.e(this,Ei)||(chunkQBAJWPDZ_cjs.e(this,H)===0?this.isAbsolute()?chunkQBAJWPDZ_cjs.e(this,lt)[0]+chunkQBAJWPDZ_cjs.e(this,lt).slice(1).join("/"):chunkQBAJWPDZ_cjs.e(this,lt).join("/"):chunkQBAJWPDZ_cjs.e(this,lt).slice(chunkQBAJWPDZ_cjs.e(this,H)).join("/")))}hasMore(){return this.length>chunkQBAJWPDZ_cjs.e(this,H)+1}rest(){return chunkQBAJWPDZ_cjs.e(this,Lt)!==void 0?chunkQBAJWPDZ_cjs.e(this,Lt):this.hasMore()?(chunkQBAJWPDZ_cjs.g(this,Lt,new ze(chunkQBAJWPDZ_cjs.e(this,I),chunkQBAJWPDZ_cjs.e(this,lt),chunkQBAJWPDZ_cjs.e(this,H)+1,chunkQBAJWPDZ_cjs.e(this,Se))),chunkQBAJWPDZ_cjs.g(chunkQBAJWPDZ_cjs.e(this,Lt),ne,chunkQBAJWPDZ_cjs.e(this,ne)),chunkQBAJWPDZ_cjs.g(chunkQBAJWPDZ_cjs.e(this,Lt),he,chunkQBAJWPDZ_cjs.e(this,he)),chunkQBAJWPDZ_cjs.g(chunkQBAJWPDZ_cjs.e(this,Lt),re,chunkQBAJWPDZ_cjs.e(this,re)),chunkQBAJWPDZ_cjs.e(this,Lt)):chunkQBAJWPDZ_cjs.g(this,Lt,null)}isUNC(){let t=chunkQBAJWPDZ_cjs.e(this,I);return chunkQBAJWPDZ_cjs.e(this,he)!==void 0?chunkQBAJWPDZ_cjs.e(this,he):chunkQBAJWPDZ_cjs.g(this,he,chunkQBAJWPDZ_cjs.e(this,Se)==="win32"&&chunkQBAJWPDZ_cjs.e(this,H)===0&&t[0]===""&&t[1]===""&&typeof t[2]=="string"&&!!t[2]&&typeof t[3]=="string"&&!!t[3])}isDrive(){let t=chunkQBAJWPDZ_cjs.e(this,I);return chunkQBAJWPDZ_cjs.e(this,re)!==void 0?chunkQBAJWPDZ_cjs.e(this,re):chunkQBAJWPDZ_cjs.g(this,re,chunkQBAJWPDZ_cjs.e(this,Se)==="win32"&&chunkQBAJWPDZ_cjs.e(this,H)===0&&this.length>1&&typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]))}isAbsolute(){let t=chunkQBAJWPDZ_cjs.e(this,I);return chunkQBAJWPDZ_cjs.e(this,ne)!==void 0?chunkQBAJWPDZ_cjs.e(this,ne):chunkQBAJWPDZ_cjs.g(this,ne,t[0]===""&&t.length>1||this.isDrive()||this.isUNC())}root(){let t=chunkQBAJWPDZ_cjs.e(this,I)[0];return typeof t=="string"&&this.isAbsolute()&&chunkQBAJWPDZ_cjs.e(this,H)===0?t:""}checkFollowGlobstar(){return !(chunkQBAJWPDZ_cjs.e(this,H)===0||!this.isGlobstar()||!chunkQBAJWPDZ_cjs.e(this,Ne))}markFollowGlobstar(){return chunkQBAJWPDZ_cjs.e(this,H)===0||!this.isGlobstar()||!chunkQBAJWPDZ_cjs.e(this,Ne)?false:(chunkQBAJWPDZ_cjs.g(this,Ne,false),true)}},I=new WeakMap,lt=new WeakMap,H=new WeakMap,Se=new WeakMap,Lt=new WeakMap,Ei=new WeakMap,re=new WeakMap,he=new WeakMap,ne=new WeakMap,Ne=new WeakMap,ze),Kn=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Us=class{constructor(e,{nobrace:t,nocase:i,noext:s,noglobstar:h,platform:n=Kn}){chunkQBAJWPDZ_cjs.d(this,"relative");chunkQBAJWPDZ_cjs.d(this,"relativeChildren");chunkQBAJWPDZ_cjs.d(this,"absolute");chunkQBAJWPDZ_cjs.d(this,"absoluteChildren");chunkQBAJWPDZ_cjs.d(this,"platform");chunkQBAJWPDZ_cjs.d(this,"mmopts");this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=n,this.mmopts={dot:true,nobrace:t,nocase:i,noext:s,noglobstar:h,optimizationLevel:2,platform:n,nocomment:true,nonegate:true};for(let o of e)this.add(o);}add(e){let t=new ae(e,this.mmopts);for(let i=0;i<t.set.length;i++){let s=t.set[i],h=t.globParts[i];if(!s||!h)throw new Error("invalid pattern object");for(;s[0]==="."&&h[0]===".";)s.shift(),h.shift();let n=new eh(s,h,0,this.platform),o=new ae(n.globString(),this.mmopts),a=h[h.length-1]==="**",l=n.isAbsolute();l?this.absolute.push(o):this.relative.push(o),a&&(l?this.absoluteChildren.push(o):this.relativeChildren.push(o));}}ignored(e){let t=e.fullpath(),i=`${t}/`,s=e.relative()||".",h=`${s}/`;for(let n of this.relative)if(n.match(s)||n.match(h))return true;for(let n of this.absolute)if(n.match(t)||n.match(i))return true;return false}childrenIgnored(e){let t=e.fullpath()+"/",i=(e.relative()||".")+"/";for(let s of this.relativeChildren)if(s.match(i))return true;for(let s of this.absoluteChildren)if(s.match(t))return true;return false}},Xn=class ih{constructor(t=new Map){chunkQBAJWPDZ_cjs.d(this,"store");this.store=t;}copy(){return new ih(new Map(this.store))}hasWalked(t,i){return this.store.get(t.fullpath())?.has(i.globString())}storeWalked(t,i){let s=t.fullpath(),h=this.store.get(s);h?h.add(i.globString()):this.store.set(s,new Set([i.globString()]));}},Qn=class{constructor(){chunkQBAJWPDZ_cjs.d(this,"store",new Map);}add(e,t,i){let s=(t?2:0)|(i?1:0),h=this.store.get(e);this.store.set(e,h===void 0?s:s&h);}entries(){return [...this.store.entries()].map(([e,t])=>[e,!!(t&2),!!(t&1)])}},to=class{constructor(){chunkQBAJWPDZ_cjs.d(this,"store",new Map);}add(e,t){if(!e.canReaddir())return;let i=this.store.get(e);i?i.find(s=>s.globString()===t.globString())||i.push(t):this.store.set(e,[t]);}get(e){let t=this.store.get(e);if(!t)throw new Error("attempting to walk unknown path");return t}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return [...this.store.keys()].filter(e=>e.canReaddir())}},Gs=class sh{constructor(t,i){chunkQBAJWPDZ_cjs.d(this,"hasWalkedCache");chunkQBAJWPDZ_cjs.d(this,"matches",new Qn);chunkQBAJWPDZ_cjs.d(this,"subwalks",new to);chunkQBAJWPDZ_cjs.d(this,"patterns");chunkQBAJWPDZ_cjs.d(this,"follow");chunkQBAJWPDZ_cjs.d(this,"dot");chunkQBAJWPDZ_cjs.d(this,"opts");this.opts=t,this.follow=!!t.follow,this.dot=!!t.dot,this.hasWalkedCache=i?i.copy():new Xn;}processPatterns(t,i){this.patterns=i;let s=i.map(h=>[t,h]);for(let[h,n]of s){this.hasWalkedCache.storeWalked(h,n);let o=n.root(),a=n.isAbsolute()&&this.opts.absolute!==false;if(o){h=h.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let f=n.rest();if(f)n=f;else {this.matches.add(h,true,false);continue}}if(h.isENOENT())continue;let l,u,d=false;for(;typeof(l=n.pattern())=="string"&&(u=n.rest());)h=h.resolve(l),n=u,d=true;if(l=n.pattern(),u=n.rest(),d){if(this.hasWalkedCache.hasWalked(h,n))continue;this.hasWalkedCache.storeWalked(h,n);}if(typeof l=="string"){let f=l===".."||l===""||l===".";this.matches.add(h.resolve(l),a,f);continue}else if(l===ht){(!h.isSymbolicLink()||this.follow||n.checkFollowGlobstar())&&this.subwalks.add(h,n);let f=u?.pattern(),w=u?.rest();if(!u||(f===""||f===".")&&!w)this.matches.add(h,a,f===""||f===".");else if(f===".."){let S=h.parent||h;w?this.hasWalkedCache.hasWalked(S,w)||this.subwalks.add(S,w):this.matches.add(S,a,true);}}else l instanceof RegExp&&this.subwalks.add(h,n);}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new sh(this.opts,this.hasWalkedCache)}filterEntries(t,i){let s=this.subwalks.get(t),h=this.child();for(let n of i)for(let o of s){let a=o.isAbsolute(),l=o.pattern(),u=o.rest();l===ht?h.testGlobstar(n,o,u,a):l instanceof RegExp?h.testRegExp(n,l,u,a):h.testString(n,l,u,a);}return h}testGlobstar(t,i,s,h){if((this.dot||!t.name.startsWith("."))&&(i.hasMore()||this.matches.add(t,h,false),t.canReaddir()&&(this.follow||!t.isSymbolicLink()?this.subwalks.add(t,i):t.isSymbolicLink()&&(s&&i.checkFollowGlobstar()?this.subwalks.add(t,s):i.markFollowGlobstar()&&this.subwalks.add(t,i)))),s){let n=s.pattern();if(typeof n=="string"&&n!==".."&&n!==""&&n!==".")this.testString(t,n,s.rest(),h);else if(n===".."){let o=t.parent||t;this.subwalks.add(o,s);}else n instanceof RegExp&&this.testRegExp(t,n,s.rest(),h);}}testRegExp(t,i,s,h){i.test(t.name)&&(s?this.subwalks.add(t,s):this.matches.add(t,h,false));}testString(t,i,s,h){t.isNamed(i)&&(s?this.subwalks.add(t,s):this.matches.add(t,h,false));}},eo=(e,t)=>typeof e=="string"?new Us([e],t):Array.isArray(e)?new Us(e,t):e,_e,qt,ve,St,ue,ys,mr,rh=(mr=class{constructor(e,t,i){chunkQBAJWPDZ_cjs.f(this,St);chunkQBAJWPDZ_cjs.d(this,"path");chunkQBAJWPDZ_cjs.d(this,"patterns");chunkQBAJWPDZ_cjs.d(this,"opts");chunkQBAJWPDZ_cjs.d(this,"seen",new Set);chunkQBAJWPDZ_cjs.d(this,"paused",false);chunkQBAJWPDZ_cjs.d(this,"aborted",false);chunkQBAJWPDZ_cjs.f(this,_e,[]);chunkQBAJWPDZ_cjs.f(this,qt);chunkQBAJWPDZ_cjs.f(this,ve);chunkQBAJWPDZ_cjs.d(this,"signal");chunkQBAJWPDZ_cjs.d(this,"maxDepth");chunkQBAJWPDZ_cjs.d(this,"includeChildMatches");if(this.patterns=e,this.path=t,this.opts=i,chunkQBAJWPDZ_cjs.g(this,ve,!i.posix&&i.platform==="win32"?"\\":"/"),this.includeChildMatches=i.includeChildMatches!==false,(i.ignore||!this.includeChildMatches)&&(chunkQBAJWPDZ_cjs.g(this,qt,eo(i.ignore??[],i)),!this.includeChildMatches&&typeof chunkQBAJWPDZ_cjs.e(this,qt).add!="function")){let s="cannot ignore child matches, ignore lacks add() method.";throw new Error(s)}this.maxDepth=i.maxDepth||1/0,i.signal&&(this.signal=i.signal,this.signal.addEventListener("abort",()=>{chunkQBAJWPDZ_cjs.e(this,_e).length=0;}));}pause(){this.paused=true;}resume(){if(this.signal?.aborted)return;this.paused=false;let e;for(;!this.paused&&(e=chunkQBAJWPDZ_cjs.e(this,_e).shift());)e();}onResume(e){this.signal?.aborted||(this.paused?chunkQBAJWPDZ_cjs.e(this,_e).push(e):e());}async matchCheck(e,t){if(t&&this.opts.nodir)return;let i;if(this.opts.realpath){if(i=e.realpathCached()||await e.realpath(),!i)return;e=i;}let s=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let h=await s.realpath();h&&(h.isUnknown()||this.opts.stat)&&await h.lstat();}return this.matchCheckTest(s,t)}matchCheckTest(e,t){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!t||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!chunkQBAJWPDZ_cjs.h(this,St,ue).call(this,e)?e:void 0}matchCheckSync(e,t){if(t&&this.opts.nodir)return;let i;if(this.opts.realpath){if(i=e.realpathCached()||e.realpathSync(),!i)return;e=i;}let s=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let h=s.realpathSync();h&&(h?.isUnknown()||this.opts.stat)&&h.lstatSync();}return this.matchCheckTest(s,t)}matchFinish(e,t){if(chunkQBAJWPDZ_cjs.h(this,St,ue).call(this,e))return;if(!this.includeChildMatches&&chunkQBAJWPDZ_cjs.e(this,qt)?.add){let h=`${e.relativePosix()}/**`;chunkQBAJWPDZ_cjs.e(this,qt).add(h);}let i=this.opts.absolute===void 0?t:this.opts.absolute;this.seen.add(e);let s=this.opts.mark&&e.isDirectory()?chunkQBAJWPDZ_cjs.e(this,ve):"";if(this.opts.withFileTypes)this.matchEmit(e);else if(i){let h=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(h+s);}else {let h=this.opts.posix?e.relativePosix():e.relative(),n=this.opts.dotRelative&&!h.startsWith(".."+chunkQBAJWPDZ_cjs.e(this,ve))?"."+chunkQBAJWPDZ_cjs.e(this,ve):"";this.matchEmit(h?n+h+s:"."+s);}}async match(e,t,i){let s=await this.matchCheck(e,i);s&&this.matchFinish(s,t);}matchSync(e,t,i){let s=this.matchCheckSync(e,i);s&&this.matchFinish(s,t);}walkCB(e,t,i){this.signal?.aborted&&i(),this.walkCB2(e,t,new Gs(this.opts),i);}walkCB2(e,t,i,s){if(chunkQBAJWPDZ_cjs.h(this,St,ys).call(this,e))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2(e,t,i,s));return}i.processPatterns(e,t);let h=1,n=()=>{--h===0&&s();};for(let[o,a,l]of i.matches.entries())chunkQBAJWPDZ_cjs.h(this,St,ue).call(this,o)||(h++,this.match(o,a,l).then(()=>n()));for(let o of i.subwalkTargets()){if(this.maxDepth!==1/0&&o.depth()>=this.maxDepth)continue;h++;let a=o.readdirCached();o.calledReaddir()?this.walkCB3(o,a,i,n):o.readdirCB((l,u)=>this.walkCB3(o,u,i,n),true);}n();}walkCB3(e,t,i,s){i=i.filterEntries(e,t);let h=1,n=()=>{--h===0&&s();};for(let[o,a,l]of i.matches.entries())chunkQBAJWPDZ_cjs.h(this,St,ue).call(this,o)||(h++,this.match(o,a,l).then(()=>n()));for(let[o,a]of i.subwalks.entries())h++,this.walkCB2(o,a,i.child(),n);n();}walkCBSync(e,t,i){this.signal?.aborted&&i(),this.walkCB2Sync(e,t,new Gs(this.opts),i);}walkCB2Sync(e,t,i,s){if(chunkQBAJWPDZ_cjs.h(this,St,ys).call(this,e))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2Sync(e,t,i,s));return}i.processPatterns(e,t);let h=1,n=()=>{--h===0&&s();};for(let[o,a,l]of i.matches.entries())chunkQBAJWPDZ_cjs.h(this,St,ue).call(this,o)||this.matchSync(o,a,l);for(let o of i.subwalkTargets()){if(this.maxDepth!==1/0&&o.depth()>=this.maxDepth)continue;h++;let a=o.readdirSync();this.walkCB3Sync(o,a,i,n);}n();}walkCB3Sync(e,t,i,s){i=i.filterEntries(e,t);let h=1,n=()=>{--h===0&&s();};for(let[o,a,l]of i.matches.entries())chunkQBAJWPDZ_cjs.h(this,St,ue).call(this,o)||this.matchSync(o,a,l);for(let[o,a]of i.subwalks.entries())h++,this.walkCB2Sync(o,a,i.child(),n);n();}},_e=new WeakMap,qt=new WeakMap,ve=new WeakMap,St=new WeakSet,ue=function(e){return this.seen.has(e)||!!chunkQBAJWPDZ_cjs.e(this,qt)?.ignored?.(e)},ys=function(e){return !!chunkQBAJWPDZ_cjs.e(this,qt)?.childrenIgnored?.(e)},mr),Is=class extends rh{constructor(t,i,s){super(t,i,s);chunkQBAJWPDZ_cjs.d(this,"matches",new Set);}matchEmit(t){this.matches.add(t);}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((t,i)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?i(this.signal.reason):t(this.matches);});}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},Hs=class extends rh{constructor(t,i,s){super(t,i,s);chunkQBAJWPDZ_cjs.d(this,"results");this.results=new Gi({signal:this.signal,objectMode:true}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume());}matchEmit(t){this.results.write(t),this.results.flowing||this.pause();}stream(){let t=this.path;return t.isUnknown()?t.lstat().then(()=>{this.walkCB(t,this.patterns,()=>this.results.end());}):this.walkCB(t,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}},io=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",xe=class{constructor(e,t){chunkQBAJWPDZ_cjs.d(this,"absolute");chunkQBAJWPDZ_cjs.d(this,"cwd");chunkQBAJWPDZ_cjs.d(this,"root");chunkQBAJWPDZ_cjs.d(this,"dot");chunkQBAJWPDZ_cjs.d(this,"dotRelative");chunkQBAJWPDZ_cjs.d(this,"follow");chunkQBAJWPDZ_cjs.d(this,"ignore");chunkQBAJWPDZ_cjs.d(this,"magicalBraces");chunkQBAJWPDZ_cjs.d(this,"mark");chunkQBAJWPDZ_cjs.d(this,"matchBase");chunkQBAJWPDZ_cjs.d(this,"maxDepth");chunkQBAJWPDZ_cjs.d(this,"nobrace");chunkQBAJWPDZ_cjs.d(this,"nocase");chunkQBAJWPDZ_cjs.d(this,"nodir");chunkQBAJWPDZ_cjs.d(this,"noext");chunkQBAJWPDZ_cjs.d(this,"noglobstar");chunkQBAJWPDZ_cjs.d(this,"pattern");chunkQBAJWPDZ_cjs.d(this,"platform");chunkQBAJWPDZ_cjs.d(this,"realpath");chunkQBAJWPDZ_cjs.d(this,"scurry");chunkQBAJWPDZ_cjs.d(this,"stat");chunkQBAJWPDZ_cjs.d(this,"signal");chunkQBAJWPDZ_cjs.d(this,"windowsPathsNoEscape");chunkQBAJWPDZ_cjs.d(this,"withFileTypes");chunkQBAJWPDZ_cjs.d(this,"includeChildMatches");chunkQBAJWPDZ_cjs.d(this,"opts");chunkQBAJWPDZ_cjs.d(this,"patterns");if(!t)throw new TypeError("glob options required");if(this.withFileTypes=!!t.withFileTypes,this.signal=t.signal,this.follow=!!t.follow,this.dot=!!t.dot,this.dotRelative=!!t.dotRelative,this.nodir=!!t.nodir,this.mark=!!t.mark,t.cwd?(t.cwd instanceof URL||t.cwd.startsWith("file://"))&&(t.cwd=url.fileURLToPath(t.cwd)):this.cwd="",this.cwd=t.cwd||"",this.root=t.root,this.magicalBraces=!!t.magicalBraces,this.nobrace=!!t.nobrace,this.noext=!!t.noext,this.realpath=!!t.realpath,this.absolute=t.absolute,this.includeChildMatches=t.includeChildMatches!==false,this.noglobstar=!!t.noglobstar,this.matchBase=!!t.matchBase,this.maxDepth=typeof t.maxDepth=="number"?t.maxDepth:1/0,this.stat=!!t.stat,this.ignore=t.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===false,this.windowsPathsNoEscape&&(e=e.map(a=>a.replace(/\\/g,"/"))),this.matchBase){if(t.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(a=>a.includes("/")?a:`./**/${a}`);}if(this.pattern=e,this.platform=t.platform||io,this.opts={...t,platform:this.platform},t.scurry){if(this.scurry=t.scurry,t.nocase!==void 0&&t.nocase!==t.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else {let a=t.platform==="win32"?Es:t.platform==="darwin"?th:t.platform?xs:qn;this.scurry=new a(this.cwd,{nocase:t.nocase,fs:t.fs});}this.nocase=this.scurry.nocase;let i=this.platform==="darwin"||this.platform==="win32",s={braceExpandMax:1e4,...t,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:i,nocomment:true,noext:this.noext,nonegate:true,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},h=this.pattern.map(a=>new ae(a,s)),[n,o]=h.reduce((a,l)=>(a[0].push(...l.set),a[1].push(...l.globParts),a),[[],[]]);this.patterns=n.map((a,l)=>{let u=o[l];if(!u)throw new Error("invalid pattern object");return new eh(a,u,0,this.platform)});}async walk(){return [...await new Is(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return [...new Is(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new Hs(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new Hs(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}},so=(e,t={})=>{Array.isArray(e)||(e=[e]);for(let i of e)if(new ae(i,t).hasMagic())return true;return false};function Ji(e,t={}){return new xe(e,t).streamSync()}function hh(e,t={}){return new xe(e,t).stream()}function nh(e,t={}){return new xe(e,t).walkSync()}async function Js(e,t={}){return new xe(e,t).walk()}function qi(e,t={}){return new xe(e,t).iterateSync()}function oh(e,t={}){return new xe(e,t).iterate()}var ro=Ji,ho=Object.assign(hh,{sync:Ji}),no=qi,oo=Object.assign(oh,{sync:qi}),ao=Object.assign(nh,{stream:Ji,iterate:qi}),Ii=Object.assign(Js,{glob:Js,globSync:nh,sync:ao,globStream:hh,stream:ho,globStreamSync:Ji,streamSync:ro,globIterate:oh,iterate:oo,globIterateSync:qi,iterateSync:no,Glob:xe,hasMagic:so,escape:Cr,unescape:Ce});Ii.glob=Ii;exports.c=void 0;(M=>{M.Level=co__default.default.enum(["DEBUG","INFO","WARN","ERROR"]).meta({ref:"LogLevel",description:"Log level"});let t={DEBUG:0,INFO:1,WARN:2,ERROR:3},i="INFO";function s(F){return t[F]>=t[i]}function h(){return i}M.getLevel=h;let n=new Map;M.Default=T({service:"default"});let a="";function l(){return a}M.file=l;let u,d,f=false,w=()=>{},S=false,E=false;async function b(F){if(f)return;if(F.print){f=true;return}F.level&&(i=F.level);let j=F.logDir||Zi__default.default.join(process.env.EASBOT_LOG_PATH??process.cwd(),"logs");F.logFile?a=Zi__default.default.join(j,F.logFile??"utils.log"):a=Zi__default.default.join(j,"utils.log");try{await ah__default.default.mkdir(j,{recursive:!0}),u=await ah__default.default.open(a,"a"),d=Cn.createWriteStream("",{fd:u.fd,autoClose:!1}),w=N=>{if(!(S||E||!d||d.destroyed))try{if(!d.writable)return;d.write(N,B=>{if(B&&!S){let L=B;if(L.code==="EPIPE"||L.code==="EIO"){E=!0,d?.destroy();return}S=!0,setTimeout(()=>{S=!1;},1e3);}});}catch(B){let L=B;if(L.code==="EPIPE"||L.code==="EIO"){E=!0,d?.destroy();return}S||(S=!0,setTimeout(()=>{S=!1;},1e3));}},f=!0;}catch(N){process.stderr.write(`[LOG ERROR] Failed to init log file: ${N}
4
+ `),w=B=>{try{process.stderr.write(B);}catch{}},f=true;}}M.init=b;async function x(){f&&(d&&!d.destroyed&&(await new Promise((F,j)=>{d.end(N=>{N?j(N):F();});}).catch(F=>{process.stderr.write(`[LOG ERROR] Failed to close log stream: ${F}
5
+ `);}),d=void 0),u&&(await u.close().catch(F=>{process.stderr.write(`[LOG ERROR] Failed to close log file: ${F}
6
+ `);}),u=void 0),w=F=>{try{process.stderr.write(F);}catch{}},f=false);}M.close=x;function R(F,j=0){let N=F.message;return F.cause instanceof Error&&j<10?N+" Caused by: "+R(F.cause,j+1):N}let A=Date.now();function T(F){F=F||{};let j=F.service;if(j&&typeof j=="string"){let L=n.get(j);if(L)return L}function N(L,ot){let Vi=Object.entries({...F,...ot}).filter(([ks,Zt])=>Zt!=null).map(([ks,Zt])=>{let Yi=`${ks}=`;return Zt instanceof Error?Yi+R(Zt):typeof Zt=="object"?Yi+JSON.stringify(Zt):Yi+Zt}).join(" "),vt=new Date,ch=vt.getTime()-A;return A=vt.getTime(),[vt.getFullYear()+"-"+String(vt.getMonth()+1).padStart(2,"0")+"-"+String(vt.getDate()).padStart(2,"0")+"T"+String(vt.getHours()).padStart(2,"0")+":"+String(vt.getMinutes()).padStart(2,"0")+":"+String(vt.getSeconds()).padStart(2,"0"),"+"+ch+"ms",Vi,L].filter(Boolean).join(" ")+`
7
+ `}let B={debug(L,ot){s("DEBUG")&&w("DEBUG "+N(L,ot));},info(L,ot){s("INFO")&&w("INFO "+N(L,ot));},error(L,ot){s("ERROR")&&w("ERROR "+N(L,ot));},warn(L,ot){s("WARN")&&w("WARN "+N(L,ot));},tag(L,ot){return F&&(F[L]=ot),B},clone(){return M.create({...F})},time(L,ot){let Vi=Date.now();B.info(L,{status:"started",...ot});function vt(){B.info(L,{status:"completed",duration:Date.now()-Vi,...ot});}return {stop:vt,[Symbol.dispose](){vt();}}}};return j&&typeof j=="string"&&n.set(j,B),B}M.create=T;})(exports.c||(exports.c={}));exports.a=nh;exports.b=Ii;
@@ -0,0 +1 @@
1
+ 'use strict';var chunkOZKXKJQS_cjs=require('./chunk-OZKXKJQS.cjs');require('./chunk-QBAJWPDZ.cjs');Object.defineProperty(exports,"Log",{enumerable:true,get:function(){return chunkOZKXKJQS_cjs.c}});
@@ -0,0 +1 @@
1
+ export{c as Log}from'./chunk-INMS7P5R.mjs';import'./chunk-3QJJWPMF.mjs';