coze-bridge 0.1.6 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +41 -40
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5,16 +5,16 @@ import { dirname as __coze_dirname } from 'node:path';
|
|
|
5
5
|
const require = __coze_createRequire(import.meta.url);
|
|
6
6
|
const __filename = __coze_fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __coze_dirname(__filename);
|
|
8
|
-
var
|
|
9
|
-
`,"utf8"),
|
|
10
|
-
`):
|
|
11
|
-
`)}function N(r){return{debug:(e,i)=>Ut("debug",r,e,i),info:(e,i)=>Ut("info",r,e,i),warn:(e,i)=>Ut("warn",r,e,i),error:(e,i)=>Ut("error",r,e,i),child:e=>N(`${r}.${e}`)}}var Ht,_s,j0,G0,ys,F=Ae(()=>{"use strict";Ht={debug:10,info:20,warn:30,error:40},_s=(()=>{let r=process.env.COZE_BRIDGE_LOG_LEVEL;return r==="debug"||r==="info"||r==="warn"||r==="error"?r:"info"})(),j0=process.stdout,G0=process.stderr,ys={}});import{homedir as W0}from"node:os";import{join as te}from"node:path";function K(r){let e=r??W0(),i=te(e,".coze"),a=te(i,"bridge"),x=te(a,"lib");return{cozeRoot:i,bridgeRoot:a,libDir:x,libEntry:te(x,"index.js"),pidFile:te(a,"bridge.pid"),portFile:te(a,"bridge.port"),tokenFile:te(a,"bridge.token"),logFile:te(a,"bridge.log"),installLock:te(a,"install.lock"),configFile:te(a,"config.json"),agentsRoot:te(i,"agents")}}function Ie(r,e=K()){let i=te(e.agentsRoot,r);return{root:i,config:te(i,"config.json"),workspace:te(i,"workspace"),logs:te(i,"logs")}}var xe=Ae(()=>{"use strict"});var Gt={};ws(Gt,{AGENT_CONFIG_FILE_MODE:()=>Kt,enforceAgentConfigMode:()=>Y0,loadAgentConfig:()=>oe,persistAgentSessions:()=>ar,persistAgentSkills:()=>jt,saveAgentConfig:()=>ue});import{chmod as J0,stat as V0}from"node:fs/promises";function oe(r,e){return qt(Ie(r,e).config)}function ue(r,e){return Ft(Ie(r.agentId,e).config,r,{mode:Kt})}async function Y0(r,e){if(process.platform==="win32")return;let i=Ie(r,e).config;try{let a=await V0(i);if(!a.isFile())return;let x=a.mode&511;x!==Kt&&(await J0(i,Kt),bs.warn("agent config mode auto-corrected to 0600",{path:i,from:x.toString(8)}))}catch(a){if(a.code==="ENOENT")return;bs.warn("enforceAgentConfigMode: chmod failed (ignored)",{path:i,err:String(a)})}}async function ar(r,e,i){let a=await oe(r,i);a&&(a.sessions=Object.fromEntries(e),await ue(a,i))}async function jt(r,e,i){let a=await oe(r,i);a&&(a.skills=e,await ue(a,i))}var bs,Kt,Ue=Ae(()=>{"use strict";ir();F();xe();bs=N("agent-config"),Kt=384});var ii=ie(V=>{"use strict";var S=A;(function(r,e){let i=A,a=r();for(;;)try{if(-parseInt(i(915))/1*(parseInt(i(575))/2)+parseInt(i(1194))/3*(-parseInt(i(1252))/4)+parseInt(i(1007))/5*(-parseInt(i(940))/6)+-parseInt(i(1150))/7*(-parseInt(i(621))/8)+-parseInt(i(210))/9+parseInt(i(284))/10+parseInt(i(1328))/11===e)break;a.push(a.shift())}catch{a.push(a.shift())}})(_n,797648);var ex=Object[S(1316)+S(126)],tx=Object[S(833)+S(671)+S(732)],ei=(r,e)=>function(){return r&&(e=(0,r[{GOLBE:function(f,u){return f(u)}}[S(975)](tx,r)[0]])(r=0)),e},nx=(r,e)=>{for(var i in e)ex(r,i,{get:e[i],enumerable:!0})};function rx(){return Ys||(Ys=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function sx(){let r=S;return Xs||(Xs=[IDBCursor.prototype[r(1582)],IDBCursor[r(1396)+"e"][r(958)],IDBCursor[r(1396)+"e"][r(958)+"PrimaryKey"]])}function ix(r){let e=S,i={PxtNG:e(1387),czkLh:function(x){return x()},wXtHk:function(x,f){return x(f)},rmjaW:e(1523)},a=new Promise((x,f)=>{let u=e,h=()=>{let y=A;r[y(1086)+"entListe"+y(658)](i[y(687)],m),r["removeEv"+y(419)+y(658)]("error",w)},m=()=>{let y=A;x(ve(r[y(831)])),i[y(703)](h)},w=()=>{i[A(1443)](f,r.error),h()};r[u(1514)+u(735)](i[u(687)],m),r[u(1514)+u(735)](i[u(815)],w)});return a[e(839)](x=>{let f=e;x instanceof IDBCursor&&dr[f(868)](x,r)})[e(1008)](()=>{}),mn.set(a,r),a}function ox(r){let e=S,i={OkEpl:function(x,f){return x!==f},pMsWE:e(1319),uSXUn:e(902),iYDPO:function(x){return x()},Mdkps:e(889)+e(1317),iLmVh:"header",SvshW:function(x,f,u,h){return x(f,u,h)},JwAuf:e(1351)+e(695),lsySR:function(x,f){return x(f)},Idsvo:function(x,f){return x!==f},SjiIG:e(293),EEMiL:e(1384),lKHqF:e(1523),VxPyd:e(484)};if(pn.has(r))return;let a=new Promise((x,f)=>{let u=e,h={JXKkj:u(484),suEiL:i[u(1303)],BLXiH:i[u(823)],TIeWT:function(m,w,y,_){return i[u(317)](m,w,y,_)},wrndY:"service",gjHde:function(m,w,y,_){return i.SvshW(m,w,y,_)},PcoUw:i.JwAuf,WiqOM:u(1428),yJRie:function(m,w){return i[u(633)](m,w)},eEzPC:u(860)+"or",wmYFY:function(m){return m()}};if(i.Idsvo(i[u(195)],i[u(195)]))return _0x524b3d||(_0xd8f7e6=[_0x1cd670[u(1396)+"e"][u(1582)],_0x58ea9f[u(1396)+"e"].continue,_0x1731d5[u(1396)+"e"][u(958)+u(714)+"ey"]]);{let m=()=>{let _=u;r[_(1086)+_(419)+_(658)](_(1384),w),r["removeEv"+_(419)+_(658)](_(1523),y),r["removeEv"+_(419)+_(658)](h[_(297)],y)},w=()=>{let _=u;i[_(1577)](i[_(471)],i.uSXUn)?(i[_(1026)](x),i.iYDPO(m)):(_0x1d41af.log(h[_(398)],_0x1d1d50,_0x4ee207[_(1123)]),_0x1a8c22=_0x59582b(0,_0x3c2ffc,_0x4951df),_0x475f06[_(942)](h[_(1180)],_0x4456f6),_0x48fd4d=h.TIeWT(_0x5b3444,_0x810b47,_0x412895,_0x3fee59[_(1123)]||0),_0x23af84[_(942)](h.wrndY,_0x90dd89),_0x57b115=h.gjHde(_0x16e8f2,_0x874917[_0x8612a2[_(1064)+_(1394)]],_0x19e543,_0x6aa5d5),_0x469349[_(942)](h[_(604)],_0x362f0e),_0xbdf9d0=h.gjHde(_0x155d06,_0xab66b4[_(1064)+_(1394)],_0x2396c8,_0x5a7486),_0x3d1ceb[_(942)](_(695),_0x18fe11),_0x18fb09=_0x328525(_0x1d32f8[_(1224)+"er"](_0x9062ae.cursor||_0x40036e),_0x15b281,_0x1fbd08),_0x13eedf[_(942)](h.WiqOM,_0x5f0d41))},y=()=>{let _=u;h[_(252)](f,r[_(1523)]||new DOMException(h[_(763)],h[_(763)])),h[_(1119)](m)};r[u(1514)+"Listener"](i[u(348)],w),r["addEvent"+u(735)](i[u(119)],y),r[u(1514)+"Listener"](i[u(261)],y)}});pn[e(868)](r,a)}function ax(r){wn=r(wn)}function xx(r){let e=S,i={MPgtf:function(a,x){return a(x)},tLKqm:function(a,x){return a(x)},flJzI:function(a,x){return a(x)},NrUyZ:function(a,x){return a(x)},xrrDy:function(a,x){return a===x},SyKdL:e(647)+e(718),YLhWs:function(a){return a()}};return i[e(543)](r,IDBDatabase.prototype[e(110)+e(814)])&&!(i[e(1382)]in IDBTransaction[e(1396)+"e"])?function(a,...x){let f=e,u=r[f(861)](i.MPgtf(kt,this),a,...x);return ur.set(u,a.sort?a.sort():[a]),i[f(771)](ve,u)}:i.YLhWs(sx)[e(136)](r)?function(...a){let x=e;return r[x(1228)](i[x(771)](kt,this),a),i.tLKqm(ve,dr.get(this))}:function(...a){let x=e;return i[x(547)](ve,r[x(1228)](i[x(497)](kt,this),a))}}function cx(r){let e=S,i={QmyHH:function(a,x){return a===x},MCPiT:function(a,x){return a instanceof x},TKEtm:function(a,x){return a(x)},gxOVi:function(a,x,f){return a(x,f)},EGyrR:function(a){return a()}};return i[e(227)](typeof r,e(417))?xx(r):(i[e(843)](r,IDBTransaction)&&i[e(496)](ox,r),i[e(690)](ti,r,i[e(1327)](rx))?new Proxy(r,wn):r)}function ve(r){let e=S,i={ghvuV:function(x,f){return x!==f}};if(r instanceof IDBRequest)return ix(r);if(hn.has(r))return hn[e(1379)](r);let a=cx(r);return i[e(1477)](a,r)&&(hn[e(868)](r,a),mn[e(868)](a,r)),a}function A(r,e){r=r-100;let i=_n(),a=i[r];if(A.sDdmtF===void 0){var x=function(m){let w="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=",y="",_="";for(let C=0,L,T,R=0;T=m.charAt(R++);~T&&(L=C%4?L*64+T:T,C++%4)?y+=String.fromCharCode(255&L>>(-2*C&6)):0)T=w.indexOf(T);for(let C=0,L=y.length;C<L;C++)_+="%"+("00"+y.charCodeAt(C).toString(16)).slice(-2);return decodeURIComponent(_)};A.Arxomu=x,A.ZJdlmF={},A.sDdmtF=!0}let f=i[0],u=r+f,h=A.ZJdlmF[u];return h?a=h:(a=A.Arxomu(a),A.ZJdlmF[u]=a),a}var ti,Ys,Xs,dr,pn,ur,hn,mn,wn,kt,Zs=ei({"node_modules/idb/build/wrap-idb-value.js"(){let r=S,e={LBjAT:r(266),Pfywo:function(i,a){return i===a},NByKf:r(647)+r(718),zxpUn:function(i,a){return i===a},IXEXy:function(i,a){return i(a)},mWsyu:function(i,a){return i!==a},RJXtg:function(i,a,x){return i(a,x)},eicLy:function(i,a){return i===a}};ti=(i,a)=>a[r(607)](x=>i instanceof x),dr=new WeakMap,pn=new WeakMap,ur=new WeakMap,hn=new WeakMap,mn=new WeakMap,wn={get(i,a,x){let f=r;if(i instanceof IDBTransaction){if(a===e[f(456)])return pn[f(1379)](i);if(e.Pfywo(a,e.NByKf))return i[f(647)+"oreNames"]||ur[f(1379)](i);if(e[f(335)](a,f(525)))return x[f(647)+f(718)][1]?void 0:x["objectSt"+f(653)](x.objectStoreNames[0])}return e[f(876)](ve,i[a])},set(i,a,x){let f=r,u={dfThl:function(h,m){return e[A(997)](h,m)},oBRHn:function(h,m,w){return e[A(1405)](h,m,w)},kvsAI:function(h,m,w){return h(m,w)}};if(f(1353)===f(202)){let h=_0x27e51a[f(988)];u[f(153)](void 0,h)&&(u[f(1466)](_0x2b3c2a,_0x78389b,10),u.oBRHn(_0x211933,_0x562e6f,h));let m=_0xaabab6[f(1472)];m!==void 0&&(u.kvsAI(_0x19176f,_0x170afb,18),u[f(1431)](_0x50c0c3,_0x41b50a,m))}else return i[a]=x,!0},has(i,a){let x=r;return i instanceof IDBTransaction&&(e[x(1169)](a,e[x(456)])||e.zxpUn(a,x(525)))?!0:a in i}},kt=i=>mn[r(1379)](i)}}),ni={};nx(ni,{deleteDB:()=>ux,openDB:()=>fx,unwrap:()=>kt,wrap:()=>ve});function fx(r,e,{blocked:i,upgrade:a,blocking:x,terminated:f}={}){let u=S,h={VqWwX:function(y,_,C,L,T){return y(_,C,L,T)},vknvB:function(y,_){return y(_)},oIPVn:function(y,_){return y(_)},iZVjH:function(y,_){return y!==_},SIYvs:u(1427),gPQsD:u(514),WWUmr:u(1434)+u(1095),aCGum:function(y,_){return y(_)},JnbzE:u(1262)+u(264),siYUN:"blocked"},m=indexedDB.open(r,e),w=h[u(859)](ve,m);return a&&m[u(1514)+u(735)](h[u(1156)],y=>{let _=u;h.VqWwX(a,h[_(306)](ve,m[_(831)]),y[_(485)+"on"],y[_(1474)+"on"],h[_(581)](ve,m["transact"+_(814)]))}),i&&m[u(1514)+u(735)](h[u(204)],()=>i()),w.then(y=>{let _=u;h[_(1154)](h[_(1347)],h.SIYvs)?(this[_(441)]=!0,this[_(540)]()):(f&&y["addEvent"+_(735)](h[_(1083)],()=>f()),x&&y[_(1514)+_(735)](h.WWUmr,()=>x()))}).catch(()=>{}),w}function ux(r,{blocked:e}={}){let i=S,a={ikxrB:function(f,u){return f(u)}},x=indexedDB[i(217)+"tabase"](r);return e&&x[i(1514)+i(735)](i(413),()=>e()),a[i(1182)](ve,x)[i(839)](()=>{})}function $s(r,e){let i=S,a={IWSNV:function(m,w){return m-w},KStIY:i(460),oPErw:function(m,w){return m in w},tfpbD:function(m,w){return m===w},pMasT:"string",tesLr:function(m,w){return m!==w},vZRxx:"veNdf",FwDzS:i(599)};if(!(r instanceof IDBDatabase&&!a[i(1512)](e,r)&&a.tfpbD(typeof e,a[i(288)]))){if(a[i(1501)](a[i(1206)],a[i(563)]))return;{let m=_0x2c1812[i(572)+"g"](0,a[i(847)](4,_0x5a5226[_0x43394d][i(769)])),w=m[i(1288)](_0x6f0a1e[_0x30592c]);_0x5a7b92[i(473)](w)}}if(gn[i(1379)](e))return gn[i(1379)](e);let x=e[i(1198)](/FromIndex$/,""),f=e!==x,u=si[i(136)](x);if(!a[i(1512)](x,(f?IDBIndex:IDBObjectStore)[i(1396)+"e"])||!(u||ri[i(136)](x)))return;let h=async function(m,...w){let y=i,_=this[y(110)+"ion"](m,u?"readwrite":a[y(875)]),C=_.store;return f&&(C=C[y(438)](w[y(1207)]())),(await Promise[y(1257)]([C[x](...w),u&&_[y(266)]]))[0]};return gn[i(868)](e,h),h}var ri,si,gn,dx=ei({"node_modules/idb/build/index.js"(){let r=S,e={ObPLh:r(741)+"3|4",YwDNJ:"put",XgEIH:r(476),xQzrK:r(245),zQZEN:function(x){return x()},wRdUJ:function(x,f){return x(f)},BMaod:r(1034),CRmBm:r(1480)},i=e[r(1027)][r(970)]("|"),a=0;for(;;){switch(i[a++]){case"0":si=[e[r(1187)],e[r(359)],r(913),e[r(158)]];continue;case"1":Zs();continue;case"2":e[r(1411)](Zs);continue;case"3":gn=new Map;continue;case"4":e[r(494)](ax,x=>({...x,get:(f,u,h)=>$s(f,u)||x[r(1379)](f,u,h),has:(f,u)=>!!$s(f,u)||x.has(f,u)}));continue;case"5":ri=[r(1379),"getKey",e.BMaod,r(407)+"ys",e[r(730)]];continue}break}}}),lx={idb:function(r){let e=S,i={muAzN:function(a,x){return a!=x},NwJYV:function(a,x){return a instanceof x},rCoEP:"string",iHPOl:"applicat"+e(334),ijvYK:function(a,x){return a!==x},drQjf:e(320)};r[e(1321)]=Promise[e(1024)]()[e(839)](()=>(dx(),ni)).then(function(a){let x=e;return i[x(784)](i[x(410)],"IeGyC")?a:i[x(838)]("string",typeof _0xe8c4da)&&(i[x(773)](_0x2db00e,_0x503f84)||_0x4f6ecd[x(1464)]&&_0x57f522[x(1464)]instanceof _0x16320c)||i[x(160)]!=typeof _0x133371?"":(_0x48b726[x(1324)](_0x27ad88),i[x(1306)])})}},Qs={};function ye(r){let e=S,i={PzhnA:function(f,u){return f!==u}};var a=Qs[r];if(i[e(542)](void 0,a))return a[e(1321)];var x=Qs[r]={exports:{}};return lx[r](x,x.exports,ye),x[e(1321)]}ye.d=(r,e)=>{let i=A;for(var a in e)ye.o(e,a)&&!ye.o(r,a)&&Object["definePr"+i(126)](r,a,{enumerable:!0,get:e[a]})},(()=>{let r=S;ye.o=(e,i)=>Object[r(1396)+"e"]["hasOwnPr"+r(126)].call(e,i)})(),(()=>{let r=S,e={qfRAO:r(1166)+"d",wOywI:"Module"};ye.r=i=>{let a=r;e[a(1302)]!=typeof Symbol&&Symbol[a(1555)+a(1341)]&&Object[a(1316)+a(126)](i,Symbol[a(1555)+a(1341)],{value:e.wOywI}),Object[a(1316)+a(126)](i,"__esModule",{value:!0})}})();function _n(){let r=["svz3ywS","zv9ZDwnJzxm","yxbWBhK","q2LHDeq","AxnAzxjV","BuLKtNO","yxnqs28","uuPZAwi","x3bPBMC","x2rItMfTzq","Axnby2TdBgu","rLPNy3m","yuX1D1m","seT5v1u","EfrZBxO","CMLLC0nVDw4","vvnkueq","BMvJDa","zMLSDgvY","u1nZsu8","Bwv0Ag9K","uxDirgm","zw5NDgG","vgDpufi","CKXHrxq","ywDLu2HVDW","nJGWodi0s2riwLvo","zNzhEw4","q1n2z04","uM5vugm","CKXlExO","ywXS","DwHgwMC","yMfNAMS","Dgv4Dc9Qyxy","yK9JweS","DxbNCMfKzw4","EsbJBg9Zzwq","tNvZBgO","rLDTBwS","zxHTvg8","CYbPBNn0yw4","mdaWma","CNnVCL9Uyw0","qxbfu3O","Cgu6ia","yw5ZzM9YBvq","yMfSrxzLBNq","Ae5HBLO","zNjHBwvuExa","yxnIu3u","BwLZzq","Cw9Z","ExbL","sevqC1C","qw1eBg4","zM9YrwfJAa","x3vYBa","x2rLyNvN","x2rPC2nVBM4","tLv1rKS","CMvWBgfJzui","y29Uy2f0","CKjPzue","thjKzMm","ywnRDxbfBMq","Aw47y2HHCNm","vwnIy1O","Be5VqMC","tM94DhC","ELbprLi","zMLXAM0","yMfJA3vWigu","yK9Jy20","DwDKtwC","AKXQr0e","Cwzsqu8","twrRChm","rvH5wNi","DvHgsui","AuHqt2W","u3rYyxrLz3K","vvr4BNa","DuDqwwy","DLb6B2u","s0DyCLy","zKPzsK0","tM9zuwS","C2v0u3rVCMe","AK5TCu4","zgvMAw5Luhi","zxj2AwnL","tKzpsw0","veDoB3q","BM5Ly3q","zxHWB3j0CW","D2LSBfjLy28","x2LZtwLUAvq","CgfYC2u","zMfdB1i","B25tDg9Wsw0","ruD5CLi","mJi2mZy2mZzmqNDHvwS","uxDTCeq","ign1CNnVCIa","t2LoBM4","Ef9MCM9UDgK","ywXrAMu","C3PRt3a","CwjHv2C","CKvKBfu","y0TVEfO","sevhuMG","y0TpEKi","qwzAr0O","vgfN","aaaaaaaaaaa","r1bVz0K","zM9Yy2u","DhLWzq","yw5Nzq","u0LzDNm","uNLdsfK","B2nRzxq","uhzlwvG","C2vYDMLJzs0","vuTxDxy","zfrdvw8","EwHYz2q","C0XPC3rLBMu","rLbPDNe","wM51wu8","sxHmD1m","BxLyvNu","DxbSu00","rfv2EMu","Bg93","z2v0sxrLBq","zgvS","y0ziteG","tLbutva","rePXufe","x2DLBMvYyxq","B2nRzxrgywK","z1rPBwvVDxq","q3jyufK","reDcCxK","B3v0sw50zxi","yxPeAgy","yMvNr0G","AvbcqNe","Ew1qB2e","yM9KEq","z2v0","Efnjzg4","y3ruAw1LB3u","u3LlzeW","DLzLB2O","y29TCgXLDgu","EwjMugO","y3DWq0q","C3vJy2vZCW","BKHjCwK","EK9lshO","x3bYB3rVy28","yxnZAwDU","A2fUDxa","ihrPBwvZ","yw1L","CYbWyxjHBxm","ChjVDg90Exa","x2TLEvbHDgG","zw5JB2rPBMC","wLjnCwO","zMPtDvy","Cgf5Bg9Hzeu","sw1cCxe","BfrHD04","ignVzgu6ia","uKPyDgC","y3vYCMvUDeK","Dgv4DfbHEwW","Currzha","zfHAuu8","t1jjCKu","ELfAru4","CLDIyuu","z2v0q3vYC28","su5VBve","CKnlDMG","x3jLy29UBMu","DhDVCMTdAge","Evn2rgu","DMTHsNi","CgjICdi","uLvkvuC","mNW1Fdf8nhW","zKfNAxG","vKLiAg0","vgvgCxe","q09otKvdveK","shner3K","y3vYDMfSDwu","Ec11C2uT","DgvZDa","A3zZquK","zwnVBM5Ly3q","q291BNq","DMvYC2LVBMm","x29UvgLTzw8","BuL3uLu","BKnevMq","zfjNALq","y3r4","rxLNswW","vxLfA1K","Bwu6ia","D1H0sgS","wunctfy","l3DZl3yY","BM93","yxjYyxLIDwy","z0PUBKm","B2Tpvuu","vNHKBgq","AeHbrMq","BMXytxa","BMrLEa","q3LHENm","sMzXwui","zKXJBMe","tuPeC0K","Ahr0Chm6","vxbKyxrLq28","Cg1vA3a","qvfeuNC","B1Lxtfe","x2n1CNnVCK4","yNvMzMvY","uKPAwLi","B0jssg4","ve1Hvgi","tNLfAMS","EKTdB1m","A1r5ELC","z29PBMCGyxC","DMfSDwu","rhjSu0i","BMv3vMvYC2K","ELjhBe8","EMHiqLi","z2H2Dvy","yNL0zxm","v2vIu29JA2u","y291BNq","EeDSruS","AwHovLq","BxnNsuq","lcbTyxGGCMu","zgv2AwnLx2K","ExHVBNe","tvzyuLq","uNPpweG","x2nYzwf0zvm","swTNqxm","C2LWs0e","Aw1LCYbPBIa","y3jLyxrLt2i","AxnrB1nnzxm","BwLUAvbYB2C","sfnyrKy","DxrVuMvJB24","zgvxuwO","BwvY","C2rWD3K","DgvZthi","BM9Uzv9UB24","weXjBfe","q1jHBfa","ywXSq3vYC28","Aw5L","C0vOtuK","yM9L","thHKEMm","B3bLBG","z2vrDwv1zuW","B1bfCNC","y29UBMvJDa","ywrKrxzLBNq","Aw5PDcbrB1m","x3DZ","mtf8nNWXmhW","tuDjr0i","C2v0q3vYC28","Chv0","CxjmtLy","yxGGCMv0CMK","zxjYB3i","sLnptLa","CMfNzvn5BMm","tKLNChm","BgL6ENi","sKPlrNa","vhjevNC","tLvdCxe","vKX2u1C","tfPRDgy","zNjVBuHHC2G","s2nkAKG","Dw5ZAwDUzwq","BM5Ts2O","uKvRvhG","mdaWmdaWmda","qKvusuu","x2LUAxrqCM8","CxDwEfy","BNrfBMrWB2K","qNn1twe","rLHqEhG","vwHZuwK","B25JBg9Zzq","Bw1dtfi","yxv0B21HDgK","ELPUu3O","A3Dot1G","DKves1u","BwHuALq","AejAA1u","ANDlEfq","Dg9tDhjPBMC","C3rYAw5N","ugHlz3G","Bg9Nsurhzw4","AenSB3nLrxy","CgLUz0LUDgu","zxjFDhrS","AgvKtwf4uMu","C2PxvgK","tNfwyvu","shvttNC","D2vqz3u","ysbTDxn0igi","CMvZzxrfBMq","A3DxC0O","tg9Nsuq","yLjAD2y","ENDUy0W","vgnhwuC","D1bsr0i","EMnHv2q","rLveELK","t2TfCgW","x25HDMLNyxq","thrSCeq","Dg9cExrLC0i","qwLLAvu","ywr2yw5Jzq","uLbUt0G","x2HHBMrSzva","AuDfCgW","tuXkwLi","EgvrB3K","yxbWBgLJyxq","B0HhD3G","zM1xELi","Eu9zDwW","zxjFCw9Z","C3rVCcbPBw0","tNDlt1q","zw5XDwv1zq","tMfTzq","D3jPDgvvAw4","v1nbrK4","rhzUsKi","ruvkuvO","B1nAtMK","Aw5KzxGGB3u","ihrYEsbYzwm","DhjHBNnHy3q","v0rMyM4","rxzLBNq","BMzjyNm","y2XVC2uSihC","yNvMzMvYzwq","zw5fDMvUDa","CK1PtKm","swz4ufa","BeTiCuy","sxDvDfy","tg9NsurozxC","Dw50","vKHdCui","ruLIvMu","EgnuC2K","B3bLCNr5","x2LZv29YA2u","vhbZtgS","AxnszwfKEq","ChbzsvO","y01dDM8","AwDbCfC","Bvn5v1q","t0vYthO","reLZzuu","Aw5JBhvKzxm","CNj2vKW","D05gy24","zfPlExy","y29UBMvJDfm","tufyx1jfvfi","vMPcvwC","A0DuBgK","y3jLyxrLt3a","BMrWB2LUDfq","wwHZDuW","qMP4Bxe","x2HHBMrSzvi","uMrosLe","sffMshu","z1vfq1a","vLf6u1i","zgzuAgW","wKnusMy","Bg9NsurozxC","B25mAw5L","vw5Oyw5KBgu","Eff6CKS","x2vUzhbVAw4","CKnVrva","qLjvBeW","zgf0yq","CvbKuLy","BMDLza","Aw5KzxHpzG","y0nlwvO","CMvJzxzPzwq","DwzPv0O","vuHpDNG","y3jLyxrLrxi","ywWGy3vYC28","wwrmEfm","x21LC3nHz2u","zxH0zw5ZAw8","C2v0sxrLBq","EePvwwC","zgLZywjSzue","twr4Cwy","x3nVy2TLDa","svzdy04","DxrMofDYAxq","v3vkz04","vfvXuum","A0rivgO","CMvZzxruCMK","qM5zuwi","nhWW","EKTwDfy","s3bhvfG","ywXPzcb1CMW","u2vXsuq","svHxz0i","Eu1Mvhq","zKHbC0W","u2PPsuC","EMPZtNm","yw92sKe","BMCGzMfPBgu","q1j4yxq","vuDQAhC","Aw9UvgLTzw8","sxPyD2m","zLvHDNK","C2Lzvu4","DhjPzxm","zMX1C2HfEha","DvLKvLu","CNrjy2O","DgvmB2Djre4","mteXnZyXndzsvgzVqMu","zxjYtxnN","v3vREMS","BMnLq2XVC2u","BMvrzxO","vwP0sfm","DurVAuO","zgvSzxrLrge","AwXK","rgjTy1y","twvZC2fNzuu","shD0v0y","ruHLtfu","r0niDw8","sgvQtwe","vejWwLy","BuTSrxu","uw15seG","B3vNtgG","C3nHz2vfDMu","yw9uB1e","AxnbCNjHEq","zMLSzw5HBwu","q09oveLovuu","B25nzxnZywC","EuTmvgO","EeTLCvu","yxrnzNq","BLftrhq","quPoz2W","CurRrva","r2rOt3O","BvHeDxy","CK1Org4","tMr3BKu","y2XLyxi","DMLJzuLeig8","rhP2Eei","ywvgwgK","x2LZtwLUAvC","q3bswuK","tLj5rfa","EuPsAwu","ALr1v0i","uLvLD2W","v3zsDvq","B3PgvMO","C3vIyxjYyxK","AK5wr0i","BfL4zhC","C3LLvhO","vNHqEwq","DefLv3e","ANrOAfm","zwvKzwq","rw9ABK0","zg9Uzq","C0nNsKm","y3jLyxrLuMu","zxDPB2S","CgLUz1rPBwu","x2nSzwfYugK","DxbKyxrLq3u","Dxrjza","ChbL","EfvZzuvUDG","x29Uq2XVC2u","ywDLrxzLBNq","C1ziCeC","rxfTCLC","yxnL","zvvYBa","z01WqvO","AM9PBG","nZmZnJyXmhnitgr1Aq","DMvY","y09Wzw4","Ae1LC3nHz2u","Ce1HC1q","y3bUr20","zLPsugm","C1PHuva","EMLLt0i","A01Iqxu","vhHzvuC","x2fKzfDZtgK","ywDL","sLHlA2O","z2T4Duy","qNruCem","uKzgu3i","ALzQDva","EfPYywC","rgjXy1u","CgLUz19VBMm","BML0AwfSAxO","DMTUDKi","wendt1C","qMztuMG","y1zwB1y","wLvVq0O","v2PhB04","q3HfB2O","CuvVC1K","zM5yyNu","sMfeEwG","zxjYtM8","u3zZAfC","Aefkzw8","vfLmBw8","Bhn2yuS","CM92AwrLihy","mhW3FdH8mNW","B2fK","sgnNze8","C2vUzf9Hy2S","zeTMvey","qKrzqvO","y3vYCMvUDeu","t2jIrNa","CgjnAwu","zwnLzuy","x0rctMfTzq","uuDHq2i","Aw9Ul2PZB24","ENHWvw4","sMfvA3C","BfrPBwvVDxq","z2vY","o2nOyxjZzxq","tfflC0K","DeLUDgvYy2u","x3jLBw92zvC","rMLJqxq","vgn0u1a","zMLUza","tMjrB0S","AvHdtvi","ruvnAuW","weP5C1C","BwLUzW","vgLTzw91Da","DcbSAw1PDa","Au9isu8","z2DYDNq","De1HBMfNzxi","ihrVihjLDhi","B3nLrxzLBNq","B2fRwKm","wgDfsuG","y0j1tK8","z2vtEw5J","sg9hyxa","Dw5RBM93BIa","z2fxAhy","qvDSy1q","D3v3Bva","CMvHzfvjBNq","t25zvxe","r0TMzLi","CvHhDg0","CMj5sLa","DejtEMe","CgLUz0XVC3m","qvb3z28","whbXEui","sgH2uuq","swLZD0q","yxnJCMLWDa","ENHqzvC","CNzHBa","CgLUz09Uy2u","zxmGCMvHy2G","weT6B04","zgDAr1m","CM9AA1m","rNjVBNrPzxi","DhjPBq","ywnR","yMLUza","s3rjsxu","zxfAueO","qw16zvy","t3bLBKv2zw4","Dgvvtxe","x3bPBMDmB3m","sM93AK0","sgzKDhG","C3vfAuW","ALbUz20","B0jIqwO","jMPZy2fSBgi","zgHNwMC","quXm","DKrlwxa","CMv0CNLdB3u","yMLUyxj5","z2v0qwXSs2u","rMXot2S","AwXLtMfTzq","zhjrAMy","s3vLwK0","q3vZDg9Trxi","yMXVy2TLza","AwDHDg9Yt24","ywnOzwq","v2LUzg93","zNvUy3rPB24","u1jnrfm","zw50tgLZDgu","z1nwufa","y2XVC2veqG","su1rA1C","tgDhzuK","zfLzCfa","yxKSihrYEsa","DxnLCKLW","Cw5dqKq","Cw9Zx18","yw1Lu3bHy2u","DfP1qLa","senHuNq","CNnVCKzPBgu","zeHQDeC","Dg9VigXHCMC","BgvY","vu5tu0K","u0PyB3G","Aw5KzxG","zfjfENO","s3z0seS","x2LZsw5PDa","rwP1EhC","BgvvEKi","q0Xpu0LorW","yKjZAu8","u1jlvwy","AfHAqui","y2Xes1e","tMDvqMG","AwLSDMK","z2vywLO","Dgzbvxe","y3nmy2u","A3vKu20","svzpBge","tejQqvq","EMXvshy","x3nLCuLK","yw1LoIa","CMvHzg9UBhK","ANPltLe","A0TcA1C","wMDwvKe","sfrtzMi","mhWYFdr8mxW","D1DKsMS","q0X3C0W","ywrKt25L","BNPtDKy","B05Uwxi","Ce1Zv0u","Aw5Lza","ChvZAa","v2rQzLy","lcbOB3n0BMe","ywrK","yKj0z0u","r1jzAvm","BxnN","r1b6t2q","wMH3Dgi","AhvVBNq","te5qCwS","ywjVCNq","B2XKvMvYC2K","rxzJuu4","B25szwnLAxy","igzPzwXKoIa","D1nsuMS","vwvkEwi","AgvHzgvYCW","x3bYzwzPEa","x29UrxjYB3i","D1jKvuO","mNWXFdr8m3W","veTfDg0","tNjvEvO","BMnJDMK","DgLhAKq","zw5KCg9PBNq","DwLtsem","uNzOz3q","shvnveW","ufP4Due","rxbfAK4","sfHJCe0","x3DHAxq","yw51Ce1LC3m","x19LC01Vzhu","vKjWs1y","y3nVuMi","uLjpuG","thbTwxe","y2XVC2u","rxb1BuG","vgv3sMi","ugDyy20","Cgf5Bg9Hzfq","vhPZtuK","q3vZDg9Tq2W","yM5gtLC","s01YEwK","reHozwy","DhfRyM4","C3rVCMu","BMPot2G","CMfUzg9T","zgrjrcWGzgu","AwXLx25HBwu","qwfcrM0","Dg9Y","Ahj4z2G","qw1VDw50","wfndrfm","rvvnywy","z2v0q3vYCMu","uujXweK","rvrzvvi","zxf1ywXZ","x2nVBM5Ly3q","zcWG","uhPOBKe","EhjYrhK","wM55Bw0","x3bHDgHlzxK","C1nnrgq","zMXkEKK","sgzHzNC","x2n1CNnVCK0","ihn1y2nLC3m","x2XPC3rLBMu","zg9XrLC","igXHCMDLCIa","zfPHv0C","ohW1Fdj8mxW","AxPpEvy","z2XKtMi","uNngr2q","rLDt","y3vYC29Yx2y","vLrxDuK","D3jPDgu","rNDeELm","C2vYDMvYvgK","BMXyCLO","BxvyqLe","zwHosLy","ywrKq291BNq","q29UzMLN","ve10u0C","zu1ysw8","C3vIC3rYAw4","tLD5Dva","rKLoz2m","nduYmZr3AwPMCKG","tKXlzvO","BMDuAw1LCG","r2PNu00","CgfwsNy","y0TeBgq","B0LqvM4","B3nLza","x2zVCM1HDeu","r3PLs1e","BNrksxG","zunqzxy","uu1WC1i","BgLZDgvUtMu","B2zM","Dg9mB3DLCKm","vKfQsvi","DKrtu2m","EgfXv1G","txLdDeW","Bg9IywXty28","CNbPrKq","whrQALm","AMTLyuu","uxjcr3K","rLjptLrjrvi","Aw50zwDLCIa","B25Uzwn0Aw4","CYbHBhjLywq","ugnVvxC","vM1jB3a","A2v5CW","C29Tzq","twvcAfG","Dhr3Awq","B2zMC2v0","CNjVCK1LC3m","zNjVBNrPzxi","y2HLy2Tszwe","CuvZzfG","ywvRyNK","thvrChi","y2XLyxjtDg8","zgjhD3e","ugPvzMW","zNjVBunOyxi","mtm2EfrsvwHR","rK52EgS","zLLzCwO","BIWGAg9ZDg4","C2XPy2u","CgfNuei","vw5PBxbSzw0","ihrPBwvVDxq","zMLN","zw5JB2rLrNi","zwDis3i","rfbjtKi","Bhn5u1i","AevYCM9Yrxy","BezSDxnO","zNnYsKy","t0zvAeK","uMvHzcbWyxm","q29Kzq","txnlD0O","yK9ZBu0","CMTizM4","CMvJB25Uzwm","BNruCMLLC0m","DfzkEKG","yLDPAKS","B2jQzwn0u3q","DvnlBxG","rvjst1i","C3rLBMvYCW","sxL3zwK","wLnLwfK","B3jL","z2vjBMzVu3K","t1bftL9fuLi","wwD2wvK","zcWGDw5RBM8","BMvY","r1v1EMK","vKDTyvy","zxq9DxrMltG","t1PWugW","qu9fwLm","vw9xCM8","twLZC2LUzYa","x29UugfNzu4","wfrJqMu","u0zdALa","EfjlwLG","BK5crwW","B3bLCNr5tMe","B25SAw5L","zhf2wK0","DhjPzxmGCMu","ExPMAMS","sKHmy3G","D0fmsLy","tgncDKe","yunJsxC","uM1mq2K","DhbizwfKzxi","y29UDgv4Da","DcbVzIbYyw4","sNnlEvO","CMvZzxrdB3u","vK1yweO","uhH0tKC","zxfqruS","tg5xCLC","z3HpvMK","rxjYB3jdB2q","Ce9lzLy","x2LUDgvYDMe","C0Xf","BMfTzq","Dg9oDw1Izxi","CMvXDwLYzwq","BgLUzw5V","Du5uy3G","CMvHzhLtDge","zsbHihn0CMK","EuzcBuq","y3PRtgG","EvjLy29UBMu","C1PzB0S","shD4Beu","DgfYz2v0","Cg9PBNrdB24","z0HLvNu","x2LUAxq","BwvZC2fNztO","Ehr6AKK","C2LHze8","uhjPBwfYEuS","BgjTzg8","B2nhEuy","x29UtwvZC2e","B3jLtMfTzxm","uxvLDwu","zu5SsLi","C2vUDa","AwDTveK","zMD2yKu","BwvZC2fNzv8","y2HnyxHuCMK","z2z3DgO","twntD1q","AMftD3u","t1bftG","q1jTqM0","rgDyuxO","BwvZ","ChrVCG","s2XbEMC","tgLZDgvUzxi","x2rYB3bhBg8","sgjuqwq","ChjVDg9JB2W","rg5fC1O","B25LCNjVCG","mNWXFdv8mhW","Bwf4tg9ZC0m","qNvuCvK","r3bWCNK","u3jhwK4","BvzuBvG","rLzirLq","CKLqALO","wMrAtNa","x3jLywr5q2W","vMXqteW","veXLB2q","z2vNuMO","wKzRBKe","tKfusvzfx0u","tMfru0y","D2TsBhi","vhj4BLy","D2vpB3G","igzHAwWSig0","DeDgzhi","tNrlwuO","zuv6uem","x29Ut3bLBG","DMvUDa","CMvTB3zLq2G","ugHPD2C","CMvLCMG","BgvUz3rO","zNjVBuj5Dgu","tvbNDgy","sLLtrKi","tNDkwvy","mhW1Fdf8nhW","AKrlCgK","B2HJENy","uufUrxK","wwj1B2G","yw5Nu2i","Dvf0Dfu","Dg9cExrLC0W","AuHxwhe","zw50","AwP2wuS","BuTXBxG","x2LZtM9Kzq","CLr0ywS","sKrPzeq","B1fSsuy","zMzMzG","BxjxrMy","u0zgDg4","zgLZCgf0y2G","zv90Aw1LB3u","AfHSy2W","yMTYEue","A1n0yxr1C0m","id4G","x3fVC0rc","uvHQs1K","CNjjq1e","vhHcy08","zxjFBxnNAwq","uvDwv2G","C2v0y3vYC28","uMvJB25Uzwm","zwXzrKm","mhW2Fdr8mta","B3vUDa","BerUufe","BvDeDvC","C0jf","qNjPzgDL","Aw9U","CM1QyvC","CgXLyxnLiha","C3rYAw5NAwy","q0Xpu0ve","su9WtNq","y1jADgq","x1fVu01HBMe","ywXSB2nvBNm","AuXTvMG","r0zhqxq","wgvUAfu","x2LUAxrhBg8","C2DPza","BKfzvKu","yNL0zu9MzNm","CMvUDevUzha","CMvZDwX0","B25VCgvU","z2v0t3DUuhi","z0DtAwC","BMCGB3iGyw4","x2nSzwfYvgK","t2jQzwn0","BxvbEK4","DgHLBG","qNPiChO","sKDHufq","DgLTzw91DcW","tunqAvq","zMzLCG","B25pCgvU","Cfj5zuy","svDttLy","r3nxwKW","CgvYC2LZDgu","zgL2z2q","BMv4DcGPigm","BMnVzgLUzW","Dev2zw50","C0nVDw50zxi","thz6re0","wNrJAuO","y01usuq","reHmthy","yunhDw0","qwjVCNrfCNi","y2fSBa","CM9YrxzLBNq","weLrCw4","y3jLyxrLrwW","Ec1TC2CTy3u","D3nZoI8V","B2LUDfjLywm","C2v0","tw9yC1y","De9wALC","CvjIEKW","q1bKExq","r3ntsxq","yvDhzKq","s1n0svK","svHfwhK","D2vI","CMvJzwL2zwq","BgPMEg0","EMfNEwK","sKDvAhC","DK5py0W","tePotvu","AxnrB1nby2S","CM92AwrLige","zw1PDa","BLPWrfO","EvPSwKW","y3vYC29YlNm","D1beDxq","CM5xvLO","u2joqLe","sxbTD0S","zgvIDwC","tg9JAW","sfbgz0i","Ahr0Ca","y3jLyxrLtwu","vwLzDuq","y29UC3rYDwm","txLsvwe","EuzizgK","zxjFywnRx20","x2n1CNnVCKy","vKjmDLi","x2HHBMrSzu8","Dwvuy2u","sgPVD3q","x2rLC3rYB3K","ALzgBLK","wuXvCNe","ruTlsKK","zgvSzxrL","Dvz3BMi","ntnWy05lD0m","y1f4y08","B25TzxnZywC","qMfvwMW","tLfOrKy","yMn4suu","zw1LBNq","re1mu3O","B25dBg9Zzq","nNWYFdm","rujJrvG","BeHHBMrSzxi","zeXMy08","shfKuxe","wujlr2e","DMXMsMO","Cw5Arui","B094uei","C0DfCfy","zgrlt2W","x3DZsw5ZDge","zcbLCNjVCI4","sLnJsue","Dhj1y3rVCIa","DgLTzw91Da","mZb3BxnIDfe","zNjVBujPDhm","Bg9N","zvHwr1q","BwvKAwf0zwW","z0j1zge","CM5tBKO","C2fNzq","AgLNAa","q2jfuKG","uK1HrgW","twr4rLO","B3bLBIa","veXIrLu","zvvZt1K","wxfJteu","zMzmAw5L","Efrurw52","y29UDgLUDwu","y3vYC29Y","y2HnyxHdB3u","qwPqCKS","yNL0zuXLBMC","wuLiz3q","x2rPC3bHDgm","Bwf4uMv0CMK","CgfNzwHPzgu","BgLUzq","D3Djuwu","s1DStK8","C3bSAxq","DgLLCKPtt04","BwvZC2fNzq","rvLzEwe","rgHou1u","r09mqKu","twjJsK0","BNvTyMvY","AgvHzgvY","D2f4DwG","q3Lbr0y","y3jLyxrLq2W","y2vZC0HHBMq","sfHzA0e","sfH6u08","veT6sLu","uLnSAeC","BKnrz3y","A2v5","y2HHCKnVzgu","B3jpBMXPBMu","D2DgzeW","A01kt3G","qNLnr1K","zK5nv0i","FdL8n3WZ","BNrLCG","BvDZExu","zxjFAxnFywm","rwHhq3K","wLrNvLm","tMXsDei","AxPiz2y","r1rvEwq","tg1mvvy","rgnQu3u","Ae9Wzw5fDMu","mJaXnJG1Cuziqu5u","y2f0y2G","yxv0BW","zxrcCha","zwHguee","AxnmB25N","DNjzu0i","yMLJveq","qvLzEgq","y29SBM8","Ec1TC2CTCw8","CKz5tgW","tunHAgy","tKHuu2O","sMvPq3O","DgHHBIbSB2m","wMnlELC","CMvZB2X2zq","zgfkCKS","AvLeue8","t2jqtgG","uunrreK","rKjKu08","rLLMA0y","ywfREhm","BxLVD00","uKfAvLC","z2v0qwXS","tMruCuG","ywXty29Wzq","z3LQrxK","vMf5B20","DeDIvfK","DMfS","EvfUD0q","zwvvEKC","B25ozxr3B3i","ChjzDNm","z3zhte8","vKPsr2C","BuPwwei","D0rzqxe","C3vYqxe","ve9ZDw4","yvHMqLq","Bw1Yzw0","DfnyDfq","BwfUDwfSihi","tMnSBvO","B2nRzxrtDwm","ywnRx2nVzgu","C3bSAwnL","sfLLC0C","zxjHDg9Y","zw50zwqGDhK","yxKSig5LDhC","ALPqqKK","y3vYC29Yx24","zgvJB2rLzey","zfDVCMTLCKC","s3LsseC","rgvKAwnHDgu","Aw92zMO","v0XHz1C","rgPyyLO","Cg9W","yw5Hz2vY","rKjrD1i","q0jmEgO","rxLtB3u","vvnTugu","zufJAW","wKftB3u","y29UBMvJDeu","u1bzz0O","Dw5JCwO","z1brC0q","yxrLq291BNq","DMfSDwvZ","CMvTB3zLrxy","AK5Xr3G","Aw5N","y29UBMvJDgK","qMHvEeK","uhbQzvK","DNfHqKK","BNrbBMrvCgq","x29WDgLVBNm","AgfUz2u","B25tDgfYDfi","zxLdBhm","z2v0u3rVCMe","DvnIz3C","r0TJCgi","vvjwD1O","y1btuNC","rNP2vKO","C2vUza","s0zqq1q","x0vysvnu","thDWtMu","sfjKzNq","yMLUyxj5vhK","t053A3e","yurwtvu","zxrxB3jRq2G","DxjS","rvDWBui","t1DWv3K","q3juBve","x2DLDeLUDgu","x2jPBMfYEvq","D21zrLK","zxDkDMW","Bhm6ia","AwToEg4","C2vYDMLJzq","uMHAzw4","s0PtyLq","x21PBMLoyxy","B3jRig9MzMW","suvtx0vsuK8","DuDAshe","vMnisLi","EwrNBxq","C1HPCxK","DenOCMi","wwrjs3O","DfL1BLm","wLjABK4","CMfTugfYyw0","CMvQzwn0","y29Kzq","rgvLB0O","BgLTAxq","tMD0v2C","A1DKywi","B3bLBKrc","zwHStei","vKfJz3q","DwLWuha","uK1rDwm","EKP2z2S","nda3mteZB3fQD2jo","x2LZqNjVD3m","Cgzbzgy","tuvtu0fhrv8","AvPwAKG","CxbtEwm","sM5IEKu","zwn0","y2uGBM90igK","zNDZxZeUmc4","ELzsD3C","AxnFywnR","CMfTzq","x3nLBMrby2S","ywDLsgLKzq","ywzL","Dw5KzwzPBMu","C0Ljr0O","wMnvtha","zwLJthK","Avrez2G","zMvY","ywXSzwqGBxu","yNLL","C1HNveG","zhfWwfy","zgLLvMW","Cgf5Bg9Hza","BMDpBKS","t2PgAKO","qKXyAuG","rfnWzvG","AwT4CKi","BLnXyNa","D1LdvMq","yxrHlcbKyxq","Cg93","wxDetKO","icSG","AwXSihvZzsa","Cg9PBNrbBMq","D2fZq2XLyw4","Dg9cExrLCW","z2LrDge","nKv6DM1vCW","qw5xyMW","vLbjvg4","BKXPBMu","CMvWBgfJzq","zw5HyMXLqxu","AefJA01LC3m","DNnjy00","y29UBMvJDca","zw5HyMXLuw8","ChfYt1G","CMvHC29U","DLPsEhG","C2HPzNq","zKLosey","x3bPBMDqB24","CgfNzxnOB3C","s2Dus3C","uhzpCM8","B3bnwfi","B3HtuLy","EefpEMq","CM92AwrLihC","Aufcuwq","s3H1sKi","u3bHrKq","rfLVAw0","DeLK","B0vyrxe","z2u6ia","zNjVBu51Bwi","BuPszMe"];return _n=function(){return r},_n()}var J={};(()=>{let r=S,e={MGIGB:function(s,t){return s+t},URVwZ:function(s,t,n,o){return s(t,n,o)},Noxtw:function(s,t){return s+t},CbERH:r(1179),eyCls:"mUfQe",pOjMm:function(s,t){return s+t},DcjSu:function(s,t){return s*t},LmLUV:function(s,t){return s+t},pfAdf:function(s,t){return s(t)},pagPB:function(s,t,n){return s(t,n)},Znymm:function(s,t,n){return s(t,n)},wkRlr:function(s,t){return s(t)},TrDVw:"0000",fgvbE:function(s,t){return s(t)},FicAt:r(1538)+"00000000"+r(1538)+r(1538),ETYUR:function(s,t){return s||t},CRalP:function(s,t){return s<t},divgd:function(s,t){return s!==t},iGEpl:r(243),VlPLL:r(675),igApW:function(s,t){return s-t},ZUoCJ:function(s,t){return s<t},kvcnf:function(s,t){return s-t},LuQpr:function(s,t){return s===t},NUuFK:function(s,t){return s-t},bcxIE:function(s,t){return s!==t},oOxPB:r(1462),NclmZ:function(s,t){return s!==t},dREzz:function(s,t,n){return s(t,n)},DYoim:function(s,t,n){return s(t,n)},DbmcV:function(s,t){return s!==t},KwlsY:r(365),NyEjk:r(436),tYunS:function(s,t,n){return s(t,n)},qbaWg:function(s,t){return s(t)},vPzoe:function(s,t,n){return s(t,n)},pqrOX:function(s,t,n){return s(t,n)},ozFVj:function(s,t){return s&t},qMlmZ:function(s,t){return s===t},fjSuV:r(665)+r(697)+" field: "+r(1472),xSIdn:function(s){return s()},KcJjH:function(s,t){return s==t},SbNBQ:function(s,t){return s>t},UcbcZ:function(s,t,n,o){return s(t,n,o)},qEsdX:function(s,t){return s+t},uSbgw:function(s,t){return s+t},ihNVT:function(s,t){return s===t},etBpp:r(787),jNVGB:function(s,t,n){return s(t,n)},CiatD:"bOsmM",LQKsI:function(s,t,n){return s(t,n)},TKYEw:function(s,t){return s!==t},DSpeX:function(s,t){return s===t},YIfUO:function(s,t,n){return s(t,n)},IVCcN:function(s,t,n){return s(t,n)},ZCTJf:function(s,t,n){return s(t,n)},cKOzB:function(s){return s()},qRbzL:function(s,t){return s(t)},mVTmX:function(s,t){return s!==t},jwKxT:function(s,t,n){return s(t,n)},vUKwj:function(s,t,n){return s(t,n)},Hfafw:function(s,t){return s!==t},faCoR:function(s,t,n){return s(t,n)},lTawN:function(s,t){return s!==t},zExUm:function(s,t,n){return s(t,n)},QwmpD:function(s,t,n){return s(t,n)},ahhey:function(s,t,n){return s(t,n)},CRxat:function(s,t){return s===t},deWQj:r(447),VGmaV:function(s,t,n){return s(t,n)},Lrdfc:function(s,t,n){return s(t,n)},rrvVL:function(s,t){return s(t)},xeQoy:function(s,t){return s(t)},fnXbu:function(s,t,n){return s(t,n)},WSAFN:function(s,t){return s(t)},ByMGY:function(s,t,n){return s(t,n)},wWdJk:function(s,t){return s(t)},VHCqB:function(s,t){return s&t},Zhwtb:function(s,t){return s===t},ZdZNp:"Missing "+r(697)+r(488)+"LogID",RUewl:r(665)+r(697)+r(488)+r(1123),YqcLE:"Missing "+r(697)+r(488)+"method",RmLCi:function(s,t){return s&t},cPSRw:function(s,t){return s(t)},qrLNV:function(s,t,n){return s(t,n)},ntJIx:function(s,t){return s+t},moFhl:r(627)+r(1061)+r(1271),xKeqU:function(s,t){return s>>t},TcGYG:function(s,t){return s===t},NuCCO:function(s,t){return s>t},ONwkq:"Skip past limit",XJysW:function(s,t){return s+t},xJUYg:function(s,t){return s!==t},zPOFR:r(124),NnOcg:r(1242),GsSIt:function(s,t){return s>=t},XLIlQ:function(s,t){return s+t},sCgJC:function(s,t){return s>t},CxEoj:function(s,t){return s>t},fiqjm:"Read pas"+r(352),HwtWF:r(363)+r(1205),RdNJQ:r(1449),RSlhG:function(s,t){return s+t},UeJyb:"FDOIh",rFyLl:function(s,t,n){return s(t,n)},daJrK:function(s,t){return s(t)},uXFIB:function(s,t,n){return s(t,n)},MyCtL:function(s,t){return s<t},WDfbn:function(s,t){return s===t},CSvgN:function(s,t){return s===t},CyAGF:function(s,t){return s>=t},JfqYB:function(s,t){return s&t},GFGAt:function(s,t){return s<<t},jTuWB:function(s,t){return s&t},izHgf:function(s,t){return s&t},MVXRT:function(s,t){return s(t)},KpGTX:function(s,t){return s>=t},tZuBP:function(s,t){return s+t},fHAsL:function(s,t){return s+t},uGPYf:function(s,t){return s+t},ZFknA:function(s,t){return s|t},ZASou:function(s,t){return s<<t},MoXsV:function(s,t){return s<<t},cMCvo:function(s,t){return s&t},RJZZR:function(s,t){return s<=t},NdTqH:function(s,t){return s===t},NLKeZ:r(376),TKzJU:function(s,t){return s(t)},SFCjP:function(s,t){return s==t},kwWsJ:function(s,t){return s+t},xzscd:function(s,t){return s+t},elYFC:function(s,t){return s+t},IpmwK:function(s,t){return s+t},HuSNw:function(s,t){return s&t},vVeoj:function(s,t){return s<<t},RhZen:function(s,t){return s<<t},dKfTF:function(s,t){return s|t},nNBEl:function(s,t){return s|t},JScIA:function(s,t){return s&t},iHWXq:function(s,t){return s<<t},OWpWy:function(s,t,n){return s(t,n)},YdLxS:function(s,t){return s>>t},UKWuv:function(s,t){return s&t},VcHJR:function(s,t){return s|t},YBKGa:function(s,t){return s<<t},DHNef:function(s,t){return s+t},kDHTj:function(s,t){return s|t},rLaEt:function(s,t){return s<<t},LJNMU:function(s,t){return s+t},fINHF:r(1051),NwKOT:function(s,t){return s>=t},usiCy:function(s,t){return s<t},HKyWU:function(s,t){return s<t},giQta:function(s,t,n){return s(t,n)},NIgps:function(s,t){return s<t},LZktf:function(s,t){return s<t},pbMie:function(s,t){return s-t},FAiXj:r(302),xRKZX:function(s,t){return s&t},rpiFD:function(s,t){return s<t},csLce:function(s,t){return s>>t},HwxlE:function(s,t){return s|t},wYCVd:function(s,t){return s>>t},RMaDl:function(s,t){return s|t},LtlpD:function(s,t){return s&t},xHrRb:function(s,t){return s&t},yhrgd:function(s,t){return s>>t},TeFqq:function(s,t){return s|t},MLJZR:function(s,t,n){return s(t,n)},wuwmP:function(s,t){return s<t},csoRb:function(s,t,n){return s(t,n)},qjNJf:function(s,t){return s(t)},PvKYX:function(s,t){return s<<t},ewiok:r(1510),BETIE:function(s,t){return s!==t},JowjM:r(239),nlXrZ:function(s,t){return s|t},jzKNQ:function(s,t){return s&t},HejMa:function(s,t){return s>>>t},TrxnV:function(s,t){return s+t},qnZEB:function(s,t){return s|t},zlUHv:function(s,t){return s<<t},Thcml:r(242),IkgAs:r(705),wgFdL:function(s,t){return s(t)},SRKUf:function(s,t){return s&t},syeTz:function(s,t){return s<<t},angSb:function(s,t){return s&t},fvGyn:function(s,t){return s&t},FVHFT:function(s,t){return s<<t},FUDzY:"ekNpn",EoZnM:function(s,t){return s&t},PgXcm:function(s,t){return s&t},sPLyB:function(s,t){return s(t)},NqVaU:function(s,t){return s&t},gvGLO:function(s,t){return s&t},dZKyv:function(s,t){return s&t},SPYgJ:function(s,t){return s(t)},YLUrq:r(440),ovgpq:function(s,t){return s&t},jhJtZ:function(s,t){return s<<t},PjUfl:function(s,t){return s>>>t},VMXXJ:function(s,t){return s>>>t},oHGwx:function(s,t){return s===t},hObYE:function(s,t,n){return s(t,n)},AnWbl:function(s,t){return s+t},blTLd:function(s,t){return s&t},ybfPj:function(s,t){return s+t},ZgVVA:function(s,t){return s>>>t},REkTx:function(s,t){return s+t},Vxdld:function(s,t){return s>>>t},DeeoJ:function(s,t){return s+t},UiYuD:function(s,t){return s!==t},uGZHq:function(s,t){return s>>>t},TOsun:function(s,t){return s!==t},BDYAZ:function(s,t){return s|t},eceeF:function(s,t){return s&t},VAcgt:function(s,t){return s|t},FWmmk:function(s,t){return s&t},YWHoj:function(s,t){return s>>>t},ImBqq:function(s,t){return s+t},YgvYY:function(s,t){return s|t},FBQwR:function(s,t){return s>>>t},APwgo:function(s,t){return s!==t},HXYkA:function(s,t){return s===t},QAnEy:function(s,t){return s*t},ddKOl:function(s,t){return s>t},azDhf:r(301),dqpXV:function(s,t){return s<<t},fmWzR:function(s,t){return s<<t},AjPrK:function(s,t){return s|t},BtTpC:function(s,t){return s<<t},Vayom:r(467),GUuzi:function(s,t){return s|t},FzvVJ:function(s,t){return s|t},HXcpM:function(s,t){return s<<t},uVwnb:function(s,t){return s<<t},prYvs:function(s,t){return s|t},JaUkw:function(s,t){return s|t},gxbUq:function(s,t){return s|t},begGH:"cYcmi",mIdNz:r(125),GKcpb:function(s,t){return s>>>t},DIseE:function(s,t){return s|t},uDoiJ:function(s,t){return s|t},qEosY:function(s,t){return s<<t},lizzr:function(s,t){return s<<t},UhsQi:function(s,t){return s>>>t},kTyzW:function(s,t){return s|t},EpEjN:function(s,t){return s|t},uhFZg:function(s,t){return s<<t},kanup:"nXkMo",EUMaf:function(s,t){return s&t},ORIrE:function(s,t){return s>>>t},EySou:function(s,t){return s&t},TFlIQ:function(s,t){return s(t)},lbmdo:function(s,t){return s|t},MeBhX:function(s,t){return s%t},siadO:function(s,t){return s>>>t},vkaJr:function(s,t){return s*t},IfxPP:function(s,t){return s===t},sjWTi:function(s,t){return s===t},xLovA:function(s,t){return s>>>t},dRgjT:function(s,t){return s>>>t},sVHpG:function(s,t){return s+t},MdxFZ:function(s,t){return s>>>t},KkXao:function(s,t){return s+t},tOVjW:function(s,t){return s<<t},mmrem:function(s,t){return s|t},mhTjT:function(s,t){return s<<t},gyjEy:function(s,t){return s(t)},UHOvx:function(s){return s()},CBepp:"yAoXv",HCaRt:r(1041),fNMWB:function(s,t){return s===t},NaQSF:function(s,t){return s>>>t},hHAFd:function(s,t){return s===t},iilvi:function(s,t){return s+t},kwNOX:r(1001),daLhQ:function(s,t){return s|t},gegRj:function(s,t){return s|t},gGSig:function(s,t){return s&t},RUDWc:function(s,t){return s>>>t},qwVxV:function(s,t){return s!==t},EWyCq:"AGKiQ",nzSvF:function(s,t){return s>>>t},dYYpP:function(s,t){return s&t},hamIT:function(s,t){return s>>>t},FPivq:function(s,t){return s&t},qTRQU:function(s,t){return s>>>t},oSZNi:function(s,t){return s>>>t},zZnSz:function(s,t){return s&t},mJVXB:"3|5|2|1|"+r(187),RMQuc:"MESSAGE_ERROR",FZgcs:r(141)+r(1128)+"R",RGrdc:r(755)+r(512),Ybuoh:r(655)+"OR",jVFnY:r(1426)+"NG_ERROR",dXZQO:r(774)+r(924),fJYJM:function(s,t){return s>=t},JJKFp:function(s,t){return s===t},KDTPp:r(168),gldNb:r(1544),dHjtG:r(1523),avsDO:"zJlQo",dhgZg:r(987),yrtSo:"nAYVE",rbyJP:function(s,t){return s-t},uNTcx:function(s,t){return s===t},JeiCz:function(s,t){return s>t},KJSbT:function(s,t){return s instanceof t},SFFtn:r(157)+r(936),myowM:function(s,t){return s===t},GzeKQ:function(s,t){return s===t},SmaYr:function(s,t){return s===t},mrWFf:function(s,t,n){return s(t,n)},fZRPc:r(514),fsrJF:function(s,t){return s!==t},QwHDc:r(362),bkryA:r(354),KyRHG:"OEREe",UyEkY:"message",dyOQQ:"RzOXH",TMtSG:function(s,t){return s!==t},nagyH:"NkSae",HxQvH:"UOvGq",lYxdw:function(s,t,n){return s(t,n)},yJScy:function(s,t){return s<t},zRGlO:function(s,t){return s+t},oEXEq:function(s,t){return s(t)},SpaFD:function(s,t){return s!==t},bBsiO:r(731),hBZkU:function(s,t,n){return s(t,n)},Mdxqf:function(s,t){return s!==t},hGmrz:r(1299),vqaBI:function(s,t){return s!=t},aLuwS:r(1166)+"d",mJRfa:function(s,t){return s||t},cKDld:function(s,t){return s!=t},KueZM:function(s,t){return s<=t},ARkTc:r(851)+r(1172)+"ltiple t"+r(1492)+"process",JAXHQ:function(s,t){return s+t},zKVtV:function(s,t){return s(t)},zAcAt:function(s,t){return s===t},HRdft:function(s,t){return s===t},pWOGC:"reerh",ZTgVS:r(939),MyRUa:r(304)+"e_timeout",DUvze:function(s,t){return s<=t},fYYqj:function(s,t){return s<t},FBIPy:function(s,t){return s|t},pmUkp:function(s,t){return s<<t},wPRGB:function(s,t){return s&t},LcBvA:function(s,t){return s<t},ueTce:function(s,t){return s&t},AOEZS:r(1240),VLvSW:function(s,t){return s|t},TUqQC:function(s,t){return s|t},xGlEK:function(s,t){return s&t},RyCHY:function(s,t){return s<<t},OErLz:function(s,t){return s&t},dqvZM:function(s,t){return s&t},BzHpz:function(s,t){return s&t},rBieA:function(s,t){return s+t},XIQqn:function(s,t){return s&t},ZRZnN:function(s,t){return s===t},NoYQk:"NGgPs",BvBRI:function(s,t){return s<t},zOKHz:function(s,t){return s<t},gaWhv:function(s,t){return s===t},JDidD:r(1422)+"3|0",TpsLk:function(s,t){return s|t},eXVGT:function(s,t){return s+t},fAgix:function(s,t){return s&t},qpSyc:function(s,t){return s|t},JYSFB:function(s,t){return s|t},kWdab:function(s,t){return s>>t},aakxs:function(s,t){return s===t},cBuNO:r(1145),rEdlU:function(s,t){return s|t},ppYIZ:function(s,t){return s>>t},tGbTY:function(s,t){return s<t},yKLTj:function(s,t){return s+t},LnWrW:r(879),yFBmD:function(s,t){return s==t},geXZZ:r(1556),zjsNs:function(s,t){return s(t)},mIwRU:r(138),CPdyt:r(745),cCKYZ:"jthhS",gfwtj:function(s,t){return s!=t},NbQoK:r(1588)+r(334),VPITn:"text/pla"+r(1292)+r(661),GjgSM:r(1508),TefRI:r(274),Ljifb:function(s,t,n){return s(t,n)},vtQnU:function(s,t){return s(t)},qesOz:function(s,t){return s+t},vjWnc:r(401)+"ack=fron"+r(971)+"P",uiSHC:function(s,t,n,o){return s(t,n,o)},fUavy:r(101),sXgTH:r(106),SJXox:function(s,t){return s!==t},xtzjI:r(186),rnSnJ:r(1458),jNmqN:"ws://",GKffR:r(646),OnYUq:r(1491),uplSM:function(s,t,n){return s(t,n)},eeUzG:function(s,t){return s(t)},iPBBq:"YQcPf",QCQDI:function(s,t){return s||t},myXVu:function(s,t){return s||t},ougLh:function(s,t,n){return s(t,n)},oNnYr:r(454),UjtHS:function(s,t){return s||t},Lxdzc:function(s,t){return s||t},eCJTl:function(s,t){return s||t},paVJv:function(s,t){return s!=t},MCahf:r(1515)+"DB failed",GCHuo:function(s,t,n){return s(t,n)},LwpNe:r(1278),VjBUg:"message_id",ydgmt:function(s,t){return s(t)},leUzB:"abort",DzvxB:r(1384),RFFSr:r(642),zagyi:function(s,t){return s(t)},RPnOH:function(s,t,n,o){return s(t,n,o)},igmTI:r(1332)+r(1592),waxuh:function(s,t,n,o){return s(t,n,o)},bBtgE:"x_fronti"+r(998)+"k",geISi:r(1332)+r(903)+r(827),EBcEX:"need_ack",VBLvR:"ack_id",ObbFp:r(1057),uSKmx:function(s){return s()},HTSfb:r(878),TctSP:function(s,t){return s instanceof t},bagjk:function(s,t){return s instanceof t},rCKvh:function(s,t){return s instanceof t},dLfcO:function(s,t){return s!==t},nQSDt:r(1011),EygIl:function(s,t,n,o){return s(t,n,o)},uAThU:function(s,t){return s>t},kMJOx:function(s,t){return s||t},SfGRW:function(s,t){return s(t)},ohczv:r(108)+r(683)+r(1223),AfZGJ:r(1188),rMiNC:r(798),tfAUq:r(601)+r(434)+"e",tSsnP:function(s,t){return s>=t},Cyazs:r(255),alQje:function(s,t){return s+t},DHLLv:function(s,t){return s<t},iOHIO:function(s,t){return s>>>t},mSyWT:"2|1|3|4|0",neQez:function(s,t){return s<t},CDDst:function(s,t){return s+t},TxYUG:function(s,t){return s|t},JGaPT:function(s,t){return s+t},lNoBg:function(s,t){return s+t},HYesG:function(s,t){return s|t},zVRww:function(s,t){return s|t},mmCLR:function(s,t){return s<<t},MJDsI:function(s,t){return s+t},GTUyd:function(s,t){return s+t},HcgdO:r(600)+">",rPWla:function(s,t){return s!==t},CrXPY:r(504),babfT:r(1274),SpIXn:function(s,t){return s>>>t},qnCBD:function(s,t){return s+t},KtIIu:function(s,t){return s&t},CWOqs:function(s,t){return s&t},iABQd:function(s,t){return s&t},HXzSO:function(s,t){return s+t},ySvDe:function(s,t){return s>>>t},TLeod:function(s,t){return s+t},fLcna:function(s,t){return s&t},wePgu:function(s,t){return s>>>t},tkQdE:function(s,t){return s+t},RAZVW:function(s,t){return s>>>t},FpPLg:function(s,t){return s+t},dirxG:function(s,t){return s+t},WjGoN:function(s,t){return s&t},EcBqy:function(s,t){return s+t},bJrpg:function(s,t){return s|t},DnEsZ:function(s,t){return s|t},QMpsR:function(s,t){return s<<t},KgTKw:function(s,t){return s|t},LNPqk:function(s,t,n,o){return s(t,n,o)},SSsIO:function(s,t){return s(t)},KxuJB:r(1123),rbyMP:r(1428),TLbFU:r(1351)+r(695),MZNbM:r(695),AieiU:function(s,t){return s(t)},gJnnC:r(560)+r(529),GtXKt:function(s,t,n){return s(t,n)},NldmI:function(s,t){return s+t},pOKfV:function(s,t,n){return s(t,n)},JaDyh:r(1064)+r(1394),ghIPs:r(1255),jPngm:r(1505)+"rValues",hmouZ:r(403),HPFgB:function(s,t,n,o){return s(t,n,o)},qDkEP:"INSTANT",WdjfV:r(233),jkeaE:function(s,t){return s(t)},Gppry:r(805)+"r",Phiwg:function(s,t){return s||t},dbGwq:function(s,t,n,o){return s(t,n,o)},KGXrV:"code",jMMFj:"is_ack",ikNxn:r(1332)+r(803),vZgpC:function(s,t){return s(t)},GsWZL:function(s,t,n){return s(t,n)},OeNtb:r(1332)+r(1561),xaqWX:function(s,t){return s(t)},BfSRh:r(865)+"rsor_value",xAOzd:function(s,t){return s>t},meJtW:r(212),eCPev:function(s){return s()},LpmYq:function(s){return s()},FlNOk:function(s,t){return s===t},cQxcO:function(s,t){return s&&t},HEGRh:function(s,t,n){return s(t,n)},wPDut:function(s){return s()},ZcKzW:function(s){return s()},JkWFU:function(s,t){return s<t},IVOla:function(s,t){return s===t},CrTmQ:function(s,t,n){return s(t,n)},FNvxk:r(1105),cMTID:function(s,t){return s===t},CbfOc:function(s,t){return s===t},oBbAj:"always",VAjIR:r(1009),vDKYp:r(304)+r(1227)+"s",hDLaw:function(s,t,n){return s(t,n)},zcaWd:function(s,t,n,o){return s(t,n,o)},NgUBh:function(s,t,n){return s(t,n)},YIHgt:function(s,t){return s!==t},XpqyB:r(151),weOox:function(s,t,n){return s(t,n)},eUsOY:function(s,t){return s===t},hAJeo:function(s,t,n){return s(t,n)},aCcIw:r(226),BRUlL:r(973),PvOro:function(s,t){return s!==t},ewJvl:r(1173),TewJb:function(s,t){return s(t)},EqmrW:function(s,t,n){return s(t,n)},GMuYb:r(1447)+r(1171),mNFNP:r(1420),eNlJR:function(s,t){return s/t},XtjjS:function(s,t){return s===t},eqZPJ:function(s,t){return s(t)},iTDgh:"please p"+r(1216)+r(1395)+", WebSocket cons"+r(938)+"is undef"+r(472),JHLcx:function(s,t,n){return s(t,n)},RIBvg:r(643)+"t",kGTli:r(1593)+"ediately reconnect",zKCoS:"offline",DbqcU:"pagehide",sEhMI:r(1210),Bjxmq:r(262),rrICQ:r(672),KKYJx:r(499),wSRRk:r(379),aDVMU:function(s,t,n){return s(t,n)},lDnPQ:r(1387),IxLwS:r(825),OiNnn:r(478),FBdSO:function(s,t){return s!==t},muXBQ:function(s,t){return s|t},lUhTm:function(s,t){return s<<t},FYfkF:function(s,t){return s<<t},HqdQq:function(s,t){return s<<t},gbZvC:r(647)+r(718),vlfJj:r(1337),qDQdp:r(248),YRsTf:function(s,t){return s===t},atMft:"OgtdV",sIIGJ:r(748),dgZGS:function(s,t){return s==t},mWDuW:"wss://",VTWuI:function(s,t){return s!==t},PhKgx:r(383),iyHdF:"bd_did",BsuMa:r(609),uQttU:r(1485)+"d",aoToQ:"please provide b"+r(528)+r(246)+"r ttwID",ZHhgR:"function",OtdkR:function(s,t,n){return s(t,n)},gBuda:r(877),JGUhw:r(1159)+"0",NRyDP:function(s,t,n){return s(t,n)},gkxuF:function(s,t,n){return s(t,n)},nKGcv:function(s,t){return s>t},vNOcL:function(s,t){return s-t},kKBkW:function(s,t,n){return s(t,n)},wwIQe:function(s,t){return s(t)},AaBFm:function(s,t){return s(t)},fFmag:function(s,t){return s*t},JRdTF:function(s,t){return s|t},NUCqq:"DDVGc",huont:function(s,t,n){return s(t,n)},LvzDM:function(s,t){return s!==t},IwUtV:"going aw"+r(425)+r(643)+"ting ser"+r(285),QGaCb:function(s,t){return s!==t},aovJA:"aDBHD",HEPsW:function(s,t){return s(t)},mYxFG:"MMWhM",jgKBi:r(728),nHIqi:r(573),VmIop:function(s,t,n){return s(t,n)},Rvhgt:function(s,t){return s===t},YhsuL:r(1377),RUJUG:r(1046),tGFdr:r(842)+r(109)+r(602)+"g",nSqbp:r(325),izOyV:r(465)+"3",kWfku:"4|2|1|0|3",ofLnG:r(969),mhAVz:r(1412),uncqj:function(s,t,n){return s(t,n)},uYdVU:function(s,t,n){return s(t,n)},rLKyz:function(s,t,n){return s(t,n)},QKMnc:r(388),MbcJM:function(s,t){return s(t)},LgGeI:function(s,t){return s+t},NPTMP:"bicTD",ngOnK:function(s,t){return s||t},tvOPK:r(524),QBqXI:r(1476),INomQ:function(s,t){return s|t},bnFNW:function(s,t){return s&t},OAqyx:function(s,t){return s===t},DhNSU:r(667),Nuslj:r(114)+r(1267)+r(1158)+r(305)+"ed",doqFW:r(114)+r(603)+r(1263),roZkS:r(816)+r(885)+" valid d"+r(1185)+r(1567)+r(701)+r(835)+" arraybu"+r(844),XNHfl:function(s,t){return s==t},mPBXU:r(977),fRTtX:function(s,t){return s instanceof t},DrlSB:function(s,t){return s(t)},cVVoV:function(s,t){return s||t},BaUZl:r(816)+"rovide a valid s"+r(1317),rnWVZ:r(721),MfDcM:function(s,t){return s<t},hrxgh:"MuCEp",lxdHY:r(574),asbSu:function(s,t){return s||t},egHKr:function(s,t){return s==t},jZPBI:function(s,t){return s!==t},iovfj:r(1054)+r(1432)+r(1088),nnmKj:r(567),MsKwJ:r(1500),vsIcM:function(s,t){return s(t)},ecssR:r(1342),iXCMR:function(s,t){return s===t},ZSeXY:r(416),pRyeF:function(s,t){return s!=t},CpRYI:function(s,t){return s===t},cwpCD:r(837),jNqGx:function(s,t){return s!=t},qXGtm:r(1068)+"dWorkerGlobalScope",USmPe:"ServiceWorkerGlobalScope",Jgvpy:function(s,t){return s===t},VIHhm:function(s,t,n){return s(t,n)},AuHkT:"__x_msg_"+r(428)};ye.r(J),ye.d(J,{FWS:()=>I0,CustomErrorEvent:()=>es,createCloseEvent:()=>ge,ReconnectEvent:()=>Qr,createErrorEvent:()=>fe,decodedFrame:()=>Vr,createOpenEvent:()=>os,CustomCloseEvent:()=>ts,createReconnectEvent:()=>Jn,FrontierMessageEvent:()=>rs,encodeFrame:()=>Wn,createMessageEvent:()=>is,OpenEvent:()=>ss,ErrorCode:()=>Oe,Event:()=>it,MessageEvent:()=>ns});let i="";function a(s=""){let t=r,n={JsKyZ:function(o,c){return e.MGIGB(o,c)},cpnGm:t(638)+"t limit"};if(t(282)!==t(1090)){let c=""+Date.now(),d=i||(i=m(s)),p=Math.random()[t(1555)](16)[t(625)](-6);return"02"+c+d+p}else{let o=_0x24e6a5[t(610)];if(n[t(684)](o,_0x4069aa)>_0x416f9f.limit)throw new _0x11e485(n[t(289)]);return _0x22b077[t(610)]+=_0xe33e44,o}}function x(){let s=r;if(e[s(949)]===e[s(1097)]){let t=(s(495)+"0").split("|"),n=0;for(;;){switch(t[n++]){case"0":return e[s(1518)](e[s(1101)](_0x195761,_0x4e8a96,_0xa7aa53,_0x4fff06),_0x3b4bd9);case"1":if(_0x52454b.length<40)return e[s(1518)](_0x23431e(_0x227f80,_0x22c48c,_0x305bad),_0x551dba);continue;case"2":if(!_0x5a831a)return _0x2349bc;continue;case"3":if(_0x167bfd[s(562)])return e[s(1518)](_0x1f1ce3[s(562)](_0x5efe0d,_0x415633),_0x1af248);continue;case"4":if(_0x494e11.utf8Write)return e.Noxtw(_0x34fe1a[s(181)+"e"](_0x2c81d5,_0x2438a6),_0x2bd1b8);continue}break}}else return e.pOjMm(1e4*Date[s(1446)](),Math.floor(e[s(1005)](1e4,Math[s(527)]())))}function f(s){let t=r;return e[t(1004)](e.pfAdf(Array,8).join("0"),e[t(626)](parseInt,s,10)[t(1555)](2)).slice(-8)}function u(s){let t=r;return e[t(1295)](Array(4)[t(283)]("0"),e[t(544)](parseInt,s,2)[t(1555)](16))[t(625)](-4)}function h(s){let t=r,n=s[t(970)](/\./).map(d=>f(d)),o=[];return o[0]=e[t(1152)](u,e[t(1518)](n[0],n[1])),o[1]=e.wkRlr(u,e[t(1295)](n[2],n[3])),[e[t(1529)],e[t(1529)],t(1268),t(1268),e.TrDVw,t(790),o[0],o[1]].join("")}function m(s){let t=r,n=/(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}/[t(1430)](s),o=/(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))/[t(1430)](s);return n?e.fgvbE(h,s):o?e[t(757)](w,s):e[t(343)]}function w(s){let t=r,n="",o=[],c=0,d=0,p=!0,g=e[t(1529)];if(s[t(165)]("::")>-1){let l=s.split("::");for(let b=0;e.CRalP(b,l.length);b++){let D=l[b];if(D.indexOf(":")>0)if(e[t(850)](e[t(1585)],e[t(751)])){let I=D.split(":");p&&(c=I.length),d+=I[t(769)];for(let P=0;P<I[t(769)];P++)if(e[t(850)](4,I[P][t(769)])){let q=g.substring(0,e[t(132)](4,I[P][t(769)])),se=q[t(1288)](I[P]);o.push(se)}else o[t(473)](I[P]);p=!1}else{let I=this[t(799)][t(1363)](this[t(492)]),P=_0x21b038[t(1324)](e[t(538)](I,"{}"));return _0x5e9f73.values(P)}else{if(D[t(769)]!==4){let I=g.substring(0,e[t(132)](4,D[t(769)])),P=I[t(1288)](D);o[t(473)](P)}else o[t(473)](D);p&&(c+=1),d+=1,p=!1}}let v="";for(let b=0;e[t(310)](b,e.kvcnf(8,d));b++)v=v[t(1288)](g);for(let b=0;e[t(310)](b,o[t(769)]);b++)e[t(616)](b,c)&&(n=n[t(1288)](v)),n=n[t(1288)](o[b]);return n}{let l=s[t(970)](":");for(let v=0;v<l[t(769)];v++){let b=l[v];if(l[v][t(769)]!==4){let D=g[t(572)+"g"](0,e[t(1286)](4,l[v][t(769)])),I=D[t(1288)](b);n=n[t(1288)](I)}else n=n.concat(b)}return n}}function y(s,t){let n=r;if(!e[n(920)](e[n(932)],e[n(932)])){let o=s.key;o!==void 0&&($(t,10),Ce(t,o));let c=s[n(1472)];e.NclmZ(void 0,c)&&(e[n(439)]($,t,18),e[n(1220)](Ce,t,c))}}function _(s){let t=r,n={};e:for(;!e.wkRlr(we,s);)if(e[t(219)](e.KwlsY,e[t(1468)])){let o=e[t(1152)](ee,s);switch(o>>>3){case 0:break e;case 1:n[t(988)]=e[t(1135)](Ee,s,e.qbaWg(ee,s));break;case 2:n[t(1472)]=e[t(1310)](Ee,s,ee(s));break;default:e.pqrOX(re,s,e[t(256)](7,o))}}else this[t(500)+"s"]=_0x154761,this[t(965)+"es"]=_0x13a765,this[t(1406)+t(1453)]=0,this[t(328)+t(145)+t(1241)+"t"]=0;if(e.qMlmZ(void 0,n[t(988)]))throw new Error(t(665)+t(697)+" field: "+t(988));if(n.value===void 0)throw new Error(e[t(1400)]);return n}function C(s){let t=r,n=e[t(1380)](M);return e[t(626)](L,s,n),Be(n)}function L(s,t){let n=r,o={uipPp:function(c,d,p,g){return e.UcbcZ(c,d,p,g)},sSMDd:function(c,d){return e.qEsdX(c,d)},uiIpv:function(c,d){return c>>>d},nfIbs:function(c,d){return e[A(1099)](c,d)},YCBLV:function(c,d){return e[A(1005)](c,d)},HSXFF:function(c,d){return c>>>d}};if(e[n(1482)](n(1308),e[n(1010)]))o[n(1147)](_0x178dd0,this,_0x6c619e,[_0x378cb7,_0x40c59b,_0x216322]);else{let c=s[n(191)];e[n(920)](void 0,c)&&($(t,8),e[n(258)](vt,t,c));let d=s.LogID;if(e[n(920)](void 0,d))if(e[n(1229)]===n(641))e[n(340)]($,t,16),vt(t,d);else return e[n(1534)](this[n(1406)+n(1453)],this.endpoints[n(769)])?!0:e[n(892)](this[n(328)+n(145)+"riesCount"],this.maxRetries);let p=s[n(1123)];e[n(1055)](void 0,p)&&(e.tYunS($,t,24),e[n(1220)](vt,t,ae(p)));let g=s[n(1246)];if(e.TKYEw(void 0,g)){if(e.DSpeX(n(377),n(637)))return this[n(1535)]?o[n(546)](o.uiIpv(this[n(948)],0)*_0x5df11f,o.uiIpv(this[n(1362)],0)):o[n(113)](o[n(1444)](this[n(948)],_0x3cc343),o[n(1496)](this[n(1362)],0));e.YIfUO($,t,32),e.IVCcN(vt,t,e[n(1152)](ae,g))}let l=s[n(491)];if(e[n(1055)](void 0,l))for(let qe of l){e[n(154)]($,t,42);let Fe=e.cKOzB(M);e.IVCcN(y,qe,Fe),$(t,Fe.limit),e[n(544)](De,t,Fe),e.qRbzL(G,Fe)}let v=s[n(1401)+n(852)];e[n(746)](void 0,v)&&(e[n(1554)]($,t,50),e.vUKwj(Ce,t,v));let b=s[n(518)+n(1279)];e.Hfafw(void 0,b)&&($(t,58),e.IVCcN(Ce,t,b));let D=s[n(1177)];D!==void 0&&(e[n(180)]($,t,66),e[n(1310)]($,t,D[n(769)]),e.faCoR(zt,t,D));let I=s[n(121)];e.lTawN(void 0,I)&&(e.zExUm($,t,74),Ce(t,I));let P=s[n(564)+n(350)];P!==void 0&&(e[n(1329)]($,t,82),e.ahhey(Ce,t,P));let q=s[n(1483)];if(e.lTawN(void 0,q))if(e[n(199)](e.deWQj,e[n(1498)]))$(t,90),e[n(660)](Ce,t,q);else return n(612)+"_"+this[n(332)];let se=s[n(1275)+"e"];se!==void 0&&($(t,96),e[n(1290)](vt,t,e.rrvVL(ae,se)))}}function T(s){return R(e.xeQoy(Se,s))}function R(s){let t=r,n={};e:for(;!e[t(1152)](we,s);){let o=e[t(1587)](ee,s);switch(o>>>3){case 0:break e;case 1:n.SeqID=e[t(544)](Jr,s,!0);break;case 2:n[t(1570)]=e[t(1329)](Jr,s,!0);break;case 3:n[t(1123)]=ee(s);break;case 4:n.method=e.qbaWg(ee,s);break;case 5:{let c=e[t(1335)](j,s);(n[t(491)]||(n[t(491)]=[]))[t(473)](e[t(1152)](_,s)),s[t(1141)]=c;break}case 6:n[t(1401)+t(852)]=e.fnXbu(Ee,s,e[t(1587)](ee,s));break;case 7:n[t(518)+t(1279)]=e.ZCTJf(Ee,s,e[t(137)](ee,s));break;case 8:n[t(1177)]=e[t(626)](Ot,s,e[t(757)](ee,s));break;case 9:n[t(121)]=e.vUKwj(Ee,s,e[t(104)](ee,s));break;case 10:n.serverTiming=e[t(993)](Ee,s,e[t(466)](ee,s));break;case 11:n[t(1483)]=e.YIfUO(Ee,s,e.wkRlr(ee,s));break;case 12:n[t(1275)+"e"]=ee(s);break;default:re(s,e[t(123)](7,o))}}if(e.DSpeX(void 0,n.SeqID))throw new Error(t(665)+t(697)+t(488)+t(191));if(e[t(481)](void 0,n[t(1570)]))throw new Error(e[t(749)]);if(e.ihNVT(void 0,n[t(1123)]))throw new Error(e[t(254)]);if(e[t(616)](void 0,n[t(1246)]))throw new Error(e[t(955)]);return n}function j(s){let t=r,n=ee(s),o=s[t(1141)];return s[t(1141)]=e.qEsdX(s[t(610)],n),o}function re(s,t){let n=r;switch(t){case 0:for(;e[n(680)](128,e[n(1102)](Q,s)););break;case 2:e[n(1521)](me,s,ee(s));break;case 5:me(s,4);break;case 1:e[n(314)](me,s,8);break;default:throw new Error(e[n(585)](e.moFhl,t))}}function ae(s){let t=r;return s|=0,{low:s,high:e[t(236)](s,31),unsigned:s>=0}}let k=[];function M(){let s=r,t=k[s(1072)]();return t?(t[s(610)]=t.limit=0,t):{bytes:new Uint8Array(64),offset:0,limit:0}}function G(s){k[r(473)](s)}function Se(s){return{bytes:s,offset:0,limit:s.length}}function Be(s){let t=r,n=s.bytes,o=s[t(1141)];return e[t(1573)](n[t(769)],o)?n:n[t(257)](0,o)}function me(s,t){let n=r;if(e.NuCCO(e[n(614)](s[n(610)],t),s[n(1141)]))throw new Error(e[n(1110)]);s[n(610)]+=t}function we(s){let t=r,n={GdhOz:function(o,c){return e[A(123)](o,c)},IPKlc:function(o,c){return e[A(349)](o,c)}};return e[t(176)](e[t(1296)],e.NnOcg)?e.GsSIt(s[t(610)],s[t(1141)]):(_0x1254ce[t(103)+"t8"]?_0x293739[t(103)+"t8"](_0x186d5c,_0x2c3bcf):_0x5340e6[_0xf8f68c]=n[t(241)](255,_0x240f94),n.IPKlc(_0x1be73e,1))}function he(s,t){let n=r,o=s[n(1478)],c=s[n(610)],d=s[n(1141)],p=e[n(1503)](c,t);if(e[n(267)](p,o[n(769)])){let g=new Uint8Array(2*p);g[n(868)](o),s[n(1478)]=g}return s[n(610)]=p,e[n(312)](p,d)&&(s[n(1141)]=p),c}function rt(s,t){let n=r,o=s[n(610)];if(e[n(267)](e[n(349)](o,t),s[n(1141)]))throw new Error(e[n(1297)]);return s[n(610)]+=t,o}function Ot(s,t){let n=r,o={tVJzH:function(c,d){return c(d)},AQDRw:e[n(221)]};if(e[n(149)]!==n(1213)){let c=rt(s,t);return s[n(1478)].subarray(c,e[n(986)](c,t))}else _0x3097a4[n(612)+n(1524)]=void 0,o[n(645)](_0x13ccc5,o[n(1461)])}function zt(s,t){let n=r;if(e[n(1181)](e[n(490)],e[n(490)])){let o=e[n(1018)](he,s,t[n(769)]);s.bytes.set(t,o)}else return _0x4c6099(_0xe68e07.apply(_0x34a257(this),_0x88198))}function Ee(s,t){let n=r,o=e[n(1305)](rt,s,t),c=String[n(620)+n(639)],d=s[n(1478)],p="\uFFFD",g="";for(let l=0;e[n(594)](l,t);l++){let v=d[e.qEsdX(l,o)],b,D,I,P;if(e.WDfbn(128&v,0))g+=e.pfAdf(c,v);else if(e[n(1254)](224&v,192))e.CyAGF(l+1,t)?g+=p:(b=d[e[n(1099)](e[n(986)](l,o),1)],e[n(1455)](192,b)!==128?g+=p:(P=e[n(824)](e[n(253)](31,v),6)|e[n(1002)](63,b),e.MyCtL(P,128)?g+=p:(g+=e[n(1487)](c,P),l++)));else if(e.KcJjH(e[n(1002)](240,v),224))if(e[n(189)](l+2,t))g+=p;else if(b=d[e[n(430)](l+o,1)],D=d[e[n(194)](e[n(1309)](l,o),2)],e[n(219)](e[n(680)](e[n(754)](b,e.ZASou(D,8)),49344),32896))g+=p;else if(P=e.ZFknA(e.ZFknA(e.ZASou(15&v,12),e[n(869)](e[n(131)](63,b),6)),e[n(256)](63,D)),P<2048||e[n(873)](P,55296)&&e[n(1465)](P,57343))g+=p;else if(e[n(1035)](n(376),e[n(576)]))g+=e[n(985)](c,P),l+=2;else return _0xce893b&&(_0x553cab=(0,_0x3cfebb[eujvuM[n(1025)](_0x2c6e72,_0x465ddb)[0]])(_0x58b08b=0)),_0x612ad0;else e.SFCjP(248&v,240)?e[n(1569)](l,3)>=t?g+=p:(b=d[e.xzscd(e.qEsdX(l,o),1)],D=d[e.fHAsL(e[n(807)](l,o),2)],I=d[e[n(893)](e.pOjMm(l,o),3)],e[n(1565)](e[n(754)](e.ZFknA(b,e[n(1383)](D,8)),e[n(1124)](I,16)),12632256)!==8421504?g+=p:(P=e[n(326)](e[n(670)](e[n(326)](e[n(1079)](e[n(131)](7,v),18),e[n(1124)](e[n(937)](63,b),12)),e.iHWXq(63&D,6)),e[n(1565)](63,I)),P<65536||e[n(892)](P,1114111)?g+=p:(P-=65536,g+=e[n(1115)](c,e[n(172)](P,10)+55296,e[n(1503)](e.UKWuv(1023,P),56320)),l+=3))):g+=p}return g}function Ce(s,t){let n=r;if(e[n(1573)](e[n(1208)],e[n(1208)])){let o=t[n(769)],c=0;for(let g=0;e.ZUoCJ(g,o);g++){let l=t[n(989)+"At"](g);e[n(100)](l,55296)&&e[n(1465)](l,56319)&&e.usiCy(e.xzscd(g,1),o)&&(l=e[n(132)](e[n(523)](l<<10,t[n(989)+"At"](++g)),56613888)),c+=l<128?1:l<2048?2:e[n(1239)](l,65536)?3:4}e[n(1193)]($,s,c);let d=e[n(1554)](he,s,c),p=s.bytes;for(let g=0;e.NIgps(g,o);g++){let l=t.charCodeAt(g);if(e[n(873)](l,55296)&&e[n(1465)](l,56319)&&e[n(1532)](e[n(1569)](g,1),o)&&(l=e[n(330)](e.XJysW(e.rLaEt(l,10),t.charCodeAt(++g)),56613888)),e[n(1504)](l,128))p[d++]=l;else if(e.Zhwtb(e.FAiXj,n(302)))e[n(1532)](l,2048)?p[d++]=e.VcHJR(e[n(669)](l>>6,31),192):(e[n(596)](l,65536)?p[d++]=e[n(184)](e[n(1352)](e[n(453)](l,12),15),224):(p[d++]=e[n(706)](e[n(123)](e[n(1184)](l,18),7),240),p[d++]=e[n(950)](e[n(1579)](e.csLce(l,12),63),128)),p[d++]=e.xHrRb(e[n(1354)](l,6),63)|128),p[d++]=e[n(1425)](63&l,128);else return _0x4a29aa||(_0x2d7e69=[_0x176939,_0x227237,_0x16b1fe,_0xea2636,_0x2d65ca])}}else{let o=new _0x4c8a1d(e.ZFknA(e.VcHJR(e[n(1130)](_0x2cd6e5[_0x3ff955+4]<<24,_0x5177c4[e.Noxtw(_0x3eedb2,5)]<<16),e[n(929)](_0x18fd7f[e[n(523)](_0x5ebf9d,6)],8)),_0x3258f8[e[n(986)](_0x297643,7)]),e[n(1130)](e[n(184)](e[n(1250)](_0x424818[e[n(883)](_0x103c19,0)],24)|_0xd5b0a[_0x273a40+1]<<16,e[n(782)](_0xab77e5[e[n(1295)](_0x20c010,2)],8)),_0x463535[_0x1e5e08+3]),!0);return _0x2ceffd+=8,{value:o,offset:e.pOjMm(_0x13017a,8)}}}function De(s,t){let n=r,o=e.MLJZR(he,s,t[n(1141)]),c=s[n(1478)],d=t[n(1478)];for(let p=0,g=t[n(1141)];e[n(366)](p,g);p++)c[p+o]=d[p]}function Q(s){let t=r;return s.bytes[e[t(511)](rt,s,1)]}function We(s,t){let n=he(s,1);s.bytes[n]=t}function ee(s){let t=r,n=0,o=0,c;do c=e.qjNJf(Q,s),n<32&&(o|=e[t(1350)](e[t(123)](127,c),n)),n+=7;while(e[t(131)](128,c));return o}function $(s,t){let n=r;for(t>>>=0;t>=128;)e.BETIE(e[n(396)],e[n(396)])?(this.emit(e[n(269)],_0x591613),this[n(832)]&&this[n(832)](_0x2db087)):(We(s,e[n(565)](e[n(461)](127,t),128)),t>>>=7);e[n(626)](We,s,t)}function Jr(s,t){let n=r,o={BuTqY:function(c,d){return e[A(224)](c,d)},lxOcF:function(c,d){return e[A(224)](c,d)},Nzqhe:function(c,d){return c&d},XCCOW:function(c,d){return e.cMCvo(c,d)},kXKqE:function(c,d){return e.TrxnV(c,d)},SRMDS:function(c,d){return c>>>d},cCYUF:function(c,d){return e[A(931)](c,d)},ocGyF:function(c,d){return e.zlUHv(c,d)},VBpKV:function(c,d,p,g){return e[A(1293)](c,d,p,g)},HbTAd:function(c,d){return c+d}};if(e[n(481)](e.Thcml,e[n(1490)])){_0x316c02.isLong(_0x198ca2)||(_0x187285=_0x79d8d6[n(1224)+"er"](_0x163921));let c=o.BuTqY(this[n(948)],16),d=65535&this[n(948)],p=o.lxOcF(this[n(1362)],16),g=65535&this[n(1362)],l=o.BuTqY(_0x566f8e.high,16),v=o.Nzqhe(65535,_0x2bc62f[n(948)]),b=o[n(743)](_0x14176d[n(1362)],16),D=o[n(307)](65535,_0x1c92d7.low),I=0,P=0,q=0,se=0;return se+=o.kXKqE(g,D),q+=o.BuTqY(se,16),se&=65535,q+=o.kXKqE(p,b),P+=q>>>16,q&=65535,P+=o.kXKqE(d,v),I+=o[n(418)](P,16),P&=65535,I+=o.kXKqE(c,l),I&=65535,_0x65f0a0[n(941)](o.cCYUF(o[n(716)](q,16),se),o.cCYUF(I<<16,P),this.unsigned)}else{let c=0,d=0,p=0,g;if(g=e[n(991)](Q,s),c=e[n(446)](127,g),e[n(680)](128,g)&&(g=Q(s),c|=e[n(260)](127&g,7),128&g&&(g=Q(s),c|=e.angSb(127,g)<<14,e[n(1253)](128,g)&&(g=Q(s),c|=e[n(747)](e[n(256)](127,g),21),e[n(1565)](128,g))))){if(e[n(920)](e[n(1576)],e[n(1576)]))this[n(332)]=_0x175f4c,this._pathKey=_0x24710,this._qosDB=_0x2f4781;else if(g=Q(s),d=e[n(265)](127,g),e[n(517)](128,g)&&(g=e.sPLyB(Q,s),d|=(127&g)<<7,e[n(1564)](128,g)))if(n(1300)===n(1300)){if(g=Q(s),d|=e[n(1350)](e[n(1045)](127,g),14),e[n(139)](128,g)&&(g=e[n(1081)](Q,s),d|=e[n(1565)](127,g)<<21,e.fvGyn(128,g)&&(g=Q(s),p=127&g,e[n(1565)](128,g))))if(e[n(111)](e[n(911)],"KvtHK"))g=Q(s),p|=e.ovgpq(127,g)<<7;else{let l=o[n(307)](255,_0x11203d);o[n(510)](_0x58fafe,l,_0x1b3a43,o[n(737)](_0x344102,_0x49ebe3)),_0x5679c4>>>=8,_0x597fcc--}}else return{bytes:_0x5e5c72,offset:0,limit:_0x42e78e[n(769)]}}return{low:e[n(1130)](c,e.jhJtZ(d,28)),high:e[n(224)](d,4)|p<<24,unsigned:t}}}function vt(s,t){let n=r,o=t[n(1362)]>>>0,c=e[n(619)](e[n(184)](t[n(1362)]>>>28,t[n(948)]<<4),0),d=e[n(686)](t[n(948)],24),p=e.oHGwx(0,d)?e[n(481)](0,c)?e[n(310)](o,16384)?e[n(594)](o,128)?1:2:e.ZUoCJ(o,2097152)?3:4:c<16384?e[n(310)](c,128)?5:6:c<2097152?7:8:e[n(1526)](d,128)?9:10,g=e.hObYE(he,s,p),l=s[n(1478)];switch(p){case 10:l[e[n(1195)](g,9)]=e.blTLd(d>>>7,1);case 9:l[e[n(1385)](g,8)]=e[n(746)](9,p)?e[n(184)](128,d):e[n(265)](127,d);case 8:l[e[n(1295)](g,7)]=e[n(1403)](8,p)?e.TeFqq(e[n(463)](c,21),128):c>>>21&127;case 7:l[e[n(1537)](g,6)]=e[n(219)](7,p)?e[n(565)](e[n(1450)](c,14),128):e[n(265)](e[n(1450)](c,14),127);case 6:l[e[n(1140)](g,5)]=e[n(899)](6,p)?e[n(950)](e[n(619)](c,7),128):e[n(1129)](c,7)&127;case 5:l[e[n(1518)](g,4)]=e[n(1050)](5,p)?e.BDYAZ(128,c):e[n(331)](127,c);case 4:l[e[n(883)](g,3)]=e[n(850)](4,p)?e[n(1146)](o>>>21,128):e[n(1265)](e.YWHoj(o,21),127);case 3:l[e.ImBqq(g,2)]=p!==3?e[n(1146)](o>>>14,128):e[n(1450)](o,14)&127;case 2:l[e[n(1569)](g,1)]=e[n(219)](2,p)?e.YgvYY(o>>>7,128):e[n(680)](e[n(1074)](o,7),127);case 1:l[g]=e.APwgo(1,p)?128|o:127&o}}function Vr(s){return e[r(104)](T,s)}function Wn(s){return e.fgvbE(C,s)}let Yr=65536,Fo=e.ecssR,st=e[r(777)](Yr,Yr),Xr=e.DcjSu(st,st),Zr=e[r(720)](Xr,2),Me=String[r(1396)+"e"][r(989)+"At"];class B{constructor(t,n,o){let c=r;this[c(1012)]=!0,this[c(1362)]=0|t,this[c(948)]=e[c(327)](0,n),this[c(1535)]=!!o}static isLong(t){let n=r;return t&&e.HXYkA(!0,t[n(1012)])}static[r(941)](t,n,o){return new B(t,n,o)}static[r(770)+"s"](t,n,o){let c=r;if(e[c(983)](e[c(1374)],e[c(1374)]))return o?B[c(770)+"sLE"](t,n):B.fromBytesBE(t,n);{let{initReconnectInterval:d,maxReconnectInterval:p,reconnectIntervalGrowFactor:g}=this[c(1094)],l=e[c(777)](d,_0x520834[c(1186)](g,e[c(132)](_0x258d7a,1)));return e[c(934)](l,p)?p:l}}static[r(770)+r(694)](t,n){let o=r;return new B(e[o(327)](t[0]|e[o(457)](t[1],8),e[o(1175)](t[2],16))|e[o(1590)](t[3],24),e[o(961)](t[4]|t[5]<<8,t[6]<<16)|e[o(299)](t[7],24),n)}static[r(770)+r(812)](t,n){let o=r,c={yZlZL:function(d,p,g){return d(p,g)}};if(e.TcGYG(o(467),e[o(1038)]))return new B(e[o(659)](e[o(1103)](e[o(184)](e[o(506)](t[4],24),e[o(914)](t[5],16)),t[6]<<8),t[7]),e.prYvs(e[o(336)](e.gxbUq(t[0]<<24,e[o(1350)](t[1],16)),e.HXcpM(t[2],8)),t[3]),n);_0x38ad91(_0x5a6d59,32),GOnNJF[o(888)](_0x216777,_0x597550,_0x3bfa8d(_0x2b6bc3))}static[r(1533)](t){let n=r,o={cRZtd:function(c){return c()}};if(e[n(1375)]!==e[n(1231)])return t===Fo?$r:new B(e[n(1100)](e[n(135)](e[n(326)](e[n(216)](Me[n(861)](t,0),e[n(313)](Me[n(861)](t,1),8)),e[n(1527)](Me[n(861)](t,2),16)),e[n(313)](Me.call(t,3),24)),0),e[n(1545)](e[n(1470)](e[n(505)](Me[n(861)](t,4)|e.MoXsV(Me.call(t,5),8),e[n(1258)](Me.call(t,6),16)),e.iHWXq(Me[n(861)](t,7),24)),0),!0);NmehKM.cRZtd(_0x49eca2),NmehKM[n(820)](_0x5b2c60)}toHash(){let t=r,n={RsFGd:function(o,c){return e[A(985)](o,c)}};return e[t(1254)](e[t(1392)],"nXkMo")?String[t(620)+"Code"](e[t(535)](255,this[t(1362)]),e[t(1545)](this[t(1362)],8)&255,e[t(1410)](this[t(1362)],16)&255,this[t(1362)]>>>24,255&this.high,e[t(779)](e[t(1410)](this[t(948)],8),255),e[t(1076)](e[t(1100)](this.high,16),255),e[t(619)](this[t(948)],24)):(_0x5a7629[t(1228)](HwxCuv[t(558)](_0x3e1a7b,this),_0x1696fa),HwxCuv.RsFGd(_0x1185df,_0x2101cb[t(1379)](this)))}static fromNumber(t,n=!0){let o=r;if(e.TFlIQ(isNaN,t))return n?Uo:$r;if(n){if(e[o(980)](t,Xr))return Ko}else{if(e[o(1465)](t,-Zr))return jo;if(e.CyAGF(e.ntJIx(t,1),Zr))return Ho}return B[o(941)](e[o(715)](e[o(608)](t,st),0),e[o(659)](t/st,0),n)}[r(696)](){let t=r;return this[t(1535)]?e.MGIGB(e[t(777)](e[t(713)](this[t(948)],0),st),e[t(1074)](this[t(1362)],0)):e[t(1140)](e[t(1419)](this[t(948)],st),e.ORIrE(this[t(1362)],0))}[r(1230)](){let t=r;return e.IfxPP(0,this.high)&&e[t(1563)](0,this[t(1362)])}[r(476)](t){let n=r;B[n(1012)](t)||(t=B.fromNumber(t));let o=e[n(1074)](this.high,16),c=65535&this[n(948)],d=e.xLovA(this[n(1362)],16),p=e[n(1253)](65535,this[n(1362)]),g=e.Vxdld(t[n(948)],16),l=65535&t[n(948)],v=e[n(1438)](t[n(1362)],16),b=e[n(131)](65535,t[n(1362)]),D=0,I=0,P=0,q=0;return q+=e[n(278)](p,b),P+=e[n(224)](q,16),q&=65535,P+=e.LmLUV(d,v),I+=P>>>16,P&=65535,I+=e[n(893)](c,l),D+=e[n(951)](I,16),I&=65535,D+=e.KkXao(o,g),D&=65535,B[n(941)](e[n(1044)](e[n(870)](P,16),q),e[n(1052)](e[n(1552)](D,16),I),this[n(1535)])}[r(539)](t){let n=r,o={gHeVu:function(c,d){return e[A(1037)](c,d)},qFKrd:function(c){return e.UHOvx(c)}};if(e[n(548)](e.CBepp,e[n(431)]))return B[n(1012)](t)||(t=B[n(1224)+"er"](t)),this[n(1535)]!==t[n(1535)]&&e[n(994)](e[n(1074)](this[n(948)],31),1)&&e.WDfbn(e[n(756)](t[n(948)],31),1)?!1:e[n(111)](this[n(948)],t.high)&&this.low===t[n(1362)];this[n(441)]=!1,o[n(709)](_0x10fc34,this["_connectionTimeo"+n(273)]),o.qFKrd(_0x5e932d)}[r(468)](){let t=r;return e[t(1482)](-1,this[t(1362)])&&e[t(1254)](-1,this[t(948)])?B[t(941)](0,0,this[t(1535)]):e[t(1451)](-1,this[t(1362)])?B[t(941)](0,this[t(948)]+1,this.unsigned):B[t(941)](e[t(450)](this[t(1362)],1),this[t(948)],this[t(1535)])}[r(1192)](t){let n=r;return e[n(1550)]===n(1001)?t?this[n(781)+"E"]():this[n(1580)+"E"]():!0}[r(781)+"E"](){let t=r;if(e[t(1541)](e.EWyCq,e.EWyCq)){let n={surAq:function(c,d){return c&d},QWVWh:function(c,d){return c<d},vrYSB:function(c,d){return e[t(656)](c,d)},nZpDZ:function(c,d){return e.daLhQ(c,d)},aekby:function(c,d){return e[t(312)](c,d)},ZRMqj:function(c,d){return e[t(1258)](c,d)},KMryi:function(c,d){return c<d},Hfdtx:function(c,d){return c|d},sXiqy:function(c,d){return e[t(753)](c,d)},EWpmB:function(c,d){return e[t(870)](c,d)},tSXtT:function(c,d){return e[t(834)](c,d)},zwncL:function(c,d){return e.RUDWc(c,d)},QJsib:function(c,d){return c&d}},o=4294967295;return function(c,d,p=!0){let g=t,l=(g(322)+g(1517)+"4|5|1|3|9")[g(970)]("|"),v=0;for(;;){switch(l[v++]){case"0":o=n[g(1049)](127,c[d])>>>0;continue;case"1":if(n[g(804)](c[d++],128))return{value:p?o:n[g(1013)](0,o),offset:d};continue;case"2":if(n.QWVWh(c[d++],128))return{value:p?o:n[g(887)](0,o),offset:d};continue;case"3":if(n[g(615)](d+=5,c[g(769)]))throw d=c[g(769)],_0x291945(d,10,c[g(769)]);continue;case"4":if(n[g(804)](c[d++],128))return{value:p?o:n[g(1013)](0,o),offset:d};continue;case"5":o=n[g(1013)](o,n[g(1399)](15&c[d],28))>>>0;continue;case"6":if(n[g(522)](c[d++],128))return{value:p?o:n.vrYSB(0,o),offset:d};continue;case"7":if(n[g(522)](c[d++],128))return{value:p?o:0|o,offset:d};continue;case"8":o=n[g(397)](o,n.ZRMqj(n[g(1049)](127,c[d]),7))>>>0;continue;case"9":return{value:p?o:n[g(1132)](0,o),offset:d};case"10":o=n.Hfdtx(o,n[g(1114)](n[g(1053)](127,c[d]),21))>>>0;continue;case"11":o=n[g(1572)](o|n.EWpmB(n[g(1233)](127,c[d]),14),0);continue}break}}}else{let n=this[t(948)],o=this.low;return[255&o,e[t(1564)](e[t(951)](o,8),255),e.xHrRb(e[t(1438)](o,16),255),e[t(469)](o,24),e[t(424)](255,n),e[t(1564)](e.hamIT(n,8),255),e[t(1356)](e.qTRQU(n,16),255),n>>>24]}}[r(1580)+"E"](){let t=r,n=this[t(948)],o=this[t(1362)];return[e[t(756)](n,24),e[t(461)](e[t(713)](n,16),255),e[t(107)](n,8)&255,255&n,o>>>24,e.zZnSz(o>>>16,255),e[t(1265)](e[t(463)](o,8),255),e.angSb(255,o)]}}let $r=new B(0,0,!1),Uo=new B(0,0,!0),Ho=B[r(941)](-1,2147483647,!1),Ko=B[r(941)](-1,-1,!0),jo=B[r(941)](0,-2147483648,!1);var Oe=(function(s){let t=r,n=e[t(1047)].split("|"),o=0;for(;;){switch(n[o++]){case"0":return s;case"1":s[s[e[t(1148)]]=5004]=e.RMQuc;continue;case"2":s[s[e[t(1237)]]=5003]=e[t(1237)];continue;case"3":s[s[e.RGrdc]=5001]=e.RGrdc;continue;case"4":s[s[e[t(778)]]=5005]=t(655)+"OR";continue;case"5":s[s[e[t(910)]]=5002]=e.jVFnY;continue}break}})({});class it{constructor(t){let n=r;this[n(1345)]=t,this[n(707)]=null}}class Qr extends it{constructor(t,n){let o=r;super(t),this[o(972)]=n&&n[o(972)]||null}}class es extends it{constructor(t,n){let o=r,c=e[o(1409)][o(970)]("|"),d=0;for(;;){switch(c[d++]){case"0":super(t);continue;case"1":this.colno=n&&n[o(1016)]||0;continue;case"2":this[o(972)]=n&&n[o(972)]||"";continue;case"3":this[o(1139)]=n&&n[o(1139)]||5001;continue;case"4":this[o(232)]=n&&n[o(232)]||"";continue;case"5":this[o(1523)]=n&&n[o(1523)]||null;continue;case"6":this[o(698)]=n&&n.lineno||0;continue}break}}}class ts extends it{constructor(t,n){let o=r;super(t),this[o(1139)]=n&&n[o(1139)]||0,this[o(1205)]=n&&n[o(1205)]||"",this.wasClean=n&&n[o(1191)]||!1,this["willReco"+o(1320)]=n&&n[o(1322)+o(1320)]||!1}}class ns extends it{constructor(t,n){let o=r;super(t),this[o(162)]=n&&n[o(162)]||null}}class rs extends ns{constructor(t,n){let o=r;super(t),this[o(162)]=n&&n.data||null,this[o(972)]=n&&n.message||null}}class ss extends it{constructor(t,n){let o=r;super(t),this[o(162)]=n&&n[o(162)]||null}}function fe(s,{message:t,code:n,error:o}){return new es(s,{message:t,code:n,error:o})}function ge(s,{code:t,reason:n,wasClean:o,willReconnect:c}){return new ts(s,{code:t,reason:n,wasClean:o,willReconnect:c})}function is(s,{data:t,message:n}){return new rs(s,{data:t,message:n})}function os(s,{data:t}){let n=r,o={KlAzg:function(c,d){return e[A(1312)](c,d)}};if(e[n(1528)](e.KDTPp,e[n(557)])){if(zkWaln[n(734)](_0x3619cb,_0x123637))return _0x1f8eeb}else return new ss(s,{data:t})}function Jn(s,{message:t}){let n=r,o={WLagW:e[n(433)]};if(e[n(1589)](e.avsDO,e[n(402)]))this[n(886)](o[n(1070)],_0x2f1129),this.onerror&&this[n(740)](_0x3fb01c);else return new Qr(s,{message:t})}class as{constructor(t,n){let o=r;this[o(500)+"s"]=t,this.maxRetries=n,this["currentI"+o(1453)]=0,this["currentEndpointT"+o(1241)+"t"]=0}["resetEndpointCon"+r(629)](){let t=r;if(e.IfxPP(e.yrtSo,t(828)))this[t(1406)+t(1453)]=0,this[t(328)+"ndpointT"+t(1241)+"t"]=0;else{let n=this["_endpoin"+t(355)]?.[t(536)+t(1542)+"nt"]();this[t(1284)](t(952)+n),_0x2c246c()}}[r(185)+"es"](){let t=r;this[t(328)+t(145)+t(1241)+"t"]=0}[r(536)+"ntEndpoint"](){let t=r;return this[t(500)+"s"][this[t(1406)+"ndex"]]}["getCurre"+r(1542)+"ntTriesC"+r(809)](){let t=r;return this[t(328)+t(145)+"riesCount"]}["checkRea"+r(725)+"es"](){let t=r;return!!(e[t(873)](this[t(1406)+t(1453)],this[t(500)+"s"][t(769)])||e[t(616)](this[t(1406)+"ndex"],e[t(371)](this[t(500)+"s"].length,1))&&e.uNTcx(this["currentE"+t(145)+t(1241)+"t"],this.maxRetries))}["checkCur"+r(830)+r(867)+r(1562)+r(205)](){let t=r;return e[t(1534)](this[t(1406)+"ndex"],this[t(500)+"s"][t(769)])?!0:e[t(1021)](this[t(328)+t(145)+"riesCount"],this[t(965)+"es"])}[r(1287)+r(1291)+"pointAnd"+r(1459)+r(122)](){let t=r;return this[t(328)+t(145)+"riesCount"]=1,this["currentI"+t(1453)]++,this.endpoints[this[t(1406)+t(1453)]]}[r(536)+r(1542)+r(1093)+r(1084)](){let t=r;return this[t(328)+t(145)+"riesCount"]++,this.getCurrentEndpoint()}}let ot=(e.aLuwS!=typeof globalThis&&e[r(347)](e[r(652)],globalThis[r(900)+"tor"].name)||e[r(846)](e[r(1238)],typeof window)&&e[r(250)](e.ZSeXY,window[r(900)+"tor"].name))&&e.aLuwS!=typeof document,Je=e[r(726)](e[r(1238)],typeof globalThis)&&(e[r(364)](e[r(1386)],globalThis[r(900)+r(531)][r(695)])||r(1068)+r(1066)+r(595)+"pe"===globalThis[r(900)+"tor"][r(695)])&&e[r(579)](e[r(1238)],typeof tt),bt=(e[r(1087)](e[r(1238)],typeof globalThis)&&e.CRxat(e[r(1386)],globalThis[r(900)+r(531)][r(695)])||e[r(1238)]==typeof globalThis||e[r(1238)]!=typeof globalThis&&!!globalThis["WeixinJS"+r(813)])&&e[r(1087)](e[r(1238)],typeof wx),St=e[r(1087)](r(1166)+"d",typeof globalThis)&&(e[r(1563)](e[r(370)],globalThis[r(900)+r(531)].name)||e[r(1451)]("SharedWorkerGlob"+r(1036),globalThis[r(900)+r(531)][r(695)])||e.JJKFp(e[r(1077)],globalThis[r(900)+r(531)][r(695)]))&&e[r(846)](e[r(1238)],typeof self),Go=r(1166)+"d"!=typeof globalThis&&e[r(1386)]===globalThis[r(900)+r(531)].name&&r(1166)+"d"!=typeof global&&e.Jgvpy(e[r(1386)],global[r(900)+r(531)][r(695)])&&e[r(580)](r(1166)+"d",typeof process)&&!!process.version;class Vn{constructor(){let t=r;this[t(551)+"rs"]={}}[r(886)](t,...n){let o=r,c=this[o(551)+"rs"][t];if(c)c[o(625)]().forEach(d=>d.fn[o(1228)](d[o(1439)],n));else if(e[o(111)](e[o(433)],t)&&!this[o(740)]){let d=n[o(769)]&&n[0];if(e[o(1125)](d,Error))throw d;let p=new Error(e[o(1295)](e[o(792)],d?e[o(194)](e[o(1385)](" (",d[o(972)]),")"):""));throw p[o(682)]=d,d}return this}[r(589)](t,n){let o=r;if(e[o(1032)](void 0,t))this[o(551)+"rs"]={};else if(e[o(584)](void 0,n))this[o(551)+"rs"][t]=null;else{let c=this[o(551)+"rs"][t];if(c)for(let d=0;d<c[o(769)];)e.SmaYr(c[d].fn,n)?c.splice(d,1):++d}return this}on(t,n,o){let c=r;return(this[c(551)+"rs"][t]||(this[c(551)+"rs"][t]=[])).push({fn:n,ctx:o||this}),this}}class Wo extends Vn{[r(583)+r(611)+r(296)](t){let n=r;return t[n(211)]||t.errNo?(n(711)+" "+(t[n(211)]||"")+n(1404)+(t[n(316)]||""))[n(387)]():JSON[n(817)+"y"](t)}constructor(t,n,o){let c=r;super(),this[c(179)]=null,bt&&wx[c(140)+c(1349)]&&(this[c(179)]=wx[c(140)+"ocket"]({url:t,protocols:n,header:o,fail:this[c(1489)+c(1369)+"lHandler"][c(389)](this),success:this["_createS"+c(1056)+c(982)+c(435)][c(389)](this)})),Je&&tt[c(140)+c(1349)]&&(this._socket=tt[c(140)+c(1349)]({url:t,protocols:n,header:o,fail:this[c(1489)+c(1369)+c(926)][c(389)](this),success:this[c(1489)+c(1056)+c(982)+c(435)].bind(this)}))}[r(1489)+"ocketSuc"+r(982)+r(435)](){let t=r;Promise[t(1024)]().then(()=>{let n=t;this[n(295)+n(650)]()})}[r(1489)+r(1369)+r(926)](t){let n=r,o={TMaTb:function(c,d,p){return e[A(791)](c,d,p)},dieVl:e.dHjtG,DJqPQ:e[n(290)]};Promise[n(1024)]().then(()=>{let c=n,d=o[c(1467)](fe,o[c(1176)],{message:this[c(583)+c(611)+c(296)](t)});this[c(886)](o[c(1176)],d);let p=o[c(1467)](ge,o[c(1367)],{reason:this[c(583)+c(611)+c(296)](t)});this[c(886)](o[c(1367)],p)})}["_addWsLi"+r(650)](){let t=r,n={EvcQN:function(o,c){return e[A(176)](o,c)},IVwak:e[t(796)],vGyWD:e[t(1067)],wDYAq:"open",EXyZr:function(o,c,d){return e[t(1204)](o,c,d)},EHeLU:e[t(290)],OZpPl:e.UyEkY};if(e[t(616)](t(1488),e.dyOQQ))this[t(179)][t(845)](o=>{let c=t;n[c(486)](n[c(1226)],n.vGyWD)?this.emit(n[c(1048)],n.EXyZr(os,n[c(1048)],{...o,data:o[c(211)]||""})):this[c(799)]?.[c(1364)](_0x355c9f.message_id)}),this[t(179)][t(923)](o=>{let c=t;this[c(886)](n[c(222)],n.EXyZr(ge,n[c(222)],{...o}))}),this[t(179)][t(234)+"e"](o=>{let c=t;this.emit(n[c(662)],n[c(1304)](is,n[c(662)],{...o}))}),this._socket.onError(o=>{let c=t;if(e[c(636)](c(775),e[c(1247)]))this[c(886)](e[c(433)],e.rFyLl(fe,e.dHjtG,{...o,message:o[c(211)]||""}));else return this[c(799)]?.[c(1364)](_0x3842ef)});else return 0}[r(1104)](t){let n=r,o={NFOIm:e[n(433)],ZcULp:function(c,d){return e.yJScy(c,d)},DvnJB:function(c,d){return e[n(699)](c,d)}};if(e[n(1125)](t,Uint8Array)){let c=t.buffer[n(625)](t[n(829)+"et"],e.zRGlO(t[n(962)+"th"],t[n(829)+"et"]));this[n(179)]&&this[n(179)][n(1104)]({data:c,fail:d=>{let p=n;this[p(886)](p(1523),fe(o[p(1318)],{message:this[p(583)+p(611)+"age"](d)}))}})}else this[n(179)]&&this._socket[n(1104)]({data:t,fail:c=>{let d=n;if(e.TMtSG(e.nagyH,e.HxQvH))this[d(886)](e[d(433)],e.lYxdw(fe,d(1523),{message:this["_formatErrorMess"+d(296)](c)}));else{let p=this[d(551)+"rs"][_0x1313f7];if(p)for(let g=0;iJhXng[d(1168)](g,p[d(769)]);)iJhXng[d(105)](p[g].fn,_0x2b1eac)?p[d(1058)](g,1):++g}}})}[r(514)](t,n){let o=r;this[o(179)]&&this._socket[o(514)]({code:t,reason:n})}[r(1514)+"Listener"](t,n){let o=r;e[o(1219)](o(731),e[o(445)])?(_0x198465[o(1378)]["removeCh"+o(218)](_0x3cd09e),_0x3192db[o(612)+o(1524)]=void 0,e[o(1222)](_0x2547af,_0x2dc254&&_0x4cd2c0.msg||e[o(221)])):this.on(t,n)}[r(1086)+r(419)+"ner"](t,n){this.off(t,n)}get[r(700)+"te"](){let t=r;return this[t(179)][t(700)+"te"]}get[r(1109)+"pe"](){let t=r;return this._socket[t(1109)+"pe"]}set[r(1109)+"pe"](t){}get[r(1113)](){let t=r,n={wALJV:function(o,c,d){return e[A(1553)](o,c,d)}};if(e[t(178)](t(1299),e.hGmrz))_0x18bd78(_0x37da3b,66),_0x418ca4(_0x153a7c,_0x748ba1[t(769)]),kmPhMY[t(677)](_0x7fc9b3,_0x5c8338,_0x51dc6a);else return this[t(179)][t(1113)]}get[r(738)](){return this[r(179)].protocol}get[r(174)+"ns"](){let t=r;return this[t(179)][t(174)+"ns"]}get["buffered"+r(533)](){return 0}}function Jo(s,t){let n=r;if(t)return new t(s[n(1113)],s[n(738)]);if(bt||Je)return new Wo(s[n(1113)],s[n(738)],s[n(491)]);if(e.ETYUR(ot,St)&&e[n(1092)](e[n(1238)],typeof WebSocket)&&WebSocket)return new WebSocket(s.url,s[n(738)+"s"])}function Vo(s){let t=r,n="1|3|4|2|0".split("|"),o=0;for(;;){switch(n[o++]){case"0":return!1;case"1":if(s)return!0;continue;case"2":if(e.mJRfa(ot,St)&&e[t(580)](e.aLuwS,typeof WebSocket)&&WebSocket)return!0;continue;case"3":if(bt&&wx[t(140)+"ocket"])return!0;continue;case"4":if(Je&&tt[t(140)+"ocket"])return!0;continue}break}}function xs(s,t,n){let o=r,c={VQzSR:function(g,l){return e[A(411)](g,l)},QXjKY:e.ARkTc,ApESz:function(g,l){return e[A(1451)](g,l)},ZnuYO:function(g,l){return e.JAXHQ(g,l)}},d=-1;async function p(g){let l=A;return c[l(152)](g,d)?Promise[l(1138)](new Error(c[l(800)])):(d=g,c[l(1270)](g,n.length)?Promise.resolve():n[g].bind(s)(t,p.bind(null,c[l(1357)](g,1))))}e[o(188)](p,0)}function cs(s){let t=r,n=0,o=0;for(let c=0;c<s[t(769)];++c)if(o=s[t(989)+"At"](c),o<128)n+=1;else if(o<2048)n+=2;else if(e.zAcAt(e[t(256)](64512,o),55296)&&e[t(1108)](e[t(253)](64512,s[t(989)+"At"](e.RSlhG(c,1))),56320))if(e[t(548)](t(768),e.pWOGC)){let d="connect "+_0x575aa2+(" timeout, max re"+t(674)+t(415));this._debug(d),this[t(964)+"hErrorEv"+t(783)](e[t(1553)](_0x206d28,e[t(433)],{message:d,code:_0x4bdc7c["MAX_RETR"+t(1128)+"R"]}));return}else++c,n+=4;else n+=3;return n}function fs(s,t,n){let o=r;if(e[o(1532)](n-t,1))return"";let c="";for(let d=t;e[o(1526)](d,n);){let p=s[d++];if(e[o(1361)](p,127))c+=String[o(620)+o(639)](p);else if(p>=192&&e[o(623)](p,224))c+=String["fromChar"+o(639)](e.FBIPy(e[o(1460)](e[o(1574)](31,p),6),e[o(1045)](63,s[d++])));else if(p>=224&&e[o(678)](p,240))c+=String[o(620)+o(639)](e[o(1146)](e.VcHJR((15&p)<<12,e[o(260)](e[o(907)](63,s[d++]),6)),e[o(1574)](63,s[d++])));else if(p>=240)if(e.qMlmZ(e[o(663)],"zNLXX"))_0x259ae3(e[o(1e3)]),this[o(589)](o(304)+o(1227)+"s",_0x2cfdbe),this.off(e[o(901)],_0x36d4bc);else{let g=e[o(1531)](e[o(183)](e[o(1250)](e[o(1481)](7,p),18),e[o(1348)](e[o(134)](63,s[d++]),12))|e.BtTpC(e[o(673)](63,s[d++]),6),e[o(840)](63,s[d++]))-65536;c+=String[o(620)+o(639)](e.REkTx(55296,g>>10)),c+=String[o(620)+o(639)](e[o(1289)](56320,e[o(863)](1023,g)))}}return c}function Yn(s,t,n){let o=r,c=n,d,p;for(let v=0;v<s[o(769)];++v)if(e[o(1136)](e[o(1313)],e.NoYQk))if(d=s[o(989)+"At"](v),e.BvBRI(d,128))t[n++]=d;else if(e[o(1389)](d,2048))t[n++]=e[o(1052)](e[o(172)](d,6),192),t[n++]=e[o(1425)](63&d,128);else if(e[o(1573)](e[o(680)](64512,d),55296)&&e[o(364)](e[o(1455)](64512,p=s[o(989)+"At"](e.DHNef(v,1))),56320)){let b=e[o(788)][o(970)]("|"),D=0;for(;;){switch(b[D++]){case"0":t[n++]=e[o(128)](63&d,128);continue;case"1":t[n++]=e[o(453)](d,18)|240;continue;case"2":d=e[o(943)](65536,e.uhFZg(1023&d,10))+e[o(1423)](1023,p);continue;case"3":t[n++]=e[o(1155)](e[o(453)](d,6)&63,128);continue;case"4":t[n++]=e[o(772)](e[o(863)](e[o(1143)](d,12),63),128);continue;case"5":++v;continue}break}}else if(e[o(1031)](o(1266),e[o(360)])){var g=_0xf8a8f[_0x424ac3];if(eujvuM.TKYEw(void 0,g))return g.exports;var l=_0x3aed19[_0x92dc04]={exports:{}};return _0x500fd1[_0x26c759](l,l[o(1321)],_0x4f4862),l[o(1321)]}else t[n++]=e[o(505)](e.wYCVd(d,12),224),t[n++]=e[o(1336)](e[o(130)](d,6)&63,128),t[n++]=e[o(184)](63&d,128);else this[o(886)](e[o(1441)],_0x566fe9),this.onmessage&&this[o(917)+"e"](_0x6ecaba);return e[o(330)](n,c)}async function us(s){let t=r;if(t(879)===e[t(689)]){if(e[t(702)](e[t(451)],typeof s)){let n=new Uint8Array(e[t(196)](cs,s));return Yn(s,n,0),n}return e.KJSbT(s,ArrayBuffer)?new Uint8Array(s):new Uint8Array(s.buffer,s.byteOffset,s[t(962)+"th"])}else{let n=0,o=[];for(;e[t(1039)](n,_0x2694c5.byteLength);){let{offset:c}=e[t(258)](_0x4953a0,_0x3342e2,n);n=c;let d={cursor_name:"",cursor:0,service:0},{value:p,offset:g}=e[t(439)](_0x37e20d,_0x165636,n);d[t(1123)]=p,n=g;let{value:l,offset:v}=e[t(314)](_0x2f6604,_0x3932d6,n);n=v,d[t(1064)+"ame"]=e[t(1293)](_0x1e9b22,_0x16be0a,n,e[t(235)](n,l)),n+=l;let{value:b,offset:D}=e[t(511)](_0x3dbdad,_0xc85021,n);d.cursor=b.toNumber(),n=D,o[t(473)](d)}return o}}function Yo(s){let t=r,n={IOpNt:t(514)};if(e[t(1219)](e[t(1436)],e[t(872)]))try{if(e[t(850)](t(263),e[t(166)]))this[t(886)](n[t(819)],_0xa77c34),this.onclose&&this.onclose(_0x2ad253);else return e.geXZZ!=typeof s&&(e[t(1125)](s,ArrayBuffer)||s.buffer&&e[t(1125)](s[t(1464)],ArrayBuffer))||e[t(726)](t(1556),typeof s)?"":(JSON[t(1324)](s),e[t(346)])}catch{return e[t(668)](e[t(451)],typeof s)?e[t(1196)]:""}else _0x1cd4ed.d=(o,c)=>{let d=t;for(var p in c)_0x59b9c8.o(c,p)&&!_0x3e0e9e.o(o,p)&&_0x27fdd5[d(1316)+"operty"](o,p,{enumerable:!0,get:c[p]})}}let Xo=(s,t)=>{let n=r;switch(s){case e[n(578)]:case e.TefRI:return{[n(1429)+s]:1,"x-tt-env":t};default:return{}}};class Zo{constructor(t){let n=r;this[n(742)+n(809)]=t,this[n(1480)]=0}[r(568)](){let t=r,n={tChrb:function(o,c,d){return e.Ljifb(o,c,d)},Sfmqh:function(o,c){return o>>c},tEbcP:function(o,c){return o+c},ZxKnL:function(o,c){return o&c}};t(1071)==="DjXbZ"?this.count++:(_0x28c17d-=65536,_0x8373bb+=spjHDm[t(1133)](_0x1948c8,spjHDm.Sfmqh(_0x2d1394,10)+55296,spjHDm.tEbcP(spjHDm.ZxKnL(1023,_0x128b16),56320)),_0x1b206c+=3)}[r(613)+r(960)+"nt"](){let t=r;return e[t(189)](this.count,this["maxLossC"+t(809)])}[r(685)+r(996)](t=0){let n=r;this["maxLossC"+n(809)]=t,this[n(1480)]=0}}async function $o(s){let t=r,n={NtKYJ:function(o,c){return e.vtQnU(o,c)},nccvi:e[t(221)],eqPEK:"script",NQhFF:function(o,c){return e.qesOz(o,c)},njNOh:e.vjWnc};return new Promise(o=>{let c=t,d={zJvgk:function(p,g){return n[A(762)](p,g)}};if(!ot)return o(n[c(498)]);try{let p=document[c(864)+c(921)](n[c(688)]);window[c(612)+c(1524)]=g=>{let l=c;document[l(1378)][l(766)+l(218)](p),window[l(612)+l(1524)]=void 0,d[l(1149)](o,g&&g[l(479)]||l(363)+l(1205))},p[c(1345)]=c(1260)+c(378),p.src=n[c(919)](s[c(1198)](/^ws/,c(897)),n[c(526)]);try{document[c(1378)].appendChild(p)}catch{document[c(1378)][c(766)+c(218)](p)}}catch{window[c(612)+c(1524)]=void 0,o(n[c(498)])}})}function ze(s,t,n){let o=r;return!!s?.[o(345)](c=>c[o(988)]===t&&c[o(1472)]===n)}function at(s,t){let n=r;return s?.[n(345)](o=>o[n(988)]===t)?.[n(1472)]}let Xn=null;async function Qo(){let s=r;return Xn||(Xn=Promise[s(1024)]()[s(839)](ye[s(389)](ye,"idb"))),Xn}class e0 extends Vn{constructor(t,n){let o=r;super(),this[o(1235)]=t,this[o(1397)]=n,this[o(799)]=void 0,this[o(1540)+o(1277)]=null}async[r(1144)](){await this[r(710)]()}async[r(710)](){let t=r,n={vDSSc:function(o){return o()},ZtciJ:function(o,c,d,p){return e[A(501)](o,c,d,p)},szkOp:e[t(203)],xEVpa:function(o,c){return e.CyAGF(o,c)}};if(!this[t(799)]){if(this[t(1540)+t(1277)])return this._initPromise;try{if(e[t(1174)]===t(1075))_0x1dabb9[t(942)](_0x2d6672);else{let o=this[t(1235)],c=this[t(1397)];this._initPromise=(async()=>{let d=t,{openDB:p}=await n[d(592)](Qo);this[d(799)]=await n[d(856)](p,d(612)+"_"+o,1,{upgrade(g){g[d(1493)+"jectStore"](o,{keyPath:c})}})})(),await this[t(1540)+t(1277)]}}catch(o){e[t(437)](e[t(712)],t(795))?console[t(942)](o):(this[t(173)+t(719)][t(473)](_0x2ef492),this._debug(n[t(1334)],_0x19d858))}finally{if(e[t(994)](t(192),t(420)))return UDxHxi.xEVpa(this[t(1480)],this[t(742)+t(809)]);this[t(1540)+t(1277)]=null}}}async[r(1379)](t){let n=r;try{return await this[n(710)](),this[n(799)]?.[n(1379)](this._dbName,t)}catch(o){console[n(942)](o)}}async[r(868)](t,n){let o=r;return await this._init(),this._qosDB?.[o(1520)](this[o(1235)],t)}async del(t){let n=r;try{if(n(1452)===e[n(369)])_0x32b9a2=_0x57e0cb&&e[n(946)]==_0x33d0ef[n(738)]?n(866):e.jNmqN,_0x1d19f0=_0x29b819[n(1198)](/((^ws)|(^http))((?:[s]*:\/\/))/,""),_0xb20af6=/^wss(.*:\/\/)/[n(1430)](_0x59e25a)?_0x55e651:""+_0x45d426+_0x1b9274;else return await this[n(710)](),this[n(799)]?.[n(913)](this[n(1235)],t)}catch(o){console[n(942)](o)}}async[r(245)](){let t=r;try{return await this[t(710)](),this[t(799)]?.[t(245)](this[t(1235)])}catch(n){console.log(n)}}async[r(606)](){let t=r;return await this._init(),this[t(799)]?.getAllKeys(this[t(1235)])}async[r(1034)](){let t=r;return e[t(437)](e[t(368)],t(1491))?e.yFBmD(e[t(451)],typeof _0x437c5a)?e[t(1196)]:"":(await this._init(),this[t(799)]?.[t(1034)](this[t(1235)]))}async closeDB(){let t=r;try{this[t(799)]?.[t(514)](),this[t(799)]=void 0}catch(n){console[t(942)](n)}}get[r(129)](){let t=r;try{return!!this._qosDB}catch(n){return console[t(942)](n),!1}}}class t0{constructor(t,n){let o=r;e[o(1035)](e[o(1376)],e[o(1376)])?(this[o(332)]=t,this[o(545)]=n,this[o(799)]=localStorage):(e[o(1586)](_0x2f07ca,_0x51b3f5,96),e[o(1360)](_0x2901c2,_0xb5ef71,e[o(1042)](_0x61b5ef,_0x23eff3)))}async[r(1144)](){}get _prefix(){let t=r;return t(612)+"_"+this[t(332)]}async[r(1379)](t){let n=r,o=this[n(799)][n(1363)](this[n(492)]);return JSON[n(1324)](e[n(1028)](o,"{}"))[t]}async set(t,n){let o=r,c=this._qosDB[o(1363)](this[o(492)]),d=JSON[o(1324)](c||"{}");return d[n||t[this[o(545)]]]=t,this[o(799)][o(175)](this[o(492)],JSON[o(817)+"y"](d)),n||t[this[o(545)]]}async[r(1364)](t){let n=r,o=this[n(799)][n(1363)](this[n(492)]),c=JSON.parse(e.ETYUR(o,"{}"));return c[t]=void 0,this[n(799)][n(175)](this[n(492)],JSON.stringify(c))}async clear(){let t=r;return this[t(799)][t(245)]()}async keys(){let t=r,n=this[t(799)][t(1363)](this._prefix),o=JSON[t(1324)](e[t(1225)](n,"{}"));return Object[t(606)](o)}async[r(1034)](){let t=r,n=this[t(799)][t(1363)](this._prefix),o=JSON[t(1324)](e.mJRfa(n,"{}"));return Object[t(1085)](o)}closeDB(){return Promise[r(1024)]()}get[r(129)](){return!!this[r(799)]}}class n0{constructor(t,n){let o=r;this[o(332)]=t,this[o(545)]=n,this[o(799)]=Je?tt:bt?wx:null}async[r(1144)](){}get _prefix(){let t=r;return t(612)+"_"+this[t(332)]}async[r(1379)](t){let n=r,o=this._qosDB["getStora"+n(361)](this[n(492)]);return JSON[n(1324)](e[n(1359)](o,"{}"))[t]}async[r(868)](t,n){let o=r,c=this[o(799)][o(1098)+o(361)](this[o(492)]),d=JSON[o(1324)](c||"{}");return d[n||t[this._pathKey]]=t,this[o(799)][o(1314)+"geSync"](this[o(492)],JSON.stringify(d)),n||t[this[o(545)]]}async del(t){let n=r,o=this[n(799)][n(1098)+n(361)](this._prefix),c=JSON[n(1324)](o||"{}");return c[t]=void 0,this[n(799)][n(1314)+n(361)](this[n(492)],JSON[n(817)+"y"](c))}async[r(245)](){let t=r;if(e[t(920)](e[t(470)],e.oNnYr))e[t(228)](_0x42efb1,_0x3a8d7d,16),e.ougLh(_0x49b184,_0x2f159f,_0x4df6d0);else return this._qosDB[t(617)+t(1525)]()}async keys(){let t=r,n=this[t(799)][t(1098)+t(654)+"nc"](this[t(492)]),o=JSON[t(1324)](e.ETYUR(n,"{}"));return Object[t(606)](o)}async[r(1034)](){let t=r,n=this._qosDB["getStora"+t(654)+"nc"](this[t(492)]),o=JSON[t(1324)](e[t(215)](n,"{}"));return Object[t(1085)](o)}[r(421)](){return Promise[r(1024)]()}get[r(129)](){return!!this._qosDB}}function ds(s,t){let n=r;if(e[n(1359)](Je,Je))return new n0(s,t);if(e[n(1509)](ot,St)&&e[n(580)](e[n(1238)],typeof indexedDB))return new e0(s,t);if(e.eCJTl(ot,St)&&e.paVJv(n(1166)+"d",typeof localStorage))return new t0(s,t);throw new Error(e[n(1019)])}class r0{constructor(){let t=r;this[t(693)+t(337)+"Id"]=null,this[t(693)+"l"]=36e5,this._qosDB=e[t(223)](ds,e[t(1107)],e[t(142)])}async[r(693)+"lFlush"](){let t=r;e[t(1131)](clearInterval,this[t(693)+t(337)+"Id"]),this[t(693)+t(337)+"Id"]=setInterval(()=>{this[t(206)+"ired"]()},this[t(693)+"l"])}async openDB(){let t=r;await this[t(799)][t(1144)]()[t(839)](()=>{let n=t;this[n(693)+n(635)]()})}async flushExpired(){let t=r;(await this._qosDB?.getAll()||[])[t(1244)](({timestamp:c})=>c<Date[t(1446)]())[t(1282)](c=>{let d=t;this[d(799)]?.del(c[d(724)+"id"])})}async del(t){return this[r(799)]?.del(t)}async set(t,n){let o=r,c={Ejuxw:function(d){return e[A(169)](d)},DGBqy:"AbortError"};if(e[o(1032)](o(642),e[o(300)]))return this[o(799)]?.[o(868)]({message_id:t,timestamp:n});{let d={UGjhw:eujvuM.dHjtG,dZaWG:eujvuM[o(443)]},p=()=>{let v=o;_0x548672[v(1086)+v(419)+v(658)]("complete",g),_0x3a591b["removeEv"+v(419)+v(658)](d[v(200)],l),_0x38a9f9[v(1086)+v(419)+v(658)](d[v(554)],l)},g=()=>{let v=o;RwAdZG.Ejuxw(_0x18e716),RwAdZG[v(442)](p)},l=()=>{let v=o;_0x4d93b8(_0x4696b5[v(1523)]||new _0x11384c(RwAdZG.DGBqy,RwAdZG[v(1372)])),p()};_0x43777d[o(1514)+o(735)](eujvuM.DzvxB,g),_0x4bd01b[o(1514)+"Listener"](eujvuM[o(433)],l),_0x1a9e43[o(1514)+o(735)](eujvuM.leUzB,l)}}async[r(1379)](t){let n=r;return this[n(799)]?.[n(1379)](t)}async[r(421)](){let t=r;e[t(880)](clearInterval,this[t(693)+t(337)+"Id"]),await this[t(799)]?.[t(421)]()}get[r(129)](){let t=r;return this[t(799)]?.[t(129)]}}function Zn(s){let t=r,n=!!this._options[t(1203)+"S"];if(!n)return{enabled:n,isQoSMessage:!1,isQoSAck:!1,isAckCleanupMessage:!1,ackMsgIds:[]};let o=e[t(1583)](ze,s[t(972)][t(491)],e[t(722)],"2"),c=o&&e[t(979)](ze,s.message.headers,t(1332)+"er_qos_ack","1"),d=o&&ze(s.message[t(491)],e[t(477)],"1"),p=d?e[t(660)](at,s.message[t(491)],e.geISi)?.[t(970)](",").filter(Boolean)||[]:[];return{enabled:n,isQoSMessage:o,isQoSAck:c,isAckCleanupMessage:d,ackMsgIds:p}}async function ls(){let s=r;return this[s(821)+"ger"]||(this[s(821)+s(338)]=new r0),this[s(821)+"ger"][s(129)]||await this[s(821)+s(338)][s(1144)](),this[s(821)+s(338)]}async function s0(s,t){let n=r,{enableAutoAck:o}=this[n(1094)],c=ze(s[n(972)][n(491)],e[n(925)],"1"),d=e[n(979)](ze,s[n(972)].headers,n(1161),"1"),p=Zn[n(861)](this,s);if(o&&c){let{SeqID:g,LogID:l,service:v,LogIDNew:b,method:D}=s[n(972)];this[n(1163)]({SeqID:g,LogID:l,LogIDNew:b,service:v,method:D,headers:[{key:n(1161),value:"1"},{key:e[n(905)],value:b||""},{key:e[n(329)],value:"0"}]})}d&&!p.isQoSAck&&this["_dispatc"+n(1200)+n(277)](s),e[n(648)](t)}async function i0(s,t){let n=r;this[n(1284)](e[n(464)],s[n(972)]),t()}async function o0(s,t){let n=r,o=e[n(985)](Vr,await e[n(1131)](us,s.data));try{if(e.rCKvh(o[n(1177)],Uint8Array))if(e[n(927)](e.nQSDt,e[n(238)]))try{return e[n(726)](e.geXZZ,typeof _0x16b5c4)&&(e[n(344)](_0x54f7dc,_0x21dba4)||_0x161619[n(1464)]&&e[n(1259)](_0x5612ff.buffer,_0x58b713))||e[n(1092)](e[n(451)],typeof _0x40ed3d)?"":(_0x2ea840[n(1324)](_0x28ae0b),n(1588)+n(334))}catch{return e[n(668)](n(1556),typeof _0x521e51)?e[n(1196)]:""}else{let c=e[n(1415)](this._options[n(1401)+n(852)],Object)?{force:!!this[n(1094)][n(1401)+n(852)].force,encoding:this[n(1094)][n(1401)+"ncoding"][n(1398)]?this[n(1094)][n(1401)+n(852)][n(1398)][n(1198)](/\s/g,"")[n(590)+n(280)]():""}:{force:!1,encoding:this[n(1094)][n(1401)+n(852)]?this[n(1094)][n(1401)+"ncoding"][n(1198)](/\s/g,"")[n(590)+"ase"]():""},d=o[n(1401)+n(852)]?o[n(1401)+n(852)][n(1198)](/\s/g,"")[n(590)+n(280)]():"",p=e[n(1125)](this._options[n(518)+n(1279)],Object)?{force:!!this[n(1094)][n(518)+"ype"].force,type:this[n(1094)][n(518)+"ype"][n(1345)]?this._options[n(518)+"ype"][n(1345)].replace(/\s/g,"")[n(590)+n(280)]():""}:{force:!1,type:this[n(1094)][n(518)+"ype"]?this[n(1094)]["payloadT"+n(1279)].replace(/\s/g,"")[n(590)+n(280)]():""},g=o[n(518)+"ype"]?o[n(518)+n(1279)][n(1198)](/\s/g,"").toLowerCase():"",l=p[n(1344)]?p[n(1345)]:g||p.type,v=c[n(1344)]?c[n(1398)]:d||c[n(1398)],b=[e[n(1196)],e[n(346)],n(1588)+"ion/json"+n(339)+"=utf-8",e[n(451)]],D=[n(1502)+"e",n(406)];this[n(1094)]["enableTr"+n(1272)+"extPayload"]&&b[n(136)](l)&&(!v||D[n(136)](v))?o.textPayload=e[n(1440)](fs,o.payload,0,o[n(1177)][n(962)+"th"]):o["textPayl"+n(323)]=""}else o[n(1407)+n(323)]=""}catch(c){o["textPayl"+n(323)]="",console[n(942)](c)}s[n(972)]=o,t()}function a0(s,t,n){let o={AYYxd:function(l,v){return e.uAThU(l,v)},YdIKz:function(l,v){return l+v}},c=e.kMJOx(n,8192),d=c>>>1,p=null,g=c;return function(l){let v=A;if(l<1||l>d)return s(l);o[v(1015)](g+l,c)&&(p=s(c),g=0);let b=t[v(861)](p,g,g+=l);return 7&g&&(g=o[v(1134)](7|g,1)),b}}let x0=4294967295;function c0(s,t,n){let o=r;return e.SfGRW(RangeError,e[o(278)](e[o(1099)](e.eXVGT(e[o(776)],s),e[o(1340)]),e[o(538)](t,1))+e[o(117)]+n)}function f0(s,t,n){let o=r,c={GwsGN:function(p,g){return p===g}};if(e[o(934)](n,x0))throw new Error(e[o(452)]);let d=3;for(;e.tSsnP(d,0);){if(e[o(1539)](e[o(1454)],e.Cyazs))return _0x54495c&&McNcTo.GwsGN(!0,_0x5ec468[o(1012)]);{let p=255&n;e[o(1101)](Qn,p,s,e[o(1333)](t,d)),n>>>=8,d--}}return t+4}function u0(s,t){let n=r,o=0,c=t,d=t+4;for(;e[n(858)](c,d);){let{value:p,offset:g}=e[n(1135)]($n,s,c);c=g,o=e[n(353)](e[n(1175)](o,8),0),o+=p}return{value:o,offset:d}}function d0(s,t,n){let o=r,c=e[o(133)][o(970)]("|"),d=0;for(;;){switch(c[d++]){case"0":return e[o(1101)](Yn,s,t,n)+n;case"1":if(e[o(214)](s[o(769)],40))return e[o(1004)](Yn(s,t,n),n);continue;case"2":if(!s)return n;continue;case"3":if(t.utf8Write)return e.CDDst(t.utf8Write(s,n),n);continue;case"4":if(t[o(562)])return t.write(s,n)+n;continue}break}}function l0(s,t){let n=r,o=new B(e[n(294)](e[n(1103)](e[n(870)](s[e[n(841)](t,4)],24),s[e[n(450)](t,5)]<<16)|e[n(929)](s[e[n(1294)](t,6)],8),s[e[n(1289)](t,7)]),e[n(1059)](e[n(1160)](e[n(1547)](s[e[n(1457)](t,0)],24),e[n(1460)](s[t+1],16))|e[n(824)](s[e.RSlhG(t,2)],8),s[e[n(1003)](t,3)]),!0);return t+=8,{value:o,offset:e[n(758)](t,8)}}function h0(s,t,n){let o=r,c={TYLmo:e.HcgdO};if(e.rPWla(e[o(1371)],e.babfT)){let d=s[o(1362)],p=s[o(948)];return t[n]=e.SpIXn(p,24),t[e[o(427)](n,1)]=e[o(390)](e[o(1438)](p,16),255),t[e[o(278)](n,2)]=e.CWOqs(p>>>8,255),t[n+3]=e[o(1217)](255,p),t[e[o(984)](n,4)]=e[o(1418)](d,24),t[e[o(752)](n,5)]=e[o(1456)](e[o(1566)](d,16),255),t[e.tkQdE(n,6)]=e[o(1549)](e[o(1033)](d,8),255),t[e.FpPLg(n,7)]=255&d,n+=8,n}else this[o(1094)][o(894)]&&_0x5072d6[o(942)][o(1228)](_0x217449,[c[o(319)],..._0x443c9b])}function $n(s,t){let n=r;return s[n(367)+"8"]?{value:s[n(367)+"8"](t),offset:e.dirxG(t,1)}:{value:e[n(1265)](255,s[t]),offset:t+1}}function Qn(s,t,n){let o=r;return t[o(103)+"t8"]?t[o(103)+"t8"](s,n):t[n]=e[o(311)](255,s),e.EcBqy(n,1)}let g0=function(s){return new Uint8Array(s)},p0=e[r(1087)](e.aLuwS,typeof Buffer)?Buffer[r(822)+r(1165)]:e[r(1424)](a0,g0,Uint8Array.prototype[r(257)]),m0=16,er=32;function w0(s){let t=r,n=0,o={};for(let c=0;e[t(678)](c,s.length);c++)o[s[c][t(1064)+"ame"]]=e[t(1245)](cs,s[c][t(1064)+t(1394)]),n+=e[t(986)](14,o[s[c].cursor_name]);return[n,o]}function hs(s,t,n){let o=r,c={NgtWg:o(555)+o(808)+o(995),HQfHu:e[o(1218)],mKqmx:function(v,b,D,I){return e[o(1583)](v,b,D,I)},cFHLH:e.rbyMP,tBSza:e[o(953)],WuJgN:function(v,b,D,I){return e.waxuh(v,b,D,I)},Iywei:o(889)+o(1317),teUMq:e.MZNbM,nCDVd:function(v,b,D,I){return e.EygIl(v,b,D,I)}},[d,p]=e[o(1581)](w0,s),g=p0(d),l=0;return s[o(1282)](v=>{let b=o,D=c[b(1142)][b(970)]("|"),I=0;for(;;){switch(D[I++]){case"0":console[b(942)](c[b(150)],l);continue;case"1":l=c.mKqmx(f0,g,l,v[b(1123)]||0);continue;case"2":console.log(b(978),l);continue;case"3":console[b(942)](c[b(1365)],l);continue;case"4":console.log(c[b(372)],l);continue;case"5":l=c[b(182)](Qn,0,g,l);continue;case"6":l=c[b(785)](Qn,p[v[b(1064)+b(1394)]],g,l);continue;case"7":l=c[b(785)](h0,B[b(1224)+"er"](v.cursor||t),g,l);continue;case"8":console[b(942)](c[b(651)],v,v[b(1123)]);continue;case"9":console[b(942)](c[b(394)],l);continue;case"10":l=c[b(1437)](d0,v[b(1064)+b(1394)],g,l);continue}break}}),{frameType:er,headers:[{key:e.gJnnC,value:n}],payload:g}}function _0(s){let t=r,n=0,o=[];for(;e[t(623)](n,s[t(962)+"th"]);){let{offset:c}=e.GtXKt($n,s,n);n=c;let d={cursor_name:"",cursor:0,service:0},{value:p,offset:g}=e[t(1521)](u0,s,n);d[t(1123)]=p,n=g;let{value:l,offset:v}=e.mrWFf($n,s,n);n=v,d[t(1064)+"ame"]=e[t(979)](fs,s,n,e.NldmI(n,l)),n+=l;let{value:b,offset:D}=e[t(692)](l0,s,n);d[t(959)]=b[t(696)](),n=D,o[t(473)](d)}return o}function y0(){let s=r;return{frameType:er,headers:[{key:e[s(1448)],value:"FILE_NOT"+s(1106)}],payload:void 0}}class v0{constructor(t,n,o){let c=r;this[c(1463)+c(429)]=t,this["_cursorF"+c(409)]=n,this["_message"+c(1307)]=o,this[c(799)]=e[c(1329)](ds,this[c(1463)+c(429)],e[c(315)])}async[r(1144)](){let t=r;if(e.ghIPs===t(225))return this[t(328)+t(145)+"riesCount"];await this[t(799)][t(1144)]()}async[r(1413)+"rs"](){let t=r;if(!this[t(799)].isReady)return;let n=this["_message"+t(1307)],o=await this[t(799)][t(1034)]();switch(console[t(942)](e[t(399)],o),n){case e.hmouZ:return o&&o[t(769)]?e[t(896)](hs,o,0,this[t(904)+t(409)]):void 0;case e[t(240)]:return;case e[t(474)]:return o&&o[t(769)]?e[t(501)](hs,o,0,this[t(904)+t(409)]):y0()}}async[r(868)](t,n,o){let c=r;return console[c(942)]("setdb",t,n,o),this[c(799)][c(868)]({cursor_name:t,cursor:n,service:o})}async[r(1519)+"rs"](t){let n=r,o=e[n(598)](_0,t);for(let c of o)console[n(942)](e[n(744)],o),await this[n(799)].set(c)}async get(t){let n=r;return(await this._qosDB[n(1379)](t))?.[n(959)]}async[r(421)](){let t=r;await this._qosDB[t(421)]()}[r(272)+r(432)+r(102)](t){let n=r;this[n(904)+n(409)]=t}get[r(129)](){let t=r;return this[t(799)][t(129)]}}let b0=e.AuHkT;async function gs(s){let t=r;if(!this._options[t(1203)+"S"])return null;let{aID:n,fpID:o,messageStrategy:c}=this._options,d=e[t(767)](s,b0);try{return this["_cursorM"+t(1073)]?s&&this[t(549)+t(1073)][t(272)+t(432)+"Name"](s):this[t(549)+"anager"]=new v0(o+"_"+n+"_"+d,d,c),this[t(549)+t(1073)][t(129)]||await this[t(549)+t(1073)].openDB(),this["_cursorM"+t(1073)]}catch{return null}}async function S0(s,t){let n=r,o=e[n(618)](ze,s[n(972)][n(491)],e[n(1311)],"-1"),c=ze(s[n(972)].headers,e.jMMFj,"1"),d=at(s[n(972)][n(491)],e[n(1122)]),p=e.vZgpC(Number,e[n(848)](at,s[n(972)][n(491)],e.OeNtb))||0,g=Zn[n(861)](this,s),l=e[n(618)](ze,s.message[n(491)],n(1017)+"s","2"),v=at(s.message[n(491)],n(865)+n(1269)+"e"),b=e[n(593)](Number,e[n(1325)](at,s.message[n(491)],e[n(308)]));if(g[n(884)])return e.UHOvx(t);let D=g[n(1494)+n(947)]?await ls[n(861)](this):null;if(e[n(1215)](s[n(972)].service,0)&&c&&!o||e[n(312)](s[n(972)].service,0)){if(d&&g[n(1494)+n(947)]&&D)return!!!await D[n(1379)](d)&&(this[n(964)+"hMessage"+n(112)](s),await D[n(868)](d,e[n(523)](Date[n(1446)](),p))),e[n(169)](t);if(l){if(e[n(1589)](n(922),e.meJtW))return(this[n(551)+"rs"][_0x356b0d]||(this[n(551)+"rs"][_0x59e934]=[]))[n(473)]({fn:_0x137362,ctx:_0x4be23d||this}),this;{let I=await gs.call(this);if(!I)return this[n(964)+"hMessage"+n(112)](s),e[n(1339)](t);let P=await I[n(1379)](v)??-1;if(e[n(623)](P,b))this[n(964)+n(287)+n(112)](s),I[n(868)](v,b,s[n(972)][n(1123)]);else throw new Error(n(167)+" message"+n(1330)+b+(n(553)+n(1022)+n(171)+"r ")+P);return e.UHOvx(t)}}return this[n(964)+n(287)+n(112)](s),e[n(586)](t)}}async function E0(s,t){let n=r,o=Zn[n(861)](this,s);if(!o["isQoSMes"+n(947)])return e[n(513)](t);let c=await ls[n(861)](this);if(o[n(1236)+n(508)+n(296)]&&o.ackMsgIds.length)for(let d of o.ackMsgIds)await c[n(1364)](d);t()}async function C0(s,t){let n=r,o={EpumH:function(c,d){return c===d},GPogI:function(c,d){return e.KJSbT(c,d)},sGEpV:function(c,d){return e[A(1402)](c,d)},XSXLX:"Unhandle"+n(936)};if(n(1261)!==n(1261)){let c=this[n(551)+"rs"][_0x57bad0];if(c)c[n(625)]()[n(1282)](d=>d.fn.apply(d[n(1439)],_0x256954));else if(lyRNpz[n(515)](n(1523),_0x4df303)&&!this[n(740)]){let d=_0x2444d8[n(769)]&&_0x1fa18e[0];if(lyRNpz[n(1343)](d,_0x38398e))throw d;let p=new _0x2060b3(lyRNpz[n(933)](lyRNpz.XSXLX,d?lyRNpz.sGEpV(" (",d[n(972)])+")":""));throw p.context=d,d}return this}else{let c=e[n(408)](s.message.frameType,m0),d=s.message.frameType===er;if(e[n(916)](!c,!d))return t();let p=e[n(1338)](at,s[n(972)].headers,e[n(1448)]);if(!p)return e.eCPev(t);let g=await gs[n(861)](this,p);if(!g)return e[n(890)](t);if(c){let l=await g[n(1413)+"rs"](),v={frameType:l?.[n(1275)+"e"],SeqID:B.fromNumber(this._seqId++),LogID:B[n(1224)+"er"](this._options["logIDGen"+n(1060)]()),service:9e3,method:5,headers:l?.headers,payload:l?.[n(1177)]},b=e[n(1042)](C,v);this[n(1516)]&&this[n(1516)][n(700)+"te"]&&this[n(1516)][n(1104)](b)}if(d){let l=s[n(972)][n(1177)];l&&g[n(1519)+"rs"](l)}}}let D0=async function(s,t){let n=r;this[n(441)]=!1,e.daJrK(clearTimeout,this[n(540)+"ionTimeoutId"]),e[n(1023)](t)},A0=async function(s,t){let n=r;if(!this[n(1516)]||this[n(1516)].readyState!==this[n(729)])return e[n(890)](t);let{pingInterval:o}=this[n(1094)];this["_endpoin"+n(355)]?.[n(1568)+n(708)+n(629)]();for(let d=0;e.JkWFU(d,this[n(173)+n(719)][n(769)]);d++){let p=this[n(173)+n(719)][d];if(e[n(455)](this._ws.readyState,this[n(729)])&&p!==null)this[n(1516)]&&this[n(1516)][n(1104)](p),this[n(173)+n(719)][d]=null;else break}this[n(173)+n(719)]=this[n(173)+n(719)].filter(d=>!!d),this[n(1209)+"gTimeoutId"]=e[n(1116)](setTimeout,()=>this._ping(),o),this["_dispatc"+n(1006)+"nt"](s),this[n(1151)+"er"]&&this[n(1516)]&&(this[n(1516)][n(1109)+"pe"]=this["_binaryT"+n(1279)]);let c=this[n(159)+n(355)]?.["getCurre"+n(1542)+"nt"]();this[n(1284)](n(952)+c+n(550)),t()},k0=async function(s,t){let n=r,o=this._endpointManager?.["getCurre"+n(1542)+"nt"]();this._debug(n(952)+o),e[n(1023)](t)};class I0 extends Vn{constructor(t){let n=r,o={zieOB:function(g,l,v,b){return e[A(501)](g,l,v,b)},eMXIo:function(g,l,v){return e[A(692)](g,l,v)},EKKJI:e[n(433)]};super(),this[n(1126)+n(414)+"line"]=!0,this[n(1151)+"er"]=ot,this[n(786)]=Go,this._isMiniTT=Je,this[n(249)+"X"]=bt,this[n(127)+"r"]=St,this[n(173)+n(719)]=[],this[n(159)+n(355)]=null,this[n(750)+"osed"]=!1,this["_binaryT"+n(1279)]=e.GMuYb,this[n(540)+n(895)]=!1,this[n(540)+n(201)+n(273)]=null,this[n(1416)+"ctTimeou"+n(1221)]=null,this[n(1209)+n(1370)+"Id"]=null,this[n(458)]=0,this._isInit=!1,this._url="",this[n(821)+n(338)]=null,this["_cursorM"+n(1073)]=null,this[n(395)+n(854)]=null,this[n(1390)+"ls"]=e.mNFNP,this[n(818)]=3,this.CONNECTING=0,this[n(729)]=1,this[n(444)]=2,this[n(764)]=g=>{let l=n;try{o[l(292)](xs,this,g,[D0,A0,k0])}catch(v){let b=o[l(571)](fe,o[l(912)],{message:v[l(972)],code:Oe[l(655)+"OR"],error:v});this["_dispatc"+l(634)+l(783)](b)}},this[n(717)+"ge"]=async g=>{let l=n;if(e[l(850)](e[l(622)],e[l(622)]))return this[l(1516)]?this[l(1516)][l(700)+"te"]:this[l(1094)][l(1548)+l(286)]?this.CONNECTING:this.CLOSED;{let{pingInterval:v,pingFrequency:b}=this._options;if((e[l(857)]("hi",g[l(162)])&&e.CbfOc(e[l(400)],b)||e.cMTID(e.VAjIR,b))&&(this[l(271)+l(577)](),this[l(886)](e[l(404)],l(1387)),this[l(1209)+l(1370)+"Id"]=e.hDLaw(setTimeout,this._ping[l(389)](this),v)),e[l(455)]("hi",g[l(162)]))return;try{e[l(1575)](xs,this,g,[o0,s0,E0,C0,S0,i0])}catch(D){let I=e[l(449)](fe,l(1523),{message:D[l(972)],code:Oe[l(1153)+l(649)],error:D});this[l(964)+l(634)+"ent"](I)}}},this[n(493)]=g=>{let l=n,v=this[l(159)+l(355)]?.[l(613)+"chMaxTries"](),b=this[l(159)+l(355)]?.[l(536)+l(1542)+"nt"]();if(v&&!g[l(972)])if(e[l(963)]("LaCwQ",e[l(375)])){let D=l(1202)+b+(" fail, m"+l(1522)+l(382)+"ed");this[l(964)+l(634)+"ent"](e[l(759)](fe,e[l(433)],{message:D,code:Oe[l(141)+l(1128)+"R"],error:g}));return}else return this[l(1516)]?this._ws[l(1109)+"pe"]:this[l(1118)+l(1279)];this[l(1516)]&&e[l(954)](this[l(1516)].readyState,this[l(729)])&&this[l(1285)+l(1157)](),this[l(964)+l(634)+l(783)](e[l(318)](fe,l(1523),{message:g.message,code:Oe["NATIVE_E"+l(512)],error:g}))},this[n(276)]=async g=>{let l=n;this[l(836)+l(1499)](),this._clearPingTimer(),this["_removeW"+l(1355)+"rs"](),this[l(1516)]=null,this[l(540)+l(895)]=!1;let v=this[l(159)+l(355)]?.checkReachMaxTries();if(!v&&this["_navigat"+l(990)]()&&!this[l(750)+l(582)])if(e[l(679)]!==e[l(161)]){let b=this[l(159)+"tManager"]?.[l(536)+l(1542)+"nt"](),D=this[l(1094)][l(643)+"tInterceptor"](g[l(1139)],g[l(1205)]);this[l(964)+l(1559)+l(783)](ge(l(514),{code:1006,reason:g[l(1205)]||l(1089)+l(198)+l(657)+"wn reason, hostn"+l(459)+b,willReconnect:D})),D&&this[l(540)]();return}else _0xca0b91[l(1407)+l(323)]="",_0x2fbbdb[l(942)](_0x50ef22);if(e[l(1212)](1e3,g.code)&&this[l(750)+l(582)]){this[l(964)+l(1559)+l(783)](e[l(1329)](ge,e[l(290)],{code:1e3,reason:e[l(1120)]})),this[l(159)+"tManager"]?.[l(1568)+l(708)+l(629)](),this[l(395)+l(854)]?.resetCounter();return}if(e[l(570)](1e3,g[l(1139)])&&v){let b=this._endpointManager?.[l(536)+l(1542)+"nt"](),D=g[l(1205)];D||(D=await e[l(516)]($o,this[l(1283)])),D=l(1089)+l(198)+l(541)+D+(l(475)+l(1442))+b+(l(1484)+l(674)+l(415)),this[l(964)+l(1559)+l(783)](ge(e.fZRPc,{code:g[l(1139)],reason:D}));let I=l(1202)+b+(l(760)+l(1522)+l(382)+"ed");this[l(964)+l(634)+l(783)](e[l(279)](fe,l(1523),{message:I,code:Oe["MAX_RETR"+l(1128)+"R"]})),this[l(159)+l(355)]?.[l(1568)+l(708)+l(629)](),this[l(395)+l(854)]?.[l(685)+"nter"]();return}if(e[l(963)](1e3,g[l(1139)])&&!g[l(1205)]){let b=this[l(159)+l(355)]?.[l(536)+"ntEndpoint"]();this["_dispatchCloseEv"+l(783)](e[l(180)](ge,e[l(290)],{code:g[l(1139)],reason:l(1089)+l(198)+l(657)+"wn reaso"+l(624)+l(459)+b})),this["_endpoin"+l(355)]?.[l(1568)+"pointCon"+l(629)](),this[l(395)+"sCounter"]?.resetCounter();return}this[l(964)+"hCloseEv"+l(783)](g),this[l(159)+"tManager"]?.[l(1568)+l(708)+l(629)](),this["_pingLos"+l(854)]?.[l(685)+l(996)]()},this[n(1546)]=null,this[n(740)]=null,this[n(917)+"e"]=null,this[n(832)]=null,this[n(1096)+n(1432)]=null,this["onReceiv"+n(1078)]=null,this[n(1326)+n(944)+n(704)+"ct"]=null,this[n(906)+"nLine"]=this[n(906)+n(1197)].bind(this),this[n(906)+n(956)]=this[n(906)+n(956)][n(389)](this),this[n(1584)+n(1164)]=this[n(1584)+n(1164)].bind(this),this[n(1584)+n(1251)]=this[n(1584)+n(1251)][n(389)](this),this[n(1094)]={url:"",automaticOpen:!0,initReconnectInterval:1e3,maxReconnectInterval:1e4,reconnectIntervalGrowFactor:2,timeoutInterval:5e3,maxRetries:5,debug:!1,maxMessageQueueLength:e[n(720)](1,0),service:0,logIDGenerator:x,headers:void 0,payloadEncoding:"",payloadType:"",fpID:"",deviceID:"",accessKey:"",ttwID:"",bddID:"",aID:"",disableAutoReconnect:!1,customParams:{},pingInterval:15e3,pingTimeoutInterval:4e3,pingFrequency:e[n(591)],pingLossCount:2,enableTransformTextPayload:!1,logIDNewConfig:{enableAutoGenerateLogIDNew:!1,userIp:""},miniProgramParams:{customHttpHeader:{}},enableAutoAck:!1,reconnectInterceptor:()=>!0,enableQoS:!1,QoSLevel:2,messageStrategy:n(233),env:{xTTEnv:"",xUseEnv:""},listenNetworkChanged:!0};let{url:c,ws:d}=t,p=Array[n(231)](c)?c:typeof c=="string"?[c]:[];if(!p||e[n(597)](0,p[n(769)]))throw new Error(n(816)+n(321)+n(190));if(!e[n(391)](Vo,d))throw new Error(e[n(1170)]);Object[n(1391)](this._options,t),this[n(159)+n(355)]=new as(p,this[n(1094)][n(965)+"es"]),this["_pingLos"+n(854)]=new Zo(this[n(1094)][n(373)+n(1433)]),this[n(1094)][n(1548)+n(286)]&&(this[n(441)]=!0,this[n(540)]()),this[n(1094)][n(588)+"tworkCha"+n(164)]&&(this[n(1323)+"T"]||this._isMiniWX?this[n(666)+n(1112)+n(1346)]():this[n(1151)+"er"]&&this[n(826)+"balEvent"+n(735)]())}_handleOnLine(){let t=r;this[t(1094)][t(177)+t(1497)+t(1243)]||this[t(750)+t(582)]||this[t(148)+t(1432)]()}[r(906)+r(956)](){let t=r;this[t(909)+t(1479)+"t"]();let n=e[t(676)](Jn,e.RIBvg,{message:e[t(143)]});this[t(1326)+"mediatel"+t(704)+"ct"]&&this[t(1326)+t(944)+t(704)+"ct"](n)}[r(826)+r(1273)+r(735)](){let t=r;this[t(1151)+"er"]&&window["addEvent"+t(735)]("online",this[t(906)+t(1197)]),this._isBrowser&&window[t(1514)+t(735)](e[t(1469)],this[t(906)+"ffLine"]),this[t(1151)+"er"]&&window[t(1514)+t(735)](e[t(303)],this[t(1584)+t(1164)]),this[t(1151)+"er"]&&window[t(1514)+t(735)](e[t(1507)],this["_handleP"+t(1251)])}["_dropGlobalEvent"+r(735)](){let t=r;e[t(1254)](t(802),e[t(147)])?this._isMiniTT||this[t(249)+"X"]?this[t(666)+t(1112)+t(1346)]():this[t(1151)+"er"]&&this[t(826)+t(1273)+t(735)]():(this[t(1151)+"er"]&&window["removeEv"+t(419)+t(658)](e[t(801)],this[t(906)+"nLine"]),this[t(1151)+"er"]&&window[t(1086)+t(419)+t(658)](e[t(1469)],this[t(906)+t(956)]),this[t(1151)+"er"]&&window[t(1086)+t(419)+t(658)]("pagehide",this[t(1584)+"ageHide"]),this[t(1151)+"er"]&&window[t(1086)+"entListe"+t(658)]("pageshow",this[t(1584)+"ageShow"]))}["_handleP"+r(1164)](t){let n=r;if(e.KKYJx===e[n(489)])return this[n(799)]?.[n(129)];!t[n(849)+"d"]&&(this[n(1151)+"er"]&&window[n(1086)+"entListe"+n(658)](n(966),this[n(1584)+n(1164)]),this[n(1151)+"er"]&&window[n(1086)+n(419)+n(658)](e[n(1507)],this[n(1584)+"ageShow"]),this.close()),this[n(1151)+"er"]&&window[n(1086)+"entListe"+n(658)]("online",this[n(906)+n(1197)]),this[n(1151)+"er"]&&window["removeEv"+n(419)+n(658)](e[n(1469)],this[n(906)+"ffLine"])}[r(1584)+r(1251)](t){let n=r,o={AmDln:e[n(810)],gGLBE:e[n(404)],rtIcj:e[n(901)]};if(e[n(374)](e[n(1358)],"KNfHX")){if(t[n(849)+"d"])if(e[n(437)](n(478),e[n(1331)])){let c={OxJgi:e[n(1e3)],tzYeF:n(304)+"e_success",UoWro:e[n(901)]};this[n(271)+n(577)](),this[n(1209)+"gTimeoutId"]=e[n(1111)](_0x5bb125,this[n(1234)][n(389)](this),this[n(1094)]["pingInte"+n(380)]);let d=()=>{let g=n;_0x1edbd8(o[g(1281)]),this[g(589)](o.gGLBE,d),this[g(589)](o[g(208)],p)},p=()=>{let g=n;_0x2ed22b(c.OxJgi),this.off(c.tzYeF,d),this[g(589)](c[g(664)],p)};this.on(e[n(404)],d),this.on(n(304)+n(794)+"t",p),this[n(1234)]()}else this[n(1578)+n(990)]()&&(!this[n(1516)]||e[n(1029)](this[n(1516)].readyState,this[n(729)])||e[n(219)](this[n(1516)][n(700)+"te"],this[n(1426)+"NG"]))&&this[n(906)+n(1197)](),this[n(1151)+"er"]&&window[n(1514)+"Listener"](e[n(801)],this[n(906)+n(1197)]),this._isBrowser&&window[n(1514)+n(735)](e.zKCoS,this[n(906)+n(956)])}else this[n(964)+"hMessage"+n(112)](_0x1c79a4),_0x5a84f4[n(868)](_0x3185fb,_0x5705fc,_0x986fcb[n(972)][n(1123)])}async[r(1368)+r(281)](t){let n=r,o={qPdRV:function(c,d){return e[A(597)](c,d)},GPzOd:e.gbZvC};if(e[n(930)]===e[n(1408)]){if(dIqpoC[n(163)](_0x44be88,n(266)))return _0x3f6972[n(1379)](_0x4570c8);if(_0x588938===dIqpoC[n(480)])return _0x4a72bc[n(647)+n(718)]||_0x44c81a[n(1379)](_0x441f0f);if(_0xe7f696===n(525))return _0x170214[n(647)+"oreNames"][1]?void 0:_0x4d7cd8[n(647)+n(653)](_0x58e1b1[n(647)+"oreNames"][0])}else{let{fpID:c,deviceID:d,bddID:p,ttwID:g,accessKey:l,aID:v,customParams:b={},enableAutoAck:D,enableQoS:I,QoSLevel:P,env:q}=this[n(1094)],se,qe,Fe;if(this._isBrowser||this._isMiniWX||this[n(1323)+"T"]){if(e.YRsTf(e[n(237)],e[n(1167)]))return _0x49a761===_0x2efbd1?_0x7d3bf5:new _0x3da6ac(e[n(739)](e[n(566)](_0xe4b04b[n(861)](_0x2d8b0e,0),e.PvKYX(_0x482f70.call(_0x2144d5,1),8))|e.lUhTm(_0xe8357f[n(861)](_0x312307,2),16),e[n(1030)](_0x2f4f9f[n(861)](_0x4430a3,3),24))>>>0,e[n(1438)](e[n(753)](e[n(326)](e[n(1531)](_0x4801e2[n(861)](_0x888fcc,4),_0x7fa8c5[n(861)](_0x5681ec,5)<<8),e.pmUkp(_0x3a8720[n(861)](_0x1ec477,6),16)),e[n(928)](_0x15ae24.call(_0x6e858e,7),24)),0),!0);se=location&&e[n(384)](n(1458),location[n(738)])?e[n(811)]:e[n(1315)],qe=t[n(1198)](/((^ws)|(^http))((?:[s]*:\/\/))/,""),Fe=/^wss(.*:\/\/)/.test(t)?t:""+se+qe}else{if(e[n(561)](e[n(1557)],e.PhKgx))return _0x196bbb[n(647)+"oreNames"]||_0x2bf4ee[n(1379)](_0x5304bb);se=e.mWDuW,qe=t[n(1198)](/(^http)((?:[s]*:\/\/))/,""),Fe=/(^ws)((?:[s]*:\/\/))/.test(qe)?qe:""+se+qe}let ps=p?e.iyHdF:g?e[n(1543)]:e[n(780)],ms=p||g||d;if(e[n(538)](!ms,!ps))throw new Error(e[n(230)]);let P0=e.dgZGS(e.ZHhgR,typeof b)?await e[n(513)](b):b,T0=q?e.OtdkR(Xo,q[n(275)],q[n(957)]):{},tr=Object[n(1391)]({device_platform:e[n(945)],version_code:e[n(881)],access_key:l,fpid:c,aid:v,[ps]:ms,xsack:D?1:0,xaack:D?1:0,xsqos:I?1:0,qos_level:I?P:void 0,qos_sdk_version:2,...T0},P0),L0=Object[n(606)](tr).reduce((nr,rr)=>tr[rr]!==void 0?""+nr+(nr?"&":"?")+rr+"="+tr[rr]:nr,"");return Fe+n(1445)+L0}}async[r(540)](){let t=r;if(!(this[t(540)+t(895)]||this[t(750)+t(582)])){this[t(540)+t(895)]=!0;try{let n=this[t(159)+"tManager"]?.["checkCur"+t(830)+"ointReac"+t(1562)+t(205)](),{timeoutInterval:o}=this[t(1094)];if(n){let d=this[t(159)+t(355)]?.["getCurre"+t(1542)+"nt"](),p=this[t(159)+"tManager"]?.["replaceB"+t(1291)+t(1190)+t(1459)+t(122)](),g=this[t(159)+t(355)]?.["getCurre"+t(1542)+t(644)+t(809)]();if(p){let l="connect "+d+(t(628)+t(1484)+t(674)+"ached, w"+t(1189)+t(1298)+"ndpoint ")+p+(t(356)+"y"),v=e[t(251)](fe,t(1523),{message:l,code:Oe[t(141)+t(1128)+"R"]});this[t(1284)](l),this["_dispatchErrorEv"+t(783)](v),this[t(1283)]=await this[t(1368)+t(281)](p),this._debug(t(1202)+p+" "+g+t(1393)),this[t(342)+t(1355)+"rs"]()}else{let l=t(1202)+d+(t(628)+", max retries re"+t(415));this._debug(l),this[t(964)+"hErrorEv"+t(783)](e[t(298)](fe,e[t(433)],{message:l,code:Oe[t(141)+t(1128)+"R"]}));return}}else{let d=this[t(159)+t(355)]?.[t(536)+t(1542)+t(1093)+"ateCount"](),p=this["_endpoin"+t(355)]?.[t(536)+"ntEndpoi"+t(644)+t(809)]();this[t(1283)]=await this[t(1368)+t(281)](e[t(992)](d,"")),this._debug("connect "+d+" "+p+" times"),this[t(342)+t(1355)+"rs"]()}if(this[t(441)])this[t(441)]=!1;else{let d=Jn(t(643)+"t",{message:"start"});this["onStartR"+t(1432)]&&this[t(1096)+t(1432)](d)}let c=this[t(159)+t(355)]?.[t(536)+t(1542)+t(644)+t(809)]()||0;e.nKGcv(c,1)&&await this[t(507)](e[t(882)](c,1)),this[t(1284)](t(1089)+"ng url: "+this._url+(" protoco"+t(1121))+this[t(1390)+"ls"]),this[t(1516)]=Jo({url:this[t(1283)],protocols:[this[t(1390)+"ls"]],headers:this[t(1094)][t(1495)+t(1137)+"s"]["customHt"+t(681)]},this[t(1094)].ws),(this[t(1151)+"er"]||this[t(127)+"r"])&&this[t(1516)]&&(this[t(1516)][t(1109)+"pe"]=this[t(1118)+t(1279)]),this[t(295)+t(650)](),this[t(540)+t(201)+"utId"]=e[t(462)](setTimeout,this[t(1435)+"ut"].bind(this),o)}catch(n){throw this[t(540)+"Lock"]=!1,n}}}["_clearTi"+r(1499)](){let t=r;e[t(968)](clearTimeout,this._connectionTimeoutId),this[t(540)+"ionTimeoutId"]=null}[r(271)+r(577)](){let t=r;e[t(530)](clearTimeout,this["_pingPon"+t(1370)+"Id"]),clearTimeout(this["_reconne"+t(1381)+t(1221)]),this[t(1209)+t(1370)+"Id"]=null,this[t(1416)+"ctTimeou"+t(1221)]=null}_debug(...t){let n=r;this[n(1094)][n(894)]&&console[n(942)][n(1228)](console,[e[n(324)],...t])}[r(1117)+"rvalValue"](t){let n=r,{initReconnectInterval:o,maxReconnectInterval:c,reconnectIntervalGrowFactor:d}=this[n(1094)],p=e.fFmag(o,Math[n(1186)](d,e[n(1286)](t,1)));return e[n(892)](p,c)?c:p}_ping(){let t=r,n={NHTSj:function(o,c){return e.JRdTF(o,c)}};if(e[t(1530)]===e[t(1530)]){if(this[t(1516)]&&this._ws[t(700)+"te"]===this[t(1426)+"NG"]){this[t(271)+t(577)](),this[t(1209)+"gTimeoutId"]=e[t(482)](setTimeout,this[t(1234)].bind(this),this._options["pingInte"+t(380)]);return}if(!this[t(1516)]||e[t(855)](this[t(1516)][t(700)+"te"],this[t(729)]))return void this[t(148)+"econnect"]();this._ws&&this[t(1516)][t(1104)]("hi"),this[t(1416)+t(1381)+t(1221)]=e[t(1553)](setTimeout,this[t(148)+"econnect"+t(351)][t(389)](this),this[t(1094)][t(270)+t(1373)+t(1040)])}else this[t(1012)]=!0,this.low=eUOejb[t(1020)](0,_0x1bf554),this.high=0|_0x2d9182,this[t(1535)]=!!_0x48520a}[r(148)+r(1432)+r(351)](){let t=r;this[t(395)+t(854)]?.[t(568)](),this[t(886)](t(304)+t(794)+"t",e[t(1e3)]),this[t(395)+t(854)]?.[t(613)+"chMaxCount"]()?this[t(148)+t(1432)]():this[t(1234)]()}[r(1578)+r(990)](){let t=r;return this[t(1323)+"T"]||this._isMiniWX?this["_miniNavigatorOn"+t(967)]:(this[t(1151)+"er"]||this[t(127)+"r"])&&this[t(1094)][t(588)+t(1417)+"nged"]?navigator[t(156)]:!0}[r(148)+r(1432)](){let t=r;!this["_navigat"+t(990)]()||this[t(750)+t(582)]||(this[t(159)+"tManager"]?.[t(1568)+t(708)+t(629)](),this["_pingLos"+t(854)]?.[t(685)+t(996)](),this[t(1516)]?this[t(1285)+"ect"](1001,e[t(120)],!0):this[t(540)]())}["_onPageN"+r(1112)+r(1346)](){let t=r,n={asPKo:function(o,c){return e[A(1280)](o,c)}};if(e[t(481)](e.mYxFG,e.jgKBi))return this[t(159)+t(355)]?.[t(536)+t(1542)+t(644)+"ount"]()||0;this[t(1323)+"T"]?tt[t(1043)+t(797)+t(1095)](({isConnected:o})=>{let c=t;this["_miniNav"+c(414)+c(967)]=o,o?this["_handleO"+c(1197)]():this[c(906)+c(956)]()}):this[t(249)+"X"]&&wx[t(1043)+t(797)+"hange"](({isConnected:o})=>{let c=t;e[c(333)](e[c(197)],e.aovJA)?(DJperS[c(1232)](_0x314af6,_0x132048[c(1523)]),_0x24ec73()):(this[c(1126)+c(414)+c(967)]=o,o?this[c(906)+c(1197)]():this[c(906)+c(956)]())})}[r(507)](t){let n=r,o={HuMTL:function(c,d){return c!==d},XSCDS:e[n(1388)],AmzeV:n(519),Hjowt:function(c,d,p){return e[n(605)](c,d,p)}};return new Promise(c=>{let d=n;o[d(503)](o[d(534)],o[d(392)])?o[d(908)](setTimeout,c,this[d(1117)+"rvalValue"](t)):this[d(328)+"ndpointT"+d(1241)+"t"]=0})}_disconnect(t=1e3,n="",o=!1){let c=r;this[c(1516)]&&this["_destroy"+c(1479)+"t"](t,n,o)}[r(1435)+"ut"](){let t=r;if(e[t(502)](e[t(146)],e[t(1421)]))_0x5b2705[t(1086)+t(419)+t(658)](eujvuM[t(247)],_0x5578e7),_0x5bf42d[t(1086)+"entListe"+t(658)]("error",_0x970f28),_0x1bc4aa[t(1086)+t(419)+t(658)](eujvuM.leUzB,_0x3a5849);else{let n=this[t(159)+t(355)]?.[t(536)+t(1542)+"nt"]();this[t(1284)](t(1202)+n+t(628)),this[t(1285)+t(1157)](1001,e[t(761)],!0)}}[r(1163)](t){let n=r,o=Wn(t);this[n(1516)]&&e[n(857)](this[n(1516)][n(700)+"te"],this[n(729)])&&(this._ws&&this[n(1516)][n(1104)](o),this[n(1284)](e[n(1183)],t))}[r(342)+r(1355)+"rs"](){let t=r,n=e[t(556)][t(970)]("|"),o=0;for(;;){switch(n[o++]){case"0":if(!this[t(1516)])return;continue;case"1":this[t(1516)][t(1086)+"entListe"+t(658)](e[t(1441)],this._onMessage);continue;case"2":this[t(1516)][t(1086)+"entListener"](e[t(269)],this[t(764)]);continue;case"3":this._ws[t(1086)+"entListener"](e.dHjtG,this[t(493)]);continue;case"4":this[t(1516)][t(1086)+t(419)+"ner"](e[t(290)],this._onClose);continue}break}}[r(295)+r(650)](){let t=r,n=e.kWfku[t(970)]("|"),o=0;for(;;){switch(n[o++]){case"0":this[t(1516)][t(1514)+"Listener"](t(972),this[t(717)+"ge"]);continue;case"1":this._ws[t(1514)+t(735)]("close",this._onClose);continue;case"2":this[t(1516)][t(1514)+t(735)](e[t(269)],this[t(764)]);continue;case"3":this._ws[t(1514)+t(735)](e[t(433)],this._onError);continue;case"4":if(!this._ws)return;continue}break}}["_wsInsta"+r(213)](t=1e3,n=""){let o=r;try{this[o(1516)]&&this[o(1516)][o(514)](t,n)}catch{}}[r(909)+r(1479)+"t"](t=1e3,n="",o=!1){let c=r;if(this[c(271)+c(577)](),this["_clearTi"+c(1499)](),this["_removeW"+c(1355)+"rs"](),this[c(935)+c(213)](1e3,n),this[c(540)+"Lock"]=!1,o&&this[c(1578)+"orOnline"]()&&!this._readyClosed){if(this[c(159)+c(355)]?.[c(613)+c(725)+"es"]()){if(e.ofLnG===e.mhAVz)return null;{let p=this["_endpoin"+c(355)]?.["getCurre"+c(1542)+"nt"]();this[c(964)+c(1559)+c(783)](e[c(1082)](ge,e[c(290)],{code:1006,reason:c(1202)+p+(" timeout"+c(1484)+c(674)+c(415)),wasClean:!0}))}}else{let p=this._options["reconnec"+c(341)+c(733)](t,n);this[c(964)+c(1559)+c(783)](e[c(207)](ge,e[c(290)],{code:t,reason:n,wasClean:!0,willReconnect:p})),p&&this._connect()}return}this[c(1578)+c(990)]()||this[c(750)+c(582)]?this[c(964)+c(1559)+c(783)](ge(e[c(290)],{code:t,reason:e[c(1120)]})):this[c(964)+"hCloseEv"+c(783)](e[c(1256)](ge,e[c(290)],{code:1006,reason:c(1471)+c(1062)+c(1127)+c(1506)})),this._ws=null,this["_endpoin"+c(355)]?.[c(1568)+c(708)+c(629)](),this[c(395)+c(854)]?.[c(685)+c(996)]()}_dispatchOpenEvent(t){let n=r;this[n(886)](n(1510),t),this[n(832)]&&this[n(832)](t)}[r(964)+r(287)+r(112)](t){let n=r;this.emit(e.UyEkY,t),this[n(917)+"e"]&&this.onmessage(t)}["_dispatc"+r(1200)+"ageEvent"](t){let n=r;this.emit(e.QKMnc,t),this[n(487)+n(1078)]&&this[n(487)+n(1078)](t)}[r(964)+r(634)+"ent"](t){let n=r;this[n(886)](e[n(433)],t),this.onerror&&this[n(740)](t)}[r(964)+r(1559)+"ent"](t){let n=r;this[n(886)](n(514),t),this.onclose&&this[n(1546)](t)}get[r(1109)+"pe"](){let t=r;return this._ws?this[t(1516)].binaryType:this._binaryType}set[r(1109)+"pe"](t){let n=r;this[n(1118)+n(1279)]=t,this[n(1516)]&&(this[n(1516)].binaryType=t)}get[r(405)+"nt"](){let t=r;return this["_endpoin"+t(355)]?.[t(536)+"ntEndpoi"+t(644)+t(809)]()||0}get["buffered"+r(533)](){let t=r,n=this[t(173)+t(719)].reduce((o,c)=>(o+=c&&c[t(962)+"th"]||0,o),0);return e[t(1475)](n,this[t(1516)]?this[t(1516)][t(115)+t(533)]:0)}get[r(174)+"ns"](){let t=r,n={zURMR:function(o,c){return e[A(976)](o,c)},yMfTt:function(o,c){return e[A(423)](o,c)}};if(e[t(1366)]===t(1014))return this[t(1516)]?this[t(1516)].extensions:"";{let o=CapvyG.zURMR(_0x2fb87d,_0x49f5af),c=_0x5ba0a8[t(1141)];return _0x4f455b[t(1141)]=CapvyG[t(193)](_0x39c863.offset,o),c}}get[r(738)](){let t=r,n={PpjeY:function(o,c){return e[A(1178)](o,c)}};if(e.CbfOc(e.tvOPK,e[t(537)])){let o=this[t(799)][t(1363)](this[t(492)]),c=_0x165fae.parse(MxQDSF[t(1091)](o,"{}"));return c[_0x490591]=void 0,this[t(799)][t(175)](this._prefix,_0x34cfd7[t(817)+"y"](c))}else return this._ws?this[t(1516)][t(738)]:""}get[r(700)+"te"](){let t=r;return this._ws?this[t(1516)].readyState:this[t(1094)]["automati"+t(286)]?this[t(1426)+"NG"]:this[t(818)]}get[r(1113)](){let t=r;return this[t(1516)]?this[t(1516)].url:this[t(1283)]}close(t=1e3,n){let o=r,c={oxSRV:function(d,p){return e[A(1414)](d,p)},gTOkV:function(d,p){return d>>p},bRZwf:function(d,p){return e[A(521)](d,p)}};if(e.OAqyx(e.DhNSU,e[o(974)])){if(this["_readyCl"+o(582)]=!0,this[o(836)+"mer"](),this[o(271)+o(577)](),this[o(736)+o(1273)+o(735)](),this["_QoSMana"+o(338)]?.[o(421)](),!this._ws)return void this[o(1284)](e[o(1264)]);if(this[o(1516)][o(700)+"te"]===this[o(818)]||this[o(1516)].readyState===this[o(444)])return void this[o(1284)](e[o(552)]);this[o(909)+o(1479)+"t"](t,n)}else _0x5d8307[_0x540915++]=crUnSM[o(1214)](crUnSM.gTOkV(_0x14b4b3,6),192),_0x54ce49[_0x1243bf++]=crUnSM.oxSRV(crUnSM[o(1571)](63,_0x12d7b7),128)}async send(t,n){let o=r;if(t==null)throw new Error(e[o(385)]);e.XNHfl(e.mPBXU,typeof t)&&(t=JSON[o(817)+"y"](t)),e[o(579)](e.geXZZ,typeof t)&&!e.fRTtX(t,ArrayBuffer)&&!(t[o(1464)]&&e[o(1259)](t[o(1464)],ArrayBuffer))&&(t=JSON[o(817)+"y"](t));let c=await e[o(1037)](us,t),d=e[o(871)](Yo,t),{method:p=0,service:g=this._options[o(1123)],logID:l=this._options[o(1558)+o(1060)](),headers:v=this[o(1094)][o(491)],payloadEncoding:b=this[o(1094)][o(1401)+o(852)],payloadType:D=this[o(1094)][o(518)+o(1279)],logIDNew:I=this[o(1094)][o(155)+o(569)][o(1199)+"toGenera"+o(209)+"ew"]?e[o(1473)](a,this[o(1094)][o(155)+o(569)][o(426)]):""}=e[o(309)](n,{});if(!g)throw new Error(e[o(918)]);let P={SeqID:B[o(1224)+"er"](this[o(458)]++),LogID:B[o(1224)+"er"](l),service:g,method:p,headers:v,payloadEncoding:e.TctSP(b,Object)?b[o(1398)]?b[o(1398)]:"":b,payloadType:D instanceof Object?D[o(1345)]?D[o(1345)]:d:D||d,payload:c,LogIDNew:I},q=e[o(723)](Wn,P);return this[o(1516)]&&e.zAcAt(this[o(1516)].readyState,this.OPEN)?(this._ws&&this[o(1516)].send(q),this[o(1284)](e[o(891)],P)):e.MfDcM(this["_message"+o(719)][o(769)],this._options["maxMessa"+o(1511)+o(1248)])?(this["_message"+o(719)][o(473)](q),this[o(1284)](e[o(203)],P)):e.dLfcO(e[o(532)],e.lxdHY)?(this[o(173)+o(719)][o(1207)](),this["_message"+o(719)][o(473)](q)):(_0x4abff6=o(866),_0x363060=_0x433535[o(1198)](/(^http)((?:[s]*:\/\/))/,""),_0x3c675a=/(^ws)((?:[s]*:\/\/))/[o(1430)](_0x39112f)?_0x19daca:""+_0x1579f4+_0x958d11),{seqID:this._seqId,logID:l,logIDNew:I}}async[r(643)+"t"](t){let n=r,o={Hbmra:function(p,g,l){return e[A(259)](p,g,l)}},{url:c}=e[n(1276)](t,{}),d=Array.isArray(c)?c:e[n(631)](e.geXZZ,typeof c)?[c]:[];if(t&&Object[n(1391)](this[n(1094)],t),d&&d.length?this[n(159)+"tManager"]=new as(d,this[n(1094)][n(965)+"es"]):this[n(159)+"tManager"]?.[n(1568)+n(708)+n(629)](),this[n(395)+n(854)]?.[n(685)+n(996)](this[n(1094)]["pingLoss"+n(1433)]),this[n(750)+n(582)]=!1,this[n(1516)]&&e[n(1063)](this[n(1516)][n(700)+"te"],this[n(818)]))this[n(1285)+n(1157)](1e3,e[n(1069)],!0);else if(e[n(1254)](e[n(1536)],e[n(1536)]))this[n(441)]=!0,this[n(540)]();else{let p=VZLtxn.Hbmra(_0x121a8f,_0x40d7f3,_0x26650b.length);_0x2902f1[n(1478)][n(868)](_0x1c7184,p)}}async[r(1513)](){let t=r;!this._connectLock&&(this["_endpoin"+t(355)]?.[t(1568)+t(708)+t(629)](),this[t(395)+t(854)]?.[t(685)+t(996)](),this[t(750)+"osed"]=!1,this[t(441)]=!0,this[t(540)]())}[r(1514)+r(735)](t,n){this.on(t,n)}[r(793)+r(112)](t){let n=r;if(e[n(118)]("ZUqLs",e[n(640)]))return this[n(1516)]?this[n(1516)][n(1113)]:this._url;{let{type:o}=t;this.emit(o,t)}}[r(1086)+"entListener"](t,n){this[r(589)](t,n)}[r(381)](){return new Promise((t,n)=>{let o=A,c={clDKQ:function(g,l){return e[A(1201)](g,l)},HqsgO:e[o(810)],DPINB:e[o(404)],yOYul:e[o(1e3)],vEDKU:e.MyRUa};this["_clearPi"+o(577)](),this[o(1209)+o(1370)+"Id"]=setTimeout(this[o(1234)][o(389)](this),this._options[o(1560)+o(380)]);let d=()=>{let g=o;c[g(448)](t,c.HqsgO),this[g(589)](c[g(632)],d),this[g(589)]("ping_onc"+g(794)+"t",p)},p=()=>{let g=o;n(c[g(1591)]),this[g(589)](c.DPINB,d),this[g(589)](c[g(1551)],p)};this.on(e.vDKYp,d),this.on(e[o(901)],p),this._ping()})}}})(),V[S(520)+S(357)]=J[S(520)+S(357)],V[S(412)+S(862)]=J[S(412)+S(862)],V[S(691)+"e"]=J.ErrorCode,V[S(112)]=J[S(112)],V.FWS=J[S(559)],V["Frontier"+S(220)+S(765)]=J[S(386)+S(220)+"vent"],V[S(220)+S(765)]=J[S(220)+"vent"],V[S(393)+"t"]=J[S(393)+"t"],V[S(806)+"tEvent"]=J["Reconnec"+S(853)],V[S(981)+S(357)]=J["createCl"+S(357)],V[S(170)+"rorEvent"]=J["createEr"+S(862)],V[S(898)+S(229)+"nt"]=J[S(898)+"ssageEvent"],V[S(144)+"enEvent"]=J[S(144)+S(116)],V[S(268)+S(1080)+S(765)]=J["createReconnectE"+S(765)],V[S(1065)+"rame"]=J[S(1065)+S(1162)],V[S(630)+"ame"]=J["encodeFr"+S(1394)];for(ln in J)["CustomCl"+S(357),"CustomErrorEvent",S(691)+"e",S(112),S(559),"FrontierMessageE"+S(765),"MessageE"+S(765),S(393)+"t",S(806)+S(853),S(981)+S(357),"createErrorEvent",S(898)+S(229)+"nt","createOpenEvent",S(268)+"connectEvent","decodedF"+S(1162),S(630)+S(1394)].indexOf(ln)===-1&&(V[ln]=J[ln]);var ln;Object[S(1316)+S(126)](V,S(509)+"le",{value:!0})});var Te=ie((Xd,xi)=>{"use strict";var oi=["nodebuffer","arraybuffer","fragments"],ai=typeof Blob<"u";ai&&oi.push("blob");xi.exports={BINARY_TYPES:oi,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:ai,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var It=ie((Zd,yn)=>{"use strict";var{EMPTY_BUFFER:hx}=Te(),lr=Buffer[Symbol.species];function gx(r,e){if(r.length===0)return hx;if(r.length===1)return r[0];let i=Buffer.allocUnsafe(e),a=0;for(let x=0;x<r.length;x++){let f=r[x];i.set(f,a),a+=f.length}return a<e?new lr(i.buffer,i.byteOffset,a):i}function ci(r,e,i,a,x){for(let f=0;f<x;f++)i[a+f]=r[f]^e[f&3]}function fi(r,e){for(let i=0;i<r.length;i++)r[i]^=e[i&3]}function px(r){return r.length===r.buffer.byteLength?r.buffer:r.buffer.slice(r.byteOffset,r.byteOffset+r.length)}function hr(r){if(hr.readOnly=!0,Buffer.isBuffer(r))return r;let e;return r instanceof ArrayBuffer?e=new lr(r):ArrayBuffer.isView(r)?e=new lr(r.buffer,r.byteOffset,r.byteLength):(e=Buffer.from(r),hr.readOnly=!1),e}yn.exports={concat:gx,mask:ci,toArrayBuffer:px,toBuffer:hr,unmask:fi};if(!process.env.WS_NO_BUFFER_UTIL)try{let r=W("bufferutil");yn.exports.mask=function(e,i,a,x,f){f<48?ci(e,i,a,x,f):r.mask(e,i,a,x,f)},yn.exports.unmask=function(e,i){e.length<32?fi(e,i):r.unmask(e,i)}}catch{}});var li=ie(($d,di)=>{"use strict";var ui=Symbol("kDone"),gr=Symbol("kRun"),pr=class{constructor(e){this[ui]=()=>{this.pending--,this[gr]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[gr]()}[gr](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[ui])}}};di.exports=pr});var ht=ie((Qd,mi)=>{"use strict";var Pt=W("zlib"),hi=It(),mx=li(),{kStatusCode:gi}=Te(),_x=Buffer[Symbol.species],yx=Buffer.from([0,0,255,255]),bn=Symbol("permessage-deflate"),Le=Symbol("total-length"),dt=Symbol("callback"),Ke=Symbol("buffers"),lt=Symbol("error"),vn,mr=class{constructor(e){if(this._options=e||{},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,!vn){let i=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;vn=new mx(i)}}static get extensionName(){return"permessage-deflate"}offer(){let e={};return this._options.serverNoContextTakeover&&(e.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(e.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(e.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?e.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(e.client_max_window_bits=!0),e}accept(e){return e=this.normalizeParams(e),this.params=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let e=this._deflate[dt];this._deflate.close(),this._deflate=null,e&&e(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(e){let i=this._options,a=e.find(x=>!(i.serverNoContextTakeover===!1&&x.server_no_context_takeover||x.server_max_window_bits&&(i.serverMaxWindowBits===!1||typeof i.serverMaxWindowBits=="number"&&i.serverMaxWindowBits>x.server_max_window_bits)||typeof i.clientMaxWindowBits=="number"&&!x.client_max_window_bits));if(!a)throw new Error("None of the extension offers can be accepted");return i.serverNoContextTakeover&&(a.server_no_context_takeover=!0),i.clientNoContextTakeover&&(a.client_no_context_takeover=!0),typeof i.serverMaxWindowBits=="number"&&(a.server_max_window_bits=i.serverMaxWindowBits),typeof i.clientMaxWindowBits=="number"?a.client_max_window_bits=i.clientMaxWindowBits:(a.client_max_window_bits===!0||i.clientMaxWindowBits===!1)&&delete a.client_max_window_bits,a}acceptAsClient(e){let i=e[0];if(this._options.clientNoContextTakeover===!1&&i.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!i.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(i.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&i.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return i}normalizeParams(e){return e.forEach(i=>{Object.keys(i).forEach(a=>{let x=i[a];if(x.length>1)throw new Error(`Parameter "${a}" must have only a single value`);if(x=x[0],a==="client_max_window_bits"){if(x!==!0){let f=+x;if(!Number.isInteger(f)||f<8||f>15)throw new TypeError(`Invalid value for parameter "${a}": ${x}`);x=f}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${a}": ${x}`)}else if(a==="server_max_window_bits"){let f=+x;if(!Number.isInteger(f)||f<8||f>15)throw new TypeError(`Invalid value for parameter "${a}": ${x}`);x=f}else if(a==="client_no_context_takeover"||a==="server_no_context_takeover"){if(x!==!0)throw new TypeError(`Invalid value for parameter "${a}": ${x}`)}else throw new Error(`Unknown parameter "${a}"`);i[a]=x})}),e}decompress(e,i,a){vn.add(x=>{this._decompress(e,i,(f,u)=>{x(),a(f,u)})})}compress(e,i,a){vn.add(x=>{this._compress(e,i,(f,u)=>{x(),a(f,u)})})}_decompress(e,i,a){let x=this._isServer?"client":"server";if(!this._inflate){let f=`${x}_max_window_bits`,u=typeof this.params[f]!="number"?Pt.Z_DEFAULT_WINDOWBITS:this.params[f];this._inflate=Pt.createInflateRaw({...this._options.zlibInflateOptions,windowBits:u}),this._inflate[bn]=this,this._inflate[Le]=0,this._inflate[Ke]=[],this._inflate.on("error",bx),this._inflate.on("data",pi)}this._inflate[dt]=a,this._inflate.write(e),i&&this._inflate.write(yx),this._inflate.flush(()=>{let f=this._inflate[lt];if(f){this._inflate.close(),this._inflate=null,a(f);return}let u=hi.concat(this._inflate[Ke],this._inflate[Le]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[Le]=0,this._inflate[Ke]=[],i&&this.params[`${x}_no_context_takeover`]&&this._inflate.reset()),a(null,u)})}_compress(e,i,a){let x=this._isServer?"server":"client";if(!this._deflate){let f=`${x}_max_window_bits`,u=typeof this.params[f]!="number"?Pt.Z_DEFAULT_WINDOWBITS:this.params[f];this._deflate=Pt.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:u}),this._deflate[Le]=0,this._deflate[Ke]=[],this._deflate.on("data",vx)}this._deflate[dt]=a,this._deflate.write(e),this._deflate.flush(Pt.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let f=hi.concat(this._deflate[Ke],this._deflate[Le]);i&&(f=new _x(f.buffer,f.byteOffset,f.length-4)),this._deflate[dt]=null,this._deflate[Le]=0,this._deflate[Ke]=[],i&&this.params[`${x}_no_context_takeover`]&&this._deflate.reset(),a(null,f)})}};mi.exports=mr;function vx(r){this[Ke].push(r),this[Le]+=r.length}function pi(r){if(this[Le]+=r.length,this[bn]._maxPayload<1||this[Le]<=this[bn]._maxPayload){this[Ke].push(r);return}this[lt]=new RangeError("Max payload size exceeded"),this[lt].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[lt][gi]=1009,this.removeListener("data",pi),this.reset()}function bx(r){if(this[bn]._inflate=null,this[lt]){this[dt](this[lt]);return}r[gi]=1007,this[dt](r)}});var gt=ie((el,Sn)=>{"use strict";var{isUtf8:wi}=W("buffer"),{hasBlob:Sx}=Te(),Ex=[0,0,0,0,0,0,0,0,0,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 Cx(r){return r>=1e3&&r<=1014&&r!==1004&&r!==1005&&r!==1006||r>=3e3&&r<=4999}function wr(r){let e=r.length,i=0;for(;i<e;)if((r[i]&128)===0)i++;else if((r[i]&224)===192){if(i+1===e||(r[i+1]&192)!==128||(r[i]&254)===192)return!1;i+=2}else if((r[i]&240)===224){if(i+2>=e||(r[i+1]&192)!==128||(r[i+2]&192)!==128||r[i]===224&&(r[i+1]&224)===128||r[i]===237&&(r[i+1]&224)===160)return!1;i+=3}else if((r[i]&248)===240){if(i+3>=e||(r[i+1]&192)!==128||(r[i+2]&192)!==128||(r[i+3]&192)!==128||r[i]===240&&(r[i+1]&240)===128||r[i]===244&&r[i+1]>143||r[i]>244)return!1;i+=4}else return!1;return!0}function Dx(r){return Sx&&typeof r=="object"&&typeof r.arrayBuffer=="function"&&typeof r.type=="string"&&typeof r.stream=="function"&&(r[Symbol.toStringTag]==="Blob"||r[Symbol.toStringTag]==="File")}Sn.exports={isBlob:Dx,isValidStatusCode:Cx,isValidUTF8:wr,tokenChars:Ex};if(wi)Sn.exports.isValidUTF8=function(r){return r.length<24?wr(r):wi(r)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let r=W("utf-8-validate");Sn.exports.isValidUTF8=function(e){return e.length<32?wr(e):r(e)}}catch{}});var Sr=ie((tl,Ci)=>{"use strict";var{Writable:Ax}=W("stream"),_i=ht(),{BINARY_TYPES:kx,EMPTY_BUFFER:yi,kStatusCode:Ix,kWebSocket:Px}=Te(),{concat:_r,toArrayBuffer:Tx,unmask:Lx}=It(),{isValidStatusCode:Nx,isValidUTF8:vi}=gt(),En=Buffer[Symbol.species],de=0,bi=1,Si=2,Ei=3,yr=4,vr=5,Cn=6,br=class extends Ax{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||kx[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[Px]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=de}_write(e,i,a){if(this._opcode===8&&this._state==de)return a();this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(a)}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e<this._buffers[0].length){let a=this._buffers[0];return this._buffers[0]=new En(a.buffer,a.byteOffset+e,a.length-e),new En(a.buffer,a.byteOffset,e)}let i=Buffer.allocUnsafe(e);do{let a=this._buffers[0],x=i.length-e;e>=a.length?i.set(this._buffers.shift(),x):(i.set(new Uint8Array(a.buffer,a.byteOffset,e),x),this._buffers[0]=new En(a.buffer,a.byteOffset+e,a.length-e)),e-=a.length}while(e>0);return i}startLoop(e){this._loop=!0;do switch(this._state){case de:this.getInfo(e);break;case bi:this.getPayloadLength16(e);break;case Si:this.getPayloadLength64(e);break;case Ei:this.getMask();break;case yr:this.getData(e);break;case vr:case Cn:this._loop=!1;return}while(this._loop);this._errored||e()}getInfo(e){if(this._bufferedBytes<2){this._loop=!1;return}let i=this.consume(2);if((i[0]&48)!==0){let x=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");e(x);return}let a=(i[0]&64)===64;if(a&&!this._extensions[_i.extensionName]){let x=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(x);return}if(this._fin=(i[0]&128)===128,this._opcode=i[0]&15,this._payloadLength=i[1]&127,this._opcode===0){if(a){let x=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(x);return}if(!this._fragmented){let x=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");e(x);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let x=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(x);return}this._compressed=a}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let x=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");e(x);return}if(a){let x=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(x);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let x=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");e(x);return}}else{let x=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(x);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(i[1]&128)===128,this._isServer){if(!this._masked){let x=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");e(x);return}}else if(this._masked){let x=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");e(x);return}this._payloadLength===126?this._state=bi:this._payloadLength===127?this._state=Si:this.haveLength(e)}getPayloadLength16(e){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(e)}getPayloadLength64(e){if(this._bufferedBytes<8){this._loop=!1;return}let i=this.consume(8),a=i.readUInt32BE(0);if(a>Math.pow(2,21)-1){let x=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");e(x);return}this._payloadLength=a*Math.pow(2,32)+i.readUInt32BE(4),this.haveLength(e)}haveLength(e){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let i=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");e(i);return}this._masked?this._state=Ei:this._state=yr}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=yr}getData(e){let i=yi;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}i=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&Lx(i,this._mask)}if(this._opcode>7){this.controlMessage(i,e);return}if(this._compressed){this._state=vr,this.decompress(i,e);return}i.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(i)),this.dataMessage(e)}decompress(e,i){this._extensions[_i.extensionName].decompress(e,this._fin,(x,f)=>{if(x)return i(x);if(f.length){if(this._messageLength+=f.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let u=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");i(u);return}this._fragments.push(f)}this.dataMessage(i),this._state===de&&this.startLoop(i)})}dataMessage(e){if(!this._fin){this._state=de;return}let i=this._messageLength,a=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let x;this._binaryType==="nodebuffer"?x=_r(a,i):this._binaryType==="arraybuffer"?x=Tx(_r(a,i)):this._binaryType==="blob"?x=new Blob(a):x=a,this._allowSynchronousEvents?(this.emit("message",x,!0),this._state=de):(this._state=Cn,setImmediate(()=>{this.emit("message",x,!0),this._state=de,this.startLoop(e)}))}else{let x=_r(a,i);if(!this._skipUTF8Validation&&!vi(x)){let f=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(f);return}this._state===vr||this._allowSynchronousEvents?(this.emit("message",x,!1),this._state=de):(this._state=Cn,setImmediate(()=>{this.emit("message",x,!1),this._state=de,this.startLoop(e)}))}}controlMessage(e,i){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit("conclude",1005,yi),this.end();else{let a=e.readUInt16BE(0);if(!Nx(a)){let f=this.createError(RangeError,`invalid status code ${a}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");i(f);return}let x=new En(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!vi(x)){let f=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");i(f);return}this._loop=!1,this.emit("conclude",a,x),this.end()}this._state=de;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=de):(this._state=Cn,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=de,this.startLoop(i)}))}createError(e,i,a,x,f){this._loop=!1,this._errored=!0;let u=new e(a?`Invalid WebSocket frame: ${i}`:i);return Error.captureStackTrace(u,this.createError),u.code=f,u[Ix]=x,u}};Ci.exports=br});var Dr=ie((rl,ki)=>{"use strict";var{Duplex:nl}=W("stream"),{randomFillSync:Rx}=W("crypto"),Di=ht(),{EMPTY_BUFFER:Bx,kWebSocket:Mx,NOOP:Ox}=Te(),{isBlob:pt,isValidStatusCode:zx}=gt(),{mask:Ai,toBuffer:Ze}=It(),le=Symbol("kByteLength"),qx=Buffer.alloc(4),Dn=8*1024,$e,mt=Dn,pe=0,Fx=1,Ux=2,Er=class r{constructor(e,i,a){this._extensions=i||{},a&&(this._generateMask=a,this._maskBuffer=Buffer.alloc(4)),this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=pe,this.onerror=Ox,this[Mx]=void 0}static frame(e,i){let a,x=!1,f=2,u=!1;i.mask&&(a=i.maskBuffer||qx,i.generateMask?i.generateMask(a):(mt===Dn&&($e===void 0&&($e=Buffer.alloc(Dn)),Rx($e,0,Dn),mt=0),a[0]=$e[mt++],a[1]=$e[mt++],a[2]=$e[mt++],a[3]=$e[mt++]),u=(a[0]|a[1]|a[2]|a[3])===0,f=6);let h;typeof e=="string"?(!i.mask||u)&&i[le]!==void 0?h=i[le]:(e=Buffer.from(e),h=e.length):(h=e.length,x=i.mask&&i.readOnly&&!u);let m=h;h>=65536?(f+=8,m=127):h>125&&(f+=2,m=126);let w=Buffer.allocUnsafe(x?h+f:f);return w[0]=i.fin?i.opcode|128:i.opcode,i.rsv1&&(w[0]|=64),w[1]=m,m===126?w.writeUInt16BE(h,2):m===127&&(w[2]=w[3]=0,w.writeUIntBE(h,4,6)),i.mask?(w[1]|=128,w[f-4]=a[0],w[f-3]=a[1],w[f-2]=a[2],w[f-1]=a[3],u?[w,e]:x?(Ai(e,a,w,f,h),[w]):(Ai(e,a,e,0,h),[w,e])):[w,e]}close(e,i,a,x){let f;if(e===void 0)f=Bx;else{if(typeof e!="number"||!zx(e))throw new TypeError("First argument must be a valid error code number");if(i===void 0||!i.length)f=Buffer.allocUnsafe(2),f.writeUInt16BE(e,0);else{let h=Buffer.byteLength(i);if(h>123)throw new RangeError("The message must not be greater than 123 bytes");f=Buffer.allocUnsafe(2+h),f.writeUInt16BE(e,0),typeof i=="string"?f.write(i,2):f.set(i,2)}}let u={[le]:f.length,fin:!0,generateMask:this._generateMask,mask:a,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==pe?this.enqueue([this.dispatch,f,!1,u,x]):this.sendFrame(r.frame(f,u),x)}ping(e,i,a){let x,f;if(typeof e=="string"?(x=Buffer.byteLength(e),f=!1):pt(e)?(x=e.size,f=!1):(e=Ze(e),x=e.length,f=Ze.readOnly),x>125)throw new RangeError("The data size must not be greater than 125 bytes");let u={[le]:x,fin:!0,generateMask:this._generateMask,mask:i,maskBuffer:this._maskBuffer,opcode:9,readOnly:f,rsv1:!1};pt(e)?this._state!==pe?this.enqueue([this.getBlobData,e,!1,u,a]):this.getBlobData(e,!1,u,a):this._state!==pe?this.enqueue([this.dispatch,e,!1,u,a]):this.sendFrame(r.frame(e,u),a)}pong(e,i,a){let x,f;if(typeof e=="string"?(x=Buffer.byteLength(e),f=!1):pt(e)?(x=e.size,f=!1):(e=Ze(e),x=e.length,f=Ze.readOnly),x>125)throw new RangeError("The data size must not be greater than 125 bytes");let u={[le]:x,fin:!0,generateMask:this._generateMask,mask:i,maskBuffer:this._maskBuffer,opcode:10,readOnly:f,rsv1:!1};pt(e)?this._state!==pe?this.enqueue([this.getBlobData,e,!1,u,a]):this.getBlobData(e,!1,u,a):this._state!==pe?this.enqueue([this.dispatch,e,!1,u,a]):this.sendFrame(r.frame(e,u),a)}send(e,i,a){let x=this._extensions[Di.extensionName],f=i.binary?2:1,u=i.compress,h,m;typeof e=="string"?(h=Buffer.byteLength(e),m=!1):pt(e)?(h=e.size,m=!1):(e=Ze(e),h=e.length,m=Ze.readOnly),this._firstFragment?(this._firstFragment=!1,u&&x&&x.params[x._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(u=h>=x._threshold),this._compress=u):(u=!1,f=0),i.fin&&(this._firstFragment=!0);let w={[le]:h,fin:i.fin,generateMask:this._generateMask,mask:i.mask,maskBuffer:this._maskBuffer,opcode:f,readOnly:m,rsv1:u};pt(e)?this._state!==pe?this.enqueue([this.getBlobData,e,this._compress,w,a]):this.getBlobData(e,this._compress,w,a):this._state!==pe?this.enqueue([this.dispatch,e,this._compress,w,a]):this.dispatch(e,this._compress,w,a)}getBlobData(e,i,a,x){this._bufferedBytes+=a[le],this._state=Ux,e.arrayBuffer().then(f=>{if(this._socket.destroyed){let h=new Error("The socket was closed while the blob was being read");process.nextTick(Cr,this,h,x);return}this._bufferedBytes-=a[le];let u=Ze(f);i?this.dispatch(u,i,a,x):(this._state=pe,this.sendFrame(r.frame(u,a),x),this.dequeue())}).catch(f=>{process.nextTick(Hx,this,f,x)})}dispatch(e,i,a,x){if(!i){this.sendFrame(r.frame(e,a),x);return}let f=this._extensions[Di.extensionName];this._bufferedBytes+=a[le],this._state=Fx,f.compress(e,a.fin,(u,h)=>{if(this._socket.destroyed){let m=new Error("The socket was closed while data was being compressed");Cr(this,m,x);return}this._bufferedBytes-=a[le],this._state=pe,a.readOnly=!1,this.sendFrame(r.frame(h,a),x),this.dequeue()})}dequeue(){for(;this._state===pe&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][le],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][le],this._queue.push(e)}sendFrame(e,i){e.length===2?(this._socket.cork(),this._socket.write(e[0]),this._socket.write(e[1],i),this._socket.uncork()):this._socket.write(e[0],i)}};ki.exports=Er;function Cr(r,e,i){typeof i=="function"&&i(e);for(let a=0;a<r._queue.length;a++){let x=r._queue[a],f=x[x.length-1];typeof f=="function"&&f(e)}}function Hx(r,e,i){Cr(r,e,i),r.onerror(e)}});var Oi=ie((sl,Mi)=>{"use strict";var{kForOnEventAttribute:Tt,kListener:Ar}=Te(),Ii=Symbol("kCode"),Pi=Symbol("kData"),Ti=Symbol("kError"),Li=Symbol("kMessage"),Ni=Symbol("kReason"),wt=Symbol("kTarget"),Ri=Symbol("kType"),Bi=Symbol("kWasClean"),Ne=class{constructor(e){this[wt]=null,this[Ri]=e}get target(){return this[wt]}get type(){return this[Ri]}};Object.defineProperty(Ne.prototype,"target",{enumerable:!0});Object.defineProperty(Ne.prototype,"type",{enumerable:!0});var Qe=class extends Ne{constructor(e,i={}){super(e),this[Ii]=i.code===void 0?0:i.code,this[Ni]=i.reason===void 0?"":i.reason,this[Bi]=i.wasClean===void 0?!1:i.wasClean}get code(){return this[Ii]}get reason(){return this[Ni]}get wasClean(){return this[Bi]}};Object.defineProperty(Qe.prototype,"code",{enumerable:!0});Object.defineProperty(Qe.prototype,"reason",{enumerable:!0});Object.defineProperty(Qe.prototype,"wasClean",{enumerable:!0});var _t=class extends Ne{constructor(e,i={}){super(e),this[Ti]=i.error===void 0?null:i.error,this[Li]=i.message===void 0?"":i.message}get error(){return this[Ti]}get message(){return this[Li]}};Object.defineProperty(_t.prototype,"error",{enumerable:!0});Object.defineProperty(_t.prototype,"message",{enumerable:!0});var Lt=class extends Ne{constructor(e,i={}){super(e),this[Pi]=i.data===void 0?null:i.data}get data(){return this[Pi]}};Object.defineProperty(Lt.prototype,"data",{enumerable:!0});var Kx={addEventListener(r,e,i={}){for(let x of this.listeners(r))if(!i[Tt]&&x[Ar]===e&&!x[Tt])return;let a;if(r==="message")a=function(f,u){let h=new Lt("message",{data:u?f:f.toString()});h[wt]=this,An(e,this,h)};else if(r==="close")a=function(f,u){let h=new Qe("close",{code:f,reason:u.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});h[wt]=this,An(e,this,h)};else if(r==="error")a=function(f){let u=new _t("error",{error:f,message:f.message});u[wt]=this,An(e,this,u)};else if(r==="open")a=function(){let f=new Ne("open");f[wt]=this,An(e,this,f)};else return;a[Tt]=!!i[Tt],a[Ar]=e,i.once?this.once(r,a):this.on(r,a)},removeEventListener(r,e){for(let i of this.listeners(r))if(i[Ar]===e&&!i[Tt]){this.removeListener(r,i);break}}};Mi.exports={CloseEvent:Qe,ErrorEvent:_t,Event:Ne,EventTarget:Kx,MessageEvent:Lt};function An(r,e,i){typeof r=="object"&&r.handleEvent?r.handleEvent.call(r,i):r.call(e,i)}});var kn=ie((il,zi)=>{"use strict";var{tokenChars:Nt}=gt();function be(r,e,i){r[e]===void 0?r[e]=[i]:r[e].push(i)}function jx(r){let e=Object.create(null),i=Object.create(null),a=!1,x=!1,f=!1,u,h,m=-1,w=-1,y=-1,_=0;for(;_<r.length;_++)if(w=r.charCodeAt(_),u===void 0)if(y===-1&&Nt[w]===1)m===-1&&(m=_);else if(_!==0&&(w===32||w===9))y===-1&&m!==-1&&(y=_);else if(w===59||w===44){if(m===-1)throw new SyntaxError(`Unexpected character at index ${_}`);y===-1&&(y=_);let L=r.slice(m,y);w===44?(be(e,L,i),i=Object.create(null)):u=L,m=y=-1}else throw new SyntaxError(`Unexpected character at index ${_}`);else if(h===void 0)if(y===-1&&Nt[w]===1)m===-1&&(m=_);else if(w===32||w===9)y===-1&&m!==-1&&(y=_);else if(w===59||w===44){if(m===-1)throw new SyntaxError(`Unexpected character at index ${_}`);y===-1&&(y=_),be(i,r.slice(m,y),!0),w===44&&(be(e,u,i),i=Object.create(null),u=void 0),m=y=-1}else if(w===61&&m!==-1&&y===-1)h=r.slice(m,_),m=y=-1;else throw new SyntaxError(`Unexpected character at index ${_}`);else if(x){if(Nt[w]!==1)throw new SyntaxError(`Unexpected character at index ${_}`);m===-1?m=_:a||(a=!0),x=!1}else if(f)if(Nt[w]===1)m===-1&&(m=_);else if(w===34&&m!==-1)f=!1,y=_;else if(w===92)x=!0;else throw new SyntaxError(`Unexpected character at index ${_}`);else if(w===34&&r.charCodeAt(_-1)===61)f=!0;else if(y===-1&&Nt[w]===1)m===-1&&(m=_);else if(m!==-1&&(w===32||w===9))y===-1&&(y=_);else if(w===59||w===44){if(m===-1)throw new SyntaxError(`Unexpected character at index ${_}`);y===-1&&(y=_);let L=r.slice(m,y);a&&(L=L.replace(/\\/g,""),a=!1),be(i,h,L),w===44&&(be(e,u,i),i=Object.create(null),u=void 0),h=void 0,m=y=-1}else throw new SyntaxError(`Unexpected character at index ${_}`);if(m===-1||f||w===32||w===9)throw new SyntaxError("Unexpected end of input");y===-1&&(y=_);let C=r.slice(m,y);return u===void 0?be(e,C,i):(h===void 0?be(i,C,!0):a?be(i,h,C.replace(/\\/g,"")):be(i,h,C),be(e,u,i)),e}function Gx(r){return Object.keys(r).map(e=>{let i=r[e];return Array.isArray(i)||(i=[i]),i.map(a=>[e].concat(Object.keys(a).map(x=>{let f=a[x];return Array.isArray(f)||(f=[f]),f.map(u=>u===!0?x:`${x}=${u}`).join("; ")})).join("; ")).join(", ")}).join(", ")}zi.exports={format:Gx,parse:jx}});var Ln=ie((xl,Xi)=>{"use strict";var Wx=W("events"),Jx=W("https"),Vx=W("http"),Ui=W("net"),Yx=W("tls"),{randomBytes:Xx,createHash:Zx}=W("crypto"),{Duplex:ol,Readable:al}=W("stream"),{URL:kr}=W("url"),je=ht(),$x=Sr(),Qx=Dr(),{isBlob:ec}=gt(),{BINARY_TYPES:qi,CLOSE_TIMEOUT:tc,EMPTY_BUFFER:In,GUID:nc,kForOnEventAttribute:Ir,kListener:rc,kStatusCode:sc,kWebSocket:Z,NOOP:Hi}=Te(),{EventTarget:{addEventListener:ic,removeEventListener:oc}}=Oi(),{format:ac,parse:xc}=kn(),{toBuffer:cc}=It(),Ki=Symbol("kAborted"),Pr=[8,13],Re=["CONNECTING","OPEN","CLOSING","CLOSED"],fc=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,z=class r extends Wx{constructor(e,i,a){super(),this._binaryType=qi[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=In,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=r.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,e!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,i===void 0?i=[]:Array.isArray(i)||(typeof i=="object"&&i!==null?(a=i,i=[]):i=[i]),ji(this,e,i,a)):(this._autoPong=a.autoPong,this._closeTimeout=a.closeTimeout,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){qi.includes(e)&&(this._binaryType=e,this._receiver&&(this._receiver._binaryType=e))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(e,i,a){let x=new $x({allowSynchronousEvents:a.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:a.maxPayload,skipUTF8Validation:a.skipUTF8Validation}),f=new Qx(e,this._extensions,a.generateMask);this._receiver=x,this._sender=f,this._socket=e,x[Z]=this,f[Z]=this,e[Z]=this,x.on("conclude",lc),x.on("drain",hc),x.on("error",gc),x.on("message",pc),x.on("ping",mc),x.on("pong",wc),f.onerror=_c,e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),i.length>0&&e.unshift(i),e.on("close",Ji),e.on("data",Tn),e.on("end",Vi),e.on("error",Yi),this._readyState=r.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=r.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[je.extensionName]&&this._extensions[je.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=r.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,i){if(this.readyState!==r.CLOSED){if(this.readyState===r.CONNECTING){ce(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===r.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=r.CLOSING,this._sender.close(e,i,!this._isServer,a=>{a||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),Wi(this)}}pause(){this.readyState===r.CONNECTING||this.readyState===r.CLOSED||(this._paused=!0,this._socket.pause())}ping(e,i,a){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(a=e,e=i=void 0):typeof i=="function"&&(a=i,i=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){Tr(this,e,a);return}i===void 0&&(i=!this._isServer),this._sender.ping(e||In,i,a)}pong(e,i,a){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(a=e,e=i=void 0):typeof i=="function"&&(a=i,i=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){Tr(this,e,a);return}i===void 0&&(i=!this._isServer),this._sender.pong(e||In,i,a)}resume(){this.readyState===r.CONNECTING||this.readyState===r.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(e,i,a){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof i=="function"&&(a=i,i={}),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){Tr(this,e,a);return}let x={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...i};this._extensions[je.extensionName]||(x.compress=!1),this._sender.send(e||In,x,a)}terminate(){if(this.readyState!==r.CLOSED){if(this.readyState===r.CONNECTING){ce(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=r.CLOSING,this._socket.destroy())}}};Object.defineProperty(z,"CONNECTING",{enumerable:!0,value:Re.indexOf("CONNECTING")});Object.defineProperty(z.prototype,"CONNECTING",{enumerable:!0,value:Re.indexOf("CONNECTING")});Object.defineProperty(z,"OPEN",{enumerable:!0,value:Re.indexOf("OPEN")});Object.defineProperty(z.prototype,"OPEN",{enumerable:!0,value:Re.indexOf("OPEN")});Object.defineProperty(z,"CLOSING",{enumerable:!0,value:Re.indexOf("CLOSING")});Object.defineProperty(z.prototype,"CLOSING",{enumerable:!0,value:Re.indexOf("CLOSING")});Object.defineProperty(z,"CLOSED",{enumerable:!0,value:Re.indexOf("CLOSED")});Object.defineProperty(z.prototype,"CLOSED",{enumerable:!0,value:Re.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(r=>{Object.defineProperty(z.prototype,r,{enumerable:!0})});["open","error","close","message"].forEach(r=>{Object.defineProperty(z.prototype,`on${r}`,{enumerable:!0,get(){for(let e of this.listeners(r))if(e[Ir])return e[rc];return null},set(e){for(let i of this.listeners(r))if(i[Ir]){this.removeListener(r,i);break}typeof e=="function"&&this.addEventListener(r,e,{[Ir]:!0})}})});z.prototype.addEventListener=ic;z.prototype.removeEventListener=oc;Xi.exports=z;function ji(r,e,i,a){let x={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:tc,protocolVersion:Pr[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...a,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(r._autoPong=x.autoPong,r._closeTimeout=x.closeTimeout,!Pr.includes(x.protocolVersion))throw new RangeError(`Unsupported protocol version: ${x.protocolVersion} (supported versions: ${Pr.join(", ")})`);let f;if(e instanceof kr)f=e;else try{f=new kr(e)}catch{throw new SyntaxError(`Invalid URL: ${e}`)}f.protocol==="http:"?f.protocol="ws:":f.protocol==="https:"&&(f.protocol="wss:"),r._url=f.href;let u=f.protocol==="wss:",h=f.protocol==="ws+unix:",m;if(f.protocol!=="ws:"&&!u&&!h?m=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:h&&!f.pathname?m="The URL's pathname is empty":f.hash&&(m="The URL contains a fragment identifier"),m){let R=new SyntaxError(m);if(r._redirects===0)throw R;Pn(r,R);return}let w=u?443:80,y=Xx(16).toString("base64"),_=u?Jx.request:Vx.request,C=new Set,L;if(x.createConnection=x.createConnection||(u?dc:uc),x.defaultPort=x.defaultPort||w,x.port=f.port||w,x.host=f.hostname.startsWith("[")?f.hostname.slice(1,-1):f.hostname,x.headers={...x.headers,"Sec-WebSocket-Version":x.protocolVersion,"Sec-WebSocket-Key":y,Connection:"Upgrade",Upgrade:"websocket"},x.path=f.pathname+f.search,x.timeout=x.handshakeTimeout,x.perMessageDeflate&&(L=new je({...x.perMessageDeflate,isServer:!1,maxPayload:x.maxPayload}),x.headers["Sec-WebSocket-Extensions"]=ac({[je.extensionName]:L.offer()})),i.length){for(let R of i){if(typeof R!="string"||!fc.test(R)||C.has(R))throw new SyntaxError("An invalid or duplicated subprotocol was specified");C.add(R)}x.headers["Sec-WebSocket-Protocol"]=i.join(",")}if(x.origin&&(x.protocolVersion<13?x.headers["Sec-WebSocket-Origin"]=x.origin:x.headers.Origin=x.origin),(f.username||f.password)&&(x.auth=`${f.username}:${f.password}`),h){let R=x.path.split(":");x.socketPath=R[0],x.path=R[1]}let T;if(x.followRedirects){if(r._redirects===0){r._originalIpc=h,r._originalSecure=u,r._originalHostOrSocketPath=h?x.socketPath:f.host;let R=a&&a.headers;if(a={...a,headers:{}},R)for(let[j,re]of Object.entries(R))a.headers[j.toLowerCase()]=re}else if(r.listenerCount("redirect")===0){let R=h?r._originalIpc?x.socketPath===r._originalHostOrSocketPath:!1:r._originalIpc?!1:f.host===r._originalHostOrSocketPath;(!R||r._originalSecure&&!u)&&(delete x.headers.authorization,delete x.headers.cookie,R||delete x.headers.host,x.auth=void 0)}x.auth&&!a.headers.authorization&&(a.headers.authorization="Basic "+Buffer.from(x.auth).toString("base64")),T=r._req=_(x),r._redirects&&r.emit("redirect",r.url,T)}else T=r._req=_(x);x.timeout&&T.on("timeout",()=>{ce(r,T,"Opening handshake has timed out")}),T.on("error",R=>{T===null||T[Ki]||(T=r._req=null,Pn(r,R))}),T.on("response",R=>{let j=R.headers.location,re=R.statusCode;if(j&&x.followRedirects&&re>=300&&re<400){if(++r._redirects>x.maxRedirects){ce(r,T,"Maximum redirects exceeded");return}T.abort();let ae;try{ae=new kr(j,e)}catch{let M=new SyntaxError(`Invalid URL: ${j}`);Pn(r,M);return}ji(r,ae,i,a)}else r.emit("unexpected-response",T,R)||ce(r,T,`Unexpected server response: ${R.statusCode}`)}),T.on("upgrade",(R,j,re)=>{if(r.emit("upgrade",R),r.readyState!==z.CONNECTING)return;T=r._req=null;let ae=R.headers.upgrade;if(ae===void 0||ae.toLowerCase()!=="websocket"){ce(r,j,"Invalid Upgrade header");return}let k=Zx("sha1").update(y+nc).digest("base64");if(R.headers["sec-websocket-accept"]!==k){ce(r,j,"Invalid Sec-WebSocket-Accept header");return}let M=R.headers["sec-websocket-protocol"],G;if(M!==void 0?C.size?C.has(M)||(G="Server sent an invalid subprotocol"):G="Server sent a subprotocol but none was requested":C.size&&(G="Server sent no subprotocol"),G){ce(r,j,G);return}M&&(r._protocol=M);let Se=R.headers["sec-websocket-extensions"];if(Se!==void 0){if(!L){ce(r,j,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let Be;try{Be=xc(Se)}catch{ce(r,j,"Invalid Sec-WebSocket-Extensions header");return}let me=Object.keys(Be);if(me.length!==1||me[0]!==je.extensionName){ce(r,j,"Server indicated an extension that was not requested");return}try{L.accept(Be[je.extensionName])}catch{ce(r,j,"Invalid Sec-WebSocket-Extensions header");return}r._extensions[je.extensionName]=L}r.setSocket(j,re,{allowSynchronousEvents:x.allowSynchronousEvents,generateMask:x.generateMask,maxPayload:x.maxPayload,skipUTF8Validation:x.skipUTF8Validation})}),x.finishRequest?x.finishRequest(T,r):T.end()}function Pn(r,e){r._readyState=z.CLOSING,r._errorEmitted=!0,r.emit("error",e),r.emitClose()}function uc(r){return r.path=r.socketPath,Ui.connect(r)}function dc(r){return r.path=void 0,!r.servername&&r.servername!==""&&(r.servername=Ui.isIP(r.host)?"":r.host),Yx.connect(r)}function ce(r,e,i){r._readyState=z.CLOSING;let a=new Error(i);Error.captureStackTrace(a,ce),e.setHeader?(e[Ki]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(Pn,r,a)):(e.destroy(a),e.once("error",r.emit.bind(r,"error")),e.once("close",r.emitClose.bind(r)))}function Tr(r,e,i){if(e){let a=ec(e)?e.size:cc(e).length;r._socket?r._sender._bufferedBytes+=a:r._bufferedAmount+=a}if(i){let a=new Error(`WebSocket is not open: readyState ${r.readyState} (${Re[r.readyState]})`);process.nextTick(i,a)}}function lc(r,e){let i=this[Z];i._closeFrameReceived=!0,i._closeMessage=e,i._closeCode=r,i._socket[Z]!==void 0&&(i._socket.removeListener("data",Tn),process.nextTick(Gi,i._socket),r===1005?i.close():i.close(r,e))}function hc(){let r=this[Z];r.isPaused||r._socket.resume()}function gc(r){let e=this[Z];e._socket[Z]!==void 0&&(e._socket.removeListener("data",Tn),process.nextTick(Gi,e._socket),e.close(r[sc])),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r))}function Fi(){this[Z].emitClose()}function pc(r,e){this[Z].emit("message",r,e)}function mc(r){let e=this[Z];e._autoPong&&e.pong(r,!this._isServer,Hi),e.emit("ping",r)}function wc(r){this[Z].emit("pong",r)}function Gi(r){r.resume()}function _c(r){let e=this[Z];e.readyState!==z.CLOSED&&(e.readyState===z.OPEN&&(e._readyState=z.CLOSING,Wi(e)),this._socket.end(),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r)))}function Wi(r){r._closeTimer=setTimeout(r._socket.destroy.bind(r._socket),r._closeTimeout)}function Ji(){let r=this[Z];if(this.removeListener("close",Ji),this.removeListener("data",Tn),this.removeListener("end",Vi),r._readyState=z.CLOSING,!this._readableState.endEmitted&&!r._closeFrameReceived&&!r._receiver._writableState.errorEmitted&&this._readableState.length!==0){let e=this.read(this._readableState.length);r._receiver.write(e)}r._receiver.end(),this[Z]=void 0,clearTimeout(r._closeTimer),r._receiver._writableState.finished||r._receiver._writableState.errorEmitted?r.emitClose():(r._receiver.on("error",Fi),r._receiver.on("finish",Fi))}function Tn(r){this[Z]._receiver.write(r)||this.pause()}function Vi(){let r=this[Z];r._readyState=z.CLOSING,r._receiver.end(),this.end()}function Yi(){let r=this[Z];this.removeListener("error",Yi),this.on("error",Hi),r&&(r._readyState=z.CLOSING,this.destroy())}});var eo=ie((fl,Qi)=>{"use strict";var cl=Ln(),{Duplex:yc}=W("stream");function Zi(r){r.emit("close")}function vc(){!this.destroyed&&this._writableState.finished&&this.destroy()}function $i(r){this.removeListener("error",$i),this.destroy(),this.listenerCount("error")===0&&this.emit("error",r)}function bc(r,e){let i=!0,a=new yc({...e,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return r.on("message",function(f,u){let h=!u&&a._readableState.objectMode?f.toString():f;a.push(h)||r.pause()}),r.once("error",function(f){a.destroyed||(i=!1,a.destroy(f))}),r.once("close",function(){a.destroyed||a.push(null)}),a._destroy=function(x,f){if(r.readyState===r.CLOSED){f(x),process.nextTick(Zi,a);return}let u=!1;r.once("error",function(m){u=!0,f(m)}),r.once("close",function(){u||f(x),process.nextTick(Zi,a)}),i&&r.terminate()},a._final=function(x){if(r.readyState===r.CONNECTING){r.once("open",function(){a._final(x)});return}r._socket!==null&&(r._socket._writableState.finished?(x(),a._readableState.endEmitted&&a.destroy()):(r._socket.once("finish",function(){x()}),r.close()))},a._read=function(){r.isPaused&&r.resume()},a._write=function(x,f,u){if(r.readyState===r.CONNECTING){r.once("open",function(){a._write(x,f,u)});return}r.send(x,u)},a.on("end",vc),a.on("error",$i),a}Qi.exports=bc});var Lr=ie((ul,to)=>{"use strict";var{tokenChars:Sc}=gt();function Ec(r){let e=new Set,i=-1,a=-1,x=0;for(x;x<r.length;x++){let u=r.charCodeAt(x);if(a===-1&&Sc[u]===1)i===-1&&(i=x);else if(x!==0&&(u===32||u===9))a===-1&&i!==-1&&(a=x);else if(u===44){if(i===-1)throw new SyntaxError(`Unexpected character at index ${x}`);a===-1&&(a=x);let h=r.slice(i,a);if(e.has(h))throw new SyntaxError(`The "${h}" subprotocol is duplicated`);e.add(h),i=a=-1}else throw new SyntaxError(`Unexpected character at index ${x}`)}if(i===-1||a!==-1)throw new SyntaxError("Unexpected end of input");let f=r.slice(i,x);if(e.has(f))throw new SyntaxError(`The "${f}" subprotocol is duplicated`);return e.add(f),e}to.exports={parse:Ec}});var xo=ie((ll,ao)=>{"use strict";var Cc=W("events"),Nn=W("http"),{Duplex:dl}=W("stream"),{createHash:Dc}=W("crypto"),no=kn(),et=ht(),Ac=Lr(),kc=Ln(),{CLOSE_TIMEOUT:Ic,GUID:Pc,kWebSocket:Tc}=Te(),Lc=/^[+/0-9A-Za-z]{22}==$/,ro=0,so=1,oo=2,Nr=class extends Cc{constructor(e,i){if(super(),e={allowSynchronousEvents:!0,autoPong:!0,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:Ic,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:kc,...e},e.port==null&&!e.server&&!e.noServer||e.port!=null&&(e.server||e.noServer)||e.server&&e.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(e.port!=null?(this._server=Nn.createServer((a,x)=>{let f=Nn.STATUS_CODES[426];x.writeHead(426,{"Content-Length":f.length,"Content-Type":"text/plain"}),x.end(f)}),this._server.listen(e.port,e.host,e.backlog,i)):e.server&&(this._server=e.server),this._server){let a=this.emit.bind(this,"connection");this._removeListeners=Nc(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(x,f,u)=>{this.handleUpgrade(x,f,u,a)}})}e.perMessageDeflate===!0&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=e,this._state=ro}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(e){if(this._state===oo){e&&this.once("close",()=>{e(new Error("The server is not running"))}),process.nextTick(Rt,this);return}if(e&&this.once("close",e),this._state!==so)if(this._state=so,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(Rt,this):process.nextTick(Rt,this);else{let i=this._server;this._removeListeners(),this._removeListeners=this._server=null,i.close(()=>{Rt(this)})}}shouldHandle(e){if(this.options.path){let i=e.url.indexOf("?");if((i!==-1?e.url.slice(0,i):e.url)!==this.options.path)return!1}return!0}handleUpgrade(e,i,a,x){i.on("error",io);let f=e.headers["sec-websocket-key"],u=e.headers.upgrade,h=+e.headers["sec-websocket-version"];if(e.method!=="GET"){nt(this,e,i,405,"Invalid HTTP method");return}if(u===void 0||u.toLowerCase()!=="websocket"){nt(this,e,i,400,"Invalid Upgrade header");return}if(f===void 0||!Lc.test(f)){nt(this,e,i,400,"Missing or invalid Sec-WebSocket-Key header");return}if(h!==13&&h!==8){nt(this,e,i,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(e)){Bt(i,400);return}let m=e.headers["sec-websocket-protocol"],w=new Set;if(m!==void 0)try{w=Ac.parse(m)}catch{nt(this,e,i,400,"Invalid Sec-WebSocket-Protocol header");return}let y=e.headers["sec-websocket-extensions"],_={};if(this.options.perMessageDeflate&&y!==void 0){let C=new et({...this.options.perMessageDeflate,isServer:!0,maxPayload:this.options.maxPayload});try{let L=no.parse(y);L[et.extensionName]&&(C.accept(L[et.extensionName]),_[et.extensionName]=C)}catch{nt(this,e,i,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let C={origin:e.headers[`${h===8?"sec-websocket-origin":"origin"}`],secure:!!(e.socket.authorized||e.socket.encrypted),req:e};if(this.options.verifyClient.length===2){this.options.verifyClient(C,(L,T,R,j)=>{if(!L)return Bt(i,T||401,R,j);this.completeUpgrade(_,f,w,e,i,a,x)});return}if(!this.options.verifyClient(C))return Bt(i,401)}this.completeUpgrade(_,f,w,e,i,a,x)}completeUpgrade(e,i,a,x,f,u,h){if(!f.readable||!f.writable)return f.destroy();if(f[Tc])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>ro)return Bt(f,503);let w=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${Dc("sha1").update(i+Pc).digest("base64")}`],y=new this.options.WebSocket(null,void 0,this.options);if(a.size){let _=this.options.handleProtocols?this.options.handleProtocols(a,x):a.values().next().value;_&&(w.push(`Sec-WebSocket-Protocol: ${_}`),y._protocol=_)}if(e[et.extensionName]){let _=e[et.extensionName].params,C=no.format({[et.extensionName]:[_]});w.push(`Sec-WebSocket-Extensions: ${C}`),y._extensions=e}this.emit("headers",w,x),f.write(w.concat(`\r
|
|
8
|
+
var B0=Object.create;var sr=Object.defineProperty;var z0=Object.getOwnPropertyDescriptor;var q0=Object.getOwnPropertyNames;var F0=Object.getPrototypeOf,U0=Object.prototype.hasOwnProperty;var X=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(e,o)=>(typeof require<"u"?require:e)[o]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')});var De=(r,e)=>()=>(r&&(e=r(r=0)),e);var oe=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),ms=(r,e)=>{for(var o in e)sr(r,o,{get:e[o],enumerable:!0})},H0=(r,e,o,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let x of q0(e))!U0.call(r,x)&&x!==o&&sr(r,x,{get:()=>e[x],enumerable:!(a=z0(e,x))||a.enumerable});return r};var Pe=(r,e,o)=>(o=r!=null?B0(F0(r)):{},H0(e||!r||!r.__esModule?sr(o,"default",{value:r,enumerable:!0}):o,r));import{chmod as K0,mkdir as j0,readFile as W0,writeFile as G0}from"node:fs/promises";import{dirname as J0}from"node:path";async function qt(r){try{let e=await W0(r,"utf8");return JSON.parse(e)}catch(e){if(e.code==="ENOENT")return null;throw e}}async function Ft(r,e,o){await j0(J0(r),{recursive:!0}),await G0(r,`${JSON.stringify(e,null,2)}
|
|
9
|
+
`,"utf8"),o?.mode!==void 0&&await K0(r,o.mode)}var ir=De(()=>{"use strict"});function ys(r){return Ht[_s]<=Ht[r]}function or(r){ws={...r}}function Ut(r,e,o,a){if(Ht[r]<Ht[_s])return;let x=JSON.stringify({ts:new Date().toISOString(),level:r,module:e,msg:o,...ws,...a});r==="error"||r==="warn"?V0.write(`${x}
|
|
10
|
+
`):X0.write(`${x}
|
|
11
|
+
`)}function M(r){return{debug:(e,o)=>Ut("debug",r,e,o),info:(e,o)=>Ut("info",r,e,o),warn:(e,o)=>Ut("warn",r,e,o),error:(e,o)=>Ut("error",r,e,o),child:e=>M(`${r}.${e}`)}}var Ht,_s,X0,V0,ws,F=De(()=>{"use strict";Ht={debug:10,info:20,warn:30,error:40},_s=(()=>{let r=process.env.COZE_BRIDGE_LOG_LEVEL;return r==="debug"||r==="info"||r==="warn"||r==="error"?r:"info"})(),X0=process.stdout,V0=process.stderr,ws={}});import{homedir as Y0}from"node:os";import{join as re}from"node:path";function U(r){let e=r??Y0(),o=re(e,".coze"),a=re(o,"bridge"),x=re(a,"lib");return{cozeRoot:o,bridgeRoot:a,libDir:x,libEntry:re(x,"index.js"),pidFile:re(a,"bridge.pid"),portFile:re(a,"bridge.port"),tokenFile:re(a,"bridge.token"),logFile:re(a,"bridge.log"),installLock:re(a,"install.lock"),configFile:re(a,"config.json"),agentsRoot:re(o,"agents")}}function Ie(r,e=U()){let o=re(e.agentsRoot,r);return{root:o,config:re(o,"config.json"),workspace:re(o,"workspace"),logs:re(o,"logs")}}var ce=De(()=>{"use strict"});var Wt={};ms(Wt,{AGENT_CONFIG_FILE_MODE:()=>Kt,enforceAgentConfigMode:()=>Z0,loadAgentConfig:()=>ae,persistAgentSessions:()=>ar,persistAgentSkills:()=>jt,saveAgentConfig:()=>de});import{chmod as Q0,stat as $0}from"node:fs/promises";function ae(r,e){return qt(Ie(r,e).config)}function de(r,e){return Ft(Ie(r.agentId,e).config,r,{mode:Kt})}async function Z0(r,e){if(process.platform==="win32")return;let o=Ie(r,e).config;try{let a=await $0(o);if(!a.isFile())return;let x=a.mode&511;x!==Kt&&(await Q0(o,Kt),bs.warn("agent config mode auto-corrected to 0600",{path:o,from:x.toString(8)}))}catch(a){if(a.code==="ENOENT")return;bs.warn("enforceAgentConfigMode: chmod failed (ignored)",{path:o,err:String(a)})}}async function ar(r,e,o){let a=await ae(r,o);a&&(a.sessions=Object.fromEntries(e),await de(a,o))}async function jt(r,e,o){let a=await ae(r,o);a&&(a.skills=e,await de(a,o))}var bs,Kt,Fe=De(()=>{"use strict";ir();F();ce();bs=M("agent-config"),Kt=384});var ai=oe(Y=>{"use strict";var S=k;(function(r,e){let o=k,a=r();for(;;)try{if(-parseInt(o(1764))/1+parseInt(o(811))/2+-parseInt(o(1466))/3*(-parseInt(o(1431))/4)+parseInt(o(1562))/5+-parseInt(o(783))/6*(parseInt(o(1308))/7)+parseInt(o(1202))/8+parseInt(o(1906))/9===e)break;a.push(a.shift())}catch{a.push(a.shift())}})(gn,502323);var sx=Object[S(1490)+S(1571)],ix=Object[S(523)+S(554)+"mes"],ni=(r,e)=>function(){return r&&(e=(0,r[{zMRuE:function(f,d){return f(d)}}[S(646)](ix,r)[0]])(r=0)),e},ox=(r,e)=>{for(var o in e)sx(r,o,{get:e[o],enumerable:!0})};function gn(){let r=["rLL0DKi","y29UBMvJDeu","BerMweO","x29Uq2XVC2u","vKPgCgK","mNW0Fdn8mhW","s2TIz3K","uLr2wLK","uKv2B2m","y1DwqvK","suj3DhG","u2rSEve","BMv4DcGPigm","rNzvz28","BIWGAg9ZDg4","CMvTB3zLrxy","tvbAwNK","y29erue","qw5uqMu","x2HHBMrSzvi","C2v0y3vYC28","B3DpCwK","yM9KEq","CgDnBwC","tvDbwfG","t1bftL9fuLi","txvJtfu","zgvS","wgf1wwy","z0TvD2i","D0Xoz1a","CM92AwrLihC","A1Drv1a","yungsgu","AvfRuNK","B1zVyMe","wLzxC0W","x1fVu01HBMe","mNW0Fdb8mxW","sMHmAw8","ww1ltKS","EfvZzuvUDG","yxboBxe","sgTYy1O","CMPovK0","BwvZC2fNzq","wvztB3i","y2XLyxjtDg8","yw1L","x29UrxjYB3i","q1fZr2C","BMnVzgLUzW","B2nRzxrtDwm","tvjuuvm","y0PQCeO","BwjLB3y","v2nAz2q","s3LjCvG","BwvKAwf0zwW","AhDlC3y","BMv3vMvYC2K","vuLMy0u","tvfQsee","ihzHBgLKigq","Aw5KzxHpzG","Cfr1vxa","q0TPwMe","CNzHBa","rKLmrv9ot1q","oti1nZG5yKPQDK1R","x2fKzfDZtgK","BMnLq2XVC2u","z1P4C2S","ugjmyxi","tNDYtLi","ANDnte8","x2LUAxrqCM8","tNLSr1m","ANPhvLe","ywDuy1O","qLLMqwi","yw5Hz2vY","BLffELG","thbMAu8","z2v0qwXS","ANDiDvi","yKniuhC","q0Xpu0LorW","zvvYBa","B3jRig9MzMW","t0LnzNG","zKr3zNO","D2LSBfjLy28","qvnctw0","sfrcuMO","C2vUza","AgfZt3DUuhi","BvrKs3G","C3Dwshe","C1bes1q","AvLkq3y","q09otKvdveK","DKXHzvy","BfbIDxm","uLnYwfa","DMvYC2LVBG","CgjICdi","vvH0sey","q2XdqMq","y0zyrNe","ywXSq3vYC28","rLDt","DLHoC0C","txnUAhi","z0rpCKi","Def6rMe","EKfws08","Aw1LCYbPBIa","nhWXFdn8mNW","zujAr0O","x2vUzhbVAw4","EuzlCge","C0rvD0O","yMjcAwe","CMvJB25Uzwm","uvjkrLu","mhWYFdn8nxW","sKnYD2e","vK1nBM4","y29Uy2f0","zezwuNi","uKfPvMq","uMnArMO","CLzHBhvLCW","tK1HDNm","x3jLy29UBMu","rgTtqMG","ywrKt25L","vg9mAuO","ywDL","q3P1y3q","EMj1z20","vgLTzw91Da","whjwD2W","tufyx1jfvfi","C0jf","zxrxB3jRq2G","t2fwELC","Fdr8mxW3","s2jkC1m","uuHRDvu","q09oveLovuu","A1n0yxr1C0m","AwXLtMfTzq","uvLMzgq","EMvYtLm","Aw5L","swvNqLq","z2vY","u1vwwwu","vKzdAxm","yxv0BW","swvwAKK","uMLNBwq","mhW0Fdv8mNW","yMfSu2nVCgu","wKrkzgi","B3L3vMW","tKzntLq","vvbXC0K","C3Diu08","ywXSB2nvBNm","sNf1vuy","sMvTzvC","CKT0rxe","DKD6B0u","m3WXFdv8n3W","B3jLtMfTzxm","z3rAqvO","wfLlqK4","A2zRrNe","CMvKDwnL","zuXsyKS","CfrkDLC","qwvfrwi","x29Ut3bLBG","rfDyCxG","quDtBuS","zNvUy3rPB24","z3nOq24","zermC2e","sg9nsMi","ELPRy3C","ChrVCG","rLDsAMm","s0PPvKO","ywnRpwzYB24","BM5mqKG","z2v0s2v5","CNjVCK1LC3m","CIb0DhDjra","DNPdu00","uuXrCei","vu5ksvq","rvHqBxK","uvrjr0e","AeXPtKm","C3rVCMu","zgvIDwC","sKXutwW","tgzHtMe","mJKZoty1mLLfuuD5AG","CgLUz0XVC3m","C3rYAw5N","BKneCxK","C2X5v2G","ywrK","AxvMCK0","Euv6q2y","sMfUBKy","BgXsDei","BxDZtLi","B25mAw5L","Cg9PBNrbBMq","CM12quG","zNrNzw8","uxvLDwu","yKfpveW","tgHqtwS","wwXYt2y","DLHmtLy","nNW0FdD8m3W","ywrwAeW","t0D6C2e","twP6rKK","zw1PDa","DvrdtKy","vM5WBM0","CMH0EeW","EePvrNa","z2v0u3rVCMe","ueT3uhu","t21JzvG","DfHwtKG","tMLhvMS","y0j0se0","vMLhsKG","Dg9VigXHCMC","mxWWFdv8mNW","uwLnu1a","CMvJzxzPzwq","tw9KDwXL","zNjVBu51Bwi","qMz5q3C","ChvZAa","DfzLsgm","Ae9Wzw5fDMu","CezUzKG","y2HHCKnVzgu","AMTtvKS","AuPLB2W","CgLUz1rPBwu","rfrbs0q","whbAuey","y29UBMvJDa","txHesfe","sMrfDMi","B2jQzwn0u3q","sfLLsui","ohWYFdL8nxW","Dgf2rxK","rNHPChq","Axjkvum","yLvuBM4","vgjSyu0","y2HnyxHdB3u","C29YDa","uMfXt3O","Dg9Y","thzzrvy","A2vvu3O","DuXTtve","zcWG","BgLUzq","m3W0","tMfTzq","DxDPsuS","C2nYAxb0","s2DUr1G","zwDgrum","BwXIBM8","BwvZC2fNzv8","zu1isK8","q29Kzq","BgvUz3rO","z2v0qwXSs2u","D25wCNK","qxzizNy","weXqDfC","Ae1LC3nHz2u","CMvUDevUzha","vMrHBM0","zu9WtKi","u250ve4","C3jOBgi","AwXLx25HBwu","Dxrjza","ywjYBfe","y3vYCMvUDeu","EhvzCMu","rNzmEve","ChjVy2vZCW","EhrquLq","Cgn1v1y","yNPXugu","zM9Yy2u","Bg93","tMfMqM4","s05ovMu","vfjKBwK","C1riB3a","vfvlyNi","verjt08","zvHlDxq","seTwD0m","yw51Ce1LC3m","zxD0z08","wNnftLm","wunluM8","Ec1TC2CTy3u","ihrPBwvZ","ug5dBeu","A1LpCwy","AfDmywK","B3nLza","x2zVCM1HDeu","zxH0zw5ZAw8","uLjpuG","s1nPDu8","vvjsvgi","x2nYzwf0zvm","B0PKExK","yxKSig5LDhC","y3jUAxa","mdaWma","x2rPC3bHDgm","vwnbvxa","yw5ZzM9YBvq","AxLcwfy","rvDKrwq","B2zM","svPHAey","DcbSAw1PDa","x29UvgLTzw8","EgPRuMm","Aw9U","ugzuD2u","ywr2yw5Jzq","BxnNsuq","yNvkuxC","Aw47y2HHCNm","A2v5","B25tDgfYDfi","v0zkqwG","BwPoz08","u2XxAw8","Cgf5Bg9Hza","y2HnyxHuCMK","z29PBMCGyxC","wffJBuW","wvzLveG","yxnL","yMncr0q","rMXtD2y","q0Xpu0ve","ueLnsg4","x29UtwvZC2e","y0PovLO","zw1LBNq","D3m6lY8","Bg9IywXty28","D3jPDgu","zw50","z1Lgy0C","B0vhswe","x3nVy2TLDa","yMLUza","t2Per3O","zgvJB2rLzey","vLvJt2W","u1vlDg4","BhbdzLK","DwXIu08","AgvhCMO","y3vYC29Y","zufJAW","Bu1kEgW","uxHfteq","s0nwD0W","y3bvt28","zef2y04","C2nqB1q","r1zKq1m","Aw50zwDLCIa","vfLgrKm","ChzWEM4","B2nRzxrgywK","uM1yrwy","C2vYDMLJzq","y3jLyxrLtwu","BMfTzq","BhLnuue","rw1lsxy","qwTpsge","tKL6Eum","qxjpuw8","yKnyzxu","rxzLBNq","C0Xf","z2v0t3DUuhi","DeLK","D01kuwm","uxDQs0C","x3DZ","AxnmB25N","EvfPDeO","B3jpBMXPBMu","r09pD0e","AwXSihvZzsa","s1LpzKe","tuvtu0fhrv8","B0LKs3e","yMXVy2TLza","x2rLyNvN","rhP4Cgm","t3bLBKv2zw4","zKrntvy","zgLZCgf0y2G","A3HJD0m","B1zzt04","CMfTzq","sLfjA2G","DurRrg4","wLvfvu0","Dhr3Awq","zgLZywjSzue","veHky3q","s1fpyuu","y29UBMvJDgK","zwvKzwq","B3bLCNr5tMe","u29urwm","DMfSDwvZ","BuPOz2O","yu5gzve","v1fIwe0","tK5Qz2C","DxDlAKu","weTKAvi","q3nvvfa","yNndvue","qLDVze0","zcbLCNjVCI4","uMvJB25Uzwm","EMrwAxi","wNDSu28","wMrssxe","yvrstMq","y29UBMvJDfm","AxjLza","Bwf4tg9ZC0m","y3jLyxrLrxi","C2HPzNq","uMjbufu","sNLJwMK","CgfNzxnOB3C","uvjdExK","zw5fDMvUDa","t2XgDg0","y1vkCvC","Bg5pDg8","AMTKsuO","CMfUzg9T","uuXswKi","y3jLyxrLuMu","B2zMBgLUzq","AejOzMC","sufwELG","B25JBg9Zzq","EeTbrfC","rKrpuvK","qLPtDvK","zNjVBujPDhm","BeHHBMrSzxi","s0T3ENC","q291BNq","yxv0B21HDgK","x19LC01Vzhu","BvzdrNu","CMvZDwX0","wKjsswC","qwnzwNq","A1fmzKC","B2zMC2v0","CM5qCNG","CMvJzwL2zwq","D3PlseC","vKLjvKC","z1b2uu8","x2rPC2nVBM4","Dg9cExrLC0i","y2XVC2uSihC","D0HJr0u","BLn3uLq","uM9RELq","BNPAB3G","reXxre8","yuHct3q","zw5JB2rLrNi","yu5iAha","B25LCNjVCG","vhjRwMq","tgH4sfC","tuzfuem","tejoswq","uvHywg0","sgzAD2G","qLnczLe","DxrMofDYAxq","BMDLza","y29Kzq","wK1fBNq","B2nRzxq","C3fXDum","z3jpC1K","DhDVCMTdAge","wMjTquC","zuX3EvC","sfndB3K","ve1ZquO","q1LZD0y","zxjYtxnN","EK1sDuu","z09SqKy","C3vJy2vZCW","DxLgEMm","BNv2B1C","wLHzt00","yMLUyxj5vhK","Dg9cExrLC0W","A2Xeq0C","CevJwfa","C3rVCcbPBw0","BfrPBwvVDxq","q3jQzMW","x0vysvnu","ywnOzwq","BxzmyuW","DhjPzxmGCMu","tLbJtMi","zxrXuvi","vhnAwuG","Dg9Zq2q","EeDAqvy","DgLTzw91DcW","A0nMyxO","qw5YD24","y29UC3rYDwm","ywrKrxzLBNq","zv90Aw1LB3u","z2vrDwv1zuW","zxH0ugf5Bg8","C01czuu","B25szwnLAxy","ugHADwO","y2XLyxi","zwn0","DerOqM4","EKfyyNO","y2fSBa","Bw9AA1O","r3r4suK","zLzYCwW","rKXOvNe","rKn3tNa","zMLSDgvY","x3vYBa","DxbKyxrLq3u","q25Ot2q","BLnfsve","sNzKAe8","De1HBMfNzxi","Cgf5Bg9Hzfq","q1rir2e","wg1RrwK","AvvTCeS","AxLfrNi","t05vzKq","C0vkAfu","ywLXEgG","x2nSzwfYugK","sLnfuhe","EMDvvhG","zfDVCMTLCKC","zgLcCvK","sxPKD2q","BwDcDvK","B25tDg9Wsw0","DwPAwMy","x2LZtwLUAvq","yMfSrxzLBNq","AxmGDw5Kzwy","zw50zwqGDhK","u3rYyxrLz3K","r2HJAMS","rhDKq2m","Bwv0Ag9K","Ec11C2uT","tLPJseC","wNLQsw8","r2r6BNm","zxHWB3j0CW","CezfBu8","CM9YrxzLBNq","Cgj6Eu0","s0DuCwG","B3jRzxjhBg8","EvjLy29UBMu","C3bSAwnL","DurzCK0","qujywuy","Cu5uCfu","ugfktK0","t1vzquO","AePIq2K","v2PpAxK","wgTRzKy","x3jLywr5q2W","wgPduwm","CMvWBgfJzq","qw1VDw50","BMCGDxjSoIa","ywWGy3vYC28","uMTxree","swHOsvG","C2XPy2u","zNjVBuHHC2G","wwryv2O","ywnRDxbfBMq","B3vUDa","CNnVCL9Uyw0","yxbWBgLJyxq","txrHrKC","A2v5CW","BvDUs0m","r3fQDKe","zKjRquW","BMCGzMfPBgu","y3vYC29Yx24","A1rVyKu","B2TRAhC","zgvSzxrLrge","DhjPBq","DLzus3q","B3nLrxzLBNq","y2f0y2G","zevOBg8","Cw91Ce0","shvnC04","zuvyyKq","C3jJ","uuHgrwS","zvbqrLa","C3Let2q","r3HnENi","AgvKtwf4uMu","DMfS","yxrLq291BNq","zMLN","nLjXCfzxsW","tfj2ueG","DNbWwxq","zMvY","rMroq1G","BgvY","qNDXChK","uhnOEum","zMzLCG","CMvHzhLtDge","CMvHC29U","BM5Ly3q","C3vIyxjYyxK","qwnrBK4","t3zjugW","yuLiB0u","sLnXuhO","nhWWFdn8nxW","x2rItMfTzq","yMLJr1m","DwXxzKm","C3bSAxq","t3LbEvm","rfbmveG","uhjUsfi","ruv2s0O","zwXRrNe","D0zxq20","nde2mdmWvuvRAgzo","u215Dee","uvj6vM4","BerlyMm","q2fjCvK","x2jPBMfYEvq","qMftuMy","yKL1Auq","De5mqKG","wxjXzMm","v2ffu0u","yxrHlcbKyxq","uwXxuxy","x0rctMfTzq","C2v0zgi","uLjKDve","tLzAv0m","Chn3D1m","C0jAqLm","thHxAwi","Cg93","uK53DNG","tKH4uMu","CMvZzxrfBMq","zw5JB2rPBMC","CK5Uv3u","zhDVzfG","z29HEge","A2X4Ahm","qMXKBuW","C1Ddr0G","B3jL","z2v0sxrLBq","uwnRuxe","CMvQzwn0","Aw5KzxGGB3u","Dg9iyxnO","CMjkEMW","whnirwu","yxvNsKG","zNjVBunOyxi","A1HlBfu","wLbZsMu","q0Pvqwe","yMLUyxj5","y25YqNK","ywXty29Wzq","Ew1xsfG","wxjMthK","x2LUAxq","C3fdEMS","CLHhAuq","tMTiquu","Bg9Nsurhzw4","suf1quW","m3WWFdr8mNW","EhvUCgm","t1P5EM8","Bwu6ia","ywrKq291BNq","Dg9tDhjPBMC","zMzorLK","r2f2qxG","Ahr0Chm6","u2LpzMC","zMnoBu8","CwnmCwO","qK5VEMu","zxjYtM8","A0XmAg8","zMDnq3e","z2vjBMzVu3K","CgnzsLq","qKHhBw0","tvPKsva","yM1xquC","sej5vxK","BMrLEa","r2vPB1O","yLrNtKi","Cw9Z","yM9L","sefNy0S","AhzYuuy","x29WDgLVBNm","EhfRqNG","x3bYzwzPEa","BNrbBMrvCgq","sM5zCw0","AM9PBG","zhDXAKu","ruTrCw4","ExPhAw0","wgDKse8","AKz0weG","wgf6yNm","v2vIu29JA2u","q3vZDg9Trxi","zg9Uzq","txPgrhO","wfPYzK8","sNHuCKe","BerSzuy","Ef9MCM9UDgK","yNLL","vefkDxy","C2vUzf9Hy2S","Efrurw52","mNW2Fdb8na","CuzrEge","C29Tzq","ENHuANu","vwLHwwe","v2TiAee","zeDIC2q","zwrPyxrLBhK","vhHNzNO","C3vIC3rYAw4","zxjFywnRx20","rMjXwuG","uvr6wLK","mNWWFdn8nNW","CwzTyvq","ChjVDg90Exa","vw5Oyw5KBgu","ywnOzwqSihC","Dg9mB3DLCKm","yLvLrvG","rffYA2q","y2vZC0HHBMq","AuXxBgC","A2PwD2G","Evf1Cgq","ugrhD0S","CwLTue8","EfPsEvG","vgrVruS","BxnN","yxGGCMv0CMK","v2vjsuu","v3vIz0C","ruXMCNK","uhjPBwfYEuS","v1HjDgu","zwLwA2e","EuvVuvC","ihn1y2nLC3m","ihjLy29UBMu","x3bPBMDmB3m","vfbtt24","yw1Lu3bHy2u","CgfNzwHPzgu","CMvZzxrdB3u","z2v0","uK1JqMe","yxDTzgi","yLndrhG","BxPnveq","Ahvsq3G","DxrVuMvJB24","y3jLyxrLrwW","vvnozui","x2LUAxrhBg8","zxrhANu","B25pCgvU","BwLZzq","D09NrKC","vgfN","CgfYC2u","rxjYB3jdB2q","x2DLDeLUDgu","y3jLyxrLt3a","CYbWyxjHBxm","y3vYCMO","DgHLBG","mhWXmhWZFdy","u3vZAgG","AgvHzgvY","zxj2AwnL","y09Wzw4","ihrPBwvVDxq","uKzKq3q","y3HLvvm","v25Swwu","r0fdzg0","yxnZAwDU","ywXS","uuzZDKK","u2vXsuq","Aw9UvgLTzw8","wujHwvK","zxjFDhrS","zMX1C2HfEha","AwrI","igzHAwWSig0","BLDPy0q","z3z3vuG","AKT6zvq","zhzbzK8","q1zbD1i","zenkrxa","x3DZsw5ZDge","s0PRqNK","ueDluM8","ANb1BMS","mdaWmdaWmda","B1vkC3i","EgXfAMe","BwfW","wg9Ttva","yxKSihrYEsa","EwXjrhu","CNzHBfzHBhu","q1HLA1q","vg1QANK","A2Pev0O","ywXPzcb1CMW","s0L1ywi","qLziyxa","AxnrB1nnzxm","ANHrrM8","yMrFzgLK","zxjYB3i","sNz4r2u","DNPkAha","DxjS","wuLvB3q","CMLLC0nVDw4","z2vwyvG","Bg9NsurozxC","zM9YrwfJAa","CMres0y","sNzIvM4","seXOCge","tu1Kv3O","tvLoy1i","uhLcy24","Egv0BNO","CurvqMi","ywnRx2LK","z3vgzMm","CMvXDwLYzwq","B25dBg9Zzq","EhjbrgK","zg1Zz3q","DKnIuMW","v01MC1e","tKfusvzfx0u","EvDRsM8","Dw5RBM93BIa","AfL2CKq","CMvHzhDYAxq","z2u6ia","mxWY","D1LqC0O","rxPiBfe","DurKBvu","BwvZC2fNztO","zxjHDg9Y","tevWtum","AxD6wfO","BMDuAw1LCG","y0DLuLe","rMvvs1q","x2n1CNnVCK0","B25ozxr3B3i","rNbOqKK","re1NzgW","uw5IzvK","z3L0wvG","B3v0sw50zxi","zMDUqw4","yNL0zu9MzNm","CM92AwrLigi","x2LUDgvYDMe","D1vdt1O","Bg9N","CfPJsxu","CLvVwxe","BhDouLq","zw50tgLZDgu","ufbKC04","id4G","zwnVBM5Ly3q","DLLICwe","z2v0q3vYCMu","qvHLrfi","DgvZDa","r3r5s3a","Bwv4wKi","EvrXtMS","rKrXseC","EvjhDeu","DfLNqLG","BKTxCM8","s0zqzwW","Bhb0rxa","zKXeAue","B3bLBKrc","BuPsC04","x3jLBw92zvC","q21JqMi","sKPMv1e","uuPZrui","y3vYDMfSDwu","zxq9DxrMltG","BNruCMLLC0m","DNjIDgi","tMr1A0G","qNjPzgDL","zhz1Dwm","tLnnAwy","nhWX","yvjQsMS","y2Xiuu0","suvtx0vsuK8","y3jLyxrLt2i","u3vACKi","yuDRqwu","zgLxAgW","yxfXvgW","Bhm6ia","yxHYv0q","BvDkCKG","qND6s0G","x2HHBMrSzu8","ignVzgu6ia","uvjWChu","Cg9PBNrdB24","qwLkzNe","y29UDgLUDwu","C2P2D2m","zxjFCw9Zx2e","tMXisNC","tvjvz2C","Aw9Ul2PZB24","C3nHz2vfDMu","CfrYtvK","y2HLy2Tszwe","yKP2v1G","qMX1CNe","Cgf5Bg9Hzeu","uerotvm","EMrjCe4","DhLWzq","q0DHywW","zffYqKe","AevYCM9Yrxy","yvnUu3e","CNL6vwS","B2LUDfjLywm","ihzHBgLKihm","AgfZ","rLLszvG","qMnez2O","y2Dmq1i","igfYCMf5yNu","B25fCNjVCG","vLLfBMe","BM50Eu8","rvrXzhu","Dw5KzwzPBMu","weHbEge","tg9Nsuq","twPTtNq","zNjVBNrPzxi","ELLYBLO","t0DMqxa","DuffuuK","t3n5B2m","BeL2wuS","vMfOyKm","zMLSzw5HBwu","DLnyCxG","DgPjDKe","ChrAr3y","B3DAAMq","t2jQzwn0","r2vfzMy","tMPlEMm","yKzozMq","vuvXwgu","tKDFrvjst1i","yuf3t0O","rLLYsK0","qwHPuhe","sLfHDLi","vNfnteS","rwP4vK8","BNrLCG","vLfJzeS","mZe1odi5nKDgsvPxBq","CgLUz09Uy2u","CMTLCKDSB2i","z05RyMK","AwjHvMm","y3vZDg9Tshq","vgT0Aum","ywnRx2nVzgu","BNrfBMrWB2K","txjTu0K","qvDqreK","rgvxu0y","CMvZzxruCMK","thnewwC","C2v0","q2vKzK0","q29UzMLN","vufWq1G","vxPACeS","x2nSzwfYvgK","ywDLrxzLBNq","wMvjzKG","C3rYAw5NAwy","wKXZwvC","Cgu6ia","sxLdteS","y0HdrKy","reiGzMfPBgu","AwXK","tM1dBvK","yNvMzMvYzwq","t1bftG","rNjVBNrPzxi","BxHJwLK","yvb5CKe","CMfTugfYyw0","zenvuhi","EuLPAgK","AxnszwfKEq","Aw5JBhvKzxm","CMvTB3zLq2G","AwzgAKi","C2vYDMvYvgK","y3vYCMvUDeK","AgvHzgvYCW","y3vYC29Yx2y","x3nLCuLK","DgnPDhu","ru5hwNe","tvnby2S","BMfQs0e","shDtsfa","qxPoC0W","yMTlqvO","CK93zg0","Dgv4Dc9WBge","twvZC2fNzuu","y3rxCuu","qxbgwMC","C0nVDw50zxi","zwniugq","CeL5AwO","CvboEM4","x2DLBMvYyxq","uxDRy3q","qKjxDvG","tgLZDgvUzxi","v3DyEwu","ANzvuw4","Dw50","yw1LoIa","CvHWs2m","y3rwr0u","twLZC2LUzYa","su5tvefova","y2uGBM90igK","B0HHAfq","r0npuwG","yuTqrxe","qwjQy2q","nNWWFdv8mxW","x3bPBMDqB24","u1LkrLC","DwnsC1m","l3DZl3yY","v2LUzg93","Aw1SseO","AxnAzxjV","ze5eBey","BwLUzW","zMzmAw5L","rg5SAK8","EK55CwG","rvjst1i","t0fxChO","y2XVC2u","u3vYC3q","uwresLO","x3bHDgHlzxK","DhjHBNnHy3q","DhDoze4","Cg9W","x2TLEvbHDgG","B3bLBG","zvvqBuS","y25ivuO","nJqYntGZovPXDM5kAG","ywDLsgLKzq","v3DrEem","rvbIBxO","DxbNCMfKzw4","C055Ag8","CMvWBgfJzui","rhHQyui","D0Dlz08","BMrWB2LUDfq","y3jLyxrLq2W","yu9Iu2m","CgLUz0LUDgu","B2XKvMvYC2K","y29UBMvJDca","qKXQAK8","BgrXtLi","y291BNq","rKLgBxu","AhHRr0O","wvjXzey","m3WYFdb8nhW","whnWAwy","CerysNa","AgfUz2u","yNzltNq","yxbWzw5Kq2G","qNLAz2u","qLzby1u","z2vtEw5J","zw5HyMXLuw8","C2vYDMLJzs0","A1bMBLi","z0rpt2G","uM9Kquu","ANrStxe","AwvmCKe","vgTcALK","yNvMzMvY","ExbL","uKTgD0O","pxv0zI04","qwDODKW","Axv2yLy","BMCGB3iGyw4","EhLhreK","te5TCxu","sxL0s0e","EhryCvm","BNLgqMG","qu1YDhG","v05MzMO","zhDmzha","tg9NsurozxC","z0f4twm","BvvUA2q","thnQtLC","qu5JDxa","CYbPBNn0yw4","quPVzKq","ywnRtxnNswq","igzPzwXKoIa","Ahr0Ca","v3f6u1u","DLjqwMe","x2LZsw5PDa","CgvYC2LZDgu","DMfSDwu","v2vPEgLUsLm","q3vZDg9Tq2W","tfjowhG","rhbbEuS","x2HHBMrSzva","CM92AwrLige","yw5Nzq","wffUyNa","AxnrB1nby2S","uxbVt0m","zgnPt3u","DgXnCMi","x2rLC3rYB3K","DhjWwue","BwvY","vLzWuu4","sg9twxu","rLfAD2C","EgnoyvG","y2XVC2veqG","mtb8nxW5","wKvTDxe","x25HDMLNyxq","zMzMzG","yuPUq0O","B25VCgvU","sNjJy2m","A2L1DxO","y1bJrue","zKzdr0G","sNnIvfO","BezSDxnO","DgXfDMu","DgHHBIbSB2m","D2fZq2XLyw4","y2XgtgG","vxbKyxrLq28","BwXAz0W","wKXRAxy","B25TzxnZywC","Cu9muuG","ywjVCNq","vxDuAgi","tfHfz0y","x21PBMLoyxy","B0zUyue","zxmGCMvHy2G","uwjuBhC","yw9xyMG","x2XPC3rLBMu","qufpDwe","C1HABeq","qvrmEg8","Bwf4uMv0CMK","mxW3FdH8nhW","mJa5nJa1nMT6u0Hxsa","EsbJBg9Zzwq","q2rdvMu","C09OBKq","rM1Ay1y","wNrswNq","ihrVihjLDhi","DLfPy1i","tMfIvM0","DKnWrfu","u1vuC2y","DfvhuwG","Aw5Lza","DgfIyxnL","DMvUDa","x2LZv29YA2u","x2LZqNjVD3m","s0fmtwK","zw5HyMXLvhi","y3vYC29YlNm","CNzxsuu","vMfxyNq","ChDmC0e","shbpywe","AMTmEhy","DhjPzxm","ChjVDg9JB2W","CNnVCKzPBgu","EKrnyLm","CKz4ufq","wgXsCLq","ywjuCwm","ywPdz0G","sMHQww0","qM10D3q","m0vRDhj5sW","B3bLBIa","y3r4","zLfrshe","CNnVCL92ywW","zgf0yq","Ew12Bw4","yxjYyxLIDwy","uw95weO","x2LZtwLUAvC","DMziD0i","EKnqrfe","u1zOsMG","q05JBwe","vvbeAxK","AKnmsxy","B2fK","A3LgA08","x2n1CNnVCK4","ExPvyK4","CgXLyxnLiha","x3nLBMrby2S","zLHnz3e","u3zhvuS","zgvMAw5Luhi","ueHoEfu","vuDRrMG","txbRzeO","r3zxq24","reLJy0W","CMfNzvn5BMm","BgLTAxq","B25nzxnZywC","AxnbCNjHEq","txjXzgy","x3fVC0rc","DeLdwLC","x2rYB3bhBg8","AgLNAa","tvbhu2S","Awfnrha","yMLeAfK","tMzyAxG","tfLVrhe","uw1gseq","wxfxu3C","AxnFywnR","ChbL","z2v0q3vYC28","vxbWq2y","CvHisKy","C1rhtgy","u2HHCMvKv28","EeLkv1K","Dgv4DfbHEwW","BNvTyMvY","C2v0u3rVCMe","EMnvuKy","AeHuCLa","ENzRsvu","wgnVueO","zejgu1y","vvr4zgm","u2PMugq","AKHTq0u","DvneCxK","Chv0","ywXSzwqGBxu","Bwf4twvZC2e","veDqCfm","C3rLBMvYCW","BMvY","DvLrywK","rM1jtgO","BKXPBMu","zv9ZDwnJzxm","wxnYC0C","aaaaaaaaaaa","AKrZqNa","A3HODhi","rgv0ree","yxbWBhK","te14zMi","BNbeB1O","Aw5N","z0r6B3K","zNjHBwvuExa","r2vLv2u","BhrPCgXLihq","D2z2vxO","sNvirKm","yMPLDw8","DxLOvve","x3bPBMC","u0XTuuK","AefJA01LC3m","ndq2mZiYnxPMswPwwa","AwDHDg9Yt24","DMLJzuLeig8","BLbyrNu","ueP4ANm","u0jzy2e","vgnxtKe","D3nZoI8V","vgXJtfC","B3bLCNr5","qxHZCei","ANjuv2K","EhLmA1m","zxjFAxnFywm","ANDqqwO","C0XPC3rLBMu","CYbHBhjLywq","EujWzem","Dhj2rfO","BLLtzhC","qu5suwC","zw5KCg9PBNq","sLP1CNK","A2v0ignVBNm","AenSB3nLrxy","ihrYEsbYzwm","ExHry08","x2n1CNnVCKy","De1lthi","zgrjrcWGzgu","sNzuyMu","q0vis1e","B25Uzwn0Aw4","rMD2sxC","z1Ptq3G","zcWGDw5RBM8","uxvwzKG","yKzez2S","B2Dbwu0","lcbTyxGGCMu","Bfz5Dfy","z3nhAgO","EgfLrhC","z2DryM4","D3jPDgvvAw4","C2fNzq","EeLkBM0","vvfgDgq","yKnIyva","x194x21Zz18","B25SAw5L","vw5PBxbSzw0","tg9JAW","uMvHzcbWyxm","Aw5PDcbrB1m","x29UugfNzu4","EKXUuKO","Eenrwuu","sLrtA3u","rfrYtLq","y3ruAw1LB3u","CM5rvu8","zNDZxZeUmc4","vvjgr1O","x2nVBM5Ly3q","Dw5ZAwDUzwq","zMLUza","quPIAwm","AxjvEwS","zejYCLu","zKLXveC","y29TCgXLDgu","s0LyB1a","zM15q3C","DgvmB2Djre4","y3rtsve","sxjwEeC","q2nlCfe","ywX3yxLZ","tKXqzwy","sLnptLa","Ec1TC2CTCw8","qNzmELG","EKv6vMK","BgLZDgvUtMu","C2v0sxrLBq","D24GCMvHC28","vNfssvy","rwjWzgC","r29iDM4","Bfjry00","A0vnDgm","BM93","CgzXDee","DhbizwfKzxi","ywDLu2HVDW","zvvdz0K","teXVsLy","yNL0zuXLBMC","zgvSzxrL","z1rPBwvVDxq","yNL0zxm","o2nOyxjZzxq","zNjVBuj5Dgu","vNvUr3u","q29LD1u","CMvHzfvjBNq","ENvXBvi","z2P5s3G","vxz1tu4","Bhros1u","De5bDhu","D3DzEvi","t2LisLy","swHJzue","DffVtvC","CvvQyLC","Dev2zw50","y3rqu2W","zeHiwu4","wfrjug0","EMjYtKG","DeLUDgvYy2u","CgLUz19VBMm","rNjhDha","Dg9oDw1Izxi","x21LC3nHz2u","zMHHqMi","tg1vs20","ufbpwhG","CMvZB2X2zq","rNHjDuW","y2HLy2TdDxi"];return gn=function(){return r},gn()}function ax(){return Qs||(Qs=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function xx(){let r=S;return $s||($s=[IDBCursor[r(934)+"e"][r(461)],IDBCursor[r(934)+"e"][r(1141)],IDBCursor.prototype[r(1141)+r(953)+"ey"]])}function cx(r){let e=S,o={IytKA:function(x,f){return x(f)},KGTqh:"success",goaxa:function(x){return x()},GVdCS:e(1033),UFdbf:function(x,f){return x instanceof f}},a=new Promise((x,f)=>{let d=e,g={EjsPj:o[d(729)],klDCG:function(y){return o[d(838)](y)}},p=()=>{let y=d;r[y(1710)+y(1091)+"ner"](g.EjsPj,_),r["removeEv"+y(1091)+y(1537)]("error",w)},_=()=>{let y=d;x(o[y(1355)](Ce,r[y(603)])),p()},w=()=>{let y=d;f(r.error),g[y(654)](p)};r[d(672)+d(1268)](o.KGTqh,_),r[d(672)+d(1268)](o[d(506)],w)});return a[e(985)](x=>{let f=e;o.UFdbf(x,IDBCursor)&&dr[f(1216)](x,r)})[e(769)](()=>{}),mn[e(1216)](a,r),a}function fx(r){let e=S,o={ulbSO:e(1033),cxeUS:e(1417),nQgPv:function(x){return x()},mTdKx:function(x,f){return x===f},aSnSq:e(1695),cMIsh:function(x,f){return x(f)},Crjfl:"AbortError"};if(pn[e(1163)](r))return;let a=new Promise((x,f)=>{let d=e,g=()=>{let w=k;r["removeEv"+w(1091)+w(1537)]("complete",p),r[w(1710)+w(1091)+w(1537)](o.ulbSO,_),r[w(1710)+w(1091)+w(1537)](o[w(993)],_)},p=()=>{o.nQgPv(x),o.nQgPv(g)},_=()=>{let w=k;if(o[w(1792)](o[w(1159)],o[w(1159)]))o.cMIsh(f,r.error||new DOMException("AbortError",o[w(658)])),o.nQgPv(g);else return _0x710fdc[w(645)]||_0x20f8bf[w(879)]?("message: "+(_0x5b48b3[w(645)]||"")+w(1137)+(_0x55f18b[w(879)]||""))[w(766)]():_0x15aa5c[w(1224)+"y"](_0x1165ff)};r["addEvent"+d(1268)](d(1633),p),r["addEvent"+d(1268)](o[d(496)],_),r["addEvent"+d(1268)](d(1417),_)});pn[e(1216)](r,a)}function ux(r){_n={oHahT:function(a,x){return a(x)}}[S(1278)](r,_n)}function dx(r){let e=S,o={abTqc:function(a,x){return a(x)},ksYNB:function(a,x){return a instanceof x},vXNsG:function(a,x){return a instanceof x},KSiuO:"none_none",oEGIa:e(855),JannF:function(a,x){return a===x},BaSRf:e(650),GJBOS:"RmAGS",yQitJ:function(a,x){return a(x)},JQIkh:function(a,x){return a!=x},KWUVK:e(1908),dNDlF:function(a,x){return a instanceof x},EKQqn:function(a,x){return a!=x},yzGim:e(755)+e(1146),nnLBH:e(972),VafFx:function(a,x){return a===x},lFPDZ:"objectSt"+e(1872),FdNCX:function(a,x){return a===x},uDYrM:e(1862),vroED:function(a){return a()}};if(o.VafFx(r,IDBDatabase.prototype[e(1301)+"ion"])&&!(o.lFPDZ in IDBTransaction[e(934)+"e"])){if(o[e(787)](o[e(733)],o[e(733)]))return function(a,...x){let f=e,d=r[f(683)](o[f(1462)](Dt,this),a,...x);return ur.set(d,a.sort?a[f(380)]():[a]),o[f(1462)](Ce,d)};_0x1d2f06&&this[e(1075)+"anager"]["updateCu"+e(1458)+e(389)](_0x28f7c2)}return o.vroED(xx)[e(1241)](r)?function(...a){let x=e,f={AAOua:function(d,g){return o.ksYNB(d,g)},pcYJT:function(d,g){return o[k(1807)](d,g)},GXXac:"applicat"+x(1146)+x(1664)+x(1349),YCKRo:"string",xunpc:o[x(442)],TPBQW:o[x(488)],mzMTD:function(d,g,p,_){return d(g,p,_)}};if(o.JannF(o[x(817)],o.GJBOS))if(f[x(1426)](_0x3b7893[x(470)],_0x37c8af)){let d=f[x(883)](this._options[x(1152)+x(1746)],_0x354865)?{force:!!this[x(895)][x(1152)+x(1746)][x(419)],encoding:this[x(895)][x(1152)+x(1746)][x(835)]?this[x(895)][x(1152)+x(1746)].encoding[x(743)](/\s/g,"")[x(937)+x(475)]():""}:{force:!1,encoding:this[x(895)][x(1152)+x(1746)]?this._options[x(1152)+x(1746)][x(743)](/\s/g,"")["toLowerC"+x(475)]():""},g=_0xdd60c6[x(1152)+x(1746)]?_0x2e38d4[x(1152)+x(1746)].replace(/\s/g,"")[x(937)+x(475)]():"",p=f[x(883)](this[x(895)][x(696)+"ype"],_0x30976c)?{force:!!this[x(895)].payloadType[x(419)],type:this[x(895)][x(696)+x(1347)].type?this._options[x(696)+x(1347)].type[x(743)](/\s/g,"")["toLowerC"+x(475)]():""}:{force:!1,type:this[x(895)][x(696)+x(1347)]?this._options[x(696)+"ype"][x(743)](/\s/g,"")[x(937)+x(475)]():""},_=_0x4764fc[x(696)+x(1347)]?_0x5ea937.payloadType[x(743)](/\s/g,"")[x(937)+"ase"]():"",w=p[x(419)]?p[x(1155)]:_||p[x(1155)],y=d[x(419)]?d[x(835)]:g||d[x(835)],A=["text/pla"+x(464)+"et=utf-8","applicat"+x(1146),f.GXXac,f[x(432)]],T=[f[x(867)],f.TPBQW];this[x(895)][x(1449)+"ansformT"+x(675)+"ad"]&&A[x(1241)](w)&&(!y||T.includes(y))?_0x47e428[x(1520)+x(1482)]=f[x(968)](_0x26346d,_0x67c15e[x(470)],0,_0x58e6c9[x(470)][x(1660)+"th"]):_0x107279.textPayload=""}else _0x5ed50a[x(1520)+"oad"]="";else return r[x(1547)](o[x(1462)](Dt,this),a),o[x(529)](Ce,dr[x(964)](this))}:function(...a){let x=e;return o[x(323)](x(972),o[x(1892)])?o.abTqc(Ce,r[x(1547)](Dt(this),a)):o[x(545)](o.KWUVK,typeof _0x26fad3)&&(_0x240a28 instanceof _0x2f717d||_0x505904[x(1346)]&&o[x(1290)](_0x164347[x(1346)],_0x4bb469))||o[x(902)]("string",typeof _0x20605b)?"":(_0x4bad37[x(979)](_0x5c457a),o[x(903)])}}function lx(r){let e=S,o={ZwlSo:function(a,x){return a===x},cJjpJ:function(a,x){return a instanceof x},huRCx:function(a,x,f){return a(x,f)}};return o[e(569)](typeof r,e(1883))?dx(r):(o[e(1749)](r,IDBTransaction)&&fx(r),o[e(969)](ri,r,ax())?new Proxy(r,_n):r)}function Ce(r){let e=S,o={JoRmg:function(x,f){return x(f)},ctVGE:function(x,f){return x!==f}};if(r instanceof IDBRequest)return o.JoRmg(cx,r);if(ln[e(1163)](r))return ln[e(964)](r);let a=lx(r);return o[e(1274)](a,r)&&(ln[e(1216)](r,a),mn[e(1216)](a,r)),a}var ri,Qs,$s,dr,pn,ur,ln,mn,_n,Dt,Zs=ni({"node_modules/idb/build/wrap-idb-value.js"(){let r=S,e={kxcwC:"wss://",KQcMZ:function(o,a){return o instanceof a},RTvZY:r(909),rdDKF:function(o,a){return o===a},xaeDw:r(371)+"oreNames",ZtRZt:r(651),REvoc:function(o,a){return o(a)},wfvUz:function(o,a){return o instanceof a},lYNfJ:r(1902),mjNgO:function(o,a){return o in a}};ri=(o,a)=>a[r(921)](x=>o instanceof x),dr=new WeakMap,pn=new WeakMap,ur=new WeakMap,ln=new WeakMap,mn=new WeakMap,_n={get(o,a,x){let f=r,d={pTuUp:function(g,p){return g==p},bGCWH:f(874),zYrnZ:e[f(542)],eLRbK:f(483)};if(e.KQcMZ(o,IDBTransaction)){if(a===e[f(1702)])return pn[f(964)](o);if(e[f(1042)](a,e[f(1604)]))return o[f(371)+f(1872)]||ur[f(964)](o);if(e[f(1042)](a,"store")){if(e[f(1042)](e[f(1436)],e[f(1436)]))return x[f(371)+f(1872)][1]?void 0:x[f(371)+f(842)](x[f(371)+f(1872)][0]);_0x436d2c=_0x5b5910&&d[f(1760)](d.bGCWH,_0x11de00[f(1457)])?d[f(1177)]:d[f(1877)],_0x38b551=_0x87bcd2[f(743)](/((^ws)|(^http))((?:[s]*:\/\/))/,""),_0x18e057=/^wss(.*:\/\/)/[f(1098)](_0x53c4f9)?_0xef1b29:""+_0x1ebf03+_0x9fa158}}return e[f(1703)](Ce,o[a])},set(o,a,x){return o[a]=x,!0},has(o,a){let x=r;return e[x(1555)](o,IDBTransaction)&&(a===e[x(1702)]||a===e.lYNfJ)?!0:e[x(468)](a,o)}},Dt=o=>mn[r(964)](o)}}),si={};ox(si,{deleteDB:()=>gx,openDB:()=>hx,unwrap:()=>Dt,wrap:()=>Ce});function hx(r,e,{blocked:o,upgrade:a,blocking:x,terminated:f}={}){let d=S,g={hwKsv:function(w,y){return w(y)},ecHPd:"close",KALMi:"versionc"+d(1332),OEjhh:d(1312)+d(553),ZIzYj:d(536)},p=indexedDB[d(1305)](r,e),_=Ce(p);return a&&p[d(672)+d(1268)](g.OEjhh,w=>{let y=d;a(g.hwKsv(Ce,p[y(603)]),w[y(1321)+"on"],w[y(1755)+"on"],g[y(1754)](Ce,p["transact"+y(459)]))}),o&&p[d(672)+d(1268)](g.ZIzYj,()=>o()),_[d(985)](w=>{let y=d;f&&w[y(672)+y(1268)](g[y(1262)],()=>f()),x&&w[y(672)+y(1268)](g[y(1448)],()=>x())})[d(769)](()=>{}),_}function gx(r,{blocked:e}={}){let o=S,a=indexedDB[o(765)+o(1444)](r);return e&&a[o(672)+o(1268)](o(536),()=>e()),Ce(a)[o(985)](()=>{})}function ei(r,e){let o=S,a={MucLU:o(405),LsjNW:o(1062)+"e",CcKpQ:"readonly",iJeol:o(1908),eiVka:function(p,_){return p!==_},LRvPH:function(p,_){return p in _}};if(!(r instanceof IDBDatabase&&!(e in r)&&typeof e===a[o(364)]))return;if(hn[o(964)](e))return hn[o(964)](e);let x=e[o(743)](/FromIndex$/,""),f=a[o(955)](e,x),d=oi[o(1241)](x);if(!a[o(784)](x,(f?IDBIndex:IDBObjectStore)[o(934)+"e"])||!(d||ii[o(1241)](x)))return;let g=async function(p,..._){let w=o;if(a[w(1721)]===a[w(1721)]){let y=this[w(1301)+w(459)](p,d?a[w(1364)]:a[w(1639)]),A=y[w(1902)];return f&&(A=A.index(_.shift())),(await Promise[w(997)]([A[x](..._),d&&y.done]))[0]}else{let y=_0x3250c2[w(928)+"g"](0,4-_0x616653[_0x15f7e7][w(398)]),A=y[w(1824)](_0x4164ca[_0x329d4c]);_0xc12014[w(358)](A)}};return hn[o(1216)](e,g),g}var ii,oi,hn,px=ni({"node_modules/idb/build/index.js"(){let r=S,e={ANcup:function(o){return o()},CnhOd:function(o){return o()},bIuiD:r(964),VyQli:r(1893),clHQM:r(1779),Sushh:r(1325)};e[r(1365)](Zs),e[r(692)](Zs),ii=[e[r(818)],e.VyQli,e[r(1125)],"getAllKeys",e[r(987)]],oi=[r(1532),"add",r(1661),r(679)],hn=new Map,ux(o=>({...o,get:(a,x,f)=>ei(a,x)||o[r(964)](a,x,f),has:(a,x)=>!!ei(a,x)||o[r(1163)](a,x)}))}}),mx={idb:function(r){let e=S,o={TlcLW:function(a,x){return a&x},llRtB:function(a,x){return a+x},ylIDu:function(a,x){return a===x},MRTQS:e(1598)};r.exports=Promise[e(1692)]().then(()=>(px(),si))[e(985)](function(a){let x=e;return o[x(1022)](o[x(1748)],"QuVfH")?a:(_0x154676[x(1606)+"t8"]?_0x417f29[x(1606)+"t8"](_0xea231a,_0x298da6):_0x24e3ea[_0x1f4f95]=o[x(1570)](255,_0x1aebe6),o[x(324)](_0x217176,1))})}},ti={};function Se(r){let e=S,o={nCDqy:function(f,d){return f!==d}};var a=ti[r];if(o[e(1909)](void 0,a))return a.exports;var x=ti[r]={exports:{}};return mx[r](x,x[e(725)],Se),x[e(725)]}Se.d=(r,e)=>{let o=k;for(var a in e)Se.o(e,a)&&!Se.o(r,a)&&Object[o(1490)+o(1571)](r,a,{enumerable:!0,get:e[a]})},(()=>{let r=S;Se.o=(e,o)=>Object[r(934)+"e"][r(1791)+r(1571)].call(e,o)})(),(()=>{let r=S,e={hYvrD:r(933),nDmGe:function(o,a){return o!=a},vrbtb:r(1172)+"d",zDMbS:r(355),gZSCx:r(601)+"le"};Se.r=o=>{let a=r;a(1079)===e[a(1061)]?Y._cursorFileName=_0x41937c:(e.nDmGe(e[a(1118)],typeof Symbol)&&Symbol[a(871)+a(978)]&&Object[a(1490)+"operty"](o,Symbol[a(871)+a(978)],{value:e[a(1459)]}),Object[a(1490)+a(1571)](o,e[a(1596)],{value:!0}))}})();function k(r,e){r=r-323;let o=gn(),a=o[r];if(k.ojjJXg===void 0){var x=function(p){let _="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=",w="",y="";for(let A=0,T,N,R=0;N=p.charAt(R++);~N&&(T=A%4?T*64+N:N,A++%4)?w+=String.fromCharCode(255&T>>(-2*A&6)):0)N=_.indexOf(N);for(let A=0,T=w.length;A<T;A++)y+="%"+("00"+w.charCodeAt(A).toString(16)).slice(-2);return decodeURIComponent(y)};k.kFLLOb=x,k.aIsoIS={},k.ojjJXg=!0}let f=o[0],d=r+f,g=k.aIsoIS[d];return g?a=g:(a=k.kFLLOb(a),k.aIsoIS[d]=a),a}var V={};(()=>{let r=S,e={vCbRl:function(s,t){return s(t)},IZahF:function(s,t){return s+t},RKFwJ:function(s,t){return s+t},tDhBn:function(s,t){return s+t},fDwfz:function(s,t){return s+t},NFMNT:function(s,t){return s*t},PPOXx:function(s,t){return s*t},XsHEe:function(s,t){return s+t},GtyKp:function(s,t,n){return s(t,n)},PhZuj:function(s,t){return s===t},uLmMQ:r(808),TAJuv:function(s,t){return s(t)},MYNcR:function(s,t){return s(t)},UiaYa:function(s,t){return s+t},HYeIB:function(s,t){return s(t)},NMavs:"0000",lRQcM:r(1399),XQcmL:function(s,t){return s!==t},HnmHb:r(1035),HoMJb:function(s,t){return s(t)},KCVwL:function(s,t,n){return s(t,n)},etGju:r(1685)+"e_success",FgvIw:r(1685)+r(673)+"t",gZxsk:"NATIVE_E"+r(441),QFsvI:r(1796)+r(1193),okkhw:r(1839)+"IES_ERROR",GeeWe:"OPEN_ERROR",IhceA:r(534)+r(1295),MRUgg:"timeout",lpCfY:function(s,t){return s>t},KyIqX:function(s,t){return s<t},PshyC:function(s,t){return s!==t},zNyqh:r(1560),Surst:function(s,t){return s<t},uhNHo:function(s,t){return s-t},pEcXP:function(s,t){return s!==t},kYOqf:r(610),XmkEi:r(1896),rmvAH:function(s,t){return s-t},hxkGJ:function(s,t){return s-t},cFXFq:function(s,t){return s<t},LYoDq:function(s,t){return s===t},MtaFG:r(414),yxQcO:function(s,t){return s<t},iaMDp:function(s,t){return s!==t},XlRrT:function(s,t,n){return s(t,n)},clFLh:function(s,t){return s!==t},CoewU:function(s,t){return s>>>t},JTSku:function(s,t,n){return s(t,n)},MPZZy:function(s,t){return s(t)},PdGwK:function(s,t,n){return s(t,n)},fcNmO:function(s,t){return s(t)},YRqdF:function(s,t,n){return s(t,n)},egFEC:function(s,t){return s&t},NIzyC:function(s,t){return s===t},mFUDh:"Missing "+r(1052)+r(1369)+r(1375),pcuWV:function(s){return s()},bUTnn:function(s,t,n){return s(t,n)},FbqYH:r(1297),cUJqW:r(915),OjDGz:function(s,t){return s<<t},FYrJM:function(s,t){return s&t},KJkBy:function(s,t){return s<<t},JQavR:function(s,t,n){return s(t,n)},etqQR:r(547),QJsEB:r(1219),Ebpdg:function(s,t,n){return s(t,n)},WkHhA:function(s,t,n){return s(t,n)},hBhfg:function(s,t){return s!==t},xKADW:r(1184),FCwNp:function(s,t,n){return s(t,n)},jEFFg:function(s,t,n){return s(t,n)},JLTMl:function(s,t,n){return s(t,n)},VqMLK:function(s,t,n){return s(t,n)},FmILj:"fsHga",LxWib:function(s,t,n){return s(t,n)},LmUKm:function(s,t){return s!==t},eBZGJ:function(s,t,n){return s(t,n)},sWUxP:function(s,t){return s!==t},kfkFq:function(s,t){return s(t)},QIaVU:function(s,t){return s(t)},JdEvb:function(s,t){return s(t)},LvYEV:function(s,t){return s(t)},xcNaX:function(s,t){return s(t)},uTCNF:function(s,t){return s(t)},RbAPU:function(s,t,n){return s(t,n)},qoupM:function(s,t){return s(t)},eXKut:function(s,t,n){return s(t,n)},WNffj:"Missing "+r(1052)+r(1369)+r(999),iLWlg:function(s,t){return s===t},BcDgj:"Missing "+r(1052)+r(1369)+"LogID",yBpdC:"Missing required field: service",GvWCn:function(s,t){return s===t},PGKRo:r(1275)+"required"+r(1369)+r(720),OAWpz:function(s,t){return s>=t},FWRjc:"usCeq",nzZox:function(s,t){return s(t)},wMJQc:function(s,t){return s&t},nvPqX:function(s,t,n){return s(t,n)},bCXeu:function(s,t){return s(t)},IAVzX:function(s,t){return s+t},gshCn:r(1613)+r(716)+r(1226),SVhJh:function(s,t){return s>=t},jDsBp:r(718),ujZZf:"Skip pas"+r(456),sDUwJ:function(s,t){return s>=t},SUKtn:r(910),RAtjl:r(1825),bFNfd:function(s,t){return s+t},gDOrB:function(s,t){return s*t},aKPEq:function(s,t){return s>t},OlFtm:function(s,t){return s>t},PbLar:function(s,t){return s+t},bmWAG:r(1615)+r(456),DkSBh:function(s,t){return s+t},FYReX:function(s,t,n,i){return s(t,n,i)},xqkBx:function(s,t){return s<t},mJhgj:function(s,t){return s&t},Bwqpy:function(s,t){return s(t)},RmXEf:function(s,t){return s+t},mwsNR:function(s,t){return s!==t},ZPsJe:r(1315),ZeIfH:r(1548),XKdiR:function(s,t){return s+t},hHTrP:function(s,t){return s!==t},SuZrB:function(s,t){return s&t},OGzsa:function(s,t){return s|t},AzNsL:function(s,t){return s!==t},NmCmY:function(s,t){return s==t},NfXix:function(s,t){return s+t},HkrcZ:function(s,t){return s+t},lyMQA:function(s,t){return s+t},aqqTl:function(s,t){return s&t},Txgfz:function(s,t){return s|t},pIyij:function(s,t){return s!==t},SDWso:r(1170),mxcZY:function(s,t){return s|t},buSyb:function(s,t){return s<<t},TYFFC:function(s,t){return s<=t},ASBMm:function(s,t){return s(t)},LEpMC:function(s,t){return s+t},LRNXx:"lUtcg",hLiNC:function(s,t){return s+t},uAEQI:function(s,t){return s!==t},wFWCm:function(s,t){return s|t},tNAtu:function(s,t){return s|t},OZyzo:function(s,t){return s===t},eLwyW:r(693),Srnoz:function(s,t){return s|t},UNJIT:function(s,t){return s<<t},KIuab:function(s,t){return s&t},XcoPJ:function(s,t){return s&t},kEMtc:function(s,t){return s>t},jwMLO:function(s,t,n){return s(t,n)},ZBRIg:function(s,t){return s>>t},Dcibz:function(s,t){return s+t},RRduQ:function(s,t){return s&t},JSEPq:function(s,t){return s<t},iQkRy:function(s,t){return s+t},URFGZ:function(s,t){return s+t},jvUQn:function(s,t){return s<<t},tuijP:function(s,t){return s<t},ePPFP:function(s,t){return s<t},uDdmU:function(s,t){return s>=t},mTnfT:function(s,t){return s<=t},YplBc:function(s,t){return s+t},wUCOZ:function(s,t){return s<<t},pwLsA:function(s,t){return s<t},WQbXM:function(s,t){return s<t},JycZi:function(s,t){return s>>t},TktiC:function(s,t){return s&t},kQLfG:function(s,t){return s>>t},uYQai:function(s,t){return s|t},TkBjY:function(s,t){return s>>t},FAEdw:function(s,t){return s&t},pvpzn:function(s,t){return s>>t},zbugm:function(s,t){return s|t},znKWJ:function(s,t){return s&t},CGaal:function(s,t,n){return s(t,n)},UGkFh:function(s,t,n){return s(t,n)},XomMP:function(s,t){return s<<t},PoUJS:function(s,t){return s&t},fFCGH:r(1725),RaqOz:function(s,t){return s>=t},YrfLy:function(s,t,n){return s(t,n)},currj:r(1033),ywDbN:function(s,t){return s(t)},YqWSw:function(s,t){return s&t},aCFHe:r(1704),lnOto:r(1421),ffNFY:function(s,t){return s&t},ejMxc:function(s,t){return s&t},xjkRc:function(s,t){return s(t)},QTzZY:function(s,t){return s(t)},wvtKI:function(s,t){return s<<t},XpZPF:function(s,t){return s&t},Msnhr:function(s,t){return s&t},WqzSU:function(s,t){return s&t},HByUy:function(s,t){return s(t)},Izdwd:function(s,t){return s<<t},dQrBA:function(s,t){return s&t},tVeHc:function(s,t){return s|t},RSrXP:function(s,t){return s|t},Anrwn:function(s,t){return s>>>t},bzqPe:function(s,t){return s<<t},BldmL:function(s,t){return s>>>t},apNmq:function(s,t){return s>>>t},TMsAJ:function(s,t){return s>>>t},lDKbc:function(s,t){return s<t},JsbTZ:function(s,t){return s<t},tUGQh:function(s,t){return s<t},FvUgo:function(s,t){return s<t},GOOwA:function(s,t){return s+t},GavAx:function(s,t){return s&t},PDNMS:function(s,t){return s!==t},ViGJH:function(s,t){return s&t},SjfPd:function(s,t){return s!==t},BLjjO:function(s,t){return s|t},uDkDn:function(s,t){return s|t},FLhVq:function(s,t){return s>>>t},gDzoy:function(s,t){return s>>>t},HuMsN:function(s,t){return s|t},qNTpU:function(s,t){return s>>>t},Yrqfc:function(s,t){return s>>>t},WXIte:function(s,t){return s>>>t},EToJI:function(s,t){return s!==t},wYPsJ:function(s,t){return s|t},fjVwr:function(s,t){return s(t)},trpYA:function(s,t){return s===t},RAiVd:"ZLkiv",BwzKH:r(355),QXXXm:r(601)+"le",CmcBb:function(s,t){return s===t},XHAxa:r(649),AcYZt:r(1082),pZcIu:function(s,t){return s|t},QRzVn:function(s,t){return s<<t},xCQYE:function(s,t){return s|t},QoyXJ:function(s,t){return s<<t},ZwTVG:function(s,t){return s|t},QLRZB:function(s,t){return s<<t},zAVKO:function(s,t){return s<<t},zerNS:function(s,t){return s<<t},lDleF:function(s,t){return s<<t},FmZcV:function(s,t){return s|t},UPDiy:function(s,t){return s|t},JvdhO:function(s,t){return s|t},ZWIqv:function(s,t){return s<<t},kfevH:function(s,t){return s&t},ajCgH:function(s,t){return s&t},BYfAb:function(s,t){return s>>>t},lptEp:function(s,t){return s(t)},MjzFI:function(s,t){return s>=t},AghvL:function(s,t){return s>=t},bkKAZ:function(s,t){return s%t},Qupyz:function(s,t){return s|t},QwjKG:function(s,t){return s/t},xcblt:function(s,t){return s*t},NNjgg:function(s,t){return s&t},KJiVJ:function(s,t){return s&t},GxMzr:function(s,t){return s>>>t},FlSwf:function(s,t){return s&t},lIvYK:function(s,t){return s>>>t},TUKbr:function(s,t){return s>>>t},YVeTH:r(1302),AnTBe:r(742),FxIuL:function(s,t){return s>>>t},fDMMV:function(s,t){return s&t},LLoJV:function(s,t){return s&t},IJiqo:function(s,t){return s>>>t},NZcHG:function(s,t){return s|t},Abjcd:function(s,t){return s===t},gvwUH:function(s,t){return s===t},coDEA:function(s,t){return s+t},FEvbh:function(s,t){return s>>>t},XZrfO:function(s,t){return s&t},WaESE:function(s,t){return s>>>t},nYSdw:function(s,t){return s&t},jHmCE:function(s,t){return s&t},swVHq:function(s,t){return s>>t},DetDA:function(s,t){return s&t},gOlBF:function(s,t){return s!==t},sjvwc:"mzHwq",JxTrA:r(1528),iyEFr:r(1329)+"1",FQZwg:function(s,t,n){return s(t,n)},bTgNB:r(1166),rUoYq:r(802),MjmNt:r(1827),NjKzc:r(1718),aIHoE:r(1358),pbzyM:r(1418),DMgdl:r(625),GDqPD:r(1199),YlrOf:function(s,t,n){return s(t,n)},DIccL:r(1452),KbJsS:function(s,t){return s|t},YIUot:function(s,t){return s<<t},dYbuH:function(s,t){return s+t},UcAUp:function(s,t){return s<<t},tNLBH:function(s,t){return s+t},moZkZ:function(s,t){return s<<t},dwqjE:function(s,t){return s+t},nyFBh:function(s,t){return s+t},vQicR:function(s,t){return s<<t},aGkAe:function(s,t){return s+t},sXZlD:r(487),ONUfD:r(1228),aRjJk:r(1215),bsCUA:r(775),WubgG:function(s,t){return s===t},JemeW:function(s,t){return s!==t},qpSon:r(369),KYOfA:function(s,t){return s instanceof t},DnljO:r(935)+r(566),nreul:function(s,t){return s|t},excJi:function(s,t){return s===t},QLQpB:function(s,t){return s&t},ifFjB:function(s,t){return s&t},QTIGA:function(s,t){return s|t},AvHfv:function(s,t){return s&t},Blurq:"ejbOc",DQrkd:function(s,t){return s===t},gPzNM:r(1354),xJUFp:function(s,t){return s===t},lTezq:r(469),jtlMq:function(s,t){return s!==t},FDOQY:r(925),FDqHG:function(s,t,n){return s(t,n)},JvbVn:function(s,t,n){return s(t,n)},ApFZg:r(1397),dDLsa:r(1797),xlEja:r(1305),ZDJdb:function(s,t,n){return s(t,n)},cGeRQ:r(942),QiMSP:r(1632),XTIPm:r(1356),wwYyR:r(1372),dciOu:function(s,t){return s||t},ctSIQ:function(s,t){return s!=t},NwrNR:r(932)+r(1430)+r(1396),heGrj:function(s,t,n,i){return s(t,n,i)},CdCVe:r(512),BvLzX:r(1450)+r(989),URRTb:r(988),QKWvq:function(s,t,n,i){return s(t,n,i)},yRGtE:function(s,t,n,i){return s(t,n,i)},crnip:r(1339)+r(514),qnrWS:r(1115),LBNId:"name",anVEF:function(s,t){return s===t},yEzCf:r(1160),KFPel:r(1733)+"3",nKWro:function(s,t){return s!=t},mgBuY:r(1172)+"d",kTPdd:function(s,t){return s<=t},KIXoP:r(1707)+r(1533)+r(1554)+r(1812)+r(415),RmWwU:function(s,t){return s+t},cgyYz:function(s,t){return s(t)},mWJrH:function(s,t){return s(t)},vYbqa:function(s,t,n){return s(t,n)},xyGDI:function(s,t){return s<t},aAwOJ:function(s,t){return s<t},gDOOh:function(s,t){return s&t},SvGUK:r(767),kyFkO:function(s,t){return s<t},jzGVQ:function(s,t){return s<t},CsUTP:function(s,t){return s<=t},fqfLd:function(s,t){return s<<t},aJnCJ:function(s,t){return s&t},dEhlo:function(s,t){return s&t},XgeXX:function(s,t){return s-t},yIihi:function(s,t){return s&t},QHkuU:function(s,t){return s&t},AxRZk:function(s,t){return s+t},srhlb:r(839),zbrNH:function(s,t){return s<t},imlHJ:function(s,t){return s===t},ogAYM:"qTLba",QYfdd:function(s,t){return s>>t},jpunk:function(s,t){return s|t},qXpKc:function(s,t){return s&t},MrmSI:function(s,t){return s&t},xIJWY:function(s,t){return s+t},keUSz:r(1859)+"1|3",jCLIv:function(s,t){return s&t},GeioZ:function(s,t){return s>>t},Jrccc:function(s,t){return s|t},tAzFa:function(s,t){return s>>t},TkEyb:function(s,t){return s&t},syDOd:function(s,t){return s|t},ucRsS:function(s,t){return s>>t},YmKNK:function(s,t){return s&t},GeEff:function(s,t){return s|t},dBFSV:function(s,t){return s==t},pswwS:function(s,t){return s(t)},CYswF:function(s,t){return s||t},YPGpQ:r(392),ieLrA:r(1264),PIMHn:r(1908),rjNVM:function(s,t){return s instanceof t},lZPHC:function(s,t){return s!=t},KNNVe:r(755)+r(1146),tjIvA:function(s,t){return s>=t},YVSor:function(s,t){return s<t},aObSc:function(s,t){return s&t},Vnpnm:function(s,t){return s<t},kXKlU:function(s,t){return s<<t},KKwzw:function(s,t){return s&t},xyLkS:function(s,t){return s|t},zgUTx:function(s,t){return s<<t},DFWYJ:function(s,t){return s&t},fqpzv:function(s,t){return s<<t},HfZwh:function(s,t){return s+t},qOLQH:function(s,t){return s+t},PaJNM:r(1148),MQjHA:r(538),XqaVX:r(892),LfaNa:r(348),DLWDO:function(s,t){return s>=t},CJUAa:function(s,t){return s|t},TRdmi:"unknown "+r(793),cnHUJ:r(686),VFCis:r(391),ymWHX:function(s,t){return s+t},GvyoB:"&jscallb"+r(1891)+"tierJSONP",BfyCw:function(s,t){return s===t},JSqPz:r(1731),EPbmz:function(s,t){return s===t},mJRsN:r(618),WwXye:r(1004),MzFVk:function(s,t,n){return s(t,n)},iufrM:function(s,t){return s===t},kLLho:"ftgeo",TsZYH:function(s,t){return s||t},PNWld:function(s,t){return s!==t},CEHKQ:r(977),TblaM:function(s,t){return s!==t},XQYGZ:function(s,t){return s||t},mVCFu:function(s,t){return s(t)},pFnfH:function(s,t){return s+t},NlHJw:function(s,t){return s!==t},kCfaz:r(1697),gtZAZ:r(1858),sqCzk:function(s,t){return s||t},HwSHP:function(s,t){return s!==t},oIdKq:"tavEy",AkOHa:r(334),dmXkU:function(s,t){return s||t},OyAyS:r(1616)+"DB failed",jKzeT:r(891),sPDKT:"message_id",NdukH:function(s,t){return s&t},ZTJXc:r(347),AJbic:function(s,t){return s(t)},cJNVZ:function(s,t,n){return s(t,n)},fXMgq:function(s,t){return s===t},MiLkB:"vdAfR",uyhUQ:r(914)+"er_qos",dAvcN:function(s,t,n,i){return s(t,n,i)},fmyCw:r(914)+r(1143)+"ck",FIFmu:function(s,t,n,i){return s(t,n,i)},QdDJZ:function(s,t,n){return s(t,n)},nQEzX:"x_fronti"+r(929)+"sgid",eUPmK:"need_ack",JhLio:r(1512),dwodX:function(s,t){return s&&t},rnQUO:r(1050),IhhIX:r(609),xrADi:function(s){return s()},BBWuX:r(507)+r(351)+"e",UppCf:function(s,t,n,i){return s(t,n,i)},vCpDU:r(1335),ibaVc:function(s,t){return s(t)},BHGmm:function(s,t){return s===t},Tmjjy:r(621),QRppu:"BOXFh",QmFHD:function(s,t){return s instanceof t},sWCGH:r(1257)+r(464)+r(1116),QckQq:r(755)+r(1146)+";charset"+r(1349),dSJex:"none_none",OiHJV:r(855),mbeov:function(s){return s()},qsMLR:function(s,t){return s>t},cDNPU:function(s,t){return s(t)},nSwRT:function(s,t){return s&t},owOqi:function(s,t){return s>>>t},geVaX:function(s,t){return s===t},ahKzC:r(1774),OmceX:"ngBlS",SmytA:function(s,t){return s+t},lwNRT:function(s,t){return s+t},mUnkd:function(s,t){return s+t},GtxII:r(846)+"t of ran"+r(1063),gNkbi:" + ",EXPmy:r(1093),fgMCq:function(s,t){return s!==t},UQFtd:r(1186),qoplO:function(s,t){return s>t},AWPDI:function(s,t){return s>=t},aiqxh:function(s,t){return s&t},awmdb:function(s,t){return s+t},EIUhl:function(s,t,n,i){return s(t,n,i)},SdlyQ:function(s,t){return s<<t},YsrsG:function(s,t){return s<<t},sNyho:function(s,t){return s+t},CaIqY:function(s,t){return s|t},AhiPq:function(s,t){return s+t},zAXbz:function(s,t){return s<<t},OaVzW:function(s,t){return s+t},ctWqE:function(s,t){return s+t},tcitu:function(s,t){return s>>>t},GWMMa:function(s,t){return s>>>t},xetnz:function(s,t){return s&t},EqOrJ:function(s,t){return s>>>t},IpZIb:function(s,t){return s&t},TdoEK:function(s,t){return s+t},AxtID:function(s,t){return s>>>t},OvIPl:function(s,t){return s>>>t},LhxHW:function(s,t){return s>t},IBwtx:function(s,t){return s+t},iYJCv:function(s,t){return s||t},UEqXe:function(s,t){return s!=t},mvLaL:function(s,t){return s!==t},ZdRIq:r(726),MJXei:function(s,t){return s&t},eOUZd:function(s,t){return s===t},QxELD:function(s,t){return s>>>t},buJQw:function(s,t){return s|t},qXHJF:function(s,t){return s<<t},wnVry:function(s,t){return s|t},DnOhc:function(s,t){return s<<t},LpfiO:function(s,t){return s|t},mWnKC:function(s,t){return s<<t},JCrwa:function(s,t){return s&t},oJdyy:r(656)+r(926)+r(958)+"ct",OUYAJ:"QzNgn",RFdCt:r(1469),bbBia:function(s,t){return s<t},LXEgF:function(s,t){return s|t},axrWD:function(s,t){return s|t},bJvWX:function(s,t){return s&t},tlEve:function(s,t){return s>>>t},jwHuR:function(s,t){return s&t},eUCgI:"KHAcl",TDIOO:function(s,t,n,i){return s(t,n,i)},uSDqy:r(1187),ArOQo:function(s,t){return s<t},RvRxn:function(s,t){return s+t},VMMnn:function(s,t,n,i){return s(t,n,i)},PfTwe:function(s,t,n,i){return s(t,n,i)},fLDiA:function(s,t,n,i){return s(t,n,i)},eMHJO:"cursor_f"+r(409),CedfM:function(s,t){return s<t},najKA:function(s,t,n){return s(t,n)},lVytV:function(s,t,n){return s(t,n)},oVoba:r(1763)+r(659),oVYON:"cursor_n"+r(1743),FdWsU:r(1805)+r(1828),kiuuz:function(s,t,n,i){return s(t,n,i)},swHSO:r(1276),dmsgt:r(1846),kjDWJ:function(s){return s()},dCJEp:r(505),stgdR:r(825),grOsY:function(s,t){return s(t)},rPDzN:r(1715)+"r",olbfa:function(s,t){return s|t},zdVir:function(s,t){return s>>>t},VYEna:function(s,t){return s|t},JuHFC:function(s,t){return s>t},fhaBb:function(s,t){return s===t},sEJhU:r(627),pDXJp:function(s,t,n,i){return s(t,n,i)},AxKgC:r(914)+"er_msgid",wHcGE:r(914)+r(1002),DPrfT:r(1643)+"s",PKwPu:function(s){return s()},BNoze:function(s,t){return s>t},QRJFU:function(s,t){return s>t},AcQnN:function(s,t){return s!==t},hWLai:"CDCus",iuvbV:r(1227),xIJnm:function(s){return s()},XauYf:function(s){return s()},MZdIP:function(s,t){return s(t)},KQOaE:function(s){return s()},KADQX:function(s,t){return s!==t},HpOaa:r(1491),XLPtW:r(827),VUcOl:r(1549),qaZto:function(s){return s()},iwzXZ:function(s,t,n,i){return s(t,n,i)},nPXFu:"vUeYE",vHYDC:function(s,t,n){return s(t,n)},QRCyy:function(s,t){return s===t},dvuuc:function(s,t,n){return s(t,n)},xuYre:function(s,t,n){return s(t,n)},sMBeE:function(s,t){return s===t},QpoOC:"success",zvkIU:r(1582),xGZAV:"gNNoE",jrTWi:function(s,t){return s!==t},AXeDR:"YVzLk",mlbno:r(363),gAxMc:r(1473)+r(786),diBqY:"auto",tEpOi:function(s,t){return s==t},pYrdi:r(1486)+"rovide v"+r(1027),JZury:r(1638),SBYca:function(s,t,n){return s(t,n)},rbJzl:r(1819)+"t",zZkcw:r(589),cpUOo:r(962),ATLxo:r(1612),OIMfx:"pageshow",sOhnD:function(s,t){return s(t)},JquUF:function(s){return s()},eEXbD:"PekEK",dCUPr:r(1724),dxwXR:r(874),tQoMW:r(1569),VahbC:r(483),Gdzns:r(548),GCOQh:"please p"+r(1084)+r(1591)+r(1564)+r(1895),YdXWj:r(1883),EWdEd:"web",AGSmK:function(s,t,n){return s(t,n)},ZLsYW:function(s,t){return s>t},dBrrU:function(s,t){return s-t},Qwkct:function(s,t,n){return s(t,n)},HScjT:function(s,t,n){return s(t,n)},SiOfg:"0|2|4|1|3",NylGS:r(1740),lPbus:function(s,t){return s!==t},BWodM:r(945),sBgED:function(s,t){return s(t)},StuDh:"FRONTIER>",zuqmR:function(s,t){return s*t},mexZB:function(s,t){return s-t},JJfWQ:function(s,t){return s>t},DpAyK:function(s,t){return s===t},HTBRj:r(946),HHWcJ:r(332),guFfc:r(472)+r(1021)+r(1819)+"ting server",MpkdJ:function(s,t){return s!==t},YLPkc:function(s,t,n){return s(t,n)},rKtEq:r(668)+r(1587)+r(1594)+"g",yzUbN:function(s,t){return s===t},FphBI:r(917),HSCoy:r(866)+"1",YstUd:"0|3|1|2|4",WauWk:function(s,t){return s===t},NafBn:r(615)+"s already closed",ltNKU:"AWfhE",vGzoE:r(611),eOpNB:function(s,t,n){return s(t,n)},FeUKT:function(s,t,n){return s(t,n)},NVjFT:r(472)+r(446)+r(1784)+r(1851),RMcBa:r(1566),lCCPg:"ack",RodAE:r(1871)+r(919),HLhpa:function(s,t){return s==t},ubTvR:function(s,t){return s==t},elkFq:r(1521),aNFeQ:function(s,t){return s instanceof t},aNHhp:function(s,t){return s(t)},CTHGa:function(s,t){return s(t)},bjeuo:function(s,t){return s(t)},rOwdm:function(s,t){return s||t},diWhl:function(s,t){return s instanceof t},aPyrA:function(s,t){return s(t)},SoTEc:"sent",IegBT:function(s,t){return s<t},cnrBy:"enqueue",JvTbe:function(s,t){return s||t},GqjvA:function(s,t){return s!==t},gjyKx:"manual r"+r(1094)+r(1550),tlMrb:r(1813)+"0",vzZTC:r(1001),ymvmn:function(s,t){return s!==t},NXrsF:r(1213),xtPRT:r(1543),jFtXH:function(s,t){return s*t},VQcdK:function(s,t){return s/t},isWEh:function(s,t){return s!=t},AJofD:r(1287),dENIA:function(s,t){return s!=t},XYKBN:function(s,t){return s===t},cPcEA:r(1188),ENGZq:"Dedicate"+r(707)+r(484)+"pe",nWicD:function(s,t){return s!=t},WeIIE:function(s,t){return s==t},ickjK:function(s,t){return s!=t},TcWNA:function(s,t){return s!=t},Xspif:function(s,t){return s!=t},RkWDA:function(s,t){return s===t},UPqsI:function(s,t){return s===t},CQsGg:r(1518)+r(1204)+r(857),rXGiD:function(s,t){return s===t},adVhL:"ServiceW"+r(730)+r(1860),biDhY:function(s,t){return s!=t},WcZgd:function(s,t){return s===t}};Se.r(V),Se.d(V,{FWS:()=>N0,CustomErrorEvent:()=>es,createCloseEvent:()=>pe,ReconnectEvent:()=>Zr,createErrorEvent:()=>ue,decodedFrame:()=>Xr,createOpenEvent:()=>os,CustomCloseEvent:()=>ts,createReconnectEvent:()=>Jn,FrontierMessageEvent:()=>rs,encodeFrame:()=>Gn,createMessageEvent:()=>is,OpenEvent:()=>ss,ErrorCode:()=>ze,Event:()=>st,MessageEvent:()=>ns});let o="";function a(s=""){let t=r,n="02",i=""+Date[t(1654)](),c=o||(o=e.vCbRl(p,s)),u=Math[t(586)]()[t(871)](16)[t(749)](-6);return e[t(455)](e[t(1348)](e[t(681)](n,i),c),u)}function x(){let s=r;return e[s(1786)](e[s(1863)](1e4,Date[s(1654)]()),Math.floor(e[s(1691)](1e4,Math[s(586)]())))}function f(s){let t=r;return e[t(849)](Array(8)[t(900)]("0"),e[t(1099)](parseInt,s,10).toString(2))[t(749)](-8)}function d(s){let t=r;if(e[t(678)](t(808),e[t(385)]))return e[t(681)](e[t(916)](Array,4)[t(900)]("0"),parseInt(s,2).toString(16))[t(749)](-4);_0x43dce0.log(_0x1388b2)}function g(s){let t=r,n=s.split(/\./)[t(1019)](u=>f(u)),i=[];return i[0]=e[t(1046)](d,e[t(923)](n[0],n[1])),i[1]=e[t(372)](d,e[t(923)](n[2],n[3])),[e[t(1829)],e[t(1829)],t(448),e.NMavs,e[t(1829)],e[t(1652)],i[0],i[1]].join("")}function p(s){let t=r;if(e[t(473)]("QMBWo",e.HnmHb)){let n=/(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}/.test(s),i=/(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))/[t(1098)](s);return n?e[t(916)](g,s):i?e.HoMJb(_,s):t(1016)+"00000000"+t(1016)+"00000000"}else return this[t(1501)]?.get(_0x22a9b8)}function _(s){let t=r,n={SUTsf:function(b,v){return e[k(1886)](b,v)},tYgBX:t(648),dHHYN:t(1685)+t(1541)+"s",PPdsN:e[t(1595)],qgNJy:e[t(1145)]},i="",c=[],u=0,h=0,m=!0,l=e[t(1829)];if(e[t(495)](s.indexOf("::"),-1)){let b=s[t(804)]("::");for(let C=0;e.KyIqX(C,b[t(398)]);C++)if(e[t(790)](e[t(1294)],t(967))){let P=b[C];if(P[t(1759)](":")>0){let L=P.split(":");m&&(u=L.length),h+=L[t(398)];for(let I=0;e[t(1298)](I,L[t(398)]);I++)if(e[t(790)](4,L[I][t(398)])){let te=l[t(928)+"g"](0,e.uhNHo(4,L[I][t(398)])),ne=te.concat(L[I]);c[t(358)](ne)}else c[t(358)](L[I]);m=!1}else{if(e[t(473)](4,P[t(398)]))if(e[t(655)](e[t(436)],e[t(698)])){let L=l[t(928)+"g"](0,e[t(328)](4,P.length)),I=L[t(1824)](P);c[t(358)](I)}else return _0xa4d70a?.find(L=>L.key===_0x14563e)?.[t(1375)];else c[t(358)](P);m&&(u+=1),h+=1,m=!1}}else{this["_clearPi"+t(1072)](),this[t(1283)+"gTimeoutId"]=e[t(502)](_0x370b8a,this[t(1559)][t(490)](this),this[t(895)][t(1320)+t(1762)]);let P=()=>{let I=t;n[I(1441)](_0x14378c,n[I(1104)]),this[I(454)](n[I(1681)],P),this.off(n[I(1092)],L)},L=()=>{let I=t;_0x316b82(n.qgNJy),this.off(I(1685)+"e_success",P),this.off(I(1685)+I(673)+"t",L)};this.on(e[t(974)],P),this.on(e[t(1595)],L),this._ping()}let v="";for(let C=0;e[t(1752)](C,e.hxkGJ(8,h));C++)v=v[t(1824)](l);for(let C=0;e[t(1804)](C,c[t(398)]);C++)if(e[t(1509)](C,u))if(e[t(790)](t(1080),e[t(756)]))i=i[t(1824)](v),i=i[t(1824)](c[C]);else{let P=(t(1821)+t(1123)).split("|"),L=0;for(;;){switch(P[L++]){case"0":_0x39969c[_0x4d0bbb[e[t(1767)]]=5001]=e[t(1767)];continue;case"1":return _0x55b37e;case"2":_0x5203d3[_0x25c1bb[e.QFsvI]=5002]=e[t(998)];continue;case"3":_0x4f8da7[_0x486bca[e.okkhw]=5003]=e[t(764)];continue;case"4":_0x16b7e4[_0x243ec0[t(1720)+"OR"]=5005]=e.GeeWe;continue;case"5":_0xf6901e[_0x3ec9b8[e[t(1676)]]=5004]=e[t(1676)];continue}break}}else i=i[t(1824)](c[C]);return i}{let b=s[t(804)](":");for(let v=0;e[t(1588)](v,b[t(398)]);v++){let C=b[v];if(e[t(1506)](4,b[v].length)){let P=l.substring(0,e[t(1327)](4,b[v].length)),L=P[t(1824)](C);i=i.concat(L)}else i=i[t(1824)](C)}return i}}function w(s,t){let n=r,i=s[n(465)];i!==void 0&&(e.XlRrT(ee,t,10),ke(t,i));let c=s[n(1375)];e.clFLh(void 0,c)&&(ee(t,18),e.GtyKp(ke,t,c))}function y(s){let t=r,n={};e:for(;!ye(s);){let i=j(s);switch(e[t(1667)](i,3)){case 0:break e;case 1:n.key=e.JTSku(be,s,e[t(1711)](j,s));break;case 2:n[t(1375)]=e[t(944)](be,s,e[t(876)](j,s));break;default:e[t(1328)](ie,s,e[t(393)](7,i))}}if(e[t(678)](void 0,n[t(465)]))throw new Error("Missing "+t(1052)+t(1369)+t(465));if(e[t(518)](void 0,n.value))throw new Error(e.mFUDh);return n}function A(s){let t=r,n=e[t(417)](z);return e[t(1328)](T,s,n),e[t(916)](Oe,n)}function T(s,t){let n=r,i={oUJsr:function(ne,me){return e.KJkBy(ne,me)}},c=s[n(999)];e[n(1411)](void 0,c)&&(e[n(1197)](ee,t,8),yt(t,c));let u=s[n(1174)];e[n(655)](void 0,u)&&(ee(t,16),e[n(944)](yt,t,u));let h=s[n(512)];if(h!==void 0)if(e.NIzyC(e[n(664)],e[n(1114)])){this[n(449)+n(1586)+n(486)](e.bUTnn(_0x2f5b36,e[n(930)],{code:1e3,reason:e[n(583)]})),this[n(1815)+n(695)]?.[n(834)+n(1139)+n(782)](),this[n(959)+n(1261)]?.["resetCou"+n(1200)]();return}else e[n(1620)](ee,t,24),e[n(1650)](yt,t,xe(h));let m=s.method;e[n(790)](void 0,m)&&(e.YRqdF(ee,t,32),e.WkHhA(yt,t,e[n(1886)](xe,m)));let l=s.headers;if(e[n(590)](void 0,l))for(let ne of l)if(e[n(518)](e[n(593)],e[n(593)])){e[n(688)](ee,t,42);let me=e[n(417)](z);e.jEFFg(w,ne,me),e[n(1904)](ee,t,me[n(1497)]),e[n(1904)](Wn,t,me),e[n(1046)](G,me)}else _0x3f2d5d=e[n(1711)](_0x17cafd,_0x504dba),_0x402634|=e.OjDGz(e[n(1195)](127,_0x61f2d5),7);let b=s["payloadE"+n(1746)];e[n(590)](void 0,b)&&(e[n(1099)](ee,t,50),ke(t,b));let v=s[n(696)+n(1347)];e[n(655)](void 0,v)&&(e.PdGwK(ee,t,58),e[n(1198)](ke,t,v));let C=s[n(470)];C!==void 0&&(e[n(1197)](ee,t,66),e[n(1198)](ee,t,C[n(398)]),zt(t,C));let P=s[n(1361)];if(e[n(1506)](void 0,P))if(e[n(1506)](e[n(1539)],e.FmILj)){let{value:ne,offset:me}=_0x326879(_0x51519d,_0x1c6887);_0x46d54f=me,_0x3cf0f1=i[n(1017)](_0x48738b,8)>>>0,_0x12795a+=ne}else ee(t,74),e[n(830)](ke,t,P);let L=s[n(1244)+"ming"];L!==void 0&&(e.VqMLK(ee,t,82),e[n(1461)](ke,t,L));let I=s.msgID;e[n(1690)](void 0,I)&&(e[n(1814)](ee,t,90),e[n(924)](ke,t,I));let te=s.frameType;e.sWUxP(void 0,te)&&(ee(t,96),e[n(1197)](yt,t,e[n(372)](xe,te)))}function N(s){return e[r(1875)](R,e.QIaVU(Ae,s))}function R(s){let t=r,n={};e:for(;!ye(s);){let i=e[t(370)](j,s);switch(e[t(1667)](i,3)){case 0:break e;case 1:n[t(999)]=Jr(s,!0);break;case 2:n[t(1174)]=e[t(924)](Jr,s,!0);break;case 3:n[t(512)]=e[t(383)](j,s);break;case 4:n[t(720)]=j(s);break;case 5:{let c=e[t(1394)](K,s);(n[t(1246)]||(n[t(1246)]=[]))[t(358)](e[t(340)](y,s)),s[t(1497)]=c;break}case 6:n["payloadE"+t(1746)]=e[t(1198)](be,s,j(s));break;case 7:n[t(696)+t(1347)]=e[t(577)](be,s,e[t(1886)](j,s));break;case 8:n[t(470)]=e.JTSku(Bt,s,e[t(1394)](j,s));break;case 9:n.LogIDNew=e[t(830)](be,s,e[t(1886)](j,s));break;case 10:n[t(1244)+t(1291)]=e.jEFFg(be,s,e.LvYEV(j,s));break;case 11:n[t(462)]=be(s,e.MPZZy(j,s));break;case 12:n[t(1552)+"e"]=e[t(771)](j,s);break;default:e[t(427)](ie,s,e.FYrJM(7,i))}}if(e[t(518)](void 0,n[t(999)]))throw new Error(e[t(1359)]);if(e[t(941)](void 0,n[t(1174)]))throw new Error(e[t(1165)]);if(n[t(512)]===void 0)throw new Error(e[t(1579)]);if(e[t(1494)](void 0,n[t(720)]))throw new Error(e[t(1014)]);return n}function K(s){let t=r,n={iVueu:function(i,c){return e[k(1296)](i,c)}};if(e.sWUxP(e[t(1889)],"usCeq")){if(n.iVueu(_0x1c27ab,_0x30506c))return _0x5af506}else{let i=e[t(619)](j,s),c=s.limit;return s[t(1497)]=e[t(455)](s[t(607)],i),c}}function ie(s,t){let n=r;switch(t){case 0:for(;e[n(525)](128,e[n(372)](J,s)););break;case 2:e.nvPqX(we,s,e[n(520)](j,s));break;case 5:we(s,4);break;case 1:we(s,8);break;default:throw new Error(e.IAVzX(e[n(1884)],t))}}function xe(s){let t=r;return s|=0,{low:s,high:s>>31,unsigned:e[t(1478)](s,0)}}let D=[];function z(){let s=r,t=D[s(1303)]();return t?(t[s(607)]=t.limit=0,t):{bytes:new Uint8Array(64),offset:0,limit:0}}function G(s){let t=r;if(e[t(1544)]===t(1910))return this[t(449)+t(403)+t(521)](_0x2ea7fa),_0x191152();D[t(358)](s)}function Ae(s){return{bytes:s,offset:0,limit:s.length}}function Oe(s){let t=r,n=s[t(1663)],i=s[t(1497)];return n[t(398)]===i?n:n[t(795)](0,i)}function we(s,t){let n=r;if(e[n(495)](e[n(455)](s[n(607)],t),s[n(1497)]))throw new Error(e[n(712)]);s[n(607)]+=t}function ye(s){return e[r(1817)](s.offset,s.limit)}function ge(s,t){let n=r;if(e[n(1494)](e[n(494)],e.RAtjl))return this[n(1501)]?.[n(1722)](_0x54c057);{let i=s.bytes,c=s.offset,u=s[n(1497)],h=e[n(1191)](c,t);if(e[n(495)](h,i[n(398)])){let m=new Uint8Array(e[n(1809)](2,h));m[n(1216)](i),s.bytes=m}return s[n(607)]=h,e[n(1280)](h,u)&&(s[n(1497)]=h),c}}function et(s,t){let n=r,i=s[n(607)];if(e[n(582)](e.PbLar(i,t),s.limit))throw new Error(e[n(886)]);return s[n(607)]+=t,i}function Bt(s,t){let n=r,i=e[n(427)](et,s,t);return s[n(1663)][n(795)](i,e[n(1831)](i,t))}function zt(s,t){let n=r,i=ge(s,t[n(398)]);s.bytes[n(1216)](t,i)}function be(s,t){let n=r,i={XkkfF:function(b){return e.pcuWV(b)},ABXYF:function(b,v,C){return b(v,C)},tosCd:function(b,v,C,P){return e[k(1164)](b,v,C,P)}},c=e[n(377)](et,s,t),u=String["fromChar"+n(397)],h=s[n(1663)],m="\uFFFD",l="";for(let b=0;e[n(896)](b,t);b++){let v=h[e[n(1831)](b,c)],C,P,L,I;if(e[n(557)](128,v)===0)l+=e[n(789)](u,v);else if(e[n(941)](224&v,192))if(e[n(511)](b,1)>=t)l+=m;else if(e[n(325)](e[n(853)],e[n(1223)]))C=h[e[n(1348)](e[n(562)](b,c),1)],e[n(1524)](e.SuZrB(192,C),128)?l+=m:(I=e[n(337)](e[n(557)](31,v)<<6,63&C),e[n(1752)](I,128)?l+=m:e[n(1254)](n(1857),n(1857))?(_0x3ecac6(),bjSpdA[n(740)](_0x822e72)):(l+=e[n(771)](u,I),b++));else return new _0x260ca6(te=>{let ne=n;i[ne(734)](_0x1a0ace,te,this[ne(981)+ne(1023)+"e"](_0x5ee8b2))});else if(e[n(1231)](e[n(1195)](240,v),224))if(e.sDUwJ(e.NfXix(b,2),t))l+=m;else if(C=h[e[n(1738)](e[n(1831)](b,c),1)],P=h[e[n(515)](e[n(1831)](b,c),2)],e[n(1131)](e[n(927)](C,e[n(491)](P,8)),49344)!==32896)l+=m;else if(e.pIyij(n(1170),e.SDWso)){let te=new _0x120f3d(_0x221121(_0xb63a50));return i[n(666)](_0x3d3cc4,_0x232d97,te,0),te}else I=e.Txgfz(e[n(1235)](e.buSyb(e[n(557)](15,v),12),e[n(491)](63&C,6)),e[n(393)](63,P)),I<2048||e[n(1817)](I,55296)&&e[n(508)](I,57343)?l+=m:(l+=e[n(1788)](u,I),b+=2);else if(e.NmCmY(e[n(1128)](248,v),240))if(e.LEpMC(b,3)>=t)l+=m;else if(n(1655)!==e[n(1378)])if(C=h[e[n(455)](e[n(1070)](b,c),1)],P=h[e[n(849)](e[n(1070)](b,c),2)],L=h[e.hLiNC(b,c)+3],e[n(1179)](e[n(393)](e[n(810)](e[n(1673)](C,e[n(1013)](P,8)),e[n(1013)](L,16)),12632256),8421504))l+=m;else{if(e[n(868)](n(1641),e[n(641)]))return _0x1843b4||(_0x3b82d4=[_0x36ab96,_0x1b18eb,_0x233ba,_0x1c03fb,_0x26d0e5]);I=e[n(1235)](e.Srnoz(e[n(1195)](7,v)<<18,e[n(1898)](e[n(525)](63,C),12))|e[n(491)](e[n(1028)](63,P),6),e[n(1526)](63,L)),I<65536||e[n(1653)](I,1114111)?l+=m:(I-=65536,l+=e[n(1770)](u,e[n(604)](I,10)+55296,e.Dcibz(e[n(826)](1023,I),56320)),b+=3)}else return this[n(713)+"T"]||this[n(1475)+"X"]?this["_miniNav"+n(1563)+n(387)]:(this[n(1447)+"er"]||this[n(1446)+"r"])&&this._options[n(1646)+n(639)+n(633)]?_0x32ec01[n(326)]:!0;else l+=m}return l}function ke(s,t){let n=r,i=t[n(398)],c=0;for(let m=0;e.JSEPq(m,i);m++){let l=t[n(362)+"At"](m);e[n(1817)](l,55296)&&e[n(508)](l,56319)&&e[n(1729)](m,1)<i&&(l=e[n(328)](e[n(1625)](e[n(1270)](l,10),t[n(362)+"At"](++m)),56613888)),c+=e.tuijP(l,128)?1:e[n(1298)](l,2048)?2:e[n(776)](l,65536)?3:4}ee(s,c);let u=e.nvPqX(ge,s,c),h=s[n(1663)];for(let m=0;m<i;m++){let l=t[n(362)+"At"](m);e[n(1067)](l,55296)&&e.mTnfT(l,56319)&&e.YplBc(m,1)<i&&(l=e[n(1786)](e[n(1086)](l,10),t[n(362)+"At"](++m))-56613888),e[n(1453)](l,128)?h[u++]=l:(e.WQbXM(l,2048)?h[u++]=e.egFEC(e[n(578)](l,6),31)|192:(e.cFXFq(l,65536)?h[u++]=e.Txgfz(e.JycZi(l,12)&15,224):(h[u++]=e[n(1235)](e[n(1208)](e[n(606)](l,18),7),240),h[u++]=e[n(1538)](e[n(1128)](e[n(1345)](l,12),63),128)),h[u++]=e[n(1538)](e.FAEdw(e[n(509)](l,6),63),128)),h[u++]=e[n(1836)](e.znKWJ(63,l),128))}}function Wn(s,t){let n=r;if(e[n(868)](n(1251),n(1251))){let i=e[n(1156)](ge,s,t.limit),c=s.bytes,u=t[n(1663)];for(let h=0,m=t[n(1497)];e[n(896)](h,m);h++)c[e[n(455)](h,i)]=u[h]}else return n(1176)+"_"+this[n(824)]}function J(s){return s.bytes[et(s,1)]}function nt(s,t){let n=r,i=e[n(1492)](ge,s,1);s.bytes[i]=t}function j(s){let t=r,n=0,i=0,c;do c=e.nzZox(J,s),n<32&&(i|=e[t(1020)](127&c,n)),n+=7;while(e.PoUJS(128,c));return i}function ee(s,t){let n=r;if(e[n(655)](e.fFCGH,e[n(1405)]))e[n(1904)](_0x3b8200,_0x27b38c,18),e[n(502)](_0x34d17d,_0x20fe24,_0x555cf4);else{for(t>>>=0;e[n(381)](t,128);)e.bUTnn(nt,s,e[n(1538)](e.egFEC(127,t),128)),t>>>=7;e[n(1198)](nt,s,t)}}function Jr(s,t){let n=r,i={jkdIJ:e[n(930)],VVpQN:function(c,u,h){return e[n(1197)](c,u,h)}};if(e[n(1254)](n(719),n(561))){let c=0,u=0,h=0,m;if(m=J(s),c=127&m,e.KIuab(128,m)&&(m=e.ywDbN(J,s),c|=e[n(1086)](e[n(1511)](127,m),7),e.TktiC(128,m)&&(m=J(s),c|=e[n(1020)](e.egFEC(127,m),14),128&m&&(m=e[n(372)](J,s),c|=(127&m)<<21,e[n(1208)](128,m)))))if(e[n(1728)]===e[n(584)]){let l=e[n(859)](_0x1c8a40,e[n(984)],{message:_0x459d38[n(1740)],code:_0x114e28["MESSAGE_"+n(1295)],error:_0x389213});this["_dispatc"+n(1158)+n(486)](l)}else m=e[n(1886)](J,s),u=e[n(872)](127,m),e.ejMxc(128,m)&&(m=e[n(1394)](J,s),u|=e[n(491)](127&m,7),128&m&&(m=e[n(458)](J,s),u|=e[n(1013)](e[n(872)](127,m),14),e.TktiC(128,m)&&(m=e[n(931)](J,s),u|=e.wvtKI(e[n(367)](127,m),21),e[n(1808)](128,m)&&(m=e[n(372)](J,s),h=127&m,e[n(1371)](128,m)&&(m=e[n(887)](J,s),h|=e[n(709)](e[n(1157)](127,m),7))))));return{low:e[n(359)](c,e[n(709)](u,28)),high:e[n(1799)](e.Anrwn(u,4),e.bzqPe(h,24)),unsigned:t}}else this.emit(i.jkdIJ,i[n(1391)](_0x12e523,i[n(585)],{..._0xf07feb}))}function yt(s,t){let n=r,i=t[n(420)]>>>0,c=e.BldmL(e[n(1737)](t[n(420)],28)|e[n(1020)](t.high,4),0),u=e[n(643)](t.high,24),h=u===0?c===0?e[n(814)](i,16384)?e[n(705)](i,128)?1:2:e[n(1406)](i,2097152)?3:4:c<16384?e[n(1442)](c,128)?5:6:c<2097152?7:8:e[n(1708)](u,128)?9:10,m=ge(s,h),l=s.bytes;switch(h){case 10:l[e[n(531)](m,9)]=e.GavAx(e[n(840)](u,7),1);case 9:l[m+8]=e[n(1153)](9,h)?e.zbugm(128,u):e.ViGJH(127,u);case 8:l[e[n(923)](m,7)]=e[n(1529)](8,h)?c>>>21|128:e[n(670)](c,21)&127;case 7:l[m+6]=h!==7?e.BLjjO(e[n(670)](c,14),128):c>>>14&127;case 6:l[m+5]=h!==6?e[n(546)](e.FLhVq(c,7),128):e.gDzoy(c,7)&127;case 5:l[m+4]=h!==5?e.OGzsa(128,c):127&c;case 4:l[e[n(1901)](m,3)]=e.iaMDp(4,h)?e[n(772)](e[n(735)](i,21),128):e[n(826)](i>>>21,127);case 3:l[e[n(1768)](m,2)]=e[n(655)](3,h)?e[n(820)](i,14)|128:e[n(525)](e.CoewU(i,14),127);case 2:l[m+1]=e[n(1254)](2,h)?e[n(810)](e[n(1667)](i,7),128):e[n(954)](i,7)&127;case 1:l[m]=e.EToJI(1,h)?e[n(1065)](128,i):e.FAEdw(127,i)}}function Xr(s){return N(s)}function Gn(s){return e.fjVwr(A,s)}let Vr=65536,jo=e[r(416)],rt=e[r(905)](Vr,Vr),Yr=rt*rt,Qr=e[r(1201)](Yr,2),Be=String[r(934)+"e"][r(362)+"At"];class O{constructor(t,n,i){let c=r;this[c(528)]=!0,this[c(420)]=e[c(1323)](0,t),this.high=0|n,this.unsigned=!!i}static[r(528)](t){return t&&e[r(1389)](!0,t.isLong)}static fromBits(t,n,i){let c=r;return e[c(325)](c(1414),e[c(1826)])?this[c(1501)]?.[c(1216)]({message_id:_0x506fee,timestamp:_0x30876e}):new O(t,n,i)}static[r(1665)+"s"](t,n,i){let c=r;return i?O["fromByte"+c(522)](t,n):O[c(1665)+"sBE"](t,n)}static[r(1665)+"sLE"](t,n){let i=r,c={bCbaP:i(1172)+"d",zxTju:e[i(1135)],knxDd:e[i(629)]};if(e[i(1112)](e[i(1173)],e[i(605)]))CbOiDf[i(1610)]!=typeof _0x3c95a0&&_0x2b8719[i(871)+i(978)]&&_0x3986a7[i(1490)+i(1571)](_0xf05223,_0x39a727[i(871)+"Tag"],{value:CbOiDf[i(922)]}),_0x2f3ca2["definePr"+i(1571)](_0x38755b,CbOiDf.knxDd,{value:!0});else return new O(e[i(927)](e[i(1088)](t[0]|e.QRzVn(t[1],8),e[i(1898)](t[2],16)),t[3]<<24),e[i(1619)](e.HuMsN(t[4],e.QoyXJ(t[5],8)),t[6]<<16)|e[i(1086)](t[7],24),n)}static[r(1665)+r(1840)](t,n){let i=r;return new O(e[i(772)](e[i(1619)](e.ZwTVG(e[i(813)](t[4],24),e.UNJIT(t[5],16)),e.jvUQn(t[6],8)),t[7]),e[i(546)](e[i(927)](e[i(359)](t[0]<<24,e.QLRZB(t[1],16)),e[i(1811)](t[2],8)),t[3]),n)}static[r(750)](t){let n=r;return t===jo?$r:new O(e[n(1737)](e[n(1619)](Be.call(t,0)|e[n(1850)](Be[n(683)](t,1),8)|e[n(418)](Be[n(683)](t,2),16),e[n(913)](Be[n(683)](t,3),24)),0),e.FmZcV(e[n(1480)](e[n(694)](Be[n(683)](t,4),Be[n(683)](t,5)<<8),e.ZWIqv(Be.call(t,6),16)),e[n(418)](Be[n(683)](t,7),24))>>>0,!0)}[r(847)](){let t=r;return String[t(851)+"Code"](e.kfevH(255,this[t(420)]),this[t(420)]>>>8&255,e.Msnhr(e[t(840)](this[t(420)],16),255),e[t(1551)](this[t(420)],24),e[t(1463)](255,this[t(1504)]),e.wMJQc(e[t(1775)](this[t(1504)],8),255),e.wMJQc(e[t(840)](this.high,16),255),e[t(1775)](this.high,24))}static[r(356)+"er"](t,n=!0){let i=r;if(e[i(1107)](isNaN,t))return n?Wo:$r;if(n){if(e[i(338)](t,Yr))return Jo}else{if(t<=-Qr)return Xo;if(e[i(1350)](e[i(1070)](t,1),Qr))return Go}return O.fromBits(e[i(1255)](t,rt)|0,e.Qupyz(e[i(526)](t,rt),0),n)}[r(1687)](){let t=r;return this[t(1627)]?e[t(511)](e[t(670)](this[t(1504)],0)*rt,e[t(1775)](this[t(420)],0)):e.xcblt(this.high,rt)+e[t(670)](this[t(420)],0)}[r(1289)](){let t=r;return e.GvWCn(0,this.high)&&e[t(678)](0,this[t(420)])}[r(1911)](t){let n=r;if(e[n(1389)](e[n(474)],e[n(1713)])){let i=this[n(1504)],c=this[n(420)];return[e[n(560)](255,c),e[n(1890)](e[n(778)](c,8),255),e.TMsAJ(c,16)&255,c>>>24,255&i,e[n(477)](e[n(643)](i,8),255),e.FlSwf(e[n(1181)](i,16),255),e[n(425)](i,24)]}else{O[n(528)](t)||(t=O[n(356)+"er"](t));let i=e[n(1667)](this[n(1504)],16),c=e[n(873)](65535,this[n(1504)]),u=e[n(1693)](this.low,16),h=e[n(477)](65535,this[n(420)]),m=t[n(1504)]>>>16,l=e[n(540)](65535,t[n(1504)]),b=e[n(1737)](t[n(420)],16),v=e.LLoJV(65535,t[n(420)]),C=0,P=0,L=0,I=0;return I+=e.YplBc(h,v),L+=e[n(1181)](I,16),I&=65535,L+=u+b,P+=L>>>16,L&=65535,P+=e[n(1729)](c,l),C+=e.IJiqo(P,16),P&=65535,C+=e[n(1070)](i,m),C&=65535,O[n(596)](e.zbugm(e[n(1086)](L,16),I),e[n(722)](e.Izdwd(C,16),P),this[n(1627)])}}equals(t){let n=r;return O[n(528)](t)||(t=O.fromNumber(t)),this.unsigned!==t[n(1627)]&&e[n(1389)](e.TUKbr(this[n(1504)],31),1)&&e[n(1737)](t[n(1504)],31)===1?!1:e[n(1509)](this[n(1504)],t[n(1504)])&&e.LYoDq(this[n(420)],t.low)}[r(1832)](){let t=r;return this.low===-1&&e[t(1281)](-1,this[t(1504)])?O[t(596)](0,0,this[t(1627)]):e[t(1007)](-1,this[t(420)])?O[t(596)](0,this[t(1504)]+1,this[t(1627)]):O[t(596)](e.coDEA(this.low,1),this.high,this[t(1627)])}toBytes(t){let n=r;return t?this[n(653)+"E"]():this[n(614)+"E"]()}toBytesLE(){let t=r,n=this[t(1504)],i=this[t(420)];return[e[t(1028)](255,i),e[t(393)](e[t(820)](i,8),255),e[t(1131)](e.FEvbh(i,16),255),i>>>24,e[t(1208)](255,n),e[t(393)](e[t(1737)](n,8),255),e[t(1890)](e[t(1551)](n,16),255),e.Yrqfc(n,24)]}[r(614)+"E"](){let t=r,n=this[t(1504)],i=this[t(420)];return[e[t(820)](n,24),n>>>16&255,e[t(911)](e[t(821)](n,8),255),e[t(1581)](255,n),e[t(687)](i,24),i>>>16&255,e[t(840)](i,8)&255,e[t(1530)](255,i)]}}let $r=new O(0,0,!1),Wo=new O(0,0,!0),Go=O[r(596)](-1,2147483647,!1),Jo=O[r(596)](-1,-1,!0),Xo=O[r(596)](0,-2147483648,!1);var ze=(function(s){let t=r,n=(t(352)+t(388)).split("|"),i=0;for(;;){switch(n[i++]){case"0":s[s[e.QFsvI]=5002]=e[t(998)];continue;case"1":s[s[t(1058)+t(441)]=5001]=t(1058)+t(441);continue;case"2":s[s[e.IhceA]=5004]=e[t(1676)];continue;case"3":s[s[e[t(1553)]]=5005]=e.GeeWe;continue;case"4":return s;case"5":s[s["MAX_RETR"+t(1126)+"R"]=5003]=t(1839)+t(1126)+"R";continue}break}})({});class st{constructor(t){let n=r;this[n(1155)]=t,this.target=null}}class Zr extends st{constructor(t,n){super(t),this.message=n&&n.message||null}}class es extends st{constructor(t,n){let i=r,c="0|3|2|5|4|1|6"[i(804)]("|"),u=0;for(;;){switch(c[u++]){case"0":super(t);continue;case"1":this.message=n&&n.message||"";continue;case"2":this.colno=n&&n.colno||0;continue;case"3":this[i(1033)]=n&&n.error||null;continue;case"4":this.lineno=n&&n.lineno||0;continue;case"5":this[i(1183)]=n&&n.filename||"";continue;case"6":this.code=n&&n.code||5001;continue}break}}}class ts extends st{constructor(t,n){let i=r,c={UvuMN:function(u,h){return e[k(1793)](u,h)},AxspB:function(u,h){return e[k(1546)](u,h)}};if(e.gOlBF(e[i(1142)],e[i(912)])){let u=e[i(700)][i(804)]("|"),h=0;for(;;){switch(u[h++]){case"0":this[i(793)]=n&&n[i(793)]||"";continue;case"1":this[i(1787)+i(794)]=n&&n[i(1787)+i(794)]||!1;continue;case"2":this[i(634)]=n&&n[i(634)]||0;continue;case"3":super(t);continue;case"4":this[i(1410)]=n&&n.wasClean||!1;continue}break}}else _0xe4a9f7[_0x18dba0++]=c[i(1671)](_0xa93103,6)|192,_0x3c76ad[_0x15d682++]=c[i(1572)](63,_0x10dc76)|128}}class ns extends st{constructor(t,n){let i=r;super(t),this[i(1471)]=n&&n[i(1471)]||null}}class rs extends ns{constructor(t,n){let i=r,c={SxQPi:function(u,h,m){return e.FQZwg(u,h,m)},joOxa:function(u,h,m){return e[k(1814)](u,h,m)},WiWIT:function(u,h){return e[k(789)](u,h)}};e[i(890)]!==i(1166)?(mERsSL.SxQPi(_0x3b0cbe,_0x57faf0,24),mERsSL.joOxa(_0x156035,_0x131402,mERsSL.WiWIT(_0x2c3ee1,_0x4ab503))):(super(t),this[i(1471)]=n&&n.data||null,this[i(1740)]=n&&n.message||null)}}class ss extends st{constructor(t,n){let i=r;e[i(868)](e[i(1089)],e[i(1175)])?this["currentE"+i(1317)+i(1038)+"t"]=0:(super(t),this[i(1471)]=n&&n[i(1471)]||null)}}function ue(s,{message:t,code:n,error:i}){let c=r;return e[c(1153)](c(1718),e[c(1190)])?this[c(1501)].isReady:new es(s,{message:t,code:n,error:i})}function pe(s,{code:t,reason:n,wasClean:i,willReconnect:c}){let u=r,h={wGKgO:function(m,l){return m(l)},mlZgL:function(m,l){return e[k(776)](m,l)},kxhtr:function(m,l){return e[k(587)](m,l)},QbTlw:function(m,l){return e[k(1659)](m,l)}};if(e.gvwUH(e[u(798)],e[u(728)]))_0x2859c7=DmtErz[u(1316)](_0x41069f,_0x104be0),DmtErz[u(1413)](_0x375571,32)&&(_0x181004|=DmtErz[u(1545)](DmtErz[u(1423)](127,_0x2b1d3e),_0x4a3e51)),_0x4c14e3+=7;else return new ts(s,{code:t,reason:n,wasClean:i,willReconnect:c})}function is(s,{data:t,message:n}){return e[r(1078)]===e.GDqPD?null:new rs(s,{data:t,message:n})}function os(s,{data:t}){return new ss(s,{data:t})}function Jn(s,{message:t}){return new Zr(s,{message:t})}class as{constructor(t,n){let i=r;this.endpoints=t,this[i(1429)+"es"]=n,this[i(1245)+i(888)]=0,this[i(412)+i(1317)+"riesCount"]=0}[r(834)+r(1139)+r(782)](){let t=r;this["currentI"+t(888)]=0,this[t(412)+t(1317)+t(1038)+"t"]=0}[r(1214)+"es"](){let t=r;this[t(412)+t(1317)+t(1038)+"t"]=0}[r(1096)+r(1210)+"nt"](){let t=r;return this[t(1583)+"s"][this[t(1245)+t(888)]]}getCurrentEndpointTriesCount(){let t=r;return this[t(412)+t(1317)+t(1038)+"t"]}["checkRea"+r(471)+"es"](){let t=r;return!!(this["currentI"+t(888)]>=this[t(1583)+"s"].length||e[t(678)](this.currentIndex,this[t(1583)+"s"][t(398)]-1)&&e[t(1112)](this.currentEndpointTriesCount,this[t(1429)+"es"]))}[r(1694)+r(404)+r(1161)+"hedMaxRe"+r(1456)](){let t=r,n={BSBfQ:function(i,c,u){return e[k(333)](i,c,u)},TmAmF:"error",hJbCi:e[t(930)]};if(e.DIccL===e[t(1495)])return e.NmCmY(this[t(1245)+t(888)],this.endpoints[t(398)])?!0:e[t(1280)](this[t(412)+t(1317)+"riesCount"],this[t(1429)+"es"]);{let i=n[t(631)](_0x57d6fa,n.TmAmF,{message:this[t(439)+t(1894)+t(1834)](_0x171d73)});this[t(339)](t(1033),i);let c=_0x243e69(n[t(738)],{reason:this["_formatE"+t(1894)+t(1834)](_0x556ba7)});this.emit(n[t(738)],c)}}[r(1314)+r(752)+r(327)+r(1412)+r(1271)](){let t=r;if(e[t(1427)]!==e[t(701)])return this["currentE"+t(1317)+t(1038)+"t"]=1,this[t(1245)+t(888)]++,this[t(1583)+"s"][this[t(1245)+"ndex"]];{let n=new _0x3ce8be(e[t(1844)](e.BLjjO(e.BLjjO(e[t(1037)](_0x8a1f6c[e.dYbuH(_0x56c247,4)],24),e[t(450)](_0x4392ae[e[t(819)](_0x221396,5)],16)),e[t(684)](_0x146247[e.dwqjE(_0x5906d6,6)],8)),_0xecf430[e[t(1712)](_0x330352,7)]),e[t(772)](_0x5a0b96[e[t(1357)](_0x59d45c,0)]<<24|e[t(1438)](_0x2da5dc[e[t(901)](_0x24880e,1)],16),_0x17da48[_0x49123c+2]<<8)|_0xc8f56d[e[t(1129)](_0x593112,3)],!0);return _0x8225a7+=8,{value:n,offset:e[t(591)](_0xae4529,8)}}}[r(1096)+r(1210)+r(898)+r(781)](){let t=r,n={EmKIv:function(i,c){return i(c)}};return e[t(647)](e[t(1124)],e[t(564)])?(this[t(412)+t(1317)+t(1038)+"t"]++,this[t(1096)+t(1210)+"nt"]()):function(i,...c){let u=t,h=_0x28de2d[u(683)](qwVmSU[u(516)](_0x1995b6,this),i,...c);return _0xcb2575.set(h,i[u(380)]?i[u(380)]():[i]),qwVmSU[u(516)](_0x34f393,h)}}}let it=(e.isWEh(e.mgBuY,typeof globalThis)&&e.trpYA(e[r(1367)],globalThis[r(671)+r(382)].name)||e.dENIA(e[r(710)],typeof window)&&e[r(580)](e[r(1367)],window[r(671)+"tor"][r(514)]))&&e.mgBuY!=typeof document,We=e[r(1637)](r(1172)+"d",typeof globalThis)&&(e[r(1874)](e.cPcEA,globalThis.constructor[r(514)])||e[r(941)](e[r(1250)],globalThis[r(671)+r(382)][r(514)]))&&e[r(1105)](e[r(710)],typeof tt),bt=(e[r(1006)](r(1172)+"d",typeof globalThis)&&e[r(1404)]===globalThis[r(671)+r(382)].name||e[r(950)](e[r(710)],typeof globalThis)||e.ickjK(e[r(710)],typeof globalThis)&&!!globalThis[r(1376)+r(1120)])&&e[r(1568)](e[r(710)],typeof wx),vt=e[r(1330)](r(1172)+"d",typeof globalThis)&&(e[r(747)](e[r(1250)],globalThis[r(671)+r(382)][r(514)])||e[r(1864)](e[r(1745)],globalThis["construc"+r(382)][r(514)])||e[r(862)](e[r(336)],globalThis[r(671)+"tor"][r(514)]))&&e[r(1507)](e[r(710)],typeof self),Vo=e[r(1006)](r(1172)+"d",typeof globalThis)&&e[r(1311)](r(1188),globalThis[r(671)+r(382)][r(514)])&&r(1172)+"d"!=typeof global&&e[r(1751)](r(1188),global[r(671)+r(382)].name)&&e.mgBuY!=typeof process&&!!process[r(1800)];class Xn{constructor(){this._listeners={}}emit(t,...n){let i=r,c=this[i(1425)+"rs"][t];if(c)c[i(749)]().forEach(u=>u.fn[i(1547)](u[i(1468)],n));else if(e[i(951)](e[i(984)],t)&&!this[i(624)])if(e[i(1868)](i(760),e.qpSon)){let u=n.length&&n[0];if(e[i(533)](u,Error))throw u;let h=new Error(e[i(1293)]+(u?e[i(819)](e[i(1508)](" (",u[i(1740)]),")"):""));throw h.context=u,u}else return!!_0x450ade?.[i(1628)](u=>u[i(465)]===_0x4756eb&&u[i(1375)]===_0x497bf0);return this}[r(454)](t,n){let i=r,c={NvjET:function(u,h){return e[k(1708)](u,h)},MBStS:function(u,h){return u<h},sTHop:function(u,h){return u>>h},DWXqx:function(u,h){return e.nreul(u,h)},ZbmAG:function(u,h){return e[k(1028)](u,h)},WuulF:function(u,h){return e.excJi(u,h)},VJFpi:function(u,h){return e[k(1897)](u,h)},ctPSl:function(u,h){return e[k(1243)](u,h)},zEzVi:i(800)+i(1064),MWAXX:function(u,h){return e[i(1900)](u,h)},WMfsQ:function(u,h){return u>>h},Mrqdf:function(u,h){return e[i(694)](u,h)},NkHAE:function(u,h){return e[i(401)](u,h)},SntTN:function(u,h){return u+h},iUmpK:function(u,h){return e[i(560)](u,h)},cOtSL:function(u,h){return u&h}};if(e[i(1389)](void 0,t))this[i(1425)+"rs"]={};else if(n===void 0)this[i(1425)+"rs"][t]=null;else if(e[i(1151)]!==e[i(1151)])if(_0x2733af=_0x246963.charCodeAt(_0x597203),c.NvjET(_0x1658f2,128))_0x39bc39[_0x304d4a++]=_0x31f815;else if(c.MBStS(_0x6ab3a8,2048))_0x5e1c35[_0x24c37f++]=c[i(424)](_0x545beb,6)|192,_0x565391[_0x3cf110++]=c.DWXqx(c[i(640)](63,_0x861075),128);else if(c.WuulF(c[i(1699)](64512,_0xa2ad6b),55296)&&c.WuulF(c[i(1680)](64512,_0x18113f=_0x234616[i(362)+"At"](_0x542a85+1)),56320)){let u=c[i(1645)].split("|"),h=0;for(;;){switch(u[h++]){case"0":++_0x128652;continue;case"1":_0xbecdf3[_0x574d12++]=c.MWAXX(c[i(1680)](c[i(1057)](_0x51458b,6),63),128);continue;case"2":_0x16b7c4[_0x422467++]=c[i(1500)](c[i(863)](63,_0x3cbc59),128);continue;case"3":_0x89a4f4[_0x57ae86++]=_0x560c87>>18|240;continue;case"4":_0x3c3245=c[i(407)](65536+(c[i(699)](1023,_0xff6f9b)<<10),c[i(640)](1023,_0x522276));continue;case"5":_0x1e6102[_0x51346e++]=c[i(1719)](c[i(640)](_0x3b1591>>12,63),128);continue}break}}else _0x2b83d4[_0x353e8a++]=c[i(1881)](_0x1a7de3>>12,224),_0x324cda[_0x342aa4++]=c.cOtSL(_0x5e4ad5>>6,63)|128,_0x143581[_0x15f8f1++]=c[i(1881)](63&_0x28d383,128);else{let u=this[i(1425)+"rs"][t];if(u)for(let h=0;h<u.length;)e[i(939)](u[h].fn,n)?u[i(732)](h,1):++h}return this}on(t,n,i){let c=r;return(this[c(1425)+"rs"][t]||(this[c(1425)+"rs"][t]=[])).push({fn:n,ctx:i||this}),this}}class Yo extends Xn{["_formatE"+r(1894)+"age"](t){let n=r,i={sqquC:function(c,u,h){return e[k(1620)](c,u,h)},OGfAp:function(c,u,h){return e[k(1198)](c,u,h)}};if(e.gPzNM!==e.gPzNM)rnrXtE[n(637)](_0x389515,_0x3bc3bd,50),rnrXtE[n(1178)](_0x42a119,_0x393052,_0x45d9af);else return t[n(645)]||t[n(879)]?(n(1068)+" "+(t[n(645)]||"")+n(1137)+(t[n(879)]||""))[n(766)]():JSON[n(1224)+"y"](t)}constructor(t,n,i){let c=r;super(),this[c(489)]=null,bt&&wx["connectS"+c(636)]&&(this[c(489)]=wx[c(572)+c(636)]({url:t,protocols:n,header:i,fail:this[c(444)+c(510)+"lHandler"][c(490)](this),success:this["_createS"+c(1747)+"cessHand"+c(788)].bind(this)})),We&&tt[c(572)+c(636)]&&(this[c(489)]=tt["connectS"+c(636)]({url:t,protocols:n,header:i,fail:this[c(444)+c(510)+c(597)][c(490)](this),success:this[c(444)+c(1747)+c(940)+c(788)][c(490)](this)}))}[r(444)+r(1747)+r(940)+"ler"](){let t=r,n={VxvzL:function(i,c,u){return e[k(924)](i,c,u)},pULTK:function(i,c){return e[k(455)](i,c)}};if(e[t(343)](e.lTezq,e.lTezq))Promise.resolve().then(()=>{let i=t;this[i(1765)+i(1536)]()});else{let i=EXhLSS.VxvzL(_0xeaeec4,_0x297896,_0xff4c91);return _0x5e36fb[t(1663)].subarray(i,EXhLSS.pULTK(i,_0x5c1ac5))}}[r(444)+"ocketFai"+r(597)](t){let n=r;Promise.resolve()[n(985)](()=>{let i=n;if(e[i(1343)](e[i(594)],e[i(594)])){let c=_0x397cc1[i(1740)][i(470)];c&&_0x2675f8.setCursors(c)}else{let c=e[i(1650)](ue,e[i(984)],{message:this[i(439)+i(1894)+"age"](t)});this[i(339)](e.currj,c);let u=e.FDqHG(pe,e[i(930)],{reason:this[i(439)+"rrorMess"+i(1834)](t)});this[i(339)](e[i(930)],u)}})}["_addWsLi"+r(1536)](){let t=r,n={augJH:function(i,c){return i===c},FrGtp:e[t(1260)],aTRNd:e[t(1885)],cBtHM:e.xlEja,PrnHR:function(i,c,u){return e[t(1861)](i,c,u)},BVHap:t(1740)};this[t(489)][t(975)](i=>{let c=t,u={dYBKA:c(1297)};if(n[c(850)](n[c(1686)],n[c(571)])){let h=this[c(1815)+"tManager"]?.[c(1096)+c(1210)+"nt"]();this[c(449)+c(1586)+c(486)](_0x29bde8(u.dYBKA,{code:1006,reason:c(1322)+h+(c(991)+c(1601)+"tries re"+c(660)),wasClean:!0}))}else this[c(339)](n[c(349)],n[c(807)](os,c(1305),{...i,data:i.errMsg||""}))}),this[t(489)][t(1053)](i=>{let c=t;this.emit(c(1297),pe(c(1297),{...i}))}),this._socket[t(1498)+"e"](i=>{let c=t;this[c(339)](n[c(1029)],is("message",{...i}))}),this[t(489)][t(1168)](i=>{let c=t;this[c(339)](e[c(984)],e.JvbVn(ue,e[c(984)],{...i,message:i[c(645)]||""}))})}send(t){let n=r;if(e.KYOfA(t,Uint8Array)){let i=t[n(1346)][n(749)](t[n(1083)+"et"],e[n(1901)](t.byteLength,t[n(1083)+"et"]));this[n(489)]&&this._socket.send({data:i,fail:c=>{let u=n;this[u(339)](u(1033),e[u(1393)](ue,e[u(984)],{message:this[u(439)+u(1894)+u(1834)](c)}))}})}else this._socket&&this[n(489)][n(1790)]({data:t,fail:i=>{let c=n;this[c(339)](e[c(984)],e[c(944)](ue,"error",{message:this[c(439)+c(1894)+c(1834)](i)}))}})}close(t,n){this[r(489)]&&this._socket.close({code:t,reason:n})}[r(672)+r(1268)](t,n){let i=r;i(550)!==i(899)?this.on(t,n):(_0x1f421c(this[i(1626)+i(1e3)+i(410)]),this[i(1626)+i(1e3)+i(410)]=null)}["removeEv"+r(1091)+r(1537)](t,n){let i=r;e[i(1494)](e[i(1073)],e[i(353)])?(_0x19f412(_0x452f0a,16),_0x1e3d64(_0xd9ba4f,_0x3d57f5)):this[i(454)](t,n)}get readyState(){let t=r;return this[t(489)][t(792)+"te"]}get[r(652)+"pe"](){return this[r(489)].binaryType}set[r(652)+"pe"](t){}get[r(1036)](){let t=r,n={jRJYR:function(i,c,u){return e[k(1197)](i,c,u)}};if(e[t(1682)]===e[t(1674)]){let i=jkMSuG.jRJYR(_0x1556d6,_0x334b7f,_0x257a6c[t(398)]);_0x4dd803[t(1663)][t(1216)](_0x13f08b,i)}else return this[t(489)].url}get protocol(){let t=r;return this._socket[t(1457)]}get[r(440)+"ns"](){return this[r(489)].extensions}get[r(1232)+r(744)](){return 0}}function Qo(s,t){let n=r;if(t)return new t(s[n(1036)],s[n(1457)]);if(e[n(1386)](bt,We))return new Yo(s[n(1036)],s.protocol,s[n(1246)]);if((it||vt)&&e[n(1637)](n(1172)+"d",typeof WebSocket)&&WebSocket)return new WebSocket(s[n(1036)],s[n(1457)+"s"])}function $o(s){let t=r;if(e.anVEF(e[t(1913)],t(1838))){let n=e[t(1769)][t(804)]("|"),i=0;for(;;){switch(n[i++]){case"0":_0x501b9e=e[t(497)](_0x37056f,0,_0x1b04db,_0x3a08f7);continue;case"1":_0x328ff4.log(e[t(1433)],_0xc26876);continue;case"2":_0x30536e[t(1087)](e[t(1644)],_0x264840,_0x400ac4[t(512)]);continue;case"3":_0x74417b.log(e[t(443)],_0x1d2494);continue;case"4":_0x30175d=_0x15b241(_0x47878c["cursor_n"+t(1743)],_0xfe2464,_0x2f206a);continue;case"5":_0x3d304e=e.QKWvq(_0xfbe8d9,_0x50426.fromNumber(_0x4c3874[t(498)]||_0x7bfd7a),_0x4606fc,_0x90374d);continue;case"6":_0x79abec=e[t(1103)](_0x117b9c,_0x4835be,_0x23ab84,_0x54dc21.service||0);continue;case"7":_0x3583=e.QKWvq(_0x39f3dd,_0x3ce0cd[_0x37162d["cursor_n"+t(1743)]],_0x240b9f,_0x7a6ad8);continue;case"8":_0x357248.log(e[t(447)],_0x3f2839);continue;case"9":_0x359926[t(1087)](e.qnrWS,_0x31bb11);continue;case"10":_0x1a6cb8[t(1087)](e[t(628)],_0x1b9707);continue}break}}else{let n=e[t(1106)][t(804)]("|"),i=0;for(;;){switch(n[i++]){case"0":if(We&&tt[t(572)+t(636)])return!0;continue;case"1":if((it||vt)&&e.nKWro(e[t(710)],typeof WebSocket)&&WebSocket)return!0;continue;case"2":if(s)return!0;continue;case"3":return!1;case"4":if(bt&&wx[t(572)+t(636)])return!0;continue}break}}}function xs(s,t,n){let i=-1;async function c(u){let h=k;return e.kTPdd(u,i)?Promise[h(845)](new Error(e[h(1634)])):(i=u,e[h(1509)](u,n[h(398)])?Promise[h(1692)]():n[u].bind(s)(t,c[h(490)](null,e.RmWwU(u,1))))}e.cgyYz(c,0)}function cs(s){let t=r,n=0,i=0;for(let c=0;e[t(1353)](c,s[t(398)]);++c)if(i=s[t(362)+"At"](c),e[t(1194)](i,128))n+=1;else if(i<2048)n+=2;else if((64512&i)===55296&&e[t(868)](e[t(1341)](64512,s.charCodeAt(e[t(1070)](c,1))),56320))if(e[t(1489)]==="vVTKt")++c,n+=4;else return(e[t(1134)](_0x332d4a,4)[t(900)]("0")+e[t(1095)](_0x56bff7,_0x7c1ba,2)[t(871)](16))[t(749)](-4);else n+=3;return n}function fs(s,t,n){let i=r;if(e[i(1483)](n-t,1))return"";let c="";for(let u=t;e[i(1773)](u,n);){let h=s[u++];if(e[i(563)](h,127))c+=String.fromCharCode(h);else if(e[i(1296)](h,192)&&e.cFXFq(h,224))c+=String.fromCharCode(e[i(546)](e.fqfLd(e[i(1400)](31,h),6),e[i(770)](63,s[u++])));else if(h>=224&&h<240)c+=String[i(851)+i(397)](e[i(1480)](e[i(1157)](15,h)<<12,(63&s[u++])<<6)|e.mJhgj(63,s[u++]));else if(e[i(1350)](h,240)){let m=e.XgeXX(e[i(359)](e[i(1435)](e[i(1371)](7,h)<<18|e[i(1239)](63,s[u++])<<12,e[i(813)](e[i(367)](63,s[u++]),6)),e[i(1845)](63,s[u++])),65536);c+=String[i(851)+i(397)](e.AxRZk(55296,e[i(578)](m,10))),c+=String[i(851)+"Code"](e[i(531)](56320,1023&m))}}return c}function Vn(s,t,n){let i=r;if(e[i(408)]!==e[i(408)])return _0x419b16[i(607)]>=_0x54d7f2[i(1497)];{let c=n,u,h;for(let m=0;e[i(1683)](m,s[i(398)]);++m){if(e[i(1288)](i(1140),e[i(1600)]))return i(1176)+"_"+this[i(824)];if(u=s[i(362)+"At"](m),e[i(559)](u,128))t[n++]=u;else if(u<2048)t[n++]=e.nreul(e[i(1849)](u,6),192),t[n++]=e[i(1015)](e[i(560)](63,u),128);else if(e[i(941)](e[i(1273)](64512,u),55296)&&e[i(1211)](64512,h=s.charCodeAt(e.xIJWY(m,1)))===56320){let l=e[i(384)][i(804)]("|"),b=0;for(;;){switch(l[b++]){case"0":u=e[i(1786)](65536,e[i(1474)](e[i(1481)](1023,u),10))+(1023&h);continue;case"1":t[n++]=e[i(393)](e[i(889)](u,6),63)|128;continue;case"2":t[n++]=e[i(1402)](e[i(1808)](e[i(1810)](u,12),63),128);continue;case"3":t[n++]=e.TkEyb(63,u)|128;continue;case"4":++m;continue;case"5":t[n++]=e[i(777)](e[i(1285)](u,18),240);continue}break}}else t[n++]=u>>12|224,t[n++]=e[i(777)](e[i(1735)](e[i(509)](u,6),63),128),t[n++]=e[i(1189)](e[i(1526)](63,u),128)}return n-c}}async function us(s){let t=r;if(e[t(1527)](t(1908),typeof s)){let n=new Uint8Array(e[t(828)](cs,s));return Vn(s,n,0),n}return s instanceof ArrayBuffer?new Uint8Array(s):new Uint8Array(s[t(1346)],s.byteOffset,s[t(1660)+"th"])}function Zo(s){let t=r;if(e.DQrkd(e.YPGpQ,e[t(1344)])){let n=this._qosDB[t(344)+t(1337)](this[t(897)]),i=_0x78094e[t(979)](e[t(644)](n,"{}"));return i[_0x249fa7||_0x319fdb[this[t(1300)]]]=_0x37ca54,this[t(1501)]["setStora"+t(1337)](this[t(897)],_0x127280[t(1224)+"y"](i)),_0x231779||_0x488b4f[this._pathKey]}else try{return e.PIMHn!=typeof s&&(e[t(1739)](s,ArrayBuffer)||s.buffer&&e.rjNVM(s[t(1346)],ArrayBuffer))||e.lZPHC(e[t(479)],typeof s)?"":(JSON[t(979)](s),e[t(422)])}catch{return e[t(1527)](e.PIMHn,typeof s)?t(1257)+t(464)+t(1116):""}}let e0=(s,t)=>{let n=r;if(e[n(736)]===e[n(1757)]){let i=_0xc35d5a[_0x160e1c++];if(e[n(563)](i,127))_0x293b30+=_0x560e3f[n(851)+n(397)](i);else if(e[n(1185)](i,192)&&e[n(1741)](i,224))_0x29ff41+=_0x551126["fromChar"+n(397)](e[n(1065)](e[n(1850)](e.aqqTl(31,i),6),e[n(1319)](63,_0x4044ae[_0x28725d++])));else if(e[n(1067)](i,224)&&e[n(341)](i,240))_0x1994b4+=_0x285c87[n(851)+"Code"](e[n(359)](e[n(1086)](e[n(1511)](15,i),12),e[n(852)](e[n(598)](63,_0x50e2f9[_0x276656++]),6))|e[n(1211)](63,_0x317d21[_0x1b204++]));else if(e[n(1350)](i,240)){let c=e[n(1015)](e[n(722)](e[n(1574)](e[n(706)](7&i,18),e[n(491)](e.DFWYJ(63,_0x129b23[_0xc0be63++]),12)),e.fqpzv(e[n(477)](63,_0x4a164e[_0x52be30++]),6)),63&_0x559d0a[_0x5a81b5++])-65536;_0x27a201+=_0x147803[n(851)+n(397)](e[n(630)](55296,e.tAzFa(c,10))),_0x30f2f5+=_0x29c9af["fromChar"+n(397)](e.qOLQH(56320,1023&c))}}else switch(s){case e.XqaVX:case n(1513):return{[n(721)+s]:1,"x-tt-env":t};default:return{}}};class t0{constructor(t){let n=r;this[n(574)+n(753)]=t,this.count=0}[r(870)](){let t=r;if(e[t(1524)](e[t(1905)],e[t(1905)]))return _0x52029d||(_0x296d25=_0x36f989[t(1692)]()[t(985)](_0x2f01f3[t(490)](_0x2aa29b,t(1004)))),_0x33216a;this[t(1325)]++}[r(1149)+r(379)+"nt"](){let t=r;return e[t(620)](this[t(1325)],this[t(574)+t(753)])}[r(963)+r(1200)](t=0){let n=r;this[n(574)+n(753)]=t,this.count=0}}async function n0(s){let t=r,n={qFQxa:function(i,c){return i||c},BiwCq:function(i,c){return e[k(854)](i,c)},tMKLr:function(i,c){return e[k(1511)](i,c)},Bmtwt:function(i,c){return i|c},MMdWz:e[t(423)],CKiZa:function(i,c){return i!==c},WFJAh:e[t(1307)],IAuAL:"WdXMT",yQupd:e[t(1855)],QlWQv:"text/javascript",vppYt:function(i,c){return e[t(858)](i,c)},VqRIV:e.GvyoB,irUyk:function(i,c){return e[t(357)](i,c)},bAOTL:e[t(799)],abrlQ:function(i,c){return e[t(1788)](i,c)}};return new Promise(i=>{let c=t,u={GACdm:n[c(1045)]};if(!it)return i(n[c(1045)]);try{if(n[c(1761)](n[c(467)],n[c(865)])){let h=document[c(971)+c(482)](n[c(943)]);window["frontier"+c(1642)]=m=>{let l=c;document[l(1717)]["removeCh"+l(1230)](h),window[l(1176)+l(1642)]=void 0,i(m&&m[l(948)]||u[l(995)])},h[c(1155)]=n[c(823)],h[c(774)]=n[c(785)](s.replace(/^ws/,c(1370)),n[c(1649)]);try{document.body[c(1334)+c(1230)](h)}catch{if(n[c(1630)](n[c(331)],"ZVWsL"))document.body[c(1242)+c(1230)](h);else{let m=this[c(1501)][c(344)+c(1337)](this[c(897)]),l=_0x15f515[c(979)](n[c(920)](m,"{}"));return l[_0x5d9b7d]=void 0,this[c(1501)].setStorageSync(this[c(897)],_0x20c6d2[c(1224)+"y"](l))}}}else _0x205173[_0x3f0f8e++]=_0x585906>>12|224,_0x3f7284[_0x512320++]=IKWvTB.BiwCq(IKWvTB[c(1590)](_0x5485e3>>6,63),128),_0x14f1db[_0x1d1d9d++]=IKWvTB[c(1465)](IKWvTB[c(1590)](63,_0x5c89df),128)}catch{window[c(1176)+c(1642)]=void 0,n[c(411)](i,c(1060)+c(793))}})}function qe(s,t,n){let i=r;return!!s?.find(c=>c[i(465)]===t&&c[i(1375)]===n)}function ot(s,t){let n=r;if(e[n(1281)](e[n(1110)],e[n(1110)]))return s?.[n(1628)](i=>i[n(465)]===t)?.[n(1375)];if(this[n(527)]&&e[n(1311)](this._ws[n(792)+"te"],this[n(1796)+"NG"])){this["_clearPi"+n(1072)](),this[n(1283)+n(1662)+"Id"]=_0x54e43d(this[n(1559)].bind(this),this[n(895)][n(1320)+"rval"]);return}if(!this[n(527)]||this[n(527)][n(792)+"te"]!==this[n(1233)])return void this[n(1714)+n(1094)]();this[n(527)]&&this[n(527)].send("hi"),this[n(1830)+n(1622)+n(524)]=e[n(1492)](_0x18a267,this[n(1714)+n(1094)+"Timeout"][n(490)](this),this._options[n(365)+n(1081)+n(780)])}let Yn=null;async function r0(){let s=r;return Yn||(Yn=Promise[s(1692)]()[s(985)](Se.bind(Se,e[s(1269)]))),Yn}class s0 extends Xn{constructor(t,n){let i=r;super(),this[i(801)]=t,this._keyPath=n,this[i(1501)]=void 0,this["_initPro"+i(976)]=null}async[r(1109)](){await this[r(860)]()}async[r(860)](){let t=r,n={TPSOn:function(i,c,u,h){return e.yRGtE(i,c,u,h)}};if(!this[t(1501)]){if(this._initPromise)return this[t(1771)+"mise"];try{let i=this[t(801)],c=this[t(1304)];this[t(1771)+"mise"]=(async()=>{let u=t,{openDB:h}=await r0();this[u(1501)]=await n[u(960)](h,u(1176)+"_"+i,1,{upgrade(m){m[u(1127)+"jectStore"](i,{keyPath:c})}})})(),await this["_initPro"+t(976)]}catch(i){console[t(1087)](i)}finally{this[t(1771)+t(976)]=null}}}async[r(964)](t){let n=r;try{return await this[n(860)](),this[n(1501)]?.[n(964)](this[n(801)],t)}catch(i){console[n(1087)](i)}}async[r(1216)](t,n){let i=r;return await this._init(),this[i(1501)]?.[i(1532)](this._dbName,t)}async del(t){let n=r;try{if(e[n(1912)](e[n(880)],n(329)))return await this[n(860)](),this[n(1501)]?.delete(this[n(801)],t);e.MzFVk(_0x34a296,_0x2ff6ac,8),_0x1b492c(_0xe22110,_0x4ad8aa)}catch(i){console[n(1087)](i)}}async clear(){let t=r,n={iyBXV:function(i,c){return e.TsZYH(i,c)}};try{return await this._init(),this[t(1501)]?.clear(this[t(801)])}catch(i){if(e.PNWld(e[t(1593)],t(977))){let c=this[t(1501)]["getStora"+t(882)+"nc"](this[t(897)]),u=_0x5998be[t(979)](n[t(452)](c,"{}"));return _0xe80ade[t(757)](u)}else console[t(1087)](i)}}async keys(){let t=r;return await this[t(860)](),this[t(1501)]?.[t(399)+"ys"](this[t(801)])}async[r(1779)](){let t=r;return await this[t(860)](),this._qosDB?.[t(1779)](this[t(801)])}async[r(1395)](){let t=r;if(e[t(378)]("ulWfC",t(803)))this.emit(e.currj,_0x341170),this.onerror&&this[t(624)](_0x2cb432);else try{this[t(1501)]?.[t(1297)](),this._qosDB=void 0}catch(n){console[t(1087)](n)}}get isReady(){let t=r;try{return!!this._qosDB}catch(n){return console[t(1087)](n),!1}}}class i0{constructor(t,n){let i=r;this[i(824)]=t,this[i(1300)]=n,this[i(1501)]=localStorage}async[r(1109)](){}get _prefix(){let t=r;return t(1176)+"_"+this[t(824)]}async get(t){let n=r,i=this[n(1501)][n(843)](this._prefix);return JSON[n(979)](e.XQYGZ(i,"{}"))[t]}async[r(1216)](t,n){let i=r,c=this._qosDB[i(843)](this[i(897)]),u=JSON[i(979)](e[i(665)](c,"{}"));return u[n||t[this._pathKey]]=t,this[i(1501)][i(1647)](this[i(897)],JSON[i(1224)+"y"](u)),n||t[this[i(1300)]]}async del(t){let n=r,i=this._qosDB[n(843)](this._prefix),c=JSON[n(979)](e[n(665)](i,"{}"));return c[t]=void 0,this[n(1501)].setItem(this[n(897)],JSON.stringify(c))}async[r(679)](){let t=r,n={bCHPw:function(i,c){return e[k(602)](i,c)},Xazbs:function(i,c){return e[k(361)](i,c)},RNwvx:e.NMavs,wMKdj:e[t(1652)]};if(e[t(1144)](e[t(669)],e[t(1873)]))return this[t(1501)].clear();{let i=_0x3de718[t(804)](/\./)[t(1019)](h=>_0x1ceca2(h)),c=[];return c[0]=rjTMnO[t(1781)](_0x3d1e7e,rjTMnO.Xazbs(i[0],i[1])),c[1]=_0x19941f(rjTMnO[t(906)](i[2],i[3])),[rjTMnO[t(832)],rjTMnO[t(832)],rjTMnO[t(832)],t(448),rjTMnO[t(832)],rjTMnO.wMKdj,c[0],c[1]].join("")}}async[r(757)](){let t=r,n=this._qosDB[t(843)](this[t(897)]),i=JSON[t(979)](n||"{}");return Object[t(757)](i)}async[r(1779)](){let t=r,n=this[t(1501)][t(843)](this[t(897)]),i=JSON.parse(n||"{}");return Object[t(556)](i)}[r(1395)](){return Promise[r(1692)]()}get[r(1240)](){return!!this._qosDB}}class o0{constructor(t,n){let i=r;this._DBName=t,this[i(1300)]=n,this[i(1501)]=We?tt:bt?wx:null}async openDB(){}get[r(897)](){let t=r;return t(1176)+"_"+this[t(824)]}async[r(964)](t){let n=r,i=this._qosDB[n(344)+n(1337)](this._prefix);return JSON.parse(e[n(861)](i,"{}"))[t]}async set(t,n){let i=r,c=this[i(1501)]["getStora"+i(1337)](this._prefix),u=JSON[i(979)](e.sqCzk(c,"{}"));return u[n||t[this[i(1300)]]]=t,this[i(1501)][i(1522)+i(1337)](this[i(897)],JSON[i(1224)+"y"](u)),n||t[this[i(1300)]]}async del(t){let n=r,i=this[n(1501)][n(344)+n(1337)](this[n(897)]),c=JSON[n(979)](e[n(665)](i,"{}"));return c[t]=void 0,this[n(1501)]["setStora"+n(1337)](this[n(897)],JSON[n(1224)+"y"](c))}async[r(679)](){let t=r;return this[t(1501)][t(1742)+t(1496)]()}async keys(){let t=r,n=this[t(1501)][t(344)+t(882)+"nc"](this[t(897)]),i=JSON[t(979)](e[t(1386)](n,"{}"));return Object.keys(i)}async[r(1779)](){let t=r;if(e[t(1253)](t(374),e[t(535)]))return this[t(489)][t(652)+"pe"];{let n=this._qosDB["getStora"+t(882)+"nc"](this[t(897)]),i=JSON[t(979)](n||"{}");return Object[t(556)](i)}}[r(1395)](){let t=r,n={hGHrJ:function(i,c){return i instanceof c}};if(e[t(517)]!==e[t(517)])RXlmAF.hGHrJ(_0x1f6040,_0x187505)&&_0x5df500[t(1216)](_0x321e22,_0x231239);else return Promise[t(1692)]()}get isReady(){return!!this[r(1501)]}}function ds(s,t){let n=r;if(e[n(665)](We,We))return new o0(s,t);if(e.dciOu(it,vt)&&e[n(710)]!=typeof indexedDB)return new s0(s,t);if(e.dmXkU(it,vt)&&e[n(1637)](e[n(710)],typeof localStorage))return new i0(s,t);throw new Error(e[n(805)])}class a0{constructor(){let t=r;this["_interva"+t(657)+"Id"]=null,this._interval=36e5,this[t(1501)]=e[t(377)](ds,e[t(1008)],e[t(1794)])}async[r(1085)+r(1407)](){let t=r,n={ldqNR:function(i,c,u){return e[k(1620)](i,c,u)},aoWbh:function(i,c){return e[k(1119)](i,c)}};e.Abjcd(e.ZTJXc,e.ZTJXc)?(e[t(1629)](clearInterval,this[t(1085)+"lTimeoutId"]),this[t(1085)+t(657)+"Id"]=e[t(481)](setInterval,()=>{this["flushExp"+t(573)]()},this[t(1085)+"l"])):(_0x39ca7d-=65536,_0x144b1c+=jSnKGd[t(1324)](_0x53c8e9,(_0x2fe5ed>>10)+55296,jSnKGd[t(1424)](1023,_0x3a09c4)+56320),_0x7c5da8+=3)}async[r(1109)](){let t=r,n={zCPDQ:function(i,c){return e[k(1488)](i,c)},dvAfO:e.MiLkB};await this[t(1501)][t(1109)]()[t(985)](()=>{let i=t;if(n[i(1477)](n.dvAfO,n[i(1009)]))this[i(1085)+i(1407)]();else return new _0x14c1d5(_0x148e82,{message:_0x12e671,code:_0xfb0b79,error:_0x2ef426})})}async[r(1003)+r(573)](){let t=r;(await this[t(1501)]?.[t(1779)]()||[])[t(689)](({timestamp:c})=>c<Date[t(1654)]())[t(1041)](c=>{let u=t;this[u(1501)]?.[u(1722)](c[u(395)+"id"])})}async[r(1722)](t){let n=r;return this[n(1501)]?.[n(1722)](t)}async[r(1216)](t,n){let i=r;return this[i(1501)]?.[i(1216)]({message_id:t,timestamp:n})}async[r(964)](t){let n=r;return this._qosDB?.[n(964)](t)}async[r(1395)](){let t=r;e[t(1056)](clearInterval,this[t(1085)+t(657)+"Id"]),await this._qosDB?.[t(1395)]()}get[r(1240)](){let t=r;return this[t(1501)]?.[t(1240)]}}function Qn(s){let t=r,n=!!this[t(895)].enableQoS;if(!n)return{enabled:n,isQoSMessage:!1,isQoSAck:!1,isAckCleanupMessage:!1,ackMsgIds:[]};let i=qe(s[t(1740)][t(1246)],e[t(1558)],"2"),c=i&&e[t(504)](qe,s[t(1740)][t(1246)],e[t(1635)],"1"),u=i&&e.FIFmu(qe,s[t(1740)].headers,t(914)+t(1575)+"k","1"),h=u?e[t(1299)](ot,s[t(1740)][t(1246)],e[t(1777)])?.split(",")[t(689)](Boolean)||[]:[];return{enabled:n,isQoSMessage:i,isQoSAck:c,isAckCleanupMessage:u,ackMsgIds:h}}async function ls(){let s=r;return this[s(1732)+"ger"]||(this[s(1732)+s(1853)]=new a0),this["_QoSMana"+s(1853)][s(1240)]||await this._QoSManager[s(1109)](),this["_QoSMana"+s(1853)]}async function x0(s,t){let n=r,{enableAutoAck:i}=this[n(895)],c=qe(s.message[n(1246)],e[n(1306)],"1"),u=qe(s[n(1740)][n(1246)],e[n(1734)],"1"),h=Qn[n(683)](this,s);if(e[n(837)](i,c)){let{SeqID:m,LogID:l,service:b,LogIDNew:v,method:C}=s.message;this._sendAck({SeqID:m,LogID:l,LogIDNew:v,service:b,method:C,headers:[{key:e[n(1734)],value:"1"},{key:e[n(1623)],value:e[n(644)](v,"")},{key:n(1209),value:"0"}]})}u&&!h[n(1384)]&&this[n(449)+n(1561)+n(1222)](s),e.pcuWV(t)}async function c0(s,t){let n=r;this[n(537)](e[n(748)],s[n(1740)]),e[n(1054)](t)}async function f0(s,t){let n=r;if(e.vCpDU!==e[n(1440)]){if(e[n(582)](_0x52470a,_0x1d4b17))throw new _0x4af684(e[n(1267)]);let i=3;for(;e[n(1817)](i,0);){let c=e[n(1581)](255,_0x47c636);e[n(1515)](_0x345615,c,_0x4ca297,e.RKFwJ(_0x13eea7,i)),_0x9c4aa8>>>=8,i--}return _0x5846ce+4}else{let i=e[n(619)](Xr,await e[n(1206)](us,s[n(1471)]));try{if(e[n(1739)](i[n(470)],Uint8Array))if(e[n(884)](e[n(1025)],e[n(1138)])){let c=this[n(1815)+n(695)]?.[n(1096)+n(1210)+"nt"]();this[n(537)](n(1467)+c),_0x1a1d17()}else{let c=e[n(1510)](this[n(895)]["payloadE"+n(1746)],Object)?{force:!!this[n(895)][n(1152)+n(1746)].force,encoding:this[n(895)][n(1152)+n(1746)][n(835)]?this[n(895)][n(1152)+n(1746)][n(835)][n(743)](/\s/g,"")[n(937)+n(475)]():""}:{force:!1,encoding:this._options[n(1152)+n(1746)]?this._options[n(1152)+n(1746)][n(743)](/\s/g,"")[n(937)+n(475)]():""},u=i[n(1152)+n(1746)]?i[n(1152)+n(1746)][n(743)](/\s/g,"")[n(937)+n(475)]():"",h=this[n(895)][n(696)+"ype"]instanceof Object?{force:!!this._options["payloadT"+n(1347)][n(419)],type:this[n(895)][n(696)+n(1347)][n(1155)]?this[n(895)][n(696)+n(1347)].type[n(743)](/\s/g,"")[n(937)+n(475)]():""}:{force:!1,type:this._options[n(696)+"ype"]?this[n(895)][n(696)+n(1347)].replace(/\s/g,"")[n(937)+"ase"]():""},m=i.payloadType?i[n(696)+n(1347)][n(743)](/\s/g,"")[n(937)+n(475)]():"",l=h[n(419)]?h[n(1155)]:m||h[n(1155)],b=c[n(419)]?c[n(835)]:u||c[n(835)],v=[e[n(841)],e[n(422)],e[n(844)],n(1908)],C=[e.dSJex,e[n(1675)]];this[n(895)][n(1449)+n(451)+"extPayload"]&&v.includes(l)&&(!b||C[n(1241)](b))?i[n(1520)+n(1482)]=fs(i[n(470)],0,i[n(470)][n(1660)+"th"]):i[n(1520)+n(1482)]=""}else i["textPayl"+n(1482)]=""}catch(c){i["textPayl"+n(1482)]="",console[n(1087)](c)}s.message=i,e[n(1750)](t)}}function u0(s,t,n){let i=r,c=e.CYswF(n,8192),u=e[i(1716)](c,1),h=null,m=c;return function(l){let b=i;if(l<1||e.qsMLR(l,u))return s(l);m+l>c&&(h=e.cDNPU(s,c),m=0);let v=t[b(683)](h,m,m+=l);return e[b(617)](7,m)&&(m=e.RSrXP(7,m)+1),v}}let d0=4294967295;function l0(s,t,n){let i=r;return e[i(1039)](e.ahKzC,e[i(346)])?this[i(527)]?this._ws[i(652)+"pe"]:this[i(816)+i(1347)]:RangeError(e[i(812)](e[i(1090)](e[i(1729)](e.mUnkd(e[i(455)](e[i(685)],s),e[i(1205)]),e[i(1386)](t,1)),e[i(1899)]),n))}function h0(s,t,n){let i=r;if(e[i(881)](e.UQFtd,e[i(1609)]))this[i(449)+"hMessage"+i(521)](_0x46a56e),_0x59b847[i(1216)](_0xf5a3b5,_0x26c823,_0x1b90ab[i(1740)][i(512)]);else{if(e.qoplO(n,d0))throw new Error(e[i(1267)]);let c=3;for(;e[i(1212)](c,0);){let u=e.aiqxh(255,n);e[i(1326)](Zn,u,s,e.NfXix(t,c)),n>>>=8,c--}return t+4}}function g0(s,t){let n=r,i=0,c=t,u=e.nyFBh(t,4);for(;c<u;){let{value:h,offset:m}=$n(s,c);c=m,i=e[n(1551)](e[n(813)](i,8),0),i+=h}return{value:i,offset:u}}function p0(s,t,n){let i=r,c=(i(1700)+"1")[i(804)]("|"),u=0;for(;;){switch(c[u++]){case"0":if(t[i(485)])return e[i(1363)](t[i(485)](s,n),n);continue;case"1":return Vn(s,t,n)+n;case"2":if(!s)return n;continue;case"3":if(t[i(632)+"e"])return e[i(966)](t.utf8Write(s,n),n);continue;case"4":if(e[i(896)](s[i(398)],40))return e.NfXix(e.EIUhl(Vn,s,t,n),n);continue}break}}function m0(s,t){let n=r,i=new O(e[n(927)](e[n(1706)](s[t+4],24)|e[n(1542)](s[e[n(1313)](t,5)],16)|e[n(1474)](s[t+6],8),s[t+7]),e[n(1435)](e[n(815)](e[n(1538)](e[n(813)](s[e[n(1196)](t,0)],24),e[n(682)](s[t+1],16)),s[t+2]<<8),s[e[n(1842)](t,3)]),!0);return t+=8,{value:i,offset:e[n(1259)](t,8)}}function _0(s,t,n){let i=r,c=s[i(420)],u=s[i(1504)];return t[n]=e[i(1249)](u,24),t[e[i(1416)](n,1)]=e.GWMMa(u,16)&255,t[e[i(681)](n,2)]=e[i(1048)](e.EqOrJ(u,8),255),t[n+3]=e.IpZIb(255,u),t[e[i(947)](n,4)]=c>>>24,t[n+5]=e[i(703)](e.AxtID(c,16),255),t[n+6]=e.nYSdw(e[i(797)](c,8),255),t[e[i(455)](n,7)]=255&c,n+=8,n}function $n(s,t){let n=r;if(e.fgMCq("JtizL",n(1580)))return s[n(1668)+"8"]?{value:s.readUInt8(t),offset:t+1}:{value:e[n(770)](255,s[t]),offset:e[n(1519)](t,1)};if(e[n(626)](e[n(1705)](_0x696a93[n(607)],_0x2db2bb),_0xd4b97c[n(1497)]))throw new _0x49b9bf(e[n(712)]);_0x336289[n(607)]+=_0xbc52bf}function Zn(s,t,n){let i=r,c={VunGu:function(u,h){return e.iYJCv(u,h)},EzHlQ:function(u,h){return e[k(1192)](u,h)},Kkbgy:e.mgBuY,MScIb:i(1616)+i(1229)+"d"};if(e[i(661)](e[i(570)],i(726))){if(DadpQy[i(1666)](_0x46b9bb,_0x5aaa30))return new _0x2efc1b(_0x647f96,_0x5e9078);if(DadpQy[i(1666)](_0x10c789,_0x46c630)&&DadpQy.EzHlQ(DadpQy.Kkbgy,typeof _0x4d9124))return new _0x22bd1a(_0x12fffb,_0x259c28);if(DadpQy[i(1666)](_0x598f4e,_0x54dbb5)&&DadpQy[i(1066)](DadpQy[i(1701)],typeof _0x28b566))return new _0x535f56(_0x3bda34,_0x43d04e);throw new _0x1ac747(DadpQy.MScIb)}else return t[i(1606)+"t8"]?t[i(1606)+"t8"](s,n):t[n]=e.MJXei(255,s),n+1}let w0=function(s){return new Uint8Array(s)},y0=e[r(1568)](e[r(710)],typeof Buffer)?Buffer[r(1866)+"afe"]:e[r(577)](u0,w0,Uint8Array[r(934)+"e"][r(795)]);(()=>{let s=r,t={UXtHF:function(n,i){return n|i},gsGhj:function(n,i){return e[k(1778)](n,i)},WnlYe:function(n,i){return e[k(758)](n,i)},dwLdp:function(n,i){return e[k(1822)](n,i)},UzZpK:function(n,i){return e[k(350)](n,i)},HoSYu:function(n,i){return e.WQbXM(n,i)},CNcma:function(n,i){return e[k(495)](n,i)},mMJxl:function(n,i,c){return n(i,c)},sQVsA:function(n,i){return n+i},bvKNt:function(n,i){return e.RmXEf(n,i)},bcBGD:function(n,i){return e.ajCgH(n,i)},bFDgk:e[s(445)],XgdHO:e[s(737)],qAkPV:e[s(992)],JhjYm:function(n,i){return e[s(840)](n,i)},SUVYe:function(n,i){return e[s(1581)](n,i)},BVAcU:function(n,i){return e[s(1818)](n,i)},yEoQW:function(n,i){return e[s(1419)](n,i)},rhtxL:function(n,i){return e[s(1133)](n,i)},TKIBa:function(n,i){return n<<i},NabVm:function(n,i){return e[s(1150)](n,i)},PyBcn:function(n,i){return e[s(1408)](n,i)},MPGSk:function(n,i){return e.zbugm(n,i)},rvWIE:function(n,i){return e[s(1474)](n,i)},hvrQF:function(n,i){return e[s(1780)](n,i)},ElYbm:function(n,i){return e.zbrNH(n,i)},rnPrx:function(n,i){return n&i},jjfyL:function(n,i){return n<<i},zLnRJ:function(n,i){return n!==i},rNnWu:e[s(1658)],Osyoc:function(n,i,c,u){return e[s(426)](n,i,c,u)}};if(e[s(1912)](e[s(1531)],e[s(1531)])){let n=4294967295;return function(i,c,u=!0){let h=s,m={DTAKD:function(l,b,v){return l(b,v)},zcURF:t[h(1599)]};if(t[h(904)]!==t.qAkPV){if(n=t.JhjYm(t[h(1854)](127,i[c]),0),t[h(1336)](i[c++],128))return{value:u?n:t.yEoQW(0,n),offset:c};if(n=t[h(1464)](t[h(342)](n,t.TKIBa(t[h(1439)](127,i[c]),7)),0),t.BVAcU(i[c++],128))return{value:u?n:t[h(956)](0,n),offset:c};if(n=t[h(1047)](t.MPGSk(n,t[h(1451)](t[h(894)](127,i[c]),14)),0),t.ElYbm(i[c++],128))return{value:u?n:0|n,offset:c};if(n=t.PyBcn(t[h(342)](n,t[h(608)](127,i[c])<<21),0),t[h(1392)](i[c++],128))return{value:u?n:t[h(1505)](0,n),offset:c};if(n=t[h(1047)](n|t.jjfyL(15&i[c],28),0),t[h(1336)](i[c++],128))return{value:u?n:t[h(1603)](0,n),offset:c};if(t[h(1479)](c+=5,i[h(398)])){if(t[h(1618)](t[h(836)],h(1678)))throw c=i[h(398)],t[h(1180)](l0,c,10,i[h(398)]);{this[h(1388)+h(907)+"t"]();let l=m[h(366)](_0x1f1d85,h(1819)+"t",{message:m[h(1523)]});this[h(711)+h(1753)+h(731)+"ct"]&&this[h(711)+"mediatel"+h(731)+"ct"](l)}}return{value:u?n:t.UXtHF(0,n),offset:c}}else _0x584fda=kiJCaM[h(1802)](kiJCaM[h(1603)](kiJCaM[h(994)](7&_0x581d4f,18)|kiJCaM.WnlYe(63&_0x488300,12),kiJCaM.WnlYe(kiJCaM[h(1360)](63,_0x3567b0),6)),kiJCaM[h(1220)](63,_0xb2690d)),kiJCaM[h(1392)](_0x183831,65536)||kiJCaM.CNcma(_0x4be5b5,1114111)?_0x21f436+=_0x54015:(_0x5c1df6-=65536,_0x938ae6+=kiJCaM[h(500)](_0x292730,kiJCaM.sQVsA(_0x276256>>10,55296),kiJCaM[h(1333)](kiJCaM[h(476)](1023,_0x58f5a2),56320)),_0x5e949d+=3)}}else return e.eOUZd(_0x1ab3bc,_0x18b350)?_0x565016:new _0x222eaf(e[s(501)](e[s(463)](e.xyLkS(_0xf9a693[s(683)](_0x2ee8f4,0),_0x3ba135[s(683)](_0x60962b,1)<<8),_0x3d225c[s(683)](_0x20e8e4,2)<<16)|e[s(1516)](_0x4f416e[s(683)](_0x18b845,3),24),0),e.OvIPl(e[s(1574)](e[s(400)](_0x40de26[s(683)](_0x534c31,4)|e[s(1037)](_0x41732a[s(683)](_0x6d5925,5),8),_0x23db42[s(683)](_0x4e3b57,6)<<16),e.DnOhc(_0x5daa20[s(683)](_0x1d7c3a,7),24)),0),!0)})();let b0=16,er=32;function v0(s){let t=r,n=0,i={};for(let c=0;e[t(519)](c,s.length);c++)i[s[c]["cursor_n"+t(1743)]]=cs(s[c][t(762)+"ame"]),n+=e.RvRxn(14,i[s[c][t(762)+t(1743)]]);return[n,i]}function hs(s,t,n){let i=r,c={etuCI:function(b,v){return e[k(325)](b,v)},bUeEX:i(373)+i(986)+i(1843),gPvQO:e[i(1433)],BZSuY:function(b,v,C,P){return e[i(1823)](b,v,C,P)},ZMEnt:function(b,v,C,P){return e.PfTwe(b,v,C,P)},racir:e.crnip,NPcNb:"name",ToLiJ:"header",ZyjIo:function(b,v,C,P){return e[i(1108)](b,v,C,P)}},[u,h]=e.QTzZY(v0,s),m=y0(u),l=0;return s[i(1041)](b=>{let v=i;if(c.etuCI(v(1835),v(1835))){let C=_0x1eea5d.pop();return C?(C.offset=C[v(1497)]=0,C):{bytes:new _0x1bdfda(64),offset:0,limit:0}}else{let C=c[v(938)][v(804)]("|"),P=0;for(;;){switch(C[P++]){case"0":console[v(1087)](c[v(612)],l);continue;case"1":l=c[v(595)](_0,O[v(356)+"er"](b[v(498)]||t),m,l);continue;case"2":l=c[v(635)](Zn,0,m,l);continue;case"3":console[v(1087)](c.racir,l);continue;case"4":console[v(1087)](c[v(663)],l);continue;case"5":l=h0(m,l,b.service||0);continue;case"6":l=c.ZMEnt(p0,b[v(762)+v(1743)],m,l);continue;case"7":console[v(1087)](v(1115),l);continue;case"8":console.log(v(1450)+"ervice",b,b[v(512)]);continue;case"9":console[v(1087)](c[v(1833)],l);continue;case"10":l=c[v(723)](Zn,h[b[v(762)+v(1743)]],m,l);continue}break}}}),{frameType:er,headers:[{key:e.eMHJO,value:n}],payload:m}}function S0(s){let t=r,n=0,i=[];for(;e[t(1217)](n,s[t(1660)+"th"]);){let{offset:c}=e[t(1252)]($n,s,n);n=c;let u={cursor_name:"",cursor:0,service:0},{value:h,offset:m}=e[t(1770)](g0,s,n);u[t(512)]=h,n=m;let{value:l,offset:b}=e[t(1602)]($n,s,n);n=b,u[t(762)+t(1743)]=e[t(460)](fs,s,n,n+l),n+=l;let{value:v,offset:C}=e[t(577)](m0,s,n);u[t(498)]=v[t(1687)](),n=C,i[t(358)](u)}return i}function C0(){let s=r;return{frameType:er,headers:[{key:s(1247)+s(409),value:e[s(1730)]}],payload:void 0}}class E0{constructor(t,n,i){let c=r;this[c(1484)+c(961)]=t,this["_cursorF"+c(1848)]=n,this[c(1688)+"Strategy"]=i,this[c(1501)]=e.UGkFh(ds,this[c(1484)+"ameSpace"],e[c(543)])}async[r(1109)](){let t=r;await this[t(1501)][t(1109)]()}async[r(1514)+"rs"](){let t=r;if(!this[t(1501)].isReady)return;let n=this[t(1688)+t(717)],i=await this._qosDB[t(1779)]();switch(console.log(e.FdWsU,i),n){case"ALL":return i&&i.length?e[t(1403)](hs,i,0,this._cursorFileName):void 0;case e[t(1865)]:return;case e[t(1055)]:return i&&i[t(398)]?hs(i,0,this[t(1589)+t(1848)]):e[t(1026)](C0)}}async[r(1216)](t,n,i){let c=r;if(e[c(1011)]!==c(1878))return console[c(1087)](e.stgdR,t,n,i),this[c(1501)].set({cursor_name:t,cursor:n,service:i});_0x1ba726.log(_0x4e2dbb)}async setCursors(t){let n=r,i=e[n(638)](S0,t);for(let c of i)console.log(e.rPDzN,i),await this[n(1501)][n(1216)](c)}async[r(964)](t){let n=r;return(await this[n(1501)][n(964)](t))?.[n(498)]}async[r(1395)](){let t=r;await this[t(1501)][t(1395)]()}[r(691)+r(1458)+"Name"](t){let n=r;this[n(1589)+"ileName"]=t}get isReady(){let t=r;return this[t(1501)][t(1240)]}}let A0=r(1611)+"qos__";async function gs(s){let t=r;if(!this[t(895)][t(1338)+"S"])return null;let{aID:n,fpID:i,messageStrategy:c}=this[t(895)],u=e[t(644)](s,A0);try{return this[t(1075)+t(1776)]?s&&this[t(1075)+"anager"][t(691)+t(1458)+t(389)](s):this[t(1075)+t(1776)]=new E0(i+"_"+n+"_"+u,u,c),this["_cursorM"+t(1776)].isReady||await this[t(1075)+"anager"][t(1109)](),this[t(1075)+"anager"]}catch{return null}}async function k0(s,t){let n=r,i={yTqNk:n(335)+"0|1|5|10|8|11|9|2",kWQWP:function(c,u){return c|u},kPfnR:function(c,u){return c<<u},yWkJo:function(c,u){return c&u},irJUC:function(c,u){return e.OGzsa(c,u)},adwCw:function(c,u){return e.olbfa(c,u)},sTGLf:function(c,u){return c<u},rFxPT:function(c,u){return e[n(1119)](c,u)},ggQbn:function(c,u){return e[n(568)](c,u)},ZsENS:function(c,u){return c&u},jxQFo:function(c,u){return e[n(1169)](c,u)},VaWIt:function(c,u){return e[n(1556)](c,u)},ELfry:function(c,u){return e[n(1480)](c,u)},HAgcK:function(c,u){return e.axrWD(c,u)}};if(e[n(1689)](e[n(702)],e.sEJhU)){let c=e[n(1331)](qe,s[n(1740)][n(1246)],n(634),"-1"),u=qe(s[n(1740)][n(1246)],e[n(1734)],"1"),h=ot(s[n(1740)][n(1246)],e.AxKgC),m=Number(ot(s[n(1740)].headers,e[n(616)]))||0,l=Qn[n(683)](this,s),b=e[n(1331)](qe,s[n(1740)][n(1246)],e.DPrfT,"2"),v=ot(s[n(1740)][n(1246)],n(433)+n(754)+"e"),C=e[n(520)](Number,e.JvbVn(ot,s[n(1740)][n(1246)],n(433)+n(1470)+"ue"));if(l.isQoSAck)return e[n(345)](t);let P=l[n(1030)+"sage"]?await ls[n(683)](this):null;if(e[n(878)](s[n(1740)][n(512)],0)&&u&&!c||e[n(1820)](s[n(1740)][n(512)],0)){if(h&&l[n(1030)+"sage"]&&P)return!!!await P[n(964)](h)&&(this["_dispatchMessage"+n(521)](s),await P[n(1216)](h,e[n(1729)](Date[n(1654)](),m))),e[n(417)](t);if(b){let L=await gs[n(683)](this);if(!L)return this[n(449)+n(403)+"Event"](s),e[n(1026)](t);let I=await L.get(v)??-1;if(e.Surst(I,C))if(e[n(796)](e[n(437)],e[n(1351)]))this[n(449)+n(403)+n(521)](s),L[n(1216)](v,C,s[n(1740)][n(512)]);else return n(1908)==typeof _0x22d4cc?e[n(841)]:"";else throw new Error(n(354)+" message cursor "+C+(" larger "+n(1409)+n(746)+"r ")+I);return e[n(1608)](t)}return this["_dispatc"+n(403)+"Event"](s),e[n(417)](t)}}else{let c=i[n(1101)][n(804)]("|"),u=0;for(;;){switch(c[u++]){case"0":_0x3c6d26=kjFrSn.kWQWP(_0x3da201,kjFrSn.kPfnR(kjFrSn.yWkJo(127,_0x3599b4[_0x9f8342]),14))>>>0;continue;case"1":if(_0x5cc679[_0xc08a8++]<128)return{value:_0x5c5053?_0x22db94:kjFrSn.irJUC(0,_0x1dd228),offset:_0x3b01c5};continue;case"2":return{value:_0x1efc68?_0x34ed06:kjFrSn.adwCw(0,_0x1645c6),offset:_0x56ea0d};case"3":if(kjFrSn[n(1517)](_0x157559[_0x1846e2++],128))return{value:_0x112659?_0x232536:kjFrSn[n(1727)](0,_0x4271c8),offset:_0x1677d3};continue;case"4":if(_0x320107[_0x5f5872++]<128)return{value:_0x16c09d?_0x4ab232:kjFrSn[n(376)](0,_0x544731),offset:_0x267672};continue;case"5":_0x1b67f5=kjFrSn.irJUC(_0x2ddf7c,kjFrSn[n(1460)](127,_0x3bf366[_0xb43fbb])<<21)>>>0;continue;case"6":_0x3b6e34=kjFrSn[n(1605)](kjFrSn[n(431)](127,_0xf898c5[_0x3dd2e0]),0);continue;case"7":_0x4fa17b=kjFrSn.ggQbn(kjFrSn[n(1727)](_0x177c74,kjFrSn[n(1340)](kjFrSn[n(1059)](127,_0x7ae1a2[_0x15edf1]),7)),0);continue;case"8":_0x35db24=kjFrSn[n(1031)](_0x4b8d0e,(15&_0x404244[_0x249bd8])<<28)>>>0;continue;case"9":if(kjFrSn.VaWIt(_0x1f9a68+=5,_0x56e72f[n(398)]))throw _0x4652b3=_0x3c30a4[n(398)],_0xe28c51(_0x30561c,10,_0x354c65[n(398)]);continue;case"10":if(_0xbbc297[_0x113539++]<128)return{value:_0x45c669?_0x1e4086:kjFrSn[n(952)](0,_0x3dc5e2),offset:_0x5b6071};continue;case"11":if(_0x4b51f4[_0x4448ae++]<128)return{value:_0x5e2263?_0x59f536:kjFrSn[n(893)](0,_0x50a2dd),offset:_0x24b73f};continue}break}}}async function D0(s,t){let n=r,i=Qn[n(683)](this,s);if(!i["isQoSMes"+n(1607)])return t();let c=await ls[n(683)](this);if(i["isAckCle"+n(429)+n(1834)]&&i[n(1368)+"s"][n(398)])for(let u of i[n(1368)+"s"])await c.del(u);e[n(1723)](t)}async function P0(s,t){let n=r,i=e.anVEF(s[n(1740)].frameType,b0),c=e.imlHJ(s[n(1740)][n(1552)+"e"],er);if(e[n(837)](!i,!c))return e[n(1723)](t);let u=ot(s.message[n(1246)],e[n(396)]);if(!u)return t();let h=await gs.call(this,u);if(!h)return e[n(1054)](t);if(i){let m=await h[n(1514)+"rs"](),l={frameType:m?.[n(1552)+"e"],SeqID:O[n(356)+"er"](this._seqId++),LogID:O[n(356)+"er"](this[n(895)][n(864)+n(1069)]()),service:9e3,method:5,headers:m?.[n(1246)],payload:m?.[n(470)]},b=e[n(885)](A,l);this._ws&&this[n(527)][n(792)+"te"]&&this._ws.send(b)}if(c){let m=s[n(1740)][n(470)];m&&h.setCursors(m)}}let I0=async function(s,t){let n=r;this[n(1373)]=!1,clearTimeout(this[n(1626)+n(1e3)+n(410)]),t()},T0=async function(s,t){let n=r;if(!this[n(527)]||e.iaMDp(this._ws.readyState,this[n(1233)]))return e[n(551)](t);let{pingInterval:i}=this[n(895)];this[n(1815)+n(695)]?.[n(834)+"pointCon"+n(782)]();for(let u=0;u<this._messageQueue[n(398)];u++){let h=this[n(1688)+"Queue"][u];if(this[n(527)][n(792)+"te"]===this[n(1233)]&&e.PDNMS(null,h))e.KADQX("PHNxU",e[n(1454)])?this.count++:(this._ws&&this[n(527)][n(1790)](h),this[n(1688)+n(330)][u]=null);else break}this["_message"+n(330)]=this[n(1688)+"Queue"][n(689)](u=>!!u),this[n(1283)+"gTimeoutId"]=e[n(1904)](setTimeout,()=>this._ping(),i),this[n(449)+n(360)+"nt"](s),this[n(1447)+"er"]&&this[n(527)]&&(this._ws.binaryType=this[n(816)+n(1347)]);let c=this["_endpoin"+n(695)]?.[n(1096)+n(1210)+"nt"]();this[n(537)](n(1467)+c+n(957)),e.kjDWJ(t)},L0=async function(s,t){let n=r;if(e[n(1153)](e[n(402)],e[n(493)])){let i=this["_endpoin"+n(695)]?.[n(1096)+n(1210)+"nt"]();this[n(537)](n(1467)+i),e.qaZto(t)}else _0x23b03b=_0x354ac7[n(1824)](_0x3152d0),_0x1c8ef6=_0x51a53e.concat(_0x12efce[_0x430de2])};class N0 extends Xn{constructor(t){let n=r,i={DPLTH:function(c,u,h){return c(u,h)},ClCBd:function(c,u){return c===u},nOvYe:function(c,u){return e[k(1311)](c,u)},WwQxC:function(c,u){return e[k(676)](c,u)},AeEEb:e.etGju,qcLqj:e[n(1385)],TGPpS:function(c,u){return e[n(1007)](c,u)},ETqdu:e[n(1525)],bwEPA:function(c,u,h,m){return e.QKWvq(c,u,h,m)},NSMif:e[n(667)],jGLTQ:function(c,u){return c!==u},AmxQi:function(c,u,h){return e[n(1102)](c,u,h)},vfHwB:e[n(930)],XQnbp:function(c,u){return c(u)},SYJFW:e.currj,CVAwR:function(c,u,h){return e[n(1602)](c,u,h)}};if(e[n(1573)](e[n(1097)],e[n(394)])){super(),this[n(1420)+n(1563)+n(387)]=!0,this[n(1447)+"er"]=it,this._isNode=Vo,this._isMiniTT=We,this[n(1475)+"X"]=bt,this[n(1446)+"r"]=vt,this["_message"+n(330)]=[],this["_endpoin"+n(695)]=null,this[n(741)+n(438)]=!1,this[n(816)+n(1347)]=e[n(1362)],this[n(1626)+n(1614)]=!1,this[n(1626)+"ionTimeo"+n(410)]=null,this[n(1830)+n(1622)+n(524)]=null,this["_pingPon"+n(1662)+"Id"]=null,this._seqId=0,this._isInit=!1,this[n(690)]="",this[n(1732)+n(1853)]=null,this["_cursorM"+n(1776)]=null,this[n(959)+n(1261)]=null,this._protocols=n(1801),this[n(478)]=3,this[n(1796)+"NG"]=0,this[n(1233)]=1,this[n(1782)]=2,this._onOpen=m=>{let l=n;try{e[l(1071)](xs,this,m,[I0,T0,L0])}catch(b){if(e[l(1343)](l(1455),e[l(1565)])){let v=ue(e[l(984)],{message:b[l(1740)],code:ze[l(1720)+"OR"],error:b});this[l(449)+"hErrorEv"+l(486)](v)}else this[l(1688)+l(330)].shift(),this[l(1688)+"Queue"].push(_0x5de35c)}},this[n(480)+"ge"]=async m=>{let l=n,{pingInterval:b,pingFrequency:v}=this[l(895)];if((i[l(1803)]("hi",m.data)&&i.nOvYe(l(1640),v)||i[l(1310)](l(1856),v))&&(this["_clearPi"+l(1072)](),this.emit(i[l(1879)],i[l(877)]),this[l(1283)+"gTimeoutId"]=i.DPLTH(setTimeout,this[l(1559)][l(490)](this),b)),!i[l(1310)]("hi",m[l(1471)]))try{i[l(1535)](i[l(1171)],"XAQXw")?this.emit(l(1740),LFrXZN[l(806)](_0x1e5b85,"message",{..._0x3933fc})):i.bwEPA(xs,this,m,[f0,x0,D0,P0,k0,c0])}catch(C){if(i[l(1803)](i[l(1122)],i[l(1122)])){let P=ue(l(1033),{message:C.message,code:ze[l(534)+l(1295)],error:C});this[l(449)+l(1158)+l(486)](P)}else this.on(_0x57fb12,_0x3bd496)}},this[n(1744)]=m=>{let l=n,b=this[l(1815)+l(695)]?.[l(1149)+l(471)+"es"](),v=this[l(1815)+"tManager"]?.[l(1096)+"ntEndpoint"]();if(b&&!m[l(1740)]){let C=l(1322)+v+(l(1005)+"ax retri"+l(1422)+"ed");this[l(449)+l(1158)+l(486)](e.vHYDC(ue,e.currj,{message:C,code:ze.MAX_RETRIES_ERROR,error:m}));return}this._ws&&e[l(580)](this[l(527)].readyState,this.OPEN)&&this._disconnect(),this[l(449)+l(1158)+"ent"](e.dvuuc(ue,e[l(984)],{message:m.message,code:ze[l(1058)+l(441)],error:m}))},this[n(1698)]=async m=>{let l=n;this[l(1221)+l(1390)](),this[l(704)+l(1072)](),this[l(1111)+l(1577)+"rs"](),this[l(527)]=null,this["_connect"+l(1614)]=!1;let b=this[l(1815)+"tManager"]?.[l(1149)+"chMaxTries"]();if(!b&&this[l(1398)+l(530)]()&&!this[l(741)+l(438)]){let v=this[l(1815)+l(695)]?.["getCurre"+l(1210)+"nt"](),C=this._options["reconnec"+l(1684)+l(1888)](m[l(634)],m[l(793)]);this[l(449)+l(1586)+"ent"](i.DPLTH(pe,"close",{code:1006,reason:m[l(793)]||l(552)+l(761)+"d, unkno"+l(1648)+l(1709)+l(1272)+v,willReconnect:C})),C&&this[l(1626)]();return}if(i.jGLTQ(1e3,m[l(634)])&&this[l(741)+l(438)]){this["_dispatc"+l(1586)+l(486)](i.AmxQi(pe,i[l(1476)],{code:1e3,reason:l(915)})),this[l(1815)+"tManager"]?.[l(834)+l(1139)+l(782)](),this["_pingLos"+l(1261)]?.[l(963)+"nter"]();return}if(i.jGLTQ(1e3,m[l(634)])&&b){let v=this[l(1815)+l(695)]?.[l(1096)+l(1210)+"nt"](),C=m[l(793)];C||(C=await i[l(1383)](n0,this[l(690)])),C=l(552)+l(761)+l(386)+C+(", hostna"+l(869))+v+(l(1601)+"tries re"+l(660)),this["_dispatc"+l(1586)+l(486)](i.AmxQi(pe,i.vfHwB,{code:m[l(634)],reason:C}));let P="connect "+v+(l(1005)+l(949)+"es reached");this[l(449)+l(1158)+"ent"](ue(i[l(1284)],{message:P,code:ze[l(1839)+l(1126)+"R"]})),this[l(1815)+l(695)]?.[l(834)+l(1139)+l(782)](),this[l(959)+l(1261)]?.[l(963)+l(1200)]();return}if(m[l(634)]!==1e3&&!m[l(793)]){let v=this[l(1815)+l(695)]?.[l(1096)+l(1210)+"nt"]();this[l(449)+l(1586)+l(486)](i[l(1010)](pe,i[l(1476)],{code:m[l(634)],reason:l(552)+"ng faile"+l(1597)+"wn reaso"+l(1709)+l(1272)+v})),this["_endpoin"+l(695)]?.[l(834)+l(1139)+"fig"](),this[l(959)+l(1261)]?.[l(963)+l(1200)]();return}this[l(449)+"hCloseEv"+l(486)](m),this[l(1815)+l(695)]?.[l(834)+l(1139)+l(782)](),this[l(959)+"sCounter"]?.[l(963)+l(1200)]()},this[n(592)]=null,this[n(624)]=null,this[n(1415)+"e"]=null,this[n(1401)]=null,this[n(466)+n(1094)]=null,this[n(677)+"eAck"]=null,this[n(711)+n(1753)+"yReconnect"]=null,this[n(1136)+n(1540)]=this[n(1136)+n(1540)].bind(this),this["_handleO"+n(1292)]=this[n(1136)+n(1292)][n(490)](this),this[n(1380)+"ageHide"]=this[n(1380)+"ageHide"][n(490)](this),this[n(1380)+"ageShow"]=this[n(1380)+"ageShow"].bind(this),this._options={url:"",automaticOpen:!0,initReconnectInterval:1e3,maxReconnectInterval:1e4,reconnectIntervalGrowFactor:2,timeoutInterval:5e3,maxRetries:5,debug:!1,maxMessageQueueLength:1/0,service:0,logIDGenerator:x,headers:void 0,payloadEncoding:"",payloadType:"",fpID:"",deviceID:"",accessKey:"",ttwID:"",bddID:"",aID:"",disableAutoReconnect:!1,customParams:{},pingInterval:15e3,pingTimeoutInterval:4e3,pingFrequency:e[n(708)],pingLossCount:2,enableTransformTextPayload:!1,logIDNewConfig:{enableAutoGenerateLogIDNew:!1,userIp:""},miniProgramParams:{customHttpHeader:{}},enableAutoAck:!1,reconnectInterceptor:()=>!0,enableQoS:!1,QoSLevel:2,messageStrategy:n(1846),env:{xTTEnv:"",xUseEnv:""},listenNetworkChanged:!0};let{url:c,ws:u}=t,h=Array[n(1499)](c)?c:e.tEpOi(e[n(479)],typeof c)?[c]:[];if(!h||e[n(1389)](0,h.length))throw new Error(e.pYrdi);if(!$o(u))throw new Error(n(1486)+n(1726)+n(983)+", WebSoc"+n(1585)+"tructor "+n(715)+n(1443));if(Object[n(996)](this[n(895)],t),this["_endpoin"+n(695)]=new as(h,this._options[n(1429)+"es"]),this["_pingLos"+n(1261)]=new t0(this[n(895)][n(1907)+n(599)]),this[n(895)]["automati"+n(990)]&&(this._isInit=!0,this[n(1626)]()),this[n(895)][n(1646)+"tworkCha"+n(633)])if(e.pEcXP(e.JZury,e[n(1584)])){let m=this[n(1501)][n(843)](this._prefix),l=_0x1a9a15[n(979)](e[n(1795)](m,"{}"));return l[_0x52760e]=void 0,this[n(1501)].setItem(this._prefix,_0x59ad99.stringify(l))}else this[n(713)+"T"]||this[n(1475)+"X"]?this[n(1617)+n(1841)+n(1382)]():this[n(1447)+"er"]&&this[n(973)+n(714)+n(1268)]()}else try{_0x3e5c50(this,_0x1dfc66,[_0x374e4b,_0xfd5288,_0x19a006])}catch(c){let u=e[n(413)](_0xa2fe70,e[n(984)],{message:c[n(1740)],code:_0x196c44.OPEN_ERROR,error:c});this[n(449)+n(1158)+"ent"](u)}}[r(1136)+"nLine"](){let t=r;this[t(895)][t(549)+t(970)+"nect"]||this[t(741)+t(438)]||this[t(1714)+"econnect"]()}[r(1136)+r(1292)](){let t=r;this["_destroy"+t(907)+"t"]();let n=e[t(1567)](Jn,e[t(848)],{message:e.oJdyy});this[t(711)+"mediatelyReconnect"]&&this[t(711)+"mediatelyReconnect"](n)}[r(973)+r(714)+r(1268)](){let t=r;this[t(1447)+"er"]&&window[t(672)+t(1268)](t(1612),this._handleOnLine),this[t(1447)+"er"]&&window[t(672)+t(1268)](e[t(1887)],this[t(1136)+t(1292)]),this[t(1447)+"er"]&&window[t(672)+t(1268)](e[t(503)],this[t(1380)+t(1309)]),this._isBrowser&&window[t(672)+t(1268)](t(579),this[t(1380)+"ageShow"])}[r(1503)+r(714)+r(1268)](){let t=r;this._isBrowser&&window[t(1710)+t(1091)+t(1537)](e[t(1428)],this[t(1136)+t(1540)]),this[t(1447)+"er"]&&window[t(1710)+t(1091)+"ner"](t(589),this[t(1136)+"ffLine"]),this[t(1447)+"er"]&&window[t(1710)+t(1091)+t(1537)](e.cpUOo,this[t(1380)+"ageHide"]),this[t(1447)+"er"]&&window[t(1710)+t(1091)+t(1537)](e[t(1785)],this[t(1380)+t(1657)])}[r(1380)+r(1309)](t){let n=r;!t[n(1374)+"d"]&&(this[n(1447)+"er"]&&window["removeEv"+n(1091)+"ner"](n(962),this[n(1380)+"ageHide"]),this[n(1447)+"er"]&&window[n(1710)+"entListener"](e[n(1785)],this[n(1380)+n(1657)]),this.close()),this[n(1447)+"er"]&&window[n(1710)+"entListe"+n(1537)](e[n(1428)],this["_handleO"+n(1540)]),this[n(1447)+"er"]&&window["removeEv"+n(1091)+n(1537)](e[n(1887)],this[n(1136)+"ffLine"])}[r(1380)+r(1657)](t){let n=r,i={ewtgO:function(c,u){return e[k(1394)](c,u)},xhIzE:function(c){return e[k(1750)](c)},WjOiy:function(c,u){return e[k(1434)](c,u)},XunxQ:function(c){return e[k(1867)](c)},LTwri:e[n(1385)],UIfcE:e[n(984)]};if(e[n(773)]!==e[n(1238)])t[n(1374)+"d"]&&(this._navigatorOnline()&&(!this._ws||e[n(647)](this[n(527)][n(792)+"te"],this[n(1233)])||e[n(1263)](this[n(527)][n(792)+"te"],this[n(1796)+"NG"]))&&this["_handleO"+n(1540)](),this[n(1447)+"er"]&&window[n(672)+"Listener"](e[n(1428)],this[n(1136)+n(1540)]),this[n(1447)+"er"]&&window["addEvent"+n(1268)](e[n(1887)],this[n(1136)+n(1292)]));else{let c={zdIpN:gftDCn.LTwri,yFKpa:gftDCn.UIfcE},u=()=>{let l=n;_0x669336["removeEv"+l(1091)+"ner"](c[l(1154)],h),_0xb3f230[l(1710)+l(1091)+l(1537)](c[l(1816)],m)},h=()=>{let l=n;gftDCn[l(430)](_0x4439fc,_0x22d5b9(_0x23d4b7.result)),gftDCn.xhIzE(u)},m=()=>{let l=n;gftDCn[l(739)](_0xb2fe8c,_0x170c27[l(1033)]),gftDCn.XunxQ(u)};_0x521b61["addEvent"+n(1268)](gftDCn.LTwri,h),_0x3c3512[n(672)+n(1268)](gftDCn[n(1756)],m)}}async["_generat"+r(1783)](t){let n=r,{fpID:i,deviceID:c,bddID:u,ttwID:h,accessKey:m,aID:l,customParams:b={},enableAutoAck:v,enableQoS:C,QoSLevel:P,env:L}=this[n(895)],I,te,ne;this[n(1447)+"er"]||this[n(1475)+"X"]||this[n(713)+"T"]?(I=location&&e.dBFSV(e.dxwXR,location.protocol)?e[n(1677)]:e[n(1182)],te=t[n(743)](/((^ws)|(^http))((?:[s]*:\/\/))/,""),ne=/^wss(.*:\/\/)/[n(1098)](t)?t:""+I+te):(I=e[n(1677)],te=t[n(743)](/(^http)((?:[s]*:\/\/))/,""),ne=/(^ws)((?:[s]*:\/\/))/.test(te)?te:""+I+te);let me=u?n(1032):h?e[n(724)]:"device_id",ps=u||h||c;if(!ps||!me)throw new Error(e[n(1279)]);let M0=e[n(1231)](e[n(751)],typeof b)?await e[n(345)](b):b,R0=L?e0(L[n(1736)],L[n(918)]):{},tr=Object.assign({device_platform:e[n(453)],version_code:n(1624)+"0",access_key:m,fpid:i,aid:l,[me]:ps,xsack:v?1:0,xaack:v?1:0,xsqos:C?1:0,qos_level:C?P:void 0,qos_sdk_version:2,...R0},M0),O0=Object[n(757)](tr)[n(1876)]((nr,rr)=>tr[rr]!==void 0?""+nr+(nr?"&":"?")+rr+"="+tr[rr]:nr,"");return ne+n(1286)+O0}async[r(1626)](){let t=r;if(!(this[t(1626)+t(1614)]||this[t(741)+"osed"])){this[t(1626)+t(1614)]=!0;try{let n=this[t(1815)+t(695)]?.["checkCur"+t(404)+"ointReac"+t(779)+t(1456)](),{timeoutInterval:i}=this[t(895)];if(n){let u=this[t(1815)+t(695)]?.["getCurre"+t(1210)+"nt"](),h=this[t(1815)+t(695)]?.["replaceB"+t(752)+t(327)+"UpdateCo"+t(1271)](),m=this[t(1815)+t(695)]?.[t(1096)+t(1210)+t(1117)+t(753)]();if(h){let l=t(1322)+u+(t(991)+t(1601)+t(662)+t(936)+t(532)+"backup endpoint ")+h+(t(1437)+"y"),b=e[t(1882)](ue,t(1033),{message:l,code:ze[t(1839)+t(1126)+"R"]});this[t(537)](l),this[t(449)+t(1158)+t(486)](b),this._url=await this[t(1265)+t(1783)](h),this._debug(t(1322)+h+" "+m+t(434)),this["_removeW"+t(1577)+"rs"]()}else{let l=t(1322)+u+(t(991)+t(1601)+t(662)+"ached");this[t(537)](l),this["_dispatc"+t(1158)+"ent"](e[t(413)](ue,e[t(984)],{message:l,code:ze[t(1839)+t(1126)+"R"]}));return}}else{let u=this._endpointManager?.[t(1096)+t(1210)+t(898)+t(781)](),h=this[t(1815)+t(695)]?.["getCurre"+t(1210)+t(1117)+t(753)]();this[t(690)]=await this["_generat"+t(1783)](u||""),this[t(537)]("connect "+u+" "+h+t(434)),this[t(1111)+t(1577)+"rs"]()}if(this[t(1373)])this._isInit=!1;else{let u=e[t(1882)](Jn,e[t(848)],{message:"start"});this[t(466)+t(1094)]&&this["onStartR"+t(1094)](u)}let c=this[t(1815)+t(695)]?.[t(1096)+"ntEndpoi"+t(1117)+"ount"]()||0;e[t(1225)](c,1)&&await this._wait(e[t(1631)](c,1)),this._debug(t(552)+t(745)+this[t(690)]+(" protoco"+t(1132))+this._protocols),this[t(527)]=e[t(1266)](Qo,{url:this[t(690)],protocols:[this._protocols],headers:this._options["miniProg"+t(1237)+"s"][t(1207)+t(1656)]},this[t(895)].ws),(this[t(1447)+"er"]||this[t(1446)+"r"])&&this[t(527)]&&(this[t(527)][t(652)+"pe"]=this[t(816)+t(1347)]),this["_addWsLi"+t(1536)](),this["_connect"+t(1e3)+"utId"]=e.HScjT(setTimeout,this._onTimeout[t(490)](this),i)}catch(n){throw this[t(1626)+t(1614)]=!1,n}}}[r(1221)+"mer"](){let t=r;if(e[t(1798)](e[t(565)],e[t(565)])){let n=e[t(875)].split("|"),i=0;for(;;){switch(n[i++]){case"0":if(!this._ws)return;continue;case"1":this[t(527)][t(1710)+t(1091)+"ner"](e[t(1772)],this[t(480)+"ge"]);continue;case"2":this[t(527)][t(1710)+"entListener"](e[t(1018)],this[t(1880)]);continue;case"3":this[t(527)]["removeEv"+t(1091)+t(1537)](e[t(984)],this._onError);continue;case"4":this._ws[t(1710)+t(1091)+"ner"](e[t(930)],this._onClose);continue}break}}else clearTimeout(this[t(1626)+t(1e3)+t(410)]),this[t(1626)+t(1e3)+t(410)]=null}[r(704)+r(1072)](){let t=r;e.sBgED(clearTimeout,this[t(1283)+t(1662)+"Id"]),clearTimeout(this[t(1830)+"ctTimeoutId"]),this[t(1283)+t(1662)+"Id"]=null,this[t(1830)+t(1622)+t(524)]=null}[r(537)](...t){let n=r;this._options[n(1903)]&&console.log[n(1547)](console,[e.StuDh,...t])}[r(981)+r(1023)+"e"](t){let n=r,{initReconnectInterval:i,maxReconnectInterval:c,reconnectIntervalGrowFactor:u}=this[n(895)],h=e[n(1669)](i,Math[n(831)](u,e[n(1100)](t,1)));return e[n(1113)](h,c)?c:h}[r(1559)](){let t=r;if(this._ws&&e[t(1379)](this[t(527)][t(792)+"te"],this[t(1796)+"NG"])){this["_clearPi"+t(1072)](),this[t(1283)+"gTimeoutId"]=e[t(1121)](setTimeout,this[t(1559)][t(490)](this),this[t(895)]["pingInte"+t(1762)]);return}if(!this[t(527)]||e[t(378)](this[t(527)][t(792)+"te"],this.OPEN))return void this._handleReconnect();this[t(527)]&&this._ws[t(1790)]("hi"),this[t(1830)+"ctTimeou"+t(524)]=setTimeout(this[t(1714)+t(1094)+t(1837)][t(490)](this),this[t(895)]["pingTime"+t(1081)+t(780)])}[r(1714)+r(1094)+r(1837)](){let t=r,n={kTobE:e[t(984)],PnClE:function(i,c,u){return e[t(859)](i,c,u)}};e[t(1509)](e[t(1789)],e.HHWcJ)?this[t(339)](TLbTnj[t(763)],TLbTnj[t(435)](_0x49dee3,TLbTnj[t(763)],{message:this["_formatErrorMess"+t(1834)](_0x4cdffe)})):(this[t(959)+t(1261)]?.[t(870)](),this[t(339)](e[t(1595)],e[t(1145)]),this[t(959)+t(1261)]?.[t(1149)+t(379)+"nt"]()?this[t(1714)+t(1094)]():this._ping())}[r(1398)+r(530)](){let t=r;return this[t(713)+"T"]||this._isMiniWX?this[t(1420)+t(1563)+t(387)]:(this._isBrowser||this._isWorker)&&this[t(895)][t(1646)+t(639)+t(633)]?navigator[t(326)]:!0}[r(1714)+r(1094)](){let t=r;!this[t(1398)+t(530)]()||this["_readyCl"+t(438)]||(this[t(1815)+t(695)]?.resetEndpointConfig(),this[t(959)+t(1261)]?.["resetCou"+t(1200)](),this._ws?this[t(613)+t(680)](1001,e[t(1051)],!0):this[t(1626)]())}[r(1617)+"etWorkCh"+r(1382)](){let t=r,n={IuExF:function(i,c){return e.aKPEq(i,c)},HbGLH:e[t(886)]};this._isMiniTT?tt[t(1076)+t(1847)+"hange"](({isConnected:i})=>{let c=t;if(e[c(1493)](c(1576),c(1576))){let u=_0x5ec8e6[c(607)];if(LdtMzh.IuExF(u+_0x47435d,_0x17b9e0.limit))throw new _0x475fbd(LdtMzh.HbGLH);return _0x4cf530[c(607)]+=_0x30b6ce,u}else this[c(1420)+c(1563)+"line"]=i,i?this[c(1136)+c(1540)]():this[c(1136)+"ffLine"]()}):this._isMiniWX&&wx["onNetwor"+t(1847)+t(1332)](({isConnected:i})=>{let c=t;this[c(1420)+c(1563)+"line"]=i,i?this[c(1136)+c(1540)]():this["_handleO"+c(1292)]()})}_wait(t){return new Promise(n=>{let i=k;e.YLPkc(setTimeout,n,this["_getInte"+i(1023)+"e"](t))})}[r(613)+r(680)](t=1e3,n="",i=!1){let c=r;this[c(527)]&&this[c(1388)+c(907)+"t"](t,n,i)}[r(457)+"ut"](){let t=r,n=this[t(1815)+t(695)]?.[t(1096)+t(1210)+"nt"]();this[t(537)]("connect "+n+t(991)),this["_disconn"+t(680)](1001,e[t(1869)],!0)}[r(1487)](t){let n=r,i=e[n(887)](Gn,t);this._ws&&e[n(1485)](this[n(527)][n(792)+"te"],this[n(1233)])&&(this._ws&&this[n(527)].send(i),this[n(537)](e[n(1077)],t))}[r(1111)+"sListeners"](){let t=r,n=e[t(642)].split("|"),i=0;for(;;){switch(n[i++]){case"0":this[t(527)][t(1710)+"entListener"](e.xlEja,this[t(1880)]);continue;case"1":this._ws.removeEventListener("error",this[t(1744)]);continue;case"2":this[t(527)]["removeEventListe"+t(1537)](t(1740),this[t(480)+"ge"]);continue;case"3":if(!this[t(527)])return;continue;case"4":this[t(527)][t(1710)+"entListe"+t(1537)](e[t(930)],this[t(1698)]);continue}break}}_addWsListeners(){let t=r,n=e.YstUd[t(804)]("|"),i=0;for(;;){switch(n[i++]){case"0":if(!this[t(527)])return;continue;case"1":this._ws[t(672)+"Listener"]("close",this[t(1698)]);continue;case"2":this[t(527)]["addEvent"+t(1268)](e[t(1772)],this[t(480)+"ge"]);continue;case"3":this._ws["addEvent"+t(1268)](e.xlEja,this[t(1880)]);continue;case"4":this[t(527)]["addEvent"+t(1268)](e[t(984)],this._onError);continue}break}}[r(1012)+r(1766)](t=1e3,n=""){let i=r;if(e[i(1253)](e[i(1672)],e[i(1870)]))try{this[i(527)]&&this[i(527)][i(1297)](t,n)}catch{}else{let c=(i(1282)+"4|7|2|3").split("|"),u=0;for(;;){switch(c[u++]){case"0":this["_clearTi"+i(1390)]();continue;case"1":this[i(1503)+i(714)+"Listener"]();continue;case"2":if(this[i(527)].readyState===this[i(478)]||e.WauWk(this._ws[i(792)+"te"],this[i(1782)]))return void this[i(537)](e[i(421)]);continue;case"3":this[i(1388)+"WebSocket"](_0x40550,_0x1cbbd2);continue;case"4":this[i(1732)+i(1853)]?.closeDB();continue;case"5":this[i(704)+"ngTimer"]();continue;case"6":this[i(741)+i(438)]=!0;continue;case"7":if(!this._ws)return void this[i(537)]("close, w"+i(1366)+i(1277)+"nitialized");continue}break}}}[r(1388)+r(907)+"t"](t=1e3,n="",i=!1){let c=r;if(this[c(704)+c(1072)](),this["_clearTi"+c(1390)](),this[c(1111)+"sListeners"](),this["_wsInsta"+c(1766)](1e3,n),this["_connect"+c(1614)]=!1,i&&this[c(1398)+c(530)]()&&!this["_readyCl"+c(438)]){if(this["_endpoin"+c(695)]?.[c(1149)+"chMaxTries"]()){let h=this["_endpoin"+c(695)]?.[c(1096)+"ntEndpoint"]();this["_dispatc"+c(1586)+c(486)](e[c(406)](pe,c(1297),{code:1006,reason:c(1322)+h+(c(991)+c(1601)+c(662)+c(660)),wasClean:!0}))}else{let h=this[c(895)][c(1819)+c(1684)+c(1888)](t,n);this[c(449)+c(1586)+c(486)](e[c(1074)](pe,e[c(930)],{code:t,reason:n,wasClean:!0,willReconnect:h})),h&&this._connect()}return}this[c(1398)+c(530)]()||this[c(741)+c(438)]?this["_dispatc"+c(1586)+c(486)](e[c(830)](pe,c(1297),{code:t,reason:e[c(583)]})):this[c(449)+c(1586)+c(486)](e[c(1043)](pe,e[c(930)],{code:1006,reason:e.NVjFT})),this[c(527)]=null,this[c(1815)+"tManager"]?.[c(834)+c(1139)+c(782)](),this[c(959)+"sCounter"]?.["resetCou"+c(1200)]()}[r(449)+r(360)+"nt"](t){let n=r;this[n(339)](e[n(1018)],t),this.onopen&&this[n(1401)](t)}[r(449)+r(403)+"Event"](t){let n=r;this[n(339)]("message",t),this.onmessage&&this[n(1415)+"e"](t)}[r(449)+r(1561)+r(1222)](t){let n=r;if(e.iufrM(e[n(965)],e[n(965)]))this[n(339)](e.lCCPg,t),this[n(677)+n(499)]&&this[n(677)+n(499)](t);else return(this[n(1425)+"rs"][_0x3affe8]||(this[n(1425)+"rs"][_0x644339]=[]))[n(358)]({fn:_0x3e1787,ctx:_0x12b6a8||this}),this}["_dispatc"+r(1158)+r(486)](t){let n=r;this[n(339)](e.currj,t),this[n(624)]&&this[n(624)](t)}["_dispatchCloseEv"+r(486)](t){let n=r;this.emit(n(1297),t),this[n(592)]&&this[n(592)](t)}get[r(652)+"pe"](){let t=r;return this[t(527)]?this._ws.binaryType:this[t(816)+t(1347)]}set[r(652)+"pe"](t){let n=r;this["_binaryT"+n(1347)]=t,this[n(527)]&&(this[n(527)][n(652)+"pe"]=t)}get retryCount(){let t=r;return this["_endpoin"+t(695)]?.[t(1096)+"ntEndpoi"+t(1117)+"ount"]()||0}get[r(1232)+r(744)](){let t=r;return this._messageQueue.reduce((i,c)=>(i+=c&&c[k(1660)+"th"]||0,i),0)+(this[t(527)]?this[t(527)][t(1232)+t(744)]:0)}get extensions(){let t=r;return this[t(527)]?this._ws[t(440)+"ns"]:""}get[r(1457)](){let t=r;return this[t(527)]?this[t(527)].protocol:""}get[r(792)+"te"](){let t=r;return this[t(527)]?this._ws.readyState:this[t(895)][t(600)+t(990)]?this[t(1796)+"NG"]:this[t(478)]}get[r(1036)](){let t=r;return this._ws?this[t(527)][t(1036)]:this._url}[r(1297)](t=1e3,n){let i=r,c=e[i(1342)][i(804)]("|"),u=0;for(;;){switch(c[u++]){case"0":if(this._ws[i(792)+"te"]===this[i(478)]||this._ws.readyState===this[i(1782)])return void this[i(537)]("close, w"+i(1578)+i(1432));continue;case"1":this[i(1221)+i(1390)]();continue;case"2":this[i(1732)+"ger"]?.[i(1395)]();continue;case"3":this[i(741)+i(438)]=!0;continue;case"4":this._destroyWebSocket(t,n);continue;case"5":this[i(704)+"ngTimer"]();continue;case"6":if(!this[i(527)])return void this[i(537)](i(615)+"s instan"+i(1277)+"nitialized");continue;case"7":this[i(1503)+i(714)+"Listener"]();continue}break}}async[r(1790)](t,n){let i=r;if(e[i(1044)](null,t))throw new Error(i(1486)+"rovide a"+i(1758)+i(822)+"a must be a stri"+i(1352)+i(1167)+i(791));e.ubTvR(e[i(809)],typeof t)&&(t=JSON.stringify(t)),e[i(479)]!=typeof t&&!(t instanceof ArrayBuffer)&&!(t[i(1346)]&&e[i(558)](t[i(1346)],ArrayBuffer))&&(t=JSON[i(1224)+"y"](t));let c=await e[i(623)](us,t),u=e[i(697)](Zo,t),{method:h=0,service:m=this[i(895)][i(512)],logID:l=this[i(895)][i(864)+"erator"](),headers:b=this[i(895)].headers,payloadEncoding:v=this[i(895)][i(1152)+i(1746)],payloadType:C=this._options[i(696)+i(1347)],logIDNew:P=this[i(895)][i(1040)+"Config"]["enableAutoGenera"+i(1636)+"ew"]?e[i(1557)](a,this[i(895)][i(1040)+i(1218)].userIp):""}=e[i(1256)](n,{});if(!m)throw new Error(i(1486)+i(1381)+i(1162)+i(989));let L={SeqID:O[i(356)+"er"](this[i(1248)]++),LogID:O[i(356)+"er"](l),service:m,method:h,headers:b,payloadEncoding:e[i(558)](v,Object)?v.encoding?v[i(835)]:"":v,payloadType:e[i(1130)](C,Object)?C[i(1155)]?C[i(1155)]:u:C||u,payload:c,LogIDNew:P},I=e[i(1236)](Gn,L);return this[i(527)]&&e.BfyCw(this[i(527)][i(792)+"te"],this[i(1233)])?(this[i(527)]&&this[i(527)][i(1790)](I),this[i(537)](e[i(555)],L)):e[i(1852)](this["_message"+i(330)][i(398)],this[i(895)][i(1534)+i(674)+"ength"])?(this[i(1688)+i(330)][i(358)](I),this._debug(e[i(856)],L)):(this[i(1688)+i(330)][i(576)](),this[i(1688)+i(330)][i(358)](I)),{seqID:this[i(1248)],logID:l,logIDNew:P}}async reconnect(t){let n=r,{url:i}=e[n(1592)](t,{}),c=Array[n(1499)](i)?i:e[n(1527)](e.PIMHn,typeof i)?[i]:[];t&&Object[n(996)](this[n(895)],t),c&&c.length?this[n(1815)+"tManager"]=new as(c,this[n(895)][n(1429)+"es"]):this[n(1815)+"tManager"]?.[n(834)+n(1139)+n(782)](),this._pingLossCounter?.["resetCou"+n(1200)](this[n(895)]["pingLoss"+n(599)]),this[n(741)+n(438)]=!1,this[n(527)]&&e[n(759)](this[n(527)][n(792)+"te"],this[n(478)])?this[n(613)+"ect"](1e3,e[n(1670)],!0):(this[n(1373)]=!0,this[n(1626)]())}async[r(368)](){let t=r;if(!this[t(1626)+"Lock"]){let n=e[t(1387)][t(804)]("|"),i=0;for(;;){switch(n[i++]){case"0":this[t(1626)]();continue;case"1":this[t(959)+t(1261)]?.[t(963)+t(1200)]();continue;case"2":this[t(1373)]=!0;continue;case"3":this[t(741)+t(438)]=!1;continue;case"4":this[t(1815)+t(695)]?.[t(834)+t(1139)+t(782)]();continue}break}}}["addEvent"+r(1268)](t,n){this.on(t,n)}[r(541)+"Event"](t){let n=r;if(e[n(1281)](e.vzZTC,n(1024)))_0x10622c.d=(i,c)=>{let u=n;for(var h in c)_0x356137.o(c,h)&&!_0x56f52e.o(i,h)&&_0xf1911f[u(1490)+u(1571)](i,h,{enumerable:!0,get:c[h]})};else{let{type:i}=t;this.emit(i,t)}}[r(1710)+r(1091)+r(1537)](t,n){this[r(454)](t,n)}[r(1203)](){let t=r,n={UNnbV:e[t(1385)],uwiIK:e[t(1595)],NHxRe:e.MRUgg,qDUBb:e[t(974)],GoHvn:function(i,c){return e[t(1472)](i,c)},DTrNT:e.NXrsF,tICZW:function(i,c,u){return i(c,u)}};return new Promise((i,c)=>{let u=t,h={sBZBS:n.UNnbV,Fxipt:n[u(390)],HKVwC:n[u(833)],JvxGe:n[u(1049)]};if(n[u(1651)]("qMCcb",n[u(1621)])){this[u(704)+u(1072)](),this._pingPongTimeoutId=n[u(1502)](setTimeout,this[u(1559)][u(490)](this),this[u(895)][u(1320)+u(1762)]);let m=()=>{let b=u;i(h[b(829)]),this.off("ping_onc"+b(1541)+"s",m),this[b(454)](h[b(375)],l)},l=()=>{let b=u;c(h[b(428)]),this[b(454)](h[b(1034)],m),this.off(b(1685)+b(673)+"t",l)};this.on("ping_once_success",m),this.on(n[u(390)],l),this[u(1559)]()}else this.emit(u(1297),_0x287fc4),this[u(592)]&&this[u(592)](_0x4ae1fa)})}}})(),Y.CustomCloseEvent=V[S(1377)+S(768)],Y[S(908)+S(727)]=V[S(908)+"rorEvent"],Y[S(980)+"e"]=V.ErrorCode,Y[S(521)]=V[S(521)],Y.FWS=V[S(1806)],Y[S(1234)+"MessageE"+S(1445)]=V["Frontier"+S(1258)+S(1445)],Y[S(1258)+S(1445)]=V[S(1258)+S(1445)],Y[S(539)+"t"]=V.OpenEvent,Y["Reconnec"+S(1679)]=V[S(567)+S(1679)],Y["createCl"+S(768)]=V["createCl"+S(768)],Y[S(575)+S(727)]=V["createEr"+S(727)],Y[S(513)+S(1147)+"nt"]=V[S(513)+S(1147)+"nt"],Y[S(982)+S(581)]=V[S(982)+S(581)],Y[S(588)+S(1696)+S(1445)]=V["createRe"+S(1696)+S(1445)],Y[S(492)+"rame"]=V[S(492)+S(544)],Y[S(622)+S(1743)]=V[S(622)+S(1743)];for(dn in V)[S(1377)+"oseEvent",S(908)+"rorEvent","ErrorCode",S(521),S(1806),S(1234)+S(1258)+S(1445),S(1258)+S(1445),"OpenEvent","ReconnectEvent",S(1318)+"oseEvent",S(575)+S(727),"createMe"+S(1147)+"nt",S(982)+S(581),S(588)+S(1696)+S(1445),S(492)+S(544),S(622)+"ame"].indexOf(dn)===-1&&(Y[dn]=V[dn]);var dn;Object[S(1490)+"operty"](Y,S(601)+"le",{value:!0})});var Le=oe((Zd,fi)=>{"use strict";var xi=["nodebuffer","arraybuffer","fragments"],ci=typeof Blob<"u";ci&&xi.push("blob");fi.exports={BINARY_TYPES:xi,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:ci,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var Pt=oe((el,wn)=>{"use strict";var{EMPTY_BUFFER:_x}=Le(),lr=Buffer[Symbol.species];function yx(r,e){if(r.length===0)return _x;if(r.length===1)return r[0];let o=Buffer.allocUnsafe(e),a=0;for(let x=0;x<r.length;x++){let f=r[x];o.set(f,a),a+=f.length}return a<e?new lr(o.buffer,o.byteOffset,a):o}function ui(r,e,o,a,x){for(let f=0;f<x;f++)o[a+f]=r[f]^e[f&3]}function di(r,e){for(let o=0;o<r.length;o++)r[o]^=e[o&3]}function bx(r){return r.length===r.buffer.byteLength?r.buffer:r.buffer.slice(r.byteOffset,r.byteOffset+r.length)}function hr(r){if(hr.readOnly=!0,Buffer.isBuffer(r))return r;let e;return r instanceof ArrayBuffer?e=new lr(r):ArrayBuffer.isView(r)?e=new lr(r.buffer,r.byteOffset,r.byteLength):(e=Buffer.from(r),hr.readOnly=!1),e}wn.exports={concat:yx,mask:ui,toArrayBuffer:bx,toBuffer:hr,unmask:di};if(!process.env.WS_NO_BUFFER_UTIL)try{let r=X("bufferutil");wn.exports.mask=function(e,o,a,x,f){f<48?ui(e,o,a,x,f):r.mask(e,o,a,x,f)},wn.exports.unmask=function(e,o){e.length<32?di(e,o):r.unmask(e,o)}}catch{}});var gi=oe((tl,hi)=>{"use strict";var li=Symbol("kDone"),gr=Symbol("kRun"),pr=class{constructor(e){this[li]=()=>{this.pending--,this[gr]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[gr]()}[gr](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[li])}}};hi.exports=pr});var lt=oe((nl,wi)=>{"use strict";var It=X("zlib"),pi=Pt(),vx=gi(),{kStatusCode:mi}=Le(),Sx=Buffer[Symbol.species],Cx=Buffer.from([0,0,255,255]),bn=Symbol("permessage-deflate"),Ne=Symbol("total-length"),ut=Symbol("callback"),He=Symbol("buffers"),dt=Symbol("error"),yn,mr=class{constructor(e){if(this._options=e||{},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,!yn){let o=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;yn=new vx(o)}}static get extensionName(){return"permessage-deflate"}offer(){let e={};return this._options.serverNoContextTakeover&&(e.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(e.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(e.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?e.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(e.client_max_window_bits=!0),e}accept(e){return e=this.normalizeParams(e),this.params=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let e=this._deflate[ut];this._deflate.close(),this._deflate=null,e&&e(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(e){let o=this._options,a=e.find(x=>!(o.serverNoContextTakeover===!1&&x.server_no_context_takeover||x.server_max_window_bits&&(o.serverMaxWindowBits===!1||typeof o.serverMaxWindowBits=="number"&&o.serverMaxWindowBits>x.server_max_window_bits)||typeof o.clientMaxWindowBits=="number"&&!x.client_max_window_bits));if(!a)throw new Error("None of the extension offers can be accepted");return o.serverNoContextTakeover&&(a.server_no_context_takeover=!0),o.clientNoContextTakeover&&(a.client_no_context_takeover=!0),typeof o.serverMaxWindowBits=="number"&&(a.server_max_window_bits=o.serverMaxWindowBits),typeof o.clientMaxWindowBits=="number"?a.client_max_window_bits=o.clientMaxWindowBits:(a.client_max_window_bits===!0||o.clientMaxWindowBits===!1)&&delete a.client_max_window_bits,a}acceptAsClient(e){let o=e[0];if(this._options.clientNoContextTakeover===!1&&o.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!o.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(o.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&o.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return o}normalizeParams(e){return e.forEach(o=>{Object.keys(o).forEach(a=>{let x=o[a];if(x.length>1)throw new Error(`Parameter "${a}" must have only a single value`);if(x=x[0],a==="client_max_window_bits"){if(x!==!0){let f=+x;if(!Number.isInteger(f)||f<8||f>15)throw new TypeError(`Invalid value for parameter "${a}": ${x}`);x=f}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${a}": ${x}`)}else if(a==="server_max_window_bits"){let f=+x;if(!Number.isInteger(f)||f<8||f>15)throw new TypeError(`Invalid value for parameter "${a}": ${x}`);x=f}else if(a==="client_no_context_takeover"||a==="server_no_context_takeover"){if(x!==!0)throw new TypeError(`Invalid value for parameter "${a}": ${x}`)}else throw new Error(`Unknown parameter "${a}"`);o[a]=x})}),e}decompress(e,o,a){yn.add(x=>{this._decompress(e,o,(f,d)=>{x(),a(f,d)})})}compress(e,o,a){yn.add(x=>{this._compress(e,o,(f,d)=>{x(),a(f,d)})})}_decompress(e,o,a){let x=this._isServer?"client":"server";if(!this._inflate){let f=`${x}_max_window_bits`,d=typeof this.params[f]!="number"?It.Z_DEFAULT_WINDOWBITS:this.params[f];this._inflate=It.createInflateRaw({...this._options.zlibInflateOptions,windowBits:d}),this._inflate[bn]=this,this._inflate[Ne]=0,this._inflate[He]=[],this._inflate.on("error",Ax),this._inflate.on("data",_i)}this._inflate[ut]=a,this._inflate.write(e),o&&this._inflate.write(Cx),this._inflate.flush(()=>{let f=this._inflate[dt];if(f){this._inflate.close(),this._inflate=null,a(f);return}let d=pi.concat(this._inflate[He],this._inflate[Ne]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[Ne]=0,this._inflate[He]=[],o&&this.params[`${x}_no_context_takeover`]&&this._inflate.reset()),a(null,d)})}_compress(e,o,a){let x=this._isServer?"server":"client";if(!this._deflate){let f=`${x}_max_window_bits`,d=typeof this.params[f]!="number"?It.Z_DEFAULT_WINDOWBITS:this.params[f];this._deflate=It.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:d}),this._deflate[Ne]=0,this._deflate[He]=[],this._deflate.on("data",Ex)}this._deflate[ut]=a,this._deflate.write(e),this._deflate.flush(It.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let f=pi.concat(this._deflate[He],this._deflate[Ne]);o&&(f=new Sx(f.buffer,f.byteOffset,f.length-4)),this._deflate[ut]=null,this._deflate[Ne]=0,this._deflate[He]=[],o&&this.params[`${x}_no_context_takeover`]&&this._deflate.reset(),a(null,f)})}};wi.exports=mr;function Ex(r){this[He].push(r),this[Ne]+=r.length}function _i(r){if(this[Ne]+=r.length,this[bn]._maxPayload<1||this[Ne]<=this[bn]._maxPayload){this[He].push(r);return}this[dt]=new RangeError("Max payload size exceeded"),this[dt].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[dt][mi]=1009,this.removeListener("data",_i),this.reset()}function Ax(r){if(this[bn]._inflate=null,this[dt]){this[ut](this[dt]);return}r[mi]=1007,this[ut](r)}});var ht=oe((rl,vn)=>{"use strict";var{isUtf8:yi}=X("buffer"),{hasBlob:kx}=Le(),Dx=[0,0,0,0,0,0,0,0,0,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 Px(r){return r>=1e3&&r<=1014&&r!==1004&&r!==1005&&r!==1006||r>=3e3&&r<=4999}function _r(r){let e=r.length,o=0;for(;o<e;)if((r[o]&128)===0)o++;else if((r[o]&224)===192){if(o+1===e||(r[o+1]&192)!==128||(r[o]&254)===192)return!1;o+=2}else if((r[o]&240)===224){if(o+2>=e||(r[o+1]&192)!==128||(r[o+2]&192)!==128||r[o]===224&&(r[o+1]&224)===128||r[o]===237&&(r[o+1]&224)===160)return!1;o+=3}else if((r[o]&248)===240){if(o+3>=e||(r[o+1]&192)!==128||(r[o+2]&192)!==128||(r[o+3]&192)!==128||r[o]===240&&(r[o+1]&240)===128||r[o]===244&&r[o+1]>143||r[o]>244)return!1;o+=4}else return!1;return!0}function Ix(r){return kx&&typeof r=="object"&&typeof r.arrayBuffer=="function"&&typeof r.type=="string"&&typeof r.stream=="function"&&(r[Symbol.toStringTag]==="Blob"||r[Symbol.toStringTag]==="File")}vn.exports={isBlob:Ix,isValidStatusCode:Px,isValidUTF8:_r,tokenChars:Dx};if(yi)vn.exports.isValidUTF8=function(r){return r.length<24?_r(r):yi(r)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let r=X("utf-8-validate");vn.exports.isValidUTF8=function(e){return e.length<32?_r(e):r(e)}}catch{}});var Sr=oe((sl,ki)=>{"use strict";var{Writable:Tx}=X("stream"),bi=lt(),{BINARY_TYPES:Lx,EMPTY_BUFFER:vi,kStatusCode:Nx,kWebSocket:Mx}=Le(),{concat:wr,toArrayBuffer:Rx,unmask:Ox}=Pt(),{isValidStatusCode:Bx,isValidUTF8:Si}=ht(),Sn=Buffer[Symbol.species],le=0,Ci=1,Ei=2,Ai=3,yr=4,br=5,Cn=6,vr=class extends Tx{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||Lx[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[Mx]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=le}_write(e,o,a){if(this._opcode===8&&this._state==le)return a();this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(a)}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e<this._buffers[0].length){let a=this._buffers[0];return this._buffers[0]=new Sn(a.buffer,a.byteOffset+e,a.length-e),new Sn(a.buffer,a.byteOffset,e)}let o=Buffer.allocUnsafe(e);do{let a=this._buffers[0],x=o.length-e;e>=a.length?o.set(this._buffers.shift(),x):(o.set(new Uint8Array(a.buffer,a.byteOffset,e),x),this._buffers[0]=new Sn(a.buffer,a.byteOffset+e,a.length-e)),e-=a.length}while(e>0);return o}startLoop(e){this._loop=!0;do switch(this._state){case le:this.getInfo(e);break;case Ci:this.getPayloadLength16(e);break;case Ei:this.getPayloadLength64(e);break;case Ai:this.getMask();break;case yr:this.getData(e);break;case br:case Cn:this._loop=!1;return}while(this._loop);this._errored||e()}getInfo(e){if(this._bufferedBytes<2){this._loop=!1;return}let o=this.consume(2);if((o[0]&48)!==0){let x=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");e(x);return}let a=(o[0]&64)===64;if(a&&!this._extensions[bi.extensionName]){let x=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(x);return}if(this._fin=(o[0]&128)===128,this._opcode=o[0]&15,this._payloadLength=o[1]&127,this._opcode===0){if(a){let x=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(x);return}if(!this._fragmented){let x=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");e(x);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let x=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(x);return}this._compressed=a}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let x=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");e(x);return}if(a){let x=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(x);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let x=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");e(x);return}}else{let x=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(x);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(o[1]&128)===128,this._isServer){if(!this._masked){let x=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");e(x);return}}else if(this._masked){let x=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");e(x);return}this._payloadLength===126?this._state=Ci:this._payloadLength===127?this._state=Ei:this.haveLength(e)}getPayloadLength16(e){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(e)}getPayloadLength64(e){if(this._bufferedBytes<8){this._loop=!1;return}let o=this.consume(8),a=o.readUInt32BE(0);if(a>Math.pow(2,21)-1){let x=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");e(x);return}this._payloadLength=a*Math.pow(2,32)+o.readUInt32BE(4),this.haveLength(e)}haveLength(e){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let o=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");e(o);return}this._masked?this._state=Ai:this._state=yr}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=yr}getData(e){let o=vi;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}o=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&Ox(o,this._mask)}if(this._opcode>7){this.controlMessage(o,e);return}if(this._compressed){this._state=br,this.decompress(o,e);return}o.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(o)),this.dataMessage(e)}decompress(e,o){this._extensions[bi.extensionName].decompress(e,this._fin,(x,f)=>{if(x)return o(x);if(f.length){if(this._messageLength+=f.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let d=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");o(d);return}this._fragments.push(f)}this.dataMessage(o),this._state===le&&this.startLoop(o)})}dataMessage(e){if(!this._fin){this._state=le;return}let o=this._messageLength,a=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let x;this._binaryType==="nodebuffer"?x=wr(a,o):this._binaryType==="arraybuffer"?x=Rx(wr(a,o)):this._binaryType==="blob"?x=new Blob(a):x=a,this._allowSynchronousEvents?(this.emit("message",x,!0),this._state=le):(this._state=Cn,setImmediate(()=>{this.emit("message",x,!0),this._state=le,this.startLoop(e)}))}else{let x=wr(a,o);if(!this._skipUTF8Validation&&!Si(x)){let f=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(f);return}this._state===br||this._allowSynchronousEvents?(this.emit("message",x,!1),this._state=le):(this._state=Cn,setImmediate(()=>{this.emit("message",x,!1),this._state=le,this.startLoop(e)}))}}controlMessage(e,o){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit("conclude",1005,vi),this.end();else{let a=e.readUInt16BE(0);if(!Bx(a)){let f=this.createError(RangeError,`invalid status code ${a}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");o(f);return}let x=new Sn(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!Si(x)){let f=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");o(f);return}this._loop=!1,this.emit("conclude",a,x),this.end()}this._state=le;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=le):(this._state=Cn,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=le,this.startLoop(o)}))}createError(e,o,a,x,f){this._loop=!1,this._errored=!0;let d=new e(a?`Invalid WebSocket frame: ${o}`:o);return Error.captureStackTrace(d,this.createError),d.code=f,d[Nx]=x,d}};ki.exports=vr});var Ar=oe((ol,Ii)=>{"use strict";var{Duplex:il}=X("stream"),{randomFillSync:zx}=X("crypto"),Di=lt(),{EMPTY_BUFFER:qx,kWebSocket:Fx,NOOP:Ux}=Le(),{isBlob:gt,isValidStatusCode:Hx}=ht(),{mask:Pi,toBuffer:Ve}=Pt(),he=Symbol("kByteLength"),Kx=Buffer.alloc(4),En=8*1024,Ye,pt=En,_e=0,jx=1,Wx=2,Cr=class r{constructor(e,o,a){this._extensions=o||{},a&&(this._generateMask=a,this._maskBuffer=Buffer.alloc(4)),this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=_e,this.onerror=Ux,this[Fx]=void 0}static frame(e,o){let a,x=!1,f=2,d=!1;o.mask&&(a=o.maskBuffer||Kx,o.generateMask?o.generateMask(a):(pt===En&&(Ye===void 0&&(Ye=Buffer.alloc(En)),zx(Ye,0,En),pt=0),a[0]=Ye[pt++],a[1]=Ye[pt++],a[2]=Ye[pt++],a[3]=Ye[pt++]),d=(a[0]|a[1]|a[2]|a[3])===0,f=6);let g;typeof e=="string"?(!o.mask||d)&&o[he]!==void 0?g=o[he]:(e=Buffer.from(e),g=e.length):(g=e.length,x=o.mask&&o.readOnly&&!d);let p=g;g>=65536?(f+=8,p=127):g>125&&(f+=2,p=126);let _=Buffer.allocUnsafe(x?g+f:f);return _[0]=o.fin?o.opcode|128:o.opcode,o.rsv1&&(_[0]|=64),_[1]=p,p===126?_.writeUInt16BE(g,2):p===127&&(_[2]=_[3]=0,_.writeUIntBE(g,4,6)),o.mask?(_[1]|=128,_[f-4]=a[0],_[f-3]=a[1],_[f-2]=a[2],_[f-1]=a[3],d?[_,e]:x?(Pi(e,a,_,f,g),[_]):(Pi(e,a,e,0,g),[_,e])):[_,e]}close(e,o,a,x){let f;if(e===void 0)f=qx;else{if(typeof e!="number"||!Hx(e))throw new TypeError("First argument must be a valid error code number");if(o===void 0||!o.length)f=Buffer.allocUnsafe(2),f.writeUInt16BE(e,0);else{let g=Buffer.byteLength(o);if(g>123)throw new RangeError("The message must not be greater than 123 bytes");f=Buffer.allocUnsafe(2+g),f.writeUInt16BE(e,0),typeof o=="string"?f.write(o,2):f.set(o,2)}}let d={[he]:f.length,fin:!0,generateMask:this._generateMask,mask:a,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==_e?this.enqueue([this.dispatch,f,!1,d,x]):this.sendFrame(r.frame(f,d),x)}ping(e,o,a){let x,f;if(typeof e=="string"?(x=Buffer.byteLength(e),f=!1):gt(e)?(x=e.size,f=!1):(e=Ve(e),x=e.length,f=Ve.readOnly),x>125)throw new RangeError("The data size must not be greater than 125 bytes");let d={[he]:x,fin:!0,generateMask:this._generateMask,mask:o,maskBuffer:this._maskBuffer,opcode:9,readOnly:f,rsv1:!1};gt(e)?this._state!==_e?this.enqueue([this.getBlobData,e,!1,d,a]):this.getBlobData(e,!1,d,a):this._state!==_e?this.enqueue([this.dispatch,e,!1,d,a]):this.sendFrame(r.frame(e,d),a)}pong(e,o,a){let x,f;if(typeof e=="string"?(x=Buffer.byteLength(e),f=!1):gt(e)?(x=e.size,f=!1):(e=Ve(e),x=e.length,f=Ve.readOnly),x>125)throw new RangeError("The data size must not be greater than 125 bytes");let d={[he]:x,fin:!0,generateMask:this._generateMask,mask:o,maskBuffer:this._maskBuffer,opcode:10,readOnly:f,rsv1:!1};gt(e)?this._state!==_e?this.enqueue([this.getBlobData,e,!1,d,a]):this.getBlobData(e,!1,d,a):this._state!==_e?this.enqueue([this.dispatch,e,!1,d,a]):this.sendFrame(r.frame(e,d),a)}send(e,o,a){let x=this._extensions[Di.extensionName],f=o.binary?2:1,d=o.compress,g,p;typeof e=="string"?(g=Buffer.byteLength(e),p=!1):gt(e)?(g=e.size,p=!1):(e=Ve(e),g=e.length,p=Ve.readOnly),this._firstFragment?(this._firstFragment=!1,d&&x&&x.params[x._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(d=g>=x._threshold),this._compress=d):(d=!1,f=0),o.fin&&(this._firstFragment=!0);let _={[he]:g,fin:o.fin,generateMask:this._generateMask,mask:o.mask,maskBuffer:this._maskBuffer,opcode:f,readOnly:p,rsv1:d};gt(e)?this._state!==_e?this.enqueue([this.getBlobData,e,this._compress,_,a]):this.getBlobData(e,this._compress,_,a):this._state!==_e?this.enqueue([this.dispatch,e,this._compress,_,a]):this.dispatch(e,this._compress,_,a)}getBlobData(e,o,a,x){this._bufferedBytes+=a[he],this._state=Wx,e.arrayBuffer().then(f=>{if(this._socket.destroyed){let g=new Error("The socket was closed while the blob was being read");process.nextTick(Er,this,g,x);return}this._bufferedBytes-=a[he];let d=Ve(f);o?this.dispatch(d,o,a,x):(this._state=_e,this.sendFrame(r.frame(d,a),x),this.dequeue())}).catch(f=>{process.nextTick(Gx,this,f,x)})}dispatch(e,o,a,x){if(!o){this.sendFrame(r.frame(e,a),x);return}let f=this._extensions[Di.extensionName];this._bufferedBytes+=a[he],this._state=jx,f.compress(e,a.fin,(d,g)=>{if(this._socket.destroyed){let p=new Error("The socket was closed while data was being compressed");Er(this,p,x);return}this._bufferedBytes-=a[he],this._state=_e,a.readOnly=!1,this.sendFrame(r.frame(g,a),x),this.dequeue()})}dequeue(){for(;this._state===_e&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][he],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][he],this._queue.push(e)}sendFrame(e,o){e.length===2?(this._socket.cork(),this._socket.write(e[0]),this._socket.write(e[1],o),this._socket.uncork()):this._socket.write(e[0],o)}};Ii.exports=Cr;function Er(r,e,o){typeof o=="function"&&o(e);for(let a=0;a<r._queue.length;a++){let x=r._queue[a],f=x[x.length-1];typeof f=="function"&&f(e)}}function Gx(r,e,o){Er(r,e,o),r.onerror(e)}});var qi=oe((al,zi)=>{"use strict";var{kForOnEventAttribute:Tt,kListener:kr}=Le(),Ti=Symbol("kCode"),Li=Symbol("kData"),Ni=Symbol("kError"),Mi=Symbol("kMessage"),Ri=Symbol("kReason"),mt=Symbol("kTarget"),Oi=Symbol("kType"),Bi=Symbol("kWasClean"),Me=class{constructor(e){this[mt]=null,this[Oi]=e}get target(){return this[mt]}get type(){return this[Oi]}};Object.defineProperty(Me.prototype,"target",{enumerable:!0});Object.defineProperty(Me.prototype,"type",{enumerable:!0});var Qe=class extends Me{constructor(e,o={}){super(e),this[Ti]=o.code===void 0?0:o.code,this[Ri]=o.reason===void 0?"":o.reason,this[Bi]=o.wasClean===void 0?!1:o.wasClean}get code(){return this[Ti]}get reason(){return this[Ri]}get wasClean(){return this[Bi]}};Object.defineProperty(Qe.prototype,"code",{enumerable:!0});Object.defineProperty(Qe.prototype,"reason",{enumerable:!0});Object.defineProperty(Qe.prototype,"wasClean",{enumerable:!0});var _t=class extends Me{constructor(e,o={}){super(e),this[Ni]=o.error===void 0?null:o.error,this[Mi]=o.message===void 0?"":o.message}get error(){return this[Ni]}get message(){return this[Mi]}};Object.defineProperty(_t.prototype,"error",{enumerable:!0});Object.defineProperty(_t.prototype,"message",{enumerable:!0});var Lt=class extends Me{constructor(e,o={}){super(e),this[Li]=o.data===void 0?null:o.data}get data(){return this[Li]}};Object.defineProperty(Lt.prototype,"data",{enumerable:!0});var Jx={addEventListener(r,e,o={}){for(let x of this.listeners(r))if(!o[Tt]&&x[kr]===e&&!x[Tt])return;let a;if(r==="message")a=function(f,d){let g=new Lt("message",{data:d?f:f.toString()});g[mt]=this,An(e,this,g)};else if(r==="close")a=function(f,d){let g=new Qe("close",{code:f,reason:d.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});g[mt]=this,An(e,this,g)};else if(r==="error")a=function(f){let d=new _t("error",{error:f,message:f.message});d[mt]=this,An(e,this,d)};else if(r==="open")a=function(){let f=new Me("open");f[mt]=this,An(e,this,f)};else return;a[Tt]=!!o[Tt],a[kr]=e,o.once?this.once(r,a):this.on(r,a)},removeEventListener(r,e){for(let o of this.listeners(r))if(o[kr]===e&&!o[Tt]){this.removeListener(r,o);break}}};zi.exports={CloseEvent:Qe,ErrorEvent:_t,Event:Me,EventTarget:Jx,MessageEvent:Lt};function An(r,e,o){typeof r=="object"&&r.handleEvent?r.handleEvent.call(r,o):r.call(e,o)}});var kn=oe((xl,Fi)=>{"use strict";var{tokenChars:Nt}=ht();function Ee(r,e,o){r[e]===void 0?r[e]=[o]:r[e].push(o)}function Xx(r){let e=Object.create(null),o=Object.create(null),a=!1,x=!1,f=!1,d,g,p=-1,_=-1,w=-1,y=0;for(;y<r.length;y++)if(_=r.charCodeAt(y),d===void 0)if(w===-1&&Nt[_]===1)p===-1&&(p=y);else if(y!==0&&(_===32||_===9))w===-1&&p!==-1&&(w=y);else if(_===59||_===44){if(p===-1)throw new SyntaxError(`Unexpected character at index ${y}`);w===-1&&(w=y);let T=r.slice(p,w);_===44?(Ee(e,T,o),o=Object.create(null)):d=T,p=w=-1}else throw new SyntaxError(`Unexpected character at index ${y}`);else if(g===void 0)if(w===-1&&Nt[_]===1)p===-1&&(p=y);else if(_===32||_===9)w===-1&&p!==-1&&(w=y);else if(_===59||_===44){if(p===-1)throw new SyntaxError(`Unexpected character at index ${y}`);w===-1&&(w=y),Ee(o,r.slice(p,w),!0),_===44&&(Ee(e,d,o),o=Object.create(null),d=void 0),p=w=-1}else if(_===61&&p!==-1&&w===-1)g=r.slice(p,y),p=w=-1;else throw new SyntaxError(`Unexpected character at index ${y}`);else if(x){if(Nt[_]!==1)throw new SyntaxError(`Unexpected character at index ${y}`);p===-1?p=y:a||(a=!0),x=!1}else if(f)if(Nt[_]===1)p===-1&&(p=y);else if(_===34&&p!==-1)f=!1,w=y;else if(_===92)x=!0;else throw new SyntaxError(`Unexpected character at index ${y}`);else if(_===34&&r.charCodeAt(y-1)===61)f=!0;else if(w===-1&&Nt[_]===1)p===-1&&(p=y);else if(p!==-1&&(_===32||_===9))w===-1&&(w=y);else if(_===59||_===44){if(p===-1)throw new SyntaxError(`Unexpected character at index ${y}`);w===-1&&(w=y);let T=r.slice(p,w);a&&(T=T.replace(/\\/g,""),a=!1),Ee(o,g,T),_===44&&(Ee(e,d,o),o=Object.create(null),d=void 0),g=void 0,p=w=-1}else throw new SyntaxError(`Unexpected character at index ${y}`);if(p===-1||f||_===32||_===9)throw new SyntaxError("Unexpected end of input");w===-1&&(w=y);let A=r.slice(p,w);return d===void 0?Ee(e,A,o):(g===void 0?Ee(o,A,!0):a?Ee(o,g,A.replace(/\\/g,"")):Ee(o,g,A),Ee(e,d,o)),e}function Vx(r){return Object.keys(r).map(e=>{let o=r[e];return Array.isArray(o)||(o=[o]),o.map(a=>[e].concat(Object.keys(a).map(x=>{let f=a[x];return Array.isArray(f)||(f=[f]),f.map(d=>d===!0?x:`${x}=${d}`).join("; ")})).join("; ")).join(", ")}).join(", ")}Fi.exports={format:Vx,parse:Xx}});var Tn=oe((ul,$i)=>{"use strict";var Yx=X("events"),Qx=X("https"),$x=X("http"),Ki=X("net"),Zx=X("tls"),{randomBytes:ec,createHash:tc}=X("crypto"),{Duplex:cl,Readable:fl}=X("stream"),{URL:Dr}=X("url"),Ke=lt(),nc=Sr(),rc=Ar(),{isBlob:sc}=ht(),{BINARY_TYPES:Ui,CLOSE_TIMEOUT:ic,EMPTY_BUFFER:Dn,GUID:oc,kForOnEventAttribute:Pr,kListener:ac,kStatusCode:xc,kWebSocket:Z,NOOP:ji}=Le(),{EventTarget:{addEventListener:cc,removeEventListener:fc}}=qi(),{format:uc,parse:dc}=kn(),{toBuffer:lc}=Pt(),Wi=Symbol("kAborted"),Ir=[8,13],Re=["CONNECTING","OPEN","CLOSING","CLOSED"],hc=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,q=class r extends Yx{constructor(e,o,a){super(),this._binaryType=Ui[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=Dn,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=r.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,e!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,o===void 0?o=[]:Array.isArray(o)||(typeof o=="object"&&o!==null?(a=o,o=[]):o=[o]),Gi(this,e,o,a)):(this._autoPong=a.autoPong,this._closeTimeout=a.closeTimeout,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){Ui.includes(e)&&(this._binaryType=e,this._receiver&&(this._receiver._binaryType=e))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(e,o,a){let x=new nc({allowSynchronousEvents:a.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:a.maxPayload,skipUTF8Validation:a.skipUTF8Validation}),f=new rc(e,this._extensions,a.generateMask);this._receiver=x,this._sender=f,this._socket=e,x[Z]=this,f[Z]=this,e[Z]=this,x.on("conclude",mc),x.on("drain",_c),x.on("error",wc),x.on("message",yc),x.on("ping",bc),x.on("pong",vc),f.onerror=Sc,e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),o.length>0&&e.unshift(o),e.on("close",Vi),e.on("data",In),e.on("end",Yi),e.on("error",Qi),this._readyState=r.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=r.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[Ke.extensionName]&&this._extensions[Ke.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=r.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,o){if(this.readyState!==r.CLOSED){if(this.readyState===r.CONNECTING){fe(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===r.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=r.CLOSING,this._sender.close(e,o,!this._isServer,a=>{a||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),Xi(this)}}pause(){this.readyState===r.CONNECTING||this.readyState===r.CLOSED||(this._paused=!0,this._socket.pause())}ping(e,o,a){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(a=e,e=o=void 0):typeof o=="function"&&(a=o,o=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){Tr(this,e,a);return}o===void 0&&(o=!this._isServer),this._sender.ping(e||Dn,o,a)}pong(e,o,a){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(a=e,e=o=void 0):typeof o=="function"&&(a=o,o=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){Tr(this,e,a);return}o===void 0&&(o=!this._isServer),this._sender.pong(e||Dn,o,a)}resume(){this.readyState===r.CONNECTING||this.readyState===r.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(e,o,a){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof o=="function"&&(a=o,o={}),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){Tr(this,e,a);return}let x={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...o};this._extensions[Ke.extensionName]||(x.compress=!1),this._sender.send(e||Dn,x,a)}terminate(){if(this.readyState!==r.CLOSED){if(this.readyState===r.CONNECTING){fe(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=r.CLOSING,this._socket.destroy())}}};Object.defineProperty(q,"CONNECTING",{enumerable:!0,value:Re.indexOf("CONNECTING")});Object.defineProperty(q.prototype,"CONNECTING",{enumerable:!0,value:Re.indexOf("CONNECTING")});Object.defineProperty(q,"OPEN",{enumerable:!0,value:Re.indexOf("OPEN")});Object.defineProperty(q.prototype,"OPEN",{enumerable:!0,value:Re.indexOf("OPEN")});Object.defineProperty(q,"CLOSING",{enumerable:!0,value:Re.indexOf("CLOSING")});Object.defineProperty(q.prototype,"CLOSING",{enumerable:!0,value:Re.indexOf("CLOSING")});Object.defineProperty(q,"CLOSED",{enumerable:!0,value:Re.indexOf("CLOSED")});Object.defineProperty(q.prototype,"CLOSED",{enumerable:!0,value:Re.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(r=>{Object.defineProperty(q.prototype,r,{enumerable:!0})});["open","error","close","message"].forEach(r=>{Object.defineProperty(q.prototype,`on${r}`,{enumerable:!0,get(){for(let e of this.listeners(r))if(e[Pr])return e[ac];return null},set(e){for(let o of this.listeners(r))if(o[Pr]){this.removeListener(r,o);break}typeof e=="function"&&this.addEventListener(r,e,{[Pr]:!0})}})});q.prototype.addEventListener=cc;q.prototype.removeEventListener=fc;$i.exports=q;function Gi(r,e,o,a){let x={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:ic,protocolVersion:Ir[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...a,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(r._autoPong=x.autoPong,r._closeTimeout=x.closeTimeout,!Ir.includes(x.protocolVersion))throw new RangeError(`Unsupported protocol version: ${x.protocolVersion} (supported versions: ${Ir.join(", ")})`);let f;if(e instanceof Dr)f=e;else try{f=new Dr(e)}catch{throw new SyntaxError(`Invalid URL: ${e}`)}f.protocol==="http:"?f.protocol="ws:":f.protocol==="https:"&&(f.protocol="wss:"),r._url=f.href;let d=f.protocol==="wss:",g=f.protocol==="ws+unix:",p;if(f.protocol!=="ws:"&&!d&&!g?p=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:g&&!f.pathname?p="The URL's pathname is empty":f.hash&&(p="The URL contains a fragment identifier"),p){let R=new SyntaxError(p);if(r._redirects===0)throw R;Pn(r,R);return}let _=d?443:80,w=ec(16).toString("base64"),y=d?Qx.request:$x.request,A=new Set,T;if(x.createConnection=x.createConnection||(d?pc:gc),x.defaultPort=x.defaultPort||_,x.port=f.port||_,x.host=f.hostname.startsWith("[")?f.hostname.slice(1,-1):f.hostname,x.headers={...x.headers,"Sec-WebSocket-Version":x.protocolVersion,"Sec-WebSocket-Key":w,Connection:"Upgrade",Upgrade:"websocket"},x.path=f.pathname+f.search,x.timeout=x.handshakeTimeout,x.perMessageDeflate&&(T=new Ke({...x.perMessageDeflate,isServer:!1,maxPayload:x.maxPayload}),x.headers["Sec-WebSocket-Extensions"]=uc({[Ke.extensionName]:T.offer()})),o.length){for(let R of o){if(typeof R!="string"||!hc.test(R)||A.has(R))throw new SyntaxError("An invalid or duplicated subprotocol was specified");A.add(R)}x.headers["Sec-WebSocket-Protocol"]=o.join(",")}if(x.origin&&(x.protocolVersion<13?x.headers["Sec-WebSocket-Origin"]=x.origin:x.headers.Origin=x.origin),(f.username||f.password)&&(x.auth=`${f.username}:${f.password}`),g){let R=x.path.split(":");x.socketPath=R[0],x.path=R[1]}let N;if(x.followRedirects){if(r._redirects===0){r._originalIpc=g,r._originalSecure=d,r._originalHostOrSocketPath=g?x.socketPath:f.host;let R=a&&a.headers;if(a={...a,headers:{}},R)for(let[K,ie]of Object.entries(R))a.headers[K.toLowerCase()]=ie}else if(r.listenerCount("redirect")===0){let R=g?r._originalIpc?x.socketPath===r._originalHostOrSocketPath:!1:r._originalIpc?!1:f.host===r._originalHostOrSocketPath;(!R||r._originalSecure&&!d)&&(delete x.headers.authorization,delete x.headers.cookie,R||delete x.headers.host,x.auth=void 0)}x.auth&&!a.headers.authorization&&(a.headers.authorization="Basic "+Buffer.from(x.auth).toString("base64")),N=r._req=y(x),r._redirects&&r.emit("redirect",r.url,N)}else N=r._req=y(x);x.timeout&&N.on("timeout",()=>{fe(r,N,"Opening handshake has timed out")}),N.on("error",R=>{N===null||N[Wi]||(N=r._req=null,Pn(r,R))}),N.on("response",R=>{let K=R.headers.location,ie=R.statusCode;if(K&&x.followRedirects&&ie>=300&&ie<400){if(++r._redirects>x.maxRedirects){fe(r,N,"Maximum redirects exceeded");return}N.abort();let xe;try{xe=new Dr(K,e)}catch{let z=new SyntaxError(`Invalid URL: ${K}`);Pn(r,z);return}Gi(r,xe,o,a)}else r.emit("unexpected-response",N,R)||fe(r,N,`Unexpected server response: ${R.statusCode}`)}),N.on("upgrade",(R,K,ie)=>{if(r.emit("upgrade",R),r.readyState!==q.CONNECTING)return;N=r._req=null;let xe=R.headers.upgrade;if(xe===void 0||xe.toLowerCase()!=="websocket"){fe(r,K,"Invalid Upgrade header");return}let D=tc("sha1").update(w+oc).digest("base64");if(R.headers["sec-websocket-accept"]!==D){fe(r,K,"Invalid Sec-WebSocket-Accept header");return}let z=R.headers["sec-websocket-protocol"],G;if(z!==void 0?A.size?A.has(z)||(G="Server sent an invalid subprotocol"):G="Server sent a subprotocol but none was requested":A.size&&(G="Server sent no subprotocol"),G){fe(r,K,G);return}z&&(r._protocol=z);let Ae=R.headers["sec-websocket-extensions"];if(Ae!==void 0){if(!T){fe(r,K,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let Oe;try{Oe=dc(Ae)}catch{fe(r,K,"Invalid Sec-WebSocket-Extensions header");return}let we=Object.keys(Oe);if(we.length!==1||we[0]!==Ke.extensionName){fe(r,K,"Server indicated an extension that was not requested");return}try{T.accept(Oe[Ke.extensionName])}catch{fe(r,K,"Invalid Sec-WebSocket-Extensions header");return}r._extensions[Ke.extensionName]=T}r.setSocket(K,ie,{allowSynchronousEvents:x.allowSynchronousEvents,generateMask:x.generateMask,maxPayload:x.maxPayload,skipUTF8Validation:x.skipUTF8Validation})}),x.finishRequest?x.finishRequest(N,r):N.end()}function Pn(r,e){r._readyState=q.CLOSING,r._errorEmitted=!0,r.emit("error",e),r.emitClose()}function gc(r){return r.path=r.socketPath,Ki.connect(r)}function pc(r){return r.path=void 0,!r.servername&&r.servername!==""&&(r.servername=Ki.isIP(r.host)?"":r.host),Zx.connect(r)}function fe(r,e,o){r._readyState=q.CLOSING;let a=new Error(o);Error.captureStackTrace(a,fe),e.setHeader?(e[Wi]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(Pn,r,a)):(e.destroy(a),e.once("error",r.emit.bind(r,"error")),e.once("close",r.emitClose.bind(r)))}function Tr(r,e,o){if(e){let a=sc(e)?e.size:lc(e).length;r._socket?r._sender._bufferedBytes+=a:r._bufferedAmount+=a}if(o){let a=new Error(`WebSocket is not open: readyState ${r.readyState} (${Re[r.readyState]})`);process.nextTick(o,a)}}function mc(r,e){let o=this[Z];o._closeFrameReceived=!0,o._closeMessage=e,o._closeCode=r,o._socket[Z]!==void 0&&(o._socket.removeListener("data",In),process.nextTick(Ji,o._socket),r===1005?o.close():o.close(r,e))}function _c(){let r=this[Z];r.isPaused||r._socket.resume()}function wc(r){let e=this[Z];e._socket[Z]!==void 0&&(e._socket.removeListener("data",In),process.nextTick(Ji,e._socket),e.close(r[xc])),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r))}function Hi(){this[Z].emitClose()}function yc(r,e){this[Z].emit("message",r,e)}function bc(r){let e=this[Z];e._autoPong&&e.pong(r,!this._isServer,ji),e.emit("ping",r)}function vc(r){this[Z].emit("pong",r)}function Ji(r){r.resume()}function Sc(r){let e=this[Z];e.readyState!==q.CLOSED&&(e.readyState===q.OPEN&&(e._readyState=q.CLOSING,Xi(e)),this._socket.end(),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r)))}function Xi(r){r._closeTimer=setTimeout(r._socket.destroy.bind(r._socket),r._closeTimeout)}function Vi(){let r=this[Z];if(this.removeListener("close",Vi),this.removeListener("data",In),this.removeListener("end",Yi),r._readyState=q.CLOSING,!this._readableState.endEmitted&&!r._closeFrameReceived&&!r._receiver._writableState.errorEmitted&&this._readableState.length!==0){let e=this.read(this._readableState.length);r._receiver.write(e)}r._receiver.end(),this[Z]=void 0,clearTimeout(r._closeTimer),r._receiver._writableState.finished||r._receiver._writableState.errorEmitted?r.emitClose():(r._receiver.on("error",Hi),r._receiver.on("finish",Hi))}function In(r){this[Z]._receiver.write(r)||this.pause()}function Yi(){let r=this[Z];r._readyState=q.CLOSING,r._receiver.end(),this.end()}function Qi(){let r=this[Z];this.removeListener("error",Qi),this.on("error",ji),r&&(r._readyState=q.CLOSING,this.destroy())}});var no=oe((ll,to)=>{"use strict";var dl=Tn(),{Duplex:Cc}=X("stream");function Zi(r){r.emit("close")}function Ec(){!this.destroyed&&this._writableState.finished&&this.destroy()}function eo(r){this.removeListener("error",eo),this.destroy(),this.listenerCount("error")===0&&this.emit("error",r)}function Ac(r,e){let o=!0,a=new Cc({...e,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return r.on("message",function(f,d){let g=!d&&a._readableState.objectMode?f.toString():f;a.push(g)||r.pause()}),r.once("error",function(f){a.destroyed||(o=!1,a.destroy(f))}),r.once("close",function(){a.destroyed||a.push(null)}),a._destroy=function(x,f){if(r.readyState===r.CLOSED){f(x),process.nextTick(Zi,a);return}let d=!1;r.once("error",function(p){d=!0,f(p)}),r.once("close",function(){d||f(x),process.nextTick(Zi,a)}),o&&r.terminate()},a._final=function(x){if(r.readyState===r.CONNECTING){r.once("open",function(){a._final(x)});return}r._socket!==null&&(r._socket._writableState.finished?(x(),a._readableState.endEmitted&&a.destroy()):(r._socket.once("finish",function(){x()}),r.close()))},a._read=function(){r.isPaused&&r.resume()},a._write=function(x,f,d){if(r.readyState===r.CONNECTING){r.once("open",function(){a._write(x,f,d)});return}r.send(x,d)},a.on("end",Ec),a.on("error",eo),a}to.exports=Ac});var Lr=oe((hl,ro)=>{"use strict";var{tokenChars:kc}=ht();function Dc(r){let e=new Set,o=-1,a=-1,x=0;for(x;x<r.length;x++){let d=r.charCodeAt(x);if(a===-1&&kc[d]===1)o===-1&&(o=x);else if(x!==0&&(d===32||d===9))a===-1&&o!==-1&&(a=x);else if(d===44){if(o===-1)throw new SyntaxError(`Unexpected character at index ${x}`);a===-1&&(a=x);let g=r.slice(o,a);if(e.has(g))throw new SyntaxError(`The "${g}" subprotocol is duplicated`);e.add(g),o=a=-1}else throw new SyntaxError(`Unexpected character at index ${x}`)}if(o===-1||a!==-1)throw new SyntaxError("Unexpected end of input");let f=r.slice(o,x);if(e.has(f))throw new SyntaxError(`The "${f}" subprotocol is duplicated`);return e.add(f),e}ro.exports={parse:Dc}});var fo=oe((pl,co)=>{"use strict";var Pc=X("events"),Ln=X("http"),{Duplex:gl}=X("stream"),{createHash:Ic}=X("crypto"),so=kn(),$e=lt(),Tc=Lr(),Lc=Tn(),{CLOSE_TIMEOUT:Nc,GUID:Mc,kWebSocket:Rc}=Le(),Oc=/^[+/0-9A-Za-z]{22}==$/,io=0,oo=1,xo=2,Nr=class extends Pc{constructor(e,o){if(super(),e={allowSynchronousEvents:!0,autoPong:!0,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:Nc,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:Lc,...e},e.port==null&&!e.server&&!e.noServer||e.port!=null&&(e.server||e.noServer)||e.server&&e.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(e.port!=null?(this._server=Ln.createServer((a,x)=>{let f=Ln.STATUS_CODES[426];x.writeHead(426,{"Content-Length":f.length,"Content-Type":"text/plain"}),x.end(f)}),this._server.listen(e.port,e.host,e.backlog,o)):e.server&&(this._server=e.server),this._server){let a=this.emit.bind(this,"connection");this._removeListeners=Bc(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(x,f,d)=>{this.handleUpgrade(x,f,d,a)}})}e.perMessageDeflate===!0&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=e,this._state=io}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(e){if(this._state===xo){e&&this.once("close",()=>{e(new Error("The server is not running"))}),process.nextTick(Mt,this);return}if(e&&this.once("close",e),this._state!==oo)if(this._state=oo,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(Mt,this):process.nextTick(Mt,this);else{let o=this._server;this._removeListeners(),this._removeListeners=this._server=null,o.close(()=>{Mt(this)})}}shouldHandle(e){if(this.options.path){let o=e.url.indexOf("?");if((o!==-1?e.url.slice(0,o):e.url)!==this.options.path)return!1}return!0}handleUpgrade(e,o,a,x){o.on("error",ao);let f=e.headers["sec-websocket-key"],d=e.headers.upgrade,g=+e.headers["sec-websocket-version"];if(e.method!=="GET"){Ze(this,e,o,405,"Invalid HTTP method");return}if(d===void 0||d.toLowerCase()!=="websocket"){Ze(this,e,o,400,"Invalid Upgrade header");return}if(f===void 0||!Oc.test(f)){Ze(this,e,o,400,"Missing or invalid Sec-WebSocket-Key header");return}if(g!==13&&g!==8){Ze(this,e,o,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(e)){Rt(o,400);return}let p=e.headers["sec-websocket-protocol"],_=new Set;if(p!==void 0)try{_=Tc.parse(p)}catch{Ze(this,e,o,400,"Invalid Sec-WebSocket-Protocol header");return}let w=e.headers["sec-websocket-extensions"],y={};if(this.options.perMessageDeflate&&w!==void 0){let A=new $e({...this.options.perMessageDeflate,isServer:!0,maxPayload:this.options.maxPayload});try{let T=so.parse(w);T[$e.extensionName]&&(A.accept(T[$e.extensionName]),y[$e.extensionName]=A)}catch{Ze(this,e,o,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let A={origin:e.headers[`${g===8?"sec-websocket-origin":"origin"}`],secure:!!(e.socket.authorized||e.socket.encrypted),req:e};if(this.options.verifyClient.length===2){this.options.verifyClient(A,(T,N,R,K)=>{if(!T)return Rt(o,N||401,R,K);this.completeUpgrade(y,f,_,e,o,a,x)});return}if(!this.options.verifyClient(A))return Rt(o,401)}this.completeUpgrade(y,f,_,e,o,a,x)}completeUpgrade(e,o,a,x,f,d,g){if(!f.readable||!f.writable)return f.destroy();if(f[Rc])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>io)return Rt(f,503);let _=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${Ic("sha1").update(o+Mc).digest("base64")}`],w=new this.options.WebSocket(null,void 0,this.options);if(a.size){let y=this.options.handleProtocols?this.options.handleProtocols(a,x):a.values().next().value;y&&(_.push(`Sec-WebSocket-Protocol: ${y}`),w._protocol=y)}if(e[$e.extensionName]){let y=e[$e.extensionName].params,A=so.format({[$e.extensionName]:[y]});_.push(`Sec-WebSocket-Extensions: ${A}`),w._extensions=e}this.emit("headers",_,x),f.write(_.concat(`\r
|
|
12
12
|
`).join(`\r
|
|
13
|
-
`)),f.removeListener("error",
|
|
13
|
+
`)),f.removeListener("error",ao),w.setSocket(f,d,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(w),w.on("close",()=>{this.clients.delete(w),this._shouldEmitClose&&!this.clients.size&&process.nextTick(Mt,this)})),g(w,x)}};co.exports=Nr;function Bc(r,e){for(let o of Object.keys(e))r.on(o,e[o]);return function(){for(let a of Object.keys(e))r.removeListener(a,e[a])}}function Mt(r){r._state=xo,r.emit("close")}function ao(){this.destroy()}function Rt(r,e,o,a){o=o||Ln.STATUS_CODES[e],a={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(o),...a},r.once("finish",r.destroy),r.end(`HTTP/1.1 ${e} ${Ln.STATUS_CODES[e]}\r
|
|
14
14
|
`+Object.keys(a).map(x=>`${x}: ${a[x]}`).join(`\r
|
|
15
15
|
`)+`\r
|
|
16
16
|
\r
|
|
17
|
-
`+
|
|
17
|
+
`+o)}function Ze(r,e,o,a,x,f){if(r.listenerCount("wsClientError")){let d=new Error(x);Error.captureStackTrace(d,Ze),r.emit("wsClientError",d,o,e)}else Rt(o,a,x,f)}});import{spawn as xf}from"node:child_process";import{existsSync as cf,openSync as ff}from"node:fs";import{mkdir as uf}from"node:fs/promises";import{dirname as df}from"node:path";import{fileURLToPath as lf}from"node:url";function Or(r=U()){return cf(r.libEntry)?r.libEntry:lf(new URL("../index.ts",import.meta.url))}async function Lo(r={}){let e=r.paths??U(),o=r.entryOverride??Or(e);await uf(df(e.logFile),{recursive:!0});let a=ff(e.logFile,"a"),f=o.endsWith(".ts")?["--import","tsx/esm",o,"--daemon"]:[o,"--daemon"],d=xf(process.execPath,f,{detached:!0,stdio:["ignore",a,a],env:{...process.env,COZE_BRIDGE_DAEMON:"1"}});if(d.unref(),typeof d.pid!="number")throw new Error("failed to spawn daemon (no pid)");return hf.info("daemon spawned",{pid:d.pid,entry:o}),{pid:d.pid,entry:o}}var hf,Br=De(()=>{"use strict";F();ce();hf=M("spawn-daemon")});import{spawn as vf}from"node:child_process";import{mkdir as Sf,unlink as Cf,writeFile as Ef}from"node:fs/promises";import{dirname as Af,join as kf}from"node:path";function Fn(r){return r.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function Bo(r,e){return new Promise((o,a)=>{let x=vf(r,e,{stdio:["ignore","pipe","pipe"]}),f="";x.stderr?.on("data",d=>{f+=d.toString("utf8")}),x.on("error",a),x.on("close",d=>{d===0?o():a(new Error(`${r} ${e.join(" ")} exited ${d}: ${f.trim()}`))})})}var qn,Fr,Ur,zo=De(()=>{"use strict";F();qn=M("supervisor.launchd"),Fr="ai.coze.bridge",Ur={platform:"darwin",renderConfig(r){return`<?xml version="1.0" encoding="UTF-8"?>
|
|
18
18
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
19
19
|
<plist version="1.0">
|
|
20
20
|
<dict>
|
|
@@ -22,8 +22,8 @@ var N0=Object.create;var sr=Object.defineProperty;var R0=Object.getOwnPropertyDe
|
|
|
22
22
|
<string>${Fr}</string>
|
|
23
23
|
<key>ProgramArguments</key>
|
|
24
24
|
<array>
|
|
25
|
-
<string>${
|
|
26
|
-
<string>${
|
|
25
|
+
<string>${Fn(r.nodeBin)}</string>
|
|
26
|
+
<string>${Fn(r.entry)}</string>
|
|
27
27
|
<string>--daemon</string>
|
|
28
28
|
</array>
|
|
29
29
|
<key>RunAtLoad</key>
|
|
@@ -33,12 +33,12 @@ var N0=Object.create;var sr=Object.defineProperty;var R0=Object.getOwnPropertyDe
|
|
|
33
33
|
<key>ThrottleInterval</key>
|
|
34
34
|
<integer>10</integer>
|
|
35
35
|
<key>StandardOutPath</key>
|
|
36
|
-
<string>${
|
|
36
|
+
<string>${Fn(r.logFile)}</string>
|
|
37
37
|
<key>StandardErrorPath</key>
|
|
38
|
-
<string>${
|
|
38
|
+
<string>${Fn(r.logFile)}</string>
|
|
39
39
|
</dict>
|
|
40
40
|
</plist>
|
|
41
|
-
`},configPath(r){return
|
|
41
|
+
`},configPath(r){return kf(r.homeDir,"Library","LaunchAgents",`${Fr}.plist`)},async install(r){let e=this.configPath(r);await Sf(Af(e),{recursive:!0}),await Ef(e,this.renderConfig(r),"utf8"),qn.info("plist written",{plistPath:e}),await Bo("launchctl",["load","-w",e]),qn.info("launchd job loaded",{label:Fr})},async uninstall(r){let e=this.configPath(r);await Bo("launchctl",["unload","-w",e]).catch(o=>qn.warn("launchctl unload failed (ignored)",{err:String(o)})),await Cf(e).catch(o=>{if(o.code!=="ENOENT")throw o}),qn.info("launchd job removed",{plistPath:e})}}});import{spawn as Df}from"node:child_process";import{mkdir as Pf,unlink as If,writeFile as Tf}from"node:fs/promises";import{dirname as Lf,join as Nf}from"node:path";function Kn(r,e){return new Promise((o,a)=>{let x=Df(r,e,{stdio:["ignore","pipe","pipe"]}),f="";x.stderr?.on("data",d=>{f+=d.toString("utf8")}),x.on("error",a),x.on("close",d=>{d===0?o():a(new Error(`${r} ${e.join(" ")} exited ${d}: ${f.trim()}`))})})}var Un,Hn,Hr,qo=De(()=>{"use strict";F();Un=M("supervisor.systemd"),Hn="coze-bridge.service",Hr={platform:"linux",renderConfig(r){return`[Unit]
|
|
42
42
|
Description=Coze Bridge daemon
|
|
43
43
|
After=network.target
|
|
44
44
|
|
|
@@ -52,7 +52,7 @@ StandardError=append:${r.logFile}
|
|
|
52
52
|
|
|
53
53
|
[Install]
|
|
54
54
|
WantedBy=default.target
|
|
55
|
-
`},configPath(r){return
|
|
55
|
+
`},configPath(r){return Nf(r.homeDir,".config","systemd","user",Hn)},async install(r){let e=this.configPath(r);await Pf(Lf(e),{recursive:!0}),await Tf(e,this.renderConfig(r),"utf8"),Un.info("systemd unit written",{unitPath:e}),await Kn("systemctl",["--user","daemon-reload"]),await Kn("systemctl",["--user","enable","--now",Hn]),Un.info("systemd unit enabled",{unitName:Hn})},async uninstall(r){let e=this.configPath(r);await Kn("systemctl",["--user","disable","--now",Hn]).catch(o=>Un.warn("systemctl disable failed (ignored)",{err:String(o)})),await If(e).catch(o=>{if(o.code!=="ENOENT")throw o}),await Kn("systemctl",["--user","daemon-reload"]).catch(()=>{}),Un.info("systemd unit removed",{unitPath:e})}}});import{spawn as Mf}from"node:child_process";import{join as Rf}from"node:path";function Fo(r,e){return new Promise((o,a)=>{let x=Mf(r,e,{stdio:["ignore","pipe","pipe"],shell:!1}),f="";x.stderr?.on("data",d=>{f+=d.toString("utf8")}),x.on("error",a),x.on("close",d=>{d===0?o():a(new Error(`${r} ${e.join(" ")} exited ${d}: ${f.trim()}`))})})}var Kr,jn,jr,Uo=De(()=>{"use strict";F();Kr=M("supervisor.taskscheduler"),jn="CozeBridge",jr={platform:"win32",renderConfig(r){return`<?xml version="1.0" encoding="UTF-16"?>
|
|
56
56
|
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
|
|
57
57
|
<RegistrationInfo>
|
|
58
58
|
<Description>Coze Bridge daemon</Description>
|
|
@@ -76,19 +76,19 @@ WantedBy=default.target
|
|
|
76
76
|
</Exec>
|
|
77
77
|
</Actions>
|
|
78
78
|
</Task>
|
|
79
|
-
`},configPath(r){return
|
|
79
|
+
`},configPath(r){return Rf(r.homeDir,".coze","bridge","task.xml")},async install(r){let e=`"${r.nodeBin}" "${r.entry}" --daemon`;await Fo("schtasks",["/Create","/SC","ONLOGON","/TN",jn,"/TR",e,"/RU",r.userName,"/F"]),Kr.info("task scheduler entry created",{task:jn})},async uninstall(r){await Fo("schtasks",["/Delete","/TN",jn,"/F"]).catch(e=>Kr.warn("schtasks /Delete failed (ignored)",{err:String(e)})),Kr.info("task scheduler entry removed",{task:jn})}}});var Wr={};ms(Wr,{buildContext:()=>qf,getSupervisor:()=>zf,launchdSupervisor:()=>Ur,systemdSupervisor:()=>Hr,taskSchedulerSupervisor:()=>jr});import{homedir as Of,userInfo as Bf}from"node:os";function zf(r=process.platform){switch(r){case"darwin":return Ur;case"linux":return Hr;case"win32":return jr;default:throw new Error(`unsupported platform for OS supervisor: ${r}`)}}function qf(){let r=U();return{nodeBin:process.execPath,entry:Or(r),logFile:r.logFile,homeDir:Of(),userName:Bf().username}}var Gr=De(()=>{"use strict";ce();Br();zo();qo();Uo()});Fe();F();import{readdir as ia}from"node:fs/promises";import{mkdir as ea,writeFile as ta}from"node:fs/promises";import{join as na}from"node:path";var ra={"claude-code":"CLAUDE.md",codex:"AGENTS.md",openclaw:"SOUL.md"};async function Ge(r,e,o,a){await ea(r,{recursive:!0});let x=ra[e],f=na(r,x),d=sa(e,o,a);return await ta(f,d,"utf8"),f}function sa(r,e,o){let a=`# Coze Agent: ${e}
|
|
80
80
|
|
|
81
81
|
> framework: \`${r}\`
|
|
82
82
|
|
|
83
|
-
`,x=
|
|
84
|
-
`)?
|
|
83
|
+
`,x=o?.trim()?o.endsWith(`
|
|
84
|
+
`)?o:`${o}
|
|
85
85
|
`:`_No instructions provided._
|
|
86
86
|
`;return`${a}---
|
|
87
87
|
|
|
88
|
-
${x}`}var _e=N("agent-detail-sync"),Wt=class{constructor(e){this.opts=e}opts;async syncAll(e){let i=this.opts.paths.agentsRoot,a;try{a=await ta(i)}catch(x){_e.info("agents dir not found, skip detail sync",{root:i,err:String(x)});return}_e.info("starting detail sync",{reason:e,count:a.length});for(let x of a)try{await this.syncOne(x)}catch(f){_e.warn("detail sync failed for agent, skipping",{agentId:x,err:String(f)})}_e.info("detail sync done",{reason:e})}async syncOne(e){let i=await oe(e,this.opts.paths);if(!i){_e.info("detail sync: agent config missing, skip",{agentId:e});return}let a;try{a=await this.opts.sendDetail({_meta:{cozeAgentId:e}})}catch(u){_e.warn("detail RPC failed, using local data",{agentId:e,err:String(u)});return}if(a.agentId&&a.agentId!==e){_e.warn("detail response agentId mismatch, ignoring",{agentId:e,responseAgentId:a.agentId});return}let x=!1,f=!1;if(a.agentName&&a.agentName!==i.agentName&&(i.agentName=a.agentName,x=!0),a.description!==void 0&&a.description!==i.description&&(i.description=a.description,x=!0),a.cozeIdentity&&a.cozeIdentity!==i.cozeIdentity&&(i.cozeIdentity=a.cozeIdentity,x=!0,f=!0),a.deployType&&_e.info("detail.deployType",{agentId:e,deployType:a.deployType}),!x){_e.debug("detail sync: no diff",{agentId:e});return}await ue(i,this.opts.paths),_e.info("detail sync: config updated",{agentId:e,identityChanged:f,agentName:i.agentName}),f&&(await Ve(i.workspace,i.framework,e,i.cozeIdentity),await this.opts.handlers.reloadAgentSessionsPublic(e,"detail-sync"))}};Ue();import{spawn as na}from"node:child_process";import{mkdir as ra,readFile as Ls,readdir as sa,rm as ia,stat as Yt,writeFile as oa}from"node:fs/promises";import{join as Pe,normalize as aa,relative as Ns,resolve as xa,sep as Rs}from"node:path";function Jt(r){return r?.cozeDeployType==="cloud"?"cloud":"local"}function Ss(r){let{_meta:e,...i}=r;return{stripped:i,meta:e}}function xt(r){if(!r?.cozeAgentId)throw new Error("missing _meta.cozeAgentId");return r.cozeAgentId}var E=class extends Error{code;retriable;cause;constructor(e,i,a){super(i),this.name="BridgeError",this.code=e,this.retriable=a?.retriable??!1,a?.cause!==void 0&&(this.cause=a.cause)}};F();xe();function Ye(r,e){if(Jt(r)!=="cloud")throw new E("OPERATION_NOT_ALLOWED_FOR_LOCAL",`${e} is not allowed for local agent`)}var Es="https://llm-gateway.coze.cn",Vt="auto";function xr(r){return{model:r.model??Vt,...r.modelToken?{modelToken:r.modelToken}:{}}}function Cs(r){return!r||r===Vt}function Ds(r){let e={};return r.modelToken&&(e.ANTHROPIC_BASE_URL=Es,e.ANTHROPIC_AUTH_TOKEN=r.modelToken),Cs(r.model)||(e.ANTHROPIC_MODEL=r.model),e}function As(r){let e=[];return Cs(r.model)||e.push("-c",`model="${r.model}"`),r.modelToken&&(e.push("-c",'model_provider="openai"'),e.push("-c",`model_provider_overrides.openai.base_url="${Es}/v1"`)),e}function ks(r){return r.modelToken?{OPENAI_API_KEY:r.modelToken}:{}}var Y=N("agent-handlers"),Is=5*1024*1024,ca=1,fa=6,ua=new Set(["node_modules",".git",".coze","dist","build",".next"]),da=3e4,Xt=class{constructor(e){this.opts=e}opts;async listSkills(e){Ye(e._meta,"_agent/listSkills");let i=xt(e._meta),a=await this.loadAgentCfg(i),x=a?.workspace??Ie(i).workspace,f=a?.skills??[],u=[];for(let h of f){let m=Pe(x,h.relPath,"SKILL.md");await Yt(m).then(y=>y.isFile()).catch(()=>!1)&&u.push({skillId:h.skillId,skillName:h.skillName,downloadUrl:h.downloadUrl??"",...h.description?{description:h.description}:{},...h.version?{version:h.version}:{}})}return{skills:u}}async addSkills(e){Ye(e._meta,"_agent/addSkills");let i=xt(e._meta),a=await this.requireAgentCfg(i),x=e.skills??[],f=[...a.skills??[]],u=new Map(f.map((m,w)=>[m.skillId,w])),h=[];for(let m of x){if(!m.skillName)throw new E("IPC_BAD_REQUEST","skill missing skillName");let w=la(m.skillName),y=ha(a.framework),_=Pe(y,w),C=Pe(a.workspace,_);await ra(C,{recursive:!0});let L=await pa(m.downloadUrl);wa(L)?await _a(L,C):await oa(Pe(C,"SKILL.md"),L.toString("utf8"),"utf8");let T={skillId:m.skillId,skillName:m.skillName,relPath:_,installedAt:Date.now(),...m.description?{description:m.description}:{},...m.version?{version:m.version}:{},...m.downloadUrl?{downloadUrl:m.downloadUrl}:{}},R=u.get(m.skillId);R!==void 0?f[R]=T:(u.set(m.skillId,f.length),f.push(T)),h.push(m),Y.info("skill installed",{agentId:i,skillId:m.skillId,skillName:m.skillName,relPath:_})}return await jt(i,f),await this.reloadAgentSessions(i,"skills-added"),{installedSkills:h}}async removeSkills(e){Ye(e._meta,"_agent/removeSkills");let i=xt(e._meta),a=await this.requireAgentCfg(i),x=new Set(e.skillIds??[]),f=a.skills??[],u=[];for(let h of f){if(!x.has(h.skillId)){u.push(h);continue}let m=Pe(a.workspace,h.relPath);await ia(m,{recursive:!0,force:!0}),Y.info("skill removed",{agentId:i,skillId:h.skillId,relPath:h.relPath})}return await jt(i,u),await this.reloadAgentSessions(i,"skills-removed"),{ok:!0}}reloadAgentSessionsPublic(e,i){return this.reloadAgentSessions(e,i)}async reloadAgentSessions(e,i){let a=this.opts.agents.get(e);if(a&&a.framework!=="codex")for(let[x,f]of a.sessions)try{await a.downstream.sessionLoad({sessionId:f,cwd:a.workspace}),Y.info("session reloaded",{reason:i,agentId:e,framework:a.framework,cloudId:x,acpId:f})}catch(u){Y.warn("session reload failed",{reason:i,agentId:e,framework:a.framework,cloudId:x,acpId:f,err:String(u)})}}async updateAgent(e){if(!e.cozeIdentity?.trim())return Y.info("_agent/update: empty cozeIdentity, noop",{agentId:e.agentId}),{ok:!0};let i=e.agentId,a=await oe(i);if(!a)throw new E("AGENT_NOT_FOUND",`agent not found: ${i}`);return a.cozeIdentity===e.cozeIdentity?(Y.info("_agent/update: cozeIdentity unchanged, noop",{agentId:i}),{ok:!0}):(a.cozeIdentity=e.cozeIdentity,await ue(a),await Ve(a.workspace,a.framework,i,e.cozeIdentity),Y.info("_agent/update: cozeIdentity rewritten",{agentId:i,framework:a.framework}),await this.reloadAgentSessions(i,"identity-changed"),{ok:!0})}async disconnectAgent(e){let i=e.agentId;if(!i)throw new E("IPC_BAD_REQUEST","_agent/disconnect: missing agentId");let a=await oe(i);return a?(a.disconnectedAt=Date.now(),a.disconnectReason=e.reason??"",await ue(a),Y.info("agent disconnected",{agentId:i,reason:e.reason??"",force:e.force??!1}),this.opts.disposeAndMarkDisconnected&&await this.opts.disposeAndMarkDisconnected(i,e.reason??"disconnect"),{ok:!0}):(Y.warn("_agent/disconnect: agent not found, ignoring",{agentId:i}),{ok:!0})}async switchModel(e){if(Ye(e._meta,"_agent/switchModel"),!e.agentId)throw new E("IPC_BAD_REQUEST","_agent/switchModel: missing agentId");let i=e.model&&e.model.trim()?e.model:Vt,a=e.modelToken?.trim()||void 0,x=await oe(e.agentId);if(!x)throw new E("AGENT_NOT_FOUND",`agent not found: ${e.agentId}`);x.model=i,a!==void 0?x.modelToken=a:delete x.modelToken,await ue(x),Y.info("_agent/switchModel: model/modelToken persisted",{agentId:e.agentId,model:i,hasToken:!!a,reason:e.reason??"",force:e.force??!1});let f=this.opts.agents.get(e.agentId);if(!f)return Y.info("_agent/switchModel: agent not running, config persisted only",{agentId:e.agentId}),{ok:!0};if(f.status==="switching")return Y.info("_agent/switchModel: already switching, params updated via config",{agentId:e.agentId}),{ok:!0};if(!this.opts.executeModelSwitch)throw new E("BRIDGE_INTERNAL","_agent/switchModel: executeModelSwitch callback not wired");f.status="switching";let u=f.msgQueue.enqueue(async()=>{}),h=setTimeout(()=>{Y.warn("_agent/switchModel: 30s idle timeout, forcing downstream stop",{agentId:e.agentId}),f.downstream.stop("switchModel idle timeout").catch(m=>Y.warn("force stop failed (ignored)",{agentId:e.agentId,err:String(m)}))},da);try{return await u.catch(m=>Y.warn("_agent/switchModel: msgQueue idle wait rejected (continuing)",{agentId:e.agentId,err:String(m)})),clearTimeout(h),await this.opts.executeModelSwitch(e.agentId),{ok:!0}}catch(m){clearTimeout(h),Y.error("_agent/switchModel: failed, marking disconnected",{agentId:e.agentId,err:String(m)});let w=await oe(e.agentId).catch(()=>null);throw w&&(w.disconnectedAt=Date.now(),w.disconnectReason=`model switch failed: ${m instanceof Error?m.message:String(m)}`,await ue(w).catch(y=>Y.warn("write disconnect marker failed (ignored)",{err:String(y)}))),this.opts.disposeAndMarkDisconnected?await this.opts.disposeAndMarkDisconnected(e.agentId,`model switch failed: ${m instanceof Error?m.message:String(m)}`).catch(y=>Y.warn("disposeAndMarkDisconnected failed (ignored)",{err:String(y)})):f.status="disconnected",m instanceof E&&(m.code==="MODEL_SWITCH_FAILED"||m.code==="AGENT_NOT_FOUND")?m:new E("MODEL_SWITCH_FAILED",m instanceof Error?m.message:String(m),{cause:m})}}async getFileTree(e){Ye(e._meta,"_agent/getFileTree");let i=e._meta,a=xt(i),x=this.resolveWorkspace(a),f=e.filePath??"",u=this.safeJoin(x,f),h=await Yt(u).catch(()=>null);if(!h)throw new E("IPC_BAD_REQUEST",`path not found: ${f}`);let m=ya(e.depth);return h.isDirectory()?{tree:await Bs(x,u,f,m)}:{tree:[{name:va(f),path:Ms(f||"."),isDir:!1,size:h.size,modifiedAt:Math.floor(h.mtimeMs)}]}}async getFileContent(e){Ye(e._meta,"_agent/getFileContent");let i=xt(e._meta),a=this.resolveWorkspace(i);if(!e.filePath)throw new E("IPC_BAD_REQUEST","filePath required");let x=this.safeJoin(a,e.filePath),f=await Yt(x).catch(()=>null);if(!f||!f.isFile())throw new E("IPC_BAD_REQUEST",`not a file: ${e.filePath}`);if(f.size>Is)throw new E("IPC_BAD_REQUEST",`file too large: ${f.size} bytes (max ${Is})`);let u=await Ls(x);return u.includes(0)?{content:u.toString("base64"),encoding:"base64",size:f.size}:{content:u.toString("utf8"),encoding:"utf-8",size:f.size}}resolveWorkspace(e){let i=this.opts.agents.get(e);return i?i.workspace:Ie(e).workspace}safeJoin(e,i){let a=xa(e,i||"."),x=Ns(e,a);if(x.startsWith("..")||x===".."||x.startsWith(`..${Rs}`))throw new E("IPC_BAD_REQUEST",`path escapes workspace: ${i}`);return a}loadAgentCfg(e){return oe(e)}async requireAgentCfg(e){let i=await this.loadAgentCfg(e);if(!i)throw new E("AGENT_NOT_FOUND",`no config for agent: ${e}`);return i}};function la(r){let e=r.trim().replace(/[^a-zA-Z0-9._-]+/g,"-").replace(/^-+|-+$/g,"").slice(0,64);if(!e||e==="."||e==="..")throw new E("IPC_BAD_REQUEST",`invalid skill name: ${r}`);return e}function ha(r){return r==="claude-code"?Pe(".claude","skills"):Pe(".agents","skills")}var ga=3e4,Ps=50*1024*1024,Ts=3e4;async function pa(r){if(!r)throw new E("IPC_BAD_REQUEST","skill missing downloadUrl");if(r.startsWith("data:"))return ma(r);if(r.startsWith("file:")){let e=new URL(r).pathname,i=await Ls(e);if(i.length>Ps)throw new E("IPC_BAD_REQUEST",`skill too large: ${i.length} bytes`);return i}if(r.startsWith("http://")||r.startsWith("https://")){let e=new AbortController,i=setTimeout(()=>e.abort(),ga);try{let a=await fetch(r,{signal:e.signal});if(!a.ok)throw new E("IPC_BAD_REQUEST",`fetch skill failed HTTP ${a.status} ${r}`);let x=await a.arrayBuffer();if(x.byteLength>Ps)throw new E("IPC_BAD_REQUEST",`skill too large: ${x.byteLength} bytes`);return Buffer.from(x)}finally{clearTimeout(i)}}throw new E("IPC_BAD_REQUEST",`unsupported downloadUrl scheme (\u8981 https/data/file): ${r.slice(0,80)}`)}function ma(r){let e=/^data:([^,;]*)(;base64)?,(.*)$/s.exec(r);if(!e)throw new E("IPC_BAD_REQUEST","bad data URL");let i=!!e[2],a=e[3]??"";return i?Buffer.from(a,"base64"):Buffer.from(decodeURIComponent(a),"utf8")}function wa(r){return r.length>=2&&r[0]===31&&r[1]===139}async function _a(r,e){await new Promise((i,a)=>{let x=na("tar",["-xzf","-","-C",e,"--strip-components=1"],{stdio:["pipe","pipe","pipe"]}),f="";x.stderr?.on("data",h=>{f+=String(h)});let u=setTimeout(()=>{x.kill("SIGKILL"),a(new E("IPC_BAD_REQUEST",`tar extract timeout (${Ts}ms)`))},Ts);x.on("error",h=>{clearTimeout(u),a(new E("IPC_BAD_REQUEST",`tar spawn failed: ${h.message}`,{cause:h}))}),x.on("exit",h=>{clearTimeout(u),h===0?i():a(new E("IPC_BAD_REQUEST",`tar exit ${h}${f?`: ${f.trim().slice(0,200)}`:""}`))}),x.stdin?.end(r)})}async function Bs(r,e,i,a){if(a<=0)return[];let x;try{x=await sa(e,{withFileTypes:!0})}catch{return[]}let f=[];for(let u of x){if(ua.has(u.name))continue;let h=Pe(e,u.name),m=aa(Pe(i,u.name)),w=null;try{w=await Yt(h)}catch{continue}let y={name:u.name,path:Ms(Ns(r,h)),isDir:w.isDirectory(),size:w.size,modifiedAt:Math.floor(w.mtimeMs)};w.isDirectory()&&a>1&&(y.children=await Bs(r,h,m,a-1)),f.push(y)}return f.sort((u,h)=>u.isDir!==h.isDir?u.isDir?-1:1:u.name.localeCompare(h.name)),f}function ya(r){return!r||r<=0?ca:Math.min(r,fa)}function va(r){if(!r||r==="."||r==="/")return".";let e=r.split(/[/\\]/);return e[e.length-1]||"."}function Ms(r){return r.split(Rs).join("/")}F();var Et=N("agent-health-reporter"),ba=3e4,Zt=class{constructor(e){this.opts=e;this.intervalMs=e.intervalMs??ba}opts;timer=null;inFlight=!1;unsubscribeRegister=null;intervalMs;start(){this.timer||(this.timer=setInterval(()=>{this.tick()},this.intervalMs),this.timer.unref?.(),this.unsubscribeRegister=this.opts.core.onAgentRegister(()=>{this.tick()}),Et.info("heartbeat started",{intervalMs:this.intervalMs}),this.tick())}stop(){this.timer&&(clearInterval(this.timer),this.timer=null,this.unsubscribeRegister&&(this.unsubscribeRegister(),this.unsubscribeRegister=null),Et.info("heartbeat stopped"))}async tick(){if(this.inFlight){Et.debug("previous tick still in-flight, skip");return}let e=this.opts.getDeviceId();if(!e){Et.debug("deviceId not available, skip tick (\u5C1A\u672A pair)");return}this.inFlight=!0;try{let i=[...this.opts.core.agents.values()];for(let a of i){let x=Sa(a);if(!x)continue;let f={status:x,_meta:{cozeAgentId:a.agentId,cozeDeviceId:e}};try{await this.opts.core.sendRequest("_agent/health",f)}catch(u){Et.warn("heartbeat send failed",{agentId:a.agentId,status:x,err:String(u)})}}}finally{this.inFlight=!1}}};function Sa(r){return r.status==="error"?"error":r.activeTriggers.size>0?"busy":r.status==="ok"||r.status==="degraded"?"online":null}Ue();import{mkdir as cr,rm as Na}from"node:fs/promises";import{spawn as ka}from"node:child_process";function ct(r,e,i){return i===void 0?{jsonrpc:"2.0",id:r,method:e}:{jsonrpc:"2.0",id:r,method:e,params:i}}function Os(r,e){return e===void 0?{jsonrpc:"2.0",method:r}:{jsonrpc:"2.0",method:r,params:e}}function ft(r,e){return{jsonrpc:"2.0",id:r,result:e}}function Xe(r,e){return{jsonrpc:"2.0",id:r,error:e}}var $t=class extends Error{code;data;constructor(e){super(`JSON-RPC error code=${e.code} ${e.message}`),this.name="RemoteRpcError",this.code=e.code,e.data!==void 0&&(this.data=e.data)}},U={PARSE_ERROR:-32700,INVALID_REQUEST:-32600,METHOD_NOT_FOUND:-32601,INVALID_PARAMS:-32602,INTERNAL_ERROR:-32603,AGENT_NOT_FOUND:-32001,AGENT_BUSY:-32002,AGENT_TIMEOUT:-32003,AGENT_SPAWN_FAILED:-32004,OPERATION_NOT_ALLOWED_FOR_LOCAL:-32005,AGENT_DISCONNECTED:-32006,MODEL_SWITCHING:-32007,MODEL_SWITCH_FAILED:-32008};function Qt(r){return"method"in r&&"id"in r&&r.id!==void 0}function zs(r){return"method"in r&&!("id"in r)}function en(r){return!("method"in r)&&"id"in r}var Ea={AGENT_NOT_FOUND:U.AGENT_NOT_FOUND,AGENT_BUSY:U.AGENT_BUSY,AGENT_DISCONNECTED:U.AGENT_DISCONNECTED,AGENT_TIMEOUT:U.AGENT_TIMEOUT,AGENT_SPAWN_FAILED:U.AGENT_SPAWN_FAILED,AGENT_PROTOCOL_ERROR:U.INTERNAL_ERROR,BRIDGE_CONFIG_INVALID:U.INTERNAL_ERROR,BRIDGE_INTERNAL:U.INTERNAL_ERROR,IPC_AUTH_FAILED:U.INTERNAL_ERROR,IPC_BAD_REQUEST:U.INVALID_REQUEST,MODEL_SWITCHING:U.MODEL_SWITCHING,MODEL_SWITCH_FAILED:U.MODEL_SWITCH_FAILED,OPERATION_NOT_ALLOWED_FOR_LOCAL:U.OPERATION_NOT_ALLOWED_FOR_LOCAL,UPSTREAM_DISCONNECTED:U.INTERNAL_ERROR,UPSTREAM_HANDSHAKE_FAILED:U.INTERNAL_ERROR};function tn(r){return r instanceof E?{code:Ea[r.code]??U.INTERNAL_ERROR,message:r.message,data:{bridgeCode:r.code,retriable:r.retriable}}:{code:U.INTERNAL_ERROR,message:r instanceof Error?r.message:String(r)}}function qs(r){let e=r.data,i=e?.bridgeCode??"AGENT_PROTOCOL_ERROR";return new E(i,r.message,{retriable:e?.retriable??!1,cause:r.data})}function Fs(r){return`${JSON.stringify(r)}
|
|
89
|
-
`}var
|
|
90
|
-
`);this.buffer=i.pop()??"";let a=[];for(let x of i){let f=x.replace(/\r$/,"").trim();if(f)try{a.push(JSON.parse(f))}catch(u){this.onError?.({line:f,error:u})}}return a}flush(){if(!this.buffer)return[];let e=this.buffer.replace(/\r$/,"").trim();if(this.buffer="",!e)return[];try{return[JSON.parse(e)]}catch(i){return this.onError?.({line:e,error:i}),[]}}};var Hs={"session/prompt":"session.prompt","session/cancel":"session.cancel","session/new":"session.new","session/load":"session.load","_agent/create":"agent.create","_agent/health":"agent.health","_agent/pair":"agent.pair","_agent/listSkills":"agent.listSkills","_agent/addSkills":"agent.addSkills","_agent/removeSkills":"agent.removeSkills","_agent/getFileTree":"agent.getFileTree","_agent/getFileContent":"agent.getFileContent","_agent/detail":"agent.detail","_agent/update":"agent.update","_agent/disconnect":"agent.disconnect","_agent/switchModel":"agent.switchModel",initialize:"initialize"},Fu=Object.fromEntries(Object.entries(Hs).map(([r,e])=>[e,r])),Ca={"session.prompt":["agentId","triggerMsgId","sessionId"],"session.cancel":["agentId","triggerMsgId","sessionId"],"session.new":["agentId"],"session.load":["agentId"],"agent.create":["agentId"],"agent.health":["agentId"],"agent.listSkills":["agentId"],"agent.addSkills":["agentId"],"agent.removeSkills":["agentId"],"agent.getFileTree":["agentId"],"agent.getFileContent":["agentId"],"agent.detail":["agentId"],"agent.update":["agentId"],"agent.disconnect":["agentId"],"agent.switchModel":["agentId"],"agent.pair":[],initialize:[]},ut=class{seq=0;next(e,i){this.seq+=1;let a=Hs[e]??Da(e),x=Ca[a]??[],f=[a,String(this.seq)];if(x.length>0){let u=x.map(m=>Us(i?.[m]??"")),h=Aa(u).join(":");h&&f.push(h)}else i&&Object.values(i).some(u=>u)&&f.push(Object.values(i).filter(Boolean).map(u=>Us(String(u))).join(":"));return f.join("_")}reset(){this.seq=0}};function Da(r){return r.replace(/[\s/]+/g,".").replace(/_+/g,"-")}function Us(r){return r.replace(/[:_\s]+/g,"-")}function Aa(r){let e=r.length;for(;e>0&&!r[e-1];)e-=1;return r.slice(0,e)}F();var Ia=3e4;function Ks(r,e){if(!(typeof r!="number"||r<=0))try{process.platform==="win32"?process.kill(r,e):process.kill(-r,e)}catch{}}var He=class{constructor(e){this.opts=e;this.log=N(`downstream.${this.constructor.name}`),this.decoder=new nn({onError:i=>this.log.warn("decode line failed",{line:i.line})})}opts;child;decoder;pending=new Map;idAllocator=new ut;updateHandlers=[];agentRequestHandlers=[];exitHandlers=[];log;stopped=!1;sanitizeEnv(e){return e}async start(){if(this.child)throw new E("BRIDGE_INTERNAL","Downstream already started");let e=process.platform!=="win32",i=ka(this.opts.command,this.opts.args,{cwd:this.opts.cwd,env:{...this.sanitizeEnv(process.env),...this.opts.env},stdio:["pipe","pipe","pipe"],detached:e});this.child=i,i.stdout?.setEncoding("utf8"),i.stdout?.on("data",a=>{for(let x of this.decoder.push(a))this.dispatch(x)}),i.stderr?.setEncoding("utf8"),i.stderr?.on("data",a=>{this.log.debug("stderr",{text:a.trimEnd()})}),i.on("exit",(a,x)=>{this.stopped=!0,this.failAllPending(new E("AGENT_PROTOCOL_ERROR",`agent exited (${a}/${x})`));for(let f of this.exitHandlers)f(a,x)}),i.on("error",a=>{this.log.error("child error",{err:String(a)}),this.failAllPending(new E("AGENT_SPAWN_FAILED",String(a),{cause:a}))}),this.log.info("downstream started",{command:this.opts.command,pid:i.pid,cwd:this.opts.cwd})}async stop(e){if(!this.child||this.stopped)return;this.stopped=!0,this.log.info("downstream stopping",{reason:e});let i=this.child,a=new Promise(f=>i.once("exit",()=>f()));Ks(i.pid,"SIGTERM");let x=setTimeout(()=>{i.killed||Ks(i.pid,"SIGKILL")},5e3);try{await a}finally{clearTimeout(x)}}pid(){return this.child?.pid}isAlive(){return!!this.child&&!this.stopped}initialize(e){return this.call("initialize",e)}sessionNew(e){return this.call("session/new",{mcpServers:[],...e})}sessionLoad(e){return this.call("session/load",{mcpServers:[],...e})}sessionPrompt(e){return this.call("session/prompt",e,0)}async sessionCancel(e){if(!this.child||this.stopped)return;let i=this.idAllocator.next("session/cancel");this.writeFrame(ct(i,"session/cancel",e))}onUpdate(e){this.updateHandlers.push(e)}onAgentRequest(e){this.agentRequestHandlers.push(e)}respondAgentRequest(e,i){if(!(!this.child||this.stopped))try{this.writeFrame(ft(e,i))}catch(a){this.log.warn("respondAgentRequest write failed",{id:e,err:String(a)})}}respondAgentRequestError(e,i){if(!(!this.child||this.stopped))try{this.writeFrame(Xe(e,i))}catch(a){this.log.warn("respondAgentRequestError write failed",{id:e,err:String(a)})}}onExit(e){this.exitHandlers.push(e)}call(e,i,a=Ia){if(!this.child||this.stopped)return Promise.reject(new E("AGENT_PROTOCOL_ERROR","downstream not started"));let x=this.idAllocator.next(e),f=ct(x,e,i),u=a>0&&Number.isFinite(a);return new Promise((h,m)=>{let w=u?setTimeout(()=>{this.pending.delete(x),m(new E("AGENT_TIMEOUT",`${e} timed out after ${a}ms`))},a):null;this.pending.set(x,{resolve:h,reject:m,timer:w,method:e});try{this.writeFrame(f)}catch(y){w&&clearTimeout(w),this.pending.delete(x),m(y)}})}writeFrame(e){if(!this.child?.stdin||this.child.stdin.destroyed)throw new E("AGENT_PROTOCOL_ERROR","downstream stdin not writable");this.child.stdin.write(Fs(e))}dispatch(e){if(en(e)){let i=e.id!==null?this.pending.get(e.id):void 0;if(!i){this.log.warn("orphan response",{id:e.id});return}this.pending.delete(e.id),i.timer&&clearTimeout(i.timer),e.error?i.reject(qs(e.error)):i.resolve(e.result);return}if(zs(e)){if(e.method==="session/update")for(let i of this.updateHandlers)Promise.resolve(i(e.params)).catch(a=>this.log.warn("update handler failed",{err:String(a)}));else this.log.debug("unknown notification",{method:e.method});return}if(Qt(e)){let i=e;this.handleAgentRequest(i).catch(a=>this.log.error("agent request handler failed",{method:i.method,err:String(a)}))}}async handleAgentRequest(e){if(this.agentRequestHandlers.length===0){this.writeFrame(Xe(e.id,{code:-32601,message:`method not handled by Bridge: ${e.method}`}));return}for(let i of this.agentRequestHandlers)try{await i(e)}catch(a){this.log.error("agentRequestHandler threw",{method:e.method,err:String(a)});try{this.writeFrame(Xe(e.id,tn(a)))}catch{}}}failAllPending(e){for(let i of this.pending.values())i.timer&&clearTimeout(i.timer),i.reject(e);this.pending.clear()}};var Pa="@zed-industries/claude-code-acp@latest";function Ta(r){let e={};for(let[i,a]of Object.entries(r))a!==void 0&&(i.startsWith("CLAUDE")||i==="AI_AGENT"||i==="BAGGAGE"||(e[i]=a));return e}var rn=class extends He{framework="claude-code";constructor(e){let i=e.command??"npx",a=e.args??["-y",Pa],x={command:i,args:a,cwd:e.cwd,...e.env?{env:e.env}:{}};super(x)}sanitizeEnv(e){return Ta(e)}};var La="@zed-industries/codex-acp@latest",sn=class extends He{framework="codex";constructor(e){let i=e.command??"npx",a=e.args??["-y",La],x=e.extraArgs?[...a,...e.extraArgs]:a,f={command:i,args:x,cwd:e.cwd,...e.env?{env:e.env}:{}};super(f)}};import{spawn as js}from"node:child_process";F();var on=class extends He{framework="openclaw";registerLog;profile;agentId;sessionName;registered=!1;constructor(e){let i=e.profile??"coze",a=e.sessionName??"default",x=["--profile",i,"acp","--session",`agent:${e.agentId}:${a}`],f={command:e.command,args:x,cwd:e.cwd,...e.env?{env:e.env}:{}};super(f),this.profile=i,this.agentId=e.agentId,this.sessionName=a,this.registerLog=N("downstream.openclaw.register")}async start(){await this.registerAgent().catch(e=>{this.registerLog.warn("openclaw agents add failed (will continue to acp anyway)",{agentId:this.agentId,err:String(e)})}),await super.start()}registerAgent(){return new Promise((e,i)=>{let a=js(this.opts.command,["--profile",this.profile,"agents","add",this.agentId,"--workspace",this.opts.cwd,"--non-interactive"],{stdio:["ignore","pipe","pipe"],env:{...process.env,...this.opts.env}}),x="";a.stderr?.on("data",f=>{x+=f.toString("utf8")}),a.on("error",i),a.on("close",f=>{f===0?(this.registered=!0,this.registerLog.info("agent registered",{agentId:this.agentId,profile:this.profile}),e()):i(new E("AGENT_SPAWN_FAILED",`openclaw agents add ${this.agentId} exited ${f}: ${x.trim()}`))})})}async cleanup(e){this.registered&&await new Promise(i=>{let a=js(this.opts.command,["--profile",this.profile,"agents","delete",this.agentId,"--force"],{stdio:["ignore","pipe","pipe"],env:{...process.env,...this.opts.env}}),x="";a.stderr?.on("data",f=>{x+=f.toString("utf8")}),a.on("error",f=>{this.registerLog.warn("openclaw agents delete failed (best-effort)",{agentId:this.agentId,err:String(f)}),i()}),a.on("close",f=>{f===0?this.registerLog.info("agent unregistered",{agentId:this.agentId}):this.registerLog.warn("openclaw agents delete non-zero exit",{agentId:this.agentId,code:f,stderr:x.trim()}),this.registered=!1,i()})})}get acpSessionName(){return this.sessionName}};F();xe();var an=class{slots=[];running=!1;closed=!1;disposed=!1;enqueue(e){return this.disposed?Promise.reject(new Error("AsyncQueue disposed")):this.closed?Promise.reject(new Error("AsyncQueue closed")):new Promise((i,a)=>{this.slots.push({task:e,resolve:i,reject:a}),this.drain()})}close(){this.closed=!0}dispose(e=new Error("AsyncQueue disposed")){for(this.disposed=!0,this.closed=!0;this.slots.length>0;)this.slots.shift()?.reject(e)}get size(){return this.slots.length}get isRunning(){return this.running}async drain(){if(!this.running){this.running=!0;try{for(;this.slots.length>0&&!this.disposed;){let e=this.slots.shift();if(!e)break;try{let i=await e.task();e.resolve(i)}catch(i){e.reject(i)}}}finally{this.running=!1}}}};var xn=class{agentId;framework;workspace;msgQueue;sessions=new Map;verifiedSessions=new Set;activeTriggers=new Map;status="starting";lastActiveAt=Date.now();_downstream;constructor(e){this.agentId=e.agentId,this.framework=e.framework,this.workspace=e.workspace,this._downstream=e.downstream,this.msgQueue=new an}get downstream(){return this._downstream}swap(e){this._downstream=e,this.verifiedSessions.clear(),this.activeTriggers.clear()}async dispose(e){this.status="stopped",this.msgQueue.dispose(new Error(`AgentSession disposed${e?`: ${e}`:""}`)),await this._downstream.stop(e)}};var H=N("agent-manager"),Ra=(r,e,i,a,x)=>{switch(r){case"claude-code":{let f=x?Ds(x):void 0;return new rn({cwd:i,...f&&Object.keys(f).length>0?{env:f}:{}})}case"codex":{let f=x?As(x):[],u=x?ks(x):void 0;return new sn({cwd:i,...f.length>0?{extraArgs:f}:{},...u&&Object.keys(u).length>0?{env:u}:{}})}case"openclaw":return new on({command:e,cwd:i,agentId:a})}},Ba=[0,5e3,5e3],Ma=2e4,Gs={protocolVersion:1,clientCapabilities:{fs:{readTextFile:!0,writeTextFile:!0}}},cn=class{paths;config;registry;factory;restartDelaysMs;createTimeoutMs;healthReporter;constructor(e){this.paths=e.paths,this.config=e.config,this.registry=e.registry,this.factory=e.downstreamFactory??Ra,this.restartDelaysMs=e.restartDelaysMs??Ba,this.createTimeoutMs=e.createTimeoutMs??Ma,this.healthReporter=e.healthReporter}async createAgent(e){if(!e.agentId)throw new E("IPC_BAD_REQUEST","agentId required");if(!e.framework)throw new E("IPC_BAD_REQUEST","framework required");if(Jt(e._meta)==="cloud")return H.info("cloud-deployed agent, ack without local spawn",{agentId:e.agentId,framework:e.framework}),{ok:!0,agentId:e.agentId,framework:e.framework};this.registry.reviveIfDisconnected?.(e.agentId);let i=this.registry.get(e.agentId);if(i){if(i.framework!==e.framework)throw new E("AGENT_BUSY",`agent ${e.agentId} exists with different framework (${i.framework})`);if(i.status==="error")H.warn("existing agent in error state, rebuilding",{agentId:e.agentId}),await i.dispose("rebuild after error").catch(m=>H.warn("dispose stale agent failed (ignored)",{err:String(m)})),this.registry.unregister(e.agentId);else return H.info("agent already exists,return current",{agentId:e.agentId}),{ok:!0,agentId:i.agentId,workspace:i.workspace,pid:i.downstream.pid()??0,framework:i.framework}}let a=this.config.frameworksCache?.[e.framework];if(!a)throw new E("AGENT_SPAWN_FAILED",`framework ${e.framework} not detected on this machine; rerun daemon to refresh frameworks_cache`);let x=Ie(e.agentId,this.paths),f=e.workspace??x.workspace,u=new AbortController,h=setTimeout(()=>u.abort(new E("AGENT_TIMEOUT",`_agent/create timed out after ${this.createTimeoutMs}ms`)),this.createTimeoutMs);try{return await this.createAgentInner(e,x,f,a,u.signal)}finally{clearTimeout(h)}}async createAgentInner(e,i,a,x,f){let u=()=>{if(f.aborted)throw f.reason instanceof Error?f.reason:new E("AGENT_TIMEOUT","_agent/create aborted")},h,m,w=!1;try{await cr(i.root,{recursive:!0}),await cr(a,{recursive:!0}),await cr(i.logs,{recursive:!0}),u(),e.framework!=="openclaw"&&await Ve(a,e.framework,e.agentId,e.cozeIdentity),u();let y=await oe(e.agentId,this.paths).catch(()=>null),_=xr({model:e.model??y?.model,modelToken:e.modelToken??y?.modelToken});if(h=this.factory(e.framework,x.path,a,e.agentId,_),await h.start(),u(),await h.initialize(Gs),u(),e.framework==="openclaw"&&await Ve(a,"openclaw",e.agentId,e.cozeIdentity),m=new xn({agentId:e.agentId,framework:e.framework,workspace:a,downstream:h}),m.status="ok",y?.sessions){for(let[T,R]of Object.entries(y.sessions))m.sessions.set(T,R);Object.keys(y.sessions).length>0&&H.info("restored persisted sessions for agent",{agentId:e.agentId,count:Object.keys(y.sessions).length})}this.registry.register(m),w=!0;let C={agentId:e.agentId,framework:e.framework,workspace:a,cozeIdentity:e.cozeIdentity,createdAt:y?.createdAt??Date.now(),sessions:y?.sessions??{},model:_.model};_.modelToken&&(C.modelToken=_.modelToken),y?.skills&&(C.skills=y.skills),y?.agentName&&(C.agentName=y.agentName),y?.description&&(C.description=y.description),await ue(C,this.paths);let L=h.pid()??0;return H.info("agent created",{agentId:e.agentId,framework:e.framework,pid:L}),this.installRestartHook(m),{ok:!0,agentId:e.agentId,workspace:a,pid:L,framework:e.framework}}catch(y){throw H.error("agent create failed,rolling back",{agentId:e.agentId,err:String(y)}),h?.cleanup&&await h.cleanup("rollback").catch(_=>H.warn("downstream cleanup failed (ignored)",{err:String(_)})),h&&await h.stop("rollback").catch(()=>{}),w&&m&&(await m.dispose("rollback").catch(()=>{}),this.registry.unregister(e.agentId)),await Na(i.root,{recursive:!0,force:!0}).catch(_=>H.warn("rm agent dir failed (ignored)",{err:String(_)})),y instanceof E?y:new E("AGENT_SPAWN_FAILED",String(y),{cause:y})}}async reportHealth(e,i,a){if(!this.healthReporter){H.info("healthReporter not wired, skip _agent/health upstream",{agentId:e.agentId,status:i});return}try{await this.healthReporter({status:i,_meta:{cozeAgentId:e.agentId}}),H.info("_agent/health reported",{agentId:e.agentId,status:i,cause:a})}catch(x){H.warn("_agent/health upstream failed (ignored)",{agentId:e.agentId,status:i,err:String(x)})}}installRestartHook(e){let i=0,a=x=>{if(e.status==="stopped"||e.status==="disconnected"||e.status==="switching")return;if(i>=this.restartDelaysMs.length){H.error("agent restart exhausted",{agentId:e.agentId,attempts:i,...x}),e.status="error",this.reportHealth(e,"error",x);return}let f=this.restartDelaysMs[i]??5e3;i+=1,e.status="degraded",H.warn("agent restart scheduled",{agentId:e.agentId,attempt:i,delayMs:f,...x}),setTimeout(()=>{this.doRestart(e,i).then(u=>{u?(i=0,e.status="ok"):a(null)})},f)};e.downstream.onExit((x,f)=>a({code:x,signal:f}))}async spawnAndInitialize(e,i){let a=await oe(e.agentId,this.paths).catch(()=>null),x=a?xr(a):void 0,f=this.factory(e.framework,i,e.workspace,e.agentId,x);try{return await f.start(),await f.initialize(Gs),f}catch(u){throw await f.stop("spawnAndInitialize failed").catch(()=>{}),u}}rewireSession(e,i){e.swap(i),this.registry.attachHooks?.(e),this.installRestartHook(e)}async doRestart(e,i){let a=this.config.frameworksCache?.[e.framework];if(!a)return H.error("framework cache missing during restart",{agentId:e.agentId,framework:e.framework}),e.status="error",!1;H.info("agent restart attempt",{agentId:e.agentId,attempt:i});try{let x=await this.spawnAndInitialize(e,a.path);return this.rewireSession(e,x),H.info("agent restart succeeded",{agentId:e.agentId,attempt:i}),!0}catch(x){return H.warn("agent restart attempt failed",{agentId:e.agentId,attempt:i,err:String(x)}),!1}}async executeModelSwitch(e){let i=this.registry.get(e);if(!i)throw new E("AGENT_NOT_FOUND",`agent not found: ${e}`);let a=this.config.frameworksCache?.[i.framework];if(!a)throw new E("AGENT_SPAWN_FAILED",`framework ${i.framework} not detected; cannot respawn for switchModel`);H.info("executeModelSwitch: stopping old downstream",{agentId:e,framework:i.framework}),await i.downstream.stop("switchModel").catch(u=>{H.warn("stop old downstream failed (ignored, continuing)",{agentId:e,err:String(u)})});let x;try{x=await this.spawnAndInitialize(i,a.path)}catch(u){throw new E("MODEL_SWITCH_FAILED",`failed to spawn new downstream after switchModel: ${u instanceof Error?u.message:String(u)}`,{cause:u})}this.rewireSession(i,x);let f=[...i.sessions.entries()];for(let[u,h]of f)try{await x.sessionLoad({sessionId:h,cwd:i.workspace}),i.verifiedSessions.add(h)}catch(m){throw new E("MODEL_SWITCH_FAILED",`sessionLoad failed after switchModel for cloud session ${u} (acp=${h}): ${m instanceof Error?m.message:String(m)}`,{cause:m})}f.length>0&&H.info("executeModelSwitch: session/load reloaded",{agentId:e,count:f.length}),i.status="ok",H.info("executeModelSwitch: success",{agentId:e,framework:i.framework})}};F();import{spawn as Oa}from"node:child_process";import{constants as Ws,access as za}from"node:fs/promises";import{delimiter as qa,join as Fa}from"node:path";var Ua=N("framework-detector"),Js={"claude-code":"claude",codex:"codex",openclaw:"openclaw"},Ha=[".exe",".cmd",".bat",".ps1"],Ct=class{env;constructor(e={}){this.env={pathEnv:e.pathEnv??process.env.PATH??"",platform:e.platform??process.platform,spawn:e.spawn??Oa,access:e.access??za}}async detect(e){let i=Js[e],a=await this.which(i);if(!a)return Ua.debug("framework binary not found",{framework:e,bin:i}),null;let x=await this.probeVersion(a);return{path:a,version:x}}async detectAll(){let e=await Promise.all(Object.keys(Js).map(async a=>[a,await this.detect(a)])),i={};for(let[a,x]of e)x&&(i[a]=x);return i}async which(e){let i=this.env.pathEnv.split(qa).filter(Boolean),a=this.env.platform==="win32"?["",...Ha]:[""];for(let x of i)for(let f of a){let u=Fa(x,e+f);if(await this.isExecutable(u))return u}return null}async isExecutable(e){try{let i=this.env.platform==="win32"?Ws.F_OK:Ws.X_OK;return await this.env.access(e,i),!0}catch{return!1}}async probeVersion(e){return new Promise(i=>{let a="",x=!1,f,u=h=>{x||(x=!0,f&&clearTimeout(f),i(h.trim()||"unknown"))};try{let h=this.env.spawn(e,["--version"],{stdio:["ignore","pipe","pipe"]});f=setTimeout(()=>{h.kill("SIGKILL"),u("unknown")},5e3),h.stdout?.on("data",m=>{a+=m.toString("utf8")}),h.on("error",()=>u("unknown")),h.on("close",()=>{let m=ja(a).split(/\r?\n/)[0]??"";u(m)})}catch{u("unknown")}})}},Ka=new RegExp("\x1B\\[[0-9;]*[A-Za-z]","g");function ja(r){return r.replace(Ka,"")}ir();xe();function fn(r){return qt(r??K().configFile)}function Dt(r,e){return Ft(e??K().configFile,r)}Ue();F();var X=N("core"),Ga=5*6e4,Wa=3e4,un=class{upstream;agents=new Map;disconnectedAgents=new Set;extensions;paths;upstreamIds=new ut;pendingUpstream=new Map;pendingBridge=new Map;constructor(e){this.upstream=e.upstream,this.extensions=e.extensions??{},this.paths=e.paths}registerExtension(e,i){this.extensions[e]=i}async start(){this.upstream.onFrame(e=>this.handleFrame(e)),await this.upstream.start(),X.info("Core started",{extensions:Object.keys(this.extensions)})}async stop(e){X.info("Core stopping",{reason:e}),await Promise.all([...this.agents.values()].map(i=>i.dispose(e))),this.agents.clear(),await this.upstream.stop(e)}get(e){return this.agents.get(e)}register(e){this.agents.set(e.agentId,e),this.attachDownstreamHooks(e),X.info("agent registered",{agentId:e.agentId,framework:e.framework});for(let i of this.registerHandlers)try{i(e.agentId)}catch(a){X.warn("onAgentRegister handler threw (ignored)",{agentId:e.agentId,err:String(a)})}}onAgentRegister(e){return this.registerHandlers.add(e),()=>this.registerHandlers.delete(e)}registerHandlers=new Set;unregister(e){this.agents.delete(e)}reviveIfDisconnected(e){this.disconnectedAgents.delete(e)&&X.info("agent revived from disconnect",{agentId:e})}attachDownstreamHooks(e){e.downstream.onUpdate(i=>{this.forwardUpdate(e,i)}),e.downstream.onAgentRequest(i=>{this.handleAgentRequest(e,i)}),e.downstream.onExit((i,a)=>{X.warn("agent downstream exited",{agentId:e.agentId,code:i,signal:a})})}attachHooks(e){this.attachDownstreamHooks(e)}async handleFrame(e){if(en(e)){this.handleUpstreamResponse(e);return}if(Qt(e))try{if(e.method.startsWith("_agent/")){let i=this.extensions[e.method];if(!i){await this.sendError(e.id,U.METHOD_NOT_FOUND,`extension not registered: ${e.method}`);return}let a=await i(e,this);await this.upstream.send(ft(e.id,a));return}if(e.method.startsWith("session/")){let i=await this.routeSessionMethod(e);await this.upstream.send(ft(e.id,i));return}if(e.method==="initialize"){await this.upstream.send(ft(e.id,{protocolVersion:1,agentCapabilities:{loadSession:!0}}));return}await this.sendError(e.id,U.METHOD_NOT_FOUND,`method not implemented: ${e.method}`)}catch(i){X.error("handleFrame failed",{method:e.method,err:String(i)}),await this.upstream.send(Xe(e.id,tn(i)))}}async routeSessionMethod(e){if(!e.params||typeof e.params!="object")throw new E("IPC_BAD_REQUEST",`${e.method} requires params`);let i=e.params,a=i._meta?.cozeAgentId;if(!a)throw new E("IPC_BAD_REQUEST",`${e.method}: missing _meta.cozeAgentId`);let x=this.agents.get(a);if(!x)throw this.disconnectedAgents.has(a)?new E("AGENT_DISCONNECTED",`agent ${a} has been disconnected; cloud must _agent/create to revive`):new E("AGENT_NOT_FOUND",`agent not found: ${a}`);if(x.status==="switching")throw new E("MODEL_SWITCHING",`agent ${a} is switching model; retry later`,{retriable:!0});let f=Date.now(),u=!1;try{let h=await x.msgQueue.enqueue(()=>this.dispatchSessionCall(x,e.method,i));return u=!0,h}finally{X.info("session call done",{agentId:x.agentId,method:e.method,durationMs:Date.now()-f,ok:u})}}async dispatchSessionCall(e,i,a){e.lastActiveAt=Date.now();let{stripped:x}=Ss(a);switch(i){case"session/new":{let f=x;return await e.downstream.sessionNew({...f,cwd:f.cwd||e.workspace})}case"session/load":{let f=x,u=f.sessionId,h=e.sessions.get(u);try{let m=h??u,w=await e.downstream.sessionLoad({...f,sessionId:m,cwd:f.cwd||e.workspace});return h||e.sessions.set(u,m),w}catch(m){X.warn("session/load failed,fallback to session/new",{agentId:e.agentId,cloudId:u,err:String(m)});let w=await e.downstream.sessionNew({cwd:f.cwd||e.workspace});return e.sessions.set(u,w.sessionId),{}}}case"session/prompt":{let f=x,u=f.sessionId,h=e.sessions.get(u),m=!1;if(h&&!e.verifiedSessions.has(h))try{await e.downstream.sessionLoad({sessionId:h,cwd:e.workspace}),e.verifiedSessions.add(h),X.info("session restored via session/load",{agentId:e.agentId,cloudId:u,acpId:h})}catch(_){X.warn("session/load failed,fallback to session/new",{agentId:e.agentId,cloudId:u,acpId:h,err:String(_)}),e.sessions.delete(u),h=void 0}h||(h=(await e.downstream.sessionNew({cwd:e.workspace})).sessionId,e.sessions.set(u,h),e.verifiedSessions.add(h),m=!0);let w=a._meta?.cozeTriggerMsgId;w?e.activeTriggers.set(h,w):e.activeTriggers.delete(h);let y=await e.downstream.sessionPrompt({...f,sessionId:h});return m&&this.persistSessionMapping(e),y}case"session/cancel":{let u=x.sessionId;if(!u)throw new E("IPC_BAD_REQUEST","session/cancel: missing sessionId");let h=e.sessions.get(u);return h&&await e.downstream.sessionCancel({sessionId:h}),{ok:!0}}default:throw new E("IPC_BAD_REQUEST",`session method not supported: ${i}`)}}forwardUpdate(e,i){let a=i.sessionId,x=this.reverseSessionId(e,a);if(!x){X.debug("drop update for unknown session",{agentId:e.agentId,acpId:a});return}let f={cozeAgentId:e.agentId},u=e.activeTriggers.get(a);u&&(f.cozeTriggerMsgId=u),this.upstream.send(Os("session/update",{...i,sessionId:x,_meta:f})).catch(h=>X.warn("forward update failed",{agentId:e.agentId,err:String(h)}))}handleAgentRequest(e,i){if(i.method==="session/request_permission"){this.forwardPermissionRequest(e,i);return}X.warn("unhandled agent request,returning method_not_found",{agentId:e.agentId,method:i.method}),e.downstream.respondAgentRequestError(i.id,{code:U.METHOD_NOT_FOUND,message:`method not handled by Bridge: ${i.method}`})}forwardPermissionRequest(e,i){let a=this.upstreamIds.next("session/request_permission"),x=i.params??{},u=x.sessionId,h=u?e.activeTriggers.get(u):void 0,m={cozeAgentId:e.agentId};h&&(m.cozeTriggerMsgId=h);let w=u?this.reverseSessionId(e,u):void 0,y={...x,...w?{sessionId:w}:{},_meta:m},_=setTimeout(()=>{let C=this.pendingUpstream.get(a);C&&(this.pendingUpstream.delete(a),X.warn("upstream permission request timed out,replying cancelled to agent",{agentId:e.agentId,upstreamId:a}),e.downstream.respondAgentRequest(C.agentRequestId,{outcome:{kind:"cancelled"}}))},Ga);this.pendingUpstream.set(a,{agentRequestId:i.id,session:e,method:i.method,timer:_}),this.upstream.send(ct(a,"session/request_permission",y)).catch(C=>{let L=this.pendingUpstream.get(a);L&&(clearTimeout(L.timer),this.pendingUpstream.delete(a)),X.error("forward permission request failed",{agentId:e.agentId,err:String(C)}),e.downstream.respondAgentRequestError(i.id,{code:U.INTERNAL_ERROR,message:`upstream send failed: ${String(C)}`})})}handleUpstreamResponse(e){if(e.id===null)return;let i=this.pendingUpstream.get(e.id);if(i){this.pendingUpstream.delete(e.id),clearTimeout(i.timer),e.error?i.session.downstream.respondAgentRequestError(i.agentRequestId,e.error):i.session.downstream.respondAgentRequest(i.agentRequestId,e.result);return}let a=this.pendingBridge.get(e.id);if(a){this.pendingBridge.delete(e.id),clearTimeout(a.timer),e.error?a.reject(new $t(e.error)):a.resolve(e.result);return}X.debug("orphan upstream response (no pending)",{id:e.id})}sendRequest(e,i,a=Wa){let x=this.upstreamIds.next(e);return new Promise((f,u)=>{let h=setTimeout(()=>{this.pendingBridge.delete(x),u(new E("AGENT_TIMEOUT",`${e} timed out after ${a}ms`))},a);this.pendingBridge.set(x,{method:e,resolve:f,reject:u,timer:h}),this.upstream.send(ct(x,e,i)).catch(m=>{let w=this.pendingBridge.get(x);w&&(clearTimeout(w.timer),this.pendingBridge.delete(x)),u(m)})})}async persistSessionMapping(e){if(this.paths)try{await ar(e.agentId,e.sessions,this.paths)}catch(i){X.warn("persist session mapping failed",{agentId:e.agentId,err:String(i)})}}reverseSessionId(e,i){for(let[a,x]of e.sessions.entries())if(x===i)return a}sendError(e,i,a){return this.upstream.send(Xe(e,{code:i,message:a}))}};F();xe();import{randomBytes as Ja}from"node:crypto";import{chmod as Va,mkdir as Ya,writeFile as Vs}from"node:fs/promises";import{createServer as Xa}from"node:http";import{dirname as Za}from"node:path";var $a=1e6,fr=N("ipc"),dn=class{server=null;port=0;token="";routes;paths;constructor(e){this.routes=new Map(e.routes.map(i=>[`${i.method} ${i.path}`,i])),this.paths=e.paths??K()}async start(){this.token=Ja(32).toString("hex");let e=Xa((a,x)=>{this.dispatch(a,x)});this.server=e,await new Promise((a,x)=>{e.once("error",x),e.listen(0,"127.0.0.1",()=>a())});let i=e.address();if(!i||typeof i!="object")throw new Error("failed to obtain IPC port");return this.port=i.port,await this.persistAuthFiles(),fr.info("IPC listening",{port:this.port}),{port:this.port,token:this.token}}async stop(){let e=this.server;e&&(await new Promise((i,a)=>{e.close(x=>x?a(x):i())}),this.server=null)}async persistAuthFiles(){await Ya(Za(this.paths.portFile),{recursive:!0}),await Vs(this.paths.portFile,String(this.port),"utf8"),await Vs(this.paths.tokenFile,this.token,"utf8");try{await Va(this.paths.tokenFile,384)}catch(e){fr.warn("chmod token file failed (non-POSIX?)",{err:String(e)})}}async dispatch(e,i){if(e.headers.authorization!==`Bearer ${this.token}`){At(i,401,{error:"unauthorized"});return}let x=`${e.method} ${(e.url??"").split("?")[0]}`,f=this.routes.get(x);if(!f){At(i,404,{error:"not found"});return}let u=null;if(e.method==="POST")try{u=await Qa(e)}catch(h){At(i,400,{error:"invalid json",detail:String(h)});return}try{let h=await f.handler(u,e);At(i,200,h??{ok:!0})}catch(h){fr.error("IPC handler failed",{key:x,err:String(h)}),At(i,500,{error:h instanceof Error?h.message:String(h)})}}};function At(r,e,i){r.statusCode=e,r.setHeader("content-type","application/json"),r.end(JSON.stringify(i))}async function Qa(r){let e=[],i=0;for await(let x of r){let f=x;if(i+=f.length,i>$a)throw new Error("body too large");e.push(f)}let a=Buffer.concat(e).toString("utf8");return a?JSON.parse(a):null}var vo=ke(ii(),1);var Rc=ke(eo(),1),Bc=ke(kn(),1),Mc=ke(ht(),1),Oc=ke(Sr(),1),zc=ke(Dr(),1),qc=ke(Lr(),1),co=ke(Ln(),1),Fc=ke(xo(),1);var fo=co.default;F();var Rn="1008033",uo="1289";var lo="pbbp2",ho="https://www.coze.cn",go="/api/coze_claw/resource/get_frontier_key",Uc="https://www.coze.cn",Hc="wss://frontier.coze.cn";function po(r){return r??process.env.COZE_BRIDGE_HANDSHAKE_URL??Uc}function mo(r){return r??process.env.COZE_BRIDGE_FRONTIER_URL??Hc}function Bn(r){let e={},i=r?.ttEnv??process.env.COZE_BRIDGE_TT_ENV,a=r?.usePpe??process.env.COZE_BRIDGE_USE_PPE;return i&&(e["x-tt-env"]=i),a&&(e["x-use-ppe"]=a),e}var ne=N("upstream.frontier"),_o="application/json",yo="none",Mn=class{constructor(e){this.opts=e}opts;fws=null;handler=null;connectHandler=null;opened=!1;openCount=0;async start(){if(this.fws){ne.warn("start called on already-started FrontierUpstream; noop");return}let e={Authorization:`Bearer ${this.opts.privatecode}`,Origin:ho,...Bn(this.opts.ppeOverride)};class i extends fo{constructor(h){super(h,lo,{headers:e})}send(h,...m){if(vs("debug"))try{let w;typeof h=="string"?w=Buffer.from(h,"utf8"):h instanceof Buffer?w=h:h instanceof ArrayBuffer?w=new Uint8Array(h):ArrayBuffer.isView(h)?w=new Uint8Array(h.buffer,h.byteOffset,h.byteLength):w=new Uint8Array(0);let y=Buffer.from(w.slice(0,128)).toString("hex");ne.debug("WS raw frame out",{bytes:w.byteLength,headHex:y})}catch(w){ne.warn("WS raw frame dump failed",{err:String(w)})}super.send(h,...m)}}let a=mo(this.opts.urlOverride),x={url:a,ws:i,fpID:uo,aID:Rn,accessKey:this.opts.handshake.accessKey,deviceID:this.opts.handshake.deviceId,payloadType:{type:_o,force:!0},payloadEncoding:{encoding:yo,force:!0},enableTransformTextPayload:!0,enableQoS:!1,enableAutoAck:!1,automaticOpen:!1,debug:this.opts.debug??!1},f=new vo.FWS(x);f.onopen=()=>{this.opened=!0,this.openCount+=1;let u=this.openCount===1;ne.info("frontier opened",{url:a,remoteDeviceId:this.opts.handshake.deviceId,initial:u,openCount:this.openCount}),this.connectHandler&&Promise.resolve(this.connectHandler({initial:u})).catch(h=>ne.warn("onConnect handler threw (ignored)",{err:String(h)}))},f.onclose=u=>{this.opened=!1,ne.info("frontier closed",{code:u.code,reason:u.reason,willReconnect:u.willReconnect})},f.onerror=u=>{ne.warn("frontier error",{code:u.code,msg:u.message})},f.onmessage=u=>this.handleMessage(u),this.fws=f,await f.connect()}async stop(e){let i=this.fws;if(i){this.fws=null,this.opened=!1;try{i.close(1e3,e??"bridge shutdown")}catch(a){ne.warn("frontier close threw (ignored)",{err:String(a)})}}}async send(e){let i=this.fws;if(!i)throw new E("UPSTREAM_DISCONNECTED","frontier upstream not started");let a=JSON.stringify(e),x=e;ne.info("frontier frame out",{method:x.method,jsonrpcId:x.id,size:a.length});try{await i.send(a,{service:33555712,method:1,payloadType:_o,payloadEncoding:yo})}catch(f){throw new E("UPSTREAM_DISCONNECTED",`frontier send failed: ${String(f)}`,{cause:f})}}onFrame(e){this.handler=e}onConnect(e){this.connectHandler=e}isConnected(){return this.opened&&this.fws?.readyState===1}handleMessage(e){let i=e.message?.service;if(i!==33555712){ne.debug("drop non-adapter frontier frame",{service:i});return}let a=Gc(e);if(!a){ne.debug("frontier message without text payload, drop",{payloadType:e.message?.payloadType});return}if(!this.handler){ne.debug("frame received but no onFrame handler",{size:a.length});return}let x;try{x=JSON.parse(a)}catch(f){ne.warn("frontier message JSON parse failed",{err:String(f),head:a.slice(0,80)});return}ne.info("frontier frame in",{logid:jc(e.message?.LogID),logidNew:e.message?.LogIDNew,msgId:e.message?.msgID,jsonrpcId:x.id}),Promise.resolve(this.handler(x)).catch(f=>ne.warn("frontier frame handler threw",{err:String(f)}))}};function jc(r){return r?r.high===0?String(r.low>>>0):`${r.high.toString(16)}${(r.low>>>0).toString(16).padStart(8,"0")}`:""}function Gc(r){let e=r.message;if(e?.textPayload)return e.textPayload;let i=e?.payload;if(!i)return null;try{return Buffer.from(i).toString("utf8")}catch{return null}}F();function So(r){return r?r.startsWith("boe_")?{ttEnv:r}:{ttEnv:r,usePpe:"1"}:{}}var bo=N("handshake");async function Eo(r){let e=po(r.endpoint),i=r.timeoutMs??1e4,a=`${Wc(e)}${go}?aid=${encodeURIComponent(Rn)}`,x={Authorization:`Bearer ${r.privatecode}`,Accept:"application/json",...Bn(r.ppeOverride)},f=new AbortController,u=setTimeout(()=>f.abort(),i);bo.info("frontier key handshake",{base:e});try{let h=await fetch(a,{method:"GET",headers:x,signal:f.signal}),m=h.headers.get("x-tt-logid")??"",w=h.headers.get("x-tt-trace-id")??"";if(!h.ok){let L=await h.text().catch(()=>"");throw new E("UPSTREAM_HANDSHAKE_FAILED",`handshake HTTP ${h.status} logid=${m}: ${L.slice(0,200)}`)}let y=await h.json();if(y.code!==void 0&&y.code!==0)throw new E("UPSTREAM_HANDSHAKE_FAILED",`handshake code=${y.code} msg=${y.msg??"-"} logid=${m}`);let _=y.data?.access_key,C=y.data?.device_id;if(!_||!C)throw new E("UPSTREAM_HANDSHAKE_FAILED",`handshake response missing access_key/device_id logid=${m}: ${JSON.stringify(y)}`);return bo.info("handshake ok",{remoteDeviceId:C,logid:m,traceId:w}),{accessKey:_,deviceId:C}}catch(h){throw h instanceof E?h:h.name==="AbortError"?new E("UPSTREAM_HANDSHAKE_FAILED",`handshake timeout (${i}ms)`):new E("UPSTREAM_HANDSHAKE_FAILED",String(h),{cause:h})}finally{clearTimeout(u)}}function Wc(r){return r.endsWith("/")?r.slice(0,-1):r}F();var Rr=N("upstream.switchable"),On=class{inner;handler=null;connectHandler=null;constructor(e){this.inner=e}async swap(e,i){if(this.inner===e)return;Rr.info("swap upstream",{reason:i});let a=this.inner;this.inner=e,this.handler&&e.onFrame(this.handler),this.connectHandler&&e.onConnect&&e.onConnect(this.connectHandler);try{await e.start()}catch(x){throw Rr.error("swap target start failed, reverting",{err:String(x)}),this.inner=a,x}await a.stop(i??"swapped").catch(x=>Rr.warn("previous upstream stop threw (ignored)",{err:String(x)}))}current(){return this.inner}start(){return this.inner.start()}stop(e){return this.inner.stop(e)}send(e){return this.inner.send(e)}onFrame(e){this.handler=e,this.inner.onFrame(e)}onConnect(e){this.connectHandler=e,this.inner.onConnect?.(e)}isConnected(){return this.inner.isConnected()}};F();var Br=N("upstream"),Mt=class{handler=null;async start(){Br.info("NoopUpstream started (M1 skeleton; real Frontier wired in M4)")}async stop(e){Br.info("NoopUpstream stopped",{reason:e})}async send(e){Br.debug("NoopUpstream.send (dropped)",{method:"method"in e?e.method:void 0})}onFrame(e){this.handler=e}isConnected(){return!1}async injectFrame(e){this.handler&&await this.handler(e)}};F();xe();F();xe();import{readFileSync as Jc,unlinkSync as Vc}from"node:fs";import{mkdir as Yc,readFile as Co,unlink as Do,writeFile as Xc}from"node:fs/promises";import{dirname as Zc}from"node:path";var $c=N("single-instance"),zn=class{pidFile;acquired=!1;constructor(e={}){this.pidFile=e.pidFile??K().pidFile,e.processTitle&&(process.title=e.processTitle)}async acquire(){let e=await this.readExistingPid();return e!==null&&this.isAlive(e)?{kind:"already-running",pid:e}:(e!==null&&($c.warn("removing stale pid file",{stalePid:e}),await Do(this.pidFile).catch(()=>{})),await Yc(Zc(this.pidFile),{recursive:!0}),await Xc(this.pidFile,String(process.pid),"utf8"),this.acquired=!0,this.installCleanupHooks(),{kind:"acquired"})}async release(){if(this.acquired){try{(await Co(this.pidFile,"utf8")).trim()===String(process.pid)&&await Do(this.pidFile)}catch{}this.acquired=!1}}async readExistingPid(){try{let e=await Co(this.pidFile,"utf8"),i=Number.parseInt(e.trim(),10);return Number.isFinite(i)&&i>0?i:null}catch(e){if(e.code==="ENOENT")return null;throw e}}isAlive(e){try{return process.kill(e,0),!0}catch(i){return i.code==="EPERM"}}installCleanupHooks(){process.once("exit",()=>{if(this.acquired)try{Jc(this.pidFile,"utf8").trim()===String(process.pid)&&Vc(this.pidFile)}catch{}})}};var O=N("daemon"),Qc="coze-bridge-daemon";async function ko(){let r=new zn({processTitle:Qc}),e=await r.acquire();if(e.kind==="already-running")throw new Error(`coze-bridge daemon already running (pid=${e.pid})`);let i=await fn(),a=i??{};or({pid:process.pid}),O.info(i?"loaded bridge config":"initialized bridge config");try{let k=new Ct;a.frameworksCache=await k.detectAll(),O.info("refreshed frameworks_cache",{detected:Object.keys(a.frameworksCache)})}catch(k){O.warn("framework detection failed",{err:String(k)})}await Dt(a);let x=new On(new Mt),f=K(),u=new un({upstream:x,paths:f});await tf(f,u);let h=new cn({paths:f,config:a,registry:u,healthReporter:async k=>{await u.sendRequest("_agent/health",k)}}),m,w,y=null,_=null;u.registerExtension("_agent/create",async k=>h.createAgent(k.params)),u.registerExtension("_agent/health",async()=>({ok:!0}));let C=new Xt({agents:u.agents,disposeAndMarkDisconnected:async(k,M)=>{let G=u.agents.get(k);G&&(await G.dispose(`disconnect: ${M}`).catch(Se=>O.warn("dispose during disconnect failed (ignored)",{agentId:k,err:String(Se)})),G.status="disconnected",u.unregister(k)),u.disconnectedAgents.add(k)},executeModelSwitch:k=>h.executeModelSwitch(k)});u.registerExtension("_agent/listSkills",k=>C.listSkills(k.params)),u.registerExtension("_agent/addSkills",k=>C.addSkills(k.params)),u.registerExtension("_agent/removeSkills",k=>C.removeSkills(k.params)),u.registerExtension("_agent/getFileTree",k=>C.getFileTree(k.params)),u.registerExtension("_agent/getFileContent",k=>C.getFileContent(k.params)),u.registerExtension("_agent/update",k=>C.updateAgent(k.params)),u.registerExtension("_agent/disconnect",k=>C.disconnectAgent(k.params)),u.registerExtension("_agent/switchModel",k=>C.switchModel(k.params));let L=new Wt({paths:f,handlers:C,sendDetail:k=>u.sendRequest("_agent/detail",k)});x.onConnect(({initial:k})=>{O.info("frontier upstream connected, triggering detail sync",{initial:k}),L.syncAll(k?"initial-connect":"reconnect").catch(M=>O.warn("detail sync top-level error (ignored)",{err:String(M)}))});let T=new dn({paths:f,routes:[{method:"GET",path:"/status",handler:async()=>({running:!0,pid:process.pid,agents:[...u.agents.keys()],deviceId:y??"",frameworksCache:a.frameworksCache??{}})},{method:"POST",path:"/pair",handler:async k=>{let M=k,G=M?.privatecode,Se=M?.pairing_code;if(!G||!Se)throw new E("IPC_BAD_REQUEST","/pair requires privatecode + pairing_code");let Be=So(M.env),me=M.handshake_url,we=M.frontier_url,he=ef(M.env,me,we),rt=!!m&&m!==G,Ot=w!==void 0&&w!==he;if(rt||Ot){O.warn("pair config switched, resetting agents",{pcChanged:rt,envChanged:Ot,previousPc:m?Ao(m):"",nextPc:Ao(G),previousEnvKey:w??"",nextEnvKey:he});for(let De of[...u.agents.values()])await De.dispose("pair config switch").catch(()=>{}),u.agents.delete(De.agentId);await x.swap(new Mt,"pair switch").catch(()=>{})}let zt=await Eo({privatecode:G,...me?{endpoint:me}:{},ppeOverride:Be});y=zt.deviceId,or({deviceId:y,pid:process.pid});let Ee=new Mn({handshake:zt,privatecode:G,...we?{urlOverride:we}:{},ppeOverride:Be});await x.swap(Ee,"pair"),m=G,w=he;let Ce=Object.keys(a.frameworksCache??{});try{let De=await u.sendRequest("_agent/pair",{pairCode:Se,patToken:G,frameworks:Ce,_meta:{cozeDeviceId:y}});O.info("_agent/pair ok",{pairResult:De}),_||(_=new Zt({core:u,getDeviceId:()=>y??""})),_.start();let Q;return M.agent_id&&(Q=await nf(M.agent_id,f,h,We=>u.sendRequest("_agent/detail",We)).catch(We=>(O.error("--agent-id ensureAgent failed",{agentId:M.agent_id,err:String(We)}),{ok:!1,agentId:M.agent_id??"",note:String(We)}))),{ok:!0,note:"paired with cloud",...Q?{agent:Q}:{}}}catch(De){return O.error("_agent/pair failed",{err:String(De)}),{ok:!1,note:`pair failed: ${String(De)}`}}}},{method:"POST",path:"/_agent/create",handler:async k=>{let M=k;return{ok:!0,result:await h.createAgent(M)}}},{method:"POST",path:"/refresh",handler:async()=>{O.info("IPC /refresh: re-detecting frameworks");let k=new Ct;return a.frameworksCache=await k.detectAll(),await Dt(a),{ok:!0,frameworks:a.frameworksCache}}},{method:"POST",path:"/shutdown",handler:async()=>(O.info("IPC /shutdown received"),setImmediate(()=>{ae.shutdown("ipc /shutdown")}),{ok:!0})}]}),{port:R,token:j}=await T.start();await u.start(),rf(f,h).catch(k=>O.warn("auto-revive top-level error (ignored)",{err:String(k)}));let re=null,ae={port:R,token:j,core:u,ipc:T,shutdown(k){return re||(O.info("daemon shutdown",{reason:k}),re=(async()=>{_?.stop(),await u.stop(k),await T.stop(),await r.release()})(),re)}};for(let k of["SIGTERM","SIGINT"])process.on(k,()=>{ae.shutdown(k).then(()=>process.exit(0))});return O.info("daemon ready",{port:R,pid:process.pid,nodeVersion:process.version,platform:process.platform,frameworks:Object.keys(a.frameworksCache??{}),libVersion:a.libVersion??"dev"}),ae}function Ao(r){return r.length<=8?"***":`${r.slice(0,4)}***${r.slice(-4)}`}function ef(r,e,i){return`${r??""}|${e??""}|${i??""}`}async function tf(r,e){let{readdir:i}=await import("node:fs/promises"),a;try{a=await i(r.agentsRoot)}catch{return}let{loadAgentConfig:x,enforceAgentConfigMode:f}=await Promise.resolve().then(()=>(Ue(),Gt));for(let u of a){await f(u,r).catch(h=>O.warn("enforceAgentConfigMode failed (ignored)",{agentId:u,err:String(h)}));try{let h=await x(u,r);h?.disconnectedAt&&(e.disconnectedAgents.add(u),O.info("agent marked disconnected on startup",{agentId:u,disconnectedAt:h.disconnectedAt,reason:h.disconnectReason??""}))}catch(h){O.warn("failed to load agent config on startup, skipping",{agentId:u,err:String(h)})}}}async function nf(r,e,i,a){let{loadAgentConfig:x}=await Promise.resolve().then(()=>(Ue(),Gt)),f=await x(r,e);if(f){O.info("--agent-id: local config found, reconnecting",{agentId:r,framework:f.framework,hadDisconnect:!!f.disconnectedAt});let m={agentId:f.agentId,framework:f.framework,...f.cozeIdentity?{cozeIdentity:f.cozeIdentity}:{},...f.model?{model:f.model}:{},...f.modelToken?{modelToken:f.modelToken}:{}};return await i.createAgent(m),{ok:!0,agentId:r,note:f.disconnectedAt?"revived from local config":"connected from local config"}}O.info("--agent-id: local config missing, pulling _agent/detail from cloud",{agentId:r});let u=await a({_meta:{cozeAgentId:r}});if(!u.framework)throw new E("AGENT_NOT_FOUND",`agent ${r} \u4E0D\u5728\u672C\u5730; \u4E91\u7AEF _agent/detail \u54CD\u5E94\u7F3A framework \u5B57\u6BB5 (D36 \u534F\u8BAE\u6269\u5C55\u672A\u751F\u6548), \u65E0\u6CD5\u5728\u672C\u673A\u65B0\u5EFA`);let h={agentId:u.agentId,framework:u.framework,...u.cozeIdentity?{cozeIdentity:u.cozeIdentity}:{},...u.model?{model:u.model}:{},...u.modelToken?{modelToken:u.modelToken}:{},...u.deployType?{_meta:{cozeDeployType:u.deployType}}:{}};return await i.createAgent(h),{ok:!0,agentId:r,note:u.deployType==="cloud"?"cloud agent acknowledged":"created from cloud detail"}}async function rf(r,e){let{readdir:i}=await import("node:fs/promises"),a;try{a=await i(r.agentsRoot)}catch{return{revived:0,skipped:0,total:0}}if(a.length===0)return{revived:0,skipped:0,total:0};let{loadAgentConfig:x}=await Promise.resolve().then(()=>(Ue(),Gt));O.info("auto-revive: scanning local agents on startup",{count:a.length});let f=0,u=0;for(let h of a){let m;try{m=await x(h,r)}catch(w){O.warn("auto-revive: load config failed (skipping)",{agentId:h,err:String(w)}),u+=1;continue}if(!m){u+=1;continue}if(m.disconnectedAt){O.info("auto-revive: skip disconnected agent",{agentId:h,disconnectedAt:m.disconnectedAt}),u+=1;continue}try{O.info("auto-revive: spawning",{agentId:h,framework:m.framework}),await e.createAgent({agentId:m.agentId,framework:m.framework,...m.cozeIdentity?{cozeIdentity:m.cozeIdentity}:{},...m.model?{model:m.model}:{},...m.modelToken?{modelToken:m.modelToken}:{}}),f+=1}catch(w){O.warn("auto-revive: createAgent failed (skipping)",{agentId:h,framework:m.framework,err:String(w)}),u+=1}}return O.info("auto-revive: done",{revived:f,skipped:u,total:a.length}),{revived:f,skipped:u,total:a.length}}Or();xe();import{readFile as Po}from"node:fs/promises";var Ge=class{paths;constructor(e){this.paths=e??K()}async probe(e=1e3){let i=await this.readAuth();if(!i)return{kind:"not-running"};try{let a=await this.fetch(i,{method:"GET",path:"/status",timeoutMs:e});return a.status===200?{kind:"connected",...i}:{kind:"stale",reason:`unexpected status ${a.status}`}}catch(a){return{kind:"stale",reason:lf(a)}}}async request(e){let i=await this.readAuth();if(!i)throw new Error("coze-bridge daemon not running (no port/token files)");return this.fetch(i,e)}async readAuth(){try{let[e,i]=await Promise.all([Po(this.paths.portFile,"utf8"),Po(this.paths.tokenFile,"utf8")]),a=Number.parseInt(e.trim(),10),x=i.trim();return!Number.isFinite(a)||a<=0||!x?null:{port:a,token:x}}catch(e){if(e.code==="ENOENT")return null;throw e}}async fetch(e,i){let a=i.body!==void 0,x={Authorization:`Bearer ${e.token}`};a&&(x["content-type"]="application/json");let f=new AbortController,u=setTimeout(()=>f.abort(),i.timeoutMs??5e3);try{let h=await fetch(`http://127.0.0.1:${e.port}${i.path}`,{method:i.method,headers:x,body:a?JSON.stringify(i.body):void 0,signal:f.signal}),m=await h.text();return{status:h.status,body:df(m)}}finally{clearTimeout(u)}}};function df(r){if(!r)return null;try{return JSON.parse(r)}catch{return r}}function lf(r){return r instanceof Error?r.message:String(r)}F();xe();import{copyFile as To,mkdir as hf,readFile as zr,writeFile as gf}from"node:fs/promises";import{dirname as pf,resolve as qr,sep as qn}from"node:path";import{fileURLToPath as mf}from"node:url";F();xe();var Lo=N("dist-install");function wf(r){let e=mf(r),i=pf(e),a=`${qn}src${qn}`;if(i.includes(a)||i.endsWith(`${qn}src${qn}cli`))return null;let x=qr(i,"index.js"),f=qr(i,"..","package.json");return{dist:x,pkgJson:f}}async function No(r={}){let e=r.paths??K(),i=wf(import.meta.url),a=r.sourceDist??i?.dist,x=r.sourcePackageJson??i?.pkgJson;if(!a||!x)return{kind:"dev-mode-skip",reason:"running from src/(tsx loader);no dist/ to install"};let f;try{f=JSON.parse(await zr(x,"utf8")).version??"unknown"}catch(_){return Lo.warn("cannot read source package.json,skip dist install",{err:String(_)}),{kind:"dev-mode-skip",reason:`package.json read failed: ${String(_)}`}}let u=await fn(e.configFile)??{},h=u.libVersion;if(h===f)try{return await zr(e.libEntry),{kind:"already-current",libVersion:f}}catch{}await hf(e.libDir,{recursive:!0}),await To(a,e.libEntry),await To(`${a}.map`,`${e.libEntry}.map`).catch(()=>{});let m=qr(e.libDir,"package.json"),w=`${JSON.stringify({type:"module"},null,2)}
|
|
91
|
-
`;return await zr(
|
|
88
|
+
${x}`}var ve=M("agent-detail-sync"),Gt=class{constructor(e){this.opts=e}opts;async syncAll(e){let o=this.opts.paths.agentsRoot,a;try{a=await ia(o)}catch(x){ve.info("agents dir not found, skip detail sync",{root:o,err:String(x)});return}ve.info("starting detail sync",{reason:e,count:a.length});for(let x of a)try{await this.syncOne(x)}catch(f){ve.warn("detail sync failed for agent, skipping",{agentId:x,err:String(f)})}ve.info("detail sync done",{reason:e})}async syncOne(e){let o=await ae(e,this.opts.paths);if(!o){ve.info("detail sync: agent config missing, skip",{agentId:e});return}let a;try{a=await this.opts.sendDetail({_meta:{cozeAgentId:e}})}catch(d){ve.warn("detail RPC failed, using local data",{agentId:e,err:String(d)});return}if(a.agentId&&a.agentId!==e){ve.warn("detail response agentId mismatch, ignoring",{agentId:e,responseAgentId:a.agentId});return}let x=!1,f=!1;if(a.agentName&&a.agentName!==o.agentName&&(o.agentName=a.agentName,x=!0),a.description!==void 0&&a.description!==o.description&&(o.description=a.description,x=!0),a.cozeIdentity&&a.cozeIdentity!==o.cozeIdentity&&(o.cozeIdentity=a.cozeIdentity,x=!0,f=!0),a.deployType&&ve.info("detail.deployType",{agentId:e,deployType:a.deployType}),!x){ve.debug("detail sync: no diff",{agentId:e});return}await de(o,this.opts.paths),ve.info("detail sync: config updated",{agentId:e,identityChanged:f,agentName:o.agentName}),f&&(await Ge(o.workspace,o.framework,e,o.cozeIdentity),await this.opts.handlers.reloadAgentSessionsPublic(e,"detail-sync"))}};Fe();import{spawn as oa}from"node:child_process";import{mkdir as aa,readFile as Ts,readdir as xa,rm as ca,stat as Xt,writeFile as fa}from"node:fs/promises";import{join as Te,normalize as ua,relative as Ls,resolve as da,sep as Ns}from"node:path";function St(r){return r?.cozeDeployType==="cloud"?"cloud":"local"}function vs(r){let{_meta:e,...o}=r;return{stripped:o,meta:e}}function at(r){if(!r?.cozeAgentId)throw new Error("missing _meta.cozeAgentId");return r.cozeAgentId}var E=class extends Error{code;retriable;cause;constructor(e,o,a){super(o),this.name="BridgeError",this.code=e,this.retriable=a?.retriable??!1,a?.cause!==void 0&&(this.cause=a.cause)}};F();ce();function Je(r,e){if(St(r)!=="cloud")throw new E("OPERATION_NOT_ALLOWED_FOR_LOCAL",`${e} is not allowed for local agent`)}var Ss="https://llm-gateway.coze.cn",Jt="auto";function xr(r){return{model:r.model??Jt,...r.modelToken?{modelToken:r.modelToken}:{}}}function Cs(r){return!r||r===Jt}function Es(r){let e={};return r.modelToken&&(e.ANTHROPIC_BASE_URL=Ss,e.ANTHROPIC_AUTH_TOKEN=r.modelToken),Cs(r.model)||(e.ANTHROPIC_MODEL=r.model),e}function As(r){let e=[];return Cs(r.model)||e.push("-c",`model="${r.model}"`),r.modelToken&&(e.push("-c",'model_provider="openai"'),e.push("-c",`model_provider_overrides.openai.base_url="${Ss}/v1"`)),e}function ks(r){return r.modelToken?{OPENAI_API_KEY:r.modelToken}:{}}var Q=M("agent-handlers"),Ds=5*1024*1024,la=1,ha=6,ga=new Set(["node_modules",".git",".coze","dist","build",".next"]),pa=3e4,Vt=class{constructor(e){this.opts=e}opts;async listSkills(e){Je(e._meta,"_agent/listSkills");let o=at(e._meta),a=await this.loadAgentCfg(o),x=a?.workspace??Ie(o).workspace,f=a?.skills??[],d=[];for(let g of f){let p=Te(x,g.relPath,"SKILL.md");await Xt(p).then(w=>w.isFile()).catch(()=>!1)&&d.push({skillId:g.skillId,skillName:g.skillName,downloadUrl:g.downloadUrl??"",...g.description?{description:g.description}:{},...g.version?{version:g.version}:{}})}return{skills:d}}async addSkills(e){Je(e._meta,"_agent/addSkills");let o=at(e._meta),a=await this.requireAgentCfg(o),x=e.skills??[],f=[...a.skills??[]],d=new Map(f.map((p,_)=>[p.skillId,_])),g=[];for(let p of x){if(!p.skillName)throw new E("IPC_BAD_REQUEST","skill missing skillName");let _=ma(p.skillName),w=_a(a.framework),y=Te(w,_),A=Te(a.workspace,y);await aa(A,{recursive:!0});let T=await ya(p.downloadUrl);va(T)?await Sa(T,A):await fa(Te(A,"SKILL.md"),T.toString("utf8"),"utf8");let N={skillId:p.skillId,skillName:p.skillName,relPath:y,installedAt:Date.now(),...p.description?{description:p.description}:{},...p.version?{version:p.version}:{},...p.downloadUrl?{downloadUrl:p.downloadUrl}:{}},R=d.get(p.skillId);R!==void 0?f[R]=N:(d.set(p.skillId,f.length),f.push(N)),g.push(p),Q.info("skill installed",{agentId:o,skillId:p.skillId,skillName:p.skillName,relPath:y})}return await jt(o,f),await this.reloadAgentSessions(o,"skills-added"),{installedSkills:g}}async removeSkills(e){Je(e._meta,"_agent/removeSkills");let o=at(e._meta),a=await this.requireAgentCfg(o),x=new Set(e.skillIds??[]),f=a.skills??[],d=[];for(let g of f){if(!x.has(g.skillId)){d.push(g);continue}let p=Te(a.workspace,g.relPath);await ca(p,{recursive:!0,force:!0}),Q.info("skill removed",{agentId:o,skillId:g.skillId,relPath:g.relPath})}return await jt(o,d),await this.reloadAgentSessions(o,"skills-removed"),{ok:!0}}reloadAgentSessionsPublic(e,o){return this.reloadAgentSessions(e,o)}async reloadAgentSessions(e,o){let a=this.opts.agents.get(e);if(a&&a.framework!=="codex")for(let[x,f]of a.sessions)try{await a.downstream.sessionLoad({sessionId:f,cwd:a.workspace}),Q.info("session reloaded",{reason:o,agentId:e,framework:a.framework,cloudId:x,acpId:f})}catch(d){Q.warn("session reload failed",{reason:o,agentId:e,framework:a.framework,cloudId:x,acpId:f,err:String(d)})}}async updateAgent(e){if(!e.cozeIdentity?.trim())return Q.info("_agent/update: empty cozeIdentity, noop",{agentId:e.agentId}),{ok:!0};let o=e.agentId,a=await ae(o);if(!a)throw new E("AGENT_NOT_FOUND",`agent not found: ${o}`);return a.cozeIdentity===e.cozeIdentity?(Q.info("_agent/update: cozeIdentity unchanged, noop",{agentId:o}),{ok:!0}):(a.cozeIdentity=e.cozeIdentity,await de(a),await Ge(a.workspace,a.framework,o,e.cozeIdentity),Q.info("_agent/update: cozeIdentity rewritten",{agentId:o,framework:a.framework}),await this.reloadAgentSessions(o,"identity-changed"),{ok:!0})}async disconnectAgent(e){let o=e.agentId;if(!o)throw new E("IPC_BAD_REQUEST","_agent/disconnect: missing agentId");let a=await ae(o);return a?(a.disconnectedAt=Date.now(),a.disconnectReason=e.reason??"",await de(a),Q.info("agent disconnected",{agentId:o,reason:e.reason??"",force:e.force??!1}),this.opts.disposeAndMarkDisconnected&&await this.opts.disposeAndMarkDisconnected(o,e.reason??"disconnect"),{ok:!0}):(Q.warn("_agent/disconnect: agent not found, ignoring",{agentId:o}),{ok:!0})}async switchModel(e){if(Je(e._meta,"_agent/switchModel"),!e.agentId)throw new E("IPC_BAD_REQUEST","_agent/switchModel: missing agentId");let o=e.model&&e.model.trim()?e.model:Jt,a=e.modelToken?.trim()||void 0,x=await ae(e.agentId);if(!x)throw new E("AGENT_NOT_FOUND",`agent not found: ${e.agentId}`);x.model=o,a!==void 0?x.modelToken=a:delete x.modelToken,await de(x),Q.info("_agent/switchModel: model/modelToken persisted",{agentId:e.agentId,model:o,hasToken:!!a,reason:e.reason??"",force:e.force??!1});let f=this.opts.agents.get(e.agentId);if(!f)return Q.info("_agent/switchModel: agent not running, config persisted only",{agentId:e.agentId}),{ok:!0};if(f.status==="switching")return Q.info("_agent/switchModel: already switching, params updated via config",{agentId:e.agentId}),{ok:!0};if(!this.opts.executeModelSwitch)throw new E("BRIDGE_INTERNAL","_agent/switchModel: executeModelSwitch callback not wired");f.status="switching";let d=f.msgQueue.enqueue(async()=>{}),g=setTimeout(()=>{Q.warn("_agent/switchModel: 30s idle timeout, forcing downstream stop",{agentId:e.agentId}),f.downstream.stop("switchModel idle timeout").catch(p=>Q.warn("force stop failed (ignored)",{agentId:e.agentId,err:String(p)}))},pa);try{return await d.catch(p=>Q.warn("_agent/switchModel: msgQueue idle wait rejected (continuing)",{agentId:e.agentId,err:String(p)})),clearTimeout(g),await this.opts.executeModelSwitch(e.agentId),{ok:!0}}catch(p){clearTimeout(g),Q.error("_agent/switchModel: failed, marking disconnected",{agentId:e.agentId,err:String(p)});let _=await ae(e.agentId).catch(()=>null);throw _&&(_.disconnectedAt=Date.now(),_.disconnectReason=`model switch failed: ${p instanceof Error?p.message:String(p)}`,await de(_).catch(w=>Q.warn("write disconnect marker failed (ignored)",{err:String(w)}))),this.opts.disposeAndMarkDisconnected?await this.opts.disposeAndMarkDisconnected(e.agentId,`model switch failed: ${p instanceof Error?p.message:String(p)}`).catch(w=>Q.warn("disposeAndMarkDisconnected failed (ignored)",{err:String(w)})):f.status="disconnected",p instanceof E&&(p.code==="MODEL_SWITCH_FAILED"||p.code==="AGENT_NOT_FOUND")?p:new E("MODEL_SWITCH_FAILED",p instanceof Error?p.message:String(p),{cause:p})}}async getFileTree(e){Je(e._meta,"_agent/getFileTree");let o=e._meta,a=at(o),x=this.resolveWorkspace(a),f=e.filePath??"",d=this.safeJoin(x,f),g=await Xt(d).catch(()=>null);if(!g)throw new E("IPC_BAD_REQUEST",`path not found: ${f}`);let p=Ca(e.depth);return g.isDirectory()?{tree:await Ms(x,d,f,p)}:{tree:[{name:Ea(f),path:Rs(f||"."),isDir:!1,size:g.size,modifiedAt:Math.floor(g.mtimeMs)}]}}async getFileContent(e){Je(e._meta,"_agent/getFileContent");let o=at(e._meta),a=this.resolveWorkspace(o);if(!e.filePath)throw new E("IPC_BAD_REQUEST","filePath required");let x=this.safeJoin(a,e.filePath),f=await Xt(x).catch(()=>null);if(!f||!f.isFile())throw new E("IPC_BAD_REQUEST",`not a file: ${e.filePath}`);if(f.size>Ds)throw new E("IPC_BAD_REQUEST",`file too large: ${f.size} bytes (max ${Ds})`);let d=await Ts(x);return d.includes(0)?{content:d.toString("base64"),encoding:"base64",size:f.size}:{content:d.toString("utf8"),encoding:"utf-8",size:f.size}}resolveWorkspace(e){let o=this.opts.agents.get(e);return o?o.workspace:Ie(e).workspace}safeJoin(e,o){let a=da(e,o||"."),x=Ls(e,a);if(x.startsWith("..")||x===".."||x.startsWith(`..${Ns}`))throw new E("IPC_BAD_REQUEST",`path escapes workspace: ${o}`);return a}loadAgentCfg(e){return ae(e)}async requireAgentCfg(e){let o=await this.loadAgentCfg(e);if(!o)throw new E("AGENT_NOT_FOUND",`no config for agent: ${e}`);return o}};function ma(r){let e=r.trim().replace(/[^a-zA-Z0-9._-]+/g,"-").replace(/^-+|-+$/g,"").slice(0,64);if(!e||e==="."||e==="..")throw new E("IPC_BAD_REQUEST",`invalid skill name: ${r}`);return e}function _a(r){return r==="claude-code"?Te(".claude","skills"):Te(".agents","skills")}var wa=3e4,Ps=50*1024*1024,Is=3e4;async function ya(r){if(!r)throw new E("IPC_BAD_REQUEST","skill missing downloadUrl");if(r.startsWith("data:"))return ba(r);if(r.startsWith("file:")){let e=new URL(r).pathname,o=await Ts(e);if(o.length>Ps)throw new E("IPC_BAD_REQUEST",`skill too large: ${o.length} bytes`);return o}if(r.startsWith("http://")||r.startsWith("https://")){let e=new AbortController,o=setTimeout(()=>e.abort(),wa);try{let a=await fetch(r,{signal:e.signal});if(!a.ok)throw new E("IPC_BAD_REQUEST",`fetch skill failed HTTP ${a.status} ${r}`);let x=await a.arrayBuffer();if(x.byteLength>Ps)throw new E("IPC_BAD_REQUEST",`skill too large: ${x.byteLength} bytes`);return Buffer.from(x)}finally{clearTimeout(o)}}throw new E("IPC_BAD_REQUEST",`unsupported downloadUrl scheme (\u8981 https/data/file): ${r.slice(0,80)}`)}function ba(r){let e=/^data:([^,;]*)(;base64)?,(.*)$/s.exec(r);if(!e)throw new E("IPC_BAD_REQUEST","bad data URL");let o=!!e[2],a=e[3]??"";return o?Buffer.from(a,"base64"):Buffer.from(decodeURIComponent(a),"utf8")}function va(r){return r.length>=2&&r[0]===31&&r[1]===139}async function Sa(r,e){await new Promise((o,a)=>{let x=oa("tar",["-xzf","-","-C",e,"--strip-components=1"],{stdio:["pipe","pipe","pipe"]}),f="";x.stderr?.on("data",g=>{f+=String(g)});let d=setTimeout(()=>{x.kill("SIGKILL"),a(new E("IPC_BAD_REQUEST",`tar extract timeout (${Is}ms)`))},Is);x.on("error",g=>{clearTimeout(d),a(new E("IPC_BAD_REQUEST",`tar spawn failed: ${g.message}`,{cause:g}))}),x.on("exit",g=>{clearTimeout(d),g===0?o():a(new E("IPC_BAD_REQUEST",`tar exit ${g}${f?`: ${f.trim().slice(0,200)}`:""}`))}),x.stdin?.end(r)})}async function Ms(r,e,o,a){if(a<=0)return[];let x;try{x=await xa(e,{withFileTypes:!0})}catch{return[]}let f=[];for(let d of x){if(ga.has(d.name))continue;let g=Te(e,d.name),p=ua(Te(o,d.name)),_=null;try{_=await Xt(g)}catch{continue}let w={name:d.name,path:Rs(Ls(r,g)),isDir:_.isDirectory(),size:_.size,modifiedAt:Math.floor(_.mtimeMs)};_.isDirectory()&&a>1&&(w.children=await Ms(r,g,p,a-1)),f.push(w)}return f.sort((d,g)=>d.isDir!==g.isDir?d.isDir?-1:1:d.name.localeCompare(g.name)),f}function Ca(r){return!r||r<=0?la:Math.min(r,ha)}function Ea(r){if(!r||r==="."||r==="/")return".";let e=r.split(/[/\\]/);return e[e.length-1]||"."}function Rs(r){return r.split(Ns).join("/")}F();var Ct=M("agent-health-reporter"),Aa=3e4,Yt=class{constructor(e){this.opts=e;this.intervalMs=e.intervalMs??Aa}opts;timer=null;inFlight=!1;unsubscribeRegister=null;intervalMs;start(){this.timer||(this.timer=setInterval(()=>{this.tick()},this.intervalMs),this.timer.unref?.(),this.unsubscribeRegister=this.opts.core.onAgentRegister(()=>{this.tick()}),Ct.info("heartbeat started",{intervalMs:this.intervalMs}),this.tick())}stop(){this.timer&&(clearInterval(this.timer),this.timer=null,this.unsubscribeRegister&&(this.unsubscribeRegister(),this.unsubscribeRegister=null),Ct.info("heartbeat stopped"))}async tick(){if(this.inFlight){Ct.debug("previous tick still in-flight, skip");return}let e=this.opts.getDeviceId();if(!e){Ct.debug("deviceId not available, skip tick (\u5C1A\u672A pair)");return}this.inFlight=!0;try{let o=[...this.opts.core.agents.values()];for(let a of o){let x=ka(a);if(!x)continue;let f={status:x,_meta:{cozeAgentId:a.agentId,cozeDeviceId:e}};try{await this.opts.core.sendRequest("_agent/health",f)}catch(d){Ct.warn("heartbeat send failed",{agentId:a.agentId,status:x,err:String(d)})}}}finally{this.inFlight=!1}}};function ka(r){return r.status==="error"?"error":r.activeTriggers.size>0?"busy":r.status==="ok"||r.status==="degraded"?"online":null}Fe();import{mkdir as cr,rm as Ba}from"node:fs/promises";import{spawn as La}from"node:child_process";function xt(r,e,o){return o===void 0?{jsonrpc:"2.0",id:r,method:e}:{jsonrpc:"2.0",id:r,method:e,params:o}}function Os(r,e){return e===void 0?{jsonrpc:"2.0",method:r}:{jsonrpc:"2.0",method:r,params:e}}function ct(r,e){return{jsonrpc:"2.0",id:r,result:e}}function Xe(r,e){return{jsonrpc:"2.0",id:r,error:e}}var Qt=class extends Error{code;data;constructor(e){super(`JSON-RPC error code=${e.code} ${e.message}`),this.name="RemoteRpcError",this.code=e.code,e.data!==void 0&&(this.data=e.data)}},H={PARSE_ERROR:-32700,INVALID_REQUEST:-32600,METHOD_NOT_FOUND:-32601,INVALID_PARAMS:-32602,INTERNAL_ERROR:-32603,AGENT_NOT_FOUND:-32001,AGENT_BUSY:-32002,AGENT_TIMEOUT:-32003,AGENT_SPAWN_FAILED:-32004,OPERATION_NOT_ALLOWED_FOR_LOCAL:-32005,AGENT_DISCONNECTED:-32006,MODEL_SWITCHING:-32007,MODEL_SWITCH_FAILED:-32008};function $t(r){return"method"in r&&"id"in r&&r.id!==void 0}function Bs(r){return"method"in r&&!("id"in r)}function Zt(r){return!("method"in r)&&"id"in r}var Da={AGENT_NOT_FOUND:H.AGENT_NOT_FOUND,AGENT_BUSY:H.AGENT_BUSY,AGENT_DISCONNECTED:H.AGENT_DISCONNECTED,AGENT_TIMEOUT:H.AGENT_TIMEOUT,AGENT_SPAWN_FAILED:H.AGENT_SPAWN_FAILED,AGENT_PROTOCOL_ERROR:H.INTERNAL_ERROR,BRIDGE_CONFIG_INVALID:H.INTERNAL_ERROR,BRIDGE_INTERNAL:H.INTERNAL_ERROR,IPC_AUTH_FAILED:H.INTERNAL_ERROR,IPC_BAD_REQUEST:H.INVALID_REQUEST,MODEL_SWITCHING:H.MODEL_SWITCHING,MODEL_SWITCH_FAILED:H.MODEL_SWITCH_FAILED,OPERATION_NOT_ALLOWED_FOR_LOCAL:H.OPERATION_NOT_ALLOWED_FOR_LOCAL,UPSTREAM_DISCONNECTED:H.INTERNAL_ERROR,UPSTREAM_HANDSHAKE_FAILED:H.INTERNAL_ERROR};function en(r){return r instanceof E?{code:Da[r.code]??H.INTERNAL_ERROR,message:r.message,data:{bridgeCode:r.code,retriable:r.retriable}}:{code:H.INTERNAL_ERROR,message:r instanceof Error?r.message:String(r)}}function zs(r){let e=r.data,o=e?.bridgeCode??"AGENT_PROTOCOL_ERROR";return new E(o,r.message,{retriable:e?.retriable??!1,cause:r.data})}function qs(r){return`${JSON.stringify(r)}
|
|
89
|
+
`}var tn=class{buffer="";onError;constructor(e={}){this.onError=e.onError}push(e){this.buffer+=typeof e=="string"?e:e.toString("utf8");let o=this.buffer.split(`
|
|
90
|
+
`);this.buffer=o.pop()??"";let a=[];for(let x of o){let f=x.replace(/\r$/,"").trim();if(f)try{a.push(JSON.parse(f))}catch(d){this.onError?.({line:f,error:d})}}return a}flush(){if(!this.buffer)return[];let e=this.buffer.replace(/\r$/,"").trim();if(this.buffer="",!e)return[];try{return[JSON.parse(e)]}catch(o){return this.onError?.({line:e,error:o}),[]}}};var Us={"session/prompt":"session.prompt","session/cancel":"session.cancel","session/new":"session.new","session/load":"session.load","_agent/create":"agent.create","_agent/health":"agent.health","_agent/pair":"agent.pair","_agent/listSkills":"agent.listSkills","_agent/addSkills":"agent.addSkills","_agent/removeSkills":"agent.removeSkills","_agent/getFileTree":"agent.getFileTree","_agent/getFileContent":"agent.getFileContent","_agent/detail":"agent.detail","_agent/update":"agent.update","_agent/disconnect":"agent.disconnect","_agent/switchModel":"agent.switchModel",initialize:"initialize"},Ku=Object.fromEntries(Object.entries(Us).map(([r,e])=>[e,r])),Pa={"session.prompt":["agentId","triggerMsgId","sessionId"],"session.cancel":["agentId","triggerMsgId","sessionId"],"session.new":["agentId"],"session.load":["agentId"],"agent.create":["agentId"],"agent.health":["agentId"],"agent.listSkills":["agentId"],"agent.addSkills":["agentId"],"agent.removeSkills":["agentId"],"agent.getFileTree":["agentId"],"agent.getFileContent":["agentId"],"agent.detail":["agentId"],"agent.update":["agentId"],"agent.disconnect":["agentId"],"agent.switchModel":["agentId"],"agent.pair":[],initialize:[]},ft=class{seq=0;next(e,o){this.seq+=1;let a=Us[e]??Ia(e),x=Pa[a]??[],f=[a,String(this.seq)];if(x.length>0){let d=x.map(p=>Fs(o?.[p]??"")),g=Ta(d).join(":");g&&f.push(g)}else o&&Object.values(o).some(d=>d)&&f.push(Object.values(o).filter(Boolean).map(d=>Fs(String(d))).join(":"));return f.join("_")}reset(){this.seq=0}};function Ia(r){return r.replace(/[\s/]+/g,".").replace(/_+/g,"-")}function Fs(r){return r.replace(/[:_\s]+/g,"-")}function Ta(r){let e=r.length;for(;e>0&&!r[e-1];)e-=1;return r.slice(0,e)}F();var Na=3e4;function Hs(r,e){if(!(typeof r!="number"||r<=0))try{process.platform==="win32"?process.kill(r,e):process.kill(-r,e)}catch{}}var Ue=class{constructor(e){this.opts=e;this.log=M(`downstream.${this.constructor.name}`),this.decoder=new tn({onError:o=>this.log.warn("decode line failed",{line:o.line})})}opts;child;decoder;pending=new Map;idAllocator=new ft;updateHandlers=[];agentRequestHandlers=[];exitHandlers=[];log;stopped=!1;sanitizeEnv(e){return e}async start(){if(this.child)throw new E("BRIDGE_INTERNAL","Downstream already started");let e=process.platform!=="win32",o=La(this.opts.command,this.opts.args,{cwd:this.opts.cwd,env:{...this.sanitizeEnv(process.env),...this.opts.env},stdio:["pipe","pipe","pipe"],detached:e});this.child=o,o.stdout?.setEncoding("utf8"),o.stdout?.on("data",a=>{for(let x of this.decoder.push(a))this.dispatch(x)}),o.stderr?.setEncoding("utf8"),o.stderr?.on("data",a=>{this.log.debug("stderr",{text:a.trimEnd()})}),o.on("exit",(a,x)=>{this.stopped=!0,this.failAllPending(new E("AGENT_PROTOCOL_ERROR",`agent exited (${a}/${x})`));for(let f of this.exitHandlers)f(a,x)}),o.on("error",a=>{this.log.error("child error",{err:String(a)}),this.failAllPending(new E("AGENT_SPAWN_FAILED",String(a),{cause:a}))}),this.log.info("downstream started",{command:this.opts.command,pid:o.pid,cwd:this.opts.cwd})}async stop(e){if(!this.child||this.stopped)return;this.stopped=!0,this.log.info("downstream stopping",{reason:e});let o=this.child,a=new Promise(f=>o.once("exit",()=>f()));Hs(o.pid,"SIGTERM");let x=setTimeout(()=>{o.killed||Hs(o.pid,"SIGKILL")},5e3);try{await a}finally{clearTimeout(x)}}pid(){return this.child?.pid}isAlive(){return!!this.child&&!this.stopped}initialize(e){return this.call("initialize",e)}sessionNew(e){return this.call("session/new",{mcpServers:[],...e})}sessionLoad(e){return this.call("session/load",{mcpServers:[],...e})}sessionPrompt(e){return this.call("session/prompt",e,0)}async sessionCancel(e){if(!this.child||this.stopped)return;let o=this.idAllocator.next("session/cancel");this.writeFrame(xt(o,"session/cancel",e))}onUpdate(e){this.updateHandlers.push(e)}onAgentRequest(e){this.agentRequestHandlers.push(e)}respondAgentRequest(e,o){if(!(!this.child||this.stopped))try{this.writeFrame(ct(e,o))}catch(a){this.log.warn("respondAgentRequest write failed",{id:e,err:String(a)})}}respondAgentRequestError(e,o){if(!(!this.child||this.stopped))try{this.writeFrame(Xe(e,o))}catch(a){this.log.warn("respondAgentRequestError write failed",{id:e,err:String(a)})}}onExit(e){this.exitHandlers.push(e)}call(e,o,a=Na){if(!this.child||this.stopped)return Promise.reject(new E("AGENT_PROTOCOL_ERROR","downstream not started"));let x=this.idAllocator.next(e),f=xt(x,e,o),d=a>0&&Number.isFinite(a);return new Promise((g,p)=>{let _=d?setTimeout(()=>{this.pending.delete(x),p(new E("AGENT_TIMEOUT",`${e} timed out after ${a}ms`))},a):null;this.pending.set(x,{resolve:g,reject:p,timer:_,method:e});try{this.writeFrame(f)}catch(w){_&&clearTimeout(_),this.pending.delete(x),p(w)}})}writeFrame(e){if(!this.child?.stdin||this.child.stdin.destroyed)throw new E("AGENT_PROTOCOL_ERROR","downstream stdin not writable");this.child.stdin.write(qs(e))}dispatch(e){if(Zt(e)){let o=e.id!==null?this.pending.get(e.id):void 0;if(!o){this.log.warn("orphan response",{id:e.id});return}this.pending.delete(e.id),o.timer&&clearTimeout(o.timer),e.error?o.reject(zs(e.error)):o.resolve(e.result);return}if(Bs(e)){if(e.method==="session/update")for(let o of this.updateHandlers)Promise.resolve(o(e.params)).catch(a=>this.log.warn("update handler failed",{err:String(a)}));else this.log.debug("unknown notification",{method:e.method});return}if($t(e)){let o=e;this.handleAgentRequest(o).catch(a=>this.log.error("agent request handler failed",{method:o.method,err:String(a)}))}}async handleAgentRequest(e){if(this.agentRequestHandlers.length===0){this.writeFrame(Xe(e.id,{code:-32601,message:`method not handled by Bridge: ${e.method}`}));return}for(let o of this.agentRequestHandlers)try{await o(e)}catch(a){this.log.error("agentRequestHandler threw",{method:e.method,err:String(a)});try{this.writeFrame(Xe(e.id,en(a)))}catch{}}}failAllPending(e){for(let o of this.pending.values())o.timer&&clearTimeout(o.timer),o.reject(e);this.pending.clear()}};var Ma="@zed-industries/claude-code-acp@latest";function Ra(r){let e={};for(let[o,a]of Object.entries(r))a!==void 0&&(o.startsWith("CLAUDE")||o==="AI_AGENT"||o==="BAGGAGE"||(e[o]=a));return e}var nn=class extends Ue{framework="claude-code";constructor(e){let o=e.command??"npx",a=e.args??["-y",Ma],x={command:o,args:a,cwd:e.cwd,...e.env?{env:e.env}:{}};super(x)}sanitizeEnv(e){return Ra(e)}};var Oa="@zed-industries/codex-acp@latest",rn=class extends Ue{framework="codex";constructor(e){let o=e.command??"npx",a=e.args??["-y",Oa],x=e.extraArgs?[...a,...e.extraArgs]:a,f={command:o,args:x,cwd:e.cwd,...e.env?{env:e.env}:{}};super(f)}};import{spawn as Ks}from"node:child_process";F();var sn=class extends Ue{framework="openclaw";registerLog;profile;agentId;sessionName;registered=!1;constructor(e){let o=e.profile??"coze",a=e.sessionName??"default",x=["--profile",o,"acp","--session",`agent:${e.agentId}:${a}`],f={command:e.command,args:x,cwd:e.cwd,...e.env?{env:e.env}:{}};super(f),this.profile=o,this.agentId=e.agentId,this.sessionName=a,this.registerLog=M("downstream.openclaw.register")}async start(){await this.registerAgent().catch(e=>{this.registerLog.warn("openclaw agents add failed (will continue to acp anyway)",{agentId:this.agentId,err:String(e)})}),await super.start()}registerAgent(){return new Promise((e,o)=>{let a=Ks(this.opts.command,["--profile",this.profile,"agents","add",this.agentId,"--workspace",this.opts.cwd,"--non-interactive"],{stdio:["ignore","pipe","pipe"],env:{...process.env,...this.opts.env}}),x="";a.stderr?.on("data",f=>{x+=f.toString("utf8")}),a.on("error",o),a.on("close",f=>{f===0?(this.registered=!0,this.registerLog.info("agent registered",{agentId:this.agentId,profile:this.profile}),e()):o(new E("AGENT_SPAWN_FAILED",`openclaw agents add ${this.agentId} exited ${f}: ${x.trim()}`))})})}async cleanup(e){this.registered&&await new Promise(o=>{let a=Ks(this.opts.command,["--profile",this.profile,"agents","delete",this.agentId,"--force"],{stdio:["ignore","pipe","pipe"],env:{...process.env,...this.opts.env}}),x="";a.stderr?.on("data",f=>{x+=f.toString("utf8")}),a.on("error",f=>{this.registerLog.warn("openclaw agents delete failed (best-effort)",{agentId:this.agentId,err:String(f)}),o()}),a.on("close",f=>{f===0?this.registerLog.info("agent unregistered",{agentId:this.agentId}):this.registerLog.warn("openclaw agents delete non-zero exit",{agentId:this.agentId,code:f,stderr:x.trim()}),this.registered=!1,o()})})}get acpSessionName(){return this.sessionName}};F();ce();var on=class{slots=[];running=!1;closed=!1;disposed=!1;enqueue(e){return this.disposed?Promise.reject(new Error("AsyncQueue disposed")):this.closed?Promise.reject(new Error("AsyncQueue closed")):new Promise((o,a)=>{this.slots.push({task:e,resolve:o,reject:a}),this.drain()})}close(){this.closed=!0}dispose(e=new Error("AsyncQueue disposed")){for(this.disposed=!0,this.closed=!0;this.slots.length>0;)this.slots.shift()?.reject(e)}get size(){return this.slots.length}get isRunning(){return this.running}async drain(){if(!this.running){this.running=!0;try{for(;this.slots.length>0&&!this.disposed;){let e=this.slots.shift();if(!e)break;try{let o=await e.task();e.resolve(o)}catch(o){e.reject(o)}}}finally{this.running=!1}}}};var an=class{agentId;framework;workspace;deployType;msgQueue;sessions=new Map;verifiedSessions=new Set;activeTriggers=new Map;status="starting";lastActiveAt=Date.now();_downstream;constructor(e){this.agentId=e.agentId,this.framework=e.framework,this.workspace=e.workspace,this.deployType=e.deployType??"local",this._downstream=e.downstream,this.msgQueue=new on}get downstream(){return this._downstream}swap(e){this._downstream=e,this.verifiedSessions.clear(),this.activeTriggers.clear()}async dispose(e){this.status="stopped",this.msgQueue.dispose(new Error(`AgentSession disposed${e?`: ${e}`:""}`)),await this._downstream.stop(e)}};var W=M("agent-manager"),za=(r,e,o,a,x)=>{switch(r){case"claude-code":{let f=x?Es(x):void 0;return new nn({cwd:o,...f&&Object.keys(f).length>0?{env:f}:{}})}case"codex":{let f=x?As(x):[],d=x?ks(x):void 0;return new rn({cwd:o,...f.length>0?{extraArgs:f}:{},...d&&Object.keys(d).length>0?{env:d}:{}})}case"openclaw":return new sn({command:e,cwd:o,agentId:a})}};function Gs(r){return r==="claude-code"||r==="codex"}var Js={path:"",version:"cloud-deployed"};function js(r,e){let o=r.frameworksCache?.[e.framework];if(o)return o;if(e.deployType==="cloud"&&Gs(e.framework))return Js}var qa=[0,5e3,5e3],Fa=2e4,Ws={protocolVersion:1,clientCapabilities:{fs:{readTextFile:!0,writeTextFile:!0}}},xn=class{paths;config;registry;factory;restartDelaysMs;createTimeoutMs;healthReporter;constructor(e){this.paths=e.paths,this.config=e.config,this.registry=e.registry,this.factory=e.downstreamFactory??za,this.restartDelaysMs=e.restartDelaysMs??qa,this.createTimeoutMs=e.createTimeoutMs??Fa,this.healthReporter=e.healthReporter}async createAgent(e){if(!e.agentId)throw new E("IPC_BAD_REQUEST","agentId required");if(!e.framework)throw new E("IPC_BAD_REQUEST","framework required");let o=St(e._meta)==="cloud";if(o&&e.framework==="openclaw")return W.info("cloud-deployed openclaw, ack without local spawn",{agentId:e.agentId,framework:e.framework}),{ok:!0,agentId:e.agentId,framework:e.framework};this.registry.reviveIfDisconnected?.(e.agentId);let a=this.registry.get(e.agentId);if(a){if(a.framework!==e.framework)throw new E("AGENT_BUSY",`agent ${e.agentId} exists with different framework (${a.framework})`);if(a.status==="error")W.warn("existing agent in error state, rebuilding",{agentId:e.agentId}),await a.dispose("rebuild after error").catch(_=>W.warn("dispose stale agent failed (ignored)",{err:String(_)})),this.registry.unregister(e.agentId);else return W.info("agent already exists,return current",{agentId:e.agentId}),{ok:!0,agentId:a.agentId,workspace:a.workspace,pid:a.downstream.pid()??0,framework:a.framework}}let x=this.config.frameworksCache?.[e.framework];if(!x)if(o&&Gs(e.framework))x=Js;else throw new E("AGENT_SPAWN_FAILED",`framework ${e.framework} not detected on this machine; rerun daemon to refresh frameworks_cache`);let f=Ie(e.agentId,this.paths),d=e.workspace??f.workspace,g=new AbortController,p=setTimeout(()=>g.abort(new E("AGENT_TIMEOUT",`_agent/create timed out after ${this.createTimeoutMs}ms`)),this.createTimeoutMs);try{return await this.createAgentInner(e,f,d,x,g.signal)}finally{clearTimeout(p)}}async createAgentInner(e,o,a,x,f){let d=()=>{if(f.aborted)throw f.reason instanceof Error?f.reason:new E("AGENT_TIMEOUT","_agent/create aborted")},g,p,_=!1;try{await cr(o.root,{recursive:!0}),await cr(a,{recursive:!0}),await cr(o.logs,{recursive:!0}),d(),e.framework!=="openclaw"&&await Ge(a,e.framework,e.agentId,e.cozeIdentity),d();let w=await ae(e.agentId,this.paths).catch(()=>null),y=xr({model:e.model??w?.model,modelToken:e.modelToken??w?.modelToken});g=this.factory(e.framework,x.path,a,e.agentId,y),await g.start(),d(),await g.initialize(Ws),d(),e.framework==="openclaw"&&await Ge(a,"openclaw",e.agentId,e.cozeIdentity);let A=St(e._meta);if(p=new an({agentId:e.agentId,framework:e.framework,workspace:a,downstream:g,deployType:A}),p.status="ok",w?.sessions){for(let[R,K]of Object.entries(w.sessions))p.sessions.set(R,K);Object.keys(w.sessions).length>0&&W.info("restored persisted sessions for agent",{agentId:e.agentId,count:Object.keys(w.sessions).length})}this.registry.register(p),_=!0;let T={agentId:e.agentId,framework:e.framework,workspace:a,cozeIdentity:e.cozeIdentity,createdAt:w?.createdAt??Date.now(),sessions:w?.sessions??{},model:y.model};y.modelToken&&(T.modelToken=y.modelToken),A==="cloud"&&(T.deployType="cloud"),w?.skills&&(T.skills=w.skills),w?.agentName&&(T.agentName=w.agentName),w?.description&&(T.description=w.description),await de(T,this.paths);let N=g.pid()??0;return W.info("agent created",{agentId:e.agentId,framework:e.framework,pid:N}),this.installRestartHook(p),{ok:!0,agentId:e.agentId,workspace:a,pid:N,framework:e.framework}}catch(w){throw W.error("agent create failed,rolling back",{agentId:e.agentId,err:String(w)}),g?.cleanup&&await g.cleanup("rollback").catch(y=>W.warn("downstream cleanup failed (ignored)",{err:String(y)})),g&&await g.stop("rollback").catch(()=>{}),_&&p&&(await p.dispose("rollback").catch(()=>{}),this.registry.unregister(e.agentId)),await Ba(o.root,{recursive:!0,force:!0}).catch(y=>W.warn("rm agent dir failed (ignored)",{err:String(y)})),w instanceof E?w:new E("AGENT_SPAWN_FAILED",String(w),{cause:w})}}async reportHealth(e,o,a){if(!this.healthReporter){W.info("healthReporter not wired, skip _agent/health upstream",{agentId:e.agentId,status:o});return}try{await this.healthReporter({status:o,_meta:{cozeAgentId:e.agentId}}),W.info("_agent/health reported",{agentId:e.agentId,status:o,cause:a})}catch(x){W.warn("_agent/health upstream failed (ignored)",{agentId:e.agentId,status:o,err:String(x)})}}installRestartHook(e){let o=0,a=x=>{if(e.status==="stopped"||e.status==="disconnected"||e.status==="switching")return;if(o>=this.restartDelaysMs.length){W.error("agent restart exhausted",{agentId:e.agentId,attempts:o,...x}),e.status="error",this.reportHealth(e,"error",x);return}let f=this.restartDelaysMs[o]??5e3;o+=1,e.status="degraded",W.warn("agent restart scheduled",{agentId:e.agentId,attempt:o,delayMs:f,...x}),setTimeout(()=>{this.doRestart(e,o).then(d=>{d?(o=0,e.status="ok"):a(null)})},f)};e.downstream.onExit((x,f)=>a({code:x,signal:f}))}async spawnAndInitialize(e,o){let a=await ae(e.agentId,this.paths).catch(()=>null),x=a?xr(a):void 0,f=this.factory(e.framework,o,e.workspace,e.agentId,x);try{return await f.start(),await f.initialize(Ws),f}catch(d){throw await f.stop("spawnAndInitialize failed").catch(()=>{}),d}}rewireSession(e,o){e.swap(o),this.registry.attachHooks?.(e),this.installRestartHook(e)}async doRestart(e,o){let a=js(this.config,e);if(!a)return W.error("framework cache missing during restart",{agentId:e.agentId,framework:e.framework}),e.status="error",!1;W.info("agent restart attempt",{agentId:e.agentId,attempt:o});try{let x=await this.spawnAndInitialize(e,a.path);return this.rewireSession(e,x),W.info("agent restart succeeded",{agentId:e.agentId,attempt:o}),!0}catch(x){return W.warn("agent restart attempt failed",{agentId:e.agentId,attempt:o,err:String(x)}),!1}}async executeModelSwitch(e){let o=this.registry.get(e);if(!o)throw new E("AGENT_NOT_FOUND",`agent not found: ${e}`);let a=js(this.config,o);if(!a)throw new E("AGENT_SPAWN_FAILED",`framework ${o.framework} not detected; cannot respawn for switchModel`);W.info("executeModelSwitch: stopping old downstream",{agentId:e,framework:o.framework}),await o.downstream.stop("switchModel").catch(d=>{W.warn("stop old downstream failed (ignored, continuing)",{agentId:e,err:String(d)})});let x;try{x=await this.spawnAndInitialize(o,a.path)}catch(d){throw new E("MODEL_SWITCH_FAILED",`failed to spawn new downstream after switchModel: ${d instanceof Error?d.message:String(d)}`,{cause:d})}this.rewireSession(o,x);let f=[...o.sessions.entries()];for(let[d,g]of f)try{await x.sessionLoad({sessionId:g,cwd:o.workspace}),o.verifiedSessions.add(g)}catch(p){throw new E("MODEL_SWITCH_FAILED",`sessionLoad failed after switchModel for cloud session ${d} (acp=${g}): ${p instanceof Error?p.message:String(p)}`,{cause:p})}f.length>0&&W.info("executeModelSwitch: session/load reloaded",{agentId:e,count:f.length}),o.status="ok",W.info("executeModelSwitch: success",{agentId:e,framework:o.framework})}};F();import{spawn as Ua}from"node:child_process";import{constants as Xs,access as Ha}from"node:fs/promises";import{delimiter as Ka,join as ja}from"node:path";var Wa=M("framework-detector"),Vs={"claude-code":"claude",codex:"codex",openclaw:"openclaw"},Ga=[".exe",".cmd",".bat",".ps1"],Et=class{env;constructor(e={}){this.env={pathEnv:e.pathEnv??process.env.PATH??"",platform:e.platform??process.platform,spawn:e.spawn??Ua,access:e.access??Ha}}async detect(e){let o=Vs[e],a=await this.which(o);if(!a)return Wa.debug("framework binary not found",{framework:e,bin:o}),null;let x=await this.probeVersion(a);return{path:a,version:x}}async detectAll(){let e=await Promise.all(Object.keys(Vs).map(async a=>[a,await this.detect(a)])),o={};for(let[a,x]of e)x&&(o[a]=x);return o}async which(e){let o=this.env.pathEnv.split(Ka).filter(Boolean),a=this.env.platform==="win32"?["",...Ga]:[""];for(let x of o)for(let f of a){let d=ja(x,e+f);if(await this.isExecutable(d))return d}return null}async isExecutable(e){try{let o=this.env.platform==="win32"?Xs.F_OK:Xs.X_OK;return await this.env.access(e,o),!0}catch{return!1}}async probeVersion(e){return new Promise(o=>{let a="",x=!1,f,d=g=>{x||(x=!0,f&&clearTimeout(f),o(g.trim()||"unknown"))};try{let g=this.env.spawn(e,["--version"],{stdio:["ignore","pipe","pipe"]});f=setTimeout(()=>{g.kill("SIGKILL"),d("unknown")},5e3),g.stdout?.on("data",p=>{a+=p.toString("utf8")}),g.on("error",()=>d("unknown")),g.on("close",()=>{let p=Xa(a).split(/\r?\n/)[0]??"";d(p)})}catch{d("unknown")}})}},Ja=new RegExp("\x1B\\[[0-9;]*[A-Za-z]","g");function Xa(r){return r.replace(Ja,"")}ir();ce();function cn(r){return qt(r??U().configFile)}function At(r,e){return Ft(e??U().configFile,r)}Fe();F();var $=M("core"),Va=5*6e4,Ya=3e4,fn=class{upstream;agents=new Map;disconnectedAgents=new Set;extensions;paths;upstreamIds=new ft;pendingUpstream=new Map;pendingBridge=new Map;constructor(e){this.upstream=e.upstream,this.extensions=e.extensions??{},this.paths=e.paths}registerExtension(e,o){this.extensions[e]=o}async start(){this.upstream.onFrame(e=>this.handleFrame(e)),await this.upstream.start(),$.info("Core started",{extensions:Object.keys(this.extensions)})}async stop(e){$.info("Core stopping",{reason:e}),await Promise.all([...this.agents.values()].map(o=>o.dispose(e))),this.agents.clear(),await this.upstream.stop(e)}get(e){return this.agents.get(e)}register(e){this.agents.set(e.agentId,e),this.attachDownstreamHooks(e),$.info("agent registered",{agentId:e.agentId,framework:e.framework});for(let o of this.registerHandlers)try{o(e.agentId)}catch(a){$.warn("onAgentRegister handler threw (ignored)",{agentId:e.agentId,err:String(a)})}}onAgentRegister(e){return this.registerHandlers.add(e),()=>this.registerHandlers.delete(e)}registerHandlers=new Set;unregister(e){this.agents.delete(e)}reviveIfDisconnected(e){this.disconnectedAgents.delete(e)&&$.info("agent revived from disconnect",{agentId:e})}attachDownstreamHooks(e){e.downstream.onUpdate(o=>{this.forwardUpdate(e,o)}),e.downstream.onAgentRequest(o=>{this.handleAgentRequest(e,o)}),e.downstream.onExit((o,a)=>{$.warn("agent downstream exited",{agentId:e.agentId,code:o,signal:a})})}attachHooks(e){this.attachDownstreamHooks(e)}async handleFrame(e){if(Zt(e)){this.handleUpstreamResponse(e);return}if($t(e))try{if(e.method.startsWith("_agent/")){let o=this.extensions[e.method];if(!o){await this.sendError(e.id,H.METHOD_NOT_FOUND,`extension not registered: ${e.method}`);return}let a=await o(e,this);await this.upstream.send(ct(e.id,a));return}if(e.method.startsWith("session/")){let o=await this.routeSessionMethod(e);await this.upstream.send(ct(e.id,o));return}if(e.method==="initialize"){await this.upstream.send(ct(e.id,{protocolVersion:1,agentCapabilities:{loadSession:!0}}));return}await this.sendError(e.id,H.METHOD_NOT_FOUND,`method not implemented: ${e.method}`)}catch(o){$.error("handleFrame failed",{method:e.method,err:String(o)}),await this.upstream.send(Xe(e.id,en(o)))}}async routeSessionMethod(e){if(!e.params||typeof e.params!="object")throw new E("IPC_BAD_REQUEST",`${e.method} requires params`);let o=e.params,a=o._meta?.cozeAgentId;if(!a)throw new E("IPC_BAD_REQUEST",`${e.method}: missing _meta.cozeAgentId`);let x=this.agents.get(a);if(!x)throw this.disconnectedAgents.has(a)?new E("AGENT_DISCONNECTED",`agent ${a} has been disconnected; cloud must _agent/create to revive`):new E("AGENT_NOT_FOUND",`agent not found: ${a}`);if(x.status==="switching")throw new E("MODEL_SWITCHING",`agent ${a} is switching model; retry later`,{retriable:!0});let f=Date.now(),d=!1;try{let g=await x.msgQueue.enqueue(()=>this.dispatchSessionCall(x,e.method,o));return d=!0,g}finally{$.info("session call done",{agentId:x.agentId,method:e.method,durationMs:Date.now()-f,ok:d})}}async dispatchSessionCall(e,o,a){e.lastActiveAt=Date.now();let{stripped:x}=vs(a);switch(o){case"session/new":{let f=x;return await e.downstream.sessionNew({...f,cwd:f.cwd||e.workspace})}case"session/load":{let f=x,d=f.sessionId,g=e.sessions.get(d);try{let p=g??d,_=await e.downstream.sessionLoad({...f,sessionId:p,cwd:f.cwd||e.workspace});return g||e.sessions.set(d,p),_}catch(p){$.warn("session/load failed,fallback to session/new",{agentId:e.agentId,cloudId:d,err:String(p)});let _=await e.downstream.sessionNew({cwd:f.cwd||e.workspace});return e.sessions.set(d,_.sessionId),{}}}case"session/prompt":{let f=x,d=f.sessionId,g=e.sessions.get(d),p=!1;if(g&&!e.verifiedSessions.has(g))try{await e.downstream.sessionLoad({sessionId:g,cwd:e.workspace}),e.verifiedSessions.add(g),$.info("session restored via session/load",{agentId:e.agentId,cloudId:d,acpId:g})}catch(y){$.warn("session/load failed,fallback to session/new",{agentId:e.agentId,cloudId:d,acpId:g,err:String(y)}),e.sessions.delete(d),g=void 0}g||(g=(await e.downstream.sessionNew({cwd:e.workspace})).sessionId,e.sessions.set(d,g),e.verifiedSessions.add(g),p=!0);let _=a._meta?.cozeTriggerMsgId;_?e.activeTriggers.set(g,_):e.activeTriggers.delete(g);let w=await e.downstream.sessionPrompt({...f,sessionId:g});return p&&this.persistSessionMapping(e),w}case"session/cancel":{let d=x.sessionId;if(!d)throw new E("IPC_BAD_REQUEST","session/cancel: missing sessionId");let g=e.sessions.get(d);return g&&await e.downstream.sessionCancel({sessionId:g}),{ok:!0}}default:throw new E("IPC_BAD_REQUEST",`session method not supported: ${o}`)}}forwardUpdate(e,o){let a=o.sessionId,x=this.reverseSessionId(e,a);if(!x){$.debug("drop update for unknown session",{agentId:e.agentId,acpId:a});return}let f={cozeAgentId:e.agentId},d=e.activeTriggers.get(a);d&&(f.cozeTriggerMsgId=d),this.upstream.send(Os("session/update",{...o,sessionId:x,_meta:f})).catch(g=>$.warn("forward update failed",{agentId:e.agentId,err:String(g)}))}handleAgentRequest(e,o){if(o.method==="session/request_permission"){this.forwardPermissionRequest(e,o);return}$.warn("unhandled agent request,returning method_not_found",{agentId:e.agentId,method:o.method}),e.downstream.respondAgentRequestError(o.id,{code:H.METHOD_NOT_FOUND,message:`method not handled by Bridge: ${o.method}`})}forwardPermissionRequest(e,o){let a=this.upstreamIds.next("session/request_permission"),x=o.params??{},d=x.sessionId,g=d?e.activeTriggers.get(d):void 0,p={cozeAgentId:e.agentId};g&&(p.cozeTriggerMsgId=g);let _=d?this.reverseSessionId(e,d):void 0,w={...x,..._?{sessionId:_}:{},_meta:p},y=setTimeout(()=>{let A=this.pendingUpstream.get(a);A&&(this.pendingUpstream.delete(a),$.warn("upstream permission request timed out,replying cancelled to agent",{agentId:e.agentId,upstreamId:a}),e.downstream.respondAgentRequest(A.agentRequestId,{outcome:{kind:"cancelled"}}))},Va);this.pendingUpstream.set(a,{agentRequestId:o.id,session:e,method:o.method,timer:y}),this.upstream.send(xt(a,"session/request_permission",w)).catch(A=>{let T=this.pendingUpstream.get(a);T&&(clearTimeout(T.timer),this.pendingUpstream.delete(a)),$.error("forward permission request failed",{agentId:e.agentId,err:String(A)}),e.downstream.respondAgentRequestError(o.id,{code:H.INTERNAL_ERROR,message:`upstream send failed: ${String(A)}`})})}handleUpstreamResponse(e){if(e.id===null)return;let o=this.pendingUpstream.get(e.id);if(o){this.pendingUpstream.delete(e.id),clearTimeout(o.timer),e.error?o.session.downstream.respondAgentRequestError(o.agentRequestId,e.error):o.session.downstream.respondAgentRequest(o.agentRequestId,e.result);return}let a=this.pendingBridge.get(e.id);if(a){this.pendingBridge.delete(e.id),clearTimeout(a.timer),e.error?a.reject(new Qt(e.error)):a.resolve(e.result);return}$.debug("orphan upstream response (no pending)",{id:e.id})}sendRequest(e,o,a=Ya){let x=this.upstreamIds.next(e);return new Promise((f,d)=>{let g=setTimeout(()=>{this.pendingBridge.delete(x),d(new E("AGENT_TIMEOUT",`${e} timed out after ${a}ms`))},a);this.pendingBridge.set(x,{method:e,resolve:f,reject:d,timer:g}),this.upstream.send(xt(x,e,o)).catch(p=>{let _=this.pendingBridge.get(x);_&&(clearTimeout(_.timer),this.pendingBridge.delete(x)),d(p)})})}async persistSessionMapping(e){if(this.paths)try{await ar(e.agentId,e.sessions,this.paths)}catch(o){$.warn("persist session mapping failed",{agentId:e.agentId,err:String(o)})}}reverseSessionId(e,o){for(let[a,x]of e.sessions.entries())if(x===o)return a}sendError(e,o,a){return this.upstream.send(Xe(e,{code:o,message:a}))}};F();ce();import{randomBytes as Qa}from"node:crypto";import{chmod as $a,mkdir as Za,writeFile as Ys}from"node:fs/promises";import{createServer as ex}from"node:http";import{dirname as tx}from"node:path";var nx=1e6,fr=M("ipc"),un=class{server=null;port=0;token="";routes;paths;constructor(e){this.routes=new Map(e.routes.map(o=>[`${o.method} ${o.path}`,o])),this.paths=e.paths??U()}async start(){this.token=Qa(32).toString("hex");let e=ex((a,x)=>{this.dispatch(a,x)});this.server=e,await new Promise((a,x)=>{e.once("error",x),e.listen(0,"127.0.0.1",()=>a())});let o=e.address();if(!o||typeof o!="object")throw new Error("failed to obtain IPC port");return this.port=o.port,await this.persistAuthFiles(),fr.info("IPC listening",{port:this.port}),{port:this.port,token:this.token}}async stop(){let e=this.server;e&&(await new Promise((o,a)=>{e.close(x=>x?a(x):o())}),this.server=null)}async persistAuthFiles(){await Za(tx(this.paths.portFile),{recursive:!0}),await Ys(this.paths.portFile,String(this.port),"utf8"),await Ys(this.paths.tokenFile,this.token,"utf8");try{await $a(this.paths.tokenFile,384)}catch(e){fr.warn("chmod token file failed (non-POSIX?)",{err:String(e)})}}async dispatch(e,o){if(e.headers.authorization!==`Bearer ${this.token}`){kt(o,401,{error:"unauthorized"});return}let x=`${e.method} ${(e.url??"").split("?")[0]}`,f=this.routes.get(x);if(!f){kt(o,404,{error:"not found"});return}let d=null;if(e.method==="POST")try{d=await rx(e)}catch(g){kt(o,400,{error:"invalid json",detail:String(g)});return}try{let g=await f.handler(d,e);kt(o,200,g??{ok:!0})}catch(g){fr.error("IPC handler failed",{key:x,err:String(g)}),kt(o,500,{error:g instanceof Error?g.message:String(g)})}}};function kt(r,e,o){r.statusCode=e,r.setHeader("content-type","application/json"),r.end(JSON.stringify(o))}async function rx(r){let e=[],o=0;for await(let x of r){let f=x;if(o+=f.length,o>nx)throw new Error("body too large");e.push(f)}let a=Buffer.concat(e).toString("utf8");return a?JSON.parse(a):null}var So=Pe(ai(),1);var zc=Pe(no(),1),qc=Pe(kn(),1),Fc=Pe(lt(),1),Uc=Pe(Sr(),1),Hc=Pe(Ar(),1),Kc=Pe(Lr(),1),uo=Pe(Tn(),1),jc=Pe(fo(),1);var lo=uo.default;F();var Nn="1008033",ho="1289";var go="pbbp2",po="https://www.coze.cn",mo="/api/coze_claw/resource/get_frontier_key",Wc="https://www.coze.cn",Gc="wss://frontier.coze.cn";function _o(r){return r??process.env.COZE_BRIDGE_HANDSHAKE_URL??Wc}function wo(r){return r??process.env.COZE_BRIDGE_FRONTIER_URL??Gc}function Mn(r){let e={},o=r?.ttEnv??process.env.COZE_BRIDGE_TT_ENV,a=r?.usePpe??process.env.COZE_BRIDGE_USE_PPE;return o&&(e["x-tt-env"]=o),a&&(e["x-use-ppe"]=a),e}var se=M("upstream.frontier"),bo="application/json",vo="none",Rn=class{constructor(e){this.opts=e}opts;fws=null;handler=null;connectHandler=null;opened=!1;openCount=0;async start(){if(this.fws){se.warn("start called on already-started FrontierUpstream; noop");return}let e={Authorization:`Bearer ${this.opts.privatecode}`,Origin:po,...Mn(this.opts.ppeOverride)};class o extends lo{constructor(g){super(g,go,{headers:e})}send(g,...p){if(ys("debug"))try{let _;typeof g=="string"?_=Buffer.from(g,"utf8"):g instanceof Buffer?_=g:g instanceof ArrayBuffer?_=new Uint8Array(g):ArrayBuffer.isView(g)?_=new Uint8Array(g.buffer,g.byteOffset,g.byteLength):_=new Uint8Array(0);let w=Buffer.from(_.slice(0,128)).toString("hex");se.debug("WS raw frame out",{bytes:_.byteLength,headHex:w})}catch(_){se.warn("WS raw frame dump failed",{err:String(_)})}super.send(g,...p)}}let a=wo(this.opts.urlOverride),x={url:a,ws:o,fpID:ho,aID:Nn,accessKey:this.opts.handshake.accessKey,deviceID:this.opts.handshake.deviceId,payloadType:{type:bo,force:!0},payloadEncoding:{encoding:vo,force:!0},enableTransformTextPayload:!0,enableQoS:!1,enableAutoAck:!1,automaticOpen:!1,debug:this.opts.debug??!1},f=new So.FWS(x);f.onopen=()=>{this.opened=!0,this.openCount+=1;let d=this.openCount===1;se.info("frontier opened",{url:a,remoteDeviceId:this.opts.handshake.deviceId,initial:d,openCount:this.openCount}),this.connectHandler&&Promise.resolve(this.connectHandler({initial:d})).catch(g=>se.warn("onConnect handler threw (ignored)",{err:String(g)}))},f.onclose=d=>{this.opened=!1,se.info("frontier closed",{code:d.code,reason:d.reason,willReconnect:d.willReconnect})},f.onerror=d=>{se.warn("frontier error",{code:d.code,msg:d.message})},f.onmessage=d=>this.handleMessage(d),this.fws=f,await f.connect()}async stop(e){let o=this.fws;if(o){this.fws=null,this.opened=!1;try{o.close(1e3,e??"bridge shutdown")}catch(a){se.warn("frontier close threw (ignored)",{err:String(a)})}}}async send(e){let o=this.fws;if(!o)throw new E("UPSTREAM_DISCONNECTED","frontier upstream not started");let a=JSON.stringify(e),x=e;se.info("frontier frame out",{method:x.method,jsonrpcId:x.id,size:a.length});try{await o.send(a,{service:33555712,method:1,payloadType:bo,payloadEncoding:vo})}catch(f){throw new E("UPSTREAM_DISCONNECTED",`frontier send failed: ${String(f)}`,{cause:f})}}onFrame(e){this.handler=e}onConnect(e){this.connectHandler=e}isConnected(){return this.opened&&this.fws?.readyState===1}handleMessage(e){let o=e.message?.service;if(o!==33555712){se.debug("drop non-adapter frontier frame",{service:o});return}let a=Vc(e);if(!a){se.debug("frontier message without text payload, drop",{payloadType:e.message?.payloadType});return}if(!this.handler){se.debug("frame received but no onFrame handler",{size:a.length});return}let x;try{x=JSON.parse(a)}catch(f){se.warn("frontier message JSON parse failed",{err:String(f),head:a.slice(0,80)});return}se.info("frontier frame in",{logid:Xc(e.message?.LogID),logidNew:e.message?.LogIDNew,msgId:e.message?.msgID,jsonrpcId:x.id}),Promise.resolve(this.handler(x)).catch(f=>se.warn("frontier frame handler threw",{err:String(f)}))}};function Xc(r){return r?r.high===0?String(r.low>>>0):`${r.high.toString(16)}${(r.low>>>0).toString(16).padStart(8,"0")}`:""}function Vc(r){let e=r.message;if(e?.textPayload)return e.textPayload;let o=e?.payload;if(!o)return null;try{return Buffer.from(o).toString("utf8")}catch{return null}}F();function Eo(r){return r?r.startsWith("boe_")?{ttEnv:r}:{ttEnv:r,usePpe:"1"}:{}}var Co=M("handshake");async function Ao(r){let e=_o(r.endpoint),o=r.timeoutMs??1e4,a=`${Yc(e)}${mo}?aid=${encodeURIComponent(Nn)}`,x={Authorization:`Bearer ${r.privatecode}`,Accept:"application/json",...Mn(r.ppeOverride)},f=new AbortController,d=setTimeout(()=>f.abort(),o);Co.info("frontier key handshake",{base:e});try{let g=await fetch(a,{method:"GET",headers:x,signal:f.signal}),p=g.headers.get("x-tt-logid")??"",_=g.headers.get("x-tt-trace-id")??"";if(!g.ok){let T=await g.text().catch(()=>"");throw new E("UPSTREAM_HANDSHAKE_FAILED",`handshake HTTP ${g.status} logid=${p}: ${T.slice(0,200)}`)}let w=await g.json();if(w.code!==void 0&&w.code!==0)throw new E("UPSTREAM_HANDSHAKE_FAILED",`handshake code=${w.code} msg=${w.msg??"-"} logid=${p}`);let y=w.data?.access_key,A=w.data?.device_id;if(!y||!A)throw new E("UPSTREAM_HANDSHAKE_FAILED",`handshake response missing access_key/device_id logid=${p}: ${JSON.stringify(w)}`);return Co.info("handshake ok",{remoteDeviceId:A,logid:p,traceId:_}),{accessKey:y,deviceId:A}}catch(g){throw g instanceof E?g:g.name==="AbortError"?new E("UPSTREAM_HANDSHAKE_FAILED",`handshake timeout (${o}ms)`):new E("UPSTREAM_HANDSHAKE_FAILED",String(g),{cause:g})}finally{clearTimeout(d)}}function Yc(r){return r.endsWith("/")?r.slice(0,-1):r}F();var Mr=M("upstream.switchable"),On=class{inner;handler=null;connectHandler=null;constructor(e){this.inner=e}async swap(e,o){if(this.inner===e)return;Mr.info("swap upstream",{reason:o});let a=this.inner;this.inner=e,this.handler&&e.onFrame(this.handler),this.connectHandler&&e.onConnect&&e.onConnect(this.connectHandler);try{await e.start()}catch(x){throw Mr.error("swap target start failed, reverting",{err:String(x)}),this.inner=a,x}await a.stop(o??"swapped").catch(x=>Mr.warn("previous upstream stop threw (ignored)",{err:String(x)}))}current(){return this.inner}start(){return this.inner.start()}stop(e){return this.inner.stop(e)}send(e){return this.inner.send(e)}onFrame(e){this.handler=e,this.inner.onFrame(e)}onConnect(e){this.connectHandler=e,this.inner.onConnect?.(e)}isConnected(){return this.inner.isConnected()}};F();var Rr=M("upstream"),Ot=class{handler=null;async start(){Rr.info("NoopUpstream started (M1 skeleton; real Frontier wired in M4)")}async stop(e){Rr.info("NoopUpstream stopped",{reason:e})}async send(e){Rr.debug("NoopUpstream.send (dropped)",{method:"method"in e?e.method:void 0})}onFrame(e){this.handler=e}isConnected(){return!1}async injectFrame(e){this.handler&&await this.handler(e)}};F();ce();F();ce();import{readFileSync as Qc,unlinkSync as $c}from"node:fs";import{mkdir as Zc,readFile as ko,unlink as Do,writeFile as ef}from"node:fs/promises";import{dirname as tf}from"node:path";var nf=M("single-instance"),Bn=class{pidFile;acquired=!1;constructor(e={}){this.pidFile=e.pidFile??U().pidFile,e.processTitle&&(process.title=e.processTitle)}async acquire(){let e=await this.readExistingPid();return e!==null&&this.isAlive(e)?{kind:"already-running",pid:e}:(e!==null&&(nf.warn("removing stale pid file",{stalePid:e}),await Do(this.pidFile).catch(()=>{})),await Zc(tf(this.pidFile),{recursive:!0}),await ef(this.pidFile,String(process.pid),"utf8"),this.acquired=!0,this.installCleanupHooks(),{kind:"acquired"})}async release(){if(this.acquired){try{(await ko(this.pidFile,"utf8")).trim()===String(process.pid)&&await Do(this.pidFile)}catch{}this.acquired=!1}}async readExistingPid(){try{let e=await ko(this.pidFile,"utf8"),o=Number.parseInt(e.trim(),10);return Number.isFinite(o)&&o>0?o:null}catch(e){if(e.code==="ENOENT")return null;throw e}}isAlive(e){try{return process.kill(e,0),!0}catch(o){return o.code==="EPERM"}}installCleanupHooks(){process.once("exit",()=>{if(this.acquired)try{Qc(this.pidFile,"utf8").trim()===String(process.pid)&&$c(this.pidFile)}catch{}})}};var B=M("daemon"),rf="coze-bridge-daemon";async function To(){let r=new Bn({processTitle:rf}),e=await r.acquire();if(e.kind==="already-running")throw new Error(`coze-bridge daemon already running (pid=${e.pid})`);let o=await cn(),a=o??{};or({pid:process.pid}),B.info(o?"loaded bridge config":"initialized bridge config");try{let D=new Et;a.frameworksCache=await D.detectAll(),B.info("refreshed frameworks_cache",{detected:Object.keys(a.frameworksCache)})}catch(D){B.warn("framework detection failed",{err:String(D)})}await At(a);let x=new On(new Ot),f=U(),d=new fn({upstream:x,paths:f});await of(f,d);let g=new xn({paths:f,config:a,registry:d,healthReporter:async D=>{await d.sendRequest("_agent/health",D)}}),p,_,w=null,y=null;d.registerExtension("_agent/create",async D=>g.createAgent(D.params)),d.registerExtension("_agent/health",async()=>({ok:!0}));let A=new Vt({agents:d.agents,disposeAndMarkDisconnected:async(D,z)=>{let G=d.agents.get(D);G&&(await G.dispose(`disconnect: ${z}`).catch(Ae=>B.warn("dispose during disconnect failed (ignored)",{agentId:D,err:String(Ae)})),G.status="disconnected",d.unregister(D)),d.disconnectedAgents.add(D)},executeModelSwitch:D=>g.executeModelSwitch(D)});d.registerExtension("_agent/listSkills",D=>A.listSkills(D.params)),d.registerExtension("_agent/addSkills",D=>A.addSkills(D.params)),d.registerExtension("_agent/removeSkills",D=>A.removeSkills(D.params)),d.registerExtension("_agent/getFileTree",D=>A.getFileTree(D.params)),d.registerExtension("_agent/getFileContent",D=>A.getFileContent(D.params)),d.registerExtension("_agent/update",D=>A.updateAgent(D.params)),d.registerExtension("_agent/disconnect",D=>A.disconnectAgent(D.params)),d.registerExtension("_agent/switchModel",D=>A.switchModel(D.params));let T=new Gt({paths:f,handlers:A,sendDetail:D=>d.sendRequest("_agent/detail",D)});x.onConnect(({initial:D})=>{B.info("frontier upstream connected, triggering detail sync",{initial:D}),T.syncAll(D?"initial-connect":"reconnect").catch(z=>B.warn("detail sync top-level error (ignored)",{err:String(z)}))});let N=new un({paths:f,routes:[{method:"GET",path:"/status",handler:async()=>({running:!0,pid:process.pid,agents:[...d.agents.keys()],deviceId:w??"",frameworksCache:a.frameworksCache??{}})},{method:"POST",path:"/pair",handler:async D=>{let z=D,G=z?.privatecode,Ae=z?.pairing_code;if(!G||!Ae)throw new E("IPC_BAD_REQUEST","/pair requires privatecode + pairing_code");let Oe=Eo(z.env),we=z.handshake_url,ye=z.frontier_url,ge=sf(z.env,we,ye),et=!!p&&p!==G,Bt=_!==void 0&&_!==ge,zt=et||Bt;if(zt){B.warn("pair config switched, resetting agents",{pcChanged:et,envChanged:Bt,previousPc:p?Po(p):"",nextPc:Po(G),previousEnvKey:_??"",nextEnvKey:ge});for(let J of[...d.agents.values()])await J.dispose("pair config switch").catch(()=>{}),d.agents.delete(J.agentId);await x.swap(new Ot,"pair switch").catch(()=>{})}let be=await Ao({privatecode:G,...we?{endpoint:we}:{},ppeOverride:Oe});w=be.deviceId,or({deviceId:w,pid:process.pid});let ke=new Rn({handshake:be,privatecode:G,...ye?{urlOverride:ye}:{},ppeOverride:Oe});await x.swap(ke,"pair"),p=G,_=ge;let Wn=Object.keys(a.frameworksCache??{});try{let J=await d.sendRequest("_agent/pair",{pairCode:Ae,patToken:G,frameworks:Wn,_meta:{cozeDeviceId:w}});B.info("_agent/pair ok",{pairResult:J}),y||(y=new Yt({core:d,getDeviceId:()=>w??""})),y.start(),zt&&Io(f,g).catch(j=>B.warn("post-pair-switch auto-revive error (ignored)",{err:String(j)}));let nt;return z.agent_id&&(nt=await af(z.agent_id,f,g,j=>d.sendRequest("_agent/detail",j)).catch(j=>(B.error("--agent-id ensureAgent failed",{agentId:z.agent_id,err:String(j)}),{ok:!1,agentId:z.agent_id??"",note:String(j)}))),{ok:!0,note:"paired with cloud",...nt?{agent:nt}:{}}}catch(J){return B.error("_agent/pair failed",{err:String(J)}),{ok:!1,note:`pair failed: ${String(J)}`}}}},{method:"POST",path:"/_agent/create",handler:async D=>{let z=D;return{ok:!0,result:await g.createAgent(z)}}},{method:"POST",path:"/refresh",handler:async()=>{B.info("IPC /refresh: re-detecting frameworks");let D=new Et;return a.frameworksCache=await D.detectAll(),await At(a),{ok:!0,frameworks:a.frameworksCache}}},{method:"POST",path:"/shutdown",handler:async()=>(B.info("IPC /shutdown received"),setImmediate(()=>{xe.shutdown("ipc /shutdown")}),{ok:!0})}]}),{port:R,token:K}=await N.start();await d.start(),Io(f,g).catch(D=>B.warn("auto-revive top-level error (ignored)",{err:String(D)}));let ie=null,xe={port:R,token:K,core:d,ipc:N,shutdown(D){return ie||(B.info("daemon shutdown",{reason:D}),ie=(async()=>{y?.stop(),await d.stop(D),await N.stop(),await r.release()})(),ie)}};for(let D of["SIGTERM","SIGINT"])process.on(D,()=>{xe.shutdown(D).then(()=>process.exit(0))});return B.info("daemon ready",{port:R,pid:process.pid,nodeVersion:process.version,platform:process.platform,frameworks:Object.keys(a.frameworksCache??{}),libVersion:a.libVersion??"dev"}),xe}function Po(r){return r.length<=8?"***":`${r.slice(0,4)}***${r.slice(-4)}`}function sf(r,e,o){return`${r??""}|${e??""}|${o??""}`}async function of(r,e){let{readdir:o}=await import("node:fs/promises"),a;try{a=await o(r.agentsRoot)}catch{return}let{loadAgentConfig:x,enforceAgentConfigMode:f}=await Promise.resolve().then(()=>(Fe(),Wt));for(let d of a){await f(d,r).catch(g=>B.warn("enforceAgentConfigMode failed (ignored)",{agentId:d,err:String(g)}));try{let g=await x(d,r);g?.disconnectedAt&&(e.disconnectedAgents.add(d),B.info("agent marked disconnected on startup",{agentId:d,disconnectedAt:g.disconnectedAt,reason:g.disconnectReason??""}))}catch(g){B.warn("failed to load agent config on startup, skipping",{agentId:d,err:String(g)})}}}async function af(r,e,o,a){let{loadAgentConfig:x}=await Promise.resolve().then(()=>(Fe(),Wt)),f=await x(r,e);if(f){B.info("--agent-id: local config found, reconnecting",{agentId:r,framework:f.framework,hadDisconnect:!!f.disconnectedAt});let _={agentId:f.agentId,framework:f.framework,...f.cozeIdentity?{cozeIdentity:f.cozeIdentity}:{},...f.model?{model:f.model}:{},...f.modelToken?{modelToken:f.modelToken}:{}};return await o.createAgent(_),{ok:!0,agentId:r,note:f.disconnectedAt?"revived from local config":"connected from local config"}}B.info("--agent-id: local config missing, pulling _agent/detail from cloud",{agentId:r});let d=await a({_meta:{cozeAgentId:r}});if(!d.framework)throw new E("AGENT_NOT_FOUND",`agent ${r} \u4E0D\u5728\u672C\u5730; \u4E91\u7AEF _agent/detail \u54CD\u5E94\u7F3A framework \u5B57\u6BB5 (D36 \u534F\u8BAE\u6269\u5C55\u672A\u751F\u6548), \u65E0\u6CD5\u5728\u672C\u673A\u65B0\u5EFA`);let g={agentId:d.agentId,framework:d.framework,...d.cozeIdentity?{cozeIdentity:d.cozeIdentity}:{},...d.model?{model:d.model}:{},...d.modelToken?{modelToken:d.modelToken}:{},...d.deployType?{_meta:{cozeDeployType:d.deployType}}:{}};await o.createAgent(g);let p=d.deployType==="cloud"&&d.framework==="openclaw";return{ok:!0,agentId:r,note:p?"cloud agent acknowledged":"created from cloud detail"}}async function Io(r,e){let{readdir:o}=await import("node:fs/promises"),a;try{a=await o(r.agentsRoot)}catch{return{revived:0,skipped:0,total:0}}if(a.length===0)return{revived:0,skipped:0,total:0};let{loadAgentConfig:x}=await Promise.resolve().then(()=>(Fe(),Wt));B.info("auto-revive: scanning local agents on startup",{count:a.length});let f=0,d=0;for(let g of a){let p;try{p=await x(g,r)}catch(_){B.warn("auto-revive: load config failed (skipping)",{agentId:g,err:String(_)}),d+=1;continue}if(!p){d+=1;continue}if(p.disconnectedAt){B.info("auto-revive: skip disconnected agent",{agentId:g,disconnectedAt:p.disconnectedAt}),d+=1;continue}try{B.info("auto-revive: spawning",{agentId:g,framework:p.framework}),await e.createAgent({agentId:p.agentId,framework:p.framework,...p.cozeIdentity?{cozeIdentity:p.cozeIdentity}:{},...p.model?{model:p.model}:{},...p.modelToken?{modelToken:p.modelToken}:{},...p.deployType?{_meta:{cozeDeployType:p.deployType}}:{}}),f+=1}catch(_){B.warn("auto-revive: createAgent failed (skipping)",{agentId:g,framework:p.framework,err:String(_)}),d+=1}}return B.info("auto-revive: done",{revived:f,skipped:d,total:a.length}),{revived:f,skipped:d,total:a.length}}Br();ce();import{readFile as No}from"node:fs/promises";var je=class{paths;constructor(e){this.paths=e??U()}async probe(e=1e3){let o=await this.readAuth();if(!o)return{kind:"not-running"};try{let a=await this.fetch(o,{method:"GET",path:"/status",timeoutMs:e});return a.status===200?{kind:"connected",...o}:{kind:"stale",reason:`unexpected status ${a.status}`}}catch(a){return{kind:"stale",reason:pf(a)}}}async request(e){let o=await this.readAuth();if(!o)throw new Error("coze-bridge daemon not running (no port/token files)");return this.fetch(o,e)}async readAuth(){try{let[e,o]=await Promise.all([No(this.paths.portFile,"utf8"),No(this.paths.tokenFile,"utf8")]),a=Number.parseInt(e.trim(),10),x=o.trim();return!Number.isFinite(a)||a<=0||!x?null:{port:a,token:x}}catch(e){if(e.code==="ENOENT")return null;throw e}}async fetch(e,o){let a=o.body!==void 0,x={Authorization:`Bearer ${e.token}`};a&&(x["content-type"]="application/json");let f=new AbortController,d=setTimeout(()=>f.abort(),o.timeoutMs??5e3);try{let g=await fetch(`http://127.0.0.1:${e.port}${o.path}`,{method:o.method,headers:x,body:a?JSON.stringify(o.body):void 0,signal:f.signal}),p=await g.text();return{status:g.status,body:gf(p)}}finally{clearTimeout(d)}}};function gf(r){if(!r)return null;try{return JSON.parse(r)}catch{return r}}function pf(r){return r instanceof Error?r.message:String(r)}F();ce();import{copyFile as Mo,mkdir as mf,readFile as zr,writeFile as _f}from"node:fs/promises";import{dirname as wf,resolve as qr,sep as zn}from"node:path";import{fileURLToPath as yf}from"node:url";F();ce();var Ro=M("dist-install");function bf(r){let e=yf(r),o=wf(e),a=`${zn}src${zn}`;if(o.includes(a)||o.endsWith(`${zn}src${zn}cli`))return null;let x=qr(o,"index.js"),f=qr(o,"..","package.json");return{dist:x,pkgJson:f}}async function Oo(r={}){let e=r.paths??U(),o=bf(import.meta.url),a=r.sourceDist??o?.dist,x=r.sourcePackageJson??o?.pkgJson;if(!a||!x)return{kind:"dev-mode-skip",reason:"running from src/(tsx loader);no dist/ to install"};let f;try{f=JSON.parse(await zr(x,"utf8")).version??"unknown"}catch(y){return Ro.warn("cannot read source package.json,skip dist install",{err:String(y)}),{kind:"dev-mode-skip",reason:`package.json read failed: ${String(y)}`}}let d=await cn(e.configFile)??{},g=d.libVersion;if(g===f)try{return await zr(e.libEntry),{kind:"already-current",libVersion:f}}catch{}await mf(e.libDir,{recursive:!0}),await Mo(a,e.libEntry),await Mo(`${a}.map`,`${e.libEntry}.map`).catch(()=>{});let p=qr(e.libDir,"package.json"),_=`${JSON.stringify({type:"module"},null,2)}
|
|
91
|
+
`;return await zr(p,"utf8").catch(()=>null)!==_&&await _f(p,_),d.libVersion=f,await At(d,e.configFile),Ro.info("dist installed",{libEntry:e.libEntry,fromVersion:g,toVersion:f}),g?{kind:"version-changed",fromVersion:g,toVersion:f,libEntry:e.libEntry}:{kind:"first-install",libVersion:f,libEntry:e.libEntry}}var Ff=M("cli");function wt(r,e){let o=[],a;for(let x=0;x<r.length;x++){let f=r[x];if(f===e){a=r[x+1],x+=1;continue}if(f.startsWith(`${e}=`)){a=f.slice(e.length+1);continue}o.push(f)}return{value:a,rest:o}}function Uf(r){let e=r.slice(2);if(e.includes("--daemon"))return{mode:"daemon"};if(e.includes("--status"))return{mode:"status"};if(e.includes("--stop"))return{mode:"stop"};if(e.includes("--refresh"))return{mode:"refresh"};if(e.includes("--uninstall"))return{mode:"uninstall"};if(e.includes("--install-service"))return{mode:"install-service"};if(e.includes("--help")||e.includes("-h")||e.length===0)return{mode:"help"};let o=e,{value:a,rest:x}=wt(o,"--pat-token");o=x;let{value:f,rest:d}=wt(o,"--pair-code");o=d;let{value:g,rest:p}=wt(o,"--env");o=p;let{value:_,rest:w}=wt(o,"--handshake-url");o=w;let{value:y,rest:A}=wt(o,"--frontier-url");o=A;let{value:T}=wt(o,"--agent-id");if(!a||!f)return{mode:"help"};let N={mode:"pair",privatecode:a,pairingCode:f};return g&&(N.env=g),_&&(N.handshakeUrl=_),y&&(N.frontierUrl=y),T&&(N.agentId=T),N}var Hf=`
|
|
92
92
|
coze-bridge - local bridge daemon for cloud Agent Service
|
|
93
93
|
|
|
94
94
|
Usage:
|
|
@@ -115,34 +115,35 @@ Auto-connect agent (optional):
|
|
|
115
115
|
|
|
116
116
|
Internal:
|
|
117
117
|
<node> <entry> --daemon daemon mode (OS supervisor only)
|
|
118
|
-
`.trimStart();async function
|
|
119
|
-
`),1;if(
|
|
120
|
-
`),1;let
|
|
121
|
-
${JSON.stringify(
|
|
122
|
-
`),0}async function
|
|
123
|
-
`),0;
|
|
124
|
-
`),0
|
|
125
|
-
`),
|
|
118
|
+
`.trimStart();async function Ho(r=process.argv,e={}){let o=Uf(r);switch(o.mode){case"help":return process.stdout.write(Hf),0;case"daemon":{try{await To()}catch(a){return Ff.error("daemon start failed",{err:String(a)}),1}return new Promise(()=>{})}case"status":return Kf(e);case"stop":return jf(e);case"refresh":return Wf(e);case"uninstall":return Gf(e);case"install-service":return Jf();case"pair":{let a={};return o.env&&(a.env=o.env),o.handshakeUrl&&(a.handshakeUrl=o.handshakeUrl),o.frontierUrl&&(a.frontierUrl=o.frontierUrl),Xf(o.privatecode,o.pairingCode,e,a,o.agentId)}}}async function Ko(r){let{unlink:e}=await import("node:fs/promises");await Promise.all([e(r.pidFile).catch(()=>{}),e(r.portFile).catch(()=>{}),e(r.tokenFile).catch(()=>{})])}async function Kf(r){let e=r.paths??U(),o=new je(e),a=await o.probe();if(a.kind==="not-running")return process.stdout.write(`coze-bridge: not running
|
|
119
|
+
`),1;if(a.kind==="stale")return await Ko(e),process.stdout.write(`coze-bridge: not running (cleaned stale state)
|
|
120
|
+
`),1;let x=await o.request({method:"GET",path:"/status"});return process.stdout.write(`coze-bridge: running
|
|
121
|
+
${JSON.stringify(x.body,null,2)}
|
|
122
|
+
`),0}async function jf(r){let e=r.paths??U(),o=new je(e),a=await o.probe();if(a.kind==="not-running")return process.stdout.write(`coze-bridge: not running
|
|
123
|
+
`),0;if(a.kind==="stale")return await Ko(e),process.stdout.write(`coze-bridge: not running (cleaned stale state)
|
|
124
|
+
`),0;try{return await o.request({method:"POST",path:"/shutdown"}),process.stdout.write(`coze-bridge: stopped
|
|
125
|
+
`),0}catch(x){return process.stdout.write(`coze-bridge: stop failed: ${String(x)}
|
|
126
|
+
`),1}}async function Wf(r){let e=new je(r.paths);if((await e.probe()).kind==="not-running")return process.stdout.write(`coze-bridge: not running (start daemon first)
|
|
126
127
|
`),1;try{let a=await e.request({method:"POST",path:"/refresh"});return a.status===200?(process.stdout.write(`coze-bridge: refreshed
|
|
127
128
|
${JSON.stringify(a.body,null,2)}
|
|
128
129
|
`),0):(process.stderr.write(`coze-bridge: refresh failed: ${JSON.stringify(a.body)}
|
|
129
130
|
`),1)}catch(a){return process.stderr.write(`coze-bridge: refresh failed: ${String(a)}
|
|
130
|
-
`),1}}async function
|
|
131
|
+
`),1}}async function Gf(r){let e=new je(r.paths);if((await e.probe()).kind==="connected"){process.stdout.write(`coze-bridge: stopping daemon...
|
|
131
132
|
`);try{await e.request({method:"POST",path:"/shutdown"})}catch(f){process.stderr.write(`coze-bridge: stop failed (continuing): ${String(f)}
|
|
132
|
-
`)}await new Promise(f=>setTimeout(f,500))}if(!r.skipSupervisor)try{let{getSupervisor:f,buildContext:
|
|
133
|
+
`)}await new Promise(f=>setTimeout(f,500))}if(!r.skipSupervisor)try{let{getSupervisor:f,buildContext:d}=await Promise.resolve().then(()=>(Gr(),Wr)),g=f();await g.uninstall(d()),process.stdout.write(`coze-bridge: ${g.platform} supervisor unregistered
|
|
133
134
|
`)}catch(f){process.stderr.write(`coze-bridge: supervisor uninstall failed (continuing): ${String(f)}
|
|
134
|
-
`)}let a=r.paths??
|
|
135
|
+
`)}let a=r.paths??U(),{rm:x}=await import("node:fs/promises");try{await x(a.cozeRoot,{recursive:!0,force:!0}),process.stdout.write(`coze-bridge: removed ${a.cozeRoot}
|
|
135
136
|
`)}catch(f){return process.stderr.write(`coze-bridge: remove failed: ${String(f)}
|
|
136
137
|
`),1}return process.stdout.write(`coze-bridge: uninstalled
|
|
137
|
-
`),0}async function
|
|
138
|
-
`),await
|
|
138
|
+
`),0}async function Jf(){try{let{getSupervisor:r,buildContext:e}=await Promise.resolve().then(()=>(Gr(),Wr)),o=r(),a=e();return process.stdout.write(`coze-bridge: installing ${o.platform} supervisor...
|
|
139
|
+
`),await o.install(a),process.stdout.write(`coze-bridge: supervisor installed (daemon will auto-start on login)
|
|
139
140
|
`),0}catch(r){return process.stderr.write(`coze-bridge: --install-service failed: ${String(r)}
|
|
140
|
-
`),1}}async function
|
|
141
|
-
`),(await f.probe()).kind==="connected"&&(await f.request({method:"POST",path:"/shutdown"}).catch(()=>{}),await new Promise(
|
|
142
|
-
`)}let
|
|
143
|
-
`),await
|
|
144
|
-
`),1;let
|
|
145
|
-
`),0):(process.stderr.write(`coze-bridge: pair failed: ${JSON.stringify(
|
|
146
|
-
`),1)}catch(
|
|
147
|
-
`),1}}async function
|
|
141
|
+
`),1}}async function Xf(r,e,o,a={},x){let f=new je(o.paths),d=o.spawnDaemon??Lo;if(!o.skipDistInstall){let _=await Oo({paths:o.paths});_.kind==="version-changed"?(process.stdout.write(`coze-bridge: upgraded ${_.fromVersion} \u2192 ${_.toVersion}
|
|
142
|
+
`),(await f.probe()).kind==="connected"&&(await f.request({method:"POST",path:"/shutdown"}).catch(()=>{}),await new Promise(y=>setTimeout(y,500)))):_.kind==="first-install"&&process.stdout.write(`coze-bridge: installed ${_.libVersion}
|
|
143
|
+
`)}let g=await f.probe();if(g.kind!=="connected"&&(process.stdout.write(`coze-bridge: starting daemon...
|
|
144
|
+
`),await d({paths:o.paths}),g=await Vf(f,o.waitTimeoutMs??1e4,o.sleep??Yf),g.kind!=="connected"))return process.stderr.write(`coze-bridge: daemon did not come up: ${g.kind}
|
|
145
|
+
`),1;let p={privatecode:r,pairing_code:e};a.env&&(p.env=a.env),a.handshakeUrl&&(p.handshake_url=a.handshakeUrl),a.frontierUrl&&(p.frontier_url=a.frontierUrl),x&&(p.agent_id=x);try{let _=await f.request({method:"POST",path:"/pair",body:p});return _.status===200&&_.body?.ok?(process.stdout.write(`coze-bridge: paired (${_.body.note??"ok"})
|
|
146
|
+
`),0):(process.stderr.write(`coze-bridge: pair failed: ${JSON.stringify(_.body)}
|
|
147
|
+
`),1)}catch(_){return process.stderr.write(`coze-bridge: pair failed: ${String(_)}
|
|
148
|
+
`),1}}async function Vf(r,e,o){let a=Date.now()+e;for(;Date.now()<a;){let x=await r.probe(500);if(x.kind==="connected")return x;await o(200)}return r.probe(500)}function Yf(r){return new Promise(e=>setTimeout(e,r))}Ho(process.argv).then(r=>process.exit(r),r=>{process.stderr.write(`fatal: ${r instanceof Error?r.stack??r.message:String(r)}
|
|
148
149
|
`),process.exit(1)});
|