232 lines
380 KiB
JavaScript
Executable File
232 lines
380 KiB
JavaScript
Executable File
#!/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 fE = require('crypto');
|
||
|
||
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
||
|
||
var fE__default = /*#__PURE__*/_interopDefault(fE);
|
||
|
||
var oE=Object.create;var Hn=Object.defineProperty;var aE=Object.getOwnPropertyDescriptor;var lE=Object.getOwnPropertyNames;var uE=Object.getPrototypeOf,cE=Object.prototype.hasOwnProperty;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 jn=(t,e)=>()=>(t&&(e=t(t=0)),e);var T=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Xs=(t,e)=>{for(var r in e)Hn(t,r,{get:e[r],enumerable:!0});},Fc=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of lE(e))!cE.call(t,s)&&s!==r&&Hn(t,s,{get:()=>e[s],enumerable:!(n=aE(e,s))||n.enumerable});return t};var fr=(t,e,r)=>(r=t!=null?oE(uE(t)):{},Fc(e||!t||!t.__esModule?Hn(r,"default",{value:t,enumerable:!0}):r,t)),Qs=t=>Fc(Hn({},"__esModule",{value:!0}),t);var ro=T((Yk,$c)=>{var kc=Object.prototype.toString;$c.exports=function(e){var r=kc.call(e),n=r==="[object Arguments]";return n||(n=r!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&kc.call(e.callee)==="[object Function]"),n};});var zc=T((Jk,Wc)=>{var jc;Object.keys||(Yr=Object.prototype.hasOwnProperty,no=Object.prototype.toString,Lc=ro(),io=Object.prototype.propertyIsEnumerable,Dc=!io.call({toString:null},"toString"),qc=io.call(function(){},"prototype"),Jr=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Gn=function(t){var e=t.constructor;return e&&e.prototype===t},Bc={$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},Uc=function(){if(typeof window>"u")return !1;for(var t in window)try{if(!Bc["$"+t]&&Yr.call(window,t)&&window[t]!==null&&typeof window[t]=="object")try{Gn(window[t]);}catch{return !0}}catch{return !0}return !1}(),Hc=function(t){if(typeof window>"u"||!Uc)return Gn(t);try{return Gn(t)}catch{return !1}},jc=function(e){var r=e!==null&&typeof e=="object",n=no.call(e)==="[object Function]",s=Lc(e),i=r&&no.call(e)==="[object String]",o=[];if(!r&&!n&&!s)throw new TypeError("Object.keys called on a non-object");var a=qc&&n;if(i&&e.length>0&&!Yr.call(e,0))for(var c=0;c<e.length;++c)o.push(String(c));if(s&&e.length>0)for(var d=0;d<e.length;++d)o.push(String(d));else for(var u in e)!(a&&u==="prototype")&&Yr.call(e,u)&&o.push(String(u));if(Dc)for(var p=Hc(e),_=0;_<Jr.length;++_)!(p&&Jr[_]==="constructor")&&Yr.call(e,Jr[_])&&o.push(Jr[_]);return o});var Yr,no,Lc,io,Dc,qc,Jr,Gn,Bc,Uc,Hc;Wc.exports=jc;});var Kn=T((Xk,Kc)=>{var pE=Array.prototype.slice,mE=ro(),Gc=Object.keys,Vn=Gc?function(e){return Gc(e)}:zc(),Vc=Object.keys;Vn.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 mE(n)?Vc(pE.call(n)):Vc(n)});}else Object.keys=Vn;return Object.keys||Vn};Kc.exports=Vn;});var Zn=T((Qk,Zc)=>{Zc.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 so=T((e2,Jc)=>{var Yc=typeof Symbol<"u"&&Symbol,_E=Zn();Jc.exports=function(){return typeof Yc!="function"||typeof Symbol!="function"||typeof Yc("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:_E()};});var ef=T((t2,Qc)=>{var Xc={foo:{}},gE=Object;Qc.exports=function(){return {__proto__:Xc}.foo===Xc.foo&&!({__proto__:null}instanceof gE)};});var rf=T((r2,tf)=>{var yE="Function.prototype.bind called on incompatible ",oo=Array.prototype.slice,wE=Object.prototype.toString,bE="[object Function]";tf.exports=function(e){var r=this;if(typeof r!="function"||wE.call(r)!==bE)throw new TypeError(yE+r);for(var n=oo.call(arguments,1),s,i=function(){if(this instanceof s){var u=r.apply(this,n.concat(oo.call(arguments)));return Object(u)===u?u:this}else return r.apply(e,n.concat(oo.call(arguments)))},o=Math.max(0,r.length-n.length),a=[],c=0;c<o;c++)a.push("$"+c);if(s=Function("binder","return function ("+a.join(",")+"){ return binder.apply(this,arguments); }")(i),r.prototype){var d=function(){};d.prototype=r.prototype,s.prototype=new d,d.prototype=null;}return s};});var Yn=T((n2,nf)=>{var vE=rf();nf.exports=Function.prototype.bind||vE;});var of=T((i2,sf)=>{var SE=Yn();sf.exports=SE.call(Function.call,Object.prototype.hasOwnProperty);});var ct=T((s2,ff)=>{var oe,mr=SyntaxError,cf=Function,pr=TypeError,ao=function(t){try{return cf('"use strict"; return ('+t+").constructor;")()}catch{}},zt=Object.getOwnPropertyDescriptor;var lo=function(){throw new pr},EE=zt?function(){try{return lo}catch{try{return zt(arguments,"callee").get}catch{return lo}}}():lo,hr=so()(),AE=ef()(),Se=Object.getPrototypeOf||(AE?function(t){return t.__proto__}:null),dr={},xE=typeof Uint8Array>"u"||!Se?oe:Se(Uint8Array),Gt={"%AggregateError%":typeof AggregateError>"u"?oe:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?oe:ArrayBuffer,"%ArrayIteratorPrototype%":hr&&Se?Se([][Symbol.iterator]()):oe,"%AsyncFromSyncIteratorPrototype%":oe,"%AsyncFunction%":dr,"%AsyncGenerator%":dr,"%AsyncGeneratorFunction%":dr,"%AsyncIteratorPrototype%":dr,"%Atomics%":typeof Atomics>"u"?oe:Atomics,"%BigInt%":typeof BigInt>"u"?oe:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?oe:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?oe:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?oe:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?oe:Float32Array,"%Float64Array%":typeof Float64Array>"u"?oe:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?oe:FinalizationRegistry,"%Function%":cf,"%GeneratorFunction%":dr,"%Int8Array%":typeof Int8Array>"u"?oe:Int8Array,"%Int16Array%":typeof Int16Array>"u"?oe:Int16Array,"%Int32Array%":typeof Int32Array>"u"?oe:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":hr&&Se?Se(Se([][Symbol.iterator]())):oe,"%JSON%":typeof JSON=="object"?JSON:oe,"%Map%":typeof Map>"u"?oe:Map,"%MapIteratorPrototype%":typeof Map>"u"||!hr||!Se?oe:Se(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?oe:Promise,"%Proxy%":typeof Proxy>"u"?oe:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?oe:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?oe:Set,"%SetIteratorPrototype%":typeof Set>"u"||!hr||!Se?oe:Se(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?oe:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":hr&&Se?Se(""[Symbol.iterator]()):oe,"%Symbol%":hr?Symbol:oe,"%SyntaxError%":mr,"%ThrowTypeError%":EE,"%TypedArray%":xE,"%TypeError%":pr,"%Uint8Array%":typeof Uint8Array>"u"?oe:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?oe:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?oe:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?oe:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?oe:WeakMap,"%WeakRef%":typeof WeakRef>"u"?oe:WeakRef,"%WeakSet%":typeof WeakSet>"u"?oe:WeakSet};var CE=function t(e){var r;if(e==="%AsyncFunction%")r=ao("async function () {}");else if(e==="%GeneratorFunction%")r=ao("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=ao("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype);}else if(e==="%AsyncIteratorPrototype%"){var s=t("%AsyncGenerator%");s&&Se&&(r=Se(s.prototype));}return Gt[e]=r,r},lf={"%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"]},Xr=Yn(),Jn=of(),RE=Xr.call(Function.call,Array.prototype.concat),TE=Xr.call(Function.apply,Array.prototype.splice),uf=Xr.call(Function.call,String.prototype.replace),Xn=Xr.call(Function.call,String.prototype.slice),IE=Xr.call(Function.call,RegExp.prototype.exec),PE=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,OE=/\\(\\)?/g,ME=function(e){var r=Xn(e,0,1),n=Xn(e,-1);if(r==="%"&&n!=="%")throw new mr("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new mr("invalid intrinsic syntax, expected opening `%`");var s=[];return uf(e,PE,function(i,o,a,c){s[s.length]=a?uf(c,OE,"$1"):o||i;}),s},FE=function(e,r){var n=e,s;if(Jn(lf,n)&&(s=lf[n],n="%"+s[0]+"%"),Jn(Gt,n)){var i=Gt[n];if(i===dr&&(i=CE(n)),typeof i>"u"&&!r)throw new pr("intrinsic "+e+" exists, but is not available. Please file an issue!");return {alias:s,name:n,value:i}}throw new mr("intrinsic "+e+" does not exist!")};ff.exports=function(e,r){if(typeof e!="string"||e.length===0)throw new pr("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new pr('"allowMissing" argument must be a boolean');if(IE(/^%?[^%]*%?$/,e)===null)throw new mr("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=ME(e),s=n.length>0?n[0]:"",i=FE("%"+s+"%",r),o=i.name,a=i.value,c=!1,d=i.alias;d&&(s=d[0],TE(n,RE([0,1],d)));for(var u=1,p=!0;u<n.length;u+=1){var _=n[u],m=Xn(_,0,1),y=Xn(_,-1);if((m==='"'||m==="'"||m==="`"||y==='"'||y==="'"||y==="`")&&m!==y)throw new mr("property names with quotes must have matching quotes");if((_==="constructor"||!p)&&(c=!0),s+="."+_,o="%"+s+"%",Jn(Gt,o))a=Gt[o];else if(a!=null){if(!(_ in a)){if(!r)throw new pr("base intrinsic for "+e+" exists, but the property is not available.");return}if(zt&&u+1>=n.length){var v=zt(a,_);p=!!v,p&&"get"in v&&!("originalValue"in v.get)?a=v.get:a=a[_];}else p=Jn(a,_),a=a[_];p&&!c&&(Gt[o]=a);}}return a};});var Qn=T((o2,hf)=>{var NE=ct(),uo=NE("%Object.defineProperty%",!0),co=function(){if(uo)try{return uo({},"a",{value:1}),!0}catch{return !1}return !1};co.hasArrayLengthDefineBug=function(){if(!co())return null;try{return uo([],"length",{value:1}).length!==1}catch{return !0}};hf.exports=co;});var fo=T((a2,df)=>{var kE=ct(),ei=kE("%Object.getOwnPropertyDescriptor%",!0);if(ei)try{ei([],"length");}catch{ei=null;}df.exports=ei;});var po=T((l2,_f)=>{var $E=Qn()(),ho=ct(),pf=$E&&ho("%Object.defineProperty%",!0),LE=ho("%SyntaxError%"),_r=ho("%TypeError%"),mf=fo();_f.exports=function(e,r,n){if(!e||typeof e!="object"&&typeof e!="function")throw new _r("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new _r("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new _r("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new _r("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new _r("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new _r("`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,a=arguments.length>6?arguments[6]:!1,c=!!mf&&mf(e,r);if(pf)pf(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(a||!s&&!i&&!o)e[r]=n;else throw new LE("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")};});var Rt=T((u2,bf)=>{var DE=Kn(),qE=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",BE=Object.prototype.toString,UE=Array.prototype.concat,gf=po(),HE=function(t){return typeof t=="function"&&BE.call(t)==="[object Function]"},yf=Qn()(),jE=function(t,e,r,n){if(e in t){if(n===!0){if(t[e]===r)return}else if(!HE(n)||!n())return}yf?gf(t,e,r,!0):gf(t,e,r);},wf=function(t,e){var r=arguments.length>2?arguments[2]:{},n=DE(e);qE&&(n=UE.call(n,Object.getOwnPropertySymbols(e)));for(var s=0;s<n.length;s+=1)jE(t,n[s],e[n[s]],r[n[s]]);};wf.supportsDescriptors=!!yf;bf.exports=wf;});var Kt=T((c2,ti)=>{var mo=Yn(),gr=ct(),Ef=gr("%Function.prototype.apply%"),Af=gr("%Function.prototype.call%"),xf=gr("%Reflect.apply%",!0)||mo.call(Af,Ef),vf=gr("%Object.getOwnPropertyDescriptor%",!0),Vt=gr("%Object.defineProperty%",!0),WE=gr("%Math.max%");if(Vt)try{Vt({},"a",{value:1});}catch{Vt=null;}ti.exports=function(e){var r=xf(mo,Af,arguments);if(vf&&Vt){var n=vf(r,"length");n.configurable&&Vt(r,"length",{value:1+WE(0,e.length-(arguments.length-1))});}return r};var Sf=function(){return xf(mo,Ef,arguments)};Vt?Vt(ti.exports,"apply",{value:Sf}):ti.exports.apply=Sf;});var Qe=T((f2,Tf)=>{var Cf=ct(),Rf=Kt(),zE=Rf(Cf("String.prototype.indexOf"));Tf.exports=function(e,r){var n=Cf(e,!!r);return typeof n=="function"&&zE(e,".prototype.")>-1?Rf(n):n};});var _o=T((h2,Ff)=>{var GE=Kn(),Of=Zn()(),Mf=Qe(),If=Object,VE=Mf("Array.prototype.push"),Pf=Mf("Object.prototype.propertyIsEnumerable"),KE=Of?Object.getOwnPropertySymbols:null;Ff.exports=function(e,r){if(e==null)throw new TypeError("target must be an object");var n=If(e);if(arguments.length===1)return n;for(var s=1;s<arguments.length;++s){var i=If(arguments[s]),o=GE(i),a=Of&&(Object.getOwnPropertySymbols||KE);if(a)for(var c=a(i),d=0;d<c.length;++d){var u=c[d];Pf(i,u)&&VE(o,u);}for(var p=0;p<o.length;++p){var _=o[p];if(Pf(i,_)){var m=i[_];n[_]=m;}}}return n};});var yo=T((d2,Nf)=>{var go=_o(),ZE=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},YE=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};Nf.exports=function(){return !Object.assign||ZE()||YE()?go:Object.assign};});var $f=T((p2,kf)=>{var JE=Rt(),XE=yo();kf.exports=function(){var e=XE();return JE(Object,{assign:e},{assign:function(){return Object.assign!==e}}),e};});var Bf=T((m2,qf)=>{var QE=Rt(),e0=Kt(),t0=_o(),Lf=yo(),r0=$f(),n0=e0.apply(Lf()),Df=function(e,r){return n0(Object,arguments)};QE(Df,{getPolyfill:Lf,implementation:t0,shim:r0});qf.exports=Df;});var Hf=T((_2,Uf)=>{var en=function(){return typeof function(){}.name=="string"},Qr=Object.getOwnPropertyDescriptor;en.functionsHaveConfigurableNames=function(){if(!en()||!Qr)return !1;var e=Qr(function(){},"name");return !!e&&!!e.configurable};var i0=Function.prototype.bind;en.boundFunctionsHaveNames=function(){return en()&&typeof i0=="function"&&function(){}.bind().name!==""};Uf.exports=en;});var zf=T((g2,Wf)=>{var jf=po(),s0=Qn()(),o0=Hf().functionsHaveConfigurableNames(),a0=TypeError;Wf.exports=function(e,r){if(typeof e!="function")throw new a0("`fn` is not a function");var n=arguments.length>2&&!!arguments[2];return (!n||o0)&&(s0?jf(e,"name",r,!0,!0):jf(e,"name",r)),e};});var wo=T((y2,Gf)=>{var l0=zf(),u0=Object,c0=TypeError;Gf.exports=l0(function(){if(this!=null&&this!==u0(this))throw new c0("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 bo=T((w2,Vf)=>{var f0=wo(),h0=Rt().supportsDescriptors,d0=Object.getOwnPropertyDescriptor;Vf.exports=function(){if(h0&&/a/mig.flags==="gim"){var e=d0(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 f0};});var Yf=T((b2,Zf)=>{var p0=Rt().supportsDescriptors,m0=bo(),_0=Object.getOwnPropertyDescriptor,g0=Object.defineProperty,y0=TypeError,Kf=Object.getPrototypeOf,w0=/a/;Zf.exports=function(){if(!p0||!Kf)throw new y0("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var e=m0(),r=Kf(w0),n=_0(r,"flags");return (!n||n.get!==e)&&g0(r,"flags",{configurable:!0,enumerable:!1,get:e}),e};});var eh=T((v2,Qf)=>{var b0=Rt(),v0=Kt(),S0=wo(),Jf=bo(),E0=Yf(),Xf=v0(Jf());b0(Xf,{getPolyfill:Jf,implementation:S0,shim:E0});Qf.exports=Xf;});var nh=T((S2,rh)=>{var th=Symbol.iterator;rh.exports=function(e){if(e!=null&&typeof e[th]<"u")return e[th]()};});var sh=T((E2,ih)=>{ih.exports=G("util").inspect;});var xh=T((A2,Ah)=>{var Po=typeof Map=="function"&&Map.prototype,vo=Object.getOwnPropertyDescriptor&&Po?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,ni=Po&&vo&&typeof vo.get=="function"?vo.get:null,oh=Po&&Map.prototype.forEach,Oo=typeof Set=="function"&&Set.prototype,So=Object.getOwnPropertyDescriptor&&Oo?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,ii=Oo&&So&&typeof So.get=="function"?So.get:null,ah=Oo&&Set.prototype.forEach,A0=typeof WeakMap=="function"&&WeakMap.prototype,rn=A0?WeakMap.prototype.has:null,x0=typeof WeakSet=="function"&&WeakSet.prototype,nn=x0?WeakSet.prototype.has:null,C0=typeof WeakRef=="function"&&WeakRef.prototype,lh=C0?WeakRef.prototype.deref:null,R0=Boolean.prototype.valueOf,T0=Object.prototype.toString,I0=Function.prototype.toString,P0=String.prototype.match,Mo=String.prototype.slice,It=String.prototype.replace,O0=String.prototype.toUpperCase,uh=String.prototype.toLowerCase,yh=RegExp.prototype.test,ch=Array.prototype.concat,ft=Array.prototype.join,M0=Array.prototype.slice,fh=Math.floor,xo=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Eo=Object.getOwnPropertySymbols,Co=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,yr=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Fe=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===yr||"symbol")?Symbol.toStringTag:null,wh=Object.prototype.propertyIsEnumerable,hh=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function dh(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||yh.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-fh(-t):fh(t);if(n!==t){var s=String(n),i=Mo.call(e,s.length+1);return It.call(s,r,"$&_")+"."+It.call(It.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return It.call(e,r,"$&_")}var Ro=sh(),ph=Ro.custom,mh=vh(ph)?ph:null;Ah.exports=function t(e,r,n,s){var i=r||{};if(Tt(i,"quoteStyle")&&i.quoteStyle!=="single"&&i.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Tt(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=Tt(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(Tt(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(Tt(i,"numericSeparator")&&typeof i.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=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 Eh(e,i);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var c=String(e);return a?dh(e,c):c}if(typeof e=="bigint"){var d=String(e)+"n";return a?dh(e,d):d}var u=typeof i.depth>"u"?5:i.depth;if(typeof n>"u"&&(n=0),n>=u&&u>0&&typeof e=="object")return To(e)?"[Array]":"[Object]";var p=Y0(i,n);if(typeof s>"u")s=[];else if(Sh(s,e)>=0)return "[Circular]";function _(V,te,I){if(te&&(s=M0.call(s),s.push(te)),I){var O={depth:i.depth};return Tt(i,"quoteStyle")&&(O.quoteStyle=i.quoteStyle),t(V,O,n+1,s)}return t(V,i,n+1,s)}if(typeof e=="function"&&!_h(e)){var m=U0(e),y=ri(e,_);return "[Function"+(m?": "+m:" (anonymous)")+"]"+(y.length>0?" { "+ft.call(y,", ")+" }":"")}if(vh(e)){var v=yr?It.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):Co.call(e);return typeof e=="object"&&!yr?tn(v):v}if(V0(e)){for(var E="<"+uh.call(String(e.nodeName)),A=e.attributes||[],w=0;w<A.length;w++)E+=" "+A[w].name+"="+bh(F0(A[w].value),"double",i);return E+=">",e.childNodes&&e.childNodes.length&&(E+="..."),E+="</"+uh.call(String(e.nodeName))+">",E}if(To(e)){if(e.length===0)return "[]";var x=ri(e,_);return p&&!Z0(x)?"["+Io(x,p)+"]":"[ "+ft.call(x,", ")+" ]"}if(k0(e)){var M=ri(e,_);return !("cause"in Error.prototype)&&"cause"in e&&!wh.call(e,"cause")?"{ ["+String(e)+"] "+ft.call(ch.call("[cause]: "+_(e.cause),M),", ")+" }":M.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+ft.call(M,", ")+" }"}if(typeof e=="object"&&o){if(mh&&typeof e[mh]=="function"&&Ro)return Ro(e,{depth:u-n});if(o!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(H0(e)){var k=[];return oh&&oh.call(e,function(V,te){k.push(_(te,e,!0)+" => "+_(V,e));}),gh("Map",ni.call(e),k,p)}if(z0(e)){var j=[];return ah&&ah.call(e,function(V){j.push(_(V,e));}),gh("Set",ii.call(e),j,p)}if(j0(e))return Ao("WeakMap");if(G0(e))return Ao("WeakSet");if(W0(e))return Ao("WeakRef");if(L0(e))return tn(_(Number(e)));if(q0(e))return tn(_(xo.call(e)));if(D0(e))return tn(R0.call(e));if($0(e))return tn(_(String(e)));if(!N0(e)&&!_h(e)){var U=ri(e,_),$=hh?hh(e)===Object.prototype:e instanceof Object||e.constructor===Object,F=e instanceof Object?"":"null prototype",B=!$&&Fe&&Object(e)===e&&Fe in e?Mo.call(Pt(e),8,-1):F?"Object":"",R=$||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",z=R+(B||F?"["+ft.call(ch.call([],B||[],F||[]),": ")+"] ":"");return U.length===0?z+"{}":p?z+"{"+Io(U,p)+"}":z+"{ "+ft.call(U,", ")+" }"}return String(e)};function bh(t,e,r){var n=(r.quoteStyle||e)==="double"?'"':"'";return n+t+n}function F0(t){return It.call(String(t),/"/g,""")}function To(t){return Pt(t)==="[object Array]"&&(!Fe||!(typeof t=="object"&&Fe in t))}function N0(t){return Pt(t)==="[object Date]"&&(!Fe||!(typeof t=="object"&&Fe in t))}function _h(t){return Pt(t)==="[object RegExp]"&&(!Fe||!(typeof t=="object"&&Fe in t))}function k0(t){return Pt(t)==="[object Error]"&&(!Fe||!(typeof t=="object"&&Fe in t))}function $0(t){return Pt(t)==="[object String]"&&(!Fe||!(typeof t=="object"&&Fe in t))}function L0(t){return Pt(t)==="[object Number]"&&(!Fe||!(typeof t=="object"&&Fe in t))}function D0(t){return Pt(t)==="[object Boolean]"&&(!Fe||!(typeof t=="object"&&Fe in t))}function vh(t){if(yr)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return !0;if(!t||typeof t!="object"||!Co)return !1;try{return Co.call(t),!0}catch{}return !1}function q0(t){if(!t||typeof t!="object"||!xo)return !1;try{return xo.call(t),!0}catch{}return !1}var B0=Object.prototype.hasOwnProperty||function(t){return t in this};function Tt(t,e){return B0.call(t,e)}function Pt(t){return T0.call(t)}function U0(t){if(t.name)return t.name;var e=P0.call(I0.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function Sh(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 H0(t){if(!ni||!t||typeof t!="object")return !1;try{ni.call(t);try{ii.call(t);}catch{return !0}return t instanceof Map}catch{}return !1}function j0(t){if(!rn||!t||typeof t!="object")return !1;try{rn.call(t,rn);try{nn.call(t,nn);}catch{return !0}return t instanceof WeakMap}catch{}return !1}function W0(t){if(!lh||!t||typeof t!="object")return !1;try{return lh.call(t),!0}catch{}return !1}function z0(t){if(!ii||!t||typeof t!="object")return !1;try{ii.call(t);try{ni.call(t);}catch{return !0}return t instanceof Set}catch{}return !1}function G0(t){if(!nn||!t||typeof t!="object")return !1;try{nn.call(t,nn);try{rn.call(t,rn);}catch{return !0}return t instanceof WeakSet}catch{}return !1}function V0(t){return !t||typeof t!="object"?!1:typeof HTMLElement<"u"&&t instanceof HTMLElement?!0:typeof t.nodeName=="string"&&typeof t.getAttribute=="function"}function Eh(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return Eh(Mo.call(t,0,e.maxStringLength),e)+n}var s=It.call(It.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,K0);return bh(s,"single",e)}function K0(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":"")+O0.call(e.toString(16))}function tn(t){return "Object("+t+")"}function Ao(t){return t+" { ? }"}function gh(t,e,r,n){var s=n?Io(r,n):ft.call(r,", ");return t+" ("+e+") {"+s+"}"}function Z0(t){for(var e=0;e<t.length;e++)if(Sh(t[e],`
|
||
`)>=0)return !1;return !0}function Y0(t,e){var r;if(t.indent===" ")r=" ";else if(typeof t.indent=="number"&&t.indent>0)r=ft.call(Array(t.indent+1)," ");else return null;return {base:r,prev:ft.call(Array(e+1),r)}}function Io(t,e){if(t.length===0)return "";var r=`
|
||
`+e.prev+e.base;return r+ft.call(t,","+r)+`
|
||
`+e.prev}function ri(t,e){var r=To(t),n=[];if(r){n.length=t.length;for(var s=0;s<t.length;s++)n[s]=Tt(t,s)?e(t[s],t):"";}var i=typeof Eo=="function"?Eo(t):[],o;if(yr){o={};for(var a=0;a<i.length;a++)o["$"+i[a]]=i[a];}for(var c in t)Tt(t,c)&&(r&&String(Number(c))===c&&c<t.length||yr&&o["$"+c]instanceof Symbol||(yh.call(/[^\w$]/,c)?n.push(e(c,t)+": "+e(t[c],t)):n.push(c+": "+e(t[c],t))));if(typeof Eo=="function")for(var d=0;d<i.length;d++)wh.call(t,i[d])&&n.push("["+e(i[d])+"]: "+e(t[i[d]],t));return n}});var Rh=T((x2,Ch)=>{var Fo=ct(),wr=Qe(),J0=xh(),X0=Fo("%TypeError%"),si=Fo("%WeakMap%",!0),oi=Fo("%Map%",!0),Q0=wr("WeakMap.prototype.get",!0),eA=wr("WeakMap.prototype.set",!0),tA=wr("WeakMap.prototype.has",!0),rA=wr("Map.prototype.get",!0),nA=wr("Map.prototype.set",!0),iA=wr("Map.prototype.has",!0),No=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},sA=function(t,e){var r=No(t,e);return r&&r.value},oA=function(t,e,r){var n=No(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r};},aA=function(t,e){return !!No(t,e)};Ch.exports=function(){var e,r,n,s={assert:function(i){if(!s.has(i))throw new X0("Side channel does not contain "+J0(i))},get:function(i){if(si&&i&&(typeof i=="object"||typeof i=="function")){if(e)return Q0(e,i)}else if(oi){if(r)return rA(r,i)}else if(n)return sA(n,i)},has:function(i){if(si&&i&&(typeof i=="object"||typeof i=="function")){if(e)return tA(e,i)}else if(oi){if(r)return iA(r,i)}else if(n)return aA(n,i);return !1},set:function(i,o){si&&i&&(typeof i=="object"||typeof i=="function")?(e||(e=new si),eA(e,i,o)):oi?(r||(r=new oi),nA(r,i,o)):(n||(n={key:{},next:null}),oA(n,i,o));}};return s};});var ko=T((C2,Ih)=>{var Th=function(t){return t!==t};Ih.exports=function(e,r){return e===0&&r===0?1/e===1/r:!!(e===r||Th(e)&&Th(r))};});var $o=T((R2,Ph)=>{var lA=ko();Ph.exports=function(){return typeof Object.is=="function"?Object.is:lA};});var Mh=T((T2,Oh)=>{var uA=$o(),cA=Rt();Oh.exports=function(){var e=uA();return cA(Object,{is:e},{is:function(){return Object.is!==e}}),e};});var $h=T((I2,kh)=>{var fA=Rt(),hA=Kt(),dA=ko(),Fh=$o(),pA=Mh(),Nh=hA(Fh(),Object);fA(Nh,{getPolyfill:Fh,implementation:dA,shim:pA});kh.exports=Nh;});var Ot=T((P2,Lh)=>{var mA=Zn();Lh.exports=function(){return mA()&&!!Symbol.toStringTag};});var Bh=T((O2,qh)=>{var _A=Ot()(),gA=Qe(),Lo=gA("Object.prototype.toString"),ai=function(e){return _A&&e&&typeof e=="object"&&Symbol.toStringTag in e?!1:Lo(e)==="[object Arguments]"},Dh=function(e){return ai(e)?!0:e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&Lo(e)!=="[object Array]"&&Lo(e.callee)==="[object Function]"},yA=function(){return ai(arguments)}();ai.isLegacyArguments=Dh;qh.exports=yA?ai:Dh;});var Hh=T((M2,Uh)=>{var wA={}.toString;Uh.exports=Array.isArray||function(t){return wA.call(t)=="[object Array]"};});var Gh=T((F2,zh)=>{var Wh=Function.prototype.toString,br=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,qo,li;if(typeof br=="function"&&typeof Object.defineProperty=="function")try{qo=Object.defineProperty({},"length",{get:function(){throw li}}),li={},br(function(){throw 42},null,qo);}catch(t){t!==li&&(br=null);}else br=null;var bA=/^\s*class\b/,Bo=function(e){try{var r=Wh.call(e);return bA.test(r)}catch{return !1}},Do=function(e){try{return Bo(e)?!1:(Wh.call(e),!0)}catch{return !1}},ui=Object.prototype.toString,vA="[object Object]",SA="[object Function]",EA="[object GeneratorFunction]",AA="[object HTMLAllCollection]",xA="[object HTML document.all class]",CA="[object HTMLCollection]",RA=typeof Symbol=="function"&&!!Symbol.toStringTag,TA=!(0 in[,]),Uo=function(){return !1};typeof document=="object"&&(jh=document.all,ui.call(jh)===ui.call(document.all)&&(Uo=function(e){if((TA||!e)&&(typeof e>"u"||typeof e=="object"))try{var r=ui.call(e);return (r===AA||r===xA||r===CA||r===vA)&&e("")==null}catch{}return !1}));var jh;zh.exports=br?function(e){if(Uo(e))return !0;if(!e||typeof e!="function"&&typeof e!="object")return !1;try{br(e,null,qo);}catch(r){if(r!==li)return !1}return !Bo(e)&&Do(e)}:function(e){if(Uo(e))return !0;if(!e||typeof e!="function"&&typeof e!="object")return !1;if(RA)return Do(e);if(Bo(e))return !1;var r=ui.call(e);return r!==SA&&r!==EA&&!/^\[object HTML/.test(r)?!1:Do(e)};});var Zh=T((N2,Kh)=>{var IA=Gh(),PA=Object.prototype.toString,Vh=Object.prototype.hasOwnProperty,OA=function(e,r,n){for(var s=0,i=e.length;s<i;s++)Vh.call(e,s)&&(n==null?r(e[s],s,e):r.call(n,e[s],s,e));},MA=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);},FA=function(e,r,n){for(var s in e)Vh.call(e,s)&&(n==null?r(e[s],s,e):r.call(n,e[s],s,e));},NA=function(e,r,n){if(!IA(r))throw new TypeError("iterator must be a function");var s;arguments.length>=3&&(s=n),PA.call(e)==="[object Array]"?OA(e,r,s):typeof e=="string"?MA(e,r,s):FA(e,r,s);};Kh.exports=NA;});var Jh=T((k2,Yh)=>{var Ho=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],kA=typeof globalThis>"u"?global:globalThis;Yh.exports=function(){for(var e=[],r=0;r<Ho.length;r++)typeof kA[Ho[r]]=="function"&&(e[e.length]=Ho[r]);return e};});var Vo=T(($2,td)=>{var fi=Zh(),$A=Jh(),Xh=Kt(),zo=Qe(),ci=fo(),LA=zo("Object.prototype.toString"),ed=Ot()(),Qh=typeof globalThis>"u"?global:globalThis,Wo=$A(),Go=zo("String.prototype.slice"),jo=Object.getPrototypeOf,DA=zo("Array.prototype.indexOf",!0)||function(e,r){for(var n=0;n<e.length;n+=1)if(e[n]===r)return n;return -1},hi={__proto__:null};ed&&ci&&jo?fi(Wo,function(t){var e=new Qh[t];if(Symbol.toStringTag in e){var r=jo(e),n=ci(r,Symbol.toStringTag);if(!n){var s=jo(r);n=ci(s,Symbol.toStringTag);}hi["$"+t]=Xh(n.get);}}):fi(Wo,function(t){var e=new Qh[t];hi["$"+t]=Xh(e.slice);});var qA=function(e){var r=!1;return fi(hi,function(n,s){if(!r)try{"$"+n(e)===s&&(r=Go(s,1));}catch{}}),r},BA=function(e){var r=!1;return fi(hi,function(n,s){if(!r)try{n(e),r=Go(s,1);}catch{}}),r};td.exports=function(e){if(!e||typeof e!="object")return !1;if(!ed){var r=Go(LA(e),8,-1);return DA(Wo,r)>-1?r:r!=="Object"?!1:BA(e)}return ci?qA(e):null};});var nd=T((L2,rd)=>{var UA=Vo();rd.exports=function(e){return !!UA(e)};});var Ko=T((D2,ud)=>{var HA=Kt(),jA=Qe(),ld=ct(),WA=nd(),id=ld("ArrayBuffer",!0),sd=ld("Float32Array",!0),di=jA("ArrayBuffer.prototype.byteLength",!0),od=id&&!di&&new id().slice,ad=od&&HA(od);ud.exports=di||ad?function(e){if(!e||typeof e!="object")return !1;try{return di?di(e):ad(e,0),!0}catch{return !1}}:sd?function(e){try{return new sd(e).buffer===e&&!WA(e)}catch(r){return typeof e=="object"&&r.name==="RangeError"}}:function(e){return !1};});var fd=T((q2,cd)=>{var zA=Date.prototype.getDay,GA=function(e){try{return zA.call(e),!0}catch{return !1}},VA=Object.prototype.toString,KA="[object Date]",ZA=Ot()();cd.exports=function(e){return typeof e!="object"||e===null?!1:ZA?GA(e):VA.call(e)===KA};});var _d=T((B2,md)=>{var Zo=Qe(),hd=Ot()(),dd,pd,Yo,Jo;hd&&(dd=Zo("Object.prototype.hasOwnProperty"),pd=Zo("RegExp.prototype.exec"),Yo={},pi=function(){throw Yo},Jo={toString:pi,valueOf:pi},typeof Symbol.toPrimitive=="symbol"&&(Jo[Symbol.toPrimitive]=pi));var pi,YA=Zo("Object.prototype.toString"),JA=Object.getOwnPropertyDescriptor,XA="[object RegExp]";md.exports=hd?function(e){if(!e||typeof e!="object")return !1;var r=JA(e,"lastIndex"),n=r&&dd(r,"value");if(!n)return !1;try{pd(e,Jo);}catch(s){return s===Yo}}:function(e){return !e||typeof e!="object"&&typeof e!="function"?!1:YA(e)===XA};});var wd=T((U2,yd)=>{var QA=Qe(),gd=QA("SharedArrayBuffer.prototype.byteLength",!0);yd.exports=gd?function(e){if(!e||typeof e!="object")return !1;try{return gd(e),!0}catch{return !1}}:function(e){return !1};});var vd=T((H2,bd)=>{var ex=String.prototype.valueOf,tx=function(e){try{return ex.call(e),!0}catch{return !1}},rx=Object.prototype.toString,nx="[object String]",ix=Ot()();bd.exports=function(e){return typeof e=="string"?!0:typeof e!="object"?!1:ix?tx(e):rx.call(e)===nx};});var Ed=T((j2,Sd)=>{var sx=Number.prototype.toString,ox=function(e){try{return sx.call(e),!0}catch{return !1}},ax=Object.prototype.toString,lx="[object Number]",ux=Ot()();Sd.exports=function(e){return typeof e=="number"?!0:typeof e!="object"?!1:ux?ox(e):ax.call(e)===lx};});var Cd=T((W2,xd)=>{var Ad=Qe(),cx=Ad("Boolean.prototype.toString"),fx=Ad("Object.prototype.toString"),hx=function(e){try{return cx(e),!0}catch{return !1}},dx="[object Boolean]",px=Ot()();xd.exports=function(e){return typeof e=="boolean"?!0:e===null||typeof e!="object"?!1:px&&Symbol.toStringTag in e?hx(e):fx(e)===dx};});var Pd=T((z2,Xo)=>{var mx=Object.prototype.toString,_x=so()();_x?(Rd=Symbol.prototype.toString,Td=/^Symbol\(.*\)$/,Id=function(e){return typeof e.valueOf()!="symbol"?!1:Td.test(Rd.call(e))},Xo.exports=function(e){if(typeof e=="symbol")return !0;if(mx.call(e)!=="[object Symbol]")return !1;try{return Id(e)}catch{return !1}}):Xo.exports=function(e){return !1};var Rd,Td,Id;});var Fd=T((G2,Md)=>{var Od=typeof BigInt<"u"&&BigInt;Md.exports=function(){return typeof Od=="function"&&typeof BigInt=="function"&&typeof Od(42)=="bigint"&&typeof BigInt(42)=="bigint"};});var $d=T((V2,Qo)=>{var gx=Fd()();gx?(Nd=BigInt.prototype.valueOf,kd=function(e){try{return Nd.call(e),!0}catch{}return !1},Qo.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:kd(e)}):Qo.exports=function(e){return !1};var Nd,kd;});var Dd=T((K2,Ld)=>{var yx=vd(),wx=Ed(),bx=Cd(),vx=Pd(),Sx=$d();Ld.exports=function(e){if(e==null||typeof e!="object"&&typeof e!="function")return null;if(yx(e))return "String";if(wx(e))return "Number";if(bx(e))return "Boolean";if(vx(e))return "Symbol";if(Sx(e))return "BigInt"};});var Hd=T((Z2,Ud)=>{var ea=typeof Map=="function"&&Map.prototype?Map:null,Ex=typeof Set=="function"&&Set.prototype?Set:null,mi;ea||(mi=function(e){return !1});var Bd=ea?Map.prototype.has:null,qd=Ex?Set.prototype.has:null;!mi&&!Bd&&(mi=function(e){return !1});Ud.exports=mi||function(e){if(!e||typeof e!="object")return !1;try{if(Bd.call(e),qd)try{qd.call(e);}catch{return !0}return e instanceof ea}catch{}return !1};});var Gd=T((Y2,zd)=>{var Ax=typeof Map=="function"&&Map.prototype?Map:null,ta=typeof Set=="function"&&Set.prototype?Set:null,_i;ta||(_i=function(e){return !1});var jd=Ax?Map.prototype.has:null,Wd=ta?Set.prototype.has:null;!_i&&!Wd&&(_i=function(e){return !1});zd.exports=_i||function(e){if(!e||typeof e!="object")return !1;try{if(Wd.call(e),jd)try{jd.call(e);}catch{return !0}return e instanceof ta}catch{}return !1};});var Zd=T((J2,Kd)=>{var gi=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,Vd=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,yi;gi||(yi=function(e){return !1});var na=gi?gi.prototype.has:null,ra=Vd?Vd.prototype.has:null;!yi&&!na&&(yi=function(e){return !1});Kd.exports=yi||function(e){if(!e||typeof e!="object")return !1;try{if(na.call(e,na),ra)try{ra.call(e,ra);}catch{return !0}return e instanceof gi}catch{}return !1};});var Jd=T((X2,sa)=>{var xx=ct(),Yd=Qe(),Cx=xx("%WeakSet%",!0),ia=Yd("WeakSet.prototype.has",!0);ia?(wi=Yd("WeakMap.prototype.has",!0),sa.exports=function(e){if(!e||typeof e!="object")return !1;try{if(ia(e,ia),wi)try{wi(e,wi);}catch{return !0}return e instanceof Cx}catch{}return !1}):sa.exports=function(e){return !1};var wi;});var Qd=T((Q2,Xd)=>{var Rx=Hd(),Tx=Gd(),Ix=Zd(),Px=Jd();Xd.exports=function(e){if(e&&typeof e=="object"){if(Rx(e))return "Map";if(Tx(e))return "Set";if(Ix(e))return "WeakMap";if(Px(e))return "WeakSet"}return !1};});var rp=T((e$,tp)=>{var Ox=Qe(),ep=Ox("ArrayBuffer.prototype.byteLength",!0),Mx=Ko();tp.exports=function(e){return Mx(e)?ep?ep(e):e.byteLength:NaN};});var xi=T((t$,Cp)=>{var Ep=Bf(),ht=Qe(),np=eh(),Fx=ct(),vr=nh(),Nx=Rh(),ip=$h(),sp=Bh(),op=Hh(),ap=Ko(),lp=fd(),up=_d(),cp=wd(),fp=Kn(),hp=Dd(),dp=Qd(),pp=Vo(),mp=rp(),_p=ht("SharedArrayBuffer.prototype.byteLength",!0),gp=ht("Date.prototype.getTime"),oa=Object.getPrototypeOf,yp=ht("Object.prototype.toString"),vi=Fx("%Set%",!0),aa=ht("Map.prototype.has",!0),Si=ht("Map.prototype.get",!0),wp=ht("Map.prototype.size",!0),Ei=ht("Set.prototype.add",!0),Ap=ht("Set.prototype.delete",!0),Ai=ht("Set.prototype.has",!0),bi=ht("Set.prototype.size",!0);function bp(t,e,r,n){for(var s=vr(t),i;(i=s.next())&&!i.done;)if(it(e,i.value,r,n))return Ap(t,i.value),!0;return !1}function xp(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 kx(t,e,r,n,s,i){var o=xp(r);if(o!=null)return o;var a=Si(e,o),c=Ep({},s,{strict:!1});return typeof a>"u"&&!aa(e,o)||!it(n,a,c,i)?!1:!aa(t,o)&&it(n,a,c,i)}function $x(t,e,r){var n=xp(r);return n??(Ai(e,n)&&!Ai(t,n))}function vp(t,e,r,n,s,i){for(var o=vr(t),a,c;(a=o.next())&&!a.done;)if(c=a.value,it(r,c,s,i)&&it(n,Si(e,c),s,i))return Ap(t,c),!0;return !1}function it(t,e,r,n){var s=r||{};if(s.strict?ip(t,e):t===e)return !0;var i=hp(t),o=hp(e);if(i!==o)return !1;if(!t||!e||typeof t!="object"&&typeof e!="object")return s.strict?ip(t,e):t==e;var a=n.has(t),c=n.has(e),d;if(a&&c){if(n.get(t)===n.get(e))return !0}else d={};return a||n.set(t,d),c||n.set(e,d),qx(t,e,s,n)}function Sp(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 Lx(t,e,r,n){if(bi(t)!==bi(e))return !1;for(var s=vr(t),i=vr(e),o,a,c;(o=s.next())&&!o.done;)if(o.value&&typeof o.value=="object")c||(c=new vi),Ei(c,o.value);else if(!Ai(e,o.value)){if(r.strict||!$x(t,e,o.value))return !1;c||(c=new vi),Ei(c,o.value);}if(c){for(;(a=i.next())&&!a.done;)if(a.value&&typeof a.value=="object"){if(!bp(c,a.value,r.strict,n))return !1}else if(!r.strict&&!Ai(t,a.value)&&!bp(c,a.value,r.strict,n))return !1;return bi(c)===0}return !0}function Dx(t,e,r,n){if(wp(t)!==wp(e))return !1;for(var s=vr(t),i=vr(e),o,a,c,d,u,p;(o=s.next())&&!o.done;)if(d=o.value[0],u=o.value[1],d&&typeof d=="object")c||(c=new vi),Ei(c,d);else if(p=Si(e,d),typeof p>"u"&&!aa(e,d)||!it(u,p,r,n)){if(r.strict||!kx(t,e,d,u,r,n))return !1;c||(c=new vi),Ei(c,d);}if(c){for(;(a=i.next())&&!a.done;)if(d=a.value[0],p=a.value[1],d&&typeof d=="object"){if(!vp(c,t,d,p,r,n))return !1}else if(!r.strict&&(!t.has(d)||!it(Si(t,d),p,r,n))&&!vp(c,t,d,p,Ep({},r,{strict:!1}),n))return !1;return bi(c)===0}return !0}function qx(t,e,r,n){var s,i;if(typeof t!=typeof e||t==null||e==null||yp(t)!==yp(e)||sp(t)!==sp(e))return !1;var o=op(t),a=op(e);if(o!==a)return !1;var c=t instanceof Error,d=e instanceof Error;if(c!==d||(c||d)&&(t.name!==e.name||t.message!==e.message))return !1;var u=up(t),p=up(e);if(u!==p||(u||p)&&(t.source!==e.source||np(t)!==np(e)))return !1;var _=lp(t),m=lp(e);if(_!==m||(_||m)&&gp(t)!==gp(e)||r.strict&&oa&&oa(t)!==oa(e))return !1;var y=pp(t),v=pp(e);if(y!==v)return !1;if(y||v){if(t.length!==e.length)return !1;for(s=0;s<t.length;s++)if(t[s]!==e[s])return !1;return !0}var E=Sp(t),A=Sp(e);if(E!==A)return !1;if(E||A){if(t.length!==e.length)return !1;for(s=0;s<t.length;s++)if(t[s]!==e[s])return !1;return !0}var w=ap(t),x=ap(e);if(w!==x)return !1;if(w||x)return mp(t)!==mp(e)?!1:typeof Uint8Array=="function"&&it(new Uint8Array(t),new Uint8Array(e),r,n);var M=cp(t),k=cp(e);if(M!==k)return !1;if(M||k)return _p(t)!==_p(e)?!1:typeof Uint8Array=="function"&&it(new Uint8Array(t),new Uint8Array(e),r,n);if(typeof t!=typeof e)return !1;var j=fp(t),U=fp(e);if(j.length!==U.length)return !1;for(j.sort(),U.sort(),s=j.length-1;s>=0;s--)if(j[s]!=U[s])return !1;for(s=j.length-1;s>=0;s--)if(i=j[s],!it(t[i],e[i],r,n))return !1;var $=dp(t),F=dp(e);return $!==F?!1:$==="Set"||F==="Set"?Lx(t,e,r,n):$==="Map"?Dx(t,e,r,n):!0}Cp.exports=function(e,r,n){return it(e,r,n,Nx())};});var $p={};Xs($p,{closest:()=>uC,distance:()=>kp});var yt,aC,lC,kp,uC,Lp=jn(()=>{yt=new Uint32Array(65536),aC=(t,e)=>{let r=t.length,n=e.length,s=1<<r-1,i=-1,o=0,a=r,c=r;for(;c--;)yt[t.charCodeAt(c)]|=1<<c;for(c=0;c<n;c++){let d=yt[e.charCodeAt(c)],u=d|o;d|=(d&i)+i^i,o|=~(d|i),i&=d,o&s&&a++,i&s&&a--,o=o<<1|1,i=i<<1|~(u|o),o&=u;}for(c=r;c--;)yt[t.charCodeAt(c)]=0;return a},lC=(t,e)=>{let r=e.length,n=t.length,s=[],i=[],o=Math.ceil(r/32),a=Math.ceil(n/32);for(let y=0;y<o;y++)i[y]=-1,s[y]=0;let c=0;for(;c<a-1;c++){let y=0,v=-1,E=c*32,A=Math.min(32,n)+E;for(let w=E;w<A;w++)yt[t.charCodeAt(w)]|=1<<w;for(let w=0;w<r;w++){let x=yt[e.charCodeAt(w)],M=i[w/32|0]>>>w&1,k=s[w/32|0]>>>w&1,j=x|y,U=((x|k)&v)+v^v|x|k,$=y|~(U|v),F=v&U;$>>>31^M&&(i[w/32|0]^=1<<w),F>>>31^k&&(s[w/32|0]^=1<<w),$=$<<1|M,F=F<<1|k,v=F|~(j|$),y=$&j;}for(let w=E;w<A;w++)yt[t.charCodeAt(w)]=0;}let d=0,u=-1,p=c*32,_=Math.min(32,n-p)+p;for(let y=p;y<_;y++)yt[t.charCodeAt(y)]|=1<<y;let m=n;for(let y=0;y<r;y++){let v=yt[e.charCodeAt(y)],E=i[y/32|0]>>>y&1,A=s[y/32|0]>>>y&1,w=v|d,x=((v|A)&u)+u^u|v|A,M=d|~(x|u),k=u&x;m+=M>>>n-1&1,m-=k>>>n-1&1,M>>>31^E&&(i[y/32|0]^=1<<y),k>>>31^A&&(s[y/32|0]^=1<<y),M=M<<1|E,k=k<<1|A,u=k|~(w|M),d=M&w;}for(let y=p;y<_;y++)yt[t.charCodeAt(y)]=0;return m},kp=(t,e)=>{if(t.length<e.length){let r=e;e=t,t=r;}return e.length===0?t.length:t.length<=32?aC(t,e):lC(t,e)},uC=(t,e)=>{let r=1/0,n=0;for(let s=0;s<e.length;s++){let i=kp(t,e[s]);i<r&&(r=i,n=s);}return e[n]};});var Dp=T((ha,on)=>{(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=(Lp(),Qs($p)),r=[],n=[],s={get:function(i,o,a){var c=a&&t&&a.useCollator;if(c){var d=i.length,u=o.length;if(d===0)return u;if(u===0)return d;var p,_,m,y,v;for(m=0;m<u;++m)r[m]=m,n[m]=o.charCodeAt(m);r[u]=u;var E;for(m=0;m<d;++m){for(_=m+1,y=0;y<u;++y)p=_,E=t.compare(i.charAt(m),String.fromCharCode(n[y]))===0,_=r[y]+(E?0:1),v=p+1,_>v&&(_=v),v=r[y+1]+1,_>v&&(_=v),r[y]=p;r[y]=_;}return _}return e.distance(i,o)}};typeof define<"u"&&define!==null&&define.amd?define(function(){return s}):typeof on<"u"&&on!==null&&typeof ha<"u"&&on.exports===ha?on.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 Ft=jn(()=>{});var qe=T(ma=>{ma.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})};ma.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 zp=T((c$,Wp)=>{var Nt=G("constants"),hC=process.cwd,Mi=null,dC=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return Mi||(Mi=hC.call(process)),Mi};try{process.cwd();}catch{}typeof process.chdir=="function"&&(_a=process.chdir,process.chdir=function(t){Mi=null,_a.call(process,t);},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,_a));var _a;Wp.exports=pC;function pC(t){Nt.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=a(t.stat),t.fstat=a(t.fstat),t.lstat=a(t.lstat),t.statSync=c(t.statSync),t.fstatSync=c(t.fstatSync),t.lstatSync=c(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(u,p,_){_&&process.nextTick(_);},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(u,p,_,m){m&&process.nextTick(m);},t.lchownSync=function(){}),dC==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:function(u){function p(_,m,y){var v=Date.now(),E=0;u(_,m,function A(w){if(w&&(w.code==="EACCES"||w.code==="EPERM"||w.code==="EBUSY")&&Date.now()-v<6e4){setTimeout(function(){t.stat(m,function(x,M){x&&x.code==="ENOENT"?u(_,m,A):y(w);});},E),E<100&&(E+=10);return}y&&y(w);});}return Object.setPrototypeOf&&Object.setPrototypeOf(p,u),p}(t.rename)),t.read=typeof t.read!="function"?t.read:function(u){function p(_,m,y,v,E,A){var w;if(A&&typeof A=="function"){var x=0;w=function(M,k,j){if(M&&M.code==="EAGAIN"&&x<10)return x++,u.call(t,_,m,y,v,E,w);A.apply(this,arguments);};}return u.call(t,_,m,y,v,E,w)}return Object.setPrototypeOf&&Object.setPrototypeOf(p,u),p}(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:function(u){return function(p,_,m,y,v){for(var E=0;;)try{return u.call(t,p,_,m,y,v)}catch(A){if(A.code==="EAGAIN"&&E<10){E++;continue}throw A}}}(t.readSync);function e(u){u.lchmod=function(p,_,m){u.open(p,Nt.O_WRONLY|Nt.O_SYMLINK,_,function(y,v){if(y){m&&m(y);return}u.fchmod(v,_,function(E){u.close(v,function(A){m&&m(E||A);});});});},u.lchmodSync=function(p,_){var m=u.openSync(p,Nt.O_WRONLY|Nt.O_SYMLINK,_),y=!0,v;try{v=u.fchmodSync(m,_),y=!1;}finally{if(y)try{u.closeSync(m);}catch{}else u.closeSync(m);}return v};}function r(u){Nt.hasOwnProperty("O_SYMLINK")&&u.futimes?(u.lutimes=function(p,_,m,y){u.open(p,Nt.O_SYMLINK,function(v,E){if(v){y&&y(v);return}u.futimes(E,_,m,function(A){u.close(E,function(w){y&&y(A||w);});});});},u.lutimesSync=function(p,_,m){var y=u.openSync(p,Nt.O_SYMLINK),v,E=!0;try{v=u.futimesSync(y,_,m),E=!1;}finally{if(E)try{u.closeSync(y);}catch{}else u.closeSync(y);}return v}):u.futimes&&(u.lutimes=function(p,_,m,y){y&&process.nextTick(y);},u.lutimesSync=function(){});}function n(u){return u&&function(p,_,m){return u.call(t,p,_,function(y){d(y)&&(y=null),m&&m.apply(this,arguments);})}}function s(u){return u&&function(p,_){try{return u.call(t,p,_)}catch(m){if(!d(m))throw m}}}function i(u){return u&&function(p,_,m,y){return u.call(t,p,_,m,function(v){d(v)&&(v=null),y&&y.apply(this,arguments);})}}function o(u){return u&&function(p,_,m){try{return u.call(t,p,_,m)}catch(y){if(!d(y))throw y}}}function a(u){return u&&function(p,_,m){typeof _=="function"&&(m=_,_=null);function y(v,E){E&&(E.uid<0&&(E.uid+=4294967296),E.gid<0&&(E.gid+=4294967296)),m&&m.apply(this,arguments);}return _?u.call(t,p,_,y):u.call(t,p,y)}}function c(u){return u&&function(p,_){var m=_?u.call(t,p,_):u.call(t,p);return m&&(m.uid<0&&(m.uid+=4294967296),m.gid<0&&(m.gid+=4294967296)),m}}function d(u){if(!u||u.code==="ENOSYS")return !0;var p=!process.getuid||process.getuid()!==0;return !!(p&&(u.code==="EINVAL"||u.code==="EPERM"))}}});var Kp=T((f$,Vp)=>{var Gp=G("stream").Stream;Vp.exports=mC;function mC(t){return {ReadStream:e,WriteStream:r};function e(n,s){if(!(this instanceof e))return new e(n,s);Gp.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),a=0,c=o.length;a<c;a++){var d=o[a];this[d]=s[d];}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(u,p){if(u){i.emit("error",u),i.readable=!1;return}i.fd=p,i.emit("open",p),i._read();});}function r(n,s){if(!(this instanceof r))return new r(n,s);Gp.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,a=i.length;o<a;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 Yp=T((h$,Zp)=>{Zp.exports=gC;var _C=Object.getPrototypeOf||function(t){return t.__proto__};function gC(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:_C(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));}),e}});var Be=T((d$,wa)=>{var me=G("fs"),yC=zp(),wC=Kp(),bC=Yp(),Fi=G("util"),Me,ki;typeof Symbol=="function"&&typeof Symbol.for=="function"?(Me=Symbol.for("graceful-fs.queue"),ki=Symbol.for("graceful-fs.previous")):(Me="___graceful-fs.queue",ki="___graceful-fs.previous");function vC(){}function Qp(t,e){Object.defineProperty(t,Me,{get:function(){return e}});}var Jt=vC;Fi.debuglog?Jt=Fi.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Jt=function(){var t=Fi.format.apply(Fi,arguments);t="GFS4: "+t.split(/\n/).join(`
|
||
GFS4: `),console.error(t);});me[Me]||(Jp=global[Me]||[],Qp(me,Jp),me.close=function(t){function e(r,n){return t.call(me,r,function(s){s||Xp(),typeof n=="function"&&n.apply(this,arguments);})}return Object.defineProperty(e,ki,{value:t}),e}(me.close),me.closeSync=function(t){function e(r){t.apply(me,arguments),Xp();}return Object.defineProperty(e,ki,{value:t}),e}(me.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Jt(me[Me]),G("assert").equal(me[Me].length,0);}));var Jp;global[Me]||Qp(global,me[Me]);wa.exports=ga(bC(me));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!me.__patched&&(wa.exports=ga(me),me.__patched=!0);function ga(t){yC(t),t.gracefulify=ga,t.createReadStream=k,t.createWriteStream=j;var e=t.readFile;t.readFile=r;function r(F,B,R){return typeof B=="function"&&(R=B,B=null),z(F,B,R);function z(V,te,I,O){return e(V,te,function(X){X&&(X.code==="EMFILE"||X.code==="ENFILE")?Ar([z,[V,te,I],X,O||Date.now(),Date.now()]):typeof I=="function"&&I.apply(this,arguments);})}}var n=t.writeFile;t.writeFile=s;function s(F,B,R,z){return typeof R=="function"&&(z=R,R=null),V(F,B,R,z);function V(te,I,O,X,Q){return n(te,I,O,function(ie){ie&&(ie.code==="EMFILE"||ie.code==="ENFILE")?Ar([V,[te,I,O,X],ie,Q||Date.now(),Date.now()]):typeof X=="function"&&X.apply(this,arguments);})}}var i=t.appendFile;i&&(t.appendFile=o);function o(F,B,R,z){return typeof R=="function"&&(z=R,R=null),V(F,B,R,z);function V(te,I,O,X,Q){return i(te,I,O,function(ie){ie&&(ie.code==="EMFILE"||ie.code==="ENFILE")?Ar([V,[te,I,O,X],ie,Q||Date.now(),Date.now()]):typeof X=="function"&&X.apply(this,arguments);})}}var a=t.copyFile;a&&(t.copyFile=c);function c(F,B,R,z){return typeof R=="function"&&(z=R,R=0),V(F,B,R,z);function V(te,I,O,X,Q){return a(te,I,O,function(ie){ie&&(ie.code==="EMFILE"||ie.code==="ENFILE")?Ar([V,[te,I,O,X],ie,Q||Date.now(),Date.now()]):typeof X=="function"&&X.apply(this,arguments);})}}var d=t.readdir;t.readdir=p;var u=/^v[0-5]\./;function p(F,B,R){typeof B=="function"&&(R=B,B=null);var z=u.test(process.version)?function(I,O,X,Q){return d(I,V(I,O,X,Q))}:function(I,O,X,Q){return d(I,O,V(I,O,X,Q))};return z(F,B,R);function V(te,I,O,X){return function(Q,ie){Q&&(Q.code==="EMFILE"||Q.code==="ENFILE")?Ar([z,[te,I,O],Q,X||Date.now(),Date.now()]):(ie&&ie.sort&&ie.sort(),typeof O=="function"&&O.call(this,Q,ie));}}}if(process.version.substr(0,4)==="v0.8"){var _=wC(t);A=_.ReadStream,x=_.WriteStream;}var m=t.ReadStream;m&&(A.prototype=Object.create(m.prototype),A.prototype.open=w);var y=t.WriteStream;y&&(x.prototype=Object.create(y.prototype),x.prototype.open=M),Object.defineProperty(t,"ReadStream",{get:function(){return A},set:function(F){A=F;},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return x},set:function(F){x=F;},enumerable:!0,configurable:!0});var v=A;Object.defineProperty(t,"FileReadStream",{get:function(){return v},set:function(F){v=F;},enumerable:!0,configurable:!0});var E=x;Object.defineProperty(t,"FileWriteStream",{get:function(){return E},set:function(F){E=F;},enumerable:!0,configurable:!0});function A(F,B){return this instanceof A?(m.apply(this,arguments),this):A.apply(Object.create(A.prototype),arguments)}function w(){var F=this;$(F.path,F.flags,F.mode,function(B,R){B?(F.autoClose&&F.destroy(),F.emit("error",B)):(F.fd=R,F.emit("open",R),F.read());});}function x(F,B){return this instanceof x?(y.apply(this,arguments),this):x.apply(Object.create(x.prototype),arguments)}function M(){var F=this;$(F.path,F.flags,F.mode,function(B,R){B?(F.destroy(),F.emit("error",B)):(F.fd=R,F.emit("open",R));});}function k(F,B){return new t.ReadStream(F,B)}function j(F,B){return new t.WriteStream(F,B)}var U=t.open;t.open=$;function $(F,B,R,z){return typeof R=="function"&&(z=R,R=null),V(F,B,R,z);function V(te,I,O,X,Q){return U(te,I,O,function(ie,Ne){ie&&(ie.code==="EMFILE"||ie.code==="ENFILE")?Ar([V,[te,I,O,X],ie,Q||Date.now(),Date.now()]):typeof X=="function"&&X.apply(this,arguments);})}}return t}function Ar(t){Jt("ENQUEUE",t[0].name,t[1]),me[Me].push(t),ya();}var Ni;function Xp(){for(var t=Date.now(),e=0;e<me[Me].length;++e)me[Me][e].length>2&&(me[Me][e][3]=t,me[Me][e][4]=t);ya();}function ya(){if(clearTimeout(Ni),Ni=void 0,me[Me].length!==0){var t=me[Me].shift(),e=t[0],r=t[1],n=t[2],s=t[3],i=t[4];if(s===void 0)Jt("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-s>=6e4){Jt("TIMEOUT",e.name,r);var o=r.pop();typeof o=="function"&&o.call(null,n);}else {var a=Date.now()-i,c=Math.max(i-s,1),d=Math.min(c*1.2,100);a>=d?(Jt("RETRY",e.name,r),e.apply(null,r.concat([s]))):me[Me].push(t);}Ni===void 0&&(Ni=setTimeout(ya,0));}}});var Xt=T(wt=>{var em=qe().fromCallback,ke=Be(),SC=["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 ke[t]=="function");Object.assign(wt,ke);SC.forEach(t=>{wt[t]=em(ke[t]);});wt.exists=function(t,e){return typeof e=="function"?ke.exists(t,e):new Promise(r=>ke.exists(t,r))};wt.read=function(t,e,r,n,s,i){return typeof i=="function"?ke.read(t,e,r,n,s,i):new Promise((o,a)=>{ke.read(t,e,r,n,s,(c,d,u)=>{if(c)return a(c);o({bytesRead:d,buffer:u});});})};wt.write=function(t,e,...r){return typeof r[r.length-1]=="function"?ke.write(t,e,...r):new Promise((n,s)=>{ke.write(t,e,...r,(i,o,a)=>{if(i)return s(i);n({bytesWritten:o,buffer:a});});})};wt.readv=function(t,e,...r){return typeof r[r.length-1]=="function"?ke.readv(t,e,...r):new Promise((n,s)=>{ke.readv(t,e,...r,(i,o,a)=>{if(i)return s(i);n({bytesRead:o,buffers:a});});})};wt.writev=function(t,e,...r){return typeof r[r.length-1]=="function"?ke.writev(t,e,...r):new Promise((n,s)=>{ke.writev(t,e,...r,(i,o,a)=>{if(i)return s(i);n({bytesWritten:o,buffers:a});});})};typeof ke.realpath.native=="function"?wt.realpath.native=em(ke.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003");});var rm=T((m$,tm)=>{var EC=G("path");tm.exports.checkPath=function(e){if(process.platform==="win32"&&/[<>:"|?*]/.test(e.replace(EC.parse(e).root,""))){let n=new Error(`Path contains invalid characters: ${e}`);throw n.code="EINVAL",n}};});var om=T((_$,ba)=>{var nm=Xt(),{checkPath:im}=rm(),sm=t=>{let e={mode:511};return typeof t=="number"?t:{...e,...t}.mode};ba.exports.makeDir=async(t,e)=>(im(t),nm.mkdir(t,{mode:sm(e),recursive:!0}));ba.exports.makeDirSync=(t,e)=>(im(t),nm.mkdirSync(t,{mode:sm(e),recursive:!0}));});var st=T((g$,am)=>{var AC=qe().fromPromise,{makeDir:xC,makeDirSync:va}=om(),Sa=AC(xC);am.exports={mkdirs:Sa,mkdirsSync:va,mkdirp:Sa,mkdirpSync:va,ensureDir:Sa,ensureDirSync:va};});var kt=T((y$,um)=>{var CC=qe().fromPromise,lm=Xt();function RC(t){return lm.access(t).then(()=>!0).catch(()=>!1)}um.exports={pathExists:CC(RC),pathExistsSync:lm.existsSync};});var Ea=T((w$,cm)=>{var xr=Be();function TC(t,e,r,n){xr.open(t,"r+",(s,i)=>{if(s)return n(s);xr.futimes(i,e,r,o=>{xr.close(i,a=>{n&&n(o||a);});});});}function IC(t,e,r){let n=xr.openSync(t,"r+");return xr.futimesSync(n,e,r),xr.closeSync(n)}cm.exports={utimesMillis:TC,utimesMillisSync:IC};});var Qt=T((b$,dm)=>{var Cr=Xt(),Ee=G("path"),PC=G("util");function OC(t,e,r){let n=r.dereference?s=>Cr.stat(s,{bigint:!0}):s=>Cr.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 MC(t,e,r){let n,s=r.dereference?o=>Cr.statSync(o,{bigint:!0}):o=>Cr.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 FC(t,e,r,n,s){PC.callbackify(OC)(t,e,n,(i,o)=>{if(i)return s(i);let{srcStat:a,destStat:c}=o;if(c){if(un(a,c)){let d=Ee.basename(t),u=Ee.basename(e);return r==="move"&&d!==u&&d.toLowerCase()===u.toLowerCase()?s(null,{srcStat:a,destStat:c,isChangingCase:!0}):s(new Error("Source and destination must not be the same."))}if(a.isDirectory()&&!c.isDirectory())return s(new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`));if(!a.isDirectory()&&c.isDirectory())return s(new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`))}return a.isDirectory()&&Aa(t,e)?s(new Error($i(t,e,r))):s(null,{srcStat:a,destStat:c})});}function NC(t,e,r,n){let{srcStat:s,destStat:i}=MC(t,e,n);if(i){if(un(s,i)){let o=Ee.basename(t),a=Ee.basename(e);if(r==="move"&&o!==a&&o.toLowerCase()===a.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()&&Aa(t,e))throw new Error($i(t,e,r));return {srcStat:s,destStat:i}}function fm(t,e,r,n,s){let i=Ee.resolve(Ee.dirname(t)),o=Ee.resolve(Ee.dirname(r));if(o===i||o===Ee.parse(o).root)return s();Cr.stat(o,{bigint:!0},(a,c)=>a?a.code==="ENOENT"?s():s(a):un(e,c)?s(new Error($i(t,r,n))):fm(t,e,o,n,s));}function hm(t,e,r,n){let s=Ee.resolve(Ee.dirname(t)),i=Ee.resolve(Ee.dirname(r));if(i===s||i===Ee.parse(i).root)return;let o;try{o=Cr.statSync(i,{bigint:!0});}catch(a){if(a.code==="ENOENT")return;throw a}if(un(e,o))throw new Error($i(t,r,n));return hm(t,e,i,n)}function un(t,e){return e.ino&&e.dev&&e.ino===t.ino&&e.dev===t.dev}function Aa(t,e){let r=Ee.resolve(t).split(Ee.sep).filter(s=>s),n=Ee.resolve(e).split(Ee.sep).filter(s=>s);return r.reduce((s,i,o)=>s&&n[o]===i,!0)}function $i(t,e,r){return `Cannot ${r} '${t}' to a subdirectory of itself, '${e}'.`}dm.exports={checkPaths:FC,checkPathsSync:NC,checkParentPaths:fm,checkParentPathsSync:hm,isSrcSubdir:Aa,areIdentical:un};});var wm=T((v$,ym)=>{var Ue=Be(),cn=G("path"),kC=st().mkdirs,$C=kt().pathExists,LC=Ea().utimesMillis,fn=Qt();function DC(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"),fn.checkPaths(t,e,"copy",r,(s,i)=>{if(s)return n(s);let{srcStat:o,destStat:a}=i;fn.checkParentPaths(t,o,e,"copy",c=>{if(c)return n(c);mm(t,e,r,(d,u)=>{if(d)return n(d);if(!u)return n();qC(a,t,e,r,n);});});});}function qC(t,e,r,n,s){let i=cn.dirname(r);$C(i,(o,a)=>{if(o)return s(o);if(a)return xa(t,e,r,n,s);kC(i,c=>c?s(c):xa(t,e,r,n,s));});}function mm(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 xa(t,e,r,n,s){(n.dereference?Ue.stat:Ue.lstat)(e,(o,a)=>o?s(o):a.isDirectory()?GC(a,t,e,r,n,s):a.isFile()||a.isCharacterDevice()||a.isBlockDevice()?BC(a,t,e,r,n,s):a.isSymbolicLink()?ZC(t,e,r,n,s):a.isSocket()?s(new Error(`Cannot copy a socket file: ${e}`)):a.isFIFO()?s(new Error(`Cannot copy a FIFO pipe: ${e}`)):s(new Error(`Unknown file: ${e}`)));}function BC(t,e,r,n,s,i){return e?UC(t,r,n,s,i):_m(t,r,n,s,i)}function UC(t,e,r,n,s){if(n.overwrite)Ue.unlink(r,i=>i?s(i):_m(t,e,r,n,s));else return n.errorOnExist?s(new Error(`'${r}' already exists`)):s()}function _m(t,e,r,n,s){Ue.copyFile(e,r,i=>i?s(i):n.preserveTimestamps?HC(t.mode,e,r,s):Li(r,t.mode,s));}function HC(t,e,r,n){return jC(t)?WC(r,t,s=>s?n(s):pm(t,e,r,n)):pm(t,e,r,n)}function jC(t){return (t&128)===0}function WC(t,e,r){return Li(t,e|128,r)}function pm(t,e,r,n){zC(e,r,s=>s?n(s):Li(r,t,n));}function Li(t,e,r){return Ue.chmod(t,e,r)}function zC(t,e,r){Ue.stat(t,(n,s)=>n?r(n):LC(e,s.atime,s.mtime,r));}function GC(t,e,r,n,s,i){return e?gm(r,n,s,i):VC(t.mode,r,n,s,i)}function VC(t,e,r,n,s){Ue.mkdir(r,i=>{if(i)return s(i);gm(e,r,n,o=>o?s(o):Li(r,t,s));});}function gm(t,e,r,n){Ue.readdir(t,(s,i)=>s?n(s):Ca(i,t,e,r,n));}function Ca(t,e,r,n,s){let i=t.pop();return i?KC(t,i,e,r,n,s):s()}function KC(t,e,r,n,s,i){let o=cn.join(r,e),a=cn.join(n,e);mm(o,a,s,(c,d)=>{if(c)return i(c);if(!d)return Ca(t,r,n,s,i);fn.checkPaths(o,a,"copy",s,(u,p)=>{if(u)return i(u);let{destStat:_}=p;xa(_,o,a,s,m=>m?i(m):Ca(t,r,n,s,i));});});}function ZC(t,e,r,n,s){Ue.readlink(e,(i,o)=>{if(i)return s(i);if(n.dereference&&(o=cn.resolve(process.cwd(),o)),t)Ue.readlink(r,(a,c)=>a?a.code==="EINVAL"||a.code==="UNKNOWN"?Ue.symlink(o,r,s):s(a):(n.dereference&&(c=cn.resolve(process.cwd(),c)),fn.isSrcSubdir(o,c)?s(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${c}'.`)):fn.isSrcSubdir(c,o)?s(new Error(`Cannot overwrite '${c}' with '${o}'.`)):YC(o,r,s)));else return Ue.symlink(o,r,s)});}function YC(t,e,r){Ue.unlink(e,n=>n?r(n):Ue.symlink(t,e,r));}ym.exports=DC;});var Am=T((S$,Em)=>{var $e=Be(),hn=G("path"),JC=st().mkdirsSync,XC=Ea().utimesMillisSync,dn=Qt();function QC(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}=dn.checkPathsSync(t,e,"copy",r);if(dn.checkParentPathsSync(t,n,e,"copy"),r.filter&&!r.filter(t,e))return;let i=hn.dirname(e);return $e.existsSync(i)||JC(i),bm(s,t,e,r)}function bm(t,e,r,n){let i=(n.dereference?$e.statSync:$e.lstatSync)(e);if(i.isDirectory())return oR(i,t,e,r,n);if(i.isFile()||i.isCharacterDevice()||i.isBlockDevice())return eR(i,t,e,r,n);if(i.isSymbolicLink())return uR(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 eR(t,e,r,n,s){return e?tR(t,r,n,s):vm(t,r,n,s)}function tR(t,e,r,n){if(n.overwrite)return $e.unlinkSync(r),vm(t,e,r,n);if(n.errorOnExist)throw new Error(`'${r}' already exists`)}function vm(t,e,r,n){return $e.copyFileSync(e,r),n.preserveTimestamps&&rR(t.mode,e,r),Ra(r,t.mode)}function rR(t,e,r){return nR(t)&&iR(r,t),sR(e,r)}function nR(t){return (t&128)===0}function iR(t,e){return Ra(t,e|128)}function Ra(t,e){return $e.chmodSync(t,e)}function sR(t,e){let r=$e.statSync(t);return XC(e,r.atime,r.mtime)}function oR(t,e,r,n,s){return e?Sm(r,n,s):aR(t.mode,r,n,s)}function aR(t,e,r,n){return $e.mkdirSync(r),Sm(e,r,n),Ra(r,t)}function Sm(t,e,r){$e.readdirSync(t).forEach(n=>lR(n,t,e,r));}function lR(t,e,r,n){let s=hn.join(e,t),i=hn.join(r,t);if(n.filter&&!n.filter(s,i))return;let{destStat:o}=dn.checkPathsSync(s,i,"copy",n);return bm(o,s,i,n)}function uR(t,e,r,n){let s=$e.readlinkSync(e);if(n.dereference&&(s=hn.resolve(process.cwd(),s)),t){let i;try{i=$e.readlinkSync(r);}catch(o){if(o.code==="EINVAL"||o.code==="UNKNOWN")return $e.symlinkSync(s,r);throw o}if(n.dereference&&(i=hn.resolve(process.cwd(),i)),dn.isSrcSubdir(s,i))throw new Error(`Cannot copy '${s}' to a subdirectory of itself, '${i}'.`);if(dn.isSrcSubdir(i,s))throw new Error(`Cannot overwrite '${i}' with '${s}'.`);return cR(s,r)}else return $e.symlinkSync(s,r)}function cR(t,e){return $e.unlinkSync(e),$e.symlinkSync(t,e)}Em.exports=QC;});var Di=T((E$,xm)=>{var fR=qe().fromCallback;xm.exports={copy:fR(wm()),copySync:Am()};});var pn=T((A$,Rm)=>{var Cm=Be(),hR=qe().fromCallback;function dR(t,e){Cm.rm(t,{recursive:!0,force:!0},e);}function pR(t){Cm.rmSync(t,{recursive:!0,force:!0});}Rm.exports={remove:hR(dR),removeSync:pR};});var km=T((x$,Nm)=>{var mR=qe().fromPromise,Pm=Xt(),Om=G("path"),Mm=st(),Fm=pn(),Tm=mR(async function(e){let r;try{r=await Pm.readdir(e);}catch{return Mm.mkdirs(e)}return Promise.all(r.map(n=>Fm.remove(Om.join(e,n))))});function Im(t){let e;try{e=Pm.readdirSync(t);}catch{return Mm.mkdirsSync(t)}e.forEach(r=>{r=Om.join(t,r),Fm.removeSync(r);});}Nm.exports={emptyDirSync:Im,emptydirSync:Im,emptyDir:Tm,emptydir:Tm};});var qm=T((C$,Dm)=>{var _R=qe().fromCallback,$m=G("path"),$t=Be(),Lm=st();function gR(t,e){function r(){$t.writeFile(t,"",n=>{if(n)return e(n);e();});}$t.stat(t,(n,s)=>{if(!n&&s.isFile())return e();let i=$m.dirname(t);$t.stat(i,(o,a)=>{if(o)return o.code==="ENOENT"?Lm.mkdirs(i,c=>{if(c)return e(c);r();}):e(o);a.isDirectory()?r():$t.readdir(i,c=>{if(c)return e(c)});});});}function yR(t){let e;try{e=$t.statSync(t);}catch{}if(e&&e.isFile())return;let r=$m.dirname(t);try{$t.statSync(r).isDirectory()||$t.readdirSync(r);}catch(n){if(n&&n.code==="ENOENT")Lm.mkdirsSync(r);else throw n}$t.writeFileSync(t,"");}Dm.exports={createFile:_R(gR),createFileSync:yR};});var Wm=T((R$,jm)=>{var wR=qe().fromCallback,Bm=G("path"),Lt=Be(),Um=st(),bR=kt().pathExists,{areIdentical:Hm}=Qt();function vR(t,e,r){function n(s,i){Lt.link(s,i,o=>{if(o)return r(o);r(null);});}Lt.lstat(e,(s,i)=>{Lt.lstat(t,(o,a)=>{if(o)return o.message=o.message.replace("lstat","ensureLink"),r(o);if(i&&Hm(a,i))return r(null);let c=Bm.dirname(e);bR(c,(d,u)=>{if(d)return r(d);if(u)return n(t,e);Um.mkdirs(c,p=>{if(p)return r(p);n(t,e);});});});});}function SR(t,e){let r;try{r=Lt.lstatSync(e);}catch{}try{let i=Lt.lstatSync(t);if(r&&Hm(i,r))return}catch(i){throw i.message=i.message.replace("lstat","ensureLink"),i}let n=Bm.dirname(e);return Lt.existsSync(n)||Um.mkdirsSync(n),Lt.linkSync(t,e)}jm.exports={createLink:wR(vR),createLinkSync:SR};});var Gm=T((T$,zm)=>{var Dt=G("path"),mn=Be(),ER=kt().pathExists;function AR(t,e,r){if(Dt.isAbsolute(t))return mn.lstat(t,n=>n?(n.message=n.message.replace("lstat","ensureSymlink"),r(n)):r(null,{toCwd:t,toDst:t}));{let n=Dt.dirname(e),s=Dt.join(n,t);return ER(s,(i,o)=>i?r(i):o?r(null,{toCwd:s,toDst:t}):mn.lstat(t,a=>a?(a.message=a.message.replace("lstat","ensureSymlink"),r(a)):r(null,{toCwd:t,toDst:Dt.relative(n,t)})))}}function xR(t,e){let r;if(Dt.isAbsolute(t)){if(r=mn.existsSync(t),!r)throw new Error("absolute srcpath does not exist");return {toCwd:t,toDst:t}}else {let n=Dt.dirname(e),s=Dt.join(n,t);if(r=mn.existsSync(s),r)return {toCwd:s,toDst:t};if(r=mn.existsSync(t),!r)throw new Error("relative srcpath does not exist");return {toCwd:t,toDst:Dt.relative(n,t)}}}zm.exports={symlinkPaths:AR,symlinkPathsSync:xR};});var Zm=T((I$,Km)=>{var Vm=Be();function CR(t,e,r){if(r=typeof e=="function"?e:r,e=typeof e=="function"?!1:e,e)return r(null,e);Vm.lstat(t,(n,s)=>{if(n)return r(null,"file");e=s&&s.isDirectory()?"dir":"file",r(null,e);});}function RR(t,e){let r;if(e)return e;try{r=Vm.lstatSync(t);}catch{return "file"}return r&&r.isDirectory()?"dir":"file"}Km.exports={symlinkType:CR,symlinkTypeSync:RR};});var n_=T((P$,r_)=>{var TR=qe().fromCallback,Jm=G("path"),ot=Xt(),Xm=st(),IR=Xm.mkdirs,PR=Xm.mkdirsSync,Qm=Gm(),OR=Qm.symlinkPaths,MR=Qm.symlinkPathsSync,e_=Zm(),FR=e_.symlinkType,NR=e_.symlinkTypeSync,kR=kt().pathExists,{areIdentical:t_}=Qt();function $R(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,a])=>{if(t_(o,a))return n(null);Ym(t,e,r,n);}):Ym(t,e,r,n);});}function Ym(t,e,r,n){OR(t,e,(s,i)=>{if(s)return n(s);t=i.toDst,FR(i.toCwd,r,(o,a)=>{if(o)return n(o);let c=Jm.dirname(e);kR(c,(d,u)=>{if(d)return n(d);if(u)return ot.symlink(t,e,a,n);IR(c,p=>{if(p)return n(p);ot.symlink(t,e,a,n);});});});});}function LR(t,e,r){let n;try{n=ot.lstatSync(e);}catch{}if(n&&n.isSymbolicLink()){let a=ot.statSync(t),c=ot.statSync(e);if(t_(a,c))return}let s=MR(t,e);t=s.toDst,r=NR(s.toCwd,r);let i=Jm.dirname(e);return ot.existsSync(i)||PR(i),ot.symlinkSync(t,e,r)}r_.exports={createSymlink:TR($R),createSymlinkSync:LR};});var f_=T((O$,c_)=>{var{createFile:i_,createFileSync:s_}=qm(),{createLink:o_,createLinkSync:a_}=Wm(),{createSymlink:l_,createSymlinkSync:u_}=n_();c_.exports={createFile:i_,createFileSync:s_,ensureFile:i_,ensureFileSync:s_,createLink:o_,createLinkSync:a_,ensureLink:o_,ensureLinkSync:a_,createSymlink:l_,createSymlinkSync:u_,ensureSymlink:l_,ensureSymlinkSync:u_};});var qi=T((M$,h_)=>{function DR(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 qR(t){return Buffer.isBuffer(t)&&(t=t.toString("utf8")),t.replace(/^\uFEFF/,"")}h_.exports={stringify:DR,stripBom:qR};});var __=T((F$,m_)=>{var Rr;try{Rr=Be();}catch{Rr=G("fs");}var Bi=qe(),{stringify:d_,stripBom:p_}=qi();async function BR(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||Rr,n="throws"in e?e.throws:!0,s=await Bi.fromCallback(r.readFile)(t,e);s=p_(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 UR=Bi.fromPromise(BR);function HR(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||Rr,n="throws"in e?e.throws:!0;try{let s=r.readFileSync(t,e);return s=p_(s),JSON.parse(s,e.reviver)}catch(s){if(n)throw s.message=`${t}: ${s.message}`,s;return null}}async function jR(t,e,r={}){let n=r.fs||Rr,s=d_(e,r);await Bi.fromCallback(n.writeFile)(t,s,r);}var WR=Bi.fromPromise(jR);function zR(t,e,r={}){let n=r.fs||Rr,s=d_(e,r);return n.writeFileSync(t,s,r)}var GR={readFile:UR,readFileSync:HR,writeFile:WR,writeFileSync:zR};m_.exports=GR;});var y_=T((N$,g_)=>{var Ui=__();g_.exports={readJson:Ui.readFile,readJsonSync:Ui.readFileSync,writeJson:Ui.writeFile,writeJsonSync:Ui.writeFileSync};});var Hi=T((k$,v_)=>{var VR=qe().fromCallback,_n=Be(),w_=G("path"),b_=st(),KR=kt().pathExists;function ZR(t,e,r,n){typeof r=="function"&&(n=r,r="utf8");let s=w_.dirname(t);KR(s,(i,o)=>{if(i)return n(i);if(o)return _n.writeFile(t,e,r,n);b_.mkdirs(s,a=>{if(a)return n(a);_n.writeFile(t,e,r,n);});});}function YR(t,...e){let r=w_.dirname(t);if(_n.existsSync(r))return _n.writeFileSync(t,...e);b_.mkdirsSync(r),_n.writeFileSync(t,...e);}v_.exports={outputFile:VR(ZR),outputFileSync:YR};});var E_=T(($$,S_)=>{var{stringify:JR}=qi(),{outputFile:XR}=Hi();async function QR(t,e,r={}){let n=JR(e,r);await XR(t,n,r);}S_.exports=QR;});var x_=T((L$,A_)=>{var{stringify:eT}=qi(),{outputFileSync:tT}=Hi();function rT(t,e,r){let n=eT(e,r);tT(t,n,r);}A_.exports=rT;});var R_=T((D$,C_)=>{var nT=qe().fromPromise,Le=y_();Le.outputJson=nT(E_());Le.outputJsonSync=x_();Le.outputJSON=Le.outputJson;Le.outputJSONSync=Le.outputJsonSync;Le.writeJSON=Le.writeJson;Le.writeJSONSync=Le.writeJsonSync;Le.readJSON=Le.readJson;Le.readJSONSync=Le.readJsonSync;C_.exports=Le;});var M_=T((q$,O_)=>{var iT=Be(),Ia=G("path"),sT=Di().copy,P_=pn().remove,oT=st().mkdirp,aT=kt().pathExists,T_=Qt();function lT(t,e,r,n){typeof r=="function"&&(n=r,r={}),r=r||{};let s=r.overwrite||r.clobber||!1;T_.checkPaths(t,e,"move",r,(i,o)=>{if(i)return n(i);let{srcStat:a,isChangingCase:c=!1}=o;T_.checkParentPaths(t,a,e,"move",d=>{if(d)return n(d);if(uT(e))return I_(t,e,s,c,n);oT(Ia.dirname(e),u=>u?n(u):I_(t,e,s,c,n));});});}function uT(t){let e=Ia.dirname(t);return Ia.parse(e).root===e}function I_(t,e,r,n,s){if(n)return Ta(t,e,r,s);if(r)return P_(e,i=>i?s(i):Ta(t,e,r,s));aT(e,(i,o)=>i?s(i):o?s(new Error("dest already exists.")):Ta(t,e,r,s));}function Ta(t,e,r,n){iT.rename(t,e,s=>s?s.code!=="EXDEV"?n(s):cT(t,e,r,n):n());}function cT(t,e,r,n){sT(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0},i=>i?n(i):P_(t,n));}O_.exports=lT;});var L_=T((B$,$_)=>{var N_=Be(),Oa=G("path"),fT=Di().copySync,k_=pn().removeSync,hT=st().mkdirpSync,F_=Qt();function dT(t,e,r){r=r||{};let n=r.overwrite||r.clobber||!1,{srcStat:s,isChangingCase:i=!1}=F_.checkPathsSync(t,e,"move",r);return F_.checkParentPathsSync(t,s,e,"move"),pT(e)||hT(Oa.dirname(e)),mT(t,e,n,i)}function pT(t){let e=Oa.dirname(t);return Oa.parse(e).root===e}function mT(t,e,r,n){if(n)return Pa(t,e,r);if(r)return k_(e),Pa(t,e,r);if(N_.existsSync(e))throw new Error("dest already exists.");return Pa(t,e,r)}function Pa(t,e,r){try{N_.renameSync(t,e);}catch(n){if(n.code!=="EXDEV")throw n;return _T(t,e,r)}}function _T(t,e,r){return fT(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),k_(t)}$_.exports=dT;});var q_=T((U$,D_)=>{var gT=qe().fromCallback;D_.exports={move:gT(M_()),moveSync:L_()};});var Ma=T((H$,B_)=>{B_.exports={...Xt(),...Di(),...km(),...f_(),...R_(),...st(),...q_(),...Hi(),...kt(),...pn()};});var gn=T((j$,z_)=>{var yT=G("path"),dt="\\\\/",U_=`[^${dt}]`,bt="\\.",wT="\\+",bT="\\?",ji="\\/",vT="(?=.)",H_="[^/]",Fa=`(?:${ji}|$)`,j_=`(?:^|${ji})`,Na=`${bt}{1,2}${Fa}`,ST=`(?!${bt})`,ET=`(?!${j_}${Na})`,AT=`(?!${bt}{0,1}${Fa})`,xT=`(?!${Na})`,CT=`[^.${ji}]`,RT=`${H_}*?`,W_={DOT_LITERAL:bt,PLUS_LITERAL:wT,QMARK_LITERAL:bT,SLASH_LITERAL:ji,ONE_CHAR:vT,QMARK:H_,END_ANCHOR:Fa,DOTS_SLASH:Na,NO_DOT:ST,NO_DOTS:ET,NO_DOT_SLASH:AT,NO_DOTS_SLASH:xT,QMARK_NO_DOT:CT,STAR:RT,START_ANCHOR:j_},TT={...W_,SLASH_LITERAL:`[${dt}]`,QMARK:U_,STAR:`${U_}*?`,DOTS_SLASH:`${bt}{1,2}(?:[${dt}]|$)`,NO_DOT:`(?!${bt})`,NO_DOTS:`(?!(?:^|[${dt}])${bt}{1,2}(?:[${dt}]|$))`,NO_DOT_SLASH:`(?!${bt}{0,1}(?:[${dt}]|$))`,NO_DOTS_SLASH:`(?!${bt}{1,2}(?:[${dt}]|$))`,QMARK_NO_DOT:`[^.${dt}]`,START_ANCHOR:`(?:^|[${dt}])`,END_ANCHOR:`(?:[${dt}]|$)`},IT={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"};z_.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:IT,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:yT.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?TT:W_}};});var Wi=T(He=>{var PT=G("path"),OT=process.platform==="win32",{REGEX_BACKSLASH:MT,REGEX_REMOVE_BACKSLASH:FT,REGEX_SPECIAL_CHARS:NT,REGEX_SPECIAL_CHARS_GLOBAL:kT}=gn();He.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);He.hasRegexChars=t=>NT.test(t);He.isRegexChar=t=>t.length===1&&He.hasRegexChars(t);He.escapeRegex=t=>t.replace(kT,"\\$1");He.toPosixSlashes=t=>t.replace(MT,"/");He.removeBackslashes=t=>t.replace(FT,e=>e==="\\"?"":e);He.supportsLookbehinds=()=>{let t=process.version.slice(1).split(".").map(Number);return t.length===3&&t[0]>=9||t[0]===8&&t[1]>=10};He.isWindows=t=>t&&typeof t.windows=="boolean"?t.windows:OT===!0||PT.sep==="\\";He.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?He.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};He.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};He.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",s=r.contains?"":"$",i=`${n}(?:${t})${s}`;return e.negated===!0&&(i=`(?:^(?!${i}).*$)`),i};});var Q_=T((z$,X_)=>{var G_=Wi(),{CHAR_ASTERISK:ka,CHAR_AT:$T,CHAR_BACKWARD_SLASH:yn,CHAR_COMMA:LT,CHAR_DOT:$a,CHAR_EXCLAMATION_MARK:La,CHAR_FORWARD_SLASH:J_,CHAR_LEFT_CURLY_BRACE:Da,CHAR_LEFT_PARENTHESES:qa,CHAR_LEFT_SQUARE_BRACKET:DT,CHAR_PLUS:qT,CHAR_QUESTION_MARK:V_,CHAR_RIGHT_CURLY_BRACE:BT,CHAR_RIGHT_PARENTHESES:K_,CHAR_RIGHT_SQUARE_BRACKET:UT}=gn(),Z_=t=>t===J_||t===yn,Y_=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1);},HT=(t,e)=>{let r=e||{},n=t.length-1,s=r.parts===!0||r.scanToEnd===!0,i=[],o=[],a=[],c=t,d=-1,u=0,p=0,_=!1,m=!1,y=!1,v=!1,E=!1,A=!1,w=!1,x=!1,M=!1,k=!1,j=0,U,$,F={value:"",depth:0,isGlob:!1},B=()=>d>=n,R=()=>c.charCodeAt(d+1),z=()=>(U=$,c.charCodeAt(++d));for(;d<n;){$=z();let X;if($===yn){w=F.backslashes=!0,$=z(),$===Da&&(A=!0);continue}if(A===!0||$===Da){for(j++;B()!==!0&&($=z());){if($===yn){w=F.backslashes=!0,z();continue}if($===Da){j++;continue}if(A!==!0&&$===$a&&($=z())===$a){if(_=F.isBrace=!0,y=F.isGlob=!0,k=!0,s===!0)continue;break}if(A!==!0&&$===LT){if(_=F.isBrace=!0,y=F.isGlob=!0,k=!0,s===!0)continue;break}if($===BT&&(j--,j===0)){A=!1,_=F.isBrace=!0,k=!0;break}}if(s===!0)continue;break}if($===J_){if(i.push(d),o.push(F),F={value:"",depth:0,isGlob:!1},k===!0)continue;if(U===$a&&d===u+1){u+=2;continue}p=d+1;continue}if(r.noext!==!0&&($===qT||$===$T||$===ka||$===V_||$===La)===!0&&R()===qa){if(y=F.isGlob=!0,v=F.isExtglob=!0,k=!0,$===La&&d===u&&(M=!0),s===!0){for(;B()!==!0&&($=z());){if($===yn){w=F.backslashes=!0,$=z();continue}if($===K_){y=F.isGlob=!0,k=!0;break}}continue}break}if($===ka){if(U===ka&&(E=F.isGlobstar=!0),y=F.isGlob=!0,k=!0,s===!0)continue;break}if($===V_){if(y=F.isGlob=!0,k=!0,s===!0)continue;break}if($===DT){for(;B()!==!0&&(X=z());){if(X===yn){w=F.backslashes=!0,z();continue}if(X===UT){m=F.isBracket=!0,y=F.isGlob=!0,k=!0;break}}if(s===!0)continue;break}if(r.nonegate!==!0&&$===La&&d===u){x=F.negated=!0,u++;continue}if(r.noparen!==!0&&$===qa){if(y=F.isGlob=!0,s===!0){for(;B()!==!0&&($=z());){if($===qa){w=F.backslashes=!0,$=z();continue}if($===K_){k=!0;break}}continue}break}if(y===!0){if(k=!0,s===!0)continue;break}}r.noext===!0&&(v=!1,y=!1);let V=c,te="",I="";u>0&&(te=c.slice(0,u),c=c.slice(u),p-=u),V&&y===!0&&p>0?(V=c.slice(0,p),I=c.slice(p)):y===!0?(V="",I=c):V=c,V&&V!==""&&V!=="/"&&V!==c&&Z_(V.charCodeAt(V.length-1))&&(V=V.slice(0,-1)),r.unescape===!0&&(I&&(I=G_.removeBackslashes(I)),V&&w===!0&&(V=G_.removeBackslashes(V)));let O={prefix:te,input:t,start:u,base:V,glob:I,isBrace:_,isBracket:m,isGlob:y,isExtglob:v,isGlobstar:E,negated:x,negatedExtglob:M};if(r.tokens===!0&&(O.maxDepth=0,Z_($)||o.push(F),O.tokens=o),r.parts===!0||r.tokens===!0){let X;for(let Q=0;Q<i.length;Q++){let ie=X?X+1:u,Ne=i[Q],ve=t.slice(ie,Ne);r.tokens&&(Q===0&&u!==0?(o[Q].isPrefix=!0,o[Q].value=te):o[Q].value=ve,Y_(o[Q]),O.maxDepth+=o[Q].depth),(Q!==0||ve!=="")&&a.push(ve),X=Ne;}if(X&&X+1<t.length){let Q=t.slice(X+1);a.push(Q),r.tokens&&(o[o.length-1].value=Q,Y_(o[o.length-1]),O.maxDepth+=o[o.length-1].depth);}O.slashes=i,O.parts=a;}return O};X_.exports=HT;});var rg=T((G$,tg)=>{var zi=gn(),Ke=Wi(),{MAX_LENGTH:Gi,POSIX_REGEX_SOURCE:jT,REGEX_NON_SPECIAL_CHARS:WT,REGEX_SPECIAL_CHARS_BACKREF:zT,REPLACEMENTS:eg}=zi,GT=(t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let r=`[${t.join("-")}]`;return r},Tr=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,Ba=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=eg[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min(Gi,r.maxLength):Gi,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],a=r.capture?"":"?:",c=Ke.isWindows(e),d=zi.globChars(c),u=zi.extglobChars(d),{DOT_LITERAL:p,PLUS_LITERAL:_,SLASH_LITERAL:m,ONE_CHAR:y,DOTS_SLASH:v,NO_DOT:E,NO_DOT_SLASH:A,NO_DOTS_SLASH:w,QMARK:x,QMARK_NO_DOT:M,STAR:k,START_ANCHOR:j}=d,U=Z=>`(${a}(?:(?!${j}${Z.dot?v:p}).)*?)`,$=r.dot?"":E,F=r.dot?x:M,B=r.bash===!0?U(r):k;r.capture&&(B=`(${B})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let R={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=Ke.removePrefix(t,R),s=t.length;let z=[],V=[],te=[],I=i,O,X=()=>R.index===s-1,Q=R.peek=(Z=1)=>t[R.index+Z],ie=R.advance=()=>t[++R.index]||"",Ne=()=>t.slice(R.index+1),ve=(Z="",he=0)=>{R.consumed+=Z,R.index+=he;},Et=Z=>{R.output+=Z.output!=null?Z.output:Z.value,ve(Z.value);},Hr=()=>{let Z=1;for(;Q()==="!"&&(Q(2)!=="("||Q(3)==="?");)ie(),R.start++,Z++;return Z%2===0?!1:(R.negated=!0,R.start++,!0)},At=Z=>{R[Z]++,te.push(Z);},nt=Z=>{R[Z]--,te.pop();},se=Z=>{if(I.type==="globstar"){let he=R.braces>0&&(Z.type==="comma"||Z.type==="brace"),W=Z.extglob===!0||z.length&&(Z.type==="pipe"||Z.type==="paren");Z.type!=="slash"&&Z.type!=="paren"&&!he&&!W&&(R.output=R.output.slice(0,-I.output.length),I.type="star",I.value="*",I.output=B,R.output+=I.output);}if(z.length&&Z.type!=="paren"&&(z[z.length-1].inner+=Z.value),(Z.value||Z.output)&&Et(Z),I&&I.type==="text"&&Z.type==="text"){I.value+=Z.value,I.output=(I.output||"")+Z.value;return}Z.prev=I,o.push(Z),I=Z;},lr=(Z,he)=>{let W={...u[he],conditions:1,inner:""};W.prev=I,W.parens=R.parens,W.output=R.output;let ne=(r.capture?"(":"")+W.open;At("parens"),se({type:Z,value:he,output:R.output?"":y}),se({type:"paren",extglob:!0,value:ie(),output:ne}),z.push(W);},js=Z=>{let he=Z.close+(r.capture?")":""),W;if(Z.type==="negate"){let ne=B;if(Z.inner&&Z.inner.length>1&&Z.inner.includes("/")&&(ne=U(r)),(ne!==B||X()||/^\)+$/.test(Ne()))&&(he=Z.close=`)$))${ne}`),Z.inner.includes("*")&&(W=Ne())&&/^\.[^\\/.]+$/.test(W)){let de=Ba(W,{...e,fastpaths:!1}).output;he=Z.close=`)${de})${ne})`;}Z.prev.type==="bos"&&(R.negatedExtglob=!0);}se({type:"paren",extglob:!0,value:O,output:he}),nt("parens");};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let Z=!1,he=t.replace(zT,(W,ne,de,Re,ge,Wt)=>Re==="\\"?(Z=!0,W):Re==="?"?ne?ne+Re+(ge?x.repeat(ge.length):""):Wt===0?F+(ge?x.repeat(ge.length):""):x.repeat(de.length):Re==="."?p.repeat(de.length):Re==="*"?ne?ne+Re+(ge?B:""):B:ne?W:`\\${W}`);return Z===!0&&(r.unescape===!0?he=he.replace(/\\/g,""):he=he.replace(/\\+/g,W=>W.length%2===0?"\\\\":W?"\\":"")),he===t&&r.contains===!0?(R.output=t,R):(R.output=Ke.wrapOutput(he,R,e),R)}for(;!X();){if(O=ie(),O==="\0")continue;if(O==="\\"){let W=Q();if(W==="/"&&r.bash!==!0||W==="."||W===";")continue;if(!W){O+="\\",se({type:"text",value:O});continue}let ne=/^\\+/.exec(Ne()),de=0;if(ne&&ne[0].length>2&&(de=ne[0].length,R.index+=de,de%2!==0&&(O+="\\")),r.unescape===!0?O=ie():O+=ie(),R.brackets===0){se({type:"text",value:O});continue}}if(R.brackets>0&&(O!=="]"||I.value==="["||I.value==="[^")){if(r.posix!==!1&&O===":"){let W=I.value.slice(1);if(W.includes("[")&&(I.posix=!0,W.includes(":"))){let ne=I.value.lastIndexOf("["),de=I.value.slice(0,ne),Re=I.value.slice(ne+2),ge=jT[Re];if(ge){I.value=de+ge,R.backtrack=!0,ie(),!i.output&&o.indexOf(I)===1&&(i.output=y);continue}}}(O==="["&&Q()!==":"||O==="-"&&Q()==="]")&&(O=`\\${O}`),O==="]"&&(I.value==="["||I.value==="[^")&&(O=`\\${O}`),r.posix===!0&&O==="!"&&I.value==="["&&(O="^"),I.value+=O,Et({value:O});continue}if(R.quotes===1&&O!=='"'){O=Ke.escapeRegex(O),I.value+=O,Et({value:O});continue}if(O==='"'){R.quotes=R.quotes===1?0:1,r.keepQuotes===!0&&se({type:"text",value:O});continue}if(O==="("){At("parens"),se({type:"paren",value:O});continue}if(O===")"){if(R.parens===0&&r.strictBrackets===!0)throw new SyntaxError(Tr("opening","("));let W=z[z.length-1];if(W&&R.parens===W.parens+1){js(z.pop());continue}se({type:"paren",value:O,output:R.parens?")":"\\)"}),nt("parens");continue}if(O==="["){if(r.nobracket===!0||!Ne().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(Tr("closing","]"));O=`\\${O}`;}else At("brackets");se({type:"bracket",value:O});continue}if(O==="]"){if(r.nobracket===!0||I&&I.type==="bracket"&&I.value.length===1){se({type:"text",value:O,output:`\\${O}`});continue}if(R.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(Tr("opening","["));se({type:"text",value:O,output:`\\${O}`});continue}nt("brackets");let W=I.value.slice(1);if(I.posix!==!0&&W[0]==="^"&&!W.includes("/")&&(O=`/${O}`),I.value+=O,Et({value:O}),r.literalBrackets===!1||Ke.hasRegexChars(W))continue;let ne=Ke.escapeRegex(I.value);if(R.output=R.output.slice(0,-I.value.length),r.literalBrackets===!0){R.output+=ne,I.value=ne;continue}I.value=`(${a}${ne}|${I.value})`,R.output+=I.value;continue}if(O==="{"&&r.nobrace!==!0){At("braces");let W={type:"brace",value:O,output:"(",outputIndex:R.output.length,tokensIndex:R.tokens.length};V.push(W),se(W);continue}if(O==="}"){let W=V[V.length-1];if(r.nobrace===!0||!W){se({type:"text",value:O,output:O});continue}let ne=")";if(W.dots===!0){let de=o.slice(),Re=[];for(let ge=de.length-1;ge>=0&&(o.pop(),de[ge].type!=="brace");ge--)de[ge].type!=="dots"&&Re.unshift(de[ge].value);ne=GT(Re,r),R.backtrack=!0;}if(W.comma!==!0&&W.dots!==!0){let de=R.output.slice(0,W.outputIndex),Re=R.tokens.slice(W.tokensIndex);W.value=W.output="\\{",O=ne="\\}",R.output=de;for(let ge of Re)R.output+=ge.output||ge.value;}se({type:"brace",value:O,output:ne}),nt("braces"),V.pop();continue}if(O==="|"){z.length>0&&z[z.length-1].conditions++,se({type:"text",value:O});continue}if(O===","){let W=O,ne=V[V.length-1];ne&&te[te.length-1]==="braces"&&(ne.comma=!0,W="|"),se({type:"comma",value:O,output:W});continue}if(O==="/"){if(I.type==="dot"&&R.index===R.start+1){R.start=R.index+1,R.consumed="",R.output="",o.pop(),I=i;continue}se({type:"slash",value:O,output:m});continue}if(O==="."){if(R.braces>0&&I.type==="dot"){I.value==="."&&(I.output=p);let W=V[V.length-1];I.type="dots",I.output+=O,I.value+=O,W.dots=!0;continue}if(R.braces+R.parens===0&&I.type!=="bos"&&I.type!=="slash"){se({type:"text",value:O,output:p});continue}se({type:"dot",value:O,output:p});continue}if(O==="?"){if(!(I&&I.value==="(")&&r.noextglob!==!0&&Q()==="("&&Q(2)!=="?"){lr("qmark",O);continue}if(I&&I.type==="paren"){let ne=Q(),de=O;if(ne==="<"&&!Ke.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(I.value==="("&&!/[!=<:]/.test(ne)||ne==="<"&&!/<([!=]|\w+>)/.test(Ne()))&&(de=`\\${O}`),se({type:"text",value:O,output:de});continue}if(r.dot!==!0&&(I.type==="slash"||I.type==="bos")){se({type:"qmark",value:O,output:M});continue}se({type:"qmark",value:O,output:x});continue}if(O==="!"){if(r.noextglob!==!0&&Q()==="("&&(Q(2)!=="?"||!/[!=<:]/.test(Q(3)))){lr("negate",O);continue}if(r.nonegate!==!0&&R.index===0){Hr();continue}}if(O==="+"){if(r.noextglob!==!0&&Q()==="("&&Q(2)!=="?"){lr("plus",O);continue}if(I&&I.value==="("||r.regex===!1){se({type:"plus",value:O,output:_});continue}if(I&&(I.type==="bracket"||I.type==="paren"||I.type==="brace")||R.parens>0){se({type:"plus",value:O});continue}se({type:"plus",value:_});continue}if(O==="@"){if(r.noextglob!==!0&&Q()==="("&&Q(2)!=="?"){se({type:"at",extglob:!0,value:O,output:""});continue}se({type:"text",value:O});continue}if(O!=="*"){(O==="$"||O==="^")&&(O=`\\${O}`);let W=WT.exec(Ne());W&&(O+=W[0],R.index+=W[0].length),se({type:"text",value:O});continue}if(I&&(I.type==="globstar"||I.star===!0)){I.type="star",I.star=!0,I.value+=O,I.output=B,R.backtrack=!0,R.globstar=!0,ve(O);continue}let Z=Ne();if(r.noextglob!==!0&&/^\([^?]/.test(Z)){lr("star",O);continue}if(I.type==="star"){if(r.noglobstar===!0){ve(O);continue}let W=I.prev,ne=W.prev,de=W.type==="slash"||W.type==="bos",Re=ne&&(ne.type==="star"||ne.type==="globstar");if(r.bash===!0&&(!de||Z[0]&&Z[0]!=="/")){se({type:"star",value:O,output:""});continue}let ge=R.braces>0&&(W.type==="comma"||W.type==="brace"),Wt=z.length&&(W.type==="pipe"||W.type==="paren");if(!de&&W.type!=="paren"&&!ge&&!Wt){se({type:"star",value:O,output:""});continue}for(;Z.slice(0,3)==="/**";){let xt=t[R.index+4];if(xt&&xt!=="/")break;Z=Z.slice(3),ve("/**",3);}if(W.type==="bos"&&X()){I.type="globstar",I.value+=O,I.output=U(r),R.output=I.output,R.globstar=!0,ve(O);continue}if(W.type==="slash"&&W.prev.type!=="bos"&&!Re&&X()){R.output=R.output.slice(0,-(W.output+I.output).length),W.output=`(?:${W.output}`,I.type="globstar",I.output=U(r)+(r.strictSlashes?")":"|$)"),I.value+=O,R.globstar=!0,R.output+=W.output+I.output,ve(O);continue}if(W.type==="slash"&&W.prev.type!=="bos"&&Z[0]==="/"){let xt=Z[1]!==void 0?"|$":"";R.output=R.output.slice(0,-(W.output+I.output).length),W.output=`(?:${W.output}`,I.type="globstar",I.output=`${U(r)}${m}|${m}${xt})`,I.value+=O,R.output+=W.output+I.output,R.globstar=!0,ve(O+ie()),se({type:"slash",value:"/",output:""});continue}if(W.type==="bos"&&Z[0]==="/"){I.type="globstar",I.value+=O,I.output=`(?:^|${m}|${U(r)}${m})`,R.output=I.output,R.globstar=!0,ve(O+ie()),se({type:"slash",value:"/",output:""});continue}R.output=R.output.slice(0,-I.output.length),I.type="globstar",I.output=U(r),I.value+=O,R.output+=I.output,R.globstar=!0,ve(O);continue}let he={type:"star",value:O,output:B};if(r.bash===!0){he.output=".*?",(I.type==="bos"||I.type==="slash")&&(he.output=$+he.output),se(he);continue}if(I&&(I.type==="bracket"||I.type==="paren")&&r.regex===!0){he.output=O,se(he);continue}(R.index===R.start||I.type==="slash"||I.type==="dot")&&(I.type==="dot"?(R.output+=A,I.output+=A):r.dot===!0?(R.output+=w,I.output+=w):(R.output+=$,I.output+=$),Q()!=="*"&&(R.output+=y,I.output+=y)),se(he);}for(;R.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(Tr("closing","]"));R.output=Ke.escapeLast(R.output,"["),nt("brackets");}for(;R.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(Tr("closing",")"));R.output=Ke.escapeLast(R.output,"("),nt("parens");}for(;R.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(Tr("closing","}"));R.output=Ke.escapeLast(R.output,"{"),nt("braces");}if(r.strictSlashes!==!0&&(I.type==="star"||I.type==="bracket")&&se({type:"maybe_slash",value:"",output:`${m}?`}),R.backtrack===!0){R.output="";for(let Z of R.tokens)R.output+=Z.output!=null?Z.output:Z.value,Z.suffix&&(R.output+=Z.suffix);}return R};Ba.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min(Gi,r.maxLength):Gi,s=t.length;if(s>n)throw new SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${n}`);t=eg[t]||t;let i=Ke.isWindows(e),{DOT_LITERAL:o,SLASH_LITERAL:a,ONE_CHAR:c,DOTS_SLASH:d,NO_DOT:u,NO_DOTS:p,NO_DOTS_SLASH:_,STAR:m,START_ANCHOR:y}=zi.globChars(i),v=r.dot?p:u,E=r.dot?_:u,A=r.capture?"":"?:",w={negated:!1,prefix:""},x=r.bash===!0?".*?":m;r.capture&&(x=`(${x})`);let M=$=>$.noglobstar===!0?x:`(${A}(?:(?!${y}${$.dot?d:o}).)*?)`,k=$=>{switch($){case"*":return `${v}${c}${x}`;case".*":return `${o}${c}${x}`;case"*.*":return `${v}${x}${o}${c}${x}`;case"*/*":return `${v}${x}${a}${c}${E}${x}`;case"**":return v+M(r);case"**/*":return `(?:${v}${M(r)}${a})?${E}${c}${x}`;case"**/*.*":return `(?:${v}${M(r)}${a})?${E}${x}${o}${c}${x}`;case"**/.*":return `(?:${v}${M(r)}${a})?${o}${c}${x}`;default:{let F=/^(.*?)\.(\w+)$/.exec($);if(!F)return;let B=k(F[1]);return B?B+o+F[2]:void 0}}},j=Ke.removePrefix(t,w),U=k(j);return U&&r.strictSlashes!==!0&&(U+=`${a}?`),U};tg.exports=Ba;});var ig=T((V$,ng)=>{var VT=G("path"),KT=Q_(),Ua=rg(),Ha=Wi(),ZT=gn(),YT=t=>t&&typeof t=="object"&&!Array.isArray(t),we=(t,e,r=!1)=>{if(Array.isArray(t)){let u=t.map(_=>we(_,e,r));return _=>{for(let m of u){let y=m(_);if(y)return y}return !1}}let n=YT(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=Ha.isWindows(e),o=n?we.compileRe(t,e):we.makeRe(t,e,!1,!0),a=o.state;delete o.state;let c=()=>!1;if(s.ignore){let u={...e,ignore:null,onMatch:null,onResult:null};c=we(s.ignore,u,r);}let d=(u,p=!1)=>{let{isMatch:_,match:m,output:y}=we.test(u,o,e,{glob:t,posix:i}),v={glob:t,state:a,regex:o,posix:i,input:u,output:y,match:m,isMatch:_};return typeof s.onResult=="function"&&s.onResult(v),_===!1?(v.isMatch=!1,p?v:!1):c(u)?(typeof s.onIgnore=="function"&&s.onIgnore(v),v.isMatch=!1,p?v:!1):(typeof s.onMatch=="function"&&s.onMatch(v),p?v:!0)};return r&&(d.state=a),d};we.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?Ha.toPosixSlashes:null),a=t===n,c=a&&o?o(t):t;return a===!1&&(c=o?o(t):t,a=c===n),(a===!1||i.capture===!0)&&(i.matchBase===!0||i.basename===!0?a=we.matchBase(t,e,r,s):a=e.exec(c)),{isMatch:!!a,match:a,output:c}};we.matchBase=(t,e,r,n=Ha.isWindows(r))=>(e instanceof RegExp?e:we.makeRe(e,r)).test(VT.basename(t));we.isMatch=(t,e,r)=>we(e,r)(t);we.parse=(t,e)=>Array.isArray(t)?t.map(r=>we.parse(r,e)):Ua(t,{...e,fastpaths:!1});we.scan=(t,e)=>KT(t,e);we.compileRe=(t,e,r=!1,n=!1)=>{if(r===!0)return t.output;let s=e||{},i=s.contains?"":"^",o=s.contains?"":"$",a=`${i}(?:${t.output})${o}`;t&&t.negated===!0&&(a=`^(?!${a}).*$`);let c=we.toRegex(a,e);return n===!0&&(c.state=t),c};we.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=Ua.fastpaths(t,e)),s.output||(s=Ua(t,e)),we.compileRe(s,e,r,n)};we.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 /$^/}};we.constants=ZT;ng.exports=we;});var ja=T((K$,sg)=>{sg.exports=ig();});var dg=T((Z$,hg)=>{var bn=G("fs"),{Readable:JT}=G("stream"),wn=G("path"),{promisify:Yi}=G("util"),Wa=ja(),XT=Yi(bn.readdir),QT=Yi(bn.stat),og=Yi(bn.lstat),e1=Yi(bn.realpath),t1="!",cg="READDIRP_RECURSIVE_ERROR",r1=new Set(["ENOENT","EPERM","EACCES","ELOOP",cg]),za="files",fg="directories",Ki="files_directories",Vi="all",ag=[za,fg,Ki,Vi],n1=t=>r1.has(t.code),[lg,i1]=process.versions.node.split(".").slice(0,2).map(t=>Number.parseInt(t,10)),s1=process.platform==="win32"&&(lg>10||lg===10&&i1>=5),ug=t=>{if(t!==void 0){if(typeof t=="function")return t;if(typeof t=="string"){let e=Wa(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)===t1?r.push(Wa(s.slice(1))):e.push(Wa(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))}}},Zi=class t extends JT{static get defaultOptions(){return {root:".",fileFilter:e=>!0,directoryFilter:e=>!0,type:za,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=ug(r.fileFilter),this._directoryFilter=ug(r.directoryFilter);let i=r.lstat?og:QT;s1?this._stat=o=>i(o,{bigint:!0}):this._stat=i,this._maxDepth=r.depth,this._wantsDir=[fg,Ki,Vi].includes(s),this._wantsFile=[za,Ki,Vi].includes(s),this._wantsEverything=s===Vi,this._root=wn.resolve(n),this._isDirent="Dirent"in bn&&!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 a=await this._getEntryType(o);a==="directory"&&this._directoryFilter(o)?(n<=this._maxDepth&&this.parents.push(this._exploreDir(o.fullPath,n+1)),this._wantsDir&&(this.push(o),e--)):(a==="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 XT(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=wn.resolve(wn.join(r,s));n={path:wn.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){n1(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 e1(n),i=await og(s);if(i.isFile())return "file";if(i.isDirectory()){let o=s.length;if(n.startsWith(s)&&n.substr(o,1)===wn.sep){let a=new Error(`Circular symlink detected: "${n}" points to "${s}"`);return a.code=cg,this._onError(a)}return "directory"}}catch(s){this._onError(s);}}}}_includeAsFile(e){let r=e&&e[this._statsProp];return r&&this._wantsEverything&&!r.isDirectory()}},Ir=(t,e={})=>{let r=e.entryType||e.type;if(r==="both"&&(r=Ki),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&&!ag.includes(r))throw new Error(`readdirp: Invalid type passed. Use one of ${ag.join(", ")}`)}else throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");return e.root=t,new Zi(e)},o1=(t,e={})=>new Promise((r,n)=>{let s=[];Ir(t,e).on("data",i=>s.push(i)).on("end",()=>r(s)).on("error",i=>n(i));});Ir.promise=o1;Ir.ReaddirpStream=Zi;Ir.default=Ir;hg.exports=Ir;});var Ga=T((Y$,pg)=>{pg.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 bg=T((yg,wg)=>{Object.defineProperty(yg,"__esModule",{value:!0});var gg=ja(),a1=Ga(),mg="!",l1={returnIndex:!1},u1=t=>Array.isArray(t)?t:[t],c1=(t,e)=>{if(typeof t=="function")return t;if(typeof t=="string"){let r=gg(t,e);return n=>t===n||r(n)}return t instanceof RegExp?r=>t.test(r):r=>!1},_g=(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=a1(i,!1);for(let c=0;c<e.length;c++){let d=e[c];if(d(o))return n?-1:!1}let a=s&&[o].concat(r.slice(1));for(let c=0;c<t.length;c++){let d=t[c];if(s?d(...a):d(o))return n?c:!0}return n?-1:!1},Va=(t,e,r=l1)=>{if(t==null)throw new TypeError("anymatch: specify first argument");let n=typeof r=="boolean"?{returnIndex:r}:r,s=n.returnIndex||!1,i=u1(t),o=i.filter(c=>typeof c=="string"&&c.charAt(0)===mg).map(c=>c.slice(1)).map(c=>gg(c,n)),a=i.filter(c=>typeof c!="string"||typeof c=="string"&&c.charAt(0)!==mg).map(c=>c1(c,n));return e==null?(c,d=!1)=>_g(a,o,c,typeof d=="boolean"?d:!1):_g(a,o,e,s)};Va.default=Va;wg.exports=Va;});var Sg=T((J$,vg)=>{vg.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 Ka=T((X$,Ag)=>{var f1=Sg(),Eg={"{":"}","(":")","[":"]"},h1=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 a=t[e+1];e+=2;var c=Eg[a];if(c){var d=t.indexOf(c,e);d!==-1&&(e=d+1);}if(t[e]==="!")return !0}else e++;}return !1},d1=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=Eg[r];if(n){var s=t.indexOf(n,e);s!==-1&&(e=s+1);}if(t[e]==="!")return !0}else e++;}return !1};Ag.exports=function(e,r){if(typeof e!="string"||e==="")return !1;if(f1(e))return !0;var n=h1;return r&&r.strict===!1&&(n=d1),n(e)};});var Cg=T((Q$,xg)=>{var p1=Ka(),m1=G("path").posix.dirname,_1=G("os").platform()==="win32",Za="/",g1=/\\/g,y1=/[\{\[].*[\}\]]$/,w1=/(^|[^\\])([\{\[]|\([^\)]+$)/,b1=/\\([\!\*\?\|\[\]\(\)\{\}])/g;xg.exports=function(e,r){var n=Object.assign({flipBackslashes:!0},r);n.flipBackslashes&&_1&&e.indexOf(Za)<0&&(e=e.replace(g1,Za)),y1.test(e)&&(e+=Za),e+="a";do e=m1(e);while(p1(e)||w1.test(e));return e.replace(b1,"$1")};});var Ji=T(et=>{et.isInteger=t=>typeof t=="number"?Number.isInteger(t):typeof t=="string"&&t.trim()!==""?Number.isInteger(Number(t)):!1;et.find=(t,e)=>t.nodes.find(r=>r.type===e);et.exceedsLimit=(t,e,r=1,n)=>n===!1||!et.isInteger(t)||!et.isInteger(e)?!1:(Number(e)-Number(t))/Number(r)>=n;et.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);};et.encloseBrace=t=>t.type!=="brace"||t.commas>>0+t.ranges>>0?!1:(t.invalid=!0,!0);et.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;et.isOpenOrClose=t=>t.type==="open"||t.type==="close"?!0:t.open===!0||t.close===!0;et.reduce=t=>t.reduce((e,r)=>(r.type==="text"&&e.push(r.value),r.type==="range"&&(r.type="text"),e),[]);et.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 Xi=T((tL,Tg)=>{var Rg=Ji();Tg.exports=(t,e={})=>{let r=(n,s={})=>{let i=e.escapeInvalid&&Rg.isInvalidBrace(s),o=n.invalid===!0&&e.escapeInvalid===!0,a="";if(n.value)return (i||o)&&Rg.isOpenOrClose(n)?"\\"+n.value:n.value;if(n.value)return n.value;if(n.nodes)for(let c of n.nodes)a+=r(c);return a};return r(t)};});var Pg=T((rL,Ig)=>{Ig.exports=function(t){return typeof t=="number"?t-t===0:typeof t=="string"&&t.trim()!==""?Number.isFinite?Number.isFinite(+t):isFinite(+t):!1};});var qg=T((nL,Dg)=>{var Og=Pg(),er=(t,e,r)=>{if(Og(t)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||t===e)return String(t);if(Og(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),a=String(n.wrap),c=t+":"+e+"="+s+i+o+a;if(er.cache.hasOwnProperty(c))return er.cache[c].result;let d=Math.min(t,e),u=Math.max(t,e);if(Math.abs(d-u)===1){let v=t+"|"+e;return n.capture?`(${v})`:n.wrap===!1?v:`(?:${v})`}let p=Lg(t)||Lg(e),_={min:t,max:e,a:d,b:u},m=[],y=[];if(p&&(_.isPadded=p,_.maxLen=String(_.max).length),d<0){let v=u<0?Math.abs(u):1;y=Mg(v,Math.abs(d),_,n),d=_.a=0;}return u>=0&&(m=Mg(d,u,_,n)),_.negatives=y,_.positives=m,_.result=v1(y,m),n.capture===!0?_.result=`(${_.result})`:n.wrap!==!1&&m.length+y.length>1&&(_.result=`(?:${_.result})`),er.cache[c]=_,_.result};function v1(t,e,r){let n=Ya(t,e,"-",!1)||[],s=Ya(e,t,"",!1)||[],i=Ya(t,e,"-?",!0)||[];return n.concat(i).concat(s).join("|")}function S1(t,e){let r=1,n=1,s=Ng(t,r),i=new Set([e]);for(;t<=s&&s<=e;)i.add(s),r+=1,s=Ng(t,r);for(s=kg(e+1,n)-1;t<s&&s<=e;)i.add(s),n+=1,s=kg(e+1,n)-1;return i=[...i],i.sort(x1),i}function E1(t,e,r){if(t===e)return {pattern:t,count:[],digits:0};let n=A1(t,e),s=n.length,i="",o=0;for(let a=0;a<s;a++){let[c,d]=n[a];c===d?i+=c:c!=="0"||d!=="9"?i+=C1(c,d):o++;}return o&&(i+=r.shorthand===!0?"\\d":"[0-9]"),{pattern:i,count:[o],digits:s}}function Mg(t,e,r,n){let s=S1(t,e),i=[],o=t,a;for(let c=0;c<s.length;c++){let d=s[c],u=E1(String(o),String(d),n),p="";if(!r.isPadded&&a&&a.pattern===u.pattern){a.count.length>1&&a.count.pop(),a.count.push(u.count[0]),a.string=a.pattern+$g(a.count),o=d+1;continue}r.isPadded&&(p=R1(d,r,n)),u.string=p+u.pattern+$g(u.count),i.push(u),o=d+1,a=u;}return i}function Ya(t,e,r,n,s){let i=[];for(let o of t){let{string:a}=o;!n&&!Fg(e,"string",a)&&i.push(r+a),n&&Fg(e,"string",a)&&i.push(r+a);}return i}function A1(t,e){let r=[];for(let n=0;n<t.length;n++)r.push([t[n],e[n]]);return r}function x1(t,e){return t>e?1:e>t?-1:0}function Fg(t,e,r){return t.some(n=>n[e]===r)}function Ng(t,e){return Number(String(t).slice(0,-e)+"9".repeat(e))}function kg(t,e){return t-t%Math.pow(10,e)}function $g(t){let[e=0,r=""]=t;return r||e>1?`{${e+(r?","+r:"")}}`:""}function C1(t,e,r){return `[${t}${e-t===1?"":"-"}${e}]`}function Lg(t){return /^-?(0+)\d/.test(t)}function R1(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}}`}}er.cache={};er.clearCache=()=>er.cache={};Dg.exports=er;});var Qa=T((iL,Vg)=>{var T1=G("util"),Hg=qg(),Bg=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),I1=t=>e=>t===!0?Number(e):String(e),Ja=t=>typeof t=="number"||typeof t=="string"&&t!=="",vn=t=>Number.isInteger(+t),Xa=t=>{let e=`${t}`,r=-1;if(e[0]==="-"&&(e=e.slice(1)),e==="0")return !1;for(;e[++r]==="0";);return r>0},P1=(t,e,r)=>typeof t=="string"||typeof e=="string"?!0:r.stringify===!0,O1=(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},Ug=(t,e)=>{let r=t[0]==="-"?"-":"";for(r&&(t=t.slice(1),e--);t.length<e;)t="0"+t;return r?"-"+t:t},M1=(t,e)=>{t.negatives.sort((o,a)=>o<a?-1:o>a?1:0),t.positives.sort((o,a)=>o<a?-1:o>a?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},jg=(t,e,r,n)=>{if(r)return Hg(t,e,{wrap:!1,...n});let s=String.fromCharCode(t);if(t===e)return s;let i=String.fromCharCode(e);return `[${s}-${i}]`},Wg=(t,e,r)=>{if(Array.isArray(t)){let n=r.wrap===!0,s=r.capture?"":"?:";return n?`(${s}${t.join("|")})`:t.join("|")}return Hg(t,e,r)},zg=(...t)=>new RangeError("Invalid range arguments: "+T1.inspect(...t)),Gg=(t,e,r)=>{if(r.strictRanges===!0)throw zg([t,e]);return []},F1=(t,e)=>{if(e.strictRanges===!0)throw new TypeError(`Expected step "${t}" to be a number`);return []},N1=(t,e,r=1,n={})=>{let s=Number(t),i=Number(e);if(!Number.isInteger(s)||!Number.isInteger(i)){if(n.strictRanges===!0)throw zg([t,e]);return []}s===0&&(s=0),i===0&&(i=0);let o=s>i,a=String(t),c=String(e),d=String(r);r=Math.max(Math.abs(r),1);let u=Xa(a)||Xa(c)||Xa(d),p=u?Math.max(a.length,c.length,d.length):0,_=u===!1&&P1(t,e,n)===!1,m=n.transform||I1(_);if(n.toRegex&&r===1)return jg(Ug(t,p),Ug(e,p),!0,n);let y={negatives:[],positives:[]},v=w=>y[w<0?"negatives":"positives"].push(Math.abs(w)),E=[],A=0;for(;o?s>=i:s<=i;)n.toRegex===!0&&r>1?v(s):E.push(O1(m(s,A),p,_)),s=o?s-r:s+r,A++;return n.toRegex===!0?r>1?M1(y,n):Wg(E,null,{wrap:!1,...n}):E},k1=(t,e,r=1,n={})=>{if(!vn(t)&&t.length>1||!vn(e)&&e.length>1)return Gg(t,e,n);let s=n.transform||(_=>String.fromCharCode(_)),i=`${t}`.charCodeAt(0),o=`${e}`.charCodeAt(0),a=i>o,c=Math.min(i,o),d=Math.max(i,o);if(n.toRegex&&r===1)return jg(c,d,!1,n);let u=[],p=0;for(;a?i>=o:i<=o;)u.push(s(i,p)),i=a?i-r:i+r,p++;return n.toRegex===!0?Wg(u,null,{wrap:!1,options:n}):u},Qi=(t,e,r,n={})=>{if(e==null&&Ja(t))return [t];if(!Ja(t)||!Ja(e))return Gg(t,e,n);if(typeof r=="function")return Qi(t,e,1,{transform:r});if(Bg(r))return Qi(t,e,0,r);let s={...n};return s.capture===!0&&(s.wrap=!0),r=r||s.step||1,vn(r)?vn(t)&&vn(e)?N1(t,e,r,s):k1(t,e,Math.max(Math.abs(r),1),s):r!=null&&!Bg(r)?F1(r,s):Qi(t,e,1,r)};Vg.exports=Qi;});var Yg=T((sL,Zg)=>{var $1=Qa(),Kg=Ji(),L1=(t,e={})=>{let r=(n,s={})=>{let i=Kg.isInvalidBrace(s),o=n.invalid===!0&&e.escapeInvalid===!0,a=i===!0||o===!0,c=e.escapeInvalid===!0?"\\":"",d="";if(n.isOpen===!0||n.isClose===!0)return c+n.value;if(n.type==="open")return a?c+n.value:"(";if(n.type==="close")return a?c+n.value:")";if(n.type==="comma")return n.prev.type==="comma"?"":a?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){let u=Kg.reduce(n.nodes),p=$1(...u,{...e,wrap:!1,toRegex:!0});if(p.length!==0)return u.length>1&&p.length>1?`(${p})`:p}if(n.nodes)for(let u of n.nodes)d+=r(u,n);return d};return r(t)};Zg.exports=L1;});var Qg=T((oL,Xg)=>{var D1=Qa(),Jg=Xi(),Pr=Ji(),tr=(t="",e="",r=!1)=>{let n=[];if(t=[].concat(t),e=[].concat(e),!e.length)return t;if(!t.length)return r?Pr.flatten(e).map(s=>`{${s}}`):e;for(let s of t)if(Array.isArray(s))for(let i of s)n.push(tr(i,e,r));else for(let i of e)r===!0&&typeof i=="string"&&(i=`{${i}}`),n.push(Array.isArray(i)?tr(s,i,r):s+i);return Pr.flatten(n)},q1=(t,e={})=>{let r=e.rangeLimit===void 0?1e3:e.rangeLimit,n=(s,i={})=>{s.queue=[];let o=i,a=i.queue;for(;o.type!=="brace"&&o.type!=="root"&&o.parent;)o=o.parent,a=o.queue;if(s.invalid||s.dollar){a.push(tr(a.pop(),Jg(s,e)));return}if(s.type==="brace"&&s.invalid!==!0&&s.nodes.length===2){a.push(tr(a.pop(),["{}"]));return}if(s.nodes&&s.ranges>0){let p=Pr.reduce(s.nodes);if(Pr.exceedsLimit(...p,e.step,r))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let _=D1(...p,e);_.length===0&&(_=Jg(s,e)),a.push(tr(a.pop(),_)),s.nodes=[];return}let c=Pr.encloseBrace(s),d=s.queue,u=s;for(;u.type!=="brace"&&u.type!=="root"&&u.parent;)u=u.parent,d=u.queue;for(let p=0;p<s.nodes.length;p++){let _=s.nodes[p];if(_.type==="comma"&&s.type==="brace"){p===1&&d.push(""),d.push("");continue}if(_.type==="close"){a.push(tr(a.pop(),d,c));continue}if(_.value&&_.type!=="open"){d.push(tr(d.pop(),_.value));continue}_.nodes&&n(_,s);}return d};return Pr.flatten(n(t))};Xg.exports=q1;});var ty=T((aL,ey)=>{ey.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 oy=T((lL,sy)=>{var B1=Xi(),{MAX_LENGTH:ry,CHAR_BACKSLASH:el,CHAR_BACKTICK:U1,CHAR_COMMA:H1,CHAR_DOT:j1,CHAR_LEFT_PARENTHESES:W1,CHAR_RIGHT_PARENTHESES:z1,CHAR_LEFT_CURLY_BRACE:G1,CHAR_RIGHT_CURLY_BRACE:V1,CHAR_LEFT_SQUARE_BRACKET:ny,CHAR_RIGHT_SQUARE_BRACKET:iy,CHAR_DOUBLE_QUOTE:K1,CHAR_SINGLE_QUOTE:Z1,CHAR_NO_BREAK_SPACE:Y1,CHAR_ZERO_WIDTH_NOBREAK_SPACE:J1}=ty(),X1=(t,e={})=>{if(typeof t!="string")throw new TypeError("Expected a string");let r=e||{},n=typeof r.maxLength=="number"?Math.min(ry,r.maxLength):ry;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,a=s,c=0,d=t.length,u=0,p=0,_,y=()=>t[u++],v=E=>{if(E.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&E.type==="text"){a.value+=E.value;return}return o.nodes.push(E),E.parent=o,E.prev=a,a=E,E};for(v({type:"bos"});u<d;)if(o=i[i.length-1],_=y(),!(_===J1||_===Y1)){if(_===el){v({type:"text",value:(e.keepEscaping?_:"")+y()});continue}if(_===iy){v({type:"text",value:"\\"+_});continue}if(_===ny){c++;let A;for(;u<d&&(A=y());){if(_+=A,A===ny){c++;continue}if(A===el){_+=y();continue}if(A===iy&&(c--,c===0))break}v({type:"text",value:_});continue}if(_===W1){o=v({type:"paren",nodes:[]}),i.push(o),v({type:"text",value:_});continue}if(_===z1){if(o.type!=="paren"){v({type:"text",value:_});continue}o=i.pop(),v({type:"text",value:_}),o=i[i.length-1];continue}if(_===K1||_===Z1||_===U1){let E=_,A;for(e.keepQuotes!==!0&&(_="");u<d&&(A=y());){if(A===el){_+=A+y();continue}if(A===E){e.keepQuotes===!0&&(_+=A);break}_+=A;}v({type:"text",value:_});continue}if(_===G1){p++;let A={type:"brace",open:!0,close:!1,dollar:a.value&&a.value.slice(-1)==="$"||o.dollar===!0,depth:p,commas:0,ranges:0,nodes:[]};o=v(A),i.push(o),v({type:"open",value:_});continue}if(_===V1){if(o.type!=="brace"){v({type:"text",value:_});continue}let E="close";o=i.pop(),o.close=!0,v({type:E,value:_}),p--,o=i[i.length-1];continue}if(_===H1&&p>0){if(o.ranges>0){o.ranges=0;let E=o.nodes.shift();o.nodes=[E,{type:"text",value:B1(o)}];}v({type:"comma",value:_}),o.commas++;continue}if(_===j1&&p>0&&o.commas===0){let E=o.nodes;if(p===0||E.length===0){v({type:"text",value:_});continue}if(a.type==="dot"){if(o.range=[],a.value+=_,a.type="range",o.nodes.length!==3&&o.nodes.length!==5){o.invalid=!0,o.ranges=0,a.type="text";continue}o.ranges++,o.args=[];continue}if(a.type==="range"){E.pop();let A=E[E.length-1];A.value+=a.value+_,a=A,o.ranges--;continue}v({type:"dot",value:_});continue}v({type:"text",value:_});}do if(o=i.pop(),o.type!=="root"){o.nodes.forEach(w=>{w.nodes||(w.type==="open"&&(w.isOpen=!0),w.type==="close"&&(w.isClose=!0),w.nodes||(w.type="text"),w.invalid=!0);});let E=i[i.length-1],A=E.nodes.indexOf(o);E.nodes.splice(A,1,...o.nodes);}while(i.length>0);return v({type:"eos"}),s};sy.exports=X1;});var uy=T((uL,ly)=>{var ay=Xi(),Q1=Yg(),eI=Qg(),tI=oy(),Ze=(t,e={})=>{let r=[];if(Array.isArray(t))for(let n of t){let s=Ze.create(n,e);Array.isArray(s)?r.push(...s):r.push(s);}else r=[].concat(Ze.create(t,e));return e&&e.expand===!0&&e.nodupes===!0&&(r=[...new Set(r)]),r};Ze.parse=(t,e={})=>tI(t,e);Ze.stringify=(t,e={})=>ay(typeof t=="string"?Ze.parse(t,e):t,e);Ze.compile=(t,e={})=>(typeof t=="string"&&(t=Ze.parse(t,e)),Q1(t,e));Ze.expand=(t,e={})=>{typeof t=="string"&&(t=Ze.parse(t,e));let r=eI(t,e);return e.noempty===!0&&(r=r.filter(Boolean)),e.nodupes===!0&&(r=[...new Set(r)]),r};Ze.create=(t,e={})=>t===""||t.length<3?[t]:e.expand!==!0?Ze.compile(t,e):Ze.expand(t,e);ly.exports=Ze;});var cy=T((cL,rI)=>{rI.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 hy=T((fL,fy)=>{fy.exports=cy();});var py=T((hL,dy)=>{var nI=G("path"),iI=hy(),sI=new Set(iI);dy.exports=t=>sI.has(nI.extname(t).slice(1).toLowerCase());});var es=T(ee=>{var{sep:oI}=G("path"),{platform:tl}=process,aI=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=`.${oI}`;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=tl==="win32";ee.isMacos=tl==="darwin";ee.isLinux=tl==="linux";ee.isIBMi=aI.type()==="OS400";});var by=T((pL,wy)=>{var vt=G("fs"),Ae=G("path"),{promisify:xn}=G("util"),lI=py(),{isWindows:uI,isLinux:cI,EMPTY_FN:fI,EMPTY_STR:hI,KEY_LISTENERS:Or,KEY_ERR:rl,KEY_RAW:Sn,HANDLER_KEYS:dI,EV_CHANGE:rs,EV_ADD:ts,EV_ADD_DIR:pI,EV_ERROR:_y,STR_DATA:mI,STR_END:_I,BRACE_START:gI,STAR:yI}=es(),wI="watch",bI=xn(vt.open),gy=xn(vt.stat),vI=xn(vt.lstat),SI=xn(vt.close),nl=xn(vt.realpath),EI={lstat:vI,stat:gy},sl=(t,e)=>{t instanceof Set?t.forEach(e):e(t);},En=(t,e,r)=>{let n=t[e];n instanceof Set||(t[e]=n=new Set([n])),n.add(r);},AI=t=>e=>{let r=t[e];r instanceof Set?r.clear():delete t[e];},An=(t,e,r)=>{let n=t[e];n instanceof Set?n.delete(r):n===r&&delete t[e];},yy=t=>t instanceof Set?t.size===0:!t,ns=new Map;function my(t,e,r,n,s){let i=(o,a)=>{r(t),s(o,a,{watchedPath:t}),a&&t!==a&&is(Ae.resolve(t,a),Or,Ae.join(t,a));};try{return vt.watch(t,e,i)}catch(o){n(o);}}var is=(t,e,r,n,s)=>{let i=ns.get(t);i&&sl(i[e],o=>{o(r,n,s);});},xI=(t,e,r,n)=>{let{listener:s,errHandler:i,rawEmitter:o}=n,a=ns.get(e),c;if(!r.persistent)return c=my(t,r,s,i,o),c.close.bind(c);if(a)En(a,Or,s),En(a,rl,i),En(a,Sn,o);else {if(c=my(t,r,is.bind(null,e,Or),i,is.bind(null,e,Sn)),!c)return;c.on(_y,async d=>{let u=is.bind(null,e,rl);if(a.watcherUnusable=!0,uI&&d.code==="EPERM")try{let p=await bI(t,"r");await SI(p),u(d);}catch{}else u(d);}),a={listeners:s,errHandlers:i,rawEmitters:o,watcher:c},ns.set(e,a);}return ()=>{An(a,Or,s),An(a,rl,i),An(a,Sn,o),yy(a.listeners)&&(a.watcher.close(),ns.delete(e),dI.forEach(AI(a)),a.watcher=void 0,Object.freeze(a));}},il=new Map,CI=(t,e,r,n)=>{let {listener:s,rawEmitter:i}=n,o=il.get(e),d=o&&o.options;return d&&(d.persistent<r.persistent||d.interval>r.interval)&&(vt.unwatchFile(e),o=void 0),o?(En(o,Or,s),En(o,Sn,i)):(o={listeners:s,rawEmitters:i,options:r,watcher:vt.watchFile(e,r,(u,p)=>{sl(o.rawEmitters,m=>{m(rs,e,{curr:u,prev:p});});let _=u.mtimeMs;(u.size!==p.size||_>p.mtimeMs||_===0)&&sl(o.listeners,m=>m(t,u));})},il.set(e,o)),()=>{An(o,Or,s),An(o,Sn,i),yy(o.listeners)&&(il.delete(e),vt.unwatchFile(e),o.options=o.watcher=void 0,Object.freeze(o));}},ol=class{constructor(e){this.fsw=e,this._boundHandleError=r=>e._handleError(r);}_watchWithNodeFs(e,r){let n=this.fsw.options,s=Ae.dirname(e),i=Ae.basename(e);this.fsw._getWatchedDir(s).add(i);let a=Ae.resolve(e),c={persistent:n.persistent};r||(r=fI);let d;return n.usePolling?(c.interval=n.enableBinaryInterval&&lI(i)?n.binaryInterval:n.interval,d=CI(e,a,c,{listener:r,rawEmitter:this.fsw._emitRaw})):d=xI(e,a,c,{listener:r,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw}),d}_handleFile(e,r,n){if(this.fsw.closed)return;let s=Ae.dirname(e),i=Ae.basename(e),o=this.fsw._getWatchedDir(s),a=r;if(o.has(i))return;let c=async(u,p)=>{if(this.fsw._throttle(wI,e,5)){if(!p||p.mtimeMs===0)try{let _=await gy(e);if(this.fsw.closed)return;let m=_.atimeMs,y=_.mtimeMs;(!m||m<=y||y!==a.mtimeMs)&&this.fsw._emit(rs,e,_),cI&&a.ino!==_.ino?(this.fsw._closeFile(u),a=_,this.fsw._addPathCloser(u,this._watchWithNodeFs(e,c))):a=_;}catch{this.fsw._remove(s,i);}else if(o.has(i)){let _=p.atimeMs,m=p.mtimeMs;(!_||_<=m||m!==a.mtimeMs)&&this.fsw._emit(rs,e,p),a=p;}}},d=this._watchWithNodeFs(e,c);if(!(n&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(ts,e,0))return;this.fsw._emit(ts,e,r);}return d}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 a;try{a=await nl(n);}catch{return this.fsw._emitReady(),!0}return this.fsw.closed?void 0:(o.has(s)?this.fsw._symlinkPaths.get(i)!==a&&(this.fsw._symlinkPaths.set(i,a),this.fsw._emit(rs,n,e.stats)):(o.add(s),this.fsw._symlinkPaths.set(i,a),this.fsw._emit(ts,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,a){if(e=Ae.join(e,hI),!n.hasGlob&&(a=this.fsw._throttle("readdir",e,1e3),!a))return;let c=this.fsw._getWatchedDir(n.path),d=new Set,u=this.fsw._readdirp(e,{fileFilter:p=>n.filterPath(p),directoryFilter:p=>n.filterDir(p),depth:0}).on(mI,async p=>{if(this.fsw.closed){u=void 0;return}let _=p.path,m=Ae.join(e,_);if(d.add(_),!(p.stats.isSymbolicLink()&&await this._handleSymlink(p,e,m,_))){if(this.fsw.closed){u=void 0;return}(_===s||!s&&!c.has(_))&&(this.fsw._incrReadyCount(),m=Ae.join(i,Ae.relative(i,m)),this._addToNodeFs(m,r,n,o+1));}}).on(_y,this._boundHandleError);return new Promise(p=>u.once(_I,()=>{if(this.fsw.closed){u=void 0;return}let _=a?a.clear():!1;p(),c.getChildren().filter(m=>m!==e&&!d.has(m)&&(!n.hasGlob||n.filterPath({fullPath:Ae.resolve(e,m)}))).forEach(m=>{this.fsw._remove(e,m);}),u=void 0,_&&this._handleRead(e,!1,n,s,i,o,a);}))}async _handleDir(e,r,n,s,i,o,a){let c=this.fsw._getWatchedDir(Ae.dirname(e)),d=c.has(Ae.basename(e));!(n&&this.fsw.options.ignoreInitial)&&!i&&!d&&(!o.hasGlob||o.globFilter(e))&&this.fsw._emit(pI,e,r),c.add(Ae.basename(e)),this.fsw._getWatchedDir(e);let u,p,_=this.fsw.options.depth;if((_==null||s<=_)&&!this.fsw._symlinkPaths.has(a)){if(!i&&(await this._handleRead(e,n,o,i,e,s,u),this.fsw.closed))return;p=this._watchWithNodeFs(e,(m,y)=>{y&&y.mtimeMs===0||this._handleRead(m,!1,o,i,e,s,u);});}return p}async _addToNodeFs(e,r,n,s,i){let o=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return o(),!1;let a=this.fsw._getWatchHelpers(e,s);!a.hasGlob&&n&&(a.hasGlob=n.hasGlob,a.globFilter=n.globFilter,a.filterPath=c=>n.filterPath(c),a.filterDir=c=>n.filterDir(c));try{let c=await EI[a.statMethod](a.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(a.watchPath,c))return o(),!1;let d=this.fsw.options.followSymlinks&&!e.includes(yI)&&!e.includes(gI),u;if(c.isDirectory()){let p=Ae.resolve(e),_=d?await nl(e):e;if(this.fsw.closed||(u=await this._handleDir(a.watchPath,c,r,s,i,a,_),this.fsw.closed))return;p!==_&&_!==void 0&&this.fsw._symlinkPaths.set(p,_);}else if(c.isSymbolicLink()){let p=d?await nl(e):e;if(this.fsw.closed)return;let _=Ae.dirname(a.watchPath);if(this.fsw._getWatchedDir(_).add(a.watchPath),this.fsw._emit(ts,a.watchPath,c),u=await this._handleDir(_,c,r,s,e,a,p),this.fsw.closed)return;p!==void 0&&this.fsw._symlinkPaths.set(Ae.resolve(e),p);}else u=this._handleFile(a.watchPath,c,r);return o(),this.fsw._addPathCloser(e,u),!1}catch(c){if(this.fsw._handleError(c))return o(),e}}};wy.exports=ol;});var Ry=T((mL,pl)=>{var hl=G("fs"),xe=G("path"),{promisify:dl}=G("util"),Mr;try{Mr=G("fsevents");}catch(t){process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR&&console.error(t);}if(Mr){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&&(Mr=void 0);}}var{EV_ADD:al,EV_CHANGE:RI,EV_ADD_DIR:vy,EV_UNLINK:ss,EV_ERROR:TI,STR_DATA:II,STR_END:PI,FSEVENT_CREATED:OI,FSEVENT_MODIFIED:MI,FSEVENT_DELETED:FI,FSEVENT_MOVED:NI,FSEVENT_UNKNOWN:kI,FSEVENT_TYPE_FILE:$I,FSEVENT_TYPE_DIRECTORY:Cn,FSEVENT_TYPE_SYMLINK:Cy,ROOT_GLOBSTAR:Sy,DIR_SUFFIX:LI,DOT_SLASH:Ey,FUNCTION_TYPE:ll,EMPTY_FN:DI,IDENTITY_FN:qI}=es(),BI=t=>isNaN(t)?{}:{depth:t},cl=dl(hl.stat),UI=dl(hl.lstat),Ay=dl(hl.realpath),HI={stat:cl,lstat:UI},rr=new Map,jI=10,WI=new Set([69888,70400,71424,72704,73472,131328,131840,262912]),zI=(t,e)=>({stop:Mr.watch(t,e)});function GI(t,e,r,n){let s=xe.extname(e)?xe.dirname(e):e,i=xe.dirname(s),o=rr.get(s);VI(i)&&(s=i);let a=xe.resolve(t),c=a!==e,d=(p,_,m)=>{c&&(p=p.replace(e,a)),(p===a||!p.indexOf(a+xe.sep))&&r(p,_,m);},u=!1;for(let p of rr.keys())if(e.indexOf(xe.resolve(p)+xe.sep)===0){s=p,o=rr.get(s),u=!0;break}return o||u?o.listeners.add(d):(o={listeners:new Set([d]),rawEmitter:n,watcher:zI(s,(p,_)=>{if(!o.listeners.size)return;let m=Mr.getInfo(p,_);o.listeners.forEach(y=>{y(p,_,m);}),o.rawEmitter(m.event,p,m);})},rr.set(s,o)),()=>{let p=o.listeners;if(p.delete(d),!p.size&&(rr.delete(s),o.watcher))return o.watcher.stop().then(()=>{o.rawEmitter=o.watcher=void 0,Object.freeze(o);})}}var VI=t=>{let e=0;for(let r of rr.keys())if(r.indexOf(t)===0&&(e++,e>=jI))return !0;return !1},KI=()=>Mr&&rr.size<128,ul=(t,e)=>{let r=0;for(;!t.indexOf(e)&&(t=xe.dirname(t))!==e;)r++;return r},xy=(t,e)=>t.type===Cn&&e.isDirectory()||t.type===Cy&&e.isSymbolicLink()||t.type===$I&&e.isFile(),fl=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+Sy),!0;n.delete(e),n.delete(e+Sy);}addOrChange(e,r,n,s,i,o,a,c){let d=i.has(o)?RI:al;this.handleEvent(d,e,r,n,s,i,o,a,c);}async checkExists(e,r,n,s,i,o,a,c){try{let d=await cl(e);if(this.fsw.closed)return;xy(a,d)?this.addOrChange(e,r,n,s,i,o,a,c):this.handleEvent(ss,e,r,n,s,i,o,a,c);}catch(d){d.code==="EACCES"?this.addOrChange(e,r,n,s,i,o,a,c):this.handleEvent(ss,e,r,n,s,i,o,a,c);}}handleEvent(e,r,n,s,i,o,a,c,d){if(!(this.fsw.closed||this.checkIgnored(r)))if(e===ss){let u=c.type===Cn;(u||o.has(a))&&this.fsw._remove(i,a,u);}else {if(e===al){if(c.type===Cn&&this.fsw._getWatchedDir(r),c.type===Cy&&d.followSymlinks){let p=d.depth===void 0?void 0:ul(n,s)+1;return this._addToFsEvents(r,!1,!0,p)}this.fsw._getWatchedDir(i).add(a);}let u=c.type===Cn?e+LI:e;this.fsw._emit(u,r),u===vy&&this._addToFsEvents(r,!1,!0);}}_watchWithFsEvents(e,r,n,s){if(this.fsw.closed||this.fsw._isIgnored(e))return;let i=this.fsw.options,a=GI(e,r,async(c,d,u)=>{if(this.fsw.closed||i.depth!==void 0&&ul(c,r)>i.depth)return;let p=n(xe.join(e,xe.relative(e,c)));if(s&&!s(p))return;let _=xe.dirname(p),m=xe.basename(p),y=this.fsw._getWatchedDir(u.type===Cn?p:_);if(WI.has(d)||u.event===kI)if(typeof i.ignored===ll){let v;try{v=await cl(p);}catch{}if(this.fsw.closed||this.checkIgnored(p,v))return;xy(u,v)?this.addOrChange(p,c,r,_,y,m,u,i):this.handleEvent(ss,p,c,r,_,y,m,u,i);}else this.checkExists(p,c,r,_,y,m,u,i);else switch(u.event){case OI:case MI:return this.addOrChange(p,c,r,_,y,m,u,i);case FI:case NI:return this.checkExists(p,c,r,_,y,m,u,i)}},this.fsw._emitRaw);return this.fsw._emitReady(),a}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 Ay(e);if(this.fsw.closed)return;if(this.fsw._isIgnored(i))return this.fsw._emitReady();this.fsw._incrReadyCount(),this._addToFsEvents(i||e,o=>{let a=e;return i&&i!==Ey?a=o.replace(i,e):o!==Ey&&(a=xe.join(e,o)),n(a)},!1,s);}catch(i){if(this.fsw._handleError(i))return this.fsw._emitReady()}}}emitAdd(e,r,n,s,i){let o=n(e),a=r.isDirectory(),c=this.fsw._getWatchedDir(xe.dirname(o)),d=xe.basename(o);a&&this.fsw._getWatchedDir(o),!c.has(d)&&(c.add(d),(!s.ignoreInitial||i===!0)&&this.fsw._emit(a?vy:al,o,r));}initWatch(e,r,n,s){if(this.fsw.closed)return;let i=this._watchWithFsEvents(n.watchPath,xe.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===ll?r:qI,a=this.fsw._getWatchHelpers(e);try{let c=await HI[a.statMethod](a.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(a.watchPath,c))throw null;if(c.isDirectory()){if(a.globFilter||this.emitAdd(o(e),c,o,i,n),s&&s>i.depth)return;this.fsw._readdirp(a.watchPath,{fileFilter:d=>a.filterPath(d),directoryFilter:d=>a.filterDir(d),...BI(i.depth-(s||0))}).on(II,d=>{if(this.fsw.closed||d.stats.isDirectory()&&!a.filterPath(d))return;let u=xe.join(a.watchPath,d.path),{fullPath:p}=d;if(a.followSymlinks&&d.stats.isSymbolicLink()){let _=i.depth===void 0?void 0:ul(u,xe.resolve(a.watchPath))+1;this._handleFsEventsSymlink(u,p,o,_);}else this.emitAdd(u,d.stats,o,i,n);}).on(TI,DI).on(PI,()=>{this.fsw._emitReady();});}else this.emitAdd(a.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===ll)this.initWatch(void 0,e,a,o);else {let c;try{c=await Ay(a.watchPath);}catch{}this.initWatch(c,e,a,o);}}};pl.exports=fl;pl.exports.canUse=KI;});var Pl=T(Il=>{var{EventEmitter:ZI}=G("events"),Rl=G("fs"),fe=G("path"),{promisify:Ny}=G("util"),YI=dg(),bl=bg().default,JI=Cg(),ml=Ka(),XI=uy(),QI=Ga(),eP=by(),Ty=Ry(),{EV_ALL:_l,EV_READY:tP,EV_ADD:os,EV_CHANGE:Rn,EV_UNLINK:Iy,EV_ADD_DIR:rP,EV_UNLINK_DIR:nP,EV_RAW:iP,EV_ERROR:gl,STR_CLOSE:sP,STR_END:oP,BACK_SLASH_RE:aP,DOUBLE_SLASH_RE:Py,SLASH_OR_BACK_SLASH_RE:lP,DOT_RE:uP,REPLACER_RE:cP,SLASH:yl,SLASH_SLASH:fP,BRACE_START:hP,BANG:vl,ONE_DOT:ky,TWO_DOTS:dP,GLOBSTAR:pP,SLASH_GLOBSTAR:wl,ANYMATCH_OPTS:Sl,STRING_TYPE:Tl,FUNCTION_TYPE:mP,EMPTY_STR:El,EMPTY_FN:_P,isWindows:gP,isMacos:yP,isIBMi:wP}=es(),bP=Ny(Rl.stat),vP=Ny(Rl.readdir),Al=(t=[])=>Array.isArray(t)?t:[t],$y=(t,e=[])=>(t.forEach(r=>{Array.isArray(r)?$y(r,e):e.push(r);}),e),Oy=t=>{let e=$y(Al(t));if(!e.every(r=>typeof r===Tl))throw new TypeError(`Non-string provided as watch path: ${e}`);return e.map(Ly)},My=t=>{let e=t.replace(aP,yl),r=!1;for(e.startsWith(fP)&&(r=!0);e.match(Py);)e=e.replace(Py,yl);return r&&(e=yl+e),e},Ly=t=>My(fe.normalize(My(t))),Fy=(t=El)=>e=>typeof e!==Tl?e:Ly(fe.isAbsolute(e)?e:fe.join(t,e)),SP=(t,e)=>fe.isAbsolute(t)?t:t.startsWith(vl)?vl+fe.join(e,t.slice(1)):fe.join(e,t),at=(t,e)=>t[e]===void 0,xl=class{constructor(e,r){this.path=e,this._removeWatcher=r,this.items=new Set;}add(e){let{items:r}=this;r&&e!==ky&&e!==dP&&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 vP(n);}catch{this._removeWatcher&&this._removeWatcher(fe.dirname(n),fe.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);}},EP="stat",AP="lstat",Cl=class{constructor(e,r,n,s){this.fsw=s,this.path=e=e.replace(cP,El),this.watchPath=r,this.fullWatchPath=fe.resolve(r),this.hasGlob=r!==e,e===El&&(this.hasGlob=!1),this.globSymlink=this.hasGlob&&n?void 0:!1,this.globFilter=this.hasGlob?bl(e,void 0,Sl):!1,this.dirParts=this.getDirParts(e),this.dirParts.forEach(i=>{i.length>1&&i.pop();}),this.followSymlinks=n,this.statMethod=n?EP:AP;}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 fe.join(this.watchPath,fe.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===mP?this.globFilter(n):!0)&&this.fsw._isntIgnored(n,r)&&this.fsw._hasReadPermissions(r)}getDirParts(e){if(!this.hasGlob)return [];let r=[];return (e.includes(hP)?XI.expand(e):[e]).forEach(s=>{r.push(fe.relative(this.watchPath,s).split(lP));}),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===pP&&(n=!0),n||!r[0][o]||bl(i,r[0][o],Sl))));}return !this.unmatchedGlob&&this.fsw._isntIgnored(this.entryPath(e),e.stats)}},as=class extends ZI{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,at(r,"persistent")&&(r.persistent=!0),at(r,"ignoreInitial")&&(r.ignoreInitial=!1),at(r,"ignorePermissionErrors")&&(r.ignorePermissionErrors=!1),at(r,"interval")&&(r.interval=100),at(r,"binaryInterval")&&(r.binaryInterval=300),at(r,"disableGlobbing")&&(r.disableGlobbing=!1),r.enableBinaryInterval=r.binaryInterval!==r.interval,at(r,"useFsEvents")&&(r.useFsEvents=!r.usePolling),Ty.canUse()||(r.useFsEvents=!1),at(r,"usePolling")&&!r.useFsEvents&&(r.usePolling=yP),wP&&(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)),at(r,"atomic")&&(r.atomic=!r.usePolling&&!r.useFsEvents),r.atomic&&(this._pendingUnlinks=new Map),at(r,"followSymlinks")&&(r.followSymlinks=!0),at(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=Al(r.ignored));let a=0;this._emitReady=()=>{a++,a>=this._readyCount&&(this._emitReady=_P,this._readyEmitted=!0,process.nextTick(()=>this.emit(tP)));},this._emitRaw=(...c)=>this.emit(iP,...c),this._readyEmitted=!1,this.options=r,r.useFsEvents?this._fsEventsHandler=new Ty(this):this._nodeFsHandler=new eP(this),Object.freeze(r);}add(e,r,n){let{cwd:s,disableGlobbing:i}=this.options;this.closed=!1;let o=Oy(e);return s&&(o=o.map(a=>{let c=SP(a,s);return i||!ml(a)?c:QI(c)})),o=o.filter(a=>a.startsWith(vl)?(this._ignoredPaths.add(a.slice(1)),!1):(this._ignoredPaths.delete(a),this._ignoredPaths.delete(a+wl),this._userIgnored=void 0,!0)),this.options.useFsEvents&&this._fsEventsHandler?(this._readyCount||(this._readyCount=o.length),this.options.persistent&&(this._readyCount*=2),o.forEach(a=>this._fsEventsHandler._addToFsEvents(a))):(this._readyCount||(this._readyCount=0),this._readyCount+=o.length,Promise.all(o.map(async a=>{let c=await this._nodeFsHandler._addToNodeFs(a,!n,0,0,r);return c&&this._emitReady(),c})).then(a=>{this.closed||a.filter(c=>c).forEach(c=>{this.add(fe.dirname(c),fe.basename(r||c));});})),this}unwatch(e){if(this.closed)return this;let r=Oy(e),{cwd:n}=this.options;return r.forEach(s=>{!fe.isAbsolute(s)&&!this._closers.has(s)&&(n&&(s=fe.join(n,s)),s=fe.resolve(s)),this._closePath(s),this._ignoredPaths.add(s),this._watched.has(s)&&this._ignoredPaths.add(s+wl),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?fe.relative(this.options.cwd,n):n;e[s||ky]=r.getChildren().sort();}),e}emitWithAll(e,r){this.emit(...r),e!==gl&&this.emit(_l,...r);}async _emit(e,r,n,s,i){if(this.closed)return;let o=this.options;gP&&(r=fe.normalize(r)),o.cwd&&(r=fe.relative(o.cwd,r));let a=[e,r];i!==void 0?a.push(n,s,i):s!==void 0?a.push(n,s):n!==void 0&&a.push(n);let c=o.awaitWriteFinish,d;if(c&&(d=this._pendingWrites.get(r)))return d.lastChange=new Date,this;if(o.atomic){if(e===Iy)return this._pendingUnlinks.set(r,a),setTimeout(()=>{this._pendingUnlinks.forEach((u,p)=>{this.emit(...u),this.emit(_l,...u),this._pendingUnlinks.delete(p);});},typeof o.atomic=="number"?o.atomic:100),this;e===os&&this._pendingUnlinks.has(r)&&(e=a[0]=Rn,this._pendingUnlinks.delete(r));}if(c&&(e===os||e===Rn)&&this._readyEmitted){let u=(p,_)=>{p?(e=a[0]=gl,a[1]=p,this.emitWithAll(e,a)):_&&(a.length>2?a[2]=_:a.push(_),this.emitWithAll(e,a));};return this._awaitWriteFinish(r,c.stabilityThreshold,e,u),this}if(e===Rn&&!this._throttle(Rn,r,50))return this;if(o.alwaysStat&&n===void 0&&(e===os||e===rP||e===Rn)){let u=o.cwd?fe.join(o.cwd,r):r,p;try{p=await bP(u);}catch{}if(!p||this.closed)return;a.push(p);}return this.emitWithAll(e,a),this}_handleError(e){let r=e&&e.code;return e&&r!=="ENOENT"&&r!=="ENOTDIR"&&(!this.options.ignorePermissionErrors||r!=="EPERM"&&r!=="EACCES")&&this.emit(gl,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,a=()=>{let d=s.get(r),u=d?d.count:0;return s.delete(r),clearTimeout(o),d&&clearTimeout(d.timeoutObject),u};o=setTimeout(a,n);let c={timeoutObject:o,clear:a,count:0};return s.set(r,c),c}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,r,n,s){let i,o=e;this.options.cwd&&!fe.isAbsolute(e)&&(o=fe.join(this.options.cwd,e));let a=new Date,c=d=>{Rl.stat(o,(u,p)=>{if(u||!this._pendingWrites.has(e)){u&&u.code!=="ENOENT"&&s(u);return}let _=Number(new Date);d&&p.size!==d.size&&(this._pendingWrites.get(e).lastChange=_);let m=this._pendingWrites.get(e);_-m.lastChange>=r?(this._pendingWrites.delete(e),s(void 0,p)):i=setTimeout(c,this.options.awaitWriteFinish.pollInterval,p);});};this._pendingWrites.has(e)||(this._pendingWrites.set(e,{lastChange:a,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&&uP.test(e))return !0;if(!this._userIgnored){let{cwd:n}=this.options,s=this.options.ignored,i=s&&s.map(Fy(n)),o=Al(i).filter(c=>typeof c===Tl&&!ml(c)).map(c=>c+wl),a=this._getGlobIgnored().map(Fy(n)).concat(i,o);this._userIgnored=bl(a,void 0,Sl);}return this._userIgnored([e,r])}_isntIgnored(e,r){return !this._isIgnored(e,r)}_getWatchHelpers(e,r){let n=r||this.options.disableGlobbing||!ml(e)?e:JI(e),s=this.options.followSymlinks;return new Cl(e,n,s,this)}_getWatchedDir(e){this._boundRemove||(this._boundRemove=this._remove.bind(this));let r=fe.resolve(e);return this._watched.has(r)||this._watched.set(r,new xl(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=fe.join(e,r),i=fe.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(_=>this._remove(s,_));let c=this._getWatchedDir(e),d=c.has(r);c.remove(r),this._symlinkPaths.has(i)&&this._symlinkPaths.delete(i);let u=s;if(this.options.cwd&&(u=fe.relative(this.options.cwd,s)),this.options.awaitWriteFinish&&this._pendingWrites.has(u)&&this._pendingWrites.get(u).cancelWait()===os)return;this._watched.delete(s),this._watched.delete(i);let p=n?nP:Iy;d&&!this._isIgnored(s)&&this._emit(p,s),this.options.useFsEvents||this._closePath(s);}_closePath(e){this._closeFile(e);let r=fe.dirname(e);this._getWatchedDir(r).remove(fe.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:_l,alwaysStat:!0,lstat:!0,...r},s=YI(e,n);return this._streams.add(s),s.once(sP,()=>{s=void 0;}),s.once(oP,()=>{s&&(this._streams.delete(s),s=void 0);}),s}};Il.FSWatcher=as;var xP=(t,e)=>{let r=new as(e);return r.add(t),r};Il.watch=xP;});var Ml=T((wL,By)=>{var Tn=t=>t&&typeof t.message=="string",Ol=t=>{if(!t)return;let e=t.cause;if(typeof e=="function"){let r=t.cause();return Tn(r)?r:void 0}else return Tn(e)?e:void 0},Dy=(t,e)=>{if(!Tn(t))return "";let r=t.stack||"";if(e.has(t))return r+`
|
||
causes have become circular...`;let n=Ol(t);return n?(e.add(t),r+`
|
||
caused by: `+Dy(n,e)):r},CP=t=>Dy(t,new Set),qy=(t,e,r)=>{if(!Tn(t))return "";let n=r?"":t.message||"";if(e.has(t))return n+": ...";let s=Ol(t);if(s){e.add(t);let i=typeof t.cause=="function";return n+(i?"":": ")+qy(s,e,i)}else return n},RP=t=>qy(t,new Set);By.exports={isErrorLike:Tn,getErrorCause:Ol,stackWithCauses:CP,messageWithCauses:RP};});var Fl=T((bL,Hy)=>{var TP=Symbol("circular-ref-tag"),ls=Symbol("pino-raw-err-ref"),Uy=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[ls]},set:function(t){this[ls]=t;}}});Object.defineProperty(Uy,ls,{writable:!0,value:{}});Hy.exports={pinoErrProto:Uy,pinoErrorSymbols:{seen:TP,rawSymbol:ls}};});var zy=T((vL,Wy)=>{Wy.exports=kl;var{messageWithCauses:IP,stackWithCauses:PP,isErrorLike:jy}=Ml(),{pinoErrProto:OP,pinoErrorSymbols:MP}=Fl(),{seen:Nl}=MP,{toString:FP}=Object.prototype;function kl(t){if(!jy(t))return t;t[Nl]=void 0;let e=Object.create(OP);e.type=FP.call(t.constructor)==="[object Function]"?t.constructor.name:t.name,e.message=IP(t),e.stack=PP(t),Array.isArray(t.errors)&&(e.aggregateErrors=t.errors.map(r=>kl(r)));for(let r in t)if(e[r]===void 0){let n=t[r];jy(n)?r!=="cause"&&!Object.prototype.hasOwnProperty.call(n,Nl)&&(e[r]=kl(n)):e[r]=n;}return delete t[Nl],e.raw=t,e}});var Vy=T((SL,Gy)=>{Gy.exports=cs;var{isErrorLike:$l}=Ml(),{pinoErrProto:NP,pinoErrorSymbols:kP}=Fl(),{seen:us}=kP,{toString:$P}=Object.prototype;function cs(t){if(!$l(t))return t;t[us]=void 0;let e=Object.create(NP);e.type=$P.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=>cs(r))),$l(t.cause)&&!Object.prototype.hasOwnProperty.call(t.cause,us)&&(e.cause=cs(t.cause));for(let r in t)if(e[r]===void 0){let n=t[r];$l(n)?Object.prototype.hasOwnProperty.call(n,us)||(e[r]=cs(n)):e[r]=n;}return delete t[us],e.raw=t,e}});var Jy=T((EL,Yy)=>{Yy.exports={mapHttpRequest:LP,reqSerializer:Zy};var Ll=Symbol("pino-raw-req-ref"),Ky=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[Ll]},set:function(t){this[Ll]=t;}}});Object.defineProperty(Ky,Ll,{writable:!0,value:{}});function Zy(t){let e=t.info||t.socket,r=Object.create(Ky);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 LP(t){return {req:Zy(t)}}});var tw=T((AL,ew)=>{ew.exports={mapHttpResponse:DP,resSerializer:Qy};var Dl=Symbol("pino-raw-res-ref"),Xy=Object.create({},{statusCode:{enumerable:!0,writable:!0,value:0},headers:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[Dl]},set:function(t){this[Dl]=t;}}});Object.defineProperty(Xy,Dl,{writable:!0,value:{}});function Qy(t){let e=Object.create(Xy);return e.statusCode=t.headersSent?t.statusCode:null,e.headers=t.getHeaders?t.getHeaders():t._headers,e.raw=t,e}function DP(t){return {res:Qy(t)}}});var Bl=T((xL,rw)=>{var ql=zy(),qP=Vy(),hs=Jy(),ds=tw();rw.exports={err:ql,errWithCause:qP,mapHttpRequest:hs.mapHttpRequest,mapHttpResponse:ds.mapHttpResponse,req:hs.reqSerializer,res:ds.resSerializer,wrapErrorSerializer:function(e){return e===ql?e:function(n){return e(ql(n))}},wrapRequestSerializer:function(e){return e===hs.reqSerializer?e:function(n){return e(hs.reqSerializer(n))}},wrapResponseSerializer:function(e){return e===ds.resSerializer?e:function(n){return e(ds.resSerializer(n))}}};});var Ul=T((CL,nw)=>{function BP(t,e){return e}nw.exports=function(){let e=Error.prepareStackTrace;Error.prepareStackTrace=BP;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 sw=T((RL,iw)=>{iw.exports=UP;function UP(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 ps=T((TL,ow)=>{ow.exports=/[^.[\]]+|\[((?:.)*?)\]/g;});var lw=T((IL,aw)=>{var HP=ps();aw.exports=jP;function jP({paths:t}){let e=[];var r=0;let n=t.reduce(function(s,i,o){var a=i.match(HP).map(u=>u.replace(/'|"|`/g,""));let c=i[0]==="[";a=a.map(u=>u[0]==="["?u.substr(1,u.length-2):u);let d=a.indexOf("*");if(d>-1){let u=a.slice(0,d),p=u.join("."),_=a.slice(d+1,a.length),m=_.length>0;r++,e.push({before:u,beforeStr:p,after:_,nested:m});}else s[i]={path:a,val:void 0,precensored:!1,circle:"",escPath:JSON.stringify(i),leadingBracket:c};return s},{});return {wildcards:e,wcLen:r,secret:n}}});var cw=T((PL,uw)=>{var WP=ps();uw.exports=zP;function zP({secret:t,serialize:e,wcLen:r,strict:n,isCensorFct:s,censorFctTakesPath:i},o){let a=Function("o",`
|
||
if (typeof o !== 'object' || o == null) {
|
||
${ZP(n,e)}
|
||
}
|
||
const { censor, secret } = this
|
||
${GP(t,s,i)}
|
||
this.compileRestore()
|
||
${VP(r>0,s,i)}
|
||
${KP(e)}
|
||
`).bind(o);return e===!1&&(a.restore=c=>o.restore(c)),a}function GP(t,e,r){return Object.keys(t).map(n=>{let{escPath:s,leadingBracket:i,path:o}=t[n],a=i?1:0,c=i?"":".",d=[];for(var u;(u=WP.exec(n))!==null;){let[,y]=u,{index:v,input:E}=u;v>a&&d.push(E.substring(0,v-(y?0:1)));}var p=d.map(y=>`o${c}${y}`).join(" && ");p.length===0?p+=`o${c}${n} != null`:p+=` && o${c}${n} != null`;let _=`
|
||
switch (true) {
|
||
${d.reverse().map(y=>`
|
||
case o${c}${y} === censor:
|
||
secret[${s}].circle = ${JSON.stringify(y)}
|
||
break
|
||
`).join(`
|
||
`)}
|
||
}
|
||
`,m=r?`val, ${JSON.stringify(o)}`:"val";return `
|
||
if (${p}) {
|
||
const val = o${c}${n}
|
||
if (val === censor) {
|
||
secret[${s}].precensored = true
|
||
} else {
|
||
secret[${s}].val = val
|
||
o${c}${n} = ${e?`censor(${m})`:"censor"}
|
||
${_}
|
||
}
|
||
}
|
||
`}).join(`
|
||
`)}function VP(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 KP(t){return t===!1?"return o":`
|
||
var s = this.serialize(o)
|
||
this.restore(o)
|
||
return s
|
||
`}function ZP(t,e){return t===!0?"throw Error('fast-redact: primitives cannot be redacted')":e===!1?"return o":"return this.serialize(o)"}});var jl=T((OL,dw)=>{dw.exports={groupRedact:JP,groupRestore:YP,nestedRedact:QP,nestedRestore:XP};function YP({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 JP(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),a=o.length,c=e.length,d=s?[...e]:void 0,u=new Array(a);for(var p=0;p<a;p++){let _=o[p];u[p]=i[_],s?(d[c]=_,i[_]=r(i[_],d)):n?i[_]=r(i[_]):i[_]=r;}return {keys:o,values:u,target:i,flat:!0}}function XP(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 QP(t,e,r,n,s,i,o){let a=fw(e,r);if(a==null)return;let c=Object.keys(a),d=c.length;for(var u=0;u<d;u++){let p=c[u];eO(t,a,p,r,n,s,i,o);}return t}function Hl(t,e){return t!=null?"hasOwn"in Object?Object.hasOwn(t,e):Object.prototype.hasOwnProperty.call(t,e):!1}function eO(t,e,r,n,s,i,o,a){let c=s.length,d=c-1,u=r;var p=-1,_,m,y,E=null,A,w,x=!1,M=0,k=0,j=tO();if(y=_=e[r],typeof _=="object"){for(;_!=null&&++p<c&&(k+=1,r=s[p],!(r!=="*"&&!E&&!(typeof _=="object"&&r in _)));)if(!(r==="*"&&(E==="*"&&(x=!0),E=r,p!==d))){if(E){let $=Object.keys(_);for(var U=0;U<$.length;U++){let F=$[U];if(w=_[F],A=r==="*",x)j=St(j,F,k),M=p,y=hw(w,M-1,r,n,s,i,o,a,u,_,m,y,A,F,p,d,j,t,e[u],k+1);else if(A||typeof w=="object"&&w!==null&&r in w){if(A?y=w:y=w[r],m=p!==d?y:o?a?i(y,[...n,u,...s]):i(y):i,A){let B=In(St(j,F,k),y,e[u]);t.push(B),_[F]=m;}else if(w[r]!==m)if(m===void 0&&i!==void 0||Hl(w,r)&&m===y)j=St(j,F,k);else {j=St(j,F,k);let B=In(St(j,r,k+1),y,e[u]);t.push(B),w[r]=m;}}}E=null;}else {if(y=_[r],j=St(j,r,k),m=p!==d?y:o?a?i(y,[...n,u,...s]):i(y):i,!(Hl(_,r)&&m===y||m===void 0&&i!==void 0)){let $=In(j,y,e[u]);t.push($),_[r]=m;}_=_[r];}if(typeof _!="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 hw(t,e,r,n,s,i,o,a,c,d,u,p,_,m,y,v,E,A,w,x){if(e===0&&(_||typeof t=="object"&&t!==null&&r in t)){if(_?p=t:p=t[r],u=y!==v?p:o?a?i(p,[...n,c,...s]):i(p):i,_){let M=In(E,p,w);A.push(M),d[m]=u;}else if(t[r]!==u){if(!(u===void 0&&i!==void 0||Hl(t,r)&&u===p)){let M=In(St(E,r,x+1),p,w);A.push(M),t[r]=u;}}}for(let M in t)typeof t[M]=="object"&&(E=St(E,M,x),hw(t[M],e-1,r,n,s,i,o,a,c,d,u,p,_,m,y,v,E,A,w,x+1));}function tO(){return {parent:null,key:null,children:[],depth:0}}function St(t,e,r){if(t.depth===r)return St(t.parent,e,r);var n={parent:t,key:e,depth:r,children:[]};return t.children.push(n),n}function In(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 mw=T((ML,pw)=>{var{groupRestore:rO,nestedRestore:nO}=jl();pw.exports=iO;function iO({secret:t,wcLen:e}){return function(){if(this.restore)return;let n=Object.keys(t),s=sO(t,n),i=e>0,o=i?{secret:t,groupRestore:rO,nestedRestore:nO}:{secret:t};this.restore=Function("o",oO(s,n,i)).bind(o);}}function sO(t,e){return e.map(r=>{let{circle:n,escPath:s,leadingBracket:i}=t[r],a=n?`o.${n} = secret[${s}].val`:`o${i?"":"."}${r} = secret[${s}].val`,c=`secret[${s}].val = undefined`;return `
|
||
if (secret[${s}].val !== undefined) {
|
||
try { ${a} } catch (e) {}
|
||
${c}
|
||
}
|
||
`}).join("")}function oO(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 gw=T((FL,_w)=>{_w.exports=aO;function aO(t){let{secret:e,censor:r,compileRestore:n,serialize:s,groupRedact:i,nestedRedact:o,wildcards:a,wcLen:c}=t,d=[{secret:e,censor:r,compileRestore:n}];return s!==!1&&d.push({serialize:s}),c>0&&d.push({groupRedact:i,nestedRedact:o,wildcards:a,wcLen:c}),Object.assign(...d)}});var bw=T((NL,ww)=>{var yw=sw(),lO=lw(),uO=cw(),cO=mw(),{groupRedact:fO,nestedRedact:hO}=jl(),dO=gw(),pO=ps(),mO=yw(),Wl=t=>t;Wl.restore=Wl;var _O="[REDACTED]";zl.rx=pO;zl.validator=yw;ww.exports=zl;function zl(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:_O,i=typeof s=="function",o=i&&s.length>1;if(e.length===0)return r||Wl;mO({paths:e,serialize:r,censor:s});let{wildcards:a,wcLen:c,secret:d}=lO({paths:e,censor:s}),u=cO({secret:d,wcLen:c}),p="strict"in t?t.strict:!0;return uO({secret:d,wcLen:c,serialize:r,strict:p,isCensorFct:i,censorFctTakesPath:o},dO({secret:d,censor:s,compileRestore:u,serialize:r,groupRedact:fO,nestedRedact:hO,wildcards:a,wcLen:c}))}});var Nr=T((kL,vw)=>{var gO=Symbol("pino.setLevel"),yO=Symbol("pino.getLevel"),wO=Symbol("pino.levelVal"),bO=Symbol("pino.useLevelLabels"),vO=Symbol("pino.useOnlyCustomLevels"),SO=Symbol("pino.mixin"),EO=Symbol("pino.lsCache"),AO=Symbol("pino.chindings"),xO=Symbol("pino.asJson"),CO=Symbol("pino.write"),RO=Symbol("pino.redactFmt"),TO=Symbol("pino.time"),IO=Symbol("pino.timeSliceIndex"),PO=Symbol("pino.stream"),OO=Symbol("pino.stringify"),MO=Symbol("pino.stringifySafe"),FO=Symbol("pino.stringifiers"),NO=Symbol("pino.end"),kO=Symbol("pino.formatOpts"),$O=Symbol("pino.messageKey"),LO=Symbol("pino.errorKey"),DO=Symbol("pino.nestedKey"),qO=Symbol("pino.nestedKeyStr"),BO=Symbol("pino.mixinMergeStrategy"),UO=Symbol("pino.msgPrefix"),HO=Symbol("pino.wildcardFirst"),jO=Symbol.for("pino.serializers"),WO=Symbol.for("pino.formatters"),zO=Symbol.for("pino.hooks"),GO=Symbol.for("pino.metadata");vw.exports={setLevelSym:gO,getLevelSym:yO,levelValSym:wO,useLevelLabelsSym:bO,mixinSym:SO,lsCacheSym:EO,chindingsSym:AO,asJsonSym:xO,writeSym:CO,serializersSym:jO,redactFmtSym:RO,timeSym:TO,timeSliceIndexSym:IO,streamSym:PO,stringifySym:OO,stringifySafeSym:MO,stringifiersSym:FO,endSym:NO,formatOptsSym:kO,messageKeySym:$O,errorKeySym:LO,nestedKeySym:DO,wildcardFirstSym:HO,needsMetadataGsym:GO,useOnlyCustomLevelsSym:vO,formattersSym:WO,hooksSym:zO,nestedKeyStrSym:qO,mixinMergeStrategySym:BO,msgPrefixSym:UO};});var Kl=T(($L,xw)=>{var Vl=bw(),{redactFmtSym:VO,wildcardFirstSym:ms}=Nr(),{rx:Gl,validator:KO}=Vl,Sw=KO({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})`}),Ew="[Redacted]",Aw=!1;function ZO(t,e){let{paths:r,censor:n}=YO(t),s=r.reduce((a,c)=>{Gl.lastIndex=0;let d=Gl.exec(c),u=Gl.exec(c),p=d[1]!==void 0?d[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/,"$1"):d[0];if(p==="*"&&(p=ms),u===null)return a[p]=null,a;if(a[p]===null)return a;let{index:_}=u,m=`${c.substr(_,c.length-1)}`;return a[p]=a[p]||[],p!==ms&&a[p].length===0&&a[p].push(...a[ms]||[]),p===ms&&Object.keys(a).forEach(function(y){a[y]&&a[y].push(m);}),a[p].push(m),a},{}),i={[VO]:Vl({paths:r,censor:n,serialize:e,strict:Aw})},o=(...a)=>e(typeof n=="function"?n(...a):n);return [...Object.keys(s),...Object.getOwnPropertySymbols(s)].reduce((a,c)=>{if(s[c]===null)a[c]=d=>o(d,[c]);else {let d=typeof n=="function"?(u,p)=>n(u,[c,...p]):n;a[c]=Vl({paths:s[c],censor:d,serialize:e,strict:Aw});}return a},i)}function YO(t){if(Array.isArray(t))return t={paths:t,censor:Ew},Sw(t),t;let{paths:e,censor:r=Ew,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),Sw({paths:e,censor:r}),{paths:e,censor:r}}xw.exports=ZO;});var Rw=T((LL,Cw)=>{var JO=()=>"",XO=()=>`,"time":${Date.now()}`,QO=()=>`,"time":${Math.round(Date.now()/1e3)}`,eM=()=>`,"time":"${new Date(Date.now()).toISOString()}"`;Cw.exports={nullTime:JO,epochTime:XO,unixTime:QO,isoTime:eM};});var Iw=T((DL,Tw)=>{function tM(t){try{return JSON.stringify(t)}catch{return '"[Circular]"'}}Tw.exports=rM;function rM(t,e,r){var n=r&&r.stringify||tM,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 a=1;a<i;a++)o[a]=n(e[a]);return o.join(" ")}if(typeof t!="string")return t;var c=e.length;if(c===0)return t;for(var d="",u=1-s,p=-1,_=t&&t.length||0,m=0;m<_;){if(t.charCodeAt(m)===37&&m+1<_){switch(p=p>-1?p:0,t.charCodeAt(m+1)){case 100:case 102:if(u>=c||e[u]==null)break;p<m&&(d+=t.slice(p,m)),d+=Number(e[u]),p=m+2,m++;break;case 105:if(u>=c||e[u]==null)break;p<m&&(d+=t.slice(p,m)),d+=Math.floor(Number(e[u])),p=m+2,m++;break;case 79:case 111:case 106:if(u>=c||e[u]===void 0)break;p<m&&(d+=t.slice(p,m));var y=typeof e[u];if(y==="string"){d+="'"+e[u]+"'",p=m+2,m++;break}if(y==="function"){d+=e[u].name||"<anonymous>",p=m+2,m++;break}d+=n(e[u]),p=m+2,m++;break;case 115:if(u>=c)break;p<m&&(d+=t.slice(p,m)),d+=String(e[u]),p=m+2,m++;break;case 37:p<m&&(d+=t.slice(p,m)),d+="%",p=m+2,m++,u--;break}++u;}++m;}return p===-1?t:(p<_&&(d+=t.slice(p)),d)}});var Yl=T((qL,Zl)=>{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));Zl.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");};Zl.exports=t;}});var Nw=T((BL,Fw)=>{var je=G("fs"),nM=G("events"),iM=G("util").inherits,Pw=G("path"),Ow=Yl(),Jl=100,sM=16*1024;function Mw(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&&kr(e);}let n=e.append?"a":"w",s=e.mode;if(e.sync)try{e.mkdir&&je.mkdirSync(Pw.dirname(t),{recursive:!0});let i=je.openSync(t,n,s);r(null,i);}catch(i){throw r(i),i}else e.mkdir?je.mkdir(Pw.dirname(t),{recursive:!0},i=>{if(i)return r(i);je.open(t,n,s,r);}):je.open(t,n,s,r);}function We(t){if(!(this instanceof We))return new We(t);let{fd:e,dest:r,minLength:n,maxLength:s,maxWrite:i,sync:o,append:a=!0,mode:c,mkdir:d,retryEAGAIN:u,fsync:p}=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||sM,this.sync=o||!1,this._fsync=p||!1,this.append=a||!1,this.mode=c,this.retryEAGAIN=u||(()=>!0),this.mkdir=d||!1,typeof e=="number")this.fd=e,process.nextTick(()=>this.emit("ready"));else if(typeof e=="string")Mw(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=(_,m)=>{if(_){if((_.code==="EAGAIN"||_.code==="EBUSY")&&this.retryEAGAIN(_,this._writingBuf.length,this._len-this._writingBuf.length))if(this.sync)try{Ow(Jl),this.release(void 0,0);}catch(v){this.release(v);}else setTimeout(()=>{je.write(this.fd,this._writingBuf,"utf8",this.release);},Jl);else this._writing=!1,this.emit("error",_);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){je.write(this.fd,this._writingBuf,"utf8",this.release);return}try{do{let v=je.writeSync(this.fd,this._writingBuf,"utf8");this._len-=v,this._writingBuf=this._writingBuf.slice(v);}while(this._writingBuf)}catch(v){this.release(v);return}}this._fsync&&je.fsyncSync(this.fd);let y=this._len;this._reopening?(this._writing=!1,this._reopening=!1,this.reopen()):y>this.minLength?kr(this):this._ending?y>0?kr(this):(this._writing=!1,_s(this)):(this._writing=!1,this.sync?this._asyncDrainScheduled||(this._asyncDrainScheduled=!0,process.nextTick(oM,this)):this.emit("drain"));},this.on("newListener",function(_){_==="drain"&&(this._asyncDrainScheduled=!1);});}function oM(t){t.listenerCount("drain")>0&&(t._asyncDrainScheduled=!1,t.emit("drain"));}iM(We,nM);We.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&&kr(this),this._len<this._hwm)};We.prototype.flush=function(){if(this.destroyed)throw new Error("SonicBoom destroyed");this._writing||this.minLength<=0||(this._bufs.length===0&&this._bufs.push(""),kr(this));};We.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&&je.close(e,r=>{if(r)return this.emit("error",r)});}),Mw(t||this.file,this);};We.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?kr(this):_s(this)));};We.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=je.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;Ow(Jl);}}};We.prototype.destroy=function(){this.destroyed||_s(this);};function kr(t){let e=t.release;if(t._writing=!0,t._writingBuf=t._writingBuf||t._bufs.shift()||"",t.sync)try{let r=je.writeSync(t.fd,t._writingBuf,"utf8");e(null,r);}catch(r){e(r);}else je.write(t.fd,t._writingBuf,"utf8",e);}function _s(t){if(t.fd===-1){t.once("ready",_s.bind(null,t));return}t.destroyed=!0,t._bufs=[],t.fd!==1&&t.fd!==2?je.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");}}We.SonicBoom=We;We.default=We;Fw.exports=We;});var Xl=T((UL,Bw)=>{var qt={exit:[],beforeExit:[]},kw={exit:lM,beforeExit:uM},$w=new FinalizationRegistry(cM);function aM(t){qt[t].length>0||process.on(t,kw[t]);}function Lw(t){qt[t].length>0||process.removeListener(t,kw[t]);}function lM(){Dw("exit");}function uM(){Dw("beforeExit");}function Dw(t){for(let e of qt[t]){let r=e.deref(),n=e.fn;r!==void 0&&n(r,t);}}function cM(t){for(let e of ["exit","beforeExit"]){let r=qt[e].indexOf(t);qt[e].splice(r,r+1),Lw(e);}}function qw(t,e,r){if(e===void 0)throw new Error("the object can't be undefined");aM(t);let n=new WeakRef(e);n.fn=r,$w.register(e,n),qt[t].push(n);}function fM(t,e){qw("exit",t,e);}function hM(t,e){qw("beforeExit",t,e);}function dM(t){$w.unregister(t);for(let e of ["exit","beforeExit"])qt[e]=qt[e].filter(r=>{let n=r.deref();return n&&n!==t}),Lw(e);}Bw.exports={register:fM,registerBeforeExit:hM,unregister:dM};});var Uw=T((HL,pM)=>{pM.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 jw=T((jL,Hw)=>{function mM(t,e,r,n,s){let i=Date.now()+n,o=Atomics.load(t,e);if(o===r){s(null,"ok");return}let a=o,c=d=>{Date.now()>i?s(null,"timed-out"):setTimeout(()=>{a=o,o=Atomics.load(t,e),o===a?c(d>=1e3?1e3:d*2):o===r?s(null,"ok"):s(null,"not-equal");},d);};c(1);}function _M(t,e,r,n,s){let i=Date.now()+n,o=Atomics.load(t,e);if(o!==r){s(null,"ok");return}let a=c=>{Date.now()>i?s(null,"timed-out"):setTimeout(()=>{o=Atomics.load(t,e),o!==r?s(null,"ok"):a(c>=1e3?1e3:c*2);},c);};a(1);}Hw.exports={wait:mM,waitDiff:_M};});var zw=T((WL,Ww)=>{Ww.exports={WRITE_INDEX:4,READ_INDEX:8};});var Yw=T((GL,Zw)=>{var{version:gM}=Uw(),{EventEmitter:yM}=G("events"),{Worker:wM}=G("worker_threads"),{join:bM}=G("path"),{pathToFileURL:vM}=G("url"),{wait:SM}=jw(),{WRITE_INDEX:ze,READ_INDEX:pt}=zw(),EM=G("buffer"),AM=G("assert"),L=Symbol("kImpl"),xM=EM.constants.MAX_STRING_LENGTH,ys=class{constructor(e){this._value=e;}deref(){return this._value}},CM=global.FinalizationRegistry||class{register(){}unregister(){}},RM=global.WeakRef||ys,Gw=new CM(t=>{t.exited||t.terminate();});function TM(t,e){let{filename:r,workerData:n}=e,i=("__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{})["thread-stream-worker"]||bM(__dirname,"lib","worker.js"),o=new wM(i,{...e.workerOpts,trackUnmanagedFds:!1,workerData:{filename:r.indexOf("file://")===0?r:vM(r).href,dataBuf:t[L].dataBuf,stateBuf:t[L].stateBuf,workerData:{$context:{threadStreamVersion:gM},...n}}});return o.stream=new ys(t),o.on("message",IM),o.on("exit",Kw),Gw.register(t,o),o}function Vw(t){AM(!t[L].sync),t[L].needDrain&&(t[L].needDrain=!1,t.emit("drain"));}function gs(t){let e=Atomics.load(t[L].state,ze),r=t[L].data.length-e;if(r>0){if(t[L].buf.length===0){t[L].flushing=!1,t[L].ending?nu(t):t[L].needDrain&&process.nextTick(Vw,t);return}let n=t[L].buf.slice(0,r),s=Buffer.byteLength(n);s<=r?(t[L].buf=t[L].buf.slice(r),ws(t,n,gs.bind(null,t))):t.flush(()=>{if(!t.destroyed){for(Atomics.store(t[L].state,pt,0),Atomics.store(t[L].state,ze,0);s>t[L].data.length;)r=r/2,n=t[L].buf.slice(0,r),s=Buffer.byteLength(n);t[L].buf=t[L].buf.slice(r),ws(t,n,gs.bind(null,t));}});}else if(r===0){if(e===0&&t[L].buf.length===0)return;t.flush(()=>{Atomics.store(t[L].state,pt,0),Atomics.store(t[L].state,ze,0),gs(t);});}else mt(t,new Error("overwritten"));}function IM(t){let e=this.stream.deref();if(e===void 0){this.exited=!0,this.terminate();return}switch(t.code){case"READY":this.stream=new RM(e),e.flush(()=>{e[L].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 Kw(t){let e=this.stream.deref();e!==void 0&&(Gw.unregister(e),e.worker.exited=!0,e.worker.off("exit",Kw),mt(e,t!==0?new Error("the worker thread exited"):null));}var eu=class extends yM{constructor(e={}){if(super(),e.bufferSize<4)throw new Error("bufferSize must at least fit a 4-byte utf-8 char");this[L]={},this[L].stateBuf=new SharedArrayBuffer(128),this[L].state=new Int32Array(this[L].stateBuf),this[L].dataBuf=new SharedArrayBuffer(e.bufferSize||4*1024*1024),this[L].data=Buffer.from(this[L].dataBuf),this[L].sync=e.sync||!1,this[L].ending=!1,this[L].ended=!1,this[L].needDrain=!1,this[L].destroyed=!1,this[L].flushing=!1,this[L].ready=!1,this[L].finished=!1,this[L].errored=null,this[L].closed=!1,this[L].buf="",this.worker=TM(this,e);}write(e){if(this[L].destroyed)return tu(this,new Error("the worker has exited")),!1;if(this[L].ending)return tu(this,new Error("the worker is ending")),!1;if(this[L].flushing&&this[L].buf.length+e.length>=xM)try{Ql(this),this[L].flushing=!0;}catch(r){return mt(this,r),!1}if(this[L].buf+=e,this[L].sync)try{return Ql(this),!0}catch(r){return mt(this,r),!1}return this[L].flushing||(this[L].flushing=!0,setImmediate(gs,this)),this[L].needDrain=this[L].data.length-this[L].buf.length-Atomics.load(this[L].state,ze)<=0,!this[L].needDrain}end(){this[L].destroyed||(this[L].ending=!0,nu(this));}flush(e){if(this[L].destroyed){typeof e=="function"&&process.nextTick(e,new Error("the worker has exited"));return}let r=Atomics.load(this[L].state,ze);SM(this[L].state,pt,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[L].destroyed||(Ql(this),ru(this));}unref(){this.worker.unref();}ref(){this.worker.ref();}get ready(){return this[L].ready}get destroyed(){return this[L].destroyed}get closed(){return this[L].closed}get writable(){return !this[L].destroyed&&!this[L].ending}get writableEnded(){return this[L].ending}get writableFinished(){return this[L].finished}get writableNeedDrain(){return this[L].needDrain}get writableObjectMode(){return !1}get writableErrored(){return this[L].errored}};function tu(t,e){setImmediate(()=>{t.emit("error",e);});}function mt(t,e){t[L].destroyed||(t[L].destroyed=!0,e&&(t[L].errored=e,tu(t,e)),t.worker.exited?setImmediate(()=>{t[L].closed=!0,t.emit("close");}):t.worker.terminate().catch(()=>{}).then(()=>{t[L].closed=!0,t.emit("close");}));}function ws(t,e,r){let n=Atomics.load(t[L].state,ze),s=Buffer.byteLength(e);return t[L].data.write(e,n),Atomics.store(t[L].state,ze,n+s),Atomics.notify(t[L].state,ze),r(),!0}function nu(t){if(!(t[L].ended||!t[L].ending||t[L].flushing)){t[L].ended=!0;try{t.flushSync();let e=Atomics.load(t[L].state,pt);Atomics.store(t[L].state,ze,-1),Atomics.notify(t[L].state,ze);let r=0;for(;e!==-1;){if(Atomics.wait(t[L].state,pt,e,1e3),e=Atomics.load(t[L].state,pt),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[L].finished=!0,t.emit("finish");});}catch(e){mt(t,e);}}}function Ql(t){let e=()=>{t[L].ending?nu(t):t[L].needDrain&&process.nextTick(Vw,t);};for(t[L].flushing=!1;t[L].buf.length!==0;){let r=Atomics.load(t[L].state,ze),n=t[L].data.length-r;if(n===0){ru(t),Atomics.store(t[L].state,pt,0),Atomics.store(t[L].state,ze,0);continue}else if(n<0)throw new Error("overwritten");let s=t[L].buf.slice(0,n),i=Buffer.byteLength(s);if(i<=n)t[L].buf=t[L].buf.slice(n),ws(t,s,e);else {for(ru(t),Atomics.store(t[L].state,pt,0),Atomics.store(t[L].state,ze,0);i>t[L].buf.length;)n=n/2,s=t[L].buf.slice(0,n),i=Buffer.byteLength(s);t[L].buf=t[L].buf.slice(n),ws(t,s,e);}}}function ru(t){if(t[L].flushing)throw new Error("unable to flush while flushing");let e=Atomics.load(t[L].state,ze),r=0;for(;;){let n=Atomics.load(t[L].state,pt);if(n===-2)throw Error("_flushSync failed");if(n!==e)Atomics.wait(t[L].state,pt,n,1e3);else break;if(++r===10)throw new Error("_flushSync took too long (10s)")}}Zw.exports=eu;});var ou=T((VL,Jw)=>{var{createRequire:PM}=G("module"),OM=Ul(),{join:iu,isAbsolute:MM,sep:FM}=G("path"),NM=Yl(),su=Xl(),kM=Yw();function $M(t){su.register(t,DM),su.registerBeforeExit(t,qM),t.on("close",function(){su.unregister(t);});}function LM(t,e,r){let n=new kM({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&&$M(n);}function i(){n.closed||(n.flushSync(),NM(100),n.end());}return n}function DM(t){t.ref(),t.flushSync(),t.end(),t.once("close",function(){t.unref();});}function qM(t){t.flushSync();}function BM(t){let{pipeline:e,targets:r,levels:n,dedupe:s,options:i={},worker:o={},caller:a=OM()}=t,c=typeof a=="string"?[a]:a,d="__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{},u=t.target;if(u&&r)throw new Error("only one of target or targets can be specified");return r?(u=d["pino-worker"]||iu(__dirname,"worker.js"),i.targets=r.map(_=>({..._,target:p(_.target)}))):e&&(u=d["pino-pipeline-worker"]||iu(__dirname,"worker-pipeline.js"),i.targets=e.map(_=>({..._,target:p(_.target)}))),n&&(i.levels=n),s&&(i.dedupe=s),LM(p(u),i,o);function p(_){if(_=d[_]||_,MM(_)||_.indexOf("file://")===0)return _;if(_==="pino/file")return iu(__dirname,"..","file.js");let m;for(let y of c)try{let v=y==="node:repl"?process.cwd()+FM:y;m=PM(v).resolve(_);break}catch{continue}if(!m)throw new Error(`unable to determine transport target for "${_}"`);return m}}Jw.exports=BM;});var Ss=T((KL,lb)=>{var Xw=Iw(),{mapHttpRequest:UM,mapHttpResponse:HM}=Bl(),lu=Nw(),Qw=Xl(),{lsCacheSym:jM,chindingsSym:rb,writeSym:eb,serializersSym:nb,formatOptsSym:tb,endSym:WM,stringifiersSym:ib,stringifySym:sb,stringifySafeSym:uu,wildcardFirstSym:ob,nestedKeySym:zM,formattersSym:ab,messageKeySym:GM,errorKeySym:VM,nestedKeyStrSym:KM,msgPrefixSym:bs}=Nr(),{isMainThread:ZM}=G("worker_threads"),YM=ou();function $r(){}function JM(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=UM(n):typeof n.setHeader=="function"&&(n=HM(n)));let o;i===null&&s.length===0?o=[null]:(i=s.shift(),o=s),typeof this[bs]=="string"&&i!==void 0&&i!==null&&(i=this[bs]+i),this[eb](n,Xw(i,o,this[tb]),t);}else {let i=n===void 0?s.shift():n;typeof this[bs]=="string"&&i!==void 0&&i!==null&&(i=this[bs]+i),this[eb](null,Xw(i,s,this[tb]),t);}}}function au(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 XM(t,e,r,n){let s=this[sb],i=this[uu],o=this[ib],a=this[WM],c=this[rb],d=this[nb],u=this[ab],p=this[GM],_=this[VM],m=this[jM][r]+n;m=m+c;let y;u.log&&(t=u.log(t));let v=o[ob],E="";for(let w in t)if(y=t[w],Object.prototype.hasOwnProperty.call(t,w)&&y!==void 0){d[w]?y=d[w](y):w===_&&d.err&&(y=d.err(y));let x=o[w]||v;switch(typeof y){case"undefined":case"function":continue;case"number":Number.isFinite(y)===!1&&(y=null);case"boolean":x&&(y=x(y));break;case"string":y=(x||au)(y);break;default:y=(x||s)(y,i);}if(y===void 0)continue;let M=au(w);E+=","+M+":"+y;}let A="";if(e!==void 0){y=d[p]?d[p](e):e;let w=o[p]||v;switch(typeof y){case"function":break;case"number":Number.isFinite(y)===!1&&(y=null);case"boolean":w&&(y=w(y)),A=',"'+p+'":'+y;break;case"string":y=(w||au)(y),A=',"'+p+'":'+y;break;default:y=(w||s)(y,i),A=',"'+p+'":'+y;}}return this[zM]&&E?m+this[KM]+E.slice(1)+"}"+A+a:m+E+A+a}function QM(t,e){let r,n=t[rb],s=t[sb],i=t[uu],o=t[ib],a=o[ob],c=t[nb],d=t[ab].bindings;e=d(e);for(let u in e)if(r=e[u],(u!=="level"&&u!=="serializers"&&u!=="formatters"&&u!=="customLevels"&&e.hasOwnProperty(u)&&r!==void 0)===!0){if(r=c[u]?c[u](r):r,r=(o[u]||a||s)(r,i),r===void 0)continue;n+=',"'+u+'":'+r;}return n}function eF(t){return t.write!==t.constructor.prototype.write}function vs(t){let e=new lu(t);return e.on("error",r),!t.sync&&ZM&&(Qw.register(e,tF),e.on("close",function(){Qw.unregister(e);})),e;function r(n){if(n.code==="EPIPE"){e.write=$r,e.end=$r,e.flushSync=$r,e.destroy=$r;return}e.removeListener("error",r),e.emit("error",n);}}function tF(t,e){t.destroyed||(e==="beforeExit"?(t.flush(),t.on("drain",function(){t.end();})):t.flushSync());}function rF(t){return function(r,n,s={},i){if(typeof s=="string")i=vs({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=vs({dest:i});}else if(s instanceof lu||s.writable||s._writableState)i=s,s={};else if(s.transport){if(s.transport instanceof lu||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=YM({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:a}=s;return o===!1&&(s.level="silent"),a||(s.onChild=$r),i||(eF(process.stdout)?i=process.stdout:i=vs({fd:process.stdout.fd||1})),{opts:s,stream:i}}}function nF(t,e){try{return JSON.stringify(t)}catch{try{return (e||this[uu])(t)}catch{return '"[unable to serialize, circular reference is too complex to analyze]"'}}}function iF(t,e,r){return {level:t,bindings:e,log:r}}function sF(t){let e=Number(t);return typeof t=="string"&&Number.isFinite(e)?e:t===void 0?1:t}lb.exports={noop:$r,buildSafeSonicBoom:vs,asChindings:QM,asJson:XM,genLog:JM,createArgsNormalizer:rF,stringify:nF,buildFormatters:iF,normalizeDestFileDescriptor:sF};});var Es=T((ZL,cb)=>{var{lsCacheSym:oF,levelValSym:cu,useOnlyCustomLevelsSym:aF,streamSym:lF,formattersSym:uF,hooksSym:cF}=Nr(),{noop:fF,genLog:nr}=Ss(),lt={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},ub={fatal:t=>{let e=nr(lt.fatal,t);return function(...r){let n=this[lF];if(e.call(this,...r),typeof n.flushSync=="function")try{n.flushSync();}catch{}}},error:t=>nr(lt.error,t),warn:t=>nr(lt.warn,t),info:t=>nr(lt.info,t),debug:t=>nr(lt.debug,t),trace:t=>nr(lt.trace,t)},fu=Object.keys(lt).reduce((t,e)=>(t[lt[e]]=e,t),{}),hF=Object.keys(fu).reduce((t,e)=>(t[e]='{"level":'+Number(e),t),{});function dF(t){let e=t[uF].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[oF]=n,t}function pF(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 mF(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[cu],s=this[cu]=r[t],i=this[aF],o=this[cF].logMethod;for(let a in r){if(s>r[a]){this[a]=fF;continue}this[a]=pF(a,i)?ub[a](o):nr(r[a],o);}this.emit("level-change",t,s,e[n],n,this);}function _F(t){let{levels:e,levelVal:r}=this;return e&&e.labels?e.labels[r]:""}function gF(t){let{values:e}=this.levels,r=e[t];return r!==void 0&&r>=this[cu]}function yF(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:fu,r),s=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),e?null:lt,t);return {labels:n,values:s}}function wF(t,e,r){if(typeof t=="number"){if(![].concat(Object.keys(e||{}).map(i=>e[i]),r?[]:Object.keys(fu).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:lt,e);if(!(t in n))throw Error(`default level:${t} must be included in custom levels`)}function bF(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")}}cb.exports={initialLsCache:hF,genLsCache:dF,levelMethods:ub,getLevel:_F,setLevel:mF,isLevelEnabled:gF,mappings:yF,levels:lt,assertNoLevelCollisions:bF,assertDefaultLevelFound:wF};});var hu=T((YL,fb)=>{fb.exports={version:"8.15.1"};});var Sb=T((XL,vb)=>{var{EventEmitter:vF}=G("events"),{lsCacheSym:SF,levelValSym:EF,setLevelSym:pu,getLevelSym:hb,chindingsSym:mu,parsedChindingsSym:AF,mixinSym:xF,asJsonSym:gb,writeSym:CF,mixinMergeStrategySym:RF,timeSym:TF,timeSliceIndexSym:IF,streamSym:yb,serializersSym:ir,formattersSym:du,errorKeySym:PF,messageKeySym:OF,useOnlyCustomLevelsSym:MF,needsMetadataGsym:FF,redactFmtSym:NF,stringifySym:kF,formatOptsSym:$F,stringifiersSym:LF,msgPrefixSym:db}=Nr(),{getLevel:DF,setLevel:qF,isLevelEnabled:BF,mappings:UF,initialLsCache:HF,genLsCache:jF,assertNoLevelCollisions:WF}=Es(),{asChindings:wb,asJson:zF,buildFormatters:pb,stringify:mb}=Ss(),{version:GF}=hu(),VF=Kl(),KF=class{},bb={constructor:KF,child:ZF,bindings:YF,setBindings:JF,flush:tN,isLevelEnabled:BF,version:GF,get level(){return this[hb]()},set level(t){this[pu](t);},get levelVal(){return this[EF]},set levelVal(t){throw Error("levelVal is read-only")},[SF]:HF,[CF]:QF,[gb]:zF,[hb]:DF,[pu]:qF};Object.setPrototypeOf(bb,vF.prototype);vb.exports=function(){return Object.create(bb)};var _b=t=>t;function ZF(t,e){if(!t)throw Error("missing bindings for child Pino");e=e||{};let r=this[ir],n=this[du],s=Object.create(this);if(e.hasOwnProperty("serializers")===!0){s[ir]=Object.create(null);for(let u in r)s[ir][u]=r[u];let c=Object.getOwnPropertySymbols(r);for(var i=0;i<c.length;i++){let u=c[i];s[ir][u]=r[u];}for(let u in e.serializers)s[ir][u]=e.serializers[u];let d=Object.getOwnPropertySymbols(e.serializers);for(var o=0;o<d.length;o++){let u=d[o];s[ir][u]=e.serializers[u];}}else s[ir]=r;if(e.hasOwnProperty("formatters")){let{level:c,bindings:d,log:u}=e.formatters;s[du]=pb(c||n.level,d||_b,u||n.log);}else s[du]=pb(n.level,_b,n.log);if(e.hasOwnProperty("customLevels")===!0&&(WF(this.levels,e.customLevels),s.levels=UF(e.customLevels,s[MF]),jF(s)),typeof e.redact=="object"&&e.redact!==null||Array.isArray(e.redact)){s.redact=e.redact;let c=VF(s.redact,mb),d={stringify:c[NF]};s[kF]=mb,s[LF]=c,s[$F]=d;}typeof e.msgPrefix=="string"&&(s[db]=(this[db]||"")+e.msgPrefix),s[mu]=wb(s,t);let a=e.level||this.level;return s[pu](a),this.onChild(s),s}function YF(){let e=`{${this[mu].substr(1)}}`,r=JSON.parse(e);return delete r.pid,delete r.hostname,r}function JF(t){let e=wb(this,t);this[mu]=e,delete this[AF];}function XF(t,e){return Object.assign(e,t)}function QF(t,e,r){let n=this[TF](),s=this[xF],i=this[PF],o=this[OF],a=this[RF]||XF,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=a(c,s(c,r,this)));let d=this[gb](c,e,r,n),u=this[yb];u[FF]===!0&&(u.lastLevel=r,u.lastObj=c,u.lastMsg=e,u.lastTime=n.slice(this[IF]),u.lastLogger=this),u.write(d);}function eN(){}function tN(){let t=this[yb];"flush"in t&&t.flush(eN);}});var Rb=T((wu,Cb)=>{var{hasOwnProperty:As}=Object.prototype,or=yu();or.configure=yu;or.stringify=or;or.default=or;wu.stringify=or;wu.configure=yu;Cb.exports=or;var rN=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]|[\ud800-\udbff](?![\udc00-\udfff])|(?:[^\ud800-\udbff]|^)[\udc00-\udfff]/;function Bt(t){return t.length<5e3&&!rN.test(t)?`"${t}"`:JSON.stringify(t)}function _u(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 nN=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function gu(t){return nN.call(t)!==void 0&&t.length!==0}function Eb(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 iN(t){if(As.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 Ab(t,e){let r;if(As.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 xb(t,e){let r;if(As.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 sr(t){return t===1?"1 item":`${t} items`}function sN(t){let e=new Set;for(let r of t)(typeof r=="string"||typeof r=="number")&&e.add(String(r));return e}function oN(t){if(As.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 yu(t){t={...t};let e=oN(t);e&&(t.bigint===void 0&&(t.bigint=!1),"circularValue"in t||(t.circularValue=Error));let r=iN(t),n=Ab(t,"bigint"),s=Ab(t,"deterministic"),i=xb(t,"maximumDepth"),o=xb(t,"maximumBreadth");function a(_,m,y,v,E,A){let w=m[_];switch(typeof w=="object"&&w!==null&&typeof w.toJSON=="function"&&(w=w.toJSON(_)),w=v.call(m,_,w),typeof w){case"string":return Bt(w);case"object":{if(w===null)return "null";if(y.indexOf(w)!==-1)return r;let x="",M=",",k=A;if(Array.isArray(w)){if(w.length===0)return "[]";if(i<y.length+1)return '"[Array]"';y.push(w),E!==""&&(A+=E,x+=`
|
||
${A}`,M=`,
|
||
${A}`);let R=Math.min(w.length,o),z=0;for(;z<R-1;z++){let te=a(String(z),w,y,v,E,A);x+=te!==void 0?te:"null",x+=M;}let V=a(String(z),w,y,v,E,A);if(x+=V!==void 0?V:"null",w.length-1>o){let te=w.length-o-1;x+=`${M}"... ${sr(te)} not stringified"`;}return E!==""&&(x+=`
|
||
${k}`),y.pop(),`[${x}]`}let j=Object.keys(w),U=j.length;if(U===0)return "{}";if(i<y.length+1)return '"[Object]"';let $="",F="";E!==""&&(A+=E,M=`,
|
||
${A}`,$=" ");let B=Math.min(U,o);s&&!gu(w)&&(j=_u(j)),y.push(w);for(let R=0;R<B;R++){let z=j[R],V=a(z,w,y,v,E,A);V!==void 0&&(x+=`${F}${Bt(z)}:${$}${V}`,F=M);}if(U>o){let R=U-o;x+=`${F}"...":${$}"${sr(R)} not stringified"`,F=M;}return E!==""&&F.length>1&&(x=`
|
||
${A}${x}
|
||
${k}`),y.pop(),`{${x}}`}case"number":return isFinite(w)?String(w):e?e(w):"null";case"boolean":return w===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(w);default:return e?e(w):void 0}}function c(_,m,y,v,E,A){switch(typeof m=="object"&&m!==null&&typeof m.toJSON=="function"&&(m=m.toJSON(_)),typeof m){case"string":return Bt(m);case"object":{if(m===null)return "null";if(y.indexOf(m)!==-1)return r;let w=A,x="",M=",";if(Array.isArray(m)){if(m.length===0)return "[]";if(i<y.length+1)return '"[Array]"';y.push(m),E!==""&&(A+=E,x+=`
|
||
${A}`,M=`,
|
||
${A}`);let U=Math.min(m.length,o),$=0;for(;$<U-1;$++){let B=c(String($),m[$],y,v,E,A);x+=B!==void 0?B:"null",x+=M;}let F=c(String($),m[$],y,v,E,A);if(x+=F!==void 0?F:"null",m.length-1>o){let B=m.length-o-1;x+=`${M}"... ${sr(B)} not stringified"`;}return E!==""&&(x+=`
|
||
${w}`),y.pop(),`[${x}]`}y.push(m);let k="";E!==""&&(A+=E,M=`,
|
||
${A}`,k=" ");let j="";for(let U of v){let $=c(U,m[U],y,v,E,A);$!==void 0&&(x+=`${j}${Bt(U)}:${k}${$}`,j=M);}return E!==""&&j.length>1&&(x=`
|
||
${A}${x}
|
||
${w}`),y.pop(),`{${x}}`}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(_,m,y,v,E){switch(typeof m){case"string":return Bt(m);case"object":{if(m===null)return "null";if(typeof m.toJSON=="function"){if(m=m.toJSON(_),typeof m!="object")return d(_,m,y,v,E);if(m===null)return "null"}if(y.indexOf(m)!==-1)return r;let A=E;if(Array.isArray(m)){if(m.length===0)return "[]";if(i<y.length+1)return '"[Array]"';y.push(m),E+=v;let $=`
|
||
${E}`,F=`,
|
||
${E}`,B=Math.min(m.length,o),R=0;for(;R<B-1;R++){let V=d(String(R),m[R],y,v,E);$+=V!==void 0?V:"null",$+=F;}let z=d(String(R),m[R],y,v,E);if($+=z!==void 0?z:"null",m.length-1>o){let V=m.length-o-1;$+=`${F}"... ${sr(V)} not stringified"`;}return $+=`
|
||
${A}`,y.pop(),`[${$}]`}let w=Object.keys(m),x=w.length;if(x===0)return "{}";if(i<y.length+1)return '"[Object]"';E+=v;let M=`,
|
||
${E}`,k="",j="",U=Math.min(x,o);gu(m)&&(k+=Eb(m,M,o),w=w.slice(m.length),U-=m.length,j=M),s&&(w=_u(w)),y.push(m);for(let $=0;$<U;$++){let F=w[$],B=d(F,m[F],y,v,E);B!==void 0&&(k+=`${j}${Bt(F)}: ${B}`,j=M);}if(x>o){let $=x-o;k+=`${j}"...": "${sr($)} not stringified"`,j=M;}return j!==""&&(k=`
|
||
${E}${k}
|
||
${A}`),y.pop(),`{${k}}`}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 u(_,m,y){switch(typeof m){case"string":return Bt(m);case"object":{if(m===null)return "null";if(typeof m.toJSON=="function"){if(m=m.toJSON(_),typeof m!="object")return u(_,m,y);if(m===null)return "null"}if(y.indexOf(m)!==-1)return r;let v="";if(Array.isArray(m)){if(m.length===0)return "[]";if(i<y.length+1)return '"[Array]"';y.push(m);let M=Math.min(m.length,o),k=0;for(;k<M-1;k++){let U=u(String(k),m[k],y);v+=U!==void 0?U:"null",v+=",";}let j=u(String(k),m[k],y);if(v+=j!==void 0?j:"null",m.length-1>o){let U=m.length-o-1;v+=`,"... ${sr(U)} not stringified"`;}return y.pop(),`[${v}]`}let E=Object.keys(m),A=E.length;if(A===0)return "{}";if(i<y.length+1)return '"[Object]"';let w="",x=Math.min(A,o);gu(m)&&(v+=Eb(m,",",o),E=E.slice(m.length),x-=m.length,w=","),s&&(E=_u(E)),y.push(m);for(let M=0;M<x;M++){let k=E[M],j=u(k,m[k],y);j!==void 0&&(v+=`${w}${Bt(k)}:${j}`,w=",");}if(A>o){let M=A-o;v+=`${w}"...":"${sr(M)} not stringified"`;}return y.pop(),`{${v}}`}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(_,m,y){if(arguments.length>1){let v="";if(typeof y=="number"?v=" ".repeat(Math.min(y,10)):typeof y=="string"&&(v=y.slice(0,10)),m!=null){if(typeof m=="function")return a("",{"":_},[],m,v,"");if(Array.isArray(m))return c("",_,[],sN(m),v,"")}if(v.length!==0)return d("",_,[],v,"")}return u("",_,[])}return p}});var Pb=T((QL,Ib)=>{var bu=Symbol.for("pino.metadata"),{levels:Tb}=Es(),aN=Tb.info;function lN(t,e){let r=0;t=t||[],e=e||{dedupe:!1};let n=Object.create(Tb);n.silent=1/0,e.levels&&typeof e.levels=="object"&&Object.keys(e.levels).forEach(u=>{n[u]=e.levels[u];});let s={write:i,add:a,flushSync:o,end:c,minLevel:0,streams:[],clone:d,[bu]:!0,streamLevels:n};return Array.isArray(t)?t.forEach(a,s):a.call(s,t),t=null,s;function i(u){let p,_=this.lastLevel,{streams:m}=this,y=0,v;for(let E=cN(m.length,e.dedupe);hN(E,m.length,e.dedupe);E=fN(E,e.dedupe))if(p=m[E],p.level<=_){if(y!==0&&y!==p.level)break;if(v=p.stream,v[bu]){let{lastTime:A,lastMsg:w,lastObj:x,lastLogger:M}=this;v.lastLevel=_,v.lastTime=A,v.lastMsg=w,v.lastObj=x,v.lastLogger=M;}v.write(u),e.dedupe&&(y=p.level);}else if(!e.dedupe)break}function o(){for(let{stream:u}of this.streams)typeof u.flushSync=="function"&&u.flushSync();}function a(u){if(!u)return s;let p=typeof u.write=="function"||u.stream,_=u.write?u:u.stream;if(!p)throw Error("stream object needs to implement either StreamEntry or DestinationStream interface");let{streams:m,streamLevels:y}=this,v;typeof u.levelVal=="number"?v=u.levelVal:typeof u.level=="string"?v=y[u.level]:typeof u.level=="number"?v=u.level:v=aN;let E={stream:_,level:v,levelVal:void 0,id:r++};return m.unshift(E),m.sort(uN),this.minLevel=m[0].level,s}function c(){for(let{stream:u}of this.streams)typeof u.flushSync=="function"&&u.flushSync(),u.end();}function d(u){let p=new Array(this.streams.length);for(let _=0;_<p.length;_++)p[_]={level:u,stream:this.streams[_].stream};return {write:i,add:a,minLevel:u,streams:p,clone:d,flushSync:o,[bu]:!0}}}function uN(t,e){return t.level-e.level}function cN(t,e){return e?t-1:0}function fN(t,e){return e?t-1:t+1}function hN(t,e,r){return r?t>=0:t<e}Ib.exports=lN;});var jb=T((eD,rt)=>{var dN=G("os"),Db=Bl(),pN=Ul(),mN=Kl(),qb=Rw(),_N=Sb(),Bb=Nr(),{configure:gN}=Rb(),{assertDefaultLevelFound:yN,mappings:Ub,genLsCache:wN,levels:bN}=Es(),{createArgsNormalizer:vN,asChindings:SN,buildSafeSonicBoom:Ob,buildFormatters:EN,stringify:vu,normalizeDestFileDescriptor:Mb,noop:AN}=Ss(),{version:xN}=hu(),{chindingsSym:Fb,redactFmtSym:CN,serializersSym:Nb,timeSym:RN,timeSliceIndexSym:TN,streamSym:IN,stringifySym:kb,stringifySafeSym:Su,stringifiersSym:$b,setLevelSym:PN,endSym:ON,formatOptsSym:MN,messageKeySym:FN,errorKeySym:NN,nestedKeySym:kN,mixinSym:$N,useOnlyCustomLevelsSym:LN,formattersSym:Lb,hooksSym:DN,nestedKeyStrSym:qN,mixinMergeStrategySym:BN,msgPrefixSym:UN}=Bb,{epochTime:Hb,nullTime:HN}=qb,{pid:jN}=process,WN=dN.hostname(),zN=Db.err,GN={level:"info",levels:bN,messageKey:"msg",errorKey:"err",nestedKey:null,enabled:!0,base:{pid:jN,hostname:WN},serializers:Object.assign(Object.create(null),{err:zN}),formatters:Object.assign(Object.create(null),{bindings(t){return t},level(t,e){return {level:e}}}),hooks:{logMethod:void 0},timestamp:Hb,name:void 0,redact:null,customLevels:null,useOnlyCustomLevels:!1,depthLimit:5,edgeLimit:100},VN=vN(GN),KN=Object.assign(Object.create(null),Db);function Eu(...t){let e={},{opts:r,stream:n}=VN(e,pN(),...t),{redact:s,crlf:i,serializers:o,timestamp:a,messageKey:c,errorKey:d,nestedKey:u,base:p,name:_,level:m,customLevels:y,mixin:v,mixinMergeStrategy:E,useOnlyCustomLevels:A,formatters:w,hooks:x,depthLimit:M,edgeLimit:k,onChild:j,msgPrefix:U}=r,$=gN({maximumDepth:M,maximumBreadth:k}),F=EN(w.level,w.bindings,w.log),B=vu.bind({[Su]:$}),R=s?mN(s,B):{},z=s?{stringify:R[CN]}:{stringify:B},V="}"+(i?`\r
|
||
`:`
|
||
`),te=SN.bind(null,{[Fb]:"",[Nb]:o,[$b]:R,[kb]:vu,[Su]:$,[Lb]:F}),I="";p!==null&&(_===void 0?I=te(p):I=te(Object.assign({},p,{name:_})));let O=a instanceof Function?a:a?Hb:HN,X=O().indexOf(":")+1;if(A&&!y)throw Error("customLevels is required if useOnlyCustomLevels is set true");if(v&&typeof v!="function")throw Error(`Unknown mixin type "${typeof v}" - expected "function"`);if(U&&typeof U!="string")throw Error(`Unknown msgPrefix type "${typeof U}" - expected "string"`);yN(m,y,A);let Q=Ub(y,A);return Object.assign(e,{levels:Q,[LN]:A,[IN]:n,[RN]:O,[TN]:X,[kb]:vu,[Su]:$,[$b]:R,[ON]:V,[MN]:z,[FN]:c,[NN]:d,[kN]:u,[qN]:u?`,${JSON.stringify(u)}:{`:"",[Nb]:o,[$N]:v,[BN]:E,[Fb]:I,[Lb]:F,[DN]:x,silent:AN,onChild:j,[UN]:U}),Object.setPrototypeOf(e,_N()),wN(e),e[PN](m),e}rt.exports=Eu;rt.exports.destination=(t=process.stdout.fd)=>typeof t=="object"?(t.dest=Mb(t.dest||process.stdout.fd),Ob(t)):Ob({dest:Mb(t),minLength:0});rt.exports.transport=ou();rt.exports.multistream=Pb();rt.exports.levels=Ub();rt.exports.stdSerializers=KN;rt.exports.stdTimeFunctions=Object.assign({},qb);rt.exports.symbols=Bb;rt.exports.version=xN;rt.exports.default=Eu;rt.exports.pino=Eu;});var Yb={};Xs(Yb,{RotatingFileStream:()=>Rs,RotatingFileStreamError:()=>Pn,createStream:()=>dk});async function zb(t){return new Promise(e=>fs.access(t,fs.constants.F_OK,r=>e(!r)))}function Gb(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 xu(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 Zb(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 Cu(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 lk(t){let e=Zb(t,"interval",ak);switch(e.unit){case"h":Cu(e,"hours",24);break;case"m":Cu(e,"minutes",60);break;case"s":Cu(e,"seconds",60);break}return e}function Vb(t){let e=Zb(t,"size",uk);return e.unit==="K"?e.num*1024:e.unit==="M"?e.num*1048576:e.unit==="G"?e.num*1073741824:e.num}function ck(t){let e={};for(let r in t){let n=t[r],s=typeof n;if(!(r in Kb))throw new Error(`Unknown option: ${r}`);e[r]=t[r],Kb[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 fk(t,e,r){return n=>n?`${t}.${n}${e&&!r?".gz":""}`:t}function hk(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),a=n(s.getDate()),c=n(s.getHours()),d=n(s.getMinutes());return o+a+"-"+c+d+"-"+n(i)+"-"+t+(e&&!r?".gz":"")}}function dk(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=ck(e),{compress:n,omitExtension:s}=r,i;if(typeof t=="string")i=e.rotate?fk(t,n!==void 0,s):hk(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 Rs(i,r)}var Pn,Rs,ak,uk,Kb,Jb=jn(()=>{Pn=class extends Error{code="RFS-TOO-MANY";constructor(){super("Too many destination file attempts");}},Rs=class extends stream.Writable{createGzip;exec;file;filename;finished;fsCreateReadStream;fsCreateWriteStream;fsOpen;fsReadFile;fsStat;fsUnlink;generator;initPromise;last;maxTimeout;next;options;prev;rotation;size;stdout;timeout;timeoutPromise;constructor(e,r){let{encoding:n,history:s,maxFiles:i,maxSize:o,path:a}=r;super({decodeStrings:!0,defaultEncoding:n}),this.createGzip=zlib.createGzip,this.exec=child_process.exec,this.filename=a+e(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=e,this.maxTimeout=2147483640,this.options=r,this.stdout=process.stdout,(i||o)&&(r.history=a+(s||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(e,r){this.refinal(e,r);}_final(e){this.refinal(void 0,e);}_write(e,r,n){this.rewrite([{chunk:e,encoding:r}],0,n);}_writev(e,r){this.rewrite(e,0,r);}async refinal(e,r){try{this.clear(),this.initPromise&&await this.initPromise,this.timeoutPromise&&await this.timeoutPromise,await this.reclose();}catch(n){return r(e||n)}r(e);}async rewrite(e,r,n){let{size:s,teeToStdout:i}=this.options;try{this.initPromise&&await this.initPromise;for(let o=0;o<e.length;++o){let{chunk:a}=e[o];this.size+=a.length,this.timeoutPromise&&await this.timeoutPromise,await this.file.write(a),i&&!this.stdout.destroyed&&this.stdout.write(a),s&&this.size>=s&&await this.rotate();}}catch(o){return n(o)}n();}async init(){let{immutable:e,initialRotation:r,interval:n,size:s}=this.options;if(e)return new Promise((o,a)=>process.nextTick(()=>this.immutate(!0).then(o).catch(a)));let i;try{i=await promises.stat(this.filename);}catch(o){if(o.code!=="ENOENT")throw o;return this.reopen(0)}if(!i.isFile())throw new Error(`Can't write on: ${this.filename} (it is not a file)`);if(r){this.intervalBounds(this.now());let o=this.prev;if(this.intervalBounds(new Date(i.mtime.getTime())),o!==this.prev)return this.rotate()}return this.size=i.size,!s||i.size<s?this.reopen(i.size):(n&&this.intervalBounds(this.now()),this.rotate())}async makePath(e){return promises.mkdir(e.split(path.sep).slice(0,-1).join(path.sep),{recursive:!0})}async reopen(e){let r;try{r=await promises.open(this.filename,"a",this.options.mode);}catch(n){if(n.code!=="ENOENT")throw n;await this.makePath(this.filename),r=await promises.open(this.filename,"a",this.options.mode);}this.file=r,this.size=e,this.interval(),this.emit("open",this.filename);}async reclose(){let{file:e}=this;if(e)return delete this.file,e.close()}now(){return new Date}async rotate(){let{immutable:e,rotate:r}=this.options;return this.size=0,this.rotation=this.now(),this.clear(),this.emit("rotation"),await this.reclose(),r?this.classical():e?this.immutate(!1):this.move()}async findName(){let{interval:e,path:r,intervalBoundary:n}=this.options;for(let s=1;s<1e3;++s){let i=r+this.generator(e&&n?new Date(this.prev):this.rotation,s);if(!await zb(i))return i}throw new Pn}async move(){let{compress:e}=this.options,r=await this.findName();return await this.touch(r),e?await this.compress(r):await promises.rename(this.filename,r),this.rotated(r)}async touch(e){let r;try{r=await this.fsOpen(e,"a");}catch(n){if(n.code!=="ENOENT")throw n;await this.makePath(e),r=await promises.open(e,"a");}return await r.close(),this.unlink(e)}async classical(){let{compress:e,path:r,rotate:n}=this.options,s="";for(let i=n;i>0;--i){let o=r+this.generator(i),a=i===1?this.filename:r+this.generator(i-1);if(await zb(a))if(s||(s=o),i===1&&e)await this.compress(o);else try{await promises.rename(a,o);}catch(c){if(c.code!=="ENOENT")throw c;await this.makePath(o),await promises.rename(a,o);}}return this.rotated(s)}clear(){return this.timeout&&(clearTimeout(this.timeout),this.timeout=null),!0}intervalBoundsBig(e){let r=e.getFullYear(),n=e.getMonth(),s=e.getDate(),i=e.getHours(),{num:o,unit:a}=this.options.interval;a==="M"?(s=1,i=0):a==="d"?i=0:i=parseInt(i/o,10)*o,this.prev=new Date(r,n,s,i,0,0,0).getTime(),a==="M"?n+=o:a==="d"?s+=o:i+=o,this.next=new Date(r,n,s,i,0,0,0).getTime();}intervalBounds(e){let r=this.options.interval.unit;if(r==="M"||r==="d"||r==="h")this.intervalBoundsBig(e);else {let n=1e3*this.options.interval.num;r==="m"&&(n*=60),this.prev=parseInt(e.getTime()/n,10)*n,this.next=this.prev+n;}return new Date(this.prev)}interval(){if(!this.options.interval)return;this.intervalBounds(this.now());let e=async()=>{let r=this.next-this.now().getTime();if(r<=0)try{this.timeoutPromise=this.rotate(),await this.timeoutPromise,delete this.timeoutPromise;}catch{}else this.timeout=setTimeout(e,r>this.maxTimeout?this.maxTimeout:r),this.timeout.unref();};e();}async compress(e){let{compress:r}=this.options;return typeof r=="function"?await new Promise((n,s)=>{this.exec(r(this.filename,e),(i,o,a)=>{this.emit("external",o,a),i?s(i):n();});}):await this.gzip(e),this.unlink(this.filename)}async gzip(e){let{mode:r}=this.options,n=r?{mode:r}:{},s=this.fsCreateReadStream(this.filename,{}),i=this.fsCreateWriteStream(e,n),o=this.createGzip();return new Promise((a,c)=>{[s,i,o].map(d=>d.once("error",c)),i.once("finish",a),s.pipe(o).pipe(i);})}async rotated(e){let{maxFiles:r,maxSize:n}=this.options;return (r||n)&&await this.history(e),this.emit("rotated",e),this.reopen(0)}async history(e){let{history:r,maxFiles:n,maxSize:s}=this.options,i=[],o=[e];try{o=[...(await this.fsReadFile(r,"utf8")).toString().split(`
|
||
`),e];}catch(a){if(a.code!=="ENOENT")throw a}for(let a of o)if(a)try{let c=await this.fsStat(a);c.isFile()?i.push({name:a,size:c.size,time:c.ctime.getTime()}):this.emit("warning",new Error(`File '${a}' contained in history is not a regular file`));}catch(c){if(c.code!=="ENOENT")throw c}if(i.sort((a,c)=>a.time-c.time),n)for(;i.length>n;){let a=i.shift();await this.unlink(a.name),this.emit("removed",a.name,!0);}if(s)for(;i.reduce((a,c)=>a+c.size,0)>s;){let a=i.shift();await this.unlink(a.name),this.emit("removed",a.name,!1);}await promises.writeFile(r,i.map(a=>a.name).join(`
|
||
`)+`
|
||
`,"utf-8"),this.emit("history");}async immutate(e){let{size:r}=this.options,n=this.now();for(let s=1;s<1e3;++s){let i=0,o;this.filename=this.options.path+this.generator(n,s);try{o=await this.fsStat(this.filename);}catch(a){if(a.code!=="ENOENT")throw a}if(o){if(i=o.size,!o.isFile())throw new Error(`Can't write on: '${this.filename}' (it is not a file)`);if(r&&i>=r)continue}if(e)return this.last=this.filename,this.reopen(i);await this.rotated(this.last),this.last=this.filename;return}throw new Pn}async unlink(e){try{await this.fsUnlink(e);}catch(r){if(r.code!=="ENOENT")throw r;this.emit("warning",r);}}};ak={M:!0,d:!0,h:!0,m:!0,s:!0};uk={B:!0,G:!0,K:!0,M:!0};Kb={encoding:(t,e,r)=>new util.TextDecoder(r),immutable:()=>{},initialRotation:()=>{},interval:xu("interval",lk),intervalBoundary:()=>{},maxFiles:Gb("maxFiles"),maxSize:xu("maxSize",Vb),mode:()=>{},omitExtension:()=>{},rotate:Gb("rotate"),size:xu("size",Vb),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={};Xs(ev,{allLoggers:()=>Lr,rootLogger:()=>be});var Ts,Xb,Qb,be,Lr,_t=jn(()=>{Ts=fr(jb());Ft();Xb=(Jb(),Qs(Yb)).createStream("tabby-agent.log",{path:G("path").join(G("os").homedir(),".tabby-client","agent","logs"),size:"10M",interval:"1d"}),Qb={serializers:{error:Ts.default.stdSerializers.err}},be=Xb?(0, Ts.default)(Qb,Xb):(0, Ts.default)(Qb);be.level="silent";Lr=[be];be.onChild=t=>{Lr.push(t);};});var rv=T((gD,tv)=>{tv.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,a,c){this.message=n,this.expected=s,this.found=i,this.offset=o,this.line=a,this.column=c,this.name="SyntaxError";}t(e,Error);function r(n){var s=arguments.length>1?arguments[1]:{},i={},o={start:hc},a=hc,d=function(){return Oc},u=i,p="#",_={type:"literal",value:"#",description:'"#"'},m=void 0,y={type:"any",description:"any character"},v="[",E={type:"literal",value:"[",description:'"["'},A="]",w={type:"literal",value:"]",description:'"]"'},x=function(l){Ys(Pe("ObjectPath",l,Te,Ie));},M=function(l){Ys(Pe("ArrayPath",l,Te,Ie));},k=function(l,h){return l.concat(h)},j=function(l){return [l]},U=function(l){return l},$=".",F={type:"literal",value:".",description:'"."'},B="=",R={type:"literal",value:"=",description:'"="'},z=function(l,h){Ys(Pe("Assign",h,Te,Ie,l));},V=function(l){return l.join("")},te=function(l){return l.value},I='"""',O={type:"literal",value:'"""',description:'"\\"\\"\\""'},X=null,Q=function(l){return Pe("String",l.join(""),Te,Ie)},ie='"',Ne={type:"literal",value:'"',description:'"\\""'},ve="'''",Et={type:"literal",value:"'''",description:`"'''"`},Hr="'",At={type:"literal",value:"'",description:`"'"`},nt=function(l){return l},se=function(l){return l},lr="\\",js={type:"literal",value:"\\",description:'"\\\\"'},Z=function(){return ""},he="e",W={type:"literal",value:"e",description:'"e"'},ne="E",de={type:"literal",value:"E",description:'"E"'},Re=function(l,h){return Pe("Float",parseFloat(l+"e"+h),Te,Ie)},ge=function(l){return Pe("Float",parseFloat(l),Te,Ie)},Wt="+",xt={type:"literal",value:"+",description:'"+"'},ju=function(l){return l.join("")},jr="-",Wr={type:"literal",value:"-",description:'"-"'},Wu=function(l){return "-"+l.join("")},jv=function(l){return Pe("Integer",parseInt(l,10),Te,Ie)},zu="true",Wv={type:"literal",value:"true",description:'"true"'},zv=function(){return Pe("Boolean",!0,Te,Ie)},Gu="false",Gv={type:"literal",value:"false",description:'"false"'},Vv=function(){return Pe("Boolean",!1,Te,Ie)},Kv=function(){return Pe("Array",[],Te,Ie)},Zv=function(l){return Pe("Array",l?[l]:[],Te,Ie)},Yv=function(l){return Pe("Array",l,Te,Ie)},Jv=function(l,h){return Pe("Array",l.concat(h),Te,Ie)},Vu=function(l){return l},Ku=",",Zu={type:"literal",value:",",description:'","'},Xv="{",Qv={type:"literal",value:"{",description:'"{"'},eS="}",tS={type:"literal",value:"}",description:'"}"'},rS=function(l){return Pe("InlineTable",l,Te,Ie)},Yu=function(l,h){return Pe("InlineTableValue",h,Te,Ie,l)},nS=function(l){return "."+l},iS=function(l){return l.join("")},zr=":",Gr={type:"literal",value:":",description:'":"'},Ju=function(l){return l.join("")},Xu="T",Qu={type:"literal",value:"T",description:'"T"'},sS="Z",oS={type:"literal",value:"Z",description:'"Z"'},aS=function(l,h){return Pe("Date",new Date(l+"T"+h+"Z"),Te,Ie)},lS=function(l,h){return Pe("Date",new Date(l+"T"+h),Te,Ie)},uS=/^[ \t]/,cS={type:"class",value:"[ \\t]",description:"[ \\t]"},ec=`
|
||
`,tc={type:"literal",value:`
|
||
`,description:'"\\n"'},fS="\r",hS={type:"literal",value:"\r",description:'"\\r"'},dS=/^[0-9a-f]/i,pS={type:"class",value:"[0-9a-f]i",description:"[0-9a-f]i"},mS=/^[0-9]/,_S={type:"class",value:"[0-9]",description:"[0-9]"},gS="_",yS={type:"literal",value:"_",description:'"_"'},wS=function(){return ""},bS=/^[A-Za-z0-9_\-]/,vS={type:"class",value:"[A-Za-z0-9_\\-]",description:"[A-Za-z0-9_\\-]"},SS=function(l){return l.join("")},rc='\\"',ES={type:"literal",value:'\\"',description:'"\\\\\\""'},AS=function(){return '"'},nc="\\\\",xS={type:"literal",value:"\\\\",description:'"\\\\\\\\"'},CS=function(){return "\\"},ic="\\b",RS={type:"literal",value:"\\b",description:'"\\\\b"'},TS=function(){return "\b"},sc="\\t",IS={type:"literal",value:"\\t",description:'"\\\\t"'},PS=function(){return " "},oc="\\n",OS={type:"literal",value:"\\n",description:'"\\\\n"'},MS=function(){return `
|
||
`},ac="\\f",NS={type:"literal",value:"\\f",description:'"\\\\f"'},kS=function(){return "\f"},lc="\\r",$S={type:"literal",value:"\\r",description:'"\\\\r"'},LS=function(){return "\r"},uc="\\U",DS={type:"literal",value:"\\U",description:'"\\\\U"'},cc=function(l){return iE(l.join(""))},fc="\\u",qS={type:"literal",value:"\\u",description:'"\\\\u"'},f=0,Y=0,Vr=0,Ws={line:1,column:1,seenCR:!1},Ln=0,zs=[],D=0,q={},Dn;if("startRule"in s){if(!(s.startRule in o))throw new Error(`Can't start parsing from rule "`+s.startRule+'".');a=o[s.startRule];}function Te(){return Gs(Y).line}function Ie(){return Gs(Y).column}function Gs(l){function h(g,b,S){var P,N;for(P=b;P<S;P++)N=n.charAt(P),N===`
|
||
`?(g.seenCR||g.line++,g.column=1,g.seenCR=!1):N==="\r"||N==="\u2028"||N==="\u2029"?(g.line++,g.column=1,g.seenCR=!0):(g.column++,g.seenCR=!1);}return Vr!==l&&(Vr>l&&(Vr=0,Ws={line:1,column:1,seenCR:!1}),h(Ws,Vr,l),Vr=l),Ws}function H(l){f<Ln||(f>Ln&&(Ln=f,zs=[]),zs.push(l));}function Vs(l,h,g){function b(K){var re=1;for(K.sort(function(ce,le){return ce.description<le.description?-1:ce.description>le.description?1:0});re<K.length;)K[re-1]===K[re]?K.splice(re,1):re++;}function S(K,re){function ce(cr){function Ct(Ve){return Ve.charCodeAt(0).toString(16).toUpperCase()}return cr.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(Ve){return "\\x0"+Ct(Ve)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(Ve){return "\\x"+Ct(Ve)}).replace(/[\u0180-\u0FFF]/g,function(Ve){return "\\u0"+Ct(Ve)}).replace(/[\u1080-\uFFFF]/g,function(Ve){return "\\u"+Ct(Ve)})}var le=new Array(K.length),pe,ye,Ge;for(Ge=0;Ge<K.length;Ge++)le[Ge]=K[Ge].description;return pe=K.length>1?le.slice(0,-1).join(", ")+" or "+le[K.length-1]:le[0],ye=re?'"'+ce(re)+'"':"end of input","Expected "+pe+" but "+ye+" found."}var P=Gs(g),N=g<n.length?n.charAt(g):null;return h!==null&&b(h),new e(l!==null?l:S(h,N),h,N,g,P.line,P.column)}function hc(){var l,h,g,b=f*49+0,S=q[b];if(S)return f=S.nextPos,S.result;for(l=f,h=[],g=dc();g!==i;)h.push(g),g=dc();return h!==i&&(Y=l,h=d()),l=h,q[b]={nextPos:f,result:l},l}function dc(){var l,h,g,b,S,P,N,K=f*49+1,re=q[K];if(re)return f=re.nextPos,re.result;for(l=f,h=[],g=J();g!==i;)h.push(g),g=J();if(h!==i)if(g=BS(),g!==i){for(b=[],S=J();S!==i;)b.push(S),S=J();if(b!==i){for(S=[],P=qn();P!==i;)S.push(P),P=qn();if(S!==i){if(P=[],N=Je(),N!==i)for(;N!==i;)P.push(N),N=Je();else P=u;P===i&&(P=Un()),P!==i?(h=[h,g,b,S,P],l=h):(f=l,l=u);}else f=l,l=u;}else f=l,l=u;}else f=l,l=u;else f=l,l=u;if(l===i){if(l=f,h=[],g=J(),g!==i)for(;g!==i;)h.push(g),g=J();else h=u;if(h!==i){if(g=[],b=Je(),b!==i)for(;b!==i;)g.push(b),b=Je();else g=u;g===i&&(g=Un()),g!==i?(h=[h,g],l=h):(f=l,l=u);}else f=l,l=u;l===i&&(l=Je());}return q[K]={nextPos:f,result:l},l}function BS(){var l,h=f*49+2,g=q[h];return g?(f=g.nextPos,g.result):(l=qn(),l===i&&(l=US(),l===i&&(l=HS(),l===i&&(l=jS()))),q[h]={nextPos:f,result:l},l)}function qn(){var l,h,g,b,S,P,N=f*49+3,K=q[N];if(K)return f=K.nextPos,K.result;if(l=f,n.charCodeAt(f)===35?(h=p,f++):(h=i,D===0&&H(_)),h!==i){for(g=[],b=f,S=f,D++,P=Je(),P===i&&(P=Un()),D--,P===i?S=m:(f=S,S=u),S!==i?(n.length>f?(P=n.charAt(f),f++):(P=i,D===0&&H(y)),P!==i?(S=[S,P],b=S):(f=b,b=u)):(f=b,b=u);b!==i;)g.push(b),b=f,S=f,D++,P=Je(),P===i&&(P=Un()),D--,P===i?S=m:(f=S,S=u),S!==i?(n.length>f?(P=n.charAt(f),f++):(P=i,D===0&&H(y)),P!==i?(S=[S,P],b=S):(f=b,b=u)):(f=b,b=u);g!==i?(h=[h,g],l=h):(f=l,l=u);}else f=l,l=u;return q[N]={nextPos:f,result:l},l}function US(){var l,h,g,b,S,P,N=f*49+4,K=q[N];if(K)return f=K.nextPos,K.result;if(l=f,n.charCodeAt(f)===91?(h=v,f++):(h=i,D===0&&H(E)),h!==i){for(g=[],b=J();b!==i;)g.push(b),b=J();if(g!==i)if(b=pc(),b!==i){for(S=[],P=J();P!==i;)S.push(P),P=J();S!==i?(n.charCodeAt(f)===93?(P=A,f++):(P=i,D===0&&H(w)),P!==i?(Y=l,h=x(b),l=h):(f=l,l=u)):(f=l,l=u);}else f=l,l=u;else f=l,l=u;}else f=l,l=u;return q[N]={nextPos:f,result:l},l}function HS(){var l,h,g,b,S,P,N,K,re=f*49+5,ce=q[re];if(ce)return f=ce.nextPos,ce.result;if(l=f,n.charCodeAt(f)===91?(h=v,f++):(h=i,D===0&&H(E)),h!==i)if(n.charCodeAt(f)===91?(g=v,f++):(g=i,D===0&&H(E)),g!==i){for(b=[],S=J();S!==i;)b.push(S),S=J();if(b!==i)if(S=pc(),S!==i){for(P=[],N=J();N!==i;)P.push(N),N=J();P!==i?(n.charCodeAt(f)===93?(N=A,f++):(N=i,D===0&&H(w)),N!==i?(n.charCodeAt(f)===93?(K=A,f++):(K=i,D===0&&H(w)),K!==i?(Y=l,h=M(S),l=h):(f=l,l=u)):(f=l,l=u)):(f=l,l=u);}else f=l,l=u;else f=l,l=u;}else f=l,l=u;else f=l,l=u;return q[re]={nextPos:f,result:l},l}function pc(){var l,h,g,b=f*49+6,S=q[b];if(S)return f=S.nextPos,S.result;if(l=f,h=[],g=_c(),g!==i)for(;g!==i;)h.push(g),g=_c();else h=u;return h!==i?(g=mc(),g!==i?(Y=l,h=k(h,g),l=h):(f=l,l=u)):(f=l,l=u),l===i&&(l=f,h=mc(),h!==i&&(Y=l,h=j(h)),l=h),q[b]={nextPos:f,result:l},l}function mc(){var l,h,g,b,S,P=f*49+7,N=q[P];if(N)return f=N.nextPos,N.result;for(l=f,h=[],g=J();g!==i;)h.push(g),g=J();if(h!==i)if(g=Kr(),g!==i){for(b=[],S=J();S!==i;)b.push(S),S=J();b!==i?(Y=l,h=U(g),l=h):(f=l,l=u);}else f=l,l=u;else f=l,l=u;if(l===i){for(l=f,h=[],g=J();g!==i;)h.push(g),g=J();if(h!==i)if(g=Ks(),g!==i){for(b=[],S=J();S!==i;)b.push(S),S=J();b!==i?(Y=l,h=U(g),l=h):(f=l,l=u);}else f=l,l=u;else f=l,l=u;}return q[P]={nextPos:f,result:l},l}function _c(){var l,h,g,b,S,P,N,K=f*49+8,re=q[K];if(re)return f=re.nextPos,re.result;for(l=f,h=[],g=J();g!==i;)h.push(g),g=J();if(h!==i)if(g=Kr(),g!==i){for(b=[],S=J();S!==i;)b.push(S),S=J();if(b!==i)if(n.charCodeAt(f)===46?(S=$,f++):(S=i,D===0&&H(F)),S!==i){for(P=[],N=J();N!==i;)P.push(N),N=J();P!==i?(Y=l,h=U(g),l=h):(f=l,l=u);}else f=l,l=u;else f=l,l=u;}else f=l,l=u;else f=l,l=u;if(l===i){for(l=f,h=[],g=J();g!==i;)h.push(g),g=J();if(h!==i)if(g=Ks(),g!==i){for(b=[],S=J();S!==i;)b.push(S),S=J();if(b!==i)if(n.charCodeAt(f)===46?(S=$,f++):(S=i,D===0&&H(F)),S!==i){for(P=[],N=J();N!==i;)P.push(N),N=J();P!==i?(Y=l,h=U(g),l=h):(f=l,l=u);}else f=l,l=u;else f=l,l=u;}else f=l,l=u;else f=l,l=u;}return q[K]={nextPos:f,result:l},l}function jS(){var l,h,g,b,S,P,N=f*49+9,K=q[N];if(K)return f=K.nextPos,K.result;if(l=f,h=Kr(),h!==i){for(g=[],b=J();b!==i;)g.push(b),b=J();if(g!==i)if(n.charCodeAt(f)===61?(b=B,f++):(b=i,D===0&&H(R)),b!==i){for(S=[],P=J();P!==i;)S.push(P),P=J();S!==i?(P=ur(),P!==i?(Y=l,h=z(h,P),l=h):(f=l,l=u)):(f=l,l=u);}else f=l,l=u;else f=l,l=u;}else f=l,l=u;if(l===i)if(l=f,h=Ks(),h!==i){for(g=[],b=J();b!==i;)g.push(b),b=J();if(g!==i)if(n.charCodeAt(f)===61?(b=B,f++):(b=i,D===0&&H(R)),b!==i){for(S=[],P=J();P!==i;)S.push(P),P=J();S!==i?(P=ur(),P!==i?(Y=l,h=z(h,P),l=h):(f=l,l=u)):(f=l,l=u);}else f=l,l=u;else f=l,l=u;}else f=l,l=u;return q[N]={nextPos:f,result:l},l}function Kr(){var l,h,g,b=f*49+10,S=q[b];if(S)return f=S.nextPos,S.result;if(l=f,h=[],g=Ic(),g!==i)for(;g!==i;)h.push(g),g=Ic();else h=u;return h!==i&&(Y=l,h=V(h)),l=h,q[b]={nextPos:f,result:l},l}function Ks(){var l,h,g=f*49+11,b=q[g];return b?(f=b.nextPos,b.result):(l=f,h=gc(),h!==i&&(Y=l,h=te(h)),l=h,l===i&&(l=f,h=yc(),h!==i&&(Y=l,h=te(h)),l=h),q[g]={nextPos:f,result:l},l)}function ur(){var l,h=f*49+12,g=q[h];return g?(f=g.nextPos,g.result):(l=WS(),l===i&&(l=tE(),l===i&&(l=KS(),l===i&&(l=ZS(),l===i&&(l=YS(),l===i&&(l=JS(),l===i&&(l=XS())))))),q[h]={nextPos:f,result:l},l)}function WS(){var l,h=f*49+13,g=q[h];return g?(f=g.nextPos,g.result):(l=zS(),l===i&&(l=gc(),l===i&&(l=GS(),l===i&&(l=yc()))),q[h]={nextPos:f,result:l},l)}function zS(){var l,h,g,b,S,P=f*49+14,N=q[P];if(N)return f=N.nextPos,N.result;if(l=f,n.substr(f,3)===I?(h=I,f+=3):(h=i,D===0&&H(O)),h!==i)if(g=Je(),g===i&&(g=X),g!==i){for(b=[],S=vc();S!==i;)b.push(S),S=vc();b!==i?(n.substr(f,3)===I?(S=I,f+=3):(S=i,D===0&&H(O)),S!==i?(Y=l,h=Q(b),l=h):(f=l,l=u)):(f=l,l=u);}else f=l,l=u;else f=l,l=u;return q[P]={nextPos:f,result:l},l}function gc(){var l,h,g,b,S=f*49+15,P=q[S];if(P)return f=P.nextPos,P.result;if(l=f,n.charCodeAt(f)===34?(h=ie,f++):(h=i,D===0&&H(Ne)),h!==i){for(g=[],b=wc();b!==i;)g.push(b),b=wc();g!==i?(n.charCodeAt(f)===34?(b=ie,f++):(b=i,D===0&&H(Ne)),b!==i?(Y=l,h=Q(g),l=h):(f=l,l=u)):(f=l,l=u);}else f=l,l=u;return q[S]={nextPos:f,result:l},l}function GS(){var l,h,g,b,S,P=f*49+16,N=q[P];if(N)return f=N.nextPos,N.result;if(l=f,n.substr(f,3)===ve?(h=ve,f+=3):(h=i,D===0&&H(Et)),h!==i)if(g=Je(),g===i&&(g=X),g!==i){for(b=[],S=Sc();S!==i;)b.push(S),S=Sc();b!==i?(n.substr(f,3)===ve?(S=ve,f+=3):(S=i,D===0&&H(Et)),S!==i?(Y=l,h=Q(b),l=h):(f=l,l=u)):(f=l,l=u);}else f=l,l=u;else f=l,l=u;return q[P]={nextPos:f,result:l},l}function yc(){var l,h,g,b,S=f*49+17,P=q[S];if(P)return f=P.nextPos,P.result;if(l=f,n.charCodeAt(f)===39?(h=Hr,f++):(h=i,D===0&&H(At)),h!==i){for(g=[],b=bc();b!==i;)g.push(b),b=bc();g!==i?(n.charCodeAt(f)===39?(b=Hr,f++):(b=i,D===0&&H(At)),b!==i?(Y=l,h=Q(g),l=h):(f=l,l=u)):(f=l,l=u);}else f=l,l=u;return q[S]={nextPos:f,result:l},l}function wc(){var l,h,g,b=f*49+18,S=q[b];return S?(f=S.nextPos,S.result):(l=Pc(),l===i&&(l=f,h=f,D++,n.charCodeAt(f)===34?(g=ie,f++):(g=i,D===0&&H(Ne)),D--,g===i?h=m:(f=h,h=u),h!==i?(n.length>f?(g=n.charAt(f),f++):(g=i,D===0&&H(y)),g!==i?(Y=l,h=nt(g),l=h):(f=l,l=u)):(f=l,l=u)),q[b]={nextPos:f,result:l},l)}function bc(){var l,h,g,b=f*49+19,S=q[b];return S?(f=S.nextPos,S.result):(l=f,h=f,D++,n.charCodeAt(f)===39?(g=Hr,f++):(g=i,D===0&&H(At)),D--,g===i?h=m:(f=h,h=u),h!==i?(n.length>f?(g=n.charAt(f),f++):(g=i,D===0&&H(y)),g!==i?(Y=l,h=nt(g),l=h):(f=l,l=u)):(f=l,l=u),q[b]={nextPos:f,result:l},l)}function vc(){var l,h,g,b=f*49+20,S=q[b];return S?(f=S.nextPos,S.result):(l=Pc(),l===i&&(l=VS(),l===i&&(l=f,h=f,D++,n.substr(f,3)===I?(g=I,f+=3):(g=i,D===0&&H(O)),D--,g===i?h=m:(f=h,h=u),h!==i?(n.length>f?(g=n.charAt(f),f++):(g=i,D===0&&H(y)),g!==i?(Y=l,h=se(g),l=h):(f=l,l=u)):(f=l,l=u))),q[b]={nextPos:f,result:l},l)}function VS(){var l,h,g,b,S,P=f*49+21,N=q[P];if(N)return f=N.nextPos,N.result;if(l=f,n.charCodeAt(f)===92?(h=lr,f++):(h=i,D===0&&H(js)),h!==i)if(g=Je(),g!==i){for(b=[],S=Tc();S!==i;)b.push(S),S=Tc();b!==i?(Y=l,h=Z(),l=h):(f=l,l=u);}else f=l,l=u;else f=l,l=u;return q[P]={nextPos:f,result:l},l}function Sc(){var l,h,g,b=f*49+22,S=q[b];return S?(f=S.nextPos,S.result):(l=f,h=f,D++,n.substr(f,3)===ve?(g=ve,f+=3):(g=i,D===0&&H(Et)),D--,g===i?h=m:(f=h,h=u),h!==i?(n.length>f?(g=n.charAt(f),f++):(g=i,D===0&&H(y)),g!==i?(Y=l,h=nt(g),l=h):(f=l,l=u)):(f=l,l=u),q[b]={nextPos:f,result:l},l)}function KS(){var l,h,g,b,S=f*49+23,P=q[S];return P?(f=P.nextPos,P.result):(l=f,h=Ec(),h===i&&(h=Zs()),h!==i?(n.charCodeAt(f)===101?(g=he,f++):(g=i,D===0&&H(W)),g===i&&(n.charCodeAt(f)===69?(g=ne,f++):(g=i,D===0&&H(de))),g!==i?(b=Zs(),b!==i?(Y=l,h=Re(h,b),l=h):(f=l,l=u)):(f=l,l=u)):(f=l,l=u),l===i&&(l=f,h=Ec(),h!==i&&(Y=l,h=ge(h)),l=h),q[S]={nextPos:f,result:l},l)}function Ec(){var l,h,g,b,S,P,N=f*49+24,K=q[N];return K?(f=K.nextPos,K.result):(l=f,n.charCodeAt(f)===43?(h=Wt,f++):(h=i,D===0&&H(xt)),h===i&&(h=X),h!==i?(g=f,b=Zr(),b!==i?(n.charCodeAt(f)===46?(S=$,f++):(S=i,D===0&&H(F)),S!==i?(P=Zr(),P!==i?(b=[b,S,P],g=b):(f=g,g=u)):(f=g,g=u)):(f=g,g=u),g!==i?(Y=l,h=ju(g),l=h):(f=l,l=u)):(f=l,l=u),l===i&&(l=f,n.charCodeAt(f)===45?(h=jr,f++):(h=i,D===0&&H(Wr)),h!==i?(g=f,b=Zr(),b!==i?(n.charCodeAt(f)===46?(S=$,f++):(S=i,D===0&&H(F)),S!==i?(P=Zr(),P!==i?(b=[b,S,P],g=b):(f=g,g=u)):(f=g,g=u)):(f=g,g=u),g!==i?(Y=l,h=Wu(g),l=h):(f=l,l=u)):(f=l,l=u)),q[N]={nextPos:f,result:l},l)}function ZS(){var l,h,g=f*49+25,b=q[g];return b?(f=b.nextPos,b.result):(l=f,h=Zs(),h!==i&&(Y=l,h=jv(h)),l=h,q[g]={nextPos:f,result:l},l)}function Zs(){var l,h,g,b,S,P=f*49+26,N=q[P];if(N)return f=N.nextPos,N.result;if(l=f,n.charCodeAt(f)===43?(h=Wt,f++):(h=i,D===0&&H(xt)),h===i&&(h=X),h!==i){if(g=[],b=ue(),b!==i)for(;b!==i;)g.push(b),b=ue();else g=u;g!==i?(b=f,D++,n.charCodeAt(f)===46?(S=$,f++):(S=i,D===0&&H(F)),D--,S===i?b=m:(f=b,b=u),b!==i?(Y=l,h=ju(g),l=h):(f=l,l=u)):(f=l,l=u);}else f=l,l=u;if(l===i)if(l=f,n.charCodeAt(f)===45?(h=jr,f++):(h=i,D===0&&H(Wr)),h!==i){if(g=[],b=ue(),b!==i)for(;b!==i;)g.push(b),b=ue();else g=u;g!==i?(b=f,D++,n.charCodeAt(f)===46?(S=$,f++):(S=i,D===0&&H(F)),D--,S===i?b=m:(f=b,b=u),b!==i?(Y=l,h=Wu(g),l=h):(f=l,l=u)):(f=l,l=u);}else f=l,l=u;return q[P]={nextPos:f,result:l},l}function YS(){var l,h,g=f*49+27,b=q[g];return b?(f=b.nextPos,b.result):(l=f,n.substr(f,4)===zu?(h=zu,f+=4):(h=i,D===0&&H(Wv)),h!==i&&(Y=l,h=zv()),l=h,l===i&&(l=f,n.substr(f,5)===Gu?(h=Gu,f+=5):(h=i,D===0&&H(Gv)),h!==i&&(Y=l,h=Vv()),l=h),q[g]={nextPos:f,result:l},l)}function JS(){var l,h,g,b,S,P=f*49+28,N=q[P];if(N)return f=N.nextPos,N.result;if(l=f,n.charCodeAt(f)===91?(h=v,f++):(h=i,D===0&&H(E)),h!==i){for(g=[],b=Ye();b!==i;)g.push(b),b=Ye();g!==i?(n.charCodeAt(f)===93?(b=A,f++):(b=i,D===0&&H(w)),b!==i?(Y=l,h=Kv(),l=h):(f=l,l=u)):(f=l,l=u);}else f=l,l=u;if(l===i&&(l=f,n.charCodeAt(f)===91?(h=v,f++):(h=i,D===0&&H(E)),h!==i?(g=Ac(),g===i&&(g=X),g!==i?(n.charCodeAt(f)===93?(b=A,f++):(b=i,D===0&&H(w)),b!==i?(Y=l,h=Zv(g),l=h):(f=l,l=u)):(f=l,l=u)):(f=l,l=u),l===i)){if(l=f,n.charCodeAt(f)===91?(h=v,f++):(h=i,D===0&&H(E)),h!==i){if(g=[],b=Bn(),b!==i)for(;b!==i;)g.push(b),b=Bn();else g=u;g!==i?(n.charCodeAt(f)===93?(b=A,f++):(b=i,D===0&&H(w)),b!==i?(Y=l,h=Yv(g),l=h):(f=l,l=u)):(f=l,l=u);}else f=l,l=u;if(l===i)if(l=f,n.charCodeAt(f)===91?(h=v,f++):(h=i,D===0&&H(E)),h!==i){if(g=[],b=Bn(),b!==i)for(;b!==i;)g.push(b),b=Bn();else g=u;g!==i?(b=Ac(),b!==i?(n.charCodeAt(f)===93?(S=A,f++):(S=i,D===0&&H(w)),S!==i?(Y=l,h=Jv(g,b),l=h):(f=l,l=u)):(f=l,l=u)):(f=l,l=u);}else f=l,l=u;}return q[P]={nextPos:f,result:l},l}function Ac(){var l,h,g,b,S,P=f*49+29,N=q[P];if(N)return f=N.nextPos,N.result;for(l=f,h=[],g=Ye();g!==i;)h.push(g),g=Ye();if(h!==i)if(g=ur(),g!==i){for(b=[],S=Ye();S!==i;)b.push(S),S=Ye();b!==i?(Y=l,h=Vu(g),l=h):(f=l,l=u);}else f=l,l=u;else f=l,l=u;return q[P]={nextPos:f,result:l},l}function Bn(){var l,h,g,b,S,P,N,K=f*49+30,re=q[K];if(re)return f=re.nextPos,re.result;for(l=f,h=[],g=Ye();g!==i;)h.push(g),g=Ye();if(h!==i)if(g=ur(),g!==i){for(b=[],S=Ye();S!==i;)b.push(S),S=Ye();if(b!==i)if(n.charCodeAt(f)===44?(S=Ku,f++):(S=i,D===0&&H(Zu)),S!==i){for(P=[],N=Ye();N!==i;)P.push(N),N=Ye();P!==i?(Y=l,h=Vu(g),l=h):(f=l,l=u);}else f=l,l=u;else f=l,l=u;}else f=l,l=u;else f=l,l=u;return q[K]={nextPos:f,result:l},l}function Ye(){var l,h=f*49+31,g=q[h];return g?(f=g.nextPos,g.result):(l=J(),l===i&&(l=Je(),l===i&&(l=qn())),q[h]={nextPos:f,result:l},l)}function XS(){var l,h,g,b,S,P,N=f*49+32,K=q[N];if(K)return f=K.nextPos,K.result;if(l=f,n.charCodeAt(f)===123?(h=Xv,f++):(h=i,D===0&&H(Qv)),h!==i){for(g=[],b=J();b!==i;)g.push(b),b=J();if(g!==i){for(b=[],S=xc();S!==i;)b.push(S),S=xc();if(b!==i){for(S=[],P=J();P!==i;)S.push(P),P=J();S!==i?(n.charCodeAt(f)===125?(P=eS,f++):(P=i,D===0&&H(tS)),P!==i?(Y=l,h=rS(b),l=h):(f=l,l=u)):(f=l,l=u);}else f=l,l=u;}else f=l,l=u;}else f=l,l=u;return q[N]={nextPos:f,result:l},l}function xc(){var l,h,g,b,S,P,N,K,re,ce,le,pe=f*49+33,ye=q[pe];if(ye)return f=ye.nextPos,ye.result;for(l=f,h=[],g=J();g!==i;)h.push(g),g=J();if(h!==i)if(g=Kr(),g!==i){for(b=[],S=J();S!==i;)b.push(S),S=J();if(b!==i)if(n.charCodeAt(f)===61?(S=B,f++):(S=i,D===0&&H(R)),S!==i){for(P=[],N=J();N!==i;)P.push(N),N=J();if(P!==i)if(N=ur(),N!==i){for(K=[],re=J();re!==i;)K.push(re),re=J();if(K!==i)if(n.charCodeAt(f)===44?(re=Ku,f++):(re=i,D===0&&H(Zu)),re!==i){for(ce=[],le=J();le!==i;)ce.push(le),le=J();ce!==i?(Y=l,h=Yu(g,N),l=h):(f=l,l=u);}else f=l,l=u;else f=l,l=u;}else f=l,l=u;else f=l,l=u;}else f=l,l=u;else f=l,l=u;}else f=l,l=u;else f=l,l=u;if(l===i){for(l=f,h=[],g=J();g!==i;)h.push(g),g=J();if(h!==i)if(g=Kr(),g!==i){for(b=[],S=J();S!==i;)b.push(S),S=J();if(b!==i)if(n.charCodeAt(f)===61?(S=B,f++):(S=i,D===0&&H(R)),S!==i){for(P=[],N=J();N!==i;)P.push(N),N=J();P!==i?(N=ur(),N!==i?(Y=l,h=Yu(g,N),l=h):(f=l,l=u)):(f=l,l=u);}else f=l,l=u;else f=l,l=u;}else f=l,l=u;else f=l,l=u;}return q[pe]={nextPos:f,result:l},l}function Cc(){var l,h,g,b=f*49+34,S=q[b];return S?(f=S.nextPos,S.result):(l=f,n.charCodeAt(f)===46?(h=$,f++):(h=i,D===0&&H(F)),h!==i?(g=Zr(),g!==i?(Y=l,h=nS(g),l=h):(f=l,l=u)):(f=l,l=u),q[b]={nextPos:f,result:l},l)}function Rc(){var l,h,g,b,S,P,N,K,re,ce,le,pe,ye=f*49+35,Ge=q[ye];return Ge?(f=Ge.nextPos,Ge.result):(l=f,h=f,g=ue(),g!==i?(b=ue(),b!==i?(S=ue(),S!==i?(P=ue(),P!==i?(n.charCodeAt(f)===45?(N=jr,f++):(N=i,D===0&&H(Wr)),N!==i?(K=ue(),K!==i?(re=ue(),re!==i?(n.charCodeAt(f)===45?(ce=jr,f++):(ce=i,D===0&&H(Wr)),ce!==i?(le=ue(),le!==i?(pe=ue(),pe!==i?(g=[g,b,S,P,N,K,re,ce,le,pe],h=g):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u),h!==i&&(Y=l,h=iS(h)),l=h,q[ye]={nextPos:f,result:l},l)}function QS(){var l,h,g,b,S,P,N,K,re,ce,le,pe=f*49+36,ye=q[pe];return ye?(f=ye.nextPos,ye.result):(l=f,h=f,g=ue(),g!==i?(b=ue(),b!==i?(n.charCodeAt(f)===58?(S=zr,f++):(S=i,D===0&&H(Gr)),S!==i?(P=ue(),P!==i?(N=ue(),N!==i?(n.charCodeAt(f)===58?(K=zr,f++):(K=i,D===0&&H(Gr)),K!==i?(re=ue(),re!==i?(ce=ue(),ce!==i?(le=Cc(),le===i&&(le=X),le!==i?(g=[g,b,S,P,N,K,re,ce,le],h=g):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u),h!==i&&(Y=l,h=Ju(h)),l=h,q[pe]={nextPos:f,result:l},l)}function eE(){var l,h,g,b,S,P,N,K,re,ce,le,pe,ye,Ge,cr,Ct,Ve,Mc=f*49+37,Js=q[Mc];return Js?(f=Js.nextPos,Js.result):(l=f,h=f,g=ue(),g!==i?(b=ue(),b!==i?(n.charCodeAt(f)===58?(S=zr,f++):(S=i,D===0&&H(Gr)),S!==i?(P=ue(),P!==i?(N=ue(),N!==i?(n.charCodeAt(f)===58?(K=zr,f++):(K=i,D===0&&H(Gr)),K!==i?(re=ue(),re!==i?(ce=ue(),ce!==i?(le=Cc(),le===i&&(le=X),le!==i?(n.charCodeAt(f)===45?(pe=jr,f++):(pe=i,D===0&&H(Wr)),pe===i&&(n.charCodeAt(f)===43?(pe=Wt,f++):(pe=i,D===0&&H(xt))),pe!==i?(ye=ue(),ye!==i?(Ge=ue(),Ge!==i?(n.charCodeAt(f)===58?(cr=zr,f++):(cr=i,D===0&&H(Gr)),cr!==i?(Ct=ue(),Ct!==i?(Ve=ue(),Ve!==i?(g=[g,b,S,P,N,K,re,ce,le,pe,ye,Ge,cr,Ct,Ve],h=g):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u),h!==i&&(Y=l,h=Ju(h)),l=h,q[Mc]={nextPos:f,result:l},l)}function tE(){var l,h,g,b,S,P=f*49+38,N=q[P];return N?(f=N.nextPos,N.result):(l=f,h=Rc(),h!==i?(n.charCodeAt(f)===84?(g=Xu,f++):(g=i,D===0&&H(Qu)),g!==i?(b=QS(),b!==i?(n.charCodeAt(f)===90?(S=sS,f++):(S=i,D===0&&H(oS)),S!==i?(Y=l,h=aS(h,b),l=h):(f=l,l=u)):(f=l,l=u)):(f=l,l=u)):(f=l,l=u),l===i&&(l=f,h=Rc(),h!==i?(n.charCodeAt(f)===84?(g=Xu,f++):(g=i,D===0&&H(Qu)),g!==i?(b=eE(),b!==i?(Y=l,h=lS(h,b),l=h):(f=l,l=u)):(f=l,l=u)):(f=l,l=u)),q[P]={nextPos:f,result:l},l)}function J(){var l,h=f*49+39,g=q[h];return g?(f=g.nextPos,g.result):(uS.test(n.charAt(f))?(l=n.charAt(f),f++):(l=i,D===0&&H(cS)),q[h]={nextPos:f,result:l},l)}function Je(){var l,h,g,b=f*49+40,S=q[b];return S?(f=S.nextPos,S.result):(n.charCodeAt(f)===10?(l=ec,f++):(l=i,D===0&&H(tc)),l===i&&(l=f,n.charCodeAt(f)===13?(h=fS,f++):(h=i,D===0&&H(hS)),h!==i?(n.charCodeAt(f)===10?(g=ec,f++):(g=i,D===0&&H(tc)),g!==i?(h=[h,g],l=h):(f=l,l=u)):(f=l,l=u)),q[b]={nextPos:f,result:l},l)}function Tc(){var l,h=f*49+41,g=q[h];return g?(f=g.nextPos,g.result):(l=Je(),l===i&&(l=J()),q[h]={nextPos:f,result:l},l)}function Un(){var l,h,g=f*49+42,b=q[g];return b?(f=b.nextPos,b.result):(l=f,D++,n.length>f?(h=n.charAt(f),f++):(h=i,D===0&&H(y)),D--,h===i?l=m:(f=l,l=u),q[g]={nextPos:f,result:l},l)}function Xe(){var l,h=f*49+43,g=q[h];return g?(f=g.nextPos,g.result):(dS.test(n.charAt(f))?(l=n.charAt(f),f++):(l=i,D===0&&H(pS)),q[h]={nextPos:f,result:l},l)}function ue(){var l,h,g=f*49+44,b=q[g];return b?(f=b.nextPos,b.result):(mS.test(n.charAt(f))?(l=n.charAt(f),f++):(l=i,D===0&&H(_S)),l===i&&(l=f,n.charCodeAt(f)===95?(h=gS,f++):(h=i,D===0&&H(yS)),h!==i&&(Y=l,h=wS()),l=h),q[g]={nextPos:f,result:l},l)}function Ic(){var l,h=f*49+45,g=q[h];return g?(f=g.nextPos,g.result):(bS.test(n.charAt(f))?(l=n.charAt(f),f++):(l=i,D===0&&H(vS)),q[h]={nextPos:f,result:l},l)}function Zr(){var l,h,g,b=f*49+46,S=q[b];if(S)return f=S.nextPos,S.result;if(l=f,h=[],g=ue(),g!==i)for(;g!==i;)h.push(g),g=ue();else h=u;return h!==i&&(Y=l,h=SS(h)),l=h,q[b]={nextPos:f,result:l},l}function Pc(){var l,h,g=f*49+47,b=q[g];return b?(f=b.nextPos,b.result):(l=f,n.substr(f,2)===rc?(h=rc,f+=2):(h=i,D===0&&H(ES)),h!==i&&(Y=l,h=AS()),l=h,l===i&&(l=f,n.substr(f,2)===nc?(h=nc,f+=2):(h=i,D===0&&H(xS)),h!==i&&(Y=l,h=CS()),l=h,l===i&&(l=f,n.substr(f,2)===ic?(h=ic,f+=2):(h=i,D===0&&H(RS)),h!==i&&(Y=l,h=TS()),l=h,l===i&&(l=f,n.substr(f,2)===sc?(h=sc,f+=2):(h=i,D===0&&H(IS)),h!==i&&(Y=l,h=PS()),l=h,l===i&&(l=f,n.substr(f,2)===oc?(h=oc,f+=2):(h=i,D===0&&H(OS)),h!==i&&(Y=l,h=MS()),l=h,l===i&&(l=f,n.substr(f,2)===ac?(h=ac,f+=2):(h=i,D===0&&H(NS)),h!==i&&(Y=l,h=kS()),l=h,l===i&&(l=f,n.substr(f,2)===lc?(h=lc,f+=2):(h=i,D===0&&H($S)),h!==i&&(Y=l,h=LS()),l=h,l===i&&(l=rE()))))))),q[g]={nextPos:f,result:l},l)}function rE(){var l,h,g,b,S,P,N,K,re,ce,le,pe=f*49+48,ye=q[pe];return ye?(f=ye.nextPos,ye.result):(l=f,n.substr(f,2)===uc?(h=uc,f+=2):(h=i,D===0&&H(DS)),h!==i?(g=f,b=Xe(),b!==i?(S=Xe(),S!==i?(P=Xe(),P!==i?(N=Xe(),N!==i?(K=Xe(),K!==i?(re=Xe(),re!==i?(ce=Xe(),ce!==i?(le=Xe(),le!==i?(b=[b,S,P,N,K,re,ce,le],g=b):(f=g,g=u)):(f=g,g=u)):(f=g,g=u)):(f=g,g=u)):(f=g,g=u)):(f=g,g=u)):(f=g,g=u)):(f=g,g=u),g!==i?(Y=l,h=cc(g),l=h):(f=l,l=u)):(f=l,l=u),l===i&&(l=f,n.substr(f,2)===fc?(h=fc,f+=2):(h=i,D===0&&H(qS)),h!==i?(g=f,b=Xe(),b!==i?(S=Xe(),S!==i?(P=Xe(),P!==i?(N=Xe(),N!==i?(b=[b,S,P,N],g=b):(f=g,g=u)):(f=g,g=u)):(f=g,g=u)):(f=g,g=u),g!==i?(Y=l,h=cc(g),l=h):(f=l,l=u)):(f=l,l=u)),q[pe]={nextPos:f,result:l},l)}var Oc=[];function nE(l,h,g){var b=new Error(l);throw b.line=h,b.column=g,b}function Ys(l){Oc.push(l);}function Pe(l,h,g,b,S){var P={type:l,value:h,line:g(),column:b()};return S&&(P.key=S),P}function iE(l,h,g){var b=parseInt("0x"+l);if(!isFinite(b)||Math.floor(b)!=b||b<0||b>1114111||b>55295&&b<57344)nE("Invalid Unicode escape code: "+l,h,g);else return sE(b)}function sE(){var l=16384,h=[],g,b,S=-1,P=arguments.length;if(!P)return "";for(var N="";++S<P;){var K=Number(arguments[S]);K<=65535?h.push(K):(K-=65536,g=(K>>10)+55296,b=K%1024+56320,h.push(g,b)),(S+1==P||h.length>l)&&(N+=String.fromCharCode.apply(null,h),h.length=0);}return N}if(Dn=a(),Dn!==i&&f===n.length)return Dn;throw Dn!==i&&f<n.length&&H({type:"end",description:"end of input"}),Vs(null,zs,Ln)}return {SyntaxError:e,parse:r}}();});var iv=T((yD,nv)=>{function mk(t){var e=[],r=[],n="",s=Object.create(null),i=s;return a(t);function a(w){for(var x,M=0;M<w.length;M++)switch(x=w[M],x.type){case"Assign":d(x);break;case"ObjectPath":m(x);break;case"ArrayPath":y(x);break}return s}function c(w,x,M){var k=new Error(w);throw k.line=x,k.column=M,k}function d(w){var x=w.key,M=w.value,k=w.line,j=w.column,U;n?U=n+"."+x:U=x,typeof i[x]<"u"&&c("Cannot redefine existing key '"+U+"'.",k,j),i[x]=p(M),u(U)||(e.push(U),r.push(U));}function u(w){return e.indexOf(w)!==-1}function p(w){return w.type==="Array"?E(w.value):w.type==="InlineTable"?_(w.value):w.value}function _(w){for(var x=Object.create(null),M=0;M<w.length;M++){var k=w[M];k.value.type==="InlineTable"?x[k.key]=_(k.value.value):k.type==="InlineTableValue"&&(x[k.key]=p(k.value));}return x}function m(w){var x=w.value,M=x.map(A).join("."),k=w.line,j=w.column;u(M)&&c("Cannot redefine existing key '"+x+"'.",k,j),e.push(M),i=v(s,x,Object.create(null),k,j),n=x;}function y(w){var x=w.value,M=x.map(A).join("."),k=w.line,j=w.column;if(u(M)||e.push(M),e=e.filter(function($){return $.indexOf(M)!==0}),e.push(M),i=v(s,x,[],k,j),n=M,i instanceof Array){var U=Object.create(null);i.push(U),i=U;}else c("Cannot redefine existing key '"+x+"'.",k,j);}function v(w,x,M,k,j){for(var U=[],$="",F=x.join("."),B=w,R=0;R<x.length;R++){var z=x[R];U.push(z),$=U.join("."),typeof B[z]>"u"?R===x.length-1?B[z]=M:B[z]=Object.create(null):R!==x.length-1&&r.indexOf($)>-1&&c("Cannot redefine existing key '"+$+"'.",k,j),B=B[z],B instanceof Array&&B.length&&R<x.length-1&&(B=B[B.length-1]);}return B}function E(w){for(var x=null,M=0;M<w.length;M++){var k=w[M];x===null?x=k.type:k.type!==x&&c("Cannot add value of type "+k.type+" to array of type "+x+".",k.line,k.column);}return w.map(p)}function A(w){return w.indexOf(".")>-1?'"'+w+'"':w}}nv.exports={compile:mk};});var ov=T((wD,sv)=>{var _k=rv(),gk=iv();sv.exports={parse:function(t){var e=_k.parse(t.toString());return gk.compile(e)}};});var yv=T((ar,gv)=>{var Pu=G("crypto");ar=gv.exports=Fn;function Fn(t,e){return e=mv(t,e),vk(t,e)}ar.sha1=function(t){return Fn(t)};ar.keys=function(t){return Fn(t,{excludeValues:!0,algorithm:"sha1",encoding:"hex"})};ar.MD5=function(t){return Fn(t,{algorithm:"md5",encoding:"hex"})};ar.keysMD5=function(t){return Fn(t,{algorithm:"md5",encoding:"hex",excludeValues:!0})};var Br=Pu.getHashes?Pu.getHashes().slice():["sha1","md5"];Br.push("passthrough");var dv=["buffer","hex","binary","base64"];function mv(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<Br.length;++n)Br[n].toLowerCase()===r.algorithm.toLowerCase()&&(r.algorithm=Br[n]);if(Br.indexOf(r.algorithm)===-1)throw new Error('Algorithm "'+r.algorithm+'" not supported. supported values: '+Br.join(", "));if(dv.indexOf(r.encoding)===-1&&r.algorithm!=="passthrough")throw new Error('Encoding "'+r.encoding+'" not supported. supported values: '+dv.join(", "));return r}function pv(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 vk(t,e){var r;e.algorithm!=="passthrough"?r=Pu.createHash(e.algorithm):r=new _v,typeof r.write>"u"&&(r.write=r.update,r.end=r.update);var n=Ou(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)}ar.writeToStream=function(t,e,r){return typeof r>"u"&&(r=e,e={}),e=mv(t,e),Ou(e,r).dispatch(t)};function Ou(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),a=i.exec(o);a?a=a[1]:a="unknown:["+o+"]",a=a.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(a!=="object"&&a!=="function"&&a!=="asyncfunction")if(this["_"+a])this["_"+a](s);else {if(t.ignoreUnknown)return n("["+a+"]");throw new Error('Unknown object type "'+a+'"')}else {var d=Object.keys(s);t.unorderedObjects&&(d=d.sort()),t.respectType!==!1&&!pv(s)&&d.splice(0,0,"prototype","__proto__","constructor"),t.excludeKeys&&(d=d.filter(function(p){return !t.excludeKeys(p)})),n("object:"+d.length+":");var u=this;return d.forEach(function(p){u.dispatch(p),n(":"),t.excludeValues||u.dispatch(s[p]),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(d){return o.dispatch(d)});var a=[],c=s.map(function(d){var u=new _v,p=r.slice(),_=Ou(t,u,p);return _.dispatch(d),a=a.concat(p.slice(r.length)),u.read().toString()});return r=r.concat(a),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:"),pv(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 _v(){return {buf:"",write:function(t){this.buf+=t;},end:function(t){this.buf+=t;},read:function(){return this.buf}}}});var Av=T((exports,module)=>{var Module=Module!==void 0?Module:{},TreeSitter=function(){var initPromise,document=typeof window=="object"?{currentScript:window.document.currentScript}:null;class Parser{constructor(){this.initialize();}initialize(){throw new Error("cannot construct a Parser before calling `init()`")}static init(moduleOptions){return initPromise||(Module=Object.assign({},Module,moduleOptions),initPromise=new Promise(resolveInitPromise=>{var moduleOverrides=Object.assign({},Module),arguments_=[],thisProgram="./this.program",quit_=(t,e)=>{throw e},ENVIRONMENT_IS_WEB=typeof window=="object",ENVIRONMENT_IS_WORKER=typeof importScripts=="function",ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",scriptDirectory="",read_,readAsync,readBinary;function locateFile(t){return Module.locateFile?Module.locateFile(t,scriptDirectory):scriptDirectory+t}function logExceptionOnExit(t){t instanceof ExitStatus||err("exiting due to exception: "+t);}if(ENVIRONMENT_IS_NODE){var fs=G("fs"),nodePath=G("path");scriptDirectory=ENVIRONMENT_IS_WORKER?nodePath.dirname(scriptDirectory)+"/":__dirname+"/",read_=(t,e)=>(t=isFileURI(t)?new URL(t):nodePath.normalize(t),fs.readFileSync(t,e?void 0:"utf8")),readBinary=t=>{var e=read_(t,!0);return e.buffer||(e=new Uint8Array(e)),e},readAsync=(t,e,r)=>{t=isFileURI(t)?new URL(t):nodePath.normalize(t),fs.readFile(t,function(n,s){n?r(n):e(s.buffer);});},process.argv.length>1&&(thisProgram=process.argv[1].replace(/\\/g,"/")),arguments_=process.argv.slice(2),typeof module<"u"&&(module.exports=Module),quit_=(t,e)=>{if(keepRuntimeAlive())throw process.exitCode=t,e;logExceptionOnExit(e),process.exit(t);},Module.inspect=function(){return "[Emscripten Module object]"};}else (ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&(ENVIRONMENT_IS_WORKER?scriptDirectory=self.location.href:document!==void 0&&document.currentScript&&(scriptDirectory=document.currentScript.src),scriptDirectory=scriptDirectory.indexOf("blob:")!==0?scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1):"",read_=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},ENVIRONMENT_IS_WORKER&&(readBinary=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),readAsync=(t,e,r)=>{var n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="arraybuffer",n.onload=()=>{n.status==200||n.status==0&&n.response?e(n.response):r();},n.onerror=r,n.send(null);},t=>document.title=t);Module.print||console.log.bind(console);var err=Module.printErr||console.warn.bind(console);Object.assign(Module,moduleOverrides),moduleOverrides=null,Module.arguments&&(arguments_=Module.arguments),Module.thisProgram&&(thisProgram=Module.thisProgram),Module.quit&&(quit_=Module.quit);var STACK_ALIGN=16,dynamicLibraries=Module.dynamicLibraries||[],wasmBinary;Module.wasmBinary&&(wasmBinary=Module.wasmBinary);var noExitRuntime=Module.noExitRuntime||!0,wasmMemory;typeof WebAssembly!="object"&&abort("no native wasm support detected");var ABORT=!1,EXITSTATUS,UTF8Decoder=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,buffer,HEAP8,HEAPU8,HEAP16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function UTF8ArrayToString(t,e,r){for(var n=e+r,s=e;t[s]&&!(s>=n);)++s;if(s-e>16&&t.buffer&&UTF8Decoder)return UTF8Decoder.decode(t.subarray(e,s));for(var i="";e<s;){var o=t[e++];if(128&o){var a=63&t[e++];if((224&o)!=192){var c=63&t[e++];if((o=(240&o)==224?(15&o)<<12|a<<6|c:(7&o)<<18|a<<12|c<<6|63&t[e++])<65536)i+=String.fromCharCode(o);else {var d=o-65536;i+=String.fromCharCode(55296|d>>10,56320|1023&d);}}else i+=String.fromCharCode((31&o)<<6|a);}else i+=String.fromCharCode(o);}return i}function UTF8ToString(t,e){return t?UTF8ArrayToString(HEAPU8,t,e):""}function stringToUTF8Array(t,e,r,n){if(!(n>0))return 0;for(var s=r,i=r+n-1,o=0;o<t.length;++o){var a=t.charCodeAt(o);if(a>=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&t.charCodeAt(++o)),a<=127){if(r>=i)break;e[r++]=a;}else if(a<=2047){if(r+1>=i)break;e[r++]=192|a>>6,e[r++]=128|63&a;}else if(a<=65535){if(r+2>=i)break;e[r++]=224|a>>12,e[r++]=128|a>>6&63,e[r++]=128|63&a;}else {if(r+3>=i)break;e[r++]=240|a>>18,e[r++]=128|a>>12&63,e[r++]=128|a>>6&63,e[r++]=128|63&a;}}return e[r]=0,r-s}function stringToUTF8(t,e,r){return stringToUTF8Array(t,HEAPU8,e,r)}function lengthBytesUTF8(t){for(var e=0,r=0;r<t.length;++r){var n=t.charCodeAt(r);n<=127?e++:n<=2047?e+=2:n>=55296&&n<=57343?(e+=4,++r):e+=3;}return e}function updateGlobalBufferAndViews(t){buffer=t,Module.HEAP8=HEAP8=new Int8Array(t),Module.HEAP16=HEAP16=new Int16Array(t),Module.HEAP32=HEAP32=new Int32Array(t),Module.HEAPU8=HEAPU8=new Uint8Array(t),Module.HEAPU16=new Uint16Array(t),Module.HEAPU32=HEAPU32=new Uint32Array(t),Module.HEAPF32=HEAPF32=new Float32Array(t),Module.HEAPF64=HEAPF64=new Float64Array(t);}var INITIAL_MEMORY=Module.INITIAL_MEMORY||33554432;wasmMemory=Module.wasmMemory?Module.wasmMemory:new WebAssembly.Memory({initial:INITIAL_MEMORY/65536,maximum:32768}),wasmMemory&&(buffer=wasmMemory.buffer),INITIAL_MEMORY=buffer.byteLength,updateGlobalBufferAndViews(buffer);var wasmTable=new WebAssembly.Table({initial:20,element:"anyfunc"}),__ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATPOSTRUN__=[],__RELOC_FUNCS__=[],runtimeInitialized=!1;function keepRuntimeAlive(){return noExitRuntime}function preRun(){if(Module.preRun)for(typeof Module.preRun=="function"&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__);}function initRuntime(){runtimeInitialized=!0,callRuntimeCallbacks(__RELOC_FUNCS__),callRuntimeCallbacks(__ATINIT__);}function preMain(){callRuntimeCallbacks(__ATMAIN__);}function postRun(){if(Module.postRun)for(typeof Module.postRun=="function"&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__);}function addOnPreRun(t){__ATPRERUN__.unshift(t);}function addOnInit(t){__ATINIT__.unshift(t);}function addOnPostRun(t){__ATPOSTRUN__.unshift(t);}var runDependencies=0,dependenciesFulfilled=null;function addRunDependency(t){runDependencies++,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies);}function removeRunDependency(t){if(runDependencies--,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies),runDependencies==0&&(dependenciesFulfilled)){var e=dependenciesFulfilled;dependenciesFulfilled=null,e();}}function abort(t){throw Module.onAbort&&Module.onAbort(t),err(t="Aborted("+t+")"),ABORT=!0,EXITSTATUS=1,t+=". Build with -sASSERTIONS for more info.",new WebAssembly.RuntimeError(t)}var dataURIPrefix="data:application/octet-stream;base64,",wasmBinaryFile,tempDouble,tempI64;function isDataURI(t){return t.startsWith(dataURIPrefix)}function isFileURI(t){return t.startsWith("file://")}function getBinary(t){try{if(t==wasmBinaryFile&&wasmBinary)return new Uint8Array(wasmBinary);if(readBinary)return readBinary(t);throw "both async and sync fetching of the wasm failed"}catch(e){abort(e);}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch=="function"&&!isFileURI(wasmBinaryFile))return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(t){if(!t.ok)throw "failed to load wasm binary file at '"+wasmBinaryFile+"'";return t.arrayBuffer()}).catch(function(){return getBinary(wasmBinaryFile)});if(readAsync)return new Promise(function(t,e){readAsync(wasmBinaryFile,function(r){t(new Uint8Array(r));},e);})}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var t={env:asmLibraryArg,wasi_snapshot_preview1:asmLibraryArg,"GOT.mem":new Proxy(asmLibraryArg,GOTHandler),"GOT.func":new Proxy(asmLibraryArg,GOTHandler)};function e(s,i){var o=s.exports;o=relocateExports(o,1024);var a=getDylinkMetadata(i);a.neededDynlibs&&(dynamicLibraries=a.neededDynlibs.concat(dynamicLibraries)),mergeLibSymbols(o),Module.asm=o,addOnInit(Module.asm.__wasm_call_ctors),__RELOC_FUNCS__.push(Module.asm.__wasm_apply_data_relocs),removeRunDependency();}function r(s){e(s.instance,s.module);}function n(s){return getBinaryPromise().then(function(i){return WebAssembly.instantiate(i,t)}).then(function(i){return i}).then(s,function(i){err("failed to asynchronously prepare wasm: "+i),abort(i);})}if(addRunDependency(),Module.instantiateWasm)try{return Module.instantiateWasm(t,e)}catch(s){return err("Module.instantiateWasm callback failed with error: "+s),!1}return wasmBinary||typeof WebAssembly.instantiateStreaming!="function"||isDataURI(wasmBinaryFile)||isFileURI(wasmBinaryFile)||ENVIRONMENT_IS_NODE||typeof fetch!="function"?n(r):fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(s){return WebAssembly.instantiateStreaming(s,t).then(r,function(i){return err("wasm streaming compile failed: "+i),err("falling back to ArrayBuffer instantiation"),n(r)})}),{}}wasmBinaryFile="tree-sitter.wasm",isDataURI(wasmBinaryFile)||(wasmBinaryFile=locateFile(wasmBinaryFile));function ExitStatus(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t;}var GOT={},CurrentModuleWeakSymbols=new Set([]),GOTHandler={get:function(t,e){var r=GOT[e];return r||(r=GOT[e]=new WebAssembly.Global({value:"i32",mutable:!0})),CurrentModuleWeakSymbols.has(e)||(r.required=!0),r}};function callRuntimeCallbacks(t){for(;t.length>0;)t.shift()(Module);}function getDylinkMetadata(t){var e=0,r=0;function n(){for(var A=0,w=1;;){var x=t[e++];if(A+=(127&x)*w,w*=128,!(128&x))break}return A}function s(){var A=n();return UTF8ArrayToString(t,(e+=A)-A,A)}function i(A,w){if(A)throw new Error(w)}var o="dylink.0";if(t instanceof WebAssembly.Module){var a=WebAssembly.Module.customSections(t,o);a.length===0&&(o="dylink",a=WebAssembly.Module.customSections(t,o)),i(a.length===0,"need dylink section"),r=(t=new Uint8Array(a[0])).length;}else {i(new Uint32Array(new Uint8Array(t.subarray(0,24)).buffer)[0]!=1836278016,"need to see wasm magic number"),i(t[8]!==0,"need the dylink section to be first"),e=9;var c=n();r=e+c,o=s();}var d={neededDynlibs:[],tlsExports:new Set,weakImports:new Set};if(o=="dylink"){d.memorySize=n(),d.memoryAlign=n(),d.tableSize=n(),d.tableAlign=n();for(var u=n(),p=0;p<u;++p){var _=s();d.neededDynlibs.push(_);}}else for(i(o!=="dylink.0");e<r;){var m=t[e++],y=n();if(m===1)d.memorySize=n(),d.memoryAlign=n(),d.tableSize=n(),d.tableAlign=n();else if(m===2)for(u=n(),p=0;p<u;++p)_=s(),d.neededDynlibs.push(_);else if(m===3)for(var v=n();v--;){var E=s();256&n()&&d.tlsExports.add(E);}else if(m===4)for(v=n();v--;)s(),E=s(),(3&n())==1&&d.weakImports.add(E);else e+=y;}return d}function getValue(t,e="i8"){switch(e.endsWith("*")&&(e="*"),e){case"i1":case"i8":return HEAP8[t>>0];case"i16":return HEAP16[t>>1];case"i32":case"i64":return HEAP32[t>>2];case"float":return HEAPF32[t>>2];case"double":return HEAPF64[t>>3];case"*":return HEAPU32[t>>2];default:abort("invalid type for getValue: "+e);}return null}function asmjsMangle(t){return t.indexOf("dynCall_")==0||["stackAlloc","stackSave","stackRestore","getTempRet0","setTempRet0"].includes(t)?t:"_"+t}function mergeLibSymbols(t,e){for(var r in t)if(t.hasOwnProperty(r)){asmLibraryArg.hasOwnProperty(r)||(asmLibraryArg[r]=t[r]);var n=asmjsMangle(r);Module.hasOwnProperty(n)||(Module[n]=t[r]),r=="__main_argc_argv"&&(Module._main=t[r]);}}var LDSO={loadedLibsByName:{},loadedLibsByHandle:{}};function dynCallLegacy(t,e,r){var n=Module["dynCall_"+t];return r&&r.length?n.apply(null,[e].concat(r)):n.call(null,e)}var wasmTableMirror=[];function getWasmTableEntry(t){var e=wasmTableMirror[t];return e||(t>=wasmTableMirror.length&&(wasmTableMirror.length=t+1),wasmTableMirror[t]=e=wasmTable.get(t)),e}function dynCall(t,e,r){return t.includes("j")?dynCallLegacy(t,e,r):getWasmTableEntry(e).apply(null,r)}function createInvokeFunction(t){return function(){var e=stackSave();try{return dynCall(t,arguments[0],Array.prototype.slice.call(arguments,1))}catch(r){if(stackRestore(e),r!==r+0)throw r;_setThrew(1,0);}}}var ___heap_base=78144;function zeroMemory(t,e){return HEAPU8.fill(0,t,t+e),t}function getMemory(t){if(runtimeInitialized)return zeroMemory(_malloc(t),t);var e=___heap_base,r=e+t+15&-16;return ___heap_base=r,GOT.__heap_base.value=r,e}function isInternalSym(t){return ["__cpp_exception","__c_longjmp","__wasm_apply_data_relocs","__dso_handle","__tls_size","__tls_align","__set_stack_limits","_emscripten_tls_init","__wasm_init_tls","__wasm_call_ctors","__start_em_asm","__stop_em_asm"].includes(t)}function uleb128Encode(t,e){t<128?e.push(t):e.push(t%128|128,t>>7);}function sigToWasmTypes(t){for(var e={i:"i32",j:"i32",f:"f32",d:"f64",p:"i32"},r={parameters:[],results:t[0]=="v"?[]:[e[t[0]]]},n=1;n<t.length;++n)r.parameters.push(e[t[n]]),t[n]==="j"&&r.parameters.push("i32");return r}function generateFuncType(t,e){var r=t.slice(0,1),n=t.slice(1),s={i:127,p:127,j:126,f:125,d:124};e.push(96),uleb128Encode(n.length,e);for(var i=0;i<n.length;++i)e.push(s[n[i]]);r=="v"?e.push(0):e.push(1,s[r]);}function convertJsFunctionToWasm(t,e){if(typeof WebAssembly.Function=="function")return new WebAssembly.Function(sigToWasmTypes(e),t);var r=[1];generateFuncType(e,r);var n=[0,97,115,109,1,0,0,0,1];uleb128Encode(r.length,n),n.push.apply(n,r),n.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);var s=new WebAssembly.Module(new Uint8Array(n));return new WebAssembly.Instance(s,{e:{f:t}}).exports.f}function updateTableMap(t,e){if(functionsInTableMap)for(var r=t;r<t+e;r++){var n=getWasmTableEntry(r);n&&functionsInTableMap.set(n,r);}}var functionsInTableMap=void 0,freeTableIndexes=[];function getEmptyTableSlot(){if(freeTableIndexes.length)return freeTableIndexes.pop();try{wasmTable.grow(1);}catch(t){throw t instanceof RangeError?"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.":t}return wasmTable.length-1}function setWasmTableEntry(t,e){wasmTable.set(t,e),wasmTableMirror[t]=wasmTable.get(t);}function addFunction(t,e){if(functionsInTableMap||(functionsInTableMap=new WeakMap,updateTableMap(0,wasmTable.length)),functionsInTableMap.has(t))return functionsInTableMap.get(t);var r=getEmptyTableSlot();try{setWasmTableEntry(r,t);}catch(n){if(!(n instanceof TypeError))throw n;setWasmTableEntry(r,convertJsFunctionToWasm(t,e));}return functionsInTableMap.set(t,r),r}function updateGOT(t,e){for(var r in t)if(!isInternalSym(r)){var n=t[r];r.startsWith("orig$")&&(r=r.split("$")[1],e=!0),GOT[r]||(GOT[r]=new WebAssembly.Global({value:"i32",mutable:!0})),(e||GOT[r].value==0)&&(typeof n=="function"?GOT[r].value=addFunction(n):typeof n=="number"?GOT[r].value=n:err("unhandled export type for `"+r+"`: "+typeof n));}}function relocateExports(t,e,r){var n={};for(var s in t){var i=t[s];typeof i=="object"&&(i=i.value),typeof i=="number"&&(i+=e),n[s]=i;}return updateGOT(n,r),n}function resolveGlobalSymbol(t,e){var r;return e&&(r=asmLibraryArg["orig$"+t]),r||(r=asmLibraryArg[t])&&r.stub&&(r=void 0),r||(r=Module[asmjsMangle(t)]),!r&&t.startsWith("invoke_")&&(r=createInvokeFunction(t.split("_")[1])),r}function alignMemory(t,e){return Math.ceil(t/e)*e}function loadWebAssemblyModule(binary,flags,handle){var metadata=getDylinkMetadata(binary);function loadModule(){var firstLoad=!handle||!HEAP8[handle+12>>0];if(firstLoad){var memAlign=Math.pow(2,metadata.memoryAlign);memAlign=Math.max(memAlign,STACK_ALIGN);var memoryBase=metadata.memorySize?alignMemory(getMemory(metadata.memorySize+memAlign),memAlign):0,tableBase=metadata.tableSize?wasmTable.length:0;handle&&(HEAP8[handle+12>>0]=1,HEAPU32[handle+16>>2]=memoryBase,HEAP32[handle+20>>2]=metadata.memorySize,HEAPU32[handle+24>>2]=tableBase,HEAP32[handle+28>>2]=metadata.tableSize);}else memoryBase=HEAPU32[handle+16>>2],tableBase=HEAPU32[handle+24>>2];var tableGrowthNeeded=tableBase+metadata.tableSize-wasmTable.length,moduleExports;function resolveSymbol(t){var e=resolveGlobalSymbol(t,!1);return e||(e=moduleExports[t]),e}tableGrowthNeeded>0&&wasmTable.grow(tableGrowthNeeded);var proxyHandler={get:function(t,e){switch(e){case"__memory_base":return memoryBase;case"__table_base":return tableBase}if(e in asmLibraryArg)return asmLibraryArg[e];var r;return e in t||(t[e]=function(){return r||(r=resolveSymbol(e)),r.apply(null,arguments)}),t[e]}},proxy=new Proxy({},proxyHandler),info={"GOT.mem":new Proxy({},GOTHandler),"GOT.func":new Proxy({},GOTHandler),env:proxy,wasi_snapshot_preview1:proxy};function postInstantiation(instance){function addEmAsm(addr,body){for(var args=[],arity=0;arity<16&&body.indexOf("$"+arity)!=-1;arity++)args.push("$"+arity);args=args.join(",");var func="("+args+" ) => { "+body+"};";eval(func);}if(updateTableMap(tableBase,metadata.tableSize),moduleExports=relocateExports(instance.exports,memoryBase),flags.allowUndefined||reportUndefinedSymbols(),"__start_em_asm"in moduleExports)for(var start=moduleExports.__start_em_asm,stop=moduleExports.__stop_em_asm;start<stop;){var jsString=UTF8ToString(start);addEmAsm(start,jsString),start=HEAPU8.indexOf(0,start)+1;}var applyRelocs=moduleExports.__wasm_apply_data_relocs;applyRelocs&&(runtimeInitialized?applyRelocs():__RELOC_FUNCS__.push(applyRelocs));var init=moduleExports.__wasm_call_ctors;return init&&(runtimeInitialized?init():__ATINIT__.push(init)),moduleExports}if(flags.loadAsync){if(binary instanceof WebAssembly.Module){var instance=new WebAssembly.Instance(binary,info);return Promise.resolve(postInstantiation(instance))}return WebAssembly.instantiate(binary,info).then(function(t){return postInstantiation(t.instance)})}var module=binary instanceof WebAssembly.Module?binary:new WebAssembly.Module(binary),instance=new WebAssembly.Instance(module,info);return postInstantiation(instance)}return CurrentModuleWeakSymbols=metadata.weakImports,flags.loadAsync?metadata.neededDynlibs.reduce(function(t,e){return t.then(function(){return loadDynamicLibrary(e,flags)})},Promise.resolve()).then(function(){return loadModule()}):(metadata.neededDynlibs.forEach(function(t){loadDynamicLibrary(t,flags);}),loadModule())}function loadDynamicLibrary(t,e,r){e=e||{global:!0,nodelete:!0};var n=LDSO.loadedLibsByName[t];if(n)return e.global&&!n.global&&(n.global=!0,n.module!=="loading"&&mergeLibSymbols(n.module)),e.nodelete&&n.refcount!==1/0&&(n.refcount=1/0),n.refcount++,r&&(LDSO.loadedLibsByHandle[r]=n),!e.loadAsync||Promise.resolve(!0);function s(a){if(e.fs&&e.fs.findObject(a)){var c=e.fs.readFile(a,{encoding:"binary"});return c instanceof Uint8Array||(c=new Uint8Array(c)),e.loadAsync?Promise.resolve(c):c}if(a=locateFile(a),e.loadAsync)return new Promise(function(d,u){readAsync(a,p=>d(new Uint8Array(p)),u);});if(!readBinary)throw new Error(a+": file not found, and synchronous loading of external files is not available");return readBinary(a)}function i(){if(typeof preloadedWasm<"u"&&preloadedWasm[t]){var a=preloadedWasm[t];return e.loadAsync?Promise.resolve(a):a}return e.loadAsync?s(t).then(function(c){return loadWebAssemblyModule(c,e,r)}):loadWebAssemblyModule(s(t),e,r)}function o(a){n.global&&mergeLibSymbols(a),n.module=a;}return n={refcount:e.nodelete?1/0:1,name:t,module:"loading",global:e.global},LDSO.loadedLibsByName[t]=n,r&&(LDSO.loadedLibsByHandle[r]=n),e.loadAsync?i().then(function(a){return o(a),!0}):(o(i()),!0)}function reportUndefinedSymbols(){for(var t in GOT)if(GOT[t].value==0){var e=resolveGlobalSymbol(t,!0);if(!e&&!GOT[t].required)continue;if(typeof e=="function")GOT[t].value=addFunction(e,e.sig);else {if(typeof e!="number")throw new Error("bad export type for `"+t+"`: "+typeof e);GOT[t].value=e;}}}function preloadDylibs(){dynamicLibraries.length?(addRunDependency(),dynamicLibraries.reduce(function(t,e){return t.then(function(){return loadDynamicLibrary(e,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0})})},Promise.resolve()).then(function(){reportUndefinedSymbols(),removeRunDependency();})):reportUndefinedSymbols();}function setValue(t,e,r="i8"){switch(r.endsWith("*")&&(r="*"),r){case"i1":case"i8":HEAP8[t>>0]=e;break;case"i16":HEAP16[t>>1]=e;break;case"i32":HEAP32[t>>2]=e;break;case"i64":tempI64=[e>>>0,(tempDouble=e,+Math.abs(tempDouble)>=1?tempDouble>0?(0|Math.min(+Math.floor(tempDouble/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[t>>2]=tempI64[0],HEAP32[t+4>>2]=tempI64[1];break;case"float":HEAPF32[t>>2]=e;break;case"double":HEAPF64[t>>3]=e;break;case"*":HEAPU32[t>>2]=e;break;default:abort("invalid type for setValue: "+r);}}var ___memory_base=new WebAssembly.Global({value:"i32",mutable:!1},1024),___stack_pointer=new WebAssembly.Global({value:"i32",mutable:!0},78144),___table_base=new WebAssembly.Global({value:"i32",mutable:!1},1),nowIsMonotonic=!0,_emscripten_get_now;function __emscripten_get_now_is_monotonic(){return nowIsMonotonic}function _abort(){abort("");}function _emscripten_memcpy_big(t,e,r){HEAPU8.copyWithin(t,e,e+r);}function getHeapMax(){return 2147483648}function emscripten_realloc_buffer(t){try{return wasmMemory.grow(t-buffer.byteLength+65535>>>16),updateGlobalBufferAndViews(wasmMemory.buffer),1}catch{}}function _emscripten_resize_heap(t){var e=HEAPU8.length;t>>>=0;var r=getHeapMax();if(t>r)return !1;for(var n=1;n<=4;n*=2){var s=e*(1+.2/n);if(s=Math.min(s,t+100663296),emscripten_realloc_buffer(Math.min(r,(i=Math.max(t,s))+((o=65536)-i%o)%o)))return !0}var i,o;return !1}__emscripten_get_now_is_monotonic.sig="i",Module._abort=_abort,_abort.sig="v",_emscripten_get_now=ENVIRONMENT_IS_NODE?()=>{var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:()=>performance.now(),_emscripten_get_now.sig="d",_emscripten_memcpy_big.sig="vppp",_emscripten_resize_heap.sig="ip";var SYSCALLS={DEFAULT_POLLMASK:5,calculateAt:function(t,e,r){if(PATH.isAbs(e))return e;var n;if(t===-100?n=FS.cwd():n=SYSCALLS.getStreamFromFD(t).path,e.length==0){if(!r)throw new FS.ErrnoError(44);return n}return PATH.join2(n,e)},doStat:function(t,e,r){try{var n=t(e);}catch(a){if(a&&a.node&&PATH.normalize(e)!==PATH.normalize(FS.getPath(a.node)))return -54;throw a}HEAP32[r>>2]=n.dev,HEAP32[r+8>>2]=n.ino,HEAP32[r+12>>2]=n.mode,HEAPU32[r+16>>2]=n.nlink,HEAP32[r+20>>2]=n.uid,HEAP32[r+24>>2]=n.gid,HEAP32[r+28>>2]=n.rdev,tempI64=[n.size>>>0,(tempDouble=n.size,+Math.abs(tempDouble)>=1?tempDouble>0?(0|Math.min(+Math.floor(tempDouble/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[r+40>>2]=tempI64[0],HEAP32[r+44>>2]=tempI64[1],HEAP32[r+48>>2]=4096,HEAP32[r+52>>2]=n.blocks;var s=n.atime.getTime(),i=n.mtime.getTime(),o=n.ctime.getTime();return tempI64=[Math.floor(s/1e3)>>>0,(tempDouble=Math.floor(s/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?(0|Math.min(+Math.floor(tempDouble/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[r+56>>2]=tempI64[0],HEAP32[r+60>>2]=tempI64[1],HEAPU32[r+64>>2]=s%1e3*1e3,tempI64=[Math.floor(i/1e3)>>>0,(tempDouble=Math.floor(i/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?(0|Math.min(+Math.floor(tempDouble/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[r+72>>2]=tempI64[0],HEAP32[r+76>>2]=tempI64[1],HEAPU32[r+80>>2]=i%1e3*1e3,tempI64=[Math.floor(o/1e3)>>>0,(tempDouble=Math.floor(o/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?(0|Math.min(+Math.floor(tempDouble/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[r+88>>2]=tempI64[0],HEAP32[r+92>>2]=tempI64[1],HEAPU32[r+96>>2]=o%1e3*1e3,tempI64=[n.ino>>>0,(tempDouble=n.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(0|Math.min(+Math.floor(tempDouble/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[r+104>>2]=tempI64[0],HEAP32[r+108>>2]=tempI64[1],0},doMsync:function(t,e,r,n,s){if(!FS.isFile(e.node.mode))throw new FS.ErrnoError(43);if(2&n)return 0;var i=HEAPU8.slice(t,t+r);FS.msync(e,i,s,r,n);},varargs:void 0,get:function(){return SYSCALLS.varargs+=4,HEAP32[SYSCALLS.varargs-4>>2]},getStr:function(t){return UTF8ToString(t)},getStreamFromFD:function(t){var e=FS.getStream(t);if(!e)throw new FS.ErrnoError(8);return e}};function _proc_exit(t){EXITSTATUS=t,keepRuntimeAlive()||(Module.onExit&&Module.onExit(t),ABORT=!0),quit_(t,new ExitStatus(t));}function exitJS(t,e){EXITSTATUS=t,_proc_exit(t);}_proc_exit.sig="vi";var _exit=exitJS;function _fd_close(t){try{var e=SYSCALLS.getStreamFromFD(t);return FS.close(e),0}catch(r){if(typeof FS>"u"||!(r instanceof FS.ErrnoError))throw r;return r.errno}}function convertI32PairToI53Checked(t,e){return e+2097152>>>0<4194305-!!t?(t>>>0)+4294967296*e:NaN}function _fd_seek(t,e,r,n,s){try{var i=convertI32PairToI53Checked(e,r);if(isNaN(i))return 61;var o=SYSCALLS.getStreamFromFD(t);return FS.llseek(o,i,n),tempI64=[o.position>>>0,(tempDouble=o.position,+Math.abs(tempDouble)>=1?tempDouble>0?(0|Math.min(+Math.floor(tempDouble/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[s>>2]=tempI64[0],HEAP32[s+4>>2]=tempI64[1],o.getdents&&i===0&&n===0&&(o.getdents=null),0}catch(a){if(typeof FS>"u"||!(a instanceof FS.ErrnoError))throw a;return a.errno}}function doWritev(t,e,r,n){for(var s=0,i=0;i<r;i++){var o=HEAPU32[e>>2],a=HEAPU32[e+4>>2];e+=8;var c=FS.write(t,HEAP8,o,a,n);if(c<0)return -1;s+=c,n!==void 0&&(n+=c);}return s}function _fd_write(t,e,r,n){try{var s=doWritev(SYSCALLS.getStreamFromFD(t),e,r);return HEAPU32[n>>2]=s,0}catch(i){if(typeof FS>"u"||!(i instanceof FS.ErrnoError))throw i;return i.errno}}function _tree_sitter_log_callback(t,e){if(currentLogCallback){let r=UTF8ToString(e);currentLogCallback(r,t!==0);}}function _tree_sitter_parse_callback(t,e,r,n,s){var i=currentParseCallback(e,{row:r,column:n});typeof i=="string"?(setValue(s,i.length,"i32"),stringToUTF16(i,t,10240)):setValue(s,0,"i32");}function handleException(t){if(t instanceof ExitStatus||t=="unwind")return EXITSTATUS;quit_(1,t);}function allocateUTF8OnStack(t){var e=lengthBytesUTF8(t)+1,r=stackAlloc(e);return stringToUTF8Array(t,HEAP8,r,e),r}function stringToUTF16(t,e,r){if(r===void 0&&(r=2147483647),r<2)return 0;for(var n=e,s=(r-=2)<2*t.length?r/2:t.length,i=0;i<s;++i){var o=t.charCodeAt(i);HEAP16[e>>1]=o,e+=2;}return HEAP16[e>>1]=0,e-n}function AsciiToString(t){for(var e="";;){var r=HEAPU8[t++>>0];if(!r)return e;e+=String.fromCharCode(r);}}_exit.sig="vi",_fd_close.sig="ii",_fd_seek.sig="iijip",_fd_write.sig="iippp";var asmLibraryArg={__heap_base:___heap_base,__indirect_function_table:wasmTable,__memory_base:___memory_base,__stack_pointer:___stack_pointer,__table_base:___table_base,_emscripten_get_now_is_monotonic:__emscripten_get_now_is_monotonic,abort:_abort,emscripten_get_now:_emscripten_get_now,emscripten_memcpy_big:_emscripten_memcpy_big,emscripten_resize_heap:_emscripten_resize_heap,exit:_exit,fd_close:_fd_close,fd_seek:_fd_seek,fd_write:_fd_write,memory:wasmMemory,tree_sitter_log_callback:_tree_sitter_log_callback,tree_sitter_parse_callback:_tree_sitter_parse_callback};createWasm();Module.___wasm_call_ctors=function(){return (Module.___wasm_call_ctors=Module.asm.__wasm_call_ctors).apply(null,arguments)};Module.___wasm_apply_data_relocs=function(){return (Module.___wasm_apply_data_relocs=Module.asm.__wasm_apply_data_relocs).apply(null,arguments)};var _malloc=Module._malloc=function(){return (_malloc=Module._malloc=Module.asm.malloc).apply(null,arguments)};Module._calloc=function(){return (Module._calloc=Module.asm.calloc).apply(null,arguments)};Module._realloc=function(){return (Module._realloc=Module.asm.realloc).apply(null,arguments)};Module._free=function(){return (Module._free=Module.asm.free).apply(null,arguments)};Module._ts_language_symbol_count=function(){return (Module._ts_language_symbol_count=Module.asm.ts_language_symbol_count).apply(null,arguments)};Module._ts_language_version=function(){return (Module._ts_language_version=Module.asm.ts_language_version).apply(null,arguments)};Module._ts_language_field_count=function(){return (Module._ts_language_field_count=Module.asm.ts_language_field_count).apply(null,arguments)};Module._ts_language_symbol_name=function(){return (Module._ts_language_symbol_name=Module.asm.ts_language_symbol_name).apply(null,arguments)};Module._ts_language_symbol_for_name=function(){return (Module._ts_language_symbol_for_name=Module.asm.ts_language_symbol_for_name).apply(null,arguments)};Module._ts_language_symbol_type=function(){return (Module._ts_language_symbol_type=Module.asm.ts_language_symbol_type).apply(null,arguments)};Module._ts_language_field_name_for_id=function(){return (Module._ts_language_field_name_for_id=Module.asm.ts_language_field_name_for_id).apply(null,arguments)};Module._memset=function(){return (Module._memset=Module.asm.memset).apply(null,arguments)};Module._memcpy=function(){return (Module._memcpy=Module.asm.memcpy).apply(null,arguments)};Module._ts_parser_delete=function(){return (Module._ts_parser_delete=Module.asm.ts_parser_delete).apply(null,arguments)};Module._ts_parser_reset=function(){return (Module._ts_parser_reset=Module.asm.ts_parser_reset).apply(null,arguments)};Module._ts_parser_set_language=function(){return (Module._ts_parser_set_language=Module.asm.ts_parser_set_language).apply(null,arguments)};Module._ts_parser_timeout_micros=function(){return (Module._ts_parser_timeout_micros=Module.asm.ts_parser_timeout_micros).apply(null,arguments)};Module._ts_parser_set_timeout_micros=function(){return (Module._ts_parser_set_timeout_micros=Module.asm.ts_parser_set_timeout_micros).apply(null,arguments)};Module._memmove=function(){return (Module._memmove=Module.asm.memmove).apply(null,arguments)};Module._memcmp=function(){return (Module._memcmp=Module.asm.memcmp).apply(null,arguments)};Module._ts_query_new=function(){return (Module._ts_query_new=Module.asm.ts_query_new).apply(null,arguments)};Module._ts_query_delete=function(){return (Module._ts_query_delete=Module.asm.ts_query_delete).apply(null,arguments)};Module._iswspace=function(){return (Module._iswspace=Module.asm.iswspace).apply(null,arguments)};Module._iswalnum=function(){return (Module._iswalnum=Module.asm.iswalnum).apply(null,arguments)};Module._ts_query_pattern_count=function(){return (Module._ts_query_pattern_count=Module.asm.ts_query_pattern_count).apply(null,arguments)};Module._ts_query_capture_count=function(){return (Module._ts_query_capture_count=Module.asm.ts_query_capture_count).apply(null,arguments)};Module._ts_query_string_count=function(){return (Module._ts_query_string_count=Module.asm.ts_query_string_count).apply(null,arguments)};Module._ts_query_capture_name_for_id=function(){return (Module._ts_query_capture_name_for_id=Module.asm.ts_query_capture_name_for_id).apply(null,arguments)};Module._ts_query_string_value_for_id=function(){return (Module._ts_query_string_value_for_id=Module.asm.ts_query_string_value_for_id).apply(null,arguments)};Module._ts_query_predicates_for_pattern=function(){return (Module._ts_query_predicates_for_pattern=Module.asm.ts_query_predicates_for_pattern).apply(null,arguments)};Module._ts_tree_copy=function(){return (Module._ts_tree_copy=Module.asm.ts_tree_copy).apply(null,arguments)};Module._ts_tree_delete=function(){return (Module._ts_tree_delete=Module.asm.ts_tree_delete).apply(null,arguments)};Module._ts_init=function(){return (Module._ts_init=Module.asm.ts_init).apply(null,arguments)};Module._ts_parser_new_wasm=function(){return (Module._ts_parser_new_wasm=Module.asm.ts_parser_new_wasm).apply(null,arguments)};Module._ts_parser_enable_logger_wasm=function(){return (Module._ts_parser_enable_logger_wasm=Module.asm.ts_parser_enable_logger_wasm).apply(null,arguments)};Module._ts_parser_parse_wasm=function(){return (Module._ts_parser_parse_wasm=Module.asm.ts_parser_parse_wasm).apply(null,arguments)};Module._ts_language_type_is_named_wasm=function(){return (Module._ts_language_type_is_named_wasm=Module.asm.ts_language_type_is_named_wasm).apply(null,arguments)};Module._ts_language_type_is_visible_wasm=function(){return (Module._ts_language_type_is_visible_wasm=Module.asm.ts_language_type_is_visible_wasm).apply(null,arguments)};Module._ts_tree_root_node_wasm=function(){return (Module._ts_tree_root_node_wasm=Module.asm.ts_tree_root_node_wasm).apply(null,arguments)};Module._ts_tree_edit_wasm=function(){return (Module._ts_tree_edit_wasm=Module.asm.ts_tree_edit_wasm).apply(null,arguments)};Module._ts_tree_get_changed_ranges_wasm=function(){return (Module._ts_tree_get_changed_ranges_wasm=Module.asm.ts_tree_get_changed_ranges_wasm).apply(null,arguments)};Module._ts_tree_cursor_new_wasm=function(){return (Module._ts_tree_cursor_new_wasm=Module.asm.ts_tree_cursor_new_wasm).apply(null,arguments)};Module._ts_tree_cursor_delete_wasm=function(){return (Module._ts_tree_cursor_delete_wasm=Module.asm.ts_tree_cursor_delete_wasm).apply(null,arguments)};Module._ts_tree_cursor_reset_wasm=function(){return (Module._ts_tree_cursor_reset_wasm=Module.asm.ts_tree_cursor_reset_wasm).apply(null,arguments)};Module._ts_tree_cursor_goto_first_child_wasm=function(){return (Module._ts_tree_cursor_goto_first_child_wasm=Module.asm.ts_tree_cursor_goto_first_child_wasm).apply(null,arguments)};Module._ts_tree_cursor_goto_next_sibling_wasm=function(){return (Module._ts_tree_cursor_goto_next_sibling_wasm=Module.asm.ts_tree_cursor_goto_next_sibling_wasm).apply(null,arguments)};Module._ts_tree_cursor_goto_parent_wasm=function(){return (Module._ts_tree_cursor_goto_parent_wasm=Module.asm.ts_tree_cursor_goto_parent_wasm).apply(null,arguments)};Module._ts_tree_cursor_current_node_type_id_wasm=function(){return (Module._ts_tree_cursor_current_node_type_id_wasm=Module.asm.ts_tree_cursor_current_node_type_id_wasm).apply(null,arguments)};Module._ts_tree_cursor_current_node_is_named_wasm=function(){return (Module._ts_tree_cursor_current_node_is_named_wasm=Module.asm.ts_tree_cursor_current_node_is_named_wasm).apply(null,arguments)};Module._ts_tree_cursor_current_node_is_missing_wasm=function(){return (Module._ts_tree_cursor_current_node_is_missing_wasm=Module.asm.ts_tree_cursor_current_node_is_missing_wasm).apply(null,arguments)};Module._ts_tree_cursor_current_node_id_wasm=function(){return (Module._ts_tree_cursor_current_node_id_wasm=Module.asm.ts_tree_cursor_current_node_id_wasm).apply(null,arguments)};Module._ts_tree_cursor_start_position_wasm=function(){return (Module._ts_tree_cursor_start_position_wasm=Module.asm.ts_tree_cursor_start_position_wasm).apply(null,arguments)};Module._ts_tree_cursor_end_position_wasm=function(){return (Module._ts_tree_cursor_end_position_wasm=Module.asm.ts_tree_cursor_end_position_wasm).apply(null,arguments)};Module._ts_tree_cursor_start_index_wasm=function(){return (Module._ts_tree_cursor_start_index_wasm=Module.asm.ts_tree_cursor_start_index_wasm).apply(null,arguments)};Module._ts_tree_cursor_end_index_wasm=function(){return (Module._ts_tree_cursor_end_index_wasm=Module.asm.ts_tree_cursor_end_index_wasm).apply(null,arguments)};Module._ts_tree_cursor_current_field_id_wasm=function(){return (Module._ts_tree_cursor_current_field_id_wasm=Module.asm.ts_tree_cursor_current_field_id_wasm).apply(null,arguments)};Module._ts_tree_cursor_current_node_wasm=function(){return (Module._ts_tree_cursor_current_node_wasm=Module.asm.ts_tree_cursor_current_node_wasm).apply(null,arguments)};Module._ts_node_symbol_wasm=function(){return (Module._ts_node_symbol_wasm=Module.asm.ts_node_symbol_wasm).apply(null,arguments)};Module._ts_node_child_count_wasm=function(){return (Module._ts_node_child_count_wasm=Module.asm.ts_node_child_count_wasm).apply(null,arguments)};Module._ts_node_named_child_count_wasm=function(){return (Module._ts_node_named_child_count_wasm=Module.asm.ts_node_named_child_count_wasm).apply(null,arguments)};Module._ts_node_child_wasm=function(){return (Module._ts_node_child_wasm=Module.asm.ts_node_child_wasm).apply(null,arguments)};Module._ts_node_named_child_wasm=function(){return (Module._ts_node_named_child_wasm=Module.asm.ts_node_named_child_wasm).apply(null,arguments)};Module._ts_node_child_by_field_id_wasm=function(){return (Module._ts_node_child_by_field_id_wasm=Module.asm.ts_node_child_by_field_id_wasm).apply(null,arguments)};Module._ts_node_next_sibling_wasm=function(){return (Module._ts_node_next_sibling_wasm=Module.asm.ts_node_next_sibling_wasm).apply(null,arguments)};Module._ts_node_prev_sibling_wasm=function(){return (Module._ts_node_prev_sibling_wasm=Module.asm.ts_node_prev_sibling_wasm).apply(null,arguments)};Module._ts_node_next_named_sibling_wasm=function(){return (Module._ts_node_next_named_sibling_wasm=Module.asm.ts_node_next_named_sibling_wasm).apply(null,arguments)};Module._ts_node_prev_named_sibling_wasm=function(){return (Module._ts_node_prev_named_sibling_wasm=Module.asm.ts_node_prev_named_sibling_wasm).apply(null,arguments)};Module._ts_node_parent_wasm=function(){return (Module._ts_node_parent_wasm=Module.asm.ts_node_parent_wasm).apply(null,arguments)};Module._ts_node_descendant_for_index_wasm=function(){return (Module._ts_node_descendant_for_index_wasm=Module.asm.ts_node_descendant_for_index_wasm).apply(null,arguments)};Module._ts_node_named_descendant_for_index_wasm=function(){return (Module._ts_node_named_descendant_for_index_wasm=Module.asm.ts_node_named_descendant_for_index_wasm).apply(null,arguments)};Module._ts_node_descendant_for_position_wasm=function(){return (Module._ts_node_descendant_for_position_wasm=Module.asm.ts_node_descendant_for_position_wasm).apply(null,arguments)};Module._ts_node_named_descendant_for_position_wasm=function(){return (Module._ts_node_named_descendant_for_position_wasm=Module.asm.ts_node_named_descendant_for_position_wasm).apply(null,arguments)};Module._ts_node_start_point_wasm=function(){return (Module._ts_node_start_point_wasm=Module.asm.ts_node_start_point_wasm).apply(null,arguments)};Module._ts_node_end_point_wasm=function(){return (Module._ts_node_end_point_wasm=Module.asm.ts_node_end_point_wasm).apply(null,arguments)};Module._ts_node_start_index_wasm=function(){return (Module._ts_node_start_index_wasm=Module.asm.ts_node_start_index_wasm).apply(null,arguments)};Module._ts_node_end_index_wasm=function(){return (Module._ts_node_end_index_wasm=Module.asm.ts_node_end_index_wasm).apply(null,arguments)};Module._ts_node_to_string_wasm=function(){return (Module._ts_node_to_string_wasm=Module.asm.ts_node_to_string_wasm).apply(null,arguments)};Module._ts_node_children_wasm=function(){return (Module._ts_node_children_wasm=Module.asm.ts_node_children_wasm).apply(null,arguments)};Module._ts_node_named_children_wasm=function(){return (Module._ts_node_named_children_wasm=Module.asm.ts_node_named_children_wasm).apply(null,arguments)};Module._ts_node_descendants_of_type_wasm=function(){return (Module._ts_node_descendants_of_type_wasm=Module.asm.ts_node_descendants_of_type_wasm).apply(null,arguments)};Module._ts_node_is_named_wasm=function(){return (Module._ts_node_is_named_wasm=Module.asm.ts_node_is_named_wasm).apply(null,arguments)};Module._ts_node_has_changes_wasm=function(){return (Module._ts_node_has_changes_wasm=Module.asm.ts_node_has_changes_wasm).apply(null,arguments)};Module._ts_node_has_error_wasm=function(){return (Module._ts_node_has_error_wasm=Module.asm.ts_node_has_error_wasm).apply(null,arguments)};Module._ts_node_is_missing_wasm=function(){return (Module._ts_node_is_missing_wasm=Module.asm.ts_node_is_missing_wasm).apply(null,arguments)};Module._ts_query_matches_wasm=function(){return (Module._ts_query_matches_wasm=Module.asm.ts_query_matches_wasm).apply(null,arguments)};Module._ts_query_captures_wasm=function(){return (Module._ts_query_captures_wasm=Module.asm.ts_query_captures_wasm).apply(null,arguments)};Module.___cxa_atexit=function(){return (Module.___cxa_atexit=Module.asm.__cxa_atexit).apply(null,arguments)};Module._iswdigit=function(){return (Module._iswdigit=Module.asm.iswdigit).apply(null,arguments)};Module._iswalpha=function(){return (Module._iswalpha=Module.asm.iswalpha).apply(null,arguments)};Module._iswlower=function(){return (Module._iswlower=Module.asm.iswlower).apply(null,arguments)};Module._memchr=function(){return (Module._memchr=Module.asm.memchr).apply(null,arguments)};Module._strlen=function(){return (Module._strlen=Module.asm.strlen).apply(null,arguments)};Module._towupper=function(){return (Module._towupper=Module.asm.towupper).apply(null,arguments)};var _setThrew=Module._setThrew=function(){return (_setThrew=Module._setThrew=Module.asm.setThrew).apply(null,arguments)},stackSave=Module.stackSave=function(){return (stackSave=Module.stackSave=Module.asm.stackSave).apply(null,arguments)},stackRestore=Module.stackRestore=function(){return (stackRestore=Module.stackRestore=Module.asm.stackRestore).apply(null,arguments)},stackAlloc=Module.stackAlloc=function(){return (stackAlloc=Module.stackAlloc=Module.asm.stackAlloc).apply(null,arguments)};Module.__Znwm=function(){return (Module.__Znwm=Module.asm._Znwm).apply(null,arguments)};Module.__ZdlPv=function(){return (Module.__ZdlPv=Module.asm._ZdlPv).apply(null,arguments)};Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev=function(){return (Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev=Module.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev).apply(null,arguments)};Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm=function(){return (Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm=Module.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm).apply(null,arguments)};Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm=function(){return (Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm=Module.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm).apply(null,arguments)};Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm=function(){return (Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm=Module.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm).apply(null,arguments)};Module.__ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm=function(){return (Module.__ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm=Module.asm._ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm).apply(null,arguments)};Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc=function(){return (Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc=Module.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc).apply(null,arguments)};Module.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev=function(){return (Module.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev=Module.asm._ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev).apply(null,arguments)};Module.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw=function(){return (Module.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw=Module.asm._ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw).apply(null,arguments)};Module.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6resizeEmw=function(){return (Module.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6resizeEmw=Module.asm._ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6resizeEmw).apply(null,arguments)};Module.dynCall_jiji=function(){return (Module.dynCall_jiji=Module.asm.dynCall_jiji).apply(null,arguments)};Module._orig$ts_parser_timeout_micros=function(){return (Module._orig$ts_parser_timeout_micros=Module.asm.orig$ts_parser_timeout_micros).apply(null,arguments)};Module._orig$ts_parser_set_timeout_micros=function(){return (Module._orig$ts_parser_set_timeout_micros=Module.asm.orig$ts_parser_set_timeout_micros).apply(null,arguments)};var calledRun;function callMain(t){var e=Module._main;if(e){(t=t||[]).unshift(thisProgram);var r=t.length,n=stackAlloc(4*(r+1)),s=n>>2;t.forEach(o=>{HEAP32[s++]=allocateUTF8OnStack(o);}),HEAP32[s]=0;try{var i=e(r,n);return exitJS(i),i}catch(o){return handleException(o)}}}Module.AsciiToString=AsciiToString,Module.stringToUTF16=stringToUTF16,dependenciesFulfilled=function t(){calledRun||run(),calledRun||(dependenciesFulfilled=t);};var dylibsLoaded=!1;function run(t){function e(){calledRun||(calledRun=!0,Module.calledRun=!0,ABORT||(initRuntime(),preMain(),Module.onRuntimeInitialized&&Module.onRuntimeInitialized(),shouldRunNow&&callMain(t),postRun()));}t=t||arguments_,runDependencies>0||!dylibsLoaded&&(preloadDylibs(),dylibsLoaded=!0,runDependencies>0)||(preRun(),runDependencies>0||(Module.setStatus?(Module.setStatus("Running..."),setTimeout(function(){setTimeout(function(){Module.setStatus("");},1),e();},1)):e()));}if(Module.preInit)for(typeof Module.preInit=="function"&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.pop()();var shouldRunNow=!0;Module.noInitialRun&&(shouldRunNow=!1),run();let C=Module,INTERNAL={},SIZE_OF_INT=4,SIZE_OF_NODE=5*SIZE_OF_INT,SIZE_OF_POINT=2*SIZE_OF_INT,SIZE_OF_RANGE=2*SIZE_OF_INT+2*SIZE_OF_POINT,ZERO_POINT={row:0,column:0},QUERY_WORD_REGEX=/[\w-.]*/g,PREDICATE_STEP_TYPE_CAPTURE=1,PREDICATE_STEP_TYPE_STRING=2,LANGUAGE_FUNCTION_REGEX=/^_?tree_sitter_\w+/;var VERSION,MIN_COMPATIBLE_VERSION,TRANSFER_BUFFER,currentParseCallback,currentLogCallback;class ParserImpl{static init(){TRANSFER_BUFFER=C._ts_init(),VERSION=getValue(TRANSFER_BUFFER,"i32"),MIN_COMPATIBLE_VERSION=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32");}initialize(){C._ts_parser_new_wasm(),this[0]=getValue(TRANSFER_BUFFER,"i32"),this[1]=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32");}delete(){C._ts_parser_delete(this[0]),C._free(this[1]),this[0]=0,this[1]=0;}setLanguage(e){let r;if(e){if(e.constructor!==Language)throw new Error("Argument must be a Language");{r=e[0];let n=C._ts_language_version(r);if(n<MIN_COMPATIBLE_VERSION||VERSION<n)throw new Error(`Incompatible language version ${n}. Compatibility range ${MIN_COMPATIBLE_VERSION} through ${VERSION}.`)}}else r=0,e=null;return this.language=e,C._ts_parser_set_language(this[0],r),this}getLanguage(){return this.language}parse(e,r,n){if(typeof e=="string")currentParseCallback=(c,d,u)=>e.slice(c,u);else {if(typeof e!="function")throw new Error("Argument must be a string or a function");currentParseCallback=e;}this.logCallback?(currentLogCallback=this.logCallback,C._ts_parser_enable_logger_wasm(this[0],1)):(currentLogCallback=null,C._ts_parser_enable_logger_wasm(this[0],0));let s=0,i=0;if(n&&n.includedRanges){s=n.includedRanges.length,i=C._calloc(s,SIZE_OF_RANGE);let c=i;for(let d=0;d<s;d++)marshalRange(c,n.includedRanges[d]),c+=SIZE_OF_RANGE;}let o=C._ts_parser_parse_wasm(this[0],this[1],r?r[0]:0,i,s);if(!o)throw currentParseCallback=null,currentLogCallback=null,new Error("Parsing failed");let a=new Tree(INTERNAL,o,this.language,currentParseCallback);return currentParseCallback=null,currentLogCallback=null,a}reset(){C._ts_parser_reset(this[0]);}setTimeoutMicros(e){C._ts_parser_set_timeout_micros(this[0],e);}getTimeoutMicros(){return C._ts_parser_timeout_micros(this[0])}setLogger(e){if(e){if(typeof e!="function")throw new Error("Logger callback must be a function")}else e=null;return this.logCallback=e,this}getLogger(){return this.logCallback}}class Tree{constructor(e,r,n,s){assertInternal(e),this[0]=r,this.language=n,this.textCallback=s;}copy(){let e=C._ts_tree_copy(this[0]);return new Tree(INTERNAL,e,this.language,this.textCallback)}delete(){C._ts_tree_delete(this[0]),this[0]=0;}edit(e){marshalEdit(e),C._ts_tree_edit_wasm(this[0]);}get rootNode(){return C._ts_tree_root_node_wasm(this[0]),unmarshalNode(this)}getLanguage(){return this.language}walk(){return this.rootNode.walk()}getChangedRanges(e){if(e.constructor!==Tree)throw new TypeError("Argument must be a Tree");C._ts_tree_get_changed_ranges_wasm(this[0],e[0]);let r=getValue(TRANSFER_BUFFER,"i32"),n=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),s=new Array(r);if(r>0){let i=n;for(let o=0;o<r;o++)s[o]=unmarshalRange(i),i+=SIZE_OF_RANGE;C._free(n);}return s}}class Node{constructor(e,r){assertInternal(e),this.tree=r;}get typeId(){return marshalNode(this),C._ts_node_symbol_wasm(this.tree[0])}get type(){return this.tree.language.types[this.typeId]||"ERROR"}get endPosition(){return marshalNode(this),C._ts_node_end_point_wasm(this.tree[0]),unmarshalPoint(TRANSFER_BUFFER)}get endIndex(){return marshalNode(this),C._ts_node_end_index_wasm(this.tree[0])}get text(){return getText(this.tree,this.startIndex,this.endIndex)}isNamed(){return marshalNode(this),C._ts_node_is_named_wasm(this.tree[0])===1}hasError(){return marshalNode(this),C._ts_node_has_error_wasm(this.tree[0])===1}hasChanges(){return marshalNode(this),C._ts_node_has_changes_wasm(this.tree[0])===1}isMissing(){return marshalNode(this),C._ts_node_is_missing_wasm(this.tree[0])===1}equals(e){return this.id===e.id}child(e){return marshalNode(this),C._ts_node_child_wasm(this.tree[0],e),unmarshalNode(this.tree)}namedChild(e){return marshalNode(this),C._ts_node_named_child_wasm(this.tree[0],e),unmarshalNode(this.tree)}childForFieldId(e){return marshalNode(this),C._ts_node_child_by_field_id_wasm(this.tree[0],e),unmarshalNode(this.tree)}childForFieldName(e){let r=this.tree.language.fields.indexOf(e);if(r!==-1)return this.childForFieldId(r)}get childCount(){return marshalNode(this),C._ts_node_child_count_wasm(this.tree[0])}get namedChildCount(){return marshalNode(this),C._ts_node_named_child_count_wasm(this.tree[0])}get firstChild(){return this.child(0)}get firstNamedChild(){return this.namedChild(0)}get lastChild(){return this.child(this.childCount-1)}get lastNamedChild(){return this.namedChild(this.namedChildCount-1)}get children(){if(!this._children){marshalNode(this),C._ts_node_children_wasm(this.tree[0]);let e=getValue(TRANSFER_BUFFER,"i32"),r=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32");if(this._children=new Array(e),e>0){let n=r;for(let s=0;s<e;s++)this._children[s]=unmarshalNode(this.tree,n),n+=SIZE_OF_NODE;C._free(r);}}return this._children}get namedChildren(){if(!this._namedChildren){marshalNode(this),C._ts_node_named_children_wasm(this.tree[0]);let e=getValue(TRANSFER_BUFFER,"i32"),r=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32");if(this._namedChildren=new Array(e),e>0){let n=r;for(let s=0;s<e;s++)this._namedChildren[s]=unmarshalNode(this.tree,n),n+=SIZE_OF_NODE;C._free(r);}}return this._namedChildren}descendantsOfType(e,r,n){Array.isArray(e)||(e=[e]),r||(r=ZERO_POINT),n||(n=ZERO_POINT);let s=[],i=this.tree.language.types;for(let u=0,p=i.length;u<p;u++)e.includes(i[u])&&s.push(u);let o=C._malloc(SIZE_OF_INT*s.length);for(let u=0,p=s.length;u<p;u++)setValue(o+u*SIZE_OF_INT,s[u],"i32");marshalNode(this),C._ts_node_descendants_of_type_wasm(this.tree[0],o,s.length,r.row,r.column,n.row,n.column);let a=getValue(TRANSFER_BUFFER,"i32"),c=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),d=new Array(a);if(a>0){let u=c;for(let p=0;p<a;p++)d[p]=unmarshalNode(this.tree,u),u+=SIZE_OF_NODE;}return C._free(c),C._free(o),d}get nextSibling(){return marshalNode(this),C._ts_node_next_sibling_wasm(this.tree[0]),unmarshalNode(this.tree)}get previousSibling(){return marshalNode(this),C._ts_node_prev_sibling_wasm(this.tree[0]),unmarshalNode(this.tree)}get nextNamedSibling(){return marshalNode(this),C._ts_node_next_named_sibling_wasm(this.tree[0]),unmarshalNode(this.tree)}get previousNamedSibling(){return marshalNode(this),C._ts_node_prev_named_sibling_wasm(this.tree[0]),unmarshalNode(this.tree)}get parent(){return marshalNode(this),C._ts_node_parent_wasm(this.tree[0]),unmarshalNode(this.tree)}descendantForIndex(e,r=e){if(typeof e!="number"||typeof r!="number")throw new Error("Arguments must be numbers");marshalNode(this);let n=TRANSFER_BUFFER+SIZE_OF_NODE;return setValue(n,e,"i32"),setValue(n+SIZE_OF_INT,r,"i32"),C._ts_node_descendant_for_index_wasm(this.tree[0]),unmarshalNode(this.tree)}namedDescendantForIndex(e,r=e){if(typeof e!="number"||typeof r!="number")throw new Error("Arguments must be numbers");marshalNode(this);let n=TRANSFER_BUFFER+SIZE_OF_NODE;return setValue(n,e,"i32"),setValue(n+SIZE_OF_INT,r,"i32"),C._ts_node_named_descendant_for_index_wasm(this.tree[0]),unmarshalNode(this.tree)}descendantForPosition(e,r=e){if(!isPoint(e)||!isPoint(r))throw new Error("Arguments must be {row, column} objects");marshalNode(this);let n=TRANSFER_BUFFER+SIZE_OF_NODE;return marshalPoint(n,e),marshalPoint(n+SIZE_OF_POINT,r),C._ts_node_descendant_for_position_wasm(this.tree[0]),unmarshalNode(this.tree)}namedDescendantForPosition(e,r=e){if(!isPoint(e)||!isPoint(r))throw new Error("Arguments must be {row, column} objects");marshalNode(this);let n=TRANSFER_BUFFER+SIZE_OF_NODE;return marshalPoint(n,e),marshalPoint(n+SIZE_OF_POINT,r),C._ts_node_named_descendant_for_position_wasm(this.tree[0]),unmarshalNode(this.tree)}walk(){return marshalNode(this),C._ts_tree_cursor_new_wasm(this.tree[0]),new TreeCursor(INTERNAL,this.tree)}toString(){marshalNode(this);let e=C._ts_node_to_string_wasm(this.tree[0]),r=AsciiToString(e);return C._free(e),r}}class TreeCursor{constructor(e,r){assertInternal(e),this.tree=r,unmarshalTreeCursor(this);}delete(){marshalTreeCursor(this),C._ts_tree_cursor_delete_wasm(this.tree[0]),this[0]=this[1]=this[2]=0;}reset(e){marshalNode(e),marshalTreeCursor(this,TRANSFER_BUFFER+SIZE_OF_NODE),C._ts_tree_cursor_reset_wasm(this.tree[0]),unmarshalTreeCursor(this);}get nodeType(){return this.tree.language.types[this.nodeTypeId]||"ERROR"}get nodeTypeId(){return marshalTreeCursor(this),C._ts_tree_cursor_current_node_type_id_wasm(this.tree[0])}get nodeId(){return marshalTreeCursor(this),C._ts_tree_cursor_current_node_id_wasm(this.tree[0])}get nodeIsNamed(){return marshalTreeCursor(this),C._ts_tree_cursor_current_node_is_named_wasm(this.tree[0])===1}get nodeIsMissing(){return marshalTreeCursor(this),C._ts_tree_cursor_current_node_is_missing_wasm(this.tree[0])===1}get nodeText(){marshalTreeCursor(this);let e=C._ts_tree_cursor_start_index_wasm(this.tree[0]),r=C._ts_tree_cursor_end_index_wasm(this.tree[0]);return getText(this.tree,e,r)}get startPosition(){return marshalTreeCursor(this),C._ts_tree_cursor_start_position_wasm(this.tree[0]),unmarshalPoint(TRANSFER_BUFFER)}get endPosition(){return marshalTreeCursor(this),C._ts_tree_cursor_end_position_wasm(this.tree[0]),unmarshalPoint(TRANSFER_BUFFER)}get startIndex(){return marshalTreeCursor(this),C._ts_tree_cursor_start_index_wasm(this.tree[0])}get endIndex(){return marshalTreeCursor(this),C._ts_tree_cursor_end_index_wasm(this.tree[0])}currentNode(){return marshalTreeCursor(this),C._ts_tree_cursor_current_node_wasm(this.tree[0]),unmarshalNode(this.tree)}currentFieldId(){return marshalTreeCursor(this),C._ts_tree_cursor_current_field_id_wasm(this.tree[0])}currentFieldName(){return this.tree.language.fields[this.currentFieldId()]}gotoFirstChild(){marshalTreeCursor(this);let e=C._ts_tree_cursor_goto_first_child_wasm(this.tree[0]);return unmarshalTreeCursor(this),e===1}gotoNextSibling(){marshalTreeCursor(this);let e=C._ts_tree_cursor_goto_next_sibling_wasm(this.tree[0]);return unmarshalTreeCursor(this),e===1}gotoParent(){marshalTreeCursor(this);let e=C._ts_tree_cursor_goto_parent_wasm(this.tree[0]);return unmarshalTreeCursor(this),e===1}}class Language{constructor(e,r){assertInternal(e),this[0]=r,this.types=new Array(C._ts_language_symbol_count(this[0]));for(let n=0,s=this.types.length;n<s;n++)C._ts_language_symbol_type(this[0],n)<2&&(this.types[n]=UTF8ToString(C._ts_language_symbol_name(this[0],n)));this.fields=new Array(C._ts_language_field_count(this[0])+1);for(let n=0,s=this.fields.length;n<s;n++){let i=C._ts_language_field_name_for_id(this[0],n);this.fields[n]=i!==0?UTF8ToString(i):null;}}get version(){return C._ts_language_version(this[0])}get fieldCount(){return this.fields.length-1}fieldIdForName(e){let r=this.fields.indexOf(e);return r!==-1?r:null}fieldNameForId(e){return this.fields[e]||null}idForNodeType(e,r){let n=lengthBytesUTF8(e),s=C._malloc(n+1);stringToUTF8(e,s,n+1);let i=C._ts_language_symbol_for_name(this[0],s,n,r);return C._free(s),i||null}get nodeTypeCount(){return C._ts_language_symbol_count(this[0])}nodeTypeForId(e){let r=C._ts_language_symbol_name(this[0],e);return r?UTF8ToString(r):null}nodeTypeIsNamed(e){return !!C._ts_language_type_is_named_wasm(this[0],e)}nodeTypeIsVisible(e){return !!C._ts_language_type_is_visible_wasm(this[0],e)}query(e){let r=lengthBytesUTF8(e),n=C._malloc(r+1);stringToUTF8(e,n,r+1);let s=C._ts_query_new(this[0],n,r,TRANSFER_BUFFER,TRANSFER_BUFFER+SIZE_OF_INT);if(!s){let v=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),E=UTF8ToString(n,getValue(TRANSFER_BUFFER,"i32")).length,A=e.substr(E,100).split(`
|
||
`)[0],w,x=A.match(QUERY_WORD_REGEX)[0];switch(v){case 2:w=new RangeError(`Bad node name '${x}'`);break;case 3:w=new RangeError(`Bad field name '${x}'`);break;case 4:w=new RangeError(`Bad capture name @${x}`);break;case 5:w=new TypeError(`Bad pattern structure at offset ${E}: '${A}'...`),x="";break;default:w=new SyntaxError(`Bad syntax at offset ${E}: '${A}'...`),x="";}throw w.index=E,w.length=x.length,C._free(n),w}let i=C._ts_query_string_count(s),o=C._ts_query_capture_count(s),a=C._ts_query_pattern_count(s),c=new Array(o),d=new Array(i);for(let v=0;v<o;v++){let E=C._ts_query_capture_name_for_id(s,v,TRANSFER_BUFFER),A=getValue(TRANSFER_BUFFER,"i32");c[v]=UTF8ToString(E,A);}for(let v=0;v<i;v++){let E=C._ts_query_string_value_for_id(s,v,TRANSFER_BUFFER),A=getValue(TRANSFER_BUFFER,"i32");d[v]=UTF8ToString(E,A);}let u=new Array(a),p=new Array(a),_=new Array(a),m=new Array(a),y=new Array(a);for(let v=0;v<a;v++){let E=C._ts_query_predicates_for_pattern(s,v,TRANSFER_BUFFER),A=getValue(TRANSFER_BUFFER,"i32");m[v]=[],y[v]=[];let w=[],x=E;for(let M=0;M<A;M++){let k=getValue(x,"i32");x+=SIZE_OF_INT;let j=getValue(x,"i32");if(x+=SIZE_OF_INT,k===PREDICATE_STEP_TYPE_CAPTURE)w.push({type:"capture",name:c[j]});else if(k===PREDICATE_STEP_TYPE_STRING)w.push({type:"string",value:d[j]});else if(w.length>0){if(w[0].type!=="string")throw new Error("Predicates must begin with a literal value");let U=w[0].value,$=!0;switch(U){case"not-eq?":$=!1;case"eq?":if(w.length!==3)throw new Error("Wrong number of arguments to `#eq?` predicate. Expected 2, got "+(w.length-1));if(w[1].type!=="capture")throw new Error(`First argument of \`#eq?\` predicate must be a capture. Got "${w[1].value}"`);if(w[2].type==="capture"){let z=w[1].name,V=w[2].name;y[v].push(function(te){let I,O;for(let X of te)X.name===z&&(I=X.node),X.name===V&&(O=X.node);return I===void 0||O===void 0||I.text===O.text===$});}else {let z=w[1].name,V=w[2].value;y[v].push(function(te){for(let I of te)if(I.name===z)return I.node.text===V===$;return !0});}break;case"not-match?":$=!1;case"match?":if(w.length!==3)throw new Error(`Wrong number of arguments to \`#match?\` predicate. Expected 2, got ${w.length-1}.`);if(w[1].type!=="capture")throw new Error(`First argument of \`#match?\` predicate must be a capture. Got "${w[1].value}".`);if(w[2].type!=="string")throw new Error(`Second argument of \`#match?\` predicate must be a string. Got @${w[2].value}.`);let F=w[1].name,B=new RegExp(w[2].value);y[v].push(function(z){for(let V of z)if(V.name===F)return B.test(V.node.text)===$;return !0});break;case"set!":if(w.length<2||w.length>3)throw new Error(`Wrong number of arguments to \`#set!\` predicate. Expected 1 or 2. Got ${w.length-1}.`);if(w.some(z=>z.type!=="string"))throw new Error('Arguments to `#set!` predicate must be a strings.".');u[v]||(u[v]={}),u[v][w[1].value]=w[2]?w[2].value:null;break;case"is?":case"is-not?":if(w.length<2||w.length>3)throw new Error(`Wrong number of arguments to \`#${U}\` predicate. Expected 1 or 2. Got ${w.length-1}.`);if(w.some(z=>z.type!=="string"))throw new Error(`Arguments to \`#${U}\` predicate must be a strings.".`);let R=U==="is?"?p:_;R[v]||(R[v]={}),R[v][w[1].value]=w[2]?w[2].value:null;break;default:m[v].push({operator:U,operands:w.slice(1)});}w.length=0;}}Object.freeze(u[v]),Object.freeze(p[v]),Object.freeze(_[v]);}return C._free(n),new Query(INTERNAL,s,c,y,m,Object.freeze(u),Object.freeze(p),Object.freeze(_))}static load(e){let r;if(e instanceof Uint8Array)r=Promise.resolve(e);else {let s=e;if(typeof process<"u"&&process.versions&&process.versions.node){let i=G("fs");r=Promise.resolve(i.readFileSync(s));}else r=fetch(s).then(i=>i.arrayBuffer().then(o=>{if(i.ok)return new Uint8Array(o);{let a=new TextDecoder("utf-8").decode(o);throw new Error(`Language.load failed with status ${i.status}.
|
||
|
||
${a}`)}}));}let n=typeof loadSideModule=="function"?loadSideModule:loadWebAssemblyModule;return r.then(s=>n(s,{loadAsync:!0})).then(s=>{let i=Object.keys(s),o=i.find(c=>LANGUAGE_FUNCTION_REGEX.test(c)&&!c.includes("external_scanner_"));o||console.log(`Couldn't find language function in WASM file. Symbols:
|
||
${JSON.stringify(i,null,2)}`);let a=s[o]();return new Language(INTERNAL,a)})}}class Query{constructor(e,r,n,s,i,o,a,c){assertInternal(e),this[0]=r,this.captureNames=n,this.textPredicates=s,this.predicates=i,this.setProperties=o,this.assertedProperties=a,this.refutedProperties=c,this.exceededMatchLimit=!1;}delete(){C._ts_query_delete(this[0]),this[0]=0;}matches(e,r,n,s){r||(r=ZERO_POINT),n||(n=ZERO_POINT),s||(s={});let i=s.matchLimit;if(i===void 0)i=0;else if(typeof i!="number")throw new Error("Arguments must be numbers");marshalNode(e),C._ts_query_matches_wasm(this[0],e.tree[0],r.row,r.column,n.row,n.column,i);let o=getValue(TRANSFER_BUFFER,"i32"),a=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),c=getValue(TRANSFER_BUFFER+2*SIZE_OF_INT,"i32"),d=new Array(o);this.exceededMatchLimit=!!c;let u=0,p=a;for(let _=0;_<o;_++){let m=getValue(p,"i32");p+=SIZE_OF_INT;let y=getValue(p,"i32");p+=SIZE_OF_INT;let v=new Array(y);if(p=unmarshalCaptures(this,e.tree,p,v),this.textPredicates[m].every(E=>E(v))){d[u++]={pattern:m,captures:v};let E=this.setProperties[m];E&&(d[_].setProperties=E);let A=this.assertedProperties[m];A&&(d[_].assertedProperties=A);let w=this.refutedProperties[m];w&&(d[_].refutedProperties=w);}}return d.length=u,C._free(a),d}captures(e,r,n,s){r||(r=ZERO_POINT),n||(n=ZERO_POINT),s||(s={});let i=s.matchLimit;if(i===void 0)i=0;else if(typeof i!="number")throw new Error("Arguments must be numbers");marshalNode(e),C._ts_query_captures_wasm(this[0],e.tree[0],r.row,r.column,n.row,n.column,i);let o=getValue(TRANSFER_BUFFER,"i32"),a=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),c=getValue(TRANSFER_BUFFER+2*SIZE_OF_INT,"i32"),d=[];this.exceededMatchLimit=!!c;let u=[],p=a;for(let _=0;_<o;_++){let m=getValue(p,"i32");p+=SIZE_OF_INT;let y=getValue(p,"i32");p+=SIZE_OF_INT;let v=getValue(p,"i32");if(p+=SIZE_OF_INT,u.length=y,p=unmarshalCaptures(this,e.tree,p,u),this.textPredicates[m].every(E=>E(u))){let E=u[v],A=this.setProperties[m];A&&(E.setProperties=A);let w=this.assertedProperties[m];w&&(E.assertedProperties=w);let x=this.refutedProperties[m];x&&(E.refutedProperties=x),d.push(E);}}return C._free(a),d}predicatesForPattern(e){return this.predicates[e]}didExceedMatchLimit(){return this.exceededMatchLimit}}function getText(t,e,r){let n=r-e,s=t.textCallback(e,null,r);for(e+=s.length;e<r;){let i=t.textCallback(e,null,r);if(!(i&&i.length>0))break;e+=i.length,s+=i;}return e>r&&(s=s.slice(0,n)),s}function unmarshalCaptures(t,e,r,n){for(let s=0,i=n.length;s<i;s++){let o=getValue(r,"i32"),a=unmarshalNode(e,r+=SIZE_OF_INT);r+=SIZE_OF_NODE,n[s]={name:t.captureNames[o],node:a};}return r}function assertInternal(t){if(t!==INTERNAL)throw new Error("Illegal constructor")}function isPoint(t){return t&&typeof t.row=="number"&&typeof t.column=="number"}function marshalNode(t){let e=TRANSFER_BUFFER;setValue(e,t.id,"i32"),e+=SIZE_OF_INT,setValue(e,t.startIndex,"i32"),e+=SIZE_OF_INT,setValue(e,t.startPosition.row,"i32"),e+=SIZE_OF_INT,setValue(e,t.startPosition.column,"i32"),e+=SIZE_OF_INT,setValue(e,t[0],"i32");}function unmarshalNode(t,e=TRANSFER_BUFFER){let r=getValue(e,"i32");if(r===0)return null;let n=getValue(e+=SIZE_OF_INT,"i32"),s=getValue(e+=SIZE_OF_INT,"i32"),i=getValue(e+=SIZE_OF_INT,"i32"),o=getValue(e+=SIZE_OF_INT,"i32"),a=new Node(INTERNAL,t);return a.id=r,a.startIndex=n,a.startPosition={row:s,column:i},a[0]=o,a}function marshalTreeCursor(t,e=TRANSFER_BUFFER){setValue(e+0*SIZE_OF_INT,t[0],"i32"),setValue(e+1*SIZE_OF_INT,t[1],"i32"),setValue(e+2*SIZE_OF_INT,t[2],"i32");}function unmarshalTreeCursor(t){t[0]=getValue(TRANSFER_BUFFER+0*SIZE_OF_INT,"i32"),t[1]=getValue(TRANSFER_BUFFER+1*SIZE_OF_INT,"i32"),t[2]=getValue(TRANSFER_BUFFER+2*SIZE_OF_INT,"i32");}function marshalPoint(t,e){setValue(t,e.row,"i32"),setValue(t+SIZE_OF_INT,e.column,"i32");}function unmarshalPoint(t){return {row:getValue(t,"i32"),column:getValue(t+SIZE_OF_INT,"i32")}}function marshalRange(t,e){marshalPoint(t,e.startPosition),marshalPoint(t+=SIZE_OF_POINT,e.endPosition),setValue(t+=SIZE_OF_POINT,e.startIndex,"i32"),setValue(t+=SIZE_OF_INT,e.endIndex,"i32"),t+=SIZE_OF_INT;}function unmarshalRange(t){let e={};return e.startPosition=unmarshalPoint(t),t+=SIZE_OF_POINT,e.endPosition=unmarshalPoint(t),t+=SIZE_OF_POINT,e.startIndex=getValue(t,"i32"),t+=SIZE_OF_INT,e.endIndex=getValue(t,"i32"),e}function marshalEdit(t){let e=TRANSFER_BUFFER;marshalPoint(e,t.startPosition),e+=SIZE_OF_POINT,marshalPoint(e,t.oldEndPosition),e+=SIZE_OF_POINT,marshalPoint(e,t.newEndPosition),e+=SIZE_OF_POINT,setValue(e,t.startIndex,"i32"),e+=SIZE_OF_INT,setValue(e,t.oldEndIndex,"i32"),e+=SIZE_OF_INT,setValue(e,t.newEndIndex,"i32"),e+=SIZE_OF_INT;}for(let t of Object.getOwnPropertyNames(ParserImpl.prototype))Object.defineProperty(Parser.prototype,t,{value:ParserImpl.prototype[t],enumerable:!1,writable:!1});Parser.Language=Language,Module.onRuntimeInitialized=()=>{ParserImpl.init(),resolveInitPromise();};}))}}return Parser}();typeof exports=="object"&&(module.exports=TreeSitter);});var Bu=T((rB,Dv)=>{var qu=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?Nn(this.lower(e),this.upper(e)):Nn(e,r)}};function Nn(t,e,r=10){if(t===e)return t;if(t*e<=0)return 0;if(e<0)return -Nn(-e,-t,r);if(t>e)return Nn(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}Dv.exports={Binning:qu,shorten:Nn};});var Bv=T((nB,qv)=>{var{Binning:Ok}=Bu(),Mk="stats-logscale/univariate@1.0",kn=class t extends Ok{constructor(e={}){super(e),this.storage=new Map,this._count=0,this._cache={},this.neat=new $n(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:Mk,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((a,c)=>a[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(a=>a[0]>=r&&a[0]<=n);let s=[this.round(r),0],i=[this.round(n),0],o=[s];for(let[a,c]of this._cache.data)a<=s[0]?s[1]+=c:a>=i[0]?i[1]+=c:o.push([a,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]),a=this.upper(n[s][0])-o;return o+a*(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,a=n!==r[s][0]?0:(r[s][2]-r[s][1])*(e-this.lower(e))/(this.upper(e)-this.lower(e));return o+a}histogram(e={}){if(!this._count)return [];let r=this.min(),n=this.max(),s=e.count||10,i=[],o=r,a=(n-r)/s;for(let c=0;c<s;c++)i.push([this._rawCdf(o+a),o,o+=a]);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 d=0;d<i.length;d++)c<i[d][0]&&(c=i[d][0]);for(let d=0;d<i.length;d++)i[d][0]=i[d][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=kn.prototype[t];if(typeof r!="function")throw new Error('method "'+t+'" is cached but never defined');kn.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 $n=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=>{$n.prototype[t]=function(e){return this._main.shorten(this._main[t](e))};});["cdf","count"].forEach(t=>{$n.prototype[t]=function(e){return this._main[t](e)};});qv.exports={Univariate:kn};});var Uv=T((iB,Uu)=>{(()=>{let{Binning:t}=Bu(),{Univariate:e}=Bv(),r={Binning:t,Univariate:e};typeof window<"u"&&(window.logstat=r),typeof Uu=="object"&&(Uu.exports=r);})();});var zn=new Uint8Array(256),Wn=zn.length;function eo(){return Wn>zn.length-16&&(fE__default.default.randomFillSync(zn),Wn=0),zn.slice(Wn,Wn+=16)}var Oe=[];for(let t=0;t<256;++t)Oe.push((t+256).toString(16).slice(1));function Nc(t,e=0){return Oe[t[e+0]]+Oe[t[e+1]]+Oe[t[e+2]]+Oe[t[e+3]]+"-"+Oe[t[e+4]]+Oe[t[e+5]]+"-"+Oe[t[e+6]]+Oe[t[e+7]]+"-"+Oe[t[e+8]]+Oe[t[e+9]]+"-"+Oe[t[e+10]]+Oe[t[e+11]]+Oe[t[e+12]]+Oe[t[e+13]]+Oe[t[e+14]]+Oe[t[e+15]]}var to={randomUUID:fE__default.default.randomUUID};function dE(t,e,r){if(to.randomUUID&&!e&&!t)return to.randomUUID();t=t||{};let n=t.random||(t.rng||eo)();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 Nc(n)}var gt=dE;var Bs=fr(xi());var Mt={defaultMerge:Symbol("deepmerge-ts: default merge"),skip:Symbol("deepmerge-ts: skip")};function Bx(t,e){return e}function Rp(t){return typeof t!="object"||t===null?0:Array.isArray(t)?2:jx(t)?1:t instanceof Set?3:t instanceof Map?4:5}function Ux(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 Hx(t,e){return typeof t=="object"&&Object.prototype.propertyIsEnumerable.call(t,e)}function Ip(t){return {*[Symbol.iterator](){for(let e of t)for(let r of e)yield r;}}}var Tp=new Set(["[object Object]","[object Module]"]);function jx(t){if(!Tp.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"||!Tp.has(Object.prototype.toString.call(r))||!r.hasOwnProperty("isPrototypeOf"))}function Wx(t,e,r){let n={};for(let s of Ux(t)){let i=[];for(let c of t)Hx(c,s)&&i.push(c[s]);if(i.length===0)continue;let o=e.metaDataUpdater(r,{key:s,parents:t}),a=Mp(i,e,o);a!==Mt.skip&&(s==="__proto__"?Object.defineProperty(n,s,{value:a,configurable:!0,enumerable:!0,writable:!0}):n[s]=a);}return n}function zx(t){return t.flat()}function Gx(t){return new Set(Ip(t))}function Vx(t){return new Map(Ip(t))}function Pp(t){return t.at(-1)}var la=Object.freeze({__proto__:null,mergeArrays:zx,mergeMaps:Vx,mergeOthers:Pp,mergeRecords:Wx,mergeSets:Gx});function Op(...t){return Kx({})(...t)}function Kx(t,e){let r=Zx(t,n);function n(...s){return Mp(s,r,e)}return n}function Zx(t,e){return {defaultMergeFunctions:la,mergeFunctions:{...la,...Object.fromEntries(Object.entries(t).filter(([r,n])=>Object.hasOwn(la,r)).map(([r,n])=>n===!1?[r,Pp]:[r,n]))},metaDataUpdater:t.metaDataUpdater??Bx,deepmerge:e,useImplicitDefaultMerging:t.enableImplicitDefaultMerging??!1,actions:Mt}}function Mp(t,e,r){if(t.length===0)return;if(t.length===1)return ua(t,e,r);let n=Rp(t[0]);if(n!==0&&n!==5){for(let s=1;s<t.length;s++)if(Rp(t[s])!==n)return ua(t,e,r)}switch(n){case 1:return Yx(t,e,r);case 2:return Jx(t,e,r);case 3:return Xx(t,e,r);case 4:return Qx(t,e,r);default:return ua(t,e,r)}}function Yx(t,e,r){let n=e.mergeFunctions.mergeRecords(t,e,r);return n===Mt.defaultMerge||e.useImplicitDefaultMerging&&n===void 0&&e.mergeFunctions.mergeRecords!==e.defaultMergeFunctions.mergeRecords?e.defaultMergeFunctions.mergeRecords(t,e,r):n}function Jx(t,e,r){let n=e.mergeFunctions.mergeArrays(t,e,r);return n===Mt.defaultMerge||e.useImplicitDefaultMerging&&n===void 0&&e.mergeFunctions.mergeArrays!==e.defaultMergeFunctions.mergeArrays?e.defaultMergeFunctions.mergeArrays(t):n}function Xx(t,e,r){let n=e.mergeFunctions.mergeSets(t,e,r);return n===Mt.defaultMerge||e.useImplicitDefaultMerging&&n===void 0&&e.mergeFunctions.mergeSets!==e.defaultMergeFunctions.mergeSets?e.defaultMergeFunctions.mergeSets(t):n}function Qx(t,e,r){let n=e.mergeFunctions.mergeMaps(t,e,r);return n===Mt.defaultMerge||e.useImplicitDefaultMerging&&n===void 0&&e.mergeFunctions.mergeMaps!==e.defaultMergeFunctions.mergeMaps?e.defaultMergeFunctions.mergeMaps(t):n}function ua(t,e,r){let n=e.mergeFunctions.mergeOthers(t,e,r);return n===Mt.defaultMerge||e.useImplicitDefaultMerging&&n===void 0&&e.mergeFunctions.mergeOthers!==e.defaultMergeFunctions.mergeOthers?e.defaultMergeFunctions.mergeOthers(t):n}var sn=t=>{let e=typeof t;return t!==null&&(e==="object"||e==="function")};var ca=new Set(["__proto__","prototype","constructor"]),eC=new Set("0123456789");function fa(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(ca.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(ca.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"&&!eC.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(ca.has(r))return [];e.push(r);break}case"index":throw new Error("Index was not closed");case"start":{e.push("");break}}return e}function Fp(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 Np(t,e){if(Fp(t,e))throw new Error("Cannot use string index")}function Ci(t,e,r){if(!sn(t)||typeof e!="string")return r===void 0?t:r;let n=fa(e);if(n.length===0)return r;for(let s=0;s<n.length;s++){let i=n[s];if(Fp(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 Sr(t,e,r){if(!sn(t)||typeof e!="string")return t;let n=t,s=fa(e);for(let i=0;i<s.length;i++){let o=s[i];Np(t,o),i===s.length-1?t[o]=r:sn(t[o])||(t[o]=typeof s[i+1]=="number"?[]:{}),t=t[o];}return n}function Ri(t,e){if(!sn(t)||typeof e!="string")return !1;let r=fa(e);for(let n=0;n<r.length;n++){let s=r[n];if(Np(t,s),n===r.length-1)return delete t[s],!0;if(t=t[s],!sn(t))return !1}}var tC={"Content-Type":"application/json"},rC=/\/*$/;function Zt(t={}){let{fetch:e=globalThis.fetch,querySerializer:r,bodySerializer:n,...s}=t;async function i(o,a){let{headers:c,body:d,params:u={},parseAs:p="json",querySerializer:_=r??nC,bodySerializer:m=n??iC,...y}=a||{},v=sC(o,{baseUrl:s.baseUrl,params:u,querySerializer:_}),E=oC(tC,t?.headers,c,u.header),A={redirect:"follow",...s,...y,headers:E};d&&(A.body=m(d)),A.body instanceof FormData&&E.delete("Content-Type");let w=await e(v,A);if(w.status===204||w.headers.get("Content-Length")==="0")return w.ok?{data:{},response:w}:{error:{},response:w};if(w.ok){let M=w.body;if(p!=="stream"){let k=w.clone();M=typeof k[p]=="function"?await k[p]():await k.text();}return {data:M,response:w}}let x={};try{x=await w.clone().json();}catch{x=await w.clone().text();}return {error:x,response:w}}return {async GET(o,a){return i(o,{...a,method:"GET"})},async PUT(o,a){return i(o,{...a,method:"PUT"})},async POST(o,a){return i(o,{...a,method:"POST"})},async DELETE(o,a){return i(o,{...a,method:"DELETE"})},async OPTIONS(o,a){return i(o,{...a,method:"OPTIONS"})},async HEAD(o,a){return i(o,{...a,method:"HEAD"})},async PATCH(o,a){return i(o,{...a,method:"PATCH"})},async TRACE(o,a){return i(o,{...a,method:"TRACE"})}}}function nC(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 iC(t){return JSON.stringify(t)}function sC(t,e){let r=`${e.baseUrl?e.baseUrl.replace(rC,""):""}${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 oC(...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 Up=fr(Dp());function _e(t){let e=t.match(/.*(?:$|\r?\n)/g).filter(Boolean);return e.length>0&&e[e.length-1].endsWith(`
|
||
`)&&e.push(""),e}function ae(t){return t.trim().length===0}var qp=[["(",")"],["[","]"],["{","}"],["'","'"],['"','"'],["`","`"]],Bp=qp.map(t=>t[0]),Ti=qp.map(t=>t[1]);function Ii(t){let e=[];for(let r of t)[["(",")"],["[","]"],["{","}"]].forEach(n=>{r===n[1]&&(e.length>0&&e[e.length-1]===n[0]?e.pop():e.push(r));}),"([{".includes(r)&&e.push(r),["'",'"',"`"].forEach(n=>{r===n&&(e.length>0&&e.includes(n)?e.splice(e.lastIndexOf(n),e.length-e.lastIndexOf(n)):e.push(r));});return e.join("")}function Er(t,e){return Up.get(t,e)}function an(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 De=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 ln(t){return t instanceof Error&&t.name==="TimeoutError"||t instanceof De&&[408,499].includes(t.status)}function Yt(t){return t instanceof Error&&t.name==="AbortError"}function da(t){let e=t.message||t.toString();return t.cause&&(e+=`
|
||
Caused by: `+da(t.cause)),e}function pa(t){this.message=t;}pa.prototype=new Error,pa.prototype.name="InvalidCharacterError";var Hp=typeof window<"u"&&window.atob&&window.atob.bind(window)||function(t){var e=String(t).replace(/=+$/,"");if(e.length%4==1)throw new pa("'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 cC(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(Hp(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 Hp(e)}}function Pi(t){this.message=t;}function fC(t,e){if(typeof t!="string")throw new Pi("Invalid token specified");var r=(e=e||{}).header===!0?0:1;try{return JSON.parse(cC(t.split(".")[r]))}catch(n){throw new Pi("Invalid token specified: "+n.message)}}Pi.prototype=new Error,Pi.prototype.name="InvalidTokenError";var Oi=fC;Ft();var Fr=(()=>{let t=G("events"),e=Ma(),r=xi(),n=Pl();class s extends t{constructor(c){super();this.data={};this.watcher=null;this.filepath=c;}async load(){this.data=await e.readJson(i,{throws:!1})||{};}async save(){await e.outputJson(i,this.data);}watch(){this.watcher=n.watch(this.filepath,{interval:1e3});let c=async()=>{let d=this.data;await this.load(),r(d,this.data)||super.emit("updated",this.data);};this.watcher.on("add",c),this.watcher.on("change",c);}}let i=G("path").join(G("os").homedir(),".tabby-client","agent","data.json");return new s(i)})();_t();var Is=class t extends events.EventEmitter{constructor(r){super();this.logger=be.child({component:"Auth"});this.dataStore=null;this.refreshTokenTimer=null;this.jwt=null;this.endpoint=r.endpoint,r.dataStore?this.dataStore=r.dataStore:(this.dataStore=Fr,Fr.on("updated",async()=>{await this.load(),super.emit("updated",this.jwt);}),Fr.watch()),this.authApi=Zt({baseUrl:"https://app.tabbyml.com/api"}),this.scheduleRefreshToken();}static{this.authPageUrl="https://app.tabbyml.com/account/device-token";}static{this.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}}};}static async create(r){let n=new t(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:Oi(r)};n.payload.exp*1e3-Date.now()<t.tokenStrategy.refresh.beforeExpire?(this.jwt=await this.refreshToken(n,t.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 De(n.response);let s=n.data;this.logger.debug({deviceToken:s},"Request device token response");let i=new URL(t.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=an([AbortSignal.timeout(t.tokenStrategy.polling.timeout),n?.signal]),a=setInterval(async()=>{try{let c=await this.authApi.POST("/device-token/accept",{params:{query:{code:r}},signal:o});if(c.error)throw new De(c.response);let d=c.data;this.logger.debug({result:d},"Poll jwt response"),this.jwt={token:d.data.jwt,payload:Oi(d.data.jwt)},super.emit("updated",this.jwt),await this.save(),clearInterval(a),s(!0);}catch(c){c instanceof De&&[400,401,403,405].includes(c.status)?this.logger.debug({error:c},"Expected error when polling jwt"):this.logger.error({error:c},"Error when polling jwt");}},t.tokenStrategy.polling.interval);o.aborted?(clearInterval(a),i(o.reason)):o.addEventListener("abort",()=>{clearInterval(a),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 De(i.response);let o=i.data;return this.logger.debug({refreshedJwt:o},"Refresh token response"),{token:o.data.jwt,payload:Oi(o.data.jwt)}}catch(i){if(i instanceof De&&[400,401,403,405].includes(i.status))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()<t.tokenStrategy.refresh.beforeExpire)try{this.jwt=await this.refreshToken(this.jwt,t.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");},t.tokenStrategy.refresh.interval);}};Ft();var Ru={server:{endpoint:"http://localhost:8080",token:"",requestHeaders:{},requestTimeout:3e4},completion:{prompt:{experimentalStripAutoClosingCharacters:!1,maxPrefixLines:20,maxSuffixLines:20},debounce:{mode:"adaptive",interval:250},timeout:4e3},postprocess:{limitScope:{experimentalSyntax:!1,indentation:{experimentalKeepBlockScopeWhenCompletingLine:!1}},calculateReplaceRange:{experimentalSyntax:!1}},logs:{level:"silent"},anonymousUsageTracking:{disable:!1}},av=`## Tabby agent configuration file
|
||
|
||
## Online documentation: https://tabby.tabbyml.com/docs/extensions/configuration
|
||
## You can uncomment and edit the values below to change the default settings.
|
||
## Configurations in this file have lower priority than the IDE settings.
|
||
|
||
## Server
|
||
## You can set the server endpoint here and an optional authentication token if required.
|
||
# [server]
|
||
# endpoint = "http://localhost:8080" # http or https URL
|
||
# token = "your-token-here" # if token is set, request header Authorization = "Bearer $token" will be added automatically
|
||
|
||
## You can add custom request headers.
|
||
# [server.requestHeaders]
|
||
# Header1 = "Value1" # list your custom headers here
|
||
# Header2 = "Value2" # values can be strings, numbers or booleans
|
||
|
||
## Completion
|
||
## (Since 1.1.0) You can set the completion request timeout here.
|
||
## Note that there is also a timeout config at the server side.
|
||
# [completion]
|
||
# timeout = 4000 # 4s
|
||
|
||
## Logs
|
||
## You can set the log level here. The log file is located at ~/.tabby-client/agent/logs/.
|
||
# [logs]
|
||
# level = "silent" # "silent" or "error" or "debug"
|
||
|
||
## Anonymous usage tracking
|
||
## Tabby collects anonymous usage data and sends it to the Tabby team to help improve our products.
|
||
## Your code, generated completions, or any sensitive information is never tracked or sent.
|
||
## For more details on data collection, see https://tabby.tabbyml.com/docs/extensions/configuration#usage-collection
|
||
## Your contribution is greatly appreciated. However, if you prefer not to participate, you can disable anonymous usage tracking here.
|
||
# [anonymousUsageTracking]
|
||
# disable = false # set to true to disable
|
||
|
||
`,lv={server:"object","server.endpoint":"string","server.token":"string","server.requestHeaders":"object","server.requestTimeout":"number",completion:"object","completion.prompt":"object","completion.prompt.experimentalStripAutoClosingCharacters":"boolean","completion.prompt.maxPrefixLines":"number","completion.prompt.maxSuffixLines":"number","completion.debounce":"object","completion.debounce.mode":"string","completion.debounce.interval":"number","completion.timeout":"number",postprocess:"object","postprocess.limitScopeByIndentation":"object","postprocess.limitScopeByIndentation.experimentalKeepBlockScopeWhenCompletingLine":"boolean",logs:"object","logs.level":"string",anonymousUsageTracking:"object","anonymousUsageTracking.disable":"boolean"};function yk(t,e,r){typeof Ci(t,e)!==r&&Ri(t,e);}function wk(t){let e={...t};for(let r in lv)yk(e,r,lv[r]);return e}var Dr=(()=>{let t=G("events"),e=Ma(),r=ov(),n=Pl(),s=xi();class i extends t{constructor(d){super();this.data={};this.watcher=null;this.logger=(_t(),Qs(ev)).rootLogger.child({component:"ConfigFile"});this.filepath=d;}get config(){return this.data}async load(){try{let d=await e.readFile(this.filepath,"utf8"),u=r.parse(d);if(Object.keys(u).length===0&&d.trim()!==av.trim()){await this.createTemplate();return}this.data=wk(u);}catch(d){d.code==="ENOENT"?await this.createTemplate():this.logger.error({error:d},"Failed to load config file");}}async createTemplate(){try{await e.outputFile(this.filepath,av);}catch(d){this.logger.error({error:d},"Failed to create config template file");}}watch(){this.watcher=n.watch(this.filepath,{interval:1e3});let d=async()=>{let u=this.data;await this.load(),s(u,this.data)||super.emit("updated",this.data);};this.watcher.on("add",d),this.watcher.on("change",d);}}let o=G("path").join(G("os").homedir(),".tabby-client","agent","config.toml");return new i(o)})();var Mn=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,cv=new Set,Tu=typeof process=="object"&&process?process:{},fv=(t,e,r,n)=>{typeof Tu.emitWarning=="function"?Tu.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`);},Ps=globalThis.AbortController,uv=globalThis.AbortSignal;if(typeof Ps>"u"){uv=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(n,s){this._onabort.push(s);}},Ps=class{constructor(){e();}signal=new uv;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=Tu.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=!1,fv("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 bk=t=>!cv.has(t),Ut=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),hv=t=>Ut(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?qr:null:null,qr=class extends Array{constructor(e){super(e),this.fill(0);}},Iu=class t{heap;length;static#l=!1;static create(e){let r=hv(e);if(!r)return [];t.#l=!0;let n=new t(e,r);return t.#l=!1,n}constructor(e,r){if(!t.#l)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0;}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}},Os=class t{#l;#f;#y;#p;#I;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#n;#m;#i;#r;#e;#u;#h;#a;#s;#_;#o;#S;#E;#g;#w;#x;#c;static unsafeExposeInternals(e){return {starts:e.#E,ttls:e.#g,sizes:e.#S,keyMap:e.#i,keyList:e.#r,valList:e.#e,next:e.#u,prev:e.#h,get head(){return e.#a},get tail(){return e.#s},free:e.#_,isBackgroundFetch:r=>e.#t(r),backgroundFetch:(r,n,s,i)=>e.#M(r,n,s,i),moveToTail:r=>e.#T(r),indexes:r=>e.#b(r),rindexes:r=>e.#v(r),isStale:r=>e.#d(r)}}get max(){return this.#l}get maxSize(){return this.#f}get calculatedSize(){return this.#m}get size(){return this.#n}get fetchMethod(){return this.#I}get dispose(){return this.#y}get disposeAfter(){return this.#p}constructor(e){let{max:r=0,ttl:n,ttlResolution:s=1,ttlAutopurge:i,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:c,dispose:d,disposeAfter:u,noDisposeOnSet:p,noUpdateTTL:_,maxSize:m=0,maxEntrySize:y=0,sizeCalculation:v,fetchMethod:E,noDeleteOnFetchRejection:A,noDeleteOnStaleGet:w,allowStaleOnFetchRejection:x,allowStaleOnFetchAbort:M,ignoreFetchAbort:k}=e;if(r!==0&&!Ut(r))throw new TypeError("max option must be a nonnegative integer");let j=r?hv(r):Array;if(!j)throw new Error("invalid max value: "+r);if(this.#l=r,this.#f=m,this.maxEntrySize=y||this.#f,this.sizeCalculation=v,this.sizeCalculation){if(!this.#f&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(E!==void 0&&typeof E!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#I=E,this.#x=!!E,this.#i=new Map,this.#r=new Array(r).fill(void 0),this.#e=new Array(r).fill(void 0),this.#u=new j(r),this.#h=new j(r),this.#a=0,this.#s=0,this.#_=Iu.create(r),this.#n=0,this.#m=0,typeof d=="function"&&(this.#y=d),typeof u=="function"?(this.#p=u,this.#o=[]):(this.#p=void 0,this.#o=void 0),this.#w=!!this.#y,this.#c=!!this.#p,this.noDisposeOnSet=!!p,this.noUpdateTTL=!!_,this.noDeleteOnFetchRejection=!!A,this.allowStaleOnFetchRejection=!!x,this.allowStaleOnFetchAbort=!!M,this.ignoreFetchAbort=!!k,this.maxEntrySize!==0){if(this.#f!==0&&!Ut(this.#f))throw new TypeError("maxSize must be a positive integer if specified");if(!Ut(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#D();}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!w,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=Ut(s)||s===0?s:1,this.ttlAutopurge=!!i,this.ttl=n||0,this.ttl){if(!Ut(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#F();}if(this.#l===0&&this.ttl===0&&this.#f===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#l&&!this.#f){let U="LRU_CACHE_UNBOUNDED";bk(U)&&(cv.add(U),fv("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",U,t));}}getRemainingTTL(e){return this.#i.has(e)?1/0:0}#F(){let e=new qr(this.#l),r=new qr(this.#l);this.#g=e,this.#E=r,this.#N=(i,o,a=Mn.now())=>{if(r[i]=o!==0?a:0,e[i]=o,o!==0&&this.ttlAutopurge){let c=setTimeout(()=>{this.#d(i)&&this.delete(this.#r[i]);},o+1);c.unref&&c.unref();}},this.#C=i=>{r[i]=e[i]!==0?Mn.now():0;},this.#A=(i,o)=>{if(e[o]){let a=e[o],c=r[o];i.ttl=a,i.start=c,i.now=n||s();let d=i.now-c;i.remainingTTL=a-d;}};let n=0,s=()=>{let i=Mn.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=this.#i.get(i);if(o===void 0)return 0;let a=e[o],c=r[o];if(a===0||c===0)return 1/0;let d=(n||s())-c;return a-d},this.#d=i=>e[i]!==0&&r[i]!==0&&(n||s())-r[i]>e[i];}#C=()=>{};#A=()=>{};#N=()=>{};#d=()=>!1;#D(){let e=new qr(this.#l);this.#m=0,this.#S=e,this.#R=r=>{this.#m-=e[r],e[r]=0;},this.#k=(r,n,s,i)=>{if(this.#t(n))return 0;if(!Ut(s))if(i){if(typeof i!="function")throw new TypeError("sizeCalculation must be a function");if(s=i(n,r),!Ut(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},this.#P=(r,n,s)=>{if(e[r]=n,this.#f){let i=this.#f-e[r];for(;this.#m>i;)this.#O(!0);}this.#m+=e[r],s&&(s.entrySize=n,s.totalCalculatedSize=this.#m);};}#R=e=>{};#P=(e,r,n)=>{};#k=(e,r,n,s)=>{if(n||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#b({allowStale:e=this.allowStale}={}){if(this.#n)for(let r=this.#s;!(!this.#$(r)||((e||!this.#d(r))&&(yield r),r===this.#a));)r=this.#h[r];}*#v({allowStale:e=this.allowStale}={}){if(this.#n)for(let r=this.#a;!(!this.#$(r)||((e||!this.#d(r))&&(yield r),r===this.#s));)r=this.#u[r];}#$(e){return e!==void 0&&this.#i.get(this.#r[e])===e}*entries(){for(let e of this.#b())this.#e[e]!==void 0&&this.#r[e]!==void 0&&!this.#t(this.#e[e])&&(yield [this.#r[e],this.#e[e]]);}*rentries(){for(let e of this.#v())this.#e[e]!==void 0&&this.#r[e]!==void 0&&!this.#t(this.#e[e])&&(yield [this.#r[e],this.#e[e]]);}*keys(){for(let e of this.#b()){let r=this.#r[e];r!==void 0&&!this.#t(this.#e[e])&&(yield r);}}*rkeys(){for(let e of this.#v()){let r=this.#r[e];r!==void 0&&!this.#t(this.#e[e])&&(yield r);}}*values(){for(let e of this.#b())this.#e[e]!==void 0&&!this.#t(this.#e[e])&&(yield this.#e[e]);}*rvalues(){for(let e of this.#v())this.#e[e]!==void 0&&!this.#t(this.#e[e])&&(yield this.#e[e]);}[Symbol.iterator](){return this.entries()}find(e,r={}){for(let n of this.#b()){let s=this.#e[n],i=this.#t(s)?s.__staleWhileFetching:s;if(i!==void 0&&e(i,this.#r[n],this))return this.get(this.#r[n],r)}}forEach(e,r=this){for(let n of this.#b()){let s=this.#e[n],i=this.#t(s)?s.__staleWhileFetching:s;i!==void 0&&e.call(r,i,this.#r[n],this);}}rforEach(e,r=this){for(let n of this.#v()){let s=this.#e[n],i=this.#t(s)?s.__staleWhileFetching:s;i!==void 0&&e.call(r,i,this.#r[n],this);}}purgeStale(){let e=!1;for(let r of this.#v({allowStale:!0}))this.#d(r)&&(this.delete(this.#r[r]),e=!0);return e}dump(){let e=[];for(let r of this.#b({allowStale:!0})){let n=this.#r[r],s=this.#e[r],i=this.#t(s)?s.__staleWhileFetching:s;if(i===void 0||n===void 0)continue;let o={value:i};if(this.#g&&this.#E){o.ttl=this.#g[r];let a=Mn.now()-this.#E[r];o.start=Math.floor(Date.now()-a);}this.#S&&(o.size=this.#S[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=Mn.now()-s;}this.set(r,n.value,n);}}set(e,r,n={}){if(r===void 0)return this.delete(e),this;let{ttl:s=this.ttl,start:i,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:c}=n,{noUpdateTTL:d=this.noUpdateTTL}=n,u=this.#k(e,r,n.size||0,a);if(this.maxEntrySize&&u>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this.delete(e),this;let p=this.#n===0?void 0:this.#i.get(e);if(p===void 0)p=this.#n===0?this.#s:this.#_.length!==0?this.#_.pop():this.#n===this.#l?this.#O(!1):this.#n,this.#r[p]=e,this.#e[p]=r,this.#i.set(e,p),this.#u[this.#s]=p,this.#h[p]=this.#s,this.#s=p,this.#n++,this.#P(p,u,c),c&&(c.set="add"),d=!1;else {this.#T(p);let _=this.#e[p];if(r!==_){if(this.#x&&this.#t(_)?_.__abortController.abort(new Error("replaced")):o||(this.#w&&this.#y?.(_,e,"set"),this.#c&&this.#o?.push([_,e,"set"])),this.#R(p),this.#P(p,u,c),this.#e[p]=r,c){c.set="replace";let m=_&&this.#t(_)?_.__staleWhileFetching:_;m!==void 0&&(c.oldValue=m);}}else c&&(c.set="update");}if(s!==0&&!this.#g&&this.#F(),this.#g&&(d||this.#N(p,s,i),c&&this.#A(c,p)),!o&&this.#c&&this.#o){let _=this.#o,m;for(;m=_?.shift();)this.#p?.(...m);}return this}pop(){try{for(;this.#n;){let e=this.#e[this.#a];if(this.#O(!0),this.#t(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#c&&this.#o){let e=this.#o,r;for(;r=e?.shift();)this.#p?.(...r);}}}#O(e){let r=this.#a,n=this.#r[r],s=this.#e[r];return this.#x&&this.#t(s)?s.__abortController.abort(new Error("evicted")):(this.#w||this.#c)&&(this.#w&&this.#y?.(s,n,"evict"),this.#c&&this.#o?.push([s,n,"evict"])),this.#R(r),e&&(this.#r[r]=void 0,this.#e[r]=void 0,this.#_.push(r)),this.#n===1?(this.#a=this.#s=0,this.#_.length=0):this.#a=this.#u[r],this.#i.delete(n),this.#n--,r}has(e,r={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:s}=r,i=this.#i.get(e);if(i!==void 0){let o=this.#e[i];if(this.#t(o)&&o.__staleWhileFetching===void 0)return !1;if(this.#d(i))s&&(s.has="stale",this.#A(s,i));else return n&&this.#C(i),s&&(s.has="hit",this.#A(s,i)),!0}else s&&(s.has="miss");return !1}peek(e,r={}){let{allowStale:n=this.allowStale}=r,s=this.#i.get(e);if(s!==void 0&&(n||!this.#d(s))){let i=this.#e[s];return this.#t(i)?i.__staleWhileFetching:i}}#M(e,r,n,s){let i=r===void 0?void 0:this.#e[r];if(this.#t(i))return i;let o=new Ps,{signal:a}=n;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let c={signal:o.signal,options:n,context:s},d=(v,E=!1)=>{let{aborted:A}=o.signal,w=n.ignoreFetchAbort&&v!==void 0;if(n.status&&(A&&!E?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,w&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),A&&!w&&!E)return p(o.signal.reason);let x=m;return this.#e[r]===m&&(v===void 0?x.__staleWhileFetching?this.#e[r]=x.__staleWhileFetching:this.delete(e):(n.status&&(n.status.fetchUpdated=!0),this.set(e,v,c.options))),v},u=v=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=v),p(v)),p=v=>{let{aborted:E}=o.signal,A=E&&n.allowStaleOnFetchAbort,w=A||n.allowStaleOnFetchRejection,x=w||n.noDeleteOnFetchRejection,M=m;if(this.#e[r]===m&&(!x||M.__staleWhileFetching===void 0?this.delete(e):A||(this.#e[r]=M.__staleWhileFetching)),w)return n.status&&M.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),M.__staleWhileFetching;if(M.__returned===M)throw v},_=(v,E)=>{let A=this.#I?.(e,i,c);A&&A instanceof Promise&&A.then(w=>v(w),E),o.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(v(),n.allowStaleOnFetchAbort&&(v=w=>d(w,!0)));});};n.status&&(n.status.fetchDispatched=!0);let m=new Promise(_).then(d,u),y=Object.assign(m,{__abortController:o,__staleWhileFetching:i,__returned:void 0});return r===void 0?(this.set(e,y,{...c.options,status:void 0}),r=this.#i.get(e)):this.#e[r]=y,y}#t(e){if(!this.#x)return !1;let r=e;return !!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof Ps}async fetch(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:c=0,sizeCalculation:d=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:p=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:_=this.allowStaleOnFetchRejection,ignoreFetchAbort:m=this.ignoreFetchAbort,allowStaleOnFetchAbort:y=this.allowStaleOnFetchAbort,context:v,forceRefresh:E=!1,status:A,signal:w}=r;if(!this.#x)return A&&(A.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:s,noDeleteOnStaleGet:i,status:A});let x={allowStale:n,updateAgeOnGet:s,noDeleteOnStaleGet:i,ttl:o,noDisposeOnSet:a,size:c,sizeCalculation:d,noUpdateTTL:u,noDeleteOnFetchRejection:p,allowStaleOnFetchRejection:_,allowStaleOnFetchAbort:y,ignoreFetchAbort:m,status:A,signal:w},M=this.#i.get(e);if(M===void 0){A&&(A.fetch="miss");let k=this.#M(e,M,x,v);return k.__returned=k}else {let k=this.#e[M];if(this.#t(k)){let B=n&&k.__staleWhileFetching!==void 0;return A&&(A.fetch="inflight",B&&(A.returnedStale=!0)),B?k.__staleWhileFetching:k.__returned=k}let j=this.#d(M);if(!E&&!j)return A&&(A.fetch="hit"),this.#T(M),s&&this.#C(M),A&&this.#A(A,M),k;let U=this.#M(e,M,x,v),F=U.__staleWhileFetching!==void 0&&n;return A&&(A.fetch=j?"stale":"refresh",F&&j&&(A.returnedStale=!0)),F?U.__staleWhileFetching:U.__returned=U}}get(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:o}=r,a=this.#i.get(e);if(a!==void 0){let c=this.#e[a],d=this.#t(c);return o&&this.#A(o,a),this.#d(a)?(o&&(o.get="stale"),d?(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"),d?c.__staleWhileFetching:(this.#T(a),s&&this.#C(a),c))}else o&&(o.get="miss");}#L(e,r){this.#h[r]=e,this.#u[e]=r;}#T(e){e!==this.#s&&(e===this.#a?this.#a=this.#u[e]:this.#L(this.#h[e],this.#u[e]),this.#L(this.#s,e),this.#s=e);}delete(e){let r=!1;if(this.#n!==0){let n=this.#i.get(e);if(n!==void 0)if(r=!0,this.#n===1)this.clear();else {this.#R(n);let s=this.#e[n];this.#t(s)?s.__abortController.abort(new Error("deleted")):(this.#w||this.#c)&&(this.#w&&this.#y?.(s,e,"delete"),this.#c&&this.#o?.push([s,e,"delete"])),this.#i.delete(e),this.#r[n]=void 0,this.#e[n]=void 0,n===this.#s?this.#s=this.#h[n]:n===this.#a?this.#a=this.#u[n]:(this.#u[this.#h[n]]=this.#u[n],this.#h[this.#u[n]]=this.#h[n]),this.#n--,this.#_.push(n);}}if(this.#c&&this.#o?.length){let n=this.#o,s;for(;s=n?.shift();)this.#p?.(...s);}return r}clear(){for(let e of this.#v({allowStale:!0})){let r=this.#e[e];if(this.#t(r))r.__abortController.abort(new Error("deleted"));else {let n=this.#r[e];this.#w&&this.#y?.(r,n,"delete"),this.#c&&this.#o?.push([r,n,"delete"]);}}if(this.#i.clear(),this.#e.fill(void 0),this.#r.fill(void 0),this.#g&&this.#E&&(this.#g.fill(0),this.#E.fill(0)),this.#S&&this.#S.fill(0),this.#a=0,this.#s=0,this.#_.length=0,this.#m=0,this.#n=0,this.#c&&this.#o){let e=this.#o,r;for(;r=e?.shift();)this.#p?.(...r);}}};var wv=fr(yv());function Sk(t){return t.trimEnd().split("").every(e=>Ti.includes(e))}var Ht=class{constructor(e){this.filepath=e.filepath,this.language=e.language,this.text=e.text,this.position=e.position,this.prefix=e.text.slice(0,e.position),this.suffix=e.text.slice(e.position),this.prefixLines=_e(this.prefix),this.suffixLines=_e(this.suffix);let r=Sk(this.suffixLines[0]??"");this.mode=r?"default":"fill-in-line",this.hash=(0, wv.default)({filepath:e.filepath,language:e.language,text:e.text,position:e.position});}};var bv=["statusChanged","configUpdated","authRequired","issuesUpdated"];_t();var Ms=class{constructor(){this.logger=be.child({component:"CompletionCache"});this.options={maxCount:1e4,prebuildCache:{enabled:!0,perCharacter:{lines:1,max:50},perLine:{max:10},autoClosingPairCheck:{max:3}}};this.cache=new Os({max:this.options.maxCount});}has(e){return this.cache.has(e.hash)}buildCache(e,r){this.logger.debug({key:e,value:r},"Starting to build cache");let n=this.createCacheEntries(e,r);n.forEach(s=>{this.cache.set(s.key.hash,{value:s.value,rebuildFlag:s.rebuildFlag});}),this.logger.debug({newEntries:n.length,cacheSize:this.cache.size},"Cache updated");}get(e){let r=this.cache.get(e.hash);return r?.rebuildFlag&&this.buildCache(e,r?.value),r?.value}createCacheEntries(e,r){let n=[{key:e,value:r,rebuildFlag:!1}];if(this.options.prebuildCache.enabled)for(let i of r.choices){let o=i.text.slice(e.position-i.replaceRange.start),a=this.getPerLinePositions(o);this.logger.trace({completionText:o,perLinePositions:a},"Calculate per-line cache positions");for(let d of a){let u=o.slice(0,d),p=this.generateAutoClosedPrefixes(u);for(let _ of [u,...p]){let m={key:new Ht({...e,text:e.text.slice(0,e.position)+_+e.text.slice(e.position),position:e.position+d}),value:{...r,choices:[{index:i.index,text:o.slice(d),replaceRange:{start:e.position+d,end:e.position+d}}]},rebuildFlag:!0};this.logger.trace({prefix:_,entry:m},"Build per-line cache entry"),n.push(m);}}let c=this.getPerCharacterPositions(o);this.logger.trace({completionText:o,perCharacterPositions:c},"Calculate per-character cache positions");for(let d of c){let u=d;for(;u>0&&o[u-1]!==`
|
||
`;)u--;let p=o.slice(0,d),_=this.generateAutoClosedPrefixes(p);for(let m of [p,..._]){let y={key:new Ht({...e,text:e.text.slice(0,e.position)+m+e.text.slice(e.position),position:e.position+d}),value:{...r,choices:[{index:i.index,text:o.slice(u),replaceRange:{start:e.position+u,end:e.position+d}}]},rebuildFlag:!1};this.logger.trace({prefix:m,entry:y},"Build per-character cache entry"),n.push(y);}}}return n.reduce((i,o)=>{let a=i.find(c=>c.key.hash===o.key.hash);return a?(a.value.choices.push(...o.value.choices),a.rebuildFlag=a.rebuildFlag||o.rebuildFlag):i.push(o),i},[])}getPerLinePositions(e){let r=[],n=this.options.prebuildCache,s=_e(e),i=0,o=0;for(;i<s.length-1&&i<n.perLine.max;){o+=s[i].length,r.push(o-1),r.push(o);let a=o;for(;a<e.length&&e[a].match(/\s/);)a++;r.push(a),i++;}return r}getPerCharacterPositions(e){let r=[],n=this.options.prebuildCache,s=_e(e).slice(0,n.perCharacter.lines).join(""),i=0;for(;i<s.length&&i<n.perCharacter.max;)r.push(i),i++;return r}generateAutoClosedPrefixes(e){let r=[],n=Ii(e);for(let s=0,i="";s<this.options.prebuildCache.autoClosingPairCheck.max&&n.length>s;s++){let o=Bp.indexOf(n[n.length-1-s]);if(o<0)break;i=i+Ti[o],r.push(e+i);}return r}};_t();function Mu(t,e,r){return Math.max(t,Math.min(e,r))}var Fs=class{constructor(){this.logger=be.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 a=this.calcContextScore(n),d=(this.options.adaptiveRate.max-(this.options.adaptiveRate.max-this.options.adaptiveRate.min)*a)*this.baseInterval,u=Mu(this.options.requestDelay.min,this.options.requestDelay.max,d-i);return this.sleep(u,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=Mu(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=_e(i)[0]??"";return r+=o.match(/^\W*$/)?n.noSuffixInCurrentLine:0,r+=i.match(/^\W*$/)?n.noSuffix:0,r=Mu(0,1,r),r}};Ft();_t();var Ce=be.child({component:"Postprocess"});Array.prototype.distinct||(Array.prototype.distinct=function(t){return [...new Map(this.map(e=>[t?.(e)??e,e])).values()]});function ut(t,e){return async r=>(r.choices=(await Promise.all(r.choices.map(async n=>{let s=e.position-n.replaceRange.start,i=await t(n.text.slice(s));return n.text=n.text.slice(0,s)+(i??""),n}))).filter(n=>!!n.text).distinct(n=>n.text),r)}function Ek(t){return /\n(\s*)\n/g}var vv=t=>e=>{let r=e.split(Ek()),n=0,s=2,i=r.length-2;for(;i>=1;){if(ae(r[i])){i--;continue}let o=i-1;for(;o>=0&&ae(r[o]);)o--;if(o<0)break;let a=r[i].trim(),c=r[o].trim(),d=Math.max(.1*a.length,.1*c.length);if(Er(a,c)<=d)n++,i--;else break}return n>=s?(Ce.debug({inputBlocks:r,repetitionCount:n},"Remove repetitive blocks."),r.slice(0,i+1).join("").trimEnd()):e};var Sv=()=>t=>{let e=_e(t),r=0,n=5,s=e.length-2;for(;s>=1;){if(ae(e[s])){s--;continue}let i=s-1;for(;i>=0&&ae(e[i]);)i--;if(i<0)break;let o=e[s].trim(),a=e[i].trim(),c=Math.max(.1*o.length,.1*a.length);if(Er(o,a)<=c)r++,s=i;else break}return r>=n?(Ce.debug({inputLines:e,repetitionCount:r},"Remove repetitive lines."),e.slice(0,s+1).join("").trimEnd()):t};var Ak=[/(.{3,}?)\1{5,}$/g,/(.{10,}?)\1{3,}$/g],Ev=()=>t=>{let e=_e(t),r=e.length-1;for(;r>=0&&ae(e[r]);)r--;if(r<0)return t;for(let n of Ak){let s=e[r].match(n);if(s)return Ce.debug({inputLines:e,lineNumber:r,match:s},"Remove line ends with repetition."),r<1?null:e.slice(0,r).join("").trimEnd()}return t};Ft();function jt(t){return t.match(/^[ \t]*/)?.[0]?.length??0}function xk(t,e){return e>=t.length-1?!1:jt(t[e])<jt(t[e+1])}function Ck(t,e,r,n){let s=!1,i={indentLevelLimit:0,allowClosingLine:A=>s};if(t.length==0||e.length==0)return i;let o=e[e.length-1],a=ae(o),c=e.length-1;for(;c>=0&&ae(e[c]);)c--;if(c<0)return i;let d=e[c],u=jt(d),p=t[0],_=ae(p),m=0;for(;m<t.length&&ae(t[m]);)m++;if(m>=t.length)return i;let y=t[m],v;_?v=jt(y):v=jt(o+y),!_&&!a?(n.experimentalKeepBlockScopeWhenCompletingLine?i.indentLevelLimit=u:i.indentLevelLimit=u+1,s=!!t[1]&&jt(t[1])>u):v>u?(i.indentLevelLimit=u+1,s=!0):(i.indentLevelLimit=u,s=!0);let E=1;for(;E<r.length&&ae(r[E]);)E++;return E<r.length&&(s&&=jt(r[E])<i.indentLevelLimit,i.allowClosingLine=A=>{let w=A.startsWith(r[E])||r[E].startsWith(A);return s&&!w}),i}function Fu(t,e){return r=>{let{prefixLines:n,suffixLines:s}=t,i=_e(r);if(t.mode==="fill-in-line"&&i.length>1)return Ce.debug({inputLines:i,prefixLines:n,suffixLines:s},"Drop content with multiple lines"),null;let o=Ck(i,n,s,e),a;for(a=1;a<i.length;a++){if(ae(i[a]))continue;if(jt(i[a])<o.indentLevelLimit){if(xk(i,a))continue;o.allowClosingLine(i[a])&&(t.language!=="python"||!ae(i[a-1]))&&a++;break}}return a<i.length?(Ce.debug({inputLines:i,prefixLines:n,suffixLines:s,scopeLineCount:a},"Remove content out of indent scope"),i.slice(0,a).join("").trimEnd()):r}}var Ns=fr(Av());Ft();var Ur={javascript:"tsx",typescript:"tsx",javascriptreact:"tsx",typescriptreact:"tsx",python:"python",go:"go",rust:"rust",ruby:"ruby"},xv=!1;async function Rk(t){xv||(await Ns.default.init({locateFile(n,s){let i=[s,"wasm",n];return G("path").join(...i)}}),xv=!0);let e=new Ns.default,r=[__dirname,"wasm",`tree-sitter-${t}.wasm`];return e.setLanguage(await Ns.default.Language.load(G("path").join(...r))),e}var Cv=new Map;async function ks(t){let e=Cv.get(t);return e||(e=await Rk(t),Cv.set(t,e)),e}var Rv={tsx:[["jsx_element","jsx_self_closing_element","for_statement","for_in_statement","if_statement","while_statement","do_statement","switch_statement","try_statement","with_statement","labeled_statement","class_declaration","abstract_class_declaration","interface_declaration","enum_declaration","type_alias_declaration","function_declaration","generator_function_declaration","ambient_declaration","method_definition","import_statement","export_statement","module"]],python:[["for_statement","if_statement","while_statement","match_statement","try_statement","with_statement","function_definition","decorated_definition","class_definition","import_statement","import_from_statement"]],go:[["for_statement","if_statement","expression_switch_statement","type_switch_statement","select_statement","labeled_statement","function_declaration","method_declaration","type_declaration","import_declaration","package_clause"]],rust:[["for_expression","if_expression","while_expression","loop_expression","match_expression","try_expression","function_item","type_item","enum_item","struct_item","union_item","trait_item","impl_item","use_declaration"]],ruby:[["for","if","unless","while","until","case","class","singleton_class","method","singleton_method","module"]]};var Nu=Object.keys(Ur);function Tk(t,e){let r=e-1;for(;r>=0&&t[r].match(/\s/);)r--;if(r<0)return 0;let n=t.lastIndexOf(`
|
||
`,r);if(n<0)return 0;let i=t.slice(n+1,e).search(/\S/);return n+1+i}function Ik(t,e){let r=e;for(;r<t.length&&t[r].match(/\s/);)r++;if(r>=t.length)return t.length;let n=t.indexOf(`
|
||
`,r);return n<0?t.length:n}function Pk(t,e){for(let r of e){let n=t;for(;n;){if(r.includes(n.type))return n;n=n.parent;}}return t}function Tv(t){return async e=>{let{position:r,text:n,language:s,prefix:i,suffix:o}=t;if(!Nu.includes(s))return e;let a=Ur[s],c=await ks(a),d=i+e+o,u=c.parse(d),p=Tk(d,r),_=Ik(d,r),m=Pk(u.rootNode.namedDescendantForIndex(p,_),Rv[a]);return m.endIndex<r+e.length?(Ce.debug({languageConfig:a,text:n,updatedText:d,position:r,lineBegin:p,lineEnd:_,scope:{type:m.type,start:m.startIndex,end:m.endIndex}},"Remove content out of syntax scope"),e.slice(0,m.endIndex-r)):e}}function Iv(t,e){return r=>e.experimentalSyntax&&Nu.includes(t.language)?Tv(t)(r):Fu(t,e.indentation)(r)}var ku=t=>e=>{let {prefixLines:r,suffixLines:n}=t;_e(e);let i=e,o=r[r.length-1]??"",a=n[0]??"";return !ae(o)&&o.match(/\s$/)&&(i=i.trimStart()),(ae(a)||!ae(a)&&a.match(/^\s/))&&(i=i.trimEnd()),i};var $u=t=>e=>{let{suffixLines:r}=t,n=_e(e),s=0;for(;s<n.length&&ae(n[s]);)s++;let i=0;for(;i<r.length&&ae(r[i]);)i++;let o=Math.min(3,n.length-s,r.length-i);if(o<1)return e;let a=n.slice(s,s+o).join("").trim(),c=r.slice(i,i+o).join("").trim(),d=Math.max(1,.05*a.length,.05*c.length),u=Er(a,c);return u<=d?(Ce.debug({inputLines:n,suffixLines:r,inputToCompare:a,suffixToCompare:c,distance:u,threshold:d},"Drop completion due to duplicated."),null):e};var Lu=()=>t=>ae(t)?null:t;function Pv(t,e){let{suffixLines:r}=e,n=r[0]?.trimEnd()||"";if(ae(n))return t;for(let s of t.choices){let i=s.text.slice(e.position-s.replaceRange.start),o=Ii(i);ae(o)||(n.startsWith(o)?(s.replaceRange.end=e.position+o.length,Ce.trace({context:e,completion:s.text,range:s.replaceRange,unpaired:o},"Adjust replace range by bracket stack")):o.startsWith(n)&&(s.replaceRange.end=e.position+n.length,Ce.trace({context:e,completion:s.text,range:s.replaceRange,unpaired:o},"Adjust replace range by bracket stack")));}return t}var Du=Object.keys(Ur);async function Ov(t,e){let{position:r,prefix:n,suffix:s,prefixLines:i,suffixLines:o,language:a}=e;if(!Du.includes(a))return t;let c=Ur[a],d=await ks(c),p=o[0]?.trimEnd()||"";if(ae(p))return t;for(let _ of t.choices){let m=_.text.slice(r-_.replaceRange.start),y=_e(m),v=0,E=d.parse(n+m+s),A=E.rootNode.namedDescendantForIndex(n.length+m.length);for(;A.hasError()&&v<p.length;){v++;let w=i.length-1+y.length-1,x=y[y.length-1].length;y.length==1&&(x+=i[i.length-1].length),E.edit({startIndex:n.length+m.length,oldEndIndex:n.length+m.length+1,newEndIndex:n.length+m.length,startPosition:{row:w,column:x},oldEndPosition:{row:w,column:x+1},newEndPosition:{row:w,column:x}}),E=d.parse(n+m+s.slice(v),E),A=E.rootNode.namedDescendantForIndex(n.length+m.length);}A.hasError()||(_.replaceRange.end=r+v,Ce.trace({context:e,completion:_.text,range:_.replaceRange},"Adjust replace range by syntax"));}return t}async function Mv(t,e,r){return Promise.resolve(r).then(ut(Ev(),t)).then(ut($u(t),t)).then(ut(ku(t),t)).then(ut(Lu(),t))}async function Fv(t,e,r){return Promise.resolve(r).then(ut(vv(),t)).then(ut(Sv(),t)).then(ut(Iv(t,e.limitScope),t)).then(ut($u(t),t)).then(ut(ku(t),t)).then(ut(Lu(),t))}async function Nv(t,e,r){return !e.calculateReplaceRange.experimentalSyntax||!Du.includes(t.language)?Pv(r,t):Ov(r,t)}_t();var $v="tabby-agent",Lv="1.1.1";Ft();_t();var $s=class t{constructor(){this.anonymousUsageTrackingApi=Zt({baseUrl:"https://app.tabbyml.com/api"});this.logger=be.child({component:"AnonymousUsage"});this.systemData={agent:`${$v}, ${Lv}`,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||Fr,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=gt(),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=gt();}setSessionProperties(e,r){Sr(this.sessionProperties,e,r);}setUserProperties(e,r){Sr(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.includes(e))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 Hu=fr(Uv());_t();var Ls=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}},Ds=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}},qs=class{constructor(){this.logger=be.child({component:"CompletionProviderStats"});this.config={windowSize:10,checks:{disable:!1,healthy:{windowSize:3,latency:2400},slowResponseTime:{latency:3200,count:3},highTimeoutRate:{rate:.5,count:3}}};this.autoCompletionCount=0;this.manualCompletionCount=0;this.cacheHitCount=0;this.cacheMissCount=0;this.eventMap=new Map;this.completionRequestLatencyStats=new Hu.Univariate;this.completionRequestCanceledStats=new Ls;this.completionRequestTimeoutCount=0;this.recentCompletionRequestLatencies=new Ds(this.config.windowSize);}updateConfigByRequestTimeout(e){this.config.checks.healthy.latency=e*.6,this.config.checks.slowResponseTime.latency=e*.8,this.resetWindowed();}add(e){let{triggerMode:r,cacheHit:n,aborted:s,requestSent:i,requestLatency:o,requestCanceled:a,requestTimeout:c}=e;s||(r==="auto"?this.autoCompletionCount+=1:this.manualCompletionCount+=1,n?this.cacheHitCount+=1:this.cacheMissCount+=1),i&&(a?this.completionRequestCanceledStats.add(o):c?this.completionRequestTimeoutCount+=1:this.completionRequestLatencyStats.add(o),a||this.recentCompletionRequestLatencies.add(o));}addEvent(e){let r=this.eventMap.get(e)||0;this.eventMap.set(e,r+1);}reset(){this.autoCompletionCount=0,this.manualCompletionCount=0,this.cacheHitCount=0,this.cacheMissCount=0,this.eventMap=new Map,this.completionRequestLatencyStats=new Hu.Univariate,this.completionRequestCanceledStats=new Ls,this.completionRequestTimeoutCount=0;}resetWindowed(){this.recentCompletionRequestLatencies=new Ds(this.config.windowSize);}stats(){let e=Object.fromEntries(Array.from(this.eventMap.entries()).map(([r,n])=>["count_"+r,n]));return {completion:{count_auto:this.autoCompletionCount,count_manual:this.manualCompletionCount,cache_hit:this.cacheHitCount,cache_miss:this.cacheMissCount,...e},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}}}check(e){if(this.config.checks.disable)return null;let r=this.config.checks,{values:n,stats:{total:s,timeouts:i,responses:o,averageResponseTime:a}}=e;return n.slice(-Math.max(this.config.windowSize,r.healthy.windowSize)).every(c=>c<r.healthy.latency)?"healthy":i/s>r.highTimeoutRate.rate&&i>=r.highTimeoutRate.count?"highTimeoutRate":a>r.slowResponseTime.latency&&o>=r.slowResponseTime.count?"slowResponseTime":null}};var Us=class t extends events.EventEmitter{constructor(){super();this.logger=be.child({component:"TabbyAgent"});this.config=Ru;this.userConfig={};this.clientConfig={};this.status="notInitialized";this.issues=[];this.serverHealthState=null;this.connectionErrorMessage=null;this.dataStore=null;this.completionCache=new Ms;this.completionDebounce=new Fs;this.nonParallelProvideCompletionAbortController=null;this.completionProviderStats=new qs;this.tryingConnectTimer=null;this.submitStatsTimer=null;this.tryingConnectTimer=setInterval(async()=>{this.status==="disconnected"&&(this.logger.debug("Trying to connect..."),await this.healthCheck());},t.tryConnectInterval),this.submitStatsTimer=setInterval(async()=>{await this.submitStats();},t.submitStatsInterval);}static{this.tryConnectInterval=1e3*30;}static{this.submitStatsInterval=1e3*60*60*24;}static async create(r){let n=new t;return n.dataStore=r?.dataStore,n.anonymousUsageLogger=await $s.create({dataStore:r?.dataStore}),n}async applyConfig(){let r=this.config,n=this.status;this.config=Op(Ru,this.userConfig,this.clientConfig),Lr.forEach(i=>i.level=this.config.logs.level),this.anonymousUsageLogger.disabled=this.config.anonymousUsageTracking.disable,ae(this.config.server.token)&&this.config.server.requestHeaders.Authorization===void 0?this.config.server.endpoint!==this.auth?.endpoint&&(this.auth=await Is.create({endpoint:this.config.server.endpoint,dataStore:this.dataStore}),this.auth.on("updated",this.setupApi.bind(this))):this.auth=null,(0, Bs.default)(r.server,this.config.server)||(this.serverHealthState=null,this.completionProviderStats.resetWindowed(),this.popIssue("slowCompletionResponseTime"),this.popIssue("highCompletionTimeoutRate"),this.popIssue("connectionFailed"),this.connectionErrorMessage=null),await this.setupApi(),(0, Bs.default)(r.server,this.config.server)||n==="unauthorized"&&this.status==="unauthorized"&&this.emitAuthRequired(),r.completion.timeout!==this.config.completion.timeout&&(this.completionProviderStats.updateConfigByRequestTimeout(this.config.completion.timeout),this.popIssue("slowCompletionResponseTime"),this.popIssue("highCompletionTimeoutRate"));let s={event:"configUpdated",config:this.config};this.logger.debug({event:s},"Config updated"),super.emit("configUpdated",s);}async setupApi(){let r=ae(this.config.server.token)?this.auth?.token?`Bearer ${this.auth.token}`:void 0:`Bearer ${this.config.server.token}`;this.api=Zt({baseUrl:this.config.server.endpoint.replace(/\/+$/,""),headers:{Authorization:r,...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};case"connectionFailed":return {name:"connectionFailed",message:this.connectionErrorMessage}}}pushIssue(r){this.issues.includes(r)||(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"));}createAbortSignal(r){let n=Math.min(2147483647,r?.timeout||this.config.server.requestTimeout);return an([AbortSignal.timeout(n),r?.signal])}async healthCheck(r){let n=gt(),s="/v1/health",i=this.config.server.endpoint+s,o={signal:this.createAbortSignal(r)};try{this.logger.debug({requestId:n,requestOptions:o,url:i},"Health check request");let a=await this.api.GET(s,o);if(a.error)throw new De(a.response);this.logger.debug({requestId:n,response:a},"Health check response"),this.changeStatus("ready"),this.popIssue("connectionFailed"),this.connectionErrorMessage=null;let c=a.data;typeof c=="object"&&c.model!==void 0&&c.device!==void 0&&(this.serverHealthState=c,this.anonymousUsageLogger.uniqueEvent("AgentConnected",c));}catch(a){this.serverHealthState=null,a instanceof De&&[401,403,405].includes(a.status)&&new URL(this.config.server.endpoint).hostname.endsWith("app.tabbyml.com")&&ae(this.config.server.token)&&this.config.server.requestHeaders.Authorization===void 0?(this.logger.debug({requestId:n,error:a},"Health check error: unauthorized"),this.changeStatus("unauthorized")):(ln(a)?(this.logger.debug({requestId:n,error:a},"Health check error: timeout"),this.connectionErrorMessage=`GET ${i}: Timed out.`):Yt(a)?(this.logger.debug({requestId:n,error:a},"Health check error: canceled"),this.connectionErrorMessage=`GET ${i}: Canceled.`):(this.logger.error({requestId:n,error:a},"Health check error: unknown error"),this.connectionErrorMessage=`GET ${i}: Request failed:
|
||
${da(a)}`),this.pushIssue("connectionFailed"),this.changeStatus("disconnected"));}}createSegments(r){let n=this.config.completion.prompt.maxPrefixLines,s=this.config.completion.prompt.maxSuffixLines,{prefixLines:i,suffixLines:o}=r,a=i.slice(Math.max(i.length-n,0)).join(""),c;return this.config.completion.prompt.experimentalStripAutoClosingCharacters&&r.mode!=="fill-in-line"?c=`
|
||
`+o.slice(1,s).join(""):c=o.slice(0,s).join(""),{prefix:a,suffix:c}}async initialize(r){if(r.clientProperties){let{user:n,session:s}=r.clientProperties;Lr.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 Dr&&(await Dr.load(),this.userConfig=Dr.config,Dr.on("updated",async n=>{this.userConfig=n,await this.applyConfig();}),Dr.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 this.status==="finalized"?!1:(await this.submitStats(),this.tryingConnectTimer&&(clearInterval(this.tryingConnectTimer),this.tryingConnectTimer=null),this.submitStatsTimer&&(clearInterval(this.submitStatsTimer),this.submitStatsTimer=null),this.changeStatus("finalized"),!0)}async updateClientProperties(r,n,s){switch(r){case"session":let i={};Sr(i,n,s),Lr.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=Ci(this.clientConfig,r);return (0, Bs.default)(s,n)||(n===void 0?Ri(this.clientConfig,r):Sr(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&&r.index<this.issues.length?this.issueFromName(this.issues[r.index]):r.name!==void 0&&this.issues.includes(r.name)?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.logger.trace({request:r},"Call provideCompletions"),this.nonParallelProvideCompletionAbortController&&this.nonParallelProvideCompletionAbortController.abort(),this.nonParallelProvideCompletionAbortController=new AbortController;let s=an([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},a=null,c=new Ht(r);try{if(this.completionCache.has(c))o.cacheHit=!0,this.logger.debug({context:c},"Completion cache hit"),await this.completionDebounce.debounce({request:r,config:this.config.completion.debounce,responseTime:0},{signal:s}),i=this.completionCache.get(c);else {o.cacheHit=!1;let d=this.createSegments(c);if(ae(d.prefix))o=null,this.logger.debug("Segment prefix is blank, returning empty completion response"),i={id:"agent-"+gt(),choices:[]};else {await this.completionDebounce.debounce({request:r,config:this.config.completion.debounce,responseTime:this.completionProviderStats.stats().averageResponseTime},n);let u=gt();o.requestSent=!0,a=performance.now();try{let p="/v1/completions",_={body:{language:r.language,segments:d,user:this.auth?.user},signal:this.createAbortSignal({signal:s,timeout:this.config.completion.timeout})};this.logger.debug({requestId:u,requestOptions:_,url:this.config.server.endpoint+p},"Completion request");let m=await this.api.POST(p,_);if(m.error)throw new De(m.response);this.logger.debug({requestId:u,response:m},"Completion response");let y=m.data;o.requestLatency=performance.now()-a,i={id:y.id,choices:y.choices.map(v=>({index:v.index,text:v.text,replaceRange:{start:r.position,end:r.position}}))};}catch(p){throw Yt(p)?(this.logger.debug({requestId:u,error:p},"Completion request canceled"),o.requestCanceled=!0,o.requestLatency=performance.now()-a):ln(p)?(this.logger.debug({requestId:u,error:p},"Completion request timeout"),o.requestTimeout=!0,o.requestLatency=NaN):(this.logger.error({requestId:u,error:p},"Completion request failed with unknown error"),this.healthCheck()),p}if(i=await Mv(c,this.config.postprocess,i),n?.signal?.aborted)throw n.signal.reason;this.completionCache.buildCache(c,JSON.parse(JSON.stringify(i)));}}if(i=await Fv(c,this.config.postprocess,i),n?.signal?.aborted||(i=await Nv(c,this.config.postprocess,i),n?.signal?.aborted))throw n.signal.reason}catch(d){throw Yt(d)||ln(d)?o&&(o.aborted=!0):o=null,d}finally{if(o&&(this.completionProviderStats.add(o),o.requestSent&&!o.requestCanceled)){let d=this.completionProviderStats.windowed();switch(this.completionProviderStats.check(d)){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 this.logger.trace({context:c,completionResponse:i},"Return from provideCompletions"),i}async postEvent(r,n){if(this.status==="notInitialized")throw new Error("Agent is not initialized");this.completionProviderStats.addEvent(r.type);let s=gt();try{let i="/v1/events",o={body:r,params:{query:{select_kind:r.select_kind}},signal:this.createAbortSignal(n),parseAs:"text"};this.logger.debug({requestId:s,requestOptions:o,url:this.config.server.endpoint+i},"Event request");let a=await this.api.POST(i,o);if(a.error)throw new De(a.response);return this.logger.debug({requestId:s,response:a},"Event response"),!0}catch(i){return ln(i)?this.logger.debug({requestId:s,error:i},"Event request timeout"):Yt(i)?this.logger.debug({requestId:s,error:i},"Event request canceled"):this.logger.error({requestId:s,error:i},"Event request failed with unknown error"),!1}}};_t();var Hs=class{constructor(){this.process=process;this.inStream=process.stdin;this.outStream=process.stdout;this.logger=be.child({component:"StdIO"});this.buffer="";this.abortControllers={};this.agent=null;}async handleInput(e){let r=e.toString();this.buffer+=r;let n=_e(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(a){this.logger.error({error:a},`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 a=e[1].args;a.length>0&&typeof a[a.length-1]=="object"&&a[a.length-1].signal&&(this.abortControllers[r]=s,a[a.length-1].signal=s.signal),n[1]=await o.apply(this.agent,a);}}catch(i){Yt(i)?this.logger.debug({error:i,request:e},"Request canceled"):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 bv)this.agent.on(r,n=>{this.sendResponse([0,n]);});}listen(){this.inStream.on("data",this.handleInput.bind(this)),["SIGTERM","SIGINT"].forEach(e=>{this.process.on(e,async()=>{this.agent&&this.agent.getStatus()!=="finalized"&&await this.agent.finalize(),this.process.exit(0);});});}};var Hv=new Hs;Us.create().then(t=>{Hv.bind(t),Hv.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.
|
||
*)
|
||
*/
|
||
//# sourceMappingURL=out.js.map
|
||
//# sourceMappingURL=cli.js.map
|