tabby/clients/intellij/node_scripts/tabby-agent.js

237 lines
338 KiB
JavaScript
Executable File
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#!/bin/env node
'use strict';
var child_process = require('child_process');
var zlib = require('zlib');
var stream = require('stream');
var fs = require('fs');
var promises = require('fs/promises');
var path = require('path');
var util = require('util');
var events = require('events');
var Xx = require('crypto');
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
var Xx__default = /*#__PURE__*/_interopDefault(Xx);
var zx=Object.create;var Jn=Object.defineProperty;var Gx=Object.getOwnPropertyDescriptor;var Vx=Object.getOwnPropertyNames;var Kx=Object.getPrototypeOf,Yx=Object.prototype.hasOwnProperty;var Jx=(t,e,r)=>e in t?Jn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var G=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var Ji=(t,e)=>()=>(t&&(e=t(t=0)),e);var _=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),sa=(t,e)=>{for(var r in e)Jn(t,r,{get:e[r],enumerable:!0});},Qf=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Vx(e))!Yx.call(t,s)&&s!==r&&Jn(t,s,{get:()=>e[s],enumerable:!(n=Gx(e,s))||n.enumerable});return t};var nn=(t,e,r)=>(r=t!=null?zx(Kx(t)):{},Qf(e||!t||!t.__esModule?Jn(r,"default",{value:t,enumerable:!0}):r,t)),oa=t=>Qf(Jn({},"__esModule",{value:!0}),t);var ie=(t,e,r)=>(Jx(t,typeof e!="symbol"?e+"":e,r),r),aa=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)};var S=(t,e,r)=>(aa(t,e,"read from private field"),r?r.call(t):e.get(t)),ue=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r);},ne=(t,e,r,n)=>(aa(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r);var Xi=(t,e,r,n)=>({set _(s){ne(t,e,s,r);},get _(){return S(t,e,n)}}),te=(t,e,r)=>(aa(t,e,"access private method"),r);var ca=_((dD,th)=>{var eh=Object.prototype.toString;th.exports=function(e){var r=eh.call(e),n=r==="[object Arguments]";return n||(n=r!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&eh.call(e.callee)==="[object Function]"),n};});var ch=_((yD,lh)=>{var uh;Object.keys||(Xn=Object.prototype.hasOwnProperty,fa=Object.prototype.toString,rh=ca(),ha=Object.prototype.propertyIsEnumerable,nh=!ha.call({toString:null},"toString"),ih=ha.call(function(){},"prototype"),Qn=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],es=function(t){var e=t.constructor;return e&&e.prototype===t},sh={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},oh=function(){if(typeof window>"u")return !1;for(var t in window)try{if(!sh["$"+t]&&Xn.call(window,t)&&window[t]!==null&&typeof window[t]=="object")try{es(window[t]);}catch{return !0}}catch{return !0}return !1}(),ah=function(t){if(typeof window>"u"||!oh)return es(t);try{return es(t)}catch{return !1}},uh=function(e){var r=e!==null&&typeof e=="object",n=fa.call(e)==="[object Function]",s=rh(e),i=r&&fa.call(e)==="[object String]",o=[];if(!r&&!n&&!s)throw new TypeError("Object.keys called on a non-object");var u=ih&&n;if(i&&e.length>0&&!Xn.call(e,0))for(var c=0;c<e.length;++c)o.push(String(c));if(s&&e.length>0)for(var p=0;p<e.length;++p)o.push(String(p));else for(var l in e)!(u&&l==="prototype")&&Xn.call(e,l)&&o.push(String(l));if(nh)for(var d=ah(e),g=0;g<Qn.length;++g)!(d&&Qn[g]==="constructor")&&Xn.call(e,Qn[g])&&o.push(Qn[g]);return o});var Xn,fa,rh,ha,nh,ih,Qn,es,sh,oh,ah;lh.exports=uh;});var rs=_((gD,ph)=>{var eA=Array.prototype.slice,tA=ca(),fh=Object.keys,ts=fh?function(e){return fh(e)}:ch(),hh=Object.keys;ts.shim=function(){if(Object.keys){var e=function(){var r=Object.keys(arguments);return r&&r.length===arguments.length}(1,2);e||(Object.keys=function(n){return tA(n)?hh(eA.call(n)):hh(n)});}else Object.keys=ts;return Object.keys||ts};ph.exports=ts;});var ns=_((mD,dh)=>{dh.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return !1;if(typeof Symbol.iterator=="symbol")return !0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return !1;var s=42;e[r]=s;for(r in e)return !1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return !1;var i=Object.getOwnPropertySymbols(e);if(i.length!==1||i[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return !1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(e,r);if(o.value!==s||o.enumerable!==!0)return !1}return !0};});var pa=_((wD,gh)=>{var yh=typeof Symbol<"u"&&Symbol,rA=ns();gh.exports=function(){return typeof yh!="function"||typeof Symbol!="function"||typeof yh("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:rA()};});var vh=_((vD,wh)=>{var mh={foo:{}},nA=Object;wh.exports=function(){return {__proto__:mh}.foo===mh.foo&&!({__proto__:null}instanceof nA)};});var bh=_((SD,Sh)=>{var iA="Function.prototype.bind called on incompatible ",da=Array.prototype.slice,sA=Object.prototype.toString,oA="[object Function]";Sh.exports=function(e){var r=this;if(typeof r!="function"||sA.call(r)!==oA)throw new TypeError(iA+r);for(var n=da.call(arguments,1),s,i=function(){if(this instanceof s){var l=r.apply(this,n.concat(da.call(arguments)));return Object(l)===l?l:this}else return r.apply(e,n.concat(da.call(arguments)))},o=Math.max(0,r.length-n.length),u=[],c=0;c<o;c++)u.push("$"+c);if(s=Function("binder","return function ("+u.join(",")+"){ return binder.apply(this,arguments); }")(i),r.prototype){var p=function(){};p.prototype=r.prototype,s.prototype=new p,p.prototype=null;}return s};});var is=_((bD,Eh)=>{var aA=bh();Eh.exports=Function.prototype.bind||aA;});var Ah=_((ED,xh)=>{var uA=is();xh.exports=uA.call(Function.call,Object.prototype.hasOwnProperty);});var qt=_((xD,Th)=>{var he,un=SyntaxError,Oh=Function,an=TypeError,ya=function(t){try{return Oh('"use strict"; return ('+t+").constructor;")()}catch{}},Ir=Object.getOwnPropertyDescriptor;var ga=function(){throw new an},lA=Ir?function(){try{return ga}catch{try{return Ir(arguments,"callee").get}catch{return ga}}}():ga,sn=pa()(),cA=vh()(),Fe=Object.getPrototypeOf||(cA?function(t){return t.__proto__}:null),on={},fA=typeof Uint8Array>"u"||!Fe?he:Fe(Uint8Array),$r={"%AggregateError%":typeof AggregateError>"u"?he:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?he:ArrayBuffer,"%ArrayIteratorPrototype%":sn&&Fe?Fe([][Symbol.iterator]()):he,"%AsyncFromSyncIteratorPrototype%":he,"%AsyncFunction%":on,"%AsyncGenerator%":on,"%AsyncGeneratorFunction%":on,"%AsyncIteratorPrototype%":on,"%Atomics%":typeof Atomics>"u"?he:Atomics,"%BigInt%":typeof BigInt>"u"?he:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?he:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?he:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?he:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?he:Float32Array,"%Float64Array%":typeof Float64Array>"u"?he:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?he:FinalizationRegistry,"%Function%":Oh,"%GeneratorFunction%":on,"%Int8Array%":typeof Int8Array>"u"?he:Int8Array,"%Int16Array%":typeof Int16Array>"u"?he:Int16Array,"%Int32Array%":typeof Int32Array>"u"?he:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":sn&&Fe?Fe(Fe([][Symbol.iterator]())):he,"%JSON%":typeof JSON=="object"?JSON:he,"%Map%":typeof Map>"u"?he:Map,"%MapIteratorPrototype%":typeof Map>"u"||!sn||!Fe?he:Fe(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?he:Promise,"%Proxy%":typeof Proxy>"u"?he:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?he:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?he:Set,"%SetIteratorPrototype%":typeof Set>"u"||!sn||!Fe?he:Fe(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?he:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":sn&&Fe?Fe(""[Symbol.iterator]()):he,"%Symbol%":sn?Symbol:he,"%SyntaxError%":un,"%ThrowTypeError%":lA,"%TypedArray%":fA,"%TypeError%":an,"%Uint8Array%":typeof Uint8Array>"u"?he:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?he:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?he:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?he:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?he:WeakMap,"%WeakRef%":typeof WeakRef>"u"?he:WeakRef,"%WeakSet%":typeof WeakSet>"u"?he:WeakSet};var hA=function t(e){var r;if(e==="%AsyncFunction%")r=ya("async function () {}");else if(e==="%GeneratorFunction%")r=ya("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=ya("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype);}else if(e==="%AsyncIteratorPrototype%"){var s=t("%AsyncGenerator%");s&&Fe&&(r=Fe(s.prototype));}return $r[e]=r,r},Ch={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Zn=is(),ss=Ah(),pA=Zn.call(Function.call,Array.prototype.concat),dA=Zn.call(Function.apply,Array.prototype.splice),Rh=Zn.call(Function.call,String.prototype.replace),os=Zn.call(Function.call,String.prototype.slice),yA=Zn.call(Function.call,RegExp.prototype.exec),gA=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,mA=/\\(\\)?/g,wA=function(e){var r=os(e,0,1),n=os(e,-1);if(r==="%"&&n!=="%")throw new un("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new un("invalid intrinsic syntax, expected opening `%`");var s=[];return Rh(e,gA,function(i,o,u,c){s[s.length]=u?Rh(c,mA,"$1"):o||i;}),s},vA=function(e,r){var n=e,s;if(ss(Ch,n)&&(s=Ch[n],n="%"+s[0]+"%"),ss($r,n)){var i=$r[n];if(i===on&&(i=hA(n)),typeof i>"u"&&!r)throw new an("intrinsic "+e+" exists, but is not available. Please file an issue!");return {alias:s,name:n,value:i}}throw new un("intrinsic "+e+" does not exist!")};Th.exports=function(e,r){if(typeof e!="string"||e.length===0)throw new an("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new an('"allowMissing" argument must be a boolean');if(yA(/^%?[^%]*%?$/,e)===null)throw new un("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=wA(e),s=n.length>0?n[0]:"",i=vA("%"+s+"%",r),o=i.name,u=i.value,c=!1,p=i.alias;p&&(s=p[0],dA(n,pA([0,1],p)));for(var l=1,d=!0;l<n.length;l+=1){var g=n[l],m=os(g,0,1),w=os(g,-1);if((m==='"'||m==="'"||m==="`"||w==='"'||w==="'"||w==="`")&&m!==w)throw new un("property names with quotes must have matching quotes");if((g==="constructor"||!d)&&(c=!0),s+="."+g,o="%"+s+"%",ss($r,o))u=$r[o];else if(u!=null){if(!(g in u)){if(!r)throw new an("base intrinsic for "+e+" exists, but the property is not available.");return}if(Ir&&l+1>=n.length){var E=Ir(u,g);d=!!E,d&&"get"in E&&!("originalValue"in E.get)?u=E.get:u=u[g];}else d=ss(u,g),u=u[g];d&&!c&&($r[o]=u);}}return u};});var as=_((AD,Ph)=>{var SA=qt(),ma=SA("%Object.defineProperty%",!0),wa=function(){if(ma)try{return ma({},"a",{value:1}),!0}catch{return !1}return !1};wa.hasArrayLengthDefineBug=function(){if(!wa())return null;try{return ma([],"length",{value:1}).length!==1}catch{return !0}};Ph.exports=wa;});var va=_((_D,Ih)=>{var bA=qt(),us=bA("%Object.getOwnPropertyDescriptor%",!0);if(us)try{us([],"length");}catch{us=null;}Ih.exports=us;});var ba=_((CD,kh)=>{var EA=as()(),Sa=qt(),$h=EA&&Sa("%Object.defineProperty%",!0),xA=Sa("%SyntaxError%"),ln=Sa("%TypeError%"),Fh=va();kh.exports=function(e,r,n){if(!e||typeof e!="object"&&typeof e!="function")throw new ln("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new ln("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new ln("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new ln("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new ln("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new ln("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,i=arguments.length>4?arguments[4]:null,o=arguments.length>5?arguments[5]:null,u=arguments.length>6?arguments[6]:!1,c=!!Fh&&Fh(e,r);if($h)$h(e,r,{configurable:o===null&&c?c.configurable:!o,enumerable:s===null&&c?c.enumerable:!s,value:n,writable:i===null&&c?c.writable:!i});else if(u||!s&&!i&&!o)e[r]=n;else throw new xA("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")};});var lr=_((RD,Dh)=>{var AA=rs(),_A=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",CA=Object.prototype.toString,RA=Array.prototype.concat,Lh=ba(),OA=function(t){return typeof t=="function"&&CA.call(t)==="[object Function]"},qh=as()(),TA=function(t,e,r,n){if(e in t){if(n===!0){if(t[e]===r)return}else if(!OA(n)||!n())return}qh?Lh(t,e,r,!0):Lh(t,e,r);},Bh=function(t,e){var r=arguments.length>2?arguments[2]:{},n=AA(e);_A&&(n=RA.call(n,Object.getOwnPropertySymbols(e)));for(var s=0;s<n.length;s+=1)TA(t,n[s],e[n[s]],r[n[s]]);};Bh.supportsDescriptors=!!qh;Dh.exports=Bh;});var kr=_((OD,ls)=>{var Ea=is(),cn=qt(),Uh=cn("%Function.prototype.apply%"),jh=cn("%Function.prototype.call%"),Hh=cn("%Reflect.apply%",!0)||Ea.call(jh,Uh),Nh=cn("%Object.getOwnPropertyDescriptor%",!0),Fr=cn("%Object.defineProperty%",!0),PA=cn("%Math.max%");if(Fr)try{Fr({},"a",{value:1});}catch{Fr=null;}ls.exports=function(e){var r=Hh(Ea,jh,arguments);if(Nh&&Fr){var n=Nh(r,"length");n.configurable&&Fr(r,"length",{value:1+PA(0,e.length-(arguments.length-1))});}return r};var Mh=function(){return Hh(Ea,Uh,arguments)};Fr?Fr(ls.exports,"apply",{value:Mh}):ls.exports.apply=Mh;});var bt=_((TD,Gh)=>{var Wh=qt(),zh=kr(),IA=zh(Wh("String.prototype.indexOf"));Gh.exports=function(e,r){var n=Wh(e,!!r);return typeof n=="function"&&IA(e,".prototype.")>-1?zh(n):n};});var xa=_((PD,Xh)=>{var $A=rs(),Yh=ns()(),Jh=bt(),Vh=Object,FA=Jh("Array.prototype.push"),Kh=Jh("Object.prototype.propertyIsEnumerable"),kA=Yh?Object.getOwnPropertySymbols:null;Xh.exports=function(e,r){if(e==null)throw new TypeError("target must be an object");var n=Vh(e);if(arguments.length===1)return n;for(var s=1;s<arguments.length;++s){var i=Vh(arguments[s]),o=$A(i),u=Yh&&(Object.getOwnPropertySymbols||kA);if(u)for(var c=u(i),p=0;p<c.length;++p){var l=c[p];Kh(i,l)&&FA(o,l);}for(var d=0;d<o.length;++d){var g=o[d];if(Kh(i,g)){var m=i[g];n[g]=m;}}}return n};});var _a=_((ID,Qh)=>{var Aa=xa(),LA=function(){if(!Object.assign)return !1;for(var t="abcdefghijklmnopqrst",e=t.split(""),r={},n=0;n<e.length;++n)r[e[n]]=e[n];var s=Object.assign({},r),i="";for(var o in s)i+=o;return t!==i},qA=function(){if(!Object.assign||!Object.preventExtensions)return !1;var t=Object.preventExtensions({1:2});try{Object.assign(t,"xy");}catch{return t[1]==="y"}return !1};Qh.exports=function(){return !Object.assign||LA()||qA()?Aa:Object.assign};});var ep=_(($D,Zh)=>{var BA=lr(),DA=_a();Zh.exports=function(){var e=DA();return BA(Object,{assign:e},{assign:function(){return Object.assign!==e}}),e};});var ip=_((FD,np)=>{var NA=lr(),MA=kr(),UA=xa(),tp=_a(),jA=ep(),HA=MA.apply(tp()),rp=function(e,r){return HA(Object,arguments)};NA(rp,{getPolyfill:tp,implementation:UA,shim:jA});np.exports=rp;});var op=_((kD,sp)=>{var ti=function(){return typeof function(){}.name=="string"},ei=Object.getOwnPropertyDescriptor;ti.functionsHaveConfigurableNames=function(){if(!ti()||!ei)return !1;var e=ei(function(){},"name");return !!e&&!!e.configurable};var WA=Function.prototype.bind;ti.boundFunctionsHaveNames=function(){return ti()&&typeof WA=="function"&&function(){}.bind().name!==""};sp.exports=ti;});var lp=_((LD,up)=>{var ap=ba(),zA=as()(),GA=op().functionsHaveConfigurableNames(),VA=TypeError;up.exports=function(e,r){if(typeof e!="function")throw new VA("`fn` is not a function");var n=arguments.length>2&&!!arguments[2];return (!n||GA)&&(zA?ap(e,"name",r,!0,!0):ap(e,"name",r)),e};});var Ca=_((qD,cp)=>{var KA=lp(),YA=Object,JA=TypeError;cp.exports=KA(function(){if(this!=null&&this!==YA(this))throw new JA("RegExp.prototype.flags getter called on non-object");var e="";return this.hasIndices&&(e+="d"),this.global&&(e+="g"),this.ignoreCase&&(e+="i"),this.multiline&&(e+="m"),this.dotAll&&(e+="s"),this.unicode&&(e+="u"),this.unicodeSets&&(e+="v"),this.sticky&&(e+="y"),e},"get flags",!0);});var Ra=_((BD,fp)=>{var XA=Ca(),QA=lr().supportsDescriptors,ZA=Object.getOwnPropertyDescriptor;fp.exports=function(){if(QA&&/a/mig.flags==="gim"){var e=ZA(RegExp.prototype,"flags");if(e&&typeof e.get=="function"&&typeof RegExp.prototype.dotAll=="boolean"&&typeof RegExp.prototype.hasIndices=="boolean"){var r="",n={};if(Object.defineProperty(n,"hasIndices",{get:function(){r+="d";}}),Object.defineProperty(n,"sticky",{get:function(){r+="y";}}),r==="dy")return e.get}}return XA};});var dp=_((DD,pp)=>{var e_=lr().supportsDescriptors,t_=Ra(),r_=Object.getOwnPropertyDescriptor,n_=Object.defineProperty,i_=TypeError,hp=Object.getPrototypeOf,s_=/a/;pp.exports=function(){if(!e_||!hp)throw new i_("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var e=t_(),r=hp(s_),n=r_(r,"flags");return (!n||n.get!==e)&&n_(r,"flags",{configurable:!0,enumerable:!1,get:e}),e};});var wp=_((ND,mp)=>{var o_=lr(),a_=kr(),u_=Ca(),yp=Ra(),l_=dp(),gp=a_(yp());o_(gp,{getPolyfill:yp,implementation:u_,shim:l_});mp.exports=gp;});var bp=_((MD,Sp)=>{var vp=Symbol.iterator;Sp.exports=function(e){if(e!=null&&typeof e[vp]<"u")return e[vp]()};});var xp=_((UD,Ep)=>{Ep.exports=G("util").inspect;});var Hp=_((jD,jp)=>{var Ba=typeof Map=="function"&&Map.prototype,Oa=Object.getOwnPropertyDescriptor&&Ba?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,fs=Ba&&Oa&&typeof Oa.get=="function"?Oa.get:null,Ap=Ba&&Map.prototype.forEach,Da=typeof Set=="function"&&Set.prototype,Ta=Object.getOwnPropertyDescriptor&&Da?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,hs=Da&&Ta&&typeof Ta.get=="function"?Ta.get:null,_p=Da&&Set.prototype.forEach,c_=typeof WeakMap=="function"&&WeakMap.prototype,ni=c_?WeakMap.prototype.has:null,f_=typeof WeakSet=="function"&&WeakSet.prototype,ii=f_?WeakSet.prototype.has:null,h_=typeof WeakRef=="function"&&WeakRef.prototype,Cp=h_?WeakRef.prototype.deref:null,p_=Boolean.prototype.valueOf,d_=Object.prototype.toString,y_=Function.prototype.toString,g_=String.prototype.match,Na=String.prototype.slice,fr=String.prototype.replace,m_=String.prototype.toUpperCase,Rp=String.prototype.toLowerCase,qp=RegExp.prototype.test,Op=Array.prototype.concat,Bt=Array.prototype.join,w_=Array.prototype.slice,Tp=Math.floor,$a=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Pa=Object.getOwnPropertySymbols,Fa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,fn=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Ge=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===fn||"symbol")?Symbol.toStringTag:null,Bp=Object.prototype.propertyIsEnumerable,Pp=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function Ip(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||qp.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-Tp(-t):Tp(t);if(n!==t){var s=String(n),i=Na.call(e,s.length+1);return fr.call(s,r,"$&_")+"."+fr.call(fr.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return fr.call(e,r,"$&_")}var ka=xp(),$p=ka.custom,Fp=Np($p)?$p:null;jp.exports=function t(e,r,n,s){var i=r||{};if(cr(i,"quoteStyle")&&i.quoteStyle!=="single"&&i.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(cr(i,"maxStringLength")&&(typeof i.maxStringLength=="number"?i.maxStringLength<0&&i.maxStringLength!==1/0:i.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var o=cr(i,"customInspect")?i.customInspect:!0;if(typeof o!="boolean"&&o!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(cr(i,"indent")&&i.indent!==null&&i.indent!==" "&&!(parseInt(i.indent,10)===i.indent&&i.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(cr(i,"numericSeparator")&&typeof i.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var u=i.numericSeparator;if(typeof e>"u")return "undefined";if(e===null)return "null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return Up(e,i);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var c=String(e);return u?Ip(e,c):c}if(typeof e=="bigint"){var p=String(e)+"n";return u?Ip(e,p):p}var l=typeof i.depth>"u"?5:i.depth;if(typeof n>"u"&&(n=0),n>=l&&l>0&&typeof e=="object")return La(e)?"[Array]":"[Object]";var d=q_(i,n);if(typeof s>"u")s=[];else if(Mp(s,e)>=0)return "[Circular]";function g(J,oe,P){if(oe&&(s=w_.call(s),s.push(oe)),P){var I={depth:i.depth};return cr(i,"quoteStyle")&&(I.quoteStyle=i.quoteStyle),t(J,I,n+1,s)}return t(J,i,n+1,s)}if(typeof e=="function"&&!kp(e)){var m=R_(e),w=cs(e,g);return "[Function"+(m?": "+m:" (anonymous)")+"]"+(w.length>0?" { "+Bt.call(w,", ")+" }":"")}if(Np(e)){var E=fn?fr.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):Fa.call(e);return typeof e=="object"&&!fn?ri(E):E}if(F_(e)){for(var A="<"+Rp.call(String(e.nodeName)),R=e.attributes||[],x=0;x<R.length;x++)A+=" "+R[x].name+"="+Dp(v_(R[x].value),"double",i);return A+=">",e.childNodes&&e.childNodes.length&&(A+="..."),A+="</"+Rp.call(String(e.nodeName))+">",A}if(La(e)){if(e.length===0)return "[]";var O=cs(e,g);return d&&!L_(O)?"["+qa(O,d)+"]":"[ "+Bt.call(O,", ")+" ]"}if(b_(e)){var F=cs(e,g);return !("cause"in Error.prototype)&&"cause"in e&&!Bp.call(e,"cause")?"{ ["+String(e)+"] "+Bt.call(Op.call("[cause]: "+g(e.cause),F),", ")+" }":F.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+Bt.call(F,", ")+" }"}if(typeof e=="object"&&o){if(Fp&&typeof e[Fp]=="function"&&ka)return ka(e,{depth:l-n});if(o!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(O_(e)){var q=[];return Ap&&Ap.call(e,function(J,oe){q.push(g(oe,e,!0)+" => "+g(J,e));}),Lp("Map",fs.call(e),q,d)}if(I_(e)){var W=[];return _p&&_p.call(e,function(J){W.push(g(J,e));}),Lp("Set",hs.call(e),W,d)}if(T_(e))return Ia("WeakMap");if($_(e))return Ia("WeakSet");if(P_(e))return Ia("WeakRef");if(x_(e))return ri(g(Number(e)));if(__(e))return ri(g($a.call(e)));if(A_(e))return ri(p_.call(e));if(E_(e))return ri(g(String(e)));if(!S_(e)&&!kp(e)){var H=cs(e,g),B=Pp?Pp(e)===Object.prototype:e instanceof Object||e.constructor===Object,k=e instanceof Object?"":"null prototype",U=!B&&Ge&&Object(e)===e&&Ge in e?Na.call(hr(e),8,-1):k?"Object":"",C=B||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",Y=C+(U||k?"["+Bt.call(Op.call([],U||[],k||[]),": ")+"] ":"");return H.length===0?Y+"{}":d?Y+"{"+qa(H,d)+"}":Y+"{ "+Bt.call(H,", ")+" }"}return String(e)};function Dp(t,e,r){var n=(r.quoteStyle||e)==="double"?'"':"'";return n+t+n}function v_(t){return fr.call(String(t),/"/g,"&quot;")}function La(t){return hr(t)==="[object Array]"&&(!Ge||!(typeof t=="object"&&Ge in t))}function S_(t){return hr(t)==="[object Date]"&&(!Ge||!(typeof t=="object"&&Ge in t))}function kp(t){return hr(t)==="[object RegExp]"&&(!Ge||!(typeof t=="object"&&Ge in t))}function b_(t){return hr(t)==="[object Error]"&&(!Ge||!(typeof t=="object"&&Ge in t))}function E_(t){return hr(t)==="[object String]"&&(!Ge||!(typeof t=="object"&&Ge in t))}function x_(t){return hr(t)==="[object Number]"&&(!Ge||!(typeof t=="object"&&Ge in t))}function A_(t){return hr(t)==="[object Boolean]"&&(!Ge||!(typeof t=="object"&&Ge in t))}function Np(t){if(fn)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return !0;if(!t||typeof t!="object"||!Fa)return !1;try{return Fa.call(t),!0}catch{}return !1}function __(t){if(!t||typeof t!="object"||!$a)return !1;try{return $a.call(t),!0}catch{}return !1}var C_=Object.prototype.hasOwnProperty||function(t){return t in this};function cr(t,e){return C_.call(t,e)}function hr(t){return d_.call(t)}function R_(t){if(t.name)return t.name;var e=g_.call(y_.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function Mp(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return -1}function O_(t){if(!fs||!t||typeof t!="object")return !1;try{fs.call(t);try{hs.call(t);}catch{return !0}return t instanceof Map}catch{}return !1}function T_(t){if(!ni||!t||typeof t!="object")return !1;try{ni.call(t,ni);try{ii.call(t,ii);}catch{return !0}return t instanceof WeakMap}catch{}return !1}function P_(t){if(!Cp||!t||typeof t!="object")return !1;try{return Cp.call(t),!0}catch{}return !1}function I_(t){if(!hs||!t||typeof t!="object")return !1;try{hs.call(t);try{fs.call(t);}catch{return !0}return t instanceof Set}catch{}return !1}function $_(t){if(!ii||!t||typeof t!="object")return !1;try{ii.call(t,ii);try{ni.call(t,ni);}catch{return !0}return t instanceof WeakSet}catch{}return !1}function F_(t){return !t||typeof t!="object"?!1:typeof HTMLElement<"u"&&t instanceof HTMLElement?!0:typeof t.nodeName=="string"&&typeof t.getAttribute=="function"}function Up(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return Up(Na.call(t,0,e.maxStringLength),e)+n}var s=fr.call(fr.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,k_);return Dp(s,"single",e)}function k_(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+m_.call(e.toString(16))}function ri(t){return "Object("+t+")"}function Ia(t){return t+" { ? }"}function Lp(t,e,r,n){var s=n?qa(r,n):Bt.call(r,", ");return t+" ("+e+") {"+s+"}"}function L_(t){for(var e=0;e<t.length;e++)if(Mp(t[e],`
`)>=0)return !1;return !0}function q_(t,e){var r;if(t.indent===" ")r=" ";else if(typeof t.indent=="number"&&t.indent>0)r=Bt.call(Array(t.indent+1)," ");else return null;return {base:r,prev:Bt.call(Array(e+1),r)}}function qa(t,e){if(t.length===0)return "";var r=`
`+e.prev+e.base;return r+Bt.call(t,","+r)+`
`+e.prev}function cs(t,e){var r=La(t),n=[];if(r){n.length=t.length;for(var s=0;s<t.length;s++)n[s]=cr(t,s)?e(t[s],t):"";}var i=typeof Pa=="function"?Pa(t):[],o;if(fn){o={};for(var u=0;u<i.length;u++)o["$"+i[u]]=i[u];}for(var c in t)cr(t,c)&&(r&&String(Number(c))===c&&c<t.length||fn&&o["$"+c]instanceof Symbol||(qp.call(/[^\w$]/,c)?n.push(e(c,t)+": "+e(t[c],t)):n.push(c+": "+e(t[c],t))));if(typeof Pa=="function")for(var p=0;p<i.length;p++)Bp.call(t,i[p])&&n.push("["+e(i[p])+"]: "+e(t[i[p]],t));return n}});var zp=_((HD,Wp)=>{var Ma=qt(),hn=bt(),B_=Hp(),D_=Ma("%TypeError%"),ps=Ma("%WeakMap%",!0),ds=Ma("%Map%",!0),N_=hn("WeakMap.prototype.get",!0),M_=hn("WeakMap.prototype.set",!0),U_=hn("WeakMap.prototype.has",!0),j_=hn("Map.prototype.get",!0),H_=hn("Map.prototype.set",!0),W_=hn("Map.prototype.has",!0),Ua=function(t,e){for(var r=t,n;(n=r.next)!==null;r=n)if(n.key===e)return r.next=n.next,n.next=t.next,t.next=n,n},z_=function(t,e){var r=Ua(t,e);return r&&r.value},G_=function(t,e,r){var n=Ua(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r};},V_=function(t,e){return !!Ua(t,e)};Wp.exports=function(){var e,r,n,s={assert:function(i){if(!s.has(i))throw new D_("Side channel does not contain "+B_(i))},get:function(i){if(ps&&i&&(typeof i=="object"||typeof i=="function")){if(e)return N_(e,i)}else if(ds){if(r)return j_(r,i)}else if(n)return z_(n,i)},has:function(i){if(ps&&i&&(typeof i=="object"||typeof i=="function")){if(e)return U_(e,i)}else if(ds){if(r)return W_(r,i)}else if(n)return V_(n,i);return !1},set:function(i,o){ps&&i&&(typeof i=="object"||typeof i=="function")?(e||(e=new ps),M_(e,i,o)):ds?(r||(r=new ds),H_(r,i,o)):(n||(n={key:{},next:null}),G_(n,i,o));}};return s};});var ja=_((WD,Vp)=>{var Gp=function(t){return t!==t};Vp.exports=function(e,r){return e===0&&r===0?1/e===1/r:!!(e===r||Gp(e)&&Gp(r))};});var Ha=_((zD,Kp)=>{var K_=ja();Kp.exports=function(){return typeof Object.is=="function"?Object.is:K_};});var Jp=_((GD,Yp)=>{var Y_=Ha(),J_=lr();Yp.exports=function(){var e=Y_();return J_(Object,{is:e},{is:function(){return Object.is!==e}}),e};});var ed=_((VD,Zp)=>{var X_=lr(),Q_=kr(),Z_=ja(),Xp=Ha(),e1=Jp(),Qp=Q_(Xp(),Object);X_(Qp,{getPolyfill:Xp,implementation:Z_,shim:e1});Zp.exports=Qp;});var pr=_((KD,td)=>{var t1=ns();td.exports=function(){return t1()&&!!Symbol.toStringTag};});var id=_((YD,nd)=>{var r1=pr()(),n1=bt(),Wa=n1("Object.prototype.toString"),ys=function(e){return r1&&e&&typeof e=="object"&&Symbol.toStringTag in e?!1:Wa(e)==="[object Arguments]"},rd=function(e){return ys(e)?!0:e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&Wa(e)!=="[object Array]"&&Wa(e.callee)==="[object Function]"},i1=function(){return ys(arguments)}();ys.isLegacyArguments=rd;nd.exports=i1?ys:rd;});var od=_((JD,sd)=>{var s1={}.toString;sd.exports=Array.isArray||function(t){return s1.call(t)=="[object Array]"};});var cd=_((XD,ld)=>{var ud=Function.prototype.toString,pn=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,Ga,gs;if(typeof pn=="function"&&typeof Object.defineProperty=="function")try{Ga=Object.defineProperty({},"length",{get:function(){throw gs}}),gs={},pn(function(){throw 42},null,Ga);}catch(t){t!==gs&&(pn=null);}else pn=null;var o1=/^\s*class\b/,Va=function(e){try{var r=ud.call(e);return o1.test(r)}catch{return !1}},za=function(e){try{return Va(e)?!1:(ud.call(e),!0)}catch{return !1}},ms=Object.prototype.toString,a1="[object Object]",u1="[object Function]",l1="[object GeneratorFunction]",c1="[object HTMLAllCollection]",f1="[object HTML document.all class]",h1="[object HTMLCollection]",p1=typeof Symbol=="function"&&!!Symbol.toStringTag,d1=!(0 in[,]),Ka=function(){return !1};typeof document=="object"&&(ad=document.all,ms.call(ad)===ms.call(document.all)&&(Ka=function(e){if((d1||!e)&&(typeof e>"u"||typeof e=="object"))try{var r=ms.call(e);return (r===c1||r===f1||r===h1||r===a1)&&e("")==null}catch{}return !1}));var ad;ld.exports=pn?function(e){if(Ka(e))return !0;if(!e||typeof e!="function"&&typeof e!="object")return !1;try{pn(e,null,Ga);}catch(r){if(r!==gs)return !1}return !Va(e)&&za(e)}:function(e){if(Ka(e))return !0;if(!e||typeof e!="function"&&typeof e!="object")return !1;if(p1)return za(e);if(Va(e))return !1;var r=ms.call(e);return r!==u1&&r!==l1&&!/^\[object HTML/.test(r)?!1:za(e)};});var pd=_((QD,hd)=>{var y1=cd(),g1=Object.prototype.toString,fd=Object.prototype.hasOwnProperty,m1=function(e,r,n){for(var s=0,i=e.length;s<i;s++)fd.call(e,s)&&(n==null?r(e[s],s,e):r.call(n,e[s],s,e));},w1=function(e,r,n){for(var s=0,i=e.length;s<i;s++)n==null?r(e.charAt(s),s,e):r.call(n,e.charAt(s),s,e);},v1=function(e,r,n){for(var s in e)fd.call(e,s)&&(n==null?r(e[s],s,e):r.call(n,e[s],s,e));},S1=function(e,r,n){if(!y1(r))throw new TypeError("iterator must be a function");var s;arguments.length>=3&&(s=n),g1.call(e)==="[object Array]"?m1(e,r,s):typeof e=="string"?w1(e,r,s):v1(e,r,s);};hd.exports=S1;});var yd=_((ZD,dd)=>{var Ya=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],b1=typeof globalThis>"u"?global:globalThis;dd.exports=function(){for(var e=[],r=0;r<Ya.length;r++)typeof b1[Ya[r]]=="function"&&(e[e.length]=Ya[r]);return e};});var eu=_((eN,vd)=>{var vs=pd(),E1=yd(),gd=kr(),Qa=bt(),ws=va(),x1=Qa("Object.prototype.toString"),wd=pr()(),md=typeof globalThis>"u"?global:globalThis,Xa=E1(),Za=Qa("String.prototype.slice"),Ja=Object.getPrototypeOf,A1=Qa("Array.prototype.indexOf",!0)||function(e,r){for(var n=0;n<e.length;n+=1)if(e[n]===r)return n;return -1},Ss={__proto__:null};wd&&ws&&Ja?vs(Xa,function(t){var e=new md[t];if(Symbol.toStringTag in e){var r=Ja(e),n=ws(r,Symbol.toStringTag);if(!n){var s=Ja(r);n=ws(s,Symbol.toStringTag);}Ss["$"+t]=gd(n.get);}}):vs(Xa,function(t){var e=new md[t];Ss["$"+t]=gd(e.slice);});var _1=function(e){var r=!1;return vs(Ss,function(n,s){if(!r)try{"$"+n(e)===s&&(r=Za(s,1));}catch{}}),r},C1=function(e){var r=!1;return vs(Ss,function(n,s){if(!r)try{n(e),r=Za(s,1);}catch{}}),r};vd.exports=function(e){if(!e||typeof e!="object")return !1;if(!wd){var r=Za(x1(e),8,-1);return A1(Xa,r)>-1?r:r!=="Object"?!1:C1(e)}return ws?_1(e):null};});var bd=_((tN,Sd)=>{var R1=eu();Sd.exports=function(e){return !!R1(e)};});var tu=_((rN,Rd)=>{var O1=kr(),T1=bt(),Cd=qt(),P1=bd(),Ed=Cd("ArrayBuffer",!0),xd=Cd("Float32Array",!0),bs=T1("ArrayBuffer.prototype.byteLength",!0),Ad=Ed&&!bs&&new Ed().slice,_d=Ad&&O1(Ad);Rd.exports=bs||_d?function(e){if(!e||typeof e!="object")return !1;try{return bs?bs(e):_d(e,0),!0}catch{return !1}}:xd?function(e){try{return new xd(e).buffer===e&&!P1(e)}catch(r){return typeof e=="object"&&r.name==="RangeError"}}:function(e){return !1};});var Td=_((nN,Od)=>{var I1=Date.prototype.getDay,$1=function(e){try{return I1.call(e),!0}catch{return !1}},F1=Object.prototype.toString,k1="[object Date]",L1=pr()();Od.exports=function(e){return typeof e!="object"||e===null?!1:L1?$1(e):F1.call(e)===k1};});var kd=_((iN,Fd)=>{var ru=bt(),Pd=pr()(),Id,$d,nu,iu;Pd&&(Id=ru("Object.prototype.hasOwnProperty"),$d=ru("RegExp.prototype.exec"),nu={},Es=function(){throw nu},iu={toString:Es,valueOf:Es},typeof Symbol.toPrimitive=="symbol"&&(iu[Symbol.toPrimitive]=Es));var Es,q1=ru("Object.prototype.toString"),B1=Object.getOwnPropertyDescriptor,D1="[object RegExp]";Fd.exports=Pd?function(e){if(!e||typeof e!="object")return !1;var r=B1(e,"lastIndex"),n=r&&Id(r,"value");if(!n)return !1;try{$d(e,iu);}catch(s){return s===nu}}:function(e){return !e||typeof e!="object"&&typeof e!="function"?!1:q1(e)===D1};});var Bd=_((sN,qd)=>{var N1=bt(),Ld=N1("SharedArrayBuffer.prototype.byteLength",!0);qd.exports=Ld?function(e){if(!e||typeof e!="object")return !1;try{return Ld(e),!0}catch{return !1}}:function(e){return !1};});var Nd=_((oN,Dd)=>{var M1=String.prototype.valueOf,U1=function(e){try{return M1.call(e),!0}catch{return !1}},j1=Object.prototype.toString,H1="[object String]",W1=pr()();Dd.exports=function(e){return typeof e=="string"?!0:typeof e!="object"?!1:W1?U1(e):j1.call(e)===H1};});var Ud=_((aN,Md)=>{var z1=Number.prototype.toString,G1=function(e){try{return z1.call(e),!0}catch{return !1}},V1=Object.prototype.toString,K1="[object Number]",Y1=pr()();Md.exports=function(e){return typeof e=="number"?!0:typeof e!="object"?!1:Y1?G1(e):V1.call(e)===K1};});var Wd=_((uN,Hd)=>{var jd=bt(),J1=jd("Boolean.prototype.toString"),X1=jd("Object.prototype.toString"),Q1=function(e){try{return J1(e),!0}catch{return !1}},Z1="[object Boolean]",eC=pr()();Hd.exports=function(e){return typeof e=="boolean"?!0:e===null||typeof e!="object"?!1:eC&&Symbol.toStringTag in e?Q1(e):X1(e)===Z1};});var Kd=_((lN,su)=>{var tC=Object.prototype.toString,rC=pa()();rC?(zd=Symbol.prototype.toString,Gd=/^Symbol\(.*\)$/,Vd=function(e){return typeof e.valueOf()!="symbol"?!1:Gd.test(zd.call(e))},su.exports=function(e){if(typeof e=="symbol")return !0;if(tC.call(e)!=="[object Symbol]")return !1;try{return Vd(e)}catch{return !1}}):su.exports=function(e){return !1};var zd,Gd,Vd;});var Xd=_((cN,Jd)=>{var Yd=typeof BigInt<"u"&&BigInt;Jd.exports=function(){return typeof Yd=="function"&&typeof BigInt=="function"&&typeof Yd(42)=="bigint"&&typeof BigInt(42)=="bigint"};});var ey=_((fN,ou)=>{var nC=Xd()();nC?(Qd=BigInt.prototype.valueOf,Zd=function(e){try{return Qd.call(e),!0}catch{}return !1},ou.exports=function(e){return e===null||typeof e>"u"||typeof e=="boolean"||typeof e=="string"||typeof e=="number"||typeof e=="symbol"||typeof e=="function"?!1:typeof e=="bigint"?!0:Zd(e)}):ou.exports=function(e){return !1};var Qd,Zd;});var ry=_((hN,ty)=>{var iC=Nd(),sC=Ud(),oC=Wd(),aC=Kd(),uC=ey();ty.exports=function(e){if(e==null||typeof e!="object"&&typeof e!="function")return null;if(iC(e))return "String";if(sC(e))return "Number";if(oC(e))return "Boolean";if(aC(e))return "Symbol";if(uC(e))return "BigInt"};});var oy=_((pN,sy)=>{var au=typeof Map=="function"&&Map.prototype?Map:null,lC=typeof Set=="function"&&Set.prototype?Set:null,xs;au||(xs=function(e){return !1});var iy=au?Map.prototype.has:null,ny=lC?Set.prototype.has:null;!xs&&!iy&&(xs=function(e){return !1});sy.exports=xs||function(e){if(!e||typeof e!="object")return !1;try{if(iy.call(e),ny)try{ny.call(e);}catch{return !0}return e instanceof au}catch{}return !1};});var cy=_((dN,ly)=>{var cC=typeof Map=="function"&&Map.prototype?Map:null,uu=typeof Set=="function"&&Set.prototype?Set:null,As;uu||(As=function(e){return !1});var ay=cC?Map.prototype.has:null,uy=uu?Set.prototype.has:null;!As&&!uy&&(As=function(e){return !1});ly.exports=As||function(e){if(!e||typeof e!="object")return !1;try{if(uy.call(e),ay)try{ay.call(e);}catch{return !0}return e instanceof uu}catch{}return !1};});var py=_((yN,hy)=>{var _s=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,fy=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,Cs;_s||(Cs=function(e){return !1});var cu=_s?_s.prototype.has:null,lu=fy?fy.prototype.has:null;!Cs&&!cu&&(Cs=function(e){return !1});hy.exports=Cs||function(e){if(!e||typeof e!="object")return !1;try{if(cu.call(e,cu),lu)try{lu.call(e,lu);}catch{return !0}return e instanceof _s}catch{}return !1};});var yy=_((gN,hu)=>{var fC=qt(),dy=bt(),hC=fC("%WeakSet%",!0),fu=dy("WeakSet.prototype.has",!0);fu?(Rs=dy("WeakMap.prototype.has",!0),hu.exports=function(e){if(!e||typeof e!="object")return !1;try{if(fu(e,fu),Rs)try{Rs(e,Rs);}catch{return !0}return e instanceof hC}catch{}return !1}):hu.exports=function(e){return !1};var Rs;});var my=_((mN,gy)=>{var pC=oy(),dC=cy(),yC=py(),gC=yy();gy.exports=function(e){if(e&&typeof e=="object"){if(pC(e))return "Map";if(dC(e))return "Set";if(yC(e))return "WeakMap";if(gC(e))return "WeakSet"}return !1};});var Sy=_((wN,vy)=>{var mC=bt(),wy=mC("ArrayBuffer.prototype.byteLength",!0),wC=tu();vy.exports=function(e){return wC(e)?wy?wy(e):e.byteLength:NaN};});var zy=_((vN,Wy)=>{var Uy=ip(),Dt=bt(),by=wp(),vC=qt(),dn=bp(),SC=zp(),Ey=ed(),xy=id(),Ay=od(),_y=tu(),Cy=Td(),Ry=kd(),Oy=Bd(),Ty=rs(),Py=ry(),Iy=my(),$y=eu(),Fy=Sy(),ky=Dt("SharedArrayBuffer.prototype.byteLength",!0),Ly=Dt("Date.prototype.getTime"),pu=Object.getPrototypeOf,qy=Dt("Object.prototype.toString"),Ts=vC("%Set%",!0),du=Dt("Map.prototype.has",!0),Ps=Dt("Map.prototype.get",!0),By=Dt("Map.prototype.size",!0),Is=Dt("Set.prototype.add",!0),jy=Dt("Set.prototype.delete",!0),$s=Dt("Set.prototype.has",!0),Os=Dt("Set.prototype.size",!0);function Dy(t,e,r,n){for(var s=dn(t),i;(i=s.next())&&!i.done;)if(Ct(e,i.value,r,n))return jy(t,i.value),!0;return !1}function Hy(t){if(typeof t>"u")return null;if(typeof t!="object")return typeof t=="symbol"?!1:typeof t=="string"||typeof t=="number"?+t==+t:!0}function bC(t,e,r,n,s,i){var o=Hy(r);if(o!=null)return o;var u=Ps(e,o),c=Uy({},s,{strict:!1});return typeof u>"u"&&!du(e,o)||!Ct(n,u,c,i)?!1:!du(t,o)&&Ct(n,u,c,i)}function EC(t,e,r){var n=Hy(r);return n??($s(e,n)&&!$s(t,n))}function Ny(t,e,r,n,s,i){for(var o=dn(t),u,c;(u=o.next())&&!u.done;)if(c=u.value,Ct(r,c,s,i)&&Ct(n,Ps(e,c),s,i))return jy(t,c),!0;return !1}function Ct(t,e,r,n){var s=r||{};if(s.strict?Ey(t,e):t===e)return !0;var i=Py(t),o=Py(e);if(i!==o)return !1;if(!t||!e||typeof t!="object"&&typeof e!="object")return s.strict?Ey(t,e):t==e;var u=n.has(t),c=n.has(e),p;if(u&&c){if(n.get(t)===n.get(e))return !0}else p={};return u||n.set(t,p),c||n.set(e,p),_C(t,e,s,n)}function My(t){return !t||typeof t!="object"||typeof t.length!="number"||typeof t.copy!="function"||typeof t.slice!="function"||t.length>0&&typeof t[0]!="number"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))}function xC(t,e,r,n){if(Os(t)!==Os(e))return !1;for(var s=dn(t),i=dn(e),o,u,c;(o=s.next())&&!o.done;)if(o.value&&typeof o.value=="object")c||(c=new Ts),Is(c,o.value);else if(!$s(e,o.value)){if(r.strict||!EC(t,e,o.value))return !1;c||(c=new Ts),Is(c,o.value);}if(c){for(;(u=i.next())&&!u.done;)if(u.value&&typeof u.value=="object"){if(!Dy(c,u.value,r.strict,n))return !1}else if(!r.strict&&!$s(t,u.value)&&!Dy(c,u.value,r.strict,n))return !1;return Os(c)===0}return !0}function AC(t,e,r,n){if(By(t)!==By(e))return !1;for(var s=dn(t),i=dn(e),o,u,c,p,l,d;(o=s.next())&&!o.done;)if(p=o.value[0],l=o.value[1],p&&typeof p=="object")c||(c=new Ts),Is(c,p);else if(d=Ps(e,p),typeof d>"u"&&!du(e,p)||!Ct(l,d,r,n)){if(r.strict||!bC(t,e,p,l,r,n))return !1;c||(c=new Ts),Is(c,p);}if(c){for(;(u=i.next())&&!u.done;)if(p=u.value[0],d=u.value[1],p&&typeof p=="object"){if(!Ny(c,t,p,d,r,n))return !1}else if(!r.strict&&(!t.has(p)||!Ct(Ps(t,p),d,r,n))&&!Ny(c,t,p,d,Uy({},r,{strict:!1}),n))return !1;return Os(c)===0}return !0}function _C(t,e,r,n){var s,i;if(typeof t!=typeof e||t==null||e==null||qy(t)!==qy(e)||xy(t)!==xy(e))return !1;var o=Ay(t),u=Ay(e);if(o!==u)return !1;var c=t instanceof Error,p=e instanceof Error;if(c!==p||(c||p)&&(t.name!==e.name||t.message!==e.message))return !1;var l=Ry(t),d=Ry(e);if(l!==d||(l||d)&&(t.source!==e.source||by(t)!==by(e)))return !1;var g=Cy(t),m=Cy(e);if(g!==m||(g||m)&&Ly(t)!==Ly(e)||r.strict&&pu&&pu(t)!==pu(e))return !1;var w=$y(t),E=$y(e);if(w!==E)return !1;if(w||E){if(t.length!==e.length)return !1;for(s=0;s<t.length;s++)if(t[s]!==e[s])return !1;return !0}var A=My(t),R=My(e);if(A!==R)return !1;if(A||R){if(t.length!==e.length)return !1;for(s=0;s<t.length;s++)if(t[s]!==e[s])return !1;return !0}var x=_y(t),O=_y(e);if(x!==O)return !1;if(x||O)return Fy(t)!==Fy(e)?!1:typeof Uint8Array=="function"&&Ct(new Uint8Array(t),new Uint8Array(e),r,n);var F=Oy(t),q=Oy(e);if(F!==q)return !1;if(F||q)return ky(t)!==ky(e)?!1:typeof Uint8Array=="function"&&Ct(new Uint8Array(t),new Uint8Array(e),r,n);if(typeof t!=typeof e)return !1;var W=Ty(t),H=Ty(e);if(W.length!==H.length)return !1;for(W.sort(),H.sort(),s=W.length-1;s>=0;s--)if(W[s]!=H[s])return !1;for(s=W.length-1;s>=0;s--)if(i=W[s],!Ct(t[i],e[i],r,n))return !1;var B=Iy(t),k=Iy(e);return B!==k?!1:B==="Set"||k==="Set"?xC(t,e,r,n):B==="Map"?AC(t,e,r,n):!0}Wy.exports=function(e,r,n){return Ct(e,r,n,SC())};});var ng={};sa(ng,{closest:()=>YC,distance:()=>rg});var Yt,VC,KC,rg,YC,ig=Ji(()=>{Yt=new Uint32Array(65536),VC=(t,e)=>{let r=t.length,n=e.length,s=1<<r-1,i=-1,o=0,u=r,c=r;for(;c--;)Yt[t.charCodeAt(c)]|=1<<c;for(c=0;c<n;c++){let p=Yt[e.charCodeAt(c)],l=p|o;p|=(p&i)+i^i,o|=~(p|i),i&=p,o&s&&u++,i&s&&u--,o=o<<1|1,i=i<<1|~(l|o),o&=l;}for(c=r;c--;)Yt[t.charCodeAt(c)]=0;return u},KC=(t,e)=>{let r=e.length,n=t.length,s=[],i=[],o=Math.ceil(r/32),u=Math.ceil(n/32);for(let w=0;w<o;w++)i[w]=-1,s[w]=0;let c=0;for(;c<u-1;c++){let w=0,E=-1,A=c*32,R=Math.min(32,n)+A;for(let x=A;x<R;x++)Yt[t.charCodeAt(x)]|=1<<x;for(let x=0;x<r;x++){let O=Yt[e.charCodeAt(x)],F=i[x/32|0]>>>x&1,q=s[x/32|0]>>>x&1,W=O|w,H=((O|q)&E)+E^E|O|q,B=w|~(H|E),k=E&H;B>>>31^F&&(i[x/32|0]^=1<<x),k>>>31^q&&(s[x/32|0]^=1<<x),B=B<<1|F,k=k<<1|q,E=k|~(W|B),w=B&W;}for(let x=A;x<R;x++)Yt[t.charCodeAt(x)]=0;}let p=0,l=-1,d=c*32,g=Math.min(32,n-d)+d;for(let w=d;w<g;w++)Yt[t.charCodeAt(w)]|=1<<w;let m=n;for(let w=0;w<r;w++){let E=Yt[e.charCodeAt(w)],A=i[w/32|0]>>>w&1,R=s[w/32|0]>>>w&1,x=E|p,O=((E|R)&l)+l^l|E|R,F=p|~(O|l),q=l&O;m+=F>>>n-1&1,m-=q>>>n-1&1,F>>>31^A&&(i[w/32|0]^=1<<w),q>>>31^R&&(s[w/32|0]^=1<<w),F=F<<1|A,q=q<<1|R,l=q|~(x|F),p=F&x;}for(let w=d;w<g;w++)Yt[t.charCodeAt(w)]=0;return m},rg=(t,e)=>{if(t.length<e.length){let r=e;e=t,t=r;}return e.length===0?t.length:t.length<=32?VC(t,e):KC(t,e)},YC=(t,e)=>{let r=1/0,n=0;for(let s=0;s<e.length;s++){let i=rg(t,e[s]);i<r&&(r=i,n=s);}return e[n]};});var sg=_((vu,oi)=>{(function(){var t;try{t=typeof Intl<"u"&&typeof Intl.Collator<"u"?Intl.Collator("generic",{sensitivity:"base"}):null;}catch{console.log("Collator could not be initialized and wouldn't be used");}var e=(ig(),oa(ng)),r=[],n=[],s={get:function(i,o,u){var c=u&&t&&u.useCollator;if(c){var p=i.length,l=o.length;if(p===0)return l;if(l===0)return p;var d,g,m,w,E;for(m=0;m<l;++m)r[m]=m,n[m]=o.charCodeAt(m);r[l]=l;var A;for(m=0;m<p;++m){for(g=m+1,w=0;w<l;++w)d=g,A=t.compare(i.charAt(m),String.fromCharCode(n[w]))===0,g=r[w]+(A?0:1),E=d+1,g>E&&(g=E),E=r[w+1]+1,g>E&&(g=E),r[w]=d;r[w]=g;}return g}return e.distance(i,o)}};typeof define<"u"&&define!==null&&define.amd?define(function(){return s}):typeof oi<"u"&&oi!==null&&typeof vu<"u"&&oi.exports===vu?oi.exports=s:typeof self<"u"&&typeof self.postMessage=="function"&&typeof self.importScripts=="function"?self.Levenshtein=s:typeof window<"u"&&window!==null&&(window.Levenshtein=s);})();});var ui=Ji(()=>{});var Ze=_(Eu=>{Eu.fromCallback=function(t){return Object.defineProperty(function(...e){if(typeof e[e.length-1]=="function")t.apply(this,e);else return new Promise((r,n)=>{t.call(this,...e,(s,i)=>s!=null?n(s):r(i));})},"name",{value:t.name})};Eu.fromPromise=function(t){return Object.defineProperty(function(...e){let r=e[e.length-1];if(typeof r!="function")return t.apply(this,e);t.apply(this,e.slice(0,-1)).then(n=>r(null,n),r);},"name",{value:t.name})};});var cg=_((ON,lg)=>{var yr=G("constants"),QC=process.cwd,Bs=null,ZC=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return Bs||(Bs=QC.call(process)),Bs};try{process.cwd();}catch{}typeof process.chdir=="function"&&(xu=process.chdir,process.chdir=function(t){Bs=null,xu.call(process,t);},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,xu));var xu;lg.exports=eR;function eR(t){yr.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||r(t),t.chown=i(t.chown),t.fchown=i(t.fchown),t.lchown=i(t.lchown),t.chmod=n(t.chmod),t.fchmod=n(t.fchmod),t.lchmod=n(t.lchmod),t.chownSync=o(t.chownSync),t.fchownSync=o(t.fchownSync),t.lchownSync=o(t.lchownSync),t.chmodSync=s(t.chmodSync),t.fchmodSync=s(t.fchmodSync),t.lchmodSync=s(t.lchmodSync),t.stat=u(t.stat),t.fstat=u(t.fstat),t.lstat=u(t.lstat),t.statSync=c(t.statSync),t.fstatSync=c(t.fstatSync),t.lstatSync=c(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(l,d,g){g&&process.nextTick(g);},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(l,d,g,m){m&&process.nextTick(m);},t.lchownSync=function(){}),ZC==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:function(l){function d(g,m,w){var E=Date.now(),A=0;l(g,m,function R(x){if(x&&(x.code==="EACCES"||x.code==="EPERM"||x.code==="EBUSY")&&Date.now()-E<6e4){setTimeout(function(){t.stat(m,function(O,F){O&&O.code==="ENOENT"?l(g,m,R):w(x);});},A),A<100&&(A+=10);return}w&&w(x);});}return Object.setPrototypeOf&&Object.setPrototypeOf(d,l),d}(t.rename)),t.read=typeof t.read!="function"?t.read:function(l){function d(g,m,w,E,A,R){var x;if(R&&typeof R=="function"){var O=0;x=function(F,q,W){if(F&&F.code==="EAGAIN"&&O<10)return O++,l.call(t,g,m,w,E,A,x);R.apply(this,arguments);};}return l.call(t,g,m,w,E,A,x)}return Object.setPrototypeOf&&Object.setPrototypeOf(d,l),d}(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:function(l){return function(d,g,m,w,E){for(var A=0;;)try{return l.call(t,d,g,m,w,E)}catch(R){if(R.code==="EAGAIN"&&A<10){A++;continue}throw R}}}(t.readSync);function e(l){l.lchmod=function(d,g,m){l.open(d,yr.O_WRONLY|yr.O_SYMLINK,g,function(w,E){if(w){m&&m(w);return}l.fchmod(E,g,function(A){l.close(E,function(R){m&&m(A||R);});});});},l.lchmodSync=function(d,g){var m=l.openSync(d,yr.O_WRONLY|yr.O_SYMLINK,g),w=!0,E;try{E=l.fchmodSync(m,g),w=!1;}finally{if(w)try{l.closeSync(m);}catch{}else l.closeSync(m);}return E};}function r(l){yr.hasOwnProperty("O_SYMLINK")&&l.futimes?(l.lutimes=function(d,g,m,w){l.open(d,yr.O_SYMLINK,function(E,A){if(E){w&&w(E);return}l.futimes(A,g,m,function(R){l.close(A,function(x){w&&w(R||x);});});});},l.lutimesSync=function(d,g,m){var w=l.openSync(d,yr.O_SYMLINK),E,A=!0;try{E=l.futimesSync(w,g,m),A=!1;}finally{if(A)try{l.closeSync(w);}catch{}else l.closeSync(w);}return E}):l.futimes&&(l.lutimes=function(d,g,m,w){w&&process.nextTick(w);},l.lutimesSync=function(){});}function n(l){return l&&function(d,g,m){return l.call(t,d,g,function(w){p(w)&&(w=null),m&&m.apply(this,arguments);})}}function s(l){return l&&function(d,g){try{return l.call(t,d,g)}catch(m){if(!p(m))throw m}}}function i(l){return l&&function(d,g,m,w){return l.call(t,d,g,m,function(E){p(E)&&(E=null),w&&w.apply(this,arguments);})}}function o(l){return l&&function(d,g,m){try{return l.call(t,d,g,m)}catch(w){if(!p(w))throw w}}}function u(l){return l&&function(d,g,m){typeof g=="function"&&(m=g,g=null);function w(E,A){A&&(A.uid<0&&(A.uid+=4294967296),A.gid<0&&(A.gid+=4294967296)),m&&m.apply(this,arguments);}return g?l.call(t,d,g,w):l.call(t,d,w)}}function c(l){return l&&function(d,g){var m=g?l.call(t,d,g):l.call(t,d);return m&&(m.uid<0&&(m.uid+=4294967296),m.gid<0&&(m.gid+=4294967296)),m}}function p(l){if(!l||l.code==="ENOSYS")return !0;var d=!process.getuid||process.getuid()!==0;return !!(d&&(l.code==="EINVAL"||l.code==="EPERM"))}}});var pg=_((TN,hg)=>{var fg=G("stream").Stream;hg.exports=tR;function tR(t){return {ReadStream:e,WriteStream:r};function e(n,s){if(!(this instanceof e))return new e(n,s);fg.call(this);var i=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,s=s||{};for(var o=Object.keys(s),u=0,c=o.length;u<c;u++){var p=o[u];this[p]=s[p];}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start;}if(this.fd!==null){process.nextTick(function(){i._read();});return}t.open(this.path,this.flags,this.mode,function(l,d){if(l){i.emit("error",l),i.readable=!1;return}i.fd=d,i.emit("open",d),i._read();});}function r(n,s){if(!(this instanceof r))return new r(n,s);fg.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,s=s||{};for(var i=Object.keys(s),o=0,u=i.length;o<u;o++){var c=i[o];this[c]=s[c];}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start;}this.busy=!1,this._queue=[],this.fd===null&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush());}}});var yg=_((PN,dg)=>{dg.exports=nR;var rR=Object.getPrototypeOf||function(t){return t.__proto__};function nR(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:rR(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));}),e}});var et=_((IN,Cu)=>{var Ae=G("fs"),iR=cg(),sR=pg(),oR=yg(),Ds=G("util"),We,Ms;typeof Symbol=="function"&&typeof Symbol.for=="function"?(We=Symbol.for("graceful-fs.queue"),Ms=Symbol.for("graceful-fs.previous")):(We="___graceful-fs.queue",Ms="___graceful-fs.previous");function aR(){}function wg(t,e){Object.defineProperty(t,We,{get:function(){return e}});}var qr=aR;Ds.debuglog?qr=Ds.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(qr=function(){var t=Ds.format.apply(Ds,arguments);t="GFS4: "+t.split(/\n/).join(`
GFS4: `),console.error(t);});Ae[We]||(gg=global[We]||[],wg(Ae,gg),Ae.close=function(t){function e(r,n){return t.call(Ae,r,function(s){s||mg(),typeof n=="function"&&n.apply(this,arguments);})}return Object.defineProperty(e,Ms,{value:t}),e}(Ae.close),Ae.closeSync=function(t){function e(r){t.apply(Ae,arguments),mg();}return Object.defineProperty(e,Ms,{value:t}),e}(Ae.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){qr(Ae[We]),G("assert").equal(Ae[We].length,0);}));var gg;global[We]||wg(global,Ae[We]);Cu.exports=Au(oR(Ae));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Ae.__patched&&(Cu.exports=Au(Ae),Ae.__patched=!0);function Au(t){iR(t),t.gracefulify=Au,t.createReadStream=q,t.createWriteStream=W;var e=t.readFile;t.readFile=r;function r(k,U,C){return typeof U=="function"&&(C=U,U=null),Y(k,U,C);function Y(J,oe,P,I){return e(J,oe,function(re){re&&(re.code==="EMFILE"||re.code==="ENFILE")?mn([Y,[J,oe,P],re,I||Date.now(),Date.now()]):typeof P=="function"&&P.apply(this,arguments);})}}var n=t.writeFile;t.writeFile=s;function s(k,U,C,Y){return typeof C=="function"&&(Y=C,C=null),J(k,U,C,Y);function J(oe,P,I,re,Z){return n(oe,P,I,function(ce){ce&&(ce.code==="EMFILE"||ce.code==="ENFILE")?mn([J,[oe,P,I,re],ce,Z||Date.now(),Date.now()]):typeof re=="function"&&re.apply(this,arguments);})}}var i=t.appendFile;i&&(t.appendFile=o);function o(k,U,C,Y){return typeof C=="function"&&(Y=C,C=null),J(k,U,C,Y);function J(oe,P,I,re,Z){return i(oe,P,I,function(ce){ce&&(ce.code==="EMFILE"||ce.code==="ENFILE")?mn([J,[oe,P,I,re],ce,Z||Date.now(),Date.now()]):typeof re=="function"&&re.apply(this,arguments);})}}var u=t.copyFile;u&&(t.copyFile=c);function c(k,U,C,Y){return typeof C=="function"&&(Y=C,C=0),J(k,U,C,Y);function J(oe,P,I,re,Z){return u(oe,P,I,function(ce){ce&&(ce.code==="EMFILE"||ce.code==="ENFILE")?mn([J,[oe,P,I,re],ce,Z||Date.now(),Date.now()]):typeof re=="function"&&re.apply(this,arguments);})}}var p=t.readdir;t.readdir=d;var l=/^v[0-5]\./;function d(k,U,C){typeof U=="function"&&(C=U,U=null);var Y=l.test(process.version)?function(P,I,re,Z){return p(P,J(P,I,re,Z))}:function(P,I,re,Z){return p(P,I,J(P,I,re,Z))};return Y(k,U,C);function J(oe,P,I,re){return function(Z,ce){Z&&(Z.code==="EMFILE"||Z.code==="ENFILE")?mn([Y,[oe,P,I],Z,re||Date.now(),Date.now()]):(ce&&ce.sort&&ce.sort(),typeof I=="function"&&I.call(this,Z,ce));}}}if(process.version.substr(0,4)==="v0.8"){var g=sR(t);R=g.ReadStream,O=g.WriteStream;}var m=t.ReadStream;m&&(R.prototype=Object.create(m.prototype),R.prototype.open=x);var w=t.WriteStream;w&&(O.prototype=Object.create(w.prototype),O.prototype.open=F),Object.defineProperty(t,"ReadStream",{get:function(){return R},set:function(k){R=k;},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return O},set:function(k){O=k;},enumerable:!0,configurable:!0});var E=R;Object.defineProperty(t,"FileReadStream",{get:function(){return E},set:function(k){E=k;},enumerable:!0,configurable:!0});var A=O;Object.defineProperty(t,"FileWriteStream",{get:function(){return A},set:function(k){A=k;},enumerable:!0,configurable:!0});function R(k,U){return this instanceof R?(m.apply(this,arguments),this):R.apply(Object.create(R.prototype),arguments)}function x(){var k=this;B(k.path,k.flags,k.mode,function(U,C){U?(k.autoClose&&k.destroy(),k.emit("error",U)):(k.fd=C,k.emit("open",C),k.read());});}function O(k,U){return this instanceof O?(w.apply(this,arguments),this):O.apply(Object.create(O.prototype),arguments)}function F(){var k=this;B(k.path,k.flags,k.mode,function(U,C){U?(k.destroy(),k.emit("error",U)):(k.fd=C,k.emit("open",C));});}function q(k,U){return new t.ReadStream(k,U)}function W(k,U){return new t.WriteStream(k,U)}var H=t.open;t.open=B;function B(k,U,C,Y){return typeof C=="function"&&(Y=C,C=null),J(k,U,C,Y);function J(oe,P,I,re,Z){return H(oe,P,I,function(ce,Ke){ce&&(ce.code==="EMFILE"||ce.code==="ENFILE")?mn([J,[oe,P,I,re],ce,Z||Date.now(),Date.now()]):typeof re=="function"&&re.apply(this,arguments);})}}return t}function mn(t){qr("ENQUEUE",t[0].name,t[1]),Ae[We].push(t),_u();}var Ns;function mg(){for(var t=Date.now(),e=0;e<Ae[We].length;++e)Ae[We][e].length>2&&(Ae[We][e][3]=t,Ae[We][e][4]=t);_u();}function _u(){if(clearTimeout(Ns),Ns=void 0,Ae[We].length!==0){var t=Ae[We].shift(),e=t[0],r=t[1],n=t[2],s=t[3],i=t[4];if(s===void 0)qr("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-s>=6e4){qr("TIMEOUT",e.name,r);var o=r.pop();typeof o=="function"&&o.call(null,n);}else {var u=Date.now()-i,c=Math.max(i-s,1),p=Math.min(c*1.2,100);u>=p?(qr("RETRY",e.name,r),e.apply(null,r.concat([s]))):Ae[We].push(t);}Ns===void 0&&(Ns=setTimeout(_u,0));}}});var Br=_(Jt=>{var vg=Ze().fromCallback,Ye=et(),uR=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter(t=>typeof Ye[t]=="function");Object.assign(Jt,Ye);uR.forEach(t=>{Jt[t]=vg(Ye[t]);});Jt.exists=function(t,e){return typeof e=="function"?Ye.exists(t,e):new Promise(r=>Ye.exists(t,r))};Jt.read=function(t,e,r,n,s,i){return typeof i=="function"?Ye.read(t,e,r,n,s,i):new Promise((o,u)=>{Ye.read(t,e,r,n,s,(c,p,l)=>{if(c)return u(c);o({bytesRead:p,buffer:l});});})};Jt.write=function(t,e,...r){return typeof r[r.length-1]=="function"?Ye.write(t,e,...r):new Promise((n,s)=>{Ye.write(t,e,...r,(i,o,u)=>{if(i)return s(i);n({bytesWritten:o,buffer:u});});})};Jt.readv=function(t,e,...r){return typeof r[r.length-1]=="function"?Ye.readv(t,e,...r):new Promise((n,s)=>{Ye.readv(t,e,...r,(i,o,u)=>{if(i)return s(i);n({bytesRead:o,buffers:u});});})};Jt.writev=function(t,e,...r){return typeof r[r.length-1]=="function"?Ye.writev(t,e,...r):new Promise((n,s)=>{Ye.writev(t,e,...r,(i,o,u)=>{if(i)return s(i);n({bytesWritten:o,buffers:u});});})};typeof Ye.realpath.native=="function"?Jt.realpath.native=vg(Ye.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003");});var bg=_((FN,Sg)=>{var lR=G("path");Sg.exports.checkPath=function(e){if(process.platform==="win32"&&/[<>:"|?*]/.test(e.replace(lR.parse(e).root,""))){let n=new Error(`Path contains invalid characters: ${e}`);throw n.code="EINVAL",n}};});var _g=_((kN,Ru)=>{var Eg=Br(),{checkPath:xg}=bg(),Ag=t=>{let e={mode:511};return typeof t=="number"?t:{...e,...t}.mode};Ru.exports.makeDir=async(t,e)=>(xg(t),Eg.mkdir(t,{mode:Ag(e),recursive:!0}));Ru.exports.makeDirSync=(t,e)=>(xg(t),Eg.mkdirSync(t,{mode:Ag(e),recursive:!0}));});var Rt=_((LN,Cg)=>{var cR=Ze().fromPromise,{makeDir:fR,makeDirSync:Ou}=_g(),Tu=cR(fR);Cg.exports={mkdirs:Tu,mkdirsSync:Ou,mkdirp:Tu,mkdirpSync:Ou,ensureDir:Tu,ensureDirSync:Ou};});var gr=_((qN,Og)=>{var hR=Ze().fromPromise,Rg=Br();function pR(t){return Rg.access(t).then(()=>!0).catch(()=>!1)}Og.exports={pathExists:hR(pR),pathExistsSync:Rg.existsSync};});var Pu=_((BN,Tg)=>{var wn=et();function dR(t,e,r,n){wn.open(t,"r+",(s,i)=>{if(s)return n(s);wn.futimes(i,e,r,o=>{wn.close(i,u=>{n&&n(o||u);});});});}function yR(t,e,r){let n=wn.openSync(t,"r+");return wn.futimesSync(n,e,r),wn.closeSync(n)}Tg.exports={utimesMillis:dR,utimesMillisSync:yR};});var Dr=_((DN,$g)=>{var vn=Br(),ke=G("path"),gR=G("util");function mR(t,e,r){let n=r.dereference?s=>vn.stat(s,{bigint:!0}):s=>vn.lstat(s,{bigint:!0});return Promise.all([n(t),n(e).catch(s=>{if(s.code==="ENOENT")return null;throw s})]).then(([s,i])=>({srcStat:s,destStat:i}))}function wR(t,e,r){let n,s=r.dereference?o=>vn.statSync(o,{bigint:!0}):o=>vn.lstatSync(o,{bigint:!0}),i=s(t);try{n=s(e);}catch(o){if(o.code==="ENOENT")return {srcStat:i,destStat:null};throw o}return {srcStat:i,destStat:n}}function vR(t,e,r,n,s){gR.callbackify(mR)(t,e,n,(i,o)=>{if(i)return s(i);let{srcStat:u,destStat:c}=o;if(c){if(li(u,c)){let p=ke.basename(t),l=ke.basename(e);return r==="move"&&p!==l&&p.toLowerCase()===l.toLowerCase()?s(null,{srcStat:u,destStat:c,isChangingCase:!0}):s(new Error("Source and destination must not be the same."))}if(u.isDirectory()&&!c.isDirectory())return s(new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`));if(!u.isDirectory()&&c.isDirectory())return s(new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`))}return u.isDirectory()&&Iu(t,e)?s(new Error(Us(t,e,r))):s(null,{srcStat:u,destStat:c})});}function SR(t,e,r,n){let{srcStat:s,destStat:i}=wR(t,e,n);if(i){if(li(s,i)){let o=ke.basename(t),u=ke.basename(e);if(r==="move"&&o!==u&&o.toLowerCase()===u.toLowerCase())return {srcStat:s,destStat:i,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(s.isDirectory()&&!i.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`);if(!s.isDirectory()&&i.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`)}if(s.isDirectory()&&Iu(t,e))throw new Error(Us(t,e,r));return {srcStat:s,destStat:i}}function Pg(t,e,r,n,s){let i=ke.resolve(ke.dirname(t)),o=ke.resolve(ke.dirname(r));if(o===i||o===ke.parse(o).root)return s();vn.stat(o,{bigint:!0},(u,c)=>u?u.code==="ENOENT"?s():s(u):li(e,c)?s(new Error(Us(t,r,n))):Pg(t,e,o,n,s));}function Ig(t,e,r,n){let s=ke.resolve(ke.dirname(t)),i=ke.resolve(ke.dirname(r));if(i===s||i===ke.parse(i).root)return;let o;try{o=vn.statSync(i,{bigint:!0});}catch(u){if(u.code==="ENOENT")return;throw u}if(li(e,o))throw new Error(Us(t,r,n));return Ig(t,e,i,n)}function li(t,e){return e.ino&&e.dev&&e.ino===t.ino&&e.dev===t.dev}function Iu(t,e){let r=ke.resolve(t).split(ke.sep).filter(s=>s),n=ke.resolve(e).split(ke.sep).filter(s=>s);return r.reduce((s,i,o)=>s&&n[o]===i,!0)}function Us(t,e,r){return `Cannot ${r} '${t}' to a subdirectory of itself, '${e}'.`}$g.exports={checkPaths:vR,checkPathsSync:SR,checkParentPaths:Pg,checkParentPathsSync:Ig,isSrcSubdir:Iu,areIdentical:li};});var Dg=_((NN,Bg)=>{var tt=et(),ci=G("path"),bR=Rt().mkdirs,ER=gr().pathExists,xR=Pu().utimesMillis,fi=Dr();function AR(t,e,r,n){typeof r=="function"&&!n?(n=r,r={}):typeof r=="function"&&(r={filter:r}),n=n||function(){},r=r||{},r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001"),fi.checkPaths(t,e,"copy",r,(s,i)=>{if(s)return n(s);let{srcStat:o,destStat:u}=i;fi.checkParentPaths(t,o,e,"copy",c=>{if(c)return n(c);kg(t,e,r,(p,l)=>{if(p)return n(p);if(!l)return n();_R(u,t,e,r,n);});});});}function _R(t,e,r,n,s){let i=ci.dirname(r);ER(i,(o,u)=>{if(o)return s(o);if(u)return $u(t,e,r,n,s);bR(i,c=>c?s(c):$u(t,e,r,n,s));});}function kg(t,e,r,n){if(!r.filter)return n(null,!0);Promise.resolve(r.filter(t,e)).then(s=>n(null,s),s=>n(s));}function $u(t,e,r,n,s){(n.dereference?tt.stat:tt.lstat)(e,(o,u)=>o?s(o):u.isDirectory()?$R(u,t,e,r,n,s):u.isFile()||u.isCharacterDevice()||u.isBlockDevice()?CR(u,t,e,r,n,s):u.isSymbolicLink()?LR(t,e,r,n,s):u.isSocket()?s(new Error(`Cannot copy a socket file: ${e}`)):u.isFIFO()?s(new Error(`Cannot copy a FIFO pipe: ${e}`)):s(new Error(`Unknown file: ${e}`)));}function CR(t,e,r,n,s,i){return e?RR(t,r,n,s,i):Lg(t,r,n,s,i)}function RR(t,e,r,n,s){if(n.overwrite)tt.unlink(r,i=>i?s(i):Lg(t,e,r,n,s));else return n.errorOnExist?s(new Error(`'${r}' already exists`)):s()}function Lg(t,e,r,n,s){tt.copyFile(e,r,i=>i?s(i):n.preserveTimestamps?OR(t.mode,e,r,s):js(r,t.mode,s));}function OR(t,e,r,n){return TR(t)?PR(r,t,s=>s?n(s):Fg(t,e,r,n)):Fg(t,e,r,n)}function TR(t){return (t&128)===0}function PR(t,e,r){return js(t,e|128,r)}function Fg(t,e,r,n){IR(e,r,s=>s?n(s):js(r,t,n));}function js(t,e,r){return tt.chmod(t,e,r)}function IR(t,e,r){tt.stat(t,(n,s)=>n?r(n):xR(e,s.atime,s.mtime,r));}function $R(t,e,r,n,s,i){return e?qg(r,n,s,i):FR(t.mode,r,n,s,i)}function FR(t,e,r,n,s){tt.mkdir(r,i=>{if(i)return s(i);qg(e,r,n,o=>o?s(o):js(r,t,s));});}function qg(t,e,r,n){tt.readdir(t,(s,i)=>s?n(s):Fu(i,t,e,r,n));}function Fu(t,e,r,n,s){let i=t.pop();return i?kR(t,i,e,r,n,s):s()}function kR(t,e,r,n,s,i){let o=ci.join(r,e),u=ci.join(n,e);kg(o,u,s,(c,p)=>{if(c)return i(c);if(!p)return Fu(t,r,n,s,i);fi.checkPaths(o,u,"copy",s,(l,d)=>{if(l)return i(l);let{destStat:g}=d;$u(g,o,u,s,m=>m?i(m):Fu(t,r,n,s,i));});});}function LR(t,e,r,n,s){tt.readlink(e,(i,o)=>{if(i)return s(i);if(n.dereference&&(o=ci.resolve(process.cwd(),o)),t)tt.readlink(r,(u,c)=>u?u.code==="EINVAL"||u.code==="UNKNOWN"?tt.symlink(o,r,s):s(u):(n.dereference&&(c=ci.resolve(process.cwd(),c)),fi.isSrcSubdir(o,c)?s(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${c}'.`)):fi.isSrcSubdir(c,o)?s(new Error(`Cannot overwrite '${c}' with '${o}'.`)):qR(o,r,s)));else return tt.symlink(o,r,s)});}function qR(t,e,r){tt.unlink(e,n=>n?r(n):tt.symlink(t,e,r));}Bg.exports=AR;});var Hg=_((MN,jg)=>{var Je=et(),hi=G("path"),BR=Rt().mkdirsSync,DR=Pu().utimesMillisSync,pi=Dr();function NR(t,e,r){typeof r=="function"&&(r={filter:r}),r=r||{},r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");let{srcStat:n,destStat:s}=pi.checkPathsSync(t,e,"copy",r);if(pi.checkParentPathsSync(t,n,e,"copy"),r.filter&&!r.filter(t,e))return;let i=hi.dirname(e);return Je.existsSync(i)||BR(i),Ng(s,t,e,r)}function Ng(t,e,r,n){let i=(n.dereference?Je.statSync:Je.lstatSync)(e);if(i.isDirectory())return GR(i,t,e,r,n);if(i.isFile()||i.isCharacterDevice()||i.isBlockDevice())return MR(i,t,e,r,n);if(i.isSymbolicLink())return YR(t,e,r,n);throw i.isSocket()?new Error(`Cannot copy a socket file: ${e}`):i.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}function MR(t,e,r,n,s){return e?UR(t,r,n,s):Mg(t,r,n,s)}function UR(t,e,r,n){if(n.overwrite)return Je.unlinkSync(r),Mg(t,e,r,n);if(n.errorOnExist)throw new Error(`'${r}' already exists`)}function Mg(t,e,r,n){return Je.copyFileSync(e,r),n.preserveTimestamps&&jR(t.mode,e,r),ku(r,t.mode)}function jR(t,e,r){return HR(t)&&WR(r,t),zR(e,r)}function HR(t){return (t&128)===0}function WR(t,e){return ku(t,e|128)}function ku(t,e){return Je.chmodSync(t,e)}function zR(t,e){let r=Je.statSync(t);return DR(e,r.atime,r.mtime)}function GR(t,e,r,n,s){return e?Ug(r,n,s):VR(t.mode,r,n,s)}function VR(t,e,r,n){return Je.mkdirSync(r),Ug(e,r,n),ku(r,t)}function Ug(t,e,r){Je.readdirSync(t).forEach(n=>KR(n,t,e,r));}function KR(t,e,r,n){let s=hi.join(e,t),i=hi.join(r,t);if(n.filter&&!n.filter(s,i))return;let{destStat:o}=pi.checkPathsSync(s,i,"copy",n);return Ng(o,s,i,n)}function YR(t,e,r,n){let s=Je.readlinkSync(e);if(n.dereference&&(s=hi.resolve(process.cwd(),s)),t){let i;try{i=Je.readlinkSync(r);}catch(o){if(o.code==="EINVAL"||o.code==="UNKNOWN")return Je.symlinkSync(s,r);throw o}if(n.dereference&&(i=hi.resolve(process.cwd(),i)),pi.isSrcSubdir(s,i))throw new Error(`Cannot copy '${s}' to a subdirectory of itself, '${i}'.`);if(pi.isSrcSubdir(i,s))throw new Error(`Cannot overwrite '${i}' with '${s}'.`);return JR(s,r)}else return Je.symlinkSync(s,r)}function JR(t,e){return Je.unlinkSync(e),Je.symlinkSync(t,e)}jg.exports=NR;});var Hs=_((UN,Wg)=>{var XR=Ze().fromCallback;Wg.exports={copy:XR(Dg()),copySync:Hg()};});var di=_((jN,Gg)=>{var zg=et(),QR=Ze().fromCallback;function ZR(t,e){zg.rm(t,{recursive:!0,force:!0},e);}function eO(t){zg.rmSync(t,{recursive:!0,force:!0});}Gg.exports={remove:QR(ZR),removeSync:eO};});var em=_((HN,Zg)=>{var tO=Ze().fromPromise,Yg=Br(),Jg=G("path"),Xg=Rt(),Qg=di(),Vg=tO(async function(e){let r;try{r=await Yg.readdir(e);}catch{return Xg.mkdirs(e)}return Promise.all(r.map(n=>Qg.remove(Jg.join(e,n))))});function Kg(t){let e;try{e=Yg.readdirSync(t);}catch{return Xg.mkdirsSync(t)}e.forEach(r=>{r=Jg.join(t,r),Qg.removeSync(r);});}Zg.exports={emptyDirSync:Kg,emptydirSync:Kg,emptyDir:Vg,emptydir:Vg};});var im=_((WN,nm)=>{var rO=Ze().fromCallback,tm=G("path"),mr=et(),rm=Rt();function nO(t,e){function r(){mr.writeFile(t,"",n=>{if(n)return e(n);e();});}mr.stat(t,(n,s)=>{if(!n&&s.isFile())return e();let i=tm.dirname(t);mr.stat(i,(o,u)=>{if(o)return o.code==="ENOENT"?rm.mkdirs(i,c=>{if(c)return e(c);r();}):e(o);u.isDirectory()?r():mr.readdir(i,c=>{if(c)return e(c)});});});}function iO(t){let e;try{e=mr.statSync(t);}catch{}if(e&&e.isFile())return;let r=tm.dirname(t);try{mr.statSync(r).isDirectory()||mr.readdirSync(r);}catch(n){if(n&&n.code==="ENOENT")rm.mkdirsSync(r);else throw n}mr.writeFileSync(t,"");}nm.exports={createFile:rO(nO),createFileSync:iO};});var lm=_((zN,um)=>{var sO=Ze().fromCallback,sm=G("path"),wr=et(),om=Rt(),oO=gr().pathExists,{areIdentical:am}=Dr();function aO(t,e,r){function n(s,i){wr.link(s,i,o=>{if(o)return r(o);r(null);});}wr.lstat(e,(s,i)=>{wr.lstat(t,(o,u)=>{if(o)return o.message=o.message.replace("lstat","ensureLink"),r(o);if(i&&am(u,i))return r(null);let c=sm.dirname(e);oO(c,(p,l)=>{if(p)return r(p);if(l)return n(t,e);om.mkdirs(c,d=>{if(d)return r(d);n(t,e);});});});});}function uO(t,e){let r;try{r=wr.lstatSync(e);}catch{}try{let i=wr.lstatSync(t);if(r&&am(i,r))return}catch(i){throw i.message=i.message.replace("lstat","ensureLink"),i}let n=sm.dirname(e);return wr.existsSync(n)||om.mkdirsSync(n),wr.linkSync(t,e)}um.exports={createLink:sO(aO),createLinkSync:uO};});var fm=_((GN,cm)=>{var vr=G("path"),yi=et(),lO=gr().pathExists;function cO(t,e,r){if(vr.isAbsolute(t))return yi.lstat(t,n=>n?(n.message=n.message.replace("lstat","ensureSymlink"),r(n)):r(null,{toCwd:t,toDst:t}));{let n=vr.dirname(e),s=vr.join(n,t);return lO(s,(i,o)=>i?r(i):o?r(null,{toCwd:s,toDst:t}):yi.lstat(t,u=>u?(u.message=u.message.replace("lstat","ensureSymlink"),r(u)):r(null,{toCwd:t,toDst:vr.relative(n,t)})))}}function fO(t,e){let r;if(vr.isAbsolute(t)){if(r=yi.existsSync(t),!r)throw new Error("absolute srcpath does not exist");return {toCwd:t,toDst:t}}else {let n=vr.dirname(e),s=vr.join(n,t);if(r=yi.existsSync(s),r)return {toCwd:s,toDst:t};if(r=yi.existsSync(t),!r)throw new Error("relative srcpath does not exist");return {toCwd:t,toDst:vr.relative(n,t)}}}cm.exports={symlinkPaths:cO,symlinkPathsSync:fO};});var dm=_((VN,pm)=>{var hm=et();function hO(t,e,r){if(r=typeof e=="function"?e:r,e=typeof e=="function"?!1:e,e)return r(null,e);hm.lstat(t,(n,s)=>{if(n)return r(null,"file");e=s&&s.isDirectory()?"dir":"file",r(null,e);});}function pO(t,e){let r;if(e)return e;try{r=hm.lstatSync(t);}catch{return "file"}return r&&r.isDirectory()?"dir":"file"}pm.exports={symlinkType:hO,symlinkTypeSync:pO};});var Em=_((KN,bm)=>{var dO=Ze().fromCallback,gm=G("path"),Ot=Br(),mm=Rt(),yO=mm.mkdirs,gO=mm.mkdirsSync,wm=fm(),mO=wm.symlinkPaths,wO=wm.symlinkPathsSync,vm=dm(),vO=vm.symlinkType,SO=vm.symlinkTypeSync,bO=gr().pathExists,{areIdentical:Sm}=Dr();function EO(t,e,r,n){n=typeof r=="function"?r:n,r=typeof r=="function"?!1:r,Ot.lstat(e,(s,i)=>{!s&&i.isSymbolicLink()?Promise.all([Ot.stat(t),Ot.stat(e)]).then(([o,u])=>{if(Sm(o,u))return n(null);ym(t,e,r,n);}):ym(t,e,r,n);});}function ym(t,e,r,n){mO(t,e,(s,i)=>{if(s)return n(s);t=i.toDst,vO(i.toCwd,r,(o,u)=>{if(o)return n(o);let c=gm.dirname(e);bO(c,(p,l)=>{if(p)return n(p);if(l)return Ot.symlink(t,e,u,n);yO(c,d=>{if(d)return n(d);Ot.symlink(t,e,u,n);});});});});}function xO(t,e,r){let n;try{n=Ot.lstatSync(e);}catch{}if(n&&n.isSymbolicLink()){let u=Ot.statSync(t),c=Ot.statSync(e);if(Sm(u,c))return}let s=wO(t,e);t=s.toDst,r=SO(s.toCwd,r);let i=gm.dirname(e);return Ot.existsSync(i)||gO(i),Ot.symlinkSync(t,e,r)}bm.exports={createSymlink:dO(EO),createSymlinkSync:xO};});var Pm=_((YN,Tm)=>{var{createFile:xm,createFileSync:Am}=im(),{createLink:_m,createLinkSync:Cm}=lm(),{createSymlink:Rm,createSymlinkSync:Om}=Em();Tm.exports={createFile:xm,createFileSync:Am,ensureFile:xm,ensureFileSync:Am,createLink:_m,createLinkSync:Cm,ensureLink:_m,ensureLinkSync:Cm,createSymlink:Rm,createSymlinkSync:Om,ensureSymlink:Rm,ensureSymlinkSync:Om};});var Ws=_((JN,Im)=>{function AO(t,{EOL:e=`
`,finalEOL:r=!0,replacer:n=null,spaces:s}={}){let i=r?e:"";return JSON.stringify(t,n,s).replace(/\n/g,e)+i}function _O(t){return Buffer.isBuffer(t)&&(t=t.toString("utf8")),t.replace(/^\uFEFF/,"")}Im.exports={stringify:AO,stripBom:_O};});var Lm=_((XN,km)=>{var Sn;try{Sn=et();}catch{Sn=G("fs");}var zs=Ze(),{stringify:$m,stripBom:Fm}=Ws();async function CO(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||Sn,n="throws"in e?e.throws:!0,s=await zs.fromCallback(r.readFile)(t,e);s=Fm(s);let i;try{i=JSON.parse(s,e?e.reviver:null);}catch(o){if(n)throw o.message=`${t}: ${o.message}`,o;return null}return i}var RO=zs.fromPromise(CO);function OO(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||Sn,n="throws"in e?e.throws:!0;try{let s=r.readFileSync(t,e);return s=Fm(s),JSON.parse(s,e.reviver)}catch(s){if(n)throw s.message=`${t}: ${s.message}`,s;return null}}async function TO(t,e,r={}){let n=r.fs||Sn,s=$m(e,r);await zs.fromCallback(n.writeFile)(t,s,r);}var PO=zs.fromPromise(TO);function IO(t,e,r={}){let n=r.fs||Sn,s=$m(e,r);return n.writeFileSync(t,s,r)}var $O={readFile:RO,readFileSync:OO,writeFile:PO,writeFileSync:IO};km.exports=$O;});var Bm=_((QN,qm)=>{var Gs=Lm();qm.exports={readJson:Gs.readFile,readJsonSync:Gs.readFileSync,writeJson:Gs.writeFile,writeJsonSync:Gs.writeFileSync};});var Vs=_((ZN,Mm)=>{var FO=Ze().fromCallback,gi=et(),Dm=G("path"),Nm=Rt(),kO=gr().pathExists;function LO(t,e,r,n){typeof r=="function"&&(n=r,r="utf8");let s=Dm.dirname(t);kO(s,(i,o)=>{if(i)return n(i);if(o)return gi.writeFile(t,e,r,n);Nm.mkdirs(s,u=>{if(u)return n(u);gi.writeFile(t,e,r,n);});});}function qO(t,...e){let r=Dm.dirname(t);if(gi.existsSync(r))return gi.writeFileSync(t,...e);Nm.mkdirsSync(r),gi.writeFileSync(t,...e);}Mm.exports={outputFile:FO(LO),outputFileSync:qO};});var jm=_((e2,Um)=>{var{stringify:BO}=Ws(),{outputFile:DO}=Vs();async function NO(t,e,r={}){let n=BO(e,r);await DO(t,n,r);}Um.exports=NO;});var Wm=_((t2,Hm)=>{var{stringify:MO}=Ws(),{outputFileSync:UO}=Vs();function jO(t,e,r){let n=MO(e,r);UO(t,n,r);}Hm.exports=jO;});var Gm=_((r2,zm)=>{var HO=Ze().fromPromise,Xe=Bm();Xe.outputJson=HO(jm());Xe.outputJsonSync=Wm();Xe.outputJSON=Xe.outputJson;Xe.outputJSONSync=Xe.outputJsonSync;Xe.writeJSON=Xe.writeJson;Xe.writeJSONSync=Xe.writeJsonSync;Xe.readJSON=Xe.readJson;Xe.readJSONSync=Xe.readJsonSync;zm.exports=Xe;});var Xm=_((n2,Jm)=>{var WO=et(),qu=G("path"),zO=Hs().copy,Ym=di().remove,GO=Rt().mkdirp,VO=gr().pathExists,Vm=Dr();function KO(t,e,r,n){typeof r=="function"&&(n=r,r={}),r=r||{};let s=r.overwrite||r.clobber||!1;Vm.checkPaths(t,e,"move",r,(i,o)=>{if(i)return n(i);let{srcStat:u,isChangingCase:c=!1}=o;Vm.checkParentPaths(t,u,e,"move",p=>{if(p)return n(p);if(YO(e))return Km(t,e,s,c,n);GO(qu.dirname(e),l=>l?n(l):Km(t,e,s,c,n));});});}function YO(t){let e=qu.dirname(t);return qu.parse(e).root===e}function Km(t,e,r,n,s){if(n)return Lu(t,e,r,s);if(r)return Ym(e,i=>i?s(i):Lu(t,e,r,s));VO(e,(i,o)=>i?s(i):o?s(new Error("dest already exists.")):Lu(t,e,r,s));}function Lu(t,e,r,n){WO.rename(t,e,s=>s?s.code!=="EXDEV"?n(s):JO(t,e,r,n):n());}function JO(t,e,r,n){zO(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0},i=>i?n(i):Ym(t,n));}Jm.exports=KO;});var rw=_((i2,tw)=>{var Zm=et(),Du=G("path"),XO=Hs().copySync,ew=di().removeSync,QO=Rt().mkdirpSync,Qm=Dr();function ZO(t,e,r){r=r||{};let n=r.overwrite||r.clobber||!1,{srcStat:s,isChangingCase:i=!1}=Qm.checkPathsSync(t,e,"move",r);return Qm.checkParentPathsSync(t,s,e,"move"),eT(e)||QO(Du.dirname(e)),tT(t,e,n,i)}function eT(t){let e=Du.dirname(t);return Du.parse(e).root===e}function tT(t,e,r,n){if(n)return Bu(t,e,r);if(r)return ew(e),Bu(t,e,r);if(Zm.existsSync(e))throw new Error("dest already exists.");return Bu(t,e,r)}function Bu(t,e,r){try{Zm.renameSync(t,e);}catch(n){if(n.code!=="EXDEV")throw n;return rT(t,e,r)}}function rT(t,e,r){return XO(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),ew(t)}tw.exports=ZO;});var iw=_((s2,nw)=>{var nT=Ze().fromCallback;nw.exports={move:nT(Xm()),moveSync:rw()};});var Nu=_((o2,sw)=>{sw.exports={...Br(),...Hs(),...em(),...Pm(),...Gm(),...Rt(),...iw(),...Vs(),...gr(),...di()};});var Uu=_((l2,uw)=>{var mi=t=>t&&typeof t.message=="string",Mu=t=>{if(!t)return;let e=t.cause;if(typeof e=="function"){let r=t.cause();return mi(r)?r:void 0}else return mi(e)?e:void 0},ow=(t,e)=>{if(!mi(t))return "";let r=t.stack||"";if(e.has(t))return r+`
causes have become circular...`;let n=Mu(t);return n?(e.add(t),r+`
caused by: `+ow(n,e)):r},iT=t=>ow(t,new Set),aw=(t,e,r)=>{if(!mi(t))return "";let n=r?"":t.message||"";if(e.has(t))return n+": ...";let s=Mu(t);if(s){e.add(t);let i=typeof t.cause=="function";return n+(i?"":": ")+aw(s,e,i)}else return n},sT=t=>aw(t,new Set);uw.exports={isErrorLike:mi,getErrorCause:Mu,stackWithCauses:iT,messageWithCauses:sT};});var ju=_((c2,cw)=>{var oT=Symbol("circular-ref-tag"),Ys=Symbol("pino-raw-err-ref"),lw=Object.create({},{type:{enumerable:!0,writable:!0,value:void 0},message:{enumerable:!0,writable:!0,value:void 0},stack:{enumerable:!0,writable:!0,value:void 0},aggregateErrors:{enumerable:!0,writable:!0,value:void 0},raw:{enumerable:!1,get:function(){return this[Ys]},set:function(t){this[Ys]=t;}}});Object.defineProperty(lw,Ys,{writable:!0,value:{}});cw.exports={pinoErrProto:lw,pinoErrorSymbols:{seen:oT,rawSymbol:Ys}};});var pw=_((f2,hw)=>{hw.exports=Wu;var{messageWithCauses:aT,stackWithCauses:uT,isErrorLike:fw}=Uu(),{pinoErrProto:lT,pinoErrorSymbols:cT}=ju(),{seen:Hu}=cT,{toString:fT}=Object.prototype;function Wu(t){if(!fw(t))return t;t[Hu]=void 0;let e=Object.create(lT);e.type=fT.call(t.constructor)==="[object Function]"?t.constructor.name:t.name,e.message=aT(t),e.stack=uT(t),Array.isArray(t.errors)&&(e.aggregateErrors=t.errors.map(r=>Wu(r)));for(let r in t)if(e[r]===void 0){let n=t[r];fw(n)?r!=="cause"&&!Object.prototype.hasOwnProperty.call(n,Hu)&&(e[r]=Wu(n)):e[r]=n;}return delete t[Hu],e.raw=t,e}});var yw=_((h2,dw)=>{dw.exports=Xs;var{isErrorLike:zu}=Uu(),{pinoErrProto:hT,pinoErrorSymbols:pT}=ju(),{seen:Js}=pT,{toString:dT}=Object.prototype;function Xs(t){if(!zu(t))return t;t[Js]=void 0;let e=Object.create(hT);e.type=dT.call(t.constructor)==="[object Function]"?t.constructor.name:t.name,e.message=t.message,e.stack=t.stack,Array.isArray(t.errors)&&(e.aggregateErrors=t.errors.map(r=>Xs(r))),zu(t.cause)&&!Object.prototype.hasOwnProperty.call(t.cause,Js)&&(e.cause=Xs(t.cause));for(let r in t)if(e[r]===void 0){let n=t[r];zu(n)?Object.prototype.hasOwnProperty.call(n,Js)||(e[r]=Xs(n)):e[r]=n;}return delete t[Js],e.raw=t,e}});var vw=_((p2,ww)=>{ww.exports={mapHttpRequest:yT,reqSerializer:mw};var Gu=Symbol("pino-raw-req-ref"),gw=Object.create({},{id:{enumerable:!0,writable:!0,value:""},method:{enumerable:!0,writable:!0,value:""},url:{enumerable:!0,writable:!0,value:""},query:{enumerable:!0,writable:!0,value:""},params:{enumerable:!0,writable:!0,value:""},headers:{enumerable:!0,writable:!0,value:{}},remoteAddress:{enumerable:!0,writable:!0,value:""},remotePort:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[Gu]},set:function(t){this[Gu]=t;}}});Object.defineProperty(gw,Gu,{writable:!0,value:{}});function mw(t){let e=t.info||t.socket,r=Object.create(gw);if(r.id=typeof t.id=="function"?t.id():t.id||(t.info?t.info.id:void 0),r.method=t.method,t.originalUrl)r.url=t.originalUrl;else {let n=t.path;r.url=typeof n=="string"?n:t.url?t.url.path||t.url:void 0;}return t.query&&(r.query=t.query),t.params&&(r.params=t.params),r.headers=t.headers,r.remoteAddress=e&&e.remoteAddress,r.remotePort=e&&e.remotePort,r.raw=t.raw||t,r}function yT(t){return {req:mw(t)}}});var xw=_((d2,Ew)=>{Ew.exports={mapHttpResponse:gT,resSerializer:bw};var Vu=Symbol("pino-raw-res-ref"),Sw=Object.create({},{statusCode:{enumerable:!0,writable:!0,value:0},headers:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[Vu]},set:function(t){this[Vu]=t;}}});Object.defineProperty(Sw,Vu,{writable:!0,value:{}});function bw(t){let e=Object.create(Sw);return e.statusCode=t.headersSent?t.statusCode:null,e.headers=t.getHeaders?t.getHeaders():t._headers,e.raw=t,e}function gT(t){return {res:bw(t)}}});var Yu=_((y2,Aw)=>{var Ku=pw(),mT=yw(),Qs=vw(),Zs=xw();Aw.exports={err:Ku,errWithCause:mT,mapHttpRequest:Qs.mapHttpRequest,mapHttpResponse:Zs.mapHttpResponse,req:Qs.reqSerializer,res:Zs.resSerializer,wrapErrorSerializer:function(e){return e===Ku?e:function(n){return e(Ku(n))}},wrapRequestSerializer:function(e){return e===Qs.reqSerializer?e:function(n){return e(Qs.reqSerializer(n))}},wrapResponseSerializer:function(e){return e===Zs.resSerializer?e:function(n){return e(Zs.resSerializer(n))}}};});var Ju=_((g2,_w)=>{function wT(t,e){return e}_w.exports=function(){let e=Error.prepareStackTrace;Error.prepareStackTrace=wT;let r=new Error().stack;if(Error.prepareStackTrace=e,!Array.isArray(r))return;let n=r.slice(2),s=[];for(let i of n)i&&s.push(i.getFileName());return s};});var Rw=_((m2,Cw)=>{Cw.exports=vT;function vT(t={}){let{ERR_PATHS_MUST_BE_STRINGS:e=()=>"fast-redact - Paths must be (non-empty) strings",ERR_INVALID_PATH:r=n=>`fast-redact \u2013 Invalid path (${n})`}=t;return function({paths:s}){s.forEach(i=>{if(typeof i!="string")throw Error(e());try{if(//.test(i))throw Error();let o=(i[0]==="["?"":".")+i.replace(/^\*/,"\u3007").replace(/\.\*/g,".\u3007").replace(/\[\*\]/g,"[\u3007]");if(/\n|\r|;/.test(o)||/\/\*/.test(o))throw Error();Function(`
'use strict'
const o = new Proxy({}, { get: () => o, set: () => { throw Error() } });
const \u3007 = null;
o${o}
if ([o${o}].length !== 1) throw Error()`)();}catch{throw Error(r(i))}});}}});var eo=_((w2,Ow)=>{Ow.exports=/[^.[\]]+|\[((?:.)*?)\]/g;});var Pw=_((v2,Tw)=>{var ST=eo();Tw.exports=bT;function bT({paths:t}){let e=[];var r=0;let n=t.reduce(function(s,i,o){var u=i.match(ST).map(l=>l.replace(/'|"|`/g,""));let c=i[0]==="[";u=u.map(l=>l[0]==="["?l.substr(1,l.length-2):l);let p=u.indexOf("*");if(p>-1){let l=u.slice(0,p),d=l.join("."),g=u.slice(p+1,u.length),m=g.length>0;r++,e.push({before:l,beforeStr:d,after:g,nested:m});}else s[i]={path:u,val:void 0,precensored:!1,circle:"",escPath:JSON.stringify(i),leadingBracket:c};return s},{});return {wildcards:e,wcLen:r,secret:n}}});var $w=_((S2,Iw)=>{var ET=eo();Iw.exports=xT;function xT({secret:t,serialize:e,wcLen:r,strict:n,isCensorFct:s,censorFctTakesPath:i},o){let u=Function("o",`
if (typeof o !== 'object' || o == null) {
${RT(n,e)}
}
const { censor, secret } = this
${AT(t,s,i)}
this.compileRestore()
${_T(r>0,s,i)}
${CT(e)}
`).bind(o);return e===!1&&(u.restore=c=>o.restore(c)),u}function AT(t,e,r){return Object.keys(t).map(n=>{let{escPath:s,leadingBracket:i,path:o}=t[n],u=i?1:0,c=i?"":".",p=[];for(var l;(l=ET.exec(n))!==null;){let[,w]=l,{index:E,input:A}=l;E>u&&p.push(A.substring(0,E-(w?0:1)));}var d=p.map(w=>`o${c}${w}`).join(" && ");d.length===0?d+=`o${c}${n} != null`:d+=` && o${c}${n} != null`;let g=`
switch (true) {
${p.reverse().map(w=>`
case o${c}${w} === censor:
secret[${s}].circle = ${JSON.stringify(w)}
break
`).join(`
`)}
}
`,m=r?`val, ${JSON.stringify(o)}`:"val";return `
if (${d}) {
const val = o${c}${n}
if (val === censor) {
secret[${s}].precensored = true
} else {
secret[${s}].val = val
o${c}${n} = ${e?`censor(${m})`:"censor"}
${g}
}
}
`}).join(`
`)}function _T(t,e,r){return t===!0?`
{
const { wildcards, wcLen, groupRedact, nestedRedact } = this
for (var i = 0; i < wcLen; i++) {
const { before, beforeStr, after, nested } = wildcards[i]
if (nested === true) {
secret[beforeStr] = secret[beforeStr] || []
nestedRedact(secret[beforeStr], o, before, after, censor, ${e}, ${r})
} else secret[beforeStr] = groupRedact(o, before, censor, ${e}, ${r})
}
}
`:""}function CT(t){return t===!1?"return o":`
var s = this.serialize(o)
this.restore(o)
return s
`}function RT(t,e){return t===!0?"throw Error('fast-redact: primitives cannot be redacted')":e===!1?"return o":"return this.serialize(o)"}});var Qu=_((b2,Lw)=>{Lw.exports={groupRedact:TT,groupRestore:OT,nestedRedact:IT,nestedRestore:PT};function OT({keys:t,values:e,target:r}){if(r==null)return;let n=t.length;for(var s=0;s<n;s++){let i=t[s];r[i]=e[s];}}function TT(t,e,r,n,s){let i=Fw(t,e);if(i==null)return {keys:null,values:null,target:null,flat:!0};let o=Object.keys(i),u=o.length,c=e.length,p=s?[...e]:void 0,l=new Array(u);for(var d=0;d<u;d++){let g=o[d];l[d]=i[g],s?(p[c]=g,i[g]=r(i[g],p)):n?i[g]=r(i[g]):i[g]=r;}return {keys:o,values:l,target:i,flat:!0}}function PT(t){for(let e=0;e<t.length;e++){let{target:r,path:n,value:s}=t[e],i=r;for(let o=n.length-1;o>0;o--)i=i[n[o]];i[n[0]]=s;}}function IT(t,e,r,n,s,i,o){let u=Fw(e,r);if(u==null)return;let c=Object.keys(u),p=c.length;for(var l=0;l<p;l++){let d=c[l];$T(t,u,d,r,n,s,i,o);}return t}function Xu(t,e){return t!=null?"hasOwn"in Object?Object.hasOwn(t,e):Object.prototype.hasOwnProperty.call(t,e):!1}function $T(t,e,r,n,s,i,o,u){let c=s.length,p=c-1,l=r;var d=-1,g,m,w,A=null,R,x,O=!1,F=0,q=0,W=FT();if(w=g=e[r],typeof g=="object"){for(;g!=null&&++d<c&&(q+=1,r=s[d],!(r!=="*"&&!A&&!(typeof g=="object"&&r in g)));)if(!(r==="*"&&(A==="*"&&(O=!0),A=r,d!==p))){if(A){let B=Object.keys(g);for(var H=0;H<B.length;H++){let k=B[H];if(x=g[k],R=r==="*",O)W=Xt(W,k,q),F=d,w=kw(x,F-1,r,n,s,i,o,u,l,g,m,w,R,k,d,p,W,t,e[l],q+1);else if(R||typeof x=="object"&&x!==null&&r in x){if(R?w=x:w=x[r],m=d!==p?w:o?u?i(w,[...n,l,...s]):i(w):i,R){let U=wi(Xt(W,k,q),w,e[l]);t.push(U),g[k]=m;}else if(x[r]!==m)if(m===void 0&&i!==void 0||Xu(x,r)&&m===w)W=Xt(W,k,q);else {W=Xt(W,k,q);let U=wi(Xt(W,r,q+1),w,e[l]);t.push(U),x[r]=m;}}}A=null;}else {if(w=g[r],W=Xt(W,r,q),m=d!==p?w:o?u?i(w,[...n,l,...s]):i(w):i,!(Xu(g,r)&&m===w||m===void 0&&i!==void 0)){let B=wi(W,w,e[l]);t.push(B),g[r]=m;}g=g[r];}if(typeof g!="object")break}}}function Fw(t,e){for(var r=-1,n=e.length,s=t;s!=null&&++r<n;)s=s[e[r]];return s}function kw(t,e,r,n,s,i,o,u,c,p,l,d,g,m,w,E,A,R,x,O){if(e===0&&(g||typeof t=="object"&&t!==null&&r in t)){if(g?d=t:d=t[r],l=w!==E?d:o?u?i(d,[...n,c,...s]):i(d):i,g){let F=wi(A,d,x);R.push(F),p[m]=l;}else if(t[r]!==l){if(!(l===void 0&&i!==void 0||Xu(t,r)&&l===d)){let F=wi(Xt(A,r,O+1),d,x);R.push(F),t[r]=l;}}}for(let F in t)typeof t[F]=="object"&&(A=Xt(A,F,O),kw(t[F],e-1,r,n,s,i,o,u,c,p,l,d,g,m,w,E,A,R,x,O+1));}function FT(){return {parent:null,key:null,children:[],depth:0}}function Xt(t,e,r){if(t.depth===r)return Xt(t.parent,e,r);var n={parent:t,key:e,depth:r,children:[]};return t.children.push(n),n}function wi(t,e,r){let n=t,s=[];do s.push(n.key),n=n.parent;while(n.parent!=null);return {path:s,value:e,target:r}}});var Bw=_((E2,qw)=>{var{groupRestore:kT,nestedRestore:LT}=Qu();qw.exports=qT;function qT({secret:t,wcLen:e}){return function(){if(this.restore)return;let n=Object.keys(t),s=BT(t,n),i=e>0,o=i?{secret:t,groupRestore:kT,nestedRestore:LT}:{secret:t};this.restore=Function("o",DT(s,n,i)).bind(o);}}function BT(t,e){return e.map(r=>{let{circle:n,escPath:s,leadingBracket:i}=t[r],u=n?`o.${n} = secret[${s}].val`:`o${i?"":"."}${r} = secret[${s}].val`,c=`secret[${s}].val = undefined`;return `
if (secret[${s}].val !== undefined) {
try { ${u} } catch (e) {}
${c}
}
`}).join("")}function DT(t,e,r){return `
const secret = this.secret
${r===!0?`
const keys = Object.keys(secret)
const len = keys.length
for (var i = len - 1; i >= ${e.length}; i--) {
const k = keys[i]
const o = secret[k]
if (o.flat === true) this.groupRestore(o)
else this.nestedRestore(o)
secret[k] = null
}
`:""}
${t}
return o
`}});var Nw=_((x2,Dw)=>{Dw.exports=NT;function NT(t){let{secret:e,censor:r,compileRestore:n,serialize:s,groupRedact:i,nestedRedact:o,wildcards:u,wcLen:c}=t,p=[{secret:e,censor:r,compileRestore:n}];return s!==!1&&p.push({serialize:s}),c>0&&p.push({groupRedact:i,nestedRedact:o,wildcards:u,wcLen:c}),Object.assign(...p)}});var jw=_((A2,Uw)=>{var Mw=Rw(),MT=Pw(),UT=$w(),jT=Bw(),{groupRedact:HT,nestedRedact:WT}=Qu(),zT=Nw(),GT=eo(),VT=Mw(),Zu=t=>t;Zu.restore=Zu;var KT="[REDACTED]";el.rx=GT;el.validator=Mw;Uw.exports=el;function el(t={}){let e=Array.from(new Set(t.paths||[])),r="serialize"in t&&(t.serialize===!1||typeof t.serialize=="function")?t.serialize:JSON.stringify,n=t.remove;if(n===!0&&r!==JSON.stringify)throw Error("fast-redact \u2013 remove option may only be set when serializer is JSON.stringify");let s=n===!0?void 0:"censor"in t?t.censor:KT,i=typeof s=="function",o=i&&s.length>1;if(e.length===0)return r||Zu;VT({paths:e,serialize:r,censor:s});let{wildcards:u,wcLen:c,secret:p}=MT({paths:e,censor:s}),l=jT({secret:p,wcLen:c}),d="strict"in t?t.strict:!0;return UT({secret:p,wcLen:c,serialize:r,strict:d,isCensorFct:i,censorFctTakesPath:o},zT({secret:p,censor:s,compileRestore:l,serialize:r,groupRedact:HT,nestedRedact:WT,wildcards:u,wcLen:c}))}});var bn=_((_2,Hw)=>{var YT=Symbol("pino.setLevel"),JT=Symbol("pino.getLevel"),XT=Symbol("pino.levelVal"),QT=Symbol("pino.useLevelLabels"),ZT=Symbol("pino.useOnlyCustomLevels"),eP=Symbol("pino.mixin"),tP=Symbol("pino.lsCache"),rP=Symbol("pino.chindings"),nP=Symbol("pino.asJson"),iP=Symbol("pino.write"),sP=Symbol("pino.redactFmt"),oP=Symbol("pino.time"),aP=Symbol("pino.timeSliceIndex"),uP=Symbol("pino.stream"),lP=Symbol("pino.stringify"),cP=Symbol("pino.stringifySafe"),fP=Symbol("pino.stringifiers"),hP=Symbol("pino.end"),pP=Symbol("pino.formatOpts"),dP=Symbol("pino.messageKey"),yP=Symbol("pino.errorKey"),gP=Symbol("pino.nestedKey"),mP=Symbol("pino.nestedKeyStr"),wP=Symbol("pino.mixinMergeStrategy"),vP=Symbol("pino.msgPrefix"),SP=Symbol("pino.wildcardFirst"),bP=Symbol.for("pino.serializers"),EP=Symbol.for("pino.formatters"),xP=Symbol.for("pino.hooks"),AP=Symbol.for("pino.metadata");Hw.exports={setLevelSym:YT,getLevelSym:JT,levelValSym:XT,useLevelLabelsSym:QT,mixinSym:eP,lsCacheSym:tP,chindingsSym:rP,asJsonSym:nP,writeSym:iP,serializersSym:bP,redactFmtSym:sP,timeSym:oP,timeSliceIndexSym:aP,streamSym:uP,stringifySym:lP,stringifySafeSym:cP,stringifiersSym:fP,endSym:hP,formatOptsSym:pP,messageKeySym:dP,errorKeySym:yP,nestedKeySym:gP,wildcardFirstSym:SP,needsMetadataGsym:AP,useOnlyCustomLevelsSym:ZT,formattersSym:EP,hooksSym:xP,nestedKeyStrSym:mP,mixinMergeStrategySym:wP,msgPrefixSym:vP};});var nl=_((C2,Vw)=>{var rl=jw(),{redactFmtSym:_P,wildcardFirstSym:to}=bn(),{rx:tl,validator:CP}=rl,Ww=CP({ERR_PATHS_MUST_BE_STRINGS:()=>"pino \u2013 redacted paths must be strings",ERR_INVALID_PATH:t=>`pino \u2013 redact paths array contains an invalid path (${t})`}),zw="[Redacted]",Gw=!1;function RP(t,e){let{paths:r,censor:n}=OP(t),s=r.reduce((u,c)=>{tl.lastIndex=0;let p=tl.exec(c),l=tl.exec(c),d=p[1]!==void 0?p[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/,"$1"):p[0];if(d==="*"&&(d=to),l===null)return u[d]=null,u;if(u[d]===null)return u;let{index:g}=l,m=`${c.substr(g,c.length-1)}`;return u[d]=u[d]||[],d!==to&&u[d].length===0&&u[d].push(...u[to]||[]),d===to&&Object.keys(u).forEach(function(w){u[w]&&u[w].push(m);}),u[d].push(m),u},{}),i={[_P]:rl({paths:r,censor:n,serialize:e,strict:Gw})},o=(...u)=>e(typeof n=="function"?n(...u):n);return [...Object.keys(s),...Object.getOwnPropertySymbols(s)].reduce((u,c)=>{if(s[c]===null)u[c]=p=>o(p,[c]);else {let p=typeof n=="function"?(l,d)=>n(l,[c,...d]):n;u[c]=rl({paths:s[c],censor:p,serialize:e,strict:Gw});}return u},i)}function OP(t){if(Array.isArray(t))return t={paths:t,censor:zw},Ww(t),t;let{paths:e,censor:r=zw,remove:n}=t;if(Array.isArray(e)===!1)throw Error("pino \u2013 redact must contain an array of strings");return n===!0&&(r=void 0),Ww({paths:e,censor:r}),{paths:e,censor:r}}Vw.exports=RP;});var Yw=_((R2,Kw)=>{var TP=()=>"",PP=()=>`,"time":${Date.now()}`,IP=()=>`,"time":${Math.round(Date.now()/1e3)}`,$P=()=>`,"time":"${new Date(Date.now()).toISOString()}"`;Kw.exports={nullTime:TP,epochTime:PP,unixTime:IP,isoTime:$P};});var Xw=_((O2,Jw)=>{function FP(t){try{return JSON.stringify(t)}catch{return '"[Circular]"'}}Jw.exports=kP;function kP(t,e,r){var n=r&&r.stringify||FP,s=1;if(typeof t=="object"&&t!==null){var i=e.length+s;if(i===1)return t;var o=new Array(i);o[0]=n(t);for(var u=1;u<i;u++)o[u]=n(e[u]);return o.join(" ")}if(typeof t!="string")return t;var c=e.length;if(c===0)return t;for(var p="",l=1-s,d=-1,g=t&&t.length||0,m=0;m<g;){if(t.charCodeAt(m)===37&&m+1<g){switch(d=d>-1?d:0,t.charCodeAt(m+1)){case 100:case 102:if(l>=c||e[l]==null)break;d<m&&(p+=t.slice(d,m)),p+=Number(e[l]),d=m+2,m++;break;case 105:if(l>=c||e[l]==null)break;d<m&&(p+=t.slice(d,m)),p+=Math.floor(Number(e[l])),d=m+2,m++;break;case 79:case 111:case 106:if(l>=c||e[l]===void 0)break;d<m&&(p+=t.slice(d,m));var w=typeof e[l];if(w==="string"){p+="'"+e[l]+"'",d=m+2,m++;break}if(w==="function"){p+=e[l].name||"<anonymous>",d=m+2,m++;break}p+=n(e[l]),d=m+2,m++;break;case 115:if(l>=c)break;d<m&&(p+=t.slice(d,m)),p+=String(e[l]),d=m+2,m++;break;case 37:d<m&&(p+=t.slice(d,m)),p+="%",d=m+2,m++,l--;break}++l;}++m;}return d===-1?t:(d<g&&(p+=t.slice(d)),p)}});var sl=_((T2,il)=>{if(typeof SharedArrayBuffer<"u"&&typeof Atomics<"u"){let e=function(r){if((r>0&&r<1/0)===!1)throw typeof r!="number"&&typeof r!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");Atomics.wait(t,0,0,Number(r));},t=new Int32Array(new SharedArrayBuffer(4));il.exports=e;}else {let t=function(e){if((e>0&&e<1/0)===!1)throw typeof e!="number"&&typeof e!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");};il.exports=t;}});var r0=_((P2,t0)=>{var rt=G("fs"),LP=G("events"),qP=G("util").inherits,Qw=G("path"),Zw=sl(),ol=100,BP=16*1024;function e0(t,e){e._opening=!0,e._writing=!0,e._asyncDrainScheduled=!1;function r(i,o){if(i){e._reopening=!1,e._writing=!1,e._opening=!1,e.sync?process.nextTick(()=>{e.listenerCount("error")>0&&e.emit("error",i);}):e.emit("error",i);return}e.fd=o,e.file=t,e._reopening=!1,e._opening=!1,e._writing=!1,e.sync?process.nextTick(()=>e.emit("ready")):e.emit("ready"),!e._reopening&&!e._writing&&e._len>e.minLength&&!e.destroyed&&En(e);}let n=e.append?"a":"w",s=e.mode;if(e.sync)try{e.mkdir&&rt.mkdirSync(Qw.dirname(t),{recursive:!0});let i=rt.openSync(t,n,s);r(null,i);}catch(i){throw r(i),i}else e.mkdir?rt.mkdir(Qw.dirname(t),{recursive:!0},i=>{if(i)return r(i);rt.open(t,n,s,r);}):rt.open(t,n,s,r);}function nt(t){if(!(this instanceof nt))return new nt(t);let{fd:e,dest:r,minLength:n,maxLength:s,maxWrite:i,sync:o,append:u=!0,mode:c,mkdir:p,retryEAGAIN:l,fsync:d}=t||{};if(e=e||r,this._bufs=[],this._len=0,this.fd=-1,this._writing=!1,this._writingBuf="",this._ending=!1,this._reopening=!1,this._asyncDrainScheduled=!1,this._hwm=Math.max(n||0,16387),this.file=null,this.destroyed=!1,this.minLength=n||0,this.maxLength=s||0,this.maxWrite=i||BP,this.sync=o||!1,this._fsync=d||!1,this.append=u||!1,this.mode=c,this.retryEAGAIN=l||(()=>!0),this.mkdir=p||!1,typeof e=="number")this.fd=e,process.nextTick(()=>this.emit("ready"));else if(typeof e=="string")e0(e,this);else throw new Error("SonicBoom supports only file descriptors and files");if(this.minLength>=this.maxWrite)throw new Error(`minLength should be smaller than maxWrite (${this.maxWrite})`);this.release=(g,m)=>{if(g){if((g.code==="EAGAIN"||g.code==="EBUSY")&&this.retryEAGAIN(g,this._writingBuf.length,this._len-this._writingBuf.length))if(this.sync)try{Zw(ol),this.release(void 0,0);}catch(E){this.release(E);}else setTimeout(()=>{rt.write(this.fd,this._writingBuf,"utf8",this.release);},ol);else this._writing=!1,this.emit("error",g);return}if(this.emit("write",m),this._len-=m,this._len<0&&(this._len=0),this._writingBuf=this._writingBuf.slice(m),this._writingBuf.length){if(!this.sync){rt.write(this.fd,this._writingBuf,"utf8",this.release);return}try{do{let E=rt.writeSync(this.fd,this._writingBuf,"utf8");this._len-=E,this._writingBuf=this._writingBuf.slice(E);}while(this._writingBuf)}catch(E){this.release(E);return}}this._fsync&&rt.fsyncSync(this.fd);let w=this._len;this._reopening?(this._writing=!1,this._reopening=!1,this.reopen()):w>this.minLength?En(this):this._ending?w>0?En(this):(this._writing=!1,ro(this)):(this._writing=!1,this.sync?this._asyncDrainScheduled||(this._asyncDrainScheduled=!0,process.nextTick(DP,this)):this.emit("drain"));},this.on("newListener",function(g){g==="drain"&&(this._asyncDrainScheduled=!1);});}function DP(t){t.listenerCount("drain")>0&&(t._asyncDrainScheduled=!1,t.emit("drain"));}qP(nt,LP);nt.prototype.write=function(t){if(this.destroyed)throw new Error("SonicBoom destroyed");let e=this._len+t.length,r=this._bufs;return this.maxLength&&e>this.maxLength?(this.emit("drop",t),this._len<this._hwm):(r.length===0||r[r.length-1].length+t.length>this.maxWrite?r.push(""+t):r[r.length-1]+=t,this._len=e,!this._writing&&this._len>=this.minLength&&En(this),this._len<this._hwm)};nt.prototype.flush=function(){if(this.destroyed)throw new Error("SonicBoom destroyed");this._writing||this.minLength<=0||(this._bufs.length===0&&this._bufs.push(""),En(this));};nt.prototype.reopen=function(t){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this._opening){this.once("ready",()=>{this.reopen(t);});return}if(this._ending)return;if(!this.file)throw new Error("Unable to reopen a file descriptor, you must pass a file to SonicBoom");if(this._reopening=!0,this._writing)return;let e=this.fd;this.once("ready",()=>{e!==this.fd&&rt.close(e,r=>{if(r)return this.emit("error",r)});}),e0(t||this.file,this);};nt.prototype.end=function(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this._opening){this.once("ready",()=>{this.end();});return}this._ending||(this._ending=!0,!this._writing&&(this._len>0&&this.fd>=0?En(this):ro(this)));};nt.prototype.flushSync=function(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this.fd<0)throw new Error("sonic boom is not ready yet");!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift(this._writingBuf),this._writingBuf="");let t="";for(;this._bufs.length||t.length;){t.length<=0&&(t=this._bufs[0]);try{let e=rt.writeSync(this.fd,t,"utf8");t=t.slice(e),this._len=Math.max(this._len-e,0),t.length<=0&&this._bufs.shift();}catch(e){if((e.code==="EAGAIN"||e.code==="EBUSY")&&!this.retryEAGAIN(e,t.length,this._len-t.length))throw e;Zw(ol);}}};nt.prototype.destroy=function(){this.destroyed||ro(this);};function En(t){let e=t.release;if(t._writing=!0,t._writingBuf=t._writingBuf||t._bufs.shift()||"",t.sync)try{let r=rt.writeSync(t.fd,t._writingBuf,"utf8");e(null,r);}catch(r){e(r);}else rt.write(t.fd,t._writingBuf,"utf8",e);}function ro(t){if(t.fd===-1){t.once("ready",ro.bind(null,t));return}t.destroyed=!0,t._bufs=[],t.fd!==1&&t.fd!==2?rt.close(t.fd,e):setImmediate(e);function e(r){if(r){t.emit("error",r);return}t._ending&&!t._writing&&t.emit("finish"),t.emit("close");}}nt.SonicBoom=nt;nt.default=nt;t0.exports=nt;});var al=_((I2,u0)=>{var br={exit:[],beforeExit:[]},n0={exit:MP,beforeExit:UP},i0=new FinalizationRegistry(jP);function NP(t){br[t].length>0||process.on(t,n0[t]);}function s0(t){br[t].length>0||process.removeListener(t,n0[t]);}function MP(){o0("exit");}function UP(){o0("beforeExit");}function o0(t){for(let e of br[t]){let r=e.deref(),n=e.fn;r!==void 0&&n(r,t);}}function jP(t){for(let e of ["exit","beforeExit"]){let r=br[e].indexOf(t);br[e].splice(r,r+1),s0(e);}}function a0(t,e,r){if(e===void 0)throw new Error("the object can't be undefined");NP(t);let n=new WeakRef(e);n.fn=r,i0.register(e,n),br[t].push(n);}function HP(t,e){a0("exit",t,e);}function WP(t,e){a0("beforeExit",t,e);}function zP(t){i0.unregister(t);for(let e of ["exit","beforeExit"])br[e]=br[e].filter(r=>{let n=r.deref();return n&&n!==t}),s0(e);}u0.exports={register:HP,registerBeforeExit:WP,unregister:zP};});var l0=_(($2,GP)=>{GP.exports={name:"thread-stream",version:"2.4.0",description:"A streaming way to send data to a Node.js Worker Thread",main:"index.js",types:"index.d.ts",dependencies:{"real-require":"^0.2.0"},devDependencies:{"@types/node":"^20.1.0","@types/tap":"^15.0.0",desm:"^1.3.0",fastbench:"^1.0.1",husky:"^8.0.1","pino-elasticsearch":"^6.0.0","sonic-boom":"^3.0.0",standard:"^17.0.0",tap:"^16.2.0","ts-node":"^10.8.0",typescript:"^4.7.2","why-is-node-running":"^2.2.2"},scripts:{test:"standard && npm run transpile && tap test/*.test.*js && tap --ts test/*.test.*ts","test:ci":"standard && npm run transpile && npm run test:ci:js && npm run test:ci:ts","test:ci:js":'tap --no-check-coverage --coverage-report=lcovonly "test/**/*.test.*js"',"test:ci:ts":'tap --ts --no-check-coverage --coverage-report=lcovonly "test/**/*.test.*ts"',"test:yarn":'npm run transpile && tap "test/**/*.test.js" --no-check-coverage',transpile:"sh ./test/ts/transpile.sh",prepare:"husky install"},standard:{ignore:["test/ts/**/*"]},repository:{type:"git",url:"git+https://github.com/mcollina/thread-stream.git"},keywords:["worker","thread","threads","stream"],author:"Matteo Collina <hello@matteocollina.com>",license:"MIT",bugs:{url:"https://github.com/mcollina/thread-stream/issues"},homepage:"https://github.com/mcollina/thread-stream#readme"};});var f0=_((F2,c0)=>{function VP(t,e,r,n,s){let i=Date.now()+n,o=Atomics.load(t,e);if(o===r){s(null,"ok");return}let u=o,c=p=>{Date.now()>i?s(null,"timed-out"):setTimeout(()=>{u=o,o=Atomics.load(t,e),o===u?c(p>=1e3?1e3:p*2):o===r?s(null,"ok"):s(null,"not-equal");},p);};c(1);}function KP(t,e,r,n,s){let i=Date.now()+n,o=Atomics.load(t,e);if(o!==r){s(null,"ok");return}let u=c=>{Date.now()>i?s(null,"timed-out"):setTimeout(()=>{o=Atomics.load(t,e),o!==r?s(null,"ok"):u(c>=1e3?1e3:c*2);},c);};u(1);}c0.exports={wait:VP,waitDiff:KP};});var p0=_((k2,h0)=>{h0.exports={WRITE_INDEX:4,READ_INDEX:8};});var w0=_((q2,m0)=>{var{version:YP}=l0(),{EventEmitter:JP}=G("events"),{Worker:XP}=G("worker_threads"),{join:QP}=G("path"),{pathToFileURL:ZP}=G("url"),{wait:eI}=f0(),{WRITE_INDEX:it,READ_INDEX:Nt}=p0(),tI=G("buffer"),rI=G("assert"),D=Symbol("kImpl"),nI=tI.constants.MAX_STRING_LENGTH,io=class{constructor(e){this._value=e;}deref(){return this._value}},iI=global.FinalizationRegistry||class{register(){}unregister(){}},sI=global.WeakRef||io,d0=new iI(t=>{t.exited||t.terminate();});function oI(t,e){let{filename:r,workerData:n}=e,i=("__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{})["thread-stream-worker"]||QP(__dirname,"lib","worker.js"),o=new XP(i,{...e.workerOpts,trackUnmanagedFds:!1,workerData:{filename:r.indexOf("file://")===0?r:ZP(r).href,dataBuf:t[D].dataBuf,stateBuf:t[D].stateBuf,workerData:{$context:{threadStreamVersion:YP},...n}}});return o.stream=new io(t),o.on("message",aI),o.on("exit",g0),d0.register(t,o),o}function y0(t){rI(!t[D].sync),t[D].needDrain&&(t[D].needDrain=!1,t.emit("drain"));}function no(t){let e=Atomics.load(t[D].state,it),r=t[D].data.length-e;if(r>0){if(t[D].buf.length===0){t[D].flushing=!1,t[D].ending?hl(t):t[D].needDrain&&process.nextTick(y0,t);return}let n=t[D].buf.slice(0,r),s=Buffer.byteLength(n);s<=r?(t[D].buf=t[D].buf.slice(r),so(t,n,no.bind(null,t))):t.flush(()=>{if(!t.destroyed){for(Atomics.store(t[D].state,Nt,0),Atomics.store(t[D].state,it,0);s>t[D].data.length;)r=r/2,n=t[D].buf.slice(0,r),s=Buffer.byteLength(n);t[D].buf=t[D].buf.slice(r),so(t,n,no.bind(null,t));}});}else if(r===0){if(e===0&&t[D].buf.length===0)return;t.flush(()=>{Atomics.store(t[D].state,Nt,0),Atomics.store(t[D].state,it,0),no(t);});}else Mt(t,new Error("overwritten"));}function aI(t){let e=this.stream.deref();if(e===void 0){this.exited=!0,this.terminate();return}switch(t.code){case"READY":this.stream=new sI(e),e.flush(()=>{e[D].ready=!0,e.emit("ready");});break;case"ERROR":Mt(e,t.err);break;case"EVENT":Array.isArray(t.args)?e.emit(t.name,...t.args):e.emit(t.name,t.args);break;case"WARNING":process.emitWarning(t.err);break;default:Mt(e,new Error("this should not happen: "+t.code));}}function g0(t){let e=this.stream.deref();e!==void 0&&(d0.unregister(e),e.worker.exited=!0,e.worker.off("exit",g0),Mt(e,t!==0?new Error("the worker thread exited"):null));}var ll=class extends JP{constructor(e={}){if(super(),e.bufferSize<4)throw new Error("bufferSize must at least fit a 4-byte utf-8 char");this[D]={},this[D].stateBuf=new SharedArrayBuffer(128),this[D].state=new Int32Array(this[D].stateBuf),this[D].dataBuf=new SharedArrayBuffer(e.bufferSize||4*1024*1024),this[D].data=Buffer.from(this[D].dataBuf),this[D].sync=e.sync||!1,this[D].ending=!1,this[D].ended=!1,this[D].needDrain=!1,this[D].destroyed=!1,this[D].flushing=!1,this[D].ready=!1,this[D].finished=!1,this[D].errored=null,this[D].closed=!1,this[D].buf="",this.worker=oI(this,e);}write(e){if(this[D].destroyed)return cl(this,new Error("the worker has exited")),!1;if(this[D].ending)return cl(this,new Error("the worker is ending")),!1;if(this[D].flushing&&this[D].buf.length+e.length>=nI)try{ul(this),this[D].flushing=!0;}catch(r){return Mt(this,r),!1}if(this[D].buf+=e,this[D].sync)try{return ul(this),!0}catch(r){return Mt(this,r),!1}return this[D].flushing||(this[D].flushing=!0,setImmediate(no,this)),this[D].needDrain=this[D].data.length-this[D].buf.length-Atomics.load(this[D].state,it)<=0,!this[D].needDrain}end(){this[D].destroyed||(this[D].ending=!0,hl(this));}flush(e){if(this[D].destroyed){typeof e=="function"&&process.nextTick(e,new Error("the worker has exited"));return}let r=Atomics.load(this[D].state,it);eI(this[D].state,Nt,r,1/0,(n,s)=>{if(n){Mt(this,n),process.nextTick(e,n);return}if(s==="not-equal"){this.flush(e);return}process.nextTick(e);});}flushSync(){this[D].destroyed||(ul(this),fl(this));}unref(){this.worker.unref();}ref(){this.worker.ref();}get ready(){return this[D].ready}get destroyed(){return this[D].destroyed}get closed(){return this[D].closed}get writable(){return !this[D].destroyed&&!this[D].ending}get writableEnded(){return this[D].ending}get writableFinished(){return this[D].finished}get writableNeedDrain(){return this[D].needDrain}get writableObjectMode(){return !1}get writableErrored(){return this[D].errored}};function cl(t,e){setImmediate(()=>{t.emit("error",e);});}function Mt(t,e){t[D].destroyed||(t[D].destroyed=!0,e&&(t[D].errored=e,cl(t,e)),t.worker.exited?setImmediate(()=>{t[D].closed=!0,t.emit("close");}):t.worker.terminate().catch(()=>{}).then(()=>{t[D].closed=!0,t.emit("close");}));}function so(t,e,r){let n=Atomics.load(t[D].state,it),s=Buffer.byteLength(e);return t[D].data.write(e,n),Atomics.store(t[D].state,it,n+s),Atomics.notify(t[D].state,it),r(),!0}function hl(t){if(!(t[D].ended||!t[D].ending||t[D].flushing)){t[D].ended=!0;try{t.flushSync();let e=Atomics.load(t[D].state,Nt);Atomics.store(t[D].state,it,-1),Atomics.notify(t[D].state,it);let r=0;for(;e!==-1;){if(Atomics.wait(t[D].state,Nt,e,1e3),e=Atomics.load(t[D].state,Nt),e===-2){Mt(t,new Error("end() failed"));return}if(++r===10){Mt(t,new Error("end() took too long (10s)"));return}}process.nextTick(()=>{t[D].finished=!0,t.emit("finish");});}catch(e){Mt(t,e);}}}function ul(t){let e=()=>{t[D].ending?hl(t):t[D].needDrain&&process.nextTick(y0,t);};for(t[D].flushing=!1;t[D].buf.length!==0;){let r=Atomics.load(t[D].state,it),n=t[D].data.length-r;if(n===0){fl(t),Atomics.store(t[D].state,Nt,0),Atomics.store(t[D].state,it,0);continue}else if(n<0)throw new Error("overwritten");let s=t[D].buf.slice(0,n),i=Buffer.byteLength(s);if(i<=n)t[D].buf=t[D].buf.slice(n),so(t,s,e);else {for(fl(t),Atomics.store(t[D].state,Nt,0),Atomics.store(t[D].state,it,0);i>t[D].buf.length;)n=n/2,s=t[D].buf.slice(0,n),i=Buffer.byteLength(s);t[D].buf=t[D].buf.slice(n),so(t,s,e);}}}function fl(t){if(t[D].flushing)throw new Error("unable to flush while flushing");let e=Atomics.load(t[D].state,it),r=0;for(;;){let n=Atomics.load(t[D].state,Nt);if(n===-2)throw Error("_flushSync failed");if(n!==e)Atomics.wait(t[D].state,Nt,n,1e3);else break;if(++r===10)throw new Error("_flushSync took too long (10s)")}}m0.exports=ll;});var yl=_((B2,v0)=>{var{createRequire:uI}=G("module"),lI=Ju(),{join:pl,isAbsolute:cI,sep:fI}=G("path"),hI=sl(),dl=al(),pI=w0();function dI(t){dl.register(t,gI),dl.registerBeforeExit(t,mI),t.on("close",function(){dl.unregister(t);});}function yI(t,e,r){let n=new pI({filename:t,workerData:e,workerOpts:r});n.on("ready",s),n.on("close",function(){process.removeListener("exit",i);}),process.on("exit",i);function s(){process.removeListener("exit",i),n.unref(),r.autoEnd!==!1&&dI(n);}function i(){n.closed||(n.flushSync(),hI(100),n.end());}return n}function gI(t){t.ref(),t.flushSync(),t.end(),t.once("close",function(){t.unref();});}function mI(t){t.flushSync();}function wI(t){let{pipeline:e,targets:r,levels:n,dedupe:s,options:i={},worker:o={},caller:u=lI()}=t,c=typeof u=="string"?[u]:u,p="__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{},l=t.target;if(l&&r)throw new Error("only one of target or targets can be specified");return r?(l=p["pino-worker"]||pl(__dirname,"worker.js"),i.targets=r.map(g=>({...g,target:d(g.target)}))):e&&(l=p["pino-pipeline-worker"]||pl(__dirname,"worker-pipeline.js"),i.targets=e.map(g=>({...g,target:d(g.target)}))),n&&(i.levels=n),s&&(i.dedupe=s),yI(d(l),i,o);function d(g){if(g=p[g]||g,cI(g)||g.indexOf("file://")===0)return g;if(g==="pino/file")return pl(__dirname,"..","file.js");let m;for(let w of c)try{let E=w==="node:repl"?process.cwd()+fI:w;m=uI(E).resolve(g);break}catch{continue}if(!m)throw new Error(`unable to determine transport target for "${g}"`);return m}}v0.exports=wI;});var uo=_((D2,P0)=>{var S0=Xw(),{mapHttpRequest:vI,mapHttpResponse:SI}=Yu(),ml=r0(),b0=al(),{lsCacheSym:bI,chindingsSym:A0,writeSym:E0,serializersSym:_0,formatOptsSym:x0,endSym:EI,stringifiersSym:C0,stringifySym:R0,stringifySafeSym:wl,wildcardFirstSym:O0,nestedKeySym:xI,formattersSym:T0,messageKeySym:AI,errorKeySym:_I,nestedKeyStrSym:CI,msgPrefixSym:oo}=bn(),{isMainThread:RI}=G("worker_threads"),OI=yl();function xn(){}function TI(t,e){if(!e)return r;return function(...s){e.call(this,s,r,t);};function r(n,...s){if(typeof n=="object"){let i=n;n!==null&&(n.method&&n.headers&&n.socket?n=vI(n):typeof n.setHeader=="function"&&(n=SI(n)));let o;i===null&&s.length===0?o=[null]:(i=s.shift(),o=s),typeof this[oo]=="string"&&i!==void 0&&i!==null&&(i=this[oo]+i),this[E0](n,S0(i,o,this[x0]),t);}else {let i=n===void 0?s.shift():n;typeof this[oo]=="string"&&i!==void 0&&i!==null&&(i=this[oo]+i),this[E0](null,S0(i,s,this[x0]),t);}}}function gl(t){let e="",r=0,n=!1,s=255,i=t.length;if(i>100)return JSON.stringify(t);for(var o=0;o<i&&s>=32;o++)s=t.charCodeAt(o),(s===34||s===92)&&(e+=t.slice(r,o)+"\\",r=o,n=!0);return n?e+=t.slice(r):e=t,s<32?JSON.stringify(t):'"'+e+'"'}function PI(t,e,r,n){let s=this[R0],i=this[wl],o=this[C0],u=this[EI],c=this[A0],p=this[_0],l=this[T0],d=this[AI],g=this[_I],m=this[bI][r]+n;m=m+c;let w;l.log&&(t=l.log(t));let E=o[O0],A="";for(let x in t)if(w=t[x],Object.prototype.hasOwnProperty.call(t,x)&&w!==void 0){p[x]?w=p[x](w):x===g&&p.err&&(w=p.err(w));let O=o[x]||E;switch(typeof w){case"undefined":case"function":continue;case"number":Number.isFinite(w)===!1&&(w=null);case"boolean":O&&(w=O(w));break;case"string":w=(O||gl)(w);break;default:w=(O||s)(w,i);}if(w===void 0)continue;let F=gl(x);A+=","+F+":"+w;}let R="";if(e!==void 0){w=p[d]?p[d](e):e;let x=o[d]||E;switch(typeof w){case"function":break;case"number":Number.isFinite(w)===!1&&(w=null);case"boolean":x&&(w=x(w)),R=',"'+d+'":'+w;break;case"string":w=(x||gl)(w),R=',"'+d+'":'+w;break;default:w=(x||s)(w,i),R=',"'+d+'":'+w;}}return this[xI]&&A?m+this[CI]+A.slice(1)+"}"+R+u:m+A+R+u}function II(t,e){let r,n=t[A0],s=t[R0],i=t[wl],o=t[C0],u=o[O0],c=t[_0],p=t[T0].bindings;e=p(e);for(let l in e)if(r=e[l],(l!=="level"&&l!=="serializers"&&l!=="formatters"&&l!=="customLevels"&&e.hasOwnProperty(l)&&r!==void 0)===!0){if(r=c[l]?c[l](r):r,r=(o[l]||u||s)(r,i),r===void 0)continue;n+=',"'+l+'":'+r;}return n}function $I(t){return t.write!==t.constructor.prototype.write}function ao(t){let e=new ml(t);return e.on("error",r),!t.sync&&RI&&(b0.register(e,FI),e.on("close",function(){b0.unregister(e);})),e;function r(n){if(n.code==="EPIPE"){e.write=xn,e.end=xn,e.flushSync=xn,e.destroy=xn;return}e.removeListener("error",r),e.emit("error",n);}}function FI(t,e){t.destroyed||(e==="beforeExit"?(t.flush(),t.on("drain",function(){t.end();})):t.flushSync());}function kI(t){return function(r,n,s={},i){if(typeof s=="string")i=ao({dest:s}),s={};else if(typeof i=="string"){if(s&&s.transport)throw Error("only one of option.transport or stream can be specified");i=ao({dest:i});}else if(s instanceof ml||s.writable||s._writableState)i=s,s={};else if(s.transport){if(s.transport instanceof ml||s.transport.writable||s.transport._writableState)throw Error("option.transport do not allow stream, please pass to option directly. e.g. pino(transport)");if(s.transport.targets&&s.transport.targets.length&&s.formatters&&typeof s.formatters.level=="function")throw Error("option.transport.targets do not allow custom level formatters");let c;s.customLevels&&(c=s.useOnlyCustomLevels?s.customLevels:Object.assign({},s.levels,s.customLevels)),i=OI({caller:n,...s.transport,levels:c});}if(s=Object.assign({},t,s),s.serializers=Object.assign({},t.serializers,s.serializers),s.formatters=Object.assign({},t.formatters,s.formatters),s.prettyPrint)throw new Error("prettyPrint option is no longer supported, see the pino-pretty package (https://github.com/pinojs/pino-pretty)");let{enabled:o,onChild:u}=s;return o===!1&&(s.level="silent"),u||(s.onChild=xn),i||($I(process.stdout)?i=process.stdout:i=ao({fd:process.stdout.fd||1})),{opts:s,stream:i}}}function LI(t,e){try{return JSON.stringify(t)}catch{try{return (e||this[wl])(t)}catch{return '"[unable to serialize, circular reference is too complex to analyze]"'}}}function qI(t,e,r){return {level:t,bindings:e,log:r}}function BI(t){let e=Number(t);return typeof t=="string"&&Number.isFinite(e)?e:t===void 0?1:t}P0.exports={noop:xn,buildSafeSonicBoom:ao,asChindings:II,asJson:PI,genLog:TI,createArgsNormalizer:kI,stringify:LI,buildFormatters:qI,normalizeDestFileDescriptor:BI};});var lo=_((N2,$0)=>{var{lsCacheSym:DI,levelValSym:vl,useOnlyCustomLevelsSym:NI,streamSym:MI,formattersSym:UI,hooksSym:jI}=bn(),{noop:HI,genLog:Nr}=uo(),Tt={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},I0={fatal:t=>{let e=Nr(Tt.fatal,t);return function(...r){let n=this[MI];if(e.call(this,...r),typeof n.flushSync=="function")try{n.flushSync();}catch{}}},error:t=>Nr(Tt.error,t),warn:t=>Nr(Tt.warn,t),info:t=>Nr(Tt.info,t),debug:t=>Nr(Tt.debug,t),trace:t=>Nr(Tt.trace,t)},Sl=Object.keys(Tt).reduce((t,e)=>(t[Tt[e]]=e,t),{}),WI=Object.keys(Sl).reduce((t,e)=>(t[e]='{"level":'+Number(e),t),{});function zI(t){let e=t[UI].level,{labels:r}=t.levels,n={};for(let s in r){let i=e(r[s],Number(s));n[s]=JSON.stringify(i).slice(0,-1);}return t[DI]=n,t}function GI(t,e){if(e)return !1;switch(t){case"fatal":case"error":case"warn":case"info":case"debug":case"trace":return !0;default:return !1}}function VI(t){let{labels:e,values:r}=this.levels;if(typeof t=="number"){if(e[t]===void 0)throw Error("unknown level value"+t);t=e[t];}if(r[t]===void 0)throw Error("unknown level "+t);let n=this[vl],s=this[vl]=r[t],i=this[NI],o=this[jI].logMethod;for(let u in r){if(s>r[u]){this[u]=HI;continue}this[u]=GI(u,i)?I0[u](o):Nr(r[u],o);}this.emit("level-change",t,s,e[n],n,this);}function KI(t){let{levels:e,levelVal:r}=this;return e&&e.labels?e.labels[r]:""}function YI(t){let{values:e}=this.levels,r=e[t];return r!==void 0&&r>=this[vl]}function JI(t=null,e=!1){let r=t?Object.keys(t).reduce((i,o)=>(i[t[o]]=o,i),{}):null,n=Object.assign(Object.create(Object.prototype,{Infinity:{value:"silent"}}),e?null:Sl,r),s=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),e?null:Tt,t);return {labels:n,values:s}}function XI(t,e,r){if(typeof t=="number"){if(![].concat(Object.keys(e||{}).map(i=>e[i]),r?[]:Object.keys(Sl).map(i=>+i),1/0).includes(t))throw Error(`default level:${t} must be included in custom levels`);return}let n=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),r?null:Tt,e);if(!(t in n))throw Error(`default level:${t} must be included in custom levels`)}function QI(t,e){let{labels:r,values:n}=t;for(let s in e){if(s in n)throw Error("levels cannot be overridden");if(e[s]in r)throw Error("pre-existing level values cannot be used for new levels")}}$0.exports={initialLsCache:WI,genLsCache:zI,levelMethods:I0,getLevel:KI,setLevel:VI,isLevelEnabled:YI,mappings:JI,levels:Tt,assertNoLevelCollisions:QI,assertDefaultLevelFound:XI};});var bl=_((M2,F0)=>{F0.exports={version:"8.15.1"};});var W0=_((j2,H0)=>{var{EventEmitter:ZI}=G("events"),{lsCacheSym:e$,levelValSym:t$,setLevelSym:xl,getLevelSym:k0,chindingsSym:Al,parsedChindingsSym:r$,mixinSym:n$,asJsonSym:N0,writeSym:i$,mixinMergeStrategySym:s$,timeSym:o$,timeSliceIndexSym:a$,streamSym:M0,serializersSym:Mr,formattersSym:El,errorKeySym:u$,messageKeySym:l$,useOnlyCustomLevelsSym:c$,needsMetadataGsym:f$,redactFmtSym:h$,stringifySym:p$,formatOptsSym:d$,stringifiersSym:y$,msgPrefixSym:L0}=bn(),{getLevel:g$,setLevel:m$,isLevelEnabled:w$,mappings:v$,initialLsCache:S$,genLsCache:b$,assertNoLevelCollisions:E$}=lo(),{asChindings:U0,asJson:x$,buildFormatters:q0,stringify:B0}=uo(),{version:A$}=bl(),_$=nl(),C$=class{},j0={constructor:C$,child:R$,bindings:O$,setBindings:T$,flush:F$,isLevelEnabled:w$,version:A$,get level(){return this[k0]()},set level(t){this[xl](t);},get levelVal(){return this[t$]},set levelVal(t){throw Error("levelVal is read-only")},[e$]:S$,[i$]:I$,[N0]:x$,[k0]:g$,[xl]:m$};Object.setPrototypeOf(j0,ZI.prototype);H0.exports=function(){return Object.create(j0)};var D0=t=>t;function R$(t,e){if(!t)throw Error("missing bindings for child Pino");e=e||{};let r=this[Mr],n=this[El],s=Object.create(this);if(e.hasOwnProperty("serializers")===!0){s[Mr]=Object.create(null);for(let l in r)s[Mr][l]=r[l];let c=Object.getOwnPropertySymbols(r);for(var i=0;i<c.length;i++){let l=c[i];s[Mr][l]=r[l];}for(let l in e.serializers)s[Mr][l]=e.serializers[l];let p=Object.getOwnPropertySymbols(e.serializers);for(var o=0;o<p.length;o++){let l=p[o];s[Mr][l]=e.serializers[l];}}else s[Mr]=r;if(e.hasOwnProperty("formatters")){let{level:c,bindings:p,log:l}=e.formatters;s[El]=q0(c||n.level,p||D0,l||n.log);}else s[El]=q0(n.level,D0,n.log);if(e.hasOwnProperty("customLevels")===!0&&(E$(this.levels,e.customLevels),s.levels=v$(e.customLevels,s[c$]),b$(s)),typeof e.redact=="object"&&e.redact!==null||Array.isArray(e.redact)){s.redact=e.redact;let c=_$(s.redact,B0),p={stringify:c[h$]};s[p$]=B0,s[y$]=c,s[d$]=p;}typeof e.msgPrefix=="string"&&(s[L0]=(this[L0]||"")+e.msgPrefix),s[Al]=U0(s,t);let u=e.level||this.level;return s[xl](u),this.onChild(s),s}function O$(){let e=`{${this[Al].substr(1)}}`,r=JSON.parse(e);return delete r.pid,delete r.hostname,r}function T$(t){let e=U0(this,t);this[Al]=e,delete this[r$];}function P$(t,e){return Object.assign(e,t)}function I$(t,e,r){let n=this[o$](),s=this[n$],i=this[u$],o=this[l$],u=this[s$]||P$,c;t==null?c={}:t instanceof Error?(c={[i]:t},e===void 0&&(e=t.message)):(c=t,e===void 0&&t[o]===void 0&&t[i]&&(e=t[i].message)),s&&(c=u(c,s(c,r,this)));let p=this[N0](c,e,r,n),l=this[M0];l[f$]===!0&&(l.lastLevel=r,l.lastObj=c,l.lastMsg=e,l.lastTime=n.slice(this[a$]),l.lastLogger=this),l.write(p);}function $$(){}function F$(){let t=this[M0];"flush"in t&&t.flush($$);}});var Y0=_((Ol,K0)=>{var{hasOwnProperty:co}=Object.prototype,jr=Rl();jr.configure=Rl;jr.stringify=jr;jr.default=jr;Ol.stringify=jr;Ol.configure=Rl;K0.exports=jr;var k$=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]|[\ud800-\udbff](?![\udc00-\udfff])|(?:[^\ud800-\udbff]|^)[\udc00-\udfff]/;function Er(t){return t.length<5e3&&!k$.test(t)?`"${t}"`:JSON.stringify(t)}function _l(t){if(t.length>200)return t.sort();for(let e=1;e<t.length;e++){let r=t[e],n=e;for(;n!==0&&t[n-1]>r;)t[n]=t[n-1],n--;t[n]=r;}return t}var L$=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function Cl(t){return L$.call(t)!==void 0&&t.length!==0}function z0(t,e,r){t.length<r&&(r=t.length);let n=e===","?"":" ",s=`"0":${n}${t[0]}`;for(let i=1;i<r;i++)s+=`${e}"${i}":${n}${t[i]}`;return s}function q$(t){if(co.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 G0(t,e){let r;if(co.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 V0(t,e){let r;if(co.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 Ur(t){return t===1?"1 item":`${t} items`}function B$(t){let e=new Set;for(let r of t)(typeof r=="string"||typeof r=="number")&&e.add(String(r));return e}function D$(t){if(co.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 n=`Object can not safely be stringified. Received type ${typeof r}`;throw typeof r!="function"&&(n+=` (${r.toString()})`),new Error(n)}}}function Rl(t){t={...t};let e=D$(t);e&&(t.bigint===void 0&&(t.bigint=!1),"circularValue"in t||(t.circularValue=Error));let r=q$(t),n=G0(t,"bigint"),s=G0(t,"deterministic"),i=V0(t,"maximumDepth"),o=V0(t,"maximumBreadth");function u(g,m,w,E,A,R){let x=m[g];switch(typeof x=="object"&&x!==null&&typeof x.toJSON=="function"&&(x=x.toJSON(g)),x=E.call(m,g,x),typeof x){case"string":return Er(x);case"object":{if(x===null)return "null";if(w.indexOf(x)!==-1)return r;let O="",F=",",q=R;if(Array.isArray(x)){if(x.length===0)return "[]";if(i<w.length+1)return '"[Array]"';w.push(x),A!==""&&(R+=A,O+=`
${R}`,F=`,
${R}`);let C=Math.min(x.length,o),Y=0;for(;Y<C-1;Y++){let oe=u(String(Y),x,w,E,A,R);O+=oe!==void 0?oe:"null",O+=F;}let J=u(String(Y),x,w,E,A,R);if(O+=J!==void 0?J:"null",x.length-1>o){let oe=x.length-o-1;O+=`${F}"... ${Ur(oe)} not stringified"`;}return A!==""&&(O+=`
${q}`),w.pop(),`[${O}]`}let W=Object.keys(x),H=W.length;if(H===0)return "{}";if(i<w.length+1)return '"[Object]"';let B="",k="";A!==""&&(R+=A,F=`,
${R}`,B=" ");let U=Math.min(H,o);s&&!Cl(x)&&(W=_l(W)),w.push(x);for(let C=0;C<U;C++){let Y=W[C],J=u(Y,x,w,E,A,R);J!==void 0&&(O+=`${k}${Er(Y)}:${B}${J}`,k=F);}if(H>o){let C=H-o;O+=`${k}"...":${B}"${Ur(C)} not stringified"`,k=F;}return A!==""&&k.length>1&&(O=`
${R}${O}
${q}`),w.pop(),`{${O}}`}case"number":return isFinite(x)?String(x):e?e(x):"null";case"boolean":return x===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(x);default:return e?e(x):void 0}}function c(g,m,w,E,A,R){switch(typeof m=="object"&&m!==null&&typeof m.toJSON=="function"&&(m=m.toJSON(g)),typeof m){case"string":return Er(m);case"object":{if(m===null)return "null";if(w.indexOf(m)!==-1)return r;let x=R,O="",F=",";if(Array.isArray(m)){if(m.length===0)return "[]";if(i<w.length+1)return '"[Array]"';w.push(m),A!==""&&(R+=A,O+=`
${R}`,F=`,
${R}`);let H=Math.min(m.length,o),B=0;for(;B<H-1;B++){let U=c(String(B),m[B],w,E,A,R);O+=U!==void 0?U:"null",O+=F;}let k=c(String(B),m[B],w,E,A,R);if(O+=k!==void 0?k:"null",m.length-1>o){let U=m.length-o-1;O+=`${F}"... ${Ur(U)} not stringified"`;}return A!==""&&(O+=`
${x}`),w.pop(),`[${O}]`}w.push(m);let q="";A!==""&&(R+=A,F=`,
${R}`,q=" ");let W="";for(let H of E){let B=c(H,m[H],w,E,A,R);B!==void 0&&(O+=`${W}${Er(H)}:${q}${B}`,W=F);}return A!==""&&W.length>1&&(O=`
${R}${O}
${x}`),w.pop(),`{${O}}`}case"number":return isFinite(m)?String(m):e?e(m):"null";case"boolean":return m===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(m);default:return e?e(m):void 0}}function p(g,m,w,E,A){switch(typeof m){case"string":return Er(m);case"object":{if(m===null)return "null";if(typeof m.toJSON=="function"){if(m=m.toJSON(g),typeof m!="object")return p(g,m,w,E,A);if(m===null)return "null"}if(w.indexOf(m)!==-1)return r;let R=A;if(Array.isArray(m)){if(m.length===0)return "[]";if(i<w.length+1)return '"[Array]"';w.push(m),A+=E;let B=`
${A}`,k=`,
${A}`,U=Math.min(m.length,o),C=0;for(;C<U-1;C++){let J=p(String(C),m[C],w,E,A);B+=J!==void 0?J:"null",B+=k;}let Y=p(String(C),m[C],w,E,A);if(B+=Y!==void 0?Y:"null",m.length-1>o){let J=m.length-o-1;B+=`${k}"... ${Ur(J)} not stringified"`;}return B+=`
${R}`,w.pop(),`[${B}]`}let x=Object.keys(m),O=x.length;if(O===0)return "{}";if(i<w.length+1)return '"[Object]"';A+=E;let F=`,
${A}`,q="",W="",H=Math.min(O,o);Cl(m)&&(q+=z0(m,F,o),x=x.slice(m.length),H-=m.length,W=F),s&&(x=_l(x)),w.push(m);for(let B=0;B<H;B++){let k=x[B],U=p(k,m[k],w,E,A);U!==void 0&&(q+=`${W}${Er(k)}: ${U}`,W=F);}if(O>o){let B=O-o;q+=`${W}"...": "${Ur(B)} not stringified"`,W=F;}return W!==""&&(q=`
${A}${q}
${R}`),w.pop(),`{${q}}`}case"number":return isFinite(m)?String(m):e?e(m):"null";case"boolean":return m===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(m);default:return e?e(m):void 0}}function l(g,m,w){switch(typeof m){case"string":return Er(m);case"object":{if(m===null)return "null";if(typeof m.toJSON=="function"){if(m=m.toJSON(g),typeof m!="object")return l(g,m,w);if(m===null)return "null"}if(w.indexOf(m)!==-1)return r;let E="";if(Array.isArray(m)){if(m.length===0)return "[]";if(i<w.length+1)return '"[Array]"';w.push(m);let F=Math.min(m.length,o),q=0;for(;q<F-1;q++){let H=l(String(q),m[q],w);E+=H!==void 0?H:"null",E+=",";}let W=l(String(q),m[q],w);if(E+=W!==void 0?W:"null",m.length-1>o){let H=m.length-o-1;E+=`,"... ${Ur(H)} not stringified"`;}return w.pop(),`[${E}]`}let A=Object.keys(m),R=A.length;if(R===0)return "{}";if(i<w.length+1)return '"[Object]"';let x="",O=Math.min(R,o);Cl(m)&&(E+=z0(m,",",o),A=A.slice(m.length),O-=m.length,x=","),s&&(A=_l(A)),w.push(m);for(let F=0;F<O;F++){let q=A[F],W=l(q,m[q],w);W!==void 0&&(E+=`${x}${Er(q)}:${W}`,x=",");}if(R>o){let F=R-o;E+=`${x}"...":"${Ur(F)} not stringified"`;}return w.pop(),`{${E}}`}case"number":return isFinite(m)?String(m):e?e(m):"null";case"boolean":return m===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(m);default:return e?e(m):void 0}}function d(g,m,w){if(arguments.length>1){let E="";if(typeof w=="number"?E=" ".repeat(Math.min(w,10)):typeof w=="string"&&(E=w.slice(0,10)),m!=null){if(typeof m=="function")return u("",{"":g},[],m,E,"");if(Array.isArray(m))return c("",g,[],B$(m),E,"")}if(E.length!==0)return p("",g,[],E,"")}return l("",g,[])}return d}});var Q0=_((H2,X0)=>{var Tl=Symbol.for("pino.metadata"),{levels:J0}=lo(),N$=J0.info;function M$(t,e){let r=0;t=t||[],e=e||{dedupe:!1};let n=Object.create(J0);n.silent=1/0,e.levels&&typeof e.levels=="object"&&Object.keys(e.levels).forEach(l=>{n[l]=e.levels[l];});let s={write:i,add:u,flushSync:o,end:c,minLevel:0,streams:[],clone:p,[Tl]:!0,streamLevels:n};return Array.isArray(t)?t.forEach(u,s):u.call(s,t),t=null,s;function i(l){let d,g=this.lastLevel,{streams:m}=this,w=0,E;for(let A=j$(m.length,e.dedupe);W$(A,m.length,e.dedupe);A=H$(A,e.dedupe))if(d=m[A],d.level<=g){if(w!==0&&w!==d.level)break;if(E=d.stream,E[Tl]){let{lastTime:R,lastMsg:x,lastObj:O,lastLogger:F}=this;E.lastLevel=g,E.lastTime=R,E.lastMsg=x,E.lastObj=O,E.lastLogger=F;}E.write(l),e.dedupe&&(w=d.level);}else if(!e.dedupe)break}function o(){for(let{stream:l}of this.streams)typeof l.flushSync=="function"&&l.flushSync();}function u(l){if(!l)return s;let d=typeof l.write=="function"||l.stream,g=l.write?l:l.stream;if(!d)throw Error("stream object needs to implement either StreamEntry or DestinationStream interface");let{streams:m,streamLevels:w}=this,E;typeof l.levelVal=="number"?E=l.levelVal:typeof l.level=="string"?E=w[l.level]:typeof l.level=="number"?E=l.level:E=N$;let A={stream:g,level:E,levelVal:void 0,id:r++};return m.unshift(A),m.sort(U$),this.minLevel=m[0].level,s}function c(){for(let{stream:l}of this.streams)typeof l.flushSync=="function"&&l.flushSync(),l.end();}function p(l){let d=new Array(this.streams.length);for(let g=0;g<d.length;g++)d[g]={level:l,stream:this.streams[g].stream};return {write:i,add:u,minLevel:l,streams:d,clone:p,flushSync:o,[Tl]:!0}}}function U$(t,e){return t.level-e.level}function j$(t,e){return e?t-1:0}function H$(t,e){return e?t-1:t+1}function W$(t,e,r){return r?t>=0:t<e}X0.exports=M$;});var fv=_((W2,Et)=>{var z$=G("os"),ov=Yu(),G$=Ju(),V$=nl(),av=Yw(),K$=W0(),uv=bn(),{configure:Y$}=Y0(),{assertDefaultLevelFound:J$,mappings:lv,genLsCache:X$,levels:Q$}=lo(),{createArgsNormalizer:Z$,asChindings:eF,buildSafeSonicBoom:Z0,buildFormatters:tF,stringify:Pl,normalizeDestFileDescriptor:ev,noop:rF}=uo(),{version:nF}=bl(),{chindingsSym:tv,redactFmtSym:iF,serializersSym:rv,timeSym:sF,timeSliceIndexSym:oF,streamSym:aF,stringifySym:nv,stringifySafeSym:Il,stringifiersSym:iv,setLevelSym:uF,endSym:lF,formatOptsSym:cF,messageKeySym:fF,errorKeySym:hF,nestedKeySym:pF,mixinSym:dF,useOnlyCustomLevelsSym:yF,formattersSym:sv,hooksSym:gF,nestedKeyStrSym:mF,mixinMergeStrategySym:wF,msgPrefixSym:vF}=uv,{epochTime:cv,nullTime:SF}=av,{pid:bF}=process,EF=z$.hostname(),xF=ov.err,AF={level:"info",levels:Q$,messageKey:"msg",errorKey:"err",nestedKey:null,enabled:!0,base:{pid:bF,hostname:EF},serializers:Object.assign(Object.create(null),{err:xF}),formatters:Object.assign(Object.create(null),{bindings(t){return t},level(t,e){return {level:e}}}),hooks:{logMethod:void 0},timestamp:cv,name:void 0,redact:null,customLevels:null,useOnlyCustomLevels:!1,depthLimit:5,edgeLimit:100},_F=Z$(AF),CF=Object.assign(Object.create(null),ov);function $l(...t){let e={},{opts:r,stream:n}=_F(e,G$(),...t),{redact:s,crlf:i,serializers:o,timestamp:u,messageKey:c,errorKey:p,nestedKey:l,base:d,name:g,level:m,customLevels:w,mixin:E,mixinMergeStrategy:A,useOnlyCustomLevels:R,formatters:x,hooks:O,depthLimit:F,edgeLimit:q,onChild:W,msgPrefix:H}=r,B=Y$({maximumDepth:F,maximumBreadth:q}),k=tF(x.level,x.bindings,x.log),U=Pl.bind({[Il]:B}),C=s?V$(s,U):{},Y=s?{stringify:C[iF]}:{stringify:U},J="}"+(i?`\r
`:`
`),oe=eF.bind(null,{[tv]:"",[rv]:o,[iv]:C,[nv]:Pl,[Il]:B,[sv]:k}),P="";d!==null&&(g===void 0?P=oe(d):P=oe(Object.assign({},d,{name:g})));let I=u instanceof Function?u:u?cv:SF,re=I().indexOf(":")+1;if(R&&!w)throw Error("customLevels is required if useOnlyCustomLevels is set true");if(E&&typeof E!="function")throw Error(`Unknown mixin type "${typeof E}" - expected "function"`);if(H&&typeof H!="string")throw Error(`Unknown msgPrefix type "${typeof H}" - expected "string"`);J$(m,w,R);let Z=lv(w,R);return Object.assign(e,{levels:Z,[yF]:R,[aF]:n,[sF]:I,[oF]:re,[nv]:Pl,[Il]:B,[iv]:C,[lF]:J,[cF]:Y,[fF]:c,[hF]:p,[pF]:l,[mF]:l?`,${JSON.stringify(l)}:{`:"",[rv]:o,[dF]:E,[wF]:A,[tv]:P,[sv]:k,[gF]:O,silent:rF,onChild:W,[vF]:H}),Object.setPrototypeOf(e,K$()),X$(e),e[uF](m),e}Et.exports=$l;Et.exports.destination=(t=process.stdout.fd)=>typeof t=="object"?(t.dest=ev(t.dest||process.stdout.fd),Z0(t)):Z0({dest:ev(t),minLength:0});Et.exports.transport=yl();Et.exports.multistream=Q0();Et.exports.levels=lv();Et.exports.stdSerializers=CF;Et.exports.stdTimeFunctions=Object.assign({},av);Et.exports.symbols=uv;Et.exports.version=nF;Et.exports.default=$l;Et.exports.pino=$l;});var wv={};sa(wv,{RotatingFileStream:()=>po,RotatingFileStreamError:()=>vi,createStream:()=>zF});async function pv(t){return new Promise(e=>fs.access(t,fs.constants.F_OK,r=>e(!r)))}function dv(t){return (e,r,n)=>{let s=parseInt(n,10);if(e!=="number"||s!==n||s<=0)throw new Error(`'${t}' option must be a positive integer number`)}}function kl(t,e){return (r,n,s)=>{if(r!=="string")throw new Error(`Don't know how to handle 'options.${t}' type: ${r}`);n[t]=e(s);}}function mv(t,e,r){let n={};if(n.num=parseInt(t,10),isNaN(n.num))throw new Error(`Unknown 'options.${e}' format: ${t}`);if(n.num<=0)throw new Error(`A positive integer number is expected for 'options.${e}'`);if(n.unit=t.replace(/^[ 0]*/g,"").substr((n.num+"").length,1),n.unit.length===0)throw new Error(`Missing unit for 'options.${e}'`);if(!r[n.unit])throw new Error(`Unknown 'options.${e}' unit: ${n.unit}`);return n}function Ll(t,e,r){if(parseInt(r/t.num,10)*t.num!==r)throw new Error(`An integer divider of ${r} is expected as ${e} for 'options.interval'`)}function MF(t){let e=mv(t,"interval",NF);switch(e.unit){case"h":Ll(e,"hours",24);break;case"m":Ll(e,"minutes",60);break;case"s":Ll(e,"seconds",60);break}return e}function yv(t){let e=mv(t,"size",UF);return e.unit==="K"?e.num*1024:e.unit==="M"?e.num*1048576:e.unit==="G"?e.num*1073741824:e.num}function jF(t){let e={};for(let r in t){let n=t[r],s=typeof n;if(!(r in gv))throw new Error(`Unknown option: ${r}`);e[r]=t[r],gv[r](s,e,n);}return e.path||(e.path=""),e.interval||(delete e.immutable,delete e.initialRotation,delete e.intervalBoundary),e.rotate&&(delete e.history,delete e.immutable,delete e.maxFiles,delete e.maxSize,delete e.intervalBoundary),e.immutable&&delete e.compress,e.intervalBoundary||delete e.initialRotation,e}function HF(t,e,r){return n=>n?`${t}.${n}${e&&!r?".gz":""}`:t}function WF(t,e,r){let n=s=>(s>9?"":"0")+s;return (s,i)=>{if(!s)return t;let o=s.getFullYear()+""+n(s.getMonth()+1),u=n(s.getDate()),c=n(s.getHours()),p=n(s.getMinutes());return o+u+"-"+c+p+"-"+n(i)+"-"+t+(e&&!r?".gz":"")}}function zF(t,e){if(typeof e>"u")e={};else if(typeof e!="object")throw new Error(`The "options" argument must be of type object. Received type ${typeof e}`);let r=jF(e),{compress:n,omitExtension:s}=r,i;if(typeof t=="string")i=e.rotate?HF(t,n!==void 0,s):WF(t,n!==void 0,s);else if(typeof t=="function")i=t;else throw new Error(`The "filename" argument must be one of type string or function. Received type ${typeof t}`);return new po(i,r)}var vi,po,NF,UF,gv,vv=Ji(()=>{vi=class extends Error{constructor(){super("Too many destination file attempts");ie(this,"code","RFS-TOO-MANY");}},po=class extends stream.Writable{constructor(r,n){let{encoding:s,history:i,maxFiles:o,maxSize:u,path:c}=n;super({decodeStrings:!0,defaultEncoding:s});ie(this,"createGzip");ie(this,"exec");ie(this,"file");ie(this,"filename");ie(this,"finished");ie(this,"fsCreateReadStream");ie(this,"fsCreateWriteStream");ie(this,"fsOpen");ie(this,"fsReadFile");ie(this,"fsStat");ie(this,"fsUnlink");ie(this,"generator");ie(this,"initPromise");ie(this,"last");ie(this,"maxTimeout");ie(this,"next");ie(this,"options");ie(this,"prev");ie(this,"rotation");ie(this,"size");ie(this,"stdout");ie(this,"timeout");ie(this,"timeoutPromise");this.createGzip=zlib.createGzip,this.exec=child_process.exec,this.filename=c+r(null),this.fsCreateReadStream=fs.createReadStream,this.fsCreateWriteStream=fs.createWriteStream,this.fsOpen=promises.open,this.fsReadFile=promises.readFile,this.fsStat=promises.stat,this.fsUnlink=promises.unlink,this.generator=r,this.maxTimeout=2147483640,this.options=n,this.stdout=process.stdout,(o||u)&&(n.history=c+(i||this.generator(null)+".txt")),this.on("close",()=>this.finished?null:this.emit("finish")),this.on("finish",()=>this.finished=this.clear()),(async()=>{try{this.initPromise=this.init(),await this.initPromise,delete this.initPromise;}catch{}})();}_destroy(r,n){this.refinal(r,n);}_final(r){this.refinal(void 0,r);}_write(r,n,s){this.rewrite([{chunk:r,encoding:n}],0,s);}_writev(r,n){this.rewrite(r,0,n);}async refinal(r,n){try{this.clear(),this.initPromise&&await this.initPromise,this.timeoutPromise&&await this.timeoutPromise,await this.reclose();}catch(s){return n(r||s)}n(r);}async rewrite(r,n,s){let{size:i,teeToStdout:o}=this.options;try{this.initPromise&&await this.initPromise;for(let u=0;u<r.length;++u){let{chunk:c}=r[u];this.size+=c.length,this.timeoutPromise&&await this.timeoutPromise,await this.file.write(c),o&&!this.stdout.destroyed&&this.stdout.write(c),i&&this.size>=i&&await this.rotate();}}catch(u){return s(u)}s();}async init(){let{immutable:r,initialRotation:n,interval:s,size:i}=this.options;if(r)return new Promise((u,c)=>process.nextTick(()=>this.immutate(!0).then(u).catch(c)));let o;try{o=await promises.stat(this.filename);}catch(u){if(u.code!=="ENOENT")throw u;return this.reopen(0)}if(!o.isFile())throw new Error(`Can't write on: ${this.filename} (it is not a file)`);if(n){this.intervalBounds(this.now());let u=this.prev;if(this.intervalBounds(new Date(o.mtime.getTime())),u!==this.prev)return this.rotate()}return this.size=o.size,!i||o.size<i?this.reopen(o.size):(s&&this.intervalBounds(this.now()),this.rotate())}async makePath(r){return promises.mkdir(r.split(path.sep).slice(0,-1).join(path.sep),{recursive:!0})}async reopen(r){let n;try{n=await promises.open(this.filename,"a",this.options.mode);}catch(s){if(s.code!=="ENOENT")throw s;await this.makePath(this.filename),n=await promises.open(this.filename,"a",this.options.mode);}this.file=n,this.size=r,this.interval(),this.emit("open",this.filename);}async reclose(){let{file:r}=this;if(r)return delete this.file,r.close()}now(){return new Date}async rotate(){let{immutable:r,rotate:n}=this.options;return this.size=0,this.rotation=this.now(),this.clear(),this.emit("rotation"),await this.reclose(),n?this.classical():r?this.immutate(!1):this.move()}async findName(){let{interval:r,path:n,intervalBoundary:s}=this.options;for(let i=1;i<1e3;++i){let o=n+this.generator(r&&s?new Date(this.prev):this.rotation,i);if(!await pv(o))return o}throw new vi}async move(){let{compress:r}=this.options,n=await this.findName();return await this.touch(n),r?await this.compress(n):await promises.rename(this.filename,n),this.rotated(n)}async touch(r){let n;try{n=await this.fsOpen(r,"a");}catch(s){if(s.code!=="ENOENT")throw s;await this.makePath(r),n=await promises.open(r,"a");}return await n.close(),this.unlink(r)}async classical(){let{compress:r,path:n,rotate:s}=this.options,i="";for(let o=s;o>0;--o){let u=n+this.generator(o),c=o===1?this.filename:n+this.generator(o-1);if(await pv(c))if(i||(i=u),o===1&&r)await this.compress(u);else try{await promises.rename(c,u);}catch(p){if(p.code!=="ENOENT")throw p;await this.makePath(u),await promises.rename(c,u);}}return this.rotated(i)}clear(){return this.timeout&&(clearTimeout(this.timeout),this.timeout=null),!0}intervalBoundsBig(r){let n=r.getFullYear(),s=r.getMonth(),i=r.getDate(),o=r.getHours(),{num:u,unit:c}=this.options.interval;c==="M"?(i=1,o=0):c==="d"?o=0:o=parseInt(o/u,10)*u,this.prev=new Date(n,s,i,o,0,0,0).getTime(),c==="M"?s+=u:c==="d"?i+=u:o+=u,this.next=new Date(n,s,i,o,0,0,0).getTime();}intervalBounds(r){let n=this.options.interval.unit;if(n==="M"||n==="d"||n==="h")this.intervalBoundsBig(r);else {let s=1e3*this.options.interval.num;n==="m"&&(s*=60),this.prev=parseInt(r.getTime()/s,10)*s,this.next=this.prev+s;}return new Date(this.prev)}interval(){if(!this.options.interval)return;this.intervalBounds(this.now());let r=async()=>{let n=this.next-this.now().getTime();if(n<=0)try{this.timeoutPromise=this.rotate(),await this.timeoutPromise,delete this.timeoutPromise;}catch{}else this.timeout=setTimeout(r,n>this.maxTimeout?this.maxTimeout:n),this.timeout.unref();};r();}async compress(r){let{compress:n}=this.options;return typeof n=="function"?await new Promise((s,i)=>{this.exec(n(this.filename,r),(o,u,c)=>{this.emit("external",u,c),o?i(o):s();});}):await this.gzip(r),this.unlink(this.filename)}async gzip(r){let{mode:n}=this.options,s=n?{mode:n}:{},i=this.fsCreateReadStream(this.filename,{}),o=this.fsCreateWriteStream(r,s),u=this.createGzip();return new Promise((c,p)=>{[i,o,u].map(l=>l.once("error",p)),o.once("finish",c),i.pipe(u).pipe(o);})}async rotated(r){let{maxFiles:n,maxSize:s}=this.options;return (n||s)&&await this.history(r),this.emit("rotated",r),this.reopen(0)}async history(r){let{history:n,maxFiles:s,maxSize:i}=this.options,o=[],u=[r];try{u=[...(await this.fsReadFile(n,"utf8")).toString().split(`
`),r];}catch(c){if(c.code!=="ENOENT")throw c}for(let c of u)if(c)try{let p=await this.fsStat(c);p.isFile()?o.push({name:c,size:p.size,time:p.ctime.getTime()}):this.emit("warning",new Error(`File '${c}' contained in history is not a regular file`));}catch(p){if(p.code!=="ENOENT")throw p}if(o.sort((c,p)=>c.time-p.time),s)for(;o.length>s;){let c=o.shift();await this.unlink(c.name),this.emit("removed",c.name,!0);}if(i)for(;o.reduce((c,p)=>c+p.size,0)>i;){let c=o.shift();await this.unlink(c.name),this.emit("removed",c.name,!1);}await promises.writeFile(n,o.map(c=>c.name).join(`
`)+`
`,"utf-8"),this.emit("history");}async immutate(r){let{size:n}=this.options,s=this.now();for(let i=1;i<1e3;++i){let o=0,u;this.filename=this.options.path+this.generator(s,i);try{u=await this.fsStat(this.filename);}catch(c){if(c.code!=="ENOENT")throw c}if(u){if(o=u.size,!u.isFile())throw new Error(`Can't write on: '${this.filename}' (it is not a file)`);if(n&&o>=n)continue}if(r)return this.last=this.filename,this.reopen(o);await this.rotated(this.last),this.last=this.filename;return}throw new vi}async unlink(r){try{await this.fsUnlink(r);}catch(n){if(n.code!=="ENOENT")throw n;this.emit("warning",n);}}};NF={M:!0,d:!0,h:!0,m:!0,s:!0};UF={B:!0,G:!0,K:!0,M:!0};gv={encoding:(t,e,r)=>new util.TextDecoder(r),immutable:()=>{},initialRotation:()=>{},interval:kl("interval",MF),intervalBoundary:()=>{},maxFiles:dv("maxFiles"),maxSize:kl("maxSize",yv),mode:()=>{},omitExtension:()=>{},rotate:dv("rotate"),size:kl("size",yv),teeToStdout:()=>{},compress:(t,e,r)=>{if(!r)throw new Error("A value for 'options.compress' must be specified");if(t==="boolean")return e.compress=(n,s)=>`cat ${n} | gzip -c9 > ${s}`;if(t!=="function"){if(t!=="string")throw new Error(`Don't know how to handle 'options.compress' type: ${t}`);if(r!=="gzip")throw new Error(`Don't know how to handle compression method: ${r}`)}},history:t=>{if(t!=="string")throw new Error(`Don't know how to handle 'options.history' type: ${t}`)},path:(t,e,r)=>{if(t!=="string")throw new Error(`Don't know how to handle 'options.path' type: ${t}`);r[r.length-1]!==path.sep&&(e.path=r+path.sep);}};});var Ev={};sa(Ev,{allLoggers:()=>An,rootLogger:()=>Re});var ql,Sv,Re,An,Ut=Ji(()=>{ql=nn(fv());ui();Sv=(vv(),oa(wv)).createStream("tabby-agent.log",{path:G("path").join(G("os").homedir(),".tabby-client","agent","logs"),size:"10M",interval:"1d"}),Re=Sv?(0, ql.default)(Sv):(0, ql.default)();Re.level="silent";An=[Re];Re.onChild=t=>{An.push(t);};});var Av=_((uM,xv)=>{xv.exports=function(){function t(n,s){function i(){this.constructor=n;}i.prototype=s.prototype,n.prototype=new i;}function e(n,s,i,o,u,c){this.message=n,this.expected=s,this.found=i,this.offset=o,this.line=u,this.column=c,this.name="SyntaxError";}t(e,Error);function r(n){var s=arguments.length>1?arguments[1]:{},i={},o={start:If},u=If,p=function(){return Jf},l=i,d="#",g={type:"literal",value:"#",description:'"#"'},m=void 0,w={type:"any",description:"any character"},E="[",A={type:"literal",value:"[",description:'"["'},R="]",x={type:"literal",value:"]",description:'"]"'},O=function(a){na(je("ObjectPath",a,Me,Ue));},F=function(a){na(je("ArrayPath",a,Me,Ue));},q=function(a,h){return a.concat(h)},W=function(a){return [a]},H=function(a){return a},B=".",k={type:"literal",value:".",description:'"."'},U="=",C={type:"literal",value:"=",description:'"="'},Y=function(a,h){na(je("Assign",h,Me,Ue,a));},J=function(a){return a.join("")},oe=function(a){return a.value},P='"""',I={type:"literal",value:'"""',description:'"\\"\\"\\""'},re=null,Z=function(a){return je("String",a.join(""),Me,Ue)},ce='"',Ke={type:"literal",value:'"',description:'"\\""'},Te="'''",sr={type:"literal",value:"'''",description:`"'''"`},jn="'",or={type:"literal",value:"'",description:`"'"`},_t=function(a){return a},fe=function(a){return a},en="\\",Jo={type:"literal",value:"\\",description:'"\\\\"'},K=function(){return ""},me="e",z={type:"literal",value:"e",description:'"e"'},le="E",ve={type:"literal",value:"E",description:'"E"'},Ne=function(a,h){return je("Float",parseFloat(a+"e"+h),Me,Ue)},_e=function(a){return je("Float",parseFloat(a),Me,Ue)},Tr="+",ar={type:"literal",value:"+",description:'"+"'},uf=function(a){return a.join("")},Hn="-",Wn={type:"literal",value:"-",description:'"-"'},lf=function(a){return "-"+a.join("")},TE=function(a){return je("Integer",parseInt(a,10),Me,Ue)},cf="true",PE={type:"literal",value:"true",description:'"true"'},IE=function(){return je("Boolean",!0,Me,Ue)},ff="false",$E={type:"literal",value:"false",description:'"false"'},FE=function(){return je("Boolean",!1,Me,Ue)},kE=function(){return je("Array",[],Me,Ue)},LE=function(a){return je("Array",a?[a]:[],Me,Ue)},qE=function(a){return je("Array",a,Me,Ue)},BE=function(a,h){return je("Array",a.concat(h),Me,Ue)},hf=function(a){return a},pf=",",df={type:"literal",value:",",description:'","'},DE="{",NE={type:"literal",value:"{",description:'"{"'},ME="}",UE={type:"literal",value:"}",description:'"}"'},jE=function(a){return je("InlineTable",a,Me,Ue)},yf=function(a,h){return je("InlineTableValue",h,Me,Ue,a)},HE=function(a){return "."+a},WE=function(a){return a.join("")},zn=":",Gn={type:"literal",value:":",description:'":"'},gf=function(a){return a.join("")},mf="T",wf={type:"literal",value:"T",description:'"T"'},zE="Z",GE={type:"literal",value:"Z",description:'"Z"'},VE=function(a,h){return je("Date",new Date(a+"T"+h+"Z"),Me,Ue)},KE=function(a,h){return je("Date",new Date(a+"T"+h),Me,Ue)},YE=/^[ \t]/,JE={type:"class",value:"[ \\t]",description:"[ \\t]"},vf=`
`,Sf={type:"literal",value:`
`,description:'"\\n"'},XE="\r",QE={type:"literal",value:"\r",description:'"\\r"'},ZE=/^[0-9a-f]/i,ex={type:"class",value:"[0-9a-f]i",description:"[0-9a-f]i"},tx=/^[0-9]/,rx={type:"class",value:"[0-9]",description:"[0-9]"},nx="_",ix={type:"literal",value:"_",description:'"_"'},sx=function(){return ""},ox=/^[A-Za-z0-9_\-]/,ax={type:"class",value:"[A-Za-z0-9_\\-]",description:"[A-Za-z0-9_\\-]"},ux=function(a){return a.join("")},bf='\\"',lx={type:"literal",value:'\\"',description:'"\\\\\\""'},cx=function(){return '"'},Ef="\\\\",fx={type:"literal",value:"\\\\",description:'"\\\\\\\\"'},hx=function(){return "\\"},xf="\\b",px={type:"literal",value:"\\b",description:'"\\\\b"'},dx=function(){return "\b"},Af="\\t",yx={type:"literal",value:"\\t",description:'"\\\\t"'},gx=function(){return " "},_f="\\n",mx={type:"literal",value:"\\n",description:'"\\\\n"'},wx=function(){return `
`},Cf="\\f",vx={type:"literal",value:"\\f",description:'"\\\\f"'},Sx=function(){return "\f"},Rf="\\r",bx={type:"literal",value:"\\r",description:'"\\\\r"'},Ex=function(){return "\r"},Of="\\U",xx={type:"literal",value:"\\U",description:'"\\\\U"'},Tf=function(a){return Hx(a.join(""))},Pf="\\u",Ax={type:"literal",value:"\\u",description:'"\\\\u"'},f=0,X=0,Vn=0,Xo={line:1,column:1,seenCR:!1},zi=0,Qo=[],N=0,M={},Gi;if("startRule"in s){if(!(s.startRule in o))throw new Error(`Can't start parsing from rule "`+s.startRule+'".');u=o[s.startRule];}function Me(){return Zo(X).line}function Ue(){return Zo(X).column}function Zo(a){function h(y,v,b){var T,L;for(T=v;T<b;T++)L=n.charAt(T),L===`
`?(y.seenCR||y.line++,y.column=1,y.seenCR=!1):L==="\r"||L==="\u2028"||L==="\u2029"?(y.line++,y.column=1,y.seenCR=!0):(y.column++,y.seenCR=!1);}return Vn!==a&&(Vn>a&&(Vn=0,Xo={line:1,column:1,seenCR:!1}),h(Xo,Vn,a),Vn=a),Xo}function j(a){f<zi||(f>zi&&(zi=f,Qo=[]),Qo.push(a));}function ea(a,h,y){function v(V){var se=1;for(V.sort(function(ye,pe){return ye.description<pe.description?-1:ye.description>pe.description?1:0});se<V.length;)V[se-1]===V[se]?V.splice(se,1):se++;}function b(V,se){function ye(rn){function ur(lt){return lt.charCodeAt(0).toString(16).toUpperCase()}return rn.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(lt){return "\\x0"+ur(lt)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(lt){return "\\x"+ur(lt)}).replace(/[\u0180-\u0FFF]/g,function(lt){return "\\u0"+ur(lt)}).replace(/[\u1080-\uFFFF]/g,function(lt){return "\\u"+ur(lt)})}var pe=new Array(V.length),Ee,Ce,ut;for(ut=0;ut<V.length;ut++)pe[ut]=V[ut].description;return Ee=V.length>1?pe.slice(0,-1).join(", ")+" or "+pe[V.length-1]:pe[0],Ce=se?'"'+ye(se)+'"':"end of input","Expected "+Ee+" but "+Ce+" found."}var T=Zo(y),L=y<n.length?n.charAt(y):null;return h!==null&&v(h),new e(a!==null?a:b(h,L),h,L,y,T.line,T.column)}function If(){var a,h,y,v=f*49+0,b=M[v];if(b)return f=b.nextPos,b.result;for(a=f,h=[],y=$f();y!==i;)h.push(y),y=$f();return h!==i&&(X=a,h=p()),a=h,M[v]={nextPos:f,result:a},a}function $f(){var a,h,y,v,b,T,L,V=f*49+1,se=M[V];if(se)return f=se.nextPos,se.result;for(a=f,h=[],y=Q();y!==i;)h.push(y),y=Q();if(h!==i)if(y=_x(),y!==i){for(v=[],b=Q();b!==i;)v.push(b),b=Q();if(v!==i){for(b=[],T=Vi();T!==i;)b.push(T),T=Vi();if(b!==i){if(T=[],L=vt(),L!==i)for(;L!==i;)T.push(L),L=vt();else T=l;T===i&&(T=Yi()),T!==i?(h=[h,y,v,b,T],a=h):(f=a,a=l);}else f=a,a=l;}else f=a,a=l;}else f=a,a=l;else f=a,a=l;if(a===i){if(a=f,h=[],y=Q(),y!==i)for(;y!==i;)h.push(y),y=Q();else h=l;if(h!==i){if(y=[],v=vt(),v!==i)for(;v!==i;)y.push(v),v=vt();else y=l;y===i&&(y=Yi()),y!==i?(h=[h,y],a=h):(f=a,a=l);}else f=a,a=l;a===i&&(a=vt());}return M[V]={nextPos:f,result:a},a}function _x(){var a,h=f*49+2,y=M[h];return y?(f=y.nextPos,y.result):(a=Vi(),a===i&&(a=Cx(),a===i&&(a=Rx(),a===i&&(a=Ox()))),M[h]={nextPos:f,result:a},a)}function Vi(){var a,h,y,v,b,T,L=f*49+3,V=M[L];if(V)return f=V.nextPos,V.result;if(a=f,n.charCodeAt(f)===35?(h=d,f++):(h=i,N===0&&j(g)),h!==i){for(y=[],v=f,b=f,N++,T=vt(),T===i&&(T=Yi()),N--,T===i?b=m:(f=b,b=l),b!==i?(n.length>f?(T=n.charAt(f),f++):(T=i,N===0&&j(w)),T!==i?(b=[b,T],v=b):(f=v,v=l)):(f=v,v=l);v!==i;)y.push(v),v=f,b=f,N++,T=vt(),T===i&&(T=Yi()),N--,T===i?b=m:(f=b,b=l),b!==i?(n.length>f?(T=n.charAt(f),f++):(T=i,N===0&&j(w)),T!==i?(b=[b,T],v=b):(f=v,v=l)):(f=v,v=l);y!==i?(h=[h,y],a=h):(f=a,a=l);}else f=a,a=l;return M[L]={nextPos:f,result:a},a}function Cx(){var a,h,y,v,b,T,L=f*49+4,V=M[L];if(V)return f=V.nextPos,V.result;if(a=f,n.charCodeAt(f)===91?(h=E,f++):(h=i,N===0&&j(A)),h!==i){for(y=[],v=Q();v!==i;)y.push(v),v=Q();if(y!==i)if(v=Ff(),v!==i){for(b=[],T=Q();T!==i;)b.push(T),T=Q();b!==i?(n.charCodeAt(f)===93?(T=R,f++):(T=i,N===0&&j(x)),T!==i?(X=a,h=O(v),a=h):(f=a,a=l)):(f=a,a=l);}else f=a,a=l;else f=a,a=l;}else f=a,a=l;return M[L]={nextPos:f,result:a},a}function Rx(){var a,h,y,v,b,T,L,V,se=f*49+5,ye=M[se];if(ye)return f=ye.nextPos,ye.result;if(a=f,n.charCodeAt(f)===91?(h=E,f++):(h=i,N===0&&j(A)),h!==i)if(n.charCodeAt(f)===91?(y=E,f++):(y=i,N===0&&j(A)),y!==i){for(v=[],b=Q();b!==i;)v.push(b),b=Q();if(v!==i)if(b=Ff(),b!==i){for(T=[],L=Q();L!==i;)T.push(L),L=Q();T!==i?(n.charCodeAt(f)===93?(L=R,f++):(L=i,N===0&&j(x)),L!==i?(n.charCodeAt(f)===93?(V=R,f++):(V=i,N===0&&j(x)),V!==i?(X=a,h=F(b),a=h):(f=a,a=l)):(f=a,a=l)):(f=a,a=l);}else f=a,a=l;else f=a,a=l;}else f=a,a=l;else f=a,a=l;return M[se]={nextPos:f,result:a},a}function Ff(){var a,h,y,v=f*49+6,b=M[v];if(b)return f=b.nextPos,b.result;if(a=f,h=[],y=Lf(),y!==i)for(;y!==i;)h.push(y),y=Lf();else h=l;return h!==i?(y=kf(),y!==i?(X=a,h=q(h,y),a=h):(f=a,a=l)):(f=a,a=l),a===i&&(a=f,h=kf(),h!==i&&(X=a,h=W(h)),a=h),M[v]={nextPos:f,result:a},a}function kf(){var a,h,y,v,b,T=f*49+7,L=M[T];if(L)return f=L.nextPos,L.result;for(a=f,h=[],y=Q();y!==i;)h.push(y),y=Q();if(h!==i)if(y=Kn(),y!==i){for(v=[],b=Q();b!==i;)v.push(b),b=Q();v!==i?(X=a,h=H(y),a=h):(f=a,a=l);}else f=a,a=l;else f=a,a=l;if(a===i){for(a=f,h=[],y=Q();y!==i;)h.push(y),y=Q();if(h!==i)if(y=ta(),y!==i){for(v=[],b=Q();b!==i;)v.push(b),b=Q();v!==i?(X=a,h=H(y),a=h):(f=a,a=l);}else f=a,a=l;else f=a,a=l;}return M[T]={nextPos:f,result:a},a}function Lf(){var a,h,y,v,b,T,L,V=f*49+8,se=M[V];if(se)return f=se.nextPos,se.result;for(a=f,h=[],y=Q();y!==i;)h.push(y),y=Q();if(h!==i)if(y=Kn(),y!==i){for(v=[],b=Q();b!==i;)v.push(b),b=Q();if(v!==i)if(n.charCodeAt(f)===46?(b=B,f++):(b=i,N===0&&j(k)),b!==i){for(T=[],L=Q();L!==i;)T.push(L),L=Q();T!==i?(X=a,h=H(y),a=h):(f=a,a=l);}else f=a,a=l;else f=a,a=l;}else f=a,a=l;else f=a,a=l;if(a===i){for(a=f,h=[],y=Q();y!==i;)h.push(y),y=Q();if(h!==i)if(y=ta(),y!==i){for(v=[],b=Q();b!==i;)v.push(b),b=Q();if(v!==i)if(n.charCodeAt(f)===46?(b=B,f++):(b=i,N===0&&j(k)),b!==i){for(T=[],L=Q();L!==i;)T.push(L),L=Q();T!==i?(X=a,h=H(y),a=h):(f=a,a=l);}else f=a,a=l;else f=a,a=l;}else f=a,a=l;else f=a,a=l;}return M[V]={nextPos:f,result:a},a}function Ox(){var a,h,y,v,b,T,L=f*49+9,V=M[L];if(V)return f=V.nextPos,V.result;if(a=f,h=Kn(),h!==i){for(y=[],v=Q();v!==i;)y.push(v),v=Q();if(y!==i)if(n.charCodeAt(f)===61?(v=U,f++):(v=i,N===0&&j(C)),v!==i){for(b=[],T=Q();T!==i;)b.push(T),T=Q();b!==i?(T=tn(),T!==i?(X=a,h=Y(h,T),a=h):(f=a,a=l)):(f=a,a=l);}else f=a,a=l;else f=a,a=l;}else f=a,a=l;if(a===i)if(a=f,h=ta(),h!==i){for(y=[],v=Q();v!==i;)y.push(v),v=Q();if(y!==i)if(n.charCodeAt(f)===61?(v=U,f++):(v=i,N===0&&j(C)),v!==i){for(b=[],T=Q();T!==i;)b.push(T),T=Q();b!==i?(T=tn(),T!==i?(X=a,h=Y(h,T),a=h):(f=a,a=l)):(f=a,a=l);}else f=a,a=l;else f=a,a=l;}else f=a,a=l;return M[L]={nextPos:f,result:a},a}function Kn(){var a,h,y,v=f*49+10,b=M[v];if(b)return f=b.nextPos,b.result;if(a=f,h=[],y=Kf(),y!==i)for(;y!==i;)h.push(y),y=Kf();else h=l;return h!==i&&(X=a,h=J(h)),a=h,M[v]={nextPos:f,result:a},a}function ta(){var a,h,y=f*49+11,v=M[y];return v?(f=v.nextPos,v.result):(a=f,h=qf(),h!==i&&(X=a,h=oe(h)),a=h,a===i&&(a=f,h=Bf(),h!==i&&(X=a,h=oe(h)),a=h),M[y]={nextPos:f,result:a},a)}function tn(){var a,h=f*49+12,y=M[h];return y?(f=y.nextPos,y.result):(a=Tx(),a===i&&(a=Mx(),a===i&&(a=Fx(),a===i&&(a=kx(),a===i&&(a=Lx(),a===i&&(a=qx(),a===i&&(a=Bx())))))),M[h]={nextPos:f,result:a},a)}function Tx(){var a,h=f*49+13,y=M[h];return y?(f=y.nextPos,y.result):(a=Px(),a===i&&(a=qf(),a===i&&(a=Ix(),a===i&&(a=Bf()))),M[h]={nextPos:f,result:a},a)}function Px(){var a,h,y,v,b,T=f*49+14,L=M[T];if(L)return f=L.nextPos,L.result;if(a=f,n.substr(f,3)===P?(h=P,f+=3):(h=i,N===0&&j(I)),h!==i)if(y=vt(),y===i&&(y=re),y!==i){for(v=[],b=Mf();b!==i;)v.push(b),b=Mf();v!==i?(n.substr(f,3)===P?(b=P,f+=3):(b=i,N===0&&j(I)),b!==i?(X=a,h=Z(v),a=h):(f=a,a=l)):(f=a,a=l);}else f=a,a=l;else f=a,a=l;return M[T]={nextPos:f,result:a},a}function qf(){var a,h,y,v,b=f*49+15,T=M[b];if(T)return f=T.nextPos,T.result;if(a=f,n.charCodeAt(f)===34?(h=ce,f++):(h=i,N===0&&j(Ke)),h!==i){for(y=[],v=Df();v!==i;)y.push(v),v=Df();y!==i?(n.charCodeAt(f)===34?(v=ce,f++):(v=i,N===0&&j(Ke)),v!==i?(X=a,h=Z(y),a=h):(f=a,a=l)):(f=a,a=l);}else f=a,a=l;return M[b]={nextPos:f,result:a},a}function Ix(){var a,h,y,v,b,T=f*49+16,L=M[T];if(L)return f=L.nextPos,L.result;if(a=f,n.substr(f,3)===Te?(h=Te,f+=3):(h=i,N===0&&j(sr)),h!==i)if(y=vt(),y===i&&(y=re),y!==i){for(v=[],b=Uf();b!==i;)v.push(b),b=Uf();v!==i?(n.substr(f,3)===Te?(b=Te,f+=3):(b=i,N===0&&j(sr)),b!==i?(X=a,h=Z(v),a=h):(f=a,a=l)):(f=a,a=l);}else f=a,a=l;else f=a,a=l;return M[T]={nextPos:f,result:a},a}function Bf(){var a,h,y,v,b=f*49+17,T=M[b];if(T)return f=T.nextPos,T.result;if(a=f,n.charCodeAt(f)===39?(h=jn,f++):(h=i,N===0&&j(or)),h!==i){for(y=[],v=Nf();v!==i;)y.push(v),v=Nf();y!==i?(n.charCodeAt(f)===39?(v=jn,f++):(v=i,N===0&&j(or)),v!==i?(X=a,h=Z(y),a=h):(f=a,a=l)):(f=a,a=l);}else f=a,a=l;return M[b]={nextPos:f,result:a},a}function Df(){var a,h,y,v=f*49+18,b=M[v];return b?(f=b.nextPos,b.result):(a=Yf(),a===i&&(a=f,h=f,N++,n.charCodeAt(f)===34?(y=ce,f++):(y=i,N===0&&j(Ke)),N--,y===i?h=m:(f=h,h=l),h!==i?(n.length>f?(y=n.charAt(f),f++):(y=i,N===0&&j(w)),y!==i?(X=a,h=_t(y),a=h):(f=a,a=l)):(f=a,a=l)),M[v]={nextPos:f,result:a},a)}function Nf(){var a,h,y,v=f*49+19,b=M[v];return b?(f=b.nextPos,b.result):(a=f,h=f,N++,n.charCodeAt(f)===39?(y=jn,f++):(y=i,N===0&&j(or)),N--,y===i?h=m:(f=h,h=l),h!==i?(n.length>f?(y=n.charAt(f),f++):(y=i,N===0&&j(w)),y!==i?(X=a,h=_t(y),a=h):(f=a,a=l)):(f=a,a=l),M[v]={nextPos:f,result:a},a)}function Mf(){var a,h,y,v=f*49+20,b=M[v];return b?(f=b.nextPos,b.result):(a=Yf(),a===i&&(a=$x(),a===i&&(a=f,h=f,N++,n.substr(f,3)===P?(y=P,f+=3):(y=i,N===0&&j(I)),N--,y===i?h=m:(f=h,h=l),h!==i?(n.length>f?(y=n.charAt(f),f++):(y=i,N===0&&j(w)),y!==i?(X=a,h=fe(y),a=h):(f=a,a=l)):(f=a,a=l))),M[v]={nextPos:f,result:a},a)}function $x(){var a,h,y,v,b,T=f*49+21,L=M[T];if(L)return f=L.nextPos,L.result;if(a=f,n.charCodeAt(f)===92?(h=en,f++):(h=i,N===0&&j(Jo)),h!==i)if(y=vt(),y!==i){for(v=[],b=Vf();b!==i;)v.push(b),b=Vf();v!==i?(X=a,h=K(),a=h):(f=a,a=l);}else f=a,a=l;else f=a,a=l;return M[T]={nextPos:f,result:a},a}function Uf(){var a,h,y,v=f*49+22,b=M[v];return b?(f=b.nextPos,b.result):(a=f,h=f,N++,n.substr(f,3)===Te?(y=Te,f+=3):(y=i,N===0&&j(sr)),N--,y===i?h=m:(f=h,h=l),h!==i?(n.length>f?(y=n.charAt(f),f++):(y=i,N===0&&j(w)),y!==i?(X=a,h=_t(y),a=h):(f=a,a=l)):(f=a,a=l),M[v]={nextPos:f,result:a},a)}function Fx(){var a,h,y,v,b=f*49+23,T=M[b];return T?(f=T.nextPos,T.result):(a=f,h=jf(),h===i&&(h=ra()),h!==i?(n.charCodeAt(f)===101?(y=me,f++):(y=i,N===0&&j(z)),y===i&&(n.charCodeAt(f)===69?(y=le,f++):(y=i,N===0&&j(ve))),y!==i?(v=ra(),v!==i?(X=a,h=Ne(h,v),a=h):(f=a,a=l)):(f=a,a=l)):(f=a,a=l),a===i&&(a=f,h=jf(),h!==i&&(X=a,h=_e(h)),a=h),M[b]={nextPos:f,result:a},a)}function jf(){var a,h,y,v,b,T,L=f*49+24,V=M[L];return V?(f=V.nextPos,V.result):(a=f,n.charCodeAt(f)===43?(h=Tr,f++):(h=i,N===0&&j(ar)),h===i&&(h=re),h!==i?(y=f,v=Yn(),v!==i?(n.charCodeAt(f)===46?(b=B,f++):(b=i,N===0&&j(k)),b!==i?(T=Yn(),T!==i?(v=[v,b,T],y=v):(f=y,y=l)):(f=y,y=l)):(f=y,y=l),y!==i?(X=a,h=uf(y),a=h):(f=a,a=l)):(f=a,a=l),a===i&&(a=f,n.charCodeAt(f)===45?(h=Hn,f++):(h=i,N===0&&j(Wn)),h!==i?(y=f,v=Yn(),v!==i?(n.charCodeAt(f)===46?(b=B,f++):(b=i,N===0&&j(k)),b!==i?(T=Yn(),T!==i?(v=[v,b,T],y=v):(f=y,y=l)):(f=y,y=l)):(f=y,y=l),y!==i?(X=a,h=lf(y),a=h):(f=a,a=l)):(f=a,a=l)),M[L]={nextPos:f,result:a},a)}function kx(){var a,h,y=f*49+25,v=M[y];return v?(f=v.nextPos,v.result):(a=f,h=ra(),h!==i&&(X=a,h=TE(h)),a=h,M[y]={nextPos:f,result:a},a)}function ra(){var a,h,y,v,b,T=f*49+26,L=M[T];if(L)return f=L.nextPos,L.result;if(a=f,n.charCodeAt(f)===43?(h=Tr,f++):(h=i,N===0&&j(ar)),h===i&&(h=re),h!==i){if(y=[],v=de(),v!==i)for(;v!==i;)y.push(v),v=de();else y=l;y!==i?(v=f,N++,n.charCodeAt(f)===46?(b=B,f++):(b=i,N===0&&j(k)),N--,b===i?v=m:(f=v,v=l),v!==i?(X=a,h=uf(y),a=h):(f=a,a=l)):(f=a,a=l);}else f=a,a=l;if(a===i)if(a=f,n.charCodeAt(f)===45?(h=Hn,f++):(h=i,N===0&&j(Wn)),h!==i){if(y=[],v=de(),v!==i)for(;v!==i;)y.push(v),v=de();else y=l;y!==i?(v=f,N++,n.charCodeAt(f)===46?(b=B,f++):(b=i,N===0&&j(k)),N--,b===i?v=m:(f=v,v=l),v!==i?(X=a,h=lf(y),a=h):(f=a,a=l)):(f=a,a=l);}else f=a,a=l;return M[T]={nextPos:f,result:a},a}function Lx(){var a,h,y=f*49+27,v=M[y];return v?(f=v.nextPos,v.result):(a=f,n.substr(f,4)===cf?(h=cf,f+=4):(h=i,N===0&&j(PE)),h!==i&&(X=a,h=IE()),a=h,a===i&&(a=f,n.substr(f,5)===ff?(h=ff,f+=5):(h=i,N===0&&j($E)),h!==i&&(X=a,h=FE()),a=h),M[y]={nextPos:f,result:a},a)}function qx(){var a,h,y,v,b,T=f*49+28,L=M[T];if(L)return f=L.nextPos,L.result;if(a=f,n.charCodeAt(f)===91?(h=E,f++):(h=i,N===0&&j(A)),h!==i){for(y=[],v=wt();v!==i;)y.push(v),v=wt();y!==i?(n.charCodeAt(f)===93?(v=R,f++):(v=i,N===0&&j(x)),v!==i?(X=a,h=kE(),a=h):(f=a,a=l)):(f=a,a=l);}else f=a,a=l;if(a===i&&(a=f,n.charCodeAt(f)===91?(h=E,f++):(h=i,N===0&&j(A)),h!==i?(y=Hf(),y===i&&(y=re),y!==i?(n.charCodeAt(f)===93?(v=R,f++):(v=i,N===0&&j(x)),v!==i?(X=a,h=LE(y),a=h):(f=a,a=l)):(f=a,a=l)):(f=a,a=l),a===i)){if(a=f,n.charCodeAt(f)===91?(h=E,f++):(h=i,N===0&&j(A)),h!==i){if(y=[],v=Ki(),v!==i)for(;v!==i;)y.push(v),v=Ki();else y=l;y!==i?(n.charCodeAt(f)===93?(v=R,f++):(v=i,N===0&&j(x)),v!==i?(X=a,h=qE(y),a=h):(f=a,a=l)):(f=a,a=l);}else f=a,a=l;if(a===i)if(a=f,n.charCodeAt(f)===91?(h=E,f++):(h=i,N===0&&j(A)),h!==i){if(y=[],v=Ki(),v!==i)for(;v!==i;)y.push(v),v=Ki();else y=l;y!==i?(v=Hf(),v!==i?(n.charCodeAt(f)===93?(b=R,f++):(b=i,N===0&&j(x)),b!==i?(X=a,h=BE(y,v),a=h):(f=a,a=l)):(f=a,a=l)):(f=a,a=l);}else f=a,a=l;}return M[T]={nextPos:f,result:a},a}function Hf(){var a,h,y,v,b,T=f*49+29,L=M[T];if(L)return f=L.nextPos,L.result;for(a=f,h=[],y=wt();y!==i;)h.push(y),y=wt();if(h!==i)if(y=tn(),y!==i){for(v=[],b=wt();b!==i;)v.push(b),b=wt();v!==i?(X=a,h=hf(y),a=h):(f=a,a=l);}else f=a,a=l;else f=a,a=l;return M[T]={nextPos:f,result:a},a}function Ki(){var a,h,y,v,b,T,L,V=f*49+30,se=M[V];if(se)return f=se.nextPos,se.result;for(a=f,h=[],y=wt();y!==i;)h.push(y),y=wt();if(h!==i)if(y=tn(),y!==i){for(v=[],b=wt();b!==i;)v.push(b),b=wt();if(v!==i)if(n.charCodeAt(f)===44?(b=pf,f++):(b=i,N===0&&j(df)),b!==i){for(T=[],L=wt();L!==i;)T.push(L),L=wt();T!==i?(X=a,h=hf(y),a=h):(f=a,a=l);}else f=a,a=l;else f=a,a=l;}else f=a,a=l;else f=a,a=l;return M[V]={nextPos:f,result:a},a}function wt(){var a,h=f*49+31,y=M[h];return y?(f=y.nextPos,y.result):(a=Q(),a===i&&(a=vt(),a===i&&(a=Vi())),M[h]={nextPos:f,result:a},a)}function Bx(){var a,h,y,v,b,T,L=f*49+32,V=M[L];if(V)return f=V.nextPos,V.result;if(a=f,n.charCodeAt(f)===123?(h=DE,f++):(h=i,N===0&&j(NE)),h!==i){for(y=[],v=Q();v!==i;)y.push(v),v=Q();if(y!==i){for(v=[],b=Wf();b!==i;)v.push(b),b=Wf();if(v!==i){for(b=[],T=Q();T!==i;)b.push(T),T=Q();b!==i?(n.charCodeAt(f)===125?(T=ME,f++):(T=i,N===0&&j(UE)),T!==i?(X=a,h=jE(v),a=h):(f=a,a=l)):(f=a,a=l);}else f=a,a=l;}else f=a,a=l;}else f=a,a=l;return M[L]={nextPos:f,result:a},a}function Wf(){var a,h,y,v,b,T,L,V,se,ye,pe,Ee=f*49+33,Ce=M[Ee];if(Ce)return f=Ce.nextPos,Ce.result;for(a=f,h=[],y=Q();y!==i;)h.push(y),y=Q();if(h!==i)if(y=Kn(),y!==i){for(v=[],b=Q();b!==i;)v.push(b),b=Q();if(v!==i)if(n.charCodeAt(f)===61?(b=U,f++):(b=i,N===0&&j(C)),b!==i){for(T=[],L=Q();L!==i;)T.push(L),L=Q();if(T!==i)if(L=tn(),L!==i){for(V=[],se=Q();se!==i;)V.push(se),se=Q();if(V!==i)if(n.charCodeAt(f)===44?(se=pf,f++):(se=i,N===0&&j(df)),se!==i){for(ye=[],pe=Q();pe!==i;)ye.push(pe),pe=Q();ye!==i?(X=a,h=yf(y,L),a=h):(f=a,a=l);}else f=a,a=l;else f=a,a=l;}else f=a,a=l;else f=a,a=l;}else f=a,a=l;else f=a,a=l;}else f=a,a=l;else f=a,a=l;if(a===i){for(a=f,h=[],y=Q();y!==i;)h.push(y),y=Q();if(h!==i)if(y=Kn(),y!==i){for(v=[],b=Q();b!==i;)v.push(b),b=Q();if(v!==i)if(n.charCodeAt(f)===61?(b=U,f++):(b=i,N===0&&j(C)),b!==i){for(T=[],L=Q();L!==i;)T.push(L),L=Q();T!==i?(L=tn(),L!==i?(X=a,h=yf(y,L),a=h):(f=a,a=l)):(f=a,a=l);}else f=a,a=l;else f=a,a=l;}else f=a,a=l;else f=a,a=l;}return M[Ee]={nextPos:f,result:a},a}function zf(){var a,h,y,v=f*49+34,b=M[v];return b?(f=b.nextPos,b.result):(a=f,n.charCodeAt(f)===46?(h=B,f++):(h=i,N===0&&j(k)),h!==i?(y=Yn(),y!==i?(X=a,h=HE(y),a=h):(f=a,a=l)):(f=a,a=l),M[v]={nextPos:f,result:a},a)}function Gf(){var a,h,y,v,b,T,L,V,se,ye,pe,Ee,Ce=f*49+35,ut=M[Ce];return ut?(f=ut.nextPos,ut.result):(a=f,h=f,y=de(),y!==i?(v=de(),v!==i?(b=de(),b!==i?(T=de(),T!==i?(n.charCodeAt(f)===45?(L=Hn,f++):(L=i,N===0&&j(Wn)),L!==i?(V=de(),V!==i?(se=de(),se!==i?(n.charCodeAt(f)===45?(ye=Hn,f++):(ye=i,N===0&&j(Wn)),ye!==i?(pe=de(),pe!==i?(Ee=de(),Ee!==i?(y=[y,v,b,T,L,V,se,ye,pe,Ee],h=y):(f=h,h=l)):(f=h,h=l)):(f=h,h=l)):(f=h,h=l)):(f=h,h=l)):(f=h,h=l)):(f=h,h=l)):(f=h,h=l)):(f=h,h=l)):(f=h,h=l),h!==i&&(X=a,h=WE(h)),a=h,M[Ce]={nextPos:f,result:a},a)}function Dx(){var a,h,y,v,b,T,L,V,se,ye,pe,Ee=f*49+36,Ce=M[Ee];return Ce?(f=Ce.nextPos,Ce.result):(a=f,h=f,y=de(),y!==i?(v=de(),v!==i?(n.charCodeAt(f)===58?(b=zn,f++):(b=i,N===0&&j(Gn)),b!==i?(T=de(),T!==i?(L=de(),L!==i?(n.charCodeAt(f)===58?(V=zn,f++):(V=i,N===0&&j(Gn)),V!==i?(se=de(),se!==i?(ye=de(),ye!==i?(pe=zf(),pe===i&&(pe=re),pe!==i?(y=[y,v,b,T,L,V,se,ye,pe],h=y):(f=h,h=l)):(f=h,h=l)):(f=h,h=l)):(f=h,h=l)):(f=h,h=l)):(f=h,h=l)):(f=h,h=l)):(f=h,h=l)):(f=h,h=l),h!==i&&(X=a,h=gf(h)),a=h,M[Ee]={nextPos:f,result:a},a)}function Nx(){var a,h,y,v,b,T,L,V,se,ye,pe,Ee,Ce,ut,rn,ur,lt,Xf=f*49+37,ia=M[Xf];return ia?(f=ia.nextPos,ia.result):(a=f,h=f,y=de(),y!==i?(v=de(),v!==i?(n.charCodeAt(f)===58?(b=zn,f++):(b=i,N===0&&j(Gn)),b!==i?(T=de(),T!==i?(L=de(),L!==i?(n.charCodeAt(f)===58?(V=zn,f++):(V=i,N===0&&j(Gn)),V!==i?(se=de(),se!==i?(ye=de(),ye!==i?(pe=zf(),pe===i&&(pe=re),pe!==i?(n.charCodeAt(f)===45?(Ee=Hn,f++):(Ee=i,N===0&&j(Wn)),Ee===i&&(n.charCodeAt(f)===43?(Ee=Tr,f++):(Ee=i,N===0&&j(ar))),Ee!==i?(Ce=de(),Ce!==i?(ut=de(),ut!==i?(n.charCodeAt(f)===58?(rn=zn,f++):(rn=i,N===0&&j(Gn)),rn!==i?(ur=de(),ur!==i?(lt=de(),lt!==i?(y=[y,v,b,T,L,V,se,ye,pe,Ee,Ce,ut,rn,ur,lt],h=y):(f=h,h=l)):(f=h,h=l)):(f=h,h=l)):(f=h,h=l)):(f=h,h=l)):(f=h,h=l)):(f=h,h=l)):(f=h,h=l)):(f=h,h=l)):(f=h,h=l)):(f=h,h=l)):(f=h,h=l)):(f=h,h=l)):(f=h,h=l)):(f=h,h=l),h!==i&&(X=a,h=gf(h)),a=h,M[Xf]={nextPos:f,result:a},a)}function Mx(){var a,h,y,v,b,T=f*49+38,L=M[T];return L?(f=L.nextPos,L.result):(a=f,h=Gf(),h!==i?(n.charCodeAt(f)===84?(y=mf,f++):(y=i,N===0&&j(wf)),y!==i?(v=Dx(),v!==i?(n.charCodeAt(f)===90?(b=zE,f++):(b=i,N===0&&j(GE)),b!==i?(X=a,h=VE(h,v),a=h):(f=a,a=l)):(f=a,a=l)):(f=a,a=l)):(f=a,a=l),a===i&&(a=f,h=Gf(),h!==i?(n.charCodeAt(f)===84?(y=mf,f++):(y=i,N===0&&j(wf)),y!==i?(v=Nx(),v!==i?(X=a,h=KE(h,v),a=h):(f=a,a=l)):(f=a,a=l)):(f=a,a=l)),M[T]={nextPos:f,result:a},a)}function Q(){var a,h=f*49+39,y=M[h];return y?(f=y.nextPos,y.result):(YE.test(n.charAt(f))?(a=n.charAt(f),f++):(a=i,N===0&&j(JE)),M[h]={nextPos:f,result:a},a)}function vt(){var a,h,y,v=f*49+40,b=M[v];return b?(f=b.nextPos,b.result):(n.charCodeAt(f)===10?(a=vf,f++):(a=i,N===0&&j(Sf)),a===i&&(a=f,n.charCodeAt(f)===13?(h=XE,f++):(h=i,N===0&&j(QE)),h!==i?(n.charCodeAt(f)===10?(y=vf,f++):(y=i,N===0&&j(Sf)),y!==i?(h=[h,y],a=h):(f=a,a=l)):(f=a,a=l)),M[v]={nextPos:f,result:a},a)}function Vf(){var a,h=f*49+41,y=M[h];return y?(f=y.nextPos,y.result):(a=vt(),a===i&&(a=Q()),M[h]={nextPos:f,result:a},a)}function Yi(){var a,h,y=f*49+42,v=M[y];return v?(f=v.nextPos,v.result):(a=f,N++,n.length>f?(h=n.charAt(f),f++):(h=i,N===0&&j(w)),N--,h===i?a=m:(f=a,a=l),M[y]={nextPos:f,result:a},a)}function St(){var a,h=f*49+43,y=M[h];return y?(f=y.nextPos,y.result):(ZE.test(n.charAt(f))?(a=n.charAt(f),f++):(a=i,N===0&&j(ex)),M[h]={nextPos:f,result:a},a)}function de(){var a,h,y=f*49+44,v=M[y];return v?(f=v.nextPos,v.result):(tx.test(n.charAt(f))?(a=n.charAt(f),f++):(a=i,N===0&&j(rx)),a===i&&(a=f,n.charCodeAt(f)===95?(h=nx,f++):(h=i,N===0&&j(ix)),h!==i&&(X=a,h=sx()),a=h),M[y]={nextPos:f,result:a},a)}function Kf(){var a,h=f*49+45,y=M[h];return y?(f=y.nextPos,y.result):(ox.test(n.charAt(f))?(a=n.charAt(f),f++):(a=i,N===0&&j(ax)),M[h]={nextPos:f,result:a},a)}function Yn(){var a,h,y,v=f*49+46,b=M[v];if(b)return f=b.nextPos,b.result;if(a=f,h=[],y=de(),y!==i)for(;y!==i;)h.push(y),y=de();else h=l;return h!==i&&(X=a,h=ux(h)),a=h,M[v]={nextPos:f,result:a},a}function Yf(){var a,h,y=f*49+47,v=M[y];return v?(f=v.nextPos,v.result):(a=f,n.substr(f,2)===bf?(h=bf,f+=2):(h=i,N===0&&j(lx)),h!==i&&(X=a,h=cx()),a=h,a===i&&(a=f,n.substr(f,2)===Ef?(h=Ef,f+=2):(h=i,N===0&&j(fx)),h!==i&&(X=a,h=hx()),a=h,a===i&&(a=f,n.substr(f,2)===xf?(h=xf,f+=2):(h=i,N===0&&j(px)),h!==i&&(X=a,h=dx()),a=h,a===i&&(a=f,n.substr(f,2)===Af?(h=Af,f+=2):(h=i,N===0&&j(yx)),h!==i&&(X=a,h=gx()),a=h,a===i&&(a=f,n.substr(f,2)===_f?(h=_f,f+=2):(h=i,N===0&&j(mx)),h!==i&&(X=a,h=wx()),a=h,a===i&&(a=f,n.substr(f,2)===Cf?(h=Cf,f+=2):(h=i,N===0&&j(vx)),h!==i&&(X=a,h=Sx()),a=h,a===i&&(a=f,n.substr(f,2)===Rf?(h=Rf,f+=2):(h=i,N===0&&j(bx)),h!==i&&(X=a,h=Ex()),a=h,a===i&&(a=Ux()))))))),M[y]={nextPos:f,result:a},a)}function Ux(){var a,h,y,v,b,T,L,V,se,ye,pe,Ee=f*49+48,Ce=M[Ee];return Ce?(f=Ce.nextPos,Ce.result):(a=f,n.substr(f,2)===Of?(h=Of,f+=2):(h=i,N===0&&j(xx)),h!==i?(y=f,v=St(),v!==i?(b=St(),b!==i?(T=St(),T!==i?(L=St(),L!==i?(V=St(),V!==i?(se=St(),se!==i?(ye=St(),ye!==i?(pe=St(),pe!==i?(v=[v,b,T,L,V,se,ye,pe],y=v):(f=y,y=l)):(f=y,y=l)):(f=y,y=l)):(f=y,y=l)):(f=y,y=l)):(f=y,y=l)):(f=y,y=l)):(f=y,y=l),y!==i?(X=a,h=Tf(y),a=h):(f=a,a=l)):(f=a,a=l),a===i&&(a=f,n.substr(f,2)===Pf?(h=Pf,f+=2):(h=i,N===0&&j(Ax)),h!==i?(y=f,v=St(),v!==i?(b=St(),b!==i?(T=St(),T!==i?(L=St(),L!==i?(v=[v,b,T,L],y=v):(f=y,y=l)):(f=y,y=l)):(f=y,y=l)):(f=y,y=l),y!==i?(X=a,h=Tf(y),a=h):(f=a,a=l)):(f=a,a=l)),M[Ee]={nextPos:f,result:a},a)}var Jf=[];function jx(a,h,y){var v=new Error(a);throw v.line=h,v.column=y,v}function na(a){Jf.push(a);}function je(a,h,y,v,b){var T={type:a,value:h,line:y(),column:v()};return b&&(T.key=b),T}function Hx(a,h,y){var v=parseInt("0x"+a);if(!isFinite(v)||Math.floor(v)!=v||v<0||v>1114111||v>55295&&v<57344)jx("Invalid Unicode escape code: "+a,h,y);else return Wx(v)}function Wx(){var a=16384,h=[],y,v,b=-1,T=arguments.length;if(!T)return "";for(var L="";++b<T;){var V=Number(arguments[b]);V<=65535?h.push(V):(V-=65536,y=(V>>10)+55296,v=V%1024+56320,h.push(y,v)),(b+1==T||h.length>a)&&(L+=String.fromCharCode.apply(null,h),h.length=0);}return L}if(Gi=u(),Gi!==i&&f===n.length)return Gi;throw Gi!==i&&f<n.length&&j({type:"end",description:"end of input"}),ea(null,Qo,zi)}return {SyntaxError:e,parse:r}}();});var Cv=_((lM,_v)=>{function VF(t){var e=[],r=[],n="",s=Object.create(null),i=s;return u(t);function u(x){for(var O,F=0;F<x.length;F++)switch(O=x[F],O.type){case"Assign":p(O);break;case"ObjectPath":m(O);break;case"ArrayPath":w(O);break}return s}function c(x,O,F){var q=new Error(x);throw q.line=O,q.column=F,q}function p(x){var O=x.key,F=x.value,q=x.line,W=x.column,H;n?H=n+"."+O:H=O,typeof i[O]<"u"&&c("Cannot redefine existing key '"+H+"'.",q,W),i[O]=d(F),l(H)||(e.push(H),r.push(H));}function l(x){return e.indexOf(x)!==-1}function d(x){return x.type==="Array"?A(x.value):x.type==="InlineTable"?g(x.value):x.value}function g(x){for(var O=Object.create(null),F=0;F<x.length;F++){var q=x[F];q.value.type==="InlineTable"?O[q.key]=g(q.value.value):q.type==="InlineTableValue"&&(O[q.key]=d(q.value));}return O}function m(x){var O=x.value,F=O.map(R).join("."),q=x.line,W=x.column;l(F)&&c("Cannot redefine existing key '"+O+"'.",q,W),e.push(F),i=E(s,O,Object.create(null),q,W),n=O;}function w(x){var O=x.value,F=O.map(R).join("."),q=x.line,W=x.column;if(l(F)||e.push(F),e=e.filter(function(B){return B.indexOf(F)!==0}),e.push(F),i=E(s,O,[],q,W),n=F,i instanceof Array){var H=Object.create(null);i.push(H),i=H;}else c("Cannot redefine existing key '"+O+"'.",q,W);}function E(x,O,F,q,W){for(var H=[],B="",k=O.join("."),U=x,C=0;C<O.length;C++){var Y=O[C];H.push(Y),B=H.join("."),typeof U[Y]>"u"?C===O.length-1?U[Y]=F:U[Y]=Object.create(null):C!==O.length-1&&r.indexOf(B)>-1&&c("Cannot redefine existing key '"+B+"'.",q,W),U=U[Y],U instanceof Array&&U.length&&C<O.length-1&&(U=U[U.length-1]);}return U}function A(x){for(var O=null,F=0;F<x.length;F++){var q=x[F];O===null?O=q.type:q.type!==O&&c("Cannot add value of type "+q.type+" to array of type "+O+".",q.line,q.column);}return x.map(d)}function R(x){return x.indexOf(".")>-1?'"'+x+'"':x}}_v.exports={compile:VF};});var Ov=_((cM,Rv)=>{var KF=Av(),YF=Cv();Rv.exports={parse:function(t){var e=KF.parse(t.toString());return YF.compile(e)}};});var Si=_((fM,Fv)=>{var JF=G("path"),jt="\\\\/",Tv=`[^${jt}]`,Qt="\\.",XF="\\+",QF="\\?",go="\\/",ZF="(?=.)",Pv="[^/]",Bl=`(?:${go}|$)`,Iv=`(?:^|${go})`,Dl=`${Qt}{1,2}${Bl}`,ek=`(?!${Qt})`,tk=`(?!${Iv}${Dl})`,rk=`(?!${Qt}{0,1}${Bl})`,nk=`(?!${Dl})`,ik=`[^.${go}]`,sk=`${Pv}*?`,$v={DOT_LITERAL:Qt,PLUS_LITERAL:XF,QMARK_LITERAL:QF,SLASH_LITERAL:go,ONE_CHAR:ZF,QMARK:Pv,END_ANCHOR:Bl,DOTS_SLASH:Dl,NO_DOT:ek,NO_DOTS:tk,NO_DOT_SLASH:rk,NO_DOTS_SLASH:nk,QMARK_NO_DOT:ik,STAR:sk,START_ANCHOR:Iv},ok={...$v,SLASH_LITERAL:`[${jt}]`,QMARK:Tv,STAR:`${Tv}*?`,DOTS_SLASH:`${Qt}{1,2}(?:[${jt}]|$)`,NO_DOT:`(?!${Qt})`,NO_DOTS:`(?!(?:^|[${jt}])${Qt}{1,2}(?:[${jt}]|$))`,NO_DOT_SLASH:`(?!${Qt}{0,1}(?:[${jt}]|$))`,NO_DOTS_SLASH:`(?!${Qt}{1,2}(?:[${jt}]|$))`,QMARK_NO_DOT:`[^.${jt}]`,START_ANCHOR:`(?:^|[${jt}])`,END_ANCHOR:`(?:[${jt}]|$)`},ak={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};Fv.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:ak,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:JF.sep,extglobChars(t){return {"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?ok:$v}};});var mo=_(st=>{var uk=G("path"),lk=process.platform==="win32",{REGEX_BACKSLASH:ck,REGEX_REMOVE_BACKSLASH:fk,REGEX_SPECIAL_CHARS:hk,REGEX_SPECIAL_CHARS_GLOBAL:pk}=Si();st.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);st.hasRegexChars=t=>hk.test(t);st.isRegexChar=t=>t.length===1&&st.hasRegexChars(t);st.escapeRegex=t=>t.replace(pk,"\\$1");st.toPosixSlashes=t=>t.replace(ck,"/");st.removeBackslashes=t=>t.replace(fk,e=>e==="\\"?"":e);st.supportsLookbehinds=()=>{let t=process.version.slice(1).split(".").map(Number);return t.length===3&&t[0]>=9||t[0]===8&&t[1]>=10};st.isWindows=t=>t&&typeof t.windows=="boolean"?t.windows:lk===!0||uk.sep==="\\";st.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?st.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};st.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};st.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",s=r.contains?"":"$",i=`${n}(?:${t})${s}`;return e.negated===!0&&(i=`(?:^(?!${i}).*$)`),i};});var Uv=_((pM,Mv)=>{var kv=mo(),{CHAR_ASTERISK:Nl,CHAR_AT:dk,CHAR_BACKWARD_SLASH:bi,CHAR_COMMA:yk,CHAR_DOT:Ml,CHAR_EXCLAMATION_MARK:Ul,CHAR_FORWARD_SLASH:Nv,CHAR_LEFT_CURLY_BRACE:jl,CHAR_LEFT_PARENTHESES:Hl,CHAR_LEFT_SQUARE_BRACKET:gk,CHAR_PLUS:mk,CHAR_QUESTION_MARK:Lv,CHAR_RIGHT_CURLY_BRACE:wk,CHAR_RIGHT_PARENTHESES:qv,CHAR_RIGHT_SQUARE_BRACKET:vk}=Si(),Bv=t=>t===Nv||t===bi,Dv=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1);},Sk=(t,e)=>{let r=e||{},n=t.length-1,s=r.parts===!0||r.scanToEnd===!0,i=[],o=[],u=[],c=t,p=-1,l=0,d=0,g=!1,m=!1,w=!1,E=!1,A=!1,R=!1,x=!1,O=!1,F=!1,q=!1,W=0,H,B,k={value:"",depth:0,isGlob:!1},U=()=>p>=n,C=()=>c.charCodeAt(p+1),Y=()=>(H=B,c.charCodeAt(++p));for(;p<n;){B=Y();let re;if(B===bi){x=k.backslashes=!0,B=Y(),B===jl&&(R=!0);continue}if(R===!0||B===jl){for(W++;U()!==!0&&(B=Y());){if(B===bi){x=k.backslashes=!0,Y();continue}if(B===jl){W++;continue}if(R!==!0&&B===Ml&&(B=Y())===Ml){if(g=k.isBrace=!0,w=k.isGlob=!0,q=!0,s===!0)continue;break}if(R!==!0&&B===yk){if(g=k.isBrace=!0,w=k.isGlob=!0,q=!0,s===!0)continue;break}if(B===wk&&(W--,W===0)){R=!1,g=k.isBrace=!0,q=!0;break}}if(s===!0)continue;break}if(B===Nv){if(i.push(p),o.push(k),k={value:"",depth:0,isGlob:!1},q===!0)continue;if(H===Ml&&p===l+1){l+=2;continue}d=p+1;continue}if(r.noext!==!0&&(B===mk||B===dk||B===Nl||B===Lv||B===Ul)===!0&&C()===Hl){if(w=k.isGlob=!0,E=k.isExtglob=!0,q=!0,B===Ul&&p===l&&(F=!0),s===!0){for(;U()!==!0&&(B=Y());){if(B===bi){x=k.backslashes=!0,B=Y();continue}if(B===qv){w=k.isGlob=!0,q=!0;break}}continue}break}if(B===Nl){if(H===Nl&&(A=k.isGlobstar=!0),w=k.isGlob=!0,q=!0,s===!0)continue;break}if(B===Lv){if(w=k.isGlob=!0,q=!0,s===!0)continue;break}if(B===gk){for(;U()!==!0&&(re=Y());){if(re===bi){x=k.backslashes=!0,Y();continue}if(re===vk){m=k.isBracket=!0,w=k.isGlob=!0,q=!0;break}}if(s===!0)continue;break}if(r.nonegate!==!0&&B===Ul&&p===l){O=k.negated=!0,l++;continue}if(r.noparen!==!0&&B===Hl){if(w=k.isGlob=!0,s===!0){for(;U()!==!0&&(B=Y());){if(B===Hl){x=k.backslashes=!0,B=Y();continue}if(B===qv){q=!0;break}}continue}break}if(w===!0){if(q=!0,s===!0)continue;break}}r.noext===!0&&(E=!1,w=!1);let J=c,oe="",P="";l>0&&(oe=c.slice(0,l),c=c.slice(l),d-=l),J&&w===!0&&d>0?(J=c.slice(0,d),P=c.slice(d)):w===!0?(J="",P=c):J=c,J&&J!==""&&J!=="/"&&J!==c&&Bv(J.charCodeAt(J.length-1))&&(J=J.slice(0,-1)),r.unescape===!0&&(P&&(P=kv.removeBackslashes(P)),J&&x===!0&&(J=kv.removeBackslashes(J)));let I={prefix:oe,input:t,start:l,base:J,glob:P,isBrace:g,isBracket:m,isGlob:w,isExtglob:E,isGlobstar:A,negated:O,negatedExtglob:F};if(r.tokens===!0&&(I.maxDepth=0,Bv(B)||o.push(k),I.tokens=o),r.parts===!0||r.tokens===!0){let re;for(let Z=0;Z<i.length;Z++){let ce=re?re+1:l,Ke=i[Z],Te=t.slice(ce,Ke);r.tokens&&(Z===0&&l!==0?(o[Z].isPrefix=!0,o[Z].value=oe):o[Z].value=Te,Dv(o[Z]),I.maxDepth+=o[Z].depth),(Z!==0||Te!=="")&&u.push(Te),re=Ke;}if(re&&re+1<t.length){let Z=t.slice(re+1);u.push(Z),r.tokens&&(o[o.length-1].value=Z,Dv(o[o.length-1]),I.maxDepth+=o[o.length-1].depth);}I.slashes=i,I.parts=u;}return I};Mv.exports=Sk;});var Wv=_((dM,Hv)=>{var wo=Si(),ht=mo(),{MAX_LENGTH:vo,POSIX_REGEX_SOURCE:bk,REGEX_NON_SPECIAL_CHARS:Ek,REGEX_SPECIAL_CHARS_BACKREF:xk,REPLACEMENTS:jv}=wo,Ak=(t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let r=`[${t.join("-")}]`;return r},_n=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,Wl=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=jv[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min(vo,r.maxLength):vo,s=t.length;if(s>n)throw new SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${n}`);let i={type:"bos",value:"",output:r.prepend||""},o=[i],u=r.capture?"":"?:",c=ht.isWindows(e),p=wo.globChars(c),l=wo.extglobChars(p),{DOT_LITERAL:d,PLUS_LITERAL:g,SLASH_LITERAL:m,ONE_CHAR:w,DOTS_SLASH:E,NO_DOT:A,NO_DOT_SLASH:R,NO_DOTS_SLASH:x,QMARK:O,QMARK_NO_DOT:F,STAR:q,START_ANCHOR:W}=p,H=K=>`(${u}(?:(?!${W}${K.dot?E:d}).)*?)`,B=r.dot?"":A,k=r.dot?O:F,U=r.bash===!0?H(r):q;r.capture&&(U=`(${U})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let C={input:t,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:o};t=ht.removePrefix(t,C),s=t.length;let Y=[],J=[],oe=[],P=i,I,re=()=>C.index===s-1,Z=C.peek=(K=1)=>t[C.index+K],ce=C.advance=()=>t[++C.index]||"",Ke=()=>t.slice(C.index+1),Te=(K="",me=0)=>{C.consumed+=K,C.index+=me;},sr=K=>{C.output+=K.output!=null?K.output:K.value,Te(K.value);},jn=()=>{let K=1;for(;Z()==="!"&&(Z(2)!=="("||Z(3)==="?");)ce(),C.start++,K++;return K%2===0?!1:(C.negated=!0,C.start++,!0)},or=K=>{C[K]++,oe.push(K);},_t=K=>{C[K]--,oe.pop();},fe=K=>{if(P.type==="globstar"){let me=C.braces>0&&(K.type==="comma"||K.type==="brace"),z=K.extglob===!0||Y.length&&(K.type==="pipe"||K.type==="paren");K.type!=="slash"&&K.type!=="paren"&&!me&&!z&&(C.output=C.output.slice(0,-P.output.length),P.type="star",P.value="*",P.output=U,C.output+=P.output);}if(Y.length&&K.type!=="paren"&&(Y[Y.length-1].inner+=K.value),(K.value||K.output)&&sr(K),P&&P.type==="text"&&K.type==="text"){P.value+=K.value,P.output=(P.output||"")+K.value;return}K.prev=P,o.push(K),P=K;},en=(K,me)=>{let z={...l[me],conditions:1,inner:""};z.prev=P,z.parens=C.parens,z.output=C.output;let le=(r.capture?"(":"")+z.open;or("parens"),fe({type:K,value:me,output:C.output?"":w}),fe({type:"paren",extglob:!0,value:ce(),output:le}),Y.push(z);},Jo=K=>{let me=K.close+(r.capture?")":""),z;if(K.type==="negate"){let le=U;if(K.inner&&K.inner.length>1&&K.inner.includes("/")&&(le=H(r)),(le!==U||re()||/^\)+$/.test(Ke()))&&(me=K.close=`)$))${le}`),K.inner.includes("*")&&(z=Ke())&&/^\.[^\\/.]+$/.test(z)){let ve=Wl(z,{...e,fastpaths:!1}).output;me=K.close=`)${ve})${le})`;}K.prev.type==="bos"&&(C.negatedExtglob=!0);}fe({type:"paren",extglob:!0,value:I,output:me}),_t("parens");};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let K=!1,me=t.replace(xk,(z,le,ve,Ne,_e,Tr)=>Ne==="\\"?(K=!0,z):Ne==="?"?le?le+Ne+(_e?O.repeat(_e.length):""):Tr===0?k+(_e?O.repeat(_e.length):""):O.repeat(ve.length):Ne==="."?d.repeat(ve.length):Ne==="*"?le?le+Ne+(_e?U:""):U:le?z:`\\${z}`);return K===!0&&(r.unescape===!0?me=me.replace(/\\/g,""):me=me.replace(/\\+/g,z=>z.length%2===0?"\\\\":z?"\\":"")),me===t&&r.contains===!0?(C.output=t,C):(C.output=ht.wrapOutput(me,C,e),C)}for(;!re();){if(I=ce(),I==="\0")continue;if(I==="\\"){let z=Z();if(z==="/"&&r.bash!==!0||z==="."||z===";")continue;if(!z){I+="\\",fe({type:"text",value:I});continue}let le=/^\\+/.exec(Ke()),ve=0;if(le&&le[0].length>2&&(ve=le[0].length,C.index+=ve,ve%2!==0&&(I+="\\")),r.unescape===!0?I=ce():I+=ce(),C.brackets===0){fe({type:"text",value:I});continue}}if(C.brackets>0&&(I!=="]"||P.value==="["||P.value==="[^")){if(r.posix!==!1&&I===":"){let z=P.value.slice(1);if(z.includes("[")&&(P.posix=!0,z.includes(":"))){let le=P.value.lastIndexOf("["),ve=P.value.slice(0,le),Ne=P.value.slice(le+2),_e=bk[Ne];if(_e){P.value=ve+_e,C.backtrack=!0,ce(),!i.output&&o.indexOf(P)===1&&(i.output=w);continue}}}(I==="["&&Z()!==":"||I==="-"&&Z()==="]")&&(I=`\\${I}`),I==="]"&&(P.value==="["||P.value==="[^")&&(I=`\\${I}`),r.posix===!0&&I==="!"&&P.value==="["&&(I="^"),P.value+=I,sr({value:I});continue}if(C.quotes===1&&I!=='"'){I=ht.escapeRegex(I),P.value+=I,sr({value:I});continue}if(I==='"'){C.quotes=C.quotes===1?0:1,r.keepQuotes===!0&&fe({type:"text",value:I});continue}if(I==="("){or("parens"),fe({type:"paren",value:I});continue}if(I===")"){if(C.parens===0&&r.strictBrackets===!0)throw new SyntaxError(_n("opening","("));let z=Y[Y.length-1];if(z&&C.parens===z.parens+1){Jo(Y.pop());continue}fe({type:"paren",value:I,output:C.parens?")":"\\)"}),_t("parens");continue}if(I==="["){if(r.nobracket===!0||!Ke().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(_n("closing","]"));I=`\\${I}`;}else or("brackets");fe({type:"bracket",value:I});continue}if(I==="]"){if(r.nobracket===!0||P&&P.type==="bracket"&&P.value.length===1){fe({type:"text",value:I,output:`\\${I}`});continue}if(C.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(_n("opening","["));fe({type:"text",value:I,output:`\\${I}`});continue}_t("brackets");let z=P.value.slice(1);if(P.posix!==!0&&z[0]==="^"&&!z.includes("/")&&(I=`/${I}`),P.value+=I,sr({value:I}),r.literalBrackets===!1||ht.hasRegexChars(z))continue;let le=ht.escapeRegex(P.value);if(C.output=C.output.slice(0,-P.value.length),r.literalBrackets===!0){C.output+=le,P.value=le;continue}P.value=`(${u}${le}|${P.value})`,C.output+=P.value;continue}if(I==="{"&&r.nobrace!==!0){or("braces");let z={type:"brace",value:I,output:"(",outputIndex:C.output.length,tokensIndex:C.tokens.length};J.push(z),fe(z);continue}if(I==="}"){let z=J[J.length-1];if(r.nobrace===!0||!z){fe({type:"text",value:I,output:I});continue}let le=")";if(z.dots===!0){let ve=o.slice(),Ne=[];for(let _e=ve.length-1;_e>=0&&(o.pop(),ve[_e].type!=="brace");_e--)ve[_e].type!=="dots"&&Ne.unshift(ve[_e].value);le=Ak(Ne,r),C.backtrack=!0;}if(z.comma!==!0&&z.dots!==!0){let ve=C.output.slice(0,z.outputIndex),Ne=C.tokens.slice(z.tokensIndex);z.value=z.output="\\{",I=le="\\}",C.output=ve;for(let _e of Ne)C.output+=_e.output||_e.value;}fe({type:"brace",value:I,output:le}),_t("braces"),J.pop();continue}if(I==="|"){Y.length>0&&Y[Y.length-1].conditions++,fe({type:"text",value:I});continue}if(I===","){let z=I,le=J[J.length-1];le&&oe[oe.length-1]==="braces"&&(le.comma=!0,z="|"),fe({type:"comma",value:I,output:z});continue}if(I==="/"){if(P.type==="dot"&&C.index===C.start+1){C.start=C.index+1,C.consumed="",C.output="",o.pop(),P=i;continue}fe({type:"slash",value:I,output:m});continue}if(I==="."){if(C.braces>0&&P.type==="dot"){P.value==="."&&(P.output=d);let z=J[J.length-1];P.type="dots",P.output+=I,P.value+=I,z.dots=!0;continue}if(C.braces+C.parens===0&&P.type!=="bos"&&P.type!=="slash"){fe({type:"text",value:I,output:d});continue}fe({type:"dot",value:I,output:d});continue}if(I==="?"){if(!(P&&P.value==="(")&&r.noextglob!==!0&&Z()==="("&&Z(2)!=="?"){en("qmark",I);continue}if(P&&P.type==="paren"){let le=Z(),ve=I;if(le==="<"&&!ht.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(P.value==="("&&!/[!=<:]/.test(le)||le==="<"&&!/<([!=]|\w+>)/.test(Ke()))&&(ve=`\\${I}`),fe({type:"text",value:I,output:ve});continue}if(r.dot!==!0&&(P.type==="slash"||P.type==="bos")){fe({type:"qmark",value:I,output:F});continue}fe({type:"qmark",value:I,output:O});continue}if(I==="!"){if(r.noextglob!==!0&&Z()==="("&&(Z(2)!=="?"||!/[!=<:]/.test(Z(3)))){en("negate",I);continue}if(r.nonegate!==!0&&C.index===0){jn();continue}}if(I==="+"){if(r.noextglob!==!0&&Z()==="("&&Z(2)!=="?"){en("plus",I);continue}if(P&&P.value==="("||r.regex===!1){fe({type:"plus",value:I,output:g});continue}if(P&&(P.type==="bracket"||P.type==="paren"||P.type==="brace")||C.parens>0){fe({type:"plus",value:I});continue}fe({type:"plus",value:g});continue}if(I==="@"){if(r.noextglob!==!0&&Z()==="("&&Z(2)!=="?"){fe({type:"at",extglob:!0,value:I,output:""});continue}fe({type:"text",value:I});continue}if(I!=="*"){(I==="$"||I==="^")&&(I=`\\${I}`);let z=Ek.exec(Ke());z&&(I+=z[0],C.index+=z[0].length),fe({type:"text",value:I});continue}if(P&&(P.type==="globstar"||P.star===!0)){P.type="star",P.star=!0,P.value+=I,P.output=U,C.backtrack=!0,C.globstar=!0,Te(I);continue}let K=Ke();if(r.noextglob!==!0&&/^\([^?]/.test(K)){en("star",I);continue}if(P.type==="star"){if(r.noglobstar===!0){Te(I);continue}let z=P.prev,le=z.prev,ve=z.type==="slash"||z.type==="bos",Ne=le&&(le.type==="star"||le.type==="globstar");if(r.bash===!0&&(!ve||K[0]&&K[0]!=="/")){fe({type:"star",value:I,output:""});continue}let _e=C.braces>0&&(z.type==="comma"||z.type==="brace"),Tr=Y.length&&(z.type==="pipe"||z.type==="paren");if(!ve&&z.type!=="paren"&&!_e&&!Tr){fe({type:"star",value:I,output:""});continue}for(;K.slice(0,3)==="/**";){let ar=t[C.index+4];if(ar&&ar!=="/")break;K=K.slice(3),Te("/**",3);}if(z.type==="bos"&&re()){P.type="globstar",P.value+=I,P.output=H(r),C.output=P.output,C.globstar=!0,Te(I);continue}if(z.type==="slash"&&z.prev.type!=="bos"&&!Ne&&re()){C.output=C.output.slice(0,-(z.output+P.output).length),z.output=`(?:${z.output}`,P.type="globstar",P.output=H(r)+(r.strictSlashes?")":"|$)"),P.value+=I,C.globstar=!0,C.output+=z.output+P.output,Te(I);continue}if(z.type==="slash"&&z.prev.type!=="bos"&&K[0]==="/"){let ar=K[1]!==void 0?"|$":"";C.output=C.output.slice(0,-(z.output+P.output).length),z.output=`(?:${z.output}`,P.type="globstar",P.output=`${H(r)}${m}|${m}${ar})`,P.value+=I,C.output+=z.output+P.output,C.globstar=!0,Te(I+ce()),fe({type:"slash",value:"/",output:""});continue}if(z.type==="bos"&&K[0]==="/"){P.type="globstar",P.value+=I,P.output=`(?:^|${m}|${H(r)}${m})`,C.output=P.output,C.globstar=!0,Te(I+ce()),fe({type:"slash",value:"/",output:""});continue}C.output=C.output.slice(0,-P.output.length),P.type="globstar",P.output=H(r),P.value+=I,C.output+=P.output,C.globstar=!0,Te(I);continue}let me={type:"star",value:I,output:U};if(r.bash===!0){me.output=".*?",(P.type==="bos"||P.type==="slash")&&(me.output=B+me.output),fe(me);continue}if(P&&(P.type==="bracket"||P.type==="paren")&&r.regex===!0){me.output=I,fe(me);continue}(C.index===C.start||P.type==="slash"||P.type==="dot")&&(P.type==="dot"?(C.output+=R,P.output+=R):r.dot===!0?(C.output+=x,P.output+=x):(C.output+=B,P.output+=B),Z()!=="*"&&(C.output+=w,P.output+=w)),fe(me);}for(;C.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(_n("closing","]"));C.output=ht.escapeLast(C.output,"["),_t("brackets");}for(;C.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(_n("closing",")"));C.output=ht.escapeLast(C.output,"("),_t("parens");}for(;C.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(_n("closing","}"));C.output=ht.escapeLast(C.output,"{"),_t("braces");}if(r.strictSlashes!==!0&&(P.type==="star"||P.type==="bracket")&&fe({type:"maybe_slash",value:"",output:`${m}?`}),C.backtrack===!0){C.output="";for(let K of C.tokens)C.output+=K.output!=null?K.output:K.value,K.suffix&&(C.output+=K.suffix);}return C};Wl.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min(vo,r.maxLength):vo,s=t.length;if(s>n)throw new SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${n}`);t=jv[t]||t;let i=ht.isWindows(e),{DOT_LITERAL:o,SLASH_LITERAL:u,ONE_CHAR:c,DOTS_SLASH:p,NO_DOT:l,NO_DOTS:d,NO_DOTS_SLASH:g,STAR:m,START_ANCHOR:w}=wo.globChars(i),E=r.dot?d:l,A=r.dot?g:l,R=r.capture?"":"?:",x={negated:!1,prefix:""},O=r.bash===!0?".*?":m;r.capture&&(O=`(${O})`);let F=B=>B.noglobstar===!0?O:`(${R}(?:(?!${w}${B.dot?p:o}).)*?)`,q=B=>{switch(B){case"*":return `${E}${c}${O}`;case".*":return `${o}${c}${O}`;case"*.*":return `${E}${O}${o}${c}${O}`;case"*/*":return `${E}${O}${u}${c}${A}${O}`;case"**":return E+F(r);case"**/*":return `(?:${E}${F(r)}${u})?${A}${c}${O}`;case"**/*.*":return `(?:${E}${F(r)}${u})?${A}${O}${o}${c}${O}`;case"**/.*":return `(?:${E}${F(r)}${u})?${o}${c}${O}`;default:{let k=/^(.*?)\.(\w+)$/.exec(B);if(!k)return;let U=q(k[1]);return U?U+o+k[2]:void 0}}},W=ht.removePrefix(t,x),H=q(W);return H&&r.strictSlashes!==!0&&(H+=`${u}?`),H};Hv.exports=Wl;});var Gv=_((yM,zv)=>{var _k=G("path"),Ck=Uv(),zl=Wv(),Gl=mo(),Rk=Si(),Ok=t=>t&&typeof t=="object"&&!Array.isArray(t),Oe=(t,e,r=!1)=>{if(Array.isArray(t)){let l=t.map(g=>Oe(g,e,r));return g=>{for(let m of l){let w=m(g);if(w)return w}return !1}}let n=Ok(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let s=e||{},i=Gl.isWindows(e),o=n?Oe.compileRe(t,e):Oe.makeRe(t,e,!1,!0),u=o.state;delete o.state;let c=()=>!1;if(s.ignore){let l={...e,ignore:null,onMatch:null,onResult:null};c=Oe(s.ignore,l,r);}let p=(l,d=!1)=>{let{isMatch:g,match:m,output:w}=Oe.test(l,o,e,{glob:t,posix:i}),E={glob:t,state:u,regex:o,posix:i,input:l,output:w,match:m,isMatch:g};return typeof s.onResult=="function"&&s.onResult(E),g===!1?(E.isMatch=!1,d?E:!1):c(l)?(typeof s.onIgnore=="function"&&s.onIgnore(E),E.isMatch=!1,d?E:!1):(typeof s.onMatch=="function"&&s.onMatch(E),d?E:!0)};return r&&(p.state=u),p};Oe.test=(t,e,r,{glob:n,posix:s}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return {isMatch:!1,output:""};let i=r||{},o=i.format||(s?Gl.toPosixSlashes:null),u=t===n,c=u&&o?o(t):t;return u===!1&&(c=o?o(t):t,u=c===n),(u===!1||i.capture===!0)&&(i.matchBase===!0||i.basename===!0?u=Oe.matchBase(t,e,r,s):u=e.exec(c)),{isMatch:!!u,match:u,output:c}};Oe.matchBase=(t,e,r,n=Gl.isWindows(r))=>(e instanceof RegExp?e:Oe.makeRe(e,r)).test(_k.basename(t));Oe.isMatch=(t,e,r)=>Oe(e,r)(t);Oe.parse=(t,e)=>Array.isArray(t)?t.map(r=>Oe.parse(r,e)):zl(t,{...e,fastpaths:!1});Oe.scan=(t,e)=>Ck(t,e);Oe.compileRe=(t,e,r=!1,n=!1)=>{if(r===!0)return t.output;let s=e||{},i=s.contains?"":"^",o=s.contains?"":"$",u=`${i}(?:${t.output})${o}`;t&&t.negated===!0&&(u=`^(?!${u}).*$`);let c=Oe.toRegex(u,e);return n===!0&&(c.state=t),c};Oe.makeRe=(t,e={},r=!1,n=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let s={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(s.output=zl.fastpaths(t,e)),s.output||(s=zl(t,e)),Oe.compileRe(s,e,r,n)};Oe.toRegex=(t,e)=>{try{let r=e||{};return new RegExp(t,r.flags||(r.nocase?"i":""))}catch(r){if(e&&e.debug===!0)throw r;return /$^/}};Oe.constants=Rk;zv.exports=Oe;});var Vl=_((gM,Vv)=>{Vv.exports=Gv();});var tS=_((mM,eS)=>{var xi=G("fs"),{Readable:Tk}=G("stream"),Ei=G("path"),{promisify:xo}=G("util"),Kl=Vl(),Pk=xo(xi.readdir),Ik=xo(xi.stat),Kv=xo(xi.lstat),$k=xo(xi.realpath),Fk="!",Qv="READDIRP_RECURSIVE_ERROR",kk=new Set(["ENOENT","EPERM","EACCES","ELOOP",Qv]),Yl="files",Zv="directories",bo="files_directories",So="all",Yv=[Yl,Zv,bo,So],Lk=t=>kk.has(t.code),[Jv,qk]=process.versions.node.split(".").slice(0,2).map(t=>Number.parseInt(t,10)),Bk=process.platform==="win32"&&(Jv>10||Jv===10&&qk>=5),Xv=t=>{if(t!==void 0){if(typeof t=="function")return t;if(typeof t=="string"){let e=Kl(t.trim());return r=>e(r.basename)}if(Array.isArray(t)){let e=[],r=[];for(let n of t){let s=n.trim();s.charAt(0)===Fk?r.push(Kl(s.slice(1))):e.push(Kl(s));}return r.length>0?e.length>0?n=>e.some(s=>s(n.basename))&&!r.some(s=>s(n.basename)):n=>!r.some(s=>s(n.basename)):n=>e.some(s=>s(n.basename))}}},Eo=class t extends Tk{static get defaultOptions(){return {root:".",fileFilter:e=>!0,directoryFilter:e=>!0,type:Yl,lstat:!1,depth:2147483648,alwaysStat:!1}}constructor(e={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:e.highWaterMark||4096});let r={...t.defaultOptions,...e},{root:n,type:s}=r;this._fileFilter=Xv(r.fileFilter),this._directoryFilter=Xv(r.directoryFilter);let i=r.lstat?Kv:Ik;Bk?this._stat=o=>i(o,{bigint:!0}):this._stat=i,this._maxDepth=r.depth,this._wantsDir=[Zv,bo,So].includes(s),this._wantsFile=[Yl,bo,So].includes(s),this._wantsEverything=s===So,this._root=Ei.resolve(n),this._isDirent="Dirent"in xi&&!r.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent},this.parents=[this._exploreDir(n,1)],this.reading=!1,this.parent=void 0;}async _read(e){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&e>0;){let{path:r,depth:n,files:s=[]}=this.parent||{};if(s.length>0){let i=s.splice(0,e).map(o=>this._formatEntry(o,r));for(let o of await Promise.all(i)){if(this.destroyed)return;let u=await this._getEntryType(o);u==="directory"&&this._directoryFilter(o)?(n<=this._maxDepth&&this.parents.push(this._exploreDir(o.fullPath,n+1)),this._wantsDir&&(this.push(o),e--)):(u==="file"||this._includeAsFile(o))&&this._fileFilter(o)&&this._wantsFile&&(this.push(o),e--);}}else {let i=this.parents.pop();if(!i){this.push(null);break}if(this.parent=await i,this.destroyed)return}}}catch(r){this.destroy(r);}finally{this.reading=!1;}}}async _exploreDir(e,r){let n;try{n=await Pk(e,this._rdOptions);}catch(s){this._onError(s);}return {files:n,depth:r,path:e}}async _formatEntry(e,r){let n;try{let s=this._isDirent?e.name:e,i=Ei.resolve(Ei.join(r,s));n={path:Ei.relative(this._root,i),fullPath:i,basename:s},n[this._statsProp]=this._isDirent?e:await this._stat(i);}catch(s){this._onError(s);}return n}_onError(e){Lk(e)&&!this.destroyed?this.emit("warn",e):this.destroy(e);}async _getEntryType(e){let r=e&&e[this._statsProp];if(r){if(r.isFile())return "file";if(r.isDirectory())return "directory";if(r&&r.isSymbolicLink()){let n=e.fullPath;try{let s=await $k(n),i=await Kv(s);if(i.isFile())return "file";if(i.isDirectory()){let o=s.length;if(n.startsWith(s)&&n.substr(o,1)===Ei.sep){let u=new Error(`Circular symlink detected: "${n}" points to "${s}"`);return u.code=Qv,this._onError(u)}return "directory"}}catch(s){this._onError(s);}}}}_includeAsFile(e){let r=e&&e[this._statsProp];return r&&this._wantsEverything&&!r.isDirectory()}},Cn=(t,e={})=>{let r=e.entryType||e.type;if(r==="both"&&(r=bo),r&&(e.type=r),t){if(typeof t!="string")throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");if(r&&!Yv.includes(r))throw new Error(`readdirp: Invalid type passed. Use one of ${Yv.join(", ")}`)}else throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");return e.root=t,new Eo(e)},Dk=(t,e={})=>new Promise((r,n)=>{let s=[];Cn(t,e).on("data",i=>s.push(i)).on("end",()=>r(s)).on("error",i=>n(i));});Cn.promise=Dk;Cn.ReaddirpStream=Eo;Cn.default=Cn;eS.exports=Cn;});var Jl=_((wM,rS)=>{rS.exports=function(t,e){if(typeof t!="string")throw new TypeError("expected path to be a string");if(t==="\\"||t==="/")return "/";var r=t.length;if(r<=1)return t;var n="";if(r>4&&t[3]==="\\"){var s=t[2];(s==="?"||s===".")&&t.slice(0,2)==="\\\\"&&(t=t.slice(2),n="//");}var i=t.split(/[/\\]+/);return e!==!1&&i[i.length-1]===""&&i.pop(),n+i.join("/")};});var uS=_((oS,aS)=>{Object.defineProperty(oS,"__esModule",{value:!0});var sS=Vl(),Nk=Jl(),nS="!",Mk={returnIndex:!1},Uk=t=>Array.isArray(t)?t:[t],jk=(t,e)=>{if(typeof t=="function")return t;if(typeof t=="string"){let r=sS(t,e);return n=>t===n||r(n)}return t instanceof RegExp?r=>t.test(r):r=>!1},iS=(t,e,r,n)=>{let s=Array.isArray(r),i=s?r[0]:r;if(!s&&typeof i!="string")throw new TypeError("anymatch: second argument must be a string: got "+Object.prototype.toString.call(i));let o=Nk(i,!1);for(let c=0;c<e.length;c++){let p=e[c];if(p(o))return n?-1:!1}let u=s&&[o].concat(r.slice(1));for(let c=0;c<t.length;c++){let p=t[c];if(s?p(...u):p(o))return n?c:!0}return n?-1:!1},Xl=(t,e,r=Mk)=>{if(t==null)throw new TypeError("anymatch: specify first argument");let n=typeof r=="boolean"?{returnIndex:r}:r,s=n.returnIndex||!1,i=Uk(t),o=i.filter(c=>typeof c=="string"&&c.charAt(0)===nS).map(c=>c.slice(1)).map(c=>sS(c,n)),u=i.filter(c=>typeof c!="string"||typeof c=="string"&&c.charAt(0)!==nS).map(c=>jk(c,n));return e==null?(c,p=!1)=>iS(u,o,c,typeof p=="boolean"?p:!1):iS(u,o,e,s)};Xl.default=Xl;aS.exports=Xl;});var cS=_((vM,lS)=>{lS.exports=function(e){if(typeof e!="string"||e==="")return !1;for(var r;r=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(r[2])return !0;e=e.slice(r.index+r[0].length);}return !1};});var Ql=_((SM,hS)=>{var Hk=cS(),fS={"{":"}","(":")","[":"]"},Wk=function(t){if(t[0]==="!")return !0;for(var e=0,r=-2,n=-2,s=-2,i=-2,o=-2;e<t.length;){if(t[e]==="*"||t[e+1]==="?"&&/[\].+)]/.test(t[e])||n!==-1&&t[e]==="["&&t[e+1]!=="]"&&(n<e&&(n=t.indexOf("]",e)),n>e&&(o===-1||o>n||(o=t.indexOf("\\",e),o===-1||o>n)))||s!==-1&&t[e]==="{"&&t[e+1]!=="}"&&(s=t.indexOf("}",e),s>e&&(o=t.indexOf("\\",e),o===-1||o>s))||i!==-1&&t[e]==="("&&t[e+1]==="?"&&/[:!=]/.test(t[e+2])&&t[e+3]!==")"&&(i=t.indexOf(")",e),i>e&&(o=t.indexOf("\\",e),o===-1||o>i))||r!==-1&&t[e]==="("&&t[e+1]!=="|"&&(r<e&&(r=t.indexOf("|",e)),r!==-1&&t[r+1]!==")"&&(i=t.indexOf(")",r),i>r&&(o=t.indexOf("\\",r),o===-1||o>i))))return !0;if(t[e]==="\\"){var u=t[e+1];e+=2;var c=fS[u];if(c){var p=t.indexOf(c,e);p!==-1&&(e=p+1);}if(t[e]==="!")return !0}else e++;}return !1},zk=function(t){if(t[0]==="!")return !0;for(var e=0;e<t.length;){if(/[*?{}()[\]]/.test(t[e]))return !0;if(t[e]==="\\"){var r=t[e+1];e+=2;var n=fS[r];if(n){var s=t.indexOf(n,e);s!==-1&&(e=s+1);}if(t[e]==="!")return !0}else e++;}return !1};hS.exports=function(e,r){if(typeof e!="string"||e==="")return !1;if(Hk(e))return !0;var n=Wk;return r&&r.strict===!1&&(n=zk),n(e)};});var dS=_((bM,pS)=>{var Gk=Ql(),Vk=G("path").posix.dirname,Kk=G("os").platform()==="win32",Zl="/",Yk=/\\/g,Jk=/[\{\[].*[\}\]]$/,Xk=/(^|[^\\])([\{\[]|\([^\)]+$)/,Qk=/\\([\!\*\?\|\[\]\(\)\{\}])/g;pS.exports=function(e,r){var n=Object.assign({flipBackslashes:!0},r);n.flipBackslashes&&Kk&&e.indexOf(Zl)<0&&(e=e.replace(Yk,Zl)),Jk.test(e)&&(e+=Zl),e+="a";do e=Vk(e);while(Gk(e)||Xk.test(e));return e.replace(Qk,"$1")};});var Ao=_(xt=>{xt.isInteger=t=>typeof t=="number"?Number.isInteger(t):typeof t=="string"&&t.trim()!==""?Number.isInteger(Number(t)):!1;xt.find=(t,e)=>t.nodes.find(r=>r.type===e);xt.exceedsLimit=(t,e,r=1,n)=>n===!1||!xt.isInteger(t)||!xt.isInteger(e)?!1:(Number(e)-Number(t))/Number(r)>=n;xt.escapeNode=(t,e=0,r)=>{let n=t.nodes[e];n&&(r&&n.type===r||n.type==="open"||n.type==="close")&&n.escaped!==!0&&(n.value="\\"+n.value,n.escaped=!0);};xt.encloseBrace=t=>t.type!=="brace"||t.commas>>0+t.ranges>>0?!1:(t.invalid=!0,!0);xt.isInvalidBrace=t=>t.type!=="brace"?!1:t.invalid===!0||t.dollar?!0:!(t.commas>>0+t.ranges>>0)||t.open!==!0||t.close!==!0?(t.invalid=!0,!0):!1;xt.isOpenOrClose=t=>t.type==="open"||t.type==="close"?!0:t.open===!0||t.close===!0;xt.reduce=t=>t.reduce((e,r)=>(r.type==="text"&&e.push(r.value),r.type==="range"&&(r.type="text"),e),[]);xt.flatten=(...t)=>{let e=[],r=n=>{for(let s=0;s<n.length;s++){let i=n[s];Array.isArray(i)?r(i):i!==void 0&&e.push(i);}return e};return r(t),e};});var _o=_((xM,gS)=>{var yS=Ao();gS.exports=(t,e={})=>{let r=(n,s={})=>{let i=e.escapeInvalid&&yS.isInvalidBrace(s),o=n.invalid===!0&&e.escapeInvalid===!0,u="";if(n.value)return (i||o)&&yS.isOpenOrClose(n)?"\\"+n.value:n.value;if(n.value)return n.value;if(n.nodes)for(let c of n.nodes)u+=r(c);return u};return r(t)};});var wS=_((AM,mS)=>{mS.exports=function(t){return typeof t=="number"?t-t===0:typeof t=="string"&&t.trim()!==""?Number.isFinite?Number.isFinite(+t):isFinite(+t):!1};});var RS=_((_M,CS)=>{var vS=wS(),Hr=(t,e,r)=>{if(vS(t)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||t===e)return String(t);if(vS(e)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let n={relaxZeros:!0,...r};typeof n.strictZeros=="boolean"&&(n.relaxZeros=n.strictZeros===!1);let s=String(n.relaxZeros),i=String(n.shorthand),o=String(n.capture),u=String(n.wrap),c=t+":"+e+"="+s+i+o+u;if(Hr.cache.hasOwnProperty(c))return Hr.cache[c].result;let p=Math.min(t,e),l=Math.max(t,e);if(Math.abs(p-l)===1){let E=t+"|"+e;return n.capture?`(${E})`:n.wrap===!1?E:`(?:${E})`}let d=_S(t)||_S(e),g={min:t,max:e,a:p,b:l},m=[],w=[];if(d&&(g.isPadded=d,g.maxLen=String(g.max).length),p<0){let E=l<0?Math.abs(l):1;w=SS(E,Math.abs(p),g,n),p=g.a=0;}return l>=0&&(m=SS(p,l,g,n)),g.negatives=w,g.positives=m,g.result=Zk(w,m),n.capture===!0?g.result=`(${g.result})`:n.wrap!==!1&&m.length+w.length>1&&(g.result=`(?:${g.result})`),Hr.cache[c]=g,g.result};function Zk(t,e,r){let n=ec(t,e,"-",!1)||[],s=ec(e,t,"",!1)||[],i=ec(t,e,"-?",!0)||[];return n.concat(i).concat(s).join("|")}function eL(t,e){let r=1,n=1,s=ES(t,r),i=new Set([e]);for(;t<=s&&s<=e;)i.add(s),r+=1,s=ES(t,r);for(s=xS(e+1,n)-1;t<s&&s<=e;)i.add(s),n+=1,s=xS(e+1,n)-1;return i=[...i],i.sort(nL),i}function tL(t,e,r){if(t===e)return {pattern:t,count:[],digits:0};let n=rL(t,e),s=n.length,i="",o=0;for(let u=0;u<s;u++){let[c,p]=n[u];c===p?i+=c:c!=="0"||p!=="9"?i+=iL(c,p):o++;}return o&&(i+=r.shorthand===!0?"\\d":"[0-9]"),{pattern:i,count:[o],digits:s}}function SS(t,e,r,n){let s=eL(t,e),i=[],o=t,u;for(let c=0;c<s.length;c++){let p=s[c],l=tL(String(o),String(p),n),d="";if(!r.isPadded&&u&&u.pattern===l.pattern){u.count.length>1&&u.count.pop(),u.count.push(l.count[0]),u.string=u.pattern+AS(u.count),o=p+1;continue}r.isPadded&&(d=sL(p,r,n)),l.string=d+l.pattern+AS(l.count),i.push(l),o=p+1,u=l;}return i}function ec(t,e,r,n,s){let i=[];for(let o of t){let{string:u}=o;!n&&!bS(e,"string",u)&&i.push(r+u),n&&bS(e,"string",u)&&i.push(r+u);}return i}function rL(t,e){let r=[];for(let n=0;n<t.length;n++)r.push([t[n],e[n]]);return r}function nL(t,e){return t>e?1:e>t?-1:0}function bS(t,e,r){return t.some(n=>n[e]===r)}function ES(t,e){return Number(String(t).slice(0,-e)+"9".repeat(e))}function xS(t,e){return t-t%Math.pow(10,e)}function AS(t){let[e=0,r=""]=t;return r||e>1?`{${e+(r?","+r:"")}}`:""}function iL(t,e,r){return `[${t}${e-t===1?"":"-"}${e}]`}function _S(t){return /^-?(0+)\d/.test(t)}function sL(t,e,r){if(!e.isPadded)return t;let n=Math.abs(e.maxLen-String(t).length),s=r.relaxZeros!==!1;switch(n){case 0:return "";case 1:return s?"0?":"0";case 2:return s?"0{0,2}":"00";default:return s?`0{0,${n}}`:`0{${n}}`}}Hr.cache={};Hr.clearCache=()=>Hr.cache={};CS.exports=Hr;});var nc=_((CM,LS)=>{var oL=G("util"),PS=RS(),OS=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),aL=t=>e=>t===!0?Number(e):String(e),tc=t=>typeof t=="number"||typeof t=="string"&&t!=="",Ai=t=>Number.isInteger(+t),rc=t=>{let e=`${t}`,r=-1;if(e[0]==="-"&&(e=e.slice(1)),e==="0")return !1;for(;e[++r]==="0";);return r>0},uL=(t,e,r)=>typeof t=="string"||typeof e=="string"?!0:r.stringify===!0,lL=(t,e,r)=>{if(e>0){let n=t[0]==="-"?"-":"";n&&(t=t.slice(1)),t=n+t.padStart(n?e-1:e,"0");}return r===!1?String(t):t},TS=(t,e)=>{let r=t[0]==="-"?"-":"";for(r&&(t=t.slice(1),e--);t.length<e;)t="0"+t;return r?"-"+t:t},cL=(t,e)=>{t.negatives.sort((o,u)=>o<u?-1:o>u?1:0),t.positives.sort((o,u)=>o<u?-1:o>u?1:0);let r=e.capture?"":"?:",n="",s="",i;return t.positives.length&&(n=t.positives.join("|")),t.negatives.length&&(s=`-(${r}${t.negatives.join("|")})`),n&&s?i=`${n}|${s}`:i=n||s,e.wrap?`(${r}${i})`:i},IS=(t,e,r,n)=>{if(r)return PS(t,e,{wrap:!1,...n});let s=String.fromCharCode(t);if(t===e)return s;let i=String.fromCharCode(e);return `[${s}-${i}]`},$S=(t,e,r)=>{if(Array.isArray(t)){let n=r.wrap===!0,s=r.capture?"":"?:";return n?`(${s}${t.join("|")})`:t.join("|")}return PS(t,e,r)},FS=(...t)=>new RangeError("Invalid range arguments: "+oL.inspect(...t)),kS=(t,e,r)=>{if(r.strictRanges===!0)throw FS([t,e]);return []},fL=(t,e)=>{if(e.strictRanges===!0)throw new TypeError(`Expected step "${t}" to be a number`);return []},hL=(t,e,r=1,n={})=>{let s=Number(t),i=Number(e);if(!Number.isInteger(s)||!Number.isInteger(i)){if(n.strictRanges===!0)throw FS([t,e]);return []}s===0&&(s=0),i===0&&(i=0);let o=s>i,u=String(t),c=String(e),p=String(r);r=Math.max(Math.abs(r),1);let l=rc(u)||rc(c)||rc(p),d=l?Math.max(u.length,c.length,p.length):0,g=l===!1&&uL(t,e,n)===!1,m=n.transform||aL(g);if(n.toRegex&&r===1)return IS(TS(t,d),TS(e,d),!0,n);let w={negatives:[],positives:[]},E=x=>w[x<0?"negatives":"positives"].push(Math.abs(x)),A=[],R=0;for(;o?s>=i:s<=i;)n.toRegex===!0&&r>1?E(s):A.push(lL(m(s,R),d,g)),s=o?s-r:s+r,R++;return n.toRegex===!0?r>1?cL(w,n):$S(A,null,{wrap:!1,...n}):A},pL=(t,e,r=1,n={})=>{if(!Ai(t)&&t.length>1||!Ai(e)&&e.length>1)return kS(t,e,n);let s=n.transform||(g=>String.fromCharCode(g)),i=`${t}`.charCodeAt(0),o=`${e}`.charCodeAt(0),u=i>o,c=Math.min(i,o),p=Math.max(i,o);if(n.toRegex&&r===1)return IS(c,p,!1,n);let l=[],d=0;for(;u?i>=o:i<=o;)l.push(s(i,d)),i=u?i-r:i+r,d++;return n.toRegex===!0?$S(l,null,{wrap:!1,options:n}):l},Co=(t,e,r,n={})=>{if(e==null&&tc(t))return [t];if(!tc(t)||!tc(e))return kS(t,e,n);if(typeof r=="function")return Co(t,e,1,{transform:r});if(OS(r))return Co(t,e,0,r);let s={...n};return s.capture===!0&&(s.wrap=!0),r=r||s.step||1,Ai(r)?Ai(t)&&Ai(e)?hL(t,e,r,s):pL(t,e,Math.max(Math.abs(r),1),s):r!=null&&!OS(r)?fL(r,s):Co(t,e,1,r)};LS.exports=Co;});var DS=_((RM,BS)=>{var dL=nc(),qS=Ao(),yL=(t,e={})=>{let r=(n,s={})=>{let i=qS.isInvalidBrace(s),o=n.invalid===!0&&e.escapeInvalid===!0,u=i===!0||o===!0,c=e.escapeInvalid===!0?"\\":"",p="";if(n.isOpen===!0||n.isClose===!0)return c+n.value;if(n.type==="open")return u?c+n.value:"(";if(n.type==="close")return u?c+n.value:")";if(n.type==="comma")return n.prev.type==="comma"?"":u?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){let l=qS.reduce(n.nodes),d=dL(...l,{...e,wrap:!1,toRegex:!0});if(d.length!==0)return l.length>1&&d.length>1?`(${d})`:d}if(n.nodes)for(let l of n.nodes)p+=r(l,n);return p};return r(t)};BS.exports=yL;});var US=_((OM,MS)=>{var gL=nc(),NS=_o(),Rn=Ao(),Wr=(t="",e="",r=!1)=>{let n=[];if(t=[].concat(t),e=[].concat(e),!e.length)return t;if(!t.length)return r?Rn.flatten(e).map(s=>`{${s}}`):e;for(let s of t)if(Array.isArray(s))for(let i of s)n.push(Wr(i,e,r));else for(let i of e)r===!0&&typeof i=="string"&&(i=`{${i}}`),n.push(Array.isArray(i)?Wr(s,i,r):s+i);return Rn.flatten(n)},mL=(t,e={})=>{let r=e.rangeLimit===void 0?1e3:e.rangeLimit,n=(s,i={})=>{s.queue=[];let o=i,u=i.queue;for(;o.type!=="brace"&&o.type!=="root"&&o.parent;)o=o.parent,u=o.queue;if(s.invalid||s.dollar){u.push(Wr(u.pop(),NS(s,e)));return}if(s.type==="brace"&&s.invalid!==!0&&s.nodes.length===2){u.push(Wr(u.pop(),["{}"]));return}if(s.nodes&&s.ranges>0){let d=Rn.reduce(s.nodes);if(Rn.exceedsLimit(...d,e.step,r))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let g=gL(...d,e);g.length===0&&(g=NS(s,e)),u.push(Wr(u.pop(),g)),s.nodes=[];return}let c=Rn.encloseBrace(s),p=s.queue,l=s;for(;l.type!=="brace"&&l.type!=="root"&&l.parent;)l=l.parent,p=l.queue;for(let d=0;d<s.nodes.length;d++){let g=s.nodes[d];if(g.type==="comma"&&s.type==="brace"){d===1&&p.push(""),p.push("");continue}if(g.type==="close"){u.push(Wr(u.pop(),p,c));continue}if(g.value&&g.type!=="open"){p.push(Wr(p.pop(),g.value));continue}g.nodes&&n(g,s);}return p};return Rn.flatten(n(t))};MS.exports=mL;});var HS=_((TM,jS)=>{jS.exports={MAX_LENGTH:1024*64,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:`
`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"};});var KS=_((PM,VS)=>{var wL=_o(),{MAX_LENGTH:WS,CHAR_BACKSLASH:ic,CHAR_BACKTICK:vL,CHAR_COMMA:SL,CHAR_DOT:bL,CHAR_LEFT_PARENTHESES:EL,CHAR_RIGHT_PARENTHESES:xL,CHAR_LEFT_CURLY_BRACE:AL,CHAR_RIGHT_CURLY_BRACE:_L,CHAR_LEFT_SQUARE_BRACKET:zS,CHAR_RIGHT_SQUARE_BRACKET:GS,CHAR_DOUBLE_QUOTE:CL,CHAR_SINGLE_QUOTE:RL,CHAR_NO_BREAK_SPACE:OL,CHAR_ZERO_WIDTH_NOBREAK_SPACE:TL}=HS(),PL=(t,e={})=>{if(typeof t!="string")throw new TypeError("Expected a string");let r=e||{},n=typeof r.maxLength=="number"?Math.min(WS,r.maxLength):WS;if(t.length>n)throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${n})`);let s={type:"root",input:t,nodes:[]},i=[s],o=s,u=s,c=0,p=t.length,l=0,d=0,g,w=()=>t[l++],E=A=>{if(A.type==="text"&&u.type==="dot"&&(u.type="text"),u&&u.type==="text"&&A.type==="text"){u.value+=A.value;return}return o.nodes.push(A),A.parent=o,A.prev=u,u=A,A};for(E({type:"bos"});l<p;)if(o=i[i.length-1],g=w(),!(g===TL||g===OL)){if(g===ic){E({type:"text",value:(e.keepEscaping?g:"")+w()});continue}if(g===GS){E({type:"text",value:"\\"+g});continue}if(g===zS){c++;let R;for(;l<p&&(R=w());){if(g+=R,R===zS){c++;continue}if(R===ic){g+=w();continue}if(R===GS&&(c--,c===0))break}E({type:"text",value:g});continue}if(g===EL){o=E({type:"paren",nodes:[]}),i.push(o),E({type:"text",value:g});continue}if(g===xL){if(o.type!=="paren"){E({type:"text",value:g});continue}o=i.pop(),E({type:"text",value:g}),o=i[i.length-1];continue}if(g===CL||g===RL||g===vL){let A=g,R;for(e.keepQuotes!==!0&&(g="");l<p&&(R=w());){if(R===ic){g+=R+w();continue}if(R===A){e.keepQuotes===!0&&(g+=R);break}g+=R;}E({type:"text",value:g});continue}if(g===AL){d++;let R={type:"brace",open:!0,close:!1,dollar:u.value&&u.value.slice(-1)==="$"||o.dollar===!0,depth:d,commas:0,ranges:0,nodes:[]};o=E(R),i.push(o),E({type:"open",value:g});continue}if(g===_L){if(o.type!=="brace"){E({type:"text",value:g});continue}let A="close";o=i.pop(),o.close=!0,E({type:A,value:g}),d--,o=i[i.length-1];continue}if(g===SL&&d>0){if(o.ranges>0){o.ranges=0;let A=o.nodes.shift();o.nodes=[A,{type:"text",value:wL(o)}];}E({type:"comma",value:g}),o.commas++;continue}if(g===bL&&d>0&&o.commas===0){let A=o.nodes;if(d===0||A.length===0){E({type:"text",value:g});continue}if(u.type==="dot"){if(o.range=[],u.value+=g,u.type="range",o.nodes.length!==3&&o.nodes.length!==5){o.invalid=!0,o.ranges=0,u.type="text";continue}o.ranges++,o.args=[];continue}if(u.type==="range"){A.pop();let R=A[A.length-1];R.value+=u.value+g,u=R,o.ranges--;continue}E({type:"dot",value:g});continue}E({type:"text",value:g});}do if(o=i.pop(),o.type!=="root"){o.nodes.forEach(x=>{x.nodes||(x.type==="open"&&(x.isOpen=!0),x.type==="close"&&(x.isClose=!0),x.nodes||(x.type="text"),x.invalid=!0);});let A=i[i.length-1],R=A.nodes.indexOf(o);A.nodes.splice(R,1,...o.nodes);}while(i.length>0);return E({type:"eos"}),s};VS.exports=PL;});var XS=_((IM,JS)=>{var YS=_o(),IL=DS(),$L=US(),FL=KS(),pt=(t,e={})=>{let r=[];if(Array.isArray(t))for(let n of t){let s=pt.create(n,e);Array.isArray(s)?r.push(...s):r.push(s);}else r=[].concat(pt.create(t,e));return e&&e.expand===!0&&e.nodupes===!0&&(r=[...new Set(r)]),r};pt.parse=(t,e={})=>FL(t,e);pt.stringify=(t,e={})=>YS(typeof t=="string"?pt.parse(t,e):t,e);pt.compile=(t,e={})=>(typeof t=="string"&&(t=pt.parse(t,e)),IL(t,e));pt.expand=(t,e={})=>{typeof t=="string"&&(t=pt.parse(t,e));let r=$L(t,e);return e.noempty===!0&&(r=r.filter(Boolean)),e.nodupes===!0&&(r=[...new Set(r)]),r};pt.create=(t,e={})=>t===""||t.length<3?[t]:e.expand!==!0?pt.compile(t,e):pt.expand(t,e);JS.exports=pt;});var QS=_(($M,kL)=>{kL.exports=["3dm","3ds","3g2","3gp","7z","a","aac","adp","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"];});var eb=_((FM,ZS)=>{ZS.exports=QS();});var rb=_((kM,tb)=>{var LL=G("path"),qL=eb(),BL=new Set(qL);tb.exports=t=>BL.has(LL.extname(t).slice(1).toLowerCase());});var Ro=_(ee=>{var{sep:DL}=G("path"),{platform:sc}=process,NL=G("os");ee.EV_ALL="all";ee.EV_READY="ready";ee.EV_ADD="add";ee.EV_CHANGE="change";ee.EV_ADD_DIR="addDir";ee.EV_UNLINK="unlink";ee.EV_UNLINK_DIR="unlinkDir";ee.EV_RAW="raw";ee.EV_ERROR="error";ee.STR_DATA="data";ee.STR_END="end";ee.STR_CLOSE="close";ee.FSEVENT_CREATED="created";ee.FSEVENT_MODIFIED="modified";ee.FSEVENT_DELETED="deleted";ee.FSEVENT_MOVED="moved";ee.FSEVENT_CLONED="cloned";ee.FSEVENT_UNKNOWN="unknown";ee.FSEVENT_TYPE_FILE="file";ee.FSEVENT_TYPE_DIRECTORY="directory";ee.FSEVENT_TYPE_SYMLINK="symlink";ee.KEY_LISTENERS="listeners";ee.KEY_ERR="errHandlers";ee.KEY_RAW="rawEmitters";ee.HANDLER_KEYS=[ee.KEY_LISTENERS,ee.KEY_ERR,ee.KEY_RAW];ee.DOT_SLASH=`.${DL}`;ee.BACK_SLASH_RE=/\\/g;ee.DOUBLE_SLASH_RE=/\/\//;ee.SLASH_OR_BACK_SLASH_RE=/[/\\]/;ee.DOT_RE=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/;ee.REPLACER_RE=/^\.[/\\]/;ee.SLASH="/";ee.SLASH_SLASH="//";ee.BRACE_START="{";ee.BANG="!";ee.ONE_DOT=".";ee.TWO_DOTS="..";ee.STAR="*";ee.GLOBSTAR="**";ee.ROOT_GLOBSTAR="/**/*";ee.SLASH_GLOBSTAR="/**";ee.DIR_SUFFIX="Dir";ee.ANYMATCH_OPTS={dot:!0};ee.STRING_TYPE="string";ee.FUNCTION_TYPE="function";ee.EMPTY_STR="";ee.EMPTY_FN=()=>{};ee.IDENTITY_FN=t=>t;ee.isWindows=sc==="win32";ee.isMacos=sc==="darwin";ee.isLinux=sc==="linux";ee.isIBMi=NL.type()==="OS400";});var ub=_((qM,ab)=>{var Zt=G("fs"),Le=G("path"),{promisify:Oi}=G("util"),ML=rb(),{isWindows:UL,isLinux:jL,EMPTY_FN:HL,EMPTY_STR:WL,KEY_LISTENERS:On,KEY_ERR:oc,KEY_RAW:_i,HANDLER_KEYS:zL,EV_CHANGE:To,EV_ADD:Oo,EV_ADD_DIR:GL,EV_ERROR:ib,STR_DATA:VL,STR_END:KL,BRACE_START:YL,STAR:JL}=Ro(),XL="watch",QL=Oi(Zt.open),sb=Oi(Zt.stat),ZL=Oi(Zt.lstat),eq=Oi(Zt.close),ac=Oi(Zt.realpath),tq={lstat:ZL,stat:sb},lc=(t,e)=>{t instanceof Set?t.forEach(e):e(t);},Ci=(t,e,r)=>{let n=t[e];n instanceof Set||(t[e]=n=new Set([n])),n.add(r);},rq=t=>e=>{let r=t[e];r instanceof Set?r.clear():delete t[e];},Ri=(t,e,r)=>{let n=t[e];n instanceof Set?n.delete(r):n===r&&delete t[e];},ob=t=>t instanceof Set?t.size===0:!t,Po=new Map;function nb(t,e,r,n,s){let i=(o,u)=>{r(t),s(o,u,{watchedPath:t}),u&&t!==u&&Io(Le.resolve(t,u),On,Le.join(t,u));};try{return Zt.watch(t,e,i)}catch(o){n(o);}}var Io=(t,e,r,n,s)=>{let i=Po.get(t);i&&lc(i[e],o=>{o(r,n,s);});},nq=(t,e,r,n)=>{let{listener:s,errHandler:i,rawEmitter:o}=n,u=Po.get(e),c;if(!r.persistent)return c=nb(t,r,s,i,o),c.close.bind(c);if(u)Ci(u,On,s),Ci(u,oc,i),Ci(u,_i,o);else {if(c=nb(t,r,Io.bind(null,e,On),i,Io.bind(null,e,_i)),!c)return;c.on(ib,async p=>{let l=Io.bind(null,e,oc);if(u.watcherUnusable=!0,UL&&p.code==="EPERM")try{let d=await QL(t,"r");await eq(d),l(p);}catch{}else l(p);}),u={listeners:s,errHandlers:i,rawEmitters:o,watcher:c},Po.set(e,u);}return ()=>{Ri(u,On,s),Ri(u,oc,i),Ri(u,_i,o),ob(u.listeners)&&(u.watcher.close(),Po.delete(e),zL.forEach(rq(u)),u.watcher=void 0,Object.freeze(u));}},uc=new Map,iq=(t,e,r,n)=>{let {listener:s,rawEmitter:i}=n,o=uc.get(e),p=o&&o.options;return p&&(p.persistent<r.persistent||p.interval>r.interval)&&(Zt.unwatchFile(e),o=void 0),o?(Ci(o,On,s),Ci(o,_i,i)):(o={listeners:s,rawEmitters:i,options:r,watcher:Zt.watchFile(e,r,(l,d)=>{lc(o.rawEmitters,m=>{m(To,e,{curr:l,prev:d});});let g=l.mtimeMs;(l.size!==d.size||g>d.mtimeMs||g===0)&&lc(o.listeners,m=>m(t,l));})},uc.set(e,o)),()=>{Ri(o,On,s),Ri(o,_i,i),ob(o.listeners)&&(uc.delete(e),Zt.unwatchFile(e),o.options=o.watcher=void 0,Object.freeze(o));}},cc=class{constructor(e){this.fsw=e,this._boundHandleError=r=>e._handleError(r);}_watchWithNodeFs(e,r){let n=this.fsw.options,s=Le.dirname(e),i=Le.basename(e);this.fsw._getWatchedDir(s).add(i);let u=Le.resolve(e),c={persistent:n.persistent};r||(r=HL);let p;return n.usePolling?(c.interval=n.enableBinaryInterval&&ML(i)?n.binaryInterval:n.interval,p=iq(e,u,c,{listener:r,rawEmitter:this.fsw._emitRaw})):p=nq(e,u,c,{listener:r,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw}),p}_handleFile(e,r,n){if(this.fsw.closed)return;let s=Le.dirname(e),i=Le.basename(e),o=this.fsw._getWatchedDir(s),u=r;if(o.has(i))return;let c=async(l,d)=>{if(this.fsw._throttle(XL,e,5)){if(!d||d.mtimeMs===0)try{let g=await sb(e);if(this.fsw.closed)return;let m=g.atimeMs,w=g.mtimeMs;(!m||m<=w||w!==u.mtimeMs)&&this.fsw._emit(To,e,g),jL&&u.ino!==g.ino?(this.fsw._closeFile(l),u=g,this.fsw._addPathCloser(l,this._watchWithNodeFs(e,c))):u=g;}catch{this.fsw._remove(s,i);}else if(o.has(i)){let g=d.atimeMs,m=d.mtimeMs;(!g||g<=m||m!==u.mtimeMs)&&this.fsw._emit(To,e,d),u=d;}}},p=this._watchWithNodeFs(e,c);if(!(n&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(Oo,e,0))return;this.fsw._emit(Oo,e,r);}return p}async _handleSymlink(e,r,n,s){if(this.fsw.closed)return;let i=e.fullPath,o=this.fsw._getWatchedDir(r);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let u;try{u=await ac(n);}catch{return this.fsw._emitReady(),!0}return this.fsw.closed?void 0:(o.has(s)?this.fsw._symlinkPaths.get(i)!==u&&(this.fsw._symlinkPaths.set(i,u),this.fsw._emit(To,n,e.stats)):(o.add(s),this.fsw._symlinkPaths.set(i,u),this.fsw._emit(Oo,n,e.stats)),this.fsw._emitReady(),!0)}if(this.fsw._symlinkPaths.has(i))return !0;this.fsw._symlinkPaths.set(i,!0);}_handleRead(e,r,n,s,i,o,u){if(e=Le.join(e,WL),!n.hasGlob&&(u=this.fsw._throttle("readdir",e,1e3),!u))return;let c=this.fsw._getWatchedDir(n.path),p=new Set,l=this.fsw._readdirp(e,{fileFilter:d=>n.filterPath(d),directoryFilter:d=>n.filterDir(d),depth:0}).on(VL,async d=>{if(this.fsw.closed){l=void 0;return}let g=d.path,m=Le.join(e,g);if(p.add(g),!(d.stats.isSymbolicLink()&&await this._handleSymlink(d,e,m,g))){if(this.fsw.closed){l=void 0;return}(g===s||!s&&!c.has(g))&&(this.fsw._incrReadyCount(),m=Le.join(i,Le.relative(i,m)),this._addToNodeFs(m,r,n,o+1));}}).on(ib,this._boundHandleError);return new Promise(d=>l.once(KL,()=>{if(this.fsw.closed){l=void 0;return}let g=u?u.clear():!1;d(),c.getChildren().filter(m=>m!==e&&!p.has(m)&&(!n.hasGlob||n.filterPath({fullPath:Le.resolve(e,m)}))).forEach(m=>{this.fsw._remove(e,m);}),l=void 0,g&&this._handleRead(e,!1,n,s,i,o,u);}))}async _handleDir(e,r,n,s,i,o,u){let c=this.fsw._getWatchedDir(Le.dirname(e)),p=c.has(Le.basename(e));!(n&&this.fsw.options.ignoreInitial)&&!i&&!p&&(!o.hasGlob||o.globFilter(e))&&this.fsw._emit(GL,e,r),c.add(Le.basename(e)),this.fsw._getWatchedDir(e);let l,d,g=this.fsw.options.depth;if((g==null||s<=g)&&!this.fsw._symlinkPaths.has(u)){if(!i&&(await this._handleRead(e,n,o,i,e,s,l),this.fsw.closed))return;d=this._watchWithNodeFs(e,(m,w)=>{w&&w.mtimeMs===0||this._handleRead(m,!1,o,i,e,s,l);});}return d}async _addToNodeFs(e,r,n,s,i){let o=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return o(),!1;let u=this.fsw._getWatchHelpers(e,s);!u.hasGlob&&n&&(u.hasGlob=n.hasGlob,u.globFilter=n.globFilter,u.filterPath=c=>n.filterPath(c),u.filterDir=c=>n.filterDir(c));try{let c=await tq[u.statMethod](u.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(u.watchPath,c))return o(),!1;let p=this.fsw.options.followSymlinks&&!e.includes(JL)&&!e.includes(YL),l;if(c.isDirectory()){let d=Le.resolve(e),g=p?await ac(e):e;if(this.fsw.closed||(l=await this._handleDir(u.watchPath,c,r,s,i,u,g),this.fsw.closed))return;d!==g&&g!==void 0&&this.fsw._symlinkPaths.set(d,g);}else if(c.isSymbolicLink()){let d=p?await ac(e):e;if(this.fsw.closed)return;let g=Le.dirname(u.watchPath);if(this.fsw._getWatchedDir(g).add(u.watchPath),this.fsw._emit(Oo,u.watchPath,c),l=await this._handleDir(g,c,r,s,e,u,d),this.fsw.closed)return;d!==void 0&&this.fsw._symlinkPaths.set(Le.resolve(e),d);}else l=this._handleFile(u.watchPath,c,r);return o(),this.fsw._addPathCloser(e,l),!1}catch(c){if(this.fsw._handleError(c))return o(),e}}};ab.exports=cc;});var yb=_((BM,wc)=>{var gc=G("fs"),qe=G("path"),{promisify:mc}=G("util"),Tn;try{Tn=G("fsevents");}catch(t){process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR&&console.error(t);}if(Tn){let t=process.version.match(/v(\d+)\.(\d+)/);if(t&&t[1]&&t[2]){let e=Number.parseInt(t[1],10),r=Number.parseInt(t[2],10);e===8&&r<16&&(Tn=void 0);}}var{EV_ADD:fc,EV_CHANGE:sq,EV_ADD_DIR:lb,EV_UNLINK:$o,EV_ERROR:oq,STR_DATA:aq,STR_END:uq,FSEVENT_CREATED:lq,FSEVENT_MODIFIED:cq,FSEVENT_DELETED:fq,FSEVENT_MOVED:hq,FSEVENT_UNKNOWN:pq,FSEVENT_TYPE_FILE:dq,FSEVENT_TYPE_DIRECTORY:Ti,FSEVENT_TYPE_SYMLINK:db,ROOT_GLOBSTAR:cb,DIR_SUFFIX:yq,DOT_SLASH:fb,FUNCTION_TYPE:hc,EMPTY_FN:gq,IDENTITY_FN:mq}=Ro(),wq=t=>isNaN(t)?{}:{depth:t},dc=mc(gc.stat),vq=mc(gc.lstat),hb=mc(gc.realpath),Sq={stat:dc,lstat:vq},zr=new Map,bq=10,Eq=new Set([69888,70400,71424,72704,73472,131328,131840,262912]),xq=(t,e)=>({stop:Tn.watch(t,e)});function Aq(t,e,r,n){let s=qe.extname(e)?qe.dirname(e):e,i=qe.dirname(s),o=zr.get(s);_q(i)&&(s=i);let u=qe.resolve(t),c=u!==e,p=(d,g,m)=>{c&&(d=d.replace(e,u)),(d===u||!d.indexOf(u+qe.sep))&&r(d,g,m);},l=!1;for(let d of zr.keys())if(e.indexOf(qe.resolve(d)+qe.sep)===0){s=d,o=zr.get(s),l=!0;break}return o||l?o.listeners.add(p):(o={listeners:new Set([p]),rawEmitter:n,watcher:xq(s,(d,g)=>{if(!o.listeners.size)return;let m=Tn.getInfo(d,g);o.listeners.forEach(w=>{w(d,g,m);}),o.rawEmitter(m.event,d,m);})},zr.set(s,o)),()=>{let d=o.listeners;if(d.delete(p),!d.size&&(zr.delete(s),o.watcher))return o.watcher.stop().then(()=>{o.rawEmitter=o.watcher=void 0,Object.freeze(o);})}}var _q=t=>{let e=0;for(let r of zr.keys())if(r.indexOf(t)===0&&(e++,e>=bq))return !0;return !1},Cq=()=>Tn&&zr.size<128,pc=(t,e)=>{let r=0;for(;!t.indexOf(e)&&(t=qe.dirname(t))!==e;)r++;return r},pb=(t,e)=>t.type===Ti&&e.isDirectory()||t.type===db&&e.isSymbolicLink()||t.type===dq&&e.isFile(),yc=class{constructor(e){this.fsw=e;}checkIgnored(e,r){let n=this.fsw._ignoredPaths;if(this.fsw._isIgnored(e,r))return n.add(e),r&&r.isDirectory()&&n.add(e+cb),!0;n.delete(e),n.delete(e+cb);}addOrChange(e,r,n,s,i,o,u,c){let p=i.has(o)?sq:fc;this.handleEvent(p,e,r,n,s,i,o,u,c);}async checkExists(e,r,n,s,i,o,u,c){try{let p=await dc(e);if(this.fsw.closed)return;pb(u,p)?this.addOrChange(e,r,n,s,i,o,u,c):this.handleEvent($o,e,r,n,s,i,o,u,c);}catch(p){p.code==="EACCES"?this.addOrChange(e,r,n,s,i,o,u,c):this.handleEvent($o,e,r,n,s,i,o,u,c);}}handleEvent(e,r,n,s,i,o,u,c,p){if(!(this.fsw.closed||this.checkIgnored(r)))if(e===$o){let l=c.type===Ti;(l||o.has(u))&&this.fsw._remove(i,u,l);}else {if(e===fc){if(c.type===Ti&&this.fsw._getWatchedDir(r),c.type===db&&p.followSymlinks){let d=p.depth===void 0?void 0:pc(n,s)+1;return this._addToFsEvents(r,!1,!0,d)}this.fsw._getWatchedDir(i).add(u);}let l=c.type===Ti?e+yq:e;this.fsw._emit(l,r),l===lb&&this._addToFsEvents(r,!1,!0);}}_watchWithFsEvents(e,r,n,s){if(this.fsw.closed||this.fsw._isIgnored(e))return;let i=this.fsw.options,u=Aq(e,r,async(c,p,l)=>{if(this.fsw.closed||i.depth!==void 0&&pc(c,r)>i.depth)return;let d=n(qe.join(e,qe.relative(e,c)));if(s&&!s(d))return;let g=qe.dirname(d),m=qe.basename(d),w=this.fsw._getWatchedDir(l.type===Ti?d:g);if(Eq.has(p)||l.event===pq)if(typeof i.ignored===hc){let E;try{E=await dc(d);}catch{}if(this.fsw.closed||this.checkIgnored(d,E))return;pb(l,E)?this.addOrChange(d,c,r,g,w,m,l,i):this.handleEvent($o,d,c,r,g,w,m,l,i);}else this.checkExists(d,c,r,g,w,m,l,i);else switch(l.event){case lq:case cq:return this.addOrChange(d,c,r,g,w,m,l,i);case fq:case hq:return this.checkExists(d,c,r,g,w,m,l,i)}},this.fsw._emitRaw);return this.fsw._emitReady(),u}async _handleFsEventsSymlink(e,r,n,s){if(!(this.fsw.closed||this.fsw._symlinkPaths.has(r))){this.fsw._symlinkPaths.set(r,!0),this.fsw._incrReadyCount();try{let i=await hb(e);if(this.fsw.closed)return;if(this.fsw._isIgnored(i))return this.fsw._emitReady();this.fsw._incrReadyCount(),this._addToFsEvents(i||e,o=>{let u=e;return i&&i!==fb?u=o.replace(i,e):o!==fb&&(u=qe.join(e,o)),n(u)},!1,s);}catch(i){if(this.fsw._handleError(i))return this.fsw._emitReady()}}}emitAdd(e,r,n,s,i){let o=n(e),u=r.isDirectory(),c=this.fsw._getWatchedDir(qe.dirname(o)),p=qe.basename(o);u&&this.fsw._getWatchedDir(o),!c.has(p)&&(c.add(p),(!s.ignoreInitial||i===!0)&&this.fsw._emit(u?lb:fc,o,r));}initWatch(e,r,n,s){if(this.fsw.closed)return;let i=this._watchWithFsEvents(n.watchPath,qe.resolve(e||n.watchPath),s,n.globFilter);this.fsw._addPathCloser(r,i);}async _addToFsEvents(e,r,n,s){if(this.fsw.closed)return;let i=this.fsw.options,o=typeof r===hc?r:mq,u=this.fsw._getWatchHelpers(e);try{let c=await Sq[u.statMethod](u.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(u.watchPath,c))throw null;if(c.isDirectory()){if(u.globFilter||this.emitAdd(o(e),c,o,i,n),s&&s>i.depth)return;this.fsw._readdirp(u.watchPath,{fileFilter:p=>u.filterPath(p),directoryFilter:p=>u.filterDir(p),...wq(i.depth-(s||0))}).on(aq,p=>{if(this.fsw.closed||p.stats.isDirectory()&&!u.filterPath(p))return;let l=qe.join(u.watchPath,p.path),{fullPath:d}=p;if(u.followSymlinks&&p.stats.isSymbolicLink()){let g=i.depth===void 0?void 0:pc(l,qe.resolve(u.watchPath))+1;this._handleFsEventsSymlink(l,d,o,g);}else this.emitAdd(l,p.stats,o,i,n);}).on(oq,gq).on(uq,()=>{this.fsw._emitReady();});}else this.emitAdd(u.watchPath,c,o,i,n),this.fsw._emitReady();}catch(c){(!c||this.fsw._handleError(c))&&(this.fsw._emitReady(),this.fsw._emitReady());}if(i.persistent&&n!==!0)if(typeof r===hc)this.initWatch(void 0,e,u,o);else {let c;try{c=await hb(u.watchPath);}catch{}this.initWatch(c,e,u,o);}}};wc.exports=yc;wc.exports.canUse=Cq;});var Cb=_(Fc=>{var{EventEmitter:Rq}=G("events"),Ic=G("fs"),ge=G("path"),{promisify:Eb}=G("util"),Oq=tS(),Ac=uS().default,Tq=dS(),vc=Ql(),Pq=XS(),Iq=Jl(),$q=ub(),gb=yb(),{EV_ALL:Sc,EV_READY:Fq,EV_ADD:Fo,EV_CHANGE:Pi,EV_UNLINK:mb,EV_ADD_DIR:kq,EV_UNLINK_DIR:Lq,EV_RAW:qq,EV_ERROR:bc,STR_CLOSE:Bq,STR_END:Dq,BACK_SLASH_RE:Nq,DOUBLE_SLASH_RE:wb,SLASH_OR_BACK_SLASH_RE:Mq,DOT_RE:Uq,REPLACER_RE:jq,SLASH:Ec,SLASH_SLASH:Hq,BRACE_START:Wq,BANG:_c,ONE_DOT:xb,TWO_DOTS:zq,GLOBSTAR:Gq,SLASH_GLOBSTAR:xc,ANYMATCH_OPTS:Cc,STRING_TYPE:$c,FUNCTION_TYPE:Vq,EMPTY_STR:Rc,EMPTY_FN:Kq,isWindows:Yq,isMacos:Jq,isIBMi:Xq}=Ro(),Qq=Eb(Ic.stat),Zq=Eb(Ic.readdir),Oc=(t=[])=>Array.isArray(t)?t:[t],Ab=(t,e=[])=>(t.forEach(r=>{Array.isArray(r)?Ab(r,e):e.push(r);}),e),vb=t=>{let e=Ab(Oc(t));if(!e.every(r=>typeof r===$c))throw new TypeError(`Non-string provided as watch path: ${e}`);return e.map(_b)},Sb=t=>{let e=t.replace(Nq,Ec),r=!1;for(e.startsWith(Hq)&&(r=!0);e.match(wb);)e=e.replace(wb,Ec);return r&&(e=Ec+e),e},_b=t=>Sb(ge.normalize(Sb(t))),bb=(t=Rc)=>e=>typeof e!==$c?e:_b(ge.isAbsolute(e)?e:ge.join(t,e)),eB=(t,e)=>ge.isAbsolute(t)?t:t.startsWith(_c)?_c+ge.join(e,t.slice(1)):ge.join(e,t),Pt=(t,e)=>t[e]===void 0,Tc=class{constructor(e,r){this.path=e,this._removeWatcher=r,this.items=new Set;}add(e){let{items:r}=this;r&&e!==xb&&e!==zq&&r.add(e);}async remove(e){let{items:r}=this;if(!r||(r.delete(e),r.size>0))return;let n=this.path;try{await Zq(n);}catch{this._removeWatcher&&this._removeWatcher(ge.dirname(n),ge.basename(n));}}has(e){let{items:r}=this;if(r)return r.has(e)}getChildren(){let{items:e}=this;if(e)return [...e.values()]}dispose(){this.items.clear(),delete this.path,delete this._removeWatcher,delete this.items,Object.freeze(this);}},tB="stat",rB="lstat",Pc=class{constructor(e,r,n,s){this.fsw=s,this.path=e=e.replace(jq,Rc),this.watchPath=r,this.fullWatchPath=ge.resolve(r),this.hasGlob=r!==e,e===Rc&&(this.hasGlob=!1),this.globSymlink=this.hasGlob&&n?void 0:!1,this.globFilter=this.hasGlob?Ac(e,void 0,Cc):!1,this.dirParts=this.getDirParts(e),this.dirParts.forEach(i=>{i.length>1&&i.pop();}),this.followSymlinks=n,this.statMethod=n?tB:rB;}checkGlobSymlink(e){return this.globSymlink===void 0&&(this.globSymlink=e.fullParentDir===this.fullWatchPath?!1:{realPath:e.fullParentDir,linkPath:this.fullWatchPath}),this.globSymlink?e.fullPath.replace(this.globSymlink.realPath,this.globSymlink.linkPath):e.fullPath}entryPath(e){return ge.join(this.watchPath,ge.relative(this.watchPath,this.checkGlobSymlink(e)))}filterPath(e){let{stats:r}=e;if(r&&r.isSymbolicLink())return this.filterDir(e);let n=this.entryPath(e);return (this.hasGlob&&typeof this.globFilter===Vq?this.globFilter(n):!0)&&this.fsw._isntIgnored(n,r)&&this.fsw._hasReadPermissions(r)}getDirParts(e){if(!this.hasGlob)return [];let r=[];return (e.includes(Wq)?Pq.expand(e):[e]).forEach(s=>{r.push(ge.relative(this.watchPath,s).split(Mq));}),r}filterDir(e){if(this.hasGlob){let r=this.getDirParts(this.checkGlobSymlink(e)),n=!1;this.unmatchedGlob=!this.dirParts.some(s=>s.every((i,o)=>(i===Gq&&(n=!0),n||!r[0][o]||Ac(i,r[0][o],Cc))));}return !this.unmatchedGlob&&this.fsw._isntIgnored(this.entryPath(e),e.stats)}},ko=class extends Rq{constructor(e){super();let r={};e&&Object.assign(r,e),this._watched=new Map,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._symlinkPaths=new Map,this._streams=new Set,this.closed=!1,Pt(r,"persistent")&&(r.persistent=!0),Pt(r,"ignoreInitial")&&(r.ignoreInitial=!1),Pt(r,"ignorePermissionErrors")&&(r.ignorePermissionErrors=!1),Pt(r,"interval")&&(r.interval=100),Pt(r,"binaryInterval")&&(r.binaryInterval=300),Pt(r,"disableGlobbing")&&(r.disableGlobbing=!1),r.enableBinaryInterval=r.binaryInterval!==r.interval,Pt(r,"useFsEvents")&&(r.useFsEvents=!r.usePolling),gb.canUse()||(r.useFsEvents=!1),Pt(r,"usePolling")&&!r.useFsEvents&&(r.usePolling=Jq),Xq&&(r.usePolling=!0);let s=process.env.CHOKIDAR_USEPOLLING;if(s!==void 0){let c=s.toLowerCase();c==="false"||c==="0"?r.usePolling=!1:c==="true"||c==="1"?r.usePolling=!0:r.usePolling=!!c;}let i=process.env.CHOKIDAR_INTERVAL;i&&(r.interval=Number.parseInt(i,10)),Pt(r,"atomic")&&(r.atomic=!r.usePolling&&!r.useFsEvents),r.atomic&&(this._pendingUnlinks=new Map),Pt(r,"followSymlinks")&&(r.followSymlinks=!0),Pt(r,"awaitWriteFinish")&&(r.awaitWriteFinish=!1),r.awaitWriteFinish===!0&&(r.awaitWriteFinish={});let o=r.awaitWriteFinish;o&&(o.stabilityThreshold||(o.stabilityThreshold=2e3),o.pollInterval||(o.pollInterval=100),this._pendingWrites=new Map),r.ignored&&(r.ignored=Oc(r.ignored));let u=0;this._emitReady=()=>{u++,u>=this._readyCount&&(this._emitReady=Kq,this._readyEmitted=!0,process.nextTick(()=>this.emit(Fq)));},this._emitRaw=(...c)=>this.emit(qq,...c),this._readyEmitted=!1,this.options=r,r.useFsEvents?this._fsEventsHandler=new gb(this):this._nodeFsHandler=new $q(this),Object.freeze(r);}add(e,r,n){let{cwd:s,disableGlobbing:i}=this.options;this.closed=!1;let o=vb(e);return s&&(o=o.map(u=>{let c=eB(u,s);return i||!vc(u)?c:Iq(c)})),o=o.filter(u=>u.startsWith(_c)?(this._ignoredPaths.add(u.slice(1)),!1):(this._ignoredPaths.delete(u),this._ignoredPaths.delete(u+xc),this._userIgnored=void 0,!0)),this.options.useFsEvents&&this._fsEventsHandler?(this._readyCount||(this._readyCount=o.length),this.options.persistent&&(this._readyCount*=2),o.forEach(u=>this._fsEventsHandler._addToFsEvents(u))):(this._readyCount||(this._readyCount=0),this._readyCount+=o.length,Promise.all(o.map(async u=>{let c=await this._nodeFsHandler._addToNodeFs(u,!n,0,0,r);return c&&this._emitReady(),c})).then(u=>{this.closed||u.filter(c=>c).forEach(c=>{this.add(ge.dirname(c),ge.basename(r||c));});})),this}unwatch(e){if(this.closed)return this;let r=vb(e),{cwd:n}=this.options;return r.forEach(s=>{!ge.isAbsolute(s)&&!this._closers.has(s)&&(n&&(s=ge.join(n,s)),s=ge.resolve(s)),this._closePath(s),this._ignoredPaths.add(s),this._watched.has(s)&&this._ignoredPaths.add(s+xc),this._userIgnored=void 0;}),this}close(){if(this.closed)return this._closePromise;this.closed=!0,this.removeAllListeners();let e=[];return this._closers.forEach(r=>r.forEach(n=>{let s=n();s instanceof Promise&&e.push(s);})),this._streams.forEach(r=>r.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(r=>r.dispose()),["closers","watched","streams","symlinkPaths","throttled"].forEach(r=>{this[`_${r}`].clear();}),this._closePromise=e.length?Promise.all(e).then(()=>{}):Promise.resolve(),this._closePromise}getWatched(){let e={};return this._watched.forEach((r,n)=>{let s=this.options.cwd?ge.relative(this.options.cwd,n):n;e[s||xb]=r.getChildren().sort();}),e}emitWithAll(e,r){this.emit(...r),e!==bc&&this.emit(Sc,...r);}async _emit(e,r,n,s,i){if(this.closed)return;let o=this.options;Yq&&(r=ge.normalize(r)),o.cwd&&(r=ge.relative(o.cwd,r));let u=[e,r];i!==void 0?u.push(n,s,i):s!==void 0?u.push(n,s):n!==void 0&&u.push(n);let c=o.awaitWriteFinish,p;if(c&&(p=this._pendingWrites.get(r)))return p.lastChange=new Date,this;if(o.atomic){if(e===mb)return this._pendingUnlinks.set(r,u),setTimeout(()=>{this._pendingUnlinks.forEach((l,d)=>{this.emit(...l),this.emit(Sc,...l),this._pendingUnlinks.delete(d);});},typeof o.atomic=="number"?o.atomic:100),this;e===Fo&&this._pendingUnlinks.has(r)&&(e=u[0]=Pi,this._pendingUnlinks.delete(r));}if(c&&(e===Fo||e===Pi)&&this._readyEmitted){let l=(d,g)=>{d?(e=u[0]=bc,u[1]=d,this.emitWithAll(e,u)):g&&(u.length>2?u[2]=g:u.push(g),this.emitWithAll(e,u));};return this._awaitWriteFinish(r,c.stabilityThreshold,e,l),this}if(e===Pi&&!this._throttle(Pi,r,50))return this;if(o.alwaysStat&&n===void 0&&(e===Fo||e===kq||e===Pi)){let l=o.cwd?ge.join(o.cwd,r):r,d;try{d=await Qq(l);}catch{}if(!d||this.closed)return;u.push(d);}return this.emitWithAll(e,u),this}_handleError(e){let r=e&&e.code;return e&&r!=="ENOENT"&&r!=="ENOTDIR"&&(!this.options.ignorePermissionErrors||r!=="EPERM"&&r!=="EACCES")&&this.emit(bc,e),e||this.closed}_throttle(e,r,n){this._throttled.has(e)||this._throttled.set(e,new Map);let s=this._throttled.get(e),i=s.get(r);if(i)return i.count++,!1;let o,u=()=>{let p=s.get(r),l=p?p.count:0;return s.delete(r),clearTimeout(o),p&&clearTimeout(p.timeoutObject),l};o=setTimeout(u,n);let c={timeoutObject:o,clear:u,count:0};return s.set(r,c),c}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,r,n,s){let i,o=e;this.options.cwd&&!ge.isAbsolute(e)&&(o=ge.join(this.options.cwd,e));let u=new Date,c=p=>{Ic.stat(o,(l,d)=>{if(l||!this._pendingWrites.has(e)){l&&l.code!=="ENOENT"&&s(l);return}let g=Number(new Date);p&&d.size!==p.size&&(this._pendingWrites.get(e).lastChange=g);let m=this._pendingWrites.get(e);g-m.lastChange>=r?(this._pendingWrites.delete(e),s(void 0,d)):i=setTimeout(c,this.options.awaitWriteFinish.pollInterval,d);});};this._pendingWrites.has(e)||(this._pendingWrites.set(e,{lastChange:u,cancelWait:()=>(this._pendingWrites.delete(e),clearTimeout(i),n)}),i=setTimeout(c,this.options.awaitWriteFinish.pollInterval));}_getGlobIgnored(){return [...this._ignoredPaths.values()]}_isIgnored(e,r){if(this.options.atomic&&Uq.test(e))return !0;if(!this._userIgnored){let{cwd:n}=this.options,s=this.options.ignored,i=s&&s.map(bb(n)),o=Oc(i).filter(c=>typeof c===$c&&!vc(c)).map(c=>c+xc),u=this._getGlobIgnored().map(bb(n)).concat(i,o);this._userIgnored=Ac(u,void 0,Cc);}return this._userIgnored([e,r])}_isntIgnored(e,r){return !this._isIgnored(e,r)}_getWatchHelpers(e,r){let n=r||this.options.disableGlobbing||!vc(e)?e:Tq(e),s=this.options.followSymlinks;return new Pc(e,n,s,this)}_getWatchedDir(e){this._boundRemove||(this._boundRemove=this._remove.bind(this));let r=ge.resolve(e);return this._watched.has(r)||this._watched.set(r,new Tc(r,this._boundRemove)),this._watched.get(r)}_hasReadPermissions(e){if(this.options.ignorePermissionErrors)return !0;let n=(e&&Number.parseInt(e.mode,10))&511;return !!(4&Number.parseInt(n.toString(8)[0],10))}_remove(e,r,n){let s=ge.join(e,r),i=ge.resolve(s);if(n=n??(this._watched.has(s)||this._watched.has(i)),!this._throttle("remove",s,100))return;!n&&!this.options.useFsEvents&&this._watched.size===1&&this.add(e,r,!0),this._getWatchedDir(s).getChildren().forEach(g=>this._remove(s,g));let c=this._getWatchedDir(e),p=c.has(r);c.remove(r),this._symlinkPaths.has(i)&&this._symlinkPaths.delete(i);let l=s;if(this.options.cwd&&(l=ge.relative(this.options.cwd,s)),this.options.awaitWriteFinish&&this._pendingWrites.has(l)&&this._pendingWrites.get(l).cancelWait()===Fo)return;this._watched.delete(s),this._watched.delete(i);let d=n?Lq:mb;p&&!this._isIgnored(s)&&this._emit(d,s),this.options.useFsEvents||this._closePath(s);}_closePath(e){this._closeFile(e);let r=ge.dirname(e);this._getWatchedDir(r).remove(ge.basename(e));}_closeFile(e){let r=this._closers.get(e);r&&(r.forEach(n=>n()),this._closers.delete(e));}_addPathCloser(e,r){if(!r)return;let n=this._closers.get(e);n||(n=[],this._closers.set(e,n)),n.push(r);}_readdirp(e,r){if(this.closed)return;let n={type:Sc,alwaysStat:!0,lstat:!0,...r},s=Oq(e,n);return this._streams.add(s),s.once(Bq,()=>{s=void 0;}),s.once(Dq,()=>{s&&(this._streams.delete(s),s=void 0);}),s}};Fc.FSWatcher=ko;var nB=(t,e)=>{let r=new ko(e);return r.add(t),r};Fc.watch=nB;});var Bb=_((Jr,qb)=>{var Uc=G("crypto");Jr=qb.exports=Di;function Di(t,e){return e=kb(t,e),oB(t,e)}Jr.sha1=function(t){return Di(t)};Jr.keys=function(t){return Di(t,{excludeValues:!0,algorithm:"sha1",encoding:"hex"})};Jr.MD5=function(t){return Di(t,{algorithm:"md5",encoding:"hex"})};Jr.keysMD5=function(t){return Di(t,{algorithm:"md5",encoding:"hex",excludeValues:!0})};var Bn=Uc.getHashes?Uc.getHashes().slice():["sha1","md5"];Bn.push("passthrough");var $b=["buffer","hex","binary","base64"];function kb(t,e){e=e||{};var r={};if(r.algorithm=e.algorithm||"sha1",r.encoding=e.encoding||"hex",r.excludeValues=!!e.excludeValues,r.algorithm=r.algorithm.toLowerCase(),r.encoding=r.encoding.toLowerCase(),r.ignoreUnknown=e.ignoreUnknown===!0,r.respectType=e.respectType!==!1,r.respectFunctionNames=e.respectFunctionNames!==!1,r.respectFunctionProperties=e.respectFunctionProperties!==!1,r.unorderedArrays=e.unorderedArrays===!0,r.unorderedSets=e.unorderedSets!==!1,r.unorderedObjects=e.unorderedObjects!==!1,r.replacer=e.replacer||void 0,r.excludeKeys=e.excludeKeys||void 0,typeof t>"u")throw new Error("Object argument required.");for(var n=0;n<Bn.length;++n)Bn[n].toLowerCase()===r.algorithm.toLowerCase()&&(r.algorithm=Bn[n]);if(Bn.indexOf(r.algorithm)===-1)throw new Error('Algorithm "'+r.algorithm+'" not supported. supported values: '+Bn.join(", "));if($b.indexOf(r.encoding)===-1&&r.algorithm!=="passthrough")throw new Error('Encoding "'+r.encoding+'" not supported. supported values: '+$b.join(", "));return r}function Fb(t){if(typeof t!="function")return !1;var e=/^function\s+\w*\s*\(\s*\)\s*{\s+\[native code\]\s+}$/i;return e.exec(Function.prototype.toString.call(t))!=null}function oB(t,e){var r;e.algorithm!=="passthrough"?r=Uc.createHash(e.algorithm):r=new Lb,typeof r.write>"u"&&(r.write=r.update,r.end=r.update);var n=jc(e,r);if(n.dispatch(t),r.update||r.end(""),r.digest)return r.digest(e.encoding==="buffer"?void 0:e.encoding);var s=r.read();return e.encoding==="buffer"?s:s.toString(e.encoding)}Jr.writeToStream=function(t,e,r){return typeof r>"u"&&(r=e,e={}),e=kb(t,e),jc(e,r).dispatch(t)};function jc(t,e,r){r=r||[];var n=function(s){return e.update?e.update(s,"utf8"):e.write(s,"utf8")};return {dispatch:function(s){t.replacer&&(s=t.replacer(s));var i=typeof s;return s===null&&(i="null"),this["_"+i](s)},_object:function(s){var i=/\[object (.*)\]/i,o=Object.prototype.toString.call(s),u=i.exec(o);u?u=u[1]:u="unknown:["+o+"]",u=u.toLowerCase();var c=null;if((c=r.indexOf(s))>=0)return this.dispatch("[CIRCULAR:"+c+"]");if(r.push(s),typeof Buffer<"u"&&Buffer.isBuffer&&Buffer.isBuffer(s))return n("buffer:"),n(s);if(u!=="object"&&u!=="function"&&u!=="asyncfunction")if(this["_"+u])this["_"+u](s);else {if(t.ignoreUnknown)return n("["+u+"]");throw new Error('Unknown object type "'+u+'"')}else {var p=Object.keys(s);t.unorderedObjects&&(p=p.sort()),t.respectType!==!1&&!Fb(s)&&p.splice(0,0,"prototype","__proto__","constructor"),t.excludeKeys&&(p=p.filter(function(d){return !t.excludeKeys(d)})),n("object:"+p.length+":");var l=this;return p.forEach(function(d){l.dispatch(d),n(":"),t.excludeValues||l.dispatch(s[d]),n(",");})}},_array:function(s,i){i=typeof i<"u"?i:t.unorderedArrays!==!1;var o=this;if(n("array:"+s.length+":"),!i||s.length<=1)return s.forEach(function(p){return o.dispatch(p)});var u=[],c=s.map(function(p){var l=new Lb,d=r.slice(),g=jc(t,l,d);return g.dispatch(p),u=u.concat(d.slice(r.length)),l.read().toString()});return r=r.concat(u),c.sort(),this._array(c,!1)},_date:function(s){return n("date:"+s.toJSON())},_symbol:function(s){return n("symbol:"+s.toString())},_error:function(s){return n("error:"+s.toString())},_boolean:function(s){return n("bool:"+s.toString())},_string:function(s){n("string:"+s.length+":"),n(s.toString());},_function:function(s){n("fn:"),Fb(s)?this.dispatch("[native]"):this.dispatch(s.toString()),t.respectFunctionNames!==!1&&this.dispatch("function-name:"+String(s.name)),t.respectFunctionProperties&&this._object(s);},_number:function(s){return n("number:"+s.toString())},_xml:function(s){return n("xml:"+s.toString())},_null:function(){return n("Null")},_undefined:function(){return n("Undefined")},_regexp:function(s){return n("regex:"+s.toString())},_uint8array:function(s){return n("uint8array:"),this.dispatch(Array.prototype.slice.call(s))},_uint8clampedarray:function(s){return n("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(s))},_int8array:function(s){return n("int8array:"),this.dispatch(Array.prototype.slice.call(s))},_uint16array:function(s){return n("uint16array:"),this.dispatch(Array.prototype.slice.call(s))},_int16array:function(s){return n("int16array:"),this.dispatch(Array.prototype.slice.call(s))},_uint32array:function(s){return n("uint32array:"),this.dispatch(Array.prototype.slice.call(s))},_int32array:function(s){return n("int32array:"),this.dispatch(Array.prototype.slice.call(s))},_float32array:function(s){return n("float32array:"),this.dispatch(Array.prototype.slice.call(s))},_float64array:function(s){return n("float64array:"),this.dispatch(Array.prototype.slice.call(s))},_arraybuffer:function(s){return n("arraybuffer:"),this.dispatch(new Uint8Array(s))},_url:function(s){return n("url:"+s.toString())},_map:function(s){n("map:");var i=Array.from(s);return this._array(i,t.unorderedSets!==!1)},_set:function(s){n("set:");var i=Array.from(s);return this._array(i,t.unorderedSets!==!1)},_file:function(s){return n("file:"),this.dispatch([s.name,s.size,s.type,s.lastModfied])},_blob:function(){if(t.ignoreUnknown)return n("[blob]");throw Error(`Hashing Blob objects is currently not supported
(see https://github.com/puleos/object-hash/issues/26)
Use "options.replacer" or "options.ignoreUnknown"
`)},_domwindow:function(){return n("domwindow")},_bigint:function(s){return n("bigint:"+s.toString())},_process:function(){return n("process")},_timer:function(){return n("timer")},_pipe:function(){return n("pipe")},_tcp:function(){return n("tcp")},_udp:function(){return n("udp")},_tty:function(){return n("tty")},_statwatcher:function(){return n("statwatcher")},_securecontext:function(){return n("securecontext")},_connection:function(){return n("connection")},_zlib:function(){return n("zlib")},_context:function(){return n("context")},_nodescript:function(){return n("nodescript")},_httpparser:function(){return n("httpparser")},_dataview:function(){return n("dataview")},_signal:function(){return n("signal")},_fsevent:function(){return n("fsevent")},_tlswrap:function(){return n("tlswrap")}}}function Lb(){return {buf:"",write:function(t){this.buf+=t;},end:function(t){this.buf+=t;},read:function(){return this.buf}}}});var Nb=_((GM,Db)=>{Db.exports={STRING:2,BOOLEAN:4,BYTES:4,NUMBER:8,Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8};});var jb=_(Mo=>{Mo.byteLength=uB;Mo.toByteArray=cB;Mo.fromByteArray=pB;var Vt=[],At=[],aB=typeof Uint8Array<"u"?Uint8Array:Array,Hc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Xr=0,Mb=Hc.length;Xr<Mb;++Xr)Vt[Xr]=Hc[Xr],At[Hc.charCodeAt(Xr)]=Xr;var Xr,Mb;At["-".charCodeAt(0)]=62;At["_".charCodeAt(0)]=63;function Ub(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return [r,n]}function uB(t){var e=Ub(t),r=e[0],n=e[1];return (r+n)*3/4-n}function lB(t,e,r){return (e+r)*3/4-r}function cB(t){var e,r=Ub(t),n=r[0],s=r[1],i=new aB(lB(t,n,s)),o=0,u=s>0?n-4:n,c;for(c=0;c<u;c+=4)e=At[t.charCodeAt(c)]<<18|At[t.charCodeAt(c+1)]<<12|At[t.charCodeAt(c+2)]<<6|At[t.charCodeAt(c+3)],i[o++]=e>>16&255,i[o++]=e>>8&255,i[o++]=e&255;return s===2&&(e=At[t.charCodeAt(c)]<<2|At[t.charCodeAt(c+1)]>>4,i[o++]=e&255),s===1&&(e=At[t.charCodeAt(c)]<<10|At[t.charCodeAt(c+1)]<<4|At[t.charCodeAt(c+2)]>>2,i[o++]=e>>8&255,i[o++]=e&255),i}function fB(t){return Vt[t>>18&63]+Vt[t>>12&63]+Vt[t>>6&63]+Vt[t&63]}function hB(t,e,r){for(var n,s=[],i=e;i<r;i+=3)n=(t[i]<<16&16711680)+(t[i+1]<<8&65280)+(t[i+2]&255),s.push(fB(n));return s.join("")}function pB(t){for(var e,r=t.length,n=r%3,s=[],i=16383,o=0,u=r-n;o<u;o+=i)s.push(hB(t,o,o+i>u?u:o+i));return n===1?(e=t[r-1],s.push(Vt[e>>2]+Vt[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],s.push(Vt[e>>10]+Vt[e>>4&63]+Vt[e<<2&63]+"=")),s.join("")}});var Hb=_(Wc=>{Wc.read=function(t,e,r,n,s){var i,o,u=s*8-n-1,c=(1<<u)-1,p=c>>1,l=-7,d=r?s-1:0,g=r?-1:1,m=t[e+d];for(d+=g,i=m&(1<<-l)-1,m>>=-l,l+=u;l>0;i=i*256+t[e+d],d+=g,l-=8);for(o=i&(1<<-l)-1,i>>=-l,l+=n;l>0;o=o*256+t[e+d],d+=g,l-=8);if(i===0)i=1-p;else {if(i===c)return o?NaN:(m?-1:1)*(1/0);o=o+Math.pow(2,n),i=i-p;}return (m?-1:1)*o*Math.pow(2,i-n)};Wc.write=function(t,e,r,n,s,i){var o,u,c,p=i*8-s-1,l=(1<<p)-1,d=l>>1,g=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=n?0:i-1,w=n?1:-1,E=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,o=l):(o=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+d>=1?e+=g/c:e+=g*Math.pow(2,1-d),e*c>=2&&(o++,c/=2),o+d>=l?(u=0,o=l):o+d>=1?(u=(e*c-1)*Math.pow(2,s),o=o+d):(u=e*Math.pow(2,d-1)*Math.pow(2,s),o=0));s>=8;t[r+m]=u&255,m+=w,u/=256,s-=8);for(o=o<<s|u,p+=s;p>0;t[r+m]=o&255,m+=w,o/=256,p-=8);t[r+m-w]|=E*128;};});var oE=_(Un=>{var zc=jb(),Nn=Hb(),Wb=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Un.Buffer=$;Un.SlowBuffer=vB;Un.INSPECT_MAX_BYTES=50;var Uo=2147483647;Un.kMaxLength=Uo;$.TYPED_ARRAY_SUPPORT=dB();!$.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function dB(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch{return !1}}Object.defineProperty($.prototype,"parent",{enumerable:!0,get:function(){if($.isBuffer(this))return this.buffer}});Object.defineProperty($.prototype,"offset",{enumerable:!0,get:function(){if($.isBuffer(this))return this.byteOffset}});function nr(t){if(t>Uo)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,$.prototype),e}function $(t,e,r){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Yc(t)}return Kb(t,e,r)}$.poolSize=8192;function Kb(t,e,r){if(typeof t=="string")return gB(t,e);if(ArrayBuffer.isView(t))return mB(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(Kt(t,ArrayBuffer)||t&&Kt(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Kt(t,SharedArrayBuffer)||t&&Kt(t.buffer,SharedArrayBuffer)))return Vc(t,e,r);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=t.valueOf&&t.valueOf();if(n!=null&&n!==t)return $.from(n,e,r);let s=wB(t);if(s)return s;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return $.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}$.from=function(t,e,r){return Kb(t,e,r)};Object.setPrototypeOf($.prototype,Uint8Array.prototype);Object.setPrototypeOf($,Uint8Array);function Yb(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function yB(t,e,r){return Yb(t),t<=0?nr(t):e!==void 0?typeof r=="string"?nr(t).fill(e,r):nr(t).fill(e):nr(t)}$.alloc=function(t,e,r){return yB(t,e,r)};function Yc(t){return Yb(t),nr(t<0?0:Jc(t)|0)}$.allocUnsafe=function(t){return Yc(t)};$.allocUnsafeSlow=function(t){return Yc(t)};function gB(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!$.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let r=Jb(t,e)|0,n=nr(r),s=n.write(t,e);return s!==r&&(n=n.slice(0,s)),n}function Gc(t){let e=t.length<0?0:Jc(t.length)|0,r=nr(e);for(let n=0;n<e;n+=1)r[n]=t[n]&255;return r}function mB(t){if(Kt(t,Uint8Array)){let e=new Uint8Array(t);return Vc(e.buffer,e.byteOffset,e.byteLength)}return Gc(t)}function Vc(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return e===void 0&&r===void 0?n=new Uint8Array(t):r===void 0?n=new Uint8Array(t,e):n=new Uint8Array(t,e,r),Object.setPrototypeOf(n,$.prototype),n}function wB(t){if($.isBuffer(t)){let e=Jc(t.length)|0,r=nr(e);return r.length===0||t.copy(r,0,0,e),r}if(t.length!==void 0)return typeof t.length!="number"||Qc(t.length)?nr(0):Gc(t);if(t.type==="Buffer"&&Array.isArray(t.data))return Gc(t.data)}function Jc(t){if(t>=Uo)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Uo.toString(16)+" bytes");return t|0}function vB(t){return +t!=t&&(t=0),$.alloc(+t)}$.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==$.prototype};$.compare=function(e,r){if(Kt(e,Uint8Array)&&(e=$.from(e,e.offset,e.byteLength)),Kt(r,Uint8Array)&&(r=$.from(r,r.offset,r.byteLength)),!$.isBuffer(e)||!$.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===r)return 0;let n=e.length,s=r.length;for(let i=0,o=Math.min(n,s);i<o;++i)if(e[i]!==r[i]){n=e[i],s=r[i];break}return n<s?-1:s<n?1:0};$.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return !0;default:return !1}};$.concat=function(e,r){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return $.alloc(0);let n;if(r===void 0)for(r=0,n=0;n<e.length;++n)r+=e[n].length;let s=$.allocUnsafe(r),i=0;for(n=0;n<e.length;++n){let o=e[n];if(Kt(o,Uint8Array))i+o.length>s.length?($.isBuffer(o)||(o=$.from(o)),o.copy(s,i)):Uint8Array.prototype.set.call(s,o,i);else if($.isBuffer(o))o.copy(s,i);else throw new TypeError('"list" argument must be an Array of Buffers');i+=o.length;}return s};function Jb(t,e){if($.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||Kt(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let r=t.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&r===0)return 0;let s=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Kc(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return sE(t).length;default:if(s)return n?-1:Kc(t).length;e=(""+e).toLowerCase(),s=!0;}}$.byteLength=Jb;function SB(t,e,r){let n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return "";for(t||(t="utf8");;)switch(t){case"hex":return PB(this,e,r);case"utf8":case"utf-8":return Qb(this,e,r);case"ascii":return OB(this,e,r);case"latin1":case"binary":return TB(this,e,r);case"base64":return CB(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return IB(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0;}}$.prototype._isBuffer=!0;function Qr(t,e,r){let n=t[e];t[e]=t[r],t[r]=n;}$.prototype.swap16=function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let r=0;r<e;r+=2)Qr(this,r,r+1);return this};$.prototype.swap32=function(){let e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let r=0;r<e;r+=4)Qr(this,r,r+3),Qr(this,r+1,r+2);return this};$.prototype.swap64=function(){let e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let r=0;r<e;r+=8)Qr(this,r,r+7),Qr(this,r+1,r+6),Qr(this,r+2,r+5),Qr(this,r+3,r+4);return this};$.prototype.toString=function(){let e=this.length;return e===0?"":arguments.length===0?Qb(this,0,e):SB.apply(this,arguments)};$.prototype.toLocaleString=$.prototype.toString;$.prototype.equals=function(e){if(!$.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:$.compare(this,e)===0};$.prototype.inspect=function(){let e="",r=Un.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"};Wb&&($.prototype[Wb]=$.prototype.inspect);$.prototype.compare=function(e,r,n,s,i){if(Kt(e,Uint8Array)&&(e=$.from(e,e.offset,e.byteLength)),!$.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(r===void 0&&(r=0),n===void 0&&(n=e?e.length:0),s===void 0&&(s=0),i===void 0&&(i=this.length),r<0||n>e.length||s<0||i>this.length)throw new RangeError("out of range index");if(s>=i&&r>=n)return 0;if(s>=i)return -1;if(r>=n)return 1;if(r>>>=0,n>>>=0,s>>>=0,i>>>=0,this===e)return 0;let o=i-s,u=n-r,c=Math.min(o,u),p=this.slice(s,i),l=e.slice(r,n);for(let d=0;d<c;++d)if(p[d]!==l[d]){o=p[d],u=l[d];break}return o<u?-1:u<o?1:0};function Xb(t,e,r,n,s){if(t.length===0)return -1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,Qc(r)&&(r=s?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(s)return -1;r=t.length-1;}else if(r<0)if(s)r=0;else return -1;if(typeof e=="string"&&(e=$.from(e,n)),$.isBuffer(e))return e.length===0?-1:zb(t,e,r,n,s);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?s?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):zb(t,[e],r,n,s);throw new TypeError("val must be string, number or Buffer")}function zb(t,e,r,n,s){let i=1,o=t.length,u=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||e.length<2)return -1;i=2,o/=2,u/=2,r/=2;}function c(l,d){return i===1?l[d]:l.readUInt16BE(d*i)}let p;if(s){let l=-1;for(p=r;p<o;p++)if(c(t,p)===c(e,l===-1?0:p-l)){if(l===-1&&(l=p),p-l+1===u)return l*i}else l!==-1&&(p-=p-l),l=-1;}else for(r+u>o&&(r=o-u),p=r;p>=0;p--){let l=!0;for(let d=0;d<u;d++)if(c(t,p+d)!==c(e,d)){l=!1;break}if(l)return p}return -1}$.prototype.includes=function(e,r,n){return this.indexOf(e,r,n)!==-1};$.prototype.indexOf=function(e,r,n){return Xb(this,e,r,n,!0)};$.prototype.lastIndexOf=function(e,r,n){return Xb(this,e,r,n,!1)};function bB(t,e,r,n){r=Number(r)||0;let s=t.length-r;n?(n=Number(n),n>s&&(n=s)):n=s;let i=e.length;n>i/2&&(n=i/2);let o;for(o=0;o<n;++o){let u=parseInt(e.substr(o*2,2),16);if(Qc(u))return o;t[r+o]=u;}return o}function EB(t,e,r,n){return jo(Kc(e,t.length-r),t,r,n)}function xB(t,e,r,n){return jo(LB(e),t,r,n)}function AB(t,e,r,n){return jo(sE(e),t,r,n)}function _B(t,e,r,n){return jo(qB(e,t.length-r),t,r,n)}$.prototype.write=function(e,r,n,s){if(r===void 0)s="utf8",n=this.length,r=0;else if(n===void 0&&typeof r=="string")s=r,n=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(n)?(n=n>>>0,s===void 0&&(s="utf8")):(s=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let i=this.length-r;if((n===void 0||n>i)&&(n=i),e.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");s||(s="utf8");let o=!1;for(;;)switch(s){case"hex":return bB(this,e,r,n);case"utf8":case"utf-8":return EB(this,e,r,n);case"ascii":case"latin1":case"binary":return xB(this,e,r,n);case"base64":return AB(this,e,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _B(this,e,r,n);default:if(o)throw new TypeError("Unknown encoding: "+s);s=(""+s).toLowerCase(),o=!0;}};$.prototype.toJSON=function(){return {type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function CB(t,e,r){return e===0&&r===t.length?zc.fromByteArray(t):zc.fromByteArray(t.slice(e,r))}function Qb(t,e,r){r=Math.min(t.length,r);let n=[],s=e;for(;s<r;){let i=t[s],o=null,u=i>239?4:i>223?3:i>191?2:1;if(s+u<=r){let c,p,l,d;switch(u){case 1:i<128&&(o=i);break;case 2:c=t[s+1],(c&192)===128&&(d=(i&31)<<6|c&63,d>127&&(o=d));break;case 3:c=t[s+1],p=t[s+2],(c&192)===128&&(p&192)===128&&(d=(i&15)<<12|(c&63)<<6|p&63,d>2047&&(d<55296||d>57343)&&(o=d));break;case 4:c=t[s+1],p=t[s+2],l=t[s+3],(c&192)===128&&(p&192)===128&&(l&192)===128&&(d=(i&15)<<18|(c&63)<<12|(p&63)<<6|l&63,d>65535&&d<1114112&&(o=d));}}o===null?(o=65533,u=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|o&1023),n.push(o),s+=u;}return RB(n)}var Gb=4096;function RB(t){let e=t.length;if(e<=Gb)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=Gb));return r}function OB(t,e,r){let n="";r=Math.min(t.length,r);for(let s=e;s<r;++s)n+=String.fromCharCode(t[s]&127);return n}function TB(t,e,r){let n="";r=Math.min(t.length,r);for(let s=e;s<r;++s)n+=String.fromCharCode(t[s]);return n}function PB(t,e,r){let n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);let s="";for(let i=e;i<r;++i)s+=BB[t[i]];return s}function IB(t,e,r){let n=t.slice(e,r),s="";for(let i=0;i<n.length-1;i+=2)s+=String.fromCharCode(n[i]+n[i+1]*256);return s}$.prototype.slice=function(e,r){let n=this.length;e=~~e,r=r===void 0?n:~~r,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<e&&(r=e);let s=this.subarray(e,r);return Object.setPrototypeOf(s,$.prototype),s};function De(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}$.prototype.readUintLE=$.prototype.readUIntLE=function(e,r,n){e=e>>>0,r=r>>>0,n||De(e,r,this.length);let s=this[e],i=1,o=0;for(;++o<r&&(i*=256);)s+=this[e+o]*i;return s};$.prototype.readUintBE=$.prototype.readUIntBE=function(e,r,n){e=e>>>0,r=r>>>0,n||De(e,r,this.length);let s=this[e+--r],i=1;for(;r>0&&(i*=256);)s+=this[e+--r]*i;return s};$.prototype.readUint8=$.prototype.readUInt8=function(e,r){return e=e>>>0,r||De(e,1,this.length),this[e]};$.prototype.readUint16LE=$.prototype.readUInt16LE=function(e,r){return e=e>>>0,r||De(e,2,this.length),this[e]|this[e+1]<<8};$.prototype.readUint16BE=$.prototype.readUInt16BE=function(e,r){return e=e>>>0,r||De(e,2,this.length),this[e]<<8|this[e+1]};$.prototype.readUint32LE=$.prototype.readUInt32LE=function(e,r){return e=e>>>0,r||De(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};$.prototype.readUint32BE=$.prototype.readUInt32BE=function(e,r){return e=e>>>0,r||De(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};$.prototype.readBigUInt64LE=Rr(function(e){e=e>>>0,Mn(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&Ni(e,this.length-8);let s=r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,i=this[++e]+this[++e]*2**8+this[++e]*2**16+n*2**24;return BigInt(s)+(BigInt(i)<<BigInt(32))});$.prototype.readBigUInt64BE=Rr(function(e){e=e>>>0,Mn(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&Ni(e,this.length-8);let s=r*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],i=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return (BigInt(s)<<BigInt(32))+BigInt(i)});$.prototype.readIntLE=function(e,r,n){e=e>>>0,r=r>>>0,n||De(e,r,this.length);let s=this[e],i=1,o=0;for(;++o<r&&(i*=256);)s+=this[e+o]*i;return i*=128,s>=i&&(s-=Math.pow(2,8*r)),s};$.prototype.readIntBE=function(e,r,n){e=e>>>0,r=r>>>0,n||De(e,r,this.length);let s=r,i=1,o=this[e+--s];for(;s>0&&(i*=256);)o+=this[e+--s]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*r)),o};$.prototype.readInt8=function(e,r){return e=e>>>0,r||De(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};$.prototype.readInt16LE=function(e,r){e=e>>>0,r||De(e,2,this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};$.prototype.readInt16BE=function(e,r){e=e>>>0,r||De(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};$.prototype.readInt32LE=function(e,r){return e=e>>>0,r||De(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};$.prototype.readInt32BE=function(e,r){return e=e>>>0,r||De(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};$.prototype.readBigInt64LE=Rr(function(e){e=e>>>0,Mn(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&Ni(e,this.length-8);let s=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return (BigInt(s)<<BigInt(32))+BigInt(r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)});$.prototype.readBigInt64BE=Rr(function(e){e=e>>>0,Mn(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&Ni(e,this.length-8);let s=(r<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return (BigInt(s)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n)});$.prototype.readFloatLE=function(e,r){return e=e>>>0,r||De(e,4,this.length),Nn.read(this,e,!0,23,4)};$.prototype.readFloatBE=function(e,r){return e=e>>>0,r||De(e,4,this.length),Nn.read(this,e,!1,23,4)};$.prototype.readDoubleLE=function(e,r){return e=e>>>0,r||De(e,8,this.length),Nn.read(this,e,!0,52,8)};$.prototype.readDoubleBE=function(e,r){return e=e>>>0,r||De(e,8,this.length),Nn.read(this,e,!1,52,8)};function at(t,e,r,n,s,i){if(!$.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>s||e<i)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}$.prototype.writeUintLE=$.prototype.writeUIntLE=function(e,r,n,s){if(e=+e,r=r>>>0,n=n>>>0,!s){let u=Math.pow(2,8*n)-1;at(this,e,r,n,u,0);}let i=1,o=0;for(this[r]=e&255;++o<n&&(i*=256);)this[r+o]=e/i&255;return r+n};$.prototype.writeUintBE=$.prototype.writeUIntBE=function(e,r,n,s){if(e=+e,r=r>>>0,n=n>>>0,!s){let u=Math.pow(2,8*n)-1;at(this,e,r,n,u,0);}let i=n-1,o=1;for(this[r+i]=e&255;--i>=0&&(o*=256);)this[r+i]=e/o&255;return r+n};$.prototype.writeUint8=$.prototype.writeUInt8=function(e,r,n){return e=+e,r=r>>>0,n||at(this,e,r,1,255,0),this[r]=e&255,r+1};$.prototype.writeUint16LE=$.prototype.writeUInt16LE=function(e,r,n){return e=+e,r=r>>>0,n||at(this,e,r,2,65535,0),this[r]=e&255,this[r+1]=e>>>8,r+2};$.prototype.writeUint16BE=$.prototype.writeUInt16BE=function(e,r,n){return e=+e,r=r>>>0,n||at(this,e,r,2,65535,0),this[r]=e>>>8,this[r+1]=e&255,r+2};$.prototype.writeUint32LE=$.prototype.writeUInt32LE=function(e,r,n){return e=+e,r=r>>>0,n||at(this,e,r,4,4294967295,0),this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255,r+4};$.prototype.writeUint32BE=$.prototype.writeUInt32BE=function(e,r,n){return e=+e,r=r>>>0,n||at(this,e,r,4,4294967295,0),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};function Zb(t,e,r,n,s){iE(e,n,s,t,r,7);let i=Number(e&BigInt(4294967295));t[r++]=i,i=i>>8,t[r++]=i,i=i>>8,t[r++]=i,i=i>>8,t[r++]=i;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o,r}function eE(t,e,r,n,s){iE(e,n,s,t,r,7);let i=Number(e&BigInt(4294967295));t[r+7]=i,i=i>>8,t[r+6]=i,i=i>>8,t[r+5]=i,i=i>>8,t[r+4]=i;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=o,o=o>>8,t[r+2]=o,o=o>>8,t[r+1]=o,o=o>>8,t[r]=o,r+8}$.prototype.writeBigUInt64LE=Rr(function(e,r=0){return Zb(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});$.prototype.writeBigUInt64BE=Rr(function(e,r=0){return eE(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});$.prototype.writeIntLE=function(e,r,n,s){if(e=+e,r=r>>>0,!s){let c=Math.pow(2,8*n-1);at(this,e,r,n,c-1,-c);}let i=0,o=1,u=0;for(this[r]=e&255;++i<n&&(o*=256);)e<0&&u===0&&this[r+i-1]!==0&&(u=1),this[r+i]=(e/o>>0)-u&255;return r+n};$.prototype.writeIntBE=function(e,r,n,s){if(e=+e,r=r>>>0,!s){let c=Math.pow(2,8*n-1);at(this,e,r,n,c-1,-c);}let i=n-1,o=1,u=0;for(this[r+i]=e&255;--i>=0&&(o*=256);)e<0&&u===0&&this[r+i+1]!==0&&(u=1),this[r+i]=(e/o>>0)-u&255;return r+n};$.prototype.writeInt8=function(e,r,n){return e=+e,r=r>>>0,n||at(this,e,r,1,127,-128),e<0&&(e=255+e+1),this[r]=e&255,r+1};$.prototype.writeInt16LE=function(e,r,n){return e=+e,r=r>>>0,n||at(this,e,r,2,32767,-32768),this[r]=e&255,this[r+1]=e>>>8,r+2};$.prototype.writeInt16BE=function(e,r,n){return e=+e,r=r>>>0,n||at(this,e,r,2,32767,-32768),this[r]=e>>>8,this[r+1]=e&255,r+2};$.prototype.writeInt32LE=function(e,r,n){return e=+e,r=r>>>0,n||at(this,e,r,4,2147483647,-2147483648),this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24,r+4};$.prototype.writeInt32BE=function(e,r,n){return e=+e,r=r>>>0,n||at(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};$.prototype.writeBigInt64LE=Rr(function(e,r=0){return Zb(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});$.prototype.writeBigInt64BE=Rr(function(e,r=0){return eE(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function tE(t,e,r,n,s,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function rE(t,e,r,n,s){return e=+e,r=r>>>0,s||tE(t,e,r,4),Nn.write(t,e,r,n,23,4),r+4}$.prototype.writeFloatLE=function(e,r,n){return rE(this,e,r,!0,n)};$.prototype.writeFloatBE=function(e,r,n){return rE(this,e,r,!1,n)};function nE(t,e,r,n,s){return e=+e,r=r>>>0,s||tE(t,e,r,8),Nn.write(t,e,r,n,52,8),r+8}$.prototype.writeDoubleLE=function(e,r,n){return nE(this,e,r,!0,n)};$.prototype.writeDoubleBE=function(e,r,n){return nE(this,e,r,!1,n)};$.prototype.copy=function(e,r,n,s){if(!$.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),!s&&s!==0&&(s=this.length),r>=e.length&&(r=e.length),r||(r=0),s>0&&s<n&&(s=n),s===n||e.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(s<0)throw new RangeError("sourceEnd out of bounds");s>this.length&&(s=this.length),e.length-r<s-n&&(s=e.length-r+n);let i=s-n;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,n,s):Uint8Array.prototype.set.call(e,this.subarray(n,s),r),i};$.prototype.fill=function(e,r,n,s){if(typeof e=="string"){if(typeof r=="string"?(s=r,r=0,n=this.length):typeof n=="string"&&(s=n,n=this.length),s!==void 0&&typeof s!="string")throw new TypeError("encoding must be a string");if(typeof s=="string"&&!$.isEncoding(s))throw new TypeError("Unknown encoding: "+s);if(e.length===1){let o=e.charCodeAt(0);(s==="utf8"&&o<128||s==="latin1")&&(e=o);}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r=r>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);let i;if(typeof e=="number")for(i=r;i<n;++i)this[i]=e;else {let o=$.isBuffer(e)?e:$.from(e,s),u=o.length;if(u===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<n-r;++i)this[i+r]=o[i%u];}return this};var Dn={};function Xc(t,e,r){Dn[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,delete this.name;}get code(){return t}set code(s){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:s,writable:!0});}toString(){return `${this.name} [${t}]: ${this.message}`}};}Xc("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);Xc("ERR_INVALID_ARG_TYPE",function(t,e){return `The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError);Xc("ERR_OUT_OF_RANGE",function(t,e,r){let n=`The value of "${t}" is out of range.`,s=r;return Number.isInteger(r)&&Math.abs(r)>2**32?s=Vb(String(r)):typeof r=="bigint"&&(s=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(s=Vb(s)),s+="n"),n+=` It must be ${e}. Received ${s}`,n},RangeError);function Vb(t){let e="",r=t.length,n=t[0]==="-"?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return `${t.slice(0,r)}${e}`}function $B(t,e,r){Mn(e,"offset"),(t[e]===void 0||t[e+r]===void 0)&&Ni(e,t.length-(r+1));}function iE(t,e,r,n,s,i){if(t>r||t<e){let o=typeof e=="bigint"?"n":"",u;throw i>3?e===0||e===BigInt(0)?u=`>= 0${o} and < 2${o} ** ${(i+1)*8}${o}`:u=`>= -(2${o} ** ${(i+1)*8-1}${o}) and < 2 ** ${(i+1)*8-1}${o}`:u=`>= ${e}${o} and <= ${r}${o}`,new Dn.ERR_OUT_OF_RANGE("value",u,t)}$B(n,s,i);}function Mn(t,e){if(typeof t!="number")throw new Dn.ERR_INVALID_ARG_TYPE(e,"number",t)}function Ni(t,e,r){throw Math.floor(t)!==t?(Mn(t,r),new Dn.ERR_OUT_OF_RANGE(r||"offset","an integer",t)):e<0?new Dn.ERR_BUFFER_OUT_OF_BOUNDS:new Dn.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}var FB=/[^+/0-9A-Za-z-_]/g;function kB(t){if(t=t.split("=")[0],t=t.trim().replace(FB,""),t.length<2)return "";for(;t.length%4!==0;)t=t+"=";return t}function Kc(t,e){e=e||1/0;let r,n=t.length,s=null,i=[];for(let o=0;o<n;++o){if(r=t.charCodeAt(o),r>55295&&r<57344){if(!s){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}else if(o+1===n){(e-=3)>-1&&i.push(239,191,189);continue}s=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),s=r;continue}r=(s-55296<<10|r-56320)+65536;}else s&&(e-=3)>-1&&i.push(239,191,189);if(s=null,r<128){if((e-=1)<0)break;i.push(r);}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,r&63|128);}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,r&63|128);}else if(r<1114112){if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128);}else throw new Error("Invalid code point")}return i}function LB(t){let e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}function qB(t,e){let r,n,s,i=[];for(let o=0;o<t.length&&!((e-=2)<0);++o)r=t.charCodeAt(o),n=r>>8,s=r%256,i.push(s),i.push(n);return i}function sE(t){return zc.toByteArray(kB(t))}function jo(t,e,r,n){let s;for(s=0;s<n&&!(s+r>=e.length||s>=t.length);++s)e[s+r]=t[s];return s}function Kt(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function Qc(t){return t!==t}var BB=function(){let t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){let n=r*16;for(let s=0;s<16;++s)e[n+s]=t[r]+t[s];}return e}();function Rr(t){return typeof BigInt>"u"?DB:t}function DB(){throw new Error("BigInt not supported")}});var lE=_((XM,uE)=>{var Mi=Nb(),aE=oE().Buffer;function NB(t){return 12+4*Math.ceil(t.length/4)}function MB(){return !(typeof window<"u"&&typeof document<"u")}function UB(t){return t.BYTES_PER_ELEMENT?t.length*t.BYTES_PER_ELEMENT:-1}function jB(t){let e=0,r=-1;try{let n=t;if(t instanceof Map?n=Object.fromEntries(t):t instanceof Set&&(n=Array.from(t)),ArrayBuffer.isView(t))return UB(t);let s=JSON.stringify(n,(i,o)=>typeof o=="bigint"||typeof o=="function"?o.toString():typeof o>"u"?"undefined":typeof o=="symbol"||o instanceof RegExp?o.toString():o);e=aE.byteLength(s,"utf8");}catch(n){return console.error("Error detected, returning "+r,n),r}return e}function HB(t){let e=[],r=[t],n=0;for(;r.length;){let s=r.pop();if(typeof s=="boolean")n+=Mi.BYTES;else if(typeof s=="string")MB()?n+=NB(s):n+=s.length*Mi.STRING;else if(typeof s=="number")n+=Mi.NUMBER;else if(typeof s=="symbol")Symbol.keyFor&&Symbol.keyFor(t)?n+=Symbol.keyFor(t).length*Mi.STRING:n+=(t.toString().length-8)*Mi.STRING;else if(typeof s=="bigint")n+=aE.from(s.toString()).byteLength;else if(typeof s=="function")n+=s.toString().length;else if(typeof s=="object"&&e.indexOf(s)===-1){e.push(s);for(let i in s)r.push(s[i]);}}return n}uE.exports=function(t){let e=0;return t!==null&&typeof t=="object"?e=jB(t):e=HB(t),e};});var nf=_((ij,xE)=>{var rf=class{constructor(e={}){let r=e.base||1.001,n=e.precision||1e-9;if(!(r>1)||!(r<1.5))throw new Error("base must be a number between 1 and 1.5");if(r+=1e-9,r=2**(1/Math.ceil(Math.log(2)/Math.log(r))),r===1)throw new Error("base too close to 1");n=Number.parseFloat(""+n);let s=Math.ceil(1/(r-1)),i=n*s;this._thresh=i,this._precision=n,this._base=r;}getBase(){return this._base}getPrecision(){return this._precision}round(e){if(typeof e!="number"&&(e=Number.parseFloat(e)),Number.isNaN(e))throw new Error("Attempt to round a non-numeric value: "+e);return e<0?-this.round(-e):e<this._thresh?Math.round(e/this._precision)*this._precision:this._thresh*this._base**Math.round(Math.log(e/this._thresh)/Math.log(this._base))}upper(e){return e<0?-this.lower(-e):(e=this.round(e),e<this._thresh?e+this._precision/2:e*Math.sqrt(this._base))}lower(e){return e<0?-this.upper(-e):(e=this.round(e),e<=this._thresh?e-this._precision/2:e/Math.sqrt(this._base))}shorten(e,r){return e===void 0?e:r===void 0?Ui(this.lower(e),this.upper(e)):Ui(e,r)}};function Ui(t,e,r=10){if(t===e)return t;if(t*e<=0)return 0;if(e<0)return -Ui(-e,-t,r);if(t>e)return Ui(e,t,r);let n=-Math.floor(Math.log(e-t)/Math.log(r));for(;Math.ceil(t*r**n)<=Math.floor(e*r**n);)n--;return n++,n>=0?Math.ceil(t*r**n)/r**n:Math.ceil(t/r**-n)*r**-n}xE.exports={Binning:rf,shorten:Ui};});var _E=_((sj,AE)=>{var{Binning:YB}=nf(),JB="stats-logscale/univariate@1.0",ji=class t extends YB{constructor(e={}){super(e),this.storage=new Map,this._count=0,this._cache={},this.neat=new Hi(this),e.bins&&this.addWeighted(e.bins);}add(...e){return this._cache={},e.forEach(r=>{let n=this.round(r),s=this.storage.get(n)??0;this.storage.set(n,s+1),this._count++;}),this}addWeighted(e){return this._cache={},e.forEach(r=>{let n=r[0],s=Number.parseFloat(r[1]);if(Number.isNaN(s))throw new Error("Attempt to provide a non-numeric weight");let i=this.round(n),o=(this.storage.get(i)??0)+s;o<=0?(this.storage.delete(i),this._count+=s-o):(this.storage.set(i,o),this._count+=s);}),this}toJSON(){return {version:JB,precision:this.getPrecision(),base:this.getBase(),bins:this.getBins()}}clone(e={}){let r=this.getBins(e);return e.transform&&(r=r.map(n=>[e.transform(n[0]),n[1]])),new t({precision:e.precision??this.getPrecision(),base:e.base??this.getBase(),bins:r})}getBins(e){if(this._cache.data||(this._cache.data=[...this.storage].sort((u,c)=>u[0]-c[0])),!e)return this._cache.data;let r=Math.max(e.min??-1/0,this.percentile(e.ltrim??0)),n=Math.min(e.max??1/0,this.percentile(100-(e.rtrim??0)));if(!e.winsorize)return this._cache.data.filter(u=>u[0]>=r&&u[0]<=n);let s=[this.round(r),0],i=[this.round(n),0],o=[s];for(let[u,c]of this._cache.data)u<=s[0]?s[1]+=c:u>=i[0]?i[1]+=c:o.push([u,c]);return i[1]>0&&o.push(i),o}count(){return this._count}min(){let e=this.getBins();return this.lower(e[0][0])}max(){let e=this.getBins();return this.upper(e[e.length-1][0])}sumOf(e){let r=0;return [...this.storage].forEach(n=>{r+=n[1]*e(n[0]);}),r}E(e){return this._count?this.sumOf(e)/this._count:void 0}mean(){return this._count?this.sumOf(e=>e)/this._count:void 0}stdev(){if(this._count<2)return;let e=this.mean();return Math.sqrt(this.sumOf(r=>(r-e)*(r-e))/(this._count-1))}skewness(){let e=this.count();return e<3?void 0:e*e/((e-1)*(e-2))*this.momentStd(3)}kurtosis(){let e=this.count();if(e<4)return;let r=e*e*(e+1)/((e-1)*(e-2)*(e-3)),n=(e-1)*(e-1)/((e-2)*(e-3));return this.momentStd(4)*r-3*n}moment(e,r){if(!Number.isInteger(e))throw new Error("Cannot calculate non-integer moment (did you mean momentAbs?)");return r===void 0&&(r=this.mean()),this.E(n=>(n-r)**e)}momentAbs(e=1,r){return r===void 0&&(r=this.mean()),this.E(n=>Math.abs(n-r)**e)}momentStd(e){return this.moment(e)/this.stdev()**e}quantile(e){let r=e*this._count,n=this._cumulative(),s=0,i=n.length;for(;s+1<i;){let c=Math.floor((i+s)/2);n[c][1]>=r?i=c:s=c;}let o=this.lower(n[s][0]),u=this.upper(n[s][0])-o;return o+u*(r-n[s][1])/(n[s][2]-n[s][1])}percentile(e){return this.quantile(e/100)}median(){return this.quantile(.5)}cdf(e){return this._rawCdf(e)/this._count}_rawCdf(e){let r=this._cumulative(),n=this.round(e),s=0,i=r.length;for(;s<i;){let c=Math.floor((i+s)/2);r[c][0]<n?s=c+1:i=c;}if(s>=r.length)return this._count;let o=s>0?r[s-1][2]:0,u=n!==r[s][0]?0:(r[s][2]-r[s][1])*(e-this.lower(e))/(this.upper(e)-this.lower(e));return o+u}histogram(e={}){if(!this._count)return [];let r=this.min(),n=this.max(),s=e.count||10,i=[],o=r,u=(n-r)/s;for(let c=0;c<s;c++)i.push([this._rawCdf(o+u),o,o+=u]);for(let c=i.length;c-- >1;)i[c][0]-=i[c-1][0];if(i[0][0]-=this._rawCdf(r),e.scale){let c=0;for(let p=0;p<i.length;p++)c<i[p][0]&&(c=i[p][0]);for(let p=0;p<i.length;p++)i[p][0]=i[p][0]*e.scale/c;}return i}_cumulative(){if(!this._cache.cumulative){let e=this.getBins(),r=[],n=0;for(let s=0;s<e.length;s++)r.push([e[s][0],n,n+=e[s][1]]);this._cache.cumulative=r;}return this._cache.cumulative}};["cdf+","kurtosis","max","mean","min","moment+","momentAbs+","momentStd+","quantile+","skewness","stdev"].forEach(t=>{let e=!!t.match(/\+/);e&&(t=t.replace("+",""));let r=ji.prototype[t];if(typeof r!="function")throw new Error('method "'+t+'" is cached but never defined');ji.prototype[t]=e?function(...n){if(this._count===0)return;this._cache[t]===void 0&&(this._cache[t]={});let s=n.join(":");return this._cache[t][s]===void 0&&(this._cache[t][s]=r.apply(this,n)),this._cache[t][s]}:function(){if(this._count!==0)return this._cache[t]===void 0&&(this._cache[t]=r.apply(this)),this._cache[t]};});var Hi=class{constructor(e){this._main=e;}min(){if(!this._main._count)return;let e=this._main.getBins();return this._main.shorten(e[0][0])}max(){if(!this._main._count)return;let e=this._main.getBins();return this._main.shorten(e[e.length-1][0])}};["E","kurtosis","mean","median","moment","momentAbs","momentStd","percentile","quantile","skewness","stdev","sumOf"].forEach(t=>{Hi.prototype[t]=function(e){return this._main.shorten(this._main[t](e))};});["cdf","count"].forEach(t=>{Hi.prototype[t]=function(e){return this._main[t](e)};});AE.exports={Univariate:ji};});var CE=_((oj,sf)=>{(()=>{let{Binning:t}=nf(),{Univariate:e}=_E(),r={Binning:t,Univariate:e};typeof window<"u"&&(window.logstat=r),typeof sf=="object"&&(sf.exports=r);})();});var Zi=new Uint8Array(256),Qi=Zi.length;function ua(){return Qi>Zi.length-16&&(Xx__default.default.randomFillSync(Zi),Qi=0),Zi.slice(Qi,Qi+=16)}var He=[];for(let t=0;t<256;++t)He.push((t+256).toString(16).slice(1));function Zf(t,e=0){return He[t[e+0]]+He[t[e+1]]+He[t[e+2]]+He[t[e+3]]+"-"+He[t[e+4]]+He[t[e+5]]+"-"+He[t[e+6]]+He[t[e+7]]+"-"+He[t[e+8]]+He[t[e+9]]+"-"+He[t[e+10]]+He[t[e+11]]+He[t[e+12]]+He[t[e+13]]+He[t[e+14]]+He[t[e+15]]}var la={randomUUID:Xx__default.default.randomUUID};function Zx(t,e,r){if(la.randomUUID&&!e&&!t)return la.randomUUID();t=t||{};let n=t.random||(t.rng||ua)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){r=r||0;for(let s=0;s<16;++s)e[r+s]=n[s];return e}return Zf(n)}var Pr=Zx;var af=nn(zy());var dr={defaultMerge:Symbol("deepmerge-ts: default merge"),skip:Symbol("deepmerge-ts: skip")};function CC(t,e){return e}function Gy(t){return typeof t!="object"||t===null?0:Array.isArray(t)?2:TC(t)?1:t instanceof Set?3:t instanceof Map?4:5}function RC(t){let e=new Set;for(let r of t)for(let n of [...Object.keys(r),...Object.getOwnPropertySymbols(r)])e.add(n);return e}function OC(t,e){return typeof t=="object"&&Object.prototype.propertyIsEnumerable.call(t,e)}function Ky(t){return {*[Symbol.iterator](){for(let e of t)for(let r of e)yield r;}}}var Vy=new Set(["[object Object]","[object Module]"]);function TC(t){if(!Vy.has(Object.prototype.toString.call(t)))return !1;let{constructor:e}=t;if(e===void 0)return !0;let r=e.prototype;return !(r===null||typeof r!="object"||!Vy.has(Object.prototype.toString.call(r))||!r.hasOwnProperty("isPrototypeOf"))}function PC(t,e,r){let n={};for(let s of RC(t)){let i=[];for(let c of t)OC(c,s)&&i.push(c[s]);if(i.length===0)continue;let o=e.metaDataUpdater(r,{key:s,parents:t}),u=Xy(i,e,o);u!==dr.skip&&(s==="__proto__"?Object.defineProperty(n,s,{value:u,configurable:!0,enumerable:!0,writable:!0}):n[s]=u);}return n}function IC(t){return t.flat()}function $C(t){return new Set(Ky(t))}function FC(t){return new Map(Ky(t))}function Yy(t){return t.at(-1)}var yu=Object.freeze({__proto__:null,mergeArrays:IC,mergeMaps:FC,mergeOthers:Yy,mergeRecords:PC,mergeSets:$C});function Jy(...t){return kC({})(...t)}function kC(t,e){let r=LC(t,n);function n(...s){return Xy(s,r,e)}return n}function LC(t,e){return {defaultMergeFunctions:yu,mergeFunctions:{...yu,...Object.fromEntries(Object.entries(t).filter(([r,n])=>Object.hasOwn(yu,r)).map(([r,n])=>n===!1?[r,Yy]:[r,n]))},metaDataUpdater:t.metaDataUpdater??CC,deepmerge:e,useImplicitDefaultMerging:t.enableImplicitDefaultMerging??!1,actions:dr}}function Xy(t,e,r){if(t.length===0)return;if(t.length===1)return gu(t,e,r);let n=Gy(t[0]);if(n!==0&&n!==5){for(let s=1;s<t.length;s++)if(Gy(t[s])!==n)return gu(t,e,r)}switch(n){case 1:return qC(t,e,r);case 2:return BC(t,e,r);case 3:return DC(t,e,r);case 4:return NC(t,e,r);default:return gu(t,e,r)}}function qC(t,e,r){let n=e.mergeFunctions.mergeRecords(t,e,r);return n===dr.defaultMerge||e.useImplicitDefaultMerging&&n===void 0&&e.mergeFunctions.mergeRecords!==e.defaultMergeFunctions.mergeRecords?e.defaultMergeFunctions.mergeRecords(t,e,r):n}function BC(t,e,r){let n=e.mergeFunctions.mergeArrays(t,e,r);return n===dr.defaultMerge||e.useImplicitDefaultMerging&&n===void 0&&e.mergeFunctions.mergeArrays!==e.defaultMergeFunctions.mergeArrays?e.defaultMergeFunctions.mergeArrays(t):n}function DC(t,e,r){let n=e.mergeFunctions.mergeSets(t,e,r);return n===dr.defaultMerge||e.useImplicitDefaultMerging&&n===void 0&&e.mergeFunctions.mergeSets!==e.defaultMergeFunctions.mergeSets?e.defaultMergeFunctions.mergeSets(t):n}function NC(t,e,r){let n=e.mergeFunctions.mergeMaps(t,e,r);return n===dr.defaultMerge||e.useImplicitDefaultMerging&&n===void 0&&e.mergeFunctions.mergeMaps!==e.defaultMergeFunctions.mergeMaps?e.defaultMergeFunctions.mergeMaps(t):n}function gu(t,e,r){let n=e.mergeFunctions.mergeOthers(t,e,r);return n===dr.defaultMerge||e.useImplicitDefaultMerging&&n===void 0&&e.mergeFunctions.mergeOthers!==e.defaultMergeFunctions.mergeOthers?e.defaultMergeFunctions.mergeOthers(t):n}var si=t=>{let e=typeof t;return t!==null&&(e==="object"||e==="function")};var mu=new Set(["__proto__","prototype","constructor"]),MC=new Set("0123456789");function wu(t){let e=[],r="",n="start",s=!1;for(let i of t)switch(i){case"\\":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd")throw new Error("Invalid character after an index");s&&(r+=i),n="property",s=!s;break}case".":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd"){n="property";break}if(s){s=!1,r+=i;break}if(mu.has(r))return [];e.push(r),r="",n="property";break}case"[":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd"){n="index";break}if(s){s=!1,r+=i;break}if(n==="property"){if(mu.has(r))return [];e.push(r),r="";}n="index";break}case"]":{if(n==="index"){e.push(Number.parseInt(r,10)),r="",n="indexEnd";break}if(n==="indexEnd")throw new Error("Invalid character after an index")}default:{if(n==="index"&&!MC.has(i))throw new Error("Invalid character in an index");if(n==="indexEnd")throw new Error("Invalid character after an index");n==="start"&&(n="property"),s&&(s=!1,r+="\\"),r+=i;}}switch(s&&(r+="\\"),n){case"property":{if(mu.has(r))return [];e.push(r);break}case"index":throw new Error("Index was not closed");case"start":{e.push("");break}}return e}function Qy(t,e){if(typeof e!="number"&&Array.isArray(t)){let r=Number.parseInt(e,10);return Number.isInteger(r)&&t[r]===t[e]}return !1}function Zy(t,e){if(Qy(t,e))throw new Error("Cannot use string index")}function eg(t,e,r){if(!si(t)||typeof e!="string")return r===void 0?t:r;let n=wu(e);if(n.length===0)return r;for(let s=0;s<n.length;s++){let i=n[s];if(Qy(t,i)?t=s===n.length-1?void 0:null:t=t[i],t==null){if(s!==n.length-1)return r;break}}return t===void 0?r:t}function yn(t,e,r){if(!si(t)||typeof e!="string")return t;let n=t,s=wu(e);for(let i=0;i<s.length;i++){let o=s[i];Zy(t,o),i===s.length-1?t[o]=r:si(t[o])||(t[o]=typeof s[i+1]=="number"?[]:{}),t=t[o];}return n}function tg(t,e){if(!si(t)||typeof e!="string")return !1;let r=wu(e);for(let n=0;n<r.length;n++){let s=r[n];if(Zy(t,s),n===r.length-1)return delete t[s],!0;if(t=t[s],!si(t))return !1}}var UC={"Content-Type":"application/json"},jC=/\/*$/;function Lr(t={}){let{fetch:e=globalThis.fetch,querySerializer:r,bodySerializer:n,...s}=t;async function i(o,u){let{headers:c,body:p,params:l={},parseAs:d="json",querySerializer:g=r??HC,bodySerializer:m=n??WC,...w}=u||{},E=zC(o,{baseUrl:s.baseUrl,params:l,querySerializer:g}),A=GC(UC,t?.headers,c,l.header),R={redirect:"follow",...s,...w,headers:A};p&&(R.body=m(p)),R.body instanceof FormData&&A.delete("Content-Type");let x=await e(E,R);if(x.status===204||x.headers.get("Content-Length")==="0")return x.ok?{data:{},response:x}:{error:{},response:x};if(x.ok){let F=x.body;if(d!=="stream"){let q=x.clone();F=typeof q[d]=="function"?await q[d]():await q.text();}return {data:F,response:x}}let O={};try{O=await x.clone().json();}catch{O=await x.clone().text();}return {error:O,response:x}}return {async GET(o,u){return i(o,{...u,method:"GET"})},async PUT(o,u){return i(o,{...u,method:"PUT"})},async POST(o,u){return i(o,{...u,method:"POST"})},async DELETE(o,u){return i(o,{...u,method:"DELETE"})},async OPTIONS(o,u){return i(o,{...u,method:"OPTIONS"})},async HEAD(o,u){return i(o,{...u,method:"HEAD"})},async PATCH(o,u){return i(o,{...u,method:"PATCH"})},async TRACE(o,u){return i(o,{...u,method:"TRACE"})}}}function HC(t){let e=new URLSearchParams;if(t&&typeof t=="object")for(let[r,n]of Object.entries(t))n!=null&&e.set(r,n);return e.toString()}function WC(t){return JSON.stringify(t)}function zC(t,e){let r=`${e.baseUrl?e.baseUrl.replace(jC,""):""}${t}`;if(e.params.path)for(let[n,s]of Object.entries(e.params.path))r=r.replace(`{${n}}`,encodeURIComponent(String(s)));if(e.params.query){let n=e.querySerializer(e.params.query);n&&(r+=`?${n}`);}return r}function GC(...t){let e=new Headers;for(let r of t){if(!r||typeof r!="object")continue;let n=r instanceof Headers?r.entries():Object.entries(r);for(let[s,i]of n)i===null?e.delete(s):i!==void 0&&e.set(s,i);}return e}var og=nn(sg());function Pe(t){return t.match(/.*(?:$|\r?\n)/g).filter(Boolean)}function Su(t){return t.match(/\w+|\W+/g).filter(Boolean)}function xe(t){return t.trim().length===0}function gn(t,e){return og.get(t,e)}function ai(t){let e=new AbortController;for(let r of t){if(r?.aborted)return e.abort(r.reason),r;r?.addEventListener("abort",()=>e.abort(r.reason),{signal:e.signal});}return e.signal}var ct=class extends Error{constructor(r){super(`${r.status} ${r.statusText}`);this.name="HttpError",this.status=r.status,this.statusText=r.statusText,this.response=r;}};function Fs(t){return t instanceof Error&&t.name==="TimeoutError"||t instanceof ct&&[408,499].indexOf(t.status)!==-1}function ks(t){return t instanceof Error&&t.name==="AbortError"}function bu(t){this.message=t;}bu.prototype=new Error,bu.prototype.name="InvalidCharacterError";var ag=typeof window<"u"&&window.atob&&window.atob.bind(window)||function(t){var e=String(t).replace(/=+$/,"");if(e.length%4==1)throw new bu("'atob' failed: The string to be decoded is not correctly encoded.");for(var r,n,s=0,i=0,o="";n=e.charAt(i++);~n&&(r=s%4?64*r+n:n,s++%4)?o+=String.fromCharCode(255&r>>(-2*s&6)):0)n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(n);return o};function JC(t){var e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw "Illegal base64url string!"}try{return function(r){return decodeURIComponent(ag(r).replace(/(.)/g,function(n,s){var i=s.charCodeAt(0).toString(16).toUpperCase();return i.length<2&&(i="0"+i),"%"+i}))}(e)}catch{return ag(e)}}function Ls(t){this.message=t;}function XC(t,e){if(typeof t!="string")throw new Ls("Invalid token specified");var r=(e=e||{}).header===!0?0:1;try{return JSON.parse(JC(t.split(".")[r]))}catch(n){throw new Ls("Invalid token specified: "+n.message)}}Ls.prototype=new Error,Ls.prototype.name="InvalidTokenError";var qs=XC;ui();var Ks=(()=>{let t=G("path").join(G("os").homedir(),".tabby-client","agent","data.json"),e=Nu();return {data:{},load:async function(){await this.migrateFrom_0_3_0(),this.data=await e.readJson(t,{throws:!1})||{};},save:async function(){await e.outputJson(t,this.data);},migrateFrom_0_3_0:async function(){let r=G("path").join(G("os").homedir(),".tabby","agent","data.json"),n=G("path").join(G("os").homedir(),".tabby","agent",".data_json_migrated");if(await e.pathExists(r)&&!await e.pathExists(n)){let s=await e.readJson(r);await e.outputJson(t,s),await e.outputFile(n,"");}}}})();Ut();var ft=class ft extends events.EventEmitter{constructor(r){super();this.logger=Re.child({component:"Auth"});this.dataStore=null;this.refreshTokenTimer=null;this.jwt=null;this.endpoint=r.endpoint,this.dataStore=r.dataStore||Ks,this.authApi=Lr({baseUrl:"https://app.tabbyml.com/api"}),this.scheduleRefreshToken();}static async create(r){let n=new ft(r);return await n.load(),n}get token(){return this.jwt?.token}get user(){return this.jwt?.payload.email}async load(){if(this.dataStore)try{await this.dataStore.load();let r=this.dataStore.data.auth?.[this.endpoint]?.jwt;if(typeof r=="string"&&this.jwt?.token!==r){this.logger.debug({storedJwt:r},"Load jwt from data store.");let n={token:r,payload:qs(r)};n.payload.exp*1e3-Date.now()<ft.tokenStrategy.refresh.beforeExpire?(this.jwt=await this.refreshToken(n,ft.tokenStrategy.refresh.whenLoaded),await this.save()):this.jwt=n;}}catch(r){this.logger.debug({error:r},"Error when loading auth");}}async save(){if(this.dataStore)try{if(this.jwt){if(this.dataStore.data.auth?.[this.endpoint]?.jwt===this.jwt.token)return;this.dataStore.data.auth={...this.dataStore.data.auth,[this.endpoint]:{jwt:this.jwt.token}};}else {if(typeof this.dataStore.data.auth?.[this.endpoint]>"u")return;delete this.dataStore.data.auth[this.endpoint];}await this.dataStore.save(),this.logger.debug("Save changes to data store.");}catch(r){this.logger.error({error:r},"Error when saving auth");}}async reset(){this.jwt&&(this.jwt=null,await this.save());}async requestAuthUrl(r){try{if(await this.reset(),r?.signal.aborted)throw r.signal.reason;this.logger.debug("Start to request device token");let n=await this.authApi.POST("/device-token",{body:{auth_url:this.endpoint},signal:r?.signal});if(n.error)throw new ct(n.response);let s=n.data;this.logger.debug({deviceToken:s},"Request device token response");let i=new URL(ft.authPageUrl);return i.searchParams.append("code",s.data.code),{authUrl:i.toString(),code:s.data.code}}catch(n){throw this.logger.error({error:n},"Error when requesting token"),n}}async pollingToken(r,n){return new Promise((s,i)=>{let o=ai([AbortSignal.timeout(ft.tokenStrategy.polling.timeout),n?.signal]),u=setInterval(async()=>{try{let c=await this.authApi.POST("/device-token/accept",{params:{query:{code:r}},signal:o});if(c.error)throw new ct(c.response);let p=c.data;this.logger.debug({result:p},"Poll jwt response"),this.jwt={token:p.data.jwt,payload:qs(p.data.jwt)},super.emit("updated",this.jwt),await this.save(),clearInterval(u),s(!0);}catch(c){c instanceof ct&&[400,401,403,405].indexOf(c.status)!==-1?this.logger.debug({error:c},"Expected error when polling jwt"):this.logger.error({error:c},"Error when polling jwt");}},ft.tokenStrategy.polling.interval);o.aborted?(clearInterval(u),i(o.reason)):o.addEventListener("abort",()=>{clearInterval(u),i(o.reason);});})}async refreshToken(r,n={maxTry:1,retryDelay:1e3},s=0){try{this.logger.debug({retry:s},"Start to refresh token");let i=await this.authApi.POST("/device-token/refresh",{headers:{Authorization:`Bearer ${r.token}`}});if(i.error)throw new ct(i.response);let o=i.data;return this.logger.debug({refreshedJwt:o},"Refresh token response"),{token:o.data.jwt,payload:qs(o.data.jwt)}}catch(i){if(i instanceof ct&&[400,401,403,405].indexOf(i.status)!==-1)this.logger.debug({error:i},"Error when refreshing jwt");else if(this.logger.error({error:i},"Unknown error when refreshing jwt"),s<n.maxTry)return this.logger.debug(`Retry refreshing jwt after ${n.retryDelay}ms`),await new Promise(o=>setTimeout(o,n.retryDelay)),this.refreshToken(r,n,s+1);throw {...i,retry:s}}}scheduleRefreshToken(){this.refreshTokenTimer=setInterval(async()=>{if(!this.jwt)return null;if(this.jwt.payload.exp*1e3-Date.now()<ft.tokenStrategy.refresh.beforeExpire)try{this.jwt=await this.refreshToken(this.jwt,ft.tokenStrategy.refresh.whenScheduled),super.emit("updated",this.jwt),await this.save();}catch(r){this.logger.error({error:r},"Error when refreshing jwt");}else this.logger.debug("Check token, still valid");},ft.tokenStrategy.refresh.interval);}};ft.authPageUrl="https://app.tabbyml.com/account/device-token",ft.tokenStrategy={polling:{interval:5e3,timeout:5*60*1e3},refresh:{interval:15*60*1e3,beforeExpire:30*60*1e3,whenLoaded:{maxTry:5,retryDelay:1e3},whenScheduled:{maxTry:60,retryDelay:30*1e3}}};var yo=ft;ui();var kc={server:{endpoint:"http://localhost:8080",requestHeaders:{},requestTimeout:3e4},completion:{prompt:{maxPrefixLines:20,maxSuffixLines:20},debounce:{mode:"adaptive",interval:250},timeout:{auto:5e3,manually:3e4}},logs:{level:"silent"},anonymousUsageTracking:{disable:!1}},iB=`## Tabby agent configuration file
## You can uncomment any block to enable settings.
## Configurations in this file has lower priority than in IDE settings.
## Server
## You can set the server endpoint and request timeout here.
# [server]
# endpoint = "http://localhost:8080" # http or https URL
# requestTimeout = 30000 # ms
## You can add custom request headers, e.g. for authentication.
# [server.requestHeaders]
# Authorization = "Bearer eyJhbGciOiJ..........."
## Completion
## You can set the prompt context to send to the server for completion.
# [completion.prompt]
# maxPrefixLines = 20
# maxSuffixLines = 20
## You can set the debounce mode for auto completion requests when typing.
# [completion.debounce]
# mode = "adaptive" # or "fixed"
# interval = 250 # ms, only used when mode is "fixed"
## You can set the timeout for completion requests.
# [completion.timeout]
# auto = 5000 # ms, for auto completion when typing
# manually = 30000 # ms, for manually triggered completion
## Logs
## You can set the log level here. The log file is located at ~/.tabby-client/agent/logs/.
# [logs]
# level = "silent" # or "error" or "debug"
## Anonymous usage tracking
## You can disable anonymous usage tracking here.
# [anonymousUsageTracking]
# disable = false # set to true to disable
`,Pn=(()=>{let t=G("events"),e=Nu(),r=Ov(),n=Cb();class s extends t{constructor(c){super();this.data={};this.watcher=null;this.logger=(Ut(),oa(Ev)).rootLogger.child({component:"ConfigFile"});this.filepath=c;}get config(){return this.data}async load(){try{let c=await e.readFile(this.filepath,"utf8");this.data=r.parse(c),super.emit("updated",this.data);}catch(c){c.code==="ENOENT"?await this.createTemplate():this.logger.error({error:c},"Failed to load config file");}}async createTemplate(){try{await e.outputFile(this.filepath,iB);}catch(c){this.logger.error({error:c},"Failed to create config template file");}}watch(){this.watcher=n.watch(this.filepath,{interval:1e3}),this.watcher.on("add",this.load.bind(this)),this.watcher.on("change",this.load.bind(this));}}let i=G("path").join(G("os").homedir(),".tabby-client","agent","config.toml");return new s(i)})();var Ii=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Ob=new Set,Lc=typeof process=="object"&&process?process:{},Tb=(t,e,r,n)=>{typeof Lc.emitWarning=="function"?Lc.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`);},Bo=globalThis.AbortController,Rb=globalThis.AbortSignal;if(typeof Bo>"u"){Rb=class{constructor(){ie(this,"onabort");ie(this,"_onabort",[]);ie(this,"reason");ie(this,"aborted",!1);}addEventListener(n,s){this._onabort.push(s);}},Bo=class{constructor(){ie(this,"signal",new Rb);e();}abort(n){if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=!0;for(let s of this.signal._onabort)s(n);this.signal.onabort?.(n);}}};let t=Lc.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=!1,Tb("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 sB=t=>!Ob.has(t),xr=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),Pb=t=>xr(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?In:null:null,In=class extends Array{constructor(e){super(e),this.fill(0);}},$n,Gr=class Gr{constructor(e,r){ie(this,"heap");ie(this,"length");if(!S(Gr,$n))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0;}static create(e){let r=Pb(e);if(!r)return [];ne(Gr,$n,!0);let n=new Gr(e,r);return ne(Gr,$n,!1),n}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}};$n=new WeakMap,ue(Gr,$n,!1);var qc=Gr,It,dt,Ht,$t,Fn,Ie,Ft,$e,Se,ae,Qe,yt,Ve,Be,kt,ze,er,tr,Lt,Wt,Cr,ot,Fi,Bc,Vr,rr,ki,gt,No,Ib,Kr,kn,Li,zt,Ar,Gt,_r,qi,Dc,Ln,Lo,qn,qo,we,be,Bi,Nc,Yr,$i,Mc=class Mc{constructor(e){ue(this,Fi);ue(this,No);ue(this,zt);ue(this,Gt);ue(this,qi);ue(this,Ln);ue(this,qn);ue(this,we);ue(this,Bi);ue(this,Yr);ue(this,It,void 0);ue(this,dt,void 0);ue(this,Ht,void 0);ue(this,$t,void 0);ue(this,Fn,void 0);ie(this,"ttl");ie(this,"ttlResolution");ie(this,"ttlAutopurge");ie(this,"updateAgeOnGet");ie(this,"updateAgeOnHas");ie(this,"allowStale");ie(this,"noDisposeOnSet");ie(this,"noUpdateTTL");ie(this,"maxEntrySize");ie(this,"sizeCalculation");ie(this,"noDeleteOnFetchRejection");ie(this,"noDeleteOnStaleGet");ie(this,"allowStaleOnFetchAbort");ie(this,"allowStaleOnFetchRejection");ie(this,"ignoreFetchAbort");ue(this,Ie,void 0);ue(this,Ft,void 0);ue(this,$e,void 0);ue(this,Se,void 0);ue(this,ae,void 0);ue(this,Qe,void 0);ue(this,yt,void 0);ue(this,Ve,void 0);ue(this,Be,void 0);ue(this,kt,void 0);ue(this,ze,void 0);ue(this,er,void 0);ue(this,tr,void 0);ue(this,Lt,void 0);ue(this,Wt,void 0);ue(this,Cr,void 0);ue(this,ot,void 0);ue(this,Vr,()=>{});ue(this,rr,()=>{});ue(this,ki,()=>{});ue(this,gt,()=>!1);ue(this,Kr,e=>{});ue(this,kn,(e,r,n)=>{});ue(this,Li,(e,r,n,s)=>{if(n||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});let{max:r=0,ttl:n,ttlResolution:s=1,ttlAutopurge:i,updateAgeOnGet:o,updateAgeOnHas:u,allowStale:c,dispose:p,disposeAfter:l,noDisposeOnSet:d,noUpdateTTL:g,maxSize:m=0,maxEntrySize:w=0,sizeCalculation:E,fetchMethod:A,noDeleteOnFetchRejection:R,noDeleteOnStaleGet:x,allowStaleOnFetchRejection:O,allowStaleOnFetchAbort:F,ignoreFetchAbort:q}=e;if(r!==0&&!xr(r))throw new TypeError("max option must be a nonnegative integer");let W=r?Pb(r):Array;if(!W)throw new Error("invalid max value: "+r);if(ne(this,It,r),ne(this,dt,m),this.maxEntrySize=w||S(this,dt),this.sizeCalculation=E,this.sizeCalculation){if(!S(this,dt)&&!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(A!==void 0&&typeof A!="function")throw new TypeError("fetchMethod must be a function if specified");if(ne(this,Fn,A),ne(this,Cr,!!A),ne(this,$e,new Map),ne(this,Se,new Array(r).fill(void 0)),ne(this,ae,new Array(r).fill(void 0)),ne(this,Qe,new W(r)),ne(this,yt,new W(r)),ne(this,Ve,0),ne(this,Be,0),ne(this,kt,qc.create(r)),ne(this,Ie,0),ne(this,Ft,0),typeof p=="function"&&ne(this,Ht,p),typeof l=="function"?(ne(this,$t,l),ne(this,ze,[])):(ne(this,$t,void 0),ne(this,ze,void 0)),ne(this,Wt,!!S(this,Ht)),ne(this,ot,!!S(this,$t)),this.noDisposeOnSet=!!d,this.noUpdateTTL=!!g,this.noDeleteOnFetchRejection=!!R,this.allowStaleOnFetchRejection=!!O,this.allowStaleOnFetchAbort=!!F,this.ignoreFetchAbort=!!q,this.maxEntrySize!==0){if(S(this,dt)!==0&&!xr(S(this,dt)))throw new TypeError("maxSize must be a positive integer if specified");if(!xr(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");te(this,No,Ib).call(this);}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!x,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!u,this.ttlResolution=xr(s)||s===0?s:1,this.ttlAutopurge=!!i,this.ttl=n||0,this.ttl){if(!xr(this.ttl))throw new TypeError("ttl must be a positive integer if specified");te(this,Fi,Bc).call(this);}if(S(this,It)===0&&this.ttl===0&&S(this,dt)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!S(this,It)&&!S(this,dt)){let H="LRU_CACHE_UNBOUNDED";sB(H)&&(Ob.add(H),Tb("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",H,Mc));}}static unsafeExposeInternals(e){return {starts:S(e,tr),ttls:S(e,Lt),sizes:S(e,er),keyMap:S(e,$e),keyList:S(e,Se),valList:S(e,ae),next:S(e,Qe),prev:S(e,yt),get head(){return S(e,Ve)},get tail(){return S(e,Be)},free:S(e,kt),isBackgroundFetch:r=>{var n;return te(n=e,we,be).call(n,r)},backgroundFetch:(r,n,s,i)=>{var o;return te(o=e,qn,qo).call(o,r,n,s,i)},moveToTail:r=>{var n;return te(n=e,Yr,$i).call(n,r)},indexes:r=>{var n;return te(n=e,zt,Ar).call(n,r)},rindexes:r=>{var n;return te(n=e,Gt,_r).call(n,r)},isStale:r=>{var n;return S(n=e,gt).call(n,r)}}}get max(){return S(this,It)}get maxSize(){return S(this,dt)}get calculatedSize(){return S(this,Ft)}get size(){return S(this,Ie)}get fetchMethod(){return S(this,Fn)}get dispose(){return S(this,Ht)}get disposeAfter(){return S(this,$t)}getRemainingTTL(e){return S(this,$e).has(e)?1/0:0}*entries(){for(let e of te(this,zt,Ar).call(this))S(this,ae)[e]!==void 0&&S(this,Se)[e]!==void 0&&!te(this,we,be).call(this,S(this,ae)[e])&&(yield [S(this,Se)[e],S(this,ae)[e]]);}*rentries(){for(let e of te(this,Gt,_r).call(this))S(this,ae)[e]!==void 0&&S(this,Se)[e]!==void 0&&!te(this,we,be).call(this,S(this,ae)[e])&&(yield [S(this,Se)[e],S(this,ae)[e]]);}*keys(){for(let e of te(this,zt,Ar).call(this)){let r=S(this,Se)[e];r!==void 0&&!te(this,we,be).call(this,S(this,ae)[e])&&(yield r);}}*rkeys(){for(let e of te(this,Gt,_r).call(this)){let r=S(this,Se)[e];r!==void 0&&!te(this,we,be).call(this,S(this,ae)[e])&&(yield r);}}*values(){for(let e of te(this,zt,Ar).call(this))S(this,ae)[e]!==void 0&&!te(this,we,be).call(this,S(this,ae)[e])&&(yield S(this,ae)[e]);}*rvalues(){for(let e of te(this,Gt,_r).call(this))S(this,ae)[e]!==void 0&&!te(this,we,be).call(this,S(this,ae)[e])&&(yield S(this,ae)[e]);}[Symbol.iterator](){return this.entries()}find(e,r={}){for(let n of te(this,zt,Ar).call(this)){let s=S(this,ae)[n],i=te(this,we,be).call(this,s)?s.__staleWhileFetching:s;if(i!==void 0&&e(i,S(this,Se)[n],this))return this.get(S(this,Se)[n],r)}}forEach(e,r=this){for(let n of te(this,zt,Ar).call(this)){let s=S(this,ae)[n],i=te(this,we,be).call(this,s)?s.__staleWhileFetching:s;i!==void 0&&e.call(r,i,S(this,Se)[n],this);}}rforEach(e,r=this){for(let n of te(this,Gt,_r).call(this)){let s=S(this,ae)[n],i=te(this,we,be).call(this,s)?s.__staleWhileFetching:s;i!==void 0&&e.call(r,i,S(this,Se)[n],this);}}purgeStale(){let e=!1;for(let r of te(this,Gt,_r).call(this,{allowStale:!0}))S(this,gt).call(this,r)&&(this.delete(S(this,Se)[r]),e=!0);return e}dump(){let e=[];for(let r of te(this,zt,Ar).call(this,{allowStale:!0})){let n=S(this,Se)[r],s=S(this,ae)[r],i=te(this,we,be).call(this,s)?s.__staleWhileFetching:s;if(i===void 0||n===void 0)continue;let o={value:i};if(S(this,Lt)&&S(this,tr)){o.ttl=S(this,Lt)[r];let u=Ii.now()-S(this,tr)[r];o.start=Math.floor(Date.now()-u);}S(this,er)&&(o.size=S(this,er)[r]),e.unshift([n,o]);}return e}load(e){this.clear();for(let[r,n]of e){if(n.start){let s=Date.now()-n.start;n.start=Ii.now()-s;}this.set(r,n.value,n);}}set(e,r,n={}){var g,m;if(r===void 0)return this.delete(e),this;let{ttl:s=this.ttl,start:i,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:u=this.sizeCalculation,status:c}=n,{noUpdateTTL:p=this.noUpdateTTL}=n,l=S(this,Li).call(this,e,r,n.size||0,u);if(this.maxEntrySize&&l>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this.delete(e),this;let d=S(this,Ie)===0?void 0:S(this,$e).get(e);if(d===void 0)d=S(this,Ie)===0?S(this,Be):S(this,kt).length!==0?S(this,kt).pop():S(this,Ie)===S(this,It)?te(this,Ln,Lo).call(this,!1):S(this,Ie),S(this,Se)[d]=e,S(this,ae)[d]=r,S(this,$e).set(e,d),S(this,Qe)[S(this,Be)]=d,S(this,yt)[d]=S(this,Be),ne(this,Be,d),Xi(this,Ie)._++,S(this,kn).call(this,d,l,c),c&&(c.set="add"),p=!1;else {te(this,Yr,$i).call(this,d);let w=S(this,ae)[d];if(r!==w){if(S(this,Cr)&&te(this,we,be).call(this,w)?w.__abortController.abort(new Error("replaced")):o||(S(this,Wt)&&((g=S(this,Ht))==null||g.call(this,w,e,"set")),S(this,ot)&&S(this,ze)?.push([w,e,"set"])),S(this,Kr).call(this,d),S(this,kn).call(this,d,l,c),S(this,ae)[d]=r,c){c.set="replace";let E=w&&te(this,we,be).call(this,w)?w.__staleWhileFetching:w;E!==void 0&&(c.oldValue=E);}}else c&&(c.set="update");}if(s!==0&&!S(this,Lt)&&te(this,Fi,Bc).call(this),S(this,Lt)&&(p||S(this,ki).call(this,d,s,i),c&&S(this,rr).call(this,c,d)),!o&&S(this,ot)&&S(this,ze)){let w=S(this,ze),E;for(;E=w?.shift();)(m=S(this,$t))==null||m.call(this,...E);}return this}pop(){var e;try{for(;S(this,Ie);){let r=S(this,ae)[S(this,Ve)];if(te(this,Ln,Lo).call(this,!0),te(this,we,be).call(this,r)){if(r.__staleWhileFetching)return r.__staleWhileFetching}else if(r!==void 0)return r}}finally{if(S(this,ot)&&S(this,ze)){let r=S(this,ze),n;for(;n=r?.shift();)(e=S(this,$t))==null||e.call(this,...n);}}}has(e,r={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:s}=r,i=S(this,$e).get(e);if(i!==void 0){let o=S(this,ae)[i];if(te(this,we,be).call(this,o)&&o.__staleWhileFetching===void 0)return !1;if(S(this,gt).call(this,i))s&&(s.has="stale",S(this,rr).call(this,s,i));else return n&&S(this,Vr).call(this,i),s&&(s.has="hit",S(this,rr).call(this,s,i)),!0}else s&&(s.has="miss");return !1}peek(e,r={}){let{allowStale:n=this.allowStale}=r,s=S(this,$e).get(e);if(s!==void 0&&(n||!S(this,gt).call(this,s))){let i=S(this,ae)[s];return te(this,we,be).call(this,i)?i.__staleWhileFetching:i}}async fetch(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:u=this.noDisposeOnSet,size:c=0,sizeCalculation:p=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:g=this.allowStaleOnFetchRejection,ignoreFetchAbort:m=this.ignoreFetchAbort,allowStaleOnFetchAbort:w=this.allowStaleOnFetchAbort,context:E,forceRefresh:A=!1,status:R,signal:x}=r;if(!S(this,Cr))return R&&(R.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:s,noDeleteOnStaleGet:i,status:R});let O={allowStale:n,updateAgeOnGet:s,noDeleteOnStaleGet:i,ttl:o,noDisposeOnSet:u,size:c,sizeCalculation:p,noUpdateTTL:l,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:g,allowStaleOnFetchAbort:w,ignoreFetchAbort:m,status:R,signal:x},F=S(this,$e).get(e);if(F===void 0){R&&(R.fetch="miss");let q=te(this,qn,qo).call(this,e,F,O,E);return q.__returned=q}else {let q=S(this,ae)[F];if(te(this,we,be).call(this,q)){let U=n&&q.__staleWhileFetching!==void 0;return R&&(R.fetch="inflight",U&&(R.returnedStale=!0)),U?q.__staleWhileFetching:q.__returned=q}let W=S(this,gt).call(this,F);if(!A&&!W)return R&&(R.fetch="hit"),te(this,Yr,$i).call(this,F),s&&S(this,Vr).call(this,F),R&&S(this,rr).call(this,R,F),q;let H=te(this,qn,qo).call(this,e,F,O,E),k=H.__staleWhileFetching!==void 0&&n;return R&&(R.fetch=W?"stale":"refresh",k&&W&&(R.returnedStale=!0)),k?H.__staleWhileFetching:H.__returned=H}}get(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:o}=r,u=S(this,$e).get(e);if(u!==void 0){let c=S(this,ae)[u],p=te(this,we,be).call(this,c);return o&&S(this,rr).call(this,o,u),S(this,gt).call(this,u)?(o&&(o.get="stale"),p?(o&&n&&c.__staleWhileFetching!==void 0&&(o.returnedStale=!0),n?c.__staleWhileFetching:void 0):(i||this.delete(e),o&&n&&(o.returnedStale=!0),n?c:void 0)):(o&&(o.get="hit"),p?c.__staleWhileFetching:(te(this,Yr,$i).call(this,u),s&&S(this,Vr).call(this,u),c))}else o&&(o.get="miss");}delete(e){var n,s;let r=!1;if(S(this,Ie)!==0){let i=S(this,$e).get(e);if(i!==void 0)if(r=!0,S(this,Ie)===1)this.clear();else {S(this,Kr).call(this,i);let o=S(this,ae)[i];te(this,we,be).call(this,o)?o.__abortController.abort(new Error("deleted")):(S(this,Wt)||S(this,ot))&&(S(this,Wt)&&((n=S(this,Ht))==null||n.call(this,o,e,"delete")),S(this,ot)&&S(this,ze)?.push([o,e,"delete"])),S(this,$e).delete(e),S(this,Se)[i]=void 0,S(this,ae)[i]=void 0,i===S(this,Be)?ne(this,Be,S(this,yt)[i]):i===S(this,Ve)?ne(this,Ve,S(this,Qe)[i]):(S(this,Qe)[S(this,yt)[i]]=S(this,Qe)[i],S(this,yt)[S(this,Qe)[i]]=S(this,yt)[i]),Xi(this,Ie)._--,S(this,kt).push(i);}}if(S(this,ot)&&S(this,ze)?.length){let i=S(this,ze),o;for(;o=i?.shift();)(s=S(this,$t))==null||s.call(this,...o);}return r}clear(){var e,r;for(let n of te(this,Gt,_r).call(this,{allowStale:!0})){let s=S(this,ae)[n];if(te(this,we,be).call(this,s))s.__abortController.abort(new Error("deleted"));else {let i=S(this,Se)[n];S(this,Wt)&&((e=S(this,Ht))==null||e.call(this,s,i,"delete")),S(this,ot)&&S(this,ze)?.push([s,i,"delete"]);}}if(S(this,$e).clear(),S(this,ae).fill(void 0),S(this,Se).fill(void 0),S(this,Lt)&&S(this,tr)&&(S(this,Lt).fill(0),S(this,tr).fill(0)),S(this,er)&&S(this,er).fill(0),ne(this,Ve,0),ne(this,Be,0),S(this,kt).length=0,ne(this,Ft,0),ne(this,Ie,0),S(this,ot)&&S(this,ze)){let n=S(this,ze),s;for(;s=n?.shift();)(r=S(this,$t))==null||r.call(this,...s);}}};It=new WeakMap,dt=new WeakMap,Ht=new WeakMap,$t=new WeakMap,Fn=new WeakMap,Ie=new WeakMap,Ft=new WeakMap,$e=new WeakMap,Se=new WeakMap,ae=new WeakMap,Qe=new WeakMap,yt=new WeakMap,Ve=new WeakMap,Be=new WeakMap,kt=new WeakMap,ze=new WeakMap,er=new WeakMap,tr=new WeakMap,Lt=new WeakMap,Wt=new WeakMap,Cr=new WeakMap,ot=new WeakMap,Fi=new WeakSet,Bc=function(){let e=new In(S(this,It)),r=new In(S(this,It));ne(this,Lt,e),ne(this,tr,r),ne(this,ki,(i,o,u=Ii.now())=>{if(r[i]=o!==0?u:0,e[i]=o,o!==0&&this.ttlAutopurge){let c=setTimeout(()=>{S(this,gt).call(this,i)&&this.delete(S(this,Se)[i]);},o+1);c.unref&&c.unref();}}),ne(this,Vr,i=>{r[i]=e[i]!==0?Ii.now():0;}),ne(this,rr,(i,o)=>{if(e[o]){let u=e[o],c=r[o];i.ttl=u,i.start=c,i.now=n||s();let p=i.now-c;i.remainingTTL=u-p;}});let n=0,s=()=>{let i=Ii.now();if(this.ttlResolution>0){n=i;let o=setTimeout(()=>n=0,this.ttlResolution);o.unref&&o.unref();}return i};this.getRemainingTTL=i=>{let o=S(this,$e).get(i);if(o===void 0)return 0;let u=e[o],c=r[o];if(u===0||c===0)return 1/0;let p=(n||s())-c;return u-p},ne(this,gt,i=>e[i]!==0&&r[i]!==0&&(n||s())-r[i]>e[i]);},Vr=new WeakMap,rr=new WeakMap,ki=new WeakMap,gt=new WeakMap,No=new WeakSet,Ib=function(){let e=new In(S(this,It));ne(this,Ft,0),ne(this,er,e),ne(this,Kr,r=>{ne(this,Ft,S(this,Ft)-e[r]),e[r]=0;}),ne(this,Li,(r,n,s,i)=>{if(te(this,we,be).call(this,n))return 0;if(!xr(s))if(i){if(typeof i!="function")throw new TypeError("sizeCalculation must be a function");if(s=i(n,r),!xr(s))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 s}),ne(this,kn,(r,n,s)=>{if(e[r]=n,S(this,dt)){let i=S(this,dt)-e[r];for(;S(this,Ft)>i;)te(this,Ln,Lo).call(this,!0);}ne(this,Ft,S(this,Ft)+e[r]),s&&(s.entrySize=n,s.totalCalculatedSize=S(this,Ft));});},Kr=new WeakMap,kn=new WeakMap,Li=new WeakMap,zt=new WeakSet,Ar=function*({allowStale:e=this.allowStale}={}){if(S(this,Ie))for(let r=S(this,Be);!(!te(this,qi,Dc).call(this,r)||((e||!S(this,gt).call(this,r))&&(yield r),r===S(this,Ve)));)r=S(this,yt)[r];},Gt=new WeakSet,_r=function*({allowStale:e=this.allowStale}={}){if(S(this,Ie))for(let r=S(this,Ve);!(!te(this,qi,Dc).call(this,r)||((e||!S(this,gt).call(this,r))&&(yield r),r===S(this,Be)));)r=S(this,Qe)[r];},qi=new WeakSet,Dc=function(e){return e!==void 0&&S(this,$e).get(S(this,Se)[e])===e},Ln=new WeakSet,Lo=function(e){var i;let r=S(this,Ve),n=S(this,Se)[r],s=S(this,ae)[r];return S(this,Cr)&&te(this,we,be).call(this,s)?s.__abortController.abort(new Error("evicted")):(S(this,Wt)||S(this,ot))&&(S(this,Wt)&&((i=S(this,Ht))==null||i.call(this,s,n,"evict")),S(this,ot)&&S(this,ze)?.push([s,n,"evict"])),S(this,Kr).call(this,r),e&&(S(this,Se)[r]=void 0,S(this,ae)[r]=void 0,S(this,kt).push(r)),S(this,Ie)===1?(ne(this,Ve,ne(this,Be,0)),S(this,kt).length=0):ne(this,Ve,S(this,Qe)[r]),S(this,$e).delete(n),Xi(this,Ie)._--,r},qn=new WeakSet,qo=function(e,r,n,s){let i=r===void 0?void 0:S(this,ae)[r];if(te(this,we,be).call(this,i))return i;let o=new Bo,{signal:u}=n;u?.addEventListener("abort",()=>o.abort(u.reason),{signal:o.signal});let c={signal:o.signal,options:n,context:s},p=(E,A=!1)=>{let{aborted:R}=o.signal,x=n.ignoreFetchAbort&&E!==void 0;if(n.status&&(R&&!A?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,x&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),R&&!x&&!A)return d(o.signal.reason);let O=m;return S(this,ae)[r]===m&&(E===void 0?O.__staleWhileFetching?S(this,ae)[r]=O.__staleWhileFetching:this.delete(e):(n.status&&(n.status.fetchUpdated=!0),this.set(e,E,c.options))),E},l=E=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=E),d(E)),d=E=>{let{aborted:A}=o.signal,R=A&&n.allowStaleOnFetchAbort,x=R||n.allowStaleOnFetchRejection,O=x||n.noDeleteOnFetchRejection,F=m;if(S(this,ae)[r]===m&&(!O||F.__staleWhileFetching===void 0?this.delete(e):R||(S(this,ae)[r]=F.__staleWhileFetching)),x)return n.status&&F.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),F.__staleWhileFetching;if(F.__returned===F)throw E},g=(E,A)=>{var x;let R=(x=S(this,Fn))==null?void 0:x.call(this,e,i,c);R&&R instanceof Promise&&R.then(O=>E(O),A),o.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(E(),n.allowStaleOnFetchAbort&&(E=O=>p(O,!0)));});};n.status&&(n.status.fetchDispatched=!0);let m=new Promise(g).then(p,l),w=Object.assign(m,{__abortController:o,__staleWhileFetching:i,__returned:void 0});return r===void 0?(this.set(e,w,{...c.options,status:void 0}),r=S(this,$e).get(e)):S(this,ae)[r]=w,w},we=new WeakSet,be=function(e){if(!S(this,Cr))return !1;let r=e;return !!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof Bo},Bi=new WeakSet,Nc=function(e,r){S(this,yt)[r]=e,S(this,Qe)[e]=r;},Yr=new WeakSet,$i=function(e){e!==S(this,Be)&&(e===S(this,Ve)?ne(this,Ve,S(this,Qe)[e]):te(this,Bi,Nc).call(this,S(this,yt)[e],S(this,Qe)[e]),te(this,Bi,Nc).call(this,S(this,Be),e),ne(this,Be,e));};var Do=Mc;var cE=nn(Bb()),fE=nn(lE());Ut();var Ho=class{constructor(){this.logger=Re.child({component:"CompletionCache"});this.options={maxSize:1*1024*1024,partiallyAcceptedCacheGeneration:{enabled:!0,perCharacter:{lines:1,words:10,max:30},perWord:{lines:1,max:20},perLine:{max:3}}};this.cache=new Do({maxSize:this.options.maxSize,sizeCalculation:fE.default});}has(e){return this.cache.has(this.hash(e))}set(e,r){for(let n of this.createCacheEntries(e,r))this.logger.debug({entry:n},"Setting cache entry"),this.cache.set(this.hash(n.key),n.value);this.logger.debug({size:this.cache.calculatedSize},"Cache size");}get(e){return this.cache.get(this.hash(e))}hash(e){return (0, cE.default)(e)}createCacheEntries(e,r){let n=[{key:e,value:r}];if(this.options.partiallyAcceptedCacheGeneration.enabled){let s=r.choices.map(i=>this.calculatePartiallyAcceptedPositions(i.text).map(o=>({prefix:i.text.slice(0,o),suffix:i.text.slice(o),choiceIndex:i.index}))).flat().reduce((i,o)=>(i[o.prefix]=i[o.prefix]||[],i[o.prefix].push({suffix:o.suffix,choiceIndex:o.choiceIndex}),i),{});for(let i in s){let o={...e,text:e.text.slice(0,e.position)+i+e.text.slice(e.position),position:e.position+i.length},u={...r,choices:s[i].map(c=>({index:c.choiceIndex,text:c.suffix}))};n.push({key:o,value:u});}}return n}calculatePartiallyAcceptedPositions(e){let r=[],n=this.options.partiallyAcceptedCacheGeneration,s=Pe(e),i=0,o=0;for(;i<s.length-1&&i<n.perLine.max;)o+=s[i].length,r.push(o),i++;let u=s.slice(0,n.perWord.lines).map(Su).flat();for(i=0,o=0;i<u.length&&i<n.perWord.max;)o+=u[i].length,r.push(o),i++;let c=s.slice(0,n.perCharacter.lines).map(Su).flat().slice(0,n.perCharacter.words).join("");for(o=1;o<c.length&&o<n.perCharacter.max;)r.push(o),o++;return r.filter((p,l,d)=>d.indexOf(p)===l).sort((p,l)=>p-l)}};Ut();function Zc(t,e,r){return Math.max(t,Math.min(e,r))}var Wo=class{constructor(){this.logger=Re.child({component:"CompletionDebounce"});this.lastCalledTimeStamp=0;this.baseInterval=200;this.calledIntervalHistory=[];this.options={baseIntervalSlideWindowAvg:{minSize:20,maxSize:100,min:100,max:400},adaptiveRate:{min:1.5,max:3},contextScoreWeights:{triggerCharacter:.5,noSuffixInCurrentLine:.4,noSuffix:.1},requestDelay:{min:100,max:1e3}};}async debounce(e,r){let{request:n,config:s,responseTime:i}=e;if(n.manually)return this.sleep(0,r);if(s.mode==="fixed")return this.sleep(s.interval,r);let o=Date.now();this.updateBaseInterval(o-this.lastCalledTimeStamp),this.lastCalledTimeStamp=o;let u=this.calcContextScore(n),p=(this.options.adaptiveRate.max-(this.options.adaptiveRate.max-this.options.adaptiveRate.min)*u)*this.baseInterval,l=Zc(this.options.requestDelay.min,this.options.requestDelay.max,p-i);return this.sleep(l,r)}async sleep(e,r){return new Promise((n,s)=>{let i=setTimeout(n,Math.min(e,2147483647));r?.signal&&(r.signal.aborted?(clearTimeout(i),s(r.signal.reason)):r.signal.addEventListener("abort",()=>{clearTimeout(i),s(r.signal.reason);}));})}updateBaseInterval(e){if(!(e>this.options.baseIntervalSlideWindowAvg.max)&&(this.calledIntervalHistory.push(e),this.calledIntervalHistory.length>this.options.baseIntervalSlideWindowAvg.maxSize&&this.calledIntervalHistory.shift(),this.calledIntervalHistory.length>this.options.baseIntervalSlideWindowAvg.minSize)){let r=this.calledIntervalHistory.reduce((n,s)=>n+s,0)/this.calledIntervalHistory.length;this.baseInterval=Zc(this.options.baseIntervalSlideWindowAvg.min,this.options.baseIntervalSlideWindowAvg.max,r);}}calcContextScore(e){let r=0,n=this.options.contextScoreWeights,s=e.text[e.position-1]??"";r+=s.match(/^\W*$/)?n.triggerCharacter:0;let i=e.text.slice(e.position)??"",o=Pe(i)[0]??"";return r+=o.match(/^\W*$/)?n.noSuffixInCurrentLine:0,r+=i.match(/^\W*$/)?n.noSuffix:0,r=Zc(0,1,r),r}};Ut();var mt=Re.child({component:"Postprocess"});function ef(t){let e=t.text.slice(0,t.position),r=t.text.slice(t.position),n=Pe(e),s=Pe(r);return {request:t,prefix:e,suffix:r,prefixLines:n,suffixLines:s}}Array.prototype.distinct||(Array.prototype.distinct=function(t){return [...new Map(this.map(e=>[t?.(e)??e,e])).values()]});function ir(t){return async e=>(e.choices=(await Promise.all(e.choices.map(async r=>(r.text=await t(r.text),r)))).filter(r=>!!r.text).distinct(r=>r.text),e)}function WB(t){return /\n(\s*)\n/g}var hE=t=>e=>{let r=e.split(WB()),n=0,s=2,i=r.length-2;for(;i>=1;){if(xe(r[i])){i--;continue}let o=i-1;for(;o>=0&&xe(r[o]);)o--;if(o<0)break;let u=r[i].trim(),c=r[o].trim(),p=Math.max(3,.1*u.length,.1*c.length);if(gn(u,c)<=p)n++,i--;else break}return n>=s?(mt.debug({inputBlocks:r,repetitionCount:n},"Remove repetitive blocks."),r.slice(0,i+1).join("").trimEnd()):e};var pE=()=>t=>{let e=Pe(t),r=0,n=5,s=e.length-2;for(;s>=1;){if(xe(e[s])){s--;continue}let i=s-1;for(;i>=0&&xe(e[i]);)i--;if(i<0)break;let o=e[s].trim(),u=e[i].trim(),c=Math.max(3,.1*o.length,.1*u.length);if(gn(o,u)<=c)r++,s=i;else break}return r>=n?(mt.debug({inputLines:e,repetitionCount:r},"Remove repetitive lines."),e.slice(0,s+1).join("").trimEnd()):t};var zB=[/(.{3,}?)\1{5,}$/g,/(.{10,}?)\1{3,}$/g],dE=()=>t=>{let e=Pe(t),r=e.length-1;for(;r>=0&&xe(e[r]);)r--;if(r<0)return t;for(let n of zB){let s=e[r].match(n);if(s)return mt.debug({inputLines:e,lineNumber:r,match:s},"Remove line ends with repetition."),r<1?null:e.slice(0,r).join("").trimEnd()}return t};function Or(t){return t.match(/^[ \t]*/)?.[0]?.length??0}function GB(t,e){return e>=t.length-1?!1:Or(t[e])<Or(t[e+1])}function VB(t){let e=t[0]??"";return !xe(e.replace(/[\)\}\]]/g,""))}function KB(t,e,r){let n={indentLevelLimit:0,allowClosingLine:!1};if(t.length==0||e.length==0)return n;let s=e[e.length-1],i=xe(s),o=e.length-1;for(;o>=0&&xe(e[o]);)o--;if(o<0)return n;let u=e[o],c=Or(u),p=t[0],l=xe(p),d=0;for(;d<t.length&&xe(t[d]);)d++;if(d>=t.length)return n;let g=t[d],m;l?m=Or(g):m=Or(s+g),!l&&!i?(n.indentLevelLimit=c+1,n.allowClosingLine=!!t[1]&&Or(t[1])>c):m>c?(n.indentLevelLimit=c+1,n.allowClosingLine=!0):m<c?(n.indentLevelLimit=c,n.allowClosingLine=!0):(n.indentLevelLimit=c,n.allowClosingLine=!1);let w=1;for(;w<r.length&&xe(r[w]);)w++;return w<r.length&&n.allowClosingLine&&(n.allowClosingLine=Or(r[w])<n.indentLevelLimit),n}var yE=t=>e=>{let{prefix:r,suffix:n,prefixLines:s,suffixLines:i}=t,o=Pe(e);if(VB(i)&&o.length>1)return mt.debug({input:e,prefix:r,suffix:n},"Drop content with multiple lines"),null;let u=KB(o,s,i),c;for(c=1;c<o.length;c++){if(xe(o[c]))continue;if(Or(o[c])<u.indentLevelLimit){if(GB(o,c))continue;u.allowClosingLine&&t.request.language!=="python"&&c++;break}}return c<o.length?(mt.debug({input:e,prefix:r,suffix:n,scopeEndAt:c},"Remove content out of scope"),o.slice(0,c).join("").trimEnd()):e};var gE=t=>e=>{let r=t.request,n=r.text.slice(r.position);for(let s=Math.max(0,e.length-n.length);s<e.length;s++)if(e.slice(s)===n.slice(0,e.length-s))return mt.debug({input:e,suffix:n,overlappedAt:s},"Remove overlapped content"),e.slice(0,s);return e};var mE=t=>e=>{let{suffixLines:r}=t,n=Pe(e),s=0;for(;s<n.length&&xe(n[s]);)s++;let i=0;for(;i<r.length&&xe(r[i]);)i++;let o=Math.min(3,n.length-s,r.length-i);if(o<1)return e;let u=n.slice(s,s+o).join("").trim(),c=r.slice(i,i+o).join("").trim(),p=Math.max(3,.05*u.length,.05*c.length),l=gn(u,c);return l<=p?(mt.debug({inputLines:n,suffixLines:r,inputToCompare:u,suffixToCompare:c,distance:l,threshold:p},"Drop completion due to duplicated."),null):e};var tf=()=>t=>xe(t)?null:t;async function wE(t,e){let r=ef(t);return Promise.resolve(e).then(ir(dE())).then(ir(gE(r))).then(ir(mE(r))).then(ir(tf()))}async function vE(t,e){let r=ef(t);return Promise.resolve(e).then(ir(hE())).then(ir(pE())).then(ir(yE(r))).then(ir(tf()))}Ut();var bE="tabby-agent",EE="0.3.1";ui();Ut();var zo=class t{constructor(){this.anonymousUsageTrackingApi=Lr({baseUrl:"https://app.tabbyml.com/api"});this.logger=Re.child({component:"AnonymousUsage"});this.systemData={agent:`${bE}, ${EE}`,browser:void 0,node:`${process.version} ${process.platform} ${G("os").arch()} ${G("os").release()}`};this.sessionProperties={};this.userProperties={};this.userPropertiesUpdated=!1;this.emittedUniqueEvent=[];this.dataStore=null;}static async create(e){let r=new t;return r.dataStore=e.dataStore||Ks,await r.checkAnonymousId(),r}async checkAnonymousId(){if(this.dataStore){try{await this.dataStore.load();}catch(e){this.logger.debug({error:e},"Error when loading anonymousId");}if(typeof this.dataStore.data.anonymousId=="string")this.anonymousId=this.dataStore.data.anonymousId;else {this.anonymousId=Pr(),this.dataStore.data.anonymousId=this.anonymousId;try{await this.dataStore.save();}catch(e){this.logger.debug({error:e},"Error when saving anonymousId");}}}else this.anonymousId=Pr();}setSessionProperties(e,r){yn(this.sessionProperties,e,r);}setUserProperties(e,r){yn(this.userProperties,e,r),this.userPropertiesUpdated=!0;}async uniqueEvent(e,r={}){await this.event(e,r,!0);}async event(e,r={},n=!1){if(this.disabled||n&&this.emittedUniqueEvent.indexOf(e)>=0)return;n&&this.emittedUniqueEvent.push(e);let s={...this.systemData,...this.sessionProperties,...r};this.userPropertiesUpdated&&(s.$set=this.userProperties,this.userPropertiesUpdated=!1);try{await this.anonymousUsageTrackingApi.POST("/usage",{body:{distinctId:this.anonymousId,event:e,properties:s}});}catch(i){this.logger.error({error:i},"Error when sending anonymous usage data");}}};var of=nn(CE());Ut();var Go=class{constructor(){this.sum=0;this.quantity=0;}add(e){this.sum+=e,this.quantity+=1;}mean(){if(this.quantity!==0)return this.sum/this.quantity}count(){return this.quantity}},Vo=class{constructor(e){this.values=[];this.maxSize=e;}add(e){this.values.push(e),this.values.length>this.maxSize&&this.values.shift();}getValues(){return this.values}},Wi=class{constructor(){this.logger=Re.child({component:"CompletionProviderStats"});this.autoCompletionCount=0;this.manualCompletionCount=0;this.cacheHitCount=0;this.cacheMissCount=0;this.completionRequestLatencyStats=new of.Univariate;this.completionRequestCanceledStats=new Go;this.completionRequestTimeoutCount=0;this.recentCompletionRequestLatencies=new Vo(10);}add(e){let{triggerMode:r,cacheHit:n,aborted:s,requestSent:i,requestLatency:o,requestCanceled:u,requestTimeout:c}=e;s||(r==="auto"?this.autoCompletionCount+=1:this.manualCompletionCount+=1,n?this.cacheHitCount+=1:this.cacheMissCount+=1),i&&(u?this.completionRequestCanceledStats.add(o):c?this.completionRequestTimeoutCount+=1:this.completionRequestLatencyStats.add(o),u||this.recentCompletionRequestLatencies.add(o));}reset(){this.autoCompletionCount=0,this.manualCompletionCount=0,this.cacheHitCount=0,this.cacheMissCount=0,this.completionRequestLatencyStats=new of.Univariate,this.completionRequestCanceledStats=new Go,this.completionRequestTimeoutCount=0;}resetWindowed(){this.recentCompletionRequestLatencies=new Vo(10);}stats(){return {completion:{count_auto:this.autoCompletionCount,count_manual:this.manualCompletionCount,cache_hit:this.cacheHitCount,cache_miss:this.cacheMissCount},completion_request:{count:this.completionRequestLatencyStats.count(),latency_avg:this.completionRequestLatencyStats.mean(),latency_p50:this.completionRequestLatencyStats.percentile(50),latency_p95:this.completionRequestLatencyStats.percentile(95),latency_p99:this.completionRequestLatencyStats.percentile(99)},completion_request_canceled:{count:this.completionRequestCanceledStats.count(),latency_avg:this.completionRequestCanceledStats.mean()},completion_request_timeout:{count:this.completionRequestTimeoutCount}}}windowed(){let e=this.recentCompletionRequestLatencies.getValues(),r=e.filter(i=>Number.isNaN(i)),n=e.filter(i=>!Number.isNaN(i)),s=n.reduce((i,o)=>i+o,0)/n.length;return {values:e,stats:{total:e.length,timeouts:r.length,responses:n.length,averageResponseTime:s}}}static check(e){let{values:r,stats:{total:n,timeouts:s,responses:i,averageResponseTime:o}}=e;return r.slice(-3).every(u=>u<3e3)?"healthy":s/n>.5&&s>=3?"highTimeoutRate":i>=3&&o>4e3?"slowResponseTime":null}};var Zr=class Zr extends events.EventEmitter{constructor(){super();this.logger=Re.child({component:"TabbyAgent"});this.config=kc;this.userConfig={};this.clientConfig={};this.status="notInitialized";this.issues=[];this.serverHealthState=null;this.dataStore=null;this.completionCache=new Ho;this.completionDebounce=new Wo;this.nonParallelProvideCompletionAbortController=null;this.completionProviderStats=new Wi;this.tryingConnectTimer=null;this.submitStatsTimer=null;this.tryingConnectTimer=setInterval(async()=>{this.status==="disconnected"&&(this.logger.debug("Trying to connect..."),await this.healthCheck());},Zr.tryConnectInterval),this.submitStatsTimer=setInterval(async()=>{await this.submitStats();},Zr.submitStatsInterval);}static async create(r){let n=new Zr;return n.dataStore=r?.dataStore,n.anonymousUsageLogger=await zo.create({dataStore:r?.dataStore}),n}async applyConfig(){let r=this.config,n=this.status;this.config=Jy(kc,this.userConfig,this.clientConfig),An.forEach(i=>i.level=this.config.logs.level),this.anonymousUsageLogger.disabled=this.config.anonymousUsageTracking.disable,this.config.server.requestHeaders.Authorization===void 0?this.config.server.endpoint!==this.auth?.endpoint&&(this.auth=await yo.create({endpoint:this.config.server.endpoint,dataStore:this.dataStore}),this.auth.on("updated",this.setupApi.bind(this))):this.auth=null,await this.setupApi(),(0, af.default)(r.server,this.config.server)||(this.serverHealthState=null,this.completionProviderStats.resetWindowed(),this.popIssue("slowCompletionResponseTime"),this.popIssue("highCompletionTimeoutRate"),n==="unauthorized"&&this.status==="unauthorized"&&this.emitAuthRequired());let s={event:"configUpdated",config:this.config};this.logger.debug({event:s},"Config updated"),super.emit("configUpdated",s);}async setupApi(){this.api=Lr({baseUrl:this.config.server.endpoint.replace(/\/+$/,""),headers:{Authorization:this.auth?.token?`Bearer ${this.auth.token}`:void 0,...this.config.server.requestHeaders}}),await this.healthCheck();}changeStatus(r){if(this.status!=r){this.status=r;let n={event:"statusChanged",status:r};this.logger.debug({event:n},"Status changed"),super.emit("statusChanged",n),this.status==="unauthorized"&&this.emitAuthRequired();}}issueFromName(r){switch(r){case"highCompletionTimeoutRate":return {name:"highCompletionTimeoutRate",completionResponseStats:this.completionProviderStats.windowed().stats};case"slowCompletionResponseTime":return {name:"slowCompletionResponseTime",completionResponseStats:this.completionProviderStats.windowed().stats}}}pushIssue(r){this.issues.indexOf(r)===-1&&(this.issues.push(r),this.logger.debug({issue:r},"Issues Pushed"),this.emitIssueUpdated());}popIssue(r){let n=this.issues.indexOf(r);n>=0&&(this.issues.splice(n,1),this.logger.debug({issue:r},"Issues Popped"),this.emitIssueUpdated());}emitAuthRequired(){let r={event:"authRequired",server:this.config.server};super.emit("authRequired",r);}emitIssueUpdated(){let r={event:"issuesUpdated",issues:this.issues};super.emit("issuesUpdated",r);}async submitStats(){let r=this.completionProviderStats.stats();r.completion_request.count>0&&(await this.anonymousUsageLogger.event("AgentStats",{stats:r}),this.completionProviderStats.reset(),this.logger.debug({stats:r},"Stats submitted"));}async post(r,n,s){let i=Pr();this.logger.debug({requestId:i,path:r,requestOptions:n,abortOptions:s},"API request");try{let o=Math.min(2147483647,s?.timeout||this.config.server.requestTimeout),u=ai([AbortSignal.timeout(o),s?.signal]),c=await this.api.POST(r,{...n,signal:u});if(c.error)throw new ct(c.response);return this.logger.debug({requestId:i,path:r,response:c.data},"API response"),this.changeStatus("ready"),c.data}catch(o){throw Fs(o)?this.logger.debug({requestId:i,path:r,error:o},"API request timeout"):ks(o)?this.logger.debug({requestId:i,path:r,error:o},"API request canceled"):o instanceof ct&&[401,403,405].indexOf(o.status)!==-1&&new URL(this.config.server.endpoint).hostname.endsWith("app.tabbyml.com")&&this.config.server.requestHeaders.Authorization===void 0?(this.logger.debug({requestId:i,path:r,error:o},"API unauthorized"),this.changeStatus("unauthorized")):o instanceof ct?(this.logger.error({requestId:i,path:r,error:o},"API error"),this.changeStatus("disconnected")):(this.logger.error({requestId:i,path:r,error:o},"API request failed with unknown error"),this.changeStatus("disconnected")),o}}async healthCheck(r){try{let n=await this.post("/v1/health",{},r);typeof n=="object"&&n.model!==void 0&&n.device!==void 0&&(this.serverHealthState=n,this.status==="ready"&&this.anonymousUsageLogger.uniqueEvent("AgentConnected",n));}catch{}}createSegments(r){let n=this.config.completion.prompt.maxPrefixLines,s=this.config.completion.prompt.maxSuffixLines,i=r.text.slice(0,r.position),o=Pe(i),u=r.text.slice(r.position),c=Pe(u);return {prefix:o.slice(Math.max(o.length-n,0)).join(""),suffix:c.slice(0,s).join("")}}async initialize(r){if(r.clientProperties){let{user:n,session:s}=r.clientProperties;An.forEach(i=>i.setBindings?.({...s})),s&&Object.entries(s).forEach(([i,o])=>{this.anonymousUsageLogger.setSessionProperties(i,o);}),n&&Object.entries(n).forEach(([i,o])=>{this.anonymousUsageLogger.setUserProperties(i,o);});}return Pn&&(await Pn.load(),this.userConfig=Pn.config,Pn.on("updated",async n=>{this.userConfig=n,await this.applyConfig();}),Pn.watch()),r.config&&(this.clientConfig=r.config),await this.applyConfig(),await this.anonymousUsageLogger.uniqueEvent("AgentInitialized"),this.logger.debug({options:r},"Initialized"),this.status!=="notInitialized"}async finalize(){return await this.submitStats(),this.tryingConnectTimer&&(clearInterval(this.tryingConnectTimer),this.tryingConnectTimer=null),this.submitStatsTimer&&(clearInterval(this.submitStatsTimer),this.submitStatsTimer=null),this.logger.debug("Finalized"),!0}async updateClientProperties(r,n,s){switch(r){case"session":let i={};yn(i,n,s),An.forEach(o=>o.setBindings?.(i)),this.anonymousUsageLogger.setSessionProperties(n,s);break;case"user":this.anonymousUsageLogger.setUserProperties(n,s);break}return !0}async updateConfig(r,n){let s=eg(this.clientConfig,r);return (0, af.default)(s,n)||(n===void 0?tg(this.clientConfig,r):yn(this.clientConfig,r,n),await this.applyConfig()),!0}async clearConfig(r){return await this.updateConfig(r,void 0)}getConfig(){return this.config}getStatus(){return this.status}getIssues(){return this.issues}getIssueDetail(r){return r.index!==void 0?this.issueFromName(this.issues[r.index]):r.name!==void 0&&this.issues.indexOf(r.name)!==-1?this.issueFromName(r.name):null}getServerHealthState(){return this.serverHealthState}async requestAuthUrl(r){if(this.status==="notInitialized")throw new Error("Agent is not initialized");return await this.healthCheck(r),this.status!=="unauthorized"?null:await this.auth.requestAuthUrl(r)}async waitForAuthToken(r,n){if(this.status==="notInitialized")throw new Error("Agent is not initialized");await this.auth.pollingToken(r,n),await this.setupApi();}async provideCompletions(r,n){if(this.status==="notInitialized")throw new Error("Agent is not initialized");this.nonParallelProvideCompletionAbortController&&this.nonParallelProvideCompletionAbortController.abort(),this.nonParallelProvideCompletionAbortController=new AbortController;let s=ai([this.nonParallelProvideCompletionAbortController.signal,n?.signal]),i=null,o={triggerMode:r.manually?"manual":"auto",cacheHit:!1,aborted:!1,requestSent:!1,requestLatency:0,requestCanceled:!1,requestTimeout:!1},u=null;try{if(this.completionCache.has(r))o.cacheHit=!0,this.logger.debug({request:r},"Completion cache hit"),await this.completionDebounce.debounce({request:r,config:this.config.completion.debounce,responseTime:0},{signal:s}),i=this.completionCache.get(r);else {o.cacheHit=!1;let c=this.createSegments(r);if(xe(c.prefix))o=null,this.logger.debug("Segment prefix is blank, returning empty completion response"),i={id:"agent-"+Pr(),choices:[]};else {await this.completionDebounce.debounce({request:r,config:this.config.completion.debounce,responseTime:this.completionProviderStats.stats().averageResponseTime},n),o.requestSent=!0,u=performance.now();try{i=await this.post("/v1/completions",{body:{language:r.language,segments:c,user:this.auth?.user}},{signal:s,timeout:r.manually?this.config.completion.timeout.manually:this.config.completion.timeout.auto}),o.requestLatency=performance.now()-u;}catch(p){throw ks(p)&&(o.requestCanceled=!0,o.requestLatency=performance.now()-u),Fs(p)&&(o.requestTimeout=!0,o.requestLatency=NaN),p}if(i=await wE(r,i),n?.signal?.aborted)throw n.signal.reason;this.completionCache.set(r,i);}}if(i=await vE(r,i),n?.signal?.aborted)throw n.signal.reason}catch(c){throw ks(c)||Fs(c)?o&&(o.aborted=!0):o=null,c}finally{if(o&&(this.completionProviderStats.add(o),o.requestSent&&!o.requestCanceled)){let c=this.completionProviderStats.windowed();switch(Wi.check(c)){case"healthy":this.popIssue("slowCompletionResponseTime"),this.popIssue("highCompletionTimeoutRate");break;case"highTimeoutRate":this.popIssue("slowCompletionResponseTime"),this.pushIssue("highCompletionTimeoutRate");break;case"slowResponseTime":this.popIssue("highCompletionTimeoutRate"),this.pushIssue("slowCompletionResponseTime");break}}}return i}async postEvent(r,n){if(this.status==="notInitialized")throw new Error("Agent is not initialized");return await this.post("/v1/events",{body:r,params:{query:{select_kind:r.select_kind}},parseAs:"text"},n),!0}};Zr.tryConnectInterval=1e3*30,Zr.submitStatsInterval=1e3*60*60*24;var Ko=Zr;var RE=["statusChanged","configUpdated","authRequired","issuesUpdated"];Ut();var Yo=class{constructor(){this.inStream=process.stdin;this.outStream=process.stdout;this.logger=Re.child({component:"StdIO"});this.buffer="";this.abortControllers={};this.agent=null;}async handleInput(e){let r=e.toString();this.buffer+=r;let n=Pe(this.buffer);if(!(n.length<1)){n[n.length-1].endsWith(`
`)?this.buffer="":this.buffer=n.pop();for(let s of n){let i=null;try{i=JSON.parse(s);}catch(u){this.logger.error({error:u},`Failed to parse request: ${s}`);continue}this.logger.debug({request:i},"Received request");let o=await this.handleRequest(i);this.sendResponse(o),this.logger.debug({response:o},"Sent response");}}}async handleRequest(e){let r=0,n=[0,null],s=new AbortController;try{if(!this.agent)throw new Error(`Agent not bound.
`);r=e[0],n[0]=r;let i=e[1].func;if(i==="cancelRequest")n[1]=this.cancelRequest(e);else {let o=this.agent[i];if(!o)throw new Error(`Unknown function: ${i}`);let u=e[1].args;u.length>0&&typeof u[u.length-1]=="object"&&u[u.length-1].signal&&(this.abortControllers[r]=s,u[u.length-1].signal=s.signal),n[1]=await o.apply(this.agent,u);}}catch(i){this.logger.error({error:i,request:e},"Failed to handle request");}finally{return this.abortControllers[r]&&delete this.abortControllers[r],n}}cancelRequest(e){let r=e[1].args[0],n=this.abortControllers[r];return n?(n.abort(),!0):!1}sendResponse(e){this.outStream.write(JSON.stringify(e)+`
`);}bind(e){this.agent=e;for(let r of RE)this.agent.on(r,n=>{this.sendResponse([0,n]);});}listen(){this.inStream.on("data",this.handleInput.bind(this));}};var OE=new Yo;Ko.create().then(t=>{OE.bind(t),OE.listen();});
/*! Bundled license information:
normalize-path/index.js:
(*!
* normalize-path <https://github.com/jonschlinkert/normalize-path>
*
* Copyright (c) 2014-2018, Jon Schlinkert.
* Released under the MIT License.
*)
is-extglob/index.js:
(*!
* is-extglob <https://github.com/jonschlinkert/is-extglob>
*
* Copyright (c) 2014-2016, Jon Schlinkert.
* Licensed under the MIT License.
*)
is-glob/index.js:
(*!
* is-glob <https://github.com/jonschlinkert/is-glob>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*)
is-number/index.js:
(*!
* is-number <https://github.com/jonschlinkert/is-number>
*
* Copyright (c) 2014-present, Jon Schlinkert.
* Released under the MIT License.
*)
to-regex-range/index.js:
(*!
* to-regex-range <https://github.com/micromatch/to-regex-range>
*
* Copyright (c) 2015-present, Jon Schlinkert.
* Released under the MIT License.
*)
fill-range/index.js:
(*!
* fill-range <https://github.com/jonschlinkert/fill-range>
*
* Copyright (c) 2014-present, Jon Schlinkert.
* Licensed under the MIT License.
*)
ieee754/index.js:
(*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
buffer/index.js:
(*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*)
*/
//# sourceMappingURL=out.js.map
//# sourceMappingURL=cli.js.map