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

252 lines
313 KiB
JavaScript
Executable File
Raw Blame History

This file contains ambiguous Unicode characters!

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

#!/bin/env node
'use strict';
var child_process = require('child_process');
var zlib = require('zlib');
var stream = require('stream');
var fs = require('fs');
var promises = require('fs/promises');
var path = require('path');
var util = require('util');
var events = require('events');
var ZE = require('crypto');
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
var ZE__default = /*#__PURE__*/_interopDefault(ZE);
var KE=Object.create;var Dn=Object.defineProperty;var VE=Object.getOwnPropertyDescriptor;var YE=Object.getOwnPropertyNames;var JE=Object.getPrototypeOf,XE=Object.prototype.hasOwnProperty;var QE=(t,e,r)=>e in t?Dn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var z=(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 qi=(t,e)=>()=>(t&&(e=t(t=0)),e);var R=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Wo=(t,e)=>{for(var r in e)Dn(t,r,{get:e[r],enumerable:!0});},Cf=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of YE(e))!XE.call(t,s)&&s!==r&&Dn(t,s,{get:()=>e[s],enumerable:!(n=VE(e,s))||n.enumerable});return t};var Nn=(t,e,r)=>(r=t!=null?KE(JE(t)):{},Cf(e||!t||!t.__esModule?Dn(r,"default",{value:t,enumerable:!0}):r,t)),zo=t=>Cf(Dn({},"__esModule",{value:!0}),t);var ne=(t,e,r)=>(QE(t,typeof e!="symbol"?e+"":e,r),r),Go=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)};var S=(t,e,r)=>(Go(t,e,"read from private field"),r?r.call(t):e.get(t)),ae=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r);},re=(t,e,r,n)=>(Go(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r);var Di=(t,e,r,n)=>({set _(s){re(t,e,s,r);},get _(){return S(t,e,n)}}),ee=(t,e,r)=>(Go(t,e,"access private method"),r);var Yo=R((Lq,Pf)=>{var Of=Object.prototype.toString;Pf.exports=function(e){var r=Of.call(e),n=r==="[object Arguments]";return n||(n=r!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&Of.call(e.callee)==="[object Function]"),n};});var Nf=R((Fq,Df)=>{var qf;Object.keys||(Mn=Object.prototype.hasOwnProperty,Jo=Object.prototype.toString,Tf=Yo(),Xo=Object.prototype.propertyIsEnumerable,$f=!Xo.call({toString:null},"toString"),If=Xo.call(function(){},"prototype"),jn=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],ji=function(t){var e=t.constructor;return e&&e.prototype===t},kf={$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},Lf=function(){if(typeof window>"u")return !1;for(var t in window)try{if(!kf["$"+t]&&Mn.call(window,t)&&window[t]!==null&&typeof window[t]=="object")try{ji(window[t]);}catch{return !0}}catch{return !0}return !1}(),Ff=function(t){if(typeof window>"u"||!Lf)return ji(t);try{return ji(t)}catch{return !1}},qf=function(e){var r=e!==null&&typeof e=="object",n=Jo.call(e)==="[object Function]",s=Tf(e),i=r&&Jo.call(e)==="[object String]",o=[];if(!r&&!n&&!s)throw new TypeError("Object.keys called on a non-object");var l=If&&n;if(i&&e.length>0&&!Mn.call(e,0))for(var c=0;c<e.length;++c)o.push(String(c));if(s&&e.length>0)for(var p=0;p<e.length;++p)o.push(String(p));else for(var u in e)!(l&&u==="prototype")&&Mn.call(e,u)&&o.push(String(u));if($f)for(var g=Ff(e),y=0;y<jn.length;++y)!(g&&jn[y]==="constructor")&&Mn.call(e,jn[y])&&o.push(jn[y]);return o});var Mn,Jo,Tf,Xo,$f,If,jn,ji,kf,Lf,Ff;Df.exports=qf;});var Hi=R((qq,Bf)=>{var rA=Array.prototype.slice,nA=Yo(),Mf=Object.keys,Bi=Mf?function(e){return Mf(e)}:Nf(),jf=Object.keys;Bi.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 nA(n)?jf(rA.call(n)):jf(n)});}else Object.keys=Bi;return Object.keys||Bi};Bf.exports=Bi;});var Ui=R((Dq,Hf)=>{Hf.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 Qo=R((Nq,Wf)=>{var Uf=typeof Symbol<"u"&&Symbol,iA=Ui();Wf.exports=function(){return typeof Uf!="function"||typeof Symbol!="function"||typeof Uf("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:iA()};});var Kf=R((Mq,Gf)=>{var zf={foo:{}},sA=Object;Gf.exports=function(){return {__proto__:zf}.foo===zf.foo&&!({__proto__:null}instanceof sA)};});var Yf=R((jq,Vf)=>{var oA="Function.prototype.bind called on incompatible ",Zo=Array.prototype.slice,aA=Object.prototype.toString,lA="[object Function]";Vf.exports=function(e){var r=this;if(typeof r!="function"||aA.call(r)!==lA)throw new TypeError(oA+r);for(var n=Zo.call(arguments,1),s,i=function(){if(this instanceof s){var u=r.apply(this,n.concat(Zo.call(arguments)));return Object(u)===u?u:this}else return r.apply(e,n.concat(Zo.call(arguments)))},o=Math.max(0,r.length-n.length),l=[],c=0;c<o;c++)l.push("$"+c);if(s=Function("binder","return function ("+l.join(",")+"){ return binder.apply(this,arguments); }")(i),r.prototype){var p=function(){};p.prototype=r.prototype,s.prototype=new p,p.prototype=null;}return s};});var Wi=R((Bq,Jf)=>{var uA=Yf();Jf.exports=Function.prototype.bind||uA;});var Qf=R((Hq,Xf)=>{var cA=Wi();Xf.exports=cA.call(Function.call,Object.prototype.hasOwnProperty);});var kt=R((Uq,nh)=>{var fe,Xr=SyntaxError,rh=Function,Jr=TypeError,ea=function(t){try{return rh('"use strict"; return ('+t+").constructor;")()}catch{}},_r=Object.getOwnPropertyDescriptor;var ta=function(){throw new Jr},fA=_r?function(){try{return ta}catch{try{return _r(arguments,"callee").get}catch{return ta}}}():ta,Vr=Qo()(),hA=Kf()(),Ie=Object.getPrototypeOf||(hA?function(t){return t.__proto__}:null),Yr={},pA=typeof Uint8Array>"u"||!Ie?fe:Ie(Uint8Array),xr={"%AggregateError%":typeof AggregateError>"u"?fe:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?fe:ArrayBuffer,"%ArrayIteratorPrototype%":Vr&&Ie?Ie([][Symbol.iterator]()):fe,"%AsyncFromSyncIteratorPrototype%":fe,"%AsyncFunction%":Yr,"%AsyncGenerator%":Yr,"%AsyncGeneratorFunction%":Yr,"%AsyncIteratorPrototype%":Yr,"%Atomics%":typeof Atomics>"u"?fe:Atomics,"%BigInt%":typeof BigInt>"u"?fe:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?fe:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?fe:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?fe:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?fe:Float32Array,"%Float64Array%":typeof Float64Array>"u"?fe:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?fe:FinalizationRegistry,"%Function%":rh,"%GeneratorFunction%":Yr,"%Int8Array%":typeof Int8Array>"u"?fe:Int8Array,"%Int16Array%":typeof Int16Array>"u"?fe:Int16Array,"%Int32Array%":typeof Int32Array>"u"?fe:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Vr&&Ie?Ie(Ie([][Symbol.iterator]())):fe,"%JSON%":typeof JSON=="object"?JSON:fe,"%Map%":typeof Map>"u"?fe:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Vr||!Ie?fe:Ie(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?fe:Promise,"%Proxy%":typeof Proxy>"u"?fe:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?fe:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?fe:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Vr||!Ie?fe:Ie(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?fe:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Vr&&Ie?Ie(""[Symbol.iterator]()):fe,"%Symbol%":Vr?Symbol:fe,"%SyntaxError%":Xr,"%ThrowTypeError%":fA,"%TypedArray%":pA,"%TypeError%":Jr,"%Uint8Array%":typeof Uint8Array>"u"?fe:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?fe:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?fe:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?fe:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?fe:WeakMap,"%WeakRef%":typeof WeakRef>"u"?fe:WeakRef,"%WeakSet%":typeof WeakSet>"u"?fe:WeakSet};var dA=function t(e){var r;if(e==="%AsyncFunction%")r=ea("async function () {}");else if(e==="%GeneratorFunction%")r=ea("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=ea("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype);}else if(e==="%AsyncIteratorPrototype%"){var s=t("%AsyncGenerator%");s&&Ie&&(r=Ie(s.prototype));}return xr[e]=r,r},eh={"%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"]},Bn=Wi(),zi=Qf(),gA=Bn.call(Function.call,Array.prototype.concat),yA=Bn.call(Function.apply,Array.prototype.splice),th=Bn.call(Function.call,String.prototype.replace),Gi=Bn.call(Function.call,String.prototype.slice),mA=Bn.call(Function.call,RegExp.prototype.exec),vA=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,wA=/\\(\\)?/g,SA=function(e){var r=Gi(e,0,1),n=Gi(e,-1);if(r==="%"&&n!=="%")throw new Xr("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Xr("invalid intrinsic syntax, expected opening `%`");var s=[];return th(e,vA,function(i,o,l,c){s[s.length]=l?th(c,wA,"$1"):o||i;}),s},bA=function(e,r){var n=e,s;if(zi(eh,n)&&(s=eh[n],n="%"+s[0]+"%"),zi(xr,n)){var i=xr[n];if(i===Yr&&(i=dA(n)),typeof i>"u"&&!r)throw new Jr("intrinsic "+e+" exists, but is not available. Please file an issue!");return {alias:s,name:n,value:i}}throw new Xr("intrinsic "+e+" does not exist!")};nh.exports=function(e,r){if(typeof e!="string"||e.length===0)throw new Jr("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Jr('"allowMissing" argument must be a boolean');if(mA(/^%?[^%]*%?$/,e)===null)throw new Xr("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=SA(e),s=n.length>0?n[0]:"",i=bA("%"+s+"%",r),o=i.name,l=i.value,c=!1,p=i.alias;p&&(s=p[0],yA(n,gA([0,1],p)));for(var u=1,g=!0;u<n.length;u+=1){var y=n[u],m=Gi(y,0,1),v=Gi(y,-1);if((m==='"'||m==="'"||m==="`"||v==='"'||v==="'"||v==="`")&&m!==v)throw new Xr("property names with quotes must have matching quotes");if((y==="constructor"||!g)&&(c=!0),s+="."+y,o="%"+s+"%",zi(xr,o))l=xr[o];else if(l!=null){if(!(y in l)){if(!r)throw new Jr("base intrinsic for "+e+" exists, but the property is not available.");return}if(_r&&u+1>=n.length){var b=_r(l,y);g=!!b,g&&"get"in b&&!("originalValue"in b.get)?l=b.get:l=l[y];}else g=zi(l,y),l=l[y];g&&!c&&(xr[o]=l);}}return l};});var Ki=R((Wq,ih)=>{var EA=kt(),ra=EA("%Object.defineProperty%",!0),na=function(){if(ra)try{return ra({},"a",{value:1}),!0}catch{return !1}return !1};na.hasArrayLengthDefineBug=function(){if(!na())return null;try{return ra([],"length",{value:1}).length!==1}catch{return !0}};ih.exports=na;});var ia=R((zq,sh)=>{var AA=kt(),Vi=AA("%Object.getOwnPropertyDescriptor%",!0);if(Vi)try{Vi([],"length");}catch{Vi=null;}sh.exports=Vi;});var oa=R((Gq,lh)=>{var _A=Ki()(),sa=kt(),oh=_A&&sa("%Object.defineProperty%",!0),xA=sa("%SyntaxError%"),Qr=sa("%TypeError%"),ah=ia();lh.exports=function(e,r,n){if(!e||typeof e!="object"&&typeof e!="function")throw new Qr("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new Qr("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Qr("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Qr("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Qr("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Qr("`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,l=arguments.length>6?arguments[6]:!1,c=!!ah&&ah(e,r);if(oh)oh(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(l||!s&&!i&&!o)e[r]=n;else throw new xA("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")};});var rr=R((Kq,hh)=>{var CA=Hi(),RA=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",OA=Object.prototype.toString,PA=Array.prototype.concat,uh=oa(),TA=function(t){return typeof t=="function"&&OA.call(t)==="[object Function]"},ch=Ki()(),$A=function(t,e,r,n){if(e in t){if(n===!0){if(t[e]===r)return}else if(!TA(n)||!n())return}ch?uh(t,e,r,!0):uh(t,e,r);},fh=function(t,e){var r=arguments.length>2?arguments[2]:{},n=CA(e);RA&&(n=PA.call(n,Object.getOwnPropertySymbols(e)));for(var s=0;s<n.length;s+=1)$A(t,n[s],e[n[s]],r[n[s]]);};fh.supportsDescriptors=!!ch;hh.exports=fh;});var Rr=R((Vq,Yi)=>{var aa=Wi(),Zr=kt(),gh=Zr("%Function.prototype.apply%"),yh=Zr("%Function.prototype.call%"),mh=Zr("%Reflect.apply%",!0)||aa.call(yh,gh),ph=Zr("%Object.getOwnPropertyDescriptor%",!0),Cr=Zr("%Object.defineProperty%",!0),IA=Zr("%Math.max%");if(Cr)try{Cr({},"a",{value:1});}catch{Cr=null;}Yi.exports=function(e){var r=mh(aa,yh,arguments);if(ph&&Cr){var n=ph(r,"length");n.configurable&&Cr(r,"length",{value:1+IA(0,e.length-(arguments.length-1))});}return r};var dh=function(){return mh(aa,gh,arguments)};Cr?Cr(Yi.exports,"apply",{value:dh}):Yi.exports.apply=dh;});var mt=R((Yq,Sh)=>{var vh=kt(),wh=Rr(),kA=wh(vh("String.prototype.indexOf"));Sh.exports=function(e,r){var n=vh(e,!!r);return typeof n=="function"&&kA(e,".prototype.")>-1?wh(n):n};});var la=R((Jq,xh)=>{var LA=Hi(),Ah=Ui()(),_h=mt(),bh=Object,FA=_h("Array.prototype.push"),Eh=_h("Object.prototype.propertyIsEnumerable"),qA=Ah?Object.getOwnPropertySymbols:null;xh.exports=function(e,r){if(e==null)throw new TypeError("target must be an object");var n=bh(e);if(arguments.length===1)return n;for(var s=1;s<arguments.length;++s){var i=bh(arguments[s]),o=LA(i),l=Ah&&(Object.getOwnPropertySymbols||qA);if(l)for(var c=l(i),p=0;p<c.length;++p){var u=c[p];Eh(i,u)&&FA(o,u);}for(var g=0;g<o.length;++g){var y=o[g];if(Eh(i,y)){var m=i[y];n[y]=m;}}}return n};});var ca=R((Xq,Ch)=>{var ua=la(),DA=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},NA=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};Ch.exports=function(){return !Object.assign||DA()||NA()?ua:Object.assign};});var Oh=R((Qq,Rh)=>{var MA=rr(),jA=ca();Rh.exports=function(){var e=jA();return MA(Object,{assign:e},{assign:function(){return Object.assign!==e}}),e};});var Ih=R((Zq,$h)=>{var BA=rr(),HA=Rr(),UA=la(),Ph=ca(),WA=Oh(),zA=HA.apply(Ph()),Th=function(e,r){return zA(Object,arguments)};BA(Th,{getPolyfill:Ph,implementation:UA,shim:WA});$h.exports=Th;});var Lh=R((eD,kh)=>{var Un=function(){return typeof function(){}.name=="string"},Hn=Object.getOwnPropertyDescriptor;Un.functionsHaveConfigurableNames=function(){if(!Un()||!Hn)return !1;var e=Hn(function(){},"name");return !!e&&!!e.configurable};var GA=Function.prototype.bind;Un.boundFunctionsHaveNames=function(){return Un()&&typeof GA=="function"&&function(){}.bind().name!==""};kh.exports=Un;});var Dh=R((tD,qh)=>{var Fh=oa(),KA=Ki()(),VA=Lh().functionsHaveConfigurableNames(),YA=TypeError;qh.exports=function(e,r){if(typeof e!="function")throw new YA("`fn` is not a function");var n=arguments.length>2&&!!arguments[2];return (!n||VA)&&(KA?Fh(e,"name",r,!0,!0):Fh(e,"name",r)),e};});var fa=R((rD,Nh)=>{var JA=Dh(),XA=Object,QA=TypeError;Nh.exports=JA(function(){if(this!=null&&this!==XA(this))throw new QA("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 ha=R((nD,Mh)=>{var ZA=fa(),e_=rr().supportsDescriptors,t_=Object.getOwnPropertyDescriptor;Mh.exports=function(){if(e_&&/a/mig.flags==="gim"){var e=t_(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 ZA};});var Hh=R((iD,Bh)=>{var r_=rr().supportsDescriptors,n_=ha(),i_=Object.getOwnPropertyDescriptor,s_=Object.defineProperty,o_=TypeError,jh=Object.getPrototypeOf,a_=/a/;Bh.exports=function(){if(!r_||!jh)throw new o_("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var e=n_(),r=jh(a_),n=i_(r,"flags");return (!n||n.get!==e)&&s_(r,"flags",{configurable:!0,enumerable:!1,get:e}),e};});var Gh=R((sD,zh)=>{var l_=rr(),u_=Rr(),c_=fa(),Uh=ha(),f_=Hh(),Wh=u_(Uh());l_(Wh,{getPolyfill:Uh,implementation:c_,shim:f_});zh.exports=Wh;});var Yh=R((oD,Vh)=>{var Kh=Symbol.iterator;Vh.exports=function(e){if(e!=null&&typeof e[Kh]<"u")return e[Kh]()};});var Xh=R((aD,Jh)=>{Jh.exports=z("util").inspect;});var mp=R((lD,yp)=>{var Ea=typeof Map=="function"&&Map.prototype,pa=Object.getOwnPropertyDescriptor&&Ea?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Xi=Ea&&pa&&typeof pa.get=="function"?pa.get:null,Qh=Ea&&Map.prototype.forEach,Aa=typeof Set=="function"&&Set.prototype,da=Object.getOwnPropertyDescriptor&&Aa?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Qi=Aa&&da&&typeof da.get=="function"?da.get:null,Zh=Aa&&Set.prototype.forEach,h_=typeof WeakMap=="function"&&WeakMap.prototype,zn=h_?WeakMap.prototype.has:null,p_=typeof WeakSet=="function"&&WeakSet.prototype,Gn=p_?WeakSet.prototype.has:null,d_=typeof WeakRef=="function"&&WeakRef.prototype,ep=d_?WeakRef.prototype.deref:null,g_=Boolean.prototype.valueOf,y_=Object.prototype.toString,m_=Function.prototype.toString,v_=String.prototype.match,_a=String.prototype.slice,ir=String.prototype.replace,w_=String.prototype.toUpperCase,tp=String.prototype.toLowerCase,cp=RegExp.prototype.test,rp=Array.prototype.concat,Lt=Array.prototype.join,S_=Array.prototype.slice,np=Math.floor,ma=typeof BigInt=="function"?BigInt.prototype.valueOf:null,ga=Object.getOwnPropertySymbols,va=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,en=typeof Symbol=="function"&&typeof Symbol.iterator=="object",We=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===en||"symbol")?Symbol.toStringTag:null,fp=Object.prototype.propertyIsEnumerable,ip=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function sp(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||cp.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-np(-t):np(t);if(n!==t){var s=String(n),i=_a.call(e,s.length+1);return ir.call(s,r,"$&_")+"."+ir.call(ir.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return ir.call(e,r,"$&_")}var wa=Xh(),op=wa.custom,ap=pp(op)?op:null;yp.exports=function t(e,r,n,s){var i=r||{};if(nr(i,"quoteStyle")&&i.quoteStyle!=="single"&&i.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(nr(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=nr(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(nr(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(nr(i,"numericSeparator")&&typeof i.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var l=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 gp(e,i);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var c=String(e);return l?sp(e,c):c}if(typeof e=="bigint"){var p=String(e)+"n";return l?sp(e,p):p}var u=typeof i.depth>"u"?5:i.depth;if(typeof n>"u"&&(n=0),n>=u&&u>0&&typeof e=="object")return Sa(e)?"[Array]":"[Object]";var g=N_(i,n);if(typeof s>"u")s=[];else if(dp(s,e)>=0)return "[Circular]";function y(Y,se,T){if(se&&(s=S_.call(s),s.push(se)),T){var $={depth:i.depth};return nr(i,"quoteStyle")&&($.quoteStyle=i.quoteStyle),t(Y,$,n+1,s)}return t(Y,i,n+1,s)}if(typeof e=="function"&&!lp(e)){var m=P_(e),v=Ji(e,y);return "[Function"+(m?": "+m:" (anonymous)")+"]"+(v.length>0?" { "+Lt.call(v,", ")+" }":"")}if(pp(e)){var b=en?ir.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):va.call(e);return typeof e=="object"&&!en?Wn(b):b}if(F_(e)){for(var _="<"+tp.call(String(e.nodeName)),x=e.attributes||[],A=0;A<x.length;A++)_+=" "+x[A].name+"="+hp(b_(x[A].value),"double",i);return _+=">",e.childNodes&&e.childNodes.length&&(_+="..."),_+="</"+tp.call(String(e.nodeName))+">",_}if(Sa(e)){if(e.length===0)return "[]";var O=Ji(e,y);return g&&!D_(O)?"["+ba(O,g)+"]":"[ "+Lt.call(O,", ")+" ]"}if(A_(e)){var I=Ji(e,y);return !("cause"in Error.prototype)&&"cause"in e&&!fp.call(e,"cause")?"{ ["+String(e)+"] "+Lt.call(rp.call("[cause]: "+y(e.cause),I),", ")+" }":I.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+Lt.call(I,", ")+" }"}if(typeof e=="object"&&o){if(ap&&typeof e[ap]=="function"&&wa)return wa(e,{depth:u-n});if(o!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(T_(e)){var F=[];return Qh&&Qh.call(e,function(Y,se){F.push(y(se,e,!0)+" => "+y(Y,e));}),up("Map",Xi.call(e),F,g)}if(k_(e)){var U=[];return Zh&&Zh.call(e,function(Y){U.push(y(Y,e));}),up("Set",Qi.call(e),U,g)}if($_(e))return ya("WeakMap");if(L_(e))return ya("WeakSet");if(I_(e))return ya("WeakRef");if(x_(e))return Wn(y(Number(e)));if(R_(e))return Wn(y(ma.call(e)));if(C_(e))return Wn(g_.call(e));if(__(e))return Wn(y(String(e)));if(!E_(e)&&!lp(e)){var H=Ji(e,y),q=ip?ip(e)===Object.prototype:e instanceof Object||e.constructor===Object,k=e instanceof Object?"":"null prototype",j=!q&&We&&Object(e)===e&&We in e?_a.call(sr(e),8,-1):k?"Object":"",C=q||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",V=C+(j||k?"["+Lt.call(rp.call([],j||[],k||[]),": ")+"] ":"");return H.length===0?V+"{}":g?V+"{"+ba(H,g)+"}":V+"{ "+Lt.call(H,", ")+" }"}return String(e)};function hp(t,e,r){var n=(r.quoteStyle||e)==="double"?'"':"'";return n+t+n}function b_(t){return ir.call(String(t),/"/g,"&quot;")}function Sa(t){return sr(t)==="[object Array]"&&(!We||!(typeof t=="object"&&We in t))}function E_(t){return sr(t)==="[object Date]"&&(!We||!(typeof t=="object"&&We in t))}function lp(t){return sr(t)==="[object RegExp]"&&(!We||!(typeof t=="object"&&We in t))}function A_(t){return sr(t)==="[object Error]"&&(!We||!(typeof t=="object"&&We in t))}function __(t){return sr(t)==="[object String]"&&(!We||!(typeof t=="object"&&We in t))}function x_(t){return sr(t)==="[object Number]"&&(!We||!(typeof t=="object"&&We in t))}function C_(t){return sr(t)==="[object Boolean]"&&(!We||!(typeof t=="object"&&We in t))}function pp(t){if(en)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return !0;if(!t||typeof t!="object"||!va)return !1;try{return va.call(t),!0}catch{}return !1}function R_(t){if(!t||typeof t!="object"||!ma)return !1;try{return ma.call(t),!0}catch{}return !1}var O_=Object.prototype.hasOwnProperty||function(t){return t in this};function nr(t,e){return O_.call(t,e)}function sr(t){return y_.call(t)}function P_(t){if(t.name)return t.name;var e=v_.call(m_.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function dp(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 T_(t){if(!Xi||!t||typeof t!="object")return !1;try{Xi.call(t);try{Qi.call(t);}catch{return !0}return t instanceof Map}catch{}return !1}function $_(t){if(!zn||!t||typeof t!="object")return !1;try{zn.call(t,zn);try{Gn.call(t,Gn);}catch{return !0}return t instanceof WeakMap}catch{}return !1}function I_(t){if(!ep||!t||typeof t!="object")return !1;try{return ep.call(t),!0}catch{}return !1}function k_(t){if(!Qi||!t||typeof t!="object")return !1;try{Qi.call(t);try{Xi.call(t);}catch{return !0}return t instanceof Set}catch{}return !1}function L_(t){if(!Gn||!t||typeof t!="object")return !1;try{Gn.call(t,Gn);try{zn.call(t,zn);}catch{return !0}return t instanceof WeakSet}catch{}return !1}function F_(t){return !t||typeof t!="object"?!1:typeof HTMLElement<"u"&&t instanceof HTMLElement?!0:typeof t.nodeName=="string"&&typeof t.getAttribute=="function"}function gp(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return gp(_a.call(t,0,e.maxStringLength),e)+n}var s=ir.call(ir.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,q_);return hp(s,"single",e)}function q_(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":"")+w_.call(e.toString(16))}function Wn(t){return "Object("+t+")"}function ya(t){return t+" { ? }"}function up(t,e,r,n){var s=n?ba(r,n):Lt.call(r,", ");return t+" ("+e+") {"+s+"}"}function D_(t){for(var e=0;e<t.length;e++)if(dp(t[e],`
`)>=0)return !1;return !0}function N_(t,e){var r;if(t.indent===" ")r=" ";else if(typeof t.indent=="number"&&t.indent>0)r=Lt.call(Array(t.indent+1)," ");else return null;return {base:r,prev:Lt.call(Array(e+1),r)}}function ba(t,e){if(t.length===0)return "";var r=`
`+e.prev+e.base;return r+Lt.call(t,","+r)+`
`+e.prev}function Ji(t,e){var r=Sa(t),n=[];if(r){n.length=t.length;for(var s=0;s<t.length;s++)n[s]=nr(t,s)?e(t[s],t):"";}var i=typeof ga=="function"?ga(t):[],o;if(en){o={};for(var l=0;l<i.length;l++)o["$"+i[l]]=i[l];}for(var c in t)nr(t,c)&&(r&&String(Number(c))===c&&c<t.length||en&&o["$"+c]instanceof Symbol||(cp.call(/[^\w$]/,c)?n.push(e(c,t)+": "+e(t[c],t)):n.push(c+": "+e(t[c],t))));if(typeof ga=="function")for(var p=0;p<i.length;p++)fp.call(t,i[p])&&n.push("["+e(i[p])+"]: "+e(t[i[p]],t));return n}});var wp=R((uD,vp)=>{var xa=kt(),tn=mt(),M_=mp(),j_=xa("%TypeError%"),Zi=xa("%WeakMap%",!0),es=xa("%Map%",!0),B_=tn("WeakMap.prototype.get",!0),H_=tn("WeakMap.prototype.set",!0),U_=tn("WeakMap.prototype.has",!0),W_=tn("Map.prototype.get",!0),z_=tn("Map.prototype.set",!0),G_=tn("Map.prototype.has",!0),Ca=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},K_=function(t,e){var r=Ca(t,e);return r&&r.value},V_=function(t,e,r){var n=Ca(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r};},Y_=function(t,e){return !!Ca(t,e)};vp.exports=function(){var e,r,n,s={assert:function(i){if(!s.has(i))throw new j_("Side channel does not contain "+M_(i))},get:function(i){if(Zi&&i&&(typeof i=="object"||typeof i=="function")){if(e)return B_(e,i)}else if(es){if(r)return W_(r,i)}else if(n)return K_(n,i)},has:function(i){if(Zi&&i&&(typeof i=="object"||typeof i=="function")){if(e)return U_(e,i)}else if(es){if(r)return G_(r,i)}else if(n)return Y_(n,i);return !1},set:function(i,o){Zi&&i&&(typeof i=="object"||typeof i=="function")?(e||(e=new Zi),H_(e,i,o)):es?(r||(r=new es),z_(r,i,o)):(n||(n={key:{},next:null}),V_(n,i,o));}};return s};});var Ra=R((cD,bp)=>{var Sp=function(t){return t!==t};bp.exports=function(e,r){return e===0&&r===0?1/e===1/r:!!(e===r||Sp(e)&&Sp(r))};});var Oa=R((fD,Ep)=>{var J_=Ra();Ep.exports=function(){return typeof Object.is=="function"?Object.is:J_};});var _p=R((hD,Ap)=>{var X_=Oa(),Q_=rr();Ap.exports=function(){var e=X_();return Q_(Object,{is:e},{is:function(){return Object.is!==e}}),e};});var Op=R((pD,Rp)=>{var Z_=rr(),ex=Rr(),tx=Ra(),xp=Oa(),rx=_p(),Cp=ex(xp(),Object);Z_(Cp,{getPolyfill:xp,implementation:tx,shim:rx});Rp.exports=Cp;});var or=R((dD,Pp)=>{var nx=Ui();Pp.exports=function(){return nx()&&!!Symbol.toStringTag};});var Ip=R((gD,$p)=>{var ix=or()(),sx=mt(),Pa=sx("Object.prototype.toString"),ts=function(e){return ix&&e&&typeof e=="object"&&Symbol.toStringTag in e?!1:Pa(e)==="[object Arguments]"},Tp=function(e){return ts(e)?!0:e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&Pa(e)!=="[object Array]"&&Pa(e.callee)==="[object Function]"},ox=function(){return ts(arguments)}();ts.isLegacyArguments=Tp;$p.exports=ox?ts:Tp;});var Lp=R((yD,kp)=>{var ax={}.toString;kp.exports=Array.isArray||function(t){return ax.call(t)=="[object Array]"};});var Np=R((mD,Dp)=>{var qp=Function.prototype.toString,rn=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,$a,rs;if(typeof rn=="function"&&typeof Object.defineProperty=="function")try{$a=Object.defineProperty({},"length",{get:function(){throw rs}}),rs={},rn(function(){throw 42},null,$a);}catch(t){t!==rs&&(rn=null);}else rn=null;var lx=/^\s*class\b/,Ia=function(e){try{var r=qp.call(e);return lx.test(r)}catch{return !1}},Ta=function(e){try{return Ia(e)?!1:(qp.call(e),!0)}catch{return !1}},ns=Object.prototype.toString,ux="[object Object]",cx="[object Function]",fx="[object GeneratorFunction]",hx="[object HTMLAllCollection]",px="[object HTML document.all class]",dx="[object HTMLCollection]",gx=typeof Symbol=="function"&&!!Symbol.toStringTag,yx=!(0 in[,]),ka=function(){return !1};typeof document=="object"&&(Fp=document.all,ns.call(Fp)===ns.call(document.all)&&(ka=function(e){if((yx||!e)&&(typeof e>"u"||typeof e=="object"))try{var r=ns.call(e);return (r===hx||r===px||r===dx||r===ux)&&e("")==null}catch{}return !1}));var Fp;Dp.exports=rn?function(e){if(ka(e))return !0;if(!e||typeof e!="function"&&typeof e!="object")return !1;try{rn(e,null,$a);}catch(r){if(r!==rs)return !1}return !Ia(e)&&Ta(e)}:function(e){if(ka(e))return !0;if(!e||typeof e!="function"&&typeof e!="object")return !1;if(gx)return Ta(e);if(Ia(e))return !1;var r=ns.call(e);return r!==cx&&r!==fx&&!/^\[object HTML/.test(r)?!1:Ta(e)};});var Bp=R((vD,jp)=>{var mx=Np(),vx=Object.prototype.toString,Mp=Object.prototype.hasOwnProperty,wx=function(e,r,n){for(var s=0,i=e.length;s<i;s++)Mp.call(e,s)&&(n==null?r(e[s],s,e):r.call(n,e[s],s,e));},Sx=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);},bx=function(e,r,n){for(var s in e)Mp.call(e,s)&&(n==null?r(e[s],s,e):r.call(n,e[s],s,e));},Ex=function(e,r,n){if(!mx(r))throw new TypeError("iterator must be a function");var s;arguments.length>=3&&(s=n),vx.call(e)==="[object Array]"?wx(e,r,s):typeof e=="string"?Sx(e,r,s):bx(e,r,s);};jp.exports=Ex;});var Up=R((wD,Hp)=>{var La=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],Ax=typeof globalThis>"u"?global:globalThis;Hp.exports=function(){for(var e=[],r=0;r<La.length;r++)typeof Ax[La[r]]=="function"&&(e[e.length]=La[r]);return e};});var Ma=R((SD,Kp)=>{var ss=Bp(),_x=Up(),Wp=Rr(),Da=mt(),is=ia(),xx=Da("Object.prototype.toString"),Gp=or()(),zp=typeof globalThis>"u"?global:globalThis,qa=_x(),Na=Da("String.prototype.slice"),Fa=Object.getPrototypeOf,Cx=Da("Array.prototype.indexOf",!0)||function(e,r){for(var n=0;n<e.length;n+=1)if(e[n]===r)return n;return -1},os={__proto__:null};Gp&&is&&Fa?ss(qa,function(t){var e=new zp[t];if(Symbol.toStringTag in e){var r=Fa(e),n=is(r,Symbol.toStringTag);if(!n){var s=Fa(r);n=is(s,Symbol.toStringTag);}os["$"+t]=Wp(n.get);}}):ss(qa,function(t){var e=new zp[t];os["$"+t]=Wp(e.slice);});var Rx=function(e){var r=!1;return ss(os,function(n,s){if(!r)try{"$"+n(e)===s&&(r=Na(s,1));}catch{}}),r},Ox=function(e){var r=!1;return ss(os,function(n,s){if(!r)try{n(e),r=Na(s,1);}catch{}}),r};Kp.exports=function(e){if(!e||typeof e!="object")return !1;if(!Gp){var r=Na(xx(e),8,-1);return Cx(qa,r)>-1?r:r!=="Object"?!1:Ox(e)}return is?Rx(e):null};});var Yp=R((bD,Vp)=>{var Px=Ma();Vp.exports=function(e){return !!Px(e)};});var ja=R((ED,td)=>{var Tx=Rr(),$x=mt(),ed=kt(),Ix=Yp(),Jp=ed("ArrayBuffer",!0),Xp=ed("Float32Array",!0),as=$x("ArrayBuffer.prototype.byteLength",!0),Qp=Jp&&!as&&new Jp().slice,Zp=Qp&&Tx(Qp);td.exports=as||Zp?function(e){if(!e||typeof e!="object")return !1;try{return as?as(e):Zp(e,0),!0}catch{return !1}}:Xp?function(e){try{return new Xp(e).buffer===e&&!Ix(e)}catch(r){return typeof e=="object"&&r.name==="RangeError"}}:function(e){return !1};});var nd=R((AD,rd)=>{var kx=Date.prototype.getDay,Lx=function(e){try{return kx.call(e),!0}catch{return !1}},Fx=Object.prototype.toString,qx="[object Date]",Dx=or()();rd.exports=function(e){return typeof e!="object"||e===null?!1:Dx?Lx(e):Fx.call(e)===qx};});var ld=R((_D,ad)=>{var Ba=mt(),id=or()(),sd,od,Ha,Ua;id&&(sd=Ba("Object.prototype.hasOwnProperty"),od=Ba("RegExp.prototype.exec"),Ha={},ls=function(){throw Ha},Ua={toString:ls,valueOf:ls},typeof Symbol.toPrimitive=="symbol"&&(Ua[Symbol.toPrimitive]=ls));var ls,Nx=Ba("Object.prototype.toString"),Mx=Object.getOwnPropertyDescriptor,jx="[object RegExp]";ad.exports=id?function(e){if(!e||typeof e!="object")return !1;var r=Mx(e,"lastIndex"),n=r&&sd(r,"value");if(!n)return !1;try{od(e,Ua);}catch(s){return s===Ha}}:function(e){return !e||typeof e!="object"&&typeof e!="function"?!1:Nx(e)===jx};});var fd=R((xD,cd)=>{var Bx=mt(),ud=Bx("SharedArrayBuffer.prototype.byteLength",!0);cd.exports=ud?function(e){if(!e||typeof e!="object")return !1;try{return ud(e),!0}catch{return !1}}:function(e){return !1};});var pd=R((CD,hd)=>{var Hx=String.prototype.valueOf,Ux=function(e){try{return Hx.call(e),!0}catch{return !1}},Wx=Object.prototype.toString,zx="[object String]",Gx=or()();hd.exports=function(e){return typeof e=="string"?!0:typeof e!="object"?!1:Gx?Ux(e):Wx.call(e)===zx};});var gd=R((RD,dd)=>{var Kx=Number.prototype.toString,Vx=function(e){try{return Kx.call(e),!0}catch{return !1}},Yx=Object.prototype.toString,Jx="[object Number]",Xx=or()();dd.exports=function(e){return typeof e=="number"?!0:typeof e!="object"?!1:Xx?Vx(e):Yx.call(e)===Jx};});var vd=R((OD,md)=>{var yd=mt(),Qx=yd("Boolean.prototype.toString"),Zx=yd("Object.prototype.toString"),eC=function(e){try{return Qx(e),!0}catch{return !1}},tC="[object Boolean]",rC=or()();md.exports=function(e){return typeof e=="boolean"?!0:e===null||typeof e!="object"?!1:rC&&Symbol.toStringTag in e?eC(e):Zx(e)===tC};});var Ed=R((PD,Wa)=>{var nC=Object.prototype.toString,iC=Qo()();iC?(wd=Symbol.prototype.toString,Sd=/^Symbol\(.*\)$/,bd=function(e){return typeof e.valueOf()!="symbol"?!1:Sd.test(wd.call(e))},Wa.exports=function(e){if(typeof e=="symbol")return !0;if(nC.call(e)!=="[object Symbol]")return !1;try{return bd(e)}catch{return !1}}):Wa.exports=function(e){return !1};var wd,Sd,bd;});var xd=R((TD,_d)=>{var Ad=typeof BigInt<"u"&&BigInt;_d.exports=function(){return typeof Ad=="function"&&typeof BigInt=="function"&&typeof Ad(42)=="bigint"&&typeof BigInt(42)=="bigint"};});var Od=R(($D,za)=>{var sC=xd()();sC?(Cd=BigInt.prototype.valueOf,Rd=function(e){try{return Cd.call(e),!0}catch{}return !1},za.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:Rd(e)}):za.exports=function(e){return !1};var Cd,Rd;});var Td=R((ID,Pd)=>{var oC=pd(),aC=gd(),lC=vd(),uC=Ed(),cC=Od();Pd.exports=function(e){if(e==null||typeof e!="object"&&typeof e!="function")return null;if(oC(e))return "String";if(aC(e))return "Number";if(lC(e))return "Boolean";if(uC(e))return "Symbol";if(cC(e))return "BigInt"};});var Ld=R((kD,kd)=>{var Ga=typeof Map=="function"&&Map.prototype?Map:null,fC=typeof Set=="function"&&Set.prototype?Set:null,us;Ga||(us=function(e){return !1});var Id=Ga?Map.prototype.has:null,$d=fC?Set.prototype.has:null;!us&&!Id&&(us=function(e){return !1});kd.exports=us||function(e){if(!e||typeof e!="object")return !1;try{if(Id.call(e),$d)try{$d.call(e);}catch{return !0}return e instanceof Ga}catch{}return !1};});var Nd=R((LD,Dd)=>{var hC=typeof Map=="function"&&Map.prototype?Map:null,Ka=typeof Set=="function"&&Set.prototype?Set:null,cs;Ka||(cs=function(e){return !1});var Fd=hC?Map.prototype.has:null,qd=Ka?Set.prototype.has:null;!cs&&!qd&&(cs=function(e){return !1});Dd.exports=cs||function(e){if(!e||typeof e!="object")return !1;try{if(qd.call(e),Fd)try{Fd.call(e);}catch{return !0}return e instanceof Ka}catch{}return !1};});var Bd=R((FD,jd)=>{var fs=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,Md=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,hs;fs||(hs=function(e){return !1});var Ya=fs?fs.prototype.has:null,Va=Md?Md.prototype.has:null;!hs&&!Ya&&(hs=function(e){return !1});jd.exports=hs||function(e){if(!e||typeof e!="object")return !1;try{if(Ya.call(e,Ya),Va)try{Va.call(e,Va);}catch{return !0}return e instanceof fs}catch{}return !1};});var Ud=R((qD,Xa)=>{var pC=kt(),Hd=mt(),dC=pC("%WeakSet%",!0),Ja=Hd("WeakSet.prototype.has",!0);Ja?(ps=Hd("WeakMap.prototype.has",!0),Xa.exports=function(e){if(!e||typeof e!="object")return !1;try{if(Ja(e,Ja),ps)try{ps(e,ps);}catch{return !0}return e instanceof dC}catch{}return !1}):Xa.exports=function(e){return !1};var ps;});var zd=R((DD,Wd)=>{var gC=Ld(),yC=Nd(),mC=Bd(),vC=Ud();Wd.exports=function(e){if(e&&typeof e=="object"){if(gC(e))return "Map";if(yC(e))return "Set";if(mC(e))return "WeakMap";if(vC(e))return "WeakSet"}return !1};});var Vd=R((ND,Kd)=>{var wC=mt(),Gd=wC("ArrayBuffer.prototype.byteLength",!0),SC=ja();Kd.exports=function(e){return SC(e)?Gd?Gd(e):e.byteLength:NaN};});var wg=R((MD,vg)=>{var gg=Ih(),Ft=mt(),Yd=Gh(),bC=kt(),nn=Yh(),EC=wp(),Jd=Op(),Xd=Ip(),Qd=Lp(),Zd=ja(),eg=nd(),tg=ld(),rg=fd(),ng=Hi(),ig=Td(),sg=zd(),og=Ma(),ag=Vd(),lg=Ft("SharedArrayBuffer.prototype.byteLength",!0),ug=Ft("Date.prototype.getTime"),Qa=Object.getPrototypeOf,cg=Ft("Object.prototype.toString"),gs=bC("%Set%",!0),Za=Ft("Map.prototype.has",!0),ys=Ft("Map.prototype.get",!0),fg=Ft("Map.prototype.size",!0),ms=Ft("Set.prototype.add",!0),yg=Ft("Set.prototype.delete",!0),vs=Ft("Set.prototype.has",!0),ds=Ft("Set.prototype.size",!0);function hg(t,e,r,n){for(var s=nn(t),i;(i=s.next())&&!i.done;)if(bt(e,i.value,r,n))return yg(t,i.value),!0;return !1}function mg(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 AC(t,e,r,n,s,i){var o=mg(r);if(o!=null)return o;var l=ys(e,o),c=gg({},s,{strict:!1});return typeof l>"u"&&!Za(e,o)||!bt(n,l,c,i)?!1:!Za(t,o)&&bt(n,l,c,i)}function _C(t,e,r){var n=mg(r);return n??(vs(e,n)&&!vs(t,n))}function pg(t,e,r,n,s,i){for(var o=nn(t),l,c;(l=o.next())&&!l.done;)if(c=l.value,bt(r,c,s,i)&&bt(n,ys(e,c),s,i))return yg(t,c),!0;return !1}function bt(t,e,r,n){var s=r||{};if(s.strict?Jd(t,e):t===e)return !0;var i=ig(t),o=ig(e);if(i!==o)return !1;if(!t||!e||typeof t!="object"&&typeof e!="object")return s.strict?Jd(t,e):t==e;var l=n.has(t),c=n.has(e),p;if(l&&c){if(n.get(t)===n.get(e))return !0}else p={};return l||n.set(t,p),c||n.set(e,p),RC(t,e,s,n)}function dg(t){return !t||typeof t!="object"||typeof t.length!="number"||typeof t.copy!="function"||typeof t.slice!="function"||t.length>0&&typeof t[0]!="number"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))}function xC(t,e,r,n){if(ds(t)!==ds(e))return !1;for(var s=nn(t),i=nn(e),o,l,c;(o=s.next())&&!o.done;)if(o.value&&typeof o.value=="object")c||(c=new gs),ms(c,o.value);else if(!vs(e,o.value)){if(r.strict||!_C(t,e,o.value))return !1;c||(c=new gs),ms(c,o.value);}if(c){for(;(l=i.next())&&!l.done;)if(l.value&&typeof l.value=="object"){if(!hg(c,l.value,r.strict,n))return !1}else if(!r.strict&&!vs(t,l.value)&&!hg(c,l.value,r.strict,n))return !1;return ds(c)===0}return !0}function CC(t,e,r,n){if(fg(t)!==fg(e))return !1;for(var s=nn(t),i=nn(e),o,l,c,p,u,g;(o=s.next())&&!o.done;)if(p=o.value[0],u=o.value[1],p&&typeof p=="object")c||(c=new gs),ms(c,p);else if(g=ys(e,p),typeof g>"u"&&!Za(e,p)||!bt(u,g,r,n)){if(r.strict||!AC(t,e,p,u,r,n))return !1;c||(c=new gs),ms(c,p);}if(c){for(;(l=i.next())&&!l.done;)if(p=l.value[0],g=l.value[1],p&&typeof p=="object"){if(!pg(c,t,p,g,r,n))return !1}else if(!r.strict&&(!t.has(p)||!bt(ys(t,p),g,r,n))&&!pg(c,t,p,g,gg({},r,{strict:!1}),n))return !1;return ds(c)===0}return !0}function RC(t,e,r,n){var s,i;if(typeof t!=typeof e||t==null||e==null||cg(t)!==cg(e)||Xd(t)!==Xd(e))return !1;var o=Qd(t),l=Qd(e);if(o!==l)return !1;var c=t instanceof Error,p=e instanceof Error;if(c!==p||(c||p)&&(t.name!==e.name||t.message!==e.message))return !1;var u=tg(t),g=tg(e);if(u!==g||(u||g)&&(t.source!==e.source||Yd(t)!==Yd(e)))return !1;var y=eg(t),m=eg(e);if(y!==m||(y||m)&&ug(t)!==ug(e)||r.strict&&Qa&&Qa(t)!==Qa(e))return !1;var v=og(t),b=og(e);if(v!==b)return !1;if(v||b){if(t.length!==e.length)return !1;for(s=0;s<t.length;s++)if(t[s]!==e[s])return !1;return !0}var _=dg(t),x=dg(e);if(_!==x)return !1;if(_||x){if(t.length!==e.length)return !1;for(s=0;s<t.length;s++)if(t[s]!==e[s])return !1;return !0}var A=Zd(t),O=Zd(e);if(A!==O)return !1;if(A||O)return ag(t)!==ag(e)?!1:typeof Uint8Array=="function"&&bt(new Uint8Array(t),new Uint8Array(e),r,n);var I=rg(t),F=rg(e);if(I!==F)return !1;if(I||F)return lg(t)!==lg(e)?!1:typeof Uint8Array=="function"&&bt(new Uint8Array(t),new Uint8Array(e),r,n);if(typeof t!=typeof e)return !1;var U=ng(t),H=ng(e);if(U.length!==H.length)return !1;for(U.sort(),H.sort(),s=U.length-1;s>=0;s--)if(U[s]!=H[s])return !1;for(s=U.length-1;s>=0;s--)if(i=U[s],!bt(t[i],e[i],r,n))return !1;var q=sg(t),k=sg(e);return q!==k?!1:q==="Set"||k==="Set"?xC(t,e,r,n):q==="Map"?CC(t,e,r,n):!0}vg.exports=function(e,r,n){return bt(e,r,n,EC())};});var $g={};Wo($g,{closest:()=>XC,distance:()=>Tg});var Wt,YC,JC,Tg,XC,Ig=qi(()=>{Wt=new Uint32Array(65536),YC=(t,e)=>{let r=t.length,n=e.length,s=1<<r-1,i=-1,o=0,l=r,c=r;for(;c--;)Wt[t.charCodeAt(c)]|=1<<c;for(c=0;c<n;c++){let p=Wt[e.charCodeAt(c)],u=p|o;p|=(p&i)+i^i,o|=~(p|i),i&=p,o&s&&l++,i&s&&l--,o=o<<1|1,i=i<<1|~(u|o),o&=u;}for(c=r;c--;)Wt[t.charCodeAt(c)]=0;return l},JC=(t,e)=>{let r=e.length,n=t.length,s=[],i=[],o=Math.ceil(r/32),l=Math.ceil(n/32);for(let v=0;v<o;v++)i[v]=-1,s[v]=0;let c=0;for(;c<l-1;c++){let v=0,b=-1,_=c*32,x=Math.min(32,n)+_;for(let A=_;A<x;A++)Wt[t.charCodeAt(A)]|=1<<A;for(let A=0;A<r;A++){let O=Wt[e.charCodeAt(A)],I=i[A/32|0]>>>A&1,F=s[A/32|0]>>>A&1,U=O|v,H=((O|F)&b)+b^b|O|F,q=v|~(H|b),k=b&H;q>>>31^I&&(i[A/32|0]^=1<<A),k>>>31^F&&(s[A/32|0]^=1<<A),q=q<<1|I,k=k<<1|F,b=k|~(U|q),v=q&U;}for(let A=_;A<x;A++)Wt[t.charCodeAt(A)]=0;}let p=0,u=-1,g=c*32,y=Math.min(32,n-g)+g;for(let v=g;v<y;v++)Wt[t.charCodeAt(v)]|=1<<v;let m=n;for(let v=0;v<r;v++){let b=Wt[e.charCodeAt(v)],_=i[v/32|0]>>>v&1,x=s[v/32|0]>>>v&1,A=b|p,O=((b|x)&u)+u^u|b|x,I=p|~(O|u),F=u&O;m+=I>>>n-1&1,m-=F>>>n-1&1,I>>>31^_&&(i[v/32|0]^=1<<v),F>>>31^x&&(s[v/32|0]^=1<<v),I=I<<1|_,F=F<<1|x,u=F|~(A|I),p=I&A;}for(let v=g;v<y;v++)Wt[t.charCodeAt(v)]=0;return m},Tg=(t,e)=>{if(t.length<e.length){let r=e;e=t,t=r;}return e.length===0?t.length:t.length<=32?YC(t,e):JC(t,e)},XC=(t,e)=>{let r=1/0,n=0;for(let s=0;s<e.length;s++){let i=Tg(t,e[s]);i<r&&(r=i,n=s);}return e[n]};});var kg=R((il,Vn)=>{(function(){var t;try{t=typeof Intl<"u"&&typeof Intl.Collator<"u"?Intl.Collator("generic",{sensitivity:"base"}):null;}catch{console.log("Collator could not be initialized and wouldn't be used");}var e=(Ig(),zo($g)),r=[],n=[],s={get:function(i,o,l){var c=l&&t&&l.useCollator;if(c){var p=i.length,u=o.length;if(p===0)return u;if(u===0)return p;var g,y,m,v,b;for(m=0;m<u;++m)r[m]=m,n[m]=o.charCodeAt(m);r[u]=u;var _;for(m=0;m<p;++m){for(y=m+1,v=0;v<u;++v)g=y,_=t.compare(i.charAt(m),String.fromCharCode(n[v]))===0,y=r[v]+(_?0:1),b=g+1,y>b&&(y=b),b=r[v+1]+1,y>b&&(y=b),r[v]=g;r[v]=y;}return y}return e.distance(i,o)}};typeof define<"u"&&define!==null&&define.amd?define(function(){return s}):typeof Vn<"u"&&Vn!==null&&typeof il<"u"&&Vn.exports===il?Vn.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 Jn=qi(()=>{});var Xe=R(ol=>{ol.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})};ol.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 jg=R((VD,Mg)=>{var lr=z("constants"),eR=process.cwd,_s=null,tR=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return _s||(_s=eR.call(process)),_s};try{process.cwd();}catch{}typeof process.chdir=="function"&&(al=process.chdir,process.chdir=function(t){_s=null,al.call(process,t);},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,al));var al;Mg.exports=rR;function rR(t){lr.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=l(t.stat),t.fstat=l(t.fstat),t.lstat=l(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,g,y){y&&process.nextTick(y);},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(u,g,y,m){m&&process.nextTick(m);},t.lchownSync=function(){}),tR==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:function(u){function g(y,m,v){var b=Date.now(),_=0;u(y,m,function x(A){if(A&&(A.code==="EACCES"||A.code==="EPERM"||A.code==="EBUSY")&&Date.now()-b<6e4){setTimeout(function(){t.stat(m,function(O,I){O&&O.code==="ENOENT"?u(y,m,x):v(A);});},_),_<100&&(_+=10);return}v&&v(A);});}return Object.setPrototypeOf&&Object.setPrototypeOf(g,u),g}(t.rename)),t.read=typeof t.read!="function"?t.read:function(u){function g(y,m,v,b,_,x){var A;if(x&&typeof x=="function"){var O=0;A=function(I,F,U){if(I&&I.code==="EAGAIN"&&O<10)return O++,u.call(t,y,m,v,b,_,A);x.apply(this,arguments);};}return u.call(t,y,m,v,b,_,A)}return Object.setPrototypeOf&&Object.setPrototypeOf(g,u),g}(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:function(u){return function(g,y,m,v,b){for(var _=0;;)try{return u.call(t,g,y,m,v,b)}catch(x){if(x.code==="EAGAIN"&&_<10){_++;continue}throw x}}}(t.readSync);function e(u){u.lchmod=function(g,y,m){u.open(g,lr.O_WRONLY|lr.O_SYMLINK,y,function(v,b){if(v){m&&m(v);return}u.fchmod(b,y,function(_){u.close(b,function(x){m&&m(_||x);});});});},u.lchmodSync=function(g,y){var m=u.openSync(g,lr.O_WRONLY|lr.O_SYMLINK,y),v=!0,b;try{b=u.fchmodSync(m,y),v=!1;}finally{if(v)try{u.closeSync(m);}catch{}else u.closeSync(m);}return b};}function r(u){lr.hasOwnProperty("O_SYMLINK")&&u.futimes?(u.lutimes=function(g,y,m,v){u.open(g,lr.O_SYMLINK,function(b,_){if(b){v&&v(b);return}u.futimes(_,y,m,function(x){u.close(_,function(A){v&&v(x||A);});});});},u.lutimesSync=function(g,y,m){var v=u.openSync(g,lr.O_SYMLINK),b,_=!0;try{b=u.futimesSync(v,y,m),_=!1;}finally{if(_)try{u.closeSync(v);}catch{}else u.closeSync(v);}return b}):u.futimes&&(u.lutimes=function(g,y,m,v){v&&process.nextTick(v);},u.lutimesSync=function(){});}function n(u){return u&&function(g,y,m){return u.call(t,g,y,function(v){p(v)&&(v=null),m&&m.apply(this,arguments);})}}function s(u){return u&&function(g,y){try{return u.call(t,g,y)}catch(m){if(!p(m))throw m}}}function i(u){return u&&function(g,y,m,v){return u.call(t,g,y,m,function(b){p(b)&&(b=null),v&&v.apply(this,arguments);})}}function o(u){return u&&function(g,y,m){try{return u.call(t,g,y,m)}catch(v){if(!p(v))throw v}}}function l(u){return u&&function(g,y,m){typeof y=="function"&&(m=y,y=null);function v(b,_){_&&(_.uid<0&&(_.uid+=4294967296),_.gid<0&&(_.gid+=4294967296)),m&&m.apply(this,arguments);}return y?u.call(t,g,y,v):u.call(t,g,v)}}function c(u){return u&&function(g,y){var m=y?u.call(t,g,y):u.call(t,g);return m&&(m.uid<0&&(m.uid+=4294967296),m.gid<0&&(m.gid+=4294967296)),m}}function p(u){if(!u||u.code==="ENOSYS")return !0;var g=!process.getuid||process.getuid()!==0;return !!(g&&(u.code==="EINVAL"||u.code==="EPERM"))}}});var Ug=R((YD,Hg)=>{var Bg=z("stream").Stream;Hg.exports=nR;function nR(t){return {ReadStream:e,WriteStream:r};function e(n,s){if(!(this instanceof e))return new e(n,s);Bg.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),l=0,c=o.length;l<c;l++){var p=o[l];this[p]=s[p];}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start;}if(this.fd!==null){process.nextTick(function(){i._read();});return}t.open(this.path,this.flags,this.mode,function(u,g){if(u){i.emit("error",u),i.readable=!1;return}i.fd=g,i.emit("open",g),i._read();});}function r(n,s){if(!(this instanceof r))return new r(n,s);Bg.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,l=i.length;o<l;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 zg=R((JD,Wg)=>{Wg.exports=sR;var iR=Object.getPrototypeOf||function(t){return t.__proto__};function sR(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:iR(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));}),e}});var Qe=R((XD,cl)=>{var Ae=z("fs"),oR=jg(),aR=Ug(),lR=zg(),xs=z("util"),He,Rs;typeof Symbol=="function"&&typeof Symbol.for=="function"?(He=Symbol.for("graceful-fs.queue"),Rs=Symbol.for("graceful-fs.previous")):(He="___graceful-fs.queue",Rs="___graceful-fs.previous");function uR(){}function Vg(t,e){Object.defineProperty(t,He,{get:function(){return e}});}var Pr=uR;xs.debuglog?Pr=xs.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Pr=function(){var t=xs.format.apply(xs,arguments);t="GFS4: "+t.split(/\n/).join(`
GFS4: `),console.error(t);});Ae[He]||(Gg=global[He]||[],Vg(Ae,Gg),Ae.close=function(t){function e(r,n){return t.call(Ae,r,function(s){s||Kg(),typeof n=="function"&&n.apply(this,arguments);})}return Object.defineProperty(e,Rs,{value:t}),e}(Ae.close),Ae.closeSync=function(t){function e(r){t.apply(Ae,arguments),Kg();}return Object.defineProperty(e,Rs,{value:t}),e}(Ae.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Pr(Ae[He]),z("assert").equal(Ae[He].length,0);}));var Gg;global[He]||Vg(global,Ae[He]);cl.exports=ll(lR(Ae));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Ae.__patched&&(cl.exports=ll(Ae),Ae.__patched=!0);function ll(t){oR(t),t.gracefulify=ll,t.createReadStream=F,t.createWriteStream=U;var e=t.readFile;t.readFile=r;function r(k,j,C){return typeof j=="function"&&(C=j,j=null),V(k,j,C);function V(Y,se,T,$){return e(Y,se,function(te){te&&(te.code==="EMFILE"||te.code==="ENFILE")?ln([V,[Y,se,T],te,$||Date.now(),Date.now()]):typeof T=="function"&&T.apply(this,arguments);})}}var n=t.writeFile;t.writeFile=s;function s(k,j,C,V){return typeof C=="function"&&(V=C,C=null),Y(k,j,C,V);function Y(se,T,$,te,Q){return n(se,T,$,function(ue){ue&&(ue.code==="EMFILE"||ue.code==="ENFILE")?ln([Y,[se,T,$,te],ue,Q||Date.now(),Date.now()]):typeof te=="function"&&te.apply(this,arguments);})}}var i=t.appendFile;i&&(t.appendFile=o);function o(k,j,C,V){return typeof C=="function"&&(V=C,C=null),Y(k,j,C,V);function Y(se,T,$,te,Q){return i(se,T,$,function(ue){ue&&(ue.code==="EMFILE"||ue.code==="ENFILE")?ln([Y,[se,T,$,te],ue,Q||Date.now(),Date.now()]):typeof te=="function"&&te.apply(this,arguments);})}}var l=t.copyFile;l&&(t.copyFile=c);function c(k,j,C,V){return typeof C=="function"&&(V=C,C=0),Y(k,j,C,V);function Y(se,T,$,te,Q){return l(se,T,$,function(ue){ue&&(ue.code==="EMFILE"||ue.code==="ENFILE")?ln([Y,[se,T,$,te],ue,Q||Date.now(),Date.now()]):typeof te=="function"&&te.apply(this,arguments);})}}var p=t.readdir;t.readdir=g;var u=/^v[0-5]\./;function g(k,j,C){typeof j=="function"&&(C=j,j=null);var V=u.test(process.version)?function(T,$,te,Q){return p(T,Y(T,$,te,Q))}:function(T,$,te,Q){return p(T,$,Y(T,$,te,Q))};return V(k,j,C);function Y(se,T,$,te){return function(Q,ue){Q&&(Q.code==="EMFILE"||Q.code==="ENFILE")?ln([V,[se,T,$],Q,te||Date.now(),Date.now()]):(ue&&ue.sort&&ue.sort(),typeof $=="function"&&$.call(this,Q,ue));}}}if(process.version.substr(0,4)==="v0.8"){var y=aR(t);x=y.ReadStream,O=y.WriteStream;}var m=t.ReadStream;m&&(x.prototype=Object.create(m.prototype),x.prototype.open=A);var v=t.WriteStream;v&&(O.prototype=Object.create(v.prototype),O.prototype.open=I),Object.defineProperty(t,"ReadStream",{get:function(){return x},set:function(k){x=k;},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return O},set:function(k){O=k;},enumerable:!0,configurable:!0});var b=x;Object.defineProperty(t,"FileReadStream",{get:function(){return b},set:function(k){b=k;},enumerable:!0,configurable:!0});var _=O;Object.defineProperty(t,"FileWriteStream",{get:function(){return _},set:function(k){_=k;},enumerable:!0,configurable:!0});function x(k,j){return this instanceof x?(m.apply(this,arguments),this):x.apply(Object.create(x.prototype),arguments)}function A(){var k=this;q(k.path,k.flags,k.mode,function(j,C){j?(k.autoClose&&k.destroy(),k.emit("error",j)):(k.fd=C,k.emit("open",C),k.read());});}function O(k,j){return this instanceof O?(v.apply(this,arguments),this):O.apply(Object.create(O.prototype),arguments)}function I(){var k=this;q(k.path,k.flags,k.mode,function(j,C){j?(k.destroy(),k.emit("error",j)):(k.fd=C,k.emit("open",C));});}function F(k,j){return new t.ReadStream(k,j)}function U(k,j){return new t.WriteStream(k,j)}var H=t.open;t.open=q;function q(k,j,C,V){return typeof C=="function"&&(V=C,C=null),Y(k,j,C,V);function Y(se,T,$,te,Q){return H(se,T,$,function(ue,Ge){ue&&(ue.code==="EMFILE"||ue.code==="ENFILE")?ln([Y,[se,T,$,te],ue,Q||Date.now(),Date.now()]):typeof te=="function"&&te.apply(this,arguments);})}}return t}function ln(t){Pr("ENQUEUE",t[0].name,t[1]),Ae[He].push(t),ul();}var Cs;function Kg(){for(var t=Date.now(),e=0;e<Ae[He].length;++e)Ae[He][e].length>2&&(Ae[He][e][3]=t,Ae[He][e][4]=t);ul();}function ul(){if(clearTimeout(Cs),Cs=void 0,Ae[He].length!==0){var t=Ae[He].shift(),e=t[0],r=t[1],n=t[2],s=t[3],i=t[4];if(s===void 0)Pr("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-s>=6e4){Pr("TIMEOUT",e.name,r);var o=r.pop();typeof o=="function"&&o.call(null,n);}else {var l=Date.now()-i,c=Math.max(i-s,1),p=Math.min(c*1.2,100);l>=p?(Pr("RETRY",e.name,r),e.apply(null,r.concat([s]))):Ae[He].push(t);}Cs===void 0&&(Cs=setTimeout(ul,0));}}});var Tr=R(zt=>{var Yg=Xe().fromCallback,Ke=Qe(),cR=["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(zt,Ke);cR.forEach(t=>{zt[t]=Yg(Ke[t]);});zt.exists=function(t,e){return typeof e=="function"?Ke.exists(t,e):new Promise(r=>Ke.exists(t,r))};zt.read=function(t,e,r,n,s,i){return typeof i=="function"?Ke.read(t,e,r,n,s,i):new Promise((o,l)=>{Ke.read(t,e,r,n,s,(c,p,u)=>{if(c)return l(c);o({bytesRead:p,buffer:u});});})};zt.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,l)=>{if(i)return s(i);n({bytesWritten:o,buffer:l});});})};zt.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,l)=>{if(i)return s(i);n({bytesRead:o,buffers:l});});})};zt.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,l)=>{if(i)return s(i);n({bytesWritten:o,buffers:l});});})};typeof Ke.realpath.native=="function"?zt.realpath.native=Yg(Ke.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003");});var Xg=R((ZD,Jg)=>{var fR=z("path");Jg.exports.checkPath=function(e){if(process.platform==="win32"&&/[<>:"|?*]/.test(e.replace(fR.parse(e).root,""))){let n=new Error(`Path contains invalid characters: ${e}`);throw n.code="EINVAL",n}};});var ty=R((eN,fl)=>{var Qg=Tr(),{checkPath:Zg}=Xg(),ey=t=>{let e={mode:511};return typeof t=="number"?t:{...e,...t}.mode};fl.exports.makeDir=async(t,e)=>(Zg(t),Qg.mkdir(t,{mode:ey(e),recursive:!0}));fl.exports.makeDirSync=(t,e)=>(Zg(t),Qg.mkdirSync(t,{mode:ey(e),recursive:!0}));});var Et=R((tN,ry)=>{var hR=Xe().fromPromise,{makeDir:pR,makeDirSync:hl}=ty(),pl=hR(pR);ry.exports={mkdirs:pl,mkdirsSync:hl,mkdirp:pl,mkdirpSync:hl,ensureDir:pl,ensureDirSync:hl};});var ur=R((rN,iy)=>{var dR=Xe().fromPromise,ny=Tr();function gR(t){return ny.access(t).then(()=>!0).catch(()=>!1)}iy.exports={pathExists:dR(gR),pathExistsSync:ny.existsSync};});var dl=R((nN,sy)=>{var un=Qe();function yR(t,e,r,n){un.open(t,"r+",(s,i)=>{if(s)return n(s);un.futimes(i,e,r,o=>{un.close(i,l=>{n&&n(o||l);});});});}function mR(t,e,r){let n=un.openSync(t,"r+");return un.futimesSync(n,e,r),un.closeSync(n)}sy.exports={utimesMillis:yR,utimesMillisSync:mR};});var $r=R((iN,ly)=>{var cn=Tr(),ke=z("path"),vR=z("util");function wR(t,e,r){let n=r.dereference?s=>cn.stat(s,{bigint:!0}):s=>cn.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 SR(t,e,r){let n,s=r.dereference?o=>cn.statSync(o,{bigint:!0}):o=>cn.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 bR(t,e,r,n,s){vR.callbackify(wR)(t,e,n,(i,o)=>{if(i)return s(i);let{srcStat:l,destStat:c}=o;if(c){if(Xn(l,c)){let p=ke.basename(t),u=ke.basename(e);return r==="move"&&p!==u&&p.toLowerCase()===u.toLowerCase()?s(null,{srcStat:l,destStat:c,isChangingCase:!0}):s(new Error("Source and destination must not be the same."))}if(l.isDirectory()&&!c.isDirectory())return s(new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`));if(!l.isDirectory()&&c.isDirectory())return s(new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`))}return l.isDirectory()&&gl(t,e)?s(new Error(Os(t,e,r))):s(null,{srcStat:l,destStat:c})});}function ER(t,e,r,n){let{srcStat:s,destStat:i}=SR(t,e,n);if(i){if(Xn(s,i)){let o=ke.basename(t),l=ke.basename(e);if(r==="move"&&o!==l&&o.toLowerCase()===l.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()&&gl(t,e))throw new Error(Os(t,e,r));return {srcStat:s,destStat:i}}function oy(t,e,r,n,s){let i=ke.resolve(ke.dirname(t)),o=ke.resolve(ke.dirname(r));if(o===i||o===ke.parse(o).root)return s();cn.stat(o,{bigint:!0},(l,c)=>l?l.code==="ENOENT"?s():s(l):Xn(e,c)?s(new Error(Os(t,r,n))):oy(t,e,o,n,s));}function ay(t,e,r,n){let s=ke.resolve(ke.dirname(t)),i=ke.resolve(ke.dirname(r));if(i===s||i===ke.parse(i).root)return;let o;try{o=cn.statSync(i,{bigint:!0});}catch(l){if(l.code==="ENOENT")return;throw l}if(Xn(e,o))throw new Error(Os(t,r,n));return ay(t,e,i,n)}function Xn(t,e){return e.ino&&e.dev&&e.ino===t.ino&&e.dev===t.dev}function gl(t,e){let r=ke.resolve(t).split(ke.sep).filter(s=>s),n=ke.resolve(e).split(ke.sep).filter(s=>s);return r.reduce((s,i,o)=>s&&n[o]===i,!0)}function Os(t,e,r){return `Cannot ${r} '${t}' to a subdirectory of itself, '${e}'.`}ly.exports={checkPaths:bR,checkPathsSync:ER,checkParentPaths:oy,checkParentPathsSync:ay,isSrcSubdir:gl,areIdentical:Xn};});var dy=R((sN,py)=>{var Ze=Qe(),Qn=z("path"),AR=Et().mkdirs,_R=ur().pathExists,xR=dl().utimesMillis,Zn=$r();function CR(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"),Zn.checkPaths(t,e,"copy",r,(s,i)=>{if(s)return n(s);let{srcStat:o,destStat:l}=i;Zn.checkParentPaths(t,o,e,"copy",c=>{if(c)return n(c);cy(t,e,r,(p,u)=>{if(p)return n(p);if(!u)return n();RR(l,t,e,r,n);});});});}function RR(t,e,r,n,s){let i=Qn.dirname(r);_R(i,(o,l)=>{if(o)return s(o);if(l)return yl(t,e,r,n,s);AR(i,c=>c?s(c):yl(t,e,r,n,s));});}function cy(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 yl(t,e,r,n,s){(n.dereference?Ze.stat:Ze.lstat)(e,(o,l)=>o?s(o):l.isDirectory()?LR(l,t,e,r,n,s):l.isFile()||l.isCharacterDevice()||l.isBlockDevice()?OR(l,t,e,r,n,s):l.isSymbolicLink()?DR(t,e,r,n,s):l.isSocket()?s(new Error(`Cannot copy a socket file: ${e}`)):l.isFIFO()?s(new Error(`Cannot copy a FIFO pipe: ${e}`)):s(new Error(`Unknown file: ${e}`)));}function OR(t,e,r,n,s,i){return e?PR(t,r,n,s,i):fy(t,r,n,s,i)}function PR(t,e,r,n,s){if(n.overwrite)Ze.unlink(r,i=>i?s(i):fy(t,e,r,n,s));else return n.errorOnExist?s(new Error(`'${r}' already exists`)):s()}function fy(t,e,r,n,s){Ze.copyFile(e,r,i=>i?s(i):n.preserveTimestamps?TR(t.mode,e,r,s):Ps(r,t.mode,s));}function TR(t,e,r,n){return $R(t)?IR(r,t,s=>s?n(s):uy(t,e,r,n)):uy(t,e,r,n)}function $R(t){return (t&128)===0}function IR(t,e,r){return Ps(t,e|128,r)}function uy(t,e,r,n){kR(e,r,s=>s?n(s):Ps(r,t,n));}function Ps(t,e,r){return Ze.chmod(t,e,r)}function kR(t,e,r){Ze.stat(t,(n,s)=>n?r(n):xR(e,s.atime,s.mtime,r));}function LR(t,e,r,n,s,i){return e?hy(r,n,s,i):FR(t.mode,r,n,s,i)}function FR(t,e,r,n,s){Ze.mkdir(r,i=>{if(i)return s(i);hy(e,r,n,o=>o?s(o):Ps(r,t,s));});}function hy(t,e,r,n){Ze.readdir(t,(s,i)=>s?n(s):ml(i,t,e,r,n));}function ml(t,e,r,n,s){let i=t.pop();return i?qR(t,i,e,r,n,s):s()}function qR(t,e,r,n,s,i){let o=Qn.join(r,e),l=Qn.join(n,e);cy(o,l,s,(c,p)=>{if(c)return i(c);if(!p)return ml(t,r,n,s,i);Zn.checkPaths(o,l,"copy",s,(u,g)=>{if(u)return i(u);let{destStat:y}=g;yl(y,o,l,s,m=>m?i(m):ml(t,r,n,s,i));});});}function DR(t,e,r,n,s){Ze.readlink(e,(i,o)=>{if(i)return s(i);if(n.dereference&&(o=Qn.resolve(process.cwd(),o)),t)Ze.readlink(r,(l,c)=>l?l.code==="EINVAL"||l.code==="UNKNOWN"?Ze.symlink(o,r,s):s(l):(n.dereference&&(c=Qn.resolve(process.cwd(),c)),Zn.isSrcSubdir(o,c)?s(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${c}'.`)):Zn.isSrcSubdir(c,o)?s(new Error(`Cannot overwrite '${c}' with '${o}'.`)):NR(o,r,s)));else return Ze.symlink(o,r,s)});}function NR(t,e,r){Ze.unlink(e,n=>n?r(n):Ze.symlink(t,e,r));}py.exports=CR;});var wy=R((oN,vy)=>{var Ve=Qe(),ei=z("path"),MR=Et().mkdirsSync,jR=dl().utimesMillisSync,ti=$r();function BR(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}=ti.checkPathsSync(t,e,"copy",r);if(ti.checkParentPathsSync(t,n,e,"copy"),r.filter&&!r.filter(t,e))return;let i=ei.dirname(e);return Ve.existsSync(i)||MR(i),gy(s,t,e,r)}function gy(t,e,r,n){let i=(n.dereference?Ve.statSync:Ve.lstatSync)(e);if(i.isDirectory())return VR(i,t,e,r,n);if(i.isFile()||i.isCharacterDevice()||i.isBlockDevice())return HR(i,t,e,r,n);if(i.isSymbolicLink())return XR(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 HR(t,e,r,n,s){return e?UR(t,r,n,s):yy(t,r,n,s)}function UR(t,e,r,n){if(n.overwrite)return Ve.unlinkSync(r),yy(t,e,r,n);if(n.errorOnExist)throw new Error(`'${r}' already exists`)}function yy(t,e,r,n){return Ve.copyFileSync(e,r),n.preserveTimestamps&&WR(t.mode,e,r),vl(r,t.mode)}function WR(t,e,r){return zR(t)&&GR(r,t),KR(e,r)}function zR(t){return (t&128)===0}function GR(t,e){return vl(t,e|128)}function vl(t,e){return Ve.chmodSync(t,e)}function KR(t,e){let r=Ve.statSync(t);return jR(e,r.atime,r.mtime)}function VR(t,e,r,n,s){return e?my(r,n,s):YR(t.mode,r,n,s)}function YR(t,e,r,n){return Ve.mkdirSync(r),my(e,r,n),vl(r,t)}function my(t,e,r){Ve.readdirSync(t).forEach(n=>JR(n,t,e,r));}function JR(t,e,r,n){let s=ei.join(e,t),i=ei.join(r,t);if(n.filter&&!n.filter(s,i))return;let{destStat:o}=ti.checkPathsSync(s,i,"copy",n);return gy(o,s,i,n)}function XR(t,e,r,n){let s=Ve.readlinkSync(e);if(n.dereference&&(s=ei.resolve(process.cwd(),s)),t){let i;try{i=Ve.readlinkSync(r);}catch(o){if(o.code==="EINVAL"||o.code==="UNKNOWN")return Ve.symlinkSync(s,r);throw o}if(n.dereference&&(i=ei.resolve(process.cwd(),i)),ti.isSrcSubdir(s,i))throw new Error(`Cannot copy '${s}' to a subdirectory of itself, '${i}'.`);if(ti.isSrcSubdir(i,s))throw new Error(`Cannot overwrite '${i}' with '${s}'.`);return QR(s,r)}else return Ve.symlinkSync(s,r)}function QR(t,e){return Ve.unlinkSync(e),Ve.symlinkSync(t,e)}vy.exports=BR;});var Ts=R((aN,Sy)=>{var ZR=Xe().fromCallback;Sy.exports={copy:ZR(dy()),copySync:wy()};});var ri=R((lN,Ey)=>{var by=Qe(),eO=Xe().fromCallback;function tO(t,e){by.rm(t,{recursive:!0,force:!0},e);}function rO(t){by.rmSync(t,{recursive:!0,force:!0});}Ey.exports={remove:eO(tO),removeSync:rO};});var Ty=R((uN,Py)=>{var nO=Xe().fromPromise,xy=Tr(),Cy=z("path"),Ry=Et(),Oy=ri(),Ay=nO(async function(e){let r;try{r=await xy.readdir(e);}catch{return Ry.mkdirs(e)}return Promise.all(r.map(n=>Oy.remove(Cy.join(e,n))))});function _y(t){let e;try{e=xy.readdirSync(t);}catch{return Ry.mkdirsSync(t)}e.forEach(r=>{r=Cy.join(t,r),Oy.removeSync(r);});}Py.exports={emptyDirSync:_y,emptydirSync:_y,emptyDir:Ay,emptydir:Ay};});var Ly=R((cN,ky)=>{var iO=Xe().fromCallback,$y=z("path"),cr=Qe(),Iy=Et();function sO(t,e){function r(){cr.writeFile(t,"",n=>{if(n)return e(n);e();});}cr.stat(t,(n,s)=>{if(!n&&s.isFile())return e();let i=$y.dirname(t);cr.stat(i,(o,l)=>{if(o)return o.code==="ENOENT"?Iy.mkdirs(i,c=>{if(c)return e(c);r();}):e(o);l.isDirectory()?r():cr.readdir(i,c=>{if(c)return e(c)});});});}function oO(t){let e;try{e=cr.statSync(t);}catch{}if(e&&e.isFile())return;let r=$y.dirname(t);try{cr.statSync(r).isDirectory()||cr.readdirSync(r);}catch(n){if(n&&n.code==="ENOENT")Iy.mkdirsSync(r);else throw n}cr.writeFileSync(t,"");}ky.exports={createFile:iO(sO),createFileSync:oO};});var My=R((fN,Ny)=>{var aO=Xe().fromCallback,Fy=z("path"),fr=Qe(),qy=Et(),lO=ur().pathExists,{areIdentical:Dy}=$r();function uO(t,e,r){function n(s,i){fr.link(s,i,o=>{if(o)return r(o);r(null);});}fr.lstat(e,(s,i)=>{fr.lstat(t,(o,l)=>{if(o)return o.message=o.message.replace("lstat","ensureLink"),r(o);if(i&&Dy(l,i))return r(null);let c=Fy.dirname(e);lO(c,(p,u)=>{if(p)return r(p);if(u)return n(t,e);qy.mkdirs(c,g=>{if(g)return r(g);n(t,e);});});});});}function cO(t,e){let r;try{r=fr.lstatSync(e);}catch{}try{let i=fr.lstatSync(t);if(r&&Dy(i,r))return}catch(i){throw i.message=i.message.replace("lstat","ensureLink"),i}let n=Fy.dirname(e);return fr.existsSync(n)||qy.mkdirsSync(n),fr.linkSync(t,e)}Ny.exports={createLink:aO(uO),createLinkSync:cO};});var By=R((hN,jy)=>{var hr=z("path"),ni=Qe(),fO=ur().pathExists;function hO(t,e,r){if(hr.isAbsolute(t))return ni.lstat(t,n=>n?(n.message=n.message.replace("lstat","ensureSymlink"),r(n)):r(null,{toCwd:t,toDst:t}));{let n=hr.dirname(e),s=hr.join(n,t);return fO(s,(i,o)=>i?r(i):o?r(null,{toCwd:s,toDst:t}):ni.lstat(t,l=>l?(l.message=l.message.replace("lstat","ensureSymlink"),r(l)):r(null,{toCwd:t,toDst:hr.relative(n,t)})))}}function pO(t,e){let r;if(hr.isAbsolute(t)){if(r=ni.existsSync(t),!r)throw new Error("absolute srcpath does not exist");return {toCwd:t,toDst:t}}else {let n=hr.dirname(e),s=hr.join(n,t);if(r=ni.existsSync(s),r)return {toCwd:s,toDst:t};if(r=ni.existsSync(t),!r)throw new Error("relative srcpath does not exist");return {toCwd:t,toDst:hr.relative(n,t)}}}jy.exports={symlinkPaths:hO,symlinkPathsSync:pO};});var Wy=R((pN,Uy)=>{var Hy=Qe();function dO(t,e,r){if(r=typeof e=="function"?e:r,e=typeof e=="function"?!1:e,e)return r(null,e);Hy.lstat(t,(n,s)=>{if(n)return r(null,"file");e=s&&s.isDirectory()?"dir":"file",r(null,e);});}function gO(t,e){let r;if(e)return e;try{r=Hy.lstatSync(t);}catch{return "file"}return r&&r.isDirectory()?"dir":"file"}Uy.exports={symlinkType:dO,symlinkTypeSync:gO};});var Qy=R((dN,Xy)=>{var yO=Xe().fromCallback,Gy=z("path"),At=Tr(),Ky=Et(),mO=Ky.mkdirs,vO=Ky.mkdirsSync,Vy=By(),wO=Vy.symlinkPaths,SO=Vy.symlinkPathsSync,Yy=Wy(),bO=Yy.symlinkType,EO=Yy.symlinkTypeSync,AO=ur().pathExists,{areIdentical:Jy}=$r();function _O(t,e,r,n){n=typeof r=="function"?r:n,r=typeof r=="function"?!1:r,At.lstat(e,(s,i)=>{!s&&i.isSymbolicLink()?Promise.all([At.stat(t),At.stat(e)]).then(([o,l])=>{if(Jy(o,l))return n(null);zy(t,e,r,n);}):zy(t,e,r,n);});}function zy(t,e,r,n){wO(t,e,(s,i)=>{if(s)return n(s);t=i.toDst,bO(i.toCwd,r,(o,l)=>{if(o)return n(o);let c=Gy.dirname(e);AO(c,(p,u)=>{if(p)return n(p);if(u)return At.symlink(t,e,l,n);mO(c,g=>{if(g)return n(g);At.symlink(t,e,l,n);});});});});}function xO(t,e,r){let n;try{n=At.lstatSync(e);}catch{}if(n&&n.isSymbolicLink()){let l=At.statSync(t),c=At.statSync(e);if(Jy(l,c))return}let s=SO(t,e);t=s.toDst,r=EO(s.toCwd,r);let i=Gy.dirname(e);return At.existsSync(i)||vO(i),At.symlinkSync(t,e,r)}Xy.exports={createSymlink:yO(_O),createSymlinkSync:xO};});var om=R((gN,sm)=>{var{createFile:Zy,createFileSync:em}=Ly(),{createLink:tm,createLinkSync:rm}=My(),{createSymlink:nm,createSymlinkSync:im}=Qy();sm.exports={createFile:Zy,createFileSync:em,ensureFile:Zy,ensureFileSync:em,createLink:tm,createLinkSync:rm,ensureLink:tm,ensureLinkSync:rm,createSymlink:nm,createSymlinkSync:im,ensureSymlink:nm,ensureSymlinkSync:im};});var $s=R((yN,am)=>{function CO(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 RO(t){return Buffer.isBuffer(t)&&(t=t.toString("utf8")),t.replace(/^\uFEFF/,"")}am.exports={stringify:CO,stripBom:RO};});var fm=R((mN,cm)=>{var fn;try{fn=Qe();}catch{fn=z("fs");}var Is=Xe(),{stringify:lm,stripBom:um}=$s();async function OO(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||fn,n="throws"in e?e.throws:!0,s=await Is.fromCallback(r.readFile)(t,e);s=um(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 PO=Is.fromPromise(OO);function TO(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||fn,n="throws"in e?e.throws:!0;try{let s=r.readFileSync(t,e);return s=um(s),JSON.parse(s,e.reviver)}catch(s){if(n)throw s.message=`${t}: ${s.message}`,s;return null}}async function $O(t,e,r={}){let n=r.fs||fn,s=lm(e,r);await Is.fromCallback(n.writeFile)(t,s,r);}var IO=Is.fromPromise($O);function kO(t,e,r={}){let n=r.fs||fn,s=lm(e,r);return n.writeFileSync(t,s,r)}var LO={readFile:PO,readFileSync:TO,writeFile:IO,writeFileSync:kO};cm.exports=LO;});var pm=R((vN,hm)=>{var ks=fm();hm.exports={readJson:ks.readFile,readJsonSync:ks.readFileSync,writeJson:ks.writeFile,writeJsonSync:ks.writeFileSync};});var Ls=R((wN,ym)=>{var FO=Xe().fromCallback,ii=Qe(),dm=z("path"),gm=Et(),qO=ur().pathExists;function DO(t,e,r,n){typeof r=="function"&&(n=r,r="utf8");let s=dm.dirname(t);qO(s,(i,o)=>{if(i)return n(i);if(o)return ii.writeFile(t,e,r,n);gm.mkdirs(s,l=>{if(l)return n(l);ii.writeFile(t,e,r,n);});});}function NO(t,...e){let r=dm.dirname(t);if(ii.existsSync(r))return ii.writeFileSync(t,...e);gm.mkdirsSync(r),ii.writeFileSync(t,...e);}ym.exports={outputFile:FO(DO),outputFileSync:NO};});var vm=R((SN,mm)=>{var{stringify:MO}=$s(),{outputFile:jO}=Ls();async function BO(t,e,r={}){let n=MO(e,r);await jO(t,n,r);}mm.exports=BO;});var Sm=R((bN,wm)=>{var{stringify:HO}=$s(),{outputFileSync:UO}=Ls();function WO(t,e,r){let n=HO(e,r);UO(t,n,r);}wm.exports=WO;});var Em=R((EN,bm)=>{var zO=Xe().fromPromise,Ye=pm();Ye.outputJson=zO(vm());Ye.outputJsonSync=Sm();Ye.outputJSON=Ye.outputJson;Ye.outputJSONSync=Ye.outputJsonSync;Ye.writeJSON=Ye.writeJson;Ye.writeJSONSync=Ye.writeJsonSync;Ye.readJSON=Ye.readJson;Ye.readJSONSync=Ye.readJsonSync;bm.exports=Ye;});var Rm=R((AN,Cm)=>{var GO=Qe(),Sl=z("path"),KO=Ts().copy,xm=ri().remove,VO=Et().mkdirp,YO=ur().pathExists,Am=$r();function JO(t,e,r,n){typeof r=="function"&&(n=r,r={}),r=r||{};let s=r.overwrite||r.clobber||!1;Am.checkPaths(t,e,"move",r,(i,o)=>{if(i)return n(i);let{srcStat:l,isChangingCase:c=!1}=o;Am.checkParentPaths(t,l,e,"move",p=>{if(p)return n(p);if(XO(e))return _m(t,e,s,c,n);VO(Sl.dirname(e),u=>u?n(u):_m(t,e,s,c,n));});});}function XO(t){let e=Sl.dirname(t);return Sl.parse(e).root===e}function _m(t,e,r,n,s){if(n)return wl(t,e,r,s);if(r)return xm(e,i=>i?s(i):wl(t,e,r,s));YO(e,(i,o)=>i?s(i):o?s(new Error("dest already exists.")):wl(t,e,r,s));}function wl(t,e,r,n){GO.rename(t,e,s=>s?s.code!=="EXDEV"?n(s):QO(t,e,r,n):n());}function QO(t,e,r,n){KO(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0},i=>i?n(i):xm(t,n));}Cm.exports=JO;});var Im=R((_N,$m)=>{var Pm=Qe(),El=z("path"),ZO=Ts().copySync,Tm=ri().removeSync,eP=Et().mkdirpSync,Om=$r();function tP(t,e,r){r=r||{};let n=r.overwrite||r.clobber||!1,{srcStat:s,isChangingCase:i=!1}=Om.checkPathsSync(t,e,"move",r);return Om.checkParentPathsSync(t,s,e,"move"),rP(e)||eP(El.dirname(e)),nP(t,e,n,i)}function rP(t){let e=El.dirname(t);return El.parse(e).root===e}function nP(t,e,r,n){if(n)return bl(t,e,r);if(r)return Tm(e),bl(t,e,r);if(Pm.existsSync(e))throw new Error("dest already exists.");return bl(t,e,r)}function bl(t,e,r){try{Pm.renameSync(t,e);}catch(n){if(n.code!=="EXDEV")throw n;return iP(t,e,r)}}function iP(t,e,r){return ZO(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),Tm(t)}$m.exports=tP;});var Lm=R((xN,km)=>{var sP=Xe().fromCallback;km.exports={move:sP(Rm()),moveSync:Im()};});var Al=R((CN,Fm)=>{Fm.exports={...Tr(),...Ts(),...Ty(),...om(),...Em(),...Et(),...Lm(),...Ls(),...ur(),...ri()};});var xl=R((PN,Nm)=>{var si=t=>t&&typeof t.message=="string",_l=t=>{if(!t)return;let e=t.cause;if(typeof e=="function"){let r=t.cause();return si(r)?r:void 0}else return si(e)?e:void 0},qm=(t,e)=>{if(!si(t))return "";let r=t.stack||"";if(e.has(t))return r+`
causes have become circular...`;let n=_l(t);return n?(e.add(t),r+`
caused by: `+qm(n,e)):r},oP=t=>qm(t,new Set),Dm=(t,e,r)=>{if(!si(t))return "";let n=r?"":t.message||"";if(e.has(t))return n+": ...";let s=_l(t);if(s){e.add(t);let i=typeof t.cause=="function";return n+(i?"":": ")+Dm(s,e,i)}else return n},aP=t=>Dm(t,new Set);Nm.exports={isErrorLike:si,getErrorCause:_l,stackWithCauses:oP,messageWithCauses:aP};});var Cl=R((TN,jm)=>{var lP=Symbol("circular-ref-tag"),qs=Symbol("pino-raw-err-ref"),Mm=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[qs]},set:function(t){this[qs]=t;}}});Object.defineProperty(Mm,qs,{writable:!0,value:{}});jm.exports={pinoErrProto:Mm,pinoErrorSymbols:{seen:lP,rawSymbol:qs}};});var Um=R(($N,Hm)=>{Hm.exports=Ol;var{messageWithCauses:uP,stackWithCauses:cP,isErrorLike:Bm}=xl(),{pinoErrProto:fP,pinoErrorSymbols:hP}=Cl(),{seen:Rl}=hP,{toString:pP}=Object.prototype;function Ol(t){if(!Bm(t))return t;t[Rl]=void 0;let e=Object.create(fP);e.type=pP.call(t.constructor)==="[object Function]"?t.constructor.name:t.name,e.message=uP(t),e.stack=cP(t),Array.isArray(t.errors)&&(e.aggregateErrors=t.errors.map(r=>Ol(r)));for(let r in t)if(e[r]===void 0){let n=t[r];Bm(n)?r!=="cause"&&!Object.prototype.hasOwnProperty.call(n,Rl)&&(e[r]=Ol(n)):e[r]=n;}return delete t[Rl],e.raw=t,e}});var zm=R((IN,Wm)=>{Wm.exports=Ns;var{isErrorLike:Pl}=xl(),{pinoErrProto:dP,pinoErrorSymbols:gP}=Cl(),{seen:Ds}=gP,{toString:yP}=Object.prototype;function Ns(t){if(!Pl(t))return t;t[Ds]=void 0;let e=Object.create(dP);e.type=yP.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=>Ns(r))),Pl(t.cause)&&!Object.prototype.hasOwnProperty.call(t.cause,Ds)&&(e.cause=Ns(t.cause));for(let r in t)if(e[r]===void 0){let n=t[r];Pl(n)?Object.prototype.hasOwnProperty.call(n,Ds)||(e[r]=Ns(n)):e[r]=n;}return delete t[Ds],e.raw=t,e}});var Ym=R((kN,Vm)=>{Vm.exports={mapHttpRequest:mP,reqSerializer:Km};var Tl=Symbol("pino-raw-req-ref"),Gm=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[Tl]},set:function(t){this[Tl]=t;}}});Object.defineProperty(Gm,Tl,{writable:!0,value:{}});function Km(t){let e=t.info||t.socket,r=Object.create(Gm);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 mP(t){return {req:Km(t)}}});var Zm=R((LN,Qm)=>{Qm.exports={mapHttpResponse:vP,resSerializer:Xm};var $l=Symbol("pino-raw-res-ref"),Jm=Object.create({},{statusCode:{enumerable:!0,writable:!0,value:0},headers:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[$l]},set:function(t){this[$l]=t;}}});Object.defineProperty(Jm,$l,{writable:!0,value:{}});function Xm(t){let e=Object.create(Jm);return e.statusCode=t.headersSent?t.statusCode:null,e.headers=t.getHeaders?t.getHeaders():t._headers,e.raw=t,e}function vP(t){return {res:Xm(t)}}});var kl=R((FN,ev)=>{var Il=Um(),wP=zm(),Ms=Ym(),js=Zm();ev.exports={err:Il,errWithCause:wP,mapHttpRequest:Ms.mapHttpRequest,mapHttpResponse:js.mapHttpResponse,req:Ms.reqSerializer,res:js.resSerializer,wrapErrorSerializer:function(e){return e===Il?e:function(n){return e(Il(n))}},wrapRequestSerializer:function(e){return e===Ms.reqSerializer?e:function(n){return e(Ms.reqSerializer(n))}},wrapResponseSerializer:function(e){return e===js.resSerializer?e:function(n){return e(js.resSerializer(n))}}};});var Ll=R((qN,tv)=>{function SP(t,e){return e}tv.exports=function(){let e=Error.prepareStackTrace;Error.prepareStackTrace=SP;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 nv=R((DN,rv)=>{rv.exports=bP;function bP(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 Bs=R((NN,iv)=>{iv.exports=/[^.[\]]+|\[((?:.)*?)\]/g;});var ov=R((MN,sv)=>{var EP=Bs();sv.exports=AP;function AP({paths:t}){let e=[];var r=0;let n=t.reduce(function(s,i,o){var l=i.match(EP).map(u=>u.replace(/'|"|`/g,""));let c=i[0]==="[";l=l.map(u=>u[0]==="["?u.substr(1,u.length-2):u);let p=l.indexOf("*");if(p>-1){let u=l.slice(0,p),g=u.join("."),y=l.slice(p+1,l.length),m=y.length>0;r++,e.push({before:u,beforeStr:g,after:y,nested:m});}else s[i]={path:l,val:void 0,precensored:!1,circle:"",escPath:JSON.stringify(i),leadingBracket:c};return s},{});return {wildcards:e,wcLen:r,secret:n}}});var lv=R((jN,av)=>{var _P=Bs();av.exports=xP;function xP({secret:t,serialize:e,wcLen:r,strict:n,isCensorFct:s,censorFctTakesPath:i},o){let l=Function("o",`
if (typeof o !== 'object' || o == null) {
${PP(n,e)}
}
const { censor, secret } = this
${CP(t,s,i)}
this.compileRestore()
${RP(r>0,s,i)}
${OP(e)}
`).bind(o);return e===!1&&(l.restore=c=>o.restore(c)),l}function CP(t,e,r){return Object.keys(t).map(n=>{let{escPath:s,leadingBracket:i,path:o}=t[n],l=i?1:0,c=i?"":".",p=[];for(var u;(u=_P.exec(n))!==null;){let[,v]=u,{index:b,input:_}=u;b>l&&p.push(_.substring(0,b-(v?0:1)));}var g=p.map(v=>`o${c}${v}`).join(" && ");g.length===0?g+=`o${c}${n} != null`:g+=` && o${c}${n} != null`;let y=`
switch (true) {
${p.reverse().map(v=>`
case o${c}${v} === censor:
secret[${s}].circle = ${JSON.stringify(v)}
break
`).join(`
`)}
}
`,m=r?`val, ${JSON.stringify(o)}`:"val";return `
if (${g}) {
const val = o${c}${n}
if (val === censor) {
secret[${s}].precensored = true
} else {
secret[${s}].val = val
o${c}${n} = ${e?`censor(${m})`:"censor"}
${y}
}
}
`}).join(`
`)}function RP(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 OP(t){return t===!1?"return o":`
var s = this.serialize(o)
this.restore(o)
return s
`}function PP(t,e){return t===!0?"throw Error('fast-redact: primitives cannot be redacted')":e===!1?"return o":"return this.serialize(o)"}});var ql=R((BN,fv)=>{fv.exports={groupRedact:$P,groupRestore:TP,nestedRedact:kP,nestedRestore:IP};function TP({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 $P(t,e,r,n,s){let i=uv(t,e);if(i==null)return {keys:null,values:null,target:null,flat:!0};let o=Object.keys(i),l=o.length,c=e.length,p=s?[...e]:void 0,u=new Array(l);for(var g=0;g<l;g++){let y=o[g];u[g]=i[y],s?(p[c]=y,i[y]=r(i[y],p)):n?i[y]=r(i[y]):i[y]=r;}return {keys:o,values:u,target:i,flat:!0}}function IP(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 kP(t,e,r,n,s,i,o){let l=uv(e,r);if(l==null)return;let c=Object.keys(l),p=c.length;for(var u=0;u<p;u++){let g=c[u];LP(t,l,g,r,n,s,i,o);}return t}function Fl(t,e){return t!=null?"hasOwn"in Object?Object.hasOwn(t,e):Object.prototype.hasOwnProperty.call(t,e):!1}function LP(t,e,r,n,s,i,o,l){let c=s.length,p=c-1,u=r;var g=-1,y,m,v,_=null,x,A,O=!1,I=0,F=0,U=FP();if(v=y=e[r],typeof y=="object"){for(;y!=null&&++g<c&&(F+=1,r=s[g],!(r!=="*"&&!_&&!(typeof y=="object"&&r in y)));)if(!(r==="*"&&(_==="*"&&(O=!0),_=r,g!==p))){if(_){let q=Object.keys(y);for(var H=0;H<q.length;H++){let k=q[H];if(A=y[k],x=r==="*",O)U=Gt(U,k,F),I=g,v=cv(A,I-1,r,n,s,i,o,l,u,y,m,v,x,k,g,p,U,t,e[u],F+1);else if(x||typeof A=="object"&&A!==null&&r in A){if(x?v=A:v=A[r],m=g!==p?v:o?l?i(v,[...n,u,...s]):i(v):i,x){let j=oi(Gt(U,k,F),v,e[u]);t.push(j),y[k]=m;}else if(A[r]!==m)if(m===void 0&&i!==void 0||Fl(A,r)&&m===v)U=Gt(U,k,F);else {U=Gt(U,k,F);let j=oi(Gt(U,r,F+1),v,e[u]);t.push(j),A[r]=m;}}}_=null;}else {if(v=y[r],U=Gt(U,r,F),m=g!==p?v:o?l?i(v,[...n,u,...s]):i(v):i,!(Fl(y,r)&&m===v||m===void 0&&i!==void 0)){let q=oi(U,v,e[u]);t.push(q),y[r]=m;}y=y[r];}if(typeof y!="object")break}}}function uv(t,e){for(var r=-1,n=e.length,s=t;s!=null&&++r<n;)s=s[e[r]];return s}function cv(t,e,r,n,s,i,o,l,c,p,u,g,y,m,v,b,_,x,A,O){if(e===0&&(y||typeof t=="object"&&t!==null&&r in t)){if(y?g=t:g=t[r],u=v!==b?g:o?l?i(g,[...n,c,...s]):i(g):i,y){let I=oi(_,g,A);x.push(I),p[m]=u;}else if(t[r]!==u){if(!(u===void 0&&i!==void 0||Fl(t,r)&&u===g)){let I=oi(Gt(_,r,O+1),g,A);x.push(I),t[r]=u;}}}for(let I in t)typeof t[I]=="object"&&(_=Gt(_,I,O),cv(t[I],e-1,r,n,s,i,o,l,c,p,u,g,y,m,v,b,_,x,A,O+1));}function FP(){return {parent:null,key:null,children:[],depth:0}}function Gt(t,e,r){if(t.depth===r)return Gt(t.parent,e,r);var n={parent:t,key:e,depth:r,children:[]};return t.children.push(n),n}function oi(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 pv=R((HN,hv)=>{var{groupRestore:qP,nestedRestore:DP}=ql();hv.exports=NP;function NP({secret:t,wcLen:e}){return function(){if(this.restore)return;let n=Object.keys(t),s=MP(t,n),i=e>0,o=i?{secret:t,groupRestore:qP,nestedRestore:DP}:{secret:t};this.restore=Function("o",jP(s,n,i)).bind(o);}}function MP(t,e){return e.map(r=>{let{circle:n,escPath:s,leadingBracket:i}=t[r],l=n?`o.${n} = secret[${s}].val`:`o${i?"":"."}${r} = secret[${s}].val`,c=`secret[${s}].val = undefined`;return `
if (secret[${s}].val !== undefined) {
try { ${l} } catch (e) {}
${c}
}
`}).join("")}function jP(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 gv=R((UN,dv)=>{dv.exports=BP;function BP(t){let{secret:e,censor:r,compileRestore:n,serialize:s,groupRedact:i,nestedRedact:o,wildcards:l,wcLen:c}=t,p=[{secret:e,censor:r,compileRestore:n}];return s!==!1&&p.push({serialize:s}),c>0&&p.push({groupRedact:i,nestedRedact:o,wildcards:l,wcLen:c}),Object.assign(...p)}});var vv=R((WN,mv)=>{var yv=nv(),HP=ov(),UP=lv(),WP=pv(),{groupRedact:zP,nestedRedact:GP}=ql(),KP=gv(),VP=Bs(),YP=yv(),Dl=t=>t;Dl.restore=Dl;var JP="[REDACTED]";Nl.rx=VP;Nl.validator=yv;mv.exports=Nl;function Nl(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:JP,i=typeof s=="function",o=i&&s.length>1;if(e.length===0)return r||Dl;YP({paths:e,serialize:r,censor:s});let{wildcards:l,wcLen:c,secret:p}=HP({paths:e,censor:s}),u=WP({secret:p,wcLen:c}),g="strict"in t?t.strict:!0;return UP({secret:p,wcLen:c,serialize:r,strict:g,isCensorFct:i,censorFctTakesPath:o},KP({secret:p,censor:s,compileRestore:u,serialize:r,groupRedact:zP,nestedRedact:GP,wildcards:l,wcLen:c}))}});var hn=R((zN,wv)=>{var XP=Symbol("pino.setLevel"),QP=Symbol("pino.getLevel"),ZP=Symbol("pino.levelVal"),e1=Symbol("pino.useLevelLabels"),t1=Symbol("pino.useOnlyCustomLevels"),r1=Symbol("pino.mixin"),n1=Symbol("pino.lsCache"),i1=Symbol("pino.chindings"),s1=Symbol("pino.asJson"),o1=Symbol("pino.write"),a1=Symbol("pino.redactFmt"),l1=Symbol("pino.time"),u1=Symbol("pino.timeSliceIndex"),c1=Symbol("pino.stream"),f1=Symbol("pino.stringify"),h1=Symbol("pino.stringifySafe"),p1=Symbol("pino.stringifiers"),d1=Symbol("pino.end"),g1=Symbol("pino.formatOpts"),y1=Symbol("pino.messageKey"),m1=Symbol("pino.errorKey"),v1=Symbol("pino.nestedKey"),w1=Symbol("pino.nestedKeyStr"),S1=Symbol("pino.mixinMergeStrategy"),b1=Symbol("pino.msgPrefix"),E1=Symbol("pino.wildcardFirst"),A1=Symbol.for("pino.serializers"),_1=Symbol.for("pino.formatters"),x1=Symbol.for("pino.hooks"),C1=Symbol.for("pino.metadata");wv.exports={setLevelSym:XP,getLevelSym:QP,levelValSym:ZP,useLevelLabelsSym:e1,mixinSym:r1,lsCacheSym:n1,chindingsSym:i1,asJsonSym:s1,writeSym:o1,serializersSym:A1,redactFmtSym:a1,timeSym:l1,timeSliceIndexSym:u1,streamSym:c1,stringifySym:f1,stringifySafeSym:h1,stringifiersSym:p1,endSym:d1,formatOptsSym:g1,messageKeySym:y1,errorKeySym:m1,nestedKeySym:v1,wildcardFirstSym:E1,needsMetadataGsym:C1,useOnlyCustomLevelsSym:t1,formattersSym:_1,hooksSym:x1,nestedKeyStrSym:w1,mixinMergeStrategySym:S1,msgPrefixSym:b1};});var Bl=R((GN,Av)=>{var jl=vv(),{redactFmtSym:R1,wildcardFirstSym:Hs}=hn(),{rx:Ml,validator:O1}=jl,Sv=O1({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})`}),bv="[Redacted]",Ev=!1;function P1(t,e){let{paths:r,censor:n}=T1(t),s=r.reduce((l,c)=>{Ml.lastIndex=0;let p=Ml.exec(c),u=Ml.exec(c),g=p[1]!==void 0?p[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/,"$1"):p[0];if(g==="*"&&(g=Hs),u===null)return l[g]=null,l;if(l[g]===null)return l;let{index:y}=u,m=`${c.substr(y,c.length-1)}`;return l[g]=l[g]||[],g!==Hs&&l[g].length===0&&l[g].push(...l[Hs]||[]),g===Hs&&Object.keys(l).forEach(function(v){l[v]&&l[v].push(m);}),l[g].push(m),l},{}),i={[R1]:jl({paths:r,censor:n,serialize:e,strict:Ev})},o=(...l)=>e(typeof n=="function"?n(...l):n);return [...Object.keys(s),...Object.getOwnPropertySymbols(s)].reduce((l,c)=>{if(s[c]===null)l[c]=p=>o(p,[c]);else {let p=typeof n=="function"?(u,g)=>n(u,[c,...g]):n;l[c]=jl({paths:s[c],censor:p,serialize:e,strict:Ev});}return l},i)}function T1(t){if(Array.isArray(t))return t={paths:t,censor:bv},Sv(t),t;let{paths:e,censor:r=bv,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),Sv({paths:e,censor:r}),{paths:e,censor:r}}Av.exports=P1;});var xv=R((KN,_v)=>{var $1=()=>"",I1=()=>`,"time":${Date.now()}`,k1=()=>`,"time":${Math.round(Date.now()/1e3)}`,L1=()=>`,"time":"${new Date(Date.now()).toISOString()}"`;_v.exports={nullTime:$1,epochTime:I1,unixTime:k1,isoTime:L1};});var Rv=R((VN,Cv)=>{function F1(t){try{return JSON.stringify(t)}catch{return '"[Circular]"'}}Cv.exports=q1;function q1(t,e,r){var n=r&&r.stringify||F1,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 l=1;l<i;l++)o[l]=n(e[l]);return o.join(" ")}if(typeof t!="string")return t;var c=e.length;if(c===0)return t;for(var p="",u=1-s,g=-1,y=t&&t.length||0,m=0;m<y;){if(t.charCodeAt(m)===37&&m+1<y){switch(g=g>-1?g:0,t.charCodeAt(m+1)){case 100:case 102:if(u>=c||e[u]==null)break;g<m&&(p+=t.slice(g,m)),p+=Number(e[u]),g=m+2,m++;break;case 105:if(u>=c||e[u]==null)break;g<m&&(p+=t.slice(g,m)),p+=Math.floor(Number(e[u])),g=m+2,m++;break;case 79:case 111:case 106:if(u>=c||e[u]===void 0)break;g<m&&(p+=t.slice(g,m));var v=typeof e[u];if(v==="string"){p+="'"+e[u]+"'",g=m+2,m++;break}if(v==="function"){p+=e[u].name||"<anonymous>",g=m+2,m++;break}p+=n(e[u]),g=m+2,m++;break;case 115:if(u>=c)break;g<m&&(p+=t.slice(g,m)),p+=String(e[u]),g=m+2,m++;break;case 37:g<m&&(p+=t.slice(g,m)),p+="%",g=m+2,m++,u--;break}++u;}++m;}return g===-1?t:(g<y&&(p+=t.slice(g)),p)}});var Ul=R((YN,Hl)=>{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));Hl.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");};Hl.exports=t;}});var Iv=R((JN,$v)=>{var et=z("fs"),D1=z("events"),N1=z("util").inherits,Ov=z("path"),Pv=Ul(),Wl=100,M1=16*1024;function Tv(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&&pn(e);}let n=e.append?"a":"w",s=e.mode;if(e.sync)try{e.mkdir&&et.mkdirSync(Ov.dirname(t),{recursive:!0});let i=et.openSync(t,n,s);r(null,i);}catch(i){throw r(i),i}else e.mkdir?et.mkdir(Ov.dirname(t),{recursive:!0},i=>{if(i)return r(i);et.open(t,n,s,r);}):et.open(t,n,s,r);}function tt(t){if(!(this instanceof tt))return new tt(t);let{fd:e,dest:r,minLength:n,maxLength:s,maxWrite:i,sync:o,append:l=!0,mode:c,mkdir:p,retryEAGAIN:u,fsync:g}=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||M1,this.sync=o||!1,this._fsync=g||!1,this.append=l||!1,this.mode=c,this.retryEAGAIN=u||(()=>!0),this.mkdir=p||!1,typeof e=="number")this.fd=e,process.nextTick(()=>this.emit("ready"));else if(typeof e=="string")Tv(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=(y,m)=>{if(y){if((y.code==="EAGAIN"||y.code==="EBUSY")&&this.retryEAGAIN(y,this._writingBuf.length,this._len-this._writingBuf.length))if(this.sync)try{Pv(Wl),this.release(void 0,0);}catch(b){this.release(b);}else setTimeout(()=>{et.write(this.fd,this._writingBuf,"utf8",this.release);},Wl);else this._writing=!1,this.emit("error",y);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){et.write(this.fd,this._writingBuf,"utf8",this.release);return}try{do{let b=et.writeSync(this.fd,this._writingBuf,"utf8");this._len-=b,this._writingBuf=this._writingBuf.slice(b);}while(this._writingBuf)}catch(b){this.release(b);return}}this._fsync&&et.fsyncSync(this.fd);let v=this._len;this._reopening?(this._writing=!1,this._reopening=!1,this.reopen()):v>this.minLength?pn(this):this._ending?v>0?pn(this):(this._writing=!1,Us(this)):(this._writing=!1,this.sync?this._asyncDrainScheduled||(this._asyncDrainScheduled=!0,process.nextTick(j1,this)):this.emit("drain"));},this.on("newListener",function(y){y==="drain"&&(this._asyncDrainScheduled=!1);});}function j1(t){t.listenerCount("drain")>0&&(t._asyncDrainScheduled=!1,t.emit("drain"));}N1(tt,D1);tt.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&&pn(this),this._len<this._hwm)};tt.prototype.flush=function(){if(this.destroyed)throw new Error("SonicBoom destroyed");this._writing||this.minLength<=0||(this._bufs.length===0&&this._bufs.push(""),pn(this));};tt.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&&et.close(e,r=>{if(r)return this.emit("error",r)});}),Tv(t||this.file,this);};tt.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?pn(this):Us(this)));};tt.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=et.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;Pv(Wl);}}};tt.prototype.destroy=function(){this.destroyed||Us(this);};function pn(t){let e=t.release;if(t._writing=!0,t._writingBuf=t._writingBuf||t._bufs.shift()||"",t.sync)try{let r=et.writeSync(t.fd,t._writingBuf,"utf8");e(null,r);}catch(r){e(r);}else et.write(t.fd,t._writingBuf,"utf8",e);}function Us(t){if(t.fd===-1){t.once("ready",Us.bind(null,t));return}t.destroyed=!0,t._bufs=[],t.fd!==1&&t.fd!==2?et.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");}}tt.SonicBoom=tt;tt.default=tt;$v.exports=tt;});var zl=R((XN,Nv)=>{var dr={exit:[],beforeExit:[]},kv={exit:H1,beforeExit:U1},Lv=new FinalizationRegistry(W1);function B1(t){dr[t].length>0||process.on(t,kv[t]);}function Fv(t){dr[t].length>0||process.removeListener(t,kv[t]);}function H1(){qv("exit");}function U1(){qv("beforeExit");}function qv(t){for(let e of dr[t]){let r=e.deref(),n=e.fn;r!==void 0&&n(r,t);}}function W1(t){for(let e of ["exit","beforeExit"]){let r=dr[e].indexOf(t);dr[e].splice(r,r+1),Fv(e);}}function Dv(t,e,r){if(e===void 0)throw new Error("the object can't be undefined");B1(t);let n=new WeakRef(e);n.fn=r,Lv.register(e,n),dr[t].push(n);}function z1(t,e){Dv("exit",t,e);}function G1(t,e){Dv("beforeExit",t,e);}function K1(t){Lv.unregister(t);for(let e of ["exit","beforeExit"])dr[e]=dr[e].filter(r=>{let n=r.deref();return n&&n!==t}),Fv(e);}Nv.exports={register:z1,registerBeforeExit:G1,unregister:K1};});var Mv=R((QN,V1)=>{V1.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 Bv=R((ZN,jv)=>{function Y1(t,e,r,n,s){let i=Date.now()+n,o=Atomics.load(t,e);if(o===r){s(null,"ok");return}let l=o,c=p=>{Date.now()>i?s(null,"timed-out"):setTimeout(()=>{l=o,o=Atomics.load(t,e),o===l?c(p>=1e3?1e3:p*2):o===r?s(null,"ok"):s(null,"not-equal");},p);};c(1);}function J1(t,e,r,n,s){let i=Date.now()+n,o=Atomics.load(t,e);if(o!==r){s(null,"ok");return}let l=c=>{Date.now()>i?s(null,"timed-out"):setTimeout(()=>{o=Atomics.load(t,e),o!==r?s(null,"ok"):l(c>=1e3?1e3:c*2);},c);};l(1);}jv.exports={wait:Y1,waitDiff:J1};});var Uv=R((eM,Hv)=>{Hv.exports={WRITE_INDEX:4,READ_INDEX:8};});var Vv=R((rM,Kv)=>{var{version:X1}=Mv(),{EventEmitter:Q1}=z("events"),{Worker:Z1}=z("worker_threads"),{join:eT}=z("path"),{pathToFileURL:tT}=z("url"),{wait:rT}=Bv(),{WRITE_INDEX:rt,READ_INDEX:qt}=Uv(),nT=z("buffer"),iT=z("assert"),D=Symbol("kImpl"),sT=nT.constants.MAX_STRING_LENGTH,zs=class{constructor(e){this._value=e;}deref(){return this._value}},oT=global.FinalizationRegistry||class{register(){}unregister(){}},aT=global.WeakRef||zs,Wv=new oT(t=>{t.exited||t.terminate();});function lT(t,e){let{filename:r,workerData:n}=e,i=("__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{})["thread-stream-worker"]||eT(__dirname,"lib","worker.js"),o=new Z1(i,{...e.workerOpts,trackUnmanagedFds:!1,workerData:{filename:r.indexOf("file://")===0?r:tT(r).href,dataBuf:t[D].dataBuf,stateBuf:t[D].stateBuf,workerData:{$context:{threadStreamVersion:X1},...n}}});return o.stream=new zs(t),o.on("message",uT),o.on("exit",Gv),Wv.register(t,o),o}function zv(t){iT(!t[D].sync),t[D].needDrain&&(t[D].needDrain=!1,t.emit("drain"));}function Ws(t){let e=Atomics.load(t[D].state,rt),r=t[D].data.length-e;if(r>0){if(t[D].buf.length===0){t[D].flushing=!1,t[D].ending?Jl(t):t[D].needDrain&&process.nextTick(zv,t);return}let n=t[D].buf.slice(0,r),s=Buffer.byteLength(n);s<=r?(t[D].buf=t[D].buf.slice(r),Gs(t,n,Ws.bind(null,t))):t.flush(()=>{if(!t.destroyed){for(Atomics.store(t[D].state,qt,0),Atomics.store(t[D].state,rt,0);s>t[D].data.length;)r=r/2,n=t[D].buf.slice(0,r),s=Buffer.byteLength(n);t[D].buf=t[D].buf.slice(r),Gs(t,n,Ws.bind(null,t));}});}else if(r===0){if(e===0&&t[D].buf.length===0)return;t.flush(()=>{Atomics.store(t[D].state,qt,0),Atomics.store(t[D].state,rt,0),Ws(t);});}else Dt(t,new Error("overwritten"));}function uT(t){let e=this.stream.deref();if(e===void 0){this.exited=!0,this.terminate();return}switch(t.code){case"READY":this.stream=new aT(e),e.flush(()=>{e[D].ready=!0,e.emit("ready");});break;case"ERROR":Dt(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:Dt(e,new Error("this should not happen: "+t.code));}}function Gv(t){let e=this.stream.deref();e!==void 0&&(Wv.unregister(e),e.worker.exited=!0,e.worker.off("exit",Gv),Dt(e,t!==0?new Error("the worker thread exited"):null));}var Kl=class extends Q1{constructor(e={}){if(super(),e.bufferSize<4)throw new Error("bufferSize must at least fit a 4-byte utf-8 char");this[D]={},this[D].stateBuf=new SharedArrayBuffer(128),this[D].state=new Int32Array(this[D].stateBuf),this[D].dataBuf=new SharedArrayBuffer(e.bufferSize||4*1024*1024),this[D].data=Buffer.from(this[D].dataBuf),this[D].sync=e.sync||!1,this[D].ending=!1,this[D].ended=!1,this[D].needDrain=!1,this[D].destroyed=!1,this[D].flushing=!1,this[D].ready=!1,this[D].finished=!1,this[D].errored=null,this[D].closed=!1,this[D].buf="",this.worker=lT(this,e);}write(e){if(this[D].destroyed)return Vl(this,new Error("the worker has exited")),!1;if(this[D].ending)return Vl(this,new Error("the worker is ending")),!1;if(this[D].flushing&&this[D].buf.length+e.length>=sT)try{Gl(this),this[D].flushing=!0;}catch(r){return Dt(this,r),!1}if(this[D].buf+=e,this[D].sync)try{return Gl(this),!0}catch(r){return Dt(this,r),!1}return this[D].flushing||(this[D].flushing=!0,setImmediate(Ws,this)),this[D].needDrain=this[D].data.length-this[D].buf.length-Atomics.load(this[D].state,rt)<=0,!this[D].needDrain}end(){this[D].destroyed||(this[D].ending=!0,Jl(this));}flush(e){if(this[D].destroyed){typeof e=="function"&&process.nextTick(e,new Error("the worker has exited"));return}let r=Atomics.load(this[D].state,rt);rT(this[D].state,qt,r,1/0,(n,s)=>{if(n){Dt(this,n),process.nextTick(e,n);return}if(s==="not-equal"){this.flush(e);return}process.nextTick(e);});}flushSync(){this[D].destroyed||(Gl(this),Yl(this));}unref(){this.worker.unref();}ref(){this.worker.ref();}get ready(){return this[D].ready}get destroyed(){return this[D].destroyed}get closed(){return this[D].closed}get writable(){return !this[D].destroyed&&!this[D].ending}get writableEnded(){return this[D].ending}get writableFinished(){return this[D].finished}get writableNeedDrain(){return this[D].needDrain}get writableObjectMode(){return !1}get writableErrored(){return this[D].errored}};function Vl(t,e){setImmediate(()=>{t.emit("error",e);});}function Dt(t,e){t[D].destroyed||(t[D].destroyed=!0,e&&(t[D].errored=e,Vl(t,e)),t.worker.exited?setImmediate(()=>{t[D].closed=!0,t.emit("close");}):t.worker.terminate().catch(()=>{}).then(()=>{t[D].closed=!0,t.emit("close");}));}function Gs(t,e,r){let n=Atomics.load(t[D].state,rt),s=Buffer.byteLength(e);return t[D].data.write(e,n),Atomics.store(t[D].state,rt,n+s),Atomics.notify(t[D].state,rt),r(),!0}function Jl(t){if(!(t[D].ended||!t[D].ending||t[D].flushing)){t[D].ended=!0;try{t.flushSync();let e=Atomics.load(t[D].state,qt);Atomics.store(t[D].state,rt,-1),Atomics.notify(t[D].state,rt);let r=0;for(;e!==-1;){if(Atomics.wait(t[D].state,qt,e,1e3),e=Atomics.load(t[D].state,qt),e===-2){Dt(t,new Error("end() failed"));return}if(++r===10){Dt(t,new Error("end() took too long (10s)"));return}}process.nextTick(()=>{t[D].finished=!0,t.emit("finish");});}catch(e){Dt(t,e);}}}function Gl(t){let e=()=>{t[D].ending?Jl(t):t[D].needDrain&&process.nextTick(zv,t);};for(t[D].flushing=!1;t[D].buf.length!==0;){let r=Atomics.load(t[D].state,rt),n=t[D].data.length-r;if(n===0){Yl(t),Atomics.store(t[D].state,qt,0),Atomics.store(t[D].state,rt,0);continue}else if(n<0)throw new Error("overwritten");let s=t[D].buf.slice(0,n),i=Buffer.byteLength(s);if(i<=n)t[D].buf=t[D].buf.slice(n),Gs(t,s,e);else {for(Yl(t),Atomics.store(t[D].state,qt,0),Atomics.store(t[D].state,rt,0);i>t[D].buf.length;)n=n/2,s=t[D].buf.slice(0,n),i=Buffer.byteLength(s);t[D].buf=t[D].buf.slice(n),Gs(t,s,e);}}}function Yl(t){if(t[D].flushing)throw new Error("unable to flush while flushing");let e=Atomics.load(t[D].state,rt),r=0;for(;;){let n=Atomics.load(t[D].state,qt);if(n===-2)throw Error("_flushSync failed");if(n!==e)Atomics.wait(t[D].state,qt,n,1e3);else break;if(++r===10)throw new Error("_flushSync took too long (10s)")}}Kv.exports=Kl;});var Zl=R((nM,Yv)=>{var{createRequire:cT}=z("module"),fT=Ll(),{join:Xl,isAbsolute:hT,sep:pT}=z("path"),dT=Ul(),Ql=zl(),gT=Vv();function yT(t){Ql.register(t,vT),Ql.registerBeforeExit(t,wT),t.on("close",function(){Ql.unregister(t);});}function mT(t,e,r){let n=new gT({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&&yT(n);}function i(){n.closed||(n.flushSync(),dT(100),n.end());}return n}function vT(t){t.ref(),t.flushSync(),t.end(),t.once("close",function(){t.unref();});}function wT(t){t.flushSync();}function ST(t){let{pipeline:e,targets:r,levels:n,dedupe:s,options:i={},worker:o={},caller:l=fT()}=t,c=typeof l=="string"?[l]:l,p="__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=p["pino-worker"]||Xl(__dirname,"worker.js"),i.targets=r.map(y=>({...y,target:g(y.target)}))):e&&(u=p["pino-pipeline-worker"]||Xl(__dirname,"worker-pipeline.js"),i.targets=e.map(y=>({...y,target:g(y.target)}))),n&&(i.levels=n),s&&(i.dedupe=s),mT(g(u),i,o);function g(y){if(y=p[y]||y,hT(y)||y.indexOf("file://")===0)return y;if(y==="pino/file")return Xl(__dirname,"..","file.js");let m;for(let v of c)try{let b=v==="node:repl"?process.cwd()+pT:v;m=cT(b).resolve(y);break}catch{continue}if(!m)throw new Error(`unable to determine transport target for "${y}"`);return m}}Yv.exports=ST;});var Ys=R((iM,ow)=>{var Jv=Rv(),{mapHttpRequest:bT,mapHttpResponse:ET}=kl(),tu=Iv(),Xv=zl(),{lsCacheSym:AT,chindingsSym:ew,writeSym:Qv,serializersSym:tw,formatOptsSym:Zv,endSym:_T,stringifiersSym:rw,stringifySym:nw,stringifySafeSym:ru,wildcardFirstSym:iw,nestedKeySym:xT,formattersSym:sw,messageKeySym:CT,errorKeySym:RT,nestedKeyStrSym:OT,msgPrefixSym:Ks}=hn(),{isMainThread:PT}=z("worker_threads"),TT=Zl();function dn(){}function $T(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=bT(n):typeof n.setHeader=="function"&&(n=ET(n)));let o;i===null&&s.length===0?o=[null]:(i=s.shift(),o=s),typeof this[Ks]=="string"&&i!==void 0&&i!==null&&(i=this[Ks]+i),this[Qv](n,Jv(i,o,this[Zv]),t);}else {let i=n===void 0?s.shift():n;typeof this[Ks]=="string"&&i!==void 0&&i!==null&&(i=this[Ks]+i),this[Qv](null,Jv(i,s,this[Zv]),t);}}}function eu(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 IT(t,e,r,n){let s=this[nw],i=this[ru],o=this[rw],l=this[_T],c=this[ew],p=this[tw],u=this[sw],g=this[CT],y=this[RT],m=this[AT][r]+n;m=m+c;let v;u.log&&(t=u.log(t));let b=o[iw],_="";for(let A in t)if(v=t[A],Object.prototype.hasOwnProperty.call(t,A)&&v!==void 0){p[A]?v=p[A](v):A===y&&p.err&&(v=p.err(v));let O=o[A]||b;switch(typeof v){case"undefined":case"function":continue;case"number":Number.isFinite(v)===!1&&(v=null);case"boolean":O&&(v=O(v));break;case"string":v=(O||eu)(v);break;default:v=(O||s)(v,i);}if(v===void 0)continue;let I=eu(A);_+=","+I+":"+v;}let x="";if(e!==void 0){v=p[g]?p[g](e):e;let A=o[g]||b;switch(typeof v){case"function":break;case"number":Number.isFinite(v)===!1&&(v=null);case"boolean":A&&(v=A(v)),x=',"'+g+'":'+v;break;case"string":v=(A||eu)(v),x=',"'+g+'":'+v;break;default:v=(A||s)(v,i),x=',"'+g+'":'+v;}}return this[xT]&&_?m+this[OT]+_.slice(1)+"}"+x+l:m+_+x+l}function kT(t,e){let r,n=t[ew],s=t[nw],i=t[ru],o=t[rw],l=o[iw],c=t[tw],p=t[sw].bindings;e=p(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]||l||s)(r,i),r===void 0)continue;n+=',"'+u+'":'+r;}return n}function LT(t){return t.write!==t.constructor.prototype.write}function Vs(t){let e=new tu(t);return e.on("error",r),!t.sync&&PT&&(Xv.register(e,FT),e.on("close",function(){Xv.unregister(e);})),e;function r(n){if(n.code==="EPIPE"){e.write=dn,e.end=dn,e.flushSync=dn,e.destroy=dn;return}e.removeListener("error",r),e.emit("error",n);}}function FT(t,e){t.destroyed||(e==="beforeExit"?(t.flush(),t.on("drain",function(){t.end();})):t.flushSync());}function qT(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 tu||s.writable||s._writableState)i=s,s={};else if(s.transport){if(s.transport instanceof tu||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=TT({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:l}=s;return o===!1&&(s.level="silent"),l||(s.onChild=dn),i||(LT(process.stdout)?i=process.stdout:i=Vs({fd:process.stdout.fd||1})),{opts:s,stream:i}}}function DT(t,e){try{return JSON.stringify(t)}catch{try{return (e||this[ru])(t)}catch{return '"[unable to serialize, circular reference is too complex to analyze]"'}}}function NT(t,e,r){return {level:t,bindings:e,log:r}}function MT(t){let e=Number(t);return typeof t=="string"&&Number.isFinite(e)?e:t===void 0?1:t}ow.exports={noop:dn,buildSafeSonicBoom:Vs,asChindings:kT,asJson:IT,genLog:$T,createArgsNormalizer:qT,stringify:DT,buildFormatters:NT,normalizeDestFileDescriptor:MT};});var Js=R((sM,lw)=>{var{lsCacheSym:jT,levelValSym:nu,useOnlyCustomLevelsSym:BT,streamSym:HT,formattersSym:UT,hooksSym:WT}=hn(),{noop:zT,genLog:Ir}=Ys(),_t={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},aw={fatal:t=>{let e=Ir(_t.fatal,t);return function(...r){let n=this[HT];if(e.call(this,...r),typeof n.flushSync=="function")try{n.flushSync();}catch{}}},error:t=>Ir(_t.error,t),warn:t=>Ir(_t.warn,t),info:t=>Ir(_t.info,t),debug:t=>Ir(_t.debug,t),trace:t=>Ir(_t.trace,t)},iu=Object.keys(_t).reduce((t,e)=>(t[_t[e]]=e,t),{}),GT=Object.keys(iu).reduce((t,e)=>(t[e]='{"level":'+Number(e),t),{});function KT(t){let e=t[UT].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[jT]=n,t}function VT(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 YT(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[nu],s=this[nu]=r[t],i=this[BT],o=this[WT].logMethod;for(let l in r){if(s>r[l]){this[l]=zT;continue}this[l]=VT(l,i)?aw[l](o):Ir(r[l],o);}this.emit("level-change",t,s,e[n],n,this);}function JT(t){let{levels:e,levelVal:r}=this;return e&&e.labels?e.labels[r]:""}function XT(t){let{values:e}=this.levels,r=e[t];return r!==void 0&&r>=this[nu]}function QT(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:iu,r),s=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),e?null:_t,t);return {labels:n,values:s}}function ZT(t,e,r){if(typeof t=="number"){if(![].concat(Object.keys(e||{}).map(i=>e[i]),r?[]:Object.keys(iu).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:_t,e);if(!(t in n))throw Error(`default level:${t} must be included in custom levels`)}function e$(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")}}lw.exports={initialLsCache:GT,genLsCache:KT,levelMethods:aw,getLevel:JT,setLevel:YT,isLevelEnabled:XT,mappings:QT,levels:_t,assertNoLevelCollisions:e$,assertDefaultLevelFound:ZT};});var su=R((oM,uw)=>{uw.exports={version:"8.15.1"};});var Sw=R((lM,ww)=>{var{EventEmitter:t$}=z("events"),{lsCacheSym:r$,levelValSym:n$,setLevelSym:au,getLevelSym:cw,chindingsSym:lu,parsedChindingsSym:i$,mixinSym:s$,asJsonSym:gw,writeSym:o$,mixinMergeStrategySym:a$,timeSym:l$,timeSliceIndexSym:u$,streamSym:yw,serializersSym:kr,formattersSym:ou,errorKeySym:c$,messageKeySym:f$,useOnlyCustomLevelsSym:h$,needsMetadataGsym:p$,redactFmtSym:d$,stringifySym:g$,formatOptsSym:y$,stringifiersSym:m$,msgPrefixSym:fw}=hn(),{getLevel:v$,setLevel:w$,isLevelEnabled:S$,mappings:b$,initialLsCache:E$,genLsCache:A$,assertNoLevelCollisions:_$}=Js(),{asChindings:mw,asJson:x$,buildFormatters:hw,stringify:pw}=Ys(),{version:C$}=su(),R$=Bl(),O$=class{},vw={constructor:O$,child:P$,bindings:T$,setBindings:$$,flush:F$,isLevelEnabled:S$,version:C$,get level(){return this[cw]()},set level(t){this[au](t);},get levelVal(){return this[n$]},set levelVal(t){throw Error("levelVal is read-only")},[r$]:E$,[o$]:k$,[gw]:x$,[cw]:v$,[au]:w$};Object.setPrototypeOf(vw,t$.prototype);ww.exports=function(){return Object.create(vw)};var dw=t=>t;function P$(t,e){if(!t)throw Error("missing bindings for child Pino");e=e||{};let r=this[kr],n=this[ou],s=Object.create(this);if(e.hasOwnProperty("serializers")===!0){s[kr]=Object.create(null);for(let u in r)s[kr][u]=r[u];let c=Object.getOwnPropertySymbols(r);for(var i=0;i<c.length;i++){let u=c[i];s[kr][u]=r[u];}for(let u in e.serializers)s[kr][u]=e.serializers[u];let p=Object.getOwnPropertySymbols(e.serializers);for(var o=0;o<p.length;o++){let u=p[o];s[kr][u]=e.serializers[u];}}else s[kr]=r;if(e.hasOwnProperty("formatters")){let{level:c,bindings:p,log:u}=e.formatters;s[ou]=hw(c||n.level,p||dw,u||n.log);}else s[ou]=hw(n.level,dw,n.log);if(e.hasOwnProperty("customLevels")===!0&&(_$(this.levels,e.customLevels),s.levels=b$(e.customLevels,s[h$]),A$(s)),typeof e.redact=="object"&&e.redact!==null||Array.isArray(e.redact)){s.redact=e.redact;let c=R$(s.redact,pw),p={stringify:c[d$]};s[g$]=pw,s[m$]=c,s[y$]=p;}typeof e.msgPrefix=="string"&&(s[fw]=(this[fw]||"")+e.msgPrefix),s[lu]=mw(s,t);let l=e.level||this.level;return s[au](l),this.onChild(s),s}function T$(){let e=`{${this[lu].substr(1)}}`,r=JSON.parse(e);return delete r.pid,delete r.hostname,r}function $$(t){let e=mw(this,t);this[lu]=e,delete this[i$];}function I$(t,e){return Object.assign(e,t)}function k$(t,e,r){let n=this[l$](),s=this[s$],i=this[c$],o=this[f$],l=this[a$]||I$,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=l(c,s(c,r,this)));let p=this[gw](c,e,r,n),u=this[yw];u[p$]===!0&&(u.lastLevel=r,u.lastObj=c,u.lastMsg=e,u.lastTime=n.slice(this[u$]),u.lastLogger=this),u.write(p);}function L$(){}function F$(){let t=this[yw];"flush"in t&&t.flush(L$);}});var xw=R((hu,_w)=>{var{hasOwnProperty:Xs}=Object.prototype,Fr=fu();Fr.configure=fu;Fr.stringify=Fr;Fr.default=Fr;hu.stringify=Fr;hu.configure=fu;_w.exports=Fr;var q$=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]|[\ud800-\udbff](?![\udc00-\udfff])|(?:[^\ud800-\udbff]|^)[\udc00-\udfff]/;function gr(t){return t.length<5e3&&!q$.test(t)?`"${t}"`:JSON.stringify(t)}function uu(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 D$=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function cu(t){return D$.call(t)!==void 0&&t.length!==0}function bw(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 N$(t){if(Xs.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 Ew(t,e){let r;if(Xs.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 Aw(t,e){let r;if(Xs.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 Lr(t){return t===1?"1 item":`${t} items`}function M$(t){let e=new Set;for(let r of t)(typeof r=="string"||typeof r=="number")&&e.add(String(r));return e}function j$(t){if(Xs.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 fu(t){t={...t};let e=j$(t);e&&(t.bigint===void 0&&(t.bigint=!1),"circularValue"in t||(t.circularValue=Error));let r=N$(t),n=Ew(t,"bigint"),s=Ew(t,"deterministic"),i=Aw(t,"maximumDepth"),o=Aw(t,"maximumBreadth");function l(y,m,v,b,_,x){let A=m[y];switch(typeof A=="object"&&A!==null&&typeof A.toJSON=="function"&&(A=A.toJSON(y)),A=b.call(m,y,A),typeof A){case"string":return gr(A);case"object":{if(A===null)return "null";if(v.indexOf(A)!==-1)return r;let O="",I=",",F=x;if(Array.isArray(A)){if(A.length===0)return "[]";if(i<v.length+1)return '"[Array]"';v.push(A),_!==""&&(x+=_,O+=`
${x}`,I=`,
${x}`);let C=Math.min(A.length,o),V=0;for(;V<C-1;V++){let se=l(String(V),A,v,b,_,x);O+=se!==void 0?se:"null",O+=I;}let Y=l(String(V),A,v,b,_,x);if(O+=Y!==void 0?Y:"null",A.length-1>o){let se=A.length-o-1;O+=`${I}"... ${Lr(se)} not stringified"`;}return _!==""&&(O+=`
${F}`),v.pop(),`[${O}]`}let U=Object.keys(A),H=U.length;if(H===0)return "{}";if(i<v.length+1)return '"[Object]"';let q="",k="";_!==""&&(x+=_,I=`,
${x}`,q=" ");let j=Math.min(H,o);s&&!cu(A)&&(U=uu(U)),v.push(A);for(let C=0;C<j;C++){let V=U[C],Y=l(V,A,v,b,_,x);Y!==void 0&&(O+=`${k}${gr(V)}:${q}${Y}`,k=I);}if(H>o){let C=H-o;O+=`${k}"...":${q}"${Lr(C)} not stringified"`,k=I;}return _!==""&&k.length>1&&(O=`
${x}${O}
${F}`),v.pop(),`{${O}}`}case"number":return isFinite(A)?String(A):e?e(A):"null";case"boolean":return A===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(A);default:return e?e(A):void 0}}function c(y,m,v,b,_,x){switch(typeof m=="object"&&m!==null&&typeof m.toJSON=="function"&&(m=m.toJSON(y)),typeof m){case"string":return gr(m);case"object":{if(m===null)return "null";if(v.indexOf(m)!==-1)return r;let A=x,O="",I=",";if(Array.isArray(m)){if(m.length===0)return "[]";if(i<v.length+1)return '"[Array]"';v.push(m),_!==""&&(x+=_,O+=`
${x}`,I=`,
${x}`);let H=Math.min(m.length,o),q=0;for(;q<H-1;q++){let j=c(String(q),m[q],v,b,_,x);O+=j!==void 0?j:"null",O+=I;}let k=c(String(q),m[q],v,b,_,x);if(O+=k!==void 0?k:"null",m.length-1>o){let j=m.length-o-1;O+=`${I}"... ${Lr(j)} not stringified"`;}return _!==""&&(O+=`
${A}`),v.pop(),`[${O}]`}v.push(m);let F="";_!==""&&(x+=_,I=`,
${x}`,F=" ");let U="";for(let H of b){let q=c(H,m[H],v,b,_,x);q!==void 0&&(O+=`${U}${gr(H)}:${F}${q}`,U=I);}return _!==""&&U.length>1&&(O=`
${x}${O}
${A}`),v.pop(),`{${O}}`}case"number":return isFinite(m)?String(m):e?e(m):"null";case"boolean":return m===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(m);default:return e?e(m):void 0}}function p(y,m,v,b,_){switch(typeof m){case"string":return gr(m);case"object":{if(m===null)return "null";if(typeof m.toJSON=="function"){if(m=m.toJSON(y),typeof m!="object")return p(y,m,v,b,_);if(m===null)return "null"}if(v.indexOf(m)!==-1)return r;let x=_;if(Array.isArray(m)){if(m.length===0)return "[]";if(i<v.length+1)return '"[Array]"';v.push(m),_+=b;let q=`
${_}`,k=`,
${_}`,j=Math.min(m.length,o),C=0;for(;C<j-1;C++){let Y=p(String(C),m[C],v,b,_);q+=Y!==void 0?Y:"null",q+=k;}let V=p(String(C),m[C],v,b,_);if(q+=V!==void 0?V:"null",m.length-1>o){let Y=m.length-o-1;q+=`${k}"... ${Lr(Y)} not stringified"`;}return q+=`
${x}`,v.pop(),`[${q}]`}let A=Object.keys(m),O=A.length;if(O===0)return "{}";if(i<v.length+1)return '"[Object]"';_+=b;let I=`,
${_}`,F="",U="",H=Math.min(O,o);cu(m)&&(F+=bw(m,I,o),A=A.slice(m.length),H-=m.length,U=I),s&&(A=uu(A)),v.push(m);for(let q=0;q<H;q++){let k=A[q],j=p(k,m[k],v,b,_);j!==void 0&&(F+=`${U}${gr(k)}: ${j}`,U=I);}if(O>o){let q=O-o;F+=`${U}"...": "${Lr(q)} not stringified"`,U=I;}return U!==""&&(F=`
${_}${F}
${x}`),v.pop(),`{${F}}`}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(y,m,v){switch(typeof m){case"string":return gr(m);case"object":{if(m===null)return "null";if(typeof m.toJSON=="function"){if(m=m.toJSON(y),typeof m!="object")return u(y,m,v);if(m===null)return "null"}if(v.indexOf(m)!==-1)return r;let b="";if(Array.isArray(m)){if(m.length===0)return "[]";if(i<v.length+1)return '"[Array]"';v.push(m);let I=Math.min(m.length,o),F=0;for(;F<I-1;F++){let H=u(String(F),m[F],v);b+=H!==void 0?H:"null",b+=",";}let U=u(String(F),m[F],v);if(b+=U!==void 0?U:"null",m.length-1>o){let H=m.length-o-1;b+=`,"... ${Lr(H)} not stringified"`;}return v.pop(),`[${b}]`}let _=Object.keys(m),x=_.length;if(x===0)return "{}";if(i<v.length+1)return '"[Object]"';let A="",O=Math.min(x,o);cu(m)&&(b+=bw(m,",",o),_=_.slice(m.length),O-=m.length,A=","),s&&(_=uu(_)),v.push(m);for(let I=0;I<O;I++){let F=_[I],U=u(F,m[F],v);U!==void 0&&(b+=`${A}${gr(F)}:${U}`,A=",");}if(x>o){let I=x-o;b+=`${A}"...":"${Lr(I)} not stringified"`;}return v.pop(),`{${b}}`}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 g(y,m,v){if(arguments.length>1){let b="";if(typeof v=="number"?b=" ".repeat(Math.min(v,10)):typeof v=="string"&&(b=v.slice(0,10)),m!=null){if(typeof m=="function")return l("",{"":y},[],m,b,"");if(Array.isArray(m))return c("",y,[],M$(m),b,"")}if(b.length!==0)return p("",y,[],b,"")}return u("",y,[])}return g}});var Ow=R((uM,Rw)=>{var pu=Symbol.for("pino.metadata"),{levels:Cw}=Js(),B$=Cw.info;function H$(t,e){let r=0;t=t||[],e=e||{dedupe:!1};let n=Object.create(Cw);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:l,flushSync:o,end:c,minLevel:0,streams:[],clone:p,[pu]:!0,streamLevels:n};return Array.isArray(t)?t.forEach(l,s):l.call(s,t),t=null,s;function i(u){let g,y=this.lastLevel,{streams:m}=this,v=0,b;for(let _=W$(m.length,e.dedupe);G$(_,m.length,e.dedupe);_=z$(_,e.dedupe))if(g=m[_],g.level<=y){if(v!==0&&v!==g.level)break;if(b=g.stream,b[pu]){let{lastTime:x,lastMsg:A,lastObj:O,lastLogger:I}=this;b.lastLevel=y,b.lastTime=x,b.lastMsg=A,b.lastObj=O,b.lastLogger=I;}b.write(u),e.dedupe&&(v=g.level);}else if(!e.dedupe)break}function o(){for(let{stream:u}of this.streams)typeof u.flushSync=="function"&&u.flushSync();}function l(u){if(!u)return s;let g=typeof u.write=="function"||u.stream,y=u.write?u:u.stream;if(!g)throw Error("stream object needs to implement either StreamEntry or DestinationStream interface");let{streams:m,streamLevels:v}=this,b;typeof u.levelVal=="number"?b=u.levelVal:typeof u.level=="string"?b=v[u.level]:typeof u.level=="number"?b=u.level:b=B$;let _={stream:y,level:b,levelVal:void 0,id:r++};return m.unshift(_),m.sort(U$),this.minLevel=m[0].level,s}function c(){for(let{stream:u}of this.streams)typeof u.flushSync=="function"&&u.flushSync(),u.end();}function p(u){let g=new Array(this.streams.length);for(let y=0;y<g.length;y++)g[y]={level:u,stream:this.streams[y].stream};return {write:i,add:l,minLevel:u,streams:g,clone:p,flushSync:o,[pu]:!0}}}function U$(t,e){return t.level-e.level}function W$(t,e){return e?t-1:0}function z$(t,e){return e?t-1:t+1}function G$(t,e,r){return r?t>=0:t<e}Rw.exports=H$;});var Bw=R((cM,vt)=>{var K$=z("os"),qw=kl(),V$=Ll(),Y$=Bl(),Dw=xv(),J$=Sw(),Nw=hn(),{configure:X$}=xw(),{assertDefaultLevelFound:Q$,mappings:Mw,genLsCache:Z$,levels:eI}=Js(),{createArgsNormalizer:tI,asChindings:rI,buildSafeSonicBoom:Pw,buildFormatters:nI,stringify:du,normalizeDestFileDescriptor:Tw,noop:iI}=Ys(),{version:sI}=su(),{chindingsSym:$w,redactFmtSym:oI,serializersSym:Iw,timeSym:aI,timeSliceIndexSym:lI,streamSym:uI,stringifySym:kw,stringifySafeSym:gu,stringifiersSym:Lw,setLevelSym:cI,endSym:fI,formatOptsSym:hI,messageKeySym:pI,errorKeySym:dI,nestedKeySym:gI,mixinSym:yI,useOnlyCustomLevelsSym:mI,formattersSym:Fw,hooksSym:vI,nestedKeyStrSym:wI,mixinMergeStrategySym:SI,msgPrefixSym:bI}=Nw,{epochTime:jw,nullTime:EI}=Dw,{pid:AI}=process,_I=K$.hostname(),xI=qw.err,CI={level:"info",levels:eI,messageKey:"msg",errorKey:"err",nestedKey:null,enabled:!0,base:{pid:AI,hostname:_I},serializers:Object.assign(Object.create(null),{err:xI}),formatters:Object.assign(Object.create(null),{bindings(t){return t},level(t,e){return {level:e}}}),hooks:{logMethod:void 0},timestamp:jw,name:void 0,redact:null,customLevels:null,useOnlyCustomLevels:!1,depthLimit:5,edgeLimit:100},RI=tI(CI),OI=Object.assign(Object.create(null),qw);function yu(...t){let e={},{opts:r,stream:n}=RI(e,V$(),...t),{redact:s,crlf:i,serializers:o,timestamp:l,messageKey:c,errorKey:p,nestedKey:u,base:g,name:y,level:m,customLevels:v,mixin:b,mixinMergeStrategy:_,useOnlyCustomLevels:x,formatters:A,hooks:O,depthLimit:I,edgeLimit:F,onChild:U,msgPrefix:H}=r,q=X$({maximumDepth:I,maximumBreadth:F}),k=nI(A.level,A.bindings,A.log),j=du.bind({[gu]:q}),C=s?Y$(s,j):{},V=s?{stringify:C[oI]}:{stringify:j},Y="}"+(i?`\r
`:`
`),se=rI.bind(null,{[$w]:"",[Iw]:o,[Lw]:C,[kw]:du,[gu]:q,[Fw]:k}),T="";g!==null&&(y===void 0?T=se(g):T=se(Object.assign({},g,{name:y})));let $=l instanceof Function?l:l?jw:EI,te=$().indexOf(":")+1;if(x&&!v)throw Error("customLevels is required if useOnlyCustomLevels is set true");if(b&&typeof b!="function")throw Error(`Unknown mixin type "${typeof b}" - expected "function"`);if(H&&typeof H!="string")throw Error(`Unknown msgPrefix type "${typeof H}" - expected "string"`);Q$(m,v,x);let Q=Mw(v,x);return Object.assign(e,{levels:Q,[mI]:x,[uI]:n,[aI]:$,[lI]:te,[kw]:du,[gu]:q,[Lw]:C,[fI]:Y,[hI]:V,[pI]:c,[dI]:p,[gI]:u,[wI]:u?`,${JSON.stringify(u)}:{`:"",[Iw]:o,[yI]:b,[SI]:_,[$w]:T,[Fw]:k,[vI]:O,silent:iI,onChild:U,[bI]:H}),Object.setPrototypeOf(e,J$()),Z$(e),e[cI](m),e}vt.exports=yu;vt.exports.destination=(t=process.stdout.fd)=>typeof t=="object"?(t.dest=Tw(t.dest||process.stdout.fd),Pw(t)):Pw({dest:Tw(t),minLength:0});vt.exports.transport=Zl();vt.exports.multistream=Ow();vt.exports.levels=Mw();vt.exports.stdSerializers=OI;vt.exports.stdTimeFunctions=Object.assign({},Dw);vt.exports.symbols=Nw;vt.exports.version=sI;vt.exports.default=yu;vt.exports.pino=yu;});var Vw={};Wo(Vw,{RotatingFileStream:()=>eo,RotatingFileStreamError:()=>ai,createStream:()=>KI});async function Uw(t){return new Promise(e=>fs.access(t,fs.constants.F_OK,r=>e(!r)))}function Ww(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 vu(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 Kw(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 wu(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 HI(t){let e=Kw(t,"interval",BI);switch(e.unit){case"h":wu(e,"hours",24);break;case"m":wu(e,"minutes",60);break;case"s":wu(e,"seconds",60);break}return e}function zw(t){let e=Kw(t,"size",UI);return e.unit==="K"?e.num*1024:e.unit==="M"?e.num*1048576:e.unit==="G"?e.num*1073741824:e.num}function WI(t){let e={};for(let r in t){let n=t[r],s=typeof n;if(!(r in Gw))throw new Error(`Unknown option: ${r}`);e[r]=t[r],Gw[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 zI(t,e,r){return n=>n?`${t}.${n}${e&&!r?".gz":""}`:t}function GI(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),l=n(s.getDate()),c=n(s.getHours()),p=n(s.getMinutes());return o+l+"-"+c+p+"-"+n(i)+"-"+t+(e&&!r?".gz":"")}}function KI(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=WI(e),{compress:n,omitExtension:s}=r,i;if(typeof t=="string")i=e.rotate?zI(t,n!==void 0,s):GI(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 eo(i,r)}var ai,eo,BI,UI,Gw,Yw=qi(()=>{ai=class extends Error{constructor(){super("Too many destination file attempts");ne(this,"code","RFS-TOO-MANY");}},eo=class extends stream.Writable{constructor(r,n){let{encoding:s,history:i,maxFiles:o,maxSize:l,path:c}=n;super({decodeStrings:!0,defaultEncoding:s});ne(this,"createGzip");ne(this,"exec");ne(this,"file");ne(this,"filename");ne(this,"finished");ne(this,"fsCreateReadStream");ne(this,"fsCreateWriteStream");ne(this,"fsOpen");ne(this,"fsReadFile");ne(this,"fsStat");ne(this,"fsUnlink");ne(this,"generator");ne(this,"initPromise");ne(this,"last");ne(this,"maxTimeout");ne(this,"next");ne(this,"options");ne(this,"prev");ne(this,"rotation");ne(this,"size");ne(this,"stdout");ne(this,"timeout");ne(this,"timeoutPromise");this.createGzip=zlib.createGzip,this.exec=child_process.exec,this.filename=c+r(null),this.fsCreateReadStream=fs.createReadStream,this.fsCreateWriteStream=fs.createWriteStream,this.fsOpen=promises.open,this.fsReadFile=promises.readFile,this.fsStat=promises.stat,this.fsUnlink=promises.unlink,this.generator=r,this.maxTimeout=2147483640,this.options=n,this.stdout=process.stdout,(o||l)&&(n.history=c+(i||this.generator(null)+".txt")),this.on("close",()=>this.finished?null:this.emit("finish")),this.on("finish",()=>this.finished=this.clear()),(async()=>{try{this.initPromise=this.init(),await this.initPromise,delete this.initPromise;}catch{}})();}_destroy(r,n){this.refinal(r,n);}_final(r){this.refinal(void 0,r);}_write(r,n,s){this.rewrite([{chunk:r,encoding:n}],0,s);}_writev(r,n){this.rewrite(r,0,n);}async refinal(r,n){try{this.clear(),this.initPromise&&await this.initPromise,this.timeoutPromise&&await this.timeoutPromise,await this.reclose();}catch(s){return n(r||s)}n(r);}async rewrite(r,n,s){let{size:i,teeToStdout:o}=this.options;try{this.initPromise&&await this.initPromise;for(let l=0;l<r.length;++l){let{chunk:c}=r[l];this.size+=c.length,this.timeoutPromise&&await this.timeoutPromise,await this.file.write(c),o&&!this.stdout.destroyed&&this.stdout.write(c),i&&this.size>=i&&await this.rotate();}}catch(l){return s(l)}s();}async init(){let{immutable:r,initialRotation:n,interval:s,size:i}=this.options;if(r)return new Promise((l,c)=>process.nextTick(()=>this.immutate(!0).then(l).catch(c)));let o;try{o=await promises.stat(this.filename);}catch(l){if(l.code!=="ENOENT")throw l;return this.reopen(0)}if(!o.isFile())throw new Error(`Can't write on: ${this.filename} (it is not a file)`);if(n){this.intervalBounds(this.now());let l=this.prev;if(this.intervalBounds(new Date(o.mtime.getTime())),l!==this.prev)return this.rotate()}return this.size=o.size,!i||o.size<i?this.reopen(o.size):(s&&this.intervalBounds(this.now()),this.rotate())}async makePath(r){return promises.mkdir(r.split(path.sep).slice(0,-1).join(path.sep),{recursive:!0})}async reopen(r){let n;try{n=await promises.open(this.filename,"a",this.options.mode);}catch(s){if(s.code!=="ENOENT")throw s;await this.makePath(this.filename),n=await promises.open(this.filename,"a",this.options.mode);}this.file=n,this.size=r,this.interval(),this.emit("open",this.filename);}async reclose(){let{file:r}=this;if(r)return delete this.file,r.close()}now(){return new Date}async rotate(){let{immutable:r,rotate:n}=this.options;return this.size=0,this.rotation=this.now(),this.clear(),this.emit("rotation"),await this.reclose(),n?this.classical():r?this.immutate(!1):this.move()}async findName(){let{interval:r,path:n,intervalBoundary:s}=this.options;for(let i=1;i<1e3;++i){let o=n+this.generator(r&&s?new Date(this.prev):this.rotation,i);if(!await Uw(o))return o}throw new ai}async move(){let{compress:r}=this.options,n=await this.findName();return await this.touch(n),r?await this.compress(n):await promises.rename(this.filename,n),this.rotated(n)}async touch(r){let n;try{n=await this.fsOpen(r,"a");}catch(s){if(s.code!=="ENOENT")throw s;await this.makePath(r),n=await promises.open(r,"a");}return await n.close(),this.unlink(r)}async classical(){let{compress:r,path:n,rotate:s}=this.options,i="";for(let o=s;o>0;--o){let l=n+this.generator(o),c=o===1?this.filename:n+this.generator(o-1);if(await Uw(c))if(i||(i=l),o===1&&r)await this.compress(l);else try{await promises.rename(c,l);}catch(p){if(p.code!=="ENOENT")throw p;await this.makePath(l),await promises.rename(c,l);}}return this.rotated(i)}clear(){return this.timeout&&(clearTimeout(this.timeout),this.timeout=null),!0}intervalBoundsBig(r){let n=r.getFullYear(),s=r.getMonth(),i=r.getDate(),o=r.getHours(),{num:l,unit:c}=this.options.interval;c==="M"?(i=1,o=0):c==="d"?o=0:o=parseInt(o/l,10)*l,this.prev=new Date(n,s,i,o,0,0,0).getTime(),c==="M"?s+=l:c==="d"?i+=l:o+=l,this.next=new Date(n,s,i,o,0,0,0).getTime();}intervalBounds(r){let n=this.options.interval.unit;if(n==="M"||n==="d"||n==="h")this.intervalBoundsBig(r);else {let s=1e3*this.options.interval.num;n==="m"&&(s*=60),this.prev=parseInt(r.getTime()/s,10)*s,this.next=this.prev+s;}return new Date(this.prev)}interval(){if(!this.options.interval)return;this.intervalBounds(this.now());let r=async()=>{let n=this.next-this.now().getTime();if(n<=0)try{this.timeoutPromise=this.rotate(),await this.timeoutPromise,delete this.timeoutPromise;}catch{}else this.timeout=setTimeout(r,n>this.maxTimeout?this.maxTimeout:n),this.timeout.unref();};r();}async compress(r){let{compress:n}=this.options;return typeof n=="function"?await new Promise((s,i)=>{this.exec(n(this.filename,r),(o,l,c)=>{this.emit("external",l,c),o?i(o):s();});}):await this.gzip(r),this.unlink(this.filename)}async gzip(r){let{mode:n}=this.options,s=n?{mode:n}:{},i=this.fsCreateReadStream(this.filename,{}),o=this.fsCreateWriteStream(r,s),l=this.createGzip();return new Promise((c,p)=>{[i,o,l].map(u=>u.once("error",p)),o.once("finish",c),i.pipe(l).pipe(o);})}async rotated(r){let{maxFiles:n,maxSize:s}=this.options;return (n||s)&&await this.history(r),this.emit("rotated",r),this.reopen(0)}async history(r){let{history:n,maxFiles:s,maxSize:i}=this.options,o=[],l=[r];try{l=[...(await this.fsReadFile(n,"utf8")).toString().split(`
`),r];}catch(c){if(c.code!=="ENOENT")throw c}for(let c of l)if(c)try{let p=await this.fsStat(c);p.isFile()?o.push({name:c,size:p.size,time:p.ctime.getTime()}):this.emit("warning",new Error(`File '${c}' contained in history is not a regular file`));}catch(p){if(p.code!=="ENOENT")throw p}if(o.sort((c,p)=>c.time-p.time),s)for(;o.length>s;){let c=o.shift();await this.unlink(c.name),this.emit("removed",c.name,!0);}if(i)for(;o.reduce((c,p)=>c+p.size,0)>i;){let c=o.shift();await this.unlink(c.name),this.emit("removed",c.name,!1);}await promises.writeFile(n,o.map(c=>c.name).join(`
`)+`
`,"utf-8"),this.emit("history");}async immutate(r){let{size:n}=this.options,s=this.now();for(let i=1;i<1e3;++i){let o=0,l;this.filename=this.options.path+this.generator(s,i);try{l=await this.fsStat(this.filename);}catch(c){if(c.code!=="ENOENT")throw c}if(l){if(o=l.size,!l.isFile())throw new Error(`Can't write on: '${this.filename}' (it is not a file)`);if(n&&o>=n)continue}if(r)return this.last=this.filename,this.reopen(o);await this.rotated(this.last),this.last=this.filename;return}throw new ai}async unlink(r){try{await this.fsUnlink(r);}catch(n){if(n.code!=="ENOENT")throw n;this.emit("warning",n);}}};BI={M:!0,d:!0,h:!0,m:!0,s:!0};UI={B:!0,G:!0,K:!0,M:!0};Gw={encoding:(t,e,r)=>new util.TextDecoder(r),immutable:()=>{},initialRotation:()=>{},interval:vu("interval",HI),intervalBoundary:()=>{},maxFiles:Ww("maxFiles"),maxSize:vu("maxSize",zw),mode:()=>{},omitExtension:()=>{},rotate:Ww("rotate"),size:vu("size",zw),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 Zw={};Wo(Zw,{allLoggers:()=>gn,rootLogger:()=>Ce});var to,Jw,Xw,Ce,gn,Nt=qi(()=>{to=Nn(Bw());Jn();Jw=(Yw(),zo(Vw)).createStream("tabby-agent.log",{path:z("path").join(z("os").homedir(),".tabby-client","agent","logs"),size:"10M",interval:"1d"}),Xw={serializers:{error:to.default.stdSerializers.err}},Ce=Jw?(0, to.default)(Xw,Jw):(0, to.default)(Xw);Ce.level="silent";gn=[Ce];Ce.onChild=t=>{gn.push(t);};});var tS=R((OM,eS)=>{eS.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,l,c){this.message=n,this.expected=s,this.found=i,this.offset=o,this.line=l,this.column=c,this.name="SyntaxError";}t(e,Error);function r(n){var s=arguments.length>1?arguments[1]:{},i={},o={start:sf},l=sf,p=function(){return _f},u=i,g="#",y={type:"literal",value:"#",description:'"#"'},m=void 0,v={type:"any",description:"any character"},b="[",_={type:"literal",value:"[",description:'"["'},x="]",A={type:"literal",value:"]",description:'"]"'},O=function(a){Ho(je("ObjectPath",a,Ne,Me));},I=function(a){Ho(je("ArrayPath",a,Ne,Me));},F=function(a,h){return a.concat(h)},U=function(a){return [a]},H=function(a){return a},q=".",k={type:"literal",value:".",description:'"."'},j="=",C={type:"literal",value:"=",description:'"="'},V=function(a,h){Ho(je("Assign",h,Ne,Me,a));},Y=function(a){return a.join("")},se=function(a){return a.value},T='"""',$={type:"literal",value:'"""',description:'"\\"\\"\\""'},te=null,Q=function(a){return je("String",a.join(""),Ne,Me)},ue='"',Ge={type:"literal",value:'"',description:'"\\""'},Oe="'''",Qt={type:"literal",value:"'''",description:`"'''"`},Pn="'",Zt={type:"literal",value:"'",description:`"'"`},St=function(a){return a},ce=function(a){return a},zr="\\",Fo={type:"literal",value:"\\",description:'"\\\\"'},K=function(){return ""},me="e",W={type:"literal",value:"e",description:'"e"'},le="E",we={type:"literal",value:"E",description:'"E"'},De=function(a,h){return je("Float",parseFloat(a+"e"+h),Ne,Me)},_e=function(a){return je("Float",parseFloat(a),Ne,Me)},Er="+",er={type:"literal",value:"+",description:'"+"'},Fc=function(a){return a.join("")},Tn="-",$n={type:"literal",value:"-",description:'"-"'},qc=function(a){return "-"+a.join("")},$0=function(a){return je("Integer",parseInt(a,10),Ne,Me)},Dc="true",I0={type:"literal",value:"true",description:'"true"'},k0=function(){return je("Boolean",!0,Ne,Me)},Nc="false",L0={type:"literal",value:"false",description:'"false"'},F0=function(){return je("Boolean",!1,Ne,Me)},q0=function(){return je("Array",[],Ne,Me)},D0=function(a){return je("Array",a?[a]:[],Ne,Me)},N0=function(a){return je("Array",a,Ne,Me)},M0=function(a,h){return je("Array",a.concat(h),Ne,Me)},Mc=function(a){return a},jc=",",Bc={type:"literal",value:",",description:'","'},j0="{",B0={type:"literal",value:"{",description:'"{"'},H0="}",U0={type:"literal",value:"}",description:'"}"'},W0=function(a){return je("InlineTable",a,Ne,Me)},Hc=function(a,h){return je("InlineTableValue",h,Ne,Me,a)},z0=function(a){return "."+a},G0=function(a){return a.join("")},In=":",kn={type:"literal",value:":",description:'":"'},Uc=function(a){return a.join("")},Wc="T",zc={type:"literal",value:"T",description:'"T"'},K0="Z",V0={type:"literal",value:"Z",description:'"Z"'},Y0=function(a,h){return je("Date",new Date(a+"T"+h+"Z"),Ne,Me)},J0=function(a,h){return je("Date",new Date(a+"T"+h),Ne,Me)},X0=/^[ \t]/,Q0={type:"class",value:"[ \\t]",description:"[ \\t]"},Gc=`
`,Kc={type:"literal",value:`
`,description:'"\\n"'},Z0="\r",eE={type:"literal",value:"\r",description:'"\\r"'},tE=/^[0-9a-f]/i,rE={type:"class",value:"[0-9a-f]i",description:"[0-9a-f]i"},nE=/^[0-9]/,iE={type:"class",value:"[0-9]",description:"[0-9]"},sE="_",oE={type:"literal",value:"_",description:'"_"'},aE=function(){return ""},lE=/^[A-Za-z0-9_\-]/,uE={type:"class",value:"[A-Za-z0-9_\\-]",description:"[A-Za-z0-9_\\-]"},cE=function(a){return a.join("")},Vc='\\"',fE={type:"literal",value:'\\"',description:'"\\\\\\""'},hE=function(){return '"'},Yc="\\\\",pE={type:"literal",value:"\\\\",description:'"\\\\\\\\"'},dE=function(){return "\\"},Jc="\\b",gE={type:"literal",value:"\\b",description:'"\\\\b"'},yE=function(){return "\b"},Xc="\\t",mE={type:"literal",value:"\\t",description:'"\\\\t"'},vE=function(){return " "},Qc="\\n",wE={type:"literal",value:"\\n",description:'"\\\\n"'},SE=function(){return `
`},Zc="\\f",bE={type:"literal",value:"\\f",description:'"\\\\f"'},EE=function(){return "\f"},ef="\\r",AE={type:"literal",value:"\\r",description:'"\\\\r"'},_E=function(){return "\r"},tf="\\U",xE={type:"literal",value:"\\U",description:'"\\\\U"'},rf=function(a){return zE(a.join(""))},nf="\\u",CE={type:"literal",value:"\\u",description:'"\\\\u"'},f=0,J=0,Ln=0,qo={line:1,column:1,seenCR:!1},$i=0,Do=[],N=0,M={},Ii;if("startRule"in s){if(!(s.startRule in o))throw new Error(`Can't start parsing from rule "`+s.startRule+'".');l=o[s.startRule];}function Ne(){return No(J).line}function Me(){return No(J).column}function No(a){function h(d,w,E){var P,L;for(P=w;P<E;P++)L=n.charAt(P),L===`
`?(d.seenCR||d.line++,d.column=1,d.seenCR=!1):L==="\r"||L==="\u2028"||L==="\u2029"?(d.line++,d.column=1,d.seenCR=!0):(d.column++,d.seenCR=!1);}return Ln!==a&&(Ln>a&&(Ln=0,qo={line:1,column:1,seenCR:!1}),h(qo,Ln,a),Ln=a),qo}function B(a){f<$i||(f>$i&&($i=f,Do=[]),Do.push(a));}function Mo(a,h,d){function w(G){var ie=1;for(G.sort(function(de,he){return de.description<he.description?-1:de.description>he.description?1:0});ie<G.length;)G[ie-1]===G[ie]?G.splice(ie,1):ie++;}function E(G,ie){function de(Kr){function tr(ot){return ot.charCodeAt(0).toString(16).toUpperCase()}return Kr.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(ot){return "\\x0"+tr(ot)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(ot){return "\\x"+tr(ot)}).replace(/[\u0180-\u0FFF]/g,function(ot){return "\\u0"+tr(ot)}).replace(/[\u1080-\uFFFF]/g,function(ot){return "\\u"+tr(ot)})}var he=new Array(G.length),Ee,xe,st;for(st=0;st<G.length;st++)he[st]=G[st].description;return Ee=G.length>1?he.slice(0,-1).join(", ")+" or "+he[G.length-1]:he[0],xe=ie?'"'+de(ie)+'"':"end of input","Expected "+Ee+" but "+xe+" found."}var P=No(d),L=d<n.length?n.charAt(d):null;return h!==null&&w(h),new e(a!==null?a:E(h,L),h,L,d,P.line,P.column)}function sf(){var a,h,d,w=f*49+0,E=M[w];if(E)return f=E.nextPos,E.result;for(a=f,h=[],d=of();d!==i;)h.push(d),d=of();return h!==i&&(J=a,h=p()),a=h,M[w]={nextPos:f,result:a},a}function of(){var a,h,d,w,E,P,L,G=f*49+1,ie=M[G];if(ie)return f=ie.nextPos,ie.result;for(a=f,h=[],d=X();d!==i;)h.push(d),d=X();if(h!==i)if(d=RE(),d!==i){for(w=[],E=X();E!==i;)w.push(E),E=X();if(w!==i){for(E=[],P=ki();P!==i;)E.push(P),P=ki();if(E!==i){if(P=[],L=gt(),L!==i)for(;L!==i;)P.push(L),L=gt();else P=u;P===i&&(P=Fi()),P!==i?(h=[h,d,w,E,P],a=h):(f=a,a=u);}else f=a,a=u;}else f=a,a=u;}else f=a,a=u;else f=a,a=u;if(a===i){if(a=f,h=[],d=X(),d!==i)for(;d!==i;)h.push(d),d=X();else h=u;if(h!==i){if(d=[],w=gt(),w!==i)for(;w!==i;)d.push(w),w=gt();else d=u;d===i&&(d=Fi()),d!==i?(h=[h,d],a=h):(f=a,a=u);}else f=a,a=u;a===i&&(a=gt());}return M[G]={nextPos:f,result:a},a}function RE(){var a,h=f*49+2,d=M[h];return d?(f=d.nextPos,d.result):(a=ki(),a===i&&(a=OE(),a===i&&(a=PE(),a===i&&(a=TE()))),M[h]={nextPos:f,result:a},a)}function ki(){var a,h,d,w,E,P,L=f*49+3,G=M[L];if(G)return f=G.nextPos,G.result;if(a=f,n.charCodeAt(f)===35?(h=g,f++):(h=i,N===0&&B(y)),h!==i){for(d=[],w=f,E=f,N++,P=gt(),P===i&&(P=Fi()),N--,P===i?E=m:(f=E,E=u),E!==i?(n.length>f?(P=n.charAt(f),f++):(P=i,N===0&&B(v)),P!==i?(E=[E,P],w=E):(f=w,w=u)):(f=w,w=u);w!==i;)d.push(w),w=f,E=f,N++,P=gt(),P===i&&(P=Fi()),N--,P===i?E=m:(f=E,E=u),E!==i?(n.length>f?(P=n.charAt(f),f++):(P=i,N===0&&B(v)),P!==i?(E=[E,P],w=E):(f=w,w=u)):(f=w,w=u);d!==i?(h=[h,d],a=h):(f=a,a=u);}else f=a,a=u;return M[L]={nextPos:f,result:a},a}function OE(){var a,h,d,w,E,P,L=f*49+4,G=M[L];if(G)return f=G.nextPos,G.result;if(a=f,n.charCodeAt(f)===91?(h=b,f++):(h=i,N===0&&B(_)),h!==i){for(d=[],w=X();w!==i;)d.push(w),w=X();if(d!==i)if(w=af(),w!==i){for(E=[],P=X();P!==i;)E.push(P),P=X();E!==i?(n.charCodeAt(f)===93?(P=x,f++):(P=i,N===0&&B(A)),P!==i?(J=a,h=O(w),a=h):(f=a,a=u)):(f=a,a=u);}else f=a,a=u;else f=a,a=u;}else f=a,a=u;return M[L]={nextPos:f,result:a},a}function PE(){var a,h,d,w,E,P,L,G,ie=f*49+5,de=M[ie];if(de)return f=de.nextPos,de.result;if(a=f,n.charCodeAt(f)===91?(h=b,f++):(h=i,N===0&&B(_)),h!==i)if(n.charCodeAt(f)===91?(d=b,f++):(d=i,N===0&&B(_)),d!==i){for(w=[],E=X();E!==i;)w.push(E),E=X();if(w!==i)if(E=af(),E!==i){for(P=[],L=X();L!==i;)P.push(L),L=X();P!==i?(n.charCodeAt(f)===93?(L=x,f++):(L=i,N===0&&B(A)),L!==i?(n.charCodeAt(f)===93?(G=x,f++):(G=i,N===0&&B(A)),G!==i?(J=a,h=I(E),a=h):(f=a,a=u)):(f=a,a=u)):(f=a,a=u);}else f=a,a=u;else f=a,a=u;}else f=a,a=u;else f=a,a=u;return M[ie]={nextPos:f,result:a},a}function af(){var a,h,d,w=f*49+6,E=M[w];if(E)return f=E.nextPos,E.result;if(a=f,h=[],d=uf(),d!==i)for(;d!==i;)h.push(d),d=uf();else h=u;return h!==i?(d=lf(),d!==i?(J=a,h=F(h,d),a=h):(f=a,a=u)):(f=a,a=u),a===i&&(a=f,h=lf(),h!==i&&(J=a,h=U(h)),a=h),M[w]={nextPos:f,result:a},a}function lf(){var a,h,d,w,E,P=f*49+7,L=M[P];if(L)return f=L.nextPos,L.result;for(a=f,h=[],d=X();d!==i;)h.push(d),d=X();if(h!==i)if(d=Fn(),d!==i){for(w=[],E=X();E!==i;)w.push(E),E=X();w!==i?(J=a,h=H(d),a=h):(f=a,a=u);}else f=a,a=u;else f=a,a=u;if(a===i){for(a=f,h=[],d=X();d!==i;)h.push(d),d=X();if(h!==i)if(d=jo(),d!==i){for(w=[],E=X();E!==i;)w.push(E),E=X();w!==i?(J=a,h=H(d),a=h):(f=a,a=u);}else f=a,a=u;else f=a,a=u;}return M[P]={nextPos:f,result:a},a}function uf(){var a,h,d,w,E,P,L,G=f*49+8,ie=M[G];if(ie)return f=ie.nextPos,ie.result;for(a=f,h=[],d=X();d!==i;)h.push(d),d=X();if(h!==i)if(d=Fn(),d!==i){for(w=[],E=X();E!==i;)w.push(E),E=X();if(w!==i)if(n.charCodeAt(f)===46?(E=q,f++):(E=i,N===0&&B(k)),E!==i){for(P=[],L=X();L!==i;)P.push(L),L=X();P!==i?(J=a,h=H(d),a=h):(f=a,a=u);}else f=a,a=u;else f=a,a=u;}else f=a,a=u;else f=a,a=u;if(a===i){for(a=f,h=[],d=X();d!==i;)h.push(d),d=X();if(h!==i)if(d=jo(),d!==i){for(w=[],E=X();E!==i;)w.push(E),E=X();if(w!==i)if(n.charCodeAt(f)===46?(E=q,f++):(E=i,N===0&&B(k)),E!==i){for(P=[],L=X();L!==i;)P.push(L),L=X();P!==i?(J=a,h=H(d),a=h):(f=a,a=u);}else f=a,a=u;else f=a,a=u;}else f=a,a=u;else f=a,a=u;}return M[G]={nextPos:f,result:a},a}function TE(){var a,h,d,w,E,P,L=f*49+9,G=M[L];if(G)return f=G.nextPos,G.result;if(a=f,h=Fn(),h!==i){for(d=[],w=X();w!==i;)d.push(w),w=X();if(d!==i)if(n.charCodeAt(f)===61?(w=j,f++):(w=i,N===0&&B(C)),w!==i){for(E=[],P=X();P!==i;)E.push(P),P=X();E!==i?(P=Gr(),P!==i?(J=a,h=V(h,P),a=h):(f=a,a=u)):(f=a,a=u);}else f=a,a=u;else f=a,a=u;}else f=a,a=u;if(a===i)if(a=f,h=jo(),h!==i){for(d=[],w=X();w!==i;)d.push(w),w=X();if(d!==i)if(n.charCodeAt(f)===61?(w=j,f++):(w=i,N===0&&B(C)),w!==i){for(E=[],P=X();P!==i;)E.push(P),P=X();E!==i?(P=Gr(),P!==i?(J=a,h=V(h,P),a=h):(f=a,a=u)):(f=a,a=u);}else f=a,a=u;else f=a,a=u;}else f=a,a=u;return M[L]={nextPos:f,result:a},a}function Fn(){var a,h,d,w=f*49+10,E=M[w];if(E)return f=E.nextPos,E.result;if(a=f,h=[],d=Ef(),d!==i)for(;d!==i;)h.push(d),d=Ef();else h=u;return h!==i&&(J=a,h=Y(h)),a=h,M[w]={nextPos:f,result:a},a}function jo(){var a,h,d=f*49+11,w=M[d];return w?(f=w.nextPos,w.result):(a=f,h=cf(),h!==i&&(J=a,h=se(h)),a=h,a===i&&(a=f,h=ff(),h!==i&&(J=a,h=se(h)),a=h),M[d]={nextPos:f,result:a},a)}function Gr(){var a,h=f*49+12,d=M[h];return d?(f=d.nextPos,d.result):(a=$E(),a===i&&(a=HE(),a===i&&(a=FE(),a===i&&(a=qE(),a===i&&(a=DE(),a===i&&(a=NE(),a===i&&(a=ME())))))),M[h]={nextPos:f,result:a},a)}function $E(){var a,h=f*49+13,d=M[h];return d?(f=d.nextPos,d.result):(a=IE(),a===i&&(a=cf(),a===i&&(a=kE(),a===i&&(a=ff()))),M[h]={nextPos:f,result:a},a)}function IE(){var a,h,d,w,E,P=f*49+14,L=M[P];if(L)return f=L.nextPos,L.result;if(a=f,n.substr(f,3)===T?(h=T,f+=3):(h=i,N===0&&B($)),h!==i)if(d=gt(),d===i&&(d=te),d!==i){for(w=[],E=df();E!==i;)w.push(E),E=df();w!==i?(n.substr(f,3)===T?(E=T,f+=3):(E=i,N===0&&B($)),E!==i?(J=a,h=Q(w),a=h):(f=a,a=u)):(f=a,a=u);}else f=a,a=u;else f=a,a=u;return M[P]={nextPos:f,result:a},a}function cf(){var a,h,d,w,E=f*49+15,P=M[E];if(P)return f=P.nextPos,P.result;if(a=f,n.charCodeAt(f)===34?(h=ue,f++):(h=i,N===0&&B(Ge)),h!==i){for(d=[],w=hf();w!==i;)d.push(w),w=hf();d!==i?(n.charCodeAt(f)===34?(w=ue,f++):(w=i,N===0&&B(Ge)),w!==i?(J=a,h=Q(d),a=h):(f=a,a=u)):(f=a,a=u);}else f=a,a=u;return M[E]={nextPos:f,result:a},a}function kE(){var a,h,d,w,E,P=f*49+16,L=M[P];if(L)return f=L.nextPos,L.result;if(a=f,n.substr(f,3)===Oe?(h=Oe,f+=3):(h=i,N===0&&B(Qt)),h!==i)if(d=gt(),d===i&&(d=te),d!==i){for(w=[],E=gf();E!==i;)w.push(E),E=gf();w!==i?(n.substr(f,3)===Oe?(E=Oe,f+=3):(E=i,N===0&&B(Qt)),E!==i?(J=a,h=Q(w),a=h):(f=a,a=u)):(f=a,a=u);}else f=a,a=u;else f=a,a=u;return M[P]={nextPos:f,result:a},a}function ff(){var a,h,d,w,E=f*49+17,P=M[E];if(P)return f=P.nextPos,P.result;if(a=f,n.charCodeAt(f)===39?(h=Pn,f++):(h=i,N===0&&B(Zt)),h!==i){for(d=[],w=pf();w!==i;)d.push(w),w=pf();d!==i?(n.charCodeAt(f)===39?(w=Pn,f++):(w=i,N===0&&B(Zt)),w!==i?(J=a,h=Q(d),a=h):(f=a,a=u)):(f=a,a=u);}else f=a,a=u;return M[E]={nextPos:f,result:a},a}function hf(){var a,h,d,w=f*49+18,E=M[w];return E?(f=E.nextPos,E.result):(a=Af(),a===i&&(a=f,h=f,N++,n.charCodeAt(f)===34?(d=ue,f++):(d=i,N===0&&B(Ge)),N--,d===i?h=m:(f=h,h=u),h!==i?(n.length>f?(d=n.charAt(f),f++):(d=i,N===0&&B(v)),d!==i?(J=a,h=St(d),a=h):(f=a,a=u)):(f=a,a=u)),M[w]={nextPos:f,result:a},a)}function pf(){var a,h,d,w=f*49+19,E=M[w];return E?(f=E.nextPos,E.result):(a=f,h=f,N++,n.charCodeAt(f)===39?(d=Pn,f++):(d=i,N===0&&B(Zt)),N--,d===i?h=m:(f=h,h=u),h!==i?(n.length>f?(d=n.charAt(f),f++):(d=i,N===0&&B(v)),d!==i?(J=a,h=St(d),a=h):(f=a,a=u)):(f=a,a=u),M[w]={nextPos:f,result:a},a)}function df(){var a,h,d,w=f*49+20,E=M[w];return E?(f=E.nextPos,E.result):(a=Af(),a===i&&(a=LE(),a===i&&(a=f,h=f,N++,n.substr(f,3)===T?(d=T,f+=3):(d=i,N===0&&B($)),N--,d===i?h=m:(f=h,h=u),h!==i?(n.length>f?(d=n.charAt(f),f++):(d=i,N===0&&B(v)),d!==i?(J=a,h=ce(d),a=h):(f=a,a=u)):(f=a,a=u))),M[w]={nextPos:f,result:a},a)}function LE(){var a,h,d,w,E,P=f*49+21,L=M[P];if(L)return f=L.nextPos,L.result;if(a=f,n.charCodeAt(f)===92?(h=zr,f++):(h=i,N===0&&B(Fo)),h!==i)if(d=gt(),d!==i){for(w=[],E=bf();E!==i;)w.push(E),E=bf();w!==i?(J=a,h=K(),a=h):(f=a,a=u);}else f=a,a=u;else f=a,a=u;return M[P]={nextPos:f,result:a},a}function gf(){var a,h,d,w=f*49+22,E=M[w];return E?(f=E.nextPos,E.result):(a=f,h=f,N++,n.substr(f,3)===Oe?(d=Oe,f+=3):(d=i,N===0&&B(Qt)),N--,d===i?h=m:(f=h,h=u),h!==i?(n.length>f?(d=n.charAt(f),f++):(d=i,N===0&&B(v)),d!==i?(J=a,h=St(d),a=h):(f=a,a=u)):(f=a,a=u),M[w]={nextPos:f,result:a},a)}function FE(){var a,h,d,w,E=f*49+23,P=M[E];return P?(f=P.nextPos,P.result):(a=f,h=yf(),h===i&&(h=Bo()),h!==i?(n.charCodeAt(f)===101?(d=me,f++):(d=i,N===0&&B(W)),d===i&&(n.charCodeAt(f)===69?(d=le,f++):(d=i,N===0&&B(we))),d!==i?(w=Bo(),w!==i?(J=a,h=De(h,w),a=h):(f=a,a=u)):(f=a,a=u)):(f=a,a=u),a===i&&(a=f,h=yf(),h!==i&&(J=a,h=_e(h)),a=h),M[E]={nextPos:f,result:a},a)}function yf(){var a,h,d,w,E,P,L=f*49+24,G=M[L];return G?(f=G.nextPos,G.result):(a=f,n.charCodeAt(f)===43?(h=Er,f++):(h=i,N===0&&B(er)),h===i&&(h=te),h!==i?(d=f,w=qn(),w!==i?(n.charCodeAt(f)===46?(E=q,f++):(E=i,N===0&&B(k)),E!==i?(P=qn(),P!==i?(w=[w,E,P],d=w):(f=d,d=u)):(f=d,d=u)):(f=d,d=u),d!==i?(J=a,h=Fc(d),a=h):(f=a,a=u)):(f=a,a=u),a===i&&(a=f,n.charCodeAt(f)===45?(h=Tn,f++):(h=i,N===0&&B($n)),h!==i?(d=f,w=qn(),w!==i?(n.charCodeAt(f)===46?(E=q,f++):(E=i,N===0&&B(k)),E!==i?(P=qn(),P!==i?(w=[w,E,P],d=w):(f=d,d=u)):(f=d,d=u)):(f=d,d=u),d!==i?(J=a,h=qc(d),a=h):(f=a,a=u)):(f=a,a=u)),M[L]={nextPos:f,result:a},a)}function qE(){var a,h,d=f*49+25,w=M[d];return w?(f=w.nextPos,w.result):(a=f,h=Bo(),h!==i&&(J=a,h=$0(h)),a=h,M[d]={nextPos:f,result:a},a)}function Bo(){var a,h,d,w,E,P=f*49+26,L=M[P];if(L)return f=L.nextPos,L.result;if(a=f,n.charCodeAt(f)===43?(h=Er,f++):(h=i,N===0&&B(er)),h===i&&(h=te),h!==i){if(d=[],w=pe(),w!==i)for(;w!==i;)d.push(w),w=pe();else d=u;d!==i?(w=f,N++,n.charCodeAt(f)===46?(E=q,f++):(E=i,N===0&&B(k)),N--,E===i?w=m:(f=w,w=u),w!==i?(J=a,h=Fc(d),a=h):(f=a,a=u)):(f=a,a=u);}else f=a,a=u;if(a===i)if(a=f,n.charCodeAt(f)===45?(h=Tn,f++):(h=i,N===0&&B($n)),h!==i){if(d=[],w=pe(),w!==i)for(;w!==i;)d.push(w),w=pe();else d=u;d!==i?(w=f,N++,n.charCodeAt(f)===46?(E=q,f++):(E=i,N===0&&B(k)),N--,E===i?w=m:(f=w,w=u),w!==i?(J=a,h=qc(d),a=h):(f=a,a=u)):(f=a,a=u);}else f=a,a=u;return M[P]={nextPos:f,result:a},a}function DE(){var a,h,d=f*49+27,w=M[d];return w?(f=w.nextPos,w.result):(a=f,n.substr(f,4)===Dc?(h=Dc,f+=4):(h=i,N===0&&B(I0)),h!==i&&(J=a,h=k0()),a=h,a===i&&(a=f,n.substr(f,5)===Nc?(h=Nc,f+=5):(h=i,N===0&&B(L0)),h!==i&&(J=a,h=F0()),a=h),M[d]={nextPos:f,result:a},a)}function NE(){var a,h,d,w,E,P=f*49+28,L=M[P];if(L)return f=L.nextPos,L.result;if(a=f,n.charCodeAt(f)===91?(h=b,f++):(h=i,N===0&&B(_)),h!==i){for(d=[],w=dt();w!==i;)d.push(w),w=dt();d!==i?(n.charCodeAt(f)===93?(w=x,f++):(w=i,N===0&&B(A)),w!==i?(J=a,h=q0(),a=h):(f=a,a=u)):(f=a,a=u);}else f=a,a=u;if(a===i&&(a=f,n.charCodeAt(f)===91?(h=b,f++):(h=i,N===0&&B(_)),h!==i?(d=mf(),d===i&&(d=te),d!==i?(n.charCodeAt(f)===93?(w=x,f++):(w=i,N===0&&B(A)),w!==i?(J=a,h=D0(d),a=h):(f=a,a=u)):(f=a,a=u)):(f=a,a=u),a===i)){if(a=f,n.charCodeAt(f)===91?(h=b,f++):(h=i,N===0&&B(_)),h!==i){if(d=[],w=Li(),w!==i)for(;w!==i;)d.push(w),w=Li();else d=u;d!==i?(n.charCodeAt(f)===93?(w=x,f++):(w=i,N===0&&B(A)),w!==i?(J=a,h=N0(d),a=h):(f=a,a=u)):(f=a,a=u);}else f=a,a=u;if(a===i)if(a=f,n.charCodeAt(f)===91?(h=b,f++):(h=i,N===0&&B(_)),h!==i){if(d=[],w=Li(),w!==i)for(;w!==i;)d.push(w),w=Li();else d=u;d!==i?(w=mf(),w!==i?(n.charCodeAt(f)===93?(E=x,f++):(E=i,N===0&&B(A)),E!==i?(J=a,h=M0(d,w),a=h):(f=a,a=u)):(f=a,a=u)):(f=a,a=u);}else f=a,a=u;}return M[P]={nextPos:f,result:a},a}function mf(){var a,h,d,w,E,P=f*49+29,L=M[P];if(L)return f=L.nextPos,L.result;for(a=f,h=[],d=dt();d!==i;)h.push(d),d=dt();if(h!==i)if(d=Gr(),d!==i){for(w=[],E=dt();E!==i;)w.push(E),E=dt();w!==i?(J=a,h=Mc(d),a=h):(f=a,a=u);}else f=a,a=u;else f=a,a=u;return M[P]={nextPos:f,result:a},a}function Li(){var a,h,d,w,E,P,L,G=f*49+30,ie=M[G];if(ie)return f=ie.nextPos,ie.result;for(a=f,h=[],d=dt();d!==i;)h.push(d),d=dt();if(h!==i)if(d=Gr(),d!==i){for(w=[],E=dt();E!==i;)w.push(E),E=dt();if(w!==i)if(n.charCodeAt(f)===44?(E=jc,f++):(E=i,N===0&&B(Bc)),E!==i){for(P=[],L=dt();L!==i;)P.push(L),L=dt();P!==i?(J=a,h=Mc(d),a=h):(f=a,a=u);}else f=a,a=u;else f=a,a=u;}else f=a,a=u;else f=a,a=u;return M[G]={nextPos:f,result:a},a}function dt(){var a,h=f*49+31,d=M[h];return d?(f=d.nextPos,d.result):(a=X(),a===i&&(a=gt(),a===i&&(a=ki())),M[h]={nextPos:f,result:a},a)}function ME(){var a,h,d,w,E,P,L=f*49+32,G=M[L];if(G)return f=G.nextPos,G.result;if(a=f,n.charCodeAt(f)===123?(h=j0,f++):(h=i,N===0&&B(B0)),h!==i){for(d=[],w=X();w!==i;)d.push(w),w=X();if(d!==i){for(w=[],E=vf();E!==i;)w.push(E),E=vf();if(w!==i){for(E=[],P=X();P!==i;)E.push(P),P=X();E!==i?(n.charCodeAt(f)===125?(P=H0,f++):(P=i,N===0&&B(U0)),P!==i?(J=a,h=W0(w),a=h):(f=a,a=u)):(f=a,a=u);}else f=a,a=u;}else f=a,a=u;}else f=a,a=u;return M[L]={nextPos:f,result:a},a}function vf(){var a,h,d,w,E,P,L,G,ie,de,he,Ee=f*49+33,xe=M[Ee];if(xe)return f=xe.nextPos,xe.result;for(a=f,h=[],d=X();d!==i;)h.push(d),d=X();if(h!==i)if(d=Fn(),d!==i){for(w=[],E=X();E!==i;)w.push(E),E=X();if(w!==i)if(n.charCodeAt(f)===61?(E=j,f++):(E=i,N===0&&B(C)),E!==i){for(P=[],L=X();L!==i;)P.push(L),L=X();if(P!==i)if(L=Gr(),L!==i){for(G=[],ie=X();ie!==i;)G.push(ie),ie=X();if(G!==i)if(n.charCodeAt(f)===44?(ie=jc,f++):(ie=i,N===0&&B(Bc)),ie!==i){for(de=[],he=X();he!==i;)de.push(he),he=X();de!==i?(J=a,h=Hc(d,L),a=h):(f=a,a=u);}else f=a,a=u;else f=a,a=u;}else f=a,a=u;else f=a,a=u;}else f=a,a=u;else f=a,a=u;}else f=a,a=u;else f=a,a=u;if(a===i){for(a=f,h=[],d=X();d!==i;)h.push(d),d=X();if(h!==i)if(d=Fn(),d!==i){for(w=[],E=X();E!==i;)w.push(E),E=X();if(w!==i)if(n.charCodeAt(f)===61?(E=j,f++):(E=i,N===0&&B(C)),E!==i){for(P=[],L=X();L!==i;)P.push(L),L=X();P!==i?(L=Gr(),L!==i?(J=a,h=Hc(d,L),a=h):(f=a,a=u)):(f=a,a=u);}else f=a,a=u;else f=a,a=u;}else f=a,a=u;else f=a,a=u;}return M[Ee]={nextPos:f,result:a},a}function wf(){var a,h,d,w=f*49+34,E=M[w];return E?(f=E.nextPos,E.result):(a=f,n.charCodeAt(f)===46?(h=q,f++):(h=i,N===0&&B(k)),h!==i?(d=qn(),d!==i?(J=a,h=z0(d),a=h):(f=a,a=u)):(f=a,a=u),M[w]={nextPos:f,result:a},a)}function Sf(){var a,h,d,w,E,P,L,G,ie,de,he,Ee,xe=f*49+35,st=M[xe];return st?(f=st.nextPos,st.result):(a=f,h=f,d=pe(),d!==i?(w=pe(),w!==i?(E=pe(),E!==i?(P=pe(),P!==i?(n.charCodeAt(f)===45?(L=Tn,f++):(L=i,N===0&&B($n)),L!==i?(G=pe(),G!==i?(ie=pe(),ie!==i?(n.charCodeAt(f)===45?(de=Tn,f++):(de=i,N===0&&B($n)),de!==i?(he=pe(),he!==i?(Ee=pe(),Ee!==i?(d=[d,w,E,P,L,G,ie,de,he,Ee],h=d):(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&&(J=a,h=G0(h)),a=h,M[xe]={nextPos:f,result:a},a)}function jE(){var a,h,d,w,E,P,L,G,ie,de,he,Ee=f*49+36,xe=M[Ee];return xe?(f=xe.nextPos,xe.result):(a=f,h=f,d=pe(),d!==i?(w=pe(),w!==i?(n.charCodeAt(f)===58?(E=In,f++):(E=i,N===0&&B(kn)),E!==i?(P=pe(),P!==i?(L=pe(),L!==i?(n.charCodeAt(f)===58?(G=In,f++):(G=i,N===0&&B(kn)),G!==i?(ie=pe(),ie!==i?(de=pe(),de!==i?(he=wf(),he===i&&(he=te),he!==i?(d=[d,w,E,P,L,G,ie,de,he],h=d):(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&&(J=a,h=Uc(h)),a=h,M[Ee]={nextPos:f,result:a},a)}function BE(){var a,h,d,w,E,P,L,G,ie,de,he,Ee,xe,st,Kr,tr,ot,xf=f*49+37,Uo=M[xf];return Uo?(f=Uo.nextPos,Uo.result):(a=f,h=f,d=pe(),d!==i?(w=pe(),w!==i?(n.charCodeAt(f)===58?(E=In,f++):(E=i,N===0&&B(kn)),E!==i?(P=pe(),P!==i?(L=pe(),L!==i?(n.charCodeAt(f)===58?(G=In,f++):(G=i,N===0&&B(kn)),G!==i?(ie=pe(),ie!==i?(de=pe(),de!==i?(he=wf(),he===i&&(he=te),he!==i?(n.charCodeAt(f)===45?(Ee=Tn,f++):(Ee=i,N===0&&B($n)),Ee===i&&(n.charCodeAt(f)===43?(Ee=Er,f++):(Ee=i,N===0&&B(er))),Ee!==i?(xe=pe(),xe!==i?(st=pe(),st!==i?(n.charCodeAt(f)===58?(Kr=In,f++):(Kr=i,N===0&&B(kn)),Kr!==i?(tr=pe(),tr!==i?(ot=pe(),ot!==i?(d=[d,w,E,P,L,G,ie,de,he,Ee,xe,st,Kr,tr,ot],h=d):(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&&(J=a,h=Uc(h)),a=h,M[xf]={nextPos:f,result:a},a)}function HE(){var a,h,d,w,E,P=f*49+38,L=M[P];return L?(f=L.nextPos,L.result):(a=f,h=Sf(),h!==i?(n.charCodeAt(f)===84?(d=Wc,f++):(d=i,N===0&&B(zc)),d!==i?(w=jE(),w!==i?(n.charCodeAt(f)===90?(E=K0,f++):(E=i,N===0&&B(V0)),E!==i?(J=a,h=Y0(h,w),a=h):(f=a,a=u)):(f=a,a=u)):(f=a,a=u)):(f=a,a=u),a===i&&(a=f,h=Sf(),h!==i?(n.charCodeAt(f)===84?(d=Wc,f++):(d=i,N===0&&B(zc)),d!==i?(w=BE(),w!==i?(J=a,h=J0(h,w),a=h):(f=a,a=u)):(f=a,a=u)):(f=a,a=u)),M[P]={nextPos:f,result:a},a)}function X(){var a,h=f*49+39,d=M[h];return d?(f=d.nextPos,d.result):(X0.test(n.charAt(f))?(a=n.charAt(f),f++):(a=i,N===0&&B(Q0)),M[h]={nextPos:f,result:a},a)}function gt(){var a,h,d,w=f*49+40,E=M[w];return E?(f=E.nextPos,E.result):(n.charCodeAt(f)===10?(a=Gc,f++):(a=i,N===0&&B(Kc)),a===i&&(a=f,n.charCodeAt(f)===13?(h=Z0,f++):(h=i,N===0&&B(eE)),h!==i?(n.charCodeAt(f)===10?(d=Gc,f++):(d=i,N===0&&B(Kc)),d!==i?(h=[h,d],a=h):(f=a,a=u)):(f=a,a=u)),M[w]={nextPos:f,result:a},a)}function bf(){var a,h=f*49+41,d=M[h];return d?(f=d.nextPos,d.result):(a=gt(),a===i&&(a=X()),M[h]={nextPos:f,result:a},a)}function Fi(){var a,h,d=f*49+42,w=M[d];return w?(f=w.nextPos,w.result):(a=f,N++,n.length>f?(h=n.charAt(f),f++):(h=i,N===0&&B(v)),N--,h===i?a=m:(f=a,a=u),M[d]={nextPos:f,result:a},a)}function yt(){var a,h=f*49+43,d=M[h];return d?(f=d.nextPos,d.result):(tE.test(n.charAt(f))?(a=n.charAt(f),f++):(a=i,N===0&&B(rE)),M[h]={nextPos:f,result:a},a)}function pe(){var a,h,d=f*49+44,w=M[d];return w?(f=w.nextPos,w.result):(nE.test(n.charAt(f))?(a=n.charAt(f),f++):(a=i,N===0&&B(iE)),a===i&&(a=f,n.charCodeAt(f)===95?(h=sE,f++):(h=i,N===0&&B(oE)),h!==i&&(J=a,h=aE()),a=h),M[d]={nextPos:f,result:a},a)}function Ef(){var a,h=f*49+45,d=M[h];return d?(f=d.nextPos,d.result):(lE.test(n.charAt(f))?(a=n.charAt(f),f++):(a=i,N===0&&B(uE)),M[h]={nextPos:f,result:a},a)}function qn(){var a,h,d,w=f*49+46,E=M[w];if(E)return f=E.nextPos,E.result;if(a=f,h=[],d=pe(),d!==i)for(;d!==i;)h.push(d),d=pe();else h=u;return h!==i&&(J=a,h=cE(h)),a=h,M[w]={nextPos:f,result:a},a}function Af(){var a,h,d=f*49+47,w=M[d];return w?(f=w.nextPos,w.result):(a=f,n.substr(f,2)===Vc?(h=Vc,f+=2):(h=i,N===0&&B(fE)),h!==i&&(J=a,h=hE()),a=h,a===i&&(a=f,n.substr(f,2)===Yc?(h=Yc,f+=2):(h=i,N===0&&B(pE)),h!==i&&(J=a,h=dE()),a=h,a===i&&(a=f,n.substr(f,2)===Jc?(h=Jc,f+=2):(h=i,N===0&&B(gE)),h!==i&&(J=a,h=yE()),a=h,a===i&&(a=f,n.substr(f,2)===Xc?(h=Xc,f+=2):(h=i,N===0&&B(mE)),h!==i&&(J=a,h=vE()),a=h,a===i&&(a=f,n.substr(f,2)===Qc?(h=Qc,f+=2):(h=i,N===0&&B(wE)),h!==i&&(J=a,h=SE()),a=h,a===i&&(a=f,n.substr(f,2)===Zc?(h=Zc,f+=2):(h=i,N===0&&B(bE)),h!==i&&(J=a,h=EE()),a=h,a===i&&(a=f,n.substr(f,2)===ef?(h=ef,f+=2):(h=i,N===0&&B(AE)),h!==i&&(J=a,h=_E()),a=h,a===i&&(a=UE()))))))),M[d]={nextPos:f,result:a},a)}function UE(){var a,h,d,w,E,P,L,G,ie,de,he,Ee=f*49+48,xe=M[Ee];return xe?(f=xe.nextPos,xe.result):(a=f,n.substr(f,2)===tf?(h=tf,f+=2):(h=i,N===0&&B(xE)),h!==i?(d=f,w=yt(),w!==i?(E=yt(),E!==i?(P=yt(),P!==i?(L=yt(),L!==i?(G=yt(),G!==i?(ie=yt(),ie!==i?(de=yt(),de!==i?(he=yt(),he!==i?(w=[w,E,P,L,G,ie,de,he],d=w):(f=d,d=u)):(f=d,d=u)):(f=d,d=u)):(f=d,d=u)):(f=d,d=u)):(f=d,d=u)):(f=d,d=u)):(f=d,d=u),d!==i?(J=a,h=rf(d),a=h):(f=a,a=u)):(f=a,a=u),a===i&&(a=f,n.substr(f,2)===nf?(h=nf,f+=2):(h=i,N===0&&B(CE)),h!==i?(d=f,w=yt(),w!==i?(E=yt(),E!==i?(P=yt(),P!==i?(L=yt(),L!==i?(w=[w,E,P,L],d=w):(f=d,d=u)):(f=d,d=u)):(f=d,d=u)):(f=d,d=u),d!==i?(J=a,h=rf(d),a=h):(f=a,a=u)):(f=a,a=u)),M[Ee]={nextPos:f,result:a},a)}var _f=[];function WE(a,h,d){var w=new Error(a);throw w.line=h,w.column=d,w}function Ho(a){_f.push(a);}function je(a,h,d,w,E){var P={type:a,value:h,line:d(),column:w()};return E&&(P.key=E),P}function zE(a,h,d){var w=parseInt("0x"+a);if(!isFinite(w)||Math.floor(w)!=w||w<0||w>1114111||w>55295&&w<57344)WE("Invalid Unicode escape code: "+a,h,d);else return GE(w)}function GE(){var a=16384,h=[],d,w,E=-1,P=arguments.length;if(!P)return "";for(var L="";++E<P;){var G=Number(arguments[E]);G<=65535?h.push(G):(G-=65536,d=(G>>10)+55296,w=G%1024+56320,h.push(d,w)),(E+1==P||h.length>a)&&(L+=String.fromCharCode.apply(null,h),h.length=0);}return L}if(Ii=l(),Ii!==i&&f===n.length)return Ii;throw Ii!==i&&f<n.length&&B({type:"end",description:"end of input"}),Mo(null,Do,$i)}return {SyntaxError:e,parse:r}}();});var nS=R((PM,rS)=>{function YI(t){var e=[],r=[],n="",s=Object.create(null),i=s;return l(t);function l(A){for(var O,I=0;I<A.length;I++)switch(O=A[I],O.type){case"Assign":p(O);break;case"ObjectPath":m(O);break;case"ArrayPath":v(O);break}return s}function c(A,O,I){var F=new Error(A);throw F.line=O,F.column=I,F}function p(A){var O=A.key,I=A.value,F=A.line,U=A.column,H;n?H=n+"."+O:H=O,typeof i[O]<"u"&&c("Cannot redefine existing key '"+H+"'.",F,U),i[O]=g(I),u(H)||(e.push(H),r.push(H));}function u(A){return e.indexOf(A)!==-1}function g(A){return A.type==="Array"?_(A.value):A.type==="InlineTable"?y(A.value):A.value}function y(A){for(var O=Object.create(null),I=0;I<A.length;I++){var F=A[I];F.value.type==="InlineTable"?O[F.key]=y(F.value.value):F.type==="InlineTableValue"&&(O[F.key]=g(F.value));}return O}function m(A){var O=A.value,I=O.map(x).join("."),F=A.line,U=A.column;u(I)&&c("Cannot redefine existing key '"+O+"'.",F,U),e.push(I),i=b(s,O,Object.create(null),F,U),n=O;}function v(A){var O=A.value,I=O.map(x).join("."),F=A.line,U=A.column;if(u(I)||e.push(I),e=e.filter(function(q){return q.indexOf(I)!==0}),e.push(I),i=b(s,O,[],F,U),n=I,i instanceof Array){var H=Object.create(null);i.push(H),i=H;}else c("Cannot redefine existing key '"+O+"'.",F,U);}function b(A,O,I,F,U){for(var H=[],q="",k=O.join("."),j=A,C=0;C<O.length;C++){var V=O[C];H.push(V),q=H.join("."),typeof j[V]>"u"?C===O.length-1?j[V]=I:j[V]=Object.create(null):C!==O.length-1&&r.indexOf(q)>-1&&c("Cannot redefine existing key '"+q+"'.",F,U),j=j[V],j instanceof Array&&j.length&&C<O.length-1&&(j=j[j.length-1]);}return j}function _(A){for(var O=null,I=0;I<A.length;I++){var F=A[I];O===null?O=F.type:F.type!==O&&c("Cannot add value of type "+F.type+" to array of type "+O+".",F.line,F.column);}return A.map(g)}function x(A){return A.indexOf(".")>-1?'"'+A+'"':A}}rS.exports={compile:YI};});var sS=R((TM,iS)=>{var JI=tS(),XI=nS();iS.exports={parse:function(t){var e=JI.parse(t.toString());return XI.compile(e)}};});var li=R(($M,cS)=>{var QI=z("path"),Mt="\\\\/",oS=`[^${Mt}]`,Kt="\\.",ZI="\\+",ek="\\?",no="\\/",tk="(?=.)",aS="[^/]",Su=`(?:${no}|$)`,lS=`(?:^|${no})`,bu=`${Kt}{1,2}${Su}`,rk=`(?!${Kt})`,nk=`(?!${lS}${bu})`,ik=`(?!${Kt}{0,1}${Su})`,sk=`(?!${bu})`,ok=`[^.${no}]`,ak=`${aS}*?`,uS={DOT_LITERAL:Kt,PLUS_LITERAL:ZI,QMARK_LITERAL:ek,SLASH_LITERAL:no,ONE_CHAR:tk,QMARK:aS,END_ANCHOR:Su,DOTS_SLASH:bu,NO_DOT:rk,NO_DOTS:nk,NO_DOT_SLASH:ik,NO_DOTS_SLASH:sk,QMARK_NO_DOT:ok,STAR:ak,START_ANCHOR:lS},lk={...uS,SLASH_LITERAL:`[${Mt}]`,QMARK:oS,STAR:`${oS}*?`,DOTS_SLASH:`${Kt}{1,2}(?:[${Mt}]|$)`,NO_DOT:`(?!${Kt})`,NO_DOTS:`(?!(?:^|[${Mt}])${Kt}{1,2}(?:[${Mt}]|$))`,NO_DOT_SLASH:`(?!${Kt}{0,1}(?:[${Mt}]|$))`,NO_DOTS_SLASH:`(?!${Kt}{1,2}(?:[${Mt}]|$))`,QMARK_NO_DOT:`[^.${Mt}]`,START_ANCHOR:`(?:^|[${Mt}])`,END_ANCHOR:`(?:[${Mt}]|$)`},uk={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"};cS.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:uk,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:QI.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?lk:uS}};});var io=R(nt=>{var ck=z("path"),fk=process.platform==="win32",{REGEX_BACKSLASH:hk,REGEX_REMOVE_BACKSLASH:pk,REGEX_SPECIAL_CHARS:dk,REGEX_SPECIAL_CHARS_GLOBAL:gk}=li();nt.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);nt.hasRegexChars=t=>dk.test(t);nt.isRegexChar=t=>t.length===1&&nt.hasRegexChars(t);nt.escapeRegex=t=>t.replace(gk,"\\$1");nt.toPosixSlashes=t=>t.replace(hk,"/");nt.removeBackslashes=t=>t.replace(pk,e=>e==="\\"?"":e);nt.supportsLookbehinds=()=>{let t=process.version.slice(1).split(".").map(Number);return t.length===3&&t[0]>=9||t[0]===8&&t[1]>=10};nt.isWindows=t=>t&&typeof t.windows=="boolean"?t.windows:fk===!0||ck.sep==="\\";nt.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?nt.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};nt.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};nt.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",s=r.contains?"":"$",i=`${n}(?:${t})${s}`;return e.negated===!0&&(i=`(?:^(?!${i}).*$)`),i};});var vS=R((kM,mS)=>{var fS=io(),{CHAR_ASTERISK:Eu,CHAR_AT:yk,CHAR_BACKWARD_SLASH:ui,CHAR_COMMA:mk,CHAR_DOT:Au,CHAR_EXCLAMATION_MARK:_u,CHAR_FORWARD_SLASH:yS,CHAR_LEFT_CURLY_BRACE:xu,CHAR_LEFT_PARENTHESES:Cu,CHAR_LEFT_SQUARE_BRACKET:vk,CHAR_PLUS:wk,CHAR_QUESTION_MARK:hS,CHAR_RIGHT_CURLY_BRACE:Sk,CHAR_RIGHT_PARENTHESES:pS,CHAR_RIGHT_SQUARE_BRACKET:bk}=li(),dS=t=>t===yS||t===ui,gS=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1);},Ek=(t,e)=>{let r=e||{},n=t.length-1,s=r.parts===!0||r.scanToEnd===!0,i=[],o=[],l=[],c=t,p=-1,u=0,g=0,y=!1,m=!1,v=!1,b=!1,_=!1,x=!1,A=!1,O=!1,I=!1,F=!1,U=0,H,q,k={value:"",depth:0,isGlob:!1},j=()=>p>=n,C=()=>c.charCodeAt(p+1),V=()=>(H=q,c.charCodeAt(++p));for(;p<n;){q=V();let te;if(q===ui){A=k.backslashes=!0,q=V(),q===xu&&(x=!0);continue}if(x===!0||q===xu){for(U++;j()!==!0&&(q=V());){if(q===ui){A=k.backslashes=!0,V();continue}if(q===xu){U++;continue}if(x!==!0&&q===Au&&(q=V())===Au){if(y=k.isBrace=!0,v=k.isGlob=!0,F=!0,s===!0)continue;break}if(x!==!0&&q===mk){if(y=k.isBrace=!0,v=k.isGlob=!0,F=!0,s===!0)continue;break}if(q===Sk&&(U--,U===0)){x=!1,y=k.isBrace=!0,F=!0;break}}if(s===!0)continue;break}if(q===yS){if(i.push(p),o.push(k),k={value:"",depth:0,isGlob:!1},F===!0)continue;if(H===Au&&p===u+1){u+=2;continue}g=p+1;continue}if(r.noext!==!0&&(q===wk||q===yk||q===Eu||q===hS||q===_u)===!0&&C()===Cu){if(v=k.isGlob=!0,b=k.isExtglob=!0,F=!0,q===_u&&p===u&&(I=!0),s===!0){for(;j()!==!0&&(q=V());){if(q===ui){A=k.backslashes=!0,q=V();continue}if(q===pS){v=k.isGlob=!0,F=!0;break}}continue}break}if(q===Eu){if(H===Eu&&(_=k.isGlobstar=!0),v=k.isGlob=!0,F=!0,s===!0)continue;break}if(q===hS){if(v=k.isGlob=!0,F=!0,s===!0)continue;break}if(q===vk){for(;j()!==!0&&(te=V());){if(te===ui){A=k.backslashes=!0,V();continue}if(te===bk){m=k.isBracket=!0,v=k.isGlob=!0,F=!0;break}}if(s===!0)continue;break}if(r.nonegate!==!0&&q===_u&&p===u){O=k.negated=!0,u++;continue}if(r.noparen!==!0&&q===Cu){if(v=k.isGlob=!0,s===!0){for(;j()!==!0&&(q=V());){if(q===Cu){A=k.backslashes=!0,q=V();continue}if(q===pS){F=!0;break}}continue}break}if(v===!0){if(F=!0,s===!0)continue;break}}r.noext===!0&&(b=!1,v=!1);let Y=c,se="",T="";u>0&&(se=c.slice(0,u),c=c.slice(u),g-=u),Y&&v===!0&&g>0?(Y=c.slice(0,g),T=c.slice(g)):v===!0?(Y="",T=c):Y=c,Y&&Y!==""&&Y!=="/"&&Y!==c&&dS(Y.charCodeAt(Y.length-1))&&(Y=Y.slice(0,-1)),r.unescape===!0&&(T&&(T=fS.removeBackslashes(T)),Y&&A===!0&&(Y=fS.removeBackslashes(Y)));let $={prefix:se,input:t,start:u,base:Y,glob:T,isBrace:y,isBracket:m,isGlob:v,isExtglob:b,isGlobstar:_,negated:O,negatedExtglob:I};if(r.tokens===!0&&($.maxDepth=0,dS(q)||o.push(k),$.tokens=o),r.parts===!0||r.tokens===!0){let te;for(let Q=0;Q<i.length;Q++){let ue=te?te+1:u,Ge=i[Q],Oe=t.slice(ue,Ge);r.tokens&&(Q===0&&u!==0?(o[Q].isPrefix=!0,o[Q].value=se):o[Q].value=Oe,gS(o[Q]),$.maxDepth+=o[Q].depth),(Q!==0||Oe!=="")&&l.push(Oe),te=Ge;}if(te&&te+1<t.length){let Q=t.slice(te+1);l.push(Q),r.tokens&&(o[o.length-1].value=Q,gS(o[o.length-1]),$.maxDepth+=o[o.length-1].depth);}$.slashes=i,$.parts=l;}return $};mS.exports=Ek;});var bS=R((LM,SS)=>{var so=li(),ut=io(),{MAX_LENGTH:oo,POSIX_REGEX_SOURCE:Ak,REGEX_NON_SPECIAL_CHARS:_k,REGEX_SPECIAL_CHARS_BACKREF:xk,REPLACEMENTS:wS}=so,Ck=(t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let r=`[${t.join("-")}]`;return r},yn=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,Ru=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=wS[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min(oo,r.maxLength):oo,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],l=r.capture?"":"?:",c=ut.isWindows(e),p=so.globChars(c),u=so.extglobChars(p),{DOT_LITERAL:g,PLUS_LITERAL:y,SLASH_LITERAL:m,ONE_CHAR:v,DOTS_SLASH:b,NO_DOT:_,NO_DOT_SLASH:x,NO_DOTS_SLASH:A,QMARK:O,QMARK_NO_DOT:I,STAR:F,START_ANCHOR:U}=p,H=K=>`(${l}(?:(?!${U}${K.dot?b:g}).)*?)`,q=r.dot?"":_,k=r.dot?O:I,j=r.bash===!0?H(r):F;r.capture&&(j=`(${j})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let C={input:t,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:o};t=ut.removePrefix(t,C),s=t.length;let V=[],Y=[],se=[],T=i,$,te=()=>C.index===s-1,Q=C.peek=(K=1)=>t[C.index+K],ue=C.advance=()=>t[++C.index]||"",Ge=()=>t.slice(C.index+1),Oe=(K="",me=0)=>{C.consumed+=K,C.index+=me;},Qt=K=>{C.output+=K.output!=null?K.output:K.value,Oe(K.value);},Pn=()=>{let K=1;for(;Q()==="!"&&(Q(2)!=="("||Q(3)==="?");)ue(),C.start++,K++;return K%2===0?!1:(C.negated=!0,C.start++,!0)},Zt=K=>{C[K]++,se.push(K);},St=K=>{C[K]--,se.pop();},ce=K=>{if(T.type==="globstar"){let me=C.braces>0&&(K.type==="comma"||K.type==="brace"),W=K.extglob===!0||V.length&&(K.type==="pipe"||K.type==="paren");K.type!=="slash"&&K.type!=="paren"&&!me&&!W&&(C.output=C.output.slice(0,-T.output.length),T.type="star",T.value="*",T.output=j,C.output+=T.output);}if(V.length&&K.type!=="paren"&&(V[V.length-1].inner+=K.value),(K.value||K.output)&&Qt(K),T&&T.type==="text"&&K.type==="text"){T.value+=K.value,T.output=(T.output||"")+K.value;return}K.prev=T,o.push(K),T=K;},zr=(K,me)=>{let W={...u[me],conditions:1,inner:""};W.prev=T,W.parens=C.parens,W.output=C.output;let le=(r.capture?"(":"")+W.open;Zt("parens"),ce({type:K,value:me,output:C.output?"":v}),ce({type:"paren",extglob:!0,value:ue(),output:le}),V.push(W);},Fo=K=>{let me=K.close+(r.capture?")":""),W;if(K.type==="negate"){let le=j;if(K.inner&&K.inner.length>1&&K.inner.includes("/")&&(le=H(r)),(le!==j||te()||/^\)+$/.test(Ge()))&&(me=K.close=`)$))${le}`),K.inner.includes("*")&&(W=Ge())&&/^\.[^\\/.]+$/.test(W)){let we=Ru(W,{...e,fastpaths:!1}).output;me=K.close=`)${we})${le})`;}K.prev.type==="bos"&&(C.negatedExtglob=!0);}ce({type:"paren",extglob:!0,value:$,output:me}),St("parens");};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let K=!1,me=t.replace(xk,(W,le,we,De,_e,Er)=>De==="\\"?(K=!0,W):De==="?"?le?le+De+(_e?O.repeat(_e.length):""):Er===0?k+(_e?O.repeat(_e.length):""):O.repeat(we.length):De==="."?g.repeat(we.length):De==="*"?le?le+De+(_e?j:""):j:le?W:`\\${W}`);return K===!0&&(r.unescape===!0?me=me.replace(/\\/g,""):me=me.replace(/\\+/g,W=>W.length%2===0?"\\\\":W?"\\":"")),me===t&&r.contains===!0?(C.output=t,C):(C.output=ut.wrapOutput(me,C,e),C)}for(;!te();){if($=ue(),$==="\0")continue;if($==="\\"){let W=Q();if(W==="/"&&r.bash!==!0||W==="."||W===";")continue;if(!W){$+="\\",ce({type:"text",value:$});continue}let le=/^\\+/.exec(Ge()),we=0;if(le&&le[0].length>2&&(we=le[0].length,C.index+=we,we%2!==0&&($+="\\")),r.unescape===!0?$=ue():$+=ue(),C.brackets===0){ce({type:"text",value:$});continue}}if(C.brackets>0&&($!=="]"||T.value==="["||T.value==="[^")){if(r.posix!==!1&&$===":"){let W=T.value.slice(1);if(W.includes("[")&&(T.posix=!0,W.includes(":"))){let le=T.value.lastIndexOf("["),we=T.value.slice(0,le),De=T.value.slice(le+2),_e=Ak[De];if(_e){T.value=we+_e,C.backtrack=!0,ue(),!i.output&&o.indexOf(T)===1&&(i.output=v);continue}}}($==="["&&Q()!==":"||$==="-"&&Q()==="]")&&($=`\\${$}`),$==="]"&&(T.value==="["||T.value==="[^")&&($=`\\${$}`),r.posix===!0&&$==="!"&&T.value==="["&&($="^"),T.value+=$,Qt({value:$});continue}if(C.quotes===1&&$!=='"'){$=ut.escapeRegex($),T.value+=$,Qt({value:$});continue}if($==='"'){C.quotes=C.quotes===1?0:1,r.keepQuotes===!0&&ce({type:"text",value:$});continue}if($==="("){Zt("parens"),ce({type:"paren",value:$});continue}if($===")"){if(C.parens===0&&r.strictBrackets===!0)throw new SyntaxError(yn("opening","("));let W=V[V.length-1];if(W&&C.parens===W.parens+1){Fo(V.pop());continue}ce({type:"paren",value:$,output:C.parens?")":"\\)"}),St("parens");continue}if($==="["){if(r.nobracket===!0||!Ge().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(yn("closing","]"));$=`\\${$}`;}else Zt("brackets");ce({type:"bracket",value:$});continue}if($==="]"){if(r.nobracket===!0||T&&T.type==="bracket"&&T.value.length===1){ce({type:"text",value:$,output:`\\${$}`});continue}if(C.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(yn("opening","["));ce({type:"text",value:$,output:`\\${$}`});continue}St("brackets");let W=T.value.slice(1);if(T.posix!==!0&&W[0]==="^"&&!W.includes("/")&&($=`/${$}`),T.value+=$,Qt({value:$}),r.literalBrackets===!1||ut.hasRegexChars(W))continue;let le=ut.escapeRegex(T.value);if(C.output=C.output.slice(0,-T.value.length),r.literalBrackets===!0){C.output+=le,T.value=le;continue}T.value=`(${l}${le}|${T.value})`,C.output+=T.value;continue}if($==="{"&&r.nobrace!==!0){Zt("braces");let W={type:"brace",value:$,output:"(",outputIndex:C.output.length,tokensIndex:C.tokens.length};Y.push(W),ce(W);continue}if($==="}"){let W=Y[Y.length-1];if(r.nobrace===!0||!W){ce({type:"text",value:$,output:$});continue}let le=")";if(W.dots===!0){let we=o.slice(),De=[];for(let _e=we.length-1;_e>=0&&(o.pop(),we[_e].type!=="brace");_e--)we[_e].type!=="dots"&&De.unshift(we[_e].value);le=Ck(De,r),C.backtrack=!0;}if(W.comma!==!0&&W.dots!==!0){let we=C.output.slice(0,W.outputIndex),De=C.tokens.slice(W.tokensIndex);W.value=W.output="\\{",$=le="\\}",C.output=we;for(let _e of De)C.output+=_e.output||_e.value;}ce({type:"brace",value:$,output:le}),St("braces"),Y.pop();continue}if($==="|"){V.length>0&&V[V.length-1].conditions++,ce({type:"text",value:$});continue}if($===","){let W=$,le=Y[Y.length-1];le&&se[se.length-1]==="braces"&&(le.comma=!0,W="|"),ce({type:"comma",value:$,output:W});continue}if($==="/"){if(T.type==="dot"&&C.index===C.start+1){C.start=C.index+1,C.consumed="",C.output="",o.pop(),T=i;continue}ce({type:"slash",value:$,output:m});continue}if($==="."){if(C.braces>0&&T.type==="dot"){T.value==="."&&(T.output=g);let W=Y[Y.length-1];T.type="dots",T.output+=$,T.value+=$,W.dots=!0;continue}if(C.braces+C.parens===0&&T.type!=="bos"&&T.type!=="slash"){ce({type:"text",value:$,output:g});continue}ce({type:"dot",value:$,output:g});continue}if($==="?"){if(!(T&&T.value==="(")&&r.noextglob!==!0&&Q()==="("&&Q(2)!=="?"){zr("qmark",$);continue}if(T&&T.type==="paren"){let le=Q(),we=$;if(le==="<"&&!ut.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(T.value==="("&&!/[!=<:]/.test(le)||le==="<"&&!/<([!=]|\w+>)/.test(Ge()))&&(we=`\\${$}`),ce({type:"text",value:$,output:we});continue}if(r.dot!==!0&&(T.type==="slash"||T.type==="bos")){ce({type:"qmark",value:$,output:I});continue}ce({type:"qmark",value:$,output:O});continue}if($==="!"){if(r.noextglob!==!0&&Q()==="("&&(Q(2)!=="?"||!/[!=<:]/.test(Q(3)))){zr("negate",$);continue}if(r.nonegate!==!0&&C.index===0){Pn();continue}}if($==="+"){if(r.noextglob!==!0&&Q()==="("&&Q(2)!=="?"){zr("plus",$);continue}if(T&&T.value==="("||r.regex===!1){ce({type:"plus",value:$,output:y});continue}if(T&&(T.type==="bracket"||T.type==="paren"||T.type==="brace")||C.parens>0){ce({type:"plus",value:$});continue}ce({type:"plus",value:y});continue}if($==="@"){if(r.noextglob!==!0&&Q()==="("&&Q(2)!=="?"){ce({type:"at",extglob:!0,value:$,output:""});continue}ce({type:"text",value:$});continue}if($!=="*"){($==="$"||$==="^")&&($=`\\${$}`);let W=_k.exec(Ge());W&&($+=W[0],C.index+=W[0].length),ce({type:"text",value:$});continue}if(T&&(T.type==="globstar"||T.star===!0)){T.type="star",T.star=!0,T.value+=$,T.output=j,C.backtrack=!0,C.globstar=!0,Oe($);continue}let K=Ge();if(r.noextglob!==!0&&/^\([^?]/.test(K)){zr("star",$);continue}if(T.type==="star"){if(r.noglobstar===!0){Oe($);continue}let W=T.prev,le=W.prev,we=W.type==="slash"||W.type==="bos",De=le&&(le.type==="star"||le.type==="globstar");if(r.bash===!0&&(!we||K[0]&&K[0]!=="/")){ce({type:"star",value:$,output:""});continue}let _e=C.braces>0&&(W.type==="comma"||W.type==="brace"),Er=V.length&&(W.type==="pipe"||W.type==="paren");if(!we&&W.type!=="paren"&&!_e&&!Er){ce({type:"star",value:$,output:""});continue}for(;K.slice(0,3)==="/**";){let er=t[C.index+4];if(er&&er!=="/")break;K=K.slice(3),Oe("/**",3);}if(W.type==="bos"&&te()){T.type="globstar",T.value+=$,T.output=H(r),C.output=T.output,C.globstar=!0,Oe($);continue}if(W.type==="slash"&&W.prev.type!=="bos"&&!De&&te()){C.output=C.output.slice(0,-(W.output+T.output).length),W.output=`(?:${W.output}`,T.type="globstar",T.output=H(r)+(r.strictSlashes?")":"|$)"),T.value+=$,C.globstar=!0,C.output+=W.output+T.output,Oe($);continue}if(W.type==="slash"&&W.prev.type!=="bos"&&K[0]==="/"){let er=K[1]!==void 0?"|$":"";C.output=C.output.slice(0,-(W.output+T.output).length),W.output=`(?:${W.output}`,T.type="globstar",T.output=`${H(r)}${m}|${m}${er})`,T.value+=$,C.output+=W.output+T.output,C.globstar=!0,Oe($+ue()),ce({type:"slash",value:"/",output:""});continue}if(W.type==="bos"&&K[0]==="/"){T.type="globstar",T.value+=$,T.output=`(?:^|${m}|${H(r)}${m})`,C.output=T.output,C.globstar=!0,Oe($+ue()),ce({type:"slash",value:"/",output:""});continue}C.output=C.output.slice(0,-T.output.length),T.type="globstar",T.output=H(r),T.value+=$,C.output+=T.output,C.globstar=!0,Oe($);continue}let me={type:"star",value:$,output:j};if(r.bash===!0){me.output=".*?",(T.type==="bos"||T.type==="slash")&&(me.output=q+me.output),ce(me);continue}if(T&&(T.type==="bracket"||T.type==="paren")&&r.regex===!0){me.output=$,ce(me);continue}(C.index===C.start||T.type==="slash"||T.type==="dot")&&(T.type==="dot"?(C.output+=x,T.output+=x):r.dot===!0?(C.output+=A,T.output+=A):(C.output+=q,T.output+=q),Q()!=="*"&&(C.output+=v,T.output+=v)),ce(me);}for(;C.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(yn("closing","]"));C.output=ut.escapeLast(C.output,"["),St("brackets");}for(;C.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(yn("closing",")"));C.output=ut.escapeLast(C.output,"("),St("parens");}for(;C.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(yn("closing","}"));C.output=ut.escapeLast(C.output,"{"),St("braces");}if(r.strictSlashes!==!0&&(T.type==="star"||T.type==="bracket")&&ce({type:"maybe_slash",value:"",output:`${m}?`}),C.backtrack===!0){C.output="";for(let K of C.tokens)C.output+=K.output!=null?K.output:K.value,K.suffix&&(C.output+=K.suffix);}return C};Ru.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min(oo,r.maxLength):oo,s=t.length;if(s>n)throw new SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${n}`);t=wS[t]||t;let i=ut.isWindows(e),{DOT_LITERAL:o,SLASH_LITERAL:l,ONE_CHAR:c,DOTS_SLASH:p,NO_DOT:u,NO_DOTS:g,NO_DOTS_SLASH:y,STAR:m,START_ANCHOR:v}=so.globChars(i),b=r.dot?g:u,_=r.dot?y:u,x=r.capture?"":"?:",A={negated:!1,prefix:""},O=r.bash===!0?".*?":m;r.capture&&(O=`(${O})`);let I=q=>q.noglobstar===!0?O:`(${x}(?:(?!${v}${q.dot?p:o}).)*?)`,F=q=>{switch(q){case"*":return `${b}${c}${O}`;case".*":return `${o}${c}${O}`;case"*.*":return `${b}${O}${o}${c}${O}`;case"*/*":return `${b}${O}${l}${c}${_}${O}`;case"**":return b+I(r);case"**/*":return `(?:${b}${I(r)}${l})?${_}${c}${O}`;case"**/*.*":return `(?:${b}${I(r)}${l})?${_}${O}${o}${c}${O}`;case"**/.*":return `(?:${b}${I(r)}${l})?${o}${c}${O}`;default:{let k=/^(.*?)\.(\w+)$/.exec(q);if(!k)return;let j=F(k[1]);return j?j+o+k[2]:void 0}}},U=ut.removePrefix(t,A),H=F(U);return H&&r.strictSlashes!==!0&&(H+=`${l}?`),H};SS.exports=Ru;});var AS=R((FM,ES)=>{var Rk=z("path"),Ok=vS(),Ou=bS(),Pu=io(),Pk=li(),Tk=t=>t&&typeof t=="object"&&!Array.isArray(t),Re=(t,e,r=!1)=>{if(Array.isArray(t)){let u=t.map(y=>Re(y,e,r));return y=>{for(let m of u){let v=m(y);if(v)return v}return !1}}let n=Tk(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=Pu.isWindows(e),o=n?Re.compileRe(t,e):Re.makeRe(t,e,!1,!0),l=o.state;delete o.state;let c=()=>!1;if(s.ignore){let u={...e,ignore:null,onMatch:null,onResult:null};c=Re(s.ignore,u,r);}let p=(u,g=!1)=>{let{isMatch:y,match:m,output:v}=Re.test(u,o,e,{glob:t,posix:i}),b={glob:t,state:l,regex:o,posix:i,input:u,output:v,match:m,isMatch:y};return typeof s.onResult=="function"&&s.onResult(b),y===!1?(b.isMatch=!1,g?b:!1):c(u)?(typeof s.onIgnore=="function"&&s.onIgnore(b),b.isMatch=!1,g?b:!1):(typeof s.onMatch=="function"&&s.onMatch(b),g?b:!0)};return r&&(p.state=l),p};Re.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?Pu.toPosixSlashes:null),l=t===n,c=l&&o?o(t):t;return l===!1&&(c=o?o(t):t,l=c===n),(l===!1||i.capture===!0)&&(i.matchBase===!0||i.basename===!0?l=Re.matchBase(t,e,r,s):l=e.exec(c)),{isMatch:!!l,match:l,output:c}};Re.matchBase=(t,e,r,n=Pu.isWindows(r))=>(e instanceof RegExp?e:Re.makeRe(e,r)).test(Rk.basename(t));Re.isMatch=(t,e,r)=>Re(e,r)(t);Re.parse=(t,e)=>Array.isArray(t)?t.map(r=>Re.parse(r,e)):Ou(t,{...e,fastpaths:!1});Re.scan=(t,e)=>Ok(t,e);Re.compileRe=(t,e,r=!1,n=!1)=>{if(r===!0)return t.output;let s=e||{},i=s.contains?"":"^",o=s.contains?"":"$",l=`${i}(?:${t.output})${o}`;t&&t.negated===!0&&(l=`^(?!${l}).*$`);let c=Re.toRegex(l,e);return n===!0&&(c.state=t),c};Re.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=Ou.fastpaths(t,e)),s.output||(s=Ou(t,e)),Re.compileRe(s,e,r,n)};Re.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 /$^/}};Re.constants=Pk;ES.exports=Re;});var Tu=R((qM,_S)=>{_S.exports=AS();});var IS=R((DM,$S)=>{var fi=z("fs"),{Readable:$k}=z("stream"),ci=z("path"),{promisify:co}=z("util"),$u=Tu(),Ik=co(fi.readdir),kk=co(fi.stat),xS=co(fi.lstat),Lk=co(fi.realpath),Fk="!",PS="READDIRP_RECURSIVE_ERROR",qk=new Set(["ENOENT","EPERM","EACCES","ELOOP",PS]),Iu="files",TS="directories",lo="files_directories",ao="all",CS=[Iu,TS,lo,ao],Dk=t=>qk.has(t.code),[RS,Nk]=process.versions.node.split(".").slice(0,2).map(t=>Number.parseInt(t,10)),Mk=process.platform==="win32"&&(RS>10||RS===10&&Nk>=5),OS=t=>{if(t!==void 0){if(typeof t=="function")return t;if(typeof t=="string"){let e=$u(t.trim());return r=>e(r.basename)}if(Array.isArray(t)){let e=[],r=[];for(let n of t){let s=n.trim();s.charAt(0)===Fk?r.push($u(s.slice(1))):e.push($u(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))}}},uo=class t extends $k{static get defaultOptions(){return {root:".",fileFilter:e=>!0,directoryFilter:e=>!0,type:Iu,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=OS(r.fileFilter),this._directoryFilter=OS(r.directoryFilter);let i=r.lstat?xS:kk;Mk?this._stat=o=>i(o,{bigint:!0}):this._stat=i,this._maxDepth=r.depth,this._wantsDir=[TS,lo,ao].includes(s),this._wantsFile=[Iu,lo,ao].includes(s),this._wantsEverything=s===ao,this._root=ci.resolve(n),this._isDirent="Dirent"in fi&&!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 l=await this._getEntryType(o);l==="directory"&&this._directoryFilter(o)?(n<=this._maxDepth&&this.parents.push(this._exploreDir(o.fullPath,n+1)),this._wantsDir&&(this.push(o),e--)):(l==="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 Ik(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=ci.resolve(ci.join(r,s));n={path:ci.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){Dk(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 Lk(n),i=await xS(s);if(i.isFile())return "file";if(i.isDirectory()){let o=s.length;if(n.startsWith(s)&&n.substr(o,1)===ci.sep){let l=new Error(`Circular symlink detected: "${n}" points to "${s}"`);return l.code=PS,this._onError(l)}return "directory"}}catch(s){this._onError(s);}}}}_includeAsFile(e){let r=e&&e[this._statsProp];return r&&this._wantsEverything&&!r.isDirectory()}},mn=(t,e={})=>{let r=e.entryType||e.type;if(r==="both"&&(r=lo),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&&!CS.includes(r))throw new Error(`readdirp: Invalid type passed. Use one of ${CS.join(", ")}`)}else throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");return e.root=t,new uo(e)},jk=(t,e={})=>new Promise((r,n)=>{let s=[];mn(t,e).on("data",i=>s.push(i)).on("end",()=>r(s)).on("error",i=>n(i));});mn.promise=jk;mn.ReaddirpStream=uo;mn.default=mn;$S.exports=mn;});var ku=R((NM,kS)=>{kS.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 MS=R((DS,NS)=>{Object.defineProperty(DS,"__esModule",{value:!0});var qS=Tu(),Bk=ku(),LS="!",Hk={returnIndex:!1},Uk=t=>Array.isArray(t)?t:[t],Wk=(t,e)=>{if(typeof t=="function")return t;if(typeof t=="string"){let r=qS(t,e);return n=>t===n||r(n)}return t instanceof RegExp?r=>t.test(r):r=>!1},FS=(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=Bk(i,!1);for(let c=0;c<e.length;c++){let p=e[c];if(p(o))return n?-1:!1}let l=s&&[o].concat(r.slice(1));for(let c=0;c<t.length;c++){let p=t[c];if(s?p(...l):p(o))return n?c:!0}return n?-1:!1},Lu=(t,e,r=Hk)=>{if(t==null)throw new TypeError("anymatch: specify first argument");let n=typeof r=="boolean"?{returnIndex:r}:r,s=n.returnIndex||!1,i=Uk(t),o=i.filter(c=>typeof c=="string"&&c.charAt(0)===LS).map(c=>c.slice(1)).map(c=>qS(c,n)),l=i.filter(c=>typeof c!="string"||typeof c=="string"&&c.charAt(0)!==LS).map(c=>Wk(c,n));return e==null?(c,p=!1)=>FS(l,o,c,typeof p=="boolean"?p:!1):FS(l,o,e,s)};Lu.default=Lu;NS.exports=Lu;});var BS=R((MM,jS)=>{jS.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 Fu=R((jM,US)=>{var zk=BS(),HS={"{":"}","(":")","[":"]"},Gk=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 l=t[e+1];e+=2;var c=HS[l];if(c){var p=t.indexOf(c,e);p!==-1&&(e=p+1);}if(t[e]==="!")return !0}else e++;}return !1},Kk=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=HS[r];if(n){var s=t.indexOf(n,e);s!==-1&&(e=s+1);}if(t[e]==="!")return !0}else e++;}return !1};US.exports=function(e,r){if(typeof e!="string"||e==="")return !1;if(zk(e))return !0;var n=Gk;return r&&r.strict===!1&&(n=Kk),n(e)};});var zS=R((BM,WS)=>{var Vk=Fu(),Yk=z("path").posix.dirname,Jk=z("os").platform()==="win32",qu="/",Xk=/\\/g,Qk=/[\{\[].*[\}\]]$/,Zk=/(^|[^\\])([\{\[]|\([^\)]+$)/,eL=/\\([\!\*\?\|\[\]\(\)\{\}])/g;WS.exports=function(e,r){var n=Object.assign({flipBackslashes:!0},r);n.flipBackslashes&&Jk&&e.indexOf(qu)<0&&(e=e.replace(Xk,qu)),Qk.test(e)&&(e+=qu),e+="a";do e=Yk(e);while(Vk(e)||Zk.test(e));return e.replace(eL,"$1")};});var fo=R(wt=>{wt.isInteger=t=>typeof t=="number"?Number.isInteger(t):typeof t=="string"&&t.trim()!==""?Number.isInteger(Number(t)):!1;wt.find=(t,e)=>t.nodes.find(r=>r.type===e);wt.exceedsLimit=(t,e,r=1,n)=>n===!1||!wt.isInteger(t)||!wt.isInteger(e)?!1:(Number(e)-Number(t))/Number(r)>=n;wt.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);};wt.encloseBrace=t=>t.type!=="brace"||t.commas>>0+t.ranges>>0?!1:(t.invalid=!0,!0);wt.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;wt.isOpenOrClose=t=>t.type==="open"||t.type==="close"?!0:t.open===!0||t.close===!0;wt.reduce=t=>t.reduce((e,r)=>(r.type==="text"&&e.push(r.value),r.type==="range"&&(r.type="text"),e),[]);wt.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 ho=R((UM,KS)=>{var GS=fo();KS.exports=(t,e={})=>{let r=(n,s={})=>{let i=e.escapeInvalid&&GS.isInvalidBrace(s),o=n.invalid===!0&&e.escapeInvalid===!0,l="";if(n.value)return (i||o)&&GS.isOpenOrClose(n)?"\\"+n.value:n.value;if(n.value)return n.value;if(n.nodes)for(let c of n.nodes)l+=r(c);return l};return r(t)};});var YS=R((WM,VS)=>{VS.exports=function(t){return typeof t=="number"?t-t===0:typeof t=="string"&&t.trim()!==""?Number.isFinite?Number.isFinite(+t):isFinite(+t):!1};});var ib=R((zM,nb)=>{var JS=YS(),qr=(t,e,r)=>{if(JS(t)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||t===e)return String(t);if(JS(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),l=String(n.wrap),c=t+":"+e+"="+s+i+o+l;if(qr.cache.hasOwnProperty(c))return qr.cache[c].result;let p=Math.min(t,e),u=Math.max(t,e);if(Math.abs(p-u)===1){let b=t+"|"+e;return n.capture?`(${b})`:n.wrap===!1?b:`(?:${b})`}let g=rb(t)||rb(e),y={min:t,max:e,a:p,b:u},m=[],v=[];if(g&&(y.isPadded=g,y.maxLen=String(y.max).length),p<0){let b=u<0?Math.abs(u):1;v=XS(b,Math.abs(p),y,n),p=y.a=0;}return u>=0&&(m=XS(p,u,y,n)),y.negatives=v,y.positives=m,y.result=tL(v,m),n.capture===!0?y.result=`(${y.result})`:n.wrap!==!1&&m.length+v.length>1&&(y.result=`(?:${y.result})`),qr.cache[c]=y,y.result};function tL(t,e,r){let n=Du(t,e,"-",!1)||[],s=Du(e,t,"",!1)||[],i=Du(t,e,"-?",!0)||[];return n.concat(i).concat(s).join("|")}function rL(t,e){let r=1,n=1,s=ZS(t,r),i=new Set([e]);for(;t<=s&&s<=e;)i.add(s),r+=1,s=ZS(t,r);for(s=eb(e+1,n)-1;t<s&&s<=e;)i.add(s),n+=1,s=eb(e+1,n)-1;return i=[...i],i.sort(sL),i}function nL(t,e,r){if(t===e)return {pattern:t,count:[],digits:0};let n=iL(t,e),s=n.length,i="",o=0;for(let l=0;l<s;l++){let[c,p]=n[l];c===p?i+=c:c!=="0"||p!=="9"?i+=oL(c,p):o++;}return o&&(i+=r.shorthand===!0?"\\d":"[0-9]"),{pattern:i,count:[o],digits:s}}function XS(t,e,r,n){let s=rL(t,e),i=[],o=t,l;for(let c=0;c<s.length;c++){let p=s[c],u=nL(String(o),String(p),n),g="";if(!r.isPadded&&l&&l.pattern===u.pattern){l.count.length>1&&l.count.pop(),l.count.push(u.count[0]),l.string=l.pattern+tb(l.count),o=p+1;continue}r.isPadded&&(g=aL(p,r,n)),u.string=g+u.pattern+tb(u.count),i.push(u),o=p+1,l=u;}return i}function Du(t,e,r,n,s){let i=[];for(let o of t){let{string:l}=o;!n&&!QS(e,"string",l)&&i.push(r+l),n&&QS(e,"string",l)&&i.push(r+l);}return i}function iL(t,e){let r=[];for(let n=0;n<t.length;n++)r.push([t[n],e[n]]);return r}function sL(t,e){return t>e?1:e>t?-1:0}function QS(t,e,r){return t.some(n=>n[e]===r)}function ZS(t,e){return Number(String(t).slice(0,-e)+"9".repeat(e))}function eb(t,e){return t-t%Math.pow(10,e)}function tb(t){let[e=0,r=""]=t;return r||e>1?`{${e+(r?","+r:"")}}`:""}function oL(t,e,r){return `[${t}${e-t===1?"":"-"}${e}]`}function rb(t){return /^-?(0+)\d/.test(t)}function aL(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}}`}}qr.cache={};qr.clearCache=()=>qr.cache={};nb.exports=qr;});var ju=R((GM,hb)=>{var lL=z("util"),ab=ib(),sb=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),uL=t=>e=>t===!0?Number(e):String(e),Nu=t=>typeof t=="number"||typeof t=="string"&&t!=="",hi=t=>Number.isInteger(+t),Mu=t=>{let e=`${t}`,r=-1;if(e[0]==="-"&&(e=e.slice(1)),e==="0")return !1;for(;e[++r]==="0";);return r>0},cL=(t,e,r)=>typeof t=="string"||typeof e=="string"?!0:r.stringify===!0,fL=(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},ob=(t,e)=>{let r=t[0]==="-"?"-":"";for(r&&(t=t.slice(1),e--);t.length<e;)t="0"+t;return r?"-"+t:t},hL=(t,e)=>{t.negatives.sort((o,l)=>o<l?-1:o>l?1:0),t.positives.sort((o,l)=>o<l?-1:o>l?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},lb=(t,e,r,n)=>{if(r)return ab(t,e,{wrap:!1,...n});let s=String.fromCharCode(t);if(t===e)return s;let i=String.fromCharCode(e);return `[${s}-${i}]`},ub=(t,e,r)=>{if(Array.isArray(t)){let n=r.wrap===!0,s=r.capture?"":"?:";return n?`(${s}${t.join("|")})`:t.join("|")}return ab(t,e,r)},cb=(...t)=>new RangeError("Invalid range arguments: "+lL.inspect(...t)),fb=(t,e,r)=>{if(r.strictRanges===!0)throw cb([t,e]);return []},pL=(t,e)=>{if(e.strictRanges===!0)throw new TypeError(`Expected step "${t}" to be a number`);return []},dL=(t,e,r=1,n={})=>{let s=Number(t),i=Number(e);if(!Number.isInteger(s)||!Number.isInteger(i)){if(n.strictRanges===!0)throw cb([t,e]);return []}s===0&&(s=0),i===0&&(i=0);let o=s>i,l=String(t),c=String(e),p=String(r);r=Math.max(Math.abs(r),1);let u=Mu(l)||Mu(c)||Mu(p),g=u?Math.max(l.length,c.length,p.length):0,y=u===!1&&cL(t,e,n)===!1,m=n.transform||uL(y);if(n.toRegex&&r===1)return lb(ob(t,g),ob(e,g),!0,n);let v={negatives:[],positives:[]},b=A=>v[A<0?"negatives":"positives"].push(Math.abs(A)),_=[],x=0;for(;o?s>=i:s<=i;)n.toRegex===!0&&r>1?b(s):_.push(fL(m(s,x),g,y)),s=o?s-r:s+r,x++;return n.toRegex===!0?r>1?hL(v,n):ub(_,null,{wrap:!1,...n}):_},gL=(t,e,r=1,n={})=>{if(!hi(t)&&t.length>1||!hi(e)&&e.length>1)return fb(t,e,n);let s=n.transform||(y=>String.fromCharCode(y)),i=`${t}`.charCodeAt(0),o=`${e}`.charCodeAt(0),l=i>o,c=Math.min(i,o),p=Math.max(i,o);if(n.toRegex&&r===1)return lb(c,p,!1,n);let u=[],g=0;for(;l?i>=o:i<=o;)u.push(s(i,g)),i=l?i-r:i+r,g++;return n.toRegex===!0?ub(u,null,{wrap:!1,options:n}):u},po=(t,e,r,n={})=>{if(e==null&&Nu(t))return [t];if(!Nu(t)||!Nu(e))return fb(t,e,n);if(typeof r=="function")return po(t,e,1,{transform:r});if(sb(r))return po(t,e,0,r);let s={...n};return s.capture===!0&&(s.wrap=!0),r=r||s.step||1,hi(r)?hi(t)&&hi(e)?dL(t,e,r,s):gL(t,e,Math.max(Math.abs(r),1),s):r!=null&&!sb(r)?pL(r,s):po(t,e,1,r)};hb.exports=po;});var gb=R((KM,db)=>{var yL=ju(),pb=fo(),mL=(t,e={})=>{let r=(n,s={})=>{let i=pb.isInvalidBrace(s),o=n.invalid===!0&&e.escapeInvalid===!0,l=i===!0||o===!0,c=e.escapeInvalid===!0?"\\":"",p="";if(n.isOpen===!0||n.isClose===!0)return c+n.value;if(n.type==="open")return l?c+n.value:"(";if(n.type==="close")return l?c+n.value:")";if(n.type==="comma")return n.prev.type==="comma"?"":l?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){let u=pb.reduce(n.nodes),g=yL(...u,{...e,wrap:!1,toRegex:!0});if(g.length!==0)return u.length>1&&g.length>1?`(${g})`:g}if(n.nodes)for(let u of n.nodes)p+=r(u,n);return p};return r(t)};db.exports=mL;});var vb=R((VM,mb)=>{var vL=ju(),yb=ho(),vn=fo(),Dr=(t="",e="",r=!1)=>{let n=[];if(t=[].concat(t),e=[].concat(e),!e.length)return t;if(!t.length)return r?vn.flatten(e).map(s=>`{${s}}`):e;for(let s of t)if(Array.isArray(s))for(let i of s)n.push(Dr(i,e,r));else for(let i of e)r===!0&&typeof i=="string"&&(i=`{${i}}`),n.push(Array.isArray(i)?Dr(s,i,r):s+i);return vn.flatten(n)},wL=(t,e={})=>{let r=e.rangeLimit===void 0?1e3:e.rangeLimit,n=(s,i={})=>{s.queue=[];let o=i,l=i.queue;for(;o.type!=="brace"&&o.type!=="root"&&o.parent;)o=o.parent,l=o.queue;if(s.invalid||s.dollar){l.push(Dr(l.pop(),yb(s,e)));return}if(s.type==="brace"&&s.invalid!==!0&&s.nodes.length===2){l.push(Dr(l.pop(),["{}"]));return}if(s.nodes&&s.ranges>0){let g=vn.reduce(s.nodes);if(vn.exceedsLimit(...g,e.step,r))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let y=vL(...g,e);y.length===0&&(y=yb(s,e)),l.push(Dr(l.pop(),y)),s.nodes=[];return}let c=vn.encloseBrace(s),p=s.queue,u=s;for(;u.type!=="brace"&&u.type!=="root"&&u.parent;)u=u.parent,p=u.queue;for(let g=0;g<s.nodes.length;g++){let y=s.nodes[g];if(y.type==="comma"&&s.type==="brace"){g===1&&p.push(""),p.push("");continue}if(y.type==="close"){l.push(Dr(l.pop(),p,c));continue}if(y.value&&y.type!=="open"){p.push(Dr(p.pop(),y.value));continue}y.nodes&&n(y,s);}return p};return vn.flatten(n(t))};mb.exports=wL;});var Sb=R((YM,wb)=>{wb.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 xb=R((JM,_b)=>{var SL=ho(),{MAX_LENGTH:bb,CHAR_BACKSLASH:Bu,CHAR_BACKTICK:bL,CHAR_COMMA:EL,CHAR_DOT:AL,CHAR_LEFT_PARENTHESES:_L,CHAR_RIGHT_PARENTHESES:xL,CHAR_LEFT_CURLY_BRACE:CL,CHAR_RIGHT_CURLY_BRACE:RL,CHAR_LEFT_SQUARE_BRACKET:Eb,CHAR_RIGHT_SQUARE_BRACKET:Ab,CHAR_DOUBLE_QUOTE:OL,CHAR_SINGLE_QUOTE:PL,CHAR_NO_BREAK_SPACE:TL,CHAR_ZERO_WIDTH_NOBREAK_SPACE:$L}=Sb(),IL=(t,e={})=>{if(typeof t!="string")throw new TypeError("Expected a string");let r=e||{},n=typeof r.maxLength=="number"?Math.min(bb,r.maxLength):bb;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,l=s,c=0,p=t.length,u=0,g=0,y,v=()=>t[u++],b=_=>{if(_.type==="text"&&l.type==="dot"&&(l.type="text"),l&&l.type==="text"&&_.type==="text"){l.value+=_.value;return}return o.nodes.push(_),_.parent=o,_.prev=l,l=_,_};for(b({type:"bos"});u<p;)if(o=i[i.length-1],y=v(),!(y===$L||y===TL)){if(y===Bu){b({type:"text",value:(e.keepEscaping?y:"")+v()});continue}if(y===Ab){b({type:"text",value:"\\"+y});continue}if(y===Eb){c++;let x;for(;u<p&&(x=v());){if(y+=x,x===Eb){c++;continue}if(x===Bu){y+=v();continue}if(x===Ab&&(c--,c===0))break}b({type:"text",value:y});continue}if(y===_L){o=b({type:"paren",nodes:[]}),i.push(o),b({type:"text",value:y});continue}if(y===xL){if(o.type!=="paren"){b({type:"text",value:y});continue}o=i.pop(),b({type:"text",value:y}),o=i[i.length-1];continue}if(y===OL||y===PL||y===bL){let _=y,x;for(e.keepQuotes!==!0&&(y="");u<p&&(x=v());){if(x===Bu){y+=x+v();continue}if(x===_){e.keepQuotes===!0&&(y+=x);break}y+=x;}b({type:"text",value:y});continue}if(y===CL){g++;let x={type:"brace",open:!0,close:!1,dollar:l.value&&l.value.slice(-1)==="$"||o.dollar===!0,depth:g,commas:0,ranges:0,nodes:[]};o=b(x),i.push(o),b({type:"open",value:y});continue}if(y===RL){if(o.type!=="brace"){b({type:"text",value:y});continue}let _="close";o=i.pop(),o.close=!0,b({type:_,value:y}),g--,o=i[i.length-1];continue}if(y===EL&&g>0){if(o.ranges>0){o.ranges=0;let _=o.nodes.shift();o.nodes=[_,{type:"text",value:SL(o)}];}b({type:"comma",value:y}),o.commas++;continue}if(y===AL&&g>0&&o.commas===0){let _=o.nodes;if(g===0||_.length===0){b({type:"text",value:y});continue}if(l.type==="dot"){if(o.range=[],l.value+=y,l.type="range",o.nodes.length!==3&&o.nodes.length!==5){o.invalid=!0,o.ranges=0,l.type="text";continue}o.ranges++,o.args=[];continue}if(l.type==="range"){_.pop();let x=_[_.length-1];x.value+=l.value+y,l=x,o.ranges--;continue}b({type:"dot",value:y});continue}b({type:"text",value:y});}do if(o=i.pop(),o.type!=="root"){o.nodes.forEach(A=>{A.nodes||(A.type==="open"&&(A.isOpen=!0),A.type==="close"&&(A.isClose=!0),A.nodes||(A.type="text"),A.invalid=!0);});let _=i[i.length-1],x=_.nodes.indexOf(o);_.nodes.splice(x,1,...o.nodes);}while(i.length>0);return b({type:"eos"}),s};_b.exports=IL;});var Ob=R((XM,Rb)=>{var Cb=ho(),kL=gb(),LL=vb(),FL=xb(),ct=(t,e={})=>{let r=[];if(Array.isArray(t))for(let n of t){let s=ct.create(n,e);Array.isArray(s)?r.push(...s):r.push(s);}else r=[].concat(ct.create(t,e));return e&&e.expand===!0&&e.nodupes===!0&&(r=[...new Set(r)]),r};ct.parse=(t,e={})=>FL(t,e);ct.stringify=(t,e={})=>Cb(typeof t=="string"?ct.parse(t,e):t,e);ct.compile=(t,e={})=>(typeof t=="string"&&(t=ct.parse(t,e)),kL(t,e));ct.expand=(t,e={})=>{typeof t=="string"&&(t=ct.parse(t,e));let r=LL(t,e);return e.noempty===!0&&(r=r.filter(Boolean)),e.nodupes===!0&&(r=[...new Set(r)]),r};ct.create=(t,e={})=>t===""||t.length<3?[t]:e.expand!==!0?ct.compile(t,e):ct.expand(t,e);Rb.exports=ct;});var Pb=R((QM,qL)=>{qL.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 $b=R((ZM,Tb)=>{Tb.exports=Pb();});var kb=R((ej,Ib)=>{var DL=z("path"),NL=$b(),ML=new Set(NL);Ib.exports=t=>ML.has(DL.extname(t).slice(1).toLowerCase());});var go=R(Z=>{var{sep:jL}=z("path"),{platform:Hu}=process,BL=z("os");Z.EV_ALL="all";Z.EV_READY="ready";Z.EV_ADD="add";Z.EV_CHANGE="change";Z.EV_ADD_DIR="addDir";Z.EV_UNLINK="unlink";Z.EV_UNLINK_DIR="unlinkDir";Z.EV_RAW="raw";Z.EV_ERROR="error";Z.STR_DATA="data";Z.STR_END="end";Z.STR_CLOSE="close";Z.FSEVENT_CREATED="created";Z.FSEVENT_MODIFIED="modified";Z.FSEVENT_DELETED="deleted";Z.FSEVENT_MOVED="moved";Z.FSEVENT_CLONED="cloned";Z.FSEVENT_UNKNOWN="unknown";Z.FSEVENT_TYPE_FILE="file";Z.FSEVENT_TYPE_DIRECTORY="directory";Z.FSEVENT_TYPE_SYMLINK="symlink";Z.KEY_LISTENERS="listeners";Z.KEY_ERR="errHandlers";Z.KEY_RAW="rawEmitters";Z.HANDLER_KEYS=[Z.KEY_LISTENERS,Z.KEY_ERR,Z.KEY_RAW];Z.DOT_SLASH=`.${jL}`;Z.BACK_SLASH_RE=/\\/g;Z.DOUBLE_SLASH_RE=/\/\//;Z.SLASH_OR_BACK_SLASH_RE=/[/\\]/;Z.DOT_RE=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/;Z.REPLACER_RE=/^\.[/\\]/;Z.SLASH="/";Z.SLASH_SLASH="//";Z.BRACE_START="{";Z.BANG="!";Z.ONE_DOT=".";Z.TWO_DOTS="..";Z.STAR="*";Z.GLOBSTAR="**";Z.ROOT_GLOBSTAR="/**/*";Z.SLASH_GLOBSTAR="/**";Z.DIR_SUFFIX="Dir";Z.ANYMATCH_OPTS={dot:!0};Z.STRING_TYPE="string";Z.FUNCTION_TYPE="function";Z.EMPTY_STR="";Z.EMPTY_FN=()=>{};Z.IDENTITY_FN=t=>t;Z.isWindows=Hu==="win32";Z.isMacos=Hu==="darwin";Z.isLinux=Hu==="linux";Z.isIBMi=BL.type()==="OS400";});var Mb=R((rj,Nb)=>{var Vt=z("fs"),Le=z("path"),{promisify:yi}=z("util"),HL=kb(),{isWindows:UL,isLinux:WL,EMPTY_FN:zL,EMPTY_STR:GL,KEY_LISTENERS:wn,KEY_ERR:Uu,KEY_RAW:pi,HANDLER_KEYS:KL,EV_CHANGE:mo,EV_ADD:yo,EV_ADD_DIR:VL,EV_ERROR:Fb,STR_DATA:YL,STR_END:JL,BRACE_START:XL,STAR:QL}=go(),ZL="watch",eF=yi(Vt.open),qb=yi(Vt.stat),tF=yi(Vt.lstat),rF=yi(Vt.close),Wu=yi(Vt.realpath),nF={lstat:tF,stat:qb},Gu=(t,e)=>{t instanceof Set?t.forEach(e):e(t);},di=(t,e,r)=>{let n=t[e];n instanceof Set||(t[e]=n=new Set([n])),n.add(r);},iF=t=>e=>{let r=t[e];r instanceof Set?r.clear():delete t[e];},gi=(t,e,r)=>{let n=t[e];n instanceof Set?n.delete(r):n===r&&delete t[e];},Db=t=>t instanceof Set?t.size===0:!t,vo=new Map;function Lb(t,e,r,n,s){let i=(o,l)=>{r(t),s(o,l,{watchedPath:t}),l&&t!==l&&wo(Le.resolve(t,l),wn,Le.join(t,l));};try{return Vt.watch(t,e,i)}catch(o){n(o);}}var wo=(t,e,r,n,s)=>{let i=vo.get(t);i&&Gu(i[e],o=>{o(r,n,s);});},sF=(t,e,r,n)=>{let{listener:s,errHandler:i,rawEmitter:o}=n,l=vo.get(e),c;if(!r.persistent)return c=Lb(t,r,s,i,o),c.close.bind(c);if(l)di(l,wn,s),di(l,Uu,i),di(l,pi,o);else {if(c=Lb(t,r,wo.bind(null,e,wn),i,wo.bind(null,e,pi)),!c)return;c.on(Fb,async p=>{let u=wo.bind(null,e,Uu);if(l.watcherUnusable=!0,UL&&p.code==="EPERM")try{let g=await eF(t,"r");await rF(g),u(p);}catch{}else u(p);}),l={listeners:s,errHandlers:i,rawEmitters:o,watcher:c},vo.set(e,l);}return ()=>{gi(l,wn,s),gi(l,Uu,i),gi(l,pi,o),Db(l.listeners)&&(l.watcher.close(),vo.delete(e),KL.forEach(iF(l)),l.watcher=void 0,Object.freeze(l));}},zu=new Map,oF=(t,e,r,n)=>{let {listener:s,rawEmitter:i}=n,o=zu.get(e),p=o&&o.options;return p&&(p.persistent<r.persistent||p.interval>r.interval)&&(Vt.unwatchFile(e),o=void 0),o?(di(o,wn,s),di(o,pi,i)):(o={listeners:s,rawEmitters:i,options:r,watcher:Vt.watchFile(e,r,(u,g)=>{Gu(o.rawEmitters,m=>{m(mo,e,{curr:u,prev:g});});let y=u.mtimeMs;(u.size!==g.size||y>g.mtimeMs||y===0)&&Gu(o.listeners,m=>m(t,u));})},zu.set(e,o)),()=>{gi(o,wn,s),gi(o,pi,i),Db(o.listeners)&&(zu.delete(e),Vt.unwatchFile(e),o.options=o.watcher=void 0,Object.freeze(o));}},Ku=class{constructor(e){this.fsw=e,this._boundHandleError=r=>e._handleError(r);}_watchWithNodeFs(e,r){let n=this.fsw.options,s=Le.dirname(e),i=Le.basename(e);this.fsw._getWatchedDir(s).add(i);let l=Le.resolve(e),c={persistent:n.persistent};r||(r=zL);let p;return n.usePolling?(c.interval=n.enableBinaryInterval&&HL(i)?n.binaryInterval:n.interval,p=oF(e,l,c,{listener:r,rawEmitter:this.fsw._emitRaw})):p=sF(e,l,c,{listener:r,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw}),p}_handleFile(e,r,n){if(this.fsw.closed)return;let s=Le.dirname(e),i=Le.basename(e),o=this.fsw._getWatchedDir(s),l=r;if(o.has(i))return;let c=async(u,g)=>{if(this.fsw._throttle(ZL,e,5)){if(!g||g.mtimeMs===0)try{let y=await qb(e);if(this.fsw.closed)return;let m=y.atimeMs,v=y.mtimeMs;(!m||m<=v||v!==l.mtimeMs)&&this.fsw._emit(mo,e,y),WL&&l.ino!==y.ino?(this.fsw._closeFile(u),l=y,this.fsw._addPathCloser(u,this._watchWithNodeFs(e,c))):l=y;}catch{this.fsw._remove(s,i);}else if(o.has(i)){let y=g.atimeMs,m=g.mtimeMs;(!y||y<=m||m!==l.mtimeMs)&&this.fsw._emit(mo,e,g),l=g;}}},p=this._watchWithNodeFs(e,c);if(!(n&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(yo,e,0))return;this.fsw._emit(yo,e,r);}return p}async _handleSymlink(e,r,n,s){if(this.fsw.closed)return;let i=e.fullPath,o=this.fsw._getWatchedDir(r);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let l;try{l=await Wu(n);}catch{return this.fsw._emitReady(),!0}return this.fsw.closed?void 0:(o.has(s)?this.fsw._symlinkPaths.get(i)!==l&&(this.fsw._symlinkPaths.set(i,l),this.fsw._emit(mo,n,e.stats)):(o.add(s),this.fsw._symlinkPaths.set(i,l),this.fsw._emit(yo,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,l){if(e=Le.join(e,GL),!n.hasGlob&&(l=this.fsw._throttle("readdir",e,1e3),!l))return;let c=this.fsw._getWatchedDir(n.path),p=new Set,u=this.fsw._readdirp(e,{fileFilter:g=>n.filterPath(g),directoryFilter:g=>n.filterDir(g),depth:0}).on(YL,async g=>{if(this.fsw.closed){u=void 0;return}let y=g.path,m=Le.join(e,y);if(p.add(y),!(g.stats.isSymbolicLink()&&await this._handleSymlink(g,e,m,y))){if(this.fsw.closed){u=void 0;return}(y===s||!s&&!c.has(y))&&(this.fsw._incrReadyCount(),m=Le.join(i,Le.relative(i,m)),this._addToNodeFs(m,r,n,o+1));}}).on(Fb,this._boundHandleError);return new Promise(g=>u.once(JL,()=>{if(this.fsw.closed){u=void 0;return}let y=l?l.clear():!1;g(),c.getChildren().filter(m=>m!==e&&!p.has(m)&&(!n.hasGlob||n.filterPath({fullPath:Le.resolve(e,m)}))).forEach(m=>{this.fsw._remove(e,m);}),u=void 0,y&&this._handleRead(e,!1,n,s,i,o,l);}))}async _handleDir(e,r,n,s,i,o,l){let c=this.fsw._getWatchedDir(Le.dirname(e)),p=c.has(Le.basename(e));!(n&&this.fsw.options.ignoreInitial)&&!i&&!p&&(!o.hasGlob||o.globFilter(e))&&this.fsw._emit(VL,e,r),c.add(Le.basename(e)),this.fsw._getWatchedDir(e);let u,g,y=this.fsw.options.depth;if((y==null||s<=y)&&!this.fsw._symlinkPaths.has(l)){if(!i&&(await this._handleRead(e,n,o,i,e,s,u),this.fsw.closed))return;g=this._watchWithNodeFs(e,(m,v)=>{v&&v.mtimeMs===0||this._handleRead(m,!1,o,i,e,s,u);});}return g}async _addToNodeFs(e,r,n,s,i){let o=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return o(),!1;let l=this.fsw._getWatchHelpers(e,s);!l.hasGlob&&n&&(l.hasGlob=n.hasGlob,l.globFilter=n.globFilter,l.filterPath=c=>n.filterPath(c),l.filterDir=c=>n.filterDir(c));try{let c=await nF[l.statMethod](l.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(l.watchPath,c))return o(),!1;let p=this.fsw.options.followSymlinks&&!e.includes(QL)&&!e.includes(XL),u;if(c.isDirectory()){let g=Le.resolve(e),y=p?await Wu(e):e;if(this.fsw.closed||(u=await this._handleDir(l.watchPath,c,r,s,i,l,y),this.fsw.closed))return;g!==y&&y!==void 0&&this.fsw._symlinkPaths.set(g,y);}else if(c.isSymbolicLink()){let g=p?await Wu(e):e;if(this.fsw.closed)return;let y=Le.dirname(l.watchPath);if(this.fsw._getWatchedDir(y).add(l.watchPath),this.fsw._emit(yo,l.watchPath,c),u=await this._handleDir(y,c,r,s,e,l,g),this.fsw.closed)return;g!==void 0&&this.fsw._symlinkPaths.set(Le.resolve(e),g);}else u=this._handleFile(l.watchPath,c,r);return o(),this.fsw._addPathCloser(e,u),!1}catch(c){if(this.fsw._handleError(c))return o(),e}}};Nb.exports=Ku;});var Gb=R((nj,tc)=>{var Zu=z("fs"),Fe=z("path"),{promisify:ec}=z("util"),Sn;try{Sn=z("fsevents");}catch(t){process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR&&console.error(t);}if(Sn){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&&(Sn=void 0);}}var{EV_ADD:Vu,EV_CHANGE:aF,EV_ADD_DIR:jb,EV_UNLINK:So,EV_ERROR:lF,STR_DATA:uF,STR_END:cF,FSEVENT_CREATED:fF,FSEVENT_MODIFIED:hF,FSEVENT_DELETED:pF,FSEVENT_MOVED:dF,FSEVENT_UNKNOWN:gF,FSEVENT_TYPE_FILE:yF,FSEVENT_TYPE_DIRECTORY:mi,FSEVENT_TYPE_SYMLINK:zb,ROOT_GLOBSTAR:Bb,DIR_SUFFIX:mF,DOT_SLASH:Hb,FUNCTION_TYPE:Yu,EMPTY_FN:vF,IDENTITY_FN:wF}=go(),SF=t=>isNaN(t)?{}:{depth:t},Xu=ec(Zu.stat),bF=ec(Zu.lstat),Ub=ec(Zu.realpath),EF={stat:Xu,lstat:bF},Nr=new Map,AF=10,_F=new Set([69888,70400,71424,72704,73472,131328,131840,262912]),xF=(t,e)=>({stop:Sn.watch(t,e)});function CF(t,e,r,n){let s=Fe.extname(e)?Fe.dirname(e):e,i=Fe.dirname(s),o=Nr.get(s);RF(i)&&(s=i);let l=Fe.resolve(t),c=l!==e,p=(g,y,m)=>{c&&(g=g.replace(e,l)),(g===l||!g.indexOf(l+Fe.sep))&&r(g,y,m);},u=!1;for(let g of Nr.keys())if(e.indexOf(Fe.resolve(g)+Fe.sep)===0){s=g,o=Nr.get(s),u=!0;break}return o||u?o.listeners.add(p):(o={listeners:new Set([p]),rawEmitter:n,watcher:xF(s,(g,y)=>{if(!o.listeners.size)return;let m=Sn.getInfo(g,y);o.listeners.forEach(v=>{v(g,y,m);}),o.rawEmitter(m.event,g,m);})},Nr.set(s,o)),()=>{let g=o.listeners;if(g.delete(p),!g.size&&(Nr.delete(s),o.watcher))return o.watcher.stop().then(()=>{o.rawEmitter=o.watcher=void 0,Object.freeze(o);})}}var RF=t=>{let e=0;for(let r of Nr.keys())if(r.indexOf(t)===0&&(e++,e>=AF))return !0;return !1},OF=()=>Sn&&Nr.size<128,Ju=(t,e)=>{let r=0;for(;!t.indexOf(e)&&(t=Fe.dirname(t))!==e;)r++;return r},Wb=(t,e)=>t.type===mi&&e.isDirectory()||t.type===zb&&e.isSymbolicLink()||t.type===yF&&e.isFile(),Qu=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+Bb),!0;n.delete(e),n.delete(e+Bb);}addOrChange(e,r,n,s,i,o,l,c){let p=i.has(o)?aF:Vu;this.handleEvent(p,e,r,n,s,i,o,l,c);}async checkExists(e,r,n,s,i,o,l,c){try{let p=await Xu(e);if(this.fsw.closed)return;Wb(l,p)?this.addOrChange(e,r,n,s,i,o,l,c):this.handleEvent(So,e,r,n,s,i,o,l,c);}catch(p){p.code==="EACCES"?this.addOrChange(e,r,n,s,i,o,l,c):this.handleEvent(So,e,r,n,s,i,o,l,c);}}handleEvent(e,r,n,s,i,o,l,c,p){if(!(this.fsw.closed||this.checkIgnored(r)))if(e===So){let u=c.type===mi;(u||o.has(l))&&this.fsw._remove(i,l,u);}else {if(e===Vu){if(c.type===mi&&this.fsw._getWatchedDir(r),c.type===zb&&p.followSymlinks){let g=p.depth===void 0?void 0:Ju(n,s)+1;return this._addToFsEvents(r,!1,!0,g)}this.fsw._getWatchedDir(i).add(l);}let u=c.type===mi?e+mF:e;this.fsw._emit(u,r),u===jb&&this._addToFsEvents(r,!1,!0);}}_watchWithFsEvents(e,r,n,s){if(this.fsw.closed||this.fsw._isIgnored(e))return;let i=this.fsw.options,l=CF(e,r,async(c,p,u)=>{if(this.fsw.closed||i.depth!==void 0&&Ju(c,r)>i.depth)return;let g=n(Fe.join(e,Fe.relative(e,c)));if(s&&!s(g))return;let y=Fe.dirname(g),m=Fe.basename(g),v=this.fsw._getWatchedDir(u.type===mi?g:y);if(_F.has(p)||u.event===gF)if(typeof i.ignored===Yu){let b;try{b=await Xu(g);}catch{}if(this.fsw.closed||this.checkIgnored(g,b))return;Wb(u,b)?this.addOrChange(g,c,r,y,v,m,u,i):this.handleEvent(So,g,c,r,y,v,m,u,i);}else this.checkExists(g,c,r,y,v,m,u,i);else switch(u.event){case fF:case hF:return this.addOrChange(g,c,r,y,v,m,u,i);case pF:case dF:return this.checkExists(g,c,r,y,v,m,u,i)}},this.fsw._emitRaw);return this.fsw._emitReady(),l}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 Ub(e);if(this.fsw.closed)return;if(this.fsw._isIgnored(i))return this.fsw._emitReady();this.fsw._incrReadyCount(),this._addToFsEvents(i||e,o=>{let l=e;return i&&i!==Hb?l=o.replace(i,e):o!==Hb&&(l=Fe.join(e,o)),n(l)},!1,s);}catch(i){if(this.fsw._handleError(i))return this.fsw._emitReady()}}}emitAdd(e,r,n,s,i){let o=n(e),l=r.isDirectory(),c=this.fsw._getWatchedDir(Fe.dirname(o)),p=Fe.basename(o);l&&this.fsw._getWatchedDir(o),!c.has(p)&&(c.add(p),(!s.ignoreInitial||i===!0)&&this.fsw._emit(l?jb:Vu,o,r));}initWatch(e,r,n,s){if(this.fsw.closed)return;let i=this._watchWithFsEvents(n.watchPath,Fe.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===Yu?r:wF,l=this.fsw._getWatchHelpers(e);try{let c=await EF[l.statMethod](l.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(l.watchPath,c))throw null;if(c.isDirectory()){if(l.globFilter||this.emitAdd(o(e),c,o,i,n),s&&s>i.depth)return;this.fsw._readdirp(l.watchPath,{fileFilter:p=>l.filterPath(p),directoryFilter:p=>l.filterDir(p),...SF(i.depth-(s||0))}).on(uF,p=>{if(this.fsw.closed||p.stats.isDirectory()&&!l.filterPath(p))return;let u=Fe.join(l.watchPath,p.path),{fullPath:g}=p;if(l.followSymlinks&&p.stats.isSymbolicLink()){let y=i.depth===void 0?void 0:Ju(u,Fe.resolve(l.watchPath))+1;this._handleFsEventsSymlink(u,g,o,y);}else this.emitAdd(u,p.stats,o,i,n);}).on(lF,vF).on(cF,()=>{this.fsw._emitReady();});}else this.emitAdd(l.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===Yu)this.initWatch(void 0,e,l,o);else {let c;try{c=await Ub(l.watchPath);}catch{}this.initWatch(c,e,l,o);}}};tc.exports=Qu;tc.exports.canUse=OF;});var n0=R(yc=>{var{EventEmitter:PF}=z("events"),dc=z("fs"),ye=z("path"),{promisify:Zb}=z("util"),TF=IS(),ac=MS().default,$F=zS(),rc=Fu(),IF=Ob(),kF=ku(),LF=Mb(),Kb=Gb(),{EV_ALL:nc,EV_READY:FF,EV_ADD:bo,EV_CHANGE:vi,EV_UNLINK:Vb,EV_ADD_DIR:qF,EV_UNLINK_DIR:DF,EV_RAW:NF,EV_ERROR:ic,STR_CLOSE:MF,STR_END:jF,BACK_SLASH_RE:BF,DOUBLE_SLASH_RE:Yb,SLASH_OR_BACK_SLASH_RE:HF,DOT_RE:UF,REPLACER_RE:WF,SLASH:sc,SLASH_SLASH:zF,BRACE_START:GF,BANG:lc,ONE_DOT:e0,TWO_DOTS:KF,GLOBSTAR:VF,SLASH_GLOBSTAR:oc,ANYMATCH_OPTS:uc,STRING_TYPE:gc,FUNCTION_TYPE:YF,EMPTY_STR:cc,EMPTY_FN:JF,isWindows:XF,isMacos:QF,isIBMi:ZF}=go(),eq=Zb(dc.stat),tq=Zb(dc.readdir),fc=(t=[])=>Array.isArray(t)?t:[t],t0=(t,e=[])=>(t.forEach(r=>{Array.isArray(r)?t0(r,e):e.push(r);}),e),Jb=t=>{let e=t0(fc(t));if(!e.every(r=>typeof r===gc))throw new TypeError(`Non-string provided as watch path: ${e}`);return e.map(r0)},Xb=t=>{let e=t.replace(BF,sc),r=!1;for(e.startsWith(zF)&&(r=!0);e.match(Yb);)e=e.replace(Yb,sc);return r&&(e=sc+e),e},r0=t=>Xb(ye.normalize(Xb(t))),Qb=(t=cc)=>e=>typeof e!==gc?e:r0(ye.isAbsolute(e)?e:ye.join(t,e)),rq=(t,e)=>ye.isAbsolute(t)?t:t.startsWith(lc)?lc+ye.join(e,t.slice(1)):ye.join(e,t),xt=(t,e)=>t[e]===void 0,hc=class{constructor(e,r){this.path=e,this._removeWatcher=r,this.items=new Set;}add(e){let{items:r}=this;r&&e!==e0&&e!==KF&&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 tq(n);}catch{this._removeWatcher&&this._removeWatcher(ye.dirname(n),ye.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);}},nq="stat",iq="lstat",pc=class{constructor(e,r,n,s){this.fsw=s,this.path=e=e.replace(WF,cc),this.watchPath=r,this.fullWatchPath=ye.resolve(r),this.hasGlob=r!==e,e===cc&&(this.hasGlob=!1),this.globSymlink=this.hasGlob&&n?void 0:!1,this.globFilter=this.hasGlob?ac(e,void 0,uc):!1,this.dirParts=this.getDirParts(e),this.dirParts.forEach(i=>{i.length>1&&i.pop();}),this.followSymlinks=n,this.statMethod=n?nq:iq;}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 ye.join(this.watchPath,ye.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===YF?this.globFilter(n):!0)&&this.fsw._isntIgnored(n,r)&&this.fsw._hasReadPermissions(r)}getDirParts(e){if(!this.hasGlob)return [];let r=[];return (e.includes(GF)?IF.expand(e):[e]).forEach(s=>{r.push(ye.relative(this.watchPath,s).split(HF));}),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===VF&&(n=!0),n||!r[0][o]||ac(i,r[0][o],uc))));}return !this.unmatchedGlob&&this.fsw._isntIgnored(this.entryPath(e),e.stats)}},Eo=class extends PF{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,xt(r,"persistent")&&(r.persistent=!0),xt(r,"ignoreInitial")&&(r.ignoreInitial=!1),xt(r,"ignorePermissionErrors")&&(r.ignorePermissionErrors=!1),xt(r,"interval")&&(r.interval=100),xt(r,"binaryInterval")&&(r.binaryInterval=300),xt(r,"disableGlobbing")&&(r.disableGlobbing=!1),r.enableBinaryInterval=r.binaryInterval!==r.interval,xt(r,"useFsEvents")&&(r.useFsEvents=!r.usePolling),Kb.canUse()||(r.useFsEvents=!1),xt(r,"usePolling")&&!r.useFsEvents&&(r.usePolling=QF),ZF&&(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)),xt(r,"atomic")&&(r.atomic=!r.usePolling&&!r.useFsEvents),r.atomic&&(this._pendingUnlinks=new Map),xt(r,"followSymlinks")&&(r.followSymlinks=!0),xt(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=fc(r.ignored));let l=0;this._emitReady=()=>{l++,l>=this._readyCount&&(this._emitReady=JF,this._readyEmitted=!0,process.nextTick(()=>this.emit(FF)));},this._emitRaw=(...c)=>this.emit(NF,...c),this._readyEmitted=!1,this.options=r,r.useFsEvents?this._fsEventsHandler=new Kb(this):this._nodeFsHandler=new LF(this),Object.freeze(r);}add(e,r,n){let{cwd:s,disableGlobbing:i}=this.options;this.closed=!1;let o=Jb(e);return s&&(o=o.map(l=>{let c=rq(l,s);return i||!rc(l)?c:kF(c)})),o=o.filter(l=>l.startsWith(lc)?(this._ignoredPaths.add(l.slice(1)),!1):(this._ignoredPaths.delete(l),this._ignoredPaths.delete(l+oc),this._userIgnored=void 0,!0)),this.options.useFsEvents&&this._fsEventsHandler?(this._readyCount||(this._readyCount=o.length),this.options.persistent&&(this._readyCount*=2),o.forEach(l=>this._fsEventsHandler._addToFsEvents(l))):(this._readyCount||(this._readyCount=0),this._readyCount+=o.length,Promise.all(o.map(async l=>{let c=await this._nodeFsHandler._addToNodeFs(l,!n,0,0,r);return c&&this._emitReady(),c})).then(l=>{this.closed||l.filter(c=>c).forEach(c=>{this.add(ye.dirname(c),ye.basename(r||c));});})),this}unwatch(e){if(this.closed)return this;let r=Jb(e),{cwd:n}=this.options;return r.forEach(s=>{!ye.isAbsolute(s)&&!this._closers.has(s)&&(n&&(s=ye.join(n,s)),s=ye.resolve(s)),this._closePath(s),this._ignoredPaths.add(s),this._watched.has(s)&&this._ignoredPaths.add(s+oc),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?ye.relative(this.options.cwd,n):n;e[s||e0]=r.getChildren().sort();}),e}emitWithAll(e,r){this.emit(...r),e!==ic&&this.emit(nc,...r);}async _emit(e,r,n,s,i){if(this.closed)return;let o=this.options;XF&&(r=ye.normalize(r)),o.cwd&&(r=ye.relative(o.cwd,r));let l=[e,r];i!==void 0?l.push(n,s,i):s!==void 0?l.push(n,s):n!==void 0&&l.push(n);let c=o.awaitWriteFinish,p;if(c&&(p=this._pendingWrites.get(r)))return p.lastChange=new Date,this;if(o.atomic){if(e===Vb)return this._pendingUnlinks.set(r,l),setTimeout(()=>{this._pendingUnlinks.forEach((u,g)=>{this.emit(...u),this.emit(nc,...u),this._pendingUnlinks.delete(g);});},typeof o.atomic=="number"?o.atomic:100),this;e===bo&&this._pendingUnlinks.has(r)&&(e=l[0]=vi,this._pendingUnlinks.delete(r));}if(c&&(e===bo||e===vi)&&this._readyEmitted){let u=(g,y)=>{g?(e=l[0]=ic,l[1]=g,this.emitWithAll(e,l)):y&&(l.length>2?l[2]=y:l.push(y),this.emitWithAll(e,l));};return this._awaitWriteFinish(r,c.stabilityThreshold,e,u),this}if(e===vi&&!this._throttle(vi,r,50))return this;if(o.alwaysStat&&n===void 0&&(e===bo||e===qF||e===vi)){let u=o.cwd?ye.join(o.cwd,r):r,g;try{g=await eq(u);}catch{}if(!g||this.closed)return;l.push(g);}return this.emitWithAll(e,l),this}_handleError(e){let r=e&&e.code;return e&&r!=="ENOENT"&&r!=="ENOTDIR"&&(!this.options.ignorePermissionErrors||r!=="EPERM"&&r!=="EACCES")&&this.emit(ic,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,l=()=>{let p=s.get(r),u=p?p.count:0;return s.delete(r),clearTimeout(o),p&&clearTimeout(p.timeoutObject),u};o=setTimeout(l,n);let c={timeoutObject:o,clear:l,count:0};return s.set(r,c),c}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,r,n,s){let i,o=e;this.options.cwd&&!ye.isAbsolute(e)&&(o=ye.join(this.options.cwd,e));let l=new Date,c=p=>{dc.stat(o,(u,g)=>{if(u||!this._pendingWrites.has(e)){u&&u.code!=="ENOENT"&&s(u);return}let y=Number(new Date);p&&g.size!==p.size&&(this._pendingWrites.get(e).lastChange=y);let m=this._pendingWrites.get(e);y-m.lastChange>=r?(this._pendingWrites.delete(e),s(void 0,g)):i=setTimeout(c,this.options.awaitWriteFinish.pollInterval,g);});};this._pendingWrites.has(e)||(this._pendingWrites.set(e,{lastChange:l,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&&UF.test(e))return !0;if(!this._userIgnored){let{cwd:n}=this.options,s=this.options.ignored,i=s&&s.map(Qb(n)),o=fc(i).filter(c=>typeof c===gc&&!rc(c)).map(c=>c+oc),l=this._getGlobIgnored().map(Qb(n)).concat(i,o);this._userIgnored=ac(l,void 0,uc);}return this._userIgnored([e,r])}_isntIgnored(e,r){return !this._isIgnored(e,r)}_getWatchHelpers(e,r){let n=r||this.options.disableGlobbing||!rc(e)?e:$F(e),s=this.options.followSymlinks;return new pc(e,n,s,this)}_getWatchedDir(e){this._boundRemove||(this._boundRemove=this._remove.bind(this));let r=ye.resolve(e);return this._watched.has(r)||this._watched.set(r,new hc(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=ye.join(e,r),i=ye.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(y=>this._remove(s,y));let c=this._getWatchedDir(e),p=c.has(r);c.remove(r),this._symlinkPaths.has(i)&&this._symlinkPaths.delete(i);let u=s;if(this.options.cwd&&(u=ye.relative(this.options.cwd,s)),this.options.awaitWriteFinish&&this._pendingWrites.has(u)&&this._pendingWrites.get(u).cancelWait()===bo)return;this._watched.delete(s),this._watched.delete(i);let g=n?DF:Vb;p&&!this._isIgnored(s)&&this._emit(g,s),this.options.useFsEvents||this._closePath(s);}_closePath(e){this._closeFile(e);let r=ye.dirname(e);this._getWatchedDir(r).remove(ye.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:nc,alwaysStat:!0,lstat:!0,...r},s=TF(e,n);return this._streams.add(s),s.once(MF,()=>{s=void 0;}),s.once(jF,()=>{s&&(this._streams.delete(s),s=void 0);}),s}};yc.FSWatcher=Eo;var sq=(t,e)=>{let r=new Eo(e);return r.add(t),r};yc.watch=sq;});var d0=R((Ur,p0)=>{var _c=z("crypto");Ur=p0.exports=Ci;function Ci(t,e){return e=f0(t,e),uq(t,e)}Ur.sha1=function(t){return Ci(t)};Ur.keys=function(t){return Ci(t,{excludeValues:!0,algorithm:"sha1",encoding:"hex"})};Ur.MD5=function(t){return Ci(t,{algorithm:"md5",encoding:"hex"})};Ur.keysMD5=function(t){return Ci(t,{algorithm:"md5",encoding:"hex",excludeValues:!0})};var On=_c.getHashes?_c.getHashes().slice():["sha1","md5"];On.push("passthrough");var u0=["buffer","hex","binary","base64"];function f0(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<On.length;++n)On[n].toLowerCase()===r.algorithm.toLowerCase()&&(r.algorithm=On[n]);if(On.indexOf(r.algorithm)===-1)throw new Error('Algorithm "'+r.algorithm+'" not supported. supported values: '+On.join(", "));if(u0.indexOf(r.encoding)===-1&&r.algorithm!=="passthrough")throw new Error('Encoding "'+r.encoding+'" not supported. supported values: '+u0.join(", "));return r}function c0(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 uq(t,e){var r;e.algorithm!=="passthrough"?r=_c.createHash(e.algorithm):r=new h0,typeof r.write>"u"&&(r.write=r.update,r.end=r.update);var n=xc(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)}Ur.writeToStream=function(t,e,r){return typeof r>"u"&&(r=e,e={}),e=f0(t,e),xc(e,r).dispatch(t)};function xc(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),l=i.exec(o);l?l=l[1]:l="unknown:["+o+"]",l=l.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(l!=="object"&&l!=="function"&&l!=="asyncfunction")if(this["_"+l])this["_"+l](s);else {if(t.ignoreUnknown)return n("["+l+"]");throw new Error('Unknown object type "'+l+'"')}else {var p=Object.keys(s);t.unorderedObjects&&(p=p.sort()),t.respectType!==!1&&!c0(s)&&p.splice(0,0,"prototype","__proto__","constructor"),t.excludeKeys&&(p=p.filter(function(g){return !t.excludeKeys(g)})),n("object:"+p.length+":");var u=this;return p.forEach(function(g){u.dispatch(g),n(":"),t.excludeValues||u.dispatch(s[g]),n(",");})}},_array:function(s,i){i=typeof i<"u"?i:t.unorderedArrays!==!1;var o=this;if(n("array:"+s.length+":"),!i||s.length<=1)return s.forEach(function(p){return o.dispatch(p)});var l=[],c=s.map(function(p){var u=new h0,g=r.slice(),y=xc(t,u,g);return y.dispatch(p),l=l.concat(g.slice(r.length)),u.read().toString()});return r=r.concat(l),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:"),c0(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 h0(){return {buf:"",write:function(t){this.buf+=t;},end:function(t){this.buf+=t;},read:function(){return this.buf}}}});var $c=R((wB,C0)=>{var Tc=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?Ri(this.lower(e),this.upper(e)):Ri(e,r)}};function Ri(t,e,r=10){if(t===e)return t;if(t*e<=0)return 0;if(e<0)return -Ri(-e,-t,r);if(t>e)return Ri(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}C0.exports={Binning:Tc,shorten:Ri};});var O0=R((SB,R0)=>{var{Binning:gq}=$c(),yq="stats-logscale/univariate@1.0",Oi=class t extends gq{constructor(e={}){super(e),this.storage=new Map,this._count=0,this._cache={},this.neat=new Pi(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:yq,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((l,c)=>l[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(l=>l[0]>=r&&l[0]<=n);let s=[this.round(r),0],i=[this.round(n),0],o=[s];for(let[l,c]of this._cache.data)l<=s[0]?s[1]+=c:l>=i[0]?i[1]+=c:o.push([l,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]),l=this.upper(n[s][0])-o;return o+l*(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,l=n!==r[s][0]?0:(r[s][2]-r[s][1])*(e-this.lower(e))/(this.upper(e)-this.lower(e));return o+l}histogram(e={}){if(!this._count)return [];let r=this.min(),n=this.max(),s=e.count||10,i=[],o=r,l=(n-r)/s;for(let c=0;c<s;c++)i.push([this._rawCdf(o+l),o,o+=l]);for(let c=i.length;c-- >1;)i[c][0]-=i[c-1][0];if(i[0][0]-=this._rawCdf(r),e.scale){let c=0;for(let p=0;p<i.length;p++)c<i[p][0]&&(c=i[p][0]);for(let p=0;p<i.length;p++)i[p][0]=i[p][0]*e.scale/c;}return i}_cumulative(){if(!this._cache.cumulative){let e=this.getBins(),r=[],n=0;for(let s=0;s<e.length;s++)r.push([e[s][0],n,n+=e[s][1]]);this._cache.cumulative=r;}return this._cache.cumulative}};["cdf+","kurtosis","max","mean","min","moment+","momentAbs+","momentStd+","quantile+","skewness","stdev"].forEach(t=>{let e=!!t.match(/\+/);e&&(t=t.replace("+",""));let r=Oi.prototype[t];if(typeof r!="function")throw new Error('method "'+t+'" is cached but never defined');Oi.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 Pi=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=>{Pi.prototype[t]=function(e){return this._main.shorten(this._main[t](e))};});["cdf","count"].forEach(t=>{Pi.prototype[t]=function(e){return this._main[t](e)};});R0.exports={Univariate:Oi};});var P0=R((bB,Ic)=>{(()=>{let{Binning:t}=$c(),{Univariate:e}=O0(),r={Binning:t,Univariate:e};typeof window<"u"&&(window.logstat=r),typeof Ic=="object"&&(Ic.exports=r);})();});var Mi=new Uint8Array(256),Ni=Mi.length;function Ko(){return Ni>Mi.length-16&&(ZE__default.default.randomFillSync(Mi),Ni=0),Mi.slice(Ni,Ni+=16)}var Be=[];for(let t=0;t<256;++t)Be.push((t+256).toString(16).slice(1));function Rf(t,e=0){return Be[t[e+0]]+Be[t[e+1]]+Be[t[e+2]]+Be[t[e+3]]+"-"+Be[t[e+4]]+Be[t[e+5]]+"-"+Be[t[e+6]]+Be[t[e+7]]+"-"+Be[t[e+8]]+Be[t[e+9]]+"-"+Be[t[e+10]]+Be[t[e+11]]+Be[t[e+12]]+Be[t[e+13]]+Be[t[e+14]]+Be[t[e+15]]}var Vo={randomUUID:ZE__default.default.randomUUID};function tA(t,e,r){if(Vo.randomUUID&&!e&&!t)return Vo.randomUUID();t=t||{};let n=t.random||(t.rng||Ko)();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 Rf(n)}var Ar=tA;var Lc=Nn(wg());var ar={defaultMerge:Symbol("deepmerge-ts: default merge"),skip:Symbol("deepmerge-ts: skip")};function OC(t,e){return e}function Sg(t){return typeof t!="object"||t===null?0:Array.isArray(t)?2:$C(t)?1:t instanceof Set?3:t instanceof Map?4:5}function PC(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 TC(t,e){return typeof t=="object"&&Object.prototype.propertyIsEnumerable.call(t,e)}function Eg(t){return {*[Symbol.iterator](){for(let e of t)for(let r of e)yield r;}}}var bg=new Set(["[object Object]","[object Module]"]);function $C(t){if(!bg.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"||!bg.has(Object.prototype.toString.call(r))||!r.hasOwnProperty("isPrototypeOf"))}function IC(t,e,r){let n={};for(let s of PC(t)){let i=[];for(let c of t)TC(c,s)&&i.push(c[s]);if(i.length===0)continue;let o=e.metaDataUpdater(r,{key:s,parents:t}),l=xg(i,e,o);l!==ar.skip&&(s==="__proto__"?Object.defineProperty(n,s,{value:l,configurable:!0,enumerable:!0,writable:!0}):n[s]=l);}return n}function kC(t){return t.flat()}function LC(t){return new Set(Eg(t))}function FC(t){return new Map(Eg(t))}function Ag(t){return t.at(-1)}var el=Object.freeze({__proto__:null,mergeArrays:kC,mergeMaps:FC,mergeOthers:Ag,mergeRecords:IC,mergeSets:LC});function _g(...t){return qC({})(...t)}function qC(t,e){let r=DC(t,n);function n(...s){return xg(s,r,e)}return n}function DC(t,e){return {defaultMergeFunctions:el,mergeFunctions:{...el,...Object.fromEntries(Object.entries(t).filter(([r,n])=>Object.hasOwn(el,r)).map(([r,n])=>n===!1?[r,Ag]:[r,n]))},metaDataUpdater:t.metaDataUpdater??OC,deepmerge:e,useImplicitDefaultMerging:t.enableImplicitDefaultMerging??!1,actions:ar}}function xg(t,e,r){if(t.length===0)return;if(t.length===1)return tl(t,e,r);let n=Sg(t[0]);if(n!==0&&n!==5){for(let s=1;s<t.length;s++)if(Sg(t[s])!==n)return tl(t,e,r)}switch(n){case 1:return NC(t,e,r);case 2:return MC(t,e,r);case 3:return jC(t,e,r);case 4:return BC(t,e,r);default:return tl(t,e,r)}}function NC(t,e,r){let n=e.mergeFunctions.mergeRecords(t,e,r);return n===ar.defaultMerge||e.useImplicitDefaultMerging&&n===void 0&&e.mergeFunctions.mergeRecords!==e.defaultMergeFunctions.mergeRecords?e.defaultMergeFunctions.mergeRecords(t,e,r):n}function MC(t,e,r){let n=e.mergeFunctions.mergeArrays(t,e,r);return n===ar.defaultMerge||e.useImplicitDefaultMerging&&n===void 0&&e.mergeFunctions.mergeArrays!==e.defaultMergeFunctions.mergeArrays?e.defaultMergeFunctions.mergeArrays(t):n}function jC(t,e,r){let n=e.mergeFunctions.mergeSets(t,e,r);return n===ar.defaultMerge||e.useImplicitDefaultMerging&&n===void 0&&e.mergeFunctions.mergeSets!==e.defaultMergeFunctions.mergeSets?e.defaultMergeFunctions.mergeSets(t):n}function BC(t,e,r){let n=e.mergeFunctions.mergeMaps(t,e,r);return n===ar.defaultMerge||e.useImplicitDefaultMerging&&n===void 0&&e.mergeFunctions.mergeMaps!==e.defaultMergeFunctions.mergeMaps?e.defaultMergeFunctions.mergeMaps(t):n}function tl(t,e,r){let n=e.mergeFunctions.mergeOthers(t,e,r);return n===ar.defaultMerge||e.useImplicitDefaultMerging&&n===void 0&&e.mergeFunctions.mergeOthers!==e.defaultMergeFunctions.mergeOthers?e.defaultMergeFunctions.mergeOthers(t):n}var Kn=t=>{let e=typeof t;return t!==null&&(e==="object"||e==="function")};var rl=new Set(["__proto__","prototype","constructor"]),HC=new Set("0123456789");function nl(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(rl.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(rl.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"&&!HC.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(rl.has(r))return [];e.push(r);break}case"index":throw new Error("Index was not closed");case"start":{e.push("");break}}return e}function Cg(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 Rg(t,e){if(Cg(t,e))throw new Error("Cannot use string index")}function Og(t,e,r){if(!Kn(t)||typeof e!="string")return r===void 0?t:r;let n=nl(e);if(n.length===0)return r;for(let s=0;s<n.length;s++){let i=n[s];if(Cg(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 sn(t,e,r){if(!Kn(t)||typeof e!="string")return t;let n=t,s=nl(e);for(let i=0;i<s.length;i++){let o=s[i];Rg(t,o),i===s.length-1?t[o]=r:Kn(t[o])||(t[o]=typeof s[i+1]=="number"?[]:{}),t=t[o];}return n}function Pg(t,e){if(!Kn(t)||typeof e!="string")return !1;let r=nl(e);for(let n=0;n<r.length;n++){let s=r[n];if(Rg(t,s),n===r.length-1)return delete t[s],!0;if(t=t[s],!Kn(t))return !1}}var UC={"Content-Type":"application/json"},WC=/\/*$/;function Or(t={}){let{fetch:e=globalThis.fetch,querySerializer:r,bodySerializer:n,...s}=t;async function i(o,l){let{headers:c,body:p,params:u={},parseAs:g="json",querySerializer:y=r??zC,bodySerializer:m=n??GC,...v}=l||{},b=KC(o,{baseUrl:s.baseUrl,params:u,querySerializer:y}),_=VC(UC,t?.headers,c,u.header),x={redirect:"follow",...s,...v,headers:_};p&&(x.body=m(p)),x.body instanceof FormData&&_.delete("Content-Type");let A=await e(b,x);if(A.status===204||A.headers.get("Content-Length")==="0")return A.ok?{data:{},response:A}:{error:{},response:A};if(A.ok){let I=A.body;if(g!=="stream"){let F=A.clone();I=typeof F[g]=="function"?await F[g]():await F.text();}return {data:I,response:A}}let O={};try{O=await A.clone().json();}catch{O=await A.clone().text();}return {error:O,response:A}}return {async GET(o,l){return i(o,{...l,method:"GET"})},async PUT(o,l){return i(o,{...l,method:"PUT"})},async POST(o,l){return i(o,{...l,method:"POST"})},async DELETE(o,l){return i(o,{...l,method:"DELETE"})},async OPTIONS(o,l){return i(o,{...l,method:"OPTIONS"})},async HEAD(o,l){return i(o,{...l,method:"HEAD"})},async PATCH(o,l){return i(o,{...l,method:"PATCH"})},async TRACE(o,l){return i(o,{...l,method:"TRACE"})}}}function zC(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 GC(t){return JSON.stringify(t)}function KC(t,e){let r=`${e.baseUrl?e.baseUrl.replace(WC,""):""}${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 VC(...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 qg=Nn(kg());function Pe(t){let e=t.match(/.*(?:$|\r?\n)/g).filter(Boolean);return e.length>0&&e[e.length-1].endsWith(`
`)&&e.push(""),e}function ge(t){return t.trim().length===0}var Lg=[["(",")"],["[","]"],["{","}"],["'","'"],['"','"'],["`","`"]],Fg=Lg.map(t=>t[0]),ws=Lg.map(t=>t[1]);function Ss(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 on(t,e){return qg.get(t,e)}function Yn(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 at=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 bs(t){return t instanceof Error&&t.name==="TimeoutError"||t instanceof at&&[408,499].indexOf(t.status)!==-1}function an(t){return t instanceof Error&&t.name==="AbortError"}function sl(t){this.message=t;}sl.prototype=new Error,sl.prototype.name="InvalidCharacterError";var Dg=typeof window<"u"&&window.atob&&window.atob.bind(window)||function(t){var e=String(t).replace(/=+$/,"");if(e.length%4==1)throw new sl("'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 QC(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(Dg(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 Dg(e)}}function Es(t){this.message=t;}function ZC(t,e){if(typeof t!="string")throw new Es("Invalid token specified");var r=(e=e||{}).header===!0?0:1;try{return JSON.parse(QC(t.split(".")[r]))}catch(n){throw new Es("Invalid token specified: "+n.message)}}Es.prototype=new Error,Es.prototype.name="InvalidTokenError";var As=ZC;Jn();var Fs=(()=>{let t=z("path").join(z("os").homedir(),".tabby-client","agent","data.json"),e=Al();return {data:{},load:async function(){await this.migrateFrom_0_3_0(),this.data=await e.readJson(t,{throws:!1})||{};},save:async function(){await e.outputJson(t,this.data);},migrateFrom_0_3_0:async function(){let r=z("path").join(z("os").homedir(),".tabby","agent","data.json"),n=z("path").join(z("os").homedir(),".tabby","agent",".data_json_migrated");if(await e.pathExists(r)&&!await e.pathExists(n)){let s=await e.readJson(r);await e.outputJson(t,s),await e.outputFile(n,"");}}}})();Nt();var lt=class lt extends events.EventEmitter{constructor(r){super();this.logger=Ce.child({component:"Auth"});this.dataStore=null;this.refreshTokenTimer=null;this.jwt=null;this.endpoint=r.endpoint,this.dataStore=r.dataStore||Fs,this.authApi=Or({baseUrl:"https://app.tabbyml.com/api"}),this.scheduleRefreshToken();}static async create(r){let n=new lt(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:As(r)};n.payload.exp*1e3-Date.now()<lt.tokenStrategy.refresh.beforeExpire?(this.jwt=await this.refreshToken(n,lt.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 at(n.response);let s=n.data;this.logger.debug({deviceToken:s},"Request device token response");let i=new URL(lt.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=Yn([AbortSignal.timeout(lt.tokenStrategy.polling.timeout),n?.signal]),l=setInterval(async()=>{try{let c=await this.authApi.POST("/device-token/accept",{params:{query:{code:r}},signal:o});if(c.error)throw new at(c.response);let p=c.data;this.logger.debug({result:p},"Poll jwt response"),this.jwt={token:p.data.jwt,payload:As(p.data.jwt)},super.emit("updated",this.jwt),await this.save(),clearInterval(l),s(!0);}catch(c){c instanceof at&&[400,401,403,405].indexOf(c.status)!==-1?this.logger.debug({error:c},"Expected error when polling jwt"):this.logger.error({error:c},"Error when polling jwt");}},lt.tokenStrategy.polling.interval);o.aborted?(clearInterval(l),i(o.reason)):o.addEventListener("abort",()=>{clearInterval(l),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 at(i.response);let o=i.data;return this.logger.debug({refreshedJwt:o},"Refresh token response"),{token:o.data.jwt,payload:As(o.data.jwt)}}catch(i){if(i instanceof at&&[400,401,403,405].indexOf(i.status)!==-1)this.logger.debug({error:i},"Error when refreshing jwt");else if(this.logger.error({error:i},"Unknown error when refreshing jwt"),s<n.maxTry)return this.logger.debug(`Retry refreshing jwt after ${n.retryDelay}ms`),await new Promise(o=>setTimeout(o,n.retryDelay)),this.refreshToken(r,n,s+1);throw {...i,retry:s}}}scheduleRefreshToken(){this.refreshTokenTimer=setInterval(async()=>{if(!this.jwt)return null;if(this.jwt.payload.exp*1e3-Date.now()<lt.tokenStrategy.refresh.beforeExpire)try{this.jwt=await this.refreshToken(this.jwt,lt.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");},lt.tokenStrategy.refresh.interval);}};lt.authPageUrl="https://app.tabbyml.com/account/device-token",lt.tokenStrategy={polling:{interval:5e3,timeout:5*60*1e3},refresh:{interval:15*60*1e3,beforeExpire:30*60*1e3,whenLoaded:{maxTry:5,retryDelay:1e3},whenScheduled:{maxTry:60,retryDelay:30*1e3}}};var ro=lt;Jn();var mc={server:{endpoint:"http://localhost:8080",requestHeaders:{},requestTimeout:3e4},completion:{prompt:{maxPrefixLines:20,maxSuffixLines:20},debounce:{mode:"adaptive",interval:250},timeout:{auto:4e3,manually:4e3}},logs:{level:"silent"},anonymousUsageTracking:{disable:!1}},oq=`## Tabby agent configuration file
## You can uncomment any block to enable settings.
## Configurations in this file has lower priority than in IDE settings.
## Server
## You can set the server endpoint and request timeout here.
# [server]
# endpoint = "http://localhost:8080" # http or https URL
# requestTimeout = 30000 # ms
## You can add custom request headers, e.g. for authentication.
# [server.requestHeaders]
# Authorization = "Bearer eyJhbGciOiJ..........."
## Completion
## You can set the prompt context to send to the server for completion.
# [completion.prompt]
# maxPrefixLines = 20
# maxSuffixLines = 20
## You can set the debounce mode for auto completion requests when typing.
# [completion.debounce]
# mode = "adaptive" # or "fixed"
# interval = 250 # ms, only used when mode is "fixed"
## You can set the timeout for completion requests.
# [completion.timeout]
# auto = 5000 # ms, for auto completion when typing
# manually = 30000 # ms, for manually triggered completion
## Logs
## You can set the log level here. The log file is located at ~/.tabby-client/agent/logs/.
# [logs]
# level = "silent" # or "error" or "debug"
## Anonymous usage tracking
## You can disable anonymous usage tracking here.
# [anonymousUsageTracking]
# disable = false # set to true to disable
`,aq=`## Tabby agent configuration file
## You can uncomment any block to enable settings.
## Configurations in this file has lower priority than in IDE settings.
## Server
## You can set the server endpoint here.
# [server]
# endpoint = "http://localhost:8080" # http or https URL
## You can add custom request headers, e.g. for authentication.
# [server.requestHeaders]
# Authorization = "Bearer eyJhbGciOiJ..........."
## Logs
## You can set the log level here. The log file is located at ~/.tabby-client/agent/logs/.
# [logs]
# level = "silent" # or "error" or "debug"
## Anonymous usage tracking
## You can disable anonymous usage tracking here.
# [anonymousUsageTracking]
# disable = false # set to true to disable
`,bn=(()=>{let t=z("events"),e=Al(),r=sS(),n=n0();class s extends t{constructor(c){super();this.data={};this.watcher=null;this.logger=(Nt(),zo(Zw)).rootLogger.child({component:"ConfigFile"});this.filepath=c;}get config(){return this.data}async load(){try{let c=await e.readFile(this.filepath,"utf8");if(c.trim()===oq.trim())return await this.createTemplate(),await this.load();this.data=r.parse(c),super.emit("updated",this.data);}catch(c){c.code==="ENOENT"?await this.createTemplate():this.logger.error({error:c},"Failed to load config file");}}async createTemplate(){try{await e.outputFile(this.filepath,aq);}catch(c){this.logger.error({error:c},"Failed to create config template file");}}watch(){this.watcher=n.watch(this.filepath,{interval:1e3}),this.watcher.on("add",this.load.bind(this)),this.watcher.on("change",this.load.bind(this));}}let i=z("path").join(z("os").homedir(),".tabby-client","agent","config.toml");return new s(i)})();var wi=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,s0=new Set,vc=typeof process=="object"&&process?process:{},o0=(t,e,r,n)=>{typeof vc.emitWarning=="function"?vc.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`);},xo=globalThis.AbortController,i0=globalThis.AbortSignal;if(typeof xo>"u"){i0=class{constructor(){ne(this,"onabort");ne(this,"_onabort",[]);ne(this,"reason");ne(this,"aborted",!1);}addEventListener(n,s){this._onabort.push(s);}},xo=class{constructor(){ne(this,"signal",new i0);e();}abort(n){if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=!0;for(let s of this.signal._onabort)s(n);this.signal.onabort?.(n);}}};let t=vc.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=!1,o0("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 lq=t=>!s0.has(t),yr=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),a0=t=>yr(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?En:null:null,En=class extends Array{constructor(e){super(e),this.fill(0);}},An,Mr=class Mr{constructor(e,r){ne(this,"heap");ne(this,"length");if(!S(Mr,An))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0;}static create(e){let r=a0(e);if(!r)return [];re(Mr,An,!0);let n=new Mr(e,r);return re(Mr,An,!1),n}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}};An=new WeakMap,ae(Mr,An,!1);var wc=Mr,Ct,ft,jt,Rt,_n,Te,Ot,$e,Se,oe,Je,ht,ze,qe,Pt,Ue,Yt,Jt,Tt,Bt,wr,it,bi,Sc,jr,Xt,Ei,pt,Ro,l0,Br,xn,Ai,Ht,mr,Ut,vr,_i,bc,Cn,Ao,Rn,_o,ve,be,xi,Ec,Hr,Si,Ac=class Ac{constructor(e){ae(this,bi);ae(this,Ro);ae(this,Ht);ae(this,Ut);ae(this,_i);ae(this,Cn);ae(this,Rn);ae(this,ve);ae(this,xi);ae(this,Hr);ae(this,Ct,void 0);ae(this,ft,void 0);ae(this,jt,void 0);ae(this,Rt,void 0);ae(this,_n,void 0);ne(this,"ttl");ne(this,"ttlResolution");ne(this,"ttlAutopurge");ne(this,"updateAgeOnGet");ne(this,"updateAgeOnHas");ne(this,"allowStale");ne(this,"noDisposeOnSet");ne(this,"noUpdateTTL");ne(this,"maxEntrySize");ne(this,"sizeCalculation");ne(this,"noDeleteOnFetchRejection");ne(this,"noDeleteOnStaleGet");ne(this,"allowStaleOnFetchAbort");ne(this,"allowStaleOnFetchRejection");ne(this,"ignoreFetchAbort");ae(this,Te,void 0);ae(this,Ot,void 0);ae(this,$e,void 0);ae(this,Se,void 0);ae(this,oe,void 0);ae(this,Je,void 0);ae(this,ht,void 0);ae(this,ze,void 0);ae(this,qe,void 0);ae(this,Pt,void 0);ae(this,Ue,void 0);ae(this,Yt,void 0);ae(this,Jt,void 0);ae(this,Tt,void 0);ae(this,Bt,void 0);ae(this,wr,void 0);ae(this,it,void 0);ae(this,jr,()=>{});ae(this,Xt,()=>{});ae(this,Ei,()=>{});ae(this,pt,()=>!1);ae(this,Br,e=>{});ae(this,xn,(e,r,n)=>{});ae(this,Ai,(e,r,n,s)=>{if(n||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});let{max:r=0,ttl:n,ttlResolution:s=1,ttlAutopurge:i,updateAgeOnGet:o,updateAgeOnHas:l,allowStale:c,dispose:p,disposeAfter:u,noDisposeOnSet:g,noUpdateTTL:y,maxSize:m=0,maxEntrySize:v=0,sizeCalculation:b,fetchMethod:_,noDeleteOnFetchRejection:x,noDeleteOnStaleGet:A,allowStaleOnFetchRejection:O,allowStaleOnFetchAbort:I,ignoreFetchAbort:F}=e;if(r!==0&&!yr(r))throw new TypeError("max option must be a nonnegative integer");let U=r?a0(r):Array;if(!U)throw new Error("invalid max value: "+r);if(re(this,Ct,r),re(this,ft,m),this.maxEntrySize=v||S(this,ft),this.sizeCalculation=b,this.sizeCalculation){if(!S(this,ft)&&!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(_!==void 0&&typeof _!="function")throw new TypeError("fetchMethod must be a function if specified");if(re(this,_n,_),re(this,wr,!!_),re(this,$e,new Map),re(this,Se,new Array(r).fill(void 0)),re(this,oe,new Array(r).fill(void 0)),re(this,Je,new U(r)),re(this,ht,new U(r)),re(this,ze,0),re(this,qe,0),re(this,Pt,wc.create(r)),re(this,Te,0),re(this,Ot,0),typeof p=="function"&&re(this,jt,p),typeof u=="function"?(re(this,Rt,u),re(this,Ue,[])):(re(this,Rt,void 0),re(this,Ue,void 0)),re(this,Bt,!!S(this,jt)),re(this,it,!!S(this,Rt)),this.noDisposeOnSet=!!g,this.noUpdateTTL=!!y,this.noDeleteOnFetchRejection=!!x,this.allowStaleOnFetchRejection=!!O,this.allowStaleOnFetchAbort=!!I,this.ignoreFetchAbort=!!F,this.maxEntrySize!==0){if(S(this,ft)!==0&&!yr(S(this,ft)))throw new TypeError("maxSize must be a positive integer if specified");if(!yr(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");ee(this,Ro,l0).call(this);}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!A,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!l,this.ttlResolution=yr(s)||s===0?s:1,this.ttlAutopurge=!!i,this.ttl=n||0,this.ttl){if(!yr(this.ttl))throw new TypeError("ttl must be a positive integer if specified");ee(this,bi,Sc).call(this);}if(S(this,Ct)===0&&this.ttl===0&&S(this,ft)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!S(this,Ct)&&!S(this,ft)){let H="LRU_CACHE_UNBOUNDED";lq(H)&&(s0.add(H),o0("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",H,Ac));}}static unsafeExposeInternals(e){return {starts:S(e,Jt),ttls:S(e,Tt),sizes:S(e,Yt),keyMap:S(e,$e),keyList:S(e,Se),valList:S(e,oe),next:S(e,Je),prev:S(e,ht),get head(){return S(e,ze)},get tail(){return S(e,qe)},free:S(e,Pt),isBackgroundFetch:r=>{var n;return ee(n=e,ve,be).call(n,r)},backgroundFetch:(r,n,s,i)=>{var o;return ee(o=e,Rn,_o).call(o,r,n,s,i)},moveToTail:r=>{var n;return ee(n=e,Hr,Si).call(n,r)},indexes:r=>{var n;return ee(n=e,Ht,mr).call(n,r)},rindexes:r=>{var n;return ee(n=e,Ut,vr).call(n,r)},isStale:r=>{var n;return S(n=e,pt).call(n,r)}}}get max(){return S(this,Ct)}get maxSize(){return S(this,ft)}get calculatedSize(){return S(this,Ot)}get size(){return S(this,Te)}get fetchMethod(){return S(this,_n)}get dispose(){return S(this,jt)}get disposeAfter(){return S(this,Rt)}getRemainingTTL(e){return S(this,$e).has(e)?1/0:0}*entries(){for(let e of ee(this,Ht,mr).call(this))S(this,oe)[e]!==void 0&&S(this,Se)[e]!==void 0&&!ee(this,ve,be).call(this,S(this,oe)[e])&&(yield [S(this,Se)[e],S(this,oe)[e]]);}*rentries(){for(let e of ee(this,Ut,vr).call(this))S(this,oe)[e]!==void 0&&S(this,Se)[e]!==void 0&&!ee(this,ve,be).call(this,S(this,oe)[e])&&(yield [S(this,Se)[e],S(this,oe)[e]]);}*keys(){for(let e of ee(this,Ht,mr).call(this)){let r=S(this,Se)[e];r!==void 0&&!ee(this,ve,be).call(this,S(this,oe)[e])&&(yield r);}}*rkeys(){for(let e of ee(this,Ut,vr).call(this)){let r=S(this,Se)[e];r!==void 0&&!ee(this,ve,be).call(this,S(this,oe)[e])&&(yield r);}}*values(){for(let e of ee(this,Ht,mr).call(this))S(this,oe)[e]!==void 0&&!ee(this,ve,be).call(this,S(this,oe)[e])&&(yield S(this,oe)[e]);}*rvalues(){for(let e of ee(this,Ut,vr).call(this))S(this,oe)[e]!==void 0&&!ee(this,ve,be).call(this,S(this,oe)[e])&&(yield S(this,oe)[e]);}[Symbol.iterator](){return this.entries()}find(e,r={}){for(let n of ee(this,Ht,mr).call(this)){let s=S(this,oe)[n],i=ee(this,ve,be).call(this,s)?s.__staleWhileFetching:s;if(i!==void 0&&e(i,S(this,Se)[n],this))return this.get(S(this,Se)[n],r)}}forEach(e,r=this){for(let n of ee(this,Ht,mr).call(this)){let s=S(this,oe)[n],i=ee(this,ve,be).call(this,s)?s.__staleWhileFetching:s;i!==void 0&&e.call(r,i,S(this,Se)[n],this);}}rforEach(e,r=this){for(let n of ee(this,Ut,vr).call(this)){let s=S(this,oe)[n],i=ee(this,ve,be).call(this,s)?s.__staleWhileFetching:s;i!==void 0&&e.call(r,i,S(this,Se)[n],this);}}purgeStale(){let e=!1;for(let r of ee(this,Ut,vr).call(this,{allowStale:!0}))S(this,pt).call(this,r)&&(this.delete(S(this,Se)[r]),e=!0);return e}dump(){let e=[];for(let r of ee(this,Ht,mr).call(this,{allowStale:!0})){let n=S(this,Se)[r],s=S(this,oe)[r],i=ee(this,ve,be).call(this,s)?s.__staleWhileFetching:s;if(i===void 0||n===void 0)continue;let o={value:i};if(S(this,Tt)&&S(this,Jt)){o.ttl=S(this,Tt)[r];let l=wi.now()-S(this,Jt)[r];o.start=Math.floor(Date.now()-l);}S(this,Yt)&&(o.size=S(this,Yt)[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=wi.now()-s;}this.set(r,n.value,n);}}set(e,r,n={}){var y,m;if(r===void 0)return this.delete(e),this;let{ttl:s=this.ttl,start:i,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:l=this.sizeCalculation,status:c}=n,{noUpdateTTL:p=this.noUpdateTTL}=n,u=S(this,Ai).call(this,e,r,n.size||0,l);if(this.maxEntrySize&&u>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this.delete(e),this;let g=S(this,Te)===0?void 0:S(this,$e).get(e);if(g===void 0)g=S(this,Te)===0?S(this,qe):S(this,Pt).length!==0?S(this,Pt).pop():S(this,Te)===S(this,Ct)?ee(this,Cn,Ao).call(this,!1):S(this,Te),S(this,Se)[g]=e,S(this,oe)[g]=r,S(this,$e).set(e,g),S(this,Je)[S(this,qe)]=g,S(this,ht)[g]=S(this,qe),re(this,qe,g),Di(this,Te)._++,S(this,xn).call(this,g,u,c),c&&(c.set="add"),p=!1;else {ee(this,Hr,Si).call(this,g);let v=S(this,oe)[g];if(r!==v){if(S(this,wr)&&ee(this,ve,be).call(this,v)?v.__abortController.abort(new Error("replaced")):o||(S(this,Bt)&&((y=S(this,jt))==null||y.call(this,v,e,"set")),S(this,it)&&S(this,Ue)?.push([v,e,"set"])),S(this,Br).call(this,g),S(this,xn).call(this,g,u,c),S(this,oe)[g]=r,c){c.set="replace";let b=v&&ee(this,ve,be).call(this,v)?v.__staleWhileFetching:v;b!==void 0&&(c.oldValue=b);}}else c&&(c.set="update");}if(s!==0&&!S(this,Tt)&&ee(this,bi,Sc).call(this),S(this,Tt)&&(p||S(this,Ei).call(this,g,s,i),c&&S(this,Xt).call(this,c,g)),!o&&S(this,it)&&S(this,Ue)){let v=S(this,Ue),b;for(;b=v?.shift();)(m=S(this,Rt))==null||m.call(this,...b);}return this}pop(){var e;try{for(;S(this,Te);){let r=S(this,oe)[S(this,ze)];if(ee(this,Cn,Ao).call(this,!0),ee(this,ve,be).call(this,r)){if(r.__staleWhileFetching)return r.__staleWhileFetching}else if(r!==void 0)return r}}finally{if(S(this,it)&&S(this,Ue)){let r=S(this,Ue),n;for(;n=r?.shift();)(e=S(this,Rt))==null||e.call(this,...n);}}}has(e,r={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:s}=r,i=S(this,$e).get(e);if(i!==void 0){let o=S(this,oe)[i];if(ee(this,ve,be).call(this,o)&&o.__staleWhileFetching===void 0)return !1;if(S(this,pt).call(this,i))s&&(s.has="stale",S(this,Xt).call(this,s,i));else return n&&S(this,jr).call(this,i),s&&(s.has="hit",S(this,Xt).call(this,s,i)),!0}else s&&(s.has="miss");return !1}peek(e,r={}){let{allowStale:n=this.allowStale}=r,s=S(this,$e).get(e);if(s!==void 0&&(n||!S(this,pt).call(this,s))){let i=S(this,oe)[s];return ee(this,ve,be).call(this,i)?i.__staleWhileFetching:i}}async fetch(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:l=this.noDisposeOnSet,size:c=0,sizeCalculation:p=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:g=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:y=this.allowStaleOnFetchRejection,ignoreFetchAbort:m=this.ignoreFetchAbort,allowStaleOnFetchAbort:v=this.allowStaleOnFetchAbort,context:b,forceRefresh:_=!1,status:x,signal:A}=r;if(!S(this,wr))return x&&(x.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:s,noDeleteOnStaleGet:i,status:x});let O={allowStale:n,updateAgeOnGet:s,noDeleteOnStaleGet:i,ttl:o,noDisposeOnSet:l,size:c,sizeCalculation:p,noUpdateTTL:u,noDeleteOnFetchRejection:g,allowStaleOnFetchRejection:y,allowStaleOnFetchAbort:v,ignoreFetchAbort:m,status:x,signal:A},I=S(this,$e).get(e);if(I===void 0){x&&(x.fetch="miss");let F=ee(this,Rn,_o).call(this,e,I,O,b);return F.__returned=F}else {let F=S(this,oe)[I];if(ee(this,ve,be).call(this,F)){let j=n&&F.__staleWhileFetching!==void 0;return x&&(x.fetch="inflight",j&&(x.returnedStale=!0)),j?F.__staleWhileFetching:F.__returned=F}let U=S(this,pt).call(this,I);if(!_&&!U)return x&&(x.fetch="hit"),ee(this,Hr,Si).call(this,I),s&&S(this,jr).call(this,I),x&&S(this,Xt).call(this,x,I),F;let H=ee(this,Rn,_o).call(this,e,I,O,b),k=H.__staleWhileFetching!==void 0&&n;return x&&(x.fetch=U?"stale":"refresh",k&&U&&(x.returnedStale=!0)),k?H.__staleWhileFetching:H.__returned=H}}get(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:o}=r,l=S(this,$e).get(e);if(l!==void 0){let c=S(this,oe)[l],p=ee(this,ve,be).call(this,c);return o&&S(this,Xt).call(this,o,l),S(this,pt).call(this,l)?(o&&(o.get="stale"),p?(o&&n&&c.__staleWhileFetching!==void 0&&(o.returnedStale=!0),n?c.__staleWhileFetching:void 0):(i||this.delete(e),o&&n&&(o.returnedStale=!0),n?c:void 0)):(o&&(o.get="hit"),p?c.__staleWhileFetching:(ee(this,Hr,Si).call(this,l),s&&S(this,jr).call(this,l),c))}else o&&(o.get="miss");}delete(e){var n,s;let r=!1;if(S(this,Te)!==0){let i=S(this,$e).get(e);if(i!==void 0)if(r=!0,S(this,Te)===1)this.clear();else {S(this,Br).call(this,i);let o=S(this,oe)[i];ee(this,ve,be).call(this,o)?o.__abortController.abort(new Error("deleted")):(S(this,Bt)||S(this,it))&&(S(this,Bt)&&((n=S(this,jt))==null||n.call(this,o,e,"delete")),S(this,it)&&S(this,Ue)?.push([o,e,"delete"])),S(this,$e).delete(e),S(this,Se)[i]=void 0,S(this,oe)[i]=void 0,i===S(this,qe)?re(this,qe,S(this,ht)[i]):i===S(this,ze)?re(this,ze,S(this,Je)[i]):(S(this,Je)[S(this,ht)[i]]=S(this,Je)[i],S(this,ht)[S(this,Je)[i]]=S(this,ht)[i]),Di(this,Te)._--,S(this,Pt).push(i);}}if(S(this,it)&&S(this,Ue)?.length){let i=S(this,Ue),o;for(;o=i?.shift();)(s=S(this,Rt))==null||s.call(this,...o);}return r}clear(){var e,r;for(let n of ee(this,Ut,vr).call(this,{allowStale:!0})){let s=S(this,oe)[n];if(ee(this,ve,be).call(this,s))s.__abortController.abort(new Error("deleted"));else {let i=S(this,Se)[n];S(this,Bt)&&((e=S(this,jt))==null||e.call(this,s,i,"delete")),S(this,it)&&S(this,Ue)?.push([s,i,"delete"]);}}if(S(this,$e).clear(),S(this,oe).fill(void 0),S(this,Se).fill(void 0),S(this,Tt)&&S(this,Jt)&&(S(this,Tt).fill(0),S(this,Jt).fill(0)),S(this,Yt)&&S(this,Yt).fill(0),re(this,ze,0),re(this,qe,0),S(this,Pt).length=0,re(this,Ot,0),re(this,Te,0),S(this,it)&&S(this,Ue)){let n=S(this,Ue),s;for(;s=n?.shift();)(r=S(this,Rt))==null||r.call(this,...s);}}};Ct=new WeakMap,ft=new WeakMap,jt=new WeakMap,Rt=new WeakMap,_n=new WeakMap,Te=new WeakMap,Ot=new WeakMap,$e=new WeakMap,Se=new WeakMap,oe=new WeakMap,Je=new WeakMap,ht=new WeakMap,ze=new WeakMap,qe=new WeakMap,Pt=new WeakMap,Ue=new WeakMap,Yt=new WeakMap,Jt=new WeakMap,Tt=new WeakMap,Bt=new WeakMap,wr=new WeakMap,it=new WeakMap,bi=new WeakSet,Sc=function(){let e=new En(S(this,Ct)),r=new En(S(this,Ct));re(this,Tt,e),re(this,Jt,r),re(this,Ei,(i,o,l=wi.now())=>{if(r[i]=o!==0?l:0,e[i]=o,o!==0&&this.ttlAutopurge){let c=setTimeout(()=>{S(this,pt).call(this,i)&&this.delete(S(this,Se)[i]);},o+1);c.unref&&c.unref();}}),re(this,jr,i=>{r[i]=e[i]!==0?wi.now():0;}),re(this,Xt,(i,o)=>{if(e[o]){let l=e[o],c=r[o];i.ttl=l,i.start=c,i.now=n||s();let p=i.now-c;i.remainingTTL=l-p;}});let n=0,s=()=>{let i=wi.now();if(this.ttlResolution>0){n=i;let o=setTimeout(()=>n=0,this.ttlResolution);o.unref&&o.unref();}return i};this.getRemainingTTL=i=>{let o=S(this,$e).get(i);if(o===void 0)return 0;let l=e[o],c=r[o];if(l===0||c===0)return 1/0;let p=(n||s())-c;return l-p},re(this,pt,i=>e[i]!==0&&r[i]!==0&&(n||s())-r[i]>e[i]);},jr=new WeakMap,Xt=new WeakMap,Ei=new WeakMap,pt=new WeakMap,Ro=new WeakSet,l0=function(){let e=new En(S(this,Ct));re(this,Ot,0),re(this,Yt,e),re(this,Br,r=>{re(this,Ot,S(this,Ot)-e[r]),e[r]=0;}),re(this,Ai,(r,n,s,i)=>{if(ee(this,ve,be).call(this,n))return 0;if(!yr(s))if(i){if(typeof i!="function")throw new TypeError("sizeCalculation must be a function");if(s=i(n,r),!yr(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}),re(this,xn,(r,n,s)=>{if(e[r]=n,S(this,ft)){let i=S(this,ft)-e[r];for(;S(this,Ot)>i;)ee(this,Cn,Ao).call(this,!0);}re(this,Ot,S(this,Ot)+e[r]),s&&(s.entrySize=n,s.totalCalculatedSize=S(this,Ot));});},Br=new WeakMap,xn=new WeakMap,Ai=new WeakMap,Ht=new WeakSet,mr=function*({allowStale:e=this.allowStale}={}){if(S(this,Te))for(let r=S(this,qe);!(!ee(this,_i,bc).call(this,r)||((e||!S(this,pt).call(this,r))&&(yield r),r===S(this,ze)));)r=S(this,ht)[r];},Ut=new WeakSet,vr=function*({allowStale:e=this.allowStale}={}){if(S(this,Te))for(let r=S(this,ze);!(!ee(this,_i,bc).call(this,r)||((e||!S(this,pt).call(this,r))&&(yield r),r===S(this,qe)));)r=S(this,Je)[r];},_i=new WeakSet,bc=function(e){return e!==void 0&&S(this,$e).get(S(this,Se)[e])===e},Cn=new WeakSet,Ao=function(e){var i;let r=S(this,ze),n=S(this,Se)[r],s=S(this,oe)[r];return S(this,wr)&&ee(this,ve,be).call(this,s)?s.__abortController.abort(new Error("evicted")):(S(this,Bt)||S(this,it))&&(S(this,Bt)&&((i=S(this,jt))==null||i.call(this,s,n,"evict")),S(this,it)&&S(this,Ue)?.push([s,n,"evict"])),S(this,Br).call(this,r),e&&(S(this,Se)[r]=void 0,S(this,oe)[r]=void 0,S(this,Pt).push(r)),S(this,Te)===1?(re(this,ze,re(this,qe,0)),S(this,Pt).length=0):re(this,ze,S(this,Je)[r]),S(this,$e).delete(n),Di(this,Te)._--,r},Rn=new WeakSet,_o=function(e,r,n,s){let i=r===void 0?void 0:S(this,oe)[r];if(ee(this,ve,be).call(this,i))return i;let o=new xo,{signal:l}=n;l?.addEventListener("abort",()=>o.abort(l.reason),{signal:o.signal});let c={signal:o.signal,options:n,context:s},p=(b,_=!1)=>{let{aborted:x}=o.signal,A=n.ignoreFetchAbort&&b!==void 0;if(n.status&&(x&&!_?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,A&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),x&&!A&&!_)return g(o.signal.reason);let O=m;return S(this,oe)[r]===m&&(b===void 0?O.__staleWhileFetching?S(this,oe)[r]=O.__staleWhileFetching:this.delete(e):(n.status&&(n.status.fetchUpdated=!0),this.set(e,b,c.options))),b},u=b=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=b),g(b)),g=b=>{let{aborted:_}=o.signal,x=_&&n.allowStaleOnFetchAbort,A=x||n.allowStaleOnFetchRejection,O=A||n.noDeleteOnFetchRejection,I=m;if(S(this,oe)[r]===m&&(!O||I.__staleWhileFetching===void 0?this.delete(e):x||(S(this,oe)[r]=I.__staleWhileFetching)),A)return n.status&&I.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),I.__staleWhileFetching;if(I.__returned===I)throw b},y=(b,_)=>{var A;let x=(A=S(this,_n))==null?void 0:A.call(this,e,i,c);x&&x instanceof Promise&&x.then(O=>b(O),_),o.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(b(),n.allowStaleOnFetchAbort&&(b=O=>p(O,!0)));});};n.status&&(n.status.fetchDispatched=!0);let m=new Promise(y).then(p,u),v=Object.assign(m,{__abortController:o,__staleWhileFetching:i,__returned:void 0});return r===void 0?(this.set(e,v,{...c.options,status:void 0}),r=S(this,$e).get(e)):S(this,oe)[r]=v,v},ve=new WeakSet,be=function(e){if(!S(this,wr))return !1;let r=e;return !!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof xo},xi=new WeakSet,Ec=function(e,r){S(this,ht)[r]=e,S(this,Je)[e]=r;},Hr=new WeakSet,Si=function(e){e!==S(this,qe)&&(e===S(this,ze)?re(this,ze,S(this,Je)[e]):ee(this,xi,Ec).call(this,S(this,ht)[e],S(this,Je)[e]),ee(this,xi,Ec).call(this,S(this,qe),e),re(this,qe,e));};var Co=Ac;var g0=Nn(d0());function cq(t){return t.trimEnd().split("").every(e=>ws.includes(e))}var Sr=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=Pe(this.prefix),this.suffixLines=Pe(this.suffix);let r=cq(this.suffixLines[0]??"");this.mode=r?"default":"fill-in-line",this.hash=(0, g0.default)({filepath:e.filepath,language:e.language,text:e.text,position:e.position});}};var y0=["statusChanged","configUpdated","authRequired","issuesUpdated"];Nt();var Oo=class{constructor(){this.logger=Ce.child({component:"CompletionCache"});this.options={maxCount:1e4,prebuildCache:{enabled:!0,perCharacter:{lines:1,max:50},perLine:{max:10},autoClosingPairCheck:{max:3}}};this.cache=new Co({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),l=this.getPerLinePositions(o);this.logger.trace({completionText:o,perLinePositions:l},"Calculate per-line cache positions");for(let p of l){let u=o.slice(0,p),g=this.generateAutoClosedPrefixes(u);for(let y of [u,...g]){let m={key:new Sr({...e,text:e.text.slice(0,e.position)+y+e.text.slice(e.position),position:e.position+p}),value:{...r,choices:[{index:i.index,text:o.slice(p),replaceRange:{start:e.position+p,end:e.position+p}}]},rebuildFlag:!0};this.logger.trace({prefix:y,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 p of c){let u=p;for(;u>0&&o[u-1]!==`
`;)u--;let g=o.slice(0,p),y=this.generateAutoClosedPrefixes(g);for(let m of [g,...y]){let v={key:new Sr({...e,text:e.text.slice(0,e.position)+m+e.text.slice(e.position),position:e.position+p}),value:{...r,choices:[{index:i.index,text:o.slice(u),replaceRange:{start:e.position+u,end:e.position+p}}]},rebuildFlag:!1};this.logger.trace({prefix:m,entry:v},"Build per-character cache entry"),n.push(v);}}}return n.reduce((i,o)=>{let l=i.find(c=>c.key.hash===o.key.hash);return l?(l.value.choices.push(...o.value.choices),l.rebuildFlag=l.rebuildFlag||o.rebuildFlag):i.push(o),i},[])}getPerLinePositions(e){let r=[],n=this.options.prebuildCache,s=Pe(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 l=o;for(;l<e.length&&e[l].match(/\s/);)l++;r.push(l),i++;}return r}getPerCharacterPositions(e){let r=[],n=this.options.prebuildCache,s=Pe(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=Ss(e);for(let s=0,i="";s<this.options.prebuildCache.autoClosingPairCheck.max&&n.length>s;s++){let o=Fg.indexOf(n[n.length-1-s]);if(o<0)break;i=i+ws[o],r.push(e+i);}return r}};Nt();function Cc(t,e,r){return Math.max(t,Math.min(e,r))}var Po=class{constructor(){this.logger=Ce.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 l=this.calcContextScore(n),p=(this.options.adaptiveRate.max-(this.options.adaptiveRate.max-this.options.adaptiveRate.min)*l)*this.baseInterval,u=Cc(this.options.requestDelay.min,this.options.requestDelay.max,p-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=Cc(this.options.baseIntervalSlideWindowAvg.min,this.options.baseIntervalSlideWindowAvg.max,r);}}calcContextScore(e){let r=0,n=this.options.contextScoreWeights,s=e.text[e.position-1]??"";r+=s.match(/^\W*$/)?n.triggerCharacter:0;let i=e.text.slice(e.position)??"",o=Pe(i)[0]??"";return r+=o.match(/^\W*$/)?n.noSuffixInCurrentLine:0,r+=i.match(/^\W*$/)?n.noSuffix:0,r=Cc(0,1,r),r}};Nt();var $t=Ce.child({component:"Postprocess"});Array.prototype.distinct||(Array.prototype.distinct=function(t){return [...new Map(this.map(e=>[t?.(e)??e,e])).values()]});function It(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 fq(t){return /\n(\s*)\n/g}var m0=t=>e=>{let r=e.split(fq()),n=0,s=2,i=r.length-2;for(;i>=1;){if(ge(r[i])){i--;continue}let o=i-1;for(;o>=0&&ge(r[o]);)o--;if(o<0)break;let l=r[i].trim(),c=r[o].trim(),p=Math.max(.1*l.length,.1*c.length);if(on(l,c)<=p)n++,i--;else break}return n>=s?($t.debug({inputBlocks:r,repetitionCount:n},"Remove repetitive blocks."),r.slice(0,i+1).join("").trimEnd()):e};var v0=()=>t=>{let e=Pe(t),r=0,n=5,s=e.length-2;for(;s>=1;){if(ge(e[s])){s--;continue}let i=s-1;for(;i>=0&&ge(e[i]);)i--;if(i<0)break;let o=e[s].trim(),l=e[i].trim(),c=Math.max(.1*o.length,.1*l.length);if(on(o,l)<=c)r++,s=i;else break}return r>=n?($t.debug({inputLines:e,repetitionCount:r},"Remove repetitive lines."),e.slice(0,s+1).join("").trimEnd()):t};var hq=[/(.{3,}?)\1{5,}$/g,/(.{10,}?)\1{3,}$/g],w0=()=>t=>{let e=Pe(t),r=e.length-1;for(;r>=0&&ge(e[r]);)r--;if(r<0)return t;for(let n of hq){let s=e[r].match(n);if(s)return $t.debug({inputLines:e,lineNumber:r,match:s},"Remove line ends with repetition."),r<1?null:e.slice(0,r).join("").trimEnd()}return t};function br(t){return t.match(/^[ \t]*/)?.[0]?.length??0}function pq(t,e){return e>=t.length-1?!1:br(t[e])<br(t[e+1])}function dq(t,e,r){let n=!1,s={indentLevelLimit:0,allowClosingLine:_=>n};if(t.length==0||e.length==0)return s;let i=e[e.length-1],o=ge(i),l=e.length-1;for(;l>=0&&ge(e[l]);)l--;if(l<0)return s;let c=e[l],p=br(c),u=t[0],g=ge(u),y=0;for(;y<t.length&&ge(t[y]);)y++;if(y>=t.length)return s;let m=t[y],v;g?v=br(m):v=br(i+m),!g&&!o?(s.indentLevelLimit=p+1,n=!!t[1]&&br(t[1])>p):v>p?(s.indentLevelLimit=p+1,n=!0):(s.indentLevelLimit=p,n=!0);let b=1;for(;b<r.length&&ge(r[b]);)b++;return b<r.length&&(n&&(n=br(r[b])<s.indentLevelLimit),s.allowClosingLine=_=>{let x=_.startsWith(r[b])||r[b].startsWith(_);return n&&!x}),s}var S0=t=>e=>{let{prefix:r,suffix:n,prefixLines:s,suffixLines:i}=t,o=Pe(e);if(t.mode==="fill-in-line"&&o.length>1)return $t.debug({input:e,prefix:r,suffix:n},"Drop content with multiple lines"),null;let l=dq(o,s,i),c;for(c=1;c<o.length;c++){if(ge(o[c]))continue;if(br(o[c])<l.indentLevelLimit){if(pq(o,c))continue;l.allowClosingLine(o[c])&&(t.language!=="python"||!ge(o[c-1]))&&c++;break}}return c<o.length?($t.debug({input:e,prefix:r,suffix:n,scopeEndAt:c},"Remove content out of scope"),o.slice(0,c).join("").trimEnd()):e};var Rc=t=>e=>{let {prefixLines:r,suffixLines:n}=t;Pe(e);let i=e,o=r[r.length-1]??"",l=n[0]??"";return !ge(o)&&o.match(/\s$/)&&(i=i.trimStart()),(ge(l)||!ge(l)&&l.match(/^\s/))&&(i=i.trimEnd()),i};var Oc=t=>e=>{let{suffixLines:r}=t,n=Pe(e),s=0;for(;s<n.length&&ge(n[s]);)s++;let i=0;for(;i<r.length&&ge(r[i]);)i++;let o=Math.min(3,n.length-s,r.length-i);if(o<1)return e;let l=n.slice(s,s+o).join("").trim(),c=r.slice(i,i+o).join("").trim(),p=Math.max(1,.05*l.length,.05*c.length),u=on(l,c);return u<=p?($t.debug({inputLines:n,suffixLines:r,inputToCompare:l,suffixToCompare:c,distance:u,threshold:p},"Drop completion due to duplicated."),null):e};var Pc=()=>t=>ge(t)?null:t;async function b0(t,e){return Promise.resolve(e).then(It(w0(),t)).then(It(Oc(t),t)).then(It(Rc(t),t)).then(It(Pc(),t))}async function E0(t,e){return Promise.resolve(e).then(It(m0(),t)).then(It(v0(),t)).then(It(S0(t),t)).then(It(Oc(t),t)).then(It(Rc(t),t)).then(It(Pc(),t))}Nt();var _0="tabby-agent",x0="1.0.0";Jn();Nt();var To=class t{constructor(){this.anonymousUsageTrackingApi=Or({baseUrl:"https://app.tabbyml.com/api"});this.logger=Ce.child({component:"AnonymousUsage"});this.systemData={agent:`${_0}, ${x0}`,browser:void 0,node:`${process.version} ${process.platform} ${z("os").arch()} ${z("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||Fs,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=Ar(),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=Ar();}setSessionProperties(e,r){sn(this.sessionProperties,e,r);}setUserProperties(e,r){sn(this.userProperties,e,r),this.userPropertiesUpdated=!0;}async uniqueEvent(e,r={}){await this.event(e,r,!0);}async event(e,r={},n=!1){if(this.disabled||n&&this.emittedUniqueEvent.indexOf(e)>=0)return;n&&this.emittedUniqueEvent.push(e);let s={...this.systemData,...this.sessionProperties,...r};this.userPropertiesUpdated&&(s.$set=this.userProperties,this.userPropertiesUpdated=!1);try{await this.anonymousUsageTrackingApi.POST("/usage",{body:{distinctId:this.anonymousId,event:e,properties:s}});}catch(i){this.logger.error({error:i},"Error when sending anonymous usage data");}}};var kc=Nn(P0());Nt();var $o=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}},Io=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}},Ti=class{constructor(){this.logger=Ce.child({component:"CompletionProviderStats"});this.autoCompletionCount=0;this.manualCompletionCount=0;this.cacheHitCount=0;this.cacheMissCount=0;this.eventMap=new Map;this.completionRequestLatencyStats=new kc.Univariate;this.completionRequestCanceledStats=new $o;this.completionRequestTimeoutCount=0;this.recentCompletionRequestLatencies=new Io(10);}add(e){let{triggerMode:r,cacheHit:n,aborted:s,requestSent:i,requestLatency:o,requestCanceled:l,requestTimeout:c}=e;s||(r==="auto"?this.autoCompletionCount+=1:this.manualCompletionCount+=1,n?this.cacheHitCount+=1:this.cacheMissCount+=1),i&&(l?this.completionRequestCanceledStats.add(o):c?this.completionRequestTimeoutCount+=1:this.completionRequestLatencyStats.add(o),l||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 kc.Univariate,this.completionRequestCanceledStats=new $o,this.completionRequestTimeoutCount=0;}resetWindowed(){this.recentCompletionRequestLatencies=new Io(10);}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}}}static check(e){let{values:r,stats:{total:n,timeouts:s,responses:i,averageResponseTime:o}}=e;return r.slice(-3).every(l=>l<3e3)?"healthy":s/n>.5&&s>=3?"highTimeoutRate":i>=3&&o>4e3?"slowResponseTime":null}};var Wr=class Wr extends events.EventEmitter{constructor(){super();this.logger=Ce.child({component:"TabbyAgent"});this.config=mc;this.userConfig={};this.clientConfig={};this.status="notInitialized";this.issues=[];this.serverHealthState=null;this.dataStore=null;this.completionCache=new Oo;this.completionDebounce=new Po;this.nonParallelProvideCompletionAbortController=null;this.completionProviderStats=new Ti;this.tryingConnectTimer=null;this.submitStatsTimer=null;this.tryingConnectTimer=setInterval(async()=>{this.status==="disconnected"&&(this.logger.debug("Trying to connect..."),await this.healthCheck());},Wr.tryConnectInterval),this.submitStatsTimer=setInterval(async()=>{await this.submitStats();},Wr.submitStatsInterval);}static async create(r){let n=new Wr;return n.dataStore=r?.dataStore,n.anonymousUsageLogger=await To.create({dataStore:r?.dataStore}),n}async applyConfig(){let r=this.config,n=this.status;this.config=_g(mc,this.userConfig,this.clientConfig),gn.forEach(i=>i.level=this.config.logs.level),this.anonymousUsageLogger.disabled=this.config.anonymousUsageTracking.disable,this.config.server.requestHeaders.Authorization===void 0?this.config.server.endpoint!==this.auth?.endpoint&&(this.auth=await ro.create({endpoint:this.config.server.endpoint,dataStore:this.dataStore}),this.auth.on("updated",this.setupApi.bind(this))):this.auth=null,await this.setupApi(),(0, Lc.default)(r.server,this.config.server)||(this.serverHealthState=null,this.completionProviderStats.resetWindowed(),this.popIssue("slowCompletionResponseTime"),this.popIssue("highCompletionTimeoutRate"),n==="unauthorized"&&this.status==="unauthorized"&&this.emitAuthRequired());let s={event:"configUpdated",config:this.config};this.logger.debug({event:s},"Config updated"),super.emit("configUpdated",s);}async setupApi(){this.api=Or({baseUrl:this.config.server.endpoint.replace(/\/+$/,""),headers:{Authorization:this.auth?.token?`Bearer ${this.auth.token}`:void 0,...this.config.server.requestHeaders}}),await this.healthCheck();}changeStatus(r){if(this.status!=r){this.status=r;let n={event:"statusChanged",status:r};this.logger.debug({event:n},"Status changed"),super.emit("statusChanged",n),this.status==="unauthorized"&&this.emitAuthRequired();}}issueFromName(r){switch(r){case"highCompletionTimeoutRate":return {name:"highCompletionTimeoutRate",completionResponseStats:this.completionProviderStats.windowed().stats};case"slowCompletionResponseTime":return {name:"slowCompletionResponseTime",completionResponseStats:this.completionProviderStats.windowed().stats}}}pushIssue(r){this.issues.indexOf(r)===-1&&(this.issues.push(r),this.logger.debug({issue:r},"Issues Pushed"),this.emitIssueUpdated());}popIssue(r){let n=this.issues.indexOf(r);n>=0&&(this.issues.splice(n,1),this.logger.debug({issue:r},"Issues Popped"),this.emitIssueUpdated());}emitAuthRequired(){let r={event:"authRequired",server:this.config.server};super.emit("authRequired",r);}emitIssueUpdated(){let r={event:"issuesUpdated",issues:this.issues};super.emit("issuesUpdated",r);}async submitStats(){let r=this.completionProviderStats.stats();r.completion_request.count>0&&(await this.anonymousUsageLogger.event("AgentStats",{stats:r}),this.completionProviderStats.reset(),this.logger.debug({stats:r},"Stats submitted"));}async post(r,n,s){let i=Ar();this.logger.debug({requestId:i,path:r,requestOptions:n,abortOptions:s},"API request");try{let o=Math.min(2147483647,s?.timeout||this.config.server.requestTimeout),l=Yn([AbortSignal.timeout(o),s?.signal]),c=await this.api.POST(r,{...n,signal:l});if(c.error)throw new at(c.response);return this.logger.debug({requestId:i,path:r,response:c.data},"API response"),this.changeStatus("ready"),c.data}catch(o){throw bs(o)?this.logger.debug({requestId:i,path:r,error:o},"API request timeout"):an(o)?this.logger.debug({requestId:i,path:r,error:o},"API request canceled"):o instanceof at&&[401,403,405].indexOf(o.status)!==-1&&new URL(this.config.server.endpoint).hostname.endsWith("app.tabbyml.com")&&this.config.server.requestHeaders.Authorization===void 0?(this.logger.debug({requestId:i,path:r,error:o},"API unauthorized"),this.changeStatus("unauthorized")):o instanceof at?(this.logger.error({requestId:i,path:r,error:o},"API error"),this.changeStatus("disconnected")):(this.logger.error({requestId:i,path:r,error:o},"API request failed with unknown error"),this.changeStatus("disconnected")),o}}async healthCheck(r){try{let n=await this.post("/v1/health",{},r);typeof n=="object"&&n.model!==void 0&&n.device!==void 0&&(this.serverHealthState=n,this.status==="ready"&&this.anonymousUsageLogger.uniqueEvent("AgentConnected",n));}catch{this.changeStatus("disconnected"),this.serverHealthState=null;}}createSegments(r){let n=this.config.completion.prompt.maxPrefixLines,s=this.config.completion.prompt.maxSuffixLines,{prefixLines:i,suffixLines:o}=r;return {prefix:i.slice(Math.max(i.length-n,0)).join(""),suffix:o.slice(0,s).join("")}}calculateReplaceRange(r,n){let{suffixLines:s}=n,i=s[0]?.trimEnd()||"";if(ge(i))return r;for(let o of r.choices){let l=o.text.slice(n.position-o.replaceRange.start),c=Ss(l);ge(c)||(i.startsWith(c)?(o.replaceRange.end=n.position+c.length,this.logger.trace({context:n,completion:o.text,range:o.replaceRange,unpaired:c},"Adjust replace range")):c.startsWith(i)&&(o.replaceRange.end=n.position+i.length,this.logger.trace({context:n,completion:o.text,range:o.replaceRange,unpaired:c},"Adjust replace range")));}return r}async initialize(r){if(r.clientProperties){let{user:n,session:s}=r.clientProperties;gn.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 bn&&(await bn.load(),this.userConfig=bn.config,bn.on("updated",async n=>{this.userConfig=n,await this.applyConfig();}),bn.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={};sn(i,n,s),gn.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=Og(this.clientConfig,r);return (0, Lc.default)(s,n)||(n===void 0?Pg(this.clientConfig,r):sn(this.clientConfig,r,n),await this.applyConfig()),!0}async clearConfig(r){return await this.updateConfig(r,void 0)}getConfig(){return this.config}getStatus(){return this.status}getIssues(){return this.issues}getIssueDetail(r){return r.index!==void 0?this.issueFromName(this.issues[r.index]):r.name!==void 0&&this.issues.indexOf(r.name)!==-1?this.issueFromName(r.name):null}getServerHealthState(){return this.serverHealthState}async requestAuthUrl(r){if(this.status==="notInitialized")throw new Error("Agent is not initialized");return await this.healthCheck(r),this.status!=="unauthorized"?null:await this.auth.requestAuthUrl(r)}async waitForAuthToken(r,n){if(this.status==="notInitialized")throw new Error("Agent is not initialized");await this.auth.pollingToken(r,n),await this.setupApi();}async provideCompletions(r,n){if(this.status==="notInitialized")throw new Error("Agent is not initialized");this.logger.trace({request:r},"Call provideCompletions"),this.nonParallelProvideCompletionAbortController&&this.nonParallelProvideCompletionAbortController.abort(),this.nonParallelProvideCompletionAbortController=new AbortController;let s=Yn([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},l=null,c=new Sr(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 p=this.createSegments(c);if(ge(p.prefix))o=null,this.logger.debug("Segment prefix is blank, returning empty completion response"),i={id:"agent-"+Ar(),choices:[]};else {await this.completionDebounce.debounce({request:r,config:this.config.completion.debounce,responseTime:this.completionProviderStats.stats().averageResponseTime},n),o.requestSent=!0,l=performance.now();try{let u=await this.post("/v1/completions",{body:{language:r.language,segments:p,user:this.auth?.user}},{signal:s,timeout:r.manually?this.config.completion.timeout.manually:this.config.completion.timeout.auto});o.requestLatency=performance.now()-l,i={id:u.id,choices:u.choices.map(g=>({index:g.index,text:g.text,replaceRange:{start:r.position,end:r.position}}))};}catch(u){throw an(u)&&(o.requestCanceled=!0,o.requestLatency=performance.now()-l),bs(u)&&(o.requestTimeout=!0,o.requestLatency=NaN),u}if(i=await b0(c,i),n?.signal?.aborted)throw n.signal.reason;this.completionCache.buildCache(c,i);}}if(i=await E0(c,i),n?.signal?.aborted)throw n.signal.reason;i=this.calculateReplaceRange(i,c);}catch(p){throw an(p)||bs(p)?o&&(o.aborted=!0):o=null,p}finally{if(o&&(this.completionProviderStats.add(o),o.requestSent&&!o.requestCanceled)){let p=this.completionProviderStats.windowed();switch(Ti.check(p)){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");return this.completionProviderStats.addEvent(r.type),await this.post("/v1/events",{body:r,params:{query:{select_kind:r.select_kind}},parseAs:"text"},n),!0}};Wr.tryConnectInterval=1e3*30,Wr.submitStatsInterval=1e3*60*60*24;var ko=Wr;Nt();var Lo=class{constructor(){this.process=process;this.inStream=process.stdin;this.outStream=process.stdout;this.logger=Ce.child({component:"StdIO"});this.buffer="";this.abortControllers={};this.agent=null;}async handleInput(e){let r=e.toString();this.buffer+=r;let n=Pe(this.buffer);if(!(n.length<1)){n[n.length-1].endsWith(`
`)?this.buffer="":this.buffer=n.pop();for(let s of n){let i=null;try{i=JSON.parse(s);}catch(l){this.logger.error({error:l},`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 l=e[1].args;l.length>0&&typeof l[l.length-1]=="object"&&l[l.length-1].signal&&(this.abortControllers[r]=s,l[l.length-1].signal=s.signal),n[1]=await o.apply(this.agent,l);}}catch(i){an(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 y0)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 T0=new Lo;ko.create().then(t=>{T0.bind(t),T0.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