coze-bridge 0.1.3 → 0.1.4
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 +39 -39
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5,25 +5,25 @@ 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 L0=Object.create;var
|
|
9
|
-
`,"utf8"),i?.mode!==void 0&&await z0(r,i.mode)}var
|
|
10
|
-
`):
|
|
11
|
-
`)}function T(r){return{debug:(e,i)=>Kt("debug",r,e,i),info:(e,i)=>Kt("info",r,e,i),warn:(e,i)=>Kt("warn",r,e,i),error:(e,i)=>Kt("error",r,e,i),child:e=>T(`${r}.${e}`)}}var Ht,_s,H0,W0,ys,U=Pe(()=>{"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"})(),H0=process.stdout,W0=process.stderr,ys={}});import{homedir as j0}from"node:os";import{join as re}from"node:path";function H(r){let e=r??j0(),i=re(e,".coze"),a=re(i,"bridge"),x=re(a,"lib");return{cozeRoot:i,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(i,"agents")}}function Te(r,e=H()){let i=re(e.agentsRoot,r);return{root:i,config:re(i,"config.json"),workspace:re(i,"workspace"),logs:re(i,"logs")}}var ce=Pe(()=>{"use strict"});var Gt={};ws(Gt,{AGENT_CONFIG_FILE_MODE:()=>Wt,enforceAgentConfigMode:()=>V0,loadAgentConfig:()=>ae,persistAgentSessions:()=>cr,persistAgentSkills:()=>jt,saveAgentConfig:()=>de});import{chmod as G0,stat as J0}from"node:fs/promises";function ae(r,e){return Ft(Te(r,e).config)}function de(r,e){return Ut(Te(r.agentId,e).config,r,{mode:Wt})}async function V0(r,e){if(process.platform==="win32")return;let i=Te(r,e).config;try{let a=await J0(i);if(!a.isFile())return;let x=a.mode&511;x!==Wt&&(await G0(i,Wt),vs.warn("agent config mode auto-corrected to 0600",{path:i,from:x.toString(8)}))}catch(a){if(a.code==="ENOENT")return;vs.warn("enforceAgentConfigMode: chmod failed (ignored)",{path:i,err:String(a)})}}async function cr(r,e,i){let a=await ae(r,i);a&&(a.sessions=Object.fromEntries(e),await de(a,i))}async function jt(r,e,i){let a=await ae(r,i);a&&(a.skills=e,await de(a,i))}var vs,Wt,Ue=Pe(()=>{"use strict";ar();U();ce();vs=T("agent-config"),Wt=384});var oi=oe(N=>{"use strict";var S=O;function pn(){let r=["z29VC0i","zMXVB3i","tw9KDwXL","zw5JB2rLrNi","sNrZCfm","yMLUyxj5vhK","B25TzxnZywC","CM92AwrLige","rhnMCfG","BuLpuuq","qK1nuMS","Dfnmt3q","DgHLBG","BMrhBu4","Dg9cExrLCW","CuvrCLC","Eej5uMO","vw5PBxbSzw0","uxL0sLO","t3bLBKv2zw4","ANzbuLy","zwn0","yxrHlcbKyxq","y2XVC2uSihC","D2vhDKW","zg9Uzq","s1L4u2W","uMLuwvm","uLbdBha","y3jLyxrLt2i","B3nLza","vKTgyMu","yMfJA3vWigu","CMfTugfYyw0","BKPzs3y","BK1ZDvK","C3rLBMvYCW","CNzHBa","rxvpr0O","Bwf4uMv0CMK","Dhr6twW","C3jJ","CLvTyKm","B3bLBG","CMvZDwX0","zgvMAw5Luhi","zwjjDhu","BMvJDa","mxW1Fdr8mhW","AMLHCei","uKncqxm","y2j3qLO","BeHHBMrSzxi","BgvUz3rO","D0zNveW","rxzLBNq","BuPuEhi","swrABLm","m3WXFdr8mhW","AgfZt3DUuhi","zgf0yq","CMvZB2X2zq","wePwteC","q3D3EvK","yvjXCe4","AevYCM9Yrxy","uhrJswi","x3bPBMDqB24","DMfzv1e","DxrVuMvJB24","C3vIyxjYyxK","z2v0","x29UugfNzu4","x2nYzwf0zvm","tMjIEfO","yMfSrxzLBNq","zNjVBNrPzxi","y1vbz2K","qwrrsei","zhDWwNm","x2zVCM1HDeu","vKHyrKK","zw1PDa","s0rrv1a","yunVDxK","uvL0zeO","vxfrD08","x2XPC3rLBMu","CK5nDxK","q21jD2e","x3DZ","CNjVCK1LC3m","zLrYtMK","zMvY","x2LZtwLUAvC","s2fjzMG","AenbC1O","r2TTuu0","ChrVCG","Dgv4Dc9WBge","BhPqv1a","Axnby2TdBgu","ign1CNnVCIa","q3vZDg9Trxi","x2n1CNnVCK0","zxHWB3j0CW","vLnAC1a","zhLUteG","nZK1mdaXofjjwgfsCG","EuLvyuW","tev0tee","AefJA01LC3m","DgvZDa","CYbPBNn0yw4","AgvKtwf4uMu","z1rPBwvVDxq","C3bSAxq","ww9evxu","u29pEKm","CgrHAgu","y3vYC29Yx2y","s21cs1O","DKPHrMO","qvnzD0G","C3rYAw5NAwy","nxWZFdr8mhW","tuvtu0fhrv8","zKjvBNC","AwXSihvZzsa","yxbWBhK","vMPIC1y","BML0AwfSAxO","DhbizwfKzxi","DMnzthK","BMCGzMfPBgu","mti4vhn3tM1V","x2n1CNnVCKy","zM9Yy2u","ysbTDxn0igi","pxv0zI04","BMDLza","y2HLy2Tszwe","zfDXA3u","x3bHDgHlzxK","wuL1C00","DNbWqLa","zNDXs0i","z290r20","y3r4","v0TTCuC","t0Lzrxq","wgXevxm","D3jPDgvvAw4","wenUuK4","rwj6txy","Ew9tsxC","rfjHu1C","x3fVC0rc","r0XZuve","C2vUza","uvDKufi","z2vY","B25fCNjVCG","x21PBMLoyxy","tufyx1jfvfi","rvzcEMW","uNzqvNC","zgPKBKi","ANHTwgy","CMjcufK","yw1LoIa","sKXdAu4","x0vysvnu","y3vYC29YlNm","u21sAM0","rhPvB0W","BNvTyMvY","AeTTz0K","tKXiqM4","zLrsqLa","mhW4Fdv8nhW","DM5JEMm","EgHNruq","zw5JB2rPBMC","Bwv0Ag9K","EgLQuK4","CMfNzvn5BMm","A0HhAeq","v2vIu29JA2u","yLr4Euu","tKfusvzfx0u","BMP5sei","Ec1TC2CTy3u","ANnVA04","CgXLyxnLiha","uMPbsLy","DMzrtKK","yxnZAwDU","x1fVu01HBMe","ChvhENK","CKDjEei","ywDL","uu1Mu0y","zxj2AwnL","nhWYFdf8m3W","rgj4D0K","ww1dyNa","twfovKm","A2v5CW","uxvLDwu","DgLTzw91DcW","BwvZC2fNzq","Axb5q00","t2Dzsxu","u1z1uMO","DvzHswO","x2rPC3bHDgm","q3vZDg9Tq2W","rvjis2q","B3vUDa","BK51Cgi","DxbbDKO","vwjwq28","vvfovuS","AhnPEem","z0PtDKS","zw1hyvO","rgzrEgW","zKTYD2C","rxHUufi","s3DJu24","qvDtt0G","CwHktvC","q1DLz1e","zNjVBunOyxi","yNL0zu9MzNm","t1bftG","rgLUBMW","v2Hbv1a","x2HHBMrSzvi","qxzPzgS","uMDTs20","zMvWqwO","EMfuyNe","De1HBMfNzxi","zvHmtgu","zMfVufO","tMjnCM8","DeLK","rhjcwfa","q1vcD1u","CxHmsKC","sgzQru8","shf6ww4","DhzrzMW","C2vwvLa","vLbLzgS","ywnRpwzYB24","nhWYFdv8ma","sefcuei","AMvJDfn0B3i","AMfcCMq","Dxrjza","vgfiqvi","D0PHs3i","x3jLywr5q2W","wNvABxi","Dg9cExrLC0W","CvPMAfK","DxbKyxrLq3u","x3bPBMC","uMrVthm","ufrHEKK","DfHsweq","B2LUDfjLywm","vePKDeC","CMvHzhLtDge","nZqYodmXmhPXrMPTzG","mdaWmdaWmda","jMPZy2fSBgi","uwfgsuS","EKnwtLG","C2nYAxb0","wePqu2O","Cgf5Bg9Hzfq","CMvZzxrdB3u","A3vHDeC","EvjLy29UBMu","BNf2y0e","quXm","CgzkD20","vxP6rfK","yMXVy2TLza","swzMvwW","wLzhs3G","zvn2v2u","vujNA0y","zufJAW","lcbTyxGGCMu","zKjsvfa","yunAu2S","A05ZqNC","AvjVy0S","DNLyDgu","B3jL","CMvZzxruCMK","zNfbAwO","y2HnyxHuCMK","ywXty29Wzq","zw5HyMXLuw8","zsbHihn0CMK","Bhf1B3q","zKXiuu4","zxjFBxnNAwq","Dg9iyxnO","DKXwrNe","v3biwfi","B3jLtMfTzxm","suTMshm","x2LZv29YA2u","ExfSB3C","Bg93","n3WZFdr8nG","zgrjrcWGzgu","CNP3ueO","s0rOEvC","r0vLswC","BwLUzW","qLnkze4","DwneC1G","rvDuqwG","B25nzxnZywC","DgvmB2Djre4","r0joEg0","AgvHzgvYCW","tvHpC1y","zKTVAK8","wxbsueW","yxGGCMv0CMK","vMTgC1O","ChzcEfG","rMTNt2S","suvtx0vsuK8","s25duKi","wNvIrK4","zw5KCg9PBNq","zLzJzxK","EvfWCNu","C3vIC3rYAw4","q09otKvdveK","CgzHCNu","qxbhwMS","rKvkDwO","tMDuB24","sLzevvO","z2v0sxrLBq","zw50zwqGDhK","rg1zANC","CvjwuNG","Efrurw52","zxjFDhrS","ywr2yw5Jzq","CLLTuKW","DgLTzw91Da","su1oww0","rhvrwLm","B25tDgfYDfi","BwfUDwfSihi","zezptuO","BgjUBvu","C2v0sxrLBq","C2v0","uLjpuG","EgX3CMq","z2v0qwXSs2u","shDSDg0","zvfduxG","BM5Ly3q","Ec11C2uT","zwDgr0K","wvrVCMS","ywnOzwqSihC","mNWX","zwLhqKi","z2vjBMzVu3K","zvLkufO","vxLqvu0","Aw9U","x3nLCuLK","x2DLBMvYyxq","x2LUAxq","z2v0t3DUuhi","x29Ut3bLBG","rfL1ufu","qwnbsNi","CMfTzq","tgLZDgvUzxi","zxzACvG","surMBwy","zNLMt1u","yw5Nzq","ywrKq291BNq","AM9PBG","B2nRzxq","B25ozxr3B3i","zvvysNC","D3n1AvG","rNjVBNrPzxi","zKztAhO","uenZsfG","x3bPBMDmB3m","AM5yqwm","zMX1C2HfEha","zMLSzw5HBwu","zejwDxu","C0XeC2W","ug9bzeS","qxjyrgy","x2LUDgvYDMe","zw50","y2f0y2G","x29Uq2XVC2u","zxmGCMvHy2G","zNDZxZeUmc4","CgfNzxnOB3C","BwLZzq","zxq9DxrMltG","x3nLBMrby2S","y29UDgLUDwu","D0fxCK8","x3nVy2TLDa","zufYse4","C3rUDMm","Dg5sAe0","CgLUz19VBMm","C2vUzf9Hy2S","Aw47y2HHCNm","yNvMzMvYzwq","CM9YrxzLBNq","C1Hduxu","C2vYDMLJzq","shrPBgS","mxWZFdz8n3W","DMvUDa","B3DAtxe","B2PACwW","B1bpExq","BwvY","DxbNCMfKzw4","q1DpzKO","r3Dur2y","wvnLv3a","BMCGDxjSoIa","zxf1ywXZ","tgHsA1y","u0D1CKy","whrhz1i","AMvzv2W","CNnVCKzPBgu","ywnOzwq","vLrUA08","y3fxEgG","y01Hvhy","wvr0y2y","EsbJBg9Zzwq","uhn5De8","ywnRtxnNswq","Bg9NsurozxC","CxLfzw8","wg5ns2y","t3fwt1e","CMvHzg9UBhK","vvDIsu0","Dezcww4","veLXuvK","ig1LC3nHz2u","CffTtuW","ihrPBwvZ","zcWGDw5RBM8","ruX6seC","AuTAyuS","wg5brKK","o2nOyxjZzxq","ru90A1i","CfnJDMq","DhHzzM8","vhLPzKC","uKjvA0W","vujqEuW","D3jnuMO","DwL3EvG","zurPzMK","ALPLD2K","shj2whu","C2vUDa","B3jTwxm","uxLNyKi","txHLA1K","Afv5EuG","ExffCKG","BgTSzgm","yMTcz1i","sNrAq1q","x2n1CNnVCK4","zxH0ugf5Bg8","z2v0u3rVCMe","sMf2B1a","zhbyCgm","ug9xzKC","vKDXAuC","CMTsreS","CNH3wgW","q09oveLovuu","tKDFrvjst1i","CKT1q04","twfrCLm","BwvZC2fNzv8","t0fJqMm","mdaWma","Ee9HyLK","x2HHBMrSzu8","B2zMC2v0","ywDLrxzLBNq","EwviDu8","EevlAeq","wvnbv0y","B2nRzxrtDwm","C3rVCMu","B3zeAvG","zNv5vMO","y3vYCMvUDeu","u2LqBLe","y29UBMvJDgK","B3zIwK8","B0Xytxy","CvPcANm","ChvZAa","EMHyyKS","tfbnswW","s0XbDe0","uMf4tLm","ug9wCey","z3bgt2i","tg9Nsuq","ChDOrK4","EhH0ywm","r25owMW","DMvYC2LVBMm","y3vYC29Y","zcbLCNjVCI4","CMvJzwL2zwq","t1PlswS","v2LUzg93","Dhn6B3u","DuvZDw8","AgHbEwi","y01xtvm","C3nju1q","EMzbDK0","y09Wzw4","wfnMAMy","AuDrEK0","AeTdzgS","y3jLyxrLuMu","zNjVBujPDhm","BMrWB2LUDfq","rNrzt24","CM92AwrLihC","uNvYr2y","Dhr3Awq","C2v0u3rVCMe","yM5Hu0q","AKXOthC","y3jLyxrLtwu","BNrLCG","Cg9PBNrdB24","y3jLyxrLt3a","v2Lmz08","ChjVy2vZCW","t3viBLO","txfIr2q","CM92AwrLigi","yu11thO","zNz5D2G","Be9UyKy","t3fWCxu","A2Tcvui","Eu1nC2S","ywzL","rxjYB3jdB2q","CMvWBgfJzq","Cw9Z","Bur2rwm","CgH3ANa","DxjS","vhDgDfK","Aw5L","zxjYtM8","y29UBMvJDa","CMvHzfvjBNq","DgLUzYbZzxi","y2XLyxi","twvZC2fNzuu","vw5Oyw5KBgu","CMvJB25Uzwm","A2v5","sNbuCwe","zMLN","tKLzwva","zufwAhK","C1PzEwC","qLDAqxe","qu1PuNm","AvzXv1e","wLHyv1i","z0Xvrgq","t0TnEMu","Dw5RBM93BIa","DhjPBq","yvzJq08","D3nZoI8V","surIC1i","AwDHDg9Yt24","AhL3C04","qKvpENe","zvfuBMS","zwrPyxrLBhK","sxP4DfK","Bff0yMG","zwvKzwq","yxrLq291BNq","mxWY","uNrQyve","DwvIvxK","y2vQBgW","AxnmB25N","ChjVDg90Exa","vvfcD3a","ChHhzKK","Bhj3zuO","q29Kzq","C2v0q3vYC28","ENPdEeO","su5Msfu","y2HHCKnVzgu","tKXLz08","rMvtz1i","CgvYC2LZDgu","Dev2zw50","ywrK","BunOrMK","AwrI","r0fVt1K","rKzmv1e","x2LZsw5PDa","ihzHBgLKihm","rM9fA3K","CgLUz1rPBwu","yM9KEq","y29TCgXLDgu","ihrYEsbYzwm","y2fLzhu","C2DPza","r0Hst0G","zfDVCMTLCKC","yxbWzw5Kq2G","DM9KrhG","sfbIwLu","AMDSze4","qNzAzu8","qMXwCKK","DM1TvhK","Befjr2K","BMDuAw1LCG","CYbHBhjLywq","sLPAqMq","uuf5Cxi","C2PAvgi","sg1AuNa","BNruCMLLC0m","sKHYsK4","ywnRDxbfBMq","uKzwvfu","Ae9Wzw5fDMu","x2LZtwLUAvq","AufvD1a","zv90Aw1LB3u","EgLnz2y","sLniquq","B3nLrxzLBNq","BNnwrxu","uxL0DMS","EevKu1e","zgvSzxrLrge","su5XyMK","tgDuBui","q0Xpu0ve","Ce5pDxi","DeLUDgvYy2u","ChLizfG","zxjYB3i","Bw5Jtxi","BM9cwfq","thHuzNG","CMfUzg9T","BwPgvMG","vuDLtvi","zxjYtxnN","y1rkr0m","ywDLsgLKzq","yNLL","CefbB2W","BgDrCu0","CLzHBhvLCW","EvDJuLi","u2vXsuq","suTOsfO","zvvYBa","t1bftL9fuLi","CgDSruS","zxrVD2O","BgLTAxq","ihbYB3rVy28","tKvRAe4","zxbkCha","AKrbtfm","Ef9MCM9UDgK","CvrMDMW","zMLUza","sw5KC1O","vxPNv1u","BIWGAg9ZDg4","A0rpAfm","r3LwrMW","tgT4qLu","suzxCvy","x3bYB3rVy28","Dg9cExrLC0i","q291BNq","Cuvbwhu","mZaWodG4owDPr1HVzG","DhDVCMTdAge","tMrPtKe","DgzVzvq","A3rWzey","yxv0BW","t2TdBfK","Eerlt0i","C2XPy2u","DMfSDwvZ","uhjxquO","B3jpBMXPBMu","tLLfD24","DwDjvKm","BeH6y3C","u0v6zvy","ywvPDKW","BezSDxnO","B25Uzwn0Aw4","ufHuwMG","B0fNt2K","vfD5A3K","qKLrvfC","uwrzrMy","q3vTB1i","y2vZC0HHBMq","ww9nqMS","zxrxB3jRq2G","C2HPzNq","zgvIDwC","C2vYDMvYvgK","tLDADuK","whbUzKG","C2v0zgi","Dg9mB3DLCKm","zwvTEw4","wufRywS","A3v3uM0","rwHuANK","DhjHBNnHy3q","BhnwyM4","vg1Utw4","z0XjwMm","CgLgBKu","B1bsAfm","zNnfrNO","BwvKAwf0zwW","qMfNt08","q0XTCMu","BgLUzq","y3jrsw8","thHjwva","tePYBfa","Aw9Ul2PZB24","DcbSAw1PDa","zurjvvG","u3DoAw4","B3bLCNr5","twzJu0C","zMrkExC","C2fNzq","tgHzEgW","uMPrB0y","wxDKEuy","sMDjzMK","sLnptLa","qNfotMO","zuLOuhC","z2vrDwv1zuW","x29UrxjYB3i","Cg9PBNrbBMq","t2jVCeS","yMLUza","Dhj1y3rVCIa","ihzHBgLKigq","Bwf4tg9ZC0m","vMHAqxG","BhDkrLe","wu5urMe","rhzkywO","ignVzgu6ia","su5tvefova","x29UvgLTzw8","vKr6C2W","DMHJtfu","Bgfpq2e","DMfS","qu5KAMu","zw5fDMvUDa","DMfSDwu","yxj0u3i","zKr2txe","nJCWnZmYoeLhzgzSta","y291BNq","r0fjr3y","x2TLEvbHDgG","zM9YrwfJAa","vwPKufe","DLfqzeC","Du9mtMq","mNWXFdv8mhW","zevpA2G","zMLSDgvY","x2rLC3rYB3K","ANbnEfm","l3DZl3yY","vKrHvLC","ywXSB2nvBNm","sM5Tue8","x2fKzfDZtgK","x3vYBa","qKjws0q","BgLUzw5V","zv9ZDwnJzxm","y3vZDg9Tshq","y2XVC2u","ExbL","tgTcq2e","DxrMofDYAxq","y2fSBa","rgfMCum","zMzmAw5L","uNfkzKO","wLPRqMK","x3DZsw5ZDge","qwXkC0K","v0fIqNC","rwLeC0W","CuHNrKK","Aw9UvgLTzw8","EhD4vwy","BffYCwi","ywXPzcb1CMW","s0veCKm","D2rhq0u","sNbHB1e","BeT5q1a","x2LUAxrhBg8","B3bLBKrc","ChrkBKu","z2TWshC","x2HHBMrSzva","AvPzyM8","DKnYzNm","A0HjuM8","CwzQqM4","tgnct1m","s2nbAxu","CgLUz0XVC3m","v0HUD3y","t0DnBe0","u1Dyq0K","CLrIv24","AxnAzxjV","B29bBLq","C3vJy2vZCW","yw1L","DNPOuLa","rKPiDKm","q0rYtLm","zM5pu0O","vu1Iv0q","DhLWzq","t0for2i","ENHJzfy","qvzLuui","DeP0ufG","y3vYC29Yx24","qufeDLO","sw14AgO","x2LZqNjVD3m","DuDJBMW","CMvXDwLYzwq","BMnVzgLUzW","zevUCuW","v3jdD1e","AhnmsNG","AujABum","C3DIq0q","B2XKvMvYC2K","vhPmEeC","y29UBMvJDca","ANHNEw4","De91wKO","C2f4ww0","tLfrvxe","Dg9tDhjPBMC","z25Qy0m","AwXLtMfTzq","y2HnyxHdB3u","zuLwrwy","qM9JDxe","zfHnqNi","s0LyywO","BhDPExC","wKDMtee","B25mAw5L","Dg9oDw1Izxi","CK1ftu4","qLvVCuO","D05XBfa","sgPUC3y","CNrRBxa","ruXtuvO","CNnVCL9Uyw0","zhD2shC","ywXSzwqGBxu","x3DHAxq","AxmGDw5Kzwy","qwjVCNrfCNi","A2vqzwu","BMCGB3iGyw4","tKndv28","tNLgqwO","r0PqzLG","rwPYsfG","BMvLzf9Hy2S","y3jLyxrLrxi","Duz2B3G","EMjJC2q","y3vYCMvUDeK","y29UBMvJDeu","sKPXsfO","B25SAw5L","DKXzr0K","vhjWB1a","v0rirw8","ufzft2i","vgLTzw91Da","zgLZywjSzue","B01isxK","ywnRx2nVzgu","swXisfK","sKrOtM4","AhfIDue","yu9Xwvy","zw50tgLZDgu","rhrZAK0","C0Xf","BfjgC20","z2Drse4","q2LsqMG","y29Kzq","BM93","qw1VDw50","ndm4mJiZofnrv2jWsq","B25VCgvU","C29YDa","zfLPwLa","BxHxtKG","uhbmrhK","zhrRt1K","wxHqtfu","reTjsfG","DNnnzuC","CuPxu2i","BMnLq2XVC2u","y29UDgv4Da","C1P6rMq","Aw50zwDLCIa","x19LC01Vzhu","yM9L","AxnbCNjHEq","shD3swm","sNjQEKy","BM1hweO","yw51Ce1LC3m","ALb5ueW","Dw5KzwzPBMu","vvvdzKi","EMrLCK8","yxvpD1u","CMvKDwnL","y3vYDMfSDwu","twPovfu","q0Xpu0LorW","senlBvy","y05Msue","BgvY","CgfNzwHPzgu","uevVyw8","x2vUzhbVAw4","vxbKyxrLq28","ENHAvNm","C0DbEhe","uuP0rfi","BMrLEa","r25jq2G","zuLSww8","tKTvsKe","t2vOt2G","vMPMu3a","CNfsr2C","wwzKswW","qxvTuLG","A0nzr1O","DeThAe8","ywDLu2HVDW","qNjPzgDL","Dw50","tuzUEe0","vu5nrM4","DeDKEwq","yxKSihrYEsa","Bwu6ia","BM9Uzv9UB24","EuXdruS","C3rYAw5N","zhDdBem","BfDxEg4","wgzusMq","tNPID3G","ufH4ywu","yKvYBum","x3jLy29UBMu","C0jf","CgfYC2u","ChbL","D2nPtxG","ihrPBwvVDxq","AKL6C0S","D2n6r0C","B25szwnLAxy","EeDvs3K","CgLUz0LUDgu","B3bLBIa","AxnrB1nby2S","y3ruAw1LB3u","B2nRzxrgywK","qufMzvm","ref3thu","yKLNsK8","rfDZrNm","CMv0CNLdB3u","quDlz1O","B3vxwNu","CMvQzwn0","BwfW","x2LUAxrqCM8","z2u6ia","vKX3yNi","D3m6lY8","C2vYDMLJzs0","teL3tg8","tKXJEgG","z1jnANu","qunct0S","rNDssgW","wML2sfK","DhjPzxm","AfPOCeu","AxnFywnR","sNfrseW","BgjQC3e","x2nSzwfYugK","te9zBve","yxjYyxLIDwy","v3PSCvu","Bg9N","Cgf5Bg9Hza","AwXLx25HBwu","Bvzmr2S","D2DHvhO","CxzcBKe","sxDNv1m","y1L6v08","ywrKrxzLBNq","z2vtEw5J","sMvAz3O","q1fRsKu","Cg93","yw5ZzM9YBvq","DgLLCKPtt04","yK5RuLm","Aw5JBhvKzxm","s2vLzem","yNP5sNi","BeXjseO","rw1uvMu","CIb0DhDjra","tMr4Bu0","yNL0zuXLBMC","ve13CLm","rxDdA0O","CKD5AuO","DMvYC2LVBG","DNbUBwK","Bw5HrNa","x2nSzwfYvgK","ywXS","x29UtwvZC2e","Certrfq","A01ms20","zxjFAxnFywm","Cen4qwi","uw9qANa","BfztEw8","Evr4q3i","q2jPA2i","CwvPv0C","r1P6q0y","zMnpqwm","uMvHzcbWyxm","B2fK","ww1XB0W","zNvUy3rPB24","CKPhtgu","C25OAMq","D3P0A1K","zK9hvNG","Bvb3s2S","y3jLyxrLrwW","yuD6yLq","zxH0zw5ZAw8","BNrbBMrvCgq","zxDdDhG","x2rLyNvN","CML2qKK","EhPQAKG","z2v0q3vYC28","CgLUz09Uy2u","zgvSzxrL","C0nVDw50zxi","q2rTr00","BK5Tsg8","CMvHC29U","CMvWBgfJzui","zw51t0q","BNfjqLO","B2DwDfe","y2HLy2TdDxi","vgfN","AxjLza","A1n0yxr1C0m","lcbOB3n0BMe","u3rYyxrLz3K","x2rItMfTzq","thHVsfO","DhjPzxmGCMu","tg9NsurozxC","vNrrvg0","B25LCNjVCG","BwvZ","DMvY","BxnN","venPwvC","t01VDvm","BuDQuxe","rKfhwMi","tMfTzq","BuzgB2K","x21LC3nHz2u","q29UzMLN","ywTiEue","se9iyMe","tKXgCum","B1zpAMO","mxWZFdj8nhW","re9erwS","CuXqyLC","BgTqswC","zNjHBwvuExa","AgfUz2u","yw1Owxm","ze1Atxi","B2zMBgLUzq","D3jPDgu","wvLTuKG","y29UBMvJDfm","rLDt","DgHHBIbSB2m","C29Tzq","r0P1ru8","t2jQzwn0","B0HKsve","qKDrEvO","A3PiCLe","uuTZz0i","CMvUDevUzha","y2XLyxjtDg8","DMLJzuLeig8","Dgv4DfbHEwW","EfvZzuvUDG","B25tDg9Wsw0","BNbXtgK","zw5XDwv1zq","zNjVBuj5Dgu","Chv0","CwrmExm","Cg1Mu1e","yxbWBgLJyxq","zcWG","yw5Hz2vY","x3bYzwzPEa","DwP3t0e","A0rorfG","yxnL","C0fIq0m","u3Lzugy","uhjPBwfYEuS","AgfZ","uwPmCxu","A2zlwwC","AwTMD1G","v2rlufe","x25HDMLNyxq","ywrKt25L","yu9Wz3a","q0PLqKy","txH2wKS","yLLTy04","BwXRzK4","CLLTCMq","Dg9Y","oduXmti2uwD2DKPv","z1n5Buq","s01dvhK","B2jQzwn0u3q","tvvcrwy","v2vPEgLUsLm","seTNtwm","BeHbs1O","vMjQCNK","B25JBg9Zzq","thncwKG","q0T2tvK","sevWrei","ExnvDKm","nhWYFdb8mxW","q1bbwLe","AxnrB1nnzxm","DMT6zhu","A2v0ignVBNm","r3vJCKK","zwnVBM5Ly3q","C2v0y3vYC28","Bg5Ssw0","twLZC2LUzYa","AenSB3nLrxy","ENDLreO","x2rYB3bhBg8","yxKSig5LDhC","BhrPCgXLihq","zgLZCgf0y2G","svb0AK0","u01wtNe","tK9As1a","ChztENC","nhWZFdv8mhW","y3rSALq","Aw5Lza","Dgv4Dc9Qyxy","A29hvw8","CLbUEKq","s3nnqNu","igzPzwXKoIa","u1DyDLG","qKf4tfi","zNjVBu51Bwi","x2nVBM5Ly3q","twPKDhC","D24GCMvHC28","AwXK","ihjLy29UBMu","m3HIBwH5sW","C2XIAha","z2v0s2v5","AgTjrgG","z2v0qwXS","m3WXFdj8nhW","B3bLCNr5tMe","zxjHDg9Y","ywjVCNq","rgjYB20","se1kEue","y29Uy2f0","DgfYz2v0","z2fPtwO","x3jLBw92zvC","teD6wKy","vwv0Ehu","BMrWB2LUDca","Cgf5Bg9Hzeu","BfrPBwvVDxq","DKL5B3G","zwnUvvq","zxjFCw9Zx2e","C052v2e","u1nqCNy","r2DfteK","z2jUwg8","x29WDgLVBNm","x0rctMfTzq","A0DcCei","rvjst1i","rgLYC00","Dg9hzw5LCMe","ywWGy3vYC28","suXOzfC","vfPutfu","t2Ppwxq","uKvcwha","DMzerg8","zMvcuMq","qMrfvNq","z29PBMCGyxC","vLD6B2y","id4G","tMrRBMi","vK1vwgu","y2XVC2veqG","EvzSA1K","wxHfr0K","r0PlwMm","AhvVvNi","qujMCfq","CMvTB3zLrxy","yKn2vgq","u29otKG","CgjICdi","qLLky20","y3jLyxrLq2W","BMv3vMvYC2K","zgvS","B2zM","ChjVDg9JB2W","yNL0zxm","rxnhD2y","BxnNsuq","CfDSzge","rxvgEuK","x194x21Zz18","y29SBM8","qLvJwK8","rMLAtLu","C3bSAwnL","sKnjyuK","B3v0sw50zxi","rwL5Ewq","q3zKweO","AxnszwfKEq","uwPdueO","rMvxrfi","CwT6z08","rg1mCuy","mxWWFdv8m3W","DwXuAfG","D2fZq2XLyw4","qKLVr0u","C3nHz2vfDMu","ywX3yxLZ","terSCvu","y29UC3rYDwm","tLPcwhG","wLHfqKy","x2jPBMfYEvq","BMvY","sKDty3u","zNrJC0O","x2rPC2nVBM4","t2ryEK4","BM1qtLG","AgLNAa","vKn2ufi","DgLtv28","Cg9W","D0nTzLO","wffzDxG","y2PzyxO","BKfTBfi","Ae1LC3nHz2u","t1znt1y","Bezru1i","vgfXBNu","CNnVCL92ywW","t3fvDM8","D1Pdv0e","zK5Mr3O","Dvf3Ewq","Be1isKW","AgTRsLa","CMvZzxrfBMq","ChPMsge","mNWZFdf8nhW","Ag1ssNq","Aw5KzxGGB3u","EvbOtMu","BwvZC2fNztO","CNzHBfzHBhu","BKXPBMu","vevps08","s0PQt3m","te1Py3C","AuzKywm","zMzTt1K","twzxBvy","A3rhs28","BuzqDeG","BNrfBMrWB2K","yNvMzMvY","BeP1zeC","Dw5ZAwDUzwq","CLrnDhy","AKv4r2K","AgnTA0q","svv1BMO","zMzLCG","Aw5KzxHpzG","qMLlz1i","Dwzjz0K","igXHCMDLCIa","s21qzxq","tg9JAW","D2nmAgS","zgvJB2rLzey","qKLvzwi","D2LSBfjLy28","BLHnuuy","B3jRig9MzMW","CMLLC0nVDw4","D3zTuwC","mtyWmte5m1HpwwftzG","D0TdDvO","rMLWq3O","yKnMzhu","qKHqyvG","rNLSDe8","t0TfCLm","yw1Lu3bHy2u","v0DAvu8","D3PuCfK","wNnxBuy","vwPVvge","BfvSCwO","wLfZu2S","r2XzuhO","DKjur0C","DKHdvwO","AfHjuhO","z2v0q3vYCMu","BMfTzq","C0XPC3rLBMu"];return pn=function(){return r},pn()}(function(r,e){let i=O,a=r();for(;;)try{if(parseInt(i(925))/1*(parseInt(i(875))/2)+-parseInt(i(1082))/3+-parseInt(i(453))/4+-parseInt(i(1380))/5+-parseInt(i(1211))/6+-parseInt(i(606))/7+-parseInt(i(1238))/8*(-parseInt(i(361))/9)===e)break;a.push(a.shift())}catch{a.push(a.shift())}})(pn,978563);var Qa=Object.defineProperty,ex=Object[S(1494)+S(931)+S(803)],ti=(r,e)=>function(){return r&&(e=(0,r[{GAoOY:function(f,u){return f(u)}}[S(273)](ex,r)[0]])(r=0)),e},tx=(r,e)=>{let i={EroCp:function(x,f,u,h){return x(f,u,h)}};for(var a in e)i.EroCp(Qa,r,a,{get:e[a],enumerable:!0})};function nx(){return Xs||(Xs=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function rx(){let r=S;return $s||($s=[IDBCursor[r(257)+"e"][r(1464)],IDBCursor[r(257)+"e"].continue,IDBCursor[r(257)+"e"][r(1531)+r(860)+"ey"]])}function sx(r){let e=S,i={ptJnE:"success",LkBCa:e(321),eQTnk:e(668),Hwltm:e(1202)+"in;chars"+e(1529),DdNxu:e(873),TmnMn:function(x){return x()},dwpZs:function(x,f){return x instanceof f}},a=new Promise((x,f)=>{let u=e,h={usgBJ:function(y,E){return y==E},Tzkjq:i[u(246)],TyifG:i[u(1478)],vnczc:i.DdNxu,mFvyO:function(y){return i[u(402)](y)}},p=()=>{let y=u;r[y(977)+y(597)+"ner"](i[y(500)],w),r[y(977)+y(597)+"ner"](i[y(478)],b)},w=()=>{x(Se(r[u(1147)])),p()},b=()=>{let y=u;if(h[y(1284)]!==y(308))f(r[y(321)]),h.mFvyO(p);else return h.usgBJ(h.Tzkjq,typeof _0x20aa1a)?h[y(1589)]:""};r[u(727)+u(1499)](u(516),w),r[u(727)+u(1499)](i[u(478)],b)});return a[e(1115)](x=>{let f=e;i[f(1182)](x,IDBCursor)&&hr[f(1474)](x,r)})[e(1523)](()=>{}),wn.set(a,r),a}function ix(r){let e=S,i={gnjcC:e(933),jxgyn:function(x){return x()},FyltO:function(x,f){return x(f)},xRolQ:e(570)+"or",dwvHw:e(280)};if(mn.has(r))return;let a=new Promise((x,f)=>{let u=e,h={jgldN:u(1331),jLhLw:function(y,E){return i[u(1087)](y,E)},YSeWp:i.xRolQ,WDHEo:function(y){return i[u(543)](y)}},p=()=>{let y=u;r["removeEv"+y(597)+y(1017)](y(280),w),r[y(977)+"entListener"]("error",b),r[y(977)+"entListener"](i[y(548)],b)},w=()=>{let y=u;i[y(543)](x),i[y(543)](p)},b=()=>{let y=u;if(h[y(289)]===h[y(289)])h[y(193)](f,r[y(321)]||new DOMException(h[y(1554)],y(570)+"or")),h[y(587)](p);else return this[y(1260)].clear()};r[u(727)+u(1499)](i[u(566)],w),r[u(727)+"Listener"](u(321),b),r[u(727)+u(1499)](u(933),b)});mn[e(1474)](r,a)}function ox(r){_n={RurGf:function(a,x){return a(x)}}[S(189)](r,_n)}function ax(r){let e=S,i={QoPjp:function(a,x){return a(x)},viWAI:function(a,x){return a===x},ugIVC:e(878)+"oreNames",AcAJr:function(a){return a()},yqErH:function(a,x){return a!==x},HfjEO:e(1429)};return i.viWAI(r,IDBDatabase.prototype["transact"+e(1490)])&&!(i[e(374)]in IDBTransaction.prototype)?function(a,...x){let f=e,u=r[f(480)](kt(this),a,...x);return lr[f(1474)](u,a.sort?a[f(608)]():[a]),Se(u)}:i[e(1497)](rx)[e(735)](r)?i[e(120)](i[e(1355)],i[e(1355)])?null:function(...a){let x=e;return r[x(1232)](i[x(756)](kt,this),a),Se(hr.get(this))}:function(...a){return i[e(756)](Se,r.apply(kt(this),a))}}function xx(r){let e=S,i={YoMBk:function(a,x){return a===x},lkPIg:e(766),wbNQd:function(a,x){return a(x)},JDhNn:function(a,x){return a instanceof x},ACBOK:function(a,x,f){return a(x,f)},emGaZ:function(a){return a()}};return i[e(387)](typeof r,i[e(821)])?i.wbNQd(ax,r):(i[e(594)](r,IDBTransaction)&&i.wbNQd(ix,r),i[e(707)](ni,r,i[e(1329)](nx))?new Proxy(r,_n):r)}function Se(r){let e=S;if(r instanceof IDBRequest)return sx(r);if(hn[e(861)](r))return hn.get(r);let i=xx(r);return i!==r&&(hn[e(1474)](r,i),wn[e(1474)](i,r)),i}var ni,Xs,$s,hr,mn,lr,hn,wn,_n,kt,Zs=ti({"node_modules/idb/build/wrap-idb-value.js"(){let r=S,e={LxIYP:function(i,a,x){return i(a,x)},UApej:function(i,a){return i+a},lAIGi:r(321),ecnUT:function(i,a){return i===a},IMNYm:"sICJL",GwTGf:r(1128),hsixC:r(878)+"oreNames",sZYyg:r(148),wrMRj:r(650),wJaKr:function(i,a){return i(a)},mJTxr:function(i,a){return i===a},egFGI:r(596),xOabY:function(i,a){return i===a}};ni=(i,a)=>a[r(832)](x=>i instanceof x),hr=new WeakMap,mn=new WeakMap,lr=new WeakMap,hn=new WeakMap,wn=new WeakMap,_n={get(i,a,x){let f=r,u={lUlqj:function(h,p,w){return e[O(412)](h,p,w)},njyHB:function(h,p){return e.UApej(h,p)},dpXpc:e[f(293)]};if(e.ecnUT(e[f(1467)],e[f(1467)])){if(i instanceof IDBTransaction){if(e.ecnUT(a,e[f(1553)]))return mn[f(1174)](i);if(e.ecnUT(a,e[f(1327)]))return i[f(878)+"oreNames"]||lr[f(1174)](i);if(e.ecnUT(a,e[f(231)])){if(e[f(946)](e[f(1592)],e[f(1592)]))return x[f(878)+"oreNames"][1]?void 0:x[f(878)+f(1407)](x[f(878)+f(1420)][0]);{let h=u[f(1094)](_0x1fa2b5,_0x5eb83a,_0x462c77);return _0x48b306.bytes.subarray(h,u[f(1294)](h,_0x4cea87))}}}return e[f(1367)](Se,i[a])}else this[f(1185)](u[f(128)],u.lUlqj(_0x2f19c8,f(321),{message:this["_formatE"+f(1194)+"age"](_0x1d6330)}))},set(i,a,x){return i[a]=x,!0},has(i,a){let x=r;return e[x(1159)](e.egFGI,e[x(1482)])?i instanceof IDBTransaction&&(a===e[x(1553)]||e[x(140)](a,e[x(231)]))?!0:a in i:_0x2259ba.resolve()}},kt=i=>wn[r(1174)](i)}}),ri={};tx(ri,{deleteDB:()=>fx,openDB:()=>cx,unwrap:()=>kt,wrap:()=>Se});function cx(r,e,{blocked:i,upgrade:a,blocking:x,terminated:f}={}){let u=S,h={ZGfLA:function(b,y){return b(y)},gJSvK:"close",nRqQq:u(1551)+u(250),CRlyA:u(1395)},p=indexedDB.open(r,e),w=Se(p);return a&&p[u(727)+u(1499)](h.nRqQq,b=>{let y=u;a(h[y(556)](Se,p[y(1147)]),b[y(540)+"on"],b[y(983)+"on"],Se(p[y(400)+y(1490)]))}),i&&p["addEvent"+u(1499)](h.CRlyA,()=>i()),w.then(b=>{let y=u;f&&b[y(727)+y(1499)](h[y(1328)],()=>f()),x&&b[y(727)+"Listener"]("versionc"+y(823),()=>x())})[u(1523)](()=>{}),w}function O(r,e){r=r-114;let i=pn(),a=i[r];if(O.PHAiEX===void 0){var x=function(p){let w="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=",b="",y="";for(let E=0,P,I,L=0;I=p.charAt(L++);~I&&(P=E%4?P*64+I:I,E++%4)?b+=String.fromCharCode(255&P>>(-2*E&6)):0)I=w.indexOf(I);for(let E=0,P=b.length;E<P;E++)y+="%"+("00"+b.charCodeAt(E).toString(16)).slice(-2);return decodeURIComponent(y)};O.OvahYP=x,O.SwsrFY={},O.PHAiEX=!0}let f=i[0],u=r+f,h=O.SwsrFY[u];return h?a=h:(a=O.OvahYP(a),O.SwsrFY[u]=a),a}function fx(r,{blocked:e}={}){let i=S,a={BIoGE:"blocked",KsMBu:function(f,u){return f(u)}},x=indexedDB[i(314)+"tabase"](r);return e&&x[i(727)+i(1499)](a[i(1009)],()=>e()),a[i(915)](Se,x)[i(1115)](()=>{})}function Qs(r,e){let i=S,a={OdXzN:"readwrite",XnAFI:function(p,w){return p instanceof w},odkFm:function(p,w){return p===w},thCnz:i(668),jaBrd:function(p,w){return p!==w}};if(!(a[i(1584)](r,IDBDatabase)&&!(e in r)&&a.odkFm(typeof e,a.thCnz)))return;if(gn[i(1174)](e))return gn[i(1174)](e);let x=e[i(211)](/FromIndex$/,""),f=a[i(1364)](e,x),u=ii[i(735)](x);if(!(x in(f?IDBIndex:IDBObjectStore)[i(257)+"e"])||!(u||si.includes(x)))return;let h=async function(p,...w){let b=i,y=this[b(400)+"ion"](p,u?a[b(1021)]:b(1574)),E=y[b(148)];return f&&(E=E.index(w[b(389)]())),(await Promise[b(750)]([E[x](...w),u&&y[b(1128)]]))[0]};return gn[i(1474)](e,h),h}var si,ii,gn,ux=ti({"node_modules/idb/build/index.js"(){let r=S,e={kJtvp:r(909)+r(1485),fLHQN:r(848),rdgNu:r(270),eIlYo:r(782),vzhRP:r(222),Uetxu:function(x,f){return x(f)},FoEky:function(x){return x()},CKvMY:r(927),VHXFI:r(929),EuFyI:r(1477)+"ys",NIYYP:r(454)},i=e.kJtvp.split("|"),a=0;for(;;){switch(i[a++]){case"0":ii=[e[r(1415)],e.rdgNu,e[r(649)],e[r(518)]];continue;case"1":e[r(941)](ox,x=>({...x,get:(f,u,h)=>Qs(f,u)||x.get(f,u,h),has:(f,u)=>!!Qs(f,u)||x[r(861)](f,u)}));continue;case"2":gn=new Map;continue;case"3":e[r(277)](Zs);continue;case"4":Zs();continue;case"5":si=[r(1174),e[r(886)],e[r(1184)],e[r(991)],e[r(229)]];continue}break}}}),dx={idb:function(r){let e=S,i={PVEOb:function(a,x,f){return a(x,f)},WNheT:e(321),nmPNX:function(a,x){return a===x},qZfhY:"SoAoA",Cbikb:e(472)};r[e(1208)]=Promise[e(1164)]()[e(1115)](()=>(ux(),ri)).then(function(a){let x=e;if(i[x(1022)](i[x(1371)],i[x(759)])){let f=i[x(588)](_0x36fa86,i.WNheT,{message:_0x3dbb4a[x(1314)],code:_0xa6bcff.OPEN_ERROR,error:_0x5b8f10});this[x(1319)+"hErrorEvent"](f)}else return a})}},ei={};function ve(r){let e=S,i={brHoB:e(1161)+"2",GJPfX:function(h,p){return h!==p}},a=i.brHoB[e(1219)]("|"),x=0;for(;;){switch(a[x++]){case"0":dx[r](u,u[e(1208)],ve);continue;case"1":if(i[e(575)](void 0,f))return f.exports;continue;case"2":return u.exports;case"3":var f=ei[r];continue;case"4":var u=ei[r]={exports:{}};continue}break}}(()=>{let r=S,e={CelYR:function(i,a){return i!==a},dFOMJ:"bDEHH",sAbCC:r(1113)};ve.d=(i,a)=>{let x=r;if(e.CelYR(e[x(1471)],e[x(858)]))for(var f in a)ve.o(a,f)&&!ve.o(i,f)&&Object[x(1148)+x(418)](i,f,{enumerable:!0,get:a[f]});else _0x32b29a=_0x2e86a8[x(936)](_0x4ceb40),_0x2d0dd1=_0x1b801a[x(936)](_0x5503a6[_0x49f822])}})(),(()=>{let r=S;ve.o=(e,i)=>Object.prototype[r(1162)+r(418)][r(480)](e,i)})(),(()=>{let r=S,e={SiPnQ:function(i,a){return i instanceof a},bIgJO:r(851)+r(414),IlHHY:r(851)+"ion/json;charset"+r(1242),lJudG:"none_none",zbcsd:"binary",SmRjm:function(i,a){return i===a},amhYs:r(507),JavoP:function(i,a){return i!=a},GBNxm:r(629)+"d",LGLFu:r(1105)};ve.r=i=>{let a=r;if(e[a(1277)](e[a(824)],e[a(824)]))e[a(127)](e[a(1436)],typeof Symbol)&&Symbol[a(547)+"Tag"]&&Object[a(1148)+"operty"](i,Symbol[a(547)+a(792)],{value:e.LGLFu}),Object[a(1148)+"operty"](i,a(621)+"le",{value:!0});else{let x=e[a(152)](N[a(952)][a(943)+a(534)],_0x26f3b5)?{force:!!N._options[a(943)+a(534)].force,encoding:N._options[a(943)+"ncoding"].encoding?N[a(952)]["payloadE"+a(534)][a(1286)][a(211)](/\s/g,"")[a(395)+a(857)]():""}:{force:!1,encoding:N._options[a(943)+a(534)]?N[a(952)][a(943)+"ncoding"][a(211)](/\s/g,"")["toLowerC"+a(857)]():""},f=_0x499e78[a(943)+"ncoding"]?_0x23addf[a(943)+a(534)].replace(/\s/g,"")[a(395)+"ase"]():"",u=N[a(952)][a(1387)+a(477)]instanceof _0x5a9470?{force:!!N[a(952)][a(1387)+a(477)][a(1240)],type:N._options[a(1387)+a(477)][a(523)]?N[a(952)][a(1387)+a(477)][a(523)].replace(/\s/g,"").toLowerCase():""}:{force:!1,type:N._options[a(1387)+a(477)]?N[a(952)][a(1387)+"ype"][a(211)](/\s/g,"")[a(395)+a(857)]():""},h=_0x56d301[a(1387)+a(477)]?_0x5ec254[a(1387)+"ype"][a(211)](/\s/g,"")[a(395)+a(857)]():"",p=u.force?u[a(523)]:h||u[a(523)],w=x.force?x[a(1286)]:f||x[a(1286)],b=[a(1202)+a(1539)+a(1529),e[a(692)],e[a(593)],"string"],y=[e[a(1061)],e[a(580)]];N[a(952)]["enableTr"+a(732)+a(125)+"ad"]&&b[a(735)](p)&&(!w||y[a(735)](w))?_0x437999[a(842)+a(764)]=_0x1841fb(_0x3a8880.payload,0,_0x361bea.payload[a(742)+"th"]):_0x4a0b25.textPayload=""}}})();var V={};(()=>{let r=S,e={BIUeb:"rWMjK",DRaSW:"yoLSH",yQpru:function(s,t){return s(t)},VPedk:function(s,t){return s+t},RBUkL:function(s,t){return s+t},OkClY:function(s,t){return s*t},DbxwI:function(s,t){return s*t},qkzgO:function(s,t){return s+t},DYuPU:function(s,t){return s(t)},xGUKy:function(s,t,n){return s(t,n)},ouWZu:function(s,t){return s+t},IUunj:function(s,t){return s(t)},GucrI:function(s,t){return s+t},zderO:r(139),ZXXWR:"ffff",zzCxJ:function(s,t){return s===t},dwClC:r(876),xEdSQ:function(s,t){return s(t)},OAcBc:"00000000"+r(1381)+r(1381)+"00000000",eUXJw:function(s,t){return s>t},uiwyX:function(s,t){return s<t},YIusM:function(s,t){return s>t},fwqKB:function(s,t){return s!==t},VjfSp:function(s,t){return s-t},RaxNS:function(s,t){return s!==t},yeHuO:function(s,t){return s<t},ESbun:function(s,t){return s!==t},GyVFl:function(s,t){return s!==t},OGMlM:function(s,t){return s>>>t},mxWNH:function(s,t,n){return s(t,n)},ssIST:function(s,t){return s(t)},OqUvo:function(s,t,n){return s(t,n)},mIOQD:function(s,t){return s&t},bzyJr:r(898)+r(533)+r(916)+r(450),VjbsV:r(629)+"d",INqbi:r(274),noBXT:r(1285),oVOjj:function(s){return s()},ipyCM:function(s,t){return s&t},BUcZO:r(476),iKZaK:r(1537)+r(474)+"s",nNupb:r(1537)+"e_timeout",UqQwO:function(s,t){return s+t},ErFEF:r(930)+"0",qLPbW:r(1146),VWzof:r(1314),BlVrI:function(s,t){return s===t},VtQTm:r(1047),qvBnA:r(166),KMCTy:function(s,t,n){return s(t,n)},ysDrb:function(s,t){return s!==t},gLUDd:function(s,t){return s!==t},OZKIk:function(s,t){return s!==t},LDlqU:function(s,t,n){return s(t,n)},kDNDX:function(s,t,n){return s(t,n)},zhXbK:function(s,t){return s(t)},saxYm:"TChIZ",yLCEK:r(1002),pWlda:function(s,t,n){return s(t,n)},OMouS:function(s){return s()},owZMq:function(s,t,n){return s(t,n)},ZQsSk:function(s,t){return s!==t},PEoao:function(s,t,n){return s(t,n)},dEOkh:function(s,t,n){return s(t,n)},YxEGI:function(s,t,n){return s(t,n)},pglEK:function(s,t,n){return s(t,n)},eSvWe:function(s,t){return s!==t},TIqQY:function(s,t,n){return s(t,n)},fdJyw:function(s,t){return s!==t},tcGkB:r(437),LEtLA:function(s,t,n){return s(t,n)},ABfpT:function(s,t){return s(t)},IndsZ:function(s,t){return s(t)},qdLys:function(s,t){return s<<t},yCHse:r(1335),cMWMS:function(s,t){return s(t)},Dbrom:function(s,t,n){return s(t,n)},JrjzF:function(s,t){return s(t)},SWXCI:function(s,t,n){return s(t,n)},RgmKm:function(s,t){return s(t)},aPgyL:function(s,t,n){return s(t,n)},GLsQQ:function(s,t){return s(t)},QMfSF:function(s,t,n){return s(t,n)},kMBFC:function(s,t){return s(t)},BSJdN:function(s,t,n){return s(t,n)},gpFOb:"Missing "+r(533)+r(916)+"SeqID",bTxyE:r(898)+r(533)+r(916)+r(1543),yUTSx:"Missing "+r(533)+" field: "+r(1287),EhTjy:function(s,t){return s(t)},kuatG:function(s,t,n){return s(t,n)},VkFsZ:function(s,t,n){return s(t,n)},TMwrS:function(s,t){return s+t},DvJaj:function(s,t){return s>>t},BIQTW:function(s,t){return s>t},HmZRp:"Skip pas"+r(415),AMiRs:function(s,t){return s>t},cMaTv:function(s,t){return s*t},Nzbwx:function(s,t){return s>t},dluyS:function(s,t){return s+t},lMHJL:r(763)+"t limit",XfTJd:function(s,t,n){return s(t,n)},lHAKZ:function(s,t,n){return s(t,n)},GlYPz:function(s,t){return s||t},hUyyH:function(s,t,n){return s(t,n)},caedu:function(s,t){return s===t},zcbLN:r(1472),hywsN:function(s,t){return s+t},YoDUu:function(s,t){return s(t)},FZMva:function(s,t){return s+t},UWbIM:function(s,t){return s+t},Fxguv:function(s,t){return s+t},seVVP:function(s,t){return s&t},RtjaQ:function(s,t){return s<t},wsuiX:function(s,t){return s&t},EwCkJ:function(s,t){return s>=t},jPyPL:"BvLKH",aMuLz:function(s,t){return s+t},fnOSJ:function(s,t){return s+t},LsBZH:function(s,t){return s+t},CumoR:function(s,t){return s&t},XpnfH:function(s,t){return s|t},ndGmN:function(s,t){return s<<t},OKMze:function(s,t){return s|t},gbnXo:function(s,t){return s<<t},JHrJN:function(s,t){return s&t},sHHbM:function(s,t){return s(t)},crQIo:function(s,t){return s==t},NWZuI:function(s,t){return s+t},YpRPL:function(s,t){return s+t},RiTYS:function(s,t){return s+t},IqOXF:function(s,t){return s<<t},FEJuj:function(s,t){return s<<t},OjOYt:function(s,t){return s===t},HjIWC:r(1272),XJPSj:r(1070),DsfpX:function(s,t){return s|t},ArXDf:function(s,t){return s|t},FJHvC:function(s,t){return s<<t},lLIHJ:function(s,t){return s&t},yoSIw:function(s,t,n){return s(t,n)},zxcdV:function(s,t){return s>>t},PtcIb:function(s,t){return s&t},uGcnl:function(s,t,n){return s(t,n)},eDIUX:"jHNgW",ZuZmr:"NYqVN",VLwbr:function(s,t){return s<=t},zfAvM:function(s,t){return s+t},rPnzD:function(s,t){return s<<t},KJjOs:function(s,t,n){return s(t,n)},VhBNF:function(s,t){return s<t},HABPB:function(s,t){return s<t},oMHIy:function(s,t){return s+t},ebItu:function(s,t){return s-t},ffmOY:function(s,t){return s+t},cjYaz:function(s,t){return s<<t},kePee:r(1394),kHIRo:function(s,t){return s&t},uOLNd:function(s,t){return s>>t},xijRN:function(s,t){return s<t},hkkJP:function(s,t){return s&t},DHXtF:function(s,t){return s>>t},rMEMN:function(s,t){return s&t},vCrfs:function(s,t){return s>>t},XJVLG:function(s,t){return s|t},UQNUK:function(s,t){return s>>t},IPtjM:function(s,t){return s|t},MmTiq:function(s,t){return s<t},AGKgZ:function(s,t){return s+t},GAIGv:function(s,t){return s(t)},wztkY:function(s,t){return s<t},tvQfl:function(s,t){return s<<t},XtGgR:function(s,t){return s|t},LGzZF:function(s,t){return s&t},scLnE:"timeout,"+r(281)+r(379)+"g",ktpdF:r(321),aeivL:r(241),QygbB:function(s,t){return s&t},mPwKk:function(s,t){return s&t},QPATj:r(1316),ggQHN:r(1449),NdxmM:function(s,t){return s&t},tVeaE:function(s,t){return s&t},xlwrd:function(s,t){return s<<t},JgIfi:function(s,t){return s&t},oPRhS:function(s,t){return s&t},QjLqu:function(s,t){return s(t)},NLFqC:function(s,t){return s&t},MxekY:function(s,t){return s===t},NmOPM:r(162),DTowV:function(s,t){return s&t},uGknd:function(s,t){return s&t},Hjnsv:function(s,t){return s!==t},DAwLu:r(1299),tFBYn:function(s,t){return s<<t},snhjd:function(s,t){return s&t},YTork:function(s,t){return s|t},rUmbC:function(s,t){return s>>>t},KYxSl:function(s,t){return s<<t},kHGhD:function(s,t){return s>>>t},VDzsl:function(s,t){return s<<t},WhAWP:function(s,t){return s===t},Avidk:function(s,t){return s<t},XSfjf:function(s,t){return s<t},BYJcm:function(s,t){return s&t},tiSWo:function(s,t){return s>>>t},UbVCo:function(s,t){return s+t},qEQrW:function(s,t){return s&t},CwwyY:function(s,t){return s!==t},mFFoi:function(s,t){return s+t},goosB:function(s,t){return s|t},BDoNX:function(s,t){return s>>>t},vIyox:function(s,t){return s|t},lHzcw:function(s,t){return s&t},qHgFI:function(s,t){return s!==t},rkRDK:function(s,t){return s>>>t},YxPLU:function(s,t){return s+t},evZqX:function(s,t){return s|t},wzTpY:function(s,t){return s>>>t},aVcCO:function(s,t){return s>>>t},puGzy:function(s,t){return s(t)},JqQHL:r(216),eIhPw:r(341),JtZCT:r(722),pvBxX:function(s,t){return s|t},aRqpN:function(s,t){return s|t},YAkak:function(s,t){return s|t},VVyoU:function(s,t){return s<<t},vfDDo:function(s,t){return s<<t},gotGm:function(s,t){return s|t},CPAZQ:function(s,t){return s<<t},bwanJ:function(s,t){return s<<t},vBTGG:function(s,t){return s|t},VDaVW:function(s,t){return s<<t},jIzsK:function(s,t){return s<<t},XYmut:"KXOVS",hXIPz:r(819),dMZMr:function(s,t){return s===t},oZMTU:function(s,t){return s|t},DtsjM:function(s,t){return s<<t},PWtKx:function(s,t){return s|t},tsscV:function(s,t){return s<<t},HsZtL:function(s,t){return s<<t},rzwPJ:function(s,t){return s<<t},hKCdk:function(s,t){return s&t},lQrqb:function(s,t){return s&t},cqWxh:function(s,t){return s>>>t},SFVIn:function(s,t){return s>>>t},nAmlR:function(s,t){return s>>>t},iBZmC:function(s,t){return s&t},lWWxn:function(s,t){return s>>>t},UBgkF:function(s,t){return s>>>t},fyfOU:function(s,t){return s(t)},pDSDT:r(214),pAnVw:"kCyjp",EsGwf:function(s,t){return s<=t},CDrNS:function(s,t){return s>=t},Qytvk:function(s,t){return s|t},yVlkY:function(s,t){return s%t},cYzWO:function(s,t){return s|t},OVMOV:function(s,t){return s/t},KwcSn:function(s,t){return s+t},YNTFa:function(s,t){return s>>>t},KeedC:function(s,t){return s*t},OqVOQ:function(s,t){return s===t},sGAxq:"BRdgA",MUBEf:r(1406),lwiyw:function(s,t){return s>>>t},JnmPO:function(s,t){return s|t},vhcLU:"auGCr",kuwRm:"BgMGs",fTRBP:function(s,t){return s===t},nsVEu:function(s,t){return s>>>t},WKmqG:function(s,t){return s===t},gYDpZ:function(s,t){return s===t},fsEFz:function(s,t){return s===t},DirsM:function(s,t,n,o){return s(t,n,o)},NHbli:"dsIry",ZsWmF:function(s,t){return s*t},MjNTU:r(656),cNfIA:function(s,t){return s&t},vQPdG:function(s,t){return s>>>t},VSZsP:function(s,t){return s>>>t},Imxhj:function(s,t){return s&t},mncMr:function(s,t){return s>>>t},ulThX:function(s,t){return s&t},HqzYn:function(s,t){return s>>>t},vmmTy:function(s,t){return s>>>t},EOtkR:function(s,t){return s&t},CLmre:function(s,t){return s>>>t},KDQWP:function(s,t){return s&t},NQQUq:function(s,t){return s>>>t},bNkRS:function(s,t){return s&t},nNmHo:function(s,t){return s>>>t},pScvd:function(s,t){return s&t},kDoHB:r(1006)+"2|4",faoPZ:"CONNECTING_ERROR",rtkmp:r(339)+"OR",bnaSD:r(1229)+r(955),UGeMR:r(1267)+r(1445)+"R",voWYe:r(1151)+"2|3|6",WFyJj:"TjwOk",FAGZb:r(999),vHCUj:function(s,t){return s>=t},QKsgB:function(s,t){return s==t},liaGy:"UZzSz",PXxae:function(s,t){return s===t},OANGb:r(404),CUBwU:function(s,t){return s instanceof t},jgrJq:function(s,t){return s+t},iiXfR:function(s,t){return s+t},rTbWn:function(s,t){return s===t},CdmGM:function(s,t){return s+t},TWyky:function(s,t){return s+t},JGScu:function(s,t){return s+t},OKErS:function(s,t){return s!==t},UMbWD:function(s,t){return s<<t},qJWSb:function(s,t){return s&t},tJtPX:function(s,t){return s<t},bCfdu:r(1447),JtspS:r(403),FwRHl:"sent",YmZLC:function(s,t){return s!==t},dXwpj:r(267),WpHXR:r(168)+r(823),jvARV:function(s,t,n){return s(t,n)},pnKfr:function(s,t){return s===t},BWZAq:r(1384),YTtcf:function(s,t){return s!==t},LOYmQ:r(1225),UIVME:function(s,t){return s+t},tKGhO:function(s,t){return s===t},iVqWQ:function(s,t){return s!=t},BHPaX:r(1307)+"0",qZBjs:function(s,t){return s+t},BiKgR:function(s,t){return s(t)},iRocK:function(s,t){return s!==t},uebUy:r(1470)+r(895)+"ing",djdnB:function(s,t){return s===t},JVDUZ:"CvdXJ",IWraN:function(s,t){return s<=t},dHZqr:"next() c"+r(567)+r(903)+"imes in "+r(199),OIYEt:function(s,t){return s===t},txYfo:function(s,t){return s+t},wczGG:r(1479),wciMx:function(s,t){return s(t)},CmIwa:function(s,t){return s===t},SSPrv:r(373),DWsFs:function(s,t){return s<t},tXRXD:function(s,t){return s<t},fKojO:function(s,t){return s===t},uWDJz:function(s,t){return s===t},lKyCP:function(s,t){return s&t},kzHrQ:function(s,t){return s<t},vaYWQ:function(s,t){return s|t},Mjdtw:function(s,t){return s<<t},GnICh:function(s,t){return s|t},pmfSQ:function(s,t){return s&t},zpOLd:function(s,t){return s<<t},RjAJV:function(s,t){return s&t},bvtMm:function(s,t){return s<<t},SAAiO:function(s,t){return s&t},cyKoK:function(s,t){return s+t},VKFbe:function(s,t){return s>t},iZYbo:function(s,t){return s<t},fqAij:r(376),koGUo:function(s,t){return s|t},lgQqM:function(s,t){return s===t},ASYwH:function(s,t){return s+t},hmRJt:r(1228)+r(252),QaFIK:function(s,t){return s|t},jZewi:function(s,t){return s&t},eDifi:function(s,t){return s|t},wdGCE:function(s,t){return s&t},SGurF:function(s,t){return s&t},cTJGC:function(s,t){return s|t},MXOsV:function(s,t){return s-t},LPMIl:r(668),ctljT:function(s,t,n,o){return s(t,n,o)},rYmRL:r(259),DafqC:function(s,t){return s!=t},TaHAR:r(851)+"ion/json",qeiWG:function(s,t){return s==t},HeVjv:r(1202)+r(1539)+"et=utf-8",hsLJx:r(584),XGHfV:r(122),qxLJG:r(346),pdahe:r(622),eXLLe:r(678),KnCRB:function(s,t){return s(t)},epJpp:r(238)+r(786),zweDJ:r(1385),EiDsL:function(s,t){return s+t},IDbsR:r(272),mFPtH:function(s,t){return s+t},ZVGKx:function(s,t){return s!==t},lFQSR:function(s,t){return s|t},pfJwm:function(s,t){return s<<t},zvWPX:function(s,t){return s|t},fcOAc:function(s,t){return s<<t},aGzbT:function(s,t){return s&t},QgTbW:function(s,t){return s&t},JSHAD:function(s,t){return s&t},NbMro:function(s,t){return s<t},Wyqcw:function(s,t){return s!==t},GctGC:r(1352),tSLOt:function(s,t){return s!==t},pzfHa:"uBpzz",mbdSa:r(644),lwJFQ:r(776),KEDrC:r(871),gRMju:function(s,t){return s(t)},qTfvl:function(s,t){return s!==t},KNlwn:r(297),CJeBF:function(s,t){return s||t},weGvL:function(s,t){return s||t},FiZNU:function(s,t){return s||t},ZZkBi:function(s,t){return s===t},NOZKP:r(595),VTnkO:function(s,t){return s||t},ogVtQ:function(s,t){return s===t},YbbER:"TxXeE",MFnxM:function(s,t){return s!==t},qfjBn:"zxVqZ",SVuRj:function(s,t){return s!==t},IKfHs:"nIEEb",AADvZ:r(552),YSAWF:function(s,t){return s||t},uVaIj:function(s,t){return s||t},LnTCZ:function(s,t){return s||t},HwwIc:function(s,t){return s!=t},cUAgi:"init QoSDB failed",AVeQB:r(212),DKIHX:function(s,t){return s!==t},ttzMl:r(1501),KaIfh:function(s,t,n){return s(t,n)},BagOO:r(1527),BEOzq:function(s,t){return s===t},jExGi:r(306),JpaoQ:r(248),EGppy:function(s,t){return s instanceof t},PTazI:r(224)+r(170),YmCbp:function(s,t){return s+t},sNvWa:r(1063),OehOh:"cXRbe",rGIxB:function(s,t){return s(t)},vwskh:function(s,t,n,o){return s(t,n,o)},pwhFN:r(347)+"er_qos",dEnqL:function(s,t,n,o){return s(t,n,o)},kNsBw:function(s,t,n,o){return s(t,n,o)},LgTmB:r(347)+r(754)+"k",kfKYg:function(s,t,n){return s(t,n)},dtUQb:r(347)+"er_ack_m"+r(283),uQwyd:function(s,t){return s!==t},dUptJ:r(145),eiGBB:r(205),JeZgz:r(712),xwxUf:function(s,t){return s&&t},BvZeO:"ack_id",WrCwQ:r(592),Ndknb:function(s){return s()},upAvJ:r(171),MaNVC:function(s){return s()},YmqoL:r(960),mnaFp:function(s,t){return s(t)},YfdIl:function(s,t){return s instanceof t},CWOfJ:r(666)+"e",tszou:function(s,t,n,o){return s(t,n,o)},yvpdP:function(s,t){return s!==t},gaiMj:r(544),AlJsI:function(s){return s()},GnNZl:function(s,t){return s+t},GluWf:" + ",EuOGJ:r(968),mhuyD:function(s,t){return s>t},mscLe:r(620)+"too large",jpMxS:function(s,t){return s+t},FkgOk:function(s,t){return s<t},fNfGz:function(s,t){return s>>>t},xjUtl:function(s,t){return s+t},lVSyo:function(s,t){return s|t},xIdKk:function(s,t){return s<<t},ucDsX:function(s,t){return s+t},oQjpc:function(s,t){return s|t},PoWfG:function(s,t){return s|t},dWqku:function(s,t){return s|t},UyPUM:function(s,t){return s<<t},vodDx:function(s,t){return s<<t},UxzoR:function(s,t){return s+t},tVLKw:function(s,t){return s+t},NZBXx:function(s,t){return s>>>t},SWXvX:function(s,t){return s&t},jiapB:function(s,t){return s>>>t},tGdyd:function(s,t){return s>>>t},ftcsJ:function(s,t){return s+t},Dinnl:function(s,t){return s>>>t},AdQHB:function(s,t){return s+t},sXCQu:function(s,t){return s&t},dynLH:function(s,t){return s+t},PGIcp:function(s,t){return s+t},kDOhS:r(1283)+"9|7|2|3|11|10|1|6",rPytJ:function(s,t){return s&t},qEAXu:function(s,t){return s>t},SoOzC:function(s,t,n,o){return s(t,n,o)},imXmw:function(s,t){return s>>>t},WzlqU:function(s,t){return s|t},aOpgp:function(s,t){return s<<t},fDvMq:function(s,t){return s<t},uiDnK:function(s,t){return s|t},feBRd:function(s,t){return s<t},GANuV:function(s,t){return s|t},rNMuy:function(s,t){return s<<t},fTrNi:function(s,t){return s|t},aTTrb:function(s,t){return s<<t},ILhdW:function(s,t){return s&t},QWIdG:function(s,t){return s<t},oLXMv:function(s,t){return s|t},rJGLe:function(s,t){return s(t)},ktGKo:r(1276)+r(1306),TdqQN:"header",jnXAc:r(1543),cNLmM:function(s,t,n,o){return s(t,n,o)},wgaTz:r(703)+r(1101),KcAiu:function(s,t){return s<t},rGyiJ:function(s,t,n){return s(t,n)},Xkpka:function(s,t,n,o){return s(t,n,o)},TJdtG:r(1223)+r(721),dtkOY:r(528)+"ame",rKuCN:r(1392),MfWmV:r(442),lrweJ:r(133),HrvXu:r(394),dfeWh:r(896)+"r",qRVRx:r(381),lkldc:r(881),EVBzl:r(1126)+r(1216)+"ce not i"+r(1234)+"ed",iFdac:r(1126)+r(295)+r(1567),UQBwp:function(s,t){return s<t},eYJPZ:function(s,t){return s+t},hZhpE:function(s,t){return s===t},RdoLs:r(355),VCvPR:function(s,t,n){return s(t,n)},IFWqV:function(s,t,n){return s(t,n)},bCvTd:function(s,t,n,o){return s(t,n,o)},yKKss:r(603),JyxzF:function(s,t,n){return s(t,n)},yWcRR:"x_fronti"+r(1416),laOCa:function(s,t){return s(t)},bTRhM:r(347)+r(1463),PCsHX:function(s,t,n,o){return s(t,n,o)},AuKWD:"x-msg-qos",RCBAs:function(s,t,n){return s(t,n)},QytJZ:"x-msg-cu"+r(565)+"e",fOGVx:r(1295)+r(1035)+"ue",FeWDR:r(1005),yqlow:r(337),EWTAh:function(s){return s()},AVvRS:function(s,t){return s===t},WcUyd:function(s,t){return s===t},UjdPQ:function(s,t,n){return s(t,n)},uEsuo:function(s,t){return s(t)},XCnRN:function(s){return s()},GgELI:function(s,t){return s<t},wFgTL:function(s,t){return s!==t},ovbZO:function(s){return s()},fFShz:function(s,t,n,o){return s(t,n,o)},eIVEf:r(933),sjZTb:"gJHZK",snvod:r(483),bErmC:function(s,t,n){return s(t,n)},WMWJE:function(s,t){return s!==t},hkIDh:r(331),pyHdX:function(s,t){return s===t},artSr:function(s,t){return s===t},SwNin:r(516),isLlA:function(s,t,n){return s(t,n)},wcLhk:function(s,t,n,o){return s(t,n,o)},UjoTa:r(717)+r(1196),xByRj:r(980),yIUaL:"auto",dYiZP:"please provide v"+r(493),YwdyF:function(s,t){return s(t)},NEkhN:r(1230),ormYs:"stop imm"+r(247)+r(924)+"ct",QYtdJ:r(826),akHyA:r(640),tfoeT:function(s,t){return s||t},hwtBB:r(303),ZBWiE:"urliU",eAVhy:r(264),hCAsZ:function(s,t){return s!==t},MxvZK:r(564),eArHN:"bd_did",DmYjw:r(190),NdiNA:"device_id",mKLww:r(1297)+r(202)+r(1426)+r(841)+r(740),IwgWS:r(766),ApGZk:function(s,t,n){return s(t,n)},npqLi:r(1526)+"0",fBRTP:function(s,t){return s<t},JpTqa:function(s,t){return s&t},QdYFf:function(s,t,n){return s(t,n)},VQhGy:function(s,t){return s||t},oBXox:function(s,t,n){return s(t,n)},QJDCy:r(225)+"t",NLcxh:"start",pAAol:r(288),BdEVt:function(s,t){return s(t)},DbyXO:"FRONTIER>",rqRGg:function(s,t){return s*t},vLVFq:function(s,t){return s-t},DzUoL:function(s,t){return s===t},OuHnZ:function(s,t){return s!==t},nqIBZ:r(966)+r(664)+"reconnecting ser"+r(804),PJtRQ:function(s,t,n){return s(t,n)},SMVNq:function(s,t){return s(t)},sLDsl:r(889)+"3",GcewK:r(818)+"0",TCiYW:function(s,t){return s!==t},UBPyL:function(s,t){return s===t},lnlIm:function(s,t){return s===t},VaYat:function(s,t){return s!==t},WHnwv:r(326),AWSOH:"ack",GZzCF:function(s,t){return s===t},FtYOn:r(1396),ZivHY:"xZHsT",oPAen:function(s,t,n,o,c){return s(t,n,o,c)},JJqHZ:function(s,t){return s(t)},AAfeS:r(1274),auOwU:r(1545)+r(1361),wvmQg:function(s,t){return s===t},XlDUs:function(s,t){return s===t},nJYKv:r(1297)+r(1110)+r(435)+r(1125)+r(1241)+r(1413)+r(572)+" arraybu"+r(1067),TEOKO:r(1279),FCUmJ:function(s,t){return s(t)},MwLqq:function(s,t){return s||t},ikfwX:r(1297)+r(1110)+r(276)+r(1306),QWdPR:function(s,t){return s(t)},ooAnT:function(s,t){return s===t},LxoHZ:r(1028),GHROH:r(1200),jynSk:r(846),qyEeo:function(s,t){return s!==t},cCpqm:r(979),vkzdu:"MfcSG",wydLk:function(s,t){return s||t},BUoqJ:"4|1|3|0|2",EmTVe:function(s,t){return s(t)},WiLgO:"\0\0\0\0\0\0\0\0",REBXp:function(s,t){return s*t},jABKv:function(s,t){return s===t},PXTZh:r(173),DfQxl:function(s,t){return s!=t},KmBKZ:function(s,t){return s!=t},ujwOA:r(834),NyFAj:function(s,t){return s===t},LxTfx:"Dedicate"+r(285)+"lobalScope",sPRCm:function(s,t){return s===t},kGBpB:function(s,t){return s==t},TCDcr:function(s,t){return s!=t},mFyKq:function(s,t){return s!=t},PscMK:function(s,t){return s!=t},nLota:function(s,t){return s===t},nXMQF:function(s,t){return s===t},yMMsk:"ServiceWorkerGlobalScope",ObopK:function(s,t){return s===t},wAWrO:function(s,t){return s!=t},BAxLR:function(s,t){return s===t},ahwxq:r(992)+"qos__"};ve.r(V),ve.d(V,{FWS:()=>I0,CustomErrorEvent:()=>ns,createCloseEvent:()=>pe,ReconnectEvent:()=>ts,createErrorEvent:()=>ue,decodedFrame:()=>Xr,createOpenEvent:()=>xs,CustomCloseEvent:()=>rs,createReconnectEvent:()=>Jn,FrontierMessageEvent:()=>is,encodeFrame:()=>Gn,createMessageEvent:()=>as,OpenEvent:()=>os,ErrorCode:()=>qe,Event:()=>it,MessageEvent:()=>ss});let i="";function a(s=""){let t=r;if(e[t(1076)]!==e[t(1259)]){let o=""+Date[t(604)](),c=i||(i=e[t(1450)](p,s)),l=Math[t(325)]()[t(547)](16)[t(369)](-6);return e[t(1359)](e[t(1590)](e.RBUkL("02",o),c),l)}else return this[t(1260)]?.[t(1001)]}function x(){let s=r;return e[s(1590)](e[s(367)](1e4,Date[s(604)]()),Math[s(1104)](e[s(1308)](1e4,Math[s(325)]())))}function f(s){let t=r;return e[t(1004)](e[t(1496)](Array,8)[t(1505)]("0"),e.xGUKy(parseInt,s,10)[t(547)](2))[t(369)](-8)}function u(s){let t=r;return e[t(696)](e[t(1066)](Array,4)[t(1505)]("0"),e[t(684)](parseInt,s,2)[t(547)](16))[t(369)](-4)}function h(s){let t=r,n=s[t(1219)](/\./)[t(698)](l=>f(l)),o=[];return o[0]=e[t(1496)](u,e[t(894)](n[0],n[1])),o[1]=e[t(1066)](u,e[t(1590)](n[2],n[3])),[t(139),e.zderO,e[t(631)],t(139),e.zderO,e[t(235)],o[0],o[1]][t(1505)]("")}function p(s){let t=r;if(e[t(263)](e[t(669)],e[t(669)])){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}/[t(1215)](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(1215)](s);return n?e[t(313)](h,s):o?e[t(1066)](w,s):e[t(138)]}else this[t(523)]=_0x3a4c25,this[t(937)]=null}function w(s){let t=r,n="",o=[],c=0,l=0,m=!0,g=e.zderO;if(e[t(1508)](s[t(1068)]("::"),-1)){let d=s.split("::");for(let v=0;e[t(1593)](v,d[t(1156)]);v++){let C=d[v];if(e[t(1247)](C[t(1068)](":"),0)){let k=C[t(1219)](":");m&&(c=k[t(1156)]),l+=k[t(1156)];for(let R=0;e[t(1593)](R,k.length);R++)if(e[t(1249)](4,k[R].length)){let B=g[t(1451)+"g"](0,e[t(652)](4,k[R][t(1156)])),Y=B[t(936)](k[R]);o[t(157)](Y)}else o.push(k[R]);m=!1}else{if(e[t(161)](4,C[t(1156)])){let k=g[t(1451)+"g"](0,e.VjfSp(4,C.length)),R=k[t(936)](C);o[t(157)](R)}else o[t(157)](C);m&&(c+=1),l+=1,m=!1}}let _="";for(let v=0;e[t(1593)](v,e[t(652)](8,l));v++)_=_[t(936)](g);for(let v=0;e[t(144)](v,o[t(1156)]);v++)e.zzCxJ(v,c)?(n=n[t(936)](_),n=n.concat(o[v])):n=n[t(936)](o[v]);return n}{let d=s[t(1219)](":");for(let _=0;e.yeHuO(_,d.length);_++){let v=d[_];if(e.ESbun(4,d[_][t(1156)])){let C=g[t(1451)+"g"](0,e[t(652)](4,d[_][t(1156)])),k=C[t(936)](v);n=n.concat(k)}else n=n[t(936)](v)}return n}}function b(s,t){let n=r,o=s.key;e.RaxNS(void 0,o)&&(Q(t,10),e[n(684)](De,t,o));let c=s[n(450)];e[n(354)](void 0,c)&&(e[n(684)](Q,t,18),De(t,c))}function y(s){let t=r,n={};e:for(;!e[t(313)](ye,s);){let o=e[t(1496)](ne,s);switch(e[t(511)](o,3)){case 0:break e;case 1:n.key=e[t(610)](Ae,s,e.IUunj(ne,s));break;case 2:n.value=e[t(610)](Ae,s,e[t(178)](ne,s));break;default:e.OqUvo(ie,s,e[t(1112)](7,o))}}if(e[t(263)](void 0,n[t(226)]))throw new Error(t(898)+t(533)+t(916)+t(226));if(n[t(450)]===void 0)throw new Error(e[t(737)]);return n}function E(s){let t=r,n={fuyVj:e[t(1233)]};if(e[t(315)]!==e[t(323)]){let o=e.oVOjj(z);return P(s,o),e.yQpru(Me,o)}else{let o={pfaru:function(c,l){return c!=l},Vbjry:vkRXmW[t(150)]};_0x57501d.r=c=>{let l=t;o[l(1453)](o[l(883)],typeof _0x3905c9)&&_0x322aa6[l(547)+l(792)]&&_0x83a640["definePr"+l(418)](c,_0x5bae0c[l(547)+l(792)],{value:l(1105)}),_0x14f335["definePr"+l(418)](c,"__esModule",{value:!0})}}}function P(s,t){let n=r,o={TzLxG:function(c,l){return e.ipyCM(c,l)},NLHBn:function(c,l){return e[O(511)](c,l)},pvSzw:function(c,l){return e[O(1315)](c,l)},jsokN:function(c,l){return e[O(511)](c,l)},GcJJw:function(c,l){return c>>>l},xzjjH:function(c,l){return e[O(511)](c,l)},fFojl:e.BUcZO,BqNNj:function(c,l){return e[O(178)](c,l)},lzPWP:n(516),SyYPf:e[n(1583)],MqbGd:e[n(1323)],gePFT:function(c,l){return e[n(1247)](c,l)},ovDiX:function(c,l){return e[n(1189)](c,l)},cbwBZ:n(763)+n(415),lRFsm:function(c,l,m){return c(l,m)},AUGXW:function(c,l,m){return e[n(1036)](c,l,m)},vpnmi:e.ErFEF,KbQRZ:e[n(820)],lquot:e.VWzof};if(e.BlVrI(e[n(801)],e[n(724)]))return _0x5c8c04[n(1337)+"Code"](o.TzLxG(255,this.low),o[n(541)](o[n(1281)](this[n(1424)],8),255),o[n(908)](o.NLHBn(this[n(1424)],16),255),o[n(1296)](this.low,24),255&this[n(1023)],o[n(908)](o.GcJJw(this[n(1023)],8),255),o[n(908)](o[n(779)](this.high,16),255),this[n(1023)]>>>24);{let c=s[n(336)];e[n(1249)](void 0,c)&&(Q(t,8),e[n(877)](bt,t,c));let l=s[n(164)];if(e.RaxNS(void 0,l))if(e.ysDrb(n(1428),n(1428))){let me=this[n(642)+n(1347)]?.[n(1100)+n(1059)+"nt"](),X=this[n(952)][n(225)+n(319)+n(1201)](_0x535f02[n(603)],_0x4f607f.reason);this[n(1319)+n(899)+"ent"](_0x145390(o.fFojl,{code:1006,reason:_0x122081.reason||n(153)+n(1237)+n(1581)+n(922)+n(352)+n(1273)+me,willReconnect:X})),X&&this[n(920)]();return}else Q(t,16),e.OqUvo(bt,t,l);let m=s[n(1543)];e[n(236)](void 0,m)&&(n(1549)!==n(655)?(e[n(610)](Q,t,24),bt(t,e[n(178)](xe,m))):(o[n(427)](_0x4d5c82,o[n(1203)]),this.off(o[n(859)],_0x4a47e5),this.off(o[n(201)],_0x2505d3)));let g=s.method;e[n(172)](void 0,g)&&(e[n(1012)](Q,t,32),e[n(856)](bt,t,e.zhXbK(xe,g)));let d=s[n(1437)];if(d!==void 0)for(let me of d)if(e[n(263)](e[n(545)],e[n(667)])){let X=_0x432675[n(142)];if(o.gePFT(o[n(149)](X,_0x10cbce),_0x55dc90.limit))throw new _0x13c08a(o[n(1154)]);return _0x28df3a[n(142)]+=_0x29aa8d,X}else{e[n(990)](Q,t,42);let X=e[n(807)](z);e[n(1547)](b,me,X),Q(t,X[n(342)]),e[n(1547)](ke,t,X),e.DYuPU(G,X)}let _=s[n(943)+n(534)];e[n(1095)](void 0,_)&&(e[n(641)](Q,t,50),e[n(462)](De,t,_));let v=s[n(1387)+n(477)];e.OZKIk(void 0,v)&&(e.YxEGI(Q,t,58),e[n(990)](De,t,v));let C=s[n(720)];e[n(1249)](void 0,C)&&(e[n(877)](Q,t,66),e[n(973)](Q,t,C[n(1156)]),e[n(340)](zt,t,C));let k=s[n(800)];e[n(1398)](void 0,k)&&(Q(t,74),e[n(1577)](De,t,k));let R=s[n(391)+n(1430)];e[n(161)](void 0,R)&&(e.fdJyw(e.tcGkB,n(997))?(Q(t,82),e[n(684)](De,t,R)):(o[n(600)](_0x4630fc,_0x184c7a,16),o.AUGXW(_0x109670,_0x18fe99,_0xe08710)));let B=s[n(989)];B!==void 0&&(e[n(684)](Q,t,90),e[n(1547)](De,t,B));let Y=s[n(822)+"e"];if(e.GyVFl(void 0,Y))if(e[n(291)](n(271),"mChFi"))e[n(610)](Q,t,96),e.LEtLA(bt,t,e.DYuPU(xe,Y));else{let me=o[n(747)][n(1219)]("|"),X=0;for(;;){switch(me[X++]){case"0":this._ws[n(727)+n(1499)]("error",this[n(430)]);continue;case"1":this._ws[n(727)+n(1499)](o.KbQRZ,this[n(1495)]);continue;case"2":this[n(1193)][n(727)+n(1499)](n(476),this[n(1524)]);continue;case"3":if(!this._ws)return;continue;case"4":this[n(1193)]["addEvent"+n(1499)](o[n(1414)],this[n(751)+"ge"]);continue}break}}}}function I(s){let t=r;return e[t(976)](L,e[t(1450)](Ee,s))}function L(s){let t=r;if(e[t(236)](t(1335),e.yCHse))_0x49f1ff=e.IndsZ(_0x40b746,_0x1ecb03),_0x454609|=e[t(849)](127&_0x260b0e,7);else{let n={};e:for(;!e[t(1066)](ye,s);){let o=e[t(177)](ne,s);switch(o>>>3){case 0:break e;case 1:n[t(336)]=e[t(934)](Yr,s,!0);break;case 2:n[t(164)]=e.PEoao(Yr,s,!0);break;case 3:n[t(1543)]=e[t(1450)](ne,s);break;case 4:n.method=ne(s);break;case 5:{let c=e[t(625)](j,s);(n[t(1437)]||(n.headers=[])).push(e[t(1450)](y,s)),s[t(342)]=c;break}case 6:n[t(943)+t(534)]=e[t(512)](Ae,s,e[t(1344)](ne,s));break;case 7:n[t(1387)+"ype"]=Ae(s,e[t(625)](ne,s));break;case 8:n[t(720)]=e.aPgyL(Mt,s,e.IUunj(ne,s));break;case 9:n[t(800)]=e[t(1012)](Ae,s,e.GLsQQ(ne,s));break;case 10:n.serverTiming=e.QMfSF(Ae,s,e.kMBFC(ne,s));break;case 11:n[t(989)]=e[t(1431)](Ae,s,e[t(313)](ne,s));break;case 12:n[t(822)+"e"]=ne(s);break;default:e[t(973)](ie,s,e.mIOQD(7,o))}}if(n[t(336)]===void 0)throw new Error(e[t(163)]);if(n.LogID===void 0)throw new Error("Missing required"+t(916)+t(164));if(e[t(263)](void 0,n[t(1543)]))throw new Error(e[t(1292)]);if(e[t(291)](void 0,n[t(1287)]))throw new Error(e.yUTSx);return n}}function j(s){let t=r,n=e[t(1261)](ne,s),o=s.limit;return s[t(342)]=e[t(1590)](s[t(142)],n),o}function ie(s,t){let n=r;switch(t){case 0:for(;e[n(1112)](128,e[n(399)](te,s)););break;case 2:e.xGUKy(_e,s,e.RgmKm(ne,s));break;case 5:e[n(1389)](_e,s,4);break;case 1:e[n(1442)](_e,s,8);break;default:throw new Error(e.TMwrS(n(1120)+n(1459)+"pe: ",t))}}function xe(s){let t=r;return s|=0,{low:s,high:e[t(440)](s,31),unsigned:s>=0}}let D=[];function z(){let s=r,t=D[s(1026)]();return t?(t[s(142)]=t[s(342)]=0,t):{bytes:new Uint8Array(64),offset:0,limit:0}}function G(s){D.push(s)}function Ee(s){return{bytes:s,offset:0,limit:s[r(1156)]}}function Me(s){let t=r,n=s[t(987)],o=s[t(342)];return e[t(263)](n[t(1156)],o)?n:n.subarray(0,o)}function _e(s,t){let n=r;if(e[n(383)](s[n(142)]+t,s[n(342)]))throw new Error(e[n(299)]);s[n(142)]+=t}function ye(s){let t=r;return s[t(142)]>=s[t(342)]}function ge(s,t){let n=r,o=s[n(987)],c=s[n(142)],l=s.limit,m=e[n(1189)](c,t);if(e[n(233)](m,o.length)){let g=new Uint8Array(e.cMaTv(2,m));g[n(1474)](o),s[n(987)]=g}return s[n(142)]=m,m>l&&(s[n(342)]=m),c}function rt(s,t){let n=r,o=s[n(142)];if(e[n(672)](e.dluyS(o,t),s[n(342)]))throw new Error(e[n(1040)]);return s[n(142)]+=t,o}function Mt(s,t){let n=r,o=e[n(671)](rt,s,t);return s.bytes.subarray(o,o+t)}function zt(s,t){let n=r,o=e[n(882)](ge,s,t[n(1156)]);s[n(987)].set(t,o)}function Ae(s,t){let n=r,o={WdKPQ:function(_,v){return e[O(1096)](_,v)},NgTon:function(_,v,C){return e.SWXCI(_,v,C)},sdrcT:function(_){return e.oVOjj(_)},LhRkV:function(_,v,C){return _(v,C)},rxwXl:function(_,v,C){return e[O(119)](_,v,C)},wNqlP:function(_,v){return e.EhTjy(_,v)}},c=rt(s,t),l=String[n(1337)+n(261)],m=s[n(987)],g="\uFFFD",d="";for(let _=0;_<t;_++)if(e[n(282)](n(1271),e.zcbLN)){let v=this[n(1260)][n(1458)](this[n(854)]),C=_0x168992[n(677)](o[n(865)](v,"{}"));return _0x3db1d1[n(1311)](C)}else{let v=m[e.hywsN(_,c)],C,k,R,B;if(e.caedu(128&v,0))d+=e[n(1220)](l,v);else if(e[n(291)](e[n(1315)](224,v),192))e.FZMva(_,1)>=t?d+=g:(C=m[e[n(1575)](e.Fxguv(_,c),1)],e[n(1358)](192,C)!==128?d+=g:(B=e.qdLys(31&v,6)|e.seVVP(63,C),e.RtjaQ(B,128)?d+=g:(d+=e[n(177)](l,B),_++)));else if(e[n(1509)](240,v)==224)if(e.EwCkJ(e[n(1359)](_,2),t))d+=g;else if(e[n(263)](e.jPyPL,e[n(628)]))C=m[e.TMwrS(e[n(203)](_,c),1)],k=m[e[n(521)](e[n(885)](_,c),2)],e[n(385)](e[n(393)](C,e[n(1116)](k,8)),49344)!==32896?d+=g:(B=e[n(237)](e[n(237)](e[n(849)](e[n(385)](15,v),12),e[n(951)](63&C,6)),e.JHrJN(63,k)),e.uiwyX(B,2048)||B>=55296&&B<=57343?d+=g:(d+=e.sHHbM(l,B),_+=2));else{HbPduY[n(1456)](_0x20109d,_0x37f883,42);let Y=HbPduY.sdrcT(_0x41a512);HbPduY.NgTon(_0x39c7ba,_0x18bac4,Y),HbPduY[n(1557)](_0x322796,_0x169549,Y.limit),HbPduY[n(132)](_0x34edd1,_0x409e3b,Y),HbPduY[n(561)](_0x1502a1,Y)}else e[n(411)](248&v,240)?e[n(744)](_+3,t)?d+=g:(C=m[e[n(392)](e.UqQwO(_,c),1)],k=m[e[n(1440)](e[n(1130)](_,c),2)],R=m[e.aMuLz(_,c)+3],e[n(1358)](C|e.IqOXF(k,8)|e[n(1455)](R,16),12632256)!==8421504?d+=g:e[n(961)](e.HjIWC,e[n(1386)])?this[n(985)](_0x1a78b3,_0x4403a7):(B=e.XpnfH(e[n(1111)](e[n(1520)](e.qdLys(e[n(1358)](7,v),18),e[n(519)](63&C,12)),e.FEJuj(63&k,6)),e[n(738)](63,R)),e[n(144)](B,65536)||B>1114111?d+=g:(B-=65536,d+=e.yoSIw(l,e[n(1189)](e[n(525)](B,10),55296),e[n(1169)](1023,B)+56320),_+=3))):d+=g}return d}function De(s,t){let n=r,o={YYmRH:function(d){return e[O(807)](d)}},c=t[n(1156)],l=0;for(let d=0;d<c;d++)if(e.caedu(e[n(416)],e[n(1369)])){let _=this[n(642)+n(1347)]?.[n(1100)+n(1059)+"nt"]();this[n(777)](n(686)+_),o[n(828)](_0x482951)}else{let _=t[n(265)+"At"](d);_>=55296&&e.VLwbr(_,56319)&&e[n(253)](e[n(179)](d,1),c)&&(_=e[n(392)](e.rPnzD(_,10),t.charCodeAt(++d))-56613888),l+=_<128?1:e[n(144)](_,2048)?2:e[n(253)](_,65536)?3:4}Q(s,l);let m=e[n(1052)](ge,s,l),g=s[n(987)];for(let d=0;e.VhBNF(d,c);d++){let _=t[n(265)+"At"](d);if(_>=55296&&e[n(701)](_,56319)&&e[n(1362)](e[n(591)](d,1),c)&&(_=e[n(1149)](e[n(1055)](e[n(1029)](_,10),t[n(265)+"At"](++d)),56613888)),_<128)g[m++]=_;else{if(e[n(236)](e[n(571)],e[n(571)]))return(_0xda141c(8)[n(1505)]("0")+e[n(532)](_0x20d435,_0x164197,10)[n(547)](2))[n(369)](-8);e[n(1362)](_,2048)?g[m++]=e[n(1111)](e[n(505)](e[n(460)](_,6),31),192):(e[n(1288)](_,65536)?g[m++]=e[n(1041)](e.DHXtF(_,12),15)|224:(g[m++]=e[n(559)](e[n(504)](_,18),7)|240,g[m++]=e[n(1165)](e.seVVP(e.UQNUK(_,12),63),128)),g[m++]=e[n(559)](_>>6,63)|128),g[m++]=e[n(905)](e[n(1169)](63,_),128)}}}function ke(s,t){let n=r;if(e[n(420)](n(207),n(576))){let o=e[n(856)](ge,s,t[n(342)]),c=s.bytes,l=t[n(987)];for(let m=0,g=t[n(342)];e.MmTiq(m,g);m++)c[e[n(695)](m,o)]=l[m]}else return this[n(1533)][n(774)+"ns"]}function te(s){let t=r;return s[t(987)][e[t(1389)](rt,s,1)]}function Ge(s,t){let n=ge(s,1);s.bytes[n]=t}function ne(s){let t=r,n=0,o=0,c;do c=e[t(455)](te,s),e[t(769)](n,32)&&(o|=e[t(1357)](127&c,n)),n+=7;while(e[t(1112)](128,c));return o}function Q(s,t){let n=r;for(t>>>=0;t>=128;)e[n(877)](Ge,s,e[n(1559)](e[n(940)](127,t),128)),t>>>=7;e[n(1305)](Ge,s,t)}function Yr(s,t){let n=r,o={UUCfB:e.scLnE,aCouy:e[n(365)],NLegO:function(d,_){return e[n(411)](d,_)},lbjsq:e.aeivL,mGjQq:"ws://"},c=0,l=0,m=0,g;if(g=e[n(350)](te,s),c=e.QygbB(127,g),e[n(771)](128,g)){if(e.QPATj===e[n(601)]){let d=this[n(642)+"tManager"]?.[n(1100)+n(1059)+"nt"]();this[n(777)](n(542)+d+n(680)),this[n(1020)+"ect"](1001,o[n(630)],!0)}else if(g=te(s),c|=e.cjYaz(e[n(741)](127,g),7),e.tVeaE(128,g)&&(g=te(s),c|=e[n(1476)](127&g,14),e.JgIfi(128,g)&&(g=te(s),c|=e[n(914)](e[n(405)](127,g),21),e.mPwKk(128,g)&&(g=e[n(862)](te,s),l=e[n(816)](127,g),128&g))))if(e[n(118)]("rPNmg",e.NmOPM)){let d=_0x59417c(o[n(1187)],{message:_0x5d4ab8[n(1314)],code:_0x132587[n(1229)+n(955)],error:_0x4cdbb3});this["_dispatc"+n(1168)+n(1522)](d)}else g=e[n(158)](te,s),l|=e.rPnzD(e[n(425)](127,g),7),e[n(816)](128,g)&&(g=e[n(455)](te,s),l|=e[n(1169)](127,g)<<14,e.DTowV(128,g)&&(g=te(s),l|=e.uGknd(127,g)<<21,128&g&&(g=te(s),m=e[n(1315)](127,g),e[n(385)](128,g)&&(e[n(562)](e[n(691)],n(1090))?(g=e[n(350)](te,s),m|=e[n(1576)](e[n(768)](127,g),7)):(_0x36b693=_0x16789a&&o[n(266)]("https:",_0x2f6837.protocol)?o[n(714)]:o[n(808)],_0xd2f221=_0x15386a[n(211)](/((^ws)|(^http))((?:[s]*:\/\/))/,""),_0x525eb7=/^wss(.*:\/\/)/[n(1215)](_0x45c77f)?_0xbe2c07:""+_0x229ca5+_0x5f0818)))))}return{low:c|l<<28,high:e[n(1483)](e[n(1145)](l,4),e.KYxSl(m,24)),unsigned:t}}function bt(s,t){let n=r,o=e[n(1290)](t[n(1424)],0),c=(e[n(511)](t[n(1424)],28)|e[n(444)](t[n(1023)],4))>>>0,l=e[n(1290)](t[n(1023)],24),m=e[n(291)](0,l)?e[n(1341)](0,c)?o<16384?e.yeHuO(o,128)?1:2:e[n(1343)](o,2097152)?3:4:e[n(181)](c,16384)?e[n(1288)](c,128)?5:6:c<2097152?7:8:e[n(1362)](l,128)?9:10,g=ge(s,m),d=s[n(987)];switch(m){case 10:d[e.YpRPL(g,9)]=e[n(981)](e[n(1025)](l,7),1);case 9:d[e[n(1325)](g,8)]=e[n(1095)](9,m)?e[n(1483)](128,l):e[n(1118)](127,l);case 8:d[g+7]=e[n(1166)](8,m)?e[n(1559)](e.tiSWo(c,21),128):c>>>21&127;case 7:d[e[n(811)](g,6)]=m!==7?e[n(1103)](e.BDoNX(c,14),128):e[n(771)](e.kHGhD(c,14),127);case 6:d[g+5]=m!==6?e[n(945)](c>>>7,128):e[n(375)](c>>>7,127);case 5:d[e[n(811)](g,4)]=e[n(1095)](5,m)?128|c:e[n(301)](127,c);case 4:d[e[n(696)](g,3)]=e[n(489)](4,m)?e.ArXDf(e[n(131)](o,21),128):e[n(1145)](o,21)&127;case 3:d[e[n(613)](g,2)]=e.ZQsSk(3,m)?e[n(1500)](e[n(131)](o,14),128):e[n(1315)](e[n(1091)](o,14),127);case 2:d[e.mFFoi(g,1)]=e[n(172)](2,m)?e.XJVLG(o>>>7,128):e[n(240)](o,7)&127;case 1:d[g]=e[n(1398)](1,m)?128|o:127&o}}function Xr(s){return e.cMWMS(I,s)}function Gn(s){return e[r(1302)](E,s)}let $r=65536,Uo=e[r(198)],st=e[r(962)]($r,$r),Zr=e[r(736)](st,st),Qr=e[r(1032)](Zr,2),ze=String[r(257)+"e"].charCodeAt;class M{constructor(t,n,o){let c=r;this[c(256)]=!0,this.low=e[c(1520)](0,t),this[c(1023)]=e[c(1165)](0,n),this[c(1062)]=!!o}static[r(256)](t){let n=r;return t&&e[n(291)](!0,t[n(256)])}static fromBits(t,n,o){let c=r;if(e[c(263)]("sqALo",e[c(713)]))for(var l in _0x5e2f16)_0x22e57b.o(_0x3187ca,l)&&!_0x553707.o(_0x3db2c3,l)&&_0x53bfd7[c(1148)+c(418)](_0x4d0147,l,{enumerable:!0,get:_0x44b0e7[l]});else return new M(t,n,o)}static[r(847)+"s"](t,n,o){let c=r;return o?M[c(847)+c(599)](t,n):M[c(847)+c(676)](t,n)}static[r(847)+r(599)](t,n){let o=r;if(e[o(428)]===e[o(123)])_0x570283[o(719)](_0x2ac035);else return new M(e[o(1443)](e[o(1167)](e[o(1111)](t[0],e[o(1576)](t[1],8)),e[o(1129)](t[2],16)),e[o(519)](t[3],24)),e[o(1167)](e[o(1520)](e[o(397)](t[4],e.VVyoU(t[5],8)),e.vfDDo(t[6],16)),e[o(963)](t[7],24)),n)}static[r(847)+r(676)](t,n){let o=r;return new M(e[o(945)](e[o(1250)](e[o(890)](t[4],24),e.vfDDo(t[5],16))|e.bwanJ(t[6],8),t[7]),e[o(1111)](e[o(1097)](e[o(467)](t[0],24)|t[1]<<16,e[o(681)](t[2],8)),t[3]),n)}static fromHash(t){let n=r,o={pQmML:function(c,l){return c-l}};if(e.XYmut!==e[n(1099)])return e.dMZMr(t,Uo)?es:new M(e[n(131)](e.oZMTU(ze[n(480)](t,0)|e.gbnXo(ze[n(480)](t,1),8),e[n(519)](ze[n(480)](t,2),16))|e[n(598)](ze[n(480)](t,3),24),0),(e.PWtKx(e.IPtjM(ze.call(t,4),e.tsscV(ze[n(480)](t,5),8)),e.HsZtL(ze.call(t,6),16))|e.rzwPJ(ze[n(480)](t,7),24))>>>0,!0);if(_0x5017fd[n(1156)]!==4){let c=_0x50ad75.substring(0,XmPHYa[n(1579)](4,_0x3ce0cf[n(1156)])),l=c[n(936)](_0x58de9c);_0xf7d68a.push(l)}else _0x263ec2[n(157)](_0xbb110a);_0x1cefba&&(_0x4e7097+=1),_0x2e2d2c+=1,_0x31678f=!1}[r(1417)](){let t=r;return String[t(1337)+t(261)](e[t(183)](255,this[t(1424)]),e[t(492)](e.cqWxh(this[t(1424)],8),255),e.SFVIn(this[t(1424)],16)&255,e[t(1030)](this[t(1424)],24),255&this[t(1023)],e[t(538)](e[t(670)](this.high,8),255),e.UBgkF(this[t(1023)],16)&255,this[t(1023)]>>>24)}static[r(919)+"er"](t,n=!0){let o=r;if(e[o(1502)](isNaN,t))return n?Ko:es;if(n){if(t>=Zr)return Wo}else{if(e.MxekY(e[o(752)],e.pAnVw))return _0x529d6b?this.toBytesLE():this[o(358)+"E"]();if(e[o(988)](t,-Qr))return jo;if(e[o(520)](e[o(811)](t,1),Qr))return Ho}return M[o(185)](e[o(312)](e[o(972)](t,st),0),e[o(726)](e[o(1032)](t,st),0),n)}toNumber(){let t=r;return this[t(1062)]?e[t(1333)](e[t(1565)](e.YNTFa(this[t(1023)],0),st),e[t(439)](this[t(1424)],0)):e[t(203)](e[t(736)](this.high,st),this[t(1424)]>>>0)}[r(514)](){let t=r;return e[t(118)](0,this[t(1023)])&&this[t(1424)]===0}[r(270)](t){let n=r;if(e[n(1573)](e[n(645)],e[n(879)]))this[n(1185)](n(476),_0x6f1597),this.onclose&&this.onclose(_0x1c65a5);else{M[n(256)](t)||(t=M[n(919)+"er"](t));let o=e[n(670)](this[n(1023)],16),c=65535&this[n(1023)],l=e[n(1399)](this.low,16),m=e.tVeaE(65535,this[n(1424)]),g=t[n(1023)]>>>16,d=e.oPRhS(65535,t[n(1023)]),_=e[n(1030)](t.low,16),v=e[n(117)](65535,t.low),C=0,k=0,R=0,B=0;return B+=m+v,R+=e[n(555)](B,16),B&=65535,R+=e[n(244)](l,_),k+=e[n(1145)](R,16),R&=65535,k+=c+d,C+=k>>>16,k&=65535,C+=e[n(743)](o,g),C&=65535,M.fromBits(e.cYzWO(R<<16,B),e[n(469)](e[n(951)](C,16),k),this.unsigned)}}[r(1556)](t){let n=r;if(e[n(825)](e[n(445)],e[n(398)]))this[n(1193)]&&this._ws[n(1262)](_0x21aa5d),this[n(812)+n(1312)][_0x29b6de]=null;else return M[n(256)](t)||(t=M[n(919)+"er"](t)),e[n(1398)](this[n(1062)],t[n(1062)])&&e[n(1282)](e[n(311)](this.high,31),1)&&e[n(291)](t[n(1023)]>>>31,1)?!1:e[n(1252)](this[n(1023)],t[n(1023)])&&e.gYDpZ(this[n(1424)],t.low)}[r(867)](){let t=r;return e[t(406)](-1,this[t(1424)])&&e[t(1573)](-1,this[t(1023)])?M[t(185)](0,0,this.unsigned):e[t(291)](-1,this[t(1424)])?M[t(185)](0,this.high+1,this[t(1062)]):M[t(185)](this[t(1424)]+1,this[t(1023)],this.unsigned)}[r(1117)](t){let n=r;if(e[n(961)](e.NHbli,e.NHbli))return t?this[n(1370)+"E"]():this.toBytesBE();if(e[n(411)](n(668),typeof _0x375bfc)){let o=new _0x3cb986(e[n(1450)](_0x28e735,_0x5377ae));return e[n(956)](_0x4dcd2a,_0x96caa,o,0),o}return _0x1cd45f instanceof _0x4e77f0?new _0x1aae40(_0x4e2e4d):new _0xd9e01a(_0x589280[n(1060)],_0x213d6b[n(1338)+"et"],_0x17f828[n(742)+"th"])}[r(1370)+"E"](){let t=r;if(e.MjNTU!==e[t(635)])return this.unsigned?e[t(695)](e[t(1092)](this.high>>>0,_0x2a3139),this[t(1424)]>>>0):e[t(244)](e[t(736)](this[t(1023)],_0x2ba58),this.low>>>0);{let n=this[t(1023)],o=this[t(1424)];return[255&o,e[t(638)](e[t(459)](o,8),255),e[t(240)](o,16)&255,e[t(1209)](o,24),e[t(530)](255,n),e.lHzcw(e[t(322)](n,8),255),e[t(1007)](e[t(1564)](n,16),255),e[t(1356)](n,24)]}}toBytesBE(){let t=r,n=this[t(1023)],o=this[t(1424)];return[e.vmmTy(n,24),e[t(1586)](n>>>16,255),e[t(981)](e[t(511)](n,8),255),e[t(816)](255,n),e[t(409)](o,24),e[t(1186)](e.NQQUq(o,16),255),e[t(734)](e[t(785)](o,8),255),e[t(1587)](255,o)]}}let es=new M(0,0,!1),Ko=new M(0,0,!0),Ho=M[r(185)](-1,2147483647,!1),Wo=M[r(185)](-1,-1,!0),jo=M[r(185)](0,-2147483648,!1);var qe=(function(s){let t=r,n=e.kDoHB[t(1219)]("|"),o=0;for(;;){switch(n[o++]){case"0":s[s["CONNECTI"+t(134)]=5002]=e[t(1349)];continue;case"1":s[s["NATIVE_E"+t(1475)]=5001]=t(1293)+t(1475);continue;case"2":s[s[e[t(563)]]=5005]=e.rtkmp;continue;case"3":s[s[e[t(192)]]=5004]=e[t(192)];continue;case"4":return s;case"5":s[s[t(1267)+"IES_ERROR"]=5003]=e[t(327)];continue}break}})({});class it{constructor(t){let n=r;this[n(523)]=t,this[n(937)]=null}}class ts extends it{constructor(t,n){let o=r;super(t),this[o(1314)]=n&&n[o(1314)]||null}}class ns extends it{constructor(t,n){let o=r,c=e.voWYe[o(1219)]("|"),l=0;for(;;){switch(c[l++]){case"0":this[o(1516)]=n&&n.filename||"";continue;case"1":super(t);continue;case"2":this[o(473)]=n&&n[o(473)]||0;continue;case"3":this[o(1314)]=n&&n[o(1314)]||"";continue;case"4":this[o(993)]=n&&n[o(993)]||0;continue;case"5":this[o(321)]=n&&n[o(321)]||null;continue;case"6":this[o(603)]=n&&n[o(603)]||5001;continue}break}}}class rs extends it{constructor(t,n){let o=r;super(t),this.code=n&&n[o(603)]||0,this[o(786)]=n&&n[o(786)]||"",this.wasClean=n&&n[o(1008)]||!1,this[o(1077)+o(1480)]=n&&n[o(1077)+"nnect"]||!1}}class ss extends it{constructor(t,n){let o=r;super(t),this.data=n&&n[o(1163)]||null}}class is extends ss{constructor(t,n){let o=r;super(t),this[o(1163)]=n&&n.data||null,this[o(1314)]=n&&n[o(1314)]||null}}class os extends it{constructor(t,n){let o=r;super(t),this[o(1163)]=n&&n[o(1163)]||null}}function ue(s,{message:t,code:n,error:o}){return new ns(s,{message:t,code:n,error:o})}function pe(s,{code:t,reason:n,wasClean:o,willReconnect:c}){return new rs(s,{code:t,reason:n,wasClean:o,willReconnect:c})}function as(s,{data:t,message:n}){return new is(s,{data:t,message:n})}function xs(s,{data:t}){return new os(s,{data:t})}function Jn(s,{message:t}){return new ts(s,{message:t})}class cs{constructor(t,n){let o=r;this.endpoints=t,this[o(1142)+"es"]=n,this["currentI"+o(647)]=0,this[o(151)+"ndpointT"+o(1080)+"t"]=0}[r(1042)+r(196)+"fig"](){let t=r;if(e[t(118)]("TjwOk",e.WFyJj))this[t(581)+t(647)]=0,this[t(151)+t(186)+t(1080)+"t"]=0;else{let n=_0x26f260[t(1451)+"g"](0,4-_0x3e64ec[_0x5b415b][t(1156)]),o=n.concat(_0x1b089[_0x177523]);_0x15abf5[t(157)](o)}}[r(1408)+"es"](){let t=r;this[t(151)+t(186)+t(1080)+"t"]=0}["getCurre"+r(1059)+"nt"](){let t=r;return this[t(1448)+"s"][this[t(581)+t(647)]]}[r(1100)+r(1059)+"ntTriesC"+r(1322)](){let t=r;if(e[t(1166)](e[t(809)],e.FAGZb))_0x47ba1a[t(1474)](_0x160985,_0x5260e0);else return this[t(151)+t(186)+"riesCount"]}[r(1244)+r(1410)+"es"](){let t=r;return!!(e[t(1098)](this[t(581)+t(647)],this[t(1448)+"s"][t(1156)])||e[t(282)](this[t(581)+"ndex"],this[t(1448)+"s"][t(1156)]-1)&&this[t(151)+t(186)+"riesCount"]===this[t(1142)+"es"])}[r(791)+r(839)+"ointReac"+r(1217)+r(710)](){let t=r;return e[t(838)](this["currentI"+t(647)],this.endpoints[t(1156)])?!0:this[t(151)+t(186)+"riesCount"]>this[t(1142)+"es"]}["replaceB"+r(302)+"pointAnd"+r(643)+r(660)](){let t=r;return this[t(151)+t(186)+t(1080)+"t"]=1,this[t(581)+t(647)]++,this.endpoints[this["currentI"+t(647)]]}["getCurrentEndpoi"+r(775)+r(251)](){let t=r;return this[t(151)+t(186)+"riesCount"]++,this.getCurrentEndpoint()}}let ot=(e[r(624)](e[r(1233)],typeof globalThis)&&e.jABKv(e[r(380)],globalThis[r(1013)+"tor"].name)||e[r(1330)](e[r(1233)],typeof window)&&e[r(380)]===window[r(1013)+"tor"][r(1101)])&&e[r(1224)](e[r(1233)],typeof document),Je=e.VjbsV!=typeof globalThis&&(e[r(855)]===globalThis[r(1013)+r(874)][r(1101)]||e[r(574)](e[r(324)],globalThis[r(1013)+r(874)][r(1101)]))&&e[r(1330)](e[r(1233)],typeof tt),vt=(e[r(1233)]!=typeof globalThis&&e.sPRCm(r(834),globalThis["construc"+r(874)][r(1101)])||e[r(954)](e[r(1233)],typeof globalThis)||e.TCDcr(e[r(1233)],typeof globalThis)&&!!globalThis[r(880)+r(659)])&&e.mFyKq(e[r(1233)],typeof wx),St=e.PscMK(e[r(1233)],typeof globalThis)&&(e.nLota(e[r(324)],globalThis[r(1013)+r(874)][r(1101)])||e[r(1078)]("SharedWorkerGlob"+r(1411),globalThis[r(1013)+"tor"][r(1101)])||e[r(208)]===globalThis[r(1013)+"tor"][r(1101)])&&r(629)+"d"!=typeof self,Go=e[r(624)](e[r(1233)],typeof globalThis)&&e[r(432)]("Object",globalThis["construc"+r(874)].name)&&e[r(1532)](e[r(1233)],typeof global)&&e[r(918)](e[r(855)],global[r(1013)+r(874)].name)&&e[r(1233)]!=typeof process&&!!process[r(746)];class Vn{constructor(){let t=r;e[t(1249)](e.liaGy,"tNaxj")?this[t(1190)+"rs"]={}:_0x300692.resolve()[t(1115)](()=>{let n=t;this[n(470)+n(1139)]()})}emit(t,...n){let o=r,c=this[o(1190)+"rs"][t];if(c)c[o(369)]()[o(457)](l=>l.fn[o(1232)](l[o(1251)],n));else if(e[o(673)](o(321),t)&&!this.onerror)if(o(404)===e[o(524)]){let l=n.length&&n[0];if(e[o(1353)](l,Error))throw l;let m=new Error(e[o(392)](o(224)+o(170),l?e.jgrJq(e.iiXfR(" (",l[o(1314)]),")"):""));throw m.context=l,l}else{if(!this[o(866)+"orOnline"]()||this[o(1368)+o(1133)])return;this[o(642)+o(1347)]?.[o(1042)+o(196)+o(228)](),this["_pingLos"+o(783)]?.["resetCou"+o(195)](),this._ws?this["_disconn"+o(1124)](1001,o(966)+o(664)+"reconnec"+o(221)+o(804),!0):this[o(920)]()}return this}[r(985)](t,n){let o=r;if(e[o(673)](void 0,t))this[o(1190)+"rs"]={};else if(e[o(513)](void 0,n))this._listeners[t]=null;else{let c=this[o(1190)+"rs"][t];if(c)for(let l=0;e[o(253)](l,c[o(1156)]);)c[l].fn===n?c[o(996)](l,1):++l}return this}on(t,n,o){let c=r;return(this[c(1190)+"rs"][t]||(this[c(1190)+"rs"][t]=[])).push({fn:n,ctx:o||this}),this}}class Jo extends Vn{[r(1183)+r(1194)+r(1304)](t){let n=r;return t[n(328)]||t[n(218)]?(n(1048)+" "+(t.errMsg||"")+n(441)+(t.errNo||""))[n(239)]():JSON.stringify(t)}constructor(t,n,o){let c=r;super(),this[c(1533)]=null,vt&&wx["connectS"+c(1506)]&&(this._socket=wx[c(829)+c(1506)]({url:t,protocols:n,header:o,fail:this["_createSocketFai"+c(1155)][c(433)](this),success:this["_createS"+c(147)+"cessHandler"][c(433)](this)})),Je&&tt[c(829)+c(1506)]&&(this[c(1533)]=tt["connectS"+c(1506)]({url:t,protocols:n,header:o,fail:this[c(1176)+c(689)+c(1155)][c(433)](this),success:this[c(1176)+c(147)+c(386)+c(639)][c(433)](this)}))}[r(1176)+r(147)+r(386)+r(639)](){let t=r;Promise[t(1164)]()[t(1115)](()=>{this[t(470)+"steners"]()})}[r(1176)+r(689)+r(1155)](t){let n=r,o={slbhp:function(c,l,m){return e[O(1305)](c,l,m)},ZXEBF:"error",CWegQ:n(476)};e[n(1573)](e[n(1085)],e[n(1107)])?(_0x14c5c2=_0x2ef391[e[n(784)](_0x36130a+_0x345e7c,1)],_0x450e5c=_0x3ad5e6[e[n(382)](e[n(1018)](_0x33dfb1,_0x4e9f75),2)],e[n(1088)](e[n(538)](e[n(1097)](_0x397c26,_0x138b0d<<8),49344),32896)?_0x1477c2+=_0x1f9dd2:(_0x3457f8=e.rMEMN(15,_0x4e72fe)<<12|e.UMbWD(e[n(738)](63,_0x1a1454),6)|e[n(616)](63,_0x27d248),e[n(527)](_0x862e6e,2048)||e[n(744)](_0x1bc481,55296)&&e[n(701)](_0x254f9f,57343)?_0x15982f+=_0x406e1b:(_0x26a512+=_0x20aace(_0x42ca71),_0x4e42c0+=2))):Promise[n(1164)]().then(()=>{let c=n,l=o[c(926)](ue,o[c(1015)],{message:this[c(1183)+c(1194)+c(1304)](t)});this[c(1185)](o[c(1015)],l);let m=o[c(926)](pe,o[c(1336)],{reason:this["_formatE"+c(1194)+c(1304)](t)});this[c(1185)](c(476),m)})}[r(470)+r(1139)](){let t=r,n={sZzFd:e[t(708)],QJtDR:function(o,c){return e.YmZLC(o,c)},LhYxl:e.dXwpj,hhAyb:t(1314),KLAtM:function(o,c,l){return e[t(990)](o,c,l)}};this[t(1533)].onOpen(o=>{let c=t;this[c(1185)](e[c(820)],e[c(462)](xs,e.qLPbW,{...o,data:o.errMsg||""}))}),this._socket.onClose(o=>{let c=t;this[c(1185)](c(476),e.uGcnl(pe,e[c(994)],{...o}))}),this[t(1533)][t(1434)+"e"](o=>{let c=t;n[c(646)](n[c(422)],n[c(422)])?(this[c(1193)]&&this[c(1193)][c(1262)](_0x40eb30),this._debug(n[c(619)],_0x1c8092)):this[c(1185)](n[c(176)],n[c(160)](as,c(1314),{...o}))}),this[t(1533)][t(1265)](o=>{let c=t;this[c(1185)](e[c(365)],e[c(882)](ue,e[c(365)],{...o,message:o[c(328)]||""}))})}[r(1262)](t){let n=r,o={lsVbn:n(321),kMLKm:function(c,l,m){return e[n(1123)](c,l,m)},wZCWA:function(c,l){return e.vCrfs(c,l)},xHWou:function(c,l){return e.NWZuI(c,l)},JZZBd:function(c,l){return e[n(741)](c,l)}};if(e.pnKfr(e[n(232)],e[n(232)]))if(t instanceof Uint8Array)if(e[n(1566)](e[n(716)],n(1225)))_0x5a3cdd&&_0x5c2b45["addEvent"+n(1499)](gbTWjn[n(994)],()=>_0x2ec925()),_0x2b4a5c&&_0x15dbd6[n(727)+n(1499)](gbTWjn[n(1419)],()=>_0x41090d());else{let c=t[n(1060)][n(369)](t.byteOffset,e.UIVME(t[n(742)+"th"],t[n(1338)+"et"]));this[n(1533)]&&this[n(1533)][n(1262)]({data:c,fail:l=>{let m=n;this[m(1185)](o[m(401)],o[m(753)](ue,"error",{message:this._formatErrorMessage(l)}))}})}else this[n(1533)]&&this[n(1533)].send({data:t,fail:c=>{let l=n;this[l(1185)](o[l(401)],o.kMLKm(ue,l(321),{message:this[l(1183)+"rrorMess"+l(1304)](c)}))}});else _0x24d4cf-=65536,_0x34e9f6+=_0x19b08c(NNDjMK[n(1037)](_0x426738,10)+55296,NNDjMK.xHWou(NNDjMK[n(296)](1023,_0x2b33a0),56320)),_0x4139cd+=3}[r(476)](t,n){let o=r;this._socket&&this._socket[o(476)]({code:t,reason:n})}addEventListener(t,n){this.on(t,n)}[r(977)+r(597)+r(1017)](t,n){this[r(985)](t,n)}get[r(1379)+"te"](){let t=r;return this[t(1533)][t(1379)+"te"]}get[r(1108)+"pe"](){return this[r(1533)].binaryType}set[r(1108)+"pe"](t){}get url(){let t=r;return this[t(1533)][t(215)]}get protocol(){let t=r;return this[t(1533)][t(986)]}get[r(774)+"ns"](){return this[r(1533)].extensions}get[r(1540)+r(605)](){let t=r,n={HOHba:t(1044)+"0"};if(e[t(657)](t(1160),t(1160)))return 0;{let o=n[t(815)][t(1219)]("|"),c=0;for(;;){switch(o[c++]){case"0":this._connect();continue;case"1":this[t(1368)+t(1133)]=!1;continue;case"2":this[t(642)+t(1347)]?.resetEndpointConfig();continue;case"3":this["_pingLos"+t(783)]?.[t(1388)+t(195)]();continue;case"4":this._isInit=!0;continue}break}}}}function Vo(s,t){let n=r;if(t)return new t(s.url,s[n(986)]);if(e.GlYPz(vt,Je))return new Jo(s[n(215)],s[n(986)],s.headers);if((ot||St)&&e[n(234)](e[n(1233)],typeof WebSocket)&&WebSocket)return new WebSocket(s[n(215)],s[n(986)+"s"])}function Yo(s){let t=r,n=e[t(1086)][t(1219)]("|"),o=0;for(;;){switch(n[o++]){case"0":return!1;case"1":if(Je&&tt[t(829)+t(1506)])return!0;continue;case"2":if(vt&&wx[t(829)+"ocket"])return!0;continue;case"3":if((ot||St)&&e[t(1233)]!=typeof WebSocket&&WebSocket)return!0;continue;case"4":if(s)return!0;continue}break}}function fs(s,t,n){let o=r,c={iGQzM:function(l,m){return e[O(1096)](l,m)},LUwGA:function(l,m){return e[O(411)](l,m)},fvywh:"string",PsytO:function(l,m){return e[O(1405)](l,m)},mlkfN:e[o(254)],ddrik:function(l,m){return e[o(1270)](l,m)},MaQrS:e[o(1457)],yTxCr:function(l,m){return e.IWraN(l,m)},wCmfZ:e.dHZqr,pNOur:function(l,m){return e[o(1253)](l,m)},NCnFa:function(l,m){return e[o(1588)](l,m)}};if(e[o(161)](e[o(682)],e[o(682)]))return e[o(156)](e[o(1069)](_0x573d48,4)[o(1505)]("0"),_0x445496(_0x23baae,2).toString(16)).slice(-4);{let l=-1;async function m(g){let d=o;if(c.ddrik(d(1e3),c[d(136)]))return c[d(758)](g,l)?Promise[d(697)](new Error(c[d(1027)])):(l=g,c[d(318)](g,n[d(1156)])?Promise[d(1164)]():n[g].bind(s)(t,m.bind(null,c.NCnFa(g,1))));{let{url:_}=c[d(182)](_0x336dc9,{}),v=_0x20ad06[d(623)](_)?_:c.LUwGA(c[d(204)],typeof _)?[_]:[];_0x19a7d2&&_0x32b88e[d(1300)](this[d(952)],_0x60738e),v&&v[d(1156)]?this[d(642)+d(1347)]=new _0x3d80e2(v,this[d(952)].maxRetries):this[d(642)+d(1347)]?.["resetEnd"+d(196)+d(228)](),this[d(1513)+"sCounter"]?.[d(1388)+d(195)](this[d(952)].pingLossCount),this[d(1368)+"osed"]=!1,this[d(1193)]&&c[d(1568)](this._ws[d(1379)+"te"],this[d(317)])?this[d(1020)+d(1124)](1e3,c[d(872)],!0):(this[d(275)]=!0,this[d(920)]())}}e[o(679)](m,0)}}function us(s){let t=r,n=0,o=0;for(let c=0;e[t(769)](c,s.length);++c)if(e[t(1192)](e[t(949)],e[t(949)]))o=s[t(265)+"At"](c),e[t(693)](o,128)?n+=1:e[t(1376)](o,2048)?n+=2:e[t(1439)](e[t(616)](64512,o),55296)&&e.uWDJz(e[t(497)](64512,s[t(265)+"At"](c+1)),56320)?(++c,n+=4):n+=3;else return _0x321d7f||(_0x46e0e0=[_0x2819d6[t(257)+"e"][t(1464)],_0x5d395e[t(257)+"e"][t(1531)],_0xf1044c[t(257)+"e"][t(1531)+t(860)+"ey"]]);return n}function ds(s,t,n){let o=r;if(e[o(837)](n-t,1))return"";let c="";for(let l=t;e[o(837)](l,n);){let m=s[l++];if(e.IWraN(m,127))c+=String[o(1337)+"Code"](m);else if(e.CDrNS(m,192)&&e[o(1362)](m,224))c+=String["fromChar"+o(261)](e[o(1250)](e.UMbWD(31&m,6),e[o(1118)](63,s[l++])));else if(e.CDrNS(m,224)&&m<240)c+=String[o(1337)+o(261)](e[o(1171)](e[o(741)](15,m)<<12,e[o(921)](63&s[l++],6))|e[o(734)](63,s[l++]));else if(e[o(520)](m,240)){let g=e[o(1149)](e[o(1443)](e[o(648)](e[o(850)](7,m)<<18,e.zpOLd(e[o(1298)](63,s[l++]),12))|e.bvtMm(e.SAAiO(63,s[l++]),6),63&s[l++]),65536);c+=String["fromChar"+o(261)](e.cyKoK(55296,e.DHXtF(g,10))),c+=String[o(1337)+"Code"](56320+(1023&g))}}return c}function Yn(s,t,n){let o=r,c=n,l,m;for(let g=0;e[o(1362)](g,s[o(1156)]);++g)if(l=s.charCodeAt(g),l<128)t[n++]=l;else if(e[o(503)](l,2048))if(e[o(1409)]===o(730)){let d=_0x51aadd.bytes,_=_0x33f451[o(142)],v=_0x3ce1f3[o(342)],C=_+_0x41ffb6;if(e[o(1134)](C,d.length)){let k=new _0x2b080e(2*C);k[o(1474)](d),_0x421a27[o(987)]=k}return _0x195763.offset=C,e[o(233)](C,v)&&(_0x226aeb.limit=C),_}else t[n++]=e[o(726)](e.DHXtF(l,6),192),t[n++]=e[o(913)](e.pmfSQ(63,l),128);else if(e[o(1041)](64512,l)===55296&&e[o(333)](e[o(301)](64512,m=s[o(265)+"At"](e[o(1226)](g,1))),56320)){let d=e[o(1045)][o(1219)]("|"),_=0;for(;;){switch(d[_++]){case"0":t[n++]=e[o(1250)](e[o(440)](l,12)&63,128);continue;case"1":t[n++]=e[o(1383)](e[o(1041)](e[o(504)](l,6),63),128);continue;case"2":t[n++]=e[o(393)](e[o(1595)](63,l),128);continue;case"3":++g;continue;case"4":t[n++]=e[o(1594)](e.vCrfs(l,18),240);continue;case"5":l=e[o(392)](65536+(e[o(1587)](1023,l)<<10),e[o(495)](1023,m));continue}break}}else t[n++]=e.Qytvk(e[o(1326)](l,12),224),t[n++]=e[o(1558)](e.vCrfs(l,6),63)|128,t[n++]=e[o(329)](e[o(1118)](63,l),128);return e[o(1438)](n,c)}async function ls(s){let t=r;if(e[t(159)]==typeof s){let n=new Uint8Array(e[t(1496)](us,s));return e[t(910)](Yn,s,n,0),n}return e[t(1353)](s,ArrayBuffer)?new Uint8Array(s):new Uint8Array(s[t(1060)],s[t(1338)+"et"],s[t(742)+"th"])}function Xo(s){let t=r;if(e[t(1465)]===e[t(1465)])try{return e[t(481)](t(668),typeof s)&&(e[t(1353)](s,ArrayBuffer)||s.buffer&&s.buffer instanceof ArrayBuffer)||e[t(481)](e.LPMIl,typeof s)?"":(JSON[t(677)](s),e[t(1366)])}catch{return e[t(760)](e.LPMIl,typeof s)?e.HeVjv:""}else{let n=255&_0x323e07;_0x49dde8(n,_0x3ef257,_0x1832a9+_0x2b724c),_0x45225f>>>=8,_0x13a5e2--}}let $o=(s,t)=>{let n=r;if(e[n(825)](e.XGHfV,e[n(1354)]))_0x14c2ba.persisted&&(N[n(866)+n(372)]()&&(!N[n(1193)]||N[n(1193)][n(1379)+"te"]!==N[n(1339)]||e[n(236)](N[n(1193)][n(1379)+"te"],N[n(1452)+"NG"]))&&N[n(141)+"nLine"](),N[n(531)+"er"]&&_0x1795ca[n(727)+n(1499)](e[n(537)],N[n(141)+"nLine"]),N[n(531)+"er"]&&_0xf7a95b[n(727)+"Listener"]("offline",N[n(141)+n(482)]));else switch(s){case e[n(1222)]:case e[n(1348)]:return{[n(1481)+s]:1,"x-tt-env":t};default:return{}}};class Zo{constructor(t){let n=r;this[n(436)+n(1322)]=t,this[n(454)]=0}addCount(){let t=r;this[t(454)]++}["checkRea"+r(550)+"nt"](){let t=r;return e[t(1098)](this[t(454)],this[t(436)+t(1322)])}["resetCou"+r(195)](t=0){let n=r;this[n(436)+n(1322)]=t,this[n(454)]=0}}async function Qo(s){let t=r,n={TrpoP:function(o,c){return e[O(1446)](o,c)},ExnPR:function(o,c){return o(c)},LMicw:e[t(345)],ANdje:e[t(900)],NCCWo:t(912)+"ascript",CiRBh:function(o,c){return e[t(488)](o,c)},RjQoF:"http",RLQDA:function(o,c){return o(c)}};return new Promise(o=>{let c=t,l={FipCz:function(m,g){return n[O(586)](m,g)},VGqiG:"unknown "+c(786)};if(!ot)return n[c(1332)](o,n[c(1053)]);try{let m=document[c(772)+"ement"](n[c(448)]);window[c(1179)+c(426)]=g=>{let d=c;document[d(279)].removeChild(m),window[d(1179)+d(426)]=void 0,l[d(1084)](o,g&&g[d(805)]||l[d(130)])},m[c(523)]=n[c(573)],m[c(1144)]=n[c(602)](s[c(211)](/^ws/,n[c(423)]),c(1382)+c(1360)+c(733)+"P");try{document[c(279)][c(286)+c(923)](m)}catch{document[c(279)]["removeCh"+c(923)](m)}}catch{window[c(1179)+c(426)]=void 0,n.RLQDA(o,c(238)+"reason")}})}function Fe(s,t,n){let o=r;return!!s?.[o(349)](c=>c.key===t&&c[o(450)]===n)}function at(s,t){let n=r;return s?.[n(349)](o=>o[n(226)]===t)?.[n(450)]}let Xn=null;async function e0(){let s=r;return Xn||(Xn=Promise[s(1164)]()[s(1115)](ve[s(433)](ve,e[s(242)]))),Xn}class t0 extends Vn{constructor(t,n){let o=r;super(),this[o(797)]=t,this[o(456)]=n,this._qosDB=void 0,this[o(699)+o(1528)]=null}async[r(499)](){await this[r(1493)]()}async[r(1493)](){let t=r,n={WAbBw:function(o){return e[O(817)](o)},Oqpqu:function(o,c,l,m){return e.ctljT(o,c,l,m)}};if(!this[t(1260)]){if(this[t(699)+t(1528)])return this[t(699)+t(1528)];try{let o=this[t(797)],c=this[t(456)];this[t(699)+"mise"]=(async()=>{let l=t,{openDB:m}=await n[l(487)](e0);this[l(1260)]=await n[l(206)](m,l(1179)+"_"+o,1,{upgrade(g){let d=l;g[d(1132)+d(1363)+"e"](o,{keyPath:c})}})})(),await this[t(699)+t(1528)]}catch(o){console[t(719)](o)}finally{this[t(699)+"mise"]=null}}}async[r(1174)](t){let n=r;try{return await this[n(1493)](),this[n(1260)]?.[n(1174)](this[n(797)],t)}catch(o){console.log(o)}}async[r(1474)](t,n){let o=r;return await this[o(1493)](),this._qosDB?.[o(848)](this[o(797)],t)}async[r(984)](t){let n=r;try{return await this[n(1493)](),this[n(1260)]?.[n(782)](this[n(797)],t)}catch(o){console[n(719)](o)}}async[r(222)](){let t=r,n={vppBP:function(o,c){return e[O(744)](o,c)}};try{return t(539)!=="ctPam"?(await this[t(1493)](),this[t(1260)]?.[t(222)](this[t(797)])):cqGMWR[t(1248)](_0x264df4.offset,_0xc64fef[t(342)])}catch(o){e.Wyqcw(e.GctGC,t(975))?console[t(719)](o):(_0x4ff520=_0x58d84a[e.mFPtH(_0x2b782f,_0x2424ec)+1],_0x123119=_0x498bb6[e[t(743)](_0x3550d4,_0x3738da)+2],_0x2f33a5=_0x3f3725[e.cyKoK(_0x39196c,_0x45e0a6)+3],e[t(1397)](e[t(1443)](e[t(1033)](_0x5dca41,e[t(1393)](_0x33765d,8)),e[t(522)](_0x12a57b,16))&12632256,8421504)?_0x4800cf+=_0x57e0e5:(_0x32c04f=e.vBTGG(e[t(237)](e.zvWPX(e[t(762)](e[t(773)](7,_0x807880),18),e[t(1427)](e.QgTbW(63,_0x488c23),12)),e[t(921)](63&_0x49a1c8,6)),e[t(309)](63,_0x4f6f8a)),e[t(1350)](_0x51862d,65536)||e.eUXJw(_0x5d7132,1114111)?_0x579bbc+=_0x526022:(_0x30d2c7-=65536,_0x2b1906+=e[t(1305)](_0x20e937,e.TWyky(e[t(460)](_0x305702,10),55296),e[t(1118)](1023,_0x579338)+56320),_0x5df484+=3)))}}async[r(1311)](){let t=r;return e[t(1114)](e[t(1043)],e.mbdSa)?(await this[t(1493)](),this[t(1260)]?.[t(1477)+"ys"](this._dbName)):!!this[t(1260)]}async[r(929)](){let t=r;return await this[t(1493)](),this[t(1260)]?.[t(929)](this[t(797)])}async[r(971)](){let t=r;try{this[t(1260)]?.close(),this[t(1260)]=void 0}catch(n){console.log(n)}}get isReady(){let t=r;try{return!!this[t(1260)]}catch(n){return console[t(719)](n),!1}}}class n0{constructor(t,n){let o=r;if(e[o(354)](e[o(438)],e[o(494)]))this._DBName=t,this._pathKey=n,this[o(1260)]=localStorage;else{if(this._ws&&this._ws[o(1379)+"te"]===this[o(1452)+"NG"]){this[o(715)+o(294)](),this[o(1170)+"gTimeoutId"]=_0x343aaf(this[o(1373)].bind(this),this._options[o(685)+o(1140)]);return}if(!this._ws||this[o(1193)][o(1379)+"te"]!==this[o(1339)])return void this[o(1342)+o(895)]();this[o(1193)]&&this[o(1193)].send("hi"),this["_reconne"+o(688)+"tId"]=_0x5c91f3(this[o(1342)+"econnect"+o(589)].bind(this),this[o(952)][o(278)+o(998)+o(447)])}}async[r(499)](){}get[r(854)](){let t=r,n={jvLch:function(o,c){return e[O(706)](o,c)},enuOD:function(o,c,l){return e.kDNDX(o,c,l)}};if(e[t(348)](e.KNlwn,"QAyqr"))n.jvLch(_0x5e8dad,this[t(1521)+"lTimeoutId"]),this[t(1521)+"lTimeoutId"]=n[t(788)](_0x347844,()=>{let o=t;this[o(1515)+o(793)]()},this[t(1521)+"l"]);else return t(1179)+"_"+this[t(953)]}async get(t){let n=r,o=this[n(1260)][n(1458)](this[n(854)]);return JSON.parse(e[n(869)](o,"{}"))[t]}async[r(1474)](t,n){let o=r,c=this[o(1260)].getItem(this[o(854)]),l=JSON[o(677)](e[o(1127)](c,"{}"));return l[n||t[this[o(1246)]]]=t,this[o(1260)][o(1473)](this[o(854)],JSON[o(1227)+"y"](l)),n||t[this[o(1246)]]}async del(t){let n=r,o=this[n(1260)].getItem(this._prefix),c=JSON[n(677)](e[n(995)](o,"{}"));return c[t]=void 0,this._qosDB.setItem(this[n(854)],JSON[n(1227)+"y"](c))}async[r(222)](){let t=r;return this[t(1260)][t(222)]()}async[r(1311)](){let t=r,n=this._qosDB[t(1458)](this[t(854)]),o=JSON[t(677)](n||"{}");return Object[t(1311)](o)}async[r(929)](){let t=r,n=this[t(1260)].getItem(this._prefix),o=JSON.parse(e.weGvL(n,"{}"));return Object.values(o)}[r(971)](){return Promise[r(1164)]()}get[r(1001)](){let t=r,n={DuQZS:e[t(994)],aCZSk:function(o,c,l){return o(c,l)}};if(e[t(484)](e[t(907)],e.NOZKP))return!!this[t(1260)];this[t(1185)](WchIyh[t(1468)],WchIyh[t(1403)](_0xc71797,WchIyh[t(1468)],{..._0x37ffb4}))}}class r0{constructor(t,n){let o=r;this._DBName=t,this._pathKey=n,this[o(1260)]=Je?tt:vt?wx:null}async[r(499)](){}get[r(854)](){let t=r;return t(1179)+"_"+this[t(953)]}async[r(1174)](t){let n=r,o=this[n(1260)]["getStora"+n(728)](this[n(854)]);return JSON[n(677)](e.VTnkO(o,"{}"))[t]}async[r(1474)](t,n){let o=r,c={rivBI:function(l,m){return l>=m}};if(e[o(790)](e.YbbER,o(1548)))return xHUmKi[o(778)](this[o(454)],this[o(436)+o(1322)]);{let l=this[o(1260)]["getStora"+o(728)](this[o(854)]),m=JSON[o(677)](l||"{}");return m[n||t[this._pathKey]]=t,this[o(1260)]["setStora"+o(728)](this[o(854)],JSON[o(1227)+"y"](m)),n||t[this[o(1246)]]}}async del(t){let n=r;if(e.MFnxM(e[n(506)],e[n(506)])){let o=this[n(1260)][n(126)+n(728)](this._prefix),c=_0x5e3edf.parse(o||"{}");return c[_0x29310c||_0x5d05f2[this._pathKey]]=_0x472f83,this[n(1260)][n(191)+n(728)](this._prefix,_0x260420.stringify(c)),_0x16e94c||_0x3833fc[this._pathKey]}else{let o=this._qosDB[n(126)+n(728)](this._prefix),c=JSON[n(677)](e.FiZNU(o,"{}"));return c[t]=void 0,this[n(1260)][n(191)+n(728)](this[n(854)],JSON[n(1227)+"y"](c))}}async[r(222)](){let t=r;return this[t(1260)][t(840)+t(1289)]()}async[r(1311)](){let t=r,n={KIXaj:function(o,c){return e[O(1096)](o,c)}};if(e[t(1317)](e[t(1421)],e[t(529)])){let o=this[t(1260)][t(126)+t(1487)+"nc"](this[t(854)]),c=JSON[t(677)](e[t(1563)](o,"{}"));return Object[t(1311)](c)}else{let o=this[t(1260)].getItem(this[t(854)]),c=_0x32aecf[t(677)](MqqBOt[t(554)](o,"{}"));return _0x48bd6f[t(370)](c)}}async[r(929)](){let t=r,n=this[t(1260)]["getStora"+t(1487)+"nc"](this._prefix),o=JSON[t(677)](e.GlYPz(n,"{}"));return Object[t(370)](o)}[r(971)](){return Promise.resolve()}get isReady(){return!!this[r(1260)]}}function hs(s,t){let n=r;if(e.YSAWF(Je,Je))return new r0(s,t);if(e[n(1318)](ot,St)&&n(629)+"d"!=typeof indexedDB)return new t0(s,t);if(e.LnTCZ(ot,St)&&e[n(624)](e[n(1233)],typeof localStorage))return new n0(s,t);throw new Error(e[n(1180)])}class s0{constructor(){let t=r;this[t(1521)+"lTimeoutId"]=null,this[t(1521)+"l"]=36e5,this[t(1260)]=hs(e[t(526)],t(137)+"id")}async[r(1521)+r(378)](){let t=r,n={vLYGI:e[t(159)],vsMeG:function(o,c){return e[t(614)](o,c)},vcYLy:e[t(1143)],IEXuG:t(1177)};e[t(1261)](clearInterval,this[t(1521)+t(944)+"Id"]),this[t(1521)+t(944)+"Id"]=e[t(1198)](setInterval,()=>{let o=t,c={jeYWl:function(l,m){return l!=m},LJrlP:n[o(585)],dXMBr:function(l,m){return l instanceof m},LIwLo:o(851)+o(414)};if(n[o(615)](n[o(1236)],n.IEXuG))this[o(1515)+"ired"]();else return ajBWZp.jeYWl(ajBWZp[o(413)],typeof _0x19dd94)&&(ajBWZp[o(553)](_0x4b065d,_0x45cfe7)||_0x42cfd1[o(1060)]&&ajBWZp[o(553)](_0x3e9ecb[o(1060)],_0x2583bd))||ajBWZp[o(1560)](ajBWZp.LJrlP,typeof _0x2b7a5e)?"":(_0x2872f0[o(677)](_0x4bd376),ajBWZp[o(704)])},this[t(1521)+"l"])}async openDB(){let t=r;await this[t(1260)][t(499)]()[t(1115)](()=>{let n=t,o={oHdIQ:e[n(408)]};e[n(245)](e[n(1064)],e[n(496)])?(this._isBrowser&&_0x2124cd[n(977)+n(597)+n(1017)]("pagehide",this[n(502)+"ageHide"]),this._isBrowser&&_0x206ac6[n(977)+n(597)+"ner"](o[n(835)],this[n(502)+n(658)]),this[n(476)]()):this[n(1521)+"lFlush"]()})}async[r(1515)+r(793)](){let t=r;if(e[t(948)]!==e[t(651)])(await this[t(1260)]?.[t(929)]()||[])[t(463)](({timestamp:c})=>c<Date.now()).forEach(c=>{let l=t;this[l(1260)]?.[l(984)](c[l(137)+"id"])});else{let n=_0x5974b9[t(1156)]&&_0x4098a2[0];if(e.EGppy(n,_0x327bc5))throw n;let o=new _0x34a803(e[t(521)](e[t(1375)],n?e[t(1309)](" (",n[t(1314)])+")":""));throw o[t(618)]=n,n}}async[r(984)](t){let n=r;return this[n(1260)]?.[n(984)](t)}async[r(1474)](t,n){let o=r;return this._qosDB?.[o(1474)]({message_id:t,timestamp:n})}async[r(1174)](t){return this._qosDB?.get(t)}async[r(971)](){let t=r;e[t(1303)](clearInterval,this[t(1521)+"lTimeoutId"]),await this[t(1260)]?.closeDB()}get[r(1001)](){let t=r;return this[t(1260)]?.[t(1001)]}}function $n(s){let t=r,n=!!this[t(952)][t(1412)+"S"];if(!n)return{enabled:n,isQoSMessage:!1,isQoSAck:!1,isAckCleanupMessage:!1,ackMsgIds:[]};let o=e.vwskh(Fe,s[t(1314)][t(1437)],e[t(165)],"2"),c=o&&e[t(535)](Fe,s[t(1314)][t(1437)],t(347)+t(947)+"ck","1"),l=o&&e[t(1404)](Fe,s.message[t(1437)],e[t(316)],"1"),m=l?e[t(863)](at,s[t(1314)][t(1437)],e.dtUQb)?.[t(1219)](",")[t(463)](Boolean)||[]:[];return{enabled:n,isQoSMessage:o,isQoSAck:c,isAckCleanupMessage:l,ackMsgIds:m}}async function gs(){let s=r;return this[s(1301)+"ger"]||(this[s(1301)+"ger"]=new s0),this[s(1301)+"ger"][s(1001)]||await this._QoSManager[s(499)](),this[s(1301)+s(1264)]}async function i0(s,t){let n=r;if(e[n(1039)](e.dUptJ,e[n(1486)])){let{enableAutoAck:o}=this._options,c=e[n(535)](Fe,s[n(1314)][n(1437)],n(577),"1"),l=Fe(s.message[n(1437)],e[n(729)],"1"),m=$n[n(480)](this,s);if(e[n(491)](o,c)){let{SeqID:g,LogID:d,service:_,LogIDNew:v,method:C}=s.message;this[n(1530)]({SeqID:g,LogID:d,LogIDNew:v,service:_,method:C,headers:[{key:e[n(729)],value:"1"},{key:e[n(290)],value:e[n(1563)](v,"")},{key:e[n(536)],value:"0"}]})}l&&!m[n(687)]&&this[n(1319)+n(1214)+n(143)](s),e[n(969)](t)}else{if(this._options["disableA"+n(1172)+n(1150)]||this["_readyCl"+n(1133)])return;this[n(1342)+n(895)]()}}async function o0(s,t){let n=r;this[n(777)](e[n(1324)],s[n(1314)]),e[n(1310)](t)}async function a0(s,t){let n=r,o={stnvc:function(c,l,m){return e[O(877)](c,l,m)}};if(e[n(765)]===n(960)){let c=e[n(1303)](Xr,await e[n(748)](ls,s[n(1163)]));try{if(c[n(720)]instanceof Uint8Array){let l=this[n(952)][n(943)+n(534)]instanceof Object?{force:!!this._options["payloadE"+n(534)][n(1240)],encoding:this[n(952)][n(943)+n(534)].encoding?this._options[n(943)+"ncoding"].encoding[n(211)](/\s/g,"")["toLowerC"+n(857)]():""}:{force:!1,encoding:this[n(952)][n(943)+"ncoding"]?this._options[n(943)+n(534)][n(211)](/\s/g,"")[n(395)+n(857)]():""},m=c["payloadE"+n(534)]?c[n(943)+n(534)][n(211)](/\s/g,"")[n(395)+"ase"]():"",g=e[n(654)](this[n(952)]["payloadT"+n(477)],Object)?{force:!!this[n(952)][n(1387)+n(477)][n(1240)],type:this._options[n(1387)+"ype"][n(523)]?this[n(952)].payloadType[n(523)][n(211)](/\s/g,"")[n(395)+n(857)]():""}:{force:!1,type:this[n(952)][n(1387)+"ype"]?this._options.payloadType.replace(/\s/g,"")["toLowerC"+n(857)]():""},d=c[n(1387)+n(477)]?c[n(1387)+n(477)].replace(/\s/g,"")[n(395)+n(857)]():"",_=g[n(1240)]?g[n(523)]:d||g[n(523)],v=l[n(1240)]?l.encoding:m||l[n(1286)],C=[e.HeVjv,n(851)+"ion/json","applicat"+n(414)+n(1585)+n(1242),n(668)],k=[e[n(1552)],"binary"];this[n(952)]["enableTr"+n(732)+n(125)+"ad"]&&C.includes(_)&&(!v||k[n(735)](v))?c[n(842)+n(764)]=e[n(174)](ds,c[n(720)],0,c[n(720)][n(742)+"th"]):c[n(842)+n(764)]=""}else c["textPayl"+n(764)]=""}catch(l){e.yvpdP(e[n(938)],e[n(938)])?(AanyUh[n(1535)](_0xfb49f4,_0x1a7c01,90),AanyUh[n(1535)](_0x50c617,_0x5a08b7,_0x514f72)):(c[n(842)+n(764)]="",console.log(l))}s[n(1314)]=c,e[n(486)](t)}else{let c=_0x8c444c.bytes,l=_0x36d0bf[n(342)];return c[n(1156)]===l?c:c[n(1173)](0,l)}}function x0(s,t,n){let o=r;if(e.ysDrb(o(579),o(579)))_0x1cb451["frontier"+o(426)]=void 0,_0x3091b4(o(238)+o(786));else{let c=e[o(869)](n,8192),l=e[o(1091)](c,1),m=null,g=c;return function(d){let _=o;if(d<1||e[_(1134)](d,l))return e[_(862)](s,d);e[_(672)](e.TMwrS(g,d),c)&&(m=s(c),g=0);let v=t.call(m,g,g+=d);return e[_(1595)](7,g)&&(g=e[_(1018)](7|g,1)),v}}}let c0=4294967295;function f0(s,t,n){let o=r;return e[o(1302)](RangeError,e.GnNZl(o(1046)+"t of ran"+o(700)+s+e.GluWf+e[o(146)](t,1)+e[o(1141)],n))}function u0(s,t,n){let o=r;if(e.mhuyD(n,c0))throw new Error(e.mscLe);let c=3;for(;c>=0;){let l=255&n;Qn(l,s,e[o(465)](t,c)),n>>>=8,c--}return t+4}function d0(s,t){let n=r,o=0,c=t,l=e[n(1058)](t,4);for(;e[n(1444)](c,l);){let{value:m,offset:g}=e.lHAKZ(Zn,s,c);c=g,o=e[n(1038)](e.FJHvC(o,8),0),o+=m}return{value:o,offset:l}}function l0(s,t,n){let o=r,c="3|2|0|1|4"[o(1219)]("|"),l=0;for(;;){switch(c[l++]){case"0":if(t[o(479)+"e"])return e.xjUtl(t.utf8Write(s,n),n);continue;case"1":if(t[o(827)])return e.qkzgO(t.write(s,n),n);continue;case"2":if(e[o(769)](s[o(1156)],40))return e[o(1309)](Yn(s,t,n),n);continue;case"3":if(!s)return n;continue;case"4":return e.dEnqL(Yn,s,t,n)+n}break}}function h0(s,t){let n=r,o=new M(e[n(1443)](e.vBTGG(e[n(757)](e[n(681)](s[e[n(1333)](t,4)],24),e.xIdKk(s[e[n(1018)](t,5)],16)),s[e[n(1432)](t,6)]<<8),s[e[n(167)](t,7)]),e.oQjpc(e[n(129)](e[n(1245)](e[n(681)](s[e[n(696)](t,0)],24),e[n(1489)](s[t+1],16)),e[n(287)](s[e.UxzoR(t,2)],8)),s[t+3]),!0);return t+=8,{value:o,offset:e.tVLKw(t,8)}}function g0(s,t,n){let o=r,c=s[o(1424)],l=s[o(1023)];return t[n]=e[o(1014)](l,24),t[e[o(1018)](n,1)]=e[o(917)](e[o(1152)](l,16),255),t[e.ffmOY(n,2)]=e[o(981)](e[o(663)](l,8),255),t[n+3]=e[o(1041)](255,l),t[e[o(695)](n,4)]=e[o(546)](c,24),t[e[o(1019)](n,5)]=e[o(1340)](c,16)&255,t[e[o(1181)](n,6)]=e[o(1542)](e[o(292)](c,8),255),t[n+7]=255&c,n+=8,n}function Zn(s,t){let n=r;return s[n(220)+"8"]?{value:s.readUInt8(t),offset:e[n(1210)](t,1)}:{value:e[n(1587)](255,s[t]),offset:e[n(613)](t,1)}}function Qn(s,t,n){let o=r;return t.writeUint8?t[o(1255)+"t8"](s,n):t[n]=e.mPwKk(255,s),e.PGIcp(n,1)}let p0=function(s){return new Uint8Array(s)},m0=e[r(1233)]!=typeof Buffer?Buffer[r(468)+r(209)]:e.RCBAs(x0,p0,Uint8Array[r(257)+"e"][r(1173)]),w0=16,er=32;function _0(s){let t=r,n=0,o={};for(let c=0;e[t(253)](c,s[t(1156)]);c++)o[s[c]["cursor_n"+t(517)]]=e[t(767)](us,s[c][t(528)+"ame"]),n+=14+o[s[c][t(528)+t(517)]];return[n,o]}function ps(s,t,n){let o=r,c={UzgWU:e[o(1057)],eemyn:function(_,v,C,k){return _(v,C,k)},Htilk:e.TdqQN,plCyW:e[o(1514)],BGQyZ:function(_,v,C,k){return e.cNLmM(_,v,C,k)},wKCuZ:e[o(723)],nMsuY:function(_,v,C,k){return e.vwskh(_,v,C,k)},fepAj:o(634)},[l,m]=e[o(455)](_0,s),g=m0(l),d=0;return s[o(457)](_=>{let v=o;console.log(c[v(351)],_,_[v(1543)]),d=c[v(396)](Qn,0,g,d),console[v(719)](c[v(1544)],d),d=c[v(396)](u0,g,d,_[v(1543)]||0),console[v(719)](c.plCyW,d),d=c[v(836)](Qn,m[_[v(528)+v(517)]],g,d),console[v(719)](c[v(1083)],d),d=c[v(396)](l0,_[v(528)+v(517)],g,d),console.log(v(1101),d),d=c[v(1138)](g0,M[v(919)+"er"](_.cursor||t),g,d),console.log(c[v(1345)],d)}),{frameType:er,headers:[{key:o(1223)+o(721),value:n}],payload:g}}function y0(s){let t=r,n=0,o=[];for(;e[t(508)](n,s[t(742)+"th"]);){let{offset:c}=e[t(1036)](Zn,s,n);n=c;let l={cursor_name:"",cursor:0,service:0},{value:m,offset:g}=e[t(745)](d0,s,n);l[t(1543)]=m,n=g;let{value:d,offset:_}=Zn(s,n);n=_,l[t(528)+t(517)]=e.Xkpka(ds,s,n,e[t(1575)](n,d)),n+=d;let{value:v,offset:C}=e[t(1198)](h0,s,n);l.cursor=v.toNumber(),n=C,o[t(157)](l)}return o}function b0(){let s=r;return{frameType:er,headers:[{key:e.TJdtG,value:"FILE_NOT"+s(1275)}],payload:void 0}}class v0{constructor(t,n,o){let c=r;this[c(124)+c(1089)]=t,this._cursorFileName=n,this[c(812)+c(796)]=o,this[c(1260)]=e.lHAKZ(hs,this._cursorNameSpace,e[c(612)])}async openDB(){let t=r;await this[t(1260)][t(499)]()}async[r(780)+"rs"](){let t=r;if(!this[t(1260)].isReady)return;let n=this[t(812)+t(796)],o=await this[t(1260)].getAll();switch(console[t(719)]("allCurso"+t(334),o),n){case e[t(135)]:return o&&o[t(1156)]?e[t(910)](ps,o,0,this["_cursorF"+t(549)]):void 0;case e[t(1056)]:return;case e[t(260)]:return o&&o[t(1156)]?e[t(174)](ps,o,0,this[t(1239)+"ileName"]):e[t(486)](b0)}}async[r(1474)](t,n,o){let c=r;return console[c(719)](e[c(114)],t,n,o),this[c(1260)][c(1474)]({cursor_name:t,cursor:n,service:o})}async setCursors(t){let n=r,o=e[n(455)](y0,t);for(let c of o)console[n(719)](e.dfeWh,o),await this[n(1260)][n(1474)](c)}async[r(1174)](t){let n=r;return(await this[n(1260)][n(1174)](t))?.cursor}async[r(971)](){let t=r;e.qHgFI(e[t(1461)],t(1519))?await this[t(1260)].closeDB():_0x47a4da[t(719)](_0x5f20a4)}[r(1372)+r(1561)+r(810)](t){let n=r;if(n(626)!==e[n(121)])this[n(1239)+n(549)]=t;else return _0x265215[n(719)](e[n(114)],_0x28ca8a,_0x23da39,_0x25a46e),this[n(1260)][n(1474)]({cursor_name:_0x15fb52,cursor:_0x2d8dd5,service:_0x4c4547})}get[r(1001)](){return this._qosDB.isReady}}let S0=e.ahwxq;async function ms(s){let t=r,n={PpLDy:e[t(1268)],ysUvC:function(g,d){return g===d},EbzMv:e[t(1054)],UNMFn:function(g,d){return e[t(258)](g,d)},PrWAJ:function(g,d){return e[t(1488)](g,d)}};if(!this[t(952)][t(1412)+"S"])return null;let{aID:o,fpID:c,messageStrategy:l}=this[t(952)],m=e[t(1318)](s,S0);try{if(e[t(711)](e[t(1374)],e[t(1374)]))return this[t(1207)+t(853)]?s&&this[t(1207)+"anager"][t(1372)+"rsorFile"+t(810)](s):this[t(1207)+t(853)]=new v0(c+"_"+o+"_"+m,m,l),this["_cursorM"+t(853)].isReady||await this[t(1207)+t(853)][t(499)](),this[t(1207)+t(853)];{let g=(t(461)+t(1425))[t(1219)]("|"),d=0;for(;;){switch(g[d++]){case"0":this[t(901)+t(1178)+t(1499)]();continue;case"1":this[t(749)+"mer"]();continue;case"2":this["_readyCl"+t(1133)]=!0;continue;case"3":if(!this[t(1193)])return void this[t(777)](n[t(611)]);continue;case"4":if(n[t(888)](this._ws.readyState,this[t(317)])||n[t(888)](this[t(1193)][t(1379)+"te"],this.CLOSING))return void this[t(777)](n[t(1257)]);continue;case"5":this[t(715)+t(294)]();continue;case"6":this[t(464)+t(1291)+"t"](_0x389122,_0x5283e2);continue;case"7":this["_QoSMana"+t(1264)]?.closeDB();continue}break}}}catch{if(e[t(1114)]("VMUXe",t(970))){let g=_0x3b4a8f(_0x1162b2,_0x3a9211[t(342)]),d=_0x3756d4[t(987)],_=_0x3cad99.bytes;for(let v=0,C=_0x29f625[t(342)];zaFnIq[t(662)](v,C);v++)d[zaFnIq[t(371)](v,g)]=_[v]}else return null}}async function C0(s,t){let n=r,o=e[n(535)](Fe,s.message[n(1437)],e.yKKss,"-1"),c=Fe(s[n(1314)][n(1437)],e[n(729)],"1"),l=e.JyxzF(at,s.message.headers,e[n(335)]),m=e[n(446)](Number,e[n(1198)](at,s[n(1314)].headers,e.bTRhM))||0,g=$n[n(480)](this,s),d=e[n(1512)](Fe,s.message.headers,e.AuKWD,"2"),_=e[n(1153)](at,s[n(1314)].headers,e[n(1121)]),v=e.fyfOU(Number,at(s[n(1314)][n(1437)],e[n(770)]));if(g[n(687)])return t();let C=g[n(891)+"sage"]?await gs[n(480)](this):null;if(e[n(360)](s[n(1314)][n(1543)],0)&&c&&!o||e[n(1508)](s[n(1314)].service,0)){if(l&&g[n(891)+"sage"]&&C){if(!!!await C[n(1174)](l))if(e[n(1003)]!==e[n(1423)])this[n(1319)+n(1031)+"Event"](s),await C.set(l,Date[n(604)]()+m);else{let{offset:R}=e.XfTJd(_0x314410,_0xdaaa87,_0x157521);_0x40beef=R;let B={cursor_name:"",cursor:0,service:0},{value:Y,offset:me}=e[n(1024)](_0x386f6d,_0x59d93f,_0x3d4444);B[n(1543)]=Y,_0x7d244c=me;let{value:X,offset:qt}=e[n(356)](_0x2b877d,_0x516d04,_0x166e82);_0x3e8dbf=qt,B["cursor_n"+n(517)]=e[n(978)](_0x2c9c66,_0x3ab467,_0x5e2542,e[n(1058)](_0x3d65b0,X)),_0x59801a+=X;let{value:tr,offset:nr}=_0x24e40f(_0x57c5cf,_0x195463);B[n(169)]=tr[n(558)](),_0x1d4bb3=nr,_0x1bb890[n(157)](B)}return t()}if(d){let k=await ms[n(480)](this);if(!k)return this["_dispatc"+n(1031)+n(1158)](s),e.EWTAh(t);let R=await k[n(1174)](_)??-1;if(R<v)this[n(1319)+n(1031)+n(1158)](s),k[n(1474)](_,v,s[n(1314)].service);else throw new Error("recevied"+n(1578)+n(1205)+v+(n(1071)+n(831)+n(958)+"r ")+R);return t()}return this[n(1319)+n(1031)+n(1158)](s),e[n(1433)](t)}}async function E0(s,t){let n=r,o=$n[n(480)](this,s);if(!o["isQoSMes"+n(421)])return t();let c=await gs[n(480)](this);if(o[n(1204)+n(627)+n(1304)]&&o[n(1569)+"s"].length)for(let l of o[n(1569)+"s"])await c[n(984)](l);e[n(969)](t)}async function A0(s,t){let n=r,o=e.AVvRS(s[n(1314)][n(822)+"e"],w0),c=e.WcUyd(s[n(1314)][n(822)+"e"],er);if(e[n(491)](!o,!c))return e[n(1433)](t);let l=e[n(458)](at,s.message[n(1437)],e[n(1378)]);if(!l)return e.Ndknb(t);let m=await ms.call(this,l);if(!m)return t();if(o){let g=await m[n(780)+"rs"](),d={frameType:g?.[n(822)+"e"],SeqID:M[n(919)+"er"](this[n(1491)]++),LogID:M[n(919)+"er"](this[n(952)]["logIDGen"+n(932)]()),service:9e3,method:5,headers:g?.[n(1437)],payload:g?.[n(720)]},_=e[n(175)](E,d);this._ws&&this[n(1193)][n(1379)+"te"]&&this[n(1193)][n(1262)](_)}if(c){let g=s[n(1314)][n(720)];g&&m[n(262)+"rs"](g)}}let D0=async function(s,t){let n=r;this[n(275)]=!1,e[n(1303)](clearTimeout,this[n(920)+n(490)+n(1365)]),e[n(1256)](t)},k0=async function(s,t){let n=r;if(!this[n(1193)]||this[n(1193)][n(1379)+"te"]!==this[n(1339)])return e[n(817)](t);let{pingInterval:o}=this[n(952)];this[n(642)+n(1347)]?.["resetEnd"+n(196)+"fig"]();for(let l=0;e[n(950)](l,this[n(812)+"Queue"][n(1156)]);l++){let m=this[n(812)+"Queue"][l];if(this._ws.readyState===this[n(1339)]&&e[n(1157)](null,m))this[n(1193)]&&this._ws[n(1262)](m),this[n(812)+"Queue"][l]=null;else break}this[n(812)+"Queue"]=this._messageQueue.filter(l=>!!l),this[n(1170)+n(1218)+"Id"]=e[n(1153)](setTimeout,()=>this[n(1373)](),o),this[n(1319)+n(304)+"nt"](s),this._isBrowser&&this._ws&&(this[n(1193)][n(1108)+"pe"]=this["_binaryT"+n(477)]);let c=this[n(642)+n(1347)]?.[n(1100)+n(1059)+"nt"]();this[n(777)]("open "+c+" success"),e[n(807)](t)},P0=async function(s,t){let n=r,o=this["_endpoin"+n(1347)]?.[n(1100)+n(1059)+"nt"]();this._debug(n(686)+o),e[n(154)](t)};class I0 extends Vn{constructor(t){let n=r,o={BhoFW:function(g,d){return e[O(320)](g,d)},ELzHG:function(g,d){return e[O(451)](g,d)},zaTbq:function(g,d){return g===d},RvPVw:e[n(1583)],lQtbh:e[n(417)],mDvEc:function(g,d,_){return e.isLlA(g,d,_)},xDKOB:function(g,d,_,v){return e[n(1074)](g,d,_,v)},GJuEO:e[n(365)]};super(),this[n(1266)+n(243)+n(410)]=!0,this[n(531)+"er"]=ot,this._isNode=Go,this[n(305)+"T"]=Je,this._isMiniWX=vt,this[n(1422)+"r"]=St,this[n(812)+n(1312)]=[],this[n(642)+n(1347)]=null,this[n(1368)+"osed"]=!1,this["_binaryT"+n(477)]=e[n(1093)],this["_connect"+n(1073)]=!1,this[n(920)+n(490)+"utId"]=null,this[n(675)+n(688)+"tId"]=null,this._pingPongTimeoutId=null,this[n(1491)]=0,this[n(275)]=!1,this[n(471)]="",this[n(1301)+n(1264)]=null,this[n(1207)+"anager"]=null,this[n(1513)+n(783)]=null,this[n(357)+"ls"]=e[n(1119)],this[n(317)]=3,this[n(1452)+"NG"]=0,this.OPEN=1,this[n(636)]=2,this[n(1495)]=g=>{let d=n;try{e[d(1511)](fs,this,g,[D0,k0,P0])}catch(_){let v=ue(e.ktpdF,{message:_[d(1314)],code:qe[d(339)+"OR"],error:_});this[d(1319)+d(1168)+d(1522)](v)}},this[n(751)+"ge"]=async g=>{let d=n,{pingInterval:_,pingFrequency:v}=this[d(952)];if((o.BhoFW("hi",g.data)&&o[d(1582)](d(1011),v)||o[d(1346)](d(366),v))&&(this[d(715)+d(294)](),this[d(1185)](o[d(1269)],o[d(249)]),this[d(1170)+"gTimeoutId"]=o[d(213)](setTimeout,this[d(1373)].bind(this),_)),g.data!=="hi")try{o[d(368)](fs,this,g,[a0,i0,E0,A0,C0,o0])}catch(C){let k=ue(o[d(833)],{message:C.message,code:qe[d(1229)+d(955)],error:C});this[d(1319)+d(1168)+d(1522)](k)}},this._onError=g=>{let d=n,_={HEpDB:d(321),HMJyA:e[d(551)]};if(e[d(298)]!=="gJHZK"){if(!this[d(1193)])return;this["_destroy"+d(1291)+"t"](_0x131d7f,_0x30325b,_0x5a1000)}else{let v=this[d(642)+d(1347)]?.["checkRea"+d(1410)+"es"](),C=this[d(642)+d(1347)]?.[d(1100)+"ntEndpoint"]();if(v&&!g[d(1314)])if(e[d(1166)](e.snvod,d(483)))_0x2191b5[d(977)+d(597)+d(1017)](d(280),_0x534a7b),_0x3fc1d0["removeEv"+d(597)+d(1017)](OMiKCg[d(887)],_0x4c48e5),_0xfcb753[d(977)+"entListe"+d(1017)](OMiKCg[d(935)],_0x145191);else{let k=d(542)+C+(" fail, m"+d(1441)+"es reached");this[d(1319)+d(1168)+d(1522)](ue(e[d(365)],{message:k,code:qe[d(1267)+d(1445)+"R"],error:g}));return}this._ws&&e[d(1341)](this[d(1193)].readyState,this[d(1339)])&&this[d(1020)+d(1124)](),this["_dispatchErrorEv"+d(1522)](e[d(458)](ue,e.ktpdF,{message:g[d(1314)],code:qe[d(1293)+d(1475)],error:g}))}},this[n(1524)]=async g=>{let d=n;this[d(749)+d(1550)](),this._clearPingTimer(),this[d(939)+d(1102)+"rs"](),this[d(1193)]=null,this[d(920)+d(1073)]=!1;let _=this[d(642)+d(1347)]?.checkReachMaxTries();if(!_&&this[d(866)+d(372)]()&&!this["_readyCl"+d(1133)]){let v=this[d(642)+d(1347)]?.[d(1100)+"ntEndpoint"](),C=this[d(952)][d(225)+d(319)+"ptor"](g[d(603)],g[d(786)]);this[d(1319)+"hCloseEv"+d(1522)](e[d(674)](pe,e[d(994)],{code:1006,reason:g[d(786)]||d(153)+d(1237)+d(1581)+d(922)+d(352)+"ame: "+v,willReconnect:C})),C&&this[d(920)]();return}if(e.WMWJE(1e3,g[d(603)])&&this["_readyCl"+d(1133)]){this[d(1319)+d(899)+d(1522)](pe(e[d(994)],{code:1e3,reason:e.hkIDh})),this["_endpoin"+d(1347)]?.[d(1042)+d(196)+d(228)](),this[d(1513)+d(783)]?.resetCounter();return}if(e.qTfvl(1e3,g[d(603)])&&_){let v=this["_endpoin"+d(1347)]?.["getCurre"+d(1059)+"nt"](),C=g.reason;C||(C=await e.fyfOU(Qo,this._url)),C=d(153)+d(1237)+d(852)+C+(d(795)+d(665))+v+(d(1401)+"tries re"+d(1562)),this[d(1319)+d(899)+d(1522)](e[d(1258)](pe,e[d(994)],{code:g[d(603)],reason:C}));let k=d(542)+v+(" fail, m"+d(1441)+d(1525)+"ed");this[d(1319)+d(1168)+d(1522)](ue("error",{message:k,code:qe[d(1267)+d(1445)+"R"]})),this["_endpoin"+d(1347)]?.[d(1042)+"pointConfig"](),this[d(1513)+d(783)]?.[d(1388)+d(195)]();return}if(e[d(661)](1e3,g[d(603)])&&!g[d(786)]){let v=this["_endpoin"+d(1347)]?.[d(1100)+d(1059)+"nt"]();this["_dispatc"+d(899)+d(1522)](pe(e[d(994)],{code:g.code,reason:"connecti"+d(1237)+d(1581)+d(922)+d(352)+"ame: "+v})),this["_endpoin"+d(1347)]?.resetEndpointConfig(),this[d(1513)+d(783)]?.[d(1388)+d(195)]();return}this["_dispatc"+d(899)+"ent"](g),this[d(642)+d(1347)]?.[d(1042)+"pointCon"+d(228)](),this["_pingLos"+d(783)]?.[d(1388)+d(195)]()},this[n(884)]=null,this[n(802)]=null,this.onmessage=null,this[n(607)]=null,this[n(1469)+"econnect"]=null,this[n(683)+n(1400)]=null,this[n(844)+n(407)+n(1390)+"ct"]=null,this[n(141)+n(1050)]=this[n(141)+n(1050)][n(433)](this),this._handleOffLine=this[n(141)+n(482)].bind(this),this[n(502)+n(330)]=this[n(502)+n(330)][n(433)](this),this._handlePageShow=this[n(502)+n(658)].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(1212)],pingLossCount:2,enableTransformTextPayload:!1,logIDNewConfig:{enableAutoGenerateLogIDNew:!1,userIp:""},miniProgramParams:{customHttpHeader:{}},enableAutoAck:!1,reconnectInterceptor:()=>!0,enableQoS:!1,QoSLevel:2,messageStrategy:e[n(260)],env:{xTTEnv:"",xUseEnv:""},listenNetworkChanged:!0};let{url:c,ws:l}=t,m=Array[n(623)](c)?c:e[n(411)](e[n(159)],typeof c)?[c]:[];if(!m||e[n(1573)](0,m[n(1156)]))throw new Error(e[n(609)]);if(!e[n(424)](Yo,l))throw new Error("please p"+n(188)+"s params, WebSoc"+n(893)+n(434)+n(569)+n(911));Object[n(1300)](this._options,t),this[n(642)+"tManager"]=new cs(m,this._options.maxRetries),this[n(1513)+"sCounter"]=new Zo(this[n(952)][n(509)+n(359)]),this[n(952)]["automati"+n(180)]&&(e[n(489)](e[n(344)],e.NEkhN)?(this[n(256)]=!0,this[n(1424)]=e[n(1250)](0,_0x29587b),this.high=0|_0x4d9676,this[n(1062)]=!!_0x256f7c):(this[n(275)]=!0,this[n(920)]())),this[n(952)]["listenNe"+n(362)+n(1243)]&&(this[n(305)+"T"]||this._isMiniWX?this[n(1175)+n(388)+n(1503)]():this[n(531)+"er"]&&this[n(498)+"balEvent"+n(1499)]())}["_handleO"+r(1050)](){let t=r;this[t(952)][t(590)+t(1172)+t(1150)]||this["_readyCl"+t(1133)]||this["_handleR"+t(895)]()}[r(141)+r(482)](){let t=r;this[t(464)+t(1291)+"t"]();let n=e[t(745)](Jn,t(225)+"t",{message:e[t(116)]});this["onStopIm"+t(407)+t(1390)+"ct"]&&this[t(844)+"mediatelyReconnect"](n)}[r(498)+"balEventListener"](){let t=r;this[t(531)+"er"]&&window["addEvent"+t(1499)](e[t(537)],this[t(141)+t(1050)]),this[t(531)+"er"]&&window["addEvent"+t(1499)](e[t(1188)],this[t(141)+"ffLine"]),this[t(531)+"er"]&&window[t(727)+t(1499)](e[t(814)],this[t(502)+t(330)]),this._isBrowser&&window[t(727)+t(1499)](e.BagOO,this[t(502)+t(658)])}[r(901)+r(1178)+r(1499)](){let t=r;this._isBrowser&&window["removeEv"+t(597)+t(1017)](e[t(537)],this["_handleO"+t(1050)]),this[t(531)+"er"]&&window[t(977)+t(597)+"ner"](e.QYtdJ,this[t(141)+t(482)]),this[t(531)+"er"]&&window["removeEv"+t(597)+"ner"](e[t(814)],this[t(502)+t(330)]),this._isBrowser&&window[t(977)+t(597)+"ner"](e[t(408)],this[t(502)+t(658)])}[r(502)+r(330)](t){let n=r,o={ERHKd:function(c,l){return e[O(364)](c,l)}};if(e.hwtBB===e.ZBWiE){let c=this[n(1260)]["getStora"+n(1487)+"nc"](this._prefix),l=_0x382180[n(677)](YsKhLA[n(1321)](c,"{}"));return _0x319571[n(1311)](l)}else!t.persisted&&(this[n(531)+"er"]&&window[n(977)+"entListe"+n(1017)](e[n(814)],this[n(502)+"ageHide"]),this[n(531)+"er"]&&window[n(977)+n(597)+n(1017)](e[n(408)],this[n(502)+"ageShow"]),this[n(476)]()),this._isBrowser&&window[n(977)+n(597)+n(1017)](e[n(537)],this[n(141)+n(1050)]),this._isBrowser&&window[n(977)+n(597)+"ner"]("offline",this[n(141)+"ffLine"])}_handlePageShow(t){let n=r;n(1131)===e[n(230)]?_0x5852de.o=(o,c)=>_0x5dc92f[n(257)+"e"]["hasOwnPr"+n(418)][n(480)](o,c):t[n(268)+"d"]&&(this[n(866)+n(372)]()&&(!this[n(1193)]||e[n(1095)](this[n(1193)][n(1379)+"te"],this[n(1339)])||e[n(1199)](this[n(1193)][n(1379)+"te"],this[n(1452)+"NG"]))&&this[n(141)+"nLine"](),this[n(531)+"er"]&&window.addEventListener(n(584),this[n(141)+n(1050)]),this[n(531)+"er"]&&window[n(727)+n(1499)](e[n(1188)],this._handleOffLine))}async[r(1492)+r(338)](t){let n=r,{fpID:o,deviceID:c,bddID:l,ttwID:m,accessKey:g,aID:d,customParams:_={},enableAutoAck:v,enableQoS:C,QoSLevel:k,env:R}=this[n(952)],B,Y,me;this[n(531)+"er"]||this[n(1197)+"X"]||this._isMiniTT?(B=location&&e[n(838)]("https:",location[n(986)])?e.aeivL:n(702),Y=t[n(211)](/((^ws)|(^http))((?:[s]*:\/\/))/,""),me=/^wss(.*:\/\/)/[n(1215)](t)?t:""+B+Y):e[n(961)](n(255),e[n(870)])?_0x35bac5=_0x2e8c62(_0x4e82cc):(B=e[n(377)],Y=t[n(211)](/(^http)((?:[s]*:\/\/))/,""),me=/(^ws)((?:[s]*:\/\/))/[n(1215)](Y)?Y:""+B+Y);let X=l?e[n(1534)]:m?e[n(1460)]:e[n(363)],qt=l||m||c;if(e[n(869)](!qt,!X))throw new Error(e.mKLww);let tr=e.crQIo(e[n(725)],typeof _)?await e[n(807)](_):_,nr=R?e[n(1454)]($o,R[n(843)],R[n(1462)]):{},rr=Object.assign({device_platform:"web",version_code:e[n(845)],access_key:g,fpid:o,aid:d,[X]:qt,xsack:v?1:0,xaack:v?1:0,xsqos:C?1:0,qos_level:C?k:void 0,qos_sdk_version:2,...nr},tr),T0=Object[n(1311)](rr)[n(633)]((sr,ir)=>rr[ir]!==void 0?""+sr+(sr?"&":"?")+ir+"="+rr[ir]:sr,"");return me+n(466)+T0}async[r(920)](){let t=r;if(!(this[t(920)+"Lock"]||this[t(1368)+"osed"])){this[t(920)+t(1073)]=!0;try{let n=this["_endpoin"+t(1347)]?.[t(791)+t(839)+t(1377)+t(1217)+t(710)](),{timeoutInterval:o}=this._options;if(n){let l=this[t(642)+"tManager"]?.["getCurre"+t(1059)+"nt"](),m=this[t(642)+t(1347)]?.[t(787)+t(302)+t(431)+"UpdateCo"+t(660)](),g=this[t(642)+t(1347)]?.[t(1100)+t(1059)+t(300)+t(1322)]();if(m){let d=t(542)+l+(t(680)+", max retries re"+t(1484)+t(1231)+t(1135)+t(942))+m+" to retry",_=e[t(384)](ue,e[t(365)],{message:d,code:qe[t(1267)+t(1445)+"R"]});this[t(777)](d),this[t(1319)+t(1168)+t(1522)](_),this[t(471)]=await this[t(1492)+t(338)](m),this[t(777)](t(542)+m+" "+g+t(1580)),this[t(939)+t(1102)+"rs"]()}else{let d=t(542)+l+(" timeout, max retries re"+t(1562));this[t(777)](d),this[t(1319)+t(1168)+t(1522)](e[t(877)](ue,e[t(365)],{message:d,code:qe.MAX_RETRIES_ERROR}));return}}else{let l=this["_endpoin"+t(1347)]?.["getCurre"+t(1059)+t(775)+t(251)](),m=this[t(642)+t(1347)]?.[t(1100)+t(1059)+t(300)+t(1322)]();this[t(471)]=await this[t(1492)+"eUrl"](e.VQhGy(l,"")),this[t(777)](t(542)+l+" "+m+t(1580)),this[t(939)+t(1102)+"rs"]()}if(this[t(275)])this[t(275)]=!1;else{let l=e.oBXox(Jn,e.QJDCy,{message:e[t(705)]});this[t(1469)+"econnect"]&&this[t(1469)+t(895)](l)}let c=this["_endpoin"+t(1347)]?.["getCurre"+t(1059)+t(300)+t(1322)]()||0;e.VKFbe(c,1)&&await this[t(568)](c-1),this[t(777)](t(153)+t(1555)+this[t(471)]+(t(343)+"ls: ")+this._protocols),this._ws=e[t(512)](Vo,{url:this[t(471)],protocols:[this[t(357)+"ls"]],headers:this[t(952)]["miniProg"+t(1136)+"s"][t(475)+t(1235)]},this._options.ws),(this._isBrowser||this[t(1422)+"r"])&&this[t(1193)]&&(this._ws[t(1108)+"pe"]=this._binaryType),this._addWsListeners(),this[t(920)+t(490)+t(1365)]=setTimeout(this[t(443)+"ut"][t(433)](this),o)}catch(n){if(e[t(332)]!=="VUvkE")throw this[t(920)+t(1073)]=!1,n;{let o=0,c=0,l;do l=_0x5296f6(_0x3f4804),e[t(1402)](o,32)&&(c|=e.UyPUM(e[t(227)](127,l),o)),o+=7;while(128&l);return c}}}}[r(749)+"mer"](){let t=r;e[t(1066)](clearTimeout,this[t(920)+"ionTimeoutId"]),this[t(920)+t(490)+"utId"]=null}[r(715)+r(294)](){let t=r;e[t(679)](clearTimeout,this[t(1170)+t(1218)+"Id"]),e[t(965)](clearTimeout,this[t(675)+"ctTimeou"+t(1351)]),this[t(1170)+t(1218)+"Id"]=null,this[t(675)+t(688)+t(1351)]=null}[r(777)](...t){let n=r;this._options[n(390)]&&console[n(719)][n(1232)](console,[e.DbyXO,...t])}_getIntervalValue(t){let n=r,{initReconnectInterval:o,maxReconnectInterval:c,reconnectIntervalGrowFactor:l}=this._options,m=e[n(653)](o,Math[n(731)](l,e[n(1418)](t,1)));return e[n(1134)](m,c)?c:m}[r(1373)](){let t=r;if(this[t(1193)]&&e[t(1278)](this._ws[t(1379)+"te"],this[t(1452)+"NG"])){this[t(715)+"ngTimer"](),this[t(1170)+t(1218)+"Id"]=e[t(745)](setTimeout,this[t(1373)][t(433)](this),this[t(952)][t(685)+t(1140)]);return}if(!this[t(1193)]||e[t(200)](this[t(1193)].readyState,this[t(1339)]))return void this[t(1342)+t(895)]();this[t(1193)]&&this._ws[t(1262)]("hi"),this[t(675)+t(688)+t(1351)]=setTimeout(this[t(1342)+t(895)+t(589)][t(433)](this),this[t(952)][t(278)+t(998)+t(447)])}[r(1342)+r(895)+"Timeout"](){let t=r;this[t(1513)+t(783)]?.[t(1504)](),this[t(1185)](t(1537)+t(307)+"t",t(1466)),this[t(1513)+t(783)]?.[t(1244)+t(550)+"nt"]()?this[t(1342)+t(895)]():this[t(1373)]()}[r(866)+"orOnline"](){let t=r;return this[t(305)+"T"]||this[t(1197)+"X"]?this[t(1266)+t(243)+"line"]:(this[t(531)+"er"]||this[t(1422)+"r"])&&this[t(952)]["listenNetworkCha"+t(1243)]?navigator[t(557)]:!0}[r(1342)+r(895)](){let t=r;!this[t(866)+t(372)]()||this[t(1368)+"osed"]||(this[t(642)+t(1347)]?.[t(1042)+t(196)+t(228)](),this[t(1513)+t(783)]?.[t(1388)+t(195)](),this._ws?this[t(1020)+t(1124)](1001,e[t(789)],!0):this[t(920)]())}[r(1175)+r(388)+r(1503)](){let t=r;this._isMiniTT?tt[t(1507)+t(794)+t(823)](({isConnected:n})=>{let o=t;this[o(1266)+o(243)+o(410)]=n,n?this[o(141)+"nLine"]():this[o(141)+"ffLine"]()}):this[t(1197)+"X"]&&wx["onNetwor"+t(794)+t(823)](({isConnected:n})=>{let o=t;this[o(1266)+o(243)+"line"]=n,n?this[o(141)+o(1050)]():this["_handleO"+o(482)]()})}[r(568)](t){return new Promise(n=>{let o=O;e.PJtRQ(setTimeout,n,this["_getInte"+o(1049)+"e"](t))})}[r(1020)+"ect"](t=1e3,n="",o=!1){let c=r;this._ws&&this[c(464)+c(1291)+"t"](t,n,o)}[r(443)+"ut"](){let t=r,n=this[t(642)+t(1347)]?.[t(1100)+t(1059)+"nt"]();this._debug("connect "+n+t(680)),this[t(1020)+t(1124)](1001,t(1313)+t(281)+t(379)+"g",!0)}[r(1530)](t){let n=r,o=e[n(906)](Gn,t);this[n(1193)]&&e.rTbWn(this[n(1193)].readyState,this[n(1339)])&&(this[n(1193)]&&this[n(1193)][n(1262)](o),this._debug(n(1538),t))}[r(939)+r(1102)+"rs"](){let t=r,n=e[t(1518)][t(1219)]("|"),o=0;for(;;){switch(n[o++]){case"0":this[t(1193)][t(977)+t(597)+t(1017)](e[t(994)],this[t(1524)]);continue;case"1":this[t(1193)][t(977)+t(597)+t(1017)](e[t(967)],this._onMessage);continue;case"2":this[t(1193)]["removeEventListe"+t(1017)](e[t(820)],this[t(1495)]);continue;case"3":this[t(1193)]["removeEv"+t(597)+t(1017)](e[t(365)],this[t(430)]);continue;case"4":if(!this[t(1193)])return;continue}break}}[r(470)+r(1139)](){let t=r,n=e.GcewK[t(1219)]("|"),o=0;for(;;){switch(n[o++]){case"0":this[t(1193)]["addEvent"+t(1499)](t(321),this[t(430)]);continue;case"1":if(!this._ws)return;continue;case"2":this._ws[t(727)+t(1499)](e.BUcZO,this._onClose);continue;case"3":this[t(1193)][t(727)+t(1499)](e[t(820)],this[t(1495)]);continue;case"4":this[t(1193)].addEventListener(t(1314),this[t(751)+"ge"]);continue}break}}[r(485)+r(617)](t=1e3,n=""){let o=r;try{this[o(1193)]&&this[o(1193)][o(476)](t,n)}catch{}}[r(464)+r(1291)+"t"](t=1e3,n="",o=!1){let c=r,l={dBVuu:function(m,g){return e[O(806)](m,g)},lwLWb:function(m,g){return e[O(1145)](m,g)},Taqnu:function(m,g){return e[O(1591)](m,g)},hcmkD:function(m,g){return e.vmmTy(m,g)},GJKZc:function(m,g){return e[O(897)](m,g)}};if(e.VaYat(e[c(510)],e[c(510)]))return _0x2b6922[c(256)](_0x1d58ce)||(_0x11b0dc=_0x15509f[c(919)+"er"](_0x3740ec)),YynwxH[c(1517)](this[c(1062)],_0x10eaa4[c(1062)])&&YynwxH.lwLWb(this.high,31)===1&&YynwxH[c(1034)](YynwxH[c(1065)](_0x5ed381[c(1023)],31),1)?!1:YynwxH[c(974)](this[c(1023)],_0x5c5b77[c(1023)])&&YynwxH[c(974)](this[c(1424)],_0x10f431.low);if(this[c(715)+c(294)](),this[c(749)+"mer"](),this[c(939)+c(1102)+"rs"](),this[c(485)+c(617)](1e3,n),this[c(920)+c(1073)]=!1,o&&this["_navigat"+c(372)]()&&!this._readyClosed){if(this[c(642)+"tManager"]?.[c(1244)+c(1410)+"es"]()){let g=this._endpointManager?.[c(1100)+c(1059)+"nt"]();this[c(1319)+c(899)+"ent"](e[c(1213)](pe,e[c(994)],{code:1006,reason:"connect "+g+(" timeout"+c(1401)+c(799)+c(1562)),wasClean:!0}))}else{let g=this[c(952)]["reconnec"+c(319)+c(1201)](t,n);this[c(1319)+c(899)+c(1522)](pe(c(476),{code:t,reason:n,wasClean:!0,willReconnect:g})),g&&this[c(920)]()}return}this[c(866)+c(372)]()||this[c(1368)+"osed"]?this[c(1319)+c(899)+c(1522)](e.UjdPQ(pe,e[c(994)],{code:t,reason:e[c(928)]})):this["_dispatc"+c(899)+c(1522)](e[c(1213)](pe,e.BUcZO,{code:1006,reason:c(966)+c(902)+c(1079)+c(217)})),this[c(1193)]=null,this[c(642)+c(1347)]?.[c(1042)+c(196)+c(228)](),this[c(1513)+"sCounter"]?.[c(1388)+c(195)]()}[r(1319)+r(304)+"nt"](t){let n=r;this.emit(e.qLPbW,t),this[n(607)]&&this[n(607)](t)}[r(1319)+r(1031)+r(1158)](t){let n=r;this[n(1185)](e[n(967)],t),this[n(1109)+"e"]&&this.onmessage(t)}["_dispatc"+r(1214)+r(143)](t){let n=r;this[n(1185)](e[n(1334)],t),this[n(683)+n(1400)]&&this[n(683)+n(1400)](t)}[r(1319)+r(1168)+r(1522)](t){let n=r;this[n(1185)](e.ktpdF,t),this.onerror&&this[n(802)](t)}[r(1319)+"hCloseEvent"](t){let n=r;this.emit(e[n(994)],t),this[n(884)]&&this[n(884)](t)}get[r(1108)+"pe"](){let t=r;return this[t(1193)]?this[t(1193)][t(1108)+"pe"]:this[t(1016)+"ype"]}set[r(1108)+"pe"](t){let n=r;this._binaryType=t,this[n(1193)]&&(this[n(1193)][n(1108)+"pe"]=t)}get[r(694)+"nt"](){let t=r;return this[t(642)+t(1347)]?.[t(1100)+t(1059)+"ntTriesC"+t(1322)]()||0}get[r(1540)+r(605)](){let t=r;if(e[t(761)](e[t(187)],e[t(709)]))_0x58d74b(this,_0x2a8236,[_0x3ce2f0,_0x3ef5a5,_0x272a33,_0x391372,_0x270af3,_0x5779a3]);else return this[t(812)+t(1312)][t(633)]((o,c)=>(o+=c&&c[t(742)+"th"]||0,o),0)+(this._ws?this._ws["buffered"+t(605)]:0)}get[r(774)+"ns"](){let t=r;return this[t(1193)]?this[t(1193)][t(774)+"ns"]:""}get[r(986)](){let t=r;if(e[t(690)]!=="hQkOi")return this[t(1193)]?this._ws[t(986)]:"";gbTWjn.oPAen(_0x5d0de7,gbTWjn[t(583)](_0x3aefeb,_0x4ae884[t(1147)]),_0x1b08b3[t(540)+"on"],_0x156746.newVersion,gbTWjn[t(1302)](_0x2429cd,_0x1ea85b[t(400)+t(1490)]))}get[r(1379)+"te"](){let t=r;return this[t(1193)]?this[t(1193)][t(1379)+"te"]:this[t(952)].automaticOpen?this.CONNECTING:this.CLOSED}get[r(215)](){let t=r;return this[t(1193)]?this[t(1193)][t(215)]:this._url}[r(476)](t=1e3,n){let o=r,c=e[o(632)][o(1219)]("|"),l=0;for(;;){switch(c[l++]){case"0":this[o(464)+o(1291)+"t"](t,n);continue;case"1":this["_readyCl"+o(1133)]=!0;continue;case"2":if(!this[o(1193)])return void this._debug(e[o(1268)]);continue;case"3":this[o(749)+o(1550)]();continue;case"4":this[o(1301)+o(1264)]?.closeDB();continue;case"5":if(e[o(1081)](this[o(1193)].readyState,this[o(317)])||e[o(1254)](this[o(1193)][o(1379)+"te"],this[o(636)]))return void this[o(777)](e[o(1054)]);continue;case"6":this._clearPingTimer();continue;case"7":this[o(901)+o(1178)+o(1499)]();continue}break}}async send(t,n){let o=r;if(e[o(760)](null,t))throw new Error(e[o(1137)]);e[o(760)](e[o(1051)],typeof t)&&(t=JSON[o(1227)+"y"](t)),e[o(234)](o(668),typeof t)&&!e[o(654)](t,ArrayBuffer)&&!(t[o(1060)]&&t[o(1060)]instanceof ArrayBuffer)&&(t=JSON[o(1227)+"y"](t));let c=await e.FCUmJ(ls,t),l=Xo(t),{method:m=0,service:g=this[o(952)][o(1543)],logID:d=this._options["logIDGen"+o(932)](),headers:_=this[o(952)][o(1437)],payloadEncoding:v=this[o(952)][o(943)+o(534)],payloadType:C=this[o(952)][o(1387)+o(477)],logIDNew:k=this._options[o(1570)+o(813)]["enableAu"+o(957)+o(1435)+"ew"]?e[o(862)](a,this[o(952)][o(1570)+o(813)].userIp):""}=e.MwLqq(n,{});if(!g)throw new Error(e[o(864)]);let R={SeqID:M.fromNumber(this[o(1491)]++),LogID:M.fromNumber(d),service:g,method:m,headers:_,payloadEncoding:v instanceof Object?v[o(1286)]?v[o(1286)]:"":v,payloadType:e[o(654)](C,Object)?C[o(523)]?C.type:l:C||l,payload:c,LogIDNew:k},B=e[o(1263)](Gn,R);return this[o(1193)]&&e[o(515)](this[o(1193)][o(1379)+"te"],this[o(1339)])?(this._ws&&this[o(1193)][o(1262)](B),this[o(777)](o(115),R)):e[o(964)](this[o(812)+o(1312)][o(1156)],this[o(952)]["maxMessa"+o(429)+"ength"])?e.zzCxJ(e[o(798)],e[o(284)])?(_0x4e2ae5[o(977)+o(597)+"ner"](o(516),_0x14e3dc),_0x32e19b[o(977)+o(597)+o(1017)](gbTWjn[o(365)],_0x62062f)):(this._messageQueue.push(B),this[o(777)](e.jynSk,R)):e[o(1571)](o(979),e.cCpqm)?gbTWjn[o(1353)](_0x18515b,_0x3d7e33)&&_0x18eae5[o(1474)](_0x3d09a2,_0x522aba):(this._messageQueue[o(389)](),this[o(812)+o(1312)][o(157)](B)),{seqID:this[o(1491)],logID:d,logIDNew:k}}async[r(225)+"t"](t){let n=r;if(e[n(892)]!==n(419)){let o={hKmgI:function(c,l){return c(l)}};return function(c,...l){let m=n,g=_0x5519c9.call(o[m(1280)](_0x490b5c,this),c,...l);return _0x14b218.set(g,c[m(608)]?c[m(608)]():[c]),o.hKmgI(_0x9586b,g)}}else{let{url:o}=e.wydLk(t,{}),c=Array[n(623)](o)?o:e[n(838)](n(668),typeof o)?[o]:[];t&&Object[n(1300)](this._options,t),c&&c[n(1156)]?this[n(642)+n(1347)]=new cs(c,this[n(952)][n(1142)+"es"]):this["_endpoin"+n(1347)]?.[n(1042)+n(196)+"fig"](),this[n(1513)+n(783)]?.["resetCou"+n(195)](this[n(952)]["pingLoss"+n(359)]),this["_readyCl"+n(1133)]=!1,this[n(1193)]&&this._ws.readyState!==this[n(317)]?this[n(1020)+n(1124)](1e3,e[n(254)],!0):(this._isInit=!0,this[n(920)]())}}async[r(219)](){let t=r;if(!this._connectLock){let n=e[t(560)][t(1219)]("|"),o=0;for(;;){switch(n[o++]){case"0":this[t(275)]=!0;continue;case"1":this["_pingLos"+t(783)]?.resetCounter();continue;case"2":this._connect();continue;case"3":this[t(1368)+t(1133)]=!1;continue;case"4":this[t(642)+t(1347)]?.[t(1042)+t(196)+t(228)]();continue}break}}}[r(727)+r(1499)](t,n){this.on(t,n)}[r(904)+"Event"](t){let n=r,{type:o}=t;this[n(1185)](o,t)}[r(977)+r(597)+r(1017)](t,n){this.off(t,n)}[r(781)](){let t=r,n={nqvcA:function(o,c){return e[O(739)](o,c)},gkpHw:t(1466),tnRhM:t(1537)+t(474)+"s",LEPlD:e.SwNin,XnMKf:function(o,c,l){return o(c,l)},KmPet:e.nNupb};return new Promise((o,c)=>{let l=t,m={ioqtT:function(_,v){return n[O(1391)](_,v)},pCxAb:n.LEPlD,HCKmV:"ping_onc"+l(474)+"s"};this._clearPingTimer(),this[l(1170)+l(1218)+"Id"]=n[l(1572)](setTimeout,this._ping.bind(this),this[l(952)][l(685)+"rval"]);let g=()=>{let _=l;m.ioqtT(o,m[_(755)]),this[_(985)](m[_(637)],g),this[_(985)](_(1537)+_(307)+"t",d)},d=()=>{let _=l;n[_(1391)](c,n[_(501)]),this.off(n[_(1536)],g),this.off(_(1537)+_(307)+"t",d)};this.on(n[l(1536)],g),this.on(n[l(1072)],d),this[l(1373)]()})}}})(),N[S(1320)+S(310)]=V[S(1320)+S(310)],N["CustomEr"+S(1541)]=V[S(1206)+S(1541)],N[S(210)+"e"]=V[S(210)+"e"],N[S(1158)]=V[S(1158)],N.FWS=V[S(830)],N[S(1510)+S(223)+S(1546)]=V[S(1510)+S(223)+S(1546)],N[S(223)+"vent"]=V["MessageE"+S(1546)],N.OpenEvent=V[S(1122)+"t"],N["Reconnec"+S(269)]=V.ReconnectEvent,N[S(982)+S(310)]=V.createCloseEvent,N[S(578)+S(1541)]=V.createErrorEvent,N[S(194)+"ssageEvent"]=V[S(194)+S(1010)+"nt"],N["createOp"+S(449)]=V[S(197)+S(449)],N[S(184)+"connectE"+S(1546)]=V[S(184)+S(582)+S(1546)],N.decodedFrame=V[S(1075)+S(1498)],N[S(1106)+S(517)]=V["encodeFr"+S(517)];for(ln in V)["CustomCl"+S(310),S(1206)+S(1541),S(210)+"e",S(1158),S(830),S(1510)+S(223)+S(1546),S(223)+S(1546),S(1122)+"t","Reconnec"+S(269),S(982)+S(310),S(578)+S(1541),"createMe"+S(1010)+"nt","createOp"+S(449),S(184)+"connectE"+S(1546),"decodedF"+S(1498),S(1106)+S(517)].indexOf(ln)===-1&&(N[ln]=V[ln]);var ln;Object[S(1148)+S(418)](N,S(621)+"le",{value:!0})});var Ne=oe((Vd,ci)=>{"use strict";var ai=["nodebuffer","arraybuffer","fragments"],xi=typeof Blob<"u";xi&&ai.push("blob");ci.exports={BINARY_TYPES:ai,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:xi,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var Pt=oe((Yd,yn)=>{"use strict";var{EMPTY_BUFFER:lx}=Ne(),gr=Buffer[Symbol.species];function hx(r,e){if(r.length===0)return lx;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 gr(i.buffer,i.byteOffset,a):i}function fi(r,e,i,a,x){for(let f=0;f<x;f++)i[a+f]=r[f]^e[f&3]}function ui(r,e){for(let i=0;i<r.length;i++)r[i]^=e[i&3]}function gx(r){return r.length===r.buffer.byteLength?r.buffer:r.buffer.slice(r.byteOffset,r.byteOffset+r.length)}function pr(r){if(pr.readOnly=!0,Buffer.isBuffer(r))return r;let e;return r instanceof ArrayBuffer?e=new gr(r):ArrayBuffer.isView(r)?e=new gr(r.buffer,r.byteOffset,r.byteLength):(e=Buffer.from(r),pr.readOnly=!1),e}yn.exports={concat:hx,mask:fi,toArrayBuffer:gx,toBuffer:pr,unmask:ui};if(!process.env.WS_NO_BUFFER_UTIL)try{let r=J("bufferutil");yn.exports.mask=function(e,i,a,x,f){f<48?fi(e,i,a,x,f):r.mask(e,i,a,x,f)},yn.exports.unmask=function(e,i){e.length<32?ui(e,i):r.unmask(e,i)}}catch{}});var hi=oe((Xd,li)=>{"use strict";var di=Symbol("kDone"),mr=Symbol("kRun"),wr=class{constructor(e){this[di]=()=>{this.pending--,this[mr]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[mr]()}[mr](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[di])}}};li.exports=wr});var ht=oe(($d,wi)=>{"use strict";var It=J("zlib"),gi=Pt(),px=hi(),{kStatusCode:pi}=Ne(),mx=Buffer[Symbol.species],_x=Buffer.from([0,0,255,255]),vn=Symbol("permessage-deflate"),Oe=Symbol("total-length"),dt=Symbol("callback"),He=Symbol("buffers"),lt=Symbol("error"),bn,_r=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,!bn){let i=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;bn=new px(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){bn.add(x=>{this._decompress(e,i,(f,u)=>{x(),a(f,u)})})}compress(e,i,a){bn.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"?It.Z_DEFAULT_WINDOWBITS:this.params[f];this._inflate=It.createInflateRaw({...this._options.zlibInflateOptions,windowBits:u}),this._inflate[vn]=this,this._inflate[Oe]=0,this._inflate[He]=[],this._inflate.on("error",bx),this._inflate.on("data",mi)}this._inflate[dt]=a,this._inflate.write(e),i&&this._inflate.write(_x),this._inflate.flush(()=>{let f=this._inflate[lt];if(f){this._inflate.close(),this._inflate=null,a(f);return}let u=gi.concat(this._inflate[He],this._inflate[Oe]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[Oe]=0,this._inflate[He]=[],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"?It.Z_DEFAULT_WINDOWBITS:this.params[f];this._deflate=It.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:u}),this._deflate[Oe]=0,this._deflate[He]=[],this._deflate.on("data",yx)}this._deflate[dt]=a,this._deflate.write(e),this._deflate.flush(It.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let f=gi.concat(this._deflate[He],this._deflate[Oe]);i&&(f=new mx(f.buffer,f.byteOffset,f.length-4)),this._deflate[dt]=null,this._deflate[Oe]=0,this._deflate[He]=[],i&&this.params[`${x}_no_context_takeover`]&&this._deflate.reset(),a(null,f)})}};wi.exports=_r;function yx(r){this[He].push(r),this[Oe]+=r.length}function mi(r){if(this[Oe]+=r.length,this[vn]._maxPayload<1||this[Oe]<=this[vn]._maxPayload){this[He].push(r);return}this[lt]=new RangeError("Max payload size exceeded"),this[lt].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[lt][pi]=1009,this.removeListener("data",mi),this.reset()}function bx(r){if(this[vn]._inflate=null,this[lt]){this[dt](this[lt]);return}r[pi]=1007,this[dt](r)}});var gt=oe((Zd,Sn)=>{"use strict";var{isUtf8:_i}=J("buffer"),{hasBlob:vx}=Ne(),Sx=[0,0,0,0,0,0,0,0,0,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 yr(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 Ex(r){return vx&&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:Ex,isValidStatusCode:Cx,isValidUTF8:yr,tokenChars:Sx};if(_i)Sn.exports.isValidUTF8=function(r){return r.length<24?yr(r):_i(r)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let r=J("utf-8-validate");Sn.exports.isValidUTF8=function(e){return e.length<32?yr(e):r(e)}}catch{}});var Er=oe((Qd,Ai)=>{"use strict";var{Writable:Ax}=J("stream"),yi=ht(),{BINARY_TYPES:Dx,EMPTY_BUFFER:bi,kStatusCode:kx,kWebSocket:Px}=Ne(),{concat:br,toArrayBuffer:Ix,unmask:Tx}=Pt(),{isValidStatusCode:Lx,isValidUTF8:vi}=gt(),Cn=Buffer[Symbol.species],le=0,Si=1,Ci=2,Ei=3,vr=4,Sr=5,En=6,Cr=class extends Ax{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||Dx[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=le}_write(e,i,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 Cn(a.buffer,a.byteOffset+e,a.length-e),new Cn(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 Cn(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 le:this.getInfo(e);break;case Si:this.getPayloadLength16(e);break;case Ci:this.getPayloadLength64(e);break;case Ei:this.getMask();break;case vr:this.getData(e);break;case Sr:case En: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[yi.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=Si:this._payloadLength===127?this._state=Ci: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=vr}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=vr}getData(e){let i=bi;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&&Tx(i,this._mask)}if(this._opcode>7){this.controlMessage(i,e);return}if(this._compressed){this._state=Sr,this.decompress(i,e);return}i.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(i)),this.dataMessage(e)}decompress(e,i){this._extensions[yi.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===le&&this.startLoop(i)})}dataMessage(e){if(!this._fin){this._state=le;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=br(a,i):this._binaryType==="arraybuffer"?x=Ix(br(a,i)):this._binaryType==="blob"?x=new Blob(a):x=a,this._allowSynchronousEvents?(this.emit("message",x,!0),this._state=le):(this._state=En,setImmediate(()=>{this.emit("message",x,!0),this._state=le,this.startLoop(e)}))}else{let x=br(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===Sr||this._allowSynchronousEvents?(this.emit("message",x,!1),this._state=le):(this._state=En,setImmediate(()=>{this.emit("message",x,!1),this._state=le,this.startLoop(e)}))}}controlMessage(e,i){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit("conclude",1005,bi),this.end();else{let a=e.readUInt16BE(0);if(!Lx(a)){let f=this.createError(RangeError,`invalid status code ${a}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");i(f);return}let x=new Cn(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=le;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=le):(this._state=En,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=le,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[kx]=x,u}};Ai.exports=Cr});var kr=oe((tl,Pi)=>{"use strict";var{Duplex:el}=J("stream"),{randomFillSync:Nx}=J("crypto"),Di=ht(),{EMPTY_BUFFER:Ox,kWebSocket:Bx,NOOP:Rx}=Ne(),{isBlob:pt,isValidStatusCode:Mx}=gt(),{mask:ki,toBuffer:$e}=Pt(),he=Symbol("kByteLength"),zx=Buffer.alloc(4),An=8*1024,Ze,mt=An,we=0,qx=1,Fx=2,Ar=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=we,this.onerror=Rx,this[Bx]=void 0}static frame(e,i){let a,x=!1,f=2,u=!1;i.mask&&(a=i.maskBuffer||zx,i.generateMask?i.generateMask(a):(mt===An&&(Ze===void 0&&(Ze=Buffer.alloc(An)),Nx(Ze,0,An),mt=0),a[0]=Ze[mt++],a[1]=Ze[mt++],a[2]=Ze[mt++],a[3]=Ze[mt++]),u=(a[0]|a[1]|a[2]|a[3])===0,f=6);let h;typeof e=="string"?(!i.mask||u)&&i[he]!==void 0?h=i[he]:(e=Buffer.from(e),h=e.length):(h=e.length,x=i.mask&&i.readOnly&&!u);let p=h;h>=65536?(f+=8,p=127):h>125&&(f+=2,p=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]=p,p===126?w.writeUInt16BE(h,2):p===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?(ki(e,a,w,f,h),[w]):(ki(e,a,e,0,h),[w,e])):[w,e]}close(e,i,a,x){let f;if(e===void 0)f=Ox;else{if(typeof e!="number"||!Mx(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={[he]:f.length,fin:!0,generateMask:this._generateMask,mask:a,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==we?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=$e(e),x=e.length,f=$e.readOnly),x>125)throw new RangeError("The data size must not be greater than 125 bytes");let u={[he]:x,fin:!0,generateMask:this._generateMask,mask:i,maskBuffer:this._maskBuffer,opcode:9,readOnly:f,rsv1:!1};pt(e)?this._state!==we?this.enqueue([this.getBlobData,e,!1,u,a]):this.getBlobData(e,!1,u,a):this._state!==we?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=$e(e),x=e.length,f=$e.readOnly),x>125)throw new RangeError("The data size must not be greater than 125 bytes");let u={[he]:x,fin:!0,generateMask:this._generateMask,mask:i,maskBuffer:this._maskBuffer,opcode:10,readOnly:f,rsv1:!1};pt(e)?this._state!==we?this.enqueue([this.getBlobData,e,!1,u,a]):this.getBlobData(e,!1,u,a):this._state!==we?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,p;typeof e=="string"?(h=Buffer.byteLength(e),p=!1):pt(e)?(h=e.size,p=!1):(e=$e(e),h=e.length,p=$e.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={[he]:h,fin:i.fin,generateMask:this._generateMask,mask:i.mask,maskBuffer:this._maskBuffer,opcode:f,readOnly:p,rsv1:u};pt(e)?this._state!==we?this.enqueue([this.getBlobData,e,this._compress,w,a]):this.getBlobData(e,this._compress,w,a):this._state!==we?this.enqueue([this.dispatch,e,this._compress,w,a]):this.dispatch(e,this._compress,w,a)}getBlobData(e,i,a,x){this._bufferedBytes+=a[he],this._state=Fx,e.arrayBuffer().then(f=>{if(this._socket.destroyed){let h=new Error("The socket was closed while the blob was being read");process.nextTick(Dr,this,h,x);return}this._bufferedBytes-=a[he];let u=$e(f);i?this.dispatch(u,i,a,x):(this._state=we,this.sendFrame(r.frame(u,a),x),this.dequeue())}).catch(f=>{process.nextTick(Ux,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[he],this._state=qx,f.compress(e,a.fin,(u,h)=>{if(this._socket.destroyed){let p=new Error("The socket was closed while data was being compressed");Dr(this,p,x);return}this._bufferedBytes-=a[he],this._state=we,a.readOnly=!1,this.sendFrame(r.frame(h,a),x),this.dequeue()})}dequeue(){for(;this._state===we&&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,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)}};Pi.exports=Ar;function Dr(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 Ux(r,e,i){Dr(r,e,i),r.onerror(e)}});var zi=oe((nl,Mi)=>{"use strict";var{kForOnEventAttribute:Tt,kListener:Pr}=Ne(),Ii=Symbol("kCode"),Ti=Symbol("kData"),Li=Symbol("kError"),Ni=Symbol("kMessage"),Oi=Symbol("kReason"),wt=Symbol("kTarget"),Bi=Symbol("kType"),Ri=Symbol("kWasClean"),Be=class{constructor(e){this[wt]=null,this[Bi]=e}get target(){return this[wt]}get type(){return this[Bi]}};Object.defineProperty(Be.prototype,"target",{enumerable:!0});Object.defineProperty(Be.prototype,"type",{enumerable:!0});var Qe=class extends Be{constructor(e,i={}){super(e),this[Ii]=i.code===void 0?0:i.code,this[Oi]=i.reason===void 0?"":i.reason,this[Ri]=i.wasClean===void 0?!1:i.wasClean}get code(){return this[Ii]}get reason(){return this[Oi]}get wasClean(){return this[Ri]}};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 Be{constructor(e,i={}){super(e),this[Li]=i.error===void 0?null:i.error,this[Ni]=i.message===void 0?"":i.message}get error(){return this[Li]}get message(){return this[Ni]}};Object.defineProperty(_t.prototype,"error",{enumerable:!0});Object.defineProperty(_t.prototype,"message",{enumerable:!0});var Lt=class extends Be{constructor(e,i={}){super(e),this[Ti]=i.data===void 0?null:i.data}get data(){return this[Ti]}};Object.defineProperty(Lt.prototype,"data",{enumerable:!0});var Kx={addEventListener(r,e,i={}){for(let x of this.listeners(r))if(!i[Tt]&&x[Pr]===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,Dn(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,Dn(e,this,h)};else if(r==="error")a=function(f){let u=new _t("error",{error:f,message:f.message});u[wt]=this,Dn(e,this,u)};else if(r==="open")a=function(){let f=new Be("open");f[wt]=this,Dn(e,this,f)};else return;a[Tt]=!!i[Tt],a[Pr]=e,i.once?this.once(r,a):this.on(r,a)},removeEventListener(r,e){for(let i of this.listeners(r))if(i[Pr]===e&&!i[Tt]){this.removeListener(r,i);break}}};Mi.exports={CloseEvent:Qe,ErrorEvent:_t,Event:Be,EventTarget:Kx,MessageEvent:Lt};function Dn(r,e,i){typeof r=="object"&&r.handleEvent?r.handleEvent.call(r,i):r.call(e,i)}});var kn=oe((rl,qi)=>{"use strict";var{tokenChars:Nt}=gt();function Ce(r,e,i){r[e]===void 0?r[e]=[i]:r[e].push(i)}function Hx(r){let e=Object.create(null),i=Object.create(null),a=!1,x=!1,f=!1,u,h,p=-1,w=-1,b=-1,y=0;for(;y<r.length;y++)if(w=r.charCodeAt(y),u===void 0)if(b===-1&&Nt[w]===1)p===-1&&(p=y);else if(y!==0&&(w===32||w===9))b===-1&&p!==-1&&(b=y);else if(w===59||w===44){if(p===-1)throw new SyntaxError(`Unexpected character at index ${y}`);b===-1&&(b=y);let P=r.slice(p,b);w===44?(Ce(e,P,i),i=Object.create(null)):u=P,p=b=-1}else throw new SyntaxError(`Unexpected character at index ${y}`);else if(h===void 0)if(b===-1&&Nt[w]===1)p===-1&&(p=y);else if(w===32||w===9)b===-1&&p!==-1&&(b=y);else if(w===59||w===44){if(p===-1)throw new SyntaxError(`Unexpected character at index ${y}`);b===-1&&(b=y),Ce(i,r.slice(p,b),!0),w===44&&(Ce(e,u,i),i=Object.create(null),u=void 0),p=b=-1}else if(w===61&&p!==-1&&b===-1)h=r.slice(p,y),p=b=-1;else throw new SyntaxError(`Unexpected character at index ${y}`);else if(x){if(Nt[w]!==1)throw new SyntaxError(`Unexpected character at index ${y}`);p===-1?p=y:a||(a=!0),x=!1}else if(f)if(Nt[w]===1)p===-1&&(p=y);else if(w===34&&p!==-1)f=!1,b=y;else if(w===92)x=!0;else throw new SyntaxError(`Unexpected character at index ${y}`);else if(w===34&&r.charCodeAt(y-1)===61)f=!0;else if(b===-1&&Nt[w]===1)p===-1&&(p=y);else if(p!==-1&&(w===32||w===9))b===-1&&(b=y);else if(w===59||w===44){if(p===-1)throw new SyntaxError(`Unexpected character at index ${y}`);b===-1&&(b=y);let P=r.slice(p,b);a&&(P=P.replace(/\\/g,""),a=!1),Ce(i,h,P),w===44&&(Ce(e,u,i),i=Object.create(null),u=void 0),h=void 0,p=b=-1}else throw new SyntaxError(`Unexpected character at index ${y}`);if(p===-1||f||w===32||w===9)throw new SyntaxError("Unexpected end of input");b===-1&&(b=y);let E=r.slice(p,b);return u===void 0?Ce(e,E,i):(h===void 0?Ce(i,E,!0):a?Ce(i,h,E.replace(/\\/g,"")):Ce(i,h,E),Ce(e,u,i)),e}function Wx(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(", ")}qi.exports={format:Wx,parse:Hx}});var Ln=oe((ol,$i)=>{"use strict";var jx=J("events"),Gx=J("https"),Jx=J("http"),Ki=J("net"),Vx=J("tls"),{randomBytes:Yx,createHash:Xx}=J("crypto"),{Duplex:sl,Readable:il}=J("stream"),{URL:Ir}=J("url"),We=ht(),$x=Er(),Zx=kr(),{isBlob:Qx}=gt(),{BINARY_TYPES:Fi,CLOSE_TIMEOUT:ec,EMPTY_BUFFER:Pn,GUID:tc,kForOnEventAttribute:Tr,kListener:nc,kStatusCode:rc,kWebSocket:Z,NOOP:Hi}=Ne(),{EventTarget:{addEventListener:sc,removeEventListener:ic}}=zi(),{format:oc,parse:ac}=kn(),{toBuffer:xc}=Pt(),Wi=Symbol("kAborted"),Lr=[8,13],Re=["CONNECTING","OPEN","CLOSING","CLOSED"],cc=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,F=class r extends jx{constructor(e,i,a){super(),this._binaryType=Fi[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=Pn,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){Fi.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 Zx(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",dc),x.on("drain",lc),x.on("error",hc),x.on("message",gc),x.on("ping",pc),x.on("pong",mc),f.onerror=wc,e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),i.length>0&&e.unshift(i),e.on("close",Vi),e.on("data",Tn),e.on("end",Yi),e.on("error",Xi),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[We.extensionName]&&this._extensions[We.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){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,i,!this._isServer,a=>{a||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),Ji(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){Nr(this,e,a);return}i===void 0&&(i=!this._isServer),this._sender.ping(e||Pn,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){Nr(this,e,a);return}i===void 0&&(i=!this._isServer),this._sender.pong(e||Pn,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){Nr(this,e,a);return}let x={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...i};this._extensions[We.extensionName]||(x.compress=!1),this._sender.send(e||Pn,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(F,"CONNECTING",{enumerable:!0,value:Re.indexOf("CONNECTING")});Object.defineProperty(F.prototype,"CONNECTING",{enumerable:!0,value:Re.indexOf("CONNECTING")});Object.defineProperty(F,"OPEN",{enumerable:!0,value:Re.indexOf("OPEN")});Object.defineProperty(F.prototype,"OPEN",{enumerable:!0,value:Re.indexOf("OPEN")});Object.defineProperty(F,"CLOSING",{enumerable:!0,value:Re.indexOf("CLOSING")});Object.defineProperty(F.prototype,"CLOSING",{enumerable:!0,value:Re.indexOf("CLOSING")});Object.defineProperty(F,"CLOSED",{enumerable:!0,value:Re.indexOf("CLOSED")});Object.defineProperty(F.prototype,"CLOSED",{enumerable:!0,value:Re.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(r=>{Object.defineProperty(F.prototype,r,{enumerable:!0})});["open","error","close","message"].forEach(r=>{Object.defineProperty(F.prototype,`on${r}`,{enumerable:!0,get(){for(let e of this.listeners(r))if(e[Tr])return e[nc];return null},set(e){for(let i of this.listeners(r))if(i[Tr]){this.removeListener(r,i);break}typeof e=="function"&&this.addEventListener(r,e,{[Tr]:!0})}})});F.prototype.addEventListener=sc;F.prototype.removeEventListener=ic;$i.exports=F;function ji(r,e,i,a){let x={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:ec,protocolVersion:Lr[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,!Lr.includes(x.protocolVersion))throw new RangeError(`Unsupported protocol version: ${x.protocolVersion} (supported versions: ${Lr.join(", ")})`);let f;if(e instanceof Ir)f=e;else try{f=new Ir(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:",p;if(f.protocol!=="ws:"&&!u&&!h?p=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:h&&!f.pathname?p="The URL's pathname is empty":f.hash&&(p="The URL contains a fragment identifier"),p){let L=new SyntaxError(p);if(r._redirects===0)throw L;In(r,L);return}let w=u?443:80,b=Yx(16).toString("base64"),y=u?Gx.request:Jx.request,E=new Set,P;if(x.createConnection=x.createConnection||(u?uc:fc),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":b,Connection:"Upgrade",Upgrade:"websocket"},x.path=f.pathname+f.search,x.timeout=x.handshakeTimeout,x.perMessageDeflate&&(P=new We({...x.perMessageDeflate,isServer:!1,maxPayload:x.maxPayload}),x.headers["Sec-WebSocket-Extensions"]=oc({[We.extensionName]:P.offer()})),i.length){for(let L of i){if(typeof L!="string"||!cc.test(L)||E.has(L))throw new SyntaxError("An invalid or duplicated subprotocol was specified");E.add(L)}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 L=x.path.split(":");x.socketPath=L[0],x.path=L[1]}let I;if(x.followRedirects){if(r._redirects===0){r._originalIpc=h,r._originalSecure=u,r._originalHostOrSocketPath=h?x.socketPath:f.host;let L=a&&a.headers;if(a={...a,headers:{}},L)for(let[j,ie]of Object.entries(L))a.headers[j.toLowerCase()]=ie}else if(r.listenerCount("redirect")===0){let L=h?r._originalIpc?x.socketPath===r._originalHostOrSocketPath:!1:r._originalIpc?!1:f.host===r._originalHostOrSocketPath;(!L||r._originalSecure&&!u)&&(delete x.headers.authorization,delete x.headers.cookie,L||delete x.headers.host,x.auth=void 0)}x.auth&&!a.headers.authorization&&(a.headers.authorization="Basic "+Buffer.from(x.auth).toString("base64")),I=r._req=y(x),r._redirects&&r.emit("redirect",r.url,I)}else I=r._req=y(x);x.timeout&&I.on("timeout",()=>{fe(r,I,"Opening handshake has timed out")}),I.on("error",L=>{I===null||I[Wi]||(I=r._req=null,In(r,L))}),I.on("response",L=>{let j=L.headers.location,ie=L.statusCode;if(j&&x.followRedirects&&ie>=300&&ie<400){if(++r._redirects>x.maxRedirects){fe(r,I,"Maximum redirects exceeded");return}I.abort();let xe;try{xe=new Ir(j,e)}catch{let z=new SyntaxError(`Invalid URL: ${j}`);In(r,z);return}ji(r,xe,i,a)}else r.emit("unexpected-response",I,L)||fe(r,I,`Unexpected server response: ${L.statusCode}`)}),I.on("upgrade",(L,j,ie)=>{if(r.emit("upgrade",L),r.readyState!==F.CONNECTING)return;I=r._req=null;let xe=L.headers.upgrade;if(xe===void 0||xe.toLowerCase()!=="websocket"){fe(r,j,"Invalid Upgrade header");return}let D=Xx("sha1").update(b+tc).digest("base64");if(L.headers["sec-websocket-accept"]!==D){fe(r,j,"Invalid Sec-WebSocket-Accept header");return}let z=L.headers["sec-websocket-protocol"],G;if(z!==void 0?E.size?E.has(z)||(G="Server sent an invalid subprotocol"):G="Server sent a subprotocol but none was requested":E.size&&(G="Server sent no subprotocol"),G){fe(r,j,G);return}z&&(r._protocol=z);let Ee=L.headers["sec-websocket-extensions"];if(Ee!==void 0){if(!P){fe(r,j,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let Me;try{Me=ac(Ee)}catch{fe(r,j,"Invalid Sec-WebSocket-Extensions header");return}let _e=Object.keys(Me);if(_e.length!==1||_e[0]!==We.extensionName){fe(r,j,"Server indicated an extension that was not requested");return}try{P.accept(Me[We.extensionName])}catch{fe(r,j,"Invalid Sec-WebSocket-Extensions header");return}r._extensions[We.extensionName]=P}r.setSocket(j,ie,{allowSynchronousEvents:x.allowSynchronousEvents,generateMask:x.generateMask,maxPayload:x.maxPayload,skipUTF8Validation:x.skipUTF8Validation})}),x.finishRequest?x.finishRequest(I,r):I.end()}function In(r,e){r._readyState=F.CLOSING,r._errorEmitted=!0,r.emit("error",e),r.emitClose()}function fc(r){return r.path=r.socketPath,Ki.connect(r)}function uc(r){return r.path=void 0,!r.servername&&r.servername!==""&&(r.servername=Ki.isIP(r.host)?"":r.host),Vx.connect(r)}function fe(r,e,i){r._readyState=F.CLOSING;let a=new Error(i);Error.captureStackTrace(a,fe),e.setHeader?(e[Wi]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(In,r,a)):(e.destroy(a),e.once("error",r.emit.bind(r,"error")),e.once("close",r.emitClose.bind(r)))}function Nr(r,e,i){if(e){let a=Qx(e)?e.size:xc(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 dc(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 lc(){let r=this[Z];r.isPaused||r._socket.resume()}function hc(r){let e=this[Z];e._socket[Z]!==void 0&&(e._socket.removeListener("data",Tn),process.nextTick(Gi,e._socket),e.close(r[rc])),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r))}function Ui(){this[Z].emitClose()}function gc(r,e){this[Z].emit("message",r,e)}function pc(r){let e=this[Z];e._autoPong&&e.pong(r,!this._isServer,Hi),e.emit("ping",r)}function mc(r){this[Z].emit("pong",r)}function Gi(r){r.resume()}function wc(r){let e=this[Z];e.readyState!==F.CLOSED&&(e.readyState===F.OPEN&&(e._readyState=F.CLOSING,Ji(e)),this._socket.end(),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r)))}function Ji(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",Tn),this.removeListener("end",Yi),r._readyState=F.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",Ui),r._receiver.on("finish",Ui))}function Tn(r){this[Z]._receiver.write(r)||this.pause()}function Yi(){let r=this[Z];r._readyState=F.CLOSING,r._receiver.end(),this.end()}function Xi(){let r=this[Z];this.removeListener("error",Xi),this.on("error",Hi),r&&(r._readyState=F.CLOSING,this.destroy())}});var to=oe((xl,eo)=>{"use strict";var al=Ln(),{Duplex:_c}=J("stream");function Zi(r){r.emit("close")}function yc(){!this.destroyed&&this._writableState.finished&&this.destroy()}function Qi(r){this.removeListener("error",Qi),this.destroy(),this.listenerCount("error")===0&&this.emit("error",r)}function bc(r,e){let i=!0,a=new _c({...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(p){u=!0,f(p)}),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",yc),a.on("error",Qi),a}eo.exports=bc});var Or=oe((cl,no)=>{"use strict";var{tokenChars:vc}=gt();function Sc(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&&vc[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}no.exports={parse:Sc}});var co=oe((ul,xo)=>{"use strict";var Cc=J("events"),Nn=J("http"),{Duplex:fl}=J("stream"),{createHash:Ec}=J("crypto"),ro=kn(),et=ht(),Ac=Or(),Dc=Ln(),{CLOSE_TIMEOUT:kc,GUID:Pc,kWebSocket:Ic}=Ne(),Tc=/^[+/0-9A-Za-z]{22}==$/,so=0,io=1,ao=2,Br=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:kc,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:Dc,...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=Lc(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=so}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===ao){e&&this.once("close",()=>{e(new Error("The server is not running"))}),process.nextTick(Ot,this);return}if(e&&this.once("close",e),this._state!==io)if(this._state=io,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(Ot,this):process.nextTick(Ot,this);else{let i=this._server;this._removeListeners(),this._removeListeners=this._server=null,i.close(()=>{Ot(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",oo);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||!Tc.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 p=e.headers["sec-websocket-protocol"],w=new Set;if(p!==void 0)try{w=Ac.parse(p)}catch{nt(this,e,i,400,"Invalid Sec-WebSocket-Protocol header");return}let b=e.headers["sec-websocket-extensions"],y={};if(this.options.perMessageDeflate&&b!==void 0){let E=new et({...this.options.perMessageDeflate,isServer:!0,maxPayload:this.options.maxPayload});try{let P=ro.parse(b);P[et.extensionName]&&(E.accept(P[et.extensionName]),y[et.extensionName]=E)}catch{nt(this,e,i,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let E={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(E,(P,I,L,j)=>{if(!P)return Bt(i,I||401,L,j);this.completeUpgrade(y,f,w,e,i,a,x)});return}if(!this.options.verifyClient(E))return Bt(i,401)}this.completeUpgrade(y,f,w,e,i,a,x)}completeUpgrade(e,i,a,x,f,u,h){if(!f.readable||!f.writable)return f.destroy();if(f[Ic])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>so)return Bt(f,503);let w=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${Ec("sha1").update(i+Pc).digest("base64")}`],b=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&&(w.push(`Sec-WebSocket-Protocol: ${y}`),b._protocol=y)}if(e[et.extensionName]){let y=e[et.extensionName].params,E=ro.format({[et.extensionName]:[y]});w.push(`Sec-WebSocket-Extensions: ${E}`),b._extensions=e}this.emit("headers",w,x),f.write(w.concat(`\r
|
|
8
|
+
var L0=Object.create;var nr=Object.defineProperty;var N0=Object.getOwnPropertyDescriptor;var R0=Object.getOwnPropertyNames;var O0=Object.getPrototypeOf,M0=Object.prototype.hasOwnProperty;var W=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(t,i)=>(typeof require<"u"?require:t)[i]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')});var ke=(r,t)=>()=>(r&&(t=r(r=0)),t);var se=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),ps=(r,t)=>{for(var i in t)nr(r,i,{get:t[i],enumerable:!0})},B0=(r,t,i,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let c of R0(t))!M0.call(r,c)&&c!==i&&nr(r,c,{get:()=>t[c],enumerable:!(a=N0(t,c))||a.enumerable});return r};var De=(r,t,i)=>(i=r!=null?L0(O0(r)):{},B0(t||!r||!r.__esModule?nr(i,"default",{value:r,enumerable:!0}):i,r));import{chmod as z0,mkdir as q0,readFile as F0,writeFile as U0}from"node:fs/promises";import{dirname as H0}from"node:path";async function zt(r){try{let t=await F0(r,"utf8");return JSON.parse(t)}catch(t){if(t.code==="ENOENT")return null;throw t}}async function qt(r,t,i){await q0(H0(r),{recursive:!0}),await U0(r,`${JSON.stringify(t,null,2)}
|
|
9
|
+
`,"utf8"),i?.mode!==void 0&&await z0(r,i.mode)}var rr=ke(()=>{"use strict"});function ws(r){return Ut[ms]<=Ut[r]}function sr(r){_s={...r}}function Ft(r,t,i,a){if(Ut[r]<Ut[ms])return;let c=JSON.stringify({ts:new Date().toISOString(),level:r,module:t,msg:i,..._s,...a});r==="error"||r==="warn"?K0.write(`${c}
|
|
10
|
+
`):j0.write(`${c}
|
|
11
|
+
`)}function N(r){return{debug:(t,i)=>Ft("debug",r,t,i),info:(t,i)=>Ft("info",r,t,i),warn:(t,i)=>Ft("warn",r,t,i),error:(t,i)=>Ft("error",r,t,i),child:t=>N(`${r}.${t}`)}}var Ut,ms,j0,K0,_s,q=ke(()=>{"use strict";Ut={debug:10,info:20,warn:30,error:40},ms=(()=>{let r=process.env.COZE_BRIDGE_LOG_LEVEL;return r==="debug"||r==="info"||r==="warn"||r==="error"?r:"info"})(),j0=process.stdout,K0=process.stderr,_s={}});import{homedir as G0}from"node:os";import{join as te}from"node:path";function H(r){let t=r??G0(),i=te(t,".coze"),a=te(i,"bridge"),c=te(a,"lib");return{cozeRoot:i,bridgeRoot:a,libDir:c,libEntry:te(c,"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 Pe(r,t=H()){let i=te(t.agentsRoot,r);return{root:i,config:te(i,"config.json"),workspace:te(i,"workspace"),logs:te(i,"logs")}}var ae=ke(()=>{"use strict"});var Kt={};ps(Kt,{AGENT_CONFIG_FILE_MODE:()=>Ht,enforceAgentConfigMode:()=>V0,loadAgentConfig:()=>ie,persistAgentSessions:()=>ir,persistAgentSkills:()=>jt,saveAgentConfig:()=>fe});import{chmod as W0,stat as J0}from"node:fs/promises";function ie(r,t){return zt(Pe(r,t).config)}function fe(r,t){return qt(Pe(r.agentId,t).config,r,{mode:Ht})}async function V0(r,t){if(process.platform==="win32")return;let i=Pe(r,t).config;try{let a=await J0(i);if(!a.isFile())return;let c=a.mode&511;c!==Ht&&(await W0(i,Ht),ys.warn("agent config mode auto-corrected to 0600",{path:i,from:c.toString(8)}))}catch(a){if(a.code==="ENOENT")return;ys.warn("enforceAgentConfigMode: chmod failed (ignored)",{path:i,err:String(a)})}}async function ir(r,t,i){let a=await ie(r,i);a&&(a.sessions=Object.fromEntries(t),await fe(a,i))}async function jt(r,t,i){let a=await ie(r,i);a&&(a.skills=t,await fe(a,i))}var ys,Ht,Fe=ke(()=>{"use strict";rr();q();ae();ys=N("agent-config"),Ht=384});var si=se(V=>{"use strict";var E=S;(function(r,t){let i=S,a=r();for(;;)try{if(parseInt(i(713))/1+parseInt(i(1835))/2+-parseInt(i(598))/3*(parseInt(i(1032))/4)+-parseInt(i(1661))/5*(parseInt(i(1002))/6)+-parseInt(i(1848))/7+-parseInt(i(1070))/8+parseInt(i(1217))/9===t)break;a.push(a.shift())}catch{a.push(a.shift())}})(hn,321889);function hn(){let r=["u1DerLa","zxH0zw5ZAw8","ELjsvhK","q29Kzq","thrTAKe","x2rYB3bhBg8","ywPWA3y","x25HDMLNyxq","DgfYz2v0","Aw5N","tfLru3G","vhbLywm","sNfMyNG","EwPfEKS","uMTpreO","quvlq2K","zuPsDu8","DhDYEgW","CKHvD1O","ChvZAa","mxWYFdn8mhW","zMLUza","BNbfAM0","zLDQt0u","yMfSu2nVCgu","wKzsr0C","BMvY","sLPVuhy","y3jLyxrLuMu","yxrHlcbKyxq","r1Hrshu","BNruCMLLC0m","B0jOvwO","ChjVy2vZCW","igzPzwXKoIa","D24GCMvHC28","vMX2tgG","BgvUz3rO","AKrTq2i","C3vJy2vZCW","y2HLy2Tszwe","zMzLCG","BwvZC2fNzv8","zMLSDgvY","ywr2yw5Jzq","yNnTAxi","wKLXEe4","CePzqK8","y1jWz2G","B3v0sw50zxi","txj1ruW","yxnJCMLWDa","zNDZxZeUmc4","q0rfvhK","Dw5ZAwDUzwq","y2LUsxG","vfneuMG","tfjAA1G","vKXPt08","Cezuv2y","uxnivxa","BhHLA2m","swDVz0G","zfDVCMTLCKC","ufHQAK4","AgLMwhK","wuLXre4","zKHjuwq","DNzdwxK","CMvHzfvjBNq","BwLZzq","uvfttMe","uLbwAfO","zxHWB3j0CW","BKrVu2q","tw1Sq0i","C3rYAw5NAwy","vuvkBKm","tLDMCMm","tMfTzq","Aw5JBhvKzxm","u25wuxq","zxbUzNy","zMH5v2e","qLbuu1u","EuzTtvG","ufrttLK","CMvWBgfJzq","zMLN","yw1LoIa","B25JBg9Zzq","B2LUDfjLywm","tg9JAW","s3fAtKi","twruqvq","z09qruG","qxrpANa","x3bYzwzPEa","zvvYBa","Euv1qMq","BMvLzf9Hy2S","sMHzzhe","r25LDxG","zcWG","x3vYBa","CgzdsNK","qur1s2S","BuPczg8","zw50tgLZDgu","Bwv0Ag9K","AvL1zuS","ENr1EMC","Dg9VigXHCMC","uMH6D3C","u1nYCvy","CMvZzxrfBMq","Agvjtuu","rw54y3m","AfvIA1i","EujkA24","txvTzge","EKXYqxu","CM9YrxzLBNq","BgLZDgvUtMu","x3DZ","BgLUzq","C2vYDMLJzq","C3zur20","rvjst1i","BfjktMS","wgrKvfu","yMLUza","zhvnA1G","uMnmuee","BerTq0u","uxvLDwu","DuTZEKy","ig1LC3nHz2u","qufSCwi","y2jquw8","A09MDfy","DxbKyxrLq3u","ysbTDxn0igi","shn1ugm","r25wwxy","Exzczfi","x21PBMLoyxy","wNDfu3m","AgfUz2u","Dg9Y","zgLMBxC","B1PIDxi","vM5IAKC","x2vUzhbVAw4","AMjWrxC","zxrxB3jRq2G","rhDVDLC","zLPjD1K","wwjvA2q","vfDxsgG","z2v0sxrLBq","ChrVCG","ww93Bxe","rLjQwuS","C2v0q3vYC28","sNfvtLm","D0rgBvO","Dxrjza","AwXK","DLv5Ee8","txr2v08","vNjRwNm","uwnhAwu","tfn0q0u","zwnVBM5Ly3q","uxPNzfu","y29UBMvJDgK","wgTgq08","AxnbCNjHEq","BezSDxnO","AgfZ","t3nyAxm","qwvTBvi","Cu1uB1C","zK5ezxO","CgfNzwHPzgu","Dg9cExrLC0W","uLDqAw0","u0Xkv2e","vxbKyxrLq28","x2HHBMrSzu8","quHVzg0","z2v0u3rVCMe","uNfHsLy","zgvSzxrLrge","CMfTzq","nxWX","zw5NDgG","B2DLr1q","DhblBgi","zMH2tgK","Ae1LC3nHz2u","thPtDNK","A2LlALy","v3fhCgy","zKXvvLi","rvLqBuu","mtbXr29zz00","Ewjwzeu","DefmCeW","B2zM","AxL6C2C","Aw9Ul2PZB24","rg9iweW","D3blzKm","suvtx0vsuK8","y3jLyxrLtwu","sKLTrKC","rwLnwgS","Aw5Lza","zxjYB3i","x2LUAxrhBg8","vfvfwve","C2v0sxrLBq","y3vYC29Yx24","yM1NDu0","A0XPrfq","Ehzyz04","uKfHBLa","r0jJtu4","vevSrfO","yMLUyxj5","EgfAsgG","z1HTze8","ENbwte0","z2v0s2v5","A0XoCNm","ugruBuy","C2vUDa","vvn5sKC","CIb0DhDjra","yxKSihrYEsa","q3nzAuS","Bw5nteS","BwLUzW","y29SBM8","CNjVCK1LC3m","vxjlt20","x2rLyNvN","CM92AwrLihC","wwjltvK","te5dwNy","tKPmtMi","tLHHzgu","t2vtBMi","y2XVC2uSihC","BhrPCgXLihq","ENzIEwm","u1frz2q","sMnVEK4","t3fstLe","ywnRx2nVzgu","C0jdCuW","zNjVBuj5Dgu","AKrmr2W","tg5MCfy","ruLeuK4","x2LZtM9Kzq","zMzMzG","EKTxsuu","BNn2rK8","ignVzgu6ia","zw5JB2rPBMC","BwvZC2fNzq","EMnMruW","DMXNEgm","uezssgK","tfHRBuW","sg5OAwO","uvjPBgy","tuvtu0fhrv8","ywDLrxzLBNq","y2HnyxHdB3u","u2v1rxy","wLDOs28","quDkA3G","zuDLwxK","CgvYC2LZDgu","z2v0qwXSs2u","tNDMDhq","s1Lxrwi","yxnL","DLjeveq","zw5JB2rLrNi","ywXSzwqGBxu","BNrLCG","C2vYDMvYvgK","AwrI","x2zVCM1HDeu","EhzrtKy","CNzHBa","DgDgvwS","yNvMzMvY","B25SAw5L","wu5nsMi","qwLHAgW","zxjFBxnNAwq","B2fK","BMCGB3iGyw4","BufiCuC","B2zMBgLUzq","y1fgD1u","Chv0","A3fvDgS","AeTxEuG","rNnSsfy","zgf0yq","Bhjwyve","A0T5qvy","A1n0yxr1C0m","reLrv3m","twLZC2LUzYa","D01Xz1O","y29Kzq","su9Yr1O","y3vYCMvUDeu","tgLZDgvUzxi","s0LmzMq","uuvNwu0","ywnOzwqSihC","D3nZoI8V","tgX3whG","Cw9Zx18","z2vtEw5J","ywLAuNq","tg9Nsuq","BMvJDa","ChjVDg9JB2W","t1P5r0e","ywDL","x2DLBMvYyxq","CYbHBhjLywq","CMv0CNLdB3u","zNrxvMW","zgvJB2rLzey","x2rLC3rYB3K","t05NDMe","sefmvM0","BMvgz3e","EsbJBg9Zzwq","DuP6Ee0","C3zMDve","x3nLBMrby2S","sMfyDwC","vNzyDgu","u0rMv3G","tg5hquK","vvjtyvy","Aw9U","C2v0zgi","zgLZCgf0y2G","AeLKywW","Dg9tDhjPBMC","y2HHCKnVzgu","uNz2v2q","B25erK4","Ahr0Ca","B2vrDuu","y3ruAw1LB3u","EKjLAM8","ALfdExu","t2P4ufi","CKrMt2i","DwPmvhC","y3vYC29Y","wNfoANC","lcbTyxGGCMu","nhWZFdv8mNW","DgLTzw91Da","Aw1LCYbPBIa","zxj2AwnL","nJaXodq0zfnzBeTS","uMvHzcbWyxm","s1H1CNC","C2HPzNq","tgnxuNm","s3vMrxC","BLnLtg0","s3vhC3K","ww9Wy2m","EevwrhG","BNzrA0m","yMfSrxzLBNq","yw1Lu3bHy2u","nde3nJGYm3zetvvzBa","C25NrKe","DhjHBNnHy3q","Dg9hzw5LCMe","yNniAve","y2jezvK","wwL2y1y","vwD0u3O","sxfJwxa","vLPkuhm","AgvKtwf4uMu","sMrJsxq","x2LUDgvYDMe","wgvZvKy","ihrPBwvVDxq","teHutMO","z0vIzMW","DhfgEfq","EMjgExa","vunur1O","BMCGzMfPBgu","B25LCNjVCG","uMnczfy","q0Xpu0ve","zvLdteu","rLnlwvy","DeLK","vgToEui","B2nRzxrtDwm","rLDt","vwHxDhO","y2XLyxi","B3jLtMfTzxm","qvDquuC","ugnryu4","tMTwuMG","y3rXDuC","EvDiA0K","rMzoweO","AenSB3nLrxy","A0jbALi","z2v0q3vYC28","ywzL","CK5hBhe","ChLLwg4","vLnMrM4","z1rPBwvVDxq","v0jhrwO","BwXHqum","CgXLyxnLiha","AwXSihvZzsa","vwjWufq","B25tDgfYDfi","wKLsAuO","s0rLu0u","BKXPBMu","BMv4DcGPigm","igXHCMDLCIa","A2rNwgW","Dgv4DfbHEwW","twHlzha","C3bSAwnL","yMfJA3vWigu","rK5iDfG","rfbbv3q","CYbWyxjHBxm","svbJtwK","uLj4zgy","x2rPC2nVBM4","DMfgvvq","Bg9N","rxP4C3y","z05iteG","BM93","D0TPwwK","x3DHAxq","zwn0","sxr2zgy","x29UrxjYB3i","C2fNzq","uNjrDLy","tKfusvzfx0u","DgLLCKPtt04","x2TLEvbHDgG","t2zlvK8","rhrws1m","rerrswe","Dg9mB3DLCKm","DMvYC2LVBMm","sLvit1G","u3jIzwq","twXuvw8","A1j5tK8","EgnXr2y","sMjlCLq","uvDHDNi","vxjnEve","ANvJwwG","v3fLyMK","rezyD1u","DMfSDwu","ywTAzhm","y3jLyxrLq2W","BLPiEhe","t0LOCfK","sMjJzxq","uLzpvem","A0f6Dfm","B25tDg9Wsw0","wM9JBwq","u2vYDMLJzvC","DMfS","wKTfCxi","CefSDw0","quXm","C3rLBMvYCW","B05YwMe","qu9VzwK","zLHnAM4","B3bLBKrc","ANLZrK8","svnyrhm","vKXNyNq","z2Hqteu","zeftDeW","x3bHDgHlzxK","veHpDNq","D1r0zMe","zxjHDg9Y","DeDsz2m","BwvY","mhWYFdr8m3W","ufPmBMS","t2HPuNG","BML0AwfSAxO","C2DPza","ExvduKi","x2LZsw5PDa","y3vYC29YlNm","BNfqs1u","r2nxrNG","tuTrENm","B3nLrxzLBNq","yLngD2i","y29UBMvJDca","Cfj1DeW","u2DYChq","CgLUz19VBMm","vefYq08","B3vUDa","tKDFrvjst1i","s1HMzgW","EwfTzLa","x29WDgLVBNm","z3jdvuK","uxbKExu","zM9YrwfJAa","CMvHzg9UBhK","Ce9eAee","x2nYzwf0zvm","D2LSBfjLy28","ChzyEgW","r3rPwwe","Fdj8ohW1Fde","BMrWB2LUDca","y0Ltu2m","Aw5L","qNvktwq","sNPJBM0","Defqwgu","u0nbAeq","BwPKuNq","u01OBe0","vMXjs1O","r1feAeq","suncug8","y0nqquK","x3jLywr5q2W","Dg9qzem","rKL6Efq","ELfcBNG","y1bdrKO","y2f0y2G","zKDqAeO","wejJsum","uxP0uKC","zxjYtxnN","B25ozxr3B3i","Cg9PBNrdB24","uhHhB0e","yMrKvwm","CMvHzhLtDge","sfzMqKi","B25nzxnZywC","uwnkqxC","A3DdrgS","yNL0zxm","zNvUy3rPB24","r1L4wwG","BgLTAxq","Bg9NsurozxC","uK5dBve","BfnpBgW","z2vrDwv1zuW","ywnOzwq","Ahjmwxu","B3jpBMXPBMu","yxjWrvC","zMrXBuu","yNvZwgK","BwfUDwfSihi","B1fLww8","AxLqCuy","AxnmB25N","z3DYteC","z2DZBNi","yw5Nzq","thzNweG","rxzLBNq","yxbWBgLJyxq","r1PtBNG","AhfMyNK","B25dBg9Zzq","yMXVy2TLza","Dw1pBeO","t1bftG","ywX3yxLZ","Dhj1y3rVCIa","s01lDeO","x2fKzfDZtgK","x2nSzwfYvgK","DxLVB3C","AgvHzgvYCW","sKLStMy","A1bTy1e","q0PzqwW","BwvZC2fNztO","x2XPC3rLBMu","BfPIAuK","s0vwEem","DKjut3y","uenRuK4","tw9KDwXL","CffryuO","C0jf","CLvurxe","zxjFAxnFywm","ywnRpwzYB24","CeX4twC","qNfvBuK","ANfjt2W","AgLNAa","quHSuNG","y3Hvwu0","Ef9MCM9UDgK","B25fCNjVCG","yxrLq291BNq","mhWXFdn8nhW","r2LRC20","ExHwD0e","y0vsDg8","zMvY","x3jLy29UBMu","vK5yvxC","wvLjsg8","zvPivfK","CM92AwrLihy","ywrK","zLzWA0u","vLrACfO","C2v0y3vYC28","zw5fDMvUDa","Dw5RBM93BIa","Aw47y2HHCNm","B3nLza","C01eBuG","C3rVCMu","x21LC3nHz2u","y29UBMvJDa","z2vY","AxnFywnR","vgLTzw91Da","qMTkDgu","tKDLs0u","z2PIAxK","vvHJr0O","zcWGDw5RBM8","r01yANe","m0jUAfLMqq","Au51ELG","t0vmsLe","y2HLy2TdDxi","svfSuhi","vxPQyw0","vuviAwe","D2vqDMO","DhjPzxmGCMu","qxjIs0C","EvfJqwS","qwvNwfK","ueTOrNC","BgL1yxK","B2XKvMvYC2K","DgHLBG","uLjLwhG","yMzJwwy","q21nzMe","ELjxtM4","EMzlq3a","y2XLyxjtDg8","tfHMDNi","C0nVDw50zxi","ywrKq291BNq","CNjABey","x0rctMfTzq","BNfJyvi","yxbWzw5Kq2G","ChbL","x2HHBMrSzva","tNP6BhG","lcbxzwjtB2m","tvf5r3G","r1bWt2G","q1zrwwi","DxrIqwO","z3vnDK0","zKTevu0","CMvZB2X2zq","Aw5KzxG","sfzwyKW","sujrA3q","C0v4rMm","y2Tovxy","tfPmz0u","CLf1zwC","q0Xpu0LorW","x3DZsw5ZDge","Bg93","v0n0q1K","A2v5CW","zsbHihn0CMK","uw5NDwi","uNn3s0O","CMvKDwnL","rgflvLa","B2jQzwn0u3q","z2v0","yKHUrem","EwHQyMi","y29UDgLUDwu","D2fZq2XLyw4","qNf0yKq","z2v0qwXS","Ce1lDLe","zufJAW","Bvnhzwe","vKfxCgK","BuXuz0G","r3Dkyu4","BMDuAw1LCG","zMfUCxO","AxnrB1nby2S","wMrwAhm","zNjVBNrPzxi","zezsB0y","AM56B1G","rKPWr0K","vMrPyu0","CM92AwrLige","zM5LyLG","D0TgtgG","CeDAvwC","vLjxseK","Dg9cExrLCW","CMvTB3zLq2G","u2XzCuy","uunHwxq","v2zHrvq","yNL0zu9MzNm","thjpD1K","x2n1CNnVCK4","zgvIDwC","tMzArwC","y2HnyxHuCMK","EevJDNG","z2vjBMzVu3K","EMH0zee","vuzerMm","q291BNq","qwjVCNrfCNi","vNznwKW","BIWGAg9ZDg4","vfbYCg0","vKXdyxy","x2rPC3bHDgm","CMvXDwLYzwq","ywrKt25L","DeDnC3e","qKvhthC","CMv0BeS","zNjHBwvuExa","ufnhswG","wwPqDuW","mti4ntKWrhfWDe9r","EvjJzwu","uw9Arg0","C2v0","BMrLEa","AgfZt3DUuhi","C3HjAuW","zfHtEKq","Efrurw52","DwrOwLm","wMHzBgq","vM5zv2e","yLvqC3a","u2Hvr2C","qKfRDe8","sLfqz2W","whbpCvq","wxPpqxi","CMvJB25Uzwm","AgnduKy","mNWWFdr8nxW","DLzIwwW","wMLIzeC","Ew5gEKO","r1nzEuK","CMvZzxrdB3u","C29YDa","zM9Yy2u","x1fVu01HBMe","s3PrCNq","tLLhrLC","B3jRig9MzMW","D3r2Cgm","serKr2C","CgHkyKO","ihrPBwvZ","CfruBhm","BxnNsuq","DezbzK8","twvZC2fNzuu","Cw5iCum","q2Lvtfm","CejoBhO","y29Uy2f0","AwrIrfq","yxGGCMv0CMK","q0Htt00","zeThvge","Dg9cExrLC0i","DhHTDMe","EuvuyLi","EeLKqMS","vMrgsMi","BMDLza","tg9NsurozxC","zLvvsgW","v3Pttuq","C3vIC3rYAw4","zNjVBujPDhm","EvvtzwK","AwXLx25HBwu","DxPwzeG","tNnWD1a","A2v5","FdL8mhWZ","uxLJt1y","AwDHDg9Yt24","sfrsChm","zxjFywnRx20","CMTLCKDSB2i","zu5iBfe","D3nbEgi","EKv0vMi","wwrPufa","y3vYCMvUDeK","uLjpuG","Eg9Xq1G","x2rItMfTzq","q1roAKu","y291BNq","CNHis20","CND5zeK","zg9Uzq","y29UBMvJDfm","CgfNzxnOB3C","u3rYyxrLz3K","D0znzxK","t2jQzwn0","C0Xf","Cgf5Bg9Hza","AMXvrwy","DwPLu0K","rM1dENK","sfDkshy","v2LrAwC","vgPZwee","B1D5wuG","ywrKrxzLBNq","DgHHBIbSB2m","sLPXwge","CwrWs2O","A29JwLe","y2vZC0HHBMq","zNjVBunOyxi","yM9L","shz5wvO","CujsBNa","CgHQyNu","DcbSAw1PDa","Cg9W","zMX1C2HfEha","rw9iruS","uvfAtM8","rffwuM4","v0LzrK8","C29Tzq","lcbOB3n0BMe","zw5KCg9PBNq","txjSreC","r1boDeq","CKr1q00","uMTltgW","ywXSq3vYC28","yxvlrgG","u3HHs3y","CgLUz0XVC3m","icSG","Bwjruge","zKzACxC","D3Pcrfq","v2vIu29JA2u","zgvSzxrL","CMDKuuS","BM5Ly3q","zw5HyMXLvhi","ihrYEsbYzwm","zxmGCMvHy2G","jMPZy2fSBgi","whLUBMy","Cgu6ia","CMvZzxruCMK","uhrdtwe","C2vUza","C3bSAxq","B25pCgvU","r1vjDMC","m3WWFdj8nhW","rxLPBvm","sxLXAxK","ihbYB3rVy28","rLfzvfG","CNzHBfzHBhu","ChrLELi","Ag52sNe","CKTiy2e","u2vXsuq","v1HZwNq","igzHAwWSig0","y29TCgXLDgu","C2nZsKC","ywXSB2nvBNm","ihzHBgLKihm","yw51Ce1LC3m","De1HBMfNzxi","C2Thy1m","Dw50","vMPKBLa","Bwu6ia","BMnLq2XVC2u","y09Wzw4","zMzmAw5L","uxLAz00","BNfwu1K","s1HurhO","yvLnzw0","veHuzLq","vejsEfi","tgfKu0C","B1rbswS","wujzExe","r0Djs2C","r0nizwm","o2nOyxjZzxq","vw5AtvG","A1DivMy","uwf2v0e","DePntNC","v0fkCLm","zxjFCw9Z","tevkrwK","EfHNEfq","y2XVC2u","BMnVzgLUzW","C3rYAw5N","pxv0zI04","s1jzD1m","nxWXFdD8mW","y3rVuM4","qKfpsgm","B2zMC2v0","y3vZDg9Tshq","CNrNAM4","x2LUAxrqCM8","Bu5gseS","zNjVBuHHC2G","wfbhyLu","zvLpu2e","sLnptLa","Bhvft2i","A05xDva","zKPUu1K","BgLUzw5V","x2DLDeLUDgu","t2L0sg4","Aw5PDcbrB1m","s0nMBvm","yxbWBhK","A3fhyLa","DMfSDwvZ","Bg9Nsurhzw4","teT4r04","vwfgrNe","A29LBfG","C3vIyxjYyxK","ChHeA24","qNDTzNO","q09otKvdveK","t3bLBKv2zw4","BMv3vMvYC2K","zgT2wvO","zwLqq1i","EKr5CeK","wuPmzhy","r1rAtMe","wxzlB1m","A1fwtgu","q0vhEuq","rLjptLrjrvi","yKPtvwC","x2n1CNnVCK0","C2v0u3rVCMe","sLrhBxa","zNzRtuK","Cgf5Bg9Hzeu","zNjVBu51Bwi","y2uGBM90igK","zw1PDa","DgvmB2Djre4","x2jPBMfYEvq","x2LZv29YA2u","AxjLza","vKLZrLi","BgvY","ExbL","yM9KEq","DwHuwwK","zNfJCfq","Eu5Ivvq","v01pq3O","zMTPrwu","x194x21Zz18","AePHANu","svrqBgS","CM92AwrLigi","Dw1HzwO","qLjYCw4","AMjvzhC","s0rWyMu","DMnSwhm","x3bPBMDmB3m","yw5xyNG","BMrWB2LUDfq","zgLZywjSzue","AxnszwfKEq","wwjcsxe","v3bKyM0","C0zqA3u","y0jWs0C","CMvHC29U","C2nYAxb0","zMXVB3i","vgfN","CMvZDwX0","uKPYwum","x3fVC0rc","tuX4tfi","Au9At3i","tfH5rfG","z3vbruO","nJmWntu4zvzzEgzp","DgXyALy","C1vUrfy","DxnLCKLW","B3bLCNr5","sxnjDgC","zwneExu","rwX6yK8","ve9gDfu","z0zmy2W","sw51C3O","t2jPALe","yNL0zuXLBMC","DM9ouMK","rNjVBNrPzxi","Dhr3Awq","y2rIuwK","mxWYFdb8m3W","AvjNsg4","wKHRDfG","x3bPBMC","qw1VDw50","yNPfA1K","BvfoCKe","DvDyDeW","DuPWwvu","y1vSuxm","Cfriq1O","C3DbCLa","CwjVuKu","mtuXmZmYngrdugPqCq","sxzpvMO","BMfTzq","y1rXDKm","zw5HyMXLuw8","z2v0t3DUuhi","q1fMAuy","tg9LqKm","u2HHCMvKv28","zMrIsuy","qvvQyMi","sfvHu3u","DhbizwfKzxi","DNHjAeK","CNHPqKO","A3rYC2m","uMDMvg0","C1HNt3O","uMvJB25Uzwm","B25VCgvU","AM9PBG","wKXlr2e","y3bKueu","y2L1ww0","DxrMofDYAxq","EvP1qKy","rgDiBwK","BeHHBMrSzxi","yvrTBem","Dgv4Dc9WBge","Dgv4Dc9Qyxy","D1DAAhK","zxq9DxrMltG","DuzlDwm","zgrjrcWGzgu","DNDsAeW","vM9hyvG","uKPMwwi","ndm4nZa1nNjvD1PUCa","AKHKD3u","Ehjnz2S","x2LZtwLUAvC","yK9uvMC","sxHJtLa","AhndvwS","BM9dr1e","DhjPzxm","mdaWma","A01mD0O","qxvSBKm","BeDyz2e","r1DssK4","zxjlsLy","x2nSzwfYugK","AevYCM9Yrxy","ign1CNnVCIa","CMvWBgfJzui","EfvZzuvUDG","EK9vsei","DezxANa","yxjYyxLIDwy","tKzpsvq","EgHOqxG","DMDIrey","yxvozw8","yxv0B21HDgK","q3vZDg9Trxi","uhbNrge","y0fSC0u","vLnoDeW","A0TfwuS","y29UDgv4Da","wMD1v1O","rerYuge","q1bJvge","Cw9Z","x0vysvnu","qNjPzgDL","Bwf4twvZC2e","uwjLBMO","Dev2zw50","uLjSr0K","C3rHCNq","tu9yC1O","zw50","wMXLCw4","yNLL","mdaWmdaWmda","sK1Qtge","ihzHBgLKigq","vgDUs3G","yKDir0m","BNrbBMrvCgq","AwHNA2i","zwTevLO","y3jLyxrLrxi","s1bhuNa","EgnWAve","uMLJv3u","vxnNDu0","ze1jEKW","B25Uzwn0Aw4","v3n4u3e","x29Ut3bLBG","EKjrvui","rhDWCNC","rKDQAuu","D0fXv3u","yw5Hz2vY","x29UtwvZC2e","B25TzxnZywC","BM9Uzv9UB24","ywDLu2HVDW","CNnVCKzPBgu","CevrwK0","ywDLsgLKzq","D0v6q00","BxbXquq","ugTUtxe","y29UC3rYDwm","Bg9IywXty28","DhLWzq","suL3vhy","BKzvv20","z0DzsfC","wKXLwLu","q3HqAwG","u2TPCcbWyxm","y2XVC2veqG","zfHnEhu","twDPtMW","CMvTB3zLrxy","rMjYv3i","B3PAtg8","ChDjwgO","ihjLy29UBMu","C0XPC3rLBMu","D2vzsey","wfj5z24","B1rsyuG","zxjYtM8","yK1ZCM4","yNvMzMvYzwq","A3jOtgK","DMvY","CMTothu","rgvKAwnHDgu","CuDqsxa","Aw5KzxHpzG","q21cqu0","Bw1Nzui","CgfYC2u","BND3wwm","ExbqvvK","Cg9PBNrbBMq","D2vI","DKjzCM0","AvP0D0y","Dw9MAfa","ww55ENK","yxv0BW","seTTDwi","BgDqtgq","DwTYqKu","we9lCvm","tKHxDwu","rKLmrv9ot1q","wuzZwMq","ANzPr2O","DgLUzYbZzxi","EwjVtMK","AePfwLe","DMP0qMC","DhD4uxy","uw9QrM8","D3fqwg8","EvbXrum","y3jLyxrLt2i","txDyEuq","u3H1u0y","uLzAAfO","EKHnr3q","z0vrzfK","z29PBMCGyxC","m3WWFdj8mxW","mtq2mZm2odvcAfnnCwC","mxW0Fdb8m3W","DMvUDa","Bhrzz3a","ChfkExa","CNnVCL92ywW","DgLUrxi","BhrzzMq","uLPKCxa","y2fSBa","Axjft2C","B2nRzxrgywK","vLzmAKu","z2v0q3vYCMu","x2LZqNjVD3m","DezUwe8","C01dDLK","CMvUDevUzha","runWzuy","A2z2u0e","Dg9oDw1Izxi","sNbKsKW","B25mAw5L","x2LUAxq","Ae1YALy","Cgf5Bg9Hzfq","CxrWr0u","BwvKAwf0zwW","DgvZDa","uK11B2O","x3nLCuLK","zMLSzw5HBwu","x29Uq2XVC2u","yw1L","qwntDu0","v3nds0C","zwP3svm","CMfNzvn5BMm","D0PVsgi","B0jvD0G","DKjhwvi","DeDsEw0","AMjABLG","sLfXBu8","mxWZ","zw50zwqGDhK","wufeBMi","ANLtEfa","x2nVBM5Ly3q","x2LZtwLUAvq","zuPwCLa","BMCGDxjSoIa","x3bYB3rVy28","wNv6Evu","DNzlCMG","q3vZDg9Tq2W","x3bPBMDqB24","we5rAvO","x29UugfNzu4","AwXLtMfTzq","C3nHz2vfDMu","CgLUz0LUDgu","DhDVCMTdAge","CMPzs08","uufmthC","uvfgrwC","zwrPyxrLBhK","CvjUzu8","wfLyvMm","BLr6tgW","B3jRzxjhBg8","zu5bD1a","CLzHBhvLCW","ww1tAxe","ywnR","A1bKExe","B3bLBIa","vw5Oyw5KBgu","ru9bzeO","rMzhu28","Dw5KzwzPBMu","C1jOqLq","AMPxvvC","DMHmseS","aaaaaaaaaaa","ywXS","yMLUyxj5vhK","ChjVDg90Exa","rfzSCuG","CwHmz3y","ruLxAwe","CgLUz09Uy2u","l3DZl3yY","Ec1TC2CTy3u","vNHoCK4","BNrKBfO","ugzVCMu","s0XhChG","yvvxwuO","tunSsuS","sLPvD1u","tfLOuxG","ywnRDxbfBMq","yM9Nq3i","x2HHBMrSzvi","yLbAAfe","u0PLDKK","C2XPy2u","C3HysuW","BNbSzuC","D3jPDgu","vLvcDuq","CMvJzwL2zwq","ve5AtwO","zxLpyKm","sunjsM0","Afbbrwq","zgvMAw5Luhi","CMLLC0nVDw4","B25szwnLAxy","D3jPDgvvAw4","B0HOrwe","x3jLBw92zvC","CMvQzwn0","yw1pBNC","EvjLy29UBMu","AxnrB1nnzxm","sxrMywy","BeDnEvK","BwfW","BNrfBMrWB2K","zLDwt2e","BfrPBwvVDxq","CMr5wNy","ELDZzNa","t21iBwu","ue11tfu","uxrhzMS","y3jYsNO","r25ZqMq","CNzsEem","C1H3zfa","wujsC0m","DxjS","r2ret0q","D0L1Cwu","EwvSEwG","s1Pfuwi","vKjpDuK","x2n1CNnVCKy","x3nVy2TLDa","sKTtzLy","q0XXr3e","AgvHzgvY","v2f6qMC","zgvS","B0LMvLK","u1jju2u","qwDLvhG","nxWY","y0jTuhC","zv90Aw1LB3u","q1HTs2y","u0LYvNq","zxjMvfi","BgTxtgS","wLrRDeq","swvRCu8","ihn1y2nLC3m","uK1HugC","CLPHwxO","sLH3zvq","AxnAzxjV","qwjgq0e","te1yuxG","rxjYB3jdB2q","y0HgBem","rMzprwy","Aw9UvgLTzw8","D053CfO","AezVqve","s1npwxi","zeTeBfO","C0THCLO","CMfTugfYyw0","D0rUEw0","AvnjAuy","EeXbzM8","Bff6AK8","sxrgC1q","CNnVCL9Uyw0","tgP1v1q","tufyx1jfvfi","BwvZ","Bwf4uMv0CMK","v2HQq1u","CMXeEei","v0nXu0O","DufiDfy","Bwf4tg9ZC0m","y3jLyxrLt3a","Ew1Kvem","yvz2u20","tNrSENa","zffNENm","ze9pAwe","zv9ZDwnJzxm","t1bftL9fuLi","B3bLBG","q3Dfzhq","yKjvDvG","CMfUzg9T","yxnZAwDU","BvjsEfK","rhnxq04","AefJA01LC3m","BhfjwMy","zvDyD0O","B2nRzxq","y29UBMvJDeu","q29UzMLN","DhLgEfa","AMvJDfn0B3i","q09oveLovuu","BwLUAvbYB2C","vvPkqK8","DxHztKW","reiGzMfPBgu","DeLUDgvYy2u","C29xBK0","C2vYDMLJzs0","u2DlEuO","y01pEeu","D3PxtxK","tvfgs28","zxjFDhrS","sfrQs2C"];return hn=function(){return r},hn()}var $a=Object[E(1334)+E(1006)],ex=Object[E(1037)+"opertyNa"+E(1410)],$s=(r,t)=>function(){return r&&(t=(0,r[{FUrBs:function(c,f){return c(f)}}.FUrBs(ex,r)[0]])(r=0)),t},tx=(r,t)=>{let i=E,a={HVVbL:function(f,d,p,m){return f(d,p,m)}};for(var c in t)a[i(639)]($a,r,c,{get:t[c],enumerable:!0})};function nx(){return Vs||(Vs=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function rx(){let r=E;return Ys||(Ys=[IDBCursor.prototype[r(1498)],IDBCursor[r(1304)+"e"][r(659)],IDBCursor[r(1304)+"e"][r(659)+"PrimaryKey"]])}function sx(r){let t=E,i={JIlNf:function(c,f){return c(f)},wpKfC:function(c,f){return c(f)},gEbfl:function(c){return c()},wFMey:function(c,f){return c(f)},OmHme:function(c){return c()},eWXwJ:function(c,f){return c|f},FJLIu:function(c,f){return c>>f},KZEQb:t(1500),uRoFq:function(c,f){return c instanceof f}},a=new Promise((c,f)=>{let d=t,p={DVlqH:d(1674)},m=()=>{let y=d;r["removeEv"+y(1562)+y(1480)](y(1493),_),r[y(1163)+y(1562)+y(1480)](p[y(1305)],b)},_=()=>{let y=d;i[y(543)](c,i[y(1668)](be,r[y(995)])),i[y(1864)](m)},b=()=>{let y=d;i[y(799)](f,r[y(1674)]),i[y(1352)](m)};r[d(810)+"Listener"](d(1493),_),r[d(810)+d(1780)](d(1674),b)});return a[t(613)](c=>{let f=t;f(1500)===i[f(1364)]?i.uRoFq(c,IDBCursor)&&fr[f(716)](c,r):(_0x270ee3[_0xce8bf9++]=i[f(1434)](i.FJLIu(_0x19f363,12),224),_0x36ec7d[_0xf6168d++]=_0x58b743>>6&63|128,_0x2da624[_0xf6c034++]=63&_0x2cdb59|128)})[t(492)](()=>{}),pn[t(716)](a,r),a}function ix(r){let t=E,i={cxrQD:function(c,f){return c(f)},grCUI:t(699)+"or",YdiPP:function(c){return c()},tgFUk:t(871),tJMNw:t(1674),FfNXJ:"abort",kKyAV:t(475),JcozN:function(c){return c()},ntdlZ:function(c,f){return c===f},vRDTD:"YtIzv"};if(gn.has(r))return;let a=new Promise((c,f)=>{let d=t,p={HqbwU:i[d(1755)],fhvLi:i[d(899)],xvXgN:i[d(1886)],YjPuL:i[d(1772)],oNrZa:function(m){return i[d(786)](m)},bUPsp:function(m){return i[d(1713)](m)}};if(i[d(1312)](i[d(1746)],i[d(1746)])){let m=()=>{let y=d;r[y(1163)+y(1562)+y(1480)](p.HqbwU,_),r[y(1163)+y(1562)+y(1480)](p[y(1654)],b),r["removeEv"+y(1562)+"ner"](p[y(1681)],b)},_=()=>{let y=d;if(p[y(712)]!=="cISSc")return _0x2d18ef?this[y(1640)+"E"]():this[y(761)+"E"]();p[y(426)](c),p[y(725)](m)},b=()=>{let y=d;i.cxrQD(f,r[y(1674)]||new DOMException("AbortError",i[y(464)])),i.YdiPP(m)};r[d(810)+d(1780)](i[d(1755)],_),r[d(810)+"Listener"](i[d(899)],b),r[d(810)+"Listener"](i[d(1886)],b)}else return this[d(1607)+"tManager"]?.["getCurre"+d(1347)+"ntTriesCount"]()||0});gn[t(716)](r,a)}function ox(r){mn={lxekc:function(a,c){return a(c)}}[E(1515)](r,mn)}function ax(r){let t=E,i={kRyNO:function(a,c){return a(c)},fFZqw:function(a,c){return a(c)},hsCUk:function(a,c){return a(c)},LXkmL:function(a,c){return a===c},Enxcs:function(a,c){return a in c},dUlZJ:t(655)+"oreNames",qBRnp:function(a){return a()}};return i[t(1731)](r,IDBDatabase.prototype[t(1850)+"ion"])&&!i[t(1571)](i.dUlZJ,IDBTransaction[t(1304)+"e"])?function(a,...c){let f=t,d=r.call(i[f(402)](kt,this),a,...c);return cr[f(716)](d,a.sort?a[f(739)]():[a]),be(d)}:i[t(819)](rx)[t(1534)](r)?function(...a){let c=t;return r.apply(i[c(841)](kt,this),a),i[c(1076)](be,fr[c(656)](this))}:function(...a){let c=t;return be(r[c(929)](i[c(402)](kt,this),a))}}function xx(r){let t=E,i={fvBWP:"function",kwCDk:function(a,c){return a instanceof c},DQVRn:function(a,c){return a(c)},nXjdT:function(a,c,f){return a(c,f)},hqfby:function(a){return a()}};return typeof r===i.fvBWP?ax(r):(i[t(505)](r,IDBTransaction)&&i[t(826)](ix,r),i.nXjdT(ei,r,i[t(531)](nx))?new Proxy(r,mn):r)}function be(r){let t=E,i={rdyZv:function(c,f){return c(f)}};if(r instanceof IDBRequest)return i[t(1350)](sx,r);if(dn[t(1634)](r))return dn[t(656)](r);let a=i[t(1350)](xx,r);return a!==r&&(dn[t(716)](r,a),pn[t(716)](a,r)),a}var ei,Vs,Ys,fr,gn,cr,dn,pn,mn,kt,Xs=$s({"node_modules/idb/build/wrap-idb-value.js"(){let r=E,t={Ucmbe:function(i,a){return i instanceof a},bmguM:function(i,a){return i===a},UCTGZ:r(655)+r(1880),uxYNL:function(i,a){return i===a},JTGmp:r(586),rUTEq:function(i,a){return i(a)},ciuYm:function(i,a){return i instanceof a},Rhzww:function(i,a){return i===a},vVbYl:r(795),Jzcnm:function(i,a){return i===a}};ei=(i,a)=>a[r(828)](c=>i instanceof c),fr=new WeakMap,gn=new WeakMap,cr=new WeakMap,dn=new WeakMap,pn=new WeakMap,mn={get(i,a,c){let f=r;if(t.Ucmbe(i,IDBTransaction)){if(a===f(795))return gn.get(i);if(t[f(1679)](a,t[f(1867)]))return i.objectStoreNames||cr.get(i);if(t[f(1443)](a,t[f(954)]))return c[f(655)+f(1880)][1]?void 0:c[f(655)+"ore"](c["objectSt"+f(1880)][0])}return t[f(555)](be,i[a])},set(i,a,c){return i[a]=c,!0},has(i,a){let c=r;return t[c(1055)](i,IDBTransaction)&&(t[c(1567)](a,t[c(734)])||t[c(478)](a,t[c(954)]))?!0:a in i}},kt=i=>pn.get(i)}}),ti={};tx(ti,{deleteDB:()=>fx,openDB:()=>cx,unwrap:()=>kt,wrap:()=>be});function cx(r,t,{blocked:i,upgrade:a,blocking:c,terminated:f}={}){let d=E,p={auKDh:function(b,y){return b(y)},hUbkR:function(b,y,k){return b(y,k)},CVQYb:d(1674),STEdV:d(1241),qRneO:d(904),VUBuD:d(398)+d(1602),WsCKG:function(b,y){return b(y)},WfaET:"upgradeneeded"},m=indexedDB[d(1425)](r,t),_=p[d(1252)](be,m);return a&&m[d(810)+d(1780)](p[d(687)],b=>{let y=d;a(be(m.result),b[y(612)+"on"],b[y(941)+"on"],p[y(836)](be,m[y(1850)+y(1812)]))}),i&&m[d(810)+d(1780)](d(533),()=>i()),_[d(613)](b=>{let y=d;if(y(1241)===p.STEdV)f&&b[y(810)+y(1780)](p[y(1284)],()=>f()),c&&b[y(810)+y(1780)](p[y(1328)],()=>c());else{let k=p[y(1572)](_0x32d87e,p[y(633)],{message:this[y(1752)+y(1700)+"age"](_0x4509d3)});this[y(959)](p[y(633)],k);let I=_0x46963d(y(904),{reason:this[y(1752)+"rrorMess"+y(1793)](_0x287d22)});this.emit("close",I)}})[d(492)](()=>{}),_}function fx(r,{blocked:t}={}){let i=E,a={Uzjam:i(533),npleG:function(f,d){return f(d)}},c=indexedDB[i(1648)+"tabase"](r);return t&&c["addEvent"+i(1780)](a[i(603)],()=>t()),a[i(1326)](be,c)[i(613)](()=>{})}function S(r,t){r=r-384;let i=hn(),a=i[r];if(S.aTSIxn===void 0){var c=function(m){let _="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=",b="",y="";for(let k=0,I,L,R=0;L=m.charAt(R++);~L&&(I=k%4?I*64+L:L,k++%4)?b+=String.fromCharCode(255&I>>(-2*k&6)):0)L=_.indexOf(L);for(let k=0,I=b.length;k<I;k++)y+="%"+("00"+b.charCodeAt(k).toString(16)).slice(-2);return decodeURIComponent(y)};S.UHipak=c,S.mpdDrY={},S.aTSIxn=!0}let f=i[0],d=r+f,p=S.mpdDrY[d];return p?a=p:(a=S.UHipak(a),S.mpdDrY[d]=a),a}function Zs(r,t){let i=E,a={TpgnR:i(467),EIDRN:function(m,_){return m instanceof _},RRxdf:function(m,_){return m in _},ymdTC:function(m,_){return m===_},rrZlF:i(906),WBGEj:function(m,_){return m!==_}};if(!(a[i(1720)](r,IDBDatabase)&&!a[i(1915)](t,r)&&a[i(1418)](typeof t,a[i(623)])))return;if(ln[i(656)](t))return ln.get(t);let c=t[i(1541)](/FromIndex$/,""),f=a[i(1895)](t,c),d=ri[i(1534)](c);if(!a[i(1915)](c,(f?IDBIndex:IDBObjectStore)[i(1304)+"e"])||!(d||ni.includes(c)))return;let p=async function(m,..._){let b=i,y=this.transaction(m,d?"readwrite":a.TpgnR),k=y[b(586)];return f&&(k=k[b(638)](_[b(1838)]())),(await Promise[b(1302)]([k[c](..._),d&&y.done]))[0]};return ln.set(t,p),p}var ni,ri,ln,ux=$s({"node_modules/idb/build/index.js"(){let r=E,t={FslHV:r(567)+r(1376),nqPKU:function(c){return c()},URpmC:"get",ctquG:r(662),Jbcet:r(1742)+"ys",XBTay:r(1766),kdgXl:r(577),cTqvC:r(844),twxQv:r(1879)},i=t[r(1769)][r(856)]("|"),a=0;for(;;){switch(i[a++]){case"0":t[r(449)](Xs);continue;case"1":Xs();continue;case"2":ox(c=>({...c,get:(f,d,p)=>Zs(f,d)||c[r(656)](f,d,p),has:(f,d)=>!!Zs(f,d)||c[r(1634)](f,d)}));continue;case"3":ni=[t.URpmC,r(1689),t[r(1884)],t[r(415)],r(792)];continue;case"4":ri=[t.XBTay,t[r(1906)],t[r(1035)],t[r(1205)]];continue;case"5":ln=new Map;continue}break}}}),dx={idb:function(r){let t=E;r[t(1527)]=Promise[t(637)]()[t(613)](()=>(ux(),ti))[t(613)](function(i){return i})}},Qs={};function ye(r){let t=E,i={oFEQQ:t(1218)+"2"},a=i.oFEQQ[t(856)]("|"),c=0;for(;;){switch(a[c++]){case"0":var f=Qs[r]={exports:{}};continue;case"1":var d=Qs[r];continue;case"2":return f.exports;case"3":dx[r](f,f[t(1527)],ye);continue;case"4":if(d!==void 0)return d[t(1527)];continue}break}}ye.d=(r,t)=>{let i=S;for(var a in t)ye.o(t,a)&&!ye.o(r,a)&&Object["definePr"+i(1006)](r,a,{enumerable:!0,get:t[a]})},(()=>{let r=E;ye.o=(t,i)=>Object[r(1304)+"e"]["hasOwnPr"+r(1006)].call(t,i)})(),(()=>{let r=E,t={gOPEH:function(i,a){return i!=a},mhRmU:r(1297)+"d",amOnw:"__esModule"};ye.r=i=>{let a=r;t[a(1549)](t.mhRmU,typeof Symbol)&&Symbol["toString"+a(994)]&&Object[a(1334)+"operty"](i,Symbol[a(1816)+a(994)],{value:a(552)}),Object[a(1334)+a(1006)](i,t[a(1341)],{value:!0})}})();var J={};(()=>{let r=E,t={VvXte:function(s,e){return s(e)},yEuBd:function(s,e){return s+e},GGIKg:function(s,e){return s+e},cinIx:function(s,e){return s+e},LadSG:r(610),tqFxT:function(s,e){return s*e},Mumda:function(s,e){return s(e)},oHhEa:function(s,e){return s+e},eZHTY:function(s,e){return s(e)},jbZnX:function(s,e,n){return s(e,n)},JhYdq:function(s,e){return s(e)},sRhBT:r(1079),Yowmq:r(1722),mbQPa:r(1119)+r(1119)+r(1119)+r(1119),udhZS:function(s,e){return s|e},PxGoA:function(s,e){return s&e},rHUwZ:function(s,e){return s&e},bPZhQ:function(s,e){return s<e},JMjLa:function(s,e){return s(e)},kOftV:function(s,e){return s(e)},phjbu:function(s,e){return s+e},VxNrN:function(s,e,n){return s(e,n)},CQfiF:function(s,e){return s===e},aUWYJ:r(818),NfZEg:function(s,e){return s!==e},gGYHW:"QzuEi",qdpKj:r(1105),TkNyB:function(s,e){return s>e},jbpEw:function(s,e){return s!==e},QQZNo:function(s,e){return s-e},XesVF:function(s,e){return s-e},mNFHK:function(s,e){return s<e},fXMjn:function(s,e){return s===e},AGJkx:r(465),VBOuI:r(1653),rlDxB:function(s,e){return s<e},MOXsZ:function(s,e){return s-e},lZbiI:function(s,e){return s&e},DtVKS:function(s,e){return s>>e},FmCzy:function(s,e){return s!==e},ZFRGG:r(1344),oIfVY:function(s,e){return s===e},NqUeP:r(1538),vjtBg:r(1191),pBNlz:r(1453),wzWMy:"BOqai",wKiYi:function(s,e){return s>>>e},akZds:function(s,e,n){return s(e,n)},dFRoF:function(s,e,n){return s(e,n)},zhtdA:function(s,e,n){return s(e,n)},Jqfbx:function(s,e){return s===e},eYCLE:r(1775)+r(705)+" field: "+r(776),iRgHn:function(s,e){return s===e},WCtCY:r(1775)+r(705)+" field: "+r(410),UsguM:function(s,e){return s===e},smZAG:r(1281),npEjm:function(s,e,n){return s(e,n)},ghPLE:function(s,e){return s!==e},dXMxu:function(s,e,n){return s(e,n)},OsXis:function(s,e){return s(e)},JQqmO:function(s,e){return s!==e},AOoei:function(s,e,n){return s(e,n)},uKszF:function(s,e,n){return s(e,n)},jviGj:function(s){return s()},cQFwU:function(s,e){return s(e)},oBhUj:function(s,e){return s!==e},HcquR:function(s,e){return s!==e},dkvYZ:function(s,e){return s!==e},koelX:function(s,e,n){return s(e,n)},KXurw:function(s,e,n){return s(e,n)},LKxGN:function(s,e,n){return s(e,n)},EeQfm:function(s,e,n){return s(e,n)},Wqebi:function(s,e){return s(e)},CJpYk:function(s,e){return s(e)},xEcvx:function(s,e){return s(e)},CJYAl:function(s,e,n){return s(e,n)},NYGFW:function(s,e){return s(e)},SRISe:function(s,e){return s(e)},fkiEe:function(s,e){return s(e)},KMKtJ:function(s,e,n){return s(e,n)},IqcYp:r(1775)+r(705)+r(1488)+"SeqID",rwydI:function(s,e){return s===e},SWDFP:function(s,e){return s===e},jbUdw:r(1775)+r(705)+r(1488)+r(1580),DEXrv:"Missing "+r(705)+r(1488)+"method",VIsFR:function(s,e){return s+e},WazBg:function(s,e){return s&e},KlPrG:function(s,e,n){return s(e,n)},PZLnk:function(s,e){return s(e)},wMqgZ:function(s,e){return s>=e},aVvSm:function(s,e,n){return s(e,n)},toPdC:r(904),kNWuP:r(1202),kYexq:r(1159)+"t limit",VLiOO:function(s,e){return s*e},kocZQ:function(s,e){return s>e},xIdBk:r(1836)+r(821),qVyOd:function(s,e,n){return s(e,n)},AWPQG:r(1456),yvBdR:function(s,e,n){return s(e,n)},QRilf:function(s,e){return s(e)},crrJz:function(s,e){return s===e},PpgDa:function(s,e){return s<<e},RvvWd:function(s,e){return s&e},RZdqp:function(s,e){return s<e},gXmdO:function(s,e){return s(e)},lqIZf:function(s,e){return s==e},wDnym:function(s,e){return s+e},oGJIQ:function(s,e){return s!==e},ozZLo:function(s,e){return s|e},xaZHh:function(s,e){return s|e},utbAj:function(s,e){return s<<e},ZWhKo:function(s,e){return s>=e},BRrqn:function(s,e){return s+e},JZoPv:function(s,e){return s!==e},MrlDG:r(1502),ZTktD:function(s,e){return s+e},SSrqV:function(s,e){return s!==e},VSfFn:function(s,e){return s|e},oTAIk:function(s,e){return s|e},mAHqG:function(s,e){return s<<e},bSFwb:function(s,e){return s&e},iSIiF:function(s,e){return s>e},BqUmI:function(s,e){return s+e},IOrGZ:function(s,e){return s>>e},aYMem:function(s,e){return s<e},Inusz:function(s,e){return s>=e},TNZMj:function(s,e){return s<=e},RswKJ:function(s,e){return s+e},RWPim:function(s,e){return s-e},RcLPA:function(s,e){return s<e},ujeSI:function(s,e){return s<e},kqUtk:function(s,e,n){return s(e,n)},ITPlk:function(s,e,n){return s(e,n)},OELJQ:function(s,e){return s<e},WMOCz:function(s,e){return s<=e},hKWyH:function(s,e){return s<e},VnYWa:function(s,e){return s|e},SMhlM:function(s,e){return s>>e},jySxP:function(s,e){return s|e},TSDRh:function(s,e){return s>>e},cERto:function(s,e){return s&e},TJXPg:function(s,e){return s>>e},LcWRs:function(s,e){return s&e},BAOHc:function(s,e,n){return s(e,n)},ajpkv:function(s,e){return s<e},pXIZZ:r(1863),kEvsv:"QjONS",pqJyp:function(s,e){return s<e},kKEYK:function(s,e){return s<<e},Giksm:function(s,e){return s|e},cUlQs:function(s,e){return s&e},fNDez:function(s,e,n){return s(e,n)},ihgkb:r(1757),swArP:"offline",sXwdP:r(1639),jDmCb:function(s,e){return s&e},tFWjp:function(s,e){return s(e)},RJrYC:function(s,e){return s&e},ItFsT:function(s,e){return s<<e},HUaSu:function(s,e){return s&e},uhTYi:function(s,e){return s<<e},CmBAM:function(s,e){return s&e},jqIOl:function(s,e){return s(e)},qtpGE:function(s,e){return s(e)},pFTWf:function(s,e){return s&e},xLAfo:r(946),sMDmH:r(772),XsHIl:function(s,e){return s(e)},RkODJ:function(s,e){return s<<e},kMLwJ:function(s,e){return s&e},bfcYf:function(s,e){return s&e},UgtSz:function(s,e){return s(e)},OeSnb:function(s,e){return s&e},RVZhZ:function(s,e){return s&e},HKmub:function(s,e){return s!==e},XddTU:r(602),weYHF:function(s,e){return s&e},ousbL:function(s,e){return s|e},BkJte:function(s,e){return s|e},GdDOD:function(s,e){return s<<e},LvgXH:function(s,e){return s===e},ObijQ:function(s,e){return s===e},LnGAI:function(s,e){return s<e},irEOg:function(s,e){return s<e},jucYh:function(s,e){return s+e},FSKYV:function(s,e){return s>>>e},gFLcl:function(s,e){return s+e},AUjbb:function(s,e){return s!==e},Wpdbm:function(s,e){return s+e},TOFtU:function(s,e){return s|e},LRZkX:function(s,e){return s|e},TBRxR:function(s,e){return s&e},MClIK:function(s,e){return s+e},pODhA:function(s,e){return s|e},RAanP:function(s,e){return s>>>e},zDypI:function(s,e){return s&e},ffMWc:function(s,e){return s+e},vvKrh:function(s,e){return s&e},oZbur:function(s,e){return s|e},hifXy:function(s,e){return s&e},GnVYv:function(s,e){return s>>>e},JqUNS:function(s,e){return s+e},LnfpV:function(s,e){return s|e},zWsfp:function(s,e){return s&e},zEtVb:function(s,e){return s>>>e},VnbjG:function(s,e){return s&e},qboRE:function(s,e){return s(e)},eyObC:function(s,e){return s|e},QztRG:function(s,e){return s|e},THOvt:function(s,e){return s===e},MtvWO:r(1107),ZwESs:r(1496)+"id",OfKVO:r(1333),ztuzg:r(1170),zLrAu:function(s,e){return s|e},eNHlQ:function(s,e){return s<<e},YBYyq:function(s,e){return s|e},KzQrt:function(s,e){return s|e},QsHUp:r(1101),voNRi:function(s,e){return s|e},VVLjE:function(s,e){return s|e},zQBnx:function(s,e){return s<<e},UbpPT:function(s,e){return s(e)},VWpjz:function(s,e){return s(e)},rNGlq:r(1667),dQgzs:function(s,e){return s|e},iNuzX:function(s,e){return s>>>e},ZqNjw:function(s,e){return s>>>e},RicWu:function(s,e){return s&e},GtiYa:function(s,e){return s>>>e},KufEw:function(s,e){return s>>>e},QaHAH:r(558),nDoSd:r(1175),ZibdG:function(s,e){return s>=e},DsWCN:function(s,e){return s+e},oQeYo:function(s,e){return s|e},ukrBE:function(s,e){return s%e},QWavr:function(s,e){return s(e)},phJbJ:function(s,e){return s===e},VNXUw:r(845),FfGSo:function(s,e){return s+e},SJevI:function(s,e){return s>>>e},NJLNb:function(s,e){return s===e},GSYyI:function(s,e){return s>>>e},YIqDN:function(s,e){return s>>>e},SgKyJ:function(s,e){return s>>>e},NGeKE:function(s,e){return s&e},kQVLe:function(s,e){return s>>>e},bHnDC:function(s,e){return s&e},tGRym:function(s,e){return s+e},yYYtO:function(s,e){return s+e},MwXyD:function(s,e){return s>>>e},CXmKf:function(s,e){return s+e},ypPUY:function(s,e){return s|e},HTRps:function(s,e){return s<<e},nwwYc:function(s,e){return s===e},ktrsc:function(s,e){return s>>>e},OitHn:function(s,e){return s===e},jklGF:r(597),hcCRF:function(s,e){return s===e},uyoow:function(s,e){return s+e},LzSvy:r(1442),difmw:function(s,e){return s&e},owAqG:function(s,e){return s>>>e},CJDjq:function(s,e){return s>>>e},JKSfV:function(s,e){return s&e},LrOwY:function(s,e){return s>>>e},qGPIp:function(s,e){return s>>>e},OjxPR:function(s,e){return s&e},qnHqC:function(s,e){return s>>>e},DDQIa:function(s,e){return s>>>e},Pfore:r(733)+r(1261),MtXSY:r(939)+r(460),SDfWx:r(1424)+"OR",hJaju:r(1409)+r(1669)+"R",mpZPh:r(1734)+r(1582),GwJaN:function(s,e){return s-e},HWJHv:function(s,e){return s|e},QiUBu:function(s,e){return s<<e},uJpYU:function(s,e){return s>=e},iZtwF:function(s,e){return s|e},smDgt:function(s,e){return s&e},qhLgv:r(1111),RLASv:"0|2|1|4|3",gjbiy:"vBsQP",FfOEf:function(s,e){return s&e},MQFKo:function(s,e){return s+e},SlYqF:function(s,e){return s|e},uAHtV:r(1137),rKKue:function(s,e){return s>e},yNbUT:r(1674),txmva:function(s,e){return s instanceof e},VlvLh:function(s,e){return s+e},cbPQo:function(s,e){return s+e},pwIXj:function(s,e){return s+e},pfCJy:"BnTZH",rQueg:function(s,e){return s===e},RcDgA:r(1425),pyeXn:"uMVMf",QyZgM:r(551),FJpGI:function(s,e,n){return s(e,n)},bGHGC:r(1727),kYisI:function(s,e,n){return s(e,n)},kPdyq:function(s,e){return s!==e},GPpOh:r(1113),RkKLl:function(s,e){return s+e},wsAxb:function(s,e){return s instanceof e},lRJNk:r(1061)+r(583)+r(1064),YbKMY:r(529)+r(1666),KnBuj:r(529)+r(1666)+r(895)+r(907),wKFLh:"string",lrVaQ:r(1685),HVfBB:function(s,e,n,o){return s(e,n,o)},MLxLR:r(896),skGcS:r(1843),iyPqF:r(1197),OIhpY:function(s,e){return s||e},aiZRt:function(s,e){return s!=e},FGjiE:"undefined",SQQgd:r(1904)+r(1748)+r(1710)+r(1833)+r(1487),JQPgl:function(s,e){return s+e},AzleC:r(441)+r(1650),guMvM:r(1766),wkKrV:r(577),arpEW:r(1879),GCHec:"get",PdTmF:r(1742)+"ys",xhhAx:"count",wNNhn:function(s,e){return s<e},CmMfa:function(s,e){return s&e},YzOAr:function(s,e){return s|e},BqtbD:function(s,e){return s(e)},rDfOb:function(s){return s()},zbeoh:function(s,e){return s!==e},liuay:r(1001),idbDT:"XrBvS",CEGyD:function(s,e){return s<e},fOXZM:r(1353),pnafo:function(s,e){return s!==e},gEQdY:"KcgGW",NkVRh:"tcnMt",fdbIF:function(s,e){return s-e},RReXx:function(s,e){return s>=e},pTTls:function(s,e){return s<e},URSaV:function(s,e){return s&e},ltTEI:function(s,e){return s&e},dMIzL:function(s,e){return s<<e},MhKdp:function(s,e){return s|e},jnFrG:function(s,e){return s&e},VLgbt:function(s,e){return s&e},ZKEqr:function(s,e){return s+e},kBAjR:function(s,e,n){return s(e,n)},xcpiQ:function(s,e){return s<e},IsItg:function(s,e){return s&e},uzVdH:function(s,e){return s&e},VZJPs:function(s,e){return s&e},BuJMd:function(s,e){return s+e},fdqmE:function(s,e){return s<<e},EiMXk:function(s,e){return s|e},vgbDF:function(s,e){return s&e},KYWEb:function(s,e){return s===e},LzSmt:r(1158),bMsrn:function(s,e){return s|e},ynFzJ:function(s,e){return s&e},zvbyc:function(s,e){return s|e},ADuKk:function(s,e){return s<e},UaFFq:function(s,e){return s|e},yBJkn:function(s,e){return s===e},fUUHl:function(s,e){return s&e},yamfP:function(s,e){return s===e},EYPmE:function(s,e){return s+e},bsmir:function(s,e){return s<<e},bQidp:function(s,e){return s&e},xrMgk:function(s,e){return s|e},SIrVt:function(s,e){return s>>e},ckNUv:function(s,e){return s&e},pvXxl:function(s,e){return s|e},YlPVd:function(s,e){return s!==e},DwovW:r(1208),UEJnC:function(s,e){return s==e},TArCO:r(483),svfuQ:function(s,e){return s===e},GQDhD:"SBpaV",svTGm:function(s,e){return s instanceof e},yjtSt:r(817),NVazf:r(1291),LZLgE:function(s,e){return s===e},wAqWu:"FnrTp",txMbZ:"fhGmN",soWnM:function(s,e){return s>=e},WCqSJ:r(582)+r(991),cbDeY:function(s,e){return s(e)},dKGTa:function(s,e){return s!==e},pXRJw:r(1062)+r(1505),cBpKG:r(1820),mmgeB:r(850)+r(557)+r(392)+"P",Iyqiy:r(1751),xXgxT:function(s,e,n,o){return s(e,n,o)},DIQWs:"QojFo",XpOqT:r(1807),YivcV:function(s,e){return s&e},bBUuX:r(1134),TYgHM:function(s,e){return s!==e},duMkX:r(969),QzgdU:r(1841),bJSUg:function(s,e){return s(e)},YYIHo:function(s,e){return s===e},oHEKn:r(1058),BAktO:function(s,e){return s||e},bOTVg:function(s,e){return s||e},ZLeZU:function(s,e){return s||e},WhjCU:function(s,e){return s!==e},GnsBd:function(s,e){return s||e},RgfTm:function(s,e){return s||e},fvkMI:function(s,e){return s||e},EqzQh:r(927)+r(1444)+"d",WzSMD:function(s,e,n){return s(e,n)},LoeBC:r(702),vxjEU:r(1659),kLiDT:function(s,e){return s(e)},yFmMX:r(1177),dbezy:r(564)+r(901),zVuad:"x_frontier_qos_ack",DPAWt:"x_fronti"+r(556)+"k",HsuPc:function(s,e,n){return s(e,n)},FNHtX:function(s,e){return s===e},scsJG:"SXhDT",IPcMi:function(s,e,n,o){return s(e,n,o)},XkFCO:r(1554),VRWHI:r(590),RrQvV:"ack_id",mLTgH:function(s){return s()},NBTzv:function(s,e){return s(e)},yZuBF:function(s,e){return s instanceof e},CaGEt:function(s,e){return s instanceof e},Gneux:"none_none",wWZhy:function(s,e,n,o){return s(e,n,o)},WAJrS:function(s,e){return s(e)},RMaPg:function(s,e){return s&e},jjWUW:function(s,e){return s(e)},Zocmd:function(s,e){return s+e},OhiRx:"index out of range: ",rxHKm:r(839),dccyX:" > ",CsYiK:function(s,e){return s>=e},GWRJN:function(s,e){return s+e},rHueZ:function(s,e){return s+e},pzyGj:function(s,e){return s+e},fWVOa:function(s,e){return s<e},uofhP:function(s,e){return s+e},Nzzlx:function(s,e){return s|e},ekDVZ:function(s,e){return s<<e},TgnKx:function(s,e){return s<<e},Bwmfz:function(s,e){return s+e},kLNrs:function(s,e){return s<<e},sxIiL:function(s,e){return s|e},yQcAk:function(s,e){return s<<e},AtOjp:function(s,e){return s<<e},Jluor:function(s,e){return s+e},RJfYb:r(1657),NNCcs:"wxUpf",pAlum:function(s,e){return s+e},yxVwA:function(s,e){return s+e},JdcIt:function(s,e){return s>>>e},PFRHi:function(s,e){return s&e},VTZpZ:function(s,e){return s===e},wzBDT:r(1785),UrKOm:function(s,e){return s&e},AcSuM:function(s,e){return s+e},GXQHu:function(s,e){return s<<e},BEGLw:function(s,e){return s&e},XPGbU:function(s,e){return s<e},fWjOE:function(s,e){return s|e},yWHkI:function(s,e){return s|e},KDpbe:function(s,e){return s>>>e},bogCr:function(s,e){return s&e},zBejo:function(s,e,n,o){return s(e,n,o)},LXyDX:r(1580),lQzjO:"curvalue",xvQNF:function(s,e,n,o){return s(e,n,o)},sExFc:r(1447)+r(1034),ZRTLb:function(s,e,n,o){return s(e,n,o)},Ntlzp:r(448)+"ervice",XNQiZ:r(1034),YOunz:r(1370),YJLdv:function(s,e){return s(e)},WiQig:"cursor_f"+r(773),umaej:function(s,e){return s+e},sBCqL:function(s,e,n){return s(e,n)},KEVxC:r(1198)+r(1108),AgeTx:r(424),GUIvg:function(s,e,n,o){return s(e,n,o)},WtAeR:"INSTANT",AHodm:r(1440),CHSOM:function(s,e,n,o){return s(e,n,o)},sUnDV:function(s){return s()},WXsZt:function(s,e){return s instanceof e},luEOb:function(s,e){return s(e)},yhjbb:r(1878),cPCFJ:function(s,e,n,o){return s(e,n,o)},vZwxG:"code",uFKuc:function(s,e,n){return s(e,n)},Sgrpt:"x_fronti"+r(1760),eGeYy:function(s,e){return s(e)},PCFpQ:function(s,e,n,o){return s(e,n,o)},MruEL:"x-msg-qos",pJYBO:r(1310)+r(1407)+"e",jcdhS:"x-msg-cu"+r(1222)+"ue",USyJG:function(s,e){return s>e},PXjjN:r(1469),oTRaH:function(s){return s()},YbUkd:function(s){return s()},Nwftt:function(s){return s()},ZHktX:function(s,e){return s===e},CPcTa:function(s,e){return s===e},oWyYH:function(s,e){return s&&e},tinEr:function(s,e,n){return s(e,n)},cMOxE:function(s){return s()},MIzHL:function(s){return s()},sXgOz:function(s,e){return s(e)},QcJAw:function(s,e){return s<=e},UygTT:function(s,e){return s>=e},oQYIi:function(s,e){return s<e},xEVDx:function(s,e){return s|e},zcfEL:function(s,e){return s&e},tALpL:function(s,e){return s&e},ltYgp:function(s,e){return s&e},RqaJV:function(s,e){return s+e},EOAdJ:function(s,e){return s+e},CTNjE:r(416),UEHia:function(s,e){return s!==e},ptezR:function(s,e){return s!==e},AAlqb:function(s,e,n){return s(e,n)},JImFG:function(s){return s()},KSOYr:function(s,e,n){return s(e,n)},enZNM:r(1627),WqGpf:function(s,e){return s!==e},LEJEi:r(1118),FqVBs:function(s,e){return s!==e},auNeo:function(s,e){return s===e},jnzoX:r(1194),QQSNa:function(s,e){return s(e)},FQYTX:function(s,e,n){return s(e,n)},LMXQx:function(s,e){return s!==e},XOKqS:function(s,e,n){return s(e,n)},EIWia:function(s,e){return s!==e},GcWFx:r(1467),tyFxP:r(1532),DFXwU:function(s,e,n){return s(e,n)},AulnC:function(s,e){return s===e},PtCMa:r(536),XYXVc:r(1192),uJzxM:r(457)+r(1423)+"s",rjYKO:function(s,e,n,o){return s(e,n,o)},MKQzs:function(s,e){return s+e},onDFN:function(s,e){return s!==e},rtgjn:function(s,e){return s|e},lSOll:function(s,e){return s&e},CTPun:function(s,e){return s>e},ecDyu:function(s,e){return s>>e},WIYFO:function(s,e){return s+e},ANxyE:function(s,e){return s/e},kAztS:function(s,e){return s===e},iYueK:r(1897)+r(576)+"alid url",pEQZM:r(765),JBHdW:function(s,e){return s>>>e},KILfd:function(s,e){return s>>>e},hnvJq:function(s,e){return s===e},KCfmS:function(s,e){return s<e},eJVrP:function(s,e){return s<e},mnZdZ:function(s,e,n){return s(e,n)},pQiAY:function(s,e){return s&e},ElzbO:function(s,e){return s|e},EoHEK:function(s,e){return s>>>e},YFsZd:function(s,e){return s!==e},wTtfa:function(s,e){return s!==e},cAlsE:r(534),MgiNl:"stop imm"+r(1283)+r(1167)+"ct",wemdl:r(797),uWXtL:r(1256),wJoHb:function(s,e){return s!==e},tDhQV:"https:",RMuoj:r(1784),ZIRiJ:r(1017),vaFUT:"device_id",bgAzY:r(1897)+r(976)+r(1066)+"viceID o"+r(1694),mpqAD:function(s,e,n){return s(e,n)},jlUEf:r(867),TjsXA:r(775),ogeGT:r(1399),vBGYR:"reconnect",OZyGA:r(1114),VrkZs:function(s,e){return s>e},ltYfd:function(s,e,n){return s(e,n)},tFAfO:r(1493),vhLHK:function(s,e){return s===e},ZuzyU:"MdQcj",mnMLK:r(553),pTHCZ:function(s,e,n){return s(e,n)},ICIJm:r(524),QcGie:function(s,e){return s(e)},rxiBJ:r(950)+">",GYxYh:function(s,e){return s-e},LYhQx:r(879),FIzxT:r(1253),jHdwu:function(s,e){return s*e},wEzCM:function(s,e){return s!==e},QycOV:r(457)+r(1378)+"t",OqRNQ:r(1832),QEgYM:r(677),SeuEv:r(1617),Itvdf:function(s,e){return s!==e},epnfv:r(439),QQFEg:"timeout,"+r(848)+r(1133)+"g",fanqz:function(s,e){return s===e},YADnb:r(1019)+"4",gcViu:"aOMmu",TElDZ:r(720),ujLTw:r(1408),WjYSK:function(s,e,n){return s(e,n)},YvKoS:function(s,e){return s!==e},eNAwP:function(s,e){return s+e},SxaKv:function(s,e){return s===e},ybVdE:r(1636),zRWNn:r(1067),eiPCR:"4|2|0|6|"+r(909),qDhFS:function(s,e){return s==e},JUHOX:r(1897)+r(678)+r(1121)+r(1483)+r(1596)+r(650)+r(1762)+" arraybu"+r(1495),erKJV:"number",wePvj:function(s,e){return s(e)},JpdJL:r(1897)+r(678)+r(874)+r(1834),Srbed:function(s,e){return s instanceof e},KDeSE:function(s,e){return s instanceof e},SxJKj:r(1692),MkrlY:function(s,e){return s<e},KqZNB:"enqueue",Vlibp:function(s,e){return s==e},rhADF:function(s,e){return s<e},KPGRp:function(s,e){return s<e},EyimS:r(1104),IBQkt:function(s,e){return s*e},busXi:function(s,e){return s*e},NRAsm:function(s,e){return s/e},wYrbO:function(s,e){return s!=e},erfTR:"Window",nqcaR:function(s,e){return s===e},Qngub:function(s,e){return s!=e},THTfT:function(s,e){return s!=e},nsvFO:r(800),YbBIq:function(s,e){return s===e},lGXga:r(1178)+r(1517)+r(1152)+"pe",gHnCk:function(s,e){return s!=e},dAStL:function(s,e){return s!=e},SxuSF:function(s,e){return s!=e},KRYwS:function(s,e){return s!=e},JXPka:function(s,e){return s!=e},zJcCb:function(s,e){return s!=e},yRGwM:r(973)+r(1786)};ye.r(J),ye.d(J,{FWS:()=>D0,CustomErrorEvent:()=>Qr,createCloseEvent:()=>he,ReconnectEvent:()=>Zr,createErrorEvent:()=>ce,decodedFrame:()=>Wr,createOpenEvent:()=>ss,CustomCloseEvent:()=>$r,createReconnectEvent:()=>Gn,FrontierMessageEvent:()=>ts,encodeFrame:()=>Kn,createMessageEvent:()=>rs,OpenEvent:()=>ns,ErrorCode:()=>Be,Event:()=>st,MessageEvent:()=>es});let i="";function a(s=""){let e=r,n="02",o=""+Date[e(1921)](),x=i||(i=t[e(1808)](m,s)),l=Math.random().toString(16)[e(1324)](-6);return t[e(1553)](t[e(893)](t[e(1509)](n,o),x),l)}function c(){let s=r,e={cBmPw:function(n,o){return n||o}};if(t[s(890)]!==t[s(890)]){let n=this[s(997)].getItem(this[s(1551)]),o=_0x5896ab[s(1183)](e[s(1377)](n,"{}"));return o[_0xb5e83b]=void 0,this[s(997)][s(1677)](this._prefix,_0x2829dd[s(1530)+"y"](o))}else return t.GGIKg(t[s(1865)](1e4,Date[s(1921)]()),Math[s(993)](1e4*Math.random()))}function f(s){let e=r;return t[e(893)](t[e(1574)](Array,8)[e(1052)]("0"),parseInt(s,10)[e(1816)](2))[e(1324)](-8)}function d(s){let e=r;return t[e(1338)](t[e(575)](Array,4)[e(1052)]("0"),t[e(1259)](parseInt,s,2)[e(1816)](16))[e(1324)](-4)}function p(s){let e=r,n=s[e(856)](/\./)[e(1346)](l=>f(l)),o=[];return o[0]=d(t[e(1509)](n[0],n[1])),o[1]=t.JhYdq(d,n[2]+n[3]),[t.sRhBT,t[e(1298)],t[e(1298)],t[e(1298)],e(1079),t[e(1616)],o[0],o[1]][e(1052)]("")}function m(s){let e=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}/[e(1245)](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]))/[e(1245)](s);return n?t[e(1574)](p,s):o?t[e(1574)](_,s):t[e(840)]}function _(s){let e=r;if(t[e(1038)](t[e(1315)],t[e(1315)])){let n="",o=[],x=0,l=0,g=!0,h=t.sRhBT;if(s[e(1180)]("::")>-1){let u=s[e(856)]("::");for(let C=0;t[e(1322)](C,u[e(1491)]);C++)if(t.NfZEg(t[e(1156)],t[e(813)])){let v=u[C];if(t[e(1875)](v[e(1180)](":"),0)){let D=v[e(856)](":");g&&(x=D[e(1491)]),l+=D[e(1491)];for(let T=0;T<D.length;T++)if(t[e(1608)](4,D[T][e(1491)])){let U=h[e(770)+"g"](0,t.QQZNo(4,D[T][e(1491)])),_e=U[e(756)](D[T]);o[e(1473)](_e)}else o[e(1473)](D[T]);g=!1}else{if(v[e(1491)]!==4){let D=h[e(770)+"g"](0,t[e(1861)](4,v[e(1491)])),T=D.concat(v);o[e(1473)](T)}else o[e(1473)](v);g&&(x+=1),l+=1,g=!1}}else _0x2a818b=t[e(722)](t.PxGoA(31,_0x4364f6)<<6,t[e(1472)](63,_0x40ee98)),t.bPZhQ(_0x273f96,128)?_0x53004f+=_0x48aa6f:(_0x523878+=t.JMjLa(_0x284098,_0x5f4744),_0x3faaf6++);let w="";for(let C=0;t[e(1322)](C,8-l);C++)w=w[e(756)](h);for(let C=0;t.mNFHK(C,o[e(1491)]);C++)t[e(428)](C,x)?t[e(428)](t[e(1739)],t[e(1739)])?(n=n[e(756)](w),n=n[e(756)](o[C])):(_0x83627f[_0x5914a9[_0x97427][e(1678)+e(1250)]]=t[e(1594)](_0x5e20af,_0x3c7524[_0x3e7a0b].cursor_name),_0x34a87a+=t[e(820)](14,_0x599542[_0xf97ee8[_0x2959c9]["cursor_n"+e(1250)]])):n=n[e(756)](o[C]);return n}if(t[e(1608)](t[e(1365)],t[e(1365)]))this[e(704)+e(1655)+e(528)](_0x192676),_0x21c254[e(716)](_0x2e7a04,_0x3fa12d,_0x5f0ef7[e(1727)][e(1580)]);else{let u=s[e(856)](":");for(let w=0;t[e(1413)](w,u[e(1491)]);w++){let C=u[w];if(t[e(692)](4,u[w][e(1491)])){let v=h.substring(0,t[e(1115)](4,u[w][e(1491)])),D=v.concat(C);n=n[e(756)](D)}else n=n[e(756)](C)}return n}}else{let n=t[e(1311)](_0x10fde9,_0x5a9807,_0xbc359f);return _0x1ee111[e(506)][e(936)](n,n+_0xaa2a9d)}}function b(s,e){let n=r,o={wNwpZ:function(g,h){return g|h},dOOia:function(g,h){return t.lZbiI(g,h)},sFPku:function(g,h){return t.DtVKS(g,h)}},x=s[n(776)];x!==void 0&&(t[n(805)](n(715),t[n(1479)])?(t.VxNrN(Q,e,10),Ee(e,x)):(_0x20e852<65536?_0x28114d[_0x1c0bc4++]=o.wNwpZ(o[n(1422)](o[n(989)](_0x202672,12),15),224):(_0x4ca6c4[_0x54d098++]=o[n(1396)](o.dOOia(o[n(989)](_0x3ec680,18),7),240),_0x5a5c3d[_0x3c8534++]=o.dOOia(o[n(989)](_0x1fc955,12),63)|128),_0x47ed0b[_0x500935++]=o.dOOia(o[n(989)](_0x2462e2,6),63)|128));let l=s.value;l!==void 0&&(t[n(1373)](t.NqUeP,t[n(1204)])?_0x4ecc21.o=(g,h)=>_0x3dded7[n(1304)+"e"][n(718)+n(1006)][n(1226)](g,h):(t[n(1259)](Q,e,18),t.jbZnX(Ee,e,l)))}function y(s){let e=r;if(t[e(755)]!==t[e(1450)]){let n={};e:for(;!t[e(1120)](me,s);){let o=t[e(575)](ee,s);switch(t[e(384)](o,3)){case 0:break e;case 1:n.key=t.akZds(Ce,s,ee(s));break;case 2:n[e(410)]=t[e(674)](Ce,s,t[e(1120)](ee,s));break;default:t[e(696)](re,s,t[e(499)](7,o))}}if(t[e(1466)](void 0,n.key))throw new Error(t[e(1872)]);if(t[e(1020)](void 0,n.value))throw new Error(t[e(648)]);return n}else return new _0x5370d0(_0xaafffb)}function k(s){let e=r;if(t[e(1131)](t.smZAG,e(1281))){let n=M();return t.npEjm(I,s,n),Oe(n)}else return!!this[e(997)]}function I(s,e){let n=r,o=s[n(868)];o!==void 0&&(Q(e,8),t.akZds(yt,e,o));let x=s[n(1789)];t[n(433)](void 0,x)&&(t[n(411)](Q,e,16),t.dXMxu(yt,e,x));let l=s.service;t.FmCzy(void 0,l)&&(Q(e,24),t[n(1161)](yt,e,t.OsXis(oe,l)));let g=s[n(1563)];t[n(1260)](void 0,g)&&(t[n(427)](Q,e,32),t[n(1259)](yt,e,t[n(1555)](oe,g)));let h=s[n(542)];if(h!==void 0)for(let _e of h){t[n(1590)](Q,e,42);let qe=t.jviGj(M);t[n(427)](b,_e,qe),t[n(1161)](Q,e,qe[n(509)]),Ae(e,qe),t[n(1765)](G,qe)}let u=s[n(956)+n(905)];t[n(1486)](void 0,u)&&(t.VxNrN(Q,e,50),Ee(e,u));let w=s[n(1242)+n(966)];t.HcquR(void 0,w)&&(t[n(1311)](Q,e,58),Ee(e,w));let C=s[n(802)];t[n(1260)](void 0,C)&&(t[n(1590)](Q,e,66),Q(e,C[n(1491)]),t[n(1476)](Bt,e,C));let v=s[n(767)];t[n(942)](void 0,v)&&(t[n(427)](Q,e,74),t[n(935)](Ee,e,v));let D=s[n(1750)+n(1698)];D!==void 0&&(Q(e,82),Ee(e,D));let T=s.msgID;T!==void 0&&(Q(e,90),t[n(1837)](Ee,e,T));let U=s.frameType;t[n(942)](void 0,U)&&(t[n(933)](Q,e,96),t.EeQfm(yt,e,t[n(408)](oe,U)))}function L(s){let e=r;return t.CJpYk(R,t[e(408)](Se,s))}function R(s){let e=r,n={};e:for(;!t[e(694)](me,s);){let o=t.Wqebi(ee,s);switch(t[e(384)](o,3)){case 0:break e;case 1:n.SeqID=t[e(1476)](Gr,s,!0);break;case 2:n[e(1789)]=t[e(1259)](Gr,s,!0);break;case 3:n.service=ee(s);break;case 4:n.method=t[e(1574)](ee,s);break;case 5:{let x=K(s);(n.headers||(n.headers=[]))[e(1473)](t[e(1635)](y,s)),s.limit=x;break}case 6:n["payloadE"+e(905)]=t[e(1590)](Ce,s,ee(s));break;case 7:n[e(1242)+e(966)]=t.CJYAl(Ce,s,ee(s));break;case 8:n[e(802)]=Mt(s,t[e(743)](ee,s));break;case 9:n.LogIDNew=t.dFRoF(Ce,s,t[e(1374)](ee,s));break;case 10:n[e(1750)+e(1698)]=t[e(1311)](Ce,s,t[e(972)](ee,s));break;case 11:n[e(750)]=Ce(s,t[e(1555)](ee,s));break;case 12:n[e(710)+"e"]=t[e(1374)](ee,s);break;default:t[e(538)](re,s,7&o)}}if(n[e(868)]===void 0)throw new Error(t[e(1856)]);if(t[e(794)](void 0,n[e(1789)]))throw new Error("Missing "+e(705)+e(1488)+e(1789));if(t[e(1454)](void 0,n[e(1580)]))throw new Error(t[e(979)]);if(t[e(1466)](void 0,n[e(1563)]))throw new Error(t.DEXrv);return n}function K(s){let e=r,n=t.JhYdq(ee,s),o=s[e(509)];return s[e(509)]=t[e(964)](s[e(912)],n),o}function re(s,e){let n=r;switch(e){case 0:for(;t.WazBg(128,$(s)););break;case 2:t.KlPrG(pe,s,t[n(442)](ee,s));break;case 5:t[n(1161)](pe,s,4);break;case 1:pe(s,8);break;default:throw new Error(t[n(1338)]("Unimplem"+n(1262)+n(852),e))}}function oe(s){let e=r;return s|=0,{low:s,high:s>>31,unsigned:t[e(1776)](s,0)}}let P=[];function M(){let s=r,e=P[s(822)]();return e?(e[s(912)]=e.limit=0,e):{bytes:new Uint8Array(64),offset:0,limit:0}}function G(s){let e=r;if(t[e(1608)]("yboNi",t[e(922)])){let n=this[e(1607)+"tManager"]?.[e(1230)+e(1347)+"nt"]();this[e(704)+e(1887)+"ent"](t[e(1419)](_0x35a496,t[e(488)],{code:_0x4bdf0c[e(1777)],reason:e(1630)+e(1868)+e(596)+"wn reaso"+e(701)+"ame: "+n})),this[e(1607)+e(876)]?.[e(1569)+e(498)+"fig"](),this[e(982)+e(621)]?.[e(738)+e(1749)]();return}else P.push(s)}function Se(s){return{bytes:s,offset:0,limit:s[r(1491)]}}function Oe(s){let e=r,n=s[e(506)],o=s.limit;return t[e(1038)](n[e(1491)],o)?n:n.subarray(0,o)}function pe(s,e){let n=r;if(t[n(1875)](t[n(820)](s[n(912)],e),s[n(509)]))throw new Error(t.kYexq);s[n(912)]+=e}function me(s){let e=r;return t.wMqgZ(s[e(912)],s[e(509)])}function le(s,e){let n=r,o=s[n(506)],x=s[n(912)],l=s[n(509)],g=t[n(1509)](x,e);if(g>o[n(1491)]){let h=new Uint8Array(t[n(1512)](2,g));h[n(716)](o),s[n(506)]=h}return s[n(912)]=g,t[n(814)](g,l)&&(s[n(509)]=g),x}function nt(s,e){let n=r,o=s.offset;if(t.phjbu(o,e)>s[n(509)])throw new Error(t[n(764)]);return s[n(912)]+=e,o}function Mt(s,e){let n=r,o=nt(s,e);return s[n(506)][n(936)](o,o+e)}function Bt(s,e){let n=r,o=t.qVyOd(le,s,e[n(1491)]);s.bytes[n(716)](e,o)}function Ce(s,e){let n=r;if(t[n(1608)](n(1456),t[n(1881)]))_0x4de407[n(637)]()[n(613)](()=>{this[n(539)+"steners"]()});else{let o=t[n(1599)](nt,s,e),x=String["fromChar"+n(1457)],l=s[n(506)],g="\uFFFD",h="";for(let u=0;t[n(1413)](u,e);u++){let w=l[t[n(1553)](u,o)],C,v,D,T;(128&w)===0?h+=t.QRilf(x,w):t[n(1355)](224&w,192)?t[n(1553)](u,1)>=e?h+=g:(C=l[t[n(1509)](u+o,1)],t.HcquR(t[n(1371)](192,C),128)?h+=g:(T=t[n(722)](t.PpgDa(t[n(1371)](31,w),6),t[n(1818)](63,C)),t[n(1225)](T,128)?h+=g:(h+=t[n(1687)](x,T),u++))):t[n(1433)](240&w,224)?t.wMqgZ(t[n(1509)](u,2),e)?h+=g:(C=l[u+o+1],v=l[t.wDnym(t.VIsFR(u,o),2)],t.oGJIQ(t[n(1818)](C|t[n(1099)](v,8),49344),32896)?h+=g:(T=t[n(1165)](t.xaZHh(t[n(634)](15&w,12),t[n(634)](63&C,6)),t[n(548)](63,v)),t[n(1413)](T,2048)||T>=55296&&T<=57343?h+=g:(h+=t.eZHTY(x,T),u+=2))):t[n(1818)](248,w)==240?t[n(1738)](t[n(978)](u,3),e)?h+=g:t[n(1481)](t[n(831)],t.MrlDG)?this[n(547)+"rs"]={}:(C=l[t[n(893)](t[n(820)](u,o),1)],v=l[t.ZTktD(t[n(1383)](u,o),2)],D=l[t[n(1338)](t[n(820)](u,o),3)],t[n(1568)](t.WazBg(t.ozZLo(t[n(1165)](C,t.PpgDa(v,8)),t[n(1099)](D,16)),12632256),8421504)?h+=g:(T=t[n(1893)](t[n(1686)](t[n(891)](t.PxGoA(7,w)<<18,t.mAHqG(63&C,12)),t[n(1099)](t[n(453)](63,v),6)),t.lZbiI(63,D)),t[n(1413)](T,65536)||t[n(1403)](T,1114111)?h+=g:(T-=65536,h+=t[n(1599)](x,t[n(559)](t[n(1778)](T,10),55296),t[n(559)](1023&T,56320)),u+=3))):h+=g}return h}}function Ee(s,e){let n=r,o=e[n(1491)],x=0;for(let h=0;t.aYMem(h,o);h++){let u=e[n(1817)+"At"](h);t.Inusz(u,55296)&&t.TNZMj(u,56319)&&t[n(887)](t.RswKJ(h,1),o)&&(u=t[n(1641)](t[n(964)](u<<10,e[n(1817)+"At"](++h)),56613888)),x+=t.RcLPA(u,128)?1:t.mNFHK(u,2048)?2:t[n(804)](u,65536)?3:4}t[n(1767)](Q,s,x);let l=t[n(975)](le,s,x),g=s[n(506)];for(let h=0;t[n(600)](h,o);h++){let u=e[n(1817)+"At"](h);u>=55296&&t[n(971)](u,56319)&&t.RZdqp(t[n(1402)](h,1),o)&&(u=t[n(1861)](t.BqUmI(t[n(634)](u,10),e[n(1817)+"At"](++h)),56613888)),t[n(1587)](u,128)?g[l++]=u:(t[n(1768)](u,2048)?g[l++]=t[n(724)](t[n(482)](u,6)&31,192):(t[n(1587)](u,65536)?g[l++]=t[n(1264)](t[n(453)](u>>12,15),224):(g[l++]=t[n(1893)](t[n(1510)](u,18)&7,240),g[l++]=t[n(1264)](t[n(570)](t.IOrGZ(u,12),63),128)),g[l++]=t[n(724)](t.TJXPg(u,6)&63,128)),g[l++]=t[n(1686)](t[n(1839)](63,u),128))}}function Ae(s,e){let n=r,o=t.BAOHc(le,s,e[n(509)]),x=s[n(506)],l=e[n(506)];for(let g=0,h=e[n(509)];t.ajpkv(g,h);g++)x[g+o]=l[g]}function $(s){return s[r(506)][t.LKxGN(nt,s,1)]}function Ge(s,e){let n=r;if(t[n(942)](t.pXIZZ,t.kEvsv)){let o=t[n(1599)](le,s,1);s[n(506)][o]=e}else return _0x2b55a4}function ee(s){let e=r,n=0,o=0,x;do x=$(s),t[e(1221)](n,32)&&(o|=t.kKEYK(127&x,n)),n+=7;while(128&x);return o}function Q(s,e){let n=r;for(e>>>=0;t[n(1012)](e,128);)t[n(911)](Ge,s,t[n(568)](t[n(1028)](127,e),128)),e>>>=7;t[n(1638)](Ge,s,e)}function Gr(s,e){let n=r,o={QtGfk:function(u,w){return t[S(568)](u,w)},oeQuE:function(u,w){return t.jDmCb(u,w)}},x=0,l=0,g=0,h;return h=t[n(1091)]($,s),x=t[n(996)](127,h),128&h&&(h=t[n(1091)]($,s),x|=t[n(1406)](t[n(1043)](127,h),7),128&h&&(h=t[n(1594)]($,s),x|=t[n(968)](127&h,14),t[n(1181)](128,h)&&(h=t[n(560)]($,s),x|=t[n(1492)](127,h)<<21,t.CmBAM(128,h)&&(h=t[n(1243)]($,s),l=t[n(1513)](127,h),128&h&&(h=$(s),l|=t[n(1763)](127&h,7),t[n(570)](128,h)&&(t.NfZEg(t[n(1404)],t[n(585)])?(h=t.XsHIl($,s),l|=t[n(1468)](t[n(1080)](127,h),14),128&h&&(h=$(s),l|=t[n(1763)](t.cERto(127,h),21),t[n(615)](128,h)&&(h=t[n(1855)]($,s),g=t[n(1708)](127,h),t[n(1212)](128,h)&&(t[n(1193)](t[n(1584)],t.XddTU)?(this[n(1231)+"er"]&&_0x21617c["addEvent"+n(1780)](t.ihgkb,this[n(1644)+"nLine"]),this[n(1231)+"er"]&&_0x46b3ad["addEvent"+n(1780)](t[n(1030)],this[n(1644)+n(883)]),this._isBrowser&&_0x45085a[n(810)+n(1780)](t.sXwdP,this[n(628)+n(1147)]),this._isBrowser&&_0x287bca[n(810)+n(1780)](n(797),this["_handleP"+n(1144)])):(h=$(s),g|=t[n(1169)](127,h)<<7))))):(_0x369733[_0x410147++]=_0x925da5>>6|192,_0x175d1e[_0x41b23d++]=o[n(1354)](o[n(1821)](63,_0x5e9c00),128)))))))),{low:x|l<<28,high:t.ousbL(t[n(384)](l,4),t[n(1102)](g,24)),unsigned:e}}function yt(s,e){let n=r,o=e.low>>>0,x=t.BkJte(t[n(384)](e[n(647)],28),t[n(1361)](e[n(561)],4))>>>0,l=t[n(384)](e.high,24),g=t.LvgXH(0,l)?t[n(1013)](0,x)?t[n(1810)](o,16384)?o<128?1:2:t[n(1460)](o,2097152)?3:4:x<16384?t.irEOg(x,128)?5:6:x<2097152?7:8:l<128?9:10,h=le(s,g),u=s[n(506)];switch(g){case 10:u[t.jucYh(h,9)]=t[n(1873)](l,7)&1;case 9:u[t[n(1011)](h,8)]=t[n(1042)](9,g)?t.BkJte(128,l):127&l;case 8:u[t[n(988)](h,7)]=g!==8?t[n(1010)](t[n(1873)](x,21),128):x>>>21&127;case 7:u[t[n(1383)](h,6)]=t[n(1260)](7,g)?t[n(1511)](t[n(384)](x,14),128):t[n(889)](x>>>14,127);case 6:u[t[n(1316)](h,5)]=t[n(1260)](6,g)?t[n(468)](t[n(1682)](x,7),128):t[n(944)](t[n(1682)](x,7),127);case 5:u[t.ffMWc(h,4)]=t.NfZEg(5,g)?t[n(722)](128,x):t[n(1271)](127,x);case 4:u[t.GGIKg(h,3)]=t[n(1481)](4,g)?t[n(1605)](o>>>21,128):t[n(1519)](t[n(1873)](o,21),127);case 3:u[h+2]=t[n(1568)](3,g)?t[n(724)](t[n(1598)](o,14),128):o>>>14&127;case 2:u[t[n(1619)](h,1)]=t.dkvYZ(2,g)?t[n(1719)](o>>>7,128):t[n(1351)](t.zEtVb(o,7),127);case 1:u[h]=g!==1?128|o:t[n(1606)](127,o)}}function Wr(s){return t[r(1031)](L,s)}function Kn(s){return t[r(1031)](k,s)}let Jr=65536,qo=r(1301),rt=t[r(640)](Jr,Jr),Vr=t[r(519)](rt,rt),Yr=t.NRAsm(Vr,2),Me=String[r(1304)+"e"][r(1817)+"At"];class O{constructor(e,n,o){let x=r;this[x(523)]=!0,this[x(647)]=t.eyObC(0,e),this.high=t.QztRG(0,n),this[x(1508)]=!!o}static isLong(e){let n=r;return e&&t.THOvt(!0,e[n(523)])}static[r(771)](e,n,o){let x=r;if(t[x(394)]===t[x(1565)])this[x(1860)+x(1349)+"Id"]=null,this[x(1860)+"l"]=36e5,this[x(997)]=_0xa8a5c3(t[x(1624)],t.ZwESs);else return new O(e,n,o)}static[r(1717)+"s"](e,n,o){let x=r;return o?O[x(1717)+x(801)](e,n):O["fromByte"+x(554)](e,n)}static[r(1717)+r(801)](e,n){let o=r;return new O(t[o(1575)](t[o(592)](t[o(468)](e[0],e[1]<<8),e[2]<<16),t[o(783)](e[3],24)),t.YBYyq(t.KzQrt(e[4]|t[o(1099)](e[5],8),e[6]<<16),e[7]<<24),n)}static["fromByte"+r(554)](e,n){let o=r;if(o(1101)!==t[o(1514)])this[o(792)]++;else return new O(t[o(495)](t[o(592)](t.utbAj(e[4],24),t[o(1102)](e[5],16))|e[6]<<8,e[7]),t.ozZLo(t[o(1015)](t[o(1229)](t[o(490)](e[0],24),e[1]<<16),t.GdDOD(e[2],8)),e[3]),n)}static[r(917)](e){let n=r;if(t[n(1891)]===t[n(1891)])return t[n(1131)](e,qo)?Xr:new O(t[n(1421)](t[n(1605)](Me.call(e,0),t[n(634)](Me[n(1226)](e,1),8))|Me[n(1226)](e,2)<<16,t[n(1102)](Me.call(e,3),24))>>>0,t.iNuzX(t[n(891)](t.YBYyq(t[n(1686)](Me[n(1226)](e,4),t[n(490)](Me[n(1226)](e,5),8)),t[n(634)](Me[n(1226)](e,6),16)),t[n(1102)](Me.call(e,7),24)),0),!0);{let o=/(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}/[n(1245)](_0x4f1006),x=/(([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]))/.test(_0x361cc6);return o?t[n(1899)](_0x4f75f1,_0x2697a6):x?t.VWpjz(_0x51c528,_0x31c776):n(1119)+n(1119)+"00000000"+n(1119)}}toHash(){let e=r;return String["fromChar"+e(1457)](t[e(1271)](255,this[e(647)]),t[e(1682)](this.low,8)&255,t.FSKYV(this.low,16)&255,t.ZqNjw(this.low,24),t[e(1130)](255,this.high),t[e(453)](t[e(472)](this[e(561)],8),255),t.ZqNjw(this[e(561)],16)&255,t[e(1840)](this[e(561)],24))}static[r(957)+"er"](e,n=!0){let o=r;if(isNaN(e))return n?Fo:Xr;if(n){if(e>=Vr)return Ho}else if(t[o(433)](t.QaHAH,t[o(1528)])){if(e<=-Yr)return jo;if(t[o(735)](t.DsWCN(e,1),Yr))return Uo}else return _0x619204[o(655)+o(1880)]||_0x423144[o(656)](_0x19b99e);return O[o(771)](t[o(521)](t[o(1195)](e,rt),0),t.zLrAu(e/rt,0),n)}[r(1237)](){let e=r,n={AvWTc:function(o,x){return t[S(405)](o,x)}};if(t[e(747)](t.VNXUw,t[e(573)]))return this[e(1508)]?t[e(1296)]((this.high>>>0)*rt,t.SJevI(this[e(647)],0)):t[e(1402)](this[e(561)]*rt,t[e(599)](this.low,0));_0x335c30+=HqKaOe.AvWTc(_0x5986cd,_0x7cfa5f),_0x81f3f0++}[r(1389)](){let e=r;return t.LvgXH(0,this[e(561)])&&t[e(1706)](0,this[e(647)])}[r(577)](e){let n=r;O.isLong(e)||(e=O[n(957)+"er"](e));let o=t[n(737)](this[n(561)],16),x=t[n(570)](65535,this.high),l=t[n(1520)](this[n(647)],16),g=t[n(1212)](65535,this[n(647)]),h=t[n(1448)](e[n(561)],16),u=t[n(593)](65535,e.high),w=t[n(948)](e[n(647)],16),C=t[n(657)](65535,e[n(647)]),v=0,D=0,T=0,U=0;return U+=t[n(1258)](g,C),T+=t.RAanP(U,16),U&=65535,T+=t.yYYtO(l,w),D+=t.MwXyD(T,16),T&=65535,D+=t[n(1402)](x,u),v+=t[n(948)](D,16),D&=65535,v+=t[n(1379)](o,h),v&=65535,O[n(771)](t[n(1605)](T<<16,U),t[n(1185)](t[n(780)](v,16),D),this[n(1508)])}equals(e){let n=r;return O[n(523)](e)||(e=O[n(957)+"er"](e)),t[n(1481)](this[n(1508)],e[n(1508)])&&t[n(1184)](t[n(1829)](this.high,31),1)&&t[n(1706)](t[n(1047)](e.high,31),1)?!1:this.high===e[n(561)]&&t[n(926)](this[n(647)],e[n(647)])}[r(706)](){let e=r;if(t.UsguM(t.jklGF,e(1155)))this[e(823)+e(963)]();else return this[e(647)]===-1&&t[e(732)](-1,this[e(561)])?O[e(771)](0,0,this[e(1508)]):t[e(1131)](-1,this[e(647)])?O[e(771)](0,t[e(541)](this[e(561)],1),this[e(1508)]):O[e(771)](this[e(647)]+1,this.high,this.unsigned)}[r(683)](e){let n=r;return e?this[n(1640)+"E"]():this[n(761)+"E"]()}[r(1640)+"E"](){let e=r;if(t[e(1131)](t[e(1656)],e(1442))){let n=this[e(561)],o=this.low;return[t[e(1212)](255,o),t[e(1210)](o,8)&255,t[e(1604)](t.owAqG(o,16),255),t.CJDjq(o,24),255&n,t.bSFwb(t[e(785)](n,8),255),t[e(1368)](t[e(689)](n,16),255),t[e(948)](n,24)]}else{if(this[e(1607)+"tManager"]?.[e(1494)+"chMaxTries"]()){let o=this["_endpoin"+e(876)]?.getCurrentEndpoint();this["_dispatc"+e(1887)+e(1116)](_0x23de71(t[e(488)],{code:1006,reason:e(454)+o+(e(1862)+", max re"+e(606)+e(514)),wasClean:!0}))}else{let o=this._options["reconnectInterce"+e(1615)](_0x493abe,_0x8e9b1c);this[e(704)+e(1887)+e(1116)](_0x3ca87f(t[e(488)],{code:_0x51700d,reason:_0x6054f8,wasClean:!0,willReconnect:o})),o&&this[e(1265)]()}return}}toBytesBE(){let e=r,n=this[e(561)],o=this[e(647)];return[t[e(1179)](n,24),t.OjxPR(t[e(1598)](n,16),255),t.zEtVb(n,8)&255,t[e(1368)](255,n),t[e(753)](o,24),t[e(1043)](o>>>16,255),t[e(453)](t.DDQIa(o,8),255),255&o]}}let Xr=new O(0,0,!1),Fo=new O(0,0,!0),Uo=O[r(771)](-1,2147483647,!1),Ho=O[r(771)](-1,-1,!0),jo=O[r(771)](0,-2147483648,!1);var Be=(function(s){let e=r,n=t[e(1313)].split("|"),o=0;for(;;){switch(n[o++]){case"0":s[s[t.MtXSY]=5002]=t.MtXSY;continue;case"1":s[s[e(1424)+"OR"]=5005]=t[e(1809)];continue;case"2":s[s[e(391)+"RROR"]=5001]=e(391)+"RROR";continue;case"3":return s;case"4":s[s[t[e(974)]]=5003]=t[e(974)];continue;case"5":s[s[e(1734)+e(1582)]=5004]=t.mpZPh;continue}break}})({});class st{constructor(e){let n=r;this[n(1153)]=e,this[n(1462)]=null}}class Zr extends st{constructor(e,n){let o=r,x={heIME:function(l,g){return t[S(1587)](l,g)},sMCvY:function(l,g){return t.GwJaN(l,g)},CRxua:function(l,g){return t[S(1330)](l,g)},YmSiq:function(l,g){return t[S(1776)](l,g)},tAPXe:function(l,g){return t[S(806)](l,g)},ZdVhs:function(l,g){return t.QiUBu(l,g)},XBcIC:function(l,g){return t[S(1371)](l,g)},vclXs:function(l,g){return t[S(1027)](l,g)},jQCyu:function(l,g){return t[S(1189)](l,g)},zfKCp:function(l,g){return t[S(1271)](l,g)},BlVbI:function(l,g){return l&g},GPNtD:function(l,g){return t[S(668)](l,g)},UFDFc:function(l,g){return t[S(1686)](l,g)},nTzLl:function(l,g){return l|g},bSSBE:function(l,g){return t[S(1181)](l,g)},DBMiN:function(l,g){return t[S(634)](l,g)},sxXIL:function(l,g){return t.JqUNS(l,g)},MlTUo:function(l,g){return l>>g},ShmyF:function(l,g){return t.smDgt(l,g)}};if(t[o(1306)]!==t[o(1306)]){if(x[o(1570)](x[o(1233)](_0x241ab1,_0x1c9b02),1))return"";let l="";for(let g=_0x35dfcd;x[o(1570)](g,_0x4e3bea);){let h=_0x1e9a47[g++];if(x.CRxua(h,127))l+=_0x514d73[o(816)+"Code"](h);else if(x[o(1290)](h,192)&&x[o(1570)](h,224))l+=_0x3e43c2[o(816)+o(1457)](x[o(479)](x[o(672)](x[o(494)](31,h),6),x[o(494)](63,_0x5c0db2[g++])));else if(x[o(981)](h,224)&&x[o(1570)](h,240))l+=_0x201e58[o(816)+"Code"](x.tAPXe(x[o(1824)](x.ZdVhs(x[o(618)](15,h),12),x.BlVbI(63,_0x463522[g++])<<6),63&_0xd12257[g++]));else if(h>=240){let u=x[o(832)](x[o(697)](x[o(1286)](x[o(1824)]((7&h)<<18,x[o(672)](x.bSSBE(63,_0x5eef32[g++]),12)),x.DBMiN(x.zfKCp(63,_0x5031a4[g++]),6)),63&_0x1ef1c8[g++]),65536);l+=_0x2779a9[o(816)+o(1457)](x[o(1325)](55296,x[o(401)](u,10))),l+=_0x5e69de[o(816)+"Code"](56320+x.ShmyF(1023,u))}}return l}else super(e),this[o(1727)]=n&&n.message||null}}class Qr extends st{constructor(e,n){let o=r,x=(o(1831)+"0|1|6").split("|"),l=0;for(;;){switch(x[l++]){case"0":this[o(924)]=n&&n[o(924)]||0;continue;case"1":this[o(1727)]=n&&n[o(1727)]||"";continue;case"2":this.filename=n&&n[o(1248)]||"";continue;case"3":this.error=n&&n.error||null;continue;case"4":super(e);continue;case"5":this[o(1699)]=n&&n[o(1699)]||0;continue;case"6":this.code=n&&n.code||5001;continue}break}}}class $r extends st{constructor(e,n){let o=r,x=t.RLASv[o(856)]("|"),l=0;for(;;){switch(x[l++]){case"0":super(e);continue;case"1":this[o(991)]=n&&n[o(991)]||"";continue;case"2":this[o(1777)]=n&&n.code||0;continue;case"3":this[o(470)+o(846)]=n&&n[o(470)+o(846)]||!1;continue;case"4":this[o(660)]=n&&n[o(660)]||!1;continue}break}}}class es extends st{constructor(e,n){let o=r;t[o(594)]!=="vBsQP"?_0x226429&&this._cursorManager[o(1595)+o(1145)+"Name"](_0x26fecd):(super(e),this[o(1770)]=n&&n[o(1770)]||null)}}class ts extends es{constructor(e,n){let o=r;super(e),this[o(1770)]=n&&n[o(1770)]||null,this[o(1727)]=n&&n.message||null}}class ns extends st{constructor(e,n){let o=r;super(e),this[o(1770)]=n&&n[o(1770)]||null}}function ce(s,{message:e,code:n,error:o}){return new Qr(s,{message:e,code:n,error:o})}function he(s,{code:e,reason:n,wasClean:o,willReconnect:x}){return new $r(s,{code:e,reason:n,wasClean:o,willReconnect:x})}function rs(s,{data:e,message:n}){let o=r,x={BLxxD:function(l,g){return t[S(1221)](l,g)},jloVt:function(l,g){return t[S(1403)](l,g)},senjS:function(l,g){return t[S(694)](l,g)},uUwUb:function(l,g){return t[S(1394)](l,g)},NFOIT:function(l,g){return t[S(1451)](l,g)},KXfdl:function(l,g){return t[S(685)](l,g)}};if(t[o(1415)]==="bCQNg"){if(x.BLxxD(_0x193bcc,1)||x.jloVt(_0x1dea7d,_0x46e2e5))return _0x489d78(_0x5bdba2);_0x10103f+_0x31c1b5>_0x448fa5&&(_0x55d481=x.senjS(_0x2881bf,_0x2843d9),_0x249862=0);let l=_0x1632d1[o(1226)](_0x3ae9dc,_0x58f054,_0x2179f9+=_0xabe7ee);return x.uUwUb(7,_0x295cad)&&(_0x1e9e15=x[o(1093)](x[o(461)](7,_0x181fc5),1)),l}else return new ts(s,{data:e,message:n})}function ss(s,{data:e}){return new ns(s,{data:e})}function Gn(s,{message:e}){return new Zr(s,{message:e})}class is{constructor(e,n){let o=r;this[o(830)+"s"]=e,this[o(1411)+"es"]=n,this.currentIndex=0,this[o(1779)+"ndpointT"+o(1335)+"t"]=0}["resetEnd"+r(498)+r(1542)](){let e=r;this[e(787)+e(717)]=0,this[e(1779)+e(984)+e(1335)+"t"]=0}[r(853)+"es"](){let e=r;this[e(1779)+e(984)+e(1335)+"t"]=0}[r(1230)+r(1347)+"nt"](){let e=r;return this.endpoints[this[e(787)+e(717)]]}[r(1230)+"ntEndpoi"+r(1485)+r(459)](){let e=r;return this[e(1779)+"ndpointT"+e(1335)+"t"]}[r(1494)+r(693)+"es"](){let e=r;return!!(t[e(1776)](this["currentI"+e(717)],this[e(830)+"s"][e(1491)])||t[e(1184)](this[e(787)+e(717)],this[e(830)+"s"][e(1491)]-1)&&t[e(1466)](this["currentE"+e(984)+e(1335)+"t"],this.maxRetries))}[r(601)+r(1234)+r(1545)+r(1858)+r(1078)](){let e=r;return t.lqIZf(this[e(787)+"ndex"],this.endpoints[e(1491)])?!0:t.rKKue(this[e(1779)+e(984)+e(1335)+"t"],this[e(1411)+"es"])}[r(1088)+r(1319)+r(1186)+"UpdateCo"+r(878)](){let e=r;return this[e(1779)+e(984)+e(1335)+"t"]=1,this[e(787)+e(717)]++,this.endpoints[this[e(787)+e(717)]]}[r(1230)+r(1347)+r(1124)+r(566)](){let e=r;return this[e(1779)+"ndpointT"+e(1335)+"t"]++,this["getCurre"+e(1347)+"nt"]()}}let it=(t.wYrbO(r(1297)+"d",typeof globalThis)&&t[r(926)](t[r(1381)],globalThis[r(1151)+r(1603)][r(1034)])||t[r(1788)](t.FGjiE,typeof window)&&t[r(625)](t.erfTR,window[r(1151)+r(1603)][r(1034)]))&&t[r(651)](t.FGjiE,typeof document),We=t[r(888)](t.FGjiE,typeof globalThis)&&(t[r(670)](t[r(1724)],globalThis[r(1151)+r(1603)][r(1034)])||t[r(987)](t[r(1082)],globalThis[r(1151)+"tor"][r(1034)]))&&t[r(1138)]!=typeof tt,bt=(t.gHnCk(t.FGjiE,typeof globalThis)&&t[r(417)](t[r(1724)],globalThis[r(1151)+r(1603)][r(1034)])||t[r(1433)](t[r(1138)],typeof globalThis)||t[r(651)](t[r(1138)],typeof globalThis)&&!!globalThis["WeixinJS"+r(1109)])&&t[r(434)](t.FGjiE,typeof wx),vt=t[r(1211)](t[r(1138)],typeof globalThis)&&(t[r(1082)]===globalThis[r(1151)+"tor"][r(1034)]||t[r(926)](r(1040)+r(782)+"alScope",globalThis[r(1151)+r(1603)].name)||t[r(625)](r(420)+r(1287)+r(1478),globalThis[r(1151)+"tor"][r(1034)]))&&t[r(908)](t[r(1138)],typeof self),Ko=t[r(1138)]!=typeof globalThis&&t.rwydI(t[r(1724)],globalThis[r(1151)+"tor"][r(1034)])&&t.JXPka(t[r(1138)],typeof global)&&t[r(1454)](t.nsvFO,global[r(1151)+r(1603)][r(1034)])&&t.FGjiE!=typeof process&&!!process.version;class Wn{constructor(){let e=r;this[e(547)+"rs"]={}}[r(959)](e,...n){let o=r,x=this[o(547)+"rs"][e];if(x)x[o(1324)]()[o(466)](l=>l.fn.apply(l.ctx,n));else if(t.UsguM(t.yNbUT,e)&&!this[o(1869)]){let l=n[o(1491)]&&n[0];if(t.txmva(l,Error))throw l;let g=new Error(t[o(1490)](o(1294)+"d error.",l?t[o(1593)](t[o(1166)](" (",l[o(1727)]),")"):""));throw g[o(1103)]=l,l}return this}[r(1664)](e,n){let o=r;if(t[o(1038)](t[o(1559)],"BnTZH")){if(t[o(644)](void 0,e))this[o(547)+"rs"]={};else if(t.oIfVY(void 0,n))this[o(547)+"rs"][e]=null;else{let x=this[o(547)+"rs"][e];if(x)for(let l=0;t[o(804)](l,x.length);)t.LvgXH(x[l].fn,n)?x[o(1909)](l,1):++l}return this}else{let x=this[o(1607)+"tManager"]?.["getCurre"+o(1347)+"nt"](),l=this._options["reconnec"+o(1445)+"ptor"](_0x3fb7dd[o(1777)],_0x4f859f[o(991)]);this[o(704)+o(1887)+o(1116)](_0x2f855a(t[o(488)],{code:1006,reason:_0x5b8c34.reason||"connecti"+o(1868)+o(596)+o(1489)+"n, hostn"+o(1543)+x,willReconnect:l})),l&&this[o(1265)]();return}}on(e,n,o){let x=r;return(this[x(547)+"rs"][e]||(this[x(547)+"rs"][e]=[]))[x(1473)]({fn:n,ctx:o||this}),this}}class Go extends Wn{[r(1752)+"rrorMessage"](e){let n=r;return e.errMsg||e[n(1172)]?(n(546)+" "+(e.errMsg||"")+n(1725)+(e[n(1172)]||"")).trim():JSON[n(1530)+"y"](e)}constructor(e,n,o){let x=r;super(),this[x(1367)]=null,bt&&wx[x(796)+x(1435)]&&(this[x(1367)]=wx[x(796)+x(1435)]({url:e,protocols:n,header:o,fail:this[x(469)+x(1228)+x(1059)][x(1585)](this),success:this[x(469)+x(1876)+"cessHand"+x(965)][x(1585)](this)})),We&&tt[x(796)+x(1435)]&&(this._socket=tt[x(796)+"ocket"]({url:e,protocols:n,header:o,fail:this["_createSocketFai"+x(1059)][x(1585)](this),success:this[x(469)+x(1876)+"cessHandler"][x(1585)](this)}))}[r(469)+r(1876)+r(815)+r(965)](){Promise.resolve().then(()=>{this[S(539)+"steners"]()})}[r(469)+r(1228)+r(1059)](e){Promise.resolve().then(()=>{let n=S,o=ce(t.yNbUT,{message:this[n(1752)+n(1700)+"age"](e)});this[n(959)]("error",o);let x=t[n(1161)](he,t[n(488)],{reason:this[n(1752)+n(1700)+n(1793)](e)});this.emit(t.toPdC,x)})}_addWsListeners(){let e=r,n={CLqGq:function(o){return t[S(1200)](o)},retlK:function(o,x,l){return t.kYisI(o,x,l)},LtmjA:function(o,x){return t[S(1733)](o,x)},zbFyp:function(o,x){return t[S(988)](o,x)},aTmlC:function(o,x){return t[S(1292)](o,x)},ZLKGa:t[e(632)],fhyWa:e(1674),hIdal:function(o,x,l){return t[e(1599)](o,x,l)}};this[e(1367)][e(857)](o=>{this[e(959)](t.RcDgA,t.ITPlk(ss,t.RcDgA,{...o,data:o.errMsg||""}))}),this._socket[e(532)](o=>{let x=e;if(t[x(1892)]===t[x(884)]){let l=RHzmUl[x(1369)](_0x41b7d5);return RHzmUl[x(709)](_0x3a9874,_0x15cd6c,l),RHzmUl[x(1458)](_0x429300,l)}else this[x(959)](t.toPdC,t.FJpGI(he,t[x(488)],{...o}))}),this[e(1367)][e(503)+"e"](o=>{let x=e;this[x(959)](t[x(1123)],t[x(545)](rs,"message",{...o}))}),this[e(1367)][e(565)](o=>{let x=e,l={Aiahl:function(g,h){return n[S(1866)](g,h)},IDJjw:function(g,h,u){return n[S(709)](g,h,u)}};if(n[x(1060)](x(525),n[x(1053)]))this[x(959)](n[x(1537)],n[x(1815)](ce,x(1674),{...o,message:o[x(496)]||""}));else return PSFuNM[x(1759)](_0x59b4b6(4)[x(1052)]("0"),PSFuNM.IDJjw(_0x2a9bd0,_0x5c4df7,2)[x(1816)](16))[x(1324)](-4)})}[r(855)](e){let n=r,o={yuCRB:function(x,l,g){return t[S(674)](x,l,g)},Xynnf:t[n(970)]};if(e instanceof Uint8Array){let x=e.buffer.slice(e[n(688)+"et"],t[n(834)](e[n(1014)+"th"],e[n(688)+"et"]));this._socket&&this[n(1367)][n(855)]({data:x,fail:l=>{let g=n;this[g(959)]("error",o[g(446)](ce,o[g(851)],{message:this[g(1752)+g(1700)+"age"](l)}))}})}else this[n(1367)]&&this[n(1367)][n(855)]({data:e,fail:x=>{let l=n;this.emit(t[l(970)],ce(t.yNbUT,{message:this[l(1752)+l(1700)+l(1793)](x)}))}})}[r(904)](e,n){let o=r;this[o(1367)]&&this._socket[o(904)]({code:e,reason:n})}[r(810)+r(1780)](e,n){this.on(e,n)}[r(1163)+r(1562)+r(1480)](e,n){this[r(1664)](e,n)}get[r(501)+"te"](){let e=r;return this[e(1367)][e(501)+"te"]}get[r(1303)+"pe"](){let e=r;return this[e(1367)][e(1303)+"pe"]}set binaryType(e){}get[r(1360)](){let e=r,n={GBcMN:function(o,x){return t[S(784)](o,x)},tFnXO:function(o,x){return t[S(784)](o,x)},vJbwy:t[e(1583)],rvRxC:t[e(1704)],xGUkJ:t.KnBuj,LYQSx:t.wKFLh,pGZUg:t[e(1771)],zexqD:function(o,x,l,g){return t[e(502)](o,x,l,g)}};if(t.fXMjn(t[e(998)],t[e(877)]))if(_0x5554d6[e(802)]instanceof _0x2bf395){let o=n[e(1683)](this._options[e(956)+e(905)],_0x251b7d)?{force:!!this[e(463)]["payloadE"+e(905)][e(740)],encoding:this._options["payloadE"+e(905)][e(1726)]?this[e(463)]["payloadE"+e(905)][e(1726)][e(1541)](/\s/g,"")[e(397)+e(1745)]():""}:{force:!1,encoding:this[e(463)][e(956)+"ncoding"]?this._options[e(956)+e(905)].replace(/\s/g,"")[e(397)+e(1745)]():""},x=_0x211a1c[e(956)+e(905)]?_0x2c436a["payloadE"+e(905)].replace(/\s/g,"")[e(397)+e(1745)]():"",l=n[e(1232)](this[e(463)][e(1242)+e(966)],_0x5a72b9)?{force:!!this[e(463)]["payloadT"+e(966)][e(740)],type:this[e(463)][e(1242)+"ype"].type?this[e(463)][e(1242)+e(966)][e(1153)][e(1541)](/\s/g,"")[e(397)+e(1745)]():""}:{force:!1,type:this[e(463)][e(1242)+e(966)]?this._options[e(1242)+e(966)].replace(/\s/g,"")[e(397)+"ase"]():""},g=_0x2b31c7[e(1242)+e(966)]?_0x307e61[e(1242)+e(966)][e(1541)](/\s/g,"")[e(397)+e(1745)]():"",h=l[e(740)]?l.type:g||l.type,u=o[e(740)]?o[e(1726)]:x||o[e(1726)],w=[n.vJbwy,n[e(1357)],n.xGUkJ,n[e(1464)]],C=[e(1143)+"e",n[e(681)]];this[e(463)][e(847)+"ansformTextPayload"]&&w[e(1534)](h)&&(!u||C[e(1534)](u))?_0x1c61b6[e(1907)+"oad"]=n.zexqD(_0x1680f8,_0x508eff[e(802)],0,_0x9e5425[e(802)][e(1014)+"th"]):_0x506b8c[e(1907)+"oad"]=""}else _0x3527c2[e(1907)+e(1761)]="";else return this._socket[e(1360)]}get[r(1791)](){let e=r;if(t.ObijQ(t.iyPqF,t[e(522)]))return this[e(1367)].protocol;this[e(915)+e(1524)]=null}get[r(1455)+"ns"](){let e=r;return this[e(1367)][e(1455)+"ns"]}get[r(1174)+r(1023)](){return 0}}function Wo(s,e){let n=r;if(e)return new e(s.url,s.protocol);if(t[n(414)](bt,We))return new Go(s[n(1360)],s[n(1791)],s.headers);if(t.OIhpY(it,vt)&&t.aiZRt(t[n(1138)],typeof WebSocket)&&WebSocket)return new WebSocket(s.url,s.protocols)}function Jo(s){let e=r;return!!(s||bt&&wx[e(796)+e(1435)]||We&&tt["connectS"+e(1435)]||(it||vt)&&t[e(1788)](t[e(1138)],typeof WebSocket)&&WebSocket)}function os(s,e,n){let o=-1;async function x(l){let g=S;return t[g(971)](l,o)?Promise[g(1340)](new Error(t[g(1712)])):(o=l,t[g(794)](l,n.length)?Promise.resolve():n[l].bind(s)(e,x[g(1585)](null,t.JQPgl(l,1))))}x(0)}function as(s){let e=r,n={rZaYz:function(o,x){return t.wNNhn(o,x)},wqPXo:function(o,x){return o>x},vvCYy:function(o,x){return o(x)},PSGIh:function(o,x){return t.rKKue(o,x)},pMKvQ:function(o,x){return t[S(616)](o,x)},pRutL:function(o,x){return t[S(728)](o,x)},CDETy:function(o,x){return t[S(730)](o,x)},PTSNY:function(o,x){return t[S(1047)](o,x)},PwLKf:function(o,x){return t[S(661)](o,x)},nvQkC:function(o){return t[S(1826)](o)}};if(t.zbeoh(t[e(611)],t[e(611)])){let o=t.AzleC[e(856)]("|"),x=0;for(;;){switch(o[x++]){case"0":_0x2407bb();continue;case"1":_0x180fd2(l=>({...l,get:(g,h,u)=>_0x5a77ce(g,h)||l[e(656)](g,h,u),has:(g,h)=>!!_0x1ff062(g,h)||l[e(1634)](g,h)}));continue;case"2":_0x5aab32();continue;case"3":_0x446724=[npOTLu[e(635)],npOTLu.wkKrV,e(844),npOTLu[e(517)]];continue;case"4":_0x2dc02a=[npOTLu[e(894)],e(1689),e(662),npOTLu[e(1691)],npOTLu[e(1094)]];continue;case"5":_0x29f8f5=new _0x3d93a5;continue}break}}else{let o=0,x=0;for(let l=0;t.RZdqp(l,s.length);++l)if(t[e(747)](t[e(757)],t[e(757)]))if(x=s[e(1817)+"At"](l),t.CEGyD(x,128))o+=1;else if(t[e(1225)](x,2048))o+=2;else if((64512&x)===55296&&t[e(1131)](t[e(1394)](64512,s[e(1817)+"At"](t[e(1553)](l,1))),56320))if(t[e(644)](t.fOXZM,e(1676))){let g=_0x55cb4d||8192,h=n[e(1540)](g,1),u=null,w=g;return function(C){let v=e;if(n[v(1387)](C,1)||n[v(1207)](C,h))return n[v(1522)](_0x1bbddc,C);n[v(711)](w+C,g)&&(u=_0x50a7d0(g),w=0);let D=_0x465a5b.call(u,w,w+=C);return n[v(663)](7,w)&&(w=n[v(455)](n[v(1507)](7,w),1)),D}}else++l,o+=4;else o+=3;else foVQEu[e(1522)](_0x1da526,foVQEu.PwLKf(_0x3e663b,_0xaf1bf3[e(995)])),foVQEu[e(1845)](_0x29cf17);return o}}function xs(s,e,n){let o=r;if(t.pnafo(t[o(1214)],t[o(1883)])){if(t[o(1041)](n,e)<1)return"";let x="";for(let l=e;t[o(804)](l,n);){let g=s[l++];if(g<=127)x+=String[o(816)+o(1457)](g);else if(t[o(614)](g,192)&&t[o(749)](g,224))x+=String[o(816)+o(1457)](t[o(1010)](t[o(1811)](31,g)<<6,t.bHnDC(63,s[l++])));else if(g>=224&&t[o(1225)](g,240))x+=String[o(816)+o(1457)](t[o(1406)](t.ltTEI(15,g),12)|t[o(1132)](t.PxGoA(63,s[l++]),6)|t[o(996)](63,s[l++]));else if(t[o(1738)](g,240)){let h=t[o(825)](t[o(1908)](t.VSfFn((7&g)<<18,t.jnFrG(63,s[l++])<<12)|t[o(432)](63,s[l++])<<6,t[o(1212)](63,s[l++])),65536);x+=String[o(816)+o(1457)](t.MQFKo(55296,h>>10)),x+=String[o(816)+o(1457)](t[o(422)](56320,t[o(593)](1023,h)))}}return x}else this._options.debug&&_0x598f5c[o(1918)][o(929)](_0x1e1cc5,[o(950)+">",..._0x5d821e])}function Jn(s,e,n){let o=r,x=n,l,g;for(let h=0;h<s[o(1491)];++h)if(l=s[o(1817)+"At"](h),t.ujeSI(l,128))e[n++]=l;else if(t[o(1129)](l,2048))e[n++]=t[o(1421)](t.SMhlM(l,6),192),e[n++]=t[o(1007)](63,l)|128;else if(t[o(527)](t[o(774)](64512,l),55296)&&t[o(1131)](t[o(1857)](64512,g=s[o(1817)+"At"](t[o(541)](h,1))),56320))l=t[o(477)](65536,t[o(518)](1023&l,10))+(1023&g),++h,e[n++]=t.IOrGZ(l,18)|240,e[n++]=t[o(1672)](t[o(1095)](l>>12,63),128),e[n++]=t[o(395)](l,6)&63|128,e[n++]=t[o(468)](t[o(548)](63,l),128);else if(t[o(1744)](t.LzSmt,o(1548))){let u={fJnSY:t[o(970)],PcQaN:function(C,v,D){return t[o(1888)](C,v,D)}},w=_0x212614[o(1756)][o(1324)](_0x146ecf[o(688)+"et"],t.MQFKo(_0x3d7efd[o(1014)+"th"],_0x332325[o(688)+"et"]));this._socket&&this[o(1367)][o(855)]({data:w,fail:C=>{let v=o;this[v(959)](u.fJnSY,u[v(1882)](_0x4a6727,u[v(923)],{message:this[v(1752)+v(1700)+v(1793)](C)}))}})}else e[n++]=t[o(1173)](l>>12,224),e[n++]=t.pODhA(t[o(736)](l>>6,63),128),e[n++]=t[o(1711)](t[o(1708)](63,l),128);return n-x}async function cs(s){let e=r;if(t.YlPVd(t[e(1610)],t.DwovW))_0x59a1cf=_0x497517.charCodeAt(_0x2e52f5),_0x34037e<128?_0xbbec91[_0x1adb97++]=_0x5206c5:t[e(1560)](_0x1d36f2,2048)?(_0x2de80b[_0x15407e++]=t[e(934)](t[e(395)](_0x6318ca,6),192),_0x50b872[_0xae6458++]=t[e(722)](t.pFTWf(63,_0x51f911),128)):t[e(1573)](t[e(768)](64512,_0xbc9d5),55296)&&t[e(462)](64512&(_0x32ec02=_0x2b2eba[e(1817)+"At"](t[e(477)](_0x4b9230,1))),56320)?(_0x5f3a16=t[e(407)](t.EYPmE(65536,t[e(1499)](1023&_0x158cd2,10)),t[e(768)](1023,_0x29e1c2)),++_0x5caa1c,_0x36784e[_0x28379a++]=t[e(892)](_0x3d5d12>>18,240),_0x3012b8[_0x5de0ff++]=t[e(1331)](_0x259ee0>>12&63,128),_0x40056f[_0x187d58++]=t.smDgt(t[e(482)](_0x55b223,6),63)|128,_0x51adad[_0x3bcc7e++]=t[e(1173)](t.bQidp(63,_0x13a08d),128)):(_0x2cb8ae[_0x1e5f20++]=t[e(1072)](t[e(1380)](_0x5a3b6b,12),224),_0x26121a[_0x47eea7++]=t[e(1165)](t[e(642)](t[e(395)](_0x5b376c,6),63),128),_0xd17b28[_0x51d7cc++]=t[e(471)](t[e(1028)](63,_0x3f722f),128));else{if(t[e(1531)](t.wKFLh,typeof s)){let n=new Uint8Array(t[e(1855)](as,s));return Jn(s,n,0),n}return t[e(784)](s,ArrayBuffer)?new Uint8Array(s):new Uint8Array(s[e(1756)],s.byteOffset,s[e(1014)+"th"])}}function Vo(s){let e=r,n={bzEkY:t.yNbUT,ftWVl:function(o,x,l){return t[S(935)](o,x,l)}};if(t[e(458)]!==t[e(458)]){let o=_0x869f35(n.bzEkY,{message:_0x14542b.message,code:_0x3054cf[e(1734)+"ERROR"],error:_0x1fed9b});this["_dispatc"+e(1086)+"ent"](o)}else try{if(t[e(1805)](t[e(484)],t.GQDhD))return t[e(1788)](t[e(680)],typeof s)&&(t[e(762)](s,ArrayBuffer)||s[e(1756)]&&t[e(1581)](s[e(1756)],ArrayBuffer))||t[e(1788)](e(906),typeof s)?"":(JSON[e(1183)](s),t[e(1704)]);{let o=e(454)+_0x31e3f4+(" fail, m"+e(758)+e(849)+"ed");this[e(704)+e(1086)+e(1116)](n[e(1797)](_0x2f14f2,n[e(1024)],{message:o,code:_0x213012[e(1409)+"IES_ERROR"],error:_0x4c5c3b}));return}}catch{return t[e(1531)](e(906),typeof s)?t.lRJNk:""}}let Yo=(s,e)=>{let n=r;switch(s){case t.yjtSt:case n(627):return{["x-use-"+s]:1,"x-tt-env":e};default:return{}}};class Xo{constructor(e){let n=r;this[n(1416)+n(459)]=e,this[n(792)]=0}[r(622)](){let e=r;this[e(792)]++}[r(1494)+r(1736)+"nt"](){let e=r;if(t.LZLgE(t[e(1139)],t.txMbZ))this[e(959)](t.NVazf,_0xd24525),this[e(1336)+e(664)]&&this[e(1336)+"eAck"](_0x254aa6);else return t[e(1446)](this[e(792)],this["maxLossC"+e(459)])}[r(738)+r(1749)](e=0){let n=r;this[n(1416)+n(459)]=e,this[n(792)]=0}}async function Zo(s){let e=r,n={AQVWK:function(o,x){return o(x)},CmYtb:t[e(1414)],tGMsq:function(o,x){return t[e(1853)](o,x)},ShUGg:function(o,x){return t[e(1011)](o,x)},CiULS:function(o,x){return t[e(760)](o,x)},lkWLk:e(515),ctoRn:t.pXRJw,baMVU:function(o,x){return o+x},JbKrT:t[e(990)],ICBPo:t[e(1182)]};return new Promise(o=>{let x=e,l={beCFT:function(g,h){return n[S(707)](g,h)},zpVLM:function(g,h){return n[S(726)](g,h)},nZHxq:function(g,h){return n[S(726)](g,h)}};if(n[x(754)](n.lkWLk,n[x(1382)])){let h=""+_0xc37dfa[x(1921)](),u=_0x2f2eec||(_0x1337ac=PVaMuj.beCFT(_0x2c2650,_0x17cf5c)),w=_0x2e4dd9[x(1428)]()[x(1816)](16)[x(1324)](-6);return PVaMuj[x(1688)](PVaMuj[x(413)](PVaMuj[x(413)]("02",h),u),w)}else{if(!it)return n[x(707)](o,x(582)+x(991));try{let g=document.createElement(x(992));window[x(673)+x(920)]=h=>{let u=x;document.body[u(684)+u(1622)](g),window[u(673)+u(920)]=void 0,n.AQVWK(o,h&&h.msg||n.CmYtb)},g[x(1153)]=n[x(910)],g.src=n.baMVU(s.replace(/^ws/,n[x(404)]),n[x(485)]);try{document[x(967)][x(626)+x(1622)](g)}catch{document.body[x(684)+"ild"](g)}}catch{window[x(673)+x(920)]=void 0,n[x(707)](o,x(582)+x(991))}}})}function ze(s,e,n){let o=r;return!!s?.[o(1475)](x=>x[o(776)]===e&&x[o(410)]===n)}function ot(s,e){let n=r;return s?.[n(1475)](o=>o[n(776)]===e)?.[n(410)]}let Vn=null;async function Qo(){let s=r;return Vn||(Vn=Promise[s(637)]()[s(613)](ye[s(1585)](ye,t[s(861)]))),Vn}class $o extends Wn{constructor(e,n){let o=r;super(),this[o(790)]=e,this[o(393)]=n,this[o(997)]=void 0,this[o(915)+o(1524)]=null}async[r(429)](){await this[r(1240)]()}async _init(){let e=r,n={HDdGg:function(o,x){return o!==x},VoGaX:"troRm",anWbx:function(o){return o()},UrMyQ:function(o,x,l,g){return t[S(903)](o,x,l,g)},yETbR:function(o,x){return t[S(408)](o,x)}};if(!this[e(997)]){if(this._initPromise)return this[e(915)+e(1524)];try{if(t[e(747)](e(1206),t[e(1774)])){let o=this[e(790)],x=this._keyPath;this["_initPro"+e(1524)]=(async()=>{let l=e,g={xcqGf:function(u,w){return n[S(746)](u,w)},VLCav:n[l(1068)]},{openDB:h}=await n[l(983)](Qo);this._qosDB=await n[l(406)](h,l(673)+"_"+o,1,{upgrade(u){let w=l;if(g[w(403)](g[w(703)],g.VLCav))try{this[w(997)]?.close(),this[w(997)]=void 0}catch(C){_0x39a482[w(1918)](C)}else u[w(1209)+w(1439)+"e"](o,{keyPath:x})}})})(),await this["_initPro"+e(1524)]}else _0x20057a=emQMJg[e(763)](_0x175229,_0x2a75d0)}catch(o){console[e(1918)](o)}finally{this["_initPro"+e(1524)]=null}}}async get(e){let n=r;try{return await this[n(1240)](),this[n(997)]?.get(this[n(790)],e)}catch(o){console[n(1918)](o)}}async[r(716)](e,n){let o=r;return await this._init(),this[o(997)]?.[o(1766)](this._dbName,e)}async[r(1372)](e){let n=r;try{return await this[n(1240)](),this[n(997)]?.delete(this[n(790)],e)}catch(o){if(t[n(1292)](t[n(729)],t[n(729)]))return;console[n(1918)](o)}}async clear(){let e=r,n={WjpNm:function(o,x){return t[S(1854)](o,x)},GZSnx:function(o,x){return o+x}};try{return e(1134)===t[e(1427)]?(await this._init(),this[e(997)]?.[e(1879)](this._dbName)):(_0x57d017[e(1337)+"t8"]?_0x3e733b[e(1337)+"t8"](_0x4ab6bf,_0x2fe456):_0x420221[_0x3369fb]=n.WjpNm(255,_0x10d0a2),n[e(530)](_0x30b6ad,1))}catch(o){console[e(1918)](o)}}async[r(649)](){let e=r;return await this[e(1240)](),this[e(997)]?.[e(1742)+"ys"](this[e(790)])}async[r(662)](){let e=r;return await this[e(1240)](),this[e(997)]?.[e(662)](this[e(790)])}async[r(1160)](){let e=r;try{t.TYgHM(t[e(1586)],t[e(1586)])?(_0xdb0712[e(1163)+"entListe"+e(1480)](e(1493),_0x20f561),_0x8fb268[e(1163)+e(1562)+e(1480)](npOTLu.yNbUT,_0x253789)):(this[e(997)]?.close(),this[e(997)]=void 0)}catch(n){console[e(1918)](n)}}get[r(986)](){let e=r;try{return!!this[e(997)]}catch(n){return t.zbeoh(t[e(1629)],t[e(1629)])?t[e(1660)](t.gXmdO(_0x45cae1,8)[e(1052)]("0"),t[e(538)](_0x44c3e9,_0x14ea2a,10)[e(1816)](2))[e(1324)](-8):(console[e(1918)](n),!1)}}}class e0{constructor(e,n){let o=r;this[o(624)]=e,this[o(435)]=n,this[o(997)]=localStorage}async[r(429)](){}get _prefix(){return"frontier_"+this[r(624)]}async[r(656)](e){let n=r,o=this[n(997)][n(1614)](this[n(1551)]);return JSON[n(1183)](o||"{}")[e]}async[r(716)](e,n){let o=r,x=this[o(997)].getItem(this[o(1551)]),l=JSON[o(1183)](t[o(414)](x,"{}"));return l[n||e[this[o(435)]]]=e,this._qosDB.setItem(this[o(1551)],JSON[o(1530)+"y"](l)),n||e[this._pathKey]}async del(e){let n=r,o=this._qosDB[n(1614)](this[n(1551)]),x=JSON.parse(o||"{}");return x[e]=void 0,this[n(997)][n(1677)](this[n(1551)],JSON.stringify(x))}async clear(){let e=r,n={UhFuo:function(o,x){return t[S(951)](o,x)}};if(t[e(574)]("DgHmi",t.oHEKn))return this[e(997)][e(1879)]();_0x4b6978=n.UhFuo(_0x361fd8,_0x514e5d),_0x19c807=0}async[r(649)](){let e=r,n=this._qosDB.getItem(this[e(1551)]),o=JSON[e(1183)](t.BAktO(n,"{}"));return Object[e(649)](o)}async[r(662)](){let e=r,n=this[e(997)][e(1614)](this[e(1551)]),o=JSON[e(1183)](t[e(1074)](n,"{}"));return Object[e(931)](o)}[r(1160)](){return Promise[r(637)]()}get[r(986)](){return!!this[r(997)]}}class t0{constructor(e,n){let o=r;this._DBName=e,this[o(435)]=n,this[o(997)]=We?tt:bt?wx:null}async[r(429)](){}get[r(1551)](){return"frontier_"+this[r(624)]}async[r(656)](e){let n=r,o=this._qosDB[n(1646)+"geSync"](this[n(1551)]);return JSON[n(1183)](t[n(414)](o,"{}"))[e]}async[r(716)](e,n){let o=r,x=this[o(997)][o(1646)+"geSync"](this[o(1551)]),l=JSON[o(1183)](t[o(1157)](x,"{}"));return l[n||e[this[o(435)]]]=e,this[o(997)][o(953)+"geSync"](this[o(1551)],JSON.stringify(l)),n||e[this[o(435)]]}async del(e){let n=r,o=this[n(997)][n(1646)+n(1787)](this[n(1551)]),x=JSON[n(1183)](o||"{}");return x[e]=void 0,this[n(997)][n(953)+n(1787)](this._prefix,JSON.stringify(x))}async[r(1879)](){let e=r;return this[e(997)][e(619)+e(1254)]()}async[r(649)](){let e=r,n=this[e(997)][e(1646)+e(695)+"nc"](this[e(1551)]),o=JSON[e(1183)](t[e(414)](n,"{}"));return Object[e(649)](o)}async[r(662)](){let e=r,n=this[e(997)][e(1646)+"geInfoSync"](this[e(1551)]),o=JSON.parse(t[e(1157)](n,"{}"));return Object.values(o)}[r(1160)](){let e=r;return t[e(1412)]("LXfvr",e(620))?this[e(997)].clear():Promise[e(637)]()}get isReady(){return!!this[r(997)]}}function fs(s,e){let n=r;if(t[n(1356)](We,We))return new t0(s,e);if(t.RgfTm(it,vt)&&t[n(1788)](t[n(1138)],typeof indexedDB))return new $o(s,e);if(t[n(955)](it,vt)&&t[n(1788)](n(1297)+"d",typeof localStorage))return new e0(s,e);throw new Error(t.EqzQh)}class n0{constructor(){let e=r;if(t[e(692)](t[e(1039)],t.vxjEU))this["_interva"+e(1349)+"Id"]=null,this[e(1860)+"l"]=36e5,this[e(997)]=fs(t[e(1624)],t[e(1601)]);else{let n=this[e(1607)+e(876)]?.[e(1230)+e(1347)+"nt"]();this[e(704)+e(1887)+"ent"](t[e(769)](_0x46c951,t.toPdC,{code:1006,reason:e(454)+n+(e(1862)+e(1830)+e(606)+e(514)),wasClean:!0}))}}async[r(1860)+r(1633)](){let e=r;t[e(1680)](clearInterval,this["_interva"+e(1349)+"Id"]),this[e(1860)+e(1349)+"Id"]=t[e(545)](setInterval,()=>{let n=e;this[n(823)+n(963)]()},this[e(1860)+"l"])}async[r(429)](){let e=r;await this[e(997)][e(429)]()[e(613)](()=>{let n=e;if(t[n(1539)]!==n(430))this[n(1860)+"lFlush"]();else return new _0x3d5fb6(_0x2a860a,_0x5590a5,_0x4dfbd7)})}async[r(823)+"ired"](){let e=r;(await this[e(997)]?.[e(662)]()||[])[e(1497)](({timestamp:x})=>x<Date[e(1921)]()).forEach(x=>{let l=e;this[l(997)]?.[l(1372)](x[l(1496)+"id"])})}async[r(1372)](e){let n=r;return this[n(997)]?.[n(1372)](e)}async[r(716)](e,n){let o=r;return this[o(997)]?.[o(716)]({message_id:e,timestamp:n})}async[r(656)](e){let n=r;return this[n(997)]?.[n(656)](e)}async[r(1160)](){let e=r;clearInterval(this[e(1860)+e(1349)+"Id"]),await this._qosDB?.closeDB()}get[r(986)](){let e=r;return this._qosDB?.[e(986)]}}function Yn(s){let e=r,n=!!this._options.enableQoS;if(!n)return{enabled:n,isQoSMessage:!1,isQoSAck:!1,isAckCleanupMessage:!1,ackMsgIds:[]};let o=ze(s[e(1727)][e(542)],t.dbezy,"2"),x=o&&t.HVfBB(ze,s[e(1727)][e(542)],t.zVuad,"1"),l=o&&t[e(903)](ze,s[e(1727)][e(542)],t[e(1912)],"1"),g=l?t[e(1597)](ot,s.message[e(542)],"x_fronti"+e(781)+e(445))?.[e(856)](",").filter(Boolean)||[]:[];return{enabled:n,isQoSMessage:o,isQoSAck:x,isAckCleanupMessage:l,ackMsgIds:g}}async function us(){let s=r;return this[s(741)+s(589)]||(this[s(741)+s(589)]=new n0),this[s(741)+s(589)][s(986)]||await this[s(741)+s(589)].openDB(),this[s(741)+s(589)]}async function r0(s,e){let n=r;if(t[n(1911)](t[n(872)],n(1521)))throw this[n(1265)+"Lock"]=!1,_0x32dc09;{let{enableAutoAck:o}=this[n(463)],x=t.IPcMi(ze,s[n(1727)][n(542)],t[n(1631)],"1"),l=ze(s.message[n(542)],"is_ack","1"),g=Yn[n(1226)](this,s);if(o&&x){let{SeqID:h,LogID:u,service:w,LogIDNew:C,method:v}=s[n(1727)];this[n(1806)]({SeqID:h,LogID:u,LogIDNew:C,service:w,method:v,headers:[{key:t[n(682)],value:"1"},{key:t[n(390)],value:t[n(727)](C,"")},{key:n(1715),value:"0"}]})}l&&!g[n(671)]&&this[n(704)+"hAckMess"+n(1735)](s),e()}}async function s0(s,e){let n=r;this[n(1702)](n(1329),s[n(1727)]),t[n(667)](e)}async function i0(s,e){let n=r,o=t.NBTzv(Wr,await cs(s.data));try{if(t[n(1057)](o[n(802)],Uint8Array)){let x=t.CaGEt(this[n(463)][n(956)+n(905)],Object)?{force:!!this[n(463)]["payloadE"+n(905)][n(740)],encoding:this._options[n(956)+n(905)][n(1726)]?this._options[n(956)+n(905)][n(1726)].replace(/\s/g,"")["toLowerC"+n(1745)]():""}:{force:!1,encoding:this[n(463)].payloadEncoding?this._options[n(956)+n(905)][n(1541)](/\s/g,"")[n(397)+n(1745)]():""},l=o[n(956)+n(905)]?o[n(956)+n(905)][n(1541)](/\s/g,"")[n(397)+n(1745)]():"",g=this[n(463)][n(1242)+n(966)]instanceof Object?{force:!!this[n(463)].payloadType[n(740)],type:this._options[n(1242)+"ype"][n(1153)]?this[n(463)][n(1242)+n(966)][n(1153)][n(1541)](/\s/g,"")[n(397)+n(1745)]():""}:{force:!1,type:this[n(463)][n(1242)+"ype"]?this._options.payloadType[n(1541)](/\s/g,"")[n(397)+n(1745)]():""},h=o.payloadType?o[n(1242)+n(966)].replace(/\s/g,"")[n(397)+n(1745)]():"",u=g.force?g[n(1153)]:h||g.type,w=x[n(740)]?x[n(1726)]:l||x[n(1726)],C=[t[n(1583)],t[n(1704)],n(529)+n(1666)+";charset=utf-8","string"],v=[t[n(1556)],t.lrVaQ];this[n(463)].enableTransformTextPayload&&C[n(1534)](u)&&(!w||v[n(1534)](w))?o["textPayl"+n(1761)]=t.wWZhy(xs,o.payload,0,o[n(802)][n(1014)+"th"]):o["textPayl"+n(1761)]=""}else o[n(1907)+n(1761)]=""}catch(x){o[n(1907)+"oad"]="",console[n(1918)](x)}s[n(1727)]=o,t[n(1200)](e)}function o0(s,e,n){let o={YNMJb:function(u,w){return t[S(749)](u,w)},AHlRx:function(u,w){return t[S(820)](u,w)},kfvSA:function(u,w){return t[S(900)](u,w)},KLGpx:function(u,w){return t[S(1386)](u,w)},zOUHB:function(u,w){return t[S(1719)](u,w)}},x=t.GnsBd(n,8192),l=t.KufEw(x,1),g=null,h=x;return function(u){let w=S;if(o[w(1758)](u,1)||u>l)return s(u);o.AHlRx(h,u)>x&&(g=o[w(1236)](s,x),h=0);let C=e.call(g,h,h+=u);return o[w(1314)](7,h)&&(h=o[w(562)](o[w(1090)](7,h),1)),C}}let a0=4294967295;function x0(s,e,n){let o=r;return t[o(1299)](RangeError,t[o(419)](t.MClIK(t[o(1338)](t[o(443)]+s,t[o(793)])+(e||1),t.dccyX),n))}function c0(s,e,n){let o=r;if(n>a0)throw new Error("integer "+o(1566)+"e");let x=3;for(;t[o(1696)](x,0);){let l=255&n;t.wWZhy(Zn,l,s,t[o(1083)](e,x)),n>>>=8,x--}return e+4}function f0(s,e){let n=r,o=0,x=e,l=t.rHueZ(e,4);for(;t[n(916)](x,l);){let{value:g,offset:h}=t.EeQfm(Xn,s,x);x=h,o=t[n(1406)](o,8)>>>0,o+=g}return{value:o,offset:l}}function u0(s,e,n){let o=r,x=(o(1474)+"4")[o(856)]("|"),l=0;for(;;){switch(x[l++]){case"0":if(e[o(1327)])return t.pzyGj(e[o(1327)](s,n),n);continue;case"1":if(!s)return n;continue;case"2":if(t[o(1348)](s.length,40))return Jn(s,e,n)+n;continue;case"3":if(e[o(1056)+"e"])return t[o(1190)](e[o(1056)+"e"](s,n),n);continue;case"4":return t[o(1190)](Jn(s,e,n),n)}break}}function d0(s,e){let n=r,o=new O(t[n(1015)](t[n(629)](t[n(1126)](s[t[n(1619)](e,4)],24)|t[n(1122)](s[t[n(938)](e,5)],16),t[n(1690)](s[t.DsWCN(e,6)],8)),s[t[n(652)](e,7)]),t[n(1165)](t[n(1421)](t.sxIiL(t[n(1126)](s[e+0],24),t[n(608)](s[t[n(1316)](e,1)],16)),t.AtOjp(s[t[n(1166)](e,2)],8)),s[e+3]),!0);return e+=8,{value:o,offset:t.Jluor(e,8)}}function l0(s,e,n){let o=r;if(t[o(1069)]===t.NNCcs)_0x1cfdf9.log(_0x37b3b4);else{let x=s.low,l=s[o(561)];return e[n]=t.KufEw(l,24),e[t[o(423)](n,1)]=t[o(1519)](t[o(396)](l,16),255),e[n+2]=t[o(1492)](l>>>8,255),e[t[o(893)](n,3)]=t[o(1472)](255,l),e[t[o(569)](n,4)]=t[o(1859)](x,24),e[n+5]=t[o(1730)](x>>>16,255),e[n+6]=t[o(768)](t.ktrsc(x,8),255),e[n+7]=255&x,n+=8,n}}function Xn(s,e){let n=r;if(t[n(579)](t[n(842)],t[n(842)]))return s.readUInt8?{value:s[n(1523)+"8"](e),offset:t[n(407)](e,1)}:{value:t.bfcYf(255,s[e]),offset:t.Jluor(e,1)};this._isInit=!0,this._connect()}function Zn(s,e,n){let o=r;return e[o(1337)+"t8"]?e.writeUint8(s,n):e[n]=t[o(1701)](255,s),t[o(1251)](n,1)}let h0=function(s){return new Uint8Array(s)},g0=t.zJcCb(t.FGjiE,typeof Buffer)?Buffer[r(873)+r(1890)]:t[r(1224)](o0,h0,Uint8Array[r(1304)+"e"][r(936)]),p0=16,Qn=32;function m0(s){let e=r,n=0,o={};for(let x=0;t[e(1227)](x,s.length);x++)o[s[x][e(1678)+e(1250)]]=as(s[x][e(1678)+e(1250)]),n+=14+o[s[x][e(1678)+e(1250)]];return[n,o]}function ds(s,e,n){let o=r,[x,l]=t[o(945)](m0,s),g=g0(x),h=0;return s[o(466)](u=>{let w=o,C=("7|4|10|6"+w(473)+w(777))[w(856)]("|"),v=0;for(;;){switch(C[v++]){case"0":h=t[w(1063)](l0,O[w(957)+"er"](u.cursor||e),g,h);continue;case"1":h=t[w(1914)](u0,u[w(1678)+"ame"],g,h);continue;case"2":console.log(t[w(1e3)],h);continue;case"3":console.log(t[w(1405)],h);continue;case"4":h=t[w(1753)](Zn,0,g,h);continue;case"5":console[w(1918)](t[w(641)],h);continue;case"6":h=t.ZRTLb(c0,g,h,u[w(1580)]||0);continue;case"7":console[w(1918)](t[w(1420)],u,u[w(1580)]);continue;case"8":h=Zn(l[u[w(1678)+w(1250)]],g,h);continue;case"9":console.log(t[w(1274)],h);continue;case"10":console.log(t.YOunz,h);continue}break}}),{frameType:Qn,headers:[{key:t.WiQig,value:n}],payload:g}}function _0(s){let e=r,n=0,o=[];for(;n<s[e(1014)+"th"];){let{offset:x}=t[e(1888)](Xn,s,n);n=x;let l={cursor_name:"",cursor:0,service:0},{value:g,offset:h}=f0(s,n);l[e(1580)]=g,n=h;let{value:u,offset:w}=t.kYisI(Xn,s,n);n=w,l["cursor_n"+e(1250)]=t[e(903)](xs,s,n,t[e(977)](n,u)),n+=u;let{value:C,offset:v}=t[e(1716)](d0,s,n);l[e(1828)]=C[e(1237)](),n=v,o.push(l)}return o}function w0(){let s=r;return{frameType:Qn,headers:[{key:t[s(807)],value:t[s(549)]}],payload:void 0}}class y0{constructor(e,n,o){let x=r;this[x(690)+"ameSpace"]=e,this[x(1366)+x(1276)]=n,this[x(587)+"Strategy"]=o,this._qosDB=fs(this["_cursorN"+x(1847)],x(1678)+x(1250))}async[r(429)](){await this._qosDB.openDB()}async[r(1889)+"rs"](){let e=r;if(!this[e(997)].isReady)return;let n=this[e(587)+e(798)],o=await this[e(997)][e(662)]();switch(console.log(e(835)+e(1289),o),n){case t[e(1375)]:return o&&o[e(1491)]?t[e(858)](ds,o,0,this[e(1366)+e(1276)]):void 0;case t.WtAeR:return;case t[e(1645)]:return o&&o[e(1491)]?t[e(759)](ds,o,0,this[e(1366)+e(1276)]):t[e(1004)](w0)}}async set(e,n,o){let x=r;return console[x(1918)](x(1813),e,n,o),this[x(997)][x(716)]({cursor_name:e,cursor:n,service:o})}async[r(1618)+"rs"](e){let n=r,o=_0(e);for(let x of o)console[n(1918)](n(580)+"r",o),await this[n(997)][n(716)](x)}async[r(656)](e){let n=r;return(await this[n(997)][n(656)](e))?.[n(1828)]}async[r(1160)](){await this[r(997)].closeDB()}[r(1595)+r(1145)+r(1533)](e){let n=r;this[n(1366)+n(1276)]=e}get[r(986)](){return this[r(997)].isReady}}let b0=t.yRGwM;async function ls(s){let e=r,n={viTlz:function(h,u){return t[S(869)](h,u)},FbrWr:function(h,u){return t[S(921)](h,u)},jBldQ:function(h,u){return h!==u}};if(!this[e(463)][e(1036)+"S"])return null;let{aID:o,fpID:x,messageStrategy:l}=this[e(463)],g=t[e(1157)](s,b0);try{if(this["_cursorM"+e(1140)])if(e(1623)===t[e(658)]){if(tNcfoo.viTlz(_0x4d9dd6,_0x23f51f))return _0x4ff289(_0x33cb42);if(_0x4afd19[e(1634)](_0x20bd14))return _0x14afd2[e(656)](_0x3a8e07);let h=tNcfoo[e(1164)](_0x558181,_0x2dce2b);return tNcfoo.jBldQ(h,_0x579a38)&&(_0x17c343.set(_0x486c2d,h),_0x580e16.set(h,_0x517ce9)),h}else s&&this["_cursorM"+e(1140)]["updateCu"+e(1145)+"Name"](s);else this[e(952)+e(1140)]=new y0(x+"_"+o+"_"+g,g,l);return this[e(952)+e(1140)][e(986)]||await this[e(952)+e(1140)][e(429)](),this[e(952)+"anager"]}catch{return null}}async function v0(s,e){let n=r,o={yelyh:t.WiQig,wtvpc:t.KEVxC},x=t[n(491)](ze,s[n(1727)][n(542)],t.vZwxG,"-1"),l=t[n(1823)](ze,s.message[n(542)],t[n(682)],"1"),g=t[n(1065)](ot,s[n(1727)].headers,t[n(456)]),h=t[n(1740)](Number,t[n(935)](ot,s[n(1727)].headers,n(564)+n(1452)))||0,u=Yn[n(1226)](this,s),w=t.PCFpQ(ze,s[n(1727)][n(542)],t[n(1504)],"2"),C=ot(s.message.headers,t[n(1501)]),v=Number(t[n(1638)](ot,s[n(1727)][n(542)],t.jcdhS));if(u[n(671)])return t.mLTgH(e);let D=u["isQoSMes"+n(389)]?await us[n(1226)](this):null;if(t[n(1693)](s[n(1727)].service,0)&&l&&!x||s[n(1727)].service>0){if(g&&u[n(1343)+n(389)]&&D)return!!!await D[n(656)](g)&&(this[n(704)+"hMessage"+n(528)](s),await D.set(g,t[n(1431)](Date[n(1921)](),h))),e();if(w){if(n(1705)===t[n(1518)])return{frameType:_0x1a2313,headers:[{key:EmuBQH[n(1363)],value:EmuBQH[n(745)]}],payload:void 0};{let T=await ls.call(this);if(!T)return this["_dispatchMessage"+n(528)](s),t.jviGj(e);let U=await T[n(656)](C)??-1;if(t[n(749)](U,v))this[n(704)+"hMessage"+n(528)](s),T[n(716)](C,v,s[n(1727)][n(1580)]);else throw new Error("recevied"+n(1591)+n(1087)+v+(n(1905)+n(811)+"al cursor ")+U);return t[n(667)](e)}}return this[n(704)+"hMessage"+n(528)](s),t[n(1171)](e)}}async function S0(s,e){let n=r,o=Yn[n(1226)](this,s);if(!o[n(1343)+n(389)])return t[n(1612)](e);let x=await us[n(1226)](this);if(o["isAckCle"+n(875)+n(1793)]&&o.ackMsgIds[n(1491)])for(let l of o.ackMsgIds)await x[n(1372)](l);t[n(1743)](e)}async function C0(s,e){let n=r,o=t[n(1021)](s[n(1727)][n(710)+"e"],p0),x=t.CPcTa(s[n(1727)][n(710)+"e"],Qn);if(t[n(809)](!o,!x))return e();let l=t[n(1223)](ot,s[n(1727)].headers,t.WiQig);if(!l)return t[n(1449)](e);let g=await ls[n(1226)](this,l);if(!g)return t.MIzHL(e);if(o){let h=await g[n(1889)+"rs"](),u={frameType:h?.["frameType"],SeqID:O[n(957)+"er"](this[n(1247)]++),LogID:O.fromNumber(this._options[n(932)+n(438)]()),service:9e3,method:5,headers:h?.[n(542)],payload:h?.[n(802)]},w=t[n(1049)](k,u);this[n(1578)]&&this[n(1578)][n(501)+"te"]&&this[n(1578)].send(w)}if(x){let h=s[n(1727)].payload;h&&g.setCursors(h)}}let E0=async function(s,e){let n=r;this[n(447)]=!1,clearTimeout(this[n(1265)+n(1395)+n(1621)]),e()},A0=async function(s,e){let n=r,o={cpdPE:function(x,l){return t[S(504)](x,l)},SCAhD:function(x,l){return t.UygTT(x,l)},zHMGt:function(x,l){return t.oQYIi(x,l)},bddUc:function(x,l){return t[S(1844)](x,l)},ZhYld:function(x,l){return t.WazBg(x,l)},PhkLC:function(x,l){return t.pODhA(x,l)},RVTPS:function(x,l){return t.zQBnx(x,l)},IvOVj:function(x,l){return t.cUlQs(x,l)},gOAtl:function(x,l){return t[S(1728)](x,l)},vlgxc:function(x,l){return x-l},vBYrm:function(x,l){return t[S(719)](x,l)},RNCmQ:function(x,l){return t.eyObC(x,l)},zBQUB:function(x,l){return t[S(783)](x,l)},IekqO:function(x,l){return t[S(1663)](x,l)},vBTOv:function(x,l){return t[S(1220)](x,l)},Tpeac:function(x,l){return t[S(1647)](x,l)},vgmoB:function(x,l){return t[S(1295)](x,l)},AegXY:function(x,l){return x&l}};if(t[n(1486)](t[n(791)],n(1561))){if(!this[n(1578)]||t[n(604)](this[n(1578)][n(501)+"te"],this[n(535)]))return t.Nwftt(e);let{pingInterval:x}=this[n(463)];this[n(1607)+n(876)]?.[n(1569)+n(498)+n(1542)]();for(let g=0;t[n(949)](g,this[n(587)+n(1589)][n(1491)]);g++){let h=this[n(587)+n(1589)][g];if(this[n(1578)][n(501)+"te"]===this[n(535)]&&t[n(865)](null,h))this._ws&&this[n(1578)][n(855)](h),this[n(587)+n(1589)][g]=null;else break}this[n(587)+n(1589)]=this[n(587)+"Queue"][n(1497)](g=>!!g),this[n(1273)+n(1894)+"Id"]=t[n(1592)](setTimeout,()=>this[n(1022)](),x),this[n(704)+"hOpenEvent"](s),this._isBrowser&&this._ws&&(this[n(1578)][n(1303)+"pe"]=this[n(961)+n(966)]);let l=this[n(1607)+"tManager"]?.[n(1230)+n(1347)+"nt"]();this[n(1702)](n(1293)+l+n(1385)),t[n(1743)](e)}else{let x=_0x383ca2[_0x44da77++];if(OmRtft[n(1054)](x,127))_0x5c7b4a+=_0xf3556c["fromChar"+n(1457)](x);else if(OmRtft[n(480)](x,192)&&OmRtft[n(1213)](x,224))_0x1e7c5d+=_0x36dc77[n(816)+n(1457)](OmRtft[n(500)](OmRtft[n(723)](31,x)<<6,OmRtft[n(723)](63,_0x3e2ac1[_0x1d4a88++])));else if(OmRtft[n(480)](x,224)&&x<240)_0x191cde+=_0x38fb29[n(816)+n(1457)](OmRtft.bddUc(OmRtft.PhkLC(OmRtft.RVTPS(OmRtft.ZhYld(15,x),12),OmRtft[n(1033)](63,_0x55a26d[_0x233069++])<<6),OmRtft.gOAtl(63,_0x5bc742[_0x4e047e++])));else if(x>=240){let l=OmRtft[n(1729)](OmRtft[n(1188)](OmRtft[n(500)](OmRtft[n(511)](OmRtft.zBQUB(7&x,18),OmRtft[n(1136)](OmRtft.IekqO(63,_0x3f52ce[_0x457643++]),12)),OmRtft.zBQUB(OmRtft[n(550)](63,_0x42b96d[_0x374cc5++]),6)),OmRtft[n(1384)](63,_0x24b870[_0x3a1d57++])),65536);_0x48bebe+=_0x51f135[n(816)+"Code"](OmRtft[n(1465)](55296,l>>10)),_0x2e514c+=_0x23f110[n(816)+n(1457)](OmRtft.vgmoB(56320,OmRtft[n(609)](1023,l)))}}},k0=async function(s,e){let n=r,o=this[n(1607)+n(876)]?.[n(1230)+n(1347)+"nt"]();this[n(1702)](n(1293)+o),t[n(1671)](e)};class D0 extends Wn{constructor(e){let n=r,o={iyzsg:function(h,u){return t[S(1307)](h,u)},cxUYM:t[n(450)],HGykj:t[n(1438)],hrbEt:function(h,u,w){return t[n(409)](h,u,w)},lGMyY:function(h,u){return t[n(1106)](h,u)},mSGea:function(h,u){return t[n(1081)](h,u)},wDFmZ:t[n(854)],ljPlG:t.XYXVc,dnTrY:t[n(1804)],ECpeF:n(1493),mQNrA:function(h,u,w){return h(u,w)},ZEQWB:function(h,u,w,C){return t[n(1280)](h,u,w,C)},neFgq:"error",noCGQ:function(h,u){return h+u},JZqXa:function(h,u){return t[n(1083)](h,u)},eYOSa:function(h,u){return t[n(451)](h,u)},hJEZQ:function(h,u){return t[n(1819)](h,u)},IIwTv:function(h,u){return t[n(914)](h,u)},IgogH:function(h,u){return t.ItFsT(h,u)},rDuCM:function(h,u){return t.HWJHv(h,u)},IxcNP:function(h,u){return h&u},QavWA:function(h,u){return t[n(1825)](h,u)},SLJWa:function(h,u){return h&u},fGPhJ:function(h,u){return t[n(512)](h,u)},cCPAI:function(h,u){return t.CTPun(h,u)},yRcee:function(h,u){return t[n(1008)](h,u)},iOZOr:function(h,u){return t[n(827)](h,u)},VBeQE:function(h,u){return h||u}};super(),this[n(1600)+n(779)+n(1579)]=!0,this[n(1231)+"er"]=it,this[n(1721)]=Ko,this[n(1266)+"T"]=We,this[n(1073)+"X"]=bt,this[n(962)+"r"]=vt,this[n(587)+n(1589)]=[],this[n(1607)+n(876)]=null,this[n(487)+n(584)]=!1,this[n(961)+n(966)]=n(1092)+n(571),this[n(1265)+"Lock"]=!1,this["_connect"+n(1395)+n(1621)]=null,this[n(572)+n(1822)+n(1874)]=null,this[n(1273)+n(1894)+"Id"]=null,this._seqId=0,this._isInit=!1,this[n(1558)]="",this[n(741)+"ger"]=null,this[n(952)+n(1140)]=null,this["_pingLos"+n(621)]=null,this._protocols="pbbp2",this[n(1871)]=3,this[n(939)+"NG"]=0,this[n(535)]=1,this.CLOSING=2,this[n(1135)]=h=>{let u=n;if(o[u(1665)](o[u(563)],o.HGykj))try{os(this,h,[E0,A0,k0])}catch(w){let C=o.hrbEt(ce,"error",{message:w[u(1727)],code:Be[u(1424)+"OR"],error:w});this[u(704)+u(1086)+u(1116)](C)}else return _0x3fe634[u(1918)](_0x448561),!1},this._onMessage=async h=>{let u=n,{pingInterval:w,pingFrequency:C}=this._options;if((o[u(1345)]("hi",h[u(1770)])&&o[u(665)](o[u(1620)],C)||o.mSGea(o.ljPlG,C))&&(this._clearPingTimer(),this[u(959)](o.dnTrY,o[u(1235)]),this[u(1273)+u(1894)+"Id"]=o[u(1025)](setTimeout,this[u(1022)][u(1585)](this),w)),!o[u(665)]("hi",h[u(1770)]))try{o.ZEQWB(os,this,h,[i0,r0,S0,C0,v0,s0])}catch(v){let D=ce(o[u(1802)],{message:v[u(1727)],code:Be[u(1734)+u(1582)],error:v});this["_dispatc"+u(1086)+u(1116)](D)}},this[n(388)]=h=>{let u=n,w=this[u(1607)+"tManager"]?.[u(1494)+u(693)+"es"](),C=this[u(1607)+u(876)]?.[u(1230)+u(1347)+"nt"]();if(w&&!h[u(1727)]){let v=u(454)+C+(u(870)+u(758)+"es reached");this["_dispatc"+u(1086)+"ent"](t[u(911)](ce,t.yNbUT,{message:v,code:Be[u(1409)+u(1669)+"R"],error:h}));return}this._ws&&this[u(1578)][u(501)+"te"]===this[u(535)]&&this["_disconn"+u(386)](),this[u(704)+u(1086)+u(1116)](t[u(1398)](ce,t[u(970)],{message:h[u(1727)],code:Be["NATIVE_E"+u(788)],error:h}))},this[n(1249)]=async h=>{let u=n;if(t.enZNM==="uNett")_0x2b1430=_0x370632[qUXkTW.noCGQ(qUXkTW[u(1077)](_0x5ab5f7,_0x3221fd),1)],_0xe25b41=_0x3df470[qUXkTW[u(812)](_0xb59a33+_0x3e7382,2)],_0x5c9420=_0x3e7242[qUXkTW[u(919)](qUXkTW[u(1077)](_0x5174fa,_0x3ba7c8),3)],qUXkTW[u(1203)](qUXkTW.IIwTv(qUXkTW[u(1154)](_0x50f432,qUXkTW.IgogH(_0x480a6d,8)),qUXkTW[u(1516)](_0x8053fa,16))&12632256,8421504)?_0x5de61a+=_0x4c0ca9:(_0x55a24c=qUXkTW[u(833)](qUXkTW[u(1154)](qUXkTW[u(1075)](7,_0x4f21d)<<18,qUXkTW[u(1516)](qUXkTW[u(898)](63,_0x14cb7e),12)),qUXkTW[u(1516)](qUXkTW[u(1642)](63,_0x40d040),6))|qUXkTW[u(493)](63,_0x496422),_0x2c72b9<65536||qUXkTW[u(486)](_0x5a2f15,1114111)?_0x1c95fb+=_0x1b75de:(_0x34c98f-=65536,_0x542116+=qUXkTW[u(1025)](_0x37dbf1,qUXkTW[u(1077)](qUXkTW[u(714)](_0x42d21d,10),55296),qUXkTW[u(999)](qUXkTW[u(898)](1023,_0x1752f4),56320)),_0x56e9ea+=3));else{this[u(540)+u(440)](),this["_clearPi"+u(669)](),this._removeWsListeners(),this[u(1578)]=null,this._connectLock=!1;let w=this[u(1607)+u(876)]?.[u(1494)+u(693)+"es"]();if(!w&&this[u(1461)+"orOnline"]()&&!this[u(487)+u(584)]){let C=this[u(1607)+u(876)]?.[u(1230)+u(1347)+"nt"](),v=this[u(463)][u(731)+u(1445)+"ptor"](h[u(1777)],h[u(991)]);this[u(704)+u(1887)+u(1116)](t.AOoei(he,t[u(488)],{code:1006,reason:h[u(991)]||u(1630)+u(1868)+u(596)+"wn reaso"+u(701)+u(1543)+C,willReconnect:v})),v&&this[u(1265)]();return}if(t[u(1658)](1e3,h[u(1777)])&&this[u(487)+u(584)]){this[u(704)+u(1887)+u(1116)](he(t[u(488)],{code:1e3,reason:t[u(902)]})),this[u(1607)+u(876)]?.[u(1569)+u(498)+u(1542)](),this._pingLossCounter?.[u(738)+u(1749)]();return}if(t.FqVBs(1e3,h[u(1777)])&&w)if(t[u(1096)](t[u(675)],t[u(675)])){let C=this[u(1607)+"tManager"]?.[u(1230)+u(1347)+"nt"](),v=h[u(991)];v||(v=await t[u(1525)](Zo,this[u(1558)])),v=u(1630)+u(1868)+u(1557)+v+(u(829)+u(880))+C+(", max re"+u(606)+u(514)),this["_dispatc"+u(1887)+"ent"](t[u(863)](he,t[u(488)],{code:h.code,reason:v}));let D=u(454)+C+(u(870)+u(758)+"es reached");this["_dispatc"+u(1086)+"ent"](t.akZds(ce,t[u(970)],{message:D,code:Be["MAX_RETR"+u(1669)+"R"]})),this[u(1607)+u(876)]?.[u(1569)+u(498)+u(1542)](),this[u(982)+"sCounter"]?.[u(738)+u(1749)]();return}else{let C=this[u(997)]["getStora"+u(695)+"nc"](this._prefix),v=_0x327235[u(1183)](qUXkTW.VBeQE(C,"{}"));return _0x3243ac[u(931)](v)}if(t[u(1391)](1e3,h.code)&&!h.reason){let C=this[u(1607)+"tManager"]?.[u(1230)+u(1347)+"nt"]();this["_dispatc"+u(1887)+"ent"](t[u(1196)](he,t.toPdC,{code:h[u(1777)],reason:u(1630)+u(1868)+u(596)+"wn reaso"+u(701)+"ame: "+C})),this._endpointManager?.[u(1569)+u(498)+u(1542)](),this[u(982)+u(621)]?.["resetCou"+u(1749)]();return}this[u(704)+"hCloseEv"+u(1116)](h),this[u(1607)+u(876)]?.[u(1569)+"pointCon"+u(1542)](),this[u(982)+"sCounter"]?.[u(738)+u(1749)]()}},this[n(1544)]=null,this[n(1869)]=null,this[n(1142)+"e"]=null,this[n(1051)]=null,this[n(1900)+n(1628)]=null,this.onReceiveAck=null,this["onStopIm"+n(1244)+"yReconnect"]=null,this[n(1644)+"nLine"]=this[n(1644)+n(1903)][n(1585)](this),this[n(1644)+n(883)]=this[n(1644)+"ffLine"][n(1585)](this),this[n(628)+n(1147)]=this[n(628)+n(1147)][n(1585)](this),this[n(628)+n(1144)]=this[n(628)+n(1144)][n(1585)](this),this._options={url:"",automaticOpen:!0,initReconnectInterval:1e3,maxReconnectInterval:1e4,reconnectIntervalGrowFactor:2,timeoutInterval:5e3,maxRetries:5,debug:!1,maxMessageQueueLength:t.ANxyE(1,0),service:0,logIDGenerator:c,headers:void 0,payloadEncoding:"",payloadType:"",fpID:"",deviceID:"",accessKey:"",ttwID:"",bddID:"",aID:"",disableAutoReconnect:!1,customParams:{},pingInterval:15e3,pingTimeoutInterval:4e3,pingFrequency:t[n(1285)],pingLossCount:2,enableTransformTextPayload:!1,logIDNewConfig:{enableAutoGenerateLogIDNew:!1,userIp:""},miniProgramParams:{customHttpHeader:{}},enableAutoAck:!1,reconnectInterceptor:()=>!0,enableQoS:!1,QoSLevel:2,messageStrategy:t[n(1645)],env:{xTTEnv:"",xUseEnv:""},listenNetworkChanged:!0};let{url:x,ws:l}=e,g=Array.isArray(x)?x:t[n(1433)](t.wKFLh,typeof x)?[x]:[];if(!g||t[n(417)](0,g.length))throw new Error(t[n(1564)]);if(!Jo(l))throw new Error(n(1897)+n(1703)+n(1913)+n(630)+"ket cons"+n(537)+"is undef"+n(1673));if(Object[n(1429)](this[n(463)],e),this["_endpoin"+n(876)]=new is(g,this._options[n(1411)+"es"]),this[n(982)+n(621)]=new Xo(this[n(463)][n(838)+"Count"]),this[n(463)][n(1097)+"cOpen"])if(t[n(1466)](n(937),t[n(1146)])){let h=this._qosDB[n(1646)+n(695)+"nc"](this[n(1551)]),u=_0x3b02af[n(1183)](t[n(727)](h,"{}"));return _0x4dd30a[n(649)](u)}else this._isInit=!0,this[n(1265)]();this[n(463)][n(1577)+"tworkCha"+n(766)]&&(this[n(1266)+"T"]||this[n(1073)+"X"]?this[n(1275)+n(1609)+n(526)]():this._isBrowser&&this[n(1675)+n(1846)+n(1780)]())}[r(1644)+r(1903)](){let e=r,n={fVpkE:function(o,x){return t.JBHdW(o,x)},HALVm:function(o,x){return o<<x},kqGbP:function(o,x){return t[S(1781)](o,x)},zKWIE:function(o,x){return t[S(866)](o,x)},ONgva:function(o,x){return t.LnGAI(o,x)},fZIwY:function(o,x){return t[S(928)](o,x)},nqVSY:function(o,x){return t[S(1267)](o,x)},vEsex:function(o,x){return t.ajpkv(o,x)},xoqCX:function(o,x,l){return t.mnZdZ(o,x,l)},fnebX:function(o,x){return o+x},CwEdt:function(o,x){return t.pQiAY(o,x)},tlXjV:function(o,x){return o>>>x},ArbKG:function(o,x){return o+x},AbFCA:function(o,x){return o!==x},TWWHh:function(o,x){return t[S(1009)](o,x)},MfqZW:function(o,x){return t[S(824)](o,x)},pZRrg:function(o,x){return t[S(499)](o,x)},JZUwU:function(o,x){return o+x},NNIFH:function(o,x){return t.jbpEw(o,x)},sngFA:function(o,x){return t[S(1047)](o,x)},PknMq:function(o,x){return o+x},mjdRt:function(o,x){return t[S(1199)](o,x)},eJRuO:function(o,x){return t[S(471)](o,x)},MTgVr:function(o,x){return t[S(774)](o,x)},kPmcQ:function(o,x){return o+x},SnVQt:function(o,x){return o&x},bsHiQ:function(o,x){return t[S(1606)](o,x)},cdbQi:function(o,x){return o>>>x},gNHLH:function(o,x){return t[S(760)](o,x)}};if(t[e(437)](t[e(1100)],t[e(1100)])){let o=afCcPL[e(578)](_0x175e3a.low,0),x=(afCcPL[e(578)](_0x138472[e(647)],28)|afCcPL[e(1801)](_0x2ccb79[e(561)],4))>>>0,l=afCcPL[e(930)](_0xfd72bd[e(561)],24),g=afCcPL[e(1723)](0,l)?afCcPL[e(1723)](0,x)?afCcPL[e(1800)](o,16384)?afCcPL[e(1611)](o,128)?1:2:o<2097152?3:4:x<16384?afCcPL[e(885)](x,128)?5:6:afCcPL.vEsex(x,2097152)?7:8:afCcPL.ONgva(l,128)?9:10,h=afCcPL[e(789)](_0x2706fa,_0x1d4dc1,g),u=_0x46de87[e(506)];switch(g){case 10:u[afCcPL[e(679)](h,9)]=afCcPL.CwEdt(afCcPL.tlXjV(l,7),1);case 9:u[afCcPL[e(607)](h,8)]=afCcPL.AbFCA(9,g)?afCcPL[e(1613)](128,l):afCcPL[e(1426)](127,l);case 8:u[h+7]=afCcPL.AbFCA(8,g)?afCcPL.TWWHh(x>>>21,128):afCcPL[e(1426)](x>>>21,127);case 7:u[h+6]=afCcPL.AbFCA(7,g)?afCcPL[e(1613)](afCcPL.MfqZW(x,14),128):afCcPL.pZRrg(x>>>14,127);case 6:u[afCcPL[e(1317)](h,5)]=afCcPL.NNIFH(6,g)?x>>>7|128:afCcPL.sngFA(x,7)&127;case 5:u[afCcPL[e(1150)](h,4)]=afCcPL[e(481)](5,g)?afCcPL[e(1470)](128,x):afCcPL.MTgVr(127,x);case 4:u[afCcPL[e(607)](h,3)]=afCcPL[e(1390)](4,g)?o>>>21|128:afCcPL[e(1426)](afCcPL[e(1849)](o,21),127);case 3:u[afCcPL[e(544)](h,2)]=afCcPL[e(1390)](3,g)?o>>>14|128:afCcPL[e(1535)](afCcPL.MfqZW(o,14),127);case 2:u[afCcPL[e(1150)](h,1)]=afCcPL.mjdRt(2,g)?afCcPL.TWWHh(afCcPL[e(1003)](o,7),128):afCcPL[e(1852)](afCcPL[e(1018)](o,7),127);case 1:u[h]=afCcPL[e(1920)](1,g)?128|o:afCcPL[e(1426)](127,o)}}else{if(this._options[e(985)+"utoRecon"+e(1790)]||this._readyClosed)return;this[e(1321)+e(1628)]()}}[r(1644)+r(883)](){let e=r;this["_destroy"+e(843)+"t"]();let n=Gn(e(731)+"t",{message:t[e(1162)]});this[e(418)+e(1244)+e(1342)+"ct"]&&this[e(418)+e(1244)+e(1342)+"ct"](n)}[r(1675)+"balEvent"+r(1780)](){let e=r;this._isBrowser&&window[e(810)+e(1780)](t[e(1125)],this[e(1644)+e(1903)]),this[e(1231)+"er"]&&window["addEvent"+e(1780)]("offline",this["_handleO"+e(883)]),this._isBrowser&&window[e(810)+e(1780)](t[e(1358)],this["_handleP"+e(1147)]),this[e(1231)+"er"]&&window[e(810)+e(1780)](e(797),this[e(628)+e(1144)])}[r(1459)+r(1846)+r(1780)](){let e=r;this._isBrowser&&window[e(1163)+e(1562)+"ner"](t[e(1125)],this._handleOnLine),this[e(1231)+"er"]&&window[e(1163)+e(1562)+e(1480)](t[e(1030)],this[e(1644)+e(883)]),this._isBrowser&&window["removeEv"+e(1562)+e(1480)](t[e(1358)],this[e(628)+e(1147)]),this[e(1231)+"er"]&&window[e(1163)+"entListe"+e(1480)](t.wemdl,this["_handleP"+e(1144)])}[r(628)+r(1147)](e){let n=r;if(t[n(433)](t[n(1026)],t[n(1026)]))return n(673)+"_"+this[n(624)];!e[n(1741)+"d"]&&(this[n(1231)+"er"]&&window[n(1163)+n(1562)+n(1480)](t.sXwdP,this[n(628)+n(1147)]),this._isBrowser&&window[n(1163)+n(1562)+n(1480)]("pageshow",this[n(628)+"ageShow"]),this[n(904)]()),this[n(1231)+"er"]&&window[n(1163)+n(1562)+n(1480)](t[n(1125)],this[n(1644)+n(1903)]),this[n(1231)+"er"]&&window[n(1163)+n(1562)+n(1480)](t.swArP,this["_handleO"+n(883)])}[r(628)+r(1144)](e){let n=r;e.persisted&&(this[n(1461)+n(516)]()&&(!this[n(1578)]||this[n(1578)][n(501)+"te"]!==this[n(535)]||t[n(1255)](this[n(1578)][n(501)+"te"],this.CONNECTING))&&this[n(1644)+n(1903)](),this[n(1231)+"er"]&&window[n(810)+"Listener"](t[n(1125)],this[n(1644)+"nLine"]),this[n(1231)+"er"]&&window[n(810)+n(1780)](t[n(1030)],this[n(1644)+n(883)]))}async[r(1794)+r(1552)](e){let n=r,{fpID:o,deviceID:x,bddID:l,ttwID:g,accessKey:h,aID:u,customParams:w={},enableAutoAck:C,enableQoS:v,QoSLevel:D,env:T}=this[n(463)],U,_e,qe;this[n(1231)+"er"]||this._isMiniWX||this[n(1266)+"T"]?(U=location&&t[n(1531)](t.tDhQV,location[n(1791)])?n(1784):"ws://",_e=e[n(1541)](/((^ws)|(^http))((?:[s]*:\/\/))/,""),qe=/^wss(.*:\/\/)/.test(e)?e:""+U+_e):(U=t[n(1246)],_e=e[n(1541)](/(^http)((?:[s]*:\/\/))/,""),qe=/(^ws)((?:[s]*:\/\/))/[n(1245)](_e)?_e:""+U+_e);let hs=l?"bd_did":g?t[n(1901)]:t[n(1917)],gs=l||g||x;if(!gs||!hs)throw new Error(t.bgAzY);let P0=t[n(1531)](n(507),typeof w)?await t[n(1004)](w):w,T0=T?t[n(545)](Yo,T[n(1089)],T[n(721)]):{},$n=Object[n(1429)]({device_platform:n(1187),version_code:n(1506)+"0",access_key:h,fpid:o,aid:u,[hs]:gs,xsack:C?1:0,xaack:C?1:0,xsqos:v?1:0,qos_level:v?D:void 0,qos_sdk_version:2,...T0},P0),I0=Object.keys($n)[n(653)]((er,tr)=>$n[tr]!==void 0?""+er+(er?"&":"?")+tr+"="+$n[tr]:er,"");return qe+n(1309)+I0}async _connect(){let e=r;if(!(this[e(1265)+e(1546)]||this[e(487)+e(584)])){this[e(1265)+e(1546)]=!0;try{let n=this[e(1607)+e(876)]?.[e(601)+"rentEndpointReac"+e(1858)+e(1078)](),{timeoutInterval:o}=this[e(463)];if(n){let l=this["_endpoin"+e(876)]?.getCurrentEndpoint(),g=this._endpointManager?.[e(1088)+"ackupEnd"+e(1186)+e(1643)+e(878)](),h=this[e(1607)+e(876)]?.[e(1230)+"ntEndpointTriesC"+e(459)]();if(g){let u="connect "+l+(e(1862)+e(1830)+e(606)+e(1783)+e(1898)+e(1910)+e(474))+g+" to retry",w=t[e(1597)](ce,t.yNbUT,{message:u,code:Be[e(1409)+"IES_ERROR"]});this[e(1702)](u),this[e(704)+e(1086)+e(1116)](w),this._url=await this._generateUrl(g),this[e(1702)](e(454)+g+" "+h+e(748)),this[e(1339)+e(1168)+"rs"]()}else{let u="connect "+l+(" timeout"+e(1830)+e(606)+e(514));this[e(1702)](u),this["_dispatc"+e(1086)+e(1116)](t[e(1149)](ce,e(1674),{message:u,code:Be[e(1409)+e(1669)+"R"]}));return}}else if(t[e(527)](t[e(803)],t[e(808)])){if(!this[e(1578)])return;this[e(1799)+"WebSocket"](_0x30c1f2,_0x43962d,_0x41707e)}else{let l=this[e(1607)+e(876)]?.[e(1230)+"ntEndpointAndUpd"+e(566)](),g=this[e(1607)+e(876)]?.[e(1230)+e(1347)+e(1485)+e(459)]();this[e(1558)]=await this[e(1794)+e(1552)](t[e(955)](l,"")),this[e(1702)]("connect "+l+" "+g+e(748)),this[e(1339)+e(1168)+"rs"]()}if(this._isInit)this[e(447)]=!1;else if(t.fXMjn(e(1399),t[e(1652)])){let l=t[e(676)](Gn,t[e(1257)],{message:t[e(1792)]});this[e(1900)+e(1628)]&&this["onStartR"+e(1628)](l)}else return new _0x3358c9(_0xc8e758,{code:_0x1fb6f8,reason:_0x213f0b,wasClean:_0x52b39c,willReconnect:_0x4e70a8});let x=this[e(1607)+e(876)]?.[e(1230)+e(1347)+"ntTriesC"+e(459)]()||0;t[e(1625)](x,1)&&await this._wait(t.QQZNo(x,1)),this[e(1702)]("connecti"+e(1268)+this[e(1558)]+(e(862)+"ls: ")+this[e(1269)+"ls"]),this[e(1578)]=t.ltYfd(Wo,{url:this[e(1558)],protocols:[this[e(1269)+"ls"]],headers:this[e(463)][e(1441)+e(1401)+"s"][e(913)+e(1044)]},this._options.ws),(this[e(1231)+"er"]||this[e(962)+"r"])&&this[e(1578)]&&(this[e(1578)][e(1303)+"pe"]=this[e(961)+e(966)]),this["_addWsLi"+e(425)](),this[e(1265)+"ionTimeoutId"]=setTimeout(this._onTimeout[e(1585)](this),o)}catch(n){throw this[e(1265)+e(1546)]=!1,n}}}["_clearTi"+r(440)](){let e=r,n={lDmCE:t[e(751)]};t[e(1300)](t[e(1270)],t[e(1697)])?(this[e(1085)+e(669)](),this.emit(e(457)+e(1423)+"s",tdVVYa[e(1588)]),this[e(1273)+"gTimeoutId"]=_0x48857b(this[e(1022)].bind(this),_0x35dc76)):(t[e(1299)](clearTimeout,this[e(1265)+e(1395)+e(1621)]),this[e(1265)+"ionTimeo"+e(1621)]=null)}[r(1085)+r(669)](){let e=r;if(t[e(1332)]!==e(524)){let n=t[e(1029)](_0x2fef5d,_0x5cf3a1,1);_0x3d8b60[e(506)][n]=_0x1813a6}else t[e(661)](clearTimeout,this[e(1273)+"gTimeoutId"]),t[e(1626)](clearTimeout,this[e(572)+"ctTimeou"+e(1874)]),this["_pingPon"+e(1894)+"Id"]=null,this["_reconnectTimeou"+e(1874)]=null}[r(1702)](...e){let n=r;this._options[n(691)]&&console[n(1918)].apply(console,[t[n(1046)],...e])}["_getInte"+r(864)+"e"](e){let n=r;if(t[n(1318)]!==t[n(489)]){let{initReconnectInterval:o,maxReconnectInterval:x,reconnectIntervalGrowFactor:l}=this[n(463)],g=t[n(1071)](o,Math.pow(l,e-1));return g>x?x:g}else{let o=_0x49d2ca.substring(0,t[n(508)](4,_0x5badc2[_0x59f8f2][n(1491)])),x=o[n(756)](_0x26f353[_0x48e66d]);_0x23b40e[n(1473)](x)}}[r(1022)](){let e=r;if(this[e(1578)]&&t[e(436)](this[e(1578)][e(501)+"te"],this[e(939)+"NG"])){this[e(1085)+"ngTimer"](),this._pingPongTimeoutId=t[e(1888)](setTimeout,this._ping[e(1585)](this),this._options[e(1278)+"rval"]);return}if(!this[e(1578)]||t[e(1148)](this._ws[e(501)+"te"],this.OPEN))return void this[e(1321)+e(1628)]();this[e(1578)]&&this[e(1578)][e(855)]("hi"),this["_reconne"+e(1822)+e(1874)]=setTimeout(this["_handleR"+e(1628)+e(591)][e(1585)](this),this._options["pingTime"+e(1503)+e(421)])}[r(1321)+"econnectTimeout"](){let e=r;this[e(982)+e(621)]?.[e(622)](),this[e(959)](t[e(778)],t[e(1714)]),this[e(982)+e(621)]?.[e(1494)+e(1736)+"nt"]()?this[e(1321)+e(1628)]():this._ping()}[r(1461)+r(516)](){let e=r;return this[e(1266)+"T"]||this[e(1073)+"X"]?this[e(1600)+"igatorOnline"]:(this[e(1231)+"er"]||this[e(962)+"r"])&&this[e(463)][e(1577)+e(1279)+"nged"]?navigator[e(1239)]:!0}_handleReconnect(){let e=r;if(t[e(1782)]!==t[e(1782)])this[e(624)]=_0x39e874,this[e(435)]=_0x35222c,this[e(997)]=_0x1e740d?_0x2f3fb4:_0x2886d4?_0x21bd9c:null;else{if(!this._navigatorOnline()||this[e(487)+e(584)])return;this["_endpoin"+e(876)]?.[e(1569)+e(498)+e(1542)](),this["_pingLos"+e(621)]?.[e(738)+e(1749)](),this[e(1578)]?this[e(1916)+e(386)](1001,"going aw"+e(1695)+e(731)+e(1201)+e(1176),!0):this._connect()}}[r(1275)+r(1609)+"ange"](){let e=r;t[e(1737)]!==t[e(1737)]?this[e(1860)+e(1633)]():this._isMiniTT?tt[e(497)+e(1773)+e(1602)](({isConnected:n})=>{let o=e;this["_miniNavigatorOn"+o(1579)]=n,n?this[o(1644)+"nLine"]():this[o(1644)+o(883)]()}):this[e(1073)+"X"]&&wx[e(497)+e(1773)+"hange"](({isConnected:n})=>{let o=e;this[o(1600)+o(779)+o(1579)]=n,n?this[o(1644)+o(1903)]():this[o(1644)+"ffLine"]()})}[r(385)](e){let n={TLsdJ:function(o,x,l){return o(x,l)}};return new Promise(o=>{let x=S;n.TLsdJ(setTimeout,o,this[x(925)+"rvalValue"](e))})}[r(1916)+r(386)](e=1e3,n="",o=!1){let x=r,l={Hnhij:function(g,h){return t[S(1031)](g,h)}};if(t[x(387)](x(631),t[x(1536)])){if(!this._ws)return;this[x(1799)+"WebSocket"](e,n,o)}else return function(...g){let h=x;return _0x1bd693.apply(NLxerz[h(1732)](_0x4c2d57,this),g),NLxerz[h(1732)](_0x2efe85,_0x36894d[h(656)](this))}}_onTimeout(){let e=r,n=this[e(1607)+e(876)]?.[e(1230)+e(1347)+"nt"]();this[e(1702)](e(454)+n+" timeout"),this["_disconn"+e(386)](1001,t[e(1282)],!0)}_sendAck(e){let n=r,o=Kn(e);this[n(1578)]&&t.fanqz(this[n(1578)][n(501)+"te"],this[n(535)])&&(this._ws&&this[n(1578)][n(855)](o),this[n(1702)]("send_ack",e))}["_removeW"+r(1168)+"rs"](){let e=r;this[e(1578)]&&(this[e(1578)][e(1163)+e(1562)+"ner"](t.RcDgA,this[e(1135)]),this[e(1578)][e(1163)+e(1562)+e(1480)](t.toPdC,this[e(1249)]),this[e(1578)][e(1163)+e(1562)+e(1480)](t[e(1123)],this[e(1141)+"ge"]),this._ws[e(1163)+"entListener"](e(1674),this[e(388)]))}[r(539)+"steners"](){let e=r,n=t[e(1263)][e(856)]("|"),o=0;for(;;){switch(n[o++]){case"0":this[e(1578)][e(810)+e(1780)]("close",this[e(1249)]);continue;case"1":if(!this[e(1578)])return;continue;case"2":this._ws[e(810)+e(1780)](e(1425),this._onOpen);continue;case"3":this[e(1578)][e(810)+e(1780)](e(1727),this[e(1141)+"ge"]);continue;case"4":this[e(1578)][e(810)+"Listener"](e(1674),this[e(388)]);continue}break}}["_wsInsta"+r(881)](e=1e3,n=""){let o=r;try{this[o(1578)]&&this[o(1578)][o(904)](e,n)}catch{}}["_destroy"+r(843)+"t"](e=1e3,n="",o=!1){let x=r,l={VAWpi:function(g,h){return t[S(560)](g,h)},vxIhI:t[x(1414)]};if(t.wJoHb(t.gcViu,t[x(1684)])){if(this[x(1085)+x(669)](),this[x(540)+x(440)](),this["_removeW"+x(1168)+"rs"](),this[x(646)+"nceClose"](1e3,n),this[x(1265)+x(1546)]=!1,o&&this[x(1461)+x(516)]()&&!this[x(487)+x(584)])if(t[x(1199)](t[x(1827)],t[x(1827)]))_0x4b8f93.log(_0x453d02);else{if(this[x(1607)+x(876)]?.["checkRea"+x(693)+"es"]()){let h=this[x(1607)+x(876)]?.[x(1230)+x(1347)+"nt"]();this[x(704)+x(1887)+x(1116)](t.WjYSK(he,t[x(488)],{code:1006,reason:x(454)+h+(x(1862)+x(1830)+x(606)+x(514)),wasClean:!0}))}else{let h=this._options[x(731)+"tInterce"+x(1615)](e,n);this[x(704)+x(1887)+"ent"](he(t[x(488)],{code:e,reason:n,wasClean:!0,willReconnect:h})),h&&this[x(1265)]()}return}this["_navigat"+x(516)]()||this[x(487)+x(584)]?this[x(704)+x(1887)+x(1116)](he(x(904),{code:e,reason:x(1118)})):this["_dispatc"+x(1887)+x(1116)](t[x(933)](he,x(904),{code:1006,reason:x(1215)+"ay, netw"+x(744)+x(476)})),this[x(1578)]=null,this[x(1607)+x(876)]?.[x(1569)+x(498)+x(1542)](),this[x(982)+x(621)]?.[x(738)+x(1749)]()}else _0x39d684[x(673)+x(920)]=void 0,CxTRMJ[x(666)](_0x10bf61,CxTRMJ[x(1045)])}[r(704)+"hOpenEvent"](e){let n=r;this[n(959)](n(1425),e),this[n(1051)]&&this[n(1051)](e)}[r(704)+r(1655)+r(528)](e){this[r(959)](t.bGHGC,e),this.onmessage&&this.onmessage(e)}[r(704)+r(1432)+"ageEvent"](e){let n=r;this[n(959)](t.NVazf,e),this[n(1336)+n(664)]&&this[n(1336)+n(664)](e)}[r(704)+r(1086)+"ent"](e){let n=r;this[n(959)](t[n(970)],e),this.onerror&&this.onerror(e)}[r(704)+r(1887)+r(1116)](e){let n=r;this[n(959)](n(904),e),this[n(1544)]&&this[n(1544)](e)}get[r(1303)+"pe"](){let e=r;return t[e(947)](e(1529),e(1430))?this._ws?this[e(1578)][e(1303)+"pe"]:this[e(961)+e(966)]:{bytes:_0x152996,offset:0,limit:_0x4f8787[e(1491)]}}set[r(1303)+"pe"](e){let n=r;this[n(961)+n(966)]=e,this[n(1578)]&&(this[n(1578)][n(1303)+"pe"]=e)}get[r(1796)+"nt"](){let e=r;return this[e(1607)+e(876)]?.["getCurre"+e(1347)+e(1485)+e(459)]()||0}get[r(1174)+r(1023)](){let e=r,n=this[e(587)+e(1589)][e(653)]((o,x)=>(o+=x&&x.byteLength||0,o),0);return t[e(1288)](n,this._ws?this[e(1578)][e(1174)+"Amount"]:0)}get[r(1455)+"ns"](){let e=r,n={RcBdV:function(o,x){return t[S(1292)](o,x)},fKDUM:e(1764)};if(t[e(837)](e(1636),t[e(1662)]))return this._ws?this._ws[e(1455)+"ns"]:"";this["_navigat"+e(516)]()&&(!this[e(1578)]||xIFsHM.RcBdV(this[e(1578)][e(501)+"te"],this[e(535)])||xIFsHM[e(1870)](this._ws[e(501)+"te"],this[e(939)+"NG"]))&&this["_handleO"+e(1903)](),this[e(1231)+"er"]&&_0x21ed8b[e(810)+e(1780)](e(1757),this[e(1644)+e(1903)]),this[e(1231)+"er"]&&_0x33e143[e(810)+"Listener"](xIFsHM[e(636)],this[e(1644)+e(883)])}get protocol(){let e=r,n={RPVhZ:t[e(488)],UXcGJ:t[e(970)]};if(t[e(643)](t[e(617)],e(1067)))return this._ws?this[e(1578)][e(1791)]:"";{let o=(e(1216)+"4")[e(856)]("|"),x=0;for(;;){switch(o[x++]){case"0":this[e(1578)]["addEvent"+e(1780)]("open",this[e(1135)]);continue;case"1":this._ws[e(810)+e(1780)](e(1727),this._onMessage);continue;case"2":this[e(1578)][e(810)+e(1780)](IrEugM[e(1526)],this[e(1249)]);continue;case"3":if(!this._ws)return;continue;case"4":this[e(1578)]["addEvent"+e(1780)](IrEugM[e(595)],this[e(388)]);continue}break}}}get[r(501)+"te"](){let e=r;return this[e(1578)]?this[e(1578)].readyState:this[e(463)][e(1097)+e(882)]?this[e(939)+"NG"]:this[e(1871)]}get[r(1360)](){let e=r;return this[e(1578)]?this[e(1578)][e(1360)]:this[e(1558)]}[r(904)](e=1e3,n){let o=r,x=t[o(943)][o(856)]("|"),l=0;for(;;){switch(x[l++]){case"0":this[o(1085)+"ngTimer"]();continue;case"1":if(!this[o(1578)])return void this._debug(o(1709)+"s instan"+o(958)+o(444)+"ed");continue;case"2":this[o(540)+o(440)]();continue;case"3":this[o(1799)+o(843)+"t"](e,n);continue;case"4":this["_readyCl"+o(584)]=!0;continue;case"5":this[o(741)+o(589)]?.closeDB();continue;case"6":this["_dropGlo"+o(1846)+o(1780)]();continue;case"7":if(this[o(1578)][o(501)+"te"]===this[o(1871)]||this[o(1578)][o(501)+"te"]===this[o(645)])return void this[o(1702)](o(1709)+o(1795)+o(1803));continue}break}}async[r(855)](e,n){let o=r;if(t.qDhFS(null,e))throw new Error(t[o(399)]);t.lqIZf(t[o(1084)],typeof e)&&(e=JSON[o(1530)+"y"](e)),t[o(1788)](t[o(680)],typeof e)&&!t[o(784)](e,ArrayBuffer)&&!(e.buffer&&e[o(1756)]instanceof ArrayBuffer)&&(e=JSON[o(1530)+"y"](e));let x=await t[o(605)](cs,e),l=t[o(442)](Vo,e),{method:g=0,service:h=this[o(463)].service,logID:u=this._options[o(932)+o(438)](),headers:w=this[o(463)][o(542)],payloadEncoding:C=this[o(463)][o(956)+o(905)],payloadType:v=this._options[o(1242)+o(966)],logIDNew:D=this[o(463)][o(510)+o(1437)]["enableAu"+o(1851)+o(960)+"ew"]?t[o(1555)](a,this[o(463)][o(510)+o(1437)][o(1005)]):""}=t[o(1048)](n,{});if(!h)throw new Error(t[o(1238)]);let T={SeqID:O.fromNumber(this[o(1247)]++),LogID:O[o(957)+"er"](u),service:h,method:g,headers:w,payloadEncoding:t[o(400)](C,Object)?C[o(1726)]?C.encoding:"":C,payloadType:t[o(1902)](v,Object)?v[o(1153)]?v[o(1153)]:l:v||l,payload:x,LogIDNew:D},U=Kn(T);return this[o(1578)]&&t[o(670)](this[o(1578)][o(501)+"te"],this[o(535)])?(this[o(1578)]&&this[o(1578)].send(U),this[o(1702)](t.SxJKj,T)):t.MkrlY(this[o(587)+o(1589)][o(1491)],this[o(463)][o(1110)+o(513)+o(1651)])?(this[o(587)+o(1589)][o(1473)](U),this[o(1702)](t[o(1547)],T)):(this[o(587)+o(1589)][o(1838)](),this["_message"+o(1589)][o(1473)](U)),{seqID:this[o(1247)],logID:u,logIDNew:D}}async reconnect(e){let n=r,{url:o}=t[n(1074)](e,{}),x=Array[n(1632)](o)?o:t.Vlibp(t[n(680)],typeof o)?[o]:[];e&&Object[n(1429)](this._options,e),x&&x[n(1491)]?this[n(1607)+n(876)]=new is(x,this._options.maxRetries):this[n(1607)+n(876)]?.[n(1569)+n(498)+n(1542)](),this[n(982)+"sCounter"]?.[n(738)+n(1749)](this._options[n(838)+n(698)]),this[n(487)+n(584)]=!1,this._ws&&this._ws[n(501)+"te"]!==this.CLOSED?this._disconnect(1e3,n(520)+"econnect"+n(1463),!0):(this[n(447)]=!0,this[n(1265)]())}async[r(588)](){let e=r;if(!this[e(1265)+e(1546)]){let n=(e(859)+"1")[e(856)]("|"),o=0;for(;;){switch(n[o++]){case"0":this[e(982)+e(621)]?.[e(738)+"nter"]();continue;case"1":this[e(1265)]();continue;case"2":this[e(487)+e(584)]=!1;continue;case"3":this[e(1607)+"tManager"]?.resetEndpointConfig();continue;case"4":this[e(447)]=!0;continue}break}}}[r(810)+"Listener"](e,n){this.on(e,n)}[r(1814)+r(528)](e){let n=r,{type:o}=e;this[n(959)](o,e)}[r(1163)+r(1562)+r(1480)](e,n){this[r(1664)](e,n)}[r(1308)](){let e=r,n={YBRsC:function(o,x){return t.uofhP(o,x)},ISXDs:function(o,x){return t[S(1102)](o,x)},DaKVP:function(o,x){return t.rhADF(o,x)},wIuqe:function(o,x){return t[S(1128)](o,x)},qMToW:function(o,x){return o!==x},sKarZ:t[e(860)],JXweT:e(1832),KXTDz:t.uJzxM,QCaYt:function(o,x){return o(x)},Zleqn:t[e(751)],NXade:function(o,x,l){return t[e(769)](o,x,l)}};return new Promise((o,x)=>{let l=e,g={cHFlC:function(w,C){return n[S(686)](w,C)},Ezxsv:n[l(1117)],kWHVf:l(457)+l(1423)+"s"};this["_clearPi"+l(669)](),this[l(1273)+l(1894)+"Id"]=n[l(1707)](setTimeout,this[l(1022)].bind(this),this[l(463)][l(1278)+l(1754)]);let h=()=>{let w=l;g[w(1393)](o,g[w(1919)]),this[w(1664)](g[w(897)],h),this[w(1664)](w(457)+"e_timeout",u)},u=()=>{let w=l,C={twrxl:function(v,D){return v>=D},hFoAQ:function(v,D){return v<D},jDLGl:function(v,D){return n[S(1359)](v,D)},mlaAC:function(v,D){return v-D},DNlZH:function(v,D){return v+D},VvMZL:function(v,D){return n[S(431)](v,D)},KuGsy:function(v,D){return n[S(654)](v,D)},YkbgU:function(v,D){return n[S(1362)](v,D)}};if(n[w(1637)](n[w(1400)],n[w(1400)])){let v=_0x42e3c8[w(1817)+"At"](_0x42826e);wJxQZo[w(1471)](v,55296)&&v<=56319&&wJxQZo[w(1397)](wJxQZo[w(1718)](_0x33c6ca,1),_0x4ce11a)&&(v=wJxQZo[w(1896)](wJxQZo.DNlZH(wJxQZo[w(700)](v,10),_0x3298e8.charCodeAt(++_0x5cdb21)),56613888)),_0x448e24+=wJxQZo[w(1842)](v,128)?1:wJxQZo.YkbgU(v,2048)?2:v<65536?3:4}else x(n[w(1388)]),this[w(1664)](n[w(886)],h),this[w(1664)](w(457)+w(1378)+"t",u)};this.on(n[l(886)],h),this.on(l(457)+"e_timeout",u),this[l(1022)]()})}}})(),V[E(1272)+E(452)]=J[E(1272)+E(452)],V.CustomErrorEvent=J[E(1098)+E(1576)],V[E(1392)+"e"]=J.ErrorCode,V.Event=J[E(528)],V.FWS=J[E(1877)],V[E(1016)+"MessageE"+E(1219)]=J[E(1016)+E(752)+E(1219)],V[E(752)+E(1219)]=J[E(752)+E(1219)],V[E(940)+"t"]=J[E(940)+"t"],V["Reconnec"+E(1112)]=J[E(1050)+E(1112)],V[E(412)+E(452)]=J.createCloseEvent,V[E(1127)+"rorEvent"]=J[E(1127)+"rorEvent"],V["createMe"+E(1277)+"nt"]=J[E(1670)+E(1277)+"nt"],V[E(1417)+"enEvent"]=J.createOpenEvent,V[E(1482)+E(1436)+"vent"]=J[E(1482)+E(1436)+"vent"],V.decodedFrame=J[E(1798)+E(1649)],V[E(1747)+"ame"]=J[E(1747)+"ame"];for(un in J)[E(1272)+E(452),E(1098)+"rorEvent",E(1392)+"e",E(528),E(1877),E(1016)+E(752)+E(1219),E(752)+E(1219),E(940)+"t",E(1050)+"tEvent",E(412)+E(452),"createEr"+E(1576),E(1670)+E(1277)+"nt",E(1417)+E(581),E(1482)+E(1436)+E(1219),"decodedF"+E(1649),E(1747)+E(1250)].indexOf(un)===-1&&(V[un]=J[un]);var un;Object[E(1334)+"operty"](V,"__esModule",{value:!0})});var Ie=se((Vd,ai)=>{"use strict";var ii=["nodebuffer","arraybuffer","fragments"],oi=typeof Blob<"u";oi&&ii.push("blob");ai.exports={BINARY_TYPES:ii,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:oi,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var Dt=se((Yd,_n)=>{"use strict";var{EMPTY_BUFFER:lx}=Ie(),ur=Buffer[Symbol.species];function hx(r,t){if(r.length===0)return lx;if(r.length===1)return r[0];let i=Buffer.allocUnsafe(t),a=0;for(let c=0;c<r.length;c++){let f=r[c];i.set(f,a),a+=f.length}return a<t?new ur(i.buffer,i.byteOffset,a):i}function xi(r,t,i,a,c){for(let f=0;f<c;f++)i[a+f]=r[f]^t[f&3]}function ci(r,t){for(let i=0;i<r.length;i++)r[i]^=t[i&3]}function gx(r){return r.length===r.buffer.byteLength?r.buffer:r.buffer.slice(r.byteOffset,r.byteOffset+r.length)}function dr(r){if(dr.readOnly=!0,Buffer.isBuffer(r))return r;let t;return r instanceof ArrayBuffer?t=new ur(r):ArrayBuffer.isView(r)?t=new ur(r.buffer,r.byteOffset,r.byteLength):(t=Buffer.from(r),dr.readOnly=!1),t}_n.exports={concat:hx,mask:xi,toArrayBuffer:gx,toBuffer:dr,unmask:ci};if(!process.env.WS_NO_BUFFER_UTIL)try{let r=W("bufferutil");_n.exports.mask=function(t,i,a,c,f){f<48?xi(t,i,a,c,f):r.mask(t,i,a,c,f)},_n.exports.unmask=function(t,i){t.length<32?ci(t,i):r.unmask(t,i)}}catch{}});var di=se((Xd,ui)=>{"use strict";var fi=Symbol("kDone"),lr=Symbol("kRun"),hr=class{constructor(t){this[fi]=()=>{this.pending--,this[lr]()},this.concurrency=t||1/0,this.jobs=[],this.pending=0}add(t){this.jobs.push(t),this[lr]()}[lr](){if(this.pending!==this.concurrency&&this.jobs.length){let t=this.jobs.shift();this.pending++,t(this[fi])}}};ui.exports=hr});var lt=se((Zd,pi)=>{"use strict";var Pt=W("zlib"),li=Dt(),px=di(),{kStatusCode:hi}=Ie(),mx=Buffer[Symbol.species],_x=Buffer.from([0,0,255,255]),yn=Symbol("permessage-deflate"),Le=Symbol("total-length"),ut=Symbol("callback"),He=Symbol("buffers"),dt=Symbol("error"),wn,gr=class{constructor(t){if(this._options=t||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._maxPayload=this._options.maxPayload|0,this._isServer=!!this._options.isServer,this._deflate=null,this._inflate=null,this.params=null,!wn){let i=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;wn=new px(i)}}static get extensionName(){return"permessage-deflate"}offer(){let t={};return this._options.serverNoContextTakeover&&(t.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(t.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(t.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?t.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(t.client_max_window_bits=!0),t}accept(t){return t=this.normalizeParams(t),this.params=this._isServer?this.acceptAsServer(t):this.acceptAsClient(t),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let t=this._deflate[ut];this._deflate.close(),this._deflate=null,t&&t(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(t){let i=this._options,a=t.find(c=>!(i.serverNoContextTakeover===!1&&c.server_no_context_takeover||c.server_max_window_bits&&(i.serverMaxWindowBits===!1||typeof i.serverMaxWindowBits=="number"&&i.serverMaxWindowBits>c.server_max_window_bits)||typeof i.clientMaxWindowBits=="number"&&!c.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(t){let i=t[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(t){return t.forEach(i=>{Object.keys(i).forEach(a=>{let c=i[a];if(c.length>1)throw new Error(`Parameter "${a}" must have only a single value`);if(c=c[0],a==="client_max_window_bits"){if(c!==!0){let f=+c;if(!Number.isInteger(f)||f<8||f>15)throw new TypeError(`Invalid value for parameter "${a}": ${c}`);c=f}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${a}": ${c}`)}else if(a==="server_max_window_bits"){let f=+c;if(!Number.isInteger(f)||f<8||f>15)throw new TypeError(`Invalid value for parameter "${a}": ${c}`);c=f}else if(a==="client_no_context_takeover"||a==="server_no_context_takeover"){if(c!==!0)throw new TypeError(`Invalid value for parameter "${a}": ${c}`)}else throw new Error(`Unknown parameter "${a}"`);i[a]=c})}),t}decompress(t,i,a){wn.add(c=>{this._decompress(t,i,(f,d)=>{c(),a(f,d)})})}compress(t,i,a){wn.add(c=>{this._compress(t,i,(f,d)=>{c(),a(f,d)})})}_decompress(t,i,a){let c=this._isServer?"client":"server";if(!this._inflate){let f=`${c}_max_window_bits`,d=typeof this.params[f]!="number"?Pt.Z_DEFAULT_WINDOWBITS:this.params[f];this._inflate=Pt.createInflateRaw({...this._options.zlibInflateOptions,windowBits:d}),this._inflate[yn]=this,this._inflate[Le]=0,this._inflate[He]=[],this._inflate.on("error",bx),this._inflate.on("data",gi)}this._inflate[ut]=a,this._inflate.write(t),i&&this._inflate.write(_x),this._inflate.flush(()=>{let f=this._inflate[dt];if(f){this._inflate.close(),this._inflate=null,a(f);return}let d=li.concat(this._inflate[He],this._inflate[Le]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[Le]=0,this._inflate[He]=[],i&&this.params[`${c}_no_context_takeover`]&&this._inflate.reset()),a(null,d)})}_compress(t,i,a){let c=this._isServer?"server":"client";if(!this._deflate){let f=`${c}_max_window_bits`,d=typeof this.params[f]!="number"?Pt.Z_DEFAULT_WINDOWBITS:this.params[f];this._deflate=Pt.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:d}),this._deflate[Le]=0,this._deflate[He]=[],this._deflate.on("data",yx)}this._deflate[ut]=a,this._deflate.write(t),this._deflate.flush(Pt.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let f=li.concat(this._deflate[He],this._deflate[Le]);i&&(f=new mx(f.buffer,f.byteOffset,f.length-4)),this._deflate[ut]=null,this._deflate[Le]=0,this._deflate[He]=[],i&&this.params[`${c}_no_context_takeover`]&&this._deflate.reset(),a(null,f)})}};pi.exports=gr;function yx(r){this[He].push(r),this[Le]+=r.length}function gi(r){if(this[Le]+=r.length,this[yn]._maxPayload<1||this[Le]<=this[yn]._maxPayload){this[He].push(r);return}this[dt]=new RangeError("Max payload size exceeded"),this[dt].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[dt][hi]=1009,this.removeListener("data",gi),this.reset()}function bx(r){if(this[yn]._inflate=null,this[dt]){this[ut](this[dt]);return}r[hi]=1007,this[ut](r)}});var ht=se((Qd,bn)=>{"use strict";var{isUtf8:mi}=W("buffer"),{hasBlob:vx}=Ie(),Sx=[0,0,0,0,0,0,0,0,0,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 pr(r){let t=r.length,i=0;for(;i<t;)if((r[i]&128)===0)i++;else if((r[i]&224)===192){if(i+1===t||(r[i+1]&192)!==128||(r[i]&254)===192)return!1;i+=2}else if((r[i]&240)===224){if(i+2>=t||(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>=t||(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 Ex(r){return vx&&typeof r=="object"&&typeof r.arrayBuffer=="function"&&typeof r.type=="string"&&typeof r.stream=="function"&&(r[Symbol.toStringTag]==="Blob"||r[Symbol.toStringTag]==="File")}bn.exports={isBlob:Ex,isValidStatusCode:Cx,isValidUTF8:pr,tokenChars:Sx};if(mi)bn.exports.isValidUTF8=function(r){return r.length<24?pr(r):mi(r)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let r=W("utf-8-validate");bn.exports.isValidUTF8=function(t){return t.length<32?pr(t):r(t)}}catch{}});var br=se(($d,Ci)=>{"use strict";var{Writable:Ax}=W("stream"),_i=lt(),{BINARY_TYPES:kx,EMPTY_BUFFER:wi,kStatusCode:Dx,kWebSocket:Px}=Ie(),{concat:mr,toArrayBuffer:Tx,unmask:Ix}=Dt(),{isValidStatusCode:Lx,isValidUTF8:yi}=ht(),vn=Buffer[Symbol.species],ue=0,bi=1,vi=2,Si=3,_r=4,wr=5,Sn=6,yr=class extends Ax{constructor(t={}){super(),this._allowSynchronousEvents=t.allowSynchronousEvents!==void 0?t.allowSynchronousEvents:!0,this._binaryType=t.binaryType||kx[0],this._extensions=t.extensions||{},this._isServer=!!t.isServer,this._maxPayload=t.maxPayload|0,this._skipUTF8Validation=!!t.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=ue}_write(t,i,a){if(this._opcode===8&&this._state==ue)return a();this._bufferedBytes+=t.length,this._buffers.push(t),this.startLoop(a)}consume(t){if(this._bufferedBytes-=t,t===this._buffers[0].length)return this._buffers.shift();if(t<this._buffers[0].length){let a=this._buffers[0];return this._buffers[0]=new vn(a.buffer,a.byteOffset+t,a.length-t),new vn(a.buffer,a.byteOffset,t)}let i=Buffer.allocUnsafe(t);do{let a=this._buffers[0],c=i.length-t;t>=a.length?i.set(this._buffers.shift(),c):(i.set(new Uint8Array(a.buffer,a.byteOffset,t),c),this._buffers[0]=new vn(a.buffer,a.byteOffset+t,a.length-t)),t-=a.length}while(t>0);return i}startLoop(t){this._loop=!0;do switch(this._state){case ue:this.getInfo(t);break;case bi:this.getPayloadLength16(t);break;case vi:this.getPayloadLength64(t);break;case Si:this.getMask();break;case _r:this.getData(t);break;case wr:case Sn:this._loop=!1;return}while(this._loop);this._errored||t()}getInfo(t){if(this._bufferedBytes<2){this._loop=!1;return}let i=this.consume(2);if((i[0]&48)!==0){let c=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");t(c);return}let a=(i[0]&64)===64;if(a&&!this._extensions[_i.extensionName]){let c=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(c);return}if(this._fin=(i[0]&128)===128,this._opcode=i[0]&15,this._payloadLength=i[1]&127,this._opcode===0){if(a){let c=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(c);return}if(!this._fragmented){let c=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");t(c);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let c=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(c);return}this._compressed=a}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let c=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");t(c);return}if(a){let c=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(c);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let c=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");t(c);return}}else{let c=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(c);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(i[1]&128)===128,this._isServer){if(!this._masked){let c=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");t(c);return}}else if(this._masked){let c=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");t(c);return}this._payloadLength===126?this._state=bi:this._payloadLength===127?this._state=vi:this.haveLength(t)}getPayloadLength16(t){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(t)}getPayloadLength64(t){if(this._bufferedBytes<8){this._loop=!1;return}let i=this.consume(8),a=i.readUInt32BE(0);if(a>Math.pow(2,21)-1){let c=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");t(c);return}this._payloadLength=a*Math.pow(2,32)+i.readUInt32BE(4),this.haveLength(t)}haveLength(t){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let i=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");t(i);return}this._masked?this._state=Si:this._state=_r}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=_r}getData(t){let i=wi;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&&Ix(i,this._mask)}if(this._opcode>7){this.controlMessage(i,t);return}if(this._compressed){this._state=wr,this.decompress(i,t);return}i.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(i)),this.dataMessage(t)}decompress(t,i){this._extensions[_i.extensionName].decompress(t,this._fin,(c,f)=>{if(c)return i(c);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");i(d);return}this._fragments.push(f)}this.dataMessage(i),this._state===ue&&this.startLoop(i)})}dataMessage(t){if(!this._fin){this._state=ue;return}let i=this._messageLength,a=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let c;this._binaryType==="nodebuffer"?c=mr(a,i):this._binaryType==="arraybuffer"?c=Tx(mr(a,i)):this._binaryType==="blob"?c=new Blob(a):c=a,this._allowSynchronousEvents?(this.emit("message",c,!0),this._state=ue):(this._state=Sn,setImmediate(()=>{this.emit("message",c,!0),this._state=ue,this.startLoop(t)}))}else{let c=mr(a,i);if(!this._skipUTF8Validation&&!yi(c)){let f=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(f);return}this._state===wr||this._allowSynchronousEvents?(this.emit("message",c,!1),this._state=ue):(this._state=Sn,setImmediate(()=>{this.emit("message",c,!1),this._state=ue,this.startLoop(t)}))}}controlMessage(t,i){if(this._opcode===8){if(t.length===0)this._loop=!1,this.emit("conclude",1005,wi),this.end();else{let a=t.readUInt16BE(0);if(!Lx(a)){let f=this.createError(RangeError,`invalid status code ${a}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");i(f);return}let c=new vn(t.buffer,t.byteOffset+2,t.length-2);if(!this._skipUTF8Validation&&!yi(c)){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,c),this.end()}this._state=ue;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",t),this._state=ue):(this._state=Sn,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",t),this._state=ue,this.startLoop(i)}))}createError(t,i,a,c,f){this._loop=!1,this._errored=!0;let d=new t(a?`Invalid WebSocket frame: ${i}`:i);return Error.captureStackTrace(d,this.createError),d.code=f,d[Dx]=c,d}};Ci.exports=yr});var Cr=se((tl,ki)=>{"use strict";var{Duplex:el}=W("stream"),{randomFillSync:Nx}=W("crypto"),Ei=lt(),{EMPTY_BUFFER:Rx,kWebSocket:Ox,NOOP:Mx}=Ie(),{isBlob:gt,isValidStatusCode:Bx}=ht(),{mask:Ai,toBuffer:Xe}=Dt(),de=Symbol("kByteLength"),zx=Buffer.alloc(4),Cn=8*1024,Ze,pt=Cn,ge=0,qx=1,Fx=2,vr=class r{constructor(t,i,a){this._extensions=i||{},a&&(this._generateMask=a,this._maskBuffer=Buffer.alloc(4)),this._socket=t,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=ge,this.onerror=Mx,this[Ox]=void 0}static frame(t,i){let a,c=!1,f=2,d=!1;i.mask&&(a=i.maskBuffer||zx,i.generateMask?i.generateMask(a):(pt===Cn&&(Ze===void 0&&(Ze=Buffer.alloc(Cn)),Nx(Ze,0,Cn),pt=0),a[0]=Ze[pt++],a[1]=Ze[pt++],a[2]=Ze[pt++],a[3]=Ze[pt++]),d=(a[0]|a[1]|a[2]|a[3])===0,f=6);let p;typeof t=="string"?(!i.mask||d)&&i[de]!==void 0?p=i[de]:(t=Buffer.from(t),p=t.length):(p=t.length,c=i.mask&&i.readOnly&&!d);let m=p;p>=65536?(f+=8,m=127):p>125&&(f+=2,m=126);let _=Buffer.allocUnsafe(c?p+f:f);return _[0]=i.fin?i.opcode|128:i.opcode,i.rsv1&&(_[0]|=64),_[1]=m,m===126?_.writeUInt16BE(p,2):m===127&&(_[2]=_[3]=0,_.writeUIntBE(p,4,6)),i.mask?(_[1]|=128,_[f-4]=a[0],_[f-3]=a[1],_[f-2]=a[2],_[f-1]=a[3],d?[_,t]:c?(Ai(t,a,_,f,p),[_]):(Ai(t,a,t,0,p),[_,t])):[_,t]}close(t,i,a,c){let f;if(t===void 0)f=Rx;else{if(typeof t!="number"||!Bx(t))throw new TypeError("First argument must be a valid error code number");if(i===void 0||!i.length)f=Buffer.allocUnsafe(2),f.writeUInt16BE(t,0);else{let p=Buffer.byteLength(i);if(p>123)throw new RangeError("The message must not be greater than 123 bytes");f=Buffer.allocUnsafe(2+p),f.writeUInt16BE(t,0),typeof i=="string"?f.write(i,2):f.set(i,2)}}let d={[de]:f.length,fin:!0,generateMask:this._generateMask,mask:a,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==ge?this.enqueue([this.dispatch,f,!1,d,c]):this.sendFrame(r.frame(f,d),c)}ping(t,i,a){let c,f;if(typeof t=="string"?(c=Buffer.byteLength(t),f=!1):gt(t)?(c=t.size,f=!1):(t=Xe(t),c=t.length,f=Xe.readOnly),c>125)throw new RangeError("The data size must not be greater than 125 bytes");let d={[de]:c,fin:!0,generateMask:this._generateMask,mask:i,maskBuffer:this._maskBuffer,opcode:9,readOnly:f,rsv1:!1};gt(t)?this._state!==ge?this.enqueue([this.getBlobData,t,!1,d,a]):this.getBlobData(t,!1,d,a):this._state!==ge?this.enqueue([this.dispatch,t,!1,d,a]):this.sendFrame(r.frame(t,d),a)}pong(t,i,a){let c,f;if(typeof t=="string"?(c=Buffer.byteLength(t),f=!1):gt(t)?(c=t.size,f=!1):(t=Xe(t),c=t.length,f=Xe.readOnly),c>125)throw new RangeError("The data size must not be greater than 125 bytes");let d={[de]:c,fin:!0,generateMask:this._generateMask,mask:i,maskBuffer:this._maskBuffer,opcode:10,readOnly:f,rsv1:!1};gt(t)?this._state!==ge?this.enqueue([this.getBlobData,t,!1,d,a]):this.getBlobData(t,!1,d,a):this._state!==ge?this.enqueue([this.dispatch,t,!1,d,a]):this.sendFrame(r.frame(t,d),a)}send(t,i,a){let c=this._extensions[Ei.extensionName],f=i.binary?2:1,d=i.compress,p,m;typeof t=="string"?(p=Buffer.byteLength(t),m=!1):gt(t)?(p=t.size,m=!1):(t=Xe(t),p=t.length,m=Xe.readOnly),this._firstFragment?(this._firstFragment=!1,d&&c&&c.params[c._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(d=p>=c._threshold),this._compress=d):(d=!1,f=0),i.fin&&(this._firstFragment=!0);let _={[de]:p,fin:i.fin,generateMask:this._generateMask,mask:i.mask,maskBuffer:this._maskBuffer,opcode:f,readOnly:m,rsv1:d};gt(t)?this._state!==ge?this.enqueue([this.getBlobData,t,this._compress,_,a]):this.getBlobData(t,this._compress,_,a):this._state!==ge?this.enqueue([this.dispatch,t,this._compress,_,a]):this.dispatch(t,this._compress,_,a)}getBlobData(t,i,a,c){this._bufferedBytes+=a[de],this._state=Fx,t.arrayBuffer().then(f=>{if(this._socket.destroyed){let p=new Error("The socket was closed while the blob was being read");process.nextTick(Sr,this,p,c);return}this._bufferedBytes-=a[de];let d=Xe(f);i?this.dispatch(d,i,a,c):(this._state=ge,this.sendFrame(r.frame(d,a),c),this.dequeue())}).catch(f=>{process.nextTick(Ux,this,f,c)})}dispatch(t,i,a,c){if(!i){this.sendFrame(r.frame(t,a),c);return}let f=this._extensions[Ei.extensionName];this._bufferedBytes+=a[de],this._state=qx,f.compress(t,a.fin,(d,p)=>{if(this._socket.destroyed){let m=new Error("The socket was closed while data was being compressed");Sr(this,m,c);return}this._bufferedBytes-=a[de],this._state=ge,a.readOnly=!1,this.sendFrame(r.frame(p,a),c),this.dequeue()})}dequeue(){for(;this._state===ge&&this._queue.length;){let t=this._queue.shift();this._bufferedBytes-=t[3][de],Reflect.apply(t[0],this,t.slice(1))}}enqueue(t){this._bufferedBytes+=t[3][de],this._queue.push(t)}sendFrame(t,i){t.length===2?(this._socket.cork(),this._socket.write(t[0]),this._socket.write(t[1],i),this._socket.uncork()):this._socket.write(t[0],i)}};ki.exports=vr;function Sr(r,t,i){typeof i=="function"&&i(t);for(let a=0;a<r._queue.length;a++){let c=r._queue[a],f=c[c.length-1];typeof f=="function"&&f(t)}}function Ux(r,t,i){Sr(r,t,i),r.onerror(t)}});var Mi=se((nl,Oi)=>{"use strict";var{kForOnEventAttribute:Tt,kListener:Er}=Ie(),Di=Symbol("kCode"),Pi=Symbol("kData"),Ti=Symbol("kError"),Ii=Symbol("kMessage"),Li=Symbol("kReason"),mt=Symbol("kTarget"),Ni=Symbol("kType"),Ri=Symbol("kWasClean"),Ne=class{constructor(t){this[mt]=null,this[Ni]=t}get target(){return this[mt]}get type(){return this[Ni]}};Object.defineProperty(Ne.prototype,"target",{enumerable:!0});Object.defineProperty(Ne.prototype,"type",{enumerable:!0});var Qe=class extends Ne{constructor(t,i={}){super(t),this[Di]=i.code===void 0?0:i.code,this[Li]=i.reason===void 0?"":i.reason,this[Ri]=i.wasClean===void 0?!1:i.wasClean}get code(){return this[Di]}get reason(){return this[Li]}get wasClean(){return this[Ri]}};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(t,i={}){super(t),this[Ti]=i.error===void 0?null:i.error,this[Ii]=i.message===void 0?"":i.message}get error(){return this[Ti]}get message(){return this[Ii]}};Object.defineProperty(_t.prototype,"error",{enumerable:!0});Object.defineProperty(_t.prototype,"message",{enumerable:!0});var It=class extends Ne{constructor(t,i={}){super(t),this[Pi]=i.data===void 0?null:i.data}get data(){return this[Pi]}};Object.defineProperty(It.prototype,"data",{enumerable:!0});var Hx={addEventListener(r,t,i={}){for(let c of this.listeners(r))if(!i[Tt]&&c[Er]===t&&!c[Tt])return;let a;if(r==="message")a=function(f,d){let p=new It("message",{data:d?f:f.toString()});p[mt]=this,En(t,this,p)};else if(r==="close")a=function(f,d){let p=new Qe("close",{code:f,reason:d.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});p[mt]=this,En(t,this,p)};else if(r==="error")a=function(f){let d=new _t("error",{error:f,message:f.message});d[mt]=this,En(t,this,d)};else if(r==="open")a=function(){let f=new Ne("open");f[mt]=this,En(t,this,f)};else return;a[Tt]=!!i[Tt],a[Er]=t,i.once?this.once(r,a):this.on(r,a)},removeEventListener(r,t){for(let i of this.listeners(r))if(i[Er]===t&&!i[Tt]){this.removeListener(r,i);break}}};Oi.exports={CloseEvent:Qe,ErrorEvent:_t,Event:Ne,EventTarget:Hx,MessageEvent:It};function En(r,t,i){typeof r=="object"&&r.handleEvent?r.handleEvent.call(r,i):r.call(t,i)}});var An=se((rl,Bi)=>{"use strict";var{tokenChars:Lt}=ht();function ve(r,t,i){r[t]===void 0?r[t]=[i]:r[t].push(i)}function jx(r){let t=Object.create(null),i=Object.create(null),a=!1,c=!1,f=!1,d,p,m=-1,_=-1,b=-1,y=0;for(;y<r.length;y++)if(_=r.charCodeAt(y),d===void 0)if(b===-1&&Lt[_]===1)m===-1&&(m=y);else if(y!==0&&(_===32||_===9))b===-1&&m!==-1&&(b=y);else if(_===59||_===44){if(m===-1)throw new SyntaxError(`Unexpected character at index ${y}`);b===-1&&(b=y);let I=r.slice(m,b);_===44?(ve(t,I,i),i=Object.create(null)):d=I,m=b=-1}else throw new SyntaxError(`Unexpected character at index ${y}`);else if(p===void 0)if(b===-1&&Lt[_]===1)m===-1&&(m=y);else if(_===32||_===9)b===-1&&m!==-1&&(b=y);else if(_===59||_===44){if(m===-1)throw new SyntaxError(`Unexpected character at index ${y}`);b===-1&&(b=y),ve(i,r.slice(m,b),!0),_===44&&(ve(t,d,i),i=Object.create(null),d=void 0),m=b=-1}else if(_===61&&m!==-1&&b===-1)p=r.slice(m,y),m=b=-1;else throw new SyntaxError(`Unexpected character at index ${y}`);else if(c){if(Lt[_]!==1)throw new SyntaxError(`Unexpected character at index ${y}`);m===-1?m=y:a||(a=!0),c=!1}else if(f)if(Lt[_]===1)m===-1&&(m=y);else if(_===34&&m!==-1)f=!1,b=y;else if(_===92)c=!0;else throw new SyntaxError(`Unexpected character at index ${y}`);else if(_===34&&r.charCodeAt(y-1)===61)f=!0;else if(b===-1&&Lt[_]===1)m===-1&&(m=y);else if(m!==-1&&(_===32||_===9))b===-1&&(b=y);else if(_===59||_===44){if(m===-1)throw new SyntaxError(`Unexpected character at index ${y}`);b===-1&&(b=y);let I=r.slice(m,b);a&&(I=I.replace(/\\/g,""),a=!1),ve(i,p,I),_===44&&(ve(t,d,i),i=Object.create(null),d=void 0),p=void 0,m=b=-1}else throw new SyntaxError(`Unexpected character at index ${y}`);if(m===-1||f||_===32||_===9)throw new SyntaxError("Unexpected end of input");b===-1&&(b=y);let k=r.slice(m,b);return d===void 0?ve(t,k,i):(p===void 0?ve(i,k,!0):a?ve(i,p,k.replace(/\\/g,"")):ve(i,p,k),ve(t,d,i)),t}function Kx(r){return Object.keys(r).map(t=>{let i=r[t];return Array.isArray(i)||(i=[i]),i.map(a=>[t].concat(Object.keys(a).map(c=>{let f=a[c];return Array.isArray(f)||(f=[f]),f.map(d=>d===!0?c:`${c}=${d}`).join("; ")})).join("; ")).join(", ")}).join(", ")}Bi.exports={format:Kx,parse:jx}});var Tn=se((ol,Yi)=>{"use strict";var Gx=W("events"),Wx=W("https"),Jx=W("http"),Fi=W("net"),Vx=W("tls"),{randomBytes:Yx,createHash:Xx}=W("crypto"),{Duplex:sl,Readable:il}=W("stream"),{URL:Ar}=W("url"),je=lt(),Zx=br(),Qx=Cr(),{isBlob:$x}=ht(),{BINARY_TYPES:zi,CLOSE_TIMEOUT:ec,EMPTY_BUFFER:kn,GUID:tc,kForOnEventAttribute:kr,kListener:nc,kStatusCode:rc,kWebSocket:Z,NOOP:Ui}=Ie(),{EventTarget:{addEventListener:sc,removeEventListener:ic}}=Mi(),{format:oc,parse:ac}=An(),{toBuffer:xc}=Dt(),Hi=Symbol("kAborted"),Dr=[8,13],Re=["CONNECTING","OPEN","CLOSING","CLOSED"],cc=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,z=class r extends Gx{constructor(t,i,a){super(),this._binaryType=zi[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=kn,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,t!==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,t,i,a)):(this._autoPong=a.autoPong,this._closeTimeout=a.closeTimeout,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(t){zi.includes(t)&&(this._binaryType=t,this._receiver&&(this._receiver._binaryType=t))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(t,i,a){let c=new Zx({allowSynchronousEvents:a.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:a.maxPayload,skipUTF8Validation:a.skipUTF8Validation}),f=new Qx(t,this._extensions,a.generateMask);this._receiver=c,this._sender=f,this._socket=t,c[Z]=this,f[Z]=this,t[Z]=this,c.on("conclude",dc),c.on("drain",lc),c.on("error",hc),c.on("message",gc),c.on("ping",pc),c.on("pong",mc),f.onerror=_c,t.setTimeout&&t.setTimeout(0),t.setNoDelay&&t.setNoDelay(),i.length>0&&t.unshift(i),t.on("close",Wi),t.on("data",Pn),t.on("end",Ji),t.on("error",Vi),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(t,i){if(this.readyState!==r.CLOSED){if(this.readyState===r.CONNECTING){xe(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(t,i,!this._isServer,a=>{a||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),Gi(this)}}pause(){this.readyState===r.CONNECTING||this.readyState===r.CLOSED||(this._paused=!0,this._socket.pause())}ping(t,i,a){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(a=t,t=i=void 0):typeof i=="function"&&(a=i,i=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==r.OPEN){Pr(this,t,a);return}i===void 0&&(i=!this._isServer),this._sender.ping(t||kn,i,a)}pong(t,i,a){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(a=t,t=i=void 0):typeof i=="function"&&(a=i,i=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==r.OPEN){Pr(this,t,a);return}i===void 0&&(i=!this._isServer),this._sender.pong(t||kn,i,a)}resume(){this.readyState===r.CONNECTING||this.readyState===r.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(t,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 t=="number"&&(t=t.toString()),this.readyState!==r.OPEN){Pr(this,t,a);return}let c={binary:typeof t!="string",mask:!this._isServer,compress:!0,fin:!0,...i};this._extensions[je.extensionName]||(c.compress=!1),this._sender.send(t||kn,c,a)}terminate(){if(this.readyState!==r.CLOSED){if(this.readyState===r.CONNECTING){xe(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 t of this.listeners(r))if(t[kr])return t[nc];return null},set(t){for(let i of this.listeners(r))if(i[kr]){this.removeListener(r,i);break}typeof t=="function"&&this.addEventListener(r,t,{[kr]:!0})}})});z.prototype.addEventListener=sc;z.prototype.removeEventListener=ic;Yi.exports=z;function ji(r,t,i,a){let c={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:ec,protocolVersion:Dr[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=c.autoPong,r._closeTimeout=c.closeTimeout,!Dr.includes(c.protocolVersion))throw new RangeError(`Unsupported protocol version: ${c.protocolVersion} (supported versions: ${Dr.join(", ")})`);let f;if(t instanceof Ar)f=t;else try{f=new Ar(t)}catch{throw new SyntaxError(`Invalid URL: ${t}`)}f.protocol==="http:"?f.protocol="ws:":f.protocol==="https:"&&(f.protocol="wss:"),r._url=f.href;let d=f.protocol==="wss:",p=f.protocol==="ws+unix:",m;if(f.protocol!=="ws:"&&!d&&!p?m=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:p&&!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;Dn(r,R);return}let _=d?443:80,b=Yx(16).toString("base64"),y=d?Wx.request:Jx.request,k=new Set,I;if(c.createConnection=c.createConnection||(d?uc:fc),c.defaultPort=c.defaultPort||_,c.port=f.port||_,c.host=f.hostname.startsWith("[")?f.hostname.slice(1,-1):f.hostname,c.headers={...c.headers,"Sec-WebSocket-Version":c.protocolVersion,"Sec-WebSocket-Key":b,Connection:"Upgrade",Upgrade:"websocket"},c.path=f.pathname+f.search,c.timeout=c.handshakeTimeout,c.perMessageDeflate&&(I=new je({...c.perMessageDeflate,isServer:!1,maxPayload:c.maxPayload}),c.headers["Sec-WebSocket-Extensions"]=oc({[je.extensionName]:I.offer()})),i.length){for(let R of i){if(typeof R!="string"||!cc.test(R)||k.has(R))throw new SyntaxError("An invalid or duplicated subprotocol was specified");k.add(R)}c.headers["Sec-WebSocket-Protocol"]=i.join(",")}if(c.origin&&(c.protocolVersion<13?c.headers["Sec-WebSocket-Origin"]=c.origin:c.headers.Origin=c.origin),(f.username||f.password)&&(c.auth=`${f.username}:${f.password}`),p){let R=c.path.split(":");c.socketPath=R[0],c.path=R[1]}let L;if(c.followRedirects){if(r._redirects===0){r._originalIpc=p,r._originalSecure=d,r._originalHostOrSocketPath=p?c.socketPath:f.host;let R=a&&a.headers;if(a={...a,headers:{}},R)for(let[K,re]of Object.entries(R))a.headers[K.toLowerCase()]=re}else if(r.listenerCount("redirect")===0){let R=p?r._originalIpc?c.socketPath===r._originalHostOrSocketPath:!1:r._originalIpc?!1:f.host===r._originalHostOrSocketPath;(!R||r._originalSecure&&!d)&&(delete c.headers.authorization,delete c.headers.cookie,R||delete c.headers.host,c.auth=void 0)}c.auth&&!a.headers.authorization&&(a.headers.authorization="Basic "+Buffer.from(c.auth).toString("base64")),L=r._req=y(c),r._redirects&&r.emit("redirect",r.url,L)}else L=r._req=y(c);c.timeout&&L.on("timeout",()=>{xe(r,L,"Opening handshake has timed out")}),L.on("error",R=>{L===null||L[Hi]||(L=r._req=null,Dn(r,R))}),L.on("response",R=>{let K=R.headers.location,re=R.statusCode;if(K&&c.followRedirects&&re>=300&&re<400){if(++r._redirects>c.maxRedirects){xe(r,L,"Maximum redirects exceeded");return}L.abort();let oe;try{oe=new Ar(K,t)}catch{let M=new SyntaxError(`Invalid URL: ${K}`);Dn(r,M);return}ji(r,oe,i,a)}else r.emit("unexpected-response",L,R)||xe(r,L,`Unexpected server response: ${R.statusCode}`)}),L.on("upgrade",(R,K,re)=>{if(r.emit("upgrade",R),r.readyState!==z.CONNECTING)return;L=r._req=null;let oe=R.headers.upgrade;if(oe===void 0||oe.toLowerCase()!=="websocket"){xe(r,K,"Invalid Upgrade header");return}let P=Xx("sha1").update(b+tc).digest("base64");if(R.headers["sec-websocket-accept"]!==P){xe(r,K,"Invalid Sec-WebSocket-Accept header");return}let M=R.headers["sec-websocket-protocol"],G;if(M!==void 0?k.size?k.has(M)||(G="Server sent an invalid subprotocol"):G="Server sent a subprotocol but none was requested":k.size&&(G="Server sent no subprotocol"),G){xe(r,K,G);return}M&&(r._protocol=M);let Se=R.headers["sec-websocket-extensions"];if(Se!==void 0){if(!I){xe(r,K,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let Oe;try{Oe=ac(Se)}catch{xe(r,K,"Invalid Sec-WebSocket-Extensions header");return}let pe=Object.keys(Oe);if(pe.length!==1||pe[0]!==je.extensionName){xe(r,K,"Server indicated an extension that was not requested");return}try{I.accept(Oe[je.extensionName])}catch{xe(r,K,"Invalid Sec-WebSocket-Extensions header");return}r._extensions[je.extensionName]=I}r.setSocket(K,re,{allowSynchronousEvents:c.allowSynchronousEvents,generateMask:c.generateMask,maxPayload:c.maxPayload,skipUTF8Validation:c.skipUTF8Validation})}),c.finishRequest?c.finishRequest(L,r):L.end()}function Dn(r,t){r._readyState=z.CLOSING,r._errorEmitted=!0,r.emit("error",t),r.emitClose()}function fc(r){return r.path=r.socketPath,Fi.connect(r)}function uc(r){return r.path=void 0,!r.servername&&r.servername!==""&&(r.servername=Fi.isIP(r.host)?"":r.host),Vx.connect(r)}function xe(r,t,i){r._readyState=z.CLOSING;let a=new Error(i);Error.captureStackTrace(a,xe),t.setHeader?(t[Hi]=!0,t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),process.nextTick(Dn,r,a)):(t.destroy(a),t.once("error",r.emit.bind(r,"error")),t.once("close",r.emitClose.bind(r)))}function Pr(r,t,i){if(t){let a=$x(t)?t.size:xc(t).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 dc(r,t){let i=this[Z];i._closeFrameReceived=!0,i._closeMessage=t,i._closeCode=r,i._socket[Z]!==void 0&&(i._socket.removeListener("data",Pn),process.nextTick(Ki,i._socket),r===1005?i.close():i.close(r,t))}function lc(){let r=this[Z];r.isPaused||r._socket.resume()}function hc(r){let t=this[Z];t._socket[Z]!==void 0&&(t._socket.removeListener("data",Pn),process.nextTick(Ki,t._socket),t.close(r[rc])),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",r))}function qi(){this[Z].emitClose()}function gc(r,t){this[Z].emit("message",r,t)}function pc(r){let t=this[Z];t._autoPong&&t.pong(r,!this._isServer,Ui),t.emit("ping",r)}function mc(r){this[Z].emit("pong",r)}function Ki(r){r.resume()}function _c(r){let t=this[Z];t.readyState!==z.CLOSED&&(t.readyState===z.OPEN&&(t._readyState=z.CLOSING,Gi(t)),this._socket.end(),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",r)))}function Gi(r){r._closeTimer=setTimeout(r._socket.destroy.bind(r._socket),r._closeTimeout)}function Wi(){let r=this[Z];if(this.removeListener("close",Wi),this.removeListener("data",Pn),this.removeListener("end",Ji),r._readyState=z.CLOSING,!this._readableState.endEmitted&&!r._closeFrameReceived&&!r._receiver._writableState.errorEmitted&&this._readableState.length!==0){let t=this.read(this._readableState.length);r._receiver.write(t)}r._receiver.end(),this[Z]=void 0,clearTimeout(r._closeTimer),r._receiver._writableState.finished||r._receiver._writableState.errorEmitted?r.emitClose():(r._receiver.on("error",qi),r._receiver.on("finish",qi))}function Pn(r){this[Z]._receiver.write(r)||this.pause()}function Ji(){let r=this[Z];r._readyState=z.CLOSING,r._receiver.end(),this.end()}function Vi(){let r=this[Z];this.removeListener("error",Vi),this.on("error",Ui),r&&(r._readyState=z.CLOSING,this.destroy())}});var $i=se((xl,Qi)=>{"use strict";var al=Tn(),{Duplex:wc}=W("stream");function Xi(r){r.emit("close")}function yc(){!this.destroyed&&this._writableState.finished&&this.destroy()}function Zi(r){this.removeListener("error",Zi),this.destroy(),this.listenerCount("error")===0&&this.emit("error",r)}function bc(r,t){let i=!0,a=new wc({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return r.on("message",function(f,d){let p=!d&&a._readableState.objectMode?f.toString():f;a.push(p)||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(c,f){if(r.readyState===r.CLOSED){f(c),process.nextTick(Xi,a);return}let d=!1;r.once("error",function(m){d=!0,f(m)}),r.once("close",function(){d||f(c),process.nextTick(Xi,a)}),i&&r.terminate()},a._final=function(c){if(r.readyState===r.CONNECTING){r.once("open",function(){a._final(c)});return}r._socket!==null&&(r._socket._writableState.finished?(c(),a._readableState.endEmitted&&a.destroy()):(r._socket.once("finish",function(){c()}),r.close()))},a._read=function(){r.isPaused&&r.resume()},a._write=function(c,f,d){if(r.readyState===r.CONNECTING){r.once("open",function(){a._write(c,f,d)});return}r.send(c,d)},a.on("end",yc),a.on("error",Zi),a}Qi.exports=bc});var Tr=se((cl,eo)=>{"use strict";var{tokenChars:vc}=ht();function Sc(r){let t=new Set,i=-1,a=-1,c=0;for(c;c<r.length;c++){let d=r.charCodeAt(c);if(a===-1&&vc[d]===1)i===-1&&(i=c);else if(c!==0&&(d===32||d===9))a===-1&&i!==-1&&(a=c);else if(d===44){if(i===-1)throw new SyntaxError(`Unexpected character at index ${c}`);a===-1&&(a=c);let p=r.slice(i,a);if(t.has(p))throw new SyntaxError(`The "${p}" subprotocol is duplicated`);t.add(p),i=a=-1}else throw new SyntaxError(`Unexpected character at index ${c}`)}if(i===-1||a!==-1)throw new SyntaxError("Unexpected end of input");let f=r.slice(i,c);if(t.has(f))throw new SyntaxError(`The "${f}" subprotocol is duplicated`);return t.add(f),t}eo.exports={parse:Sc}});var ao=se((ul,oo)=>{"use strict";var Cc=W("events"),In=W("http"),{Duplex:fl}=W("stream"),{createHash:Ec}=W("crypto"),to=An(),$e=lt(),Ac=Tr(),kc=Tn(),{CLOSE_TIMEOUT:Dc,GUID:Pc,kWebSocket:Tc}=Ie(),Ic=/^[+/0-9A-Za-z]{22}==$/,no=0,ro=1,io=2,Ir=class extends Cc{constructor(t,i){if(super(),t={allowSynchronousEvents:!0,autoPong:!0,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:Dc,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:kc,...t},t.port==null&&!t.server&&!t.noServer||t.port!=null&&(t.server||t.noServer)||t.server&&t.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(t.port!=null?(this._server=In.createServer((a,c)=>{let f=In.STATUS_CODES[426];c.writeHead(426,{"Content-Length":f.length,"Content-Type":"text/plain"}),c.end(f)}),this._server.listen(t.port,t.host,t.backlog,i)):t.server&&(this._server=t.server),this._server){let a=this.emit.bind(this,"connection");this._removeListeners=Lc(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(c,f,d)=>{this.handleUpgrade(c,f,d,a)}})}t.perMessageDeflate===!0&&(t.perMessageDeflate={}),t.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=t,this._state=no}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(t){if(this._state===io){t&&this.once("close",()=>{t(new Error("The server is not running"))}),process.nextTick(Nt,this);return}if(t&&this.once("close",t),this._state!==ro)if(this._state=ro,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(Nt,this):process.nextTick(Nt,this);else{let i=this._server;this._removeListeners(),this._removeListeners=this._server=null,i.close(()=>{Nt(this)})}}shouldHandle(t){if(this.options.path){let i=t.url.indexOf("?");if((i!==-1?t.url.slice(0,i):t.url)!==this.options.path)return!1}return!0}handleUpgrade(t,i,a,c){i.on("error",so);let f=t.headers["sec-websocket-key"],d=t.headers.upgrade,p=+t.headers["sec-websocket-version"];if(t.method!=="GET"){et(this,t,i,405,"Invalid HTTP method");return}if(d===void 0||d.toLowerCase()!=="websocket"){et(this,t,i,400,"Invalid Upgrade header");return}if(f===void 0||!Ic.test(f)){et(this,t,i,400,"Missing or invalid Sec-WebSocket-Key header");return}if(p!==13&&p!==8){et(this,t,i,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(t)){Rt(i,400);return}let m=t.headers["sec-websocket-protocol"],_=new Set;if(m!==void 0)try{_=Ac.parse(m)}catch{et(this,t,i,400,"Invalid Sec-WebSocket-Protocol header");return}let b=t.headers["sec-websocket-extensions"],y={};if(this.options.perMessageDeflate&&b!==void 0){let k=new $e({...this.options.perMessageDeflate,isServer:!0,maxPayload:this.options.maxPayload});try{let I=to.parse(b);I[$e.extensionName]&&(k.accept(I[$e.extensionName]),y[$e.extensionName]=k)}catch{et(this,t,i,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let k={origin:t.headers[`${p===8?"sec-websocket-origin":"origin"}`],secure:!!(t.socket.authorized||t.socket.encrypted),req:t};if(this.options.verifyClient.length===2){this.options.verifyClient(k,(I,L,R,K)=>{if(!I)return Rt(i,L||401,R,K);this.completeUpgrade(y,f,_,t,i,a,c)});return}if(!this.options.verifyClient(k))return Rt(i,401)}this.completeUpgrade(y,f,_,t,i,a,c)}completeUpgrade(t,i,a,c,f,d,p){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>no)return Rt(f,503);let _=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${Ec("sha1").update(i+Pc).digest("base64")}`],b=new this.options.WebSocket(null,void 0,this.options);if(a.size){let y=this.options.handleProtocols?this.options.handleProtocols(a,c):a.values().next().value;y&&(_.push(`Sec-WebSocket-Protocol: ${y}`),b._protocol=y)}if(t[$e.extensionName]){let y=t[$e.extensionName].params,k=to.format({[$e.extensionName]:[y]});_.push(`Sec-WebSocket-Extensions: ${k}`),b._extensions=t}this.emit("headers",_,c),f.write(_.concat(`\r
|
|
12
12
|
`).join(`\r
|
|
13
|
-
`)),f.removeListener("error",
|
|
14
|
-
`+Object.keys(a).map(
|
|
13
|
+
`)),f.removeListener("error",so),b.setSocket(f,d,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(b),b.on("close",()=>{this.clients.delete(b),this._shouldEmitClose&&!this.clients.size&&process.nextTick(Nt,this)})),p(b,c)}};oo.exports=Ir;function Lc(r,t){for(let i of Object.keys(t))r.on(i,t[i]);return function(){for(let a of Object.keys(t))r.removeListener(a,t[a])}}function Nt(r){r._state=io,r.emit("close")}function so(){this.destroy()}function Rt(r,t,i,a){i=i||In.STATUS_CODES[t],a={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(i),...a},r.once("finish",r.destroy),r.end(`HTTP/1.1 ${t} ${In.STATUS_CODES[t]}\r
|
|
14
|
+
`+Object.keys(a).map(c=>`${c}: ${a[c]}`).join(`\r
|
|
15
15
|
`)+`\r
|
|
16
16
|
\r
|
|
17
|
-
`+i)}function
|
|
17
|
+
`+i)}function et(r,t,i,a,c,f){if(r.listenerCount("wsClientError")){let d=new Error(c);Error.captureStackTrace(d,et),r.emit("wsClientError",d,i,t)}else Rt(i,a,c,f)}});import{spawn as rf}from"node:child_process";import{existsSync as sf,openSync as of}from"node:fs";import{mkdir as af}from"node:fs/promises";import{dirname as xf}from"node:path";import{fileURLToPath as cf}from"node:url";function Rr(r=H()){return sf(r.libEntry)?r.libEntry:cf(new URL("../index.ts",import.meta.url))}async function Do(r={}){let t=r.paths??H(),i=r.entryOverride??Rr(t);await af(xf(t.logFile),{recursive:!0});let a=of(t.logFile,"a"),f=i.endsWith(".ts")?["--import","tsx/esm",i,"--daemon"]:[i,"--daemon"],d=rf(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 ff.info("daemon spawned",{pid:d.pid,entry:i}),{pid:d.pid,entry:i}}var ff,Or=ke(()=>{"use strict";q();ae();ff=N("spawn-daemon")});import{spawn as _f}from"node:child_process";import{mkdir as wf,unlink as yf,writeFile as bf}from"node:fs/promises";import{dirname as vf,join as Sf}from"node:path";function qn(r){return r.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function No(r,t){return new Promise((i,a)=>{let c=_f(r,t,{stdio:["ignore","pipe","pipe"]}),f="";c.stderr?.on("data",d=>{f+=d.toString("utf8")}),c.on("error",a),c.on("close",d=>{d===0?i():a(new Error(`${r} ${t.join(" ")} exited ${d}: ${f.trim()}`))})})}var zn,zr,qr,Ro=ke(()=>{"use strict";q();zn=N("supervisor.launchd"),zr="ai.coze.bridge",qr={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>
|
|
21
21
|
<key>Label</key>
|
|
22
|
-
<string>${
|
|
22
|
+
<string>${zr}</string>
|
|
23
23
|
<key>ProgramArguments</key>
|
|
24
24
|
<array>
|
|
25
|
-
<string>${
|
|
26
|
-
<string>${
|
|
25
|
+
<string>${qn(r.nodeBin)}</string>
|
|
26
|
+
<string>${qn(r.entry)}</string>
|
|
27
27
|
<string>--daemon</string>
|
|
28
28
|
</array>
|
|
29
29
|
<key>RunAtLoad</key>
|
|
@@ -33,12 +33,12 @@ var L0=Object.create;var or=Object.defineProperty;var N0=Object.getOwnPropertyDe
|
|
|
33
33
|
<key>ThrottleInterval</key>
|
|
34
34
|
<integer>10</integer>
|
|
35
35
|
<key>StandardOutPath</key>
|
|
36
|
-
<string>${
|
|
36
|
+
<string>${qn(r.logFile)}</string>
|
|
37
37
|
<key>StandardErrorPath</key>
|
|
38
|
-
<string>${
|
|
38
|
+
<string>${qn(r.logFile)}</string>
|
|
39
39
|
</dict>
|
|
40
40
|
</plist>
|
|
41
|
-
`},configPath(r){return Sf(r.homeDir,"Library","LaunchAgents",`${
|
|
41
|
+
`},configPath(r){return Sf(r.homeDir,"Library","LaunchAgents",`${zr}.plist`)},async install(r){let t=this.configPath(r);await wf(vf(t),{recursive:!0}),await bf(t,this.renderConfig(r),"utf8"),zn.info("plist written",{plistPath:t}),await No("launchctl",["load","-w",t]),zn.info("launchd job loaded",{label:zr})},async uninstall(r){let t=this.configPath(r);await No("launchctl",["unload","-w",t]).catch(i=>zn.warn("launchctl unload failed (ignored)",{err:String(i)})),await yf(t).catch(i=>{if(i.code!=="ENOENT")throw i}),zn.info("launchd job removed",{plistPath:t})}}});import{spawn as Cf}from"node:child_process";import{mkdir as Ef,unlink as Af,writeFile as kf}from"node:fs/promises";import{dirname as Df,join as Pf}from"node:path";function Hn(r,t){return new Promise((i,a)=>{let c=Cf(r,t,{stdio:["ignore","pipe","pipe"]}),f="";c.stderr?.on("data",d=>{f+=d.toString("utf8")}),c.on("error",a),c.on("close",d=>{d===0?i():a(new Error(`${r} ${t.join(" ")} exited ${d}: ${f.trim()}`))})})}var Fn,Un,Fr,Oo=ke(()=>{"use strict";q();Fn=N("supervisor.systemd"),Un="coze-bridge.service",Fr={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 Pf(r.homeDir,".config","systemd","user",
|
|
55
|
+
`},configPath(r){return Pf(r.homeDir,".config","systemd","user",Un)},async install(r){let t=this.configPath(r);await Ef(Df(t),{recursive:!0}),await kf(t,this.renderConfig(r),"utf8"),Fn.info("systemd unit written",{unitPath:t}),await Hn("systemctl",["--user","daemon-reload"]),await Hn("systemctl",["--user","enable","--now",Un]),Fn.info("systemd unit enabled",{unitName:Un})},async uninstall(r){let t=this.configPath(r);await Hn("systemctl",["--user","disable","--now",Un]).catch(i=>Fn.warn("systemctl disable failed (ignored)",{err:String(i)})),await Af(t).catch(i=>{if(i.code!=="ENOENT")throw i}),await Hn("systemctl",["--user","daemon-reload"]).catch(()=>{}),Fn.info("systemd unit removed",{unitPath:t})}}});import{spawn as Tf}from"node:child_process";import{join as If}from"node:path";function Mo(r,t){return new Promise((i,a)=>{let c=Tf(r,t,{stdio:["ignore","pipe","pipe"],shell:!1}),f="";c.stderr?.on("data",d=>{f+=d.toString("utf8")}),c.on("error",a),c.on("close",d=>{d===0?i():a(new Error(`${r} ${t.join(" ")} exited ${d}: ${f.trim()}`))})})}var Ur,jn,Hr,Bo=ke(()=>{"use strict";q();Ur=N("supervisor.taskscheduler"),jn="CozeBridge",Hr={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 If(r.homeDir,".coze","bridge","task.xml")},async install(r){let t=`"${r.nodeBin}" "${r.entry}" --daemon`;await Mo("schtasks",["/Create","/SC","ONLOGON","/TN",jn,"/TR",t,"/RU",r.userName,"/F"]),Ur.info("task scheduler entry created",{task:jn})},async uninstall(r){await Mo("schtasks",["/Delete","/TN",jn,"/F"]).catch(t=>Ur.warn("schtasks /Delete failed (ignored)",{err:String(t)})),Ur.info("task scheduler entry removed",{task:jn})}}});var jr={};ps(jr,{buildContext:()=>Of,getSupervisor:()=>Rf,launchdSupervisor:()=>qr,systemdSupervisor:()=>Fr,taskSchedulerSupervisor:()=>Hr});import{homedir as Lf,userInfo as Nf}from"node:os";function Rf(r=process.platform){switch(r){case"darwin":return qr;case"linux":return Fr;case"win32":return Hr;default:throw new Error(`unsupported platform for OS supervisor: ${r}`)}}function Of(){let r=H();return{nodeBin:process.execPath,entry:Rr(r),logFile:r.logFile,homeDir:Lf(),userName:Nf().username}}var Kr=ke(()=>{"use strict";ae();Or();Ro();Oo();Bo()});Fe();q();import{readdir as ea}from"node:fs/promises";import{mkdir as Y0,writeFile as X0}from"node:fs/promises";import{join as Z0}from"node:path";var Q0={"claude-code":"CLAUDE.md",codex:"AGENTS.md",openclaw:"SOUL.md"};async function Je(r,t,i,a){await Y0(r,{recursive:!0});let c=Q0[t],f=Z0(r,c),d=$0(t,i,a);return await X0(f,d,"utf8"),f}function $0(r,t,i){let a=`# Coze Agent: ${t}
|
|
80
80
|
|
|
81
81
|
> framework: \`${r}\`
|
|
82
82
|
|
|
83
|
-
`,
|
|
83
|
+
`,c=i?.trim()?i.endsWith(`
|
|
84
84
|
`)?i:`${i}
|
|
85
85
|
`:`_No instructions provided._
|
|
86
86
|
`;return`${a}---
|
|
87
87
|
|
|
88
|
-
${x}`}var be=T("agent-detail-sync"),Jt=class{constructor(e){this.opts=e}opts;async syncAll(e){let i=this.opts.paths.agentsRoot,a;try{a=await ea(i)}catch(x){be.info("agents dir not found, skip detail sync",{root:i,err:String(x)});return}be.info("starting detail sync",{reason:e,count:a.length});for(let x of a)try{await this.syncOne(x)}catch(f){be.warn("detail sync failed for agent, skipping",{agentId:x,err:String(f)})}be.info("detail sync done",{reason:e})}async syncOne(e){let i=await ae(e,this.opts.paths);if(!i){be.info("detail sync: agent config missing, skip",{agentId:e});return}let a;try{a=await this.opts.sendDetail({_meta:{cozeAgentId:e}})}catch(u){be.warn("detail RPC failed, using local data",{agentId:e,err:String(u)});return}if(a.agentId&&a.agentId!==e){be.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&&be.info("detail.deployType",{agentId:e,deployType:a.deployType}),!x){be.debug("detail sync: no diff",{agentId:e});return}await de(i,this.opts.paths),be.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 ta}from"node:child_process";import{mkdir as na,readFile as Ns,readdir as ra,rm as sa,stat as Yt,writeFile as ia}from"node:fs/promises";import{join as Le,normalize as oa,relative as Os,resolve as aa,sep as Bs}from"node:path";function Ss(r){return r?.cozeDeployType==="cloud"?"cloud":"local"}function Cs(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 A=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)}};U();ce();function Ye(r,e){if(Ss(r)!=="cloud")throw new A("OPERATION_NOT_ALLOWED_FOR_LOCAL",`${e} is not allowed for local agent`)}var Es="https://llm-gateway.coze.cn",Vt="auto";function fr(r){return{model:r.model??Vt,...r.modelToken?{modelToken:r.modelToken}:{}}}function As(r){return!r||r===Vt}function Ds(r){let e={};return r.modelToken&&(e.ANTHROPIC_BASE_URL=Es,e.ANTHROPIC_AUTH_TOKEN=r.modelToken),As(r.model)||(e.ANTHROPIC_MODEL=r.model),e}function ks(r){let e=[];return As(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 Ps(r){return r.modelToken?{OPENAI_API_KEY:r.modelToken}:{}}var $=T("agent-handlers"),Is=5*1024*1024,xa=1,ca=6,fa=new Set(["node_modules",".git",".coze","dist","build",".next"]),ua=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??Te(i).workspace,f=a?.skills??[],u=[];for(let h of f){let p=Le(x,h.relPath,"SKILL.md");await Yt(p).then(b=>b.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((p,w)=>[p.skillId,w])),h=[];for(let p of x){if(!p.skillName)throw new A("IPC_BAD_REQUEST","skill missing skillName");let w=da(p.skillName),b=la(a.framework),y=Le(b,w),E=Le(a.workspace,y);await na(E,{recursive:!0});let P=await ga(p.downloadUrl);ma(P)?await wa(P,E):await ia(Le(E,"SKILL.md"),P.toString("utf8"),"utf8");let I={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}:{}},L=u.get(p.skillId);L!==void 0?f[L]=I:(u.set(p.skillId,f.length),f.push(I)),h.push(p),$.info("skill installed",{agentId:i,skillId:p.skillId,skillName:p.skillName,relPath:y})}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 p=Le(a.workspace,h.relPath);await sa(p,{recursive:!0,force:!0}),$.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}),$.info("session reloaded",{reason:i,agentId:e,framework:a.framework,cloudId:x,acpId:f})}catch(u){$.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 $.info("_agent/update: empty cozeIdentity, noop",{agentId:e.agentId}),{ok:!0};let i=e.agentId,a=await ae(i);if(!a)throw new A("AGENT_NOT_FOUND",`agent not found: ${i}`);return a.cozeIdentity===e.cozeIdentity?($.info("_agent/update: cozeIdentity unchanged, noop",{agentId:i}),{ok:!0}):(a.cozeIdentity=e.cozeIdentity,await de(a),await Ve(a.workspace,a.framework,i,e.cozeIdentity),$.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 A("IPC_BAD_REQUEST","_agent/disconnect: missing agentId");let a=await ae(i);return a?(a.disconnectedAt=Date.now(),a.disconnectReason=e.reason??"",await de(a),$.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}):($.warn("_agent/disconnect: agent not found, ignoring",{agentId:i}),{ok:!0})}async switchModel(e){if(Ye(e._meta,"_agent/switchModel"),!e.agentId)throw new A("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 ae(e.agentId);if(!x)throw new A("AGENT_NOT_FOUND",`agent not found: ${e.agentId}`);x.model=i,a!==void 0?x.modelToken=a:delete x.modelToken,await de(x),$.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 $.info("_agent/switchModel: agent not running, config persisted only",{agentId:e.agentId}),{ok:!0};if(f.status==="switching")return $.info("_agent/switchModel: already switching, params updated via config",{agentId:e.agentId}),{ok:!0};if(!this.opts.executeModelSwitch)throw new A("BRIDGE_INTERNAL","_agent/switchModel: executeModelSwitch callback not wired");f.status="switching";let u=f.msgQueue.enqueue(async()=>{}),h=setTimeout(()=>{$.warn("_agent/switchModel: 30s idle timeout, forcing downstream stop",{agentId:e.agentId}),f.downstream.stop("switchModel idle timeout").catch(p=>$.warn("force stop failed (ignored)",{agentId:e.agentId,err:String(p)}))},ua);try{return await u.catch(p=>$.warn("_agent/switchModel: msgQueue idle wait rejected (continuing)",{agentId:e.agentId,err:String(p)})),clearTimeout(h),await this.opts.executeModelSwitch(e.agentId),{ok:!0}}catch(p){clearTimeout(h),$.error("_agent/switchModel: failed, marking disconnected",{agentId:e.agentId,err:String(p)});let w=await ae(e.agentId).catch(()=>null);throw w&&(w.disconnectedAt=Date.now(),w.disconnectReason=`model switch failed: ${p instanceof Error?p.message:String(p)}`,await de(w).catch(b=>$.warn("write disconnect marker failed (ignored)",{err:String(b)}))),this.opts.disposeAndMarkDisconnected?await this.opts.disposeAndMarkDisconnected(e.agentId,`model switch failed: ${p instanceof Error?p.message:String(p)}`).catch(b=>$.warn("disposeAndMarkDisconnected failed (ignored)",{err:String(b)})):f.status="disconnected",p instanceof A&&(p.code==="MODEL_SWITCH_FAILED"||p.code==="AGENT_NOT_FOUND")?p:new A("MODEL_SWITCH_FAILED",p instanceof Error?p.message:String(p),{cause:p})}}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 A("IPC_BAD_REQUEST",`path not found: ${f}`);let p=_a(e.depth);return h.isDirectory()?{tree:await Rs(x,u,f,p)}:{tree:[{name:ya(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 A("IPC_BAD_REQUEST","filePath required");let x=this.safeJoin(a,e.filePath),f=await Yt(x).catch(()=>null);if(!f||!f.isFile())throw new A("IPC_BAD_REQUEST",`not a file: ${e.filePath}`);if(f.size>Is)throw new A("IPC_BAD_REQUEST",`file too large: ${f.size} bytes (max ${Is})`);let u=await Ns(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:Te(e).workspace}safeJoin(e,i){let a=aa(e,i||"."),x=Os(e,a);if(x.startsWith("..")||x===".."||x.startsWith(`..${Bs}`))throw new A("IPC_BAD_REQUEST",`path escapes workspace: ${i}`);return a}loadAgentCfg(e){return ae(e)}async requireAgentCfg(e){let i=await this.loadAgentCfg(e);if(!i)throw new A("AGENT_NOT_FOUND",`no config for agent: ${e}`);return i}};function da(r){let e=r.trim().replace(/[^a-zA-Z0-9._-]+/g,"-").replace(/^-+|-+$/g,"").slice(0,64);if(!e||e==="."||e==="..")throw new A("IPC_BAD_REQUEST",`invalid skill name: ${r}`);return e}function la(r){return r==="claude-code"?Le(".claude","skills"):Le(".agents","skills")}var ha=3e4,Ts=50*1024*1024,Ls=3e4;async function ga(r){if(!r)throw new A("IPC_BAD_REQUEST","skill missing downloadUrl");if(r.startsWith("data:"))return pa(r);if(r.startsWith("file:")){let e=new URL(r).pathname,i=await Ns(e);if(i.length>Ts)throw new A("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(),ha);try{let a=await fetch(r,{signal:e.signal});if(!a.ok)throw new A("IPC_BAD_REQUEST",`fetch skill failed HTTP ${a.status} ${r}`);let x=await a.arrayBuffer();if(x.byteLength>Ts)throw new A("IPC_BAD_REQUEST",`skill too large: ${x.byteLength} bytes`);return Buffer.from(x)}finally{clearTimeout(i)}}throw new A("IPC_BAD_REQUEST",`unsupported downloadUrl scheme (\u8981 https/data/file): ${r.slice(0,80)}`)}function pa(r){let e=/^data:([^,;]*)(;base64)?,(.*)$/s.exec(r);if(!e)throw new A("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 ma(r){return r.length>=2&&r[0]===31&&r[1]===139}async function wa(r,e){await new Promise((i,a)=>{let x=ta("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 A("IPC_BAD_REQUEST",`tar extract timeout (${Ls}ms)`))},Ls);x.on("error",h=>{clearTimeout(u),a(new A("IPC_BAD_REQUEST",`tar spawn failed: ${h.message}`,{cause:h}))}),x.on("exit",h=>{clearTimeout(u),h===0?i():a(new A("IPC_BAD_REQUEST",`tar exit ${h}${f?`: ${f.trim().slice(0,200)}`:""}`))}),x.stdin?.end(r)})}async function Rs(r,e,i,a){if(a<=0)return[];let x;try{x=await ra(e,{withFileTypes:!0})}catch{return[]}let f=[];for(let u of x){if(fa.has(u.name))continue;let h=Le(e,u.name),p=oa(Le(i,u.name)),w=null;try{w=await Yt(h)}catch{continue}let b={name:u.name,path:Ms(Os(r,h)),isDir:w.isDirectory(),size:w.size,modifiedAt:Math.floor(w.mtimeMs)};w.isDirectory()&&a>1&&(b.children=await Rs(r,h,p,a-1)),f.push(b)}return f.sort((u,h)=>u.isDir!==h.isDir?u.isDir?-1:1:u.name.localeCompare(h.name)),f}function _a(r){return!r||r<=0?xa:Math.min(r,ca)}function ya(r){if(!r||r==="."||r==="/")return".";let e=r.split(/[/\\]/);return e[e.length-1]||"."}function Ms(r){return r.split(Bs).join("/")}U();var Ct=T("agent-health-reporter"),ba=3e4,$t=class{constructor(e){this.opts=e;this.intervalMs=e.intervalMs??ba}opts;timer=null;inFlight=!1;intervalMs;start(){this.timer||(this.timer=setInterval(()=>{this.tick()},this.intervalMs),this.timer.unref?.(),Ct.info("heartbeat started",{intervalMs:this.intervalMs}),this.tick())}stop(){this.timer&&(clearInterval(this.timer),this.timer=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 i=[...this.opts.core.agents.values()];for(let a of i){let x=va(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){Ct.warn("heartbeat send failed",{agentId:a.agentId,status:x,err:String(u)})}}}finally{this.inFlight=!1}}};function va(r){return r.status==="error"?"error":r.activeTriggers.size>0?"busy":r.status==="ok"||r.status==="degraded"?"online":null}Ue();import{mkdir as ur,rm as La}from"node:fs/promises";import{spawn as Da}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 zs(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 Zt=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)}},K={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 qs(r){return"method"in r&&!("id"in r)}function en(r){return!("method"in r)&&"id"in r}var Sa={AGENT_NOT_FOUND:K.AGENT_NOT_FOUND,AGENT_BUSY:K.AGENT_BUSY,AGENT_DISCONNECTED:K.AGENT_DISCONNECTED,AGENT_TIMEOUT:K.AGENT_TIMEOUT,AGENT_SPAWN_FAILED:K.AGENT_SPAWN_FAILED,AGENT_PROTOCOL_ERROR:K.INTERNAL_ERROR,BRIDGE_CONFIG_INVALID:K.INTERNAL_ERROR,BRIDGE_INTERNAL:K.INTERNAL_ERROR,IPC_AUTH_FAILED:K.INTERNAL_ERROR,IPC_BAD_REQUEST:K.INVALID_REQUEST,MODEL_SWITCHING:K.MODEL_SWITCHING,MODEL_SWITCH_FAILED:K.MODEL_SWITCH_FAILED,OPERATION_NOT_ALLOWED_FOR_LOCAL:K.OPERATION_NOT_ALLOWED_FOR_LOCAL,UPSTREAM_DISCONNECTED:K.INTERNAL_ERROR,UPSTREAM_HANDSHAKE_FAILED:K.INTERNAL_ERROR};function tn(r){return r instanceof A?{code:Sa[r.code]??K.INTERNAL_ERROR,message:r.message,data:{bridgeCode:r.code,retriable:r.retriable}}:{code:K.INTERNAL_ERROR,message:r instanceof Error?r.message:String(r)}}function Fs(r){let e=r.data,i=e?.bridgeCode??"AGENT_PROTOCOL_ERROR";return new A(i,r.message,{retriable:e?.retriable??!1,cause:r.data})}function Us(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"},qu=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]??Ea(e),x=Ca[a]??[],f=[a,String(this.seq)];if(x.length>0){let u=x.map(p=>Ks(i?.[p]??"")),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=>Ks(String(u))).join(":"));return f.join("_")}reset(){this.seq=0}};function Ea(r){return r.replace(/[\s/]+/g,".").replace(/_+/g,"-")}function Ks(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)}U();var ka=3e4;function Ws(r,e){if(!(typeof r!="number"||r<=0))try{process.platform==="win32"?process.kill(r,e):process.kill(-r,e)}catch{}}var Ke=class{constructor(e){this.opts=e;this.log=T(`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 A("BRIDGE_INTERNAL","Downstream already started");let e=process.platform!=="win32",i=Da(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 A("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 A("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()));Ws(i.pid,"SIGTERM");let x=setTimeout(()=>{i.killed||Ws(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=ka){if(!this.child||this.stopped)return Promise.reject(new A("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,p)=>{let w=u?setTimeout(()=>{this.pending.delete(x),p(new A("AGENT_TIMEOUT",`${e} timed out after ${a}ms`))},a):null;this.pending.set(x,{resolve:h,reject:p,timer:w,method:e});try{this.writeFrame(f)}catch(b){w&&clearTimeout(w),this.pending.delete(x),p(b)}})}writeFrame(e){if(!this.child?.stdin||this.child.stdin.destroyed)throw new A("AGENT_PROTOCOL_ERROR","downstream stdin not writable");this.child.stdin.write(Us(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(Fs(e.error)):i.resolve(e.result);return}if(qs(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 Ia(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 Ke{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 Ia(e)}};var Ta="@zed-industries/codex-acp@latest",sn=class extends Ke{framework="codex";constructor(e){let i=e.command??"npx",a=e.args??["-y",Ta],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";U();var on=class extends Ke{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=T("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 A("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}};U();ce();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 W=T("agent-manager"),Na=(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?ks(x):[],u=x?Ps(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})}},Oa=[0,5e3,5e3],Ba=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??Na,this.restartDelaysMs=e.restartDelaysMs??Oa,this.createTimeoutMs=e.createTimeoutMs??Ba,this.healthReporter=e.healthReporter}async createAgent(e){if(!e.agentId)throw new A("IPC_BAD_REQUEST","agentId required");if(!e.framework)throw new A("IPC_BAD_REQUEST","framework required");this.registry.reviveIfDisconnected?.(e.agentId);let i=this.registry.get(e.agentId);if(i){if(i.framework!==e.framework)throw new A("AGENT_BUSY",`agent ${e.agentId} exists with different framework (${i.framework})`);if(i.status==="error")W.warn("existing agent in error state, rebuilding",{agentId:e.agentId}),await i.dispose("rebuild after error").catch(p=>W.warn("dispose stale agent failed (ignored)",{err:String(p)})),this.registry.unregister(e.agentId);else return W.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 A("AGENT_SPAWN_FAILED",`framework ${e.framework} not detected on this machine; rerun daemon to refresh frameworks_cache`);let x=Te(e.agentId,this.paths),f=e.workspace??x.workspace,u=new AbortController,h=setTimeout(()=>u.abort(new A("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 A("AGENT_TIMEOUT","_agent/create aborted")},h,p,w=!1;try{await ur(i.root,{recursive:!0}),await ur(a,{recursive:!0}),await ur(i.logs,{recursive:!0}),u(),e.framework!=="openclaw"&&await Ve(a,e.framework,e.agentId,e.cozeIdentity),u();let b=await ae(e.agentId,this.paths).catch(()=>null),y=fr({model:e.model??b?.model,modelToken:e.modelToken??b?.modelToken});if(h=this.factory(e.framework,x.path,a,e.agentId,y),await h.start(),u(),await h.initialize(Gs),u(),e.framework==="openclaw"&&await Ve(a,"openclaw",e.agentId,e.cozeIdentity),p=new xn({agentId:e.agentId,framework:e.framework,workspace:a,downstream:h}),p.status="ok",b?.sessions){for(let[I,L]of Object.entries(b.sessions))p.sessions.set(I,L);Object.keys(b.sessions).length>0&&W.info("restored persisted sessions for agent",{agentId:e.agentId,count:Object.keys(b.sessions).length})}this.registry.register(p),w=!0;let E={agentId:e.agentId,framework:e.framework,workspace:a,cozeIdentity:e.cozeIdentity,createdAt:b?.createdAt??Date.now(),sessions:b?.sessions??{},model:y.model};y.modelToken&&(E.modelToken=y.modelToken),b?.skills&&(E.skills=b.skills),b?.agentName&&(E.agentName=b.agentName),b?.description&&(E.description=b.description),await de(E,this.paths);let P=h.pid()??0;return W.info("agent created",{agentId:e.agentId,framework:e.framework,pid:P}),this.installRestartHook(p),{ok:!0,agentId:e.agentId,workspace:a,pid:P,framework:e.framework}}catch(b){throw W.error("agent create failed,rolling back",{agentId:e.agentId,err:String(b)}),h?.cleanup&&await h.cleanup("rollback").catch(y=>W.warn("downstream cleanup failed (ignored)",{err:String(y)})),h&&await h.stop("rollback").catch(()=>{}),w&&p&&(await p.dispose("rollback").catch(()=>{}),this.registry.unregister(e.agentId)),await La(i.root,{recursive:!0,force:!0}).catch(y=>W.warn("rm agent dir failed (ignored)",{err:String(y)})),b instanceof A?b:new A("AGENT_SPAWN_FAILED",String(b),{cause:b})}}async reportHealth(e,i,a){if(!this.healthReporter){W.info("healthReporter not wired, skip _agent/health upstream",{agentId:e.agentId,status:i});return}try{await this.healthReporter({status:i,_meta:{cozeAgentId:e.agentId}}),W.info("_agent/health reported",{agentId:e.agentId,status:i,cause:a})}catch(x){W.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){W.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",W.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 ae(e.agentId,this.paths).catch(()=>null),x=a?fr(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 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:i});try{let x=await this.spawnAndInitialize(e,a.path);return this.rewireSession(e,x),W.info("agent restart succeeded",{agentId:e.agentId,attempt:i}),!0}catch(x){return W.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 A("AGENT_NOT_FOUND",`agent not found: ${e}`);let a=this.config.frameworksCache?.[i.framework];if(!a)throw new A("AGENT_SPAWN_FAILED",`framework ${i.framework} not detected; cannot respawn for switchModel`);W.info("executeModelSwitch: stopping old downstream",{agentId:e,framework:i.framework}),await i.downstream.stop("switchModel").catch(u=>{W.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 A("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(p){throw new A("MODEL_SWITCH_FAILED",`sessionLoad failed after switchModel for cloud session ${u} (acp=${h}): ${p instanceof Error?p.message:String(p)}`,{cause:p})}f.length>0&&W.info("executeModelSwitch: session/load reloaded",{agentId:e,count:f.length}),i.status="ok",W.info("executeModelSwitch: success",{agentId:e,framework:i.framework})}};U();import{spawn as Ra}from"node:child_process";import{constants as Js,access as Ma}from"node:fs/promises";import{delimiter as za,join as qa}from"node:path";var Fa=T("framework-detector"),Vs={"claude-code":"claude",codex:"codex",openclaw:"openclaw"},Ua=[".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??Ra,access:e.access??Ma}}async detect(e){let i=Vs[e],a=await this.which(i);if(!a)return Fa.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(Vs).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(za).filter(Boolean),a=this.env.platform==="win32"?["",...Ua]:[""];for(let x of i)for(let f of a){let u=qa(x,e+f);if(await this.isExecutable(u))return u}return null}async isExecutable(e){try{let i=this.env.platform==="win32"?Js.F_OK:Js.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",p=>{a+=p.toString("utf8")}),h.on("error",()=>u("unknown")),h.on("close",()=>{let p=Ha(a).split(/\r?\n/)[0]??"";u(p)})}catch{u("unknown")}})}},Ka=new RegExp("\x1B\\[[0-9;]*[A-Za-z]","g");function Ha(r){return r.replace(Ka,"")}ar();ce();function fn(r){return Ft(r??H().configFile)}function At(r,e){return Ut(e??H().configFile,r)}Ue();U();var ee=T("core"),Wa=5*6e4,ja=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(),ee.info("Core started",{extensions:Object.keys(this.extensions)})}async stop(e){ee.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),ee.info("agent registered",{agentId:e.agentId,framework:e.framework})}unregister(e){this.agents.delete(e)}reviveIfDisconnected(e){this.disconnectedAgents.delete(e)&&ee.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)=>{ee.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,K.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,K.METHOD_NOT_FOUND,`method not implemented: ${e.method}`)}catch(i){ee.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 A("IPC_BAD_REQUEST",`${e.method} requires params`);let i=e.params,a=i._meta?.cozeAgentId;if(!a)throw new A("IPC_BAD_REQUEST",`${e.method}: missing _meta.cozeAgentId`);let x=this.agents.get(a);if(!x)throw this.disconnectedAgents.has(a)?new A("AGENT_DISCONNECTED",`agent ${a} has been disconnected; cloud must _agent/create to revive`):new A("AGENT_NOT_FOUND",`agent not found: ${a}`);if(x.status==="switching")throw new A("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{ee.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}=Cs(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 p=h??u,w=await e.downstream.sessionLoad({...f,sessionId:p,cwd:f.cwd||e.workspace});return h||e.sessions.set(u,p),w}catch(p){ee.warn("session/load failed,fallback to session/new",{agentId:e.agentId,cloudId:u,err:String(p)});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),p=!1;if(h&&!e.verifiedSessions.has(h))try{await e.downstream.sessionLoad({sessionId:h,cwd:e.workspace}),e.verifiedSessions.add(h),ee.info("session restored via session/load",{agentId:e.agentId,cloudId:u,acpId:h})}catch(y){ee.warn("session/load failed,fallback to session/new",{agentId:e.agentId,cloudId:u,acpId:h,err:String(y)}),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),p=!0);let w=a._meta?.cozeTriggerMsgId;w?e.activeTriggers.set(h,w):e.activeTriggers.delete(h);let b=await e.downstream.sessionPrompt({...f,sessionId:h});return p&&this.persistSessionMapping(e),b}case"session/cancel":{let u=x.sessionId;if(!u)throw new A("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 A("IPC_BAD_REQUEST",`session method not supported: ${i}`)}}forwardUpdate(e,i){let a=i.sessionId,x=this.reverseSessionId(e,a);if(!x){ee.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(zs("session/update",{...i,sessionId:x,_meta:f})).catch(h=>ee.warn("forward update failed",{agentId:e.agentId,err:String(h)}))}handleAgentRequest(e,i){if(i.method==="session/request_permission"){this.forwardPermissionRequest(e,i);return}ee.warn("unhandled agent request,returning method_not_found",{agentId:e.agentId,method:i.method}),e.downstream.respondAgentRequestError(i.id,{code:K.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,p={cozeAgentId:e.agentId};h&&(p.cozeTriggerMsgId=h);let w=u?this.reverseSessionId(e,u):void 0,b={...x,...w?{sessionId:w}:{},_meta:p},y=setTimeout(()=>{let E=this.pendingUpstream.get(a);E&&(this.pendingUpstream.delete(a),ee.warn("upstream permission request timed out,replying cancelled to agent",{agentId:e.agentId,upstreamId:a}),e.downstream.respondAgentRequest(E.agentRequestId,{outcome:{kind:"cancelled"}}))},Wa);this.pendingUpstream.set(a,{agentRequestId:i.id,session:e,method:i.method,timer:y}),this.upstream.send(ct(a,"session/request_permission",b)).catch(E=>{let P=this.pendingUpstream.get(a);P&&(clearTimeout(P.timer),this.pendingUpstream.delete(a)),ee.error("forward permission request failed",{agentId:e.agentId,err:String(E)}),e.downstream.respondAgentRequestError(i.id,{code:K.INTERNAL_ERROR,message:`upstream send failed: ${String(E)}`})})}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 Zt(e.error)):a.resolve(e.result);return}ee.debug("orphan upstream response (no pending)",{id:e.id})}sendRequest(e,i,a=ja){let x=this.upstreamIds.next(e);return new Promise((f,u)=>{let h=setTimeout(()=>{this.pendingBridge.delete(x),u(new A("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(p=>{let w=this.pendingBridge.get(x);w&&(clearTimeout(w.timer),this.pendingBridge.delete(x)),u(p)})})}async persistSessionMapping(e){if(this.paths)try{await cr(e.agentId,e.sessions,this.paths)}catch(i){ee.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}))}};U();ce();import{randomBytes as Ga}from"node:crypto";import{chmod as Ja,mkdir as Va,writeFile as Ys}from"node:fs/promises";import{createServer as Ya}from"node:http";import{dirname as Xa}from"node:path";var $a=1e6,dr=T("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??H()}async start(){this.token=Ga(32).toString("hex");let e=Ya((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(),dr.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 Va(Xa(this.paths.portFile),{recursive:!0}),await Ys(this.paths.portFile,String(this.port),"utf8"),await Ys(this.paths.tokenFile,this.token,"utf8");try{await Ja(this.paths.tokenFile,384)}catch(e){dr.warn("chmod token file failed (non-POSIX?)",{err:String(e)})}}async dispatch(e,i){if(e.headers.authorization!==`Bearer ${this.token}`){Dt(i,401,{error:"unauthorized"});return}let x=`${e.method} ${(e.url??"").split("?")[0]}`,f=this.routes.get(x);if(!f){Dt(i,404,{error:"not found"});return}let u=null;if(e.method==="POST")try{u=await Za(e)}catch(h){Dt(i,400,{error:"invalid json",detail:String(h)});return}try{let h=await f.handler(u,e);Dt(i,200,h??{ok:!0})}catch(h){dr.error("IPC handler failed",{key:x,err:String(h)}),Dt(i,500,{error:h instanceof Error?h.message:String(h)})}}};function Dt(r,e,i){r.statusCode=e,r.setHeader("content-type","application/json"),r.end(JSON.stringify(i))}async function Za(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=Ie(oi(),1);var Nc=Ie(to(),1),Oc=Ie(kn(),1),Bc=Ie(ht(),1),Rc=Ie(Er(),1),Mc=Ie(kr(),1),zc=Ie(Or(),1),fo=Ie(Ln(),1),qc=Ie(co(),1);var uo=fo.default;U();var On="1008033",lo="1289";var ho="pbbp2",go="https://www.coze.cn",po="/api/coze_claw/resource/get_frontier_key",Fc="https://www.coze.cn",Uc="wss://frontier.coze.cn";function mo(r){return r??process.env.COZE_BRIDGE_HANDSHAKE_URL??Fc}function wo(r){return r??process.env.COZE_BRIDGE_FRONTIER_URL??Uc}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 se=T("upstream.frontier"),yo="application/json",bo="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:go,...Bn(this.opts.ppeOverride)};class i extends uo{constructor(h){super(h,ho,{headers:e})}send(h,...p){if(bs("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 b=Buffer.from(w.slice(0,128)).toString("hex");se.debug("WS raw frame out",{bytes:w.byteLength,headHex:b})}catch(w){se.warn("WS raw frame dump failed",{err:String(w)})}super.send(h,...p)}}let a=wo(this.opts.urlOverride),x={url:a,ws:i,fpID:lo,aID:On,accessKey:this.opts.handshake.accessKey,deviceID:this.opts.handshake.deviceId,payloadType:{type:yo,force:!0},payloadEncoding:{encoding:bo,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;se.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=>se.warn("onConnect handler threw (ignored)",{err:String(h)}))},f.onclose=u=>{this.opened=!1,se.info("frontier closed",{code:u.code,reason:u.reason,willReconnect:u.willReconnect})},f.onerror=u=>{se.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){se.warn("frontier close threw (ignored)",{err:String(a)})}}}async send(e){let i=this.fws;if(!i)throw new A("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 i.send(a,{service:33555712,method:1,payloadType:yo,payloadEncoding:bo})}catch(f){throw new A("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){se.debug("drop non-adapter frontier frame",{service:i});return}let a=Wc(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:Hc(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 Hc(r){return r?r.high===0?String(r.low>>>0):`${r.high.toString(16)}${(r.low>>>0).toString(16).padStart(8,"0")}`:""}function Wc(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}}U();function Co(r){return r?r.startsWith("boe_")?{ttEnv:r}:{ttEnv:r,usePpe:"1"}:{}}var So=T("handshake");async function Eo(r){let e=mo(r.endpoint),i=r.timeoutMs??1e4,a=`${jc(e)}${po}?aid=${encodeURIComponent(On)}`,x={Authorization:`Bearer ${r.privatecode}`,Accept:"application/json",...Bn(r.ppeOverride)},f=new AbortController,u=setTimeout(()=>f.abort(),i);So.info("frontier key handshake",{base:e});try{let h=await fetch(a,{method:"GET",headers:x,signal:f.signal}),p=h.headers.get("x-tt-logid")??"",w=h.headers.get("x-tt-trace-id")??"";if(!h.ok){let P=await h.text().catch(()=>"");throw new A("UPSTREAM_HANDSHAKE_FAILED",`handshake HTTP ${h.status} logid=${p}: ${P.slice(0,200)}`)}let b=await h.json();if(b.code!==void 0&&b.code!==0)throw new A("UPSTREAM_HANDSHAKE_FAILED",`handshake code=${b.code} msg=${b.msg??"-"} logid=${p}`);let y=b.data?.access_key,E=b.data?.device_id;if(!y||!E)throw new A("UPSTREAM_HANDSHAKE_FAILED",`handshake response missing access_key/device_id logid=${p}: ${JSON.stringify(b)}`);return So.info("handshake ok",{remoteDeviceId:E,logid:p,traceId:w}),{accessKey:y,deviceId:E}}catch(h){throw h instanceof A?h:h.name==="AbortError"?new A("UPSTREAM_HANDSHAKE_FAILED",`handshake timeout (${i}ms)`):new A("UPSTREAM_HANDSHAKE_FAILED",String(h),{cause:h})}finally{clearTimeout(u)}}function jc(r){return r.endsWith("/")?r.slice(0,-1):r}U();var Rr=T("upstream.switchable"),Mn=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()}};U();var Mr=T("upstream"),Rt=class{handler=null;async start(){Mr.info("NoopUpstream started (M1 skeleton; real Frontier wired in M4)")}async stop(e){Mr.info("NoopUpstream stopped",{reason:e})}async send(e){Mr.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)}};U();ce();U();ce();import{readFileSync as Gc,unlinkSync as Jc}from"node:fs";import{mkdir as Vc,readFile as Ao,unlink as Do,writeFile as Yc}from"node:fs/promises";import{dirname as Xc}from"node:path";var $c=T("single-instance"),zn=class{pidFile;acquired=!1;constructor(e={}){this.pidFile=e.pidFile??H().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 Vc(Xc(this.pidFile),{recursive:!0}),await Yc(this.pidFile,String(process.pid),"utf8"),this.acquired=!0,this.installCleanupHooks(),{kind:"acquired"})}async release(){if(this.acquired){try{(await Ao(this.pidFile,"utf8")).trim()===String(process.pid)&&await Do(this.pidFile)}catch{}this.acquired=!1}}async readExistingPid(){try{let e=await Ao(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{Gc(this.pidFile,"utf8").trim()===String(process.pid)&&Jc(this.pidFile)}catch{}})}};var q=T("daemon"),Zc="coze-bridge-daemon";async function Po(){let r=new zn({processTitle:Zc}),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??{};xr({pid:process.pid}),q.info(i?"loaded bridge config":"initialized bridge config");try{let D=new Et;a.frameworksCache=await D.detectAll(),q.info("refreshed frameworks_cache",{detected:Object.keys(a.frameworksCache)})}catch(D){q.warn("framework detection failed",{err:String(D)})}await At(a);let x=new Mn(new Rt),f=H(),u=new un({upstream:x,paths:f});await ef(f,u);let h=new cn({paths:f,config:a,registry:u,healthReporter:async D=>{await u.sendRequest("_agent/health",D)}}),p,w,b=null,y=null;u.registerExtension("_agent/create",async D=>h.createAgent(D.params)),u.registerExtension("_agent/health",async()=>({ok:!0}));let E=new Xt({agents:u.agents,disposeAndMarkDisconnected:async(D,z)=>{let G=u.agents.get(D);G&&(await G.dispose(`disconnect: ${z}`).catch(Ee=>q.warn("dispose during disconnect failed (ignored)",{agentId:D,err:String(Ee)})),G.status="disconnected",u.unregister(D)),u.disconnectedAgents.add(D)},executeModelSwitch:D=>h.executeModelSwitch(D)});u.registerExtension("_agent/listSkills",D=>E.listSkills(D.params)),u.registerExtension("_agent/addSkills",D=>E.addSkills(D.params)),u.registerExtension("_agent/removeSkills",D=>E.removeSkills(D.params)),u.registerExtension("_agent/getFileTree",D=>E.getFileTree(D.params)),u.registerExtension("_agent/getFileContent",D=>E.getFileContent(D.params)),u.registerExtension("_agent/update",D=>E.updateAgent(D.params)),u.registerExtension("_agent/disconnect",D=>E.disconnectAgent(D.params)),u.registerExtension("_agent/switchModel",D=>E.switchModel(D.params));let P=new Jt({paths:f,handlers:E,sendDetail:D=>u.sendRequest("_agent/detail",D)});x.onConnect(({initial:D})=>{q.info("frontier upstream connected, triggering detail sync",{initial:D}),P.syncAll(D?"initial-connect":"reconnect").catch(z=>q.warn("detail sync top-level error (ignored)",{err:String(z)}))});let I=new dn({paths:f,routes:[{method:"GET",path:"/status",handler:async()=>({running:!0,pid:process.pid,agents:[...u.agents.keys()],deviceId:b??"",frameworksCache:a.frameworksCache??{}})},{method:"POST",path:"/pair",handler:async D=>{let z=D,G=z?.privatecode,Ee=z?.pairing_code;if(!G||!Ee)throw new A("IPC_BAD_REQUEST","/pair requires privatecode + pairing_code");let Me=Co(z.env),_e=z.handshake_url,ye=z.frontier_url,ge=Qc(z.env,_e,ye),rt=!!p&&p!==G,Mt=w!==void 0&&w!==ge;if(rt||Mt){q.warn("pair config switched, resetting agents",{pcChanged:rt,envChanged:Mt,previousPc:p?ko(p):"",nextPc:ko(G),previousEnvKey:w??"",nextEnvKey:ge});for(let ke of[...u.agents.values()])await ke.dispose("pair config switch").catch(()=>{}),u.agents.delete(ke.agentId);await x.swap(new Rt,"pair switch").catch(()=>{})}let zt=await Eo({privatecode:G,..._e?{endpoint:_e}:{},ppeOverride:Me});b=zt.deviceId,xr({deviceId:b,pid:process.pid});let Ae=new Rn({handshake:zt,privatecode:G,...ye?{urlOverride:ye}:{},ppeOverride:Me});await x.swap(Ae,"pair"),p=G,w=ge;let De=Object.keys(a.frameworksCache??{});try{let ke=await u.sendRequest("_agent/pair",{pairCode:Ee,patToken:G,frameworks:De,_meta:{cozeDeviceId:b}});q.info("_agent/pair ok",{pairResult:ke}),y||(y=new $t({core:u,getDeviceId:()=>b??""})),y.start();let te;return z.agent_id&&(te=await tf(z.agent_id,f,h,Ge=>u.sendRequest("_agent/detail",Ge)).catch(Ge=>(q.error("--agent-id ensureAgent failed",{agentId:z.agent_id,err:String(Ge)}),{ok:!1,agentId:z.agent_id??"",note:String(Ge)}))),{ok:!0,note:"paired with cloud",...te?{agent:te}:{}}}catch(ke){return q.error("_agent/pair failed",{err:String(ke)}),{ok:!1,note:`pair failed: ${String(ke)}`}}}},{method:"POST",path:"/_agent/create",handler:async D=>{let z=D;return{ok:!0,result:await h.createAgent(z)}}},{method:"POST",path:"/refresh",handler:async()=>{q.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()=>(q.info("IPC /shutdown received"),setImmediate(()=>{xe.shutdown("ipc /shutdown")}),{ok:!0})}]}),{port:L,token:j}=await I.start();await u.start(),nf(f,h).catch(D=>q.warn("auto-revive top-level error (ignored)",{err:String(D)}));let ie=null,xe={port:L,token:j,core:u,ipc:I,shutdown(D){return ie||(q.info("daemon shutdown",{reason:D}),ie=(async()=>{y?.stop(),await u.stop(D),await I.stop(),await r.release()})(),ie)}};for(let D of["SIGTERM","SIGINT"])process.on(D,()=>{xe.shutdown(D).then(()=>process.exit(0))});return q.info("daemon ready",{port:L,pid:process.pid,nodeVersion:process.version,platform:process.platform,frameworks:Object.keys(a.frameworksCache??{}),libVersion:a.libVersion??"dev"}),xe}function ko(r){return r.length<=8?"***":`${r.slice(0,4)}***${r.slice(-4)}`}function Qc(r,e,i){return`${r??""}|${e??""}|${i??""}`}async function ef(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=>q.warn("enforceAgentConfigMode failed (ignored)",{agentId:u,err:String(h)}));try{let h=await x(u,r);h?.disconnectedAt&&(e.disconnectedAgents.add(u),q.info("agent marked disconnected on startup",{agentId:u,disconnectedAt:h.disconnectedAt,reason:h.disconnectReason??""}))}catch(h){q.warn("failed to load agent config on startup, skipping",{agentId:u,err:String(h)})}}}async function tf(r,e,i,a){let{loadAgentConfig:x}=await Promise.resolve().then(()=>(Ue(),Gt)),f=await x(r,e);if(f){q.info("--agent-id: local config found, reconnecting",{agentId:r,framework:f.framework,hadDisconnect:!!f.disconnectedAt});let p={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(p),{ok:!0,agentId:r,note:f.disconnectedAt?"revived from local config":"connected from local config"}}q.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 A("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}:{}};return await i.createAgent(h),{ok:!0,agentId:r,note:"created from cloud detail"}}async function nf(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));q.info("auto-revive: scanning local agents on startup",{count:a.length});let f=0,u=0;for(let h of a){let p;try{p=await x(h,r)}catch(w){q.warn("auto-revive: load config failed (skipping)",{agentId:h,err:String(w)}),u+=1;continue}if(!p){u+=1;continue}if(p.disconnectedAt){q.info("auto-revive: skip disconnected agent",{agentId:h,disconnectedAt:p.disconnectedAt}),u+=1;continue}try{q.info("auto-revive: spawning",{agentId:h,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}:{}}),f+=1}catch(w){q.warn("auto-revive: createAgent failed (skipping)",{agentId:h,framework:p.framework,err:String(w)}),u+=1}}return q.info("auto-revive: done",{revived:f,skipped:u,total:a.length}),{revived:f,skipped:u,total:a.length}}qr();ce();import{readFile as To}from"node:fs/promises";var je=class{paths;constructor(e){this.paths=e??H()}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:df(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([To(this.paths.portFile,"utf8"),To(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}),p=await h.text();return{status:h.status,body:uf(p)}}finally{clearTimeout(u)}}};function uf(r){if(!r)return null;try{return JSON.parse(r)}catch{return r}}function df(r){return r instanceof Error?r.message:String(r)}U();ce();import{copyFile as Lo,mkdir as lf,readFile as Fr,writeFile as hf}from"node:fs/promises";import{dirname as gf,resolve as Ur,sep as qn}from"node:path";import{fileURLToPath as pf}from"node:url";U();ce();var No=T("dist-install");function mf(r){let e=pf(r),i=gf(e),a=`${qn}src${qn}`;if(i.includes(a)||i.endsWith(`${qn}src${qn}cli`))return null;let x=Ur(i,"index.js"),f=Ur(i,"..","package.json");return{dist:x,pkgJson:f}}async function Oo(r={}){let e=r.paths??H(),i=mf(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 Fr(x,"utf8")).version??"unknown"}catch(y){return No.warn("cannot read source package.json,skip dist install",{err:String(y)}),{kind:"dev-mode-skip",reason:`package.json read failed: ${String(y)}`}}let u=await fn(e.configFile)??{},h=u.libVersion;if(h===f)try{return await Fr(e.libEntry),{kind:"already-current",libVersion:f}}catch{}await lf(e.libDir,{recursive:!0}),await Lo(a,e.libEntry),await Lo(`${a}.map`,`${e.libEntry}.map`).catch(()=>{});let p=Ur(e.libDir,"package.json"),w=`${JSON.stringify({type:"module"},null,2)}
|
|
91
|
-
`;return await
|
|
88
|
+
${c}`}var we=N("agent-detail-sync"),Gt=class{constructor(t){this.opts=t}opts;async syncAll(t){let i=this.opts.paths.agentsRoot,a;try{a=await ea(i)}catch(c){we.info("agents dir not found, skip detail sync",{root:i,err:String(c)});return}we.info("starting detail sync",{reason:t,count:a.length});for(let c of a)try{await this.syncOne(c)}catch(f){we.warn("detail sync failed for agent, skipping",{agentId:c,err:String(f)})}we.info("detail sync done",{reason:t})}async syncOne(t){let i=await ie(t,this.opts.paths);if(!i){we.info("detail sync: agent config missing, skip",{agentId:t});return}let a;try{a=await this.opts.sendDetail({_meta:{cozeAgentId:t}})}catch(d){we.warn("detail RPC failed, using local data",{agentId:t,err:String(d)});return}if(a.agentId&&a.agentId!==t){we.warn("detail response agentId mismatch, ignoring",{agentId:t,responseAgentId:a.agentId});return}let c=!1,f=!1;if(a.agentName&&a.agentName!==i.agentName&&(i.agentName=a.agentName,c=!0),a.description!==void 0&&a.description!==i.description&&(i.description=a.description,c=!0),a.cozeIdentity&&a.cozeIdentity!==i.cozeIdentity&&(i.cozeIdentity=a.cozeIdentity,c=!0,f=!0),a.deployType&&we.info("detail.deployType",{agentId:t,deployType:a.deployType}),!c){we.debug("detail sync: no diff",{agentId:t});return}await fe(i,this.opts.paths),we.info("detail sync: config updated",{agentId:t,identityChanged:f,agentName:i.agentName}),f&&(await Je(i.workspace,i.framework,t,i.cozeIdentity),await this.opts.handlers.reloadAgentSessionsPublic(t,"detail-sync"))}};Fe();import{spawn as ta}from"node:child_process";import{mkdir as na,readFile as Is,readdir as ra,rm as sa,stat as Jt,writeFile as ia}from"node:fs/promises";import{join as Te,normalize as oa,relative as Ls,resolve as aa,sep as Ns}from"node:path";function bs(r){return r?.cozeDeployType==="cloud"?"cloud":"local"}function vs(r){let{_meta:t,...i}=r;return{stripped:i,meta:t}}function at(r){if(!r?.cozeAgentId)throw new Error("missing _meta.cozeAgentId");return r.cozeAgentId}var A=class extends Error{code;retriable;cause;constructor(t,i,a){super(i),this.name="BridgeError",this.code=t,this.retriable=a?.retriable??!1,a?.cause!==void 0&&(this.cause=a.cause)}};q();ae();function Ve(r,t){if(bs(r)!=="cloud")throw new A("OPERATION_NOT_ALLOWED_FOR_LOCAL",`${t} is not allowed for local agent`)}var Ss="https://llm-gateway.coze.cn",Wt="auto";function or(r){return{model:r.model??Wt,...r.modelToken?{modelToken:r.modelToken}:{}}}function Cs(r){return!r||r===Wt}function Es(r){let t={};return r.modelToken&&(t.ANTHROPIC_BASE_URL=Ss,t.ANTHROPIC_AUTH_TOKEN=r.modelToken),Cs(r.model)||(t.ANTHROPIC_MODEL=r.model),t}function As(r){let t=[];return Cs(r.model)||t.push("-c",`model="${r.model}"`),r.modelToken&&(t.push("-c",'model_provider="openai"'),t.push("-c",`model_provider_overrides.openai.base_url="${Ss}/v1"`)),t}function ks(r){return r.modelToken?{OPENAI_API_KEY:r.modelToken}:{}}var Y=N("agent-handlers"),Ds=5*1024*1024,xa=1,ca=6,fa=new Set(["node_modules",".git",".coze","dist","build",".next"]),ua=3e4,Vt=class{constructor(t){this.opts=t}opts;async listSkills(t){Ve(t._meta,"_agent/listSkills");let i=at(t._meta),a=await this.loadAgentCfg(i),c=a?.workspace??Pe(i).workspace,f=a?.skills??[],d=[];for(let p of f){let m=Te(c,p.relPath,"SKILL.md");await Jt(m).then(b=>b.isFile()).catch(()=>!1)&&d.push({skillId:p.skillId,skillName:p.skillName,downloadUrl:p.downloadUrl??"",...p.description?{description:p.description}:{},...p.version?{version:p.version}:{}})}return{skills:d}}async addSkills(t){Ve(t._meta,"_agent/addSkills");let i=at(t._meta),a=await this.requireAgentCfg(i),c=t.skills??[],f=[...a.skills??[]],d=new Map(f.map((m,_)=>[m.skillId,_])),p=[];for(let m of c){if(!m.skillName)throw new A("IPC_BAD_REQUEST","skill missing skillName");let _=da(m.skillName),b=la(a.framework),y=Te(b,_),k=Te(a.workspace,y);await na(k,{recursive:!0});let I=await ga(m.downloadUrl);ma(I)?await _a(I,k):await ia(Te(k,"SKILL.md"),I.toString("utf8"),"utf8");let L={skillId:m.skillId,skillName:m.skillName,relPath:y,installedAt:Date.now(),...m.description?{description:m.description}:{},...m.version?{version:m.version}:{},...m.downloadUrl?{downloadUrl:m.downloadUrl}:{}},R=d.get(m.skillId);R!==void 0?f[R]=L:(d.set(m.skillId,f.length),f.push(L)),p.push(m),Y.info("skill installed",{agentId:i,skillId:m.skillId,skillName:m.skillName,relPath:y})}return await jt(i,f),await this.reloadAgentSessions(i,"skills-added"),{installedSkills:p}}async removeSkills(t){Ve(t._meta,"_agent/removeSkills");let i=at(t._meta),a=await this.requireAgentCfg(i),c=new Set(t.skillIds??[]),f=a.skills??[],d=[];for(let p of f){if(!c.has(p.skillId)){d.push(p);continue}let m=Te(a.workspace,p.relPath);await sa(m,{recursive:!0,force:!0}),Y.info("skill removed",{agentId:i,skillId:p.skillId,relPath:p.relPath})}return await jt(i,d),await this.reloadAgentSessions(i,"skills-removed"),{ok:!0}}reloadAgentSessionsPublic(t,i){return this.reloadAgentSessions(t,i)}async reloadAgentSessions(t,i){let a=this.opts.agents.get(t);if(a&&a.framework!=="codex")for(let[c,f]of a.sessions)try{await a.downstream.sessionLoad({sessionId:f,cwd:a.workspace}),Y.info("session reloaded",{reason:i,agentId:t,framework:a.framework,cloudId:c,acpId:f})}catch(d){Y.warn("session reload failed",{reason:i,agentId:t,framework:a.framework,cloudId:c,acpId:f,err:String(d)})}}async updateAgent(t){if(!t.cozeIdentity?.trim())return Y.info("_agent/update: empty cozeIdentity, noop",{agentId:t.agentId}),{ok:!0};let i=t.agentId,a=await ie(i);if(!a)throw new A("AGENT_NOT_FOUND",`agent not found: ${i}`);return a.cozeIdentity===t.cozeIdentity?(Y.info("_agent/update: cozeIdentity unchanged, noop",{agentId:i}),{ok:!0}):(a.cozeIdentity=t.cozeIdentity,await fe(a),await Je(a.workspace,a.framework,i,t.cozeIdentity),Y.info("_agent/update: cozeIdentity rewritten",{agentId:i,framework:a.framework}),await this.reloadAgentSessions(i,"identity-changed"),{ok:!0})}async disconnectAgent(t){let i=t.agentId;if(!i)throw new A("IPC_BAD_REQUEST","_agent/disconnect: missing agentId");let a=await ie(i);return a?(a.disconnectedAt=Date.now(),a.disconnectReason=t.reason??"",await fe(a),Y.info("agent disconnected",{agentId:i,reason:t.reason??"",force:t.force??!1}),this.opts.disposeAndMarkDisconnected&&await this.opts.disposeAndMarkDisconnected(i,t.reason??"disconnect"),{ok:!0}):(Y.warn("_agent/disconnect: agent not found, ignoring",{agentId:i}),{ok:!0})}async switchModel(t){if(Ve(t._meta,"_agent/switchModel"),!t.agentId)throw new A("IPC_BAD_REQUEST","_agent/switchModel: missing agentId");let i=t.model&&t.model.trim()?t.model:Wt,a=t.modelToken?.trim()||void 0,c=await ie(t.agentId);if(!c)throw new A("AGENT_NOT_FOUND",`agent not found: ${t.agentId}`);c.model=i,a!==void 0?c.modelToken=a:delete c.modelToken,await fe(c),Y.info("_agent/switchModel: model/modelToken persisted",{agentId:t.agentId,model:i,hasToken:!!a,reason:t.reason??"",force:t.force??!1});let f=this.opts.agents.get(t.agentId);if(!f)return Y.info("_agent/switchModel: agent not running, config persisted only",{agentId:t.agentId}),{ok:!0};if(f.status==="switching")return Y.info("_agent/switchModel: already switching, params updated via config",{agentId:t.agentId}),{ok:!0};if(!this.opts.executeModelSwitch)throw new A("BRIDGE_INTERNAL","_agent/switchModel: executeModelSwitch callback not wired");f.status="switching";let d=f.msgQueue.enqueue(async()=>{}),p=setTimeout(()=>{Y.warn("_agent/switchModel: 30s idle timeout, forcing downstream stop",{agentId:t.agentId}),f.downstream.stop("switchModel idle timeout").catch(m=>Y.warn("force stop failed (ignored)",{agentId:t.agentId,err:String(m)}))},ua);try{return await d.catch(m=>Y.warn("_agent/switchModel: msgQueue idle wait rejected (continuing)",{agentId:t.agentId,err:String(m)})),clearTimeout(p),await this.opts.executeModelSwitch(t.agentId),{ok:!0}}catch(m){clearTimeout(p),Y.error("_agent/switchModel: failed, marking disconnected",{agentId:t.agentId,err:String(m)});let _=await ie(t.agentId).catch(()=>null);throw _&&(_.disconnectedAt=Date.now(),_.disconnectReason=`model switch failed: ${m instanceof Error?m.message:String(m)}`,await fe(_).catch(b=>Y.warn("write disconnect marker failed (ignored)",{err:String(b)}))),this.opts.disposeAndMarkDisconnected?await this.opts.disposeAndMarkDisconnected(t.agentId,`model switch failed: ${m instanceof Error?m.message:String(m)}`).catch(b=>Y.warn("disposeAndMarkDisconnected failed (ignored)",{err:String(b)})):f.status="disconnected",m instanceof A&&(m.code==="MODEL_SWITCH_FAILED"||m.code==="AGENT_NOT_FOUND")?m:new A("MODEL_SWITCH_FAILED",m instanceof Error?m.message:String(m),{cause:m})}}async getFileTree(t){Ve(t._meta,"_agent/getFileTree");let i=t._meta,a=at(i),c=this.resolveWorkspace(a),f=t.filePath??"",d=this.safeJoin(c,f),p=await Jt(d).catch(()=>null);if(!p)throw new A("IPC_BAD_REQUEST",`path not found: ${f}`);let m=wa(t.depth);return p.isDirectory()?{tree:await Rs(c,d,f,m)}:{tree:[{name:ya(f),path:Os(f||"."),isDir:!1,size:p.size,modifiedAt:Math.floor(p.mtimeMs)}]}}async getFileContent(t){Ve(t._meta,"_agent/getFileContent");let i=at(t._meta),a=this.resolveWorkspace(i);if(!t.filePath)throw new A("IPC_BAD_REQUEST","filePath required");let c=this.safeJoin(a,t.filePath),f=await Jt(c).catch(()=>null);if(!f||!f.isFile())throw new A("IPC_BAD_REQUEST",`not a file: ${t.filePath}`);if(f.size>Ds)throw new A("IPC_BAD_REQUEST",`file too large: ${f.size} bytes (max ${Ds})`);let d=await Is(c);return d.includes(0)?{content:d.toString("base64"),encoding:"base64",size:f.size}:{content:d.toString("utf8"),encoding:"utf-8",size:f.size}}resolveWorkspace(t){let i=this.opts.agents.get(t);return i?i.workspace:Pe(t).workspace}safeJoin(t,i){let a=aa(t,i||"."),c=Ls(t,a);if(c.startsWith("..")||c===".."||c.startsWith(`..${Ns}`))throw new A("IPC_BAD_REQUEST",`path escapes workspace: ${i}`);return a}loadAgentCfg(t){return ie(t)}async requireAgentCfg(t){let i=await this.loadAgentCfg(t);if(!i)throw new A("AGENT_NOT_FOUND",`no config for agent: ${t}`);return i}};function da(r){let t=r.trim().replace(/[^a-zA-Z0-9._-]+/g,"-").replace(/^-+|-+$/g,"").slice(0,64);if(!t||t==="."||t==="..")throw new A("IPC_BAD_REQUEST",`invalid skill name: ${r}`);return t}function la(r){return r==="claude-code"?Te(".claude","skills"):Te(".agents","skills")}var ha=3e4,Ps=50*1024*1024,Ts=3e4;async function ga(r){if(!r)throw new A("IPC_BAD_REQUEST","skill missing downloadUrl");if(r.startsWith("data:"))return pa(r);if(r.startsWith("file:")){let t=new URL(r).pathname,i=await Is(t);if(i.length>Ps)throw new A("IPC_BAD_REQUEST",`skill too large: ${i.length} bytes`);return i}if(r.startsWith("http://")||r.startsWith("https://")){let t=new AbortController,i=setTimeout(()=>t.abort(),ha);try{let a=await fetch(r,{signal:t.signal});if(!a.ok)throw new A("IPC_BAD_REQUEST",`fetch skill failed HTTP ${a.status} ${r}`);let c=await a.arrayBuffer();if(c.byteLength>Ps)throw new A("IPC_BAD_REQUEST",`skill too large: ${c.byteLength} bytes`);return Buffer.from(c)}finally{clearTimeout(i)}}throw new A("IPC_BAD_REQUEST",`unsupported downloadUrl scheme (\u8981 https/data/file): ${r.slice(0,80)}`)}function pa(r){let t=/^data:([^,;]*)(;base64)?,(.*)$/s.exec(r);if(!t)throw new A("IPC_BAD_REQUEST","bad data URL");let i=!!t[2],a=t[3]??"";return i?Buffer.from(a,"base64"):Buffer.from(decodeURIComponent(a),"utf8")}function ma(r){return r.length>=2&&r[0]===31&&r[1]===139}async function _a(r,t){await new Promise((i,a)=>{let c=ta("tar",["-xzf","-","-C",t,"--strip-components=1"],{stdio:["pipe","pipe","pipe"]}),f="";c.stderr?.on("data",p=>{f+=String(p)});let d=setTimeout(()=>{c.kill("SIGKILL"),a(new A("IPC_BAD_REQUEST",`tar extract timeout (${Ts}ms)`))},Ts);c.on("error",p=>{clearTimeout(d),a(new A("IPC_BAD_REQUEST",`tar spawn failed: ${p.message}`,{cause:p}))}),c.on("exit",p=>{clearTimeout(d),p===0?i():a(new A("IPC_BAD_REQUEST",`tar exit ${p}${f?`: ${f.trim().slice(0,200)}`:""}`))}),c.stdin?.end(r)})}async function Rs(r,t,i,a){if(a<=0)return[];let c;try{c=await ra(t,{withFileTypes:!0})}catch{return[]}let f=[];for(let d of c){if(fa.has(d.name))continue;let p=Te(t,d.name),m=oa(Te(i,d.name)),_=null;try{_=await Jt(p)}catch{continue}let b={name:d.name,path:Os(Ls(r,p)),isDir:_.isDirectory(),size:_.size,modifiedAt:Math.floor(_.mtimeMs)};_.isDirectory()&&a>1&&(b.children=await Rs(r,p,m,a-1)),f.push(b)}return f.sort((d,p)=>d.isDir!==p.isDir?d.isDir?-1:1:d.name.localeCompare(p.name)),f}function wa(r){return!r||r<=0?xa:Math.min(r,ca)}function ya(r){if(!r||r==="."||r==="/")return".";let t=r.split(/[/\\]/);return t[t.length-1]||"."}function Os(r){return r.split(Ns).join("/")}q();var St=N("agent-health-reporter"),ba=3e4,Yt=class{constructor(t){this.opts=t;this.intervalMs=t.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()}),St.info("heartbeat started",{intervalMs:this.intervalMs}),this.tick())}stop(){this.timer&&(clearInterval(this.timer),this.timer=null,this.unsubscribeRegister&&(this.unsubscribeRegister(),this.unsubscribeRegister=null),St.info("heartbeat stopped"))}async tick(){if(this.inFlight){St.debug("previous tick still in-flight, skip");return}let t=this.opts.getDeviceId();if(!t){St.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 c=va(a);if(!c)continue;let f={status:c,_meta:{cozeAgentId:a.agentId,cozeDeviceId:t}};try{await this.opts.core.sendRequest("_agent/health",f)}catch(d){St.warn("heartbeat send failed",{agentId:a.agentId,status:c,err:String(d)})}}}finally{this.inFlight=!1}}};function va(r){return r.status==="error"?"error":r.activeTriggers.size>0?"busy":r.status==="ok"||r.status==="degraded"?"online":null}Fe();import{mkdir as ar,rm as La}from"node:fs/promises";import{spawn as ka}from"node:child_process";function xt(r,t,i){return i===void 0?{jsonrpc:"2.0",id:r,method:t}:{jsonrpc:"2.0",id:r,method:t,params:i}}function Ms(r,t){return t===void 0?{jsonrpc:"2.0",method:r}:{jsonrpc:"2.0",method:r,params:t}}function ct(r,t){return{jsonrpc:"2.0",id:r,result:t}}function Ye(r,t){return{jsonrpc:"2.0",id:r,error:t}}var Xt=class extends Error{code;data;constructor(t){super(`JSON-RPC error code=${t.code} ${t.message}`),this.name="RemoteRpcError",this.code=t.code,t.data!==void 0&&(this.data=t.data)}},F={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 Zt(r){return"method"in r&&"id"in r&&r.id!==void 0}function Bs(r){return"method"in r&&!("id"in r)}function Qt(r){return!("method"in r)&&"id"in r}var Sa={AGENT_NOT_FOUND:F.AGENT_NOT_FOUND,AGENT_BUSY:F.AGENT_BUSY,AGENT_DISCONNECTED:F.AGENT_DISCONNECTED,AGENT_TIMEOUT:F.AGENT_TIMEOUT,AGENT_SPAWN_FAILED:F.AGENT_SPAWN_FAILED,AGENT_PROTOCOL_ERROR:F.INTERNAL_ERROR,BRIDGE_CONFIG_INVALID:F.INTERNAL_ERROR,BRIDGE_INTERNAL:F.INTERNAL_ERROR,IPC_AUTH_FAILED:F.INTERNAL_ERROR,IPC_BAD_REQUEST:F.INVALID_REQUEST,MODEL_SWITCHING:F.MODEL_SWITCHING,MODEL_SWITCH_FAILED:F.MODEL_SWITCH_FAILED,OPERATION_NOT_ALLOWED_FOR_LOCAL:F.OPERATION_NOT_ALLOWED_FOR_LOCAL,UPSTREAM_DISCONNECTED:F.INTERNAL_ERROR,UPSTREAM_HANDSHAKE_FAILED:F.INTERNAL_ERROR};function $t(r){return r instanceof A?{code:Sa[r.code]??F.INTERNAL_ERROR,message:r.message,data:{bridgeCode:r.code,retriable:r.retriable}}:{code:F.INTERNAL_ERROR,message:r instanceof Error?r.message:String(r)}}function zs(r){let t=r.data,i=t?.bridgeCode??"AGENT_PROTOCOL_ERROR";return new A(i,r.message,{retriable:t?.retriable??!1,cause:r.data})}function qs(r){return`${JSON.stringify(r)}
|
|
89
|
+
`}var en=class{buffer="";onError;constructor(t={}){this.onError=t.onError}push(t){this.buffer+=typeof t=="string"?t:t.toString("utf8");let i=this.buffer.split(`
|
|
90
|
+
`);this.buffer=i.pop()??"";let a=[];for(let c of i){let f=c.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 t=this.buffer.replace(/\r$/,"").trim();if(this.buffer="",!t)return[];try{return[JSON.parse(t)]}catch(i){return this.onError?.({line:t,error:i}),[]}}};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"},qu=Object.fromEntries(Object.entries(Us).map(([r,t])=>[t,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:[]},ft=class{seq=0;next(t,i){this.seq+=1;let a=Us[t]??Ea(t),c=Ca[a]??[],f=[a,String(this.seq)];if(c.length>0){let d=c.map(m=>Fs(i?.[m]??"")),p=Aa(d).join(":");p&&f.push(p)}else i&&Object.values(i).some(d=>d)&&f.push(Object.values(i).filter(Boolean).map(d=>Fs(String(d))).join(":"));return f.join("_")}reset(){this.seq=0}};function Ea(r){return r.replace(/[\s/]+/g,".").replace(/_+/g,"-")}function Fs(r){return r.replace(/[:_\s]+/g,"-")}function Aa(r){let t=r.length;for(;t>0&&!r[t-1];)t-=1;return r.slice(0,t)}q();var Da=3e4;function Hs(r,t){if(!(typeof r!="number"||r<=0))try{process.platform==="win32"?process.kill(r,t):process.kill(-r,t)}catch{}}var Ue=class{constructor(t){this.opts=t;this.log=N(`downstream.${this.constructor.name}`),this.decoder=new en({onError:i=>this.log.warn("decode line failed",{line:i.line})})}opts;child;decoder;pending=new Map;idAllocator=new ft;updateHandlers=[];agentRequestHandlers=[];exitHandlers=[];log;stopped=!1;sanitizeEnv(t){return t}async start(){if(this.child)throw new A("BRIDGE_INTERNAL","Downstream already started");let t=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:t});this.child=i,i.stdout?.setEncoding("utf8"),i.stdout?.on("data",a=>{for(let c of this.decoder.push(a))this.dispatch(c)}),i.stderr?.setEncoding("utf8"),i.stderr?.on("data",a=>{this.log.debug("stderr",{text:a.trimEnd()})}),i.on("exit",(a,c)=>{this.stopped=!0,this.failAllPending(new A("AGENT_PROTOCOL_ERROR",`agent exited (${a}/${c})`));for(let f of this.exitHandlers)f(a,c)}),i.on("error",a=>{this.log.error("child error",{err:String(a)}),this.failAllPending(new A("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(t){if(!this.child||this.stopped)return;this.stopped=!0,this.log.info("downstream stopping",{reason:t});let i=this.child,a=new Promise(f=>i.once("exit",()=>f()));Hs(i.pid,"SIGTERM");let c=setTimeout(()=>{i.killed||Hs(i.pid,"SIGKILL")},5e3);try{await a}finally{clearTimeout(c)}}pid(){return this.child?.pid}isAlive(){return!!this.child&&!this.stopped}initialize(t){return this.call("initialize",t)}sessionNew(t){return this.call("session/new",{mcpServers:[],...t})}sessionLoad(t){return this.call("session/load",{mcpServers:[],...t})}sessionPrompt(t){return this.call("session/prompt",t,0)}async sessionCancel(t){if(!this.child||this.stopped)return;let i=this.idAllocator.next("session/cancel");this.writeFrame(xt(i,"session/cancel",t))}onUpdate(t){this.updateHandlers.push(t)}onAgentRequest(t){this.agentRequestHandlers.push(t)}respondAgentRequest(t,i){if(!(!this.child||this.stopped))try{this.writeFrame(ct(t,i))}catch(a){this.log.warn("respondAgentRequest write failed",{id:t,err:String(a)})}}respondAgentRequestError(t,i){if(!(!this.child||this.stopped))try{this.writeFrame(Ye(t,i))}catch(a){this.log.warn("respondAgentRequestError write failed",{id:t,err:String(a)})}}onExit(t){this.exitHandlers.push(t)}call(t,i,a=Da){if(!this.child||this.stopped)return Promise.reject(new A("AGENT_PROTOCOL_ERROR","downstream not started"));let c=this.idAllocator.next(t),f=xt(c,t,i),d=a>0&&Number.isFinite(a);return new Promise((p,m)=>{let _=d?setTimeout(()=>{this.pending.delete(c),m(new A("AGENT_TIMEOUT",`${t} timed out after ${a}ms`))},a):null;this.pending.set(c,{resolve:p,reject:m,timer:_,method:t});try{this.writeFrame(f)}catch(b){_&&clearTimeout(_),this.pending.delete(c),m(b)}})}writeFrame(t){if(!this.child?.stdin||this.child.stdin.destroyed)throw new A("AGENT_PROTOCOL_ERROR","downstream stdin not writable");this.child.stdin.write(qs(t))}dispatch(t){if(Qt(t)){let i=t.id!==null?this.pending.get(t.id):void 0;if(!i){this.log.warn("orphan response",{id:t.id});return}this.pending.delete(t.id),i.timer&&clearTimeout(i.timer),t.error?i.reject(zs(t.error)):i.resolve(t.result);return}if(Bs(t)){if(t.method==="session/update")for(let i of this.updateHandlers)Promise.resolve(i(t.params)).catch(a=>this.log.warn("update handler failed",{err:String(a)}));else this.log.debug("unknown notification",{method:t.method});return}if(Zt(t)){let i=t;this.handleAgentRequest(i).catch(a=>this.log.error("agent request handler failed",{method:i.method,err:String(a)}))}}async handleAgentRequest(t){if(this.agentRequestHandlers.length===0){this.writeFrame(Ye(t.id,{code:-32601,message:`method not handled by Bridge: ${t.method}`}));return}for(let i of this.agentRequestHandlers)try{await i(t)}catch(a){this.log.error("agentRequestHandler threw",{method:t.method,err:String(a)});try{this.writeFrame(Ye(t.id,$t(a)))}catch{}}}failAllPending(t){for(let i of this.pending.values())i.timer&&clearTimeout(i.timer),i.reject(t);this.pending.clear()}};var Pa="@zed-industries/claude-code-acp@latest";function Ta(r){let t={};for(let[i,a]of Object.entries(r))a!==void 0&&(i.startsWith("CLAUDE")||i==="AI_AGENT"||i==="BAGGAGE"||(t[i]=a));return t}var tn=class extends Ue{framework="claude-code";constructor(t){let i=t.command??"npx",a=t.args??["-y",Pa],c={command:i,args:a,cwd:t.cwd,...t.env?{env:t.env}:{}};super(c)}sanitizeEnv(t){return Ta(t)}};var Ia="@zed-industries/codex-acp@latest",nn=class extends Ue{framework="codex";constructor(t){let i=t.command??"npx",a=t.args??["-y",Ia],c=t.extraArgs?[...a,...t.extraArgs]:a,f={command:i,args:c,cwd:t.cwd,...t.env?{env:t.env}:{}};super(f)}};import{spawn as js}from"node:child_process";q();var rn=class extends Ue{framework="openclaw";registerLog;profile;agentId;sessionName;registered=!1;constructor(t){let i=t.profile??"coze",a=t.sessionName??"default",c=["--profile",i,"acp","--session",`agent:${t.agentId}:${a}`],f={command:t.command,args:c,cwd:t.cwd,...t.env?{env:t.env}:{}};super(f),this.profile=i,this.agentId=t.agentId,this.sessionName=a,this.registerLog=N("downstream.openclaw.register")}async start(){await this.registerAgent().catch(t=>{this.registerLog.warn("openclaw agents add failed (will continue to acp anyway)",{agentId:this.agentId,err:String(t)})}),await super.start()}registerAgent(){return new Promise((t,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}}),c="";a.stderr?.on("data",f=>{c+=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}),t()):i(new A("AGENT_SPAWN_FAILED",`openclaw agents add ${this.agentId} exited ${f}: ${c.trim()}`))})})}async cleanup(t){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}}),c="";a.stderr?.on("data",f=>{c+=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:c.trim()}),this.registered=!1,i()})})}get acpSessionName(){return this.sessionName}};q();ae();var sn=class{slots=[];running=!1;closed=!1;disposed=!1;enqueue(t){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:t,resolve:i,reject:a}),this.drain()})}close(){this.closed=!0}dispose(t=new Error("AsyncQueue disposed")){for(this.disposed=!0,this.closed=!0;this.slots.length>0;)this.slots.shift()?.reject(t)}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 t=this.slots.shift();if(!t)break;try{let i=await t.task();t.resolve(i)}catch(i){t.reject(i)}}}finally{this.running=!1}}}};var on=class{agentId;framework;workspace;msgQueue;sessions=new Map;verifiedSessions=new Set;activeTriggers=new Map;status="starting";lastActiveAt=Date.now();_downstream;constructor(t){this.agentId=t.agentId,this.framework=t.framework,this.workspace=t.workspace,this._downstream=t.downstream,this.msgQueue=new sn}get downstream(){return this._downstream}swap(t){this._downstream=t,this.verifiedSessions.clear(),this.activeTriggers.clear()}async dispose(t){this.status="stopped",this.msgQueue.dispose(new Error(`AgentSession disposed${t?`: ${t}`:""}`)),await this._downstream.stop(t)}};var j=N("agent-manager"),Na=(r,t,i,a,c)=>{switch(r){case"claude-code":{let f=c?Es(c):void 0;return new tn({cwd:i,...f&&Object.keys(f).length>0?{env:f}:{}})}case"codex":{let f=c?As(c):[],d=c?ks(c):void 0;return new nn({cwd:i,...f.length>0?{extraArgs:f}:{},...d&&Object.keys(d).length>0?{env:d}:{}})}case"openclaw":return new rn({command:t,cwd:i,agentId:a})}},Ra=[0,5e3,5e3],Oa=2e4,Ks={protocolVersion:1,clientCapabilities:{fs:{readTextFile:!0,writeTextFile:!0}}},an=class{paths;config;registry;factory;restartDelaysMs;createTimeoutMs;healthReporter;constructor(t){this.paths=t.paths,this.config=t.config,this.registry=t.registry,this.factory=t.downstreamFactory??Na,this.restartDelaysMs=t.restartDelaysMs??Ra,this.createTimeoutMs=t.createTimeoutMs??Oa,this.healthReporter=t.healthReporter}async createAgent(t){if(!t.agentId)throw new A("IPC_BAD_REQUEST","agentId required");if(!t.framework)throw new A("IPC_BAD_REQUEST","framework required");this.registry.reviveIfDisconnected?.(t.agentId);let i=this.registry.get(t.agentId);if(i){if(i.framework!==t.framework)throw new A("AGENT_BUSY",`agent ${t.agentId} exists with different framework (${i.framework})`);if(i.status==="error")j.warn("existing agent in error state, rebuilding",{agentId:t.agentId}),await i.dispose("rebuild after error").catch(m=>j.warn("dispose stale agent failed (ignored)",{err:String(m)})),this.registry.unregister(t.agentId);else return j.info("agent already exists,return current",{agentId:t.agentId}),{ok:!0,agentId:i.agentId,workspace:i.workspace,pid:i.downstream.pid()??0,framework:i.framework}}let a=this.config.frameworksCache?.[t.framework];if(!a)throw new A("AGENT_SPAWN_FAILED",`framework ${t.framework} not detected on this machine; rerun daemon to refresh frameworks_cache`);let c=Pe(t.agentId,this.paths),f=t.workspace??c.workspace,d=new AbortController,p=setTimeout(()=>d.abort(new A("AGENT_TIMEOUT",`_agent/create timed out after ${this.createTimeoutMs}ms`)),this.createTimeoutMs);try{return await this.createAgentInner(t,c,f,a,d.signal)}finally{clearTimeout(p)}}async createAgentInner(t,i,a,c,f){let d=()=>{if(f.aborted)throw f.reason instanceof Error?f.reason:new A("AGENT_TIMEOUT","_agent/create aborted")},p,m,_=!1;try{await ar(i.root,{recursive:!0}),await ar(a,{recursive:!0}),await ar(i.logs,{recursive:!0}),d(),t.framework!=="openclaw"&&await Je(a,t.framework,t.agentId,t.cozeIdentity),d();let b=await ie(t.agentId,this.paths).catch(()=>null),y=or({model:t.model??b?.model,modelToken:t.modelToken??b?.modelToken});if(p=this.factory(t.framework,c.path,a,t.agentId,y),await p.start(),d(),await p.initialize(Ks),d(),t.framework==="openclaw"&&await Je(a,"openclaw",t.agentId,t.cozeIdentity),m=new on({agentId:t.agentId,framework:t.framework,workspace:a,downstream:p}),m.status="ok",b?.sessions){for(let[L,R]of Object.entries(b.sessions))m.sessions.set(L,R);Object.keys(b.sessions).length>0&&j.info("restored persisted sessions for agent",{agentId:t.agentId,count:Object.keys(b.sessions).length})}this.registry.register(m),_=!0;let k={agentId:t.agentId,framework:t.framework,workspace:a,cozeIdentity:t.cozeIdentity,createdAt:b?.createdAt??Date.now(),sessions:b?.sessions??{},model:y.model};y.modelToken&&(k.modelToken=y.modelToken),b?.skills&&(k.skills=b.skills),b?.agentName&&(k.agentName=b.agentName),b?.description&&(k.description=b.description),await fe(k,this.paths);let I=p.pid()??0;return j.info("agent created",{agentId:t.agentId,framework:t.framework,pid:I}),this.installRestartHook(m),{ok:!0,agentId:t.agentId,workspace:a,pid:I,framework:t.framework}}catch(b){throw j.error("agent create failed,rolling back",{agentId:t.agentId,err:String(b)}),p?.cleanup&&await p.cleanup("rollback").catch(y=>j.warn("downstream cleanup failed (ignored)",{err:String(y)})),p&&await p.stop("rollback").catch(()=>{}),_&&m&&(await m.dispose("rollback").catch(()=>{}),this.registry.unregister(t.agentId)),await La(i.root,{recursive:!0,force:!0}).catch(y=>j.warn("rm agent dir failed (ignored)",{err:String(y)})),b instanceof A?b:new A("AGENT_SPAWN_FAILED",String(b),{cause:b})}}async reportHealth(t,i,a){if(!this.healthReporter){j.info("healthReporter not wired, skip _agent/health upstream",{agentId:t.agentId,status:i});return}try{await this.healthReporter({status:i,_meta:{cozeAgentId:t.agentId}}),j.info("_agent/health reported",{agentId:t.agentId,status:i,cause:a})}catch(c){j.warn("_agent/health upstream failed (ignored)",{agentId:t.agentId,status:i,err:String(c)})}}installRestartHook(t){let i=0,a=c=>{if(t.status==="stopped"||t.status==="disconnected"||t.status==="switching")return;if(i>=this.restartDelaysMs.length){j.error("agent restart exhausted",{agentId:t.agentId,attempts:i,...c}),t.status="error",this.reportHealth(t,"error",c);return}let f=this.restartDelaysMs[i]??5e3;i+=1,t.status="degraded",j.warn("agent restart scheduled",{agentId:t.agentId,attempt:i,delayMs:f,...c}),setTimeout(()=>{this.doRestart(t,i).then(d=>{d?(i=0,t.status="ok"):a(null)})},f)};t.downstream.onExit((c,f)=>a({code:c,signal:f}))}async spawnAndInitialize(t,i){let a=await ie(t.agentId,this.paths).catch(()=>null),c=a?or(a):void 0,f=this.factory(t.framework,i,t.workspace,t.agentId,c);try{return await f.start(),await f.initialize(Ks),f}catch(d){throw await f.stop("spawnAndInitialize failed").catch(()=>{}),d}}rewireSession(t,i){t.swap(i),this.registry.attachHooks?.(t),this.installRestartHook(t)}async doRestart(t,i){let a=this.config.frameworksCache?.[t.framework];if(!a)return j.error("framework cache missing during restart",{agentId:t.agentId,framework:t.framework}),t.status="error",!1;j.info("agent restart attempt",{agentId:t.agentId,attempt:i});try{let c=await this.spawnAndInitialize(t,a.path);return this.rewireSession(t,c),j.info("agent restart succeeded",{agentId:t.agentId,attempt:i}),!0}catch(c){return j.warn("agent restart attempt failed",{agentId:t.agentId,attempt:i,err:String(c)}),!1}}async executeModelSwitch(t){let i=this.registry.get(t);if(!i)throw new A("AGENT_NOT_FOUND",`agent not found: ${t}`);let a=this.config.frameworksCache?.[i.framework];if(!a)throw new A("AGENT_SPAWN_FAILED",`framework ${i.framework} not detected; cannot respawn for switchModel`);j.info("executeModelSwitch: stopping old downstream",{agentId:t,framework:i.framework}),await i.downstream.stop("switchModel").catch(d=>{j.warn("stop old downstream failed (ignored, continuing)",{agentId:t,err:String(d)})});let c;try{c=await this.spawnAndInitialize(i,a.path)}catch(d){throw new A("MODEL_SWITCH_FAILED",`failed to spawn new downstream after switchModel: ${d instanceof Error?d.message:String(d)}`,{cause:d})}this.rewireSession(i,c);let f=[...i.sessions.entries()];for(let[d,p]of f)try{await c.sessionLoad({sessionId:p,cwd:i.workspace}),i.verifiedSessions.add(p)}catch(m){throw new A("MODEL_SWITCH_FAILED",`sessionLoad failed after switchModel for cloud session ${d} (acp=${p}): ${m instanceof Error?m.message:String(m)}`,{cause:m})}f.length>0&&j.info("executeModelSwitch: session/load reloaded",{agentId:t,count:f.length}),i.status="ok",j.info("executeModelSwitch: success",{agentId:t,framework:i.framework})}};q();import{spawn as Ma}from"node:child_process";import{constants as Gs,access as Ba}from"node:fs/promises";import{delimiter as za,join as qa}from"node:path";var Fa=N("framework-detector"),Ws={"claude-code":"claude",codex:"codex",openclaw:"openclaw"},Ua=[".exe",".cmd",".bat",".ps1"],Ct=class{env;constructor(t={}){this.env={pathEnv:t.pathEnv??process.env.PATH??"",platform:t.platform??process.platform,spawn:t.spawn??Ma,access:t.access??Ba}}async detect(t){let i=Ws[t],a=await this.which(i);if(!a)return Fa.debug("framework binary not found",{framework:t,bin:i}),null;let c=await this.probeVersion(a);return{path:a,version:c}}async detectAll(){let t=await Promise.all(Object.keys(Ws).map(async a=>[a,await this.detect(a)])),i={};for(let[a,c]of t)c&&(i[a]=c);return i}async which(t){let i=this.env.pathEnv.split(za).filter(Boolean),a=this.env.platform==="win32"?["",...Ua]:[""];for(let c of i)for(let f of a){let d=qa(c,t+f);if(await this.isExecutable(d))return d}return null}async isExecutable(t){try{let i=this.env.platform==="win32"?Gs.F_OK:Gs.X_OK;return await this.env.access(t,i),!0}catch{return!1}}async probeVersion(t){return new Promise(i=>{let a="",c=!1,f,d=p=>{c||(c=!0,f&&clearTimeout(f),i(p.trim()||"unknown"))};try{let p=this.env.spawn(t,["--version"],{stdio:["ignore","pipe","pipe"]});f=setTimeout(()=>{p.kill("SIGKILL"),d("unknown")},5e3),p.stdout?.on("data",m=>{a+=m.toString("utf8")}),p.on("error",()=>d("unknown")),p.on("close",()=>{let m=ja(a).split(/\r?\n/)[0]??"";d(m)})}catch{d("unknown")}})}},Ha=new RegExp("\x1B\\[[0-9;]*[A-Za-z]","g");function ja(r){return r.replace(Ha,"")}rr();ae();function xn(r){return zt(r??H().configFile)}function Et(r,t){return qt(t??H().configFile,r)}Fe();q();var X=N("core"),Ka=5*6e4,Ga=3e4,cn=class{upstream;agents=new Map;disconnectedAgents=new Set;extensions;paths;upstreamIds=new ft;pendingUpstream=new Map;pendingBridge=new Map;constructor(t){this.upstream=t.upstream,this.extensions=t.extensions??{},this.paths=t.paths}registerExtension(t,i){this.extensions[t]=i}async start(){this.upstream.onFrame(t=>this.handleFrame(t)),await this.upstream.start(),X.info("Core started",{extensions:Object.keys(this.extensions)})}async stop(t){X.info("Core stopping",{reason:t}),await Promise.all([...this.agents.values()].map(i=>i.dispose(t))),this.agents.clear(),await this.upstream.stop(t)}get(t){return this.agents.get(t)}register(t){this.agents.set(t.agentId,t),this.attachDownstreamHooks(t),X.info("agent registered",{agentId:t.agentId,framework:t.framework});for(let i of this.registerHandlers)try{i(t.agentId)}catch(a){X.warn("onAgentRegister handler threw (ignored)",{agentId:t.agentId,err:String(a)})}}onAgentRegister(t){return this.registerHandlers.add(t),()=>this.registerHandlers.delete(t)}registerHandlers=new Set;unregister(t){this.agents.delete(t)}reviveIfDisconnected(t){this.disconnectedAgents.delete(t)&&X.info("agent revived from disconnect",{agentId:t})}attachDownstreamHooks(t){t.downstream.onUpdate(i=>{this.forwardUpdate(t,i)}),t.downstream.onAgentRequest(i=>{this.handleAgentRequest(t,i)}),t.downstream.onExit((i,a)=>{X.warn("agent downstream exited",{agentId:t.agentId,code:i,signal:a})})}attachHooks(t){this.attachDownstreamHooks(t)}async handleFrame(t){if(Qt(t)){this.handleUpstreamResponse(t);return}if(Zt(t))try{if(t.method.startsWith("_agent/")){let i=this.extensions[t.method];if(!i){await this.sendError(t.id,F.METHOD_NOT_FOUND,`extension not registered: ${t.method}`);return}let a=await i(t,this);await this.upstream.send(ct(t.id,a));return}if(t.method.startsWith("session/")){let i=await this.routeSessionMethod(t);await this.upstream.send(ct(t.id,i));return}if(t.method==="initialize"){await this.upstream.send(ct(t.id,{protocolVersion:1,agentCapabilities:{loadSession:!0}}));return}await this.sendError(t.id,F.METHOD_NOT_FOUND,`method not implemented: ${t.method}`)}catch(i){X.error("handleFrame failed",{method:t.method,err:String(i)}),await this.upstream.send(Ye(t.id,$t(i)))}}async routeSessionMethod(t){if(!t.params||typeof t.params!="object")throw new A("IPC_BAD_REQUEST",`${t.method} requires params`);let i=t.params,a=i._meta?.cozeAgentId;if(!a)throw new A("IPC_BAD_REQUEST",`${t.method}: missing _meta.cozeAgentId`);let c=this.agents.get(a);if(!c)throw this.disconnectedAgents.has(a)?new A("AGENT_DISCONNECTED",`agent ${a} has been disconnected; cloud must _agent/create to revive`):new A("AGENT_NOT_FOUND",`agent not found: ${a}`);if(c.status==="switching")throw new A("MODEL_SWITCHING",`agent ${a} is switching model; retry later`,{retriable:!0});let f=Date.now(),d=!1;try{let p=await c.msgQueue.enqueue(()=>this.dispatchSessionCall(c,t.method,i));return d=!0,p}finally{X.info("session call done",{agentId:c.agentId,method:t.method,durationMs:Date.now()-f,ok:d})}}async dispatchSessionCall(t,i,a){t.lastActiveAt=Date.now();let{stripped:c}=vs(a);switch(i){case"session/new":{let f=c;return await t.downstream.sessionNew({...f,cwd:f.cwd||t.workspace})}case"session/load":{let f=c,d=f.sessionId,p=t.sessions.get(d);try{let m=p??d,_=await t.downstream.sessionLoad({...f,sessionId:m,cwd:f.cwd||t.workspace});return p||t.sessions.set(d,m),_}catch(m){X.warn("session/load failed,fallback to session/new",{agentId:t.agentId,cloudId:d,err:String(m)});let _=await t.downstream.sessionNew({cwd:f.cwd||t.workspace});return t.sessions.set(d,_.sessionId),{}}}case"session/prompt":{let f=c,d=f.sessionId,p=t.sessions.get(d),m=!1;if(p&&!t.verifiedSessions.has(p))try{await t.downstream.sessionLoad({sessionId:p,cwd:t.workspace}),t.verifiedSessions.add(p),X.info("session restored via session/load",{agentId:t.agentId,cloudId:d,acpId:p})}catch(y){X.warn("session/load failed,fallback to session/new",{agentId:t.agentId,cloudId:d,acpId:p,err:String(y)}),t.sessions.delete(d),p=void 0}p||(p=(await t.downstream.sessionNew({cwd:t.workspace})).sessionId,t.sessions.set(d,p),t.verifiedSessions.add(p),m=!0);let _=a._meta?.cozeTriggerMsgId;_?t.activeTriggers.set(p,_):t.activeTriggers.delete(p);let b=await t.downstream.sessionPrompt({...f,sessionId:p});return m&&this.persistSessionMapping(t),b}case"session/cancel":{let d=c.sessionId;if(!d)throw new A("IPC_BAD_REQUEST","session/cancel: missing sessionId");let p=t.sessions.get(d);return p&&await t.downstream.sessionCancel({sessionId:p}),{ok:!0}}default:throw new A("IPC_BAD_REQUEST",`session method not supported: ${i}`)}}forwardUpdate(t,i){let a=i.sessionId,c=this.reverseSessionId(t,a);if(!c){X.debug("drop update for unknown session",{agentId:t.agentId,acpId:a});return}let f={cozeAgentId:t.agentId},d=t.activeTriggers.get(a);d&&(f.cozeTriggerMsgId=d),this.upstream.send(Ms("session/update",{...i,sessionId:c,_meta:f})).catch(p=>X.warn("forward update failed",{agentId:t.agentId,err:String(p)}))}handleAgentRequest(t,i){if(i.method==="session/request_permission"){this.forwardPermissionRequest(t,i);return}X.warn("unhandled agent request,returning method_not_found",{agentId:t.agentId,method:i.method}),t.downstream.respondAgentRequestError(i.id,{code:F.METHOD_NOT_FOUND,message:`method not handled by Bridge: ${i.method}`})}forwardPermissionRequest(t,i){let a=this.upstreamIds.next("session/request_permission"),c=i.params??{},d=c.sessionId,p=d?t.activeTriggers.get(d):void 0,m={cozeAgentId:t.agentId};p&&(m.cozeTriggerMsgId=p);let _=d?this.reverseSessionId(t,d):void 0,b={...c,..._?{sessionId:_}:{},_meta:m},y=setTimeout(()=>{let k=this.pendingUpstream.get(a);k&&(this.pendingUpstream.delete(a),X.warn("upstream permission request timed out,replying cancelled to agent",{agentId:t.agentId,upstreamId:a}),t.downstream.respondAgentRequest(k.agentRequestId,{outcome:{kind:"cancelled"}}))},Ka);this.pendingUpstream.set(a,{agentRequestId:i.id,session:t,method:i.method,timer:y}),this.upstream.send(xt(a,"session/request_permission",b)).catch(k=>{let I=this.pendingUpstream.get(a);I&&(clearTimeout(I.timer),this.pendingUpstream.delete(a)),X.error("forward permission request failed",{agentId:t.agentId,err:String(k)}),t.downstream.respondAgentRequestError(i.id,{code:F.INTERNAL_ERROR,message:`upstream send failed: ${String(k)}`})})}handleUpstreamResponse(t){if(t.id===null)return;let i=this.pendingUpstream.get(t.id);if(i){this.pendingUpstream.delete(t.id),clearTimeout(i.timer),t.error?i.session.downstream.respondAgentRequestError(i.agentRequestId,t.error):i.session.downstream.respondAgentRequest(i.agentRequestId,t.result);return}let a=this.pendingBridge.get(t.id);if(a){this.pendingBridge.delete(t.id),clearTimeout(a.timer),t.error?a.reject(new Xt(t.error)):a.resolve(t.result);return}X.debug("orphan upstream response (no pending)",{id:t.id})}sendRequest(t,i,a=Ga){let c=this.upstreamIds.next(t);return new Promise((f,d)=>{let p=setTimeout(()=>{this.pendingBridge.delete(c),d(new A("AGENT_TIMEOUT",`${t} timed out after ${a}ms`))},a);this.pendingBridge.set(c,{method:t,resolve:f,reject:d,timer:p}),this.upstream.send(xt(c,t,i)).catch(m=>{let _=this.pendingBridge.get(c);_&&(clearTimeout(_.timer),this.pendingBridge.delete(c)),d(m)})})}async persistSessionMapping(t){if(this.paths)try{await ir(t.agentId,t.sessions,this.paths)}catch(i){X.warn("persist session mapping failed",{agentId:t.agentId,err:String(i)})}}reverseSessionId(t,i){for(let[a,c]of t.sessions.entries())if(c===i)return a}sendError(t,i,a){return this.upstream.send(Ye(t,{code:i,message:a}))}};q();ae();import{randomBytes as Wa}from"node:crypto";import{chmod as Ja,mkdir as Va,writeFile as Js}from"node:fs/promises";import{createServer as Ya}from"node:http";import{dirname as Xa}from"node:path";var Za=1e6,xr=N("ipc"),fn=class{server=null;port=0;token="";routes;paths;constructor(t){this.routes=new Map(t.routes.map(i=>[`${i.method} ${i.path}`,i])),this.paths=t.paths??H()}async start(){this.token=Wa(32).toString("hex");let t=Ya((a,c)=>{this.dispatch(a,c)});this.server=t,await new Promise((a,c)=>{t.once("error",c),t.listen(0,"127.0.0.1",()=>a())});let i=t.address();if(!i||typeof i!="object")throw new Error("failed to obtain IPC port");return this.port=i.port,await this.persistAuthFiles(),xr.info("IPC listening",{port:this.port}),{port:this.port,token:this.token}}async stop(){let t=this.server;t&&(await new Promise((i,a)=>{t.close(c=>c?a(c):i())}),this.server=null)}async persistAuthFiles(){await Va(Xa(this.paths.portFile),{recursive:!0}),await Js(this.paths.portFile,String(this.port),"utf8"),await Js(this.paths.tokenFile,this.token,"utf8");try{await Ja(this.paths.tokenFile,384)}catch(t){xr.warn("chmod token file failed (non-POSIX?)",{err:String(t)})}}async dispatch(t,i){if(t.headers.authorization!==`Bearer ${this.token}`){At(i,401,{error:"unauthorized"});return}let c=`${t.method} ${(t.url??"").split("?")[0]}`,f=this.routes.get(c);if(!f){At(i,404,{error:"not found"});return}let d=null;if(t.method==="POST")try{d=await Qa(t)}catch(p){At(i,400,{error:"invalid json",detail:String(p)});return}try{let p=await f.handler(d,t);At(i,200,p??{ok:!0})}catch(p){xr.error("IPC handler failed",{key:c,err:String(p)}),At(i,500,{error:p instanceof Error?p.message:String(p)})}}};function At(r,t,i){r.statusCode=t,r.setHeader("content-type","application/json"),r.end(JSON.stringify(i))}async function Qa(r){let t=[],i=0;for await(let c of r){let f=c;if(i+=f.length,i>Za)throw new Error("body too large");t.push(f)}let a=Buffer.concat(t).toString("utf8");return a?JSON.parse(a):null}var yo=De(si(),1);var Nc=De($i(),1),Rc=De(An(),1),Oc=De(lt(),1),Mc=De(br(),1),Bc=De(Cr(),1),zc=De(Tr(),1),xo=De(Tn(),1),qc=De(ao(),1);var co=xo.default;q();var Ln="1008033",fo="1289";var uo="pbbp2",lo="https://www.coze.cn",ho="/api/coze_claw/resource/get_frontier_key",Fc="https://www.coze.cn",Uc="wss://frontier.coze.cn";function go(r){return r??process.env.COZE_BRIDGE_HANDSHAKE_URL??Fc}function po(r){return r??process.env.COZE_BRIDGE_FRONTIER_URL??Uc}function Nn(r){let t={},i=r?.ttEnv??process.env.COZE_BRIDGE_TT_ENV,a=r?.usePpe??process.env.COZE_BRIDGE_USE_PPE;return i&&(t["x-tt-env"]=i),a&&(t["x-use-ppe"]=a),t}var ne=N("upstream.frontier"),_o="application/json",wo="none",Rn=class{constructor(t){this.opts=t}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 t={Authorization:`Bearer ${this.opts.privatecode}`,Origin:lo,...Nn(this.opts.ppeOverride)};class i extends co{constructor(p){super(p,uo,{headers:t})}send(p,...m){if(ws("debug"))try{let _;typeof p=="string"?_=Buffer.from(p,"utf8"):p instanceof Buffer?_=p:p instanceof ArrayBuffer?_=new Uint8Array(p):ArrayBuffer.isView(p)?_=new Uint8Array(p.buffer,p.byteOffset,p.byteLength):_=new Uint8Array(0);let b=Buffer.from(_.slice(0,128)).toString("hex");ne.debug("WS raw frame out",{bytes:_.byteLength,headHex:b})}catch(_){ne.warn("WS raw frame dump failed",{err:String(_)})}super.send(p,...m)}}let a=po(this.opts.urlOverride),c={url:a,ws:i,fpID:fo,aID:Ln,accessKey:this.opts.handshake.accessKey,deviceID:this.opts.handshake.deviceId,payloadType:{type:_o,force:!0},payloadEncoding:{encoding:wo,force:!0},enableTransformTextPayload:!0,enableQoS:!1,enableAutoAck:!1,automaticOpen:!1,debug:this.opts.debug??!1},f=new yo.FWS(c);f.onopen=()=>{this.opened=!0,this.openCount+=1;let d=this.openCount===1;ne.info("frontier opened",{url:a,remoteDeviceId:this.opts.handshake.deviceId,initial:d,openCount:this.openCount}),this.connectHandler&&Promise.resolve(this.connectHandler({initial:d})).catch(p=>ne.warn("onConnect handler threw (ignored)",{err:String(p)}))},f.onclose=d=>{this.opened=!1,ne.info("frontier closed",{code:d.code,reason:d.reason,willReconnect:d.willReconnect})},f.onerror=d=>{ne.warn("frontier error",{code:d.code,msg:d.message})},f.onmessage=d=>this.handleMessage(d),this.fws=f,await f.connect()}async stop(t){let i=this.fws;if(i){this.fws=null,this.opened=!1;try{i.close(1e3,t??"bridge shutdown")}catch(a){ne.warn("frontier close threw (ignored)",{err:String(a)})}}}async send(t){let i=this.fws;if(!i)throw new A("UPSTREAM_DISCONNECTED","frontier upstream not started");let a=JSON.stringify(t),c=t;ne.info("frontier frame out",{method:c.method,jsonrpcId:c.id,size:a.length});try{await i.send(a,{service:33555712,method:1,payloadType:_o,payloadEncoding:wo})}catch(f){throw new A("UPSTREAM_DISCONNECTED",`frontier send failed: ${String(f)}`,{cause:f})}}onFrame(t){this.handler=t}onConnect(t){this.connectHandler=t}isConnected(){return this.opened&&this.fws?.readyState===1}handleMessage(t){let i=t.message?.service;if(i!==33555712){ne.debug("drop non-adapter frontier frame",{service:i});return}let a=Kc(t);if(!a){ne.debug("frontier message without text payload, drop",{payloadType:t.message?.payloadType});return}if(!this.handler){ne.debug("frame received but no onFrame handler",{size:a.length});return}let c;try{c=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(t.message?.LogID),logidNew:t.message?.LogIDNew,msgId:t.message?.msgID,jsonrpcId:c.id}),Promise.resolve(this.handler(c)).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 Kc(r){let t=r.message;if(t?.textPayload)return t.textPayload;let i=t?.payload;if(!i)return null;try{return Buffer.from(i).toString("utf8")}catch{return null}}q();function vo(r){return r?r.startsWith("boe_")?{ttEnv:r}:{ttEnv:r,usePpe:"1"}:{}}var bo=N("handshake");async function So(r){let t=go(r.endpoint),i=r.timeoutMs??1e4,a=`${Gc(t)}${ho}?aid=${encodeURIComponent(Ln)}`,c={Authorization:`Bearer ${r.privatecode}`,Accept:"application/json",...Nn(r.ppeOverride)},f=new AbortController,d=setTimeout(()=>f.abort(),i);bo.info("frontier key handshake",{base:t});try{let p=await fetch(a,{method:"GET",headers:c,signal:f.signal}),m=p.headers.get("x-tt-logid")??"",_=p.headers.get("x-tt-trace-id")??"";if(!p.ok){let I=await p.text().catch(()=>"");throw new A("UPSTREAM_HANDSHAKE_FAILED",`handshake HTTP ${p.status} logid=${m}: ${I.slice(0,200)}`)}let b=await p.json();if(b.code!==void 0&&b.code!==0)throw new A("UPSTREAM_HANDSHAKE_FAILED",`handshake code=${b.code} msg=${b.msg??"-"} logid=${m}`);let y=b.data?.access_key,k=b.data?.device_id;if(!y||!k)throw new A("UPSTREAM_HANDSHAKE_FAILED",`handshake response missing access_key/device_id logid=${m}: ${JSON.stringify(b)}`);return bo.info("handshake ok",{remoteDeviceId:k,logid:m,traceId:_}),{accessKey:y,deviceId:k}}catch(p){throw p instanceof A?p:p.name==="AbortError"?new A("UPSTREAM_HANDSHAKE_FAILED",`handshake timeout (${i}ms)`):new A("UPSTREAM_HANDSHAKE_FAILED",String(p),{cause:p})}finally{clearTimeout(d)}}function Gc(r){return r.endsWith("/")?r.slice(0,-1):r}q();var Lr=N("upstream.switchable"),On=class{inner;handler=null;connectHandler=null;constructor(t){this.inner=t}async swap(t,i){if(this.inner===t)return;Lr.info("swap upstream",{reason:i});let a=this.inner;this.inner=t,this.handler&&t.onFrame(this.handler),this.connectHandler&&t.onConnect&&t.onConnect(this.connectHandler);try{await t.start()}catch(c){throw Lr.error("swap target start failed, reverting",{err:String(c)}),this.inner=a,c}await a.stop(i??"swapped").catch(c=>Lr.warn("previous upstream stop threw (ignored)",{err:String(c)}))}current(){return this.inner}start(){return this.inner.start()}stop(t){return this.inner.stop(t)}send(t){return this.inner.send(t)}onFrame(t){this.handler=t,this.inner.onFrame(t)}onConnect(t){this.connectHandler=t,this.inner.onConnect?.(t)}isConnected(){return this.inner.isConnected()}};q();var Nr=N("upstream"),Ot=class{handler=null;async start(){Nr.info("NoopUpstream started (M1 skeleton; real Frontier wired in M4)")}async stop(t){Nr.info("NoopUpstream stopped",{reason:t})}async send(t){Nr.debug("NoopUpstream.send (dropped)",{method:"method"in t?t.method:void 0})}onFrame(t){this.handler=t}isConnected(){return!1}async injectFrame(t){this.handler&&await this.handler(t)}};q();ae();q();ae();import{readFileSync as Wc,unlinkSync as Jc}from"node:fs";import{mkdir as Vc,readFile as Co,unlink as Eo,writeFile as Yc}from"node:fs/promises";import{dirname as Xc}from"node:path";var Zc=N("single-instance"),Mn=class{pidFile;acquired=!1;constructor(t={}){this.pidFile=t.pidFile??H().pidFile,t.processTitle&&(process.title=t.processTitle)}async acquire(){let t=await this.readExistingPid();return t!==null&&this.isAlive(t)?{kind:"already-running",pid:t}:(t!==null&&(Zc.warn("removing stale pid file",{stalePid:t}),await Eo(this.pidFile).catch(()=>{})),await Vc(Xc(this.pidFile),{recursive:!0}),await Yc(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 Eo(this.pidFile)}catch{}this.acquired=!1}}async readExistingPid(){try{let t=await Co(this.pidFile,"utf8"),i=Number.parseInt(t.trim(),10);return Number.isFinite(i)&&i>0?i:null}catch(t){if(t.code==="ENOENT")return null;throw t}}isAlive(t){try{return process.kill(t,0),!0}catch(i){return i.code==="EPERM"}}installCleanupHooks(){process.once("exit",()=>{if(this.acquired)try{Wc(this.pidFile,"utf8").trim()===String(process.pid)&&Jc(this.pidFile)}catch{}})}};var B=N("daemon"),Qc="coze-bridge-daemon";async function ko(){let r=new Mn({processTitle:Qc}),t=await r.acquire();if(t.kind==="already-running")throw new Error(`coze-bridge daemon already running (pid=${t.pid})`);let i=await xn(),a=i??{};sr({pid:process.pid}),B.info(i?"loaded bridge config":"initialized bridge config");try{let P=new Ct;a.frameworksCache=await P.detectAll(),B.info("refreshed frameworks_cache",{detected:Object.keys(a.frameworksCache)})}catch(P){B.warn("framework detection failed",{err:String(P)})}await Et(a);let c=new On(new Ot),f=H(),d=new cn({upstream:c,paths:f});await ef(f,d);let p=new an({paths:f,config:a,registry:d,healthReporter:async P=>{await d.sendRequest("_agent/health",P)}}),m,_,b=null,y=null;d.registerExtension("_agent/create",async P=>p.createAgent(P.params)),d.registerExtension("_agent/health",async()=>({ok:!0}));let k=new Vt({agents:d.agents,disposeAndMarkDisconnected:async(P,M)=>{let G=d.agents.get(P);G&&(await G.dispose(`disconnect: ${M}`).catch(Se=>B.warn("dispose during disconnect failed (ignored)",{agentId:P,err:String(Se)})),G.status="disconnected",d.unregister(P)),d.disconnectedAgents.add(P)},executeModelSwitch:P=>p.executeModelSwitch(P)});d.registerExtension("_agent/listSkills",P=>k.listSkills(P.params)),d.registerExtension("_agent/addSkills",P=>k.addSkills(P.params)),d.registerExtension("_agent/removeSkills",P=>k.removeSkills(P.params)),d.registerExtension("_agent/getFileTree",P=>k.getFileTree(P.params)),d.registerExtension("_agent/getFileContent",P=>k.getFileContent(P.params)),d.registerExtension("_agent/update",P=>k.updateAgent(P.params)),d.registerExtension("_agent/disconnect",P=>k.disconnectAgent(P.params)),d.registerExtension("_agent/switchModel",P=>k.switchModel(P.params));let I=new Gt({paths:f,handlers:k,sendDetail:P=>d.sendRequest("_agent/detail",P)});c.onConnect(({initial:P})=>{B.info("frontier upstream connected, triggering detail sync",{initial:P}),I.syncAll(P?"initial-connect":"reconnect").catch(M=>B.warn("detail sync top-level error (ignored)",{err:String(M)}))});let L=new fn({paths:f,routes:[{method:"GET",path:"/status",handler:async()=>({running:!0,pid:process.pid,agents:[...d.agents.keys()],deviceId:b??"",frameworksCache:a.frameworksCache??{}})},{method:"POST",path:"/pair",handler:async P=>{let M=P,G=M?.privatecode,Se=M?.pairing_code;if(!G||!Se)throw new A("IPC_BAD_REQUEST","/pair requires privatecode + pairing_code");let Oe=vo(M.env),pe=M.handshake_url,me=M.frontier_url,le=$c(M.env,pe,me),nt=!!m&&m!==G,Mt=_!==void 0&&_!==le;if(nt||Mt){B.warn("pair config switched, resetting agents",{pcChanged:nt,envChanged:Mt,previousPc:m?Ao(m):"",nextPc:Ao(G),previousEnvKey:_??"",nextEnvKey:le});for(let Ae of[...d.agents.values()])await Ae.dispose("pair config switch").catch(()=>{}),d.agents.delete(Ae.agentId);await c.swap(new Ot,"pair switch").catch(()=>{})}let Bt=await So({privatecode:G,...pe?{endpoint:pe}:{},ppeOverride:Oe});b=Bt.deviceId,sr({deviceId:b,pid:process.pid});let Ce=new Rn({handshake:Bt,privatecode:G,...me?{urlOverride:me}:{},ppeOverride:Oe});await c.swap(Ce,"pair"),m=G,_=le;let Ee=Object.keys(a.frameworksCache??{});try{let Ae=await d.sendRequest("_agent/pair",{pairCode:Se,patToken:G,frameworks:Ee,_meta:{cozeDeviceId:b}});B.info("_agent/pair ok",{pairResult:Ae}),y||(y=new Yt({core:d,getDeviceId:()=>b??""})),y.start();let $;return M.agent_id&&($=await tf(M.agent_id,f,p,Ge=>d.sendRequest("_agent/detail",Ge)).catch(Ge=>(B.error("--agent-id ensureAgent failed",{agentId:M.agent_id,err:String(Ge)}),{ok:!1,agentId:M.agent_id??"",note:String(Ge)}))),{ok:!0,note:"paired with cloud",...$?{agent:$}:{}}}catch(Ae){return B.error("_agent/pair failed",{err:String(Ae)}),{ok:!1,note:`pair failed: ${String(Ae)}`}}}},{method:"POST",path:"/_agent/create",handler:async P=>{let M=P;return{ok:!0,result:await p.createAgent(M)}}},{method:"POST",path:"/refresh",handler:async()=>{B.info("IPC /refresh: re-detecting frameworks");let P=new Ct;return a.frameworksCache=await P.detectAll(),await Et(a),{ok:!0,frameworks:a.frameworksCache}}},{method:"POST",path:"/shutdown",handler:async()=>(B.info("IPC /shutdown received"),setImmediate(()=>{oe.shutdown("ipc /shutdown")}),{ok:!0})}]}),{port:R,token:K}=await L.start();await d.start(),nf(f,p).catch(P=>B.warn("auto-revive top-level error (ignored)",{err:String(P)}));let re=null,oe={port:R,token:K,core:d,ipc:L,shutdown(P){return re||(B.info("daemon shutdown",{reason:P}),re=(async()=>{y?.stop(),await d.stop(P),await L.stop(),await r.release()})(),re)}};for(let P of["SIGTERM","SIGINT"])process.on(P,()=>{oe.shutdown(P).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"}),oe}function Ao(r){return r.length<=8?"***":`${r.slice(0,4)}***${r.slice(-4)}`}function $c(r,t,i){return`${r??""}|${t??""}|${i??""}`}async function ef(r,t){let{readdir:i}=await import("node:fs/promises"),a;try{a=await i(r.agentsRoot)}catch{return}let{loadAgentConfig:c,enforceAgentConfigMode:f}=await Promise.resolve().then(()=>(Fe(),Kt));for(let d of a){await f(d,r).catch(p=>B.warn("enforceAgentConfigMode failed (ignored)",{agentId:d,err:String(p)}));try{let p=await c(d,r);p?.disconnectedAt&&(t.disconnectedAgents.add(d),B.info("agent marked disconnected on startup",{agentId:d,disconnectedAt:p.disconnectedAt,reason:p.disconnectReason??""}))}catch(p){B.warn("failed to load agent config on startup, skipping",{agentId:d,err:String(p)})}}}async function tf(r,t,i,a){let{loadAgentConfig:c}=await Promise.resolve().then(()=>(Fe(),Kt)),f=await c(r,t);if(f){B.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"}}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 A("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 p={agentId:d.agentId,framework:d.framework,...d.cozeIdentity?{cozeIdentity:d.cozeIdentity}:{},...d.model?{model:d.model}:{},...d.modelToken?{modelToken:d.modelToken}:{}};return await i.createAgent(p),{ok:!0,agentId:r,note:"created from cloud detail"}}async function nf(r,t){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:c}=await Promise.resolve().then(()=>(Fe(),Kt));B.info("auto-revive: scanning local agents on startup",{count:a.length});let f=0,d=0;for(let p of a){let m;try{m=await c(p,r)}catch(_){B.warn("auto-revive: load config failed (skipping)",{agentId:p,err:String(_)}),d+=1;continue}if(!m){d+=1;continue}if(m.disconnectedAt){B.info("auto-revive: skip disconnected agent",{agentId:p,disconnectedAt:m.disconnectedAt}),d+=1;continue}try{B.info("auto-revive: spawning",{agentId:p,framework:m.framework}),await t.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(_){B.warn("auto-revive: createAgent failed (skipping)",{agentId:p,framework:m.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}}Or();ae();import{readFile as Po}from"node:fs/promises";var Ke=class{paths;constructor(t){this.paths=t??H()}async probe(t=1e3){let i=await this.readAuth();if(!i)return{kind:"not-running"};try{let a=await this.fetch(i,{method:"GET",path:"/status",timeoutMs:t});return a.status===200?{kind:"connected",...i}:{kind:"stale",reason:`unexpected status ${a.status}`}}catch(a){return{kind:"stale",reason:df(a)}}}async request(t){let i=await this.readAuth();if(!i)throw new Error("coze-bridge daemon not running (no port/token files)");return this.fetch(i,t)}async readAuth(){try{let[t,i]=await Promise.all([Po(this.paths.portFile,"utf8"),Po(this.paths.tokenFile,"utf8")]),a=Number.parseInt(t.trim(),10),c=i.trim();return!Number.isFinite(a)||a<=0||!c?null:{port:a,token:c}}catch(t){if(t.code==="ENOENT")return null;throw t}}async fetch(t,i){let a=i.body!==void 0,c={Authorization:`Bearer ${t.token}`};a&&(c["content-type"]="application/json");let f=new AbortController,d=setTimeout(()=>f.abort(),i.timeoutMs??5e3);try{let p=await fetch(`http://127.0.0.1:${t.port}${i.path}`,{method:i.method,headers:c,body:a?JSON.stringify(i.body):void 0,signal:f.signal}),m=await p.text();return{status:p.status,body:uf(m)}}finally{clearTimeout(d)}}};function uf(r){if(!r)return null;try{return JSON.parse(r)}catch{return r}}function df(r){return r instanceof Error?r.message:String(r)}q();ae();import{copyFile as To,mkdir as lf,readFile as Mr,writeFile as hf}from"node:fs/promises";import{dirname as gf,resolve as Br,sep as Bn}from"node:path";import{fileURLToPath as pf}from"node:url";q();ae();var Io=N("dist-install");function mf(r){let t=pf(r),i=gf(t),a=`${Bn}src${Bn}`;if(i.includes(a)||i.endsWith(`${Bn}src${Bn}cli`))return null;let c=Br(i,"index.js"),f=Br(i,"..","package.json");return{dist:c,pkgJson:f}}async function Lo(r={}){let t=r.paths??H(),i=mf(import.meta.url),a=r.sourceDist??i?.dist,c=r.sourcePackageJson??i?.pkgJson;if(!a||!c)return{kind:"dev-mode-skip",reason:"running from src/(tsx loader);no dist/ to install"};let f;try{f=JSON.parse(await Mr(c,"utf8")).version??"unknown"}catch(y){return Io.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 xn(t.configFile)??{},p=d.libVersion;if(p===f)try{return await Mr(t.libEntry),{kind:"already-current",libVersion:f}}catch{}await lf(t.libDir,{recursive:!0}),await To(a,t.libEntry),await To(`${a}.map`,`${t.libEntry}.map`).catch(()=>{});let m=Br(t.libDir,"package.json"),_=`${JSON.stringify({type:"module"},null,2)}
|
|
91
|
+
`;return await Mr(m,"utf8").catch(()=>null)!==_&&await hf(m,_),d.libVersion=f,await Et(d,t.configFile),Io.info("dist installed",{libEntry:t.libEntry,fromVersion:p,toVersion:f}),p?{kind:"version-changed",fromVersion:p,toVersion:f,libEntry:t.libEntry}:{kind:"first-install",libVersion:f,libEntry:t.libEntry}}var Mf=N("cli");function wt(r,t){let i=[],a;for(let c=0;c<r.length;c++){let f=r[c];if(f===t){a=r[c+1],c+=1;continue}if(f.startsWith(`${t}=`)){a=f.slice(t.length+1);continue}i.push(f)}return{value:a,rest:i}}function Bf(r){let t=r.slice(2);if(t.includes("--daemon"))return{mode:"daemon"};if(t.includes("--status"))return{mode:"status"};if(t.includes("--stop"))return{mode:"stop"};if(t.includes("--refresh"))return{mode:"refresh"};if(t.includes("--uninstall"))return{mode:"uninstall"};if(t.includes("--install-service"))return{mode:"install-service"};if(t.includes("--help")||t.includes("-h")||t.length===0)return{mode:"help"};let i=t,{value:a,rest:c}=wt(i,"--pat-token");i=c;let{value:f,rest:d}=wt(i,"--pair-code");i=d;let{value:p,rest:m}=wt(i,"--env");i=m;let{value:_,rest:b}=wt(i,"--handshake-url");i=b;let{value:y,rest:k}=wt(i,"--frontier-url");i=k;let{value:I}=wt(i,"--agent-id");if(!a||!f)return{mode:"help"};let L={mode:"pair",privatecode:a,pairingCode:f};return p&&(L.env=p),_&&(L.handshakeUrl=_),y&&(L.frontierUrl=y),I&&(L.agentId=I),L}var zf=`
|
|
92
92
|
coze-bridge - local bridge daemon for cloud Agent Service
|
|
93
93
|
|
|
94
94
|
Usage:
|
|
@@ -115,34 +115,34 @@ Auto-connect agent (optional):
|
|
|
115
115
|
|
|
116
116
|
Internal:
|
|
117
117
|
<node> <entry> --daemon daemon mode (OS supervisor only)
|
|
118
|
-
`.trimStart();async function
|
|
118
|
+
`.trimStart();async function zo(r=process.argv,t={}){let i=Bf(r);switch(i.mode){case"help":return process.stdout.write(zf),0;case"daemon":{try{await ko()}catch(a){return Mf.error("daemon start failed",{err:String(a)}),1}return new Promise(()=>{})}case"status":return qf(t);case"stop":return Ff(t);case"refresh":return Uf(t);case"uninstall":return Hf(t);case"install-service":return jf();case"pair":{let a={};return i.env&&(a.env=i.env),i.handshakeUrl&&(a.handshakeUrl=i.handshakeUrl),i.frontierUrl&&(a.frontierUrl=i.frontierUrl),Kf(i.privatecode,i.pairingCode,t,a,i.agentId)}}}async function qf(r){let t=new Ke(r.paths),i=await t.probe();if(i.kind==="not-running")return process.stdout.write(`coze-bridge: not running
|
|
119
119
|
`),1;if(i.kind==="stale")return process.stdout.write(`coze-bridge: stale (${i.reason})
|
|
120
|
-
`),1;let a=await
|
|
120
|
+
`),1;let a=await t.request({method:"GET",path:"/status"});return process.stdout.write(`coze-bridge: running
|
|
121
121
|
${JSON.stringify(a.body,null,2)}
|
|
122
|
-
`),0}async function Ff(r){let
|
|
123
|
-
`),0;try{return await
|
|
122
|
+
`),0}async function Ff(r){let t=new Ke(r.paths);if((await t.probe()).kind==="not-running")return process.stdout.write(`coze-bridge: not running
|
|
123
|
+
`),0;try{return await t.request({method:"POST",path:"/shutdown"}),process.stdout.write(`coze-bridge: stopped
|
|
124
124
|
`),0}catch(a){return process.stdout.write(`coze-bridge: stop failed: ${String(a)}
|
|
125
|
-
`),1}}async function Uf(r){let
|
|
126
|
-
`),1;try{let a=await
|
|
125
|
+
`),1}}async function Uf(r){let t=new Ke(r.paths);if((await t.probe()).kind==="not-running")return process.stdout.write(`coze-bridge: not running (start daemon first)
|
|
126
|
+
`),1;try{let a=await t.request({method:"POST",path:"/refresh"});return a.status===200?(process.stdout.write(`coze-bridge: refreshed
|
|
127
127
|
${JSON.stringify(a.body,null,2)}
|
|
128
128
|
`),0):(process.stderr.write(`coze-bridge: refresh failed: ${JSON.stringify(a.body)}
|
|
129
129
|
`),1)}catch(a){return process.stderr.write(`coze-bridge: refresh failed: ${String(a)}
|
|
130
|
-
`),1}}async function
|
|
131
|
-
`);try{await
|
|
132
|
-
`)}await new Promise(f=>setTimeout(f,500))}if(!r.skipSupervisor)try{let{getSupervisor:f,buildContext:
|
|
130
|
+
`),1}}async function Hf(r){let t=new Ke(r.paths);if((await t.probe()).kind==="connected"){process.stdout.write(`coze-bridge: stopping daemon...
|
|
131
|
+
`);try{await t.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:d}=await Promise.resolve().then(()=>(Kr(),jr)),p=f();await p.uninstall(d()),process.stdout.write(`coze-bridge: ${p.platform} supervisor unregistered
|
|
133
133
|
`)}catch(f){process.stderr.write(`coze-bridge: supervisor uninstall failed (continuing): ${String(f)}
|
|
134
|
-
`)}let a=r.paths??H(),{rm:
|
|
134
|
+
`)}let a=r.paths??H(),{rm:c}=await import("node:fs/promises");try{await c(a.cozeRoot,{recursive:!0,force:!0}),process.stdout.write(`coze-bridge: removed ${a.cozeRoot}
|
|
135
135
|
`)}catch(f){return process.stderr.write(`coze-bridge: remove failed: ${String(f)}
|
|
136
136
|
`),1}return process.stdout.write(`coze-bridge: uninstalled
|
|
137
|
-
`),0}async function
|
|
137
|
+
`),0}async function jf(){try{let{getSupervisor:r,buildContext:t}=await Promise.resolve().then(()=>(Kr(),jr)),i=r(),a=t();return process.stdout.write(`coze-bridge: installing ${i.platform} supervisor...
|
|
138
138
|
`),await i.install(a),process.stdout.write(`coze-bridge: supervisor installed (daemon will auto-start on login)
|
|
139
139
|
`),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(y=>setTimeout(y,500)))):
|
|
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
|
|
140
|
+
`),1}}async function Kf(r,t,i,a={},c){let f=new Ke(i.paths),d=i.spawnDaemon??Do;if(!i.skipDistInstall){let _=await Lo({paths:i.paths});_.kind==="version-changed"?(process.stdout.write(`coze-bridge: upgraded ${_.fromVersion} \u2192 ${_.toVersion}
|
|
141
|
+
`),(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}
|
|
142
|
+
`)}let p=await f.probe();if(p.kind!=="connected"&&(process.stdout.write(`coze-bridge: starting daemon...
|
|
143
|
+
`),await d({paths:i.paths}),p=await Gf(f,i.waitTimeoutMs??1e4,i.sleep??Wf),p.kind!=="connected"))return process.stderr.write(`coze-bridge: daemon did not come up: ${p.kind}
|
|
144
|
+
`),1;let m={privatecode:r,pairing_code:t};a.env&&(m.env=a.env),a.handshakeUrl&&(m.handshake_url=a.handshakeUrl),a.frontierUrl&&(m.frontier_url=a.frontierUrl),c&&(m.agent_id=c);try{let _=await f.request({method:"POST",path:"/pair",body:m});return _.status===200&&_.body?.ok?(process.stdout.write(`coze-bridge: paired (${_.body.note??"ok"})
|
|
145
|
+
`),0):(process.stderr.write(`coze-bridge: pair failed: ${JSON.stringify(_.body)}
|
|
146
|
+
`),1)}catch(_){return process.stderr.write(`coze-bridge: pair failed: ${String(_)}
|
|
147
|
+
`),1}}async function Gf(r,t,i){let a=Date.now()+t;for(;Date.now()<a;){let c=await r.probe(500);if(c.kind==="connected")return c;await i(200)}return r.probe(500)}function Wf(r){return new Promise(t=>setTimeout(t,r))}zo(process.argv).then(r=>process.exit(r),r=>{process.stderr.write(`fatal: ${r instanceof Error?r.stack??r.message:String(r)}
|
|
148
148
|
`),process.exit(1)});
|