@stlite/desktop 0.54.1 → 0.54.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/dump_artifacts.js
CHANGED
|
@@ -1,20 +1,55 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";var Hi=Object.create;var es=Object.defineProperty;var Ji=Object.getOwnPropertyDescriptor;var Ki=Object.getOwnPropertyNames;var Vi=Object.getPrototypeOf,Yi=Object.prototype.hasOwnProperty;var gt=(i,t)=>()=>(t||i((t={exports:{}}).exports,t),t.exports);var Xi=(i,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Ki(t))!Yi.call(i,n)&&n!==e&&es(i,n,{get:()=>t[n],enumerable:!(s=Ji(t,n))||s.enumerable});return i};var U=(i,t,e)=>(e=i!=null?Hi(Vi(i)):{},Xi(t||!i||!i.__esModule?es(e,"default",{value:i,enumerable:!0}):e,i));var te=gt((Qt,ns)=>{(function(i,t){typeof Qt=="object"&&typeof ns<"u"?t(Qt):typeof define=="function"&&define.amd?define(["exports"],t):(i=typeof globalThis<"u"?globalThis:i||self,t(i.Superstruct={}))})(Qt,function(i){"use strict";class t extends TypeError{constructor(c,f){let p,{message:S,explanation:v,...A}=c,{path:_}=c,F=_.length===0?S:`At path: ${_.join(".")} -- ${S}`;super(v??F),v!=null&&(this.cause=F),Object.assign(this,A),this.name=this.constructor.name,this.failures=()=>p??(p=[c,...f()])}}function e(l){return s(l)&&typeof l[Symbol.iterator]=="function"}function s(l){return typeof l=="object"&&l!=null}function n(l){if(Object.prototype.toString.call(l)!=="[object Object]")return!1;let c=Object.getPrototypeOf(l);return c===null||c===Object.prototype}function r(l){return typeof l=="symbol"?l.toString():typeof l=="string"?JSON.stringify(l):`${l}`}function o(l){let{done:c,value:f}=l.next();return c?void 0:f}function a(l,c,f,p){if(l===!0)return;l===!1?l={}:typeof l=="string"&&(l={message:l});let{path:S,branch:v}=c,{type:A}=f,{refinement:_,message:F=`Expected a value of type \`${A}\`${_?` with refinement \`${_}\``:""}, but received: \`${r(p)}\``}=l;return{value:p,type:A,refinement:_,key:S[S.length-1],path:S,branch:v,...l,message:F}}function*h(l,c,f,p){e(l)||(l=[l]);for(let S of l){let v=a(S,c,f,p);v&&(yield v)}}function*u(l,c,f={}){let{path:p=[],branch:S=[l],coerce:v=!1,mask:A=!1}=f,_={path:p,branch:S};if(v&&(l=c.coercer(l,_),A&&c.type!=="type"&&s(c.schema)&&s(l)&&!Array.isArray(l)))for(let D in l)c.schema[D]===void 0&&delete l[D];let F="valid";for(let D of c.validator(l,_))D.explanation=f.message,F="not_valid",yield[D,void 0];for(let[D,Y,qi]of c.entries(l,_)){let Gi=u(Y,qi,{path:D===void 0?p:[...p,D],branch:D===void 0?S:[...S,Y],coerce:v,mask:A,message:f.message});for(let Xt of Gi)Xt[0]?(F=Xt[0].refinement!=null?"not_refined":"not_valid",yield[Xt[0],void 0]):v&&(Y=Xt[1],D===void 0?l=Y:l instanceof Map?l.set(D,Y):l instanceof Set?l.add(Y):s(l)&&(Y!==void 0||D in l)&&(l[D]=Y))}if(F!=="not_valid")for(let D of c.refiner(l,_))D.explanation=f.message,F="not_refined",yield[D,void 0];F==="valid"&&(yield[void 0,l])}class d{constructor(c){let{type:f,schema:p,validator:S,refiner:v,coercer:A=F=>F,entries:_=function*(){}}=c;this.type=f,this.schema=p,this.entries=_,this.coercer=A,S?this.validator=(F,D)=>{let Y=S(F,D);return h(Y,D,this,F)}:this.validator=()=>[],v?this.refiner=(F,D)=>{let Y=v(F,D);return h(Y,D,this,F)}:this.refiner=()=>[]}assert(c,f){return m(c,this,f)}create(c,f){return g(c,this,f)}is(c){return k(c,this)}mask(c,f){return w(c,this,f)}validate(c,f={}){return y(c,this,f)}}function m(l,c,f){let p=y(l,c,{message:f});if(p[0])throw p[0]}function g(l,c,f){let p=y(l,c,{coerce:!0,message:f});if(p[0])throw p[0];return p[1]}function w(l,c,f){let p=y(l,c,{coerce:!0,mask:!0,message:f});if(p[0])throw p[0];return p[1]}function k(l,c){return!y(l,c)[0]}function y(l,c,f={}){let p=u(l,c,f),S=o(p);return S[0]?[new t(S[0],function*(){for(let A of p)A[0]&&(yield A[0])}),void 0]:[void 0,S[1]]}function E(...l){let c=l[0].type==="type",f=l.map(S=>S.schema),p=Object.assign({},...f);return c?Ft(p):_t(p)}function b(l,c){return new d({type:l,schema:null,validator:c})}function O(l,c){return new d({...l,refiner:(f,p)=>f===void 0||l.refiner(f,p),validator(f,p){return f===void 0?!0:(c(f,p),l.validator(f,p))}})}function x(l){return new d({type:"dynamic",schema:null,*entries(c,f){yield*l(c,f).entries(c,f)},validator(c,f){return l(c,f).validator(c,f)},coercer(c,f){return l(c,f).coercer(c,f)},refiner(c,f){return l(c,f).refiner(c,f)}})}function T(l){let c;return new d({type:"lazy",schema:null,*entries(f,p){c??(c=l()),yield*c.entries(f,p)},validator(f,p){return c??(c=l()),c.validator(f,p)},coercer(f,p){return c??(c=l()),c.coercer(f,p)},refiner(f,p){return c??(c=l()),c.refiner(f,p)}})}function P(l,c){let{schema:f}=l,p={...f};for(let S of c)delete p[S];switch(l.type){case"type":return Ft(p);default:return _t(p)}}function R(l){let c=l instanceof d,f=c?{...l.schema}:{...l};for(let p in f)f[p]=Xe(f[p]);return c&&l.type==="type"?Ft(f):_t(f)}function H(l,c){let{schema:f}=l,p={};for(let S of c)p[S]=f[S];switch(l.type){case"type":return Ft(p);default:return _t(p)}}function bt(l,c){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),b(l,c)}function V(){return b("any",()=>!0)}function St(l){return new d({type:"array",schema:l,*entries(c){if(l&&Array.isArray(c))for(let[f,p]of c.entries())yield[f,p,l]},coercer(c){return Array.isArray(c)?c.slice():c},validator(c){return Array.isArray(c)||`Expected an array value, but received: ${r(c)}`}})}function bi(){return b("bigint",l=>typeof l=="bigint")}function Si(){return b("boolean",l=>typeof l=="boolean")}function ki(){return b("date",l=>l instanceof Date&&!isNaN(l.getTime())||`Expected a valid \`Date\` object, but received: ${r(l)}`)}function Ei(l){let c={},f=l.map(p=>r(p)).join();for(let p of l)c[p]=p;return new d({type:"enums",schema:c,validator(p){return l.includes(p)||`Expected one of \`${f}\`, but received: ${r(p)}`}})}function vi(){return b("func",l=>typeof l=="function"||`Expected a function, but received: ${r(l)}`)}function Ti(l){return b("instance",c=>c instanceof l||`Expected a \`${l.name}\` instance, but received: ${r(c)}`)}function xi(){return b("integer",l=>typeof l=="number"&&!isNaN(l)&&Number.isInteger(l)||`Expected an integer, but received: ${r(l)}`)}function Oi(l){return new d({type:"intersection",schema:null,*entries(c,f){for(let p of l)yield*p.entries(c,f)},*validator(c,f){for(let p of l)yield*p.validator(c,f)},*refiner(c,f){for(let p of l)yield*p.refiner(c,f)}})}function Ai(l){let c=r(l),f=typeof l;return new d({type:"literal",schema:f==="string"||f==="number"||f==="boolean"?l:null,validator(p){return p===l||`Expected the literal \`${c}\`, but received: ${r(p)}`}})}function Pi(l,c){return new d({type:"map",schema:null,*entries(f){if(l&&c&&f instanceof Map)for(let[p,S]of f.entries())yield[p,p,l],yield[p,S,c]},coercer(f){return f instanceof Map?new Map(f):f},validator(f){return f instanceof Map||`Expected a \`Map\` object, but received: ${r(f)}`}})}function xe(){return b("never",()=>!1)}function Ri(l){return new d({...l,validator:(c,f)=>c===null||l.validator(c,f),refiner:(c,f)=>c===null||l.refiner(c,f)})}function Di(){return b("number",l=>typeof l=="number"&&!isNaN(l)||`Expected a number, but received: ${r(l)}`)}function _t(l){let c=l?Object.keys(l):[],f=xe();return new d({type:"object",schema:l||null,*entries(p){if(l&&s(p)){let S=new Set(Object.keys(p));for(let v of c)S.delete(v),yield[v,p[v],l[v]];for(let v of S)yield[v,p[v],f]}},validator(p){return s(p)||`Expected an object, but received: ${r(p)}`},coercer(p){return s(p)?{...p}:p}})}function Xe(l){return new d({...l,validator:(c,f)=>c===void 0||l.validator(c,f),refiner:(c,f)=>c===void 0||l.refiner(c,f)})}function _i(l,c){return new d({type:"record",schema:null,*entries(f){if(s(f))for(let p in f){let S=f[p];yield[p,p,l],yield[p,S,c]}},validator(f){return s(f)||`Expected an object, but received: ${r(f)}`}})}function Fi(){return b("regexp",l=>l instanceof RegExp)}function Ci(l){return new d({type:"set",schema:null,*entries(c){if(l&&c instanceof Set)for(let f of c)yield[f,f,l]},coercer(c){return c instanceof Set?new Set(c):c},validator(c){return c instanceof Set||`Expected a \`Set\` object, but received: ${r(c)}`}})}function Ze(){return b("string",l=>typeof l=="string"||`Expected a string, but received: ${r(l)}`)}function Mi(l){let c=xe();return new d({type:"tuple",schema:null,*entries(f){if(Array.isArray(f)){let p=Math.max(l.length,f.length);for(let S=0;S<p;S++)yield[S,f[S],l[S]||c]}},validator(f){return Array.isArray(f)||`Expected an array, but received: ${r(f)}`}})}function Ft(l){let c=Object.keys(l);return new d({type:"type",schema:l,*entries(f){if(s(f))for(let p of c)yield[p,f[p],l[p]]},validator(f){return s(f)||`Expected an object, but received: ${r(f)}`},coercer(f){return s(f)?{...f}:f}})}function ji(l){let c=l.map(f=>f.type).join(" | ");return new d({type:"union",schema:null,coercer(f){for(let p of l){let[S,v]=p.validate(f,{coerce:!0});if(!S)return v}return f},validator(f,p){let S=[];for(let v of l){let[...A]=u(f,v,p),[_]=A;if(_[0])for(let[F]of A)F&&S.push(F);else return[]}return[`Expected the value to satisfy a union of \`${c}\`, but received: ${r(f)}`,...S]}})}function Qe(){return b("unknown",()=>!0)}function Oe(l,c,f){return new d({...l,coercer:(p,S)=>k(p,c)?l.coercer(f(p,S),S):l.coercer(p,S)})}function Ni(l,c,f={}){return Oe(l,Qe(),p=>{let S=typeof c=="function"?c():c;if(p===void 0)return S;if(!f.strict&&n(p)&&n(S)){let v={...p},A=!1;for(let _ in S)v[_]===void 0&&(v[_]=S[_],A=!0);if(A)return v}return p})}function $i(l){return Oe(l,Ze(),c=>c.trim())}function Ii(l){return mt(l,"empty",c=>{let f=ts(c);return f===0||`Expected an empty ${l.type} but received one with a size of \`${f}\``})}function ts(l){return l instanceof Map||l instanceof Set?l.size:l.length}function Li(l,c,f={}){let{exclusive:p}=f;return mt(l,"max",S=>p?S<c:S<=c||`Expected a ${l.type} less than ${p?"":"or equal to "}${c} but received \`${S}\``)}function Wi(l,c,f={}){let{exclusive:p}=f;return mt(l,"min",S=>p?S>c:S>=c||`Expected a ${l.type} greater than ${p?"":"or equal to "}${c} but received \`${S}\``)}function zi(l){return mt(l,"nonempty",c=>ts(c)>0||`Expected a nonempty ${l.type} but received an empty one`)}function Bi(l,c){return mt(l,"pattern",f=>c.test(f)||`Expected a ${l.type} matching \`/${c.source}/\` but received "${f}"`)}function Ui(l,c,f=c){let p=`Expected a ${l.type}`,S=c===f?`of \`${c}\``:`between \`${c}\` and \`${f}\``;return mt(l,"size",v=>{if(typeof v=="number"||v instanceof Date)return c<=v&&v<=f||`${p} ${S} but received \`${v}\``;if(v instanceof Map||v instanceof Set){let{size:A}=v;return c<=A&&A<=f||`${p} with a size ${S} but received one with a size of \`${A}\``}else{let{length:A}=v;return c<=A&&A<=f||`${p} with a length ${S} but received one with a length of \`${A}\``}})}function mt(l,c,f){return new d({...l,*refiner(p,S){yield*l.refiner(p,S);let v=f(p,S),A=h(v,S,l,p);for(let _ of A)yield{..._,refinement:c}}})}i.Struct=d,i.StructError=t,i.any=V,i.array=St,i.assert=m,i.assign=E,i.bigint=bi,i.boolean=Si,i.coerce=Oe,i.create=g,i.date=ki,i.defaulted=Ni,i.define=b,i.deprecated=O,i.dynamic=x,i.empty=Ii,i.enums=Ei,i.func=vi,i.instance=Ti,i.integer=xi,i.intersection=Oi,i.is=k,i.lazy=T,i.literal=Ai,i.map=Pi,i.mask=w,i.max=Li,i.min=Wi,i.never=xe,i.nonempty=zi,i.nullable=Ri,i.number=Di,i.object=_t,i.omit=P,i.optional=Xe,i.partial=R,i.pattern=Bi,i.pick=H,i.record=_i,i.refine=mt,i.regexp=Fi,i.set=Ci,i.size=Ui,i.string=Ze,i.struct=bt,i.trimmed=$i,i.tuple=Mi,i.type=Ft,i.union=ji,i.unknown=Qe,i.validate=y})});var fs=gt(ee=>{"use strict";Object.defineProperty(ee,"__esModule",{value:!0});ee.validateRequirements=void 0;var sn="[",nn="(<=>!~",rn=";",on="@",an=new RegExp(`[${sn+nn+rn+on}]`);function hn(i){return i.split(an)[0].trim()}function ln(i){return i.forEach(e=>{let s;try{s=new URL(e)}catch{return}if(s.protocol==="emfs:"||s.protocol==="file:")throw new Error(`"emfs:" and "file:" protocols are not allowed for the requirement (${e})`)}),i.filter(e=>hn(e)==="streamlit"?(console.warn(`Streamlit is specified in the requirements ("${e}"), but it will be ignored. A built-in version of Streamlit will be used.`),!1):!0)}ee.validateRequirements=ln});var us=gt(se=>{"use strict";Object.defineProperty(se,"__esModule",{value:!0});se.parseRequirementsTxt=void 0;var cn=/\s#.*$/;function fn(i){return i.split(`
|
|
3
|
-
`).filter(t=>!t.startsWith("#")).map(t=>t.replace(cn,"")).map(t=>t.trim()).filter(t=>t!=="")}se.parseRequirementsTxt=fn});var ds=gt(ie=>{"use strict";Object.defineProperty(ie,"__esModule",{value:!0});ie.PromiseDelegate=void 0;var Ae=class{constructor(){this.promise=new Promise((t,e)=>{this.resolveInternal=t,this.rejectInternal=e})}resolve(t){this.resolveInternal(t)}reject(t){this.rejectInternal(t)}};ie.PromiseDelegate=Ae});var ps=gt(ht=>{"use strict";var un=ht&&ht.__createBinding||(Object.create?function(i,t,e,s){s===void 0&&(s=e);var n=Object.getOwnPropertyDescriptor(t,e);(!n||("get"in n?!t.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return t[e]}}),Object.defineProperty(i,s,n)}:function(i,t,e,s){s===void 0&&(s=e),i[s]=t[e]}),Pe=ht&&ht.__exportStar||function(i,t){for(var e in i)e!=="default"&&!Object.prototype.hasOwnProperty.call(t,e)&&un(t,i,e)};Object.defineProperty(ht,"__esModule",{value:!0});Pe(fs(),ht);Pe(us(),ht);Pe(ds(),ht)});var bs=gt((Vr,ys)=>{"use strict";ys.exports=gs;function gs(i,t,e){i instanceof RegExp&&(i=ms(i,e)),t instanceof RegExp&&(t=ms(t,e));var s=ws(i,t,e);return s&&{start:s[0],end:s[1],pre:e.slice(0,s[0]),body:e.slice(s[0]+i.length,s[1]),post:e.slice(s[1]+t.length)}}function ms(i,t){var e=t.match(i);return e?e[0]:null}gs.range=ws;function ws(i,t,e){var s,n,r,o,a,h=e.indexOf(i),u=e.indexOf(t,h+1),d=h;if(h>=0&&u>0){if(i===t)return[h,u];for(s=[],r=e.length;d>=0&&!a;)d==h?(s.push(d),h=e.indexOf(i,d+1)):s.length==1?a=[s.pop(),u]:(n=s.pop(),n<r&&(r=n,o=u),u=e.indexOf(t,d+1)),d=h<u&&h>=0?h:u;s.length&&(a=[r,o])}return a}});var As=gt((Yr,Os)=>{var Ss=bs();Os.exports=mn;var ks="\0SLASH"+Math.random()+"\0",Es="\0OPEN"+Math.random()+"\0",De="\0CLOSE"+Math.random()+"\0",vs="\0COMMA"+Math.random()+"\0",Ts="\0PERIOD"+Math.random()+"\0";function Re(i){return parseInt(i,10)==i?parseInt(i,10):i.charCodeAt(0)}function dn(i){return i.split("\\\\").join(ks).split("\\{").join(Es).split("\\}").join(De).split("\\,").join(vs).split("\\.").join(Ts)}function pn(i){return i.split(ks).join("\\").split(Es).join("{").split(De).join("}").split(vs).join(",").split(Ts).join(".")}function xs(i){if(!i)return[""];var t=[],e=Ss("{","}",i);if(!e)return i.split(",");var s=e.pre,n=e.body,r=e.post,o=s.split(",");o[o.length-1]+="{"+n+"}";var a=xs(r);return r.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),t.push.apply(t,o),t}function mn(i){return i?(i.substr(0,2)==="{}"&&(i="\\{\\}"+i.substr(2)),Mt(dn(i),!0).map(pn)):[]}function gn(i){return"{"+i+"}"}function wn(i){return/^-?0\d/.test(i)}function yn(i,t){return i<=t}function bn(i,t){return i>=t}function Mt(i,t){var e=[],s=Ss("{","}",i);if(!s)return[i];var n=s.pre,r=s.post.length?Mt(s.post,!1):[""];if(/\$$/.test(s.pre))for(var o=0;o<r.length;o++){var a=n+"{"+s.body+"}"+r[o];e.push(a)}else{var h=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(s.body),u=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(s.body),d=h||u,m=s.body.indexOf(",")>=0;if(!d&&!m)return s.post.match(/,.*\}/)?(i=s.pre+"{"+s.body+De+s.post,Mt(i)):[i];var g;if(d)g=s.body.split(/\.\./);else if(g=xs(s.body),g.length===1&&(g=Mt(g[0],!1).map(gn),g.length===1))return r.map(function(St){return s.pre+g[0]+St});var w;if(d){var k=Re(g[0]),y=Re(g[1]),E=Math.max(g[0].length,g[1].length),b=g.length==3?Math.abs(Re(g[2])):1,O=yn,x=y<k;x&&(b*=-1,O=bn);var T=g.some(wn);w=[];for(var P=k;O(P,y);P+=b){var R;if(u)R=String.fromCharCode(P),R==="\\"&&(R="");else if(R=String(P),T){var H=E-R.length;if(H>0){var bt=new Array(H+1).join("0");P<0?R="-"+bt+R.slice(1):R=bt+R}}w.push(R)}}else{w=[];for(var V=0;V<g.length;V++)w.push.apply(w,Mt(g[V],!1))}for(var V=0;V<w.length;V++)for(var o=0;o<r.length;o++){var a=n+w[V]+r[o];(!t||d||a)&&e.push(a)}}return e}});var mi=U(require("yargs")),gi=require("yargs/helpers"),W=U(require("node:path")),at=U(require("node:fs/promises")),Ke=U(require("fs-extra")),Ve=U(require("node-fetch")),Ye=require("pyodide");var ss=require("pyodide");function Zt(i){return`https://cdn.jsdelivr.net/pyodide/v${ss.version}/full/${i}`}var is=U(require("node-fetch"));var Ct=class i{static _instance;_data=null;constructor(){}static async loadPrebuiltPackageData(){let t=Zt("pyodide-lock.json");return console.log(`Load the Pyodide pyodide-lock.json from ${t}`),(await(await(0,is.default)(t,void 0)).json()).packages}static async getInstance(){return this._instance==null&&(this._instance=new i,this._instance._data=await this.loadPrebuiltPackageData()),this._instance}getPackageInfoByName(t){if(this._data==null)throw new Error("The package data is not loaded yet.");let e=Object.values(this._data).find(s=>s.name===t);if(e==null)throw new Error(`Package ${t} is not found in the lock file.`);return e}};var os=U(require("node:fs/promises")),as=U(te());var C=U(te()),rs=C.object({entrypoint:C.string(),embed:C.defaulted(C.boolean(),!1),idbfsMountpoints:C.optional(C.array(C.string())),nodeJsWorker:C.defaulted(C.boolean(),!1),nodefsMountpoints:C.optional(C.record(C.string(),C.string()))});function Zi(i){let t=as.mask(i??{},rs);if(t.nodeJsWorker){if(t.idbfsMountpoints!=null)throw new Error("The `idbfsMountpoints` field is not allowed when `nodeJsWorker` is true.")}else if(t.nodefsMountpoints!=null)throw new Error("The `nodefsMountpoints` field is not allowed when `nodeJsWorker` is false.");return t}async function hs(i){let t=Zi({...i.packageJsonStliteDesktopField,...i.fallbacks}),e=JSON.stringify(t,null,2);console.log(`Dump the manifest file -> ${i.manifestFilePath}`),console.log(e),await os.default.writeFile(i.manifestFilePath,e,{encoding:"utf-8"})}var ls=U(require("node:path")),I=U(te());async function cs(i){let{files:t,entrypoint:e}=Qi(i),s=await tn(i),n=await en(i);return{files:t,entrypoint:e,dependencies:s,requirementsTxtFilePaths:n}}function Qi(i){let{packageJsonStliteDesktopField:t,fallbacks:{appHomeDirSource:e}}=i,s=t?.files,n=t?.entrypoint;if(s==null||n==null){console.warn("`stlite.desktop.files` and `stlite.desktop.entrypoint` are not found in `package.json`. Read the `appHomeDirSource` argument as the app directory. This behavior will be deprecated in the future.");let r=e;if(typeof r!="string")throw new Error("The `appHomeDirSource` argument is required when `stlite.desktop.files` and `stlite.desktop.entrypoint` are not found in the package.json.\nNote that `appHomeDirSource` is deprecated and will be removed in the future, so please specify `stlite.desktop.files` and `stlite.desktop.entrypoint` in the package.json.");s=[r],n=`./${r}/streamlit_app.py`}else e!=null&&console.warn("[Deprecated] `appHomeDirSource` is ignored because `stlite.desktop.files` is found in `package.json`.");return I.assert(n,I.string(),"The `stlite.desktop.entrypoint` field must be a string."),I.assert(s,I.array(I.string()),"The `stlite.desktop.files` field must be an array of strings."),{files:s,entrypoint:n}}async function tn(i){let{packageJsonStliteDesktopField:t,fallbacks:{packages:e}}=i,s=t?.dependencies;I.assert(s,I.optional(I.array(I.string())),"The `stlite.desktop.dependencies` field must be an array of strings.");let n=[];return e!=null&&(console.warn("The `packages` argument is deprecated and will be removed in the future. Please specify `stlite.desktop.dependencies` in the package.json for that purpose."),n=e),[...s??[],...n]}async function en(i){let{pathResolutionRoot:t,packageJsonStliteDesktopField:e,fallbacks:{requirementsTxtFilePaths:s}}=i,n=e?.requirementsTxtFiles;I.assert(n,I.optional(I.array(I.string())),"The `stlite.desktop.requirementsTxtFiles` field must be an array of strings.");let r=n?.map(a=>ls.default.resolve(t,a)),o=[];return s!=null&&s.length>0&&(console.warn("The `requirement` argument is deprecated and will be removed in the future. Please specify `stlite.desktop.requirementsTxtFiles` in the package.json for that purpose."),o=s),[...r??[],...o]}var Te=U(ps());var js=U(As(),1);var jt=i=>{if(typeof i!="string")throw new TypeError("invalid pattern");if(i.length>65536)throw new TypeError("pattern is too long")};var Sn={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},Nt=i=>i.replace(/[[\]\\-]/g,"\\$&"),kn=i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Ps=i=>i.join(""),Rs=(i,t)=>{let e=t;if(i.charAt(e)!=="[")throw new Error("not in a brace expression");let s=[],n=[],r=e+1,o=!1,a=!1,h=!1,u=!1,d=e,m="";t:for(;r<i.length;){let y=i.charAt(r);if((y==="!"||y==="^")&&r===e+1){u=!0,r++;continue}if(y==="]"&&o&&!h){d=r+1;break}if(o=!0,y==="\\"&&!h){h=!0,r++;continue}if(y==="["&&!h){for(let[E,[b,O,x]]of Object.entries(Sn))if(i.startsWith(E,r)){if(m)return["$.",!1,i.length-e,!0];r+=E.length,x?n.push(b):s.push(b),a=a||O;continue t}}if(h=!1,m){y>m?s.push(Nt(m)+"-"+Nt(y)):y===m&&s.push(Nt(y)),m="",r++;continue}if(i.startsWith("-]",r+1)){s.push(Nt(y+"-")),r+=2;continue}if(i.startsWith("-",r+1)){m=y,r+=2;continue}s.push(Nt(y)),r++}if(d<r)return["",!1,0,!1];if(!s.length&&!n.length)return["$.",!1,i.length-e,!0];if(n.length===0&&s.length===1&&/^\\?.$/.test(s[0])&&!u){let y=s[0].length===2?s[0].slice(-1):s[0];return[kn(y),!1,d-e,!1]}let g="["+(u?"^":"")+Ps(s)+"]",w="["+(u?"":"^")+Ps(n)+"]";return[s.length&&n.length?"("+g+"|"+w+")":s.length?g:w,a,d-e,!0]};var tt=(i,{windowsPathsNoEscape:t=!1}={})=>t?i.replace(/\[([^\/\\])\]/g,"$1"):i.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");var En=new Set(["!","?","+","*","@"]),Ds=i=>En.has(i),vn="(?!(?:^|/)\\.\\.?(?:$|/))",ne="(?!\\.)",Tn=new Set(["[","."]),xn=new Set(["..","."]),On=new Set("().*{}+?[]^$\\!"),An=i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),_e="[^/]",_s=_e+"*?",Fs=_e+"+?",kt=class i{type;#t;#s;#r=!1;#i=[];#a;#l;#f;#h=!1;#o;#e;#m=!1;constructor(t,e,s={}){this.type=t,t&&(this.#s=!0),this.#a=e,this.#t=this.#a?this.#a.#t:this,this.#o=this.#t===this?s:this.#t.#o,this.#f=this.#t===this?[]:this.#t.#f,t==="!"&&!this.#t.#h&&this.#f.push(this),this.#l=this.#a?this.#a.#i.length:0}get hasMagic(){if(this.#s!==void 0)return this.#s;for(let t of this.#i)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#s=!0;return this.#s}toString(){return this.#e!==void 0?this.#e:this.type?this.#e=this.type+"("+this.#i.map(t=>String(t)).join("|")+")":this.#e=this.#i.map(t=>String(t)).join("")}#w(){if(this!==this.#t)throw new Error("should only call on root");if(this.#h)return this;this.toString(),this.#h=!0;let t;for(;t=this.#f.pop();){if(t.type!=="!")continue;let e=t,s=e.#a;for(;s;){for(let n=e.#l+1;!s.type&&n<s.#i.length;n++)for(let r of t.#i){if(typeof r=="string")throw new Error("string part in extglob AST??");r.copyIn(s.#i[n])}e=s,s=e.#a}}return this}push(...t){for(let e of t)if(e!==""){if(typeof e!="string"&&!(e instanceof i&&e.#a===this))throw new Error("invalid part: "+e);this.#i.push(e)}}toJSON(){let t=this.type===null?this.#i.slice().map(e=>typeof e=="string"?e:e.toJSON()):[this.type,...this.#i.map(e=>e.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#t||this.#t.#h&&this.#a?.type==="!")&&t.push({}),t}isStart(){if(this.#t===this)return!0;if(!this.#a?.isStart())return!1;if(this.#l===0)return!0;let t=this.#a;for(let e=0;e<this.#l;e++){let s=t.#i[e];if(!(s instanceof i&&s.type==="!"))return!1}return!0}isEnd(){if(this.#t===this||this.#a?.type==="!")return!0;if(!this.#a?.isEnd())return!1;if(!this.type)return this.#a?.isEnd();let t=this.#a?this.#a.#i.length:0;return this.#l===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){let e=new i(this.type,t);for(let s of this.#i)e.copyIn(s);return e}static#d(t,e,s,n){let r=!1,o=!1,a=-1,h=!1;if(e.type===null){let w=s,k="";for(;w<t.length;){let y=t.charAt(w++);if(r||y==="\\"){r=!r,k+=y;continue}if(o){w===a+1?(y==="^"||y==="!")&&(h=!0):y==="]"&&!(w===a+2&&h)&&(o=!1),k+=y;continue}else if(y==="["){o=!0,a=w,h=!1,k+=y;continue}if(!n.noext&&Ds(y)&&t.charAt(w)==="("){e.push(k),k="";let E=new i(y,e);w=i.#d(t,E,w,n),e.push(E);continue}k+=y}return e.push(k),w}let u=s+1,d=new i(null,e),m=[],g="";for(;u<t.length;){let w=t.charAt(u++);if(r||w==="\\"){r=!r,g+=w;continue}if(o){u===a+1?(w==="^"||w==="!")&&(h=!0):w==="]"&&!(u===a+2&&h)&&(o=!1),g+=w;continue}else if(w==="["){o=!0,a=u,h=!1,g+=w;continue}if(Ds(w)&&t.charAt(u)==="("){d.push(g),g="";let k=new i(w,d);d.push(k),u=i.#d(t,k,u,n);continue}if(w==="|"){d.push(g),g="",m.push(d),d=new i(null,e);continue}if(w===")")return g===""&&e.#i.length===0&&(e.#m=!0),d.push(g),g="",e.push(...m,d),u;g+=w}return e.type=null,e.#s=void 0,e.#i=[t.substring(s-1)],u}static fromGlob(t,e={}){let s=new i(null,void 0,e);return i.#d(t,s,0,e),s}toMMPattern(){if(this!==this.#t)return this.#t.toMMPattern();let t=this.toString(),[e,s,n,r]=this.toRegExpSource();if(!(n||this.#s||this.#o.nocase&&!this.#o.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return s;let a=(this.#o.nocase?"i":"")+(r?"u":"");return Object.assign(new RegExp(`^${e}$`,a),{_src:e,_glob:t})}toRegExpSource(t){let e=t??!!this.#o.dot;if(this.#t===this&&this.#w(),!this.type){let h=this.isStart()&&this.isEnd(),u=this.#i.map(w=>{let[k,y,E,b]=typeof w=="string"?i.#S(w,this.#s,h):w.toRegExpSource(t);return this.#s=this.#s||E,this.#r=this.#r||b,k}).join(""),d="";if(this.isStart()&&typeof this.#i[0]=="string"&&!(this.#i.length===1&&xn.has(this.#i[0]))){let k=Tn,y=e&&k.has(u.charAt(0))||u.startsWith("\\.")&&k.has(u.charAt(2))||u.startsWith("\\.\\.")&&k.has(u.charAt(4)),E=!e&&!t&&k.has(u.charAt(0));d=y?vn:E?ne:""}let m="";return this.isEnd()&&this.#t.#h&&this.#a?.type==="!"&&(m="(?:$|\\/)"),[d+u+m,tt(u),this.#s=!!this.#s,this.#r]}let s=this.type==="*"||this.type==="+",n=this.type==="!"?"(?:(?!(?:":"(?:",r=this.#u(e);if(this.isStart()&&this.isEnd()&&!r&&this.type!=="!"){let h=this.toString();return this.#i=[h],this.type=null,this.#s=void 0,[h,tt(this.toString()),!1,!1]}let o=!s||t||e||!ne?"":this.#u(!0);o===r&&(o=""),o&&(r=`(?:${r})(?:${o})*?`);let a="";if(this.type==="!"&&this.#m)a=(this.isStart()&&!e?ne:"")+Fs;else{let h=this.type==="!"?"))"+(this.isStart()&&!e&&!t?ne:"")+_s+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=n+r+h}return[a,tt(r),this.#s=!!this.#s,this.#r]}#u(t){return this.#i.map(e=>{if(typeof e=="string")throw new Error("string type in extglob ast??");let[s,n,r,o]=e.toRegExpSource(t);return this.#r=this.#r||o,s}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join("|")}static#S(t,e,s=!1){let n=!1,r="",o=!1;for(let a=0;a<t.length;a++){let h=t.charAt(a);if(n){n=!1,r+=(On.has(h)?"\\":"")+h;continue}if(h==="\\"){a===t.length-1?r+="\\\\":n=!0;continue}if(h==="["){let[u,d,m,g]=Rs(t,a);if(m){r+=u,o=o||d,a+=m-1,e=e||g;continue}}if(h==="*"){s&&t==="*"?r+=Fs:r+=_s,e=!0;continue}if(h==="?"){r+=_e,e=!0;continue}r+=An(h)}return[r,tt(t),!!e,o]}};var Et=(i,{windowsPathsNoEscape:t=!1}={})=>t?i.replace(/[?*()[\]]/g,"[$&]"):i.replace(/[?*()[\]\\]/g,"\\$&");var q=(i,t,e={})=>(jt(t),!e.nocomment&&t.charAt(0)==="#"?!1:new J(t,e).match(i)),Pn=/^\*+([^+@!?\*\[\(]*)$/,Rn=i=>t=>!t.startsWith(".")&&t.endsWith(i),Dn=i=>t=>t.endsWith(i),_n=i=>(i=i.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(i)),Fn=i=>(i=i.toLowerCase(),t=>t.toLowerCase().endsWith(i)),Cn=/^\*+\.\*+$/,Mn=i=>!i.startsWith(".")&&i.includes("."),jn=i=>i!=="."&&i!==".."&&i.includes("."),Nn=/^\.\*+$/,$n=i=>i!=="."&&i!==".."&&i.startsWith("."),In=/^\*+$/,Ln=i=>i.length!==0&&!i.startsWith("."),Wn=i=>i.length!==0&&i!=="."&&i!=="..",zn=/^\?+([^+@!?\*\[\(]*)?$/,Bn=([i,t=""])=>{let e=Ns([i]);return t?(t=t.toLowerCase(),s=>e(s)&&s.toLowerCase().endsWith(t)):e},Un=([i,t=""])=>{let e=$s([i]);return t?(t=t.toLowerCase(),s=>e(s)&&s.toLowerCase().endsWith(t)):e},qn=([i,t=""])=>{let e=$s([i]);return t?s=>e(s)&&s.endsWith(t):e},Gn=([i,t=""])=>{let e=Ns([i]);return t?s=>e(s)&&s.endsWith(t):e},Ns=([i])=>{let t=i.length;return e=>e.length===t&&!e.startsWith(".")},$s=([i])=>{let t=i.length;return e=>e.length===t&&e!=="."&&e!==".."},Is=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Cs={win32:{sep:"\\"},posix:{sep:"/"}},Hn=Is==="win32"?Cs.win32.sep:Cs.posix.sep;q.sep=Hn;var L=Symbol("globstar **");q.GLOBSTAR=L;var Jn="[^/]",Kn=Jn+"*?",Vn="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",Yn="(?:(?!(?:\\/|^)\\.).)*?",Xn=(i,t={})=>e=>q(e,i,t);q.filter=Xn;var X=(i,t={})=>Object.assign({},i,t),Zn=i=>{if(!i||typeof i!="object"||!Object.keys(i).length)return q;let t=q;return Object.assign((s,n,r={})=>t(s,n,X(i,r)),{Minimatch:class extends t.Minimatch{constructor(n,r={}){super(n,X(i,r))}static defaults(n){return t.defaults(X(i,n)).Minimatch}},AST:class extends t.AST{constructor(n,r,o={}){super(n,r,X(i,o))}static fromGlob(n,r={}){return t.AST.fromGlob(n,X(i,r))}},unescape:(s,n={})=>t.unescape(s,X(i,n)),escape:(s,n={})=>t.escape(s,X(i,n)),filter:(s,n={})=>t.filter(s,X(i,n)),defaults:s=>t.defaults(X(i,s)),makeRe:(s,n={})=>t.makeRe(s,X(i,n)),braceExpand:(s,n={})=>t.braceExpand(s,X(i,n)),match:(s,n,r={})=>t.match(s,n,X(i,r)),sep:t.sep,GLOBSTAR:L})};q.defaults=Zn;var Ls=(i,t={})=>(jt(i),t.nobrace||!/\{(?:(?!\{).)*\}/.test(i)?[i]:(0,js.default)(i));q.braceExpand=Ls;var Qn=(i,t={})=>new J(i,t).makeRe();q.makeRe=Qn;var tr=(i,t,e={})=>{let s=new J(t,e);return i=i.filter(n=>s.match(n)),s.options.nonull&&!i.length&&i.push(t),i};q.match=tr;var Ms=/[?*]|[+@!]\(.*?\)|\[|\]/,er=i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),J=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(t,e={}){jt(t),e=e||{},this.options=e,this.pattern=t,this.platform=e.platform||Is,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!e.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!e.nonegate,this.comment=!1,this.empty=!1,this.partial=!!e.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=e.windowsNoMagicRoot!==void 0?e.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let t of this.set)for(let e of t)if(typeof e!="string")return!0;return!1}debug(...t){}make(){let t=this.pattern,e=this.options;if(!e.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],e.debug&&(this.debug=(...r)=>console.error(...r)),this.debug(this.pattern,this.globSet);let s=this.globSet.map(r=>this.slashSplit(r));this.globParts=this.preprocess(s),this.debug(this.pattern,this.globParts);let n=this.globParts.map((r,o,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){let h=r[0]===""&&r[1]===""&&(r[2]==="?"||!Ms.test(r[2]))&&!Ms.test(r[3]),u=/^[a-z]:/i.test(r[0]);if(h)return[...r.slice(0,4),...r.slice(4).map(d=>this.parse(d))];if(u)return[r[0],...r.slice(1).map(d=>this.parse(d))]}return r.map(h=>this.parse(h))});if(this.debug(this.pattern,n),this.set=n.filter(r=>r.indexOf(!1)===-1),this.isWindows)for(let r=0;r<this.set.length;r++){let o=this.set[r];o[0]===""&&o[1]===""&&this.globParts[r][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let s=0;s<t.length;s++)for(let n=0;n<t[s].length;n++)t[s][n]==="**"&&(t[s][n]="*");let{optimizationLevel:e=1}=this.options;return e>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):e>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(e=>{let s=-1;for(;(s=e.indexOf("**",s+1))!==-1;){let n=s;for(;e[n+1]==="**";)n++;n!==s&&e.splice(s,n-s)}return e})}levelOneOptimize(t){return t.map(e=>(e=e.reduce((s,n)=>{let r=s[s.length-1];return n==="**"&&r==="**"?s:n===".."&&r&&r!==".."&&r!=="."&&r!=="**"?(s.pop(),s):(s.push(n),s)},[]),e.length===0?[""]:e))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let e=!1;do{if(e=!1,!this.preserveMultipleSlashes){for(let n=1;n<t.length-1;n++){let r=t[n];n===1&&r===""&&t[0]===""||(r==="."||r==="")&&(e=!0,t.splice(n,1),n--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(e=!0,t.pop())}let s=0;for(;(s=t.indexOf("..",s+1))!==-1;){let n=t[s-1];n&&n!=="."&&n!==".."&&n!=="**"&&(e=!0,t.splice(s-1,2),s-=2)}}while(e);return t.length===0?[""]:t}firstPhasePreProcess(t){let e=!1;do{e=!1;for(let s of t){let n=-1;for(;(n=s.indexOf("**",n+1))!==-1;){let o=n;for(;s[o+1]==="**";)o++;o>n&&s.splice(n+1,o-n);let a=s[n+1],h=s[n+2],u=s[n+3];if(a!==".."||!h||h==="."||h===".."||!u||u==="."||u==="..")continue;e=!0,s.splice(n,1);let d=s.slice(0);d[n]="**",t.push(d),n--}if(!this.preserveMultipleSlashes){for(let o=1;o<s.length-1;o++){let a=s[o];o===1&&a===""&&s[0]===""||(a==="."||a==="")&&(e=!0,s.splice(o,1),o--)}s[0]==="."&&s.length===2&&(s[1]==="."||s[1]==="")&&(e=!0,s.pop())}let r=0;for(;(r=s.indexOf("..",r+1))!==-1;){let o=s[r-1];if(o&&o!=="."&&o!==".."&&o!=="**"){e=!0;let h=r===1&&s[r+1]==="**"?["."]:[];s.splice(r-1,2,...h),s.length===0&&s.push(""),r-=2}}}}while(e);return t}secondPhasePreProcess(t){for(let e=0;e<t.length-1;e++)for(let s=e+1;s<t.length;s++){let n=this.partsMatch(t[e],t[s],!this.preserveMultipleSlashes);n&&(t[e]=n,t[s]=[])}return t.filter(e=>e.length)}partsMatch(t,e,s=!1){let n=0,r=0,o=[],a="";for(;n<t.length&&r<e.length;)if(t[n]===e[r])o.push(a==="b"?e[r]:t[n]),n++,r++;else if(s&&t[n]==="**"&&e[r]===t[n+1])o.push(t[n]),n++;else if(s&&e[r]==="**"&&t[n]===e[r+1])o.push(e[r]),r++;else if(t[n]==="*"&&e[r]&&(this.options.dot||!e[r].startsWith("."))&&e[r]!=="**"){if(a==="b")return!1;a="a",o.push(t[n]),n++,r++}else if(e[r]==="*"&&t[n]&&(this.options.dot||!t[n].startsWith("."))&&t[n]!=="**"){if(a==="a")return!1;a="b",o.push(e[r]),n++,r++}else return!1;return t.length===e.length&&o}parseNegate(){if(this.nonegate)return;let t=this.pattern,e=!1,s=0;for(let n=0;n<t.length&&t.charAt(n)==="!";n++)e=!e,s++;s&&(this.pattern=t.slice(s)),this.negate=e}matchOne(t,e,s=!1){let n=this.options;if(this.isWindows){let y=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),E=!y&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),b=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),O=!b&&e[0]===""&&e[1]===""&&e[2]==="?"&&typeof e[3]=="string"&&/^[a-z]:$/i.test(e[3]),x=E?3:y?0:void 0,T=O?3:b?0:void 0;if(typeof x=="number"&&typeof T=="number"){let[P,R]=[t[x],e[T]];P.toLowerCase()===R.toLowerCase()&&(e[T]=P,T>x?e=e.slice(T):x>T&&(t=t.slice(x)))}}let{optimizationLevel:r=1}=this.options;r>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:e}),this.debug("matchOne",t.length,e.length);for(var o=0,a=0,h=t.length,u=e.length;o<h&&a<u;o++,a++){this.debug("matchOne loop");var d=e[a],m=t[o];if(this.debug(e,d,m),d===!1)return!1;if(d===L){this.debug("GLOBSTAR",[e,d,m]);var g=o,w=a+1;if(w===u){for(this.debug("** at the end");o<h;o++)if(t[o]==="."||t[o]===".."||!n.dot&&t[o].charAt(0)===".")return!1;return!0}for(;g<h;){var k=t[g];if(this.debug(`
|
|
4
|
-
|
|
5
|
-
>>> no match, partial?`,t,g,e,w),g===h))}let y;if(typeof d=="string"?(y=m===d,this.debug("string match",d,m,y)):(y=d.test(m),this.debug("pattern match",d,m,y)),!y)return!1}if(o===h&&a===u)return!0;if(o===h)return s;if(a===u)return o===h-1&&t[o]==="";throw new Error("wtf?")}braceExpand(){return Ls(this.pattern,this.options)}parse(t){jt(t);let e=this.options;if(t==="**")return L;if(t==="")return"";let s,n=null;(s=t.match(In))?n=e.dot?Wn:Ln:(s=t.match(Pn))?n=(e.nocase?e.dot?Fn:_n:e.dot?Dn:Rn)(s[1]):(s=t.match(zn))?n=(e.nocase?e.dot?Un:Bn:e.dot?qn:Gn)(s):(s=t.match(Cn))?n=e.dot?jn:Mn:(s=t.match(Nn))&&(n=$n);let r=kt.fromGlob(t,this.options).toMMPattern();return n?Object.assign(r,{test:n}):r}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let e=this.options,s=e.noglobstar?Kn:e.dot?Vn:Yn,n=new Set(e.nocase?["i"]:[]),r=t.map(h=>{let u=h.map(d=>{if(d instanceof RegExp)for(let m of d.flags.split(""))n.add(m);return typeof d=="string"?er(d):d===L?L:d._src});return u.forEach((d,m)=>{let g=u[m+1],w=u[m-1];d!==L||w===L||(w===void 0?g!==void 0&&g!==L?u[m+1]="(?:\\/|"+s+"\\/)?"+g:u[m]=s:g===void 0?u[m-1]=w+"(?:\\/|"+s+")?":g!==L&&(u[m-1]=w+"(?:\\/|\\/"+s+"\\/)"+g,u[m+1]=L))}),u.filter(d=>d!==L).join("/")}).join("|"),[o,a]=t.length>1?["(?:",")"]:["",""];r="^"+o+r+a+"$",this.negate&&(r="^(?!"+r+").+$");try{this.regexp=new RegExp(r,[...n].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,e=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&e)return!0;let s=this.options;this.isWindows&&(t=t.split("\\").join("/"));let n=this.slashSplit(t);this.debug(this.pattern,"split",n);let r=this.set;this.debug(this.pattern,"set",r);let o=n[n.length-1];if(!o)for(let a=n.length-2;!o&&a>=0;a--)o=n[a];for(let a=0;a<r.length;a++){let h=r[a],u=n;if(s.matchBase&&h.length===1&&(u=[o]),this.matchOne(u,h,e))return s.flipNegate?!0:!this.negate}return s.flipNegate?!1:this.negate}static defaults(t){return q.defaults(t).Minimatch}};q.AST=kt;q.Minimatch=J;q.escape=Et;q.unescape=tt;var vt=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,zs=new Set,Fe=typeof process=="object"&&process?process:{},Bs=(i,t,e,s)=>{typeof Fe.emitWarning=="function"?Fe.emitWarning(i,t,e,s):console.error(`[${e}] ${t}: ${i}`)},re=globalThis.AbortController,Ws=globalThis.AbortSignal;if(typeof re>"u"){Ws=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(s,n){this._onabort.push(n)}},re=class{constructor(){t()}signal=new Ws;abort(s){if(!this.signal.aborted){this.signal.reason=s,this.signal.aborted=!0;for(let n of this.signal._onabort)n(s);this.signal.onabort?.(s)}}};let i=Fe.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",t=()=>{i&&(i=!1,Bs("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t))}}var sr=i=>!zs.has(i),wo=Symbol("type"),ft=i=>i&&i===Math.floor(i)&&i>0&&isFinite(i),Us=i=>ft(i)?i<=Math.pow(2,8)?Uint8Array:i<=Math.pow(2,16)?Uint16Array:i<=Math.pow(2,32)?Uint32Array:i<=Number.MAX_SAFE_INTEGER?Tt:null:null,Tt=class extends Array{constructor(t){super(t),this.fill(0)}},Ce=class i{heap;length;static#t=!1;static create(t){let e=Us(t);if(!e)return[];i.#t=!0;let s=new i(t,e);return i.#t=!1,s}constructor(t,e){if(!i.#t)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}},$t=class i{#t;#s;#r;#i;#a;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#l;#f;#h;#o;#e;#m;#w;#d;#u;#S;#g;#x;#O;#k;#b;#P;#p;static unsafeExposeInternals(t){return{starts:t.#O,ttls:t.#k,sizes:t.#x,keyMap:t.#h,keyList:t.#o,valList:t.#e,next:t.#m,prev:t.#w,get head(){return t.#d},get tail(){return t.#u},free:t.#S,isBackgroundFetch:e=>t.#c(e),backgroundFetch:(e,s,n,r)=>t.#M(e,s,n,r),moveToTail:e=>t.#C(e),indexes:e=>t.#T(e),rindexes:e=>t.#R(e),isStale:e=>t.#y(e)}}get max(){return this.#t}get maxSize(){return this.#s}get calculatedSize(){return this.#f}get size(){return this.#l}get fetchMethod(){return this.#a}get dispose(){return this.#r}get disposeAfter(){return this.#i}constructor(t){let{max:e=0,ttl:s,ttlResolution:n=1,ttlAutopurge:r,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:h,dispose:u,disposeAfter:d,noDisposeOnSet:m,noUpdateTTL:g,maxSize:w=0,maxEntrySize:k=0,sizeCalculation:y,fetchMethod:E,noDeleteOnFetchRejection:b,noDeleteOnStaleGet:O,allowStaleOnFetchRejection:x,allowStaleOnFetchAbort:T,ignoreFetchAbort:P}=t;if(e!==0&&!ft(e))throw new TypeError("max option must be a nonnegative integer");let R=e?Us(e):Array;if(!R)throw new Error("invalid max value: "+e);if(this.#t=e,this.#s=w,this.maxEntrySize=k||this.#s,this.sizeCalculation=y,this.sizeCalculation){if(!this.#s&&!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(E!==void 0&&typeof E!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#a=E,this.#P=!!E,this.#h=new Map,this.#o=new Array(e).fill(void 0),this.#e=new Array(e).fill(void 0),this.#m=new R(e),this.#w=new R(e),this.#d=0,this.#u=0,this.#S=Ce.create(e),this.#l=0,this.#f=0,typeof u=="function"&&(this.#r=u),typeof d=="function"?(this.#i=d,this.#g=[]):(this.#i=void 0,this.#g=void 0),this.#b=!!this.#r,this.#p=!!this.#i,this.noDisposeOnSet=!!m,this.noUpdateTTL=!!g,this.noDeleteOnFetchRejection=!!b,this.allowStaleOnFetchRejection=!!x,this.allowStaleOnFetchAbort=!!T,this.ignoreFetchAbort=!!P,this.maxEntrySize!==0){if(this.#s!==0&&!ft(this.#s))throw new TypeError("maxSize must be a positive integer if specified");if(!ft(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#_()}if(this.allowStale=!!h,this.noDeleteOnStaleGet=!!O,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=ft(n)||n===0?n:1,this.ttlAutopurge=!!r,this.ttl=s||0,this.ttl){if(!ft(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#D()}if(this.#t===0&&this.ttl===0&&this.#s===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#s){let H="LRU_CACHE_UNBOUNDED";sr(H)&&(zs.add(H),Bs("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",H,i))}}getRemainingTTL(t){return this.#h.has(t)?1/0:0}#D(){let t=new Tt(this.#t),e=new Tt(this.#t);this.#k=t,this.#O=e,this.#n=(r,o,a=vt.now())=>{if(e[r]=o!==0?a:0,t[r]=o,o!==0&&this.ttlAutopurge){let h=setTimeout(()=>{this.#y(r)&&this.delete(this.#o[r])},o+1);h.unref&&h.unref()}},this.#A=r=>{e[r]=t[r]!==0?vt.now():0},this.#E=(r,o)=>{if(t[o]){let a=t[o],h=e[o];if(!a||!h)return;r.ttl=a,r.start=h,r.now=s||n();let u=r.now-h;r.remainingTTL=a-u}};let s=0,n=()=>{let r=vt.now();if(this.ttlResolution>0){s=r;let o=setTimeout(()=>s=0,this.ttlResolution);o.unref&&o.unref()}return r};this.getRemainingTTL=r=>{let o=this.#h.get(r);if(o===void 0)return 0;let a=t[o],h=e[o];if(!a||!h)return 1/0;let u=(s||n())-h;return a-u},this.#y=r=>{let o=e[r],a=t[r];return!!a&&!!o&&(s||n())-o>a}}#A=()=>{};#E=()=>{};#n=()=>{};#y=()=>!1;#_(){let t=new Tt(this.#t);this.#f=0,this.#x=t,this.#v=e=>{this.#f-=t[e],t[e]=0},this.#N=(e,s,n,r)=>{if(this.#c(s))return 0;if(!ft(n))if(r){if(typeof r!="function")throw new TypeError("sizeCalculation must be a function");if(n=r(s,e),!ft(n))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 n},this.#j=(e,s,n)=>{if(t[e]=s,this.#s){let r=this.#s-t[e];for(;this.#f>r;)this.#F(!0)}this.#f+=t[e],n&&(n.entrySize=s,n.totalCalculatedSize=this.#f)}}#v=t=>{};#j=(t,e,s)=>{};#N=(t,e,s,n)=>{if(s||n)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#T({allowStale:t=this.allowStale}={}){if(this.#l)for(let e=this.#u;!(!this.#$(e)||((t||!this.#y(e))&&(yield e),e===this.#d));)e=this.#w[e]}*#R({allowStale:t=this.allowStale}={}){if(this.#l)for(let e=this.#d;!(!this.#$(e)||((t||!this.#y(e))&&(yield e),e===this.#u));)e=this.#m[e]}#$(t){return t!==void 0&&this.#h.get(this.#o[t])===t}*entries(){for(let t of this.#T())this.#e[t]!==void 0&&this.#o[t]!==void 0&&!this.#c(this.#e[t])&&(yield[this.#o[t],this.#e[t]])}*rentries(){for(let t of this.#R())this.#e[t]!==void 0&&this.#o[t]!==void 0&&!this.#c(this.#e[t])&&(yield[this.#o[t],this.#e[t]])}*keys(){for(let t of this.#T()){let e=this.#o[t];e!==void 0&&!this.#c(this.#e[t])&&(yield e)}}*rkeys(){for(let t of this.#R()){let e=this.#o[t];e!==void 0&&!this.#c(this.#e[t])&&(yield e)}}*values(){for(let t of this.#T())this.#e[t]!==void 0&&!this.#c(this.#e[t])&&(yield this.#e[t])}*rvalues(){for(let t of this.#R())this.#e[t]!==void 0&&!this.#c(this.#e[t])&&(yield this.#e[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,e={}){for(let s of this.#T()){let n=this.#e[s],r=this.#c(n)?n.__staleWhileFetching:n;if(r!==void 0&&t(r,this.#o[s],this))return this.get(this.#o[s],e)}}forEach(t,e=this){for(let s of this.#T()){let n=this.#e[s],r=this.#c(n)?n.__staleWhileFetching:n;r!==void 0&&t.call(e,r,this.#o[s],this)}}rforEach(t,e=this){for(let s of this.#R()){let n=this.#e[s],r=this.#c(n)?n.__staleWhileFetching:n;r!==void 0&&t.call(e,r,this.#o[s],this)}}purgeStale(){let t=!1;for(let e of this.#R({allowStale:!0}))this.#y(e)&&(this.delete(this.#o[e]),t=!0);return t}info(t){let e=this.#h.get(t);if(e===void 0)return;let s=this.#e[e],n=this.#c(s)?s.__staleWhileFetching:s;if(n===void 0)return;let r={value:n};if(this.#k&&this.#O){let o=this.#k[e],a=this.#O[e];if(o&&a){let h=o-(vt.now()-a);r.ttl=h,r.start=Date.now()}}return this.#x&&(r.size=this.#x[e]),r}dump(){let t=[];for(let e of this.#T({allowStale:!0})){let s=this.#o[e],n=this.#e[e],r=this.#c(n)?n.__staleWhileFetching:n;if(r===void 0||s===void 0)continue;let o={value:r};if(this.#k&&this.#O){o.ttl=this.#k[e];let a=vt.now()-this.#O[e];o.start=Math.floor(Date.now()-a)}this.#x&&(o.size=this.#x[e]),t.unshift([s,o])}return t}load(t){this.clear();for(let[e,s]of t){if(s.start){let n=Date.now()-s.start;s.start=vt.now()-n}this.set(e,s.value,s)}}set(t,e,s={}){if(e===void 0)return this.delete(t),this;let{ttl:n=this.ttl,start:r,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:h}=s,{noUpdateTTL:u=this.noUpdateTTL}=s,d=this.#N(t,e,s.size||0,a);if(this.maxEntrySize&&d>this.maxEntrySize)return h&&(h.set="miss",h.maxEntrySizeExceeded=!0),this.delete(t),this;let m=this.#l===0?void 0:this.#h.get(t);if(m===void 0)m=this.#l===0?this.#u:this.#S.length!==0?this.#S.pop():this.#l===this.#t?this.#F(!1):this.#l,this.#o[m]=t,this.#e[m]=e,this.#h.set(t,m),this.#m[this.#u]=m,this.#w[m]=this.#u,this.#u=m,this.#l++,this.#j(m,d,h),h&&(h.set="add"),u=!1;else{this.#C(m);let g=this.#e[m];if(e!==g){if(this.#P&&this.#c(g)){g.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:w}=g;w!==void 0&&!o&&(this.#b&&this.#r?.(w,t,"set"),this.#p&&this.#g?.push([w,t,"set"]))}else o||(this.#b&&this.#r?.(g,t,"set"),this.#p&&this.#g?.push([g,t,"set"]));if(this.#v(m),this.#j(m,d,h),this.#e[m]=e,h){h.set="replace";let w=g&&this.#c(g)?g.__staleWhileFetching:g;w!==void 0&&(h.oldValue=w)}}else h&&(h.set="update")}if(n!==0&&!this.#k&&this.#D(),this.#k&&(u||this.#n(m,n,r),h&&this.#E(h,m)),!o&&this.#p&&this.#g){let g=this.#g,w;for(;w=g?.shift();)this.#i?.(...w)}return this}pop(){try{for(;this.#l;){let t=this.#e[this.#d];if(this.#F(!0),this.#c(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#p&&this.#g){let t=this.#g,e;for(;e=t?.shift();)this.#i?.(...e)}}}#F(t){let e=this.#d,s=this.#o[e],n=this.#e[e];return this.#P&&this.#c(n)?n.__abortController.abort(new Error("evicted")):(this.#b||this.#p)&&(this.#b&&this.#r?.(n,s,"evict"),this.#p&&this.#g?.push([n,s,"evict"])),this.#v(e),t&&(this.#o[e]=void 0,this.#e[e]=void 0,this.#S.push(e)),this.#l===1?(this.#d=this.#u=0,this.#S.length=0):this.#d=this.#m[e],this.#h.delete(s),this.#l--,e}has(t,e={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:n}=e,r=this.#h.get(t);if(r!==void 0){let o=this.#e[r];if(this.#c(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#y(r))n&&(n.has="stale",this.#E(n,r));else return s&&this.#A(r),n&&(n.has="hit",this.#E(n,r)),!0}else n&&(n.has="miss");return!1}peek(t,e={}){let{allowStale:s=this.allowStale}=e,n=this.#h.get(t);if(n===void 0||!s&&this.#y(n))return;let r=this.#e[n];return this.#c(r)?r.__staleWhileFetching:r}#M(t,e,s,n){let r=e===void 0?void 0:this.#e[e];if(this.#c(r))return r;let o=new re,{signal:a}=s;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let h={signal:o.signal,options:s,context:n},u=(y,E=!1)=>{let{aborted:b}=o.signal,O=s.ignoreFetchAbort&&y!==void 0;if(s.status&&(b&&!E?(s.status.fetchAborted=!0,s.status.fetchError=o.signal.reason,O&&(s.status.fetchAbortIgnored=!0)):s.status.fetchResolved=!0),b&&!O&&!E)return m(o.signal.reason);let x=w;return this.#e[e]===w&&(y===void 0?x.__staleWhileFetching?this.#e[e]=x.__staleWhileFetching:this.delete(t):(s.status&&(s.status.fetchUpdated=!0),this.set(t,y,h.options))),y},d=y=>(s.status&&(s.status.fetchRejected=!0,s.status.fetchError=y),m(y)),m=y=>{let{aborted:E}=o.signal,b=E&&s.allowStaleOnFetchAbort,O=b||s.allowStaleOnFetchRejection,x=O||s.noDeleteOnFetchRejection,T=w;if(this.#e[e]===w&&(!x||T.__staleWhileFetching===void 0?this.delete(t):b||(this.#e[e]=T.__staleWhileFetching)),O)return s.status&&T.__staleWhileFetching!==void 0&&(s.status.returnedStale=!0),T.__staleWhileFetching;if(T.__returned===T)throw y},g=(y,E)=>{let b=this.#a?.(t,r,h);b&&b instanceof Promise&&b.then(O=>y(O===void 0?void 0:O),E),o.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(y(void 0),s.allowStaleOnFetchAbort&&(y=O=>u(O,!0)))})};s.status&&(s.status.fetchDispatched=!0);let w=new Promise(g).then(u,d),k=Object.assign(w,{__abortController:o,__staleWhileFetching:r,__returned:void 0});return e===void 0?(this.set(t,k,{...h.options,status:void 0}),e=this.#h.get(t)):this.#e[e]=k,k}#c(t){if(!this.#P)return!1;let e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof re}async fetch(t,e={}){let{allowStale:s=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:h=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:d=this.noUpdateTTL,noDeleteOnFetchRejection:m=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:g=this.allowStaleOnFetchRejection,ignoreFetchAbort:w=this.ignoreFetchAbort,allowStaleOnFetchAbort:k=this.allowStaleOnFetchAbort,context:y,forceRefresh:E=!1,status:b,signal:O}=e;if(!this.#P)return b&&(b.fetch="get"),this.get(t,{allowStale:s,updateAgeOnGet:n,noDeleteOnStaleGet:r,status:b});let x={allowStale:s,updateAgeOnGet:n,noDeleteOnStaleGet:r,ttl:o,noDisposeOnSet:a,size:h,sizeCalculation:u,noUpdateTTL:d,noDeleteOnFetchRejection:m,allowStaleOnFetchRejection:g,allowStaleOnFetchAbort:k,ignoreFetchAbort:w,status:b,signal:O},T=this.#h.get(t);if(T===void 0){b&&(b.fetch="miss");let P=this.#M(t,T,x,y);return P.__returned=P}else{let P=this.#e[T];if(this.#c(P)){let St=s&&P.__staleWhileFetching!==void 0;return b&&(b.fetch="inflight",St&&(b.returnedStale=!0)),St?P.__staleWhileFetching:P.__returned=P}let R=this.#y(T);if(!E&&!R)return b&&(b.fetch="hit"),this.#C(T),n&&this.#A(T),b&&this.#E(b,T),P;let H=this.#M(t,T,x,y),V=H.__staleWhileFetching!==void 0&&s;return b&&(b.fetch=R?"stale":"refresh",V&&R&&(b.returnedStale=!0)),V?H.__staleWhileFetching:H.__returned=H}}get(t,e={}){let{allowStale:s=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:o}=e,a=this.#h.get(t);if(a!==void 0){let h=this.#e[a],u=this.#c(h);return o&&this.#E(o,a),this.#y(a)?(o&&(o.get="stale"),u?(o&&s&&h.__staleWhileFetching!==void 0&&(o.returnedStale=!0),s?h.__staleWhileFetching:void 0):(r||this.delete(t),o&&s&&(o.returnedStale=!0),s?h:void 0)):(o&&(o.get="hit"),u?h.__staleWhileFetching:(this.#C(a),n&&this.#A(a),h))}else o&&(o.get="miss")}#I(t,e){this.#w[e]=t,this.#m[t]=e}#C(t){t!==this.#u&&(t===this.#d?this.#d=this.#m[t]:this.#I(this.#w[t],this.#m[t]),this.#I(this.#u,t),this.#u=t)}delete(t){let e=!1;if(this.#l!==0){let s=this.#h.get(t);if(s!==void 0)if(e=!0,this.#l===1)this.clear();else{this.#v(s);let n=this.#e[s];if(this.#c(n)?n.__abortController.abort(new Error("deleted")):(this.#b||this.#p)&&(this.#b&&this.#r?.(n,t,"delete"),this.#p&&this.#g?.push([n,t,"delete"])),this.#h.delete(t),this.#o[s]=void 0,this.#e[s]=void 0,s===this.#u)this.#u=this.#w[s];else if(s===this.#d)this.#d=this.#m[s];else{let r=this.#w[s];this.#m[r]=this.#m[s];let o=this.#m[s];this.#w[o]=this.#w[s]}this.#l--,this.#S.push(s)}}if(this.#p&&this.#g?.length){let s=this.#g,n;for(;n=s?.shift();)this.#i?.(...n)}return e}clear(){for(let t of this.#R({allowStale:!0})){let e=this.#e[t];if(this.#c(e))e.__abortController.abort(new Error("deleted"));else{let s=this.#o[t];this.#b&&this.#r?.(e,s,"delete"),this.#p&&this.#g?.push([e,s,"delete"])}}if(this.#h.clear(),this.#e.fill(void 0),this.#o.fill(void 0),this.#k&&this.#O&&(this.#k.fill(0),this.#O.fill(0)),this.#x&&this.#x.fill(0),this.#d=0,this.#u=0,this.#S.length=0,this.#f=0,this.#l=0,this.#p&&this.#g){let t=this.#g,e;for(;e=t?.shift();)this.#i?.(...e)}}};var At=require("path"),Qs=require("url"),ur=U(require("fs"),1),ot=require("fs"),pt=require("fs/promises");var ue=require("events"),We=U(require("stream"),1),Ks=require("string_decoder"),qs=typeof process=="object"&&process?process:{stdout:null,stderr:null},ir=i=>!!i&&typeof i=="object"&&(i instanceof dt||i instanceof We.default||nr(i)||rr(i)),nr=i=>!!i&&typeof i=="object"&&i instanceof ue.EventEmitter&&typeof i.pipe=="function"&&i.pipe!==We.default.Writable.prototype.pipe,rr=i=>!!i&&typeof i=="object"&&i instanceof ue.EventEmitter&&typeof i.write=="function"&&typeof i.end=="function",lt=Symbol("EOF"),ct=Symbol("maybeEmitEnd"),ut=Symbol("emittedEnd"),oe=Symbol("emittingEnd"),It=Symbol("emittedError"),ae=Symbol("closed"),Gs=Symbol("read"),he=Symbol("flush"),Hs=Symbol("flushChunk"),et=Symbol("encoding"),xt=Symbol("decoder"),j=Symbol("flowing"),Lt=Symbol("paused"),Ot=Symbol("resume"),N=Symbol("buffer"),G=Symbol("pipes"),$=Symbol("bufferLength"),Me=Symbol("bufferPush"),le=Symbol("bufferShift"),z=Symbol("objectMode"),M=Symbol("destroyed"),je=Symbol("error"),Ne=Symbol("emitData"),Js=Symbol("emitEnd"),$e=Symbol("emitEnd2"),nt=Symbol("async"),Ie=Symbol("abort"),ce=Symbol("aborted"),Wt=Symbol("signal"),wt=Symbol("dataListeners"),K=Symbol("discarded"),zt=i=>Promise.resolve().then(i),or=i=>i(),ar=i=>i==="end"||i==="finish"||i==="prefinish",hr=i=>i instanceof ArrayBuffer||!!i&&typeof i=="object"&&i.constructor&&i.constructor.name==="ArrayBuffer"&&i.byteLength>=0,lr=i=>!Buffer.isBuffer(i)&&ArrayBuffer.isView(i),fe=class{src;dest;opts;ondrain;constructor(t,e,s){this.src=t,this.dest=e,this.opts=s,this.ondrain=()=>t[Ot](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(t){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Le=class extends fe{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(t,e,s){super(t,e,s),this.proxyErrors=n=>e.emit("error",n),t.on("error",this.proxyErrors)}},cr=i=>!!i.objectMode,fr=i=>!i.objectMode&&!!i.encoding&&i.encoding!=="buffer",dt=class extends ue.EventEmitter{[j]=!1;[Lt]=!1;[G]=[];[N]=[];[z];[et];[nt];[xt];[lt]=!1;[ut]=!1;[oe]=!1;[ae]=!1;[It]=null;[$]=0;[M]=!1;[Wt];[ce]=!1;[wt]=0;[K]=!1;writable=!0;readable=!0;constructor(...t){let e=t[0]||{};if(super(),e.objectMode&&typeof e.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");cr(e)?(this[z]=!0,this[et]=null):fr(e)?(this[et]=e.encoding,this[z]=!1):(this[z]=!1,this[et]=null),this[nt]=!!e.async,this[xt]=this[et]?new Ks.StringDecoder(this[et]):null,e&&e.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[N]}),e&&e.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[G]});let{signal:s}=e;s&&(this[Wt]=s,s.aborted?this[Ie]():s.addEventListener("abort",()=>this[Ie]()))}get bufferLength(){return this[$]}get encoding(){return this[et]}set encoding(t){throw new Error("Encoding must be set at instantiation time")}setEncoding(t){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[z]}set objectMode(t){throw new Error("objectMode must be set at instantiation time")}get async(){return this[nt]}set async(t){this[nt]=this[nt]||!!t}[Ie](){this[ce]=!0,this.emit("abort",this[Wt]?.reason),this.destroy(this[Wt]?.reason)}get aborted(){return this[ce]}set aborted(t){}write(t,e,s){if(this[ce])return!1;if(this[lt])throw new Error("write after end");if(this[M])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof e=="function"&&(s=e,e="utf8"),e||(e="utf8");let n=this[nt]?zt:or;if(!this[z]&&!Buffer.isBuffer(t)){if(lr(t))t=Buffer.from(t.buffer,t.byteOffset,t.byteLength);else if(hr(t))t=Buffer.from(t);else if(typeof t!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[z]?(this[j]&&this[$]!==0&&this[he](!0),this[j]?this.emit("data",t):this[Me](t),this[$]!==0&&this.emit("readable"),s&&n(s),this[j]):t.length?(typeof t=="string"&&!(e===this[et]&&!this[xt]?.lastNeed)&&(t=Buffer.from(t,e)),Buffer.isBuffer(t)&&this[et]&&(t=this[xt].write(t)),this[j]&&this[$]!==0&&this[he](!0),this[j]?this.emit("data",t):this[Me](t),this[$]!==0&&this.emit("readable"),s&&n(s),this[j]):(this[$]!==0&&this.emit("readable"),s&&n(s),this[j])}read(t){if(this[M])return null;if(this[K]=!1,this[$]===0||t===0||t&&t>this[$])return this[ct](),null;this[z]&&(t=null),this[N].length>1&&!this[z]&&(this[N]=[this[et]?this[N].join(""):Buffer.concat(this[N],this[$])]);let e=this[Gs](t||null,this[N][0]);return this[ct](),e}[Gs](t,e){if(this[z])this[le]();else{let s=e;t===s.length||t===null?this[le]():typeof s=="string"?(this[N][0]=s.slice(t),e=s.slice(0,t),this[$]-=t):(this[N][0]=s.subarray(t),e=s.subarray(0,t),this[$]-=t)}return this.emit("data",e),!this[N].length&&!this[lt]&&this.emit("drain"),e}end(t,e,s){return typeof t=="function"&&(s=t,t=void 0),typeof e=="function"&&(s=e,e="utf8"),t!==void 0&&this.write(t,e),s&&this.once("end",s),this[lt]=!0,this.writable=!1,(this[j]||!this[Lt])&&this[ct](),this}[Ot](){this[M]||(!this[wt]&&!this[G].length&&(this[K]=!0),this[Lt]=!1,this[j]=!0,this.emit("resume"),this[N].length?this[he]():this[lt]?this[ct]():this.emit("drain"))}resume(){return this[Ot]()}pause(){this[j]=!1,this[Lt]=!0,this[K]=!1}get destroyed(){return this[M]}get flowing(){return this[j]}get paused(){return this[Lt]}[Me](t){this[z]?this[$]+=1:this[$]+=t.length,this[N].push(t)}[le](){return this[z]?this[$]-=1:this[$]-=this[N][0].length,this[N].shift()}[he](t=!1){do;while(this[Hs](this[le]())&&this[N].length);!t&&!this[N].length&&!this[lt]&&this.emit("drain")}[Hs](t){return this.emit("data",t),this[j]}pipe(t,e){if(this[M])return t;this[K]=!1;let s=this[ut];return e=e||{},t===qs.stdout||t===qs.stderr?e.end=!1:e.end=e.end!==!1,e.proxyErrors=!!e.proxyErrors,s?e.end&&t.end():(this[G].push(e.proxyErrors?new Le(this,t,e):new fe(this,t,e)),this[nt]?zt(()=>this[Ot]()):this[Ot]()),t}unpipe(t){let e=this[G].find(s=>s.dest===t);e&&(this[G].length===1?(this[j]&&this[wt]===0&&(this[j]=!1),this[G]=[]):this[G].splice(this[G].indexOf(e),1),e.unpipe())}addListener(t,e){return this.on(t,e)}on(t,e){let s=super.on(t,e);if(t==="data")this[K]=!1,this[wt]++,!this[G].length&&!this[j]&&this[Ot]();else if(t==="readable"&&this[$]!==0)super.emit("readable");else if(ar(t)&&this[ut])super.emit(t),this.removeAllListeners(t);else if(t==="error"&&this[It]){let n=e;this[nt]?zt(()=>n.call(this,this[It])):n.call(this,this[It])}return s}removeListener(t,e){return this.off(t,e)}off(t,e){let s=super.off(t,e);return t==="data"&&(this[wt]=this.listeners("data").length,this[wt]===0&&!this[K]&&!this[G].length&&(this[j]=!1)),s}removeAllListeners(t){let e=super.removeAllListeners(t);return(t==="data"||t===void 0)&&(this[wt]=0,!this[K]&&!this[G].length&&(this[j]=!1)),e}get emittedEnd(){return this[ut]}[ct](){!this[oe]&&!this[ut]&&!this[M]&&this[N].length===0&&this[lt]&&(this[oe]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[ae]&&this.emit("close"),this[oe]=!1)}emit(t,...e){let s=e[0];if(t!=="error"&&t!=="close"&&t!==M&&this[M])return!1;if(t==="data")return!this[z]&&!s?!1:this[nt]?(zt(()=>this[Ne](s)),!0):this[Ne](s);if(t==="end")return this[Js]();if(t==="close"){if(this[ae]=!0,!this[ut]&&!this[M])return!1;let r=super.emit("close");return this.removeAllListeners("close"),r}else if(t==="error"){this[It]=s,super.emit(je,s);let r=!this[Wt]||this.listeners("error").length?super.emit("error",s):!1;return this[ct](),r}else if(t==="resume"){let r=super.emit("resume");return this[ct](),r}else if(t==="finish"||t==="prefinish"){let r=super.emit(t);return this.removeAllListeners(t),r}let n=super.emit(t,...e);return this[ct](),n}[Ne](t){for(let s of this[G])s.dest.write(t)===!1&&this.pause();let e=this[K]?!1:super.emit("data",t);return this[ct](),e}[Js](){return this[ut]?!1:(this[ut]=!0,this.readable=!1,this[nt]?(zt(()=>this[$e]()),!0):this[$e]())}[$e](){if(this[xt]){let e=this[xt].end();if(e){for(let s of this[G])s.dest.write(e);this[K]||super.emit("data",e)}}for(let e of this[G])e.end();let t=super.emit("end");return this.removeAllListeners("end"),t}async collect(){let t=Object.assign([],{dataLength:0});this[z]||(t.dataLength=0);let e=this.promise();return this.on("data",s=>{t.push(s),this[z]||(t.dataLength+=s.length)}),await e,t}async concat(){if(this[z])throw new Error("cannot concat in objectMode");let t=await this.collect();return this[et]?t.join(""):Buffer.concat(t,t.dataLength)}async promise(){return new Promise((t,e)=>{this.on(M,()=>e(new Error("stream destroyed"))),this.on("error",s=>e(s)),this.on("end",()=>t())})}[Symbol.asyncIterator](){this[K]=!1;let t=!1,e=async()=>(this.pause(),t=!0,{value:void 0,done:!0});return{next:()=>{if(t)return e();let n=this.read();if(n!==null)return Promise.resolve({done:!1,value:n});if(this[lt])return e();let r,o,a=m=>{this.off("data",h),this.off("end",u),this.off(M,d),e(),o(m)},h=m=>{this.off("error",a),this.off("end",u),this.off(M,d),this.pause(),r({value:m,done:!!this[lt]})},u=()=>{this.off("error",a),this.off("data",h),this.off(M,d),e(),r({done:!0,value:void 0})},d=()=>a(new Error("stream destroyed"));return new Promise((m,g)=>{o=g,r=m,this.once(M,d),this.once("error",a),this.once("end",u),this.once("data",h)})},throw:e,return:e,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[K]=!1;let t=!1,e=()=>(this.pause(),this.off(je,e),this.off(M,e),this.off("end",e),t=!0,{done:!0,value:void 0}),s=()=>{if(t)return e();let n=this.read();return n===null?e():{done:!1,value:n}};return this.once("end",e),this.once(je,e),this.once(M,e),{next:s,throw:e,return:e,[Symbol.iterator](){return this}}}destroy(t){if(this[M])return t?this.emit("error",t):this.emit(M),this;this[M]=!0,this[K]=!0,this[N].length=0,this[$]=0;let e=this;return typeof e.close=="function"&&!this[ae]&&e.close(),t?this.emit("error",t):this.emit(M),this}static get isStream(){return ir}};var dr=ot.realpathSync.native,Ut={lstatSync:ot.lstatSync,readdir:ot.readdir,readdirSync:ot.readdirSync,readlinkSync:ot.readlinkSync,realpathSync:dr,promises:{lstat:pt.lstat,readdir:pt.readdir,readlink:pt.readlink,realpath:pt.realpath}},ti=i=>!i||i===Ut||i===ur?Ut:{...Ut,...i,promises:{...Ut.promises,...i.promises||{}}},ei=/^\\\\\?\\([a-z]:)\\?$/i,pr=i=>i.replace(/\//g,"\\").replace(ei,"$1\\"),mr=/[\\\/]/,Q=0,si=1,ii=2,rt=4,ni=6,ri=8,yt=10,oi=12,Z=15,Bt=~Z,ze=16,Vs=32,qt=64,st=128,de=256,me=512,Ys=qt|st|me,gr=1023,Be=i=>i.isFile()?ri:i.isDirectory()?rt:i.isSymbolicLink()?yt:i.isCharacterDevice()?ii:i.isBlockDevice()?ni:i.isSocket()?oi:i.isFIFO()?si:Q,Xs=new Map,Gt=i=>{let t=Xs.get(i);if(t)return t;let e=i.normalize("NFKD");return Xs.set(i,e),e},Zs=new Map,pe=i=>{let t=Zs.get(i);if(t)return t;let e=Gt(i.toLowerCase());return Zs.set(i,e),e},ge=class extends $t{constructor(){super({max:256})}},Ue=class extends $t{constructor(t=16*1024){super({maxSize:t,sizeCalculation:e=>e.length+1})}},ai=Symbol("PathScurry setAsCwd"),B=class{name;root;roots;parent;nocase;#t;#s;get dev(){return this.#s}#r;get mode(){return this.#r}#i;get nlink(){return this.#i}#a;get uid(){return this.#a}#l;get gid(){return this.#l}#f;get rdev(){return this.#f}#h;get blksize(){return this.#h}#o;get ino(){return this.#o}#e;get size(){return this.#e}#m;get blocks(){return this.#m}#w;get atimeMs(){return this.#w}#d;get mtimeMs(){return this.#d}#u;get ctimeMs(){return this.#u}#S;get birthtimeMs(){return this.#S}#g;get atime(){return this.#g}#x;get mtime(){return this.#x}#O;get ctime(){return this.#O}#k;get birthtime(){return this.#k}#b;#P;#p;#D;#A;#E;#n;#y;#_;#v;get path(){return(this.parent||this).fullpath()}constructor(t,e=Q,s,n,r,o,a){this.name=t,this.#b=r?pe(t):Gt(t),this.#n=e&gr,this.nocase=r,this.roots=n,this.root=s||this,this.#y=o,this.#p=a.fullpath,this.#A=a.relative,this.#E=a.relativePosix,this.parent=a.parent,this.parent?this.#t=this.parent.#t:this.#t=ti(a.fs)}depth(){return this.#P!==void 0?this.#P:this.parent?this.#P=this.parent.depth()+1:this.#P=0}childrenCache(){return this.#y}resolve(t){if(!t)return this;let e=this.getRootString(t),n=t.substring(e.length).split(this.splitSep);return e?this.getRoot(e).#j(n):this.#j(n)}#j(t){let e=this;for(let s of t)e=e.child(s);return e}children(){let t=this.#y.get(this);if(t)return t;let e=Object.assign([],{provisional:0});return this.#y.set(this,e),this.#n&=~ze,e}child(t,e){if(t===""||t===".")return this;if(t==="..")return this.parent||this;let s=this.children(),n=this.nocase?pe(t):Gt(t);for(let h of s)if(h.#b===n)return h;let r=this.parent?this.sep:"",o=this.#p?this.#p+r+t:void 0,a=this.newChild(t,Q,{...e,parent:this,fullpath:o});return this.canReaddir()||(a.#n|=st),s.push(a),a}relative(){if(this.#A!==void 0)return this.#A;let t=this.name,e=this.parent;if(!e)return this.#A=this.name;let s=e.relative();return s+(!s||!e.parent?"":this.sep)+t}relativePosix(){if(this.sep==="/")return this.relative();if(this.#E!==void 0)return this.#E;let t=this.name,e=this.parent;if(!e)return this.#E=this.fullpathPosix();let s=e.relativePosix();return s+(!s||!e.parent?"":"/")+t}fullpath(){if(this.#p!==void 0)return this.#p;let t=this.name,e=this.parent;if(!e)return this.#p=this.name;let n=e.fullpath()+(e.parent?this.sep:"")+t;return this.#p=n}fullpathPosix(){if(this.#D!==void 0)return this.#D;if(this.sep==="/")return this.#D=this.fullpath();if(!this.parent){let n=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(n)?this.#D=`//?/${n}`:this.#D=n}let t=this.parent,e=t.fullpathPosix(),s=e+(!e||!t.parent?"":"/")+this.name;return this.#D=s}isUnknown(){return(this.#n&Z)===Q}isType(t){return this[`is${t}`]()}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.#n&Z)===ri}isDirectory(){return(this.#n&Z)===rt}isCharacterDevice(){return(this.#n&Z)===ii}isBlockDevice(){return(this.#n&Z)===ni}isFIFO(){return(this.#n&Z)===si}isSocket(){return(this.#n&Z)===oi}isSymbolicLink(){return(this.#n&yt)===yt}lstatCached(){return this.#n&Vs?this:void 0}readlinkCached(){return this.#_}realpathCached(){return this.#v}readdirCached(){let t=this.children();return t.slice(0,t.provisional)}canReadlink(){if(this.#_)return!0;if(!this.parent)return!1;let t=this.#n&Z;return!(t!==Q&&t!==yt||this.#n&de||this.#n&st)}calledReaddir(){return!!(this.#n&ze)}isENOENT(){return!!(this.#n&st)}isNamed(t){return this.nocase?this.#b===pe(t):this.#b===Gt(t)}async readlink(){let t=this.#_;if(t)return t;if(this.canReadlink()&&this.parent)try{let e=await this.#t.promises.readlink(this.fullpath()),s=(await this.parent.realpath())?.resolve(e);if(s)return this.#_=s}catch(e){this.#I(e.code);return}}readlinkSync(){let t=this.#_;if(t)return t;if(this.canReadlink()&&this.parent)try{let e=this.#t.readlinkSync(this.fullpath()),s=this.parent.realpathSync()?.resolve(e);if(s)return this.#_=s}catch(e){this.#I(e.code);return}}#N(t){this.#n|=ze;for(let e=t.provisional;e<t.length;e++){let s=t[e];s&&s.#T()}}#T(){this.#n&st||(this.#n=(this.#n|st)&Bt,this.#R())}#R(){let t=this.children();t.provisional=0;for(let e of t)e.#T()}#$(){this.#n|=me,this.#F()}#F(){if(this.#n&qt)return;let t=this.#n;(t&Z)===rt&&(t&=Bt),this.#n=t|qt,this.#R()}#M(t=""){t==="ENOTDIR"||t==="EPERM"?this.#F():t==="ENOENT"?this.#T():this.children().provisional=0}#c(t=""){t==="ENOTDIR"?this.parent.#F():t==="ENOENT"&&this.#T()}#I(t=""){let e=this.#n;e|=de,t==="ENOENT"&&(e|=st),(t==="EINVAL"||t==="UNKNOWN")&&(e&=Bt),this.#n=e,t==="ENOTDIR"&&this.parent&&this.parent.#F()}#C(t,e){return this.#q(t,e)||this.#U(t,e)}#U(t,e){let s=Be(t),n=this.newChild(t.name,s,{parent:this}),r=n.#n&Z;return r!==rt&&r!==yt&&r!==Q&&(n.#n|=qt),e.unshift(n),e.provisional++,n}#q(t,e){for(let s=e.provisional;s<e.length;s++){let n=e[s];if((this.nocase?pe(t.name):Gt(t.name))===n.#b)return this.#G(t,n,s,e)}}#G(t,e,s,n){let r=e.name;return e.#n=e.#n&Bt|Be(t),r!==t.name&&(e.name=t.name),s!==n.provisional&&(s===n.length-1?n.pop():n.splice(s,1),n.unshift(e)),n.provisional++,e}async lstat(){if(!(this.#n&st))try{return this.#B(await this.#t.promises.lstat(this.fullpath())),this}catch(t){this.#c(t.code)}}lstatSync(){if(!(this.#n&st))try{return this.#B(this.#t.lstatSync(this.fullpath())),this}catch(t){this.#c(t.code)}}#B(t){let{atime:e,atimeMs:s,birthtime:n,birthtimeMs:r,blksize:o,blocks:a,ctime:h,ctimeMs:u,dev:d,gid:m,ino:g,mode:w,mtime:k,mtimeMs:y,nlink:E,rdev:b,size:O,uid:x}=t;this.#g=e,this.#w=s,this.#k=n,this.#S=r,this.#h=o,this.#m=a,this.#O=h,this.#u=u,this.#s=d,this.#l=m,this.#o=g,this.#r=w,this.#x=k,this.#d=y,this.#i=E,this.#f=b,this.#e=O,this.#a=x;let T=Be(t);this.#n=this.#n&Bt|T|Vs,T!==Q&&T!==rt&&T!==yt&&(this.#n|=qt)}#W=[];#z=!1;#H(t){this.#z=!1;let e=this.#W.slice();this.#W.length=0,e.forEach(s=>s(null,t))}readdirCB(t,e=!1){if(!this.canReaddir()){e?t(null,[]):queueMicrotask(()=>t(null,[]));return}let s=this.children();if(this.calledReaddir()){let r=s.slice(0,s.provisional);e?t(null,r):queueMicrotask(()=>t(null,r));return}if(this.#W.push(t),this.#z)return;this.#z=!0;let n=this.fullpath();this.#t.readdir(n,{withFileTypes:!0},(r,o)=>{if(r)this.#M(r.code),s.provisional=0;else{for(let a of o)this.#C(a,s);this.#N(s)}this.#H(s.slice(0,s.provisional))})}#L;async readdir(){if(!this.canReaddir())return[];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let e=this.fullpath();if(this.#L)await this.#L;else{let s=()=>{};this.#L=new Promise(n=>s=n);try{for(let n of await this.#t.promises.readdir(e,{withFileTypes:!0}))this.#C(n,t);this.#N(t)}catch(n){this.#M(n.code),t.provisional=0}this.#L=void 0,s()}return t.slice(0,t.provisional)}readdirSync(){if(!this.canReaddir())return[];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let e=this.fullpath();try{for(let s of this.#t.readdirSync(e,{withFileTypes:!0}))this.#C(s,t);this.#N(t)}catch(s){this.#M(s.code),t.provisional=0}return t.slice(0,t.provisional)}canReaddir(){if(this.#n&Ys)return!1;let t=Z&this.#n;return t===Q||t===rt||t===yt}shouldWalk(t,e){return(this.#n&rt)===rt&&!(this.#n&Ys)&&!t.has(this)&&(!e||e(this))}async realpath(){if(this.#v)return this.#v;if(!((me|de|st)&this.#n))try{let t=await this.#t.promises.realpath(this.fullpath());return this.#v=this.resolve(t)}catch{this.#$()}}realpathSync(){if(this.#v)return this.#v;if(!((me|de|st)&this.#n))try{let t=this.#t.realpathSync(this.fullpath());return this.#v=this.resolve(t)}catch{this.#$()}}[ai](t){if(t===this)return;let e=new Set([]),s=[],n=this;for(;n&&n.parent;)e.add(n),n.#A=s.join(this.sep),n.#E=s.join("/"),n=n.parent,s.push("..");for(n=t;n&&n.parent&&!e.has(n);)n.#A=void 0,n.#E=void 0,n=n.parent}},we=class i extends B{sep="\\";splitSep=mr;constructor(t,e=Q,s,n,r,o,a){super(t,e,s,n,r,o,a)}newChild(t,e=Q,s={}){return new i(t,e,this.root,this.roots,this.nocase,this.childrenCache(),s)}getRootString(t){return At.win32.parse(t).root}getRoot(t){if(t=pr(t.toUpperCase()),t===this.root.name)return this.root;for(let[e,s]of Object.entries(this.roots))if(this.sameRoot(t,e))return this.roots[t]=s;return this.roots[t]=new Pt(t,this).root}sameRoot(t,e=this.root.name){return t=t.toUpperCase().replace(/\//g,"\\").replace(ei,"$1\\"),t===e}},ye=class i extends B{splitSep="/";sep="/";constructor(t,e=Q,s,n,r,o,a){super(t,e,s,n,r,o,a)}getRootString(t){return t.startsWith("/")?"/":""}getRoot(t){return this.root}newChild(t,e=Q,s={}){return new i(t,e,this.root,this.roots,this.nocase,this.childrenCache(),s)}},be=class{root;rootPath;roots;cwd;#t;#s;#r;nocase;#i;constructor(t=process.cwd(),e,s,{nocase:n,childrenCacheSize:r=16*1024,fs:o=Ut}={}){this.#i=ti(o),(t instanceof URL||t.startsWith("file://"))&&(t=(0,Qs.fileURLToPath)(t));let a=e.resolve(t);this.roots=Object.create(null),this.rootPath=this.parseRootPath(a),this.#t=new ge,this.#s=new ge,this.#r=new Ue(r);let h=a.substring(this.rootPath.length).split(s);if(h.length===1&&!h[0]&&h.pop(),n===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=n,this.root=this.newRoot(this.#i),this.roots[this.rootPath]=this.root;let u=this.root,d=h.length-1,m=e.sep,g=this.rootPath,w=!1;for(let k of h){let y=d--;u=u.child(k,{relative:new Array(y).fill("..").join(m),relativePosix:new Array(y).fill("..").join("/"),fullpath:g+=(w?"":m)+k}),w=!0}this.cwd=u}depth(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.depth()}childrenCache(){return this.#r}resolve(...t){let e="";for(let r=t.length-1;r>=0;r--){let o=t[r];if(!(!o||o===".")&&(e=e?`${o}/${e}`:o,this.isAbsolute(o)))break}let s=this.#t.get(e);if(s!==void 0)return s;let n=this.cwd.resolve(e).fullpath();return this.#t.set(e,n),n}resolvePosix(...t){let e="";for(let r=t.length-1;r>=0;r--){let o=t[r];if(!(!o||o===".")&&(e=e?`${o}/${e}`:o,this.isAbsolute(o)))break}let s=this.#s.get(e);if(s!==void 0)return s;let n=this.cwd.resolve(e).fullpathPosix();return this.#s.set(e,n),n}relative(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.relative()}relativePosix(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.relativePosix()}basename(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.name}dirname(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),(t.parent||t).fullpath()}async readdir(t=this.cwd,e={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof B||(e=t,t=this.cwd);let{withFileTypes:s}=e;if(t.canReaddir()){let n=await t.readdir();return s?n:n.map(r=>r.name)}else return[]}readdirSync(t=this.cwd,e={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof B||(e=t,t=this.cwd);let{withFileTypes:s=!0}=e;return t.canReaddir()?s?t.readdirSync():t.readdirSync().map(n=>n.name):[]}async lstat(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.lstat()}lstatSync(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.lstatSync()}async readlink(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof B||(e=t.withFileTypes,t=this.cwd);let s=await t.readlink();return e?s:s?.fullpath()}readlinkSync(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof B||(e=t.withFileTypes,t=this.cwd);let s=t.readlinkSync();return e?s:s?.fullpath()}async realpath(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof B||(e=t.withFileTypes,t=this.cwd);let s=await t.realpath();return e?s:s?.fullpath()}realpathSync(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof B||(e=t.withFileTypes,t=this.cwd);let s=t.realpathSync();return e?s:s?.fullpath()}async walk(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof B||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:n=!1,filter:r,walkFilter:o}=e,a=[];(!r||r(t))&&a.push(s?t:t.fullpath());let h=new Set,u=(m,g)=>{h.add(m),m.readdirCB((w,k)=>{if(w)return g(w);let y=k.length;if(!y)return g();let E=()=>{--y===0&&g()};for(let b of k)(!r||r(b))&&a.push(s?b:b.fullpath()),n&&b.isSymbolicLink()?b.realpath().then(O=>O?.isUnknown()?O.lstat():O).then(O=>O?.shouldWalk(h,o)?u(O,E):E()):b.shouldWalk(h,o)?u(b,E):E()},!0)},d=t;return new Promise((m,g)=>{u(d,w=>{if(w)return g(w);m(a)})})}walkSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof B||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:n=!1,filter:r,walkFilter:o}=e,a=[];(!r||r(t))&&a.push(s?t:t.fullpath());let h=new Set([t]);for(let u of h){let d=u.readdirSync();for(let m of d){(!r||r(m))&&a.push(s?m:m.fullpath());let g=m;if(m.isSymbolicLink()){if(!(n&&(g=m.realpathSync())))continue;g.isUnknown()&&g.lstatSync()}g.shouldWalk(h,o)&&h.add(g)}}return a}[Symbol.asyncIterator](){return this.iterate()}iterate(t=this.cwd,e={}){return typeof t=="string"?t=this.cwd.resolve(t):t instanceof B||(e=t,t=this.cwd),this.stream(t,e)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof B||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:n=!1,filter:r,walkFilter:o}=e;(!r||r(t))&&(yield s?t:t.fullpath());let a=new Set([t]);for(let h of a){let u=h.readdirSync();for(let d of u){(!r||r(d))&&(yield s?d:d.fullpath());let m=d;if(d.isSymbolicLink()){if(!(n&&(m=d.realpathSync())))continue;m.isUnknown()&&m.lstatSync()}m.shouldWalk(a,o)&&a.add(m)}}}stream(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof B||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:n=!1,filter:r,walkFilter:o}=e,a=new dt({objectMode:!0});(!r||r(t))&&a.write(s?t:t.fullpath());let h=new Set,u=[t],d=0,m=()=>{let g=!1;for(;!g;){let w=u.shift();if(!w){d===0&&a.end();return}d++,h.add(w);let k=(E,b,O=!1)=>{if(E)return a.emit("error",E);if(n&&!O){let x=[];for(let T of b)T.isSymbolicLink()&&x.push(T.realpath().then(P=>P?.isUnknown()?P.lstat():P));if(x.length){Promise.all(x).then(()=>k(null,b,!0));return}}for(let x of b)x&&(!r||r(x))&&(a.write(s?x:x.fullpath())||(g=!0));d--;for(let x of b){let T=x.realpathCached()||x;T.shouldWalk(h,o)&&u.push(T)}g&&!a.flowing?a.once("drain",m):y||m()},y=!0;w.readdirCB(k,!0),y=!1}};return m(),a}streamSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof B||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:n=!1,filter:r,walkFilter:o}=e,a=new dt({objectMode:!0}),h=new Set;(!r||r(t))&&a.write(s?t:t.fullpath());let u=[t],d=0,m=()=>{let g=!1;for(;!g;){let w=u.shift();if(!w){d===0&&a.end();return}d++,h.add(w);let k=w.readdirSync();for(let y of k)(!r||r(y))&&(a.write(s?y:y.fullpath())||(g=!0));d--;for(let y of k){let E=y;if(y.isSymbolicLink()){if(!(n&&(E=y.realpathSync())))continue;E.isUnknown()&&E.lstatSync()}E.shouldWalk(h,o)&&u.push(E)}}g&&!a.flowing&&a.once("drain",m)};return m(),a}chdir(t=this.cwd){let e=this.cwd;this.cwd=typeof t=="string"?this.cwd.resolve(t):t,this.cwd[ai](e)}},Pt=class extends be{sep="\\";constructor(t=process.cwd(),e={}){let{nocase:s=!0}=e;super(t,At.win32,"\\",{...e,nocase:s}),this.nocase=s;for(let n=this.cwd;n;n=n.parent)n.nocase=this.nocase}parseRootPath(t){return At.win32.parse(t).root.toUpperCase()}newRoot(t){return new we(this.rootPath,rt,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")||t.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(t)}},Rt=class extends be{sep="/";constructor(t=process.cwd(),e={}){let{nocase:s=!1}=e;super(t,At.posix,"/",{...e,nocase:s}),this.nocase=s}parseRootPath(t){return"/"}newRoot(t){return new ye(this.rootPath,rt,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")}},Ht=class extends Rt{constructor(t=process.cwd(),e={}){let{nocase:s=!0}=e;super(t,{...e,nocase:s})}},Eo=process.platform==="win32"?we:ye,hi=process.platform==="win32"?Pt:process.platform==="darwin"?Ht:Rt;var li=require("url");var wr=i=>i.length>=1,yr=i=>i.length>=1,Dt=class i{#t;#s;#r;length;#i;#a;#l;#f;#h;#o;#e=!0;constructor(t,e,s,n){if(!wr(t))throw new TypeError("empty pattern list");if(!yr(e))throw new TypeError("empty glob list");if(e.length!==t.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=t.length,s<0||s>=this.length)throw new TypeError("index out of range");if(this.#t=t,this.#s=e,this.#r=s,this.#i=n,this.#r===0){if(this.isUNC()){let[r,o,a,h,...u]=this.#t,[d,m,g,w,...k]=this.#s;u[0]===""&&(u.shift(),k.shift());let y=[r,o,a,h,""].join("/"),E=[d,m,g,w,""].join("/");this.#t=[y,...u],this.#s=[E,...k],this.length=this.#t.length}else if(this.isDrive()||this.isAbsolute()){let[r,...o]=this.#t,[a,...h]=this.#s;o[0]===""&&(o.shift(),h.shift());let u=r+"/",d=a+"/";this.#t=[u,...o],this.#s=[d,...h],this.length=this.#t.length}}}pattern(){return this.#t[this.#r]}isString(){return typeof this.#t[this.#r]=="string"}isGlobstar(){return this.#t[this.#r]===L}isRegExp(){return this.#t[this.#r]instanceof RegExp}globString(){return this.#l=this.#l||(this.#r===0?this.isAbsolute()?this.#s[0]+this.#s.slice(1).join("/"):this.#s.join("/"):this.#s.slice(this.#r).join("/"))}hasMore(){return this.length>this.#r+1}rest(){return this.#a!==void 0?this.#a:this.hasMore()?(this.#a=new i(this.#t,this.#s,this.#r+1,this.#i),this.#a.#o=this.#o,this.#a.#h=this.#h,this.#a.#f=this.#f,this.#a):this.#a=null}isUNC(){let t=this.#t;return this.#h!==void 0?this.#h:this.#h=this.#i==="win32"&&this.#r===0&&t[0]===""&&t[1]===""&&typeof t[2]=="string"&&!!t[2]&&typeof t[3]=="string"&&!!t[3]}isDrive(){let t=this.#t;return this.#f!==void 0?this.#f:this.#f=this.#i==="win32"&&this.#r===0&&this.length>1&&typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0])}isAbsolute(){let t=this.#t;return this.#o!==void 0?this.#o:this.#o=t[0]===""&&t.length>1||this.isDrive()||this.isUNC()}root(){let t=this.#t[0];return typeof t=="string"&&this.isAbsolute()&&this.#r===0?t:""}checkFollowGlobstar(){return!(this.#r===0||!this.isGlobstar()||!this.#e)}markFollowGlobstar(){return this.#r===0||!this.isGlobstar()||!this.#e?!1:(this.#e=!1,!0)}};var br=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Jt=class{relative;relativeChildren;absolute;absoluteChildren;constructor(t,{nobrace:e,nocase:s,noext:n,noglobstar:r,platform:o=br}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[];let a={dot:!0,nobrace:e,nocase:s,noext:n,noglobstar:r,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let h of t){let u=new J(h,a);for(let d=0;d<u.set.length;d++){let m=u.set[d],g=u.globParts[d];if(!m||!g)throw new Error("invalid pattern object");for(;m[0]==="."&&g[0]===".";)m.shift(),g.shift();let w=new Dt(m,g,0,o),k=new J(w.globString(),a),y=g[g.length-1]==="**",E=w.isAbsolute();E?this.absolute.push(k):this.relative.push(k),y&&(E?this.absoluteChildren.push(k):this.relativeChildren.push(k))}}}ignored(t){let e=t.fullpath(),s=`${e}/`,n=t.relative()||".",r=`${n}/`;for(let o of this.relative)if(o.match(n)||o.match(r))return!0;for(let o of this.absolute)if(o.match(e)||o.match(s))return!0;return!1}childrenIgnored(t){let e=t.fullpath()+"/",s=(t.relative()||".")+"/";for(let n of this.relativeChildren)if(n.match(s))return!0;for(let n of this.absoluteChildren)if(n.match(e))return!0;return!1}};var qe=class i{store;constructor(t=new Map){this.store=t}copy(){return new i(new Map(this.store))}hasWalked(t,e){return this.store.get(t.fullpath())?.has(e.globString())}storeWalked(t,e){let s=t.fullpath(),n=this.store.get(s);n?n.add(e.globString()):this.store.set(s,new Set([e.globString()]))}},Ge=class{store=new Map;add(t,e,s){let n=(e?2:0)|(s?1:0),r=this.store.get(t);this.store.set(t,r===void 0?n:n&r)}entries(){return[...this.store.entries()].map(([t,e])=>[t,!!(e&2),!!(e&1)])}},He=class{store=new Map;add(t,e){if(!t.canReaddir())return;let s=this.store.get(t);s?s.find(n=>n.globString()===e.globString())||s.push(e):this.store.set(t,[e])}get(t){let e=this.store.get(t);if(!e)throw new Error("attempting to walk unknown path");return e}entries(){return this.keys().map(t=>[t,this.store.get(t)])}keys(){return[...this.store.keys()].filter(t=>t.canReaddir())}},Kt=class i{hasWalkedCache;matches=new Ge;subwalks=new He;patterns;follow;dot;opts;constructor(t,e){this.opts=t,this.follow=!!t.follow,this.dot=!!t.dot,this.hasWalkedCache=e?e.copy():new qe}processPatterns(t,e){this.patterns=e;let s=e.map(n=>[t,n]);for(let[n,r]of s){this.hasWalkedCache.storeWalked(n,r);let o=r.root(),a=r.isAbsolute()&&this.opts.absolute!==!1;if(o){n=n.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let m=r.rest();if(m)r=m;else{this.matches.add(n,!0,!1);continue}}if(n.isENOENT())continue;let h,u,d=!1;for(;typeof(h=r.pattern())=="string"&&(u=r.rest());)n=n.resolve(h),r=u,d=!0;if(h=r.pattern(),u=r.rest(),d){if(this.hasWalkedCache.hasWalked(n,r))continue;this.hasWalkedCache.storeWalked(n,r)}if(typeof h=="string"){let m=h===".."||h===""||h===".";this.matches.add(n.resolve(h),a,m);continue}else if(h===L){(!n.isSymbolicLink()||this.follow||r.checkFollowGlobstar())&&this.subwalks.add(n,r);let m=u?.pattern(),g=u?.rest();if(!u||(m===""||m===".")&&!g)this.matches.add(n,a,m===""||m===".");else if(m===".."){let w=n.parent||n;g?this.hasWalkedCache.hasWalked(w,g)||this.subwalks.add(w,g):this.matches.add(w,a,!0)}}else h instanceof RegExp&&this.subwalks.add(n,r)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new i(this.opts,this.hasWalkedCache)}filterEntries(t,e){let s=this.subwalks.get(t),n=this.child();for(let r of e)for(let o of s){let a=o.isAbsolute(),h=o.pattern(),u=o.rest();h===L?n.testGlobstar(r,o,u,a):h instanceof RegExp?n.testRegExp(r,h,u,a):n.testString(r,h,u,a)}return n}testGlobstar(t,e,s,n){if((this.dot||!t.name.startsWith("."))&&(e.hasMore()||this.matches.add(t,n,!1),t.canReaddir()&&(this.follow||!t.isSymbolicLink()?this.subwalks.add(t,e):t.isSymbolicLink()&&(s&&e.checkFollowGlobstar()?this.subwalks.add(t,s):e.markFollowGlobstar()&&this.subwalks.add(t,e)))),s){let r=s.pattern();if(typeof r=="string"&&r!==".."&&r!==""&&r!==".")this.testString(t,r,s.rest(),n);else if(r===".."){let o=t.parent||t;this.subwalks.add(o,s)}else r instanceof RegExp&&this.testRegExp(t,r,s.rest(),n)}}testRegExp(t,e,s,n){e.test(t.name)&&(s?this.subwalks.add(t,s):this.matches.add(t,n,!1))}testString(t,e,s,n){t.isNamed(e)&&(s?this.subwalks.add(t,s):this.matches.add(t,n,!1))}};var Sr=(i,t)=>typeof i=="string"?new Jt([i],t):Array.isArray(i)?new Jt(i,t):i,Se=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#t=[];#s;#r;signal;maxDepth;constructor(t,e,s){this.patterns=t,this.path=e,this.opts=s,this.#r=!s.posix&&s.platform==="win32"?"\\":"/",s.ignore&&(this.#s=Sr(s.ignore,s)),this.maxDepth=s.maxDepth||1/0,s.signal&&(this.signal=s.signal,this.signal.addEventListener("abort",()=>{this.#t.length=0}))}#i(t){return this.seen.has(t)||!!this.#s?.ignored?.(t)}#a(t){return!!this.#s?.childrenIgnored?.(t)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let t;for(;!this.paused&&(t=this.#t.shift());)t()}onResume(t){this.signal?.aborted||(this.paused?this.#t.push(t):t())}async matchCheck(t,e){if(e&&this.opts.nodir)return;let s;if(this.opts.realpath){if(s=t.realpathCached()||await t.realpath(),!s)return;t=s}let r=t.isUnknown()||this.opts.stat?await t.lstat():t;if(this.opts.follow&&this.opts.nodir&&r?.isSymbolicLink()){let o=await r.realpath();o&&(o.isUnknown()||this.opts.stat)&&await o.lstat()}return this.matchCheckTest(r,e)}matchCheckTest(t,e){return t&&(this.maxDepth===1/0||t.depth()<=this.maxDepth)&&(!e||t.canReaddir())&&(!this.opts.nodir||!t.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!t.isSymbolicLink()||!t.realpathCached()?.isDirectory())&&!this.#i(t)?t:void 0}matchCheckSync(t,e){if(e&&this.opts.nodir)return;let s;if(this.opts.realpath){if(s=t.realpathCached()||t.realpathSync(),!s)return;t=s}let r=t.isUnknown()||this.opts.stat?t.lstatSync():t;if(this.opts.follow&&this.opts.nodir&&r?.isSymbolicLink()){let o=r.realpathSync();o&&(o?.isUnknown()||this.opts.stat)&&o.lstatSync()}return this.matchCheckTest(r,e)}matchFinish(t,e){if(this.#i(t))return;let s=this.opts.absolute===void 0?e:this.opts.absolute;this.seen.add(t);let n=this.opts.mark&&t.isDirectory()?this.#r:"";if(this.opts.withFileTypes)this.matchEmit(t);else if(s){let r=this.opts.posix?t.fullpathPosix():t.fullpath();this.matchEmit(r+n)}else{let r=this.opts.posix?t.relativePosix():t.relative(),o=this.opts.dotRelative&&!r.startsWith(".."+this.#r)?"."+this.#r:"";this.matchEmit(r?o+r+n:"."+n)}}async match(t,e,s){let n=await this.matchCheck(t,s);n&&this.matchFinish(n,e)}matchSync(t,e,s){let n=this.matchCheckSync(t,s);n&&this.matchFinish(n,e)}walkCB(t,e,s){this.signal?.aborted&&s(),this.walkCB2(t,e,new Kt(this.opts),s)}walkCB2(t,e,s,n){if(this.#a(t))return n();if(this.signal?.aborted&&n(),this.paused){this.onResume(()=>this.walkCB2(t,e,s,n));return}s.processPatterns(t,e);let r=1,o=()=>{--r===0&&n()};for(let[a,h,u]of s.matches.entries())this.#i(a)||(r++,this.match(a,h,u).then(()=>o()));for(let a of s.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;r++;let h=a.readdirCached();a.calledReaddir()?this.walkCB3(a,h,s,o):a.readdirCB((u,d)=>this.walkCB3(a,d,s,o),!0)}o()}walkCB3(t,e,s,n){s=s.filterEntries(t,e);let r=1,o=()=>{--r===0&&n()};for(let[a,h,u]of s.matches.entries())this.#i(a)||(r++,this.match(a,h,u).then(()=>o()));for(let[a,h]of s.subwalks.entries())r++,this.walkCB2(a,h,s.child(),o);o()}walkCBSync(t,e,s){this.signal?.aborted&&s(),this.walkCB2Sync(t,e,new Kt(this.opts),s)}walkCB2Sync(t,e,s,n){if(this.#a(t))return n();if(this.signal?.aborted&&n(),this.paused){this.onResume(()=>this.walkCB2Sync(t,e,s,n));return}s.processPatterns(t,e);let r=1,o=()=>{--r===0&&n()};for(let[a,h,u]of s.matches.entries())this.#i(a)||this.matchSync(a,h,u);for(let a of s.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;r++;let h=a.readdirSync();this.walkCB3Sync(a,h,s,o)}o()}walkCB3Sync(t,e,s,n){s=s.filterEntries(t,e);let r=1,o=()=>{--r===0&&n()};for(let[a,h,u]of s.matches.entries())this.#i(a)||this.matchSync(a,h,u);for(let[a,h]of s.subwalks.entries())r++,this.walkCB2Sync(a,h,s.child(),o);o()}},Vt=class extends Se{matches;constructor(t,e,s){super(t,e,s),this.matches=new Set}matchEmit(t){this.matches.add(t)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((t,e)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?e(this.signal.reason):t(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},Yt=class extends Se{results;constructor(t,e,s){super(t,e,s),this.results=new dt({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(t){this.results.write(t),this.results.flowing||this.pause()}stream(){let t=this.path;return t.isUnknown()?t.lstat().then(()=>{this.walkCB(t,this.patterns,()=>this.results.end())}):this.walkCB(t,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};var kr=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",it=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;opts;patterns;constructor(t,e){if(!e)throw new TypeError("glob options required");if(this.withFileTypes=!!e.withFileTypes,this.signal=e.signal,this.follow=!!e.follow,this.dot=!!e.dot,this.dotRelative=!!e.dotRelative,this.nodir=!!e.nodir,this.mark=!!e.mark,e.cwd?(e.cwd instanceof URL||e.cwd.startsWith("file://"))&&(e.cwd=(0,li.fileURLToPath)(e.cwd)):this.cwd="",this.cwd=e.cwd||"",this.root=e.root,this.magicalBraces=!!e.magicalBraces,this.nobrace=!!e.nobrace,this.noext=!!e.noext,this.realpath=!!e.realpath,this.absolute=e.absolute,this.noglobstar=!!e.noglobstar,this.matchBase=!!e.matchBase,this.maxDepth=typeof e.maxDepth=="number"?e.maxDepth:1/0,this.stat=!!e.stat,this.ignore=e.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof t=="string"&&(t=[t]),this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(t=t.map(h=>h.replace(/\\/g,"/"))),this.matchBase){if(e.noglobstar)throw new TypeError("base matching requires globstar");t=t.map(h=>h.includes("/")?h:`./**/${h}`)}if(this.pattern=t,this.platform=e.platform||kr,this.opts={...e,platform:this.platform},e.scurry){if(this.scurry=e.scurry,e.nocase!==void 0&&e.nocase!==e.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let h=e.platform==="win32"?Pt:e.platform==="darwin"?Ht:e.platform?Rt:hi;this.scurry=new h(this.cwd,{nocase:e.nocase,fs:e.fs})}this.nocase=this.scurry.nocase;let s=this.platform==="darwin"||this.platform==="win32",n={...e,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:s,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},r=this.pattern.map(h=>new J(h,n)),[o,a]=r.reduce((h,u)=>(h[0].push(...u.set),h[1].push(...u.globParts),h),[[],[]]);this.patterns=o.map((h,u)=>{let d=a[u];if(!d)throw new Error("invalid pattern object");return new Dt(h,d,0,this.platform)})}async walk(){return[...await new Vt(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}).walk()]}walkSync(){return[...new Vt(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}).walkSync()]}stream(){return new Yt(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}).stream()}streamSync(){return new Yt(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}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};var Je=(i,t={})=>{Array.isArray(i)||(i=[i]);for(let e of i)if(new J(e,t).hasMagic())return!0;return!1};function Ee(i,t={}){return new it(i,t).streamSync()}function fi(i,t={}){return new it(i,t).stream()}function ui(i,t={}){return new it(i,t).walkSync()}async function ci(i,t={}){return new it(i,t).walk()}function ve(i,t={}){return new it(i,t).iterateSync()}function di(i,t={}){return new it(i,t).iterate()}var Er=Ee,vr=Object.assign(fi,{sync:Ee}),Tr=ve,xr=Object.assign(di,{sync:ve}),Or=Object.assign(ui,{stream:Ee,iterate:ve}),ke=Object.assign(ci,{glob:ci,globSync:ui,sync:Or,globStream:fi,stream:vr,globStreamSync:Ee,streamSync:Er,globIterate:di,iterate:xr,globIterateSync:ve,iterateSync:Tr,Glob:it,hasMagic:Je,escape:Et,unescape:tt});ke.glob=ke;global.fetch=Ve.default;var Ar="../build",Pr="../wheels";async function wi(i,t){let e=[],s=n=>{e.push(n)};if(await i.loadPackage(t,{errorCallback:s}),e.length>0)throw new Error(e.join(`
|
|
6
|
-
`))}
|
|
2
|
+
"use strict";var pg=Object.create;var nl=Object.defineProperty;var gg=Object.getOwnPropertyDescriptor;var mg=Object.getOwnPropertyNames;var yg=Object.getPrototypeOf,bg=Object.prototype.hasOwnProperty;var w=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var wg=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of mg(e))!bg.call(t,n)&&n!==r&&nl(t,n,{get:()=>e[n],enumerable:!(i=gg(e,n))||i.enumerable});return t};var pe=(t,e,r)=>(r=t!=null?pg(yg(t)):{},wg(e||!t||!t.__esModule?nl(r,"default",{value:t,enumerable:!0}):r,t));var Re=w((cE,al)=>{"use strict";var Os=class t extends Error{constructor(e){super(`Format functions must be synchronous taking a two arguments: (info, opts)
|
|
3
|
+
Found: ${e.toString().split(`
|
|
4
|
+
`)[0]}
|
|
5
|
+
`),Error.captureStackTrace(this,t)}};al.exports=t=>{if(t.length>2)throw new Os(t);function e(i={}){this.options=i}e.prototype.transform=t;function r(i){return new e(i)}return r.Format=e,r}});var fl=w((dE,ul)=>{var ll={};ul.exports=ll;var ol={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(ol).forEach(function(t){var e=ol[t],r=ll[t]=[];r.open="\x1B["+e[0]+"m",r.close="\x1B["+e[1]+"m"})});var cl=w((pE,hl)=>{"use strict";hl.exports=function(t,e){e=e||process.argv||[];var r=e.indexOf("--"),i=/^-{1,2}/.test(t)?"":"--",n=e.indexOf(i+t);return n!==-1&&(r===-1?!0:n<r)}});var pl=w((gE,dl)=>{"use strict";var vg=require("os"),Fe=cl(),we=process.env,er=void 0;Fe("no-color")||Fe("no-colors")||Fe("color=false")?er=!1:(Fe("color")||Fe("colors")||Fe("color=true")||Fe("color=always"))&&(er=!0);"FORCE_COLOR"in we&&(er=we.FORCE_COLOR.length===0||parseInt(we.FORCE_COLOR,10)!==0);function _g(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function Sg(t){if(er===!1)return 0;if(Fe("color=16m")||Fe("color=full")||Fe("color=truecolor"))return 3;if(Fe("color=256"))return 2;if(t&&!t.isTTY&&er!==!0)return 0;var e=er?1:0;if(process.platform==="win32"){var r=vg.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in we)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(n){return n in we})||we.CI_NAME==="codeship"?1:e;if("TEAMCITY_VERSION"in we)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(we.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in we){var i=parseInt((we.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(we.TERM_PROGRAM){case"iTerm.app":return i>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(we.TERM)?2:/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(we.TERM)||"COLORTERM"in we?1:(we.TERM==="dumb",e)}function Ms(t){var e=Sg(t);return _g(e)}dl.exports={supportsColor:Ms,stdout:Ms(process.stdout),stderr:Ms(process.stderr)}});var ml=w((mE,gl)=>{gl.exports=function(e,r){var i="";e=e||"Run the trap, drop the bass",e=e.split("");var n={a:["@","\u0104","\u023A","\u0245","\u0394","\u039B","\u0414"],b:["\xDF","\u0181","\u0243","\u026E","\u03B2","\u0E3F"],c:["\xA9","\u023B","\u03FE"],d:["\xD0","\u018A","\u0500","\u0501","\u0502","\u0503"],e:["\xCB","\u0115","\u018E","\u0258","\u03A3","\u03BE","\u04BC","\u0A6C"],f:["\u04FA"],g:["\u0262"],h:["\u0126","\u0195","\u04A2","\u04BA","\u04C7","\u050A"],i:["\u0F0F"],j:["\u0134"],k:["\u0138","\u04A0","\u04C3","\u051E"],l:["\u0139"],m:["\u028D","\u04CD","\u04CE","\u0520","\u0521","\u0D69"],n:["\xD1","\u014B","\u019D","\u0376","\u03A0","\u048A"],o:["\xD8","\xF5","\xF8","\u01FE","\u0298","\u047A","\u05DD","\u06DD","\u0E4F"],p:["\u01F7","\u048E"],q:["\u09CD"],r:["\xAE","\u01A6","\u0210","\u024C","\u0280","\u042F"],s:["\xA7","\u03DE","\u03DF","\u03E8"],t:["\u0141","\u0166","\u0373"],u:["\u01B1","\u054D"],v:["\u05D8"],w:["\u0428","\u0460","\u047C","\u0D70"],x:["\u04B2","\u04FE","\u04FC","\u04FD"],y:["\xA5","\u04B0","\u04CB"],z:["\u01B5","\u0240"]};return e.forEach(function(s){s=s.toLowerCase();var a=n[s]||[" "],o=Math.floor(Math.random()*a.length);typeof n[s]<"u"?i+=n[s][o]:i+=s}),i}});var bl=w((yE,yl)=>{yl.exports=function(e,r){e=e||" he is here ";var i={up:["\u030D","\u030E","\u0304","\u0305","\u033F","\u0311","\u0306","\u0310","\u0352","\u0357","\u0351","\u0307","\u0308","\u030A","\u0342","\u0313","\u0308","\u034A","\u034B","\u034C","\u0303","\u0302","\u030C","\u0350","\u0300","\u0301","\u030B","\u030F","\u0312","\u0313","\u0314","\u033D","\u0309","\u0363","\u0364","\u0365","\u0366","\u0367","\u0368","\u0369","\u036A","\u036B","\u036C","\u036D","\u036E","\u036F","\u033E","\u035B","\u0346","\u031A"],down:["\u0316","\u0317","\u0318","\u0319","\u031C","\u031D","\u031E","\u031F","\u0320","\u0324","\u0325","\u0326","\u0329","\u032A","\u032B","\u032C","\u032D","\u032E","\u032F","\u0330","\u0331","\u0332","\u0333","\u0339","\u033A","\u033B","\u033C","\u0345","\u0347","\u0348","\u0349","\u034D","\u034E","\u0353","\u0354","\u0355","\u0356","\u0359","\u035A","\u0323"],mid:["\u0315","\u031B","\u0300","\u0301","\u0358","\u0321","\u0322","\u0327","\u0328","\u0334","\u0335","\u0336","\u035C","\u035D","\u035E","\u035F","\u0360","\u0362","\u0338","\u0337","\u0361"," \u0489"]},n=[].concat(i.up,i.down,i.mid);function s(l){var u=Math.floor(Math.random()*l);return u}function a(l){var u=!1;return n.filter(function(h){u=h===l}),u}function o(l,u){var h="",p,c;u=u||{},u.up=typeof u.up<"u"?u.up:!0,u.mid=typeof u.mid<"u"?u.mid:!0,u.down=typeof u.down<"u"?u.down:!0,u.size=typeof u.size<"u"?u.size:"maxi",l=l.split("");for(c in l)if(!a(c)){switch(h=h+l[c],p={up:0,down:0,mid:0},u.size){case"mini":p.up=s(8),p.mid=s(2),p.down=s(8);break;case"maxi":p.up=s(16)+3,p.mid=s(4)+1,p.down=s(64)+3;break;default:p.up=s(8)+1,p.mid=s(6)/2,p.down=s(8)+1;break}var f=["up","mid","down"];for(var y in f)for(var b=f[y],S=0;S<=p[b];S++)u[b]&&(h=h+i[b][s(i[b].length)])}return h}return o(e,r)}});var vl=w((bE,wl)=>{wl.exports=function(t){return function(e,r,i){if(e===" ")return e;switch(r%3){case 0:return t.red(e);case 1:return t.white(e);case 2:return t.blue(e)}}}});var Sl=w((wE,_l)=>{_l.exports=function(t){return function(e,r,i){return r%2===0?e:t.inverse(e)}}});var Rl=w((vE,El)=>{El.exports=function(t){var e=["red","yellow","green","blue","magenta"];return function(r,i,n){return r===" "?r:t[e[i++%e.length]](r)}}});var Tl=w((_E,xl)=>{xl.exports=function(t){var e=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function(r,i,n){return r===" "?r:t[e[Math.round(Math.random()*(e.length-2))]](r)}}});var Dl=w((EE,Pl)=>{var j={};Pl.exports=j;j.themes={};var Eg=require("util"),Ct=j.styles=fl(),Ml=Object.defineProperties,Rg=new RegExp(/[\r\n]+/g);j.supportsColor=pl().supportsColor;typeof j.enabled>"u"&&(j.enabled=j.supportsColor()!==!1);j.enable=function(){j.enabled=!0};j.disable=function(){j.enabled=!1};j.stripColors=j.strip=function(t){return(""+t).replace(/\x1B\[\d+m/g,"")};var SE=j.stylize=function(e,r){if(!j.enabled)return e+"";var i=Ct[r];return!i&&r in j?j[r](e):i.open+e+i.close},xg=/[|\\{}()[\]^$+*?.]/g,Tg=function(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(xg,"\\$&")};function kl(t){var e=function r(){return Mg.apply(r,arguments)};return e._styles=t,e.__proto__=Og,e}var Al=function(){var t={};return Ct.grey=Ct.gray,Object.keys(Ct).forEach(function(e){Ct[e].closeRe=new RegExp(Tg(Ct[e].close),"g"),t[e]={get:function(){return kl(this._styles.concat(e))}}}),t}(),Og=Ml(function(){},Al);function Mg(){var t=Array.prototype.slice.call(arguments),e=t.map(function(a){return a!=null&&a.constructor===String?a:Eg.inspect(a)}).join(" ");if(!j.enabled||!e)return e;for(var r=e.indexOf(`
|
|
6
|
+
`)!=-1,i=this._styles,n=i.length;n--;){var s=Ct[i[n]];e=s.open+e.replace(s.closeRe,s.open)+s.close,r&&(e=e.replace(Rg,function(a){return s.close+a+s.open}))}return e}j.setTheme=function(t){if(typeof t=="string"){console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");return}for(var e in t)(function(r){j[r]=function(i){if(typeof t[r]=="object"){var n=i;for(var s in t[r])n=j[t[r][s]](n);return n}return j[t[r]](i)}})(e)};function kg(){var t={};return Object.keys(Al).forEach(function(e){t[e]={get:function(){return kl([e])}}}),t}var Ag=function(e,r){var i=r.split("");return i=i.map(e),i.join("")};j.trap=ml();j.zalgo=bl();j.maps={};j.maps.america=vl()(j);j.maps.zebra=Sl()(j);j.maps.rainbow=Rl()(j);j.maps.random=Tl()(j);for(Ol in j.maps)(function(t){j[t]=function(e){return Ag(j.maps[t],e)}})(Ol);var Ol;Ml(j,kg())});var ks=w((RE,ql)=>{var Pg=Dl();ql.exports=Pg});var Cl=w(As=>{"use strict";As.levels={error:0,warn:1,help:2,data:3,info:4,debug:5,prompt:6,verbose:7,input:8,silly:9};As.colors={error:"red",warn:"yellow",help:"cyan",data:"grey",info:"green",debug:"blue",prompt:"grey",verbose:"cyan",input:"grey",silly:"magenta"}});var Ll=w(Ps=>{"use strict";Ps.levels={error:0,warn:1,info:2,http:3,verbose:4,debug:5,silly:6};Ps.colors={error:"red",warn:"yellow",info:"green",http:"green",verbose:"cyan",debug:"blue",silly:"magenta"}});var jl=w(Ds=>{"use strict";Ds.levels={emerg:0,alert:1,crit:2,error:3,warning:4,notice:5,info:6,debug:7};Ds.colors={emerg:"red",alert:"yellow",crit:"red",error:"red",warning:"red",notice:"yellow",info:"green",debug:"blue"}});var Nl=w(Di=>{"use strict";Object.defineProperty(Di,"cli",{value:Cl()});Object.defineProperty(Di,"npm",{value:Ll()});Object.defineProperty(Di,"syslog",{value:jl()})});var re=w(Ar=>{"use strict";Object.defineProperty(Ar,"LEVEL",{value:Symbol.for("level")});Object.defineProperty(Ar,"MESSAGE",{value:Symbol.for("message")});Object.defineProperty(Ar,"SPLAT",{value:Symbol.for("splat")});Object.defineProperty(Ar,"configs",{value:Nl()})});var Li=w((AE,Ci)=>{"use strict";var Ls=ks(),{LEVEL:qs,MESSAGE:Cs}=re();Ls.enabled=!0;var Fl=/\s+/,qi=class t{constructor(e={}){e.colors&&this.addColors(e.colors),this.options=e}static addColors(e){let r=Object.keys(e).reduce((i,n)=>(i[n]=Fl.test(e[n])?e[n].split(Fl):e[n],i),{});return t.allColors=Object.assign({},t.allColors||{},r),t.allColors}addColors(e){return t.addColors(e)}colorize(e,r,i){if(typeof i>"u"&&(i=r),!Array.isArray(t.allColors[e]))return Ls[t.allColors[e]](i);for(let n=0,s=t.allColors[e].length;n<s;n++)i=Ls[t.allColors[e][n]](i);return i}transform(e,r){return r.all&&typeof e[Cs]=="string"&&(e[Cs]=this.colorize(e[qs],e.level,e[Cs])),(r.level||r.all||!r.message)&&(e.level=this.colorize(e[qs],e.level)),(r.all||r.message)&&(e.message=this.colorize(e[qs],e.level,e.message)),e}};Ci.exports=t=>new qi(t);Ci.exports.Colorizer=Ci.exports.Format=qi});var $l=w((PE,Il)=>{"use strict";var{Colorizer:Dg}=Li();Il.exports=t=>(Dg.addColors(t.colors||t),t)});var Bl=w((DE,Wl)=>{"use strict";var qg=Re();Wl.exports=qg(t=>(t.message=` ${t.message}`,t))});var Hl=w((qE,zl)=>{"use strict";var Cg=Re(),{LEVEL:Ul,MESSAGE:js}=re();zl.exports=Cg((t,{stack:e,cause:r})=>{if(t instanceof Error){let n=Object.assign({},t,{level:t.level,[Ul]:t[Ul]||t.level,message:t.message,[js]:t[js]||t.message});return e&&(n.stack=t.stack),r&&(n.cause=t.cause),n}if(!(t.message instanceof Error))return t;let i=t.message;return Object.assign(t,i),t.message=i.message,t[js]=i.message,e&&(t.stack=i.stack),r&&(t.cause=i.cause),t})});var Fs=w((CE,Ni)=>{"use strict";var{configs:Lg,LEVEL:Gl,MESSAGE:Ns}=re(),ji=class t{constructor(e={levels:Lg.npm.levels}){this.paddings=t.paddingForLevels(e.levels,e.filler),this.options=e}static getLongestLevel(e){let r=Object.keys(e).map(i=>i.length);return Math.max(...r)}static paddingForLevel(e,r,i){let n=i+1-e.length,s=Math.floor(n/r.length);return`${r}${r.repeat(s)}`.slice(0,n)}static paddingForLevels(e,r=" "){let i=t.getLongestLevel(e);return Object.keys(e).reduce((n,s)=>(n[s]=t.paddingForLevel(s,r,i),n),{})}transform(e,r){return e.message=`${this.paddings[e[Gl]]}${e.message}`,e[Ns]&&(e[Ns]=`${this.paddings[e[Gl]]}${e[Ns]}`),e}};Ni.exports=t=>new ji(t);Ni.exports.Padder=Ni.exports.Format=ji});var Yl=w((LE,Is)=>{"use strict";var{Colorizer:jg}=Li(),{Padder:Ng}=Fs(),{configs:Fg,MESSAGE:Ig}=re(),Fi=class{constructor(e={}){e.levels||(e.levels=Fg.cli.levels),this.colorizer=new jg(e),this.padder=new Ng(e),this.options=e}transform(e,r){return this.colorizer.transform(this.padder.transform(e,r),r),e[Ig]=`${e.level}:${e.message}`,e}};Is.exports=t=>new Fi(t);Is.exports.Format=Fi});var Kl=w((jE,$s)=>{"use strict";var $g=Re();function Vl(t){if(t.every(Wg))return e=>{let r=e;for(let i=0;i<t.length;i++)if(r=t[i].transform(r,t[i].options),!r)return!1;return r}}function Wg(t){if(typeof t.transform!="function")throw new Error(["No transform function found on format. Did you create a format instance?","const myFormat = format(formatFn);","const instance = myFormat();"].join(`
|
|
7
|
+
`));return!0}$s.exports=(...t)=>{let e=$g(Vl(t)),r=e();return r.Format=e.Format,r};$s.exports.cascade=Vl});var Pr=w((zs,Xl)=>{"use strict";var{hasOwnProperty:Ii}=Object.prototype,jt=Us();jt.configure=Us;jt.stringify=jt;jt.default=jt;zs.stringify=jt;zs.configure=Us;Xl.exports=jt;var Bg=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]|[\ud800-\udbff](?![\udc00-\udfff])|(?:[^\ud800-\udbff]|^)[\udc00-\udfff]/;function dt(t){return t.length<5e3&&!Bg.test(t)?`"${t}"`:JSON.stringify(t)}function Ws(t){if(t.length>200)return t.sort();for(let e=1;e<t.length;e++){let r=t[e],i=e;for(;i!==0&&t[i-1]>r;)t[i]=t[i-1],i--;t[i]=r}return t}var Ug=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function Bs(t){return Ug.call(t)!==void 0&&t.length!==0}function Jl(t,e,r){t.length<r&&(r=t.length);let i=e===","?"":" ",n=`"0":${i}${t[0]}`;for(let s=1;s<r;s++)n+=`${e}"${s}":${i}${t[s]}`;return n}function zg(t){if(Ii.call(t,"circularValue")){let e=t.circularValue;if(typeof e=="string")return`"${e}"`;if(e==null)return e;if(e===Error||e===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}function Zl(t,e){let r;if(Ii.call(t,e)&&(r=t[e],typeof r!="boolean"))throw new TypeError(`The "${e}" argument must be of type boolean`);return r===void 0?!0:r}function Ql(t,e){let r;if(Ii.call(t,e)){if(r=t[e],typeof r!="number")throw new TypeError(`The "${e}" argument must be of type number`);if(!Number.isInteger(r))throw new TypeError(`The "${e}" argument must be an integer`);if(r<1)throw new RangeError(`The "${e}" argument must be >= 1`)}return r===void 0?1/0:r}function Lt(t){return t===1?"1 item":`${t} items`}function Hg(t){let e=new Set;for(let r of t)(typeof r=="string"||typeof r=="number")&&e.add(String(r));return e}function Gg(t){if(Ii.call(t,"strict")){let e=t.strict;if(typeof e!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(e)return r=>{let i=`Object can not safely be stringified. Received type ${typeof r}`;throw typeof r!="function"&&(i+=` (${r.toString()})`),new Error(i)}}}function Us(t){t={...t};let e=Gg(t);e&&(t.bigint===void 0&&(t.bigint=!1),"circularValue"in t||(t.circularValue=Error));let r=zg(t),i=Zl(t,"bigint"),n=Zl(t,"deterministic"),s=Ql(t,"maximumDepth"),a=Ql(t,"maximumBreadth");function o(c,f,y,b,S,_){let x=f[c];switch(typeof x=="object"&&x!==null&&typeof x.toJSON=="function"&&(x=x.toJSON(c)),x=b.call(f,c,x),typeof x){case"string":return dt(x);case"object":{if(x===null)return"null";if(y.indexOf(x)!==-1)return r;let R="",O=",",A=_;if(Array.isArray(x)){if(x.length===0)return"[]";if(s<y.length+1)return'"[Array]"';y.push(x),S!==""&&(_+=S,R+=`
|
|
8
|
+
${_}`,O=`,
|
|
9
|
+
${_}`);let J=Math.min(x.length,a),ye=0;for(;ye<J-1;ye++){let rt=o(String(ye),x,y,b,S,_);R+=rt!==void 0?rt:"null",R+=O}let be=o(String(ye),x,y,b,S,_);if(R+=be!==void 0?be:"null",x.length-1>a){let rt=x.length-a-1;R+=`${O}"... ${Lt(rt)} not stringified"`}return S!==""&&(R+=`
|
|
10
|
+
${A}`),y.pop(),`[${R}]`}let D=Object.keys(x),F=D.length;if(F===0)return"{}";if(s<y.length+1)return'"[Object]"';let N="",B="";S!==""&&(_+=S,O=`,
|
|
11
|
+
${_}`,N=" ");let te=Math.min(F,a);n&&!Bs(x)&&(D=Ws(D)),y.push(x);for(let J=0;J<te;J++){let ye=D[J],be=o(ye,x,y,b,S,_);be!==void 0&&(R+=`${B}${dt(ye)}:${N}${be}`,B=O)}if(F>a){let J=F-a;R+=`${B}"...":${N}"${Lt(J)} not stringified"`,B=O}return S!==""&&B.length>1&&(R=`
|
|
12
|
+
${_}${R}
|
|
13
|
+
${A}`),y.pop(),`{${R}}`}case"number":return isFinite(x)?String(x):e?e(x):"null";case"boolean":return x===!0?"true":"false";case"undefined":return;case"bigint":if(i)return String(x);default:return e?e(x):void 0}}function l(c,f,y,b,S,_){switch(typeof f=="object"&&f!==null&&typeof f.toJSON=="function"&&(f=f.toJSON(c)),typeof f){case"string":return dt(f);case"object":{if(f===null)return"null";if(y.indexOf(f)!==-1)return r;let x=_,R="",O=",";if(Array.isArray(f)){if(f.length===0)return"[]";if(s<y.length+1)return'"[Array]"';y.push(f),S!==""&&(_+=S,R+=`
|
|
14
|
+
${_}`,O=`,
|
|
15
|
+
${_}`);let F=Math.min(f.length,a),N=0;for(;N<F-1;N++){let te=l(String(N),f[N],y,b,S,_);R+=te!==void 0?te:"null",R+=O}let B=l(String(N),f[N],y,b,S,_);if(R+=B!==void 0?B:"null",f.length-1>a){let te=f.length-a-1;R+=`${O}"... ${Lt(te)} not stringified"`}return S!==""&&(R+=`
|
|
16
|
+
${x}`),y.pop(),`[${R}]`}y.push(f);let A="";S!==""&&(_+=S,O=`,
|
|
17
|
+
${_}`,A=" ");let D="";for(let F of b){let N=l(F,f[F],y,b,S,_);N!==void 0&&(R+=`${D}${dt(F)}:${A}${N}`,D=O)}return S!==""&&D.length>1&&(R=`
|
|
18
|
+
${_}${R}
|
|
19
|
+
${x}`),y.pop(),`{${R}}`}case"number":return isFinite(f)?String(f):e?e(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(i)return String(f);default:return e?e(f):void 0}}function u(c,f,y,b,S){switch(typeof f){case"string":return dt(f);case"object":{if(f===null)return"null";if(typeof f.toJSON=="function"){if(f=f.toJSON(c),typeof f!="object")return u(c,f,y,b,S);if(f===null)return"null"}if(y.indexOf(f)!==-1)return r;let _=S;if(Array.isArray(f)){if(f.length===0)return"[]";if(s<y.length+1)return'"[Array]"';y.push(f),S+=b;let N=`
|
|
20
|
+
${S}`,B=`,
|
|
21
|
+
${S}`,te=Math.min(f.length,a),J=0;for(;J<te-1;J++){let be=u(String(J),f[J],y,b,S);N+=be!==void 0?be:"null",N+=B}let ye=u(String(J),f[J],y,b,S);if(N+=ye!==void 0?ye:"null",f.length-1>a){let be=f.length-a-1;N+=`${B}"... ${Lt(be)} not stringified"`}return N+=`
|
|
22
|
+
${_}`,y.pop(),`[${N}]`}let x=Object.keys(f),R=x.length;if(R===0)return"{}";if(s<y.length+1)return'"[Object]"';S+=b;let O=`,
|
|
23
|
+
${S}`,A="",D="",F=Math.min(R,a);Bs(f)&&(A+=Jl(f,O,a),x=x.slice(f.length),F-=f.length,D=O),n&&(x=Ws(x)),y.push(f);for(let N=0;N<F;N++){let B=x[N],te=u(B,f[B],y,b,S);te!==void 0&&(A+=`${D}${dt(B)}: ${te}`,D=O)}if(R>a){let N=R-a;A+=`${D}"...": "${Lt(N)} not stringified"`,D=O}return D!==""&&(A=`
|
|
24
|
+
${S}${A}
|
|
25
|
+
${_}`),y.pop(),`{${A}}`}case"number":return isFinite(f)?String(f):e?e(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(i)return String(f);default:return e?e(f):void 0}}function h(c,f,y){switch(typeof f){case"string":return dt(f);case"object":{if(f===null)return"null";if(typeof f.toJSON=="function"){if(f=f.toJSON(c),typeof f!="object")return h(c,f,y);if(f===null)return"null"}if(y.indexOf(f)!==-1)return r;let b="";if(Array.isArray(f)){if(f.length===0)return"[]";if(s<y.length+1)return'"[Array]"';y.push(f);let O=Math.min(f.length,a),A=0;for(;A<O-1;A++){let F=h(String(A),f[A],y);b+=F!==void 0?F:"null",b+=","}let D=h(String(A),f[A],y);if(b+=D!==void 0?D:"null",f.length-1>a){let F=f.length-a-1;b+=`,"... ${Lt(F)} not stringified"`}return y.pop(),`[${b}]`}let S=Object.keys(f),_=S.length;if(_===0)return"{}";if(s<y.length+1)return'"[Object]"';let x="",R=Math.min(_,a);Bs(f)&&(b+=Jl(f,",",a),S=S.slice(f.length),R-=f.length,x=","),n&&(S=Ws(S)),y.push(f);for(let O=0;O<R;O++){let A=S[O],D=h(A,f[A],y);D!==void 0&&(b+=`${x}${dt(A)}:${D}`,x=",")}if(_>a){let O=_-a;b+=`${x}"...":"${Lt(O)} not stringified"`}return y.pop(),`{${b}}`}case"number":return isFinite(f)?String(f):e?e(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(i)return String(f);default:return e?e(f):void 0}}function p(c,f,y){if(arguments.length>1){let b="";if(typeof y=="number"?b=" ".repeat(Math.min(y,10)):typeof y=="string"&&(b=y.slice(0,10)),f!=null){if(typeof f=="function")return o("",{"":c},[],f,b,"");if(Array.isArray(f))return l("",c,[],Hg(f),b,"")}if(b.length!==0)return u("",c,[],b,"")}return h("",c,[])}return p}});var Hs=w((NE,eu)=>{"use strict";var Yg=Re(),{MESSAGE:Vg}=re(),Kg=Pr();function Jg(t,e){return typeof e=="bigint"?e.toString():e}eu.exports=Yg((t,e)=>{let r=Kg.configure(e);return t[Vg]=r(t,e.replacer||Jg,e.space),t})});var ru=w((FE,tu)=>{"use strict";var Zg=Re();tu.exports=Zg((t,e)=>e.message?(t.message=`[${e.label}] ${t.message}`,t):(t.label=e.label,t))});var nu=w((IE,iu)=>{"use strict";var Qg=Re(),{MESSAGE:Xg}=re(),em=Pr();iu.exports=Qg(t=>{let e={};return t.message&&(e["@message"]=t.message,delete t.message),t.timestamp&&(e["@timestamp"]=t.timestamp,delete t.timestamp),e["@fields"]=t,t[Xg]=em(e),t})});var au=w(($E,su)=>{"use strict";var tm=Re();function rm(t,e,r){let i=e.reduce((s,a)=>(s[a]=t[a],delete t[a],s),{}),n=Object.keys(t).reduce((s,a)=>(s[a]=t[a],delete t[a],s),{});return Object.assign(t,i,{[r]:n}),t}function im(t,e,r){return t[r]=e.reduce((i,n)=>(i[n]=t[n],delete t[n],i),{}),t}su.exports=tm((t,e={})=>{let r="metadata";e.key&&(r=e.key);let i=[];return!e.fillExcept&&!e.fillWith&&(i.push("level"),i.push("message")),e.fillExcept&&(i=e.fillExcept),i.length>0?rm(t,i,r):e.fillWith?im(t,e.fillWith,r):t})});var lu=w((WE,ou)=>{var tr=1e3,rr=tr*60,ir=rr*60,Nt=ir*24,nm=Nt*7,sm=Nt*365.25;ou.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return am(t);if(r==="number"&&isFinite(t))return e.long?lm(t):om(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function am(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),i=(e[2]||"ms").toLowerCase();switch(i){case"years":case"year":case"yrs":case"yr":case"y":return r*sm;case"weeks":case"week":case"w":return r*nm;case"days":case"day":case"d":return r*Nt;case"hours":case"hour":case"hrs":case"hr":case"h":return r*ir;case"minutes":case"minute":case"mins":case"min":case"m":return r*rr;case"seconds":case"second":case"secs":case"sec":case"s":return r*tr;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function om(t){var e=Math.abs(t);return e>=Nt?Math.round(t/Nt)+"d":e>=ir?Math.round(t/ir)+"h":e>=rr?Math.round(t/rr)+"m":e>=tr?Math.round(t/tr)+"s":t+"ms"}function lm(t){var e=Math.abs(t);return e>=Nt?$i(t,e,Nt,"day"):e>=ir?$i(t,e,ir,"hour"):e>=rr?$i(t,e,rr,"minute"):e>=tr?$i(t,e,tr,"second"):t+" ms"}function $i(t,e,r,i){var n=e>=r*1.5;return Math.round(t/r)+" "+i+(n?"s":"")}});var fu=w((Dr,uu)=>{"use strict";var um=Re(),fm=lu();uu.exports=um(t=>{let e=+new Date;return Dr.diff=e-(Dr.prevTime||e),Dr.prevTime=e,t.ms=`+${fm(Dr.diff)}`,t})});var du=w((BE,cu)=>{"use strict";var hm=require("util").inspect,cm=Re(),{LEVEL:dm,MESSAGE:hu,SPLAT:pm}=re();cu.exports=cm((t,e={})=>{let r=Object.assign({},t);return delete r[dm],delete r[hu],delete r[pm],t[hu]=hm(r,!1,e.depth||null,e.colorize),t})});var pu=w((UE,Bi)=>{"use strict";var{MESSAGE:gm}=re(),Wi=class{constructor(e){this.template=e}transform(e){return e[gm]=this.template(e),e}};Bi.exports=t=>new Wi(t);Bi.exports.Printf=Bi.exports.Format=Wi});var yu=w((zE,mu)=>{"use strict";var mm=Re(),{MESSAGE:gu}=re(),ym=Pr();mu.exports=mm(t=>{let e=ym(Object.assign({},t,{level:void 0,message:void 0,splat:void 0})),r=t.padding&&t.padding[t.level]||"";return e!=="{}"?t[gu]=`${t.level}:${r} ${t.message} ${e}`:t[gu]=`${t.level}:${r} ${t.message}`,t})});var vu=w((HE,wu)=>{"use strict";var bm=require("util"),{SPLAT:bu}=re(),wm=/%[scdjifoO%]/g,vm=/%%/g,Gs=class{constructor(e){this.options=e}_splat(e,r){let i=e.message,n=e[bu]||e.splat||[],s=i.match(vm),a=s&&s.length||0,l=r.length-a-n.length,u=l<0?n.splice(l,-1*l):[],h=u.length;if(h)for(let p=0;p<h;p++)Object.assign(e,u[p]);return e.message=bm.format(i,...n),e}transform(e){let r=e.message,i=e[bu]||e.splat;if(!i||!i.length)return e;let n=r&&r.match&&r.match(wm);if(!n&&(i||i.length)){let s=i.length>1?i.splice(0):i,a=s.length;if(a)for(let o=0;o<a;o++)Object.assign(e,s[o]);return e}return n?this._splat(e,n):e}};wu.exports=t=>new Gs(t)});var Su=w((Ui,_u)=>{(function(t,e){typeof Ui=="object"&&typeof _u<"u"?e(Ui):typeof define=="function"&&define.amd?define(["exports"],e):e(t.fecha={})})(Ui,function(t){"use strict";var e=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,r="\\d\\d?",i="\\d\\d",n="\\d{3}",s="\\d{4}",a="[^\\s]+",o=/\[([^]*?)\]/gm;function l(E,M){for(var U=[],de=0,P=E.length;de<P;de++)U.push(E[de].substr(0,M));return U}var u=function(E){return function(M,U){var de=U[E].map(function(Ee){return Ee.toLowerCase()}),P=de.indexOf(M.toLowerCase());return P>-1?P:null}};function h(E){for(var M=[],U=1;U<arguments.length;U++)M[U-1]=arguments[U];for(var de=0,P=M;de<P.length;de++){var Ee=P[de];for(var it in Ee)E[it]=Ee[it]}return E}var p=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],c=["January","February","March","April","May","June","July","August","September","October","November","December"],f=l(c,3),y=l(p,3),b={dayNamesShort:y,dayNames:p,monthNamesShort:f,monthNames:c,amPm:["am","pm"],DoFn:function(E){return E+["th","st","nd","rd"][E%10>3?0:(E-E%10!==10?1:0)*E%10]}},S=h({},b),_=function(E){return S=h(S,E)},x=function(E){return E.replace(/[|\\{()[^$+*?.-]/g,"\\$&")},R=function(E,M){for(M===void 0&&(M=2),E=String(E);E.length<M;)E="0"+E;return E},O={D:function(E){return String(E.getDate())},DD:function(E){return R(E.getDate())},Do:function(E,M){return M.DoFn(E.getDate())},d:function(E){return String(E.getDay())},dd:function(E){return R(E.getDay())},ddd:function(E,M){return M.dayNamesShort[E.getDay()]},dddd:function(E,M){return M.dayNames[E.getDay()]},M:function(E){return String(E.getMonth()+1)},MM:function(E){return R(E.getMonth()+1)},MMM:function(E,M){return M.monthNamesShort[E.getMonth()]},MMMM:function(E,M){return M.monthNames[E.getMonth()]},YY:function(E){return R(String(E.getFullYear()),4).substr(2)},YYYY:function(E){return R(E.getFullYear(),4)},h:function(E){return String(E.getHours()%12||12)},hh:function(E){return R(E.getHours()%12||12)},H:function(E){return String(E.getHours())},HH:function(E){return R(E.getHours())},m:function(E){return String(E.getMinutes())},mm:function(E){return R(E.getMinutes())},s:function(E){return String(E.getSeconds())},ss:function(E){return R(E.getSeconds())},S:function(E){return String(Math.round(E.getMilliseconds()/100))},SS:function(E){return R(Math.round(E.getMilliseconds()/10),2)},SSS:function(E){return R(E.getMilliseconds(),3)},a:function(E,M){return E.getHours()<12?M.amPm[0]:M.amPm[1]},A:function(E,M){return E.getHours()<12?M.amPm[0].toUpperCase():M.amPm[1].toUpperCase()},ZZ:function(E){var M=E.getTimezoneOffset();return(M>0?"-":"+")+R(Math.floor(Math.abs(M)/60)*100+Math.abs(M)%60,4)},Z:function(E){var M=E.getTimezoneOffset();return(M>0?"-":"+")+R(Math.floor(Math.abs(M)/60),2)+":"+R(Math.abs(M)%60,2)}},A=function(E){return+E-1},D=[null,r],F=[null,a],N=["isPm",a,function(E,M){var U=E.toLowerCase();return U===M.amPm[0]?0:U===M.amPm[1]?1:null}],B=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(E){var M=(E+"").match(/([+-]|\d\d)/gi);if(M){var U=+M[1]*60+parseInt(M[2],10);return M[0]==="+"?U:-U}return 0}],te={D:["day",r],DD:["day",i],Do:["day",r+a,function(E){return parseInt(E,10)}],M:["month",r,A],MM:["month",i,A],YY:["year",i,function(E){var M=new Date,U=+(""+M.getFullYear()).substr(0,2);return+(""+(+E>68?U-1:U)+E)}],h:["hour",r,void 0,"isPm"],hh:["hour",i,void 0,"isPm"],H:["hour",r],HH:["hour",i],m:["minute",r],mm:["minute",i],s:["second",r],ss:["second",i],YYYY:["year",s],S:["millisecond","\\d",function(E){return+E*100}],SS:["millisecond",i,function(E){return+E*10}],SSS:["millisecond",n],d:D,dd:D,ddd:F,dddd:F,MMM:["month",a,u("monthNamesShort")],MMMM:["month",a,u("monthNames")],a:N,A:N,ZZ:B,Z:B},J={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},ye=function(E){return h(J,E)},be=function(E,M,U){if(M===void 0&&(M=J.default),U===void 0&&(U={}),typeof E=="number"&&(E=new Date(E)),Object.prototype.toString.call(E)!=="[object Date]"||isNaN(E.getTime()))throw new Error("Invalid Date pass to format");M=J[M]||M;var de=[];M=M.replace(o,function(Ee,it){return de.push(it),"@@@"});var P=h(h({},S),U);return M=M.replace(e,function(Ee){return O[Ee](E,P)}),M.replace(/@@@/g,function(){return de.shift()})};function rt(E,M,U){if(U===void 0&&(U={}),typeof M!="string")throw new Error("Invalid format in fecha parse");if(M=J[M]||M,E.length>1e3)return null;var de=new Date,P={year:de.getFullYear(),month:0,day:1,hour:0,minute:0,second:0,millisecond:0,isPm:null,timezoneOffset:null},Ee=[],it=[],At=M.replace(o,function(Dt,ct){return it.push(x(ct)),"@@@"}),He={},Mr={};At=x(At).replace(e,function(Dt){var ct=te[Dt],Xt=ct[0],Ts=ct[1],ki=ct[3];if(He[Xt])throw new Error("Invalid format. "+Xt+" specified twice in format");return He[Xt]=!0,ki&&(Mr[ki]=!0),Ee.push(ct),"("+Ts+")"}),Object.keys(Mr).forEach(function(Dt){if(!He[Dt])throw new Error("Invalid format. "+Dt+" is required in specified format")}),At=At.replace(/@@@/g,function(){return it.shift()});var Qt=E.match(new RegExp(At,"i"));if(!Qt)return null;for(var Es=h(h({},S),U),Te=1;Te<Qt.length;Te++){var kr=Ee[Te-1],Rs=kr[0],ft=kr[2],Mi=ft?ft(Qt[Te],Es):+Qt[Te];if(Mi==null)return null;P[Rs]=Mi}P.isPm===1&&P.hour!=null&&+P.hour!=12?P.hour=+P.hour+12:P.isPm===0&&+P.hour==12&&(P.hour=0);var Pt;if(P.timezoneOffset==null){Pt=new Date(P.year,P.month,P.day,P.hour,P.minute,P.second,P.millisecond);for(var ht=[["month","getMonth"],["day","getDate"],["hour","getHours"],["minute","getMinutes"],["second","getSeconds"]],Te=0,xs=ht.length;Te<xs;Te++)if(He[ht[Te][0]]&&P[ht[Te][0]]!==Pt[ht[Te][1]]())return null}else if(Pt=new Date(Date.UTC(P.year,P.month,P.day,P.hour,P.minute-P.timezoneOffset,P.second,P.millisecond)),P.month>11||P.month<0||P.day>31||P.day<1||P.hour>23||P.hour<0||P.minute>59||P.minute<0||P.second>59||P.second<0)return null;return Pt}var Ss={format:be,parse:rt,defaultI18n:b,setGlobalDateI18n:_,setGlobalDateMasks:ye};t.assign=h,t.default=Ss,t.format=be,t.parse=rt,t.defaultI18n=b,t.setGlobalDateI18n=_,t.setGlobalDateMasks=ye,Object.defineProperty(t,"__esModule",{value:!0})})});var Ru=w((GE,Eu)=>{"use strict";var _m=Su(),Sm=Re();Eu.exports=Sm((t,e={})=>(e.format&&(t.timestamp=typeof e.format=="function"?e.format():_m.format(new Date,e.format)),t.timestamp||(t.timestamp=new Date().toISOString()),e.alias&&(t[e.alias]=t.timestamp),t))});var Tu=w((YE,xu)=>{"use strict";var Ys=ks(),Em=Re(),{MESSAGE:Vs}=re();xu.exports=Em((t,e)=>(e.level!==!1&&(t.level=Ys.strip(t.level)),e.message!==!1&&(t.message=Ys.strip(String(t.message))),e.raw!==!1&&t[Vs]&&(t[Vs]=Ys.strip(String(t[Vs]))),t))});var Js=w(Ks=>{"use strict";var Rm=Ks.format=Re();Ks.levels=$l();function le(t,e){Object.defineProperty(Rm,t,{get(){return e()},configurable:!0})}le("align",function(){return Bl()});le("errors",function(){return Hl()});le("cli",function(){return Yl()});le("combine",function(){return Kl()});le("colorize",function(){return Li()});le("json",function(){return Hs()});le("label",function(){return ru()});le("logstash",function(){return nu()});le("metadata",function(){return au()});le("ms",function(){return fu()});le("padLevels",function(){return Fs()});le("prettyPrint",function(){return du()});le("printf",function(){return pu()});le("simple",function(){return yu()});le("splat",function(){return vu()});le("timestamp",function(){return Ru()});le("uncolorize",function(){return Tu()})});var Zs=w(zi=>{"use strict";var{format:Ou}=require("util");zi.warn={deprecated(t){return()=>{throw new Error(Ou("{ %s } was removed in winston@3.0.0.",t))}},useFormat(t){return()=>{throw new Error([Ou("{ %s } was removed in winston@3.0.0.",t),"Use a custom winston.format = winston.format(function) instead."].join(`
|
|
26
|
+
`))}},forFunctions(t,e,r){r.forEach(i=>{t[i]=zi.warn[e](i)})},forProperties(t,e,r){r.forEach(i=>{let n=zi.warn[e](i);Object.defineProperty(t,i,{get:n,set:n})})}}});var Mu=w((JE,xm)=>{xm.exports={name:"winston",description:"A logger for just about everything.",version:"3.13.0",author:"Charlie Robbins <charlie.robbins@gmail.com>",maintainers:["David Hyde <dabh@alumni.stanford.edu>"],repository:{type:"git",url:"https://github.com/winstonjs/winston.git"},keywords:["winston","logger","logging","logs","sysadmin","bunyan","pino","loglevel","tools","json","stream"],dependencies:{"@dabh/diagnostics":"^2.0.2","@colors/colors":"^1.6.0",async:"^3.2.3","is-stream":"^2.0.0",logform:"^2.4.0","one-time":"^1.0.0","readable-stream":"^3.4.0","safe-stable-stringify":"^2.3.1","stack-trace":"0.0.x","triple-beam":"^1.3.0","winston-transport":"^4.7.0"},devDependencies:{"@babel/cli":"^7.23.9","@babel/core":"^7.24.0","@babel/preset-env":"^7.24.0","@dabh/eslint-config-populist":"^5.0.0","@types/node":"^20.11.24","abstract-winston-transport":"^0.5.1",assume:"^2.2.0","cross-spawn-async":"^2.2.5",eslint:"^8.57.0",hock:"^1.4.1",mocha:"^10.3.0",nyc:"^15.1.0",rimraf:"^5.0.5",split2:"^4.1.0","std-mocks":"^2.0.0",through2:"^4.0.2","winston-compat":"^0.1.5"},main:"./lib/winston.js",browser:"./dist/winston",types:"./index.d.ts",scripts:{lint:"eslint lib/*.js lib/winston/*.js lib/winston/**/*.js --resolve-plugins-relative-to ./node_modules/@dabh/eslint-config-populist",test:"rimraf test/fixtures/logs/* && mocha","test:coverage":"nyc npm run test:unit","test:unit":"mocha test/unit","test:integration":"mocha test/integration",build:"rimraf dist && babel lib -d dist",prepublishOnly:"npm run build"},engines:{node:">= 12.0.0"},license:"MIT"}});var Qs=w((ZE,ku)=>{ku.exports=require("util").deprecate});var Xs=w((QE,Au)=>{Au.exports=require("stream")});var ta=w((XE,Du)=>{"use strict";function Tm(t,e){var r=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(ea,this,t)):process.nextTick(ea,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(s){!e&&s?r._writableState?r._writableState.errorEmitted?process.nextTick(Hi,r):(r._writableState.errorEmitted=!0,process.nextTick(Pu,r,s)):process.nextTick(Pu,r,s):e?(process.nextTick(Hi,r),e(s)):process.nextTick(Hi,r)}),this)}function Pu(t,e){ea(t,e),Hi(t)}function Hi(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function Om(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function ea(t,e){t.emit("error",e)}function Mm(t,e){var r=t._readableState,i=t._writableState;r&&r.autoDestroy||i&&i.autoDestroy?t.destroy(e):t.emit("error",e)}Du.exports={destroy:Tm,undestroy:Om,errorOrDestroy:Mm}});var nr=w((e2,Lu)=>{"use strict";var Cu={};function De(t,e,r){r||(r=Error);function i(s,a,o){return typeof e=="string"?e:e(s,a,o)}class n extends r{constructor(a,o,l){super(i(a,o,l))}}n.prototype.name=r.name,n.prototype.code=t,Cu[t]=n}function qu(t,e){if(Array.isArray(t)){let r=t.length;return t=t.map(i=>String(i)),r>2?`one of ${e} ${t.slice(0,r-1).join(", ")}, or `+t[r-1]:r===2?`one of ${e} ${t[0]} or ${t[1]}`:`of ${e} ${t[0]}`}else return`of ${e} ${String(t)}`}function km(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}function Am(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}function Pm(t,e,r){return typeof r!="number"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}De("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);De("ERR_INVALID_ARG_TYPE",function(t,e,r){let i;typeof e=="string"&&km(e,"not ")?(i="must not be",e=e.replace(/^not /,"")):i="must be";let n;if(Am(t," argument"))n=`The ${t} ${i} ${qu(e,"type")}`;else{let s=Pm(t,".")?"property":"argument";n=`The "${t}" ${s} ${i} ${qu(e,"type")}`}return n+=`. Received type ${typeof r}`,n},TypeError);De("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");De("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});De("ERR_STREAM_PREMATURE_CLOSE","Premature close");De("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});De("ERR_MULTIPLE_CALLBACK","Callback called multiple times");De("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");De("ERR_STREAM_WRITE_AFTER_END","write after end");De("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);De("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);De("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");Lu.exports.codes=Cu});var ra=w((t2,ju)=>{"use strict";var Dm=nr().codes.ERR_INVALID_OPT_VALUE;function qm(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function Cm(t,e,r,i){var n=qm(e,i,r);if(n!=null){if(!(isFinite(n)&&Math.floor(n)===n)||n<0){var s=i?r:"highWaterMark";throw new Dm(s,n)}return Math.floor(n)}return t.objectMode?16:16*1024}ju.exports={getHighWaterMark:Cm}});var Nu=w((r2,ia)=>{typeof Object.create=="function"?ia.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:ia.exports=function(e,r){if(r){e.super_=r;var i=function(){};i.prototype=r.prototype,e.prototype=new i,e.prototype.constructor=e}}});var nt=w((i2,sa)=>{try{if(na=require("util"),typeof na.inherits!="function")throw"";sa.exports=na.inherits}catch{sa.exports=Nu()}var na});var Uu=w((n2,Bu)=>{"use strict";function Fu(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,i)}return r}function Iu(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Fu(Object(r),!0).forEach(function(i){Lm(t,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Fu(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))})}return t}function Lm(t,e,r){return e=Wu(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function jm(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function $u(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Wu(i.key),i)}}function Nm(t,e,r){return e&&$u(t.prototype,e),r&&$u(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Wu(t){var e=Fm(t,"string");return typeof e=="symbol"?e:String(e)}function Fm(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var i=r.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Im=require("buffer"),Gi=Im.Buffer,$m=require("util"),aa=$m.inspect,Wm=aa&&aa.custom||"inspect";function Bm(t,e,r){Gi.prototype.copy.call(t,e,r)}Bu.exports=function(){function t(){jm(this,t),this.head=null,this.tail=null,this.length=0}return Nm(t,[{key:"push",value:function(r){var i={data:r,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length}},{key:"unshift",value:function(r){var i={data:r,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length}},{key:"shift",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(r){if(this.length===0)return"";for(var i=this.head,n=""+i.data;i=i.next;)n+=r+i.data;return n}},{key:"concat",value:function(r){if(this.length===0)return Gi.alloc(0);for(var i=Gi.allocUnsafe(r>>>0),n=this.head,s=0;n;)Bm(n.data,i,s),s+=n.data.length,n=n.next;return i}},{key:"consume",value:function(r,i){var n;return r<this.head.data.length?(n=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?n=this.shift():n=i?this._getString(r):this._getBuffer(r),n}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(r){var i=this.head,n=1,s=i.data;for(r-=s.length;i=i.next;){var a=i.data,o=r>a.length?a.length:r;if(o===a.length?s+=a:s+=a.slice(0,r),r-=o,r===0){o===a.length?(++n,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=a.slice(o));break}++n}return this.length-=n,s}},{key:"_getBuffer",value:function(r){var i=Gi.allocUnsafe(r),n=this.head,s=1;for(n.data.copy(i),r-=n.data.length;n=n.next;){var a=n.data,o=r>a.length?a.length:r;if(a.copy(i,i.length-r,0,o),r-=o,r===0){o===a.length?(++s,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=a.slice(o));break}++s}return this.length-=s,i}},{key:Wm,value:function(r,i){return aa(this,Iu(Iu({},i),{},{depth:0,customInspect:!1}))}}]),t}()});var la=w((oa,Hu)=>{var Yi=require("buffer"),Ge=Yi.Buffer;function zu(t,e){for(var r in t)e[r]=t[r]}Ge.from&&Ge.alloc&&Ge.allocUnsafe&&Ge.allocUnsafeSlow?Hu.exports=Yi:(zu(Yi,oa),oa.Buffer=Ft);function Ft(t,e,r){return Ge(t,e,r)}Ft.prototype=Object.create(Ge.prototype);zu(Ge,Ft);Ft.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return Ge(t,e,r)};Ft.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var i=Ge(t);return e!==void 0?typeof r=="string"?i.fill(e,r):i.fill(e):i.fill(0),i};Ft.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Ge(t)};Ft.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Yi.SlowBuffer(t)}});var ha=w(Yu=>{"use strict";var fa=la().Buffer,Gu=fa.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function Um(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}function zm(t){var e=Um(t);if(typeof e!="string"&&(fa.isEncoding===Gu||!Gu(t)))throw new Error("Unknown encoding: "+t);return e||t}Yu.StringDecoder=qr;function qr(t){this.encoding=zm(t);var e;switch(this.encoding){case"utf16le":this.text=Jm,this.end=Zm,e=4;break;case"utf8":this.fillLast=Ym,e=4;break;case"base64":this.text=Qm,this.end=Xm,e=3;break;default:this.write=ey,this.end=ty;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=fa.allocUnsafe(e)}qr.prototype.write=function(t){if(t.length===0)return"";var e,r;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""};qr.prototype.end=Km;qr.prototype.text=Vm;qr.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};function ua(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function Hm(t,e,r){var i=e.length-1;if(i<r)return 0;var n=ua(e[i]);return n>=0?(n>0&&(t.lastNeed=n-1),n):--i<r||n===-2?0:(n=ua(e[i]),n>=0?(n>0&&(t.lastNeed=n-2),n):--i<r||n===-2?0:(n=ua(e[i]),n>=0?(n>0&&(n===2?n=0:t.lastNeed=n-3),n):0))}function Gm(t,e,r){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}function Ym(t){var e=this.lastTotal-this.lastNeed,r=Gm(this,t,e);if(r!==void 0)return r;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}function Vm(t,e){var r=Hm(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var i=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)}function Km(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}function Jm(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function Zm(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function Qm(t,e){var r=(t.length-e)%3;return r===0?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function Xm(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function ey(t){return t.toString(this.encoding)}function ty(t){return t&&t.length?this.write(t):""}});var Zu=w((a2,Ju)=>{"use strict";var Vu=nr().codes.ERR_STREAM_PREMATURE_CLOSE;function ry(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,i=new Array(r),n=0;n<r;n++)i[n]=arguments[n];t.apply(this,i)}}}function iy(){}function ny(t){return t.setHeader&&typeof t.abort=="function"}function Ku(t,e,r){if(typeof e=="function")return Ku(t,null,e);e||(e={}),r=ry(r||iy);var i=e.readable||e.readable!==!1&&t.readable,n=e.writable||e.writable!==!1&&t.writable,s=function(){t.writable||o()},a=t._writableState&&t._writableState.finished,o=function(){n=!1,a=!0,i||r.call(t)},l=t._readableState&&t._readableState.endEmitted,u=function(){i=!1,l=!0,n||r.call(t)},h=function(y){r.call(t,y)},p=function(){var y;if(i&&!l)return(!t._readableState||!t._readableState.ended)&&(y=new Vu),r.call(t,y);if(n&&!a)return(!t._writableState||!t._writableState.ended)&&(y=new Vu),r.call(t,y)},c=function(){t.req.on("finish",o)};return ny(t)?(t.on("complete",o),t.on("abort",p),t.req?c():t.on("request",c)):n&&!t._writableState&&(t.on("end",s),t.on("close",s)),t.on("end",u),t.on("finish",o),e.error!==!1&&t.on("error",h),t.on("close",p),function(){t.removeListener("complete",o),t.removeListener("abort",p),t.removeListener("request",c),t.req&&t.req.removeListener("finish",o),t.removeListener("end",s),t.removeListener("close",s),t.removeListener("finish",o),t.removeListener("end",u),t.removeListener("error",h),t.removeListener("close",p)}}Ju.exports=Ku});var Xu=w((o2,Qu)=>{"use strict";var Vi;function pt(t,e,r){return e=sy(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function sy(t){var e=ay(t,"string");return typeof e=="symbol"?e:String(e)}function ay(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var i=r.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var oy=Zu(),gt=Symbol("lastResolve"),It=Symbol("lastReject"),Cr=Symbol("error"),Ki=Symbol("ended"),$t=Symbol("lastPromise"),ca=Symbol("handlePromise"),Wt=Symbol("stream");function mt(t,e){return{value:t,done:e}}function ly(t){var e=t[gt];if(e!==null){var r=t[Wt].read();r!==null&&(t[$t]=null,t[gt]=null,t[It]=null,e(mt(r,!1)))}}function uy(t){process.nextTick(ly,t)}function fy(t,e){return function(r,i){t.then(function(){if(e[Ki]){r(mt(void 0,!0));return}e[ca](r,i)},i)}}var hy=Object.getPrototypeOf(function(){}),cy=Object.setPrototypeOf((Vi={get stream(){return this[Wt]},next:function(){var e=this,r=this[Cr];if(r!==null)return Promise.reject(r);if(this[Ki])return Promise.resolve(mt(void 0,!0));if(this[Wt].destroyed)return new Promise(function(a,o){process.nextTick(function(){e[Cr]?o(e[Cr]):a(mt(void 0,!0))})});var i=this[$t],n;if(i)n=new Promise(fy(i,this));else{var s=this[Wt].read();if(s!==null)return Promise.resolve(mt(s,!1));n=new Promise(this[ca])}return this[$t]=n,n}},pt(Vi,Symbol.asyncIterator,function(){return this}),pt(Vi,"return",function(){var e=this;return new Promise(function(r,i){e[Wt].destroy(null,function(n){if(n){i(n);return}r(mt(void 0,!0))})})}),Vi),hy),dy=function(e){var r,i=Object.create(cy,(r={},pt(r,Wt,{value:e,writable:!0}),pt(r,gt,{value:null,writable:!0}),pt(r,It,{value:null,writable:!0}),pt(r,Cr,{value:null,writable:!0}),pt(r,Ki,{value:e._readableState.endEmitted,writable:!0}),pt(r,ca,{value:function(s,a){var o=i[Wt].read();o?(i[$t]=null,i[gt]=null,i[It]=null,s(mt(o,!1))):(i[gt]=s,i[It]=a)},writable:!0}),r));return i[$t]=null,oy(e,function(n){if(n&&n.code!=="ERR_STREAM_PREMATURE_CLOSE"){var s=i[It];s!==null&&(i[$t]=null,i[gt]=null,i[It]=null,s(n)),i[Cr]=n;return}var a=i[gt];a!==null&&(i[$t]=null,i[gt]=null,i[It]=null,a(mt(void 0,!0))),i[Ki]=!0}),e.on("readable",uy.bind(null,i)),i};Qu.exports=dy});var nf=w((l2,rf)=>{"use strict";function ef(t,e,r,i,n,s,a){try{var o=t[s](a),l=o.value}catch(u){r(u);return}o.done?e(l):Promise.resolve(l).then(i,n)}function py(t){return function(){var e=this,r=arguments;return new Promise(function(i,n){var s=t.apply(e,r);function a(l){ef(s,i,n,a,o,"next",l)}function o(l){ef(s,i,n,a,o,"throw",l)}a(void 0)})}}function tf(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,i)}return r}function gy(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?tf(Object(r),!0).forEach(function(i){my(t,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):tf(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))})}return t}function my(t,e,r){return e=yy(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function yy(t){var e=by(t,"string");return typeof e=="symbol"?e:String(e)}function by(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var i=r.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var wy=nr().codes.ERR_INVALID_ARG_TYPE;function vy(t,e,r){var i;if(e&&typeof e.next=="function")i=e;else if(e&&e[Symbol.asyncIterator])i=e[Symbol.asyncIterator]();else if(e&&e[Symbol.iterator])i=e[Symbol.iterator]();else throw new wy("iterable",["Iterable"],e);var n=new t(gy({objectMode:!0},r)),s=!1;n._read=function(){s||(s=!0,a())};function a(){return o.apply(this,arguments)}function o(){return o=py(function*(){try{var l=yield i.next(),u=l.value,h=l.done;h?n.push(null):n.push(yield u)?a():s=!1}catch(p){n.destroy(p)}}),o.apply(this,arguments)}return n}rf.exports=vy});var gf=w((f2,pf)=>{"use strict";pf.exports=$;var sr;$.ReadableState=lf;var u2=require("events").EventEmitter,of=function(e,r){return e.listeners(r).length},jr=Xs(),Ji=require("buffer").Buffer,_y=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function Sy(t){return Ji.from(t)}function Ey(t){return Ji.isBuffer(t)||t instanceof _y}var da=require("util"),C;da&&da.debuglog?C=da.debuglog("stream"):C=function(){};var Ry=Uu(),va=ta(),xy=ra(),Ty=xy.getHighWaterMark,Zi=nr().codes,Oy=Zi.ERR_INVALID_ARG_TYPE,My=Zi.ERR_STREAM_PUSH_AFTER_EOF,ky=Zi.ERR_METHOD_NOT_IMPLEMENTED,Ay=Zi.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,ar,pa,ga;nt()($,jr);var Lr=va.errorOrDestroy,ma=["error","close","destroy","pause","resume"];function Py(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}function lf(t,e,r){sr=sr||Nr(),t=t||{},typeof r!="boolean"&&(r=e instanceof sr),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=Ty(this,t,"readableHighWaterMark",r),this.buffer=new Ry,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(ar||(ar=ha().StringDecoder),this.decoder=new ar(t.encoding),this.encoding=t.encoding)}function $(t){if(sr=sr||Nr(),!(this instanceof $))return new $(t);var e=this instanceof sr;this._readableState=new lf(t,this,e),this.readable=!0,t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy)),jr.call(this)}Object.defineProperty($.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}});$.prototype.destroy=va.destroy;$.prototype._undestroy=va.undestroy;$.prototype._destroy=function(t,e){e(t)};$.prototype.push=function(t,e){var r=this._readableState,i;return r.objectMode?i=!0:typeof t=="string"&&(e=e||r.defaultEncoding,e!==r.encoding&&(t=Ji.from(t,e),e=""),i=!0),uf(this,t,e,!1,i)};$.prototype.unshift=function(t){return uf(this,t,null,!0,!1)};function uf(t,e,r,i,n){C("readableAddChunk",e);var s=t._readableState;if(e===null)s.reading=!1,Cy(t,s);else{var a;if(n||(a=Dy(s,e)),a)Lr(t,a);else if(s.objectMode||e&&e.length>0)if(typeof e!="string"&&!s.objectMode&&Object.getPrototypeOf(e)!==Ji.prototype&&(e=Sy(e)),i)s.endEmitted?Lr(t,new Ay):ya(t,s,e,!0);else if(s.ended)Lr(t,new My);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!r?(e=s.decoder.write(e),s.objectMode||e.length!==0?ya(t,s,e,!1):wa(t,s)):ya(t,s,e,!1)}else i||(s.reading=!1,wa(t,s))}return!s.ended&&(s.length<s.highWaterMark||s.length===0)}function ya(t,e,r,i){e.flowing&&e.length===0&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,i?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&Qi(t)),wa(t,e)}function Dy(t,e){var r;return!Ey(e)&&typeof e!="string"&&e!==void 0&&!t.objectMode&&(r=new Oy("chunk",["string","Buffer","Uint8Array"],e)),r}$.prototype.isPaused=function(){return this._readableState.flowing===!1};$.prototype.setEncoding=function(t){ar||(ar=ha().StringDecoder);var e=new ar(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,i="";r!==null;)i+=e.write(r.data),r=r.next;return this._readableState.buffer.clear(),i!==""&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var sf=1073741824;function qy(t){return t>=sf?t=sf:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function af(t,e){return t<=0||e.length===0&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=qy(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}$.prototype.read=function(t){C("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(t!==0&&(e.emittedReadable=!1),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return C("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?ba(this):Qi(this),null;if(t=af(t,e),t===0&&e.ended)return e.length===0&&ba(this),null;var i=e.needReadable;C("need readable",i),(e.length===0||e.length-t<e.highWaterMark)&&(i=!0,C("length less than watermark",i)),e.ended||e.reading?(i=!1,C("reading or ended",i)):i&&(C("do read"),e.reading=!0,e.sync=!0,e.length===0&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=af(r,e)));var n;return t>0?n=cf(t,e):n=null,n===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&ba(this)),n!==null&&this.emit("data",n),n};function Cy(t,e){if(C("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?Qi(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,ff(t)))}}function Qi(t){var e=t._readableState;C("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(C("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(ff,t))}function ff(t){var e=t._readableState;C("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,_a(t)}function wa(t,e){e.readingMore||(e.readingMore=!0,process.nextTick(Ly,t,e))}function Ly(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){var r=e.length;if(C("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}$.prototype._read=function(t){Lr(this,new ky("_read()"))};$.prototype.pipe=function(t,e){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t);break}i.pipesCount+=1,C("pipe count=%d opts=%j",i.pipesCount,e);var n=(!e||e.end!==!1)&&t!==process.stdout&&t!==process.stderr,s=n?o:b;i.endEmitted?process.nextTick(s):r.once("end",s),t.on("unpipe",a);function a(S,_){C("onunpipe"),S===r&&_&&_.hasUnpiped===!1&&(_.hasUnpiped=!0,h())}function o(){C("onend"),t.end()}var l=jy(r);t.on("drain",l);var u=!1;function h(){C("cleanup"),t.removeListener("close",f),t.removeListener("finish",y),t.removeListener("drain",l),t.removeListener("error",c),t.removeListener("unpipe",a),r.removeListener("end",o),r.removeListener("end",b),r.removeListener("data",p),u=!0,i.awaitDrain&&(!t._writableState||t._writableState.needDrain)&&l()}r.on("data",p);function p(S){C("ondata");var _=t.write(S);C("dest.write",_),_===!1&&((i.pipesCount===1&&i.pipes===t||i.pipesCount>1&&df(i.pipes,t)!==-1)&&!u&&(C("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function c(S){C("onerror",S),b(),t.removeListener("error",c),of(t,"error")===0&&Lr(t,S)}Py(t,"error",c);function f(){t.removeListener("finish",y),b()}t.once("close",f);function y(){C("onfinish"),t.removeListener("close",f),b()}t.once("finish",y);function b(){C("unpipe"),r.unpipe(t)}return t.emit("pipe",r),i.flowing||(C("pipe resume"),r.resume()),t};function jy(t){return function(){var r=t._readableState;C("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&of(t,"data")&&(r.flowing=!0,_a(t))}}$.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(e.pipesCount===0)return this;if(e.pipesCount===1)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var i=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var s=0;s<n;s++)i[s].emit("unpipe",this,{hasUnpiped:!1});return this}var a=df(e.pipes,t);return a===-1?this:(e.pipes.splice(a,1),e.pipesCount-=1,e.pipesCount===1&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r),this)};$.prototype.on=function(t,e){var r=jr.prototype.on.call(this,t,e),i=this._readableState;return t==="data"?(i.readableListening=this.listenerCount("readable")>0,i.flowing!==!1&&this.resume()):t==="readable"&&!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,C("on readable",i.length,i.reading),i.length?Qi(this):i.reading||process.nextTick(Ny,this)),r};$.prototype.addListener=$.prototype.on;$.prototype.removeListener=function(t,e){var r=jr.prototype.removeListener.call(this,t,e);return t==="readable"&&process.nextTick(hf,this),r};$.prototype.removeAllListeners=function(t){var e=jr.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&process.nextTick(hf,this),e};function hf(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function Ny(t){C("readable nexttick read 0"),t.read(0)}$.prototype.resume=function(){var t=this._readableState;return t.flowing||(C("resume"),t.flowing=!t.readableListening,Fy(this,t)),t.paused=!1,this};function Fy(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(Iy,t,e))}function Iy(t,e){C("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),_a(t),e.flowing&&!e.reading&&t.read(0)}$.prototype.pause=function(){return C("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(C("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function _a(t){var e=t._readableState;for(C("flow",e.flowing);e.flowing&&t.read()!==null;);}$.prototype.wrap=function(t){var e=this,r=this._readableState,i=!1;t.on("end",function(){if(C("wrapped end"),r.decoder&&!r.ended){var a=r.decoder.end();a&&a.length&&e.push(a)}e.push(null)}),t.on("data",function(a){if(C("wrapped data"),r.decoder&&(a=r.decoder.write(a)),!(r.objectMode&&a==null)&&!(!r.objectMode&&(!a||!a.length))){var o=e.push(a);o||(i=!0,t.pause())}});for(var n in t)this[n]===void 0&&typeof t[n]=="function"&&(this[n]=function(o){return function(){return t[o].apply(t,arguments)}}(n));for(var s=0;s<ma.length;s++)t.on(ma[s],this.emit.bind(this,ma[s]));return this._read=function(a){C("wrapped _read",a),i&&(i=!1,t.resume())},this};typeof Symbol=="function"&&($.prototype[Symbol.asyncIterator]=function(){return pa===void 0&&(pa=Xu()),pa(this)});Object.defineProperty($.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty($.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty($.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}});$._fromList=cf;Object.defineProperty($.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function cf(t,e){if(e.length===0)return null;var r;return e.objectMode?r=e.buffer.shift():!t||t>=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.first():r=e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r}function ba(t){var e=t._readableState;C("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick($y,e,t))}function $y(t,e){if(C("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&t.length===0&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}typeof Symbol=="function"&&($.from=function(t,e){return ga===void 0&&(ga=nf()),ga($,t,e)});function df(t,e){for(var r=0,i=t.length;r<i;r++)if(t[r]===e)return r;return-1}});var Nr=w((h2,yf)=>{"use strict";var Wy=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};yf.exports=Ye;var mf=gf(),Ea=Ra();nt()(Ye,mf);for(Sa=Wy(Ea.prototype),Xi=0;Xi<Sa.length;Xi++)en=Sa[Xi],Ye.prototype[en]||(Ye.prototype[en]=Ea.prototype[en]);var Sa,en,Xi;function Ye(t){if(!(this instanceof Ye))return new Ye(t);mf.call(this,t),Ea.call(this,t),this.allowHalfOpen=!0,t&&(t.readable===!1&&(this.readable=!1),t.writable===!1&&(this.writable=!1),t.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",By)))}Object.defineProperty(Ye.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(Ye.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(Ye.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function By(){this._writableState.ended||process.nextTick(Uy,this)}function Uy(t){t.end()}Object.defineProperty(Ye.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)}})});var Ra=w((c2,Ef)=>{"use strict";Ef.exports=Y;function wf(t){var e=this;this.next=null,this.entry=null,this.finish=function(){m0(e,t)}}var or;Y.WritableState=Ir;var zy={deprecate:Qs()},vf=Xs(),rn=require("buffer").Buffer,Hy=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function Gy(t){return rn.from(t)}function Yy(t){return rn.isBuffer(t)||t instanceof Hy}var Ta=ta(),Vy=ra(),Ky=Vy.getHighWaterMark,yt=nr().codes,Jy=yt.ERR_INVALID_ARG_TYPE,Zy=yt.ERR_METHOD_NOT_IMPLEMENTED,Qy=yt.ERR_MULTIPLE_CALLBACK,Xy=yt.ERR_STREAM_CANNOT_PIPE,e0=yt.ERR_STREAM_DESTROYED,t0=yt.ERR_STREAM_NULL_VALUES,r0=yt.ERR_STREAM_WRITE_AFTER_END,i0=yt.ERR_UNKNOWN_ENCODING,lr=Ta.errorOrDestroy;nt()(Y,vf);function n0(){}function Ir(t,e,r){or=or||Nr(),t=t||{},typeof r!="boolean"&&(r=e instanceof or),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=Ky(this,t,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var i=t.decodeStrings===!1;this.decodeStrings=!i,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(n){h0(e,n)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new wf(this)}Ir.prototype.getBuffer=function(){for(var e=this.bufferedRequest,r=[];e;)r.push(e),e=e.next;return r};(function(){try{Object.defineProperty(Ir.prototype,"buffer",{get:zy.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var tn;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(tn=Function.prototype[Symbol.hasInstance],Object.defineProperty(Y,Symbol.hasInstance,{value:function(e){return tn.call(this,e)?!0:this!==Y?!1:e&&e._writableState instanceof Ir}})):tn=function(e){return e instanceof this};function Y(t){or=or||Nr();var e=this instanceof or;if(!e&&!tn.call(Y,this))return new Y(t);this._writableState=new Ir(t,this,e),this.writable=!0,t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final)),vf.call(this)}Y.prototype.pipe=function(){lr(this,new Xy)};function s0(t,e){var r=new r0;lr(t,r),process.nextTick(e,r)}function a0(t,e,r,i){var n;return r===null?n=new t0:typeof r!="string"&&!e.objectMode&&(n=new Jy("chunk",["string","Buffer"],r)),n?(lr(t,n),process.nextTick(i,n),!1):!0}Y.prototype.write=function(t,e,r){var i=this._writableState,n=!1,s=!i.objectMode&&Yy(t);return s&&!rn.isBuffer(t)&&(t=Gy(t)),typeof e=="function"&&(r=e,e=null),s?e="buffer":e||(e=i.defaultEncoding),typeof r!="function"&&(r=n0),i.ending?s0(this,r):(s||a0(this,i,t,r))&&(i.pendingcb++,n=l0(this,i,s,t,e,r)),n};Y.prototype.cork=function(){this._writableState.corked++};Y.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,!t.writing&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&_f(this,t))};Y.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new i0(e);return this._writableState.defaultEncoding=e,this};Object.defineProperty(Y.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function o0(t,e,r){return!t.objectMode&&t.decodeStrings!==!1&&typeof e=="string"&&(e=rn.from(e,r)),e}Object.defineProperty(Y.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function l0(t,e,r,i,n,s){if(!r){var a=o0(e,i,n);i!==a&&(r=!0,n="buffer",i=a)}var o=e.objectMode?1:i.length;e.length+=o;var l=e.length<e.highWaterMark;if(l||(e.needDrain=!0),e.writing||e.corked){var u=e.lastBufferedRequest;e.lastBufferedRequest={chunk:i,encoding:n,isBuf:r,callback:s,next:null},u?u.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else xa(t,e,!1,o,i,n,s);return l}function xa(t,e,r,i,n,s,a){e.writelen=i,e.writecb=a,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new e0("write")):r?t._writev(n,e.onwrite):t._write(n,s,e.onwrite),e.sync=!1}function u0(t,e,r,i,n){--e.pendingcb,r?(process.nextTick(n,i),process.nextTick(Fr,t,e),t._writableState.errorEmitted=!0,lr(t,i)):(n(i),t._writableState.errorEmitted=!0,lr(t,i),Fr(t,e))}function f0(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}function h0(t,e){var r=t._writableState,i=r.sync,n=r.writecb;if(typeof n!="function")throw new Qy;if(f0(r),e)u0(t,r,i,e,n);else{var s=Sf(r)||t.destroyed;!s&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&_f(t,r),i?process.nextTick(bf,t,r,s,n):bf(t,r,s,n)}}function bf(t,e,r,i){r||c0(t,e),e.pendingcb--,i(),Fr(t,e)}function c0(t,e){e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}function _f(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var i=e.bufferedRequestCount,n=new Array(i),s=e.corkedRequestsFree;s.entry=r;for(var a=0,o=!0;r;)n[a]=r,r.isBuf||(o=!1),r=r.next,a+=1;n.allBuffers=o,xa(t,e,!0,e.length,n,"",s.finish),e.pendingcb++,e.lastBufferedRequest=null,s.next?(e.corkedRequestsFree=s.next,s.next=null):e.corkedRequestsFree=new wf(e),e.bufferedRequestCount=0}else{for(;r;){var l=r.chunk,u=r.encoding,h=r.callback,p=e.objectMode?1:l.length;if(xa(t,e,!1,p,l,u,h),r=r.next,e.bufferedRequestCount--,e.writing)break}r===null&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}Y.prototype._write=function(t,e,r){r(new Zy("_write()"))};Y.prototype._writev=null;Y.prototype.end=function(t,e,r){var i=this._writableState;return typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null),t!=null&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||g0(this,i,r),this};Object.defineProperty(Y.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function Sf(t){return t.ending&&t.length===0&&t.bufferedRequest===null&&!t.finished&&!t.writing}function d0(t,e){t._final(function(r){e.pendingcb--,r&&lr(t,r),e.prefinished=!0,t.emit("prefinish"),Fr(t,e)})}function p0(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.pendingcb++,e.finalCalled=!0,process.nextTick(d0,t,e)):(e.prefinished=!0,t.emit("prefinish")))}function Fr(t,e){var r=Sf(e);if(r&&(p0(t,e),e.pendingcb===0&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var i=t._readableState;(!i||i.autoDestroy&&i.endEmitted)&&t.destroy()}return r}function g0(t,e,r){e.ending=!0,Fr(t,e),r&&(e.finished?process.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}function m0(t,e,r){var i=t.entry;for(t.entry=null;i;){var n=i.callback;e.pendingcb--,n(r),i=i.next}e.corkedRequestsFree.next=t}Object.defineProperty(Y.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}});Y.prototype.destroy=Ta.destroy;Y.prototype._undestroy=Ta.undestroy;Y.prototype._destroy=function(t,e){e(t)}});var Oa=w((d2,Tf)=>{"use strict";var y0=require("util"),Rf=Ra(),{LEVEL:xf}=re(),$r=Tf.exports=function(e={}){Rf.call(this,{objectMode:!0,highWaterMark:e.highWaterMark}),this.format=e.format,this.level=e.level,this.handleExceptions=e.handleExceptions,this.handleRejections=e.handleRejections,this.silent=e.silent,e.log&&(this.log=e.log),e.logv&&(this.logv=e.logv),e.close&&(this.close=e.close),this.once("pipe",r=>{this.levels=r.levels,this.parent=r}),this.once("unpipe",r=>{r===this.parent&&(this.parent=null,this.close&&this.close())})};y0.inherits($r,Rf);$r.prototype._write=function(e,r,i){if(this.silent||e.exception===!0&&!this.handleExceptions)return i(null);let n=this.level||this.parent&&this.parent.level;if(!n||this.levels[n]>=this.levels[e[xf]]){if(e&&!this.format)return this.log(e,i);let s,a;try{a=this.format.transform(Object.assign({},e),this.format.options)}catch(o){s=o}if(s||!a){if(i(),s)throw s;return}return this.log(a,i)}return this._writableState.sync=!1,i(null)};$r.prototype._writev=function(e,r){if(this.logv){let i=e.filter(this._accept,this);return i.length?this.logv(i,r):r(null)}for(let i=0;i<e.length;i++){if(!this._accept(e[i]))continue;if(e[i].chunk&&!this.format){this.log(e[i].chunk,e[i].callback);continue}let n,s;try{s=this.format.transform(Object.assign({},e[i].chunk),this.format.options)}catch(a){n=a}if(n||!s){if(e[i].callback(),n)throw r(null),n}else this.log(s,e[i].callback)}return r(null)};$r.prototype._accept=function(e){let r=e.chunk;if(this.silent)return!1;let i=this.level||this.parent&&this.parent.level;return!!((r.exception===!0||!i||this.levels[i]>=this.levels[r[xf]])&&(this.handleExceptions||r.exception!==!0))};$r.prototype._nop=function(){}});var ka=w((p2,Mf)=>{"use strict";var b0=require("util"),{LEVEL:Ma}=re(),Of=Oa(),Wr=Mf.exports=function(e={}){if(Of.call(this,e),!e.transport||typeof e.transport.log!="function")throw new Error("Invalid transport, must be an object with a log method.");this.transport=e.transport,this.level=this.level||e.transport.level,this.handleExceptions=this.handleExceptions||e.transport.handleExceptions,this._deprecated();function r(i){this.emit("error",i,this.transport)}this.transport.__winstonError||(this.transport.__winstonError=r.bind(this),this.transport.on("error",this.transport.__winstonError))};b0.inherits(Wr,Of);Wr.prototype._write=function(e,r,i){if(this.silent||e.exception===!0&&!this.handleExceptions)return i(null);(!this.level||this.levels[this.level]>=this.levels[e[Ma]])&&this.transport.log(e[Ma],e.message,e,this._nop),i(null)};Wr.prototype._writev=function(e,r){for(let i=0;i<e.length;i++)this._accept(e[i])&&(this.transport.log(e[i].chunk[Ma],e[i].chunk.message,e[i].chunk,this._nop),e[i].callback());return r(null)};Wr.prototype._deprecated=function(){console.error([`${this.transport.name} is a legacy winston transport. Consider upgrading: `,"- Upgrade docs: https://github.com/winstonjs/winston/blob/master/UPGRADE-3.0.md"].join(`
|
|
27
|
+
`))};Wr.prototype.close=function(){this.transport.close&&this.transport.close(),this.transport.__winstonError&&(this.transport.removeListener("error",this.transport.__winstonError),this.transport.__winstonError=null)}});var ur=w((g2,Aa)=>{"use strict";Aa.exports=Oa();Aa.exports.LegacyTransportStream=ka()});var Pf=w((y2,Af)=>{"use strict";var w0=require("os"),{LEVEL:kf,MESSAGE:fr}=re(),v0=ur();Af.exports=class extends v0{constructor(e={}){super(e),this.name=e.name||"console",this.stderrLevels=this._stringArrayToSet(e.stderrLevels),this.consoleWarnLevels=this._stringArrayToSet(e.consoleWarnLevels),this.eol=typeof e.eol=="string"?e.eol:w0.EOL,this.setMaxListeners(30)}log(e,r){if(setImmediate(()=>this.emit("logged",e)),this.stderrLevels[e[kf]]){console._stderr?console._stderr.write(`${e[fr]}${this.eol}`):console.error(e[fr]),r&&r();return}else if(this.consoleWarnLevels[e[kf]]){console._stderr?console._stderr.write(`${e[fr]}${this.eol}`):console.warn(e[fr]),r&&r();return}console._stdout?console._stdout.write(`${e[fr]}${this.eol}`):console.log(e[fr]),r&&r()}_stringArrayToSet(e,r){if(!e)return{};if(r=r||"Cannot make set from type other than Array of string elements",!Array.isArray(e))throw new Error(r);return e.reduce((i,n)=>{if(typeof n!="string")throw new Error(r);return i[n]=!0,i},{})}}});var sn=w((nn,Df)=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.default=_0;function _0(t){return t&&typeof t.length=="number"&&t.length>=0&&t.length%1===0}Df.exports=nn.default});var Cf=w((an,qf)=>{"use strict";Object.defineProperty(an,"__esModule",{value:!0});an.default=function(t){return function(...e){var r=e.pop();return t.call(this,e,r)}};qf.exports=an.default});var Nf=w(bt=>{"use strict";Object.defineProperty(bt,"__esModule",{value:!0});bt.fallback=Lf;bt.wrap=jf;var S0=bt.hasQueueMicrotask=typeof queueMicrotask=="function"&&queueMicrotask,E0=bt.hasSetImmediate=typeof setImmediate=="function"&&setImmediate,R0=bt.hasNextTick=typeof process=="object"&&typeof process.nextTick=="function";function Lf(t){setTimeout(t,0)}function jf(t){return(e,...r)=>t(()=>e(...r))}var Br;S0?Br=queueMicrotask:E0?Br=setImmediate:R0?Br=process.nextTick:Br=Lf;bt.default=jf(Br)});var Bf=w((on,Wf)=>{"use strict";Object.defineProperty(on,"__esModule",{value:!0});on.default=A0;var x0=Cf(),T0=$f(x0),O0=Nf(),M0=$f(O0),k0=Bt();function $f(t){return t&&t.__esModule?t:{default:t}}function A0(t){return(0,k0.isAsync)(t)?function(...e){let r=e.pop(),i=t.apply(this,e);return Ff(i,r)}:(0,T0.default)(function(e,r){var i;try{i=t.apply(this,e)}catch(n){return r(n)}if(i&&typeof i.then=="function")return Ff(i,r);r(null,i)})}function Ff(t,e){return t.then(r=>{If(e,null,r)},r=>{If(e,r&&(r instanceof Error||r.message)?r:new Error(r))})}function If(t,e,r){try{t(e,r)}catch(i){(0,M0.default)(n=>{throw n},i)}}Wf.exports=on.default});var Bt=w(st=>{"use strict";Object.defineProperty(st,"__esModule",{value:!0});st.isAsyncIterable=st.isAsyncGenerator=st.isAsync=void 0;var P0=Bf(),D0=q0(P0);function q0(t){return t&&t.__esModule?t:{default:t}}function Uf(t){return t[Symbol.toStringTag]==="AsyncFunction"}function C0(t){return t[Symbol.toStringTag]==="AsyncGenerator"}function L0(t){return typeof t[Symbol.asyncIterator]=="function"}function j0(t){if(typeof t!="function")throw new Error("expected a function");return Uf(t)?(0,D0.default)(t):t}st.default=j0;st.isAsync=Uf;st.isAsyncGenerator=C0;st.isAsyncIterable=L0});var hr=w((ln,zf)=>{"use strict";Object.defineProperty(ln,"__esModule",{value:!0});ln.default=N0;function N0(t,e){if(e||(e=t.length),!e)throw new Error("arity is undefined");function r(...i){return typeof i[e-1]=="function"?t.apply(this,i):new Promise((n,s)=>{i[e-1]=(a,...o)=>{if(a)return s(a);n(o.length>1?o:o[0])},t.apply(this,i)})}return r}zf.exports=ln.default});var Gf=w((un,Hf)=>{"use strict";Object.defineProperty(un,"__esModule",{value:!0});var F0=sn(),I0=Pa(F0),$0=Bt(),W0=Pa($0),B0=hr(),U0=Pa(B0);function Pa(t){return t&&t.__esModule?t:{default:t}}un.default=(0,U0.default)((t,e,r)=>{var i=(0,I0.default)(e)?[]:{};t(e,(n,s,a)=>{(0,W0.default)(n)((o,...l)=>{l.length<2&&([l]=l),i[s]=l,a(o)})},n=>r(n,i))},3);Hf.exports=un.default});var Da=w((fn,Yf)=>{"use strict";Object.defineProperty(fn,"__esModule",{value:!0});fn.default=z0;function z0(t){function e(...r){if(t!==null){var i=t;t=null,i.apply(this,r)}}return Object.assign(e,t),e}Yf.exports=fn.default});var Kf=w((hn,Vf)=>{"use strict";Object.defineProperty(hn,"__esModule",{value:!0});hn.default=function(t){return t[Symbol.iterator]&&t[Symbol.iterator]()};Vf.exports=hn.default});var Qf=w((cn,Zf)=>{"use strict";Object.defineProperty(cn,"__esModule",{value:!0});cn.default=Q0;var H0=sn(),G0=Jf(H0),Y0=Kf(),V0=Jf(Y0);function Jf(t){return t&&t.__esModule?t:{default:t}}function K0(t){var e=-1,r=t.length;return function(){return++e<r?{value:t[e],key:e}:null}}function J0(t){var e=-1;return function(){var i=t.next();return i.done?null:(e++,{value:i.value,key:e})}}function Z0(t){var e=t?Object.keys(t):[],r=-1,i=e.length;return function n(){var s=e[++r];return s==="__proto__"?n():r<i?{value:t[s],key:s}:null}}function Q0(t){if((0,G0.default)(t))return K0(t);var e=(0,V0.default)(t);return e?J0(e):Z0(t)}Zf.exports=cn.default});var qa=w((dn,Xf)=>{"use strict";Object.defineProperty(dn,"__esModule",{value:!0});dn.default=X0;function X0(t){return function(...e){if(t===null)throw new Error("Callback was already called.");var r=t;t=null,r.apply(this,e)}}Xf.exports=dn.default});var gn=w((pn,eh)=>{"use strict";Object.defineProperty(pn,"__esModule",{value:!0});var eb={};pn.default=eb;eh.exports=pn.default});var rh=w((mn,th)=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});mn.default=nb;var tb=gn(),rb=ib(tb);function ib(t){return t&&t.__esModule?t:{default:t}}function nb(t,e,r,i){let n=!1,s=!1,a=!1,o=0,l=0;function u(){o>=e||a||n||(a=!0,t.next().then(({value:c,done:f})=>{if(!(s||n)){if(a=!1,f){n=!0,o<=0&&i(null);return}o++,r(c,l,h),l++,u()}}).catch(p))}function h(c,f){if(o-=1,!s){if(c)return p(c);if(c===!1){n=!0,s=!0;return}if(f===rb.default||n&&o<=0)return n=!0,i(null);u()}}function p(c){s||(a=!1,n=!0,i(c))}u()}th.exports=mn.default});var ah=w((yn,sh)=>{"use strict";Object.defineProperty(yn,"__esModule",{value:!0});var sb=Da(),ab=Ur(sb),ob=Qf(),lb=Ur(ob),ub=qa(),fb=Ur(ub),ih=Bt(),hb=rh(),nh=Ur(hb),cb=gn(),db=Ur(cb);function Ur(t){return t&&t.__esModule?t:{default:t}}yn.default=t=>(e,r,i)=>{if(i=(0,ab.default)(i),t<=0)throw new RangeError("concurrency limit cannot be less than 1");if(!e)return i(null);if((0,ih.isAsyncGenerator)(e))return(0,nh.default)(e,t,r,i);if((0,ih.isAsyncIterable)(e))return(0,nh.default)(e[Symbol.asyncIterator](),t,r,i);var n=(0,lb.default)(e),s=!1,a=!1,o=0,l=!1;function u(p,c){if(!a)if(o-=1,p)s=!0,i(p);else if(p===!1)s=!0,a=!0;else{if(c===db.default||s&&o<=0)return s=!0,i(null);l||h()}}function h(){for(l=!0;o<t&&!s;){var p=n();if(p===null){s=!0,o<=0&&i(null);return}o+=1,r(p.value,p.key,(0,fb.default)(u))}l=!1}h()};sh.exports=yn.default});var La=w((bn,oh)=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});var pb=ah(),gb=Ca(pb),mb=Bt(),yb=Ca(mb),bb=hr(),wb=Ca(bb);function Ca(t){return t&&t.__esModule?t:{default:t}}function vb(t,e,r,i){return(0,gb.default)(e)(t,(0,yb.default)(r),i)}bn.default=(0,wb.default)(vb,4);oh.exports=bn.default});var fh=w((wn,uh)=>{"use strict";Object.defineProperty(wn,"__esModule",{value:!0});var _b=La(),Sb=lh(_b),Eb=hr(),Rb=lh(Eb);function lh(t){return t&&t.__esModule?t:{default:t}}function xb(t,e,r){return(0,Sb.default)(t,1,e,r)}wn.default=(0,Rb.default)(xb,3);uh.exports=wn.default});var dh=w((vn,ch)=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.default=Ab;var Tb=Gf(),Ob=hh(Tb),Mb=fh(),kb=hh(Mb);function hh(t){return t&&t.__esModule?t:{default:t}}function Ab(t,e){return(0,Ob.default)(kb.default,t,e)}ch.exports=vn.default});var ja=w((v2,ph)=>{ph.exports=require("stream")});var vh=w((_2,wh)=>{"use strict";function gh(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,i)}return r}function mh(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?gh(Object(r),!0).forEach(function(i){Pb(t,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):gh(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))})}return t}function Pb(t,e,r){return e=bh(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Db(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function yh(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,bh(i.key),i)}}function qb(t,e,r){return e&&yh(t.prototype,e),r&&yh(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function bh(t){var e=Cb(t,"string");return typeof e=="symbol"?e:String(e)}function Cb(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var i=r.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Lb=require("buffer"),_n=Lb.Buffer,jb=require("util"),Na=jb.inspect,Nb=Na&&Na.custom||"inspect";function Fb(t,e,r){_n.prototype.copy.call(t,e,r)}wh.exports=function(){function t(){Db(this,t),this.head=null,this.tail=null,this.length=0}return qb(t,[{key:"push",value:function(r){var i={data:r,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length}},{key:"unshift",value:function(r){var i={data:r,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length}},{key:"shift",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(r){if(this.length===0)return"";for(var i=this.head,n=""+i.data;i=i.next;)n+=r+i.data;return n}},{key:"concat",value:function(r){if(this.length===0)return _n.alloc(0);for(var i=_n.allocUnsafe(r>>>0),n=this.head,s=0;n;)Fb(n.data,i,s),s+=n.data.length,n=n.next;return i}},{key:"consume",value:function(r,i){var n;return r<this.head.data.length?(n=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?n=this.shift():n=i?this._getString(r):this._getBuffer(r),n}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(r){var i=this.head,n=1,s=i.data;for(r-=s.length;i=i.next;){var a=i.data,o=r>a.length?a.length:r;if(o===a.length?s+=a:s+=a.slice(0,r),r-=o,r===0){o===a.length?(++n,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=a.slice(o));break}++n}return this.length-=n,s}},{key:"_getBuffer",value:function(r){var i=_n.allocUnsafe(r),n=this.head,s=1;for(n.data.copy(i),r-=n.data.length;n=n.next;){var a=n.data,o=r>a.length?a.length:r;if(a.copy(i,i.length-r,0,o),r-=o,r===0){o===a.length?(++s,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=a.slice(o));break}++s}return this.length-=s,i}},{key:Nb,value:function(r,i){return Na(this,mh(mh({},i),{},{depth:0,customInspect:!1}))}}]),t}()});var Ia=w((S2,Sh)=>{"use strict";function Ib(t,e){var r=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(Fa,this,t)):process.nextTick(Fa,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(s){!e&&s?r._writableState?r._writableState.errorEmitted?process.nextTick(Sn,r):(r._writableState.errorEmitted=!0,process.nextTick(_h,r,s)):process.nextTick(_h,r,s):e?(process.nextTick(Sn,r),e(s)):process.nextTick(Sn,r)}),this)}function _h(t,e){Fa(t,e),Sn(t)}function Sn(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function $b(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function Fa(t,e){t.emit("error",e)}function Wb(t,e){var r=t._readableState,i=t._writableState;r&&r.autoDestroy||i&&i.autoDestroy?t.destroy(e):t.emit("error",e)}Sh.exports={destroy:Ib,undestroy:$b,errorOrDestroy:Wb}});var wt=w((E2,xh)=>{"use strict";var Rh={};function qe(t,e,r){r||(r=Error);function i(s,a,o){return typeof e=="string"?e:e(s,a,o)}class n extends r{constructor(a,o,l){super(i(a,o,l))}}n.prototype.name=r.name,n.prototype.code=t,Rh[t]=n}function Eh(t,e){if(Array.isArray(t)){let r=t.length;return t=t.map(i=>String(i)),r>2?`one of ${e} ${t.slice(0,r-1).join(", ")}, or `+t[r-1]:r===2?`one of ${e} ${t[0]} or ${t[1]}`:`of ${e} ${t[0]}`}else return`of ${e} ${String(t)}`}function Bb(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}function Ub(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}function zb(t,e,r){return typeof r!="number"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}qe("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);qe("ERR_INVALID_ARG_TYPE",function(t,e,r){let i;typeof e=="string"&&Bb(e,"not ")?(i="must not be",e=e.replace(/^not /,"")):i="must be";let n;if(Ub(t," argument"))n=`The ${t} ${i} ${Eh(e,"type")}`;else{let s=zb(t,".")?"property":"argument";n=`The "${t}" ${s} ${i} ${Eh(e,"type")}`}return n+=`. Received type ${typeof r}`,n},TypeError);qe("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");qe("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});qe("ERR_STREAM_PREMATURE_CLOSE","Premature close");qe("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});qe("ERR_MULTIPLE_CALLBACK","Callback called multiple times");qe("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");qe("ERR_STREAM_WRITE_AFTER_END","write after end");qe("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);qe("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);qe("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");xh.exports.codes=Rh});var $a=w((R2,Th)=>{"use strict";var Hb=wt().codes.ERR_INVALID_OPT_VALUE;function Gb(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function Yb(t,e,r,i){var n=Gb(e,i,r);if(n!=null){if(!(isFinite(n)&&Math.floor(n)===n)||n<0){var s=i?r:"highWaterMark";throw new Hb(s,n)}return Math.floor(n)}return t.objectMode?16:16*1024}Th.exports={getHighWaterMark:Yb}});var Ua=w((x2,Dh)=>{"use strict";Dh.exports=V;function Mh(t){var e=this;this.next=null,this.entry=null,this.finish=function(){vw(e,t)}}var cr;V.WritableState=Hr;var Vb={deprecate:Qs()},kh=ja(),Rn=require("buffer").Buffer,Kb=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function Jb(t){return Rn.from(t)}function Zb(t){return Rn.isBuffer(t)||t instanceof Kb}var Ba=Ia(),Qb=$a(),Xb=Qb.getHighWaterMark,vt=wt().codes,ew=vt.ERR_INVALID_ARG_TYPE,tw=vt.ERR_METHOD_NOT_IMPLEMENTED,rw=vt.ERR_MULTIPLE_CALLBACK,iw=vt.ERR_STREAM_CANNOT_PIPE,nw=vt.ERR_STREAM_DESTROYED,sw=vt.ERR_STREAM_NULL_VALUES,aw=vt.ERR_STREAM_WRITE_AFTER_END,ow=vt.ERR_UNKNOWN_ENCODING,dr=Ba.errorOrDestroy;nt()(V,kh);function lw(){}function Hr(t,e,r){cr=cr||Ut(),t=t||{},typeof r!="boolean"&&(r=e instanceof cr),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=Xb(this,t,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var i=t.decodeStrings===!1;this.decodeStrings=!i,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(n){gw(e,n)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new Mh(this)}Hr.prototype.getBuffer=function(){for(var e=this.bufferedRequest,r=[];e;)r.push(e),e=e.next;return r};(function(){try{Object.defineProperty(Hr.prototype,"buffer",{get:Vb.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var En;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(En=Function.prototype[Symbol.hasInstance],Object.defineProperty(V,Symbol.hasInstance,{value:function(e){return En.call(this,e)?!0:this!==V?!1:e&&e._writableState instanceof Hr}})):En=function(e){return e instanceof this};function V(t){cr=cr||Ut();var e=this instanceof cr;if(!e&&!En.call(V,this))return new V(t);this._writableState=new Hr(t,this,e),this.writable=!0,t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final)),kh.call(this)}V.prototype.pipe=function(){dr(this,new iw)};function uw(t,e){var r=new aw;dr(t,r),process.nextTick(e,r)}function fw(t,e,r,i){var n;return r===null?n=new sw:typeof r!="string"&&!e.objectMode&&(n=new ew("chunk",["string","Buffer"],r)),n?(dr(t,n),process.nextTick(i,n),!1):!0}V.prototype.write=function(t,e,r){var i=this._writableState,n=!1,s=!i.objectMode&&Zb(t);return s&&!Rn.isBuffer(t)&&(t=Jb(t)),typeof e=="function"&&(r=e,e=null),s?e="buffer":e||(e=i.defaultEncoding),typeof r!="function"&&(r=lw),i.ending?uw(this,r):(s||fw(this,i,t,r))&&(i.pendingcb++,n=cw(this,i,s,t,e,r)),n};V.prototype.cork=function(){this._writableState.corked++};V.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,!t.writing&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&Ah(this,t))};V.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new ow(e);return this._writableState.defaultEncoding=e,this};Object.defineProperty(V.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function hw(t,e,r){return!t.objectMode&&t.decodeStrings!==!1&&typeof e=="string"&&(e=Rn.from(e,r)),e}Object.defineProperty(V.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function cw(t,e,r,i,n,s){if(!r){var a=hw(e,i,n);i!==a&&(r=!0,n="buffer",i=a)}var o=e.objectMode?1:i.length;e.length+=o;var l=e.length<e.highWaterMark;if(l||(e.needDrain=!0),e.writing||e.corked){var u=e.lastBufferedRequest;e.lastBufferedRequest={chunk:i,encoding:n,isBuf:r,callback:s,next:null},u?u.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else Wa(t,e,!1,o,i,n,s);return l}function Wa(t,e,r,i,n,s,a){e.writelen=i,e.writecb=a,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new nw("write")):r?t._writev(n,e.onwrite):t._write(n,s,e.onwrite),e.sync=!1}function dw(t,e,r,i,n){--e.pendingcb,r?(process.nextTick(n,i),process.nextTick(zr,t,e),t._writableState.errorEmitted=!0,dr(t,i)):(n(i),t._writableState.errorEmitted=!0,dr(t,i),zr(t,e))}function pw(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}function gw(t,e){var r=t._writableState,i=r.sync,n=r.writecb;if(typeof n!="function")throw new rw;if(pw(r),e)dw(t,r,i,e,n);else{var s=Ph(r)||t.destroyed;!s&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&Ah(t,r),i?process.nextTick(Oh,t,r,s,n):Oh(t,r,s,n)}}function Oh(t,e,r,i){r||mw(t,e),e.pendingcb--,i(),zr(t,e)}function mw(t,e){e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}function Ah(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var i=e.bufferedRequestCount,n=new Array(i),s=e.corkedRequestsFree;s.entry=r;for(var a=0,o=!0;r;)n[a]=r,r.isBuf||(o=!1),r=r.next,a+=1;n.allBuffers=o,Wa(t,e,!0,e.length,n,"",s.finish),e.pendingcb++,e.lastBufferedRequest=null,s.next?(e.corkedRequestsFree=s.next,s.next=null):e.corkedRequestsFree=new Mh(e),e.bufferedRequestCount=0}else{for(;r;){var l=r.chunk,u=r.encoding,h=r.callback,p=e.objectMode?1:l.length;if(Wa(t,e,!1,p,l,u,h),r=r.next,e.bufferedRequestCount--,e.writing)break}r===null&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}V.prototype._write=function(t,e,r){r(new tw("_write()"))};V.prototype._writev=null;V.prototype.end=function(t,e,r){var i=this._writableState;return typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null),t!=null&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||ww(this,i,r),this};Object.defineProperty(V.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function Ph(t){return t.ending&&t.length===0&&t.bufferedRequest===null&&!t.finished&&!t.writing}function yw(t,e){t._final(function(r){e.pendingcb--,r&&dr(t,r),e.prefinished=!0,t.emit("prefinish"),zr(t,e)})}function bw(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.pendingcb++,e.finalCalled=!0,process.nextTick(yw,t,e)):(e.prefinished=!0,t.emit("prefinish")))}function zr(t,e){var r=Ph(e);if(r&&(bw(t,e),e.pendingcb===0&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var i=t._readableState;(!i||i.autoDestroy&&i.endEmitted)&&t.destroy()}return r}function ww(t,e,r){e.ending=!0,zr(t,e),r&&(e.finished?process.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}function vw(t,e,r){var i=t.entry;for(t.entry=null;i;){var n=i.callback;e.pendingcb--,n(r),i=i.next}e.corkedRequestsFree.next=t}Object.defineProperty(V.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}});V.prototype.destroy=Ba.destroy;V.prototype._undestroy=Ba.undestroy;V.prototype._destroy=function(t,e){e(t)}});var Ut=w((T2,Ch)=>{"use strict";var _w=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};Ch.exports=Ve;var qh=Ga(),Ha=Ua();nt()(Ve,qh);for(za=_w(Ha.prototype),xn=0;xn<za.length;xn++)Tn=za[xn],Ve.prototype[Tn]||(Ve.prototype[Tn]=Ha.prototype[Tn]);var za,Tn,xn;function Ve(t){if(!(this instanceof Ve))return new Ve(t);qh.call(this,t),Ha.call(this,t),this.allowHalfOpen=!0,t&&(t.readable===!1&&(this.readable=!1),t.writable===!1&&(this.writable=!1),t.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",Sw)))}Object.defineProperty(Ve.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(Ve.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(Ve.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function Sw(){this._writableState.ended||process.nextTick(Ew,this)}function Ew(t){t.end()}Object.defineProperty(Ve.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)}})});var Ka=w(jh=>{"use strict";var Va=la().Buffer,Lh=Va.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function Rw(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}function xw(t){var e=Rw(t);if(typeof e!="string"&&(Va.isEncoding===Lh||!Lh(t)))throw new Error("Unknown encoding: "+t);return e||t}jh.StringDecoder=Gr;function Gr(t){this.encoding=xw(t);var e;switch(this.encoding){case"utf16le":this.text=Pw,this.end=Dw,e=4;break;case"utf8":this.fillLast=Mw,e=4;break;case"base64":this.text=qw,this.end=Cw,e=3;break;default:this.write=Lw,this.end=jw;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Va.allocUnsafe(e)}Gr.prototype.write=function(t){if(t.length===0)return"";var e,r;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""};Gr.prototype.end=Aw;Gr.prototype.text=kw;Gr.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};function Ya(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function Tw(t,e,r){var i=e.length-1;if(i<r)return 0;var n=Ya(e[i]);return n>=0?(n>0&&(t.lastNeed=n-1),n):--i<r||n===-2?0:(n=Ya(e[i]),n>=0?(n>0&&(t.lastNeed=n-2),n):--i<r||n===-2?0:(n=Ya(e[i]),n>=0?(n>0&&(n===2?n=0:t.lastNeed=n-3),n):0))}function Ow(t,e,r){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}function Mw(t){var e=this.lastTotal-this.lastNeed,r=Ow(this,t,e);if(r!==void 0)return r;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}function kw(t,e){var r=Tw(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var i=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)}function Aw(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}function Pw(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function Dw(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function qw(t,e){var r=(t.length-e)%3;return r===0?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function Cw(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function Lw(t){return t.toString(this.encoding)}function jw(t){return t&&t.length?this.write(t):""}});var On=w((M2,Ih)=>{"use strict";var Nh=wt().codes.ERR_STREAM_PREMATURE_CLOSE;function Nw(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,i=new Array(r),n=0;n<r;n++)i[n]=arguments[n];t.apply(this,i)}}}function Fw(){}function Iw(t){return t.setHeader&&typeof t.abort=="function"}function Fh(t,e,r){if(typeof e=="function")return Fh(t,null,e);e||(e={}),r=Nw(r||Fw);var i=e.readable||e.readable!==!1&&t.readable,n=e.writable||e.writable!==!1&&t.writable,s=function(){t.writable||o()},a=t._writableState&&t._writableState.finished,o=function(){n=!1,a=!0,i||r.call(t)},l=t._readableState&&t._readableState.endEmitted,u=function(){i=!1,l=!0,n||r.call(t)},h=function(y){r.call(t,y)},p=function(){var y;if(i&&!l)return(!t._readableState||!t._readableState.ended)&&(y=new Nh),r.call(t,y);if(n&&!a)return(!t._writableState||!t._writableState.ended)&&(y=new Nh),r.call(t,y)},c=function(){t.req.on("finish",o)};return Iw(t)?(t.on("complete",o),t.on("abort",p),t.req?c():t.on("request",c)):n&&!t._writableState&&(t.on("end",s),t.on("close",s)),t.on("end",u),t.on("finish",o),e.error!==!1&&t.on("error",h),t.on("close",p),function(){t.removeListener("complete",o),t.removeListener("abort",p),t.removeListener("request",c),t.req&&t.req.removeListener("finish",o),t.removeListener("end",s),t.removeListener("close",s),t.removeListener("finish",o),t.removeListener("end",u),t.removeListener("error",h),t.removeListener("close",p)}}Ih.exports=Fh});var Wh=w((k2,$h)=>{"use strict";var Mn;function _t(t,e,r){return e=$w(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function $w(t){var e=Ww(t,"string");return typeof e=="symbol"?e:String(e)}function Ww(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var i=r.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Bw=On(),St=Symbol("lastResolve"),zt=Symbol("lastReject"),Yr=Symbol("error"),kn=Symbol("ended"),Ht=Symbol("lastPromise"),Ja=Symbol("handlePromise"),Gt=Symbol("stream");function Et(t,e){return{value:t,done:e}}function Uw(t){var e=t[St];if(e!==null){var r=t[Gt].read();r!==null&&(t[Ht]=null,t[St]=null,t[zt]=null,e(Et(r,!1)))}}function zw(t){process.nextTick(Uw,t)}function Hw(t,e){return function(r,i){t.then(function(){if(e[kn]){r(Et(void 0,!0));return}e[Ja](r,i)},i)}}var Gw=Object.getPrototypeOf(function(){}),Yw=Object.setPrototypeOf((Mn={get stream(){return this[Gt]},next:function(){var e=this,r=this[Yr];if(r!==null)return Promise.reject(r);if(this[kn])return Promise.resolve(Et(void 0,!0));if(this[Gt].destroyed)return new Promise(function(a,o){process.nextTick(function(){e[Yr]?o(e[Yr]):a(Et(void 0,!0))})});var i=this[Ht],n;if(i)n=new Promise(Hw(i,this));else{var s=this[Gt].read();if(s!==null)return Promise.resolve(Et(s,!1));n=new Promise(this[Ja])}return this[Ht]=n,n}},_t(Mn,Symbol.asyncIterator,function(){return this}),_t(Mn,"return",function(){var e=this;return new Promise(function(r,i){e[Gt].destroy(null,function(n){if(n){i(n);return}r(Et(void 0,!0))})})}),Mn),Gw),Vw=function(e){var r,i=Object.create(Yw,(r={},_t(r,Gt,{value:e,writable:!0}),_t(r,St,{value:null,writable:!0}),_t(r,zt,{value:null,writable:!0}),_t(r,Yr,{value:null,writable:!0}),_t(r,kn,{value:e._readableState.endEmitted,writable:!0}),_t(r,Ja,{value:function(s,a){var o=i[Gt].read();o?(i[Ht]=null,i[St]=null,i[zt]=null,s(Et(o,!1))):(i[St]=s,i[zt]=a)},writable:!0}),r));return i[Ht]=null,Bw(e,function(n){if(n&&n.code!=="ERR_STREAM_PREMATURE_CLOSE"){var s=i[zt];s!==null&&(i[Ht]=null,i[St]=null,i[zt]=null,s(n)),i[Yr]=n;return}var a=i[St];a!==null&&(i[Ht]=null,i[St]=null,i[zt]=null,a(Et(void 0,!0))),i[kn]=!0}),e.on("readable",zw.bind(null,i)),i};$h.exports=Vw});var Hh=w((A2,zh)=>{"use strict";function Bh(t,e,r,i,n,s,a){try{var o=t[s](a),l=o.value}catch(u){r(u);return}o.done?e(l):Promise.resolve(l).then(i,n)}function Kw(t){return function(){var e=this,r=arguments;return new Promise(function(i,n){var s=t.apply(e,r);function a(l){Bh(s,i,n,a,o,"next",l)}function o(l){Bh(s,i,n,a,o,"throw",l)}a(void 0)})}}function Uh(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,i)}return r}function Jw(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Uh(Object(r),!0).forEach(function(i){Zw(t,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Uh(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))})}return t}function Zw(t,e,r){return e=Qw(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Qw(t){var e=Xw(t,"string");return typeof e=="symbol"?e:String(e)}function Xw(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var i=r.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var ev=wt().codes.ERR_INVALID_ARG_TYPE;function tv(t,e,r){var i;if(e&&typeof e.next=="function")i=e;else if(e&&e[Symbol.asyncIterator])i=e[Symbol.asyncIterator]();else if(e&&e[Symbol.iterator])i=e[Symbol.iterator]();else throw new ev("iterable",["Iterable"],e);var n=new t(Jw({objectMode:!0},r)),s=!1;n._read=function(){s||(s=!0,a())};function a(){return o.apply(this,arguments)}function o(){return o=Kw(function*(){try{var l=yield i.next(),u=l.value,h=l.done;h?n.push(null):n.push(yield u)?a():s=!1}catch(p){n.destroy(p)}}),o.apply(this,arguments)}return n}zh.exports=tv});var Ga=w((D2,tc)=>{"use strict";tc.exports=W;var pr;W.ReadableState=Kh;var P2=require("events").EventEmitter,Vh=function(e,r){return e.listeners(r).length},Kr=ja(),An=require("buffer").Buffer,rv=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function iv(t){return An.from(t)}function nv(t){return An.isBuffer(t)||t instanceof rv}var Za=require("util"),L;Za&&Za.debuglog?L=Za.debuglog("stream"):L=function(){};var sv=vh(),no=Ia(),av=$a(),ov=av.getHighWaterMark,Pn=wt().codes,lv=Pn.ERR_INVALID_ARG_TYPE,uv=Pn.ERR_STREAM_PUSH_AFTER_EOF,fv=Pn.ERR_METHOD_NOT_IMPLEMENTED,hv=Pn.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,gr,Qa,Xa;nt()(W,Kr);var Vr=no.errorOrDestroy,eo=["error","close","destroy","pause","resume"];function cv(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}function Kh(t,e,r){pr=pr||Ut(),t=t||{},typeof r!="boolean"&&(r=e instanceof pr),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=ov(this,t,"readableHighWaterMark",r),this.buffer=new sv,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(gr||(gr=Ka().StringDecoder),this.decoder=new gr(t.encoding),this.encoding=t.encoding)}function W(t){if(pr=pr||Ut(),!(this instanceof W))return new W(t);var e=this instanceof pr;this._readableState=new Kh(t,this,e),this.readable=!0,t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy)),Kr.call(this)}Object.defineProperty(W.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}});W.prototype.destroy=no.destroy;W.prototype._undestroy=no.undestroy;W.prototype._destroy=function(t,e){e(t)};W.prototype.push=function(t,e){var r=this._readableState,i;return r.objectMode?i=!0:typeof t=="string"&&(e=e||r.defaultEncoding,e!==r.encoding&&(t=An.from(t,e),e=""),i=!0),Jh(this,t,e,!1,i)};W.prototype.unshift=function(t){return Jh(this,t,null,!0,!1)};function Jh(t,e,r,i,n){L("readableAddChunk",e);var s=t._readableState;if(e===null)s.reading=!1,gv(t,s);else{var a;if(n||(a=dv(s,e)),a)Vr(t,a);else if(s.objectMode||e&&e.length>0)if(typeof e!="string"&&!s.objectMode&&Object.getPrototypeOf(e)!==An.prototype&&(e=iv(e)),i)s.endEmitted?Vr(t,new hv):to(t,s,e,!0);else if(s.ended)Vr(t,new uv);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!r?(e=s.decoder.write(e),s.objectMode||e.length!==0?to(t,s,e,!1):io(t,s)):to(t,s,e,!1)}else i||(s.reading=!1,io(t,s))}return!s.ended&&(s.length<s.highWaterMark||s.length===0)}function to(t,e,r,i){e.flowing&&e.length===0&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,i?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&Dn(t)),io(t,e)}function dv(t,e){var r;return!nv(e)&&typeof e!="string"&&e!==void 0&&!t.objectMode&&(r=new lv("chunk",["string","Buffer","Uint8Array"],e)),r}W.prototype.isPaused=function(){return this._readableState.flowing===!1};W.prototype.setEncoding=function(t){gr||(gr=Ka().StringDecoder);var e=new gr(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,i="";r!==null;)i+=e.write(r.data),r=r.next;return this._readableState.buffer.clear(),i!==""&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var Gh=1073741824;function pv(t){return t>=Gh?t=Gh:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function Yh(t,e){return t<=0||e.length===0&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=pv(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}W.prototype.read=function(t){L("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(t!==0&&(e.emittedReadable=!1),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return L("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?ro(this):Dn(this),null;if(t=Yh(t,e),t===0&&e.ended)return e.length===0&&ro(this),null;var i=e.needReadable;L("need readable",i),(e.length===0||e.length-t<e.highWaterMark)&&(i=!0,L("length less than watermark",i)),e.ended||e.reading?(i=!1,L("reading or ended",i)):i&&(L("do read"),e.reading=!0,e.sync=!0,e.length===0&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=Yh(r,e)));var n;return t>0?n=Xh(t,e):n=null,n===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&ro(this)),n!==null&&this.emit("data",n),n};function gv(t,e){if(L("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?Dn(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,Zh(t)))}}function Dn(t){var e=t._readableState;L("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(L("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(Zh,t))}function Zh(t){var e=t._readableState;L("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,so(t)}function io(t,e){e.readingMore||(e.readingMore=!0,process.nextTick(mv,t,e))}function mv(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){var r=e.length;if(L("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}W.prototype._read=function(t){Vr(this,new fv("_read()"))};W.prototype.pipe=function(t,e){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t);break}i.pipesCount+=1,L("pipe count=%d opts=%j",i.pipesCount,e);var n=(!e||e.end!==!1)&&t!==process.stdout&&t!==process.stderr,s=n?o:b;i.endEmitted?process.nextTick(s):r.once("end",s),t.on("unpipe",a);function a(S,_){L("onunpipe"),S===r&&_&&_.hasUnpiped===!1&&(_.hasUnpiped=!0,h())}function o(){L("onend"),t.end()}var l=yv(r);t.on("drain",l);var u=!1;function h(){L("cleanup"),t.removeListener("close",f),t.removeListener("finish",y),t.removeListener("drain",l),t.removeListener("error",c),t.removeListener("unpipe",a),r.removeListener("end",o),r.removeListener("end",b),r.removeListener("data",p),u=!0,i.awaitDrain&&(!t._writableState||t._writableState.needDrain)&&l()}r.on("data",p);function p(S){L("ondata");var _=t.write(S);L("dest.write",_),_===!1&&((i.pipesCount===1&&i.pipes===t||i.pipesCount>1&&ec(i.pipes,t)!==-1)&&!u&&(L("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function c(S){L("onerror",S),b(),t.removeListener("error",c),Vh(t,"error")===0&&Vr(t,S)}cv(t,"error",c);function f(){t.removeListener("finish",y),b()}t.once("close",f);function y(){L("onfinish"),t.removeListener("close",f),b()}t.once("finish",y);function b(){L("unpipe"),r.unpipe(t)}return t.emit("pipe",r),i.flowing||(L("pipe resume"),r.resume()),t};function yv(t){return function(){var r=t._readableState;L("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&Vh(t,"data")&&(r.flowing=!0,so(t))}}W.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(e.pipesCount===0)return this;if(e.pipesCount===1)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var i=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var s=0;s<n;s++)i[s].emit("unpipe",this,{hasUnpiped:!1});return this}var a=ec(e.pipes,t);return a===-1?this:(e.pipes.splice(a,1),e.pipesCount-=1,e.pipesCount===1&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r),this)};W.prototype.on=function(t,e){var r=Kr.prototype.on.call(this,t,e),i=this._readableState;return t==="data"?(i.readableListening=this.listenerCount("readable")>0,i.flowing!==!1&&this.resume()):t==="readable"&&!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,L("on readable",i.length,i.reading),i.length?Dn(this):i.reading||process.nextTick(bv,this)),r};W.prototype.addListener=W.prototype.on;W.prototype.removeListener=function(t,e){var r=Kr.prototype.removeListener.call(this,t,e);return t==="readable"&&process.nextTick(Qh,this),r};W.prototype.removeAllListeners=function(t){var e=Kr.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&process.nextTick(Qh,this),e};function Qh(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function bv(t){L("readable nexttick read 0"),t.read(0)}W.prototype.resume=function(){var t=this._readableState;return t.flowing||(L("resume"),t.flowing=!t.readableListening,wv(this,t)),t.paused=!1,this};function wv(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(vv,t,e))}function vv(t,e){L("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),so(t),e.flowing&&!e.reading&&t.read(0)}W.prototype.pause=function(){return L("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(L("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function so(t){var e=t._readableState;for(L("flow",e.flowing);e.flowing&&t.read()!==null;);}W.prototype.wrap=function(t){var e=this,r=this._readableState,i=!1;t.on("end",function(){if(L("wrapped end"),r.decoder&&!r.ended){var a=r.decoder.end();a&&a.length&&e.push(a)}e.push(null)}),t.on("data",function(a){if(L("wrapped data"),r.decoder&&(a=r.decoder.write(a)),!(r.objectMode&&a==null)&&!(!r.objectMode&&(!a||!a.length))){var o=e.push(a);o||(i=!0,t.pause())}});for(var n in t)this[n]===void 0&&typeof t[n]=="function"&&(this[n]=function(o){return function(){return t[o].apply(t,arguments)}}(n));for(var s=0;s<eo.length;s++)t.on(eo[s],this.emit.bind(this,eo[s]));return this._read=function(a){L("wrapped _read",a),i&&(i=!1,t.resume())},this};typeof Symbol=="function"&&(W.prototype[Symbol.asyncIterator]=function(){return Qa===void 0&&(Qa=Wh()),Qa(this)});Object.defineProperty(W.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(W.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(W.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}});W._fromList=Xh;Object.defineProperty(W.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function Xh(t,e){if(e.length===0)return null;var r;return e.objectMode?r=e.buffer.shift():!t||t>=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.first():r=e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r}function ro(t){var e=t._readableState;L("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(_v,e,t))}function _v(t,e){if(L("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&t.length===0&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}typeof Symbol=="function"&&(W.from=function(t,e){return Xa===void 0&&(Xa=Hh()),Xa(W,t,e)});function ec(t,e){for(var r=0,i=t.length;r<i;r++)if(t[r]===e)return r;return-1}});var ao=w((q2,ic)=>{"use strict";ic.exports=at;var qn=wt().codes,Sv=qn.ERR_METHOD_NOT_IMPLEMENTED,Ev=qn.ERR_MULTIPLE_CALLBACK,Rv=qn.ERR_TRANSFORM_ALREADY_TRANSFORMING,xv=qn.ERR_TRANSFORM_WITH_LENGTH_0,Cn=Ut();nt()(at,Cn);function Tv(t,e){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(i===null)return this.emit("error",new Ev);r.writechunk=null,r.writecb=null,e!=null&&this.push(e),i(t);var n=this._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}function at(t){if(!(this instanceof at))return new at(t);Cn.call(this,t),this._transformState={afterTransform:Tv.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",Ov)}function Ov(){var t=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(e,r){rc(t,e,r)}):rc(this,null,null)}at.prototype.push=function(t,e){return this._transformState.needTransform=!1,Cn.prototype.push.call(this,t,e)};at.prototype._transform=function(t,e,r){r(new Sv("_transform()"))};at.prototype._write=function(t,e,r){var i=this._transformState;if(i.writecb=r,i.writechunk=t,i.writeencoding=e,!i.transforming){var n=this._readableState;(i.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}};at.prototype._read=function(t){var e=this._transformState;e.writechunk!==null&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0};at.prototype._destroy=function(t,e){Cn.prototype._destroy.call(this,t,function(r){e(r)})};function rc(t,e,r){if(e)return t.emit("error",e);if(r!=null&&t.push(r),t._writableState.length)throw new xv;if(t._transformState.transforming)throw new Rv;return t.push(null)}});var ac=w((C2,sc)=>{"use strict";sc.exports=Jr;var nc=ao();nt()(Jr,nc);function Jr(t){if(!(this instanceof Jr))return new Jr(t);nc.call(this,t)}Jr.prototype._transform=function(t,e,r){r(null,t)}});var hc=w((L2,fc)=>{"use strict";var oo;function Mv(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}var uc=wt().codes,kv=uc.ERR_MISSING_ARGS,Av=uc.ERR_STREAM_DESTROYED;function oc(t){if(t)throw t}function Pv(t){return t.setHeader&&typeof t.abort=="function"}function Dv(t,e,r,i){i=Mv(i);var n=!1;t.on("close",function(){n=!0}),oo===void 0&&(oo=On()),oo(t,{readable:e,writable:r},function(a){if(a)return i(a);n=!0,i()});var s=!1;return function(a){if(!n&&!s){if(s=!0,Pv(t))return t.abort();if(typeof t.destroy=="function")return t.destroy();i(a||new Av("pipe"))}}}function lc(t){t()}function qv(t,e){return t.pipe(e)}function Cv(t){return!t.length||typeof t[t.length-1]!="function"?oc:t.pop()}function Lv(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var i=Cv(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new kv("streams");var n,s=e.map(function(a,o){var l=o<e.length-1,u=o>0;return Dv(a,l,u,function(h){n||(n=h),h&&s.forEach(lc),!l&&(s.forEach(lc),i(n))})});return e.reduce(qv)}fc.exports=Lv});var Yt=w((Ce,Qr)=>{var Zr=require("stream");process.env.READABLE_STREAM==="disable"&&Zr?(Qr.exports=Zr.Readable,Object.assign(Qr.exports,Zr),Qr.exports.Stream=Zr):(Ce=Qr.exports=Ga(),Ce.Stream=Zr||Ce,Ce.Readable=Ce,Ce.Writable=Ua(),Ce.Duplex=Ut(),Ce.Transform=ao(),Ce.PassThrough=ac(),Ce.finished=On(),Ce.pipeline=hc())});var go=w((j2,dc)=>{var mr=[],Xr=[],lo=function(){};function fo(t){return~mr.indexOf(t)?!1:(mr.push(t),!0)}function ho(t){lo=t}function jv(t){for(var e=[],r=0;r<mr.length;r++){if(mr[r].async){e.push(mr[r]);continue}if(mr[r](t))return!0}return e.length?new Promise(function(n){Promise.all(e.map(function(a){return a(t)})).then(function(a){n(a.some(Boolean))})}):!1}function co(t){return~Xr.indexOf(t)?!1:(Xr.push(t),!0)}function uo(){lo.apply(lo,arguments)}function cc(t){for(var e=0;e<Xr.length;e++)t=Xr[e].apply(Xr[e],arguments);return t}function po(t,e){var r=Object.prototype.hasOwnProperty;for(var i in e)r.call(e,i)&&(t[i]=e[i]);return t}function Nv(t){return t.enabled=!1,t.modify=co,t.set=ho,t.use=fo,po(function(){return!1},t)}function Fv(t){function e(){var r=Array.prototype.slice.call(arguments,0);return uo.call(uo,t,cc(r,t)),!0}return t.enabled=!0,t.modify=co,t.set=ho,t.use=fo,po(e,t)}dc.exports=function(e){return e.introduce=po,e.enabled=jv,e.process=cc,e.modify=co,e.write=uo,e.nope=Nv,e.yep=Fv,e.set=ho,e.use=fo,e}});var gc=w((N2,pc)=>{var Iv=go(),$v=Iv(function t(e,r){return r=r||{},r.namespace=e,r.prod=!0,r.dev=!1,r.force||t.force?t.yep(r):t.nope(r)});pc.exports=$v});var yc=w((F2,mc)=>{"use strict";mc.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var wc=w((I2,bc)=>{bc.exports=function(e){return!e||typeof e=="string"?!1:e instanceof Array||Array.isArray(e)||e.length>=0&&(e.splice instanceof Function||Object.getOwnPropertyDescriptor(e,e.length-1)&&e.constructor.name!=="String")}});var Sc=w(($2,_c)=>{"use strict";var Wv=wc(),Bv=Array.prototype.concat,Uv=Array.prototype.slice,vc=_c.exports=function(e){for(var r=[],i=0,n=e.length;i<n;i++){var s=e[i];Wv(s)?r=Bv.call(r,Uv.call(s)):r.push(s)}return r};vc.wrap=function(t){return function(){return t(vc(arguments))}}});var Tc=w((W2,xc)=>{var ei=yc(),ti=Sc(),Ec=Object.hasOwnProperty,Rc=Object.create(null);for(Ln in ei)Ec.call(ei,Ln)&&(Rc[ei[Ln]]=Ln);var Ln,Oe=xc.exports={to:{},get:{}};Oe.get=function(t){var e=t.substring(0,3).toLowerCase(),r,i;switch(e){case"hsl":r=Oe.get.hsl(t),i="hsl";break;case"hwb":r=Oe.get.hwb(t),i="hwb";break;default:r=Oe.get.rgb(t),i="rgb";break}return r?{model:i,value:r}:null};Oe.get.rgb=function(t){if(!t)return null;var e=/^#([a-f0-9]{3,4})$/i,r=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,i=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,n=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,s=/^(\w+)$/,a=[0,0,0,1],o,l,u;if(o=t.match(r)){for(u=o[2],o=o[1],l=0;l<3;l++){var h=l*2;a[l]=parseInt(o.slice(h,h+2),16)}u&&(a[3]=parseInt(u,16)/255)}else if(o=t.match(e)){for(o=o[1],u=o[3],l=0;l<3;l++)a[l]=parseInt(o[l]+o[l],16);u&&(a[3]=parseInt(u+u,16)/255)}else if(o=t.match(i)){for(l=0;l<3;l++)a[l]=parseInt(o[l+1],0);o[4]&&(o[5]?a[3]=parseFloat(o[4])*.01:a[3]=parseFloat(o[4]))}else if(o=t.match(n)){for(l=0;l<3;l++)a[l]=Math.round(parseFloat(o[l+1])*2.55);o[4]&&(o[5]?a[3]=parseFloat(o[4])*.01:a[3]=parseFloat(o[4]))}else return(o=t.match(s))?o[1]==="transparent"?[0,0,0,0]:Ec.call(ei,o[1])?(a=ei[o[1]],a[3]=1,a):null:null;for(l=0;l<3;l++)a[l]=Rt(a[l],0,255);return a[3]=Rt(a[3],0,1),a};Oe.get.hsl=function(t){if(!t)return null;var e=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,r=t.match(e);if(r){var i=parseFloat(r[4]),n=(parseFloat(r[1])%360+360)%360,s=Rt(parseFloat(r[2]),0,100),a=Rt(parseFloat(r[3]),0,100),o=Rt(isNaN(i)?1:i,0,1);return[n,s,a,o]}return null};Oe.get.hwb=function(t){if(!t)return null;var e=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,r=t.match(e);if(r){var i=parseFloat(r[4]),n=(parseFloat(r[1])%360+360)%360,s=Rt(parseFloat(r[2]),0,100),a=Rt(parseFloat(r[3]),0,100),o=Rt(isNaN(i)?1:i,0,1);return[n,s,a,o]}return null};Oe.to.hex=function(){var t=ti(arguments);return"#"+jn(t[0])+jn(t[1])+jn(t[2])+(t[3]<1?jn(Math.round(t[3]*255)):"")};Oe.to.rgb=function(){var t=ti(arguments);return t.length<4||t[3]===1?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"};Oe.to.rgb.percent=function(){var t=ti(arguments),e=Math.round(t[0]/255*100),r=Math.round(t[1]/255*100),i=Math.round(t[2]/255*100);return t.length<4||t[3]===1?"rgb("+e+"%, "+r+"%, "+i+"%)":"rgba("+e+"%, "+r+"%, "+i+"%, "+t[3]+")"};Oe.to.hsl=function(){var t=ti(arguments);return t.length<4||t[3]===1?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"};Oe.to.hwb=function(){var t=ti(arguments),e="";return t.length>=4&&t[3]!==1&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"};Oe.to.keyword=function(t){return Rc[t.slice(0,3)]};function Rt(t,e,r){return Math.min(Math.max(e,t),r)}function jn(t){var e=Math.round(t).toString(16).toUpperCase();return e.length<2?"0"+e:e}});var Mc=w((B2,Oc)=>{"use strict";Oc.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var mo=w((U2,Dc)=>{var Vt=Mc(),Pc={};for(Nn in Vt)Vt.hasOwnProperty(Nn)&&(Pc[Vt[Nn]]=Nn);var Nn,k=Dc.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(ve in k)if(k.hasOwnProperty(ve)){if(!("channels"in k[ve]))throw new Error("missing channels property: "+ve);if(!("labels"in k[ve]))throw new Error("missing channel labels property: "+ve);if(k[ve].labels.length!==k[ve].channels)throw new Error("channel and label counts mismatch: "+ve);kc=k[ve].channels,Ac=k[ve].labels,delete k[ve].channels,delete k[ve].labels,Object.defineProperty(k[ve],"channels",{value:kc}),Object.defineProperty(k[ve],"labels",{value:Ac})}var kc,Ac,ve;k.rgb.hsl=function(t){var e=t[0]/255,r=t[1]/255,i=t[2]/255,n=Math.min(e,r,i),s=Math.max(e,r,i),a=s-n,o,l,u;return s===n?o=0:e===s?o=(r-i)/a:r===s?o=2+(i-e)/a:i===s&&(o=4+(e-r)/a),o=Math.min(o*60,360),o<0&&(o+=360),u=(n+s)/2,s===n?l=0:u<=.5?l=a/(s+n):l=a/(2-s-n),[o,l*100,u*100]};k.rgb.hsv=function(t){var e,r,i,n,s,a=t[0]/255,o=t[1]/255,l=t[2]/255,u=Math.max(a,o,l),h=u-Math.min(a,o,l),p=function(c){return(u-c)/6/h+1/2};return h===0?n=s=0:(s=h/u,e=p(a),r=p(o),i=p(l),a===u?n=i-r:o===u?n=1/3+e-i:l===u&&(n=2/3+r-e),n<0?n+=1:n>1&&(n-=1)),[n*360,s*100,u*100]};k.rgb.hwb=function(t){var e=t[0],r=t[1],i=t[2],n=k.rgb.hsl(t)[0],s=1/255*Math.min(e,Math.min(r,i));return i=1-1/255*Math.max(e,Math.max(r,i)),[n,s*100,i*100]};k.rgb.cmyk=function(t){var e=t[0]/255,r=t[1]/255,i=t[2]/255,n,s,a,o;return o=Math.min(1-e,1-r,1-i),n=(1-e-o)/(1-o)||0,s=(1-r-o)/(1-o)||0,a=(1-i-o)/(1-o)||0,[n*100,s*100,a*100,o*100]};function zv(t,e){return Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)+Math.pow(t[2]-e[2],2)}k.rgb.keyword=function(t){var e=Pc[t];if(e)return e;var r=1/0,i;for(var n in Vt)if(Vt.hasOwnProperty(n)){var s=Vt[n],a=zv(t,s);a<r&&(r=a,i=n)}return i};k.keyword.rgb=function(t){return Vt[t]};k.rgb.xyz=function(t){var e=t[0]/255,r=t[1]/255,i=t[2]/255;e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92,i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92;var n=e*.4124+r*.3576+i*.1805,s=e*.2126+r*.7152+i*.0722,a=e*.0193+r*.1192+i*.9505;return[n*100,s*100,a*100]};k.rgb.lab=function(t){var e=k.rgb.xyz(t),r=e[0],i=e[1],n=e[2],s,a,o;return r/=95.047,i/=100,n/=108.883,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,i=i>.008856?Math.pow(i,1/3):7.787*i+16/116,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,s=116*i-16,a=500*(r-i),o=200*(i-n),[s,a,o]};k.hsl.rgb=function(t){var e=t[0]/360,r=t[1]/100,i=t[2]/100,n,s,a,o,l;if(r===0)return l=i*255,[l,l,l];i<.5?s=i*(1+r):s=i+r-i*r,n=2*i-s,o=[0,0,0];for(var u=0;u<3;u++)a=e+1/3*-(u-1),a<0&&a++,a>1&&a--,6*a<1?l=n+(s-n)*6*a:2*a<1?l=s:3*a<2?l=n+(s-n)*(2/3-a)*6:l=n,o[u]=l*255;return o};k.hsl.hsv=function(t){var e=t[0],r=t[1]/100,i=t[2]/100,n=r,s=Math.max(i,.01),a,o;return i*=2,r*=i<=1?i:2-i,n*=s<=1?s:2-s,o=(i+r)/2,a=i===0?2*n/(s+n):2*r/(i+r),[e,a*100,o*100]};k.hsv.rgb=function(t){var e=t[0]/60,r=t[1]/100,i=t[2]/100,n=Math.floor(e)%6,s=e-Math.floor(e),a=255*i*(1-r),o=255*i*(1-r*s),l=255*i*(1-r*(1-s));switch(i*=255,n){case 0:return[i,l,a];case 1:return[o,i,a];case 2:return[a,i,l];case 3:return[a,o,i];case 4:return[l,a,i];case 5:return[i,a,o]}};k.hsv.hsl=function(t){var e=t[0],r=t[1]/100,i=t[2]/100,n=Math.max(i,.01),s,a,o;return o=(2-r)*i,s=(2-r)*n,a=r*n,a/=s<=1?s:2-s,a=a||0,o/=2,[e,a*100,o*100]};k.hwb.rgb=function(t){var e=t[0]/360,r=t[1]/100,i=t[2]/100,n=r+i,s,a,o,l;n>1&&(r/=n,i/=n),s=Math.floor(6*e),a=1-i,o=6*e-s,s&1&&(o=1-o),l=r+o*(a-r);var u,h,p;switch(s){default:case 6:case 0:u=a,h=l,p=r;break;case 1:u=l,h=a,p=r;break;case 2:u=r,h=a,p=l;break;case 3:u=r,h=l,p=a;break;case 4:u=l,h=r,p=a;break;case 5:u=a,h=r,p=l;break}return[u*255,h*255,p*255]};k.cmyk.rgb=function(t){var e=t[0]/100,r=t[1]/100,i=t[2]/100,n=t[3]/100,s,a,o;return s=1-Math.min(1,e*(1-n)+n),a=1-Math.min(1,r*(1-n)+n),o=1-Math.min(1,i*(1-n)+n),[s*255,a*255,o*255]};k.xyz.rgb=function(t){var e=t[0]/100,r=t[1]/100,i=t[2]/100,n,s,a;return n=e*3.2406+r*-1.5372+i*-.4986,s=e*-.9689+r*1.8758+i*.0415,a=e*.0557+r*-.204+i*1.057,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:n*12.92,s=s>.0031308?1.055*Math.pow(s,1/2.4)-.055:s*12.92,a=a>.0031308?1.055*Math.pow(a,1/2.4)-.055:a*12.92,n=Math.min(Math.max(0,n),1),s=Math.min(Math.max(0,s),1),a=Math.min(Math.max(0,a),1),[n*255,s*255,a*255]};k.xyz.lab=function(t){var e=t[0],r=t[1],i=t[2],n,s,a;return e/=95.047,r/=100,i/=108.883,e=e>.008856?Math.pow(e,1/3):7.787*e+16/116,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,i=i>.008856?Math.pow(i,1/3):7.787*i+16/116,n=116*r-16,s=500*(e-r),a=200*(r-i),[n,s,a]};k.lab.xyz=function(t){var e=t[0],r=t[1],i=t[2],n,s,a;s=(e+16)/116,n=r/500+s,a=s-i/200;var o=Math.pow(s,3),l=Math.pow(n,3),u=Math.pow(a,3);return s=o>.008856?o:(s-16/116)/7.787,n=l>.008856?l:(n-16/116)/7.787,a=u>.008856?u:(a-16/116)/7.787,n*=95.047,s*=100,a*=108.883,[n,s,a]};k.lab.lch=function(t){var e=t[0],r=t[1],i=t[2],n,s,a;return n=Math.atan2(i,r),s=n*360/2/Math.PI,s<0&&(s+=360),a=Math.sqrt(r*r+i*i),[e,a,s]};k.lch.lab=function(t){var e=t[0],r=t[1],i=t[2],n,s,a;return a=i/360*2*Math.PI,n=r*Math.cos(a),s=r*Math.sin(a),[e,n,s]};k.rgb.ansi16=function(t){var e=t[0],r=t[1],i=t[2],n=1 in arguments?arguments[1]:k.rgb.hsv(t)[2];if(n=Math.round(n/50),n===0)return 30;var s=30+(Math.round(i/255)<<2|Math.round(r/255)<<1|Math.round(e/255));return n===2&&(s+=60),s};k.hsv.ansi16=function(t){return k.rgb.ansi16(k.hsv.rgb(t),t[2])};k.rgb.ansi256=function(t){var e=t[0],r=t[1],i=t[2];if(e===r&&r===i)return e<8?16:e>248?231:Math.round((e-8)/247*24)+232;var n=16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(i/255*5);return n};k.ansi16.rgb=function(t){var e=t%10;if(e===0||e===7)return t>50&&(e+=3.5),e=e/10.5*255,[e,e,e];var r=(~~(t>50)+1)*.5,i=(e&1)*r*255,n=(e>>1&1)*r*255,s=(e>>2&1)*r*255;return[i,n,s]};k.ansi256.rgb=function(t){if(t>=232){var e=(t-232)*10+8;return[e,e,e]}t-=16;var r,i=Math.floor(t/36)/5*255,n=Math.floor((r=t%36)/6)/5*255,s=r%6/5*255;return[i,n,s]};k.rgb.hex=function(t){var e=((Math.round(t[0])&255)<<16)+((Math.round(t[1])&255)<<8)+(Math.round(t[2])&255),r=e.toString(16).toUpperCase();return"000000".substring(r.length)+r};k.hex.rgb=function(t){var e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var r=e[0];e[0].length===3&&(r=r.split("").map(function(o){return o+o}).join(""));var i=parseInt(r,16),n=i>>16&255,s=i>>8&255,a=i&255;return[n,s,a]};k.rgb.hcg=function(t){var e=t[0]/255,r=t[1]/255,i=t[2]/255,n=Math.max(Math.max(e,r),i),s=Math.min(Math.min(e,r),i),a=n-s,o,l;return a<1?o=s/(1-a):o=0,a<=0?l=0:n===e?l=(r-i)/a%6:n===r?l=2+(i-e)/a:l=4+(e-r)/a+4,l/=6,l%=1,[l*360,a*100,o*100]};k.hsl.hcg=function(t){var e=t[1]/100,r=t[2]/100,i=1,n=0;return r<.5?i=2*e*r:i=2*e*(1-r),i<1&&(n=(r-.5*i)/(1-i)),[t[0],i*100,n*100]};k.hsv.hcg=function(t){var e=t[1]/100,r=t[2]/100,i=e*r,n=0;return i<1&&(n=(r-i)/(1-i)),[t[0],i*100,n*100]};k.hcg.rgb=function(t){var e=t[0]/360,r=t[1]/100,i=t[2]/100;if(r===0)return[i*255,i*255,i*255];var n=[0,0,0],s=e%1*6,a=s%1,o=1-a,l=0;switch(Math.floor(s)){case 0:n[0]=1,n[1]=a,n[2]=0;break;case 1:n[0]=o,n[1]=1,n[2]=0;break;case 2:n[0]=0,n[1]=1,n[2]=a;break;case 3:n[0]=0,n[1]=o,n[2]=1;break;case 4:n[0]=a,n[1]=0,n[2]=1;break;default:n[0]=1,n[1]=0,n[2]=o}return l=(1-r)*i,[(r*n[0]+l)*255,(r*n[1]+l)*255,(r*n[2]+l)*255]};k.hcg.hsv=function(t){var e=t[1]/100,r=t[2]/100,i=e+r*(1-e),n=0;return i>0&&(n=e/i),[t[0],n*100,i*100]};k.hcg.hsl=function(t){var e=t[1]/100,r=t[2]/100,i=r*(1-e)+.5*e,n=0;return i>0&&i<.5?n=e/(2*i):i>=.5&&i<1&&(n=e/(2*(1-i))),[t[0],n*100,i*100]};k.hcg.hwb=function(t){var e=t[1]/100,r=t[2]/100,i=e+r*(1-e);return[t[0],(i-e)*100,(1-i)*100]};k.hwb.hcg=function(t){var e=t[1]/100,r=t[2]/100,i=1-r,n=i-e,s=0;return n<1&&(s=(i-n)/(1-n)),[t[0],n*100,s*100]};k.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};k.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};k.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};k.gray.hsl=k.gray.hsv=function(t){return[0,0,t[0]]};k.gray.hwb=function(t){return[0,100,t[0]]};k.gray.cmyk=function(t){return[0,0,0,t[0]]};k.gray.lab=function(t){return[t[0],0,0]};k.gray.hex=function(t){var e=Math.round(t[0]/100*255)&255,r=(e<<16)+(e<<8)+e,i=r.toString(16).toUpperCase();return"000000".substring(i.length)+i};k.rgb.gray=function(t){var e=(t[0]+t[1]+t[2])/3;return[e/255*100]}});var Cc=w((z2,qc)=>{var Fn=mo();function Hv(){for(var t={},e=Object.keys(Fn),r=e.length,i=0;i<r;i++)t[e[i]]={distance:-1,parent:null};return t}function Gv(t){var e=Hv(),r=[t];for(e[t].distance=0;r.length;)for(var i=r.pop(),n=Object.keys(Fn[i]),s=n.length,a=0;a<s;a++){var o=n[a],l=e[o];l.distance===-1&&(l.distance=e[i].distance+1,l.parent=i,r.unshift(o))}return e}function Yv(t,e){return function(r){return e(t(r))}}function Vv(t,e){for(var r=[e[t].parent,t],i=Fn[e[t].parent][t],n=e[t].parent;e[n].parent;)r.unshift(e[n].parent),i=Yv(Fn[e[n].parent][n],i),n=e[n].parent;return i.conversion=r,i}qc.exports=function(t){for(var e=Gv(t),r={},i=Object.keys(e),n=i.length,s=0;s<n;s++){var a=i[s],o=e[a];o.parent!==null&&(r[a]=Vv(a,e))}return r}});var jc=w((H2,Lc)=>{var yo=mo(),Kv=Cc(),yr={},Jv=Object.keys(yo);function Zv(t){var e=function(r){return r==null?r:(arguments.length>1&&(r=Array.prototype.slice.call(arguments)),t(r))};return"conversion"in t&&(e.conversion=t.conversion),e}function Qv(t){var e=function(r){if(r==null)return r;arguments.length>1&&(r=Array.prototype.slice.call(arguments));var i=t(r);if(typeof i=="object")for(var n=i.length,s=0;s<n;s++)i[s]=Math.round(i[s]);return i};return"conversion"in t&&(e.conversion=t.conversion),e}Jv.forEach(function(t){yr[t]={},Object.defineProperty(yr[t],"channels",{value:yo[t].channels}),Object.defineProperty(yr[t],"labels",{value:yo[t].labels});var e=Kv(t),r=Object.keys(e);r.forEach(function(i){var n=e[i];yr[t][i]=Qv(n),yr[t][i].raw=Zv(n)})});Lc.exports=yr});var Ic=w((G2,Fc)=>{"use strict";var ri=Tc(),Me=jc(),vo=[].slice,Nc=["keyword","gray","hex"],bo={};Object.keys(Me).forEach(function(t){bo[vo.call(Me[t].labels).sort().join("")]=t});var In={};function ue(t,e){if(!(this instanceof ue))return new ue(t,e);if(e&&e in Nc&&(e=null),e&&!(e in Me))throw new Error("Unknown model: "+e);var r,i;if(t==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(t instanceof ue)this.model=t.model,this.color=t.color.slice(),this.valpha=t.valpha;else if(typeof t=="string"){var n=ri.get(t);if(n===null)throw new Error("Unable to parse color from string: "+t);this.model=n.model,i=Me[this.model].channels,this.color=n.value.slice(0,i),this.valpha=typeof n.value[i]=="number"?n.value[i]:1}else if(t.length){this.model=e||"rgb",i=Me[this.model].channels;var s=vo.call(t,0,i);this.color=wo(s,i),this.valpha=typeof t[i]=="number"?t[i]:1}else if(typeof t=="number")t&=16777215,this.model="rgb",this.color=[t>>16&255,t>>8&255,t&255],this.valpha=1;else{this.valpha=1;var a=Object.keys(t);"alpha"in t&&(a.splice(a.indexOf("alpha"),1),this.valpha=typeof t.alpha=="number"?t.alpha:0);var o=a.sort().join("");if(!(o in bo))throw new Error("Unable to parse color from object: "+JSON.stringify(t));this.model=bo[o];var l=Me[this.model].labels,u=[];for(r=0;r<l.length;r++)u.push(t[l[r]]);this.color=wo(u)}if(In[this.model])for(i=Me[this.model].channels,r=0;r<i;r++){var h=In[this.model][r];h&&(this.color[r]=h(this.color[r]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}ue.prototype={toString:function(){return this.string()},toJSON:function(){return this[this.model]()},string:function(t){var e=this.model in ri.to?this:this.rgb();e=e.round(typeof t=="number"?t:1);var r=e.valpha===1?e.color:e.color.concat(this.valpha);return ri.to[e.model](r)},percentString:function(t){var e=this.rgb().round(typeof t=="number"?t:1),r=e.valpha===1?e.color:e.color.concat(this.valpha);return ri.to.rgb.percent(r)},array:function(){return this.valpha===1?this.color.slice():this.color.concat(this.valpha)},object:function(){for(var t={},e=Me[this.model].channels,r=Me[this.model].labels,i=0;i<e;i++)t[r[i]]=this.color[i];return this.valpha!==1&&(t.alpha=this.valpha),t},unitArray:function(){var t=this.rgb().color;return t[0]/=255,t[1]/=255,t[2]/=255,this.valpha!==1&&t.push(this.valpha),t},unitObject:function(){var t=this.rgb().object();return t.r/=255,t.g/=255,t.b/=255,this.valpha!==1&&(t.alpha=this.valpha),t},round:function(t){return t=Math.max(t||0,0),new ue(this.color.map(e1(t)).concat(this.valpha),this.model)},alpha:function(t){return arguments.length?new ue(this.color.concat(Math.max(0,Math.min(1,t))),this.model):this.valpha},red:K("rgb",0,ie(255)),green:K("rgb",1,ie(255)),blue:K("rgb",2,ie(255)),hue:K(["hsl","hsv","hsl","hwb","hcg"],0,function(t){return(t%360+360)%360}),saturationl:K("hsl",1,ie(100)),lightness:K("hsl",2,ie(100)),saturationv:K("hsv",1,ie(100)),value:K("hsv",2,ie(100)),chroma:K("hcg",1,ie(100)),gray:K("hcg",2,ie(100)),white:K("hwb",1,ie(100)),wblack:K("hwb",2,ie(100)),cyan:K("cmyk",0,ie(100)),magenta:K("cmyk",1,ie(100)),yellow:K("cmyk",2,ie(100)),black:K("cmyk",3,ie(100)),x:K("xyz",0,ie(100)),y:K("xyz",1,ie(100)),z:K("xyz",2,ie(100)),l:K("lab",0,ie(100)),a:K("lab",1),b:K("lab",2),keyword:function(t){return arguments.length?new ue(t):Me[this.model].keyword(this.color)},hex:function(t){return arguments.length?new ue(t):ri.to.hex(this.rgb().round().color)},rgbNumber:function(){var t=this.rgb().color;return(t[0]&255)<<16|(t[1]&255)<<8|t[2]&255},luminosity:function(){for(var t=this.rgb().color,e=[],r=0;r<t.length;r++){var i=t[r]/255;e[r]=i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4)}return .2126*e[0]+.7152*e[1]+.0722*e[2]},contrast:function(t){var e=this.luminosity(),r=t.luminosity();return e>r?(e+.05)/(r+.05):(r+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7.1?"AAA":e>=4.5?"AA":""},isDark:function(){var t=this.rgb().color,e=(t[0]*299+t[1]*587+t[2]*114)/1e3;return e<128},isLight:function(){return!this.isDark()},negate:function(){for(var t=this.rgb(),e=0;e<3;e++)t.color[e]=255-t.color[e];return t},lighten:function(t){var e=this.hsl();return e.color[2]+=e.color[2]*t,e},darken:function(t){var e=this.hsl();return e.color[2]-=e.color[2]*t,e},saturate:function(t){var e=this.hsl();return e.color[1]+=e.color[1]*t,e},desaturate:function(t){var e=this.hsl();return e.color[1]-=e.color[1]*t,e},whiten:function(t){var e=this.hwb();return e.color[1]+=e.color[1]*t,e},blacken:function(t){var e=this.hwb();return e.color[2]+=e.color[2]*t,e},grayscale:function(){var t=this.rgb().color,e=t[0]*.3+t[1]*.59+t[2]*.11;return ue.rgb(e,e,e)},fade:function(t){return this.alpha(this.valpha-this.valpha*t)},opaquer:function(t){return this.alpha(this.valpha+this.valpha*t)},rotate:function(t){var e=this.hsl(),r=e.color[0];return r=(r+t)%360,r=r<0?360+r:r,e.color[0]=r,e},mix:function(t,e){if(!t||!t.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof t);var r=t.rgb(),i=this.rgb(),n=e===void 0?.5:e,s=2*n-1,a=r.alpha()-i.alpha(),o=((s*a===-1?s:(s+a)/(1+s*a))+1)/2,l=1-o;return ue.rgb(o*r.red()+l*i.red(),o*r.green()+l*i.green(),o*r.blue()+l*i.blue(),r.alpha()*n+i.alpha()*(1-n))}};Object.keys(Me).forEach(function(t){if(Nc.indexOf(t)===-1){var e=Me[t].channels;ue.prototype[t]=function(){if(this.model===t)return new ue(this);if(arguments.length)return new ue(arguments,t);var r=typeof arguments[e]=="number"?e:this.valpha;return new ue(t1(Me[this.model][t].raw(this.color)).concat(r),t)},ue[t]=function(r){return typeof r=="number"&&(r=wo(vo.call(arguments),e)),new ue(r,t)}}});function Xv(t,e){return Number(t.toFixed(e))}function e1(t){return function(e){return Xv(e,t)}}function K(t,e,r){return t=Array.isArray(t)?t:[t],t.forEach(function(i){(In[i]||(In[i]=[]))[e]=r}),t=t[0],function(i){var n;return arguments.length?(r&&(i=r(i)),n=this[t](),n.color[e]=i,n):(n=this[t]().color[e],r&&(n=r(n)),n)}}function ie(t){return function(e){return Math.max(0,Math.min(t,e))}}function t1(t){return Array.isArray(t)?t:[t]}function wo(t,e){for(var r=0;r<e;r++)typeof t[r]!="number"&&(t[r]=0);return t}Fc.exports=ue});var Wc=w((Y2,$c)=>{"use strict";$c.exports=function(e){for(var r=0,i=0;r<e.length;i=e.charCodeAt(r++)+((i<<5)-i));var n=Math.floor(Math.abs(Math.sin(i)*1e4%1*16777216)).toString(16);return"#"+Array(6-n.length+1).join("0")+n}});var Hc=w((V2,zc)=>{"use strict";var Bc=Ic(),Uc=Wc();zc.exports=function(e,r){var i=e.split(r||":"),n=Uc(i[0]);if(!i.length)return n;for(var s=0,a=i.length-1;s<a;s++)n=Bc(n).mix(Bc(Uc(i[s+1]))).saturate(1).hex();return n}});var Yc=w((K2,Gc)=>{"use strict";function Ie(t,e){if(e)return new Ie(t).style(e);if(!(this instanceof Ie))return new Ie(t);this.text=t}Ie.prototype.prefix="\x1B[";Ie.prototype.suffix="m";Ie.prototype.hex=function(e){e=e[0]==="#"?e.substring(1):e,e.length===3&&(e=e.split(""),e[5]=e[2],e[4]=e[2],e[3]=e[1],e[2]=e[1],e[1]=e[0],e=e.join(""));var r=e.substring(0,2),i=e.substring(2,4),n=e.substring(4,6);return[parseInt(r,16),parseInt(i,16),parseInt(n,16)]};Ie.prototype.rgb=function(e,r,i){var n=e/255*5,s=r/255*5,a=i/255*5;return this.ansi(n,s,a)};Ie.prototype.ansi=function(e,r,i){var n=Math.round(e),s=Math.round(r),a=Math.round(i);return 16+n*36+s*6+a};Ie.prototype.reset=function(){return this.prefix+"39;49"+this.suffix};Ie.prototype.style=function(e){return this.prefix+"38;5;"+this.rgb.apply(this,this.hex(e))+this.suffix+this.text+this.reset()};Gc.exports=Ie});var Kc=w((J2,Vc)=>{var r1=Hc(),i1=Yc();Vc.exports=function(e,r){var i=r.namespace,n=r.colors!==!1?i1(i+":",r1(i)):i+":";return e[0]=n+" "+e[0],e}});var Zc=w((Z2,Jc)=>{"use strict";Jc.exports=function(e,r){if(!r)return!1;for(var i=r.split(/[\s,]+/),n=0;n<i.length;n++){if(r=i[n].replace("*",".*?"),r.charAt(0)==="-"){if(new RegExp("^"+r.substr(1)+"$").test(e))return!1;continue}if(new RegExp("^"+r+"$").test(e))return!0}return!1}});var Xc=w((Q2,Qc)=>{var n1=Zc();Qc.exports=function(e){return function(i){try{return n1(i,e())}catch{}return!1}}});var td=w((X2,ed)=>{var s1=Xc();ed.exports=s1(function(){return process.env.DEBUG||process.env.DIAGNOSTICS})});var id=w((eR,rd)=>{rd.exports=function(t,e){try{Function.prototype.apply.call(console.log,console,e)}catch{}}});var sd=w((tR,nd)=>{var a1=go(),o1=require("tty").isatty(1),$n=a1(function t(e,r){return r=r||{},r.colors="colors"in r?r.colors:o1,r.namespace=e,r.prod=!1,r.dev=!0,!t.enabled(e)&&!(r.force||t.force)?t.nope(r):t.yep(r)});$n.modify(Kc());$n.use(td());$n.set(id());nd.exports=$n});var ii=w((rR,_o)=>{process.env.NODE_ENV==="production"?_o.exports=gc():_o.exports=sd()});var od=w((iR,ad)=>{"use strict";var So=require("fs"),{StringDecoder:l1}=require("string_decoder"),{Stream:u1}=Yt();function f1(){}ad.exports=(t,e)=>{let r=Buffer.alloc(65536),i=new l1("utf8"),n=new u1,s="",a=0,o=0;return t.start===-1&&delete t.start,n.readable=!0,n.destroy=()=>{n.destroyed=!0,n.emit("end"),n.emit("close")},So.open(t.file,"a+","0644",(l,u)=>{if(l){e?e(l):n.emit("error",l),n.destroy();return}(function h(){if(n.destroyed){So.close(u,f1);return}return So.read(u,r,0,r.length,a,(p,c)=>{if(p){e?e(p):n.emit("error",p),n.destroy();return}if(!c)return s&&((t.start==null||o>t.start)&&(e?e(null,s):n.emit("line",s)),o++,s=""),setTimeout(h,1e3);let f=i.write(r.slice(0,c));e||n.emit("data",f),f=(s+f).split(/\n+/);let y=f.length-1,b=0;for(;b<y;b++)(t.start==null||o>t.start)&&(e?e(null,f[b]):n.emit("line",f[b])),o++;return s=f[y],a+=c,h()})})()}),e?n.destroy:n}});var hd=w((sR,fd)=>{"use strict";var xe=require("fs"),ne=require("path"),ld=dh(),h1=require("zlib"),{MESSAGE:c1}=re(),{Stream:d1,PassThrough:ud}=Yt(),p1=ur(),$e=ii()("winston:file"),g1=require("os"),m1=od();fd.exports=class extends p1{constructor(e={}){super(e),this.name=e.name||"file";function r(i,...n){n.slice(1).forEach(s=>{if(e[s])throw new Error(`Cannot set ${s} and ${i} together`)})}if(this._stream=new ud,this._stream.setMaxListeners(30),this._onError=this._onError.bind(this),e.filename||e.dirname)r("filename or dirname","stream"),this._basename=this.filename=e.filename?ne.basename(e.filename):"winston.log",this.dirname=e.dirname||ne.dirname(e.filename),this.options=e.options||{flags:"a"};else if(e.stream)console.warn("options.stream will be removed in winston@4. Use winston.transports.Stream"),r("stream","filename","maxsize"),this._dest=this._stream.pipe(this._setupStream(e.stream)),this.dirname=ne.dirname(this._dest.path);else throw new Error("Cannot log to file without filename or stream.");this.maxsize=e.maxsize||null,this.rotationFormat=e.rotationFormat||!1,this.zippedArchive=e.zippedArchive||!1,this.maxFiles=e.maxFiles||null,this.eol=typeof e.eol=="string"?e.eol:g1.EOL,this.tailable=e.tailable||!1,this.lazy=e.lazy||!1,this._size=0,this._pendingSize=0,this._created=0,this._drain=!1,this._opening=!1,this._ending=!1,this._fileExist=!1,this.dirname&&this._createLogDirIfNotExist(this.dirname),this.lazy||this.open()}finishIfEnding(){this._ending&&(this._opening?this.once("open",()=>{this._stream.once("finish",()=>this.emit("finish")),setImmediate(()=>this._stream.end())}):(this._stream.once("finish",()=>this.emit("finish")),setImmediate(()=>this._stream.end())))}log(e,r=()=>{}){if(this.silent)return r(),!0;if(this._drain){this._stream.once("drain",()=>{this._drain=!1,this.log(e,r)});return}if(this._rotate){this._stream.once("rotate",()=>{this._rotate=!1,this.log(e,r)});return}if(this.lazy){if(!this._fileExist){this._opening||this.open(),this.once("open",()=>{this._fileExist=!0,this.log(e,r)});return}if(this._needsNewFile(this._pendingSize)){this._dest.once("close",()=>{this._opening||this.open(),this.once("open",()=>{this.log(e,r)})});return}}let i=`${e[c1]}${this.eol}`,n=Buffer.byteLength(i);function s(){if(this._size+=n,this._pendingSize-=n,$e("logged %s %s",this._size,i),this.emit("logged",e),!this._rotate&&!this._opening&&this._needsNewFile()){if(this.lazy){this._endStream(()=>{this.emit("fileclosed")});return}this._rotate=!0,this._endStream(()=>this._rotateFile())}}this._pendingSize+=n,this._opening&&!this.rotatedWhileOpening&&this._needsNewFile(this._size+this._pendingSize)&&(this.rotatedWhileOpening=!0);let a=this._stream.write(i,s.bind(this));return a?r():(this._drain=!0,this._stream.once("drain",()=>{this._drain=!1,r()})),$e("written",a,this._drain),this.finishIfEnding(),a}query(e,r){typeof e=="function"&&(r=e,e={}),e=p(e);let i=ne.join(this.dirname,this.filename),n="",s=[],a=0,o=xe.createReadStream(i,{encoding:"utf8"});o.on("error",c=>{if(o.readable&&o.destroy(),!!r)return c.code!=="ENOENT"?r(c):r(null,s)}),o.on("data",c=>{c=(n+c).split(/\n+/);let f=c.length-1,y=0;for(;y<f;y++)(!e.start||a>=e.start)&&l(c[y]),a++;n=c[f]}),o.on("close",()=>{n&&l(n,!0),e.order==="desc"&&(s=s.reverse()),r&&r(null,s)});function l(c,f){try{let y=JSON.parse(c);h(y)&&u(y)}catch(y){f||o.emit("error",y)}}function u(c){if(e.rows&&s.length>=e.rows&&e.order!=="desc"){o.readable&&o.destroy();return}e.fields&&(c=e.fields.reduce((f,y)=>(f[y]=c[y],f),{})),e.order==="desc"&&s.length>=e.rows&&s.shift(),s.push(c)}function h(c){if(!c||typeof c!="object")return;let f=new Date(c.timestamp);if(!(e.from&&f<e.from||e.until&&f>e.until||e.level&&e.level!==c.level))return!0}function p(c){return c=c||{},c.rows=c.rows||c.limit||10,c.start=c.start||0,c.until=c.until||new Date,typeof c.until!="object"&&(c.until=new Date(c.until)),c.from=c.from||c.until-24*60*60*1e3,typeof c.from!="object"&&(c.from=new Date(c.from)),c.order=c.order||"desc",c}}stream(e={}){let r=ne.join(this.dirname,this.filename),i=new d1,n={file:r,start:e.start};return i.destroy=m1(n,(s,a)=>{if(s)return i.emit("error",s);try{i.emit("data",a),a=JSON.parse(a),i.emit("log",a)}catch(o){i.emit("error",o)}}),i}open(){this.filename&&(this._opening||(this._opening=!0,this.stat((e,r)=>{if(e)return this.emit("error",e);$e("stat done: %s { size: %s }",this.filename,r),this._size=r,this._dest=this._createStream(this._stream),this._opening=!1,this.once("open",()=>{this._stream.eventNames().includes("rotate")?this._stream.emit("rotate"):this._rotate=!1})})))}stat(e){let r=this._getFile(),i=ne.join(this.dirname,r);xe.stat(i,(n,s)=>{if(n&&n.code==="ENOENT")return $e("ENOENT\xA0ok",i),this.filename=r,e(null,0);if(n)return $e(`err ${n.code} ${i}`),e(n);if(!s||this._needsNewFile(s.size))return this._incFile(()=>this.stat(e));this.filename=r,e(null,s.size)})}close(e){this._stream&&this._stream.end(()=>{e&&e(),this.emit("flush"),this.emit("closed")})}_needsNewFile(e){return e=e||this._size,this.maxsize&&e>=this.maxsize}_onError(e){this.emit("error",e)}_setupStream(e){return e.on("error",this._onError),e}_cleanupStream(e){return e.removeListener("error",this._onError),e.destroy(),e}_rotateFile(){this._incFile(()=>this.open())}_endStream(e=()=>{}){this._dest?(this._stream.unpipe(this._dest),this._dest.end(()=>{this._cleanupStream(this._dest),e()})):e()}_createStream(e){let r=ne.join(this.dirname,this.filename);$e("create stream start",r,this.options);let i=xe.createWriteStream(r,this.options).on("error",n=>$e(n)).on("close",()=>$e("close",i.path,i.bytesWritten)).on("open",()=>{$e("file open ok",r),this.emit("open",r),e.pipe(i),this.rotatedWhileOpening&&(this._stream=new ud,this._stream.setMaxListeners(30),this._rotateFile(),this.rotatedWhileOpening=!1,this._cleanupStream(i),e.end())});return $e("create stream ok",r),i}_incFile(e){$e("_incFile",this.filename);let r=ne.extname(this._basename),i=ne.basename(this._basename,r),n=[];this.zippedArchive&&n.push(function(s){let a=this._created>0&&!this.tailable?this._created:"";this._compressFile(ne.join(this.dirname,`${i}${a}${r}`),ne.join(this.dirname,`${i}${a}${r}.gz`),s)}.bind(this)),n.push(function(s){this.tailable?this._checkMaxFilesTailable(r,i,s):(this._created+=1,this._checkMaxFilesIncrementing(r,i,s))}.bind(this)),ld(n,e)}_getFile(){let e=ne.extname(this._basename),r=ne.basename(this._basename,e),i=this.rotationFormat?this.rotationFormat():this._created;return!this.tailable&&this._created?`${r}${i}${e}`:`${r}${e}`}_checkMaxFilesIncrementing(e,r,i){if(!this.maxFiles||this._created<this.maxFiles)return setImmediate(i);let n=this._created-this.maxFiles,s=n!==0?n:"",a=this.zippedArchive?".gz":"",o=`${r}${s}${e}${a}`,l=ne.join(this.dirname,o);xe.unlink(l,i)}_checkMaxFilesTailable(e,r,i){let n=[];if(!this.maxFiles)return;let s=this.zippedArchive?".gz":"";for(let a=this.maxFiles-1;a>1;a--)n.push(function(o,l){let u=`${r}${o-1}${e}${s}`,h=ne.join(this.dirname,u);xe.exists(h,p=>{if(!p)return l(null);u=`${r}${o}${e}${s}`,xe.rename(h,ne.join(this.dirname,u),l)})}.bind(this,a));ld(n,()=>{xe.rename(ne.join(this.dirname,`${r}${e}${s}`),ne.join(this.dirname,`${r}1${e}${s}`),i)})}_compressFile(e,r,i){xe.access(e,xe.F_OK,n=>{if(n)return i();var s=h1.createGzip(),a=xe.createReadStream(e),o=xe.createWriteStream(r);o.on("finish",()=>{xe.unlink(e,i)}),a.pipe(s).pipe(o)})}_createLogDirIfNotExist(e){xe.existsSync(e)||xe.mkdirSync(e,{recursive:!0})}}});var dd=w((oR,cd)=>{"use strict";var y1=require("http"),b1=require("https"),{Stream:w1}=Yt(),v1=ur(),{configure:_1}=Pr();cd.exports=class extends v1{constructor(e={}){super(e),this.options=e,this.name=e.name||"http",this.ssl=!!e.ssl,this.host=e.host||"localhost",this.port=e.port,this.auth=e.auth,this.path=e.path||"",this.maximumDepth=e.maximumDepth,this.agent=e.agent,this.headers=e.headers||{},this.headers["content-type"]="application/json",this.batch=e.batch||!1,this.batchInterval=e.batchInterval||5e3,this.batchCount=e.batchCount||10,this.batchOptions=[],this.batchTimeoutID=-1,this.batchCallback={},this.port||(this.port=this.ssl?443:80)}log(e,r){this._request(e,null,null,(i,n)=>{n&&n.statusCode!==200&&(i=new Error(`Invalid HTTP Status Code: ${n.statusCode}`)),i?this.emit("warn",i):this.emit("logged",e)}),r&&setImmediate(r)}query(e,r){typeof e=="function"&&(r=e,e={}),e={method:"query",params:this.normalizeQuery(e)};let i=e.params.auth||null;delete e.params.auth;let n=e.params.path||null;delete e.params.path,this._request(e,i,n,(s,a,o)=>{if(a&&a.statusCode!==200&&(s=new Error(`Invalid HTTP Status Code: ${a.statusCode}`)),s)return r(s);if(typeof o=="string")try{o=JSON.parse(o)}catch(l){return r(l)}r(null,o)})}stream(e={}){let r=new w1;e={method:"stream",params:e};let i=e.params.path||null;delete e.params.path;let n=e.params.auth||null;delete e.params.auth;let s="",a=this._request(e,n,i);return r.destroy=()=>a.destroy(),a.on("data",o=>{o=(s+o).split(/\n+/);let l=o.length-1,u=0;for(;u<l;u++)try{r.emit("log",JSON.parse(o[u]))}catch(h){r.emit("error",h)}s=o[l]}),a.on("error",o=>r.emit("error",o)),r}_request(e,r,i,n){e=e||{},r=r||this.auth,i=i||this.path||"",this.batch?this._doBatch(e,n,r,i):this._doRequest(e,n,r,i)}_doBatch(e,r,i,n){if(this.batchOptions.push(e),this.batchOptions.length===1){let s=this;this.batchCallback=r,this.batchTimeoutID=setTimeout(function(){s.batchTimeoutID=-1,s._doBatchRequest(s.batchCallback,i,n)},this.batchInterval)}this.batchOptions.length===this.batchCount&&this._doBatchRequest(this.batchCallback,i,n)}_doBatchRequest(e,r,i){this.batchTimeoutID>0&&(clearTimeout(this.batchTimeoutID),this.batchTimeoutID=-1);let n=this.batchOptions.slice();this.batchOptions=[],this._doRequest(n,e,r,i)}_doRequest(e,r,i,n){let s=Object.assign({},this.headers);i&&i.bearer&&(s.Authorization=`Bearer ${i.bearer}`);let a=(this.ssl?b1:y1).request({...this.options,method:"POST",host:this.host,port:this.port,path:`/${n.replace(/^\//,"")}`,headers:s,auth:i&&i.username&&i.password?`${i.username}:${i.password}`:"",agent:this.agent});a.on("error",r),a.on("response",l=>l.on("end",()=>r(null,l)).resume());let o=_1({...this.maximumDepth&&{maximumDepth:this.maximumDepth}});a.end(Buffer.from(o(e,this.options.replacer),"utf8"))}}});var Eo=w((lR,pd)=>{"use strict";var Ke=t=>t!==null&&typeof t=="object"&&typeof t.pipe=="function";Ke.writable=t=>Ke(t)&&t.writable!==!1&&typeof t._write=="function"&&typeof t._writableState=="object";Ke.readable=t=>Ke(t)&&t.readable!==!1&&typeof t._read=="function"&&typeof t._readableState=="object";Ke.duplex=t=>Ke.writable(t)&&Ke.readable(t);Ke.transform=t=>Ke.duplex(t)&&typeof t._transform=="function";pd.exports=Ke});var md=w((fR,gd)=>{"use strict";var S1=Eo(),{MESSAGE:E1}=re(),R1=require("os"),x1=ur();gd.exports=class extends x1{constructor(e={}){if(super(e),!e.stream||!S1(e.stream))throw new Error("options.stream is required.");this._stream=e.stream,this._stream.setMaxListeners(1/0),this.isObjectMode=e.stream._writableState.objectMode,this.eol=typeof e.eol=="string"?e.eol:R1.EOL}log(e,r){if(setImmediate(()=>this.emit("logged",e)),this.isObjectMode){this._stream.write(e),r&&r();return}this._stream.write(`${e[E1]}${this.eol}`),r&&r()}}});var yd=w(ni=>{"use strict";Object.defineProperty(ni,"Console",{configurable:!0,enumerable:!0,get(){return Pf()}});Object.defineProperty(ni,"File",{configurable:!0,enumerable:!0,get(){return hd()}});Object.defineProperty(ni,"Http",{configurable:!0,enumerable:!0,get(){return dd()}});Object.defineProperty(ni,"Stream",{configurable:!0,enumerable:!0,get(){return md()}})});var Bn=w(si=>{"use strict";var Wn=Js(),{configs:Ro}=re();si.cli=Wn.levels(Ro.cli);si.npm=Wn.levels(Ro.npm);si.syslog=Wn.levels(Ro.syslog);si.addColors=Wn.levels});var wd=w((Un,bd)=>{"use strict";Object.defineProperty(Un,"__esModule",{value:!0});var T1=sn(),O1=Kt(T1),M1=gn(),k1=Kt(M1),A1=La(),P1=Kt(A1),D1=Da(),q1=Kt(D1),C1=qa(),L1=Kt(C1),j1=Bt(),N1=Kt(j1),F1=hr(),I1=Kt(F1);function Kt(t){return t&&t.__esModule?t:{default:t}}function $1(t,e,r){r=(0,q1.default)(r);var i=0,n=0,{length:s}=t,a=!1;s===0&&r(null);function o(l,u){l===!1&&(a=!0),a!==!0&&(l?r(l):(++n===s||u===k1.default)&&r(null))}for(;i<s;i++)e(t[i],i,(0,L1.default)(o))}function W1(t,e,r){return(0,P1.default)(t,1/0,e,r)}function B1(t,e,r){var i=(0,O1.default)(t)?$1:W1;return i(t,(0,N1.default)(e),r)}Un.default=(0,I1.default)(B1,3);bd.exports=Un.default});var _d=w((zn,vd)=>{"use strict";Object.defineProperty(zn,"__esModule",{value:!0});zn.default=U1;function U1(t){return(e,r,i)=>t(e,i)}vd.exports=zn.default});var Yn=w((Gn,Sd)=>{"use strict";Object.defineProperty(Gn,"__esModule",{value:!0});var z1=wd(),H1=Hn(z1),G1=_d(),Y1=Hn(G1),V1=Bt(),K1=Hn(V1),J1=hr(),Z1=Hn(J1);function Hn(t){return t&&t.__esModule?t:{default:t}}function Q1(t,e,r){return(0,H1.default)(t,(0,Y1.default)((0,K1.default)(e)),r)}Gn.default=(0,Z1.default)(Q1,3);Sd.exports=Gn.default});var Rd=w((dR,Ed)=>{"use strict";var X1=Object.prototype.toString;Ed.exports=function(e){if(typeof e.displayName=="string"&&e.constructor.name)return e.displayName;if(typeof e.name=="string"&&e.name)return e.name;if(typeof e=="object"&&e.constructor&&typeof e.constructor.name=="string")return e.constructor.name;var r=e.toString(),i=X1.call(e).slice(8,-1);return i==="Function"?r=r.substring(r.indexOf("(")+1,r.indexOf(")")):r=i,r||"anonymous"}});var xo=w((pR,xd)=>{"use strict";var e_=Rd();xd.exports=function(e){var r=0,i;function n(){return r||(r=1,i=e.apply(this,arguments),e=null),i}return n.displayName=e_(e),n}});var To=w(oi=>{oi.get=function(t){var e=Error.stackTraceLimit;Error.stackTraceLimit=1/0;var r={},i=Error.prepareStackTrace;Error.prepareStackTrace=function(s,a){return a},Error.captureStackTrace(r,t||oi.get);var n=r.stack;return Error.prepareStackTrace=i,Error.stackTraceLimit=e,n};oi.parse=function(t){if(!t.stack)return[];var e=this,r=t.stack.split(`
|
|
28
|
+
`).slice(1);return r.map(function(i){if(i.match(/^\s*[-]{4,}$/))return e._createParsedCallSite({fileName:i,lineNumber:null,functionName:null,typeName:null,methodName:null,columnNumber:null,native:null});var n=i.match(/at (?:(.+)\s+\()?(?:(.+?):(\d+)(?::(\d+))?|([^)]+))\)?/);if(n){var s=null,a=null,o=null,l=null,u=null,h=n[5]==="native";if(n[1]){o=n[1];var p=o.lastIndexOf(".");if(o[p-1]=="."&&p--,p>0){s=o.substr(0,p),a=o.substr(p+1);var c=s.indexOf(".Module");c>0&&(o=o.substr(c+1),s=s.substr(0,c))}l=null}a&&(l=s,u=a),a==="<anonymous>"&&(u=null,o=null);var f={fileName:n[2]||null,lineNumber:parseInt(n[3],10)||null,functionName:o,typeName:l,methodName:u,columnNumber:parseInt(n[4],10)||null,native:h};return e._createParsedCallSite(f)}}).filter(function(i){return!!i})};function ai(t){for(var e in t)this[e]=t[e]}var t_=["this","typeName","functionName","methodName","fileName","lineNumber","columnNumber","function","evalOrigin"],r_=["topLevel","eval","native","constructor"];t_.forEach(function(t){ai.prototype[t]=null,ai.prototype["get"+t[0].toUpperCase()+t.substr(1)]=function(){return this[t]}});r_.forEach(function(t){ai.prototype[t]=!1,ai.prototype["is"+t[0].toUpperCase()+t.substr(1)]=function(){return this[t]}});oi._createParsedCallSite=function(t){return new ai(t)}});var Od=w((yR,Td)=>{"use strict";var{Writable:i_}=Yt();Td.exports=class extends i_{constructor(e){if(super({objectMode:!0}),!e)throw new Error("ExceptionStream requires a TransportStream instance.");this.handleExceptions=!0,this.transport=e}_write(e,r,i){return e.exception?this.transport.log(e,i):(i(),!0)}}});var Mo=w((wR,Ad)=>{"use strict";var Md=require("os"),n_=Yn(),Oo=ii()("winston:exception"),s_=xo(),kd=To(),a_=Od();Ad.exports=class{constructor(e){if(!e)throw new Error("Logger is required to handle exceptions");this.logger=e,this.handlers=new Map}handle(...e){e.forEach(r=>{if(Array.isArray(r))return r.forEach(i=>this._addHandler(i));this._addHandler(r)}),this.catcher||(this.catcher=this._uncaughtException.bind(this),process.on("uncaughtException",this.catcher))}unhandle(){this.catcher&&(process.removeListener("uncaughtException",this.catcher),this.catcher=!1,Array.from(this.handlers.values()).forEach(e=>this.logger.unpipe(e)))}getAllInfo(e){let r=null;return e&&(r=typeof e=="string"?e:e.message),{error:e,level:"error",message:[`uncaughtException: ${r||"(no error message)"}`,e&&e.stack||" No stack trace"].join(`
|
|
29
|
+
`),stack:e&&e.stack,exception:!0,date:new Date().toString(),process:this.getProcessInfo(),os:this.getOsInfo(),trace:this.getTrace(e)}}getProcessInfo(){return{pid:process.pid,uid:process.getuid?process.getuid():null,gid:process.getgid?process.getgid():null,cwd:process.cwd(),execPath:process.execPath,version:process.version,argv:process.argv,memoryUsage:process.memoryUsage()}}getOsInfo(){return{loadavg:Md.loadavg(),uptime:Md.uptime()}}getTrace(e){return(e?kd.parse(e):kd.get()).map(i=>({column:i.getColumnNumber(),file:i.getFileName(),function:i.getFunctionName(),line:i.getLineNumber(),method:i.getMethodName(),native:i.isNative()}))}_addHandler(e){if(!this.handlers.has(e)){e.handleExceptions=!0;let r=new a_(e);this.handlers.set(e,r),this.logger.pipe(r)}}_uncaughtException(e){let r=this.getAllInfo(e),i=this._getExceptionHandlers(),n=typeof this.logger.exitOnError=="function"?this.logger.exitOnError(e):this.logger.exitOnError,s;!i.length&&n&&(console.warn("winston: exitOnError cannot be true with no exception handlers."),console.warn("winston: not exiting process."),n=!1);function a(){Oo("doExit",n),Oo("process._exiting",process._exiting),n&&!process._exiting&&(s&&clearTimeout(s),process.exit(1))}if(!i||i.length===0)return process.nextTick(a);n_(i,(o,l)=>{let u=s_(l),h=o.transport||o;function p(c){return()=>{Oo(c),u()}}h._ending=!0,h.once("finish",p("finished")),h.once("error",p("error"))},()=>n&&a()),this.logger.log(r),n&&(s=setTimeout(a,3e3))}_getExceptionHandlers(){return this.logger.transports.filter(e=>(e.transport||e).handleExceptions)}}});var Dd=w((_R,Pd)=>{"use strict";var{Writable:o_}=Yt();Pd.exports=class extends o_{constructor(e){if(super({objectMode:!0}),!e)throw new Error("RejectionStream requires a TransportStream instance.");this.handleRejections=!0,this.transport=e}_write(e,r,i){return e.rejection?this.transport.log(e,i):(i(),!0)}}});var Ao=w((ER,Ld)=>{"use strict";var qd=require("os"),l_=Yn(),ko=ii()("winston:rejection"),u_=xo(),Cd=To(),f_=Dd();Ld.exports=class{constructor(e){if(!e)throw new Error("Logger is required to handle rejections");this.logger=e,this.handlers=new Map}handle(...e){e.forEach(r=>{if(Array.isArray(r))return r.forEach(i=>this._addHandler(i));this._addHandler(r)}),this.catcher||(this.catcher=this._unhandledRejection.bind(this),process.on("unhandledRejection",this.catcher))}unhandle(){this.catcher&&(process.removeListener("unhandledRejection",this.catcher),this.catcher=!1,Array.from(this.handlers.values()).forEach(e=>this.logger.unpipe(e)))}getAllInfo(e){let r=null;return e&&(r=typeof e=="string"?e:e.message),{error:e,level:"error",message:[`unhandledRejection: ${r||"(no error message)"}`,e&&e.stack||" No stack trace"].join(`
|
|
30
|
+
`),stack:e&&e.stack,rejection:!0,date:new Date().toString(),process:this.getProcessInfo(),os:this.getOsInfo(),trace:this.getTrace(e)}}getProcessInfo(){return{pid:process.pid,uid:process.getuid?process.getuid():null,gid:process.getgid?process.getgid():null,cwd:process.cwd(),execPath:process.execPath,version:process.version,argv:process.argv,memoryUsage:process.memoryUsage()}}getOsInfo(){return{loadavg:qd.loadavg(),uptime:qd.uptime()}}getTrace(e){return(e?Cd.parse(e):Cd.get()).map(i=>({column:i.getColumnNumber(),file:i.getFileName(),function:i.getFunctionName(),line:i.getLineNumber(),method:i.getMethodName(),native:i.isNative()}))}_addHandler(e){if(!this.handlers.has(e)){e.handleRejections=!0;let r=new f_(e);this.handlers.set(e,r),this.logger.pipe(r)}}_unhandledRejection(e){let r=this.getAllInfo(e),i=this._getRejectionHandlers(),n=typeof this.logger.exitOnError=="function"?this.logger.exitOnError(e):this.logger.exitOnError,s;!i.length&&n&&(console.warn("winston: exitOnError cannot be true with no rejection handlers."),console.warn("winston: not exiting process."),n=!1);function a(){ko("doExit",n),ko("process._exiting",process._exiting),n&&!process._exiting&&(s&&clearTimeout(s),process.exit(1))}if(!i||i.length===0)return process.nextTick(a);l_(i,(o,l)=>{let u=u_(l),h=o.transport||o;function p(c){return()=>{ko(c),u()}}h._ending=!0,h.once("finish",p("finished")),h.once("error",p("error"))},()=>n&&a()),this.logger.log(r),n&&(s=setTimeout(a,3e3))}_getRejectionHandlers(){return this.logger.transports.filter(e=>(e.transport||e).handleRejections)}}});var Nd=w((RR,jd)=>{"use strict";var Po=class{constructor(e){let r=Vn();if(typeof e!="object"||Array.isArray(e)||!(e instanceof r))throw new Error("Logger is required for profiling");this.logger=e,this.start=Date.now()}done(...e){typeof e[e.length-1]=="function"&&(console.warn("Callback function no longer supported as of winston@3.0.0"),e.pop());let r=typeof e[e.length-1]=="object"?e.pop():{};return r.level=r.level||"info",r.durationMs=Date.now()-this.start,this.logger.write(r)}};jd.exports=Po});var Vn=w((xR,Wd)=>{"use strict";var{Stream:h_,Transform:c_}=Yt(),Fd=Yn(),{LEVEL:Je,SPLAT:Id}=re(),$d=Eo(),d_=Mo(),p_=Ao(),g_=ka(),m_=Nd(),{warn:y_}=Zs(),b_=Bn(),w_=/%[scdjifoO%]/g,Kn=class extends c_{constructor(e){super({objectMode:!0}),this.configure(e)}child(e){let r=this;return Object.create(r,{write:{value:function(i){let n=Object.assign({},e,i);i instanceof Error&&(n.stack=i.stack,n.message=i.message),r.write(n)}}})}configure({silent:e,format:r,defaultMeta:i,levels:n,level:s="info",exitOnError:a=!0,transports:o,colors:l,emitErrs:u,formatters:h,padLevels:p,rewriters:c,stripColors:f,exceptionHandlers:y,rejectionHandlers:b}={}){if(this.transports.length&&this.clear(),this.silent=e,this.format=r||this.format||Hs()(),this.defaultMeta=i||null,this.levels=n||this.levels||b_.npm.levels,this.level=s,this.exceptions&&this.exceptions.unhandle(),this.rejections&&this.rejections.unhandle(),this.exceptions=new d_(this),this.rejections=new p_(this),this.profilers={},this.exitOnError=a,o&&(o=Array.isArray(o)?o:[o],o.forEach(S=>this.add(S))),l||u||h||p||c||f)throw new Error(["{ colors, emitErrs, formatters, padLevels, rewriters, stripColors } were removed in winston@3.0.0.","Use a custom winston.format(function) instead.","See: https://github.com/winstonjs/winston/tree/master/UPGRADE-3.0.md"].join(`
|
|
31
|
+
`));y&&this.exceptions.handle(y),b&&this.rejections.handle(b)}isLevelEnabled(e){let r=Do(this.levels,e);if(r===null)return!1;let i=Do(this.levels,this.level);return i===null?!1:!this.transports||this.transports.length===0?i>=r:this.transports.findIndex(s=>{let a=Do(this.levels,s.level);return a===null&&(a=i),a>=r})!==-1}log(e,r,...i){if(arguments.length===1)return e[Je]=e.level,this._addDefaultMeta(e),this.write(e),this;if(arguments.length===2)return r&&typeof r=="object"?(r[Je]=r.level=e,this._addDefaultMeta(r),this.write(r),this):(r={[Je]:e,level:e,message:r},this._addDefaultMeta(r),this.write(r),this);let[n]=i;if(typeof n=="object"&&n!==null&&!(r&&r.match&&r.match(w_))){let a=Object.assign({},this.defaultMeta,n,{[Je]:e,[Id]:i,level:e,message:r});return n.message&&(a.message=`${a.message} ${n.message}`),n.stack&&(a.stack=n.stack),this.write(a),this}return this.write(Object.assign({},this.defaultMeta,{[Je]:e,[Id]:i,level:e,message:r})),this}_transform(e,r,i){if(this.silent)return i();e[Je]||(e[Je]=e.level),!this.levels[e[Je]]&&this.levels[e[Je]]!==0&&console.error("[winston] Unknown logger level: %s",e[Je]),this._readableState.pipes||console.error("[winston] Attempt to write logs with no transports, which can increase memory usage: %j",e);try{this.push(this.format.transform(e,this.format.options))}finally{this._writableState.sync=!1,i()}}_final(e){let r=this.transports.slice();Fd(r,(i,n)=>{if(!i||i.finished)return setImmediate(n);i.once("finish",n),i.end()},e)}add(e){let r=!$d(e)||e.log.length>2?new g_({transport:e}):e;if(!r._writableState||!r._writableState.objectMode)throw new Error("Transports must WritableStreams in objectMode. Set { objectMode: true }.");return this._onEvent("error",r),this._onEvent("warn",r),this.pipe(r),e.handleExceptions&&this.exceptions.handle(),e.handleRejections&&this.rejections.handle(),this}remove(e){if(!e)return this;let r=e;return(!$d(e)||e.log.length>2)&&(r=this.transports.filter(i=>i.transport===e)[0]),r&&this.unpipe(r),this}clear(){return this.unpipe(),this}close(){return this.exceptions.unhandle(),this.rejections.unhandle(),this.clear(),this.emit("close"),this}setLevels(){y_.deprecated("setLevels")}query(e,r){typeof e=="function"&&(r=e,e={}),e=e||{};let i={},n=Object.assign({},e.query||{});function s(o,l){e.query&&typeof o.formatQuery=="function"&&(e.query=o.formatQuery(n)),o.query(e,(u,h)=>{if(u)return l(u);typeof o.formatResults=="function"&&(h=o.formatResults(h,e.format)),l(null,h)})}function a(o,l){s(o,(u,h)=>{l&&(h=u||h,h&&(i[o.name]=h),l()),l=null})}Fd(this.transports.filter(o=>!!o.query),a,()=>r(null,i))}stream(e={}){let r=new h_,i=[];return r._streams=i,r.destroy=()=>{let n=i.length;for(;n--;)i[n].destroy()},this.transports.filter(n=>!!n.stream).forEach(n=>{let s=n.stream(e);s&&(i.push(s),s.on("log",a=>{a.transport=a.transport||[],a.transport.push(n.name),r.emit("log",a)}),s.on("error",a=>{a.transport=a.transport||[],a.transport.push(n.name),r.emit("error",a)}))}),r}startTimer(){return new m_(this)}profile(e,...r){let i=Date.now();if(this.profilers[e]){let n=this.profilers[e];delete this.profilers[e],typeof r[r.length-2]=="function"&&(console.warn("Callback function no longer supported as of winston@3.0.0"),r.pop());let s=typeof r[r.length-1]=="object"?r.pop():{};return s.level=s.level||"info",s.durationMs=i-n,s.message=s.message||e,this.write(s)}return this.profilers[e]=i,this}handleExceptions(...e){console.warn("Deprecated: .handleExceptions() will be removed in winston@4. Use .exceptions.handle()"),this.exceptions.handle(...e)}unhandleExceptions(...e){console.warn("Deprecated: .unhandleExceptions() will be removed in winston@4. Use .exceptions.unhandle()"),this.exceptions.unhandle(...e)}cli(){throw new Error(["Logger.cli() was removed in winston@3.0.0","Use a custom winston.formats.cli() instead.","See: https://github.com/winstonjs/winston/tree/master/UPGRADE-3.0.md"].join(`
|
|
32
|
+
`))}_onEvent(e,r){function i(n){e==="error"&&!this.transports.includes(r)&&this.add(r),this.emit(e,n,r)}r["__winston"+e]||(r["__winston"+e]=i.bind(this),r.on(e,r["__winston"+e]))}_addDefaultMeta(e){this.defaultMeta&&Object.assign(e,this.defaultMeta)}};function Do(t,e){let r=t[e];return!r&&r!==0?null:r}Object.defineProperty(Kn.prototype,"transports",{configurable:!1,enumerable:!0,get(){let{pipes:t}=this._readableState;return Array.isArray(t)?t:[t].filter(Boolean)}});Wd.exports=Kn});var qo=w((TR,Bd)=>{"use strict";var{LEVEL:v_}=re(),__=Bn(),S_=Vn(),E_=ii()("winston:create-logger");function R_(t){return"is"+t.charAt(0).toUpperCase()+t.slice(1)+"Enabled"}Bd.exports=function(t={}){t.levels=t.levels||__.npm.levels;class e extends S_{constructor(n){super(n)}}let r=new e(t);return Object.keys(t.levels).forEach(function(i){if(E_('Define prototype method for "%s"',i),i==="log"){console.warn('Level "log" not defined: conflicts with the method "log". Use a different level name.');return}e.prototype[i]=function(...n){let s=this||r;if(n.length===1){let[a]=n,o=a&&a.message&&a||{message:a};return o.level=o[v_]=i,s._addDefaultMeta(o),s.write(o),this||r}return n.length===0?(s.log(i,""),s):s.log(i,...n)},e.prototype[R_(i)]=function(){return(this||r).isLevelEnabled(i)}}),r}});var zd=w((MR,Ud)=>{"use strict";var x_=qo();Ud.exports=class{constructor(e={}){this.loggers=new Map,this.options=e}add(e,r){if(!this.loggers.has(e)){r=Object.assign({},r||this.options);let i=r.transports||this.options.transports;i?r.transports=Array.isArray(i)?i.slice():[i]:r.transports=[];let n=x_(r);n.on("close",()=>this._delete(e)),this.loggers.set(e,n)}return this.loggers.get(e)}get(e,r){return this.add(e,r)}has(e){return!!this.loggers.has(e)}close(e){if(e)return this._removeLogger(e);this.loggers.forEach((r,i)=>this._removeLogger(i))}_removeLogger(e){if(!this.loggers.has(e))return;this.loggers.get(e).close(),this._delete(e)}_delete(e){this.loggers.delete(e)}}});var Gd=w(H=>{"use strict";var Hd=Js(),{warn:li}=Zs();H.version=Mu().version;H.transports=yd();H.config=Bn();H.addColors=Hd.levels;H.format=Hd.format;H.createLogger=qo();H.Logger=Vn();H.ExceptionHandler=Mo();H.RejectionHandler=Ao();H.Container=zd();H.Transport=ur();H.loggers=new H.Container;var Ze=H.createLogger();Object.keys(H.config.npm.levels).concat(["log","query","stream","add","remove","clear","profile","startTimer","handleExceptions","unhandleExceptions","handleRejections","unhandleRejections","configure","child"]).forEach(t=>H[t]=(...e)=>Ze[t](...e));Object.defineProperty(H,"level",{get(){return Ze.level},set(t){Ze.level=t}});Object.defineProperty(H,"exceptions",{get(){return Ze.exceptions}});Object.defineProperty(H,"rejections",{get(){return Ze.rejections}});["exitOnError"].forEach(t=>{Object.defineProperty(H,t,{get(){return Ze[t]},set(e){Ze[t]=e}})});Object.defineProperty(H,"default",{get(){return{exceptionHandlers:Ze.exceptionHandlers,rejectionHandlers:Ze.rejectionHandlers,transports:Ze.transports}}});li.deprecated(H,"setLevels");li.forFunctions(H,"useFormat",["cli"]);li.forProperties(H,"useFormat",["padLevels","stripColors"]);li.forFunctions(H,"deprecated",["addRewriter","addFilter","clone","extend"]);li.forProperties(H,"deprecated",["emitErrs","levelLength"])});var Zn=w((Jn,Vd)=>{(function(t,e){typeof Jn=="object"&&typeof Vd<"u"?e(Jn):typeof define=="function"&&define.amd?define(["exports"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.Superstruct={}))})(Jn,function(t){"use strict";class e extends TypeError{constructor(g,m){let v,{message:T,explanation:q,...z}=g,{path:Z}=g,Q=Z.length===0?T:`At path: ${Z.join(".")} -- ${T}`;super(q??Q),q!=null&&(this.cause=Q),Object.assign(this,z),this.name=this.constructor.name,this.failures=()=>v??(v=[g,...m()])}}function r(d){return i(d)&&typeof d[Symbol.iterator]=="function"}function i(d){return typeof d=="object"&&d!=null}function n(d){if(Object.prototype.toString.call(d)!=="[object Object]")return!1;let g=Object.getPrototypeOf(d);return g===null||g===Object.prototype}function s(d){return typeof d=="symbol"?d.toString():typeof d=="string"?JSON.stringify(d):`${d}`}function a(d){let{done:g,value:m}=d.next();return g?void 0:m}function o(d,g,m,v){if(d===!0)return;d===!1?d={}:typeof d=="string"&&(d={message:d});let{path:T,branch:q}=g,{type:z}=m,{refinement:Z,message:Q=`Expected a value of type \`${z}\`${Z?` with refinement \`${Z}\``:""}, but received: \`${s(v)}\``}=d;return{value:v,type:z,refinement:Z,key:T[T.length-1],path:T,branch:q,...d,message:Q}}function*l(d,g,m,v){r(d)||(d=[d]);for(let T of d){let q=o(T,g,m,v);q&&(yield q)}}function*u(d,g,m={}){let{path:v=[],branch:T=[d],coerce:q=!1,mask:z=!1}=m,Z={path:v,branch:T};if(q&&(d=g.coercer(d,Z),z&&g.type!=="type"&&i(g.schema)&&i(d)&&!Array.isArray(d)))for(let G in d)g.schema[G]===void 0&&delete d[G];let Q="valid";for(let G of g.validator(d,Z))G.explanation=m.message,Q="not_valid",yield[G,void 0];for(let[G,Pe,cg]of g.entries(d,Z)){let dg=u(Pe,cg,{path:G===void 0?v:[...v,G],branch:G===void 0?T:[...T,Pe],coerce:q,mask:z,message:m.message});for(let Ai of dg)Ai[0]?(Q=Ai[0].refinement!=null?"not_refined":"not_valid",yield[Ai[0],void 0]):q&&(Pe=Ai[1],G===void 0?d=Pe:d instanceof Map?d.set(G,Pe):d instanceof Set?d.add(Pe):i(d)&&(Pe!==void 0||G in d)&&(d[G]=Pe))}if(Q!=="not_valid")for(let G of g.refiner(d,Z))G.explanation=m.message,Q="not_refined",yield[G,void 0];Q==="valid"&&(yield[void 0,d])}class h{constructor(g){let{type:m,schema:v,validator:T,refiner:q,coercer:z=Q=>Q,entries:Z=function*(){}}=g;this.type=m,this.schema=v,this.entries=Z,this.coercer=z,T?this.validator=(Q,G)=>{let Pe=T(Q,G);return l(Pe,G,this,Q)}:this.validator=()=>[],q?this.refiner=(Q,G)=>{let Pe=q(Q,G);return l(Pe,G,this,Q)}:this.refiner=()=>[]}assert(g,m){return p(g,this,m)}create(g,m){return c(g,this,m)}is(g){return y(g,this)}mask(g,m){return f(g,this,m)}validate(g,m={}){return b(g,this,m)}}function p(d,g,m){let v=b(d,g,{message:m});if(v[0])throw v[0]}function c(d,g,m){let v=b(d,g,{coerce:!0,message:m});if(v[0])throw v[0];return v[1]}function f(d,g,m){let v=b(d,g,{coerce:!0,mask:!0,message:m});if(v[0])throw v[0];return v[1]}function y(d,g){return!b(d,g)[0]}function b(d,g,m={}){let v=u(d,g,m),T=a(v);return T[0]?[new e(T[0],function*(){for(let z of v)z[0]&&(yield z[0])}),void 0]:[void 0,T[1]]}function S(...d){let g=d[0].type==="type",m=d.map(T=>T.schema),v=Object.assign({},...m);return g?ft(v):He(v)}function _(d,g){return new h({type:d,schema:null,validator:g})}function x(d,g){return new h({...d,refiner:(m,v)=>m===void 0||d.refiner(m,v),validator(m,v){return m===void 0?!0:(g(m,v),d.validator(m,v))}})}function R(d){return new h({type:"dynamic",schema:null,*entries(g,m){yield*d(g,m).entries(g,m)},validator(g,m){return d(g,m).validator(g,m)},coercer(g,m){return d(g,m).coercer(g,m)},refiner(g,m){return d(g,m).refiner(g,m)}})}function O(d){let g;return new h({type:"lazy",schema:null,*entries(m,v){g??(g=d()),yield*g.entries(m,v)},validator(m,v){return g??(g=d()),g.validator(m,v)},coercer(m,v){return g??(g=d()),g.coercer(m,v)},refiner(m,v){return g??(g=d()),g.refiner(m,v)}})}function A(d,g){let{schema:m}=d,v={...m};for(let T of g)delete v[T];switch(d.type){case"type":return ft(v);default:return He(v)}}function D(d){let g=d instanceof h,m=g?{...d.schema}:{...d};for(let v in m)m[v]=Mr(m[v]);return g&&d.type==="type"?ft(m):He(m)}function F(d,g){let{schema:m}=d,v={};for(let T of g)v[T]=m[T];switch(d.type){case"type":return ft(v);default:return He(v)}}function N(d,g){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),_(d,g)}function B(){return _("any",()=>!0)}function te(d){return new h({type:"array",schema:d,*entries(g){if(d&&Array.isArray(g))for(let[m,v]of g.entries())yield[m,v,d]},coercer(g){return Array.isArray(g)?g.slice():g},validator(g){return Array.isArray(g)||`Expected an array value, but received: ${s(g)}`}})}function J(){return _("bigint",d=>typeof d=="bigint")}function ye(){return _("boolean",d=>typeof d=="boolean")}function be(){return _("date",d=>d instanceof Date&&!isNaN(d.getTime())||`Expected a valid \`Date\` object, but received: ${s(d)}`)}function rt(d){let g={},m=d.map(v=>s(v)).join();for(let v of d)g[v]=v;return new h({type:"enums",schema:g,validator(v){return d.includes(v)||`Expected one of \`${m}\`, but received: ${s(v)}`}})}function Ss(){return _("func",d=>typeof d=="function"||`Expected a function, but received: ${s(d)}`)}function E(d){return _("instance",g=>g instanceof d||`Expected a \`${d.name}\` instance, but received: ${s(g)}`)}function M(){return _("integer",d=>typeof d=="number"&&!isNaN(d)&&Number.isInteger(d)||`Expected an integer, but received: ${s(d)}`)}function U(d){return new h({type:"intersection",schema:null,*entries(g,m){for(let v of d)yield*v.entries(g,m)},*validator(g,m){for(let v of d)yield*v.validator(g,m)},*refiner(g,m){for(let v of d)yield*v.refiner(g,m)}})}function de(d){let g=s(d),m=typeof d;return new h({type:"literal",schema:m==="string"||m==="number"||m==="boolean"?d:null,validator(v){return v===d||`Expected the literal \`${g}\`, but received: ${s(v)}`}})}function P(d,g){return new h({type:"map",schema:null,*entries(m){if(d&&g&&m instanceof Map)for(let[v,T]of m.entries())yield[v,v,d],yield[v,T,g]},coercer(m){return m instanceof Map?new Map(m):m},validator(m){return m instanceof Map||`Expected a \`Map\` object, but received: ${s(m)}`}})}function Ee(){return _("never",()=>!1)}function it(d){return new h({...d,validator:(g,m)=>g===null||d.validator(g,m),refiner:(g,m)=>g===null||d.refiner(g,m)})}function At(){return _("number",d=>typeof d=="number"&&!isNaN(d)||`Expected a number, but received: ${s(d)}`)}function He(d){let g=d?Object.keys(d):[],m=Ee();return new h({type:"object",schema:d||null,*entries(v){if(d&&i(v)){let T=new Set(Object.keys(v));for(let q of g)T.delete(q),yield[q,v[q],d[q]];for(let q of T)yield[q,v[q],m]}},validator(v){return i(v)||`Expected an object, but received: ${s(v)}`},coercer(v){return i(v)?{...v}:v}})}function Mr(d){return new h({...d,validator:(g,m)=>g===void 0||d.validator(g,m),refiner:(g,m)=>g===void 0||d.refiner(g,m)})}function Qt(d,g){return new h({type:"record",schema:null,*entries(m){if(i(m))for(let v in m){let T=m[v];yield[v,v,d],yield[v,T,g]}},validator(m){return i(m)||`Expected an object, but received: ${s(m)}`}})}function Es(){return _("regexp",d=>d instanceof RegExp)}function Te(d){return new h({type:"set",schema:null,*entries(g){if(d&&g instanceof Set)for(let m of g)yield[m,m,d]},coercer(g){return g instanceof Set?new Set(g):g},validator(g){return g instanceof Set||`Expected a \`Set\` object, but received: ${s(g)}`}})}function kr(){return _("string",d=>typeof d=="string"||`Expected a string, but received: ${s(d)}`)}function Rs(d){let g=Ee();return new h({type:"tuple",schema:null,*entries(m){if(Array.isArray(m)){let v=Math.max(d.length,m.length);for(let T=0;T<v;T++)yield[T,m[T],d[T]||g]}},validator(m){return Array.isArray(m)||`Expected an array, but received: ${s(m)}`}})}function ft(d){let g=Object.keys(d);return new h({type:"type",schema:d,*entries(m){if(i(m))for(let v of g)yield[v,m[v],d[v]]},validator(m){return i(m)||`Expected an object, but received: ${s(m)}`},coercer(m){return i(m)?{...m}:m}})}function Mi(d){let g=d.map(m=>m.type).join(" | ");return new h({type:"union",schema:null,coercer(m){for(let v of d){let[T,q]=v.validate(m,{coerce:!0});if(!T)return q}return m},validator(m,v){let T=[];for(let q of d){let[...z]=u(m,q,v),[Z]=z;if(Z[0])for(let[Q]of z)Q&&T.push(Q);else return[]}return[`Expected the value to satisfy a union of \`${g}\`, but received: ${s(m)}`,...T]}})}function Pt(){return _("unknown",()=>!0)}function ht(d,g,m){return new h({...d,coercer:(v,T)=>y(v,g)?d.coercer(m(v,T),T):d.coercer(v,T)})}function xs(d,g,m={}){return ht(d,Pt(),v=>{let T=typeof g=="function"?g():g;if(v===void 0)return T;if(!m.strict&&n(v)&&n(T)){let q={...v},z=!1;for(let Z in T)q[Z]===void 0&&(q[Z]=T[Z],z=!0);if(z)return q}return v})}function Dt(d){return ht(d,kr(),g=>g.trim())}function ct(d){return qt(d,"empty",g=>{let m=Xt(g);return m===0||`Expected an empty ${d.type} but received one with a size of \`${m}\``})}function Xt(d){return d instanceof Map||d instanceof Set?d.size:d.length}function Ts(d,g,m={}){let{exclusive:v}=m;return qt(d,"max",T=>v?T<g:T<=g||`Expected a ${d.type} less than ${v?"":"or equal to "}${g} but received \`${T}\``)}function ki(d,g,m={}){let{exclusive:v}=m;return qt(d,"min",T=>v?T>g:T>=g||`Expected a ${d.type} greater than ${v?"":"or equal to "}${g} but received \`${T}\``)}function ug(d){return qt(d,"nonempty",g=>Xt(g)>0||`Expected a nonempty ${d.type} but received an empty one`)}function fg(d,g){return qt(d,"pattern",m=>g.test(m)||`Expected a ${d.type} matching \`/${g.source}/\` but received "${m}"`)}function hg(d,g,m=g){let v=`Expected a ${d.type}`,T=g===m?`of \`${g}\``:`between \`${g}\` and \`${m}\``;return qt(d,"size",q=>{if(typeof q=="number"||q instanceof Date)return g<=q&&q<=m||`${v} ${T} but received \`${q}\``;if(q instanceof Map||q instanceof Set){let{size:z}=q;return g<=z&&z<=m||`${v} with a size ${T} but received one with a size of \`${z}\``}else{let{length:z}=q;return g<=z&&z<=m||`${v} with a length ${T} but received one with a length of \`${z}\``}})}function qt(d,g,m){return new h({...d,*refiner(v,T){yield*d.refiner(v,T);let q=m(v,T),z=l(q,T,d,v);for(let Z of z)yield{...Z,refinement:g}}})}t.Struct=h,t.StructError=e,t.any=B,t.array=te,t.assert=p,t.assign=S,t.bigint=J,t.boolean=ye,t.coerce=ht,t.create=c,t.date=be,t.defaulted=xs,t.define=_,t.deprecated=x,t.dynamic=R,t.empty=ct,t.enums=rt,t.func=Ss,t.instance=E,t.integer=M,t.intersection=U,t.is=y,t.lazy=O,t.literal=de,t.map=P,t.mask=f,t.max=Ts,t.min=ki,t.never=Ee,t.nonempty=ug,t.nullable=it,t.number=At,t.object=He,t.omit=A,t.optional=Mr,t.partial=D,t.pattern=fg,t.pick=F,t.record=Qt,t.refine=qt,t.regexp=Es,t.set=Te,t.size=hg,t.string=kr,t.struct=N,t.trimmed=Dt,t.tuple=Rs,t.type=ft,t.union=Mi,t.unknown=Pt,t.validate=b})});var tp=w(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});Qn.validateRequirements=void 0;var A_="[",P_="(<=>!~",D_=";",q_="@",C_=new RegExp(`[${A_+P_+D_+q_}]`);function L_(t){return t.split(C_)[0].trim()}function j_(t){return t.forEach(r=>{let i;try{i=new URL(r)}catch{return}if(i.protocol==="emfs:"||i.protocol==="file:")throw new Error(`"emfs:" and "file:" protocols are not allowed for the requirement (${r})`)}),t.filter(r=>L_(r)==="streamlit"?(console.warn(`Streamlit is specified in the requirements ("${r}"), but it will be ignored. A built-in version of Streamlit will be used.`),!1):!0)}Qn.validateRequirements=j_});var rp=w(Xn=>{"use strict";Object.defineProperty(Xn,"__esModule",{value:!0});Xn.parseRequirementsTxt=void 0;var N_=/\s#.*$/;function F_(t){return t.split(`
|
|
33
|
+
`).filter(e=>!e.startsWith("#")).map(e=>e.replace(N_,"")).map(e=>e.trim()).filter(e=>e!=="")}Xn.parseRequirementsTxt=F_});var ip=w(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:!0});es.PromiseDelegate=void 0;var Co=class{constructor(){this.promise=new Promise((e,r)=>{this.resolveInternal=e,this.rejectInternal=r})}resolve(e){this.resolveInternal(e)}reject(e){this.rejectInternal(e)}};es.PromiseDelegate=Co});var np=w(ot=>{"use strict";var I_=ot&&ot.__createBinding||(Object.create?function(t,e,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,n)}:function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]}),Lo=ot&&ot.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&I_(e,t,r)};Object.defineProperty(ot,"__esModule",{value:!0});Lo(tp(),ot);Lo(rp(),ot);Lo(ip(),ot)});var up=w((zR,lp)=>{"use strict";lp.exports=ap;function ap(t,e,r){t instanceof RegExp&&(t=sp(t,r)),e instanceof RegExp&&(e=sp(e,r));var i=op(t,e,r);return i&&{start:i[0],end:i[1],pre:r.slice(0,i[0]),body:r.slice(i[0]+t.length,i[1]),post:r.slice(i[1]+e.length)}}function sp(t,e){var r=e.match(t);return r?r[0]:null}ap.range=op;function op(t,e,r){var i,n,s,a,o,l=r.indexOf(t),u=r.indexOf(e,l+1),h=l;if(l>=0&&u>0){if(t===e)return[l,u];for(i=[],s=r.length;h>=0&&!o;)h==l?(i.push(h),l=r.indexOf(t,h+1)):i.length==1?o=[i.pop(),u]:(n=i.pop(),n<s&&(s=n,a=u),u=r.indexOf(e,h+1)),h=l<u&&l>=0?l:u;i.length&&(o=[s,a])}return o}});var yp=w((HR,mp)=>{var fp=up();mp.exports=B_;var hp="\0SLASH"+Math.random()+"\0",cp="\0OPEN"+Math.random()+"\0",No="\0CLOSE"+Math.random()+"\0",dp="\0COMMA"+Math.random()+"\0",pp="\0PERIOD"+Math.random()+"\0";function jo(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function $_(t){return t.split("\\\\").join(hp).split("\\{").join(cp).split("\\}").join(No).split("\\,").join(dp).split("\\.").join(pp)}function W_(t){return t.split(hp).join("\\").split(cp).join("{").split(No).join("}").split(dp).join(",").split(pp).join(".")}function gp(t){if(!t)return[""];var e=[],r=fp("{","}",t);if(!r)return t.split(",");var i=r.pre,n=r.body,s=r.post,a=i.split(",");a[a.length-1]+="{"+n+"}";var o=gp(s);return s.length&&(a[a.length-1]+=o.shift(),a.push.apply(a,o)),e.push.apply(e,a),e}function B_(t){return t?(t.substr(0,2)==="{}"&&(t="\\{\\}"+t.substr(2)),hi($_(t),!0).map(W_)):[]}function U_(t){return"{"+t+"}"}function z_(t){return/^-?0\d/.test(t)}function H_(t,e){return t<=e}function G_(t,e){return t>=e}function hi(t,e){var r=[],i=fp("{","}",t);if(!i)return[t];var n=i.pre,s=i.post.length?hi(i.post,!1):[""];if(/\$$/.test(i.pre))for(var a=0;a<s.length;a++){var o=n+"{"+i.body+"}"+s[a];r.push(o)}else{var l=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body),u=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body),h=l||u,p=i.body.indexOf(",")>=0;if(!h&&!p)return i.post.match(/,.*\}/)?(t=i.pre+"{"+i.body+No+i.post,hi(t)):[t];var c;if(h)c=i.body.split(/\.\./);else if(c=gp(i.body),c.length===1&&(c=hi(c[0],!1).map(U_),c.length===1))return s.map(function(te){return i.pre+c[0]+te});var f;if(h){var y=jo(c[0]),b=jo(c[1]),S=Math.max(c[0].length,c[1].length),_=c.length==3?Math.abs(jo(c[2])):1,x=H_,R=b<y;R&&(_*=-1,x=G_);var O=c.some(z_);f=[];for(var A=y;x(A,b);A+=_){var D;if(u)D=String.fromCharCode(A),D==="\\"&&(D="");else if(D=String(A),O){var F=S-D.length;if(F>0){var N=new Array(F+1).join("0");A<0?D="-"+N+D.slice(1):D=N+D}}f.push(D)}}else{f=[];for(var B=0;B<c.length;B++)f.push.apply(f,hi(c[B],!1))}for(var B=0;B<f.length;B++)for(var a=0;a<s.length;a++){var o=n+f[B]+s[a];(!e||h||o)&&r.push(o)}}return r}});var sg=pe(require("yargs")),ag=require("yargs/helpers"),ce=pe(require("node:path")),tt=pe(require("node:fs/promises")),tl=pe(require("fs-extra")),rl=pe(require("node-fetch")),il=require("pyodide");var sl=require("pyodide");function Pi(t){return`https://cdn.jsdelivr.net/pyodide/v${sl.version}/full/${t}`}var Yd=pe(require("node-fetch"));var xt=pe(Gd()),I=xt.createLogger({transports:[new xt.transports.Console({format:xt.format.combine(xt.format.splat(),xt.format.cli())})]});function ui(t){process.emitWarning(t,{type:"DeprecationWarning"})}var fi=class t{static _instance;_data=null;constructor(){}static async loadPrebuiltPackageData(){let e=Pi("pyodide-lock.json");return I.info(`Load the Pyodide pyodide-lock.json from ${e}`),(await(await(0,Yd.default)(e,void 0)).json()).packages}static async getInstance(){return this._instance==null&&(this._instance=new t,this._instance._data=await this.loadPrebuiltPackageData()),this._instance}getPackageInfoByName(e){if(this._data==null)throw new Error("The package data is not loaded yet.");let r=Object.values(this._data).find(i=>i.name===e);if(r==null)throw new Error(`Package ${e} is not found in the lock file.`);return r}};var Jd=pe(require("node:fs/promises")),Zd=pe(Zn());var X=pe(Zn()),Kd=X.object({entrypoint:X.string(),embed:X.defaulted(X.boolean(),!1),idbfsMountpoints:X.optional(X.array(X.string())),nodeJsWorker:X.defaulted(X.boolean(),!1),nodefsMountpoints:X.optional(X.record(X.string(),X.string()))});function T_(t){let e=Zd.mask(t??{},Kd);if(e.nodeJsWorker){if(e.idbfsMountpoints!=null)throw new Error("The `idbfsMountpoints` field is not allowed when `nodeJsWorker` is true.")}else if(e.nodefsMountpoints!=null)throw new Error("The `nodefsMountpoints` field is not allowed when `nodeJsWorker` is false.");return e}async function Qd(t){let e=T_({...t.packageJsonStliteDesktopField,...t.fallbacks});I.info("App manifest: %j",e);let r=JSON.stringify(e,null,2);I.info(`Dump the manifest file -> ${t.manifestFilePath}`),await Jd.default.writeFile(t.manifestFilePath,r,{encoding:"utf-8"})}var Xd=pe(require("node:path")),fe=pe(Zn());async function ep(t){let{files:e,entrypoint:r}=O_(t),i=await M_(t),n=await k_(t);return{files:e,entrypoint:r,dependencies:i,requirementsTxtFilePaths:n}}function O_(t){let{packageJsonStliteDesktopField:e,fallbacks:{appHomeDirSource:r}}=t,i=e?.files,n=e?.entrypoint;if(i==null||n==null){ui("Missing `stlite.desktop.files` and `stlite.desktop.entrypoint` in `package.json`. Falling back to the `appHomeDirSource` argument to determine the app directory. Please update your `package.json` as this fallback is deprecated and will be removed in a future release.");let s=r;if(typeof s!="string")throw new Error("The `appHomeDirSource` argument is required when `stlite.desktop.files` and `stlite.desktop.entrypoint` are not found in the package.json. Note that `appHomeDirSource` is deprecated and will be removed in the future, so please specify `stlite.desktop.files` and `stlite.desktop.entrypoint` in the package.json.");i=[s],n=`./${s}/streamlit_app.py`}else r!=null&&ui("The `appHomeDirSource` argument is deprecated and has been ignored because `stlite.desktop.files` is specified in `package.json`.");return fe.assert(n,fe.string(),"The `stlite.desktop.entrypoint` field must be a string."),fe.assert(i,fe.array(fe.string()),"The `stlite.desktop.files` field must be an array of strings."),{files:i,entrypoint:n}}async function M_(t){let{packageJsonStliteDesktopField:e,fallbacks:{packages:r}}=t,i=e?.dependencies;fe.assert(i,fe.optional(fe.array(fe.string())),"The `stlite.desktop.dependencies` field must be an array of strings.");let n=[];return r!=null&&(ui("The `packages` argument is deprecated and will be removed in a future release. Use `stlite.desktop.dependencies` in your `package.json` instead."),n=r),[...i??[],...n]}async function k_(t){let{pathResolutionRoot:e,packageJsonStliteDesktopField:r,fallbacks:{requirementsTxtFilePaths:i}}=t,n=r?.requirementsTxtFiles;fe.assert(n,fe.optional(fe.array(fe.string())),"The `stlite.desktop.requirementsTxtFiles` field must be an array of strings.");let s=n?.map(o=>Xd.default.resolve(e,o)),a=[];return i!=null&&i.length>0&&(ui("The `requirement` argument is deprecated and will be removed in a future release. Use `stlite.desktop.requirementsTxtFiles` in your `package.json` instead."),a=i),[...s??[],...a]}var _s=pe(np());var xp=pe(yp(),1);var ci=t=>{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")};var Y_={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},di=t=>t.replace(/[[\]\\-]/g,"\\$&"),V_=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),bp=t=>t.join(""),wp=(t,e)=>{let r=e;if(t.charAt(r)!=="[")throw new Error("not in a brace expression");let i=[],n=[],s=r+1,a=!1,o=!1,l=!1,u=!1,h=r,p="";e:for(;s<t.length;){let b=t.charAt(s);if((b==="!"||b==="^")&&s===r+1){u=!0,s++;continue}if(b==="]"&&a&&!l){h=s+1;break}if(a=!0,b==="\\"&&!l){l=!0,s++;continue}if(b==="["&&!l){for(let[S,[_,x,R]]of Object.entries(Y_))if(t.startsWith(S,s)){if(p)return["$.",!1,t.length-r,!0];s+=S.length,R?n.push(_):i.push(_),o=o||x;continue e}}if(l=!1,p){b>p?i.push(di(p)+"-"+di(b)):b===p&&i.push(di(b)),p="",s++;continue}if(t.startsWith("-]",s+1)){i.push(di(b+"-")),s+=2;continue}if(t.startsWith("-",s+1)){p=b,s+=2;continue}i.push(di(b)),s++}if(h<s)return["",!1,0,!1];if(!i.length&&!n.length)return["$.",!1,t.length-r,!0];if(n.length===0&&i.length===1&&/^\\?.$/.test(i[0])&&!u){let b=i[0].length===2?i[0].slice(-1):i[0];return[V_(b),!1,h-r,!1]}let c="["+(u?"^":"")+bp(i)+"]",f="["+(u?"":"^")+bp(n)+"]";return[i.length&&n.length?"("+c+"|"+f+")":i.length?c:f,o,h-r,!0]};var We=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");var K_=new Set(["!","?","+","*","@"]),vp=t=>K_.has(t),J_="(?!(?:^|/)\\.\\.?(?:$|/))",ts="(?!\\.)",Z_=new Set(["[","."]),Q_=new Set(["..","."]),X_=new Set("().*{}+?[]^$\\!"),eS=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Fo="[^/]",_p=Fo+"*?",Sp=Fo+"+?",br=class t{type;#e;#r;#s=!1;#i=[];#o;#u;#h;#l=!1;#a;#t;#g=!1;constructor(e,r,i={}){this.type=e,e&&(this.#r=!0),this.#o=r,this.#e=this.#o?this.#o.#e:this,this.#a=this.#e===this?i:this.#e.#a,this.#h=this.#e===this?[]:this.#e.#h,e==="!"&&!this.#e.#l&&this.#h.push(this),this.#u=this.#o?this.#o.#i.length:0}get hasMagic(){if(this.#r!==void 0)return this.#r;for(let e of this.#i)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#r=!0;return this.#r}toString(){return this.#t!==void 0?this.#t:this.type?this.#t=this.type+"("+this.#i.map(e=>String(e)).join("|")+")":this.#t=this.#i.map(e=>String(e)).join("")}#y(){if(this!==this.#e)throw new Error("should only call on root");if(this.#l)return this;this.toString(),this.#l=!0;let e;for(;e=this.#h.pop();){if(e.type!=="!")continue;let r=e,i=r.#o;for(;i;){for(let n=r.#u+1;!i.type&&n<i.#i.length;n++)for(let s of e.#i){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(i.#i[n])}r=i,i=r.#o}}return this}push(...e){for(let r of e)if(r!==""){if(typeof r!="string"&&!(r instanceof t&&r.#o===this))throw new Error("invalid part: "+r);this.#i.push(r)}}toJSON(){let e=this.type===null?this.#i.slice().map(r=>typeof r=="string"?r:r.toJSON()):[this.type,...this.#i.map(r=>r.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#l&&this.#o?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#o?.isStart())return!1;if(this.#u===0)return!0;let e=this.#o;for(let r=0;r<this.#u;r++){let i=e.#i[r];if(!(i instanceof t&&i.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#o?.type==="!")return!0;if(!this.#o?.isEnd())return!1;if(!this.type)return this.#o?.isEnd();let e=this.#o?this.#o.#i.length:0;return this.#u===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let r=new t(this.type,e);for(let i of this.#i)r.copyIn(i);return r}static#d(e,r,i,n){let s=!1,a=!1,o=-1,l=!1;if(r.type===null){let f=i,y="";for(;f<e.length;){let b=e.charAt(f++);if(s||b==="\\"){s=!s,y+=b;continue}if(a){f===o+1?(b==="^"||b==="!")&&(l=!0):b==="]"&&!(f===o+2&&l)&&(a=!1),y+=b;continue}else if(b==="["){a=!0,o=f,l=!1,y+=b;continue}if(!n.noext&&vp(b)&&e.charAt(f)==="("){r.push(y),y="";let S=new t(b,r);f=t.#d(e,S,f,n),r.push(S);continue}y+=b}return r.push(y),f}let u=i+1,h=new t(null,r),p=[],c="";for(;u<e.length;){let f=e.charAt(u++);if(s||f==="\\"){s=!s,c+=f;continue}if(a){u===o+1?(f==="^"||f==="!")&&(l=!0):f==="]"&&!(u===o+2&&l)&&(a=!1),c+=f;continue}else if(f==="["){a=!0,o=u,l=!1,c+=f;continue}if(vp(f)&&e.charAt(u)==="("){h.push(c),c="";let y=new t(f,h);h.push(y),u=t.#d(e,y,u,n);continue}if(f==="|"){h.push(c),c="",p.push(h),h=new t(null,r);continue}if(f===")")return c===""&&r.#i.length===0&&(r.#g=!0),h.push(c),c="",r.push(...p,h),u;c+=f}return r.type=null,r.#r=void 0,r.#i=[e.substring(i-1)],u}static fromGlob(e,r={}){let i=new t(null,void 0,r);return t.#d(e,i,0,r),i}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[r,i,n,s]=this.toRegExpSource();if(!(n||this.#r||this.#a.nocase&&!this.#a.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return i;let o=(this.#a.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${r}$`,o),{_src:r,_glob:e})}toRegExpSource(e){let r=e??!!this.#a.dot;if(this.#e===this&&this.#y(),!this.type){let l=this.isStart()&&this.isEnd(),u=this.#i.map(f=>{let[y,b,S,_]=typeof f=="string"?t.#v(f,this.#r,l):f.toRegExpSource(e);return this.#r=this.#r||S,this.#s=this.#s||_,y}).join(""),h="";if(this.isStart()&&typeof this.#i[0]=="string"&&!(this.#i.length===1&&Q_.has(this.#i[0]))){let y=Z_,b=r&&y.has(u.charAt(0))||u.startsWith("\\.")&&y.has(u.charAt(2))||u.startsWith("\\.\\.")&&y.has(u.charAt(4)),S=!r&&!e&&y.has(u.charAt(0));h=b?J_:S?ts:""}let p="";return this.isEnd()&&this.#e.#l&&this.#o?.type==="!"&&(p="(?:$|\\/)"),[h+u+p,We(u),this.#r=!!this.#r,this.#s]}let i=this.type==="*"||this.type==="+",n=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#c(r);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let l=this.toString();return this.#i=[l],this.type=null,this.#r=void 0,[l,We(this.toString()),!1,!1]}let a=!i||e||r||!ts?"":this.#c(!0);a===s&&(a=""),a&&(s=`(?:${s})(?:${a})*?`);let o="";if(this.type==="!"&&this.#g)o=(this.isStart()&&!r?ts:"")+Sp;else{let l=this.type==="!"?"))"+(this.isStart()&&!r&&!e?ts:"")+_p+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&a?")":this.type==="*"&&a?")?":`)${this.type}`;o=n+s+l}return[o,We(s),this.#r=!!this.#r,this.#s]}#c(e){return this.#i.map(r=>{if(typeof r=="string")throw new Error("string type in extglob ast??");let[i,n,s,a]=r.toRegExpSource(e);return this.#s=this.#s||a,i}).filter(r=>!(this.isStart()&&this.isEnd())||!!r).join("|")}static#v(e,r,i=!1){let n=!1,s="",a=!1;for(let o=0;o<e.length;o++){let l=e.charAt(o);if(n){n=!1,s+=(X_.has(l)?"\\":"")+l;continue}if(l==="\\"){o===e.length-1?s+="\\\\":n=!0;continue}if(l==="["){let[u,h,p,c]=wp(e,o);if(p){s+=u,a=a||h,o+=p-1,r=r||c;continue}}if(l==="*"){i&&e==="*"?s+=Sp:s+=_p,r=!0;continue}if(l==="?"){s+=Fo,r=!0;continue}s+=eS(l)}return[s,We(e),!!r,a]}};var wr=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&");var _e=(t,e,r={})=>(ci(e),!r.nocomment&&e.charAt(0)==="#"?!1:new ke(e,r).match(t)),tS=/^\*+([^+@!?\*\[\(]*)$/,rS=t=>e=>!e.startsWith(".")&&e.endsWith(t),iS=t=>e=>e.endsWith(t),nS=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),sS=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),aS=/^\*+\.\*+$/,oS=t=>!t.startsWith(".")&&t.includes("."),lS=t=>t!=="."&&t!==".."&&t.includes("."),uS=/^\.\*+$/,fS=t=>t!=="."&&t!==".."&&t.startsWith("."),hS=/^\*+$/,cS=t=>t.length!==0&&!t.startsWith("."),dS=t=>t.length!==0&&t!=="."&&t!=="..",pS=/^\?+([^+@!?\*\[\(]*)?$/,gS=([t,e=""])=>{let r=Tp([t]);return e?(e=e.toLowerCase(),i=>r(i)&&i.toLowerCase().endsWith(e)):r},mS=([t,e=""])=>{let r=Op([t]);return e?(e=e.toLowerCase(),i=>r(i)&&i.toLowerCase().endsWith(e)):r},yS=([t,e=""])=>{let r=Op([t]);return e?i=>r(i)&&i.endsWith(e):r},bS=([t,e=""])=>{let r=Tp([t]);return e?i=>r(i)&&i.endsWith(e):r},Tp=([t])=>{let e=t.length;return r=>r.length===e&&!r.startsWith(".")},Op=([t])=>{let e=t.length;return r=>r.length===e&&r!=="."&&r!==".."},Mp=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Ep={win32:{sep:"\\"},posix:{sep:"/"}},wS=Mp==="win32"?Ep.win32.sep:Ep.posix.sep;_e.sep=wS;var he=Symbol("globstar **");_e.GLOBSTAR=he;var vS="[^/]",_S=vS+"*?",SS="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",ES="(?:(?!(?:\\/|^)\\.).)*?",RS=(t,e={})=>r=>_e(r,t,e);_e.filter=RS;var Le=(t,e={})=>Object.assign({},t,e),xS=t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return _e;let e=_e;return Object.assign((i,n,s={})=>e(i,n,Le(t,s)),{Minimatch:class extends e.Minimatch{constructor(n,s={}){super(n,Le(t,s))}static defaults(n){return e.defaults(Le(t,n)).Minimatch}},AST:class extends e.AST{constructor(n,s,a={}){super(n,s,Le(t,a))}static fromGlob(n,s={}){return e.AST.fromGlob(n,Le(t,s))}},unescape:(i,n={})=>e.unescape(i,Le(t,n)),escape:(i,n={})=>e.escape(i,Le(t,n)),filter:(i,n={})=>e.filter(i,Le(t,n)),defaults:i=>e.defaults(Le(t,i)),makeRe:(i,n={})=>e.makeRe(i,Le(t,n)),braceExpand:(i,n={})=>e.braceExpand(i,Le(t,n)),match:(i,n,s={})=>e.match(i,n,Le(t,s)),sep:e.sep,GLOBSTAR:he})};_e.defaults=xS;var kp=(t,e={})=>(ci(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:(0,xp.default)(t));_e.braceExpand=kp;var TS=(t,e={})=>new ke(t,e).makeRe();_e.makeRe=TS;var OS=(t,e,r={})=>{let i=new ke(e,r);return t=t.filter(n=>i.match(n)),i.options.nonull&&!t.length&&t.push(e),t};_e.match=OS;var Rp=/[?*]|[+@!]\(.*?\)|\[|\]/,MS=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),ke=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,r={}){ci(e),r=r||{},this.options=r,this.pattern=e,this.platform=r.platform||Mp,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!r.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!r.nonegate,this.comment=!1,this.empty=!1,this.partial=!!r.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=r.windowsNoMagicRoot!==void 0?r.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let r of e)if(typeof r!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,r=this.options;if(!r.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],r.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let i=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(i),this.debug(this.pattern,this.globParts);let n=this.globParts.map((s,a,o)=>{if(this.isWindows&&this.windowsNoMagicRoot){let l=s[0]===""&&s[1]===""&&(s[2]==="?"||!Rp.test(s[2]))&&!Rp.test(s[3]),u=/^[a-z]:/i.test(s[0]);if(l)return[...s.slice(0,4),...s.slice(4).map(h=>this.parse(h))];if(u)return[s[0],...s.slice(1).map(h=>this.parse(h))]}return s.map(l=>this.parse(l))});if(this.debug(this.pattern,n),this.set=n.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s<this.set.length;s++){let a=this.set[s];a[0]===""&&a[1]===""&&this.globParts[s][2]==="?"&&typeof a[3]=="string"&&/^[a-z]:$/i.test(a[3])&&(a[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let i=0;i<e.length;i++)for(let n=0;n<e[i].length;n++)e[i][n]==="**"&&(e[i][n]="*");let{optimizationLevel:r=1}=this.options;return r>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):r>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(r=>{let i=-1;for(;(i=r.indexOf("**",i+1))!==-1;){let n=i;for(;r[n+1]==="**";)n++;n!==i&&r.splice(i,n-i)}return r})}levelOneOptimize(e){return e.map(r=>(r=r.reduce((i,n)=>{let s=i[i.length-1];return n==="**"&&s==="**"?i:n===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(i.pop(),i):(i.push(n),i)},[]),r.length===0?[""]:r))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let r=!1;do{if(r=!1,!this.preserveMultipleSlashes){for(let n=1;n<e.length-1;n++){let s=e[n];n===1&&s===""&&e[0]===""||(s==="."||s==="")&&(r=!0,e.splice(n,1),n--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(r=!0,e.pop())}let i=0;for(;(i=e.indexOf("..",i+1))!==-1;){let n=e[i-1];n&&n!=="."&&n!==".."&&n!=="**"&&(r=!0,e.splice(i-1,2),i-=2)}}while(r);return e.length===0?[""]:e}firstPhasePreProcess(e){let r=!1;do{r=!1;for(let i of e){let n=-1;for(;(n=i.indexOf("**",n+1))!==-1;){let a=n;for(;i[a+1]==="**";)a++;a>n&&i.splice(n+1,a-n);let o=i[n+1],l=i[n+2],u=i[n+3];if(o!==".."||!l||l==="."||l===".."||!u||u==="."||u==="..")continue;r=!0,i.splice(n,1);let h=i.slice(0);h[n]="**",e.push(h),n--}if(!this.preserveMultipleSlashes){for(let a=1;a<i.length-1;a++){let o=i[a];a===1&&o===""&&i[0]===""||(o==="."||o==="")&&(r=!0,i.splice(a,1),a--)}i[0]==="."&&i.length===2&&(i[1]==="."||i[1]==="")&&(r=!0,i.pop())}let s=0;for(;(s=i.indexOf("..",s+1))!==-1;){let a=i[s-1];if(a&&a!=="."&&a!==".."&&a!=="**"){r=!0;let l=s===1&&i[s+1]==="**"?["."]:[];i.splice(s-1,2,...l),i.length===0&&i.push(""),s-=2}}}}while(r);return e}secondPhasePreProcess(e){for(let r=0;r<e.length-1;r++)for(let i=r+1;i<e.length;i++){let n=this.partsMatch(e[r],e[i],!this.preserveMultipleSlashes);n&&(e[r]=n,e[i]=[])}return e.filter(r=>r.length)}partsMatch(e,r,i=!1){let n=0,s=0,a=[],o="";for(;n<e.length&&s<r.length;)if(e[n]===r[s])a.push(o==="b"?r[s]:e[n]),n++,s++;else if(i&&e[n]==="**"&&r[s]===e[n+1])a.push(e[n]),n++;else if(i&&r[s]==="**"&&e[n]===r[s+1])a.push(r[s]),s++;else if(e[n]==="*"&&r[s]&&(this.options.dot||!r[s].startsWith("."))&&r[s]!=="**"){if(o==="b")return!1;o="a",a.push(e[n]),n++,s++}else if(r[s]==="*"&&e[n]&&(this.options.dot||!e[n].startsWith("."))&&e[n]!=="**"){if(o==="a")return!1;o="b",a.push(r[s]),n++,s++}else return!1;return e.length===r.length&&a}parseNegate(){if(this.nonegate)return;let e=this.pattern,r=!1,i=0;for(let n=0;n<e.length&&e.charAt(n)==="!";n++)r=!r,i++;i&&(this.pattern=e.slice(i)),this.negate=r}matchOne(e,r,i=!1){let n=this.options;if(this.isWindows){let b=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),S=!b&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),_=typeof r[0]=="string"&&/^[a-z]:$/i.test(r[0]),x=!_&&r[0]===""&&r[1]===""&&r[2]==="?"&&typeof r[3]=="string"&&/^[a-z]:$/i.test(r[3]),R=S?3:b?0:void 0,O=x?3:_?0:void 0;if(typeof R=="number"&&typeof O=="number"){let[A,D]=[e[R],r[O]];A.toLowerCase()===D.toLowerCase()&&(r[O]=A,O>R?r=r.slice(O):R>O&&(e=e.slice(R)))}}let{optimizationLevel:s=1}=this.options;s>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:r}),this.debug("matchOne",e.length,r.length);for(var a=0,o=0,l=e.length,u=r.length;a<l&&o<u;a++,o++){this.debug("matchOne loop");var h=r[o],p=e[a];if(this.debug(r,h,p),h===!1)return!1;if(h===he){this.debug("GLOBSTAR",[r,h,p]);var c=a,f=o+1;if(f===u){for(this.debug("** at the end");a<l;a++)if(e[a]==="."||e[a]===".."||!n.dot&&e[a].charAt(0)===".")return!1;return!0}for(;c<l;){var y=e[c];if(this.debug(`
|
|
34
|
+
globstar while`,e,c,r,f,y),this.matchOne(e.slice(c),r.slice(f),i))return this.debug("globstar found match!",c,l,y),!0;if(y==="."||y===".."||!n.dot&&y.charAt(0)==="."){this.debug("dot detected!",e,c,r,f);break}this.debug("globstar swallow a segment, and continue"),c++}return!!(i&&(this.debug(`
|
|
35
|
+
>>> no match, partial?`,e,c,r,f),c===l))}let b;if(typeof h=="string"?(b=p===h,this.debug("string match",h,p,b)):(b=h.test(p),this.debug("pattern match",h,p,b)),!b)return!1}if(a===l&&o===u)return!0;if(a===l)return i;if(o===u)return a===l-1&&e[a]==="";throw new Error("wtf?")}braceExpand(){return kp(this.pattern,this.options)}parse(e){ci(e);let r=this.options;if(e==="**")return he;if(e==="")return"";let i,n=null;(i=e.match(hS))?n=r.dot?dS:cS:(i=e.match(tS))?n=(r.nocase?r.dot?sS:nS:r.dot?iS:rS)(i[1]):(i=e.match(pS))?n=(r.nocase?r.dot?mS:gS:r.dot?yS:bS)(i):(i=e.match(aS))?n=r.dot?lS:oS:(i=e.match(uS))&&(n=fS);let s=br.fromGlob(e,this.options).toMMPattern();return n?Object.assign(s,{test:n}):s}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let r=this.options,i=r.noglobstar?_S:r.dot?SS:ES,n=new Set(r.nocase?["i"]:[]),s=e.map(l=>{let u=l.map(h=>{if(h instanceof RegExp)for(let p of h.flags.split(""))n.add(p);return typeof h=="string"?MS(h):h===he?he:h._src});return u.forEach((h,p)=>{let c=u[p+1],f=u[p-1];h!==he||f===he||(f===void 0?c!==void 0&&c!==he?u[p+1]="(?:\\/|"+i+"\\/)?"+c:u[p]=i:c===void 0?u[p-1]=f+"(?:\\/|"+i+")?":c!==he&&(u[p-1]=f+"(?:\\/|\\/"+i+"\\/)"+c,u[p+1]=he))}),u.filter(h=>h!==he).join("/")}).join("|"),[a,o]=e.length>1?["(?:",")"]:["",""];s="^"+a+s+o+"$",this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...n].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,r=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&r)return!0;let i=this.options;this.isWindows&&(e=e.split("\\").join("/"));let n=this.slashSplit(e);this.debug(this.pattern,"split",n);let s=this.set;this.debug(this.pattern,"set",s);let a=n[n.length-1];if(!a)for(let o=n.length-2;!a&&o>=0;o--)a=n[o];for(let o=0;o<s.length;o++){let l=s[o],u=n;if(i.matchBase&&l.length===1&&(u=[a]),this.matchOne(u,l,r))return i.flipNegate?!0:!this.negate}return i.flipNegate?!1:this.negate}static defaults(e){return _e.defaults(e).Minimatch}};_e.AST=br;_e.Minimatch=ke;_e.escape=wr;_e.unescape=We;var vr=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Pp=new Set,Io=typeof process=="object"&&process?process:{},Dp=(t,e,r,i)=>{typeof Io.emitWarning=="function"?Io.emitWarning(t,e,r,i):console.error(`[${r}] ${e}: ${t}`)},rs=globalThis.AbortController,Ap=globalThis.AbortSignal;if(typeof rs>"u"){Ap=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(i,n){this._onabort.push(n)}},rs=class{constructor(){e()}signal=new Ap;abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=!0;for(let n of this.signal._onabort)n(i);this.signal.onabort?.(i)}}};let t=Io.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=!1,Dp("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}var kS=t=>!Pp.has(t),hx=Symbol("type"),Tt=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),qp=t=>Tt(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?_r:null:null,_r=class extends Array{constructor(e){super(e),this.fill(0)}},$o=class t{heap;length;static#e=!1;static create(e){let r=qp(e);if(!r)return[];t.#e=!0;let i=new t(e,r);return t.#e=!1,i}constructor(e,r){if(!t.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},pi=class t{#e;#r;#s;#i;#o;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#u;#h;#l;#a;#t;#g;#y;#d;#c;#v;#m;#x;#T;#_;#w;#M;#p;static unsafeExposeInternals(e){return{starts:e.#T,ttls:e.#_,sizes:e.#x,keyMap:e.#l,keyList:e.#a,valList:e.#t,next:e.#g,prev:e.#y,get head(){return e.#d},get tail(){return e.#c},free:e.#v,isBackgroundFetch:r=>e.#f(r),backgroundFetch:(r,i,n,s)=>e.#C(r,i,n,s),moveToTail:r=>e.#q(r),indexes:r=>e.#R(r),rindexes:r=>e.#k(r),isStale:r=>e.#b(r)}}get max(){return this.#e}get maxSize(){return this.#r}get calculatedSize(){return this.#h}get size(){return this.#u}get fetchMethod(){return this.#o}get dispose(){return this.#s}get disposeAfter(){return this.#i}constructor(e){let{max:r=0,ttl:i,ttlResolution:n=1,ttlAutopurge:s,updateAgeOnGet:a,updateAgeOnHas:o,allowStale:l,dispose:u,disposeAfter:h,noDisposeOnSet:p,noUpdateTTL:c,maxSize:f=0,maxEntrySize:y=0,sizeCalculation:b,fetchMethod:S,noDeleteOnFetchRejection:_,noDeleteOnStaleGet:x,allowStaleOnFetchRejection:R,allowStaleOnFetchAbort:O,ignoreFetchAbort:A}=e;if(r!==0&&!Tt(r))throw new TypeError("max option must be a nonnegative integer");let D=r?qp(r):Array;if(!D)throw new Error("invalid max value: "+r);if(this.#e=r,this.#r=f,this.maxEntrySize=y||this.#r,this.sizeCalculation=b,this.sizeCalculation){if(!this.#r&&!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(S!==void 0&&typeof S!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#o=S,this.#M=!!S,this.#l=new Map,this.#a=new Array(r).fill(void 0),this.#t=new Array(r).fill(void 0),this.#g=new D(r),this.#y=new D(r),this.#d=0,this.#c=0,this.#v=$o.create(r),this.#u=0,this.#h=0,typeof u=="function"&&(this.#s=u),typeof h=="function"?(this.#i=h,this.#m=[]):(this.#i=void 0,this.#m=void 0),this.#w=!!this.#s,this.#p=!!this.#i,this.noDisposeOnSet=!!p,this.noUpdateTTL=!!c,this.noDeleteOnFetchRejection=!!_,this.allowStaleOnFetchRejection=!!R,this.allowStaleOnFetchAbort=!!O,this.ignoreFetchAbort=!!A,this.maxEntrySize!==0){if(this.#r!==0&&!Tt(this.#r))throw new TypeError("maxSize must be a positive integer if specified");if(!Tt(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#P()}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!x,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!o,this.ttlResolution=Tt(n)||n===0?n:1,this.ttlAutopurge=!!s,this.ttl=i||0,this.ttl){if(!Tt(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#A()}if(this.#e===0&&this.ttl===0&&this.#r===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#r){let F="LRU_CACHE_UNBOUNDED";kS(F)&&(Pp.add(F),Dp("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",F,t))}}getRemainingTTL(e){return this.#l.has(e)?1/0:0}#A(){let e=new _r(this.#e),r=new _r(this.#e);this.#_=e,this.#T=r,this.#n=(s,a,o=vr.now())=>{if(r[s]=a!==0?o:0,e[s]=a,a!==0&&this.ttlAutopurge){let l=setTimeout(()=>{this.#b(s)&&this.delete(this.#a[s])},a+1);l.unref&&l.unref()}},this.#O=s=>{r[s]=e[s]!==0?vr.now():0},this.#S=(s,a)=>{if(e[a]){let o=e[a],l=r[a];if(!o||!l)return;s.ttl=o,s.start=l,s.now=i||n();let u=s.now-l;s.remainingTTL=o-u}};let i=0,n=()=>{let s=vr.now();if(this.ttlResolution>0){i=s;let a=setTimeout(()=>i=0,this.ttlResolution);a.unref&&a.unref()}return s};this.getRemainingTTL=s=>{let a=this.#l.get(s);if(a===void 0)return 0;let o=e[a],l=r[a];if(!o||!l)return 1/0;let u=(i||n())-l;return o-u},this.#b=s=>{let a=r[s],o=e[s];return!!o&&!!a&&(i||n())-a>o}}#O=()=>{};#S=()=>{};#n=()=>{};#b=()=>!1;#P(){let e=new _r(this.#e);this.#h=0,this.#x=e,this.#E=r=>{this.#h-=e[r],e[r]=0},this.#j=(r,i,n,s)=>{if(this.#f(i))return 0;if(!Tt(n))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(n=s(i,r),!Tt(n))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 n},this.#L=(r,i,n)=>{if(e[r]=i,this.#r){let s=this.#r-e[r];for(;this.#h>s;)this.#D(!0)}this.#h+=e[r],n&&(n.entrySize=i,n.totalCalculatedSize=this.#h)}}#E=e=>{};#L=(e,r,i)=>{};#j=(e,r,i,n)=>{if(i||n)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#R({allowStale:e=this.allowStale}={}){if(this.#u)for(let r=this.#c;!(!this.#N(r)||((e||!this.#b(r))&&(yield r),r===this.#d));)r=this.#y[r]}*#k({allowStale:e=this.allowStale}={}){if(this.#u)for(let r=this.#d;!(!this.#N(r)||((e||!this.#b(r))&&(yield r),r===this.#c));)r=this.#g[r]}#N(e){return e!==void 0&&this.#l.get(this.#a[e])===e}*entries(){for(let e of this.#R())this.#t[e]!==void 0&&this.#a[e]!==void 0&&!this.#f(this.#t[e])&&(yield[this.#a[e],this.#t[e]])}*rentries(){for(let e of this.#k())this.#t[e]!==void 0&&this.#a[e]!==void 0&&!this.#f(this.#t[e])&&(yield[this.#a[e],this.#t[e]])}*keys(){for(let e of this.#R()){let r=this.#a[e];r!==void 0&&!this.#f(this.#t[e])&&(yield r)}}*rkeys(){for(let e of this.#k()){let r=this.#a[e];r!==void 0&&!this.#f(this.#t[e])&&(yield r)}}*values(){for(let e of this.#R())this.#t[e]!==void 0&&!this.#f(this.#t[e])&&(yield this.#t[e])}*rvalues(){for(let e of this.#k())this.#t[e]!==void 0&&!this.#f(this.#t[e])&&(yield this.#t[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,r={}){for(let i of this.#R()){let n=this.#t[i],s=this.#f(n)?n.__staleWhileFetching:n;if(s!==void 0&&e(s,this.#a[i],this))return this.get(this.#a[i],r)}}forEach(e,r=this){for(let i of this.#R()){let n=this.#t[i],s=this.#f(n)?n.__staleWhileFetching:n;s!==void 0&&e.call(r,s,this.#a[i],this)}}rforEach(e,r=this){for(let i of this.#k()){let n=this.#t[i],s=this.#f(n)?n.__staleWhileFetching:n;s!==void 0&&e.call(r,s,this.#a[i],this)}}purgeStale(){let e=!1;for(let r of this.#k({allowStale:!0}))this.#b(r)&&(this.delete(this.#a[r]),e=!0);return e}info(e){let r=this.#l.get(e);if(r===void 0)return;let i=this.#t[r],n=this.#f(i)?i.__staleWhileFetching:i;if(n===void 0)return;let s={value:n};if(this.#_&&this.#T){let a=this.#_[r],o=this.#T[r];if(a&&o){let l=a-(vr.now()-o);s.ttl=l,s.start=Date.now()}}return this.#x&&(s.size=this.#x[r]),s}dump(){let e=[];for(let r of this.#R({allowStale:!0})){let i=this.#a[r],n=this.#t[r],s=this.#f(n)?n.__staleWhileFetching:n;if(s===void 0||i===void 0)continue;let a={value:s};if(this.#_&&this.#T){a.ttl=this.#_[r];let o=vr.now()-this.#T[r];a.start=Math.floor(Date.now()-o)}this.#x&&(a.size=this.#x[r]),e.unshift([i,a])}return e}load(e){this.clear();for(let[r,i]of e){if(i.start){let n=Date.now()-i.start;i.start=vr.now()-n}this.set(r,i.value,i)}}set(e,r,i={}){if(r===void 0)return this.delete(e),this;let{ttl:n=this.ttl,start:s,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:l}=i,{noUpdateTTL:u=this.noUpdateTTL}=i,h=this.#j(e,r,i.size||0,o);if(this.maxEntrySize&&h>this.maxEntrySize)return l&&(l.set="miss",l.maxEntrySizeExceeded=!0),this.delete(e),this;let p=this.#u===0?void 0:this.#l.get(e);if(p===void 0)p=this.#u===0?this.#c:this.#v.length!==0?this.#v.pop():this.#u===this.#e?this.#D(!1):this.#u,this.#a[p]=e,this.#t[p]=r,this.#l.set(e,p),this.#g[this.#c]=p,this.#y[p]=this.#c,this.#c=p,this.#u++,this.#L(p,h,l),l&&(l.set="add"),u=!1;else{this.#q(p);let c=this.#t[p];if(r!==c){if(this.#M&&this.#f(c)){c.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:f}=c;f!==void 0&&!a&&(this.#w&&this.#s?.(f,e,"set"),this.#p&&this.#m?.push([f,e,"set"]))}else a||(this.#w&&this.#s?.(c,e,"set"),this.#p&&this.#m?.push([c,e,"set"]));if(this.#E(p),this.#L(p,h,l),this.#t[p]=r,l){l.set="replace";let f=c&&this.#f(c)?c.__staleWhileFetching:c;f!==void 0&&(l.oldValue=f)}}else l&&(l.set="update")}if(n!==0&&!this.#_&&this.#A(),this.#_&&(u||this.#n(p,n,s),l&&this.#S(l,p)),!a&&this.#p&&this.#m){let c=this.#m,f;for(;f=c?.shift();)this.#i?.(...f)}return this}pop(){try{for(;this.#u;){let e=this.#t[this.#d];if(this.#D(!0),this.#f(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#p&&this.#m){let e=this.#m,r;for(;r=e?.shift();)this.#i?.(...r)}}}#D(e){let r=this.#d,i=this.#a[r],n=this.#t[r];return this.#M&&this.#f(n)?n.__abortController.abort(new Error("evicted")):(this.#w||this.#p)&&(this.#w&&this.#s?.(n,i,"evict"),this.#p&&this.#m?.push([n,i,"evict"])),this.#E(r),e&&(this.#a[r]=void 0,this.#t[r]=void 0,this.#v.push(r)),this.#u===1?(this.#d=this.#c=0,this.#v.length=0):this.#d=this.#g[r],this.#l.delete(i),this.#u--,r}has(e,r={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:n}=r,s=this.#l.get(e);if(s!==void 0){let a=this.#t[s];if(this.#f(a)&&a.__staleWhileFetching===void 0)return!1;if(this.#b(s))n&&(n.has="stale",this.#S(n,s));else return i&&this.#O(s),n&&(n.has="hit",this.#S(n,s)),!0}else n&&(n.has="miss");return!1}peek(e,r={}){let{allowStale:i=this.allowStale}=r,n=this.#l.get(e);if(n===void 0||!i&&this.#b(n))return;let s=this.#t[n];return this.#f(s)?s.__staleWhileFetching:s}#C(e,r,i,n){let s=r===void 0?void 0:this.#t[r];if(this.#f(s))return s;let a=new rs,{signal:o}=i;o?.addEventListener("abort",()=>a.abort(o.reason),{signal:a.signal});let l={signal:a.signal,options:i,context:n},u=(b,S=!1)=>{let{aborted:_}=a.signal,x=i.ignoreFetchAbort&&b!==void 0;if(i.status&&(_&&!S?(i.status.fetchAborted=!0,i.status.fetchError=a.signal.reason,x&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),_&&!x&&!S)return p(a.signal.reason);let R=f;return this.#t[r]===f&&(b===void 0?R.__staleWhileFetching?this.#t[r]=R.__staleWhileFetching:this.delete(e):(i.status&&(i.status.fetchUpdated=!0),this.set(e,b,l.options))),b},h=b=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=b),p(b)),p=b=>{let{aborted:S}=a.signal,_=S&&i.allowStaleOnFetchAbort,x=_||i.allowStaleOnFetchRejection,R=x||i.noDeleteOnFetchRejection,O=f;if(this.#t[r]===f&&(!R||O.__staleWhileFetching===void 0?this.delete(e):_||(this.#t[r]=O.__staleWhileFetching)),x)return i.status&&O.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),O.__staleWhileFetching;if(O.__returned===O)throw b},c=(b,S)=>{let _=this.#o?.(e,s,l);_&&_ instanceof Promise&&_.then(x=>b(x===void 0?void 0:x),S),a.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(b(void 0),i.allowStaleOnFetchAbort&&(b=x=>u(x,!0)))})};i.status&&(i.status.fetchDispatched=!0);let f=new Promise(c).then(u,h),y=Object.assign(f,{__abortController:a,__staleWhileFetching:s,__returned:void 0});return r===void 0?(this.set(e,y,{...l.options,status:void 0}),r=this.#l.get(e)):this.#t[r]=y,y}#f(e){if(!this.#M)return!1;let r=e;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof rs}async fetch(e,r={}){let{allowStale:i=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:l=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:h=this.noUpdateTTL,noDeleteOnFetchRejection:p=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:c=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:y=this.allowStaleOnFetchAbort,context:b,forceRefresh:S=!1,status:_,signal:x}=r;if(!this.#M)return _&&(_.fetch="get"),this.get(e,{allowStale:i,updateAgeOnGet:n,noDeleteOnStaleGet:s,status:_});let R={allowStale:i,updateAgeOnGet:n,noDeleteOnStaleGet:s,ttl:a,noDisposeOnSet:o,size:l,sizeCalculation:u,noUpdateTTL:h,noDeleteOnFetchRejection:p,allowStaleOnFetchRejection:c,allowStaleOnFetchAbort:y,ignoreFetchAbort:f,status:_,signal:x},O=this.#l.get(e);if(O===void 0){_&&(_.fetch="miss");let A=this.#C(e,O,R,b);return A.__returned=A}else{let A=this.#t[O];if(this.#f(A)){let te=i&&A.__staleWhileFetching!==void 0;return _&&(_.fetch="inflight",te&&(_.returnedStale=!0)),te?A.__staleWhileFetching:A.__returned=A}let D=this.#b(O);if(!S&&!D)return _&&(_.fetch="hit"),this.#q(O),n&&this.#O(O),_&&this.#S(_,O),A;let F=this.#C(e,O,R,b),B=F.__staleWhileFetching!==void 0&&i;return _&&(_.fetch=D?"stale":"refresh",B&&D&&(_.returnedStale=!0)),B?F.__staleWhileFetching:F.__returned=F}}get(e,r={}){let{allowStale:i=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:a}=r,o=this.#l.get(e);if(o!==void 0){let l=this.#t[o],u=this.#f(l);return a&&this.#S(a,o),this.#b(o)?(a&&(a.get="stale"),u?(a&&i&&l.__staleWhileFetching!==void 0&&(a.returnedStale=!0),i?l.__staleWhileFetching:void 0):(s||this.delete(e),a&&i&&(a.returnedStale=!0),i?l:void 0)):(a&&(a.get="hit"),u?l.__staleWhileFetching:(this.#q(o),n&&this.#O(o),l))}else a&&(a.get="miss")}#F(e,r){this.#y[r]=e,this.#g[e]=r}#q(e){e!==this.#c&&(e===this.#d?this.#d=this.#g[e]:this.#F(this.#y[e],this.#g[e]),this.#F(this.#c,e),this.#c=e)}delete(e){let r=!1;if(this.#u!==0){let i=this.#l.get(e);if(i!==void 0)if(r=!0,this.#u===1)this.clear();else{this.#E(i);let n=this.#t[i];if(this.#f(n)?n.__abortController.abort(new Error("deleted")):(this.#w||this.#p)&&(this.#w&&this.#s?.(n,e,"delete"),this.#p&&this.#m?.push([n,e,"delete"])),this.#l.delete(e),this.#a[i]=void 0,this.#t[i]=void 0,i===this.#c)this.#c=this.#y[i];else if(i===this.#d)this.#d=this.#g[i];else{let s=this.#y[i];this.#g[s]=this.#g[i];let a=this.#g[i];this.#y[a]=this.#y[i]}this.#u--,this.#v.push(i)}}if(this.#p&&this.#m?.length){let i=this.#m,n;for(;n=i?.shift();)this.#i?.(...n)}return r}clear(){for(let e of this.#k({allowStale:!0})){let r=this.#t[e];if(this.#f(r))r.__abortController.abort(new Error("deleted"));else{let i=this.#a[e];this.#w&&this.#s?.(r,i,"delete"),this.#p&&this.#m?.push([r,i,"delete"])}}if(this.#l.clear(),this.#t.fill(void 0),this.#a.fill(void 0),this.#_&&this.#T&&(this.#_.fill(0),this.#T.fill(0)),this.#x&&this.#x.fill(0),this.#d=0,this.#c=0,this.#v.length=0,this.#h=0,this.#u=0,this.#p&&this.#m){let e=this.#m,r;for(;r=e?.shift();)this.#i?.(...r)}}};var Rr=require("path"),Up=require("url"),IS=pe(require("fs"),1),et=require("fs"),kt=require("fs/promises");var us=require("events"),Yo=pe(require("stream"),1),Fp=require("string_decoder"),Cp=typeof process=="object"&&process?process:{stdout:null,stderr:null},AS=t=>!!t&&typeof t=="object"&&(t instanceof Mt||t instanceof Yo.default||PS(t)||DS(t)),PS=t=>!!t&&typeof t=="object"&&t instanceof us.EventEmitter&&typeof t.pipe=="function"&&t.pipe!==Yo.default.Writable.prototype.pipe,DS=t=>!!t&&typeof t=="object"&&t instanceof us.EventEmitter&&typeof t.write=="function"&&typeof t.end=="function",lt=Symbol("EOF"),ut=Symbol("maybeEmitEnd"),Ot=Symbol("emittedEnd"),is=Symbol("emittingEnd"),gi=Symbol("emittedError"),ns=Symbol("closed"),Lp=Symbol("read"),ss=Symbol("flush"),jp=Symbol("flushChunk"),Be=Symbol("encoding"),Sr=Symbol("decoder"),se=Symbol("flowing"),mi=Symbol("paused"),Er=Symbol("resume"),ae=Symbol("buffer"),Se=Symbol("pipes"),oe=Symbol("bufferLength"),Wo=Symbol("bufferPush"),as=Symbol("bufferShift"),ge=Symbol("objectMode"),ee=Symbol("destroyed"),Bo=Symbol("error"),Uo=Symbol("emitData"),Np=Symbol("emitEnd"),zo=Symbol("emitEnd2"),Qe=Symbol("async"),Ho=Symbol("abort"),os=Symbol("aborted"),yi=Symbol("signal"),Jt=Symbol("dataListeners"),Ae=Symbol("discarded"),bi=t=>Promise.resolve().then(t),qS=t=>t(),CS=t=>t==="end"||t==="finish"||t==="prefinish",LS=t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,jS=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),ls=class{src;dest;opts;ondrain;constructor(e,r,i){this.src=e,this.dest=r,this.opts=i,this.ondrain=()=>e[Er](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Go=class extends ls{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,r,i){super(e,r,i),this.proxyErrors=n=>r.emit("error",n),e.on("error",this.proxyErrors)}},NS=t=>!!t.objectMode,FS=t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer",Mt=class extends us.EventEmitter{[se]=!1;[mi]=!1;[Se]=[];[ae]=[];[ge];[Be];[Qe];[Sr];[lt]=!1;[Ot]=!1;[is]=!1;[ns]=!1;[gi]=null;[oe]=0;[ee]=!1;[yi];[os]=!1;[Jt]=0;[Ae]=!1;writable=!0;readable=!0;constructor(...e){let r=e[0]||{};if(super(),r.objectMode&&typeof r.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");NS(r)?(this[ge]=!0,this[Be]=null):FS(r)?(this[Be]=r.encoding,this[ge]=!1):(this[ge]=!1,this[Be]=null),this[Qe]=!!r.async,this[Sr]=this[Be]?new Fp.StringDecoder(this[Be]):null,r&&r.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[ae]}),r&&r.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[Se]});let{signal:i}=r;i&&(this[yi]=i,i.aborted?this[Ho]():i.addEventListener("abort",()=>this[Ho]()))}get bufferLength(){return this[oe]}get encoding(){return this[Be]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[ge]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[Qe]}set async(e){this[Qe]=this[Qe]||!!e}[Ho](){this[os]=!0,this.emit("abort",this[yi]?.reason),this.destroy(this[yi]?.reason)}get aborted(){return this[os]}set aborted(e){}write(e,r,i){if(this[os])return!1;if(this[lt])throw new Error("write after end");if(this[ee])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof r=="function"&&(i=r,r="utf8"),r||(r="utf8");let n=this[Qe]?bi:qS;if(!this[ge]&&!Buffer.isBuffer(e)){if(jS(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(LS(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[ge]?(this[se]&&this[oe]!==0&&this[ss](!0),this[se]?this.emit("data",e):this[Wo](e),this[oe]!==0&&this.emit("readable"),i&&n(i),this[se]):e.length?(typeof e=="string"&&!(r===this[Be]&&!this[Sr]?.lastNeed)&&(e=Buffer.from(e,r)),Buffer.isBuffer(e)&&this[Be]&&(e=this[Sr].write(e)),this[se]&&this[oe]!==0&&this[ss](!0),this[se]?this.emit("data",e):this[Wo](e),this[oe]!==0&&this.emit("readable"),i&&n(i),this[se]):(this[oe]!==0&&this.emit("readable"),i&&n(i),this[se])}read(e){if(this[ee])return null;if(this[Ae]=!1,this[oe]===0||e===0||e&&e>this[oe])return this[ut](),null;this[ge]&&(e=null),this[ae].length>1&&!this[ge]&&(this[ae]=[this[Be]?this[ae].join(""):Buffer.concat(this[ae],this[oe])]);let r=this[Lp](e||null,this[ae][0]);return this[ut](),r}[Lp](e,r){if(this[ge])this[as]();else{let i=r;e===i.length||e===null?this[as]():typeof i=="string"?(this[ae][0]=i.slice(e),r=i.slice(0,e),this[oe]-=e):(this[ae][0]=i.subarray(e),r=i.subarray(0,e),this[oe]-=e)}return this.emit("data",r),!this[ae].length&&!this[lt]&&this.emit("drain"),r}end(e,r,i){return typeof e=="function"&&(i=e,e=void 0),typeof r=="function"&&(i=r,r="utf8"),e!==void 0&&this.write(e,r),i&&this.once("end",i),this[lt]=!0,this.writable=!1,(this[se]||!this[mi])&&this[ut](),this}[Er](){this[ee]||(!this[Jt]&&!this[Se].length&&(this[Ae]=!0),this[mi]=!1,this[se]=!0,this.emit("resume"),this[ae].length?this[ss]():this[lt]?this[ut]():this.emit("drain"))}resume(){return this[Er]()}pause(){this[se]=!1,this[mi]=!0,this[Ae]=!1}get destroyed(){return this[ee]}get flowing(){return this[se]}get paused(){return this[mi]}[Wo](e){this[ge]?this[oe]+=1:this[oe]+=e.length,this[ae].push(e)}[as](){return this[ge]?this[oe]-=1:this[oe]-=this[ae][0].length,this[ae].shift()}[ss](e=!1){do;while(this[jp](this[as]())&&this[ae].length);!e&&!this[ae].length&&!this[lt]&&this.emit("drain")}[jp](e){return this.emit("data",e),this[se]}pipe(e,r){if(this[ee])return e;this[Ae]=!1;let i=this[Ot];return r=r||{},e===Cp.stdout||e===Cp.stderr?r.end=!1:r.end=r.end!==!1,r.proxyErrors=!!r.proxyErrors,i?r.end&&e.end():(this[Se].push(r.proxyErrors?new Go(this,e,r):new ls(this,e,r)),this[Qe]?bi(()=>this[Er]()):this[Er]()),e}unpipe(e){let r=this[Se].find(i=>i.dest===e);r&&(this[Se].length===1?(this[se]&&this[Jt]===0&&(this[se]=!1),this[Se]=[]):this[Se].splice(this[Se].indexOf(r),1),r.unpipe())}addListener(e,r){return this.on(e,r)}on(e,r){let i=super.on(e,r);if(e==="data")this[Ae]=!1,this[Jt]++,!this[Se].length&&!this[se]&&this[Er]();else if(e==="readable"&&this[oe]!==0)super.emit("readable");else if(CS(e)&&this[Ot])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[gi]){let n=r;this[Qe]?bi(()=>n.call(this,this[gi])):n.call(this,this[gi])}return i}removeListener(e,r){return this.off(e,r)}off(e,r){let i=super.off(e,r);return e==="data"&&(this[Jt]=this.listeners("data").length,this[Jt]===0&&!this[Ae]&&!this[Se].length&&(this[se]=!1)),i}removeAllListeners(e){let r=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Jt]=0,!this[Ae]&&!this[Se].length&&(this[se]=!1)),r}get emittedEnd(){return this[Ot]}[ut](){!this[is]&&!this[Ot]&&!this[ee]&&this[ae].length===0&&this[lt]&&(this[is]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[ns]&&this.emit("close"),this[is]=!1)}emit(e,...r){let i=r[0];if(e!=="error"&&e!=="close"&&e!==ee&&this[ee])return!1;if(e==="data")return!this[ge]&&!i?!1:this[Qe]?(bi(()=>this[Uo](i)),!0):this[Uo](i);if(e==="end")return this[Np]();if(e==="close"){if(this[ns]=!0,!this[Ot]&&!this[ee])return!1;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[gi]=i,super.emit(Bo,i);let s=!this[yi]||this.listeners("error").length?super.emit("error",i):!1;return this[ut](),s}else if(e==="resume"){let s=super.emit("resume");return this[ut](),s}else if(e==="finish"||e==="prefinish"){let s=super.emit(e);return this.removeAllListeners(e),s}let n=super.emit(e,...r);return this[ut](),n}[Uo](e){for(let i of this[Se])i.dest.write(e)===!1&&this.pause();let r=this[Ae]?!1:super.emit("data",e);return this[ut](),r}[Np](){return this[Ot]?!1:(this[Ot]=!0,this.readable=!1,this[Qe]?(bi(()=>this[zo]()),!0):this[zo]())}[zo](){if(this[Sr]){let r=this[Sr].end();if(r){for(let i of this[Se])i.dest.write(r);this[Ae]||super.emit("data",r)}}for(let r of this[Se])r.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[ge]||(e.dataLength=0);let r=this.promise();return this.on("data",i=>{e.push(i),this[ge]||(e.dataLength+=i.length)}),await r,e}async concat(){if(this[ge])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[Be]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,r)=>{this.on(ee,()=>r(new Error("stream destroyed"))),this.on("error",i=>r(i)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[Ae]=!1;let e=!1,r=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return r();let n=this.read();if(n!==null)return Promise.resolve({done:!1,value:n});if(this[lt])return r();let s,a,o=p=>{this.off("data",l),this.off("end",u),this.off(ee,h),r(),a(p)},l=p=>{this.off("error",o),this.off("end",u),this.off(ee,h),this.pause(),s({value:p,done:!!this[lt]})},u=()=>{this.off("error",o),this.off("data",l),this.off(ee,h),r(),s({done:!0,value:void 0})},h=()=>o(new Error("stream destroyed"));return new Promise((p,c)=>{a=c,s=p,this.once(ee,h),this.once("error",o),this.once("end",u),this.once("data",l)})},throw:r,return:r,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[Ae]=!1;let e=!1,r=()=>(this.pause(),this.off(Bo,r),this.off(ee,r),this.off("end",r),e=!0,{done:!0,value:void 0}),i=()=>{if(e)return r();let n=this.read();return n===null?r():{done:!1,value:n}};return this.once("end",r),this.once(Bo,r),this.once(ee,r),{next:i,throw:r,return:r,[Symbol.iterator](){return this}}}destroy(e){if(this[ee])return e?this.emit("error",e):this.emit(ee),this;this[ee]=!0,this[Ae]=!0,this[ae].length=0,this[oe]=0;let r=this;return typeof r.close=="function"&&!this[ns]&&r.close(),e?this.emit("error",e):this.emit(ee),this}static get isStream(){return AS}};var $S=et.realpathSync.native,vi={lstatSync:et.lstatSync,readdir:et.readdir,readdirSync:et.readdirSync,readlinkSync:et.readlinkSync,realpathSync:$S,promises:{lstat:kt.lstat,readdir:kt.readdir,readlink:kt.readlink,realpath:kt.realpath}},zp=t=>!t||t===vi||t===IS?vi:{...vi,...t,promises:{...vi.promises,...t.promises||{}}},Hp=/^\\\\\?\\([a-z]:)\\?$/i,WS=t=>t.replace(/\//g,"\\").replace(Hp,"$1\\"),BS=/[\\\/]/,Ne=0,Gp=1,Yp=2,Xe=4,Vp=6,Kp=8,Zt=10,Jp=12,je=15,wi=~je,Vo=16,Ip=32,_i=64,Ue=128,fs=256,cs=512,$p=_i|Ue|cs,US=1023,Ko=t=>t.isFile()?Kp:t.isDirectory()?Xe:t.isSymbolicLink()?Zt:t.isCharacterDevice()?Yp:t.isBlockDevice()?Vp:t.isSocket()?Jp:t.isFIFO()?Gp:Ne,Wp=new Map,Si=t=>{let e=Wp.get(t);if(e)return e;let r=t.normalize("NFKD");return Wp.set(t,r),r},Bp=new Map,hs=t=>{let e=Bp.get(t);if(e)return e;let r=Si(t.toLowerCase());return Bp.set(t,r),r},ds=class extends pi{constructor(){super({max:256})}},Jo=class extends pi{constructor(e=16*1024){super({maxSize:e,sizeCalculation:r=>r.length+1})}},Zp=Symbol("PathScurry setAsCwd"),me=class{name;root;roots;parent;nocase;#e;#r;get dev(){return this.#r}#s;get mode(){return this.#s}#i;get nlink(){return this.#i}#o;get uid(){return this.#o}#u;get gid(){return this.#u}#h;get rdev(){return this.#h}#l;get blksize(){return this.#l}#a;get ino(){return this.#a}#t;get size(){return this.#t}#g;get blocks(){return this.#g}#y;get atimeMs(){return this.#y}#d;get mtimeMs(){return this.#d}#c;get ctimeMs(){return this.#c}#v;get birthtimeMs(){return this.#v}#m;get atime(){return this.#m}#x;get mtime(){return this.#x}#T;get ctime(){return this.#T}#_;get birthtime(){return this.#_}#w;#M;#p;#A;#O;#S;#n;#b;#P;#E;get path(){return(this.parent||this).fullpath()}constructor(e,r=Ne,i,n,s,a,o){this.name=e,this.#w=s?hs(e):Si(e),this.#n=r&US,this.nocase=s,this.roots=n,this.root=i||this,this.#b=a,this.#p=o.fullpath,this.#O=o.relative,this.#S=o.relativePosix,this.parent=o.parent,this.parent?this.#e=this.parent.#e:this.#e=zp(o.fs)}depth(){return this.#M!==void 0?this.#M:this.parent?this.#M=this.parent.depth()+1:this.#M=0}childrenCache(){return this.#b}resolve(e){if(!e)return this;let r=this.getRootString(e),n=e.substring(r.length).split(this.splitSep);return r?this.getRoot(r).#L(n):this.#L(n)}#L(e){let r=this;for(let i of e)r=r.child(i);return r}children(){let e=this.#b.get(this);if(e)return e;let r=Object.assign([],{provisional:0});return this.#b.set(this,r),this.#n&=~Vo,r}child(e,r){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let i=this.children(),n=this.nocase?hs(e):Si(e);for(let l of i)if(l.#w===n)return l;let s=this.parent?this.sep:"",a=this.#p?this.#p+s+e:void 0,o=this.newChild(e,Ne,{...r,parent:this,fullpath:a});return this.canReaddir()||(o.#n|=Ue),i.push(o),o}relative(){if(this.#O!==void 0)return this.#O;let e=this.name,r=this.parent;if(!r)return this.#O=this.name;let i=r.relative();return i+(!i||!r.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.#S!==void 0)return this.#S;let e=this.name,r=this.parent;if(!r)return this.#S=this.fullpathPosix();let i=r.relativePosix();return i+(!i||!r.parent?"":"/")+e}fullpath(){if(this.#p!==void 0)return this.#p;let e=this.name,r=this.parent;if(!r)return this.#p=this.name;let n=r.fullpath()+(r.parent?this.sep:"")+e;return this.#p=n}fullpathPosix(){if(this.#A!==void 0)return this.#A;if(this.sep==="/")return this.#A=this.fullpath();if(!this.parent){let n=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(n)?this.#A=`//?/${n}`:this.#A=n}let e=this.parent,r=e.fullpathPosix(),i=r+(!r||!e.parent?"":"/")+this.name;return this.#A=i}isUnknown(){return(this.#n&je)===Ne}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#n&je)===Kp}isDirectory(){return(this.#n&je)===Xe}isCharacterDevice(){return(this.#n&je)===Yp}isBlockDevice(){return(this.#n&je)===Vp}isFIFO(){return(this.#n&je)===Gp}isSocket(){return(this.#n&je)===Jp}isSymbolicLink(){return(this.#n&Zt)===Zt}lstatCached(){return this.#n&Ip?this:void 0}readlinkCached(){return this.#P}realpathCached(){return this.#E}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#P)return!0;if(!this.parent)return!1;let e=this.#n&je;return!(e!==Ne&&e!==Zt||this.#n&fs||this.#n&Ue)}calledReaddir(){return!!(this.#n&Vo)}isENOENT(){return!!(this.#n&Ue)}isNamed(e){return this.nocase?this.#w===hs(e):this.#w===Si(e)}async readlink(){let e=this.#P;if(e)return e;if(this.canReadlink()&&this.parent)try{let r=await this.#e.promises.readlink(this.fullpath()),i=(await this.parent.realpath())?.resolve(r);if(i)return this.#P=i}catch(r){this.#F(r.code);return}}readlinkSync(){let e=this.#P;if(e)return e;if(this.canReadlink()&&this.parent)try{let r=this.#e.readlinkSync(this.fullpath()),i=this.parent.realpathSync()?.resolve(r);if(i)return this.#P=i}catch(r){this.#F(r.code);return}}#j(e){this.#n|=Vo;for(let r=e.provisional;r<e.length;r++){let i=e[r];i&&i.#R()}}#R(){this.#n&Ue||(this.#n=(this.#n|Ue)&wi,this.#k())}#k(){let e=this.children();e.provisional=0;for(let r of e)r.#R()}#N(){this.#n|=cs,this.#D()}#D(){if(this.#n&_i)return;let e=this.#n;(e&je)===Xe&&(e&=wi),this.#n=e|_i,this.#k()}#C(e=""){e==="ENOTDIR"||e==="EPERM"?this.#D():e==="ENOENT"?this.#R():this.children().provisional=0}#f(e=""){e==="ENOTDIR"?this.parent.#D():e==="ENOENT"&&this.#R()}#F(e=""){let r=this.#n;r|=fs,e==="ENOENT"&&(r|=Ue),(e==="EINVAL"||e==="UNKNOWN")&&(r&=wi),this.#n=r,e==="ENOTDIR"&&this.parent&&this.parent.#D()}#q(e,r){return this.#z(e,r)||this.#U(e,r)}#U(e,r){let i=Ko(e),n=this.newChild(e.name,i,{parent:this}),s=n.#n&je;return s!==Xe&&s!==Zt&&s!==Ne&&(n.#n|=_i),r.unshift(n),r.provisional++,n}#z(e,r){for(let i=r.provisional;i<r.length;i++){let n=r[i];if((this.nocase?hs(e.name):Si(e.name))===n.#w)return this.#H(e,n,i,r)}}#H(e,r,i,n){let s=r.name;return r.#n=r.#n&wi|Ko(e),s!==e.name&&(r.name=e.name),i!==n.provisional&&(i===n.length-1?n.pop():n.splice(i,1),n.unshift(r)),n.provisional++,r}async lstat(){if(!(this.#n&Ue))try{return this.#B(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#f(e.code)}}lstatSync(){if(!(this.#n&Ue))try{return this.#B(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#f(e.code)}}#B(e){let{atime:r,atimeMs:i,birthtime:n,birthtimeMs:s,blksize:a,blocks:o,ctime:l,ctimeMs:u,dev:h,gid:p,ino:c,mode:f,mtime:y,mtimeMs:b,nlink:S,rdev:_,size:x,uid:R}=e;this.#m=r,this.#y=i,this.#_=n,this.#v=s,this.#l=a,this.#g=o,this.#T=l,this.#c=u,this.#r=h,this.#u=p,this.#a=c,this.#s=f,this.#x=y,this.#d=b,this.#i=S,this.#h=_,this.#t=x,this.#o=R;let O=Ko(e);this.#n=this.#n&wi|O|Ip,O!==Ne&&O!==Xe&&O!==Zt&&(this.#n|=_i)}#$=[];#W=!1;#G(e){this.#W=!1;let r=this.#$.slice();this.#$.length=0,r.forEach(i=>i(null,e))}readdirCB(e,r=!1){if(!this.canReaddir()){r?e(null,[]):queueMicrotask(()=>e(null,[]));return}let i=this.children();if(this.calledReaddir()){let s=i.slice(0,i.provisional);r?e(null,s):queueMicrotask(()=>e(null,s));return}if(this.#$.push(e),this.#W)return;this.#W=!0;let n=this.fullpath();this.#e.readdir(n,{withFileTypes:!0},(s,a)=>{if(s)this.#C(s.code),i.provisional=0;else{for(let o of a)this.#q(o,i);this.#j(i)}this.#G(i.slice(0,i.provisional))})}#I;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let r=this.fullpath();if(this.#I)await this.#I;else{let i=()=>{};this.#I=new Promise(n=>i=n);try{for(let n of await this.#e.promises.readdir(r,{withFileTypes:!0}))this.#q(n,e);this.#j(e)}catch(n){this.#C(n.code),e.provisional=0}this.#I=void 0,i()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let r=this.fullpath();try{for(let i of this.#e.readdirSync(r,{withFileTypes:!0}))this.#q(i,e);this.#j(e)}catch(i){this.#C(i.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#n&$p)return!1;let e=je&this.#n;return e===Ne||e===Xe||e===Zt}shouldWalk(e,r){return(this.#n&Xe)===Xe&&!(this.#n&$p)&&!e.has(this)&&(!r||r(this))}async realpath(){if(this.#E)return this.#E;if(!((cs|fs|Ue)&this.#n))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#E=this.resolve(e)}catch{this.#N()}}realpathSync(){if(this.#E)return this.#E;if(!((cs|fs|Ue)&this.#n))try{let e=this.#e.realpathSync(this.fullpath());return this.#E=this.resolve(e)}catch{this.#N()}}[Zp](e){if(e===this)return;let r=new Set([]),i=[],n=this;for(;n&&n.parent;)r.add(n),n.#O=i.join(this.sep),n.#S=i.join("/"),n=n.parent,i.push("..");for(n=e;n&&n.parent&&!r.has(n);)n.#O=void 0,n.#S=void 0,n=n.parent}},ps=class t extends me{sep="\\";splitSep=BS;constructor(e,r=Ne,i,n,s,a,o){super(e,r,i,n,s,a,o)}newChild(e,r=Ne,i={}){return new t(e,r,this.root,this.roots,this.nocase,this.childrenCache(),i)}getRootString(e){return Rr.win32.parse(e).root}getRoot(e){if(e=WS(e.toUpperCase()),e===this.root.name)return this.root;for(let[r,i]of Object.entries(this.roots))if(this.sameRoot(e,r))return this.roots[e]=i;return this.roots[e]=new xr(e,this).root}sameRoot(e,r=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(Hp,"$1\\"),e===r}},gs=class t extends me{splitSep="/";sep="/";constructor(e,r=Ne,i,n,s,a,o){super(e,r,i,n,s,a,o)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,r=Ne,i={}){return new t(e,r,this.root,this.roots,this.nocase,this.childrenCache(),i)}},ms=class{root;rootPath;roots;cwd;#e;#r;#s;nocase;#i;constructor(e=process.cwd(),r,i,{nocase:n,childrenCacheSize:s=16*1024,fs:a=vi}={}){this.#i=zp(a),(e instanceof URL||e.startsWith("file://"))&&(e=(0,Up.fileURLToPath)(e));let o=r.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(o),this.#e=new ds,this.#r=new ds,this.#s=new Jo(s);let l=o.substring(this.rootPath.length).split(i);if(l.length===1&&!l[0]&&l.pop(),n===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=n,this.root=this.newRoot(this.#i),this.roots[this.rootPath]=this.root;let u=this.root,h=l.length-1,p=r.sep,c=this.rootPath,f=!1;for(let y of l){let b=h--;u=u.child(y,{relative:new Array(b).fill("..").join(p),relativePosix:new Array(b).fill("..").join("/"),fullpath:c+=(f?"":p)+y}),f=!0}this.cwd=u}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#s}resolve(...e){let r="";for(let s=e.length-1;s>=0;s--){let a=e[s];if(!(!a||a===".")&&(r=r?`${a}/${r}`:a,this.isAbsolute(a)))break}let i=this.#e.get(r);if(i!==void 0)return i;let n=this.cwd.resolve(r).fullpath();return this.#e.set(r,n),n}resolvePosix(...e){let r="";for(let s=e.length-1;s>=0;s--){let a=e[s];if(!(!a||a===".")&&(r=r?`${a}/${r}`:a,this.isAbsolute(a)))break}let i=this.#r.get(r);if(i!==void 0)return i;let n=this.cwd.resolve(r).fullpathPosix();return this.#r.set(r,n),n}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,r={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof me||(r=e,e=this.cwd);let{withFileTypes:i}=r;if(e.canReaddir()){let n=await e.readdir();return i?n:n.map(s=>s.name)}else return[]}readdirSync(e=this.cwd,r={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof me||(r=e,e=this.cwd);let{withFileTypes:i=!0}=r;return e.canReaddir()?i?e.readdirSync():e.readdirSync().map(n=>n.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof me||(r=e.withFileTypes,e=this.cwd);let i=await e.readlink();return r?i:i?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof me||(r=e.withFileTypes,e=this.cwd);let i=e.readlinkSync();return r?i:i?.fullpath()}async realpath(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof me||(r=e.withFileTypes,e=this.cwd);let i=await e.realpath();return r?i:i?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof me||(r=e.withFileTypes,e=this.cwd);let i=e.realpathSync();return r?i:i?.fullpath()}async walk(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof me||(r=e,e=this.cwd);let{withFileTypes:i=!0,follow:n=!1,filter:s,walkFilter:a}=r,o=[];(!s||s(e))&&o.push(i?e:e.fullpath());let l=new Set,u=(p,c)=>{l.add(p),p.readdirCB((f,y)=>{if(f)return c(f);let b=y.length;if(!b)return c();let S=()=>{--b===0&&c()};for(let _ of y)(!s||s(_))&&o.push(i?_:_.fullpath()),n&&_.isSymbolicLink()?_.realpath().then(x=>x?.isUnknown()?x.lstat():x).then(x=>x?.shouldWalk(l,a)?u(x,S):S()):_.shouldWalk(l,a)?u(_,S):S()},!0)},h=e;return new Promise((p,c)=>{u(h,f=>{if(f)return c(f);p(o)})})}walkSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof me||(r=e,e=this.cwd);let{withFileTypes:i=!0,follow:n=!1,filter:s,walkFilter:a}=r,o=[];(!s||s(e))&&o.push(i?e:e.fullpath());let l=new Set([e]);for(let u of l){let h=u.readdirSync();for(let p of h){(!s||s(p))&&o.push(i?p:p.fullpath());let c=p;if(p.isSymbolicLink()){if(!(n&&(c=p.realpathSync())))continue;c.isUnknown()&&c.lstatSync()}c.shouldWalk(l,a)&&l.add(c)}}return o}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,r={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof me||(r=e,e=this.cwd),this.stream(e,r)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof me||(r=e,e=this.cwd);let{withFileTypes:i=!0,follow:n=!1,filter:s,walkFilter:a}=r;(!s||s(e))&&(yield i?e:e.fullpath());let o=new Set([e]);for(let l of o){let u=l.readdirSync();for(let h of u){(!s||s(h))&&(yield i?h:h.fullpath());let p=h;if(h.isSymbolicLink()){if(!(n&&(p=h.realpathSync())))continue;p.isUnknown()&&p.lstatSync()}p.shouldWalk(o,a)&&o.add(p)}}}stream(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof me||(r=e,e=this.cwd);let{withFileTypes:i=!0,follow:n=!1,filter:s,walkFilter:a}=r,o=new Mt({objectMode:!0});(!s||s(e))&&o.write(i?e:e.fullpath());let l=new Set,u=[e],h=0,p=()=>{let c=!1;for(;!c;){let f=u.shift();if(!f){h===0&&o.end();return}h++,l.add(f);let y=(S,_,x=!1)=>{if(S)return o.emit("error",S);if(n&&!x){let R=[];for(let O of _)O.isSymbolicLink()&&R.push(O.realpath().then(A=>A?.isUnknown()?A.lstat():A));if(R.length){Promise.all(R).then(()=>y(null,_,!0));return}}for(let R of _)R&&(!s||s(R))&&(o.write(i?R:R.fullpath())||(c=!0));h--;for(let R of _){let O=R.realpathCached()||R;O.shouldWalk(l,a)&&u.push(O)}c&&!o.flowing?o.once("drain",p):b||p()},b=!0;f.readdirCB(y,!0),b=!1}};return p(),o}streamSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof me||(r=e,e=this.cwd);let{withFileTypes:i=!0,follow:n=!1,filter:s,walkFilter:a}=r,o=new Mt({objectMode:!0}),l=new Set;(!s||s(e))&&o.write(i?e:e.fullpath());let u=[e],h=0,p=()=>{let c=!1;for(;!c;){let f=u.shift();if(!f){h===0&&o.end();return}h++,l.add(f);let y=f.readdirSync();for(let b of y)(!s||s(b))&&(o.write(i?b:b.fullpath())||(c=!0));h--;for(let b of y){let S=b;if(b.isSymbolicLink()){if(!(n&&(S=b.realpathSync())))continue;S.isUnknown()&&S.lstatSync()}S.shouldWalk(l,a)&&u.push(S)}}c&&!o.flowing&&o.once("drain",p)};return p(),o}chdir(e=this.cwd){let r=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[Zp](r)}},xr=class extends ms{sep="\\";constructor(e=process.cwd(),r={}){let{nocase:i=!0}=r;super(e,Rr.win32,"\\",{...r,nocase:i}),this.nocase=i;for(let n=this.cwd;n;n=n.parent)n.nocase=this.nocase}parseRootPath(e){return Rr.win32.parse(e).root.toUpperCase()}newRoot(e){return new ps(this.rootPath,Xe,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},Tr=class extends ms{sep="/";constructor(e=process.cwd(),r={}){let{nocase:i=!1}=r;super(e,Rr.posix,"/",{...r,nocase:i}),this.nocase=i}parseRootPath(e){return"/"}newRoot(e){return new gs(this.rootPath,Xe,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},Ei=class extends Tr{constructor(e=process.cwd(),r={}){let{nocase:i=!0}=r;super(e,{...r,nocase:i})}},mx=process.platform==="win32"?ps:gs,Qp=process.platform==="win32"?xr:process.platform==="darwin"?Ei:Tr;var Xp=require("url");var zS=t=>t.length>=1,HS=t=>t.length>=1,Or=class t{#e;#r;#s;length;#i;#o;#u;#h;#l;#a;#t=!0;constructor(e,r,i,n){if(!zS(e))throw new TypeError("empty pattern list");if(!HS(r))throw new TypeError("empty glob list");if(r.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,i<0||i>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#r=r,this.#s=i,this.#i=n,this.#s===0){if(this.isUNC()){let[s,a,o,l,...u]=this.#e,[h,p,c,f,...y]=this.#r;u[0]===""&&(u.shift(),y.shift());let b=[s,a,o,l,""].join("/"),S=[h,p,c,f,""].join("/");this.#e=[b,...u],this.#r=[S,...y],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[s,...a]=this.#e,[o,...l]=this.#r;a[0]===""&&(a.shift(),l.shift());let u=s+"/",h=o+"/";this.#e=[u,...a],this.#r=[h,...l],this.length=this.#e.length}}}pattern(){return this.#e[this.#s]}isString(){return typeof this.#e[this.#s]=="string"}isGlobstar(){return this.#e[this.#s]===he}isRegExp(){return this.#e[this.#s]instanceof RegExp}globString(){return this.#u=this.#u||(this.#s===0?this.isAbsolute()?this.#r[0]+this.#r.slice(1).join("/"):this.#r.join("/"):this.#r.slice(this.#s).join("/"))}hasMore(){return this.length>this.#s+1}rest(){return this.#o!==void 0?this.#o:this.hasMore()?(this.#o=new t(this.#e,this.#r,this.#s+1,this.#i),this.#o.#a=this.#a,this.#o.#l=this.#l,this.#o.#h=this.#h,this.#o):this.#o=null}isUNC(){let e=this.#e;return this.#l!==void 0?this.#l:this.#l=this.#i==="win32"&&this.#s===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#e;return this.#h!==void 0?this.#h:this.#h=this.#i==="win32"&&this.#s===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#a!==void 0?this.#a:this.#a=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#s===0?e:""}checkFollowGlobstar(){return!(this.#s===0||!this.isGlobstar()||!this.#t)}markFollowGlobstar(){return this.#s===0||!this.isGlobstar()||!this.#t?!1:(this.#t=!1,!0)}};var GS=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Ri=class{relative;relativeChildren;absolute;absoluteChildren;constructor(e,{nobrace:r,nocase:i,noext:n,noglobstar:s,platform:a=GS}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[];let o={dot:!0,nobrace:r,nocase:i,noext:n,noglobstar:s,optimizationLevel:2,platform:a,nocomment:!0,nonegate:!0};for(let l of e){let u=new ke(l,o);for(let h=0;h<u.set.length;h++){let p=u.set[h],c=u.globParts[h];if(!p||!c)throw new Error("invalid pattern object");for(;p[0]==="."&&c[0]===".";)p.shift(),c.shift();let f=new Or(p,c,0,a),y=new ke(f.globString(),o),b=c[c.length-1]==="**",S=f.isAbsolute();S?this.absolute.push(y):this.relative.push(y),b&&(S?this.absoluteChildren.push(y):this.relativeChildren.push(y))}}}ignored(e){let r=e.fullpath(),i=`${r}/`,n=e.relative()||".",s=`${n}/`;for(let a of this.relative)if(a.match(n)||a.match(s))return!0;for(let a of this.absolute)if(a.match(r)||a.match(i))return!0;return!1}childrenIgnored(e){let r=e.fullpath()+"/",i=(e.relative()||".")+"/";for(let n of this.relativeChildren)if(n.match(i))return!0;for(let n of this.absoluteChildren)if(n.match(r))return!0;return!1}};var Zo=class t{store;constructor(e=new Map){this.store=e}copy(){return new t(new Map(this.store))}hasWalked(e,r){return this.store.get(e.fullpath())?.has(r.globString())}storeWalked(e,r){let i=e.fullpath(),n=this.store.get(i);n?n.add(r.globString()):this.store.set(i,new Set([r.globString()]))}},Qo=class{store=new Map;add(e,r,i){let n=(r?2:0)|(i?1:0),s=this.store.get(e);this.store.set(e,s===void 0?n:n&s)}entries(){return[...this.store.entries()].map(([e,r])=>[e,!!(r&2),!!(r&1)])}},Xo=class{store=new Map;add(e,r){if(!e.canReaddir())return;let i=this.store.get(e);i?i.find(n=>n.globString()===r.globString())||i.push(r):this.store.set(e,[r])}get(e){let r=this.store.get(e);if(!r)throw new Error("attempting to walk unknown path");return r}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}},xi=class t{hasWalkedCache;matches=new Qo;subwalks=new Xo;patterns;follow;dot;opts;constructor(e,r){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=r?r.copy():new Zo}processPatterns(e,r){this.patterns=r;let i=r.map(n=>[e,n]);for(let[n,s]of i){this.hasWalkedCache.storeWalked(n,s);let a=s.root(),o=s.isAbsolute()&&this.opts.absolute!==!1;if(a){n=n.resolve(a==="/"&&this.opts.root!==void 0?this.opts.root:a);let p=s.rest();if(p)s=p;else{this.matches.add(n,!0,!1);continue}}if(n.isENOENT())continue;let l,u,h=!1;for(;typeof(l=s.pattern())=="string"&&(u=s.rest());)n=n.resolve(l),s=u,h=!0;if(l=s.pattern(),u=s.rest(),h){if(this.hasWalkedCache.hasWalked(n,s))continue;this.hasWalkedCache.storeWalked(n,s)}if(typeof l=="string"){let p=l===".."||l===""||l===".";this.matches.add(n.resolve(l),o,p);continue}else if(l===he){(!n.isSymbolicLink()||this.follow||s.checkFollowGlobstar())&&this.subwalks.add(n,s);let p=u?.pattern(),c=u?.rest();if(!u||(p===""||p===".")&&!c)this.matches.add(n,o,p===""||p===".");else if(p===".."){let f=n.parent||n;c?this.hasWalkedCache.hasWalked(f,c)||this.subwalks.add(f,c):this.matches.add(f,o,!0)}}else l instanceof RegExp&&this.subwalks.add(n,s)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new t(this.opts,this.hasWalkedCache)}filterEntries(e,r){let i=this.subwalks.get(e),n=this.child();for(let s of r)for(let a of i){let o=a.isAbsolute(),l=a.pattern(),u=a.rest();l===he?n.testGlobstar(s,a,u,o):l instanceof RegExp?n.testRegExp(s,l,u,o):n.testString(s,l,u,o)}return n}testGlobstar(e,r,i,n){if((this.dot||!e.name.startsWith("."))&&(r.hasMore()||this.matches.add(e,n,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,r):e.isSymbolicLink()&&(i&&r.checkFollowGlobstar()?this.subwalks.add(e,i):r.markFollowGlobstar()&&this.subwalks.add(e,r)))),i){let s=i.pattern();if(typeof s=="string"&&s!==".."&&s!==""&&s!==".")this.testString(e,s,i.rest(),n);else if(s===".."){let a=e.parent||e;this.subwalks.add(a,i)}else s instanceof RegExp&&this.testRegExp(e,s,i.rest(),n)}}testRegExp(e,r,i,n){r.test(e.name)&&(i?this.subwalks.add(e,i):this.matches.add(e,n,!1))}testString(e,r,i,n){e.isNamed(r)&&(i?this.subwalks.add(e,i):this.matches.add(e,n,!1))}};var YS=(t,e)=>typeof t=="string"?new Ri([t],e):Array.isArray(t)?new Ri(t,e):t,ys=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#r;#s;signal;maxDepth;constructor(e,r,i){this.patterns=e,this.path=r,this.opts=i,this.#s=!i.posix&&i.platform==="win32"?"\\":"/",i.ignore&&(this.#r=YS(i.ignore,i)),this.maxDepth=i.maxDepth||1/0,i.signal&&(this.signal=i.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#i(e){return this.seen.has(e)||!!this.#r?.ignored?.(e)}#o(e){return!!this.#r?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#e.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#e.push(e):e())}async matchCheck(e,r){if(r&&this.opts.nodir)return;let i;if(this.opts.realpath){if(i=e.realpathCached()||await e.realpath(),!i)return;e=i}let s=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let a=await s.realpath();a&&(a.isUnknown()||this.opts.stat)&&await a.lstat()}return this.matchCheckTest(s,r)}matchCheckTest(e,r){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!r||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#i(e)?e:void 0}matchCheckSync(e,r){if(r&&this.opts.nodir)return;let i;if(this.opts.realpath){if(i=e.realpathCached()||e.realpathSync(),!i)return;e=i}let s=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let a=s.realpathSync();a&&(a?.isUnknown()||this.opts.stat)&&a.lstatSync()}return this.matchCheckTest(s,r)}matchFinish(e,r){if(this.#i(e))return;let i=this.opts.absolute===void 0?r:this.opts.absolute;this.seen.add(e);let n=this.opts.mark&&e.isDirectory()?this.#s:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(i){let s=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(s+n)}else{let s=this.opts.posix?e.relativePosix():e.relative(),a=this.opts.dotRelative&&!s.startsWith(".."+this.#s)?"."+this.#s:"";this.matchEmit(s?a+s+n:"."+n)}}async match(e,r,i){let n=await this.matchCheck(e,i);n&&this.matchFinish(n,r)}matchSync(e,r,i){let n=this.matchCheckSync(e,i);n&&this.matchFinish(n,r)}walkCB(e,r,i){this.signal?.aborted&&i(),this.walkCB2(e,r,new xi(this.opts),i)}walkCB2(e,r,i,n){if(this.#o(e))return n();if(this.signal?.aborted&&n(),this.paused){this.onResume(()=>this.walkCB2(e,r,i,n));return}i.processPatterns(e,r);let s=1,a=()=>{--s===0&&n()};for(let[o,l,u]of i.matches.entries())this.#i(o)||(s++,this.match(o,l,u).then(()=>a()));for(let o of i.subwalkTargets()){if(this.maxDepth!==1/0&&o.depth()>=this.maxDepth)continue;s++;let l=o.readdirCached();o.calledReaddir()?this.walkCB3(o,l,i,a):o.readdirCB((u,h)=>this.walkCB3(o,h,i,a),!0)}a()}walkCB3(e,r,i,n){i=i.filterEntries(e,r);let s=1,a=()=>{--s===0&&n()};for(let[o,l,u]of i.matches.entries())this.#i(o)||(s++,this.match(o,l,u).then(()=>a()));for(let[o,l]of i.subwalks.entries())s++,this.walkCB2(o,l,i.child(),a);a()}walkCBSync(e,r,i){this.signal?.aborted&&i(),this.walkCB2Sync(e,r,new xi(this.opts),i)}walkCB2Sync(e,r,i,n){if(this.#o(e))return n();if(this.signal?.aborted&&n(),this.paused){this.onResume(()=>this.walkCB2Sync(e,r,i,n));return}i.processPatterns(e,r);let s=1,a=()=>{--s===0&&n()};for(let[o,l,u]of i.matches.entries())this.#i(o)||this.matchSync(o,l,u);for(let o of i.subwalkTargets()){if(this.maxDepth!==1/0&&o.depth()>=this.maxDepth)continue;s++;let l=o.readdirSync();this.walkCB3Sync(o,l,i,a)}a()}walkCB3Sync(e,r,i,n){i=i.filterEntries(e,r);let s=1,a=()=>{--s===0&&n()};for(let[o,l,u]of i.matches.entries())this.#i(o)||this.matchSync(o,l,u);for(let[o,l]of i.subwalks.entries())s++,this.walkCB2Sync(o,l,i.child(),a);a()}},Ti=class extends ys{matches;constructor(e,r,i){super(e,r,i),this.matches=new Set}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,r)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?r(this.signal.reason):e(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}},Oi=class extends ys{results;constructor(e,r,i){super(e,r,i),this.results=new Mt({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,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 VS=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",ze=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;opts;patterns;constructor(e,r){if(!r)throw new TypeError("glob options required");if(this.withFileTypes=!!r.withFileTypes,this.signal=r.signal,this.follow=!!r.follow,this.dot=!!r.dot,this.dotRelative=!!r.dotRelative,this.nodir=!!r.nodir,this.mark=!!r.mark,r.cwd?(r.cwd instanceof URL||r.cwd.startsWith("file://"))&&(r.cwd=(0,Xp.fileURLToPath)(r.cwd)):this.cwd="",this.cwd=r.cwd||"",this.root=r.root,this.magicalBraces=!!r.magicalBraces,this.nobrace=!!r.nobrace,this.noext=!!r.noext,this.realpath=!!r.realpath,this.absolute=r.absolute,this.noglobstar=!!r.noglobstar,this.matchBase=!!r.matchBase,this.maxDepth=typeof r.maxDepth=="number"?r.maxDepth:1/0,this.stat=!!r.stat,this.ignore=r.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(l=>l.replace(/\\/g,"/"))),this.matchBase){if(r.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(l=>l.includes("/")?l:`./**/${l}`)}if(this.pattern=e,this.platform=r.platform||VS,this.opts={...r,platform:this.platform},r.scurry){if(this.scurry=r.scurry,r.nocase!==void 0&&r.nocase!==r.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let l=r.platform==="win32"?xr:r.platform==="darwin"?Ei:r.platform?Tr:Qp;this.scurry=new l(this.cwd,{nocase:r.nocase,fs:r.fs})}this.nocase=this.scurry.nocase;let i=this.platform==="darwin"||this.platform==="win32",n={...r,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:i,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},s=this.pattern.map(l=>new ke(l,n)),[a,o]=s.reduce((l,u)=>(l[0].push(...u.set),l[1].push(...u.globParts),l),[[],[]]);this.patterns=a.map((l,u)=>{let h=o[u];if(!h)throw new Error("invalid pattern object");return new Or(l,h,0,this.platform)})}async walk(){return[...await new Ti(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}).walk()]}walkSync(){return[...new Ti(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}).walkSync()]}stream(){return new Oi(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}).stream()}streamSync(){return new Oi(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}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};var el=(t,e={})=>{Array.isArray(t)||(t=[t]);for(let r of t)if(new ke(r,e).hasMagic())return!0;return!1};function ws(t,e={}){return new ze(t,e).streamSync()}function tg(t,e={}){return new ze(t,e).stream()}function rg(t,e={}){return new ze(t,e).walkSync()}async function eg(t,e={}){return new ze(t,e).walk()}function vs(t,e={}){return new ze(t,e).iterateSync()}function ig(t,e={}){return new ze(t,e).iterate()}var KS=ws,JS=Object.assign(tg,{sync:ws}),ZS=vs,QS=Object.assign(ig,{sync:vs}),XS=Object.assign(rg,{stream:ws,iterate:vs}),bs=Object.assign(eg,{glob:eg,globSync:rg,sync:XS,globStream:tg,stream:JS,globStreamSync:ws,streamSync:KS,globIterate:ig,iterate:QS,globIterateSync:vs,iterateSync:ZS,Glob:ze,hasMagic:el,escape:wr,unescape:We});bs.glob=bs;global.fetch=rl.default;var eE="../build",tE="../wheels";async function og(t,e){let r=[],i=n=>{r.push(n)};if(await t.loadPackage(e,{errorCallback:i}),r.length>0)throw new Error(r.join(`
|
|
36
|
+
`))}async function rE(t){I.info("Copy the build directory (the bare built app files) to this directory...");let e=ce.default.resolve(__dirname,eE);if(!(await tt.default.stat(e)).isDirectory())throw new Error(`The source ${e} does not exist.`);if(e===t.copyTo){I.warn(`sourceDir == destDir (${e}). Are you in the development environment? Skip copying the directory.`);return}if(t.keepOld)try{await tt.default.access(t.copyTo),I.info(`${t.copyTo} already exists. Use it and skip copying.`);return}catch{throw new Error(`${t.copyTo} does not exist even though the \`keepOld\` option is specified`)}I.debug(`Copy ${e} to ${t.copyTo}`),await tt.default.rm(t.copyTo,{recursive:!0,force:!0}),await tl.default.copy(e,t.copyTo,{errorOnExist:!0})}async function iE(t){if(t.requirements.length===0)return[];let e=await(0,il.loadPyodide)();return await lg(e,{requirements:t.requirements}),Object.entries(e.loadedPackages).filter(([,r])=>r==="default channel").map(([r])=>r)}async function ng(t,e){I.debug("Preparing the local wheel: %s",e);let r=await tt.default.readFile(e),i="/tmp/"+ce.default.basename(e);t.FS.writeFile(i,r);let n=`emfs:${i}`;return I.debug("The local wheel %s is prepared as %s",e,n),n}async function lg(t,e){await og(t,"micropip");let r=t.pyimport("micropip"),i=[...e.requirements],n=ce.default.join(__dirname,tE),s=await ng(t,ce.default.join(n,"stlite_server-0.1.0-py3-none-any.whl"));i.push(s);let a=await ng(t,ce.default.join(n,"streamlit-1.33.0-cp311-none-any.whl"));i.push(a),I.info("Install the packages: %j",i),await r.install.callKwargs(i,{keep_going:!0})}async function nE(t){I.info("Create the site-packages snapshot file...");let e=await(0,il.loadPyodide)();await og(e,"micropip");let r=e.pyimport("micropip"),i=await fi.getInstance(),n=[];t.usedPrebuiltPackages.length>0&&(I.info("Mocking prebuilt packages so that they will not be included in the site-packages snapshot because these will be installed from the vendored wheel files at runtime..."),t.usedPrebuiltPackages.forEach(o=>{let l=i.getPackageInfoByName(o);if(l==null)throw new Error(`Package ${o} is not found in the lock file.`);I.debug(`Mock ${l.name} ${l.version}`),r.add_mock_package(l.name,l.version),n.push(l.name)})),I.info("Install the requirements %j",t.requirements),await lg(e,{requirements:t.requirements}),I.info("Remove the mocked packages: %j",n),n.forEach(o=>r.remove_mock_package(o)),I.info("Archive the site-packages director(y|ies)");let s="/tmp/site-packages-snapshot.tar.gz";await e.runPythonAsync(`
|
|
7
37
|
import os
|
|
8
38
|
import tarfile
|
|
9
39
|
import site
|
|
10
40
|
|
|
11
41
|
site_packages_dirs = site.getsitepackages()
|
|
12
42
|
|
|
13
|
-
tar_file_name = '${
|
|
43
|
+
tar_file_name = '${s}'
|
|
14
44
|
with tarfile.open(tar_file_name, mode='w:gz') as gzf:
|
|
15
45
|
for site_packages in site_packages_dirs:
|
|
16
46
|
print("Add site-package:", site_packages)
|
|
17
47
|
print(os.listdir(site_packages))
|
|
18
48
|
gzf.add(site_packages)
|
|
19
|
-
`),
|
|
20
|
-
`);await
|
|
49
|
+
`),I.info("Extract the archive file from EMFS");let a=e.FS.readFile(s);I.info(`Save the archive file (${t.saveTo})`),await tt.default.writeFile(t.saveTo,a)}async function sE(t){I.info("Copy the app directory..."),await Promise.all(t.filePathPatterns.map(async e=>{let r=await bs(e,{cwd:t.cwd,absolute:!1});if(r.length===0){I.warn(`No files match the pattern "${e}" in "${t.cwd}".`);return}await Promise.all(r.map(async i=>{let n=ce.default.resolve(t.cwd,i),s=ce.default.resolve(t.buildAppDirectory,i);I.debug(`Copy ${n} to ${s}`),await tl.default.copy(n,s,{errorOnExist:!0})}))}))}async function aE(t,e){try{await tt.default.access(ce.default.resolve(t,e))}catch{throw new Error(`The entrypoint file "${e}" is not included in the bundled files.`)}}async function oE(t){let e=await tt.default.readFile(t,{encoding:"utf-8"});return(0,_s.parseRequirementsTxt)(e)}async function lE(t,e){let r=e.join(`
|
|
50
|
+
`);await tt.default.writeFile(t,r,{encoding:"utf-8"})}async function uE(t){let e=await fi.getInstance(),i=t.packages.map(n=>e.getPackageInfoByName(n)).map(n=>Pi(n.file_name));I.info("Downloading the used prebuilt packages..."),await Promise.all(i.map(async n=>{let s=ce.default.resolve(t.destDir,"./pyodide",ce.default.basename(n));I.debug(`Download ${n} to ${s}`);let a=await(0,rl.default)(n);if(!a.ok)throw new Error(`Failed to download ${n}: ${a.status} ${a.statusText}`);let o=await a.arrayBuffer();await tt.default.writeFile(s,Buffer.from(o))}))}(0,sg.default)((0,ag.hideBin)(process.argv)).command("* [appHomeDirSource] [packages..]","Put the user code and data and the snapshot of the required packages into the build artifact.",()=>{}).positional("appHomeDirSource",{describe:"[Deprecated] The source directory of the user code and data that will be mounted in the Pyodide file system at app runtime",type:"string",demandOption:!1}).positional("packages",{describe:"[Deprecated] Package names to install.",type:"string",array:!0}).options("project",{describe:"The project directory",type:"string",alias:"p",default:process.cwd()}).options("requirement",{describe:"Install from the given requirements file. This option can be used multiple times.",array:!0,type:"string",alias:"r",default:[],deprecated:!0}).options("keepOldBuild",{type:"boolean",default:!1,alias:"k",describe:"Keep the existing build directory contents except appHomeDir."}).options("logLevel",{type:"string",default:"info",describe:"The log level",choices:["debug","info","warn","error"]}).parseAsync().then(async t=>{I.level=t.logLevel,I.debug("Command line arguments: %j",t);let e=t.project,r=ce.default.resolve(e,"./build"),i=ce.default.resolve(e,"./package.json"),n=require(i),s=await ep({pathResolutionRoot:e,packageJsonStliteDesktopField:n.stlite?.desktop,fallbacks:{appHomeDirSource:t.appHomeDirSource,packages:t.packages,requirementsTxtFilePaths:t.requirement}});I.info("File/directory patterns to be included: %j",s.files),I.info("Entrypoint: %s",s.entrypoint),I.info("Dependencies: %j",s.dependencies),I.info("`requirements.txt` files: %j",s.requirementsTxtFilePaths);let a=await Promise.all(s.requirementsTxtFilePaths.map(async h=>oE(h))).then(h=>h.flat());I.info("Dependencies from `requirements.txt` files: %j",a);let o=(0,_s.validateRequirements)([...s.dependencies,...a]);I.info("Validated dependency list: %j",o);let l=await iE({requirements:o});I.info("The prebuilt packages loaded for the given requirements: %j",l),await rE({copyTo:r,keepOld:t.keepOldBuild});let u=ce.default.resolve(r,"./app_files");await sE({cwd:e,filePathPatterns:s.files,buildAppDirectory:u}),aE(u,s.entrypoint),await nE({requirements:o,usedPrebuiltPackages:l,saveTo:ce.default.resolve(r,"./site-packages-snapshot.tar.gz")}),await lE(ce.default.resolve(r,"./prebuilt-packages.txt"),l),await uE({packages:l,destDir:r}),await Qd({packageJsonStliteDesktopField:n.stlite?.desktop,manifestFilePath:ce.default.resolve(r,"./stlite-manifest.json"),fallbacks:{entrypoint:s.entrypoint}})});
|
|
51
|
+
/*! Bundled license information:
|
|
52
|
+
|
|
53
|
+
safe-buffer/index.js:
|
|
54
|
+
(*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|
55
|
+
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stlite/desktop",
|
|
3
|
-
"version": "0.54.
|
|
3
|
+
"version": "0.54.2",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -68,9 +68,9 @@
|
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@craco/craco": "^7.0.0",
|
|
71
|
-
"@stlite/common": "^0.54.
|
|
72
|
-
"@stlite/common-react": "^0.54.
|
|
73
|
-
"@stlite/kernel": "^0.54.
|
|
71
|
+
"@stlite/common": "^0.54.2",
|
|
72
|
+
"@stlite/common-react": "^0.54.2",
|
|
73
|
+
"@stlite/kernel": "^0.54.2",
|
|
74
74
|
"@streamlit/app": "1.33.0",
|
|
75
75
|
"@testing-library/react": "^14.1.2",
|
|
76
76
|
"@testing-library/user-event": "^14.0.0",
|
|
@@ -93,7 +93,8 @@
|
|
|
93
93
|
"react-toastify": "^9.1.1",
|
|
94
94
|
"superstruct": "^1.0.4",
|
|
95
95
|
"ts-node": "^10.9.1",
|
|
96
|
-
"typescript": "^4.9.4"
|
|
96
|
+
"typescript": "^4.9.4",
|
|
97
|
+
"winston": "^3.13.0"
|
|
97
98
|
},
|
|
98
99
|
"///": "build.productName is necessary because electron-builder uses the package name for its purpose but the scoped name including '@' makes a problem: https://github.com/electron-userland/electron-builder/issues/3230",
|
|
99
100
|
"build": {
|
|
Binary file
|