@wendongfly/myhi 1.0.32 → 1.0.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +12 -12
- package/dist/login.html +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -32,7 +32,7 @@ import{createRequire as __WEBPACK_EXTERNAL_createRequire}from"module";import*as
|
|
|
32
32
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|
33
33
|
* MIT Licensed
|
|
34
34
|
*/var b=c(4531),g=c(756),m=c(8024),u=c(2830)("body-parser:urlencoded"),f=c(95)("body-parser"),a=c(7946),t=c(7323);S.exports=n;var r=Object.create(null);function n(h){var v=h||{};v.extended===void 0&&f("undefined extended: provide extended option");var w=v.extended!==!1,E=v.inflate!==!1,A=typeof v.limit!="number"?b.parse(v.limit||"100kb"):v.limit,O=v.type||"application/x-www-form-urlencoded",C=v.verify||!1;if(C!==!1&&typeof C!="function")throw new TypeError("option verify must be function");var _=w?e(v):p(v),T=typeof O!="function"?l(O):O;function k(R){return R.length?_(R):{}}return function(I,L,P){if(I._body){u("body already parsed"),P();return}if(I.body=I.body||{},!t.hasBody(I)){u("skip empty body"),P();return}if(u("content-type %j",I.headers["content-type"]),!T(I)){u("skip parsing"),P();return}var B=o(I)||"utf-8";if(B!=="utf-8"){u("invalid charset"),P(m(415,'unsupported charset "'+B.toUpperCase()+'"',{charset:B,type:"charset.unsupported"}));return}a(I,L,P,k,u,{debug:u,encoding:B,inflate:E,limit:A,verify:C})}}function e(h){var v=h.parameterLimit!==void 0?h.parameterLimit:1e3,w=h.depth!==void 0?h.depth:32,E=i("qs");if(isNaN(v)||v<1)throw new TypeError("option parameterLimit must be a positive number");if(isNaN(w)||w<0)throw new TypeError("option depth must be a zero or a positive number");return isFinite(v)&&(v=v|0),function(O){var C=s(O,v);if(C===void 0)throw u("too many parameters"),m(413,"too many parameters",{type:"parameters.too.many"});var _=Math.max(100,C);u("parse extended urlencoding");try{return E(O,{allowPrototypes:!0,arrayLimit:_,depth:w,strictDepth:!0,parameterLimit:v})}catch(T){throw T instanceof RangeError?m(400,"The input exceeded the depth",{type:"querystring.parse.rangeError"}):T}}}function o(h){try{return(g.parse(h).parameters.charset||"").toLowerCase()}catch{return}}function s(h,v){for(var w=0,E=0;(E=h.indexOf("&",E))!==-1;)if(w++,E++,w===v)return;return w}function i(h){var v=r[h];if(v!==void 0)return v.parse;switch(h){case"qs":v=c(240);break;case"querystring":v=c(3480);break}return r[h]=v,v.parse}function p(h){var v=h.parameterLimit!==void 0?h.parameterLimit:1e3,w=i("querystring");if(isNaN(v)||v<1)throw new TypeError("option parameterLimit must be a positive number");return isFinite(v)&&(v=v|0),function(A){var O=s(A,v);if(O===void 0)throw u("too many parameters"),m(413,"too many parameters",{type:"parameters.too.many"});return u("parse urlencoding"),w(A,void 0,void 0,{maxKeys:v})}}function l(h){return function(w){return!!t(w,h)}}}),4718:(S=>{var d=Object.prototype.toString,c=typeof Buffer<"u"&&typeof Buffer.alloc=="function"&&typeof Buffer.allocUnsafe=="function"&&typeof Buffer.from=="function";function b(f){return d.call(f).slice(8,-1)==="ArrayBuffer"}function g(f,a,t){a>>>=0;var r=f.byteLength-a;if(r<0)throw new RangeError("'offset' is out of bounds");if(t===void 0)t=r;else if(t>>>=0,t>r)throw new RangeError("'length' is out of bounds");return c?Buffer.from(f.slice(a,a+t)):new Buffer(new Uint8Array(f.slice(a,a+t)))}function m(f,a){if((typeof a!="string"||a==="")&&(a="utf8"),!Buffer.isEncoding(a))throw new TypeError('"encoding" must be a valid string encoding');return c?Buffer.from(f,a):new Buffer(f,a)}function u(f,a,t){if(typeof f=="number")throw new TypeError('"value" argument must not be a number');return b(f)?g(f,a,t):typeof f=="string"?m(f,a):c?Buffer.from(f):new Buffer(f)}S.exports=u}),680:((S,d,c)=>{const{parseContentType:b}=c(5313);function g(u){const f=u.headers,a=b(f["content-type"]);if(!a)throw new Error("Malformed content type");for(const t of m){if(!t.detect(a))continue;const n={limits:u.limits,headers:f,conType:a,highWaterMark:void 0,fileHwm:void 0,defCharset:void 0,defParamCharset:void 0,preservePath:!1};return u.highWaterMark&&(n.highWaterMark=u.highWaterMark),u.fileHwm&&(n.fileHwm=u.fileHwm),n.defCharset=u.defCharset,n.defParamCharset=u.defParamCharset,n.preservePath=u.preservePath,new t(n)}throw new Error(`Unsupported content type: ${f["content-type"]}`)}const m=[c(894),c(6261)].filter(function(u){return typeof u.detect=="function"});S.exports=u=>{if((typeof u!="object"||u===null)&&(u={}),typeof u.headers!="object"||u.headers===null||typeof u.headers["content-type"]!="string")throw new Error("Missing Content-Type");return g(u)}}),894:((S,d,c)=>{const{Readable:b,Writable:g}=c(2203),m=c(9026),{basename:u,convertToUTF8:f,getDecoder:a,parseContentType:t,parseDisposition:r}=c(5313),n=Buffer.from(`\r
|
|
35
|
-
`),e=Buffer.from("\r"),o=Buffer.from("-");function s(){}const i=2e3,p=16*1024,l=0,h=1,v=2;class w{constructor(P){this.header=Object.create(null),this.pairCount=0,this.byteCount=0,this.state=l,this.name="",this.value="",this.crlf=0,this.cb=P}reset(){this.header=Object.create(null),this.pairCount=0,this.byteCount=0,this.state=l,this.name="",this.value="",this.crlf=0}push(P,B,M){let z=B;for(;B<M;)switch(this.state){case l:{let $=!1;for(;B<M;++B){if(this.byteCount===p)return-1;++this.byteCount;const K=P[B];if(R[K]!==1){if(K!==58||(this.name+=P.latin1Slice(z,B),this.name.length===0))return-1;++B,$=!0,this.state=h;break}}if(!$){this.name+=P.latin1Slice(z,B);break}}case h:{let $=!1;for(;B<M;++B){if(this.byteCount===p)return-1;++this.byteCount;const K=P[B];if(K!==32&&K!==9){z=B,$=!0,this.state=v;break}}if(!$)break}case v:switch(this.crlf){case 0:for(;B<M;++B){if(this.byteCount===p)return-1;++this.byteCount;const $=P[B];if(I[$]!==1){if($!==13)return-1;++this.crlf;break}}this.value+=P.latin1Slice(z,B++);break;case 1:if(this.byteCount===p||(++this.byteCount,P[B++]!==10))return-1;++this.crlf;break;case 2:{if(this.byteCount===p)return-1;++this.byteCount;const $=P[B];$===32||$===9?(z=B,this.crlf=0):(++this.pairCount<i&&(this.name=this.name.toLowerCase(),this.header[this.name]===void 0?this.header[this.name]=[this.value]:this.header[this.name].push(this.value)),$===13?(++this.crlf,++B):(z=B,this.crlf=0,this.state=l,this.name="",this.value=""));break}case 3:{if(this.byteCount===p||(++this.byteCount,P[B++]!==10))return-1;const $=this.header;return this.reset(),this.cb($),B}}break}return B}}class E extends b{constructor(P,B){super(P),this.truncated=!1,this._readcb=null,this.once("end",()=>{if(this._read(),--B._fileEndsLeft===0&&B._finalcb){const M=B._finalcb;B._finalcb=null,process.nextTick(M)}})}_read(P){const B=this._readcb;B&&(this._readcb=null,B())}}const A={push:(L,P)=>{},destroy:()=>{}};function O(L,P){const B=L._writecb;L._writecb=null,P?L.destroy(P):B&&B()}function C(L,P){return L}class _ extends g{constructor(P){const B={autoDestroy:!0,emitClose:!0,highWaterMark:typeof P.highWaterMark=="number"?P.highWaterMark:void 0};if(super(B),!P.conType.params||typeof P.conType.params.boundary!="string")throw new Error("Multipart: Boundary not found");const M=P.conType.params.boundary,z=typeof P.defParamCharset=="string"&&P.defParamCharset?a(P.defParamCharset):C,$=P.defCharset||"utf8",K=P.preservePath,j={autoDestroy:!0,emitClose:!0,highWaterMark:typeof P.fileHwm=="number"?P.fileHwm:void 0},Z=P.limits,Y=Z&&typeof Z.fieldSize=="number"?Z.fieldSize:1*1024*1024,ne=Z&&typeof Z.fileSize=="number"?Z.fileSize:1/0,le=Z&&typeof Z.files=="number"?Z.files:1/0,re=Z&&typeof Z.fields=="number"?Z.fields:1/0,ce=Z&&typeof Z.parts=="number"?Z.parts:1/0;let ee=-1,G=0,U=0,N=!1;this._fileEndsLeft=0,this._fileStream=void 0,this._complete=!1;let W=0,Q,te=0,F,D,
|
|
35
|
+
`),e=Buffer.from("\r"),o=Buffer.from("-");function s(){}const i=2e3,p=16*1024,l=0,h=1,v=2;class w{constructor(P){this.header=Object.create(null),this.pairCount=0,this.byteCount=0,this.state=l,this.name="",this.value="",this.crlf=0,this.cb=P}reset(){this.header=Object.create(null),this.pairCount=0,this.byteCount=0,this.state=l,this.name="",this.value="",this.crlf=0}push(P,B,M){let z=B;for(;B<M;)switch(this.state){case l:{let $=!1;for(;B<M;++B){if(this.byteCount===p)return-1;++this.byteCount;const K=P[B];if(R[K]!==1){if(K!==58||(this.name+=P.latin1Slice(z,B),this.name.length===0))return-1;++B,$=!0,this.state=h;break}}if(!$){this.name+=P.latin1Slice(z,B);break}}case h:{let $=!1;for(;B<M;++B){if(this.byteCount===p)return-1;++this.byteCount;const K=P[B];if(K!==32&&K!==9){z=B,$=!0,this.state=v;break}}if(!$)break}case v:switch(this.crlf){case 0:for(;B<M;++B){if(this.byteCount===p)return-1;++this.byteCount;const $=P[B];if(I[$]!==1){if($!==13)return-1;++this.crlf;break}}this.value+=P.latin1Slice(z,B++);break;case 1:if(this.byteCount===p||(++this.byteCount,P[B++]!==10))return-1;++this.crlf;break;case 2:{if(this.byteCount===p)return-1;++this.byteCount;const $=P[B];$===32||$===9?(z=B,this.crlf=0):(++this.pairCount<i&&(this.name=this.name.toLowerCase(),this.header[this.name]===void 0?this.header[this.name]=[this.value]:this.header[this.name].push(this.value)),$===13?(++this.crlf,++B):(z=B,this.crlf=0,this.state=l,this.name="",this.value=""));break}case 3:{if(this.byteCount===p||(++this.byteCount,P[B++]!==10))return-1;const $=this.header;return this.reset(),this.cb($),B}}break}return B}}class E extends b{constructor(P,B){super(P),this.truncated=!1,this._readcb=null,this.once("end",()=>{if(this._read(),--B._fileEndsLeft===0&&B._finalcb){const M=B._finalcb;B._finalcb=null,process.nextTick(M)}})}_read(P){const B=this._readcb;B&&(this._readcb=null,B())}}const A={push:(L,P)=>{},destroy:()=>{}};function O(L,P){const B=L._writecb;L._writecb=null,P?L.destroy(P):B&&B()}function C(L,P){return L}class _ extends g{constructor(P){const B={autoDestroy:!0,emitClose:!0,highWaterMark:typeof P.highWaterMark=="number"?P.highWaterMark:void 0};if(super(B),!P.conType.params||typeof P.conType.params.boundary!="string")throw new Error("Multipart: Boundary not found");const M=P.conType.params.boundary,z=typeof P.defParamCharset=="string"&&P.defParamCharset?a(P.defParamCharset):C,$=P.defCharset||"utf8",K=P.preservePath,j={autoDestroy:!0,emitClose:!0,highWaterMark:typeof P.fileHwm=="number"?P.fileHwm:void 0},Z=P.limits,Y=Z&&typeof Z.fieldSize=="number"?Z.fieldSize:1*1024*1024,ne=Z&&typeof Z.fileSize=="number"?Z.fileSize:1/0,le=Z&&typeof Z.files=="number"?Z.files:1/0,re=Z&&typeof Z.fields=="number"?Z.fields:1/0,ce=Z&&typeof Z.parts=="number"?Z.parts:1/0;let ee=-1,G=0,U=0,N=!1;this._fileEndsLeft=0,this._fileStream=void 0,this._complete=!1;let W=0,Q,te=0,F,D,X,ie,ue=!1,H=!1,V=!1;this._hparser=null;const ae=new w(fe=>{this._hparser=null,N=!1,X="text/plain",F=$,D="7bit",ie=void 0,ue=!1;let he;if(!fe["content-disposition"]){N=!0;return}const pe=r(fe["content-disposition"][0],z);if(!pe||pe.type!=="form-data"){N=!0;return}if(pe.params&&(pe.params.name&&(ie=pe.params.name),pe.params["filename*"]?he=pe.params["filename*"]:pe.params.filename&&(he=pe.params.filename),he!==void 0&&!K&&(he=u(he))),fe["content-type"]){const ye=t(fe["content-type"][0]);ye&&(X=`${ye.type}/${ye.subtype}`,ye.params&&typeof ye.params.charset=="string"&&(F=ye.params.charset.toLowerCase()))}if(fe["content-transfer-encoding"]&&(D=fe["content-transfer-encoding"][0].toLowerCase()),X==="application/octet-stream"||he!==void 0){if(U===le){H||(H=!0,this.emit("filesLimit")),N=!0;return}if(++U,this.listenerCount("file")===0){N=!0;return}W=0,this._fileStream=new E(j,this),++this._fileEndsLeft,this.emit("file",ie,this._fileStream,{filename:he,encoding:D,mimeType:X})}else{if(G===re){V||(V=!0,this.emit("fieldsLimit")),N=!0;return}if(++G,this.listenerCount("field")===0){N=!0;return}Q=[],te=0}});let se=0;const oe=(fe,he,pe,ye,Ae)=>{e:for(;he;){if(this._hparser!==null){const ge=this._hparser.push(he,pe,ye);if(ge===-1){this._hparser=null,ae.reset(),this.emit("error",new Error("Malformed part header"));break}pe=ge}if(pe===ye)break;if(se!==0){if(se===1){switch(he[pe]){case 45:se=2,++pe;break;case 13:se=3,++pe;break;default:se=0}if(pe===ye)return}if(se===2){if(se=0,he[pe]===45){this._complete=!0,this._bparser=A;return}const ge=this._writecb;this._writecb=s,oe(!1,o,0,1,!1),this._writecb=ge}else if(se===3)if(se=0,he[pe]===10){if(++pe,ee>=ce||(this._hparser=ae,pe===ye))break;continue e}else{const ge=this._writecb;this._writecb=s,oe(!1,e,0,1,!1),this._writecb=ge}}if(!N){if(this._fileStream){let ge;const Ee=Math.min(ye-pe,ne-W);Ae?ge=he.slice(pe,pe+Ee):(ge=Buffer.allocUnsafe(Ee),he.copy(ge,0,pe,pe+Ee)),W+=ge.length,W===ne?(ge.length>0&&this._fileStream.push(ge),this._fileStream.emit("limit"),this._fileStream.truncated=!0,N=!0):this._fileStream.push(ge)||(this._writecb&&(this._fileStream._readcb=this._writecb),this._writecb=null)}else if(Q!==void 0){let ge;const Ee=Math.min(ye-pe,Y-te);Ae?ge=he.slice(pe,pe+Ee):(ge=Buffer.allocUnsafe(Ee),he.copy(ge,0,pe,pe+Ee)),te+=Ee,Q.push(ge),te===Y&&(N=!0,ue=!0)}}break}if(fe){if(se=1,this._fileStream)this._fileStream.push(null),this._fileStream=null;else if(Q!==void 0){let ge;switch(Q.length){case 0:ge="";break;case 1:ge=f(Q[0],F,0);break;default:ge=f(Buffer.concat(Q,te),F,0)}Q=void 0,te=0,this.emit("field",ie,ge,{nameTruncated:!1,valueTruncated:ue,encoding:D,mimeType:X})}++ee===ce&&this.emit("partsLimit")}};this._bparser=new m(`\r
|
|
36
36
|
--${M}`,oe),this._writecb=null,this._finalcb=null,this.write(n)}static detect(P){return P.type==="multipart"&&P.subtype==="form-data"}_write(P,B,M){this._writecb=M,this._bparser.push(P,0),this._writecb&&O(this)}_destroy(P,B){this._hparser=null,this._bparser=A,P||(P=k(this));const M=this._fileStream;M&&(this._fileStream=null,M.destroy(P)),B(P)}_final(P){if(this._bparser.destroy(),!this._complete)return P(new Error("Unexpected end of form"));this._fileEndsLeft?this._finalcb=T.bind(null,this,P):T(this,P)}}function T(L,P,B){if(B)return P(B);B=k(L),P(B)}function k(L){if(L._hparser)return new Error("Malformed part header");const P=L._fileStream;if(P&&(L._fileStream=null,P.destroy(new Error("Unexpected end of file"))),!L._complete)return new Error("Unexpected end of form")}const R=[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,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,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,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,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],I=[0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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,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,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,1,1,1,1,1,1,1,1,1,1,1,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,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,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,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,1,1,1,1,1,1,1,1,1,1,1,1];S.exports=_}),6261:((S,d,c)=>{const{Writable:b}=c(2203),{getDecoder:g}=c(5313);class m extends b{constructor(n){const e={autoDestroy:!0,emitClose:!0,highWaterMark:typeof n.highWaterMark=="number"?n.highWaterMark:void 0};super(e);let o=n.defCharset||"utf8";n.conType.params&&typeof n.conType.params.charset=="string"&&(o=n.conType.params.charset),this.charset=o;const s=n.limits;this.fieldSizeLimit=s&&typeof s.fieldSize=="number"?s.fieldSize:1*1024*1024,this.fieldsLimit=s&&typeof s.fields=="number"?s.fields:1/0,this.fieldNameSizeLimit=s&&typeof s.fieldNameSize=="number"?s.fieldNameSize:100,this._inKey=!0,this._keyTrunc=!1,this._valTrunc=!1,this._bytesKey=0,this._bytesVal=0,this._fields=0,this._key="",this._val="",this._byte=-2,this._lastPos=0,this._encode=0,this._decoder=g(o)}static detect(n){return n.type==="application"&&n.subtype==="x-www-form-urlencoded"}_write(n,e,o){if(this._fields>=this.fieldsLimit)return o();let s=0;const i=n.length;if(this._lastPos=0,this._byte!==-2){if(s=u(this,n,s,i),s===-1)return o(new Error("Malformed urlencoded form"));if(s>=i)return o();this._inKey?++this._bytesKey:++this._bytesVal}e:for(;s<i;)if(this._inKey){for(s=f(this,n,s,i);s<i;){switch(n[s]){case 61:this._lastPos<s&&(this._key+=n.latin1Slice(this._lastPos,s)),this._lastPos=++s,this._key=this._decoder(this._key,this._encode),this._encode=0,this._inKey=!1;continue e;case 38:if(this._lastPos<s&&(this._key+=n.latin1Slice(this._lastPos,s)),this._lastPos=++s,this._key=this._decoder(this._key,this._encode),this._encode=0,this._bytesKey>0&&this.emit("field",this._key,"",{nameTruncated:this._keyTrunc,valueTruncated:!1,encoding:this.charset,mimeType:"text/plain"}),this._key="",this._val="",this._keyTrunc=!1,this._valTrunc=!1,this._bytesKey=0,this._bytesVal=0,++this._fields>=this.fieldsLimit)return this.emit("fieldsLimit"),o();continue;case 43:this._lastPos<s&&(this._key+=n.latin1Slice(this._lastPos,s)),this._key+=" ",this._lastPos=s+1;break;case 37:if(this._encode===0&&(this._encode=1),this._lastPos<s&&(this._key+=n.latin1Slice(this._lastPos,s)),this._lastPos=s+1,this._byte=-1,s=u(this,n,s+1,i),s===-1)return o(new Error("Malformed urlencoded form"));if(s>=i)return o();++this._bytesKey,s=f(this,n,s,i);continue}++s,++this._bytesKey,s=f(this,n,s,i)}this._lastPos<s&&(this._key+=n.latin1Slice(this._lastPos,s))}else{for(s=a(this,n,s,i);s<i;){switch(n[s]){case 38:if(this._lastPos<s&&(this._val+=n.latin1Slice(this._lastPos,s)),this._lastPos=++s,this._inKey=!0,this._val=this._decoder(this._val,this._encode),this._encode=0,(this._bytesKey>0||this._bytesVal>0)&&this.emit("field",this._key,this._val,{nameTruncated:this._keyTrunc,valueTruncated:this._valTrunc,encoding:this.charset,mimeType:"text/plain"}),this._key="",this._val="",this._keyTrunc=!1,this._valTrunc=!1,this._bytesKey=0,this._bytesVal=0,++this._fields>=this.fieldsLimit)return this.emit("fieldsLimit"),o();continue e;case 43:this._lastPos<s&&(this._val+=n.latin1Slice(this._lastPos,s)),this._val+=" ",this._lastPos=s+1;break;case 37:if(this._encode===0&&(this._encode=1),this._lastPos<s&&(this._val+=n.latin1Slice(this._lastPos,s)),this._lastPos=s+1,this._byte=-1,s=u(this,n,s+1,i),s===-1)return o(new Error("Malformed urlencoded form"));if(s>=i)return o();++this._bytesVal,s=a(this,n,s,i);continue}++s,++this._bytesVal,s=a(this,n,s,i)}this._lastPos<s&&(this._val+=n.latin1Slice(this._lastPos,s))}o()}_final(n){if(this._byte!==-2)return n(new Error("Malformed urlencoded form"));(!this._inKey||this._bytesKey>0||this._bytesVal>0)&&(this._inKey?this._key=this._decoder(this._key,this._encode):this._val=this._decoder(this._val,this._encode),this.emit("field",this._key,this._val,{nameTruncated:this._keyTrunc,valueTruncated:this._valTrunc,encoding:this.charset,mimeType:"text/plain"})),n()}}function u(r,n,e,o){if(e>=o)return o;if(r._byte===-1){const s=t[n[e++]];if(s===-1)return-1;if(s>=8&&(r._encode=2),e<o){const i=t[n[e++]];if(i===-1)return-1;r._inKey?r._key+=String.fromCharCode((s<<4)+i):r._val+=String.fromCharCode((s<<4)+i),r._byte=-2,r._lastPos=e}else r._byte=s}else{const s=t[n[e++]];if(s===-1)return-1;r._inKey?r._key+=String.fromCharCode((r._byte<<4)+s):r._val+=String.fromCharCode((r._byte<<4)+s),r._byte=-2,r._lastPos=e}return e}function f(r,n,e,o){if(r._bytesKey>r.fieldNameSizeLimit){for(r._keyTrunc||r._lastPos<e&&(r._key+=n.latin1Slice(r._lastPos,e-1)),r._keyTrunc=!0;e<o;++e){const s=n[e];if(s===61||s===38)break;++r._bytesKey}r._lastPos=e}return e}function a(r,n,e,o){if(r._bytesVal>r.fieldSizeLimit){for(r._valTrunc||r._lastPos<e&&(r._val+=n.latin1Slice(r._lastPos,e-1)),r._valTrunc=!0;e<o&&n[e]!==38;++e)++r._bytesVal;r._lastPos=e}return e}const t=[-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,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,-1,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,-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,10,11,12,13,14,15,-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,-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,-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,-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,-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,-1,-1,-1,-1,-1,-1,-1,-1];S.exports=m}),5313:(function(S){function d(s){if(s.length===0)return;const i=Object.create(null);let p=0;for(;p<s.length;++p){const w=s.charCodeAt(p);if(t[w]!==1){if(w!==47||p===0)return;break}}if(p===s.length)return;const l=s.slice(0,p).toLowerCase(),h=++p;for(;p<s.length;++p){const w=s.charCodeAt(p);if(t[w]!==1){if(p===h||c(s,p,i)===void 0)return;break}}if(p===h)return;const v=s.slice(h,p).toLowerCase();return{type:l,subtype:v,params:i}}function c(s,i,p){for(;i<s.length;){for(;i<s.length;++i){const E=s.charCodeAt(i);if(E!==32&&E!==9)break}if(i===s.length)break;if(s.charCodeAt(i++)!==59)return;for(;i<s.length;++i){const E=s.charCodeAt(i);if(E!==32&&E!==9)break}if(i===s.length)return;let l;const h=i;for(;i<s.length;++i){const E=s.charCodeAt(i);if(t[E]!==1){if(E!==61)return;break}}if(i===s.length||(l=s.slice(h,i),++i,i===s.length))return;let v="",w;if(s.charCodeAt(i)===34){w=++i;let E=!1;for(;i<s.length;++i){const A=s.charCodeAt(i);if(A===92){E?(w=i,E=!1):(v+=s.slice(w,i),E=!0);continue}if(A===34){if(E){w=i,E=!1;continue}v+=s.slice(w,i);break}if(E&&(w=i-1,E=!1),r[A]!==1)return}if(i===s.length)return;++i}else{for(w=i;i<s.length;++i){const E=s.charCodeAt(i);if(t[E]!==1){if(i===w)return;break}}v=s.slice(w,i)}l=l.toLowerCase(),p[l]===void 0&&(p[l]=v)}return p}function b(s,i){if(s.length===0)return;const p=Object.create(null);let l=0;for(;l<s.length;++l){const v=s.charCodeAt(l);if(t[v]!==1){if(g(s,l,p,i)===void 0)return;break}}return{type:s.slice(0,l).toLowerCase(),params:p}}function g(s,i,p,l){for(;i<s.length;){for(;i<s.length;++i){const O=s.charCodeAt(i);if(O!==32&&O!==9)break}if(i===s.length)break;if(s.charCodeAt(i++)!==59)return;for(;i<s.length;++i){const O=s.charCodeAt(i);if(O!==32&&O!==9)break}if(i===s.length)return;let h;const v=i;for(;i<s.length;++i){const O=s.charCodeAt(i);if(t[O]!==1){if(O===61)break;return}}if(i===s.length)return;let w="",E,A;if(h=s.slice(v,i),h.charCodeAt(h.length-1)===42){const O=++i;for(;i<s.length;++i){const _=s.charCodeAt(i);if(n[_]!==1){if(_!==39)return;break}}if(i===s.length)return;for(A=s.slice(O,i),++i;i<s.length&&s.charCodeAt(i)!==39;++i);if(i===s.length||(++i,i===s.length))return;E=i;let C=0;for(;i<s.length;++i){const _=s.charCodeAt(i);if(e[_]!==1){if(_===37){let T,k;if(i+2<s.length&&(T=o[s.charCodeAt(i+1)])!==-1&&(k=o[s.charCodeAt(i+2)])!==-1){const R=(T<<4)+k;w+=s.slice(E,i),w+=String.fromCharCode(R),i+=2,E=i+1,R>=128?C=2:C===0&&(C=1);continue}return}break}}if(w+=s.slice(E,i),w=f(w,A,C),w===void 0)return}else{if(++i,i===s.length)return;if(s.charCodeAt(i)===34){E=++i;let O=!1;for(;i<s.length;++i){const C=s.charCodeAt(i);if(C===92){O?(E=i,O=!1):(w+=s.slice(E,i),O=!0);continue}if(C===34){if(O){E=i,O=!1;continue}w+=s.slice(E,i);break}if(O&&(E=i-1,O=!1),r[C]!==1)return}if(i===s.length)return;++i}else{for(E=i;i<s.length;++i){const O=s.charCodeAt(i);if(t[O]!==1){if(i===E)return;break}}w=s.slice(E,i)}if(w=l(w,2),w===void 0)return}h=h.toLowerCase(),p[h]===void 0&&(p[h]=w)}return p}function m(s){let i;for(;;)switch(s){case"utf-8":case"utf8":return u.utf8;case"latin1":case"ascii":case"us-ascii":case"iso-8859-1":case"iso8859-1":case"iso88591":case"iso_8859-1":case"windows-1252":case"iso_8859-1:1987":case"cp1252":case"x-cp1252":return u.latin1;case"utf16le":case"utf-16le":case"ucs2":case"ucs-2":return u.utf16le;case"base64":return u.base64;default:if(i===void 0){i=!0,s=s.toLowerCase();continue}return u.other.bind(s)}}const u={utf8:(s,i)=>{if(s.length===0)return"";if(typeof s=="string"){if(i<2)return s;s=Buffer.from(s,"latin1")}return s.utf8Slice(0,s.length)},latin1:(s,i)=>s.length===0?"":typeof s=="string"?s:s.latin1Slice(0,s.length),utf16le:(s,i)=>s.length===0?"":(typeof s=="string"&&(s=Buffer.from(s,"latin1")),s.ucs2Slice(0,s.length)),base64:(s,i)=>s.length===0?"":(typeof s=="string"&&(s=Buffer.from(s,"latin1")),s.base64Slice(0,s.length)),other:(s,i)=>{if(s.length===0)return"";typeof s=="string"&&(s=Buffer.from(s,"latin1"));try{return new TextDecoder(this).decode(s)}catch{}}};function f(s,i,p){const l=m(i);if(l)return l(s,p)}function a(s){if(typeof s!="string")return"";for(let i=s.length-1;i>=0;--i)switch(s.charCodeAt(i)){case 47:case 92:return s=s.slice(i+1),s===".."||s==="."?"":s}return s===".."||s==="."?"":s}const t=[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,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,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,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,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],r=[0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,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,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,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,1,1,1,1,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,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,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,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,1,1,1,1,1,1,1,1,1,1,1,1],n=[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,0,0,0,0,1,0,1,0,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,1,0,1,1,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,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,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,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],e=[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,0,1,0,0,0,0,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,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,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,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,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],o=[-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,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,-1,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,-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,10,11,12,13,14,15,-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,-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,-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,-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,-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,-1,-1,-1,-1,-1,-1,-1,-1];S.exports={basename:a,convertToUTF8:f,getDecoder:m,parseContentType:d,parseDisposition:b}}),4531:(S=>{/*!
|
|
37
37
|
* bytes
|
|
38
38
|
* Copyright(c) 2012-2014 TJ Holowaychuk
|
|
@@ -187,7 +187,7 @@ Please see the 3.x to 4.x migration guide for details on how to update your app.
|
|
|
187
187
|
* Copyright(c) 2012 TJ Holowaychuk
|
|
188
188
|
* Copyright(c) 2016-2017 Douglas Christopher Wilson
|
|
189
189
|
* MIT Licensed
|
|
190
|
-
*/var d=/(?:^|,)\s*?no-cache\s*?(?:,|$)/;S.exports=c;function c(m,u){var f=m["if-modified-since"],a=m["if-none-match"];if(!f&&!a)return!1;var t=m["cache-control"];if(t&&d.test(t))return!1;if(a&&a!=="*"){var r=u.etag;if(!r)return!1;for(var n=!0,e=g(a),o=0;o<e.length;o++){var s=e[o];if(s===r||s==="W/"+r||"W/"+s===r){n=!1;break}}if(n)return!1}if(f){var i=u["last-modified"],p=!i||!(b(i)<=b(f));if(p)return!1}return!0}function b(m){var u=m&&Date.parse(m);return typeof u=="number"?u:NaN}function g(m){for(var u=0,f=[],a=0,t=0,r=m.length;t<r;t++)switch(m.charCodeAt(t)){case 32:a===u&&(a=u=t+1);break;case 44:f.push(m.substring(a,u)),a=u=t+1;break;default:u=t+1;break}return f.push(m.substring(a,u)),f}}),9808:(S=>{var d="Function.prototype.bind called on incompatible ",c=Object.prototype.toString,b=Math.max,g="[object Function]",m=function(t,r){for(var n=[],e=0;e<t.length;e+=1)n[e]=t[e];for(var o=0;o<r.length;o+=1)n[o+t.length]=r[o];return n},u=function(t,r){for(var n=[],e=r||0,o=0;e<t.length;e+=1,o+=1)n[o]=t[e];return n},f=function(a,t){for(var r="",n=0;n<a.length;n+=1)r+=a[n],n+1<a.length&&(r+=t);return r};S.exports=function(t){var r=this;if(typeof r!="function"||c.apply(r)!==g)throw new TypeError(d+r);for(var n=u(arguments,1),e,o=function(){if(this instanceof e){var h=r.apply(this,m(n,arguments));return Object(h)===h?h:this}return r.apply(t,m(n,arguments))},s=b(0,r.length-n.length),i=[],p=0;p<s;p++)i[p]="$"+p;if(e=Function("binder","return function ("+f(i,",")+"){ return binder.apply(this,arguments); }")(o),r.prototype){var l=function(){};l.prototype=r.prototype,e.prototype=new l,l.prototype=null}return e}}),7564:((S,d,c)=>{var b=c(9808);S.exports=Function.prototype.bind||b}),470:((S,d,c)=>{var b,g=c(5399),m=c(1620),u=c(3056),f=c(4585),a=c(6905),t=c(105),r=c(3314),n=c(2578),e=c(5641),o=c(6171),s=c(7147),i=c(1017),p=c(6947),l=c(2621),h=c(156),v=Function,w=function(W){try{return v('"use strict"; return ('+W+").constructor;")()}catch{}},E=c(3170),A=c(9094),O=function(){throw new r},C=E?(function(){try{return arguments.callee,O}catch{try{return E(arguments,"callee").get}catch{return O}}})():O,_=c(3336)(),T=c(1967),k=c(1311),R=c(8681),I=c(3945),L=c(8093),P={},B=typeof Uint8Array>"u"||!T?b:T(Uint8Array),M={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?b:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?b:ArrayBuffer,"%ArrayIteratorPrototype%":_&&T?T([][Symbol.iterator]()):b,"%AsyncFromSyncIteratorPrototype%":b,"%AsyncFunction%":P,"%AsyncGenerator%":P,"%AsyncGeneratorFunction%":P,"%AsyncIteratorPrototype%":P,"%Atomics%":typeof Atomics>"u"?b:Atomics,"%BigInt%":typeof BigInt>"u"?b:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?b:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?b:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?b:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":m,"%eval%":eval,"%EvalError%":u,"%Float16Array%":typeof Float16Array>"u"?b:Float16Array,"%Float32Array%":typeof Float32Array>"u"?b:Float32Array,"%Float64Array%":typeof Float64Array>"u"?b:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?b:FinalizationRegistry,"%Function%":v,"%GeneratorFunction%":P,"%Int8Array%":typeof Int8Array>"u"?b:Int8Array,"%Int16Array%":typeof Int16Array>"u"?b:Int16Array,"%Int32Array%":typeof Int32Array>"u"?b:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":_&&T?T(T([][Symbol.iterator]())):b,"%JSON%":typeof JSON=="object"?JSON:b,"%Map%":typeof Map>"u"?b:Map,"%MapIteratorPrototype%":typeof Map>"u"||!_||!T?b:T(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":g,"%Object.getOwnPropertyDescriptor%":E,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?b:Promise,"%Proxy%":typeof Proxy>"u"?b:Proxy,"%RangeError%":f,"%ReferenceError%":a,"%Reflect%":typeof Reflect>"u"?b:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?b:Set,"%SetIteratorPrototype%":typeof Set>"u"||!_||!T?b:T(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?b:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":_&&T?T(""[Symbol.iterator]()):b,"%Symbol%":_?Symbol:b,"%SyntaxError%":t,"%ThrowTypeError%":C,"%TypedArray%":B,"%TypeError%":r,"%Uint8Array%":typeof Uint8Array>"u"?b:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?b:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?b:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?b:Uint32Array,"%URIError%":n,"%WeakMap%":typeof WeakMap>"u"?b:WeakMap,"%WeakRef%":typeof WeakRef>"u"?b:WeakRef,"%WeakSet%":typeof WeakSet>"u"?b:WeakSet,"%Function.prototype.call%":L,"%Function.prototype.apply%":I,"%Object.defineProperty%":A,"%Object.getPrototypeOf%":k,"%Math.abs%":e,"%Math.floor%":o,"%Math.max%":s,"%Math.min%":i,"%Math.pow%":p,"%Math.round%":l,"%Math.sign%":h,"%Reflect.getPrototypeOf%":R};if(T)try{null.error}catch(W){var z=T(T(W));M["%Error.prototype%"]=z}var $=function W(Q){var te;if(Q==="%AsyncFunction%")te=w("async function () {}");else if(Q==="%GeneratorFunction%")te=w("function* () {}");else if(Q==="%AsyncGeneratorFunction%")te=w("async function* () {}");else if(Q==="%AsyncGenerator%"){var F=W("%AsyncGeneratorFunction%");F&&(te=F.prototype)}else if(Q==="%AsyncIteratorPrototype%"){var D=W("%AsyncGenerator%");D&&T&&(te=T(D.prototype))}return M[Q]=te,te},K={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},j=c(7564),Z=c(4076),Y=j.call(L,Array.prototype.concat),ne=j.call(I,Array.prototype.splice),le=j.call(L,String.prototype.replace),re=j.call(L,String.prototype.slice),ce=j.call(L,RegExp.prototype.exec),ee=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,G=/\\(\\)?/g,U=function(Q){var te=re(Q,0,1),F=re(Q,-1);if(te==="%"&&F!=="%")throw new t("invalid intrinsic syntax, expected closing `%`");if(F==="%"&&te!=="%")throw new t("invalid intrinsic syntax, expected opening `%`");var D=[];return le(Q,ee,function(J,ie,ue,H){D[D.length]=ue?le(H,G,"$1"):ie||J}),D},N=function(Q,te){var F=Q,D;if(Z(K,F)&&(D=K[F],F="%"+D[0]+"%"),Z(M,F)){var J=M[F];if(J===P&&(J=$(F)),typeof J>"u"&&!te)throw new r("intrinsic "+Q+" exists, but is not available. Please file an issue!");return{alias:D,name:F,value:J}}throw new t("intrinsic "+Q+" does not exist!")};S.exports=function(Q,te){if(typeof Q!="string"||Q.length===0)throw new r("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof te!="boolean")throw new r('"allowMissing" argument must be a boolean');if(ce(/^%?[^%]*%?$/,Q)===null)throw new t("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var F=U(Q),D=F.length>0?F[0]:"",J=N("%"+D+"%",te),ie=J.name,ue=J.value,H=!1,V=J.alias;V&&(D=V[0],ne(F,Y([0,1],V)));for(var ae=1,se=!0;ae<F.length;ae+=1){var oe=F[ae],fe=re(oe,0,1),he=re(oe,-1);if((fe==='"'||fe==="'"||fe==="`"||he==='"'||he==="'"||he==="`")&&fe!==he)throw new t("property names with quotes must have matching quotes");if((oe==="constructor"||!se)&&(H=!0),D+="."+oe,ie="%"+D+"%",Z(M,ie))ue=M[ie];else if(ue!=null){if(!(oe in ue)){if(!te)throw new r("base intrinsic for "+Q+" exists, but the property is not available.");return}if(E&&ae+1>=F.length){var pe=E(ue,oe);se=!!pe,se&&"get"in pe&&!("originalValue"in pe.get)?ue=pe.get:ue=ue[oe]}else se=Z(ue,oe),ue=ue[oe];se&&!H&&(M[ie]=ue)}}return ue}}),1311:((S,d,c)=>{var b=c(5399);S.exports=b.getPrototypeOf||null}),8681:(S=>{S.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null}),1967:((S,d,c)=>{var b=c(8681),g=c(1311),m=c(6669);S.exports=b?function(f){return b(f)}:g?function(f){if(!f||typeof f!="object"&&typeof f!="function")throw new TypeError("getProto: not an object");return g(f)}:m?function(f){return m(f)}:null}),1174:(S=>{S.exports=Object.getOwnPropertyDescriptor}),3170:((S,d,c)=>{var b=c(1174);if(b)try{b([],"length")}catch{b=null}S.exports=b}),3336:((S,d,c)=>{var b=typeof Symbol<"u"&&Symbol,g=c(1114);S.exports=function(){return typeof b!="function"||typeof Symbol!="function"||typeof b("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:g()}}),1114:(S=>{S.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var c={},b=Symbol("test"),g=Object(b);if(typeof b=="string"||Object.prototype.toString.call(b)!=="[object Symbol]"||Object.prototype.toString.call(g)!=="[object Symbol]")return!1;var m=42;c[b]=m;for(var u in c)return!1;if(typeof Object.keys=="function"&&Object.keys(c).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(c).length!==0)return!1;var f=Object.getOwnPropertySymbols(c);if(f.length!==1||f[0]!==b||!Object.prototype.propertyIsEnumerable.call(c,b))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(c,b);if(a.value!==m||a.enumerable!==!0)return!1}return!0}}),4076:((S,d,c)=>{var b=Function.prototype.call,g=Object.prototype.hasOwnProperty,m=c(7564);S.exports=m.call(b,g)}),8024:((S,d,c)=>{/*!
|
|
190
|
+
*/var d=/(?:^|,)\s*?no-cache\s*?(?:,|$)/;S.exports=c;function c(m,u){var f=m["if-modified-since"],a=m["if-none-match"];if(!f&&!a)return!1;var t=m["cache-control"];if(t&&d.test(t))return!1;if(a&&a!=="*"){var r=u.etag;if(!r)return!1;for(var n=!0,e=g(a),o=0;o<e.length;o++){var s=e[o];if(s===r||s==="W/"+r||"W/"+s===r){n=!1;break}}if(n)return!1}if(f){var i=u["last-modified"],p=!i||!(b(i)<=b(f));if(p)return!1}return!0}function b(m){var u=m&&Date.parse(m);return typeof u=="number"?u:NaN}function g(m){for(var u=0,f=[],a=0,t=0,r=m.length;t<r;t++)switch(m.charCodeAt(t)){case 32:a===u&&(a=u=t+1);break;case 44:f.push(m.substring(a,u)),a=u=t+1;break;default:u=t+1;break}return f.push(m.substring(a,u)),f}}),9808:(S=>{var d="Function.prototype.bind called on incompatible ",c=Object.prototype.toString,b=Math.max,g="[object Function]",m=function(t,r){for(var n=[],e=0;e<t.length;e+=1)n[e]=t[e];for(var o=0;o<r.length;o+=1)n[o+t.length]=r[o];return n},u=function(t,r){for(var n=[],e=r||0,o=0;e<t.length;e+=1,o+=1)n[o]=t[e];return n},f=function(a,t){for(var r="",n=0;n<a.length;n+=1)r+=a[n],n+1<a.length&&(r+=t);return r};S.exports=function(t){var r=this;if(typeof r!="function"||c.apply(r)!==g)throw new TypeError(d+r);for(var n=u(arguments,1),e,o=function(){if(this instanceof e){var h=r.apply(this,m(n,arguments));return Object(h)===h?h:this}return r.apply(t,m(n,arguments))},s=b(0,r.length-n.length),i=[],p=0;p<s;p++)i[p]="$"+p;if(e=Function("binder","return function ("+f(i,",")+"){ return binder.apply(this,arguments); }")(o),r.prototype){var l=function(){};l.prototype=r.prototype,e.prototype=new l,l.prototype=null}return e}}),7564:((S,d,c)=>{var b=c(9808);S.exports=Function.prototype.bind||b}),470:((S,d,c)=>{var b,g=c(5399),m=c(1620),u=c(3056),f=c(4585),a=c(6905),t=c(105),r=c(3314),n=c(2578),e=c(5641),o=c(6171),s=c(7147),i=c(1017),p=c(6947),l=c(2621),h=c(156),v=Function,w=function(W){try{return v('"use strict"; return ('+W+").constructor;")()}catch{}},E=c(3170),A=c(9094),O=function(){throw new r},C=E?(function(){try{return arguments.callee,O}catch{try{return E(arguments,"callee").get}catch{return O}}})():O,_=c(3336)(),T=c(1967),k=c(1311),R=c(8681),I=c(3945),L=c(8093),P={},B=typeof Uint8Array>"u"||!T?b:T(Uint8Array),M={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?b:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?b:ArrayBuffer,"%ArrayIteratorPrototype%":_&&T?T([][Symbol.iterator]()):b,"%AsyncFromSyncIteratorPrototype%":b,"%AsyncFunction%":P,"%AsyncGenerator%":P,"%AsyncGeneratorFunction%":P,"%AsyncIteratorPrototype%":P,"%Atomics%":typeof Atomics>"u"?b:Atomics,"%BigInt%":typeof BigInt>"u"?b:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?b:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?b:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?b:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":m,"%eval%":eval,"%EvalError%":u,"%Float16Array%":typeof Float16Array>"u"?b:Float16Array,"%Float32Array%":typeof Float32Array>"u"?b:Float32Array,"%Float64Array%":typeof Float64Array>"u"?b:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?b:FinalizationRegistry,"%Function%":v,"%GeneratorFunction%":P,"%Int8Array%":typeof Int8Array>"u"?b:Int8Array,"%Int16Array%":typeof Int16Array>"u"?b:Int16Array,"%Int32Array%":typeof Int32Array>"u"?b:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":_&&T?T(T([][Symbol.iterator]())):b,"%JSON%":typeof JSON=="object"?JSON:b,"%Map%":typeof Map>"u"?b:Map,"%MapIteratorPrototype%":typeof Map>"u"||!_||!T?b:T(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":g,"%Object.getOwnPropertyDescriptor%":E,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?b:Promise,"%Proxy%":typeof Proxy>"u"?b:Proxy,"%RangeError%":f,"%ReferenceError%":a,"%Reflect%":typeof Reflect>"u"?b:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?b:Set,"%SetIteratorPrototype%":typeof Set>"u"||!_||!T?b:T(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?b:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":_&&T?T(""[Symbol.iterator]()):b,"%Symbol%":_?Symbol:b,"%SyntaxError%":t,"%ThrowTypeError%":C,"%TypedArray%":B,"%TypeError%":r,"%Uint8Array%":typeof Uint8Array>"u"?b:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?b:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?b:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?b:Uint32Array,"%URIError%":n,"%WeakMap%":typeof WeakMap>"u"?b:WeakMap,"%WeakRef%":typeof WeakRef>"u"?b:WeakRef,"%WeakSet%":typeof WeakSet>"u"?b:WeakSet,"%Function.prototype.call%":L,"%Function.prototype.apply%":I,"%Object.defineProperty%":A,"%Object.getPrototypeOf%":k,"%Math.abs%":e,"%Math.floor%":o,"%Math.max%":s,"%Math.min%":i,"%Math.pow%":p,"%Math.round%":l,"%Math.sign%":h,"%Reflect.getPrototypeOf%":R};if(T)try{null.error}catch(W){var z=T(T(W));M["%Error.prototype%"]=z}var $=function W(Q){var te;if(Q==="%AsyncFunction%")te=w("async function () {}");else if(Q==="%GeneratorFunction%")te=w("function* () {}");else if(Q==="%AsyncGeneratorFunction%")te=w("async function* () {}");else if(Q==="%AsyncGenerator%"){var F=W("%AsyncGeneratorFunction%");F&&(te=F.prototype)}else if(Q==="%AsyncIteratorPrototype%"){var D=W("%AsyncGenerator%");D&&T&&(te=T(D.prototype))}return M[Q]=te,te},K={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},j=c(7564),Z=c(4076),Y=j.call(L,Array.prototype.concat),ne=j.call(I,Array.prototype.splice),le=j.call(L,String.prototype.replace),re=j.call(L,String.prototype.slice),ce=j.call(L,RegExp.prototype.exec),ee=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,G=/\\(\\)?/g,U=function(Q){var te=re(Q,0,1),F=re(Q,-1);if(te==="%"&&F!=="%")throw new t("invalid intrinsic syntax, expected closing `%`");if(F==="%"&&te!=="%")throw new t("invalid intrinsic syntax, expected opening `%`");var D=[];return le(Q,ee,function(X,ie,ue,H){D[D.length]=ue?le(H,G,"$1"):ie||X}),D},N=function(Q,te){var F=Q,D;if(Z(K,F)&&(D=K[F],F="%"+D[0]+"%"),Z(M,F)){var X=M[F];if(X===P&&(X=$(F)),typeof X>"u"&&!te)throw new r("intrinsic "+Q+" exists, but is not available. Please file an issue!");return{alias:D,name:F,value:X}}throw new t("intrinsic "+Q+" does not exist!")};S.exports=function(Q,te){if(typeof Q!="string"||Q.length===0)throw new r("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof te!="boolean")throw new r('"allowMissing" argument must be a boolean');if(ce(/^%?[^%]*%?$/,Q)===null)throw new t("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var F=U(Q),D=F.length>0?F[0]:"",X=N("%"+D+"%",te),ie=X.name,ue=X.value,H=!1,V=X.alias;V&&(D=V[0],ne(F,Y([0,1],V)));for(var ae=1,se=!0;ae<F.length;ae+=1){var oe=F[ae],fe=re(oe,0,1),he=re(oe,-1);if((fe==='"'||fe==="'"||fe==="`"||he==='"'||he==="'"||he==="`")&&fe!==he)throw new t("property names with quotes must have matching quotes");if((oe==="constructor"||!se)&&(H=!0),D+="."+oe,ie="%"+D+"%",Z(M,ie))ue=M[ie];else if(ue!=null){if(!(oe in ue)){if(!te)throw new r("base intrinsic for "+Q+" exists, but the property is not available.");return}if(E&&ae+1>=F.length){var pe=E(ue,oe);se=!!pe,se&&"get"in pe&&!("originalValue"in pe.get)?ue=pe.get:ue=ue[oe]}else se=Z(ue,oe),ue=ue[oe];se&&!H&&(M[ie]=ue)}}return ue}}),1311:((S,d,c)=>{var b=c(5399);S.exports=b.getPrototypeOf||null}),8681:(S=>{S.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null}),1967:((S,d,c)=>{var b=c(8681),g=c(1311),m=c(6669);S.exports=b?function(f){return b(f)}:g?function(f){if(!f||typeof f!="object"&&typeof f!="function")throw new TypeError("getProto: not an object");return g(f)}:m?function(f){return m(f)}:null}),1174:(S=>{S.exports=Object.getOwnPropertyDescriptor}),3170:((S,d,c)=>{var b=c(1174);if(b)try{b([],"length")}catch{b=null}S.exports=b}),3336:((S,d,c)=>{var b=typeof Symbol<"u"&&Symbol,g=c(1114);S.exports=function(){return typeof b!="function"||typeof Symbol!="function"||typeof b("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:g()}}),1114:(S=>{S.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var c={},b=Symbol("test"),g=Object(b);if(typeof b=="string"||Object.prototype.toString.call(b)!=="[object Symbol]"||Object.prototype.toString.call(g)!=="[object Symbol]")return!1;var m=42;c[b]=m;for(var u in c)return!1;if(typeof Object.keys=="function"&&Object.keys(c).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(c).length!==0)return!1;var f=Object.getOwnPropertySymbols(c);if(f.length!==1||f[0]!==b||!Object.prototype.propertyIsEnumerable.call(c,b))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(c,b);if(a.value!==m||a.enumerable!==!0)return!1}return!0}}),4076:((S,d,c)=>{var b=Function.prototype.call,g=Object.prototype.hasOwnProperty,m=c(7564);S.exports=m.call(b,g)}),8024:((S,d,c)=>{/*!
|
|
191
191
|
* http-errors
|
|
192
192
|
* Copyright(c) 2014 Jonathan Ong
|
|
193
193
|
* Copyright(c) 2016 Douglas Christopher Wilson
|
|
@@ -231,10 +231,10 @@ Please see the 3.x to 4.x migration guide for details on how to update your app.
|
|
|
231
231
|
object-assign
|
|
232
232
|
(c) Sindre Sorhus
|
|
233
233
|
@license MIT
|
|
234
|
-
*/var d=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,b=Object.prototype.propertyIsEnumerable;function g(u){if(u==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(u)}function m(){try{if(!Object.assign)return!1;var u=new String("abc");if(u[5]="de",Object.getOwnPropertyNames(u)[0]==="5")return!1;for(var f={},a=0;a<10;a++)f["_"+String.fromCharCode(a)]=a;var t=Object.getOwnPropertyNames(f).map(function(n){return f[n]});if(t.join("")!=="0123456789")return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(n){r[n]=n}),Object.keys(Object.assign({},r)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}S.exports=m()?Object.assign:function(u,f){for(var a,t=g(u),r,n=1;n<arguments.length;n++){a=Object(arguments[n]);for(var e in a)c.call(a,e)&&(t[e]=a[e]);if(d){r=d(a);for(var o=0;o<r.length;o++)b.call(a,r[o])&&(t[r[o]]=a[r[o]])}}return t}}),506:((S,d,c)=>{var b=typeof Map=="function"&&Map.prototype,g=Object.getOwnPropertyDescriptor&&b?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,m=b&&g&&typeof g.get=="function"?g.get:null,u=b&&Map.prototype.forEach,f=typeof Set=="function"&&Set.prototype,a=Object.getOwnPropertyDescriptor&&f?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,t=f&&a&&typeof a.get=="function"?a.get:null,r=f&&Set.prototype.forEach,n=typeof WeakMap=="function"&&WeakMap.prototype,e=n?WeakMap.prototype.has:null,o=typeof WeakSet=="function"&&WeakSet.prototype,s=o?WeakSet.prototype.has:null,i=typeof WeakRef=="function"&&WeakRef.prototype,p=i?WeakRef.prototype.deref:null,l=Boolean.prototype.valueOf,h=Object.prototype.toString,v=Function.prototype.toString,w=String.prototype.match,E=String.prototype.slice,A=String.prototype.replace,O=String.prototype.toUpperCase,C=String.prototype.toLowerCase,_=RegExp.prototype.test,T=Array.prototype.concat,k=Array.prototype.join,R=Array.prototype.slice,I=Math.floor,L=typeof BigInt=="function"?BigInt.prototype.valueOf:null,P=Object.getOwnPropertySymbols,B=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,M=typeof Symbol=="function"&&typeof Symbol.iterator=="object",z=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===M||!0)?Symbol.toStringTag:null,$=Object.prototype.propertyIsEnumerable,K=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(
|
|
235
|
-
`)>=0)return!1;return!0}function Ce(
|
|
236
|
-
`+q.prev+q.base;return me+k.call(
|
|
237
|
-
`+q.prev}function Re(
|
|
234
|
+
*/var d=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,b=Object.prototype.propertyIsEnumerable;function g(u){if(u==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(u)}function m(){try{if(!Object.assign)return!1;var u=new String("abc");if(u[5]="de",Object.getOwnPropertyNames(u)[0]==="5")return!1;for(var f={},a=0;a<10;a++)f["_"+String.fromCharCode(a)]=a;var t=Object.getOwnPropertyNames(f).map(function(n){return f[n]});if(t.join("")!=="0123456789")return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(n){r[n]=n}),Object.keys(Object.assign({},r)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}S.exports=m()?Object.assign:function(u,f){for(var a,t=g(u),r,n=1;n<arguments.length;n++){a=Object(arguments[n]);for(var e in a)c.call(a,e)&&(t[e]=a[e]);if(d){r=d(a);for(var o=0;o<r.length;o++)b.call(a,r[o])&&(t[r[o]]=a[r[o]])}}return t}}),506:((S,d,c)=>{var b=typeof Map=="function"&&Map.prototype,g=Object.getOwnPropertyDescriptor&&b?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,m=b&&g&&typeof g.get=="function"?g.get:null,u=b&&Map.prototype.forEach,f=typeof Set=="function"&&Set.prototype,a=Object.getOwnPropertyDescriptor&&f?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,t=f&&a&&typeof a.get=="function"?a.get:null,r=f&&Set.prototype.forEach,n=typeof WeakMap=="function"&&WeakMap.prototype,e=n?WeakMap.prototype.has:null,o=typeof WeakSet=="function"&&WeakSet.prototype,s=o?WeakSet.prototype.has:null,i=typeof WeakRef=="function"&&WeakRef.prototype,p=i?WeakRef.prototype.deref:null,l=Boolean.prototype.valueOf,h=Object.prototype.toString,v=Function.prototype.toString,w=String.prototype.match,E=String.prototype.slice,A=String.prototype.replace,O=String.prototype.toUpperCase,C=String.prototype.toLowerCase,_=RegExp.prototype.test,T=Array.prototype.concat,k=Array.prototype.join,R=Array.prototype.slice,I=Math.floor,L=typeof BigInt=="function"?BigInt.prototype.valueOf:null,P=Object.getOwnPropertySymbols,B=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,M=typeof Symbol=="function"&&typeof Symbol.iterator=="object",z=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===M||!0)?Symbol.toStringTag:null,$=Object.prototype.propertyIsEnumerable,K=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(J){return J.__proto__}:null);function j(J,q){if(J===1/0||J===-1/0||J!==J||J&&J>-1e3&&J<1e3||_.call(/e/,q))return q;var me=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof J=="number"){var be=J<0?-I(-J):I(J);if(be!==J){var xe=String(be),de=E.call(q,xe.length+1);return A.call(xe,me,"$&_")+"."+A.call(A.call(de,/([0-9]{3})/g,"$&_"),/_$/,"")}}return A.call(q,me,"$&_")}var Z=c(8502),Y=Z.custom,ne=X(Y)?Y:null,le={__proto__:null,double:'"',single:"'"},re={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};S.exports=function J(q,me,be,xe){var de=me||{};if(H(de,"quoteStyle")&&!H(le,de.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(H(de,"maxStringLength")&&(typeof de.maxStringLength=="number"?de.maxStringLength<0&&de.maxStringLength!==1/0:de.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var Te=H(de,"customInspect")?de.customInspect:!0;if(typeof Te!="boolean"&&Te!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(H(de,"indent")&&de.indent!==null&&de.indent!==" "&&!(parseInt(de.indent,10)===de.indent&&de.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(H(de,"numericSeparator")&&typeof de.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var Ie=de.numericSeparator;if(typeof q>"u")return"undefined";if(q===null)return"null";if(typeof q=="boolean")return q?"true":"false";if(typeof q=="string")return ge(q,de);if(typeof q=="number"){if(q===0)return 1/0/q>0?"0":"-0";var _e=String(q);return Ie?j(q,_e):_e}if(typeof q=="bigint"){var Le=String(q)+"n";return Ie?j(q,Le):Le}var je=typeof de.depth>"u"?5:de.depth;if(typeof be>"u"&&(be=0),be>=je&&je>0&&typeof q=="object")return U(q)?"[Array]":"[Object]";var Be=Ce(de,be);if(typeof xe>"u")xe=[];else if(se(xe,q)>=0)return"[Circular]";function ke(Ne,De,tt){if(De&&(xe=R.call(xe),xe.push(De)),tt){var qe={depth:de.depth};return H(de,"quoteStyle")&&(qe.quoteStyle=de.quoteStyle),J(Ne,qe,be+1,xe)}return J(Ne,de,be+1,xe)}if(typeof q=="function"&&!W(q)){var Ve=ae(q),Ke=Re(q,ke);return"[Function"+(Ve?": "+Ve:" (anonymous)")+"]"+(Ke.length>0?" { "+k.call(Ke,", ")+" }":"")}if(X(q)){var Ye=M?A.call(String(q),/^(Symbol\(.*\))_[^)]*$/,"$1"):B.call(q);return typeof q=="object"&&!M?Se(Ye):Ye}if(Ae(q)){for(var Fe="<"+C.call(String(q.nodeName)),Ue=q.attributes||[],Me=0;Me<Ue.length;Me++)Fe+=" "+Ue[Me].name+"="+ce(ee(Ue[Me].value),"double",de);return Fe+=">",q.childNodes&&q.childNodes.length&&(Fe+="..."),Fe+="</"+C.call(String(q.nodeName))+">",Fe}if(U(q)){if(q.length===0)return"[]";var ze=Re(q,ke);return Be&&!ve(ze)?"["+Oe(ze,Be)+"]":"[ "+k.call(ze,", ")+" ]"}if(Q(q)){var He=Re(q,ke);return!("cause"in Error.prototype)&&"cause"in q&&!$.call(q,"cause")?"{ ["+String(q)+"] "+k.call(T.call("[cause]: "+ke(q.cause),He),", ")+" }":He.length===0?"["+String(q)+"]":"{ ["+String(q)+"] "+k.call(He,", ")+" }"}if(typeof q=="object"&&Te){if(ne&&typeof q[ne]=="function"&&Z)return Z(q,{depth:je-be});if(Te!=="symbol"&&typeof q.inspect=="function")return q.inspect()}if(oe(q)){var Xe=[];return u&&u.call(q,function(Ne,De){Xe.push(ke(De,q,!0)+" => "+ke(Ne,q))}),we("Map",m.call(q),Xe,Be)}if(pe(q)){var Je=[];return r&&r.call(q,function(Ne){Je.push(ke(Ne,q))}),we("Set",t.call(q),Je,Be)}if(fe(q))return Pe("WeakMap");if(ye(q))return Pe("WeakSet");if(he(q))return Pe("WeakRef");if(F(q))return Se(ke(Number(q)));if(ie(q))return Se(ke(L.call(q)));if(D(q))return Se(l.call(q));if(te(q))return Se(ke(String(q)));if(typeof window<"u"&&q===window)return"{ [object Window] }";if(typeof globalThis<"u"&&q===globalThis||typeof global<"u"&&q===global)return"{ [object globalThis] }";if(!N(q)&&!W(q)){var $e=Re(q,ke),Qe=K?K(q)===Object.prototype:q instanceof Object||q.constructor===Object,We=q instanceof Object?"":"null prototype",Ze=!Qe&&z&&Object(q)===q&&z in q?E.call(V(q),8,-1):We?"Object":"",et=Qe||typeof q.constructor!="function"?"":q.constructor.name?q.constructor.name+" ":"",Ge=et+(Ze||We?"["+k.call(T.call([],Ze||[],We||[]),": ")+"] ":"");return $e.length===0?Ge+"{}":Be?Ge+"{"+Oe($e,Be)+"}":Ge+"{ "+k.call($e,", ")+" }"}return String(q)};function ce(J,q,me){var be=me.quoteStyle||q,xe=le[be];return xe+J+xe}function ee(J){return A.call(String(J),/"/g,""")}function G(J){return!z||!(typeof J=="object"&&(z in J||typeof J[z]<"u"))}function U(J){return V(J)==="[object Array]"&&G(J)}function N(J){return V(J)==="[object Date]"&&G(J)}function W(J){return V(J)==="[object RegExp]"&&G(J)}function Q(J){return V(J)==="[object Error]"&&G(J)}function te(J){return V(J)==="[object String]"&&G(J)}function F(J){return V(J)==="[object Number]"&&G(J)}function D(J){return V(J)==="[object Boolean]"&&G(J)}function X(J){if(M)return J&&typeof J=="object"&&J instanceof Symbol;if(typeof J=="symbol")return!0;if(!J||typeof J!="object"||!B)return!1;try{return B.call(J),!0}catch{}return!1}function ie(J){if(!J||typeof J!="object"||!L)return!1;try{return L.call(J),!0}catch{}return!1}var ue=Object.prototype.hasOwnProperty||function(J){return J in this};function H(J,q){return ue.call(J,q)}function V(J){return h.call(J)}function ae(J){if(J.name)return J.name;var q=w.call(v.call(J),/^function\s*([\w$]+)/);return q?q[1]:null}function se(J,q){if(J.indexOf)return J.indexOf(q);for(var me=0,be=J.length;me<be;me++)if(J[me]===q)return me;return-1}function oe(J){if(!m||!J||typeof J!="object")return!1;try{m.call(J);try{t.call(J)}catch{return!0}return J instanceof Map}catch{}return!1}function fe(J){if(!e||!J||typeof J!="object")return!1;try{e.call(J,e);try{s.call(J,s)}catch{return!0}return J instanceof WeakMap}catch{}return!1}function he(J){if(!p||!J||typeof J!="object")return!1;try{return p.call(J),!0}catch{}return!1}function pe(J){if(!t||!J||typeof J!="object")return!1;try{t.call(J);try{m.call(J)}catch{return!0}return J instanceof Set}catch{}return!1}function ye(J){if(!s||!J||typeof J!="object")return!1;try{s.call(J,s);try{e.call(J,e)}catch{return!0}return J instanceof WeakSet}catch{}return!1}function Ae(J){return!J||typeof J!="object"?!1:typeof HTMLElement<"u"&&J instanceof HTMLElement?!0:typeof J.nodeName=="string"&&typeof J.getAttribute=="function"}function ge(J,q){if(J.length>q.maxStringLength){var me=J.length-q.maxStringLength,be="... "+me+" more character"+(me>1?"s":"");return ge(E.call(J,0,q.maxStringLength),q)+be}var xe=re[q.quoteStyle||"single"];xe.lastIndex=0;var de=A.call(A.call(J,xe,"\\$1"),/[\x00-\x1f]/g,Ee);return ce(de,"single",q)}function Ee(J){var q=J.charCodeAt(0),me={8:"b",9:"t",10:"n",12:"f",13:"r"}[q];return me?"\\"+me:"\\x"+(q<16?"0":"")+O.call(q.toString(16))}function Se(J){return"Object("+J+")"}function Pe(J){return J+" { ? }"}function we(J,q,me,be){var xe=be?Oe(me,be):k.call(me,", ");return J+" ("+q+") {"+xe+"}"}function ve(J){for(var q=0;q<J.length;q++)if(se(J[q],`
|
|
235
|
+
`)>=0)return!1;return!0}function Ce(J,q){var me;if(J.indent===" ")me=" ";else if(typeof J.indent=="number"&&J.indent>0)me=k.call(Array(J.indent+1)," ");else return null;return{base:me,prev:k.call(Array(q+1),me)}}function Oe(J,q){if(J.length===0)return"";var me=`
|
|
236
|
+
`+q.prev+q.base;return me+k.call(J,","+me)+`
|
|
237
|
+
`+q.prev}function Re(J,q){var me=U(J),be=[];if(me){be.length=J.length;for(var xe=0;xe<J.length;xe++)be[xe]=H(J,xe)?q(J[xe],J):""}var de=typeof P=="function"?P(J):[],Te;if(M){Te={};for(var Ie=0;Ie<de.length;Ie++)Te["$"+de[Ie]]=de[Ie]}for(var _e in J)H(J,_e)&&(me&&String(Number(_e))===_e&&_e<J.length||M&&Te["$"+_e]instanceof Symbol||(_.call(/[^\w$]/,_e)?be.push(q(_e,J)+": "+q(J[_e],J)):be.push(_e+": "+q(J[_e],J))));if(typeof P=="function")for(var Le=0;Le<de.length;Le++)$.call(J,de[Le])&&be.push("["+q(de[Le])+"]: "+q(J[de[Le]],J));return be}}),8502:((S,d,c)=>{S.exports=c(9023).inspect}),5698:((S,d,c)=>{/*!
|
|
238
238
|
* on-finished
|
|
239
239
|
* Copyright(c) 2013 Jonathan Ong
|
|
240
240
|
* Copyright(c) 2014 Douglas Christopher Wilson
|
|
@@ -265,7 +265,7 @@ Minimum version required to store current data is: `+L+`.
|
|
|
265
265
|
`}return t+=r+`
|
|
266
266
|
`,typeof g=="function"&&g(null,t),t}}),5565:((S,d,c)=>{const b=c(8441),g={WW:" ",WB:"\u2584",BB:"\u2588",BW:"\u2580"},m={BB:" ",BW:"\u2584",WW:"\u2588",WB:"\u2580"};function u(f,a,t){return f&&a?t.BB:f&&!a?t.BW:!f&&a?t.WB:t.WW}d.render=function(f,a,t){const r=b.getOptions(a);let n=g;(r.color.dark.hex==="#ffffff"||r.color.light.hex==="#000000")&&(n=m);const e=f.modules.size,o=f.modules.data;let s="",i=Array(e+r.margin*2+1).join(n.WW);i=Array(r.margin/2+1).join(i+`
|
|
267
267
|
`);const p=Array(r.margin+1).join(n.WW);s+=i;for(let l=0;l<e;l+=2){s+=p;for(let h=0;h<e;h++){const v=o[l*e+h],w=o[(l+1)*e+h];s+=u(v,w,n)}s+=p+`
|
|
268
|
-
`}return s+=i.slice(0,-1),typeof t=="function"&&t(null,s),s},d.renderToFile=function(a,t,r,n){typeof n>"u"&&(n=r,r=void 0);const e=c(9896),o=d.render(t,r);e.writeFile(a,o,n)}}),8441:((S,d)=>{function c(b){if(typeof b=="number"&&(b=b.toString()),typeof b!="string")throw new Error("Color should be defined as hex string");let g=b.slice().replace("#","").split("");if(g.length<3||g.length===5||g.length>8)throw new Error("Invalid hex color: "+b);(g.length===3||g.length===4)&&(g=Array.prototype.concat.apply([],g.map(function(u){return[u,u]}))),g.length===6&&g.push("F","F");const m=parseInt(g.join(""),16);return{r:m>>24&255,g:m>>16&255,b:m>>8&255,a:m&255,hex:"#"+g.slice(0,6).join("")}}d.getOptions=function(g){g||(g={}),g.color||(g.color={});const m=typeof g.margin>"u"||g.margin===null||g.margin<0?4:g.margin,u=g.width&&g.width>=21?g.width:void 0,f=g.scale||4;return{width:u,scale:u?4:f,margin:m,color:{dark:c(g.color.dark||"#000000ff"),light:c(g.color.light||"#ffffffff")},type:g.type,rendererOpts:g.rendererOpts||{}}},d.getScale=function(g,m){return m.width&&m.width>=g+m.margin*2?m.width/(g+m.margin*2):m.scale},d.getImageWidth=function(g,m){const u=d.getScale(g,m);return Math.floor((g+m.margin*2)*u)},d.qrToImageData=function(g,m,u){const f=m.modules.size,a=m.modules.data,t=d.getScale(f,u),r=Math.floor((f+u.margin*2)*t),n=u.margin*t,e=[u.color.light,u.color.dark];for(let o=0;o<r;o++)for(let s=0;s<r;s++){let i=(o*r+s)*4,p=u.color.light;if(o>=n&&s>=n&&o<r-n&&s<r-n){const l=Math.floor((o-n)/t),h=Math.floor((s-n)/t);p=e[a[l*f+h]?1:0]}g[i++]=p.r,g[i++]=p.g,g[i++]=p.b,g[i]=p.a}}}),2467:((S,d,c)=>{const b=c(5552),g=c(4024),m=c(4187),u=c(5565),f=c(6354),a=c(3378);function t(s,i,p){if(typeof s>"u")throw new Error("String required as first argument");if(typeof p>"u"&&(p=i,i={}),typeof p!="function")if(b())i=p||{},p=null;else throw new Error("Callback required as last argument");return{opts:i,cb:p}}function r(s){return s.slice((s.lastIndexOf(".")-1>>>0)+2).toLowerCase()}function n(s){switch(s){case"svg":return a;case"txt":case"utf8":return u;default:return m}}function e(s){switch(s){case"svg":return a;case"terminal":return f;default:return u}}function o(s,i,p){if(!p.cb)return new Promise(function(l,h){try{const v=g.create(i,p.opts);return s(v,p.opts,function(w,E){return w?h(w):l(E)})}catch(v){h(v)}});try{const l=g.create(i,p.opts);return s(l,p.opts,p.cb)}catch(l){p.cb(l)}}d.create=g.create,d.toCanvas=c(1462).toCanvas,d.toString=function(i,p,l){const h=t(i,p,l),v=h.opts?h.opts.type:void 0,w=e(v);return o(w.render,i,h)},d.toDataURL=function(i,p,l){const h=t(i,p,l),v=n(h.opts.type);return o(v.renderToDataURL,i,h)},d.toBuffer=function(i,p,l){const h=t(i,p,l),v=n(h.opts.type);return o(v.renderToBuffer,i,h)},d.toFile=function(i,p,l,h){if(typeof i!="string"||!(typeof p=="string"||typeof p=="object"))throw new Error("Invalid argument");if(arguments.length<3&&!b())throw new Error("Too few arguments provided");const v=t(p,l,h),w=v.opts.type||r(i),A=n(w).renderToFile.bind(null,i);return o(A,p,v)},d.toFileStream=function(i,p,l){if(arguments.length<2)throw new Error("Too few arguments provided");const h=t(p,l,i.emit.bind(i,"error")),w=n("png").renderToFileStream.bind(null,i);o(w,p,h)}}),6032:(S=>{var d=String.prototype.replace,c=/%20/g,b={RFC1738:"RFC1738",RFC3986:"RFC3986"};S.exports={default:b.RFC3986,formatters:{RFC1738:function(g){return d.call(g,c,"+")},RFC3986:function(g){return String(g)}},RFC1738:b.RFC1738,RFC3986:b.RFC3986}}),240:((S,d,c)=>{var b=c(1293),g=c(9091),m=c(6032);S.exports={formats:m,parse:g,stringify:b}}),9091:((S,d,c)=>{var b=c(5225),g=Object.prototype.hasOwnProperty,m=Array.isArray,u={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:b.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1,throwOnLimitExceeded:!1},f=function(p){return p.replace(/&#(\d+);/g,function(l,h){return String.fromCharCode(parseInt(h,10))})},a=function(p,l,h){if(p&&typeof p=="string"&&l.comma&&p.indexOf(",")>-1)return p.split(",");if(l.throwOnLimitExceeded&&h>=l.arrayLimit)throw new RangeError("Array limit exceeded. Only "+l.arrayLimit+" element"+(l.arrayLimit===1?"":"s")+" allowed in an array.");return p},t="utf8=%26%2310003%3B",r="utf8=%E2%9C%93",n=function(l,h){var v={__proto__:null},w=h.ignoreQueryPrefix?l.replace(/^\?/,""):l;w=w.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var E=h.parameterLimit===1/0?void 0:h.parameterLimit,A=w.split(h.delimiter,h.throwOnLimitExceeded?E+1:E);if(h.throwOnLimitExceeded&&A.length>E)throw new RangeError("Parameter limit exceeded. Only "+E+" parameter"+(E===1?"":"s")+" allowed.");var O=-1,C,_=h.charset;if(h.charsetSentinel)for(C=0;C<A.length;++C)A[C].indexOf("utf8=")===0&&(A[C]===r?_="utf-8":A[C]===t&&(_="iso-8859-1"),O=C,C=A.length);for(C=0;C<A.length;++C)if(C!==O){var T=A[C],k=T.indexOf("]="),R=k===-1?T.indexOf("="):k+1,I,L;if(R===-1?(I=h.decoder(T,u.decoder,_,"key"),L=h.strictNullHandling?null:""):(I=h.decoder(T.slice(0,R),u.decoder,_,"key"),I!==null&&(L=b.maybeMap(a(T.slice(R+1),h,m(v[I])?v[I].length:0),function(B){return h.decoder(B,u.decoder,_,"value")}))),L&&h.interpretNumericEntities&&_==="iso-8859-1"&&(L=f(String(L))),T.indexOf("[]=")>-1&&(L=m(L)?[L]:L),h.comma&&m(L)&&L.length>h.arrayLimit){if(h.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+h.arrayLimit+" element"+(h.arrayLimit===1?"":"s")+" allowed in an array.");L=b.combine([],L,h.arrayLimit,h.plainObjects)}if(I!==null){var P=g.call(v,I);P&&h.duplicates==="combine"?v[I]=b.combine(v[I],L,h.arrayLimit,h.plainObjects):(!P||h.duplicates==="last")&&(v[I]=L)}}return v},e=function(p,l,h,v){var w=0;if(p.length>0&&p[p.length-1]==="[]"){var E=p.slice(0,-1).join("");w=Array.isArray(l)&&l[E]?l[E].length:0}for(var A=v?l:a(l,h,w),O=p.length-1;O>=0;--O){var C,_=p[O];if(_==="[]"&&h.parseArrays)b.isOverflow(A)?C=A:C=h.allowEmptyArrays&&(A===""||h.strictNullHandling&&A===null)?[]:b.combine([],A,h.arrayLimit,h.plainObjects);else{C=h.plainObjects?{__proto__:null}:{};var T=_.charAt(0)==="["&&_.charAt(_.length-1)==="]"?_.slice(1,-1):_,k=h.decodeDotInKeys?T.replace(/%2E/g,"."):T,R=parseInt(k,10),I=!isNaN(R)&&_!==k&&String(R)===k&&R>=0&&h.parseArrays;if(!h.parseArrays&&k==="")C={0:A};else if(I&&R<h.arrayLimit)C=[],C[R]=A;else{if(I&&h.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+h.arrayLimit+" element"+(h.arrayLimit===1?"":"s")+" allowed in an array.");I?(C[R]=A,b.markOverflow(C,R)):k!=="__proto__"&&(C[k]=A)}}A=C}return A},o=function(l,h){var v=h.allowDots?l.replace(/\.([^.[]+)/g,"[$1]"):l;if(h.depth<=0)return!h.plainObjects&&g.call(Object.prototype,v)&&!h.allowPrototypes?void 0:[v];var w=/(\[[^[\]]*])/,E=/(\[[^[\]]*])/g,A=w.exec(v),O=A?v.slice(0,A.index):v,C=[];if(O){if(!h.plainObjects&&g.call(Object.prototype,O)&&!h.allowPrototypes)return;C[C.length]=O}for(var _=0;(A=E.exec(v))!==null&&_<h.depth;){_+=1;var T=A[1].slice(1,-1);if(!h.plainObjects&&g.call(Object.prototype,T)&&!h.allowPrototypes)return;C[C.length]=A[1]}if(A){if(h.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+h.depth+" and strictDepth is true");C[C.length]="["+v.slice(A.index)+"]"}return C},s=function(l,h,v,w){if(l){var E=o(l,v);if(E)return e(E,h,v,w)}},i=function(l){if(!l)return u;if(typeof l.allowEmptyArrays<"u"&&typeof l.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof l.decodeDotInKeys<"u"&&typeof l.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(l.decoder!==null&&typeof l.decoder<"u"&&typeof l.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof l.charset<"u"&&l.charset!=="utf-8"&&l.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof l.throwOnLimitExceeded<"u"&&typeof l.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var h=typeof l.charset>"u"?u.charset:l.charset,v=typeof l.duplicates>"u"?u.duplicates:l.duplicates;if(v!=="combine"&&v!=="first"&&v!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var w=typeof l.allowDots>"u"?l.decodeDotInKeys===!0?!0:u.allowDots:!!l.allowDots;return{allowDots:w,allowEmptyArrays:typeof l.allowEmptyArrays=="boolean"?!!l.allowEmptyArrays:u.allowEmptyArrays,allowPrototypes:typeof l.allowPrototypes=="boolean"?l.allowPrototypes:u.allowPrototypes,allowSparse:typeof l.allowSparse=="boolean"?l.allowSparse:u.allowSparse,arrayLimit:typeof l.arrayLimit=="number"?l.arrayLimit:u.arrayLimit,charset:h,charsetSentinel:typeof l.charsetSentinel=="boolean"?l.charsetSentinel:u.charsetSentinel,comma:typeof l.comma=="boolean"?l.comma:u.comma,decodeDotInKeys:typeof l.decodeDotInKeys=="boolean"?l.decodeDotInKeys:u.decodeDotInKeys,decoder:typeof l.decoder=="function"?l.decoder:u.decoder,delimiter:typeof l.delimiter=="string"||b.isRegExp(l.delimiter)?l.delimiter:u.delimiter,depth:typeof l.depth=="number"||l.depth===!1?+l.depth:u.depth,duplicates:v,ignoreQueryPrefix:l.ignoreQueryPrefix===!0,interpretNumericEntities:typeof l.interpretNumericEntities=="boolean"?l.interpretNumericEntities:u.interpretNumericEntities,parameterLimit:typeof l.parameterLimit=="number"?l.parameterLimit:u.parameterLimit,parseArrays:l.parseArrays!==!1,plainObjects:typeof l.plainObjects=="boolean"?l.plainObjects:u.plainObjects,strictDepth:typeof l.strictDepth=="boolean"?!!l.strictDepth:u.strictDepth,strictNullHandling:typeof l.strictNullHandling=="boolean"?l.strictNullHandling:u.strictNullHandling,throwOnLimitExceeded:typeof l.throwOnLimitExceeded=="boolean"?l.throwOnLimitExceeded:!1}};S.exports=function(p,l){var h=i(l);if(p===""||p===null||typeof p>"u")return h.plainObjects?{__proto__:null}:{};for(var v=typeof p=="string"?n(p,h):p,w=h.plainObjects?{__proto__:null}:{},E=Object.keys(v),A=0;A<E.length;++A){var O=E[A],C=s(O,v[O],h,typeof p=="string");w=b.merge(w,C,h)}return h.allowSparse===!0?w:b.compact(w)}}),1293:((S,d,c)=>{var b=c(4753),g=c(5225),m=c(6032),u=Object.prototype.hasOwnProperty,f={brackets:function(v){return v+"[]"},comma:"comma",indices:function(v,w){return v+"["+w+"]"},repeat:function(v){return v}},a=Array.isArray,t=Array.prototype.push,r=function(h,v){t.apply(h,a(v)?v:[v])},n=Date.prototype.toISOString,e=m.default,o={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:g.encode,encodeValuesOnly:!1,filter:void 0,format:e,formatter:m.formatters[e],indices:!1,serializeDate:function(v){return n.call(v)},skipNulls:!1,strictNullHandling:!1},s=function(v){return typeof v=="string"||typeof v=="number"||typeof v=="boolean"||typeof v=="symbol"||typeof v=="bigint"},i={},p=function h(v,w,E,A,O,C,_,T,k,R,I,L,P,B,M,z,$,K){for(var j=v,Z=K,Y=0,ne=!1;(Z=Z.get(i))!==void 0&&!ne;){var le=Z.get(v);if(Y+=1,typeof le<"u"){if(le===Y)throw new RangeError("Cyclic object value");ne=!0}typeof Z.get(i)>"u"&&(Y=0)}if(typeof R=="function"?j=R(w,j):j instanceof Date?j=P(j):E==="comma"&&a(j)&&(j=g.maybeMap(j,function(ie){return ie instanceof Date?P(ie):ie})),j===null){if(C)return k&&!z?k(w,o.encoder,$,"key",B):w;j=""}if(s(j)||g.isBuffer(j)){if(k){var re=z?w:k(w,o.encoder,$,"key",B);return[M(re)+"="+M(k(j,o.encoder,$,"value",B))]}return[M(w)+"="+M(String(j))]}var ce=[];if(typeof j>"u")return ce;var ee;if(E==="comma"&&a(j))z&&k&&(j=g.maybeMap(j,k)),ee=[{value:j.length>0?j.join(",")||null:void 0}];else if(a(R))ee=R;else{var G=Object.keys(j);ee=I?G.sort(I):G}var U=T?String(w).replace(/\./g,"%2E"):String(w),N=A&&a(j)&&j.length===1?U+"[]":U;if(O&&a(j)&&j.length===0)return N+"[]";for(var W=0;W<ee.length;++W){var Q=ee[W],te=typeof Q=="object"&&Q&&typeof Q.value<"u"?Q.value:j[Q];if(!(_&&te===null)){var F=L&&T?String(Q).replace(/\./g,"%2E"):String(Q),D=a(j)?typeof E=="function"?E(N,F):N:N+(L?"."+F:"["+F+"]");K.set(v,Y);var J=b();J.set(i,K),r(ce,h(te,D,E,A,O,C,_,T,E==="comma"&&z&&a(j)?null:k,R,I,L,P,B,M,z,$,J))}}return ce},l=function(v){if(!v)return o;if(typeof v.allowEmptyArrays<"u"&&typeof v.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof v.encodeDotInKeys<"u"&&typeof v.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(v.encoder!==null&&typeof v.encoder<"u"&&typeof v.encoder!="function")throw new TypeError("Encoder has to be a function.");var w=v.charset||o.charset;if(typeof v.charset<"u"&&v.charset!=="utf-8"&&v.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var E=m.default;if(typeof v.format<"u"){if(!u.call(m.formatters,v.format))throw new TypeError("Unknown format option provided.");E=v.format}var A=m.formatters[E],O=o.filter;(typeof v.filter=="function"||a(v.filter))&&(O=v.filter);var C;if(v.arrayFormat in f?C=v.arrayFormat:"indices"in v?C=v.indices?"indices":"repeat":C=o.arrayFormat,"commaRoundTrip"in v&&typeof v.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var _=typeof v.allowDots>"u"?v.encodeDotInKeys===!0?!0:o.allowDots:!!v.allowDots;return{addQueryPrefix:typeof v.addQueryPrefix=="boolean"?v.addQueryPrefix:o.addQueryPrefix,allowDots:_,allowEmptyArrays:typeof v.allowEmptyArrays=="boolean"?!!v.allowEmptyArrays:o.allowEmptyArrays,arrayFormat:C,charset:w,charsetSentinel:typeof v.charsetSentinel=="boolean"?v.charsetSentinel:o.charsetSentinel,commaRoundTrip:!!v.commaRoundTrip,delimiter:typeof v.delimiter>"u"?o.delimiter:v.delimiter,encode:typeof v.encode=="boolean"?v.encode:o.encode,encodeDotInKeys:typeof v.encodeDotInKeys=="boolean"?v.encodeDotInKeys:o.encodeDotInKeys,encoder:typeof v.encoder=="function"?v.encoder:o.encoder,encodeValuesOnly:typeof v.encodeValuesOnly=="boolean"?v.encodeValuesOnly:o.encodeValuesOnly,filter:O,format:E,formatter:A,serializeDate:typeof v.serializeDate=="function"?v.serializeDate:o.serializeDate,skipNulls:typeof v.skipNulls=="boolean"?v.skipNulls:o.skipNulls,sort:typeof v.sort=="function"?v.sort:null,strictNullHandling:typeof v.strictNullHandling=="boolean"?v.strictNullHandling:o.strictNullHandling}};S.exports=function(h,v){var w=h,E=l(v),A,O;typeof E.filter=="function"?(O=E.filter,w=O("",w)):a(E.filter)&&(O=E.filter,A=O);var C=[];if(typeof w!="object"||w===null)return"";var _=f[E.arrayFormat],T=_==="comma"&&E.commaRoundTrip;A||(A=Object.keys(w)),E.sort&&A.sort(E.sort);for(var k=b(),R=0;R<A.length;++R){var I=A[R],L=w[I];E.skipNulls&&L===null||r(C,p(L,I,_,T,E.allowEmptyArrays,E.strictNullHandling,E.skipNulls,E.encodeDotInKeys,E.encode?E.encoder:null,E.filter,E.sort,E.allowDots,E.serializeDate,E.format,E.formatter,E.encodeValuesOnly,E.charset,k))}var P=C.join(E.delimiter),B=E.addQueryPrefix===!0?"?":"";return E.charsetSentinel&&(E.charset==="iso-8859-1"?B+="utf8=%26%2310003%3B&":B+="utf8=%E2%9C%93&"),P.length>0?B+P:""}}),5225:((S,d,c)=>{var b=c(6032),g=c(4753),m=Object.prototype.hasOwnProperty,u=Array.isArray,f=g(),a=function(T,k){return f.set(T,k),T},t=function(T){return f.has(T)},r=function(T){return f.get(T)},n=function(T,k){f.set(T,k)},e=(function(){for(var _=[],T=0;T<256;++T)_[_.length]="%"+((T<16?"0":"")+T.toString(16)).toUpperCase();return _})(),o=function(T){for(;T.length>1;){var k=T.pop(),R=k.obj[k.prop];if(u(R)){for(var I=[],L=0;L<R.length;++L)typeof R[L]<"u"&&(I[I.length]=R[L]);k.obj[k.prop]=I}}},s=function(T,k){for(var R=k&&k.plainObjects?{__proto__:null}:{},I=0;I<T.length;++I)typeof T[I]<"u"&&(R[I]=T[I]);return R},i=function _(T,k,R){if(!k)return T;if(typeof k!="object"&&typeof k!="function"){if(u(T)){var I=T.length;if(R&&typeof R.arrayLimit=="number"&&I>R.arrayLimit)return a(s(T.concat(k),R),I);T[I]=k}else if(T&&typeof T=="object")if(t(T)){var L=r(T)+1;T[L]=k,n(T,L)}else(R&&(R.plainObjects||R.allowPrototypes)||!m.call(Object.prototype,k))&&(T[k]=!0);else return[T,k];return T}if(!T||typeof T!="object"){if(t(k)){for(var P=Object.keys(k),B=R&&R.plainObjects?{__proto__:null,0:T}:{0:T},M=0;M<P.length;M++){var z=parseInt(P[M],10);B[z+1]=k[P[M]]}return a(B,r(k)+1)}var $=[T].concat(k);return R&&typeof R.arrayLimit=="number"&&$.length>R.arrayLimit?a(s($,R),$.length-1):$}var K=T;return u(T)&&!u(k)&&(K=s(T,R)),u(T)&&u(k)?(k.forEach(function(j,Z){if(m.call(T,Z)){var Y=T[Z];Y&&typeof Y=="object"&&j&&typeof j=="object"?T[Z]=_(Y,j,R):T[T.length]=j}else T[Z]=j}),T):Object.keys(k).reduce(function(j,Z){var Y=k[Z];if(m.call(j,Z)?j[Z]=_(j[Z],Y,R):j[Z]=Y,t(k)&&!t(j)&&a(j,r(k)),t(j)){var ne=parseInt(Z,10);String(ne)===Z&&ne>=0&&ne>r(j)&&n(j,ne)}return j},K)},p=function(T,k){return Object.keys(k).reduce(function(R,I){return R[I]=k[I],R},T)},l=function(_,T,k){var R=_.replace(/\+/g," ");if(k==="iso-8859-1")return R.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(R)}catch{return R}},h=1024,v=function(T,k,R,I,L){if(T.length===0)return T;var P=T;if(typeof T=="symbol"?P=Symbol.prototype.toString.call(T):typeof T!="string"&&(P=String(T)),R==="iso-8859-1")return escape(P).replace(/%u[0-9a-f]{4}/gi,function(Z){return"%26%23"+parseInt(Z.slice(2),16)+"%3B"});for(var B="",M=0;M<P.length;M+=h){for(var z=P.length>=h?P.slice(M,M+h):P,$=[],K=0;K<z.length;++K){var j=z.charCodeAt(K);if(j===45||j===46||j===95||j===126||j>=48&&j<=57||j>=65&&j<=90||j>=97&&j<=122||L===b.RFC1738&&(j===40||j===41)){$[$.length]=z.charAt(K);continue}if(j<128){$[$.length]=e[j];continue}if(j<2048){$[$.length]=e[192|j>>6]+e[128|j&63];continue}if(j<55296||j>=57344){$[$.length]=e[224|j>>12]+e[128|j>>6&63]+e[128|j&63];continue}K+=1,j=65536+((j&1023)<<10|z.charCodeAt(K)&1023),$[$.length]=e[240|j>>18]+e[128|j>>12&63]+e[128|j>>6&63]+e[128|j&63]}B+=$.join("")}return B},w=function(T){for(var k=[{obj:{o:T},prop:"o"}],R=[],I=0;I<k.length;++I)for(var L=k[I],P=L.obj[L.prop],B=Object.keys(P),M=0;M<B.length;++M){var z=B[M],$=P[z];typeof $=="object"&&$!==null&&R.indexOf($)===-1&&(k[k.length]={obj:P,prop:z},R[R.length]=$)}return o(k),T},E=function(T){return Object.prototype.toString.call(T)==="[object RegExp]"},A=function(T){return!T||typeof T!="object"?!1:!!(T.constructor&&T.constructor.isBuffer&&T.constructor.isBuffer(T))},O=function(T,k,R,I){if(t(T)){var L=r(T)+1;return T[L]=k,n(T,L),T}var P=[].concat(T,k);return P.length>R?a(s(P,{plainObjects:I}),P.length-1):P},C=function(T,k){if(u(T)){for(var R=[],I=0;I<T.length;I+=1)R[R.length]=k(T[I]);return R}return k(T)};S.exports={arrayToObject:s,assign:p,combine:O,compact:w,decode:l,encode:v,isBuffer:A,isOverflow:t,isRegExp:E,markOverflow:a,maybeMap:C,merge:i}}),4031:(S=>{/*!
|
|
268
|
+
`}return s+=i.slice(0,-1),typeof t=="function"&&t(null,s),s},d.renderToFile=function(a,t,r,n){typeof n>"u"&&(n=r,r=void 0);const e=c(9896),o=d.render(t,r);e.writeFile(a,o,n)}}),8441:((S,d)=>{function c(b){if(typeof b=="number"&&(b=b.toString()),typeof b!="string")throw new Error("Color should be defined as hex string");let g=b.slice().replace("#","").split("");if(g.length<3||g.length===5||g.length>8)throw new Error("Invalid hex color: "+b);(g.length===3||g.length===4)&&(g=Array.prototype.concat.apply([],g.map(function(u){return[u,u]}))),g.length===6&&g.push("F","F");const m=parseInt(g.join(""),16);return{r:m>>24&255,g:m>>16&255,b:m>>8&255,a:m&255,hex:"#"+g.slice(0,6).join("")}}d.getOptions=function(g){g||(g={}),g.color||(g.color={});const m=typeof g.margin>"u"||g.margin===null||g.margin<0?4:g.margin,u=g.width&&g.width>=21?g.width:void 0,f=g.scale||4;return{width:u,scale:u?4:f,margin:m,color:{dark:c(g.color.dark||"#000000ff"),light:c(g.color.light||"#ffffffff")},type:g.type,rendererOpts:g.rendererOpts||{}}},d.getScale=function(g,m){return m.width&&m.width>=g+m.margin*2?m.width/(g+m.margin*2):m.scale},d.getImageWidth=function(g,m){const u=d.getScale(g,m);return Math.floor((g+m.margin*2)*u)},d.qrToImageData=function(g,m,u){const f=m.modules.size,a=m.modules.data,t=d.getScale(f,u),r=Math.floor((f+u.margin*2)*t),n=u.margin*t,e=[u.color.light,u.color.dark];for(let o=0;o<r;o++)for(let s=0;s<r;s++){let i=(o*r+s)*4,p=u.color.light;if(o>=n&&s>=n&&o<r-n&&s<r-n){const l=Math.floor((o-n)/t),h=Math.floor((s-n)/t);p=e[a[l*f+h]?1:0]}g[i++]=p.r,g[i++]=p.g,g[i++]=p.b,g[i]=p.a}}}),2467:((S,d,c)=>{const b=c(5552),g=c(4024),m=c(4187),u=c(5565),f=c(6354),a=c(3378);function t(s,i,p){if(typeof s>"u")throw new Error("String required as first argument");if(typeof p>"u"&&(p=i,i={}),typeof p!="function")if(b())i=p||{},p=null;else throw new Error("Callback required as last argument");return{opts:i,cb:p}}function r(s){return s.slice((s.lastIndexOf(".")-1>>>0)+2).toLowerCase()}function n(s){switch(s){case"svg":return a;case"txt":case"utf8":return u;default:return m}}function e(s){switch(s){case"svg":return a;case"terminal":return f;default:return u}}function o(s,i,p){if(!p.cb)return new Promise(function(l,h){try{const v=g.create(i,p.opts);return s(v,p.opts,function(w,E){return w?h(w):l(E)})}catch(v){h(v)}});try{const l=g.create(i,p.opts);return s(l,p.opts,p.cb)}catch(l){p.cb(l)}}d.create=g.create,d.toCanvas=c(1462).toCanvas,d.toString=function(i,p,l){const h=t(i,p,l),v=h.opts?h.opts.type:void 0,w=e(v);return o(w.render,i,h)},d.toDataURL=function(i,p,l){const h=t(i,p,l),v=n(h.opts.type);return o(v.renderToDataURL,i,h)},d.toBuffer=function(i,p,l){const h=t(i,p,l),v=n(h.opts.type);return o(v.renderToBuffer,i,h)},d.toFile=function(i,p,l,h){if(typeof i!="string"||!(typeof p=="string"||typeof p=="object"))throw new Error("Invalid argument");if(arguments.length<3&&!b())throw new Error("Too few arguments provided");const v=t(p,l,h),w=v.opts.type||r(i),A=n(w).renderToFile.bind(null,i);return o(A,p,v)},d.toFileStream=function(i,p,l){if(arguments.length<2)throw new Error("Too few arguments provided");const h=t(p,l,i.emit.bind(i,"error")),w=n("png").renderToFileStream.bind(null,i);o(w,p,h)}}),6032:(S=>{var d=String.prototype.replace,c=/%20/g,b={RFC1738:"RFC1738",RFC3986:"RFC3986"};S.exports={default:b.RFC3986,formatters:{RFC1738:function(g){return d.call(g,c,"+")},RFC3986:function(g){return String(g)}},RFC1738:b.RFC1738,RFC3986:b.RFC3986}}),240:((S,d,c)=>{var b=c(1293),g=c(9091),m=c(6032);S.exports={formats:m,parse:g,stringify:b}}),9091:((S,d,c)=>{var b=c(5225),g=Object.prototype.hasOwnProperty,m=Array.isArray,u={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:b.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1,throwOnLimitExceeded:!1},f=function(p){return p.replace(/&#(\d+);/g,function(l,h){return String.fromCharCode(parseInt(h,10))})},a=function(p,l,h){if(p&&typeof p=="string"&&l.comma&&p.indexOf(",")>-1)return p.split(",");if(l.throwOnLimitExceeded&&h>=l.arrayLimit)throw new RangeError("Array limit exceeded. Only "+l.arrayLimit+" element"+(l.arrayLimit===1?"":"s")+" allowed in an array.");return p},t="utf8=%26%2310003%3B",r="utf8=%E2%9C%93",n=function(l,h){var v={__proto__:null},w=h.ignoreQueryPrefix?l.replace(/^\?/,""):l;w=w.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var E=h.parameterLimit===1/0?void 0:h.parameterLimit,A=w.split(h.delimiter,h.throwOnLimitExceeded?E+1:E);if(h.throwOnLimitExceeded&&A.length>E)throw new RangeError("Parameter limit exceeded. Only "+E+" parameter"+(E===1?"":"s")+" allowed.");var O=-1,C,_=h.charset;if(h.charsetSentinel)for(C=0;C<A.length;++C)A[C].indexOf("utf8=")===0&&(A[C]===r?_="utf-8":A[C]===t&&(_="iso-8859-1"),O=C,C=A.length);for(C=0;C<A.length;++C)if(C!==O){var T=A[C],k=T.indexOf("]="),R=k===-1?T.indexOf("="):k+1,I,L;if(R===-1?(I=h.decoder(T,u.decoder,_,"key"),L=h.strictNullHandling?null:""):(I=h.decoder(T.slice(0,R),u.decoder,_,"key"),I!==null&&(L=b.maybeMap(a(T.slice(R+1),h,m(v[I])?v[I].length:0),function(B){return h.decoder(B,u.decoder,_,"value")}))),L&&h.interpretNumericEntities&&_==="iso-8859-1"&&(L=f(String(L))),T.indexOf("[]=")>-1&&(L=m(L)?[L]:L),h.comma&&m(L)&&L.length>h.arrayLimit){if(h.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+h.arrayLimit+" element"+(h.arrayLimit===1?"":"s")+" allowed in an array.");L=b.combine([],L,h.arrayLimit,h.plainObjects)}if(I!==null){var P=g.call(v,I);P&&h.duplicates==="combine"?v[I]=b.combine(v[I],L,h.arrayLimit,h.plainObjects):(!P||h.duplicates==="last")&&(v[I]=L)}}return v},e=function(p,l,h,v){var w=0;if(p.length>0&&p[p.length-1]==="[]"){var E=p.slice(0,-1).join("");w=Array.isArray(l)&&l[E]?l[E].length:0}for(var A=v?l:a(l,h,w),O=p.length-1;O>=0;--O){var C,_=p[O];if(_==="[]"&&h.parseArrays)b.isOverflow(A)?C=A:C=h.allowEmptyArrays&&(A===""||h.strictNullHandling&&A===null)?[]:b.combine([],A,h.arrayLimit,h.plainObjects);else{C=h.plainObjects?{__proto__:null}:{};var T=_.charAt(0)==="["&&_.charAt(_.length-1)==="]"?_.slice(1,-1):_,k=h.decodeDotInKeys?T.replace(/%2E/g,"."):T,R=parseInt(k,10),I=!isNaN(R)&&_!==k&&String(R)===k&&R>=0&&h.parseArrays;if(!h.parseArrays&&k==="")C={0:A};else if(I&&R<h.arrayLimit)C=[],C[R]=A;else{if(I&&h.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+h.arrayLimit+" element"+(h.arrayLimit===1?"":"s")+" allowed in an array.");I?(C[R]=A,b.markOverflow(C,R)):k!=="__proto__"&&(C[k]=A)}}A=C}return A},o=function(l,h){var v=h.allowDots?l.replace(/\.([^.[]+)/g,"[$1]"):l;if(h.depth<=0)return!h.plainObjects&&g.call(Object.prototype,v)&&!h.allowPrototypes?void 0:[v];var w=/(\[[^[\]]*])/,E=/(\[[^[\]]*])/g,A=w.exec(v),O=A?v.slice(0,A.index):v,C=[];if(O){if(!h.plainObjects&&g.call(Object.prototype,O)&&!h.allowPrototypes)return;C[C.length]=O}for(var _=0;(A=E.exec(v))!==null&&_<h.depth;){_+=1;var T=A[1].slice(1,-1);if(!h.plainObjects&&g.call(Object.prototype,T)&&!h.allowPrototypes)return;C[C.length]=A[1]}if(A){if(h.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+h.depth+" and strictDepth is true");C[C.length]="["+v.slice(A.index)+"]"}return C},s=function(l,h,v,w){if(l){var E=o(l,v);if(E)return e(E,h,v,w)}},i=function(l){if(!l)return u;if(typeof l.allowEmptyArrays<"u"&&typeof l.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof l.decodeDotInKeys<"u"&&typeof l.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(l.decoder!==null&&typeof l.decoder<"u"&&typeof l.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof l.charset<"u"&&l.charset!=="utf-8"&&l.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof l.throwOnLimitExceeded<"u"&&typeof l.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var h=typeof l.charset>"u"?u.charset:l.charset,v=typeof l.duplicates>"u"?u.duplicates:l.duplicates;if(v!=="combine"&&v!=="first"&&v!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var w=typeof l.allowDots>"u"?l.decodeDotInKeys===!0?!0:u.allowDots:!!l.allowDots;return{allowDots:w,allowEmptyArrays:typeof l.allowEmptyArrays=="boolean"?!!l.allowEmptyArrays:u.allowEmptyArrays,allowPrototypes:typeof l.allowPrototypes=="boolean"?l.allowPrototypes:u.allowPrototypes,allowSparse:typeof l.allowSparse=="boolean"?l.allowSparse:u.allowSparse,arrayLimit:typeof l.arrayLimit=="number"?l.arrayLimit:u.arrayLimit,charset:h,charsetSentinel:typeof l.charsetSentinel=="boolean"?l.charsetSentinel:u.charsetSentinel,comma:typeof l.comma=="boolean"?l.comma:u.comma,decodeDotInKeys:typeof l.decodeDotInKeys=="boolean"?l.decodeDotInKeys:u.decodeDotInKeys,decoder:typeof l.decoder=="function"?l.decoder:u.decoder,delimiter:typeof l.delimiter=="string"||b.isRegExp(l.delimiter)?l.delimiter:u.delimiter,depth:typeof l.depth=="number"||l.depth===!1?+l.depth:u.depth,duplicates:v,ignoreQueryPrefix:l.ignoreQueryPrefix===!0,interpretNumericEntities:typeof l.interpretNumericEntities=="boolean"?l.interpretNumericEntities:u.interpretNumericEntities,parameterLimit:typeof l.parameterLimit=="number"?l.parameterLimit:u.parameterLimit,parseArrays:l.parseArrays!==!1,plainObjects:typeof l.plainObjects=="boolean"?l.plainObjects:u.plainObjects,strictDepth:typeof l.strictDepth=="boolean"?!!l.strictDepth:u.strictDepth,strictNullHandling:typeof l.strictNullHandling=="boolean"?l.strictNullHandling:u.strictNullHandling,throwOnLimitExceeded:typeof l.throwOnLimitExceeded=="boolean"?l.throwOnLimitExceeded:!1}};S.exports=function(p,l){var h=i(l);if(p===""||p===null||typeof p>"u")return h.plainObjects?{__proto__:null}:{};for(var v=typeof p=="string"?n(p,h):p,w=h.plainObjects?{__proto__:null}:{},E=Object.keys(v),A=0;A<E.length;++A){var O=E[A],C=s(O,v[O],h,typeof p=="string");w=b.merge(w,C,h)}return h.allowSparse===!0?w:b.compact(w)}}),1293:((S,d,c)=>{var b=c(4753),g=c(5225),m=c(6032),u=Object.prototype.hasOwnProperty,f={brackets:function(v){return v+"[]"},comma:"comma",indices:function(v,w){return v+"["+w+"]"},repeat:function(v){return v}},a=Array.isArray,t=Array.prototype.push,r=function(h,v){t.apply(h,a(v)?v:[v])},n=Date.prototype.toISOString,e=m.default,o={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:g.encode,encodeValuesOnly:!1,filter:void 0,format:e,formatter:m.formatters[e],indices:!1,serializeDate:function(v){return n.call(v)},skipNulls:!1,strictNullHandling:!1},s=function(v){return typeof v=="string"||typeof v=="number"||typeof v=="boolean"||typeof v=="symbol"||typeof v=="bigint"},i={},p=function h(v,w,E,A,O,C,_,T,k,R,I,L,P,B,M,z,$,K){for(var j=v,Z=K,Y=0,ne=!1;(Z=Z.get(i))!==void 0&&!ne;){var le=Z.get(v);if(Y+=1,typeof le<"u"){if(le===Y)throw new RangeError("Cyclic object value");ne=!0}typeof Z.get(i)>"u"&&(Y=0)}if(typeof R=="function"?j=R(w,j):j instanceof Date?j=P(j):E==="comma"&&a(j)&&(j=g.maybeMap(j,function(ie){return ie instanceof Date?P(ie):ie})),j===null){if(C)return k&&!z?k(w,o.encoder,$,"key",B):w;j=""}if(s(j)||g.isBuffer(j)){if(k){var re=z?w:k(w,o.encoder,$,"key",B);return[M(re)+"="+M(k(j,o.encoder,$,"value",B))]}return[M(w)+"="+M(String(j))]}var ce=[];if(typeof j>"u")return ce;var ee;if(E==="comma"&&a(j))z&&k&&(j=g.maybeMap(j,k)),ee=[{value:j.length>0?j.join(",")||null:void 0}];else if(a(R))ee=R;else{var G=Object.keys(j);ee=I?G.sort(I):G}var U=T?String(w).replace(/\./g,"%2E"):String(w),N=A&&a(j)&&j.length===1?U+"[]":U;if(O&&a(j)&&j.length===0)return N+"[]";for(var W=0;W<ee.length;++W){var Q=ee[W],te=typeof Q=="object"&&Q&&typeof Q.value<"u"?Q.value:j[Q];if(!(_&&te===null)){var F=L&&T?String(Q).replace(/\./g,"%2E"):String(Q),D=a(j)?typeof E=="function"?E(N,F):N:N+(L?"."+F:"["+F+"]");K.set(v,Y);var X=b();X.set(i,K),r(ce,h(te,D,E,A,O,C,_,T,E==="comma"&&z&&a(j)?null:k,R,I,L,P,B,M,z,$,X))}}return ce},l=function(v){if(!v)return o;if(typeof v.allowEmptyArrays<"u"&&typeof v.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof v.encodeDotInKeys<"u"&&typeof v.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(v.encoder!==null&&typeof v.encoder<"u"&&typeof v.encoder!="function")throw new TypeError("Encoder has to be a function.");var w=v.charset||o.charset;if(typeof v.charset<"u"&&v.charset!=="utf-8"&&v.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var E=m.default;if(typeof v.format<"u"){if(!u.call(m.formatters,v.format))throw new TypeError("Unknown format option provided.");E=v.format}var A=m.formatters[E],O=o.filter;(typeof v.filter=="function"||a(v.filter))&&(O=v.filter);var C;if(v.arrayFormat in f?C=v.arrayFormat:"indices"in v?C=v.indices?"indices":"repeat":C=o.arrayFormat,"commaRoundTrip"in v&&typeof v.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var _=typeof v.allowDots>"u"?v.encodeDotInKeys===!0?!0:o.allowDots:!!v.allowDots;return{addQueryPrefix:typeof v.addQueryPrefix=="boolean"?v.addQueryPrefix:o.addQueryPrefix,allowDots:_,allowEmptyArrays:typeof v.allowEmptyArrays=="boolean"?!!v.allowEmptyArrays:o.allowEmptyArrays,arrayFormat:C,charset:w,charsetSentinel:typeof v.charsetSentinel=="boolean"?v.charsetSentinel:o.charsetSentinel,commaRoundTrip:!!v.commaRoundTrip,delimiter:typeof v.delimiter>"u"?o.delimiter:v.delimiter,encode:typeof v.encode=="boolean"?v.encode:o.encode,encodeDotInKeys:typeof v.encodeDotInKeys=="boolean"?v.encodeDotInKeys:o.encodeDotInKeys,encoder:typeof v.encoder=="function"?v.encoder:o.encoder,encodeValuesOnly:typeof v.encodeValuesOnly=="boolean"?v.encodeValuesOnly:o.encodeValuesOnly,filter:O,format:E,formatter:A,serializeDate:typeof v.serializeDate=="function"?v.serializeDate:o.serializeDate,skipNulls:typeof v.skipNulls=="boolean"?v.skipNulls:o.skipNulls,sort:typeof v.sort=="function"?v.sort:null,strictNullHandling:typeof v.strictNullHandling=="boolean"?v.strictNullHandling:o.strictNullHandling}};S.exports=function(h,v){var w=h,E=l(v),A,O;typeof E.filter=="function"?(O=E.filter,w=O("",w)):a(E.filter)&&(O=E.filter,A=O);var C=[];if(typeof w!="object"||w===null)return"";var _=f[E.arrayFormat],T=_==="comma"&&E.commaRoundTrip;A||(A=Object.keys(w)),E.sort&&A.sort(E.sort);for(var k=b(),R=0;R<A.length;++R){var I=A[R],L=w[I];E.skipNulls&&L===null||r(C,p(L,I,_,T,E.allowEmptyArrays,E.strictNullHandling,E.skipNulls,E.encodeDotInKeys,E.encode?E.encoder:null,E.filter,E.sort,E.allowDots,E.serializeDate,E.format,E.formatter,E.encodeValuesOnly,E.charset,k))}var P=C.join(E.delimiter),B=E.addQueryPrefix===!0?"?":"";return E.charsetSentinel&&(E.charset==="iso-8859-1"?B+="utf8=%26%2310003%3B&":B+="utf8=%E2%9C%93&"),P.length>0?B+P:""}}),5225:((S,d,c)=>{var b=c(6032),g=c(4753),m=Object.prototype.hasOwnProperty,u=Array.isArray,f=g(),a=function(T,k){return f.set(T,k),T},t=function(T){return f.has(T)},r=function(T){return f.get(T)},n=function(T,k){f.set(T,k)},e=(function(){for(var _=[],T=0;T<256;++T)_[_.length]="%"+((T<16?"0":"")+T.toString(16)).toUpperCase();return _})(),o=function(T){for(;T.length>1;){var k=T.pop(),R=k.obj[k.prop];if(u(R)){for(var I=[],L=0;L<R.length;++L)typeof R[L]<"u"&&(I[I.length]=R[L]);k.obj[k.prop]=I}}},s=function(T,k){for(var R=k&&k.plainObjects?{__proto__:null}:{},I=0;I<T.length;++I)typeof T[I]<"u"&&(R[I]=T[I]);return R},i=function _(T,k,R){if(!k)return T;if(typeof k!="object"&&typeof k!="function"){if(u(T)){var I=T.length;if(R&&typeof R.arrayLimit=="number"&&I>R.arrayLimit)return a(s(T.concat(k),R),I);T[I]=k}else if(T&&typeof T=="object")if(t(T)){var L=r(T)+1;T[L]=k,n(T,L)}else(R&&(R.plainObjects||R.allowPrototypes)||!m.call(Object.prototype,k))&&(T[k]=!0);else return[T,k];return T}if(!T||typeof T!="object"){if(t(k)){for(var P=Object.keys(k),B=R&&R.plainObjects?{__proto__:null,0:T}:{0:T},M=0;M<P.length;M++){var z=parseInt(P[M],10);B[z+1]=k[P[M]]}return a(B,r(k)+1)}var $=[T].concat(k);return R&&typeof R.arrayLimit=="number"&&$.length>R.arrayLimit?a(s($,R),$.length-1):$}var K=T;return u(T)&&!u(k)&&(K=s(T,R)),u(T)&&u(k)?(k.forEach(function(j,Z){if(m.call(T,Z)){var Y=T[Z];Y&&typeof Y=="object"&&j&&typeof j=="object"?T[Z]=_(Y,j,R):T[T.length]=j}else T[Z]=j}),T):Object.keys(k).reduce(function(j,Z){var Y=k[Z];if(m.call(j,Z)?j[Z]=_(j[Z],Y,R):j[Z]=Y,t(k)&&!t(j)&&a(j,r(k)),t(j)){var ne=parseInt(Z,10);String(ne)===Z&&ne>=0&&ne>r(j)&&n(j,ne)}return j},K)},p=function(T,k){return Object.keys(k).reduce(function(R,I){return R[I]=k[I],R},T)},l=function(_,T,k){var R=_.replace(/\+/g," ");if(k==="iso-8859-1")return R.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(R)}catch{return R}},h=1024,v=function(T,k,R,I,L){if(T.length===0)return T;var P=T;if(typeof T=="symbol"?P=Symbol.prototype.toString.call(T):typeof T!="string"&&(P=String(T)),R==="iso-8859-1")return escape(P).replace(/%u[0-9a-f]{4}/gi,function(Z){return"%26%23"+parseInt(Z.slice(2),16)+"%3B"});for(var B="",M=0;M<P.length;M+=h){for(var z=P.length>=h?P.slice(M,M+h):P,$=[],K=0;K<z.length;++K){var j=z.charCodeAt(K);if(j===45||j===46||j===95||j===126||j>=48&&j<=57||j>=65&&j<=90||j>=97&&j<=122||L===b.RFC1738&&(j===40||j===41)){$[$.length]=z.charAt(K);continue}if(j<128){$[$.length]=e[j];continue}if(j<2048){$[$.length]=e[192|j>>6]+e[128|j&63];continue}if(j<55296||j>=57344){$[$.length]=e[224|j>>12]+e[128|j>>6&63]+e[128|j&63];continue}K+=1,j=65536+((j&1023)<<10|z.charCodeAt(K)&1023),$[$.length]=e[240|j>>18]+e[128|j>>12&63]+e[128|j>>6&63]+e[128|j&63]}B+=$.join("")}return B},w=function(T){for(var k=[{obj:{o:T},prop:"o"}],R=[],I=0;I<k.length;++I)for(var L=k[I],P=L.obj[L.prop],B=Object.keys(P),M=0;M<B.length;++M){var z=B[M],$=P[z];typeof $=="object"&&$!==null&&R.indexOf($)===-1&&(k[k.length]={obj:P,prop:z},R[R.length]=$)}return o(k),T},E=function(T){return Object.prototype.toString.call(T)==="[object RegExp]"},A=function(T){return!T||typeof T!="object"?!1:!!(T.constructor&&T.constructor.isBuffer&&T.constructor.isBuffer(T))},O=function(T,k,R,I){if(t(T)){var L=r(T)+1;return T[L]=k,n(T,L),T}var P=[].concat(T,k);return P.length>R?a(s(P,{plainObjects:I}),P.length-1):P},C=function(T,k){if(u(T)){for(var R=[],I=0;I<T.length;I+=1)R[R.length]=k(T[I]);return R}return k(T)};S.exports={arrayToObject:s,assign:p,combine:O,compact:w,decode:l,encode:v,isBuffer:A,isOverflow:t,isRegExp:E,markOverflow:a,maybeMap:C,merge:i}}),4031:(S=>{/*!
|
|
269
269
|
* range-parser
|
|
270
270
|
* Copyright(c) 2012-2014 TJ Holowaychuk
|
|
271
271
|
* Copyright(c) 2015-2016 Douglas Christopher Wilson
|
|
@@ -275,12 +275,12 @@ Minimum version required to store current data is: `+L+`.
|
|
|
275
275
|
* Copyright(c) 2013-2014 Jonathan Ong
|
|
276
276
|
* Copyright(c) 2014-2022 Douglas Christopher Wilson
|
|
277
277
|
* MIT Licensed
|
|
278
|
-
*/var b=o(),g=c(4531),m=c(8024),u=c(1748),f=c(6367);S.exports=r;var a=/^Encoding not recognized: /;function t(i){if(!i)return null;try{return u.getDecoder(i)}catch(p){throw a.test(p.message)?m(415,"specified encoding unsupported",{encoding:i,type:"encoding.unsupported"}):p}}function r(i,p,l){var h=l,v=p||{};if(i===void 0)throw new TypeError("argument stream is required");if(typeof i!="object"||i===null||typeof i.on!="function")throw new TypeError("argument stream must be a stream");if((p===!0||typeof p=="string")&&(v={encoding:p}),typeof p=="function"&&(h=p,v={}),h!==void 0&&typeof h!="function")throw new TypeError("argument callback must be a function");if(!h&&!global.Promise)throw new TypeError("argument callback is required");var w=v.encoding!==!0?v.encoding:"utf-8",E=g.parse(v.limit),A=v.length!=null&&!isNaN(v.length)?parseInt(v.length,10):null;return h?e(i,w,A,E,s(h)):new Promise(function(C,_){e(i,w,A,E,function(k,R){if(k)return _(k);C(R)})})}function n(i){f(i),typeof i.pause=="function"&&i.pause()}function e(i,p,l,h,v){var w=!1,E=!0;if(h!==null&&l!==null&&l>h)return T(m(413,"request entity too large",{expected:l,length:l,limit:h,type:"entity.too.large"}));var A=i._readableState;if(i._decoder||A&&(A.encoding||A.decoder))return T(m(500,"stream encoding should not be set",{type:"stream.encoding.set"}));if(typeof i.readable<"u"&&!i.readable)return T(m(500,"stream is not readable",{type:"stream.not.readable"}));var O=0,C;try{C=t(p)}catch(P){return T(P)}var _=C?"":[];i.on("aborted",k),i.on("close",L),i.on("data",R),i.on("end",I),i.on("error",I),E=!1;function T(){for(var P=new Array(arguments.length),B=0;B<P.length;B++)P[B]=arguments[B];w=!0,E?process.nextTick(M):M();function M(){L(),P[0]&&n(i),v.apply(null,P)}}function k(){w||T(m(400,"request aborted",{code:"ECONNABORTED",expected:l,length:l,received:O,type:"request.aborted"}))}function R(P){w||(O+=P.length,h!==null&&O>h?T(m(413,"request entity too large",{limit:h,received:O,type:"entity.too.large"})):C?_+=C.write(P):_.push(P))}function I(P){if(!w){if(P)return T(P);if(l!==null&&O!==l)T(m(400,"request size did not match content length",{expected:l,length:l,received:O,type:"request.size.invalid"}));else{var B=C?_+(C.end()||""):Buffer.concat(_);T(null,B)}}}function L(){_=null,i.removeListener("aborted",k),i.removeListener("data",R),i.removeListener("end",I),i.removeListener("error",I),i.removeListener("close",L)}}function o(){try{return c(290)}catch{return{}}}function s(i){var p;return b.AsyncResource&&(p=new b.AsyncResource(i.name||"bound-anonymous-fn")),!p||!p.runInAsyncScope?i:p.runInAsyncScope.bind(p,i,null)}}),5500:(S=>{const d={};function c(f,a,t){t||(t=Error);function r(e,o,s){return typeof a=="string"?a:a(e,o,s)}class n extends t{constructor(o,s,i){super(r(o,s,i))}}n.prototype.name=t.name,n.prototype.code=f,d[f]=n}function b(f,a){if(Array.isArray(f)){const t=f.length;return f=f.map(r=>String(r)),t>2?`one of ${a} ${f.slice(0,t-1).join(", ")}, or `+f[t-1]:t===2?`one of ${a} ${f[0]} or ${f[1]}`:`of ${a} ${f[0]}`}else return`of ${a} ${String(f)}`}function g(f,a,t){return f.substr(!t||t<0?0:+t,a.length)===a}function m(f,a,t){return(t===void 0||t>f.length)&&(t=f.length),f.substring(t-a.length,t)===a}function u(f,a,t){return typeof t!="number"&&(t=0),t+a.length>f.length?!1:f.indexOf(a,t)!==-1}c("ERR_INVALID_OPT_VALUE",function(f,a){return'The value "'+a+'" is invalid for option "'+f+'"'},TypeError),c("ERR_INVALID_ARG_TYPE",function(f,a,t){let r;typeof a=="string"&&g(a,"not ")?(r="must not be",a=a.replace(/^not /,"")):r="must be";let n;if(m(f," argument"))n=`The ${f} ${r} ${b(a,"type")}`;else{const e=u(f,".")?"property":"argument";n=`The "${f}" ${e} ${r} ${b(a,"type")}`}return n+=`. Received type ${typeof t}`,n},TypeError),c("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),c("ERR_METHOD_NOT_IMPLEMENTED",function(f){return"The "+f+" method is not implemented"}),c("ERR_STREAM_PREMATURE_CLOSE","Premature close"),c("ERR_STREAM_DESTROYED",function(f){return"Cannot call "+f+" after a stream was destroyed"}),c("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),c("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),c("ERR_STREAM_WRITE_AFTER_END","write after end"),c("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),c("ERR_UNKNOWN_ENCODING",function(f){return"Unknown encoding: "+f},TypeError),c("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),S.exports.F=d}),2063:((S,d,c)=>{var b=Object.keys||function(e){var o=[];for(var s in e)o.push(s);return o};S.exports=t;var g=c(6893),m=c(8797);c(9598)(t,g);for(var u=b(m.prototype),f=0;f<u.length;f++){var a=u[f];t.prototype[a]||(t.prototype[a]=m.prototype[a])}function t(e){if(!(this instanceof t))return new t(e);g.call(this,e),m.call(this,e),this.allowHalfOpen=!0,e&&(e.readable===!1&&(this.readable=!1),e.writable===!1&&(this.writable=!1),e.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",r)))}Object.defineProperty(t.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(t.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(t.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function r(){this._writableState.ended||process.nextTick(n,this)}function n(e){e.end()}Object.defineProperty(t.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(o){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=o,this._writableState.destroyed=o)}})}),5283:((S,d,c)=>{S.exports=g;var b=c(2337);c(9598)(g,b);function g(m){if(!(this instanceof g))return new g(m);b.call(this,m)}g.prototype._transform=function(m,u,f){f(null,m)}}),6893:((S,d,c)=>{S.exports=I;var b;I.ReadableState=R;var g=c(4434).EventEmitter,m=function(D,J){return D.listeners(J).length},u=c(3283),f=c(181).Buffer,a=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function t(F){return f.from(F)}function r(F){return f.isBuffer(F)||F instanceof a}var n=c(9023),e;n&&n.debuglog?e=n.debuglog("stream"):e=function(){};var o=c(7336),s=c(5089),i=c(4874),p=i.getHighWaterMark,l=c(5500).F,h=l.ERR_INVALID_ARG_TYPE,v=l.ERR_STREAM_PUSH_AFTER_EOF,w=l.ERR_METHOD_NOT_IMPLEMENTED,E=l.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,A,O,C;c(9598)(I,u);var _=s.errorOrDestroy,T=["error","close","destroy","pause","resume"];function k(F,D,J){if(typeof F.prependListener=="function")return F.prependListener(D,J);!F._events||!F._events[D]?F.on(D,J):Array.isArray(F._events[D])?F._events[D].unshift(J):F._events[D]=[J,F._events[D]]}function R(F,D,J){b=b||c(2063),F=F||{},typeof J!="boolean"&&(J=D instanceof b),this.objectMode=!!F.objectMode,J&&(this.objectMode=this.objectMode||!!F.readableObjectMode),this.highWaterMark=p(this,F,"readableHighWaterMark",J),this.buffer=new o,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=F.emitClose!==!1,this.autoDestroy=!!F.autoDestroy,this.destroyed=!1,this.defaultEncoding=F.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,F.encoding&&(A||(A=c(634).I),this.decoder=new A(F.encoding),this.encoding=F.encoding)}function I(F){if(b=b||c(2063),!(this instanceof I))return new I(F);var D=this instanceof b;this._readableState=new R(F,this,D),this.readable=!0,F&&(typeof F.read=="function"&&(this._read=F.read),typeof F.destroy=="function"&&(this._destroy=F.destroy)),u.call(this)}Object.defineProperty(I.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(D){this._readableState&&(this._readableState.destroyed=D)}}),I.prototype.destroy=s.destroy,I.prototype._undestroy=s.undestroy,I.prototype._destroy=function(F,D){D(F)},I.prototype.push=function(F,D){var J=this._readableState,ie;return J.objectMode?ie=!0:typeof F=="string"&&(D=D||J.defaultEncoding,D!==J.encoding&&(F=f.from(F,D),D=""),ie=!0),L(this,F,D,!1,ie)},I.prototype.unshift=function(F){return L(this,F,null,!0,!1)};function L(F,D,J,ie,ue){e("readableAddChunk",D);var H=F._readableState;if(D===null)H.reading=!1,K(F,H);else{var V;if(ue||(V=B(H,D)),V)_(F,V);else if(H.objectMode||D&&D.length>0)if(typeof D!="string"&&!H.objectMode&&Object.getPrototypeOf(D)!==f.prototype&&(D=t(D)),ie)H.endEmitted?_(F,new E):P(F,H,D,!0);else if(H.ended)_(F,new v);else{if(H.destroyed)return!1;H.reading=!1,H.decoder&&!J?(D=H.decoder.write(D),H.objectMode||D.length!==0?P(F,H,D,!1):Y(F,H)):P(F,H,D,!1)}else ie||(H.reading=!1,Y(F,H))}return!H.ended&&(H.length<H.highWaterMark||H.length===0)}function P(F,D,J,ie){D.flowing&&D.length===0&&!D.sync?(D.awaitDrain=0,F.emit("data",J)):(D.length+=D.objectMode?1:J.length,ie?D.buffer.unshift(J):D.buffer.push(J),D.needReadable&&j(F)),Y(F,D)}function B(F,D){var J;return!r(D)&&typeof D!="string"&&D!==void 0&&!F.objectMode&&(J=new h("chunk",["string","Buffer","Uint8Array"],D)),J}I.prototype.isPaused=function(){return this._readableState.flowing===!1},I.prototype.setEncoding=function(F){A||(A=c(634).I);var D=new A(F);this._readableState.decoder=D,this._readableState.encoding=this._readableState.decoder.encoding;for(var J=this._readableState.buffer.head,ie="";J!==null;)ie+=D.write(J.data),J=J.next;return this._readableState.buffer.clear(),ie!==""&&this._readableState.buffer.push(ie),this._readableState.length=ie.length,this};var M=1073741824;function z(F){return F>=M?F=M:(F--,F|=F>>>1,F|=F>>>2,F|=F>>>4,F|=F>>>8,F|=F>>>16,F++),F}function $(F,D){return F<=0||D.length===0&&D.ended?0:D.objectMode?1:F!==F?D.flowing&&D.length?D.buffer.head.data.length:D.length:(F>D.highWaterMark&&(D.highWaterMark=z(F)),F<=D.length?F:D.ended?D.length:(D.needReadable=!0,0))}I.prototype.read=function(F){e("read",F),F=parseInt(F,10);var D=this._readableState,J=F;if(F!==0&&(D.emittedReadable=!1),F===0&&D.needReadable&&((D.highWaterMark!==0?D.length>=D.highWaterMark:D.length>0)||D.ended))return e("read: emitReadable",D.length,D.ended),D.length===0&&D.ended?W(this):j(this),null;if(F=$(F,D),F===0&&D.ended)return D.length===0&&W(this),null;var ie=D.needReadable;e("need readable",ie),(D.length===0||D.length-F<D.highWaterMark)&&(ie=!0,e("length less than watermark",ie)),D.ended||D.reading?(ie=!1,e("reading or ended",ie)):ie&&(e("do read"),D.reading=!0,D.sync=!0,D.length===0&&(D.needReadable=!0),this._read(D.highWaterMark),D.sync=!1,D.reading||(F=$(J,D)));var ue;return F>0?ue=N(F,D):ue=null,ue===null?(D.needReadable=D.length<=D.highWaterMark,F=0):(D.length-=F,D.awaitDrain=0),D.length===0&&(D.ended||(D.needReadable=!0),J!==F&&D.ended&&W(this)),ue!==null&&this.emit("data",ue),ue};function K(F,D){if(e("onEofChunk"),!D.ended){if(D.decoder){var J=D.decoder.end();J&&J.length&&(D.buffer.push(J),D.length+=D.objectMode?1:J.length)}D.ended=!0,D.sync?j(F):(D.needReadable=!1,D.emittedReadable||(D.emittedReadable=!0,Z(F)))}}function j(F){var D=F._readableState;e("emitReadable",D.needReadable,D.emittedReadable),D.needReadable=!1,D.emittedReadable||(e("emitReadable",D.flowing),D.emittedReadable=!0,process.nextTick(Z,F))}function Z(F){var D=F._readableState;e("emitReadable_",D.destroyed,D.length,D.ended),!D.destroyed&&(D.length||D.ended)&&(F.emit("readable"),D.emittedReadable=!1),D.needReadable=!D.flowing&&!D.ended&&D.length<=D.highWaterMark,U(F)}function Y(F,D){D.readingMore||(D.readingMore=!0,process.nextTick(ne,F,D))}function ne(F,D){for(;!D.reading&&!D.ended&&(D.length<D.highWaterMark||D.flowing&&D.length===0);){var J=D.length;if(e("maybeReadMore read 0"),F.read(0),J===D.length)break}D.readingMore=!1}I.prototype._read=function(F){_(this,new w("_read()"))},I.prototype.pipe=function(F,D){var J=this,ie=this._readableState;switch(ie.pipesCount){case 0:ie.pipes=F;break;case 1:ie.pipes=[ie.pipes,F];break;default:ie.pipes.push(F);break}ie.pipesCount+=1,e("pipe count=%d opts=%j",ie.pipesCount,D);var ue=(!D||D.end!==!1)&&F!==process.stdout&&F!==process.stderr,H=ue?ae:ge;ie.endEmitted?process.nextTick(H):J.once("end",H),F.on("unpipe",V);function V(Ee,Se){e("onunpipe"),Ee===J&&Se&&Se.hasUnpiped===!1&&(Se.hasUnpiped=!0,fe())}function ae(){e("onend"),F.end()}var se=le(J);F.on("drain",se);var oe=!1;function fe(){e("cleanup"),F.removeListener("close",ye),F.removeListener("finish",Ae),F.removeListener("drain",se),F.removeListener("error",pe),F.removeListener("unpipe",V),J.removeListener("end",ae),J.removeListener("end",ge),J.removeListener("data",he),oe=!0,ie.awaitDrain&&(!F._writableState||F._writableState.needDrain)&&se()}J.on("data",he);function he(Ee){e("ondata");var Se=F.write(Ee);e("dest.write",Se),Se===!1&&((ie.pipesCount===1&&ie.pipes===F||ie.pipesCount>1&&te(ie.pipes,F)!==-1)&&!oe&&(e("false write response, pause",ie.awaitDrain),ie.awaitDrain++),J.pause())}function pe(Ee){e("onerror",Ee),ge(),F.removeListener("error",pe),m(F,"error")===0&&_(F,Ee)}k(F,"error",pe);function ye(){F.removeListener("finish",Ae),ge()}F.once("close",ye);function Ae(){e("onfinish"),F.removeListener("close",ye),ge()}F.once("finish",Ae);function ge(){e("unpipe"),J.unpipe(F)}return F.emit("pipe",J),ie.flowing||(e("pipe resume"),J.resume()),F};function le(F){return function(){var J=F._readableState;e("pipeOnDrain",J.awaitDrain),J.awaitDrain&&J.awaitDrain--,J.awaitDrain===0&&m(F,"data")&&(J.flowing=!0,U(F))}}I.prototype.unpipe=function(F){var D=this._readableState,J={hasUnpiped:!1};if(D.pipesCount===0)return this;if(D.pipesCount===1)return F&&F!==D.pipes?this:(F||(F=D.pipes),D.pipes=null,D.pipesCount=0,D.flowing=!1,F&&F.emit("unpipe",this,J),this);if(!F){var ie=D.pipes,ue=D.pipesCount;D.pipes=null,D.pipesCount=0,D.flowing=!1;for(var H=0;H<ue;H++)ie[H].emit("unpipe",this,{hasUnpiped:!1});return this}var V=te(D.pipes,F);return V===-1?this:(D.pipes.splice(V,1),D.pipesCount-=1,D.pipesCount===1&&(D.pipes=D.pipes[0]),F.emit("unpipe",this,J),this)},I.prototype.on=function(F,D){var J=u.prototype.on.call(this,F,D),ie=this._readableState;return F==="data"?(ie.readableListening=this.listenerCount("readable")>0,ie.flowing!==!1&&this.resume()):F==="readable"&&!ie.endEmitted&&!ie.readableListening&&(ie.readableListening=ie.needReadable=!0,ie.flowing=!1,ie.emittedReadable=!1,e("on readable",ie.length,ie.reading),ie.length?j(this):ie.reading||process.nextTick(ce,this)),J},I.prototype.addListener=I.prototype.on,I.prototype.removeListener=function(F,D){var J=u.prototype.removeListener.call(this,F,D);return F==="readable"&&process.nextTick(re,this),J},I.prototype.removeAllListeners=function(F){var D=u.prototype.removeAllListeners.apply(this,arguments);return(F==="readable"||F===void 0)&&process.nextTick(re,this),D};function re(F){var D=F._readableState;D.readableListening=F.listenerCount("readable")>0,D.resumeScheduled&&!D.paused?D.flowing=!0:F.listenerCount("data")>0&&F.resume()}function ce(F){e("readable nexttick read 0"),F.read(0)}I.prototype.resume=function(){var F=this._readableState;return F.flowing||(e("resume"),F.flowing=!F.readableListening,ee(this,F)),F.paused=!1,this};function ee(F,D){D.resumeScheduled||(D.resumeScheduled=!0,process.nextTick(G,F,D))}function G(F,D){e("resume",D.reading),D.reading||F.read(0),D.resumeScheduled=!1,F.emit("resume"),U(F),D.flowing&&!D.reading&&F.read(0)}I.prototype.pause=function(){return e("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(e("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function U(F){var D=F._readableState;for(e("flow",D.flowing);D.flowing&&F.read()!==null;);}I.prototype.wrap=function(F){var D=this,J=this._readableState,ie=!1;F.on("end",function(){if(e("wrapped end"),J.decoder&&!J.ended){var V=J.decoder.end();V&&V.length&&D.push(V)}D.push(null)}),F.on("data",function(V){if(e("wrapped data"),J.decoder&&(V=J.decoder.write(V)),!(J.objectMode&&V==null)&&!(!J.objectMode&&(!V||!V.length))){var ae=D.push(V);ae||(ie=!0,F.pause())}});for(var ue in F)this[ue]===void 0&&typeof F[ue]=="function"&&(this[ue]=(function(ae){return function(){return F[ae].apply(F,arguments)}})(ue));for(var H=0;H<T.length;H++)F.on(T[H],this.emit.bind(this,T[H]));return this._read=function(V){e("wrapped _read",V),ie&&(ie=!1,F.resume())},this},typeof Symbol=="function"&&(I.prototype[Symbol.asyncIterator]=function(){return O===void 0&&(O=c(4868)),O(this)}),Object.defineProperty(I.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(I.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(I.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(D){this._readableState&&(this._readableState.flowing=D)}}),I._fromList=N,Object.defineProperty(I.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function N(F,D){if(D.length===0)return null;var J;return D.objectMode?J=D.buffer.shift():!F||F>=D.length?(D.decoder?J=D.buffer.join(""):D.buffer.length===1?J=D.buffer.first():J=D.buffer.concat(D.length),D.buffer.clear()):J=D.buffer.consume(F,D.decoder),J}function W(F){var D=F._readableState;e("endReadable",D.endEmitted),D.endEmitted||(D.ended=!0,process.nextTick(Q,D,F))}function Q(F,D){if(e("endReadableNT",F.endEmitted,F.length),!F.endEmitted&&F.length===0&&(F.endEmitted=!0,D.readable=!1,D.emit("end"),F.autoDestroy)){var J=D._writableState;(!J||J.autoDestroy&&J.finished)&&D.destroy()}}typeof Symbol=="function"&&(I.from=function(F,D){return C===void 0&&(C=c(4659)),C(I,F,D)});function te(F,D){for(var J=0,ie=F.length;J<ie;J++)if(F[J]===D)return J;return-1}}),2337:((S,d,c)=>{S.exports=r;var b=c(5500).F,g=b.ERR_METHOD_NOT_IMPLEMENTED,m=b.ERR_MULTIPLE_CALLBACK,u=b.ERR_TRANSFORM_ALREADY_TRANSFORMING,f=b.ERR_TRANSFORM_WITH_LENGTH_0,a=c(2063);c(9598)(r,a);function t(o,s){var i=this._transformState;i.transforming=!1;var p=i.writecb;if(p===null)return this.emit("error",new m);i.writechunk=null,i.writecb=null,s!=null&&this.push(s),p(o);var l=this._readableState;l.reading=!1,(l.needReadable||l.length<l.highWaterMark)&&this._read(l.highWaterMark)}function r(o){if(!(this instanceof r))return new r(o);a.call(this,o),this._transformState={afterTransform:t.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,o&&(typeof o.transform=="function"&&(this._transform=o.transform),typeof o.flush=="function"&&(this._flush=o.flush)),this.on("prefinish",n)}function n(){var o=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(s,i){e(o,s,i)}):e(this,null,null)}r.prototype.push=function(o,s){return this._transformState.needTransform=!1,a.prototype.push.call(this,o,s)},r.prototype._transform=function(o,s,i){i(new g("_transform()"))},r.prototype._write=function(o,s,i){var p=this._transformState;if(p.writecb=i,p.writechunk=o,p.writeencoding=s,!p.transforming){var l=this._readableState;(p.needTransform||l.needReadable||l.length<l.highWaterMark)&&this._read(l.highWaterMark)}},r.prototype._read=function(o){var s=this._transformState;s.writechunk!==null&&!s.transforming?(s.transforming=!0,this._transform(s.writechunk,s.writeencoding,s.afterTransform)):s.needTransform=!0},r.prototype._destroy=function(o,s){a.prototype._destroy.call(this,o,function(i){s(i)})};function e(o,s,i){if(s)return o.emit("error",s);if(i!=null&&o.push(i),o._writableState.length)throw new f;if(o._transformState.transforming)throw new u;return o.push(null)}}),8797:((S,d,c)=>{S.exports=R;function b(U,N,W){this.chunk=U,this.encoding=N,this.callback=W,this.next=null}function g(U){var N=this;this.next=null,this.entry=null,this.finish=function(){G(N,U)}}var m;R.WritableState=T;var u={deprecate:c(2107)},f=c(3283),a=c(181).Buffer,t=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function r(U){return a.from(U)}function n(U){return a.isBuffer(U)||U instanceof t}var e=c(5089),o=c(4874),s=o.getHighWaterMark,i=c(5500).F,p=i.ERR_INVALID_ARG_TYPE,l=i.ERR_METHOD_NOT_IMPLEMENTED,h=i.ERR_MULTIPLE_CALLBACK,v=i.ERR_STREAM_CANNOT_PIPE,w=i.ERR_STREAM_DESTROYED,E=i.ERR_STREAM_NULL_VALUES,A=i.ERR_STREAM_WRITE_AFTER_END,O=i.ERR_UNKNOWN_ENCODING,C=e.errorOrDestroy;c(9598)(R,f);function _(){}function T(U,N,W){m=m||c(2063),U=U||{},typeof W!="boolean"&&(W=N instanceof m),this.objectMode=!!U.objectMode,W&&(this.objectMode=this.objectMode||!!U.writableObjectMode),this.highWaterMark=s(this,U,"writableHighWaterMark",W),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var Q=U.decodeStrings===!1;this.decodeStrings=!Q,this.defaultEncoding=U.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(te){K(N,te)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=U.emitClose!==!1,this.autoDestroy=!!U.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new g(this)}T.prototype.getBuffer=function(){for(var N=this.bufferedRequest,W=[];N;)W.push(N),N=N.next;return W},(function(){try{Object.defineProperty(T.prototype,"buffer",{get:u.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var k;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(k=Function.prototype[Symbol.hasInstance],Object.defineProperty(R,Symbol.hasInstance,{value:function(N){return k.call(this,N)?!0:this!==R?!1:N&&N._writableState instanceof T}})):k=function(N){return N instanceof this};function R(U){m=m||c(2063);var N=this instanceof m;if(!N&&!k.call(R,this))return new R(U);this._writableState=new T(U,this,N),this.writable=!0,U&&(typeof U.write=="function"&&(this._write=U.write),typeof U.writev=="function"&&(this._writev=U.writev),typeof U.destroy=="function"&&(this._destroy=U.destroy),typeof U.final=="function"&&(this._final=U.final)),f.call(this)}R.prototype.pipe=function(){C(this,new v)};function I(U,N){var W=new A;C(U,W),process.nextTick(N,W)}function L(U,N,W,Q){var te;return W===null?te=new E:typeof W!="string"&&!N.objectMode&&(te=new p("chunk",["string","Buffer"],W)),te?(C(U,te),process.nextTick(Q,te),!1):!0}R.prototype.write=function(U,N,W){var Q=this._writableState,te=!1,F=!Q.objectMode&&n(U);return F&&!a.isBuffer(U)&&(U=r(U)),typeof N=="function"&&(W=N,N=null),F?N="buffer":N||(N=Q.defaultEncoding),typeof W!="function"&&(W=_),Q.ending?I(this,W):(F||L(this,Q,U,W))&&(Q.pendingcb++,te=B(this,Q,F,U,N,W)),te},R.prototype.cork=function(){this._writableState.corked++},R.prototype.uncork=function(){var U=this._writableState;U.corked&&(U.corked--,!U.writing&&!U.corked&&!U.bufferProcessing&&U.bufferedRequest&&Y(this,U))},R.prototype.setDefaultEncoding=function(N){if(typeof N=="string"&&(N=N.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((N+"").toLowerCase())>-1))throw new O(N);return this._writableState.defaultEncoding=N,this},Object.defineProperty(R.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function P(U,N,W){return!U.objectMode&&U.decodeStrings!==!1&&typeof N=="string"&&(N=a.from(N,W)),N}Object.defineProperty(R.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function B(U,N,W,Q,te,F){if(!W){var D=P(N,Q,te);Q!==D&&(W=!0,te="buffer",Q=D)}var J=N.objectMode?1:Q.length;N.length+=J;var ie=N.length<N.highWaterMark;if(ie||(N.needDrain=!0),N.writing||N.corked){var ue=N.lastBufferedRequest;N.lastBufferedRequest={chunk:Q,encoding:te,isBuf:W,callback:F,next:null},ue?ue.next=N.lastBufferedRequest:N.bufferedRequest=N.lastBufferedRequest,N.bufferedRequestCount+=1}else M(U,N,!1,J,Q,te,F);return ie}function M(U,N,W,Q,te,F,D){N.writelen=Q,N.writecb=D,N.writing=!0,N.sync=!0,N.destroyed?N.onwrite(new w("write")):W?U._writev(te,N.onwrite):U._write(te,F,N.onwrite),N.sync=!1}function z(U,N,W,Q,te){--N.pendingcb,W?(process.nextTick(te,Q),process.nextTick(ce,U,N),U._writableState.errorEmitted=!0,C(U,Q)):(te(Q),U._writableState.errorEmitted=!0,C(U,Q),ce(U,N))}function $(U){U.writing=!1,U.writecb=null,U.length-=U.writelen,U.writelen=0}function K(U,N){var W=U._writableState,Q=W.sync,te=W.writecb;if(typeof te!="function")throw new h;if($(W),N)z(U,W,Q,N,te);else{var F=ne(W)||U.destroyed;!F&&!W.corked&&!W.bufferProcessing&&W.bufferedRequest&&Y(U,W),Q?process.nextTick(j,U,W,F,te):j(U,W,F,te)}}function j(U,N,W,Q){W||Z(U,N),N.pendingcb--,Q(),ce(U,N)}function Z(U,N){N.length===0&&N.needDrain&&(N.needDrain=!1,U.emit("drain"))}function Y(U,N){N.bufferProcessing=!0;var W=N.bufferedRequest;if(U._writev&&W&&W.next){var Q=N.bufferedRequestCount,te=new Array(Q),F=N.corkedRequestsFree;F.entry=W;for(var D=0,J=!0;W;)te[D]=W,W.isBuf||(J=!1),W=W.next,D+=1;te.allBuffers=J,M(U,N,!0,N.length,te,"",F.finish),N.pendingcb++,N.lastBufferedRequest=null,F.next?(N.corkedRequestsFree=F.next,F.next=null):N.corkedRequestsFree=new g(N),N.bufferedRequestCount=0}else{for(;W;){var ie=W.chunk,ue=W.encoding,H=W.callback,V=N.objectMode?1:ie.length;if(M(U,N,!1,V,ie,ue,H),W=W.next,N.bufferedRequestCount--,N.writing)break}W===null&&(N.lastBufferedRequest=null)}N.bufferedRequest=W,N.bufferProcessing=!1}R.prototype._write=function(U,N,W){W(new l("_write()"))},R.prototype._writev=null,R.prototype.end=function(U,N,W){var Q=this._writableState;return typeof U=="function"?(W=U,U=null,N=null):typeof N=="function"&&(W=N,N=null),U!=null&&this.write(U,N),Q.corked&&(Q.corked=1,this.uncork()),Q.ending||ee(this,Q,W),this},Object.defineProperty(R.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function ne(U){return U.ending&&U.length===0&&U.bufferedRequest===null&&!U.finished&&!U.writing}function le(U,N){U._final(function(W){N.pendingcb--,W&&C(U,W),N.prefinished=!0,U.emit("prefinish"),ce(U,N)})}function re(U,N){!N.prefinished&&!N.finalCalled&&(typeof U._final=="function"&&!N.destroyed?(N.pendingcb++,N.finalCalled=!0,process.nextTick(le,U,N)):(N.prefinished=!0,U.emit("prefinish")))}function ce(U,N){var W=ne(N);if(W&&(re(U,N),N.pendingcb===0&&(N.finished=!0,U.emit("finish"),N.autoDestroy))){var Q=U._readableState;(!Q||Q.autoDestroy&&Q.endEmitted)&&U.destroy()}return W}function ee(U,N,W){N.ending=!0,ce(U,N),W&&(N.finished?process.nextTick(W):U.once("finish",W)),N.ended=!0,U.writable=!1}function G(U,N,W){var Q=U.entry;for(U.entry=null;Q;){var te=Q.callback;N.pendingcb--,te(W),Q=Q.next}N.corkedRequestsFree.next=U}Object.defineProperty(R.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(N){this._writableState&&(this._writableState.destroyed=N)}}),R.prototype.destroy=e.destroy,R.prototype._undestroy=e.undestroy,R.prototype._destroy=function(U,N){N(U)}}),4868:((S,d,c)=>{var b;function g(A,O,C){return O=m(O),O in A?Object.defineProperty(A,O,{value:C,enumerable:!0,configurable:!0,writable:!0}):A[O]=C,A}function m(A){var O=u(A,"string");return typeof O=="symbol"?O:String(O)}function u(A,O){if(typeof A!="object"||A===null)return A;var C=A[Symbol.toPrimitive];if(C!==void 0){var _=C.call(A,O||"default");if(typeof _!="object")return _;throw new TypeError("@@toPrimitive must return a primitive value.")}return(O==="string"?String:Number)(A)}var f=c(6815),a=Symbol("lastResolve"),t=Symbol("lastReject"),r=Symbol("error"),n=Symbol("ended"),e=Symbol("lastPromise"),o=Symbol("handlePromise"),s=Symbol("stream");function i(A,O){return{value:A,done:O}}function p(A){var O=A[a];if(O!==null){var C=A[s].read();C!==null&&(A[e]=null,A[a]=null,A[t]=null,O(i(C,!1)))}}function l(A){process.nextTick(p,A)}function h(A,O){return function(C,_){A.then(function(){if(O[n]){C(i(void 0,!0));return}O[o](C,_)},_)}}var v=Object.getPrototypeOf(function(){}),w=Object.setPrototypeOf((b={get stream(){return this[s]},next:function(){var O=this,C=this[r];if(C!==null)return Promise.reject(C);if(this[n])return Promise.resolve(i(void 0,!0));if(this[s].destroyed)return new Promise(function(R,I){process.nextTick(function(){O[r]?I(O[r]):R(i(void 0,!0))})});var _=this[e],T;if(_)T=new Promise(h(_,this));else{var k=this[s].read();if(k!==null)return Promise.resolve(i(k,!1));T=new Promise(this[o])}return this[e]=T,T}},g(b,Symbol.asyncIterator,function(){return this}),g(b,"return",function(){var O=this;return new Promise(function(C,_){O[s].destroy(null,function(T){if(T){_(T);return}C(i(void 0,!0))})})}),b),v),E=function(O){var C,_=Object.create(w,(C={},g(C,s,{value:O,writable:!0}),g(C,a,{value:null,writable:!0}),g(C,t,{value:null,writable:!0}),g(C,r,{value:null,writable:!0}),g(C,n,{value:O._readableState.endEmitted,writable:!0}),g(C,o,{value:function(k,R){var I=_[s].read();I?(_[e]=null,_[a]=null,_[t]=null,k(i(I,!1))):(_[a]=k,_[t]=R)},writable:!0}),C));return _[e]=null,f(O,function(T){if(T&&T.code!=="ERR_STREAM_PREMATURE_CLOSE"){var k=_[t];k!==null&&(_[e]=null,_[a]=null,_[t]=null,k(T)),_[r]=T;return}var R=_[a];R!==null&&(_[e]=null,_[a]=null,_[t]=null,R(i(void 0,!0))),_[n]=!0}),O.on("readable",l.bind(null,_)),_};S.exports=E}),7336:((S,d,c)=>{function b(l,h){var v=Object.keys(l);if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(l);h&&(w=w.filter(function(E){return Object.getOwnPropertyDescriptor(l,E).enumerable})),v.push.apply(v,w)}return v}function g(l){for(var h=1;h<arguments.length;h++){var v=arguments[h]!=null?arguments[h]:{};h%2?b(Object(v),!0).forEach(function(w){m(l,w,v[w])}):Object.getOwnPropertyDescriptors?Object.defineProperties(l,Object.getOwnPropertyDescriptors(v)):b(Object(v)).forEach(function(w){Object.defineProperty(l,w,Object.getOwnPropertyDescriptor(v,w))})}return l}function m(l,h,v){return h=t(h),h in l?Object.defineProperty(l,h,{value:v,enumerable:!0,configurable:!0,writable:!0}):l[h]=v,l}function u(l,h){if(!(l instanceof h))throw new TypeError("Cannot call a class as a function")}function f(l,h){for(var v=0;v<h.length;v++){var w=h[v];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(l,t(w.key),w)}}function a(l,h,v){return h&&f(l.prototype,h),v&&f(l,v),Object.defineProperty(l,"prototype",{writable:!1}),l}function t(l){var h=r(l,"string");return typeof h=="symbol"?h:String(h)}function r(l,h){if(typeof l!="object"||l===null)return l;var v=l[Symbol.toPrimitive];if(v!==void 0){var w=v.call(l,h||"default");if(typeof w!="object")return w;throw new TypeError("@@toPrimitive must return a primitive value.")}return(h==="string"?String:Number)(l)}var n=c(181),e=n.Buffer,o=c(9023),s=o.inspect,i=s&&s.custom||"inspect";function p(l,h,v){e.prototype.copy.call(l,h,v)}S.exports=(function(){function l(){u(this,l),this.head=null,this.tail=null,this.length=0}return a(l,[{key:"push",value:function(v){var w={data:v,next:null};this.length>0?this.tail.next=w:this.head=w,this.tail=w,++this.length}},{key:"unshift",value:function(v){var w={data:v,next:this.head};this.length===0&&(this.tail=w),this.head=w,++this.length}},{key:"shift",value:function(){if(this.length!==0){var v=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,v}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(v){if(this.length===0)return"";for(var w=this.head,E=""+w.data;w=w.next;)E+=v+w.data;return E}},{key:"concat",value:function(v){if(this.length===0)return e.alloc(0);for(var w=e.allocUnsafe(v>>>0),E=this.head,A=0;E;)p(E.data,w,A),A+=E.data.length,E=E.next;return w}},{key:"consume",value:function(v,w){var E;return v<this.head.data.length?(E=this.head.data.slice(0,v),this.head.data=this.head.data.slice(v)):v===this.head.data.length?E=this.shift():E=w?this._getString(v):this._getBuffer(v),E}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(v){var w=this.head,E=1,A=w.data;for(v-=A.length;w=w.next;){var O=w.data,C=v>O.length?O.length:v;if(C===O.length?A+=O:A+=O.slice(0,v),v-=C,v===0){C===O.length?(++E,w.next?this.head=w.next:this.head=this.tail=null):(this.head=w,w.data=O.slice(C));break}++E}return this.length-=E,A}},{key:"_getBuffer",value:function(v){var w=e.allocUnsafe(v),E=this.head,A=1;for(E.data.copy(w),v-=E.data.length;E=E.next;){var O=E.data,C=v>O.length?O.length:v;if(O.copy(w,w.length-v,0,C),v-=C,v===0){C===O.length?(++A,E.next?this.head=E.next:this.head=this.tail=null):(this.head=E,E.data=O.slice(C));break}++A}return this.length-=A,w}},{key:i,value:function(v,w){return s(this,g(g({},w),{},{depth:0,customInspect:!1}))}}]),l})()}),5089:(S=>{function d(f,a){var t=this,r=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return r||n?(a?a(f):f&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(m,this,f)):process.nextTick(m,this,f)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(f||null,function(e){!a&&e?t._writableState?t._writableState.errorEmitted?process.nextTick(b,t):(t._writableState.errorEmitted=!0,process.nextTick(c,t,e)):process.nextTick(c,t,e):a?(process.nextTick(b,t),a(e)):process.nextTick(b,t)}),this)}function c(f,a){m(f,a),b(f)}function b(f){f._writableState&&!f._writableState.emitClose||f._readableState&&!f._readableState.emitClose||f.emit("close")}function g(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function m(f,a){f.emit("error",a)}function u(f,a){var t=f._readableState,r=f._writableState;t&&t.autoDestroy||r&&r.autoDestroy?f.destroy(a):f.emit("error",a)}S.exports={destroy:d,undestroy:g,errorOrDestroy:u}}),6815:((S,d,c)=>{var b=c(5500).F.ERR_STREAM_PREMATURE_CLOSE;function g(a){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),e=0;e<r;e++)n[e]=arguments[e];a.apply(this,n)}}}function m(){}function u(a){return a.setHeader&&typeof a.abort=="function"}function f(a,t,r){if(typeof t=="function")return f(a,null,t);t||(t={}),r=g(r||m);var n=t.readable||t.readable!==!1&&a.readable,e=t.writable||t.writable!==!1&&a.writable,o=function(){a.writable||i()},s=a._writableState&&a._writableState.finished,i=function(){e=!1,s=!0,n||r.call(a)},p=a._readableState&&a._readableState.endEmitted,l=function(){n=!1,p=!0,e||r.call(a)},h=function(A){r.call(a,A)},v=function(){var A;if(n&&!p)return(!a._readableState||!a._readableState.ended)&&(A=new b),r.call(a,A);if(e&&!s)return(!a._writableState||!a._writableState.ended)&&(A=new b),r.call(a,A)},w=function(){a.req.on("finish",i)};return u(a)?(a.on("complete",i),a.on("abort",v),a.req?w():a.on("request",w)):e&&!a._writableState&&(a.on("end",o),a.on("close",o)),a.on("end",l),a.on("finish",i),t.error!==!1&&a.on("error",h),a.on("close",v),function(){a.removeListener("complete",i),a.removeListener("abort",v),a.removeListener("request",w),a.req&&a.req.removeListener("finish",i),a.removeListener("end",o),a.removeListener("close",o),a.removeListener("finish",i),a.removeListener("end",l),a.removeListener("error",h),a.removeListener("close",v)}}S.exports=f}),4659:((S,d,c)=>{function b(e,o,s,i,p,l,h){try{var v=e[l](h),w=v.value}catch(E){s(E);return}v.done?o(w):Promise.resolve(w).then(i,p)}function g(e){return function(){var o=this,s=arguments;return new Promise(function(i,p){var l=e.apply(o,s);function h(w){b(l,i,p,h,v,"next",w)}function v(w){b(l,i,p,h,v,"throw",w)}h(void 0)})}}function m(e,o){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);o&&(i=i.filter(function(p){return Object.getOwnPropertyDescriptor(e,p).enumerable})),s.push.apply(s,i)}return s}function u(e){for(var o=1;o<arguments.length;o++){var s=arguments[o]!=null?arguments[o]:{};o%2?m(Object(s),!0).forEach(function(i){f(e,i,s[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):m(Object(s)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(s,i))})}return e}function f(e,o,s){return o=a(o),o in e?Object.defineProperty(e,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[o]=s,e}function a(e){var o=t(e,"string");return typeof o=="symbol"?o:String(o)}function t(e,o){if(typeof e!="object"||e===null)return e;var s=e[Symbol.toPrimitive];if(s!==void 0){var i=s.call(e,o||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(e)}var r=c(5500).F.ERR_INVALID_ARG_TYPE;function n(e,o,s){var i;if(o&&typeof o.next=="function")i=o;else if(o&&o[Symbol.asyncIterator])i=o[Symbol.asyncIterator]();else if(o&&o[Symbol.iterator])i=o[Symbol.iterator]();else throw new r("iterable",["Iterable"],o);var p=new e(u({objectMode:!0},s)),l=!1;p._read=function(){l||(l=!0,h())};function h(){return v.apply(this,arguments)}function v(){return v=g(function*(){try{var w=yield i.next(),E=w.value,A=w.done;A?p.push(null):p.push(yield E)?h():l=!1}catch(O){p.destroy(O)}}),v.apply(this,arguments)}return p}S.exports=n}),6701:((S,d,c)=>{var b;function g(i){var p=!1;return function(){p||(p=!0,i.apply(void 0,arguments))}}var m=c(5500).F,u=m.ERR_MISSING_ARGS,f=m.ERR_STREAM_DESTROYED;function a(i){if(i)throw i}function t(i){return i.setHeader&&typeof i.abort=="function"}function r(i,p,l,h){h=g(h);var v=!1;i.on("close",function(){v=!0}),b===void 0&&(b=c(6815)),b(i,{readable:p,writable:l},function(E){if(E)return h(E);v=!0,h()});var w=!1;return function(E){if(!v&&!w){if(w=!0,t(i))return i.abort();if(typeof i.destroy=="function")return i.destroy();h(E||new f("pipe"))}}}function n(i){i()}function e(i,p){return i.pipe(p)}function o(i){return!i.length||typeof i[i.length-1]!="function"?a:i.pop()}function s(){for(var i=arguments.length,p=new Array(i),l=0;l<i;l++)p[l]=arguments[l];var h=o(p);if(Array.isArray(p[0])&&(p=p[0]),p.length<2)throw new u("streams");var v,w=p.map(function(E,A){var O=A<p.length-1,C=A>0;return r(E,O,C,function(_){v||(v=_),_&&w.forEach(n),!O&&(w.forEach(n),h(v))})});return p.reduce(e)}S.exports=s}),4874:((S,d,c)=>{var b=c(5500).F.ERR_INVALID_OPT_VALUE;function g(u,f,a){return u.highWaterMark!=null?u.highWaterMark:f?u[a]:null}function m(u,f,a,t){var r=g(f,t,a);if(r!=null){if(!(isFinite(r)&&Math.floor(r)===r)||r<0){var n=t?a:"highWaterMark";throw new b(n,r)}return Math.floor(r)}return u.objectMode?16:16*1024}S.exports={getHighWaterMark:m}}),3283:((S,d,c)=>{S.exports=c(2203)}),6131:((S,d,c)=>{var b=c(2203);process.env.READABLE_STREAM==="disable"&&b?(S.exports=b.Readable,Object.assign(S.exports,b),S.exports.Stream=b):(d=S.exports=c(6893),d.Stream=b||d,d.Readable=d,d.Writable=c(8797),d.Duplex=c(2063),d.Transform=c(2337),d.PassThrough=c(5283),d.finished=c(6815),d.pipeline=c(6701))}),3058:((S,d,c)=>{/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var b=c(181),g=b.Buffer;function m(f,a){for(var t in f)a[t]=f[t]}g.from&&g.alloc&&g.allocUnsafe&&g.allocUnsafeSlow?S.exports=b:(m(b,d),d.Buffer=u);function u(f,a,t){return g(f,a,t)}u.prototype=Object.create(g.prototype),m(g,u),u.from=function(f,a,t){if(typeof f=="number")throw new TypeError("Argument must not be a number");return g(f,a,t)},u.alloc=function(f,a,t){if(typeof f!="number")throw new TypeError("Argument must be a number");var r=g(f);return a!==void 0?typeof t=="string"?r.fill(a,t):r.fill(a):r.fill(0),r},u.allocUnsafe=function(f){if(typeof f!="number")throw new TypeError("Argument must be a number");return g(f)},u.allocUnsafeSlow=function(f){if(typeof f!="number")throw new TypeError("Argument must be a number");return b.SlowBuffer(f)}}),2803:((S,d,c)=>{var b=c(181),g=b.Buffer,m={},u;for(u in b)b.hasOwnProperty(u)&&(u==="SlowBuffer"||u==="Buffer"||(m[u]=b[u]));var f=m.Buffer={};for(u in g)g.hasOwnProperty(u)&&(u==="allocUnsafe"||u==="allocUnsafeSlow"||(f[u]=g[u]));if(m.Buffer.prototype=g.prototype,(!f.from||f.from===Uint8Array.from)&&(f.from=function(a,t,r){if(typeof a=="number")throw new TypeError('The "value" argument must not be of type number. Received type '+typeof a);if(a&&typeof a.length>"u")throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof a);return g(a,t,r)}),f.alloc||(f.alloc=function(a,t,r){if(typeof a!="number")throw new TypeError('The "size" argument must be of type number. Received type '+typeof a);if(a<0||a>=2*(1<<30))throw new RangeError('The value "'+a+'" is invalid for option "size"');var n=g(a);return!t||t.length===0?n.fill(0):typeof r=="string"?n.fill(t,r):n.fill(t),n}),!m.kStringMaxLength)try{m.kStringMaxLength=process.binding("buffer").kStringMaxLength}catch{}m.constants||(m.constants={MAX_LENGTH:m.kMaxLength},m.kStringMaxLength&&(m.constants.MAX_STRING_LENGTH=m.kStringMaxLength)),S.exports=m}),814:((S,d,c)=>{/*!
|
|
278
|
+
*/var b=o(),g=c(4531),m=c(8024),u=c(1748),f=c(6367);S.exports=r;var a=/^Encoding not recognized: /;function t(i){if(!i)return null;try{return u.getDecoder(i)}catch(p){throw a.test(p.message)?m(415,"specified encoding unsupported",{encoding:i,type:"encoding.unsupported"}):p}}function r(i,p,l){var h=l,v=p||{};if(i===void 0)throw new TypeError("argument stream is required");if(typeof i!="object"||i===null||typeof i.on!="function")throw new TypeError("argument stream must be a stream");if((p===!0||typeof p=="string")&&(v={encoding:p}),typeof p=="function"&&(h=p,v={}),h!==void 0&&typeof h!="function")throw new TypeError("argument callback must be a function");if(!h&&!global.Promise)throw new TypeError("argument callback is required");var w=v.encoding!==!0?v.encoding:"utf-8",E=g.parse(v.limit),A=v.length!=null&&!isNaN(v.length)?parseInt(v.length,10):null;return h?e(i,w,A,E,s(h)):new Promise(function(C,_){e(i,w,A,E,function(k,R){if(k)return _(k);C(R)})})}function n(i){f(i),typeof i.pause=="function"&&i.pause()}function e(i,p,l,h,v){var w=!1,E=!0;if(h!==null&&l!==null&&l>h)return T(m(413,"request entity too large",{expected:l,length:l,limit:h,type:"entity.too.large"}));var A=i._readableState;if(i._decoder||A&&(A.encoding||A.decoder))return T(m(500,"stream encoding should not be set",{type:"stream.encoding.set"}));if(typeof i.readable<"u"&&!i.readable)return T(m(500,"stream is not readable",{type:"stream.not.readable"}));var O=0,C;try{C=t(p)}catch(P){return T(P)}var _=C?"":[];i.on("aborted",k),i.on("close",L),i.on("data",R),i.on("end",I),i.on("error",I),E=!1;function T(){for(var P=new Array(arguments.length),B=0;B<P.length;B++)P[B]=arguments[B];w=!0,E?process.nextTick(M):M();function M(){L(),P[0]&&n(i),v.apply(null,P)}}function k(){w||T(m(400,"request aborted",{code:"ECONNABORTED",expected:l,length:l,received:O,type:"request.aborted"}))}function R(P){w||(O+=P.length,h!==null&&O>h?T(m(413,"request entity too large",{limit:h,received:O,type:"entity.too.large"})):C?_+=C.write(P):_.push(P))}function I(P){if(!w){if(P)return T(P);if(l!==null&&O!==l)T(m(400,"request size did not match content length",{expected:l,length:l,received:O,type:"request.size.invalid"}));else{var B=C?_+(C.end()||""):Buffer.concat(_);T(null,B)}}}function L(){_=null,i.removeListener("aborted",k),i.removeListener("data",R),i.removeListener("end",I),i.removeListener("error",I),i.removeListener("close",L)}}function o(){try{return c(290)}catch{return{}}}function s(i){var p;return b.AsyncResource&&(p=new b.AsyncResource(i.name||"bound-anonymous-fn")),!p||!p.runInAsyncScope?i:p.runInAsyncScope.bind(p,i,null)}}),5500:(S=>{const d={};function c(f,a,t){t||(t=Error);function r(e,o,s){return typeof a=="string"?a:a(e,o,s)}class n extends t{constructor(o,s,i){super(r(o,s,i))}}n.prototype.name=t.name,n.prototype.code=f,d[f]=n}function b(f,a){if(Array.isArray(f)){const t=f.length;return f=f.map(r=>String(r)),t>2?`one of ${a} ${f.slice(0,t-1).join(", ")}, or `+f[t-1]:t===2?`one of ${a} ${f[0]} or ${f[1]}`:`of ${a} ${f[0]}`}else return`of ${a} ${String(f)}`}function g(f,a,t){return f.substr(!t||t<0?0:+t,a.length)===a}function m(f,a,t){return(t===void 0||t>f.length)&&(t=f.length),f.substring(t-a.length,t)===a}function u(f,a,t){return typeof t!="number"&&(t=0),t+a.length>f.length?!1:f.indexOf(a,t)!==-1}c("ERR_INVALID_OPT_VALUE",function(f,a){return'The value "'+a+'" is invalid for option "'+f+'"'},TypeError),c("ERR_INVALID_ARG_TYPE",function(f,a,t){let r;typeof a=="string"&&g(a,"not ")?(r="must not be",a=a.replace(/^not /,"")):r="must be";let n;if(m(f," argument"))n=`The ${f} ${r} ${b(a,"type")}`;else{const e=u(f,".")?"property":"argument";n=`The "${f}" ${e} ${r} ${b(a,"type")}`}return n+=`. Received type ${typeof t}`,n},TypeError),c("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),c("ERR_METHOD_NOT_IMPLEMENTED",function(f){return"The "+f+" method is not implemented"}),c("ERR_STREAM_PREMATURE_CLOSE","Premature close"),c("ERR_STREAM_DESTROYED",function(f){return"Cannot call "+f+" after a stream was destroyed"}),c("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),c("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),c("ERR_STREAM_WRITE_AFTER_END","write after end"),c("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),c("ERR_UNKNOWN_ENCODING",function(f){return"Unknown encoding: "+f},TypeError),c("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),S.exports.F=d}),2063:((S,d,c)=>{var b=Object.keys||function(e){var o=[];for(var s in e)o.push(s);return o};S.exports=t;var g=c(6893),m=c(8797);c(9598)(t,g);for(var u=b(m.prototype),f=0;f<u.length;f++){var a=u[f];t.prototype[a]||(t.prototype[a]=m.prototype[a])}function t(e){if(!(this instanceof t))return new t(e);g.call(this,e),m.call(this,e),this.allowHalfOpen=!0,e&&(e.readable===!1&&(this.readable=!1),e.writable===!1&&(this.writable=!1),e.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",r)))}Object.defineProperty(t.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(t.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(t.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function r(){this._writableState.ended||process.nextTick(n,this)}function n(e){e.end()}Object.defineProperty(t.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(o){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=o,this._writableState.destroyed=o)}})}),5283:((S,d,c)=>{S.exports=g;var b=c(2337);c(9598)(g,b);function g(m){if(!(this instanceof g))return new g(m);b.call(this,m)}g.prototype._transform=function(m,u,f){f(null,m)}}),6893:((S,d,c)=>{S.exports=I;var b;I.ReadableState=R;var g=c(4434).EventEmitter,m=function(D,X){return D.listeners(X).length},u=c(3283),f=c(181).Buffer,a=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function t(F){return f.from(F)}function r(F){return f.isBuffer(F)||F instanceof a}var n=c(9023),e;n&&n.debuglog?e=n.debuglog("stream"):e=function(){};var o=c(7336),s=c(5089),i=c(4874),p=i.getHighWaterMark,l=c(5500).F,h=l.ERR_INVALID_ARG_TYPE,v=l.ERR_STREAM_PUSH_AFTER_EOF,w=l.ERR_METHOD_NOT_IMPLEMENTED,E=l.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,A,O,C;c(9598)(I,u);var _=s.errorOrDestroy,T=["error","close","destroy","pause","resume"];function k(F,D,X){if(typeof F.prependListener=="function")return F.prependListener(D,X);!F._events||!F._events[D]?F.on(D,X):Array.isArray(F._events[D])?F._events[D].unshift(X):F._events[D]=[X,F._events[D]]}function R(F,D,X){b=b||c(2063),F=F||{},typeof X!="boolean"&&(X=D instanceof b),this.objectMode=!!F.objectMode,X&&(this.objectMode=this.objectMode||!!F.readableObjectMode),this.highWaterMark=p(this,F,"readableHighWaterMark",X),this.buffer=new o,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=F.emitClose!==!1,this.autoDestroy=!!F.autoDestroy,this.destroyed=!1,this.defaultEncoding=F.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,F.encoding&&(A||(A=c(634).I),this.decoder=new A(F.encoding),this.encoding=F.encoding)}function I(F){if(b=b||c(2063),!(this instanceof I))return new I(F);var D=this instanceof b;this._readableState=new R(F,this,D),this.readable=!0,F&&(typeof F.read=="function"&&(this._read=F.read),typeof F.destroy=="function"&&(this._destroy=F.destroy)),u.call(this)}Object.defineProperty(I.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(D){this._readableState&&(this._readableState.destroyed=D)}}),I.prototype.destroy=s.destroy,I.prototype._undestroy=s.undestroy,I.prototype._destroy=function(F,D){D(F)},I.prototype.push=function(F,D){var X=this._readableState,ie;return X.objectMode?ie=!0:typeof F=="string"&&(D=D||X.defaultEncoding,D!==X.encoding&&(F=f.from(F,D),D=""),ie=!0),L(this,F,D,!1,ie)},I.prototype.unshift=function(F){return L(this,F,null,!0,!1)};function L(F,D,X,ie,ue){e("readableAddChunk",D);var H=F._readableState;if(D===null)H.reading=!1,K(F,H);else{var V;if(ue||(V=B(H,D)),V)_(F,V);else if(H.objectMode||D&&D.length>0)if(typeof D!="string"&&!H.objectMode&&Object.getPrototypeOf(D)!==f.prototype&&(D=t(D)),ie)H.endEmitted?_(F,new E):P(F,H,D,!0);else if(H.ended)_(F,new v);else{if(H.destroyed)return!1;H.reading=!1,H.decoder&&!X?(D=H.decoder.write(D),H.objectMode||D.length!==0?P(F,H,D,!1):Y(F,H)):P(F,H,D,!1)}else ie||(H.reading=!1,Y(F,H))}return!H.ended&&(H.length<H.highWaterMark||H.length===0)}function P(F,D,X,ie){D.flowing&&D.length===0&&!D.sync?(D.awaitDrain=0,F.emit("data",X)):(D.length+=D.objectMode?1:X.length,ie?D.buffer.unshift(X):D.buffer.push(X),D.needReadable&&j(F)),Y(F,D)}function B(F,D){var X;return!r(D)&&typeof D!="string"&&D!==void 0&&!F.objectMode&&(X=new h("chunk",["string","Buffer","Uint8Array"],D)),X}I.prototype.isPaused=function(){return this._readableState.flowing===!1},I.prototype.setEncoding=function(F){A||(A=c(634).I);var D=new A(F);this._readableState.decoder=D,this._readableState.encoding=this._readableState.decoder.encoding;for(var X=this._readableState.buffer.head,ie="";X!==null;)ie+=D.write(X.data),X=X.next;return this._readableState.buffer.clear(),ie!==""&&this._readableState.buffer.push(ie),this._readableState.length=ie.length,this};var M=1073741824;function z(F){return F>=M?F=M:(F--,F|=F>>>1,F|=F>>>2,F|=F>>>4,F|=F>>>8,F|=F>>>16,F++),F}function $(F,D){return F<=0||D.length===0&&D.ended?0:D.objectMode?1:F!==F?D.flowing&&D.length?D.buffer.head.data.length:D.length:(F>D.highWaterMark&&(D.highWaterMark=z(F)),F<=D.length?F:D.ended?D.length:(D.needReadable=!0,0))}I.prototype.read=function(F){e("read",F),F=parseInt(F,10);var D=this._readableState,X=F;if(F!==0&&(D.emittedReadable=!1),F===0&&D.needReadable&&((D.highWaterMark!==0?D.length>=D.highWaterMark:D.length>0)||D.ended))return e("read: emitReadable",D.length,D.ended),D.length===0&&D.ended?W(this):j(this),null;if(F=$(F,D),F===0&&D.ended)return D.length===0&&W(this),null;var ie=D.needReadable;e("need readable",ie),(D.length===0||D.length-F<D.highWaterMark)&&(ie=!0,e("length less than watermark",ie)),D.ended||D.reading?(ie=!1,e("reading or ended",ie)):ie&&(e("do read"),D.reading=!0,D.sync=!0,D.length===0&&(D.needReadable=!0),this._read(D.highWaterMark),D.sync=!1,D.reading||(F=$(X,D)));var ue;return F>0?ue=N(F,D):ue=null,ue===null?(D.needReadable=D.length<=D.highWaterMark,F=0):(D.length-=F,D.awaitDrain=0),D.length===0&&(D.ended||(D.needReadable=!0),X!==F&&D.ended&&W(this)),ue!==null&&this.emit("data",ue),ue};function K(F,D){if(e("onEofChunk"),!D.ended){if(D.decoder){var X=D.decoder.end();X&&X.length&&(D.buffer.push(X),D.length+=D.objectMode?1:X.length)}D.ended=!0,D.sync?j(F):(D.needReadable=!1,D.emittedReadable||(D.emittedReadable=!0,Z(F)))}}function j(F){var D=F._readableState;e("emitReadable",D.needReadable,D.emittedReadable),D.needReadable=!1,D.emittedReadable||(e("emitReadable",D.flowing),D.emittedReadable=!0,process.nextTick(Z,F))}function Z(F){var D=F._readableState;e("emitReadable_",D.destroyed,D.length,D.ended),!D.destroyed&&(D.length||D.ended)&&(F.emit("readable"),D.emittedReadable=!1),D.needReadable=!D.flowing&&!D.ended&&D.length<=D.highWaterMark,U(F)}function Y(F,D){D.readingMore||(D.readingMore=!0,process.nextTick(ne,F,D))}function ne(F,D){for(;!D.reading&&!D.ended&&(D.length<D.highWaterMark||D.flowing&&D.length===0);){var X=D.length;if(e("maybeReadMore read 0"),F.read(0),X===D.length)break}D.readingMore=!1}I.prototype._read=function(F){_(this,new w("_read()"))},I.prototype.pipe=function(F,D){var X=this,ie=this._readableState;switch(ie.pipesCount){case 0:ie.pipes=F;break;case 1:ie.pipes=[ie.pipes,F];break;default:ie.pipes.push(F);break}ie.pipesCount+=1,e("pipe count=%d opts=%j",ie.pipesCount,D);var ue=(!D||D.end!==!1)&&F!==process.stdout&&F!==process.stderr,H=ue?ae:ge;ie.endEmitted?process.nextTick(H):X.once("end",H),F.on("unpipe",V);function V(Ee,Se){e("onunpipe"),Ee===X&&Se&&Se.hasUnpiped===!1&&(Se.hasUnpiped=!0,fe())}function ae(){e("onend"),F.end()}var se=le(X);F.on("drain",se);var oe=!1;function fe(){e("cleanup"),F.removeListener("close",ye),F.removeListener("finish",Ae),F.removeListener("drain",se),F.removeListener("error",pe),F.removeListener("unpipe",V),X.removeListener("end",ae),X.removeListener("end",ge),X.removeListener("data",he),oe=!0,ie.awaitDrain&&(!F._writableState||F._writableState.needDrain)&&se()}X.on("data",he);function he(Ee){e("ondata");var Se=F.write(Ee);e("dest.write",Se),Se===!1&&((ie.pipesCount===1&&ie.pipes===F||ie.pipesCount>1&&te(ie.pipes,F)!==-1)&&!oe&&(e("false write response, pause",ie.awaitDrain),ie.awaitDrain++),X.pause())}function pe(Ee){e("onerror",Ee),ge(),F.removeListener("error",pe),m(F,"error")===0&&_(F,Ee)}k(F,"error",pe);function ye(){F.removeListener("finish",Ae),ge()}F.once("close",ye);function Ae(){e("onfinish"),F.removeListener("close",ye),ge()}F.once("finish",Ae);function ge(){e("unpipe"),X.unpipe(F)}return F.emit("pipe",X),ie.flowing||(e("pipe resume"),X.resume()),F};function le(F){return function(){var X=F._readableState;e("pipeOnDrain",X.awaitDrain),X.awaitDrain&&X.awaitDrain--,X.awaitDrain===0&&m(F,"data")&&(X.flowing=!0,U(F))}}I.prototype.unpipe=function(F){var D=this._readableState,X={hasUnpiped:!1};if(D.pipesCount===0)return this;if(D.pipesCount===1)return F&&F!==D.pipes?this:(F||(F=D.pipes),D.pipes=null,D.pipesCount=0,D.flowing=!1,F&&F.emit("unpipe",this,X),this);if(!F){var ie=D.pipes,ue=D.pipesCount;D.pipes=null,D.pipesCount=0,D.flowing=!1;for(var H=0;H<ue;H++)ie[H].emit("unpipe",this,{hasUnpiped:!1});return this}var V=te(D.pipes,F);return V===-1?this:(D.pipes.splice(V,1),D.pipesCount-=1,D.pipesCount===1&&(D.pipes=D.pipes[0]),F.emit("unpipe",this,X),this)},I.prototype.on=function(F,D){var X=u.prototype.on.call(this,F,D),ie=this._readableState;return F==="data"?(ie.readableListening=this.listenerCount("readable")>0,ie.flowing!==!1&&this.resume()):F==="readable"&&!ie.endEmitted&&!ie.readableListening&&(ie.readableListening=ie.needReadable=!0,ie.flowing=!1,ie.emittedReadable=!1,e("on readable",ie.length,ie.reading),ie.length?j(this):ie.reading||process.nextTick(ce,this)),X},I.prototype.addListener=I.prototype.on,I.prototype.removeListener=function(F,D){var X=u.prototype.removeListener.call(this,F,D);return F==="readable"&&process.nextTick(re,this),X},I.prototype.removeAllListeners=function(F){var D=u.prototype.removeAllListeners.apply(this,arguments);return(F==="readable"||F===void 0)&&process.nextTick(re,this),D};function re(F){var D=F._readableState;D.readableListening=F.listenerCount("readable")>0,D.resumeScheduled&&!D.paused?D.flowing=!0:F.listenerCount("data")>0&&F.resume()}function ce(F){e("readable nexttick read 0"),F.read(0)}I.prototype.resume=function(){var F=this._readableState;return F.flowing||(e("resume"),F.flowing=!F.readableListening,ee(this,F)),F.paused=!1,this};function ee(F,D){D.resumeScheduled||(D.resumeScheduled=!0,process.nextTick(G,F,D))}function G(F,D){e("resume",D.reading),D.reading||F.read(0),D.resumeScheduled=!1,F.emit("resume"),U(F),D.flowing&&!D.reading&&F.read(0)}I.prototype.pause=function(){return e("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(e("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function U(F){var D=F._readableState;for(e("flow",D.flowing);D.flowing&&F.read()!==null;);}I.prototype.wrap=function(F){var D=this,X=this._readableState,ie=!1;F.on("end",function(){if(e("wrapped end"),X.decoder&&!X.ended){var V=X.decoder.end();V&&V.length&&D.push(V)}D.push(null)}),F.on("data",function(V){if(e("wrapped data"),X.decoder&&(V=X.decoder.write(V)),!(X.objectMode&&V==null)&&!(!X.objectMode&&(!V||!V.length))){var ae=D.push(V);ae||(ie=!0,F.pause())}});for(var ue in F)this[ue]===void 0&&typeof F[ue]=="function"&&(this[ue]=(function(ae){return function(){return F[ae].apply(F,arguments)}})(ue));for(var H=0;H<T.length;H++)F.on(T[H],this.emit.bind(this,T[H]));return this._read=function(V){e("wrapped _read",V),ie&&(ie=!1,F.resume())},this},typeof Symbol=="function"&&(I.prototype[Symbol.asyncIterator]=function(){return O===void 0&&(O=c(4868)),O(this)}),Object.defineProperty(I.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(I.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(I.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(D){this._readableState&&(this._readableState.flowing=D)}}),I._fromList=N,Object.defineProperty(I.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function N(F,D){if(D.length===0)return null;var X;return D.objectMode?X=D.buffer.shift():!F||F>=D.length?(D.decoder?X=D.buffer.join(""):D.buffer.length===1?X=D.buffer.first():X=D.buffer.concat(D.length),D.buffer.clear()):X=D.buffer.consume(F,D.decoder),X}function W(F){var D=F._readableState;e("endReadable",D.endEmitted),D.endEmitted||(D.ended=!0,process.nextTick(Q,D,F))}function Q(F,D){if(e("endReadableNT",F.endEmitted,F.length),!F.endEmitted&&F.length===0&&(F.endEmitted=!0,D.readable=!1,D.emit("end"),F.autoDestroy)){var X=D._writableState;(!X||X.autoDestroy&&X.finished)&&D.destroy()}}typeof Symbol=="function"&&(I.from=function(F,D){return C===void 0&&(C=c(4659)),C(I,F,D)});function te(F,D){for(var X=0,ie=F.length;X<ie;X++)if(F[X]===D)return X;return-1}}),2337:((S,d,c)=>{S.exports=r;var b=c(5500).F,g=b.ERR_METHOD_NOT_IMPLEMENTED,m=b.ERR_MULTIPLE_CALLBACK,u=b.ERR_TRANSFORM_ALREADY_TRANSFORMING,f=b.ERR_TRANSFORM_WITH_LENGTH_0,a=c(2063);c(9598)(r,a);function t(o,s){var i=this._transformState;i.transforming=!1;var p=i.writecb;if(p===null)return this.emit("error",new m);i.writechunk=null,i.writecb=null,s!=null&&this.push(s),p(o);var l=this._readableState;l.reading=!1,(l.needReadable||l.length<l.highWaterMark)&&this._read(l.highWaterMark)}function r(o){if(!(this instanceof r))return new r(o);a.call(this,o),this._transformState={afterTransform:t.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,o&&(typeof o.transform=="function"&&(this._transform=o.transform),typeof o.flush=="function"&&(this._flush=o.flush)),this.on("prefinish",n)}function n(){var o=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(s,i){e(o,s,i)}):e(this,null,null)}r.prototype.push=function(o,s){return this._transformState.needTransform=!1,a.prototype.push.call(this,o,s)},r.prototype._transform=function(o,s,i){i(new g("_transform()"))},r.prototype._write=function(o,s,i){var p=this._transformState;if(p.writecb=i,p.writechunk=o,p.writeencoding=s,!p.transforming){var l=this._readableState;(p.needTransform||l.needReadable||l.length<l.highWaterMark)&&this._read(l.highWaterMark)}},r.prototype._read=function(o){var s=this._transformState;s.writechunk!==null&&!s.transforming?(s.transforming=!0,this._transform(s.writechunk,s.writeencoding,s.afterTransform)):s.needTransform=!0},r.prototype._destroy=function(o,s){a.prototype._destroy.call(this,o,function(i){s(i)})};function e(o,s,i){if(s)return o.emit("error",s);if(i!=null&&o.push(i),o._writableState.length)throw new f;if(o._transformState.transforming)throw new u;return o.push(null)}}),8797:((S,d,c)=>{S.exports=R;function b(U,N,W){this.chunk=U,this.encoding=N,this.callback=W,this.next=null}function g(U){var N=this;this.next=null,this.entry=null,this.finish=function(){G(N,U)}}var m;R.WritableState=T;var u={deprecate:c(2107)},f=c(3283),a=c(181).Buffer,t=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function r(U){return a.from(U)}function n(U){return a.isBuffer(U)||U instanceof t}var e=c(5089),o=c(4874),s=o.getHighWaterMark,i=c(5500).F,p=i.ERR_INVALID_ARG_TYPE,l=i.ERR_METHOD_NOT_IMPLEMENTED,h=i.ERR_MULTIPLE_CALLBACK,v=i.ERR_STREAM_CANNOT_PIPE,w=i.ERR_STREAM_DESTROYED,E=i.ERR_STREAM_NULL_VALUES,A=i.ERR_STREAM_WRITE_AFTER_END,O=i.ERR_UNKNOWN_ENCODING,C=e.errorOrDestroy;c(9598)(R,f);function _(){}function T(U,N,W){m=m||c(2063),U=U||{},typeof W!="boolean"&&(W=N instanceof m),this.objectMode=!!U.objectMode,W&&(this.objectMode=this.objectMode||!!U.writableObjectMode),this.highWaterMark=s(this,U,"writableHighWaterMark",W),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var Q=U.decodeStrings===!1;this.decodeStrings=!Q,this.defaultEncoding=U.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(te){K(N,te)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=U.emitClose!==!1,this.autoDestroy=!!U.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new g(this)}T.prototype.getBuffer=function(){for(var N=this.bufferedRequest,W=[];N;)W.push(N),N=N.next;return W},(function(){try{Object.defineProperty(T.prototype,"buffer",{get:u.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var k;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(k=Function.prototype[Symbol.hasInstance],Object.defineProperty(R,Symbol.hasInstance,{value:function(N){return k.call(this,N)?!0:this!==R?!1:N&&N._writableState instanceof T}})):k=function(N){return N instanceof this};function R(U){m=m||c(2063);var N=this instanceof m;if(!N&&!k.call(R,this))return new R(U);this._writableState=new T(U,this,N),this.writable=!0,U&&(typeof U.write=="function"&&(this._write=U.write),typeof U.writev=="function"&&(this._writev=U.writev),typeof U.destroy=="function"&&(this._destroy=U.destroy),typeof U.final=="function"&&(this._final=U.final)),f.call(this)}R.prototype.pipe=function(){C(this,new v)};function I(U,N){var W=new A;C(U,W),process.nextTick(N,W)}function L(U,N,W,Q){var te;return W===null?te=new E:typeof W!="string"&&!N.objectMode&&(te=new p("chunk",["string","Buffer"],W)),te?(C(U,te),process.nextTick(Q,te),!1):!0}R.prototype.write=function(U,N,W){var Q=this._writableState,te=!1,F=!Q.objectMode&&n(U);return F&&!a.isBuffer(U)&&(U=r(U)),typeof N=="function"&&(W=N,N=null),F?N="buffer":N||(N=Q.defaultEncoding),typeof W!="function"&&(W=_),Q.ending?I(this,W):(F||L(this,Q,U,W))&&(Q.pendingcb++,te=B(this,Q,F,U,N,W)),te},R.prototype.cork=function(){this._writableState.corked++},R.prototype.uncork=function(){var U=this._writableState;U.corked&&(U.corked--,!U.writing&&!U.corked&&!U.bufferProcessing&&U.bufferedRequest&&Y(this,U))},R.prototype.setDefaultEncoding=function(N){if(typeof N=="string"&&(N=N.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((N+"").toLowerCase())>-1))throw new O(N);return this._writableState.defaultEncoding=N,this},Object.defineProperty(R.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function P(U,N,W){return!U.objectMode&&U.decodeStrings!==!1&&typeof N=="string"&&(N=a.from(N,W)),N}Object.defineProperty(R.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function B(U,N,W,Q,te,F){if(!W){var D=P(N,Q,te);Q!==D&&(W=!0,te="buffer",Q=D)}var X=N.objectMode?1:Q.length;N.length+=X;var ie=N.length<N.highWaterMark;if(ie||(N.needDrain=!0),N.writing||N.corked){var ue=N.lastBufferedRequest;N.lastBufferedRequest={chunk:Q,encoding:te,isBuf:W,callback:F,next:null},ue?ue.next=N.lastBufferedRequest:N.bufferedRequest=N.lastBufferedRequest,N.bufferedRequestCount+=1}else M(U,N,!1,X,Q,te,F);return ie}function M(U,N,W,Q,te,F,D){N.writelen=Q,N.writecb=D,N.writing=!0,N.sync=!0,N.destroyed?N.onwrite(new w("write")):W?U._writev(te,N.onwrite):U._write(te,F,N.onwrite),N.sync=!1}function z(U,N,W,Q,te){--N.pendingcb,W?(process.nextTick(te,Q),process.nextTick(ce,U,N),U._writableState.errorEmitted=!0,C(U,Q)):(te(Q),U._writableState.errorEmitted=!0,C(U,Q),ce(U,N))}function $(U){U.writing=!1,U.writecb=null,U.length-=U.writelen,U.writelen=0}function K(U,N){var W=U._writableState,Q=W.sync,te=W.writecb;if(typeof te!="function")throw new h;if($(W),N)z(U,W,Q,N,te);else{var F=ne(W)||U.destroyed;!F&&!W.corked&&!W.bufferProcessing&&W.bufferedRequest&&Y(U,W),Q?process.nextTick(j,U,W,F,te):j(U,W,F,te)}}function j(U,N,W,Q){W||Z(U,N),N.pendingcb--,Q(),ce(U,N)}function Z(U,N){N.length===0&&N.needDrain&&(N.needDrain=!1,U.emit("drain"))}function Y(U,N){N.bufferProcessing=!0;var W=N.bufferedRequest;if(U._writev&&W&&W.next){var Q=N.bufferedRequestCount,te=new Array(Q),F=N.corkedRequestsFree;F.entry=W;for(var D=0,X=!0;W;)te[D]=W,W.isBuf||(X=!1),W=W.next,D+=1;te.allBuffers=X,M(U,N,!0,N.length,te,"",F.finish),N.pendingcb++,N.lastBufferedRequest=null,F.next?(N.corkedRequestsFree=F.next,F.next=null):N.corkedRequestsFree=new g(N),N.bufferedRequestCount=0}else{for(;W;){var ie=W.chunk,ue=W.encoding,H=W.callback,V=N.objectMode?1:ie.length;if(M(U,N,!1,V,ie,ue,H),W=W.next,N.bufferedRequestCount--,N.writing)break}W===null&&(N.lastBufferedRequest=null)}N.bufferedRequest=W,N.bufferProcessing=!1}R.prototype._write=function(U,N,W){W(new l("_write()"))},R.prototype._writev=null,R.prototype.end=function(U,N,W){var Q=this._writableState;return typeof U=="function"?(W=U,U=null,N=null):typeof N=="function"&&(W=N,N=null),U!=null&&this.write(U,N),Q.corked&&(Q.corked=1,this.uncork()),Q.ending||ee(this,Q,W),this},Object.defineProperty(R.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function ne(U){return U.ending&&U.length===0&&U.bufferedRequest===null&&!U.finished&&!U.writing}function le(U,N){U._final(function(W){N.pendingcb--,W&&C(U,W),N.prefinished=!0,U.emit("prefinish"),ce(U,N)})}function re(U,N){!N.prefinished&&!N.finalCalled&&(typeof U._final=="function"&&!N.destroyed?(N.pendingcb++,N.finalCalled=!0,process.nextTick(le,U,N)):(N.prefinished=!0,U.emit("prefinish")))}function ce(U,N){var W=ne(N);if(W&&(re(U,N),N.pendingcb===0&&(N.finished=!0,U.emit("finish"),N.autoDestroy))){var Q=U._readableState;(!Q||Q.autoDestroy&&Q.endEmitted)&&U.destroy()}return W}function ee(U,N,W){N.ending=!0,ce(U,N),W&&(N.finished?process.nextTick(W):U.once("finish",W)),N.ended=!0,U.writable=!1}function G(U,N,W){var Q=U.entry;for(U.entry=null;Q;){var te=Q.callback;N.pendingcb--,te(W),Q=Q.next}N.corkedRequestsFree.next=U}Object.defineProperty(R.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(N){this._writableState&&(this._writableState.destroyed=N)}}),R.prototype.destroy=e.destroy,R.prototype._undestroy=e.undestroy,R.prototype._destroy=function(U,N){N(U)}}),4868:((S,d,c)=>{var b;function g(A,O,C){return O=m(O),O in A?Object.defineProperty(A,O,{value:C,enumerable:!0,configurable:!0,writable:!0}):A[O]=C,A}function m(A){var O=u(A,"string");return typeof O=="symbol"?O:String(O)}function u(A,O){if(typeof A!="object"||A===null)return A;var C=A[Symbol.toPrimitive];if(C!==void 0){var _=C.call(A,O||"default");if(typeof _!="object")return _;throw new TypeError("@@toPrimitive must return a primitive value.")}return(O==="string"?String:Number)(A)}var f=c(6815),a=Symbol("lastResolve"),t=Symbol("lastReject"),r=Symbol("error"),n=Symbol("ended"),e=Symbol("lastPromise"),o=Symbol("handlePromise"),s=Symbol("stream");function i(A,O){return{value:A,done:O}}function p(A){var O=A[a];if(O!==null){var C=A[s].read();C!==null&&(A[e]=null,A[a]=null,A[t]=null,O(i(C,!1)))}}function l(A){process.nextTick(p,A)}function h(A,O){return function(C,_){A.then(function(){if(O[n]){C(i(void 0,!0));return}O[o](C,_)},_)}}var v=Object.getPrototypeOf(function(){}),w=Object.setPrototypeOf((b={get stream(){return this[s]},next:function(){var O=this,C=this[r];if(C!==null)return Promise.reject(C);if(this[n])return Promise.resolve(i(void 0,!0));if(this[s].destroyed)return new Promise(function(R,I){process.nextTick(function(){O[r]?I(O[r]):R(i(void 0,!0))})});var _=this[e],T;if(_)T=new Promise(h(_,this));else{var k=this[s].read();if(k!==null)return Promise.resolve(i(k,!1));T=new Promise(this[o])}return this[e]=T,T}},g(b,Symbol.asyncIterator,function(){return this}),g(b,"return",function(){var O=this;return new Promise(function(C,_){O[s].destroy(null,function(T){if(T){_(T);return}C(i(void 0,!0))})})}),b),v),E=function(O){var C,_=Object.create(w,(C={},g(C,s,{value:O,writable:!0}),g(C,a,{value:null,writable:!0}),g(C,t,{value:null,writable:!0}),g(C,r,{value:null,writable:!0}),g(C,n,{value:O._readableState.endEmitted,writable:!0}),g(C,o,{value:function(k,R){var I=_[s].read();I?(_[e]=null,_[a]=null,_[t]=null,k(i(I,!1))):(_[a]=k,_[t]=R)},writable:!0}),C));return _[e]=null,f(O,function(T){if(T&&T.code!=="ERR_STREAM_PREMATURE_CLOSE"){var k=_[t];k!==null&&(_[e]=null,_[a]=null,_[t]=null,k(T)),_[r]=T;return}var R=_[a];R!==null&&(_[e]=null,_[a]=null,_[t]=null,R(i(void 0,!0))),_[n]=!0}),O.on("readable",l.bind(null,_)),_};S.exports=E}),7336:((S,d,c)=>{function b(l,h){var v=Object.keys(l);if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(l);h&&(w=w.filter(function(E){return Object.getOwnPropertyDescriptor(l,E).enumerable})),v.push.apply(v,w)}return v}function g(l){for(var h=1;h<arguments.length;h++){var v=arguments[h]!=null?arguments[h]:{};h%2?b(Object(v),!0).forEach(function(w){m(l,w,v[w])}):Object.getOwnPropertyDescriptors?Object.defineProperties(l,Object.getOwnPropertyDescriptors(v)):b(Object(v)).forEach(function(w){Object.defineProperty(l,w,Object.getOwnPropertyDescriptor(v,w))})}return l}function m(l,h,v){return h=t(h),h in l?Object.defineProperty(l,h,{value:v,enumerable:!0,configurable:!0,writable:!0}):l[h]=v,l}function u(l,h){if(!(l instanceof h))throw new TypeError("Cannot call a class as a function")}function f(l,h){for(var v=0;v<h.length;v++){var w=h[v];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(l,t(w.key),w)}}function a(l,h,v){return h&&f(l.prototype,h),v&&f(l,v),Object.defineProperty(l,"prototype",{writable:!1}),l}function t(l){var h=r(l,"string");return typeof h=="symbol"?h:String(h)}function r(l,h){if(typeof l!="object"||l===null)return l;var v=l[Symbol.toPrimitive];if(v!==void 0){var w=v.call(l,h||"default");if(typeof w!="object")return w;throw new TypeError("@@toPrimitive must return a primitive value.")}return(h==="string"?String:Number)(l)}var n=c(181),e=n.Buffer,o=c(9023),s=o.inspect,i=s&&s.custom||"inspect";function p(l,h,v){e.prototype.copy.call(l,h,v)}S.exports=(function(){function l(){u(this,l),this.head=null,this.tail=null,this.length=0}return a(l,[{key:"push",value:function(v){var w={data:v,next:null};this.length>0?this.tail.next=w:this.head=w,this.tail=w,++this.length}},{key:"unshift",value:function(v){var w={data:v,next:this.head};this.length===0&&(this.tail=w),this.head=w,++this.length}},{key:"shift",value:function(){if(this.length!==0){var v=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,v}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(v){if(this.length===0)return"";for(var w=this.head,E=""+w.data;w=w.next;)E+=v+w.data;return E}},{key:"concat",value:function(v){if(this.length===0)return e.alloc(0);for(var w=e.allocUnsafe(v>>>0),E=this.head,A=0;E;)p(E.data,w,A),A+=E.data.length,E=E.next;return w}},{key:"consume",value:function(v,w){var E;return v<this.head.data.length?(E=this.head.data.slice(0,v),this.head.data=this.head.data.slice(v)):v===this.head.data.length?E=this.shift():E=w?this._getString(v):this._getBuffer(v),E}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(v){var w=this.head,E=1,A=w.data;for(v-=A.length;w=w.next;){var O=w.data,C=v>O.length?O.length:v;if(C===O.length?A+=O:A+=O.slice(0,v),v-=C,v===0){C===O.length?(++E,w.next?this.head=w.next:this.head=this.tail=null):(this.head=w,w.data=O.slice(C));break}++E}return this.length-=E,A}},{key:"_getBuffer",value:function(v){var w=e.allocUnsafe(v),E=this.head,A=1;for(E.data.copy(w),v-=E.data.length;E=E.next;){var O=E.data,C=v>O.length?O.length:v;if(O.copy(w,w.length-v,0,C),v-=C,v===0){C===O.length?(++A,E.next?this.head=E.next:this.head=this.tail=null):(this.head=E,E.data=O.slice(C));break}++A}return this.length-=A,w}},{key:i,value:function(v,w){return s(this,g(g({},w),{},{depth:0,customInspect:!1}))}}]),l})()}),5089:(S=>{function d(f,a){var t=this,r=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return r||n?(a?a(f):f&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(m,this,f)):process.nextTick(m,this,f)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(f||null,function(e){!a&&e?t._writableState?t._writableState.errorEmitted?process.nextTick(b,t):(t._writableState.errorEmitted=!0,process.nextTick(c,t,e)):process.nextTick(c,t,e):a?(process.nextTick(b,t),a(e)):process.nextTick(b,t)}),this)}function c(f,a){m(f,a),b(f)}function b(f){f._writableState&&!f._writableState.emitClose||f._readableState&&!f._readableState.emitClose||f.emit("close")}function g(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function m(f,a){f.emit("error",a)}function u(f,a){var t=f._readableState,r=f._writableState;t&&t.autoDestroy||r&&r.autoDestroy?f.destroy(a):f.emit("error",a)}S.exports={destroy:d,undestroy:g,errorOrDestroy:u}}),6815:((S,d,c)=>{var b=c(5500).F.ERR_STREAM_PREMATURE_CLOSE;function g(a){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),e=0;e<r;e++)n[e]=arguments[e];a.apply(this,n)}}}function m(){}function u(a){return a.setHeader&&typeof a.abort=="function"}function f(a,t,r){if(typeof t=="function")return f(a,null,t);t||(t={}),r=g(r||m);var n=t.readable||t.readable!==!1&&a.readable,e=t.writable||t.writable!==!1&&a.writable,o=function(){a.writable||i()},s=a._writableState&&a._writableState.finished,i=function(){e=!1,s=!0,n||r.call(a)},p=a._readableState&&a._readableState.endEmitted,l=function(){n=!1,p=!0,e||r.call(a)},h=function(A){r.call(a,A)},v=function(){var A;if(n&&!p)return(!a._readableState||!a._readableState.ended)&&(A=new b),r.call(a,A);if(e&&!s)return(!a._writableState||!a._writableState.ended)&&(A=new b),r.call(a,A)},w=function(){a.req.on("finish",i)};return u(a)?(a.on("complete",i),a.on("abort",v),a.req?w():a.on("request",w)):e&&!a._writableState&&(a.on("end",o),a.on("close",o)),a.on("end",l),a.on("finish",i),t.error!==!1&&a.on("error",h),a.on("close",v),function(){a.removeListener("complete",i),a.removeListener("abort",v),a.removeListener("request",w),a.req&&a.req.removeListener("finish",i),a.removeListener("end",o),a.removeListener("close",o),a.removeListener("finish",i),a.removeListener("end",l),a.removeListener("error",h),a.removeListener("close",v)}}S.exports=f}),4659:((S,d,c)=>{function b(e,o,s,i,p,l,h){try{var v=e[l](h),w=v.value}catch(E){s(E);return}v.done?o(w):Promise.resolve(w).then(i,p)}function g(e){return function(){var o=this,s=arguments;return new Promise(function(i,p){var l=e.apply(o,s);function h(w){b(l,i,p,h,v,"next",w)}function v(w){b(l,i,p,h,v,"throw",w)}h(void 0)})}}function m(e,o){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);o&&(i=i.filter(function(p){return Object.getOwnPropertyDescriptor(e,p).enumerable})),s.push.apply(s,i)}return s}function u(e){for(var o=1;o<arguments.length;o++){var s=arguments[o]!=null?arguments[o]:{};o%2?m(Object(s),!0).forEach(function(i){f(e,i,s[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):m(Object(s)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(s,i))})}return e}function f(e,o,s){return o=a(o),o in e?Object.defineProperty(e,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[o]=s,e}function a(e){var o=t(e,"string");return typeof o=="symbol"?o:String(o)}function t(e,o){if(typeof e!="object"||e===null)return e;var s=e[Symbol.toPrimitive];if(s!==void 0){var i=s.call(e,o||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(e)}var r=c(5500).F.ERR_INVALID_ARG_TYPE;function n(e,o,s){var i;if(o&&typeof o.next=="function")i=o;else if(o&&o[Symbol.asyncIterator])i=o[Symbol.asyncIterator]();else if(o&&o[Symbol.iterator])i=o[Symbol.iterator]();else throw new r("iterable",["Iterable"],o);var p=new e(u({objectMode:!0},s)),l=!1;p._read=function(){l||(l=!0,h())};function h(){return v.apply(this,arguments)}function v(){return v=g(function*(){try{var w=yield i.next(),E=w.value,A=w.done;A?p.push(null):p.push(yield E)?h():l=!1}catch(O){p.destroy(O)}}),v.apply(this,arguments)}return p}S.exports=n}),6701:((S,d,c)=>{var b;function g(i){var p=!1;return function(){p||(p=!0,i.apply(void 0,arguments))}}var m=c(5500).F,u=m.ERR_MISSING_ARGS,f=m.ERR_STREAM_DESTROYED;function a(i){if(i)throw i}function t(i){return i.setHeader&&typeof i.abort=="function"}function r(i,p,l,h){h=g(h);var v=!1;i.on("close",function(){v=!0}),b===void 0&&(b=c(6815)),b(i,{readable:p,writable:l},function(E){if(E)return h(E);v=!0,h()});var w=!1;return function(E){if(!v&&!w){if(w=!0,t(i))return i.abort();if(typeof i.destroy=="function")return i.destroy();h(E||new f("pipe"))}}}function n(i){i()}function e(i,p){return i.pipe(p)}function o(i){return!i.length||typeof i[i.length-1]!="function"?a:i.pop()}function s(){for(var i=arguments.length,p=new Array(i),l=0;l<i;l++)p[l]=arguments[l];var h=o(p);if(Array.isArray(p[0])&&(p=p[0]),p.length<2)throw new u("streams");var v,w=p.map(function(E,A){var O=A<p.length-1,C=A>0;return r(E,O,C,function(_){v||(v=_),_&&w.forEach(n),!O&&(w.forEach(n),h(v))})});return p.reduce(e)}S.exports=s}),4874:((S,d,c)=>{var b=c(5500).F.ERR_INVALID_OPT_VALUE;function g(u,f,a){return u.highWaterMark!=null?u.highWaterMark:f?u[a]:null}function m(u,f,a,t){var r=g(f,t,a);if(r!=null){if(!(isFinite(r)&&Math.floor(r)===r)||r<0){var n=t?a:"highWaterMark";throw new b(n,r)}return Math.floor(r)}return u.objectMode?16:16*1024}S.exports={getHighWaterMark:m}}),3283:((S,d,c)=>{S.exports=c(2203)}),6131:((S,d,c)=>{var b=c(2203);process.env.READABLE_STREAM==="disable"&&b?(S.exports=b.Readable,Object.assign(S.exports,b),S.exports.Stream=b):(d=S.exports=c(6893),d.Stream=b||d,d.Readable=d,d.Writable=c(8797),d.Duplex=c(2063),d.Transform=c(2337),d.PassThrough=c(5283),d.finished=c(6815),d.pipeline=c(6701))}),3058:((S,d,c)=>{/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var b=c(181),g=b.Buffer;function m(f,a){for(var t in f)a[t]=f[t]}g.from&&g.alloc&&g.allocUnsafe&&g.allocUnsafeSlow?S.exports=b:(m(b,d),d.Buffer=u);function u(f,a,t){return g(f,a,t)}u.prototype=Object.create(g.prototype),m(g,u),u.from=function(f,a,t){if(typeof f=="number")throw new TypeError("Argument must not be a number");return g(f,a,t)},u.alloc=function(f,a,t){if(typeof f!="number")throw new TypeError("Argument must be a number");var r=g(f);return a!==void 0?typeof t=="string"?r.fill(a,t):r.fill(a):r.fill(0),r},u.allocUnsafe=function(f){if(typeof f!="number")throw new TypeError("Argument must be a number");return g(f)},u.allocUnsafeSlow=function(f){if(typeof f!="number")throw new TypeError("Argument must be a number");return b.SlowBuffer(f)}}),2803:((S,d,c)=>{var b=c(181),g=b.Buffer,m={},u;for(u in b)b.hasOwnProperty(u)&&(u==="SlowBuffer"||u==="Buffer"||(m[u]=b[u]));var f=m.Buffer={};for(u in g)g.hasOwnProperty(u)&&(u==="allocUnsafe"||u==="allocUnsafeSlow"||(f[u]=g[u]));if(m.Buffer.prototype=g.prototype,(!f.from||f.from===Uint8Array.from)&&(f.from=function(a,t,r){if(typeof a=="number")throw new TypeError('The "value" argument must not be of type number. Received type '+typeof a);if(a&&typeof a.length>"u")throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof a);return g(a,t,r)}),f.alloc||(f.alloc=function(a,t,r){if(typeof a!="number")throw new TypeError('The "size" argument must be of type number. Received type '+typeof a);if(a<0||a>=2*(1<<30))throw new RangeError('The value "'+a+'" is invalid for option "size"');var n=g(a);return!t||t.length===0?n.fill(0):typeof r=="string"?n.fill(t,r):n.fill(t),n}),!m.kStringMaxLength)try{m.kStringMaxLength=process.binding("buffer").kStringMaxLength}catch{}m.constants||(m.constants={MAX_LENGTH:m.kMaxLength},m.kStringMaxLength&&(m.constants.MAX_STRING_LENGTH=m.kStringMaxLength)),S.exports=m}),814:((S,d,c)=>{/*!
|
|
279
279
|
* send
|
|
280
280
|
* Copyright(c) 2012 TJ Holowaychuk
|
|
281
281
|
* Copyright(c) 2014-2022 Douglas Christopher Wilson
|
|
282
282
|
* MIT Licensed
|
|
283
|
-
*/var b=c(8024),g=c(2830)("send"),m=c(95)("send"),u=c(2194),f=c(3835),a=c(2759),t=c(1825),r=c(3136),n=c(9896),e=c(2322),o=c(6774),s=c(5698),i=c(4031),p=c(6928),l=c(4650),h=c(2203),v=c(9023),w=p.extname,E=p.join,A=p.normalize,O=p.resolve,C=p.sep,_=/^ *bytes=/,T=3600*24*365*1e3,k=/(?:^|[\\/])\.\.(?:[\\/]|$)/;S.exports=R,S.exports.mime=e;function R(ee,G,U){return new I(ee,G,U)}function I(ee,G,U){h.call(this);var N=U||{};if(this.options=N,this.path=G,this.req=ee,this._acceptRanges=N.acceptRanges!==void 0?!!N.acceptRanges:!0,this._cacheControl=N.cacheControl!==void 0?!!N.cacheControl:!0,this._etag=N.etag!==void 0?!!N.etag:!0,this._dotfiles=N.dotfiles!==void 0?N.dotfiles:"ignore",this._dotfiles!=="ignore"&&this._dotfiles!=="allow"&&this._dotfiles!=="deny")throw new TypeError('dotfiles option must be "allow", "deny", or "ignore"');this._hidden=!!N.hidden,N.hidden!==void 0&&m("hidden: use dotfiles: '"+(this._hidden?"allow":"ignore")+"' instead"),N.dotfiles===void 0&&(this._dotfiles=void 0),this._extensions=N.extensions!==void 0?ne(N.extensions,"extensions option"):[],this._immutable=N.immutable!==void 0?!!N.immutable:!1,this._index=N.index!==void 0?ne(N.index,"index option"):["index.html"],this._lastModified=N.lastModified!==void 0?!!N.lastModified:!0,this._maxage=N.maxAge||N.maxage,this._maxage=typeof this._maxage=="string"?o(this._maxage):Number(this._maxage),this._maxage=isNaN(this._maxage)?0:Math.min(Math.max(0,this._maxage),T),this._root=N.root?O(N.root):null,!this._root&&N.from&&this.from(N.from)}v.inherits(I,h),I.prototype.etag=m.function(function(G){return this._etag=!!G,g("etag %s",this._etag),this},"send.etag: pass etag as option"),I.prototype.hidden=m.function(function(G){return this._hidden=!!G,this._dotfiles=void 0,g("hidden %s",this._hidden),this},"send.hidden: use dotfiles option"),I.prototype.index=m.function(function(G){var U=G?ne(G,"paths argument"):[];return g("index %o",G),this._index=U,this},"send.index: pass index as option"),I.prototype.root=function(G){return this._root=O(String(G)),g("root %s",this._root),this},I.prototype.from=m.function(I.prototype.root,"send.from: pass root as option"),I.prototype.root=m.function(I.prototype.root,"send.root: pass root as option"),I.prototype.maxage=m.function(function(G){return this._maxage=typeof G=="string"?o(G):Number(G),this._maxage=isNaN(this._maxage)?0:Math.min(Math.max(0,this._maxage),T),g("max-age %d",this._maxage),this},"send.maxage: pass maxAge as option"),I.prototype.error=function(G,U){if(Z(this,"error"))return this.emit("error",$(G,U));var N=this.res,W=l.message[G]||String(G),Q=z("Error",a(W));L(N),U&&U.headers&&ce(N,U.headers),N.statusCode=G,N.setHeader("Content-Type","text/html; charset=UTF-8"),N.setHeader("Content-Length",Buffer.byteLength(Q)),N.setHeader("Content-Security-Policy","default-src 'none'"),N.setHeader("X-Content-Type-Options","nosniff"),N.end(Q)},I.prototype.hasTrailingSlash=function(){return this.path[this.path.length-1]==="/"},I.prototype.isConditionalGET=function(){return this.req.headers["if-match"]||this.req.headers["if-unmodified-since"]||this.req.headers["if-none-match"]||this.req.headers["if-modified-since"]},I.prototype.isPreconditionFailure=function(){var G=this.req,U=this.res,N=G.headers["if-match"];if(N){var W=U.getHeader("ETag");return!W||N!=="*"&&re(N).every(function(F){return F!==W&&F!=="W/"+W&&"W/"+F!==W})}var Q=le(G.headers["if-unmodified-since"]);if(!isNaN(Q)){var te=le(U.getHeader("Last-Modified"));return isNaN(te)||te>Q}return!1},I.prototype.removeContentHeaderFields=function(){var G=this.res;G.removeHeader("Content-Encoding"),G.removeHeader("Content-Language"),G.removeHeader("Content-Length"),G.removeHeader("Content-Range"),G.removeHeader("Content-Type")},I.prototype.notModified=function(){var G=this.res;g("not modified"),this.removeContentHeaderFields(),G.statusCode=304,G.end()},I.prototype.headersAlreadySent=function(){var G=new Error("Can't set headers after they are sent.");g("headers already sent"),this.error(500,G)},I.prototype.isCachable=function(){var G=this.res.statusCode;return G>=200&&G<300||G===304},I.prototype.onStatError=function(G){switch(G.code){case"ENAMETOOLONG":case"ENOENT":case"ENOTDIR":this.error(404,G);break;default:this.error(500,G);break}},I.prototype.isFresh=function(){return r(this.req.headers,{etag:this.res.getHeader("ETag"),"last-modified":this.res.getHeader("Last-Modified")})},I.prototype.isRangeFresh=function(){var G=this.req.headers["if-range"];if(!G)return!0;if(G.indexOf('"')!==-1){var U=this.res.getHeader("ETag");return!!(U&&G.indexOf(U)!==-1)}var N=this.res.getHeader("Last-Modified");return le(N)<=le(G)},I.prototype.redirect=function(G){var U=this.res;if(Z(this,"directory")){this.emit("directory",U,G);return}if(this.hasTrailingSlash()){this.error(403);return}var N=f(P(this.path+"/")),W=z("Redirecting","Redirecting to "+a(N));U.statusCode=301,U.setHeader("Content-Type","text/html; charset=UTF-8"),U.setHeader("Content-Length",Buffer.byteLength(W)),U.setHeader("Content-Security-Policy","default-src 'none'"),U.setHeader("X-Content-Type-Options","nosniff"),U.setHeader("Location",N),U.end(W)},I.prototype.pipe=function(G){var U=this._root;this.res=G;var N=K(this.path);if(N===-1)return this.error(400),G;if(~N.indexOf("\0"))return this.error(400),G;var W;if(U!==null){if(N&&(N=A("."+C+N)),k.test(N))return g('malicious path "%s"',N),this.error(403),G;W=N.split(C),N=A(E(U,N))}else{if(k.test(N))return g('malicious path "%s"',N),this.error(403),G;W=A(N).split(C),N=O(N)}if(B(W)){var Q=this._dotfiles;switch(Q===void 0&&(Q=W[W.length-1][0]==="."?this._hidden?"allow":"ignore":"allow"),g('%s dotfile "%s"',Q,N),Q){case"allow":break;case"deny":return this.error(403),G;default:return this.error(404),G}}return this._index.length&&this.hasTrailingSlash()?(this.sendIndex(N),G):(this.sendFile(N),G)},I.prototype.send=function(G,U){var N=U.size,W=this.options,Q={},te=this.res,F=this.req,D=F.headers.range,
|
|
283
|
+
*/var b=c(8024),g=c(2830)("send"),m=c(95)("send"),u=c(2194),f=c(3835),a=c(2759),t=c(1825),r=c(3136),n=c(9896),e=c(2322),o=c(6774),s=c(5698),i=c(4031),p=c(6928),l=c(4650),h=c(2203),v=c(9023),w=p.extname,E=p.join,A=p.normalize,O=p.resolve,C=p.sep,_=/^ *bytes=/,T=3600*24*365*1e3,k=/(?:^|[\\/])\.\.(?:[\\/]|$)/;S.exports=R,S.exports.mime=e;function R(ee,G,U){return new I(ee,G,U)}function I(ee,G,U){h.call(this);var N=U||{};if(this.options=N,this.path=G,this.req=ee,this._acceptRanges=N.acceptRanges!==void 0?!!N.acceptRanges:!0,this._cacheControl=N.cacheControl!==void 0?!!N.cacheControl:!0,this._etag=N.etag!==void 0?!!N.etag:!0,this._dotfiles=N.dotfiles!==void 0?N.dotfiles:"ignore",this._dotfiles!=="ignore"&&this._dotfiles!=="allow"&&this._dotfiles!=="deny")throw new TypeError('dotfiles option must be "allow", "deny", or "ignore"');this._hidden=!!N.hidden,N.hidden!==void 0&&m("hidden: use dotfiles: '"+(this._hidden?"allow":"ignore")+"' instead"),N.dotfiles===void 0&&(this._dotfiles=void 0),this._extensions=N.extensions!==void 0?ne(N.extensions,"extensions option"):[],this._immutable=N.immutable!==void 0?!!N.immutable:!1,this._index=N.index!==void 0?ne(N.index,"index option"):["index.html"],this._lastModified=N.lastModified!==void 0?!!N.lastModified:!0,this._maxage=N.maxAge||N.maxage,this._maxage=typeof this._maxage=="string"?o(this._maxage):Number(this._maxage),this._maxage=isNaN(this._maxage)?0:Math.min(Math.max(0,this._maxage),T),this._root=N.root?O(N.root):null,!this._root&&N.from&&this.from(N.from)}v.inherits(I,h),I.prototype.etag=m.function(function(G){return this._etag=!!G,g("etag %s",this._etag),this},"send.etag: pass etag as option"),I.prototype.hidden=m.function(function(G){return this._hidden=!!G,this._dotfiles=void 0,g("hidden %s",this._hidden),this},"send.hidden: use dotfiles option"),I.prototype.index=m.function(function(G){var U=G?ne(G,"paths argument"):[];return g("index %o",G),this._index=U,this},"send.index: pass index as option"),I.prototype.root=function(G){return this._root=O(String(G)),g("root %s",this._root),this},I.prototype.from=m.function(I.prototype.root,"send.from: pass root as option"),I.prototype.root=m.function(I.prototype.root,"send.root: pass root as option"),I.prototype.maxage=m.function(function(G){return this._maxage=typeof G=="string"?o(G):Number(G),this._maxage=isNaN(this._maxage)?0:Math.min(Math.max(0,this._maxage),T),g("max-age %d",this._maxage),this},"send.maxage: pass maxAge as option"),I.prototype.error=function(G,U){if(Z(this,"error"))return this.emit("error",$(G,U));var N=this.res,W=l.message[G]||String(G),Q=z("Error",a(W));L(N),U&&U.headers&&ce(N,U.headers),N.statusCode=G,N.setHeader("Content-Type","text/html; charset=UTF-8"),N.setHeader("Content-Length",Buffer.byteLength(Q)),N.setHeader("Content-Security-Policy","default-src 'none'"),N.setHeader("X-Content-Type-Options","nosniff"),N.end(Q)},I.prototype.hasTrailingSlash=function(){return this.path[this.path.length-1]==="/"},I.prototype.isConditionalGET=function(){return this.req.headers["if-match"]||this.req.headers["if-unmodified-since"]||this.req.headers["if-none-match"]||this.req.headers["if-modified-since"]},I.prototype.isPreconditionFailure=function(){var G=this.req,U=this.res,N=G.headers["if-match"];if(N){var W=U.getHeader("ETag");return!W||N!=="*"&&re(N).every(function(F){return F!==W&&F!=="W/"+W&&"W/"+F!==W})}var Q=le(G.headers["if-unmodified-since"]);if(!isNaN(Q)){var te=le(U.getHeader("Last-Modified"));return isNaN(te)||te>Q}return!1},I.prototype.removeContentHeaderFields=function(){var G=this.res;G.removeHeader("Content-Encoding"),G.removeHeader("Content-Language"),G.removeHeader("Content-Length"),G.removeHeader("Content-Range"),G.removeHeader("Content-Type")},I.prototype.notModified=function(){var G=this.res;g("not modified"),this.removeContentHeaderFields(),G.statusCode=304,G.end()},I.prototype.headersAlreadySent=function(){var G=new Error("Can't set headers after they are sent.");g("headers already sent"),this.error(500,G)},I.prototype.isCachable=function(){var G=this.res.statusCode;return G>=200&&G<300||G===304},I.prototype.onStatError=function(G){switch(G.code){case"ENAMETOOLONG":case"ENOENT":case"ENOTDIR":this.error(404,G);break;default:this.error(500,G);break}},I.prototype.isFresh=function(){return r(this.req.headers,{etag:this.res.getHeader("ETag"),"last-modified":this.res.getHeader("Last-Modified")})},I.prototype.isRangeFresh=function(){var G=this.req.headers["if-range"];if(!G)return!0;if(G.indexOf('"')!==-1){var U=this.res.getHeader("ETag");return!!(U&&G.indexOf(U)!==-1)}var N=this.res.getHeader("Last-Modified");return le(N)<=le(G)},I.prototype.redirect=function(G){var U=this.res;if(Z(this,"directory")){this.emit("directory",U,G);return}if(this.hasTrailingSlash()){this.error(403);return}var N=f(P(this.path+"/")),W=z("Redirecting","Redirecting to "+a(N));U.statusCode=301,U.setHeader("Content-Type","text/html; charset=UTF-8"),U.setHeader("Content-Length",Buffer.byteLength(W)),U.setHeader("Content-Security-Policy","default-src 'none'"),U.setHeader("X-Content-Type-Options","nosniff"),U.setHeader("Location",N),U.end(W)},I.prototype.pipe=function(G){var U=this._root;this.res=G;var N=K(this.path);if(N===-1)return this.error(400),G;if(~N.indexOf("\0"))return this.error(400),G;var W;if(U!==null){if(N&&(N=A("."+C+N)),k.test(N))return g('malicious path "%s"',N),this.error(403),G;W=N.split(C),N=A(E(U,N))}else{if(k.test(N))return g('malicious path "%s"',N),this.error(403),G;W=A(N).split(C),N=O(N)}if(B(W)){var Q=this._dotfiles;switch(Q===void 0&&(Q=W[W.length-1][0]==="."?this._hidden?"allow":"ignore":"allow"),g('%s dotfile "%s"',Q,N),Q){case"allow":break;case"deny":return this.error(403),G;default:return this.error(404),G}}return this._index.length&&this.hasTrailingSlash()?(this.sendIndex(N),G):(this.sendFile(N),G)},I.prototype.send=function(G,U){var N=U.size,W=this.options,Q={},te=this.res,F=this.req,D=F.headers.range,X=W.start||0;if(Y(te)){this.headersAlreadySent();return}if(g('pipe "%s"',G),this.setHeader(G,U),this.type(G),this.isConditionalGET()){if(this.isPreconditionFailure()){this.error(412);return}if(this.isCachable()&&this.isFresh()){this.notModified();return}}if(N=Math.max(0,N-X),W.end!==void 0){var ie=W.end-X+1;N>ie&&(N=ie)}if(this._acceptRanges&&_.test(D)){if(D=i(N,D,{combine:!0}),this.isRangeFresh()||(g("range stale"),D=-2),D===-1)return g("range unsatisfiable"),te.setHeader("Content-Range",M("bytes",N)),this.error(416,{headers:{"Content-Range":te.getHeader("Content-Range")}});D!==-2&&D.length===1&&(g("range %j",D),te.statusCode=206,te.setHeader("Content-Range",M("bytes",N,D[0])),X+=D[0].start,N=D[0].end-D[0].start+1)}for(var ue in W)Q[ue]=W[ue];if(Q.start=X,Q.end=Math.max(X,X+N-1),te.setHeader("Content-Length",N),F.method==="HEAD"){te.end();return}this.stream(G,Q)},I.prototype.sendFile=function(G){var U=0,N=this;g('stat "%s"',G),n.stat(G,function(te,F){if(te&&te.code==="ENOENT"&&!w(G)&&G[G.length-1]!==C)return W(te);if(te)return N.onStatError(te);if(F.isDirectory())return N.redirect(G);N.emit("file",G,F),N.send(G,F)});function W(Q){if(N._extensions.length<=U)return Q?N.onStatError(Q):N.error(404);var te=G+"."+N._extensions[U++];g('stat "%s"',te),n.stat(te,function(F,D){if(F)return W(F);if(D.isDirectory())return W();N.emit("file",te,D),N.send(te,D)})}},I.prototype.sendIndex=function(G){var U=-1,N=this;function W(Q){if(++U>=N._index.length)return Q?N.onStatError(Q):N.error(404);var te=E(G,N._index[U]);g('stat "%s"',te),n.stat(te,function(F,D){if(F)return W(F);if(D.isDirectory())return W();N.emit("file",te,D),N.send(te,D)})}W()},I.prototype.stream=function(G,U){var N=this,W=this.res,Q=n.createReadStream(G,U);this.emit("stream",Q),Q.pipe(W);function te(){u(Q,!0)}s(W,te),Q.on("error",function(D){te(),N.onStatError(D)}),Q.on("end",function(){N.emit("end")})},I.prototype.type=function(G){var U=this.res;if(!U.getHeader("Content-Type")){var N=e.lookup(G);if(!N){g("no content-type");return}var W=e.charsets.lookup(N);g("content-type %s",N),U.setHeader("Content-Type",N+(W?"; charset="+W:""))}},I.prototype.setHeader=function(G,U){var N=this.res;if(this.emit("headers",N,G,U),this._acceptRanges&&!N.getHeader("Accept-Ranges")&&(g("accept ranges"),N.setHeader("Accept-Ranges","bytes")),this._cacheControl&&!N.getHeader("Cache-Control")){var W="public, max-age="+Math.floor(this._maxage/1e3);this._immutable&&(W+=", immutable"),g("cache-control %s",W),N.setHeader("Cache-Control",W)}if(this._lastModified&&!N.getHeader("Last-Modified")){var Q=U.mtime.toUTCString();g("modified %s",Q),N.setHeader("Last-Modified",Q)}if(this._etag&&!N.getHeader("ETag")){var te=t(U);g("etag %s",te),N.setHeader("ETag",te)}};function L(ee){for(var G=j(ee),U=0;U<G.length;U++)ee.removeHeader(G[U])}function P(ee){for(var G=0;G<ee.length&&ee[G]==="/";G++);return G>1?"/"+ee.substr(G):ee}function B(ee){for(var G=0;G<ee.length;G++){var U=ee[G];if(U.length>1&&U[0]===".")return!0}return!1}function M(ee,G,U){return ee+" "+(U?U.start+"-"+U.end:"*")+"/"+G}function z(ee,G){return`<!DOCTYPE html>
|
|
284
284
|
<html lang="en">
|
|
285
285
|
<head>
|
|
286
286
|
<meta charset="utf-8">
|
|
@@ -332,7 +332,7 @@ Minimum version required to store current data is: `+L+`.
|
|
|
332
332
|
* Copyright(c) 2014 Jonathan Ong
|
|
333
333
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|
334
334
|
* MIT Licensed
|
|
335
|
-
*/var b=c(827),g=c(4096);S.exports=f,S.exports.is=m,S.exports.hasBody=u,S.exports.normalize=a,S.exports.match=t;function m(e,o){var s,i=o,p=n(e);if(!p)return!1;if(i&&!Array.isArray(i))for(i=new Array(arguments.length-1),s=0;s<i.length;s++)i[s]=arguments[s+1];if(!i||!i.length)return p;var l;for(s=0;s<i.length;s++)if(t(a(l=i[s]),p))return l[0]==="+"||l.indexOf("*")!==-1?p:l;return!1}function u(e){return e.headers["transfer-encoding"]!==void 0||!isNaN(e.headers["content-length"])}function f(e,o){var s=o;if(!u(e))return null;if(arguments.length>2){s=new Array(arguments.length-1);for(var i=0;i<s.length;i++)s[i]=arguments[i+1]}var p=e.headers["content-type"];return m(p,s)}function a(e){if(typeof e!="string")return!1;switch(e){case"urlencoded":return"application/x-www-form-urlencoded";case"multipart":return"multipart/*"}return e[0]==="+"?"*/*"+e:e.indexOf("/")===-1?g.lookup(e):e}function t(e,o){if(e===!1)return!1;var s=o.split("/"),i=e.split("/");return s.length!==2||i.length!==2||i[0]!=="*"&&i[0]!==s[0]?!1:i[1].substr(0,2)==="*+"?i[1].length<=s[1].length+1&&i[1].substr(1)===s[1].substr(1-i[1].length):!(i[1]!=="*"&&i[1]!==s[1])}function r(e){var o=b.parse(e);return o.parameters=void 0,b.format(o)}function n(e){if(!e)return null;try{return r(e)}catch{return null}}}),4698:((S,d)=>{var c=void 0,b=1e5,g=(function(){var j=Object.prototype.toString,Z=Object.prototype.hasOwnProperty;return{Class:function(Y){return j.call(Y).replace(/^\[object *|\]$/g,"")},HasProperty:function(Y,ne){return ne in Y},HasOwnProperty:function(Y,ne){return Z.call(Y,ne)},IsCallable:function(Y){return typeof Y=="function"},ToInt32:function(Y){return Y>>0},ToUint32:function(Y){return Y>>>0}}})(),m=Math.LN2,u=Math.abs,f=Math.floor,a=Math.log,t=Math.min,r=Math.pow,n=Math.round;function e(j){if(s&&o){var Z=s(j),Y;for(Y=0;Y<Z.length;Y+=1)o(j,Z[Y],{value:j[Z[Y]],writable:!1,enumerable:!1,configurable:!1})}}var o;Object.defineProperty&&(function(){try{return Object.defineProperty({},"x",{}),!0}catch{return!1}})()?o=Object.defineProperty:o=function(j,Z,Y){if(!j===Object(j))throw new TypeError("Object.defineProperty called on non-object");return g.HasProperty(Y,"get")&&Object.prototype.__defineGetter__&&Object.prototype.__defineGetter__.call(j,Z,Y.get),g.HasProperty(Y,"set")&&Object.prototype.__defineSetter__&&Object.prototype.__defineSetter__.call(j,Z,Y.set),g.HasProperty(Y,"value")&&(j[Z]=Y.value),j};var s=Object.getOwnPropertyNames||function(j){if(j!==Object(j))throw new TypeError("Object.getOwnPropertyNames called on non-object");var Z=[],Y;for(Y in j)g.HasOwnProperty(j,Y)&&Z.push(Y);return Z};function i(j){if(!o)return;if(j.length>b)throw new RangeError("Array too large for polyfill");function Z(ne){o(j,ne,{get:function(){return j._getter(ne)},set:function(le){j._setter(ne,le)},enumerable:!0,configurable:!1})}var Y;for(Y=0;Y<j.length;Y+=1)Z(Y)}function p(j,Z){var Y=32-Z;return j<<Y>>Y}function l(j,Z){var Y=32-Z;return j<<Y>>>Y}function h(j){return[j&255]}function v(j){return p(j[0],8)}function w(j){return[j&255]}function E(j){return l(j[0],8)}function A(j){return j=n(Number(j)),[j<0?0:j>255?255:j&255]}function O(j){return[j>>8&255,j&255]}function C(j){return p(j[0]<<8|j[1],16)}function _(j){return[j>>8&255,j&255]}function T(j){return l(j[0]<<8|j[1],16)}function k(j){return[j>>24&255,j>>16&255,j>>8&255,j&255]}function R(j){return p(j[0]<<24|j[1]<<16|j[2]<<8|j[3],32)}function I(j){return[j>>24&255,j>>16&255,j>>8&255,j&255]}function L(j){return l(j[0]<<24|j[1]<<16|j[2]<<8|j[3],32)}function P(j,Z,Y){var ne=(1<<Z-1)-1,le,re,ce,ee,G,U,N,W;function Q(te){var F=f(te),D=te-F;return D<.5?F:D>.5||F%2?F+1:F}for(j!==j?(re=(1<<Z)-1,ce=r(2,Y-1),le=0):j===1/0||j===-1/0?(re=(1<<Z)-1,ce=0,le=j<0?1:0):j===0?(re=0,ce=0,le=1/j===-1/0?1:0):(le=j<0,j=u(j),j>=r(2,1-ne)?(re=t(f(a(j)/m),1023),ce=Q(j/r(2,re)*r(2,Y)),ce/r(2,Y)>=2&&(re=re+1,ce=1),re>ne?(re=(1<<Z)-1,ce=0):(re=re+ne,ce=ce-r(2,Y))):(re=0,ce=Q(j/r(2,1-ne-Y)))),U=[],G=Y;G;G-=1)U.push(ce%2?1:0),ce=f(ce/2);for(G=Z;G;G-=1)U.push(re%2?1:0),re=f(re/2);for(U.push(le?1:0),U.reverse(),N=U.join(""),W=[];N.length;)W.push(parseInt(N.substring(0,8),2)),N=N.substring(8);return W}function B(j,Z,Y){var ne=[],le,re,ce,ee,G,U,N,W;for(le=j.length;le;le-=1)for(ce=j[le-1],re=8;re;re-=1)ne.push(ce%2?1:0),ce=ce>>1;return ne.reverse(),ee=ne.join(""),G=(1<<Z-1)-1,U=parseInt(ee.substring(0,1),2)?-1:1,N=parseInt(ee.substring(1,1+Z),2),W=parseInt(ee.substring(1+Z),2),N===(1<<Z)-1?W!==0?NaN:U*(1/0):N>0?U*r(2,N-G)*(1+W/r(2,Y)):W!==0?U*r(2,-(G-1))*(W/r(2,Y)):U<0?-0:0}function M(j){return B(j,11,52)}function z(j){return P(j,11,52)}function $(j){return B(j,8,23)}function K(j){return P(j,8,23)}(function(){var j=function(te){if(te=g.ToInt32(te),te<0)throw new RangeError("ArrayBuffer size is not a small enough positive integer");this.byteLength=te,this._bytes=[],this._bytes.length=te;var F;for(F=0;F<this.byteLength;F+=1)this._bytes[F]=0;e(this)};d.Az=d.Az||j;var Z=function(){};function Y(Q,te,F){var D;return D=function(J,ie,ue){var H,V,ae,se;if(!arguments.length||typeof arguments[0]=="number"){if(this.length=g.ToInt32(arguments[0]),ue<0)throw new RangeError("ArrayBufferView size is not a small enough positive integer");this.byteLength=this.length*this.BYTES_PER_ELEMENT,this.buffer=new j(this.byteLength),this.byteOffset=0}else if(typeof arguments[0]=="object"&&arguments[0].constructor===D)for(H=arguments[0],this.length=H.length,this.byteLength=this.length*this.BYTES_PER_ELEMENT,this.buffer=new j(this.byteLength),this.byteOffset=0,ae=0;ae<this.length;ae+=1)this._setter(ae,H._getter(ae));else if(typeof arguments[0]=="object"&&!(arguments[0]instanceof j||g.Class(arguments[0])==="ArrayBuffer"))for(V=arguments[0],this.length=g.ToUint32(V.length),this.byteLength=this.length*this.BYTES_PER_ELEMENT,this.buffer=new j(this.byteLength),this.byteOffset=0,ae=0;ae<this.length;ae+=1)se=V[ae],this._setter(ae,Number(se));else if(typeof arguments[0]=="object"&&(arguments[0]instanceof j||g.Class(arguments[0])==="ArrayBuffer")){if(this.buffer=J,this.byteOffset=g.ToUint32(ie),this.byteOffset>this.buffer.byteLength)throw new RangeError("byteOffset out of range");if(this.byteOffset%this.BYTES_PER_ELEMENT)throw new RangeError("ArrayBuffer length minus the byteOffset is not a multiple of the element size.");if(arguments.length<3){if(this.byteLength=this.buffer.byteLength-this.byteOffset,this.byteLength%this.BYTES_PER_ELEMENT)throw new RangeError("length of buffer minus byteOffset not a multiple of the element size");this.length=this.byteLength/this.BYTES_PER_ELEMENT}else this.length=g.ToUint32(ue),this.byteLength=this.length*this.BYTES_PER_ELEMENT;if(this.byteOffset+this.byteLength>this.buffer.byteLength)throw new RangeError("byteOffset and length reference an area beyond the end of the buffer")}else throw new TypeError("Unexpected argument type(s)");this.constructor=D,e(this),i(this)},D.prototype=new Z,D.prototype.BYTES_PER_ELEMENT=Q,D.prototype._pack=te,D.prototype._unpack=F,D.BYTES_PER_ELEMENT=Q,D.prototype._getter=function(J){if(arguments.length<1)throw new SyntaxError("Not enough arguments");if(J=g.ToUint32(J),J>=this.length)return c;var ie=[],ue,H;for(ue=0,H=this.byteOffset+J*this.BYTES_PER_ELEMENT;ue<this.BYTES_PER_ELEMENT;ue+=1,H+=1)ie.push(this.buffer._bytes[H]);return this._unpack(ie)},D.prototype.get=D.prototype._getter,D.prototype._setter=function(J,ie){if(arguments.length<2)throw new SyntaxError("Not enough arguments");if(J=g.ToUint32(J),J>=this.length)return c;var ue=this._pack(ie),H,V;for(H=0,V=this.byteOffset+J*this.BYTES_PER_ELEMENT;H<this.BYTES_PER_ELEMENT;H+=1,V+=1)this.buffer._bytes[V]=ue[H]},D.prototype.set=function(J,ie){if(arguments.length<1)throw new SyntaxError("Not enough arguments");var ue,H,V,ae,se,oe,fe,he,pe,ye;if(typeof arguments[0]=="object"&&arguments[0].constructor===this.constructor){if(ue=arguments[0],V=g.ToUint32(arguments[1]),V+ue.length>this.length)throw new RangeError("Offset plus length of array is out of range");if(he=this.byteOffset+V*this.BYTES_PER_ELEMENT,pe=ue.length*this.BYTES_PER_ELEMENT,ue.buffer===this.buffer){for(ye=[],se=0,oe=ue.byteOffset;se<pe;se+=1,oe+=1)ye[se]=ue.buffer._bytes[oe];for(se=0,fe=he;se<pe;se+=1,fe+=1)this.buffer._bytes[fe]=ye[se]}else for(se=0,oe=ue.byteOffset,fe=he;se<pe;se+=1,oe+=1,fe+=1)this.buffer._bytes[fe]=ue.buffer._bytes[oe]}else if(typeof arguments[0]=="object"&&typeof arguments[0].length<"u"){if(H=arguments[0],ae=g.ToUint32(H.length),V=g.ToUint32(arguments[1]),V+ae>this.length)throw new RangeError("Offset plus length of array is out of range");for(se=0;se<ae;se+=1)oe=H[se],this._setter(V+se,Number(oe))}else throw new TypeError("Unexpected argument type(s)")},D.prototype.subarray=function(J,ie){function ue(V,ae,se){return V<ae?ae:V>se?se:V}J=g.ToInt32(J),ie=g.ToInt32(ie),arguments.length<1&&(J=0),arguments.length<2&&(ie=this.length),J<0&&(J=this.length+J),ie<0&&(ie=this.length+ie),J=ue(J,0,this.length),ie=ue(ie,0,this.length);var H=ie-J;return H<0&&(H=0),new this.constructor(this.buffer,this.byteOffset+J*this.BYTES_PER_ELEMENT,H)},D}var ne=Y(1,h,v),le=Y(1,w,E),re=Y(1,A,E),ce=Y(2,O,C),ee=Y(2,_,T),G=Y(4,k,R),U=Y(4,I,L),N=Y(4,K,$),W=Y(8,z,M);d.fo=d.fo||ne,d.SE=d.SE||le,d.ER=d.ER||re,d.ss=d.ss||ce,d.hR=d.hR||ee,d.GM=d.GM||G,d.bt=d.bt||U,d.l6=d.l6||N,d.aQ=d.aQ||W})(),(function(){function j(re,ce){return g.IsCallable(re.get)?re.get(ce):re[ce]}var Z=(function(){var re=new d.hR([4660]),ce=new d.SE(re.buffer);return j(ce,0)===18})(),Y=function(ce,ee,G){if(arguments.length===0)ce=new d.Az(0);else if(!(ce instanceof d.Az||g.Class(ce)==="ArrayBuffer"))throw new TypeError("TypeError");if(this.buffer=ce||new d.Az(0),this.byteOffset=g.ToUint32(ee),this.byteOffset>this.buffer.byteLength)throw new RangeError("byteOffset out of range");if(arguments.length<3?this.byteLength=this.buffer.byteLength-this.byteOffset:this.byteLength=g.ToUint32(G),this.byteOffset+this.byteLength>this.buffer.byteLength)throw new RangeError("byteOffset and length reference an area beyond the end of the buffer");e(this)};function ne(re){return function(ce,ee){if(ce=g.ToUint32(ce),ce+re.BYTES_PER_ELEMENT>this.byteLength)throw new RangeError("Array index out of range");ce+=this.byteOffset;var G=new d.SE(this.buffer,ce,re.BYTES_PER_ELEMENT),U=[],N;for(N=0;N<re.BYTES_PER_ELEMENT;N+=1)U.push(j(G,N));return!!ee==!!Z&&U.reverse(),j(new re(new d.SE(U).buffer),0)}}Y.prototype.getUint8=ne(d.SE),Y.prototype.getInt8=ne(d.fo),Y.prototype.getUint16=ne(d.hR),Y.prototype.getInt16=ne(d.ss),Y.prototype.getUint32=ne(d.bt),Y.prototype.getInt32=ne(d.GM),Y.prototype.getFloat32=ne(d.l6),Y.prototype.getFloat64=ne(d.aQ);function le(re){return function(ce,ee,G){if(ce=g.ToUint32(ce),ce+re.BYTES_PER_ELEMENT>this.byteLength)throw new RangeError("Array index out of range");var U=new re([ee]),N=new d.SE(U.buffer),W=[],Q,te;for(Q=0;Q<re.BYTES_PER_ELEMENT;Q+=1)W.push(j(N,Q));!!G==!!Z&&W.reverse(),te=new d.SE(this.buffer,ce,re.BYTES_PER_ELEMENT),te.set(W)}}Y.prototype.setUint8=le(d.SE),Y.prototype.setInt8=le(d.fo),Y.prototype.setUint16=le(d.hR),Y.prototype.setInt16=le(d.ss),Y.prototype.setUint32=le(d.bt),Y.prototype.setInt32=le(d.GM),Y.prototype.setFloat32=le(d.l6),Y.prototype.setFloat64=le(d.aQ),d.U$=d.U$||Y})()}),6367:(S=>{/*!
|
|
335
|
+
*/var b=c(827),g=c(4096);S.exports=f,S.exports.is=m,S.exports.hasBody=u,S.exports.normalize=a,S.exports.match=t;function m(e,o){var s,i=o,p=n(e);if(!p)return!1;if(i&&!Array.isArray(i))for(i=new Array(arguments.length-1),s=0;s<i.length;s++)i[s]=arguments[s+1];if(!i||!i.length)return p;var l;for(s=0;s<i.length;s++)if(t(a(l=i[s]),p))return l[0]==="+"||l.indexOf("*")!==-1?p:l;return!1}function u(e){return e.headers["transfer-encoding"]!==void 0||!isNaN(e.headers["content-length"])}function f(e,o){var s=o;if(!u(e))return null;if(arguments.length>2){s=new Array(arguments.length-1);for(var i=0;i<s.length;i++)s[i]=arguments[i+1]}var p=e.headers["content-type"];return m(p,s)}function a(e){if(typeof e!="string")return!1;switch(e){case"urlencoded":return"application/x-www-form-urlencoded";case"multipart":return"multipart/*"}return e[0]==="+"?"*/*"+e:e.indexOf("/")===-1?g.lookup(e):e}function t(e,o){if(e===!1)return!1;var s=o.split("/"),i=e.split("/");return s.length!==2||i.length!==2||i[0]!=="*"&&i[0]!==s[0]?!1:i[1].substr(0,2)==="*+"?i[1].length<=s[1].length+1&&i[1].substr(1)===s[1].substr(1-i[1].length):!(i[1]!=="*"&&i[1]!==s[1])}function r(e){var o=b.parse(e);return o.parameters=void 0,b.format(o)}function n(e){if(!e)return null;try{return r(e)}catch{return null}}}),4698:((S,d)=>{var c=void 0,b=1e5,g=(function(){var j=Object.prototype.toString,Z=Object.prototype.hasOwnProperty;return{Class:function(Y){return j.call(Y).replace(/^\[object *|\]$/g,"")},HasProperty:function(Y,ne){return ne in Y},HasOwnProperty:function(Y,ne){return Z.call(Y,ne)},IsCallable:function(Y){return typeof Y=="function"},ToInt32:function(Y){return Y>>0},ToUint32:function(Y){return Y>>>0}}})(),m=Math.LN2,u=Math.abs,f=Math.floor,a=Math.log,t=Math.min,r=Math.pow,n=Math.round;function e(j){if(s&&o){var Z=s(j),Y;for(Y=0;Y<Z.length;Y+=1)o(j,Z[Y],{value:j[Z[Y]],writable:!1,enumerable:!1,configurable:!1})}}var o;Object.defineProperty&&(function(){try{return Object.defineProperty({},"x",{}),!0}catch{return!1}})()?o=Object.defineProperty:o=function(j,Z,Y){if(!j===Object(j))throw new TypeError("Object.defineProperty called on non-object");return g.HasProperty(Y,"get")&&Object.prototype.__defineGetter__&&Object.prototype.__defineGetter__.call(j,Z,Y.get),g.HasProperty(Y,"set")&&Object.prototype.__defineSetter__&&Object.prototype.__defineSetter__.call(j,Z,Y.set),g.HasProperty(Y,"value")&&(j[Z]=Y.value),j};var s=Object.getOwnPropertyNames||function(j){if(j!==Object(j))throw new TypeError("Object.getOwnPropertyNames called on non-object");var Z=[],Y;for(Y in j)g.HasOwnProperty(j,Y)&&Z.push(Y);return Z};function i(j){if(!o)return;if(j.length>b)throw new RangeError("Array too large for polyfill");function Z(ne){o(j,ne,{get:function(){return j._getter(ne)},set:function(le){j._setter(ne,le)},enumerable:!0,configurable:!1})}var Y;for(Y=0;Y<j.length;Y+=1)Z(Y)}function p(j,Z){var Y=32-Z;return j<<Y>>Y}function l(j,Z){var Y=32-Z;return j<<Y>>>Y}function h(j){return[j&255]}function v(j){return p(j[0],8)}function w(j){return[j&255]}function E(j){return l(j[0],8)}function A(j){return j=n(Number(j)),[j<0?0:j>255?255:j&255]}function O(j){return[j>>8&255,j&255]}function C(j){return p(j[0]<<8|j[1],16)}function _(j){return[j>>8&255,j&255]}function T(j){return l(j[0]<<8|j[1],16)}function k(j){return[j>>24&255,j>>16&255,j>>8&255,j&255]}function R(j){return p(j[0]<<24|j[1]<<16|j[2]<<8|j[3],32)}function I(j){return[j>>24&255,j>>16&255,j>>8&255,j&255]}function L(j){return l(j[0]<<24|j[1]<<16|j[2]<<8|j[3],32)}function P(j,Z,Y){var ne=(1<<Z-1)-1,le,re,ce,ee,G,U,N,W;function Q(te){var F=f(te),D=te-F;return D<.5?F:D>.5||F%2?F+1:F}for(j!==j?(re=(1<<Z)-1,ce=r(2,Y-1),le=0):j===1/0||j===-1/0?(re=(1<<Z)-1,ce=0,le=j<0?1:0):j===0?(re=0,ce=0,le=1/j===-1/0?1:0):(le=j<0,j=u(j),j>=r(2,1-ne)?(re=t(f(a(j)/m),1023),ce=Q(j/r(2,re)*r(2,Y)),ce/r(2,Y)>=2&&(re=re+1,ce=1),re>ne?(re=(1<<Z)-1,ce=0):(re=re+ne,ce=ce-r(2,Y))):(re=0,ce=Q(j/r(2,1-ne-Y)))),U=[],G=Y;G;G-=1)U.push(ce%2?1:0),ce=f(ce/2);for(G=Z;G;G-=1)U.push(re%2?1:0),re=f(re/2);for(U.push(le?1:0),U.reverse(),N=U.join(""),W=[];N.length;)W.push(parseInt(N.substring(0,8),2)),N=N.substring(8);return W}function B(j,Z,Y){var ne=[],le,re,ce,ee,G,U,N,W;for(le=j.length;le;le-=1)for(ce=j[le-1],re=8;re;re-=1)ne.push(ce%2?1:0),ce=ce>>1;return ne.reverse(),ee=ne.join(""),G=(1<<Z-1)-1,U=parseInt(ee.substring(0,1),2)?-1:1,N=parseInt(ee.substring(1,1+Z),2),W=parseInt(ee.substring(1+Z),2),N===(1<<Z)-1?W!==0?NaN:U*(1/0):N>0?U*r(2,N-G)*(1+W/r(2,Y)):W!==0?U*r(2,-(G-1))*(W/r(2,Y)):U<0?-0:0}function M(j){return B(j,11,52)}function z(j){return P(j,11,52)}function $(j){return B(j,8,23)}function K(j){return P(j,8,23)}(function(){var j=function(te){if(te=g.ToInt32(te),te<0)throw new RangeError("ArrayBuffer size is not a small enough positive integer");this.byteLength=te,this._bytes=[],this._bytes.length=te;var F;for(F=0;F<this.byteLength;F+=1)this._bytes[F]=0;e(this)};d.Az=d.Az||j;var Z=function(){};function Y(Q,te,F){var D;return D=function(X,ie,ue){var H,V,ae,se;if(!arguments.length||typeof arguments[0]=="number"){if(this.length=g.ToInt32(arguments[0]),ue<0)throw new RangeError("ArrayBufferView size is not a small enough positive integer");this.byteLength=this.length*this.BYTES_PER_ELEMENT,this.buffer=new j(this.byteLength),this.byteOffset=0}else if(typeof arguments[0]=="object"&&arguments[0].constructor===D)for(H=arguments[0],this.length=H.length,this.byteLength=this.length*this.BYTES_PER_ELEMENT,this.buffer=new j(this.byteLength),this.byteOffset=0,ae=0;ae<this.length;ae+=1)this._setter(ae,H._getter(ae));else if(typeof arguments[0]=="object"&&!(arguments[0]instanceof j||g.Class(arguments[0])==="ArrayBuffer"))for(V=arguments[0],this.length=g.ToUint32(V.length),this.byteLength=this.length*this.BYTES_PER_ELEMENT,this.buffer=new j(this.byteLength),this.byteOffset=0,ae=0;ae<this.length;ae+=1)se=V[ae],this._setter(ae,Number(se));else if(typeof arguments[0]=="object"&&(arguments[0]instanceof j||g.Class(arguments[0])==="ArrayBuffer")){if(this.buffer=X,this.byteOffset=g.ToUint32(ie),this.byteOffset>this.buffer.byteLength)throw new RangeError("byteOffset out of range");if(this.byteOffset%this.BYTES_PER_ELEMENT)throw new RangeError("ArrayBuffer length minus the byteOffset is not a multiple of the element size.");if(arguments.length<3){if(this.byteLength=this.buffer.byteLength-this.byteOffset,this.byteLength%this.BYTES_PER_ELEMENT)throw new RangeError("length of buffer minus byteOffset not a multiple of the element size");this.length=this.byteLength/this.BYTES_PER_ELEMENT}else this.length=g.ToUint32(ue),this.byteLength=this.length*this.BYTES_PER_ELEMENT;if(this.byteOffset+this.byteLength>this.buffer.byteLength)throw new RangeError("byteOffset and length reference an area beyond the end of the buffer")}else throw new TypeError("Unexpected argument type(s)");this.constructor=D,e(this),i(this)},D.prototype=new Z,D.prototype.BYTES_PER_ELEMENT=Q,D.prototype._pack=te,D.prototype._unpack=F,D.BYTES_PER_ELEMENT=Q,D.prototype._getter=function(X){if(arguments.length<1)throw new SyntaxError("Not enough arguments");if(X=g.ToUint32(X),X>=this.length)return c;var ie=[],ue,H;for(ue=0,H=this.byteOffset+X*this.BYTES_PER_ELEMENT;ue<this.BYTES_PER_ELEMENT;ue+=1,H+=1)ie.push(this.buffer._bytes[H]);return this._unpack(ie)},D.prototype.get=D.prototype._getter,D.prototype._setter=function(X,ie){if(arguments.length<2)throw new SyntaxError("Not enough arguments");if(X=g.ToUint32(X),X>=this.length)return c;var ue=this._pack(ie),H,V;for(H=0,V=this.byteOffset+X*this.BYTES_PER_ELEMENT;H<this.BYTES_PER_ELEMENT;H+=1,V+=1)this.buffer._bytes[V]=ue[H]},D.prototype.set=function(X,ie){if(arguments.length<1)throw new SyntaxError("Not enough arguments");var ue,H,V,ae,se,oe,fe,he,pe,ye;if(typeof arguments[0]=="object"&&arguments[0].constructor===this.constructor){if(ue=arguments[0],V=g.ToUint32(arguments[1]),V+ue.length>this.length)throw new RangeError("Offset plus length of array is out of range");if(he=this.byteOffset+V*this.BYTES_PER_ELEMENT,pe=ue.length*this.BYTES_PER_ELEMENT,ue.buffer===this.buffer){for(ye=[],se=0,oe=ue.byteOffset;se<pe;se+=1,oe+=1)ye[se]=ue.buffer._bytes[oe];for(se=0,fe=he;se<pe;se+=1,fe+=1)this.buffer._bytes[fe]=ye[se]}else for(se=0,oe=ue.byteOffset,fe=he;se<pe;se+=1,oe+=1,fe+=1)this.buffer._bytes[fe]=ue.buffer._bytes[oe]}else if(typeof arguments[0]=="object"&&typeof arguments[0].length<"u"){if(H=arguments[0],ae=g.ToUint32(H.length),V=g.ToUint32(arguments[1]),V+ae>this.length)throw new RangeError("Offset plus length of array is out of range");for(se=0;se<ae;se+=1)oe=H[se],this._setter(V+se,Number(oe))}else throw new TypeError("Unexpected argument type(s)")},D.prototype.subarray=function(X,ie){function ue(V,ae,se){return V<ae?ae:V>se?se:V}X=g.ToInt32(X),ie=g.ToInt32(ie),arguments.length<1&&(X=0),arguments.length<2&&(ie=this.length),X<0&&(X=this.length+X),ie<0&&(ie=this.length+ie),X=ue(X,0,this.length),ie=ue(ie,0,this.length);var H=ie-X;return H<0&&(H=0),new this.constructor(this.buffer,this.byteOffset+X*this.BYTES_PER_ELEMENT,H)},D}var ne=Y(1,h,v),le=Y(1,w,E),re=Y(1,A,E),ce=Y(2,O,C),ee=Y(2,_,T),G=Y(4,k,R),U=Y(4,I,L),N=Y(4,K,$),W=Y(8,z,M);d.fo=d.fo||ne,d.SE=d.SE||le,d.ER=d.ER||re,d.ss=d.ss||ce,d.hR=d.hR||ee,d.GM=d.GM||G,d.bt=d.bt||U,d.l6=d.l6||N,d.aQ=d.aQ||W})(),(function(){function j(re,ce){return g.IsCallable(re.get)?re.get(ce):re[ce]}var Z=(function(){var re=new d.hR([4660]),ce=new d.SE(re.buffer);return j(ce,0)===18})(),Y=function(ce,ee,G){if(arguments.length===0)ce=new d.Az(0);else if(!(ce instanceof d.Az||g.Class(ce)==="ArrayBuffer"))throw new TypeError("TypeError");if(this.buffer=ce||new d.Az(0),this.byteOffset=g.ToUint32(ee),this.byteOffset>this.buffer.byteLength)throw new RangeError("byteOffset out of range");if(arguments.length<3?this.byteLength=this.buffer.byteLength-this.byteOffset:this.byteLength=g.ToUint32(G),this.byteOffset+this.byteLength>this.buffer.byteLength)throw new RangeError("byteOffset and length reference an area beyond the end of the buffer");e(this)};function ne(re){return function(ce,ee){if(ce=g.ToUint32(ce),ce+re.BYTES_PER_ELEMENT>this.byteLength)throw new RangeError("Array index out of range");ce+=this.byteOffset;var G=new d.SE(this.buffer,ce,re.BYTES_PER_ELEMENT),U=[],N;for(N=0;N<re.BYTES_PER_ELEMENT;N+=1)U.push(j(G,N));return!!ee==!!Z&&U.reverse(),j(new re(new d.SE(U).buffer),0)}}Y.prototype.getUint8=ne(d.SE),Y.prototype.getInt8=ne(d.fo),Y.prototype.getUint16=ne(d.hR),Y.prototype.getInt16=ne(d.ss),Y.prototype.getUint32=ne(d.bt),Y.prototype.getInt32=ne(d.GM),Y.prototype.getFloat32=ne(d.l6),Y.prototype.getFloat64=ne(d.aQ);function le(re){return function(ce,ee,G){if(ce=g.ToUint32(ce),ce+re.BYTES_PER_ELEMENT>this.byteLength)throw new RangeError("Array index out of range");var U=new re([ee]),N=new d.SE(U.buffer),W=[],Q,te;for(Q=0;Q<re.BYTES_PER_ELEMENT;Q+=1)W.push(j(N,Q));!!G==!!Z&&W.reverse(),te=new d.SE(this.buffer,ce,re.BYTES_PER_ELEMENT),te.set(W)}}Y.prototype.setUint8=le(d.SE),Y.prototype.setInt8=le(d.fo),Y.prototype.setUint16=le(d.hR),Y.prototype.setInt16=le(d.ss),Y.prototype.setUint32=le(d.bt),Y.prototype.setInt32=le(d.GM),Y.prototype.setFloat32=le(d.l6),Y.prototype.setFloat64=le(d.aQ),d.U$=d.U$||Y})()}),6367:(S=>{/*!
|
|
336
336
|
* unpipe
|
|
337
337
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
338
338
|
* MIT Licensed
|
|
@@ -346,7 +346,7 @@ Minimum version required to store current data is: `+L+`.
|
|
|
346
346
|
`+Object.keys(T).map(k=>`${k}: ${T[k]}`).join(`\r
|
|
347
347
|
`)+`\r
|
|
348
348
|
\r
|
|
349
|
-
`+_)}function A(O,C,_,T,k,R){if(O.listenerCount("wsClientError")){const I=new Error(k);Error.captureStackTrace(I,A),O.emit("wsClientError",I,_,C)}else E(_,T,k,R)}}),6681:((S,d,c)=>{const b=c(4434),g=c(5692),m=c(8611),u=c(9278),f=c(4756),{randomBytes:a,createHash:t}=c(6982),{Duplex:r,Readable:n}=c(2203),{URL:e}=c(7016),o=c(4376),s=c(893),i=c(7389),{isBlob:p}=c(6615),{BINARY_TYPES:l,EMPTY_BUFFER:h,GUID:v,kForOnEventAttribute:w,kListener:E,kStatusCode:A,kWebSocket:O,NOOP:C}=c(1791),{EventTarget:{addEventListener:_,removeEventListener:T}}=c(4634),{format:k,parse:R}=c(1335),{toBuffer:I}=c(5803),L=30*1e3,P=Symbol("kAborted"),B=[8,13],M=["CONNECTING","OPEN","CLOSING","CLOSED"],z=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/;class $ extends b{constructor(V,ae,se){super(),this._binaryType=l[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=h,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=$.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,V!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,ae===void 0?ae=[]:Array.isArray(ae)||(typeof ae=="object"&&ae!==null?(se=ae,ae=[]):ae=[ae]),K(this,V,ae,se)):(this._autoPong=se.autoPong,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(V){l.includes(V)&&(this._binaryType=V,this._receiver&&(this._receiver._binaryType=V))}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(V,ae,se){const oe=new s({allowSynchronousEvents:se.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:se.maxPayload,skipUTF8Validation:se.skipUTF8Validation}),fe=new i(V,this._extensions,se.generateMask);this._receiver=oe,this._sender=fe,this._socket=V,oe[O]=this,fe[O]=this,V[O]=this,oe.on("conclude",re),oe.on("drain",ce),oe.on("error",ee),oe.on("message",U),oe.on("ping",N),oe.on("pong",W),fe.onerror=te,V.setTimeout&&V.setTimeout(0),V.setNoDelay&&V.setNoDelay(),ae.length>0&&V.unshift(ae),V.on("close",D),V.on("data",J),V.on("end",ie),V.on("error",ue),this._readyState=$.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=$.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[o.extensionName]&&this._extensions[o.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=$.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(V,ae){if(this.readyState!==$.CLOSED){if(this.readyState===$.CONNECTING){ne(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===$.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=$.CLOSING,this._sender.close(V,ae,!this._isServer,se=>{se||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),F(this)}}pause(){this.readyState===$.CONNECTING||this.readyState===$.CLOSED||(this._paused=!0,this._socket.pause())}ping(V,ae,se){if(this.readyState===$.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof V=="function"?(se=V,V=ae=void 0):typeof ae=="function"&&(se=ae,ae=void 0),typeof V=="number"&&(V=V.toString()),this.readyState!==$.OPEN){le(this,V,se);return}ae===void 0&&(ae=!this._isServer),this._sender.ping(V||h,ae,se)}pong(V,ae,se){if(this.readyState===$.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof V=="function"?(se=V,V=ae=void 0):typeof ae=="function"&&(se=ae,ae=void 0),typeof V=="number"&&(V=V.toString()),this.readyState!==$.OPEN){le(this,V,se);return}ae===void 0&&(ae=!this._isServer),this._sender.pong(V||h,ae,se)}resume(){this.readyState===$.CONNECTING||this.readyState===$.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(V,ae,se){if(this.readyState===$.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof ae=="function"&&(se=ae,ae={}),typeof V=="number"&&(V=V.toString()),this.readyState!==$.OPEN){le(this,V,se);return}const oe={binary:typeof V!="string",mask:!this._isServer,compress:!0,fin:!0,...ae};this._extensions[o.extensionName]||(oe.compress=!1),this._sender.send(V||h,oe,se)}terminate(){if(this.readyState!==$.CLOSED){if(this.readyState===$.CONNECTING){ne(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=$.CLOSING,this._socket.destroy())}}}Object.defineProperty($,"CONNECTING",{enumerable:!0,value:M.indexOf("CONNECTING")}),Object.defineProperty($.prototype,"CONNECTING",{enumerable:!0,value:M.indexOf("CONNECTING")}),Object.defineProperty($,"OPEN",{enumerable:!0,value:M.indexOf("OPEN")}),Object.defineProperty($.prototype,"OPEN",{enumerable:!0,value:M.indexOf("OPEN")}),Object.defineProperty($,"CLOSING",{enumerable:!0,value:M.indexOf("CLOSING")}),Object.defineProperty($.prototype,"CLOSING",{enumerable:!0,value:M.indexOf("CLOSING")}),Object.defineProperty($,"CLOSED",{enumerable:!0,value:M.indexOf("CLOSED")}),Object.defineProperty($.prototype,"CLOSED",{enumerable:!0,value:M.indexOf("CLOSED")}),["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(H=>{Object.defineProperty($.prototype,H,{enumerable:!0})}),["open","error","close","message"].forEach(H=>{Object.defineProperty($.prototype,`on${H}`,{enumerable:!0,get(){for(const V of this.listeners(H))if(V[w])return V[E];return null},set(V){for(const ae of this.listeners(H))if(ae[w]){this.removeListener(H,ae);break}typeof V=="function"&&this.addEventListener(H,V,{[w]:!0})}})}),$.prototype.addEventListener=_,$.prototype.removeEventListener=T,S.exports=$;function K(H,V,ae,se){const oe={allowSynchronousEvents:!0,autoPong:!0,protocolVersion:B[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...se,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(H._autoPong=oe.autoPong,!B.includes(oe.protocolVersion))throw new RangeError(`Unsupported protocol version: ${oe.protocolVersion} (supported versions: ${B.join(", ")})`);let fe;if(V instanceof e)fe=V;else try{fe=new e(V)}catch{throw new SyntaxError(`Invalid URL: ${V}`)}fe.protocol==="http:"?fe.protocol="ws:":fe.protocol==="https:"&&(fe.protocol="wss:"),H._url=fe.href;const he=fe.protocol==="wss:",pe=fe.protocol==="ws+unix:";let ye;if(fe.protocol!=="ws:"&&!he&&!pe?ye=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:pe&&!fe.pathname?ye="The URL's pathname is empty":fe.hash&&(ye="The URL contains a fragment identifier"),ye){const ve=new SyntaxError(ye);if(H._redirects===0)throw ve;j(H,ve);return}const Ae=he?443:80,ge=a(16).toString("base64"),Ee=he?g.request:m.request,Se=new Set;let Pe;if(oe.createConnection=oe.createConnection||(he?Y:Z),oe.defaultPort=oe.defaultPort||Ae,oe.port=fe.port||Ae,oe.host=fe.hostname.startsWith("[")?fe.hostname.slice(1,-1):fe.hostname,oe.headers={...oe.headers,"Sec-WebSocket-Version":oe.protocolVersion,"Sec-WebSocket-Key":ge,Connection:"Upgrade",Upgrade:"websocket"},oe.path=fe.pathname+fe.search,oe.timeout=oe.handshakeTimeout,oe.perMessageDeflate&&(Pe=new o(oe.perMessageDeflate!==!0?oe.perMessageDeflate:{},!1,oe.maxPayload),oe.headers["Sec-WebSocket-Extensions"]=k({[o.extensionName]:Pe.offer()})),ae.length){for(const ve of ae){if(typeof ve!="string"||!z.test(ve)||Se.has(ve))throw new SyntaxError("An invalid or duplicated subprotocol was specified");Se.add(ve)}oe.headers["Sec-WebSocket-Protocol"]=ae.join(",")}if(oe.origin&&(oe.protocolVersion<13?oe.headers["Sec-WebSocket-Origin"]=oe.origin:oe.headers.Origin=oe.origin),(fe.username||fe.password)&&(oe.auth=`${fe.username}:${fe.password}`),pe){const ve=oe.path.split(":");oe.socketPath=ve[0],oe.path=ve[1]}let we;if(oe.followRedirects){if(H._redirects===0){H._originalIpc=pe,H._originalSecure=he,H._originalHostOrSocketPath=pe?oe.socketPath:fe.host;const ve=se&&se.headers;if(se={...se,headers:{}},ve)for(const[Ce,Oe]of Object.entries(ve))se.headers[Ce.toLowerCase()]=Oe}else if(H.listenerCount("redirect")===0){const ve=pe?H._originalIpc?oe.socketPath===H._originalHostOrSocketPath:!1:H._originalIpc?!1:fe.host===H._originalHostOrSocketPath;(!ve||H._originalSecure&&!he)&&(delete oe.headers.authorization,delete oe.headers.cookie,ve||delete oe.headers.host,oe.auth=void 0)}oe.auth&&!se.headers.authorization&&(se.headers.authorization="Basic "+Buffer.from(oe.auth).toString("base64")),we=H._req=Ee(oe),H._redirects&&H.emit("redirect",H.url,we)}else we=H._req=Ee(oe);oe.timeout&&we.on("timeout",()=>{ne(H,we,"Opening handshake has timed out")}),we.on("error",ve=>{we===null||we[P]||(we=H._req=null,j(H,ve))}),we.on("response",ve=>{const Ce=ve.headers.location,Oe=ve.statusCode;if(Ce&&oe.followRedirects&&Oe>=300&&Oe<400){if(++H._redirects>oe.maxRedirects){ne(H,we,"Maximum redirects exceeded");return}we.abort();let Re;try{Re=new e(Ce,V)}catch{const q=new SyntaxError(`Invalid URL: ${Ce}`);j(H,q);return}K(H,Re,ae,se)}else H.emit("unexpected-response",we,ve)||ne(H,we,`Unexpected server response: ${ve.statusCode}`)}),we.on("upgrade",(ve,Ce,Oe)=>{if(H.emit("upgrade",ve),H.readyState!==$.CONNECTING)return;we=H._req=null;const Re=ve.headers.upgrade;if(Re===void 0||Re.toLowerCase()!=="websocket"){ne(H,Ce,"Invalid Upgrade header");return}const X=t("sha1").update(ge+v).digest("base64");if(ve.headers["sec-websocket-accept"]!==X){ne(H,Ce,"Invalid Sec-WebSocket-Accept header");return}const q=ve.headers["sec-websocket-protocol"];let me;if(q!==void 0?Se.size?Se.has(q)||(me="Server sent an invalid subprotocol"):me="Server sent a subprotocol but none was requested":Se.size&&(me="Server sent no subprotocol"),me){ne(H,Ce,me);return}q&&(H._protocol=q);const be=ve.headers["sec-websocket-extensions"];if(be!==void 0){if(!Pe){ne(H,Ce,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let xe;try{xe=R(be)}catch{ne(H,Ce,"Invalid Sec-WebSocket-Extensions header");return}const de=Object.keys(xe);if(de.length!==1||de[0]!==o.extensionName){ne(H,Ce,"Server indicated an extension that was not requested");return}try{Pe.accept(xe[o.extensionName])}catch{ne(H,Ce,"Invalid Sec-WebSocket-Extensions header");return}H._extensions[o.extensionName]=Pe}H.setSocket(Ce,Oe,{allowSynchronousEvents:oe.allowSynchronousEvents,generateMask:oe.generateMask,maxPayload:oe.maxPayload,skipUTF8Validation:oe.skipUTF8Validation})}),oe.finishRequest?oe.finishRequest(we,H):we.end()}function j(H,V){H._readyState=$.CLOSING,H._errorEmitted=!0,H.emit("error",V),H.emitClose()}function Z(H){return H.path=H.socketPath,u.connect(H)}function Y(H){return H.path=void 0,!H.servername&&H.servername!==""&&(H.servername=u.isIP(H.host)?"":H.host),f.connect(H)}function ne(H,V,ae){H._readyState=$.CLOSING;const se=new Error(ae);Error.captureStackTrace(se,ne),V.setHeader?(V[P]=!0,V.abort(),V.socket&&!V.socket.destroyed&&V.socket.destroy(),process.nextTick(j,H,se)):(V.destroy(se),V.once("error",H.emit.bind(H,"error")),V.once("close",H.emitClose.bind(H)))}function le(H,V,ae){if(V){const se=p(V)?V.size:I(V).length;H._socket?H._sender._bufferedBytes+=se:H._bufferedAmount+=se}if(ae){const se=new Error(`WebSocket is not open: readyState ${H.readyState} (${M[H.readyState]})`);process.nextTick(ae,se)}}function re(H,V){const ae=this[O];ae._closeFrameReceived=!0,ae._closeMessage=V,ae._closeCode=H,ae._socket[O]!==void 0&&(ae._socket.removeListener("data",J),process.nextTick(Q,ae._socket),H===1005?ae.close():ae.close(H,V))}function ce(){const H=this[O];H.isPaused||H._socket.resume()}function ee(H){const V=this[O];V._socket[O]!==void 0&&(V._socket.removeListener("data",J),process.nextTick(Q,V._socket),V.close(H[A])),V._errorEmitted||(V._errorEmitted=!0,V.emit("error",H))}function G(){this[O].emitClose()}function U(H,V){this[O].emit("message",H,V)}function N(H){const V=this[O];V._autoPong&&V.pong(H,!this._isServer,C),V.emit("ping",H)}function W(H){this[O].emit("pong",H)}function Q(H){H.resume()}function te(H){const V=this[O];V.readyState!==$.CLOSED&&(V.readyState===$.OPEN&&(V._readyState=$.CLOSING,F(V)),this._socket.end(),V._errorEmitted||(V._errorEmitted=!0,V.emit("error",H)))}function F(H){H._closeTimer=setTimeout(H._socket.destroy.bind(H._socket),L)}function D(){const H=this[O];this.removeListener("close",D),this.removeListener("data",J),this.removeListener("end",ie),H._readyState=$.CLOSING;let V;!this._readableState.endEmitted&&!H._closeFrameReceived&&!H._receiver._writableState.errorEmitted&&(V=H._socket.read())!==null&&H._receiver.write(V),H._receiver.end(),this[O]=void 0,clearTimeout(H._closeTimer),H._receiver._writableState.finished||H._receiver._writableState.errorEmitted?H.emitClose():(H._receiver.on("error",G),H._receiver.on("finish",G))}function J(H){this[O]._receiver.write(H)||this.pause()}function ie(){const H=this[O];H._readyState=$.CLOSING,H._receiver.end(),this.end()}function ue(){const H=this[O];this.removeListener("error",ue),this.on("error",C),H&&(H._readyState=$.CLOSING,this.destroy())}}),8327:(module=>{module.exports=eval("require")("bufferutil")}),75:(module=>{module.exports=eval("require")("supports-color")}),2414:(module=>{module.exports=eval("require")("utf-8-validate")}),2613:(S=>{S.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("assert")}),290:(S=>{S.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("async_hooks")}),181:(S=>{S.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("buffer")}),6982:(S=>{S.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("crypto")}),4434:(S=>{S.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("events")}),9896:(S=>{S.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("fs")}),8611:(S=>{S.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("http")}),5692:(S=>{S.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("https")}),9278:(S=>{S.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("net")}),857:(S=>{S.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("os")}),6928:(S=>{S.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("path")}),3480:(S=>{S.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("querystring")}),2203:(S=>{S.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("stream")}),3193:(S=>{S.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("string_decoder")}),3557:(S=>{S.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("timers")}),4756:(S=>{S.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("tls")}),2018:(S=>{S.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("tty")}),7016:(S=>{S.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("url")}),9023:(S=>{S.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("util")}),3106:(S=>{S.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("zlib")}),2998:((S,d)=>{d.Emitter=c;function c(g){if(g)return b(g)}function b(g){for(var m in c.prototype)g[m]=c.prototype[m];return g}c.prototype.on=c.prototype.addEventListener=function(g,m){return this._callbacks=this._callbacks||{},(this._callbacks["$"+g]=this._callbacks["$"+g]||[]).push(m),this},c.prototype.once=function(g,m){function u(){this.off(g,u),m.apply(this,arguments)}return u.fn=m,this.on(g,u),this},c.prototype.off=c.prototype.removeListener=c.prototype.removeAllListeners=c.prototype.removeEventListener=function(g,m){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var u=this._callbacks["$"+g];if(!u)return this;if(arguments.length==1)return delete this._callbacks["$"+g],this;for(var f,a=0;a<u.length;a++)if(f=u[a],f===m||f.fn===m){u.splice(a,1);break}return u.length===0&&delete this._callbacks["$"+g],this},c.prototype.emit=function(g){this._callbacks=this._callbacks||{};for(var m=new Array(arguments.length-1),u=this._callbacks["$"+g],f=1;f<arguments.length;f++)m[f-1]=arguments[f];if(u){u=u.slice(0);for(var f=0,a=u.length;f<a;++f)u[f].apply(this,m)}return this},c.prototype.emitReserved=c.prototype.emit,c.prototype.listeners=function(g){return this._callbacks=this._callbacks||{},this._callbacks["$"+g]||[]},c.prototype.hasListeners=function(g){return!!this.listeners(g).length}}),2717:((S,d)=>{Object.defineProperty(d,"__esModule",{value:!0}),d.ERROR_PACKET=d.PACKET_TYPES_REVERSE=d.PACKET_TYPES=void 0;const c=Object.create(null);d.PACKET_TYPES=c,c.open="0",c.close="1",c.ping="2",c.pong="3",c.message="4",c.upgrade="5",c.noop="6";const b=Object.create(null);d.PACKET_TYPES_REVERSE=b,Object.keys(c).forEach(m=>{b[c[m]]=m});const g={type:"error",data:"parser error"};d.ERROR_PACKET=g}),3377:((S,d,c)=>{Object.defineProperty(d,"__esModule",{value:!0}),d.decodePacket=void 0;const b=c(2717),g=(u,f)=>{if(typeof u!="string")return{type:"message",data:m(u,f)};const a=u.charAt(0);if(a==="b"){const t=Buffer.from(u.substring(1),"base64");return{type:"message",data:m(t,f)}}return b.PACKET_TYPES_REVERSE[a]?u.length>1?{type:b.PACKET_TYPES_REVERSE[a],data:u.substring(1)}:{type:b.PACKET_TYPES_REVERSE[a]}:b.ERROR_PACKET};d.decodePacket=g;const m=(u,f)=>f==="arraybuffer"?u instanceof ArrayBuffer?u:Buffer.isBuffer(u)?u.buffer.slice(u.byteOffset,u.byteOffset+u.byteLength):u.buffer:Buffer.isBuffer(u)?u:Buffer.from(u)}),5897:((S,d,c)=>{Object.defineProperty(d,"__esModule",{value:!0}),d.encodePacket=void 0,d.encodePacketToBinary=f;const b=c(2717),g=({type:a,data:t},r,n)=>t instanceof ArrayBuffer||ArrayBuffer.isView(t)?n(r?t:"b"+m(t,!0).toString("base64")):n(b.PACKET_TYPES[a]+(t||""));d.encodePacket=g;const m=(a,t)=>Buffer.isBuffer(a)||a instanceof Uint8Array&&!t?a:a instanceof ArrayBuffer?Buffer.from(a):Buffer.from(a.buffer,a.byteOffset,a.byteLength);let u;function f(a,t){if(a.data instanceof ArrayBuffer||ArrayBuffer.isView(a.data))return t(m(a.data,!1));(0,d.encodePacket)(a,!0,r=>{u||(u=new TextEncoder),t(u.encode(r))})}}),8007:((S,d,c)=>{Object.defineProperty(d,"__esModule",{value:!0}),d.decodePayload=d.decodePacket=d.encodePayload=d.encodePacket=d.protocol=void 0,d.createPacketEncoderStream=t,d.createPacketDecoderStream=o;const b=c(5897);Object.defineProperty(d,"encodePacket",{enumerable:!0,get:function(){return b.encodePacket}});const g=c(3377);Object.defineProperty(d,"decodePacket",{enumerable:!0,get:function(){return g.decodePacket}});const m=c(2717),u="",f=(s,i)=>{const p=s.length,l=new Array(p);let h=0;s.forEach((v,w)=>{(0,b.encodePacket)(v,!1,E=>{l[w]=E,++h===p&&i(l.join(u))})})};d.encodePayload=f;const a=(s,i)=>{const p=s.split(u),l=[];for(let h=0;h<p.length;h++){const v=(0,g.decodePacket)(p[h],i);if(l.push(v),v.type==="error")break}return l};d.decodePayload=a;function t(){return new TransformStream({transform(s,i){(0,b.encodePacketToBinary)(s,p=>{const l=p.length;let h;if(l<126)h=new Uint8Array(1),new DataView(h.buffer).setUint8(0,l);else if(l<65536){h=new Uint8Array(3);const v=new DataView(h.buffer);v.setUint8(0,126),v.setUint16(1,l)}else{h=new Uint8Array(9);const v=new DataView(h.buffer);v.setUint8(0,127),v.setBigUint64(1,BigInt(l))}s.data&&typeof s.data!="string"&&(h[0]|=128),i.enqueue(h),i.enqueue(p)})}})}let r;function n(s){return s.reduce((i,p)=>i+p.length,0)}function e(s,i){if(s[0].length===i)return s.shift();const p=new Uint8Array(i);let l=0;for(let h=0;h<i;h++)p[h]=s[0][l++],l===s[0].length&&(s.shift(),l=0);return s.length&&l<s[0].length&&(s[0]=s[0].slice(l)),p}function o(s,i){r||(r=new TextDecoder);const p=[];let l=0,h=-1,v=!1;return new TransformStream({transform(w,E){for(p.push(w);;){if(l===0){if(n(p)<1)break;const A=e(p,1);v=(A[0]&128)===128,h=A[0]&127,h<126?l=3:h===126?l=1:l=2}else if(l===1){if(n(p)<2)break;const A=e(p,2);h=new DataView(A.buffer,A.byteOffset,A.length).getUint16(0),l=3}else if(l===2){if(n(p)<8)break;const A=e(p,8),O=new DataView(A.buffer,A.byteOffset,A.length),C=O.getUint32(0);if(C>Math.pow(2,21)-1){E.enqueue(m.ERROR_PACKET);break}h=C*Math.pow(2,32)+O.getUint32(4),l=3}else{if(n(p)<h)break;const A=e(p,h);E.enqueue((0,g.decodePacket)(v?A:r.decode(A),i)),l=0}if(h===0||h>s){E.enqueue(m.ERROR_PACKET);break}}}})}d.protocol=4}),68:((S,d,c)=>{Object.defineProperty(d,"__esModule",{value:!0}),d.protocol=d.Transport=d.Socket=d.uServer=d.parser=d.transports=d.Server=void 0,d.listen=r,d.attach=n;const b=c(8611),g=c(2317);Object.defineProperty(d,"Server",{enumerable:!0,get:function(){return g.Server}});const m=c(2975);d.transports=m.default;const u=c(8007);d.parser=u;var f=c(2056);Object.defineProperty(d,"uServer",{enumerable:!0,get:function(){return f.uServer}});var a=c(3739);Object.defineProperty(d,"Socket",{enumerable:!0,get:function(){return a.Socket}});var t=c(4621);Object.defineProperty(d,"Transport",{enumerable:!0,get:function(){return t.Transport}}),d.protocol=u.protocol;function r(e,o,s){typeof o=="function"&&(s=o,o={});const i=(0,b.createServer)(function(l,h){h.writeHead(501),h.end("Not Implemented")}),p=n(i,o);return p.httpServer=i,i.listen(e,s),p}function n(e,o){const s=new g.Server(o);return s.attach(e,o),s}}),2674:((S,d,c)=>{Object.defineProperty(d,"__esModule",{value:!0}),d.packets=d.protocol=void 0,d.encodePacket=a,d.encodeBase64Packet=r,d.decodePacket=n,d.decodeBase64Packet=o,d.encodePayload=s,d.decodePayload=l,d.encodePayloadAsBinary=E,d.decodePayloadAsBinary=O;var b=c(4875);d.protocol=3;const g=C=>{for(const _ of C)if(_.data instanceof ArrayBuffer||ArrayBuffer.isView(_.data))return!0;return!1};d.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6};var m=Object.keys(d.packets),u={type:"error",data:"parser error"};const f=Buffer.concat([]);function a(C,_,T,k){if(typeof _=="function"&&(k=_,_=null),typeof T=="function"&&(k=T,T=null),Buffer.isBuffer(C.data))return t(C,_,k);if(C.data&&(C.data.buffer||C.data)instanceof ArrayBuffer)return t({type:C.type,data:w(C.data)},_,k);var R=d.packets[C.type];return C.data!==void 0&&(R+=T?b.encode(String(C.data),{strict:!1}):String(C.data)),k(""+R)}function t(C,_,T){if(!_)return r(C,T);var k=C.data,R=Buffer.allocUnsafe(1);return R[0]=d.packets[C.type],T(Buffer.concat([R,k]))}function r(C,_){var T=Buffer.isBuffer(C.data)?C.data:w(C.data),k="b"+d.packets[C.type];return k+=T.toString("base64"),_(k)}function n(C,_,T){if(C===void 0)return u;let k;if(typeof C=="string")return k=C.charAt(0),k==="b"?o(C.slice(1),_):T&&(C=e(C),C===!1)||Number(k)!=k||!m[k]?u:C.length>1?{type:m[k],data:C.slice(1)}:{type:m[k]};if(_==="arraybuffer"){var R=new Uint8Array(C);return k=R[0],{type:m[k],data:R.buffer.slice(1)}}return C instanceof ArrayBuffer&&(C=w(C)),k=C[0],{type:m[k],data:C.slice(1)}}function e(C){try{C=b.decode(C,{strict:!1})}catch{return!1}return C}function o(C,_){var T=m[C.charAt(0)],k=Buffer.from(C.slice(1),"base64");if(_==="arraybuffer"){for(var R=new Uint8Array(k.length),I=0;I<R.length;I++)R[I]=k[I];k=R.buffer}return{type:T,data:k}}function s(C,_,T){if(typeof _=="function"&&(T=_,_=null),_&&g(C))return E(C,T);if(!C.length)return T("0:");function k(R,I){a(R,_,!1,function(L){I(null,i(L))})}p(C,k,function(R,I){return T(I.join(""))})}function i(C){return C.length+":"+C}function p(C,_,T){const k=new Array(C.length);let R=0;for(let I=0;I<C.length;I++)_(C[I],(L,P)=>{k[I]=P,++R===C.length&&T(null,k)})}function l(C,_,T){if(typeof C!="string")return O(C,_,T);if(typeof _=="function"&&(T=_,_=null),C==="")return T(u,0,1);for(var k="",R,I,L,P=0,B=C.length;P<B;P++){var M=C.charAt(P);if(M!==":"){k+=M;continue}if(k===""||k!=(R=Number(k))||(I=C.slice(P+1,P+1+R),k!=I.length))return T(u,0,1);if(I.length){if(L=n(I,_,!1),u.type===L.type&&u.data===L.data)return T(u,0,1);var z=T(L,P+R,B);if(z===!1)return}P+=R,k=""}if(k!=="")return T(u,0,1)}function h(C){for(var _="",T=0,k=C.length;T<k;T++)_+=String.fromCharCode(C[T]);return _}function v(C){for(var _=Buffer.allocUnsafe(C.length),T=0,k=C.length;T<k;T++)_.writeUInt8(C.charCodeAt(T),T);return _}function w(C){var _=C.byteLength||C.length,T=C.byteOffset||0;return Buffer.from(C.buffer||C,T,_)}function E(C,_){if(!C.length)return _(f);p(C,A,function(T,k){return _(Buffer.concat(k))})}function A(C,_){function T(k){var R=""+k.length,I;if(typeof k=="string"){I=Buffer.allocUnsafe(R.length+2),I[0]=0;for(var L=0;L<R.length;L++)I[L+1]=parseInt(R[L],10);return I[I.length-1]=255,_(null,Buffer.concat([I,v(k)]))}I=Buffer.allocUnsafe(R.length+2),I[0]=1;for(var L=0;L<R.length;L++)I[L+1]=parseInt(R[L],10);I[I.length-1]=255,_(null,Buffer.concat([I,k]))}a(C,!0,!0,T)}function O(C,_,T){typeof _=="function"&&(T=_,_=null);for(var k=C,R=[],I;k.length>0;){var L="",P=k[0]===0;for(I=1;k[I]!==255;I++){if(L.length>310)return T(u,0,1);L+=""+k[I]}k=k.slice(L.length+1);var B=parseInt(L,10),M=k.slice(1,B+1);P&&(M=h(M)),R.push(M),k=k.slice(B+1)}var z=R.length;for(I=0;I<z;I++){var $=R[I];T(n($,_,!0),I,z)}}}),4875:(S=>{/*! https://mths.be/utf8js v2.1.2 by @mathias */var d=String.fromCharCode;function c(s){for(var i=[],p=0,l=s.length,h,v;p<l;)h=s.charCodeAt(p++),h>=55296&&h<=56319&&p<l?(v=s.charCodeAt(p++),(v&64512)==56320?i.push(((h&1023)<<10)+(v&1023)+65536):(i.push(h),p--)):i.push(h);return i}function b(s){for(var i=s.length,p=-1,l,h="";++p<i;)l=s[p],l>65535&&(l-=65536,h+=d(l>>>10&1023|55296),l=56320|l&1023),h+=d(l);return h}function g(s,i){if(s>=55296&&s<=57343){if(i)throw Error("Lone surrogate U+"+s.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function m(s,i){return d(s>>i&63|128)}function u(s,i){if((s&4294967168)==0)return d(s);var p="";return(s&4294965248)==0?p=d(s>>6&31|192):(s&4294901760)==0?(g(s,i)||(s=65533),p=d(s>>12&15|224),p+=m(s,6)):(s&4292870144)==0&&(p=d(s>>18&7|240),p+=m(s,12),p+=m(s,6)),p+=d(s&63|128),p}function f(s,i){i=i||{};for(var p=i.strict!==!1,l=c(s),h=l.length,v=-1,w,E="";++v<h;)w=l[v],E+=u(w,p);return E}function a(){if(e>=n)throw Error("Invalid byte index");var s=r[e]&255;if(e++,(s&192)==128)return s&63;throw Error("Invalid continuation byte")}function t(s){var i,p,l,h,v;if(e>n)throw Error("Invalid byte index");if(e==n)return!1;if(i=r[e]&255,e++,(i&128)==0)return i;if((i&224)==192){if(p=a(),v=(i&31)<<6|p,v>=128)return v;throw Error("Invalid continuation byte")}if((i&240)==224){if(p=a(),l=a(),v=(i&15)<<12|p<<6|l,v>=2048)return g(v,s)?v:65533;throw Error("Invalid continuation byte")}if((i&248)==240&&(p=a(),l=a(),h=a(),v=(i&7)<<18|p<<12|l<<6|h,v>=65536&&v<=1114111))return v;throw Error("Invalid UTF-8 detected")}var r,n,e;function o(s,i){i=i||{};var p=i.strict!==!1;r=c(s),n=r.length,e=0;for(var l=[],h;(h=t(p))!==!1;)l.push(h);return b(l)}S.exports={version:"2.1.2",encode:f,decode:o}}),2317:((S,d,c)=>{Object.defineProperty(d,"__esModule",{value:!0}),d.Server=d.BaseServer=void 0;const b=c(1942),g=c(2975),m=c(4434),u=c(3739),f=c(26),a=c(3814),t=c(1354),r=c(8868),n=c(8007),e=(0,f.default)("engine"),o=Symbol("responseHeaders");function s(A){try{const O=JSON.parse(A);if(typeof O.sid=="string")return O.sid}catch{}}class i extends m.EventEmitter{constructor(O={}){super(),this.middlewares=[],this.clients={},this.clientsCount=0,this.opts=Object.assign({wsEngine:t.Server,pingTimeout:2e4,pingInterval:25e3,upgradeTimeout:1e4,maxHttpBufferSize:1e6,transports:["polling","websocket"],allowUpgrades:!0,httpCompression:{threshold:1024},cors:!1,allowEIO3:!1},O),O.cookie&&(this.opts.cookie=Object.assign({name:"io",path:"/",httpOnly:O.cookie.path!==!1,sameSite:"lax"},O.cookie)),this.opts.cors&&this.use(c(4085)(this.opts.cors)),O.perMessageDeflate&&(this.opts.perMessageDeflate=Object.assign({threshold:1024},O.perMessageDeflate)),this.init()}_computePath(O){let C=(O.path||"/engine.io").replace(/\/$/,"");return O.addTrailingSlash!==!1&&(C+="/"),C}upgrades(O){return this.opts.allowUpgrades?g.default[O].upgradesTo||[]:[]}verify(O,C,_){const T=O._query.transport;if(!~this.opts.transports.indexOf(T)||T==="webtransport")return e('unknown transport "%s"',T),_(l.errors.UNKNOWN_TRANSPORT,{transport:T});if(E(O.headers.origin)){const I=O.headers.origin;return O.headers.origin=null,e("origin header invalid"),_(l.errors.BAD_REQUEST,{name:"INVALID_ORIGIN",origin:I})}const R=O._query.sid;if(R){if(!this.clients.hasOwnProperty(R))return e('unknown sid "%s"',R),_(l.errors.UNKNOWN_SID,{sid:R});const I=this.clients[R].transport.name;if(!C&&I!==T)return e("bad request: unexpected transport without upgrade"),_(l.errors.BAD_REQUEST,{name:"TRANSPORT_MISMATCH",transport:T,previousTransport:I})}else return O.method!=="GET"?_(l.errors.BAD_HANDSHAKE_METHOD,{method:O.method}):T==="websocket"&&!C?(e("invalid transport upgrade"),_(l.errors.BAD_REQUEST,{name:"TRANSPORT_HANDSHAKE_ERROR"})):this.opts.allowRequest?this.opts.allowRequest(O,(I,L)=>{if(!L)return _(l.errors.FORBIDDEN,{message:I});_()}):_();_()}use(O){this.middlewares.push(O)}_applyMiddlewares(O,C,_){if(this.middlewares.length===0)return e("no middleware to apply, skipping"),_();const T=k=>{e("applying middleware n\xB0%d",k+1),this.middlewares[k](O,C,R=>{if(R)return _(R);k+1<this.middlewares.length?T(k+1):_()})};T(0)}close(){e("closing all open clients");for(let O in this.clients)this.clients.hasOwnProperty(O)&&this.clients[O].close(!0);return this.cleanup(),this}generateId(O){return b.generateId()}async handshake(O,C,_){const T=C._query.EIO==="4"?4:3;if(T===3&&!this.opts.allowEIO3){e("unsupported protocol version"),this.emit("connection_error",{req:C,code:l.errors.UNSUPPORTED_PROTOCOL_VERSION,message:l.errorMessages[l.errors.UNSUPPORTED_PROTOCOL_VERSION],context:{protocol:T}}),_(l.errors.UNSUPPORTED_PROTOCOL_VERSION);return}let k;try{k=await this.generateId(C)}catch(L){e("error while generating an id"),this.emit("connection_error",{req:C,code:l.errors.BAD_REQUEST,message:l.errorMessages[l.errors.BAD_REQUEST],context:{name:"ID_GENERATION_ERROR",error:L}}),_(l.errors.BAD_REQUEST);return}e('handshaking client "%s"',k);try{var R=this.createTransport(O,C);O==="polling"?(R.maxHttpBufferSize=this.opts.maxHttpBufferSize,R.httpCompression=this.opts.httpCompression):O==="websocket"&&(R.perMessageDeflate=this.opts.perMessageDeflate)}catch(L){e('error handshaking to transport "%s"',O),this.emit("connection_error",{req:C,code:l.errors.BAD_REQUEST,message:l.errorMessages[l.errors.BAD_REQUEST],context:{name:"TRANSPORT_HANDSHAKE_ERROR",error:L}}),_(l.errors.BAD_REQUEST);return}const I=new u.Socket(k,this,R,C,T);return R.on("headers",(L,P)=>{!P._query.sid&&(this.opts.cookie&&(L["Set-Cookie"]=[(0,a.serialize)(this.opts.cookie.name,k,this.opts.cookie)]),this.emit("initial_headers",L,P)),this.emit("headers",L,P)}),R.onRequest(C),this.clients[k]=I,this.clientsCount++,I.once("close",()=>{delete this.clients[k],this.clientsCount--}),this.emit("connection",I),R}async onWebTransportSession(O){const C=setTimeout(()=>{e("the client failed to establish a bidirectional stream in the given period"),O.close()},this.opts.upgradeTimeout),T=await O.incomingBidirectionalStreams.getReader().read();if(T.done){e("session is closed");return}const k=T.value,R=(0,n.createPacketDecoderStream)(this.opts.maxHttpBufferSize,"nodebuffer"),I=k.readable.pipeThrough(R).getReader(),{value:L,done:P}=await I.read();if(P){e("stream is closed");return}if(clearTimeout(C),L.type!=="open")return e("invalid WebTransport handshake"),O.close();if(L.data===void 0){const z=new r.WebTransport(O,k,I),$=b.generateId();e('handshaking client "%s" (WebTransport)',$);const K=new u.Socket($,this,z,null,4);this.clients[$]=K,this.clientsCount++,K.once("close",()=>{delete this.clients[$],this.clientsCount--}),this.emit("connection",K);return}const B=s(L.data);if(!B)return e("invalid WebTransport handshake"),O.close();const M=this.clients[B];if(!M)e("upgrade attempt for closed client"),O.close();else if(M.upgrading)e("transport has already been trying to upgrade"),O.close();else if(M.upgraded)e("transport had already been upgraded"),O.close();else{e("upgrading existing transport");const z=new r.WebTransport(O,k,I);M._maybeUpgrade(z)}}}d.BaseServer=i,i.errors={UNKNOWN_TRANSPORT:0,UNKNOWN_SID:1,BAD_HANDSHAKE_METHOD:2,BAD_REQUEST:3,FORBIDDEN:4,UNSUPPORTED_PROTOCOL_VERSION:5},i.errorMessages={0:"Transport unknown",1:"Session ID unknown",2:"Bad handshake method",3:"Bad request",4:"Forbidden",5:"Unsupported protocol version"};class p{constructor(O,C){this.req=O,this.socket=C,O[o]={}}setHeader(O,C){this.req[o][O]=C}getHeader(O){return this.req[o][O]}removeHeader(O){delete this.req[o][O]}write(){}writeHead(){}end(){this.socket.destroy()}}class l extends i{init(){~this.opts.transports.indexOf("websocket")&&(this.ws&&this.ws.close(),this.ws=new this.opts.wsEngine({noServer:!0,clientTracking:!1,perMessageDeflate:this.opts.perMessageDeflate,maxPayload:this.opts.maxHttpBufferSize}),typeof this.ws.on=="function"&&this.ws.on("headers",(O,C)=>{const _=C[o]||{};delete C[o],!C._query.sid&&this.emit("initial_headers",_,C),this.emit("headers",_,C),e("writing headers: %j",_),Object.keys(_).forEach(k=>{O.push(`${k}: ${_[k]}`)})}))}cleanup(){this.ws&&(e("closing webSocketServer"),this.ws.close())}prepare(O){if(!O._query){const C=new URL(O.url,"https://socket.io");O._query=Object.fromEntries(C.searchParams.entries())}}createTransport(O,C){return new g.default[O](C)}handleRequest(O,C){e('handling "%s" http request "%s"',O.method,O.url),this.prepare(O),O.res=C;const _=(T,k)=>{if(T!==void 0){this.emit("connection_error",{req:O,code:T,message:l.errorMessages[T],context:k}),h(C,T,k);return}if(O._query.sid)e("setting new request for existing client"),this.clients[O._query.sid].transport.onRequest(O);else{const R=(I,L)=>h(C,I,L);this.handshake(O._query.transport,O,R)}};this._applyMiddlewares(O,C,T=>{T?_(l.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(O,!1,_)})}handleUpgrade(O,C,_){this.prepare(O);const T=new p(O,C),k=(R,I)=>{if(R!==void 0){this.emit("connection_error",{req:O,code:R,message:l.errorMessages[R],context:I}),v(C,R,I);return}const L=Buffer.from(_);_=null,T.writeHead(),this.ws.handleUpgrade(O,C,L,P=>{this.onWebSocket(O,C,P)})};this._applyMiddlewares(O,T,R=>{R?k(l.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(O,!0,k)})}onWebSocket(O,C,_){if(_.on("error",k),g.default[O._query.transport]!==void 0&&!g.default[O._query.transport].prototype.handlesUpgrades){e("transport doesnt handle upgraded requests"),_.close();return}const T=O._query.sid;if(O.websocket=_,T){const R=this.clients[T];if(!R)e("upgrade attempt for closed client"),_.close();else if(R.upgrading)e("transport has already been trying to upgrade"),_.close();else if(R.upgraded)e("transport had already been upgraded"),_.close();else{e("upgrading existing transport"),_.removeListener("error",k);const I=this.createTransport(O._query.transport,O);I.perMessageDeflate=this.opts.perMessageDeflate,R._maybeUpgrade(I)}}else{const R=(I,L)=>v(C,I,L);this.handshake(O._query.transport,O,R)}function k(){e("websocket error before upgrade")}}attach(O,C={}){const _=this._computePath(C),T=C.destroyUpgradeTimeout||1e3;function k(I){return _===I.url.slice(0,_.length)}const R=O.listeners("request").slice(0);O.removeAllListeners("request"),O.on("close",this.close.bind(this)),O.on("listening",this.init.bind(this)),O.on("request",(I,L)=>{if(k(I))e('intercepting request for path "%s"',_),this.handleRequest(I,L);else{let P=0;const B=R.length;for(;P<B;P++)R[P].call(O,I,L)}}),~this.opts.transports.indexOf("websocket")&&O.on("upgrade",(I,L,P)=>{k(I)?this.handleUpgrade(I,L,P):C.destroyUpgrade!==!1&&setTimeout(function(){if(L.writable&&L.bytesWritten<=0)return L.on("error",B=>{e("error while destroying upgrade: %s",B.message)}),L.end()},T)})}}d.Server=l;function h(A,O,C){const _=O===l.errors.FORBIDDEN?403:400,T=C&&C.message?C.message:l.errorMessages[O];A.writeHead(_,{"Content-Type":"application/json"}),A.end(JSON.stringify({code:O,message:T}))}function v(A,O,C={}){if(A.on("error",()=>{e("ignoring error from closed connection")}),A.writable){const _=C.message||l.errorMessages[O],T=Buffer.byteLength(_);A.write(`HTTP/1.1 400 Bad Request\r
|
|
349
|
+
`+_)}function A(O,C,_,T,k,R){if(O.listenerCount("wsClientError")){const I=new Error(k);Error.captureStackTrace(I,A),O.emit("wsClientError",I,_,C)}else E(_,T,k,R)}}),6681:((S,d,c)=>{const b=c(4434),g=c(5692),m=c(8611),u=c(9278),f=c(4756),{randomBytes:a,createHash:t}=c(6982),{Duplex:r,Readable:n}=c(2203),{URL:e}=c(7016),o=c(4376),s=c(893),i=c(7389),{isBlob:p}=c(6615),{BINARY_TYPES:l,EMPTY_BUFFER:h,GUID:v,kForOnEventAttribute:w,kListener:E,kStatusCode:A,kWebSocket:O,NOOP:C}=c(1791),{EventTarget:{addEventListener:_,removeEventListener:T}}=c(4634),{format:k,parse:R}=c(1335),{toBuffer:I}=c(5803),L=30*1e3,P=Symbol("kAborted"),B=[8,13],M=["CONNECTING","OPEN","CLOSING","CLOSED"],z=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/;class $ extends b{constructor(V,ae,se){super(),this._binaryType=l[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=h,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=$.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,V!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,ae===void 0?ae=[]:Array.isArray(ae)||(typeof ae=="object"&&ae!==null?(se=ae,ae=[]):ae=[ae]),K(this,V,ae,se)):(this._autoPong=se.autoPong,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(V){l.includes(V)&&(this._binaryType=V,this._receiver&&(this._receiver._binaryType=V))}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(V,ae,se){const oe=new s({allowSynchronousEvents:se.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:se.maxPayload,skipUTF8Validation:se.skipUTF8Validation}),fe=new i(V,this._extensions,se.generateMask);this._receiver=oe,this._sender=fe,this._socket=V,oe[O]=this,fe[O]=this,V[O]=this,oe.on("conclude",re),oe.on("drain",ce),oe.on("error",ee),oe.on("message",U),oe.on("ping",N),oe.on("pong",W),fe.onerror=te,V.setTimeout&&V.setTimeout(0),V.setNoDelay&&V.setNoDelay(),ae.length>0&&V.unshift(ae),V.on("close",D),V.on("data",X),V.on("end",ie),V.on("error",ue),this._readyState=$.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=$.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[o.extensionName]&&this._extensions[o.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=$.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(V,ae){if(this.readyState!==$.CLOSED){if(this.readyState===$.CONNECTING){ne(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===$.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=$.CLOSING,this._sender.close(V,ae,!this._isServer,se=>{se||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),F(this)}}pause(){this.readyState===$.CONNECTING||this.readyState===$.CLOSED||(this._paused=!0,this._socket.pause())}ping(V,ae,se){if(this.readyState===$.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof V=="function"?(se=V,V=ae=void 0):typeof ae=="function"&&(se=ae,ae=void 0),typeof V=="number"&&(V=V.toString()),this.readyState!==$.OPEN){le(this,V,se);return}ae===void 0&&(ae=!this._isServer),this._sender.ping(V||h,ae,se)}pong(V,ae,se){if(this.readyState===$.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof V=="function"?(se=V,V=ae=void 0):typeof ae=="function"&&(se=ae,ae=void 0),typeof V=="number"&&(V=V.toString()),this.readyState!==$.OPEN){le(this,V,se);return}ae===void 0&&(ae=!this._isServer),this._sender.pong(V||h,ae,se)}resume(){this.readyState===$.CONNECTING||this.readyState===$.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(V,ae,se){if(this.readyState===$.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof ae=="function"&&(se=ae,ae={}),typeof V=="number"&&(V=V.toString()),this.readyState!==$.OPEN){le(this,V,se);return}const oe={binary:typeof V!="string",mask:!this._isServer,compress:!0,fin:!0,...ae};this._extensions[o.extensionName]||(oe.compress=!1),this._sender.send(V||h,oe,se)}terminate(){if(this.readyState!==$.CLOSED){if(this.readyState===$.CONNECTING){ne(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=$.CLOSING,this._socket.destroy())}}}Object.defineProperty($,"CONNECTING",{enumerable:!0,value:M.indexOf("CONNECTING")}),Object.defineProperty($.prototype,"CONNECTING",{enumerable:!0,value:M.indexOf("CONNECTING")}),Object.defineProperty($,"OPEN",{enumerable:!0,value:M.indexOf("OPEN")}),Object.defineProperty($.prototype,"OPEN",{enumerable:!0,value:M.indexOf("OPEN")}),Object.defineProperty($,"CLOSING",{enumerable:!0,value:M.indexOf("CLOSING")}),Object.defineProperty($.prototype,"CLOSING",{enumerable:!0,value:M.indexOf("CLOSING")}),Object.defineProperty($,"CLOSED",{enumerable:!0,value:M.indexOf("CLOSED")}),Object.defineProperty($.prototype,"CLOSED",{enumerable:!0,value:M.indexOf("CLOSED")}),["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(H=>{Object.defineProperty($.prototype,H,{enumerable:!0})}),["open","error","close","message"].forEach(H=>{Object.defineProperty($.prototype,`on${H}`,{enumerable:!0,get(){for(const V of this.listeners(H))if(V[w])return V[E];return null},set(V){for(const ae of this.listeners(H))if(ae[w]){this.removeListener(H,ae);break}typeof V=="function"&&this.addEventListener(H,V,{[w]:!0})}})}),$.prototype.addEventListener=_,$.prototype.removeEventListener=T,S.exports=$;function K(H,V,ae,se){const oe={allowSynchronousEvents:!0,autoPong:!0,protocolVersion:B[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...se,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(H._autoPong=oe.autoPong,!B.includes(oe.protocolVersion))throw new RangeError(`Unsupported protocol version: ${oe.protocolVersion} (supported versions: ${B.join(", ")})`);let fe;if(V instanceof e)fe=V;else try{fe=new e(V)}catch{throw new SyntaxError(`Invalid URL: ${V}`)}fe.protocol==="http:"?fe.protocol="ws:":fe.protocol==="https:"&&(fe.protocol="wss:"),H._url=fe.href;const he=fe.protocol==="wss:",pe=fe.protocol==="ws+unix:";let ye;if(fe.protocol!=="ws:"&&!he&&!pe?ye=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:pe&&!fe.pathname?ye="The URL's pathname is empty":fe.hash&&(ye="The URL contains a fragment identifier"),ye){const ve=new SyntaxError(ye);if(H._redirects===0)throw ve;j(H,ve);return}const Ae=he?443:80,ge=a(16).toString("base64"),Ee=he?g.request:m.request,Se=new Set;let Pe;if(oe.createConnection=oe.createConnection||(he?Y:Z),oe.defaultPort=oe.defaultPort||Ae,oe.port=fe.port||Ae,oe.host=fe.hostname.startsWith("[")?fe.hostname.slice(1,-1):fe.hostname,oe.headers={...oe.headers,"Sec-WebSocket-Version":oe.protocolVersion,"Sec-WebSocket-Key":ge,Connection:"Upgrade",Upgrade:"websocket"},oe.path=fe.pathname+fe.search,oe.timeout=oe.handshakeTimeout,oe.perMessageDeflate&&(Pe=new o(oe.perMessageDeflate!==!0?oe.perMessageDeflate:{},!1,oe.maxPayload),oe.headers["Sec-WebSocket-Extensions"]=k({[o.extensionName]:Pe.offer()})),ae.length){for(const ve of ae){if(typeof ve!="string"||!z.test(ve)||Se.has(ve))throw new SyntaxError("An invalid or duplicated subprotocol was specified");Se.add(ve)}oe.headers["Sec-WebSocket-Protocol"]=ae.join(",")}if(oe.origin&&(oe.protocolVersion<13?oe.headers["Sec-WebSocket-Origin"]=oe.origin:oe.headers.Origin=oe.origin),(fe.username||fe.password)&&(oe.auth=`${fe.username}:${fe.password}`),pe){const ve=oe.path.split(":");oe.socketPath=ve[0],oe.path=ve[1]}let we;if(oe.followRedirects){if(H._redirects===0){H._originalIpc=pe,H._originalSecure=he,H._originalHostOrSocketPath=pe?oe.socketPath:fe.host;const ve=se&&se.headers;if(se={...se,headers:{}},ve)for(const[Ce,Oe]of Object.entries(ve))se.headers[Ce.toLowerCase()]=Oe}else if(H.listenerCount("redirect")===0){const ve=pe?H._originalIpc?oe.socketPath===H._originalHostOrSocketPath:!1:H._originalIpc?!1:fe.host===H._originalHostOrSocketPath;(!ve||H._originalSecure&&!he)&&(delete oe.headers.authorization,delete oe.headers.cookie,ve||delete oe.headers.host,oe.auth=void 0)}oe.auth&&!se.headers.authorization&&(se.headers.authorization="Basic "+Buffer.from(oe.auth).toString("base64")),we=H._req=Ee(oe),H._redirects&&H.emit("redirect",H.url,we)}else we=H._req=Ee(oe);oe.timeout&&we.on("timeout",()=>{ne(H,we,"Opening handshake has timed out")}),we.on("error",ve=>{we===null||we[P]||(we=H._req=null,j(H,ve))}),we.on("response",ve=>{const Ce=ve.headers.location,Oe=ve.statusCode;if(Ce&&oe.followRedirects&&Oe>=300&&Oe<400){if(++H._redirects>oe.maxRedirects){ne(H,we,"Maximum redirects exceeded");return}we.abort();let Re;try{Re=new e(Ce,V)}catch{const q=new SyntaxError(`Invalid URL: ${Ce}`);j(H,q);return}K(H,Re,ae,se)}else H.emit("unexpected-response",we,ve)||ne(H,we,`Unexpected server response: ${ve.statusCode}`)}),we.on("upgrade",(ve,Ce,Oe)=>{if(H.emit("upgrade",ve),H.readyState!==$.CONNECTING)return;we=H._req=null;const Re=ve.headers.upgrade;if(Re===void 0||Re.toLowerCase()!=="websocket"){ne(H,Ce,"Invalid Upgrade header");return}const J=t("sha1").update(ge+v).digest("base64");if(ve.headers["sec-websocket-accept"]!==J){ne(H,Ce,"Invalid Sec-WebSocket-Accept header");return}const q=ve.headers["sec-websocket-protocol"];let me;if(q!==void 0?Se.size?Se.has(q)||(me="Server sent an invalid subprotocol"):me="Server sent a subprotocol but none was requested":Se.size&&(me="Server sent no subprotocol"),me){ne(H,Ce,me);return}q&&(H._protocol=q);const be=ve.headers["sec-websocket-extensions"];if(be!==void 0){if(!Pe){ne(H,Ce,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let xe;try{xe=R(be)}catch{ne(H,Ce,"Invalid Sec-WebSocket-Extensions header");return}const de=Object.keys(xe);if(de.length!==1||de[0]!==o.extensionName){ne(H,Ce,"Server indicated an extension that was not requested");return}try{Pe.accept(xe[o.extensionName])}catch{ne(H,Ce,"Invalid Sec-WebSocket-Extensions header");return}H._extensions[o.extensionName]=Pe}H.setSocket(Ce,Oe,{allowSynchronousEvents:oe.allowSynchronousEvents,generateMask:oe.generateMask,maxPayload:oe.maxPayload,skipUTF8Validation:oe.skipUTF8Validation})}),oe.finishRequest?oe.finishRequest(we,H):we.end()}function j(H,V){H._readyState=$.CLOSING,H._errorEmitted=!0,H.emit("error",V),H.emitClose()}function Z(H){return H.path=H.socketPath,u.connect(H)}function Y(H){return H.path=void 0,!H.servername&&H.servername!==""&&(H.servername=u.isIP(H.host)?"":H.host),f.connect(H)}function ne(H,V,ae){H._readyState=$.CLOSING;const se=new Error(ae);Error.captureStackTrace(se,ne),V.setHeader?(V[P]=!0,V.abort(),V.socket&&!V.socket.destroyed&&V.socket.destroy(),process.nextTick(j,H,se)):(V.destroy(se),V.once("error",H.emit.bind(H,"error")),V.once("close",H.emitClose.bind(H)))}function le(H,V,ae){if(V){const se=p(V)?V.size:I(V).length;H._socket?H._sender._bufferedBytes+=se:H._bufferedAmount+=se}if(ae){const se=new Error(`WebSocket is not open: readyState ${H.readyState} (${M[H.readyState]})`);process.nextTick(ae,se)}}function re(H,V){const ae=this[O];ae._closeFrameReceived=!0,ae._closeMessage=V,ae._closeCode=H,ae._socket[O]!==void 0&&(ae._socket.removeListener("data",X),process.nextTick(Q,ae._socket),H===1005?ae.close():ae.close(H,V))}function ce(){const H=this[O];H.isPaused||H._socket.resume()}function ee(H){const V=this[O];V._socket[O]!==void 0&&(V._socket.removeListener("data",X),process.nextTick(Q,V._socket),V.close(H[A])),V._errorEmitted||(V._errorEmitted=!0,V.emit("error",H))}function G(){this[O].emitClose()}function U(H,V){this[O].emit("message",H,V)}function N(H){const V=this[O];V._autoPong&&V.pong(H,!this._isServer,C),V.emit("ping",H)}function W(H){this[O].emit("pong",H)}function Q(H){H.resume()}function te(H){const V=this[O];V.readyState!==$.CLOSED&&(V.readyState===$.OPEN&&(V._readyState=$.CLOSING,F(V)),this._socket.end(),V._errorEmitted||(V._errorEmitted=!0,V.emit("error",H)))}function F(H){H._closeTimer=setTimeout(H._socket.destroy.bind(H._socket),L)}function D(){const H=this[O];this.removeListener("close",D),this.removeListener("data",X),this.removeListener("end",ie),H._readyState=$.CLOSING;let V;!this._readableState.endEmitted&&!H._closeFrameReceived&&!H._receiver._writableState.errorEmitted&&(V=H._socket.read())!==null&&H._receiver.write(V),H._receiver.end(),this[O]=void 0,clearTimeout(H._closeTimer),H._receiver._writableState.finished||H._receiver._writableState.errorEmitted?H.emitClose():(H._receiver.on("error",G),H._receiver.on("finish",G))}function X(H){this[O]._receiver.write(H)||this.pause()}function ie(){const H=this[O];H._readyState=$.CLOSING,H._receiver.end(),this.end()}function ue(){const H=this[O];this.removeListener("error",ue),this.on("error",C),H&&(H._readyState=$.CLOSING,this.destroy())}}),8327:(module=>{module.exports=eval("require")("bufferutil")}),75:(module=>{module.exports=eval("require")("supports-color")}),2414:(module=>{module.exports=eval("require")("utf-8-validate")}),2613:(S=>{S.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("assert")}),290:(S=>{S.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("async_hooks")}),181:(S=>{S.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("buffer")}),6982:(S=>{S.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("crypto")}),4434:(S=>{S.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("events")}),9896:(S=>{S.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("fs")}),8611:(S=>{S.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("http")}),5692:(S=>{S.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("https")}),9278:(S=>{S.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("net")}),857:(S=>{S.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("os")}),6928:(S=>{S.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("path")}),3480:(S=>{S.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("querystring")}),2203:(S=>{S.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("stream")}),3193:(S=>{S.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("string_decoder")}),3557:(S=>{S.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("timers")}),4756:(S=>{S.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("tls")}),2018:(S=>{S.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("tty")}),7016:(S=>{S.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("url")}),9023:(S=>{S.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("util")}),3106:(S=>{S.exports=__WEBPACK_EXTERNAL_createRequire(import.meta.url)("zlib")}),2998:((S,d)=>{d.Emitter=c;function c(g){if(g)return b(g)}function b(g){for(var m in c.prototype)g[m]=c.prototype[m];return g}c.prototype.on=c.prototype.addEventListener=function(g,m){return this._callbacks=this._callbacks||{},(this._callbacks["$"+g]=this._callbacks["$"+g]||[]).push(m),this},c.prototype.once=function(g,m){function u(){this.off(g,u),m.apply(this,arguments)}return u.fn=m,this.on(g,u),this},c.prototype.off=c.prototype.removeListener=c.prototype.removeAllListeners=c.prototype.removeEventListener=function(g,m){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var u=this._callbacks["$"+g];if(!u)return this;if(arguments.length==1)return delete this._callbacks["$"+g],this;for(var f,a=0;a<u.length;a++)if(f=u[a],f===m||f.fn===m){u.splice(a,1);break}return u.length===0&&delete this._callbacks["$"+g],this},c.prototype.emit=function(g){this._callbacks=this._callbacks||{};for(var m=new Array(arguments.length-1),u=this._callbacks["$"+g],f=1;f<arguments.length;f++)m[f-1]=arguments[f];if(u){u=u.slice(0);for(var f=0,a=u.length;f<a;++f)u[f].apply(this,m)}return this},c.prototype.emitReserved=c.prototype.emit,c.prototype.listeners=function(g){return this._callbacks=this._callbacks||{},this._callbacks["$"+g]||[]},c.prototype.hasListeners=function(g){return!!this.listeners(g).length}}),2717:((S,d)=>{Object.defineProperty(d,"__esModule",{value:!0}),d.ERROR_PACKET=d.PACKET_TYPES_REVERSE=d.PACKET_TYPES=void 0;const c=Object.create(null);d.PACKET_TYPES=c,c.open="0",c.close="1",c.ping="2",c.pong="3",c.message="4",c.upgrade="5",c.noop="6";const b=Object.create(null);d.PACKET_TYPES_REVERSE=b,Object.keys(c).forEach(m=>{b[c[m]]=m});const g={type:"error",data:"parser error"};d.ERROR_PACKET=g}),3377:((S,d,c)=>{Object.defineProperty(d,"__esModule",{value:!0}),d.decodePacket=void 0;const b=c(2717),g=(u,f)=>{if(typeof u!="string")return{type:"message",data:m(u,f)};const a=u.charAt(0);if(a==="b"){const t=Buffer.from(u.substring(1),"base64");return{type:"message",data:m(t,f)}}return b.PACKET_TYPES_REVERSE[a]?u.length>1?{type:b.PACKET_TYPES_REVERSE[a],data:u.substring(1)}:{type:b.PACKET_TYPES_REVERSE[a]}:b.ERROR_PACKET};d.decodePacket=g;const m=(u,f)=>f==="arraybuffer"?u instanceof ArrayBuffer?u:Buffer.isBuffer(u)?u.buffer.slice(u.byteOffset,u.byteOffset+u.byteLength):u.buffer:Buffer.isBuffer(u)?u:Buffer.from(u)}),5897:((S,d,c)=>{Object.defineProperty(d,"__esModule",{value:!0}),d.encodePacket=void 0,d.encodePacketToBinary=f;const b=c(2717),g=({type:a,data:t},r,n)=>t instanceof ArrayBuffer||ArrayBuffer.isView(t)?n(r?t:"b"+m(t,!0).toString("base64")):n(b.PACKET_TYPES[a]+(t||""));d.encodePacket=g;const m=(a,t)=>Buffer.isBuffer(a)||a instanceof Uint8Array&&!t?a:a instanceof ArrayBuffer?Buffer.from(a):Buffer.from(a.buffer,a.byteOffset,a.byteLength);let u;function f(a,t){if(a.data instanceof ArrayBuffer||ArrayBuffer.isView(a.data))return t(m(a.data,!1));(0,d.encodePacket)(a,!0,r=>{u||(u=new TextEncoder),t(u.encode(r))})}}),8007:((S,d,c)=>{Object.defineProperty(d,"__esModule",{value:!0}),d.decodePayload=d.decodePacket=d.encodePayload=d.encodePacket=d.protocol=void 0,d.createPacketEncoderStream=t,d.createPacketDecoderStream=o;const b=c(5897);Object.defineProperty(d,"encodePacket",{enumerable:!0,get:function(){return b.encodePacket}});const g=c(3377);Object.defineProperty(d,"decodePacket",{enumerable:!0,get:function(){return g.decodePacket}});const m=c(2717),u="",f=(s,i)=>{const p=s.length,l=new Array(p);let h=0;s.forEach((v,w)=>{(0,b.encodePacket)(v,!1,E=>{l[w]=E,++h===p&&i(l.join(u))})})};d.encodePayload=f;const a=(s,i)=>{const p=s.split(u),l=[];for(let h=0;h<p.length;h++){const v=(0,g.decodePacket)(p[h],i);if(l.push(v),v.type==="error")break}return l};d.decodePayload=a;function t(){return new TransformStream({transform(s,i){(0,b.encodePacketToBinary)(s,p=>{const l=p.length;let h;if(l<126)h=new Uint8Array(1),new DataView(h.buffer).setUint8(0,l);else if(l<65536){h=new Uint8Array(3);const v=new DataView(h.buffer);v.setUint8(0,126),v.setUint16(1,l)}else{h=new Uint8Array(9);const v=new DataView(h.buffer);v.setUint8(0,127),v.setBigUint64(1,BigInt(l))}s.data&&typeof s.data!="string"&&(h[0]|=128),i.enqueue(h),i.enqueue(p)})}})}let r;function n(s){return s.reduce((i,p)=>i+p.length,0)}function e(s,i){if(s[0].length===i)return s.shift();const p=new Uint8Array(i);let l=0;for(let h=0;h<i;h++)p[h]=s[0][l++],l===s[0].length&&(s.shift(),l=0);return s.length&&l<s[0].length&&(s[0]=s[0].slice(l)),p}function o(s,i){r||(r=new TextDecoder);const p=[];let l=0,h=-1,v=!1;return new TransformStream({transform(w,E){for(p.push(w);;){if(l===0){if(n(p)<1)break;const A=e(p,1);v=(A[0]&128)===128,h=A[0]&127,h<126?l=3:h===126?l=1:l=2}else if(l===1){if(n(p)<2)break;const A=e(p,2);h=new DataView(A.buffer,A.byteOffset,A.length).getUint16(0),l=3}else if(l===2){if(n(p)<8)break;const A=e(p,8),O=new DataView(A.buffer,A.byteOffset,A.length),C=O.getUint32(0);if(C>Math.pow(2,21)-1){E.enqueue(m.ERROR_PACKET);break}h=C*Math.pow(2,32)+O.getUint32(4),l=3}else{if(n(p)<h)break;const A=e(p,h);E.enqueue((0,g.decodePacket)(v?A:r.decode(A),i)),l=0}if(h===0||h>s){E.enqueue(m.ERROR_PACKET);break}}}})}d.protocol=4}),68:((S,d,c)=>{Object.defineProperty(d,"__esModule",{value:!0}),d.protocol=d.Transport=d.Socket=d.uServer=d.parser=d.transports=d.Server=void 0,d.listen=r,d.attach=n;const b=c(8611),g=c(2317);Object.defineProperty(d,"Server",{enumerable:!0,get:function(){return g.Server}});const m=c(2975);d.transports=m.default;const u=c(8007);d.parser=u;var f=c(2056);Object.defineProperty(d,"uServer",{enumerable:!0,get:function(){return f.uServer}});var a=c(3739);Object.defineProperty(d,"Socket",{enumerable:!0,get:function(){return a.Socket}});var t=c(4621);Object.defineProperty(d,"Transport",{enumerable:!0,get:function(){return t.Transport}}),d.protocol=u.protocol;function r(e,o,s){typeof o=="function"&&(s=o,o={});const i=(0,b.createServer)(function(l,h){h.writeHead(501),h.end("Not Implemented")}),p=n(i,o);return p.httpServer=i,i.listen(e,s),p}function n(e,o){const s=new g.Server(o);return s.attach(e,o),s}}),2674:((S,d,c)=>{Object.defineProperty(d,"__esModule",{value:!0}),d.packets=d.protocol=void 0,d.encodePacket=a,d.encodeBase64Packet=r,d.decodePacket=n,d.decodeBase64Packet=o,d.encodePayload=s,d.decodePayload=l,d.encodePayloadAsBinary=E,d.decodePayloadAsBinary=O;var b=c(4875);d.protocol=3;const g=C=>{for(const _ of C)if(_.data instanceof ArrayBuffer||ArrayBuffer.isView(_.data))return!0;return!1};d.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6};var m=Object.keys(d.packets),u={type:"error",data:"parser error"};const f=Buffer.concat([]);function a(C,_,T,k){if(typeof _=="function"&&(k=_,_=null),typeof T=="function"&&(k=T,T=null),Buffer.isBuffer(C.data))return t(C,_,k);if(C.data&&(C.data.buffer||C.data)instanceof ArrayBuffer)return t({type:C.type,data:w(C.data)},_,k);var R=d.packets[C.type];return C.data!==void 0&&(R+=T?b.encode(String(C.data),{strict:!1}):String(C.data)),k(""+R)}function t(C,_,T){if(!_)return r(C,T);var k=C.data,R=Buffer.allocUnsafe(1);return R[0]=d.packets[C.type],T(Buffer.concat([R,k]))}function r(C,_){var T=Buffer.isBuffer(C.data)?C.data:w(C.data),k="b"+d.packets[C.type];return k+=T.toString("base64"),_(k)}function n(C,_,T){if(C===void 0)return u;let k;if(typeof C=="string")return k=C.charAt(0),k==="b"?o(C.slice(1),_):T&&(C=e(C),C===!1)||Number(k)!=k||!m[k]?u:C.length>1?{type:m[k],data:C.slice(1)}:{type:m[k]};if(_==="arraybuffer"){var R=new Uint8Array(C);return k=R[0],{type:m[k],data:R.buffer.slice(1)}}return C instanceof ArrayBuffer&&(C=w(C)),k=C[0],{type:m[k],data:C.slice(1)}}function e(C){try{C=b.decode(C,{strict:!1})}catch{return!1}return C}function o(C,_){var T=m[C.charAt(0)],k=Buffer.from(C.slice(1),"base64");if(_==="arraybuffer"){for(var R=new Uint8Array(k.length),I=0;I<R.length;I++)R[I]=k[I];k=R.buffer}return{type:T,data:k}}function s(C,_,T){if(typeof _=="function"&&(T=_,_=null),_&&g(C))return E(C,T);if(!C.length)return T("0:");function k(R,I){a(R,_,!1,function(L){I(null,i(L))})}p(C,k,function(R,I){return T(I.join(""))})}function i(C){return C.length+":"+C}function p(C,_,T){const k=new Array(C.length);let R=0;for(let I=0;I<C.length;I++)_(C[I],(L,P)=>{k[I]=P,++R===C.length&&T(null,k)})}function l(C,_,T){if(typeof C!="string")return O(C,_,T);if(typeof _=="function"&&(T=_,_=null),C==="")return T(u,0,1);for(var k="",R,I,L,P=0,B=C.length;P<B;P++){var M=C.charAt(P);if(M!==":"){k+=M;continue}if(k===""||k!=(R=Number(k))||(I=C.slice(P+1,P+1+R),k!=I.length))return T(u,0,1);if(I.length){if(L=n(I,_,!1),u.type===L.type&&u.data===L.data)return T(u,0,1);var z=T(L,P+R,B);if(z===!1)return}P+=R,k=""}if(k!=="")return T(u,0,1)}function h(C){for(var _="",T=0,k=C.length;T<k;T++)_+=String.fromCharCode(C[T]);return _}function v(C){for(var _=Buffer.allocUnsafe(C.length),T=0,k=C.length;T<k;T++)_.writeUInt8(C.charCodeAt(T),T);return _}function w(C){var _=C.byteLength||C.length,T=C.byteOffset||0;return Buffer.from(C.buffer||C,T,_)}function E(C,_){if(!C.length)return _(f);p(C,A,function(T,k){return _(Buffer.concat(k))})}function A(C,_){function T(k){var R=""+k.length,I;if(typeof k=="string"){I=Buffer.allocUnsafe(R.length+2),I[0]=0;for(var L=0;L<R.length;L++)I[L+1]=parseInt(R[L],10);return I[I.length-1]=255,_(null,Buffer.concat([I,v(k)]))}I=Buffer.allocUnsafe(R.length+2),I[0]=1;for(var L=0;L<R.length;L++)I[L+1]=parseInt(R[L],10);I[I.length-1]=255,_(null,Buffer.concat([I,k]))}a(C,!0,!0,T)}function O(C,_,T){typeof _=="function"&&(T=_,_=null);for(var k=C,R=[],I;k.length>0;){var L="",P=k[0]===0;for(I=1;k[I]!==255;I++){if(L.length>310)return T(u,0,1);L+=""+k[I]}k=k.slice(L.length+1);var B=parseInt(L,10),M=k.slice(1,B+1);P&&(M=h(M)),R.push(M),k=k.slice(B+1)}var z=R.length;for(I=0;I<z;I++){var $=R[I];T(n($,_,!0),I,z)}}}),4875:(S=>{/*! https://mths.be/utf8js v2.1.2 by @mathias */var d=String.fromCharCode;function c(s){for(var i=[],p=0,l=s.length,h,v;p<l;)h=s.charCodeAt(p++),h>=55296&&h<=56319&&p<l?(v=s.charCodeAt(p++),(v&64512)==56320?i.push(((h&1023)<<10)+(v&1023)+65536):(i.push(h),p--)):i.push(h);return i}function b(s){for(var i=s.length,p=-1,l,h="";++p<i;)l=s[p],l>65535&&(l-=65536,h+=d(l>>>10&1023|55296),l=56320|l&1023),h+=d(l);return h}function g(s,i){if(s>=55296&&s<=57343){if(i)throw Error("Lone surrogate U+"+s.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function m(s,i){return d(s>>i&63|128)}function u(s,i){if((s&4294967168)==0)return d(s);var p="";return(s&4294965248)==0?p=d(s>>6&31|192):(s&4294901760)==0?(g(s,i)||(s=65533),p=d(s>>12&15|224),p+=m(s,6)):(s&4292870144)==0&&(p=d(s>>18&7|240),p+=m(s,12),p+=m(s,6)),p+=d(s&63|128),p}function f(s,i){i=i||{};for(var p=i.strict!==!1,l=c(s),h=l.length,v=-1,w,E="";++v<h;)w=l[v],E+=u(w,p);return E}function a(){if(e>=n)throw Error("Invalid byte index");var s=r[e]&255;if(e++,(s&192)==128)return s&63;throw Error("Invalid continuation byte")}function t(s){var i,p,l,h,v;if(e>n)throw Error("Invalid byte index");if(e==n)return!1;if(i=r[e]&255,e++,(i&128)==0)return i;if((i&224)==192){if(p=a(),v=(i&31)<<6|p,v>=128)return v;throw Error("Invalid continuation byte")}if((i&240)==224){if(p=a(),l=a(),v=(i&15)<<12|p<<6|l,v>=2048)return g(v,s)?v:65533;throw Error("Invalid continuation byte")}if((i&248)==240&&(p=a(),l=a(),h=a(),v=(i&7)<<18|p<<12|l<<6|h,v>=65536&&v<=1114111))return v;throw Error("Invalid UTF-8 detected")}var r,n,e;function o(s,i){i=i||{};var p=i.strict!==!1;r=c(s),n=r.length,e=0;for(var l=[],h;(h=t(p))!==!1;)l.push(h);return b(l)}S.exports={version:"2.1.2",encode:f,decode:o}}),2317:((S,d,c)=>{Object.defineProperty(d,"__esModule",{value:!0}),d.Server=d.BaseServer=void 0;const b=c(1942),g=c(2975),m=c(4434),u=c(3739),f=c(26),a=c(3814),t=c(1354),r=c(8868),n=c(8007),e=(0,f.default)("engine"),o=Symbol("responseHeaders");function s(A){try{const O=JSON.parse(A);if(typeof O.sid=="string")return O.sid}catch{}}class i extends m.EventEmitter{constructor(O={}){super(),this.middlewares=[],this.clients={},this.clientsCount=0,this.opts=Object.assign({wsEngine:t.Server,pingTimeout:2e4,pingInterval:25e3,upgradeTimeout:1e4,maxHttpBufferSize:1e6,transports:["polling","websocket"],allowUpgrades:!0,httpCompression:{threshold:1024},cors:!1,allowEIO3:!1},O),O.cookie&&(this.opts.cookie=Object.assign({name:"io",path:"/",httpOnly:O.cookie.path!==!1,sameSite:"lax"},O.cookie)),this.opts.cors&&this.use(c(4085)(this.opts.cors)),O.perMessageDeflate&&(this.opts.perMessageDeflate=Object.assign({threshold:1024},O.perMessageDeflate)),this.init()}_computePath(O){let C=(O.path||"/engine.io").replace(/\/$/,"");return O.addTrailingSlash!==!1&&(C+="/"),C}upgrades(O){return this.opts.allowUpgrades?g.default[O].upgradesTo||[]:[]}verify(O,C,_){const T=O._query.transport;if(!~this.opts.transports.indexOf(T)||T==="webtransport")return e('unknown transport "%s"',T),_(l.errors.UNKNOWN_TRANSPORT,{transport:T});if(E(O.headers.origin)){const I=O.headers.origin;return O.headers.origin=null,e("origin header invalid"),_(l.errors.BAD_REQUEST,{name:"INVALID_ORIGIN",origin:I})}const R=O._query.sid;if(R){if(!this.clients.hasOwnProperty(R))return e('unknown sid "%s"',R),_(l.errors.UNKNOWN_SID,{sid:R});const I=this.clients[R].transport.name;if(!C&&I!==T)return e("bad request: unexpected transport without upgrade"),_(l.errors.BAD_REQUEST,{name:"TRANSPORT_MISMATCH",transport:T,previousTransport:I})}else return O.method!=="GET"?_(l.errors.BAD_HANDSHAKE_METHOD,{method:O.method}):T==="websocket"&&!C?(e("invalid transport upgrade"),_(l.errors.BAD_REQUEST,{name:"TRANSPORT_HANDSHAKE_ERROR"})):this.opts.allowRequest?this.opts.allowRequest(O,(I,L)=>{if(!L)return _(l.errors.FORBIDDEN,{message:I});_()}):_();_()}use(O){this.middlewares.push(O)}_applyMiddlewares(O,C,_){if(this.middlewares.length===0)return e("no middleware to apply, skipping"),_();const T=k=>{e("applying middleware n\xB0%d",k+1),this.middlewares[k](O,C,R=>{if(R)return _(R);k+1<this.middlewares.length?T(k+1):_()})};T(0)}close(){e("closing all open clients");for(let O in this.clients)this.clients.hasOwnProperty(O)&&this.clients[O].close(!0);return this.cleanup(),this}generateId(O){return b.generateId()}async handshake(O,C,_){const T=C._query.EIO==="4"?4:3;if(T===3&&!this.opts.allowEIO3){e("unsupported protocol version"),this.emit("connection_error",{req:C,code:l.errors.UNSUPPORTED_PROTOCOL_VERSION,message:l.errorMessages[l.errors.UNSUPPORTED_PROTOCOL_VERSION],context:{protocol:T}}),_(l.errors.UNSUPPORTED_PROTOCOL_VERSION);return}let k;try{k=await this.generateId(C)}catch(L){e("error while generating an id"),this.emit("connection_error",{req:C,code:l.errors.BAD_REQUEST,message:l.errorMessages[l.errors.BAD_REQUEST],context:{name:"ID_GENERATION_ERROR",error:L}}),_(l.errors.BAD_REQUEST);return}e('handshaking client "%s"',k);try{var R=this.createTransport(O,C);O==="polling"?(R.maxHttpBufferSize=this.opts.maxHttpBufferSize,R.httpCompression=this.opts.httpCompression):O==="websocket"&&(R.perMessageDeflate=this.opts.perMessageDeflate)}catch(L){e('error handshaking to transport "%s"',O),this.emit("connection_error",{req:C,code:l.errors.BAD_REQUEST,message:l.errorMessages[l.errors.BAD_REQUEST],context:{name:"TRANSPORT_HANDSHAKE_ERROR",error:L}}),_(l.errors.BAD_REQUEST);return}const I=new u.Socket(k,this,R,C,T);return R.on("headers",(L,P)=>{!P._query.sid&&(this.opts.cookie&&(L["Set-Cookie"]=[(0,a.serialize)(this.opts.cookie.name,k,this.opts.cookie)]),this.emit("initial_headers",L,P)),this.emit("headers",L,P)}),R.onRequest(C),this.clients[k]=I,this.clientsCount++,I.once("close",()=>{delete this.clients[k],this.clientsCount--}),this.emit("connection",I),R}async onWebTransportSession(O){const C=setTimeout(()=>{e("the client failed to establish a bidirectional stream in the given period"),O.close()},this.opts.upgradeTimeout),T=await O.incomingBidirectionalStreams.getReader().read();if(T.done){e("session is closed");return}const k=T.value,R=(0,n.createPacketDecoderStream)(this.opts.maxHttpBufferSize,"nodebuffer"),I=k.readable.pipeThrough(R).getReader(),{value:L,done:P}=await I.read();if(P){e("stream is closed");return}if(clearTimeout(C),L.type!=="open")return e("invalid WebTransport handshake"),O.close();if(L.data===void 0){const z=new r.WebTransport(O,k,I),$=b.generateId();e('handshaking client "%s" (WebTransport)',$);const K=new u.Socket($,this,z,null,4);this.clients[$]=K,this.clientsCount++,K.once("close",()=>{delete this.clients[$],this.clientsCount--}),this.emit("connection",K);return}const B=s(L.data);if(!B)return e("invalid WebTransport handshake"),O.close();const M=this.clients[B];if(!M)e("upgrade attempt for closed client"),O.close();else if(M.upgrading)e("transport has already been trying to upgrade"),O.close();else if(M.upgraded)e("transport had already been upgraded"),O.close();else{e("upgrading existing transport");const z=new r.WebTransport(O,k,I);M._maybeUpgrade(z)}}}d.BaseServer=i,i.errors={UNKNOWN_TRANSPORT:0,UNKNOWN_SID:1,BAD_HANDSHAKE_METHOD:2,BAD_REQUEST:3,FORBIDDEN:4,UNSUPPORTED_PROTOCOL_VERSION:5},i.errorMessages={0:"Transport unknown",1:"Session ID unknown",2:"Bad handshake method",3:"Bad request",4:"Forbidden",5:"Unsupported protocol version"};class p{constructor(O,C){this.req=O,this.socket=C,O[o]={}}setHeader(O,C){this.req[o][O]=C}getHeader(O){return this.req[o][O]}removeHeader(O){delete this.req[o][O]}write(){}writeHead(){}end(){this.socket.destroy()}}class l extends i{init(){~this.opts.transports.indexOf("websocket")&&(this.ws&&this.ws.close(),this.ws=new this.opts.wsEngine({noServer:!0,clientTracking:!1,perMessageDeflate:this.opts.perMessageDeflate,maxPayload:this.opts.maxHttpBufferSize}),typeof this.ws.on=="function"&&this.ws.on("headers",(O,C)=>{const _=C[o]||{};delete C[o],!C._query.sid&&this.emit("initial_headers",_,C),this.emit("headers",_,C),e("writing headers: %j",_),Object.keys(_).forEach(k=>{O.push(`${k}: ${_[k]}`)})}))}cleanup(){this.ws&&(e("closing webSocketServer"),this.ws.close())}prepare(O){if(!O._query){const C=new URL(O.url,"https://socket.io");O._query=Object.fromEntries(C.searchParams.entries())}}createTransport(O,C){return new g.default[O](C)}handleRequest(O,C){e('handling "%s" http request "%s"',O.method,O.url),this.prepare(O),O.res=C;const _=(T,k)=>{if(T!==void 0){this.emit("connection_error",{req:O,code:T,message:l.errorMessages[T],context:k}),h(C,T,k);return}if(O._query.sid)e("setting new request for existing client"),this.clients[O._query.sid].transport.onRequest(O);else{const R=(I,L)=>h(C,I,L);this.handshake(O._query.transport,O,R)}};this._applyMiddlewares(O,C,T=>{T?_(l.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(O,!1,_)})}handleUpgrade(O,C,_){this.prepare(O);const T=new p(O,C),k=(R,I)=>{if(R!==void 0){this.emit("connection_error",{req:O,code:R,message:l.errorMessages[R],context:I}),v(C,R,I);return}const L=Buffer.from(_);_=null,T.writeHead(),this.ws.handleUpgrade(O,C,L,P=>{this.onWebSocket(O,C,P)})};this._applyMiddlewares(O,T,R=>{R?k(l.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(O,!0,k)})}onWebSocket(O,C,_){if(_.on("error",k),g.default[O._query.transport]!==void 0&&!g.default[O._query.transport].prototype.handlesUpgrades){e("transport doesnt handle upgraded requests"),_.close();return}const T=O._query.sid;if(O.websocket=_,T){const R=this.clients[T];if(!R)e("upgrade attempt for closed client"),_.close();else if(R.upgrading)e("transport has already been trying to upgrade"),_.close();else if(R.upgraded)e("transport had already been upgraded"),_.close();else{e("upgrading existing transport"),_.removeListener("error",k);const I=this.createTransport(O._query.transport,O);I.perMessageDeflate=this.opts.perMessageDeflate,R._maybeUpgrade(I)}}else{const R=(I,L)=>v(C,I,L);this.handshake(O._query.transport,O,R)}function k(){e("websocket error before upgrade")}}attach(O,C={}){const _=this._computePath(C),T=C.destroyUpgradeTimeout||1e3;function k(I){return _===I.url.slice(0,_.length)}const R=O.listeners("request").slice(0);O.removeAllListeners("request"),O.on("close",this.close.bind(this)),O.on("listening",this.init.bind(this)),O.on("request",(I,L)=>{if(k(I))e('intercepting request for path "%s"',_),this.handleRequest(I,L);else{let P=0;const B=R.length;for(;P<B;P++)R[P].call(O,I,L)}}),~this.opts.transports.indexOf("websocket")&&O.on("upgrade",(I,L,P)=>{k(I)?this.handleUpgrade(I,L,P):C.destroyUpgrade!==!1&&setTimeout(function(){if(L.writable&&L.bytesWritten<=0)return L.on("error",B=>{e("error while destroying upgrade: %s",B.message)}),L.end()},T)})}}d.Server=l;function h(A,O,C){const _=O===l.errors.FORBIDDEN?403:400,T=C&&C.message?C.message:l.errorMessages[O];A.writeHead(_,{"Content-Type":"application/json"}),A.end(JSON.stringify({code:O,message:T}))}function v(A,O,C={}){if(A.on("error",()=>{e("ignoring error from closed connection")}),A.writable){const _=C.message||l.errorMessages[O],T=Buffer.byteLength(_);A.write(`HTTP/1.1 400 Bad Request\r
|
|
350
350
|
Connection: close\r
|
|
351
351
|
Content-type: text/html\r
|
|
352
352
|
Content-Length: `+T+`\r
|
|
@@ -356,7 +356,7 @@ Content-Length: `+T+`\r
|
|
|
356
356
|
`).filter(Boolean).slice(-20);for(const u of m)try{const f=JSON.parse(u);if(f.type==="human"&&f.message?.content){const a=typeof f.message.content=="string"?f.message.content:f.message.content.find(t=>t.type==="text")?.text||"";a&&this._history.push({type:"user",content:a,timestamp:f.timestamp})}else f.type==="assistant"&&f.message?.content?this._history.push({type:"assistant",message:f.message,timestamp:f.timestamp}):f.type==="result"&&this._history.push({type:"result",total_cost_usd:f.costUSD||f.total_cost_usd,timestamp:f.timestamp})}catch{}return}}catch(d){console.warn("[agent] \u52A0\u8F7D\u6062\u590D\u4F1A\u8BDD\u5386\u53F2\u5931\u8D25:",d.message)}}async query(d){if(this._busy){this.emit("agent:error",{message:"\u6B63\u5728\u5904\u7406\u4E2D\uFF0C\u8BF7\u7B49\u5F85\u5B8C\u6210"});return}this._busy=!0,this.emit("agent:busy",!0),this._history.push({type:"user",content:d,timestamp:Date.now()});const c=["-p",d,"--output-format","stream-json","--verbose"];return this.permissionMode==="bypassPermissions"?c.push("--dangerously-skip-permissions"):this.permissionMode!=="default"&&c.push("--permission-mode",this.permissionMode),this.claudeSessionId&&c.push("--resume",this.claudeSessionId),new Promise((b,g)=>{const m={...process.env};delete m.CLAUDECODE,delete m.CLAUDE_CODE_ENTRYPOINT,delete m.CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC;const u=process.platform==="win32"?process.env.ComSpec||"cmd.exe":"claude",f=process.platform==="win32"?["/c","claude.cmd",...c]:c;this._proc=(0,external_child_process_namespaceObject.spawn)(u,f,{cwd:this.cwd,env:m,stdio:["ignore","pipe","pipe"]});let a="";this._proc.stdout.on("data",t=>{a+=t.toString();const r=a.split(`
|
|
357
357
|
`);a=r.pop();for(const n of r)if(n.trim())try{const e=JSON.parse(n);this._handleMessage(e)}catch{}}),this._proc.stderr.on("data",t=>{const r=t.toString().trim();r&&(console.error("[agent:stderr]",r),!r.includes("Warning:")&&!r.includes("DeprecationWarning")&&this.emit("agent:error",{message:r}))}),this._proc.on("close",t=>{if(a.trim())try{const r=JSON.parse(a.trim());this._handleMessage(r)}catch{}this._proc=null,this._busy=!1,this.emit("agent:busy",!1),b(t)}),this._proc.on("error",t=>{this._proc=null,this._busy=!1,this.emit("agent:busy",!1),this.emit("agent:error",{message:`\u542F\u52A8 Claude \u5931\u8D25: ${t.message}`}),g(t)})})}_handleMessage(d){d.session_id&&!this.claudeSessionId&&(this.claudeSessionId=d.session_id),d.type==="system"&&d.subtype==="init"&&d.session_id&&(this.claudeSessionId=d.session_id),this._history.push({...d,timestamp:Date.now()});const c=500;this._history.length>c&&(this._history=this._history.slice(-c)),this.emit("agent:message",d)}interrupt(){this._proc&&(this._proc.kill("SIGTERM"),this._proc=null,this._busy=!1,this.emit("agent:busy",!1),this.emit("agent:message",{type:"system",subtype:"interrupted",message:"\u67E5\u8BE2\u5DF2\u4E2D\u65AD"}))}kill(){this.interrupt(),this.alive=!1}get isBusy(){return this._busy}addViewer(d){this._viewers.add(d)}removeViewer(d){this._viewers.delete(d)}get viewerCount(){return this._viewers.size}takeControl(d,c){this.controlHolder=d,this.controlHolderName=c||null,this.lastInputTime=Date.now()}releaseControl(){this.controlHolder=null,this.controlHolderName=null,this.lastInputTime=null}isController(d){return this.controlHolder===d}toJSON(){return{id:this.id,title:this.title,cwd:this.cwd,createdAt:this.createdAt,mode:"agent",alive:this.alive,viewers:this.viewerCount,controlHolder:this.controlHolder,controlHolderName:this.controlHolderName,permissionMode:this.permissionMode,owner:this.owner,claudeSessionId:this.claudeSessionId,busy:this._busy}}}function listLocalClaudeSessions(S){const d=[];try{const c=(0,external_path_.join)((0,external_os_.homedir)(),".claude","projects");if(!(0,external_fs_.existsSync)(c))return d;for(const b of(0,external_fs_.readdirSync)(c,{withFileTypes:!0})){if(!b.isDirectory())continue;const g=(0,external_path_.join)(c,b.name);try{for(const m of(0,external_fs_.readdirSync)(g)){if(!m.endsWith(".jsonl"))continue;const u=m.replace(".jsonl",""),f=(0,external_path_.join)(g,m);try{const a=(0,external_fs_.readFileSync)(f,"utf8").split(`
|
|
358
358
|
`).filter(Boolean);let t=null,r=null,n=0,e="";for(const s of a)try{const i=JSON.parse(s);if(t||(t=i),r=i,n++,!e&&i.type==="human"&&i.message?.content){const p=i.message.content;if(typeof p=="string")e=p.slice(0,120);else if(Array.isArray(p)){const l=p.find(h=>h.type==="text");l&&(e=l.text?.slice(0,120)||"")}}}catch{}let o=b.name;process.platform==="win32"&&/^[A-Za-z]--/.test(o)?o=o[0]+":\\"+o.slice(3).replace(/-/g,"\\"):o.startsWith("-")&&(o=o.replace(/-/g,"/")),d.push({sessionId:u,projectDir:b.name,projectPath:o,messageCount:n,summary:e,createdAt:t?.timestamp||null,updatedAt:r?.timestamp||null})}catch{}}}catch{}}}catch{}return d.sort((c,b)=>new Date(b.updatedAt||0).getTime()-new Date(c.updatedAt||0).getTime()),d.slice(0,20)}const DEFAULT_SHELL=process.platform==="win32"?process.env.SHELL||"powershell.exe":process.env.SHELL||"/bin/bash",CONFIG_DIR=(0,external_path_.join)((0,external_os_.homedir)(),".myhi"),SESSIONS_FILE=(0,external_path_.join)(CONFIG_DIR,"sessions.json");function loadSavedConfigs(){try{return JSON.parse((0,external_fs_.readFileSync)(SESSIONS_FILE,"utf8"))}catch{return[]}}function writeSavedConfigs(S){try{(0,external_fs_.mkdirSync)(CONFIG_DIR,{recursive:!0});const d=SESSIONS_FILE+".tmp";(0,external_fs_.writeFileSync)(d,JSON.stringify(S,null,2),{mode:384}),(0,external_fs_.renameSync)(d,SESSIONS_FILE)}catch(d){console.error("[sessions] \u6301\u4E45\u5316\u5199\u5165\u5931\u8D25:",d.message)}}class Session extends external_events_.EventEmitter{constructor(d,c={}){super(),this.id=d,this.createdAt=new Date().toISOString(),this.title=c.title||DEFAULT_SHELL,this.cwd=c.cwd||process.env.MYHI_CWD||process.cwd(),this.initCmd=c.initCmd||null,this.permissionMode=c.permissionMode||"default",this.owner=c.owner||null,this.cols=c.cols||120,this.rows=c.rows||30,this._viewers=new Set,this.controlHolder=null,this.controlHolderName=null,this.lastInputTime=null;const b={...process.env};delete b.CLAUDECODE,delete b.CLAUDE_CODE_ENTRYPOINT,delete b.CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC,this._pty=external_node_pty_namespaceObject.spawn(DEFAULT_SHELL,[],{name:"xterm-256color",cols:this.cols,rows:this.rows,cwd:this.cwd,env:b,useConpty:!1}),this._scrollback="";const g=100*1024;if(this._pty.onData(m=>{this.emit("data",m),this._scrollback+=m,this._scrollback.length>g&&(this._scrollback=this._scrollback.slice(this._scrollback.length-g))}),this._pty.onExit(({exitCode:m})=>{this.exitCode=m,this.emit("exit",m)}),c.initCmd){const m=c.initCmd;let u=!1;const f=a=>{!u&&/[$>#\]]\s*$/.test(a.trimEnd())&&(u=!0,this._pty.off("data",f),setTimeout(()=>this._pty.write(m+"\r"),120))};this._pty.onData(f),setTimeout(()=>{u||(u=!0,this._pty.write(m+"\r"))},3e3)}}write(d){d!=null&&this._pty.write(d)}resize(d,c){this.cols=d,this.rows=c,this._pty.resize(d,c)}kill(){try{this._pty.kill()}catch{}}addViewer(d){this._viewers.add(d)}removeViewer(d){this._viewers.delete(d)}get viewerCount(){return this._viewers.size}takeControl(d,c){this.controlHolder=d,this.controlHolderName=c||null,this.lastInputTime=Date.now()}releaseControl(){this.controlHolder=null,this.controlHolderName=null,this.lastInputTime=null}isController(d){return this.controlHolder===d}toJSON(){return{id:this.id,title:this.title,cwd:this.cwd,createdAt:this.createdAt,cols:this.cols,rows:this.rows,viewers:this.viewerCount,alive:this.exitCode===void 0,controlHolder:this.controlHolder,controlHolderName:this.controlHolderName,permissionMode:this.permissionMode,owner:this.owner}}}class SessionManager{constructor(){this._sessions=new Map,this._agentSessions=new Map;for(const d of loadSavedConfigs())try{this._spawn((0,external_crypto_.randomUUID)(),d,!1)}catch(c){console.warn(`[\u4F1A\u8BDD] \u6062\u590D "${d.title}" \u5931\u8D25:`,c.message)}}_spawn(d,c,b=!0){const g=new Session(d,c);return this._sessions.set(d,g),g.on("exit",()=>{setTimeout(()=>this._sessions.delete(d),300*1e3)}),b&&this._persist(),g}create(d={}){return this._spawn((0,external_crypto_.randomUUID)(),d,!0)}createAgent(d={}){const c=(0,external_crypto_.randomUUID)(),b=new AgentSession(c,d);return this._agentSessions.set(c,b),b}get(d){return this._sessions.get(d)||this._agentSessions.get(d)}list(d){let c=[...this._sessions.values()].map(g=>({...g.toJSON(),mode:"pty"})),b=[...this._agentSessions.values()].map(g=>g.toJSON());return d&&(c=c.filter(g=>!g.owner||g.owner===d),b=b.filter(g=>!g.owner||g.owner===d)),[...c,...b]}listSessions(){return[...this._sessions.values(),...this._agentSessions.values()]}kill(d){const c=this._sessions.get(d);if(c){c.kill(),this._sessions.delete(d),this._persist();return}const b=this._agentSessions.get(d);b&&(b.kill(),this._agentSessions.delete(d))}_persist(){const d=[...this._sessions.values()].filter(c=>c.exitCode===void 0).map(c=>({title:c.title,cwd:c.cwd,initCmd:c.initCmd||void 0,permissionMode:c.permissionMode||void 0,owner:c.owner||void 0}));writeSavedConfigs(d)}}const roles_CONFIG_DIR=(0,external_path_.join)((0,external_os_.homedir)(),".myhi"),ROLES_FILE=(0,external_path_.join)(roles_CONFIG_DIR,"roles.json"),USERS_FILE=(0,external_path_.join)(roles_CONFIG_DIR,"users.json"),ROLE_LEVELS={admin:3,operator:2,viewer:1};let rolesConfig=null;function loadRoles(){try{if((0,external_fs_.existsSync)(ROLES_FILE))return rolesConfig=JSON.parse((0,external_fs_.readFileSync)(ROLES_FILE,"utf8")),rolesConfig}catch(S){console.warn("[\u89D2\u8272] \u52A0\u8F7D roles.json \u5931\u8D25:",S.message)}return rolesConfig=null,null}function lookupPassword(S){if(!rolesConfig?.passwords)return null;const d=rolesConfig.passwords[S];return d?{name:d.name||"\u7528\u6237",role:d.role||"viewer"}:null}function hasPermission(S,d){return(ROLE_LEVELS[S]||0)>=(ROLE_LEVELS[d]||0)}function isMultiUserMode(){return rolesConfig!==null&&rolesConfig.passwords&&Object.keys(rolesConfig.passwords).length>0}function getDefaultRole(){return rolesConfig?.defaultRole||"admin"}let usersConfig=null;function loadUsers(){try{if((0,external_fs_.existsSync)(USERS_FILE))return usersConfig=JSON.parse((0,external_fs_.readFileSync)(USERS_FILE,"utf8")),usersConfig}catch(S){console.warn("[\u7528\u6237] \u52A0\u8F7D users.json \u5931\u8D25:",S.message)}return usersConfig=null,null}function isExclusiveMode(){return usersConfig!==null&&usersConfig.users&&Object.keys(usersConfig.users).length>0}function lookupUser(S){if(!usersConfig?.users)return null;const d=usersConfig.users[S];return d?{name:d.name||"\u7528\u6237",dir:d.dir}:null}function listUsers(){return usersConfig?.users?Object.entries(usersConfig.users).map(([S,d])=>({password:S.slice(0,2)+"*".repeat(S.length-2),name:d.name,dir:d.dir})):[]}function addUser(S,d,c){usersConfig||(usersConfig={users:{}}),usersConfig.users||(usersConfig.users={}),usersConfig.users[S]={name:d,dir:c},_writeUsers()}function removeUser(S){return!usersConfig?.users||!usersConfig.users[S]?!1:(delete usersConfig.users[S],_writeUsers(),!0)}function _writeUsers(){mkdirSync(roles_CONFIG_DIR,{recursive:!0}),writeFileSync(USERS_FILE,JSON.stringify(usersConfig,null,2),{mode:384})}const server_dirname=(0,external_path_.dirname)((0,external_url_.fileURLToPath)(import.meta.url));let PORT=parseInt(process.env.PORT,10)||3e3;const HOST=process.env.HOST||"0.0.0.0",PORT_EXPLICIT=!!process.env.PORT,configDir=(0,external_path_.join)((0,external_os_.homedir)(),".myhi");(0,external_fs_.mkdirSync)(configDir,{recursive:!0});function readOrCreate(S,d){try{if((0,external_fs_.existsSync)(S))return(0,external_fs_.readFileSync)(S,"utf8").trim()}catch{}const c=d();return(0,external_fs_.writeFileSync)(S,c,{mode:384}),c}const TOKEN=readOrCreate((0,external_path_.join)(configDir,"token"),()=>(0,external_crypto_.randomBytes)(16).toString("hex")),PASSWORD=readOrCreate((0,external_path_.join)(configDir,"password"),()=>String(Math.floor(1e3+Math.random()*9e3)));loadRoles(),loadUsers();let activeUser=null;const userSessions=new Map;userSessions.set(TOKEN,{role:"admin",name:"\u7BA1\u7406\u5458",permanent:!0});const SESSION_MAX_AGE=10080*60*1e3;setInterval(()=>{const S=Date.now();for(const[d,c]of userSessions)c.permanent||(!c.lastUsed||S-c.lastUsed>SESSION_MAX_AGE)&&userSessions.delete(d)},3600*1e3);function getTailscaleIP(){try{return(0,external_child_process_namespaceObject.execSync)("tailscale ip -4",{timeout:3e3,stdio:"pipe"}).toString().trim().split(`
|
|
359
|
-
`)[0]}catch{}try{if(process.platform==="win32"){const d=(0,external_child_process_namespaceObject.execSync)("route print 0.0.0.0",{timeout:3e3,stdio:"pipe"}).toString().match(/0\.0\.0\.0\s+0\.0\.0\.0\s+\S+\s+(\d+\.\d+\.\d+\.\d+)/);if(d)return d[1]}else try{const d=(0,external_child_process_namespaceObject.execSync)("ip route get 1.1.1.1",{timeout:3e3,stdio:"pipe"}).toString().match(/src\s+(\d+\.\d+\.\d+\.\d+)/);if(d)return d[1]}catch{const S=(0,external_child_process_namespaceObject.execSync)("route -n get default 2>/dev/null || route -n 2>/dev/null",{timeout:3e3,stdio:"pipe"}).toString(),d=S.match(/interface:\s*(\S+)/i)||S.match(/0\.0\.0\.0\s+(\d+\.\d+\.\d+\.\d+)/);if(d){const c=(0,external_os_.networkInterfaces)()[d[1]];if(c){const b=c.find(g=>g.family==="IPv4"&&!g.internal);if(b)return b.address}if(/^\d+\.\d+\.\d+\.\d+$/.test(d[1]))return d[1]}}}catch{}for(const S of Object.values((0,external_os_.networkInterfaces)()))for(const d of S)if(d.family==="IPv4"&&!d.internal)return d.address;return"localhost"}function parseCookies(S=""){const d={};for(const c of S.split(";")){const b=c.indexOf("=");b>0&&(d[c.slice(0,b).trim()]=c.slice(b+1).trim())}return d}const SESSION_COOKIE="myhi_sid",COOKIE_OPTS="HttpOnly; SameSite=Strict; Path=/; Max-Age=31536000";function setSessionCookie(S,d){S.setHeader("Set-Cookie",`${SESSION_COOKIE}=${d||TOKEN}; ${COOKIE_OPTS}`)}function getSessionToken(S){return parseCookies(S)[SESSION_COOKIE]||null}function hasValidSession(S){const d=getSessionToken(S);if(d&&userSessions.has(d)){const c=userSessions.get(d);return c&&(c.lastUsed=Date.now()),!0}return!1}function getUserInfo(S){const d=getSessionToken(S);return d?userSessions.get(d):null}const app=express();app.set("trust proxy",!0),app.use((S,d,c)=>{d.setHeader("Referrer-Policy","no-referrer"),d.setHeader("X-Content-Type-Options","nosniff"),c()});const httpServer=(0,external_http_.createServer)(app),_corsAllowed=/^https?:\/\/(localhost|127\.0\.0\.1|\[::1\]|10\.\d+\.\d+\.\d+|172\.(1[6-9]|2\d|3[01])\.\d+\.\d+|192\.168\.\d+\.\d+|100\.(6[4-9]|[7-9]\d|1[01]\d|12[0-7])\.\d+\.\d+)(:\d+)?$/,io=new Server({cors:{origin:(S,d)=>{if(!S||_corsAllowed.test(S))return d(null,!0);d(new Error("CORS \u4E0D\u5141\u8BB8\u6B64\u6765\u6E90"),!1)},credentials:!0},transports:["websocket"]});io.attach(httpServer);const manager=new SessionManager,AUTO_ATTACH=process.env.MYHI_AUTO_ATTACH!=="0",_autoSpawned=new Set;function spawnLocalTerminal(S,d){if(!AUTO_ATTACH||_autoSpawned.has(S))return;_autoSpawned.add(S);const c=__nccwpck_require__.ab+"attach.js",b=process.execPath,g=d||"myhi";if(process.platform==="win32"){const m=`"${b}" "${c}" ${S}`,u=(0,external_child_process_namespaceObject.spawn)("wt.exe",["-w","0","new-tab","--title",g,"--","cmd","/k",m],{detached:!0,stdio:"ignore"});u.unref(),u.on("error",f=>{console.warn("[attach] wt.exe \u5931\u8D25\uFF0C\u56DE\u9000\u5230 cmd:",f.message),(0,external_child_process_namespaceObject.spawn)("cmd.exe",["/c","start",`"${g}"`,"cmd","/k",m],{detached:!0,stdio:"ignore"}).unref()})}else if(process.platform==="darwin"){const m=`tell application "Terminal" to do script "${b} ${c} ${S}"`;(0,external_child_process_namespaceObject.spawn)("osascript",["-e",m],{detached:!0,stdio:"ignore"}).unref()}else{const m=`${b} "${c}" ${S}`;for(const[u,f]of[["gnome-terminal",["--","bash","-c",`${m}; exec bash`]],["xterm",["-title",g,"-e",m]],["konsole",["--new-tab","-e",m]]]){const a=(0,external_child_process_namespaceObject.spawn)(u,f,{detached:!0,stdio:"ignore"});a.unref(),a.on("error",()=>{});break}}}const uploadDir=(0,external_path_.join)(configDir,"uploads");(0,external_fs_.mkdirSync)(uploadDir,{recursive:!0});function checkAuth(S,d,c){const b=S.query.token;if(b&&(b===TOKEN||userSessions.has(b))){const g=userSessions.get(b);if(g?.onetime){userSessions.delete(b);const u=(0,external_crypto_.randomBytes)(16).toString("hex");userSessions.set(u,{role:g.role,name:g.name,lastUsed:Date.now()}),setSessionCookie(d,u)}else setSessionCookie(d,b===TOKEN?TOKEN:b);const m=S.path+(Object.keys(S.query).filter(u=>u!=="token").length?"?"+new URLSearchParams(Object.fromEntries(Object.entries(S.query).filter(([u])=>u!=="token"))):"");return d.redirect(m)}if(hasValidSession(S.headers.cookie)){if(isExclusiveMode()&&activeUser){const g=getSessionToken(S.headers.cookie);if(g!==activeUser.token&&g!==TOKEN)return d.setHeader("Set-Cookie",`${SESSION_COOKIE}=; HttpOnly; SameSite=Strict; Path=/; Max-Age=0`),d.redirect("/login")}return c()}d.redirect("/login")}const _require=(0,external_module_namespaceObject.createRequire)(import.meta.url);function pkgDirSafe(S){try{return(0,external_path_.dirname)(_require.resolve(`${S}/package.json`))}catch{return null}}const libDir=(0,external_path_.join)(server_dirname,"lib");app.use("/lib/xterm",express.static(pkgDirSafe("xterm")||(0,external_path_.join)(libDir,"xterm"))),app.use("/lib/xterm-fit",express.static(pkgDirSafe("xterm-addon-fit")||(0,external_path_.join)(libDir,"xterm-fit"))),app.use("/lib/xterm-links",express.static(pkgDirSafe("xterm-addon-web-links")||(0,external_path_.join)(libDir,"xterm-links")));const _loginAttempts=new Map,LOGIN_MAX_ATTEMPTS=5,LOGIN_LOCKOUT_MS=300*1e3;function checkLoginRate(S){const d=Date.now(),c=_loginAttempts.get(S);return!c||d>c.resetAt?!0:c.count<LOGIN_MAX_ATTEMPTS}function recordLoginFailure(S){const d=Date.now(),c=_loginAttempts.get(S);!c||d>c.resetAt?_loginAttempts.set(S,{count:1,resetAt:d+LOGIN_LOCKOUT_MS}):c.count++}function clearLoginFailures(S){_loginAttempts.delete(S)}setInterval(()=>{const S=Date.now();for(const[d,c]of _loginAttempts)S>c.resetAt&&_loginAttempts.delete(d)},600*1e3),app.get("/login",(S,d)=>{d.sendFile(__nccwpck_require__.ab+"login.html")}),app.post("/login",express.urlencoded({extended:!1}),(S,d)=>{const c=S.ip;if(!checkLoginRate(c))return d.redirect("/login?error=locked");loadRoles(),loadUsers();const b=S.body?.password,g=S.query.from,m=g&&g.startsWith("/")&&!g.startsWith("//")?g:"/";if(isExclusiveMode()){const f=lookupUser(b);if(!f)return recordLoginFailure(c),d.redirect("/login?error=1");if(activeUser&&activeUser.name!==f.name)return d.redirect("/login?error=occupied&user="+encodeURIComponent(activeUser.name));clearLoginFailures(c);const a=(0,external_crypto_.randomBytes)(16).toString("hex");return userSessions.set(a,{role:"admin",name:f.name,dir:f.dir,lastUsed:Date.now()}),activeUser={name:f.name,dir:f.dir,token:a,loginAt:Date.now()},setSessionCookie(d,a),console.log(`[\u767B\u5F55] ${f.name} \u767B\u5F55\uFF08\u72EC\u5360\u6A21\u5F0F\uFF09`),d.redirect(m)}const u=lookupPassword(b);if(u){clearLoginFailures(c);const f=(0,external_crypto_.randomBytes)(16).toString("hex");return userSessions.set(f,{role:u.role,name:u.name,lastUsed:Date.now()}),setSessionCookie(d,f),d.redirect(m)}if(b===PASSWORD){clearLoginFailures(c);const f=(0,external_crypto_.randomBytes)(16).toString("hex");return userSessions.set(f,{role:"admin",name:"\u7BA1\u7406\u5458",lastUsed:Date.now()}),setSessionCookie(d,f),d.redirect(m)}recordLoginFailure(c),d.redirect("/login?error=1")}),app.post("/logout",(S,d)=>{const c=getSessionToken(S.headers.cookie);if(c){if(activeUser&&activeUser.token===c){console.log(`[\u9000\u51FA] ${activeUser.name} \u9000\u51FA\u767B\u5F55`);for(const b of manager.listSessions())manager.kill(b.id),_autoSpawned.delete(b.id);activeUser=null}userSessions.delete(c)}d.setHeader("Set-Cookie",`${SESSION_COOKIE}=; HttpOnly; SameSite=Strict; Path=/; Max-Age=0`),d.redirect("/login")}),app.get("/api/status",(S,d)=>{if(isExclusiveMode()&&activeUser)return d.json({occupied:!0,userName:activeUser.name});d.json({occupied:!1})}),app.get("/",checkAuth,(S,d)=>d.sendFile(__nccwpck_require__.ab+"index.html")),app.get("/terminal/:id",checkAuth,(S,d)=>d.sendFile(__nccwpck_require__.ab+"chat.html")),app.get("/terminal-raw/:id",checkAuth,(S,d)=>d.sendFile(__nccwpck_require__.ab+"terminal.html")),app.use("/lib",express.static(__nccwpck_require__.ab+"lib")),app.get("/api/sessions",checkAuth,(S,d)=>{const c=getUserInfo(S.headers.cookie);d.json(manager.list(c?.name))}),app.post("/api/sessions",checkAuth,express.json(),(S,d)=>{const c=getUserInfo(S.headers.cookie),b=manager.create({...S.body,owner:c?.name});d.status(201).json(b.toJSON())}),app.delete("/api/sessions/:id",checkAuth,(S,d)=>{manager.kill(S.params.id),d.status(204).end()}),app.get("/api/claude-sessions",checkAuth,(S,d)=>{d.json(listLocalClaudeSessions())}),app.get("/api/dirs",checkAuth,(S,d)=>{const c=getUserInfo(S.headers.cookie);if(!c||c.role!=="admin")return d.status(403).json({error:"\u6CA1\u6709\u76EE\u5F55\u6D4F\u89C8\u6743\u9650"});const b=c.dir?(0,external_path_.resolve)((0,external_path_.normalize)(c.dir)):null,g=process.platform==="win32"?"\\":"/";let m=S.query.path||b||process.env.MYHI_CWD||(0,external_os_.homedir)(),u=(0,external_path_.resolve)((0,external_path_.normalize)(m)).replace(/[/\\]+$/,"");process.platform==="win32"&&/^[A-Za-z]:$/.test(u)&&(u+="\\"),b&&!u.startsWith(b)&&(u=b);try{const f=(0,external_fs_.readdirSync)(u,{withFileTypes:!0}).filter(r=>r.isDirectory()&&!r.name.startsWith(".")).map(r=>({name:r.name,path:u.replace(/[/\\]+$/,"")+g+r.name})).sort((r,n)=>r.name.localeCompare(n.name)),a=(0,external_path_.join)(u,".."),t=!b||(0,external_path_.resolve)((0,external_path_.normalize)(a)).startsWith(b);d.json({current:u,parent:t&&a!==u?a:null,dirs:f})}catch(f){d.status(400).json({error:f.message})}}),app.get("/api/me",checkAuth,(S,d)=>{const c=getUserInfo(S.headers.cookie);d.json({name:c?.name||"\u7528\u6237",exclusive:isExclusiveMode(),dir:c?.dir||null})}),app.post("/upload",checkAuth,(S,d)=>{const c=S.query.sessionId,b=c?manager.get(c):null,g=b?.cwd?(0,external_path_.join)(b.cwd,"upload"):uploadDir;(0,external_fs_.mkdirSync)(g,{recursive:!0}),multer({storage:multer.diskStorage({destination:g,filename:(u,f,a)=>{const t=f.originalname.match(/\.[^.]+$/)?.[0]||".jpg";a(null,`${Date.now()}-${(0,external_crypto_.randomBytes)(3).toString("hex")}${t}`)}}),limits:{fileSize:20*1024*1024},fileFilter:(u,f,a)=>a(null,f.mimetype.startsWith("image/"))}).single("image")(S,d,u=>{if(u)return d.status(400).json({error:u.message});if(!S.file)return d.status(400).json({error:"\u6CA1\u6709\u56FE\u7247"});d.json({path:(0,external_path_.resolve)(S.file.path).replace(/\\/g,"/")})})}),app.get("/qr/:sessionId",checkAuth,async(S,d)=>{const c=getTailscaleIP(),b=(0,external_crypto_.randomBytes)(16).toString("hex");userSessions.set(b,{role:"admin",name:"\u626B\u7801\u7528\u6237",onetime:!0,lastUsed:Date.now()});const g=`http://${c}:${PORT}/terminal/${S.params.sessionId}?token=${b}`;try{const m=await lib.toString(g,{type:"svg"});d.setHeader("Content-Type","image/svg+xml"),d.send(m)}catch(m){d.status(500).send(m.message)}}),io.use((S,d)=>{const c=S.handshake.headers.cookie;if(hasValidSession(c)){const g=getUserInfo(c);return S.data.role=g?.role||"admin",S.data.userName=g?.name||"\u7528\u6237",S.data.dir=g?.dir||null,d()}if((S.handshake.auth?.token||S.handshake.query?.token)===TOKEN)return S.data.role="admin",S.data.userName="\u7BA1\u7406\u5458",d();d(new Error("\u672A\u6388\u6743"))});function broadcastSessions(){for(const[,S]of io.sockets.sockets)S.emit("sessions",manager.list(S.data.userName))}io.on("connection",S=>{const d=S.handshake.address?.replace("::ffff:","")||"?";console.log(`[\u8FDE\u63A5] ${S.data.userName}(${S.data.role}) \u4ECE ${d} \u63A5\u5165 id=${S.id}`);let c=null,b=null,g=null,m=null,u=null;function f(){c&&(c.isController(S.id)&&(c.releaseControl(),io.emit("control-changed",{sessionId:c.id,holder:null,holderName:null})),c.removeViewer(S.id),b&&c.off("data",b),g&&c.off("agent:message",g),m&&c.off("agent:busy",m),u&&c.off("agent:error",u),b=null,g=null,m=null,u=null)}S.on("join",a=>{const t=manager.get(a);if(!t){S.emit("error",{message:`\u4F1A\u8BDD ${a} \u672A\u627E\u5230`});return}f(),c=t,c.addViewer(S.id),t.mode==="agent"?(g=r=>S.emit("agent:message",r),c.on("agent:message",g),m=r=>S.emit("agent:busy",r),c.on("agent:busy",m),u=r=>S.emit("agent:error",r),c.on("agent:error",u)):(b=r=>S.emit("output",r),c.on("data",b),c.once("exit",r=>{S.emit("session-exit",{code:r}),b&&c?.off("data",b)}),spawnLocalTerminal(a,t.title)),console.log(`[\u52A0\u5165] ${S.data.userName} \u52A0\u5165\u4F1A\u8BDD "${t.title}" (${a}) \u6A21\u5F0F=${t.mode||"pty"}`),S.emit("joined",{...t.toJSON(),role:S.data.role}),t.mode==="agent"?t._history?.length&&S.emit("agent:history",t._history):t._scrollback?.length&&S.emit("output",t._scrollback),broadcastSessions()}),S.on("disconnect",()=>{console.log(`[\u65AD\u5F00] ${S.data.userName} \u79BB\u5F00\u4F1A\u8BDD "${c?.title||"?"}" id=${S.id}`),f(),broadcastSessions()}),S.on("agent:query",async({prompt:a}={})=>{if(!c||c.mode!=="agent"){S.emit("agent:error",{message:"\u5F53\u524D\u4E0D\u662F Agent \u6A21\u5F0F\u4F1A\u8BDD"});return}if(!c.isController(S.id)){S.emit("control-denied",{reason:"\u4F60\u6CA1\u6709\u5F53\u524D\u4F1A\u8BDD\u7684\u63A7\u5236\u6743"});return}if(c.isBusy){S.emit("agent:error",{message:"\u6B63\u5728\u5904\u7406\u4E2D\uFF0C\u8BF7\u7B49\u5F85\u5B8C\u6210"});return}try{await c.query(a)}catch(t){console.error("[agent:query] \u9519\u8BEF:",t.message),S.emit("agent:error",{message:t.message})}}),S.on("agent:interrupt",()=>{!c||c.mode!=="agent"||c.interrupt()}),S.on("create-agent",(a,t)=>{if(!hasPermission(S.data.role,"admin")){typeof t=="function"&&t({ok:!1,error:"\u6CA1\u6709\u521B\u5EFA\u4F1A\u8BDD\u7684\u6743\u9650"});return}if(S.data.dir){const r=(0,external_path_.resolve)((0,external_path_.normalize)(S.data.dir)),n=a?.cwd?(0,external_path_.resolve)((0,external_path_.normalize)(a.cwd)):null;if(n&&!n.startsWith(r)){typeof t=="function"&&t({ok:!1,error:"\u4E0D\u80FD\u5728\u7ED1\u5B9A\u76EE\u5F55\u4E4B\u5916\u521B\u5EFA\u4F1A\u8BDD"});return}n||(a={...a,cwd:r})}try{const r=manager.createAgent({...a,owner:S.data.userName});console.log(`[\u4F1A\u8BDD] ${S.data.userName} \u521B\u5EFA Agent \u4F1A\u8BDD "${r.title}" (${r.id})`),broadcastSessions(),typeof t=="function"&&t({ok:!0,session:r.toJSON()})}catch(r){typeof t=="function"&&t({ok:!1,error:r.message})}}),S.on("input",a=>{if(!(a==null||!c)&&c.mode!=="agent"){if(!c.isController(S.id)){S.emit("control-denied",{reason:"\u4F60\u6CA1\u6709\u5F53\u524D\u4F1A\u8BDD\u7684\u63A7\u5236\u6743"});return}c.lastInputTime=Date.now(),c.write(a)}}),S.on("take-control",({sessionId:a}={})=>{const t=a?manager.get(a):c;if(t){if(!hasPermission(S.data.role,"operator")){S.emit("control-denied",{reason:"\u4F60\u7684\u89D2\u8272\u6CA1\u6709\u63A7\u5236\u6743\u9650"});return}if(t.controlHolder&&t.controlHolder!==S.id&&S.data.role!=="admin"){S.emit("control-denied",{reason:"\u5176\u4ED6\u7528\u6237\u6B63\u5728\u63A7\u5236\u4E2D\uFF0C\u8BF7\u7B49\u5F85\u91CA\u653E"});return}t.takeControl(S.id,S.data.userName),console.log(`[\u63A7\u5236] ${S.data.userName} \u83B7\u53D6\u4F1A\u8BDD "${t.title}" \u7684\u63A7\u5236\u6743`),io.emit("control-changed",{sessionId:t.id,holder:S.id,holderName:S.data.userName})}}),S.on("release-control",({sessionId:a}={})=>{const t=a?manager.get(a):c;t&&t.isController(S.id)&&(console.log(`[\u63A7\u5236] ${S.data.userName} \u91CA\u653E\u4F1A\u8BDD "${t.title}" \u7684\u63A7\u5236\u6743`),t.releaseControl(),io.emit("control-changed",{sessionId:t.id,holder:null,holderName:null}))}),S.on("set-mode",({sessionId:a,mode:t}={})=>{const r=a?manager.get(a):c;r&&(r.permissionMode=t,io.emit("mode-changed",{sessionId:r.id,mode:t}))}),S.on("rename",({sessionId:a,title:t}={})=>{const r=a?manager.get(a):c;!r||!t||(r.title=t,io.emit("session-renamed",{sessionId:r.id,title:t}),broadcastSessions())}),S.on("resize",({cols:a,rows:t})=>c?.resize(a,t)),S.on("list",()=>S.emit("sessions",manager.list(S.data.userName))),S.on("dirs",(a,t)=>{if(typeof t!="function")return;const r=S.data.dir?(0,external_path_.resolve)((0,external_path_.normalize)(S.data.dir)):null,n=process.platform==="win32"?"\\":"/";let e=(a||r||process.env.MYHI_CWD||(0,external_os_.homedir)()).replace(/[/\\]+$/,"")||(0,external_os_.homedir)();process.platform==="win32"&&/^[A-Za-z]:$/.test(e)&&(e+="\\"),r&&!(0,external_path_.resolve)((0,external_path_.normalize)(e)).startsWith(r)&&(e=r);try{const o=(0,external_fs_.readdirSync)(e,{withFileTypes:!0}).filter(p=>p.isDirectory()&&!p.name.startsWith(".")).map(p=>({name:p.name,path:e.replace(/[/\\]+$/,"")+n+p.name})).sort((p,l)=>p.name.localeCompare(l.name)),s=(0,external_path_.join)(e,".."),i=!r||(0,external_path_.resolve)((0,external_path_.normalize)(s)).startsWith(r);t({ok:!0,current:e,parent:i&&s!==e?s:null,dirs:o})}catch(o){t({ok:!1,error:o.message})}}),S.on("create",(a,t)=>{if(!hasPermission(S.data.role,"admin")){typeof t=="function"&&t({ok:!1,error:"\u6CA1\u6709\u521B\u5EFA\u4F1A\u8BDD\u7684\u6743\u9650"});return}if(S.data.dir){const r=(0,external_path_.resolve)((0,external_path_.normalize)(S.data.dir)),n=a?.cwd?(0,external_path_.resolve)((0,external_path_.normalize)(a.cwd)):null;if(n&&!n.startsWith(r)){typeof t=="function"&&t({ok:!1,error:"\u4E0D\u80FD\u5728\u7ED1\u5B9A\u76EE\u5F55\u4E4B\u5916\u521B\u5EFA\u4F1A\u8BDD"});return}n||(a={...a,cwd:r})}try{const r=manager.create({...a,owner:S.data.userName});console.log(`[\u4F1A\u8BDD] ${S.data.userName} \u521B\u5EFA PTY \u4F1A\u8BDD "${r.title}" (${r.id})`),broadcastSessions(),typeof t=="function"&&t({ok:!0,session:r.toJSON()})}catch(r){console.error("[\u521B\u5EFA] PTY \u542F\u52A8\u5931\u8D25:",r.message),typeof t=="function"&&t({ok:!1,error:r.message})}}),S.on("kill",a=>{if(!hasPermission(S.data.role,"admin")){S.emit("error",{message:"\u6CA1\u6709\u5220\u9664\u4F1A\u8BDD\u7684\u6743\u9650"});return}console.log(`[\u4F1A\u8BDD] ${S.data.userName} \u5220\u9664\u4F1A\u8BDD ${a}`),manager.kill(a),_autoSpawned.delete(a),broadcastSessions()})});const CONTROL_TIMEOUT=300*1e3;setInterval(()=>{for(const S of manager.listSessions())S.controlHolder&&S.lastInputTime&&Date.now()-S.lastInputTime>CONTROL_TIMEOUT&&(S.releaseControl(),io.emit("control-changed",{sessionId:S.id,holder:null,holderName:null}))},60*1e3);function showStartupInfo(){const S=httpServer.address().port;PORT=S;const d=getTailscaleIP(),c=`http://${d}:${S}/?token=${TOKEN}`;console.log(`
|
|
359
|
+
`)[0]}catch{}try{if(process.platform==="win32"){const d=(0,external_child_process_namespaceObject.execSync)("route print 0.0.0.0",{timeout:3e3,stdio:"pipe"}).toString().match(/0\.0\.0\.0\s+0\.0\.0\.0\s+\S+\s+(\d+\.\d+\.\d+\.\d+)/);if(d)return d[1]}else try{const d=(0,external_child_process_namespaceObject.execSync)("ip route get 1.1.1.1",{timeout:3e3,stdio:"pipe"}).toString().match(/src\s+(\d+\.\d+\.\d+\.\d+)/);if(d)return d[1]}catch{const S=(0,external_child_process_namespaceObject.execSync)("route -n get default 2>/dev/null || route -n 2>/dev/null",{timeout:3e3,stdio:"pipe"}).toString(),d=S.match(/interface:\s*(\S+)/i)||S.match(/0\.0\.0\.0\s+(\d+\.\d+\.\d+\.\d+)/);if(d){const c=(0,external_os_.networkInterfaces)()[d[1]];if(c){const b=c.find(g=>g.family==="IPv4"&&!g.internal);if(b)return b.address}if(/^\d+\.\d+\.\d+\.\d+$/.test(d[1]))return d[1]}}}catch{}for(const S of Object.values((0,external_os_.networkInterfaces)()))for(const d of S)if(d.family==="IPv4"&&!d.internal)return d.address;return"localhost"}function parseCookies(S=""){const d={};for(const c of S.split(";")){const b=c.indexOf("=");b>0&&(d[c.slice(0,b).trim()]=c.slice(b+1).trim())}return d}const SESSION_COOKIE="myhi_sid",COOKIE_OPTS="HttpOnly; SameSite=Strict; Path=/; Max-Age=31536000";function setSessionCookie(S,d){S.setHeader("Set-Cookie",`${SESSION_COOKIE}=${d||TOKEN}; ${COOKIE_OPTS}`)}function getSessionToken(S){return parseCookies(S)[SESSION_COOKIE]||null}function hasValidSession(S){const d=getSessionToken(S);if(d&&userSessions.has(d)){const c=userSessions.get(d);return c&&(c.lastUsed=Date.now()),!0}return!1}function getUserInfo(S){const d=getSessionToken(S);return d?userSessions.get(d):null}const app=express();app.set("trust proxy",!0),app.use((S,d,c)=>{d.setHeader("Referrer-Policy","no-referrer"),d.setHeader("X-Content-Type-Options","nosniff"),c()});const httpServer=(0,external_http_.createServer)(app),_corsAllowed=/^https?:\/\/(localhost|127\.0\.0\.1|\[::1\]|10\.\d+\.\d+\.\d+|172\.(1[6-9]|2\d|3[01])\.\d+\.\d+|192\.168\.\d+\.\d+|100\.(6[4-9]|[7-9]\d|1[01]\d|12[0-7])\.\d+\.\d+)(:\d+)?$/,io=new Server({cors:{origin:(S,d)=>{if(!S||_corsAllowed.test(S))return d(null,!0);d(new Error("CORS \u4E0D\u5141\u8BB8\u6B64\u6765\u6E90"),!1)},credentials:!0},transports:["websocket"]});io.attach(httpServer);const manager=new SessionManager,AUTO_ATTACH=process.env.MYHI_AUTO_ATTACH!=="0",_autoSpawned=new Set;function spawnLocalTerminal(S,d){if(!AUTO_ATTACH||_autoSpawned.has(S))return;_autoSpawned.add(S);const c=__nccwpck_require__.ab+"attach.js",b=process.execPath,g=d||"myhi";if(process.platform==="win32"){const m=`"${b}" "${c}" ${S}`,u=(0,external_child_process_namespaceObject.spawn)("wt.exe",["-w","0","new-tab","--title",g,"--","cmd","/k",m],{detached:!0,stdio:"ignore"});u.unref(),u.on("error",f=>{console.warn("[attach] wt.exe \u5931\u8D25\uFF0C\u56DE\u9000\u5230 cmd:",f.message),(0,external_child_process_namespaceObject.spawn)("cmd.exe",["/c","start",`"${g}"`,"cmd","/k",m],{detached:!0,stdio:"ignore"}).unref()})}else if(process.platform==="darwin"){const m=`tell application "Terminal" to do script "${b} ${c} ${S}"`;(0,external_child_process_namespaceObject.spawn)("osascript",["-e",m],{detached:!0,stdio:"ignore"}).unref()}else{const m=`${b} "${c}" ${S}`;for(const[u,f]of[["gnome-terminal",["--","bash","-c",`${m}; exec bash`]],["xterm",["-title",g,"-e",m]],["konsole",["--new-tab","-e",m]]]){const a=(0,external_child_process_namespaceObject.spawn)(u,f,{detached:!0,stdio:"ignore"});a.unref(),a.on("error",()=>{});break}}}const uploadDir=(0,external_path_.join)(configDir,"uploads");(0,external_fs_.mkdirSync)(uploadDir,{recursive:!0});function checkAuth(S,d,c){const b=S.query.token;if(b&&(b===TOKEN||userSessions.has(b))){const g=userSessions.get(b);if(g?.onetime){userSessions.delete(b);const u=(0,external_crypto_.randomBytes)(16).toString("hex");userSessions.set(u,{role:g.role,name:g.name,lastUsed:Date.now()}),setSessionCookie(d,u)}else setSessionCookie(d,b===TOKEN?TOKEN:b);const m=S.path+(Object.keys(S.query).filter(u=>u!=="token").length?"?"+new URLSearchParams(Object.fromEntries(Object.entries(S.query).filter(([u])=>u!=="token"))):"");return d.redirect(m)}if(hasValidSession(S.headers.cookie)){if(isExclusiveMode()&&activeUser){const g=getSessionToken(S.headers.cookie);if(g!==activeUser.token&&g!==TOKEN)return d.setHeader("Set-Cookie",`${SESSION_COOKIE}=; HttpOnly; SameSite=Strict; Path=/; Max-Age=0`),d.redirect("/login")}return c()}d.redirect("/login")}const _require=(0,external_module_namespaceObject.createRequire)(import.meta.url);function pkgDirSafe(S){try{return(0,external_path_.dirname)(_require.resolve(`${S}/package.json`))}catch{return null}}const libDir=(0,external_path_.join)(server_dirname,"lib");app.use("/lib/xterm",express.static(pkgDirSafe("xterm")||(0,external_path_.join)(libDir,"xterm"))),app.use("/lib/xterm-fit",express.static(pkgDirSafe("xterm-addon-fit")||(0,external_path_.join)(libDir,"xterm-fit"))),app.use("/lib/xterm-links",express.static(pkgDirSafe("xterm-addon-web-links")||(0,external_path_.join)(libDir,"xterm-links")));const _loginAttempts=new Map,LOGIN_MAX_ATTEMPTS=5,LOGIN_LOCKOUT_MS=300*1e3;function checkLoginRate(S){const d=Date.now(),c=_loginAttempts.get(S);return!c||d>c.resetAt?!0:c.count<LOGIN_MAX_ATTEMPTS}function recordLoginFailure(S){const d=Date.now(),c=_loginAttempts.get(S);!c||d>c.resetAt?_loginAttempts.set(S,{count:1,resetAt:d+LOGIN_LOCKOUT_MS}):c.count++}function clearLoginFailures(S){_loginAttempts.delete(S)}setInterval(()=>{const S=Date.now();for(const[d,c]of _loginAttempts)S>c.resetAt&&_loginAttempts.delete(d)},600*1e3),app.get("/login",(S,d)=>{d.sendFile(__nccwpck_require__.ab+"login.html")}),app.post("/login",express.urlencoded({extended:!1}),(S,d)=>{const c=S.ip;if(!checkLoginRate(c))return d.redirect("/login?error=locked");loadRoles(),loadUsers();const b=S.body?.password,g=S.query.from,m=g&&g.startsWith("/")&&!g.startsWith("//")?g:"/";if(isExclusiveMode()){const f=lookupUser(b);if(!f)return recordLoginFailure(c),d.redirect("/login?error=1");if(activeUser&&activeUser.name!==f.name)return d.redirect("/login?error=occupied&user="+encodeURIComponent(activeUser.name));clearLoginFailures(c);const a=(0,external_crypto_.randomBytes)(16).toString("hex");return userSessions.set(a,{role:"admin",name:f.name,dir:f.dir,lastUsed:Date.now()}),activeUser={name:f.name,dir:f.dir,token:a,loginAt:Date.now()},setSessionCookie(d,a),console.log(`[\u767B\u5F55] ${f.name} \u767B\u5F55\uFF08\u72EC\u5360\u6A21\u5F0F\uFF09`),d.redirect(m)}const u=lookupPassword(b);if(u){clearLoginFailures(c);const f=(0,external_crypto_.randomBytes)(16).toString("hex");return userSessions.set(f,{role:u.role,name:u.name,lastUsed:Date.now()}),setSessionCookie(d,f),d.redirect(m)}if(b===PASSWORD){clearLoginFailures(c);const f=(0,external_crypto_.randomBytes)(16).toString("hex");return userSessions.set(f,{role:"admin",name:"\u7BA1\u7406\u5458",lastUsed:Date.now()}),setSessionCookie(d,f),d.redirect(m)}recordLoginFailure(c),d.redirect("/login?error=1")}),app.post("/logout",(S,d)=>{const c=getSessionToken(S.headers.cookie);if(c){if(activeUser&&activeUser.token===c){console.log(`[\u9000\u51FA] ${activeUser.name} \u9000\u51FA\u767B\u5F55`);for(const b of manager.listSessions())manager.kill(b.id),_autoSpawned.delete(b.id);activeUser=null}userSessions.delete(c)}d.setHeader("Set-Cookie",`${SESSION_COOKIE}=; HttpOnly; SameSite=Strict; Path=/; Max-Age=0`),d.redirect("/login")}),app.get("/api/status",(S,d)=>{if(isExclusiveMode()&&activeUser)return d.json({occupied:!0,userName:activeUser.name,releasing:!!_exclusiveReleaseTimer});d.json({occupied:!1})}),app.get("/",checkAuth,(S,d)=>d.sendFile(__nccwpck_require__.ab+"index.html")),app.get("/terminal/:id",checkAuth,(S,d)=>d.sendFile(__nccwpck_require__.ab+"chat.html")),app.get("/terminal-raw/:id",checkAuth,(S,d)=>d.sendFile(__nccwpck_require__.ab+"terminal.html")),app.use("/lib",express.static(__nccwpck_require__.ab+"lib")),app.get("/api/sessions",checkAuth,(S,d)=>{const c=getUserInfo(S.headers.cookie);d.json(manager.list(c?.name))}),app.post("/api/sessions",checkAuth,express.json(),(S,d)=>{const c=getUserInfo(S.headers.cookie),b=manager.create({...S.body,owner:c?.name});d.status(201).json(b.toJSON())}),app.delete("/api/sessions/:id",checkAuth,(S,d)=>{manager.kill(S.params.id),d.status(204).end()}),app.get("/api/claude-sessions",checkAuth,(S,d)=>{d.json(listLocalClaudeSessions())}),app.get("/api/dirs",checkAuth,(S,d)=>{const c=getUserInfo(S.headers.cookie);if(!c||c.role!=="admin")return d.status(403).json({error:"\u6CA1\u6709\u76EE\u5F55\u6D4F\u89C8\u6743\u9650"});const b=c.dir?(0,external_path_.resolve)((0,external_path_.normalize)(c.dir)):null,g=process.platform==="win32"?"\\":"/";let m=S.query.path||b||process.env.MYHI_CWD||(0,external_os_.homedir)(),u=(0,external_path_.resolve)((0,external_path_.normalize)(m)).replace(/[/\\]+$/,"");process.platform==="win32"&&/^[A-Za-z]:$/.test(u)&&(u+="\\"),b&&!u.startsWith(b)&&(u=b);try{const f=(0,external_fs_.readdirSync)(u,{withFileTypes:!0}).filter(r=>r.isDirectory()&&!r.name.startsWith(".")).map(r=>({name:r.name,path:u.replace(/[/\\]+$/,"")+g+r.name})).sort((r,n)=>r.name.localeCompare(n.name)),a=(0,external_path_.join)(u,".."),t=!b||(0,external_path_.resolve)((0,external_path_.normalize)(a)).startsWith(b);d.json({current:u,parent:t&&a!==u?a:null,dirs:f})}catch(f){d.status(400).json({error:f.message})}}),app.get("/api/me",checkAuth,(S,d)=>{const c=getUserInfo(S.headers.cookie);d.json({name:c?.name||"\u7528\u6237",exclusive:isExclusiveMode(),dir:c?.dir||null})}),app.post("/upload",checkAuth,(S,d)=>{const c=S.query.sessionId,b=c?manager.get(c):null,g=b?.cwd?(0,external_path_.join)(b.cwd,"upload"):uploadDir;(0,external_fs_.mkdirSync)(g,{recursive:!0}),multer({storage:multer.diskStorage({destination:g,filename:(u,f,a)=>{const t=f.originalname.match(/\.[^.]+$/)?.[0]||".jpg";a(null,`${Date.now()}-${(0,external_crypto_.randomBytes)(3).toString("hex")}${t}`)}}),limits:{fileSize:20*1024*1024},fileFilter:(u,f,a)=>a(null,f.mimetype.startsWith("image/"))}).single("image")(S,d,u=>{if(u)return d.status(400).json({error:u.message});if(!S.file)return d.status(400).json({error:"\u6CA1\u6709\u56FE\u7247"});d.json({path:(0,external_path_.resolve)(S.file.path).replace(/\\/g,"/")})})}),app.get("/qr/:sessionId",checkAuth,async(S,d)=>{const c=getTailscaleIP(),b=(0,external_crypto_.randomBytes)(16).toString("hex");userSessions.set(b,{role:"admin",name:"\u626B\u7801\u7528\u6237",onetime:!0,lastUsed:Date.now()});const g=`http://${c}:${PORT}/terminal/${S.params.sessionId}?token=${b}`;try{const m=await lib.toString(g,{type:"svg"});d.setHeader("Content-Type","image/svg+xml"),d.send(m)}catch(m){d.status(500).send(m.message)}}),io.use((S,d)=>{const c=S.handshake.headers.cookie;if(hasValidSession(c)){const g=getUserInfo(c);return S.data.role=g?.role||"admin",S.data.userName=g?.name||"\u7528\u6237",S.data.dir=g?.dir||null,d()}if((S.handshake.auth?.token||S.handshake.query?.token)===TOKEN)return S.data.role="admin",S.data.userName="\u7BA1\u7406\u5458",d();d(new Error("\u672A\u6388\u6743"))});const EXCLUSIVE_RELEASE_DELAY=120*1e3;let _exclusiveReleaseTimer=null;function checkExclusiveRelease(){if(!isExclusiveMode()||!activeUser)return;let S=!1;for(const[,d]of io.sockets.sockets)if(d.data.userName===activeUser.name){S=!0;break}if(S){_exclusiveReleaseTimer&&(clearTimeout(_exclusiveReleaseTimer),_exclusiveReleaseTimer=null);return}_exclusiveReleaseTimer||(_exclusiveReleaseTimer=setTimeout(()=>{if(_exclusiveReleaseTimer=null,!!activeUser){for(const[,d]of io.sockets.sockets)if(d.data.userName===activeUser.name)return;console.log(`[\u72EC\u5360] ${activeUser.name} \u5DF2\u79BB\u7EBF\u8D85\u65F6\uFF0C\u81EA\u52A8\u91CA\u653E\u767B\u5F55\u72B6\u6001`);for(const d of manager.listSessions())manager.kill(d.id),_autoSpawned.delete(d.id);userSessions.delete(activeUser.token),activeUser=null}},EXCLUSIVE_RELEASE_DELAY))}function broadcastSessions(){for(const[,S]of io.sockets.sockets)S.emit("sessions",manager.list(S.data.userName))}io.on("connection",S=>{const d=S.handshake.address?.replace("::ffff:","")||"?";console.log(`[\u8FDE\u63A5] ${S.data.userName}(${S.data.role}) \u4ECE ${d} \u63A5\u5165 id=${S.id}`),_exclusiveReleaseTimer&&activeUser&&S.data.userName===activeUser.name&&(clearTimeout(_exclusiveReleaseTimer),_exclusiveReleaseTimer=null);let c=null,b=null,g=null,m=null,u=null;function f(){c&&(c.isController(S.id)&&(c.releaseControl(),io.emit("control-changed",{sessionId:c.id,holder:null,holderName:null})),c.removeViewer(S.id),b&&c.off("data",b),g&&c.off("agent:message",g),m&&c.off("agent:busy",m),u&&c.off("agent:error",u),b=null,g=null,m=null,u=null)}S.on("join",a=>{const t=manager.get(a);if(!t){S.emit("error",{message:`\u4F1A\u8BDD ${a} \u672A\u627E\u5230`});return}f(),c=t,c.addViewer(S.id),t.mode==="agent"?(g=r=>S.emit("agent:message",r),c.on("agent:message",g),m=r=>S.emit("agent:busy",r),c.on("agent:busy",m),u=r=>S.emit("agent:error",r),c.on("agent:error",u)):(b=r=>S.emit("output",r),c.on("data",b),c.once("exit",r=>{S.emit("session-exit",{code:r}),b&&c?.off("data",b)}),spawnLocalTerminal(a,t.title)),console.log(`[\u52A0\u5165] ${S.data.userName} \u52A0\u5165\u4F1A\u8BDD "${t.title}" (${a}) \u6A21\u5F0F=${t.mode||"pty"}`),S.emit("joined",{...t.toJSON(),role:S.data.role}),t.mode==="agent"?t._history?.length&&S.emit("agent:history",t._history):t._scrollback?.length&&S.emit("output",t._scrollback),broadcastSessions()}),S.on("disconnect",()=>{console.log(`[\u65AD\u5F00] ${S.data.userName} \u79BB\u5F00\u4F1A\u8BDD "${c?.title||"?"}" id=${S.id}`),f(),broadcastSessions(),checkExclusiveRelease()}),S.on("agent:query",async({prompt:a}={})=>{if(!c||c.mode!=="agent"){S.emit("agent:error",{message:"\u5F53\u524D\u4E0D\u662F Agent \u6A21\u5F0F\u4F1A\u8BDD"});return}if(!c.isController(S.id)){S.emit("control-denied",{reason:"\u4F60\u6CA1\u6709\u5F53\u524D\u4F1A\u8BDD\u7684\u63A7\u5236\u6743"});return}if(c.isBusy){S.emit("agent:error",{message:"\u6B63\u5728\u5904\u7406\u4E2D\uFF0C\u8BF7\u7B49\u5F85\u5B8C\u6210"});return}try{await c.query(a)}catch(t){console.error("[agent:query] \u9519\u8BEF:",t.message),S.emit("agent:error",{message:t.message})}}),S.on("agent:interrupt",()=>{!c||c.mode!=="agent"||c.interrupt()}),S.on("create-agent",(a,t)=>{if(!hasPermission(S.data.role,"admin")){typeof t=="function"&&t({ok:!1,error:"\u6CA1\u6709\u521B\u5EFA\u4F1A\u8BDD\u7684\u6743\u9650"});return}if(S.data.dir){const r=(0,external_path_.resolve)((0,external_path_.normalize)(S.data.dir)),n=a?.cwd?(0,external_path_.resolve)((0,external_path_.normalize)(a.cwd)):null;if(n&&!n.startsWith(r)){typeof t=="function"&&t({ok:!1,error:"\u4E0D\u80FD\u5728\u7ED1\u5B9A\u76EE\u5F55\u4E4B\u5916\u521B\u5EFA\u4F1A\u8BDD"});return}n||(a={...a,cwd:r})}try{const r=manager.createAgent({...a,owner:S.data.userName});console.log(`[\u4F1A\u8BDD] ${S.data.userName} \u521B\u5EFA Agent \u4F1A\u8BDD "${r.title}" (${r.id})`),broadcastSessions(),typeof t=="function"&&t({ok:!0,session:r.toJSON()})}catch(r){typeof t=="function"&&t({ok:!1,error:r.message})}}),S.on("input",a=>{if(!(a==null||!c)&&c.mode!=="agent"){if(!c.isController(S.id)){S.emit("control-denied",{reason:"\u4F60\u6CA1\u6709\u5F53\u524D\u4F1A\u8BDD\u7684\u63A7\u5236\u6743"});return}c.lastInputTime=Date.now(),c.write(a)}}),S.on("take-control",({sessionId:a}={})=>{const t=a?manager.get(a):c;if(t){if(!hasPermission(S.data.role,"operator")){S.emit("control-denied",{reason:"\u4F60\u7684\u89D2\u8272\u6CA1\u6709\u63A7\u5236\u6743\u9650"});return}if(t.controlHolder&&t.controlHolder!==S.id&&S.data.role!=="admin"){S.emit("control-denied",{reason:"\u5176\u4ED6\u7528\u6237\u6B63\u5728\u63A7\u5236\u4E2D\uFF0C\u8BF7\u7B49\u5F85\u91CA\u653E"});return}t.takeControl(S.id,S.data.userName),console.log(`[\u63A7\u5236] ${S.data.userName} \u83B7\u53D6\u4F1A\u8BDD "${t.title}" \u7684\u63A7\u5236\u6743`),io.emit("control-changed",{sessionId:t.id,holder:S.id,holderName:S.data.userName})}}),S.on("release-control",({sessionId:a}={})=>{const t=a?manager.get(a):c;t&&t.isController(S.id)&&(console.log(`[\u63A7\u5236] ${S.data.userName} \u91CA\u653E\u4F1A\u8BDD "${t.title}" \u7684\u63A7\u5236\u6743`),t.releaseControl(),io.emit("control-changed",{sessionId:t.id,holder:null,holderName:null}))}),S.on("set-mode",({sessionId:a,mode:t}={})=>{const r=a?manager.get(a):c;r&&(r.permissionMode=t,io.emit("mode-changed",{sessionId:r.id,mode:t}))}),S.on("rename",({sessionId:a,title:t}={})=>{const r=a?manager.get(a):c;!r||!t||(r.title=t,io.emit("session-renamed",{sessionId:r.id,title:t}),broadcastSessions())}),S.on("resize",({cols:a,rows:t})=>c?.resize(a,t)),S.on("list",()=>S.emit("sessions",manager.list(S.data.userName))),S.on("dirs",(a,t)=>{if(typeof t!="function")return;const r=S.data.dir?(0,external_path_.resolve)((0,external_path_.normalize)(S.data.dir)):null,n=process.platform==="win32"?"\\":"/";let e=(a||r||process.env.MYHI_CWD||(0,external_os_.homedir)()).replace(/[/\\]+$/,"")||(0,external_os_.homedir)();process.platform==="win32"&&/^[A-Za-z]:$/.test(e)&&(e+="\\"),r&&!(0,external_path_.resolve)((0,external_path_.normalize)(e)).startsWith(r)&&(e=r);try{const o=(0,external_fs_.readdirSync)(e,{withFileTypes:!0}).filter(p=>p.isDirectory()&&!p.name.startsWith(".")).map(p=>({name:p.name,path:e.replace(/[/\\]+$/,"")+n+p.name})).sort((p,l)=>p.name.localeCompare(l.name)),s=(0,external_path_.join)(e,".."),i=!r||(0,external_path_.resolve)((0,external_path_.normalize)(s)).startsWith(r);t({ok:!0,current:e,parent:i&&s!==e?s:null,dirs:o})}catch(o){t({ok:!1,error:o.message})}}),S.on("create",(a,t)=>{if(!hasPermission(S.data.role,"admin")){typeof t=="function"&&t({ok:!1,error:"\u6CA1\u6709\u521B\u5EFA\u4F1A\u8BDD\u7684\u6743\u9650"});return}if(S.data.dir){const r=(0,external_path_.resolve)((0,external_path_.normalize)(S.data.dir)),n=a?.cwd?(0,external_path_.resolve)((0,external_path_.normalize)(a.cwd)):null;if(n&&!n.startsWith(r)){typeof t=="function"&&t({ok:!1,error:"\u4E0D\u80FD\u5728\u7ED1\u5B9A\u76EE\u5F55\u4E4B\u5916\u521B\u5EFA\u4F1A\u8BDD"});return}n||(a={...a,cwd:r})}try{const r=manager.create({...a,owner:S.data.userName});console.log(`[\u4F1A\u8BDD] ${S.data.userName} \u521B\u5EFA PTY \u4F1A\u8BDD "${r.title}" (${r.id})`),broadcastSessions(),typeof t=="function"&&t({ok:!0,session:r.toJSON()})}catch(r){console.error("[\u521B\u5EFA] PTY \u542F\u52A8\u5931\u8D25:",r.message),typeof t=="function"&&t({ok:!1,error:r.message})}}),S.on("kill",a=>{if(!hasPermission(S.data.role,"admin")){S.emit("error",{message:"\u6CA1\u6709\u5220\u9664\u4F1A\u8BDD\u7684\u6743\u9650"});return}console.log(`[\u4F1A\u8BDD] ${S.data.userName} \u5220\u9664\u4F1A\u8BDD ${a}`),manager.kill(a),_autoSpawned.delete(a),broadcastSessions()})});const CONTROL_TIMEOUT=300*1e3;setInterval(()=>{for(const S of manager.listSessions())S.controlHolder&&S.lastInputTime&&Date.now()-S.lastInputTime>CONTROL_TIMEOUT&&(S.releaseControl(),io.emit("control-changed",{sessionId:S.id,holder:null,holderName:null}))},60*1e3);function showStartupInfo(){const S=httpServer.address().port;PORT=S;const d=getTailscaleIP(),c=`http://${d}:${S}/?token=${TOKEN}`;console.log(`
|
|
360
360
|
\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501`),console.log(" myhi \u2014 \u57FA\u4E8E Tailscale \u7684 Web \u7EC8\u7AEF"),console.log("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),console.log(`
|
|
361
361
|
\u5730\u5740: http://${d}:${S}`),console.log(` \u5BC6\u7801: ${PASSWORD} (\u7F16\u8F91 ~/.myhi/password \u53EF\u4FEE\u6539)`),console.log(`
|
|
362
362
|
\u626B\u63CF\u4E8C\u7EF4\u7801\u5728\u624B\u673A\u4E0A\u6253\u5F00:
|
package/dist/login.html
CHANGED
|
@@ -145,7 +145,7 @@
|
|
|
145
145
|
const res = await fetch('/api/status');
|
|
146
146
|
const data = await res.json();
|
|
147
147
|
if (data.occupied) {
|
|
148
|
-
occupiedEl.textContent = data.userName + ' 正在使用中\n请等待对方退出后登录';
|
|
148
|
+
occupiedEl.textContent = data.userName + ' 正在使用中\n' + (data.releasing ? '对方已离线,即将自动释放…' : '请等待对方退出后登录');
|
|
149
149
|
occupiedEl.style.display = 'block';
|
|
150
150
|
btnEl.disabled = true;
|
|
151
151
|
inputEl.disabled = true;
|