0&&this[this.t-1]==h;)--this.t}function S(h){if(this.s<0)return"-"+this.negate().toString(h);var p;if(h==16)p=4;else if(h==8)p=3;else if(h==2)p=1;else if(h==32)p=5;else if(h==4)p=2;else return this.toRadix(h);var v=(1<0)for(K>K)>0&&(B=!0,M=g(w));G>=0;)K>(K+=this.DB-p)):(w=this[G]>>(K-=p)&v,K<=0&&(K+=this.DB,--G)),w>0&&(B=!0),B&&(M+=g(w));return B?M:"0"}function R(){var h=n();return r.ZERO.subTo(this,h),h}function T(){return this.s<0?this.negate():this}function A(h){var p=this.s-h.s;if(p!=0)return p;var v=this.t;if(p=v-h.t,p!=0)return this.s<0?-p:p;for(;--v>=0;)if((p=this[v]-h[v])!=0)return p;return 0}function C(h){var p=1,v;return(v=h>>>16)!=0&&(h=v,p+=16),(v=h>>8)!=0&&(h=v,p+=8),(v=h>>4)!=0&&(h=v,p+=4),(v=h>>2)!=0&&(h=v,p+=2),(v=h>>1)!=0&&(h=v,p+=1),p}function L(){return this.t<=0?0:this.DB*(this.t-1)+C(this[this.t-1]^this.s&this.DM)}function P(h,p){var v;for(v=this.t-1;v>=0;--v)p[v+h]=this[v];for(v=h-1;v>=0;--v)p[v]=0;p.t=this.t+h,p.s=this.s}function U(h,p){for(var v=h;v=0;--K)p[K+M+1]=this[K]>>w|G,G=(this[K]&B)<=0;--K)p[K]=0;p[M]=G,p.t=this.t+M+1,p.s=this.s,p.clamp()}function H(h,p){p.s=this.s;var v=Math.floor(h/this.DB);if(v>=this.t){p.t=0;return}var w=h%this.DB,B=this.DB-w,M=(1<>w;for(var G=v+1;G>w;w>0&&(p[this.t-v-1]|=(this.s&M)<>=this.DB;if(h.t>=this.DB;w+=this.s}else{for(w+=this.s;v>=this.DB;w-=h.s}p.s=w<0?-1:0,w<-1?p[v++]=this.DV+w:w>0&&(p[v++]=w),p.t=v,p.clamp()}function V(h,p){var v=this.abs(),w=h.abs(),B=v.t;for(p.t=B+w.t;--B>=0;)p[B]=0;for(B=0;B=0;)h[v]=0;for(v=0;v=p.DV&&(h[v+p.t]-=p.DV,h[v+p.t+1]=1)}h.t>0&&(h[h.t-1]+=p.am(v,p[v],h,2*v,0,1)),h.s=0,h.clamp()}function Q(h,p,v){var w=h.abs();if(!(w.t<=0)){var B=this.abs();if(B.t0?(w.lShiftTo(Pe,M),B.lShiftTo(Pe,v)):(w.copyTo(M),B.copyTo(v));var Ye=M.t,kt=M[Ye-1];if(kt!=0){var _t=kt*(1<1?M[Ye-2]>>this.F2:0),ti=this.FV/_t,ps=(1<=0&&(v[v.t++]=1,v.subTo(di,v)),r.ONE.dlShiftTo(Ye,di),di.subTo(M,M);M.t=0;){var xa=v[--Dt]==kt?this.DM:Math.floor(v[Dt]*ti+(v[Dt-1]+Mt)*ps);if((v[Dt]+=M.am(0,xa,v,ds,0,Ye))0&&v.rShiftTo(Pe,v),G<0&&r.ZERO.subTo(v,v)}}}function W(h){var p=n();return this.abs().divRemTo(h,null,p),this.s<0&&p.compareTo(r.ZERO)>0&&h.subTo(p,p),p}function de(h){this.m=h}function ae(h){return h.s<0||h.compareTo(this.m)>=0?h.mod(this.m):h}function ne(h){return h}function ue(h){h.divRemTo(this.m,null,h)}function N(h,p,v){h.multiplyTo(p,v),this.reduce(v)}function X(h,p){h.squareTo(p),this.reduce(p)}de.prototype.convert=ae,de.prototype.revert=ne,de.prototype.reduce=ue,de.prototype.mulTo=N,de.prototype.sqrTo=X;function ke(){if(this.t<1)return 0;var h=this[0];if((h&1)==0)return 0;var p=h&3;return p=p*(2-(h&15)*p)&15,p=p*(2-(h&255)*p)&255,p=p*(2-((h&65535)*p&65535))&65535,p=p*(2-h*p%this.DV)%this.DV,p>0?this.DV-p:-p}function be(h){this.m=h,this.mp=h.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<0&&this.m.subTo(p,p),p}function ve(h){var p=n();return h.copyTo(p),this.reduce(p),p}function fe(h){for(;h.t<=this.mt2;)h[h.t++]=0;for(var p=0;p>15)*this.mpl&this.um)<<15)&h.DM;for(v=p+this.m.t,h[v]+=this.m.am(0,w,h,p,0,this.m.t);h[v]>=h.DV;)h[v]-=h.DV,h[++v]++}h.clamp(),h.drShiftTo(this.m.t,h),h.compareTo(this.m)>=0&&h.subTo(this.m,h)}function z(h,p){h.squareTo(p),this.reduce(p)}function $(h,p,v){h.multiplyTo(p,v),this.reduce(v)}be.prototype.convert=ge,be.prototype.revert=ve,be.prototype.reduce=fe,be.prototype.mulTo=$,be.prototype.sqrTo=z;function Te(){return(this.t>0?this[0]&1:this.s)==0}function re(h,p){if(h>4294967295||h<1)return r.ONE;var v=n(),w=n(),B=p.convert(this),M=C(h)-1;for(B.copyTo(v);--M>=0;)if(p.sqrTo(v,w),(h&1<0)p.mulTo(w,B,v);else{var G=v;v=w,w=G}return p.revert(v)}function he(h,p){var v;return h<256||p.isEven()?v=new de(p):v=new be(p),this.exp(h,v)}r.prototype.copyTo=b,r.prototype.fromInt=x,r.prototype.fromString=k,r.prototype.clamp=O,r.prototype.dlShiftTo=P,r.prototype.drShiftTo=U,r.prototype.lShiftTo=F,r.prototype.rShiftTo=H,r.prototype.subTo=j,r.prototype.multiplyTo=V,r.prototype.squareTo=Y,r.prototype.divRemTo=Q,r.prototype.invDigit=ke,r.prototype.isEven=Te,r.prototype.exp=re,r.prototype.toString=S,r.prototype.negate=R,r.prototype.abs=T,r.prototype.compareTo=A,r.prototype.bitLength=L,r.prototype.mod=W,r.prototype.modPowInt=he,r.ZERO=E(0),r.ONE=E(1);function ht(){var h=n();return this.copyTo(h),h}function yt(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<>24}function Z(){return this.t==0?this.s:this[0]<<16>>16}function te(h){return Math.floor(Math.LN2*this.DB/Math.log(h))}function ee(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}function le(h){if(h==null&&(h=10),this.signum()==0||h<2||h>36)return"0";var p=this.chunkSize(h),v=Math.pow(h,p),w=E(v),B=n(),M=n(),G="";for(this.divRemTo(w,B,M);B.signum()>0;)G=(v+M.intValue()).toString(h).substr(1)+G,B.divRemTo(w,B,M);return M.intValue().toString(h)+G}function ce(h,p){this.fromInt(0),p==null&&(p=10);for(var v=this.chunkSize(p),w=Math.pow(p,v),B=!1,M=0,G=0,K=0;K=v&&(this.dMultiply(w),this.dAddOffset(G,0),M=0,G=0)}M>0&&(this.dMultiply(Math.pow(p,M)),this.dAddOffset(G,0)),B&&r.ZERO.subTo(this,this)}function _e(h,p,v){if(typeof p=="number")if(h<2)this.fromInt(1);else for(this.fromNumber(h,v),this.testBit(h-1)||this.bitwiseTo(r.ONE.shiftLeft(h-1),oe,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(p);)this.dAddOffset(2,0),this.bitLength()>h&&this.subTo(r.ONE.shiftLeft(h-1),this);else{var w=new Array,B=h&7;w.length=(h>>3)+1,p.nextBytes(w),B>0?w[0]&=(1<0)for(v>v)!=(this.s&this.DM)>>v&&(p[B++]=w|this.s<=0;)v<8?(w=(this[h]&(1<>(v+=this.DB-8)):(w=this[h]>>(v-=8)&255,v<=0&&(v+=this.DB,--h)),(w&128)!=0&&(w|=-256),B==0&&(this.s&128)!=(w&128)&&++B,(B>0||w!=this.s)&&(p[B++]=w);return p}function Re(h){return this.compareTo(h)==0}function Ae(h){return this.compareTo(h)<0?this:h}function q(h){return this.compareTo(h)>0?this:h}function J(h,p,v){var w,B,M=Math.min(h.t,this.t);for(w=0;w>=16,p+=16),(h&255)==0&&(h>>=8,p+=8),(h&15)==0&&(h>>=4,p+=4),(h&3)==0&&(h>>=2,p+=2),(h&1)==0&&++p,p}function hi(){for(var h=0;h=this.t?this.s!=0:(this[p]&1<>=this.DB;if(h.t>=this.DB;w+=this.s}else{for(w+=this.s;v>=this.DB;w+=h.s}p.s=w<0?-1:0,w>0?p[v++]=w:w<-1&&(p[v++]=this.DV+w),p.t=v,p.clamp()}function es(h){var p=n();return this.addTo(h,p),p}function Xr(h){var p=n();return this.subTo(h,p),p}function ts(h){var p=n();return this.multiplyTo(h,p),p}function is(){var h=n();return this.squareTo(h),h}function rs(h){var p=n();return this.divRemTo(h,p,null),p}function ns(h){var p=n();return this.divRemTo(h,null,p),p}function ss(h){var p=n(),v=n();return this.divRemTo(h,p,v),new Array(p,v)}function ya(h){this[this.t]=this.am(0,h-1,this,0,0,this.t),++this.t,this.clamp()}function qi(h,p){if(h!=0){for(;this.t<=p;)this[this.t++]=0;for(this[p]+=h;this[p]>=this.DV;)this[p]-=this.DV,++p>=this.t&&(this[this.t++]=0),++this[p]}}function ei(){}function ji(h){return h}function pr(h,p,v){h.multiplyTo(p,v)}function os(h,p){h.squareTo(p)}ei.prototype.convert=ji,ei.prototype.revert=ji,ei.prototype.mulTo=pr,ei.prototype.sqrTo=os;function as(h){return this.exp(h,new ei)}function ls(h,p,v){var w=Math.min(this.t+h.t,p);for(v.s=0,v.t=w;w>0;)v[--w]=0;var B;for(B=v.t-this.t;w=0;)v[w]=0;for(w=Math.max(p-this.t,0);w2*this.m.t)return h.mod(this.m);if(h.compareTo(this.m)<0)return h;var p=n();return h.copyTo(p),this.reduce(p),p}function fs(h){return h}function dr(h){for(h.drShiftTo(this.m.t-1,this.r2),h.t>this.m.t+1&&(h.t=this.m.t+1,h.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);h.compareTo(this.r2)<0;)h.dAddOffset(1,this.m.t+1);for(h.subTo(this.r2,h);h.compareTo(this.m)>=0;)h.subTo(this.m,h)}function Cb(h,p){h.squareTo(p),this.reduce(p)}function Tb(h,p,v){h.multiplyTo(p,v),this.reduce(v)}Vt.prototype.convert=us,Vt.prototype.revert=fs,Vt.prototype.reduce=dr,Vt.prototype.mulTo=Tb,Vt.prototype.sqrTo=Cb;function Ab(h,p){var v=h.bitLength(),w,B=E(1),M;if(v<=0)return B;v<18?w=1:v<48?w=3:v<144?w=4:v<768?w=5:w=6,v<8?M=new de(p):p.isEven()?M=new Vt(p):M=new be(p);var G=new Array,K=3,Pe=w-1,Ye=(1<1){var kt=n();for(M.sqrTo(G[1],kt);K<=Ye;)G[K]=n(),M.mulTo(kt,G[K-2],G[K]),K+=2}var _t=h.t-1,ti,ps=!0,Mt=n(),Dt;for(v=C(h[_t])-1;_t>=0;){for(v>=Pe?ti=h[_t]>>v-Pe&Ye:(ti=(h[_t]&(1<0&&(ti|=h[_t-1]>>this.DB+v-Pe)),K=w;(ti&1)==0;)ti>>=1,--K;if((v-=K)<0&&(v+=this.DB,--_t),ps)G[ti].copyTo(B),ps=!1;else{for(;K>1;)M.sqrTo(B,Mt),M.sqrTo(Mt,B),K-=2;K>0?M.sqrTo(B,Mt):(Dt=B,B=Mt,Mt=Dt),M.mulTo(Mt,G[ti],B)}for(;_t>=0&&(h[_t]&1<0&&(p.rShiftTo(M,p),v.rShiftTo(M,v));p.signum()>0;)(B=p.getLowestSetBit())>0&&p.rShiftTo(B,p),(B=v.getLowestSetBit())>0&&v.rShiftTo(B,v),p.compareTo(v)>=0?(p.subTo(v,p),p.rShiftTo(1,p)):(v.subTo(p,v),v.rShiftTo(1,v));return M>0&&v.lShiftTo(M,v),v}function Nb(h){if(h<=0)return 0;var p=this.DV%h,v=this.s<0?h-1:0;if(this.t>0)if(p==0)v=this[0]%h;else for(var w=this.t-1;w>=0;--w)v=(p*v+this[w])%h;return v}function Lb(h){var p=h.isEven();if(this.isEven()&&p||h.signum()==0)return r.ZERO;for(var v=h.clone(),w=this.clone(),B=E(1),M=E(0),G=E(0),K=E(1);v.signum()!=0;){for(;v.isEven();)v.rShiftTo(1,v),p?((!B.isEven()||!M.isEven())&&(B.addTo(this,B),M.subTo(h,M)),B.rShiftTo(1,B)):M.isEven()||M.subTo(h,M),M.rShiftTo(1,M);for(;w.isEven();)w.rShiftTo(1,w),p?((!G.isEven()||!K.isEven())&&(G.addTo(this,G),K.subTo(h,K)),G.rShiftTo(1,G)):K.isEven()||K.subTo(h,K),K.rShiftTo(1,K);v.compareTo(w)>=0?(v.subTo(w,v),p&&B.subTo(G,B),M.subTo(K,M)):(w.subTo(v,w),p&&G.subTo(B,G),K.subTo(M,K))}if(w.compareTo(r.ONE)!=0)return r.ZERO;if(K.compareTo(h)>=0)return K.subtract(h);if(K.signum()<0)K.addTo(h,K);else return K;return K.signum()<0?K.add(h):K}var ot=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],Bb=(1<<26)/ot[ot.length-1];function Rb(h){var p,v=this.abs();if(v.t==1&&v[0]<=ot[ot.length-1]){for(p=0;p>1,h>ot.length&&(h=ot.length);for(var B=n(),M=0;M>8&255,bt[We++]^=h>>16&255,bt[We++]^=h>>24&255,We>=wa&&(We-=wa)}function Of(){Mb(new Date().getTime())}if(bt==null){bt=new Array,We=0;var Pt;if(typeof window!="undefined"&&window.crypto){if(window.crypto.getRandomValues){var kf=new Uint8Array(32);for(window.crypto.getRandomValues(kf),Pt=0;Pt<32;++Pt)bt[We++]=kf[Pt]}else if(navigator.appName=="Netscape"&&navigator.appVersion<"5"){var Cf=window.crypto.random(32);for(Pt=0;Pt>>8,bt[We++]=Pt&255;We=0,Of()}function Db(){if(hs==null){for(Of(),hs=Ub(),hs.init(bt),We=0;We{(function(){"use strict";var i={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function e(o){return r(s(o),arguments)}function t(o,a){return e.apply(null,[o].concat(a||[]))}function r(o,a){var l=1,c=o.length,u,f="",d,m,g,y,b,x,E,k;for(d=0;d=0),g.type){case"b":u=parseInt(u,10).toString(2);break;case"c":u=String.fromCharCode(parseInt(u,10));break;case"d":case"i":u=parseInt(u,10);break;case"j":u=JSON.stringify(u,null,g.width?parseInt(g.width):0);break;case"e":u=g.precision?parseFloat(u).toExponential(g.precision):parseFloat(u).toExponential();break;case"f":u=g.precision?parseFloat(u).toFixed(g.precision):parseFloat(u);break;case"g":u=g.precision?String(Number(u.toPrecision(g.precision))):parseFloat(u);break;case"o":u=(parseInt(u,10)>>>0).toString(8);break;case"s":u=String(u),u=g.precision?u.substring(0,g.precision):u;break;case"t":u=String(!!u),u=g.precision?u.substring(0,g.precision):u;break;case"T":u=Object.prototype.toString.call(u).slice(8,-1).toLowerCase(),u=g.precision?u.substring(0,g.precision):u;break;case"u":u=parseInt(u,10)>>>0;break;case"v":u=u.valueOf(),u=g.precision?u.substring(0,g.precision):u;break;case"x":u=(parseInt(u,10)>>>0).toString(16);break;case"X":u=(parseInt(u,10)>>>0).toString(16).toUpperCase();break}i.json.test(g.type)?f+=u:(i.number.test(g.type)&&(!E||g.sign)?(k=E?"+":"-",u=u.toString().replace(i.sign,"")):k="",b=g.pad_char?g.pad_char==="0"?"0":g.pad_char.charAt(1):" ",x=g.width-(k+u).length,y=g.width&&x>0?b.repeat(x):"",f+=g.align?k+u+y:b==="0"?k+y+u:y+k+u)}return f}var n=Object.create(null);function s(o){if(n[o])return n[o];for(var a=o,l,c=[],u=0;a;){if((l=i.text.exec(a))!==null)c.push(l[0]);else if((l=i.modulo.exec(a))!==null)c.push("%");else if((l=i.placeholder.exec(a))!==null){if(l[2]){u|=1;var f=[],d=l[2],m=[];if((m=i.key.exec(d))!==null)for(f.push(m[1]);(d=d.substring(m[0].length))!=="";)if((m=i.key_access.exec(d))!==null)f.push(m[1]);else if((m=i.index_access.exec(d))!==null)f.push(m[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key");else throw new SyntaxError("[sprintf] failed to parse named argument key");l[2]=f}else u|=2;if(u===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");c.push({placeholder:l[0],param_no:l[1],keys:l[2],sign:l[3],pad_char:l[4],align:l[5],width:l[6],precision:l[7],type:l[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");a=a.substring(l[0].length)}return n[o]=c}typeof Hs!="undefined"&&(Hs.sprintf=e,Hs.vsprintf=t),typeof window!="undefined"&&(window.sprintf=e,window.vsprintf=t,typeof define=="function"&&define.amd&&define(function(){return{sprintf:e,vsprintf:t}}))})()});var zl=_(Wt=>{"use strict";var fS=Wt&&Wt.__createBinding||(Object.create?function(i,e,t,r){r===void 0&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(i,r,n)}:function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]}),hS=Wt&&Wt.__setModuleDefault||(Object.create?function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}:function(i,e){i.default=e}),km=Wt&&Wt.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&fS(e,i,t);return hS(e,i),e};Object.defineProperty(Wt,"__esModule",{value:!0});Wt.Address4=void 0;var Em=km(Hl()),jt=km(Gl()),Om=$s(),hn=Yl(),Nr=fn(),Kl=class i{constructor(e){this.groups=jt.GROUPS,this.parsedAddress=[],this.parsedSubnet="",this.subnet="/32",this.subnetMask=32,this.v4=!0,this.isCorrect=Em.isCorrect(jt.BITS),this.isInSubnet=Em.isInSubnet,this.address=e;let t=jt.RE_SUBNET_STRING.exec(e);if(t){if(this.parsedSubnet=t[0].replace("/",""),this.subnetMask=parseInt(this.parsedSubnet,10),this.subnet=`/${this.subnetMask}`,this.subnetMask<0||this.subnetMask>jt.BITS)throw new Om.AddressError("Invalid subnet mask.");e=e.replace(jt.RE_SUBNET_STRING,"")}this.addressMinusSuffix=e,this.parsedAddress=this.parse(e)}static isValid(e){try{return new i(e),!0}catch{return!1}}parse(e){let t=e.split(".");if(!e.match(jt.RE_ADDRESS))throw new Om.AddressError("Invalid IPv4 address.");return t}correctForm(){return this.parsedAddress.map(e=>parseInt(e,10)).join(".")}static fromHex(e){let t=e.replace(/:/g,"").padStart(8,"0"),r=[],n;for(n=0;n<8;n+=2){let s=t.slice(n,n+2);r.push(parseInt(s,16))}return new i(r.join("."))}static fromInteger(e){return i.fromHex(e.toString(16))}static fromArpa(e){let r=e.replace(/(\.in-addr\.arpa)?\.$/,"").split(".").reverse().join(".");return new i(r)}toHex(){return this.parsedAddress.map(e=>(0,Nr.sprintf)("%02x",parseInt(e,10))).join(":")}toArray(){return this.parsedAddress.map(e=>parseInt(e,10))}toGroup6(){let e=[],t;for(t=0;t(0,Nr.sprintf)("%02x",parseInt(e,10))).join(""),16)}_startAddress(){return new hn.BigInteger(this.mask()+"0".repeat(jt.BITS-this.subnetMask),2)}startAddress(){return i.fromBigInteger(this._startAddress())}startAddressExclusive(){let e=new hn.BigInteger("1");return i.fromBigInteger(this._startAddress().add(e))}_endAddress(){return new hn.BigInteger(this.mask()+"1".repeat(jt.BITS-this.subnetMask),2)}endAddress(){return i.fromBigInteger(this._endAddress())}endAddressExclusive(){let e=new hn.BigInteger("1");return i.fromBigInteger(this._endAddress().subtract(e))}static fromBigInteger(e){return i.fromInteger(parseInt(e.toString(),10))}mask(e){return e===void 0&&(e=this.subnetMask),this.getBitsBase2(0,e)}getBitsBase2(e,t){return this.binaryZeroPad().slice(e,t)}reverseForm(e){e||(e={});let t=this.correctForm().split(".").reverse().join(".");return e.omitSuffix?t:(0,Nr.sprintf)("%s.in-addr.arpa.",t)}isMulticast(){return this.isInSubnet(new i("224.0.0.0/4"))}binaryZeroPad(){return this.bigInteger().toString(2).padStart(jt.BITS,"0")}groupForV6(){let e=this.parsedAddress;return this.address.replace(jt.RE_ADDRESS,(0,Nr.sprintf)('%s.%s',e.slice(0,2).join("."),e.slice(2,4).join(".")))}};Wt.Address4=Kl});var Jl=_(Fe=>{"use strict";Object.defineProperty(Fe,"__esModule",{value:!0});Fe.RE_URL_WITH_PORT=Fe.RE_URL=Fe.RE_ZONE_STRING=Fe.RE_SUBNET_STRING=Fe.RE_BAD_ADDRESS=Fe.RE_BAD_CHARACTERS=Fe.TYPES=Fe.SCOPES=Fe.GROUPS=Fe.BITS=void 0;Fe.BITS=128;Fe.GROUPS=8;Fe.SCOPES={0:"Reserved",1:"Interface local",2:"Link local",4:"Admin local",5:"Site local",8:"Organization local",14:"Global",15:"Reserved"};Fe.TYPES={"ff01::1/128":"Multicast (All nodes on this interface)","ff01::2/128":"Multicast (All routers on this interface)","ff02::1/128":"Multicast (All nodes on this link)","ff02::2/128":"Multicast (All routers on this link)","ff05::2/128":"Multicast (All routers in this site)","ff02::5/128":"Multicast (OSPFv3 AllSPF routers)","ff02::6/128":"Multicast (OSPFv3 AllDR routers)","ff02::9/128":"Multicast (RIP routers)","ff02::a/128":"Multicast (EIGRP routers)","ff02::d/128":"Multicast (PIM routers)","ff02::16/128":"Multicast (MLDv2 reports)","ff01::fb/128":"Multicast (mDNSv6)","ff02::fb/128":"Multicast (mDNSv6)","ff05::fb/128":"Multicast (mDNSv6)","ff02::1:2/128":"Multicast (All DHCP servers and relay agents on this link)","ff05::1:2/128":"Multicast (All DHCP servers and relay agents in this site)","ff02::1:3/128":"Multicast (All DHCP servers on this link)","ff05::1:3/128":"Multicast (All DHCP servers in this site)","::/128":"Unspecified","::1/128":"Loopback","ff00::/8":"Multicast","fe80::/10":"Link-local unicast"};Fe.RE_BAD_CHARACTERS=/([^0-9a-f:/%])/gi;Fe.RE_BAD_ADDRESS=/([0-9a-f]{5,}|:{3,}|[^:]:$|^:[^:]|\/$)/gi;Fe.RE_SUBNET_STRING=/\/\d{1,3}(?=%|$)/;Fe.RE_ZONE_STRING=/%.*$/;Fe.RE_URL=new RegExp(/^\[{0,1}([0-9a-f:]+)\]{0,1}/);Fe.RE_URL_WITH_PORT=new RegExp(/\[([0-9a-f:]+)\]:([0-9]{1,5})/)});var Zl=_(Yt=>{"use strict";Object.defineProperty(Yt,"__esModule",{value:!0});Yt.simpleGroup=Yt.spanLeadingZeroes=Yt.spanAll=Yt.spanAllZeroes=void 0;var Cm=fn();function Tm(i){return i.replace(/(0+)/g,'$1')}Yt.spanAllZeroes=Tm;function pS(i,e=0){return i.split("").map((r,n)=>(0,Cm.sprintf)('%s',r,n+e,Tm(r))).join("")}Yt.spanAll=pS;function Am(i){return i.replace(/^(0+)/,'$1')}function dS(i){return i.split(":").map(t=>Am(t)).join(":")}Yt.spanLeadingZeroes=dS;function mS(i,e=0){return i.split(":").map((r,n)=>/group-v4/.test(r)?r:(0,Cm.sprintf)('%s',n+e,Am(r)))}Yt.simpleGroup=mS});var Im=_(Je=>{"use strict";var gS=Je&&Je.__createBinding||(Object.create?function(i,e,t,r){r===void 0&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(i,r,n)}:function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]}),vS=Je&&Je.__setModuleDefault||(Object.create?function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}:function(i,e){i.default=e}),yS=Je&&Je.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&gS(e,i,t);return vS(e,i),e};Object.defineProperty(Je,"__esModule",{value:!0});Je.possibleElisions=Je.simpleRegularExpression=Je.ADDRESS_BOUNDARY=Je.padGroup=Je.groupPossibilities=void 0;var bS=yS(Jl()),Lr=fn();function Ws(i){return(0,Lr.sprintf)("(%s)",i.join("|"))}Je.groupPossibilities=Ws;function Gs(i){return i.length<4?(0,Lr.sprintf)("0{0,%d}%s",4-i.length,i):i}Je.padGroup=Gs;Je.ADDRESS_BOUNDARY="[^A-Fa-f0-9:]";function _S(i){let e=[];i.forEach((r,n)=>{parseInt(r,16)===0&&e.push(n)});let t=e.map(r=>i.map((n,s)=>{if(s===r){let o=s===0||s===bS.GROUPS-1?":":"";return Ws([Gs(n),o])}return Gs(n)}).join(":"));return t.push(i.map(Gs).join(":")),Ws(t)}Je.simpleRegularExpression=_S;function wS(i,e,t){let r=e?"":":",n=t?"":":",s=[];!e&&!t&&s.push("::"),e&&t&&s.push(""),(t&&!e||!t&&e)&&s.push(":"),s.push((0,Lr.sprintf)("%s(:0{1,4}){1,%d}",r,i-1)),s.push((0,Lr.sprintf)("(0{1,4}:){1,%d}%s",i-1,n)),s.push((0,Lr.sprintf)("(0{1,4}:){%d}0{1,4}",i-1));for(let o=1;o{"use strict";var xS=Kt&&Kt.__createBinding||(Object.create?function(i,e,t,r){r===void 0&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(i,r,n)}:function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]}),SS=Kt&&Kt.__setModuleDefault||(Object.create?function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}:function(i,e){i.default=e}),Ks=Kt&&Kt.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&xS(e,i,t);return SS(e,i),e};Object.defineProperty(Kt,"__esModule",{value:!0});Kt.Address6=void 0;var Nm=Ks(Hl()),Ql=Ks(Gl()),Be=Ks(Jl()),Xl=Ks(Zl()),Yi=zl(),Ki=Im(),oi=$s(),ct=Yl(),ut=fn();function Ys(i){if(!i)throw new Error("Assertion failed.")}function ES(i){let e=/(\d+)(\d{3})/;for(;e.test(i);)i=i.replace(e,"$1,$2");return i}function OS(i){return i=i.replace(/^(0{1,})([1-9]+)$/,'$1$2'),i=i.replace(/^(0{1,})(0)$/,'$1$2'),i}function kS(i,e){let t=[],r=[],n;for(n=0;ne[1]&&r.push(i[n]);return t.concat(["compact"]).concat(r)}function Lm(i){return(0,ut.sprintf)("%04x",parseInt(i,16))}function Bm(i){return i&255}var ec=class i{constructor(e,t){this.addressMinusSuffix="",this.parsedSubnet="",this.subnet="/128",this.subnetMask=128,this.v4=!1,this.zone="",this.isInSubnet=Nm.isInSubnet,this.isCorrect=Nm.isCorrect(Be.BITS),t===void 0?this.groups=Be.GROUPS:this.groups=t,this.address=e;let r=Be.RE_SUBNET_STRING.exec(e);if(r){if(this.parsedSubnet=r[0].replace("/",""),this.subnetMask=parseInt(this.parsedSubnet,10),this.subnet=`/${this.subnetMask}`,Number.isNaN(this.subnetMask)||this.subnetMask<0||this.subnetMask>Be.BITS)throw new oi.AddressError("Invalid subnet mask.");e=e.replace(Be.RE_SUBNET_STRING,"")}else if(/\//.test(e))throw new oi.AddressError("Invalid subnet mask.");let n=Be.RE_ZONE_STRING.exec(e);n&&(this.zone=n[0],e=e.replace(Be.RE_ZONE_STRING,"")),this.addressMinusSuffix=e,this.parsedAddress=this.parse(this.addressMinusSuffix)}static isValid(e){try{return new i(e),!0}catch{return!1}}static fromBigInteger(e){let t=e.toString(16).padStart(32,"0"),r=[],n;for(n=0;n65536)&&(r=null)):r=null,{address:new i(t),port:r}}static fromAddress4(e){let t=new Yi.Address4(e),r=Be.BITS-(Ql.BITS-t.subnetMask);return new i(`::ffff:${t.correctForm()}/${r}`)}static fromArpa(e){let t=e.replace(/(\.ip6\.arpa)?\.$/,""),r=7;if(t.length!==63)throw new oi.AddressError("Invalid 'ip6.arpa' form.");let n=t.split(".").reverse();for(let s=r;s>0;s--){let o=s*4;n.splice(o,0,":")}return t=n.join(""),new i(t)}microsoftTranscription(){return(0,ut.sprintf)("%s.ipv6-literal.net",this.correctForm().replace(/:/g,"-"))}mask(e=this.subnetMask){return this.getBitsBase2(0,e)}possibleSubnets(e=128){let t=Be.BITS-this.subnetMask,r=Math.abs(e-Be.BITS),n=t-r;return n<0?"0":ES(new ct.BigInteger("2",10).pow(n).toString(10))}_startAddress(){return new ct.BigInteger(this.mask()+"0".repeat(Be.BITS-this.subnetMask),2)}startAddress(){return i.fromBigInteger(this._startAddress())}startAddressExclusive(){let e=new ct.BigInteger("1");return i.fromBigInteger(this._startAddress().add(e))}_endAddress(){return new ct.BigInteger(this.mask()+"1".repeat(Be.BITS-this.subnetMask),2)}endAddress(){return i.fromBigInteger(this._endAddress())}endAddressExclusive(){let e=new ct.BigInteger("1");return i.fromBigInteger(this._endAddress().subtract(e))}getScope(){let e=Be.SCOPES[this.getBits(12,16).intValue()];return this.getType()==="Global unicast"&&e!=="Link local"&&(e="Global"),e||"Unknown"}getType(){for(let e of Object.keys(Be.TYPES))if(this.isInSubnet(new i(e)))return Be.TYPES[e];return"Global unicast"}getBits(e,t){return new ct.BigInteger(this.getBitsBase2(e,t),2)}getBitsBase2(e,t){return this.binaryZeroPad().slice(e,t)}getBitsBase16(e,t){let r=t-e;if(r%4!==0)throw new Error("Length of bits to retrieve must be divisible by four");return this.getBits(e,t).toString(16).padStart(r/4,"0")}getBitsPastSubnet(){return this.getBitsBase2(this.subnetMask,Be.BITS)}reverseForm(e){e||(e={});let t=Math.floor(this.subnetMask/4),r=this.canonicalForm().replace(/:/g,"").split("").slice(0,t).reverse().join(".");return t>0?e.omitSuffix?r:(0,ut.sprintf)("%s.ip6.arpa.",r):e.omitSuffix?"":"ip6.arpa."}correctForm(){let e,t=[],r=0,n=[];for(e=0;e0&&(r>1&&n.push([e-r,e-1]),r=0)}r>1&&n.push([this.parsedAddress.length-r,this.parsedAddress.length-1]);let s=n.map(a=>a[1]-a[0]+1);if(n.length>0){let a=s.indexOf(Math.max(...s));t=kS(this.parsedAddress,n[a])}else t=this.parsedAddress;for(e=0;e1?"s":"",t.join("")),e.replace(Be.RE_BAD_CHARACTERS,'$1'));let r=e.match(Be.RE_BAD_ADDRESS);if(r)throw new oi.AddressError((0,ut.sprintf)("Address failed regex: %s",r.join("")),e.replace(Be.RE_BAD_ADDRESS,'$1'));let n=[],s=e.split("::");if(s.length===2){let o=s[0].split(":"),a=s[1].split(":");o.length===1&&o[0]===""&&(o=[]),a.length===1&&a[0]===""&&(a=[]);let l=this.groups-(o.length+a.length);if(!l)throw new oi.AddressError("Error parsing groups");this.elidedGroups=l,this.elisionBegin=o.length,this.elisionEnd=o.length+this.elidedGroups,n=n.concat(o);for(let c=0;c(0,ut.sprintf)("%x",parseInt(o,16))),n.length!==this.groups)throw new oi.AddressError("Incorrect number of groups found");return n}canonicalForm(){return this.parsedAddress.map(Lm).join(":")}decimal(){return this.parsedAddress.map(e=>(0,ut.sprintf)("%05d",parseInt(e,16))).join(":")}bigInteger(){return new ct.BigInteger(this.parsedAddress.map(Lm).join(""),16)}to4(){let e=this.binaryZeroPad().split("");return Yi.Address4.fromHex(new ct.BigInteger(e.slice(96,128).join(""),2).toString(16))}to4in6(){let e=this.to4(),r=new i(this.parsedAddress.slice(0,6).join(":"),6).correctForm(),n="";return/:$/.test(r)||(n=":"),r+n+e.address}inspectTeredo(){let e=this.getBitsBase16(0,32),t=this.getBits(80,96).xor(new ct.BigInteger("ffff",16)).toString(),r=Yi.Address4.fromHex(this.getBitsBase16(32,64)),n=Yi.Address4.fromHex(this.getBits(96,128).xor(new ct.BigInteger("ffffffff",16)).toString(16)),s=this.getBits(64,80),o=this.getBitsBase2(64,80),a=s.testBit(15),l=s.testBit(14),c=s.testBit(8),u=s.testBit(9),f=new ct.BigInteger(o.slice(2,6)+o.slice(8,16),2).toString(10);return{prefix:(0,ut.sprintf)("%s:%s",e.slice(0,4),e.slice(4,8)),server4:r.address,client4:n.address,flags:o,coneNat:a,microsoft:{reserved:l,universalLocal:u,groupIndividual:c,nonce:f},udpPort:t}}inspect6to4(){let e=this.getBitsBase16(0,16),t=Yi.Address4.fromHex(this.getBitsBase16(16,48));return{prefix:(0,ut.sprintf)("%s",e.slice(0,4)),gateway:t.address}}to6to4(){if(!this.is4())return null;let e=["2002",this.getBitsBase16(96,112),this.getBitsBase16(112,128),"","/16"].join(":");return new i(e)}toByteArray(){let e=this.bigInteger().toByteArray();return e.length===17&&e[0]===0?e.slice(1):e}toUnsignedByteArray(){return this.toByteArray().map(Bm)}static fromByteArray(e){return this.fromUnsignedByteArray(e.map(Bm))}static fromUnsignedByteArray(e){let t=new ct.BigInteger("256",10),r=new ct.BigInteger("0",10),n=new ct.BigInteger("1",10);for(let s=e.length-1;s>=0;s--)r=r.add(n.multiply(new ct.BigInteger(e[s].toString(10),10))),n=n.multiply(t);return i.fromBigInteger(r)}isCanonical(){return this.addressMinusSuffix===this.canonicalForm()}isLinkLocal(){return this.getBitsBase2(0,64)==="1111111010000000000000000000000000000000000000000000000000000000"}isMulticast(){return this.getType()==="Multicast"}is4(){return this.v4}isTeredo(){return this.isInSubnet(new i("2001::/32"))}is6to4(){return this.isInSubnet(new i("2002::/16"))}isLoopback(){return this.getType()==="Loopback"}href(e){return e===void 0?e="":e=(0,ut.sprintf)(":%s",e),(0,ut.sprintf)("http://[%s]%s/",this.correctForm(),e)}link(e){e||(e={}),e.className===void 0&&(e.className=""),e.prefix===void 0&&(e.prefix="/#address="),e.v4===void 0&&(e.v4=!1);let t=this.correctForm;return e.v4&&(t=this.to4in6),e.className?(0,ut.sprintf)('%2$s',e.prefix,t.call(this),e.className):(0,ut.sprintf)('%2$s',e.prefix,t.call(this))}group(){if(this.elidedGroups===0)return Xl.simpleGroup(this.address).join(":");Ys(typeof this.elidedGroups=="number"),Ys(typeof this.elisionBegin=="number");let e=[],[t,r]=this.address.split("::");t.length?e.push(...Xl.simpleGroup(t)):e.push("");let n=["hover-group"];for(let s=this.elisionBegin;s',n.join(" "))),r.length?e.push(...Xl.simpleGroup(r,this.elisionEnd)):e.push(""),this.is4()&&(Ys(this.address4 instanceof Yi.Address4),e.pop(),e.push(this.address4.groupForV6())),e.join(":")}regularExpressionString(e=!1){let t=[],r=new i(this.correctForm());if(r.elidedGroups===0)t.push((0,Ki.simpleRegularExpression)(r.parsedAddress));else if(r.elidedGroups===Be.GROUPS)t.push((0,Ki.possibleElisions)(Be.GROUPS));else{let n=r.address.split("::");n[0].length&&t.push((0,Ki.simpleRegularExpression)(n[0].split(":"))),Ys(typeof r.elidedGroups=="number"),t.push((0,Ki.possibleElisions)(r.elidedGroups,n[0].length!==0,n[1].length!==0)),n[1].length&&t.push((0,Ki.simpleRegularExpression)(n[1].split(":"))),t=[t.join(":")]}return e||(t=["(?=^|",Ki.ADDRESS_BOUNDARY,"|[^\\w\\:])(",...t,")(?=[^\\w\\:]|",Ki.ADDRESS_BOUNDARY,"|$)"]),t.join("")}regularExpression(e=!1){return new RegExp(this.regularExpressionString(e),"i")}};Kt.Address6=ec});var tc=_(nt=>{"use strict";var CS=nt&&nt.__createBinding||(Object.create?function(i,e,t,r){r===void 0&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(i,r,n)}:function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]}),TS=nt&&nt.__setModuleDefault||(Object.create?function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}:function(i,e){i.default=e}),AS=nt&&nt.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&CS(e,i,t);return TS(e,i),e};Object.defineProperty(nt,"__esModule",{value:!0});nt.v6=nt.AddressError=nt.Address6=nt.Address4=void 0;var IS=zl();Object.defineProperty(nt,"Address4",{enumerable:!0,get:function(){return IS.Address4}});var NS=Rm();Object.defineProperty(nt,"Address6",{enumerable:!0,get:function(){return NS.Address6}});var LS=$s();Object.defineProperty(nt,"AddressError",{enumerable:!0,get:function(){return LS.AddressError}});var BS=AS(Zl());nt.v6={helpers:BS}});var jm=_(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.ipToBuffer=Nt.int32ToIpv4=Nt.ipv4ToInt32=Nt.validateSocksClientChainOptions=Nt.validateSocksClientOptions=void 0;var ft=Vl(),Ze=Ul(),RS=require("stream"),ic=tc(),Pm=require("net");function PS(i,e=["connect","bind","associate"]){if(!Ze.SocksCommand[i.command])throw new ft.SocksClientError(Ze.ERRORS.InvalidSocksCommand,i);if(e.indexOf(i.command)===-1)throw new ft.SocksClientError(Ze.ERRORS.InvalidSocksCommandForOperation,i);if(!Dm(i.destination))throw new ft.SocksClientError(Ze.ERRORS.InvalidSocksClientOptionsDestination,i);if(!Fm(i.proxy))throw new ft.SocksClientError(Ze.ERRORS.InvalidSocksClientOptionsProxy,i);if(Mm(i.proxy,i),i.timeout&&!qm(i.timeout))throw new ft.SocksClientError(Ze.ERRORS.InvalidSocksClientOptionsTimeout,i);if(i.existing_socket&&!(i.existing_socket instanceof RS.Duplex))throw new ft.SocksClientError(Ze.ERRORS.InvalidSocksClientOptionsExistingSocket,i)}Nt.validateSocksClientOptions=PS;function MS(i){if(i.command!=="connect")throw new ft.SocksClientError(Ze.ERRORS.InvalidSocksCommandChain,i);if(!Dm(i.destination))throw new ft.SocksClientError(Ze.ERRORS.InvalidSocksClientOptionsDestination,i);if(!(i.proxies&&Array.isArray(i.proxies)&&i.proxies.length>=2))throw new ft.SocksClientError(Ze.ERRORS.InvalidSocksClientOptionsProxiesLength,i);if(i.proxies.forEach(e=>{if(!Fm(e))throw new ft.SocksClientError(Ze.ERRORS.InvalidSocksClientOptionsProxy,i);Mm(e,i)}),i.timeout&&!qm(i.timeout))throw new ft.SocksClientError(Ze.ERRORS.InvalidSocksClientOptionsTimeout,i)}Nt.validateSocksClientChainOptions=MS;function Mm(i,e){if(i.custom_auth_method!==void 0){if(i.custom_auth_methodZe.SOCKS5_CUSTOM_AUTH_END)throw new ft.SocksClientError(Ze.ERRORS.InvalidSocksClientOptionsCustomAuthRange,e);if(i.custom_auth_request_handler===void 0||typeof i.custom_auth_request_handler!="function")throw new ft.SocksClientError(Ze.ERRORS.InvalidSocksClientOptionsCustomAuthOptions,e);if(i.custom_auth_response_size===void 0)throw new ft.SocksClientError(Ze.ERRORS.InvalidSocksClientOptionsCustomAuthOptions,e);if(i.custom_auth_response_handler===void 0||typeof i.custom_auth_response_handler!="function")throw new ft.SocksClientError(Ze.ERRORS.InvalidSocksClientOptionsCustomAuthOptions,e)}}function Dm(i){return i&&typeof i.host=="string"&&typeof i.port=="number"&&i.port>=0&&i.port<=65535}function Fm(i){return i&&(typeof i.host=="string"||typeof i.ipaddress=="string")&&typeof i.port=="number"&&i.port>=0&&i.port<=65535&&(i.type===4||i.type===5)}function qm(i){return typeof i=="number"&&i>0}function DS(i){return new ic.Address4(i).toArray().reduce((t,r)=>(t<<8)+r,0)}Nt.ipv4ToInt32=DS;function FS(i){let e=i>>>24&255,t=i>>>16&255,r=i>>>8&255,n=i&255;return[e,t,r,n].join(".")}Nt.int32ToIpv4=FS;function qS(i){if(Pm.isIPv4(i)){let e=new ic.Address4(i);return Buffer.from(e.toArray())}else if(Pm.isIPv6(i)){let e=new ic.Address6(i);return Buffer.from(e.canonicalForm().split(":").map(t=>t.padStart(4,"0")).join(""),"hex")}else throw new Error("Invalid IP address format")}Nt.ipToBuffer=qS});var Um=_(zs=>{"use strict";Object.defineProperty(zs,"__esModule",{value:!0});zs.ReceiveBuffer=void 0;var rc=class{constructor(e=4096){this.buffer=Buffer.allocUnsafe(e),this.offset=0,this.originalSize=e}get length(){return this.offset}append(e){if(!Buffer.isBuffer(e))throw new Error("Attempted to append a non-buffer instance to ReceiveBuffer.");if(this.offset+e.length>=this.buffer.length){let t=this.buffer;this.buffer=Buffer.allocUnsafe(Math.max(this.buffer.length+this.originalSize,this.buffer.length+e.length)),t.copy(this.buffer)}return e.copy(this.buffer,this.offset),this.offset+=e.length}peek(e){if(e>this.offset)throw new Error("Attempted to read beyond the bounds of the managed internal data.");return this.buffer.slice(0,e)}get(e){if(e>this.offset)throw new Error("Attempted to read beyond the bounds of the managed internal data.");let t=Buffer.allocUnsafe(e);return this.buffer.slice(0,e).copy(t),this.buffer.copyWithin(0,e,e+this.offset-e),this.offset-=e,t}};zs.ReceiveBuffer=rc});var $m=_(yi=>{"use strict";var Br=yi&&yi.__awaiter||function(i,e,t,r){function n(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function a(u){try{c(r.next(u))}catch(f){o(f)}}function l(u){try{c(r.throw(u))}catch(f){o(f)}}function c(u){u.done?s(u.value):n(u.value).then(a,l)}c((r=r.apply(i,e||[])).next())})};Object.defineProperty(yi,"__esModule",{value:!0});yi.SocksClientError=yi.SocksClient=void 0;var jS=require("events"),Rr=require("net"),mt=gm(),D=Ul(),St=jm(),US=Um(),sc=Vl();Object.defineProperty(yi,"SocksClientError",{enumerable:!0,get:function(){return sc.SocksClientError}});var nc=tc(),oc=class i extends jS.EventEmitter{constructor(e){super(),this.options=Object.assign({},e),(0,St.validateSocksClientOptions)(e),this.setState(D.SocksClientState.Created)}static createConnection(e,t){return new Promise((r,n)=>{try{(0,St.validateSocksClientOptions)(e,["connect"])}catch(o){return typeof t=="function"?(t(o),r(o)):n(o)}let s=new i(e);s.connect(e.existing_socket),s.once("established",o=>{s.removeAllListeners(),typeof t=="function"&&t(null,o),r(o)}),s.once("error",o=>{s.removeAllListeners(),typeof t=="function"?(t(o),r(o)):n(o)})})}static createConnectionChain(e,t){return new Promise((r,n)=>Br(this,void 0,void 0,function*(){try{(0,St.validateSocksClientChainOptions)(e)}catch(s){return typeof t=="function"?(t(s),r(s)):n(s)}e.randomizeChain&&(0,sc.shuffleArray)(e.proxies);try{let s;for(let o=0;othis.onDataReceivedHandler(r),this.onClose=()=>this.onCloseHandler(),this.onError=r=>this.onErrorHandler(r),this.onConnect=()=>this.onConnectHandler();let t=setTimeout(()=>this.onEstablishedTimeout(),this.options.timeout||D.DEFAULT_TIMEOUT);t.unref&&typeof t.unref=="function"&&t.unref(),e?this.socket=e:this.socket=new Rr.Socket,this.socket.once("close",this.onClose),this.socket.once("error",this.onError),this.socket.once("connect",this.onConnect),this.socket.on("data",this.onDataReceived),this.setState(D.SocksClientState.Connecting),this.receiveBuffer=new US.ReceiveBuffer,e?this.socket.emit("connect"):(this.socket.connect(this.getSocketOptions()),this.options.set_tcp_nodelay!==void 0&&this.options.set_tcp_nodelay!==null&&this.socket.setNoDelay(!!this.options.set_tcp_nodelay)),this.prependOnceListener("established",r=>{setImmediate(()=>{if(this.receiveBuffer.length>0){let n=this.receiveBuffer.get(this.receiveBuffer.length);r.socket.emit("data",n)}r.socket.resume()})})}getSocketOptions(){return Object.assign(Object.assign({},this.options.socket_options),{host:this.options.proxy.host||this.options.proxy.ipaddress,port:this.options.proxy.port})}onEstablishedTimeout(){this.state!==D.SocksClientState.Established&&this.state!==D.SocksClientState.BoundWaitingForConnection&&this.closeSocket(D.ERRORS.ProxyConnectionTimedOut)}onConnectHandler(){this.setState(D.SocksClientState.Connected),this.options.proxy.type===4?this.sendSocks4InitialHandshake():this.sendSocks5InitialHandshake(),this.setState(D.SocksClientState.SentInitialHandshake)}onDataReceivedHandler(e){this.receiveBuffer.append(e),this.processData()}processData(){for(;this.state!==D.SocksClientState.Established&&this.state!==D.SocksClientState.Error&&this.receiveBuffer.length>=this.nextRequiredPacketBufferSize;)if(this.state===D.SocksClientState.SentInitialHandshake)this.options.proxy.type===4?this.handleSocks4FinalHandshakeResponse():this.handleInitialSocks5HandshakeResponse();else if(this.state===D.SocksClientState.SentAuthentication)this.handleInitialSocks5AuthenticationHandshakeResponse();else if(this.state===D.SocksClientState.SentFinalHandshake)this.handleSocks5FinalHandshakeResponse();else if(this.state===D.SocksClientState.BoundWaitingForConnection)this.options.proxy.type===4?this.handleSocks4IncomingConnectionResponse():this.handleSocks5IncomingConnectionResponse();else{this.closeSocket(D.ERRORS.InternalError);break}}onCloseHandler(){this.closeSocket(D.ERRORS.SocketClosed)}onErrorHandler(e){this.closeSocket(e.message)}removeInternalSocketHandlers(){this.socket.pause(),this.socket.removeListener("data",this.onDataReceived),this.socket.removeListener("close",this.onClose),this.socket.removeListener("error",this.onError),this.socket.removeListener("connect",this.onConnect)}closeSocket(e){this.state!==D.SocksClientState.Error&&(this.setState(D.SocksClientState.Error),this.socket.destroy(),this.removeInternalSocketHandlers(),this.emit("error",new sc.SocksClientError(e,this.options)))}sendSocks4InitialHandshake(){let e=this.options.proxy.userId||"",t=new mt.SmartBuffer;t.writeUInt8(4),t.writeUInt8(D.SocksCommand[this.options.command]),t.writeUInt16BE(this.options.destination.port),Rr.isIPv4(this.options.destination.host)?(t.writeBuffer((0,St.ipToBuffer)(this.options.destination.host)),t.writeStringNT(e)):(t.writeUInt8(0),t.writeUInt8(0),t.writeUInt8(0),t.writeUInt8(1),t.writeStringNT(e),t.writeStringNT(this.options.destination.host)),this.nextRequiredPacketBufferSize=D.SOCKS_INCOMING_PACKET_SIZES.Socks4Response,this.socket.write(t.toBuffer())}handleSocks4FinalHandshakeResponse(){let e=this.receiveBuffer.get(8);if(e[1]!==D.Socks4Response.Granted)this.closeSocket(`${D.ERRORS.Socks4ProxyRejectedConnection} - (${D.Socks4Response[e[1]]})`);else if(D.SocksCommand[this.options.command]===D.SocksCommand.bind){let t=mt.SmartBuffer.fromBuffer(e);t.readOffset=2;let r={port:t.readUInt16BE(),host:(0,St.int32ToIpv4)(t.readUInt32BE())};r.host==="0.0.0.0"&&(r.host=this.options.proxy.ipaddress),this.setState(D.SocksClientState.BoundWaitingForConnection),this.emit("bound",{remoteHost:r,socket:this.socket})}else this.setState(D.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{socket:this.socket})}handleSocks4IncomingConnectionResponse(){let e=this.receiveBuffer.get(8);if(e[1]!==D.Socks4Response.Granted)this.closeSocket(`${D.ERRORS.Socks4ProxyRejectedIncomingBoundConnection} - (${D.Socks4Response[e[1]]})`);else{let t=mt.SmartBuffer.fromBuffer(e);t.readOffset=2;let r={port:t.readUInt16BE(),host:(0,St.int32ToIpv4)(t.readUInt32BE())};this.setState(D.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{remoteHost:r,socket:this.socket})}}sendSocks5InitialHandshake(){let e=new mt.SmartBuffer,t=[D.Socks5Auth.NoAuth];(this.options.proxy.userId||this.options.proxy.password)&&t.push(D.Socks5Auth.UserPass),this.options.proxy.custom_auth_method!==void 0&&t.push(this.options.proxy.custom_auth_method),e.writeUInt8(5),e.writeUInt8(t.length);for(let r of t)e.writeUInt8(r);this.nextRequiredPacketBufferSize=D.SOCKS_INCOMING_PACKET_SIZES.Socks5InitialHandshakeResponse,this.socket.write(e.toBuffer()),this.setState(D.SocksClientState.SentInitialHandshake)}handleInitialSocks5HandshakeResponse(){let e=this.receiveBuffer.get(2);e[0]!==5?this.closeSocket(D.ERRORS.InvalidSocks5IntiailHandshakeSocksVersion):e[1]===D.SOCKS5_NO_ACCEPTABLE_AUTH?this.closeSocket(D.ERRORS.InvalidSocks5InitialHandshakeNoAcceptedAuthType):e[1]===D.Socks5Auth.NoAuth?(this.socks5ChosenAuthType=D.Socks5Auth.NoAuth,this.sendSocks5CommandRequest()):e[1]===D.Socks5Auth.UserPass?(this.socks5ChosenAuthType=D.Socks5Auth.UserPass,this.sendSocks5UserPassAuthentication()):e[1]===this.options.proxy.custom_auth_method?(this.socks5ChosenAuthType=this.options.proxy.custom_auth_method,this.sendSocks5CustomAuthentication()):this.closeSocket(D.ERRORS.InvalidSocks5InitialHandshakeUnknownAuthType)}sendSocks5UserPassAuthentication(){let e=this.options.proxy.userId||"",t=this.options.proxy.password||"",r=new mt.SmartBuffer;r.writeUInt8(1),r.writeUInt8(Buffer.byteLength(e)),r.writeString(e),r.writeUInt8(Buffer.byteLength(t)),r.writeString(t),this.nextRequiredPacketBufferSize=D.SOCKS_INCOMING_PACKET_SIZES.Socks5UserPassAuthenticationResponse,this.socket.write(r.toBuffer()),this.setState(D.SocksClientState.SentAuthentication)}sendSocks5CustomAuthentication(){return Br(this,void 0,void 0,function*(){this.nextRequiredPacketBufferSize=this.options.proxy.custom_auth_response_size,this.socket.write(yield this.options.proxy.custom_auth_request_handler()),this.setState(D.SocksClientState.SentAuthentication)})}handleSocks5CustomAuthHandshakeResponse(e){return Br(this,void 0,void 0,function*(){return yield this.options.proxy.custom_auth_response_handler(e)})}handleSocks5AuthenticationNoAuthHandshakeResponse(e){return Br(this,void 0,void 0,function*(){return e[1]===0})}handleSocks5AuthenticationUserPassHandshakeResponse(e){return Br(this,void 0,void 0,function*(){return e[1]===0})}handleInitialSocks5AuthenticationHandshakeResponse(){return Br(this,void 0,void 0,function*(){this.setState(D.SocksClientState.ReceivedAuthenticationResponse);let e=!1;this.socks5ChosenAuthType===D.Socks5Auth.NoAuth?e=yield this.handleSocks5AuthenticationNoAuthHandshakeResponse(this.receiveBuffer.get(2)):this.socks5ChosenAuthType===D.Socks5Auth.UserPass?e=yield this.handleSocks5AuthenticationUserPassHandshakeResponse(this.receiveBuffer.get(2)):this.socks5ChosenAuthType===this.options.proxy.custom_auth_method&&(e=yield this.handleSocks5CustomAuthHandshakeResponse(this.receiveBuffer.get(this.options.proxy.custom_auth_response_size))),e?this.sendSocks5CommandRequest():this.closeSocket(D.ERRORS.Socks5AuthenticationFailed)})}sendSocks5CommandRequest(){let e=new mt.SmartBuffer;e.writeUInt8(5),e.writeUInt8(D.SocksCommand[this.options.command]),e.writeUInt8(0),Rr.isIPv4(this.options.destination.host)?(e.writeUInt8(D.Socks5HostType.IPv4),e.writeBuffer((0,St.ipToBuffer)(this.options.destination.host))):Rr.isIPv6(this.options.destination.host)?(e.writeUInt8(D.Socks5HostType.IPv6),e.writeBuffer((0,St.ipToBuffer)(this.options.destination.host))):(e.writeUInt8(D.Socks5HostType.Hostname),e.writeUInt8(this.options.destination.host.length),e.writeString(this.options.destination.host)),e.writeUInt16BE(this.options.destination.port),this.nextRequiredPacketBufferSize=D.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHeader,this.socket.write(e.toBuffer()),this.setState(D.SocksClientState.SentFinalHandshake)}handleSocks5FinalHandshakeResponse(){let e=this.receiveBuffer.peek(5);if(e[0]!==5||e[1]!==D.Socks5Response.Granted)this.closeSocket(`${D.ERRORS.InvalidSocks5FinalHandshakeRejected} - ${D.Socks5Response[e[1]]}`);else{let t=e[3],r,n;if(t===D.Socks5HostType.IPv4){let s=D.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv4;if(this.receiveBuffer.length{"use strict";var $S=zi&&zi.__createBinding||(Object.create?function(i,e,t,r){r===void 0&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(i,r,n)}:function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]}),VS=zi&&zi.__exportStar||function(i,e){for(var t in i)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&$S(e,i,t)};Object.defineProperty(zi,"__esModule",{value:!0});VS($m(),zi)});var Hm=_(Ji=>{"use strict";var HS=Ji&&Ji.__awaiter||function(i,e,t,r){function n(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function a(u){try{c(r.next(u))}catch(f){o(f)}}function l(u){try{c(r.throw(u))}catch(f){o(f)}}function c(u){u.done?s(u.value):n(u.value).then(a,l)}c((r=r.apply(i,e||[])).next())})},Js=Ji&&Ji.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Ji,"__esModule",{value:!0});var GS=Js(require("dns")),WS=Js(require("tls")),YS=Js(require("url")),KS=Js(br()),zS=$a(),JS=Vm(),ac=KS.default("socks-proxy-agent");function ZS(i){return new Promise((e,t)=>{GS.default.lookup(i,(r,n)=>{r?t(r):e(n)})})}function QS(i){let e=0,t=!1,r=5,n=i.hostname||i.host;if(!n)throw new TypeError('No "host"');if(typeof i.port=="number"?e=i.port:typeof i.port=="string"&&(e=parseInt(i.port,10)),e||(e=1080),i.protocol)switch(i.protocol.replace(":","")){case"socks4":t=!0;case"socks4a":r=4;break;case"socks5":t=!0;case"socks":case"socks5h":r=5;break;default:throw new TypeError(`A "socks" protocol must be specified! Got: ${i.protocol}`)}if(typeof i.type!="undefined")if(i.type===4||i.type===5)r=i.type;else throw new TypeError(`"type" must be 4 or 5, got: ${i.type}`);let s={host:n,port:e,type:r},o=i.userId||i.username,a=i.password;if(i.auth){let l=i.auth.split(":");o=l[0],a=l[1]}return o&&Object.defineProperty(s,"userId",{value:o,enumerable:!1}),a&&Object.defineProperty(s,"password",{value:a,enumerable:!1}),{lookup:t,proxy:s}}var lc=class extends zS.Agent{constructor(e){let t;if(typeof e=="string"?t=YS.default.parse(e):t=e,!t)throw new TypeError("a SOCKS proxy server `host` and `port` must be specified!");super(t);let r=QS(t);this.lookup=r.lookup,this.proxy=r.proxy,this.tlsConnectionOptions=t.tls||{}}callback(e,t){return HS(this,void 0,void 0,function*(){let{lookup:r,proxy:n}=this,{host:s,port:o,timeout:a}=t;if(!s)throw new Error("No `host` defined!");r&&(s=yield ZS(s));let l={proxy:n,destination:{host:s,port:o},command:"connect",timeout:a};ac("Creating socks proxy connection: %o",l);let{socket:c}=yield JS.SocksClient.createConnection(l);if(ac("Successfully created socks proxy connection"),t.secureEndpoint){ac("Upgrading socket connection to TLS");let u=t.servername||t.host;return WS.default.connect(Object.assign(Object.assign(Object.assign({},XS(t,"host","hostname","path","port")),{socket:c,servername:u}),this.tlsConnectionOptions))}return c})}};Ji.default=lc;function XS(i,...e){let t={},r;for(r in i)e.includes(r)||(t[r]=i[r]);return t}});var Wm=_((fc,Gm)=>{"use strict";var eE=fc&&fc.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},cc=eE(Hm());function uc(i){return new cc.default(i)}(function(i){i.SocksProxyAgent=cc.default,i.prototype=cc.default.prototype})(uc||(uc={}));Gm.exports=uc});var Se=_(tt=>{"use strict";var hc=Symbol.for("yaml.alias"),Ym=Symbol.for("yaml.document"),Zs=Symbol.for("yaml.map"),Km=Symbol.for("yaml.pair"),pc=Symbol.for("yaml.scalar"),Qs=Symbol.for("yaml.seq"),ai=Symbol.for("yaml.node.type"),tE=i=>!!i&&typeof i=="object"&&i[ai]===hc,iE=i=>!!i&&typeof i=="object"&&i[ai]===Ym,rE=i=>!!i&&typeof i=="object"&&i[ai]===Zs,nE=i=>!!i&&typeof i=="object"&&i[ai]===Km,zm=i=>!!i&&typeof i=="object"&&i[ai]===pc,sE=i=>!!i&&typeof i=="object"&&i[ai]===Qs;function Jm(i){if(i&&typeof i=="object")switch(i[ai]){case Zs:case Qs:return!0}return!1}function oE(i){if(i&&typeof i=="object")switch(i[ai]){case hc:case Zs:case pc:case Qs:return!0}return!1}var aE=i=>(zm(i)||Jm(i))&&!!i.anchor;tt.ALIAS=hc;tt.DOC=Ym;tt.MAP=Zs;tt.NODE_TYPE=ai;tt.PAIR=Km;tt.SCALAR=pc;tt.SEQ=Qs;tt.hasAnchor=aE;tt.isAlias=tE;tt.isCollection=Jm;tt.isDocument=iE;tt.isMap=rE;tt.isNode=oE;tt.isPair=nE;tt.isScalar=zm;tt.isSeq=sE});var pn=_(dc=>{"use strict";var Ge=Se(),gt=Symbol("break visit"),Zm=Symbol("skip children"),zt=Symbol("remove node");function Xs(i,e){let t=Qm(e);Ge.isDocument(i)?Pr(null,i.contents,t,Object.freeze([i]))===zt&&(i.contents=null):Pr(null,i,t,Object.freeze([]))}Xs.BREAK=gt;Xs.SKIP=Zm;Xs.REMOVE=zt;function Pr(i,e,t,r){let n=Xm(i,e,t,r);if(Ge.isNode(n)||Ge.isPair(n))return eg(i,r,n),Pr(i,n,t,r);if(typeof n!="symbol"){if(Ge.isCollection(e)){r=Object.freeze(r.concat(e));for(let s=0;s{"use strict";var tg=Se(),lE=pn(),cE={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},uE=i=>i.replace(/[!,[\]{}]/g,e=>cE[e]),dn=class i{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},i.defaultYaml,e),this.tags=Object.assign({},i.defaultTags,t)}clone(){let e=new i(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new i(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:i.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},i.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:i.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},i.defaultTags),this.atNextDocument=!1);let r=e.trim().split(/[ \t]+/),n=r.shift();switch(n){case"%TAG":{if(r.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;let[s,o]=r;return this.tags[s]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[s]=r;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{let o=/^\d+\.\d+$/.test(s);return t(6,`Unsupported YAML version ${s}`,o),!1}}default:return t(0,`Unknown directive ${n}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),o)}let[,r,n]=e.match(/^(.*!)([^!]*)$/s);n||t(`The ${e} tag has no suffix`);let s=this.tags[r];if(s)try{return s+decodeURIComponent(n)}catch(o){return t(String(o)),null}return r==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,r]of Object.entries(this.tags))if(e.startsWith(r))return t+uE(e.substring(r.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags),n;if(e&&r.length>0&&tg.isNode(e.contents)){let s={};lE.visit(e.contents,(o,a)=>{tg.isNode(a)&&a.tag&&(s[a.tag]=!0)}),n=Object.keys(s)}else n=[];for(let[s,o]of r)s==="!!"&&o==="tag:yaml.org,2002:"||(!e||n.some(a=>a.startsWith(o)))&&t.push(`%TAG ${s} ${o}`);return t.join(`
`)}};dn.defaultYaml={explicit:!1,version:"1.2"};dn.defaultTags={"!!":"tag:yaml.org,2002:"};ig.Directives=dn});var to=_(mn=>{"use strict";var rg=Se(),fE=pn();function hE(i){if(/[\x00-\x19\s,[\]{}]/.test(i)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(i)}`;throw new Error(t)}return!0}function ng(i){let e=new Set;return fE.visit(i,{Value(t,r){r.anchor&&e.add(r.anchor)}}),e}function sg(i,e){for(let t=1;;++t){let r=`${i}${t}`;if(!e.has(r))return r}}function pE(i,e){let t=[],r=new Map,n=null;return{onAnchor:s=>{t.push(s),n||(n=ng(i));let o=sg(e,n);return n.add(o),o},setAnchors:()=>{for(let s of t){let o=r.get(s);if(typeof o=="object"&&o.anchor&&(rg.isScalar(o.node)||rg.isCollection(o.node)))o.node.anchor=o.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=s,a}}},sourceObjects:r}}mn.anchorIsValid=hE;mn.anchorNames=ng;mn.createNodeAnchors=pE;mn.findNewAnchor=sg});var gc=_(og=>{"use strict";function gn(i,e,t,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let n=0,s=r.length;n{"use strict";var dE=Se();function ag(i,e,t){if(Array.isArray(i))return i.map((r,n)=>ag(r,String(n),t));if(i&&typeof i.toJSON=="function"){if(!t||!dE.hasAnchor(i))return i.toJSON(e,t);let r={aliasCount:0,count:1,res:void 0};t.anchors.set(i,r),t.onCreate=s=>{r.res=s,delete t.onCreate};let n=i.toJSON(e,t);return t.onCreate&&t.onCreate(n),n}return typeof i=="bigint"&&!(t!=null&&t.keep)?Number(i):i}lg.toJS=ag});var io=_(ug=>{"use strict";var mE=gc(),cg=Se(),gE=bi(),vc=class{constructor(e){Object.defineProperty(this,cg.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:r,onAnchor:n,reviver:s}={}){if(!cg.isDocument(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},a=gE.toJS(this,"",o);if(typeof n=="function")for(let{count:l,res:c}of o.anchors.values())n(c,l);return typeof s=="function"?mE.applyReviver(s,{"":a},"",a):a}};ug.NodeBase=vc});var vn=_(hg=>{"use strict";var vE=to(),fg=pn(),ro=Se(),yE=io(),bE=bi(),yc=class extends yE.NodeBase{constructor(e){super(ro.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e){let t;return fg.visit(e,{Node:(r,n)=>{if(n===this)return fg.visit.BREAK;n.anchor===this.source&&(t=n)}}),t}toJSON(e,t){if(!t)return{source:this.source};let{anchors:r,doc:n,maxAliasCount:s}=t,o=this.resolve(n);if(!o){let l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let a=r.get(o);if(a||(bE.toJS(o,null,t),a=r.get(o)),!a||a.res===void 0){let l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(s>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=no(n,o,r)),a.count*a.aliasCount>s)){let l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return a.res}toString(e,t,r){let n=`*${this.source}`;if(e){if(vE.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(e.implicitKey)return`${n} `}return n}};function no(i,e,t){if(ro.isAlias(e)){let r=e.resolve(i),n=t&&r&&t.get(r);return n?n.count*n.aliasCount:0}else if(ro.isCollection(e)){let r=0;for(let n of e.items){let s=no(i,n,t);s>r&&(r=s)}return r}else if(ro.isPair(e)){let r=no(i,e.key,t),n=no(i,e.value,t);return Math.max(r,n)}return 1}hg.Alias=yc});var je=_(bc=>{"use strict";var _E=Se(),wE=io(),xE=bi(),SE=i=>!i||typeof i!="function"&&typeof i!="object",_i=class extends wE.NodeBase{constructor(e){super(_E.SCALAR),this.value=e}toJSON(e,t){return t!=null&&t.keep?this.value:xE.toJS(this.value,e,t)}toString(){return String(this.value)}};_i.BLOCK_FOLDED="BLOCK_FOLDED";_i.BLOCK_LITERAL="BLOCK_LITERAL";_i.PLAIN="PLAIN";_i.QUOTE_DOUBLE="QUOTE_DOUBLE";_i.QUOTE_SINGLE="QUOTE_SINGLE";bc.Scalar=_i;bc.isScalarValue=SE});var yn=_(dg=>{"use strict";var EE=vn(),Zi=Se(),pg=je(),OE="tag:yaml.org,2002:";function kE(i,e,t){var r;if(e){let n=t.filter(o=>o.tag===e),s=(r=n.find(o=>!o.format))!=null?r:n[0];if(!s)throw new Error(`Tag ${e} not found`);return s}return t.find(n=>{var s;return((s=n.identify)==null?void 0:s.call(n,i))&&!n.format})}function CE(i,e,t){var f,d,m;if(Zi.isDocument(i)&&(i=i.contents),Zi.isNode(i))return i;if(Zi.isPair(i)){let g=(d=(f=t.schema[Zi.MAP]).createNode)==null?void 0:d.call(f,t.schema,null,t);return g.items.push(i),g}(i instanceof String||i instanceof Number||i instanceof Boolean||typeof BigInt!="undefined"&&i instanceof BigInt)&&(i=i.valueOf());let{aliasDuplicateObjects:r,onAnchor:n,onTagObj:s,schema:o,sourceObjects:a}=t,l;if(r&&i&&typeof i=="object"){if(l=a.get(i),l)return l.anchor||(l.anchor=n(i)),new EE.Alias(l.anchor);l={anchor:null,node:null},a.set(i,l)}e!=null&&e.startsWith("!!")&&(e=OE+e.slice(2));let c=kE(i,e,o.tags);if(!c){if(i&&typeof i.toJSON=="function"&&(i=i.toJSON()),!i||typeof i!="object"){let g=new pg.Scalar(i);return l&&(l.node=g),g}c=i instanceof Map?o[Zi.MAP]:Symbol.iterator in Object(i)?o[Zi.SEQ]:o[Zi.MAP]}s&&(s(c),delete t.onTagObj);let u=c!=null&&c.createNode?c.createNode(t.schema,i,t):typeof((m=c==null?void 0:c.nodeClass)==null?void 0:m.from)=="function"?c.nodeClass.from(t.schema,i,t):new pg.Scalar(i);return e?u.tag=e:c.default||(u.tag=c.tag),l&&(l.node=u),u}dg.createNode=CE});var oo=_(so=>{"use strict";var TE=yn(),Jt=Se(),AE=io();function _c(i,e,t){let r=t;for(let n=e.length-1;n>=0;--n){let s=e[n];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){let o=[];o[s]=r,r=o}else r=new Map([[s,r]])}return TE.createNode(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:i,sourceObjects:new Map})}var mg=i=>i==null||typeof i=="object"&&!!i[Symbol.iterator]().next().done,wc=class extends AE.NodeBase{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(r=>Jt.isNode(r)||Jt.isPair(r)?r.clone(e):r),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(mg(e))this.add(t);else{let[r,...n]=e,s=this.get(r,!0);if(Jt.isCollection(s))s.addIn(n,t);else if(s===void 0&&this.schema)this.set(r,_c(this.schema,n,t));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}}deleteIn(e){let[t,...r]=e;if(r.length===0)return this.delete(t);let n=this.get(t,!0);if(Jt.isCollection(n))return n.deleteIn(r);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${r}`)}getIn(e,t){let[r,...n]=e,s=this.get(r,!0);return n.length===0?!t&&Jt.isScalar(s)?s.value:s:Jt.isCollection(s)?s.getIn(n,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!Jt.isPair(t))return!1;let r=t.value;return r==null||e&&Jt.isScalar(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(e){let[t,...r]=e;if(r.length===0)return this.has(t);let n=this.get(t,!0);return Jt.isCollection(n)?n.hasIn(r):!1}setIn(e,t){let[r,...n]=e;if(n.length===0)this.set(r,t);else{let s=this.get(r,!0);if(Jt.isCollection(s))s.setIn(n,t);else if(s===void 0&&this.schema)this.set(r,_c(this.schema,n,t));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}}};so.Collection=wc;so.collectionFromPath=_c;so.isEmptyPath=mg});var bn=_(ao=>{"use strict";var IE=i=>i.replace(/^(?!$)(?: $)?/gm,"#");function xc(i,e){return/^\n+$/.test(i)?i.substring(1):e?i.replace(/^(?! *$)/gm,e):i}var NE=(i,e,t)=>i.endsWith(`
`)?xc(t,e):t.includes(`
`)?`
`+xc(t,e):(i.endsWith(" ")?"":" ")+t;ao.indentComment=xc;ao.lineComment=NE;ao.stringifyComment=IE});var vg=_(_n=>{"use strict";var LE="flow",Sc="block",lo="quoted";function BE(i,e,t="flow",{indentAtStart:r,lineWidth:n=80,minContentWidth:s=20,onFold:o,onOverflow:a}={}){if(!n||n<0)return i;nn-Math.max(2,s)?c.push(0):f=n-r);let d,m,g=!1,y=-1,b=-1,x=-1;t===Sc&&(y=gg(i,y,e.length),y!==-1&&(f=y+l));for(let k;k=i[y+=1];){if(t===lo&&k==="\\"){switch(b=y,i[y+1]){case"x":y+=3;break;case"u":y+=5;break;case"U":y+=9;break;default:y+=1}x=y}if(k===`
`)t===Sc&&(y=gg(i,y,e.length)),f=y+e.length+l,d=void 0;else{if(k===" "&&m&&m!==" "&&m!==`
`&&m!==" "){let O=i[y+1];O&&O!==" "&&O!==`
`&&O!==" "&&(d=y)}if(y>=f)if(d)c.push(d),f=d+l,d=void 0;else if(t===lo){for(;m===" "||m===" ";)m=k,k=i[y+=1],g=!0;let O=y>x+1?y-2:b-1;if(u[O])return i;c.push(O),u[O]=!0,f=O+l,d=void 0}else g=!0}m=k}if(g&&a&&a(),c.length===0)return i;o&&o();let E=i.slice(0,c[0]);for(let k=0;k{"use strict";var Zt=je(),wi=vg(),uo=(i,e)=>({indentAtStart:e?i.indent.length:i.indentAtStart,lineWidth:i.options.lineWidth,minContentWidth:i.options.minContentWidth}),fo=i=>/^(%|---|\.\.\.)/m.test(i);function RE(i,e,t){if(!e||e<0)return!1;let r=e-t,n=i.length;if(n<=r)return!1;for(let s=0,o=0;sr)return!0;if(o=s+1,n-o<=r)return!1}return!0}function wn(i,e){let t=JSON.stringify(i);if(e.options.doubleQuotedAsJSON)return t;let{implicitKey:r}=e,n=e.options.doubleQuotedMinMultiLineLength,s=e.indent||(fo(i)?" ":""),o="",a=0;for(let l=0,c=t[l];c;c=t[++l])if(c===" "&&t[l+1]==="\\"&&t[l+2]==="n"&&(o+=t.slice(a,l)+"\\ ",l+=1,a=l,c="\\"),c==="\\")switch(t[l+1]){case"u":{o+=t.slice(a,l);let u=t.substr(l+2,4);switch(u){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:u.substr(0,2)==="00"?o+="\\x"+u.substr(2):o+=t.substr(l,6)}l+=5,a=l+1}break;case"n":if(r||t[l+2]==='"'||t.length
`;let f,d;for(d=t.length;d>0;--d){let R=t[d-1];if(R!==`
`&&R!==" "&&R!==" ")break}let m=t.substring(d),g=m.indexOf(`
`);g===-1?f="-":t===m||g!==m.length-1?(f="+",s&&s()):f="",m&&(t=t.slice(0,-m.length),m[m.length-1]===`
`&&(m=m.slice(0,-1)),m=m.replace(Oc,`$&${c}`));let y=!1,b,x=-1;for(b=0;b")+(y?c?"2":"1":"")+f;if(i&&(O+=" "+a(i.replace(/ ?[\r\n]+/g," ")),n&&n()),u)return t=t.replace(/\n+/g,`$&${c}`),`${O}
${c}${E}${t}${m}`;t=t.replace(/\n+/g,`
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`);let S=wi.foldFlowLines(`${E}${t}${m}`,c,wi.FOLD_BLOCK,uo(r,!0));return`${O}
${c}${S}`}function PE(i,e,t,r){let{type:n,value:s}=i,{actualString:o,implicitKey:a,indent:l,indentStep:c,inFlow:u}=e;if(a&&s.includes(`
`)||u&&/[[\]{},]/.test(s))return Dr(s,e);if(!s||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return a||u||!s.includes(`
`)?Dr(s,e):co(i,e,t,r);if(!a&&!u&&n!==Zt.Scalar.PLAIN&&s.includes(`
`))return co(i,e,t,r);if(fo(s)){if(l==="")return e.forceBlockIndent=!0,co(i,e,t,r);if(a&&l===c)return Dr(s,e)}let f=s.replace(/\n+/g,`$&
${l}`);if(o){let d=y=>{var b;return y.default&&y.tag!=="tag:yaml.org,2002:str"&&((b=y.test)==null?void 0:b.test(f))},{compat:m,tags:g}=e.doc.schema;if(g.some(d)||m!=null&&m.some(d))return Dr(s,e)}return a?f:wi.foldFlowLines(f,l,wi.FOLD_FLOW,uo(e,!1))}function ME(i,e,t,r){let{implicitKey:n,inFlow:s}=e,o=typeof i.value=="string"?i:Object.assign({},i,{value:String(i.value)}),{type:a}=i;a!==Zt.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=Zt.Scalar.QUOTE_DOUBLE);let l=u=>{switch(u){case Zt.Scalar.BLOCK_FOLDED:case Zt.Scalar.BLOCK_LITERAL:return n||s?Dr(o.value,e):co(o,e,t,r);case Zt.Scalar.QUOTE_DOUBLE:return wn(o.value,e);case Zt.Scalar.QUOTE_SINGLE:return Ec(o.value,e);case Zt.Scalar.PLAIN:return PE(o,e,t,r);default:return null}},c=l(a);if(c===null){let{defaultKeyType:u,defaultStringType:f}=e.options,d=n&&u||f;if(c=l(d),c===null)throw new Error(`Unsupported default string type ${d}`)}return c}yg.stringifyString=ME});var Sn=_(kc=>{"use strict";var DE=to(),xi=Se(),FE=bn(),qE=xn();function jE(i,e){let t=Object.assign({blockQuote:!0,commentString:FE.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},i.schema.toStringOptions,e),r;switch(t.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:i,flowCollectionPadding:t.flowCollectionPadding?" ":"",indent:"",indentStep:typeof t.indent=="number"?" ".repeat(t.indent):" ",inFlow:r,options:t}}function UE(i,e){var n,s,o,a;if(e.tag){let l=i.filter(c=>c.tag===e.tag);if(l.length>0)return(n=l.find(c=>c.format===e.format))!=null?n:l[0]}let t,r;if(xi.isScalar(e)){r=e.value;let l=i.filter(c=>{var u;return(u=c.identify)==null?void 0:u.call(c,r)});if(l.length>1){let c=l.filter(u=>u.test);c.length>0&&(l=c)}t=(s=l.find(c=>c.format===e.format))!=null?s:l.find(c=>!c.format)}else r=e,t=i.find(l=>l.nodeClass&&r instanceof l.nodeClass);if(!t){let l=(a=(o=r==null?void 0:r.constructor)==null?void 0:o.name)!=null?a:typeof r;throw new Error(`Tag not resolved for ${l} value`)}return t}function $E(i,e,{anchors:t,doc:r}){if(!r.directives)return"";let n=[],s=(xi.isScalar(i)||xi.isCollection(i))&&i.anchor;s&&DE.anchorIsValid(s)&&(t.add(s),n.push(`&${s}`));let o=i.tag?i.tag:e.default?null:e.tag;return o&&n.push(r.directives.tagString(o)),n.join(" ")}function VE(i,e,t,r){var l,c;if(xi.isPair(i))return i.toString(e,t,r);if(xi.isAlias(i)){if(e.doc.directives)return i.toString(e);if((l=e.resolvedAliases)!=null&&l.has(i))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(i):e.resolvedAliases=new Set([i]),i=i.resolve(e.doc)}let n,s=xi.isNode(i)?i:e.doc.createNode(i,{onTagObj:u=>n=u});n||(n=UE(e.doc.schema.tags,s));let o=$E(s,n,e);o.length>0&&(e.indentAtStart=((c=e.indentAtStart)!=null?c:0)+o.length+1);let a=typeof n.stringify=="function"?n.stringify(s,e,t,r):xi.isScalar(s)?qE.stringifyString(s,e,t,r):s.toString(e,t,r);return o?xi.isScalar(s)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
${e.indent}${a}`:a}kc.createStringifyContext=jE;kc.stringify=VE});var xg=_(wg=>{"use strict";var li=Se(),bg=je(),_g=Sn(),En=bn();function HE({key:i,value:e},t,r,n){var T,A;let{allNullValues:s,doc:o,indent:a,indentStep:l,options:{commentString:c,indentSeq:u,simpleKeys:f}}=t,d=li.isNode(i)&&i.comment||null;if(f){if(d)throw new Error("With simple keys, key nodes cannot have comments");if(li.isCollection(i)||!li.isNode(i)&&typeof i=="object"){let C="With simple keys, collection cannot be used as a key value";throw new Error(C)}}let m=!f&&(!i||d&&e==null&&!t.inFlow||li.isCollection(i)||(li.isScalar(i)?i.type===bg.Scalar.BLOCK_FOLDED||i.type===bg.Scalar.BLOCK_LITERAL:typeof i=="object"));t=Object.assign({},t,{allNullValues:!1,implicitKey:!m&&(f||!s),indent:a+l});let g=!1,y=!1,b=_g.stringify(i,t,()=>g=!0,()=>y=!0);if(!m&&!t.inFlow&&b.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=!0}if(t.inFlow){if(s||e==null)return g&&r&&r(),b===""?"?":m?`? ${b}`:b}else if(s&&!f||e==null&&m)return b=`? ${b}`,d&&!g?b+=En.lineComment(b,t.indent,c(d)):y&&n&&n(),b;g&&(d=null),m?(d&&(b+=En.lineComment(b,t.indent,c(d))),b=`? ${b}
${a}:`):(b=`${b}:`,d&&(b+=En.lineComment(b,t.indent,c(d))));let x,E,k;li.isNode(e)?(x=!!e.spaceBefore,E=e.commentBefore,k=e.comment):(x=!1,E=null,k=null,e&&typeof e=="object"&&(e=o.createNode(e))),t.implicitKey=!1,!m&&!d&&li.isScalar(e)&&(t.indentAtStart=b.length+1),y=!1,!u&&l.length>=2&&!t.inFlow&&!m&&li.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let O=!1,S=_g.stringify(e,t,()=>O=!0,()=>y=!0),R=" ";if(d||x||E){if(R=x?`
`:"",E){let C=c(E);R+=`
${En.indentComment(C,t.indent)}`}S===""&&!t.inFlow?R===`
`&&(R=`
`):R+=`
${t.indent}`}else if(!m&&li.isCollection(e)){let C=S[0],L=S.indexOf(`
`),P=L!==-1,U=(A=(T=t.inFlow)!=null?T:e.flow)!=null?A:e.items.length===0;if(P||!U){let F=!1;if(P&&(C==="&"||C==="!")){let H=S.indexOf(" ");C==="&"&&H!==-1&&H{"use strict";function GE(i,...e){i==="debug"&&console.log(...e)}function WE(i,e){(i==="debug"||i==="warn")&&(typeof process!="undefined"&&process.emitWarning?process.emitWarning(e):console.warn(e))}Cc.debug=GE;Cc.warn=WE});var go=_(mo=>{"use strict";var On=Se(),Sg=je(),ho="<<",po={identify:i=>i===ho||typeof i=="symbol"&&i.description===ho,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Sg.Scalar(Symbol(ho)),{addToJSMap:Eg}),stringify:()=>ho},YE=(i,e)=>(po.identify(e)||On.isScalar(e)&&(!e.type||e.type===Sg.Scalar.PLAIN)&&po.identify(e.value))&&(i==null?void 0:i.doc.schema.tags.some(t=>t.tag===po.tag&&t.default));function Eg(i,e,t){if(t=i&&On.isAlias(t)?t.resolve(i.doc):t,On.isSeq(t))for(let r of t.items)Ac(i,e,r);else if(Array.isArray(t))for(let r of t)Ac(i,e,r);else Ac(i,e,t)}function Ac(i,e,t){let r=i&&On.isAlias(t)?t.resolve(i.doc):t;if(!On.isMap(r))throw new Error("Merge sources must be maps or map aliases");let n=r.toJSON(null,i,Map);for(let[s,o]of n)e instanceof Map?e.has(s)||e.set(s,o):e instanceof Set?e.add(s):Object.prototype.hasOwnProperty.call(e,s)||Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}mo.addMergeToJSMap=Eg;mo.isMergeKey=YE;mo.merge=po});var Nc=_(Cg=>{"use strict";var KE=Tc(),Og=go(),zE=Sn(),kg=Se(),Ic=bi();function JE(i,e,{key:t,value:r}){if(kg.isNode(t)&&t.addToJSMap)t.addToJSMap(i,e,r);else if(Og.isMergeKey(i,t))Og.addMergeToJSMap(i,e,r);else{let n=Ic.toJS(t,"",i);if(e instanceof Map)e.set(n,Ic.toJS(r,n,i));else if(e instanceof Set)e.add(n);else{let s=ZE(t,n,i),o=Ic.toJS(r,s,i);s in e?Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[s]=o}}return e}function ZE(i,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if(kg.isNode(i)&&(t!=null&&t.doc)){let r=zE.createStringifyContext(t.doc,{});r.anchors=new Set;for(let s of t.anchors.keys())r.anchors.add(s.anchor);r.inFlow=!0,r.inStringifyKey=!0;let n=i.toString(r);if(!t.mapKeyWarned){let s=JSON.stringify(n);s.length>40&&(s=s.substring(0,36)+'..."'),KE.warn(t.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),t.mapKeyWarned=!0}return n}return JSON.stringify(e)}Cg.addPairToJSMap=JE});var Si=_(Lc=>{"use strict";var Tg=yn(),QE=xg(),XE=Nc(),vo=Se();function eO(i,e,t){let r=Tg.createNode(i,void 0,t),n=Tg.createNode(e,void 0,t);return new yo(r,n)}var yo=class i{constructor(e,t=null){Object.defineProperty(this,vo.NODE_TYPE,{value:vo.PAIR}),this.key=e,this.value=t}clone(e){let{key:t,value:r}=this;return vo.isNode(t)&&(t=t.clone(e)),vo.isNode(r)&&(r=r.clone(e)),new i(t,r)}toJSON(e,t){let r=t!=null&&t.mapAsMap?new Map:{};return XE.addPairToJSMap(t,r,this)}toString(e,t,r){return e!=null&&e.doc?QE.stringifyPair(this,e,t,r):JSON.stringify(this)}};Lc.Pair=yo;Lc.createPair=eO});var Bc=_(Ig=>{"use strict";var Qi=Se(),Ag=Sn(),bo=bn();function tO(i,e,t){var s;return(((s=e.inFlow)!=null?s:i.flow)?rO:iO)(i,e,t)}function iO({comment:i,items:e},t,{blockItemPrefix:r,flowChars:n,itemIndent:s,onChompKeep:o,onComment:a}){let{indent:l,options:{commentString:c}}=t,u=Object.assign({},t,{indent:s,type:null}),f=!1,d=[];for(let g=0;gb=null,()=>f=!0);b&&(x+=bo.lineComment(x,s,c(b))),f&&b&&(f=!1),d.push(r+x)}let m;if(d.length===0)m=n.start+n.end;else{m=d[0];for(let g=1;gb=null);gu||x.includes(`
`))&&(c=!0),f.push(x),u=f.length}let{start:d,end:m}=t;if(f.length===0)return d+m;if(!c){let g=f.reduce((y,b)=>y+b.length+2,2);c=e.options.lineWidth>0&&g>e.options.lineWidth}if(c){let g=d;for(let y of f)g+=y?`
${s}${n}${y}`:`
`;return`${g}
${n}${m}`}else return`${d}${o}${f.join(" ")}${o}${m}`}function _o({indent:i,options:{commentString:e}},t,r,n){if(r&&n&&(r=r.replace(/^\n+/,"")),r){let s=bo.indentComment(e(r),i);t.push(s.trimStart())}}Ig.stringifyCollection=tO});var Oi=_(Pc=>{"use strict";var nO=Bc(),sO=Nc(),oO=oo(),Ei=Se(),wo=Si(),aO=je();function kn(i,e){let t=Ei.isScalar(e)?e.value:e;for(let r of i)if(Ei.isPair(r)&&(r.key===e||r.key===t||Ei.isScalar(r.key)&&r.key.value===t))return r}var Rc=class extends oO.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Ei.MAP,e),this.items=[]}static from(e,t,r){let{keepUndefined:n,replacer:s}=r,o=new this(e),a=(l,c)=>{if(typeof s=="function")c=s.call(t,l,c);else if(Array.isArray(s)&&!s.includes(l))return;(c!==void 0||n)&&o.items.push(wo.createPair(l,c,r))};if(t instanceof Map)for(let[l,c]of t)a(l,c);else if(t&&typeof t=="object")for(let l of Object.keys(t))a(l,t[l]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,t){var o;let r;Ei.isPair(e)?r=e:!e||typeof e!="object"||!("key"in e)?r=new wo.Pair(e,e==null?void 0:e.value):r=new wo.Pair(e.key,e.value);let n=kn(this.items,r.key),s=(o=this.schema)==null?void 0:o.sortMapEntries;if(n){if(!t)throw new Error(`Key ${r.key} already set`);Ei.isScalar(n.value)&&aO.isScalarValue(r.value)?n.value.value=r.value:n.value=r.value}else if(s){let a=this.items.findIndex(l=>s(r,l)<0);a===-1?this.items.push(r):this.items.splice(a,0,r)}else this.items.push(r)}delete(e){let t=kn(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){var s;let r=kn(this.items,e),n=r==null?void 0:r.value;return(s=!t&&Ei.isScalar(n)?n.value:n)!=null?s:void 0}has(e){return!!kn(this.items,e)}set(e,t){this.add(new wo.Pair(e,t),!0)}toJSON(e,t,r){let n=r?new r:t!=null&&t.mapAsMap?new Map:{};t!=null&&t.onCreate&&t.onCreate(n);for(let s of this.items)sO.addPairToJSMap(t,n,s);return n}toString(e,t,r){if(!e)return JSON.stringify(this);for(let n of this.items)if(!Ei.isPair(n))throw new Error(`Map items must all be pairs; found ${JSON.stringify(n)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),nO.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:r,onComment:t})}};Pc.YAMLMap=Rc;Pc.findPair=kn});var Fr=_(Lg=>{"use strict";var lO=Se(),Ng=Oi(),cO={collection:"map",default:!0,nodeClass:Ng.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(i,e){return lO.isMap(i)||e("Expected a mapping for this tag"),i},createNode:(i,e,t)=>Ng.YAMLMap.from(i,e,t)};Lg.map=cO});var ki=_(Bg=>{"use strict";var uO=yn(),fO=Bc(),hO=oo(),So=Se(),pO=je(),dO=bi(),Mc=class extends hO.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(So.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=xo(e);return typeof t!="number"?!1:this.items.splice(t,1).length>0}get(e,t){let r=xo(e);if(typeof r!="number")return;let n=this.items[r];return!t&&So.isScalar(n)?n.value:n}has(e){let t=xo(e);return typeof t=="number"&&t=0?e:null}Bg.YAMLSeq=Mc});var qr=_(Pg=>{"use strict";var mO=Se(),Rg=ki(),gO={collection:"seq",default:!0,nodeClass:Rg.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(i,e){return mO.isSeq(i)||e("Expected a sequence for this tag"),i},createNode:(i,e,t)=>Rg.YAMLSeq.from(i,e,t)};Pg.seq=gO});var Cn=_(Mg=>{"use strict";var vO=xn(),yO={identify:i=>typeof i=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:i=>i,stringify(i,e,t,r){return e=Object.assign({actualString:!0},e),vO.stringifyString(i,e,t,r)}};Mg.string=yO});var Eo=_(qg=>{"use strict";var Dg=je(),Fg={identify:i=>i==null,createNode:()=>new Dg.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Dg.Scalar(null),stringify:({source:i},e)=>typeof i=="string"&&Fg.test.test(i)?i:e.options.nullStr};qg.nullTag=Fg});var Dc=_(Ug=>{"use strict";var bO=je(),jg={identify:i=>typeof i=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:i=>new bO.Scalar(i[0]==="t"||i[0]==="T"),stringify({source:i,value:e},t){if(i&&jg.test.test(i)){let r=i[0]==="t"||i[0]==="T";if(e===r)return i}return e?t.options.trueStr:t.options.falseStr}};Ug.boolTag=jg});var jr=_($g=>{"use strict";function _O({format:i,minFractionDigits:e,tag:t,value:r}){if(typeof r=="bigint")return String(r);let n=typeof r=="number"?r:Number(r);if(!isFinite(n))return isNaN(n)?".nan":n<0?"-.inf":".inf";let s=JSON.stringify(r);if(!i&&e&&(!t||t==="tag:yaml.org,2002:float")&&/^\d/.test(s)){let o=s.indexOf(".");o<0&&(o=s.length,s+=".");let a=e-(s.length-o-1);for(;a-- >0;)s+="0"}return s}$g.stringifyNumber=_O});var qc=_(Oo=>{"use strict";var wO=je(),Fc=jr(),xO={identify:i=>typeof i=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:i=>i.slice(-3).toLowerCase()==="nan"?NaN:i[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Fc.stringifyNumber},SO={identify:i=>typeof i=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:i=>parseFloat(i),stringify(i){let e=Number(i.value);return isFinite(e)?e.toExponential():Fc.stringifyNumber(i)}},EO={identify:i=>typeof i=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(i){let e=new wO.Scalar(parseFloat(i)),t=i.indexOf(".");return t!==-1&&i[i.length-1]==="0"&&(e.minFractionDigits=i.length-t-1),e},stringify:Fc.stringifyNumber};Oo.float=EO;Oo.floatExp=SO;Oo.floatNaN=xO});var Uc=_(Co=>{"use strict";var Vg=jr(),ko=i=>typeof i=="bigint"||Number.isInteger(i),jc=(i,e,t,{intAsBigInt:r})=>r?BigInt(i):parseInt(i.substring(e),t);function Hg(i,e,t){let{value:r}=i;return ko(r)&&r>=0?t+r.toString(e):Vg.stringifyNumber(i)}var OO={identify:i=>ko(i)&&i>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(i,e,t)=>jc(i,2,8,t),stringify:i=>Hg(i,8,"0o")},kO={identify:ko,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(i,e,t)=>jc(i,0,10,t),stringify:Vg.stringifyNumber},CO={identify:i=>ko(i)&&i>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(i,e,t)=>jc(i,2,16,t),stringify:i=>Hg(i,16,"0x")};Co.int=kO;Co.intHex=CO;Co.intOct=OO});var Wg=_(Gg=>{"use strict";var TO=Fr(),AO=Eo(),IO=qr(),NO=Cn(),LO=Dc(),$c=qc(),Vc=Uc(),BO=[TO.map,IO.seq,NO.string,AO.nullTag,LO.boolTag,Vc.intOct,Vc.int,Vc.intHex,$c.floatNaN,$c.floatExp,$c.float];Gg.schema=BO});var zg=_(Kg=>{"use strict";var RO=je(),PO=Fr(),MO=qr();function Yg(i){return typeof i=="bigint"||Number.isInteger(i)}var To=({value:i})=>JSON.stringify(i),DO=[{identify:i=>typeof i=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:i=>i,stringify:To},{identify:i=>i==null,createNode:()=>new RO.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:To},{identify:i=>typeof i=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true|false$/,resolve:i=>i==="true",stringify:To},{identify:Yg,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(i,e,{intAsBigInt:t})=>t?BigInt(i):parseInt(i,10),stringify:({value:i})=>Yg(i)?i.toString():JSON.stringify(i)},{identify:i=>typeof i=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:i=>parseFloat(i),stringify:To}],FO={default:!0,tag:"",test:/^/,resolve(i,e){return e(`Unresolved plain scalar ${JSON.stringify(i)}`),i}},qO=[PO.map,MO.seq].concat(DO,FO);Kg.schema=qO});var Gc=_(Jg=>{"use strict";var Hc=je(),jO=xn(),UO={identify:i=>i instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(i,e){if(typeof Buffer=="function")return Buffer.from(i,"base64");if(typeof atob=="function"){let t=atob(i.replace(/[\n\r]/g,"")),r=new Uint8Array(t.length);for(let n=0;n{"use strict";var Ao=Se(),Wc=Si(),$O=je(),VO=ki();function Zg(i,e){var t;if(Ao.isSeq(i))for(let r=0;r1&&e("Each pair must have its own sequence indicator");let s=n.items[0]||new Wc.Pair(new $O.Scalar(null));if(n.commentBefore&&(s.key.commentBefore=s.key.commentBefore?`${n.commentBefore}
${s.key.commentBefore}`:n.commentBefore),n.comment){let o=(t=s.value)!=null?t:s.key;o.comment=o.comment?`${n.comment}
${o.comment}`:n.comment}n=s}i.items[r]=Ao.isPair(n)?n:new Wc.Pair(n)}}else e("Expected a sequence for this tag");return i}function Qg(i,e,t){let{replacer:r}=t,n=new VO.YAMLSeq(i);n.tag="tag:yaml.org,2002:pairs";let s=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof r=="function"&&(o=r.call(e,String(s++),o));let a,l;if(Array.isArray(o))if(o.length===2)a=o[0],l=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let c=Object.keys(o);if(c.length===1)a=c[0],l=o[a];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else a=o;n.items.push(Wc.createPair(a,l,t))}return n}var HO={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Zg,createNode:Qg};Io.createPairs=Qg;Io.pairs=HO;Io.resolvePairs=Zg});var zc=_(Kc=>{"use strict";var Xg=Se(),Yc=bi(),Tn=Oi(),GO=ki(),e0=No(),Xi=class i extends GO.YAMLSeq{constructor(){super(),this.add=Tn.YAMLMap.prototype.add.bind(this),this.delete=Tn.YAMLMap.prototype.delete.bind(this),this.get=Tn.YAMLMap.prototype.get.bind(this),this.has=Tn.YAMLMap.prototype.has.bind(this),this.set=Tn.YAMLMap.prototype.set.bind(this),this.tag=i.tag}toJSON(e,t){if(!t)return super.toJSON(e);let r=new Map;t!=null&&t.onCreate&&t.onCreate(r);for(let n of this.items){let s,o;if(Xg.isPair(n)?(s=Yc.toJS(n.key,"",t),o=Yc.toJS(n.value,s,t)):s=Yc.toJS(n,"",t),r.has(s))throw new Error("Ordered maps must not include duplicate keys");r.set(s,o)}return r}static from(e,t,r){let n=e0.createPairs(e,t,r),s=new this;return s.items=n.items,s}};Xi.tag="tag:yaml.org,2002:omap";var WO={collection:"seq",identify:i=>i instanceof Map,nodeClass:Xi,default:!1,tag:"tag:yaml.org,2002:omap",resolve(i,e){let t=e0.resolvePairs(i,e),r=[];for(let{key:n}of t.items)Xg.isScalar(n)&&(r.includes(n.value)?e(`Ordered maps must not include duplicate keys: ${n.value}`):r.push(n.value));return Object.assign(new Xi,t)},createNode:(i,e,t)=>Xi.from(i,e,t)};Kc.YAMLOMap=Xi;Kc.omap=WO});var s0=_(Jc=>{"use strict";var t0=je();function i0({value:i,source:e},t){return e&&(i?r0:n0).test.test(e)?e:i?t.options.trueStr:t.options.falseStr}var r0={identify:i=>i===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new t0.Scalar(!0),stringify:i0},n0={identify:i=>i===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new t0.Scalar(!1),stringify:i0};Jc.falseTag=n0;Jc.trueTag=r0});var o0=_(Lo=>{"use strict";var YO=je(),Zc=jr(),KO={identify:i=>typeof i=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:i=>i.slice(-3).toLowerCase()==="nan"?NaN:i[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Zc.stringifyNumber},zO={identify:i=>typeof i=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:i=>parseFloat(i.replace(/_/g,"")),stringify(i){let e=Number(i.value);return isFinite(e)?e.toExponential():Zc.stringifyNumber(i)}},JO={identify:i=>typeof i=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(i){let e=new YO.Scalar(parseFloat(i.replace(/_/g,""))),t=i.indexOf(".");if(t!==-1){let r=i.substring(t+1).replace(/_/g,"");r[r.length-1]==="0"&&(e.minFractionDigits=r.length)}return e},stringify:Zc.stringifyNumber};Lo.float=JO;Lo.floatExp=zO;Lo.floatNaN=KO});var l0=_(In=>{"use strict";var a0=jr(),An=i=>typeof i=="bigint"||Number.isInteger(i);function Bo(i,e,t,{intAsBigInt:r}){let n=i[0];if((n==="-"||n==="+")&&(e+=1),i=i.substring(e).replace(/_/g,""),r){switch(t){case 2:i=`0b${i}`;break;case 8:i=`0o${i}`;break;case 16:i=`0x${i}`;break}let o=BigInt(i);return n==="-"?BigInt(-1)*o:o}let s=parseInt(i,t);return n==="-"?-1*s:s}function Qc(i,e,t){let{value:r}=i;if(An(r)){let n=r.toString(e);return r<0?"-"+t+n.substr(1):t+n}return a0.stringifyNumber(i)}var ZO={identify:An,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(i,e,t)=>Bo(i,2,2,t),stringify:i=>Qc(i,2,"0b")},QO={identify:An,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(i,e,t)=>Bo(i,1,8,t),stringify:i=>Qc(i,8,"0")},XO={identify:An,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(i,e,t)=>Bo(i,0,10,t),stringify:a0.stringifyNumber},ek={identify:An,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(i,e,t)=>Bo(i,2,16,t),stringify:i=>Qc(i,16,"0x")};In.int=XO;In.intBin=ZO;In.intHex=ek;In.intOct=QO});var eu=_(Xc=>{"use strict";var Mo=Se(),Ro=Si(),Po=Oi(),er=class i extends Po.YAMLMap{constructor(e){super(e),this.tag=i.tag}add(e){let t;Mo.isPair(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new Ro.Pair(e.key,null):t=new Ro.Pair(e,null),Po.findPair(this.items,t.key)||this.items.push(t)}get(e,t){let r=Po.findPair(this.items,e);return!t&&Mo.isPair(r)?Mo.isScalar(r.key)?r.key.value:r.key:r}set(e,t){if(typeof t!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let r=Po.findPair(this.items,e);r&&!t?this.items.splice(this.items.indexOf(r),1):!r&&t&&this.items.push(new Ro.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,r){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,r);throw new Error("Set items must all have null values")}static from(e,t,r){let{replacer:n}=r,s=new this(e);if(t&&Symbol.iterator in Object(t))for(let o of t)typeof n=="function"&&(o=n.call(t,o,o)),s.items.push(Ro.createPair(o,null,r));return s}};er.tag="tag:yaml.org,2002:set";var tk={collection:"map",identify:i=>i instanceof Set,nodeClass:er,default:!1,tag:"tag:yaml.org,2002:set",createNode:(i,e,t)=>er.from(i,e,t),resolve(i,e){if(Mo.isMap(i)){if(i.hasAllNullValues(!0))return Object.assign(new er,i);e("Set items must all have null values")}else e("Expected a mapping for this tag");return i}};Xc.YAMLSet=er;Xc.set=tk});var iu=_(Do=>{"use strict";var ik=jr();function tu(i,e){let t=i[0],r=t==="-"||t==="+"?i.substring(1):i,n=o=>e?BigInt(o):Number(o),s=r.replace(/_/g,"").split(":").reduce((o,a)=>o*n(60)+n(a),n(0));return t==="-"?n(-1)*s:s}function c0(i){let{value:e}=i,t=o=>o;if(typeof e=="bigint")t=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return ik.stringifyNumber(i);let r="";e<0&&(r="-",e*=t(-1));let n=t(60),s=[e%n];return e<60?s.unshift(0):(e=(e-s[0])/n,s.unshift(e%n),e>=60&&(e=(e-s[0])/n,s.unshift(e))),r+s.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var rk={identify:i=>typeof i=="bigint"||Number.isInteger(i),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(i,e,{intAsBigInt:t})=>tu(i,t),stringify:c0},nk={identify:i=>typeof i=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:i=>tu(i,!1),stringify:c0},u0={identify:i=>i instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(i){let e=i.match(u0.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,t,r,n,s,o,a]=e.map(Number),l=e[7]?Number((e[7]+"00").substr(1,3)):0,c=Date.UTC(t,r-1,n,s||0,o||0,a||0,l),u=e[8];if(u&&u!=="Z"){let f=tu(u,!1);Math.abs(f)<30&&(f*=60),c-=6e4*f}return new Date(c)},stringify:({value:i})=>i.toISOString().replace(/((T00:00)?:00)?\.000Z$/,"")};Do.floatTime=nk;Do.intTime=rk;Do.timestamp=u0});var p0=_(h0=>{"use strict";var sk=Fr(),ok=Eo(),ak=qr(),lk=Cn(),ck=Gc(),f0=s0(),ru=o0(),Fo=l0(),uk=go(),fk=zc(),hk=No(),pk=eu(),nu=iu(),dk=[sk.map,ak.seq,lk.string,ok.nullTag,f0.trueTag,f0.falseTag,Fo.intBin,Fo.intOct,Fo.int,Fo.intHex,ru.floatNaN,ru.floatExp,ru.float,ck.binary,uk.merge,fk.omap,hk.pairs,pk.set,nu.intTime,nu.floatTime,nu.timestamp];h0.schema=dk});var S0=_(au=>{"use strict";var v0=Fr(),mk=Eo(),y0=qr(),gk=Cn(),vk=Dc(),su=qc(),ou=Uc(),yk=Wg(),bk=zg(),b0=Gc(),Nn=go(),_0=zc(),w0=No(),d0=p0(),x0=eu(),qo=iu(),m0=new Map([["core",yk.schema],["failsafe",[v0.map,y0.seq,gk.string]],["json",bk.schema],["yaml11",d0.schema],["yaml-1.1",d0.schema]]),g0={binary:b0.binary,bool:vk.boolTag,float:su.float,floatExp:su.floatExp,floatNaN:su.floatNaN,floatTime:qo.floatTime,int:ou.int,intHex:ou.intHex,intOct:ou.intOct,intTime:qo.intTime,map:v0.map,merge:Nn.merge,null:mk.nullTag,omap:_0.omap,pairs:w0.pairs,seq:y0.seq,set:x0.set,timestamp:qo.timestamp},_k={"tag:yaml.org,2002:binary":b0.binary,"tag:yaml.org,2002:merge":Nn.merge,"tag:yaml.org,2002:omap":_0.omap,"tag:yaml.org,2002:pairs":w0.pairs,"tag:yaml.org,2002:set":x0.set,"tag:yaml.org,2002:timestamp":qo.timestamp};function wk(i,e,t){let r=m0.get(e);if(r&&!i)return t&&!r.includes(Nn.merge)?r.concat(Nn.merge):r.slice();let n=r;if(!n)if(Array.isArray(i))n=[];else{let s=Array.from(m0.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${s} or define customTags array`)}if(Array.isArray(i))for(let s of i)n=n.concat(s);else typeof i=="function"&&(n=i(n.slice()));return t&&(n=n.concat(Nn.merge)),n.reduce((s,o)=>{let a=typeof o=="string"?g0[o]:o;if(!a){let l=JSON.stringify(o),c=Object.keys(g0).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${c}`)}return s.includes(a)||s.push(a),s},[])}au.coreKnownTags=_k;au.getTags=wk});var uu=_(E0=>{"use strict";var lu=Se(),xk=Fr(),Sk=qr(),Ek=Cn(),jo=S0(),Ok=(i,e)=>i.keye.key?1:0,cu=class i{constructor({compat:e,customTags:t,merge:r,resolveKnownTags:n,schema:s,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?jo.getTags(e,"compat"):e?jo.getTags(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=n?jo.coreKnownTags:{},this.tags=jo.getTags(t,this.name,r),this.toStringOptions=a!=null?a:null,Object.defineProperty(this,lu.MAP,{value:xk.map}),Object.defineProperty(this,lu.SCALAR,{value:Ek.string}),Object.defineProperty(this,lu.SEQ,{value:Sk.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?Ok:null}clone(){let e=Object.create(i.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};E0.Schema=cu});var k0=_(O0=>{"use strict";var kk=Se(),fu=Sn(),Ln=bn();function Ck(i,e){var l;let t=[],r=e.directives===!0;if(e.directives!==!1&&i.directives){let c=i.directives.toString(i);c?(t.push(c),r=!0):i.directives.docStart&&(r=!0)}r&&t.push("---");let n=fu.createStringifyContext(i,e),{commentString:s}=n.options;if(i.commentBefore){t.length!==1&&t.unshift("");let c=s(i.commentBefore);t.unshift(Ln.indentComment(c,""))}let o=!1,a=null;if(i.contents){if(kk.isNode(i.contents)){if(i.contents.spaceBefore&&r&&t.push(""),i.contents.commentBefore){let f=s(i.contents.commentBefore);t.push(Ln.indentComment(f,""))}n.forceBlockIndent=!!i.comment,a=i.contents.comment}let c=a?void 0:()=>o=!0,u=fu.stringify(i.contents,n,()=>a=null,c);a&&(u+=Ln.lineComment(u,"",s(a))),(u[0]==="|"||u[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${u}`:t.push(u)}else t.push(fu.stringify(i.contents,n));if((l=i.directives)!=null&&l.docEnd)if(i.comment){let c=s(i.comment);c.includes(`
`)?(t.push("..."),t.push(Ln.indentComment(c,""))):t.push(`... ${c}`)}else t.push("...");else{let c=i.comment;c&&o&&(c=c.replace(/^\n+/,"")),c&&((!o||a)&&t[t.length-1]!==""&&t.push(""),t.push(Ln.indentComment(s(c),"")))}return t.join(`
`)+`
`}O0.stringifyDocument=Ck});var Bn=_(C0=>{"use strict";var Tk=vn(),Ur=oo(),Lt=Se(),Ak=Si(),Ik=bi(),Nk=uu(),Lk=k0(),hu=to(),Bk=gc(),Rk=yn(),pu=mc(),du=class i{constructor(e,t,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Lt.NODE_TYPE,{value:Lt.DOC});let n=null;typeof t=="function"||Array.isArray(t)?n=t:r===void 0&&t&&(r=t,t=void 0);let s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=s;let{version:o}=s;r!=null&&r._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new pu.Directives({version:o}),this.setSchema(o,r),this.contents=e===void 0?null:this.createNode(e,n,r)}clone(){let e=Object.create(i.prototype,{[Lt.NODE_TYPE]:{value:Lt.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=Lt.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){$r(this.contents)&&this.contents.add(e)}addIn(e,t){$r(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let r=hu.anchorNames(this);e.anchor=!t||r.has(t)?hu.findNewAnchor(t||"a",r):t}return new Tk.Alias(e.anchor)}createNode(e,t,r){let n;if(typeof t=="function")e=t.call({"":e},"",e),n=t;else if(Array.isArray(t)){let b=E=>typeof E=="number"||E instanceof String||E instanceof Number,x=t.filter(b).map(String);x.length>0&&(t=t.concat(x)),n=t}else r===void 0&&t&&(r=t,t=void 0);let{aliasDuplicateObjects:s,anchorPrefix:o,flow:a,keepUndefined:l,onTagObj:c,tag:u}=r!=null?r:{},{onAnchor:f,setAnchors:d,sourceObjects:m}=hu.createNodeAnchors(this,o||"a"),g={aliasDuplicateObjects:s!=null?s:!0,keepUndefined:l!=null?l:!1,onAnchor:f,onTagObj:c,replacer:n,schema:this.schema,sourceObjects:m},y=Rk.createNode(e,u,g);return a&&Lt.isCollection(y)&&(y.flow=!0),d(),y}createPair(e,t,r={}){let n=this.createNode(e,null,r),s=this.createNode(t,null,r);return new Ak.Pair(n,s)}delete(e){return $r(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Ur.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):$r(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return Lt.isCollection(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return Ur.isEmptyPath(e)?!t&&Lt.isScalar(this.contents)?this.contents.value:this.contents:Lt.isCollection(this.contents)?this.contents.getIn(e,t):void 0}has(e){return Lt.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return Ur.isEmptyPath(e)?this.contents!==void 0:Lt.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=Ur.collectionFromPath(this.schema,[e],t):$r(this.contents)&&this.contents.set(e,t)}setIn(e,t){Ur.isEmptyPath(e)?this.contents=t:this.contents==null?this.contents=Ur.collectionFromPath(this.schema,Array.from(e),t):$r(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e=="number"&&(e=String(e));let r;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new pu.Directives({version:"1.1"}),r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new pu.Directives({version:e}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{let n=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${n}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(r)this.schema=new Nk.Schema(Object.assign(r,t));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:r,maxAliasCount:n,onAnchor:s,reviver:o}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},l=Ik.toJS(this.contents,t!=null?t:"",a);if(typeof s=="function")for(let{count:c,res:u}of a.anchors.values())s(u,c);return typeof o=="function"?Bk.applyReviver(o,{"":l},"",l):l}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return Lk.stringifyDocument(this,e)}};function $r(i){if(Lt.isCollection(i))return!0;throw new Error("Expected a YAML collection as document contents")}C0.Document=du});var Mn=_(Pn=>{"use strict";var Rn=class extends Error{constructor(e,t,r,n){super(),this.name=e,this.code=r,this.message=n,this.pos=t}},mu=class extends Rn{constructor(e,t,r){super("YAMLParseError",e,t,r)}},gu=class extends Rn{constructor(e,t,r){super("YAMLWarning",e,t,r)}},Pk=(i,e)=>t=>{if(t.pos[0]===-1)return;t.linePos=t.pos.map(a=>e.linePos(a));let{line:r,col:n}=t.linePos[0];t.message+=` at line ${r}, column ${n}`;let s=n-1,o=i.substring(e.lineStarts[r-1],e.lineStarts[r]).replace(/[\n\r]+$/,"");if(s>=60&&o.length>80){let a=Math.min(s-39,o.length-79);o="\u2026"+o.substring(a),s-=a-1}if(o.length>80&&(o=o.substring(0,79)+"\u2026"),r>1&&/^ *$/.test(o.substring(0,s))){let a=i.substring(e.lineStarts[r-2],e.lineStarts[r-1]);a.length>80&&(a=a.substring(0,79)+`\u2026
`),o=a+o}if(/[^ ]/.test(o)){let a=1,l=t.linePos[1];l&&l.line===r&&l.col>n&&(a=Math.max(1,Math.min(l.col-n,80-s)));let c=" ".repeat(s)+"^".repeat(a);t.message+=`:
${o}
${c}
`}};Pn.YAMLError=Rn;Pn.YAMLParseError=mu;Pn.YAMLWarning=gu;Pn.prettifyError=Pk});var Dn=_(T0=>{"use strict";function Mk(i,{flow:e,indicator:t,next:r,offset:n,onError:s,parentIndent:o,startOnNewline:a}){let l=!1,c=a,u=a,f="",d="",m=!1,g=!1,y=null,b=null,x=null,E=null,k=null,O=null,S=null;for(let A of i)switch(g&&(A.type!=="space"&&A.type!=="newline"&&A.type!=="comma"&&s(A.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g=!1),y&&(c&&A.type!=="comment"&&A.type!=="newline"&&s(y,"TAB_AS_INDENT","Tabs are not allowed as indentation"),y=null),A.type){case"space":!e&&(t!=="doc-start"||(r==null?void 0:r.type)!=="flow-collection")&&A.source.includes(" ")&&(y=A),u=!0;break;case"comment":{u||s(A,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let C=A.source.substring(1)||" ";f?f+=d+C:f=C,d="",c=!1;break}case"newline":c?f?f+=A.source:l=!0:d+=A.source,c=!0,m=!0,(b||x)&&(E=A),u=!0;break;case"anchor":b&&s(A,"MULTIPLE_ANCHORS","A node can have at most one anchor"),A.source.endsWith(":")&&s(A.offset+A.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),b=A,S===null&&(S=A.offset),c=!1,u=!1,g=!0;break;case"tag":{x&&s(A,"MULTIPLE_TAGS","A node can have at most one tag"),x=A,S===null&&(S=A.offset),c=!1,u=!1,g=!0;break}case t:(b||x)&&s(A,"BAD_PROP_ORDER",`Anchors and tags must be after the ${A.source} indicator`),O&&s(A,"UNEXPECTED_TOKEN",`Unexpected ${A.source} in ${e!=null?e:"collection"}`),O=A,c=t==="seq-item-ind"||t==="explicit-key-ind",u=!1;break;case"comma":if(e){k&&s(A,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),k=A,c=!1,u=!1;break}default:s(A,"UNEXPECTED_TOKEN",`Unexpected ${A.type} token`),c=!1,u=!1}let R=i[i.length-1],T=R?R.offset+R.source.length:n;return g&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&s(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),y&&(c&&y.indent<=o||(r==null?void 0:r.type)==="block-map"||(r==null?void 0:r.type)==="block-seq")&&s(y,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:k,found:O,spaceBefore:l,comment:f,hasNewline:m,anchor:b,tag:x,newlineAfterProp:E,end:T,start:S!=null?S:T}}T0.resolveProps=Mk});var Uo=_(A0=>{"use strict";function vu(i){if(!i)return null;switch(i.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(i.source.includes(`
`))return!0;if(i.end){for(let e of i.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of i.items){for(let t of e.start)if(t.type==="newline")return!0;if(e.sep){for(let t of e.sep)if(t.type==="newline")return!0}if(vu(e.key)||vu(e.value))return!0}return!1;default:return!0}}A0.containsNewline=vu});var yu=_(I0=>{"use strict";var Dk=Uo();function Fk(i,e,t){if((e==null?void 0:e.type)==="flow-collection"){let r=e.end[0];r.indent===i&&(r.source==="]"||r.source==="}")&&Dk.containsNewline(e)&&t(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}I0.flowIndentCheck=Fk});var bu=_(L0=>{"use strict";var N0=Se();function qk(i,e,t){let{uniqueKeys:r}=i.options;if(r===!1)return!1;let n=typeof r=="function"?r:(s,o)=>s===o||N0.isScalar(s)&&N0.isScalar(o)&&s.value===o.value;return e.some(s=>n(s.key,t))}L0.mapIncludes=qk});var F0=_(D0=>{"use strict";var B0=Si(),jk=Oi(),R0=Dn(),Uk=Uo(),P0=yu(),$k=bu(),M0="All mapping items must start at the same column";function Vk({composeNode:i,composeEmptyNode:e},t,r,n,s){var u,f;let o=(u=s==null?void 0:s.nodeClass)!=null?u:jk.YAMLMap,a=new o(t.schema);t.atRoot&&(t.atRoot=!1);let l=r.offset,c=null;for(let d of r.items){let{start:m,key:g,sep:y,value:b}=d,x=R0.resolveProps(m,{indicator:"explicit-key-ind",next:g!=null?g:y==null?void 0:y[0],offset:l,onError:n,parentIndent:r.indent,startOnNewline:!0}),E=!x.found;if(E){if(g&&(g.type==="block-seq"?n(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in g&&g.indent!==r.indent&&n(l,"BAD_INDENT",M0)),!x.anchor&&!x.tag&&!y){c=x.end,x.comment&&(a.comment?a.comment+=`
`+x.comment:a.comment=x.comment);continue}(x.newlineAfterProp||Uk.containsNewline(g))&&n(g!=null?g:m[m.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((f=x.found)==null?void 0:f.indent)!==r.indent&&n(l,"BAD_INDENT",M0);t.atKey=!0;let k=x.end,O=g?i(t,g,x,n):e(t,k,m,null,x,n);t.schema.compat&&P0.flowIndentCheck(r.indent,g,n),t.atKey=!1,$k.mapIncludes(t,a.items,O)&&n(k,"DUPLICATE_KEY","Map keys must be unique");let S=R0.resolveProps(y!=null?y:[],{indicator:"map-value-ind",next:b,offset:O.range[2],onError:n,parentIndent:r.indent,startOnNewline:!g||g.type==="block-scalar"});if(l=S.end,S.found){E&&((b==null?void 0:b.type)==="block-map"&&!S.hasNewline&&n(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),t.options.strict&&x.start{"use strict";var Hk=ki(),Gk=Dn(),Wk=yu();function Yk({composeNode:i,composeEmptyNode:e},t,r,n,s){var u;let o=(u=s==null?void 0:s.nodeClass)!=null?u:Hk.YAMLSeq,a=new o(t.schema);t.atRoot&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let l=r.offset,c=null;for(let{start:f,value:d}of r.items){let m=Gk.resolveProps(f,{indicator:"seq-item-ind",next:d,offset:l,onError:n,parentIndent:r.indent,startOnNewline:!0});if(!m.found)if(m.anchor||m.tag||d)d&&d.type==="block-seq"?n(m.end,"BAD_INDENT","All sequence items must start at the same column"):n(l,"MISSING_CHAR","Sequence item without - indicator");else{c=m.end,m.comment&&(a.comment=m.comment);continue}let g=d?i(t,d,m,n):e(t,m.end,f,null,m,n);t.schema.compat&&Wk.flowIndentCheck(r.indent,d,n),l=g.range[2],a.items.push(g)}return a.range=[r.offset,l,c!=null?c:l],a}q0.resolveBlockSeq=Yk});var Vr=_(U0=>{"use strict";function Kk(i,e,t,r){let n="";if(i){let s=!1,o="";for(let a of i){let{source:l,type:c}=a;switch(c){case"space":s=!0;break;case"comment":{t&&!s&&r(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=l.substring(1)||" ";n?n+=o+u:n=u,o="";break}case"newline":n&&(o+=l),s=!0;break;default:r(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}e+=l.length}}return{comment:n,offset:e}}U0.resolveEnd=Kk});var G0=_(H0=>{"use strict";var zk=Se(),Jk=Si(),$0=Oi(),Zk=ki(),Qk=Vr(),V0=Dn(),Xk=Uo(),eC=bu(),_u="Block collections are not allowed within flow collections",wu=i=>i&&(i.type==="block-map"||i.type==="block-seq");function tC({composeNode:i,composeEmptyNode:e},t,r,n,s){var b,x;let o=r.start.source==="{",a=o?"flow map":"flow sequence",l=(b=s==null?void 0:s.nodeClass)!=null?b:o?$0.YAMLMap:Zk.YAMLSeq,c=new l(t.schema);c.flow=!0;let u=t.atRoot;u&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let f=r.offset+r.start.source.length;for(let E=0;E0){let E=Qk.resolveEnd(g,y,t.options.strict,n);E.comment&&(c.comment?c.comment+=`
`+E.comment:c.comment=E.comment),c.range=[r.offset,y,E.offset]}else c.range=[r.offset,y,y];return c}H0.resolveFlowCollection=tC});var Y0=_(W0=>{"use strict";var iC=Se(),rC=je(),nC=Oi(),sC=ki(),oC=F0(),aC=j0(),lC=G0();function xu(i,e,t,r,n,s){let o=t.type==="block-map"?oC.resolveBlockMap(i,e,t,r,s):t.type==="block-seq"?aC.resolveBlockSeq(i,e,t,r,s):lC.resolveFlowCollection(i,e,t,r,s),a=o.constructor;return n==="!"||n===a.tagName?(o.tag=a.tagName,o):(n&&(o.tag=n),o)}function cC(i,e,t,r,n){var d,m;let s=r.tag,o=s?e.directives.tagName(s.source,g=>n(s,"TAG_RESOLVE_FAILED",g)):null;if(t.type==="block-seq"){let{anchor:g,newlineAfterProp:y}=r,b=g&&s?g.offset>s.offset?g:s:g!=null?g:s;b&&(!y||y.offsetg.tag===o&&g.collection===a);if(!l){let g=e.schema.knownTags[o];if(g&&g.collection===a)e.schema.tags.push(Object.assign({},g,{default:!1})),l=g;else return g!=null&&g.collection?n(s,"BAD_COLLECTION_TYPE",`${g.tag} used for ${a} collection, but expects ${g.collection}`,!0):n(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),xu(i,e,t,n,o)}let c=xu(i,e,t,n,o,l),u=(m=(d=l.resolve)==null?void 0:d.call(l,c,g=>n(s,"TAG_RESOLVE_FAILED",g),e.options))!=null?m:c,f=iC.isNode(u)?u:new rC.Scalar(u);return f.range=c.range,f.tag=o,l!=null&&l.format&&(f.format=l.format),f}W0.composeCollection=cC});var Eu=_(K0=>{"use strict";var Su=je();function uC(i,e,t){let r=e.offset,n=fC(e,i.options.strict,t);if(!n)return{value:"",type:null,comment:"",range:[r,r,r]};let s=n.mode===">"?Su.Scalar.BLOCK_FOLDED:Su.Scalar.BLOCK_LITERAL,o=e.source?hC(e.source):[],a=o.length;for(let y=o.length-1;y>=0;--y){let b=o[y][1];if(b===""||b==="\r")a=y;else break}if(a===0){let y=n.chomp==="+"&&o.length>0?`
`.repeat(Math.max(1,o.length-1)):"",b=r+n.length;return e.source&&(b+=e.source.length),{value:y,type:s,comment:n.comment,range:[r,b,b]}}let l=e.indent+n.indent,c=e.offset+n.length,u=0;for(let y=0;yl&&(l=b.length);else{b.length=a;--y)o[y][0].length>l&&(a=y+1);let f="",d="",m=!1;for(let y=0;yl||x[0]===" "?(d===" "?d=`
`:!m&&d===`
`&&(d=`
`),f+=d+b.slice(l)+x,d=`
`,m=!0):x===""?d===`
`?f+=`
`:d=`
`:(f+=d+x,d=" ",m=!1)}switch(n.chomp){case"-":break;case"+":for(let y=a;y{"use strict";var Ou=je(),pC=Vr();function dC(i,e,t){let{offset:r,type:n,source:s,end:o}=i,a,l,c=(d,m,g)=>t(r+d,m,g);switch(n){case"scalar":a=Ou.Scalar.PLAIN,l=mC(s,c);break;case"single-quoted-scalar":a=Ou.Scalar.QUOTE_SINGLE,l=gC(s,c);break;case"double-quoted-scalar":a=Ou.Scalar.QUOTE_DOUBLE,l=vC(s,c);break;default:return t(i,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${n}`),{value:"",type:null,comment:"",range:[r,r+s.length,r+s.length]}}let u=r+s.length,f=pC.resolveEnd(o,u,e,t);return{value:l,type:a,comment:f.comment,range:[r,u,f.offset]}}function mC(i,e){let t="";switch(i[0]){case" ":t="a tab character";break;case",":t="flow indicator character ,";break;case"%":t="directive indicator character %";break;case"|":case">":{t=`block scalar indicator ${i[0]}`;break}case"@":case"`":{t=`reserved character ${i[0]}`;break}}return t&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${t}`),z0(i)}function gC(i,e){return(i[i.length-1]!=="'"||i.length===1)&&e(i.length,"MISSING_CHAR","Missing closing 'quote"),z0(i.slice(1,-1)).replace(/''/g,"'")}function z0(i){var l;let e,t;try{e=new RegExp(`(.*?)(?s?i.slice(s,r+1):n)}else t+=n}return(i[i.length-1]!=='"'||i.length===1)&&e(i.length,"MISSING_CHAR",'Missing closing "quote'),t}function yC(i,e){let t="",r=i[e+1];for(;(r===" "||r===" "||r===`
`||r==="\r")&&!(r==="\r"&&i[e+2]!==`
`);)r===`
`&&(t+=`
`),e+=1,r=i[e+1];return t||(t=" "),{fold:t,offset:e}}var bC={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function _C(i,e,t,r){let n=i.substr(e,t),o=n.length===t&&/^[0-9a-fA-F]+$/.test(n)?parseInt(n,16):NaN;if(isNaN(o)){let a=i.substr(e-2,t+2);return r(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}return String.fromCodePoint(o)}J0.resolveFlowScalar=dC});var X0=_(Q0=>{"use strict";var tr=Se(),Z0=je(),wC=Eu(),xC=ku();function SC(i,e,t,r){let{value:n,type:s,comment:o,range:a}=e.type==="block-scalar"?wC.resolveBlockScalar(i,e,r):xC.resolveFlowScalar(e,i.options.strict,r),l=t?i.directives.tagName(t.source,f=>r(t,"TAG_RESOLVE_FAILED",f)):null,c;i.options.stringKeys&&i.atKey?c=i.schema[tr.SCALAR]:l?c=EC(i.schema,n,l,t,r):e.type==="scalar"?c=OC(i,n,e,r):c=i.schema[tr.SCALAR];let u;try{let f=c.resolve(n,d=>r(t!=null?t:e,"TAG_RESOLVE_FAILED",d),i.options);u=tr.isScalar(f)?f:new Z0.Scalar(f)}catch(f){let d=f instanceof Error?f.message:String(f);r(t!=null?t:e,"TAG_RESOLVE_FAILED",d),u=new Z0.Scalar(n)}return u.range=a,u.source=n,s&&(u.type=s),l&&(u.tag=l),c.format&&(u.format=c.format),o&&(u.comment=o),u}function EC(i,e,t,r,n){var a;if(t==="!")return i[tr.SCALAR];let s=[];for(let l of i.tags)if(!l.collection&&l.tag===t)if(l.default&&l.test)s.push(l);else return l;for(let l of s)if((a=l.test)!=null&&a.test(e))return l;let o=i.knownTags[t];return o&&!o.collection?(i.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(n(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${t}`,t!=="tag:yaml.org,2002:str"),i[tr.SCALAR])}function OC({atKey:i,directives:e,schema:t},r,n,s){var a;let o=t.tags.find(l=>{var c;return(l.default===!0||i&&l.default==="key")&&((c=l.test)==null?void 0:c.test(r))})||t[tr.SCALAR];if(t.compat){let l=(a=t.compat.find(c=>{var u;return c.default&&((u=c.test)==null?void 0:u.test(r))}))!=null?a:t[tr.SCALAR];if(o.tag!==l.tag){let c=e.tagString(o.tag),u=e.tagString(l.tag),f=`Value may be parsed as either ${c} or ${u}`;s(n,"TAG_RESOLVE_FAILED",f,!0)}}return o}Q0.composeScalar=SC});var tv=_(ev=>{"use strict";function kC(i,e,t){if(e){t===null&&(t=e.length);for(let r=t-1;r>=0;--r){let n=e[r];switch(n.type){case"space":case"comment":case"newline":i-=n.source.length;continue}for(n=e[++r];(n==null?void 0:n.type)==="space";)i+=n.source.length,n=e[++r];break}}return i}ev.emptyScalarPosition=kC});var nv=_(Tu=>{"use strict";var CC=vn(),TC=Se(),AC=Y0(),iv=X0(),IC=Vr(),NC=tv(),LC={composeNode:rv,composeEmptyNode:Cu};function rv(i,e,t,r){let n=i.atKey,{spaceBefore:s,comment:o,anchor:a,tag:l}=t,c,u=!0;switch(e.type){case"alias":c=BC(i,e,r),(a||l)&&r(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":c=iv.composeScalar(i,e,l,r),a&&(c.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":c=AC.composeCollection(LC,i,e,t,r),a&&(c.anchor=a.source.substring(1));break;default:{let f=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;r(e,"UNEXPECTED_TOKEN",f),c=Cu(i,e.offset,void 0,null,t,r),u=!1}}return a&&c.anchor===""&&r(a,"BAD_ALIAS","Anchor cannot be an empty string"),n&&i.options.stringKeys&&(!TC.isScalar(c)||typeof c.value!="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str")&&r(l!=null?l:e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(c.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?c.comment=o:c.commentBefore=o),i.options.keepSourceTokens&&u&&(c.srcToken=e),c}function Cu(i,e,t,r,{spaceBefore:n,comment:s,anchor:o,tag:a,end:l},c){let u={type:"scalar",offset:NC.emptyScalarPosition(e,t,r),indent:-1,source:""},f=iv.composeScalar(i,u,a,c);return o&&(f.anchor=o.source.substring(1),f.anchor===""&&c(o,"BAD_ALIAS","Anchor cannot be an empty string")),n&&(f.spaceBefore=!0),s&&(f.comment=s,f.range[2]=l),f}function BC({options:i},{offset:e,source:t,end:r},n){let s=new CC.Alias(t.substring(1));s.source===""&&n(e,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&n(e+t.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+t.length,a=IC.resolveEnd(r,o,i.strict,n);return s.range=[e,o,a.offset],a.comment&&(s.comment=a.comment),s}Tu.composeEmptyNode=Cu;Tu.composeNode=rv});var av=_(ov=>{"use strict";var RC=Bn(),sv=nv(),PC=Vr(),MC=Dn();function DC(i,e,{offset:t,start:r,value:n,end:s},o){let a=Object.assign({_directives:e},i),l=new RC.Document(void 0,a),c={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},u=MC.resolveProps(r,{indicator:"doc-start",next:n!=null?n:s==null?void 0:s[0],offset:t,onError:o,parentIndent:0,startOnNewline:!0});u.found&&(l.directives.docStart=!0,n&&(n.type==="block-map"||n.type==="block-seq")&&!u.hasNewline&&o(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=n?sv.composeNode(c,n,u,o):sv.composeEmptyNode(c,u.end,r,null,u,o);let f=l.contents.range[2],d=PC.resolveEnd(s,f,!1,o);return d.comment&&(l.comment=d.comment),l.range=[t,f,d.offset],l}ov.composeDoc=DC});var Iu=_(uv=>{"use strict";var FC=mc(),qC=Bn(),Fn=Mn(),lv=Se(),jC=av(),UC=Vr();function qn(i){if(typeof i=="number")return[i,i+1];if(Array.isArray(i))return i.length===2?i:[i[0],i[1]];let{offset:e,source:t}=i;return[e,e+(typeof t=="string"?t.length:1)]}function cv(i){var n;let e="",t=!1,r=!1;for(let s=0;s{let o=qn(t);s?this.warnings.push(new Fn.YAMLWarning(o,r,n)):this.errors.push(new Fn.YAMLParseError(o,r,n))},this.directives=new FC.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,t){let{comment:r,afterEmptyLine:n}=cv(this.prelude);if(r){let s=e.contents;if(t)e.comment=e.comment?`${e.comment}
${r}`:r;else if(n||e.directives.docStart||!s)e.commentBefore=r;else if(lv.isCollection(s)&&!s.flow&&s.items.length>0){let o=s.items[0];lv.isPair(o)&&(o=o.key);let a=o.commentBefore;o.commentBefore=a?`${r}
${a}`:r}else{let o=s.commentBefore;s.commentBefore=o?`${r}
${o}`:r}}t?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:cv(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,r=-1){for(let n of e)yield*this.next(n);yield*this.end(t,r)}*next(e){switch(process.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(t,r,n)=>{let s=qn(e);s[0]+=t,this.onError(s,"BAD_DIRECTIVE",r,n)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let t=jC.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,r=new Fn.YAMLParseError(qn(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){let r="Unexpected doc-end without preceding document";this.errors.push(new Fn.YAMLParseError(qn(e),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;let t=UC.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let r=this.doc.comment;this.doc.comment=r?`${r}
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new Fn.YAMLParseError(qn(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let r=Object.assign({_directives:this.directives},this.options),n=new qC.Document(void 0,r);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),n.range=[0,t,t],this.decorate(n,!1),yield n}}};uv.Composer=Au});var pv=_($o=>{"use strict";var $C=Eu(),VC=ku(),HC=Mn(),fv=xn();function GC(i,e=!0,t){if(i){let r=(n,s,o)=>{let a=typeof n=="number"?n:Array.isArray(n)?n[0]:n.offset;if(t)t(a,s,o);else throw new HC.YAMLParseError([a,a+1],s,o)};switch(i.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return VC.resolveFlowScalar(i,e,r);case"block-scalar":return $C.resolveBlockScalar({options:{strict:e}},i,r)}}return null}function WC(i,e){var c;let{implicitKey:t=!1,indent:r,inFlow:n=!1,offset:s=-1,type:o="PLAIN"}=e,a=fv.stringifyString({type:o,value:i},{implicitKey:t,indent:r>0?" ".repeat(r):"",inFlow:n,options:{blockQuote:!0,lineWidth:-1}}),l=(c=e.end)!=null?c:[{type:"newline",offset:-1,indent:r,source:`
`}];switch(a[0]){case"|":case">":{let u=a.indexOf(`
`),f=a.substring(0,u),d=a.substring(u+1)+`
`,m=[{type:"block-scalar-header",offset:s,indent:r,source:f}];return hv(m,l)||m.push({type:"newline",offset:-1,indent:r,source:`
`}),{type:"block-scalar",offset:s,indent:r,props:m,source:d}}case'"':return{type:"double-quoted-scalar",offset:s,indent:r,source:a,end:l};case"'":return{type:"single-quoted-scalar",offset:s,indent:r,source:a,end:l};default:return{type:"scalar",offset:s,indent:r,source:a,end:l}}}function YC(i,e,t={}){let{afterKey:r=!1,implicitKey:n=!1,inFlow:s=!1,type:o}=t,a="indent"in i?i.indent:null;if(r&&typeof a=="number"&&(a+=2),!o)switch(i.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{let c=i.props[0];if(c.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=c.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}let l=fv.stringifyString({type:o,value:e},{implicitKey:n||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}});switch(l[0]){case"|":case">":KC(i,l);break;case'"':Nu(i,l,"double-quoted-scalar");break;case"'":Nu(i,l,"single-quoted-scalar");break;default:Nu(i,l,"scalar")}}function KC(i,e){let t=e.indexOf(`
`),r=e.substring(0,t),n=e.substring(t+1)+`
`;if(i.type==="block-scalar"){let s=i.props[0];if(s.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s.source=r,i.source=n}else{let{offset:s}=i,o="indent"in i?i.indent:-1,a=[{type:"block-scalar-header",offset:s,indent:o,source:r}];hv(a,"end"in i?i.end:void 0)||a.push({type:"newline",offset:-1,indent:o,source:`
`});for(let l of Object.keys(i))l!=="type"&&l!=="offset"&&delete i[l];Object.assign(i,{type:"block-scalar",indent:o,props:a,source:n})}}function hv(i,e){if(e)for(let t of e)switch(t.type){case"space":case"comment":i.push(t);break;case"newline":return i.push(t),!0}return!1}function Nu(i,e,t){switch(i.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":i.type=t,i.source=e;break;case"block-scalar":{let r=i.props.slice(1),n=e.length;i.props[0].type==="block-scalar-header"&&(n-=i.props[0].source.length);for(let s of r)s.offset+=n;delete i.props,Object.assign(i,{type:t,source:e,end:r});break}case"block-map":case"block-seq":{let n={type:"newline",offset:i.offset+e.length,indent:i.indent,source:`
`};delete i.items,Object.assign(i,{type:t,source:e,end:[n]});break}default:{let r="indent"in i?i.indent:-1,n="end"in i&&Array.isArray(i.end)?i.end.filter(s=>s.type==="space"||s.type==="comment"||s.type==="newline"):[];for(let s of Object.keys(i))s!=="type"&&s!=="offset"&&delete i[s];Object.assign(i,{type:t,indent:r,source:e,end:n})}}}$o.createScalarToken=WC;$o.resolveAsScalar=GC;$o.setScalarValue=YC});var mv=_(dv=>{"use strict";var zC=i=>"type"in i?Ho(i):Vo(i);function Ho(i){switch(i.type){case"block-scalar":{let e="";for(let t of i.props)e+=Ho(t);return e+i.source}case"block-map":case"block-seq":{let e="";for(let t of i.items)e+=Vo(t);return e}case"flow-collection":{let e=i.start.source;for(let t of i.items)e+=Vo(t);for(let t of i.end)e+=t.source;return e}case"document":{let e=Vo(i);if(i.end)for(let t of i.end)e+=t.source;return e}default:{let e=i.source;if("end"in i&&i.end)for(let t of i.end)e+=t.source;return e}}}function Vo({start:i,key:e,sep:t,value:r}){let n="";for(let s of i)n+=s.source;if(e&&(n+=Ho(e)),t)for(let s of t)n+=s.source;return r&&(n+=Ho(r)),n}dv.stringify=zC});var bv=_(yv=>{"use strict";var Lu=Symbol("break visit"),JC=Symbol("skip children"),gv=Symbol("remove item");function ir(i,e){"type"in i&&i.type==="document"&&(i={start:i.start,value:i.value}),vv(Object.freeze([]),i,e)}ir.BREAK=Lu;ir.SKIP=JC;ir.REMOVE=gv;ir.itemAtPath=(i,e)=>{let t=i;for(let[r,n]of e){let s=t==null?void 0:t[r];if(s&&"items"in s)t=s.items[n];else return}return t};ir.parentCollection=(i,e)=>{let t=ir.itemAtPath(i,e.slice(0,-1)),r=e[e.length-1][0],n=t==null?void 0:t[r];if(n&&"items"in n)return n;throw new Error("Parent collection not found")};function vv(i,e,t){let r=t(e,i);if(typeof r=="symbol")return r;for(let n of["key","value"]){let s=e[n];if(s&&"items"in s){for(let o=0;o{"use strict";var Bu=pv(),ZC=mv(),QC=bv(),Ru="\uFEFF",Pu="",Mu="",Du="",XC=i=>!!i&&"items"in i,eT=i=>!!i&&(i.type==="scalar"||i.type==="single-quoted-scalar"||i.type==="double-quoted-scalar"||i.type==="block-scalar");function tT(i){switch(i){case Ru:return"";case Pu:return"";case Mu:return"";case Du:return"";default:return JSON.stringify(i)}}function iT(i){switch(i){case Ru:return"byte-order-mark";case Pu:return"doc-mode";case Mu:return"flow-error-end";case Du:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
`:case`\r
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(i[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}vt.createScalarToken=Bu.createScalarToken;vt.resolveAsScalar=Bu.resolveAsScalar;vt.setScalarValue=Bu.setScalarValue;vt.stringify=ZC.stringify;vt.visit=QC.visit;vt.BOM=Ru;vt.DOCUMENT=Pu;vt.FLOW_END=Mu;vt.SCALAR=Du;vt.isCollection=XC;vt.isScalar=eT;vt.prettyToken=tT;vt.tokenType=iT});var ju=_(wv=>{"use strict";var jn=Go();function Ut(i){switch(i){case void 0:case" ":case`
`:case"\r":case" ":return!0;default:return!1}}var _v=new Set("0123456789ABCDEFabcdef"),rT=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Wo=new Set(",[]{}"),nT=new Set(` ,[]{}
\r `),Fu=i=>!i||nT.has(i),qu=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){var n;if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let r=(n=this.next)!=null?n:"stream";for(;r&&(t||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===" "||t===" ";)t=this.buffer[++e];return!t||t==="#"||t===`
`?!0:t==="\r"?this.buffer[e+1]===`
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let r=0;for(;t===" ";)t=this.buffer[++r+e];if(t==="\r"){let n=this.buffer[r+e+1];if(n===`
`||!n&&!this.atEnd)return e+r+1}return t===`
`||r>=this.indentNext||!t&&!this.atEnd?e+r:-1}if(t==="-"||t==="."){let r=this.buffer.substr(e,3);if((r==="---"||r==="...")&&Ut(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&ðis.indentValue&&!Ut(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&Ut(t)){let r=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=r,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Fu),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,r=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=r=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let n=this.getLine();if(n===null)return this.setNext("flow");if((r!==-1&&r"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if(t!=="-")break}return yield*this.pushUntil(t=>Ut(t)||t==="#")}*parseBlockScalar(){let e=this.pos-1,t=0,r;e:for(let s=this.pos;r=this.buffer[s];++s)switch(r){case" ":t+=1;break;case`
`:e=s,t=0;break;case"\r":{let o=this.buffer[s+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
`)break}default:break e}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(t>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=t:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let s=this.continueScalar(e+1);if(s===-1)break;e=this.buffer.indexOf(`
`,s)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let n=e+1;for(r=this.buffer[n];r===" ";)r=this.buffer[++n];if(r===" "){for(;r===" "||r===" "||r==="\r"||r===`
`;)r=this.buffer[++n];e=n-1}else if(!this.blockScalarKeep)do{let s=e-1,o=this.buffer[s];o==="\r"&&(o=this.buffer[--s]);let a=s;for(;o===" ";)o=this.buffer[--s];if(o===`
`&&s>=this.pos&&s+1+t>a)e=s;else break}while(!0);return yield jn.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,r=this.pos-1,n;for(;n=this.buffer[++r];)if(n===":"){let s=this.buffer[r+1];if(Ut(s)||e&&Wo.has(s))break;t=r}else if(Ut(n)){let s=this.buffer[r+1];if(n==="\r"&&(s===`
`?(r+=1,n=`
`,s=this.buffer[r+1]):t=r),s==="#"||e&&Wo.has(s))break;if(n===`
`){let o=this.continueScalar(r+1);if(o===-1)break;r=Math.max(r,o-2)}}else{if(e&&Wo.has(n))break;t=r}return!n&&!this.atEnd?this.setNext("plain-scalar"):(yield jn.SCALAR,yield*this.pushToIndex(t+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let r=this.buffer.slice(this.pos,e);return r?(yield r,this.pos+=r.length,r.length):(t&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(Fu))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let e=this.flowLevel>0,t=this.charAt(1);if(Ut(t)||e&&Wo.has(t))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,t=this.buffer[e];for(;!Ut(t)&&t!==">";)t=this.buffer[++e];return yield*this.pushToIndex(t===">"?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];for(;t;)if(rT.has(t))t=this.buffer[++e];else if(t==="%"&&_v.has(this.buffer[e+1])&&_v.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
`?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,r;do r=this.buffer[++t];while(r===" "||e&&r===" ");let n=t-this.pos;return n>0&&(yield this.buffer.substr(this.pos,n),this.pos=t),n}*pushUntil(e){let t=this.pos,r=this.buffer[t];for(;!e(r);)r=this.buffer[++t];return yield*this.pushToIndex(t,!1)}};wv.Lexer=qu});var $u=_(xv=>{"use strict";var Uu=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,r=this.lineStarts.length;for(;t>1;this.lineStarts[s]{"use strict";var Sv=Go(),sT=ju();function rr(i,e){for(let t=0;t=0;)switch(i[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((t=i[++e])==null?void 0:t.type)==="space";);return i.splice(e,i.length)}function Ov(i){if(i.start.type==="flow-seq-start")for(let e of i.items)e.sep&&!e.value&&!rr(e.start,"explicit-key-ind")&&!rr(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,kv(e.value)?e.value.end?Array.prototype.push.apply(e.value.end,e.sep):e.value.end=e.sep:Array.prototype.push.apply(e.start,e.sep),delete e.sep)}var Vu=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new sT.Lexer,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let r of this.lexer.lex(e,t))yield*this.next(r);t||(yield*this.end())}*next(e){if(this.source=e,process.env.LOG_TOKENS&&console.log("|",Sv.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=Sv.tokenType(e);if(t)if(t==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let r=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:r,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&(!e||e.type!=="doc-end")){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e!=null?e:this.stack.pop();if(!t)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield t;else{let r=this.peek(1);switch(t.type==="block-scalar"?t.indent="indent"in r?r.indent:0:t.type==="flow-collection"&&r.type==="document"&&(t.indent=0),t.type==="flow-collection"&&Ov(t),r.type){case"document":r.value=t;break;case"block-scalar":r.props.push(t);break;case"block-map":{let n=r.items[r.items.length-1];if(n.value){r.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(n.sep)n.value=t;else{Object.assign(n,{key:t,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case"block-seq":{let n=r.items[r.items.length-1];n.value?r.items.push({start:[],value:t}):n.value=t;break}case"flow-collection":{let n=r.items[r.items.length-1];!n||n.value?r.items.push({start:[],key:t,sep:[]}):n.sep?n.value=t:Object.assign(n,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){let n=t.items[t.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&Ev(n.start)===-1&&(t.indent===0||n.start.every(s=>s.type!=="comment"||s.indent=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,s=n&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind",o=[];if(s&&t.sep&&!t.value){let a=[];for(let l=0;le.indent&&(a.length=0);break;default:a.length=0}}a.length>=2&&(o=t.sep.splice(a[1]))}switch(this.type){case"anchor":case"tag":s||t.value?(o.push(this.sourceToken),e.items.push({start:o}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):s||t.value?(o.push(this.sourceToken),e.items.push({start:o,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(rr(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(kv(t.key)&&!rr(t.sep,"newline")){let a=Hr(t.start),l=t.key,c=t.sep;c.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:l,sep:c}]})}else o.length>0?t.sep=t.sep.concat(o,this.sourceToken):t.sep.push(this.sourceToken);else if(rr(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let a=Hr(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||s?e.items.push({start:o,key:null,sep:[this.sourceToken]}):rr(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let a=this.flowScalar(this.type);s||t.value?(e.items.push({start:o,key:a,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(a):(Object.assign(t,{key:a,sep:[]}),this.onKeyLine=!0);return}default:{let a=this.startBlockValue(e);if(a){n&&a.type!=="block-seq"&&e.items.push({start:o}),this.stack.push(a);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){var r;let t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){let n="end"in t.value?t.value.end:void 0,s=Array.isArray(n)?n[n.length-1]:void 0;(s==null?void 0:s.type)==="comment"?n==null||n.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2],s=(r=n==null?void 0:n.value)==null?void 0:r.end;if(Array.isArray(s)){Array.prototype.push.apply(s,t.start),s.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;t.value||rr(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let n=this.startBlockValue(e);if(n){this.stack.push(n);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while(r&&r.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case"map-value-ind":!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let n=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:n,sep:[]}):t.sep?this.stack.push(n):Object.assign(t,{key:n,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let r=this.startBlockValue(e);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{let r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===e.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){let n=Yo(r),s=Hr(n);Ov(e);let o=e.end.splice(1,e.end.length);o.push(this.sourceToken);let a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
`,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let t=Yo(e),r=Hr(t);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=Yo(e),r=Hr(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};Cv.Parser=Vu});var Lv=_($n=>{"use strict";var Tv=Iu(),oT=Bn(),Un=Mn(),aT=Tc(),lT=Se(),cT=$u(),Av=Hu();function Iv(i){let e=i.prettyErrors!==!1;return{lineCounter:i.lineCounter||e&&new cT.LineCounter||null,prettyErrors:e}}function uT(i,e={}){let{lineCounter:t,prettyErrors:r}=Iv(e),n=new Av.Parser(t==null?void 0:t.addNewLine),s=new Tv.Composer(e),o=Array.from(s.compose(n.parse(i)));if(r&&t)for(let a of o)a.errors.forEach(Un.prettifyError(i,t)),a.warnings.forEach(Un.prettifyError(i,t));return o.length>0?o:Object.assign([],{empty:!0},s.streamInfo())}function Nv(i,e={}){let{lineCounter:t,prettyErrors:r}=Iv(e),n=new Av.Parser(t==null?void 0:t.addNewLine),s=new Tv.Composer(e),o=null;for(let a of s.compose(n.parse(i),!0,i.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new Un.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&t&&(o.errors.forEach(Un.prettifyError(i,t)),o.warnings.forEach(Un.prettifyError(i,t))),o}function fT(i,e,t){let r;typeof e=="function"?r=e:t===void 0&&e&&typeof e=="object"&&(t=e);let n=Nv(i,t);if(!n)return null;if(n.warnings.forEach(s=>aT.warn(n.options.logLevel,s)),n.errors.length>0){if(n.options.logLevel!=="silent")throw n.errors[0];n.errors=[]}return n.toJS(Object.assign({reviver:r},t))}function hT(i,e,t){var n;let r=null;if(typeof e=="function"||Array.isArray(e)?r=e:t===void 0&&e&&(t=e),typeof t=="string"&&(t=t.length),typeof t=="number"){let s=Math.round(t);t=s<1?void 0:s>8?{indent:8}:{indent:s}}if(i===void 0){let{keepUndefined:s}=(n=t!=null?t:e)!=null?n:{};if(!s)return}return lT.isDocument(i)&&!r?i.toString(t):new oT.Document(i,r,t).toString(t)}$n.parse=fT;$n.parseAllDocuments=uT;$n.parseDocument=Nv;$n.stringify=hT});var Rv=_(Ce=>{"use strict";var pT=Iu(),dT=Bn(),mT=uu(),Gu=Mn(),gT=vn(),Ci=Se(),vT=Si(),yT=je(),bT=Oi(),_T=ki(),wT=Go(),xT=ju(),ST=$u(),ET=Hu(),Ko=Lv(),Bv=pn();Ce.Composer=pT.Composer;Ce.Document=dT.Document;Ce.Schema=mT.Schema;Ce.YAMLError=Gu.YAMLError;Ce.YAMLParseError=Gu.YAMLParseError;Ce.YAMLWarning=Gu.YAMLWarning;Ce.Alias=gT.Alias;Ce.isAlias=Ci.isAlias;Ce.isCollection=Ci.isCollection;Ce.isDocument=Ci.isDocument;Ce.isMap=Ci.isMap;Ce.isNode=Ci.isNode;Ce.isPair=Ci.isPair;Ce.isScalar=Ci.isScalar;Ce.isSeq=Ci.isSeq;Ce.Pair=vT.Pair;Ce.Scalar=yT.Scalar;Ce.YAMLMap=bT.YAMLMap;Ce.YAMLSeq=_T.YAMLSeq;Ce.CST=wT;Ce.Lexer=xT.Lexer;Ce.LineCounter=ST.LineCounter;Ce.Parser=ET.Parser;Ce.parse=Ko.parse;Ce.parseAllDocuments=Ko.parseAllDocuments;Ce.parseDocument=Ko.parseDocument;Ce.stringify=Ko.stringify;Ce.visit=Bv.visit;Ce.visitAsync=Bv.visitAsync});var Fv=_((kL,Dv)=>{"use strict";var{Duplex:OT}=require("stream");function Pv(i){i.emit("close")}function kT(){!this.destroyed&&this._writableState.finished&&this.destroy()}function Mv(i){this.removeListener("error",Mv),this.destroy(),this.listenerCount("error")===0&&this.emit("error",i)}function CT(i,e){let t=!0,r=new OT({...e,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return i.on("message",function(s,o){let a=!o&&r._readableState.objectMode?s.toString():s;r.push(a)||i.pause()}),i.once("error",function(s){r.destroyed||(t=!1,r.destroy(s))}),i.once("close",function(){r.destroyed||r.push(null)}),r._destroy=function(n,s){if(i.readyState===i.CLOSED){s(n),process.nextTick(Pv,r);return}let o=!1;i.once("error",function(l){o=!0,s(l)}),i.once("close",function(){o||s(n),process.nextTick(Pv,r)}),t&&i.terminate()},r._final=function(n){if(i.readyState===i.CONNECTING){i.once("open",function(){r._final(n)});return}i._socket!==null&&(i._socket._writableState.finished?(n(),r._readableState.endEmitted&&r.destroy()):(i._socket.once("finish",function(){n()}),i.close()))},r._read=function(){i.isPaused&&i.resume()},r._write=function(n,s,o){if(i.readyState===i.CONNECTING){i.once("open",function(){r._write(n,s,o)});return}i.send(n,o)},r.on("end",kT),r.on("error",Mv),r}Dv.exports=CT});var Ti=_((CL,qv)=>{"use strict";qv.exports={BINARY_TYPES:["nodebuffer","arraybuffer","fragments"],EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var Vn=_((TL,zo)=>{"use strict";var{EMPTY_BUFFER:TT}=Ti(),Wu=Buffer[Symbol.species];function AT(i,e){if(i.length===0)return TT;if(i.length===1)return i[0];let t=Buffer.allocUnsafe(e),r=0;for(let n=0;n{"use strict";var $v=Symbol("kDone"),Ku=Symbol("kRun"),zu=class{constructor(e){this[$v]=()=>{this.pending--,this[Ku]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[Ku]()}[Ku](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[$v])}}};Vv.exports=zu});var Wn=_((IL,Kv)=>{"use strict";var Hn=require("zlib"),Gv=Vn(),NT=Hv(),{kStatusCode:Wv}=Ti(),LT=Buffer[Symbol.species],BT=Buffer.from([0,0,255,255]),Qo=Symbol("permessage-deflate"),ci=Symbol("total-length"),Gn=Symbol("callback"),Ai=Symbol("buffers"),Zo=Symbol("error"),Jo,Ju=class{constructor(e,t,r){if(this._maxPayload=r|0,this._options=e||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._isServer=!!t,this._deflate=null,this._inflate=null,this.params=null,!Jo){let n=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;Jo=new NT(n)}}static get extensionName(){return"permessage-deflate"}offer(){let e={};return this._options.serverNoContextTakeover&&(e.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(e.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(e.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?e.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(e.client_max_window_bits=!0),e}accept(e){return e=this.normalizeParams(e),this.params=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let e=this._deflate[Gn];this._deflate.close(),this._deflate=null,e&&e(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(e){let t=this._options,r=e.find(n=>!(t.serverNoContextTakeover===!1&&n.server_no_context_takeover||n.server_max_window_bits&&(t.serverMaxWindowBits===!1||typeof t.serverMaxWindowBits=="number"&&t.serverMaxWindowBits>n.server_max_window_bits)||typeof t.clientMaxWindowBits=="number"&&!n.client_max_window_bits));if(!r)throw new Error("None of the extension offers can be accepted");return t.serverNoContextTakeover&&(r.server_no_context_takeover=!0),t.clientNoContextTakeover&&(r.client_no_context_takeover=!0),typeof t.serverMaxWindowBits=="number"&&(r.server_max_window_bits=t.serverMaxWindowBits),typeof t.clientMaxWindowBits=="number"?r.client_max_window_bits=t.clientMaxWindowBits:(r.client_max_window_bits===!0||t.clientMaxWindowBits===!1)&&delete r.client_max_window_bits,r}acceptAsClient(e){let t=e[0];if(this._options.clientNoContextTakeover===!1&&t.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!t.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(t.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&t.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return t}normalizeParams(e){return e.forEach(t=>{Object.keys(t).forEach(r=>{let n=t[r];if(n.length>1)throw new Error(`Parameter "${r}" must have only a single value`);if(n=n[0],r==="client_max_window_bits"){if(n!==!0){let s=+n;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${r}": ${n}`);n=s}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${r}": ${n}`)}else if(r==="server_max_window_bits"){let s=+n;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${r}": ${n}`);n=s}else if(r==="client_no_context_takeover"||r==="server_no_context_takeover"){if(n!==!0)throw new TypeError(`Invalid value for parameter "${r}": ${n}`)}else throw new Error(`Unknown parameter "${r}"`);t[r]=n})}),e}decompress(e,t,r){Jo.add(n=>{this._decompress(e,t,(s,o)=>{n(),r(s,o)})})}compress(e,t,r){Jo.add(n=>{this._compress(e,t,(s,o)=>{n(),r(s,o)})})}_decompress(e,t,r){let n=this._isServer?"client":"server";if(!this._inflate){let s=`${n}_max_window_bits`,o=typeof this.params[s]!="number"?Hn.Z_DEFAULT_WINDOWBITS:this.params[s];this._inflate=Hn.createInflateRaw({...this._options.zlibInflateOptions,windowBits:o}),this._inflate[Qo]=this,this._inflate[ci]=0,this._inflate[Ai]=[],this._inflate.on("error",PT),this._inflate.on("data",Yv)}this._inflate[Gn]=r,this._inflate.write(e),t&&this._inflate.write(BT),this._inflate.flush(()=>{let s=this._inflate[Zo];if(s){this._inflate.close(),this._inflate=null,r(s);return}let o=Gv.concat(this._inflate[Ai],this._inflate[ci]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[ci]=0,this._inflate[Ai]=[],t&&this.params[`${n}_no_context_takeover`]&&this._inflate.reset()),r(null,o)})}_compress(e,t,r){let n=this._isServer?"server":"client";if(!this._deflate){let s=`${n}_max_window_bits`,o=typeof this.params[s]!="number"?Hn.Z_DEFAULT_WINDOWBITS:this.params[s];this._deflate=Hn.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:o}),this._deflate[ci]=0,this._deflate[Ai]=[],this._deflate.on("data",RT)}this._deflate[Gn]=r,this._deflate.write(e),this._deflate.flush(Hn.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let s=Gv.concat(this._deflate[Ai],this._deflate[ci]);t&&(s=new LT(s.buffer,s.byteOffset,s.length-4)),this._deflate[Gn]=null,this._deflate[ci]=0,this._deflate[Ai]=[],t&&this.params[`${n}_no_context_takeover`]&&this._deflate.reset(),r(null,s)})}};Kv.exports=Ju;function RT(i){this[Ai].push(i),this[ci]+=i.length}function Yv(i){if(this[ci]+=i.length,this[Qo]._maxPayload<1||this[ci]<=this[Qo]._maxPayload){this[Ai].push(i);return}this[Zo]=new RangeError("Max payload size exceeded"),this[Zo].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[Zo][Wv]=1009,this.removeListener("data",Yv),this.reset()}function PT(i){this[Qo]._inflate=null,i[Wv]=1007,this[Gn](i)}});var Yn=_((NL,Xo)=>{"use strict";var{isUtf8:zv}=require("buffer"),MT=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function DT(i){return i>=1e3&&i<=1014&&i!==1004&&i!==1005&&i!==1006||i>=3e3&&i<=4999}function Zu(i){let e=i.length,t=0;for(;t=e||(i[t+1]&192)!==128||(i[t+2]&192)!==128||i[t]===224&&(i[t+1]&224)===128||i[t]===237&&(i[t+1]&224)===160)return!1;t+=3}else if((i[t]&248)===240){if(t+3>=e||(i[t+1]&192)!==128||(i[t+2]&192)!==128||(i[t+3]&192)!==128||i[t]===240&&(i[t+1]&240)===128||i[t]===244&&i[t+1]>143||i[t]>244)return!1;t+=4}else return!1;return!0}Xo.exports={isValidStatusCode:DT,isValidUTF8:Zu,tokenChars:MT};if(zv)Xo.exports.isValidUTF8=function(i){return i.length<24?Zu(i):zv(i)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let i=require("utf-8-validate");Xo.exports.isValidUTF8=function(e){return e.length<32?Zu(e):i(e)}}catch{}});var rf=_((LL,iy)=>{"use strict";var{Writable:FT}=require("stream"),Jv=Wn(),{BINARY_TYPES:qT,EMPTY_BUFFER:Zv,kStatusCode:jT,kWebSocket:UT}=Ti(),{concat:Qu,toArrayBuffer:$T,unmask:VT}=Vn(),{isValidStatusCode:HT,isValidUTF8:Qv}=Yn(),ea=Buffer[Symbol.species],Bt=0,Xv=1,ey=2,ty=3,Xu=4,ef=5,ta=6,tf=class extends FT{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||qT[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[UT]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=Bt}_write(e,t,r){if(this._opcode===8&&this._state==Bt)return r();this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(r)}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e=r.length?t.set(this._buffers.shift(),n):(t.set(new Uint8Array(r.buffer,r.byteOffset,e),n),this._buffers[0]=new ea(r.buffer,r.byteOffset+e,r.length-e)),e-=r.length}while(e>0);return t}startLoop(e){this._loop=!0;do switch(this._state){case Bt:this.getInfo(e);break;case Xv:this.getPayloadLength16(e);break;case ey:this.getPayloadLength64(e);break;case ty:this.getMask();break;case Xu:this.getData(e);break;case ef:case ta:this._loop=!1;return}while(this._loop);this._errored||e()}getInfo(e){if(this._bufferedBytes<2){this._loop=!1;return}let t=this.consume(2);if((t[0]&48)!==0){let n=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");e(n);return}let r=(t[0]&64)===64;if(r&&!this._extensions[Jv.extensionName]){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(n);return}if(this._fin=(t[0]&128)===128,this._opcode=t[0]&15,this._payloadLength=t[1]&127,this._opcode===0){if(r){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(n);return}if(!this._fragmented){let n=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");e(n);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let n=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(n);return}this._compressed=r}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let n=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");e(n);return}if(r){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(n);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let n=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");e(n);return}}else{let n=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(n);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(t[1]&128)===128,this._isServer){if(!this._masked){let n=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");e(n);return}}else if(this._masked){let n=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");e(n);return}this._payloadLength===126?this._state=Xv:this._payloadLength===127?this._state=ey:this.haveLength(e)}getPayloadLength16(e){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(e)}getPayloadLength64(e){if(this._bufferedBytes<8){this._loop=!1;return}let t=this.consume(8),r=t.readUInt32BE(0);if(r>Math.pow(2,21)-1){let n=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");e(n);return}this._payloadLength=r*Math.pow(2,32)+t.readUInt32BE(4),this.haveLength(e)}haveLength(e){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let t=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");e(t);return}this._masked?this._state=ty:this._state=Xu}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=Xu}getData(e){let t=Zv;if(this._payloadLength){if(this._bufferedBytes7){this.controlMessage(t,e);return}if(this._compressed){this._state=ef,this.decompress(t,e);return}t.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(t)),this.dataMessage(e)}decompress(e,t){this._extensions[Jv.extensionName].decompress(e,this._fin,(n,s)=>{if(n)return t(n);if(s.length){if(this._messageLength+=s.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let o=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");t(o);return}this._fragments.push(s)}this.dataMessage(t),this._state===Bt&&this.startLoop(t)})}dataMessage(e){if(!this._fin){this._state=Bt;return}let t=this._messageLength,r=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let n;this._binaryType==="nodebuffer"?n=Qu(r,t):this._binaryType==="arraybuffer"?n=$T(Qu(r,t)):n=r,this._allowSynchronousEvents?(this.emit("message",n,!0),this._state=Bt):(this._state=ta,setImmediate(()=>{this.emit("message",n,!0),this._state=Bt,this.startLoop(e)}))}else{let n=Qu(r,t);if(!this._skipUTF8Validation&&!Qv(n)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(s);return}this._state===ef||this._allowSynchronousEvents?(this.emit("message",n,!1),this._state=Bt):(this._state=ta,setImmediate(()=>{this.emit("message",n,!1),this._state=Bt,this.startLoop(e)}))}}controlMessage(e,t){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit("conclude",1005,Zv),this.end();else{let r=e.readUInt16BE(0);if(!HT(r)){let s=this.createError(RangeError,`invalid status code ${r}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");t(s);return}let n=new ea(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!Qv(n)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(s);return}this._loop=!1,this.emit("conclude",r,n),this.end()}this._state=Bt;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=Bt):(this._state=ta,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=Bt,this.startLoop(t)}))}createError(e,t,r,n,s){this._loop=!1,this._errored=!0;let o=new e(r?`Invalid WebSocket frame: ${t}`:t);return Error.captureStackTrace(o,this.createError),o.code=s,o[jT]=n,o}};iy.exports=tf});var sf=_((RL,sy)=>{"use strict";var{Duplex:BL}=require("stream"),{randomFillSync:GT}=require("crypto"),ry=Wn(),{EMPTY_BUFFER:WT}=Ti(),{isValidStatusCode:YT}=Yn(),{mask:ny,toBuffer:Gr}=Vn(),$t=Symbol("kByteLength"),KT=Buffer.alloc(4),ia=8*1024,nr,Wr=ia,nf=class i{constructor(e,t,r){this._extensions=t||{},r&&(this._generateMask=r,this._maskBuffer=Buffer.alloc(4)),this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._deflating=!1,this._queue=[]}static frame(e,t){let r,n=!1,s=2,o=!1;t.mask&&(r=t.maskBuffer||KT,t.generateMask?t.generateMask(r):(Wr===ia&&(nr===void 0&&(nr=Buffer.alloc(ia)),GT(nr,0,ia),Wr=0),r[0]=nr[Wr++],r[1]=nr[Wr++],r[2]=nr[Wr++],r[3]=nr[Wr++]),o=(r[0]|r[1]|r[2]|r[3])===0,s=6);let a;typeof e=="string"?(!t.mask||o)&&t[$t]!==void 0?a=t[$t]:(e=Buffer.from(e),a=e.length):(a=e.length,n=t.mask&&t.readOnly&&!o);let l=a;a>=65536?(s+=8,l=127):a>125&&(s+=2,l=126);let c=Buffer.allocUnsafe(n?a+s:s);return c[0]=t.fin?t.opcode|128:t.opcode,t.rsv1&&(c[0]|=64),c[1]=l,l===126?c.writeUInt16BE(a,2):l===127&&(c[2]=c[3]=0,c.writeUIntBE(a,4,6)),t.mask?(c[1]|=128,c[s-4]=r[0],c[s-3]=r[1],c[s-2]=r[2],c[s-1]=r[3],o?[c,e]:n?(ny(e,r,c,s,a),[c]):(ny(e,r,e,0,a),[c,e])):[c,e]}close(e,t,r,n){let s;if(e===void 0)s=WT;else{if(typeof e!="number"||!YT(e))throw new TypeError("First argument must be a valid error code number");if(t===void 0||!t.length)s=Buffer.allocUnsafe(2),s.writeUInt16BE(e,0);else{let a=Buffer.byteLength(t);if(a>123)throw new RangeError("The message must not be greater than 123 bytes");s=Buffer.allocUnsafe(2+a),s.writeUInt16BE(e,0),typeof t=="string"?s.write(t,2):s.set(t,2)}}let o={[$t]:s.length,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._deflating?this.enqueue([this.dispatch,s,!1,o,n]):this.sendFrame(i.frame(s,o),n)}ping(e,t,r){let n,s;if(typeof e=="string"?(n=Buffer.byteLength(e),s=!1):(e=Gr(e),n=e.length,s=Gr.readOnly),n>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[$t]:n,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:9,readOnly:s,rsv1:!1};this._deflating?this.enqueue([this.dispatch,e,!1,o,r]):this.sendFrame(i.frame(e,o),r)}pong(e,t,r){let n,s;if(typeof e=="string"?(n=Buffer.byteLength(e),s=!1):(e=Gr(e),n=e.length,s=Gr.readOnly),n>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[$t]:n,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:10,readOnly:s,rsv1:!1};this._deflating?this.enqueue([this.dispatch,e,!1,o,r]):this.sendFrame(i.frame(e,o),r)}send(e,t,r){let n=this._extensions[ry.extensionName],s=t.binary?2:1,o=t.compress,a,l;if(typeof e=="string"?(a=Buffer.byteLength(e),l=!1):(e=Gr(e),a=e.length,l=Gr.readOnly),this._firstFragment?(this._firstFragment=!1,o&&n&&n.params[n._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(o=a>=n._threshold),this._compress=o):(o=!1,s=0),t.fin&&(this._firstFragment=!0),n){let c={[$t]:a,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:s,readOnly:l,rsv1:o};this._deflating?this.enqueue([this.dispatch,e,this._compress,c,r]):this.dispatch(e,this._compress,c,r)}else this.sendFrame(i.frame(e,{[$t]:a,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:s,readOnly:l,rsv1:!1}),r)}dispatch(e,t,r,n){if(!t){this.sendFrame(i.frame(e,r),n);return}let s=this._extensions[ry.extensionName];this._bufferedBytes+=r[$t],this._deflating=!0,s.compress(e,r.fin,(o,a)=>{if(this._socket.destroyed){let l=new Error("The socket was closed while data was being compressed");typeof n=="function"&&n(l);for(let c=0;c{"use strict";var{kForOnEventAttribute:Kn,kListener:of}=Ti(),oy=Symbol("kCode"),ay=Symbol("kData"),ly=Symbol("kError"),cy=Symbol("kMessage"),uy=Symbol("kReason"),Yr=Symbol("kTarget"),fy=Symbol("kType"),hy=Symbol("kWasClean"),ui=class{constructor(e){this[Yr]=null,this[fy]=e}get target(){return this[Yr]}get type(){return this[fy]}};Object.defineProperty(ui.prototype,"target",{enumerable:!0});Object.defineProperty(ui.prototype,"type",{enumerable:!0});var sr=class extends ui{constructor(e,t={}){super(e),this[oy]=t.code===void 0?0:t.code,this[uy]=t.reason===void 0?"":t.reason,this[hy]=t.wasClean===void 0?!1:t.wasClean}get code(){return this[oy]}get reason(){return this[uy]}get wasClean(){return this[hy]}};Object.defineProperty(sr.prototype,"code",{enumerable:!0});Object.defineProperty(sr.prototype,"reason",{enumerable:!0});Object.defineProperty(sr.prototype,"wasClean",{enumerable:!0});var Kr=class extends ui{constructor(e,t={}){super(e),this[ly]=t.error===void 0?null:t.error,this[cy]=t.message===void 0?"":t.message}get error(){return this[ly]}get message(){return this[cy]}};Object.defineProperty(Kr.prototype,"error",{enumerable:!0});Object.defineProperty(Kr.prototype,"message",{enumerable:!0});var zn=class extends ui{constructor(e,t={}){super(e),this[ay]=t.data===void 0?null:t.data}get data(){return this[ay]}};Object.defineProperty(zn.prototype,"data",{enumerable:!0});var zT={addEventListener(i,e,t={}){for(let n of this.listeners(i))if(!t[Kn]&&n[of]===e&&!n[Kn])return;let r;if(i==="message")r=function(s,o){let a=new zn("message",{data:o?s:s.toString()});a[Yr]=this,ra(e,this,a)};else if(i==="close")r=function(s,o){let a=new sr("close",{code:s,reason:o.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});a[Yr]=this,ra(e,this,a)};else if(i==="error")r=function(s){let o=new Kr("error",{error:s,message:s.message});o[Yr]=this,ra(e,this,o)};else if(i==="open")r=function(){let s=new ui("open");s[Yr]=this,ra(e,this,s)};else return;r[Kn]=!!t[Kn],r[of]=e,t.once?this.once(i,r):this.on(i,r)},removeEventListener(i,e){for(let t of this.listeners(i))if(t[of]===e&&!t[Kn]){this.removeListener(i,t);break}}};py.exports={CloseEvent:sr,ErrorEvent:Kr,Event:ui,EventTarget:zT,MessageEvent:zn};function ra(i,e,t){typeof i=="object"&&i.handleEvent?i.handleEvent.call(i,t):i.call(e,t)}});var af=_((ML,my)=>{"use strict";var{tokenChars:Jn}=Yn();function Qt(i,e,t){i[e]===void 0?i[e]=[t]:i[e].push(t)}function JT(i){let e=Object.create(null),t=Object.create(null),r=!1,n=!1,s=!1,o,a,l=-1,c=-1,u=-1,f=0;for(;f{let t=i[e];return Array.isArray(t)||(t=[t]),t.map(r=>[e].concat(Object.keys(r).map(n=>{let s=r[n];return Array.isArray(s)||(s=[s]),s.map(o=>o===!0?n:`${n}=${o}`).join("; ")})).join("; ")).join(", ")}).join(", ")}my.exports={format:ZT,parse:JT}});var hf=_((qL,ky)=>{"use strict";var QT=require("events"),XT=require("https"),eA=require("http"),yy=require("net"),tA=require("tls"),{randomBytes:iA,createHash:rA}=require("crypto"),{Duplex:DL,Readable:FL}=require("stream"),{URL:lf}=require("url"),Ii=Wn(),nA=rf(),sA=sf(),{BINARY_TYPES:gy,EMPTY_BUFFER:na,GUID:oA,kForOnEventAttribute:cf,kListener:aA,kStatusCode:lA,kWebSocket:st,NOOP:by}=Ti(),{EventTarget:{addEventListener:cA,removeEventListener:uA}}=dy(),{format:fA,parse:hA}=af(),{toBuffer:pA}=Vn(),dA=30*1e3,_y=Symbol("kAborted"),uf=[8,13],fi=["CONNECTING","OPEN","CLOSING","CLOSED"],mA=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,qe=class i extends QT{constructor(e,t,r){super(),this._binaryType=gy[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=na,this._closeTimer=null,this._extensions={},this._paused=!1,this._protocol="",this._readyState=i.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,e!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,t===void 0?t=[]:Array.isArray(t)||(typeof t=="object"&&t!==null?(r=t,t=[]):t=[t]),wy(this,e,t,r)):(this._autoPong=r.autoPong,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){gy.includes(e)&&(this._binaryType=e,this._receiver&&(this._receiver._binaryType=e))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(e,t,r){let n=new nA({allowSynchronousEvents:r.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:r.maxPayload,skipUTF8Validation:r.skipUTF8Validation});this._sender=new sA(e,this._extensions,r.generateMask),this._receiver=n,this._socket=e,n[st]=this,e[st]=this,n.on("conclude",yA),n.on("drain",bA),n.on("error",_A),n.on("message",wA),n.on("ping",xA),n.on("pong",SA),e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),t.length>0&&e.unshift(t),e.on("close",Sy),e.on("data",oa),e.on("end",Ey),e.on("error",Oy),this._readyState=i.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=i.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[Ii.extensionName]&&this._extensions[Ii.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=i.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,t){if(this.readyState!==i.CLOSED){if(this.readyState===i.CONNECTING){Et(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===i.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=i.CLOSING,this._sender.close(e,t,!this._isServer,r=>{r||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),this._closeTimer=setTimeout(this._socket.destroy.bind(this._socket),dA)}}pause(){this.readyState===i.CONNECTING||this.readyState===i.CLOSED||(this._paused=!0,this._socket.pause())}ping(e,t,r){if(this.readyState===i.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(r=e,e=t=void 0):typeof t=="function"&&(r=t,t=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==i.OPEN){ff(this,e,r);return}t===void 0&&(t=!this._isServer),this._sender.ping(e||na,t,r)}pong(e,t,r){if(this.readyState===i.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(r=e,e=t=void 0):typeof t=="function"&&(r=t,t=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==i.OPEN){ff(this,e,r);return}t===void 0&&(t=!this._isServer),this._sender.pong(e||na,t,r)}resume(){this.readyState===i.CONNECTING||this.readyState===i.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(e,t,r){if(this.readyState===i.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"&&(r=t,t={}),typeof e=="number"&&(e=e.toString()),this.readyState!==i.OPEN){ff(this,e,r);return}let n={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...t};this._extensions[Ii.extensionName]||(n.compress=!1),this._sender.send(e||na,n,r)}terminate(){if(this.readyState!==i.CLOSED){if(this.readyState===i.CONNECTING){Et(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=i.CLOSING,this._socket.destroy())}}};Object.defineProperty(qe,"CONNECTING",{enumerable:!0,value:fi.indexOf("CONNECTING")});Object.defineProperty(qe.prototype,"CONNECTING",{enumerable:!0,value:fi.indexOf("CONNECTING")});Object.defineProperty(qe,"OPEN",{enumerable:!0,value:fi.indexOf("OPEN")});Object.defineProperty(qe.prototype,"OPEN",{enumerable:!0,value:fi.indexOf("OPEN")});Object.defineProperty(qe,"CLOSING",{enumerable:!0,value:fi.indexOf("CLOSING")});Object.defineProperty(qe.prototype,"CLOSING",{enumerable:!0,value:fi.indexOf("CLOSING")});Object.defineProperty(qe,"CLOSED",{enumerable:!0,value:fi.indexOf("CLOSED")});Object.defineProperty(qe.prototype,"CLOSED",{enumerable:!0,value:fi.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(i=>{Object.defineProperty(qe.prototype,i,{enumerable:!0})});["open","error","close","message"].forEach(i=>{Object.defineProperty(qe.prototype,`on${i}`,{enumerable:!0,get(){for(let e of this.listeners(i))if(e[cf])return e[aA];return null},set(e){for(let t of this.listeners(i))if(t[cf]){this.removeListener(i,t);break}typeof e=="function"&&this.addEventListener(i,e,{[cf]:!0})}})});qe.prototype.addEventListener=cA;qe.prototype.removeEventListener=uA;ky.exports=qe;function wy(i,e,t,r){let n={allowSynchronousEvents:!0,autoPong:!0,protocolVersion:uf[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...r,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(i._autoPong=n.autoPong,!uf.includes(n.protocolVersion))throw new RangeError(`Unsupported protocol version: ${n.protocolVersion} (supported versions: ${uf.join(", ")})`);let s;if(e instanceof lf)s=e;else try{s=new lf(e)}catch{throw new SyntaxError(`Invalid URL: ${e}`)}s.protocol==="http:"?s.protocol="ws:":s.protocol==="https:"&&(s.protocol="wss:"),i._url=s.href;let o=s.protocol==="wss:",a=s.protocol==="ws+unix:",l;if(s.protocol!=="ws:"&&!o&&!a?l=`The URL's protocol must be one of "ws:", "wss:", "http:", "https", or "ws+unix:"`:a&&!s.pathname?l="The URL's pathname is empty":s.hash&&(l="The URL contains a fragment identifier"),l){let y=new SyntaxError(l);if(i._redirects===0)throw y;sa(i,y);return}let c=o?443:80,u=iA(16).toString("base64"),f=o?XT.request:eA.request,d=new Set,m;if(n.createConnection=n.createConnection||(o?vA:gA),n.defaultPort=n.defaultPort||c,n.port=s.port||c,n.host=s.hostname.startsWith("[")?s.hostname.slice(1,-1):s.hostname,n.headers={...n.headers,"Sec-WebSocket-Version":n.protocolVersion,"Sec-WebSocket-Key":u,Connection:"Upgrade",Upgrade:"websocket"},n.path=s.pathname+s.search,n.timeout=n.handshakeTimeout,n.perMessageDeflate&&(m=new Ii(n.perMessageDeflate!==!0?n.perMessageDeflate:{},!1,n.maxPayload),n.headers["Sec-WebSocket-Extensions"]=fA({[Ii.extensionName]:m.offer()})),t.length){for(let y of t){if(typeof y!="string"||!mA.test(y)||d.has(y))throw new SyntaxError("An invalid or duplicated subprotocol was specified");d.add(y)}n.headers["Sec-WebSocket-Protocol"]=t.join(",")}if(n.origin&&(n.protocolVersion<13?n.headers["Sec-WebSocket-Origin"]=n.origin:n.headers.Origin=n.origin),(s.username||s.password)&&(n.auth=`${s.username}:${s.password}`),a){let y=n.path.split(":");n.socketPath=y[0],n.path=y[1]}let g;if(n.followRedirects){if(i._redirects===0){i._originalIpc=a,i._originalSecure=o,i._originalHostOrSocketPath=a?n.socketPath:s.host;let y=r&&r.headers;if(r={...r,headers:{}},y)for(let[b,x]of Object.entries(y))r.headers[b.toLowerCase()]=x}else if(i.listenerCount("redirect")===0){let y=a?i._originalIpc?n.socketPath===i._originalHostOrSocketPath:!1:i._originalIpc?!1:s.host===i._originalHostOrSocketPath;(!y||i._originalSecure&&!o)&&(delete n.headers.authorization,delete n.headers.cookie,y||delete n.headers.host,n.auth=void 0)}n.auth&&!r.headers.authorization&&(r.headers.authorization="Basic "+Buffer.from(n.auth).toString("base64")),g=i._req=f(n),i._redirects&&i.emit("redirect",i.url,g)}else g=i._req=f(n);n.timeout&&g.on("timeout",()=>{Et(i,g,"Opening handshake has timed out")}),g.on("error",y=>{g===null||g[_y]||(g=i._req=null,sa(i,y))}),g.on("response",y=>{let b=y.headers.location,x=y.statusCode;if(b&&n.followRedirects&&x>=300&&x<400){if(++i._redirects>n.maxRedirects){Et(i,g,"Maximum redirects exceeded");return}g.abort();let E;try{E=new lf(b,e)}catch{let O=new SyntaxError(`Invalid URL: ${b}`);sa(i,O);return}wy(i,E,t,r)}else i.emit("unexpected-response",g,y)||Et(i,g,`Unexpected server response: ${y.statusCode}`)}),g.on("upgrade",(y,b,x)=>{if(i.emit("upgrade",y),i.readyState!==qe.CONNECTING)return;g=i._req=null;let E=y.headers.upgrade;if(E===void 0||E.toLowerCase()!=="websocket"){Et(i,b,"Invalid Upgrade header");return}let k=rA("sha1").update(u+oA).digest("base64");if(y.headers["sec-websocket-accept"]!==k){Et(i,b,"Invalid Sec-WebSocket-Accept header");return}let O=y.headers["sec-websocket-protocol"],S;if(O!==void 0?d.size?d.has(O)||(S="Server sent an invalid subprotocol"):S="Server sent a subprotocol but none was requested":d.size&&(S="Server sent no subprotocol"),S){Et(i,b,S);return}O&&(i._protocol=O);let R=y.headers["sec-websocket-extensions"];if(R!==void 0){if(!m){Et(i,b,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let T;try{T=hA(R)}catch{Et(i,b,"Invalid Sec-WebSocket-Extensions header");return}let A=Object.keys(T);if(A.length!==1||A[0]!==Ii.extensionName){Et(i,b,"Server indicated an extension that was not requested");return}try{m.accept(T[Ii.extensionName])}catch{Et(i,b,"Invalid Sec-WebSocket-Extensions header");return}i._extensions[Ii.extensionName]=m}i.setSocket(b,x,{allowSynchronousEvents:n.allowSynchronousEvents,generateMask:n.generateMask,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation})}),n.finishRequest?n.finishRequest(g,i):g.end()}function sa(i,e){i._readyState=qe.CLOSING,i.emit("error",e),i.emitClose()}function gA(i){return i.path=i.socketPath,yy.connect(i)}function vA(i){return i.path=void 0,!i.servername&&i.servername!==""&&(i.servername=yy.isIP(i.host)?"":i.host),tA.connect(i)}function Et(i,e,t){i._readyState=qe.CLOSING;let r=new Error(t);Error.captureStackTrace(r,Et),e.setHeader?(e[_y]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(sa,i,r)):(e.destroy(r),e.once("error",i.emit.bind(i,"error")),e.once("close",i.emitClose.bind(i)))}function ff(i,e,t){if(e){let r=pA(e).length;i._socket?i._sender._bufferedBytes+=r:i._bufferedAmount+=r}if(t){let r=new Error(`WebSocket is not open: readyState ${i.readyState} (${fi[i.readyState]})`);process.nextTick(t,r)}}function yA(i,e){let t=this[st];t._closeFrameReceived=!0,t._closeMessage=e,t._closeCode=i,t._socket[st]!==void 0&&(t._socket.removeListener("data",oa),process.nextTick(xy,t._socket),i===1005?t.close():t.close(i,e))}function bA(){let i=this[st];i.isPaused||i._socket.resume()}function _A(i){let e=this[st];e._socket[st]!==void 0&&(e._socket.removeListener("data",oa),process.nextTick(xy,e._socket),e.close(i[lA])),e.emit("error",i)}function vy(){this[st].emitClose()}function wA(i,e){this[st].emit("message",i,e)}function xA(i){let e=this[st];e._autoPong&&e.pong(i,!this._isServer,by),e.emit("ping",i)}function SA(i){this[st].emit("pong",i)}function xy(i){i.resume()}function Sy(){let i=this[st];this.removeListener("close",Sy),this.removeListener("data",oa),this.removeListener("end",Ey),i._readyState=qe.CLOSING;let e;!this._readableState.endEmitted&&!i._closeFrameReceived&&!i._receiver._writableState.errorEmitted&&(e=i._socket.read())!==null&&i._receiver.write(e),i._receiver.end(),this[st]=void 0,clearTimeout(i._closeTimer),i._receiver._writableState.finished||i._receiver._writableState.errorEmitted?i.emitClose():(i._receiver.on("error",vy),i._receiver.on("finish",vy))}function oa(i){this[st]._receiver.write(i)||this.pause()}function Ey(){let i=this[st];i._readyState=qe.CLOSING,i._receiver.end(),this.end()}function Oy(){let i=this[st];this.removeListener("error",Oy),this.on("error",by),i&&(i._readyState=qe.CLOSING,this.destroy())}});var Ty=_((jL,Cy)=>{"use strict";var{tokenChars:EA}=Yn();function OA(i){let e=new Set,t=-1,r=-1,n=0;for(n;n{"use strict";var kA=require("events"),aa=require("http"),{Duplex:UL}=require("stream"),{createHash:CA}=require("crypto"),Ay=af(),or=Wn(),TA=Ty(),AA=hf(),{GUID:IA,kWebSocket:NA}=Ti(),LA=/^[+/0-9A-Za-z]{22}==$/,Iy=0,Ny=1,By=2,pf=class extends kA{constructor(e,t){if(super(),e={allowSynchronousEvents:!0,autoPong:!0,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:AA,...e},e.port==null&&!e.server&&!e.noServer||e.port!=null&&(e.server||e.noServer)||e.server&&e.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(e.port!=null?(this._server=aa.createServer((r,n)=>{let s=aa.STATUS_CODES[426];n.writeHead(426,{"Content-Length":s.length,"Content-Type":"text/plain"}),n.end(s)}),this._server.listen(e.port,e.host,e.backlog,t)):e.server&&(this._server=e.server),this._server){let r=this.emit.bind(this,"connection");this._removeListeners=BA(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(n,s,o)=>{this.handleUpgrade(n,s,o,r)}})}e.perMessageDeflate===!0&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=e,this._state=Iy}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(e){if(this._state===By){e&&this.once("close",()=>{e(new Error("The server is not running"))}),process.nextTick(Zn,this);return}if(e&&this.once("close",e),this._state!==Ny)if(this._state=Ny,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(Zn,this):process.nextTick(Zn,this);else{let t=this._server;this._removeListeners(),this._removeListeners=this._server=null,t.close(()=>{Zn(this)})}}shouldHandle(e){if(this.options.path){let t=e.url.indexOf("?");if((t!==-1?e.url.slice(0,t):e.url)!==this.options.path)return!1}return!0}handleUpgrade(e,t,r,n){t.on("error",Ly);let s=e.headers["sec-websocket-key"],o=e.headers.upgrade,a=+e.headers["sec-websocket-version"];if(e.method!=="GET"){ar(this,e,t,405,"Invalid HTTP method");return}if(o===void 0||o.toLowerCase()!=="websocket"){ar(this,e,t,400,"Invalid Upgrade header");return}if(s===void 0||!LA.test(s)){ar(this,e,t,400,"Missing or invalid Sec-WebSocket-Key header");return}if(a!==8&&a!==13){ar(this,e,t,400,"Missing or invalid Sec-WebSocket-Version header");return}if(!this.shouldHandle(e)){Qn(t,400);return}let l=e.headers["sec-websocket-protocol"],c=new Set;if(l!==void 0)try{c=TA.parse(l)}catch{ar(this,e,t,400,"Invalid Sec-WebSocket-Protocol header");return}let u=e.headers["sec-websocket-extensions"],f={};if(this.options.perMessageDeflate&&u!==void 0){let d=new or(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let m=Ay.parse(u);m[or.extensionName]&&(d.accept(m[or.extensionName]),f[or.extensionName]=d)}catch{ar(this,e,t,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let d={origin:e.headers[`${a===8?"sec-websocket-origin":"origin"}`],secure:!!(e.socket.authorized||e.socket.encrypted),req:e};if(this.options.verifyClient.length===2){this.options.verifyClient(d,(m,g,y,b)=>{if(!m)return Qn(t,g||401,y,b);this.completeUpgrade(f,s,c,e,t,r,n)});return}if(!this.options.verifyClient(d))return Qn(t,401)}this.completeUpgrade(f,s,c,e,t,r,n)}completeUpgrade(e,t,r,n,s,o,a){if(!s.readable||!s.writable)return s.destroy();if(s[NA])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>Iy)return Qn(s,503);let c=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${CA("sha1").update(t+IA).digest("base64")}`],u=new this.options.WebSocket(null,void 0,this.options);if(r.size){let f=this.options.handleProtocols?this.options.handleProtocols(r,n):r.values().next().value;f&&(c.push(`Sec-WebSocket-Protocol: ${f}`),u._protocol=f)}if(e[or.extensionName]){let f=e[or.extensionName].params,d=Ay.format({[or.extensionName]:[f]});c.push(`Sec-WebSocket-Extensions: ${d}`),u._extensions=e}this.emit("headers",c,n),s.write(c.concat(`\r
`).join(`\r
`)),s.removeListener("error",Ly),u.setSocket(s,o,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(u),u.on("close",()=>{this.clients.delete(u),this._shouldEmitClose&&!this.clients.size&&process.nextTick(Zn,this)})),a(u,n)}};Ry.exports=pf;function BA(i,e){for(let t of Object.keys(e))i.on(t,e[t]);return function(){for(let r of Object.keys(e))i.removeListener(r,e[r])}}function Zn(i){i._state=By,i.emit("close")}function Ly(){this.destroy()}function Qn(i,e,t,r){t=t||aa.STATUS_CODES[e],r={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(t),...r},i.once("finish",i.destroy),i.end(`HTTP/1.1 ${e} ${aa.STATUS_CODES[e]}\r
`+Object.keys(r).map(n=>`${n}: ${r[n]}`).join(`\r
`)+`\r
\r
`+t)}function ar(i,e,t,r,n){if(i.listenerCount("wsClientError")){let s=new Error(n);Error.captureStackTrace(s,ar),i.emit("wsClientError",s,t,e)}else Qn(t,r,n)}});var qy=_((HL,Fy)=>{var Ni=require("constants"),PA=process.cwd,la=null,MA=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return la||(la=PA.call(process)),la};try{process.cwd()}catch{}typeof process.chdir=="function"&&(vf=process.chdir,process.chdir=function(i){la=null,vf.call(process,i)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,vf));var vf;Fy.exports=DA;function DA(i){Ni.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(i),i.lutimes||t(i),i.chown=s(i.chown),i.fchown=s(i.fchown),i.lchown=s(i.lchown),i.chmod=r(i.chmod),i.fchmod=r(i.fchmod),i.lchmod=r(i.lchmod),i.chownSync=o(i.chownSync),i.fchownSync=o(i.fchownSync),i.lchownSync=o(i.lchownSync),i.chmodSync=n(i.chmodSync),i.fchmodSync=n(i.fchmodSync),i.lchmodSync=n(i.lchmodSync),i.stat=a(i.stat),i.fstat=a(i.fstat),i.lstat=a(i.lstat),i.statSync=l(i.statSync),i.fstatSync=l(i.fstatSync),i.lstatSync=l(i.lstatSync),i.chmod&&!i.lchmod&&(i.lchmod=function(u,f,d){d&&process.nextTick(d)},i.lchmodSync=function(){}),i.chown&&!i.lchown&&(i.lchown=function(u,f,d,m){m&&process.nextTick(m)},i.lchownSync=function(){}),MA==="win32"&&(i.rename=typeof i.rename!="function"?i.rename:function(u){function f(d,m,g){var y=Date.now(),b=0;u(d,m,function x(E){if(E&&(E.code==="EACCES"||E.code==="EPERM")&&Date.now()-y<6e4){setTimeout(function(){i.stat(m,function(k,O){k&&k.code==="ENOENT"?u(d,m,x):g(E)})},b),b<100&&(b+=10);return}g&&g(E)})}return Object.setPrototypeOf&&Object.setPrototypeOf(f,u),f}(i.rename)),i.read=typeof i.read!="function"?i.read:function(u){function f(d,m,g,y,b,x){var E;if(x&&typeof x=="function"){var k=0;E=function(O,S,R){if(O&&O.code==="EAGAIN"&&k<10)return k++,u.call(i,d,m,g,y,b,E);x.apply(this,arguments)}}return u.call(i,d,m,g,y,b,E)}return Object.setPrototypeOf&&Object.setPrototypeOf(f,u),f}(i.read),i.readSync=typeof i.readSync!="function"?i.readSync:function(u){return function(f,d,m,g,y){for(var b=0;;)try{return u.call(i,f,d,m,g,y)}catch(x){if(x.code==="EAGAIN"&&b<10){b++;continue}throw x}}}(i.readSync);function e(u){u.lchmod=function(f,d,m){u.open(f,Ni.O_WRONLY|Ni.O_SYMLINK,d,function(g,y){if(g){m&&m(g);return}u.fchmod(y,d,function(b){u.close(y,function(x){m&&m(b||x)})})})},u.lchmodSync=function(f,d){var m=u.openSync(f,Ni.O_WRONLY|Ni.O_SYMLINK,d),g=!0,y;try{y=u.fchmodSync(m,d),g=!1}finally{if(g)try{u.closeSync(m)}catch{}else u.closeSync(m)}return y}}function t(u){Ni.hasOwnProperty("O_SYMLINK")&&u.futimes?(u.lutimes=function(f,d,m,g){u.open(f,Ni.O_SYMLINK,function(y,b){if(y){g&&g(y);return}u.futimes(b,d,m,function(x){u.close(b,function(E){g&&g(x||E)})})})},u.lutimesSync=function(f,d,m){var g=u.openSync(f,Ni.O_SYMLINK),y,b=!0;try{y=u.futimesSync(g,d,m),b=!1}finally{if(b)try{u.closeSync(g)}catch{}else u.closeSync(g)}return y}):u.futimes&&(u.lutimes=function(f,d,m,g){g&&process.nextTick(g)},u.lutimesSync=function(){})}function r(u){return u&&function(f,d,m){return u.call(i,f,d,function(g){c(g)&&(g=null),m&&m.apply(this,arguments)})}}function n(u){return u&&function(f,d){try{return u.call(i,f,d)}catch(m){if(!c(m))throw m}}}function s(u){return u&&function(f,d,m,g){return u.call(i,f,d,m,function(y){c(y)&&(y=null),g&&g.apply(this,arguments)})}}function o(u){return u&&function(f,d,m){try{return u.call(i,f,d,m)}catch(g){if(!c(g))throw g}}}function a(u){return u&&function(f,d,m){typeof d=="function"&&(m=d,d=null);function g(y,b){b&&(b.uid<0&&(b.uid+=4294967296),b.gid<0&&(b.gid+=4294967296)),m&&m.apply(this,arguments)}return d?u.call(i,f,d,g):u.call(i,f,g)}}function l(u){return u&&function(f,d){var m=d?u.call(i,f,d):u.call(i,f);return m&&(m.uid<0&&(m.uid+=4294967296),m.gid<0&&(m.gid+=4294967296)),m}}function c(u){if(!u||u.code==="ENOSYS")return!0;var f=!process.getuid||process.getuid()!==0;return!!(f&&(u.code==="EINVAL"||u.code==="EPERM"))}}});var $y=_((GL,Uy)=>{var jy=require("stream").Stream;Uy.exports=FA;function FA(i){return{ReadStream:e,WriteStream:t};function e(r,n){if(!(this instanceof e))return new e(r,n);jy.call(this);var s=this;this.path=r,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,n=n||{};for(var o=Object.keys(n),a=0,l=o.length;athis.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){s._read()});return}i.open(this.path,this.flags,this.mode,function(u,f){if(u){s.emit("error",u),s.readable=!1;return}s.fd=f,s.emit("open",f),s._read()})}function t(r,n){if(!(this instanceof t))return new t(r,n);jy.call(this),this.path=r,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,n=n||{};for(var s=Object.keys(n),o=0,a=s.length;o= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=i.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var Hy=_((WL,Vy)=>{"use strict";Vy.exports=jA;var qA=Object.getPrototypeOf||function(i){return i.__proto__};function jA(i){if(i===null||typeof i!="object")return i;if(i instanceof Object)var e={__proto__:qA(i)};else var e=Object.create(null);return Object.getOwnPropertyNames(i).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}),e}});var Ky=_((YL,_f)=>{var De=require("fs"),UA=qy(),$A=$y(),VA=Hy(),ca=require("util"),it,fa;typeof Symbol=="function"&&typeof Symbol.for=="function"?(it=Symbol.for("graceful-fs.queue"),fa=Symbol.for("graceful-fs.previous")):(it="___graceful-fs.queue",fa="___graceful-fs.previous");function HA(){}function Yy(i,e){Object.defineProperty(i,it,{get:function(){return e}})}var lr=HA;ca.debuglog?lr=ca.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(lr=function(){var i=ca.format.apply(ca,arguments);i="GFS4: "+i.split(/\n/).join(`
GFS4: `),console.error(i)});De[it]||(Gy=global[it]||[],Yy(De,Gy),De.close=function(i){function e(t,r){return i.call(De,t,function(n){n||Wy(),typeof r=="function"&&r.apply(this,arguments)})}return Object.defineProperty(e,fa,{value:i}),e}(De.close),De.closeSync=function(i){function e(t){i.apply(De,arguments),Wy()}return Object.defineProperty(e,fa,{value:i}),e}(De.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){lr(De[it]),require("assert").equal(De[it].length,0)}));var Gy;global[it]||Yy(global,De[it]);_f.exports=yf(VA(De));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!De.__patched&&(_f.exports=yf(De),De.__patched=!0);function yf(i){UA(i),i.gracefulify=yf,i.createReadStream=S,i.createWriteStream=R;var e=i.readFile;i.readFile=t;function t(C,L,P){return typeof L=="function"&&(P=L,L=null),U(C,L,P);function U(F,H,j,V){return e(F,H,function(Y){Y&&(Y.code==="EMFILE"||Y.code==="ENFILE")?zr([U,[F,H,j],Y,V||Date.now(),Date.now()]):typeof j=="function"&&j.apply(this,arguments)})}}var r=i.writeFile;i.writeFile=n;function n(C,L,P,U){return typeof P=="function"&&(U=P,P=null),F(C,L,P,U);function F(H,j,V,Y,Q){return r(H,j,V,function(W){W&&(W.code==="EMFILE"||W.code==="ENFILE")?zr([F,[H,j,V,Y],W,Q||Date.now(),Date.now()]):typeof Y=="function"&&Y.apply(this,arguments)})}}var s=i.appendFile;s&&(i.appendFile=o);function o(C,L,P,U){return typeof P=="function"&&(U=P,P=null),F(C,L,P,U);function F(H,j,V,Y,Q){return s(H,j,V,function(W){W&&(W.code==="EMFILE"||W.code==="ENFILE")?zr([F,[H,j,V,Y],W,Q||Date.now(),Date.now()]):typeof Y=="function"&&Y.apply(this,arguments)})}}var a=i.copyFile;a&&(i.copyFile=l);function l(C,L,P,U){return typeof P=="function"&&(U=P,P=0),F(C,L,P,U);function F(H,j,V,Y,Q){return a(H,j,V,function(W){W&&(W.code==="EMFILE"||W.code==="ENFILE")?zr([F,[H,j,V,Y],W,Q||Date.now(),Date.now()]):typeof Y=="function"&&Y.apply(this,arguments)})}}var c=i.readdir;i.readdir=f;var u=/^v[0-5]\./;function f(C,L,P){typeof L=="function"&&(P=L,L=null);var U=u.test(process.version)?function(j,V,Y,Q){return c(j,F(j,V,Y,Q))}:function(j,V,Y,Q){return c(j,V,F(j,V,Y,Q))};return U(C,L,P);function F(H,j,V,Y){return function(Q,W){Q&&(Q.code==="EMFILE"||Q.code==="ENFILE")?zr([U,[H,j,V],Q,Y||Date.now(),Date.now()]):(W&&W.sort&&W.sort(),typeof V=="function"&&V.call(this,Q,W))}}}if(process.version.substr(0,4)==="v0.8"){var d=$A(i);x=d.ReadStream,k=d.WriteStream}var m=i.ReadStream;m&&(x.prototype=Object.create(m.prototype),x.prototype.open=E);var g=i.WriteStream;g&&(k.prototype=Object.create(g.prototype),k.prototype.open=O),Object.defineProperty(i,"ReadStream",{get:function(){return x},set:function(C){x=C},enumerable:!0,configurable:!0}),Object.defineProperty(i,"WriteStream",{get:function(){return k},set:function(C){k=C},enumerable:!0,configurable:!0});var y=x;Object.defineProperty(i,"FileReadStream",{get:function(){return y},set:function(C){y=C},enumerable:!0,configurable:!0});var b=k;Object.defineProperty(i,"FileWriteStream",{get:function(){return b},set:function(C){b=C},enumerable:!0,configurable:!0});function x(C,L){return this instanceof x?(m.apply(this,arguments),this):x.apply(Object.create(x.prototype),arguments)}function E(){var C=this;A(C.path,C.flags,C.mode,function(L,P){L?(C.autoClose&&C.destroy(),C.emit("error",L)):(C.fd=P,C.emit("open",P),C.read())})}function k(C,L){return this instanceof k?(g.apply(this,arguments),this):k.apply(Object.create(k.prototype),arguments)}function O(){var C=this;A(C.path,C.flags,C.mode,function(L,P){L?(C.destroy(),C.emit("error",L)):(C.fd=P,C.emit("open",P))})}function S(C,L){return new i.ReadStream(C,L)}function R(C,L){return new i.WriteStream(C,L)}var T=i.open;i.open=A;function A(C,L,P,U){return typeof P=="function"&&(U=P,P=null),F(C,L,P,U);function F(H,j,V,Y,Q){return T(H,j,V,function(W,de){W&&(W.code==="EMFILE"||W.code==="ENFILE")?zr([F,[H,j,V,Y],W,Q||Date.now(),Date.now()]):typeof Y=="function"&&Y.apply(this,arguments)})}}return i}function zr(i){lr("ENQUEUE",i[0].name,i[1]),De[it].push(i),bf()}var ua;function Wy(){for(var i=Date.now(),e=0;e2&&(De[it][e][3]=i,De[it][e][4]=i);bf()}function bf(){if(clearTimeout(ua),ua=void 0,De[it].length!==0){var i=De[it].shift(),e=i[0],t=i[1],r=i[2],n=i[3],s=i[4];if(n===void 0)lr("RETRY",e.name,t),e.apply(null,t);else if(Date.now()-n>=6e4){lr("TIMEOUT",e.name,t);var o=t.pop();typeof o=="function"&&o.call(null,r)}else{var a=Date.now()-s,l=Math.max(s-n,1),c=Math.min(l*1.2,100);a>=c?(lr("RETRY",e.name,t),e.apply(null,t.concat([n]))):De[it].push(i)}ua===void 0&&(ua=setTimeout(bf,0))}}});var Jy=_((KL,zy)=>{function Rt(i,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(i)),this._timeouts=i,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}zy.exports=Rt;Rt.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};Rt.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null};Rt.prototype.retry=function(i){if(this._timeout&&clearTimeout(this._timeout),!i)return!1;var e=new Date().getTime();if(i&&e-this._operationStart>=this._maxRetryTime)return this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(i);var t=this._timeouts.shift();if(t===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),t=this._timeouts.shift();else return!1;var r=this,n=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)},t);return this._options.unref&&n.unref(),!0};Rt.prototype.attempt=function(i,e){this._fn=i,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var t=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){t._operationTimeoutCb()},t._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};Rt.prototype.try=function(i){console.log("Using RetryOperation.try() is deprecated"),this.attempt(i)};Rt.prototype.start=function(i){console.log("Using RetryOperation.start() is deprecated"),this.attempt(i)};Rt.prototype.start=Rt.prototype.try;Rt.prototype.errors=function(){return this._errors};Rt.prototype.attempts=function(){return this._attempts};Rt.prototype.mainError=function(){if(this._errors.length===0)return null;for(var i={},e=null,t=0,r=0;r=t&&(e=n,t=o)}return e}});var Zy=_(cr=>{var GA=Jy();cr.operation=function(i){var e=cr.timeouts(i);return new GA(e,{forever:i&&i.forever,unref:i&&i.unref,maxRetryTime:i&&i.maxRetryTime})};cr.timeouts=function(i){if(i instanceof Array)return[].concat(i);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var t in i)e[t]=i[t];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var r=[],n=0;n{Qy.exports=Zy()});var eb=_((ZL,ha)=>{ha.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&ha.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&ha.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var sb=_((QL,Qr)=>{var Me=global.process,ur=function(i){return i&&typeof i=="object"&&typeof i.removeListener=="function"&&typeof i.emit=="function"&&typeof i.reallyExit=="function"&&typeof i.listeners=="function"&&typeof i.kill=="function"&&typeof i.pid=="number"&&typeof i.on=="function"};ur(Me)?(tb=require("assert"),Jr=eb(),ib=/^win/i.test(Me.platform),Xn=require("events"),typeof Xn!="function"&&(Xn=Xn.EventEmitter),Me.__signal_exit_emitter__?Qe=Me.__signal_exit_emitter__:(Qe=Me.__signal_exit_emitter__=new Xn,Qe.count=0,Qe.emitted={}),Qe.infinite||(Qe.setMaxListeners(1/0),Qe.infinite=!0),Qr.exports=function(i,e){if(!ur(global.process))return function(){};tb.equal(typeof i,"function","a callback must be provided for exit handler"),Zr===!1&&wf();var t="exit";e&&e.alwaysLast&&(t="afterexit");var r=function(){Qe.removeListener(t,i),Qe.listeners("exit").length===0&&Qe.listeners("afterexit").length===0&&pa()};return Qe.on(t,i),r},pa=function(){!Zr||!ur(global.process)||(Zr=!1,Jr.forEach(function(e){try{Me.removeListener(e,da[e])}catch{}}),Me.emit=ma,Me.reallyExit=xf,Qe.count-=1)},Qr.exports.unload=pa,fr=function(e,t,r){Qe.emitted[e]||(Qe.emitted[e]=!0,Qe.emit(e,t,r))},da={},Jr.forEach(function(i){da[i]=function(){if(ur(global.process)){var t=Me.listeners(i);t.length===Qe.count&&(pa(),fr("exit",null,i),fr("afterexit",null,i),ib&&i==="SIGHUP"&&(i="SIGINT"),Me.kill(Me.pid,i))}}}),Qr.exports.signals=function(){return Jr},Zr=!1,wf=function(){Zr||!ur(global.process)||(Zr=!0,Qe.count+=1,Jr=Jr.filter(function(e){try{return Me.on(e,da[e]),!0}catch{return!1}}),Me.emit=nb,Me.reallyExit=rb)},Qr.exports.load=wf,xf=Me.reallyExit,rb=function(e){ur(global.process)&&(Me.exitCode=e||0,fr("exit",Me.exitCode,null),fr("afterexit",Me.exitCode,null),xf.call(Me,Me.exitCode))},ma=Me.emit,nb=function(e,t){if(e==="exit"&&ur(global.process)){t!==void 0&&(Me.exitCode=t);var r=ma.apply(this,arguments);return fr("exit",Me.exitCode,null),fr("afterexit",Me.exitCode,null),r}else return ma.apply(this,arguments)}):Qr.exports=function(){return function(){}};var tb,Jr,ib,Xn,Qe,pa,fr,da,Zr,wf,xf,rb,ma,nb});var pb=_((XL,hb)=>{"use strict";var WA=require("path"),cb=Ky(),YA=Xy(),KA=sb(),Li={},ob=Symbol();function zA(i,e,t){let r=e[ob];if(r)return e.stat(i,(s,o)=>{if(s)return t(s);t(null,o.mtime,r)});let n=new Date(Math.ceil(Date.now()/1e3)*1e3+5);e.utimes(i,n,n,s=>{if(s)return t(s);e.stat(i,(o,a)=>{if(o)return t(o);let l=a.mtime.getTime()%1e3===0?"s":"ms";Object.defineProperty(e,ob,{value:l}),t(null,a.mtime,l)})})}function JA(i){let e=Date.now();return i==="s"&&(e=Math.ceil(e/1e3)*1e3),new Date(e)}function va(i,e){return e.lockfilePath||`${i}.lock`}function ub(i,e,t){if(!e.realpath)return t(null,WA.resolve(i));e.fs.realpath(i,t)}function Ef(i,e,t){let r=va(i,e);e.fs.mkdir(r,n=>{if(!n)return zA(r,e.fs,(s,o,a)=>{if(s)return e.fs.rmdir(r,()=>{}),t(s);t(null,o,a)});if(n.code!=="EEXIST")return t(n);if(e.stale<=0)return t(Object.assign(new Error("Lock file is already being held"),{code:"ELOCKED",file:i}));e.fs.stat(r,(s,o)=>{if(s)return s.code==="ENOENT"?Ef(i,{...e,stale:0},t):t(s);if(!ZA(o,e))return t(Object.assign(new Error("Lock file is already being held"),{code:"ELOCKED",file:i}));fb(i,e,a=>{if(a)return t(a);Ef(i,{...e,stale:0},t)})})})}function ZA(i,e){return i.mtime.getTime(){if(r&&r.code!=="ENOENT")return t(r);t()})}function ga(i,e){let t=Li[i];t.updateTimeout||(t.updateDelay=t.updateDelay||e.update,t.updateTimeout=setTimeout(()=>{t.updateTimeout=null,e.fs.stat(t.lockfilePath,(r,n)=>{let s=t.lastUpdate+e.stale{let c=t.lastUpdate+e.stale{throw r},...e},e.retries=e.retries||0,e.retries=typeof e.retries=="number"?{retries:e.retries}:e.retries,e.stale=Math.max(e.stale||0,2e3),e.update=e.update==null?e.stale/2:e.update||0,e.update=Math.max(Math.min(e.update,e.stale/2),1e3),ub(i,e,(r,n)=>{if(r)return t(r);let s=YA.operation(e.retries);s.attempt(()=>{Ef(n,e,(o,a,l)=>{if(s.retry(o))return;if(o)return t(s.mainError());let c=Li[n]={lockfilePath:va(n,e),mtime:a,mtimePrecision:l,options:e,lastUpdate:Date.now()};ga(n,e),t(null,u=>{if(c.released)return u&&u(Object.assign(new Error("Lock is already released"),{code:"ERELEASED"}));XA(n,{...e,realpath:!1},u)})})})})}function XA(i,e,t){e={fs:cb,realpath:!0,...e},ub(i,e,(r,n)=>{if(r)return t(r);let s=Li[n];if(!s)return t(Object.assign(new Error("Lock is not acquired/owned by you"),{code:"ENOTACQUIRED"}));s.updateTimeout&&clearTimeout(s.updateTimeout),s.released=!0,delete Li[n],fb(n,e,t)})}function ab(i){return(...e)=>new Promise((t,r)=>{e.push((n,s)=>{n?r(n):t(s)}),i(...e)})}var lb=!1;function eI(){lb||(lb=!0,KA(()=>{for(let i in Li){let e=Li[i].options;try{e.fs.rmdirSync(va(i,e))}catch{}}}))}hb.exports.lock=async(i,e)=>{eI();let t=await ab(QA)(i,e);return ab(t)}});var vI={};Tf(vI,{HttpsProxyAgent:()=>Eb.HttpsProxyAgent,PNG:()=>Ob.PNG,SocksProxyAgent:()=>kb.SocksProxyAgent,colors:()=>tI,debug:()=>iI,diff:()=>rI,dotenv:()=>nI,getProxyForUrl:()=>Sb.getProxyForUrl,jpegjs:()=>sI,lockfile:()=>aI,mime:()=>lI,minimatch:()=>cI,open:()=>uI,program:()=>sm,progress:()=>fI,ws:()=>pI,wsReceiver:()=>mI,wsSender:()=>gI,wsServer:()=>dI,yaml:()=>hI});module.exports=Yb(vI);var db=$e(rh()),mb=$e(br());var Pa={};Tf(Pa,{Diff:()=>Tt,applyPatch:()=>Mh,applyPatches:()=>X_,canonicalize:()=>Es,convertChangesToDMP:()=>lw,convertChangesToXML:()=>cw,createPatch:()=>ew,createTwoFilesPatch:()=>Dh,diffArrays:()=>z_,diffChars:()=>N_,diffCss:()=>j_,diffJson:()=>K_,diffLines:()=>Aa,diffSentences:()=>q_,diffTrimmedLines:()=>F_,diffWords:()=>M_,diffWordsWithSpace:()=>Nh,formatPatch:()=>Cs,merge:()=>nw,parsePatch:()=>Ts,reversePatch:()=>Fh,structuredPatch:()=>ks});function Tt(){}Tt.prototype={diff:function(e,t){var r,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=n.callback;typeof n=="function"&&(s=n,n={});var o=this;function a(O){return O=o.postProcess(O,n),s?(setTimeout(function(){s(O)},0),!0):O}e=this.castInput(e,n),t=this.castInput(t,n),e=this.removeEmpty(this.tokenize(e,n)),t=this.removeEmpty(this.tokenize(t,n));var l=t.length,c=e.length,u=1,f=l+c;n.maxEditLength!=null&&(f=Math.min(f,n.maxEditLength));var d=(r=n.timeout)!==null&&r!==void 0?r:1/0,m=Date.now()+d,g=[{oldPos:-1,lastComponent:void 0}],y=this.extractCommon(g[0],t,e,0,n);if(g[0].oldPos+1>=c&&y+1>=l)return a(mh(o,g[0].lastComponent,t,e,o.useLongestToken));var b=-1/0,x=1/0;function E(){for(var O=Math.max(b,-u);O<=Math.min(x,u);O+=2){var S=void 0,R=g[O-1],T=g[O+1];R&&(g[O-1]=void 0);var A=!1;if(T){var C=T.oldPos-O;A=T&&0<=C&&C=c&&y+1>=l)return a(mh(o,S.lastComponent,t,e,o.useLongestToken));g[O]=S,S.oldPos+1>=c&&(x=Math.min(x,O-1)),y+1>=l&&(b=Math.max(b,O+1))}u++}if(s)(function O(){setTimeout(function(){if(u>f||Date.now()>m)return s();E()||O()},0)})();else for(;u<=f&&Date.now()<=m;){var k=E();if(k)return k}},addToPath:function(e,t,r,n,s){var o=e.lastComponent;return o&&!s.oneChangePerToken&&o.added===t&&o.removed===r?{oldPos:e.oldPos+n,lastComponent:{count:o.count+1,added:t,removed:r,previousComponent:o.previousComponent}}:{oldPos:e.oldPos+n,lastComponent:{count:1,added:t,removed:r,previousComponent:o}}},extractCommon:function(e,t,r,n,s){for(var o=t.length,a=r.length,l=e.oldPos,c=l-n,u=0;c+1m.length?y:m}),f.value=i.join(d)}else f.value=i.join(t.slice(c,c+f.count));c+=f.count,f.added||(u+=f.count)}}return s}var I_=new Tt;function N_(i,e,t){return I_.diff(i,e,t)}function gh(i,e){var t;for(t=0;te.length&&(t=i.length-e.length);var r=e.length;i.length0&&e[o]!=e[s];)s=n[s];e[o]==e[s]&&s++}s=0;for(var a=t;a0&&i[a]!=e[s];)s=n[s];i[a]==e[s]&&s++}return s}function B_(i){return i.includes(`\r
`)&&!i.startsWith(`
`)&&!i.match(/[^\r]\n/)}function R_(i){return!i.includes(`\r
`)&&i.includes(`
`)}var Ss="a-zA-Z0-9_\\u{C0}-\\u{FF}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}",P_=new RegExp("[".concat(Ss,"]+|\\s+|[^").concat(Ss,"]"),"ug"),tn=new Tt;tn.equals=function(i,e,t){return t.ignoreCase&&(i=i.toLowerCase(),e=e.toLowerCase()),i.trim()===e.trim()};tn.tokenize=function(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t;if(e.intlSegmenter){if(e.intlSegmenter.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');t=Array.from(e.intlSegmenter.segment(i),function(s){return s.segment})}else t=i.match(P_)||[];var r=[],n=null;return t.forEach(function(s){/\s/.test(s)?n==null?r.push(s):r.push(r.pop()+s):/\s/.test(n)?r[r.length-1]==n?r.push(r.pop()+s):r.push(n+s):r.push(s),n=s}),r};tn.join=function(i){return i.map(function(e,t){return t==0?e:e.replace(/^\s+/,"")}).join("")};tn.postProcess=function(i,e){if(!i||e.oneChangePerToken)return i;var t=null,r=null,n=null;return i.forEach(function(s){s.added?r=s:s.removed?n=s:((r||n)&&bh(t,n,r,s),t=s,r=null,n=null)}),(r||n)&&bh(t,n,r,null),i};function M_(i,e,t){return(t==null?void 0:t.ignoreWhitespace)!=null&&!t.ignoreWhitespace?Nh(i,e,t):tn.diff(i,e,t)}function bh(i,e,t,r){if(e&&t){var n=e.value.match(/^\s*/)[0],s=e.value.match(/\s*$/)[0],o=t.value.match(/^\s*/)[0],a=t.value.match(/\s*$/)[0];if(i){var l=gh(n,o);i.value=Ta(i.value,o,l),e.value=en(e.value,l),t.value=en(t.value,l)}if(r){var c=vh(s,a);r.value=Ca(r.value,a,c),e.value=ws(e.value,c),t.value=ws(t.value,c)}}else if(t)i&&(t.value=t.value.replace(/^\s*/,"")),r&&(r.value=r.value.replace(/^\s*/,""));else if(i&&r){var u=r.value.match(/^\s*/)[0],f=e.value.match(/^\s*/)[0],d=e.value.match(/\s*$/)[0],m=gh(u,f);e.value=en(e.value,m);var g=vh(en(u,m),d);e.value=ws(e.value,g),r.value=Ca(r.value,u,g),i.value=Ta(i.value,u,u.slice(0,u.length-g.length))}else if(r){var y=r.value.match(/^\s*/)[0],b=e.value.match(/\s*$/)[0],x=yh(b,y);e.value=ws(e.value,x)}else if(i){var E=i.value.match(/\s*$/)[0],k=e.value.match(/^\s*/)[0],O=yh(E,k);e.value=en(e.value,O)}}var Ih=new Tt;Ih.tokenize=function(i){var e=new RegExp("(\\r?\\n)|[".concat(Ss,"]+|[^\\S\\n\\r]+|[^").concat(Ss,"]"),"ug");return i.match(e)||[]};function Nh(i,e,t){return Ih.diff(i,e,t)}function D_(i,e){if(typeof i=="function")e.callback=i;else if(i)for(var t in i)i.hasOwnProperty(t)&&(e[t]=i[t]);return e}var rn=new Tt;rn.tokenize=function(i,e){e.stripTrailingCr&&(i=i.replace(/\r\n/g,`
`));var t=[],r=i.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(var n=0;ni.length)&&(e=i.length);for(var t=0,r=new Array(e);t2&&arguments[2]!==void 0?arguments[2]:{};if(typeof e=="string"&&(e=Ts(e)),Array.isArray(e)){if(e.length>1)throw new Error("applyPatch only works with a single input.");e=e[0]}(t.autoConvertLineEndings||t.autoConvertLineEndings==null)&&(B_(i)&&J_(e)?e=Rh(e):R_(i)&&Z_(e)&&(e=Ph(e)));var r=i.split(`
`),n=e.hunks,s=t.compareLine||function(P,U,F,H){return U===H},o=t.fuzzFactor||0,a=0;if(o<0||!Number.isInteger(o))throw new Error("fuzzFactor must be a non-negative integer");if(!n.length)return i;for(var l="",c=!1,u=!1,f=0;f3&&arguments[3]!==void 0?arguments[3]:0,j=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,V=arguments.length>5&&arguments[5]!==void 0?arguments[5]:[],Y=arguments.length>6&&arguments[6]!==void 0?arguments[6]:0,Q=0,W=!1;H0?de[0]:" ",ne=de.length>0?de.substr(1):de;if(ae==="-")if(s(U+1,r[U],ae,ne))U++,Q=0;else return!F||r[U]==null?null:(V[Y]=r[U],m(P,U+1,F-1,H,!1,V,Y+1));if(ae==="+"){if(!j)return null;V[Y]=ne,Y++,Q=0,W=!0}if(ae===" ")if(Q++,V[Y]=r[U],s(U+1,r[U],ae,ne))Y++,j=!0,W=!1,U++;else return W||!F?null:r[U]&&(m(P,U+1,F-1,H+1,!1,V,Y+1)||m(P,U+1,F-1,H,!1,V,Y+1))||m(P,U,F-1,H+1,!1,V,Y)}return Y-=Q,U-=Q,V.length=Y,{patchedLines:V,oldLineLastI:U-1}}for(var g=[],y=0,b=0;b0?f(U.lines.slice(-o.context)):[],m-=y.length,g-=y.length)}(P=y).push.apply(P,ii(L.map(function(Y){return(C.added?"+":"-")+Y}))),C.added?x+=L.length:b+=L.length}else{if(m)if(L.length<=o.context*2&&ki.length)return!1;for(var t=0;t"):r.removed&&e.push(""),e.push(uw(r.value)),r.added?e.push(""):r.removed&&e.push("")}return e.join("")}function uw(i){var e=i;return e=e.replace(/&/g,"&"),e=e.replace(//g,">"),e=e.replace(/"/g,"""),e}var gb=$e(Vh()),Sb=$e(Gh()),Eb=$e(ep()),vb=$e(ap()),yb=$e(mp()),bb=$e(Mp()),_b=$e(Jp()),Ob=$e(Gd());var nm=$e(rm(),1),{program:sm,createCommand:N2,createArgument:L2,createOption:B2,CommanderError:R2,InvalidArgumentError:P2,InvalidOptionArgumentError:M2,Command:D2,Argument:F2,Option:q2,Help:j2}=nm.default;var wb=$e(um()),kb=$e(Wm()),xb=$e(Rv());var RA=$e(Fv(),1),df=$e(rf(),1),mf=$e(sf(),1),My=$e(hf(),1),gf=$e(Py(),1);var Dy=My.default;var tI=db.default,iI=mb.default,rI=Pa,nI=gb.default,sI=vb.default,oI=pb(),aI=oI,lI=yb.default,cI=bb.default,uI=_b.default,fI=wb.default,hI=xb.default,pI=Dy,dI=gf.default,mI=df.default,gI=mf.default;0&&(module.exports={HttpsProxyAgent,PNG,SocksProxyAgent,colors,debug,diff,dotenv,getProxyForUrl,jpegjs,lockfile,mime,minimatch,open,program,progress,ws,wsReceiver,wsSender,wsServer,yaml});
/*! Bundled license information:
progress/lib/node-progress.js:
(*!
* node-progress
* Copyright(c) 2011 TJ Holowaychuk
* MIT Licensed
*)
*/