@zuplo/core 6.38.14 → 6.38.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/customer.cli.minified.js +1 -1
- package/index.minified.js +1 -1
- package/package.json +4 -4
package/customer.cli.minified.js
CHANGED
|
@@ -575,7 +575,7 @@ globstar while`,s,K,c,Ne,De),this.matchOne(s.slice(K),c.slice(Ne),f))return this
|
|
|
575
575
|
>>> no match, partial?`,s,K,c,Ne),K===O))}let Se;if(typeof W=="string"?(Se=$===W,this.debug("string match",W,$,Se)):(Se=W.test($),this.debug("pattern match",W,$,Se)),!Se)return!1}if(E===O&&A===M)return!0;if(E===O)return f;if(A===M)return E===O-1&&s[E]==="";throw new Error("wtf?")}braceExpand(){return Qut(this.pattern,this.options)}parse(s){dQ(s);let c=this.options;if(s==="**")return ry;if(s==="")return"";let f,d=null;(f=s.match(Dsr))?d=c.dot?ksr:Asr:(f=s.match(hsr))?d=(c.nocase?c.dot?bsr:vsr:c.dot?ysr:gsr)(f[1]):(f=s.match(wsr))?d=(c.nocase?c.dot?Nsr:Psr:c.dot?Isr:Osr)(f):(f=s.match(Ssr))?d=c.dot?Csr:Tsr:(f=s.match(Esr))&&(d=xsr);let v=Gj.fromGlob(s,this.options).toMMPattern();return d&&typeof v=="object"&&Reflect.defineProperty(v,"test",{value:d}),v}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let s=this.set;if(!s.length)return this.regexp=!1,this.regexp;let c=this.options,f=c.noglobstar?Rsr:c.dot?Msr:jsr,d=new Set(c.nocase?["i"]:[]),v=s.map(O=>{let M=O.map(W=>{if(W instanceof RegExp)for(let $ of W.flags.split(""))d.add($);return typeof W=="string"?zsr(W):W===ry?ry:W._src});return M.forEach((W,$)=>{let K=M[$+1],Ne=M[$-1];W!==ry||Ne===ry||(Ne===void 0?K!==void 0&&K!==ry?M[$+1]="(?:\\/|"+f+"\\/)?"+K:M[$]=f:K===void 0?M[$-1]=Ne+"(?:\\/|"+f+")?":K!==ry&&(M[$-1]=Ne+"(?:\\/|\\/"+f+"\\/)"+K,M[$+1]=ry))}),M.filter(W=>W!==ry).join("/")}).join("|"),[E,A]=s.length>1?["(?:",")"]:["",""];v="^"+E+v+A+"$",this.negate&&(v="^(?!"+v+").+$");try{this.regexp=new RegExp(v,[...d].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(s){return this.preserveMultipleSlashes?s.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(s)?["",...s.split(/\/+/)]:s.split(/\/+/)}match(s,c=this.partial){if(this.debug("match",s,this.pattern),this.comment)return!1;if(this.empty)return s==="";if(s==="/"&&c)return!0;let f=this.options;this.isWindows&&(s=s.split("\\").join("/"));let d=this.slashSplit(s);this.debug(this.pattern,"split",d);let v=this.set;this.debug(this.pattern,"set",v);let E=d[d.length-1];if(!E)for(let A=d.length-2;!E&&A>=0;A--)E=d[A];for(let A=0;A<v.length;A++){let O=v[A],M=d;if(f.matchBase&&O.length===1&&(M=[E]),this.matchOne(M,O,c))return f.flipNegate?!0:!this.negate}return f.flipNegate?!1:this.negate}static defaults(s){return Cv.defaults(s).Minimatch}};Cv.AST=Gj;Cv.Minimatch=AS;Cv.escape=Qj;Cv.unescape=Tx;import{fileURLToPath as Tar}from"url";var Kj=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Yut=new Set,iNe=typeof process=="object"&&process?process:{},Xut=t((a,s,c,f)=>{typeof iNe.emitWarning=="function"?iNe.emitWarning(a,s,c,f):console.error(`[${c}] ${s}: ${a}`)},"emitWarning"),Hue=globalThis.AbortController,Kut=globalThis.AbortSignal;if(typeof Hue>"u"){Kut=class{static{t(this,"AbortSignal")}onabort;_onabort=[];reason;aborted=!1;addEventListener(f,d){this._onabort.push(d)}},Hue=class{static{t(this,"AbortController")}constructor(){s()}signal=new Kut;abort(f){if(!this.signal.aborted){this.signal.reason=f,this.signal.aborted=!0;for(let d of this.signal._onabort)d(f);this.signal.onabort?.(f)}}};let a=iNe.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",s=t(()=>{a&&(a=!1,Xut("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",s))},"warnACPolyfill")}var qsr=t(a=>!Yut.has(a),"shouldWarn"),KLr=Symbol("type"),gN=t(a=>a&&a===Math.floor(a)&&a>0&&isFinite(a),"isPosInt"),Zut=t(a=>gN(a)?a<=Math.pow(2,8)?Uint8Array:a<=Math.pow(2,16)?Uint16Array:a<=Math.pow(2,32)?Uint32Array:a<=Number.MAX_SAFE_INTEGER?Yj:null:null,"getUintArray"),Yj=class extends Array{static{t(this,"ZeroArray")}constructor(s){super(s),this.fill(0)}},sNe=class a{static{t(this,"Stack")}heap;length;static#r=!1;static create(s){let c=Zut(s);if(!c)return[];a.#r=!0;let f=new a(s,c);return a.#r=!1,f}constructor(s,c){if(!a.#r)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new c(s),this.length=0}push(s){this.heap[this.length++]=s}pop(){return this.heap[--this.length]}},hQ=class a{static{t(this,"LRUCache")}#r;#n;#e;#t;#s;#p;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#a;#_;#c;#l;#i;#f;#v;#d;#u;#m;#g;#x;#C;#b;#A;#E;#y;static unsafeExposeInternals(s){return{starts:s.#C,ttls:s.#b,sizes:s.#x,keyMap:s.#c,keyList:s.#l,valList:s.#i,next:s.#f,prev:s.#v,get head(){return s.#d},get tail(){return s.#u},free:s.#m,isBackgroundFetch:t(c=>s.#h(c),"isBackgroundFetch"),backgroundFetch:t((c,f,d,v)=>s.#j(c,f,d,v),"backgroundFetch"),moveToTail:t(c=>s.#U(c),"moveToTail"),indexes:t(c=>s.#w(c),"indexes"),rindexes:t(c=>s.#P(c),"rindexes"),isStale:t(c=>s.#S(c),"isStale")}}get max(){return this.#r}get maxSize(){return this.#n}get calculatedSize(){return this.#_}get size(){return this.#a}get fetchMethod(){return this.#s}get memoMethod(){return this.#p}get dispose(){return this.#e}get disposeAfter(){return this.#t}constructor(s){let{max:c=0,ttl:f,ttlResolution:d=1,ttlAutopurge:v,updateAgeOnGet:E,updateAgeOnHas:A,allowStale:O,dispose:M,disposeAfter:W,noDisposeOnSet:$,noUpdateTTL:K,maxSize:Ne=0,maxEntrySize:De=0,sizeCalculation:Se,fetchMethod:Tt,memoMethod:xt,noDeleteOnFetchRejection:vr,noDeleteOnStaleGet:Tr,allowStaleOnFetchRejection:Nr,allowStaleOnFetchAbort:Cr,ignoreFetchAbort:pr}=s;if(c!==0&&!gN(c))throw new TypeError("max option must be a nonnegative integer");let sr=c?Zut(c):Array;if(!sr)throw new Error("invalid max value: "+c);if(this.#r=c,this.#n=Ne,this.maxEntrySize=De||this.#n,this.sizeCalculation=Se,this.sizeCalculation){if(!this.#n&&!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(xt!==void 0&&typeof xt!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#p=xt,Tt!==void 0&&typeof Tt!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#s=Tt,this.#E=!!Tt,this.#c=new Map,this.#l=new Array(c).fill(void 0),this.#i=new Array(c).fill(void 0),this.#f=new sr(c),this.#v=new sr(c),this.#d=0,this.#u=0,this.#m=sNe.create(c),this.#a=0,this.#_=0,typeof M=="function"&&(this.#e=M),typeof W=="function"?(this.#t=W,this.#g=[]):(this.#t=void 0,this.#g=void 0),this.#A=!!this.#e,this.#y=!!this.#t,this.noDisposeOnSet=!!$,this.noUpdateTTL=!!K,this.noDeleteOnFetchRejection=!!vr,this.allowStaleOnFetchRejection=!!Nr,this.allowStaleOnFetchAbort=!!Cr,this.ignoreFetchAbort=!!pr,this.maxEntrySize!==0){if(this.#n!==0&&!gN(this.#n))throw new TypeError("maxSize must be a positive integer if specified");if(!gN(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#T()}if(this.allowStale=!!O,this.noDeleteOnStaleGet=!!Tr,this.updateAgeOnGet=!!E,this.updateAgeOnHas=!!A,this.ttlResolution=gN(d)||d===0?d:1,this.ttlAutopurge=!!v,this.ttl=f||0,this.ttl){if(!gN(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#D()}if(this.#r===0&&this.ttl===0&&this.#n===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#r&&!this.#n){let Cs="LRU_CACHE_UNBOUNDED";qsr(Cs)&&(Yut.add(Cs),Xut("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Cs,a))}}getRemainingTTL(s){return this.#c.has(s)?1/0:0}#D(){let s=new Yj(this.#r),c=new Yj(this.#r);this.#b=s,this.#C=c,this.#N=(v,E,A=Kj.now())=>{if(c[v]=E!==0?A:0,s[v]=E,E!==0&&this.ttlAutopurge){let O=setTimeout(()=>{this.#S(v)&&this.#O(this.#l[v],"expire")},E+1);O.unref&&O.unref()}},this.#k=v=>{c[v]=s[v]!==0?Kj.now():0},this.#o=(v,E)=>{if(s[E]){let A=s[E],O=c[E];if(!A||!O)return;v.ttl=A,v.start=O,v.now=f||d();let M=v.now-O;v.remainingTTL=A-M}};let f=0,d=t(()=>{let v=Kj.now();if(this.ttlResolution>0){f=v;let E=setTimeout(()=>f=0,this.ttlResolution);E.unref&&E.unref()}return v},"getNow");this.getRemainingTTL=v=>{let E=this.#c.get(v);if(E===void 0)return 0;let A=s[E],O=c[E];if(!A||!O)return 1/0;let M=(f||d())-O;return A-M},this.#S=v=>{let E=c[v],A=s[v];return!!A&&!!E&&(f||d())-E>A}}#k=t(()=>{},"#updateItemAge");#o=t(()=>{},"#statusTTL");#N=t(()=>{},"#setItemTTL");#S=t(()=>!1,"#isStale");#T(){let s=new Yj(this.#r);this.#_=0,this.#x=s,this.#I=c=>{this.#_-=s[c],s[c]=0},this.#L=(c,f,d,v)=>{if(this.#h(f))return 0;if(!gN(d))if(v){if(typeof v!="function")throw new TypeError("sizeCalculation must be a function");if(d=v(f,c),!gN(d))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 d},this.#F=(c,f,d)=>{if(s[c]=f,this.#n){let v=this.#n-s[c];for(;this.#_>v;)this.#M(!0)}this.#_+=s[c],d&&(d.entrySize=f,d.totalCalculatedSize=this.#_)}}#I=t(s=>{},"#removeItemSize");#F=t((s,c,f)=>{},"#addItemSize");#L=t((s,c,f,d)=>{if(f||d)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0},"#requireSize");*#w({allowStale:s=this.allowStale}={}){if(this.#a)for(let c=this.#u;!(!this.#R(c)||((s||!this.#S(c))&&(yield c),c===this.#d));)c=this.#v[c]}*#P({allowStale:s=this.allowStale}={}){if(this.#a)for(let c=this.#d;!(!this.#R(c)||((s||!this.#S(c))&&(yield c),c===this.#u));)c=this.#f[c]}#R(s){return s!==void 0&&this.#c.get(this.#l[s])===s}*entries(){for(let s of this.#w())this.#i[s]!==void 0&&this.#l[s]!==void 0&&!this.#h(this.#i[s])&&(yield[this.#l[s],this.#i[s]])}*rentries(){for(let s of this.#P())this.#i[s]!==void 0&&this.#l[s]!==void 0&&!this.#h(this.#i[s])&&(yield[this.#l[s],this.#i[s]])}*keys(){for(let s of this.#w()){let c=this.#l[s];c!==void 0&&!this.#h(this.#i[s])&&(yield c)}}*rkeys(){for(let s of this.#P()){let c=this.#l[s];c!==void 0&&!this.#h(this.#i[s])&&(yield c)}}*values(){for(let s of this.#w())this.#i[s]!==void 0&&!this.#h(this.#i[s])&&(yield this.#i[s])}*rvalues(){for(let s of this.#P())this.#i[s]!==void 0&&!this.#h(this.#i[s])&&(yield this.#i[s])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(s,c={}){for(let f of this.#w()){let d=this.#i[f],v=this.#h(d)?d.__staleWhileFetching:d;if(v!==void 0&&s(v,this.#l[f],this))return this.get(this.#l[f],c)}}forEach(s,c=this){for(let f of this.#w()){let d=this.#i[f],v=this.#h(d)?d.__staleWhileFetching:d;v!==void 0&&s.call(c,v,this.#l[f],this)}}rforEach(s,c=this){for(let f of this.#P()){let d=this.#i[f],v=this.#h(d)?d.__staleWhileFetching:d;v!==void 0&&s.call(c,v,this.#l[f],this)}}purgeStale(){let s=!1;for(let c of this.#P({allowStale:!0}))this.#S(c)&&(this.#O(this.#l[c],"expire"),s=!0);return s}info(s){let c=this.#c.get(s);if(c===void 0)return;let f=this.#i[c],d=this.#h(f)?f.__staleWhileFetching:f;if(d===void 0)return;let v={value:d};if(this.#b&&this.#C){let E=this.#b[c],A=this.#C[c];if(E&&A){let O=E-(Kj.now()-A);v.ttl=O,v.start=Date.now()}}return this.#x&&(v.size=this.#x[c]),v}dump(){let s=[];for(let c of this.#w({allowStale:!0})){let f=this.#l[c],d=this.#i[c],v=this.#h(d)?d.__staleWhileFetching:d;if(v===void 0||f===void 0)continue;let E={value:v};if(this.#b&&this.#C){E.ttl=this.#b[c];let A=Kj.now()-this.#C[c];E.start=Math.floor(Date.now()-A)}this.#x&&(E.size=this.#x[c]),s.unshift([f,E])}return s}load(s){this.clear();for(let[c,f]of s){if(f.start){let d=Date.now()-f.start;f.start=Kj.now()-d}this.set(c,f.value,f)}}set(s,c,f={}){if(c===void 0)return this.delete(s),this;let{ttl:d=this.ttl,start:v,noDisposeOnSet:E=this.noDisposeOnSet,sizeCalculation:A=this.sizeCalculation,status:O}=f,{noUpdateTTL:M=this.noUpdateTTL}=f,W=this.#L(s,c,f.size||0,A);if(this.maxEntrySize&&W>this.maxEntrySize)return O&&(O.set="miss",O.maxEntrySizeExceeded=!0),this.#O(s,"set"),this;let $=this.#a===0?void 0:this.#c.get(s);if($===void 0)$=this.#a===0?this.#u:this.#m.length!==0?this.#m.pop():this.#a===this.#r?this.#M(!1):this.#a,this.#l[$]=s,this.#i[$]=c,this.#c.set(s,$),this.#f[this.#u]=$,this.#v[$]=this.#u,this.#u=$,this.#a++,this.#F($,W,O),O&&(O.set="add"),M=!1;else{this.#U($);let K=this.#i[$];if(c!==K){if(this.#E&&this.#h(K)){K.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:Ne}=K;Ne!==void 0&&!E&&(this.#A&&this.#e?.(Ne,s,"set"),this.#y&&this.#g?.push([Ne,s,"set"]))}else E||(this.#A&&this.#e?.(K,s,"set"),this.#y&&this.#g?.push([K,s,"set"]));if(this.#I($),this.#F($,W,O),this.#i[$]=c,O){O.set="replace";let Ne=K&&this.#h(K)?K.__staleWhileFetching:K;Ne!==void 0&&(O.oldValue=Ne)}}else O&&(O.set="update")}if(d!==0&&!this.#b&&this.#D(),this.#b&&(M||this.#N($,d,v),O&&this.#o(O,$)),!E&&this.#y&&this.#g){let K=this.#g,Ne;for(;Ne=K?.shift();)this.#t?.(...Ne)}return this}pop(){try{for(;this.#a;){let s=this.#i[this.#d];if(this.#M(!0),this.#h(s)){if(s.__staleWhileFetching)return s.__staleWhileFetching}else if(s!==void 0)return s}}finally{if(this.#y&&this.#g){let s=this.#g,c;for(;c=s?.shift();)this.#t?.(...c)}}}#M(s){let c=this.#d,f=this.#l[c],d=this.#i[c];return this.#E&&this.#h(d)?d.__abortController.abort(new Error("evicted")):(this.#A||this.#y)&&(this.#A&&this.#e?.(d,f,"evict"),this.#y&&this.#g?.push([d,f,"evict"])),this.#I(c),s&&(this.#l[c]=void 0,this.#i[c]=void 0,this.#m.push(c)),this.#a===1?(this.#d=this.#u=0,this.#m.length=0):this.#d=this.#f[c],this.#c.delete(f),this.#a--,c}has(s,c={}){let{updateAgeOnHas:f=this.updateAgeOnHas,status:d}=c,v=this.#c.get(s);if(v!==void 0){let E=this.#i[v];if(this.#h(E)&&E.__staleWhileFetching===void 0)return!1;if(this.#S(v))d&&(d.has="stale",this.#o(d,v));else return f&&this.#k(v),d&&(d.has="hit",this.#o(d,v)),!0}else d&&(d.has="miss");return!1}peek(s,c={}){let{allowStale:f=this.allowStale}=c,d=this.#c.get(s);if(d===void 0||!f&&this.#S(d))return;let v=this.#i[d];return this.#h(v)?v.__staleWhileFetching:v}#j(s,c,f,d){let v=c===void 0?void 0:this.#i[c];if(this.#h(v))return v;let E=new Hue,{signal:A}=f;A?.addEventListener("abort",()=>E.abort(A.reason),{signal:E.signal});let O={signal:E.signal,options:f,context:d},M=t((Se,Tt=!1)=>{let{aborted:xt}=E.signal,vr=f.ignoreFetchAbort&&Se!==void 0;if(f.status&&(xt&&!Tt?(f.status.fetchAborted=!0,f.status.fetchError=E.signal.reason,vr&&(f.status.fetchAbortIgnored=!0)):f.status.fetchResolved=!0),xt&&!vr&&!Tt)return $(E.signal.reason);let Tr=Ne;return this.#i[c]===Ne&&(Se===void 0?Tr.__staleWhileFetching?this.#i[c]=Tr.__staleWhileFetching:this.#O(s,"fetch"):(f.status&&(f.status.fetchUpdated=!0),this.set(s,Se,O.options))),Se},"cb"),W=t(Se=>(f.status&&(f.status.fetchRejected=!0,f.status.fetchError=Se),$(Se)),"eb"),$=t(Se=>{let{aborted:Tt}=E.signal,xt=Tt&&f.allowStaleOnFetchAbort,vr=xt||f.allowStaleOnFetchRejection,Tr=vr||f.noDeleteOnFetchRejection,Nr=Ne;if(this.#i[c]===Ne&&(!Tr||Nr.__staleWhileFetching===void 0?this.#O(s,"fetch"):xt||(this.#i[c]=Nr.__staleWhileFetching)),vr)return f.status&&Nr.__staleWhileFetching!==void 0&&(f.status.returnedStale=!0),Nr.__staleWhileFetching;if(Nr.__returned===Nr)throw Se},"fetchFail"),K=t((Se,Tt)=>{let xt=this.#s?.(s,v,O);xt&&xt instanceof Promise&&xt.then(vr=>Se(vr===void 0?void 0:vr),Tt),E.signal.addEventListener("abort",()=>{(!f.ignoreFetchAbort||f.allowStaleOnFetchAbort)&&(Se(void 0),f.allowStaleOnFetchAbort&&(Se=t(vr=>M(vr,!0),"res")))})},"pcall");f.status&&(f.status.fetchDispatched=!0);let Ne=new Promise(K).then(M,W),De=Object.assign(Ne,{__abortController:E,__staleWhileFetching:v,__returned:void 0});return c===void 0?(this.set(s,De,{...O.options,status:void 0}),c=this.#c.get(s)):this.#i[c]=De,De}#h(s){if(!this.#E)return!1;let c=s;return!!c&&c instanceof Promise&&c.hasOwnProperty("__staleWhileFetching")&&c.__abortController instanceof Hue}async fetch(s,c={}){let{allowStale:f=this.allowStale,updateAgeOnGet:d=this.updateAgeOnGet,noDeleteOnStaleGet:v=this.noDeleteOnStaleGet,ttl:E=this.ttl,noDisposeOnSet:A=this.noDisposeOnSet,size:O=0,sizeCalculation:M=this.sizeCalculation,noUpdateTTL:W=this.noUpdateTTL,noDeleteOnFetchRejection:$=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:K=this.allowStaleOnFetchRejection,ignoreFetchAbort:Ne=this.ignoreFetchAbort,allowStaleOnFetchAbort:De=this.allowStaleOnFetchAbort,context:Se,forceRefresh:Tt=!1,status:xt,signal:vr}=c;if(!this.#E)return xt&&(xt.fetch="get"),this.get(s,{allowStale:f,updateAgeOnGet:d,noDeleteOnStaleGet:v,status:xt});let Tr={allowStale:f,updateAgeOnGet:d,noDeleteOnStaleGet:v,ttl:E,noDisposeOnSet:A,size:O,sizeCalculation:M,noUpdateTTL:W,noDeleteOnFetchRejection:$,allowStaleOnFetchRejection:K,allowStaleOnFetchAbort:De,ignoreFetchAbort:Ne,status:xt,signal:vr},Nr=this.#c.get(s);if(Nr===void 0){xt&&(xt.fetch="miss");let Cr=this.#j(s,Nr,Tr,Se);return Cr.__returned=Cr}else{let Cr=this.#i[Nr];if(this.#h(Cr)){let _o=f&&Cr.__staleWhileFetching!==void 0;return xt&&(xt.fetch="inflight",_o&&(xt.returnedStale=!0)),_o?Cr.__staleWhileFetching:Cr.__returned=Cr}let pr=this.#S(Nr);if(!Tt&&!pr)return xt&&(xt.fetch="hit"),this.#U(Nr),d&&this.#k(Nr),xt&&this.#o(xt,Nr),Cr;let sr=this.#j(s,Nr,Tr,Se),Di=sr.__staleWhileFetching!==void 0&&f;return xt&&(xt.fetch=pr?"stale":"refresh",Di&&pr&&(xt.returnedStale=!0)),Di?sr.__staleWhileFetching:sr.__returned=sr}}async forceFetch(s,c={}){let f=await this.fetch(s,c);if(f===void 0)throw new Error("fetch() returned undefined");return f}memo(s,c={}){let f=this.#p;if(!f)throw new Error("no memoMethod provided to constructor");let{context:d,forceRefresh:v,...E}=c,A=this.get(s,E);if(!v&&A!==void 0)return A;let O=f(s,A,{options:E,context:d});return this.set(s,O,E),O}get(s,c={}){let{allowStale:f=this.allowStale,updateAgeOnGet:d=this.updateAgeOnGet,noDeleteOnStaleGet:v=this.noDeleteOnStaleGet,status:E}=c,A=this.#c.get(s);if(A!==void 0){let O=this.#i[A],M=this.#h(O);return E&&this.#o(E,A),this.#S(A)?(E&&(E.get="stale"),M?(E&&f&&O.__staleWhileFetching!==void 0&&(E.returnedStale=!0),f?O.__staleWhileFetching:void 0):(v||this.#O(s,"expire"),E&&f&&(E.returnedStale=!0),f?O:void 0)):(E&&(E.get="hit"),M?O.__staleWhileFetching:(this.#U(A),d&&this.#k(A),O))}else E&&(E.get="miss")}#B(s,c){this.#v[c]=s,this.#f[s]=c}#U(s){s!==this.#u&&(s===this.#d?this.#d=this.#f[s]:this.#B(this.#v[s],this.#f[s]),this.#B(this.#u,s),this.#u=s)}delete(s){return this.#O(s,"delete")}#O(s,c){let f=!1;if(this.#a!==0){let d=this.#c.get(s);if(d!==void 0)if(f=!0,this.#a===1)this.#$(c);else{this.#I(d);let v=this.#i[d];if(this.#h(v)?v.__abortController.abort(new Error("deleted")):(this.#A||this.#y)&&(this.#A&&this.#e?.(v,s,c),this.#y&&this.#g?.push([v,s,c])),this.#c.delete(s),this.#l[d]=void 0,this.#i[d]=void 0,d===this.#u)this.#u=this.#v[d];else if(d===this.#d)this.#d=this.#f[d];else{let E=this.#v[d];this.#f[E]=this.#f[d];let A=this.#f[d];this.#v[A]=this.#v[d]}this.#a--,this.#m.push(d)}}if(this.#y&&this.#g?.length){let d=this.#g,v;for(;v=d?.shift();)this.#t?.(...v)}return f}clear(){return this.#$("delete")}#$(s){for(let c of this.#P({allowStale:!0})){let f=this.#i[c];if(this.#h(f))f.__abortController.abort(new Error("deleted"));else{let d=this.#l[c];this.#A&&this.#e?.(f,d,s),this.#y&&this.#g?.push([f,d,s])}}if(this.#c.clear(),this.#i.fill(void 0),this.#l.fill(void 0),this.#b&&this.#C&&(this.#b.fill(0),this.#C.fill(0)),this.#x&&this.#x.fill(0),this.#d=0,this.#u=0,this.#m.length=0,this.#_=0,this.#a=0,this.#y&&this.#g){let c=this.#g,f;for(;f=c?.shift();)this.#t?.(...f)}}};import{posix as tar,win32 as mNe}from"path";import{fileURLToPath as rar}from"url";import{lstatSync as nar,readdir as iar,readdirSync as sar,readlinkSync as aar,realpathSync as oar}from"fs";import*as car from"fs";import{lstat as uar,readdir as far,readlink as _ar,realpath as par}from"fs/promises";import{EventEmitter as _Ne}from"events";import ift from"stream";import{StringDecoder as Vsr}from"string_decoder";var eft=typeof process=="object"&&process?process:{stdout:null,stderr:null},Wsr=t(a=>!!a&&typeof a=="object"&&(a instanceof vN||a instanceof ift||Hsr(a)||Gsr(a)),"isStream"),Hsr=t(a=>!!a&&typeof a=="object"&&a instanceof _Ne&&typeof a.pipe=="function"&&a.pipe!==ift.Writable.prototype.pipe,"isReadable"),Gsr=t(a=>!!a&&typeof a=="object"&&a instanceof _Ne&&typeof a.write=="function"&&typeof a.end=="function","isWritable"),t6=Symbol("EOF"),r6=Symbol("maybeEmitEnd"),yN=Symbol("emittedEnd"),Gue=Symbol("emittingEnd"),gQ=Symbol("emittedError"),Que=Symbol("closed"),tft=Symbol("read"),Kue=Symbol("flush"),rft=Symbol("flushChunk"),Cx=Symbol("encoding"),Xj=Symbol("decoder"),d0=Symbol("flowing"),yQ=Symbol("paused"),Zj=Symbol("resume"),m0=Symbol("buffer"),Ev=Symbol("pipes"),h0=Symbol("bufferLength"),aNe=Symbol("bufferPush"),Yue=Symbol("bufferShift"),r1=Symbol("objectMode"),uh=Symbol("destroyed"),oNe=Symbol("error"),cNe=Symbol("emitData"),nft=Symbol("emitEnd"),lNe=Symbol("emitEnd2"),XA=Symbol("async"),uNe=Symbol("abort"),Xue=Symbol("aborted"),vQ=Symbol("signal"),qF=Symbol("dataListeners"),kS=Symbol("discarded"),bQ=t(a=>Promise.resolve().then(a),"defer"),Qsr=t(a=>a(),"nodefer"),Ksr=t(a=>a==="end"||a==="finish"||a==="prefinish","isEndish"),Ysr=t(a=>a instanceof ArrayBuffer||!!a&&typeof a=="object"&&a.constructor&&a.constructor.name==="ArrayBuffer"&&a.byteLength>=0,"isArrayBufferLike"),Xsr=t(a=>!Buffer.isBuffer(a)&&ArrayBuffer.isView(a),"isArrayBufferView"),Zue=class{static{t(this,"Pipe")}src;dest;opts;ondrain;constructor(s,c,f){this.src=s,this.dest=c,this.opts=f,this.ondrain=()=>s[Zj](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(s){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},fNe=class extends Zue{static{t(this,"PipeProxyErrors")}unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(s,c,f){super(s,c,f),this.proxyErrors=d=>c.emit("error",d),s.on("error",this.proxyErrors)}},Zsr=t(a=>!!a.objectMode,"isObjectModeOptions"),ear=t(a=>!a.objectMode&&!!a.encoding&&a.encoding!=="buffer","isEncodingOptions"),vN=class extends _Ne{static{t(this,"Minipass")}[d0]=!1;[yQ]=!1;[Ev]=[];[m0]=[];[r1];[Cx];[XA];[Xj];[t6]=!1;[yN]=!1;[Gue]=!1;[Que]=!1;[gQ]=null;[h0]=0;[uh]=!1;[vQ];[Xue]=!1;[qF]=0;[kS]=!1;writable=!0;readable=!0;constructor(...s){let c=s[0]||{};if(super(),c.objectMode&&typeof c.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");Zsr(c)?(this[r1]=!0,this[Cx]=null):ear(c)?(this[Cx]=c.encoding,this[r1]=!1):(this[r1]=!1,this[Cx]=null),this[XA]=!!c.async,this[Xj]=this[Cx]?new Vsr(this[Cx]):null,c&&c.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:t(()=>this[m0],"get")}),c&&c.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:t(()=>this[Ev],"get")});let{signal:f}=c;f&&(this[vQ]=f,f.aborted?this[uNe]():f.addEventListener("abort",()=>this[uNe]()))}get bufferLength(){return this[h0]}get encoding(){return this[Cx]}set encoding(s){throw new Error("Encoding must be set at instantiation time")}setEncoding(s){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[r1]}set objectMode(s){throw new Error("objectMode must be set at instantiation time")}get async(){return this[XA]}set async(s){this[XA]=this[XA]||!!s}[uNe](){this[Xue]=!0,this.emit("abort",this[vQ]?.reason),this.destroy(this[vQ]?.reason)}get aborted(){return this[Xue]}set aborted(s){}write(s,c,f){if(this[Xue])return!1;if(this[t6])throw new Error("write after end");if(this[uh])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof c=="function"&&(f=c,c="utf8"),c||(c="utf8");let d=this[XA]?bQ:Qsr;if(!this[r1]&&!Buffer.isBuffer(s)){if(Xsr(s))s=Buffer.from(s.buffer,s.byteOffset,s.byteLength);else if(Ysr(s))s=Buffer.from(s);else if(typeof s!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[r1]?(this[d0]&&this[h0]!==0&&this[Kue](!0),this[d0]?this.emit("data",s):this[aNe](s),this[h0]!==0&&this.emit("readable"),f&&d(f),this[d0]):s.length?(typeof s=="string"&&!(c===this[Cx]&&!this[Xj]?.lastNeed)&&(s=Buffer.from(s,c)),Buffer.isBuffer(s)&&this[Cx]&&(s=this[Xj].write(s)),this[d0]&&this[h0]!==0&&this[Kue](!0),this[d0]?this.emit("data",s):this[aNe](s),this[h0]!==0&&this.emit("readable"),f&&d(f),this[d0]):(this[h0]!==0&&this.emit("readable"),f&&d(f),this[d0])}read(s){if(this[uh])return null;if(this[kS]=!1,this[h0]===0||s===0||s&&s>this[h0])return this[r6](),null;this[r1]&&(s=null),this[m0].length>1&&!this[r1]&&(this[m0]=[this[Cx]?this[m0].join(""):Buffer.concat(this[m0],this[h0])]);let c=this[tft](s||null,this[m0][0]);return this[r6](),c}[tft](s,c){if(this[r1])this[Yue]();else{let f=c;s===f.length||s===null?this[Yue]():typeof f=="string"?(this[m0][0]=f.slice(s),c=f.slice(0,s),this[h0]-=s):(this[m0][0]=f.subarray(s),c=f.subarray(0,s),this[h0]-=s)}return this.emit("data",c),!this[m0].length&&!this[t6]&&this.emit("drain"),c}end(s,c,f){return typeof s=="function"&&(f=s,s=void 0),typeof c=="function"&&(f=c,c="utf8"),s!==void 0&&this.write(s,c),f&&this.once("end",f),this[t6]=!0,this.writable=!1,(this[d0]||!this[yQ])&&this[r6](),this}[Zj](){this[uh]||(!this[qF]&&!this[Ev].length&&(this[kS]=!0),this[yQ]=!1,this[d0]=!0,this.emit("resume"),this[m0].length?this[Kue]():this[t6]?this[r6]():this.emit("drain"))}resume(){return this[Zj]()}pause(){this[d0]=!1,this[yQ]=!0,this[kS]=!1}get destroyed(){return this[uh]}get flowing(){return this[d0]}get paused(){return this[yQ]}[aNe](s){this[r1]?this[h0]+=1:this[h0]+=s.length,this[m0].push(s)}[Yue](){return this[r1]?this[h0]-=1:this[h0]-=this[m0][0].length,this[m0].shift()}[Kue](s=!1){do;while(this[rft](this[Yue]())&&this[m0].length);!s&&!this[m0].length&&!this[t6]&&this.emit("drain")}[rft](s){return this.emit("data",s),this[d0]}pipe(s,c){if(this[uh])return s;this[kS]=!1;let f=this[yN];return c=c||{},s===eft.stdout||s===eft.stderr?c.end=!1:c.end=c.end!==!1,c.proxyErrors=!!c.proxyErrors,f?c.end&&s.end():(this[Ev].push(c.proxyErrors?new fNe(this,s,c):new Zue(this,s,c)),this[XA]?bQ(()=>this[Zj]()):this[Zj]()),s}unpipe(s){let c=this[Ev].find(f=>f.dest===s);c&&(this[Ev].length===1?(this[d0]&&this[qF]===0&&(this[d0]=!1),this[Ev]=[]):this[Ev].splice(this[Ev].indexOf(c),1),c.unpipe())}addListener(s,c){return this.on(s,c)}on(s,c){let f=super.on(s,c);if(s==="data")this[kS]=!1,this[qF]++,!this[Ev].length&&!this[d0]&&this[Zj]();else if(s==="readable"&&this[h0]!==0)super.emit("readable");else if(Ksr(s)&&this[yN])super.emit(s),this.removeAllListeners(s);else if(s==="error"&&this[gQ]){let d=c;this[XA]?bQ(()=>d.call(this,this[gQ])):d.call(this,this[gQ])}return f}removeListener(s,c){return this.off(s,c)}off(s,c){let f=super.off(s,c);return s==="data"&&(this[qF]=this.listeners("data").length,this[qF]===0&&!this[kS]&&!this[Ev].length&&(this[d0]=!1)),f}removeAllListeners(s){let c=super.removeAllListeners(s);return(s==="data"||s===void 0)&&(this[qF]=0,!this[kS]&&!this[Ev].length&&(this[d0]=!1)),c}get emittedEnd(){return this[yN]}[r6](){!this[Gue]&&!this[yN]&&!this[uh]&&this[m0].length===0&&this[t6]&&(this[Gue]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Que]&&this.emit("close"),this[Gue]=!1)}emit(s,...c){let f=c[0];if(s!=="error"&&s!=="close"&&s!==uh&&this[uh])return!1;if(s==="data")return!this[r1]&&!f?!1:this[XA]?(bQ(()=>this[cNe](f)),!0):this[cNe](f);if(s==="end")return this[nft]();if(s==="close"){if(this[Que]=!0,!this[yN]&&!this[uh])return!1;let v=super.emit("close");return this.removeAllListeners("close"),v}else if(s==="error"){this[gQ]=f,super.emit(oNe,f);let v=!this[vQ]||this.listeners("error").length?super.emit("error",f):!1;return this[r6](),v}else if(s==="resume"){let v=super.emit("resume");return this[r6](),v}else if(s==="finish"||s==="prefinish"){let v=super.emit(s);return this.removeAllListeners(s),v}let d=super.emit(s,...c);return this[r6](),d}[cNe](s){for(let f of this[Ev])f.dest.write(s)===!1&&this.pause();let c=this[kS]?!1:super.emit("data",s);return this[r6](),c}[nft](){return this[yN]?!1:(this[yN]=!0,this.readable=!1,this[XA]?(bQ(()=>this[lNe]()),!0):this[lNe]())}[lNe](){if(this[Xj]){let c=this[Xj].end();if(c){for(let f of this[Ev])f.dest.write(c);this[kS]||super.emit("data",c)}}for(let c of this[Ev])c.end();let s=super.emit("end");return this.removeAllListeners("end"),s}async collect(){let s=Object.assign([],{dataLength:0});this[r1]||(s.dataLength=0);let c=this.promise();return this.on("data",f=>{s.push(f),this[r1]||(s.dataLength+=f.length)}),await c,s}async concat(){if(this[r1])throw new Error("cannot concat in objectMode");let s=await this.collect();return this[Cx]?s.join(""):Buffer.concat(s,s.dataLength)}async promise(){return new Promise((s,c)=>{this.on(uh,()=>c(new Error("stream destroyed"))),this.on("error",f=>c(f)),this.on("end",()=>s())})}[Symbol.asyncIterator](){this[kS]=!1;let s=!1,c=t(async()=>(this.pause(),s=!0,{value:void 0,done:!0}),"stop");return{next:t(()=>{if(s)return c();let d=this.read();if(d!==null)return Promise.resolve({done:!1,value:d});if(this[t6])return c();let v,E,A=t($=>{this.off("data",O),this.off("end",M),this.off(uh,W),c(),E($)},"onerr"),O=t($=>{this.off("error",A),this.off("end",M),this.off(uh,W),this.pause(),v({value:$,done:!!this[t6]})},"ondata"),M=t(()=>{this.off("error",A),this.off("data",O),this.off(uh,W),c(),v({done:!0,value:void 0})},"onend"),W=t(()=>A(new Error("stream destroyed")),"ondestroy");return new Promise(($,K)=>{E=K,v=$,this.once(uh,W),this.once("error",A),this.once("end",M),this.once("data",O)})},"next"),throw:c,return:c,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[kS]=!1;let s=!1,c=t(()=>(this.pause(),this.off(oNe,c),this.off(uh,c),this.off("end",c),s=!0,{done:!0,value:void 0}),"stop"),f=t(()=>{if(s)return c();let d=this.read();return d===null?c():{done:!1,value:d}},"next");return this.once("end",c),this.once(oNe,c),this.once(uh,c),{next:f,throw:c,return:c,[Symbol.iterator](){return this}}}destroy(s){if(this[uh])return s?this.emit("error",s):this.emit(uh),this;this[uh]=!0,this[kS]=!0,this[m0].length=0,this[h0]=0;let c=this;return typeof c.close=="function"&&!this[Que]&&c.close(),s?this.emit("error",s):this.emit(uh),this}static get isStream(){return Wsr}};var lar=oar.native,TQ={lstatSync:nar,readdir:iar,readdirSync:sar,readlinkSync:aar,realpathSync:lar,promises:{lstat:uar,readdir:far,readlink:_ar,realpath:par}},lft=t(a=>!a||a===TQ||a===car?TQ:{...TQ,...a,promises:{...TQ.promises,...a.promises||{}}},"fsFromOption"),uft=/^\\\\\?\\([a-z]:)\\?$/i,dar=t(a=>a.replace(/\//g,"\\").replace(uft,"$1\\"),"uncToDrive"),mar=/[\\\/]/,mC=0,fft=1,_ft=2,ZA=4,pft=6,dft=8,VF=10,mft=12,dC=15,SQ=~dC,pNe=16,sft=32,CQ=64,Ex=128,efe=256,rfe=512,aft=CQ|Ex|rfe,har=1023,dNe=t(a=>a.isFile()?dft:a.isDirectory()?ZA:a.isSymbolicLink()?VF:a.isCharacterDevice()?_ft:a.isBlockDevice()?pft:a.isSocket()?mft:a.isFIFO()?fft:mC,"entToType"),oft=new Map,EQ=t(a=>{let s=oft.get(a);if(s)return s;let c=a.normalize("NFKD");return oft.set(a,c),c},"normalize"),cft=new Map,tfe=t(a=>{let s=cft.get(a);if(s)return s;let c=EQ(a.toLowerCase());return cft.set(a,c),c},"normalizeNocase"),nfe=class extends hQ{static{t(this,"ResolveCache")}constructor(){super({max:256})}},hNe=class extends hQ{static{t(this,"ChildrenCache")}constructor(s=16*1024){super({maxSize:s,sizeCalculation:t(c=>c.length+1,"sizeCalculation")})}},hft=Symbol("PathScurry setAsCwd"),n1=class{static{t(this,"PathBase")}name;root;roots;parent;nocase;isCWD=!1;#r;#n;get dev(){return this.#n}#e;get mode(){return this.#e}#t;get nlink(){return this.#t}#s;get uid(){return this.#s}#p;get gid(){return this.#p}#a;get rdev(){return this.#a}#_;get blksize(){return this.#_}#c;get ino(){return this.#c}#l;get size(){return this.#l}#i;get blocks(){return this.#i}#f;get atimeMs(){return this.#f}#v;get mtimeMs(){return this.#v}#d;get ctimeMs(){return this.#d}#u;get birthtimeMs(){return this.#u}#m;get atime(){return this.#m}#g;get mtime(){return this.#g}#x;get ctime(){return this.#x}#C;get birthtime(){return this.#C}#b;#A;#E;#y;#D;#k;#o;#N;#S;#T;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(s,c=mC,f,d,v,E,A){this.name=s,this.#b=v?tfe(s):EQ(s),this.#o=c&har,this.nocase=v,this.roots=d,this.root=f||this,this.#N=E,this.#E=A.fullpath,this.#D=A.relative,this.#k=A.relativePosix,this.parent=A.parent,this.parent?this.#r=this.parent.#r:this.#r=lft(A.fs)}depth(){return this.#A!==void 0?this.#A:this.parent?this.#A=this.parent.depth()+1:this.#A=0}childrenCache(){return this.#N}resolve(s){if(!s)return this;let c=this.getRootString(s),d=s.substring(c.length).split(this.splitSep);return c?this.getRoot(c).#I(d):this.#I(d)}#I(s){let c=this;for(let f of s)c=c.child(f);return c}children(){let s=this.#N.get(this);if(s)return s;let c=Object.assign([],{provisional:0});return this.#N.set(this,c),this.#o&=~pNe,c}child(s,c){if(s===""||s===".")return this;if(s==="..")return this.parent||this;let f=this.children(),d=this.nocase?tfe(s):EQ(s);for(let O of f)if(O.#b===d)return O;let v=this.parent?this.sep:"",E=this.#E?this.#E+v+s:void 0,A=this.newChild(s,mC,{...c,parent:this,fullpath:E});return this.canReaddir()||(A.#o|=Ex),f.push(A),A}relative(){if(this.isCWD)return"";if(this.#D!==void 0)return this.#D;let s=this.name,c=this.parent;if(!c)return this.#D=this.name;let f=c.relative();return f+(!f||!c.parent?"":this.sep)+s}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#k!==void 0)return this.#k;let s=this.name,c=this.parent;if(!c)return this.#k=this.fullpathPosix();let f=c.relativePosix();return f+(!f||!c.parent?"":"/")+s}fullpath(){if(this.#E!==void 0)return this.#E;let s=this.name,c=this.parent;if(!c)return this.#E=this.name;let d=c.fullpath()+(c.parent?this.sep:"")+s;return this.#E=d}fullpathPosix(){if(this.#y!==void 0)return this.#y;if(this.sep==="/")return this.#y=this.fullpath();if(!this.parent){let d=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(d)?this.#y=`//?/${d}`:this.#y=d}let s=this.parent,c=s.fullpathPosix(),f=c+(!c||!s.parent?"":"/")+this.name;return this.#y=f}isUnknown(){return(this.#o&dC)===mC}isType(s){return this[`is${s}`]()}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(this.#o&dC)===dft}isDirectory(){return(this.#o&dC)===ZA}isCharacterDevice(){return(this.#o&dC)===_ft}isBlockDevice(){return(this.#o&dC)===pft}isFIFO(){return(this.#o&dC)===fft}isSocket(){return(this.#o&dC)===mft}isSymbolicLink(){return(this.#o&VF)===VF}lstatCached(){return this.#o&sft?this:void 0}readlinkCached(){return this.#S}realpathCached(){return this.#T}readdirCached(){let s=this.children();return s.slice(0,s.provisional)}canReadlink(){if(this.#S)return!0;if(!this.parent)return!1;let s=this.#o&dC;return!(s!==mC&&s!==VF||this.#o&efe||this.#o&Ex)}calledReaddir(){return!!(this.#o&pNe)}isENOENT(){return!!(this.#o&Ex)}isNamed(s){return this.nocase?this.#b===tfe(s):this.#b===EQ(s)}async readlink(){let s=this.#S;if(s)return s;if(this.canReadlink()&&this.parent)try{let c=await this.#r.promises.readlink(this.fullpath()),f=(await this.parent.realpath())?.resolve(c);if(f)return this.#S=f}catch(c){this.#h(c.code);return}}readlinkSync(){let s=this.#S;if(s)return s;if(this.canReadlink()&&this.parent)try{let c=this.#r.readlinkSync(this.fullpath()),f=this.parent.realpathSync()?.resolve(c);if(f)return this.#S=f}catch(c){this.#h(c.code);return}}#F(s){this.#o|=pNe;for(let c=s.provisional;c<s.length;c++){let f=s[c];f&&f.#L()}}#L(){this.#o&Ex||(this.#o=(this.#o|Ex)&SQ,this.#w())}#w(){let s=this.children();s.provisional=0;for(let c of s)c.#L()}#P(){this.#o|=rfe,this.#R()}#R(){if(this.#o&CQ)return;let s=this.#o;(s&dC)===ZA&&(s&=SQ),this.#o=s|CQ,this.#w()}#M(s=""){s==="ENOTDIR"||s==="EPERM"?this.#R():s==="ENOENT"?this.#L():this.children().provisional=0}#j(s=""){s==="ENOTDIR"?this.parent.#R():s==="ENOENT"&&this.#L()}#h(s=""){let c=this.#o;c|=efe,s==="ENOENT"&&(c|=Ex),(s==="EINVAL"||s==="UNKNOWN")&&(c&=SQ),this.#o=c,s==="ENOTDIR"&&this.parent&&this.parent.#R()}#B(s,c){return this.#O(s,c)||this.#U(s,c)}#U(s,c){let f=dNe(s),d=this.newChild(s.name,f,{parent:this}),v=d.#o&dC;return v!==ZA&&v!==VF&&v!==mC&&(d.#o|=CQ),c.unshift(d),c.provisional++,d}#O(s,c){for(let f=c.provisional;f<c.length;f++){let d=c[f];if((this.nocase?tfe(s.name):EQ(s.name))===d.#b)return this.#$(s,d,f,c)}}#$(s,c,f,d){let v=c.name;return c.#o=c.#o&SQ|dNe(s),v!==s.name&&(c.name=s.name),f!==d.provisional&&(f===d.length-1?d.pop():d.splice(f,1),d.unshift(c)),d.provisional++,c}async lstat(){if(!(this.#o&Ex))try{return this.#V(await this.#r.promises.lstat(this.fullpath())),this}catch(s){this.#j(s.code)}}lstatSync(){if(!(this.#o&Ex))try{return this.#V(this.#r.lstatSync(this.fullpath())),this}catch(s){this.#j(s.code)}}#V(s){let{atime:c,atimeMs:f,birthtime:d,birthtimeMs:v,blksize:E,blocks:A,ctime:O,ctimeMs:M,dev:W,gid:$,ino:K,mode:Ne,mtime:De,mtimeMs:Se,nlink:Tt,rdev:xt,size:vr,uid:Tr}=s;this.#m=c,this.#f=f,this.#C=d,this.#u=v,this.#_=E,this.#i=A,this.#x=O,this.#d=M,this.#n=W,this.#p=$,this.#c=K,this.#e=Ne,this.#g=De,this.#v=Se,this.#t=Tt,this.#a=xt,this.#l=vr,this.#s=Tr;let Nr=dNe(s);this.#o=this.#o&SQ|Nr|sft,Nr!==mC&&Nr!==ZA&&Nr!==VF&&(this.#o|=CQ)}#z=[];#q=!1;#W(s){this.#q=!1;let c=this.#z.slice();this.#z.length=0,c.forEach(f=>f(null,s))}readdirCB(s,c=!1){if(!this.canReaddir()){c?s(null,[]):queueMicrotask(()=>s(null,[]));return}let f=this.children();if(this.calledReaddir()){let v=f.slice(0,f.provisional);c?s(null,v):queueMicrotask(()=>s(null,v));return}if(this.#z.push(s),this.#q)return;this.#q=!0;let d=this.fullpath();this.#r.readdir(d,{withFileTypes:!0},(v,E)=>{if(v)this.#M(v.code),f.provisional=0;else{for(let A of E)this.#B(A,f);this.#F(f)}this.#W(f.slice(0,f.provisional))})}#J;async readdir(){if(!this.canReaddir())return[];let s=this.children();if(this.calledReaddir())return s.slice(0,s.provisional);let c=this.fullpath();if(this.#J)await this.#J;else{let f=t(()=>{},"resolve");this.#J=new Promise(d=>f=d);try{for(let d of await this.#r.promises.readdir(c,{withFileTypes:!0}))this.#B(d,s);this.#F(s)}catch(d){this.#M(d.code),s.provisional=0}this.#J=void 0,f()}return s.slice(0,s.provisional)}readdirSync(){if(!this.canReaddir())return[];let s=this.children();if(this.calledReaddir())return s.slice(0,s.provisional);let c=this.fullpath();try{for(let f of this.#r.readdirSync(c,{withFileTypes:!0}))this.#B(f,s);this.#F(s)}catch(f){this.#M(f.code),s.provisional=0}return s.slice(0,s.provisional)}canReaddir(){if(this.#o&aft)return!1;let s=dC&this.#o;return s===mC||s===ZA||s===VF}shouldWalk(s,c){return(this.#o&ZA)===ZA&&!(this.#o&aft)&&!s.has(this)&&(!c||c(this))}async realpath(){if(this.#T)return this.#T;if(!((rfe|efe|Ex)&this.#o))try{let s=await this.#r.promises.realpath(this.fullpath());return this.#T=this.resolve(s)}catch{this.#P()}}realpathSync(){if(this.#T)return this.#T;if(!((rfe|efe|Ex)&this.#o))try{let s=this.#r.realpathSync(this.fullpath());return this.#T=this.resolve(s)}catch{this.#P()}}[hft](s){if(s===this)return;s.isCWD=!1,this.isCWD=!0;let c=new Set([]),f=[],d=this;for(;d&&d.parent;)c.add(d),d.#D=f.join(this.sep),d.#k=f.join("/"),d=d.parent,f.push("..");for(d=s;d&&d.parent&&!c.has(d);)d.#D=void 0,d.#k=void 0,d=d.parent}},ife=class a extends n1{static{t(this,"PathWin32")}sep="\\";splitSep=mar;constructor(s,c=mC,f,d,v,E,A){super(s,c,f,d,v,E,A)}newChild(s,c=mC,f={}){return new a(s,c,this.root,this.roots,this.nocase,this.childrenCache(),f)}getRootString(s){return mNe.parse(s).root}getRoot(s){if(s=dar(s.toUpperCase()),s===this.root.name)return this.root;for(let[c,f]of Object.entries(this.roots))if(this.sameRoot(s,c))return this.roots[s]=f;return this.roots[s]=new eB(s,this).root}sameRoot(s,c=this.root.name){return s=s.toUpperCase().replace(/\//g,"\\").replace(uft,"$1\\"),s===c}},sfe=class a extends n1{static{t(this,"PathPosix")}splitSep="/";sep="/";constructor(s,c=mC,f,d,v,E,A){super(s,c,f,d,v,E,A)}getRootString(s){return s.startsWith("/")?"/":""}getRoot(s){return this.root}newChild(s,c=mC,f={}){return new a(s,c,this.root,this.roots,this.nocase,this.childrenCache(),f)}},afe=class{static{t(this,"PathScurryBase")}root;rootPath;roots;cwd;#r;#n;#e;nocase;#t;constructor(s=process.cwd(),c,f,{nocase:d,childrenCacheSize:v=16*1024,fs:E=TQ}={}){this.#t=lft(E),(s instanceof URL||s.startsWith("file://"))&&(s=rar(s));let A=c.resolve(s);this.roots=Object.create(null),this.rootPath=this.parseRootPath(A),this.#r=new nfe,this.#n=new nfe,this.#e=new hNe(v);let O=A.substring(this.rootPath.length).split(f);if(O.length===1&&!O[0]&&O.pop(),d===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=d,this.root=this.newRoot(this.#t),this.roots[this.rootPath]=this.root;let M=this.root,W=O.length-1,$=c.sep,K=this.rootPath,Ne=!1;for(let De of O){let Se=W--;M=M.child(De,{relative:new Array(Se).fill("..").join($),relativePosix:new Array(Se).fill("..").join("/"),fullpath:K+=(Ne?"":$)+De}),Ne=!0}this.cwd=M}depth(s=this.cwd){return typeof s=="string"&&(s=this.cwd.resolve(s)),s.depth()}childrenCache(){return this.#e}resolve(...s){let c="";for(let v=s.length-1;v>=0;v--){let E=s[v];if(!(!E||E===".")&&(c=c?`${E}/${c}`:E,this.isAbsolute(E)))break}let f=this.#r.get(c);if(f!==void 0)return f;let d=this.cwd.resolve(c).fullpath();return this.#r.set(c,d),d}resolvePosix(...s){let c="";for(let v=s.length-1;v>=0;v--){let E=s[v];if(!(!E||E===".")&&(c=c?`${E}/${c}`:E,this.isAbsolute(E)))break}let f=this.#n.get(c);if(f!==void 0)return f;let d=this.cwd.resolve(c).fullpathPosix();return this.#n.set(c,d),d}relative(s=this.cwd){return typeof s=="string"&&(s=this.cwd.resolve(s)),s.relative()}relativePosix(s=this.cwd){return typeof s=="string"&&(s=this.cwd.resolve(s)),s.relativePosix()}basename(s=this.cwd){return typeof s=="string"&&(s=this.cwd.resolve(s)),s.name}dirname(s=this.cwd){return typeof s=="string"&&(s=this.cwd.resolve(s)),(s.parent||s).fullpath()}async readdir(s=this.cwd,c={withFileTypes:!0}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof n1||(c=s,s=this.cwd);let{withFileTypes:f}=c;if(s.canReaddir()){let d=await s.readdir();return f?d:d.map(v=>v.name)}else return[]}readdirSync(s=this.cwd,c={withFileTypes:!0}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof n1||(c=s,s=this.cwd);let{withFileTypes:f=!0}=c;return s.canReaddir()?f?s.readdirSync():s.readdirSync().map(d=>d.name):[]}async lstat(s=this.cwd){return typeof s=="string"&&(s=this.cwd.resolve(s)),s.lstat()}lstatSync(s=this.cwd){return typeof s=="string"&&(s=this.cwd.resolve(s)),s.lstatSync()}async readlink(s=this.cwd,{withFileTypes:c}={withFileTypes:!1}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof n1||(c=s.withFileTypes,s=this.cwd);let f=await s.readlink();return c?f:f?.fullpath()}readlinkSync(s=this.cwd,{withFileTypes:c}={withFileTypes:!1}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof n1||(c=s.withFileTypes,s=this.cwd);let f=s.readlinkSync();return c?f:f?.fullpath()}async realpath(s=this.cwd,{withFileTypes:c}={withFileTypes:!1}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof n1||(c=s.withFileTypes,s=this.cwd);let f=await s.realpath();return c?f:f?.fullpath()}realpathSync(s=this.cwd,{withFileTypes:c}={withFileTypes:!1}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof n1||(c=s.withFileTypes,s=this.cwd);let f=s.realpathSync();return c?f:f?.fullpath()}async walk(s=this.cwd,c={}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof n1||(c=s,s=this.cwd);let{withFileTypes:f=!0,follow:d=!1,filter:v,walkFilter:E}=c,A=[];(!v||v(s))&&A.push(f?s:s.fullpath());let O=new Set,M=t(($,K)=>{O.add($),$.readdirCB((Ne,De)=>{if(Ne)return K(Ne);let Se=De.length;if(!Se)return K();let Tt=t(()=>{--Se===0&&K()},"next");for(let xt of De)(!v||v(xt))&&A.push(f?xt:xt.fullpath()),d&&xt.isSymbolicLink()?xt.realpath().then(vr=>vr?.isUnknown()?vr.lstat():vr).then(vr=>vr?.shouldWalk(O,E)?M(vr,Tt):Tt()):xt.shouldWalk(O,E)?M(xt,Tt):Tt()},!0)},"walk"),W=s;return new Promise(($,K)=>{M(W,Ne=>{if(Ne)return K(Ne);$(A)})})}walkSync(s=this.cwd,c={}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof n1||(c=s,s=this.cwd);let{withFileTypes:f=!0,follow:d=!1,filter:v,walkFilter:E}=c,A=[];(!v||v(s))&&A.push(f?s:s.fullpath());let O=new Set([s]);for(let M of O){let W=M.readdirSync();for(let $ of W){(!v||v($))&&A.push(f?$:$.fullpath());let K=$;if($.isSymbolicLink()){if(!(d&&(K=$.realpathSync())))continue;K.isUnknown()&&K.lstatSync()}K.shouldWalk(O,E)&&O.add(K)}}return A}[Symbol.asyncIterator](){return this.iterate()}iterate(s=this.cwd,c={}){return typeof s=="string"?s=this.cwd.resolve(s):s instanceof n1||(c=s,s=this.cwd),this.stream(s,c)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(s=this.cwd,c={}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof n1||(c=s,s=this.cwd);let{withFileTypes:f=!0,follow:d=!1,filter:v,walkFilter:E}=c;(!v||v(s))&&(yield f?s:s.fullpath());let A=new Set([s]);for(let O of A){let M=O.readdirSync();for(let W of M){(!v||v(W))&&(yield f?W:W.fullpath());let $=W;if(W.isSymbolicLink()){if(!(d&&($=W.realpathSync())))continue;$.isUnknown()&&$.lstatSync()}$.shouldWalk(A,E)&&A.add($)}}}stream(s=this.cwd,c={}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof n1||(c=s,s=this.cwd);let{withFileTypes:f=!0,follow:d=!1,filter:v,walkFilter:E}=c,A=new vN({objectMode:!0});(!v||v(s))&&A.write(f?s:s.fullpath());let O=new Set,M=[s],W=0,$=t(()=>{let K=!1;for(;!K;){let Ne=M.shift();if(!Ne){W===0&&A.end();return}W++,O.add(Ne);let De=t((Tt,xt,vr=!1)=>{if(Tt)return A.emit("error",Tt);if(d&&!vr){let Tr=[];for(let Nr of xt)Nr.isSymbolicLink()&&Tr.push(Nr.realpath().then(Cr=>Cr?.isUnknown()?Cr.lstat():Cr));if(Tr.length){Promise.all(Tr).then(()=>De(null,xt,!0));return}}for(let Tr of xt)Tr&&(!v||v(Tr))&&(A.write(f?Tr:Tr.fullpath())||(K=!0));W--;for(let Tr of xt){let Nr=Tr.realpathCached()||Tr;Nr.shouldWalk(O,E)&&M.push(Nr)}K&&!A.flowing?A.once("drain",$):Se||$()},"onReaddir"),Se=!0;Ne.readdirCB(De,!0),Se=!1}},"process");return $(),A}streamSync(s=this.cwd,c={}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof n1||(c=s,s=this.cwd);let{withFileTypes:f=!0,follow:d=!1,filter:v,walkFilter:E}=c,A=new vN({objectMode:!0}),O=new Set;(!v||v(s))&&A.write(f?s:s.fullpath());let M=[s],W=0,$=t(()=>{let K=!1;for(;!K;){let Ne=M.shift();if(!Ne){W===0&&A.end();return}W++,O.add(Ne);let De=Ne.readdirSync();for(let Se of De)(!v||v(Se))&&(A.write(f?Se:Se.fullpath())||(K=!0));W--;for(let Se of De){let Tt=Se;if(Se.isSymbolicLink()){if(!(d&&(Tt=Se.realpathSync())))continue;Tt.isUnknown()&&Tt.lstatSync()}Tt.shouldWalk(O,E)&&M.push(Tt)}}K&&!A.flowing&&A.once("drain",$)},"process");return $(),A}chdir(s=this.cwd){let c=this.cwd;this.cwd=typeof s=="string"?this.cwd.resolve(s):s,this.cwd[hft](c)}},eB=class extends afe{static{t(this,"PathScurryWin32")}sep="\\";constructor(s=process.cwd(),c={}){let{nocase:f=!0}=c;super(s,mNe,"\\",{...c,nocase:f}),this.nocase=f;for(let d=this.cwd;d;d=d.parent)d.nocase=this.nocase}parseRootPath(s){return mNe.parse(s).root.toUpperCase()}newRoot(s){return new ife(this.rootPath,ZA,void 0,this.roots,this.nocase,this.childrenCache(),{fs:s})}isAbsolute(s){return s.startsWith("/")||s.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(s)}},tB=class extends afe{static{t(this,"PathScurryPosix")}sep="/";constructor(s=process.cwd(),c={}){let{nocase:f=!1}=c;super(s,tar,"/",{...c,nocase:f}),this.nocase=f}parseRootPath(s){return"/"}newRoot(s){return new sfe(this.rootPath,ZA,void 0,this.roots,this.nocase,this.childrenCache(),{fs:s})}isAbsolute(s){return s.startsWith("/")}},xQ=class extends tB{static{t(this,"PathScurryDarwin")}constructor(s=process.cwd(),c={}){let{nocase:f=!0}=c;super(s,{...c,nocase:f})}},uRr=process.platform==="win32"?ife:sfe,gft=process.platform==="win32"?eB:process.platform==="darwin"?xQ:tB;var gar=t(a=>a.length>=1,"isPatternList"),yar=t(a=>a.length>=1,"isGlobList"),rB=class a{static{t(this,"Pattern")}#r;#n;#e;length;#t;#s;#p;#a;#_;#c;#l=!0;constructor(s,c,f,d){if(!gar(s))throw new TypeError("empty pattern list");if(!yar(c))throw new TypeError("empty glob list");if(c.length!==s.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=s.length,f<0||f>=this.length)throw new TypeError("index out of range");if(this.#r=s,this.#n=c,this.#e=f,this.#t=d,this.#e===0){if(this.isUNC()){let[v,E,A,O,...M]=this.#r,[W,$,K,Ne,...De]=this.#n;M[0]===""&&(M.shift(),De.shift());let Se=[v,E,A,O,""].join("/"),Tt=[W,$,K,Ne,""].join("/");this.#r=[Se,...M],this.#n=[Tt,...De],this.length=this.#r.length}else if(this.isDrive()||this.isAbsolute()){let[v,...E]=this.#r,[A,...O]=this.#n;E[0]===""&&(E.shift(),O.shift());let M=v+"/",W=A+"/";this.#r=[M,...E],this.#n=[W,...O],this.length=this.#r.length}}}pattern(){return this.#r[this.#e]}isString(){return typeof this.#r[this.#e]=="string"}isGlobstar(){return this.#r[this.#e]===ry}isRegExp(){return this.#r[this.#e]instanceof RegExp}globString(){return this.#p=this.#p||(this.#e===0?this.isAbsolute()?this.#n[0]+this.#n.slice(1).join("/"):this.#n.join("/"):this.#n.slice(this.#e).join("/"))}hasMore(){return this.length>this.#e+1}rest(){return this.#s!==void 0?this.#s:this.hasMore()?(this.#s=new a(this.#r,this.#n,this.#e+1,this.#t),this.#s.#c=this.#c,this.#s.#_=this.#_,this.#s.#a=this.#a,this.#s):this.#s=null}isUNC(){let s=this.#r;return this.#_!==void 0?this.#_:this.#_=this.#t==="win32"&&this.#e===0&&s[0]===""&&s[1]===""&&typeof s[2]=="string"&&!!s[2]&&typeof s[3]=="string"&&!!s[3]}isDrive(){let s=this.#r;return this.#a!==void 0?this.#a:this.#a=this.#t==="win32"&&this.#e===0&&this.length>1&&typeof s[0]=="string"&&/^[a-z]:$/i.test(s[0])}isAbsolute(){let s=this.#r;return this.#c!==void 0?this.#c:this.#c=s[0]===""&&s.length>1||this.isDrive()||this.isUNC()}root(){let s=this.#r[0];return typeof s=="string"&&this.isAbsolute()&&this.#e===0?s:""}checkFollowGlobstar(){return!(this.#e===0||!this.isGlobstar()||!this.#l)}markFollowGlobstar(){return this.#e===0||!this.isGlobstar()||!this.#l?!1:(this.#l=!1,!0)}};var bar=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",nB=class{static{t(this,"Ignore")}relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(s,{nobrace:c,nocase:f,noext:d,noglobstar:v,platform:E=bar}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=E,this.mmopts={dot:!0,nobrace:c,nocase:f,noext:d,noglobstar:v,optimizationLevel:2,platform:E,nocomment:!0,nonegate:!0};for(let A of s)this.add(A)}add(s){let c=new AS(s,this.mmopts);for(let f=0;f<c.set.length;f++){let d=c.set[f],v=c.globParts[f];if(!d||!v)throw new Error("invalid pattern object");for(;d[0]==="."&&v[0]===".";)d.shift(),v.shift();let E=new rB(d,v,0,this.platform),A=new AS(E.globString(),this.mmopts),O=v[v.length-1]==="**",M=E.isAbsolute();M?this.absolute.push(A):this.relative.push(A),O&&(M?this.absoluteChildren.push(A):this.relativeChildren.push(A))}}ignored(s){let c=s.fullpath(),f=`${c}/`,d=s.relative()||".",v=`${d}/`;for(let E of this.relative)if(E.match(d)||E.match(v))return!0;for(let E of this.absolute)if(E.match(c)||E.match(f))return!0;return!1}childrenIgnored(s){let c=s.fullpath()+"/",f=(s.relative()||".")+"/";for(let d of this.relativeChildren)if(d.match(f))return!0;for(let d of this.absoluteChildren)if(d.match(c))return!0;return!1}};var gNe=class a{static{t(this,"HasWalkedCache")}store;constructor(s=new Map){this.store=s}copy(){return new a(new Map(this.store))}hasWalked(s,c){return this.store.get(s.fullpath())?.has(c.globString())}storeWalked(s,c){let f=s.fullpath(),d=this.store.get(f);d?d.add(c.globString()):this.store.set(f,new Set([c.globString()]))}},yNe=class{static{t(this,"MatchRecord")}store=new Map;add(s,c,f){let d=(c?2:0)|(f?1:0),v=this.store.get(s);this.store.set(s,v===void 0?d:d&v)}entries(){return[...this.store.entries()].map(([s,c])=>[s,!!(c&2),!!(c&1)])}},vNe=class{static{t(this,"SubWalks")}store=new Map;add(s,c){if(!s.canReaddir())return;let f=this.store.get(s);f?f.find(d=>d.globString()===c.globString())||f.push(c):this.store.set(s,[c])}get(s){let c=this.store.get(s);if(!c)throw new Error("attempting to walk unknown path");return c}entries(){return this.keys().map(s=>[s,this.store.get(s)])}keys(){return[...this.store.keys()].filter(s=>s.canReaddir())}},DQ=class a{static{t(this,"Processor")}hasWalkedCache;matches=new yNe;subwalks=new vNe;patterns;follow;dot;opts;constructor(s,c){this.opts=s,this.follow=!!s.follow,this.dot=!!s.dot,this.hasWalkedCache=c?c.copy():new gNe}processPatterns(s,c){this.patterns=c;let f=c.map(d=>[s,d]);for(let[d,v]of f){this.hasWalkedCache.storeWalked(d,v);let E=v.root(),A=v.isAbsolute()&&this.opts.absolute!==!1;if(E){d=d.resolve(E==="/"&&this.opts.root!==void 0?this.opts.root:E);let $=v.rest();if($)v=$;else{this.matches.add(d,!0,!1);continue}}if(d.isENOENT())continue;let O,M,W=!1;for(;typeof(O=v.pattern())=="string"&&(M=v.rest());)d=d.resolve(O),v=M,W=!0;if(O=v.pattern(),M=v.rest(),W){if(this.hasWalkedCache.hasWalked(d,v))continue;this.hasWalkedCache.storeWalked(d,v)}if(typeof O=="string"){let $=O===".."||O===""||O===".";this.matches.add(d.resolve(O),A,$);continue}else if(O===ry){(!d.isSymbolicLink()||this.follow||v.checkFollowGlobstar())&&this.subwalks.add(d,v);let $=M?.pattern(),K=M?.rest();if(!M||($===""||$===".")&&!K)this.matches.add(d,A,$===""||$===".");else if($===".."){let Ne=d.parent||d;K?this.hasWalkedCache.hasWalked(Ne,K)||this.subwalks.add(Ne,K):this.matches.add(Ne,A,!0)}}else O instanceof RegExp&&this.subwalks.add(d,v)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new a(this.opts,this.hasWalkedCache)}filterEntries(s,c){let f=this.subwalks.get(s),d=this.child();for(let v of c)for(let E of f){let A=E.isAbsolute(),O=E.pattern(),M=E.rest();O===ry?d.testGlobstar(v,E,M,A):O instanceof RegExp?d.testRegExp(v,O,M,A):d.testString(v,O,M,A)}return d}testGlobstar(s,c,f,d){if((this.dot||!s.name.startsWith("."))&&(c.hasMore()||this.matches.add(s,d,!1),s.canReaddir()&&(this.follow||!s.isSymbolicLink()?this.subwalks.add(s,c):s.isSymbolicLink()&&(f&&c.checkFollowGlobstar()?this.subwalks.add(s,f):c.markFollowGlobstar()&&this.subwalks.add(s,c)))),f){let v=f.pattern();if(typeof v=="string"&&v!==".."&&v!==""&&v!==".")this.testString(s,v,f.rest(),d);else if(v===".."){let E=s.parent||s;this.subwalks.add(E,f)}else v instanceof RegExp&&this.testRegExp(s,v,f.rest(),d)}}testRegExp(s,c,f,d){c.test(s.name)&&(f?this.subwalks.add(s,f):this.matches.add(s,d,!1))}testString(s,c,f,d){s.isNamed(c)&&(f?this.subwalks.add(s,f):this.matches.add(s,d,!1))}};var Sar=t((a,s)=>typeof a=="string"?new nB([a],s):Array.isArray(a)?new nB(a,s):a,"makeIgnore"),ofe=class{static{t(this,"GlobUtil")}path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#r=[];#n;#e;signal;maxDepth;includeChildMatches;constructor(s,c,f){if(this.patterns=s,this.path=c,this.opts=f,this.#e=!f.posix&&f.platform==="win32"?"\\":"/",this.includeChildMatches=f.includeChildMatches!==!1,(f.ignore||!this.includeChildMatches)&&(this.#n=Sar(f.ignore??[],f),!this.includeChildMatches&&typeof this.#n.add!="function")){let d="cannot ignore child matches, ignore lacks add() method.";throw new Error(d)}this.maxDepth=f.maxDepth||1/0,f.signal&&(this.signal=f.signal,this.signal.addEventListener("abort",()=>{this.#r.length=0}))}#t(s){return this.seen.has(s)||!!this.#n?.ignored?.(s)}#s(s){return!!this.#n?.childrenIgnored?.(s)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let s;for(;!this.paused&&(s=this.#r.shift());)s()}onResume(s){this.signal?.aborted||(this.paused?this.#r.push(s):s())}async matchCheck(s,c){if(c&&this.opts.nodir)return;let f;if(this.opts.realpath){if(f=s.realpathCached()||await s.realpath(),!f)return;s=f}let v=s.isUnknown()||this.opts.stat?await s.lstat():s;if(this.opts.follow&&this.opts.nodir&&v?.isSymbolicLink()){let E=await v.realpath();E&&(E.isUnknown()||this.opts.stat)&&await E.lstat()}return this.matchCheckTest(v,c)}matchCheckTest(s,c){return s&&(this.maxDepth===1/0||s.depth()<=this.maxDepth)&&(!c||s.canReaddir())&&(!this.opts.nodir||!s.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!s.isSymbolicLink()||!s.realpathCached()?.isDirectory())&&!this.#t(s)?s:void 0}matchCheckSync(s,c){if(c&&this.opts.nodir)return;let f;if(this.opts.realpath){if(f=s.realpathCached()||s.realpathSync(),!f)return;s=f}let v=s.isUnknown()||this.opts.stat?s.lstatSync():s;if(this.opts.follow&&this.opts.nodir&&v?.isSymbolicLink()){let E=v.realpathSync();E&&(E?.isUnknown()||this.opts.stat)&&E.lstatSync()}return this.matchCheckTest(v,c)}matchFinish(s,c){if(this.#t(s))return;if(!this.includeChildMatches&&this.#n?.add){let v=`${s.relativePosix()}/**`;this.#n.add(v)}let f=this.opts.absolute===void 0?c:this.opts.absolute;this.seen.add(s);let d=this.opts.mark&&s.isDirectory()?this.#e:"";if(this.opts.withFileTypes)this.matchEmit(s);else if(f){let v=this.opts.posix?s.fullpathPosix():s.fullpath();this.matchEmit(v+d)}else{let v=this.opts.posix?s.relativePosix():s.relative(),E=this.opts.dotRelative&&!v.startsWith(".."+this.#e)?"."+this.#e:"";this.matchEmit(v?E+v+d:"."+d)}}async match(s,c,f){let d=await this.matchCheck(s,f);d&&this.matchFinish(d,c)}matchSync(s,c,f){let d=this.matchCheckSync(s,f);d&&this.matchFinish(d,c)}walkCB(s,c,f){this.signal?.aborted&&f(),this.walkCB2(s,c,new DQ(this.opts),f)}walkCB2(s,c,f,d){if(this.#s(s))return d();if(this.signal?.aborted&&d(),this.paused){this.onResume(()=>this.walkCB2(s,c,f,d));return}f.processPatterns(s,c);let v=1,E=t(()=>{--v===0&&d()},"next");for(let[A,O,M]of f.matches.entries())this.#t(A)||(v++,this.match(A,O,M).then(()=>E()));for(let A of f.subwalkTargets()){if(this.maxDepth!==1/0&&A.depth()>=this.maxDepth)continue;v++;let O=A.readdirCached();A.calledReaddir()?this.walkCB3(A,O,f,E):A.readdirCB((M,W)=>this.walkCB3(A,W,f,E),!0)}E()}walkCB3(s,c,f,d){f=f.filterEntries(s,c);let v=1,E=t(()=>{--v===0&&d()},"next");for(let[A,O,M]of f.matches.entries())this.#t(A)||(v++,this.match(A,O,M).then(()=>E()));for(let[A,O]of f.subwalks.entries())v++,this.walkCB2(A,O,f.child(),E);E()}walkCBSync(s,c,f){this.signal?.aborted&&f(),this.walkCB2Sync(s,c,new DQ(this.opts),f)}walkCB2Sync(s,c,f,d){if(this.#s(s))return d();if(this.signal?.aborted&&d(),this.paused){this.onResume(()=>this.walkCB2Sync(s,c,f,d));return}f.processPatterns(s,c);let v=1,E=t(()=>{--v===0&&d()},"next");for(let[A,O,M]of f.matches.entries())this.#t(A)||this.matchSync(A,O,M);for(let A of f.subwalkTargets()){if(this.maxDepth!==1/0&&A.depth()>=this.maxDepth)continue;v++;let O=A.readdirSync();this.walkCB3Sync(A,O,f,E)}E()}walkCB3Sync(s,c,f,d){f=f.filterEntries(s,c);let v=1,E=t(()=>{--v===0&&d()},"next");for(let[A,O,M]of f.matches.entries())this.#t(A)||this.matchSync(A,O,M);for(let[A,O]of f.subwalks.entries())v++,this.walkCB2Sync(A,O,f.child(),E);E()}},AQ=class extends ofe{static{t(this,"GlobWalker")}matches=new Set;constructor(s,c,f){super(s,c,f)}matchEmit(s){this.matches.add(s)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((s,c)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?c(this.signal.reason):s(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}},kQ=class extends ofe{static{t(this,"GlobStream")}results;constructor(s,c,f){super(s,c,f),this.results=new vN({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(s){this.results.write(s),this.results.flowing||this.pause()}stream(){let s=this.path;return s.isUnknown()?s.lstat().then(()=>{this.walkCB(s,this.patterns,()=>this.results.end())}):this.walkCB(s,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}};var Car=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",xx=class{static{t(this,"Glob")}absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(s,c){if(!c)throw new TypeError("glob options required");if(this.withFileTypes=!!c.withFileTypes,this.signal=c.signal,this.follow=!!c.follow,this.dot=!!c.dot,this.dotRelative=!!c.dotRelative,this.nodir=!!c.nodir,this.mark=!!c.mark,c.cwd?(c.cwd instanceof URL||c.cwd.startsWith("file://"))&&(c.cwd=Tar(c.cwd)):this.cwd="",this.cwd=c.cwd||"",this.root=c.root,this.magicalBraces=!!c.magicalBraces,this.nobrace=!!c.nobrace,this.noext=!!c.noext,this.realpath=!!c.realpath,this.absolute=c.absolute,this.includeChildMatches=c.includeChildMatches!==!1,this.noglobstar=!!c.noglobstar,this.matchBase=!!c.matchBase,this.maxDepth=typeof c.maxDepth=="number"?c.maxDepth:1/0,this.stat=!!c.stat,this.ignore=c.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof s=="string"&&(s=[s]),this.windowsPathsNoEscape=!!c.windowsPathsNoEscape||c.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(s=s.map(O=>O.replace(/\\/g,"/"))),this.matchBase){if(c.noglobstar)throw new TypeError("base matching requires globstar");s=s.map(O=>O.includes("/")?O:`./**/${O}`)}if(this.pattern=s,this.platform=c.platform||Car,this.opts={...c,platform:this.platform},c.scurry){if(this.scurry=c.scurry,c.nocase!==void 0&&c.nocase!==c.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let O=c.platform==="win32"?eB:c.platform==="darwin"?xQ:c.platform?tB:gft;this.scurry=new O(this.cwd,{nocase:c.nocase,fs:c.fs})}this.nocase=this.scurry.nocase;let f=this.platform==="darwin"||this.platform==="win32",d={...c,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:f,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},v=this.pattern.map(O=>new AS(O,d)),[E,A]=v.reduce((O,M)=>(O[0].push(...M.set),O[1].push(...M.globParts),O),[[],[]]);this.patterns=E.map((O,M)=>{let W=A[M];if(!W)throw new Error("invalid pattern object");return new rB(O,W,0,this.platform)})}async walk(){return[...await new AQ(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 AQ(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 kQ(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 kQ(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()}};var bNe=t((a,s={})=>{Array.isArray(a)||(a=[a]);for(let c of a)if(new AS(c,s).hasMagic())return!0;return!1},"hasMagic");function cfe(a,s={}){return new xx(a,s).streamSync()}t(cfe,"globStreamSync");function vft(a,s={}){return new xx(a,s).stream()}t(vft,"globStream");function bft(a,s={}){return new xx(a,s).walkSync()}t(bft,"globSync");async function yft(a,s={}){return new xx(a,s).walk()}t(yft,"glob_");function lfe(a,s={}){return new xx(a,s).iterateSync()}t(lfe,"globIterateSync");function Sft(a,s={}){return new xx(a,s).iterate()}t(Sft,"globIterate");var Ear=cfe,xar=Object.assign(vft,{sync:cfe}),Dar=lfe,Aar=Object.assign(Sft,{sync:lfe}),kar=Object.assign(bft,{stream:cfe,iterate:lfe}),wQ=Object.assign(yft,{glob:yft,globSync:bft,sync:kar,globStream:vft,stream:xar,globStreamSync:cfe,streamSync:Ear,globIterate:Sft,iterate:Aar,globIterateSync:lfe,iterateSync:Dar,Glob:xx,hasMagic:bNe,escape:Qj,unescape:Tx});wQ.glob=wQ;import jde from"fs";import nRe from"path";var xv=class extends Error{static{t(this,"CompilationError")}buildMessages;constructor(s){super("An error occurred during compilation."),this.buildMessages=Array.isArray(s)?s:[s]}toBuildResult(){return{content:"",errors:this.buildMessages}}};var war="[",Par="]",Nar="{",Iar="}",Oar=":",Far=",",Lar="true",Rar="false",Mar="null",jar="NaN",Bar="Infinity",TNe='"',PQ=new Map([[34,TNe],[92,"\\"],[47,"/"],[98,"\b"],[110,`
|
|
576
576
|
`],[102,"\f"],[114,"\r"],[116," "]]),_fe=new Map([...PQ,[118,"\v"],[48,"\0"]]),Uar=new Map([[TNe,TNe],["\\","\\"],["/","/"],["\b","b"],[`
|
|
577
577
|
`,"n"],["\f","f"],["\r","r"],[" ","t"]]),QRr=new Map([...Uar,["\v","v"],["\0","0"],["\u2028","u2028"],["\u2029","u2029"]]),ffe=new Map([[war,"LBracket"],[Par,"RBracket"],[Nar,"LBrace"],[Iar,"RBrace"],[Oar,"Colon"],[Far,"Comma"],[Lar,"Boolean"],[Rar,"Boolean"],[Mar,"Null"]]),ufe=new Map([...ffe,[jar,"Number"],[Bar,"Number"]]),CNe=new Set([10,13,8232,8233]),i6=class extends Error{static{t(this,"ErrorWithLocation")}constructor(s,{line:c,column:f,offset:d}){super(`${s} (${c}:${f})`),this.line=c,this.column=f,this.offset=d}},ENe=class extends i6{static{t(this,"UnexpectedChar")}constructor(s,c){super(`Unexpected character '${String.fromCharCode(s)}' found.`,c)}},xNe=class extends i6{static{t(this,"UnexpectedIdentifier")}constructor(s,c){super(`Unexpected identifier '${s}' found.`,c)}},WF=class extends i6{static{t(this,"UnexpectedToken")}constructor(s){super(`Unexpected token ${s.type} found.`,s.loc.start)}},pfe=class extends i6{static{t(this,"UnexpectedEOF")}constructor(s){super("Unexpected end of input found.",s)}},$ar=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,Jar=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,zar=13,Tft=10,DNe=class{static{t(this,"CharCodeReader")}#r="";#n=1;#e=0;#t=-1;#s=!1;#p=-1;#a=!1;constructor(s){this.#r=s}#_(){this.#a||(this.#e++,this.#t++,this.#p=-1,this.#a=!0)}locate(){return{line:this.#n,column:this.#e,offset:this.#t}}next(){if(this.#t>=this.#r.length-1)return this.#_(),-1;this.#t++;let s=this.#r.charCodeAt(this.#t);return this.#s?(this.#n++,this.#e=1,this.#s=!1):this.#e++,s===zar?(this.#s=!0,this.peek()===Tft&&this.#t++):s===Tft&&(this.#s=!0),this.#p=s,s}peek(){return this.#t===this.#r.length-1?-1:this.#r.charCodeAt(this.#t+1)}match(s){return s(this.peek())?(this.next(),!0):!1}current(){return this.#p}},qar="Infinity",Var="NaN",War=new Set([116,102,110]),ANe=new Set([32,9,10,13]),Cft=new Set([...ANe,11,12,160,8232,8233,65279,160,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288]),Har={mode:"json",ranges:!1},Gar=new Set(["true","false","null"]),H_={EOF:0,Number:1,String:2,Boolean:3,Null:4,NaN:5,Infinity:6,Identifier:7,Colon:20,LBrace:21,RBrace:22,LBracket:23,RBracket:24,Comma:25,LineComment:40,BlockComment:41};function n6(a){return a>=48&&a<=57}t(n6,"isDigit");function SNe(a){return n6(a)||a>=65&&a<=70||a>=97&&a<=102}t(SNe,"isHexDigit");function Qar(a){return a>=49&&a<=57}t(Qar,"isPositiveDigit");function Kar(a){return War.has(a)}t(Kar,"isKeywordStart");function xft(a){return n6(a)||a===46||a===45}t(xft,"isNumberStart");function Yar(a){return xft(a)||a===43}t(Yar,"isJSON5NumberStart");function Eft(a,s){return a===34||s&&a===39}t(Eft,"isStringStart");function Dft(a){if(a===36||a===95||a===92||a>=97&&a<=122||a>=65&&a<=90||a===8204||a===8205)return!0;let s=String.fromCharCode(a);return $ar.test(s)}t(Dft,"isJSON5IdentifierStart");function Xar(a){if(Dft(a)||n6(a))return!0;let s=String.fromCharCode(a);return Jar.test(s)}t(Xar,"isJSON5IdentifierPart");var kNe=class{static{t(this,"Tokenizer")}#r;#n;#e;#t;#s;#p;#a;#_;#c;#l;#i;constructor(s,c){this.#n=s,this.#r={...Har,...c},this.#e=new DNe(s),this.#t=this.#r.mode==="json5",this.#s=this.#r.mode!=="json",this.#p=this.#r.ranges,this.#_=this.#t?_fe.has.bind(_fe):PQ.has.bind(PQ),this.#c=this.#t?CNe.has.bind(CNe):()=>!1,this.#l=this.#t?f=>f===120:()=>!1,this.#i=this.#t?Cft.has.bind(Cft):ANe.has.bind(ANe)}#f(s,c=this.#e.locate()){throw new ENe(s,c)}#v(s,c=this.#e.locate()){throw new xNe(s,c)}#d(){throw new pfe(this.#e.locate())}#u(s,c,f,d){let v=f.offset+c,E=this.#r.ranges?{range:[f.offset,v]}:void 0;return{type:s,loc:{start:f,end:d||{line:f.line,column:f.column+c,offset:v}},...E}}#m(s){let c="",f;for(let d=0;d<s;d++){if(f=this.#e.peek(),SNe(f)){this.#e.next(),c+=String.fromCharCode(f);continue}this.#f(f)}return c}#g(s){let c="";do{if(c+=String.fromCharCode(s),s===92&&(s=this.#e.next(),s!==117&&this.#f(s),c+=String.fromCharCode(s),c+=this.#m(4)),s=this.#e.peek(),!Xar(s))break;this.#e.next()}while(!0);return c}#x(s){let c=s,f=1;for(s=this.#e.peek();s!==-1&&s!==c;){if(this.#e.next(),f++,s===92)if(s=this.#e.peek(),this.#_(s)||this.#c(s))this.#e.next(),f++;else if(s===117){this.#e.next(),f++;let d=this.#m(4);f+=d.length}else if(this.#l(s)){this.#e.next(),f++;let d=this.#m(2);f+=d.length}else this.#t?(this.#e.next(),f++):this.#f(s);s=this.#e.peek()}return s===-1&&(this.#e.next(),this.#d()),this.#e.next(),f++,f}#C(s){let c=1;if(s===45||this.#t&&s===43){if(s=this.#e.peek(),this.#t&&(s===73||s===78)){this.#e.next();let f=this.#g(s);return f!==qar&&f!==Var&&this.#f(s),c+f.length}n6(s)||this.#f(s),this.#e.next(),c++}if(s===48)if(s=this.#e.peek(),this.#t&&(s===120||s===88)){this.#e.next(),c++,s=this.#e.peek(),SNe(s)||(this.#e.next(),this.#f(s));do this.#e.next(),c++,s=this.#e.peek();while(SNe(s))}else n6(s)&&this.#f(s);else if(!this.#t||s!==46)for(Qar(s)||this.#f(s),s=this.#e.peek();n6(s);)this.#e.next(),c++,s=this.#e.peek();if(s===46){let f=-1;for(this.#e.next(),c++,f++,s=this.#e.peek();n6(s);)this.#e.next(),c++,f++,s=this.#e.peek();!this.#t&&f===0&&(this.#e.next(),s?this.#f(s):this.#d())}if(s===101||s===69)for(this.#e.next(),c++,s=this.#e.peek(),(s===43||s===45)&&(this.#e.next(),c++,s=this.#e.peek()),s===-1&&(this.#e.next(),this.#d()),n6(s)||(this.#e.next(),this.#f(s));n6(s);)this.#e.next(),c++,s=this.#e.peek();return c}#b(s){let c=1;if(s=this.#e.peek(),s===47){do this.#e.next(),c+=1,s=this.#e.peek();while(s>-1&&s!==13&&s!==10);return{length:c,multiline:!1}}if(s===42){for(this.#e.next(),c+=1;s>-1;)if(s=this.#e.peek(),s===42){if(this.#e.next(),c+=1,s=this.#e.peek(),s===47)return this.#e.next(),c+=1,{length:c,multiline:!0}}else this.#e.next(),c+=1;this.#e.next(),this.#d()}this.#e.next(),this.#f(s)}next(){let s=this.#e.next();for(;this.#i(s);)s=this.#e.next();if(s===-1)return H_.EOF;let c=this.#e.locate(),f=String.fromCharCode(s);if(this.#t)if(ufe.has(f))this.#a=this.#u(ufe.get(f),1,c);else if(Dft(s)){let d=this.#g(s);ufe.has(d)?this.#a=this.#u(ufe.get(d),d.length,c):this.#a=this.#u("Identifier",d.length,c)}else if(Yar(s)){let d=this.#C(s);this.#a=this.#u("Number",d,c)}else if(Eft(s,this.#t)){let d=this.#x(s),v=this.#e.locate();this.#a=this.#u("String",d,c,{line:v.line,column:v.column+1,offset:v.offset+1})}else if(s===47&&this.#s){let d=this.#b(s),v=this.#e.locate();this.#a=this.#u(d.multiline?"BlockComment":"LineComment",d.length,c,{line:v.line,column:v.column+1,offset:v.offset+1})}else this.#f(s);else if(ffe.has(f))this.#a=this.#u(ffe.get(f),1,c);else if(Kar(s)){let d=this.#g(s);Gar.has(d)||this.#v(d,c),this.#a=this.#u(ffe.get(d),d.length,c)}else if(xft(s)){let d=this.#C(s);this.#a=this.#u("Number",d,c)}else if(Eft(s,this.#t)){let d=this.#x(s);this.#a=this.#u("String",d,c)}else if(s===47&&this.#s){let d=this.#b(s),v=this.#e.locate();this.#a=this.#u(d.multiline?"BlockComment":"LineComment",d.length,c,{line:v.line,column:v.column+1,offset:v.offset+1})}else this.#f(s);return H_[this.#a.type]}get token(){return this.#a}};var hC={document(a,s={}){return{type:"Document",body:a,loc:s.loc,...s}},string(a,s={}){return{type:"String",value:a,loc:s.loc,...s}},number(a,s={}){return{type:"Number",value:a,loc:s.loc,...s}},boolean(a,s={}){return{type:"Boolean",value:a,loc:s.loc,...s}},null(a={}){return{type:"Null",loc:a.loc,...a}},array(a,s={}){return{type:"Array",elements:a,loc:s.loc,...s}},element(a,s={}){return{type:"Element",value:a,loc:s.loc,...s}},object(a,s={}){return{type:"Object",members:a,loc:s.loc,...s}},member(a,s,c={}){return{type:"Member",name:a,value:s,loc:c.loc,...c}},identifier(a,s={}){return{type:"Identifier",name:a,loc:s.loc,...s}},nan(a="",s={}){return{type:"NaN",sign:a,loc:s.loc,...s}},infinity(a="",s={}){return{type:"Infinity",sign:a,loc:s.loc,...s}}},Zar={mode:"json",ranges:!1,tokens:!1,allowTrailingCommas:!1};function eor(a,s,c=!1){let f="",d=a.indexOf("\\"),v=0;for(;d>=0;){f+=a.slice(v,d);let E=a.charAt(d+1),A=E.charCodeAt(0);if(c&&_fe.has(A))f+=_fe.get(A),v=d+2;else if(PQ.has(A))f+=PQ.get(A),v=d+2;else if(E==="u"){let O=a.slice(d+2,d+6);if(O.length<4||/[^0-9a-f]/i.test(O))throw new i6(`Invalid unicode escape \\u${O}.`,{line:s.loc.start.line,column:s.loc.start.column+d,offset:s.loc.start.offset+d});f+=String.fromCharCode(parseInt(O,16)),v=d+6}else if(c&&E==="x"){let O=a.slice(d+2,d+4);if(O.length<2||/[^0-9a-f]/i.test(O))throw new i6(`Invalid hex escape \\x${O}.`,{line:s.loc.start.line,column:s.loc.start.column+d,offset:s.loc.start.offset+d});f+=String.fromCharCode(parseInt(O,16)),v=d+4}else if(c&&CNe.has(A))v=d+2,E==="\r"&&a.charAt(v)===`
|
|
578
|
-
`&&v++;else if(c)f+=E,v=d+2;else throw new i6(`Invalid escape \\${E}.`,{line:s.loc.start.line,column:s.loc.start.column+d,offset:s.loc.start.offset+d});d=a.indexOf("\\",v)}return f+=a.slice(v),f}t(eor,"getStringValue");function tor(a,s,c=!1){switch(s.type){case"Boolean":return a==="true";case"Number":return Number(a);case"String":return eor(a.slice(1,-1),s,c);default:throw new TypeError(`Unknown token type "${s.type}.`)}}t(tor,"getLiteralValue");function Aft(a,s){s=Object.freeze({...Zar,...s});let c=[],f=new kNe(a,{mode:s.mode,ranges:s.ranges}),d=s.mode==="json5",v=s.allowTrailingCommas||d;function E(){let pr=f.next();return pr&&s.tokens&&c.push(f.token),pr}t(E,"nextNoComments");function A(){let pr=f.next();return pr&&s.tokens&&c.push(f.token),pr>=H_.LineComment?A():pr}t(A,"nextSkipComments");let O=s.mode==="json"?E:A;function M(pr,sr){if(pr!==sr)throw new WF(f.token)}t(M,"assertTokenType");function W(pr,sr){if(!sr.includes(pr))throw new WF(f.token)}t(W,"assertTokenTypes");function $(pr,sr){return s.ranges?{range:[pr.offset,sr.offset]}:void 0}t($,"createRange");function K(pr){let sr=f.token,Cs=$(sr.loc.start,sr.loc.end),Di=tor(a.slice(sr.loc.start.offset,sr.loc.end.offset),sr,d),hi={loc:{start:{...sr.loc.start},end:{...sr.loc.end}},...Cs};switch(pr){case H_.String:return hC.string(Di,hi);case H_.Number:return hC.number(Di,hi);case H_.Boolean:return hC.boolean(Di,hi);default:throw new TypeError(`Unknown token type ${sr.type}.`)}}t(K,"createLiteralNode");function Ne(pr){let sr=$(pr.loc.start,pr.loc.end),Cs=a.slice(pr.loc.start.offset,pr.loc.end.offset),_o={loc:{start:{...pr.loc.start},end:{...pr.loc.end}},...sr};if(pr.type!=="Identifier"){let hi="";return(Cs[0]==="+"||Cs[0]==="-")&&(hi=Cs[0]),hC[Cs.includes("NaN")?"nan":"infinity"](hi,_o)}return hC.identifier(Cs,_o)}t(Ne,"createJSON5IdentifierNode");function De(pr){let sr=$(pr.loc.start,pr.loc.end);return hC.null({loc:{start:{...pr.loc.start},end:{...pr.loc.end}},...sr})}t(De,"createNullNode");function Se(pr){d?W(pr,[H_.String,H_.Identifier,H_.Number]):M(pr,H_.String);let sr=f.token,Cs=pr===H_.String?K(pr):Ne(sr);if(d&&(Cs.type==="NaN"||Cs.type==="Infinity")){if(Cs.sign!=="")throw new WF(f.token);Cs=hC.identifier(Cs.type,{loc:Cs.loc,...$(Cs.loc.start,Cs.loc.end)})}pr=O(),M(pr,H_.Colon);let Di=vr(),_o=$(Cs.loc.start,Di.loc.end);return hC.member(Cs,Di,{loc:{start:{...Cs.loc.start},end:{...Di.loc.end}},..._o})}t(Se,"parseProperty");function Tt(pr){M(pr,H_.LBrace);let sr=f.token,Cs=[],Di=O();if(Di!==H_.RBrace)do{if(Cs.push(Se(Di)),Di=O(),!Di)throw new pfe(Cs[Cs.length-1].loc.end);if(Di===H_.Comma){if(Di=O(),v&&Di===H_.RBrace)break}else break}while(Di);M(Di,H_.RBrace);let _o=f.token,hi=$(sr.loc.start,_o.loc.end);return hC.object(Cs,{loc:{start:{...sr.loc.start},end:{..._o.loc.end}},...hi})}t(Tt,"parseObject");function xt(pr){M(pr,H_.LBracket);let sr=f.token,Cs=[],Di=O();if(Di!==H_.RBracket)do{let No=vr(Di);if(Cs.push(hC.element(No,{loc:No.loc})),Di=O(),Di===H_.Comma){if(Di=O(),v&&Di===H_.RBracket)break}else break}while(Di);M(Di,H_.RBracket);let _o=f.token,hi=$(sr.loc.start,_o.loc.end);return hC.array(Cs,{loc:{start:{...sr.loc.start},end:{..._o.loc.end}},...hi})}t(xt,"parseArray");function vr(pr){pr=pr??O();let sr=f.token;switch(pr){case H_.String:case H_.Boolean:return K(pr);case H_.Number:if(d){let Cs=a.slice(sr.loc.start.offset,sr.loc.end.offset);if((Cs[0]==="+"||Cs[0]==="-")&&(Cs=Cs.slice(1)),Cs==="NaN"||Cs==="Infinity")return Ne(sr)}return K(pr);case H_.Null:return De(sr);case H_.LBrace:return Tt(pr);case H_.LBracket:return xt(pr);default:throw new WF(sr)}}t(vr,"parseValue");let Tr=vr();if(O())throw new WF(f.token);let Cr={loc:{start:{line:1,column:1,offset:0},end:{...Tr.loc.end}}};return s.tokens&&(Cr.tokens=c),s.ranges&&(Cr.range=[Cr.loc.start.offset,Cr.loc.end.offset]),hC.document(Tr,Cr)}t(Aft,"parse");var ror=new Map([["Document",["body"]],["Object",["members"]],["Member",["name","value"]],["Element",["value"]],["Array",["elements"]],["String",[]],["Number",[]],["Boolean",[]],["Null",[]],["NaN",[]],["Infinity",[]],["Identifier",[]]]);function kft(a){return a&&typeof a=="object"}t(kft,"isObject");function nor(a){return kft(a)&&typeof a.type=="string"}t(nor,"isNode");function ior(a,s){function c(f,d){typeof s.enter=="function"&&s.enter(f,d);for(let v of ror.get(f.type)){let E=f[v];kft(E)&&(Array.isArray(E)?E.forEach(A=>c(A,f)):nor(E)&&c(E,f))}typeof s.exit=="function"&&s.exit(f,d)}t(c,"visitNode"),c(a)}t(ior,"traverse");function wft(a,s=()=>!0){let c=[];return ior(a,{enter(f,d){c.push({node:f,parent:d,phase:"enter"})},exit(f,d){c.push({node:f,parent:d,phase:"exit"})}}),c.filter(s).values()}t(wft,"iterator");import sor from"fs/promises";var NQ=t((a,s)=>a.split(/\r?\n/)[s-1],"getFileLineContent"),dfe=t(async a=>{try{return await sor.readFile(a,"utf-8")}catch{return}},"getSchemaContent"),IQ=t(async a=>{try{return Aft(a)}catch(s){if(s.column&&s.line&&s.message){let c=NQ(a,s.line);return{column:s.column,line:s.line,length:void 0,lineText:c}}return}},"getSchemaAST");var Pft=t(async(a,s,c)=>{try{if(a.length===0)return;for(let f of a){let d=await dfe(f),v=await aor(d,f,s,c);if(v)return v}}catch{}},"getRouteLocationByValue"),aor=t(async(a,s,c,f)=>{try{if(!a)return;let d=null,v=await IQ(a);if(v){for(let{node:E}of wft(v))if(E.value&&E.value===c){d=E.loc;break}if(d!==null){let E=NQ(a,d.start.line);return{file:s,line:d.start.line,column:d.start.column,length:d.end.column-d.start.column,lineText:E,suggestion:f}}}}catch{}},"getRouteLocationByValueFromSchema");import Nft from"fs/promises";import mfe from"path";var wNe="schemas",PNe=".oas.json";var HF=t(async a=>(await Nft.readdir(a)).map(c=>`${a}/${c}`).filter(c=>c.endsWith(PNe)).sort(),"getOpenApiFilesByAlphabetical"),iB=t(async a=>{let s=mfe.resolve(a,"config");return(await Nft.readdir(s)).filter(f=>f.endsWith(PNe)).length>=1},"oasFileInProject");function OQ(a,s,c,f,d,v,E){if(v.has(c))return;let A;try{A=f.get(c)}catch(O){throw new Tv({text:`Failed to resolve reference: ${c}`,detail:O.message,severity:"error",message:"Failed to resolve reference",location:{file:a,column:0,line:0,length:0,lineText:c,namespace:s,suggestion:"Check the reference and try again."}})}v.set(c,d.length),d.push(c),NNe(INe(c),s,A,f,d,v,E)}t(OQ,"chaseRefs");function NNe(a,s,c,f,d,v,E){if(Array.isArray(c))for(let A of c)NNe(a,s,A,f,d,v,E);else if(typeof c=="object")for(let A in c){if(A==="$ref"){let O=c[A];E&&(c[A]=E(s,O)),OQ(a,s,bN(a,O),f,d,v,E)}NNe(a,s,c[A],f,d,v,E)}}t(NNe,"lookForRefs");function bN(a,s){let c=s.indexOf("#");return c>=0?`${mfe.resolve(a,s.substring(0,c))}${s.substring(c)}`:mfe.resolve(mfe.dirname(a),s)}t(bN,"getFullyQualifiedRefName");function INe(a){let s=a.indexOf("#");return s>=0?a.substring(0,s):a}t(INe,"getFilePathNameFromRefName");var ONe=class{static{t(this,"Environment")}get ZUP_HOSTNAME(){return process.env.ZUP_HOSTNAME??"zuplo.app"}get ZUP_WORKING_COPY_HOSTNAME(){return process.env.ZUP_WORKING_COPY_HOSTNAME??"working-copy.zuplotest.com"}},oor=new ONe,FNe=oor;var KQ=jp(QIe(),1);var YIe={};Nlt(YIe,{UnsafePathError:()=>Jfe,deleteFolder:()=>s_r,dirExists:()=>KIe,fileExists:()=>Qfr,getParentDirFilename:()=>r_r,isNotFileOrDirectory:()=>Yfr,listFolderContents:()=>sdt,listFolders:()=>Zfr,mkDirTemp:()=>Kfr,mkdirForFilePathIfNotExits:()=>e_r,mkdirIfNotExists:()=>adt,safePath:()=>t_r,tarFolder:()=>n_r,untarFile:()=>i_r});import{spawn as ndt}from"child_process";import{randomUUID as Wfr}from"crypto";import kN from"fs/promises";import{platform as Hfr,tmpdir as Gfr}from"os";import AN from"path";var idt=[".git","node_modules",".yarn",".DS_Store"];async function Qfr(a){try{return(await kN.stat(a)).isFile()}catch{return!1}}t(Qfr,"fileExists");async function Kfr(){let a=Gfr(),s=Wfr().replaceAll("-",""),c=AN.join(a,s);return await kN.mkdir(c,{recursive:!0}),c}t(Kfr,"mkDirTemp");async function KIe(a){try{return(await kN.stat(a)).isDirectory()}catch{return!1}}t(KIe,"dirExists");async function Yfr(a){try{return await kN.stat(a),!1}catch{return!0}}t(Yfr,"isNotFileOrDirectory");function Xfr(a,s){let c=new RegExp(`(.*)(\\/${s})$|(.*)(${s}\\/)`),f=a.match(c);if(!f)return"";let d=a.split(f[0]);return d[1]===""?"":`/${d[1]}`}t(Xfr,"getParentDirectory");async function Zfr(a){if(!await KIe(a))return[];let s=await kN.readdir(a,{withFileTypes:!0}),c=[];for await(let f of s)idt.includes(f.name)||f.isDirectory()&&c.push(f.name);return c}t(Zfr,"listFolders");async function sdt(a,s,c=!0){let f=Xfr(a,s),d=await kN.readdir(a,{withFileTypes:!0}),v=[];for await(let E of d)if(!idt.includes(E.name)||!c)if(E.isDirectory()){let A=await sdt(AN.join(a,E.name),s,c);v.push(...A)}else v.push(AN.join(f,E.name));return v}t(sdt,"listFolderContents");var adt=t(async a=>{await kN.mkdir(a,{recursive:!0})},"mkdirIfNotExists"),e_r=t(async a=>{let s=AN.dirname(a);return adt(s)},"mkdirForFilePathIfNotExits"),Jfe=class extends Error{static{t(this,"UnsafePathError")}constructor(s){super(s)}};function t_r(a){let s=t(c=>{if(!c.startsWith(a))throw new Jfe("Resolved path is not part of the project.");return c},"ensureSafePath");return{resolve:t((...c)=>s(AN.resolve(...c)),"resolve")}}t(t_r,"safePath");function r_r(a){return`${AN.basename(AN.dirname(a))}/${AN.basename(a)}`}t(r_r,"getParentDirFilename");async function n_r({folderPath:a,outputTarPath:s,exclude:c=["node_modules",".git","dist"],logger:f}){let d=[],v=[],E;try{await new Promise((A,O)=>{let M=ndt("tar",[...c.map(W=>["--exclude",W]).flat(),...Hfr()!=="darwin"?["--warning=no-file-changed"]:[],"-cvf",s,"-C",a,"."]);M.stdout.on("data",W=>{let $=W.toString().trim();$.length>0&&d.push($.trim())}),M.stderr.on("data",W=>{let $=W.toString().trim();$.length>0&&v.push($.trim())}),M.on("close",W=>{E=W,W===0?A():O(new Error(`tar process exited with code ${W}`))}),M.on("error",W=>{O(W)})})}catch(A){throw new Error("Failed to tar folder",{cause:A})}finally{f.info({stdout:d.join(`
|
|
578
|
+
`&&v++;else if(c)f+=E,v=d+2;else throw new i6(`Invalid escape \\${E}.`,{line:s.loc.start.line,column:s.loc.start.column+d,offset:s.loc.start.offset+d});d=a.indexOf("\\",v)}return f+=a.slice(v),f}t(eor,"getStringValue");function tor(a,s,c=!1){switch(s.type){case"Boolean":return a==="true";case"Number":return Number(a);case"String":return eor(a.slice(1,-1),s,c);default:throw new TypeError(`Unknown token type "${s.type}.`)}}t(tor,"getLiteralValue");function Aft(a,s){s=Object.freeze({...Zar,...s});let c=[],f=new kNe(a,{mode:s.mode,ranges:s.ranges}),d=s.mode==="json5",v=s.allowTrailingCommas||d;function E(){let pr=f.next();return pr&&s.tokens&&c.push(f.token),pr}t(E,"nextNoComments");function A(){let pr=f.next();return pr&&s.tokens&&c.push(f.token),pr>=H_.LineComment?A():pr}t(A,"nextSkipComments");let O=s.mode==="json"?E:A;function M(pr,sr){if(pr!==sr)throw new WF(f.token)}t(M,"assertTokenType");function W(pr,sr){if(!sr.includes(pr))throw new WF(f.token)}t(W,"assertTokenTypes");function $(pr,sr){return s.ranges?{range:[pr.offset,sr.offset]}:void 0}t($,"createRange");function K(pr){let sr=f.token,Cs=$(sr.loc.start,sr.loc.end),Di=tor(a.slice(sr.loc.start.offset,sr.loc.end.offset),sr,d),hi={loc:{start:{...sr.loc.start},end:{...sr.loc.end}},...Cs};switch(pr){case H_.String:return hC.string(Di,hi);case H_.Number:return hC.number(Di,hi);case H_.Boolean:return hC.boolean(Di,hi);default:throw new TypeError(`Unknown token type ${sr.type}.`)}}t(K,"createLiteralNode");function Ne(pr){let sr=$(pr.loc.start,pr.loc.end),Cs=a.slice(pr.loc.start.offset,pr.loc.end.offset),_o={loc:{start:{...pr.loc.start},end:{...pr.loc.end}},...sr};if(pr.type!=="Identifier"){let hi="";return(Cs[0]==="+"||Cs[0]==="-")&&(hi=Cs[0]),hC[Cs.includes("NaN")?"nan":"infinity"](hi,_o)}return hC.identifier(Cs,_o)}t(Ne,"createJSON5IdentifierNode");function De(pr){let sr=$(pr.loc.start,pr.loc.end);return hC.null({loc:{start:{...pr.loc.start},end:{...pr.loc.end}},...sr})}t(De,"createNullNode");function Se(pr){d?W(pr,[H_.String,H_.Identifier,H_.Number]):M(pr,H_.String);let sr=f.token,Cs=pr===H_.String?K(pr):Ne(sr);if(d&&(Cs.type==="NaN"||Cs.type==="Infinity")){if(Cs.sign!=="")throw new WF(f.token);Cs=hC.identifier(Cs.type,{loc:Cs.loc,...$(Cs.loc.start,Cs.loc.end)})}pr=O(),M(pr,H_.Colon);let Di=vr(),_o=$(Cs.loc.start,Di.loc.end);return hC.member(Cs,Di,{loc:{start:{...Cs.loc.start},end:{...Di.loc.end}},..._o})}t(Se,"parseProperty");function Tt(pr){M(pr,H_.LBrace);let sr=f.token,Cs=[],Di=O();if(Di!==H_.RBrace)do{if(Cs.push(Se(Di)),Di=O(),!Di)throw new pfe(Cs[Cs.length-1].loc.end);if(Di===H_.Comma){if(Di=O(),v&&Di===H_.RBrace)break}else break}while(Di);M(Di,H_.RBrace);let _o=f.token,hi=$(sr.loc.start,_o.loc.end);return hC.object(Cs,{loc:{start:{...sr.loc.start},end:{..._o.loc.end}},...hi})}t(Tt,"parseObject");function xt(pr){M(pr,H_.LBracket);let sr=f.token,Cs=[],Di=O();if(Di!==H_.RBracket)do{let No=vr(Di);if(Cs.push(hC.element(No,{loc:No.loc})),Di=O(),Di===H_.Comma){if(Di=O(),v&&Di===H_.RBracket)break}else break}while(Di);M(Di,H_.RBracket);let _o=f.token,hi=$(sr.loc.start,_o.loc.end);return hC.array(Cs,{loc:{start:{...sr.loc.start},end:{..._o.loc.end}},...hi})}t(xt,"parseArray");function vr(pr){pr=pr??O();let sr=f.token;switch(pr){case H_.String:case H_.Boolean:return K(pr);case H_.Number:if(d){let Cs=a.slice(sr.loc.start.offset,sr.loc.end.offset);if((Cs[0]==="+"||Cs[0]==="-")&&(Cs=Cs.slice(1)),Cs==="NaN"||Cs==="Infinity")return Ne(sr)}return K(pr);case H_.Null:return De(sr);case H_.LBrace:return Tt(pr);case H_.LBracket:return xt(pr);default:throw new WF(sr)}}t(vr,"parseValue");let Tr=vr();if(O())throw new WF(f.token);let Cr={loc:{start:{line:1,column:1,offset:0},end:{...Tr.loc.end}}};return s.tokens&&(Cr.tokens=c),s.ranges&&(Cr.range=[Cr.loc.start.offset,Cr.loc.end.offset]),hC.document(Tr,Cr)}t(Aft,"parse");var ror=new Map([["Document",["body"]],["Object",["members"]],["Member",["name","value"]],["Element",["value"]],["Array",["elements"]],["String",[]],["Number",[]],["Boolean",[]],["Null",[]],["NaN",[]],["Infinity",[]],["Identifier",[]]]);function kft(a){return a&&typeof a=="object"}t(kft,"isObject");function nor(a){return kft(a)&&typeof a.type=="string"}t(nor,"isNode");function ior(a,s){function c(f,d){typeof s.enter=="function"&&s.enter(f,d);for(let v of ror.get(f.type)){let E=f[v];kft(E)&&(Array.isArray(E)?E.forEach(A=>c(A,f)):nor(E)&&c(E,f))}typeof s.exit=="function"&&s.exit(f,d)}t(c,"visitNode"),c(a)}t(ior,"traverse");function wft(a,s=()=>!0){let c=[];return ior(a,{enter(f,d){c.push({node:f,parent:d,phase:"enter"})},exit(f,d){c.push({node:f,parent:d,phase:"exit"})}}),c.filter(s).values()}t(wft,"iterator");import sor from"fs/promises";var NQ=t((a,s)=>a.split(/\r?\n/)[s-1],"getFileLineContent"),dfe=t(async a=>{try{return await sor.readFile(a,"utf-8")}catch{return}},"getSchemaContent"),IQ=t(async a=>{try{return Aft(a)}catch(s){if(s.column&&s.line&&s.message){let c=NQ(a,s.line);return{column:s.column,line:s.line,length:void 0,lineText:c}}return}},"getSchemaAST");var Pft=t(async(a,s,c)=>{try{if(a.length===0)return;for(let f of a){let d=await dfe(f),v=await aor(d,f,s,c);if(v)return v}}catch{}},"getRouteLocationByValue"),aor=t(async(a,s,c,f)=>{try{if(!a)return;let d=null,v=await IQ(a);if(v){for(let{node:E}of wft(v))if(E.value&&E.value===c){d=E.loc;break}if(d!==null){let E=NQ(a,d.start.line);return{file:s,line:d.start.line,column:d.start.column,length:d.end.column-d.start.column,lineText:E,suggestion:f}}}}catch{}},"getRouteLocationByValueFromSchema");import Nft from"fs/promises";import mfe from"path";var wNe="schemas",PNe=".oas.json";var HF=t(async a=>(await Nft.readdir(a)).map(c=>`${a}/${c}`).filter(c=>c.endsWith(PNe)).sort(),"getOpenApiFilesByAlphabetical"),iB=t(async a=>{let s=mfe.resolve(a,"config");return(await Nft.readdir(s)).filter(f=>f.endsWith(PNe)).length>=1},"oasFileInProject");function OQ(a,s,c,f,d,v,E){if(v.has(c))return;let A;try{A=f.get(c)}catch(O){throw new Tv({text:`Failed to resolve reference: ${c}`,detail:O.message,severity:"error",message:"Failed to resolve reference",location:{file:a,column:0,line:0,length:0,lineText:c,namespace:s,suggestion:"Check the reference and try again."}})}v.set(c,d.length),d.push(c),NNe(INe(c),s,A,f,d,v,E)}t(OQ,"chaseRefs");function NNe(a,s,c,f,d,v,E){if(Array.isArray(c))for(let A of c)NNe(a,s,A,f,d,v,E);else if(typeof c=="object")for(let A in c){if(A==="$ref"){let O=c[A];E&&(c[A]=E(s,O)),OQ(a,s,bN(a,O),f,d,v,E)}NNe(a,s,c[A],f,d,v,E)}}t(NNe,"lookForRefs");function bN(a,s){let c=s.indexOf("#");return c>=0?`${mfe.resolve(a,s.substring(0,c))}${s.substring(c)}`:mfe.resolve(mfe.dirname(a),s)}t(bN,"getFullyQualifiedRefName");function INe(a){let s=a.indexOf("#");return s>=0?a.substring(0,s):a}t(INe,"getFilePathNameFromRefName");var ONe=class{static{t(this,"Environment")}get ZUP_HOSTNAME(){return process.env.ZUP_HOSTNAME??"zuplo.app"}get ZUP_WORKING_COPY_HOSTNAME(){return process.env.ZUP_WORKING_COPY_HOSTNAME??"working-copy.zuplotest.com"}},oor=new ONe,FNe=oor;var KQ=jp(QIe(),1);var YIe={};Nlt(YIe,{UnsafePathError:()=>Jfe,deleteFolder:()=>s_r,dirExists:()=>KIe,fileExists:()=>Qfr,getParentDirFilename:()=>r_r,isNotFileOrDirectory:()=>Yfr,listFolderContents:()=>sdt,listFolders:()=>Zfr,mkDirTemp:()=>Kfr,mkdirForFilePathIfNotExits:()=>e_r,mkdirIfNotExists:()=>adt,safePath:()=>t_r,tarFolder:()=>n_r,untarFile:()=>i_r});import{spawn as ndt}from"child_process";import{randomUUID as Wfr}from"crypto";import kN from"fs/promises";import{platform as Hfr,tmpdir as Gfr}from"os";import AN from"path";var idt=[".git","node_modules",".yarn",".DS_Store"];async function Qfr(a){try{return(await kN.stat(a)).isFile()}catch{return!1}}t(Qfr,"fileExists");async function Kfr(){let a=process.env.BUILD_FILE_PATH??Gfr(),s=Wfr().replaceAll("-",""),c=AN.join(a,s);return await kN.mkdir(c,{recursive:!0}),c}t(Kfr,"mkDirTemp");async function KIe(a){try{return(await kN.stat(a)).isDirectory()}catch{return!1}}t(KIe,"dirExists");async function Yfr(a){try{return await kN.stat(a),!1}catch{return!0}}t(Yfr,"isNotFileOrDirectory");function Xfr(a,s){let c=new RegExp(`(.*)(\\/${s})$|(.*)(${s}\\/)`),f=a.match(c);if(!f)return"";let d=a.split(f[0]);return d[1]===""?"":`/${d[1]}`}t(Xfr,"getParentDirectory");async function Zfr(a){if(!await KIe(a))return[];let s=await kN.readdir(a,{withFileTypes:!0}),c=[];for await(let f of s)idt.includes(f.name)||f.isDirectory()&&c.push(f.name);return c}t(Zfr,"listFolders");async function sdt(a,s,c=!0){let f=Xfr(a,s),d=await kN.readdir(a,{withFileTypes:!0}),v=[];for await(let E of d)if(!idt.includes(E.name)||!c)if(E.isDirectory()){let A=await sdt(AN.join(a,E.name),s,c);v.push(...A)}else v.push(AN.join(f,E.name));return v}t(sdt,"listFolderContents");var adt=t(async a=>{await kN.mkdir(a,{recursive:!0})},"mkdirIfNotExists"),e_r=t(async a=>{let s=AN.dirname(a);return adt(s)},"mkdirForFilePathIfNotExits"),Jfe=class extends Error{static{t(this,"UnsafePathError")}constructor(s){super(s)}};function t_r(a){let s=t(c=>{if(!c.startsWith(a))throw new Jfe("Resolved path is not part of the project.");return c},"ensureSafePath");return{resolve:t((...c)=>s(AN.resolve(...c)),"resolve")}}t(t_r,"safePath");function r_r(a){return`${AN.basename(AN.dirname(a))}/${AN.basename(a)}`}t(r_r,"getParentDirFilename");async function n_r({folderPath:a,outputTarPath:s,exclude:c=["node_modules",".git","dist"],logger:f}){let d=[],v=[],E;try{await new Promise((A,O)=>{let M=ndt("tar",[...c.map(W=>["--exclude",W]).flat(),...Hfr()!=="darwin"?["--warning=no-file-changed"]:[],"-cvf",s,"-C",a,"."]);M.stdout.on("data",W=>{let $=W.toString().trim();$.length>0&&d.push($.trim())}),M.stderr.on("data",W=>{let $=W.toString().trim();$.length>0&&v.push($.trim())}),M.on("close",W=>{E=W,W===0?A():O(new Error(`tar process exited with code ${W}`))}),M.on("error",W=>{O(W)})})}catch(A){throw new Error("Failed to tar folder",{cause:A})}finally{f.info({stdout:d.join(`
|
|
579
579
|
`),stderr:v.join(`
|
|
580
580
|
`),exitCode:E},"Tar process logs")}}t(n_r,"tarFolder");async function i_r({tarFilePath:a,outputDir:s,logger:c,rootFolderCompatibility:f=!0}){let d=[],v=[],E;try{await new Promise((A,O)=>{let M;f?M=`
|
|
581
581
|
if tar -tf ${a} | grep -qE '^([^/]+/)$'; then
|
package/index.minified.js
CHANGED
|
@@ -575,7 +575,7 @@ globstar while`,s,K,c,Ne,De),this.matchOne(s.slice(K),c.slice(Ne),f))return this
|
|
|
575
575
|
>>> no match, partial?`,s,K,c,Ne),K===O))}let Se;if(typeof W=="string"?(Se=$===W,this.debug("string match",W,$,Se)):(Se=W.test($),this.debug("pattern match",W,$,Se)),!Se)return!1}if(E===O&&A===R)return!0;if(E===O)return f;if(A===R)return E===O-1&&s[E]==="";throw new Error("wtf?")}braceExpand(){return tft(this.pattern,this.options)}parse(s){dQ(s);let c=this.options;if(s==="**")return ry;if(s==="")return"";let f,d=null;(f=s.match(Ysr))?d=c.dot?Zsr:Xsr:(f=s.match($sr))?d=(c.nocase?c.dot?Vsr:qsr:c.dot?zsr:Jsr)(f[1]):(f=s.match(ear))?d=(c.nocase?c.dot?rar:tar:c.dot?nar:iar)(f):(f=s.match(Wsr))?d=c.dot?Gsr:Hsr:(f=s.match(Qsr))&&(d=Ksr);let v=Qj.fromGlob(s,this.options).toMMPattern();return d&&typeof v=="object"&&Reflect.defineProperty(v,"test",{value:d}),v}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let s=this.set;if(!s.length)return this.regexp=!1,this.regexp;let c=this.options,f=c.noglobstar?oar:c.dot?car:lar,d=new Set(c.nocase?["i"]:[]),v=s.map(O=>{let R=O.map(W=>{if(W instanceof RegExp)for(let $ of W.flags.split(""))d.add($);return typeof W=="string"?dar(W):W===ry?ry:W._src});return R.forEach((W,$)=>{let K=R[$+1],Ne=R[$-1];W!==ry||Ne===ry||(Ne===void 0?K!==void 0&&K!==ry?R[$+1]="(?:\\/|"+f+"\\/)?"+K:R[$]=f:K===void 0?R[$-1]=Ne+"(?:\\/|"+f+")?":K!==ry&&(R[$-1]=Ne+"(?:\\/|\\/"+f+"\\/)"+K,R[$+1]=ry))}),R.filter(W=>W!==ry).join("/")}).join("|"),[E,A]=s.length>1?["(?:",")"]:["",""];v="^"+E+v+A+"$",this.negate&&(v="^(?!"+v+").+$");try{this.regexp=new RegExp(v,[...d].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(s){return this.preserveMultipleSlashes?s.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(s)?["",...s.split(/\/+/)]:s.split(/\/+/)}match(s,c=this.partial){if(this.debug("match",s,this.pattern),this.comment)return!1;if(this.empty)return s==="";if(s==="/"&&c)return!0;let f=this.options;this.isWindows&&(s=s.split("\\").join("/"));let d=this.slashSplit(s);this.debug(this.pattern,"split",d);let v=this.set;this.debug(this.pattern,"set",v);let E=d[d.length-1];if(!E)for(let A=d.length-2;!E&&A>=0;A--)E=d[A];for(let A=0;A<v.length;A++){let O=v[A],R=d;if(f.matchBase&&O.length===1&&(R=[E]),this.matchOne(R,O,c))return f.flipNegate?!0:!this.negate}return f.flipNegate?!1:this.negate}static defaults(s){return Cv.defaults(s).Minimatch}};Cv.AST=Qj;Cv.Minimatch=AS;Cv.escape=Kj;Cv.unescape=Cx;import{fileURLToPath as Har}from"url";var Yj=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,nft=new Set,uNe=typeof process=="object"&&process?process:{},ift=t((a,s,c,f)=>{typeof uNe.emitWarning=="function"?uNe.emitWarning(a,s,c,f):console.error(`[${c}] ${s}: ${a}`)},"emitWarning"),Gue=globalThis.AbortController,rft=globalThis.AbortSignal;if(typeof Gue>"u"){rft=class{static{t(this,"AbortSignal")}onabort;_onabort=[];reason;aborted=!1;addEventListener(f,d){this._onabort.push(d)}},Gue=class{static{t(this,"AbortController")}constructor(){s()}signal=new rft;abort(f){if(!this.signal.aborted){this.signal.reason=f,this.signal.aborted=!0;for(let d of this.signal._onabort)d(f);this.signal.onabort?.(f)}}};let a=uNe.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",s=t(()=>{a&&(a=!1,ift("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",s))},"warnACPolyfill")}var mar=t(a=>!nft.has(a),"shouldWarn"),vRr=Symbol("type"),vN=t(a=>a&&a===Math.floor(a)&&a>0&&isFinite(a),"isPosInt"),sft=t(a=>vN(a)?a<=Math.pow(2,8)?Uint8Array:a<=Math.pow(2,16)?Uint16Array:a<=Math.pow(2,32)?Uint32Array:a<=Number.MAX_SAFE_INTEGER?Xj:null:null,"getUintArray"),Xj=class extends Array{static{t(this,"ZeroArray")}constructor(s){super(s),this.fill(0)}},fNe=class a{static{t(this,"Stack")}heap;length;static#r=!1;static create(s){let c=sft(s);if(!c)return[];a.#r=!0;let f=new a(s,c);return a.#r=!1,f}constructor(s,c){if(!a.#r)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new c(s),this.length=0}push(s){this.heap[this.length++]=s}pop(){return this.heap[--this.length]}},hQ=class a{static{t(this,"LRUCache")}#r;#n;#e;#t;#s;#p;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#a;#_;#c;#l;#i;#f;#v;#d;#u;#m;#g;#x;#C;#b;#A;#E;#y;static unsafeExposeInternals(s){return{starts:s.#C,ttls:s.#b,sizes:s.#x,keyMap:s.#c,keyList:s.#l,valList:s.#i,next:s.#f,prev:s.#v,get head(){return s.#d},get tail(){return s.#u},free:s.#m,isBackgroundFetch:t(c=>s.#h(c),"isBackgroundFetch"),backgroundFetch:t((c,f,d,v)=>s.#j(c,f,d,v),"backgroundFetch"),moveToTail:t(c=>s.#U(c),"moveToTail"),indexes:t(c=>s.#w(c),"indexes"),rindexes:t(c=>s.#P(c),"rindexes"),isStale:t(c=>s.#S(c),"isStale")}}get max(){return this.#r}get maxSize(){return this.#n}get calculatedSize(){return this.#_}get size(){return this.#a}get fetchMethod(){return this.#s}get memoMethod(){return this.#p}get dispose(){return this.#e}get disposeAfter(){return this.#t}constructor(s){let{max:c=0,ttl:f,ttlResolution:d=1,ttlAutopurge:v,updateAgeOnGet:E,updateAgeOnHas:A,allowStale:O,dispose:R,disposeAfter:W,noDisposeOnSet:$,noUpdateTTL:K,maxSize:Ne=0,maxEntrySize:De=0,sizeCalculation:Se,fetchMethod:Tt,memoMethod:xt,noDeleteOnFetchRejection:vr,noDeleteOnStaleGet:Tr,allowStaleOnFetchRejection:Nr,allowStaleOnFetchAbort:Cr,ignoreFetchAbort:pr}=s;if(c!==0&&!vN(c))throw new TypeError("max option must be a nonnegative integer");let sr=c?sft(c):Array;if(!sr)throw new Error("invalid max value: "+c);if(this.#r=c,this.#n=Ne,this.maxEntrySize=De||this.#n,this.sizeCalculation=Se,this.sizeCalculation){if(!this.#n&&!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(xt!==void 0&&typeof xt!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#p=xt,Tt!==void 0&&typeof Tt!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#s=Tt,this.#E=!!Tt,this.#c=new Map,this.#l=new Array(c).fill(void 0),this.#i=new Array(c).fill(void 0),this.#f=new sr(c),this.#v=new sr(c),this.#d=0,this.#u=0,this.#m=fNe.create(c),this.#a=0,this.#_=0,typeof R=="function"&&(this.#e=R),typeof W=="function"?(this.#t=W,this.#g=[]):(this.#t=void 0,this.#g=void 0),this.#A=!!this.#e,this.#y=!!this.#t,this.noDisposeOnSet=!!$,this.noUpdateTTL=!!K,this.noDeleteOnFetchRejection=!!vr,this.allowStaleOnFetchRejection=!!Nr,this.allowStaleOnFetchAbort=!!Cr,this.ignoreFetchAbort=!!pr,this.maxEntrySize!==0){if(this.#n!==0&&!vN(this.#n))throw new TypeError("maxSize must be a positive integer if specified");if(!vN(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#T()}if(this.allowStale=!!O,this.noDeleteOnStaleGet=!!Tr,this.updateAgeOnGet=!!E,this.updateAgeOnHas=!!A,this.ttlResolution=vN(d)||d===0?d:1,this.ttlAutopurge=!!v,this.ttl=f||0,this.ttl){if(!vN(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#D()}if(this.#r===0&&this.ttl===0&&this.#n===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#r&&!this.#n){let Cs="LRU_CACHE_UNBOUNDED";mar(Cs)&&(nft.add(Cs),ift("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Cs,a))}}getRemainingTTL(s){return this.#c.has(s)?1/0:0}#D(){let s=new Xj(this.#r),c=new Xj(this.#r);this.#b=s,this.#C=c,this.#N=(v,E,A=Yj.now())=>{if(c[v]=E!==0?A:0,s[v]=E,E!==0&&this.ttlAutopurge){let O=setTimeout(()=>{this.#S(v)&&this.#O(this.#l[v],"expire")},E+1);O.unref&&O.unref()}},this.#k=v=>{c[v]=s[v]!==0?Yj.now():0},this.#o=(v,E)=>{if(s[E]){let A=s[E],O=c[E];if(!A||!O)return;v.ttl=A,v.start=O,v.now=f||d();let R=v.now-O;v.remainingTTL=A-R}};let f=0,d=t(()=>{let v=Yj.now();if(this.ttlResolution>0){f=v;let E=setTimeout(()=>f=0,this.ttlResolution);E.unref&&E.unref()}return v},"getNow");this.getRemainingTTL=v=>{let E=this.#c.get(v);if(E===void 0)return 0;let A=s[E],O=c[E];if(!A||!O)return 1/0;let R=(f||d())-O;return A-R},this.#S=v=>{let E=c[v],A=s[v];return!!A&&!!E&&(f||d())-E>A}}#k=t(()=>{},"#updateItemAge");#o=t(()=>{},"#statusTTL");#N=t(()=>{},"#setItemTTL");#S=t(()=>!1,"#isStale");#T(){let s=new Xj(this.#r);this.#_=0,this.#x=s,this.#I=c=>{this.#_-=s[c],s[c]=0},this.#L=(c,f,d,v)=>{if(this.#h(f))return 0;if(!vN(d))if(v){if(typeof v!="function")throw new TypeError("sizeCalculation must be a function");if(d=v(f,c),!vN(d))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 d},this.#F=(c,f,d)=>{if(s[c]=f,this.#n){let v=this.#n-s[c];for(;this.#_>v;)this.#M(!0)}this.#_+=s[c],d&&(d.entrySize=f,d.totalCalculatedSize=this.#_)}}#I=t(s=>{},"#removeItemSize");#F=t((s,c,f)=>{},"#addItemSize");#L=t((s,c,f,d)=>{if(f||d)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0},"#requireSize");*#w({allowStale:s=this.allowStale}={}){if(this.#a)for(let c=this.#u;!(!this.#R(c)||((s||!this.#S(c))&&(yield c),c===this.#d));)c=this.#v[c]}*#P({allowStale:s=this.allowStale}={}){if(this.#a)for(let c=this.#d;!(!this.#R(c)||((s||!this.#S(c))&&(yield c),c===this.#u));)c=this.#f[c]}#R(s){return s!==void 0&&this.#c.get(this.#l[s])===s}*entries(){for(let s of this.#w())this.#i[s]!==void 0&&this.#l[s]!==void 0&&!this.#h(this.#i[s])&&(yield[this.#l[s],this.#i[s]])}*rentries(){for(let s of this.#P())this.#i[s]!==void 0&&this.#l[s]!==void 0&&!this.#h(this.#i[s])&&(yield[this.#l[s],this.#i[s]])}*keys(){for(let s of this.#w()){let c=this.#l[s];c!==void 0&&!this.#h(this.#i[s])&&(yield c)}}*rkeys(){for(let s of this.#P()){let c=this.#l[s];c!==void 0&&!this.#h(this.#i[s])&&(yield c)}}*values(){for(let s of this.#w())this.#i[s]!==void 0&&!this.#h(this.#i[s])&&(yield this.#i[s])}*rvalues(){for(let s of this.#P())this.#i[s]!==void 0&&!this.#h(this.#i[s])&&(yield this.#i[s])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(s,c={}){for(let f of this.#w()){let d=this.#i[f],v=this.#h(d)?d.__staleWhileFetching:d;if(v!==void 0&&s(v,this.#l[f],this))return this.get(this.#l[f],c)}}forEach(s,c=this){for(let f of this.#w()){let d=this.#i[f],v=this.#h(d)?d.__staleWhileFetching:d;v!==void 0&&s.call(c,v,this.#l[f],this)}}rforEach(s,c=this){for(let f of this.#P()){let d=this.#i[f],v=this.#h(d)?d.__staleWhileFetching:d;v!==void 0&&s.call(c,v,this.#l[f],this)}}purgeStale(){let s=!1;for(let c of this.#P({allowStale:!0}))this.#S(c)&&(this.#O(this.#l[c],"expire"),s=!0);return s}info(s){let c=this.#c.get(s);if(c===void 0)return;let f=this.#i[c],d=this.#h(f)?f.__staleWhileFetching:f;if(d===void 0)return;let v={value:d};if(this.#b&&this.#C){let E=this.#b[c],A=this.#C[c];if(E&&A){let O=E-(Yj.now()-A);v.ttl=O,v.start=Date.now()}}return this.#x&&(v.size=this.#x[c]),v}dump(){let s=[];for(let c of this.#w({allowStale:!0})){let f=this.#l[c],d=this.#i[c],v=this.#h(d)?d.__staleWhileFetching:d;if(v===void 0||f===void 0)continue;let E={value:v};if(this.#b&&this.#C){E.ttl=this.#b[c];let A=Yj.now()-this.#C[c];E.start=Math.floor(Date.now()-A)}this.#x&&(E.size=this.#x[c]),s.unshift([f,E])}return s}load(s){this.clear();for(let[c,f]of s){if(f.start){let d=Date.now()-f.start;f.start=Yj.now()-d}this.set(c,f.value,f)}}set(s,c,f={}){if(c===void 0)return this.delete(s),this;let{ttl:d=this.ttl,start:v,noDisposeOnSet:E=this.noDisposeOnSet,sizeCalculation:A=this.sizeCalculation,status:O}=f,{noUpdateTTL:R=this.noUpdateTTL}=f,W=this.#L(s,c,f.size||0,A);if(this.maxEntrySize&&W>this.maxEntrySize)return O&&(O.set="miss",O.maxEntrySizeExceeded=!0),this.#O(s,"set"),this;let $=this.#a===0?void 0:this.#c.get(s);if($===void 0)$=this.#a===0?this.#u:this.#m.length!==0?this.#m.pop():this.#a===this.#r?this.#M(!1):this.#a,this.#l[$]=s,this.#i[$]=c,this.#c.set(s,$),this.#f[this.#u]=$,this.#v[$]=this.#u,this.#u=$,this.#a++,this.#F($,W,O),O&&(O.set="add"),R=!1;else{this.#U($);let K=this.#i[$];if(c!==K){if(this.#E&&this.#h(K)){K.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:Ne}=K;Ne!==void 0&&!E&&(this.#A&&this.#e?.(Ne,s,"set"),this.#y&&this.#g?.push([Ne,s,"set"]))}else E||(this.#A&&this.#e?.(K,s,"set"),this.#y&&this.#g?.push([K,s,"set"]));if(this.#I($),this.#F($,W,O),this.#i[$]=c,O){O.set="replace";let Ne=K&&this.#h(K)?K.__staleWhileFetching:K;Ne!==void 0&&(O.oldValue=Ne)}}else O&&(O.set="update")}if(d!==0&&!this.#b&&this.#D(),this.#b&&(R||this.#N($,d,v),O&&this.#o(O,$)),!E&&this.#y&&this.#g){let K=this.#g,Ne;for(;Ne=K?.shift();)this.#t?.(...Ne)}return this}pop(){try{for(;this.#a;){let s=this.#i[this.#d];if(this.#M(!0),this.#h(s)){if(s.__staleWhileFetching)return s.__staleWhileFetching}else if(s!==void 0)return s}}finally{if(this.#y&&this.#g){let s=this.#g,c;for(;c=s?.shift();)this.#t?.(...c)}}}#M(s){let c=this.#d,f=this.#l[c],d=this.#i[c];return this.#E&&this.#h(d)?d.__abortController.abort(new Error("evicted")):(this.#A||this.#y)&&(this.#A&&this.#e?.(d,f,"evict"),this.#y&&this.#g?.push([d,f,"evict"])),this.#I(c),s&&(this.#l[c]=void 0,this.#i[c]=void 0,this.#m.push(c)),this.#a===1?(this.#d=this.#u=0,this.#m.length=0):this.#d=this.#f[c],this.#c.delete(f),this.#a--,c}has(s,c={}){let{updateAgeOnHas:f=this.updateAgeOnHas,status:d}=c,v=this.#c.get(s);if(v!==void 0){let E=this.#i[v];if(this.#h(E)&&E.__staleWhileFetching===void 0)return!1;if(this.#S(v))d&&(d.has="stale",this.#o(d,v));else return f&&this.#k(v),d&&(d.has="hit",this.#o(d,v)),!0}else d&&(d.has="miss");return!1}peek(s,c={}){let{allowStale:f=this.allowStale}=c,d=this.#c.get(s);if(d===void 0||!f&&this.#S(d))return;let v=this.#i[d];return this.#h(v)?v.__staleWhileFetching:v}#j(s,c,f,d){let v=c===void 0?void 0:this.#i[c];if(this.#h(v))return v;let E=new Gue,{signal:A}=f;A?.addEventListener("abort",()=>E.abort(A.reason),{signal:E.signal});let O={signal:E.signal,options:f,context:d},R=t((Se,Tt=!1)=>{let{aborted:xt}=E.signal,vr=f.ignoreFetchAbort&&Se!==void 0;if(f.status&&(xt&&!Tt?(f.status.fetchAborted=!0,f.status.fetchError=E.signal.reason,vr&&(f.status.fetchAbortIgnored=!0)):f.status.fetchResolved=!0),xt&&!vr&&!Tt)return $(E.signal.reason);let Tr=Ne;return this.#i[c]===Ne&&(Se===void 0?Tr.__staleWhileFetching?this.#i[c]=Tr.__staleWhileFetching:this.#O(s,"fetch"):(f.status&&(f.status.fetchUpdated=!0),this.set(s,Se,O.options))),Se},"cb"),W=t(Se=>(f.status&&(f.status.fetchRejected=!0,f.status.fetchError=Se),$(Se)),"eb"),$=t(Se=>{let{aborted:Tt}=E.signal,xt=Tt&&f.allowStaleOnFetchAbort,vr=xt||f.allowStaleOnFetchRejection,Tr=vr||f.noDeleteOnFetchRejection,Nr=Ne;if(this.#i[c]===Ne&&(!Tr||Nr.__staleWhileFetching===void 0?this.#O(s,"fetch"):xt||(this.#i[c]=Nr.__staleWhileFetching)),vr)return f.status&&Nr.__staleWhileFetching!==void 0&&(f.status.returnedStale=!0),Nr.__staleWhileFetching;if(Nr.__returned===Nr)throw Se},"fetchFail"),K=t((Se,Tt)=>{let xt=this.#s?.(s,v,O);xt&&xt instanceof Promise&&xt.then(vr=>Se(vr===void 0?void 0:vr),Tt),E.signal.addEventListener("abort",()=>{(!f.ignoreFetchAbort||f.allowStaleOnFetchAbort)&&(Se(void 0),f.allowStaleOnFetchAbort&&(Se=t(vr=>R(vr,!0),"res")))})},"pcall");f.status&&(f.status.fetchDispatched=!0);let Ne=new Promise(K).then(R,W),De=Object.assign(Ne,{__abortController:E,__staleWhileFetching:v,__returned:void 0});return c===void 0?(this.set(s,De,{...O.options,status:void 0}),c=this.#c.get(s)):this.#i[c]=De,De}#h(s){if(!this.#E)return!1;let c=s;return!!c&&c instanceof Promise&&c.hasOwnProperty("__staleWhileFetching")&&c.__abortController instanceof Gue}async fetch(s,c={}){let{allowStale:f=this.allowStale,updateAgeOnGet:d=this.updateAgeOnGet,noDeleteOnStaleGet:v=this.noDeleteOnStaleGet,ttl:E=this.ttl,noDisposeOnSet:A=this.noDisposeOnSet,size:O=0,sizeCalculation:R=this.sizeCalculation,noUpdateTTL:W=this.noUpdateTTL,noDeleteOnFetchRejection:$=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:K=this.allowStaleOnFetchRejection,ignoreFetchAbort:Ne=this.ignoreFetchAbort,allowStaleOnFetchAbort:De=this.allowStaleOnFetchAbort,context:Se,forceRefresh:Tt=!1,status:xt,signal:vr}=c;if(!this.#E)return xt&&(xt.fetch="get"),this.get(s,{allowStale:f,updateAgeOnGet:d,noDeleteOnStaleGet:v,status:xt});let Tr={allowStale:f,updateAgeOnGet:d,noDeleteOnStaleGet:v,ttl:E,noDisposeOnSet:A,size:O,sizeCalculation:R,noUpdateTTL:W,noDeleteOnFetchRejection:$,allowStaleOnFetchRejection:K,allowStaleOnFetchAbort:De,ignoreFetchAbort:Ne,status:xt,signal:vr},Nr=this.#c.get(s);if(Nr===void 0){xt&&(xt.fetch="miss");let Cr=this.#j(s,Nr,Tr,Se);return Cr.__returned=Cr}else{let Cr=this.#i[Nr];if(this.#h(Cr)){let _o=f&&Cr.__staleWhileFetching!==void 0;return xt&&(xt.fetch="inflight",_o&&(xt.returnedStale=!0)),_o?Cr.__staleWhileFetching:Cr.__returned=Cr}let pr=this.#S(Nr);if(!Tt&&!pr)return xt&&(xt.fetch="hit"),this.#U(Nr),d&&this.#k(Nr),xt&&this.#o(xt,Nr),Cr;let sr=this.#j(s,Nr,Tr,Se),Di=sr.__staleWhileFetching!==void 0&&f;return xt&&(xt.fetch=pr?"stale":"refresh",Di&&pr&&(xt.returnedStale=!0)),Di?sr.__staleWhileFetching:sr.__returned=sr}}async forceFetch(s,c={}){let f=await this.fetch(s,c);if(f===void 0)throw new Error("fetch() returned undefined");return f}memo(s,c={}){let f=this.#p;if(!f)throw new Error("no memoMethod provided to constructor");let{context:d,forceRefresh:v,...E}=c,A=this.get(s,E);if(!v&&A!==void 0)return A;let O=f(s,A,{options:E,context:d});return this.set(s,O,E),O}get(s,c={}){let{allowStale:f=this.allowStale,updateAgeOnGet:d=this.updateAgeOnGet,noDeleteOnStaleGet:v=this.noDeleteOnStaleGet,status:E}=c,A=this.#c.get(s);if(A!==void 0){let O=this.#i[A],R=this.#h(O);return E&&this.#o(E,A),this.#S(A)?(E&&(E.get="stale"),R?(E&&f&&O.__staleWhileFetching!==void 0&&(E.returnedStale=!0),f?O.__staleWhileFetching:void 0):(v||this.#O(s,"expire"),E&&f&&(E.returnedStale=!0),f?O:void 0)):(E&&(E.get="hit"),R?O.__staleWhileFetching:(this.#U(A),d&&this.#k(A),O))}else E&&(E.get="miss")}#B(s,c){this.#v[c]=s,this.#f[s]=c}#U(s){s!==this.#u&&(s===this.#d?this.#d=this.#f[s]:this.#B(this.#v[s],this.#f[s]),this.#B(this.#u,s),this.#u=s)}delete(s){return this.#O(s,"delete")}#O(s,c){let f=!1;if(this.#a!==0){let d=this.#c.get(s);if(d!==void 0)if(f=!0,this.#a===1)this.#$(c);else{this.#I(d);let v=this.#i[d];if(this.#h(v)?v.__abortController.abort(new Error("deleted")):(this.#A||this.#y)&&(this.#A&&this.#e?.(v,s,c),this.#y&&this.#g?.push([v,s,c])),this.#c.delete(s),this.#l[d]=void 0,this.#i[d]=void 0,d===this.#u)this.#u=this.#v[d];else if(d===this.#d)this.#d=this.#f[d];else{let E=this.#v[d];this.#f[E]=this.#f[d];let A=this.#f[d];this.#v[A]=this.#v[d]}this.#a--,this.#m.push(d)}}if(this.#y&&this.#g?.length){let d=this.#g,v;for(;v=d?.shift();)this.#t?.(...v)}return f}clear(){return this.#$("delete")}#$(s){for(let c of this.#P({allowStale:!0})){let f=this.#i[c];if(this.#h(f))f.__abortController.abort(new Error("deleted"));else{let d=this.#l[c];this.#A&&this.#e?.(f,d,s),this.#y&&this.#g?.push([f,d,s])}}if(this.#c.clear(),this.#i.fill(void 0),this.#l.fill(void 0),this.#b&&this.#C&&(this.#b.fill(0),this.#C.fill(0)),this.#x&&this.#x.fill(0),this.#d=0,this.#u=0,this.#m.length=0,this.#_=0,this.#a=0,this.#y&&this.#g){let c=this.#g,f;for(;f=c?.shift();)this.#t?.(...f)}}};import{posix as Aar,win32 as SNe}from"path";import{fileURLToPath as kar}from"url";import{lstatSync as war,readdir as Par,readdirSync as Nar,readlinkSync as Iar,realpathSync as Oar}from"fs";import*as Far from"fs";import{lstat as Rar,readdir as Mar,readlink as jar,realpath as Bar}from"fs/promises";import{EventEmitter as yNe}from"events";import uft from"stream";import{StringDecoder as har}from"string_decoder";var aft=typeof process=="object"&&process?process:{stdout:null,stderr:null},gar=t(a=>!!a&&typeof a=="object"&&(a instanceof SN||a instanceof uft||yar(a)||bar(a)),"isStream"),yar=t(a=>!!a&&typeof a=="object"&&a instanceof yNe&&typeof a.pipe=="function"&&a.pipe!==uft.Writable.prototype.pipe,"isReadable"),bar=t(a=>!!a&&typeof a=="object"&&a instanceof yNe&&typeof a.write=="function"&&typeof a.end=="function","isWritable"),i6=Symbol("EOF"),s6=Symbol("maybeEmitEnd"),bN=Symbol("emittedEnd"),Que=Symbol("emittingEnd"),gQ=Symbol("emittedError"),Kue=Symbol("closed"),oft=Symbol("read"),Yue=Symbol("flush"),cft=Symbol("flushChunk"),Ex=Symbol("encoding"),Zj=Symbol("decoder"),d0=Symbol("flowing"),yQ=Symbol("paused"),eB=Symbol("resume"),m0=Symbol("buffer"),Ev=Symbol("pipes"),h0=Symbol("bufferLength"),_Ne=Symbol("bufferPush"),Xue=Symbol("bufferShift"),r1=Symbol("objectMode"),uh=Symbol("destroyed"),pNe=Symbol("error"),dNe=Symbol("emitData"),lft=Symbol("emitEnd"),mNe=Symbol("emitEnd2"),ZA=Symbol("async"),hNe=Symbol("abort"),Zue=Symbol("aborted"),vQ=Symbol("signal"),WF=Symbol("dataListeners"),kS=Symbol("discarded"),bQ=t(a=>Promise.resolve().then(a),"defer"),Sar=t(a=>a(),"nodefer"),Tar=t(a=>a==="end"||a==="finish"||a==="prefinish","isEndish"),Car=t(a=>a instanceof ArrayBuffer||!!a&&typeof a=="object"&&a.constructor&&a.constructor.name==="ArrayBuffer"&&a.byteLength>=0,"isArrayBufferLike"),Ear=t(a=>!Buffer.isBuffer(a)&&ArrayBuffer.isView(a),"isArrayBufferView"),efe=class{static{t(this,"Pipe")}src;dest;opts;ondrain;constructor(s,c,f){this.src=s,this.dest=c,this.opts=f,this.ondrain=()=>s[eB](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(s){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},gNe=class extends efe{static{t(this,"PipeProxyErrors")}unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(s,c,f){super(s,c,f),this.proxyErrors=d=>c.emit("error",d),s.on("error",this.proxyErrors)}},xar=t(a=>!!a.objectMode,"isObjectModeOptions"),Dar=t(a=>!a.objectMode&&!!a.encoding&&a.encoding!=="buffer","isEncodingOptions"),SN=class extends yNe{static{t(this,"Minipass")}[d0]=!1;[yQ]=!1;[Ev]=[];[m0]=[];[r1];[Ex];[ZA];[Zj];[i6]=!1;[bN]=!1;[Que]=!1;[Kue]=!1;[gQ]=null;[h0]=0;[uh]=!1;[vQ];[Zue]=!1;[WF]=0;[kS]=!1;writable=!0;readable=!0;constructor(...s){let c=s[0]||{};if(super(),c.objectMode&&typeof c.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");xar(c)?(this[r1]=!0,this[Ex]=null):Dar(c)?(this[Ex]=c.encoding,this[r1]=!1):(this[r1]=!1,this[Ex]=null),this[ZA]=!!c.async,this[Zj]=this[Ex]?new har(this[Ex]):null,c&&c.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:t(()=>this[m0],"get")}),c&&c.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:t(()=>this[Ev],"get")});let{signal:f}=c;f&&(this[vQ]=f,f.aborted?this[hNe]():f.addEventListener("abort",()=>this[hNe]()))}get bufferLength(){return this[h0]}get encoding(){return this[Ex]}set encoding(s){throw new Error("Encoding must be set at instantiation time")}setEncoding(s){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[r1]}set objectMode(s){throw new Error("objectMode must be set at instantiation time")}get async(){return this[ZA]}set async(s){this[ZA]=this[ZA]||!!s}[hNe](){this[Zue]=!0,this.emit("abort",this[vQ]?.reason),this.destroy(this[vQ]?.reason)}get aborted(){return this[Zue]}set aborted(s){}write(s,c,f){if(this[Zue])return!1;if(this[i6])throw new Error("write after end");if(this[uh])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof c=="function"&&(f=c,c="utf8"),c||(c="utf8");let d=this[ZA]?bQ:Sar;if(!this[r1]&&!Buffer.isBuffer(s)){if(Ear(s))s=Buffer.from(s.buffer,s.byteOffset,s.byteLength);else if(Car(s))s=Buffer.from(s);else if(typeof s!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[r1]?(this[d0]&&this[h0]!==0&&this[Yue](!0),this[d0]?this.emit("data",s):this[_Ne](s),this[h0]!==0&&this.emit("readable"),f&&d(f),this[d0]):s.length?(typeof s=="string"&&!(c===this[Ex]&&!this[Zj]?.lastNeed)&&(s=Buffer.from(s,c)),Buffer.isBuffer(s)&&this[Ex]&&(s=this[Zj].write(s)),this[d0]&&this[h0]!==0&&this[Yue](!0),this[d0]?this.emit("data",s):this[_Ne](s),this[h0]!==0&&this.emit("readable"),f&&d(f),this[d0]):(this[h0]!==0&&this.emit("readable"),f&&d(f),this[d0])}read(s){if(this[uh])return null;if(this[kS]=!1,this[h0]===0||s===0||s&&s>this[h0])return this[s6](),null;this[r1]&&(s=null),this[m0].length>1&&!this[r1]&&(this[m0]=[this[Ex]?this[m0].join(""):Buffer.concat(this[m0],this[h0])]);let c=this[oft](s||null,this[m0][0]);return this[s6](),c}[oft](s,c){if(this[r1])this[Xue]();else{let f=c;s===f.length||s===null?this[Xue]():typeof f=="string"?(this[m0][0]=f.slice(s),c=f.slice(0,s),this[h0]-=s):(this[m0][0]=f.subarray(s),c=f.subarray(0,s),this[h0]-=s)}return this.emit("data",c),!this[m0].length&&!this[i6]&&this.emit("drain"),c}end(s,c,f){return typeof s=="function"&&(f=s,s=void 0),typeof c=="function"&&(f=c,c="utf8"),s!==void 0&&this.write(s,c),f&&this.once("end",f),this[i6]=!0,this.writable=!1,(this[d0]||!this[yQ])&&this[s6](),this}[eB](){this[uh]||(!this[WF]&&!this[Ev].length&&(this[kS]=!0),this[yQ]=!1,this[d0]=!0,this.emit("resume"),this[m0].length?this[Yue]():this[i6]?this[s6]():this.emit("drain"))}resume(){return this[eB]()}pause(){this[d0]=!1,this[yQ]=!0,this[kS]=!1}get destroyed(){return this[uh]}get flowing(){return this[d0]}get paused(){return this[yQ]}[_Ne](s){this[r1]?this[h0]+=1:this[h0]+=s.length,this[m0].push(s)}[Xue](){return this[r1]?this[h0]-=1:this[h0]-=this[m0][0].length,this[m0].shift()}[Yue](s=!1){do;while(this[cft](this[Xue]())&&this[m0].length);!s&&!this[m0].length&&!this[i6]&&this.emit("drain")}[cft](s){return this.emit("data",s),this[d0]}pipe(s,c){if(this[uh])return s;this[kS]=!1;let f=this[bN];return c=c||{},s===aft.stdout||s===aft.stderr?c.end=!1:c.end=c.end!==!1,c.proxyErrors=!!c.proxyErrors,f?c.end&&s.end():(this[Ev].push(c.proxyErrors?new gNe(this,s,c):new efe(this,s,c)),this[ZA]?bQ(()=>this[eB]()):this[eB]()),s}unpipe(s){let c=this[Ev].find(f=>f.dest===s);c&&(this[Ev].length===1?(this[d0]&&this[WF]===0&&(this[d0]=!1),this[Ev]=[]):this[Ev].splice(this[Ev].indexOf(c),1),c.unpipe())}addListener(s,c){return this.on(s,c)}on(s,c){let f=super.on(s,c);if(s==="data")this[kS]=!1,this[WF]++,!this[Ev].length&&!this[d0]&&this[eB]();else if(s==="readable"&&this[h0]!==0)super.emit("readable");else if(Tar(s)&&this[bN])super.emit(s),this.removeAllListeners(s);else if(s==="error"&&this[gQ]){let d=c;this[ZA]?bQ(()=>d.call(this,this[gQ])):d.call(this,this[gQ])}return f}removeListener(s,c){return this.off(s,c)}off(s,c){let f=super.off(s,c);return s==="data"&&(this[WF]=this.listeners("data").length,this[WF]===0&&!this[kS]&&!this[Ev].length&&(this[d0]=!1)),f}removeAllListeners(s){let c=super.removeAllListeners(s);return(s==="data"||s===void 0)&&(this[WF]=0,!this[kS]&&!this[Ev].length&&(this[d0]=!1)),c}get emittedEnd(){return this[bN]}[s6](){!this[Que]&&!this[bN]&&!this[uh]&&this[m0].length===0&&this[i6]&&(this[Que]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Kue]&&this.emit("close"),this[Que]=!1)}emit(s,...c){let f=c[0];if(s!=="error"&&s!=="close"&&s!==uh&&this[uh])return!1;if(s==="data")return!this[r1]&&!f?!1:this[ZA]?(bQ(()=>this[dNe](f)),!0):this[dNe](f);if(s==="end")return this[lft]();if(s==="close"){if(this[Kue]=!0,!this[bN]&&!this[uh])return!1;let v=super.emit("close");return this.removeAllListeners("close"),v}else if(s==="error"){this[gQ]=f,super.emit(pNe,f);let v=!this[vQ]||this.listeners("error").length?super.emit("error",f):!1;return this[s6](),v}else if(s==="resume"){let v=super.emit("resume");return this[s6](),v}else if(s==="finish"||s==="prefinish"){let v=super.emit(s);return this.removeAllListeners(s),v}let d=super.emit(s,...c);return this[s6](),d}[dNe](s){for(let f of this[Ev])f.dest.write(s)===!1&&this.pause();let c=this[kS]?!1:super.emit("data",s);return this[s6](),c}[lft](){return this[bN]?!1:(this[bN]=!0,this.readable=!1,this[ZA]?(bQ(()=>this[mNe]()),!0):this[mNe]())}[mNe](){if(this[Zj]){let c=this[Zj].end();if(c){for(let f of this[Ev])f.dest.write(c);this[kS]||super.emit("data",c)}}for(let c of this[Ev])c.end();let s=super.emit("end");return this.removeAllListeners("end"),s}async collect(){let s=Object.assign([],{dataLength:0});this[r1]||(s.dataLength=0);let c=this.promise();return this.on("data",f=>{s.push(f),this[r1]||(s.dataLength+=f.length)}),await c,s}async concat(){if(this[r1])throw new Error("cannot concat in objectMode");let s=await this.collect();return this[Ex]?s.join(""):Buffer.concat(s,s.dataLength)}async promise(){return new Promise((s,c)=>{this.on(uh,()=>c(new Error("stream destroyed"))),this.on("error",f=>c(f)),this.on("end",()=>s())})}[Symbol.asyncIterator](){this[kS]=!1;let s=!1,c=t(async()=>(this.pause(),s=!0,{value:void 0,done:!0}),"stop");return{next:t(()=>{if(s)return c();let d=this.read();if(d!==null)return Promise.resolve({done:!1,value:d});if(this[i6])return c();let v,E,A=t($=>{this.off("data",O),this.off("end",R),this.off(uh,W),c(),E($)},"onerr"),O=t($=>{this.off("error",A),this.off("end",R),this.off(uh,W),this.pause(),v({value:$,done:!!this[i6]})},"ondata"),R=t(()=>{this.off("error",A),this.off("data",O),this.off(uh,W),c(),v({done:!0,value:void 0})},"onend"),W=t(()=>A(new Error("stream destroyed")),"ondestroy");return new Promise(($,K)=>{E=K,v=$,this.once(uh,W),this.once("error",A),this.once("end",R),this.once("data",O)})},"next"),throw:c,return:c,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[kS]=!1;let s=!1,c=t(()=>(this.pause(),this.off(pNe,c),this.off(uh,c),this.off("end",c),s=!0,{done:!0,value:void 0}),"stop"),f=t(()=>{if(s)return c();let d=this.read();return d===null?c():{done:!1,value:d}},"next");return this.once("end",c),this.once(pNe,c),this.once(uh,c),{next:f,throw:c,return:c,[Symbol.iterator](){return this}}}destroy(s){if(this[uh])return s?this.emit("error",s):this.emit(uh),this;this[uh]=!0,this[kS]=!0,this[m0].length=0,this[h0]=0;let c=this;return typeof c.close=="function"&&!this[Kue]&&c.close(),s?this.emit("error",s):this.emit(uh),this}static get isStream(){return gar}};var Lar=Oar.native,TQ={lstatSync:war,readdir:Par,readdirSync:Nar,readlinkSync:Iar,realpathSync:Lar,promises:{lstat:Rar,readdir:Mar,readlink:jar,realpath:Bar}},mft=t(a=>!a||a===TQ||a===Far?TQ:{...TQ,...a,promises:{...TQ.promises,...a.promises||{}}},"fsFromOption"),hft=/^\\\\\?\\([a-z]:)\\?$/i,Uar=t(a=>a.replace(/\//g,"\\").replace(hft,"$1\\"),"uncToDrive"),$ar=/[\\\/]/,mC=0,gft=1,yft=2,ek=4,vft=6,bft=8,HF=10,Sft=12,dC=15,SQ=~dC,vNe=16,fft=32,CQ=64,xx=128,tfe=256,nfe=512,_ft=CQ|xx|nfe,Jar=1023,bNe=t(a=>a.isFile()?bft:a.isDirectory()?ek:a.isSymbolicLink()?HF:a.isCharacterDevice()?yft:a.isBlockDevice()?vft:a.isSocket()?Sft:a.isFIFO()?gft:mC,"entToType"),pft=new Map,EQ=t(a=>{let s=pft.get(a);if(s)return s;let c=a.normalize("NFKD");return pft.set(a,c),c},"normalize"),dft=new Map,rfe=t(a=>{let s=dft.get(a);if(s)return s;let c=EQ(a.toLowerCase());return dft.set(a,c),c},"normalizeNocase"),ife=class extends hQ{static{t(this,"ResolveCache")}constructor(){super({max:256})}},TNe=class extends hQ{static{t(this,"ChildrenCache")}constructor(s=16*1024){super({maxSize:s,sizeCalculation:t(c=>c.length+1,"sizeCalculation")})}},Tft=Symbol("PathScurry setAsCwd"),n1=class{static{t(this,"PathBase")}name;root;roots;parent;nocase;isCWD=!1;#r;#n;get dev(){return this.#n}#e;get mode(){return this.#e}#t;get nlink(){return this.#t}#s;get uid(){return this.#s}#p;get gid(){return this.#p}#a;get rdev(){return this.#a}#_;get blksize(){return this.#_}#c;get ino(){return this.#c}#l;get size(){return this.#l}#i;get blocks(){return this.#i}#f;get atimeMs(){return this.#f}#v;get mtimeMs(){return this.#v}#d;get ctimeMs(){return this.#d}#u;get birthtimeMs(){return this.#u}#m;get atime(){return this.#m}#g;get mtime(){return this.#g}#x;get ctime(){return this.#x}#C;get birthtime(){return this.#C}#b;#A;#E;#y;#D;#k;#o;#N;#S;#T;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(s,c=mC,f,d,v,E,A){this.name=s,this.#b=v?rfe(s):EQ(s),this.#o=c&Jar,this.nocase=v,this.roots=d,this.root=f||this,this.#N=E,this.#E=A.fullpath,this.#D=A.relative,this.#k=A.relativePosix,this.parent=A.parent,this.parent?this.#r=this.parent.#r:this.#r=mft(A.fs)}depth(){return this.#A!==void 0?this.#A:this.parent?this.#A=this.parent.depth()+1:this.#A=0}childrenCache(){return this.#N}resolve(s){if(!s)return this;let c=this.getRootString(s),d=s.substring(c.length).split(this.splitSep);return c?this.getRoot(c).#I(d):this.#I(d)}#I(s){let c=this;for(let f of s)c=c.child(f);return c}children(){let s=this.#N.get(this);if(s)return s;let c=Object.assign([],{provisional:0});return this.#N.set(this,c),this.#o&=~vNe,c}child(s,c){if(s===""||s===".")return this;if(s==="..")return this.parent||this;let f=this.children(),d=this.nocase?rfe(s):EQ(s);for(let O of f)if(O.#b===d)return O;let v=this.parent?this.sep:"",E=this.#E?this.#E+v+s:void 0,A=this.newChild(s,mC,{...c,parent:this,fullpath:E});return this.canReaddir()||(A.#o|=xx),f.push(A),A}relative(){if(this.isCWD)return"";if(this.#D!==void 0)return this.#D;let s=this.name,c=this.parent;if(!c)return this.#D=this.name;let f=c.relative();return f+(!f||!c.parent?"":this.sep)+s}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#k!==void 0)return this.#k;let s=this.name,c=this.parent;if(!c)return this.#k=this.fullpathPosix();let f=c.relativePosix();return f+(!f||!c.parent?"":"/")+s}fullpath(){if(this.#E!==void 0)return this.#E;let s=this.name,c=this.parent;if(!c)return this.#E=this.name;let d=c.fullpath()+(c.parent?this.sep:"")+s;return this.#E=d}fullpathPosix(){if(this.#y!==void 0)return this.#y;if(this.sep==="/")return this.#y=this.fullpath();if(!this.parent){let d=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(d)?this.#y=`//?/${d}`:this.#y=d}let s=this.parent,c=s.fullpathPosix(),f=c+(!c||!s.parent?"":"/")+this.name;return this.#y=f}isUnknown(){return(this.#o&dC)===mC}isType(s){return this[`is${s}`]()}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(this.#o&dC)===bft}isDirectory(){return(this.#o&dC)===ek}isCharacterDevice(){return(this.#o&dC)===yft}isBlockDevice(){return(this.#o&dC)===vft}isFIFO(){return(this.#o&dC)===gft}isSocket(){return(this.#o&dC)===Sft}isSymbolicLink(){return(this.#o&HF)===HF}lstatCached(){return this.#o&fft?this:void 0}readlinkCached(){return this.#S}realpathCached(){return this.#T}readdirCached(){let s=this.children();return s.slice(0,s.provisional)}canReadlink(){if(this.#S)return!0;if(!this.parent)return!1;let s=this.#o&dC;return!(s!==mC&&s!==HF||this.#o&tfe||this.#o&xx)}calledReaddir(){return!!(this.#o&vNe)}isENOENT(){return!!(this.#o&xx)}isNamed(s){return this.nocase?this.#b===rfe(s):this.#b===EQ(s)}async readlink(){let s=this.#S;if(s)return s;if(this.canReadlink()&&this.parent)try{let c=await this.#r.promises.readlink(this.fullpath()),f=(await this.parent.realpath())?.resolve(c);if(f)return this.#S=f}catch(c){this.#h(c.code);return}}readlinkSync(){let s=this.#S;if(s)return s;if(this.canReadlink()&&this.parent)try{let c=this.#r.readlinkSync(this.fullpath()),f=this.parent.realpathSync()?.resolve(c);if(f)return this.#S=f}catch(c){this.#h(c.code);return}}#F(s){this.#o|=vNe;for(let c=s.provisional;c<s.length;c++){let f=s[c];f&&f.#L()}}#L(){this.#o&xx||(this.#o=(this.#o|xx)&SQ,this.#w())}#w(){let s=this.children();s.provisional=0;for(let c of s)c.#L()}#P(){this.#o|=nfe,this.#R()}#R(){if(this.#o&CQ)return;let s=this.#o;(s&dC)===ek&&(s&=SQ),this.#o=s|CQ,this.#w()}#M(s=""){s==="ENOTDIR"||s==="EPERM"?this.#R():s==="ENOENT"?this.#L():this.children().provisional=0}#j(s=""){s==="ENOTDIR"?this.parent.#R():s==="ENOENT"&&this.#L()}#h(s=""){let c=this.#o;c|=tfe,s==="ENOENT"&&(c|=xx),(s==="EINVAL"||s==="UNKNOWN")&&(c&=SQ),this.#o=c,s==="ENOTDIR"&&this.parent&&this.parent.#R()}#B(s,c){return this.#O(s,c)||this.#U(s,c)}#U(s,c){let f=bNe(s),d=this.newChild(s.name,f,{parent:this}),v=d.#o&dC;return v!==ek&&v!==HF&&v!==mC&&(d.#o|=CQ),c.unshift(d),c.provisional++,d}#O(s,c){for(let f=c.provisional;f<c.length;f++){let d=c[f];if((this.nocase?rfe(s.name):EQ(s.name))===d.#b)return this.#$(s,d,f,c)}}#$(s,c,f,d){let v=c.name;return c.#o=c.#o&SQ|bNe(s),v!==s.name&&(c.name=s.name),f!==d.provisional&&(f===d.length-1?d.pop():d.splice(f,1),d.unshift(c)),d.provisional++,c}async lstat(){if(!(this.#o&xx))try{return this.#V(await this.#r.promises.lstat(this.fullpath())),this}catch(s){this.#j(s.code)}}lstatSync(){if(!(this.#o&xx))try{return this.#V(this.#r.lstatSync(this.fullpath())),this}catch(s){this.#j(s.code)}}#V(s){let{atime:c,atimeMs:f,birthtime:d,birthtimeMs:v,blksize:E,blocks:A,ctime:O,ctimeMs:R,dev:W,gid:$,ino:K,mode:Ne,mtime:De,mtimeMs:Se,nlink:Tt,rdev:xt,size:vr,uid:Tr}=s;this.#m=c,this.#f=f,this.#C=d,this.#u=v,this.#_=E,this.#i=A,this.#x=O,this.#d=R,this.#n=W,this.#p=$,this.#c=K,this.#e=Ne,this.#g=De,this.#v=Se,this.#t=Tt,this.#a=xt,this.#l=vr,this.#s=Tr;let Nr=bNe(s);this.#o=this.#o&SQ|Nr|fft,Nr!==mC&&Nr!==ek&&Nr!==HF&&(this.#o|=CQ)}#z=[];#q=!1;#W(s){this.#q=!1;let c=this.#z.slice();this.#z.length=0,c.forEach(f=>f(null,s))}readdirCB(s,c=!1){if(!this.canReaddir()){c?s(null,[]):queueMicrotask(()=>s(null,[]));return}let f=this.children();if(this.calledReaddir()){let v=f.slice(0,f.provisional);c?s(null,v):queueMicrotask(()=>s(null,v));return}if(this.#z.push(s),this.#q)return;this.#q=!0;let d=this.fullpath();this.#r.readdir(d,{withFileTypes:!0},(v,E)=>{if(v)this.#M(v.code),f.provisional=0;else{for(let A of E)this.#B(A,f);this.#F(f)}this.#W(f.slice(0,f.provisional))})}#J;async readdir(){if(!this.canReaddir())return[];let s=this.children();if(this.calledReaddir())return s.slice(0,s.provisional);let c=this.fullpath();if(this.#J)await this.#J;else{let f=t(()=>{},"resolve");this.#J=new Promise(d=>f=d);try{for(let d of await this.#r.promises.readdir(c,{withFileTypes:!0}))this.#B(d,s);this.#F(s)}catch(d){this.#M(d.code),s.provisional=0}this.#J=void 0,f()}return s.slice(0,s.provisional)}readdirSync(){if(!this.canReaddir())return[];let s=this.children();if(this.calledReaddir())return s.slice(0,s.provisional);let c=this.fullpath();try{for(let f of this.#r.readdirSync(c,{withFileTypes:!0}))this.#B(f,s);this.#F(s)}catch(f){this.#M(f.code),s.provisional=0}return s.slice(0,s.provisional)}canReaddir(){if(this.#o&_ft)return!1;let s=dC&this.#o;return s===mC||s===ek||s===HF}shouldWalk(s,c){return(this.#o&ek)===ek&&!(this.#o&_ft)&&!s.has(this)&&(!c||c(this))}async realpath(){if(this.#T)return this.#T;if(!((nfe|tfe|xx)&this.#o))try{let s=await this.#r.promises.realpath(this.fullpath());return this.#T=this.resolve(s)}catch{this.#P()}}realpathSync(){if(this.#T)return this.#T;if(!((nfe|tfe|xx)&this.#o))try{let s=this.#r.realpathSync(this.fullpath());return this.#T=this.resolve(s)}catch{this.#P()}}[Tft](s){if(s===this)return;s.isCWD=!1,this.isCWD=!0;let c=new Set([]),f=[],d=this;for(;d&&d.parent;)c.add(d),d.#D=f.join(this.sep),d.#k=f.join("/"),d=d.parent,f.push("..");for(d=s;d&&d.parent&&!c.has(d);)d.#D=void 0,d.#k=void 0,d=d.parent}},sfe=class a extends n1{static{t(this,"PathWin32")}sep="\\";splitSep=$ar;constructor(s,c=mC,f,d,v,E,A){super(s,c,f,d,v,E,A)}newChild(s,c=mC,f={}){return new a(s,c,this.root,this.roots,this.nocase,this.childrenCache(),f)}getRootString(s){return SNe.parse(s).root}getRoot(s){if(s=Uar(s.toUpperCase()),s===this.root.name)return this.root;for(let[c,f]of Object.entries(this.roots))if(this.sameRoot(s,c))return this.roots[s]=f;return this.roots[s]=new tB(s,this).root}sameRoot(s,c=this.root.name){return s=s.toUpperCase().replace(/\//g,"\\").replace(hft,"$1\\"),s===c}},afe=class a extends n1{static{t(this,"PathPosix")}splitSep="/";sep="/";constructor(s,c=mC,f,d,v,E,A){super(s,c,f,d,v,E,A)}getRootString(s){return s.startsWith("/")?"/":""}getRoot(s){return this.root}newChild(s,c=mC,f={}){return new a(s,c,this.root,this.roots,this.nocase,this.childrenCache(),f)}},ofe=class{static{t(this,"PathScurryBase")}root;rootPath;roots;cwd;#r;#n;#e;nocase;#t;constructor(s=process.cwd(),c,f,{nocase:d,childrenCacheSize:v=16*1024,fs:E=TQ}={}){this.#t=mft(E),(s instanceof URL||s.startsWith("file://"))&&(s=kar(s));let A=c.resolve(s);this.roots=Object.create(null),this.rootPath=this.parseRootPath(A),this.#r=new ife,this.#n=new ife,this.#e=new TNe(v);let O=A.substring(this.rootPath.length).split(f);if(O.length===1&&!O[0]&&O.pop(),d===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=d,this.root=this.newRoot(this.#t),this.roots[this.rootPath]=this.root;let R=this.root,W=O.length-1,$=c.sep,K=this.rootPath,Ne=!1;for(let De of O){let Se=W--;R=R.child(De,{relative:new Array(Se).fill("..").join($),relativePosix:new Array(Se).fill("..").join("/"),fullpath:K+=(Ne?"":$)+De}),Ne=!0}this.cwd=R}depth(s=this.cwd){return typeof s=="string"&&(s=this.cwd.resolve(s)),s.depth()}childrenCache(){return this.#e}resolve(...s){let c="";for(let v=s.length-1;v>=0;v--){let E=s[v];if(!(!E||E===".")&&(c=c?`${E}/${c}`:E,this.isAbsolute(E)))break}let f=this.#r.get(c);if(f!==void 0)return f;let d=this.cwd.resolve(c).fullpath();return this.#r.set(c,d),d}resolvePosix(...s){let c="";for(let v=s.length-1;v>=0;v--){let E=s[v];if(!(!E||E===".")&&(c=c?`${E}/${c}`:E,this.isAbsolute(E)))break}let f=this.#n.get(c);if(f!==void 0)return f;let d=this.cwd.resolve(c).fullpathPosix();return this.#n.set(c,d),d}relative(s=this.cwd){return typeof s=="string"&&(s=this.cwd.resolve(s)),s.relative()}relativePosix(s=this.cwd){return typeof s=="string"&&(s=this.cwd.resolve(s)),s.relativePosix()}basename(s=this.cwd){return typeof s=="string"&&(s=this.cwd.resolve(s)),s.name}dirname(s=this.cwd){return typeof s=="string"&&(s=this.cwd.resolve(s)),(s.parent||s).fullpath()}async readdir(s=this.cwd,c={withFileTypes:!0}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof n1||(c=s,s=this.cwd);let{withFileTypes:f}=c;if(s.canReaddir()){let d=await s.readdir();return f?d:d.map(v=>v.name)}else return[]}readdirSync(s=this.cwd,c={withFileTypes:!0}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof n1||(c=s,s=this.cwd);let{withFileTypes:f=!0}=c;return s.canReaddir()?f?s.readdirSync():s.readdirSync().map(d=>d.name):[]}async lstat(s=this.cwd){return typeof s=="string"&&(s=this.cwd.resolve(s)),s.lstat()}lstatSync(s=this.cwd){return typeof s=="string"&&(s=this.cwd.resolve(s)),s.lstatSync()}async readlink(s=this.cwd,{withFileTypes:c}={withFileTypes:!1}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof n1||(c=s.withFileTypes,s=this.cwd);let f=await s.readlink();return c?f:f?.fullpath()}readlinkSync(s=this.cwd,{withFileTypes:c}={withFileTypes:!1}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof n1||(c=s.withFileTypes,s=this.cwd);let f=s.readlinkSync();return c?f:f?.fullpath()}async realpath(s=this.cwd,{withFileTypes:c}={withFileTypes:!1}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof n1||(c=s.withFileTypes,s=this.cwd);let f=await s.realpath();return c?f:f?.fullpath()}realpathSync(s=this.cwd,{withFileTypes:c}={withFileTypes:!1}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof n1||(c=s.withFileTypes,s=this.cwd);let f=s.realpathSync();return c?f:f?.fullpath()}async walk(s=this.cwd,c={}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof n1||(c=s,s=this.cwd);let{withFileTypes:f=!0,follow:d=!1,filter:v,walkFilter:E}=c,A=[];(!v||v(s))&&A.push(f?s:s.fullpath());let O=new Set,R=t(($,K)=>{O.add($),$.readdirCB((Ne,De)=>{if(Ne)return K(Ne);let Se=De.length;if(!Se)return K();let Tt=t(()=>{--Se===0&&K()},"next");for(let xt of De)(!v||v(xt))&&A.push(f?xt:xt.fullpath()),d&&xt.isSymbolicLink()?xt.realpath().then(vr=>vr?.isUnknown()?vr.lstat():vr).then(vr=>vr?.shouldWalk(O,E)?R(vr,Tt):Tt()):xt.shouldWalk(O,E)?R(xt,Tt):Tt()},!0)},"walk"),W=s;return new Promise(($,K)=>{R(W,Ne=>{if(Ne)return K(Ne);$(A)})})}walkSync(s=this.cwd,c={}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof n1||(c=s,s=this.cwd);let{withFileTypes:f=!0,follow:d=!1,filter:v,walkFilter:E}=c,A=[];(!v||v(s))&&A.push(f?s:s.fullpath());let O=new Set([s]);for(let R of O){let W=R.readdirSync();for(let $ of W){(!v||v($))&&A.push(f?$:$.fullpath());let K=$;if($.isSymbolicLink()){if(!(d&&(K=$.realpathSync())))continue;K.isUnknown()&&K.lstatSync()}K.shouldWalk(O,E)&&O.add(K)}}return A}[Symbol.asyncIterator](){return this.iterate()}iterate(s=this.cwd,c={}){return typeof s=="string"?s=this.cwd.resolve(s):s instanceof n1||(c=s,s=this.cwd),this.stream(s,c)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(s=this.cwd,c={}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof n1||(c=s,s=this.cwd);let{withFileTypes:f=!0,follow:d=!1,filter:v,walkFilter:E}=c;(!v||v(s))&&(yield f?s:s.fullpath());let A=new Set([s]);for(let O of A){let R=O.readdirSync();for(let W of R){(!v||v(W))&&(yield f?W:W.fullpath());let $=W;if(W.isSymbolicLink()){if(!(d&&($=W.realpathSync())))continue;$.isUnknown()&&$.lstatSync()}$.shouldWalk(A,E)&&A.add($)}}}stream(s=this.cwd,c={}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof n1||(c=s,s=this.cwd);let{withFileTypes:f=!0,follow:d=!1,filter:v,walkFilter:E}=c,A=new SN({objectMode:!0});(!v||v(s))&&A.write(f?s:s.fullpath());let O=new Set,R=[s],W=0,$=t(()=>{let K=!1;for(;!K;){let Ne=R.shift();if(!Ne){W===0&&A.end();return}W++,O.add(Ne);let De=t((Tt,xt,vr=!1)=>{if(Tt)return A.emit("error",Tt);if(d&&!vr){let Tr=[];for(let Nr of xt)Nr.isSymbolicLink()&&Tr.push(Nr.realpath().then(Cr=>Cr?.isUnknown()?Cr.lstat():Cr));if(Tr.length){Promise.all(Tr).then(()=>De(null,xt,!0));return}}for(let Tr of xt)Tr&&(!v||v(Tr))&&(A.write(f?Tr:Tr.fullpath())||(K=!0));W--;for(let Tr of xt){let Nr=Tr.realpathCached()||Tr;Nr.shouldWalk(O,E)&&R.push(Nr)}K&&!A.flowing?A.once("drain",$):Se||$()},"onReaddir"),Se=!0;Ne.readdirCB(De,!0),Se=!1}},"process");return $(),A}streamSync(s=this.cwd,c={}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof n1||(c=s,s=this.cwd);let{withFileTypes:f=!0,follow:d=!1,filter:v,walkFilter:E}=c,A=new SN({objectMode:!0}),O=new Set;(!v||v(s))&&A.write(f?s:s.fullpath());let R=[s],W=0,$=t(()=>{let K=!1;for(;!K;){let Ne=R.shift();if(!Ne){W===0&&A.end();return}W++,O.add(Ne);let De=Ne.readdirSync();for(let Se of De)(!v||v(Se))&&(A.write(f?Se:Se.fullpath())||(K=!0));W--;for(let Se of De){let Tt=Se;if(Se.isSymbolicLink()){if(!(d&&(Tt=Se.realpathSync())))continue;Tt.isUnknown()&&Tt.lstatSync()}Tt.shouldWalk(O,E)&&R.push(Tt)}}K&&!A.flowing&&A.once("drain",$)},"process");return $(),A}chdir(s=this.cwd){let c=this.cwd;this.cwd=typeof s=="string"?this.cwd.resolve(s):s,this.cwd[Tft](c)}},tB=class extends ofe{static{t(this,"PathScurryWin32")}sep="\\";constructor(s=process.cwd(),c={}){let{nocase:f=!0}=c;super(s,SNe,"\\",{...c,nocase:f}),this.nocase=f;for(let d=this.cwd;d;d=d.parent)d.nocase=this.nocase}parseRootPath(s){return SNe.parse(s).root.toUpperCase()}newRoot(s){return new sfe(this.rootPath,ek,void 0,this.roots,this.nocase,this.childrenCache(),{fs:s})}isAbsolute(s){return s.startsWith("/")||s.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(s)}},rB=class extends ofe{static{t(this,"PathScurryPosix")}sep="/";constructor(s=process.cwd(),c={}){let{nocase:f=!1}=c;super(s,Aar,"/",{...c,nocase:f}),this.nocase=f}parseRootPath(s){return"/"}newRoot(s){return new afe(this.rootPath,ek,void 0,this.roots,this.nocase,this.childrenCache(),{fs:s})}isAbsolute(s){return s.startsWith("/")}},xQ=class extends rB{static{t(this,"PathScurryDarwin")}constructor(s=process.cwd(),c={}){let{nocase:f=!0}=c;super(s,{...c,nocase:f})}},ORr=process.platform==="win32"?sfe:afe,Cft=process.platform==="win32"?tB:process.platform==="darwin"?xQ:rB;var zar=t(a=>a.length>=1,"isPatternList"),qar=t(a=>a.length>=1,"isGlobList"),nB=class a{static{t(this,"Pattern")}#r;#n;#e;length;#t;#s;#p;#a;#_;#c;#l=!0;constructor(s,c,f,d){if(!zar(s))throw new TypeError("empty pattern list");if(!qar(c))throw new TypeError("empty glob list");if(c.length!==s.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=s.length,f<0||f>=this.length)throw new TypeError("index out of range");if(this.#r=s,this.#n=c,this.#e=f,this.#t=d,this.#e===0){if(this.isUNC()){let[v,E,A,O,...R]=this.#r,[W,$,K,Ne,...De]=this.#n;R[0]===""&&(R.shift(),De.shift());let Se=[v,E,A,O,""].join("/"),Tt=[W,$,K,Ne,""].join("/");this.#r=[Se,...R],this.#n=[Tt,...De],this.length=this.#r.length}else if(this.isDrive()||this.isAbsolute()){let[v,...E]=this.#r,[A,...O]=this.#n;E[0]===""&&(E.shift(),O.shift());let R=v+"/",W=A+"/";this.#r=[R,...E],this.#n=[W,...O],this.length=this.#r.length}}}pattern(){return this.#r[this.#e]}isString(){return typeof this.#r[this.#e]=="string"}isGlobstar(){return this.#r[this.#e]===ry}isRegExp(){return this.#r[this.#e]instanceof RegExp}globString(){return this.#p=this.#p||(this.#e===0?this.isAbsolute()?this.#n[0]+this.#n.slice(1).join("/"):this.#n.join("/"):this.#n.slice(this.#e).join("/"))}hasMore(){return this.length>this.#e+1}rest(){return this.#s!==void 0?this.#s:this.hasMore()?(this.#s=new a(this.#r,this.#n,this.#e+1,this.#t),this.#s.#c=this.#c,this.#s.#_=this.#_,this.#s.#a=this.#a,this.#s):this.#s=null}isUNC(){let s=this.#r;return this.#_!==void 0?this.#_:this.#_=this.#t==="win32"&&this.#e===0&&s[0]===""&&s[1]===""&&typeof s[2]=="string"&&!!s[2]&&typeof s[3]=="string"&&!!s[3]}isDrive(){let s=this.#r;return this.#a!==void 0?this.#a:this.#a=this.#t==="win32"&&this.#e===0&&this.length>1&&typeof s[0]=="string"&&/^[a-z]:$/i.test(s[0])}isAbsolute(){let s=this.#r;return this.#c!==void 0?this.#c:this.#c=s[0]===""&&s.length>1||this.isDrive()||this.isUNC()}root(){let s=this.#r[0];return typeof s=="string"&&this.isAbsolute()&&this.#e===0?s:""}checkFollowGlobstar(){return!(this.#e===0||!this.isGlobstar()||!this.#l)}markFollowGlobstar(){return this.#e===0||!this.isGlobstar()||!this.#l?!1:(this.#l=!1,!0)}};var Var=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",iB=class{static{t(this,"Ignore")}relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(s,{nobrace:c,nocase:f,noext:d,noglobstar:v,platform:E=Var}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=E,this.mmopts={dot:!0,nobrace:c,nocase:f,noext:d,noglobstar:v,optimizationLevel:2,platform:E,nocomment:!0,nonegate:!0};for(let A of s)this.add(A)}add(s){let c=new AS(s,this.mmopts);for(let f=0;f<c.set.length;f++){let d=c.set[f],v=c.globParts[f];if(!d||!v)throw new Error("invalid pattern object");for(;d[0]==="."&&v[0]===".";)d.shift(),v.shift();let E=new nB(d,v,0,this.platform),A=new AS(E.globString(),this.mmopts),O=v[v.length-1]==="**",R=E.isAbsolute();R?this.absolute.push(A):this.relative.push(A),O&&(R?this.absoluteChildren.push(A):this.relativeChildren.push(A))}}ignored(s){let c=s.fullpath(),f=`${c}/`,d=s.relative()||".",v=`${d}/`;for(let E of this.relative)if(E.match(d)||E.match(v))return!0;for(let E of this.absolute)if(E.match(c)||E.match(f))return!0;return!1}childrenIgnored(s){let c=s.fullpath()+"/",f=(s.relative()||".")+"/";for(let d of this.relativeChildren)if(d.match(f))return!0;for(let d of this.absoluteChildren)if(d.match(c))return!0;return!1}};var CNe=class a{static{t(this,"HasWalkedCache")}store;constructor(s=new Map){this.store=s}copy(){return new a(new Map(this.store))}hasWalked(s,c){return this.store.get(s.fullpath())?.has(c.globString())}storeWalked(s,c){let f=s.fullpath(),d=this.store.get(f);d?d.add(c.globString()):this.store.set(f,new Set([c.globString()]))}},ENe=class{static{t(this,"MatchRecord")}store=new Map;add(s,c,f){let d=(c?2:0)|(f?1:0),v=this.store.get(s);this.store.set(s,v===void 0?d:d&v)}entries(){return[...this.store.entries()].map(([s,c])=>[s,!!(c&2),!!(c&1)])}},xNe=class{static{t(this,"SubWalks")}store=new Map;add(s,c){if(!s.canReaddir())return;let f=this.store.get(s);f?f.find(d=>d.globString()===c.globString())||f.push(c):this.store.set(s,[c])}get(s){let c=this.store.get(s);if(!c)throw new Error("attempting to walk unknown path");return c}entries(){return this.keys().map(s=>[s,this.store.get(s)])}keys(){return[...this.store.keys()].filter(s=>s.canReaddir())}},DQ=class a{static{t(this,"Processor")}hasWalkedCache;matches=new ENe;subwalks=new xNe;patterns;follow;dot;opts;constructor(s,c){this.opts=s,this.follow=!!s.follow,this.dot=!!s.dot,this.hasWalkedCache=c?c.copy():new CNe}processPatterns(s,c){this.patterns=c;let f=c.map(d=>[s,d]);for(let[d,v]of f){this.hasWalkedCache.storeWalked(d,v);let E=v.root(),A=v.isAbsolute()&&this.opts.absolute!==!1;if(E){d=d.resolve(E==="/"&&this.opts.root!==void 0?this.opts.root:E);let $=v.rest();if($)v=$;else{this.matches.add(d,!0,!1);continue}}if(d.isENOENT())continue;let O,R,W=!1;for(;typeof(O=v.pattern())=="string"&&(R=v.rest());)d=d.resolve(O),v=R,W=!0;if(O=v.pattern(),R=v.rest(),W){if(this.hasWalkedCache.hasWalked(d,v))continue;this.hasWalkedCache.storeWalked(d,v)}if(typeof O=="string"){let $=O===".."||O===""||O===".";this.matches.add(d.resolve(O),A,$);continue}else if(O===ry){(!d.isSymbolicLink()||this.follow||v.checkFollowGlobstar())&&this.subwalks.add(d,v);let $=R?.pattern(),K=R?.rest();if(!R||($===""||$===".")&&!K)this.matches.add(d,A,$===""||$===".");else if($===".."){let Ne=d.parent||d;K?this.hasWalkedCache.hasWalked(Ne,K)||this.subwalks.add(Ne,K):this.matches.add(Ne,A,!0)}}else O instanceof RegExp&&this.subwalks.add(d,v)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new a(this.opts,this.hasWalkedCache)}filterEntries(s,c){let f=this.subwalks.get(s),d=this.child();for(let v of c)for(let E of f){let A=E.isAbsolute(),O=E.pattern(),R=E.rest();O===ry?d.testGlobstar(v,E,R,A):O instanceof RegExp?d.testRegExp(v,O,R,A):d.testString(v,O,R,A)}return d}testGlobstar(s,c,f,d){if((this.dot||!s.name.startsWith("."))&&(c.hasMore()||this.matches.add(s,d,!1),s.canReaddir()&&(this.follow||!s.isSymbolicLink()?this.subwalks.add(s,c):s.isSymbolicLink()&&(f&&c.checkFollowGlobstar()?this.subwalks.add(s,f):c.markFollowGlobstar()&&this.subwalks.add(s,c)))),f){let v=f.pattern();if(typeof v=="string"&&v!==".."&&v!==""&&v!==".")this.testString(s,v,f.rest(),d);else if(v===".."){let E=s.parent||s;this.subwalks.add(E,f)}else v instanceof RegExp&&this.testRegExp(s,v,f.rest(),d)}}testRegExp(s,c,f,d){c.test(s.name)&&(f?this.subwalks.add(s,f):this.matches.add(s,d,!1))}testString(s,c,f,d){s.isNamed(c)&&(f?this.subwalks.add(s,f):this.matches.add(s,d,!1))}};var War=t((a,s)=>typeof a=="string"?new iB([a],s):Array.isArray(a)?new iB(a,s):a,"makeIgnore"),cfe=class{static{t(this,"GlobUtil")}path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#r=[];#n;#e;signal;maxDepth;includeChildMatches;constructor(s,c,f){if(this.patterns=s,this.path=c,this.opts=f,this.#e=!f.posix&&f.platform==="win32"?"\\":"/",this.includeChildMatches=f.includeChildMatches!==!1,(f.ignore||!this.includeChildMatches)&&(this.#n=War(f.ignore??[],f),!this.includeChildMatches&&typeof this.#n.add!="function")){let d="cannot ignore child matches, ignore lacks add() method.";throw new Error(d)}this.maxDepth=f.maxDepth||1/0,f.signal&&(this.signal=f.signal,this.signal.addEventListener("abort",()=>{this.#r.length=0}))}#t(s){return this.seen.has(s)||!!this.#n?.ignored?.(s)}#s(s){return!!this.#n?.childrenIgnored?.(s)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let s;for(;!this.paused&&(s=this.#r.shift());)s()}onResume(s){this.signal?.aborted||(this.paused?this.#r.push(s):s())}async matchCheck(s,c){if(c&&this.opts.nodir)return;let f;if(this.opts.realpath){if(f=s.realpathCached()||await s.realpath(),!f)return;s=f}let v=s.isUnknown()||this.opts.stat?await s.lstat():s;if(this.opts.follow&&this.opts.nodir&&v?.isSymbolicLink()){let E=await v.realpath();E&&(E.isUnknown()||this.opts.stat)&&await E.lstat()}return this.matchCheckTest(v,c)}matchCheckTest(s,c){return s&&(this.maxDepth===1/0||s.depth()<=this.maxDepth)&&(!c||s.canReaddir())&&(!this.opts.nodir||!s.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!s.isSymbolicLink()||!s.realpathCached()?.isDirectory())&&!this.#t(s)?s:void 0}matchCheckSync(s,c){if(c&&this.opts.nodir)return;let f;if(this.opts.realpath){if(f=s.realpathCached()||s.realpathSync(),!f)return;s=f}let v=s.isUnknown()||this.opts.stat?s.lstatSync():s;if(this.opts.follow&&this.opts.nodir&&v?.isSymbolicLink()){let E=v.realpathSync();E&&(E?.isUnknown()||this.opts.stat)&&E.lstatSync()}return this.matchCheckTest(v,c)}matchFinish(s,c){if(this.#t(s))return;if(!this.includeChildMatches&&this.#n?.add){let v=`${s.relativePosix()}/**`;this.#n.add(v)}let f=this.opts.absolute===void 0?c:this.opts.absolute;this.seen.add(s);let d=this.opts.mark&&s.isDirectory()?this.#e:"";if(this.opts.withFileTypes)this.matchEmit(s);else if(f){let v=this.opts.posix?s.fullpathPosix():s.fullpath();this.matchEmit(v+d)}else{let v=this.opts.posix?s.relativePosix():s.relative(),E=this.opts.dotRelative&&!v.startsWith(".."+this.#e)?"."+this.#e:"";this.matchEmit(v?E+v+d:"."+d)}}async match(s,c,f){let d=await this.matchCheck(s,f);d&&this.matchFinish(d,c)}matchSync(s,c,f){let d=this.matchCheckSync(s,f);d&&this.matchFinish(d,c)}walkCB(s,c,f){this.signal?.aborted&&f(),this.walkCB2(s,c,new DQ(this.opts),f)}walkCB2(s,c,f,d){if(this.#s(s))return d();if(this.signal?.aborted&&d(),this.paused){this.onResume(()=>this.walkCB2(s,c,f,d));return}f.processPatterns(s,c);let v=1,E=t(()=>{--v===0&&d()},"next");for(let[A,O,R]of f.matches.entries())this.#t(A)||(v++,this.match(A,O,R).then(()=>E()));for(let A of f.subwalkTargets()){if(this.maxDepth!==1/0&&A.depth()>=this.maxDepth)continue;v++;let O=A.readdirCached();A.calledReaddir()?this.walkCB3(A,O,f,E):A.readdirCB((R,W)=>this.walkCB3(A,W,f,E),!0)}E()}walkCB3(s,c,f,d){f=f.filterEntries(s,c);let v=1,E=t(()=>{--v===0&&d()},"next");for(let[A,O,R]of f.matches.entries())this.#t(A)||(v++,this.match(A,O,R).then(()=>E()));for(let[A,O]of f.subwalks.entries())v++,this.walkCB2(A,O,f.child(),E);E()}walkCBSync(s,c,f){this.signal?.aborted&&f(),this.walkCB2Sync(s,c,new DQ(this.opts),f)}walkCB2Sync(s,c,f,d){if(this.#s(s))return d();if(this.signal?.aborted&&d(),this.paused){this.onResume(()=>this.walkCB2Sync(s,c,f,d));return}f.processPatterns(s,c);let v=1,E=t(()=>{--v===0&&d()},"next");for(let[A,O,R]of f.matches.entries())this.#t(A)||this.matchSync(A,O,R);for(let A of f.subwalkTargets()){if(this.maxDepth!==1/0&&A.depth()>=this.maxDepth)continue;v++;let O=A.readdirSync();this.walkCB3Sync(A,O,f,E)}E()}walkCB3Sync(s,c,f,d){f=f.filterEntries(s,c);let v=1,E=t(()=>{--v===0&&d()},"next");for(let[A,O,R]of f.matches.entries())this.#t(A)||this.matchSync(A,O,R);for(let[A,O]of f.subwalks.entries())v++,this.walkCB2Sync(A,O,f.child(),E);E()}},AQ=class extends cfe{static{t(this,"GlobWalker")}matches=new Set;constructor(s,c,f){super(s,c,f)}matchEmit(s){this.matches.add(s)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((s,c)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?c(this.signal.reason):s(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}},kQ=class extends cfe{static{t(this,"GlobStream")}results;constructor(s,c,f){super(s,c,f),this.results=new SN({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(s){this.results.write(s),this.results.flowing||this.pause()}stream(){let s=this.path;return s.isUnknown()?s.lstat().then(()=>{this.walkCB(s,this.patterns,()=>this.results.end())}):this.walkCB(s,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}};var Gar=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Dx=class{static{t(this,"Glob")}absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(s,c){if(!c)throw new TypeError("glob options required");if(this.withFileTypes=!!c.withFileTypes,this.signal=c.signal,this.follow=!!c.follow,this.dot=!!c.dot,this.dotRelative=!!c.dotRelative,this.nodir=!!c.nodir,this.mark=!!c.mark,c.cwd?(c.cwd instanceof URL||c.cwd.startsWith("file://"))&&(c.cwd=Har(c.cwd)):this.cwd="",this.cwd=c.cwd||"",this.root=c.root,this.magicalBraces=!!c.magicalBraces,this.nobrace=!!c.nobrace,this.noext=!!c.noext,this.realpath=!!c.realpath,this.absolute=c.absolute,this.includeChildMatches=c.includeChildMatches!==!1,this.noglobstar=!!c.noglobstar,this.matchBase=!!c.matchBase,this.maxDepth=typeof c.maxDepth=="number"?c.maxDepth:1/0,this.stat=!!c.stat,this.ignore=c.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof s=="string"&&(s=[s]),this.windowsPathsNoEscape=!!c.windowsPathsNoEscape||c.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(s=s.map(O=>O.replace(/\\/g,"/"))),this.matchBase){if(c.noglobstar)throw new TypeError("base matching requires globstar");s=s.map(O=>O.includes("/")?O:`./**/${O}`)}if(this.pattern=s,this.platform=c.platform||Gar,this.opts={...c,platform:this.platform},c.scurry){if(this.scurry=c.scurry,c.nocase!==void 0&&c.nocase!==c.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let O=c.platform==="win32"?tB:c.platform==="darwin"?xQ:c.platform?rB:Cft;this.scurry=new O(this.cwd,{nocase:c.nocase,fs:c.fs})}this.nocase=this.scurry.nocase;let f=this.platform==="darwin"||this.platform==="win32",d={...c,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:f,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},v=this.pattern.map(O=>new AS(O,d)),[E,A]=v.reduce((O,R)=>(O[0].push(...R.set),O[1].push(...R.globParts),O),[[],[]]);this.patterns=E.map((O,R)=>{let W=A[R];if(!W)throw new Error("invalid pattern object");return new nB(O,W,0,this.platform)})}async walk(){return[...await new AQ(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 AQ(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 kQ(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 kQ(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()}};var DNe=t((a,s={})=>{Array.isArray(a)||(a=[a]);for(let c of a)if(new AS(c,s).hasMagic())return!0;return!1},"hasMagic");function lfe(a,s={}){return new Dx(a,s).streamSync()}t(lfe,"globStreamSync");function xft(a,s={}){return new Dx(a,s).stream()}t(xft,"globStream");function Dft(a,s={}){return new Dx(a,s).walkSync()}t(Dft,"globSync");async function Eft(a,s={}){return new Dx(a,s).walk()}t(Eft,"glob_");function ufe(a,s={}){return new Dx(a,s).iterateSync()}t(ufe,"globIterateSync");function Aft(a,s={}){return new Dx(a,s).iterate()}t(Aft,"globIterate");var Qar=lfe,Kar=Object.assign(xft,{sync:lfe}),Yar=ufe,Xar=Object.assign(Aft,{sync:ufe}),Zar=Object.assign(Dft,{stream:lfe,iterate:ufe}),wQ=Object.assign(Eft,{glob:Eft,globSync:Dft,sync:Zar,globStream:xft,stream:Kar,globStreamSync:lfe,streamSync:Qar,globIterate:Aft,iterate:Xar,globIterateSync:ufe,iterateSync:Yar,Glob:Dx,hasMagic:DNe,escape:Kj,unescape:Cx});wQ.glob=wQ;import Bde from"fs";import uRe from"path";var xv=class extends Error{static{t(this,"CompilationError")}buildMessages;constructor(s){super("An error occurred during compilation."),this.buildMessages=Array.isArray(s)?s:[s]}toBuildResult(){return{content:"",errors:this.buildMessages}}};var eor="[",tor="]",ror="{",nor="}",ior=":",sor=",",aor="true",oor="false",cor="null",lor="NaN",uor="Infinity",kNe='"',PQ=new Map([[34,kNe],[92,"\\"],[47,"/"],[98,"\b"],[110,`
|
|
576
576
|
`],[102,"\f"],[114,"\r"],[116," "]]),pfe=new Map([...PQ,[118,"\v"],[48,"\0"]]),_or=new Map([[kNe,kNe],["\\","\\"],["/","/"],["\b","b"],[`
|
|
577
577
|
`,"n"],["\f","f"],["\r","r"],[" ","t"]]),yMr=new Map([..._or,["\v","v"],["\0","0"],["\u2028","u2028"],["\u2029","u2029"]]),_fe=new Map([[eor,"LBracket"],[tor,"RBracket"],[ror,"LBrace"],[nor,"RBrace"],[ior,"Colon"],[sor,"Comma"],[aor,"Boolean"],[oor,"Boolean"],[cor,"Null"]]),ffe=new Map([..._fe,[lor,"Number"],[uor,"Number"]]),wNe=new Set([10,13,8232,8233]),o6=class extends Error{static{t(this,"ErrorWithLocation")}constructor(s,{line:c,column:f,offset:d}){super(`${s} (${c}:${f})`),this.line=c,this.column=f,this.offset=d}},PNe=class extends o6{static{t(this,"UnexpectedChar")}constructor(s,c){super(`Unexpected character '${String.fromCharCode(s)}' found.`,c)}},NNe=class extends o6{static{t(this,"UnexpectedIdentifier")}constructor(s,c){super(`Unexpected identifier '${s}' found.`,c)}},GF=class extends o6{static{t(this,"UnexpectedToken")}constructor(s){super(`Unexpected token ${s.type} found.`,s.loc.start)}},dfe=class extends o6{static{t(this,"UnexpectedEOF")}constructor(s){super("Unexpected end of input found.",s)}},por=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,dor=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,mor=13,kft=10,INe=class{static{t(this,"CharCodeReader")}#r="";#n=1;#e=0;#t=-1;#s=!1;#p=-1;#a=!1;constructor(s){this.#r=s}#_(){this.#a||(this.#e++,this.#t++,this.#p=-1,this.#a=!0)}locate(){return{line:this.#n,column:this.#e,offset:this.#t}}next(){if(this.#t>=this.#r.length-1)return this.#_(),-1;this.#t++;let s=this.#r.charCodeAt(this.#t);return this.#s?(this.#n++,this.#e=1,this.#s=!1):this.#e++,s===mor?(this.#s=!0,this.peek()===kft&&this.#t++):s===kft&&(this.#s=!0),this.#p=s,s}peek(){return this.#t===this.#r.length-1?-1:this.#r.charCodeAt(this.#t+1)}match(s){return s(this.peek())?(this.next(),!0):!1}current(){return this.#p}},hor="Infinity",gor="NaN",yor=new Set([116,102,110]),ONe=new Set([32,9,10,13]),wft=new Set([...ONe,11,12,160,8232,8233,65279,160,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288]),vor={mode:"json",ranges:!1},bor=new Set(["true","false","null"]),G_={EOF:0,Number:1,String:2,Boolean:3,Null:4,NaN:5,Infinity:6,Identifier:7,Colon:20,LBrace:21,RBrace:22,LBracket:23,RBracket:24,Comma:25,LineComment:40,BlockComment:41};function a6(a){return a>=48&&a<=57}t(a6,"isDigit");function ANe(a){return a6(a)||a>=65&&a<=70||a>=97&&a<=102}t(ANe,"isHexDigit");function Sor(a){return a>=49&&a<=57}t(Sor,"isPositiveDigit");function Tor(a){return yor.has(a)}t(Tor,"isKeywordStart");function Nft(a){return a6(a)||a===46||a===45}t(Nft,"isNumberStart");function Cor(a){return Nft(a)||a===43}t(Cor,"isJSON5NumberStart");function Pft(a,s){return a===34||s&&a===39}t(Pft,"isStringStart");function Ift(a){if(a===36||a===95||a===92||a>=97&&a<=122||a>=65&&a<=90||a===8204||a===8205)return!0;let s=String.fromCharCode(a);return por.test(s)}t(Ift,"isJSON5IdentifierStart");function Eor(a){if(Ift(a)||a6(a))return!0;let s=String.fromCharCode(a);return dor.test(s)}t(Eor,"isJSON5IdentifierPart");var FNe=class{static{t(this,"Tokenizer")}#r;#n;#e;#t;#s;#p;#a;#_;#c;#l;#i;constructor(s,c){this.#n=s,this.#r={...vor,...c},this.#e=new INe(s),this.#t=this.#r.mode==="json5",this.#s=this.#r.mode!=="json",this.#p=this.#r.ranges,this.#_=this.#t?pfe.has.bind(pfe):PQ.has.bind(PQ),this.#c=this.#t?wNe.has.bind(wNe):()=>!1,this.#l=this.#t?f=>f===120:()=>!1,this.#i=this.#t?wft.has.bind(wft):ONe.has.bind(ONe)}#f(s,c=this.#e.locate()){throw new PNe(s,c)}#v(s,c=this.#e.locate()){throw new NNe(s,c)}#d(){throw new dfe(this.#e.locate())}#u(s,c,f,d){let v=f.offset+c,E=this.#r.ranges?{range:[f.offset,v]}:void 0;return{type:s,loc:{start:f,end:d||{line:f.line,column:f.column+c,offset:v}},...E}}#m(s){let c="",f;for(let d=0;d<s;d++){if(f=this.#e.peek(),ANe(f)){this.#e.next(),c+=String.fromCharCode(f);continue}this.#f(f)}return c}#g(s){let c="";do{if(c+=String.fromCharCode(s),s===92&&(s=this.#e.next(),s!==117&&this.#f(s),c+=String.fromCharCode(s),c+=this.#m(4)),s=this.#e.peek(),!Eor(s))break;this.#e.next()}while(!0);return c}#x(s){let c=s,f=1;for(s=this.#e.peek();s!==-1&&s!==c;){if(this.#e.next(),f++,s===92)if(s=this.#e.peek(),this.#_(s)||this.#c(s))this.#e.next(),f++;else if(s===117){this.#e.next(),f++;let d=this.#m(4);f+=d.length}else if(this.#l(s)){this.#e.next(),f++;let d=this.#m(2);f+=d.length}else this.#t?(this.#e.next(),f++):this.#f(s);s=this.#e.peek()}return s===-1&&(this.#e.next(),this.#d()),this.#e.next(),f++,f}#C(s){let c=1;if(s===45||this.#t&&s===43){if(s=this.#e.peek(),this.#t&&(s===73||s===78)){this.#e.next();let f=this.#g(s);return f!==hor&&f!==gor&&this.#f(s),c+f.length}a6(s)||this.#f(s),this.#e.next(),c++}if(s===48)if(s=this.#e.peek(),this.#t&&(s===120||s===88)){this.#e.next(),c++,s=this.#e.peek(),ANe(s)||(this.#e.next(),this.#f(s));do this.#e.next(),c++,s=this.#e.peek();while(ANe(s))}else a6(s)&&this.#f(s);else if(!this.#t||s!==46)for(Sor(s)||this.#f(s),s=this.#e.peek();a6(s);)this.#e.next(),c++,s=this.#e.peek();if(s===46){let f=-1;for(this.#e.next(),c++,f++,s=this.#e.peek();a6(s);)this.#e.next(),c++,f++,s=this.#e.peek();!this.#t&&f===0&&(this.#e.next(),s?this.#f(s):this.#d())}if(s===101||s===69)for(this.#e.next(),c++,s=this.#e.peek(),(s===43||s===45)&&(this.#e.next(),c++,s=this.#e.peek()),s===-1&&(this.#e.next(),this.#d()),a6(s)||(this.#e.next(),this.#f(s));a6(s);)this.#e.next(),c++,s=this.#e.peek();return c}#b(s){let c=1;if(s=this.#e.peek(),s===47){do this.#e.next(),c+=1,s=this.#e.peek();while(s>-1&&s!==13&&s!==10);return{length:c,multiline:!1}}if(s===42){for(this.#e.next(),c+=1;s>-1;)if(s=this.#e.peek(),s===42){if(this.#e.next(),c+=1,s=this.#e.peek(),s===47)return this.#e.next(),c+=1,{length:c,multiline:!0}}else this.#e.next(),c+=1;this.#e.next(),this.#d()}this.#e.next(),this.#f(s)}next(){let s=this.#e.next();for(;this.#i(s);)s=this.#e.next();if(s===-1)return G_.EOF;let c=this.#e.locate(),f=String.fromCharCode(s);if(this.#t)if(ffe.has(f))this.#a=this.#u(ffe.get(f),1,c);else if(Ift(s)){let d=this.#g(s);ffe.has(d)?this.#a=this.#u(ffe.get(d),d.length,c):this.#a=this.#u("Identifier",d.length,c)}else if(Cor(s)){let d=this.#C(s);this.#a=this.#u("Number",d,c)}else if(Pft(s,this.#t)){let d=this.#x(s),v=this.#e.locate();this.#a=this.#u("String",d,c,{line:v.line,column:v.column+1,offset:v.offset+1})}else if(s===47&&this.#s){let d=this.#b(s),v=this.#e.locate();this.#a=this.#u(d.multiline?"BlockComment":"LineComment",d.length,c,{line:v.line,column:v.column+1,offset:v.offset+1})}else this.#f(s);else if(_fe.has(f))this.#a=this.#u(_fe.get(f),1,c);else if(Tor(s)){let d=this.#g(s);bor.has(d)||this.#v(d,c),this.#a=this.#u(_fe.get(d),d.length,c)}else if(Nft(s)){let d=this.#C(s);this.#a=this.#u("Number",d,c)}else if(Pft(s,this.#t)){let d=this.#x(s);this.#a=this.#u("String",d,c)}else if(s===47&&this.#s){let d=this.#b(s),v=this.#e.locate();this.#a=this.#u(d.multiline?"BlockComment":"LineComment",d.length,c,{line:v.line,column:v.column+1,offset:v.offset+1})}else this.#f(s);return G_[this.#a.type]}get token(){return this.#a}};var hC={document(a,s={}){return{type:"Document",body:a,loc:s.loc,...s}},string(a,s={}){return{type:"String",value:a,loc:s.loc,...s}},number(a,s={}){return{type:"Number",value:a,loc:s.loc,...s}},boolean(a,s={}){return{type:"Boolean",value:a,loc:s.loc,...s}},null(a={}){return{type:"Null",loc:a.loc,...a}},array(a,s={}){return{type:"Array",elements:a,loc:s.loc,...s}},element(a,s={}){return{type:"Element",value:a,loc:s.loc,...s}},object(a,s={}){return{type:"Object",members:a,loc:s.loc,...s}},member(a,s,c={}){return{type:"Member",name:a,value:s,loc:c.loc,...c}},identifier(a,s={}){return{type:"Identifier",name:a,loc:s.loc,...s}},nan(a="",s={}){return{type:"NaN",sign:a,loc:s.loc,...s}},infinity(a="",s={}){return{type:"Infinity",sign:a,loc:s.loc,...s}}},xor={mode:"json",ranges:!1,tokens:!1,allowTrailingCommas:!1};function Dor(a,s,c=!1){let f="",d=a.indexOf("\\"),v=0;for(;d>=0;){f+=a.slice(v,d);let E=a.charAt(d+1),A=E.charCodeAt(0);if(c&&pfe.has(A))f+=pfe.get(A),v=d+2;else if(PQ.has(A))f+=PQ.get(A),v=d+2;else if(E==="u"){let O=a.slice(d+2,d+6);if(O.length<4||/[^0-9a-f]/i.test(O))throw new o6(`Invalid unicode escape \\u${O}.`,{line:s.loc.start.line,column:s.loc.start.column+d,offset:s.loc.start.offset+d});f+=String.fromCharCode(parseInt(O,16)),v=d+6}else if(c&&E==="x"){let O=a.slice(d+2,d+4);if(O.length<2||/[^0-9a-f]/i.test(O))throw new o6(`Invalid hex escape \\x${O}.`,{line:s.loc.start.line,column:s.loc.start.column+d,offset:s.loc.start.offset+d});f+=String.fromCharCode(parseInt(O,16)),v=d+4}else if(c&&wNe.has(A))v=d+2,E==="\r"&&a.charAt(v)===`
|
|
578
|
-
`&&v++;else if(c)f+=E,v=d+2;else throw new o6(`Invalid escape \\${E}.`,{line:s.loc.start.line,column:s.loc.start.column+d,offset:s.loc.start.offset+d});d=a.indexOf("\\",v)}return f+=a.slice(v),f}t(Dor,"getStringValue");function Aor(a,s,c=!1){switch(s.type){case"Boolean":return a==="true";case"Number":return Number(a);case"String":return Dor(a.slice(1,-1),s,c);default:throw new TypeError(`Unknown token type "${s.type}.`)}}t(Aor,"getLiteralValue");function Oft(a,s){s=Object.freeze({...xor,...s});let c=[],f=new FNe(a,{mode:s.mode,ranges:s.ranges}),d=s.mode==="json5",v=s.allowTrailingCommas||d;function E(){let pr=f.next();return pr&&s.tokens&&c.push(f.token),pr}t(E,"nextNoComments");function A(){let pr=f.next();return pr&&s.tokens&&c.push(f.token),pr>=G_.LineComment?A():pr}t(A,"nextSkipComments");let O=s.mode==="json"?E:A;function R(pr,sr){if(pr!==sr)throw new GF(f.token)}t(R,"assertTokenType");function W(pr,sr){if(!sr.includes(pr))throw new GF(f.token)}t(W,"assertTokenTypes");function $(pr,sr){return s.ranges?{range:[pr.offset,sr.offset]}:void 0}t($,"createRange");function K(pr){let sr=f.token,Cs=$(sr.loc.start,sr.loc.end),Di=Aor(a.slice(sr.loc.start.offset,sr.loc.end.offset),sr,d),hi={loc:{start:{...sr.loc.start},end:{...sr.loc.end}},...Cs};switch(pr){case G_.String:return hC.string(Di,hi);case G_.Number:return hC.number(Di,hi);case G_.Boolean:return hC.boolean(Di,hi);default:throw new TypeError(`Unknown token type ${sr.type}.`)}}t(K,"createLiteralNode");function Ne(pr){let sr=$(pr.loc.start,pr.loc.end),Cs=a.slice(pr.loc.start.offset,pr.loc.end.offset),_o={loc:{start:{...pr.loc.start},end:{...pr.loc.end}},...sr};if(pr.type!=="Identifier"){let hi="";return(Cs[0]==="+"||Cs[0]==="-")&&(hi=Cs[0]),hC[Cs.includes("NaN")?"nan":"infinity"](hi,_o)}return hC.identifier(Cs,_o)}t(Ne,"createJSON5IdentifierNode");function De(pr){let sr=$(pr.loc.start,pr.loc.end);return hC.null({loc:{start:{...pr.loc.start},end:{...pr.loc.end}},...sr})}t(De,"createNullNode");function Se(pr){d?W(pr,[G_.String,G_.Identifier,G_.Number]):R(pr,G_.String);let sr=f.token,Cs=pr===G_.String?K(pr):Ne(sr);if(d&&(Cs.type==="NaN"||Cs.type==="Infinity")){if(Cs.sign!=="")throw new GF(f.token);Cs=hC.identifier(Cs.type,{loc:Cs.loc,...$(Cs.loc.start,Cs.loc.end)})}pr=O(),R(pr,G_.Colon);let Di=vr(),_o=$(Cs.loc.start,Di.loc.end);return hC.member(Cs,Di,{loc:{start:{...Cs.loc.start},end:{...Di.loc.end}},..._o})}t(Se,"parseProperty");function Tt(pr){R(pr,G_.LBrace);let sr=f.token,Cs=[],Di=O();if(Di!==G_.RBrace)do{if(Cs.push(Se(Di)),Di=O(),!Di)throw new dfe(Cs[Cs.length-1].loc.end);if(Di===G_.Comma){if(Di=O(),v&&Di===G_.RBrace)break}else break}while(Di);R(Di,G_.RBrace);let _o=f.token,hi=$(sr.loc.start,_o.loc.end);return hC.object(Cs,{loc:{start:{...sr.loc.start},end:{..._o.loc.end}},...hi})}t(Tt,"parseObject");function xt(pr){R(pr,G_.LBracket);let sr=f.token,Cs=[],Di=O();if(Di!==G_.RBracket)do{let No=vr(Di);if(Cs.push(hC.element(No,{loc:No.loc})),Di=O(),Di===G_.Comma){if(Di=O(),v&&Di===G_.RBracket)break}else break}while(Di);R(Di,G_.RBracket);let _o=f.token,hi=$(sr.loc.start,_o.loc.end);return hC.array(Cs,{loc:{start:{...sr.loc.start},end:{..._o.loc.end}},...hi})}t(xt,"parseArray");function vr(pr){pr=pr??O();let sr=f.token;switch(pr){case G_.String:case G_.Boolean:return K(pr);case G_.Number:if(d){let Cs=a.slice(sr.loc.start.offset,sr.loc.end.offset);if((Cs[0]==="+"||Cs[0]==="-")&&(Cs=Cs.slice(1)),Cs==="NaN"||Cs==="Infinity")return Ne(sr)}return K(pr);case G_.Null:return De(sr);case G_.LBrace:return Tt(pr);case G_.LBracket:return xt(pr);default:throw new GF(sr)}}t(vr,"parseValue");let Tr=vr();if(O())throw new GF(f.token);let Cr={loc:{start:{line:1,column:1,offset:0},end:{...Tr.loc.end}}};return s.tokens&&(Cr.tokens=c),s.ranges&&(Cr.range=[Cr.loc.start.offset,Cr.loc.end.offset]),hC.document(Tr,Cr)}t(Oft,"parse");var kor=new Map([["Document",["body"]],["Object",["members"]],["Member",["name","value"]],["Element",["value"]],["Array",["elements"]],["String",[]],["Number",[]],["Boolean",[]],["Null",[]],["NaN",[]],["Infinity",[]],["Identifier",[]]]);function Fft(a){return a&&typeof a=="object"}t(Fft,"isObject");function wor(a){return Fft(a)&&typeof a.type=="string"}t(wor,"isNode");function Por(a,s){function c(f,d){typeof s.enter=="function"&&s.enter(f,d);for(let v of kor.get(f.type)){let E=f[v];Fft(E)&&(Array.isArray(E)?E.forEach(A=>c(A,f)):wor(E)&&c(E,f))}typeof s.exit=="function"&&s.exit(f,d)}t(c,"visitNode"),c(a)}t(Por,"traverse");function Lft(a,s=()=>!0){let c=[];return Por(a,{enter(f,d){c.push({node:f,parent:d,phase:"enter"})},exit(f,d){c.push({node:f,parent:d,phase:"exit"})}}),c.filter(s).values()}t(Lft,"iterator");import Nor from"fs/promises";var NQ=t((a,s)=>a.split(/\r?\n/)[s-1],"getFileLineContent"),mfe=t(async a=>{try{return await Nor.readFile(a,"utf-8")}catch{return}},"getSchemaContent"),IQ=t(async a=>{try{return Oft(a)}catch(s){if(s.column&&s.line&&s.message){let c=NQ(a,s.line);return{column:s.column,line:s.line,length:void 0,lineText:c}}return}},"getSchemaAST");var Rft=t(async(a,s,c)=>{try{if(a.length===0)return;for(let f of a){let d=await mfe(f),v=await Ior(d,f,s,c);if(v)return v}}catch{}},"getRouteLocationByValue"),Ior=t(async(a,s,c,f)=>{try{if(!a)return;let d=null,v=await IQ(a);if(v){for(let{node:E}of Lft(v))if(E.value&&E.value===c){d=E.loc;break}if(d!==null){let E=NQ(a,d.start.line);return{file:s,line:d.start.line,column:d.start.column,length:d.end.column-d.start.column,lineText:E,suggestion:f}}}}catch{}},"getRouteLocationByValueFromSchema");import Mft from"fs/promises";import hfe from"path";var LNe="schemas",RNe=".oas.json";var QF=t(async a=>(await Mft.readdir(a)).map(c=>`${a}/${c}`).filter(c=>c.endsWith(RNe)).sort(),"getOpenApiFilesByAlphabetical"),sB=t(async a=>{let s=hfe.resolve(a,"config");return(await Mft.readdir(s)).filter(f=>f.endsWith(RNe)).length>=1},"oasFileInProject");function OQ(a,s,c,f,d,v,E){if(v.has(c))return;let A;try{A=f.get(c)}catch(O){throw new Tv({text:`Failed to resolve reference: ${c}`,detail:O.message,severity:"error",message:"Failed to resolve reference",location:{file:a,column:0,line:0,length:0,lineText:c,namespace:s,suggestion:"Check the reference and try again."}})}v.set(c,d.length),d.push(c),MNe(jNe(c),s,A,f,d,v,E)}t(OQ,"chaseRefs");function MNe(a,s,c,f,d,v,E){if(Array.isArray(c))for(let A of c)MNe(a,s,A,f,d,v,E);else if(typeof c=="object")for(let A in c){if(A==="$ref"){let O=c[A];E&&(c[A]=E(s,O)),OQ(a,s,TN(a,O),f,d,v,E)}MNe(a,s,c[A],f,d,v,E)}}t(MNe,"lookForRefs");function TN(a,s){let c=s.indexOf("#");return c>=0?`${hfe.resolve(a,s.substring(0,c))}${s.substring(c)}`:hfe.resolve(hfe.dirname(a),s)}t(TN,"getFullyQualifiedRefName");function jNe(a){let s=a.indexOf("#");return s>=0?a.substring(0,s):a}t(jNe,"getFilePathNameFromRefName");var BNe=class{static{t(this,"Environment")}get ZUP_HOSTNAME(){return process.env.ZUP_HOSTNAME??"zuplo.app"}get ZUP_WORKING_COPY_HOSTNAME(){return process.env.ZUP_WORKING_COPY_HOSTNAME??"working-copy.zuplotest.com"}},Oor=new BNe,UNe=Oor;var KQ=W_(t8e(),1);var n8e={};Llt(n8e,{UnsafePathError:()=>zfe,deleteFolder:()=>P_r,dirExists:()=>r8e,fileExists:()=>b_r,getParentDirFilename:()=>A_r,isNotFileOrDirectory:()=>T_r,listFolderContents:()=>fdt,listFolders:()=>E_r,mkDirTemp:()=>S_r,mkdirForFilePathIfNotExits:()=>x_r,mkdirIfNotExists:()=>_dt,safePath:()=>D_r,tarFolder:()=>k_r,untarFile:()=>w_r});import{spawn as ldt}from"child_process";import{randomUUID as g_r}from"crypto";import PN from"fs/promises";import{platform as y_r,tmpdir as v_r}from"os";import wN from"path";var udt=[".git","node_modules",".yarn",".DS_Store"];async function b_r(a){try{return(await PN.stat(a)).isFile()}catch{return!1}}t(b_r,"fileExists");async function S_r(){let a=v_r(),s=g_r().replaceAll("-",""),c=wN.join(a,s);return await PN.mkdir(c,{recursive:!0}),c}t(S_r,"mkDirTemp");async function r8e(a){try{return(await PN.stat(a)).isDirectory()}catch{return!1}}t(r8e,"dirExists");async function T_r(a){try{return await PN.stat(a),!1}catch{return!0}}t(T_r,"isNotFileOrDirectory");function C_r(a,s){let c=new RegExp(`(.*)(\\/${s})$|(.*)(${s}\\/)`),f=a.match(c);if(!f)return"";let d=a.split(f[0]);return d[1]===""?"":`/${d[1]}`}t(C_r,"getParentDirectory");async function E_r(a){if(!await r8e(a))return[];let s=await PN.readdir(a,{withFileTypes:!0}),c=[];for await(let f of s)udt.includes(f.name)||f.isDirectory()&&c.push(f.name);return c}t(E_r,"listFolders");async function fdt(a,s,c=!0){let f=C_r(a,s),d=await PN.readdir(a,{withFileTypes:!0}),v=[];for await(let E of d)if(!udt.includes(E.name)||!c)if(E.isDirectory()){let A=await fdt(wN.join(a,E.name),s,c);v.push(...A)}else v.push(wN.join(f,E.name));return v}t(fdt,"listFolderContents");var _dt=t(async a=>{await PN.mkdir(a,{recursive:!0})},"mkdirIfNotExists"),x_r=t(async a=>{let s=wN.dirname(a);return _dt(s)},"mkdirForFilePathIfNotExits"),zfe=class extends Error{static{t(this,"UnsafePathError")}constructor(s){super(s)}};function D_r(a){let s=t(c=>{if(!c.startsWith(a))throw new zfe("Resolved path is not part of the project.");return c},"ensureSafePath");return{resolve:t((...c)=>s(wN.resolve(...c)),"resolve")}}t(D_r,"safePath");function A_r(a){return`${wN.basename(wN.dirname(a))}/${wN.basename(a)}`}t(A_r,"getParentDirFilename");async function k_r({folderPath:a,outputTarPath:s,exclude:c=["node_modules",".git","dist"],logger:f}){let d=[],v=[],E;try{await new Promise((A,O)=>{let R=ldt("tar",[...c.map(W=>["--exclude",W]).flat(),...y_r()!=="darwin"?["--warning=no-file-changed"]:[],"-cvf",s,"-C",a,"."]);R.stdout.on("data",W=>{let $=W.toString().trim();$.length>0&&d.push($.trim())}),R.stderr.on("data",W=>{let $=W.toString().trim();$.length>0&&v.push($.trim())}),R.on("close",W=>{E=W,W===0?A():O(new Error(`tar process exited with code ${W}`))}),R.on("error",W=>{O(W)})})}catch(A){throw new Error("Failed to tar folder",{cause:A})}finally{f.info({stdout:d.join(`
|
|
578
|
+
`&&v++;else if(c)f+=E,v=d+2;else throw new o6(`Invalid escape \\${E}.`,{line:s.loc.start.line,column:s.loc.start.column+d,offset:s.loc.start.offset+d});d=a.indexOf("\\",v)}return f+=a.slice(v),f}t(Dor,"getStringValue");function Aor(a,s,c=!1){switch(s.type){case"Boolean":return a==="true";case"Number":return Number(a);case"String":return Dor(a.slice(1,-1),s,c);default:throw new TypeError(`Unknown token type "${s.type}.`)}}t(Aor,"getLiteralValue");function Oft(a,s){s=Object.freeze({...xor,...s});let c=[],f=new FNe(a,{mode:s.mode,ranges:s.ranges}),d=s.mode==="json5",v=s.allowTrailingCommas||d;function E(){let pr=f.next();return pr&&s.tokens&&c.push(f.token),pr}t(E,"nextNoComments");function A(){let pr=f.next();return pr&&s.tokens&&c.push(f.token),pr>=G_.LineComment?A():pr}t(A,"nextSkipComments");let O=s.mode==="json"?E:A;function R(pr,sr){if(pr!==sr)throw new GF(f.token)}t(R,"assertTokenType");function W(pr,sr){if(!sr.includes(pr))throw new GF(f.token)}t(W,"assertTokenTypes");function $(pr,sr){return s.ranges?{range:[pr.offset,sr.offset]}:void 0}t($,"createRange");function K(pr){let sr=f.token,Cs=$(sr.loc.start,sr.loc.end),Di=Aor(a.slice(sr.loc.start.offset,sr.loc.end.offset),sr,d),hi={loc:{start:{...sr.loc.start},end:{...sr.loc.end}},...Cs};switch(pr){case G_.String:return hC.string(Di,hi);case G_.Number:return hC.number(Di,hi);case G_.Boolean:return hC.boolean(Di,hi);default:throw new TypeError(`Unknown token type ${sr.type}.`)}}t(K,"createLiteralNode");function Ne(pr){let sr=$(pr.loc.start,pr.loc.end),Cs=a.slice(pr.loc.start.offset,pr.loc.end.offset),_o={loc:{start:{...pr.loc.start},end:{...pr.loc.end}},...sr};if(pr.type!=="Identifier"){let hi="";return(Cs[0]==="+"||Cs[0]==="-")&&(hi=Cs[0]),hC[Cs.includes("NaN")?"nan":"infinity"](hi,_o)}return hC.identifier(Cs,_o)}t(Ne,"createJSON5IdentifierNode");function De(pr){let sr=$(pr.loc.start,pr.loc.end);return hC.null({loc:{start:{...pr.loc.start},end:{...pr.loc.end}},...sr})}t(De,"createNullNode");function Se(pr){d?W(pr,[G_.String,G_.Identifier,G_.Number]):R(pr,G_.String);let sr=f.token,Cs=pr===G_.String?K(pr):Ne(sr);if(d&&(Cs.type==="NaN"||Cs.type==="Infinity")){if(Cs.sign!=="")throw new GF(f.token);Cs=hC.identifier(Cs.type,{loc:Cs.loc,...$(Cs.loc.start,Cs.loc.end)})}pr=O(),R(pr,G_.Colon);let Di=vr(),_o=$(Cs.loc.start,Di.loc.end);return hC.member(Cs,Di,{loc:{start:{...Cs.loc.start},end:{...Di.loc.end}},..._o})}t(Se,"parseProperty");function Tt(pr){R(pr,G_.LBrace);let sr=f.token,Cs=[],Di=O();if(Di!==G_.RBrace)do{if(Cs.push(Se(Di)),Di=O(),!Di)throw new dfe(Cs[Cs.length-1].loc.end);if(Di===G_.Comma){if(Di=O(),v&&Di===G_.RBrace)break}else break}while(Di);R(Di,G_.RBrace);let _o=f.token,hi=$(sr.loc.start,_o.loc.end);return hC.object(Cs,{loc:{start:{...sr.loc.start},end:{..._o.loc.end}},...hi})}t(Tt,"parseObject");function xt(pr){R(pr,G_.LBracket);let sr=f.token,Cs=[],Di=O();if(Di!==G_.RBracket)do{let No=vr(Di);if(Cs.push(hC.element(No,{loc:No.loc})),Di=O(),Di===G_.Comma){if(Di=O(),v&&Di===G_.RBracket)break}else break}while(Di);R(Di,G_.RBracket);let _o=f.token,hi=$(sr.loc.start,_o.loc.end);return hC.array(Cs,{loc:{start:{...sr.loc.start},end:{..._o.loc.end}},...hi})}t(xt,"parseArray");function vr(pr){pr=pr??O();let sr=f.token;switch(pr){case G_.String:case G_.Boolean:return K(pr);case G_.Number:if(d){let Cs=a.slice(sr.loc.start.offset,sr.loc.end.offset);if((Cs[0]==="+"||Cs[0]==="-")&&(Cs=Cs.slice(1)),Cs==="NaN"||Cs==="Infinity")return Ne(sr)}return K(pr);case G_.Null:return De(sr);case G_.LBrace:return Tt(pr);case G_.LBracket:return xt(pr);default:throw new GF(sr)}}t(vr,"parseValue");let Tr=vr();if(O())throw new GF(f.token);let Cr={loc:{start:{line:1,column:1,offset:0},end:{...Tr.loc.end}}};return s.tokens&&(Cr.tokens=c),s.ranges&&(Cr.range=[Cr.loc.start.offset,Cr.loc.end.offset]),hC.document(Tr,Cr)}t(Oft,"parse");var kor=new Map([["Document",["body"]],["Object",["members"]],["Member",["name","value"]],["Element",["value"]],["Array",["elements"]],["String",[]],["Number",[]],["Boolean",[]],["Null",[]],["NaN",[]],["Infinity",[]],["Identifier",[]]]);function Fft(a){return a&&typeof a=="object"}t(Fft,"isObject");function wor(a){return Fft(a)&&typeof a.type=="string"}t(wor,"isNode");function Por(a,s){function c(f,d){typeof s.enter=="function"&&s.enter(f,d);for(let v of kor.get(f.type)){let E=f[v];Fft(E)&&(Array.isArray(E)?E.forEach(A=>c(A,f)):wor(E)&&c(E,f))}typeof s.exit=="function"&&s.exit(f,d)}t(c,"visitNode"),c(a)}t(Por,"traverse");function Lft(a,s=()=>!0){let c=[];return Por(a,{enter(f,d){c.push({node:f,parent:d,phase:"enter"})},exit(f,d){c.push({node:f,parent:d,phase:"exit"})}}),c.filter(s).values()}t(Lft,"iterator");import Nor from"fs/promises";var NQ=t((a,s)=>a.split(/\r?\n/)[s-1],"getFileLineContent"),mfe=t(async a=>{try{return await Nor.readFile(a,"utf-8")}catch{return}},"getSchemaContent"),IQ=t(async a=>{try{return Oft(a)}catch(s){if(s.column&&s.line&&s.message){let c=NQ(a,s.line);return{column:s.column,line:s.line,length:void 0,lineText:c}}return}},"getSchemaAST");var Rft=t(async(a,s,c)=>{try{if(a.length===0)return;for(let f of a){let d=await mfe(f),v=await Ior(d,f,s,c);if(v)return v}}catch{}},"getRouteLocationByValue"),Ior=t(async(a,s,c,f)=>{try{if(!a)return;let d=null,v=await IQ(a);if(v){for(let{node:E}of Lft(v))if(E.value&&E.value===c){d=E.loc;break}if(d!==null){let E=NQ(a,d.start.line);return{file:s,line:d.start.line,column:d.start.column,length:d.end.column-d.start.column,lineText:E,suggestion:f}}}}catch{}},"getRouteLocationByValueFromSchema");import Mft from"fs/promises";import hfe from"path";var LNe="schemas",RNe=".oas.json";var QF=t(async a=>(await Mft.readdir(a)).map(c=>`${a}/${c}`).filter(c=>c.endsWith(RNe)).sort(),"getOpenApiFilesByAlphabetical"),sB=t(async a=>{let s=hfe.resolve(a,"config");return(await Mft.readdir(s)).filter(f=>f.endsWith(RNe)).length>=1},"oasFileInProject");function OQ(a,s,c,f,d,v,E){if(v.has(c))return;let A;try{A=f.get(c)}catch(O){throw new Tv({text:`Failed to resolve reference: ${c}`,detail:O.message,severity:"error",message:"Failed to resolve reference",location:{file:a,column:0,line:0,length:0,lineText:c,namespace:s,suggestion:"Check the reference and try again."}})}v.set(c,d.length),d.push(c),MNe(jNe(c),s,A,f,d,v,E)}t(OQ,"chaseRefs");function MNe(a,s,c,f,d,v,E){if(Array.isArray(c))for(let A of c)MNe(a,s,A,f,d,v,E);else if(typeof c=="object")for(let A in c){if(A==="$ref"){let O=c[A];E&&(c[A]=E(s,O)),OQ(a,s,TN(a,O),f,d,v,E)}MNe(a,s,c[A],f,d,v,E)}}t(MNe,"lookForRefs");function TN(a,s){let c=s.indexOf("#");return c>=0?`${hfe.resolve(a,s.substring(0,c))}${s.substring(c)}`:hfe.resolve(hfe.dirname(a),s)}t(TN,"getFullyQualifiedRefName");function jNe(a){let s=a.indexOf("#");return s>=0?a.substring(0,s):a}t(jNe,"getFilePathNameFromRefName");var BNe=class{static{t(this,"Environment")}get ZUP_HOSTNAME(){return process.env.ZUP_HOSTNAME??"zuplo.app"}get ZUP_WORKING_COPY_HOSTNAME(){return process.env.ZUP_WORKING_COPY_HOSTNAME??"working-copy.zuplotest.com"}},Oor=new BNe,UNe=Oor;var KQ=W_(t8e(),1);var n8e={};Llt(n8e,{UnsafePathError:()=>zfe,deleteFolder:()=>P_r,dirExists:()=>r8e,fileExists:()=>b_r,getParentDirFilename:()=>A_r,isNotFileOrDirectory:()=>T_r,listFolderContents:()=>fdt,listFolders:()=>E_r,mkDirTemp:()=>S_r,mkdirForFilePathIfNotExits:()=>x_r,mkdirIfNotExists:()=>_dt,safePath:()=>D_r,tarFolder:()=>k_r,untarFile:()=>w_r});import{spawn as ldt}from"child_process";import{randomUUID as g_r}from"crypto";import PN from"fs/promises";import{platform as y_r,tmpdir as v_r}from"os";import wN from"path";var udt=[".git","node_modules",".yarn",".DS_Store"];async function b_r(a){try{return(await PN.stat(a)).isFile()}catch{return!1}}t(b_r,"fileExists");async function S_r(){let a=process.env.BUILD_FILE_PATH??v_r(),s=g_r().replaceAll("-",""),c=wN.join(a,s);return await PN.mkdir(c,{recursive:!0}),c}t(S_r,"mkDirTemp");async function r8e(a){try{return(await PN.stat(a)).isDirectory()}catch{return!1}}t(r8e,"dirExists");async function T_r(a){try{return await PN.stat(a),!1}catch{return!0}}t(T_r,"isNotFileOrDirectory");function C_r(a,s){let c=new RegExp(`(.*)(\\/${s})$|(.*)(${s}\\/)`),f=a.match(c);if(!f)return"";let d=a.split(f[0]);return d[1]===""?"":`/${d[1]}`}t(C_r,"getParentDirectory");async function E_r(a){if(!await r8e(a))return[];let s=await PN.readdir(a,{withFileTypes:!0}),c=[];for await(let f of s)udt.includes(f.name)||f.isDirectory()&&c.push(f.name);return c}t(E_r,"listFolders");async function fdt(a,s,c=!0){let f=C_r(a,s),d=await PN.readdir(a,{withFileTypes:!0}),v=[];for await(let E of d)if(!udt.includes(E.name)||!c)if(E.isDirectory()){let A=await fdt(wN.join(a,E.name),s,c);v.push(...A)}else v.push(wN.join(f,E.name));return v}t(fdt,"listFolderContents");var _dt=t(async a=>{await PN.mkdir(a,{recursive:!0})},"mkdirIfNotExists"),x_r=t(async a=>{let s=wN.dirname(a);return _dt(s)},"mkdirForFilePathIfNotExits"),zfe=class extends Error{static{t(this,"UnsafePathError")}constructor(s){super(s)}};function D_r(a){let s=t(c=>{if(!c.startsWith(a))throw new zfe("Resolved path is not part of the project.");return c},"ensureSafePath");return{resolve:t((...c)=>s(wN.resolve(...c)),"resolve")}}t(D_r,"safePath");function A_r(a){return`${wN.basename(wN.dirname(a))}/${wN.basename(a)}`}t(A_r,"getParentDirFilename");async function k_r({folderPath:a,outputTarPath:s,exclude:c=["node_modules",".git","dist"],logger:f}){let d=[],v=[],E;try{await new Promise((A,O)=>{let R=ldt("tar",[...c.map(W=>["--exclude",W]).flat(),...y_r()!=="darwin"?["--warning=no-file-changed"]:[],"-cvf",s,"-C",a,"."]);R.stdout.on("data",W=>{let $=W.toString().trim();$.length>0&&d.push($.trim())}),R.stderr.on("data",W=>{let $=W.toString().trim();$.length>0&&v.push($.trim())}),R.on("close",W=>{E=W,W===0?A():O(new Error(`tar process exited with code ${W}`))}),R.on("error",W=>{O(W)})})}catch(A){throw new Error("Failed to tar folder",{cause:A})}finally{f.info({stdout:d.join(`
|
|
579
579
|
`),stderr:v.join(`
|
|
580
580
|
`),exitCode:E},"Tar process logs")}}t(k_r,"tarFolder");async function w_r({tarFilePath:a,outputDir:s,logger:c,rootFolderCompatibility:f=!0}){let d=[],v=[],E;try{await new Promise((A,O)=>{let R;f?R=`
|
|
581
581
|
if tar -tf ${a} | grep -qE '^([^/]+/)$'; then
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zuplo/core",
|
|
3
|
-
"version": "6.38.
|
|
3
|
+
"version": "6.38.15",
|
|
4
4
|
"repository": "https://github.com/zuplo/zuplo",
|
|
5
5
|
"author": "Zuplo, Inc.",
|
|
6
6
|
"type": "module",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"prettier": "^3.3.3"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"@zuplo/graphql": "^6.38.
|
|
44
|
-
"@zuplo/otel": "^6.38.
|
|
45
|
-
"@zuplo/runtime": "^6.38.
|
|
43
|
+
"@zuplo/graphql": "^6.38.15",
|
|
44
|
+
"@zuplo/otel": "^6.38.15",
|
|
45
|
+
"@zuplo/runtime": "^6.38.15"
|
|
46
46
|
}
|
|
47
47
|
}
|