openpond 0.2.34 → 0.2.35
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/app-server.js +1 -1
- package/dist/chunks/{app-server-runtime-QI2PKYDK.js → app-server-runtime-CAWXM33C.js} +1 -1
- package/dist/chunks/{chunk-C472WX3L.js → chunk-BRJKTOMI.js} +1 -1
- package/dist/chunks/{chunk-UOPUBKJ4.js → chunk-JLWAK5PS.js} +1 -1
- package/dist/chunks/{chunk-UYBZNV72.js → chunk-OYJ73BSC.js} +1 -1
- package/dist/chunks/{chunk-WJD5NVVH.js → chunk-PMXE4CAA.js} +1 -1
- package/dist/chunks/{chunk-MLBXB6IG.js → chunk-VL553I5E.js} +2 -2
- package/dist/chunks/{chunk-CC7BNJCF.js → chunk-XR6ZLKVW.js} +8 -8
- package/dist/chunks/{cli-CJGAH3AL.js → cli-YI6G22CQ.js} +1 -1
- package/dist/chunks/{hosted-profile-compiler-WJWQQFBN.js → hosted-profile-compiler-7SGXUZB4.js} +1 -1
- package/dist/chunks/{src-ZJQAFIKJ.js → src-ZGGKHNNF.js} +1 -1
- package/dist/chunks/{workspaces-O575SJO4.js → workspaces-XFUQZH5T.js} +1 -1
- package/dist/cli.js +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
3
|
-
import{a as zA,b as WA,c as VA,d as j,e as JA,f as co,g as z,h as Iu,j as GA}from"./chunk-UYBZNV72.js";import{$ as zx,$a as jT,$b as yA,A as iu,Aa as dT,Ab as eA,Ac as BA,B as lx,Ba as pe,Bb as tA,Bc as $A,C as ux,Ca as lT,Cb as nA,Cc as LA,D as px,Da as uT,Db as yu,Dc as NA,E as cu,Ea as pT,Eb as rA,Ec as UA,F as mx,Fa as mT,Fb as Zo,Fc as FA,G as fx,Ga as fT,Gb as vu,H as gx,Ha as gT,Hb as oA,Hc as qA,I as hx,Ia as hT,Ib as so,J as wx,Ja as wT,Jb as ku,K as pc,Ka as yT,Kb as aA,L as Ex,La as vT,Lb as sA,M as Mx,Ma as kT,Mb as oh,N as jx,Na as Ss,Nb as ah,O as Hx,Oa as On,Ob as iA,P as Ox,Pa as He,Pb as cA,Q as mc,Qa as bT,Qb as dA,R as Dx,Ra as ST,Rb as lA,S as Bx,Sa as IT,Sb as sh,T as vs,Ta as RT,Tb as uA,U as ks,Ua as xT,Ub as ih,V as $x,Va as TT,Vb as pA,W as Lx,Wa as hu,Wb as mA,X as Nx,Xa as AT,Xb as fA,Y as Ux,Ya as CT,Yb as gA,Z as Fx,Za as ET,Zb as hA,_ as qx,_a as MT,_b as wA,a as kg,aa as oo,ab as rh,ac as vA,b as CS,ba as Wx,bb as HT,bc as kA,c as ES,ca as Vx,cb as OT,cc as bA,d as MS,da as th,db as DT,dc as ch,e as jS,ea as Jx,eb as BT,ec as SA,f as HS,fa as Gx,fb as $T,fc as dh,g as OS,ga as Kx,gb as LT,gc as IA,h as qo,ha as bs,hb as NT,hc as RA,i as DS,ia as Yx,ib as Dn,ic as PA,j as BS,ja as Xx,jb as UT,jc as _A,k as hl,ka as Qx,kb as wu,kc as xA,l as $S,la as Zx,lb as FT,lc as io,m as LS,ma as ae,mb as qT,mc as xr,n as W2,na as eT,nb as Nt,nc as lh,o as L_,oa as tT,ob as Qo,oc as TA,p as N_,pa as nT,pb as zT,pc as AA,q as U_,qa as pu,qb as _r,qc as bu,r as F_,ra as rT,rb as WT,rc as Is,s as G_,sa as oT,sb as VT,sc as CA,t as au,ta as aT,tb as JT,tc as Su,u as ax,ua as sT,ub as GT,uc as EA,v as sx,va as iT,vb as KT,vc as MA,w as ix,wa as mu,wb as YT,wc as jA,x as su,xa as cT,xb as XT,xc as HA,y as cx,ya as ao,yb as QT,yc as OA,z as dx,za as Ae,zb as ZT,zc as DA}from"./chunk-MLBXB6IG.js";import{A as Rx,C as lu,F as uu,G as cr,H as Px,I as Xg,J as _x,K as Qg,N as xx,O as Zg,P as Tx,Q as Ax,R as Cx,S as eh,T as ys,b as du,d as yx,e as vx,h as kx,m as ws,n as bx,p as Sx,q as Ix,s as uc}from"./chunk-C472WX3L.js";import{A as V_,B as tu,C as nu,D as hs,H as J_,J as nh,K as PT,L as fu,M as gu,N as _T,a as ct,b as q_,c as z_,f as W_}from"./chunk-CC7BNJCF.js";import{$ as Yg,A as A_,P as Zl,S as C_,V as E_,W as M_,X as gs,Y as eu,Z as lc,a as pS,aa as Xo,b as mS,ba as j_,c as fS,ca as H_,da as O_,e as gS,ea as D_,f as hS,g as ml,h as IS,ha as B_,i as RS,j as PS,k as _S,l as xS,ma as $_,t as I_,u as R_,v as P_,w as __,x as x_,y as T_,z as Ql}from"./chunk-UOPUBKJ4.js";import{a as b_,b as Xl,d as ie,e as it,f as fs,g as ne,i as S_}from"./chunk-WJD5NVVH.js";import{a as on,b as K_,c as Y_,d as ru,e as ou,g as X_,h as Q_,j as Z_,k as ex,l as tx,m as nx,n as rx,o as ox}from"./chunk-SRQVXHSM.js";import{$ as hR,$a as LR,$b as yP,$c as GP,$d as dc,A as aR,Aa as Hg,Ac as sc,B as Al,Bb as $g,Bc as zg,C as sR,Ca as qe,Cb as oc,D as Eg,Da as jl,E as iR,Ea as _R,Eb as oP,Ec as Ul,Ed as Ko,F as cR,Fa as Og,Fd as r_,G as tt,Gc as Wg,Gd as Pr,H as dR,Ha as xR,Hb as aP,Hc as $P,Hd as o_,I as yt,Ib as sP,Ic as LP,Id as a_,J as rc,Jb as iP,Jd as s_,K as lR,Kd as no,L as uR,La as TR,Lb as cs,Lc as Fl,Ld as ps,Mb as cP,Mc as NP,Md as Vl,N as pR,Na as Hl,Nc as Vg,Nd as i_,Oa as AR,Ob as ac,Oc as sr,Od as c_,P as mR,Pb as Ll,Pc as UP,Pd as d_,Q as fR,Qa as CR,Qb as dP,Qc as FP,Qd as cc,R as Hn,Ra as ER,Rb as Lg,Rc as Jg,Rd as ms,Sa as MR,Sb as lP,Sc as ic,Sd as Jl,Ta as jR,Tb as uP,Tc as qP,Td as l_,Ua as HR,Ub as Ng,Uc as ql,Ud as Gl,Va as OR,Vb as pP,Vc as zP,Vd as ro,Wa as DR,Wb as mP,Wc as WP,Wd as u_,X as gR,Xa as BR,Xb as fP,Xc as ds,Xd as p_,Ya as $R,Yb as gP,Yc as VP,Yd as m_,Z as Cl,Za as to,Zb as hP,Zc as ls,Zd as Kl,_b as wP,_c as JP,_d as f_,ab as NR,ac as Ug,ad as Gg,ae as g_,bb as UR,bc as vP,bd as zl,be as h_,c as VI,ca as Mg,cb as FR,cc as kP,cd as KP,da as wR,dc as bP,dd as Be,ea as Lt,eb as qR,ec as SP,ed as Wl,fa as Vo,fb as Ol,fc as Fg,fd as YP,ga as Jo,gb as zR,gc as IP,gd as XP,ha as jg,hb as WR,hc as RP,hd as QP,ia as yR,ib as VR,ic as PP,id as Kg,ja as vR,jb as JR,jc as _P,jd as ZP,ka as kR,kb as GR,kc as xP,kd as e_,ke as Yl,l as JI,la as bR,lb as KR,lc as TP,ld as t_,le as w_,m as GI,ma as SR,mb as YR,mc as AP,me as y_,n as KI,na as IR,nb as XR,nc as CP,nd as us,ne as ir,oa as El,ob as QR,oc as EP,od as n_,oe as v_,pb as ZR,pc as MP,pe as Yo,q as YI,qa as Ml,qb as eP,qc as qg,qe as k_,r as XI,rb as tP,rc as Go,s as QI,sb as nP,sc as jP,t as ZI,tb as Dg,tc as HP,u as eR,ub as Dl,uc as OP,v as Cg,vb as rP,w as tR,wb as ar,wc as Nl,x as nR,xa as RR,xb as Bl,xc as DP,y as rR,yb as Bg,z as oR,za as PR,zb as $l,zc as BP}from"./chunk-77BXXOHW.js";import{a as uI,h as HI,k as OI}from"./chunk-TBX3Z7TX.js";import{b as wS,c as yS}from"./chunk-L3KS6MOV.js";import"./chunk-XEOEKFG6.js";import{A as tc,B as xg,C as Tl,D as LI,E as NI,I as UI,J as FI,N as is,O as nc,P as qI,Q as zI,R as WI,T as Tg,V as Ag,i as DI,t as BI,u as $I,v as wn,w as xl,z as Wo}from"./chunk-QWENRTVW.js";import"./chunk-6MI4KKWF.js";import{$ as XS,$b as jn,A as bg,Ab as fI,Ac as Rl,B as US,Bb as gI,Bc as Pl,C as FS,Cb as hI,Cc as _l,D as qS,Db as bl,Dc as TI,E as yl,Eb as Pg,Ec as _g,F as zS,Fa as nI,Fb as wI,Fc as AI,G as WS,Gb as yI,H as VS,Hb as vI,Hc as CI,I as JS,Ic as EI,Jc as MI,Kc as eo,Lc as jI,Mb as kI,Mc as or,Ob as os,Q as GS,R as KS,Ra as rI,Rb as bI,Ta as oI,Tb as SI,Ua as aI,V as YS,a as vS,ab as sI,ac as II,b as kS,bc as Sl,c as hn,cc as rn,db as iI,ea as QS,f as bS,g as pl,ga as Sg,h as SS,ha as Ee,hc as Il,ia as zo,ib as cI,ja as Qe,m as fl,mb as Rg,na as ZS,nb as dI,o as TS,pc as RI,qa as ec,qb as lI,ra as eI,rb as kl,rc as PI,sa as vl,tc as as,u as gl,ua as tI,v as AS,va as Ig,w as NS,wa as rs,x as wl,xc as ss,yb as pI,yc as _I,zb as mI,zc as xI}from"./chunk-JFSDNQHW.js";import"./chunk-SDO4FC4Q.js";import"./chunk-IR3YJWPW.js";import{D as ns,E as Qi,F as ul,d as ll,m as lS,n as Zr,o as Ve,p as uS}from"./chunk-B5LKUQGM.js";import"./chunk-MJC26GOX.js";import{$a as dl,$b as cS,Da as z2,Ea as tS,Fa as yg,Ga as vg,Ia as nS,Lb as Je,Mb as Vt,Pa as rS,S as il,Sb as iS,Ta as oS,Ua as aS,a as nn,bc as dS,hb as sS,qa as Qb,ra as cl,ta as Zb,wa as eS}from"./chunk-5BFWDFPX.js";import{a as Zi}from"./chunk-6FA3GG5B.js";import{A as Ct,B as Lo,C as Tb,D as Xi,E as Rr,F as nl,G as Ab,Ga as Qr,H as rl,I as Cb,Ia as No,J as es,L as Eb,M as Mb,N as jb,Na as Ub,O as Hb,Oa as Fb,P as Ob,Pa as zb,Qa as Wb,Ta as Vb,Va as hg,W as gg,Wa as wg,Xa as Jb,ca as Db,f as Qd,ga as Xr,ia as Bb,ib as al,jb as Gb,k as Qa,ka as $b,l as Za,la as Lb,m as mg,ma as Nb,n as Zd,nb as Kb,o as st,ob as Yb,p as fg,q as el,qb as Fo,rb as Xb,sb as sl,t as We,u as Se,v as O,w as _b,y as xb,z as tl}from"./chunk-IFP6W4OW.js";import{a as $o,b as P}from"./chunk-ES2ISFJC.js";import{a as Ib,c as Bo,f as Rb,h as Xd,i as Pb,p as ts,q as qb,r as Uo,s as ol}from"./chunk-H7IWJN7L.js";import{a,b as Pe,c as Te,e as Mn}from"./chunk-FTQLQJQV.js";var Br=Te((tme,sj)=>{"use strict";var oj=["nodebuffer","arraybuffer","fragments"],aj=typeof Blob<"u";aj&&oj.push("blob");sj.exports={BINARY_TYPES:oj,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:aj,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:a(()=>{},"NOOP")}});var $c=Te((rme,gp)=>{"use strict";var{EMPTY_BUFFER:UG}=Br(),jw=Buffer[Symbol.species];function FG(e,t){if(e.length===0)return UG;if(e.length===1)return e[0];let n=Buffer.allocUnsafe(t),r=0;for(let o=0;o<e.length;o++){let s=e[o];n.set(s,r),r+=s.length}return r<t?new jw(n.buffer,n.byteOffset,r):n}a(FG,"concat");function ij(e,t,n,r,o){for(let s=0;s<o;s++)n[r+s]=e[s]^t[s&3]}a(ij,"_mask");function cj(e,t){for(let n=0;n<e.length;n++)e[n]^=t[n&3]}a(cj,"_unmask");function qG(e){return e.length===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.length)}a(qG,"toArrayBuffer");function Hw(e){if(Hw.readOnly=!0,Buffer.isBuffer(e))return e;let t;return e instanceof ArrayBuffer?t=new jw(e):ArrayBuffer.isView(e)?t=new jw(e.buffer,e.byteOffset,e.byteLength):(t=Buffer.from(e),Hw.readOnly=!1),t}a(Hw,"toBuffer");gp.exports={concat:FG,mask:ij,toArrayBuffer:qG,toBuffer:Hw,unmask:cj};if(!process.env.WS_NO_BUFFER_UTIL)try{let e=Pe("bufferutil");gp.exports.mask=function(t,n,r,o,s){s<48?ij(t,n,r,o,s):e.mask(t,n,r,o,s)},gp.exports.unmask=function(t,n){t.length<32?cj(t,n):e.unmask(t,n)}}catch{}});var uj=Te((ame,lj)=>{"use strict";var dj=Symbol("kDone"),Ow=Symbol("kRun"),Dw=class{static{a(this,"Limiter")}constructor(t){this[dj]=()=>{this.pending--,this[Ow]()},this.concurrency=t||1/0,this.jobs=[],this.pending=0}add(t){this.jobs.push(t),this[Ow]()}[Ow](){if(this.pending!==this.concurrency&&this.jobs.length){let t=this.jobs.shift();this.pending++,t(this[dj])}}};lj.exports=Dw});var ei=Te((ime,gj)=>{"use strict";var Lc=Pe("zlib"),pj=$c(),zG=uj(),{kStatusCode:mj}=Br(),WG=Buffer[Symbol.species],VG=Buffer.from([0,0,255,255]),wp=Symbol("permessage-deflate"),$r=Symbol("total-length"),Qs=Symbol("callback"),So=Symbol("buffers"),Zs=Symbol("error"),hp,Bw=class{static{a(this,"PerMessageDeflate")}constructor(t){if(this._options=t||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._maxPayload=this._options.maxPayload|0,this._isServer=!!this._options.isServer,this._deflate=null,this._inflate=null,this.params=null,!hp){let n=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;hp=new zG(n)}}static get extensionName(){return"permessage-deflate"}offer(){let t={};return this._options.serverNoContextTakeover&&(t.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(t.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(t.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?t.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(t.client_max_window_bits=!0),t}accept(t){return t=this.normalizeParams(t),this.params=this._isServer?this.acceptAsServer(t):this.acceptAsClient(t),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let t=this._deflate[Qs];this._deflate.close(),this._deflate=null,t&&t(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(t){let n=this._options,r=t.find(o=>!(n.serverNoContextTakeover===!1&&o.server_no_context_takeover||o.server_max_window_bits&&(n.serverMaxWindowBits===!1||typeof n.serverMaxWindowBits=="number"&&n.serverMaxWindowBits>o.server_max_window_bits)||typeof n.clientMaxWindowBits=="number"&&!o.client_max_window_bits));if(!r)throw new Error("None of the extension offers can be accepted");return n.serverNoContextTakeover&&(r.server_no_context_takeover=!0),n.clientNoContextTakeover&&(r.client_no_context_takeover=!0),typeof n.serverMaxWindowBits=="number"&&(r.server_max_window_bits=n.serverMaxWindowBits),typeof n.clientMaxWindowBits=="number"?r.client_max_window_bits=n.clientMaxWindowBits:(r.client_max_window_bits===!0||n.clientMaxWindowBits===!1)&&delete r.client_max_window_bits,r}acceptAsClient(t){let n=t[0];if(this._options.clientNoContextTakeover===!1&&n.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!n.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(n.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&n.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return n}normalizeParams(t){return t.forEach(n=>{Object.keys(n).forEach(r=>{let o=n[r];if(o.length>1)throw new Error(`Parameter "${r}" must have only a single value`);if(o=o[0],r==="client_max_window_bits"){if(o!==!0){let s=+o;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${r}": ${o}`);o=s}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${r}": ${o}`)}else if(r==="server_max_window_bits"){let s=+o;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${r}": ${o}`);o=s}else if(r==="client_no_context_takeover"||r==="server_no_context_takeover"){if(o!==!0)throw new TypeError(`Invalid value for parameter "${r}": ${o}`)}else throw new Error(`Unknown parameter "${r}"`);n[r]=o})}),t}decompress(t,n,r){hp.add(o=>{this._decompress(t,n,(s,i)=>{o(),r(s,i)})})}compress(t,n,r){hp.add(o=>{this._compress(t,n,(s,i)=>{o(),r(s,i)})})}_decompress(t,n,r){let o=this._isServer?"client":"server";if(!this._inflate){let s=`${o}_max_window_bits`,i=typeof this.params[s]!="number"?Lc.Z_DEFAULT_WINDOWBITS:this.params[s];this._inflate=Lc.createInflateRaw({...this._options.zlibInflateOptions,windowBits:i}),this._inflate[wp]=this,this._inflate[$r]=0,this._inflate[So]=[],this._inflate.on("error",GG),this._inflate.on("data",fj)}this._inflate[Qs]=r,this._inflate.write(t),n&&this._inflate.write(VG),this._inflate.flush(()=>{let s=this._inflate[Zs];if(s){this._inflate.close(),this._inflate=null,r(s);return}let i=pj.concat(this._inflate[So],this._inflate[$r]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[$r]=0,this._inflate[So]=[],n&&this.params[`${o}_no_context_takeover`]&&this._inflate.reset()),r(null,i)})}_compress(t,n,r){let o=this._isServer?"server":"client";if(!this._deflate){let s=`${o}_max_window_bits`,i=typeof this.params[s]!="number"?Lc.Z_DEFAULT_WINDOWBITS:this.params[s];this._deflate=Lc.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:i}),this._deflate[$r]=0,this._deflate[So]=[],this._deflate.on("data",JG)}this._deflate[Qs]=r,this._deflate.write(t),this._deflate.flush(Lc.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let s=pj.concat(this._deflate[So],this._deflate[$r]);n&&(s=new WG(s.buffer,s.byteOffset,s.length-4)),this._deflate[Qs]=null,this._deflate[$r]=0,this._deflate[So]=[],n&&this.params[`${o}_no_context_takeover`]&&this._deflate.reset(),r(null,s)})}};gj.exports=Bw;function JG(e){this[So].push(e),this[$r]+=e.length}a(JG,"deflateOnData");function fj(e){if(this[$r]+=e.length,this[wp]._maxPayload<1||this[$r]<=this[wp]._maxPayload){this[So].push(e);return}this[Zs]=new RangeError("Max payload size exceeded"),this[Zs].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[Zs][mj]=1009,this.removeListener("data",fj),this.reset()}a(fj,"inflateOnData");function GG(e){if(this[wp]._inflate=null,this[Zs]){this[Qs](this[Zs]);return}e[mj]=1007,this[Qs](e)}a(GG,"inflateOnError")});var ti=Te((dme,yp)=>{"use strict";var{isUtf8:hj}=Pe("buffer"),{hasBlob:KG}=Br(),YG=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function XG(e){return e>=1e3&&e<=1014&&e!==1004&&e!==1005&&e!==1006||e>=3e3&&e<=4999}a(XG,"isValidStatusCode");function $w(e){let t=e.length,n=0;for(;n<t;)if((e[n]&128)===0)n++;else if((e[n]&224)===192){if(n+1===t||(e[n+1]&192)!==128||(e[n]&254)===192)return!1;n+=2}else if((e[n]&240)===224){if(n+2>=t||(e[n+1]&192)!==128||(e[n+2]&192)!==128||e[n]===224&&(e[n+1]&224)===128||e[n]===237&&(e[n+1]&224)===160)return!1;n+=3}else if((e[n]&248)===240){if(n+3>=t||(e[n+1]&192)!==128||(e[n+2]&192)!==128||(e[n+3]&192)!==128||e[n]===240&&(e[n+1]&240)===128||e[n]===244&&e[n+1]>143||e[n]>244)return!1;n+=4}else return!1;return!0}a($w,"_isValidUTF8");function QG(e){return KG&&typeof e=="object"&&typeof e.arrayBuffer=="function"&&typeof e.type=="string"&&typeof e.stream=="function"&&(e[Symbol.toStringTag]==="Blob"||e[Symbol.toStringTag]==="File")}a(QG,"isBlob");yp.exports={isBlob:QG,isValidStatusCode:XG,isValidUTF8:$w,tokenChars:YG};if(hj)yp.exports.isValidUTF8=function(e){return e.length<24?$w(e):hj(e)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let e=Pe("utf-8-validate");yp.exports.isValidUTF8=function(t){return t.length<32?$w(t):e(t)}}catch{}});var qw=Te((ume,Ij)=>{"use strict";var{Writable:ZG}=Pe("stream"),wj=ei(),{BINARY_TYPES:e6,EMPTY_BUFFER:yj,kStatusCode:t6,kWebSocket:n6}=Br(),{concat:Lw,toArrayBuffer:r6,unmask:o6}=$c(),{isValidStatusCode:a6,isValidUTF8:vj}=ti(),vp=Buffer[Symbol.species],Rn=0,kj=1,bj=2,Sj=3,Nw=4,Uw=5,kp=6,Fw=class extends ZG{static{a(this,"Receiver")}constructor(t={}){super(),this._allowSynchronousEvents=t.allowSynchronousEvents!==void 0?t.allowSynchronousEvents:!0,this._binaryType=t.binaryType||e6[0],this._extensions=t.extensions||{},this._isServer=!!t.isServer,this._maxBufferedChunks=t.maxBufferedChunks|0,this._maxFragments=t.maxFragments|0,this._maxPayload=t.maxPayload|0,this._skipUTF8Validation=!!t.skipUTF8Validation,this[n6]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._numFragments=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=Rn}_write(t,n,r){if(this._opcode===8&&this._state==Rn)return r();if(this._maxBufferedChunks>0&&this._buffers.length>=this._maxBufferedChunks){r(this.createError(RangeError,"Too many buffered chunks",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS"));return}this._bufferedBytes+=t.length,this._buffers.push(t),this.startLoop(r)}consume(t){if(this._bufferedBytes-=t,t===this._buffers[0].length)return this._buffers.shift();if(t<this._buffers[0].length){let r=this._buffers[0];return this._buffers[0]=new vp(r.buffer,r.byteOffset+t,r.length-t),new vp(r.buffer,r.byteOffset,t)}let n=Buffer.allocUnsafe(t);do{let r=this._buffers[0],o=n.length-t;t>=r.length?n.set(this._buffers.shift(),o):(n.set(new Uint8Array(r.buffer,r.byteOffset,t),o),this._buffers[0]=new vp(r.buffer,r.byteOffset+t,r.length-t)),t-=r.length}while(t>0);return n}startLoop(t){this._loop=!0;do switch(this._state){case Rn:this.getInfo(t);break;case kj:this.getPayloadLength16(t);break;case bj:this.getPayloadLength64(t);break;case Sj:this.getMask();break;case Nw:this.getData(t);break;case Uw:case kp:this._loop=!1;return}while(this._loop);this._errored||t()}getInfo(t){if(this._bufferedBytes<2){this._loop=!1;return}let n=this.consume(2);if((n[0]&48)!==0){let o=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");t(o);return}let r=(n[0]&64)===64;if(r&&!this._extensions[wj.extensionName]){let o=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(o);return}if(this._fin=(n[0]&128)===128,this._opcode=n[0]&15,this._payloadLength=n[1]&127,this._opcode===0){if(r){let o=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(o);return}if(!this._fragmented){let o=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");t(o);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let o=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(o);return}this._compressed=r}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let o=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");t(o);return}if(r){let o=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(o);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let o=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");t(o);return}}else{let o=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(o);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(n[1]&128)===128,this._isServer){if(!this._masked){let o=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");t(o);return}}else if(this._masked){let o=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");t(o);return}this._payloadLength===126?this._state=kj:this._payloadLength===127?this._state=bj:this.haveLength(t)}getPayloadLength16(t){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(t)}getPayloadLength64(t){if(this._bufferedBytes<8){this._loop=!1;return}let n=this.consume(8),r=n.readUInt32BE(0);if(r>Math.pow(2,21)-1){let o=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");t(o);return}this._payloadLength=r*Math.pow(2,32)+n.readUInt32BE(4),this.haveLength(t)}haveLength(t){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let n=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");t(n);return}this._masked?this._state=Sj:this._state=Nw}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=Nw}getData(t){let n=yj;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}n=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&o6(n,this._mask)}if(this._opcode>7){this.controlMessage(n,t);return}if(this._maxFragments>0&&++this._numFragments>this._maxFragments){let r=this.createError(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS");t(r);return}if(this._compressed){this._state=Uw,this.decompress(n,t);return}n.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(n)),this.dataMessage(t)}decompress(t,n){this._extensions[wj.extensionName].decompress(t,this._fin,(o,s)=>{if(o)return n(o);if(s.length){if(this._messageLength+=s.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let i=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");n(i);return}this._fragments.push(s)}this.dataMessage(n),this._state===Rn&&this.startLoop(n)})}dataMessage(t){if(!this._fin){this._state=Rn;return}let n=this._messageLength,r=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._numFragments=0,this._fragments=[],this._opcode===2){let o;this._binaryType==="nodebuffer"?o=Lw(r,n):this._binaryType==="arraybuffer"?o=r6(Lw(r,n)):this._binaryType==="blob"?o=new Blob(r):o=r,this._allowSynchronousEvents?(this.emit("message",o,!0),this._state=Rn):(this._state=kp,setImmediate(()=>{this.emit("message",o,!0),this._state=Rn,this.startLoop(t)}))}else{let o=Lw(r,n);if(!this._skipUTF8Validation&&!vj(o)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(s);return}this._state===Uw||this._allowSynchronousEvents?(this.emit("message",o,!1),this._state=Rn):(this._state=kp,setImmediate(()=>{this.emit("message",o,!1),this._state=Rn,this.startLoop(t)}))}}controlMessage(t,n){if(this._opcode===8){if(t.length===0)this._loop=!1,this.emit("conclude",1005,yj),this.end();else{let r=t.readUInt16BE(0);if(!a6(r)){let s=this.createError(RangeError,`invalid status code ${r}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");n(s);return}let o=new vp(t.buffer,t.byteOffset+2,t.length-2);if(!this._skipUTF8Validation&&!vj(o)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");n(s);return}this._loop=!1,this.emit("conclude",r,o),this.end()}this._state=Rn;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",t),this._state=Rn):(this._state=kp,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",t),this._state=Rn,this.startLoop(n)}))}createError(t,n,r,o,s){this._loop=!1,this._errored=!0;let i=new t(r?`Invalid WebSocket frame: ${n}`:n);return Error.captureStackTrace(i,this.createError),i.code=s,i[t6]=o,i}};Ij.exports=Fw});var Vw=Te((fme,_j)=>{"use strict";var{Duplex:mme}=Pe("stream"),{randomFillSync:s6}=Pe("crypto"),{types:{isUint8Array:i6}}=Pe("util"),Rj=ei(),{EMPTY_BUFFER:c6,kWebSocket:d6,NOOP:l6}=Br(),{isBlob:ni,isValidStatusCode:u6}=ti(),{mask:Pj,toBuffer:ca}=$c(),Pn=Symbol("kByteLength"),p6=Buffer.alloc(4),bp=8*1024,da,ri=bp,Nn=0,m6=1,f6=2,zw=class e{static{a(this,"Sender")}constructor(t,n,r){this._extensions=n||{},r&&(this._generateMask=r,this._maskBuffer=Buffer.alloc(4)),this._socket=t,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=Nn,this.onerror=l6,this[d6]=void 0}static frame(t,n){let r,o=!1,s=2,i=!1;n.mask&&(r=n.maskBuffer||p6,n.generateMask?n.generateMask(r):(ri===bp&&(da===void 0&&(da=Buffer.alloc(bp)),s6(da,0,bp),ri=0),r[0]=da[ri++],r[1]=da[ri++],r[2]=da[ri++],r[3]=da[ri++]),i=(r[0]|r[1]|r[2]|r[3])===0,s=6);let c;typeof t=="string"?(!n.mask||i)&&n[Pn]!==void 0?c=n[Pn]:(t=Buffer.from(t),c=t.length):(c=t.length,o=n.mask&&n.readOnly&&!i);let d=c;c>=65536?(s+=8,d=127):c>125&&(s+=2,d=126);let l=Buffer.allocUnsafe(o?c+s:s);return l[0]=n.fin?n.opcode|128:n.opcode,n.rsv1&&(l[0]|=64),l[1]=d,d===126?l.writeUInt16BE(c,2):d===127&&(l[2]=l[3]=0,l.writeUIntBE(c,4,6)),n.mask?(l[1]|=128,l[s-4]=r[0],l[s-3]=r[1],l[s-2]=r[2],l[s-1]=r[3],i?[l,t]:o?(Pj(t,r,l,s,c),[l]):(Pj(t,r,t,0,c),[l,t])):[l,t]}close(t,n,r,o){let s;if(t===void 0)s=c6;else{if(typeof t!="number"||!u6(t))throw new TypeError("First argument must be a valid error code number");if(n===void 0||!n.length)s=Buffer.allocUnsafe(2),s.writeUInt16BE(t,0);else{let c=Buffer.byteLength(n);if(c>123)throw new RangeError("The message must not be greater than 123 bytes");if(s=Buffer.allocUnsafe(2+c),s.writeUInt16BE(t,0),typeof n=="string")s.write(n,2);else if(i6(n))s.set(n,2);else throw new TypeError("Second argument must be a string or a Uint8Array")}}let i={[Pn]:s.length,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==Nn?this.enqueue([this.dispatch,s,!1,i,o]):this.sendFrame(e.frame(s,i),o)}ping(t,n,r){let o,s;if(typeof t=="string"?(o=Buffer.byteLength(t),s=!1):ni(t)?(o=t.size,s=!1):(t=ca(t),o=t.length,s=ca.readOnly),o>125)throw new RangeError("The data size must not be greater than 125 bytes");let i={[Pn]:o,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:9,readOnly:s,rsv1:!1};ni(t)?this._state!==Nn?this.enqueue([this.getBlobData,t,!1,i,r]):this.getBlobData(t,!1,i,r):this._state!==Nn?this.enqueue([this.dispatch,t,!1,i,r]):this.sendFrame(e.frame(t,i),r)}pong(t,n,r){let o,s;if(typeof t=="string"?(o=Buffer.byteLength(t),s=!1):ni(t)?(o=t.size,s=!1):(t=ca(t),o=t.length,s=ca.readOnly),o>125)throw new RangeError("The data size must not be greater than 125 bytes");let i={[Pn]:o,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:10,readOnly:s,rsv1:!1};ni(t)?this._state!==Nn?this.enqueue([this.getBlobData,t,!1,i,r]):this.getBlobData(t,!1,i,r):this._state!==Nn?this.enqueue([this.dispatch,t,!1,i,r]):this.sendFrame(e.frame(t,i),r)}send(t,n,r){let o=this._extensions[Rj.extensionName],s=n.binary?2:1,i=n.compress,c,d;typeof t=="string"?(c=Buffer.byteLength(t),d=!1):ni(t)?(c=t.size,d=!1):(t=ca(t),c=t.length,d=ca.readOnly),this._firstFragment?(this._firstFragment=!1,i&&o&&o.params[o._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(i=c>=o._threshold),this._compress=i):(i=!1,s=0),n.fin&&(this._firstFragment=!0);let l={[Pn]:c,fin:n.fin,generateMask:this._generateMask,mask:n.mask,maskBuffer:this._maskBuffer,opcode:s,readOnly:d,rsv1:i};ni(t)?this._state!==Nn?this.enqueue([this.getBlobData,t,this._compress,l,r]):this.getBlobData(t,this._compress,l,r):this._state!==Nn?this.enqueue([this.dispatch,t,this._compress,l,r]):this.dispatch(t,this._compress,l,r)}getBlobData(t,n,r,o){this._bufferedBytes+=r[Pn],this._state=f6,t.arrayBuffer().then(s=>{if(this._socket.destroyed){let c=new Error("The socket was closed while the blob was being read");process.nextTick(Ww,this,c,o);return}this._bufferedBytes-=r[Pn];let i=ca(s);n?this.dispatch(i,n,r,o):(this._state=Nn,this.sendFrame(e.frame(i,r),o),this.dequeue())}).catch(s=>{process.nextTick(g6,this,s,o)})}dispatch(t,n,r,o){if(!n){this.sendFrame(e.frame(t,r),o);return}let s=this._extensions[Rj.extensionName];this._bufferedBytes+=r[Pn],this._state=m6,s.compress(t,r.fin,(i,c)=>{if(this._socket.destroyed){let d=new Error("The socket was closed while data was being compressed");Ww(this,d,o);return}this._bufferedBytes-=r[Pn],this._state=Nn,r.readOnly=!1,this.sendFrame(e.frame(c,r),o),this.dequeue()})}dequeue(){for(;this._state===Nn&&this._queue.length;){let t=this._queue.shift();this._bufferedBytes-=t[3][Pn],Reflect.apply(t[0],this,t.slice(1))}}enqueue(t){this._bufferedBytes+=t[3][Pn],this._queue.push(t)}sendFrame(t,n){t.length===2?(this._socket.cork(),this._socket.write(t[0]),this._socket.write(t[1],n),this._socket.uncork()):this._socket.write(t[0],n)}};_j.exports=zw;function Ww(e,t,n){typeof n=="function"&&n(t);for(let r=0;r<e._queue.length;r++){let o=e._queue[r],s=o[o.length-1];typeof s=="function"&&s(t)}}a(Ww,"callCallbacks");function g6(e,t,n){Ww(e,t,n),e.onerror(t)}a(g6,"onError")});var Oj=Te((hme,Hj)=>{"use strict";var{kForOnEventAttribute:Nc,kListener:Jw}=Br(),xj=Symbol("kCode"),Tj=Symbol("kData"),Aj=Symbol("kError"),Cj=Symbol("kMessage"),Ej=Symbol("kReason"),oi=Symbol("kTarget"),Mj=Symbol("kType"),jj=Symbol("kWasClean"),Lr=class{static{a(this,"Event")}constructor(t){this[oi]=null,this[Mj]=t}get target(){return this[oi]}get type(){return this[Mj]}};Object.defineProperty(Lr.prototype,"target",{enumerable:!0});Object.defineProperty(Lr.prototype,"type",{enumerable:!0});var la=class extends Lr{static{a(this,"CloseEvent")}constructor(t,n={}){super(t),this[xj]=n.code===void 0?0:n.code,this[Ej]=n.reason===void 0?"":n.reason,this[jj]=n.wasClean===void 0?!1:n.wasClean}get code(){return this[xj]}get reason(){return this[Ej]}get wasClean(){return this[jj]}};Object.defineProperty(la.prototype,"code",{enumerable:!0});Object.defineProperty(la.prototype,"reason",{enumerable:!0});Object.defineProperty(la.prototype,"wasClean",{enumerable:!0});var ai=class extends Lr{static{a(this,"ErrorEvent")}constructor(t,n={}){super(t),this[Aj]=n.error===void 0?null:n.error,this[Cj]=n.message===void 0?"":n.message}get error(){return this[Aj]}get message(){return this[Cj]}};Object.defineProperty(ai.prototype,"error",{enumerable:!0});Object.defineProperty(ai.prototype,"message",{enumerable:!0});var Uc=class extends Lr{static{a(this,"MessageEvent")}constructor(t,n={}){super(t),this[Tj]=n.data===void 0?null:n.data}get data(){return this[Tj]}};Object.defineProperty(Uc.prototype,"data",{enumerable:!0});var h6={addEventListener(e,t,n={}){for(let o of this.listeners(e))if(!n[Nc]&&o[Jw]===t&&!o[Nc])return;let r;if(e==="message")r=a(function(s,i){let c=new Uc("message",{data:i?s:s.toString()});c[oi]=this,Sp(t,this,c)},"onMessage");else if(e==="close")r=a(function(s,i){let c=new la("close",{code:s,reason:i.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});c[oi]=this,Sp(t,this,c)},"onClose");else if(e==="error")r=a(function(s){let i=new ai("error",{error:s,message:s.message});i[oi]=this,Sp(t,this,i)},"onError");else if(e==="open")r=a(function(){let s=new Lr("open");s[oi]=this,Sp(t,this,s)},"onOpen");else return;r[Nc]=!!n[Nc],r[Jw]=t,n.once?this.once(e,r):this.on(e,r)},removeEventListener(e,t){for(let n of this.listeners(e))if(n[Jw]===t&&!n[Nc]){this.removeListener(e,n);break}}};Hj.exports={CloseEvent:la,ErrorEvent:ai,Event:Lr,EventTarget:h6,MessageEvent:Uc};function Sp(e,t,n){typeof e=="object"&&e.handleEvent?e.handleEvent.call(e,n):e.call(t,n)}a(Sp,"callListener")});var Ip=Te((yme,Dj)=>{"use strict";var{tokenChars:Fc}=ti();function mr(e,t,n){e[t]===void 0?e[t]=[n]:e[t].push(n)}a(mr,"push");function w6(e){let t=Object.create(null),n=Object.create(null),r=!1,o=!1,s=!1,i,c,d=-1,l=-1,u=-1,p=0;for(;p<e.length;p++)if(l=e.charCodeAt(p),i===void 0)if(u===-1&&Fc[l]===1)d===-1&&(d=p);else if(p!==0&&(l===32||l===9))u===-1&&d!==-1&&(u=p);else if(l===59||l===44){if(d===-1)throw new SyntaxError(`Unexpected character at index ${p}`);u===-1&&(u=p);let f=e.slice(d,u);l===44?(mr(t,f,n),n=Object.create(null)):i=f,d=u=-1}else throw new SyntaxError(`Unexpected character at index ${p}`);else if(c===void 0)if(u===-1&&Fc[l]===1)d===-1&&(d=p);else if(l===32||l===9)u===-1&&d!==-1&&(u=p);else if(l===59||l===44){if(d===-1)throw new SyntaxError(`Unexpected character at index ${p}`);u===-1&&(u=p),mr(n,e.slice(d,u),!0),l===44&&(mr(t,i,n),n=Object.create(null),i=void 0),d=u=-1}else if(l===61&&d!==-1&&u===-1)c=e.slice(d,p),d=u=-1;else throw new SyntaxError(`Unexpected character at index ${p}`);else if(o){if(Fc[l]!==1)throw new SyntaxError(`Unexpected character at index ${p}`);d===-1?d=p:r||(r=!0),o=!1}else if(s)if(Fc[l]===1)d===-1&&(d=p);else if(l===34&&d!==-1)s=!1,u=p;else if(l===92)o=!0;else throw new SyntaxError(`Unexpected character at index ${p}`);else if(l===34&&e.charCodeAt(p-1)===61)s=!0;else if(u===-1&&Fc[l]===1)d===-1&&(d=p);else if(d!==-1&&(l===32||l===9))u===-1&&(u=p);else if(l===59||l===44){if(d===-1)throw new SyntaxError(`Unexpected character at index ${p}`);u===-1&&(u=p);let f=e.slice(d,u);r&&(f=f.replace(/\\/g,""),r=!1),mr(n,c,f),l===44&&(mr(t,i,n),n=Object.create(null),i=void 0),c=void 0,d=u=-1}else throw new SyntaxError(`Unexpected character at index ${p}`);if(d===-1||s||l===32||l===9)throw new SyntaxError("Unexpected end of input");u===-1&&(u=p);let m=e.slice(d,u);return i===void 0?mr(t,m,n):(c===void 0?mr(n,m,!0):r?mr(n,c,m.replace(/\\/g,"")):mr(n,c,m),mr(t,i,n)),t}a(w6,"parse");function y6(e){return Object.keys(e).map(t=>{let n=e[t];return Array.isArray(n)||(n=[n]),n.map(r=>[t].concat(Object.keys(r).map(o=>{let s=r[o];return Array.isArray(s)||(s=[s]),s.map(i=>i===!0?o:`${o}=${i}`).join("; ")})).join("; ")).join(", ")}).join(", ")}a(y6,"format");Dj.exports={format:y6,parse:w6}});var xp=Te((Sme,Gj)=>{"use strict";var v6=Pe("events"),k6=Pe("https"),b6=Pe("http"),Lj=Pe("net"),S6=Pe("tls"),{randomBytes:I6,createHash:R6}=Pe("crypto"),{Duplex:kme,Readable:bme}=Pe("stream"),{URL:Gw}=Pe("url"),Io=ei(),P6=qw(),_6=Vw(),{isBlob:x6}=ti(),{BINARY_TYPES:Bj,CLOSE_TIMEOUT:T6,EMPTY_BUFFER:Rp,GUID:A6,kForOnEventAttribute:Kw,kListener:C6,kStatusCode:E6,kWebSocket:pt,NOOP:Nj}=Br(),{EventTarget:{addEventListener:M6,removeEventListener:j6}}=Oj(),{format:H6,parse:O6}=Ip(),{toBuffer:D6}=$c(),Uj=Symbol("kAborted"),Yw=[8,13],Nr=["CONNECTING","OPEN","CLOSING","CLOSED"],B6=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,ze=class e extends v6{static{a(this,"WebSocket")}constructor(t,n,r){super(),this._binaryType=Bj[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=Rp,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=e.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,t!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,n===void 0?n=[]:Array.isArray(n)||(typeof n=="object"&&n!==null?(r=n,n=[]):n=[n]),Fj(this,t,n,r)):(this._autoPong=r.autoPong,this._closeTimeout=r.closeTimeout,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(t){Bj.includes(t)&&(this._binaryType=t,this._receiver&&(this._receiver._binaryType=t))}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(t,n,r){let o=new P6({allowSynchronousEvents:r.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxBufferedChunks:r.maxBufferedChunks,maxFragments:r.maxFragments,maxPayload:r.maxPayload,skipUTF8Validation:r.skipUTF8Validation}),s=new _6(t,this._extensions,r.generateMask);this._receiver=o,this._sender=s,this._socket=t,o[pt]=this,s[pt]=this,t[pt]=this,o.on("conclude",N6),o.on("drain",U6),o.on("error",F6),o.on("message",q6),o.on("ping",z6),o.on("pong",W6),s.onerror=V6,t.setTimeout&&t.setTimeout(0),t.setNoDelay&&t.setNoDelay(),n.length>0&&t.unshift(n),t.on("close",Wj),t.on("data",_p),t.on("end",Vj),t.on("error",Jj),this._readyState=e.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[Io.extensionName]&&this._extensions[Io.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(t,n){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){dn(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===e.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=e.CLOSING,this._sender.close(t,n,!this._isServer,r=>{r||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),zj(this)}}pause(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!0,this._socket.pause())}ping(t,n,r){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(r=t,t=n=void 0):typeof n=="function"&&(r=n,n=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){Xw(this,t,r);return}n===void 0&&(n=!this._isServer),this._sender.ping(t||Rp,n,r)}pong(t,n,r){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(r=t,t=n=void 0):typeof n=="function"&&(r=n,n=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){Xw(this,t,r);return}n===void 0&&(n=!this._isServer),this._sender.pong(t||Rp,n,r)}resume(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(t,n,r){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof n=="function"&&(r=n,n={}),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){Xw(this,t,r);return}let o={binary:typeof t!="string",mask:!this._isServer,compress:!0,fin:!0,...n};this._extensions[Io.extensionName]||(o.compress=!1),this._sender.send(t||Rp,o,r)}terminate(){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){dn(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=e.CLOSING,this._socket.destroy())}}};Object.defineProperty(ze,"CONNECTING",{enumerable:!0,value:Nr.indexOf("CONNECTING")});Object.defineProperty(ze.prototype,"CONNECTING",{enumerable:!0,value:Nr.indexOf("CONNECTING")});Object.defineProperty(ze,"OPEN",{enumerable:!0,value:Nr.indexOf("OPEN")});Object.defineProperty(ze.prototype,"OPEN",{enumerable:!0,value:Nr.indexOf("OPEN")});Object.defineProperty(ze,"CLOSING",{enumerable:!0,value:Nr.indexOf("CLOSING")});Object.defineProperty(ze.prototype,"CLOSING",{enumerable:!0,value:Nr.indexOf("CLOSING")});Object.defineProperty(ze,"CLOSED",{enumerable:!0,value:Nr.indexOf("CLOSED")});Object.defineProperty(ze.prototype,"CLOSED",{enumerable:!0,value:Nr.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(e=>{Object.defineProperty(ze.prototype,e,{enumerable:!0})});["open","error","close","message"].forEach(e=>{Object.defineProperty(ze.prototype,`on${e}`,{enumerable:!0,get(){for(let t of this.listeners(e))if(t[Kw])return t[C6];return null},set(t){for(let n of this.listeners(e))if(n[Kw]){this.removeListener(e,n);break}typeof t=="function"&&this.addEventListener(e,t,{[Kw]:!0})}})});ze.prototype.addEventListener=M6;ze.prototype.removeEventListener=j6;Gj.exports=ze;function Fj(e,t,n,r){let o={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:T6,protocolVersion:Yw[1],maxBufferedChunks:262144,maxFragments:16384,maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...r,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(e._autoPong=o.autoPong,e._closeTimeout=o.closeTimeout,!Yw.includes(o.protocolVersion))throw new RangeError(`Unsupported protocol version: ${o.protocolVersion} (supported versions: ${Yw.join(", ")})`);let s;if(t instanceof Gw)s=t;else try{s=new Gw(t)}catch{throw new SyntaxError(`Invalid URL: ${t}`)}s.protocol==="http:"?s.protocol="ws:":s.protocol==="https:"&&(s.protocol="wss:"),e._url=s.href;let i=s.protocol==="wss:",c=s.protocol==="ws+unix:",d;if(s.protocol!=="ws:"&&!i&&!c?d=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:c&&!s.pathname?d="The URL's pathname is empty":s.hash&&(d="The URL contains a fragment identifier"),d){let h=new SyntaxError(d);if(e._redirects===0)throw h;Pp(e,h);return}let l=i?443:80,u=I6(16).toString("base64"),p=i?k6.request:b6.request,m=new Set,f;if(o.createConnection=o.createConnection||(i?L6:$6),o.defaultPort=o.defaultPort||l,o.port=s.port||l,o.host=s.hostname.startsWith("[")?s.hostname.slice(1,-1):s.hostname,o.headers={...o.headers,"Sec-WebSocket-Version":o.protocolVersion,"Sec-WebSocket-Key":u,Connection:"Upgrade",Upgrade:"websocket"},o.path=s.pathname+s.search,o.timeout=o.handshakeTimeout,o.perMessageDeflate&&(f=new Io({...o.perMessageDeflate,isServer:!1,maxPayload:o.maxPayload}),o.headers["Sec-WebSocket-Extensions"]=H6({[Io.extensionName]:f.offer()})),n.length){for(let h of n){if(typeof h!="string"||!B6.test(h)||m.has(h))throw new SyntaxError("An invalid or duplicated subprotocol was specified");m.add(h)}o.headers["Sec-WebSocket-Protocol"]=n.join(",")}if(o.origin&&(o.protocolVersion<13?o.headers["Sec-WebSocket-Origin"]=o.origin:o.headers.Origin=o.origin),(s.username||s.password)&&(o.auth=`${s.username}:${s.password}`),c){let h=o.path.split(":");o.socketPath=h[0],o.path=h[1]}let y;if(o.followRedirects){if(e._redirects===0){e._originalIpc=c,e._originalSecure=i,e._originalHostOrSocketPath=c?o.socketPath:s.host;let h=r&&r.headers;if(r={...r,headers:{}},h)for(let[v,g]of Object.entries(h))r.headers[v.toLowerCase()]=g}else if(e.listenerCount("redirect")===0){let h=c?e._originalIpc?o.socketPath===e._originalHostOrSocketPath:!1:e._originalIpc?!1:s.host===e._originalHostOrSocketPath;(!h||e._originalSecure&&!i)&&(delete o.headers.authorization,delete o.headers.cookie,h||delete o.headers.host,o.auth=void 0)}o.auth&&!r.headers.authorization&&(r.headers.authorization="Basic "+Buffer.from(o.auth).toString("base64")),y=e._req=p(o),e._redirects&&e.emit("redirect",e.url,y)}else y=e._req=p(o);o.timeout&&y.on("timeout",()=>{dn(e,y,"Opening handshake has timed out")}),y.on("error",h=>{y===null||y[Uj]||(y=e._req=null,Pp(e,h))}),y.on("response",h=>{let v=h.headers.location,g=h.statusCode;if(v&&o.followRedirects&&g>=300&&g<400){if(++e._redirects>o.maxRedirects){dn(e,y,"Maximum redirects exceeded");return}y.abort();let I;try{I=new Gw(v,t)}catch{let k=new SyntaxError(`Invalid URL: ${v}`);Pp(e,k);return}Fj(e,I,n,r)}else e.emit("unexpected-response",y,h)||dn(e,y,`Unexpected server response: ${h.statusCode}`)}),y.on("upgrade",(h,v,g)=>{if(e.emit("upgrade",h),e.readyState!==ze.CONNECTING)return;y=e._req=null;let I=h.headers.upgrade;if(I===void 0||I.toLowerCase()!=="websocket"){dn(e,v,"Invalid Upgrade header");return}let R=R6("sha1").update(u+A6).digest("base64");if(h.headers["sec-websocket-accept"]!==R){dn(e,v,"Invalid Sec-WebSocket-Accept header");return}let k=h.headers["sec-websocket-protocol"],w;if(k!==void 0?m.size?m.has(k)||(w="Server sent an invalid subprotocol"):w="Server sent a subprotocol but none was requested":m.size&&(w="Server sent no subprotocol"),w){dn(e,v,w);return}k&&(e._protocol=k);let T=h.headers["sec-websocket-extensions"];if(T!==void 0){if(!f){dn(e,v,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let C;try{C=O6(T)}catch{dn(e,v,"Invalid Sec-WebSocket-Extensions header");return}let b=Object.keys(C);if(b.length!==1||b[0]!==Io.extensionName){dn(e,v,"Server indicated an extension that was not requested");return}try{f.accept(C[Io.extensionName])}catch{dn(e,v,"Invalid Sec-WebSocket-Extensions header");return}e._extensions[Io.extensionName]=f}e.setSocket(v,g,{allowSynchronousEvents:o.allowSynchronousEvents,generateMask:o.generateMask,maxBufferedChunks:o.maxBufferedChunks,maxFragments:o.maxFragments,maxPayload:o.maxPayload,skipUTF8Validation:o.skipUTF8Validation})}),o.finishRequest?o.finishRequest(y,e):y.end()}a(Fj,"initAsClient");function Pp(e,t){e._readyState=ze.CLOSING,e._errorEmitted=!0,e.emit("error",t),e.emitClose()}a(Pp,"emitErrorAndClose");function $6(e){return e.path=e.socketPath,Lj.connect(e)}a($6,"netConnect");function L6(e){return e.path=void 0,!e.servername&&e.servername!==""&&(e.servername=Lj.isIP(e.host)?"":e.host),S6.connect(e)}a(L6,"tlsConnect");function dn(e,t,n){e._readyState=ze.CLOSING;let r=new Error(n);Error.captureStackTrace(r,dn),t.setHeader?(t[Uj]=!0,t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),process.nextTick(Pp,e,r)):(t.destroy(r),t.once("error",e.emit.bind(e,"error")),t.once("close",e.emitClose.bind(e)))}a(dn,"abortHandshake");function Xw(e,t,n){if(t){let r=x6(t)?t.size:D6(t).length;e._socket?e._sender._bufferedBytes+=r:e._bufferedAmount+=r}if(n){let r=new Error(`WebSocket is not open: readyState ${e.readyState} (${Nr[e.readyState]})`);process.nextTick(n,r)}}a(Xw,"sendAfterClose");function N6(e,t){let n=this[pt];n._closeFrameReceived=!0,n._closeMessage=t,n._closeCode=e,n._socket[pt]!==void 0&&(n._socket.removeListener("data",_p),process.nextTick(qj,n._socket),e===1005?n.close():n.close(e,t))}a(N6,"receiverOnConclude");function U6(){let e=this[pt];e.isPaused||e._socket.resume()}a(U6,"receiverOnDrain");function F6(e){let t=this[pt];t._socket[pt]!==void 0&&(t._socket.removeListener("data",_p),process.nextTick(qj,t._socket),t.close(e[E6])),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e))}a(F6,"receiverOnError");function $j(){this[pt].emitClose()}a($j,"receiverOnFinish");function q6(e,t){this[pt].emit("message",e,t)}a(q6,"receiverOnMessage");function z6(e){let t=this[pt];t._autoPong&&t.pong(e,!this._isServer,Nj),t.emit("ping",e)}a(z6,"receiverOnPing");function W6(e){this[pt].emit("pong",e)}a(W6,"receiverOnPong");function qj(e){e.resume()}a(qj,"resume");function V6(e){let t=this[pt];t.readyState!==ze.CLOSED&&(t.readyState===ze.OPEN&&(t._readyState=ze.CLOSING,zj(t)),this._socket.end(),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e)))}a(V6,"senderOnError");function zj(e){e._closeTimer=setTimeout(e._socket.destroy.bind(e._socket),e._closeTimeout)}a(zj,"setCloseTimer");function Wj(){let e=this[pt];if(this.removeListener("close",Wj),this.removeListener("data",_p),this.removeListener("end",Vj),e._readyState=ze.CLOSING,!this._readableState.endEmitted&&!e._closeFrameReceived&&!e._receiver._writableState.errorEmitted&&this._readableState.length!==0){let t=this.read(this._readableState.length);e._receiver.write(t)}e._receiver.end(),this[pt]=void 0,clearTimeout(e._closeTimer),e._receiver._writableState.finished||e._receiver._writableState.errorEmitted?e.emitClose():(e._receiver.on("error",$j),e._receiver.on("finish",$j))}a(Wj,"socketOnClose");function _p(e){this[pt]._receiver.write(e)||this.pause()}a(_p,"socketOnData");function Vj(){let e=this[pt];e._readyState=ze.CLOSING,e._receiver.end(),this.end()}a(Vj,"socketOnEnd");function Jj(){let e=this[pt];this.removeListener("error",Jj),this.on("error",Nj),e&&(e._readyState=ze.CLOSING,this.destroy())}a(Jj,"socketOnError")});var Qj=Te((Pme,Xj)=>{"use strict";var Rme=xp(),{Duplex:J6}=Pe("stream");function Kj(e){e.emit("close")}a(Kj,"emitClose");function G6(){!this.destroyed&&this._writableState.finished&&this.destroy()}a(G6,"duplexOnEnd");function Yj(e){this.removeListener("error",Yj),this.destroy(),this.listenerCount("error")===0&&this.emit("error",e)}a(Yj,"duplexOnError");function K6(e,t){let n=!0,r=new J6({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return e.on("message",a(function(s,i){let c=!i&&r._readableState.objectMode?s.toString():s;r.push(c)||e.pause()},"message")),e.once("error",a(function(s){r.destroyed||(n=!1,r.destroy(s))},"error")),e.once("close",a(function(){r.destroyed||r.push(null)},"close")),r._destroy=function(o,s){if(e.readyState===e.CLOSED){s(o),process.nextTick(Kj,r);return}let i=!1;e.once("error",a(function(d){i=!0,s(d)},"error")),e.once("close",a(function(){i||s(o),process.nextTick(Kj,r)},"close")),n&&e.terminate()},r._final=function(o){if(e.readyState===e.CONNECTING){e.once("open",a(function(){r._final(o)},"open"));return}e._socket!==null&&(e._socket._writableState.finished?(o(),r._readableState.endEmitted&&r.destroy()):(e._socket.once("finish",a(function(){o()},"finish")),e.close()))},r._read=function(){e.isPaused&&e.resume()},r._write=function(o,s,i){if(e.readyState===e.CONNECTING){e.once("open",a(function(){r._write(o,s,i)},"open"));return}e.send(o,i)},r.on("end",G6),r.on("error",Yj),r}a(K6,"createWebSocketStream");Xj.exports=K6});var Qw=Te((xme,Zj)=>{"use strict";var{tokenChars:Y6}=ti();function X6(e){let t=new Set,n=-1,r=-1,o=0;for(o;o<e.length;o++){let i=e.charCodeAt(o);if(r===-1&&Y6[i]===1)n===-1&&(n=o);else if(o!==0&&(i===32||i===9))r===-1&&n!==-1&&(r=o);else if(i===44){if(n===-1)throw new SyntaxError(`Unexpected character at index ${o}`);r===-1&&(r=o);let c=e.slice(n,r);if(t.has(c))throw new SyntaxError(`The "${c}" subprotocol is duplicated`);t.add(c),n=r=-1}else throw new SyntaxError(`Unexpected character at index ${o}`)}if(n===-1||r!==-1)throw new SyntaxError("Unexpected end of input");let s=e.slice(n,o);if(t.has(s))throw new SyntaxError(`The "${s}" subprotocol is duplicated`);return t.add(s),t}a(X6,"parse");Zj.exports={parse:X6}});var sH=Te((Cme,aH)=>{"use strict";var Q6=Pe("events"),Tp=Pe("http"),{Duplex:Ame}=Pe("stream"),{createHash:Z6}=Pe("crypto"),eH=Ip(),ua=ei(),e5=Qw(),t5=xp(),{CLOSE_TIMEOUT:n5,GUID:r5,kWebSocket:o5}=Br(),a5=/^[+/0-9A-Za-z]{22}==$/,tH=0,nH=1,oH=2,Zw=class extends Q6{static{a(this,"WebSocketServer")}constructor(t,n){if(super(),t={allowSynchronousEvents:!0,autoPong:!0,maxBufferedChunks:256*1024,maxFragments:16*1024,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:n5,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:t5,...t},t.port==null&&!t.server&&!t.noServer||t.port!=null&&(t.server||t.noServer)||t.server&&t.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(t.port!=null?(this._server=Tp.createServer((r,o)=>{let s=Tp.STATUS_CODES[426];o.writeHead(426,{"Content-Length":s.length,"Content-Type":"text/plain"}),o.end(s)}),this._server.listen(t.port,t.host,t.backlog,n)):t.server&&(this._server=t.server),this._server){let r=this.emit.bind(this,"connection");this._removeListeners=s5(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:a((o,s,i)=>{this.handleUpgrade(o,s,i,r)},"upgrade")})}t.perMessageDeflate===!0&&(t.perMessageDeflate={}),t.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=t,this._state=tH}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(t){if(this._state===oH){t&&this.once("close",()=>{t(new Error("The server is not running"))}),process.nextTick(qc,this);return}if(t&&this.once("close",t),this._state!==nH)if(this._state=nH,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(qc,this):process.nextTick(qc,this);else{let n=this._server;this._removeListeners(),this._removeListeners=this._server=null,n.close(()=>{qc(this)})}}shouldHandle(t){if(this.options.path){let n=t.url.indexOf("?");if((n!==-1?t.url.slice(0,n):t.url)!==this.options.path)return!1}return!0}handleUpgrade(t,n,r,o){n.on("error",rH);let s=t.headers["sec-websocket-key"],i=t.headers.upgrade,c=+t.headers["sec-websocket-version"];if(t.method!=="GET"){pa(this,t,n,405,"Invalid HTTP method");return}if(i===void 0||i.toLowerCase()!=="websocket"){pa(this,t,n,400,"Invalid Upgrade header");return}if(s===void 0||!a5.test(s)){pa(this,t,n,400,"Missing or invalid Sec-WebSocket-Key header");return}if(c!==13&&c!==8){pa(this,t,n,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(t)){zc(n,400);return}let d=t.headers["sec-websocket-protocol"],l=new Set;if(d!==void 0)try{l=e5.parse(d)}catch{pa(this,t,n,400,"Invalid Sec-WebSocket-Protocol header");return}let u=t.headers["sec-websocket-extensions"],p={};if(this.options.perMessageDeflate&&u!==void 0){let m=new ua({...this.options.perMessageDeflate,isServer:!0,maxPayload:this.options.maxPayload});try{let f=eH.parse(u);f[ua.extensionName]&&(m.accept(f[ua.extensionName]),p[ua.extensionName]=m)}catch{pa(this,t,n,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let m={origin:t.headers[`${c===8?"sec-websocket-origin":"origin"}`],secure:!!(t.socket.authorized||t.socket.encrypted),req:t};if(this.options.verifyClient.length===2){this.options.verifyClient(m,(f,y,h,v)=>{if(!f)return zc(n,y||401,h,v);this.completeUpgrade(p,s,l,t,n,r,o)});return}if(!this.options.verifyClient(m))return zc(n,401)}this.completeUpgrade(p,s,l,t,n,r,o)}completeUpgrade(t,n,r,o,s,i,c){if(!s.readable||!s.writable)return s.destroy();if(s[o5])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>tH)return zc(s,503);let l=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${Z6("sha1").update(n+r5).digest("base64")}`],u=new this.options.WebSocket(null,void 0,this.options);if(r.size){let p=this.options.handleProtocols?this.options.handleProtocols(r,o):r.values().next().value;p&&(l.push(`Sec-WebSocket-Protocol: ${p}`),u._protocol=p)}if(t[ua.extensionName]){let p=t[ua.extensionName].params,m=eH.format({[ua.extensionName]:[p]});l.push(`Sec-WebSocket-Extensions: ${m}`),u._extensions=t}this.emit("headers",l,o),s.write(l.concat(`\r
|
|
3
|
+
import{a as zA,b as WA,c as VA,d as j,e as JA,f as co,g as z,h as Iu,j as GA}from"./chunk-OYJ73BSC.js";import{$ as zx,$a as jT,$b as yA,A as iu,Aa as dT,Ab as eA,Ac as BA,B as lx,Ba as pe,Bb as tA,Bc as $A,C as ux,Ca as lT,Cb as nA,Cc as LA,D as px,Da as uT,Db as yu,Dc as NA,E as cu,Ea as pT,Eb as rA,Ec as UA,F as mx,Fa as mT,Fb as Zo,Fc as FA,G as fx,Ga as fT,Gb as vu,H as gx,Ha as gT,Hb as oA,Hc as qA,I as hx,Ia as hT,Ib as so,J as wx,Ja as wT,Jb as ku,K as pc,Ka as yT,Kb as aA,L as Ex,La as vT,Lb as sA,M as Mx,Ma as kT,Mb as oh,N as jx,Na as Ss,Nb as ah,O as Hx,Oa as On,Ob as iA,P as Ox,Pa as He,Pb as cA,Q as mc,Qa as bT,Qb as dA,R as Dx,Ra as ST,Rb as lA,S as Bx,Sa as IT,Sb as sh,T as vs,Ta as RT,Tb as uA,U as ks,Ua as xT,Ub as ih,V as $x,Va as TT,Vb as pA,W as Lx,Wa as hu,Wb as mA,X as Nx,Xa as AT,Xb as fA,Y as Ux,Ya as CT,Yb as gA,Z as Fx,Za as ET,Zb as hA,_ as qx,_a as MT,_b as wA,a as kg,aa as oo,ab as rh,ac as vA,b as CS,ba as Wx,bb as HT,bc as kA,c as ES,ca as Vx,cb as OT,cc as bA,d as MS,da as th,db as DT,dc as ch,e as jS,ea as Jx,eb as BT,ec as SA,f as HS,fa as Gx,fb as $T,fc as dh,g as OS,ga as Kx,gb as LT,gc as IA,h as qo,ha as bs,hb as NT,hc as RA,i as DS,ia as Yx,ib as Dn,ic as PA,j as BS,ja as Xx,jb as UT,jc as _A,k as hl,ka as Qx,kb as wu,kc as xA,l as $S,la as Zx,lb as FT,lc as io,m as LS,ma as ae,mb as qT,mc as xr,n as W2,na as eT,nb as Nt,nc as lh,o as L_,oa as tT,ob as Qo,oc as TA,p as N_,pa as nT,pb as zT,pc as AA,q as U_,qa as pu,qb as _r,qc as bu,r as F_,ra as rT,rb as WT,rc as Is,s as G_,sa as oT,sb as VT,sc as CA,t as au,ta as aT,tb as JT,tc as Su,u as ax,ua as sT,ub as GT,uc as EA,v as sx,va as iT,vb as KT,vc as MA,w as ix,wa as mu,wb as YT,wc as jA,x as su,xa as cT,xb as XT,xc as HA,y as cx,ya as ao,yb as QT,yc as OA,z as dx,za as Ae,zb as ZT,zc as DA}from"./chunk-VL553I5E.js";import{A as Rx,C as lu,F as uu,G as cr,H as Px,I as Xg,J as _x,K as Qg,N as xx,O as Zg,P as Tx,Q as Ax,R as Cx,S as eh,T as ys,b as du,d as yx,e as vx,h as kx,m as ws,n as bx,p as Sx,q as Ix,s as uc}from"./chunk-BRJKTOMI.js";import{A as V_,B as tu,C as nu,D as hs,H as J_,J as nh,K as PT,L as fu,M as gu,N as _T,a as ct,b as q_,c as z_,f as W_}from"./chunk-XR6ZLKVW.js";import{$ as Yg,A as A_,P as Zl,S as C_,V as E_,W as M_,X as gs,Y as eu,Z as lc,a as pS,aa as Xo,b as mS,ba as j_,c as fS,ca as H_,da as O_,e as gS,ea as D_,f as hS,g as ml,h as IS,ha as B_,i as RS,j as PS,k as _S,l as xS,ma as $_,t as I_,u as R_,v as P_,w as __,x as x_,y as T_,z as Ql}from"./chunk-JLWAK5PS.js";import{a as b_,b as Xl,d as ie,e as it,f as fs,g as ne,i as S_}from"./chunk-PMXE4CAA.js";import{a as on,b as K_,c as Y_,d as ru,e as ou,g as X_,h as Q_,j as Z_,k as ex,l as tx,m as nx,n as rx,o as ox}from"./chunk-SRQVXHSM.js";import{$ as hR,$a as LR,$b as yP,$c as GP,$d as dc,A as aR,Aa as Hg,Ac as sc,B as Al,Bb as $g,Bc as zg,C as sR,Ca as qe,Cb as oc,D as Eg,Da as jl,E as iR,Ea as _R,Eb as oP,Ec as Ul,Ed as Ko,F as cR,Fa as Og,Fd as r_,G as tt,Gc as Wg,Gd as Pr,H as dR,Ha as xR,Hb as aP,Hc as $P,Hd as o_,I as yt,Ib as sP,Ic as LP,Id as a_,J as rc,Jb as iP,Jd as s_,K as lR,Kd as no,L as uR,La as TR,Lb as cs,Lc as Fl,Ld as ps,Mb as cP,Mc as NP,Md as Vl,N as pR,Na as Hl,Nc as Vg,Nd as i_,Oa as AR,Ob as ac,Oc as sr,Od as c_,P as mR,Pb as Ll,Pc as UP,Pd as d_,Q as fR,Qa as CR,Qb as dP,Qc as FP,Qd as cc,R as Hn,Ra as ER,Rb as Lg,Rc as Jg,Rd as ms,Sa as MR,Sb as lP,Sc as ic,Sd as Jl,Ta as jR,Tb as uP,Tc as qP,Td as l_,Ua as HR,Ub as Ng,Uc as ql,Ud as Gl,Va as OR,Vb as pP,Vc as zP,Vd as ro,Wa as DR,Wb as mP,Wc as WP,Wd as u_,X as gR,Xa as BR,Xb as fP,Xc as ds,Xd as p_,Ya as $R,Yb as gP,Yc as VP,Yd as m_,Z as Cl,Za as to,Zb as hP,Zc as ls,Zd as Kl,_b as wP,_c as JP,_d as f_,ab as NR,ac as Ug,ad as Gg,ae as g_,bb as UR,bc as vP,bd as zl,be as h_,c as VI,ca as Mg,cb as FR,cc as kP,cd as KP,da as wR,dc as bP,dd as Be,ea as Lt,eb as qR,ec as SP,ed as Wl,fa as Vo,fb as Ol,fc as Fg,fd as YP,ga as Jo,gb as zR,gc as IP,gd as XP,ha as jg,hb as WR,hc as RP,hd as QP,ia as yR,ib as VR,ic as PP,id as Kg,ja as vR,jb as JR,jc as _P,jd as ZP,ka as kR,kb as GR,kc as xP,kd as e_,ke as Yl,l as JI,la as bR,lb as KR,lc as TP,ld as t_,le as w_,m as GI,ma as SR,mb as YR,mc as AP,me as y_,n as KI,na as IR,nb as XR,nc as CP,nd as us,ne as ir,oa as El,ob as QR,oc as EP,od as n_,oe as v_,pb as ZR,pc as MP,pe as Yo,q as YI,qa as Ml,qb as eP,qc as qg,qe as k_,r as XI,rb as tP,rc as Go,s as QI,sb as nP,sc as jP,t as ZI,tb as Dg,tc as HP,u as eR,ub as Dl,uc as OP,v as Cg,vb as rP,w as tR,wb as ar,wc as Nl,x as nR,xa as RR,xb as Bl,xc as DP,y as rR,yb as Bg,z as oR,za as PR,zb as $l,zc as BP}from"./chunk-77BXXOHW.js";import{a as uI,h as HI,k as OI}from"./chunk-TBX3Z7TX.js";import{b as wS,c as yS}from"./chunk-L3KS6MOV.js";import"./chunk-XEOEKFG6.js";import{A as tc,B as xg,C as Tl,D as LI,E as NI,I as UI,J as FI,N as is,O as nc,P as qI,Q as zI,R as WI,T as Tg,V as Ag,i as DI,t as BI,u as $I,v as wn,w as xl,z as Wo}from"./chunk-QWENRTVW.js";import"./chunk-6MI4KKWF.js";import{$ as XS,$b as jn,A as bg,Ab as fI,Ac as Rl,B as US,Bb as gI,Bc as Pl,C as FS,Cb as hI,Cc as _l,D as qS,Db as bl,Dc as TI,E as yl,Eb as Pg,Ec as _g,F as zS,Fa as nI,Fb as wI,Fc as AI,G as WS,Gb as yI,H as VS,Hb as vI,Hc as CI,I as JS,Ic as EI,Jc as MI,Kc as eo,Lc as jI,Mb as kI,Mc as or,Ob as os,Q as GS,R as KS,Ra as rI,Rb as bI,Ta as oI,Tb as SI,Ua as aI,V as YS,a as vS,ab as sI,ac as II,b as kS,bc as Sl,c as hn,cc as rn,db as iI,ea as QS,f as bS,g as pl,ga as Sg,h as SS,ha as Ee,hc as Il,ia as zo,ib as cI,ja as Qe,m as fl,mb as Rg,na as ZS,nb as dI,o as TS,pc as RI,qa as ec,qb as lI,ra as eI,rb as kl,rc as PI,sa as vl,tc as as,u as gl,ua as tI,v as AS,va as Ig,w as NS,wa as rs,x as wl,xc as ss,yb as pI,yc as _I,zb as mI,zc as xI}from"./chunk-JFSDNQHW.js";import"./chunk-SDO4FC4Q.js";import"./chunk-IR3YJWPW.js";import{D as ns,E as Qi,F as ul,d as ll,m as lS,n as Zr,o as Ve,p as uS}from"./chunk-B5LKUQGM.js";import"./chunk-MJC26GOX.js";import{$a as dl,$b as cS,Da as z2,Ea as tS,Fa as yg,Ga as vg,Ia as nS,Lb as Je,Mb as Vt,Pa as rS,S as il,Sb as iS,Ta as oS,Ua as aS,a as nn,bc as dS,hb as sS,qa as Qb,ra as cl,ta as Zb,wa as eS}from"./chunk-5BFWDFPX.js";import{a as Zi}from"./chunk-6FA3GG5B.js";import{A as Ct,B as Lo,C as Tb,D as Xi,E as Rr,F as nl,G as Ab,Ga as Qr,H as rl,I as Cb,Ia as No,J as es,L as Eb,M as Mb,N as jb,Na as Ub,O as Hb,Oa as Fb,P as Ob,Pa as zb,Qa as Wb,Ta as Vb,Va as hg,W as gg,Wa as wg,Xa as Jb,ca as Db,f as Qd,ga as Xr,ia as Bb,ib as al,jb as Gb,k as Qa,ka as $b,l as Za,la as Lb,m as mg,ma as Nb,n as Zd,nb as Kb,o as st,ob as Yb,p as fg,q as el,qb as Fo,rb as Xb,sb as sl,t as We,u as Se,v as O,w as _b,y as xb,z as tl}from"./chunk-IFP6W4OW.js";import{a as $o,b as P}from"./chunk-ES2ISFJC.js";import{a as Ib,c as Bo,f as Rb,h as Xd,i as Pb,p as ts,q as qb,r as Uo,s as ol}from"./chunk-H7IWJN7L.js";import{a,b as Pe,c as Te,e as Mn}from"./chunk-FTQLQJQV.js";var Br=Te((tme,sj)=>{"use strict";var oj=["nodebuffer","arraybuffer","fragments"],aj=typeof Blob<"u";aj&&oj.push("blob");sj.exports={BINARY_TYPES:oj,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:aj,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:a(()=>{},"NOOP")}});var $c=Te((rme,gp)=>{"use strict";var{EMPTY_BUFFER:UG}=Br(),jw=Buffer[Symbol.species];function FG(e,t){if(e.length===0)return UG;if(e.length===1)return e[0];let n=Buffer.allocUnsafe(t),r=0;for(let o=0;o<e.length;o++){let s=e[o];n.set(s,r),r+=s.length}return r<t?new jw(n.buffer,n.byteOffset,r):n}a(FG,"concat");function ij(e,t,n,r,o){for(let s=0;s<o;s++)n[r+s]=e[s]^t[s&3]}a(ij,"_mask");function cj(e,t){for(let n=0;n<e.length;n++)e[n]^=t[n&3]}a(cj,"_unmask");function qG(e){return e.length===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.length)}a(qG,"toArrayBuffer");function Hw(e){if(Hw.readOnly=!0,Buffer.isBuffer(e))return e;let t;return e instanceof ArrayBuffer?t=new jw(e):ArrayBuffer.isView(e)?t=new jw(e.buffer,e.byteOffset,e.byteLength):(t=Buffer.from(e),Hw.readOnly=!1),t}a(Hw,"toBuffer");gp.exports={concat:FG,mask:ij,toArrayBuffer:qG,toBuffer:Hw,unmask:cj};if(!process.env.WS_NO_BUFFER_UTIL)try{let e=Pe("bufferutil");gp.exports.mask=function(t,n,r,o,s){s<48?ij(t,n,r,o,s):e.mask(t,n,r,o,s)},gp.exports.unmask=function(t,n){t.length<32?cj(t,n):e.unmask(t,n)}}catch{}});var uj=Te((ame,lj)=>{"use strict";var dj=Symbol("kDone"),Ow=Symbol("kRun"),Dw=class{static{a(this,"Limiter")}constructor(t){this[dj]=()=>{this.pending--,this[Ow]()},this.concurrency=t||1/0,this.jobs=[],this.pending=0}add(t){this.jobs.push(t),this[Ow]()}[Ow](){if(this.pending!==this.concurrency&&this.jobs.length){let t=this.jobs.shift();this.pending++,t(this[dj])}}};lj.exports=Dw});var ei=Te((ime,gj)=>{"use strict";var Lc=Pe("zlib"),pj=$c(),zG=uj(),{kStatusCode:mj}=Br(),WG=Buffer[Symbol.species],VG=Buffer.from([0,0,255,255]),wp=Symbol("permessage-deflate"),$r=Symbol("total-length"),Qs=Symbol("callback"),So=Symbol("buffers"),Zs=Symbol("error"),hp,Bw=class{static{a(this,"PerMessageDeflate")}constructor(t){if(this._options=t||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._maxPayload=this._options.maxPayload|0,this._isServer=!!this._options.isServer,this._deflate=null,this._inflate=null,this.params=null,!hp){let n=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;hp=new zG(n)}}static get extensionName(){return"permessage-deflate"}offer(){let t={};return this._options.serverNoContextTakeover&&(t.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(t.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(t.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?t.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(t.client_max_window_bits=!0),t}accept(t){return t=this.normalizeParams(t),this.params=this._isServer?this.acceptAsServer(t):this.acceptAsClient(t),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let t=this._deflate[Qs];this._deflate.close(),this._deflate=null,t&&t(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(t){let n=this._options,r=t.find(o=>!(n.serverNoContextTakeover===!1&&o.server_no_context_takeover||o.server_max_window_bits&&(n.serverMaxWindowBits===!1||typeof n.serverMaxWindowBits=="number"&&n.serverMaxWindowBits>o.server_max_window_bits)||typeof n.clientMaxWindowBits=="number"&&!o.client_max_window_bits));if(!r)throw new Error("None of the extension offers can be accepted");return n.serverNoContextTakeover&&(r.server_no_context_takeover=!0),n.clientNoContextTakeover&&(r.client_no_context_takeover=!0),typeof n.serverMaxWindowBits=="number"&&(r.server_max_window_bits=n.serverMaxWindowBits),typeof n.clientMaxWindowBits=="number"?r.client_max_window_bits=n.clientMaxWindowBits:(r.client_max_window_bits===!0||n.clientMaxWindowBits===!1)&&delete r.client_max_window_bits,r}acceptAsClient(t){let n=t[0];if(this._options.clientNoContextTakeover===!1&&n.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!n.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(n.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&n.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return n}normalizeParams(t){return t.forEach(n=>{Object.keys(n).forEach(r=>{let o=n[r];if(o.length>1)throw new Error(`Parameter "${r}" must have only a single value`);if(o=o[0],r==="client_max_window_bits"){if(o!==!0){let s=+o;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${r}": ${o}`);o=s}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${r}": ${o}`)}else if(r==="server_max_window_bits"){let s=+o;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${r}": ${o}`);o=s}else if(r==="client_no_context_takeover"||r==="server_no_context_takeover"){if(o!==!0)throw new TypeError(`Invalid value for parameter "${r}": ${o}`)}else throw new Error(`Unknown parameter "${r}"`);n[r]=o})}),t}decompress(t,n,r){hp.add(o=>{this._decompress(t,n,(s,i)=>{o(),r(s,i)})})}compress(t,n,r){hp.add(o=>{this._compress(t,n,(s,i)=>{o(),r(s,i)})})}_decompress(t,n,r){let o=this._isServer?"client":"server";if(!this._inflate){let s=`${o}_max_window_bits`,i=typeof this.params[s]!="number"?Lc.Z_DEFAULT_WINDOWBITS:this.params[s];this._inflate=Lc.createInflateRaw({...this._options.zlibInflateOptions,windowBits:i}),this._inflate[wp]=this,this._inflate[$r]=0,this._inflate[So]=[],this._inflate.on("error",GG),this._inflate.on("data",fj)}this._inflate[Qs]=r,this._inflate.write(t),n&&this._inflate.write(VG),this._inflate.flush(()=>{let s=this._inflate[Zs];if(s){this._inflate.close(),this._inflate=null,r(s);return}let i=pj.concat(this._inflate[So],this._inflate[$r]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[$r]=0,this._inflate[So]=[],n&&this.params[`${o}_no_context_takeover`]&&this._inflate.reset()),r(null,i)})}_compress(t,n,r){let o=this._isServer?"server":"client";if(!this._deflate){let s=`${o}_max_window_bits`,i=typeof this.params[s]!="number"?Lc.Z_DEFAULT_WINDOWBITS:this.params[s];this._deflate=Lc.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:i}),this._deflate[$r]=0,this._deflate[So]=[],this._deflate.on("data",JG)}this._deflate[Qs]=r,this._deflate.write(t),this._deflate.flush(Lc.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let s=pj.concat(this._deflate[So],this._deflate[$r]);n&&(s=new WG(s.buffer,s.byteOffset,s.length-4)),this._deflate[Qs]=null,this._deflate[$r]=0,this._deflate[So]=[],n&&this.params[`${o}_no_context_takeover`]&&this._deflate.reset(),r(null,s)})}};gj.exports=Bw;function JG(e){this[So].push(e),this[$r]+=e.length}a(JG,"deflateOnData");function fj(e){if(this[$r]+=e.length,this[wp]._maxPayload<1||this[$r]<=this[wp]._maxPayload){this[So].push(e);return}this[Zs]=new RangeError("Max payload size exceeded"),this[Zs].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[Zs][mj]=1009,this.removeListener("data",fj),this.reset()}a(fj,"inflateOnData");function GG(e){if(this[wp]._inflate=null,this[Zs]){this[Qs](this[Zs]);return}e[mj]=1007,this[Qs](e)}a(GG,"inflateOnError")});var ti=Te((dme,yp)=>{"use strict";var{isUtf8:hj}=Pe("buffer"),{hasBlob:KG}=Br(),YG=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function XG(e){return e>=1e3&&e<=1014&&e!==1004&&e!==1005&&e!==1006||e>=3e3&&e<=4999}a(XG,"isValidStatusCode");function $w(e){let t=e.length,n=0;for(;n<t;)if((e[n]&128)===0)n++;else if((e[n]&224)===192){if(n+1===t||(e[n+1]&192)!==128||(e[n]&254)===192)return!1;n+=2}else if((e[n]&240)===224){if(n+2>=t||(e[n+1]&192)!==128||(e[n+2]&192)!==128||e[n]===224&&(e[n+1]&224)===128||e[n]===237&&(e[n+1]&224)===160)return!1;n+=3}else if((e[n]&248)===240){if(n+3>=t||(e[n+1]&192)!==128||(e[n+2]&192)!==128||(e[n+3]&192)!==128||e[n]===240&&(e[n+1]&240)===128||e[n]===244&&e[n+1]>143||e[n]>244)return!1;n+=4}else return!1;return!0}a($w,"_isValidUTF8");function QG(e){return KG&&typeof e=="object"&&typeof e.arrayBuffer=="function"&&typeof e.type=="string"&&typeof e.stream=="function"&&(e[Symbol.toStringTag]==="Blob"||e[Symbol.toStringTag]==="File")}a(QG,"isBlob");yp.exports={isBlob:QG,isValidStatusCode:XG,isValidUTF8:$w,tokenChars:YG};if(hj)yp.exports.isValidUTF8=function(e){return e.length<24?$w(e):hj(e)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let e=Pe("utf-8-validate");yp.exports.isValidUTF8=function(t){return t.length<32?$w(t):e(t)}}catch{}});var qw=Te((ume,Ij)=>{"use strict";var{Writable:ZG}=Pe("stream"),wj=ei(),{BINARY_TYPES:e6,EMPTY_BUFFER:yj,kStatusCode:t6,kWebSocket:n6}=Br(),{concat:Lw,toArrayBuffer:r6,unmask:o6}=$c(),{isValidStatusCode:a6,isValidUTF8:vj}=ti(),vp=Buffer[Symbol.species],Rn=0,kj=1,bj=2,Sj=3,Nw=4,Uw=5,kp=6,Fw=class extends ZG{static{a(this,"Receiver")}constructor(t={}){super(),this._allowSynchronousEvents=t.allowSynchronousEvents!==void 0?t.allowSynchronousEvents:!0,this._binaryType=t.binaryType||e6[0],this._extensions=t.extensions||{},this._isServer=!!t.isServer,this._maxBufferedChunks=t.maxBufferedChunks|0,this._maxFragments=t.maxFragments|0,this._maxPayload=t.maxPayload|0,this._skipUTF8Validation=!!t.skipUTF8Validation,this[n6]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._numFragments=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=Rn}_write(t,n,r){if(this._opcode===8&&this._state==Rn)return r();if(this._maxBufferedChunks>0&&this._buffers.length>=this._maxBufferedChunks){r(this.createError(RangeError,"Too many buffered chunks",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS"));return}this._bufferedBytes+=t.length,this._buffers.push(t),this.startLoop(r)}consume(t){if(this._bufferedBytes-=t,t===this._buffers[0].length)return this._buffers.shift();if(t<this._buffers[0].length){let r=this._buffers[0];return this._buffers[0]=new vp(r.buffer,r.byteOffset+t,r.length-t),new vp(r.buffer,r.byteOffset,t)}let n=Buffer.allocUnsafe(t);do{let r=this._buffers[0],o=n.length-t;t>=r.length?n.set(this._buffers.shift(),o):(n.set(new Uint8Array(r.buffer,r.byteOffset,t),o),this._buffers[0]=new vp(r.buffer,r.byteOffset+t,r.length-t)),t-=r.length}while(t>0);return n}startLoop(t){this._loop=!0;do switch(this._state){case Rn:this.getInfo(t);break;case kj:this.getPayloadLength16(t);break;case bj:this.getPayloadLength64(t);break;case Sj:this.getMask();break;case Nw:this.getData(t);break;case Uw:case kp:this._loop=!1;return}while(this._loop);this._errored||t()}getInfo(t){if(this._bufferedBytes<2){this._loop=!1;return}let n=this.consume(2);if((n[0]&48)!==0){let o=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");t(o);return}let r=(n[0]&64)===64;if(r&&!this._extensions[wj.extensionName]){let o=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(o);return}if(this._fin=(n[0]&128)===128,this._opcode=n[0]&15,this._payloadLength=n[1]&127,this._opcode===0){if(r){let o=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(o);return}if(!this._fragmented){let o=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");t(o);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let o=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(o);return}this._compressed=r}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let o=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");t(o);return}if(r){let o=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(o);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let o=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");t(o);return}}else{let o=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(o);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(n[1]&128)===128,this._isServer){if(!this._masked){let o=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");t(o);return}}else if(this._masked){let o=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");t(o);return}this._payloadLength===126?this._state=kj:this._payloadLength===127?this._state=bj:this.haveLength(t)}getPayloadLength16(t){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(t)}getPayloadLength64(t){if(this._bufferedBytes<8){this._loop=!1;return}let n=this.consume(8),r=n.readUInt32BE(0);if(r>Math.pow(2,21)-1){let o=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");t(o);return}this._payloadLength=r*Math.pow(2,32)+n.readUInt32BE(4),this.haveLength(t)}haveLength(t){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let n=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");t(n);return}this._masked?this._state=Sj:this._state=Nw}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=Nw}getData(t){let n=yj;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}n=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&o6(n,this._mask)}if(this._opcode>7){this.controlMessage(n,t);return}if(this._maxFragments>0&&++this._numFragments>this._maxFragments){let r=this.createError(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS");t(r);return}if(this._compressed){this._state=Uw,this.decompress(n,t);return}n.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(n)),this.dataMessage(t)}decompress(t,n){this._extensions[wj.extensionName].decompress(t,this._fin,(o,s)=>{if(o)return n(o);if(s.length){if(this._messageLength+=s.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let i=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");n(i);return}this._fragments.push(s)}this.dataMessage(n),this._state===Rn&&this.startLoop(n)})}dataMessage(t){if(!this._fin){this._state=Rn;return}let n=this._messageLength,r=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._numFragments=0,this._fragments=[],this._opcode===2){let o;this._binaryType==="nodebuffer"?o=Lw(r,n):this._binaryType==="arraybuffer"?o=r6(Lw(r,n)):this._binaryType==="blob"?o=new Blob(r):o=r,this._allowSynchronousEvents?(this.emit("message",o,!0),this._state=Rn):(this._state=kp,setImmediate(()=>{this.emit("message",o,!0),this._state=Rn,this.startLoop(t)}))}else{let o=Lw(r,n);if(!this._skipUTF8Validation&&!vj(o)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(s);return}this._state===Uw||this._allowSynchronousEvents?(this.emit("message",o,!1),this._state=Rn):(this._state=kp,setImmediate(()=>{this.emit("message",o,!1),this._state=Rn,this.startLoop(t)}))}}controlMessage(t,n){if(this._opcode===8){if(t.length===0)this._loop=!1,this.emit("conclude",1005,yj),this.end();else{let r=t.readUInt16BE(0);if(!a6(r)){let s=this.createError(RangeError,`invalid status code ${r}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");n(s);return}let o=new vp(t.buffer,t.byteOffset+2,t.length-2);if(!this._skipUTF8Validation&&!vj(o)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");n(s);return}this._loop=!1,this.emit("conclude",r,o),this.end()}this._state=Rn;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",t),this._state=Rn):(this._state=kp,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",t),this._state=Rn,this.startLoop(n)}))}createError(t,n,r,o,s){this._loop=!1,this._errored=!0;let i=new t(r?`Invalid WebSocket frame: ${n}`:n);return Error.captureStackTrace(i,this.createError),i.code=s,i[t6]=o,i}};Ij.exports=Fw});var Vw=Te((fme,_j)=>{"use strict";var{Duplex:mme}=Pe("stream"),{randomFillSync:s6}=Pe("crypto"),{types:{isUint8Array:i6}}=Pe("util"),Rj=ei(),{EMPTY_BUFFER:c6,kWebSocket:d6,NOOP:l6}=Br(),{isBlob:ni,isValidStatusCode:u6}=ti(),{mask:Pj,toBuffer:ca}=$c(),Pn=Symbol("kByteLength"),p6=Buffer.alloc(4),bp=8*1024,da,ri=bp,Nn=0,m6=1,f6=2,zw=class e{static{a(this,"Sender")}constructor(t,n,r){this._extensions=n||{},r&&(this._generateMask=r,this._maskBuffer=Buffer.alloc(4)),this._socket=t,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=Nn,this.onerror=l6,this[d6]=void 0}static frame(t,n){let r,o=!1,s=2,i=!1;n.mask&&(r=n.maskBuffer||p6,n.generateMask?n.generateMask(r):(ri===bp&&(da===void 0&&(da=Buffer.alloc(bp)),s6(da,0,bp),ri=0),r[0]=da[ri++],r[1]=da[ri++],r[2]=da[ri++],r[3]=da[ri++]),i=(r[0]|r[1]|r[2]|r[3])===0,s=6);let c;typeof t=="string"?(!n.mask||i)&&n[Pn]!==void 0?c=n[Pn]:(t=Buffer.from(t),c=t.length):(c=t.length,o=n.mask&&n.readOnly&&!i);let d=c;c>=65536?(s+=8,d=127):c>125&&(s+=2,d=126);let l=Buffer.allocUnsafe(o?c+s:s);return l[0]=n.fin?n.opcode|128:n.opcode,n.rsv1&&(l[0]|=64),l[1]=d,d===126?l.writeUInt16BE(c,2):d===127&&(l[2]=l[3]=0,l.writeUIntBE(c,4,6)),n.mask?(l[1]|=128,l[s-4]=r[0],l[s-3]=r[1],l[s-2]=r[2],l[s-1]=r[3],i?[l,t]:o?(Pj(t,r,l,s,c),[l]):(Pj(t,r,t,0,c),[l,t])):[l,t]}close(t,n,r,o){let s;if(t===void 0)s=c6;else{if(typeof t!="number"||!u6(t))throw new TypeError("First argument must be a valid error code number");if(n===void 0||!n.length)s=Buffer.allocUnsafe(2),s.writeUInt16BE(t,0);else{let c=Buffer.byteLength(n);if(c>123)throw new RangeError("The message must not be greater than 123 bytes");if(s=Buffer.allocUnsafe(2+c),s.writeUInt16BE(t,0),typeof n=="string")s.write(n,2);else if(i6(n))s.set(n,2);else throw new TypeError("Second argument must be a string or a Uint8Array")}}let i={[Pn]:s.length,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==Nn?this.enqueue([this.dispatch,s,!1,i,o]):this.sendFrame(e.frame(s,i),o)}ping(t,n,r){let o,s;if(typeof t=="string"?(o=Buffer.byteLength(t),s=!1):ni(t)?(o=t.size,s=!1):(t=ca(t),o=t.length,s=ca.readOnly),o>125)throw new RangeError("The data size must not be greater than 125 bytes");let i={[Pn]:o,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:9,readOnly:s,rsv1:!1};ni(t)?this._state!==Nn?this.enqueue([this.getBlobData,t,!1,i,r]):this.getBlobData(t,!1,i,r):this._state!==Nn?this.enqueue([this.dispatch,t,!1,i,r]):this.sendFrame(e.frame(t,i),r)}pong(t,n,r){let o,s;if(typeof t=="string"?(o=Buffer.byteLength(t),s=!1):ni(t)?(o=t.size,s=!1):(t=ca(t),o=t.length,s=ca.readOnly),o>125)throw new RangeError("The data size must not be greater than 125 bytes");let i={[Pn]:o,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:10,readOnly:s,rsv1:!1};ni(t)?this._state!==Nn?this.enqueue([this.getBlobData,t,!1,i,r]):this.getBlobData(t,!1,i,r):this._state!==Nn?this.enqueue([this.dispatch,t,!1,i,r]):this.sendFrame(e.frame(t,i),r)}send(t,n,r){let o=this._extensions[Rj.extensionName],s=n.binary?2:1,i=n.compress,c,d;typeof t=="string"?(c=Buffer.byteLength(t),d=!1):ni(t)?(c=t.size,d=!1):(t=ca(t),c=t.length,d=ca.readOnly),this._firstFragment?(this._firstFragment=!1,i&&o&&o.params[o._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(i=c>=o._threshold),this._compress=i):(i=!1,s=0),n.fin&&(this._firstFragment=!0);let l={[Pn]:c,fin:n.fin,generateMask:this._generateMask,mask:n.mask,maskBuffer:this._maskBuffer,opcode:s,readOnly:d,rsv1:i};ni(t)?this._state!==Nn?this.enqueue([this.getBlobData,t,this._compress,l,r]):this.getBlobData(t,this._compress,l,r):this._state!==Nn?this.enqueue([this.dispatch,t,this._compress,l,r]):this.dispatch(t,this._compress,l,r)}getBlobData(t,n,r,o){this._bufferedBytes+=r[Pn],this._state=f6,t.arrayBuffer().then(s=>{if(this._socket.destroyed){let c=new Error("The socket was closed while the blob was being read");process.nextTick(Ww,this,c,o);return}this._bufferedBytes-=r[Pn];let i=ca(s);n?this.dispatch(i,n,r,o):(this._state=Nn,this.sendFrame(e.frame(i,r),o),this.dequeue())}).catch(s=>{process.nextTick(g6,this,s,o)})}dispatch(t,n,r,o){if(!n){this.sendFrame(e.frame(t,r),o);return}let s=this._extensions[Rj.extensionName];this._bufferedBytes+=r[Pn],this._state=m6,s.compress(t,r.fin,(i,c)=>{if(this._socket.destroyed){let d=new Error("The socket was closed while data was being compressed");Ww(this,d,o);return}this._bufferedBytes-=r[Pn],this._state=Nn,r.readOnly=!1,this.sendFrame(e.frame(c,r),o),this.dequeue()})}dequeue(){for(;this._state===Nn&&this._queue.length;){let t=this._queue.shift();this._bufferedBytes-=t[3][Pn],Reflect.apply(t[0],this,t.slice(1))}}enqueue(t){this._bufferedBytes+=t[3][Pn],this._queue.push(t)}sendFrame(t,n){t.length===2?(this._socket.cork(),this._socket.write(t[0]),this._socket.write(t[1],n),this._socket.uncork()):this._socket.write(t[0],n)}};_j.exports=zw;function Ww(e,t,n){typeof n=="function"&&n(t);for(let r=0;r<e._queue.length;r++){let o=e._queue[r],s=o[o.length-1];typeof s=="function"&&s(t)}}a(Ww,"callCallbacks");function g6(e,t,n){Ww(e,t,n),e.onerror(t)}a(g6,"onError")});var Oj=Te((hme,Hj)=>{"use strict";var{kForOnEventAttribute:Nc,kListener:Jw}=Br(),xj=Symbol("kCode"),Tj=Symbol("kData"),Aj=Symbol("kError"),Cj=Symbol("kMessage"),Ej=Symbol("kReason"),oi=Symbol("kTarget"),Mj=Symbol("kType"),jj=Symbol("kWasClean"),Lr=class{static{a(this,"Event")}constructor(t){this[oi]=null,this[Mj]=t}get target(){return this[oi]}get type(){return this[Mj]}};Object.defineProperty(Lr.prototype,"target",{enumerable:!0});Object.defineProperty(Lr.prototype,"type",{enumerable:!0});var la=class extends Lr{static{a(this,"CloseEvent")}constructor(t,n={}){super(t),this[xj]=n.code===void 0?0:n.code,this[Ej]=n.reason===void 0?"":n.reason,this[jj]=n.wasClean===void 0?!1:n.wasClean}get code(){return this[xj]}get reason(){return this[Ej]}get wasClean(){return this[jj]}};Object.defineProperty(la.prototype,"code",{enumerable:!0});Object.defineProperty(la.prototype,"reason",{enumerable:!0});Object.defineProperty(la.prototype,"wasClean",{enumerable:!0});var ai=class extends Lr{static{a(this,"ErrorEvent")}constructor(t,n={}){super(t),this[Aj]=n.error===void 0?null:n.error,this[Cj]=n.message===void 0?"":n.message}get error(){return this[Aj]}get message(){return this[Cj]}};Object.defineProperty(ai.prototype,"error",{enumerable:!0});Object.defineProperty(ai.prototype,"message",{enumerable:!0});var Uc=class extends Lr{static{a(this,"MessageEvent")}constructor(t,n={}){super(t),this[Tj]=n.data===void 0?null:n.data}get data(){return this[Tj]}};Object.defineProperty(Uc.prototype,"data",{enumerable:!0});var h6={addEventListener(e,t,n={}){for(let o of this.listeners(e))if(!n[Nc]&&o[Jw]===t&&!o[Nc])return;let r;if(e==="message")r=a(function(s,i){let c=new Uc("message",{data:i?s:s.toString()});c[oi]=this,Sp(t,this,c)},"onMessage");else if(e==="close")r=a(function(s,i){let c=new la("close",{code:s,reason:i.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});c[oi]=this,Sp(t,this,c)},"onClose");else if(e==="error")r=a(function(s){let i=new ai("error",{error:s,message:s.message});i[oi]=this,Sp(t,this,i)},"onError");else if(e==="open")r=a(function(){let s=new Lr("open");s[oi]=this,Sp(t,this,s)},"onOpen");else return;r[Nc]=!!n[Nc],r[Jw]=t,n.once?this.once(e,r):this.on(e,r)},removeEventListener(e,t){for(let n of this.listeners(e))if(n[Jw]===t&&!n[Nc]){this.removeListener(e,n);break}}};Hj.exports={CloseEvent:la,ErrorEvent:ai,Event:Lr,EventTarget:h6,MessageEvent:Uc};function Sp(e,t,n){typeof e=="object"&&e.handleEvent?e.handleEvent.call(e,n):e.call(t,n)}a(Sp,"callListener")});var Ip=Te((yme,Dj)=>{"use strict";var{tokenChars:Fc}=ti();function mr(e,t,n){e[t]===void 0?e[t]=[n]:e[t].push(n)}a(mr,"push");function w6(e){let t=Object.create(null),n=Object.create(null),r=!1,o=!1,s=!1,i,c,d=-1,l=-1,u=-1,p=0;for(;p<e.length;p++)if(l=e.charCodeAt(p),i===void 0)if(u===-1&&Fc[l]===1)d===-1&&(d=p);else if(p!==0&&(l===32||l===9))u===-1&&d!==-1&&(u=p);else if(l===59||l===44){if(d===-1)throw new SyntaxError(`Unexpected character at index ${p}`);u===-1&&(u=p);let f=e.slice(d,u);l===44?(mr(t,f,n),n=Object.create(null)):i=f,d=u=-1}else throw new SyntaxError(`Unexpected character at index ${p}`);else if(c===void 0)if(u===-1&&Fc[l]===1)d===-1&&(d=p);else if(l===32||l===9)u===-1&&d!==-1&&(u=p);else if(l===59||l===44){if(d===-1)throw new SyntaxError(`Unexpected character at index ${p}`);u===-1&&(u=p),mr(n,e.slice(d,u),!0),l===44&&(mr(t,i,n),n=Object.create(null),i=void 0),d=u=-1}else if(l===61&&d!==-1&&u===-1)c=e.slice(d,p),d=u=-1;else throw new SyntaxError(`Unexpected character at index ${p}`);else if(o){if(Fc[l]!==1)throw new SyntaxError(`Unexpected character at index ${p}`);d===-1?d=p:r||(r=!0),o=!1}else if(s)if(Fc[l]===1)d===-1&&(d=p);else if(l===34&&d!==-1)s=!1,u=p;else if(l===92)o=!0;else throw new SyntaxError(`Unexpected character at index ${p}`);else if(l===34&&e.charCodeAt(p-1)===61)s=!0;else if(u===-1&&Fc[l]===1)d===-1&&(d=p);else if(d!==-1&&(l===32||l===9))u===-1&&(u=p);else if(l===59||l===44){if(d===-1)throw new SyntaxError(`Unexpected character at index ${p}`);u===-1&&(u=p);let f=e.slice(d,u);r&&(f=f.replace(/\\/g,""),r=!1),mr(n,c,f),l===44&&(mr(t,i,n),n=Object.create(null),i=void 0),c=void 0,d=u=-1}else throw new SyntaxError(`Unexpected character at index ${p}`);if(d===-1||s||l===32||l===9)throw new SyntaxError("Unexpected end of input");u===-1&&(u=p);let m=e.slice(d,u);return i===void 0?mr(t,m,n):(c===void 0?mr(n,m,!0):r?mr(n,c,m.replace(/\\/g,"")):mr(n,c,m),mr(t,i,n)),t}a(w6,"parse");function y6(e){return Object.keys(e).map(t=>{let n=e[t];return Array.isArray(n)||(n=[n]),n.map(r=>[t].concat(Object.keys(r).map(o=>{let s=r[o];return Array.isArray(s)||(s=[s]),s.map(i=>i===!0?o:`${o}=${i}`).join("; ")})).join("; ")).join(", ")}).join(", ")}a(y6,"format");Dj.exports={format:y6,parse:w6}});var xp=Te((Sme,Gj)=>{"use strict";var v6=Pe("events"),k6=Pe("https"),b6=Pe("http"),Lj=Pe("net"),S6=Pe("tls"),{randomBytes:I6,createHash:R6}=Pe("crypto"),{Duplex:kme,Readable:bme}=Pe("stream"),{URL:Gw}=Pe("url"),Io=ei(),P6=qw(),_6=Vw(),{isBlob:x6}=ti(),{BINARY_TYPES:Bj,CLOSE_TIMEOUT:T6,EMPTY_BUFFER:Rp,GUID:A6,kForOnEventAttribute:Kw,kListener:C6,kStatusCode:E6,kWebSocket:pt,NOOP:Nj}=Br(),{EventTarget:{addEventListener:M6,removeEventListener:j6}}=Oj(),{format:H6,parse:O6}=Ip(),{toBuffer:D6}=$c(),Uj=Symbol("kAborted"),Yw=[8,13],Nr=["CONNECTING","OPEN","CLOSING","CLOSED"],B6=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,ze=class e extends v6{static{a(this,"WebSocket")}constructor(t,n,r){super(),this._binaryType=Bj[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=Rp,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=e.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,t!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,n===void 0?n=[]:Array.isArray(n)||(typeof n=="object"&&n!==null?(r=n,n=[]):n=[n]),Fj(this,t,n,r)):(this._autoPong=r.autoPong,this._closeTimeout=r.closeTimeout,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(t){Bj.includes(t)&&(this._binaryType=t,this._receiver&&(this._receiver._binaryType=t))}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(t,n,r){let o=new P6({allowSynchronousEvents:r.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxBufferedChunks:r.maxBufferedChunks,maxFragments:r.maxFragments,maxPayload:r.maxPayload,skipUTF8Validation:r.skipUTF8Validation}),s=new _6(t,this._extensions,r.generateMask);this._receiver=o,this._sender=s,this._socket=t,o[pt]=this,s[pt]=this,t[pt]=this,o.on("conclude",N6),o.on("drain",U6),o.on("error",F6),o.on("message",q6),o.on("ping",z6),o.on("pong",W6),s.onerror=V6,t.setTimeout&&t.setTimeout(0),t.setNoDelay&&t.setNoDelay(),n.length>0&&t.unshift(n),t.on("close",Wj),t.on("data",_p),t.on("end",Vj),t.on("error",Jj),this._readyState=e.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[Io.extensionName]&&this._extensions[Io.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(t,n){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){dn(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===e.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=e.CLOSING,this._sender.close(t,n,!this._isServer,r=>{r||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),zj(this)}}pause(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!0,this._socket.pause())}ping(t,n,r){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(r=t,t=n=void 0):typeof n=="function"&&(r=n,n=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){Xw(this,t,r);return}n===void 0&&(n=!this._isServer),this._sender.ping(t||Rp,n,r)}pong(t,n,r){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(r=t,t=n=void 0):typeof n=="function"&&(r=n,n=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){Xw(this,t,r);return}n===void 0&&(n=!this._isServer),this._sender.pong(t||Rp,n,r)}resume(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(t,n,r){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof n=="function"&&(r=n,n={}),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){Xw(this,t,r);return}let o={binary:typeof t!="string",mask:!this._isServer,compress:!0,fin:!0,...n};this._extensions[Io.extensionName]||(o.compress=!1),this._sender.send(t||Rp,o,r)}terminate(){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){dn(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=e.CLOSING,this._socket.destroy())}}};Object.defineProperty(ze,"CONNECTING",{enumerable:!0,value:Nr.indexOf("CONNECTING")});Object.defineProperty(ze.prototype,"CONNECTING",{enumerable:!0,value:Nr.indexOf("CONNECTING")});Object.defineProperty(ze,"OPEN",{enumerable:!0,value:Nr.indexOf("OPEN")});Object.defineProperty(ze.prototype,"OPEN",{enumerable:!0,value:Nr.indexOf("OPEN")});Object.defineProperty(ze,"CLOSING",{enumerable:!0,value:Nr.indexOf("CLOSING")});Object.defineProperty(ze.prototype,"CLOSING",{enumerable:!0,value:Nr.indexOf("CLOSING")});Object.defineProperty(ze,"CLOSED",{enumerable:!0,value:Nr.indexOf("CLOSED")});Object.defineProperty(ze.prototype,"CLOSED",{enumerable:!0,value:Nr.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(e=>{Object.defineProperty(ze.prototype,e,{enumerable:!0})});["open","error","close","message"].forEach(e=>{Object.defineProperty(ze.prototype,`on${e}`,{enumerable:!0,get(){for(let t of this.listeners(e))if(t[Kw])return t[C6];return null},set(t){for(let n of this.listeners(e))if(n[Kw]){this.removeListener(e,n);break}typeof t=="function"&&this.addEventListener(e,t,{[Kw]:!0})}})});ze.prototype.addEventListener=M6;ze.prototype.removeEventListener=j6;Gj.exports=ze;function Fj(e,t,n,r){let o={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:T6,protocolVersion:Yw[1],maxBufferedChunks:262144,maxFragments:16384,maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...r,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(e._autoPong=o.autoPong,e._closeTimeout=o.closeTimeout,!Yw.includes(o.protocolVersion))throw new RangeError(`Unsupported protocol version: ${o.protocolVersion} (supported versions: ${Yw.join(", ")})`);let s;if(t instanceof Gw)s=t;else try{s=new Gw(t)}catch{throw new SyntaxError(`Invalid URL: ${t}`)}s.protocol==="http:"?s.protocol="ws:":s.protocol==="https:"&&(s.protocol="wss:"),e._url=s.href;let i=s.protocol==="wss:",c=s.protocol==="ws+unix:",d;if(s.protocol!=="ws:"&&!i&&!c?d=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:c&&!s.pathname?d="The URL's pathname is empty":s.hash&&(d="The URL contains a fragment identifier"),d){let h=new SyntaxError(d);if(e._redirects===0)throw h;Pp(e,h);return}let l=i?443:80,u=I6(16).toString("base64"),p=i?k6.request:b6.request,m=new Set,f;if(o.createConnection=o.createConnection||(i?L6:$6),o.defaultPort=o.defaultPort||l,o.port=s.port||l,o.host=s.hostname.startsWith("[")?s.hostname.slice(1,-1):s.hostname,o.headers={...o.headers,"Sec-WebSocket-Version":o.protocolVersion,"Sec-WebSocket-Key":u,Connection:"Upgrade",Upgrade:"websocket"},o.path=s.pathname+s.search,o.timeout=o.handshakeTimeout,o.perMessageDeflate&&(f=new Io({...o.perMessageDeflate,isServer:!1,maxPayload:o.maxPayload}),o.headers["Sec-WebSocket-Extensions"]=H6({[Io.extensionName]:f.offer()})),n.length){for(let h of n){if(typeof h!="string"||!B6.test(h)||m.has(h))throw new SyntaxError("An invalid or duplicated subprotocol was specified");m.add(h)}o.headers["Sec-WebSocket-Protocol"]=n.join(",")}if(o.origin&&(o.protocolVersion<13?o.headers["Sec-WebSocket-Origin"]=o.origin:o.headers.Origin=o.origin),(s.username||s.password)&&(o.auth=`${s.username}:${s.password}`),c){let h=o.path.split(":");o.socketPath=h[0],o.path=h[1]}let y;if(o.followRedirects){if(e._redirects===0){e._originalIpc=c,e._originalSecure=i,e._originalHostOrSocketPath=c?o.socketPath:s.host;let h=r&&r.headers;if(r={...r,headers:{}},h)for(let[v,g]of Object.entries(h))r.headers[v.toLowerCase()]=g}else if(e.listenerCount("redirect")===0){let h=c?e._originalIpc?o.socketPath===e._originalHostOrSocketPath:!1:e._originalIpc?!1:s.host===e._originalHostOrSocketPath;(!h||e._originalSecure&&!i)&&(delete o.headers.authorization,delete o.headers.cookie,h||delete o.headers.host,o.auth=void 0)}o.auth&&!r.headers.authorization&&(r.headers.authorization="Basic "+Buffer.from(o.auth).toString("base64")),y=e._req=p(o),e._redirects&&e.emit("redirect",e.url,y)}else y=e._req=p(o);o.timeout&&y.on("timeout",()=>{dn(e,y,"Opening handshake has timed out")}),y.on("error",h=>{y===null||y[Uj]||(y=e._req=null,Pp(e,h))}),y.on("response",h=>{let v=h.headers.location,g=h.statusCode;if(v&&o.followRedirects&&g>=300&&g<400){if(++e._redirects>o.maxRedirects){dn(e,y,"Maximum redirects exceeded");return}y.abort();let I;try{I=new Gw(v,t)}catch{let k=new SyntaxError(`Invalid URL: ${v}`);Pp(e,k);return}Fj(e,I,n,r)}else e.emit("unexpected-response",y,h)||dn(e,y,`Unexpected server response: ${h.statusCode}`)}),y.on("upgrade",(h,v,g)=>{if(e.emit("upgrade",h),e.readyState!==ze.CONNECTING)return;y=e._req=null;let I=h.headers.upgrade;if(I===void 0||I.toLowerCase()!=="websocket"){dn(e,v,"Invalid Upgrade header");return}let R=R6("sha1").update(u+A6).digest("base64");if(h.headers["sec-websocket-accept"]!==R){dn(e,v,"Invalid Sec-WebSocket-Accept header");return}let k=h.headers["sec-websocket-protocol"],w;if(k!==void 0?m.size?m.has(k)||(w="Server sent an invalid subprotocol"):w="Server sent a subprotocol but none was requested":m.size&&(w="Server sent no subprotocol"),w){dn(e,v,w);return}k&&(e._protocol=k);let T=h.headers["sec-websocket-extensions"];if(T!==void 0){if(!f){dn(e,v,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let C;try{C=O6(T)}catch{dn(e,v,"Invalid Sec-WebSocket-Extensions header");return}let b=Object.keys(C);if(b.length!==1||b[0]!==Io.extensionName){dn(e,v,"Server indicated an extension that was not requested");return}try{f.accept(C[Io.extensionName])}catch{dn(e,v,"Invalid Sec-WebSocket-Extensions header");return}e._extensions[Io.extensionName]=f}e.setSocket(v,g,{allowSynchronousEvents:o.allowSynchronousEvents,generateMask:o.generateMask,maxBufferedChunks:o.maxBufferedChunks,maxFragments:o.maxFragments,maxPayload:o.maxPayload,skipUTF8Validation:o.skipUTF8Validation})}),o.finishRequest?o.finishRequest(y,e):y.end()}a(Fj,"initAsClient");function Pp(e,t){e._readyState=ze.CLOSING,e._errorEmitted=!0,e.emit("error",t),e.emitClose()}a(Pp,"emitErrorAndClose");function $6(e){return e.path=e.socketPath,Lj.connect(e)}a($6,"netConnect");function L6(e){return e.path=void 0,!e.servername&&e.servername!==""&&(e.servername=Lj.isIP(e.host)?"":e.host),S6.connect(e)}a(L6,"tlsConnect");function dn(e,t,n){e._readyState=ze.CLOSING;let r=new Error(n);Error.captureStackTrace(r,dn),t.setHeader?(t[Uj]=!0,t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),process.nextTick(Pp,e,r)):(t.destroy(r),t.once("error",e.emit.bind(e,"error")),t.once("close",e.emitClose.bind(e)))}a(dn,"abortHandshake");function Xw(e,t,n){if(t){let r=x6(t)?t.size:D6(t).length;e._socket?e._sender._bufferedBytes+=r:e._bufferedAmount+=r}if(n){let r=new Error(`WebSocket is not open: readyState ${e.readyState} (${Nr[e.readyState]})`);process.nextTick(n,r)}}a(Xw,"sendAfterClose");function N6(e,t){let n=this[pt];n._closeFrameReceived=!0,n._closeMessage=t,n._closeCode=e,n._socket[pt]!==void 0&&(n._socket.removeListener("data",_p),process.nextTick(qj,n._socket),e===1005?n.close():n.close(e,t))}a(N6,"receiverOnConclude");function U6(){let e=this[pt];e.isPaused||e._socket.resume()}a(U6,"receiverOnDrain");function F6(e){let t=this[pt];t._socket[pt]!==void 0&&(t._socket.removeListener("data",_p),process.nextTick(qj,t._socket),t.close(e[E6])),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e))}a(F6,"receiverOnError");function $j(){this[pt].emitClose()}a($j,"receiverOnFinish");function q6(e,t){this[pt].emit("message",e,t)}a(q6,"receiverOnMessage");function z6(e){let t=this[pt];t._autoPong&&t.pong(e,!this._isServer,Nj),t.emit("ping",e)}a(z6,"receiverOnPing");function W6(e){this[pt].emit("pong",e)}a(W6,"receiverOnPong");function qj(e){e.resume()}a(qj,"resume");function V6(e){let t=this[pt];t.readyState!==ze.CLOSED&&(t.readyState===ze.OPEN&&(t._readyState=ze.CLOSING,zj(t)),this._socket.end(),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e)))}a(V6,"senderOnError");function zj(e){e._closeTimer=setTimeout(e._socket.destroy.bind(e._socket),e._closeTimeout)}a(zj,"setCloseTimer");function Wj(){let e=this[pt];if(this.removeListener("close",Wj),this.removeListener("data",_p),this.removeListener("end",Vj),e._readyState=ze.CLOSING,!this._readableState.endEmitted&&!e._closeFrameReceived&&!e._receiver._writableState.errorEmitted&&this._readableState.length!==0){let t=this.read(this._readableState.length);e._receiver.write(t)}e._receiver.end(),this[pt]=void 0,clearTimeout(e._closeTimer),e._receiver._writableState.finished||e._receiver._writableState.errorEmitted?e.emitClose():(e._receiver.on("error",$j),e._receiver.on("finish",$j))}a(Wj,"socketOnClose");function _p(e){this[pt]._receiver.write(e)||this.pause()}a(_p,"socketOnData");function Vj(){let e=this[pt];e._readyState=ze.CLOSING,e._receiver.end(),this.end()}a(Vj,"socketOnEnd");function Jj(){let e=this[pt];this.removeListener("error",Jj),this.on("error",Nj),e&&(e._readyState=ze.CLOSING,this.destroy())}a(Jj,"socketOnError")});var Qj=Te((Pme,Xj)=>{"use strict";var Rme=xp(),{Duplex:J6}=Pe("stream");function Kj(e){e.emit("close")}a(Kj,"emitClose");function G6(){!this.destroyed&&this._writableState.finished&&this.destroy()}a(G6,"duplexOnEnd");function Yj(e){this.removeListener("error",Yj),this.destroy(),this.listenerCount("error")===0&&this.emit("error",e)}a(Yj,"duplexOnError");function K6(e,t){let n=!0,r=new J6({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return e.on("message",a(function(s,i){let c=!i&&r._readableState.objectMode?s.toString():s;r.push(c)||e.pause()},"message")),e.once("error",a(function(s){r.destroyed||(n=!1,r.destroy(s))},"error")),e.once("close",a(function(){r.destroyed||r.push(null)},"close")),r._destroy=function(o,s){if(e.readyState===e.CLOSED){s(o),process.nextTick(Kj,r);return}let i=!1;e.once("error",a(function(d){i=!0,s(d)},"error")),e.once("close",a(function(){i||s(o),process.nextTick(Kj,r)},"close")),n&&e.terminate()},r._final=function(o){if(e.readyState===e.CONNECTING){e.once("open",a(function(){r._final(o)},"open"));return}e._socket!==null&&(e._socket._writableState.finished?(o(),r._readableState.endEmitted&&r.destroy()):(e._socket.once("finish",a(function(){o()},"finish")),e.close()))},r._read=function(){e.isPaused&&e.resume()},r._write=function(o,s,i){if(e.readyState===e.CONNECTING){e.once("open",a(function(){r._write(o,s,i)},"open"));return}e.send(o,i)},r.on("end",G6),r.on("error",Yj),r}a(K6,"createWebSocketStream");Xj.exports=K6});var Qw=Te((xme,Zj)=>{"use strict";var{tokenChars:Y6}=ti();function X6(e){let t=new Set,n=-1,r=-1,o=0;for(o;o<e.length;o++){let i=e.charCodeAt(o);if(r===-1&&Y6[i]===1)n===-1&&(n=o);else if(o!==0&&(i===32||i===9))r===-1&&n!==-1&&(r=o);else if(i===44){if(n===-1)throw new SyntaxError(`Unexpected character at index ${o}`);r===-1&&(r=o);let c=e.slice(n,r);if(t.has(c))throw new SyntaxError(`The "${c}" subprotocol is duplicated`);t.add(c),n=r=-1}else throw new SyntaxError(`Unexpected character at index ${o}`)}if(n===-1||r!==-1)throw new SyntaxError("Unexpected end of input");let s=e.slice(n,o);if(t.has(s))throw new SyntaxError(`The "${s}" subprotocol is duplicated`);return t.add(s),t}a(X6,"parse");Zj.exports={parse:X6}});var sH=Te((Cme,aH)=>{"use strict";var Q6=Pe("events"),Tp=Pe("http"),{Duplex:Ame}=Pe("stream"),{createHash:Z6}=Pe("crypto"),eH=Ip(),ua=ei(),e5=Qw(),t5=xp(),{CLOSE_TIMEOUT:n5,GUID:r5,kWebSocket:o5}=Br(),a5=/^[+/0-9A-Za-z]{22}==$/,tH=0,nH=1,oH=2,Zw=class extends Q6{static{a(this,"WebSocketServer")}constructor(t,n){if(super(),t={allowSynchronousEvents:!0,autoPong:!0,maxBufferedChunks:256*1024,maxFragments:16*1024,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:n5,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:t5,...t},t.port==null&&!t.server&&!t.noServer||t.port!=null&&(t.server||t.noServer)||t.server&&t.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(t.port!=null?(this._server=Tp.createServer((r,o)=>{let s=Tp.STATUS_CODES[426];o.writeHead(426,{"Content-Length":s.length,"Content-Type":"text/plain"}),o.end(s)}),this._server.listen(t.port,t.host,t.backlog,n)):t.server&&(this._server=t.server),this._server){let r=this.emit.bind(this,"connection");this._removeListeners=s5(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:a((o,s,i)=>{this.handleUpgrade(o,s,i,r)},"upgrade")})}t.perMessageDeflate===!0&&(t.perMessageDeflate={}),t.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=t,this._state=tH}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(t){if(this._state===oH){t&&this.once("close",()=>{t(new Error("The server is not running"))}),process.nextTick(qc,this);return}if(t&&this.once("close",t),this._state!==nH)if(this._state=nH,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(qc,this):process.nextTick(qc,this);else{let n=this._server;this._removeListeners(),this._removeListeners=this._server=null,n.close(()=>{qc(this)})}}shouldHandle(t){if(this.options.path){let n=t.url.indexOf("?");if((n!==-1?t.url.slice(0,n):t.url)!==this.options.path)return!1}return!0}handleUpgrade(t,n,r,o){n.on("error",rH);let s=t.headers["sec-websocket-key"],i=t.headers.upgrade,c=+t.headers["sec-websocket-version"];if(t.method!=="GET"){pa(this,t,n,405,"Invalid HTTP method");return}if(i===void 0||i.toLowerCase()!=="websocket"){pa(this,t,n,400,"Invalid Upgrade header");return}if(s===void 0||!a5.test(s)){pa(this,t,n,400,"Missing or invalid Sec-WebSocket-Key header");return}if(c!==13&&c!==8){pa(this,t,n,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(t)){zc(n,400);return}let d=t.headers["sec-websocket-protocol"],l=new Set;if(d!==void 0)try{l=e5.parse(d)}catch{pa(this,t,n,400,"Invalid Sec-WebSocket-Protocol header");return}let u=t.headers["sec-websocket-extensions"],p={};if(this.options.perMessageDeflate&&u!==void 0){let m=new ua({...this.options.perMessageDeflate,isServer:!0,maxPayload:this.options.maxPayload});try{let f=eH.parse(u);f[ua.extensionName]&&(m.accept(f[ua.extensionName]),p[ua.extensionName]=m)}catch{pa(this,t,n,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let m={origin:t.headers[`${c===8?"sec-websocket-origin":"origin"}`],secure:!!(t.socket.authorized||t.socket.encrypted),req:t};if(this.options.verifyClient.length===2){this.options.verifyClient(m,(f,y,h,v)=>{if(!f)return zc(n,y||401,h,v);this.completeUpgrade(p,s,l,t,n,r,o)});return}if(!this.options.verifyClient(m))return zc(n,401)}this.completeUpgrade(p,s,l,t,n,r,o)}completeUpgrade(t,n,r,o,s,i,c){if(!s.readable||!s.writable)return s.destroy();if(s[o5])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>tH)return zc(s,503);let l=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${Z6("sha1").update(n+r5).digest("base64")}`],u=new this.options.WebSocket(null,void 0,this.options);if(r.size){let p=this.options.handleProtocols?this.options.handleProtocols(r,o):r.values().next().value;p&&(l.push(`Sec-WebSocket-Protocol: ${p}`),u._protocol=p)}if(t[ua.extensionName]){let p=t[ua.extensionName].params,m=eH.format({[ua.extensionName]:[p]});l.push(`Sec-WebSocket-Extensions: ${m}`),u._extensions=t}this.emit("headers",l,o),s.write(l.concat(`\r
|
|
4
4
|
`).join(`\r
|
|
5
5
|
`)),s.removeListener("error",rH),u.setSocket(s,i,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxBufferedChunks:this.options.maxBufferedChunks,maxFragments:this.options.maxFragments,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(u),u.on("close",()=>{this.clients.delete(u),this._shouldEmitClose&&!this.clients.size&&process.nextTick(qc,this)})),c(u,o)}};aH.exports=Zw;function s5(e,t){for(let n of Object.keys(t))e.on(n,t[n]);return a(function(){for(let r of Object.keys(t))e.removeListener(r,t[r])},"removeListeners")}a(s5,"addListeners");function qc(e){e._state=oH,e.emit("close")}a(qc,"emitClose");function rH(){this.destroy()}a(rH,"socketOnError");function zc(e,t,n,r){n=n||Tp.STATUS_CODES[t],r={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(n),...r},e.once("finish",e.destroy),e.end(`HTTP/1.1 ${t} ${Tp.STATUS_CODES[t]}\r
|
|
6
6
|
`+Object.keys(r).map(o=>`${o}: ${r[o]}`).join(`\r
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunk-
|
|
2
|
+
import{A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunk-BRJKTOMI.js";import"./chunk-PMXE4CAA.js";import"./chunk-FTQLQJQV.js";export{a as MACOS_GIT_MISSING_DEVELOPER_TOOLS_ERROR,C as appWorkspacePaths,B as assertSafeBranchName,d as checkWorkspaceGitAvailability,J as checkoutBranch,K as checkoutBranchAtPath,M as clearWorkspaceDiffCacheForTests,D as cloneWorkspace,H as createAndCheckoutBranch,I as createAndCheckoutBranchAtPath,A as expectedRemoteUrl,t as isGeneratedWorkspacePath,i as isGitRepo,c as isMacOSGitDeveloperToolsMissing,u as isVisibleGitWorkspaceFile,r as isWorkspaceDirectory,E as lastFetchAt,z as listPlainWorkspaceFiles,P as loadGitCommitDiffAtPath,N as loadWorkspaceDiff,O as loadWorkspaceDiffAtPath,Q as loadWorkspaceFile,T as loadWorkspaceFileAtPath,R as loadWorkspaceImageFile,S as loadWorkspaceImageFileAtPath,F as loadWorkspaceState,G as loadWorkspaceStateAtPath,n as localVideoContentType,L as mapWorkspaceDiffEntriesWithConcurrency,s as normalizeWorkspaceFilePath,w as parseBranchStatusLine,x as parseNumstat,v as parseStatusLine,h as pathExists,p as readLocalImageFile,q as readLocalVideoFile,l as readWorkspaceDocumentPreview,k as readWorkspaceFile,o as readWorkspaceImageFile,g as redactRemoteUrl,b as runWorkspaceCommand,f as sourceFromRemote,e as startMacOSCommandLineToolsInstall,j as truncatePatch,y as uniqueSortedPaths,m as workspaceImageContentType};
|
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
3
|
-
import{a as m,b as l}from"./chunks/chunk-BSHAIAXY.js";import"./chunks/chunk-XWPC3AN4.js";import"./chunks/chunk-GLUWATL5.js";import{b as u}from"./chunks/chunk-PZ2ZILPN.js";import{a as c,j as d}from"./chunks/chunk-E4U7LXSW.js";import{f as s}from"./chunks/chunk-3M53YXEI.js";import{a as t}from"./chunks/chunk-FTQLQJQV.js";function f(e){return!e.command&&s(e.options.version)?"version":s(e.options.checkUpdate)?"check-update":!e.command&&s(e.options.help)?"help":!e.command&&s(e.options.tui)?"tui":e.command?"command":"ui"}t(f,"resolveCliTopLevelAction");async function C(e=process.argv.slice(2)){if(await v(e))return;let{command:r,options:o,rest:i}=u(e);typeof o.home=="string"&&(process.env.OPENPOND_HOME=(await import("./chunks/dist-XCT2G25K.js")).resolveOpenPondHome({home:o.home}));let n=f({command:r,options:o});if(n==="version"){console.log(c());return}if(n==="check-update"){await(await import("./chunks/core-commands-Z5C7S6OH.js")).runCheckUpdate();return}if(n==="help"){(await import("./chunks/help-QDMTLEIL.js")).printHelp();return}let a=m(o),p=l(o);if(a&&(process.env.OPENPOND_ACCOUNT=a),p&&(process.env.OPENPOND_BASE_URL=p),n==="tui"){await(await import("./chunks/app-layer-HK2GTSRX.js")).runOpenPondTerminalCommand(o,i);return}if(n==="ui"){await(await import("./chunks/app-layer-HK2GTSRX.js")).runOpenPondServerCommand("web",o,i);return}await d({command:r,options:o,rest:i})||((await import("./chunks/help-QDMTLEIL.js")).printHelp(),process.exit(1))}t(C,"runOpenPondCli");async function v(e){if(e[0]==="__compile-hosted-profile")return await(await import("./chunks/hosted-profile-compiler-
|
|
3
|
+
import{a as m,b as l}from"./chunks/chunk-BSHAIAXY.js";import"./chunks/chunk-XWPC3AN4.js";import"./chunks/chunk-GLUWATL5.js";import{b as u}from"./chunks/chunk-PZ2ZILPN.js";import{a as c,j as d}from"./chunks/chunk-E4U7LXSW.js";import{f as s}from"./chunks/chunk-3M53YXEI.js";import{a as t}from"./chunks/chunk-FTQLQJQV.js";function f(e){return!e.command&&s(e.options.version)?"version":s(e.options.checkUpdate)?"check-update":!e.command&&s(e.options.help)?"help":!e.command&&s(e.options.tui)?"tui":e.command?"command":"ui"}t(f,"resolveCliTopLevelAction");async function C(e=process.argv.slice(2)){if(await v(e))return;let{command:r,options:o,rest:i}=u(e);typeof o.home=="string"&&(process.env.OPENPOND_HOME=(await import("./chunks/dist-XCT2G25K.js")).resolveOpenPondHome({home:o.home}));let n=f({command:r,options:o});if(n==="version"){console.log(c());return}if(n==="check-update"){await(await import("./chunks/core-commands-Z5C7S6OH.js")).runCheckUpdate();return}if(n==="help"){(await import("./chunks/help-QDMTLEIL.js")).printHelp();return}let a=m(o),p=l(o);if(a&&(process.env.OPENPOND_ACCOUNT=a),p&&(process.env.OPENPOND_BASE_URL=p),n==="tui"){await(await import("./chunks/app-layer-HK2GTSRX.js")).runOpenPondTerminalCommand(o,i);return}if(n==="ui"){await(await import("./chunks/app-layer-HK2GTSRX.js")).runOpenPondServerCommand("web",o,i);return}await d({command:r,options:o,rest:i})||((await import("./chunks/help-QDMTLEIL.js")).printHelp(),process.exit(1))}t(C,"runOpenPondCli");async function v(e){if(e[0]==="__compile-hosted-profile")return await(await import("./chunks/hosted-profile-compiler-7SGXUZB4.js")).runHostedProfileCompilerCli(e.slice(1)),!0;if(e[0]==="__app-server"){process.argv=[process.execPath,"openpond-app-server",...e.slice(1)];let[{createOpenPondAppServer:r},{runOpenPondAppServerCli:o}]=await Promise.all([import("./chunks/app-server-runtime-CAWXM33C.js"),import("./chunks/cli-YI6G22CQ.js")]);return await o(r),!0}if(e[0]==="__server"){process.argv=[process.execPath,"openpond-server",...e.slice(1)];let[{createOpenPondServer:r},{runOpenPondServerCli:o}]=await Promise.all([import("./chunks/src-ZGGKHNNF.js"),import("./chunks/cli-YI6G22CQ.js")]),{createOpenPondAppServer:i}=await import("./chunks/app-server-runtime-CAWXM33C.js");return await o({createOpenPondServer:r,createOpenPondAppServer:i}),!0}return e[0]==="__terminal"?(await(await import("./chunks/src-42VXY5DZ.js")).runOpenPondTerminalCli(e.slice(1)),!0):!1}t(v,"runEmbeddedCompanion");C().catch(e=>{let r=e instanceof Error?e.message:String(e),o=e.issue;if(process.argv.includes("--json")&&!(e instanceof Error&&e.name==="OpenPondChildProcessExitError"))console.log(JSON.stringify({error:o??{code:"CLI_ERROR",message:r}}));else if(o&&typeof o=="object"){let n=o;console.error(`${n.code}: ${n.message}
|
|
4
4
|
${n.path}
|
|
5
5
|
${n.action}`)}else console.error(r);let i=typeof e.exitCode=="number"?e.exitCode:1;process.exit(i)});export{C as runOpenPondCli};
|