openpond 0.2.36 → 0.2.37
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.d.ts +189 -3
- package/dist/app-server.js +1 -1
- package/dist/chunks/actions-command-GNQREIDD.js +2 -0
- package/dist/chunks/{app-layer-KPPQSL67.js → app-layer-BDAKS3DG.js} +1 -1
- package/dist/chunks/app-server-runtime-D74FFS27.js +2 -0
- package/dist/chunks/apps-2SUP5JZE.js +2 -0
- package/dist/chunks/chunk-2O5UZOYL.js +13 -0
- package/dist/chunks/{chunk-Q2Z27DCK.js → chunk-3I5BMVJI.js} +1 -1
- package/dist/chunks/{chunk-P3DI3ZMK.js → chunk-3LG4G5JR.js} +2 -2
- package/dist/chunks/{chunk-4QX2I2DX.js → chunk-3N4GQL6I.js} +1 -1
- package/dist/chunks/{chunk-DR3XPQRZ.js → chunk-3YA2CD22.js} +1 -1
- package/dist/chunks/{chunk-EFTLCT7C.js → chunk-4R4KM6LL.js} +1 -1
- package/dist/chunks/{chunk-MXLB6MEW.js → chunk-5YUITAUN.js} +1 -1
- package/dist/chunks/{chunk-QPZNN5Q3.js → chunk-6EAQL7YX.js} +1 -1
- package/dist/chunks/{chunk-DJHJIXMW.js → chunk-BLXEK5F7.js} +1 -1
- package/dist/chunks/{chunk-BFHAJTU4.js → chunk-DAOLQUAK.js} +1 -1
- package/dist/chunks/{chunk-ZF6OAPTQ.js → chunk-DG4DIFF4.js} +1 -1
- package/dist/chunks/{chunk-SHWLRMDG.js → chunk-DXOOJFFU.js} +1 -1
- package/dist/chunks/chunk-EIB7GHIQ.js +4 -0
- package/dist/chunks/{chunk-XCTFXXVY.js → chunk-FFEI7IRU.js} +1 -1
- package/dist/chunks/chunk-FOW3LI6G.js +2 -0
- package/dist/chunks/{chunk-VRY5TEEF.js → chunk-FQOVC2GR.js} +78 -78
- package/dist/chunks/chunk-HZP5U2AA.js +3 -0
- package/dist/chunks/chunk-I6DQSOSF.js +12 -0
- package/dist/chunks/chunk-IYROEHYB.js +2 -0
- package/dist/chunks/{chunk-LL3ZAZEU.js → chunk-KCFVJDIV.js} +1 -1
- package/dist/chunks/chunk-L6NNQUAT.js +53 -0
- package/dist/chunks/chunk-OO7JG7KM.js +42 -0
- package/dist/chunks/chunk-PKBU37CH.js +5 -0
- package/dist/chunks/chunk-QUNRWDVO.js +155 -0
- package/dist/chunks/{chunk-34URWDE7.js → chunk-S4RSY6CR.js} +1 -1
- package/dist/chunks/{chunk-5WFHGIQB.js → chunk-SL7XLTIT.js} +199 -199
- package/dist/chunks/{chunk-CL6YPTWP.js → chunk-TZ6N7WFI.js} +1 -1
- package/dist/chunks/{chunk-Z6F6PYF4.js → chunk-UJLZRM2M.js} +1 -1
- package/dist/chunks/chunk-XISNUB62.js +2 -0
- package/dist/chunks/{chunk-FIFGH6W3.js → chunk-XLVFY2BA.js} +1 -1
- package/dist/chunks/{chunk-K6EGNB2A.js → chunk-YQPECTJ2.js} +1 -1
- package/dist/chunks/{chunk-YZ262JZT.js → chunk-Z3RBK6LN.js} +1 -1
- package/dist/chunks/cli-A2P56J7R.js +2 -0
- package/dist/chunks/configuration-command-URDRLDNY.js +2 -0
- package/dist/chunks/core-commands-CMAAUKPQ.js +2 -0
- package/dist/chunks/desktop-test-5PKGG6H6.js +3 -0
- package/dist/chunks/dist-CEKBK32A.js +2 -0
- package/dist/chunks/dist-GKCGK44T.js +2 -0
- package/dist/chunks/{extension-LG3JL5QD.js → extension-DG2XISC6.js} +1 -1
- package/dist/chunks/{help-XP73IYAV.js → help-ZLJV3ZVW.js} +1 -1
- package/dist/chunks/hosted-harness-runtime-ABEMAABI.js +2 -0
- package/dist/chunks/hosted-profile-compiler-CSLJT75T.js +3 -0
- package/dist/chunks/{opchat-5NQ22CPO.js → opchat-IMGIFM4W.js} +1 -1
- package/dist/chunks/organizations-G3UOHURO.js +2 -0
- package/dist/chunks/{profile-O7NIC76F.js → profile-LMRN5QMQ.js} +1 -1
- package/dist/chunks/project-agent-DTAVYEB6.js +2 -0
- package/dist/chunks/sandbox-command-YO6RR5SD.js +2 -0
- package/dist/chunks/{sandbox-template-H5M4NV2F.js → sandbox-template-LN5OQ55F.js} +1 -1
- package/dist/chunks/{src-WN3RDFPF.js → src-A5KEQW52.js} +1 -1
- package/dist/chunks/{src-BITVDQDA.js → src-LRJO4THC.js} +1 -1
- package/dist/chunks/{teams-bot-RPZVD4UD.js → teams-bot-RY5M6AOW.js} +1 -1
- package/dist/chunks/{workspaces-XMU4772P.js → workspaces-KZ6ZJXXY.js} +1 -1
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/actions-command-U2DMVGDS.js +0 -2
- package/dist/chunks/app-server-runtime-ELR3VCKR.js +0 -2
- package/dist/chunks/apps-NBV45ZGW.js +0 -2
- package/dist/chunks/chunk-IFP6W4OW.js +0 -54
- package/dist/chunks/chunk-JB6FTAMW.js +0 -2
- package/dist/chunks/chunk-L67V63N3.js +0 -2
- package/dist/chunks/chunk-MPNHNWN6.js +0 -15
- package/dist/chunks/chunk-PBRD43CI.js +0 -42
- package/dist/chunks/chunk-RC3JXLP7.js +0 -4
- package/dist/chunks/chunk-VVKE6EYN.js +0 -166
- package/dist/chunks/cli-EG7K37TB.js +0 -2
- package/dist/chunks/configuration-command-MSDFCKOT.js +0 -2
- package/dist/chunks/core-commands-WDHXJPCY.js +0 -2
- package/dist/chunks/desktop-test-SN4BHDV3.js +0 -3
- package/dist/chunks/dist-XCT2G25K.js +0 -2
- package/dist/chunks/hosted-profile-compiler-HQ6T6NDP.js +0 -3
- package/dist/chunks/organizations-AY52SHI4.js +0 -2
- package/dist/chunks/project-agent-UKGWIFFI.js +0 -2
- package/dist/chunks/sandbox-command-WL6DAJTO.js +0 -2
|
@@ -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-PBRD43CI.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-5WFHGIQB.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-Q2Z27DCK.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-MPNHNWN6.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-VRY5TEEF.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-YZ262JZT.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-SHWLRMDG.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-DJHJIXMW.js";import{a as uI,h as HI,k as OI}from"./chunk-L67V63N3.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-BFHAJTU4.js";import"./chunk-6MI4KKWF.js";import{$ as XS,$b as jn,Ab as fI,Ac as Rl,Bb as gI,Bc as Pl,Cb as hI,Cc as _l,D as NS,Db as bl,Dc as TI,E as wl,Eb as Pg,Ec as _g,Fa as nI,Fb as wI,Fc as AI,Gb as yI,H as bg,Hb as vI,Hc as CI,I as US,Ic as EI,J as FS,Jc as MI,K as qS,Kc as eo,L as yl,Lc as jI,M as zS,Mb as kI,Mc as or,N as WS,O as VS,Ob as os,P as JS,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,wa as rs,xc as ss,yb as pI,yc as _I,zb as mI,zc as xI}from"./chunk-ZF6OAPTQ.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-JB6FTAMW.js";import"./chunk-MJC26GOX.js";import{$a as dl,Da as z2,Ea as tS,Fa as yg,Ga as vg,Ia as nS,Mb as Je,Nb as Vt,Pa as rS,S as il,Ta as oS,Tb as iS,Ua as aS,a as nn,ac as cS,cc as dS,ib as sS,qa as Qb,ra as cl,ta as Zb,wa as eS}from"./chunk-VVKE6EYN.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-OO7JG7KM.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-SL7XLTIT.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-3I5BMVJI.js";import{a as ct,b as q_,c as z_,d as J_,f as nh,g as PT,h as fu,i as gu,j as _T}from"./chunk-XISNUB62.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-DXOOJFFU.js";import{e as V_,f as tu,g as nu,h as hs}from"./chunk-I6DQSOSF.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,i as RS,ia as B_,j as PS,k as _S,l as xS,na as $_,t as I_,u as R_,v as P_,w as __,x as x_,y as T_,z as Ql}from"./chunk-FQOVC2GR.js";import{d as W_}from"./chunk-PKBU37CH.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-Z3RBK6LN.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-BLXEK5F7.js";import{a as uI,h as HI,k as OI}from"./chunk-FOW3LI6G.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-DAOLQUAK.js";import"./chunk-6MI4KKWF.js";import{$ as XS,$b as jn,Ab as fI,Ac as Rl,Bb as gI,Bc as Pl,Cb as hI,Cc as _l,D as NS,Db as bl,Dc as TI,E as wl,Eb as Pg,Ec as _g,Fa as nI,Fb as wI,Fc as AI,Gb as yI,H as bg,Hb as vI,Hc as CI,I as US,Ic as EI,J as FS,Jc as MI,K as qS,Kc as eo,L as yl,Lc as jI,M as zS,Mb as kI,Mc as or,N as WS,O as VS,Ob as os,P as JS,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,wa as rs,xc as ss,yb as pI,yc as _I,zb as mI,zc as xI}from"./chunk-DG4DIFF4.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-IYROEHYB.js";import"./chunk-MJC26GOX.js";import{C as sS,a as nn,ea as Je,fa as Vt,h as rS,l as oS,la as iS,m as aS,t as dl,ua as cS,wa as dS}from"./chunk-2O5UZOYL.js";import{Da as z2,Ea as tS,Fa as yg,Ga as vg,Ia as nS,R as il,pa as Qb,qa as cl,sa as Zb,wa as eS}from"./chunk-QUNRWDVO.js";import{a as Zi}from"./chunk-6FA3GG5B.js";import{$a as Fo,Ca as Vb,Ea as hg,F as gg,Fa as wg,Ga as Jb,N as Db,R as Xr,T as Bb,Ta as al,Ua as Gb,V as $b,W as Lb,X as Nb,Ya as Kb,Za as Yb,ab as Xb,bb as sl,f as Qd,k as Lo,l as Tb,m as Xi,n as Rr,o as nl,p as Ab,pa as Qr,q as rl,r as Cb,ra as No,s as es,u as Eb,v as Mb,w as jb,wa as Ub,x as Hb,xa as Fb,y as Ob,ya as zb,za as Wb}from"./chunk-L6NNQUAT.js";import{a as Qa,b as Za,c as mg,d as Zd,e as st,f as fg,g as el,j as We,k as Se,l as O,m as _b,o as xb,p as tl,q as Ct}from"./chunk-HZP5U2AA.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,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{m as f}from"./chunk-
|
|
2
|
+
import{m as f}from"./chunk-5YUITAUN.js";import"./chunk-FFEI7IRU.js";import"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import"./chunk-OGPHXXCD.js";import"./chunk-TZ6N7WFI.js";import"./chunk-UJLZRM2M.js";import"./chunk-6EAQL7YX.js";import"./chunk-GLUWATL5.js";import"./chunk-IYROEHYB.js";import"./chunk-MJC26GOX.js";import"./chunk-2O5UZOYL.js";import"./chunk-QUNRWDVO.js";import"./chunk-XLVFY2BA.js";import"./chunk-L6NNQUAT.js";import"./chunk-HZP5U2AA.js";import"./chunk-ES2ISFJC.js";import"./chunk-H7IWJN7L.js";import"./chunk-3LG4G5JR.js";import{a as g,c as a,d}from"./chunk-3M53YXEI.js";import{a as s}from"./chunk-FTQLQJQV.js";function c(){return["usage: teams-bot <overview|bind|rebind|diagnostics|diagnostic-run>"," teams-bot overview --team-id <id>"," teams-bot bind --team-id <id> --token <token> [--project-id <id>] [--agent-id <id>] [--microsoft-connection-id <id>]"," teams-bot rebind <bindingId> --team-id <id> [--project-id <id>] [--agent-id <id>] [--microsoft-connection-id <id>]"," teams-bot diagnostics <bindingId> --team-id <id>"," teams-bot diagnostic-run <bindingId> --team-id <id> --prompt <text> [--attachments-json <json-array>] [--action-input-json <json-object>]"].join(`
|
|
3
3
|
`)}s(c,"usage");function u(n,o){if(!(o in n))return;let t=a(n,o);return!t||t==="null"||t==="none"?null:t}s(u,"nullableOption");function b(n){let o=d(n,"usage: teams-bot rebind <bindingId>"),t=u(n,"sandboxId"),r=u(n,"projectId"),i=u(n,"agentId"),e=u(n,"microsoftConnectionId");return{teamId:o,...t!==void 0?{sandboxId:t}:{},...r!==void 0?{projectId:r}:{},...i!==void 0?{agentId:i}:{},...e!==void 0?{microsoftConnectionId:e}:{}}}s(b,"bindingTargetInput");function l(n){let o=a(n,"attachmentsJson");if(!o)return;let t=g(o,"attachments-json");if(!Array.isArray(t))throw new Error("attachments-json must be a JSON array");for(let r of t)if(!r||typeof r!="object"||Array.isArray(r))throw new Error("attachments-json entries must be JSON objects");return t}s(l,"attachmentsInput");function w(n){let o=a(n,"actionInputJson");if(!o)return;let t=g(o,"action-input-json");if(!t||typeof t!="object"||Array.isArray(t))throw new Error("action-input-json must be a JSON object");return t}s(w,"actionInput");async function j(n,o){let t=o[0]||"overview",r=await f(n);if(t==="overview"){let i=d(n,"usage: teams-bot overview");console.log(JSON.stringify(await r.getMicrosoftTeamsBotOverview({teamId:i}),null,2));return}if(t==="bind"){let i=a(n,"token");if(!i)throw new Error(c());let e=await r.bindMicrosoftTeamsBotConversation({...b(n),token:i});console.log(JSON.stringify(e,null,2));return}if(t==="rebind"){let i=o[1]?.trim();if(!i)throw new Error(c());let e=await r.rebindMicrosoftTeamsBotConversation(i,b(n));console.log(JSON.stringify(e,null,2));return}if(t==="diagnostics"){let i=o[1]?.trim(),e=d(n,"usage: teams-bot diagnostics <bindingId>");if(!i)throw new Error(c());console.log(JSON.stringify(await r.sendMicrosoftTeamsBotDiagnostic({teamId:e,bindingId:i}),null,2));return}if(t==="diagnostic-run"){let i=o[1]?.trim(),e=d(n,"usage: teams-bot diagnostic-run <bindingId>"),m=a(n,"prompt");if(!i||!m)throw new Error(c());console.log(JSON.stringify(await r.sendMicrosoftTeamsBotDiagnosticRun({teamId:e,bindingId:i,prompt:m,attachments:l(n),actionInput:w(n)}),null,2));return}throw new Error(c())}s(j,"runTeamsBotCommand");export{j as runTeamsBotCommand};
|
|
@@ -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-3I5BMVJI.js";import"./chunk-Z3RBK6LN.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-
|
|
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-XLVFY2BA.js";import{a as c,j as d}from"./chunks/chunk-3LG4G5JR.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-CEKBK32A.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-CMAAUKPQ.js")).runCheckUpdate();return}if(n==="help"){(await import("./chunks/help-ZLJV3ZVW.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-BDAKS3DG.js")).runOpenPondTerminalCommand(o,i);return}if(n==="ui"){await(await import("./chunks/app-layer-BDAKS3DG.js")).runOpenPondServerCommand("web",o,i);return}await d({command:r,options:o,rest:i})||((await import("./chunks/help-ZLJV3ZVW.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-CSLJT75T.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-D74FFS27.js"),import("./chunks/cli-A2P56J7R.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-LRJO4THC.js"),import("./chunks/cli-A2P56J7R.js")]),{createOpenPondAppServer:i}=await import("./chunks/app-server-runtime-D74FFS27.js");return await o({createOpenPondServer:r,createOpenPondAppServer:i}),!0}return e[0]==="__terminal"?(await(await import("./chunks/src-A5KEQW52.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};
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import"./chunks/chunk-X37KMV27.js";import{a as Er,b as Fr,c as Gr,d as Hr,e as Ir,f as Jr,g as Kr,h as Lr,i as Mr,j as Nr,k as Or,l as Pr}from"./chunks/chunk-
|
|
2
|
+
import"./chunks/chunk-X37KMV27.js";import{a as Er,b as Fr,c as Gr,d as Hr,e as Ir,f as Jr,g as Kr,h as Lr,i as Mr,j as Nr,k as Or,l as Pr}from"./chunks/chunk-3N4GQL6I.js";import{a as kr,b as lr,c as nr}from"./chunks/chunk-22UARBPW.js";import{a as qr,b as sr,c as ur,d as vr,e as wr,f as yr,g as zr,h as Ar,i as Br,j as Cr,k as Dr}from"./chunks/chunk-JEVA7YQL.js";import{A as Mo,B as No,C as Oo,D as Po,E as Qo,F as Ro,G as So,H as To,I as Uo,J as Vo,K as Wo,b as ho,c as io,d as jo,e as ko,f as lo,g as no,h as qo,i as so,j as uo,k as vo,l as wo,m as yo,n as zo,o as Ao,p as Bo,q as Co,r as Do,s as Eo,t as Fo,u as Go,v as Ho,w as Io,x as Jo,y as Ko,z as Lo}from"./chunks/chunk-YQPECTJ2.js";import"./chunks/chunk-3YA2CD22.js";import"./chunks/chunk-OGPHXXCD.js";import"./chunks/chunk-TZ6N7WFI.js";import{$ as go,A as D,B as E,C as F,D as G,E as H,F as I,G as J,H as K,I as L,J as M,K as N,L as O,M as P,N as Q,O as R,P as S,Q as T,U,V,W as fo,X as mo,Y as po,Z as to,_ as xo,a as o,b as p,c as t,d as x,e as a,f as b,g as c,h as d,i as g,j as h,k as i,l as j,n as k,o as l,p as n,q,r as s,s as u,t as v,u as w,v as y,w as z,x as A,y as B,z as C}from"./chunks/chunk-UJLZRM2M.js";import{a as W,b as X,c as Y,d as Z,e as _,f as $,g as oo,h as ro,i as eo}from"./chunks/chunk-6EAQL7YX.js";import{a as r,b as e,c as f,d as m}from"./chunks/chunk-GLUWATL5.js";import"./chunks/chunk-IYROEHYB.js";import{f as ao,g as bo,h as co}from"./chunks/chunk-MJC26GOX.js";import"./chunks/chunk-2O5UZOYL.js";import"./chunks/chunk-QUNRWDVO.js";import"./chunks/chunk-3A7HZJNE.js";import{a as Xo,b as Yo,c as Zo,d as _o,e as $o,f as or,g as rr,h as er,i as fr,j as mr,k as pr,l as tr,m as xr,n as ar,o as br,p as cr,q as dr,r as gr,s as hr,t as ir,u as jr}from"./chunks/chunk-EAPFMACH.js";import"./chunks/chunk-6FA3GG5B.js";import"./chunks/chunk-L6NNQUAT.js";import"./chunks/chunk-HZP5U2AA.js";import"./chunks/chunk-ES2ISFJC.js";import"./chunks/chunk-H7IWJN7L.js";import"./chunks/chunk-FTQLQJQV.js";export{fo as DEFAULT_CACHE_TTL_MS,yo as DEFAULT_LOCAL_PROFILE,e as DEFAULT_OPENPOND_API_BASE_URL,m as DEFAULT_OPENPOND_CHAT_API_BASE_URL,f as DEFAULT_OPENPOND_OPCHAT_API_BASE_URL,r as DEFAULT_OPENPOND_WEB_BASE_URL,zo as DEFAULT_PROFILE_AGENT,Zo as OPENPOND_MANIFEST_FILE_NAME,ho as OpenPondProfileSetupRequiredError,bo as OpenPondSandboxClient,wo as PROFILE_MANIFEST,vo as PROFILE_REPO_MANIFEST,go as SANDBOX_RUNTIME_PROFILE_IDS,_o as SANDBOX_TEMPLATE_BUILD_PLAN_FILE_NAME,$o as SANDBOX_TEMPLATE_BUILD_PLAN_KIND,Yo as SANDBOX_TEMPLATE_PREVIEW_PORT_MAX,Xo as SANDBOX_TEMPLATE_PREVIEW_PORT_MIN,or as SandboxTemplateManifestSchema,rr as SandboxTemplateValidationDiagnosticSchema,o as apiFetch,jo as assertOpenPondProfileActionReady,io as buildOpenPondProfileSetupGate,Q as checkOpenPondApiHealth,lo as collectProfileSourceUploadEntries,Uo as commitActiveProfileChanges,p as commitFiles,Nr as computeAtr,Lr as computeBollinger,Ir as computeEma,Hr as computeEmaSeries,Kr as computeMaCross,Jr as computeMacd,Mr as computePriceChange,Er as computeRsi,Gr as computeSma,Fr as computeSmaSeries,Or as consumeAgentCreateStream,lr as consumeStream,M as createAgentFromPrompt,Pr as createClient,k as createHeadlessApps,i as createLocalProject,co as createOpenPondSandboxClient,j as createRepo,Co as defaultLocalProfileRepoPath,tr as defineSandboxTemplate,H as deleteOrArchiveSchedule,t as deployApp,q as deployLatestTemplate,Do as emptyProfileState,V as executeHostedTool,T as executeUserTool,v as fetchToolManifest,ko as formatOpenPondProfileSetupRequirement,pr as formatSandboxTemplateDiagnostics,nr as formatStreamItem,u as getAppEnvironment,L as getAppExecutionTimeline,O as getAppRuntimeSummary,mo as getCachedApps,to as getCachedTools,W as getConfigPath,g as getDeploymentDetail,b as getDeploymentLogs,c as getDeploymentStatus,d as getLatestDeploymentForApp,vr as getOpChatModel,zr as getOpChatProvider,P as getOpenPondAccount,B as getOpenToolRecipe,C as getOpenToolRules,K as getScheduleExecutionLog,l as getTemplateStatus,N as getUserPerformance,qo as hostedPublishStatusFromPayload,uo as hostedRunStatusFromRunSummary,so as hostedRunSummaryFromPayload,no as hostedSourceCheckStatusFromPayload,Eo as initLocalProfileRepo,Io as installAgentPackageIntoActiveProfile,y as listAppSchedules,h as listApps,_ as listConfiguredProfiles,J as listDeploymentScheduleExecutionLogs,wr as listHostedModels,Ar as listHostedProviders,ur as listOpChatModels,yr as listOpChatProviders,z as listOpenToolRecipes,I as listScheduleExecutionLogs,n as listTemplateBranches,w as listUserTools,Z as loadConfig,Y as loadGlobalConfig,Fo as loadLocalProfileRepo,Lo as loadOpenPondProfileLibrary,Jo as loadOpenPondProfileState,Mo as loadOpenPondProfileStateForRef,Po as loadOpenPondProfileStateFromSource,Bo as mergeActiveLocalProfileConfig,Ao as mergeProfileRepoManifestEntry,kr as normalizeDataFrames,ao as normalizeSandboxApiUrl,Ko as openPondProfileRef,mr as parseSandboxTemplateYaml,S as postAgentDigest,Wo as prepareAgentSdkRuntimePackage,x as promotePreviewToProduction,Go as registerLocalProfileRepo,Oo as removeOpenPondProfile,Ho as renameActiveProfileAgent,Qo as requireActiveLocalProfile,sr as resolveHostedChatApiBaseUrl,qr as resolveOpChatApiBaseUrl,U as resolveWorkerBaseUrl,So as runAgentSdkProjectCommand,R as runAssistantMode,Dr as runOpChatSmoke,To as runProfileCheck,Ro as runProfileSdkCommand,G as runScheduleNow,gr as sandboxTemplateBuildMetadata,hr as sandboxTemplateBuildPlan,ar as sandboxTemplateDurableVolume,dr as sandboxTemplateExecutableEntries,cr as sandboxTemplateFileInput,jr as sandboxTemplateJsonSchema,br as sandboxTemplatePreviewPort,xr as sandboxTemplateResources,ir as sandboxTemplateScaffoldFiles,ro as saveConfig,eo as saveGlobalConfig,oo as saveProfileApiKey,Vo as saveProfilePushStatus,A as searchOpenToolRecipes,No as selectOpenPondProfile,Br as sendHostedChatTurn,$ as setActiveProfile,po as setCachedApps,xo as setCachedTools,a as startAppLifecycle,D as startAppSchedules,E as stopAppSchedules,F as stopCurrentAppSchedules,Cr as streamHostedChatTurn,s as updateAppEnvironment,X as updateGlobalConfig,fr as validateSandboxTemplateManifest,er as validateSandboxTemplateYaml};
|
package/package.json
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as v}from"./chunk-XCTFXXVY.js";import"./chunk-XWPC3AN4.js";import{b as R,c as p,d as m}from"./chunk-XEOEKFG6.js";import{a as O}from"./chunk-CL6YPTWP.js";import{d as P}from"./chunk-QPZNN5Q3.js";import"./chunk-GLUWATL5.js";import"./chunk-JB6FTAMW.js";import"./chunk-MJC26GOX.js";import"./chunk-VVKE6EYN.js";import"./chunk-IFP6W4OW.js";import"./chunk-ES2ISFJC.js";import"./chunk-H7IWJN7L.js";import{f as b}from"./chunk-3M53YXEI.js";import{a as c}from"./chunk-FTQLQJQV.js";import{promises as $,watch as C}from"node:fs";import y from"node:path";import{execFile as J}from"node:child_process";import{promisify as k}from"node:util";var K=k(J);async function G(t,n){let e=n[0]??"check",o=y.resolve(i(t,"cwd")??process.cwd()),l=i(t,"sourceDirectory"),u=i(t,"outputDirectory"),d=b(t.json);if(e==="check"||e==="build"){let r=await p({projectRoot:o,sourceDirectory:l,outputDirectory:u});if(d){console.log(JSON.stringify({status:"passed",actionCount:r.registry.actions.length,registry:r.registry,manifest:r.manifest,outputDirectory:r.outputDirectory},null,2));return}console.log(`${e==="check"?"Validated":"Built"} ${r.registry.actions.length} Project Action${r.registry.actions.length===1?"":"s"}.`),console.log(`Registry: ${r.registryPath}`),console.log(`Bundle: ${r.bundlePath}`);return}if(e==="run"){let r=n[1];if(!r)throw new Error("usage: openpond actions run <action-id> [--input JSON|--input-file PATH]");let a=await m({projectRoot:o,sourceDirectory:l,outputDirectory:u,build:"always"}).run({actionId:r,input:await I(t,o),timeoutMs:A(t,"timeoutMs")});console.log(JSON.stringify(a,null,2));return}if(e==="dev"){let r=n[1]??null;await _({projectRoot:o,sourceDirectory:l,outputDirectory:u,actionId:r,options:t,json:d});return}if(e==="publish"){let r=j(t,"projectId"),s=j(t,"teamId"),a=i(t,"apiKey"),w=process.env.OPENPOND_API_KEY?.trim()||null,g=a||w?null:await P({account:i(t,"account")}),h=a??w??(g?v(g):null);if(!h)throw new Error("OpenPond API key is required. Select a saved OpenPond account, set OPENPOND_API_KEY, or pass --api-key.");let N=await p({projectRoot:o,sourceDirectory:l,outputDirectory:u}),E=i(t,"sourceCommitSha")??await D(o,["rev-parse","HEAD"]),S=i(t,"sourceRef")??await D(o,["rev-parse","--abbrev-ref","HEAD"]),f=await O({apiKey:h,baseUrl:i(t,"baseUrl")??(process.env.OPENPOND_API_URL?.trim()||g?.apiBaseUrl)}).actions.publish({projectId:r,teamId:s,sourceRef:S,sourceCommitSha:E,build:N});console.log(d?JSON.stringify({release:f},null,2):`Published Project Actions release ${f.id} from ${f.sourceCommitSha}.`);return}throw new Error("usage: openpond actions <check|build|run|dev|publish> [action-id]")}c(G,"runProjectActionsCommand");async function _(t){let n=!1,e=!1,o=c(async()=>{if(n){e=!0;return}n=!0;try{let r=m({projectRoot:t.projectRoot,sourceDirectory:t.sourceDirectory,outputDirectory:t.outputDirectory,build:"always"});if(t.actionId){let s=await r.run({actionId:t.actionId,input:await I(t.options,t.projectRoot),timeoutMs:A(t.options,"timeoutMs")});console.log(JSON.stringify(s,null,2))}else{let s=await r.build(),a={status:"ready",actionCount:s.registry.actions.length,bundleHash:s.manifest.bundleHash};console.log(t.json?JSON.stringify(a):`Ready with ${a.actionCount} Project Action${a.actionCount===1?"":"s"}.`)}}catch(r){console.error(r instanceof Error?r.message:String(r))}finally{n=!1,e&&(e=!1,await o())}},"execute");await o();let l=await R(t.projectRoot),u=y.resolve(t.projectRoot,t.sourceDirectory??l.sourceDirectory??"openpond/actions");console.log(`Watching ${u}`);let d=C(u,{recursive:!0},()=>{setTimeout(()=>{o()},50)});await new Promise(r=>{let s=c(()=>{d.close(),r()},"stop");process.once("SIGINT",s),process.once("SIGTERM",s)})}c(_,"runDev");async function I(t,n){let e=i(t,"input"),o=i(t,"inputFile");if(e&&o)throw new Error("Use either --input or --input-file, not both.");return e?JSON.parse(e):o?JSON.parse(await $.readFile(y.resolve(n,o),"utf8")):{}}c(I,"actionInput");function i(t,n){let e=t[n];return typeof e=="string"&&e.trim()?e.trim():void 0}c(i,"stringOption");function j(t,n){let e=i(t,n);if(!e)throw new Error(`--${n.replace(/[A-Z]/g,o=>`-${o.toLowerCase()}`)} is required.`);return e}c(j,"requiredOption");async function D(t,n){let{stdout:e}=await K("git",n,{cwd:t}),o=e.trim();if(!o)throw new Error(`git ${n.join(" ")} returned no value.`);return o}c(D,"gitValue");function A(t,n){let e=i(t,n);if(e===void 0)return;let o=Number(e);if(!Number.isInteger(o)||o<=0)throw new Error(`--${n} must be a positive integer.`);return o}c(A,"integerOption");export{G as runProjectActionsCommand};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{Gc as c,Hc as d}from"./chunk-5WFHGIQB.js";import"./chunk-Q2Z27DCK.js";import{I as b,j as a}from"./chunk-MPNHNWN6.js";import"./chunk-VRY5TEEF.js";import"./chunk-YZ262JZT.js";import"./chunk-SHWLRMDG.js";import"./chunk-DJHJIXMW.js";import"./chunk-L67V63N3.js";import"./chunk-L3KS6MOV.js";import"./chunk-XEOEKFG6.js";import"./chunk-BFHAJTU4.js";import"./chunk-6MI4KKWF.js";import"./chunk-ZF6OAPTQ.js";import"./chunk-SDO4FC4Q.js";import"./chunk-IR3YJWPW.js";import"./chunk-JB6FTAMW.js";import"./chunk-MJC26GOX.js";import"./chunk-VVKE6EYN.js";import"./chunk-6FA3GG5B.js";import"./chunk-IFP6W4OW.js";import"./chunk-ES2ISFJC.js";import"./chunk-H7IWJN7L.js";import"./chunk-FTQLQJQV.js";export{a as AGENT_PROTOCOL_VERSION,c as APP_SERVER_COMPOSITION,d as createOpenPondAppServer,b as runAppServerJsonl};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{f as $,g as J,h as L,i as v,j as q}from"./chunk-MXLB6MEW.js";import{c as g}from"./chunk-XCTFXXVY.js";import{f as m,h as y}from"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import{b as H,c as Q}from"./chunk-22UARBPW.js";import"./chunk-OGPHXXCD.js";import"./chunk-CL6YPTWP.js";import{J as C,K as G,L as k,O as W,Q as M,S as z,T as F,c as D,m as K,r as V,s as _}from"./chunk-Z6F6PYF4.js";import{d as f}from"./chunk-QPZNN5Q3.js";import"./chunk-GLUWATL5.js";import"./chunk-JB6FTAMW.js";import"./chunk-MJC26GOX.js";import"./chunk-VVKE6EYN.js";import"./chunk-FIFGH6W3.js";import"./chunk-IFP6W4OW.js";import"./chunk-ES2ISFJC.js";import"./chunk-H7IWJN7L.js";import"./chunk-P3DI3ZMK.js";import{a as S,f as w,j as T,k as j}from"./chunk-3M53YXEI.js";import{a as p}from"./chunk-FTQLQJQV.js";async function ie(){let e=await f(),s=m(e),t=await g(e,s),n=y(e),r=await L({apiBase:n,apiKey:t});console.log(JSON.stringify(r,null,2))}p(ie,"runAppsTools");async function se(e){let s=await f(),t=m(s),n=y(s),r=await g(s,t),i=typeof e.handle=="string"?String(e.handle):void 0,o=i?$(i):null,c=e.refresh!==void 0?w(e.refresh):void 0,l=await J({apiBase:n,apiKey:r,forceRefresh:c}),u=o?l.filter(a=>$(a.handle||a.gitOwner)===o):l;if(u.length===0){console.log("no apps found");return}if(w(e.json)){console.log(JSON.stringify({apps:u},null,2));return}for(let a of u){let d=a.handle||a.gitOwner||"unknown",h=a.repo||a.gitRepo||a.id,B=a.latestDeployment?.status||"no-deploy",R=a.latestDeployment?.gitBranch||a.defaultBranch||"-",I=a.codeVisibility||"unknown",E=a.sandbox?"yes":"no";console.log(`${d}/${h} ${B} ${R} code=${I} sandbox=${E} ${a.id}`)}}p(se,"runAppsList");async function oe(e,s){let t=typeof e.visibility=="string"?e.visibility.trim():typeof e.codeVisibility=="string"?e.codeVisibility.trim():"";if(t!=="public"&&t!=="private")throw new Error("usage: apps code-visibility <handle>/<repo> --visibility public|private");let n=await f(),r=m(n),i=y(n),o=await g(n,r),{app:c,handle:l,repo:u}=await v(i,o,s),a=await K(i,o,c.id,t);console.log(`${l}/${u} code_visibility=${a.app?.codeVisibility??t} app_id=${c.id}`)}p(oe,"runAppsCodeVisibility");async function ae(e){let s=await f(),t=m(s),n=await g(s,t),r=y(s),i=typeof e.appId=="string"?String(e.appId):void 0,o=await G(r,n,{appId:i});console.log(JSON.stringify(o,null,2))}p(ae,"runAppsPerformance");async function ce(e,s){let t=await f(),n=m(t),r=y(t),i=await g(t,n),{app:o}=await v(r,i,s),c=await k(r,i,o.id);console.log(JSON.stringify(c,null,2))}p(ce,"runAppsSummary");async function le(e,s,t,n){let r=(typeof e.prompt=="string"?e.prompt:null)||n.join(" ");if(!r.trim())throw new Error("usage: apps assistant <plan|performance> <handle>/<repo> --prompt <text>");let i=await f(),o=m(i),c=y(i),l=await g(i,o),{app:u}=await v(c,l,t),a=await W(c,l,{appId:u.id,mode:s,prompt:r.trim()});console.log(JSON.stringify(a,null,2))}p(le,"runAppsAssistant");async function de(e,s){let t=await f(),n=m(t),r=await g(t,n),i=y(t),o=(typeof e.prompt=="string"?e.prompt:null)||s.join(" ");if(!o.trim())throw new Error("usage: apps agent create --prompt <text> [--team-id <id>]");let c=typeof e.templateRepoUrl=="string"?e.templateRepoUrl:void 0,l=typeof e.templateBranch=="string"?e.templateBranch:void 0,u=typeof e.templateLocalPath=="string"?e.templateLocalPath:void 0,a=typeof e.teamId=="string"&&e.teamId.trim()?e.teamId.trim():void 0;if(u&&String(u).trim().length>0)throw new Error("templateLocalPath is not supported; use templateRepoUrl");let d=typeof e.env=="string"?S(e.env,"env"):void 0;if(d){if(typeof d!="object"||Array.isArray(d))throw new Error("env must be a JSON object");for(let[b,A]of Object.entries(d))if(typeof A!="string")throw new Error(`env value for ${b} must be a string`)}let h=c||l||d?{templateRepoUrl:c,templateBranch:l,envVars:d}:void 0,B=typeof e.deployEnvironment=="string"?e.deployEnvironment==="preview"?"preview":"production":void 0,R=e.deployDisabled!==void 0?w(e.deployDisabled):void 0,I=e.streamDeployLogs!==void 0?w(e.streamDeployLogs):!0,E=await C(i,r,{prompt:o.trim(),...a?{teamId:a}:{},...h?{template:h}:{},...B?{deployEnvironment:B}:{},...R!==void 0?{deployDisabled:R}:{},streamDeployLogs:I});if(!E.ok){let b=await E.text().catch(()=>"");throw new Error(`agent create failed: ${E.status} ${b}`)}let N=null,O=null,P=null;await H(E,{onConversationId:p(b=>{N=b},"onConversationId"),onItems:p(b=>{for(let A of b){let U=Q(A);U&&console.log(U);let x=A;!O&&typeof x.appId=="string"&&(O=x.appId),!P&&typeof x.deploymentId=="string"&&(P=x.deploymentId)}},"onItems")}),N&&console.log(`conversation_id: ${N}`),O&&console.log(`app_id: ${O}`),P&&console.log(`deployment_id: ${P}`);try{await J({apiBase:i,apiKey:r,forceRefresh:!0}),await L({apiBase:i,apiKey:r,forceRefresh:!0})}catch(b){console.warn("cache refresh failed",b)}}p(de,"runAppsAgentCreate");async function pe(e,s,t,n){let r=await f(),i=m(r),o=await g(r,i),c=y(r),l=typeof e.method=="string"?String(e.method).toUpperCase():void 0,u=l&&["GET","POST","PUT","DELETE"].includes(l)?l:void 0;if(l&&!u)throw new Error("method must be GET, POST, PUT, or DELETE");let a=typeof e.body=="string"?S(String(e.body),"body"):void 0,d=typeof e.headers=="string"?S(String(e.headers),"headers"):void 0,h=typeof e.scheduleId=="string"?String(e.scheduleId):void 0,B=w(e.notifyEmail),R=w(e.summary)||w(e.withSummary),I=await M(c,o,{appId:s,deploymentId:t,toolName:n,scheduleId:h,method:u,body:a,headers:d,notifyEmail:B||void 0});if(console.log(JSON.stringify(I,null,2)),R&&I.ok){let E=await k(c,o,s);console.log(JSON.stringify({summary:E},null,2))}}p(pe,"runAppsToolsExecute");async function ue(e,s){let t=typeof e.env=="string"?e.env:typeof e.vars=="string"?e.vars:typeof e.envVars=="string"?e.envVars:null;if(!t)throw new Error("usage: apps env set <handle>/<repo> --env <json>");let n=S(t,"env");if(!n||typeof n!="object"||Array.isArray(n))throw new Error("env must be a JSON object");let r={};for(let[d,h]of Object.entries(n)){if(typeof h!="string")throw new Error(`env value for ${d} must be a string`);if(!d.startsWith("OPENTOOL_PUBLIC_"))throw new Error("only OPENTOOL_PUBLIC_ env vars can be set");r[d]=h}let i=await f(),o=m(i),c=y(i),l=await g(i,o),{app:u}=await v(c,l,s),a=await V(c,l,u.id,{envVars:r});console.log(JSON.stringify(a,null,2))}p(ue,"runAppsEnvSet");async function fe(e,s){let t=await f(),n=m(t),r=y(t),i=await g(t,n),{app:o}=await v(r,i,s),c=await _(r,i,o.id);console.log(JSON.stringify(c,null,2))}p(fe,"runAppsEnvGet");async function ge(e,s){let t=await f(),n=m(t),r=y(t),i=await g(t,n),{app:o,handle:c,repo:l}=await v(r,i,s),u=typeof e.env=="string"?e.env:typeof e.environment=="string"?e.environment:void 0,a=j(u),d=await D(r,i,o.id,{environment:a});console.log(JSON.stringify(d,null,2)),(w(e.watch)||w(e.wait)||w(e.follow))&&await q({baseUrl:r,apiKey:i,deploymentId:d.deploymentId,prefix:`[${c}/${l}] `,intervalMs:e.interval?Number(e.interval):void 0,timeoutMs:e.timeout?Number(e.timeout):void 0})}p(ge,"runAppsDeploy");function X(e){let s={};if(typeof e.params=="string"){let n=S(String(e.params),"params");if(!n||typeof n!="object"||Array.isArray(n))throw new Error("params must be a JSON object");for(let[r,i]of Object.entries(n))i!==void 0&&(s[r]=typeof i=="string"?i:JSON.stringify(i))}let t=p((n,r)=>{r===void 0||r===""||(s[n]=r)},"addParam");if(t("source",typeof e.source=="string"?e.source.trim():void 0),t("symbol",typeof e.symbol=="string"?e.symbol.trim():void 0),t("cursor",typeof e.cursor=="string"?e.cursor.trim():void 0),t("status",typeof e.status=="string"?e.status.trim():void 0),t("backtestRunId",typeof e.runId=="string"?e.runId.trim():typeof e.backtestRunId=="string"?e.backtestRunId.trim():void 0),t("since",T(e.since,"since")),t("until",T(e.until,"until")),typeof e.limit=="string"&&e.limit.trim().length>0){let n=Number.parseInt(e.limit,10);if(!Number.isFinite(n))throw new Error("limit must be a number");t("limit",String(n))}return Object.keys(s).length?s:void 0}p(X,"resolveBacktestEventsParams");async function me(e,s){let t=await f(),n=m(t),r=await g(t,n),i=y(t),{app:o}=await v(i,r,s),c={...X(e)??{},appId:o.id},l=await z(i,r,{method:"GET",query:c});console.log(JSON.stringify(l,null,2))}p(me,"runBacktestEvents");async function ye(e,s){let t=typeof e.runId=="string"?e.runId.trim():typeof e.backtestRunId=="string"?e.backtestRunId.trim():"";if(!t)throw new Error("usage: backtest get <handle>/<repo> --run-id <id>");let n=await f(),r=m(n),i=await g(n,r),o=y(n),{app:c}=await v(o,i,s),l=await F(o,i,{appId:c.id,runId:t});console.log(JSON.stringify(l,null,2))}p(ye,"runBacktestGet");export{X as resolveBacktestEventsParams,de as runAppsAgentCreate,le as runAppsAssistant,oe as runAppsCodeVisibility,ge as runAppsDeploy,fe as runAppsEnvGet,ue as runAppsEnvSet,se as runAppsList,ae as runAppsPerformance,ce as runAppsSummary,ie as runAppsTools,pe as runAppsToolsExecute,me as runBacktestEvents,ye as runBacktestGet};
|