coze-bridge 0.1.2 → 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.
Files changed (2) hide show
  1. package/dist/index.js +48 -44
  2. 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 I0=Object.create;var rr=Object.defineProperty;var N0=Object.getOwnPropertyDescriptor;var R0=Object.getOwnPropertyNames;var M0=Object.getPrototypeOf,O0=Object.prototype.hasOwnProperty;var X=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(e,o)=>(typeof require<"u"?require:e)[o]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')});var ke=(r,e)=>()=>(r&&(e=r(r=0)),e);var ae=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),ms=(r,e)=>{for(var o in e)rr(r,o,{get:e[o],enumerable:!0})},B0=(r,e,o,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let c of R0(e))!O0.call(r,c)&&c!==o&&rr(r,c,{get:()=>e[c],enumerable:!(a=N0(e,c))||a.enumerable});return r};var Te=(r,e,o)=>(o=r!=null?I0(M0(r)):{},B0(e||!r||!r.__esModule?rr(o,"default",{value:r,enumerable:!0}):o,r));function bs(r){return Ht[_s]<=Ht[r]}function sr(r){ws={...r}}function Kt(r,e,o,a){if(Ht[r]<Ht[_s])return;let c=JSON.stringify({ts:new Date().toISOString(),level:r,module:e,msg:o,...ws,...a});r==="error"||r==="warn"?q0.write(`${c}
9
- `):z0.write(`${c}
10
- `)}function M(r){return{debug:(e,o)=>Kt("debug",r,e,o),info:(e,o)=>Kt("info",r,e,o),warn:(e,o)=>Kt("warn",r,e,o),error:(e,o)=>Kt("error",r,e,o),child:e=>M(`${r}.${e}`)}}var Ht,_s,z0,q0,ws,F=ke(()=>{"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"})(),z0=process.stdout,q0=process.stderr,ws={}});import{chmod as U0,mkdir as F0,readFile as K0,writeFile as H0}from"node:fs/promises";import{dirname as W0}from"node:path";async function Wt(r){try{let e=await K0(r,"utf8");return JSON.parse(e)}catch(e){if(e.code==="ENOENT")return null;throw e}}async function jt(r,e,o){await F0(W0(r),{recursive:!0}),await H0(r,`${JSON.stringify(e,null,2)}
11
- `,"utf8"),o?.mode!==void 0&&await U0(r,o.mode)}var ir=ke(()=>{"use strict"});import{homedir as j0}from"node:os";import{join as se}from"node:path";function W(r){let e=r??j0(),o=se(e,".coze"),a=se(o,"bridge"),c=se(a,"lib");return{cozeRoot:o,bridgeRoot:a,libDir:c,libEntry:se(c,"index.js"),pidFile:se(a,"bridge.pid"),portFile:se(a,"bridge.port"),tokenFile:se(a,"bridge.token"),logFile:se(a,"bridge.log"),installLock:se(a,"install.lock"),configFile:se(a,"config.json"),agentsRoot:se(o,"agents")}}function Ie(r,e=W()){let o=se(e.agentsRoot,r);return{root:o,config:se(o,"config.json"),workspace:se(o,"workspace"),logs:se(o,"logs")}}var ue=ke(()=>{"use strict"});var vs={};ms(vs,{AGENT_CONFIG_FILE_MODE:()=>Gt,enforceAgentConfigMode:()=>X0,loadAgentConfig:()=>xe,persistAgentSessions:()=>or,persistAgentSkills:()=>Jt,saveAgentConfig:()=>he});import{chmod as G0,stat as J0}from"node:fs/promises";function xe(r,e){return Wt(Ie(r,e).config)}function he(r,e){return jt(Ie(r.agentId,e).config,r,{mode:Gt})}async function X0(r,e){if(process.platform==="win32")return;let o=Ie(r,e).config;try{let a=await J0(o);if(!a.isFile())return;let c=a.mode&511;c!==Gt&&(await G0(o,Gt),ys.warn("agent config mode auto-corrected to 0600",{path:o,from:c.toString(8)}))}catch(a){if(a.code==="ENOENT")return;ys.warn("enforceAgentConfigMode: chmod failed (ignored)",{path:o,err:String(a)})}}async function or(r,e,o){let a=await xe(r,o);a&&(a.sessions=Object.fromEntries(e),await he(a,o))}async function Jt(r,e,o){let a=await xe(r,o);a&&(a.skills=e,await he(a,o))}var ys,Gt,at=ke(()=>{"use strict";F();ir();ue();ys=M("agent-config"),Gt=384});var oi=ae(Y=>{"use strict";var S=D;(function(r,e){let o=D,a=r();for(;;)try{if(-parseInt(o(423))/1+-parseInt(o(1267))/2+parseInt(o(1189))/3+-parseInt(o(1124))/4+-parseInt(o(1806))/5+-parseInt(o(1240))/6*(parseInt(o(1489))/7)+parseInt(o(1632))/8*(parseInt(o(835))/9)===e)break;a.push(a.shift())}catch{a.push(a.shift())}})(mn,626405);function D(r,e){r=r-223;let o=mn(),a=o[r];if(D.ubpPQZ===void 0){var c=function(m){let b="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=",w="",y="";for(let E=0,T,k,N=0;k=m.charAt(N++);~k&&(T=E%4?T*64+k:k,E++%4)?w+=String.fromCharCode(255&T>>(-2*E&6)):0)k=b.indexOf(k);for(let E=0,T=w.length;E<T;E++)y+="%"+("00"+w.charCodeAt(E).toString(16)).slice(-2);return decodeURIComponent(y)};D.aAURqA=c,D.dlFLeU={},D.ubpPQZ=!0}let u=o[0],l=r+u,p=D.dlFLeU[l];return p?a=p:(a=D.aAURqA(a),D.dlFLeU[l]=a),a}var Qa=Object[S(1831)+S(1111)],ex=Object[S(1720)+S(1308)+"mes"],ti=(r,e)=>function(){return r&&(e=(0,r[{LTEcp:function(u,l){return u(l)}}[S(295)](ex,r)[0]])(r=0)),e},tx=(r,e)=>{for(var o in e)Qa(r,o,{get:e[o],enumerable:!0})};function nx(){return Ys||(Ys=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function rx(){let r=S;return Zs||(Zs=[IDBCursor[r(1460)+"e"][r(375)],IDBCursor[r(1460)+"e"][r(1217)],IDBCursor[r(1460)+"e"].continuePrimaryKey])}function sx(r){let e=S,o={qhecq:e(1202),xfpFp:e(330),MfTvH:function(c,u){return c(u)},UumrZ:function(c){return c()},DQqwf:"ping_onc"+e(1467)+"s",WvXkk:function(c,u,l){return c(u,l)},yFcoY:e(1398)+"e_timeout",jedaD:function(c,u){return c===u},QVUiI:e(1507),XuvPU:function(c,u){return c instanceof u},JcgLE:function(c,u){return c!==u},GswdS:e(541)},a=new Promise((c,u)=>{let l=e,p=()=>{let w=D;r["removeEventListe"+w(991)](o.qhecq,m),r["removeEventListe"+w(991)](o[w(1372)],b)},m=()=>{let w=D;o[w(1830)](c,o[w(1830)](Ce,r[w(1701)])),p()},b=()=>{let w=D;u(r[w(330)]),o[w(1842)](p)};r[l(1627)+l(662)](o.qhecq,m),r[l(1627)+l(662)](l(330),b)});return a[e(604)](c=>{let u=e,l={VMyJv:o[u(597)],Dssuh:function(p,m,b){return o[u(1391)](p,m,b)},gaqhF:o.yFcoY,ySgng:function(p,m){return o[u(1830)](p,m)},btTxK:u(1202)};if(o[u(1755)]("pxxNR",o.QVUiI))return null;if(o[u(518)](c,IDBCursor))if(o[u(341)](o[u(1280)],o[u(1280)])){let p={gsFSh:function(m,b){return l[u(486)](m,b)},XNGKC:l[u(379)],jzxTG:l.VMyJv,kkXQx:l[u(1546)]};return new _0x55ede8((m,b)=>{let w=u,y={rgFen:function(k,N){return k(N)},OFjNS:l.VMyJv};this["_clearPi"+w(538)](),this[w(904)+"gTimeoutId"]=l[w(1456)](_0x1c59b7,this._ping.bind(this),this[w(1594)]["pingInte"+w(1506)]);let E=()=>{let k=w;p[k(896)](m,p.XNGKC),this[k(319)](p[k(1643)],E),this[k(319)](p[k(618)],T)},T=()=>{let k=w;y[k(736)](b,k(1649)),this[k(319)](y.OFjNS,E),this[k(319)](k(1398)+k(694)+"t",T)};this.on(l[w(669)],E),this.on(l[w(1546)],T),this[w(1249)]()})}else fr[u(1739)](c,r)})[e(291)](()=>{}),wn[e(1739)](a,r),a}function ix(r){let e=S,o={RUUmG:"complete",ttmVZ:e(330),iDWyE:"abort",nlQuu:function(c){return c()},EpszX:function(c,u){return c(u)},pYChy:e(990)+"or"};if(_n.has(r))return;let a=new Promise((c,u)=>{let l=e,p={JAZbz:function(y,E){return o[D(388)](y,E)},WoSoY:o[l(284)]},m=()=>{let y=l;r[y(1838)+y(1091)+y(991)](o[y(505)],b),r["removeEv"+y(1091)+y(991)](o[y(668)],w),r[y(1838)+y(1091)+y(991)](o[y(1389)],w)},b=()=>{let y=l;o.nlQuu(c),o[y(1731)](m)},w=()=>{let y=l;p.JAZbz(u,r[y(330)]||new DOMException(p.WoSoY,p[y(1370)])),m()};r[l(1627)+l(662)](o[l(505)],b),r[l(1627)+"Listener"](o[l(668)],w),r[l(1627)+l(662)](o[l(1389)],w)});_n.set(r,a)}function ox(r){bn={wbwNw:function(o,a){return o(a)}}.wbwNw(r,bn)}function ax(r){let e=S,o={WShcI:function(a,c){return a(c)},oeiDZ:function(a,c){return a(c)},VlMoA:function(a,c){return a===c},mqsSD:function(a,c){return a in c},iUTFr:e(534)+e(1609),NGxip:function(a){return a()}};return o.VlMoA(r,IDBDatabase[e(1460)+"e"]["transact"+e(685)])&&!o[e(571)](o[e(888)],IDBTransaction.prototype)?function(a,...c){let u=e,l=r[u(1482)](o.WShcI(Pt,this),a,...c);return ur[u(1739)](l,a.sort?a.sort():[a]),o.oeiDZ(Ce,l)}:o[e(596)](rx)[e(380)](r)?function(...a){let c=e;return r[c(1812)](Pt(this),a),o[c(1423)](Ce,fr[c(1792)](this))}:function(...a){let c=e;return o[c(525)](Ce,r[c(1812)](o[c(525)](Pt,this),a))}}function mn(){let r=["zuTNEem","rMPKswy","ugDAuMO","u2vYDMLJzvC","y2fSBa","y29UBMvJDca","x2HHBMrSzvi","yvHYywq","BLDhrMS","BMDLza","vuHkCxy","mtaYmNDsDwrNtq","B25SAw5L","CfvdzuC","vujHD1K","CvzMCxa","BLPcC3K","lcbxzwjtB2m","s05zBuS","ANv0q2G","BwvKAwf0zwW","twvZC2fNzuu","vxrYz3C","B0DJtuC","AxnrB1nby2S","s2j3u1C","Ag1gq04","z29PBMCGyxC","CNzHBa","yLnwqKS","uLLVsu0","sw9frfC","t251tMi","x29UtwvZC2e","z1r6qMS","veznwg0","zejwzvi","ignVzgu6ia","DKffvKS","AeLivNi","DgfYz2v0","reDyBfq","AgvHzgvY","zgPrBK8","rNb3B0S","m3WWFdj8mxW","AefJA01LC3m","DMvkt1a","y29SBM8","AwXSihvZzsa","AMTXu3K","r05HCge","B2LUDfjLywm","u1PUAMq","rLHsCKS","Bg9Nsurhzw4","A0v1B04","s0X6wwe","BKXPBMu","tNHyzLu","rKLmrv9ot1q","tgnWuuG","B3bLBKrc","z2v0s2v5","Agzbq0e","ChfTBvu","uMTrvNa","mhW2Fdf8ohW","z2fXAey","EKvXvg8","yw5ZzM9YBvq","wwfiDeO","Dgv4DfbHEwW","y2HnyxHuCMK","r0LJChu","zxjFBxnNAwq","v1rZq2i","B2nRzxrgywK","D1jfq1u","uwfLrhy","yM9L","y2XVC2uSihC","BuHyD0y","D24GCMvHC28","tgzJtwi","r0HVsuu","Aw9UvgLTzw8","Dw5wrgu","zwjksKO","A3blse0","v3LnBuy","y3jLyxrLrxi","CMzRwLe","r1j2qMm","EMTXtKK","BunmBfu","ywrKq291BNq","BgLTAxq","D2LWtxm","BMz6rNG","tMTYr2m","Dg9VigXHCMC","AvvmqxK","rgPttge","vgTMDMO","rNjVBNrPzxi","yMrFzgLK","BfvSuuW","yM5LEey","uLLxAhi","DhbizwfKzxi","C2vYDMLJzq","zMLN","mNWXmxWXFdy","q0Tbqvu","ugrYv08","x29WDgLVBNm","mdaWma","EwnUtxa","mhWZFdj8nhW","zxjHDg9Y","twTyCNi","D2LxwLO","zhvQrMK","DerZvgS","qwHLtvC","z1rPBwvVDxq","vu56C3e","rMnLzNO","CMLLC0nVDw4","sgPKywS","B3jLtMfTzxm","uMz2sKO","C3rYAw5N","Dg9cExrLC0W","y09Wzw4","AwXLtMfTzq","veToAfC","BxnNsuq","Ae9Wzw5fDMu","CM92AwrLihy","D2fZq2XLyw4","EMXUuLu","x3bYB3rVy28","DxjS","u2vXsuq","ENP0vKK","yM9tzu8","q0n2BKi","ywrKrxzLBNq","BwvZC2fNzv8","rwXHEey","CffYvwG","Bu9ewgC","ndCWmZjiEMPQuxq","AenSB3nLrxy","y01ut3O","Ee92DLG","ywnRx2LK","wMXAyNi","zLvPu0W","ventuM0","rwfzEfO","B25ozxr3B3i","C2v0q3vYC28","ANP4veC","sK51sLm","AgLNAa","qxbQuMK","y0L1vu0","r2vTtLm","DgLTzw91Da","wMDgruy","Bvbbr3q","ywjyAgi","swDXCuO","vLj1vKi","z2vY","rKfAu3i","uejlwvC","BK12q0K","zg9Uzq","CvfgENi","D3jPDgvvAw4","zw5KCg9PBNq","x25HDMLNyxq","y29Uy2f0","Bhz6wMK","wwjbALO","zu5hwee","mNWZFdv8n3W","ENzos3O","x2HHBMrSzva","wgvJAK0","uvnUCMC","BwH2Dfi","AuHeseK","qMzxq2O","swvSD24","tg9NsurozxC","x1fVu01HBMe","BxHgshi","y2HHCKnVzgu","twHjzum","rKPZu1G","vxbKyxrLq28","wNDTyMW","uffzu0S","C2v0sxrLBq","CMvZB2X2zq","x2nSzwfYvgK","CejpyvC","EuT4CKS","ChrVCG","EePitLi","tKrntwi","vKLYBLy","ywzVu1K","zxjFCw9Zx2e","vgjxvfG","DgLUzYbZzxi","tuLPEvq","AuHSDNu","CMvZDwX0","CMfNzvn5BMm","z2v0sxrLBq","AevzEfO","y2n0thy","A0vmAvO","Affxuxq","C29YDa","D0vJtKe","tKjhAvy","uMz0Bfu","Dg9cExrLC0i","x29Ut3bLBG","A05vEva","CMzIrKi","C3rHCNq","r2rADhK","CvbLteS","q0f6z3i","z2v0t3DUuhi","CgfNzwHPzgu","yvDnvLG","Egv5CLK","B1LQww8","nhWX","DMPerKy","x2zVCM1HDeu","DMftwhy","DxnLCKLW","t2DOuKq","BMXrDxu","zhLsDwC","zxH0zw5ZAw8","EfjIBgq","s3LPue4","A1n0yxr1C0m","BwPZsMC","y3jLyxrLt3a","C2v0","r2jnqMO","CwHRDNy","DhHLufa","qNn0shK","ywnRtxnNswq","uKfysKe","D3jPDgu","AwXLx25HBwu","CgvYC2LZDgu","C2XPy2u","qwrNqLK","zuTssMi","Dw5KzwzPBMu","CNnICgO","txrUquO","AMvKyuq","teTlBu4","sKDXBgO","AxnFywnR","B25pCgvU","x2DLBMvYyxq","ywrKt25L","zw50zwqGDhK","zNjVBuHHC2G","DeLUDgvYy2u","r1HWue0","BNrLCG","AuTPExi","wwTjAfm","jMPZy2fSBgi","Dgv4Dc9Qyxy","yuvhzKO","y29UBMvJDeu","Cgu6ia","AenAEue","AhDAAve","DgHHBIbSB2m","A21nvhG","AKLtBKi","tuvvCfO","uvfeDxu","yuHnENy","ugf0vMG","Bwf4uMv0CMK","x21PBMLoyxy","zKfZzhO","vxzktvq","yNL0zu9MzNm","DxbIuMe","q29Kzq","rufVvwG","DNDqrMm","z2v0","BKzJwey","teLLs0W","zurbzve","DhjWB1u","zMDAAgK","B3v0sw50zxi","zxrxB3jRq2G","wg1gC0W","ENzUz2S","CwnVuMO","BePKwMe","q29UzMLN","q291BNq","mZyYmdi3nxHstMHUtG","rLbUv0O","sLrmA2W","qufHz1G","x2fKzfDZtgK","z0P4sha","yxbWBhK","yvjnwhi","tLPfrK8","zxf1ywXZ","verJzgm","CLzyugq","wuzRCvq","EhP1Bhu","uMreA28","zMX5r0G","tK5eB2O","C0XAv2C","qwvUwgS","A2v5CW","y29UC3rYDwm","CMvJzwL2zwq","CMvKDwnL","ywXSq3vYC28","twzuDKG","zgvMAw5Luhi","r2Hsu2q","wu9qv3i","yxnJCMLWDa","rvv2y0q","Aw47y2HHCNm","zxfktei","CMvTB3zLrxy","yw5Nzq","zw5JB2rPBMC","q3fgCwW","vxvTCLO","BMrWB2LUDfq","wu1ksgy","q2Tizgm","q3jqv3m","EgnRs0W","yxnquhq","zw5HyMXLuw8","q3DiDxm","rLbYCum","rNjmChi","DKnVAKO","uLjpuG","A2nHueW","rLrfs3i","CuTqu2C","Dg9cExrLCW","vLjzBhG","uuzzyLG","Aw5Lza","x3DZsw5ZDge","zg1nD2C","x3vYBa","tvjiBfq","uLnmDM4","C1bgqw0","EeDhDgW","yxjYyxLIDwy","DxrVuMvJB24","Ahr0Ca","y1Powfi","zhL4qwe","sM9HvMO","EfHewvG","zMLSzw5HBwu","ExDMwwe","qNjKs3K","B3jRig9MzMW","AxDTsu0","yMLUza","qw55Egu","AM5Xvui","CwvtCKe","vvH0vLa","BfH6zKe","yMLUyxj5vhK","zu9SzLO","CKDczK4","x3bPBMDmB3m","C3rLBMvYCW","r3PLz2i","vvfit28","B25szwnLAxy","Ahfby1q","zMzmAw5L","tw9KDwXL","x3nVy2TLDa","x2vUzhbVAw4","yNvMzMvYzwq","u1Ltzxm","ywDLsgLKzq","yu1VDum","s1LHuu0","AMvJDfn0B3i","qw1VDw50","ywX3yxLZ","D3f6wMq","ufzmy0y","CvjxtLK","BgLUzq","veTuww0","CfLdAhK","yxbWzw5Kq2G","quXSyKG","EsbJBg9Zzwq","vgvsExO","ufnPueu","B3nfrgq","y2f0y2G","DKncA00","svrKq1O","sxDXzhi","tfrfy3a","DgjPD3O","reiGzMfPBgu","CMvHzfvjBNq","zgvSzxrL","yLfwtKG","Ce1zs2S","Dw50","s2fAwwO","ywjuyM8","AhbNBw8","r0Pes2e","B2fK","A0vfzxa","t0Xqt1G","ru1mAwK","DeXhtgm","AxnAzxjV","sMHczMO","q3vZDg9Trxi","Cg9PBNrdB24","sKjhtKK","x2LUDgvYDMe","y3ruAw1LB3u","B2zM","B2nRzxq","r2vhwMK","Aw5KzxHpzG","wejIyvO","qMTYzfC","z2vtEw5J","x2rItMfTzq","ALvPwhe","txHxA3m","ihn1y2nLC3m","zxjYB3i","CMv0CNLdB3u","x0vysvnu","zMXVB3i","D2rICue","sxfusvy","t29Zz1q","CgXLyxnLiha","BvbHuvm","twHWteW","ze1qr04","sMnNteu","BevLDhy","ELjyq1G","rvzlzLC","swLVtMm","zerOD1q","x21LC3nHz2u","EeP2qwO","x0rctMfTzq","zvvYBa","AwHxrwO","q2jRzNC","zMvY","tvvYC0i","z0nODg0","DKrWqKe","BwvY","yMv4DLC","ELvMsha","BKfosKi","svjUAM8","veT1zhm","y2XVC2veqG","Dg9mB3DLCKm","uuTOBfa","tvr4svu","qxPIwgO","zufJAW","zg1Use8","ueziEeC","Cw9Z","s09fs2e","DhDVCMTdAge","zfDVCMTLCKC","ywr2yw5Jzq","Bwf4twvZC2e","AwrI","y1zHr2G","yNruEeS","Aw5JBhvKzxm","sxbYAgC","igzHAwWSig0","D1nhBeK","te1cBwK","Efrtz3a","yxPXvgq","y29Kzq","rxbZELG","ugP1CuS","zNvUy3rPB24","A0PZwKm","qun6u0G","DLzQCMK","BM93","CMfzC2W","y2ncCfC","tMvMtwy","BgzuyLu","y3vYC29Yx2y","yxjWsum","BMCGB3iGyw4","Ec1TC2CTy3u","zMzMzG","z2n4EMK","AfLKq0q","swfbv3u","id4G","yxnL","qKfJCgq","x2jPBMfYEvq","C0XPC3rLBMu","vwDMyvq","AuXNA3u","CfLeuKy","Dw5RBM93BIa","Cu5LAwu","AgfZ","q3vZDg9Tq2W","zgLZCgf0y2G","u1jICvm","yu5Nteq","CM92AwrLigi","odiYmtiXv3jhD1ny","v2vIu29JA2u","B25OrvO","BKT6rw0","refVweW","rNfwEfm","wezYqwe","BgLUzw5V","txftBLi","qvHXDhq","x2n1CNnVCK4","D2fZzMC","ChfrBKS","Bu9ID1G","x3bHDgHlzxK","v2veyMy","zcWG","C2vUza","tMvmBha","shjQvKm","BezSDxnO","r3rQvgu","y3jLyxrLuMu","x2XPC3rLBMu","uuD0rhq","swf2tLm","v0XNzNG","vKzZEwy","x2n1CNnVCKy","y3jLyxrLtwu","zxjizLe","BuTKquK","zwrPyxrLBhK","AMHesvy","uuPttvG","BwvYwgm","zNDZxZeUmc4","q0Xpu0ve","C2fNzq","zu9VzLi","y2XVC2u","BMv4DcGPigm","ihrPBwvZ","r1rxq3C","tuHlDe4","BwfUDwfSihi","tezyqwu","vu1Yv1u","zMLUza","r0XLAvG","whDoBvK","BMPyzgS","BIWGAg9ZDg4","u2vszw8","quDNquW","s2j5v3u","u29NtMm","zNHAsvy","zwTzBxu","qwzlAfu","yxrHlcbKyxq","Dgz0q0i","CMvUDevUzha","EvnNBMC","AxjLza","rwfKCLC","BwvZC2fNztO","AwDHDg9Yt24","rgXnzNm","zxj2AwnL","A0vzqve","C2HPzNq","yw1xq2e","y2HLy2Tszwe","CM92AwrLige","ywnRpwzYB24","DvHzDhy","yMfJA3vWigu","zeH3Be4","CvDvB0W","zM9YrwfJAa","A01WruC","uLvvBuC","BMTXy2W","B3bLBG","wMP0sey","zNjVBNrPzxi","wNHfrg8","DhjPBq","wvnUwKC","quTYy08","sLLut0G","yNL0zuXLBMC","teTQrxu","wwrjBvy","whv2ufu","s25tuNK","quXm","ANfHr24","Aej1DeG","z1buqMm","whjYrK4","v1nOy0K","z1nqzK4","Bhm6ia","zw5fDMvUDa","nhW1","sLnYB0G","B3jpBMXPBMu","BNvTyMvY","rNHSANu","B2jQzwn0u3q","BMvJDa","igfYCMf5yNu","ve5mvM4","BMDuAw1LCG","x2nYzwf0zvm","D1jJwKy","CLrvAgO","sKvoDNe","uwrpzLu","tfbLz2O","rgXJv1a","ywT5tfG","o2nOyxjZzxq","C3jNr1O","y2uGBM90igK","zgf0yq","qw5Yvg4","DMvY","Dg9tDhjPBMC","ywj3uK4","ywLtD0C","u3DZshO","ysbTDxn0igi","CMfUzg9T","CgnHExe","ChvZAa","D0rswg4","C2nzvhu","suvtx0vsuK8","yK5itNi","wez3whG","D3nZoI8V","ihrYEsbYzwm","CMvZzxruCMK","zNDSwNa","CwTvvLy","BxfZu0q","x3nLCuLK","BwjbrMu","BMjNtfG","tNzhEvy","t1jPBMq","EhrgBem","yxz3BMG","C3vIC3rYAw4","B3jRzxjhBg8","C3zxELy","Dgv4Dc9WBge","seLvCxu","B3vUDa","C2DVzwq","A0z6r1O","zNjVBuj5Dgu","BufYzLq","BMnywxO","De1HBMfNzxi","uLzpzNa","v09sDM0","AgfiBLO","tKDFrvjst1i","wu9qwu8","tKD4Axa","rffXD2y","zw5XDwv1zq","CffcCKS","A1PyC0i","B3bLBIa","uMvJB25Uzwm","uNfdCge","DgHLBG","Axnby2TdBgu","ihrVihjLDhi","yM1TuwW","CYbPBNn0yw4","ENfOy3G","DKnvt2K","sNLiz2C","Bwf4tg9ZC0m","Bg9N","BNjjD1C","CMvJzxzPzwq","yxbWBgLJyxq","y2HnyxHdB3u","A2TyuxG","zufYzwm","zMvhC0K","seTTDwC","yxv0BW","r0ndvNq","zezPwLu","pxv0zI04","BeHHBMrSzxi","CgfNzxnOB3C","sgXoueG","q09otKvdveK","lcbTyxGGCMu","x3DHAxq","x29Uq2XVC2u","yw1L","Bwv0Ag9K","wK1usw8","vNnmB1K","DxzAteG","AxDdDK4","lcbOB3n0BMe","wNvRz2W","s0zzqxm","nhW3Fdn8oxW","sePMwwm","BwLZzq","Aw5PDcbrB1m","we9tq3C","ufnzzNa","DeLK","EwPcBum","s2LuueO","Cgf5Bg9Hzfq","B25LCNjVCG","zM9Yy2u","Bwu6ia","mxW0Fdb8mNW","sNHTy2O","yLDwDLG","zxjYtM8","DhLWzq","ANbpEMG","BgLpzKy","tgLZDgvUzxi","zxq9DxrMltG","DhDAt3q","DMvUDa","BgPnExq","tMzlwLK","DhrTvLO","vK15sNy","DgnWyMe","ExbL","D3rNqK8","vKH2yvO","AgjTzuW","BMvpy24","yM9KEq","Ae9hEfm","r1vIvwu","z0zJBeC","AuPVtK4","u3blsgy","zwznq0m","DujTv1q","rhDAuM0","Aw9U","Cgf5Bg9Hza","r05uzMW","x3nLBMrby2S","DKr0t1a","zhLkqLm","s3bAq1i","yNLL","qK9lz04","zv90Aw1LB3u","AxbuuvC","zKT0CKu","zMLSDgvY","teznuui","B3nLza","BMnVzgLUzW","B1PTu2u","DNffy2m","DcbSAw1PDa","ELjQuxq","rxjYB3jdB2q","DgLTzw91DcW","BMrLEa","vxjxCKu","zNruv1G","x2rYB3bhBg8","re1VAhy","ywDLrxzLBNq","BgfHCva","A3LMqwK","svnbEfG","rezJtg0","B2XKvMvYC2K","qwPHCNq","EfDSzM8","m3WXFdi","C2v0u3rVCMe","BNrfBMrWB2K","D1DdBgy","A1PXzgO","vurUrxi","wvzkqxu","CgLPyLi","BKDLreG","rgrOsgO","x2rPC3bHDgm","BKDNCw0","zgfJBe0","sKnSrLO","sKXSBNK","zwvTruK","CMDgzw4","y29UBMvJDfm","ywHZsLO","r3vzCLi","BNruCMLLC0m","yxnZAwDU","x2LZv29YA2u","AgDWsvO","wgfPrxG","CNjVCK1LC3m","C3rVCcbPBw0","tKLXCNa","Cuvuwey","swjAzeu","r3LprNe","zLvmvMy","u1L5Cge","CNnVCL92ywW","Bfj0sNy","zMX1C2HfEha","B2nRzxrtDwm","wLnYyMi","Dg9iyxnO","y3vYCMvUDeu","C29mC2S","twLYq0e","rgvKAwnHDgu","rK9XyvG","CKH4s0i","AKHxDe0","zwnVBM5Ly3q","s0f0zw4","Cw9Zx18","y21YAKS","BM5Ly3q","CKjVEKm","zMvoAfa","CMvXDwLYzwq","Dg9hzw5LCMe","EezSEK0","ign1CNnVCIa","DxDHshi","qLjRru4","vw5Oyw5KBgu","tKHlAxu","Ae1LC3nHz2u","suToAeW","AejPDeO","uwLcsgu","rKrMCgS","vw5PBxbSzw0","s0PxuhG","Aw5KzxGGB3u","AMXxv2q","zxHWB3j0CW","A2v0ignVBNm","whDpqwq","suP4BLO","CMvTB3zLq2G","ihzHBgLKigq","sKDPANy","Bw1PEem","mxWYFdb8nhW","ueTTAg4","mdaWmdaWmda","sK9Auee","AMrytNy","Bvn1Evm","uuPksue","zhzfyxy","wgT6tLC","uLfxv3e","tgjQzeC","rg9hD0i","C2v0zgi","rvrnzfq","yw1Lu3bHy2u","C3rVCMu","yw51Ce1LC3m","x2n1CNnVCK0","BwvZC2fNzq","sLfHtxG","CgfYC2u","z2v0qwXSs2u","wenzrK4","AvPdAw0","r3jbwKK","rMXftxC","D0fOqMK","C0jf","veLIy1q","D0ThAg0","qvHUBey","thjTEhy","q3bZsvi","C0nVDw50zxi","AwrvEuW","s0P0ELm","C3bSAwnL","ndm3neHrC01JAG","wufLuxq","EunuAK0","y3vYC29Y","CeHethO","zNztuhK","uwnuzgu","CxHAugO","twLZC2LUzYa","zxjYtxnN","v3zcvxy","Dev2zw50","vfbMrM0","uNj2wMW","sNv6zw8","Aw5KzxG","vuH1weC","BMfTzq","CNHMzNa","icSG","whPmDxy","D2Povwi","D0HOAM4","yMvpANi","wez2wNG","Cg16Cu8","CIb0DhDjra","u2Dzu1C","zNjVBunOyxi","uefzu3m","rerjy1C","y3vYCMvUDeK","q1nmywe","su5tvefova","DLflDKW","y2PuBhK","z2vrDwv1zuW","DNn2CMu","BM9Uzv9UB24","BML0AwfSAxO","x2LZtwLUAvq","wKzjC1u","shLUBvy","vMX4B1a","AxbtuKW","y3r4","qLvJz0u","zxjFAxnFywm","CwjREhK","AgfUz2u","zvj5AgW","qKPHt3C","CNvst2m","AvvurNi","Efrurw52","vxLbqNy","AgvKtwf4uMu","tgLtseW","CuHvvLO","t3jYzLy","D2zSDhG","z3ngu2G","zcWGDw5RBM8","BMv3vMvYC2K","swfjsNa","AxrIDfO","r2jyDhG","ywrK","CMTLCKDSB2i","x3bPBMDqB24","r0L3Bhe","sfjgyNi","rMHbsNK","uKXhBge","BKTQB04","CxvWrNe","wgrevLm","CfHHv3q","BvzrCvK","te11Avq","v2LUzg93","Exvgwuq","A0XNt3q","rvnqwe0","D1jXA2i","z1bIv3G","zw50","CNr3y3a","x3jLywr5q2W","y0vNte8","zw1TrMy","zwrztNe","AxnmB25N","CM9YrxzLBNq","tvH0uLy","BMvLzf9Hy2S","CMvZzxrfBMq","zgPwD0u","t2jQzwn0","rgTvELy","Aw9Ul2PZB24","sw54t1K","yKTbA2W","ywXPzcb1CMW","yw5Hz2vY","s0jtr1a","zNjVBujPDhm","yMfSu2nVCgu","qwjwAeW","B25JBg9Zzq","zvb2vxG","ANjQBeO","r0XeC28","sMzdqwK","sKrIDfG","zwPSC2C","A0jJt0S","ywDL","s2vuDKK","thvWqLu","y2vZC0HHBMq","yvLWrhC","AxnszwfKEq","A0PZBvO","r0TIveG","B3nnt08","t3bLBKv2zw4","zuTMAw4","Cg9oD3K","vgfsveu","C2nYAxb0","AvLjzhm","ywXS","wgLxreC","BeXkshq","z1b4s2C","rvDprM4","CYbWyxjHBxm","vMvVquO","twL5ru8","BMrWB2LUDca","rfPfCuK","x3fVC0rc","mNWXFdD8mhW","twTAwfi","wwTVyvC","CvHTufK","DxrMofDYAxq","C2vYs3C","zLzUDKu","rKfXwLi","Dg9Y","ihbYB3rVy28","y2rnD24","tMfTzq","qwjVCNrfCNi","BMvY","y2XLyxjtDg8","BwrmCei","zMDzs1q","uw5rvNG","whvsuNq","B2zMBgLUzq","EvjLy29UBMu","uvbXAxu","C29Tzq","vgTutKC","mNWWFdf8m3W","y3jLyxrLq2W","qxbSrxe","zgvS","EeXjzLq","rwfnvNq","rgvwzKC","B25tDgfYDfi","BvDAz1e","q0Tssee","ufPnqxO","BwDxthu","CeXgyu8","wuXMq1G","v3bdv2q","l3DZl3yY","sLnWANy","igzPzwXKoIa","rvPwBuK","Dxrtzge","BeHsDuq","qNbAEhe","ChjVy2vZCW","vg5hvum","AwXK","x29UugfNzu4","C2DPza","whrRrgq","y1jJCfm","tMX0wvG","tKzWuhe","u2fJsKu","D1jxANi","zvnnvxu","BgvY","weHpvNK","C3nHz2vfDMu","C2Lvz1u","BwfW","rLDt","CMvWBgfJzui","y3vYC29Yx24","y0zlreW","rNLxDe8","A212CMm","DMfSDwu","r3zqtgO","Ahbnr2W","AvLcquG","BuXQuKy","AhjYwKK","tfvUEu4","zgLZywjSzue","mNWZFdb8mxW","BfrPBwvVDxq","x2rPC2nVBM4","nhWXFdj8m3W","qMzhwvm","Cg93","vKjrvuO","AgfZt3DUuhi","ChjVDg9JB2W","AxnbCNjHEq","u1PfzLe","BNrbBMrvCgq","B3nLrxzLBNq","sNLgrLe","uMvHzcbWyxm","BwLUzW","v1D6uLO","rvjst1i","zgrjrcWGzgu","A2v5","DePoDgy","ELrmBKO","qwfmrgy","x2LUAxq","s3jADe0","yuTXrei","ywjVCNq","DvPfwLG","z0P3zfO","yw1LoIa","q3j3y0W","z2TVsfO","ALHQsui","sLvQv0W","x29UrxjYB3i","thbPrNC","zw50tgLZDgu","ueLRt3q","zxLIyuC","B25mAw5L","suLjDwi","vK5RCeO","tMfeAfe","DefPu1C","BxHxy2W","AMLyBgG","CMfTzq","CKv5svq","t1bftG","n3W5Fdr8nxW","tuvtu0fhrv8","CfzJsuy","uM1KsLC","Cw5dDgq","Aw5L","reHZCwq","B3bLCNr5","A1b6wxe","CgLUz0XVC3m","sefZy3K","C3vIyxjYyxK","DMfS","x2rLC3rYB3K","tg9Nsuq","zvzZq08","C3bSAxq","vMzuq1O","BfnHthu","CNzHBfzHBhu","mZK4ntuYDNjmy05s","AufRAvO","t1bftL9fuLi","sw5lBLy","EuL5CuG","ANbTwg0","zvvpAwe","x2rLyNvN","zwTIuLC","ve5RC2y","yMfSrxzLBNq","mNWZFdb8nhW","AgXJzfq","y3vZDg9Tshq","sxbNueq","AgvHzgvYCW","zNL6s0y","zgvJB2rLzey","A0zKqMq","t2zyqNi","sLnptLa","B25TzxnZywC","BMPOy3q","y0nWs2e","uxvLDwu","vw50zvm","vfbOzfa","z0r2Cuu","x3DZ","x2LZtwLUAvC","sgHWvwq","r21WCvO","suHdAwK","igXHCMDLCIa","renAs3G","r0vOshi","zhvgyMu","wuDcCuG","BvL2tum","Bg93","AunADLK","wffdt04","y0XwEeS","CMvWBgfJzq","y29UBMvJDa","C2vUDa","zw5HyMXLqxu","CMfVDu0","zfPvzLa","zw5NDgG","C0nvBg4","CKjvAg0","C2vYDMLJzs0","rvHKzxC","y2XLyxi","EgL4v2K","Dvj3DLa","t2DOvfa","Chv0","tg9JAW","x29UvgLTzw8","yxrLq291BNq","B1rYz2K","y3vYC29YlNm","sgr3re0","mJi1nJK3ogDWwMrVrG","uufSsgK","tw9rAMi","yNPZAw8","C2v0y3vYC28","AuXLuKG","B2zMC2v0","qLrQzeK","r015rNu","z2v0qwXS","q2PXALe","vxznqvy","D2LSBfjLy28","C3vJy2vZCW","vKHezhO","x2LZsw5PDa","DuD3y2y","vfzgyve","Ag5xrfm","v0TxtNe","EfPmwxu","BvvtEu0","DMLJzuLeig8","wuLNCfG","ywjUvfe","suXsuw0","C2vUzf9Hy2S","DhjPzxmGCMu","y29UDgLUDwu","CgLUz1rPBwu","AxnrB1nnzxm","CgLUz0LUDgu","D3HiEum","y29TCgXLDgu","shnYEhG","v0DTCLy","ELznDNy","B0fsue0","Auf2v1e","D1zgwey","z2v0u3rVCMe","ruzduNu","yvLgEMK","u25mBhO","svnyt2W","A1rhC1m","CMvHC29U","Afb4DM4","wuf2wwy","t1DQCMW","BgvUz3rO","mJe3mZHqruTICKm","seXvBxm","rxzLBNq","vgH6rwW","zNjHBwvuExa","BhntwMu","D2D6zgK","AM9PBG","Ec1TC2CTCw8","x3bPBMC","vKv1tvK","r1jQEei","Bg9IywXty28","C0DvywC","x3bYzwzPEa","yMXVy2TLza","Dhr3Awq","CLPeqK0","rM5Ysuu","CuLHDve","BgLZDgvUtMu","Duj3sfC","zwn0","r3rAC0e","q09oveLovuu","vgfN","rw5bsMm","mtyXnJy4nMz2s3fura","yNL0zxm","vu1IwwW","yxGGCMv0CMK","Dw5ZAwDUzwq","Dhj1y3rVCIa","ENzeEuS","z2v0q3vYCMu","zfzStuC","B25tDg9Wsw0","yLHoq2G","quDNtwS","zsbHihn0CMK","r3n3zfm","EuPwCgi","BMnLq2XVC2u","zwzUuxe","zuPlsgW","vNPJqvC","C1Her04","zxmGCMvHy2G","vNfcyKe","C1jwuKK","B3jQyLO","BgTjs1y","x2nSzwfYugK","v2n3wxO","t1nprvC","z2u6ia","Aw9ot1a","ihzHBgLKihm","yxv0B21HDgK","rMvMzMW","u2LduLm","rLriA0q","Cgf5Bg9Hzeu","yxbuy28","zw1PDa","DKrXEKm","zgvIDwC","CKDYww0","B3bLCNr5tMe","BuzMEMq","CMvHzhDYAxq","rfH0D0u","B1Hrsfa","nxW2Fdb8nhW","DxbKyxrLq3u","CKTfA1m","y29UBMvJDgK","zNLfqLi","teP5y2G","vuHrBwO","B0zZu24","rwXxEhG","EKzAzxe","uMfbu2e","zMr5reG","qK5pt1u","u1rns1e","rNH3yxy","CMvJB25Uzwm","vKXvAfO","uMXgsKW","ExjMDLu","z2vjBMzVu3K","CNnVCL9Uyw0","Ef9MCM9UDgK","BwLUAvbYB2C","x3jLy29UBMu","rvvJALO","t0PzEeq","ywnRDxbfBMq","BennA2O","x2LZqNjVD3m","EK1MDLa","ExfmBfO","Dxrjza","wwDcCu4","FdH8mhWXmhW","vvLTCfy","AwL4qLe","rLvpBMq","u3LnELa","vwnsCMW","s01puwO","ANDPB20","wKDXugy","Cg9W","v0Trs0O","u2HHCMvKv28","u3rYyxrLz3K","yu1wsNG","q0Xpu0LorW","DgvZDa","vezsExq","vML1ze8","ihjLy29UBMu","AMvOs00","u0Xzs1O","CMvHzhLtDge","y291BNq","x2DLDeLUDgu","v29tB1K","AxjPsLC","EgzWrNa","Dervuw0","D3r5ELe","sKfOrNO","Dg9oDw1Izxi","vhnfsNq","yNvMzMvY","C0n3qu4","AKHtwu8","EMD0Be4","uhv4zMK","ywnR","weDpt1C","Bg9NsurozxC","zeXNyLe","A3DkuLK","x2LUAxrqCM8","AurxEuu","zxjFCw9Z","v3zyA2S","DMfSDwvZ","BMCGzMfPBgu","x3jLBw92zvC","ChbL","u2TPCcbWyxm","zLPpEg8","CgLUz19VBMm","zw5JB2rLrNi","u0Pfu3O","vKjRDg4","AuvwveO","AxmGDw5Kzwy","EvzuDNe","zKXgwKy","y2HLy2TdDxi","sxHcu28","Cwj4z1K","txzYC3m","Derzy1a","swjXzvy","zNjVBu51Bwi","x2HHBMrSzu8","yMjsDKW","ywDLu2HVDW","ywnOzwq","CMvZzxrdB3u","ig1LC3nHz2u","BLL1reO","txrpDxG","BwLPuMW","vuriEfy","B2vPrfO","ALHxr2m","AevYCM9Yrxy","BLP6z0e","BKLJruO","rLjptLrjrvi","q1DvAK8","yMveBvy","uev0CfO","BLLuEuu","mtb8mxWXmxW","u3LYrwO","AuTrqNG","vMnztK4","C3rYAw5NAwy","B25Uzwn0Aw4","sNvNz0m","Ee1iteK","x2nVBM5Ly3q","DenozuG","vLHJBxq","ihrPBwvVDxq","C0Xf","C01uzK0","DfzvD2i","zxryy2K","wvHOuwG","tufyx1jfvfi","CMvHzg9UBhK","z3zZsNa","q29ltM4","vw92yw4","A0PNsui","rhnZDwG","Aw50zwDLCIa","tfrKwNm","nxWZFdr8nG","ChjVDg90Exa","tMXzDLm","q3nnyLa","AwDnC2e","zefWweC","txDQv0i","zfPUDvq","zv9ZDwnJzxm","DcbVzIbYyw4","Dvvmvey","D09czve","Ag1Pvfm","A0nJuKe","tKfusvzfx0u","DhjHBNnHy3q","tvnoBKW","uNvxwLi","Dg9jsM8"];return mn=function(){return r},mn()}function xx(r){let e=S,o={ApjRi:function(a,c){return a===c},CwHus:e(390),aMVJx:function(a,c){return a(c)},wtgBO:function(a,c){return a instanceof c},XGOOW:function(a,c,u){return a(c,u)},LiSHL:function(a){return a()}};return o[e(1646)](typeof r,o[e(1850)])?o[e(1359)](ax,r):(o[e(672)](r,IDBTransaction)&&o.aMVJx(ix,r),o[e(1384)](ni,r,o[e(892)](nx))?new Proxy(r,bn):r)}function Ce(r){let e=S,o={dVlMG:function(c,u){return c!==u}};if(r instanceof IDBRequest)return sx(r);if(gn[e(417)](r))return gn.get(r);let a=xx(r);return o[e(1275)](a,r)&&(gn[e(1739)](r,a),wn[e(1739)](a,r)),a}var ni,Ys,Zs,fr,_n,ur,gn,wn,bn,Pt,$s=ti({"node_modules/idb/build/wrap-idb-value.js"(){let r=S,e={YUhPR:function(o,a){return o>=a},fwlZp:function(o,a){return o instanceof a},KBSGP:function(o,a){return o!==a},SyrEj:r(949),mLjRF:function(o,a){return o===a},RdDko:r(1659),AXqtt:r(534)+r(1609),uMOkb:r(813),DeVfG:function(o,a){return o(a)}};ni=(o,a)=>a[r(1e3)](c=>o instanceof c),fr=new WeakMap,_n=new WeakMap,ur=new WeakMap,gn=new WeakMap,wn=new WeakMap,bn={get(o,a,c){let u=r,l={ihWEj:function(p,m){return e.YUhPR(p,m)}};if(e[u(569)](o,IDBTransaction)){if(e[u(940)](e[u(1434)],e[u(1434)]))return l[u(351)](this[u(1368)],this["maxLossC"+u(584)]);if(e[u(1051)](a,e.RdDko))return _n[u(1792)](o);if(e.mLjRF(a,e[u(432)]))return o[u(534)+u(1609)]||ur[u(1792)](o);if(e[u(1051)](a,e.uMOkb))return c.objectStoreNames[1]?void 0:c[u(534)+"ore"](c[u(534)+u(1609)][0])}return e[u(1008)](Ce,o[a])},set(o,a,c){return o[a]=c,!0},has(o,a){let c=r;return o instanceof IDBTransaction&&(a===e[c(1820)]||a===e.uMOkb)?!0:a in o}},Pt=o=>wn[r(1792)](o)}}),ri={};tx(ri,{deleteDB:()=>ux,openDB:()=>cx,unwrap:()=>Pt,wrap:()=>Ce});function cx(r,e,{blocked:o,upgrade:a,blocking:c,terminated:u}={}){let l=S,p={lCMkj:function(w,y,E,T,k){return w(y,E,T,k)},gapED:function(w,y){return w(y)},efMCC:function(w,y){return w(y)},CjqjQ:function(w,y){return w(y)}},m=indexedDB[l(507)](r,e),b=p[l(1199)](Ce,m);return a&&m["addEvent"+l(662)]("upgradeneeded",w=>{let y=l;p[y(1340)](a,p.gapED(Ce,m[y(1701)]),w[y(717)+"on"],w[y(898)+"on"],p[y(682)](Ce,m.transaction))}),o&&m.addEventListener(l(1255),()=>o()),b[l(604)](w=>{let y=l;u&&w[y(1627)+y(662)](y(463),()=>u()),c&&w[y(1627)+y(662)]("versionc"+y(884),()=>c())}).catch(()=>{}),b}function ux(r,{blocked:e}={}){let o=S,a={tAiSW:"blocked",XFrAa:function(u,l){return u(l)}},c=indexedDB.deleteDatabase(r);return e&&c[o(1627)+"Listener"](a[o(1098)],()=>e()),a[o(429)](Ce,c)[o(604)](()=>{})}function Qs(r,e){let o=S,a={trpoU:o(1310)+"e",rfkZQ:o(1451),OfXBr:function(m,b){return m in b},eclaJ:o(1611),NfKZY:function(m,b){return m!==b}};if(!(r instanceof IDBDatabase&&!a[o(1143)](e,r)&&typeof e===a.eclaJ))return;if(pn[o(1792)](e))return pn[o(1792)](e);let c=e[o(1167)](/FromIndex$/,""),u=a[o(667)](e,c),l=ii.includes(c);if(!(c in(u?IDBIndex:IDBObjectStore).prototype)||!(l||si.includes(c)))return;let p=async function(m,...b){let w=o,y=this["transact"+w(685)](m,l?a[w(1796)]:a[w(1570)]),E=y[w(813)];return u&&(E=E[w(850)](b.shift())),(await Promise[w(967)]([E[c](...b),l&&y[w(1659)]]))[0]};return pn[o(1739)](e,p),p}var si,ii,pn,fx=ti({"node_modules/idb/build/index.js"(){let r=S,e={JejcI:r(1002)+r(529),ykFxL:r(1792),kJsmZ:r(1541),tWqWT:"getAll",qeSrA:r(1368),nZBsy:r(1182),sfegX:r(299),wRqkb:r(1178),fnWtE:function(c,u){return c(u)}},o=e.JejcI.split("|"),a=0;for(;;){switch(o[a++]){case"0":$s();continue;case"1":si=[e.ykFxL,e[r(958)],e.tWqWT,"getAllKeys",e[r(255)]];continue;case"2":$s();continue;case"3":ii=[e[r(1494)],"add",e.sfegX,e[r(919)]];continue;case"4":pn=new Map;continue;case"5":e.fnWtE(ox,c=>({...c,get:(u,l,p)=>Qs(u,l)||c[r(1792)](u,l,p),has:(u,l)=>!!Qs(u,l)||c.has(u,l)}));continue}break}}}),dx={idb:function(r){let e=S,o={pUCeG:function(a,c){return a===c},hQWQt:"tGAgW"};r[e(790)]=Promise[e(1687)]()[e(604)](()=>(fx(),ri))[e(604)](function(a){let c=e;return o[c(1491)](o[c(1707)],o[c(1707)])?a:_0x5f2d00[c(534)+c(1609)]||_0x4d280d[c(1792)](_0x33888a)})}},ei={};function Se(r){let e=S,o={peWzP:function(u,l){return u!==l}};var a=ei[r];if(o.peWzP(void 0,a))return a[e(790)];var c=ei[r]={exports:{}};return dx[r](c,c[e(790)],Se),c.exports}Se.d=(r,e)=>{let o=D;for(var a in e)Se.o(e,a)&&!Se.o(r,a)&&Object[o(1831)+o(1111)](r,a,{enumerable:!0,get:e[a]})},(()=>{let r=S;Se.o=(e,o)=>Object[r(1460)+"e"][r(1062)+"operty"][r(1482)](e,o)})(),(()=>{let r=S,e={EUvcD:r(268),srgGZ:"__esModule",ftTWX:function(o,a){return o===a},nlzcP:r(392),NkrGc:r(1714),feNhP:function(o,a){return o!=a},xzulu:r(1752)+"d"};Se.r=o=>{let a=r;e[a(709)](e.nlzcP,e[a(1578)])?(typeof _0x5bee73<"u"&&_0x374d67[a(553)+a(1265)]&&_0xd25791[a(1831)+"operty"](_0xd07adf,_0x17e611.toStringTag,{value:e[a(1835)]}),_0x3b65be[a(1831)+"operty"](_0x1bb555,e[a(548)],{value:!0})):(e[a(772)](e[a(1819)],typeof Symbol)&&Symbol[a(553)+a(1265)]&&Object.defineProperty(o,Symbol[a(553)+a(1265)],{value:e[a(1835)]}),Object[a(1831)+a(1111)](o,e.srgGZ,{value:!0}))}})();var V={};(()=>{let r=S,e={PSYfp:function(s,t){return s(t)},qcoRj:function(s,t){return s+t},Hsrxx:function(s,t){return s+t},jpmXm:function(s,t){return s*t},hmiTS:function(s,t){return s+t},jUiXq:function(s,t){return s(t)},AdgBY:function(s,t,n){return s(t,n)},hwZiQ:function(s,t){return s+t},piibR:function(s,t){return s!==t},zVMvv:r(1362),QPqiu:function(s,t){return s+t},DkUzV:"0000",xWlfo:r(403),KpZCR:function(s,t){return s(t)},FlEMw:r(800)+r(800)+r(800)+r(800),uwaHr:function(s,t){return s>t},UrWrE:function(s,t){return s<t},RSLvn:function(s,t){return s!==t},dvEav:function(s,t){return s-t},CrPWs:function(s,t){return s<t},EaYxZ:function(s,t){return s===t},WYROp:"Lpkbe",YUvsr:r(1560),UDHxV:function(s,t){return s!==t},PAYSs:function(s,t){return s!==t},DZEqI:function(s,t,n){return s(t,n)},vAEVK:"KiTPJ",UXtVP:function(s,t,n){return s(t,n)},eNGXA:function(s,t,n){return s(t,n)},UvMAV:function(s,t){return s(t)},SJESz:function(s,t){return s(t)},ZlZbr:function(s,t){return s(t)},uGwcf:function(s,t){return s&t},DjKem:r(843)+r(773)+r(1019)+r(1074),aEGfJ:"Missing "+r(773)+r(1019)+r(1047),AnrTn:function(s){return s()},MhpLL:function(s,t,n){return s(t,n)},bbRvL:function(s,t,n){return s(t,n)},YAeQt:"error",BstHy:function(s,t){return s!==t},UMbYl:function(s,t){return s!==t},asPPt:function(s,t){return s!==t},qWUoL:function(s,t,n){return s(t,n)},HLUms:function(s,t){return s!==t},XQCON:"FtQzD",uRwvP:function(s,t,n){return s(t,n)},SogNc:function(s,t,n){return s(t,n)},FjdIf:function(s,t){return s(t)},qupFq:function(s,t){return s!==t},mYCkr:function(s,t,n){return s(t,n)},eOofR:function(s,t,n){return s(t,n)},wRECU:function(s,t){return s!==t},fgYKT:function(s,t,n){return s(t,n)},KbwSW:function(s,t,n){return s(t,n)},ALlbH:function(s,t,n){return s(t,n)},NltYX:function(s,t){return s!==t},UcRrl:function(s,t,n){return s(t,n)},gChtm:function(s,t){return s(t)},UyABv:r(1135)+"1",QdOfU:function(s,t,n,i){return s(t,n,i)},uBwHW:function(s,t){return s+t},veWTg:function(s,t){return s===t},CCvnB:r(1380),InxOY:function(s,t){return s>>>t},CSLaa:function(s,t){return s(t)},WKWNq:function(s,t){return s===t},idUyL:r(253),etXci:function(s,t){return s(t)},Feffl:function(s,t){return s(t)},HJfYc:function(s,t,n){return s(t,n)},ccBpW:function(s,t){return s(t)},hfACA:function(s,t){return s(t)},mhvtR:function(s,t,n){return s(t,n)},AzbXj:function(s,t){return s(t)},jkqSy:function(s,t){return s(t)},Iprhg:function(s,t,n){return s(t,n)},mPaQS:function(s,t){return s&t},CoKNn:r(843)+r(773)+r(1019)+r(1623),HdwDM:r(843)+"required"+r(1019)+"LogID",PluqQ:"Missing "+r(773)+" field: service",zEqTo:function(s,t){return s===t},pmzqO:function(s,t){return s+t},bQVNH:function(s,t){return s&t},aHMzv:function(s,t){return s(t)},GIwlq:function(s,t,n){return s(t,n)},dmMwg:function(s,t,n){return s(t,n)},kZqdj:function(s,t){return s+t},Zukgl:r(786)+r(1762)+r(1773),jIIRG:function(s,t){return s>>t},tLGLc:function(s,t){return s>=t},eUOia:function(s,t){return s===t},ZjtHF:function(s,t){return s>t},dBVeR:function(s,t){return s+t},NDMMb:r(1396)+r(703),njhct:function(s,t){return s>=t},ZGqPf:function(s,t){return s>t},ePENo:r(1069)+r(703),MTxIU:function(s,t){return s+t},Fcefz:function(s,t){return s>t},XuRRt:function(s,t){return s<t},kPzYq:function(s,t){return s<t},yjBmC:function(s,t){return s===t},uZEZX:function(s,t){return s&t},tDsTk:function(s,t){return s+t},PKmhn:"WEWei",drNxn:function(s,t){return s&t},QFYbX:function(s,t){return s(t)},eqJLB:function(s,t){return s+t},IbZdE:function(s,t){return s!==t},XrrFN:function(s,t){return s|t},dyJBS:function(s,t){return s<<t},vDtOP:function(s,t){return s&t},hlcdT:function(s,t){return s&t},JhBfj:function(s,t){return s==t},SgYSW:function(s,t){return s&t},kFzGZ:function(s,t){return s>=t},hOGxS:function(s,t){return s+t},GJDKa:function(s,t){return s===t},arpIC:function(s,t){return s+t},bEZym:function(s,t){return s+t},JoaVj:function(s,t){return s|t},amWCa:function(s,t){return s|t},GRjxB:function(s,t){return s|t},abwRN:function(s,t){return s<<t},EXdew:function(s,t){return s&t},zkqNI:function(s,t){return s&t},UNzsq:function(s,t){return s<=t},XVynq:function(s,t){return s===t},pxipZ:"GeGZi",XecjM:function(s,t){return s(t)},CKRHA:function(s,t){return s&t},rBUhm:function(s,t){return s+t},xMtOm:function(s,t){return s+t},zFZeq:function(s,t){return s+t},RkQVp:function(s,t){return s+t},TZKdP:function(s,t){return s!==t},IavNS:function(s,t){return s|t},sPFAm:function(s,t){return s<<t},djVwE:function(s,t){return s<<t},wqzZd:function(s,t){return s|t},Uovan:function(s,t){return s<<t},kFdBd:function(s,t){return s&t},FBWlp:function(s,t){return s>t},afoSY:function(s,t){return s+t},mdLpB:function(s,t){return s&t},Fxlju:"0|4|9|6|"+r(1668)+r(1433)+"8",cEgLO:function(s,t){return s>>>t},TIbcT:function(s,t){return s<<t},jXWGc:function(s,t){return s&t},VXcmt:function(s,t){return s&t},WWzRZ:function(s,t){return s&t},dujFi:function(s,t){return s>t},njXdk:function(s,t){return s<t},ElWxx:function(s,t){return s<=t},MEUpZ:function(s,t){return s+t},merXc:function(s,t){return s+t},tDYcP:function(s,t){return s<t},uBmWT:function(s,t){return s<t},HgftX:function(s,t){return s<t},ISAxX:function(s,t,n){return s(t,n)},OWjrl:function(s,t){return s<t},eKRJb:function(s,t){return s<=t},MIiyT:function(s,t){return s<t},fyEBR:function(s,t){return s-t},RVOfp:function(s,t){return s<t},WKQKJ:function(s,t){return s>>t},rAdYg:function(s,t){return s&t},JUjWL:function(s,t){return s>>t},YMJHf:r(973),gPTBc:r(1432),InKnV:function(s,t){return s|t},PjuqK:function(s,t){return s>>t},HRFbr:function(s,t){return s&t},MqSnR:function(s,t){return s&t},bKAkl:function(s,t){return s<<t},jdXNv:function(s,t){return s!==t},kFfLi:function(s,t,n){return s(t,n)},dMPGN:function(s,t){return s|t},RftlU:function(s,t,n){return s(t,n)},xFlzM:function(s,t){return s(t)},xXDYX:function(s,t){return s&t},aiSwG:function(s,t){return s&t},IbqeV:function(s,t){return s!==t},orjbZ:r(660),poNwy:function(s,t){return s(t)},HXWkb:function(s,t){return s(t)},UnCqe:function(s,t){return s&t},twZOt:function(s,t){return s(t)},kwJRY:function(s,t){return s(t)},oGcMG:function(s,t){return s<<t},iCZvY:function(s,t){return s(t)},IRnjo:function(s,t){return s&t},PAbnV:function(s,t){return s(t)},kCcRA:function(s,t){return s<<t},mmixC:function(s,t){return s&t},toIJo:function(s,t){return s|t},lUlQL:function(s,t){return s<<t},qbzYn:function(s,t){return s===t},CKAAU:function(s,t){return s===t},LTdZs:function(s,t){return s<t},zWBYd:function(s,t){return s<t},UGanu:function(s,t,n){return s(t,n)},feGsI:function(s,t){return s>>>t},wRcZF:function(s,t){return s!==t},gTzBk:function(s,t){return s&t},zvDyK:function(s,t){return s+t},qIauQ:function(s,t){return s|t},LupBU:function(s,t){return s+t},XzLuv:function(s,t){return s!==t},nGeDH:function(s,t){return s>>>t},MkXrr:function(s,t){return s>>>t},MHKtN:function(s,t){return s+t},qnCtd:function(s,t){return s|t},XmFsL:function(s,t){return s>>>t},vDpBA:function(s,t){return s+t},WORvm:function(s,t){return s&t},lLJHt:function(s,t){return s(t)},pqmmU:r(763),iYBAH:function(s,t){return s===t},OSOEW:function(s,t){return s|t},oFsSn:function(s,t){return s|t},SLYKZ:function(s,t){return s<<t},raouM:function(s,t){return s<<t},OnuNb:function(s,t){return s<<t},eiNpr:function(s,t){return s<<t},mKdAI:function(s,t){return s|t},BfWCj:function(s,t){return s<<t},abTbo:function(s,t){return s<<t},MtOux:function(s,t){return s===t},eybaG:function(s,t){return s|t},rKzeE:function(s,t){return s<<t},RQWWq:function(s,t){return s&t},LfcMb:function(s,t){return s>>>t},zqhcx:function(s,t){return s&t},FAqZR:function(s,t){return s&t},bXNCh:function(s,t){return s>>>t},liOfF:function(s,t){return s>>>t},iHlvu:function(s,t){return s>>>t},KJWPx:function(s,t){return s>=t},wiWZZ:function(s,t){return s+t},hYdCD:function(s,t){return s|t},Fxwav:function(s,t){return s%t},NSPXh:function(s,t){return s|t},NlYvS:function(s,t){return s/t},dFiZU:function(s,t){return s>>>t},MxWks:r(1331),eemEI:function(s,t){return s===t},cmrjK:function(s,t){return s&t},PIkOt:function(s,t){return s>>>t},lXsHL:function(s,t){return s>>>t},wxHyC:function(s,t){return s+t},UHQmj:function(s,t){return s+t},RaASa:function(s,t){return s<<t},VNIsB:function(s,t){return s|t},mxWcl:function(s,t){return s<<t},sgoed:function(s,t){return s>>>t},Puxfi:function(s,t){return s>>>t},iULAy:function(s,t){return s===t},qXmPY:function(s,t){return s+t},twgYS:function(s,t){return s&t},SgWhF:function(s,t){return s>>>t},FpwoK:function(s,t){return s&t},yqLlZ:function(s,t){return s>>>t},gJxHp:function(s,t,n){return s(t,n)},SZEfQ:r(1039),XtkDd:function(s,t){return s>>>t},OLPOX:function(s,t){return s&t},cZNXR:function(s,t){return s>>>t},ipSRL:function(s,t){return s>>>t},eJKHl:function(s,t){return s>>>t},TnGUC:function(s,t){return s&t},mVQqY:function(s,t){return s>>>t},GIcpu:r(1473)+r(225),iriJW:r(1450)+r(563)+"R",TbWTX:r(1105)+r(1072),ywfYa:r(1126)+"OR",eKgcZ:function(s,t){return s!==t},zbUGX:r(308),QGtDt:r(335),UMrWU:function(s,t){return s instanceof t},SYSes:r(582)+r(1836)+r(663),sXDGN:r(616)+r(935),gvsJp:r(1611),nWGFk:"binary",DwYMe:"gcfgW",jEagr:r(1313)+r(720),lQUsk:r(655)+"3",SeReo:function(s,t){return s!==t},FTEKr:"fMCyg",HynmV:function(s,t){return s<<t},aYFzi:function(s,t){return s<<t},beDmV:function(s,t){return s&t},GXpPM:function(s,t){return s|t},wEcNA:function(s,t){return s+t},iEVTJ:function(s,t){return s<<t},Gzegb:function(s,t){return s|t},hqAcT:function(s,t){return s&t},yCTjM:function(s,t){return s!==t},eKgxC:function(s,t){return s===t},EadrW:function(s,t){return s===t},fdyDH:function(s,t){return s>t},PQYSK:r(1243),fxZIV:function(s,t){return s===t},JClFZ:r(1046),xtFlC:r(641),mYvMC:r(1169),HUAJM:r(784),vWkKC:"LtnKD",mFfzd:function(s,t){return s+t},ejkri:r(779)+"d error.",pBOaW:function(s,t){return s<t},lJdux:function(s,t){return s===t},aXrad:function(s,t){return s<t},nbgLX:function(s,t){return s===t},akyLX:function(s,t){return s&t},rSegC:function(s,t){return s!==t},vwPFc:r(1704),GyOFq:r(1447),QKhlP:r(1635),GtZsA:r(507),JYTOH:r(463),uXYtv:r(816),ZFIsU:function(s,t,n){return s(t,n)},UYmpV:function(s,t){return s!==t},eRyhl:r(1732),GEhHr:function(s,t){return s(t)},wasfg:function(s,t){return s===t},wOBeQ:"DlMfs",YbAjZ:function(s,t,n){return s(t,n)},NFpPq:function(s,t){return s instanceof t},xJHNR:r(1222),AheMW:r(1081),AAagX:function(s){return s()},GVmBT:"AbortError",jZxde:function(s,t){return s===t},TPhdP:"FFcAV",dmnHO:r(564),YSnZG:function(s,t,n){return s(t,n)},VHDdz:r(687),CqFql:function(s,t){return s||t},apTco:function(s,t){return s<t},DYkel:function(s,t){return s-t},ImuMN:r(1475),eOlfZ:function(s,t){return s!=t},haHnZ:function(s,t){return s<=t},TDcdc:r(464)+"alled multiple times in "+r(1024),OghTP:function(s,t){return s+t},mObwX:function(s,t){return s(t)},aMouC:function(s,t){return s>>>t},nFcXF:r(1206),JuggC:r(1529),UHJqv:function(s,t){return s!==t},KOEKa:r(1630),GbMBj:function(s,t){return s-t},rGrYm:function(s,t){return s|t},HhpUd:function(s,t){return s<<t},qbkxy:function(s,t){return s&t},cuCrX:function(s,t){return s|t},oTrgi:function(s,t){return s<<t},nIcEJ:function(s,t){return s&t},gkoHZ:function(s,t){return s!==t},YVJAu:r(1161),XdDVS:function(s,t){return s|t},ILRQm:function(s,t){return s|t},vVjri:function(s,t){return s<<t},ViudO:function(s,t){return s&t},uvZLH:function(s,t){return s<<t},YkoaW:function(s,t){return s&t},lfTbU:function(s,t){return s>>t},ePvUx:function(s,t){return s<t},pLFaO:function(s,t){return s===t},DGXlT:function(s,t){return s===t},sRVRI:function(s,t){return s+t},laaqP:r(881),AaLDf:function(s,t){return s+t},hnWDS:function(s,t){return s&t},vaSXv:function(s,t){return s|t},IIIub:function(s,t){return s&t},svWzV:function(s,t){return s>>t},jXjIB:function(s,t){return s|t},uULTF:function(s,t){return s>>t},BTjdI:function(s,t){return s|t},AfmMm:r(1665),tJNtf:function(s,t){return s|t},osEDd:function(s,t){return s-t},Mvrss:function(s,t,n,i){return s(t,n,i)},VkGFN:function(s,t){return s instanceof t},daclM:function(s,t){return s!=t},qNeie:function(s,t){return s instanceof t},NeLlp:function(s,t){return s==t},rBozC:function(s,t){return s&t},wWClf:function(s,t){return s>=t},xRbld:function(s,t){return s|t},cIuUM:function(s,t){return s<<t},fAsdz:function(s,t){return s&t},kEYAQ:function(s,t){return s-t},DFcLm:function(s,t){return s<<t},DHsqd:function(s,t){return s+t},zgtlN:function(s,t){return s===t},nimaj:r(1076),UHgaS:r(1395),rxffp:function(s,t,n){return s(t,n)},vIYXP:r(316),serKw:r(950),KLzYa:r(412),TvUAn:r(1174),iJoNN:function(s,t){return s(t)},bHXqZ:function(s,t){return s===t},qKPSg:r(478),LcpQH:r(1769)+r(498)+"tierJSONP",PSiPE:r(856),pXaWt:r(324),qETXF:r(377),DXtwE:r(598),nfzFx:r(1679),bmmQl:function(s,t,n,i){return s(t,n,i)},qRWNY:function(s,t){return s!==t},kJgIB:"PRECi",beOjr:r(1780),Lrmxv:r(1202),EGsJY:function(s,t){return s(t)},gDvqE:function(s,t){return s||t},hIHVr:r(1752)+"d",YkIhS:function(s){return s()},RYWhr:r(849),GUbUe:r(1016),yIyqH:function(s,t){return s!==t},GLeiX:r(1329),WvBUv:function(s,t){return s===t},oxVZh:r(714),BJaOw:r(638),kMpEG:function(s,t){return s(t)},BOKgN:r(1398)+r(1467)+"s",erHfQ:r(1398)+"e_timeout",lXzfA:function(s,t){return s===t},EWOFn:"grpog",iZCim:function(s,t){return s===t},TKTYm:function(s,t){return s>>>t},igMsa:function(s,t){return s|t},FhNuv:function(s,t){return s<<t},SZnjd:function(s,t){return s|t},rGBfN:function(s,t){return s|t},HlNPH:function(s,t){return s<<t},RlFJL:function(s,t){return s<<t},Jxmcj:function(s,t){return s!==t},azqTd:"xRQUG",kHyyT:r(438),KnSRy:r(1827),IoEDW:function(s,t){return s|t},kZXsB:function(s,t){return s<<t},qVfqp:function(s,t){return s&t},VEuMY:function(s,t){return s>>t},wipMs:"HSHTr",gZUtX:"xbsFX",DAoXL:function(s,t){return s===t},FUOnd:r(1753),NRaqF:function(s,t){return s<t},KeTvI:function(s,t){return s>>t},abXhb:function(s,t){return s===t},lJdZa:function(s,t){return s&t},gSPfN:"2|3|0|5|"+r(1725),YoYpB:function(s,t){return s>>t},ZehyV:function(s,t){return s|t},DoGwB:function(s,t){return s&t},oZmSe:function(s,t){return s+t},iwmIM:function(s,t){return s>>t},BRkEN:function(s,t){return s>>t},Ljcjg:function(s,t){return s|t},ZMTIo:function(s,t){return s|t},UBawY:r(1833),GMyFu:function(s,t){return s||t},VBQUJ:function(s,t){return s||t},VBktn:function(s,t,n){return s(t,n)},YNnfL:r(530),ncXYz:function(s,t){return s||t},xTSgp:function(s,t){return s||t},wAhBi:function(s,t){return s||t},ryzrl:function(s,t){return s||t},IUxId:function(s,t){return s||t},RuWZR:r(561),DwZRm:r(1055)+"4",BMNhk:"RLGla",SwsHz:function(s,t){return s||t},rKEkS:function(s,t,n){return s(t,n)},hrsbx:r(371),CpsIR:r(1628)+"id",bexvW:function(s,t){return s+t},rfbFB:r(1147),ElaxF:function(s,t){return s&t},FqVxS:function(s,t){return s>>>t},IpgPD:function(s,t){return s===t},fLFZF:"YshTx",WcwYz:function(s,t){return s===t},avwnh:r(872),qbxgY:"oKACW",iHDHI:function(s,t){return s!==t},KNYmK:r(292),GTWCw:r(810),iLgku:r(1682),TPfFm:r(1334)+r(1696)+"ck",MwjWB:function(s,t,n,i){return s(t,n,i)},qHUVZ:"x_fronti"+r(882)+"k",Utrgw:function(s,t,n){return s(t,n)},VcYNN:r(1334)+"er_ack_m"+r(1028),iKiyr:r(930),scYTu:r(1758),RqAXm:r(1636),UDnEr:function(s,t){return s||t},MckUH:function(s,t){return s(t)},eDvdW:function(s,t){return s(t)},JGqlj:r(946),oARPM:"CJcwe",UdnUH:function(s,t){return s instanceof t},UGYDG:function(s,t){return s instanceof t},UvJMT:r(616)+"ion/json"+r(547)+r(625),vQKvL:r(873)+"e",tcpba:function(s){return s()},NvGyV:function(s,t){return s<t},JLlny:function(s,t){return s>t},tCNeH:function(s,t){return s+t},JyHgg:function(s,t){return s||t},SpKHf:function(s,t){return s(t)},xZLYu:function(s,t){return s+t},veJOP:function(s,t){return s+t},LUnyN:function(s,t){return s+t},FnrIE:function(s,t){return s+t},OosgT:function(s,t){return s+t},mjsJg:r(788)+r(1468)+r(1295),HILLQ:r(854),BNOOU:function(s,t){return s||t},ITdCZ:r(407),abnTQ:r(1457)+r(1579)+"e",xixWi:r(426),FTHkD:"bHzpn",iAkiZ:function(s,t,n,i){return s(t,n,i)},NefMf:function(s,t){return s+t},tftCB:function(s,t){return s<t},XaiEx:function(s,t,n){return s(t,n)},iOUQL:function(s,t){return s>>>t},sCwAN:function(s,t){return s<<t},pHDLz:"4|2|1|3|0",EMLii:function(s,t){return s+t},dpBjU:function(s,t){return s+t},GhRSd:function(s,t){return s|t},CAzgr:function(s,t){return s|t},YFkqT:function(s,t){return s<<t},unVDe:function(s,t){return s+t},mPjIE:function(s,t){return s+t},BfYHm:function(s,t){return s<<t},kLgOt:function(s,t){return s+t},jlWWd:function(s,t){return s+t},WGmrV:function(s,t){return s<<t},fZOxo:function(s,t){return s+t},ETMdT:function(s,t){return s<<t},PEtpZ:function(s,t){return s<t},FTIzV:function(s,t){return s>>>t},wtyzQ:function(s,t){return s+t},VHvaZ:function(s,t){return s&t},MirCA:function(s,t){return s&t},vjDFF:function(s,t){return s&t},ORind:function(s,t){return s+t},NZgTP:function(s,t){return s+t},zUfHp:function(s,t){return s&t},sJtvP:function(s,t){return s+t},iixBQ:r(636),XFvZx:r(995),nZzgA:function(s,t){return s===t},LpiFw:r(1778),sMTfM:r(1591)+r(1346)+r(1104)+"3",PatVh:function(s,t){return s|t},tbiwz:function(s,t){return s<t},YXhQh:function(s,t){return s|t},PVLcF:function(s,t){return s<t},vCUOi:function(s,t){return s|t},ESPXM:function(s,t){return s|t},flyGH:function(s,t){return s<<t},zvngk:function(s,t){return s|t},edekh:function(s,t){return s(t)},MRHlT:function(s,t){return s+t},xMHLI:r(1520),hBitJ:function(s,t,n,i){return s(t,n,i)},onhEZ:function(s,t){return s instanceof t},ekYmu:function(s,t){return s instanceof t},zlnRU:r(895),XFwXx:function(s,t){return s(t)},Cbkfw:function(s,t){return s(t)},zRXCX:r(399)+"ile_name",MUrsB:r(706)+r(567)+r(1438)+"g",GHoIE:"DlcWP",boSeO:function(s,t){return s<t},VRuVB:function(s,t,n){return s(t,n)},TMwHd:function(s,t,n){return s(t,n)},AfKhU:function(s,t,n){return s(t,n)},FeXYm:r(1377),fblxR:r(1694),jwiom:r(1538)+r(332),MXtRV:function(s,t){return s<<t},XHOVy:function(s,t){return s&t},vDqzC:function(s,t){return s(t)},duFbe:function(s,t){return s&t},edYNq:r(1557),HAscy:r(1043)+"ame",oYjYo:r(1829)+"rValues",aRMXr:r(520),YnLWH:r(868),LPegj:function(s,t,n,i){return s(t,n,i)},HIUqu:function(s){return s()},gPbWx:r(506),JyFFQ:r(1193)+"r",RAXJA:r(1521),XwNmY:function(s,t,n,i){return s(t,n,i)},aYpDw:r(387),mSuyS:function(s,t,n){return s(t,n)},CSeqF:r(1334)+r(1553),BrdKy:"x_frontier_ttl",TeRyz:function(s,t,n,i){return s(t,n,i)},wdbqA:r(1248)+"s",RfvJJ:r(402)+r(753)+"ue",wgzdi:function(s,t){return s+t},pcayq:function(s){return s()},dHdoq:function(s){return s()},eVsCO:function(s){return s()},FxFQb:function(s,t){return s===t},GKbTH:function(s){return s()},oVbau:function(s,t){return s(t)},jzJNJ:function(s){return s()},MoQjb:function(s,t){return s<t},RrvZl:function(s,t){return s===t},ebJJJ:function(s,t){return s!==t},lsSZe:function(s,t,n){return s(t,n)},sGUag:function(s,t){return s===t},TkTNG:function(s,t,n){return s(t,n)},NIqrp:r(278),ioNOP:function(s,t){return s===t},IbZtg:function(s,t,n,i){return s(t,n,i)},eArec:function(s,t,n){return s(t,n)},nYuDJ:function(s,t,n){return s(t,n)},jnqUB:function(s,t,n){return s(t,n)},RmdJW:function(s,t){return s(t)},Iwqdr:r(240)+r(353),UCWuG:"CONTINUE",SyMzP:function(s,t){return s(t)},EGqDL:r(337)+"rovide w"+r(972)+r(1495)+r(791)+r(1272)+r(1403)+r(232),vAawf:"rTEFs",MuXqU:r(780),TaRTE:function(s,t,n){return s(t,n)},gaTVI:"online",RYoIM:r(997),PFHxG:function(s,t){return s!==t},utSda:"rtkYZ",BMKwF:r(1283),fVnvE:r(1721),WLgfx:r(627),VzcAW:function(s,t){return s||t},TFMXm:function(s,t){return s||t},CWUjO:function(s,t){return s!=t},JSpjv:function(s,t){return s||t},lHRuD:function(s,t){return s!=t},LFMQB:r(645)+r(297)+"d",BAcpd:function(s,t){return s!==t},AbVhL:r(817),wHhjn:r(1097),CsMbP:function(s,t){return s!==t},PZMAz:function(s,t){return s!==t},YdImV:"https:",weWxK:"ws://",DMohv:function(s,t){return s!==t},ZWphh:r(566),Ajart:r(1584),FtmPf:r(1256),kWWKl:"device_id",VRYlx:function(s,t){return s||t},cRcpS:r(337)+r(422)+r(1073)+r(1211)+r(861),TKuds:r(390),fAnEJ:"web",EVKfW:function(s){return s()},iLeRH:function(s,t,n){return s(t,n)},lEetv:function(s,t){return s(t)},TNLVn:function(s,t){return s(t)},EZVmI:function(s,t){return s>=t},HKmug:function(s,t){return s+t},aWMVX:function(s,t){return s|t},qkUVV:function(s,t){return s|t},TKNhW:r(456),UnteS:r(1052),hCZyA:function(s,t,n){return s(t,n)},KYaQM:r(1212),gJwdZ:r(1568),EUcjZ:function(s,t,n){return s(t,n)},cVaGh:function(s,t,n){return s(t,n)},fgPpB:r(1328)+"t",emmFf:function(s,t){return s>t},QAlHi:function(s,t,n){return s(t,n)},hpgmo:r(962),pMYKk:r(1684),rVXPd:function(s,t){return s|t},WPYyo:function(s,t){return s>>>t},mbAFe:function(s,t){return s<t},GuYrR:function(s,t){return s+t},kcaPL:function(s,t){return s>>>t},gPxKg:function(s,t){return s&t},cctLv:function(s,t){return s!==t},ljMyt:function(s,t){return s>>>t},yKxrK:function(s,t){return s>>>t},NxXfU:function(s,t){return s+t},jiXlh:function(s,t){return s!==t},VFsyf:function(s,t){return s|t},cLVxK:function(s,t){return s&t},adoTy:function(s,t){return s>>>t},nPMGH:function(s,t){return s!==t},QcTde:function(s,t){return s+t},lSaLu:function(s,t){return s&t},yfRcr:function(s,t){return s!==t},LbjdG:function(s,t){return s|t},zRjQt:function(s,t){return s&t},xukVS:r(751),VfTCZ:r(1596),lkIKV:r(1428)+">",gQkYN:function(s,t){return s*t},FPnWJ:r(1132),TNksf:r(1505)+"ay, try reconnec"+r(1698)+r(552),pImsJ:function(s,t,n){return s(t,n)},GbXtx:function(s,t,n,i,x){return s(t,n,i,x)},kTGsS:r(1706),iKQBx:r(1215),XwOAd:r(1058)+"0",WTsCb:"hxsKO",IzjpS:r(1004),YLfCX:r(960),wSGlI:r(406),mCIbd:function(s,t,n){return s(t,n)},LKjEu:r(692),LIeKL:function(s,t,n){return s(t,n)},YAvYf:r(1505)+"ay, netw"+r(250)+r(1109),FWGWT:r(1383),FPrqC:r(1735),PBKYW:r(978)+r(1459),SnLlz:"close, w"+r(608)+r(549)+r(874)+"ed",vCojJ:r(1559)+"s alread"+r(287),GRvBc:function(s,t){return s&t},PdrWO:function(s,t){return s>>>t},BpZxq:function(s,t){return s<t},LMuiT:function(s,t){return s<t},FhAJy:function(s,t){return s|t},JAhFz:function(s,t){return s<t},nrIwW:function(s,t){return s==t},GvPLj:r(337)+"rovide a"+r(795)+r(483)+r(557)+r(1279)+r(401)+r(536)+"ffer",xGGtl:r(532),zztVI:function(s,t){return s instanceof t},dHwlN:function(s,t){return s instanceof t},UHuXG:function(s,t){return s(t)},ahsJZ:function(s,t){return s(t)},MPqrN:function(s,t){return s(t)},LOVKH:function(s,t){return s||t},eSMUu:r(337)+r(497)+r(1297)+r(492),FXRrK:function(s,t){return s instanceof t},mUSyM:r(1651),aKqDB:r(1059),EaMVt:r(468)+"econnecting",oXQHP:function(s,t){return s(t)},dZnuT:function(s,t){return s(t)},SfEJS:function(s,t,n){return s(t,n)},dLgbQ:"\0\0\0\0\0\0\0\0",qxZPj:function(s,t){return s===t},fgZhi:function(s,t){return s!=t},IKNhL:r(915),DCZKx:function(s,t){return s===t},AGgMk:r(933),zvNKz:function(s,t){return s===t},uknQZ:r(762)+r(374)+r(1252)+"pe",bzsio:function(s,t){return s!=t},hgpIZ:function(s,t){return s===t},KPPeI:function(s,t){return s!=t},EAoUh:function(s,t){return s===t},YRwat:r(1357)+r(903)+"alScope",tDUQm:r(1481)+r(580)+r(942),xJvAj:function(s,t){return s===t},QSnrg:"__x_msg_"+r(768)};Se.r(V),Se.d(V,{FWS:()=>k0,CustomErrorEvent:()=>es,createCloseEvent:()=>_e,ReconnectEvent:()=>Qr,createErrorEvent:()=>le,decodedFrame:()=>Xr,createOpenEvent:()=>os,CustomCloseEvent:()=>ts,createReconnectEvent:()=>Xn,FrontierMessageEvent:()=>rs,encodeFrame:()=>Jn,createMessageEvent:()=>is,OpenEvent:()=>ss,ErrorCode:()=>Ue,Event:()=>st,MessageEvent:()=>ns});let o="";function a(s=""){let t=r,n="02",i=""+Date.now(),x=o||(o=e.PSYfp(m,s)),d=Math[t(558)]()[t(553)](16)[t(1749)](-6);return e.qcoRj(e[t(1802)](e[t(1802)](n,i),x),d)}function c(){let s=r;return e[s(1223)](e[s(1129)](1e4,Date.now()),Math[s(333)](e[s(1129)](1e4,Math[s(558)]())))}function u(s){let t=r;return e[t(1471)](e[t(327)](Array,8)[t(1247)]("0"),e.AdgBY(parseInt,s,10)[t(553)](2))[t(1749)](-8)}function l(s){let t=r;return e[t(1775)](Array(4).join("0"),parseInt(s,2).toString(16))[t(1749)](-4)}function p(s){let t=r,n={IgqqJ:function(i,x){return i(x)}};if(e.piibR(e[t(1225)],e.zVMvv))_0x13cc53=MrNZzZ[t(1653)](_0x364356,_0x414c22);else{let i=s[t(1120)](/\./)[t(1040)](h=>u(h)),x=[];return x[0]=e[t(327)](l,e.QPqiu(i[0],i[1])),x[1]=e[t(327)](l,i[2]+i[3]),[e[t(934)],e.DkUzV,"0000",t(1595),e[t(934)],e[t(719)],x[0],x[1]][t(1247)]("")}}function m(s){let t=r,n=/(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}/.test(s),i=/(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))/[t(1361)](s);return n?e[t(647)](p,s):i?e[t(691)](b,s):e[t(823)]}function b(s){let t=r,n="",i=[],x=0,d=0,h=!0,g=e[t(934)];if(e[t(777)](s[t(322)]("::"),-1)){let f=s[t(1120)]("::");for(let v=0;e[t(708)](v,f.length);v++){let C=f[v];if(e[t(777)](C.indexOf(":"),0)){let L=C[t(1120)](":");h&&(x=L[t(1239)]),d+=L.length;for(let B=0;B<L[t(1239)];B++)if(e[t(727)](4,L[B][t(1239)])){let P=g[t(579)+"g"](0,4-L[B][t(1239)]),U=P[t(1664)](L[B]);i.push(U)}else i[t(560)](L[B]);h=!1}else{if(e.RSLvn(4,C[t(1239)])){let L=g[t(579)+"g"](0,e[t(805)](4,C.length)),B=L.concat(C);i[t(560)](B)}else i[t(560)](C);h&&(x+=1),d+=1,h=!1}}let _="";for(let v=0;e[t(1846)](v,e[t(805)](8,d));v++)_=_[t(1664)](g);for(let v=0;e[t(1846)](v,i[t(1239)]);v++)if(e[t(1640)](v,x))if(e[t(237)](e.WYROp,e.YUvsr))n=n[t(1664)](_),n=n.concat(i[v]);else return _0x59d909[t(534)+t(1609)][1]?void 0:_0x21ee72[t(534)+"ore"](_0x175b58["objectSt"+t(1609)][0]);else n=n[t(1664)](i[v]);return n}{let f=s[t(1120)](":");for(let _=0;_<f[t(1239)];_++){let v=f[_];if(e.UDHxV(4,f[_].length)){let C=g[t(579)+"g"](0,4-f[_][t(1239)]),L=C[t(1664)](v);n=n.concat(L)}else n=n[t(1664)](v)}return n}}function w(s,t){let n=r,i=s.key;e.PAYSs(void 0,i)&&(ee(t,10),e[n(976)](Le,t,i));let x=s.value;if(e[n(1422)](void 0,x))if(n(650)===e[n(1516)])e[n(256)](ee,t,18),e[n(1667)](Le,t,x);else{let d=new _0x457883(e.jpmXm(2,_0x460f37));d[n(1739)](_0x4e0c1a),_0x59d019.bytes=d}}function y(s){let t=r,n={};e:for(;!e[t(1200)](ye,s);){let i=e.PSYfp(re,s);switch(i>>>3){case 0:break e;case 1:n[t(1074)]=e.AdgBY(De,s,e[t(1400)](re,s));break;case 2:n[t(1047)]=e[t(1750)](De,s,e.ZlZbr(re,s));break;default:e[t(256)](oe,s,e[t(1205)](7,i))}}if(e.EaYxZ(void 0,n[t(1074)]))throw new Error(e.DjKem);if(n[t(1047)]===void 0)throw new Error(e[t(1771)]);return n}function E(s){let t=r,n=e[t(551)](H);return e[t(339)](T,s,n),e[t(1400)](ze,n)}function T(s,t){let n=r,i={LFXAe:function(O,R,Z){return e[D(1414)](O,R,Z)},VNkpJ:e[n(836)]},x=s.SeqID;e[n(1743)](void 0,x)&&(ee(t,8),e[n(976)](bt,t,x));let d=s[n(1118)];e[n(1269)](void 0,d)&&(e[n(256)](ee,t,16),bt(t,d));let h=s[n(1589)];e[n(1848)](void 0,h)&&(ee(t,24),e[n(502)](bt,t,e[n(1637)](ce,h)));let g=s.method;if(e[n(1241)](void 0,g))if(e[n(1743)]("FtQzD",e[n(1165)])){let O=this["_endpoin"+n(590)]?.[n(496)+n(1551)+"es"](),R=this[n(270)+n(590)]?.[n(1274)+n(722)+"nt"]();if(O&&!_0x30dcf5[n(816)]){let Z=n(1483)+R+(" fail, m"+n(1270)+n(1287)+"ed");this[n(730)+n(1425)+"ent"](i[n(469)](_0x2e8aa1,i[n(1096)],{message:Z,code:_0xb27a31[n(1450)+n(563)+"R"],error:_0x2fc51e}));return}this[n(1152)]&&this[n(1152)].readyState===this[n(1103)]&&this._disconnect(),this["_dispatc"+n(1425)+n(921)](i[n(469)](_0x512c47,"error",{message:_0x3fa3d4.message,code:_0x4ddc85[n(1473)+n(225)],error:_0x1b7fca}))}else ee(t,32),e[n(256)](bt,t,e[n(691)](ce,g));let f=s[n(1139)];if(e[n(1269)](void 0,f))for(let O of f){e.uRwvP(ee,t,42);let R=e[n(551)](H);e.UXtVP(w,O,R),e.SogNc(ee,t,R.limit),Pe(t,R),e[n(1479)](J,R)}let _=s[n(1302)+n(700)];e[n(910)](void 0,_)&&(e.mYCkr(ee,t,50),e[n(462)](Le,t,_));let v=s[n(651)+n(671)];e[n(727)](void 0,v)&&(ee(t,58),e[n(1414)](Le,t,v));let C=s[n(686)];e[n(1556)](void 0,C)&&(e[n(1180)](ee,t,66),e[n(502)](ee,t,C[n(1239)]),e[n(994)](Ut,t,C));let L=s.LogIDNew;L!==void 0&&(e[n(994)](ee,t,74),Le(t,L));let B=s["serverTi"+n(1070)];B!==void 0&&(e[n(479)](ee,t,82),e.KbwSW(Le,t,B));let P=s.msgID;e[n(864)](void 0,P)&&(e[n(286)](ee,t,90),e.bbRvL(Le,t,P));let U=s[n(1244)+"e"];e[n(1031)](void 0,U)&&(ee(t,96),e[n(1351)](bt,t,e[n(355)](ce,U)))}function k(s){let t=r;return e[t(1479)](N,e[t(1200)](Ae,s))}function N(s){let t=r,n={};e:for(;!e[t(1400)](ye,s);)if(e.veWTg(e[t(1626)],e[t(1626)])){let i=e[t(355)](re,s);switch(e[t(936)](i,3)){case 0:break e;case 1:n[t(1623)]=Jr(s,!0);break;case 2:n[t(1118)]=e[t(1750)](Jr,s,!0);break;case 3:n[t(1589)]=e[t(867)](re,s);break;case 4:n[t(634)]=re(s);break;case 5:if(e.WKWNq(e[t(832)],e[t(832)])){let x=e.CSLaa(G,s);(n.headers||(n[t(1139)]=[])).push(e[t(1448)](y,s)),s[t(1575)]=x;break}else _0x5ec31f[t(1838)+"entListener"](t(1202),_0x35353f),_0x1459d6[t(1838)+"entListener"](fIcaXf[t(836)],_0x38d769);case 6:n[t(1302)+t(700)]=De(s,e[t(1299)](re,s));break;case 7:n[t(651)+t(671)]=e[t(643)](De,s,e[t(396)](re,s));break;case 8:n[t(686)]=qt(s,e[t(1542)](re,s));break;case 9:n[t(1677)]=e[t(1673)](De,s,e[t(367)](re,s));break;case 10:n.serverTiming=e[t(1503)](De,s,e[t(1528)](re,s));break;case 11:n[t(1616)]=e[t(381)](De,s,e[t(1400)](re,s));break;case 12:n[t(1244)+"e"]=re(s);break;default:oe(s,e[t(338)](7,i))}}else{let i=e[t(890)][t(1120)]("|"),x=0;for(;;){switch(i[x++]){case"0":if(_0xf8f08[t(982)+"e"])return e[t(1775)](_0xaee7b8[t(982)+"e"](_0x377042,_0x2b352b),_0x44e694);continue;case"1":return _0x3c3e8e(_0x3c6186,_0x328454,_0x3ba10f)+_0x1e6989;case"2":if(!_0xe98352)return _0x323fa4;continue;case"3":if(_0x25bdd3[t(1239)]<40)return e[t(543)](_0x586a07,_0x34cafd,_0x56f8aa,_0x1ff4c2)+_0x4a5209;continue;case"4":if(_0x44ed25.write)return e.uBwHW(_0x562980[t(1746)](_0x40ec2f,_0x29b63f),_0x4fcb85);continue}break}}if(n.SeqID===void 0)throw new Error(e[t(1453)]);if(n.LogID===void 0)throw new Error(e[t(1188)]);if(n.service===void 0)throw new Error(e.PluqQ);if(e[t(1547)](void 0,n[t(634)]))throw new Error(t(843)+t(773)+t(1019)+t(634));return n}function G(s){let t=r,n=e[t(647)](re,s),i=s[t(1575)];return s[t(1575)]=e[t(860)](s[t(1195)],n),i}function oe(s,t){let n=r;switch(t){case 0:for(;e[n(300)](128,e[n(1781)](de,s)););break;case 2:e[n(905)](be,s,e[n(1781)](re,s));break;case 5:e[n(234)](be,s,4);break;case 1:e[n(1667)](be,s,8);break;default:throw new Error(e[n(724)](e[n(640)],t))}}function ce(s){let t=r;return s|=0,{low:s,high:e.jIIRG(s,31),unsigned:e[t(311)](s,0)}}let I=[];function H(){let s=r,t=I[s(1355)]();return t?(t[s(1195)]=t[s(1575)]=0,t):{bytes:new Uint8Array(64),offset:0,limit:0}}function J(s){I[r(560)](s)}function Ae(s){return{bytes:s,offset:0,limit:s[r(1239)]}}function ze(s){let t=r,n=s[t(1268)],i=s[t(1575)];return e[t(1130)](n.length,i)?n:n[t(1115)](0,i)}function be(s,t){let n=r;if(e.ZjtHF(e.dBVeR(s[n(1195)],t),s[n(1575)]))throw new Error(e[n(1693)]);s[n(1195)]+=t}function ye(s){let t=r;return e[t(1146)](s[t(1195)],s[t(1575)])}function me(s,t){let n=r,i=s[n(1268)],x=s[n(1195)],d=s[n(1575)],h=e[n(999)](x,t);if(e[n(777)](h,i.length)){let g=new Uint8Array(e[n(1129)](2,h));g[n(1739)](i),s[n(1268)]=g}return s[n(1195)]=h,e[n(508)](h,d)&&(s[n(1575)]=h),x}function nt(s,t){let n=r,i=s[n(1195)];if(e[n(1354)](e[n(724)](i,t),s[n(1575)]))throw new Error(e.ePENo);return s.offset+=t,i}function qt(s,t){let n=r,i=e[n(502)](nt,s,t);return s.bytes[n(1115)](i,e[n(366)](i,t))}function Ut(s,t){let n=r,i=me(s,t[n(1239)]);s[n(1268)].set(t,i)}function De(s,t){let n=r,i={cdMwn:function(x,d){return e.Fcefz(x,d)},VqBbA:function(x,d){return e[D(996)](x,d)},hPxvn:function(x,d){return e[D(1112)](x,d)},YgBqN:function(x,d){return e[D(1130)](x,d)},rEyIT:function(x,d){return e[D(649)](x,d)},dGjuc:function(x,d){return e[D(1082)](x,d)},JOZPA:function(x,d){return e[D(1602)](x,d)}};if(e[n(910)](e.PKmhn,e[n(799)]))return this[n(866)+n(707)]==this[n(1662)+"s"][n(1239)]?!0:i[n(988)](this[n(759)+n(1843)+n(1607)+"t"],this[n(1783)+"es"]);{let x=e[n(1750)](nt,s,t),d=String[n(863)+n(1789)],h=s[n(1268)],g="\uFFFD",f="";for(let _=0;e[n(708)](_,t);_++){let v=h[e[n(1223)](_,x)],C,L,B,P;if(e[n(1130)](e.drNxn(128,v),0))f+=e[n(231)](d,v);else if(e.EaYxZ(e[n(1082)](224,v),192))e[n(1602)](_,1)>=t?f+=g:(C=h[e[n(1602)](e[n(1837)](_,x),1)],e[n(749)](192&C,128)?f+=g:(P=e[n(524)](e[n(690)](e[n(689)](31,v),6),e.hlcdT(63,C)),P<128?f+=g:(f+=d(P),_++)));else if(e[n(313)](e[n(862)](240,v),224))if(e[n(586)](e.hOGxS(_,2),t))f+=g;else if(e[n(306)](n(909),"nKjoN"))if(C=h[e[n(400)](_,x)+1],L=h[e[n(400)](e.bEZym(_,x),2)],(e[n(245)](C,L<<8)&49344)!==32896)f+=g;else if(P=e[n(495)](e[n(1251)](e[n(554)](e[n(1177)](15,v),12),e[n(1572)](63,C)<<6),e.zkqNI(63,L)),P<2048||e.kFzGZ(P,55296)&&e[n(1605)](P,57343))f+=g;else if(e.XVynq(e.pxipZ,n(321)))f+=e[n(1671)](d,P),_+=2;else return;else{let U=0,O=0;for(let R=0;i.VqBbA(R,_0x30f070[n(1239)]);++R)O=_0x3be149[n(1680)+"At"](R),i[n(1236)](O,128)?U+=1:i[n(1288)](O,2048)?U+=2:i[n(1345)](64512&O,55296)&&i[n(1102)](i.dGjuc(64512,_0x4b3655.charCodeAt(i[n(801)](R,1))),56320)?(++R,U+=4):U+=3;return U}else e[n(1011)](248,v)==240?e[n(586)](e[n(1175)](_,3),t)?f+=g:(C=h[e[n(1471)](_+x,1)],L=h[e.xMtOm(_,x)+2],B=h[e[n(1322)](e[n(1544)](_,x),3)],e.TZKdP(e[n(689)](e[n(448)](C|e[n(238)](L,8),e[n(932)](B,16)),12632256),8421504)?f+=g:(P=e.wqzZd(e.JoaVj(e[n(1251)]((7&v)<<18,(63&C)<<12),e[n(1454)](e.EXdew(63,L),6)),e[n(1142)](63,B)),e[n(1112)](P,65536)||e.FBWlp(P,1114111)?f+=g:(P-=65536,f+=d(e[n(999)](P>>10,55296),e[n(1695)](e.mdLpB(1023,P),56320)),_+=3))):f+=g}return f}}function Le(s,t){let n=r,i={Ielwn:e[n(533)],MiyEO:function(f,_){return e[n(936)](f,_)},yuFYD:function(f,_){return e[n(924)](f,_)},GrAZI:function(f,_){return f|_},sLZWg:function(f,_){return e[n(826)](f,_)},DDIcW:function(f,_){return e[n(1424)](f,_)},nANJB:function(f,_){return e[n(1846)](f,_)},wVFXF:function(f,_){return e[n(1443)](f,_)},qnOFN:function(f,_){return e[n(1251)](f,_)},cqBhK:function(f,_){return f|_},vqEcc:function(f,_){return e.WWzRZ(f,_)},FDfpk:function(f,_){return e[n(1601)](f,_)},xckKL:function(f,_,v,C){return f(_,v,C)}},x=t[n(1239)],d=0;for(let f=0;e[n(474)](f,x);f++){let _=t[n(1680)+"At"](f);e[n(311)](_,55296)&&e[n(1321)](_,56319)&&e[n(708)](e[n(1779)](f,1),x)&&(_=e[n(458)](_<<10,t.charCodeAt(++f))-56613888),d+=e.tDYcP(_,128)?1:e.uBmWT(_,2048)?2:e.HgftX(_,65536)?3:4}e[n(905)](ee,s,d);let h=e[n(715)](me,s,d),g=s[n(1268)];for(let f=0;e[n(1238)](f,x);f++){let _=t[n(1680)+"At"](f);if(_>=55296&&e[n(1751)](_,56319)&&e[n(1699)](e.xMtOm(f,1),x)&&(_=e.fyEBR(e[n(1454)](_,10)+t[n(1680)+"At"](++f),56613888)),e[n(591)](_,128))g[h++]=_;else{if(e[n(1112)](_,2048))g[h++]=e.WKQKJ(_,6)&31|192;else{if(e[n(708)](_,65536))g[h++]=e[n(279)](e.rAdYg(e[n(1088)](_,12),15),224);else if(e[n(1208)](e[n(1844)],e[n(523)])){let v=4294967295;return function(C,L,B=!0){let P=n,U=i[P(1676)][P(1120)]("|"),O=0;for(;;){switch(U[O++]){case"0":v=i[P(974)](127&C[L],0);continue;case"1":if(C[L++]<128)return{value:B?v:0|v,offset:L};continue;case"2":v=i.yuFYD(i.GrAZI(v,i[P(1823)](i[P(865)](127,C[L]),14)),0);continue;case"3":if(i[P(360)](C[L++],128))return{value:B?v:0|v,offset:L};continue;case"4":if(i[P(360)](C[L++],128))return{value:B?v:i[P(822)](0,v),offset:L};continue;case"5":v=i[P(822)](v,i[P(1228)](127,C[L])<<21)>>>0;continue;case"6":if(i[P(360)](C[L++],128))return{value:B?v:i.GrAZI(0,v),offset:L};continue;case"7":if(i[P(360)](C[L++],128))return{value:B?v:0|v,offset:L};continue;case"8":return{value:B?v:i[P(822)](0,v),offset:L};case"9":v=i[P(916)](i.qnOFN(v,i[P(1823)](i[P(865)](127,C[L]),7)),0);continue;case"10":v=i.MiyEO(i.cqBhK(v,i[P(702)](15,C[L])<<28),0);continue;case"11":if(i[P(785)](L+=5,C[P(1239)]))throw L=C.length,i[P(1847)](_0x3117da,L,10,C[P(1239)]);continue}break}}}else g[h++]=e[n(1127)](e[n(1011)](e.PjuqK(_,18),7),240),g[h++]=e[n(906)](e[n(1088)](_,12),63)|128;g[h++]=e.MqSnR(_>>6,63)|128}g[h++]=e[n(1127)](e[n(300)](63,_),128)}}}function Pe(s,t){let n=r,i=e[n(905)](me,s,t[n(1575)]),x=s[n(1268)],d=t[n(1268)];for(let h=0,g=t[n(1575)];h<g;h++)x[e[n(366)](h,i)]=d[h]}function de(s){let t=r;return s[t(1268)][e[t(994)](nt,s,1)]}function Gr(s,t){let n=r,i=e[n(286)](me,s,1);s[n(1268)][i]=t}function re(s){let t=r,n=0,i=0,x;do x=de(s),n<32&&(i|=e[t(937)](e[t(1443)](127,x),n)),n+=7;while(128&x);return i}function ee(s,t){let n=r;if(e.jdXNv(n(1464),n(1464)))try{this[n(1152)]&&this[n(1152)][n(463)](_0x3d95fc,_0x5a08db)}catch{}else{for(t>>>=0;t>=128;)e.kFfLi(Gr,s,e[n(340)](e.drNxn(127,t),128)),t>>>=7;e[n(1711)](Gr,s,t)}}function Jr(s,t){let n=r,i=0,x=0,d=0,h;if(h=e.xFlzM(de,s),i=e[n(246)](127,h),128&h&&(h=e[n(327)](de,s),i|=e[n(1454)](e[n(555)](127,h),7),e[n(1136)](128,h))){if(e[n(1411)](e.orjbZ,e[n(1290)]))return n(509)+"_"+this[n(349)];h=e[n(963)](de,s),i|=e.abwRN(e[n(689)](127,h),14),e.jXWGc(128,h)&&(h=e.HXWkb(de,s),i|=e[n(826)](e[n(431)](127,h),21),128&h&&(h=e[n(1299)](de,s),x=e.UnCqe(127,h),e[n(1443)](128,h)&&(h=e[n(664)](de,s),x|=e[n(1454)](127&h,7),e[n(1082)](128,h)&&(h=de(s),x|=(127&h)<<14,128&h&&(h=e[n(1387)](de,s),x|=e[n(1501)](127&h,21),e.UnCqe(128,h)&&(h=e[n(1164)](de,s),d=127&h,e[n(361)](128,h)&&(h=e.PAbnV(de,s),d|=e.kCcRA(e[n(797)](127,h),7))))))))}return{low:e[n(1477)](i,e[n(690)](x,28)),high:e[n(279)](e[n(936)](x,4),e[n(1472)](d,24)),unsigned:t}}function bt(s,t){let n=r,i=e[n(936)](t[n(1163)],0),x=e[n(936)](e.dMPGN(e[n(936)](t[n(1163)],28),e[n(1585)](t[n(1645)],4)),0),d=e[n(936)](t[n(1645)],24),h=e.qbzYn(0,d)?e[n(1592)](0,x)?i<16384?e[n(1458)](i,128)?1:2:e[n(1410)](i,2097152)?3:4:e[n(1458)](x,16384)?e.zWBYd(x,128)?5:6:x<2097152?7:8:e[n(1458)](d,128)?9:10,g=e.UGanu(me,s,h),f=s.bytes;switch(h){case 10:f[e[n(366)](g,9)]=e[n(797)](e.feGsI(d,7),1);case 9:f[g+8]=e[n(540)](9,h)?128|d:e[n(1512)](127,d);case 8:f[e[n(1273)](g,7)]=e[n(1269)](8,h)?e[n(1259)](x>>>21,128):x>>>21&127;case 7:f[e.LupBU(g,6)]=e[n(540)](7,h)?e[n(245)](x>>>14,128):e[n(1424)](e[n(924)](x,14),127);case 6:f[g+5]=e[n(855)](6,h)?e[n(728)](x,7)|128:e[n(1443)](e[n(1599)](x,7),127);case 5:f[e[n(999)](g,4)]=e[n(1269)](5,h)?128|x:127&x;case 4:f[e[n(467)](g,3)]=h!==4?e[n(1108)](e.XmFsL(i,21),128):e[n(936)](i,21)&127;case 3:f[e[n(356)](g,2)]=e[n(1411)](3,h)?e[n(495)](i>>>14,128):e[n(1136)](e[n(924)](i,14),127);case 2:f[g+1]=h!==2?i>>>7|128:e[n(555)](i>>>7,127);case 1:f[g]=h!==1?e[n(495)](128,i):e[n(592)](127,i)}}function Xr(s){return e[r(969)](k,s)}function Jn(s){return E(s)}let Vr=65536,Fo=e[r(1386)],rt=e[r(1129)](Vr,Vr),Yr=e.jpmXm(rt,rt),Zr=Yr/2,qe=String.prototype[r(1680)+"At"];class z{constructor(t,n,i){let x=r;if(e[x(1543)]!==e[x(1543)])return new _0x57b756(_0x4cc130,{data:_0x1da06b});this.isLong=!0,this[x(1163)]=0|t,this[x(1645)]=e[x(1108)](0,n),this[x(1271)]=!!i}static[r(927)](t){return t&&e[r(1050)](!0,t.isLong)}static[r(941)](t,n,i){return new z(t,n,i)}static fromBytes(t,n,i){let x=r;return i?z[x(587)+"sLE"](t,n):z[x(587)+"sBE"](t,n)}static[r(587)+r(1445)](t,n){let i=r;return new z(e[i(524)](e[i(1294)](t[0],e[i(932)](t[1],8))|e[i(238)](t[2],16),t[3]<<24),e[i(1477)](e[i(1320)](t[4],e[i(1366)](t[5],8))|e[i(1171)](t[6],16),e[i(1510)](t[7],24)),n)}static[r(587)+r(825)](t,n){let i=r;if(i(542)===i(542))return new z(e[i(524)](e.eiNpr(t[4],24)|e[i(1472)](t[5],16)|e.sPFAm(t[6],8),t[7]),e.JoaVj(e.mKdAI(e[i(1675)](t[0],24),e[i(304)](t[1],16)),e[i(1585)](t[2],8))|t[3],n);this[i(1388)+i(644)]=null}static[r(1763)](t){let n=r;return e.MtOux(t,Fo)?$r:new z(e[n(936)](e[n(1108)](e[n(1093)](e[n(1320)](qe[n(1482)](t,0),e.SLYKZ(qe.call(t,1),8)),e[n(932)](qe[n(1482)](t,2),16)),e[n(1472)](qe[n(1482)](t,3),24)),0),e[n(936)](e[n(1251)](qe.call(t,4)|e.rKzeE(qe[n(1482)](t,5),8)|e[n(690)](qe[n(1482)](t,6),16),e.oGcMG(qe.call(t,7),24)),0),!0)}[r(758)](){let t=r;return String["fromChar"+t(1789)](255&this[t(1163)],e.feGsI(this[t(1163)],8)&255,e[t(807)](e.XmFsL(this[t(1163)],16),255),e[t(1562)](this[t(1163)],24),e[t(609)](255,this[t(1645)]),e.FAqZR(e[t(1277)](this[t(1645)],8),255),e[t(661)](this[t(1645)],16)&255,e[t(1700)](this[t(1645)],24))}static[r(1412)+"er"](t,n=!0){let i=r;if(e[i(664)](isNaN,t))return n?Ko:$r;if(n){if(t>=Yr)return Wo}else{if(e.ElWxx(t,-Zr))return jo;if(e.KJWPx(e[i(1600)](t,1),Zr))return Ho}return z.fromBits(e[i(405)](e[i(1327)](t,rt),0),e.NSPXh(e[i(1461)](t,rt),0),n)}[r(1376)](){let t=r;return this.unsigned?e[t(1261)](e[t(1800)](this.high,0)*rt,e[t(624)](this[t(1163)],0)):e[t(1837)](e.jpmXm(this[t(1645)],rt),this.low>>>0)}[r(312)](){let t=r,n={Hjdak:function(i){return e.AnrTn(i)}};if(e.qbzYn(e[t(328)],e[t(328)]))return e[t(735)](0,this[t(1645)])&&this[t(1163)]===0;{let i=this[t(270)+"tManager"]?.[t(1274)+t(722)+"nt"]();this[t(1131)](t(601)+i),n[t(1608)](_0x327e34)}}[r(902)](t){let n=r;z.isLong(t)||(t=z[n(1412)+"er"](t));let i=this.high>>>16,x=e.cmrjK(65535,this[n(1645)]),d=this[n(1163)]>>>16,h=e.RQWWq(65535,this[n(1163)]),g=e[n(1092)](t[n(1645)],16),f=65535&t[n(1645)],_=e[n(936)](t[n(1163)],16),v=e[n(985)](65535,t.low),C=0,L=0,B=0,P=0;return P+=e[n(1775)](h,v),B+=P>>>16,P&=65535,B+=e[n(954)](d,_),L+=e.lXsHL(B,16),B&=65535,L+=e.wxHyC(x,f),C+=L>>>16,L&=65535,C+=e[n(1319)](i,g),C&=65535,z[n(941)](e[n(1323)](B,16)|P,e.VNIsB(e[n(1099)](C,16),L),this.unsigned)}[r(1815)](t){let n=r;return z[n(927)](t)||(t=z.fromNumber(t)),e[n(540)](this[n(1271)],t.unsigned)&&e[n(585)](this[n(1645)],31)===1&&e[n(1382)](t[n(1645)],31)===1?!1:e[n(1580)](this[n(1645)],t[n(1645)])&&e[n(1208)](this.low,t.low)}[r(1761)](){let t=r;return e[t(306)](-1,this[t(1163)])&&e[t(1130)](-1,this[t(1645)])?z[t(941)](0,0,this[t(1271)]):e[t(1420)](-1,this[t(1163)])?z[t(941)](0,e[t(981)](this[t(1645)],1),this[t(1271)]):z[t(941)](this[t(1163)]+1,this[t(1645)],this[t(1271)])}[r(229)](t){let n=r;return t?this[n(1612)+"E"]():this[n(1712)+"E"]()}toBytesLE(){let t=r,n=this[t(1645)],i=this[t(1163)];return[e.twgYS(255,i),e.SgWhF(i,8)&255,e[t(1522)](i>>>16,255),e[t(1277)](i,24),255&n,e[t(620)](n,8)&255,e[t(1343)](n,16)&255,n>>>24]}[r(1712)+"E"](){let t=r;if(e.CKAAU(t(1039),e[t(1065)])){let n=this.high,i=this[t(1163)];return[e[t(1029)](n,24),e.OLPOX(e[t(243)](n,16),255),e[t(300)](e[t(879)](n,8),255),255&n,e[t(1284)](i,24),e[t(1025)](i>>>16,255),e.IRnjo(e[t(913)](i,8),255),e.aiSwG(255,i)]}else{let n=t(1483)+_0x585ea1+(t(382)+"ax retri"+t(1287)+"ed");this[t(730)+"hErrorEv"+t(921)](e[t(1811)](_0xd5002d,e[t(836)],{message:n,code:_0x503b3a[t(1450)+t(563)+"R"],error:_0x4b80db}));return}}}let $r=new z(0,0,!1),Ko=new z(0,0,!0),Ho=z[r(941)](-1,2147483647,!1),Wo=z.fromBits(-1,-1,!0),jo=z.fromBits(0,-2147483648,!1);var Ue=(function(s){let t=r;return s[s[e[t(1552)]]=5001]=e[t(1552)],s[s[t(629)+t(594)]=5002]=t(629)+"NG_ERROR",s[s[e[t(1371)]]=5003]=t(1450)+t(563)+"R",s[s[e[t(1697)]]=5004]=e[t(1697)],s[s[e[t(248)]]=5005]=e[t(248)],s})({});class st{constructor(t){let n=r;if(e.eKgcZ(e.zbUGX,e[n(447)]))this.type=t,this[n(1518)]=null;else return this[n(759)+n(1843)+n(1607)+"t"]++,this[n(1274)+"ntEndpoint"]()}}class Qr extends st{constructor(t,n){let i=r;if(e.qupFq(e.DwYMe,e.DwYMe)){let x=e[i(470)](this[i(1594)][i(1302)+i(700)],_0x482228)?{force:!!this[i(1594)][i(1302)+i(700)][i(653)],encoding:this[i(1594)]["payloadE"+i(700)][i(1840)]?this[i(1594)][i(1302)+"ncoding"][i(1840)][i(1167)](/\s/g,"")[i(364)+i(408)]():""}:{force:!1,encoding:this[i(1594)][i(1302)+"ncoding"]?this[i(1594)][i(1302)+i(700)][i(1167)](/\s/g,"")[i(364)+"ase"]():""},d=_0x5f4fe3[i(1302)+i(700)]?_0x53f9d6[i(1302)+"ncoding"][i(1167)](/\s/g,"")["toLowerC"+i(408)]():"",h=this[i(1594)][i(651)+"ype"]instanceof _0x105de7?{force:!!this[i(1594)][i(651)+i(671)].force,type:this[i(1594)][i(651)+i(671)][i(659)]?this._options[i(651)+"ype"][i(659)][i(1167)](/\s/g,"")[i(364)+i(408)]():""}:{force:!1,type:this._options["payloadT"+i(671)]?this[i(1594)][i(651)+i(671)][i(1167)](/\s/g,"")[i(364)+i(408)]():""},g=_0x334019[i(651)+"ype"]?_0x555ef6[i(651)+i(671)][i(1167)](/\s/g,"")[i(364)+i(408)]():"",f=h[i(653)]?h.type:g||h[i(659)],_=x[i(653)]?x[i(1840)]:d||x[i(1840)],v=[e[i(272)],e[i(1286)],i(616)+i(935)+i(547)+i(625),e.gvsJp],C=[i(873)+"e",e[i(1486)]];this[i(1594)]["enableTr"+i(1548)+"extPayload"]&&v[i(380)](f)&&(!_||C[i(380)](_))?_0x26bebc[i(1550)+i(307)]=e.QdOfU(_0x44fb82,_0x7402c7[i(686)],0,_0xf68484[i(686)][i(515)+"th"]):_0x116e17[i(1550)+"oad"]=""}else super(t),this.message=n&&n[i(816)]||null}}class es extends st{constructor(t,n){let i=r,x=e.jEagr[i(1120)]("|"),d=0;for(;;){switch(x[d++]){case"0":this[i(1526)]=n&&n[i(1526)]||0;continue;case"1":this[i(816)]=n&&n[i(816)]||"";continue;case"2":this[i(387)]=n&&n[i(387)]||5001;continue;case"3":this.lineno=n&&n[i(430)]||0;continue;case"4":this[i(247)]=n&&n[i(247)]||"";continue;case"5":super(t);continue;case"6":this[i(330)]=n&&n.error||null;continue}break}}}class ts extends st{constructor(t,n){let i=r,x=e.lQUsk[i(1120)]("|"),d=0;for(;;){switch(x[d++]){case"0":this[i(1235)]=n&&n[i(1235)]||"";continue;case"1":super(t);continue;case"2":this.wasClean=n&&n[i(1619)]||!1;continue;case"3":this[i(1201)+"nnect"]=n&&n[i(1201)+i(770)]||!1;continue;case"4":this[i(387)]=n&&n[i(387)]||0;continue}break}}}class ns extends st{constructor(t,n){let i=r;super(t),this[i(550)]=n&&n[i(550)]||null}}class rs extends ns{constructor(t,n){let i=r;e[i(476)](e[i(227)],i(323))?(super(t),this.data=n&&n[i(550)]||null,this.message=n&&n.message||null):this[i(1152)]&&this._ws[i(463)](_0xdd8ffe,_0x146f0e)}}class ss extends st{constructor(t,n){let i=r;super(t),this[i(550)]=n&&n[i(550)]||null}}function le(s,{message:t,code:n,error:i}){let x=r;if(x(764)===x(764))return new es(s,{message:t,code:n,error:i});_0x5770fc=e.dMPGN(e[x(877)](15&_0x25e1b3,12),e[x(1231)](63&_0x1c0a76,6))|e[x(1430)](63,_0x4f9aa7),e[x(1846)](_0x3d8791,2048)||_0x1918e4>=55296&&_0x46d5d6<=57343?_0x39358a+=_0x13ab6b:(_0x1adede+=e[x(647)](_0xb9cd15,_0xcf70cc),_0x268e17+=2)}function _e(s,{code:t,reason:n,wasClean:i,willReconnect:x}){let d=r;if(e[d(837)](d(1822),d(1822))){let h=(d(798)+"3|5")[d(1120)]("|"),g=0;for(;;){switch(h[g++]){case"0":_0x28631d[_0x1f891e++]=e[d(1765)](_0xf3e8e0>>18,240);continue;case"1":_0x5a1c0e=e[d(677)](e[d(1709)](65536,e[d(1402)](1023&_0x240fc1,10)),e[d(807)](1023,_0x5aeb7c));continue;case"2":++_0x535767;continue;case"3":_0x853c11[_0x28f7f8++]=e[d(1251)](e.vDtOP(_0x2082b5>>6,63),128);continue;case"4":_0x2bcc90[_0x11598f++]=e[d(263)](e[d(1356)](_0x248997,12)&63,128);continue;case"5":_0x4da453[_0x1f744d++]=e[d(266)](63,_0x28fc91)|128;continue}break}}else return new ts(s,{code:t,reason:n,wasClean:i,willReconnect:x})}function is(s,{data:t,message:n}){return new rs(s,{data:t,message:n})}function os(s,{data:t}){let n=r;return e.HLUms(n(1808),n(1648))?new ss(s,{data:t}):{bytes:_0x42a958,offset:0,limit:_0x226ff3.length}}function Xn(s,{message:t}){return new Qr(s,{message:t})}class as{constructor(t,n){let i=r;this.endpoints=t,this.maxRetries=n,this[i(866)+i(707)]=0,this[i(759)+"ndpointTriesCount"]=0}[r(931)+r(315)+r(1590)](){let t=r;this[t(866)+t(707)]=0,this[t(759)+t(1843)+t(1607)+"t"]=0}[r(568)+"es"](){let t=r;this[t(759)+t(1843)+t(1607)+"t"]=0}["getCurre"+r(722)+"nt"](){let t=r;return this[t(1662)+"s"][this["currentI"+t(707)]]}[r(1274)+r(722)+r(740)+r(584)](){return this.currentEndpointTriesCount}[r(496)+r(1551)+"es"](){let t=r;return!!(this[t(866)+"ndex"]>=this[t(1662)+"s"][t(1239)]||e.eKgxC(this[t(866)+t(707)],e[t(805)](this.endpoints[t(1239)],1))&&e[t(488)](this[t(759)+t(1843)+"riesCount"],this[t(1783)+"es"]))}[r(1406)+r(485)+r(1530)+"hedMaxRetries"](){let t=r;return this[t(866)+"ndex"]==this.endpoints[t(1239)]?!0:e[t(1324)](this[t(759)+"ndpointT"+t(1607)+"t"],this.maxRetries)}[r(1042)+r(1339)+"pointAnd"+r(1683)+r(302)](){let t=r;return t(1243)===e[t(1685)]?(this[t(759)+"ndpointT"+t(1607)+"t"]=1,this[t(866)+t(707)]++,this[t(1662)+"s"][this.currentIndex]):!!this._qosDB}[r(1274)+r(722)+r(1066)+"ateCount"](){let t=r;if(e[t(480)](e[t(733)],e[t(577)]))_0x2e4350=t(566),_0x682e01=_0x4a8c6f[t(1167)](/(^http)((?:[s]*:\/\/))/,""),_0x364ac6=/(^ws)((?:[s]*:\/\/))/[t(1361)](_0x1f355b)?_0x352bd7:""+_0x1f3daf+_0x44928f;else return this[t(759)+t(1843)+t(1607)+"t"]++,this[t(1274)+"ntEndpoint"]()}}let it=(e[r(1429)](r(1752)+"d",typeof globalThis)&&e[r(842)](r(915),globalThis[r(1826)+r(986)].name)||e[r(1797)](r(1752)+"d",typeof window)&&e[r(782)]===window["construc"+r(986)][r(852)])&&e.eOlfZ(e.hIHVr,typeof document),Ge=e[r(1429)](e[r(1517)],typeof globalThis)&&(e[r(1158)](e[r(1278)],globalThis[r(1826)+r(986)][r(852)])||e[r(1669)](e.uknQZ,globalThis[r(1826)+r(986)][r(852)]))&&e[r(1192)](r(1752)+"d",typeof tt),yt=(e.lHRuD(e.hIHVr,typeof globalThis)&&e[r(743)](r(933),globalThis[r(1826)+r(986)][r(852)])||e[r(1517)]==typeof globalThis||e.lHRuD(e[r(1517)],typeof globalThis)&&!!globalThis.WeixinJSBridge)&&e.KPPeI(e[r(1517)],typeof wx),vt=e[r(1517)]!=typeof globalThis&&(e[r(1293)](r(762)+r(374)+r(1252)+"pe",globalThis["construc"+r(986)][r(852)])||e[r(1790)](e.YRwat,globalThis[r(1826)+r(986)][r(852)])||e[r(1373)]===globalThis.constructor[r(852)])&&e[r(1192)](e[r(1517)],typeof self),Go=e[r(1517)]!=typeof globalThis&&e.wasfg(e.AGgMk,globalThis[r(1826)+r(986)][r(852)])&&e[r(1517)]!=typeof global&&e[r(348)](e[r(1278)],global[r(1826)+r(986)].name)&&e[r(1797)](r(1752)+"d",typeof process)&&!!process.version;class Vn{constructor(){let t=r;if(e[t(802)](t(1549),t(513)))this[t(446)+"rs"]={};else return this._qosDB[t(992)+t(1702)]()}emit(t,...n){let i=r;if(e.zEqTo(e.HUAJM,e.vWkKC))this[i(1152)]&&this[i(1152)][i(440)](_0x4f5080),this._debug(e[i(1162)],_0x508b66);else{let x=this[i(446)+"rs"][t];if(x)x.slice()[i(503)](d=>d.fn[i(1812)](d[i(880)],n));else if(e[i(836)]===t&&!this[i(652)])if(i(804)==="fJEPg"){let d=this[i(977)][i(1229)+"geInfoSync"](this._prefix),h=_0x23db94[i(818)](d||"{}");return _0x3e4f1e.values(h)}else{let d=n[i(1239)]&&n[0];if(d instanceof Error)throw d;let h=new Error(e[i(1309)](e.ejkri,d?" ("+d[i(816)]+")":""));throw h.context=d,d}return this}}[r(319)](t,n){let i=r;if(t===void 0)this._listeners={};else if(e[i(1478)](void 0,n))this[i(446)+"rs"][t]=null;else{let x=this[i(446)+"rs"][t];if(x)for(let d=0;e[i(1689)](d,x[i(1239)]);)e.lJdux(x[d].fn,n)?x[i(834)](d,1):++d}return this}on(t,n,i){let x=r;return(this[x(446)+"rs"][t]||(this[x(446)+"rs"][t]=[]))[x(560)]({fn:n,ctx:i||this}),this}}class Jo extends Vn{["_formatE"+r(745)+r(952)](t){let n=r;if(e.rSegC(e[n(1791)],e[n(1791)]))_0x36d4dd=_0x337417[n(1680)+"At"](_0x150c40),_0x519661<128?_0x1a1d85+=1:e[n(1485)](_0x585946,2048)?_0x5e9091+=2:e[n(574)](64512&_0x3613c5,55296)&&e[n(546)](64512,_0x27e7b6[n(1680)+"At"](_0x429f81+1))===56320?(++_0x43740c,_0x49dd6a+=4):_0x127584+=3;else return t[n(844)]||t[n(658)]?(n(489)+" "+(t[n(844)]||"")+n(1515)+(t[n(658)]||""))[n(511)]():JSON[n(1437)+"y"](t)}constructor(t,n,i){let x=r;super(),this[x(269)]=null,yt&&wx[x(737)+x(320)]&&(this[x(269)]=wx[x(737)+"ocket"]({url:t,protocols:n,header:i,fail:this[x(539)+x(1555)+x(626)].bind(this),success:this[x(539)+x(756)+"cessHand"+x(1036)][x(252)](this)})),Ge&&tt["connectS"+x(320)]&&(this[x(269)]=tt["connectS"+x(320)]({url:t,protocols:n,header:i,fail:this[x(539)+x(1555)+x(626)][x(252)](this),success:this[x(539)+x(756)+"cessHand"+x(1036)][x(252)](this)}))}["_createS"+r(756)+r(955)+r(1036)](){let t=r;if(e.GyOFq===e[t(750)])Promise.resolve()[t(604)](()=>{this["_addWsLi"+t(262)]()});else return _0xf665c4}["_createS"+r(1555)+"lHandler"](t){let n=r,i={KaZYj:e[n(365)],GCCVt:function(x,d,h){return e[n(339)](x,d,h)},LMBmi:e[n(836)]};Promise[n(1687)]().then(()=>{let x=n;if(i[x(303)]==="msKuD")_0xc7066f[x(1550)+x(307)]="",_0x38976e.log(_0x5a9f16);else{let d=i[x(623)](le,i[x(384)],{message:this[x(1727)+"rrorMess"+x(952)](t)});this.emit(i[x(384)],d);let h=i.GCCVt(_e,"close",{reason:this[x(1727)+x(745)+x(952)](t)});this[x(1304)](x(463),h)}})}[r(1810)+r(262)](){let t=r,n={LduVi:function(i,x){return i(x)}};if(e[t(434)](t(491),e[t(1470)]))this[t(269)][t(1759)](i=>{let x=t;this[x(1304)](e[x(1263)],e[x(1351)](os,e[x(1263)],{...i,data:i[x(844)]||""}))}),this[t(269)].onClose(i=>{let x=t;this[x(1304)](x(463),_e(e[x(514)],{...i}))}),this[t(269)].onMessage(i=>{this[t(1304)](e.uXYtv,e.ZFIsU(is,e.uXYtv,{...i}))}),this[t(269)].onError(i=>{let x=t;e[x(1347)](x(1732),e[x(885)])?(_0x185436["frontier"+x(1144)]=void 0,n.LduVi(_0x47db91,x(415)+"reason")):this[x(1304)](e[x(836)],e[x(643)](le,e[x(836)],{...i,message:i[x(844)]||""}))});else{let i=_0x17da5e[t(1482)](fIcaXf[t(1159)](_0x2fd2d2,this),_0x1203e1,..._0x3cbb20);return _0x33630c[t(1739)](i,_0x6574be[t(1708)]?_0x42e55b[t(1708)]():[_0x663093]),_0x1736e0(i)}}[r(440)](t){let n=r;if(e[n(1032)](t,Uint8Array)){let i=t[n(1378)][n(1749)](t[n(1787)+"et"],e[n(1175)](t.byteLength,t[n(1787)+"et"]));this[n(269)]&&this[n(269)][n(440)]({data:i,fail:x=>{let d=n;this[d(1304)](e[d(836)],e[d(1666)](le,e[d(836)],{message:this[d(1727)+"rrorMess"+d(952)](x)}))}})}else this[n(269)]&&this[n(269)].send({data:t,fail:i=>{let x=n;this[x(1304)](e.YAeQt,e[x(1666)](le,e[x(836)],{message:this[x(1727)+x(745)+x(952)](i)}))}})}close(t,n){let i=r,x={sZoDm:function(d,h){return e[D(1299)](d,h)},pQBrK:e.GVmBT,pHTth:function(d){return e[D(551)](d)}};if(e.jZxde(e[i(1150)],e[i(369)])){let d={MkZXR:fIcaXf[i(1692)],GdZty:i(330),rtwcp:fIcaXf[i(1603)],Virfy:function(_){return _()},OJYxD:function(_){return fIcaXf.AAagX(_)}},h=()=>{let _=i;_0x195221["removeEv"+_(1091)+_(991)](d[_(979)],g),_0x4b589a["removeEv"+_(1091)+_(991)](d[_(1717)],f),_0x2d829a["removeEv"+_(1091)+_(991)](d[_(922)],f)},g=()=>{let _=i;d.Virfy(_0x19d68b),d[_(1338)](h)},f=()=>{let _=i;yYVytT.sZoDm(_0x3414c8,_0x18b559[_(330)]||new _0x1c2c48("AbortError",yYVytT[_(599)])),yYVytT.pHTth(h)};_0x6b4b39[i(1627)+"Listener"](i(1222),g),_0x3d86f5[i(1627)+"Listener"](fIcaXf[i(836)],f),_0x371401[i(1627)+i(662)](fIcaXf[i(1603)],f)}else this[i(269)]&&this[i(269)][i(463)]({code:t,reason:n})}[r(1627)+r(662)](t,n){let i=r;e[i(1203)]!==e[i(1203)]?(e.dmMwg(_0x18fd68,_0x45da3e,74),e[i(512)](_0x3daa9f,_0x538b10,_0x516cfa)):this.on(t,n)}[r(1838)+r(1091)+r(991)](t,n){this[r(319)](t,n)}get[r(1367)+"te"](){let t=r;return this[t(269)][t(1367)+"te"]}get[r(258)+"pe"](){let t=r;return this[t(269)][t(258)+"pe"]}set[r(258)+"pe"](t){}get[r(1622)](){let t=r;return this[t(269)][t(1622)]}get protocol(){let t=r;return this._socket[t(1063)]}get extensions(){let t=r;return this._socket[t(1733)+"ns"]}get[r(271)+r(277)](){return 0}}function Xo(s,t){let n=r;if(t)return new t(s[n(1622)],s.protocol);if(e[n(1841)](yt,Ge))return new Jo(s[n(1622)],s.protocol,s[n(1139)]);if(e[n(1841)](it,vt)&&n(1752)+"d"!=typeof WebSocket&&WebSocket)return new WebSocket(s[n(1622)],s[n(1063)+"s"])}function Vo(s){let t=r,n={dZUfP:function(i,x){return e[D(1303)](i,x)},fvSPy:function(i,x){return e.DYkel(i,x)}};if(e[t(749)](e.ImuMN,t(1754))){let i="1|2|3|4|0"[t(1120)]("|"),x=0;for(;;){switch(i[x++]){case"0":return!1;case"1":if(s)return!0;continue;case"2":if(yt&&wx[t(737)+"ocket"])return!0;continue;case"3":if(Ge&&tt[t(737)+t(320)])return!0;continue;case"4":if(e[t(1841)](it,vt)&&e.eOlfZ("undefined",typeof WebSocket)&&WebSocket)return!0;continue}break}}else{let i=_0x5ce4b3.split(":");for(let x=0;VxjbnL[t(1172)](x,i.length);x++){let d=i[x];if(i[x][t(1239)]!==4){let h=_0x4b6fb0.substring(0,VxjbnL[t(840)](4,i[x].length)),g=h[t(1664)](d);_0x7b8ad6=_0x27e217[t(1664)](g)}else _0x4f3189=_0x31cb19.concat(d)}return _0x4d0e49}}function xs(s,t,n){let i=r,x={iAvWQ:function(g,f){return e.haHnZ(g,f)},NBGiV:e[i(1816)],RlaND:function(g,f){return g===f},vVKpK:function(g,f){return e[i(1181)](g,f)}},d=-1;async function h(g){let f=i;return x[f(1227)](g,d)?Promise.reject(new Error(x[f(1710)])):(d=g,x.RlaND(g,n[f(1239)])?Promise[f(1687)]():n[g].bind(s)(t,h.bind(null,x.vVKpK(g,1))))}e[i(436)](h,0)}function cs(s){let t=r,n={LJych:function(d,h){return e[D(274)](d,h)},DjSLa:function(d,h){return d&h},HrjVC:function(d,h){return d&h},pYDRF:function(d,h){return e[D(913)](d,h)},kEuoN:function(d,h){return d&h}},i=0,x=0;for(let d=0;d<s.length;++d)if(e[t(1793)]===e[t(1439)]){let h=this[t(1645)],g=this.low;return[WLUsCX.LJych(h,24),WLUsCX[t(1581)](h>>>16,255),WLUsCX.DjSLa(WLUsCX[t(1318)](h,8),255),WLUsCX[t(1581)](255,h),g>>>24,g>>>16&255,WLUsCX[t(442)](WLUsCX[t(414)](g,8),255),WLUsCX[t(1534)](255,g)]}else x=s[t(1680)+"At"](d),x<128?i+=1:x<2048?i+=2:e[t(338)](64512,x)===55296&&e[t(1478)](e[t(1071)](64512,s[t(1680)+"At"](e.mFfzd(d,1))),56320)?(++d,i+=4):i+=3;return i}function us(s,t,n){let i=r;if(e.UHJqv(e[i(372)],"pQrUh")){let x={qQFzr:function(d,h,g){return d(h,g)}};return new _0xe7213d(d=>{let h=i;x[h(1660)](_0x5ce0d4,d,this["_getInte"+h(1123)+"e"](_0x597818))})}else{if(e[i(708)](e.GbMBj(n,t),1))return"";let x="";for(let d=t;e[i(1112)](d,n);){let h=s[d++];if(h<=127)x+=String[i(863)+i(1789)](h);else if(h>=192&&h<224)x+=String[i(863)+"Code"](e[i(1307)](e[i(1154)](e[i(883)](31,h),6),e[i(1177)](63,s[d++])));else if(h>=224&&h<240)x+=String[i(863)+"Code"](e.cuCrX(e[i(1251)](e[i(1136)](15,h)<<12,e[i(1186)](e[i(1427)](63,s[d++]),6)),e[i(1011)](63,s[d++])));else if(e[i(586)](h,240)){if(e[i(1086)](i(1161),e[i(726)]))return new _0x1a4d67(_0x318769,{data:_0x44dff0,message:_0x415e0e});{let g=e[i(1740)](e[i(911)](e.ILRQm(e[i(393)](e[i(1427)](7,h),18),e[i(932)](e[i(1363)](63,s[d++]),12)),e[i(637)](e[i(980)](63,s[d++]),6))|63&s[d++],65536);x+=String[i(863)+i(1789)](e[i(677)](55296,e[i(398)](g,10))),x+=String[i(863)+i(1789)](e.tDsTk(56320,1023&g))}}}return x}}function Yn(s,t,n){let i=r,x=n,d,h;for(let g=0;g<s[i(1239)];++g)if(d=s[i(1680)+"At"](g),d<128)t[n++]=d;else if(e[i(945)](d,2048))t[n++]=d>>6|192,t[n++]=e[i(1127)](63&d,128);else if(e[i(1014)](e[i(1363)](64512,d),55296)&&e[i(1519)](e[i(1363)](64512,h=s[i(1680)+"At"](e[i(1289)](g,1))),56320))if(e.fxZIV(e[i(713)],e[i(713)]))d=e.AaLDf(e[i(1837)](65536,e[i(1472)](e[i(1207)](1023,d),10)),e[i(769)](1023,h)),++g,t[n++]=e[i(1088)](d,18)|240,t[n++]=e[i(1728)](e.IIIub(e[i(581)](d,12),63),128),t[n++]=e[i(1087)](e[i(1469)](d,6)&63,128),t[n++]=e[i(1196)](63&d,128);else return _0x29e8da||(_0x2a04c5=[_0x8f05d6,_0x5d29ba,_0x2ff79c,_0x22c4b2,_0x4232fa]);else{if(e.PAYSs("lvzZi",e.AfmMm))return e.SJESz(_0xd534dd,_0x271081);t[n++]=e[i(1469)](d,12)|224,t[n++]=e[i(1075)](e[i(993)](d>>6,63),128),t[n++]=e[i(279)](e[i(1572)](63,d),128)}return e[i(290)](n,x)}async function fs(s){let t=r;if(e[t(1452)]==typeof s){let n=new Uint8Array(e[t(1528)](cs,s));return e[t(1409)](Yn,s,n,0),n}return e.VkGFN(s,ArrayBuffer)?new Uint8Array(s):new Uint8Array(s[t(1378)],s.byteOffset,s.byteLength)}function Yo(s){let t=r;try{return e[t(732)](e[t(1452)],typeof s)&&(s instanceof ArrayBuffer||s.buffer&&e[t(416)](s[t(1378)],ArrayBuffer))||t(1611)!=typeof s?"":(JSON[t(818)](s),e[t(1286)])}catch{return e[t(441)](e[t(1452)],typeof s)?e[t(272)]:""}}let Zo=(s,t)=>{let n=r,i={SRbqS:function(x,d){return e[D(593)](x,d)},hpMGl:function(x,d){return x<d},DdhHj:function(x,d){return e.vaSXv(x,d)},RqCpa:function(x,d){return e.rBozC(x,d)},mWZgQ:function(x,d){return e[D(723)](x,d)},qYmnE:function(x,d){return e[D(1734)](x,d)},kBcOK:function(x,d){return e[D(1647)](x,d)},XiWDG:function(x,d){return e[D(1785)](x,d)},txePP:function(x,d){return e[D(493)](x,d)},hmFCN:function(x,d){return e[D(405)](x,d)},kpKHM:function(x,d){return x<<d},XOSCw:function(x,d){return e[D(716)](x,d)},CkHdc:function(x,d){return e[D(1110)](x,d)},LvNPX:function(x,d){return x>>d},YTNdN:function(x,d){return e[D(1205)](x,d)}};if(e[n(1381)](n(1756),e.nimaj)){let x=_0xaf9adb[_0x103a4a++];if(lQsEgU[n(420)](x,127))_0x4932e7+=_0x208ea8["fromChar"+n(1789)](x);else if(x>=192&&lQsEgU[n(1049)](x,224))_0xaa08b3+=_0x2bc6f3[n(863)+n(1789)](lQsEgU[n(729)](lQsEgU[n(603)](31,x)<<6,63&_0x15718a[_0x1404aa++]));else if(lQsEgU[n(1010)](x,224)&&x<240)_0x1d9b47+=_0x1ceb0d[n(863)+"Code"](lQsEgU.qYmnE(lQsEgU[n(729)](lQsEgU[n(951)](lQsEgU[n(603)](15,x),12),lQsEgU.RqCpa(63,_0x3f2701[_0x335412++])<<6),lQsEgU[n(968)](63,_0x4ee9bd[_0x1f5955++])));else if(x>=240){let d=lQsEgU[n(1742)](lQsEgU[n(1504)](lQsEgU.hmFCN(lQsEgU[n(951)](7&x,18),lQsEgU[n(1567)](lQsEgU[n(603)](63,_0x22173c[_0xf6e19a++]),12)),lQsEgU[n(646)](63&_0x468bbf[_0x4d55f7++],6))|63&_0x1281f1[_0xba0f08++],65536);_0x39e411+=_0x2c5abd[n(863)+n(1789)](lQsEgU[n(1845)](55296,lQsEgU.LvNPX(d,10))),_0x17abbc+=_0x874a67[n(863)+n(1789)](lQsEgU.CkHdc(56320,lQsEgU.YTNdN(1023,d)))}}else switch(s){case n(1558):case e.UHgaS:return{["x-use-"+s]:1,"x-tt-env":t};default:return{}}};class $o{constructor(t){let n=r;e[n(1640)](e.vIYXP,e[n(983)])?(e[n(479)](_0xf6763d,_0x108af3,58),e[n(853)](_0x41dc3f,_0x47d492,_0x24e90e)):(this[n(612)+n(584)]=t,this[n(1368)]=0)}[r(1574)](){this.count++}[r(496)+r(617)+"nt"](){let t=r;if(e[t(1535)]===e[t(1535)])return e[t(311)](this[t(1368)],this[t(612)+"ount"]);this[t(977)]?.[t(463)](),this[t(977)]=void 0}[r(1417)+r(1766)](t=0){let n=r;this[n(612)+n(584)]=t,this.count=0}}async function Qo(s){let t=r,n={lRtJv:t(415)+t(1235),wKGhm:function(i,x){return e[t(1743)](i,x)},QzbcL:e.TvUAn,qbWfQ:function(i,x){return e[t(680)](i,x)},LsEwa:function(i,x){return e.bHXqZ(i,x)},mArfT:e[t(228)],IioNc:t(965),VVeMd:t(1770)+t(1834),qPeLK:e[t(1539)],KJtzS:e[t(289)]};return new Promise(i=>{let x=t,d={zMfvP:function(g,f){return g(f)},ZxEDo:n[x(754)]};if(n[x(827)](x(1174),n.QzbcL)){let g=_0x3cae46[x(1268)],f=_0x353c7f[x(1575)];return g[x(1239)]===f?g:g[x(1115)](0,f)}else{if(!it)return n.qbWfQ(i,n.lRtJv);try{if(n.LsEwa(x(796),n[x(588)]))for(var h in _0x4126f8)_0x3876b3.o(_0x53a134,h)&&!_0x175358.o(_0x591ca5,h)&&_0x4a6d36[x(1831)+x(1111)](_0x500c5c,h,{enumerable:!0,get:_0xe8b27[h]});else{let g=document.createElement(n[x(345)]);window[x(509)+"JSONP"]=f=>{let _=x;document.body[_(794)+_(1026)](g),window[_(509)+"JSONP"]=void 0,d[_(1342)](i,f&&f.msg||d[_(510)])},g[x(659)]=n.VVeMd,g.src=s[x(1167)](/^ws/,x(242))+n[x(1718)];try{document[x(676)][x(285)+x(1026)](g)}catch{x(894)===n[x(833)]?this["_addWsLi"+x(262)]():document[x(676)][x(794)+x(1026)](g)}}}catch{window["frontier"+x(1144)]=void 0,i(x(415)+x(1235))}}})}function Fe(s,t,n){let i=r;if(e[i(1488)](e[i(912)],"BkrdW")){let x=_0x424873[i(1120)](/\./)[i(1040)](g=>_0x591d4f(g)),d=[];return d[0]=_0x44725b(x[0]+x[1]),d[1]=e.xFlzM(_0x2f09f1,e.MHKtN(x[2],x[3])),[i(1595),e[i(934)],e.DkUzV,e.DkUzV,e[i(934)],e[i(719)],d[0],d[1]].join("")}else return!!s?.[i(471)](x=>x[i(1074)]===t&&x.value===n)}function ot(s,t){let n=r;return s?.[n(471)](i=>i.key===t)?.[n(1047)]}let Zn=null;async function e0(){let s=r;return Zn||(Zn=Promise[s(1687)]()[s(604)](Se[s(252)](Se,e[s(748)]))),Zn}class t0 extends Vn{constructor(t,n){let i=r;super(),this[i(326)]=t,this._keyPath=n,this[i(977)]=void 0,this[i(1388)+i(644)]=null}async[r(1540)](){let t=r,n={bnexF:e[t(1311)]};e[t(749)](e[t(1577)],e[t(1577)])?(this[t(347)+t(1148)].push(_0x15edff),this[t(1131)](n[t(1586)],_0x3c06f5)):await this._init()}async _init(){let t=r,n={phRCE:function(i){return e[D(551)](i)},soLsk:function(i,x,d,h){return e[D(607)](i,x,d,h)}};if(!this[t(977)]){if(this[t(1388)+"mise"])return this[t(1388)+t(644)];try{if(e[t(281)](e[t(1455)],e[t(858)])){let i=this[t(326)],x=this._keyPath;this["_initPro"+t(644)]=(async()=>{let d=t,{openDB:h}=await n.phRCE(e0);this[d(977)]=await n[d(760)](h,d(509)+"_"+i,1,{upgrade(g){g["createOb"+d(276)+"e"](i,{keyPath:x})}})})(),await this[t(1388)+t(644)]}else _0x228f95.d=(i,x)=>{for(var d in x)_0x5536d1.o(x,d)&&!_0xd6b1f7.o(i,d)&&_0x59a722.defineProperty(i,d,{enumerable:!0,get:x[d]})}}catch(i){console[t(613)](i)}finally{this[t(1388)+"mise"]=null}}}async[r(1792)](t){let n=r,i={bOaSb:function(x,d){return e.CSLaa(x,d)},cFKDL:function(x){return e[D(1768)](x)}};if(e[n(1587)]===e[n(678)]){let x={cMTOz:fIcaXf.Lrmxv,jqaGn:function(f,_){return fIcaXf.EGsJY(f,_)},AGgAL:function(f,_){return f(_)}},d=()=>{let f=n;_0x10283f[f(1838)+f(1091)+"ner"](x[f(1634)],h),_0x4dd5f9[f(1838)+f(1091)+"ner"](f(330),g)},h=()=>{let f=n;x[f(521)](_0x313fbc,x[f(477)](_0x283d8f,_0x49945f.result)),d()},g=()=>{let f=n;WOScLb.bOaSb(_0x3d7137,_0x584eb1.error),WOScLb[f(1044)](d)};_0x205740[n(1627)+n(662)](n(1202),h),_0x3a7d6d[n(1627)+n(662)](fIcaXf.YAeQt,g)}else try{return await this[n(1078)](),this[n(977)]?.[n(1792)](this[n(326)],t)}catch(x){if(e[n(1128)](e[n(472)],n(1730)))console[n(613)](x);else{let d="4|1|0|2|3".split("|"),h=0;for(;;){switch(d[h++]){case"0":if(_0x3ffaf7&&_0x421182[n(737)+n(320)])return!0;continue;case"1":if(_0xe81713&&_0x30e483["connectS"+n(320)])return!0;continue;case"2":if(e[n(1151)](_0x5381bc,_0x219200)&&e[n(1517)]!=typeof _0x353d7b&&_0x984158)return!0;continue;case"3":return!1;case"4":if(_0x584521)return!0;continue}break}}}}async[r(1739)](t,n){let i=r;return await this[i(1078)](),this[i(977)]?.[i(1182)](this[i(326)],t)}async del(t){let n=r;try{return await this[n(1078)](),this[n(977)]?.[n(299)](this[n(326)],t)}catch(i){console[n(613)](i)}}async[r(1178)](){let t=r;try{return await this[t(1078)](),this[t(977)]?.[t(1178)](this[t(326)])}catch(n){console.log(n)}}async[r(1825)](){let t=r;return e[t(845)](e.oxVZh,e[t(886)])?this[t(977)]?.[t(1005)](_0x355c83):(await this[t(1078)](),this._qosDB?.[t(819)+"ys"](this[t(326)]))}async getAll(){let t=r;if(e[t(257)](e[t(971)],e.EWOFn))return await this[t(1078)](),this._qosDB?.getAll(this[t(326)]);e[t(504)](_0x57b437,e.Lrmxv),this[t(319)](e.BOKgN,_0x2a9e61),this[t(319)](e[t(453)],_0x2ef1f0)}async[r(363)](){let t=r;try{this[t(977)]?.close(),this[t(977)]=void 0}catch(n){if(e[t(656)](e[t(386)],e.kHyyT))console.log(n);else return e[t(821)](_0x307b9b,_0x21b162)?_0x261608:new _0x58d66a(e.TKTYm(e[t(1108)](e[t(1463)](_0x431b4c[t(1482)](_0x5378d7,0),_0x515114[t(1482)](_0x51f2a7,1)<<8),e[t(1099)](_0xebc051.call(_0x13b394,2),16))|e.FhNuv(_0x47e6fa[t(1482)](_0x29d585,3),24),0),e.MkXrr(e.SZnjd(e[t(260)](e[t(279)](_0x2626e7[t(1482)](_0xe67dbd,4),e[t(628)](_0x2c40de.call(_0xfccc15,5),8)),e[t(1330)](_0x25fd11[t(1482)](_0x5668e1,6),16)),_0xdbb049[t(1482)](_0x1e5c73,7)<<24),0),!0)}}get[r(957)](){let t=r,n={itbtZ:function(i,x){return e[D(1509)](i,x)},mODXg:function(i,x){return e[D(1127)](i,x)},EbcpQ:function(i,x){return e[D(600)](i,x)},neOcn:function(i,x){return e.ViudO(i,x)},jRmjm:function(i,x){return i<<x},JNuJS:function(i,x){return e[D(1501)](i,x)},SYypa:function(i,x){return e[D(1493)](i,x)},XCYFN:function(i,x){return i<x},qhkvv:function(i,x){return e[D(1606)](i,x)},aNgLD:function(i,x,d){return e.rxffp(i,x,d)},Wwmpu:function(i,x){return e[D(1250)](i,x)}};if(e[t(1576)]===e.gZUtX)this[t(1131)](e[t(519)],_0x5a32ad[t(816)]),e.YkIhS(_0x4560bc);else try{if(e[t(427)](e[t(1349)],e[t(1349)]))return!!this[t(977)];_0x938778=VKCnTS[t(900)](VKCnTS[t(1631)](VKCnTS.mODXg(VKCnTS.EbcpQ(VKCnTS[t(675)](7,_0xbaf123),18),VKCnTS.jRmjm(VKCnTS.neOcn(63,_0x2fee32),12)),VKCnTS[t(1644)](VKCnTS[t(752)](63,_0x593a4e),6)),VKCnTS[t(675)](63,_0x2f074c)),VKCnTS[t(820)](_0x3283c6,65536)||VKCnTS[t(1741)](_0x2e6911,1114111)?_0x87c198+=_0x49b2fe:(_0x21c679-=65536,_0xa79dfb+=VKCnTS[t(421)](_0x513bb3,VKCnTS.Wwmpu(_0x4ea996,10)+55296,(1023&_0x234d42)+56320),_0x37f2ca+=3)}catch(i){return console.log(i),!1}}}class n0{constructor(t,n){let i=r;if(e.UHJqv(e[i(1492)],i(1833)))if(_0x48dc08=_0x36f2ac[i(1680)+"At"](_0x3b102b),e.NRaqF(_0x2822ce,128))_0x6e0e9a[_0x4c5b19++]=_0x401f9e;else if(e.XuRRt(_0x23d6ee,2048))_0x5b7e8b[_0x30c0ca++]=e[i(1531)](e[i(953)](_0x188ea8,6),192),_0x3fc0e9[_0x2f955c++]=e[i(1214)](63&_0x3fb9da,128);else if((64512&_0x2287de)===55296&&e[i(1652)](e[i(1803)](64512,_0x16af61=_0x51e32a[i(1680)+"At"](_0x208b22+1)),56320)){let x=e[i(526)][i(1120)]("|"),d=0;for(;;){switch(x[d++]){case"0":_0x29a567[_0x5f386a++]=e[i(279)](e.YoYpB(_0x24f568,18),240);continue;case"1":_0x140977[_0x26f2a3++]=e.ZehyV(e[i(809)](63,_0x2547da),128);continue;case"2":_0x8c14c3=e.oZmSe(65536+e[i(1366)](1023&_0x365bd8,10),1023&_0x23d88a);continue;case"3":++_0x994449;continue;case"4":_0xf64bd4[_0x2a0c8f++]=e[i(1087)](e[i(1177)](e[i(251)](_0x2d1e0e,6),63),128);continue;case"5":_0xbc536d[_0x2a802e++]=e[i(1803)](e[i(1250)](_0x1cd56b,12),63)|128;continue}break}}else _0x480492[_0x1b7f93++]=e[i(1075)](e[i(778)](_0x1fa8df,12),224),_0x2b0087[_0x16e8aa++]=e.Ljcjg(e.iwmIM(_0x48ca47,6)&63,128),_0x65615d[_0x311198++]=e[i(635)](e[i(1803)](63,_0x4289b0),128);else this[i(349)]=t,this._pathKey=n,this._qosDB=localStorage}async[r(1540)](){}get[r(1254)](){let t=r;return t(509)+"_"+this[t(349)]}async[r(1792)](t){let n=r,i=this[n(977)].getItem(this[n(1254)]);return JSON[n(818)](e[n(1197)](i,"{}"))[t]}async[r(1739)](t,n){let i=r,x=this[i(977)].getItem(this[i(1254)]),d=JSON.parse(e[i(1061)](x,"{}"));return d[n||t[this._pathKey]]=t,this[i(977)][i(1686)](this[i(1254)],JSON[i(1437)+"y"](d)),n||t[this[i(437)]]}async del(t){let n=r,i={EFCRu:function(x,d,h){return e[D(1401)](x,d,h)}};if(e.YNnfL!=="SmbDg"){let x=this._qosDB[n(1703)](this[n(1254)]),d=JSON[n(818)](e[n(589)](x,"{}"));return d[t]=void 0,this[n(977)][n(1686)](this[n(1254)],JSON.stringify(d))}else{let{value:x,offset:d}=i[n(1230)](_0x2fb52e,_0x347b44,_0x201460);_0x162514=d,_0x1e162f=_0x10eb6f<<8>>>0,_0x3f1b03+=x}}async clear(){let t=r;return this[t(977)][t(1178)]()}async[r(1825)](){let t=r,n=this[t(977)][t(1703)](this[t(1254)]),i=JSON[t(818)](e[t(385)](n,"{}"));return Object[t(1825)](i)}async[r(1198)](){let t=r,n=this[t(977)][t(1703)](this._prefix),i=JSON[t(818)](e[t(824)](n,"{}"));return Object[t(1392)](i)}[r(363)](){return Promise[r(1687)]()}get[r(957)](){return!!this[r(977)]}}class r0{constructor(t,n){let i=r;this[i(349)]=t,this._pathKey=n,this[i(977)]=Ge?tt:yt?wx:null}async[r(1540)](){}get[r(1254)](){return r(509)+"_"+this._DBName}async[r(1792)](t){let n=r,i=this[n(977)][n(1229)+n(325)](this[n(1254)]);return JSON[n(818)](e[n(589)](i,"{}"))[t]}async[r(1739)](t,n){let i=r,x=this._qosDB[i(1229)+i(325)](this[i(1254)]),d=JSON[i(818)](e[i(1841)](x,"{}"));return d[n||t[this._pathKey]]=t,this[i(977)][i(721)+"geSync"](this._prefix,JSON[i(1437)+"y"](d)),n||t[this[i(437)]]}async[r(1005)](t){let n=r,i=this[n(977)][n(1229)+n(325)](this[n(1254)]),x=JSON[n(818)](e[n(589)](i,"{}"));return x[t]=void 0,this[n(977)][n(721)+n(325)](this[n(1254)],JSON.stringify(x))}async[r(1178)](){let t=r;return this[t(977)][t(992)+t(1702)]()}async[r(1825)](){let t=r,n=this[t(977)].getStorageInfoSync(this[t(1254)]),i=JSON[t(818)](e.ryzrl(n,"{}"));return Object[t(1825)](i)}async[r(1198)](){let t=r,n=this._qosDB[t(1229)+t(1332)+"nc"](this[t(1254)]),i=JSON.parse(e.IUxId(n,"{}"));return Object[t(1392)](i)}[r(363)](){let t=r,n={Tkfvj:function(i,x,d){return i(x,d)}};if(e[t(1476)]==="shTcX"){let i=this[t(270)+t(590)]?.getCurrentEndpoint();this[t(730)+"hCloseEvent"](n[t(1582)](_0x5361ce,t(463),{code:_0x251ade[t(387)],reason:"connecting faile"+t(897)+t(1561)+t(475)+t(1084)+i})),this["_endpoin"+t(590)]?.[t(931)+t(315)+"fig"](),this[t(261)+"sCounter"]?.[t(1417)+"nter"]();return}else return Promise[t(1687)]()}get[r(957)](){return!!this[r(977)]}}function ds(s,t){let n=r;if(n(908)!==e.BMNhk){let i=e[n(684)][n(1120)]("|"),x=0;for(;;){switch(i[x++]){case"0":this["_readyCl"+n(699)]=!1;continue;case"1":this[n(1204)]=!0;continue;case"2":this["_endpoin"+n(590)]?.[n(931)+n(315)+"fig"]();continue;case"3":this[n(261)+n(831)]?.[n(1417)+"nter"]();continue;case"4":this[n(1441)]();continue}break}}else{if(e[n(556)](Ge,Ge))return new r0(s,t);if(e[n(385)](it,vt)&&e[n(259)](e[n(1517)],typeof indexedDB))return new t0(s,t);if((it||vt)&&e[n(732)](e[n(1517)],typeof localStorage))return new n0(s,t);throw new Error(n(645)+"DB failed")}}class s0{constructor(){let t=r;this[t(317)+t(1056)+"Id"]=null,this[t(317)+"l"]=36e5,this[t(977)]=e[t(1315)](ds,e.hrsbx,e[t(830)])}async[r(317)+r(443)](){let t=r,n={GLDso:function(i,x){return e[D(358)](i,x)},NZEFO:function(i,x){return i(x)},mCLlU:function(i,x,d){return e[D(286)](i,x,d)}};if(e[t(1014)](e[t(1715)],"cCpKa"))clearInterval(this[t(317)+t(1056)+"Id"]),this[t(317)+"lTimeoutId"]=setInterval(()=>{this[t(755)+"ired"]()},this[t(317)+"l"]);else return sJJuiD[t(947)](sJJuiD[t(1814)](_0x3ec8c1,8)[t(1247)]("0"),sJJuiD[t(1573)](_0x566c37,_0x365270,10)[t(553)](2))[t(1749)](-8)}async[r(1540)](){let t=r,n={XkzNW:function(i,x){return e[D(1138)](i,x)},KAten:"GFWtk",TCSRm:e[t(1405)]};if(e[t(1293)](e[t(578)],e[t(1408)])){let i=this[t(1645)],x=this.low;return[e[t(361)](255,x),x>>>8&255,e[t(1207)](e[t(1284)](x,16),255),x>>>24,e[t(1629)](255,i),e[t(266)](e[t(428)](i,8),255),i>>>16&255,e[t(1599)](i,24)]}else await this._qosDB[t(1540)]()[t(604)](()=>{let i=t;if(n[i(806)](n[i(767)],n[i(1639)]))return this[i(1152)]?this._ws.extensions:"";this[i(317)+i(443)]()})}async[r(755)+r(487)](){let t=r;(await this._qosDB?.[t(1198)]()||[])[t(697)](({timestamp:x})=>x<Date[t(394)]())[t(503)](x=>{let d=t;this[d(977)]?.[d(1005)](x.message_id)})}async[r(1005)](t){let n=r;return this[n(977)]?.[n(1005)](t)}async set(t,n){let i=r;return this[i(977)]?.[i(1739)]({message_id:t,timestamp:n})}async[r(1792)](t){let n=r;if(e[n(1674)](e[n(1496)],e[n(1496)])){if(this[n(1594)][n(1054)+n(241)+n(535)]||this[n(923)+n(699)])return;this[n(1484)+"econnect"]()}else return this[n(977)]?.[n(1792)](t)}async[r(363)](){let t=r;e[t(1387)](clearInterval,this[t(317)+t(1056)+"Id"]),await this._qosDB?.[t(363)]()}get isReady(){return this[r(977)]?.isReady}}function $n(s){let t=r,n={hbmeL:e[t(466)]};if(e[t(413)]===e[t(413)]){let i=!!this[t(1594)][t(1849)+"S"];if(!i)return{enabled:i,isQoSMessage:!1,isQoSAck:!1,isAckCleanupMessage:!1,ackMsgIds:[]};let x=e.Mvrss(Fe,s[t(816)].headers,"x_fronti"+t(1390),"2"),d=x&&e.Mvrss(Fe,s.message.headers,e[t(847)],"1"),h=x&&e[t(1465)](Fe,s[t(816)][t(1139)],e[t(893)],"1"),g=h?e[t(1500)](ot,s[t(816)][t(1139)],e[t(1436)])?.split(",")[t(697)](Boolean)||[]:[];return{enabled:i,isQoSMessage:x,isQoSAck:d,isAckCleanupMessage:h,ackMsgIds:g}}else return _0x45c5db.log(n[t(674)],_0x37424b,_0x3bd75a,_0x3fe9d0),this[t(977)][t(1739)]({cursor_name:_0x4470d7,cursor:_0x6f5342,service:_0xe085f3})}async function ls(){let s=r;return this[s(1678)+"ger"]||(this[s(1678)+s(1655)]=new s0),this[s(1678)+s(1655)][s(957)]||await this[s(1678)+s(1655)][s(1540)](),this["_QoSMana"+s(1655)]}async function i0(s,t){let n=r,{enableAutoAck:i}=this[n(1594)],x=Fe(s[n(816)][n(1139)],e[n(1767)],"1"),d=e[n(1465)](Fe,s[n(816)][n(1139)],e[n(562)],"1"),h=$n.call(this,s);if(i&&x){let{SeqID:g,LogID:f,service:_,LogIDNew:v,method:C}=s.message;this[n(688)]({SeqID:g,LogID:f,LogIDNew:v,service:_,method:C,headers:[{key:e[n(562)],value:"1"},{key:e.RqAXm,value:e.UDnEr(v,"")},{key:"ack_code",value:"0"}]})}d&&!h[n(1502)]&&this[n(730)+n(1524)+"ageEvent"](s),e[n(1768)](t)}async function o0(s,t){let n=r;this[n(1131)](n(1827),s.message),t()}async function a0(s,t){let n=r,i=e.MckUH(Xr,await e.eDvdW(fs,s[n(550)]));try{if(i[n(686)]instanceof Uint8Array)if(e[n(1757)]!==e[n(1226)]){let x=e.UdnUH(this[n(1594)][n(1302)+n(700)],Object)?{force:!!this[n(1594)][n(1302)+n(700)][n(653)],encoding:this[n(1594)][n(1302)+n(700)][n(1840)]?this[n(1594)][n(1302)+n(700)][n(1840)].replace(/\s/g,"")[n(364)+n(408)]():""}:{force:!1,encoding:this._options["payloadE"+n(700)]?this[n(1594)][n(1302)+n(700)][n(1167)](/\s/g,"")[n(364)+n(408)]():""},d=i[n(1302)+"ncoding"]?i[n(1302)+n(700)].replace(/\s/g,"")[n(364)+n(408)]():"",h=e.UGYDG(this[n(1594)][n(651)+n(671)],Object)?{force:!!this[n(1594)][n(651)+n(671)][n(653)],type:this[n(1594)][n(651)+n(671)][n(659)]?this[n(1594)][n(651)+"ype"][n(659)].replace(/\s/g,"")[n(364)+n(408)]():""}:{force:!1,type:this[n(1594)][n(651)+"ype"]?this._options[n(651)+n(671)][n(1167)](/\s/g,"")[n(364)+n(408)]():""},g=i[n(651)+n(671)]?i[n(651)+n(671)][n(1167)](/\s/g,"")[n(364)+n(408)]():"",f=h.force?h[n(659)]:g||h[n(659)],_=x[n(653)]?x[n(1840)]:d||x[n(1840)],v=[e[n(272)],e.sXDGN,e[n(1786)],e[n(1452)]],C=[e[n(869)],e[n(1486)]];this[n(1594)]["enableTr"+n(1548)+"extPayload"]&&v.includes(f)&&(!_||C.includes(_))?i["textPayl"+n(307)]=e[n(543)](us,i[n(686)],0,i[n(686)].byteLength):i[n(1550)+n(307)]=""}else{let x=_0x253282.message[n(686)];x&&_0x19c073.setCursors(x)}else i[n(1550)+"oad"]=""}catch(x){i[n(1550)+n(307)]="",console[n(613)](x)}s[n(816)]=i,e[n(670)](t)}function x0(s,t,n){let i=r,x=e[i(611)](n,8192),d=x>>>1,h=null,g=x;return function(f){let _=i;if(e[_(575)](f,1)||f>d)return e[_(231)](s,f);e[_(734)](e[_(1442)](g,f),x)&&(h=s(x),g=0);let v=t[_(1482)](h,g,g+=f);return e[_(993)](7,g)&&(g=e[_(1077)](e.dMPGN(7,g),1)),v}}let c0=4294967295;function u0(s,t,n){let i=r;return e[i(681)](RangeError,e[i(1209)](e[i(1525)](e[i(1053)](e[i(1258)](e[i(336)](e[i(1737)],s),e.HILLQ),e[i(1325)](t,1)),e[i(293)]),n))}function f0(s,t,n){let i=r;if(n>c0)throw new Error(e[i(1213)]);let x=3;for(;e[i(787)](x,0);)if(e[i(574)](e[i(1179)],e[i(1301)]))this["_miniNavigatorOn"+i(282)]=_0x555309,_0x53b850?this[i(1413)+i(1536)]():this["_handleO"+i(267)]();else{let d=255&n;e[i(1125)](er,d,s,t+x),n>>>=8,x--}return t+4}function d0(s,t){let n=r,i=0,x=t,d=e[n(397)](t,4);for(;e[n(484)](x,d);){let{value:h,offset:g}=e[n(744)](Qn,s,x);x=g,i=e.iOUQL(e[n(1379)](i,8),0),i+=h}return{value:i,offset:d}}function l0(s,t,n){let i=r,x=e[i(839)][i(1120)]("|"),d=0;for(;;){switch(x[d++]){case"0":return e[i(310)](e.QdOfU(Yn,s,t,n),n);case"1":if(t[i(982)+"e"])return e[i(701)](t[i(982)+"e"](s,n),n);continue;case"2":if(s[i(1239)]<40)return e.kZqdj(Yn(s,t,n),n);continue;case"3":if(t[i(1746)])return e.dpBjU(t[i(1746)](s,n),n);continue;case"4":if(!s)return n;continue}break}}function h0(s,t){let n=r,i=new z(e.ZMTIo(e[n(1832)](e[n(1719)](e[n(1818)](s[e[n(1565)](t,4)],24),e[n(877)](s[e.mPjIE(t,5)],16)),e.BfYHm(s[e[n(917)](t,6)],8)),s[e[n(789)](t,7)]),e[n(1075)](e.igMsa(e[n(1224)](s[e[n(1397)](t,0)],24)|e[n(811)](s[t+1],16),s[t+2]<<8),s[e.xZLYu(t,3)]),!0);return t+=8,{value:i,offset:e[n(1077)](t,8)}}function g0(s,t,n){let i=r;if(e[i(1488)](i(1365),i(346))){let x=s[i(1163)],d=s[i(1645)];return t[n]=d>>>24,t[n+1]=e.FTIzV(d,16)&255,t[e[i(1374)](n,2)]=e.VHvaZ(e[i(1343)](d,8),255),t[n+3]=e[i(761)](255,d),t[n+4]=e[i(936)](x,24),t[n+5]=e[i(1726)](e.lXsHL(x,16),255),t[e[i(576)](n,6)]=x>>>8&255,t[e.NZgTP(n,7)]=e[i(359)](255,x),n+=8,n}else{let x=_0x4ecfa1[i(1120)](":");_0x4c44eb&&(_0x41bd68=x[i(1239)]),_0x16d596+=x[i(1239)];for(let d=0;e[i(1431)](d,x.length);d++)if(x[d][i(1239)]!==4){let h=_0x4a8aa0.substring(0,e[i(805)](4,x[d][i(1239)])),g=h.concat(x[d]);_0x2cc774[i(560)](g)}else _0x711888.push(x[d]);_0x163983=!1}}function Qn(s,t){let n=r;return s[n(298)+"8"]?{value:s[n(298)+"8"](t),offset:t+1}:{value:e[n(1142)](255,s[t]),offset:e.sJtvP(t,1)}}function er(s,t,n){let i=r,x={ZiKoY:function(d,h,g){return e.UcRrl(d,h,g)}};if(e[i(1348)]===e[i(859)])lmsSzb.ZiKoY(_0x10caee,_0x5f4461,8),_0x3099b5(_0x22a60e,_0x43d448);else return t[i(1661)+"t8"]?t[i(1661)+"t8"](s,n):t[n]=255&s,e[i(358)](n,1)}let p0=function(s){let t=r;if(e[t(1426)](e[t(1090)],e[t(1090)]))return new Uint8Array(s);this.flushExpired()},m0=e[r(732)](e[r(1517)],typeof Buffer)?Buffer.allocUnsafe:e[r(1667)](x0,p0,Uint8Array.prototype[r(1115)]),_0=16,tr=32;function w0(s){let t=r,n=0,i={};for(let x=0;e.OWjrl(x,s[t(1239)]);x++)i[s[x][t(1043)+t(633)]]=e.edekh(cs,s[x][t(1043)+t(633)]),n+=e[t(236)](14,i[s[x][t(1043)+"ame"]]);return[n,i]}function hs(s,t,n){let i=r,x={Ifxew:"service",YOPYO:function(d,h,g,f){return d(h,g,f)},BWRdg:e[i(1440)],qcHFp:"name",khnzA:function(d,h,g,f){return e[i(783)](d,h,g,f)},raYsl:function(d,h,g,f){return e[i(1409)](d,h,g,f)},SacJE:function(d,h,g,f){return d(h,g,f)},xeyrY:function(d,h){return e[i(259)](d,h)},QGyYX:function(d,h){return e[i(425)](d,h)},VNFce:function(d,h){return e[i(481)](d,h)},kJsZC:e.gvsJp,CPioT:"application/json",ZSrbb:function(d,h){return d==h},VlxoP:e[i(272)]};if(e[i(1620)]===e.zlnRU){let[d,h]=e[i(565)](w0,s),g=e[i(352)](m0,d),f=0;return s.forEach(_=>{let v=i,C=(v(642)+v(1545)+"5|2|10")[v(1120)]("|"),L=0;for(;;){switch(C[L++]){case"0":console.log(x.Ifxew,f);continue;case"1":console.log(v(1176)+v(852),f);continue;case"2":f=x[v(595)](g0,z[v(1412)+"er"](_[v(838)]||t),g,f);continue;case"3":console[v(613)](x.BWRdg,f);continue;case"4":console[v(613)](v(1187)+"ervice",_,_.service);continue;case"5":console[v(613)](x.qcHFp,f);continue;case"6":f=er(h[_[v(1043)+v(633)]],g,f);continue;case"7":f=x.khnzA(er,0,g,f);continue;case"8":f=x[v(395)](l0,_["cursor_n"+v(633)],g,f);continue;case"9":f=x[v(1033)](f0,g,f,_.service||0);continue;case"10":console[v(613)]("curvalue",f);continue}break}}),{frameType:tr,headers:[{key:e[i(343)],value:n}],payload:g}}else try{return GbJSSr[i(1723)](i(1611),typeof _0x515d0e)&&(GbJSSr.QGyYX(_0x19be12,_0x310a04)||_0x2cf395[i(1378)]&&GbJSSr.VNFce(_0x5255e9[i(1378)],_0x3db665))||GbJSSr[i(391)]!=typeof _0x6c161b?"":(_0x45a91b.parse(_0x3666e0),GbJSSr.CPioT)}catch{return GbJSSr[i(757)](GbJSSr[i(391)],typeof _0x55e096)?GbJSSr[i(878)]:""}}function b0(s){let t=r,n={wxpkK:e[t(354)]};if(e.qupFq(t(545),e[t(1563)])){let i=this[t(270)+t(590)]?.[t(1274)+t(722)+"nt"]();this[t(1131)](t(1483)+i+t(1444)),this["_disconn"+t(1262)](1001,n.wxpkK,!0)}else{let i=0,x=[];for(;e[t(1625)](i,s.byteLength);){let{offset:d}=e[t(1654)](Qn,s,i);i=d;let h={cursor_name:"",cursor:0,service:0},{value:g,offset:f}=d0(s,i);h[t(1589)]=g,i=f;let{value:_,offset:v}=e.TMwHd(Qn,s,i);i=v,h["cursor_n"+t(633)]=e[t(1125)](us,s,i,e[t(917)](i,_)),i+=_;let{value:C,offset:L}=e[t(482)](h0,s,i);h[t(838)]=C[t(1376)](),i=L,x[t(560)](h)}return x}}function y0(){let s=r;return e[s(1031)](e.FeXYm,e.fblxR)?{frameType:tr,headers:[{key:e[s(343)],value:e[s(1353)]}],payload:void 0}:_0x31b76d.resolve()}class v0{constructor(t,n,i){let x=r,d={pVcIF:function(h,g){return h(g)},pqQnK:function(h,g){return e[D(929)](h,g)},QJSMX:function(h,g){return e[D(1037)](h,g)},hButH:function(h,g){return h&g},miezD:function(h,g){return e[D(1305)](h,g)},GmpqZ:function(h,g){return h&g},IaIJp:function(h,g){return h&g},KrZtM:function(h,g){return h<<g},exBah:function(h,g){return e[D(1160)](h,g)}};e[x(1848)](e[x(926)],e[x(926)])?(_0x50aa3e=cydqdX[x(1106)](_0x2cfded,_0x278082),_0x1327b8|=cydqdX.pqQnK(cydqdX[x(457)](127,_0x5e3901),14),cydqdX[x(522)](128,_0x1a0604)&&(_0x4e719a=cydqdX[x(1106)](_0x145d88,_0x20798c),_0x3e78be|=cydqdX[x(435)](127&_0x518429,21),cydqdX.hButH(128,_0x2f23f8)&&(_0x3e272f=cydqdX.miezD(_0x2f291f,_0x18f51e),_0x4951ed=cydqdX[x(1155)](127,_0x3146cd),cydqdX[x(899)](128,_0x4eaf60)&&(_0x38a432=_0x35a480(_0x565bdb),_0x24dcc0|=cydqdX[x(1079)](cydqdX.exBah(127,_0x12c733),7))))):(this["_cursorN"+x(812)]=t,this[x(451)+"ileName"]=n,this["_message"+x(1358)]=i,this[x(977)]=e[x(994)](ds,this[x(433)+x(812)],e[x(1114)]))}async[r(1540)](){let t=r;await this[t(977)][t(1540)]()}async getCursors(){let t=r;if(!this._qosDB[t(957)])return;let n=this["_message"+t(1358)],i=await this._qosDB[t(1198)]();switch(console[t(613)](e[t(1724)],i),n){case e[t(1813)]:return i&&i[t(1239)]?e[t(607)](hs,i,0,this[t(451)+t(1614)]):void 0;case e.YnLWH:return;case t(1264):return i&&i[t(1239)]?e[t(544)](hs,i,0,this["_cursorF"+t(1614)]):e[t(583)](y0)}}async set(t,n,i){let x=r,d={wRWjr:function(h,g){return h||g}};if(e.eUOia(e.gPbWx,e[x(920)]))return console.log(x(810),t,n,i),this[x(977)][x(1739)]({cursor_name:t,cursor:n,service:i});{let h=this[x(977)][x(1703)](this._prefix),g=_0x388f56[x(818)](aSCfua[x(1034)](h,"{}"));return g[_0x2fef07]=void 0,this[x(977)].setItem(this[x(1254)],_0x57a2d6[x(1437)+"y"](g))}}async[r(1642)+"rs"](t){let n=r,i=e[n(775)](b0,t);for(let x of i)console[n(613)](e[n(1068)],i),await this[n(977)][n(1739)](x)}async[r(1792)](t){let n=r;return(await this[n(977)].get(t))?.[n(838)]}async[r(363)](){let t=r;await this[t(977)][t(363)]()}[r(1314)+"rsorFile"+r(989)](t){let n=r;this[n(451)+"ileName"]=t}get[r(957)](){let t=r;return this._qosDB[t(957)]}}let S0=e[r(1672)];async function gs(s){let t=r;if(!this[t(1594)].enableQoS)return null;let{aID:n,fpID:i,messageStrategy:x}=this[t(1594)],d=e[t(589)](s,S0);try{return this[t(815)+t(939)]?s&&this[t(815)+t(939)][t(1314)+"rsorFile"+t(989)](s):this[t(815)+"anager"]=new v0(i+"_"+n+"_"+d,d,x),this._cursorManager.isReady||await this._cursorManager[t(1540)](),this["_cursorM"+t(939)]}catch{return null}}async function C0(s,t){let n=r,i={EnAJc:function(x,d){return e[D(725)](x,d)}};if(e[n(476)](e[n(1745)],e.RAXJA)){let x=this._qosDB[n(1229)+n(325)](this._prefix),d=_0x757c0a[n(818)](uztfGY[n(1266)](x,"{}"));return d[_0x541408]=void 0,this[n(977)][n(721)+n(325)](this[n(1254)],_0x455e3f[n(1437)+"y"](d))}else{let x=e[n(473)](Fe,s[n(816)][n(1139)],e[n(956)],"-1"),d=Fe(s.message[n(1139)],n(1758),"1"),h=e[n(803)](ot,s[n(816)][n(1139)],e.CSeqF),g=Number(e[n(1401)](ot,s[n(816)][n(1139)],e[n(249)]))||0,f=$n.call(this,s),_=e[n(288)](Fe,s[n(816)][n(1139)],e[n(334)],"2"),v=ot(s[n(816)][n(1139)],n(402)+n(1333)+"e"),C=Number(e.ISAxX(ot,s[n(816)][n(1139)],e[n(1610)]));if(f[n(1502)])return e[n(1809)](t);let L=f["isQoSMes"+n(461)]?await ls[n(1482)](this):null;if(e[n(1601)](s.message[n(1589)],0)&&d&&!x||s[n(816)][n(1589)]>0){if(h&&f[n(1219)+n(461)]&&L)return!!!await L.get(h)&&(this[n(730)+n(781)+"Event"](s),await L.set(h,e[n(1246)](Date.now(),g))),e.AAagX(t);if(_){let B=await gs[n(1482)](this);if(!B)return this["_dispatc"+n(781)+n(1242)](s),t();let P=await B[n(1792)](v)??-1;if(P<C)this[n(730)+n(781)+"Event"](s),B.set(v,C,s[n(816)][n(1589)]);else throw new Error(n(615)+n(1418)+n(776)+C+(n(1157)+n(1776)+"al cursor ")+P);return e[n(559)](t)}return this[n(730)+n(781)+n(1242)](s),e.dHdoq(t)}}}async function E0(s,t){let n=r,i=$n.call(this,s);if(!i["isQoSMes"+n(461)])return e[n(670)](t);let x=await ls.call(this);if(i[n(605)+n(814)+n(952)]&&i[n(1744)+"s"][n(1239)])for(let d of i[n(1744)+"s"])await x[n(1005)](d);e[n(1119)](t)}async function A0(s,t){let n=r,i=e.FxFQb(s[n(816)][n(1244)+"e"],_0),x=e.eUOia(s[n(816)][n(1244)+"e"],tr);if(!i&&!x)return e[n(959)](t);let d=e[n(1750)](ot,s[n(816)][n(1139)],"cursor_f"+n(1747));if(!d)return t();let h=await gs.call(this,d);if(!h)return t();if(i){let g=await h.getCursors(),f={frameType:g?.[n(1244)+"e"],SeqID:z.fromNumber(this[n(572)]++),LogID:z[n(1412)+"er"](this[n(1594)][n(1533)+n(1598)]()),service:9e3,method:5,headers:g?.[n(1139)],payload:g?.[n(686)]},_=E(f);this._ws&&this[n(1152)][n(1367)+"te"]&&this[n(1152)][n(440)](_)}if(x){let g=s.message[n(686)];g&&h[n(1642)+"rs"](g)}}let D0=async function(s,t){let n=r;this[n(1204)]=!1,e.oVbau(clearTimeout,this[n(1441)+"ionTimeo"+n(1344)]),e.pcayq(t)},L0=async function(s,t){let n=r;if(!this._ws||e[n(802)](this[n(1152)][n(1367)+"te"],this.OPEN))return e.jzJNJ(t);let{pingInterval:i}=this[n(1594)];this[n(270)+"tManager"]?.[n(931)+n(315)+n(1590)]();for(let d=0;e[n(1191)](d,this[n(347)+"Queue"][n(1239)]);d++){let h=this[n(347)+n(1148)][d];if(e[n(848)](this[n(1152)][n(1367)+"te"],this[n(1103)])&&e[n(1566)](null,h))this._ws&&this[n(1152)][n(440)](h),this[n(347)+n(1148)][d]=null;else break}this[n(347)+"Queue"]=this[n(347)+n(1148)].filter(d=>!!d),this[n(904)+n(1604)+"Id"]=e.gJxHp(setTimeout,()=>this._ping(),i),this[n(730)+n(1617)+"nt"](s),this[n(1341)+"er"]&&this[n(1152)]&&(this[n(1152)][n(258)+"pe"]=this[n(410)+n(671)]);let x=this["_endpoin"+n(590)]?.[n(1274)+n(722)+"nt"]();this[n(1131)]("open "+x+n(329)),e[n(1768)](t)},P0=async function(s,t){let n=r,i=this[n(270)+n(590)]?.[n(1274)+n(722)+"nt"]();this[n(1131)](n(601)+i),e[n(670)](t)};class k0 extends Vn{constructor(t){let n=r,i={GNGDx:function(g,f,_){return g(f,_)},rZDBM:function(g,f,_){return e[D(1245)](g,f,_)},MhIeC:function(g,f){return e[D(1253)](g,f)},GtjTe:function(g,f,_){return e.TkTNG(g,f,_)},ZgFEF:function(g,f){return g!==f},Xygwr:"qUBNf",UQHOo:n(765),hRHhU:function(g,f){return g===f},JfCAi:e[n(747)],KMOQj:function(g,f){return e[n(1296)](g,f)},ipTQW:n(622),JlJDd:e[n(693)],cjTly:n(1202),gFclG:function(g,f,_){return e[n(905)](g,f,_)},dyxAa:function(g,f,_,v){return e.IbZtg(g,f,_,v)},AXnlF:function(g,f,_){return e[n(619)](g,f,_)},fKtrE:e.YAeQt,ISXOl:function(g,f,_){return g(f,_)},IHCii:function(g,f){return e.nbgLX(g,f)},xLIfT:function(g,f,_){return e[n(1419)](g,f,_)},jutCh:e[n(514)],udKGE:function(g,f,_){return e[n(254)](g,f,_)},PzUIs:function(g,f){return e[n(1107)](g,f)},LqsEY:function(g,f,_){return e[n(876)](g,f,_)},SiCRS:function(g,f,_){return e[n(905)](g,f,_)}};super(),this[n(1784)+"igatorOn"+n(282)]=!0,this[n(1341)+"er"]=it,this._isNode=Go,this._isMiniTT=Ge,this[n(1153)+"X"]=yt,this[n(742)+"r"]=vt,this[n(347)+n(1148)]=[],this[n(270)+n(590)]=null,this[n(923)+"osed"]=!1,this[n(410)+n(671)]=e[n(294)],this["_connect"+n(1183)]=!1,this[n(1441)+"ionTimeoutId"]=null,this[n(1336)+n(318)+n(648)]=null,this[n(904)+"gTimeoutId"]=null,this[n(572)]=0,this._isInit=!1,this[n(235)]="",this[n(1678)+n(1655)]=null,this[n(815)+n(939)]=null,this[n(261)+"sCounter"]=null,this[n(1621)+"ls"]="pbbp2",this[n(460)]=3,this[n(629)+"NG"]=0,this.OPEN=1,this[n(1360)]=2,this._onOpen=g=>{let f=n;if(i[f(1681)]("lhKBf",f(1013)))KdRBYC.GNGDx(_0x2e3868,_0x1dcefe,82),KdRBYC[f(1257)](_0x4ae73d,_0x48cc61,_0x398ca6);else try{xs(this,g,[D0,L0,P0])}catch(_){let v=i[f(444)](le,f(330),{message:_[f(816)],code:Ue[f(1126)+"OR"],error:_});this._dispatchErrorEvent(v)}},this[n(1511)+"ge"]=async g=>{let f=n;if(i.ZgFEF(i.Xygwr,i[f(264)])){let{pingInterval:_,pingFrequency:v}=this[f(1594)];if((i.hRHhU("hi",g[f(550)])&&i[f(1681)](i[f(948)],v)||i[f(1352)](i[f(695)],v))&&(this["_clearPi"+f(538)](),this[f(1304)](i.JlJDd,i[f(870)]),this["_pingPon"+f(1604)+"Id"]=i[f(679)](setTimeout,this._ping[f(252)](this),_)),g.data==="hi")return;try{i[f(244)](xs,this,g,[a0,i0,E0,A0,C0,o0])}catch(C){let L=i[f(828)](le,i[f(696)],{message:C[f(816)],code:Ue[f(1105)+f(1072)],error:C});this[f(730)+"hErrorEvent"](L)}}else this[f(317)+f(443)]()},this[n(1089)]=g=>{let f=n,_=this[f(270)+f(590)]?.[f(496)+f(1551)+"es"](),v=this["_endpoin"+f(590)]?.[f(1274)+f(722)+"nt"]();if(_&&!g.message){let C="connect "+v+(f(382)+f(1270)+f(1287)+"ed");this._dispatchErrorEvent(i[f(1233)](le,i[f(696)],{message:C,code:Ue[f(1450)+f(563)+"R"],error:g}));return}this[f(1152)]&&i[f(1156)](this[f(1152)].readyState,this[f(1103)])&&this[f(1057)+f(1262)](),this[f(730)+f(1425)+f(921)](le(i[f(696)],{message:g[f(816)],code:Ue["NATIVE_E"+f(225)],error:g}))},this[n(632)]=async g=>{let f=n;this[f(1688)+"mer"](),this[f(1292)+f(538)](),this[f(1394)+f(411)+"rs"](),this._ws=null,this[f(1441)+f(1183)]=!1;let _=this[f(270)+f(590)]?.[f(496)+f(1551)+"es"]();if(!_&&this[f(1663)+f(531)]()&&!this[f(923)+f(699)]){let v=this[f(270)+f(590)]?.["getCurre"+f(722)+"nt"](),C=this[f(1594)][f(1328)+f(1764)+f(1691)](g[f(387)],g[f(1235)]);this[f(730)+"hCloseEv"+f(921)](i[f(1006)](_e,i[f(1497)],{code:1006,reason:g.reason||"connecting faile"+f(897)+f(1561)+f(475)+f(1084)+v,willReconnect:C})),C&&this[f(1441)]();return}if(i[f(1650)](1e3,g[f(387)])&&this[f(923)+f(699)]){this[f(730)+f(1633)+"ent"](i.udKGE(_e,i[f(1497)],{code:1e3,reason:f(692)})),this[f(270)+f(590)]?.[f(931)+f(315)+"fig"](),this[f(261)+f(831)]?.[f(1417)+f(1766)]();return}if(i.ZgFEF(1e3,g[f(387)])&&_){let v=this["_endpoin"+f(590)]?.[f(1274)+"ntEndpoint"](),C=g[f(1235)];C||(C=await i.PzUIs(Qo,this[f(235)])),C=f(1316)+f(1393)+f(439)+C+(f(639)+f(654))+v+(f(630)+f(1216)+"ached"),this[f(730)+f(1633)+f(921)](i.LqsEY(_e,f(463),{code:g[f(387)],reason:C}));let L=f(1483)+v+(" fail, m"+f(1270)+"es reached");this[f(730)+f(1425)+f(921)](le("error",{message:L,code:Ue["MAX_RETR"+f(563)+"R"]})),this[f(270)+f(590)]?.["resetEnd"+f(315)+"fig"](),this[f(261)+"sCounter"]?.["resetCou"+f(1766)]();return}if(i[f(1650)](1e3,g.code)&&!g[f(1235)]){let v=this[f(270)+f(590)]?.[f(1274)+f(722)+"nt"]();this[f(730)+f(1633)+f(921)](i[f(1300)](_e,f(463),{code:g[f(387)],reason:f(1316)+f(1393)+f(897)+f(1561)+f(475)+f(1084)+v})),this[f(270)+f(590)]?.[f(931)+f(315)+f(1590)](),this[f(261)+f(831)]?.[f(1417)+f(1766)]();return}this[f(730)+f(1633)+"ent"](g),this[f(270)+f(590)]?.[f(931)+"pointCon"+f(1590)](),this[f(261)+"sCounter"]?.resetCounter()},this.onclose=null,this[n(652)]=null,this.onmessage=null,this.onopen=null,this[n(1009)+n(766)]=null,this[n(265)+n(368)]=null,this[n(1276)+n(1498)+n(998)+"ct"]=null,this[n(1413)+n(1536)]=this[n(1413)+n(1536)][n(252)](this),this[n(1413)+n(267)]=this["_handleO"+n(267)][n(252)](this),this[n(1670)+n(273)]=this._handlePageHide[n(252)](this),this[n(1670)+"ageShow"]=this[n(1670)+n(1415)][n(252)](this),this[n(1594)]={url:"",automaticOpen:!0,initReconnectInterval:1e3,maxReconnectInterval:1e4,reconnectIntervalGrowFactor:2,timeoutInterval:5e3,maxRetries:5,debug:!1,maxMessageQueueLength: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:n(622),pingLossCount:2,enableTransformTextPayload:!1,logIDNewConfig:{enableAutoGenerateLogIDNew:!1,userIp:""},miniProgramParams:{customHttpHeader:{}},enableAutoAck:!1,reconnectInterceptor:()=>!0,enableQoS:!1,QoSLevel:2,messageStrategy:e.UCWuG,env:{xTTEnv:"",xUseEnv:""},listenNetworkChanged:!0};let{url:x,ws:d}=t,h=Array[n(1064)](x)?x:e.NeLlp(e[n(1452)],typeof x)?[x]:[];if(!h||e.abXhb(0,h[n(1239)]))throw new Error(n(337)+n(1618)+n(938));if(!e.SyMzP(Vo,d))throw new Error(e.EGqDL);if(Object[n(741)](this._options,t),this[n(270)+n(590)]=new as(h,this._options.maxRetries),this[n(261)+n(831)]=new $o(this._options["pingLoss"+n(1805)]),this[n(1594)][n(1298)+"cOpen"]){if(e[n(1253)](e.vAawf,e.MuXqU))return _0xeedd21||(_0x126e59=[_0x383eef.prototype[n(375)],_0x4b0cd8[n(1460)+"e"][n(1217)],_0x194c2f[n(1460)+"e"].continuePrimaryKey]);this[n(1204)]=!0,this._connect()}this[n(1594)][n(1260)+n(373)+n(1487)]&&(this[n(875)+"T"]||this._isMiniWX?this[n(1027)+"etWorkCh"+n(1839)]():this[n(1341)+"er"]&&this["_initGlobalEvent"+n(662)]())}["_handleO"+r(1536)](){let t=r;this[t(1594)]["disableAutoRecon"+t(535)]||this._readyClosed||this._handleReconnect()}["_handleO"+r(267)](){let t=r;this._destroyWebSocket();let n=e[t(964)](Xn,t(1328)+"t",{message:t(746)+t(455)+t(1364)+"ct"});this[t(1276)+t(1498)+"yReconnect"]&&this[t(1276)+t(1498)+"yReconnect"](n)}["_initGlo"+r(1134)+r(662)](){let t=r;this[t(1341)+"er"]&&window[t(1627)+"Listener"](e.gaTVI,this[t(1413)+"nLine"]),this[t(1341)+"er"]&&window["addEvent"+t(662)](e[t(1508)],this[t(1413)+"ffLine"]),this[t(1341)+"er"]&&window[t(1627)+t(662)](t(1721),this[t(1670)+t(273)]),this[t(1341)+"er"]&&window["addEvent"+t(662)]("pageshow",this[t(1670)+t(1415)])}["_dropGlo"+r(1134)+"Listener"](){let t=r;e[t(370)](e[t(1021)],e.BMKwF)?(this[t(1341)+"er"]&&window["removeEv"+t(1091)+t(991)](t(1490),this[t(1413)+t(1536)]),this[t(1341)+"er"]&&window["removeEv"+t(1091)+t(991)](e[t(1508)],this[t(1413)+t(267)]),this[t(1341)+"er"]&&window[t(1838)+t(1091)+t(991)](e[t(984)],this[t(1670)+t(273)]),this[t(1341)+"er"]&&window[t(1838)+t(1091)+t(991)](e.WLgfx,this[t(1670)+"ageShow"])):this[t(1304)](t(507),_0x30e0dc(e[t(1263)],{..._0x5a94f8,data:_0xde0c82[t(844)]||""}))}["_handleP"+r(273)](t){let n=r;if(!t[n(1748)+"d"])if(e[n(409)](e[n(943)],e[n(857)]))this._isBrowser&&window[n(1838)+n(1091)+n(991)](e[n(984)],this[n(1670)+n(273)]),this._isBrowser&&window["removeEventListe"+n(991)](e[n(449)],this[n(1670)+n(1415)]),this.close();else{if(e[n(1285)](_0x324e08,_0x332078))return new _0x371fe1(_0x537ced,_0x325c81);if(e[n(1513)](_0x5ecb1e,_0x27588e)&&e.CWUjO("undefined",typeof _0x31255b))return new _0x5c6fd8(_0x155291,_0x290c04);if(e[n(1018)](_0xbb71df,_0x42c204)&&e[n(1022)](e[n(1517)],typeof _0x1705d7))return new _0x2676d0(_0x4da7e3,_0x343f03);throw new _0x54d378(e[n(698)])}this[n(1341)+"er"]&&window[n(1838)+n(1091)+n(991)](n(1490),this[n(1413)+"nLine"]),this[n(1341)+"er"]&&window[n(1838)+n(1091)+n(991)](e[n(1508)],this["_handleO"+n(267)])}[r(1670)+r(1415)](t){let n=r;t[n(1748)+"d"]&&(this["_navigat"+n(531)]()&&(!this[n(1152)]||e[n(1462)](this[n(1152)][n(1367)+"te"],this[n(1103)])||e[n(1012)](this._ws.readyState,this[n(629)+"NG"]))&&this._handleOnLine(),this[n(1341)+"er"]&&window[n(1627)+n(662)](n(1490),this[n(1413)+n(1536)]),this[n(1341)+"er"]&&window[n(1627)+n(662)](e[n(1508)],this[n(1413)+n(267)]))}async[r(1760)+r(350)](t){let n=r,{fpID:i,deviceID:x,bddID:d,ttwID:h,accessKey:g,aID:f,customParams:_={},enableAutoAck:v,enableQoS:C,QoSLevel:L,env:B}=this[n(1594)],P,U,O;if(this._isBrowser||this[n(1153)+"X"]||this[n(875)+"T"])P=location&&e[n(517)]==location[n(1063)]?n(566):e.weWxK,U=t.replace(/((^ws)|(^http))((?:[s]*:\/\/))/,""),O=/^wss(.*:\/\/)/[n(1361)](t)?t:""+P+U;else if(e[n(711)](n(966),n(1656)))P=e.ZWphh,U=t[n(1167)](/(^http)((?:[s]*:\/\/))/,""),O=/(^ws)((?:[s]*:\/\/))/[n(1361)](U)?U:""+P+U;else{let St=_0x55e7c7[n(579)+"g"](0,4-_0x3edd91[_0xb623c3].length),Ct=St[n(1664)](_0x12a706[_0x131302]);_0x134807[n(560)](Ct)}let R=d?e[n(718)]:h?e.FtmPf:e.kWWKl,Z=d||h||x;if(e[n(230)](!Z,!R))throw new Error(e[n(1030)]);let Ft=e[n(313)](e[n(362)],typeof _)?await _():_,ps=B?e[n(619)](Zo,B.xUseEnv,B[n(889)]):{},nr=Object[n(741)]({device_platform:e.fAnEJ,version_code:n(459)+"0",access_key:g,fpid:i,aid:f,[R]:Z,xsack:v?1:0,xaack:v?1:0,xsqos:C?1:0,qos_level:C?L:void 0,qos_sdk_version:2,...ps},Ft),T0=Object.keys(nr)[n(1828)]((St,Ct)=>nr[Ct]!==void 0?""+St+(St?"&":"?")+Ct+"="+nr[Ct]:St,"");return O+n(1017)+T0}async _connect(){let t=r;if(!(this._connectLock||this[t(923)+t(699)])){this[t(1441)+t(1183)]=!0;try{let n=this[t(270)+"tManager"]?.[t(1406)+"rentEndp"+t(1530)+t(891)+"tries"](),{timeoutInterval:i}=this[t(1594)];if(n)if(e[t(1130)](e[t(1615)],e[t(1149)])){let d=e[t(344)](_0x15bece);return e[t(1194)](_0x1d0253,_0x2623f7,d),e[t(342)](_0x2bda2d,d)}else{let d=this["_endpoin"+t(590)]?.[t(1274)+t(722)+"nt"](),h=this[t(270)+t(590)]?.[t(1042)+t(1339)+"pointAnd"+t(1683)+"unt"](),g=this["_endpoin"+t(590)]?.[t(1274)+"ntEndpoi"+t(740)+"ount"]();if(h){let f=t(1483)+d+(t(1444)+", max re"+t(1216)+"ached, w"+t(1527)+t(500)+t(975))+h+(t(606)+"y"),_=e[t(1774)](le,t(330),{message:f,code:Ue[t(1450)+t(563)+"R"]});this[t(1131)](f),this[t(730)+t(1425)+t(921)](_),this._url=await this["_generat"+t(350)](h),this._debug("connect "+h+" "+g+t(465)),this["_removeW"+t(411)+"rs"]()}else if(e[t(275)]===e[t(1083)]){if(e[t(537)](_0xfd5624,_0x1af3a8))return _0x575c0d?_0x58e090:_0x4a79b3;if(_0x5abe9d){if(e[t(723)](_0x1b3336,_0x1ec979))return _0x3861e3}else{if(e.haHnZ(_0x2a78f9,-_0x15f744))return _0x32f282;if(e[t(1020)](e[t(621)](_0x3904eb,1),_0x439367))return _0x4e0f7f}return _0x46671d[t(941)](e[t(1722)](e[t(1327)](_0x2ba861,_0x25831e),0),e[t(245)](e[t(1461)](_0x42bc3d,_0x128684),0),_0x25bb7e)}else{let f=t(1483)+d+(" timeout"+t(630)+t(1216)+t(1416));this._debug(f),this[t(730)+t(1425)+t(921)](e[t(1337)](le,e[t(836)],{message:f,code:Ue[t(1450)+"IES_ERROR"]}));return}}else{let d=this[t(270)+"tManager"]?.[t(1274)+t(722)+t(1066)+t(1185)](),h=this[t(270)+t(590)]?.["getCurre"+t(722)+t(740)+"ount"]();this[t(235)]=await this[t(1760)+t(350)](e.VzcAW(d,"")),this[t(1131)](t(1483)+d+" "+h+" times"),this["_removeW"+t(411)+"rs"]()}if(this._isInit)this[t(1204)]=!1;else{let d=e.cVaGh(Xn,e.fgPpB,{message:t(1716)});this[t(1009)+t(766)]&&this[t(1009)+t(766)](d)}let x=this._endpointManager?.[t(1274)+"ntEndpointTriesC"+t(584)]()||0;e[t(925)](x,1)&&await this._wait(e[t(805)](x,1)),this._debug("connecting url: "+this._url+(t(987)+t(527))+this[t(1621)+"ls"]),this._ws=e[t(1190)](Xo,{url:this[t(235)],protocols:[this[t(1621)+"ls"]],headers:this[t(1594)][t(1335)+"ramParams"][t(1137)+t(1588)]},this[t(1594)].ws),(this[t(1341)+"er"]||this[t(742)+"r"])&&this[t(1152)]&&(this._ws[t(258)+"pe"]=this["_binaryT"+t(671)]),this["_addWsLi"+t(262)](),this[t(1441)+t(1564)+t(1344)]=e[t(1001)](setTimeout,this._onTimeout[t(252)](this),i)}catch(n){if(e[t(305)]!==e[t(301)])throw this[t(1441)+"Lock"]=!1,n;_0x2fdf32[_0xbed1dd++]=e[t(1095)](e[t(389)](_0x2932e8,18),7)|240,_0x1e5da1[_0x5e53d5++]=e[t(570)](_0x2f97ef>>12&63,128)}}}[r(1688)+r(357)](){let t=r;e[t(1350)](clearTimeout,this[t(1441)+"ionTimeo"+t(1344)]),this[t(1441)+"ionTimeo"+t(1344)]=null}[r(1292)+"ngTimer"](){let t=r;clearTimeout(this[t(904)+"gTimeoutId"]),e.poNwy(clearTimeout,this[t(1336)+"ctTimeou"+t(648)]),this[t(904)+"gTimeoutId"]=null,this[t(1336)+t(318)+t(648)]=null}[r(1131)](...t){let n=r;if(e.xukVS===e[n(1121)]){let i=e[n(585)](_0x958e83[n(1163)],0),x=e[n(1343)](e[n(1817)](e.WPYyo(_0x2683e3[n(1163)],28),e[n(929)](_0x191b96[n(1645)],4)),0),d=_0x5a1d1b[n(1645)]>>>24,h=e[n(306)](0,d)?e[n(649)](0,x)?e[n(573)](i,16384)?i<128?1:2:i<2097152?3:4:e.PEtpZ(x,16384)?x<128?5:6:e[n(280)](x,2097152)?7:8:e[n(1846)](d,128)?9:10,g=e.qWUoL(_0x59cbc7,_0x2acd84,h),f=_0x2a9bd0[n(1268)];switch(h){case 10:f[e[n(739)](g,9)]=e[n(906)](e[n(226)](d,7),1);case 9:f[g+8]=h!==9?128|d:e[n(970)](127,d);case 8:f[e[n(1514)](g,7)]=e[n(1705)](8,h)?e[n(635)](e[n(666)](x,21),128):e[n(1142)](e[n(1690)](x,21),127);case 7:f[e[n(1537)](g,6)]=e.rSegC(7,h)?x>>>14|128:e[n(673)](x>>>14,127);case 6:f[e[n(724)](g,5)]=e[n(1100)](6,h)?e[n(450)](x>>>7,128):e[n(1166)](e.adoTy(x,7),127);case 5:f[e[n(1221)](g,4)]=e.nPMGH(5,h)?e[n(524)](128,x):127&x;case 4:f[e[n(841)](g,3)]=e.cctLv(4,h)?e[n(1509)](i>>>21,128):e[n(1122)](i>>>21,127);case 3:f[e[n(1246)](g,2)]=e[n(1488)](3,h)?e[n(1700)](i,14)|128:i>>>14&127;case 2:f[e[n(621)](g,1)]=e.yfRcr(2,h)?e[n(808)](e[n(661)](i,7),128):e[n(704)](e[n(624)](i,7),127);case 1:f[g]=e[n(1269)](1,h)?e[n(454)](128,i):e[n(1803)](127,i)}}else this[n(1594)][n(1306)]&&console.log[n(1812)](console,[e[n(1291)],...t])}[r(1369)+r(1123)+"e"](t){let n=r,{initReconnectInterval:i,maxReconnectInterval:x,reconnectIntervalGrowFactor:d}=this[n(1594)],h=e.gQkYN(i,Math[n(1060)](d,e[n(1317)](t,1)));return h>x?x:h}_ping(){let t=r;if(this[t(1152)]&&this._ws.readyState===this.CONNECTING){this["_clearPi"+t(538)](),this[t(904)+t(1604)+"Id"]=e.bbRvL(setTimeout,this[t(1249)][t(252)](this),this._options[t(1220)+t(1506)]);return}if(!this[t(1152)]||e[t(656)](this[t(1152)][t(1367)+"te"],this[t(1103)]))return void this[t(1484)+"econnect"]();this[t(1152)]&&this[t(1152)].send("hi"),this[t(1336)+"ctTimeou"+t(648)]=e[t(479)](setTimeout,this[t(1484)+t(766)+"Timeout"][t(252)](this),this[t(1594)][t(1218)+t(1798)+t(1116)])}["_handleR"+r(766)+"Timeout"](){let t=r;if(e[t(1014)](t(657),t(1638)))try{return!!this[t(977)]}catch(n){return _0x399174[t(613)](n),!1}else this[t(261)+t(831)]?.[t(1574)](),this[t(1304)](e[t(453)],t(1649)),this[t(261)+t(831)]?.[t(496)+t(617)+"nt"]()?this[t(1484)+"econnect"]():this[t(1249)]()}[r(1663)+"orOnline"](){let t=r;return this[t(875)+"T"]||this[t(1153)+"X"]?this["_miniNavigatorOn"+t(282)]:(this[t(1341)+"er"]||this[t(742)+"r"])&&this[t(1594)][t(1260)+t(373)+t(1487)]?navigator[t(1094)]:!0}[r(1484)+r(766)](){let t=r;if(e[t(1807)]!=="PRAeo"){if(!this[t(1663)+t(531)]()||this[t(923)+t(699)])return;this[t(270)+t(590)]?.["resetEndpointCon"+t(1590)](),this[t(261)+"sCounter"]?.[t(1417)+t(1766)](),this._ws?this[t(1057)+t(1262)](1001,e[t(1133)],!0):this[t(1441)]()}else _0x1f07f8.body[t(285)+t(1026)](_0x3c7dbc)}["_onPageN"+r(1799)+"ange"](){let t=r;this[t(875)+"T"]?tt[t(1641)+t(1736)+"hange"](({isConnected:n})=>{let i=t;this[i(1784)+"igatorOnline"]=n,n?this[i(1413)+i(1536)]():this["_handleO"+i(267)]()}):this[t(1153)+"X"]&&wx[t(1641)+t(1736)+t(884)](({isConnected:n})=>{let i=t;this[i(1784)+"igatorOnline"]=n,n?this[i(1413)+i(1536)]():this[i(1413)+i(267)]()})}[r(631)](t){let n={CrwcL:function(i,x,d){return e.pImsJ(i,x,d)}};return new Promise(i=>{let x=D;n[x(1085)](setTimeout,i,this[x(1369)+x(1123)+"e"](t))})}["_disconn"+r(1262)](t=1e3,n="",i=!1){let x=r;this[x(1152)]&&this[x(1117)+x(424)+"t"](t,n,i)}[r(1184)+"ut"](){let t=r,n=this[t(270)+"tManager"]?.[t(1274)+t(722)+"nt"]();this[t(1131)]("connect "+n+t(1444)),this[t(1057)+t(1262)](1001,e[t(354)],!0)}[r(688)](t){let n=r,i={QOylR:function(x,d,h,g,f){return e[D(901)](x,d,h,g,f)},BtdbF:function(x,d){return e[D(355)](x,d)}};if(e[n(480)](n(1706),e[n(1234)])){let x=Jn(t);this[n(1152)]&&e[n(306)](this[n(1152)].readyState,this[n(1103)])&&(this[n(1152)]&&this._ws[n(440)](x),this[n(1131)](e[n(1435)],t))}else fbBPaX.QOylR(_0x371883,fbBPaX.BtdbF(_0x5a79d9,_0x2e9063[n(1701)]),_0x3238a3[n(717)+"on"],_0x66ac22.newVersion,fbBPaX.BtdbF(_0x2ed516,_0x4b49b2[n(1474)+n(685)]))}[r(1394)+r(411)+"rs"](){let t=r,n=e[t(792)][t(1120)]("|"),i=0;for(;;){switch(n[i++]){case"0":this[t(1152)][t(1838)+t(1091)+t(991)]("error",this._onError);continue;case"1":this[t(1152)][t(1838)+t(1091)+"ner"](e[t(1263)],this[t(1713)]);continue;case"2":this[t(1152)]["removeEv"+t(1091)+"ner"](e[t(514)],this[t(632)]);continue;case"3":this[t(1152)].removeEventListener(e[t(499)],this[t(1511)+"ge"]);continue;case"4":if(!this._ws)return;continue}break}}[r(1810)+"steners"](){let t=r,n=(t(1597)+"1")[t(1120)]("|"),i=0;for(;;){switch(n[i++]){case"0":if(!this[t(1152)])return;continue;case"1":this[t(1152)][t(1627)+t(662)](e[t(836)],this._onError);continue;case"2":this[t(1152)]["addEvent"+t(662)](e[t(514)],this._onClose);continue;case"3":this[t(1152)][t(1627)+t(662)](e[t(1263)],this[t(1713)]);continue;case"4":this[t(1152)][t(1627)+"Listener"](e[t(499)],this[t(1511)+"ge"]);continue}break}}[r(233)+"nceClose"](t=1e3,n=""){let i=r;try{e[i(1241)](e[i(1554)],e.IzjpS)?this[i(1152)]&&this[i(1152)][i(463)](t,n):(this[i(1784)+i(490)+i(282)]=_0x4b573b,_0x13a153?this["_handleO"+i(1536)]():this[i(1413)+i(267)]())}catch{}}_destroyWebSocket(t=1e3,n="",i=!1){let x=r;if(this["_clearPi"+x(538)](),this["_clearTi"+x(357)](),this["_removeW"+x(411)+"rs"](),this[x(233)+x(1282)](1e3,n),this[x(1441)+x(1183)]=!1,i&&this._navigatorOnline()&&!this[x(923)+x(699)])if(e[x(802)](e[x(1015)],e[x(383)])){if(this._endpointManager?.[x(496)+x(1551)+"es"]()){let h=this[x(270)+x(590)]?.[x(1274)+x(722)+"nt"]();this[x(730)+x(1633)+x(921)](e[x(234)](_e,e[x(514)],{code:1006,reason:"connect "+h+(" timeout, max re"+x(1216)+x(1416)),wasClean:!0}))}else{let h=this[x(1594)][x(1328)+x(1764)+x(1691)](t,n);this[x(730)+x(1633)+x(921)](e.mCIbd(_e,e.JYTOH,{code:t,reason:n,wasClean:!0,willReconnect:h})),h&&this[x(1441)]()}return}else return this["currentE"+x(1843)+x(1607)+"t"]=1,this[x(866)+x(707)]++,this[x(1662)+"s"][this[x(866)+"ndex"]];this[x(1663)+x(531)]()||this["_readyCl"+x(699)]?this[x(730)+"hCloseEv"+x(921)](e[x(378)](_e,x(463),{code:t,reason:e[x(516)]})):this[x(730)+x(1633)+x(921)](e[x(1794)](_e,x(463),{code:1006,reason:e[x(1237)]})),this[x(1152)]=null,this[x(270)+x(590)]?.[x(931)+x(315)+x(1590)](),this._pingLossCounter?.["resetCou"+x(1766)]()}["_dispatc"+r(1617)+"nt"](t){this[r(1304)]("open",t),this.onopen&&this.onopen(t)}[r(730)+r(781)+"Event"](t){let n=r;this[n(1304)](e[n(499)],t),this.onmessage&&this[n(1145)+"e"](t)}[r(730)+"hAckMess"+r(712)](t){let n=r;this[n(1304)](e.FWGWT,t),this[n(265)+n(368)]&&this[n(265)+n(368)](t)}[r(730)+r(1425)+r(921)](t){let n=r;this[n(1304)](e[n(836)],t),this.onerror&&this[n(652)](t)}["_dispatchCloseEv"+r(921)](t){let n=r;this[n(1304)](e.JYTOH,t),this.onclose&&this[n(944)](t)}get binaryType(){let t=r;return e[t(1851)]!==e[t(1851)]?_0x5ef651&&_0x1a340d[t(927)]===!0:this[t(1152)]?this[t(1152)][t(258)+"pe"]:this._binaryType}set[r(258)+"pe"](t){let n=r;this[n(410)+n(671)]=t,this[n(1152)]&&(this[n(1152)][n(258)+"pe"]=t)}get[r(331)+"nt"](){let t=r;return this[t(270)+t(590)]?.[t(1274)+t(722)+t(740)+t(584)]()||0}get[r(271)+r(277)](){let t=r,n=this[t(347)+t(1148)][t(1828)]((i,x)=>(i+=x&&x[t(515)+"th"]||0,i),0);return e[t(1273)](n,this._ws?this[t(1152)][t(271)+"Amount"]:0)}get[r(1733)+"ns"](){let t=r;return this[t(1152)]?this._ws[t(1733)+"ns"]:""}get protocol(){let t=r;return this[t(1152)]?this[t(1152)][t(1063)]:""}get readyState(){let t=r;return this._ws?this[t(1152)][t(1367)+"te"]:this[t(1594)]["automati"+t(1613)]?this[t(629)+"NG"]:this[t(460)]}get[r(1622)](){let t=r;return this._ws?this[t(1152)][t(1622)]:this[t(235)]}close(t=1e3,n){let i=r,x=e[i(1657)][i(1120)]("|"),d=0;for(;;){switch(x[d++]){case"0":this[i(710)+i(1134)+"Listener"]();continue;case"1":this[i(1688)+"mer"]();continue;case"2":this[i(923)+"osed"]=!0;continue;case"3":if(!this._ws)return void this[i(1131)](e[i(1232)]);continue;case"4":if(e.iZCim(this[i(1152)][i(1367)+"te"],this[i(460)])||e[i(1050)](this[i(1152)].readyState,this[i(1360)]))return void this[i(1131)](e[i(224)]);continue;case"5":this["_QoSMana"+i(1655)]?.[i(363)]();continue;case"6":this[i(1117)+i(424)+"t"](t,n);continue;case"7":this[i(1292)+i(538)]();continue}break}}async[r(440)](t,n){let i=r,x={nMvCI:function(O,R){return e[D(1571)](O,R)},ruROc:function(O,R){return O<R},eDAeQ:function(O,R){return e[D(263)](O,R)},PgZRj:function(O,R){return e[D(1593)](O,R)},miiRl:function(O,R){return e[D(1818)](O,R)},yJVpb:function(O,R){return e[D(918)](O,R)},KJgfL:function(O,R){return e[D(1023)](O,R)},STMKQ:function(O,R){return e.amWCa(O,R)},kmMTx:function(O,R){return e[D(771)](O,R)},nGgqm:function(O,R){return e[D(914)](O,R)},AenXk:function(O,R){return e[D(907)](O,R)},IxBSo:function(O,R){return e[D(1375)](O,R)},gcxzi:function(O,R){return O>R},TbOjW:function(O,R,Z,Ft){return e[D(543)](O,R,Z,Ft)}};if(e[i(614)](null,t))throw new Error(e[i(1048)]);e[i(239)]==typeof t&&(t=JSON[i(1437)+"y"](t)),e[i(1452)]!=typeof t&&!e[i(1624)](t,ArrayBuffer)&&!(t[i(1378)]&&e[i(501)](t.buffer,ArrayBuffer))&&(t=JSON[i(1437)+"y"](t));let d=await e[i(851)](fs,t),h=e[i(738)](Yo,t),{method:g=0,service:f=this[i(1594)][i(1589)],logID:_=this[i(1594)][i(1533)+i(1598)](),headers:v=this[i(1594)].headers,payloadEncoding:C=this[i(1594)][i(1302)+i(700)],payloadType:L=this[i(1594)][i(651)+"ype"],logIDNew:B=this[i(1594)][i(1385)+i(1804)][i(1170)+i(774)+"teLogIDNew"]?e.MPqrN(a,this._options["logIDNew"+i(1804)][i(1729)]):""}=e.LOVKH(n,{});if(!f)throw new Error(e[i(1035)]);let P={SeqID:z[i(1412)+"er"](this._seqId++),LogID:z.fromNumber(_),service:f,method:g,headers:v,payloadEncoding:C instanceof Object?C[i(1840)]?C[i(1840)]:"":C,payloadType:e[i(1532)](L,Object)?L[i(659)]?L[i(659)]:h:L||h,payload:d,LogIDNew:B},U=e.SJESz(Jn,P);if(this[i(1152)]&&this[i(1152)][i(1367)+"te"]===this[i(1103)])this[i(1152)]&&this[i(1152)][i(440)](U),this._debug(e[i(1162)],P);else if(e[i(914)](this._messageQueue.length,this[i(1594)][i(376)+i(871)+i(1173)]))if(e.eUOia(e[i(1210)],e[i(1080)])){if(_0x5aed90=hCpibJ[i(1658)](127,_0x286e16[_0x5ea9e5])>>>0,hCpibJ[i(887)](_0x20e849[_0x269726++],128))return{value:_0x11b052?_0x3c3c6a:hCpibJ[i(1795)](0,_0x3bfc5f),offset:_0x1e882d};if(_0xd73695=hCpibJ[i(1480)](_0xe638a|hCpibJ[i(1421)](hCpibJ[i(1658)](127,_0xb15461[_0x29bb7f]),7),0),_0x1c1fb6[_0x431d16++]<128)return{value:_0x164e80?_0x1b8527:hCpibJ[i(1281)](0,_0x71b7b1),offset:_0x1d3dc8};if(_0x1a4b86=(_0x57a785|hCpibJ.miiRl(hCpibJ[i(1658)](127,_0x18bb16[_0x4598da]),14))>>>0,hCpibJ.KJgfL(_0x3c79e8[_0x45a220++],128))return{value:_0x200dbc?_0x1f59a6:hCpibJ.eDAeQ(0,_0x162b3a),offset:_0x1ac2bc};if(_0x6ec858=hCpibJ[i(1326)](_0x2ea577,hCpibJ[i(1777)](127,_0x1e0b73[_0x1fec7e])<<21)>>>0,hCpibJ[i(731)](_0x1d5695[_0x1bcd61++],128))return{value:_0xeb0c78?_0x12c4c5:hCpibJ[i(1824)](0,_0x27112d),offset:_0x3a5561};if(_0x55c087=hCpibJ[i(1480)](hCpibJ[i(1795)](_0x438591,hCpibJ[i(1421)](hCpibJ[i(1777)](15,_0x73a0f4[_0x2405bc]),28)),0),hCpibJ[i(1407)](_0x5dce06[_0x2cf2a7++],128))return{value:_0x394530?_0x135f2a:0|_0x15e3a3,offset:_0x4ccbdd};if(hCpibJ[i(404)](_0x539a83+=5,_0x276bd9[i(1239)]))throw _0x57cef4=_0x2001b7[i(1239)],hCpibJ.TbOjW(_0x35206e,_0x3fe373,10,_0x374562[i(1239)]);return{value:_0xdee56a?_0x15d179:0|_0x1475d5,offset:_0x58b6d6}}else this[i(347)+"Queue"][i(560)](U),this[i(1131)](e.DXtwE,P);else this["_message"+i(1148)][i(494)](),this[i(347)+i(1148)][i(560)](U);return{seqID:this._seqId,logID:_,logIDNew:B}}async reconnect(t){let n=r,{url:i}=e.gDvqE(t,{}),x=Array[n(1064)](i)?i:e[n(614)](e[n(1452)],typeof i)?[i]:[];t&&Object.assign(this[n(1594)],t),x&&x[n(1239)]?this["_endpoin"+n(590)]=new as(x,this[n(1594)][n(1783)+"es"]):this[n(270)+n(590)]?.[n(931)+n(315)+n(1590)](),this[n(261)+n(831)]?.["resetCou"+n(1766)](this[n(1594)][n(1113)+n(1805)]),this[n(923)+n(699)]=!1,this[n(1152)]&&this[n(1152)][n(1367)+"te"]!==this[n(460)]?this[n(1057)+n(1262)](1e3,e[n(1007)],!0):(this[n(1204)]=!0,this._connect())}async[r(1168)](){let t=r;if(!this[t(1441)+t(1183)]){let n=(t(1523)+"4")[t(1120)]("|"),i=0;for(;;){switch(n[i++]){case"0":this["_pingLos"+t(831)]?.["resetCou"+t(1766)]();continue;case"1":this[t(1204)]=!0;continue;case"2":this["_readyCl"+t(699)]=!1;continue;case"3":this[t(270)+"tManager"]?.["resetEndpointCon"+t(1590)]();continue;case"4":this[t(1441)]();continue}break}}}["addEvent"+r(662)](t,n){this.on(t,n)}[r(419)+r(1242)](t){let n=r,{type:i}=t;this[n(1304)](i,t)}[r(1838)+"entListe"+r(991)](t,n){this.off(t,n)}pingOnce(){return new Promise((t,n)=>{let i=D,x={fyzKF:function(g,f){return e[D(1312)](g,f)},IJxnZ:e[i(829)],yVTvq:e[i(453)],FyWtO:function(g,f){return e[i(1466)](g,f)},upbRa:i(1649),FrLpr:e.BOKgN};this[i(1292)+i(538)](),this[i(904)+i(1604)+"Id"]=e.SfEJS(setTimeout,this[i(1249)][i(252)](this),this[i(1594)][i(1220)+"rval"]);let d=()=>{let g=i;x[g(1140)](t,x[g(793)]),this[g(319)](g(1398)+"e_success",d),this.off(x[g(1404)],h)},h=()=>{let g=i;x[g(1045)](n,x[g(1788)]),this[g(319)](x[g(223)],d),this[g(319)](x.yVTvq,h)};this.on(e[i(693)],d),this.on(e[i(453)],h),this[i(1249)]()})}}})(),Y[S(418)+S(1067)]=V[S(418)+S(1067)],Y["CustomEr"+S(928)]=V[S(314)+S(928)],Y[S(705)+"e"]=V.ErrorCode,Y.Event=V[S(1242)],Y[S(1041)]=V[S(1041)],Y[S(1583)+S(1499)+S(665)]=V[S(1583)+"MessageEvent"],Y["MessageE"+S(665)]=V["MessageE"+S(665)],Y[S(961)+"t"]=V[S(961)+"t"],Y["Reconnec"+S(846)]=V["Reconnec"+S(846)],Y[S(1003)+S(1067)]=V[S(1003)+S(1067)],Y[S(1569)+S(928)]=V[S(1569)+S(928)],Y[S(452)+"ssageEvent"]=V["createMe"+S(1038)+"nt"],Y[S(1738)+S(528)]=V[S(1738)+"enEvent"],Y[S(445)+S(1772)+S(665)]=V[S(445)+S(1772)+S(665)],Y[S(1141)+S(1101)]=V[S(1141)+S(1101)],Y[S(1399)+"ame"]=V[S(1399)+"ame"];for(hn in V)["CustomCl"+S(1067),S(314)+S(928),S(705)+"e",S(1242),S(1041),S(1583)+S(1499)+S(665),S(1499)+S(665),S(961)+"t",S(602)+"tEvent",S(1003)+S(1067),S(1569)+S(928),"createMessageEvent","createOp"+S(528),S(445)+S(1772)+S(665),S(1141)+S(1101),"encodeFrame"][S(322)](hn)===-1&&(Y[hn]=V[hn]);var hn;Object[S(1831)+"operty"](Y,"__esModule",{value:!0})});var Re=ae((Gd,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 kt=ae((Jd,yn)=>{"use strict";var{EMPTY_BUFFER:lx}=Re(),dr=Buffer[Symbol.species];function hx(r,e){if(r.length===0)return lx;if(r.length===1)return r[0];let o=Buffer.allocUnsafe(e),a=0;for(let c=0;c<r.length;c++){let u=r[c];o.set(u,a),a+=u.length}return a<e?new dr(o.buffer,o.byteOffset,a):o}function ui(r,e,o,a,c){for(let u=0;u<c;u++)o[a+u]=r[u]^e[u&3]}function fi(r,e){for(let o=0;o<r.length;o++)r[o]^=e[o&3]}function gx(r){return r.length===r.buffer.byteLength?r.buffer:r.buffer.slice(r.byteOffset,r.byteOffset+r.length)}function lr(r){if(lr.readOnly=!0,Buffer.isBuffer(r))return r;let e;return r instanceof ArrayBuffer?e=new dr(r):ArrayBuffer.isView(r)?e=new dr(r.buffer,r.byteOffset,r.byteLength):(e=Buffer.from(r),lr.readOnly=!1),e}yn.exports={concat:hx,mask:ui,toArrayBuffer:gx,toBuffer:lr,unmask:fi};if(!process.env.WS_NO_BUFFER_UTIL)try{let r=X("bufferutil");yn.exports.mask=function(e,o,a,c,u){u<48?ui(e,o,a,c,u):r.mask(e,o,a,c,u)},yn.exports.unmask=function(e,o){e.length<32?fi(e,o):r.unmask(e,o)}}catch{}});var hi=ae((Xd,li)=>{"use strict";var di=Symbol("kDone"),hr=Symbol("kRun"),gr=class{constructor(e){this[di]=()=>{this.pending--,this[hr]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[hr]()}[hr](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[di])}}};li.exports=gr});var ht=ae((Vd,_i)=>{"use strict";var Tt=X("zlib"),gi=kt(),px=hi(),{kStatusCode:pi}=Re(),mx=Buffer[Symbol.species],_x=Buffer.from([0,0,255,255]),Sn=Symbol("permessage-deflate"),Me=Symbol("total-length"),dt=Symbol("callback"),He=Symbol("buffers"),lt=Symbol("error"),vn,pr=class{constructor(e){if(this._options=e||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._maxPayload=this._options.maxPayload|0,this._isServer=!!this._options.isServer,this._deflate=null,this._inflate=null,this.params=null,!vn){let o=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;vn=new px(o)}}static get extensionName(){return"permessage-deflate"}offer(){let e={};return this._options.serverNoContextTakeover&&(e.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(e.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(e.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?e.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(e.client_max_window_bits=!0),e}accept(e){return e=this.normalizeParams(e),this.params=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let e=this._deflate[dt];this._deflate.close(),this._deflate=null,e&&e(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(e){let o=this._options,a=e.find(c=>!(o.serverNoContextTakeover===!1&&c.server_no_context_takeover||c.server_max_window_bits&&(o.serverMaxWindowBits===!1||typeof o.serverMaxWindowBits=="number"&&o.serverMaxWindowBits>c.server_max_window_bits)||typeof o.clientMaxWindowBits=="number"&&!c.client_max_window_bits));if(!a)throw new Error("None of the extension offers can be accepted");return o.serverNoContextTakeover&&(a.server_no_context_takeover=!0),o.clientNoContextTakeover&&(a.client_no_context_takeover=!0),typeof o.serverMaxWindowBits=="number"&&(a.server_max_window_bits=o.serverMaxWindowBits),typeof o.clientMaxWindowBits=="number"?a.client_max_window_bits=o.clientMaxWindowBits:(a.client_max_window_bits===!0||o.clientMaxWindowBits===!1)&&delete a.client_max_window_bits,a}acceptAsClient(e){let o=e[0];if(this._options.clientNoContextTakeover===!1&&o.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!o.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(o.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&o.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return o}normalizeParams(e){return e.forEach(o=>{Object.keys(o).forEach(a=>{let c=o[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 u=+c;if(!Number.isInteger(u)||u<8||u>15)throw new TypeError(`Invalid value for parameter "${a}": ${c}`);c=u}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${a}": ${c}`)}else if(a==="server_max_window_bits"){let u=+c;if(!Number.isInteger(u)||u<8||u>15)throw new TypeError(`Invalid value for parameter "${a}": ${c}`);c=u}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}"`);o[a]=c})}),e}decompress(e,o,a){vn.add(c=>{this._decompress(e,o,(u,l)=>{c(),a(u,l)})})}compress(e,o,a){vn.add(c=>{this._compress(e,o,(u,l)=>{c(),a(u,l)})})}_decompress(e,o,a){let c=this._isServer?"client":"server";if(!this._inflate){let u=`${c}_max_window_bits`,l=typeof this.params[u]!="number"?Tt.Z_DEFAULT_WINDOWBITS:this.params[u];this._inflate=Tt.createInflateRaw({...this._options.zlibInflateOptions,windowBits:l}),this._inflate[Sn]=this,this._inflate[Me]=0,this._inflate[He]=[],this._inflate.on("error",yx),this._inflate.on("data",mi)}this._inflate[dt]=a,this._inflate.write(e),o&&this._inflate.write(_x),this._inflate.flush(()=>{let u=this._inflate[lt];if(u){this._inflate.close(),this._inflate=null,a(u);return}let l=gi.concat(this._inflate[He],this._inflate[Me]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[Me]=0,this._inflate[He]=[],o&&this.params[`${c}_no_context_takeover`]&&this._inflate.reset()),a(null,l)})}_compress(e,o,a){let c=this._isServer?"server":"client";if(!this._deflate){let u=`${c}_max_window_bits`,l=typeof this.params[u]!="number"?Tt.Z_DEFAULT_WINDOWBITS:this.params[u];this._deflate=Tt.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:l}),this._deflate[Me]=0,this._deflate[He]=[],this._deflate.on("data",bx)}this._deflate[dt]=a,this._deflate.write(e),this._deflate.flush(Tt.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let u=gi.concat(this._deflate[He],this._deflate[Me]);o&&(u=new mx(u.buffer,u.byteOffset,u.length-4)),this._deflate[dt]=null,this._deflate[Me]=0,this._deflate[He]=[],o&&this.params[`${c}_no_context_takeover`]&&this._deflate.reset(),a(null,u)})}};_i.exports=pr;function bx(r){this[He].push(r),this[Me]+=r.length}function mi(r){if(this[Me]+=r.length,this[Sn]._maxPayload<1||this[Me]<=this[Sn]._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 yx(r){if(this[Sn]._inflate=null,this[lt]){this[dt](this[lt]);return}r[pi]=1007,this[dt](r)}});var gt=ae((Yd,Cn)=>{"use strict";var{isUtf8:wi}=X("buffer"),{hasBlob:vx}=Re(),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 mr(r){let e=r.length,o=0;for(;o<e;)if((r[o]&128)===0)o++;else if((r[o]&224)===192){if(o+1===e||(r[o+1]&192)!==128||(r[o]&254)===192)return!1;o+=2}else if((r[o]&240)===224){if(o+2>=e||(r[o+1]&192)!==128||(r[o+2]&192)!==128||r[o]===224&&(r[o+1]&224)===128||r[o]===237&&(r[o+1]&224)===160)return!1;o+=3}else if((r[o]&248)===240){if(o+3>=e||(r[o+1]&192)!==128||(r[o+2]&192)!==128||(r[o+3]&192)!==128||r[o]===240&&(r[o+1]&240)===128||r[o]===244&&r[o+1]>143||r[o]>244)return!1;o+=4}else return!1;return!0}function 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")}Cn.exports={isBlob:Ex,isValidStatusCode:Cx,isValidUTF8:mr,tokenChars:Sx};if(wi)Cn.exports.isValidUTF8=function(r){return r.length<24?mr(r):wi(r)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let r=X("utf-8-validate");Cn.exports.isValidUTF8=function(e){return e.length<32?mr(e):r(e)}}catch{}});var vr=ae((Zd,Ai)=>{"use strict";var{Writable:Ax}=X("stream"),bi=ht(),{BINARY_TYPES:Dx,EMPTY_BUFFER:yi,kStatusCode:Lx,kWebSocket:Px}=Re(),{concat:_r,toArrayBuffer:kx,unmask:Tx}=kt(),{isValidStatusCode:Ix,isValidUTF8:vi}=gt(),En=Buffer[Symbol.species],ge=0,Si=1,Ci=2,Ei=3,wr=4,br=5,An=6,yr=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=ge}_write(e,o,a){if(this._opcode===8&&this._state==ge)return a();this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(a)}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e<this._buffers[0].length){let a=this._buffers[0];return this._buffers[0]=new En(a.buffer,a.byteOffset+e,a.length-e),new En(a.buffer,a.byteOffset,e)}let o=Buffer.allocUnsafe(e);do{let a=this._buffers[0],c=o.length-e;e>=a.length?o.set(this._buffers.shift(),c):(o.set(new Uint8Array(a.buffer,a.byteOffset,e),c),this._buffers[0]=new En(a.buffer,a.byteOffset+e,a.length-e)),e-=a.length}while(e>0);return o}startLoop(e){this._loop=!0;do switch(this._state){case ge:this.getInfo(e);break;case Si:this.getPayloadLength16(e);break;case Ci:this.getPayloadLength64(e);break;case Ei:this.getMask();break;case wr:this.getData(e);break;case br:case An:this._loop=!1;return}while(this._loop);this._errored||e()}getInfo(e){if(this._bufferedBytes<2){this._loop=!1;return}let o=this.consume(2);if((o[0]&48)!==0){let c=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");e(c);return}let a=(o[0]&64)===64;if(a&&!this._extensions[bi.extensionName]){let c=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(c);return}if(this._fin=(o[0]&128)===128,this._opcode=o[0]&15,this._payloadLength=o[1]&127,this._opcode===0){if(a){let c=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(c);return}if(!this._fragmented){let c=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");e(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");e(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");e(c);return}if(a){let c=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(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");e(c);return}}else{let c=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(c);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(o[1]&128)===128,this._isServer){if(!this._masked){let c=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");e(c);return}}else if(this._masked){let c=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");e(c);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 o=this.consume(8),a=o.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");e(c);return}this._payloadLength=a*Math.pow(2,32)+o.readUInt32BE(4),this.haveLength(e)}haveLength(e){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let o=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");e(o);return}this._masked?this._state=Ei:this._state=wr}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=wr}getData(e){let o=yi;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}o=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&Tx(o,this._mask)}if(this._opcode>7){this.controlMessage(o,e);return}if(this._compressed){this._state=br,this.decompress(o,e);return}o.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(o)),this.dataMessage(e)}decompress(e,o){this._extensions[bi.extensionName].decompress(e,this._fin,(c,u)=>{if(c)return o(c);if(u.length){if(this._messageLength+=u.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let l=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");o(l);return}this._fragments.push(u)}this.dataMessage(o),this._state===ge&&this.startLoop(o)})}dataMessage(e){if(!this._fin){this._state=ge;return}let o=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=_r(a,o):this._binaryType==="arraybuffer"?c=kx(_r(a,o)):this._binaryType==="blob"?c=new Blob(a):c=a,this._allowSynchronousEvents?(this.emit("message",c,!0),this._state=ge):(this._state=An,setImmediate(()=>{this.emit("message",c,!0),this._state=ge,this.startLoop(e)}))}else{let c=_r(a,o);if(!this._skipUTF8Validation&&!vi(c)){let u=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(u);return}this._state===br||this._allowSynchronousEvents?(this.emit("message",c,!1),this._state=ge):(this._state=An,setImmediate(()=>{this.emit("message",c,!1),this._state=ge,this.startLoop(e)}))}}controlMessage(e,o){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit("conclude",1005,yi),this.end();else{let a=e.readUInt16BE(0);if(!Ix(a)){let u=this.createError(RangeError,`invalid status code ${a}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");o(u);return}let c=new En(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!vi(c)){let u=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");o(u);return}this._loop=!1,this.emit("conclude",a,c),this.end()}this._state=ge;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=ge):(this._state=An,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=ge,this.startLoop(o)}))}createError(e,o,a,c,u){this._loop=!1,this._errored=!0;let l=new e(a?`Invalid WebSocket frame: ${o}`:o);return Error.captureStackTrace(l,this.createError),l.code=u,l[Lx]=c,l}};Ai.exports=yr});var Er=ae((Qd,Pi)=>{"use strict";var{Duplex:$d}=X("stream"),{randomFillSync:Nx}=X("crypto"),Di=ht(),{EMPTY_BUFFER:Rx,kWebSocket:Mx,NOOP:Ox}=Re(),{isBlob:pt,isValidStatusCode:Bx}=gt(),{mask:Li,toBuffer:Ye}=kt(),pe=Symbol("kByteLength"),zx=Buffer.alloc(4),Dn=8*1024,Ze,mt=Dn,we=0,qx=1,Ux=2,Sr=class r{constructor(e,o,a){this._extensions=o||{},a&&(this._generateMask=a,this._maskBuffer=Buffer.alloc(4)),this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=we,this.onerror=Ox,this[Mx]=void 0}static frame(e,o){let a,c=!1,u=2,l=!1;o.mask&&(a=o.maskBuffer||zx,o.generateMask?o.generateMask(a):(mt===Dn&&(Ze===void 0&&(Ze=Buffer.alloc(Dn)),Nx(Ze,0,Dn),mt=0),a[0]=Ze[mt++],a[1]=Ze[mt++],a[2]=Ze[mt++],a[3]=Ze[mt++]),l=(a[0]|a[1]|a[2]|a[3])===0,u=6);let p;typeof e=="string"?(!o.mask||l)&&o[pe]!==void 0?p=o[pe]:(e=Buffer.from(e),p=e.length):(p=e.length,c=o.mask&&o.readOnly&&!l);let m=p;p>=65536?(u+=8,m=127):p>125&&(u+=2,m=126);let b=Buffer.allocUnsafe(c?p+u:u);return b[0]=o.fin?o.opcode|128:o.opcode,o.rsv1&&(b[0]|=64),b[1]=m,m===126?b.writeUInt16BE(p,2):m===127&&(b[2]=b[3]=0,b.writeUIntBE(p,4,6)),o.mask?(b[1]|=128,b[u-4]=a[0],b[u-3]=a[1],b[u-2]=a[2],b[u-1]=a[3],l?[b,e]:c?(Li(e,a,b,u,p),[b]):(Li(e,a,e,0,p),[b,e])):[b,e]}close(e,o,a,c){let u;if(e===void 0)u=Rx;else{if(typeof e!="number"||!Bx(e))throw new TypeError("First argument must be a valid error code number");if(o===void 0||!o.length)u=Buffer.allocUnsafe(2),u.writeUInt16BE(e,0);else{let p=Buffer.byteLength(o);if(p>123)throw new RangeError("The message must not be greater than 123 bytes");u=Buffer.allocUnsafe(2+p),u.writeUInt16BE(e,0),typeof o=="string"?u.write(o,2):u.set(o,2)}}let l={[pe]:u.length,fin:!0,generateMask:this._generateMask,mask:a,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==we?this.enqueue([this.dispatch,u,!1,l,c]):this.sendFrame(r.frame(u,l),c)}ping(e,o,a){let c,u;if(typeof e=="string"?(c=Buffer.byteLength(e),u=!1):pt(e)?(c=e.size,u=!1):(e=Ye(e),c=e.length,u=Ye.readOnly),c>125)throw new RangeError("The data size must not be greater than 125 bytes");let l={[pe]:c,fin:!0,generateMask:this._generateMask,mask:o,maskBuffer:this._maskBuffer,opcode:9,readOnly:u,rsv1:!1};pt(e)?this._state!==we?this.enqueue([this.getBlobData,e,!1,l,a]):this.getBlobData(e,!1,l,a):this._state!==we?this.enqueue([this.dispatch,e,!1,l,a]):this.sendFrame(r.frame(e,l),a)}pong(e,o,a){let c,u;if(typeof e=="string"?(c=Buffer.byteLength(e),u=!1):pt(e)?(c=e.size,u=!1):(e=Ye(e),c=e.length,u=Ye.readOnly),c>125)throw new RangeError("The data size must not be greater than 125 bytes");let l={[pe]:c,fin:!0,generateMask:this._generateMask,mask:o,maskBuffer:this._maskBuffer,opcode:10,readOnly:u,rsv1:!1};pt(e)?this._state!==we?this.enqueue([this.getBlobData,e,!1,l,a]):this.getBlobData(e,!1,l,a):this._state!==we?this.enqueue([this.dispatch,e,!1,l,a]):this.sendFrame(r.frame(e,l),a)}send(e,o,a){let c=this._extensions[Di.extensionName],u=o.binary?2:1,l=o.compress,p,m;typeof e=="string"?(p=Buffer.byteLength(e),m=!1):pt(e)?(p=e.size,m=!1):(e=Ye(e),p=e.length,m=Ye.readOnly),this._firstFragment?(this._firstFragment=!1,l&&c&&c.params[c._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(l=p>=c._threshold),this._compress=l):(l=!1,u=0),o.fin&&(this._firstFragment=!0);let b={[pe]:p,fin:o.fin,generateMask:this._generateMask,mask:o.mask,maskBuffer:this._maskBuffer,opcode:u,readOnly:m,rsv1:l};pt(e)?this._state!==we?this.enqueue([this.getBlobData,e,this._compress,b,a]):this.getBlobData(e,this._compress,b,a):this._state!==we?this.enqueue([this.dispatch,e,this._compress,b,a]):this.dispatch(e,this._compress,b,a)}getBlobData(e,o,a,c){this._bufferedBytes+=a[pe],this._state=Ux,e.arrayBuffer().then(u=>{if(this._socket.destroyed){let p=new Error("The socket was closed while the blob was being read");process.nextTick(Cr,this,p,c);return}this._bufferedBytes-=a[pe];let l=Ye(u);o?this.dispatch(l,o,a,c):(this._state=we,this.sendFrame(r.frame(l,a),c),this.dequeue())}).catch(u=>{process.nextTick(Fx,this,u,c)})}dispatch(e,o,a,c){if(!o){this.sendFrame(r.frame(e,a),c);return}let u=this._extensions[Di.extensionName];this._bufferedBytes+=a[pe],this._state=qx,u.compress(e,a.fin,(l,p)=>{if(this._socket.destroyed){let m=new Error("The socket was closed while data was being compressed");Cr(this,m,c);return}this._bufferedBytes-=a[pe],this._state=we,a.readOnly=!1,this.sendFrame(r.frame(p,a),c),this.dequeue()})}dequeue(){for(;this._state===we&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][pe],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][pe],this._queue.push(e)}sendFrame(e,o){e.length===2?(this._socket.cork(),this._socket.write(e[0]),this._socket.write(e[1],o),this._socket.uncork()):this._socket.write(e[0],o)}};Pi.exports=Sr;function Cr(r,e,o){typeof o=="function"&&o(e);for(let a=0;a<r._queue.length;a++){let c=r._queue[a],u=c[c.length-1];typeof u=="function"&&u(e)}}function Fx(r,e,o){Cr(r,e,o),r.onerror(e)}});var zi=ae((el,Bi)=>{"use strict";var{kForOnEventAttribute:It,kListener:Ar}=Re(),ki=Symbol("kCode"),Ti=Symbol("kData"),Ii=Symbol("kError"),Ni=Symbol("kMessage"),Ri=Symbol("kReason"),_t=Symbol("kTarget"),Mi=Symbol("kType"),Oi=Symbol("kWasClean"),Oe=class{constructor(e){this[_t]=null,this[Mi]=e}get target(){return this[_t]}get type(){return this[Mi]}};Object.defineProperty(Oe.prototype,"target",{enumerable:!0});Object.defineProperty(Oe.prototype,"type",{enumerable:!0});var $e=class extends Oe{constructor(e,o={}){super(e),this[ki]=o.code===void 0?0:o.code,this[Ri]=o.reason===void 0?"":o.reason,this[Oi]=o.wasClean===void 0?!1:o.wasClean}get code(){return this[ki]}get reason(){return this[Ri]}get wasClean(){return this[Oi]}};Object.defineProperty($e.prototype,"code",{enumerable:!0});Object.defineProperty($e.prototype,"reason",{enumerable:!0});Object.defineProperty($e.prototype,"wasClean",{enumerable:!0});var wt=class extends Oe{constructor(e,o={}){super(e),this[Ii]=o.error===void 0?null:o.error,this[Ni]=o.message===void 0?"":o.message}get error(){return this[Ii]}get message(){return this[Ni]}};Object.defineProperty(wt.prototype,"error",{enumerable:!0});Object.defineProperty(wt.prototype,"message",{enumerable:!0});var Nt=class extends Oe{constructor(e,o={}){super(e),this[Ti]=o.data===void 0?null:o.data}get data(){return this[Ti]}};Object.defineProperty(Nt.prototype,"data",{enumerable:!0});var Kx={addEventListener(r,e,o={}){for(let c of this.listeners(r))if(!o[It]&&c[Ar]===e&&!c[It])return;let a;if(r==="message")a=function(u,l){let p=new Nt("message",{data:l?u:u.toString()});p[_t]=this,Ln(e,this,p)};else if(r==="close")a=function(u,l){let p=new $e("close",{code:u,reason:l.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});p[_t]=this,Ln(e,this,p)};else if(r==="error")a=function(u){let l=new wt("error",{error:u,message:u.message});l[_t]=this,Ln(e,this,l)};else if(r==="open")a=function(){let u=new Oe("open");u[_t]=this,Ln(e,this,u)};else return;a[It]=!!o[It],a[Ar]=e,o.once?this.once(r,a):this.on(r,a)},removeEventListener(r,e){for(let o of this.listeners(r))if(o[Ar]===e&&!o[It]){this.removeListener(r,o);break}}};Bi.exports={CloseEvent:$e,ErrorEvent:wt,Event:Oe,EventTarget:Kx,MessageEvent:Nt};function Ln(r,e,o){typeof r=="object"&&r.handleEvent?r.handleEvent.call(r,o):r.call(e,o)}});var Pn=ae((tl,qi)=>{"use strict";var{tokenChars:Rt}=gt();function Ee(r,e,o){r[e]===void 0?r[e]=[o]:r[e].push(o)}function Hx(r){let e=Object.create(null),o=Object.create(null),a=!1,c=!1,u=!1,l,p,m=-1,b=-1,w=-1,y=0;for(;y<r.length;y++)if(b=r.charCodeAt(y),l===void 0)if(w===-1&&Rt[b]===1)m===-1&&(m=y);else if(y!==0&&(b===32||b===9))w===-1&&m!==-1&&(w=y);else if(b===59||b===44){if(m===-1)throw new SyntaxError(`Unexpected character at index ${y}`);w===-1&&(w=y);let T=r.slice(m,w);b===44?(Ee(e,T,o),o=Object.create(null)):l=T,m=w=-1}else throw new SyntaxError(`Unexpected character at index ${y}`);else if(p===void 0)if(w===-1&&Rt[b]===1)m===-1&&(m=y);else if(b===32||b===9)w===-1&&m!==-1&&(w=y);else if(b===59||b===44){if(m===-1)throw new SyntaxError(`Unexpected character at index ${y}`);w===-1&&(w=y),Ee(o,r.slice(m,w),!0),b===44&&(Ee(e,l,o),o=Object.create(null),l=void 0),m=w=-1}else if(b===61&&m!==-1&&w===-1)p=r.slice(m,y),m=w=-1;else throw new SyntaxError(`Unexpected character at index ${y}`);else if(c){if(Rt[b]!==1)throw new SyntaxError(`Unexpected character at index ${y}`);m===-1?m=y:a||(a=!0),c=!1}else if(u)if(Rt[b]===1)m===-1&&(m=y);else if(b===34&&m!==-1)u=!1,w=y;else if(b===92)c=!0;else throw new SyntaxError(`Unexpected character at index ${y}`);else if(b===34&&r.charCodeAt(y-1)===61)u=!0;else if(w===-1&&Rt[b]===1)m===-1&&(m=y);else if(m!==-1&&(b===32||b===9))w===-1&&(w=y);else if(b===59||b===44){if(m===-1)throw new SyntaxError(`Unexpected character at index ${y}`);w===-1&&(w=y);let T=r.slice(m,w);a&&(T=T.replace(/\\/g,""),a=!1),Ee(o,p,T),b===44&&(Ee(e,l,o),o=Object.create(null),l=void 0),p=void 0,m=w=-1}else throw new SyntaxError(`Unexpected character at index ${y}`);if(m===-1||u||b===32||b===9)throw new SyntaxError("Unexpected end of input");w===-1&&(w=y);let E=r.slice(m,w);return l===void 0?Ee(e,E,o):(p===void 0?Ee(o,E,!0):a?Ee(o,p,E.replace(/\\/g,"")):Ee(o,p,E),Ee(e,l,o)),e}function Wx(r){return Object.keys(r).map(e=>{let o=r[e];return Array.isArray(o)||(o=[o]),o.map(a=>[e].concat(Object.keys(a).map(c=>{let u=a[c];return Array.isArray(u)||(u=[u]),u.map(l=>l===!0?c:`${c}=${l}`).join("; ")})).join("; ")).join(", ")}).join(", ")}qi.exports={format:Wx,parse:Hx}});var Nn=ae((sl,Zi)=>{"use strict";var jx=X("events"),Gx=X("https"),Jx=X("http"),Ki=X("net"),Xx=X("tls"),{randomBytes:Vx,createHash:Yx}=X("crypto"),{Duplex:nl,Readable:rl}=X("stream"),{URL:Dr}=X("url"),We=ht(),Zx=vr(),$x=Er(),{isBlob:Qx}=gt(),{BINARY_TYPES:Ui,CLOSE_TIMEOUT:ec,EMPTY_BUFFER:kn,GUID:tc,kForOnEventAttribute:Lr,kListener:nc,kStatusCode:rc,kWebSocket:Q,NOOP:Hi}=Re(),{EventTarget:{addEventListener:sc,removeEventListener:ic}}=zi(),{format:oc,parse:ac}=Pn(),{toBuffer:xc}=kt(),Wi=Symbol("kAborted"),Pr=[8,13],Be=["CONNECTING","OPEN","CLOSING","CLOSED"],cc=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,q=class r extends jx{constructor(e,o,a){super(),this._binaryType=Ui[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,e!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,o===void 0?o=[]:Array.isArray(o)||(typeof o=="object"&&o!==null?(a=o,o=[]):o=[o]),ji(this,e,o,a)):(this._autoPong=a.autoPong,this._closeTimeout=a.closeTimeout,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){Ui.includes(e)&&(this._binaryType=e,this._receiver&&(this._receiver._binaryType=e))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(e,o,a){let c=new Zx({allowSynchronousEvents:a.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:a.maxPayload,skipUTF8Validation:a.skipUTF8Validation}),u=new $x(e,this._extensions,a.generateMask);this._receiver=c,this._sender=u,this._socket=e,c[Q]=this,u[Q]=this,e[Q]=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),u.onerror=_c,e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),o.length>0&&e.unshift(o),e.on("close",Xi),e.on("data",In),e.on("end",Vi),e.on("error",Yi),this._readyState=r.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=r.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[We.extensionName]&&this._extensions[We.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=r.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,o){if(this.readyState!==r.CLOSED){if(this.readyState===r.CONNECTING){fe(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===r.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=r.CLOSING,this._sender.close(e,o,!this._isServer,a=>{a||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),Ji(this)}}pause(){this.readyState===r.CONNECTING||this.readyState===r.CLOSED||(this._paused=!0,this._socket.pause())}ping(e,o,a){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(a=e,e=o=void 0):typeof o=="function"&&(a=o,o=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){kr(this,e,a);return}o===void 0&&(o=!this._isServer),this._sender.ping(e||kn,o,a)}pong(e,o,a){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(a=e,e=o=void 0):typeof o=="function"&&(a=o,o=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){kr(this,e,a);return}o===void 0&&(o=!this._isServer),this._sender.pong(e||kn,o,a)}resume(){this.readyState===r.CONNECTING||this.readyState===r.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(e,o,a){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof o=="function"&&(a=o,o={}),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){kr(this,e,a);return}let c={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...o};this._extensions[We.extensionName]||(c.compress=!1),this._sender.send(e||kn,c,a)}terminate(){if(this.readyState!==r.CLOSED){if(this.readyState===r.CONNECTING){fe(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=r.CLOSING,this._socket.destroy())}}};Object.defineProperty(q,"CONNECTING",{enumerable:!0,value:Be.indexOf("CONNECTING")});Object.defineProperty(q.prototype,"CONNECTING",{enumerable:!0,value:Be.indexOf("CONNECTING")});Object.defineProperty(q,"OPEN",{enumerable:!0,value:Be.indexOf("OPEN")});Object.defineProperty(q.prototype,"OPEN",{enumerable:!0,value:Be.indexOf("OPEN")});Object.defineProperty(q,"CLOSING",{enumerable:!0,value:Be.indexOf("CLOSING")});Object.defineProperty(q.prototype,"CLOSING",{enumerable:!0,value:Be.indexOf("CLOSING")});Object.defineProperty(q,"CLOSED",{enumerable:!0,value:Be.indexOf("CLOSED")});Object.defineProperty(q.prototype,"CLOSED",{enumerable:!0,value:Be.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(r=>{Object.defineProperty(q.prototype,r,{enumerable:!0})});["open","error","close","message"].forEach(r=>{Object.defineProperty(q.prototype,`on${r}`,{enumerable:!0,get(){for(let e of this.listeners(r))if(e[Lr])return e[nc];return null},set(e){for(let o of this.listeners(r))if(o[Lr]){this.removeListener(r,o);break}typeof e=="function"&&this.addEventListener(r,e,{[Lr]:!0})}})});q.prototype.addEventListener=sc;q.prototype.removeEventListener=ic;Zi.exports=q;function ji(r,e,o,a){let c={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:ec,protocolVersion:Pr[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...a,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(r._autoPong=c.autoPong,r._closeTimeout=c.closeTimeout,!Pr.includes(c.protocolVersion))throw new RangeError(`Unsupported protocol version: ${c.protocolVersion} (supported versions: ${Pr.join(", ")})`);let u;if(e instanceof Dr)u=e;else try{u=new Dr(e)}catch{throw new SyntaxError(`Invalid URL: ${e}`)}u.protocol==="http:"?u.protocol="ws:":u.protocol==="https:"&&(u.protocol="wss:"),r._url=u.href;let l=u.protocol==="wss:",p=u.protocol==="ws+unix:",m;if(u.protocol!=="ws:"&&!l&&!p?m=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:p&&!u.pathname?m="The URL's pathname is empty":u.hash&&(m="The URL contains a fragment identifier"),m){let N=new SyntaxError(m);if(r._redirects===0)throw N;Tn(r,N);return}let b=l?443:80,w=Vx(16).toString("base64"),y=l?Gx.request:Jx.request,E=new Set,T;if(c.createConnection=c.createConnection||(l?fc:uc),c.defaultPort=c.defaultPort||b,c.port=u.port||b,c.host=u.hostname.startsWith("[")?u.hostname.slice(1,-1):u.hostname,c.headers={...c.headers,"Sec-WebSocket-Version":c.protocolVersion,"Sec-WebSocket-Key":w,Connection:"Upgrade",Upgrade:"websocket"},c.path=u.pathname+u.search,c.timeout=c.handshakeTimeout,c.perMessageDeflate&&(T=new We({...c.perMessageDeflate,isServer:!1,maxPayload:c.maxPayload}),c.headers["Sec-WebSocket-Extensions"]=oc({[We.extensionName]:T.offer()})),o.length){for(let N of o){if(typeof N!="string"||!cc.test(N)||E.has(N))throw new SyntaxError("An invalid or duplicated subprotocol was specified");E.add(N)}c.headers["Sec-WebSocket-Protocol"]=o.join(",")}if(c.origin&&(c.protocolVersion<13?c.headers["Sec-WebSocket-Origin"]=c.origin:c.headers.Origin=c.origin),(u.username||u.password)&&(c.auth=`${u.username}:${u.password}`),p){let N=c.path.split(":");c.socketPath=N[0],c.path=N[1]}let k;if(c.followRedirects){if(r._redirects===0){r._originalIpc=p,r._originalSecure=l,r._originalHostOrSocketPath=p?c.socketPath:u.host;let N=a&&a.headers;if(a={...a,headers:{}},N)for(let[G,oe]of Object.entries(N))a.headers[G.toLowerCase()]=oe}else if(r.listenerCount("redirect")===0){let N=p?r._originalIpc?c.socketPath===r._originalHostOrSocketPath:!1:r._originalIpc?!1:u.host===r._originalHostOrSocketPath;(!N||r._originalSecure&&!l)&&(delete c.headers.authorization,delete c.headers.cookie,N||delete c.headers.host,c.auth=void 0)}c.auth&&!a.headers.authorization&&(a.headers.authorization="Basic "+Buffer.from(c.auth).toString("base64")),k=r._req=y(c),r._redirects&&r.emit("redirect",r.url,k)}else k=r._req=y(c);c.timeout&&k.on("timeout",()=>{fe(r,k,"Opening handshake has timed out")}),k.on("error",N=>{k===null||k[Wi]||(k=r._req=null,Tn(r,N))}),k.on("response",N=>{let G=N.headers.location,oe=N.statusCode;if(G&&c.followRedirects&&oe>=300&&oe<400){if(++r._redirects>c.maxRedirects){fe(r,k,"Maximum redirects exceeded");return}k.abort();let ce;try{ce=new Dr(G,e)}catch{let H=new SyntaxError(`Invalid URL: ${G}`);Tn(r,H);return}ji(r,ce,o,a)}else r.emit("unexpected-response",k,N)||fe(r,k,`Unexpected server response: ${N.statusCode}`)}),k.on("upgrade",(N,G,oe)=>{if(r.emit("upgrade",N),r.readyState!==q.CONNECTING)return;k=r._req=null;let ce=N.headers.upgrade;if(ce===void 0||ce.toLowerCase()!=="websocket"){fe(r,G,"Invalid Upgrade header");return}let I=Yx("sha1").update(w+tc).digest("base64");if(N.headers["sec-websocket-accept"]!==I){fe(r,G,"Invalid Sec-WebSocket-Accept header");return}let H=N.headers["sec-websocket-protocol"],J;if(H!==void 0?E.size?E.has(H)||(J="Server sent an invalid subprotocol"):J="Server sent a subprotocol but none was requested":E.size&&(J="Server sent no subprotocol"),J){fe(r,G,J);return}H&&(r._protocol=H);let Ae=N.headers["sec-websocket-extensions"];if(Ae!==void 0){if(!T){fe(r,G,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let ze;try{ze=ac(Ae)}catch{fe(r,G,"Invalid Sec-WebSocket-Extensions header");return}let be=Object.keys(ze);if(be.length!==1||be[0]!==We.extensionName){fe(r,G,"Server indicated an extension that was not requested");return}try{T.accept(ze[We.extensionName])}catch{fe(r,G,"Invalid Sec-WebSocket-Extensions header");return}r._extensions[We.extensionName]=T}r.setSocket(G,oe,{allowSynchronousEvents:c.allowSynchronousEvents,generateMask:c.generateMask,maxPayload:c.maxPayload,skipUTF8Validation:c.skipUTF8Validation})}),c.finishRequest?c.finishRequest(k,r):k.end()}function Tn(r,e){r._readyState=q.CLOSING,r._errorEmitted=!0,r.emit("error",e),r.emitClose()}function uc(r){return r.path=r.socketPath,Ki.connect(r)}function fc(r){return r.path=void 0,!r.servername&&r.servername!==""&&(r.servername=Ki.isIP(r.host)?"":r.host),Xx.connect(r)}function fe(r,e,o){r._readyState=q.CLOSING;let a=new Error(o);Error.captureStackTrace(a,fe),e.setHeader?(e[Wi]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(Tn,r,a)):(e.destroy(a),e.once("error",r.emit.bind(r,"error")),e.once("close",r.emitClose.bind(r)))}function kr(r,e,o){if(e){let a=Qx(e)?e.size:xc(e).length;r._socket?r._sender._bufferedBytes+=a:r._bufferedAmount+=a}if(o){let a=new Error(`WebSocket is not open: readyState ${r.readyState} (${Be[r.readyState]})`);process.nextTick(o,a)}}function dc(r,e){let o=this[Q];o._closeFrameReceived=!0,o._closeMessage=e,o._closeCode=r,o._socket[Q]!==void 0&&(o._socket.removeListener("data",In),process.nextTick(Gi,o._socket),r===1005?o.close():o.close(r,e))}function lc(){let r=this[Q];r.isPaused||r._socket.resume()}function hc(r){let e=this[Q];e._socket[Q]!==void 0&&(e._socket.removeListener("data",In),process.nextTick(Gi,e._socket),e.close(r[rc])),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r))}function Fi(){this[Q].emitClose()}function gc(r,e){this[Q].emit("message",r,e)}function pc(r){let e=this[Q];e._autoPong&&e.pong(r,!this._isServer,Hi),e.emit("ping",r)}function mc(r){this[Q].emit("pong",r)}function Gi(r){r.resume()}function _c(r){let e=this[Q];e.readyState!==q.CLOSED&&(e.readyState===q.OPEN&&(e._readyState=q.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 Xi(){let r=this[Q];if(this.removeListener("close",Xi),this.removeListener("data",In),this.removeListener("end",Vi),r._readyState=q.CLOSING,!this._readableState.endEmitted&&!r._closeFrameReceived&&!r._receiver._writableState.errorEmitted&&this._readableState.length!==0){let e=this.read(this._readableState.length);r._receiver.write(e)}r._receiver.end(),this[Q]=void 0,clearTimeout(r._closeTimer),r._receiver._writableState.finished||r._receiver._writableState.errorEmitted?r.emitClose():(r._receiver.on("error",Fi),r._receiver.on("finish",Fi))}function In(r){this[Q]._receiver.write(r)||this.pause()}function Vi(){let r=this[Q];r._readyState=q.CLOSING,r._receiver.end(),this.end()}function Yi(){let r=this[Q];this.removeListener("error",Yi),this.on("error",Hi),r&&(r._readyState=q.CLOSING,this.destroy())}});var to=ae((ol,eo)=>{"use strict";var il=Nn(),{Duplex:wc}=X("stream");function $i(r){r.emit("close")}function bc(){!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 yc(r,e){let o=!0,a=new wc({...e,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return r.on("message",function(u,l){let p=!l&&a._readableState.objectMode?u.toString():u;a.push(p)||r.pause()}),r.once("error",function(u){a.destroyed||(o=!1,a.destroy(u))}),r.once("close",function(){a.destroyed||a.push(null)}),a._destroy=function(c,u){if(r.readyState===r.CLOSED){u(c),process.nextTick($i,a);return}let l=!1;r.once("error",function(m){l=!0,u(m)}),r.once("close",function(){l||u(c),process.nextTick($i,a)}),o&&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,u,l){if(r.readyState===r.CONNECTING){r.once("open",function(){a._write(c,u,l)});return}r.send(c,l)},a.on("end",bc),a.on("error",Qi),a}eo.exports=yc});var Tr=ae((al,no)=>{"use strict";var{tokenChars:vc}=gt();function Sc(r){let e=new Set,o=-1,a=-1,c=0;for(c;c<r.length;c++){let l=r.charCodeAt(c);if(a===-1&&vc[l]===1)o===-1&&(o=c);else if(c!==0&&(l===32||l===9))a===-1&&o!==-1&&(a=c);else if(l===44){if(o===-1)throw new SyntaxError(`Unexpected character at index ${c}`);a===-1&&(a=c);let p=r.slice(o,a);if(e.has(p))throw new SyntaxError(`The "${p}" subprotocol is duplicated`);e.add(p),o=a=-1}else throw new SyntaxError(`Unexpected character at index ${c}`)}if(o===-1||a!==-1)throw new SyntaxError("Unexpected end of input");let u=r.slice(o,c);if(e.has(u))throw new SyntaxError(`The "${u}" subprotocol is duplicated`);return e.add(u),e}no.exports={parse:Sc}});var co=ae((cl,xo)=>{"use strict";var Cc=X("events"),Rn=X("http"),{Duplex:xl}=X("stream"),{createHash:Ec}=X("crypto"),ro=Pn(),Qe=ht(),Ac=Tr(),Dc=Nn(),{CLOSE_TIMEOUT:Lc,GUID:Pc,kWebSocket:kc}=Re(),Tc=/^[+/0-9A-Za-z]{22}==$/,so=0,io=1,ao=2,Ir=class extends Cc{constructor(e,o){if(super(),e={allowSynchronousEvents:!0,autoPong:!0,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:Lc,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=Rn.createServer((a,c)=>{let u=Rn.STATUS_CODES[426];c.writeHead(426,{"Content-Length":u.length,"Content-Type":"text/plain"}),c.end(u)}),this._server.listen(e.port,e.host,e.backlog,o)):e.server&&(this._server=e.server),this._server){let a=this.emit.bind(this,"connection");this._removeListeners=Ic(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(c,u,l)=>{this.handleUpgrade(c,u,l,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(Mt,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(Mt,this):process.nextTick(Mt,this);else{let o=this._server;this._removeListeners(),this._removeListeners=this._server=null,o.close(()=>{Mt(this)})}}shouldHandle(e){if(this.options.path){let o=e.url.indexOf("?");if((o!==-1?e.url.slice(0,o):e.url)!==this.options.path)return!1}return!0}handleUpgrade(e,o,a,c){o.on("error",oo);let u=e.headers["sec-websocket-key"],l=e.headers.upgrade,p=+e.headers["sec-websocket-version"];if(e.method!=="GET"){et(this,e,o,405,"Invalid HTTP method");return}if(l===void 0||l.toLowerCase()!=="websocket"){et(this,e,o,400,"Invalid Upgrade header");return}if(u===void 0||!Tc.test(u)){et(this,e,o,400,"Missing or invalid Sec-WebSocket-Key header");return}if(p!==13&&p!==8){et(this,e,o,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(e)){Ot(o,400);return}let m=e.headers["sec-websocket-protocol"],b=new Set;if(m!==void 0)try{b=Ac.parse(m)}catch{et(this,e,o,400,"Invalid Sec-WebSocket-Protocol header");return}let w=e.headers["sec-websocket-extensions"],y={};if(this.options.perMessageDeflate&&w!==void 0){let E=new Qe({...this.options.perMessageDeflate,isServer:!0,maxPayload:this.options.maxPayload});try{let T=ro.parse(w);T[Qe.extensionName]&&(E.accept(T[Qe.extensionName]),y[Qe.extensionName]=E)}catch{et(this,e,o,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let E={origin:e.headers[`${p===8?"sec-websocket-origin":"origin"}`],secure:!!(e.socket.authorized||e.socket.encrypted),req:e};if(this.options.verifyClient.length===2){this.options.verifyClient(E,(T,k,N,G)=>{if(!T)return Ot(o,k||401,N,G);this.completeUpgrade(y,u,b,e,o,a,c)});return}if(!this.options.verifyClient(E))return Ot(o,401)}this.completeUpgrade(y,u,b,e,o,a,c)}completeUpgrade(e,o,a,c,u,l,p){if(!u.readable||!u.writable)return u.destroy();if(u[kc])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>so)return Ot(u,503);let b=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${Ec("sha1").update(o+Pc).digest("base64")}`],w=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&&(b.push(`Sec-WebSocket-Protocol: ${y}`),w._protocol=y)}if(e[Qe.extensionName]){let y=e[Qe.extensionName].params,E=ro.format({[Qe.extensionName]:[y]});b.push(`Sec-WebSocket-Extensions: ${E}`),w._extensions=e}this.emit("headers",b,c),u.write(b.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
- `)),u.removeListener("error",oo),w.setSocket(u,l,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(w),w.on("close",()=>{this.clients.delete(w),this._shouldEmitClose&&!this.clients.size&&process.nextTick(Mt,this)})),p(w,c)}};xo.exports=Ir;function Ic(r,e){for(let o of Object.keys(e))r.on(o,e[o]);return function(){for(let a of Object.keys(e))r.removeListener(a,e[a])}}function Mt(r){r._state=ao,r.emit("close")}function oo(){this.destroy()}function Ot(r,e,o,a){o=o||Rn.STATUS_CODES[e],a={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(o),...a},r.once("finish",r.destroy),r.end(`HTTP/1.1 ${e} ${Rn.STATUS_CODES[e]}\r
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
14
  `+Object.keys(a).map(c=>`${c}: ${a[c]}`).join(`\r
15
15
  `)+`\r
16
16
  \r
17
- `+o)}function et(r,e,o,a,c,u){if(r.listenerCount("wsClientError")){let l=new Error(c);Error.captureStackTrace(l,et),r.emit("wsClientError",l,o,e)}else Ot(o,a,c,u)}});import{spawn as tu}from"node:child_process";import{existsSync as nu,openSync as ru}from"node:fs";import{mkdir as su}from"node:fs/promises";import{dirname as iu}from"node:path";import{fileURLToPath as ou}from"node:url";function Mr(r=W()){return nu(r.libEntry)?r.libEntry:ou(new URL("../index.ts",import.meta.url))}async function ko(r={}){let e=r.paths??W(),o=r.entryOverride??Mr(e);await su(iu(e.logFile),{recursive:!0});let a=ru(e.logFile,"a"),u=o.endsWith(".ts")?["--import","tsx/esm",o,"--daemon"]:[o,"--daemon"],l=tu(process.execPath,u,{detached:!0,stdio:["ignore",a,a],env:{...process.env,COZE_BRIDGE_DAEMON:"1"}});if(l.unref(),typeof l.pid!="number")throw new Error("failed to spawn daemon (no pid)");return au.info("daemon spawned",{pid:l.pid,entry:o}),{pid:l.pid,entry:o}}var au,Or=ke(()=>{"use strict";F();ue();au=M("spawn-daemon")});import{spawn as gu}from"node:child_process";import{mkdir as pu,unlink as mu,writeFile as _u}from"node:fs/promises";import{dirname as wu,join as bu}from"node:path";function Kn(r){return r.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function Mo(r,e){return new Promise((o,a)=>{let c=gu(r,e,{stdio:["ignore","pipe","pipe"]}),u="";c.stderr?.on("data",l=>{u+=l.toString("utf8")}),c.on("error",a),c.on("close",l=>{l===0?o():a(new Error(`${r} ${e.join(" ")} exited ${l}: ${u.trim()}`))})})}var Fn,qr,Ur,Oo=ke(()=>{"use strict";F();Fn=M("supervisor.launchd"),qr="ai.coze.bridge",Ur={platform:"darwin",renderConfig(r){return`<?xml version="1.0" encoding="UTF-8"?>
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,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}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>${qr}</string>
22
+ <string>${zr}</string>
23
23
  <key>ProgramArguments</key>
24
24
  <array>
25
- <string>${Kn(r.nodeBin)}</string>
26
- <string>${Kn(r.entry)}</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 I0=Object.create;var rr=Object.defineProperty;var N0=Object.getOwnPropertyDe
33
33
  <key>ThrottleInterval</key>
34
34
  <integer>10</integer>
35
35
  <key>StandardOutPath</key>
36
- <string>${Kn(r.logFile)}</string>
36
+ <string>${qn(r.logFile)}</string>
37
37
  <key>StandardErrorPath</key>
38
- <string>${Kn(r.logFile)}</string>
38
+ <string>${qn(r.logFile)}</string>
39
39
  </dict>
40
40
  </plist>
41
- `},configPath(r){return bu(r.homeDir,"Library","LaunchAgents",`${qr}.plist`)},async install(r){let e=this.configPath(r);await pu(wu(e),{recursive:!0}),await _u(e,this.renderConfig(r),"utf8"),Fn.info("plist written",{plistPath:e}),await Mo("launchctl",["load","-w",e]),Fn.info("launchd job loaded",{label:qr})},async uninstall(r){let e=this.configPath(r);await Mo("launchctl",["unload","-w",e]).catch(o=>Fn.warn("launchctl unload failed (ignored)",{err:String(o)})),await mu(e).catch(o=>{if(o.code!=="ENOENT")throw o}),Fn.info("launchd job removed",{plistPath:e})}}});import{spawn as yu}from"node:child_process";import{mkdir as vu,unlink as Su,writeFile as Cu}from"node:fs/promises";import{dirname as Eu,join as Au}from"node:path";function jn(r,e){return new Promise((o,a)=>{let c=yu(r,e,{stdio:["ignore","pipe","pipe"]}),u="";c.stderr?.on("data",l=>{u+=l.toString("utf8")}),c.on("error",a),c.on("close",l=>{l===0?o():a(new Error(`${r} ${e.join(" ")} exited ${l}: ${u.trim()}`))})})}var Hn,Wn,Fr,Bo=ke(()=>{"use strict";F();Hn=M("supervisor.systemd"),Wn="coze-bridge.service",Fr={platform:"linux",renderConfig(r){return`[Unit]
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 Au(r.homeDir,".config","systemd","user",Wn)},async install(r){let e=this.configPath(r);await vu(Eu(e),{recursive:!0}),await Cu(e,this.renderConfig(r),"utf8"),Hn.info("systemd unit written",{unitPath:e}),await jn("systemctl",["--user","daemon-reload"]),await jn("systemctl",["--user","enable","--now",Wn]),Hn.info("systemd unit enabled",{unitName:Wn})},async uninstall(r){let e=this.configPath(r);await jn("systemctl",["--user","disable","--now",Wn]).catch(o=>Hn.warn("systemctl disable failed (ignored)",{err:String(o)})),await Su(e).catch(o=>{if(o.code!=="ENOENT")throw o}),await jn("systemctl",["--user","daemon-reload"]).catch(()=>{}),Hn.info("systemd unit removed",{unitPath:e})}}});import{spawn as Du}from"node:child_process";import{join as Lu}from"node:path";function zo(r,e){return new Promise((o,a)=>{let c=Du(r,e,{stdio:["ignore","pipe","pipe"],shell:!1}),u="";c.stderr?.on("data",l=>{u+=l.toString("utf8")}),c.on("error",a),c.on("close",l=>{l===0?o():a(new Error(`${r} ${e.join(" ")} exited ${l}: ${u.trim()}`))})})}var Kr,Gn,Hr,qo=ke(()=>{"use strict";F();Kr=M("supervisor.taskscheduler"),Gn="CozeBridge",Hr={platform:"win32",renderConfig(r){return`<?xml version="1.0" encoding="UTF-16"?>
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 Lu(r.homeDir,".coze","bridge","task.xml")},async install(r){let e=`"${r.nodeBin}" "${r.entry}" --daemon`;await zo("schtasks",["/Create","/SC","ONLOGON","/TN",Gn,"/TR",e,"/RU",r.userName,"/F"]),Kr.info("task scheduler entry created",{task:Gn})},async uninstall(r){await zo("schtasks",["/Delete","/TN",Gn,"/F"]).catch(e=>Kr.warn("schtasks /Delete failed (ignored)",{err:String(e)})),Kr.info("task scheduler entry removed",{task:Gn})}}});var Wr={};ms(Wr,{buildContext:()=>Iu,getSupervisor:()=>Tu,launchdSupervisor:()=>Ur,systemdSupervisor:()=>Fr,taskSchedulerSupervisor:()=>Hr});import{homedir as Pu,userInfo as ku}from"node:os";function Tu(r=process.platform){switch(r){case"darwin":return Ur;case"linux":return Fr;case"win32":return Hr;default:throw new Error(`unsupported platform for OS supervisor: ${r}`)}}function Iu(){let r=W();return{nodeBin:process.execPath,entry:Mr(r),logFile:r.logFile,homeDir:Pu(),userName:ku().username}}var jr=ke(()=>{"use strict";ue();Or();Oo();Bo();qo()});at();F();import{readdir as ea}from"node:fs/promises";import{mkdir as V0,writeFile as Y0}from"node:fs/promises";import{join as Z0}from"node:path";var $0={"claude-code":"CLAUDE.md",codex:"AGENTS.md",openclaw:"SOUL.md"};async function Je(r,e,o,a){await V0(r,{recursive:!0});let c=$0[e],u=Z0(r,c),l=Q0(e,o,a);return await Y0(u,l,"utf8"),u}function Q0(r,e,o){let a=`# Coze Agent: ${e}
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
- `,c=o?.trim()?o.endsWith(`
84
- `)?o:`${o}
83
+ `,c=i?.trim()?i.endsWith(`
84
+ `)?i:`${i}
85
85
  `:`_No instructions provided._
86
86
  `;return`${a}---
87
87
 
88
- ${c}`}var ve=M("agent-detail-sync"),Xt=class{constructor(e){this.opts=e}opts;async syncAll(e){let o=this.opts.paths.agentsRoot,a;try{a=await ea(o)}catch(c){ve.info("agents dir not found, skip detail sync",{root:o,err:String(c)});return}ve.info("starting detail sync",{reason:e,count:a.length});for(let c of a)try{await this.syncOne(c)}catch(u){ve.warn("detail sync failed for agent, skipping",{agentId:c,err:String(u)})}ve.info("detail sync done",{reason:e})}async syncOne(e){let o=await xe(e,this.opts.paths);if(!o){ve.info("detail sync: agent config missing, skip",{agentId:e});return}let a;try{a=await this.opts.sendDetail({_meta:{cozeAgentId:e}})}catch(l){ve.warn("detail RPC failed, using local data",{agentId:e,err:String(l)});return}if(a.agentId&&a.agentId!==e){ve.warn("detail response agentId mismatch, ignoring",{agentId:e,responseAgentId:a.agentId});return}let c=!1,u=!1;if(a.agentName&&a.agentName!==o.agentName&&(o.agentName=a.agentName,c=!0),a.description!==void 0&&a.description!==o.description&&(o.description=a.description,c=!0),a.cozeIdentity&&a.cozeIdentity!==o.cozeIdentity&&(o.cozeIdentity=a.cozeIdentity,c=!0,u=!0),a.deployType&&ve.info("detail.deployType",{agentId:e,deployType:a.deployType}),!c){ve.debug("detail sync: no diff",{agentId:e});return}await he(o,this.opts.paths),ve.info("detail sync: config updated",{agentId:e,identityChanged:u,agentName:o.agentName}),u&&(await Je(o.workspace,o.framework,e,o.cozeIdentity),await this.opts.handlers.reloadAgentSessionsPublic(e,"detail-sync"))}};at();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 Ne,normalize as oa,relative as Rs,resolve as aa,sep as Ms}from"node:path";var Ss="https://llm-gateway.coze.cn",Vt="auto";function ar(r){return{model:r.model??Vt,...r.modelToken?{modelToken:r.modelToken}:{}}}function Cs(r){return!r||r===Vt}function Es(r){let e={};return r.modelToken&&(e.ANTHROPIC_BASE_URL=Ss,e.ANTHROPIC_AUTH_TOKEN=r.modelToken),Cs(r.model)||(e.ANTHROPIC_MODEL=r.model),e}function As(r){let e=[];return Cs(r.model)||e.push("-c",`model="${r.model}"`),r.modelToken&&(e.push("-c",'model_provider="openai"'),e.push("-c",`model_provider_overrides.openai.base_url="${Ss}/v1"`)),e}function Ds(r){return r.modelToken?{OPENAI_API_KEY:r.modelToken}:{}}function Ls(r){return r?.cozeDeployType==="cloud"?"cloud":"local"}function Ps(r){let{_meta:e,...o}=r;return{stripped:o,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,o,a){super(o),this.name="BridgeError",this.code=e,this.retriable=a?.retriable??!1,a?.cause!==void 0&&(this.cause=a.cause)}};F();ue();function Xe(r,e){if(Ls(r)!=="cloud")throw new A("OPERATION_NOT_ALLOWED_FOR_LOCAL",`${e} is not allowed for local agent`)}var $=M("agent-handlers"),ks=5*1024*1024,xa=1,ca=6,ua=new Set(["node_modules",".git",".coze","dist","build",".next"]),fa=3e4,Zt=class{constructor(e){this.opts=e}opts;async listSkills(e){Xe(e._meta,"_agent/listSkills");let o=xt(e._meta),a=await this.loadAgentCfg(o),c=a?.workspace??Ie(o).workspace,u=a?.skills??[],l=[];for(let p of u){let m=Ne(c,p.relPath,"SKILL.md");await Yt(m).then(w=>w.isFile()).catch(()=>!1)&&l.push({skillId:p.skillId,skillName:p.skillName,downloadUrl:p.downloadUrl??"",...p.description?{description:p.description}:{},...p.version?{version:p.version}:{}})}return{skills:l}}async addSkills(e){Xe(e._meta,"_agent/addSkills");let o=xt(e._meta),a=await this.requireAgentCfg(o),c=e.skills??[],u=[...a.skills??[]],l=new Map(u.map((m,b)=>[m.skillId,b])),p=[];for(let m of c){if(!m.skillName)throw new A("IPC_BAD_REQUEST","skill missing skillName");let b=da(m.skillName),w=la(a.framework),y=Ne(w,b),E=Ne(a.workspace,y);await na(E,{recursive:!0});let T=await ga(m.downloadUrl);ma(T)?await _a(T,E):await ia(Ne(E,"SKILL.md"),T.toString("utf8"),"utf8");let k={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}:{}},N=l.get(m.skillId);N!==void 0?u[N]=k:(l.set(m.skillId,u.length),u.push(k)),p.push(m),$.info("skill installed",{agentId:o,skillId:m.skillId,skillName:m.skillName,relPath:y})}return await Jt(o,u),await this.reloadAgentSessions(o,"skills-added"),{installedSkills:p}}async removeSkills(e){Xe(e._meta,"_agent/removeSkills");let o=xt(e._meta),a=await this.requireAgentCfg(o),c=new Set(e.skillIds??[]),u=a.skills??[],l=[];for(let p of u){if(!c.has(p.skillId)){l.push(p);continue}let m=Ne(a.workspace,p.relPath);await sa(m,{recursive:!0,force:!0}),$.info("skill removed",{agentId:o,skillId:p.skillId,relPath:p.relPath})}return await Jt(o,l),await this.reloadAgentSessions(o,"skills-removed"),{ok:!0}}reloadAgentSessionsPublic(e,o){return this.reloadAgentSessions(e,o)}async reloadAgentSessions(e,o){let a=this.opts.agents.get(e);if(a&&a.framework!=="codex")for(let[c,u]of a.sessions)try{await a.downstream.sessionLoad({sessionId:u,cwd:a.workspace}),$.info("session reloaded",{reason:o,agentId:e,framework:a.framework,cloudId:c,acpId:u})}catch(l){$.warn("session reload failed",{reason:o,agentId:e,framework:a.framework,cloudId:c,acpId:u,err:String(l)})}}async updateAgent(e){if(!e.cozeIdentity?.trim())return $.info("_agent/update: empty cozeIdentity, noop",{agentId:e.agentId}),{ok:!0};let o=e.agentId,a=await xe(o);if(!a)throw new A("AGENT_NOT_FOUND",`agent not found: ${o}`);return a.cozeIdentity===e.cozeIdentity?($.info("_agent/update: cozeIdentity unchanged, noop",{agentId:o}),{ok:!0}):(a.cozeIdentity=e.cozeIdentity,await he(a),await Je(a.workspace,a.framework,o,e.cozeIdentity),$.info("_agent/update: cozeIdentity rewritten",{agentId:o,framework:a.framework}),await this.reloadAgentSessions(o,"identity-changed"),{ok:!0})}async disconnectAgent(e){let o=e.agentId;if(!o)throw new A("IPC_BAD_REQUEST","_agent/disconnect: missing agentId");let a=await xe(o);return a?(a.disconnectedAt=Date.now(),a.disconnectReason=e.reason??"",await he(a),$.info("agent disconnected",{agentId:o,reason:e.reason??"",force:e.force??!1}),this.opts.disposeAndMarkDisconnected&&await this.opts.disposeAndMarkDisconnected(o,e.reason??"disconnect"),{ok:!0}):($.warn("_agent/disconnect: agent not found, ignoring",{agentId:o}),{ok:!0})}async switchModel(e){if(Xe(e._meta,"_agent/switchModel"),!e.agentId)throw new A("IPC_BAD_REQUEST","_agent/switchModel: missing agentId");let o=e.model&&e.model.trim()?e.model:Vt,a=e.modelToken?.trim()||void 0,c=await xe(e.agentId);if(!c)throw new A("AGENT_NOT_FOUND",`agent not found: ${e.agentId}`);c.model=o,a!==void 0?c.modelToken=a:delete c.modelToken,await he(c),$.info("_agent/switchModel: model/modelToken persisted",{agentId:e.agentId,model:o,hasToken:!!a,reason:e.reason??"",force:e.force??!1});let u=this.opts.agents.get(e.agentId);if(!u)return $.info("_agent/switchModel: agent not running, config persisted only",{agentId:e.agentId}),{ok:!0};if(u.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");u.status="switching";let l=u.msgQueue.enqueue(async()=>{}),p=setTimeout(()=>{$.warn("_agent/switchModel: 30s idle timeout, forcing downstream stop",{agentId:e.agentId}),u.downstream.stop("switchModel idle timeout").catch(m=>$.warn("force stop failed (ignored)",{agentId:e.agentId,err:String(m)}))},fa);try{return await l.catch(m=>$.warn("_agent/switchModel: msgQueue idle wait rejected (continuing)",{agentId:e.agentId,err:String(m)})),clearTimeout(p),await this.opts.executeModelSwitch(e.agentId),{ok:!0}}catch(m){clearTimeout(p),$.error("_agent/switchModel: failed, marking disconnected",{agentId:e.agentId,err:String(m)});let b=await xe(e.agentId).catch(()=>null);throw b&&(b.disconnectedAt=Date.now(),b.disconnectReason=`model switch failed: ${m instanceof Error?m.message:String(m)}`,await he(b).catch(w=>$.warn("write disconnect marker failed (ignored)",{err:String(w)}))),this.opts.disposeAndMarkDisconnected?await this.opts.disposeAndMarkDisconnected(e.agentId,`model switch failed: ${m instanceof Error?m.message:String(m)}`).catch(w=>$.warn("disposeAndMarkDisconnected failed (ignored)",{err:String(w)})):u.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(e){Xe(e._meta,"_agent/getFileTree");let o=e._meta,a=xt(o),c=this.resolveWorkspace(a),u=e.filePath??"",l=this.safeJoin(c,u),p=await Yt(l).catch(()=>null);if(!p)throw new A("IPC_BAD_REQUEST",`path not found: ${u}`);let m=wa(e.depth);return p.isDirectory()?{tree:await Os(c,l,u,m)}:{tree:[{name:ba(u),path:Bs(u||"."),isDir:!1,size:p.size,modifiedAt:Math.floor(p.mtimeMs)}]}}async getFileContent(e){Xe(e._meta,"_agent/getFileContent");let o=xt(e._meta),a=this.resolveWorkspace(o);if(!e.filePath)throw new A("IPC_BAD_REQUEST","filePath required");let c=this.safeJoin(a,e.filePath),u=await Yt(c).catch(()=>null);if(!u||!u.isFile())throw new A("IPC_BAD_REQUEST",`not a file: ${e.filePath}`);if(u.size>ks)throw new A("IPC_BAD_REQUEST",`file too large: ${u.size} bytes (max ${ks})`);let l=await Ns(c);return l.includes(0)?{content:l.toString("base64"),encoding:"base64",size:u.size}:{content:l.toString("utf8"),encoding:"utf-8",size:u.size}}resolveWorkspace(e){let o=this.opts.agents.get(e);return o?o.workspace:Ie(e).workspace}safeJoin(e,o){let a=aa(e,o||"."),c=Rs(e,a);if(c.startsWith("..")||c===".."||c.startsWith(`..${Ms}`))throw new A("IPC_BAD_REQUEST",`path escapes workspace: ${o}`);return a}loadAgentCfg(e){return xe(e)}async requireAgentCfg(e){let o=await this.loadAgentCfg(e);if(!o)throw new A("AGENT_NOT_FOUND",`no config for agent: ${e}`);return o}};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"?Ne(".claude","skills"):Ne(".agents","skills")}var ha=3e4,Ts=50*1024*1024,Is=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,o=await Ns(e);if(o.length>Ts)throw new A("IPC_BAD_REQUEST",`skill too large: ${o.length} bytes`);return o}if(r.startsWith("http://")||r.startsWith("https://")){let e=new AbortController,o=setTimeout(()=>e.abort(),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 c=await a.arrayBuffer();if(c.byteLength>Ts)throw new A("IPC_BAD_REQUEST",`skill too large: ${c.byteLength} bytes`);return Buffer.from(c)}finally{clearTimeout(o)}}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 o=!!e[2],a=e[3]??"";return o?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,e){await new Promise((o,a)=>{let c=ta("tar",["-xzf","-","-C",e,"--strip-components=1"],{stdio:["pipe","pipe","pipe"]}),u="";c.stderr?.on("data",p=>{u+=String(p)});let l=setTimeout(()=>{c.kill("SIGKILL"),a(new A("IPC_BAD_REQUEST",`tar extract timeout (${Is}ms)`))},Is);c.on("error",p=>{clearTimeout(l),a(new A("IPC_BAD_REQUEST",`tar spawn failed: ${p.message}`,{cause:p}))}),c.on("exit",p=>{clearTimeout(l),p===0?o():a(new A("IPC_BAD_REQUEST",`tar exit ${p}${u?`: ${u.trim().slice(0,200)}`:""}`))}),c.stdin?.end(r)})}async function Os(r,e,o,a){if(a<=0)return[];let c;try{c=await ra(e,{withFileTypes:!0})}catch{return[]}let u=[];for(let l of c){if(ua.has(l.name))continue;let p=Ne(e,l.name),m=oa(Ne(o,l.name)),b=null;try{b=await Yt(p)}catch{continue}let w={name:l.name,path:Bs(Rs(r,p)),isDir:b.isDirectory(),size:b.size,modifiedAt:Math.floor(b.mtimeMs)};b.isDirectory()&&a>1&&(w.children=await Os(r,p,m,a-1)),u.push(w)}return u.sort((l,p)=>l.isDir!==p.isDir?l.isDir?-1:1:l.name.localeCompare(p.name)),u}function wa(r){return!r||r<=0?xa:Math.min(r,ca)}function ba(r){if(!r||r==="."||r==="/")return".";let e=r.split(/[/\\]/);return e[e.length-1]||"."}function Bs(r){return r.split(Ms).join("/")}F();var Et=M("agent-health-reporter"),ya=3e4,$t=class{constructor(e){this.opts=e;this.intervalMs=e.intervalMs??ya}opts;timer=null;inFlight=!1;intervalMs;start(){this.timer||(this.timer=setInterval(()=>{this.tick()},this.intervalMs),this.timer.unref?.(),Et.info("heartbeat started",{intervalMs:this.intervalMs}),this.tick())}stop(){this.timer&&(clearInterval(this.timer),this.timer=null,Et.info("heartbeat stopped"))}async tick(){if(this.inFlight){Et.debug("previous tick still in-flight, skip");return}let e=this.opts.getDeviceId();if(!e){Et.debug("deviceId not available, skip tick (\u5C1A\u672A pair)");return}this.inFlight=!0;try{let o=[...this.opts.core.agents.values()];for(let a of o){let c=va(a);if(!c)continue;let u={status:c,_meta:{cozeAgentId:a.agentId,cozeDeviceId:e}};try{await this.opts.core.sendRequest("_agent/health",u)}catch(l){Et.warn("heartbeat send failed",{agentId:a.agentId,status:c,err:String(l)})}}}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}at();import{mkdir as xr,rm as Ia}from"node:fs/promises";import{spawn as Da}from"node:child_process";function ct(r,e,o){return o===void 0?{jsonrpc:"2.0",id:r,method:e}:{jsonrpc:"2.0",id:r,method:e,params:o}}function zs(r,e){return e===void 0?{jsonrpc:"2.0",method:r}:{jsonrpc:"2.0",method:r,params:e}}function ut(r,e){return{jsonrpc:"2.0",id:r,result:e}}function Ve(r,e){return{jsonrpc:"2.0",id:r,error:e}}var Qt=class extends Error{code;data;constructor(e){super(`JSON-RPC error code=${e.code} ${e.message}`),this.name="RemoteRpcError",this.code=e.code,e.data!==void 0&&(this.data=e.data)}},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 en(r){return"method"in r&&"id"in r&&r.id!==void 0}function qs(r){return"method"in r&&!("id"in r)}function tn(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 nn(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 Us(r){let e=r.data,o=e?.bridgeCode??"AGENT_PROTOCOL_ERROR";return new A(o,r.message,{retriable:e?.retriable??!1,cause:r.data})}function Fs(r){return`${JSON.stringify(r)}
89
- `}var rn=class{buffer="";onError;constructor(e={}){this.onError=e.onError}push(e){this.buffer+=typeof e=="string"?e:e.toString("utf8");let o=this.buffer.split(`
90
- `);this.buffer=o.pop()??"";let a=[];for(let c of o){let u=c.replace(/\r$/,"").trim();if(u)try{a.push(JSON.parse(u))}catch(l){this.onError?.({line:u,error:l})}}return a}flush(){if(!this.buffer)return[];let e=this.buffer.replace(/\r$/,"").trim();if(this.buffer="",!e)return[];try{return[JSON.parse(e)]}catch(o){return this.onError?.({line:e,error:o}),[]}}};var 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"},Bf=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:[]},ft=class{seq=0;next(e,o){this.seq+=1;let a=Hs[e]??Ea(e),c=Ca[a]??[],u=[a,String(this.seq)];if(c.length>0){let l=c.map(m=>Ks(o?.[m]??"")),p=Aa(l).join(":");p&&u.push(p)}else o&&Object.values(o).some(l=>l)&&u.push(Object.values(o).filter(Boolean).map(l=>Ks(String(l))).join(":"));return u.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)}F();var La=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=M(`downstream.${this.constructor.name}`),this.decoder=new rn({onError:o=>this.log.warn("decode line failed",{line:o.line})})}opts;child;decoder;pending=new Map;idAllocator=new ft;updateHandlers=[];agentRequestHandlers=[];exitHandlers=[];log;stopped=!1;sanitizeEnv(e){return e}async start(){if(this.child)throw new A("BRIDGE_INTERNAL","Downstream already started");let e=process.platform!=="win32",o=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=o,o.stdout?.setEncoding("utf8"),o.stdout?.on("data",a=>{for(let c of this.decoder.push(a))this.dispatch(c)}),o.stderr?.setEncoding("utf8"),o.stderr?.on("data",a=>{this.log.debug("stderr",{text:a.trimEnd()})}),o.on("exit",(a,c)=>{this.stopped=!0,this.failAllPending(new A("AGENT_PROTOCOL_ERROR",`agent exited (${a}/${c})`));for(let u of this.exitHandlers)u(a,c)}),o.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:o.pid,cwd:this.opts.cwd})}async stop(e){if(!this.child||this.stopped)return;this.stopped=!0,this.log.info("downstream stopping",{reason:e});let o=this.child,a=new Promise(u=>o.once("exit",()=>u()));Ws(o.pid,"SIGTERM");let c=setTimeout(()=>{o.killed||Ws(o.pid,"SIGKILL")},5e3);try{await a}finally{clearTimeout(c)}}pid(){return this.child?.pid}isAlive(){return!!this.child&&!this.stopped}initialize(e){return this.call("initialize",e)}sessionNew(e){return this.call("session/new",{mcpServers:[],...e})}sessionLoad(e){return this.call("session/load",{mcpServers:[],...e})}sessionPrompt(e){return this.call("session/prompt",e,0)}async sessionCancel(e){if(!this.child||this.stopped)return;let o=this.idAllocator.next("session/cancel");this.writeFrame(ct(o,"session/cancel",e))}onUpdate(e){this.updateHandlers.push(e)}onAgentRequest(e){this.agentRequestHandlers.push(e)}respondAgentRequest(e,o){if(!(!this.child||this.stopped))try{this.writeFrame(ut(e,o))}catch(a){this.log.warn("respondAgentRequest write failed",{id:e,err:String(a)})}}respondAgentRequestError(e,o){if(!(!this.child||this.stopped))try{this.writeFrame(Ve(e,o))}catch(a){this.log.warn("respondAgentRequestError write failed",{id:e,err:String(a)})}}onExit(e){this.exitHandlers.push(e)}call(e,o,a=La){if(!this.child||this.stopped)return Promise.reject(new A("AGENT_PROTOCOL_ERROR","downstream not started"));let c=this.idAllocator.next(e),u=ct(c,e,o),l=a>0&&Number.isFinite(a);return new Promise((p,m)=>{let b=l?setTimeout(()=>{this.pending.delete(c),m(new A("AGENT_TIMEOUT",`${e} timed out after ${a}ms`))},a):null;this.pending.set(c,{resolve:p,reject:m,timer:b,method:e});try{this.writeFrame(u)}catch(w){b&&clearTimeout(b),this.pending.delete(c),m(w)}})}writeFrame(e){if(!this.child?.stdin||this.child.stdin.destroyed)throw new A("AGENT_PROTOCOL_ERROR","downstream stdin not writable");this.child.stdin.write(Fs(e))}dispatch(e){if(tn(e)){let o=e.id!==null?this.pending.get(e.id):void 0;if(!o){this.log.warn("orphan response",{id:e.id});return}this.pending.delete(e.id),o.timer&&clearTimeout(o.timer),e.error?o.reject(Us(e.error)):o.resolve(e.result);return}if(qs(e)){if(e.method==="session/update")for(let o of this.updateHandlers)Promise.resolve(o(e.params)).catch(a=>this.log.warn("update handler failed",{err:String(a)}));else this.log.debug("unknown notification",{method:e.method});return}if(en(e)){let o=e;this.handleAgentRequest(o).catch(a=>this.log.error("agent request handler failed",{method:o.method,err:String(a)}))}}async handleAgentRequest(e){if(this.agentRequestHandlers.length===0){this.writeFrame(Ve(e.id,{code:-32601,message:`method not handled by Bridge: ${e.method}`}));return}for(let o of this.agentRequestHandlers)try{await o(e)}catch(a){this.log.error("agentRequestHandler threw",{method:e.method,err:String(a)});try{this.writeFrame(Ve(e.id,nn(a)))}catch{}}}failAllPending(e){for(let o of this.pending.values())o.timer&&clearTimeout(o.timer),o.reject(e);this.pending.clear()}};var Pa="@zed-industries/claude-code-acp@latest";function ka(r){let e={};for(let[o,a]of Object.entries(r))a!==void 0&&(o.startsWith("CLAUDE")||o==="AI_AGENT"||o==="BAGGAGE"||(e[o]=a));return e}var sn=class extends Ke{framework="claude-code";constructor(e){let o=e.command??"npx",a=e.args??["-y",Pa],c={command:o,args:a,cwd:e.cwd,...e.env?{env:e.env}:{}};super(c)}sanitizeEnv(e){return ka(e)}};var Ta="@zed-industries/codex-acp@latest",on=class extends Ke{framework="codex";constructor(e){let o=e.command??"npx",a=e.args??["-y",Ta],c=e.extraArgs?[...a,...e.extraArgs]:a,u={command:o,args:c,cwd:e.cwd,...e.env?{env:e.env}:{}};super(u)}};import{spawn as js}from"node:child_process";F();var an=class extends Ke{framework="openclaw";registerLog;profile;agentId;sessionName;registered=!1;constructor(e){let o=e.profile??"coze",a=e.sessionName??"default",c=["--profile",o,"acp","--session",`agent:${e.agentId}:${a}`],u={command:e.command,args:c,cwd:e.cwd,...e.env?{env:e.env}:{}};super(u),this.profile=o,this.agentId=e.agentId,this.sessionName=a,this.registerLog=M("downstream.openclaw.register")}async start(){await this.registerAgent().catch(e=>{this.registerLog.warn("openclaw agents add failed (will continue to acp anyway)",{agentId:this.agentId,err:String(e)})}),await super.start()}registerAgent(){return new Promise((e,o)=>{let a=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",u=>{c+=u.toString("utf8")}),a.on("error",o),a.on("close",u=>{u===0?(this.registered=!0,this.registerLog.info("agent registered",{agentId:this.agentId,profile:this.profile}),e()):o(new A("AGENT_SPAWN_FAILED",`openclaw agents add ${this.agentId} exited ${u}: ${c.trim()}`))})})}async cleanup(e){this.registered&&await new Promise(o=>{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",u=>{c+=u.toString("utf8")}),a.on("error",u=>{this.registerLog.warn("openclaw agents delete failed (best-effort)",{agentId:this.agentId,err:String(u)}),o()}),a.on("close",u=>{u===0?this.registerLog.info("agent unregistered",{agentId:this.agentId}):this.registerLog.warn("openclaw agents delete non-zero exit",{agentId:this.agentId,code:u,stderr:c.trim()}),this.registered=!1,o()})})}get acpSessionName(){return this.sessionName}};F();ue();var xn=class{slots=[];running=!1;closed=!1;disposed=!1;enqueue(e){return this.disposed?Promise.reject(new Error("AsyncQueue disposed")):this.closed?Promise.reject(new Error("AsyncQueue closed")):new Promise((o,a)=>{this.slots.push({task:e,resolve:o,reject:a}),this.drain()})}close(){this.closed=!0}dispose(e=new Error("AsyncQueue disposed")){for(this.disposed=!0,this.closed=!0;this.slots.length>0;)this.slots.shift()?.reject(e)}get size(){return this.slots.length}get isRunning(){return this.running}async drain(){if(!this.running){this.running=!0;try{for(;this.slots.length>0&&!this.disposed;){let e=this.slots.shift();if(!e)break;try{let o=await e.task();e.resolve(o)}catch(o){e.reject(o)}}}finally{this.running=!1}}}};var cn=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 xn}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 j=M("agent-manager"),Na=(r,e,o,a,c)=>{switch(r){case"claude-code":{let u=c?Es(c):void 0;return new sn({cwd:o,...u&&Object.keys(u).length>0?{env:u}:{}})}case"codex":{let u=c?As(c):[],l=c?Ds(c):void 0;return new on({cwd:o,...u.length>0?{extraArgs:u}:{},...l&&Object.keys(l).length>0?{env:l}:{}})}case"openclaw":return new an({command:e,cwd:o,agentId:a})}},Ra=[0,5e3,5e3],Ma=2e4,Gs={protocolVersion:1,clientCapabilities:{fs:{readTextFile:!0,writeTextFile:!0}}},un=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??Ra,this.createTimeoutMs=e.createTimeoutMs??Ma,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 o=this.registry.get(e.agentId);if(o){if(o.framework!==e.framework)throw new A("AGENT_BUSY",`agent ${e.agentId} exists with different framework (${o.framework})`);if(o.status==="error")j.warn("existing agent in error state, rebuilding",{agentId:e.agentId}),await o.dispose("rebuild after error").catch(m=>j.warn("dispose stale agent failed (ignored)",{err:String(m)})),this.registry.unregister(e.agentId);else return j.info("agent already exists,return current",{agentId:e.agentId}),{ok:!0,agentId:o.agentId,workspace:o.workspace,pid:o.downstream.pid()??0,framework:o.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 c=Ie(e.agentId,this.paths),u=e.workspace??c.workspace,l=new AbortController,p=setTimeout(()=>l.abort(new A("AGENT_TIMEOUT",`_agent/create timed out after ${this.createTimeoutMs}ms`)),this.createTimeoutMs);try{return await this.createAgentInner(e,c,u,a,l.signal)}finally{clearTimeout(p)}}async createAgentInner(e,o,a,c,u){let l=()=>{if(u.aborted)throw u.reason instanceof Error?u.reason:new A("AGENT_TIMEOUT","_agent/create aborted")},p,m,b=!1;try{await xr(o.root,{recursive:!0}),await xr(a,{recursive:!0}),await xr(o.logs,{recursive:!0}),l(),e.framework!=="openclaw"&&await Je(a,e.framework,e.agentId,e.cozeIdentity),l();let w=await xe(e.agentId,this.paths).catch(()=>null),y=ar({model:e.model??w?.model,modelToken:e.modelToken??w?.modelToken});if(p=this.factory(e.framework,c.path,a,e.agentId,y),await p.start(),l(),await p.initialize(Gs),l(),e.framework==="openclaw"&&await Je(a,"openclaw",e.agentId,e.cozeIdentity),m=new cn({agentId:e.agentId,framework:e.framework,workspace:a,downstream:p}),m.status="ok",w?.sessions){for(let[k,N]of Object.entries(w.sessions))m.sessions.set(k,N);Object.keys(w.sessions).length>0&&j.info("restored persisted sessions for agent",{agentId:e.agentId,count:Object.keys(w.sessions).length})}this.registry.register(m),b=!0;let E={agentId:e.agentId,framework:e.framework,workspace:a,cozeIdentity:e.cozeIdentity,createdAt:w?.createdAt??Date.now(),sessions:w?.sessions??{},model:y.model};y.modelToken&&(E.modelToken=y.modelToken),w?.skills&&(E.skills=w.skills),w?.agentName&&(E.agentName=w.agentName),w?.description&&(E.description=w.description),await he(E,this.paths);let T=p.pid()??0;return j.info("agent created",{agentId:e.agentId,framework:e.framework,pid:T}),this.installRestartHook(m),{ok:!0,agentId:e.agentId,workspace:a,pid:T,framework:e.framework}}catch(w){throw j.error("agent create failed,rolling back",{agentId:e.agentId,err:String(w)}),p?.cleanup&&await p.cleanup("rollback").catch(y=>j.warn("downstream cleanup failed (ignored)",{err:String(y)})),p&&await p.stop("rollback").catch(()=>{}),b&&m&&(await m.dispose("rollback").catch(()=>{}),this.registry.unregister(e.agentId)),await Ia(o.root,{recursive:!0,force:!0}).catch(y=>j.warn("rm agent dir failed (ignored)",{err:String(y)})),w instanceof A?w:new A("AGENT_SPAWN_FAILED",String(w),{cause:w})}}async reportHealth(e,o,a){if(!this.healthReporter){j.info("healthReporter not wired, skip _agent/health upstream",{agentId:e.agentId,status:o});return}try{await this.healthReporter({status:o,_meta:{cozeAgentId:e.agentId}}),j.info("_agent/health reported",{agentId:e.agentId,status:o,cause:a})}catch(c){j.warn("_agent/health upstream failed (ignored)",{agentId:e.agentId,status:o,err:String(c)})}}installRestartHook(e){let o=0,a=c=>{if(e.status==="stopped"||e.status==="disconnected"||e.status==="switching")return;if(o>=this.restartDelaysMs.length){j.error("agent restart exhausted",{agentId:e.agentId,attempts:o,...c}),e.status="error",this.reportHealth(e,"error",c);return}let u=this.restartDelaysMs[o]??5e3;o+=1,e.status="degraded",j.warn("agent restart scheduled",{agentId:e.agentId,attempt:o,delayMs:u,...c}),setTimeout(()=>{this.doRestart(e,o).then(l=>{l?(o=0,e.status="ok"):a(null)})},u)};e.downstream.onExit((c,u)=>a({code:c,signal:u}))}async spawnAndInitialize(e,o){let a=await xe(e.agentId,this.paths).catch(()=>null),c=a?ar(a):void 0,u=this.factory(e.framework,o,e.workspace,e.agentId,c);try{return await u.start(),await u.initialize(Gs),u}catch(l){throw await u.stop("spawnAndInitialize failed").catch(()=>{}),l}}rewireSession(e,o){e.swap(o),this.registry.attachHooks?.(e),this.installRestartHook(e)}async doRestart(e,o){let a=this.config.frameworksCache?.[e.framework];if(!a)return j.error("framework cache missing during restart",{agentId:e.agentId,framework:e.framework}),e.status="error",!1;j.info("agent restart attempt",{agentId:e.agentId,attempt:o});try{let c=await this.spawnAndInitialize(e,a.path);return this.rewireSession(e,c),j.info("agent restart succeeded",{agentId:e.agentId,attempt:o}),!0}catch(c){return j.warn("agent restart attempt failed",{agentId:e.agentId,attempt:o,err:String(c)}),!1}}async executeModelSwitch(e){let o=this.registry.get(e);if(!o)throw new A("AGENT_NOT_FOUND",`agent not found: ${e}`);let a=this.config.frameworksCache?.[o.framework];if(!a)throw new A("AGENT_SPAWN_FAILED",`framework ${o.framework} not detected; cannot respawn for switchModel`);j.info("executeModelSwitch: stopping old downstream",{agentId:e,framework:o.framework}),await o.downstream.stop("switchModel").catch(l=>{j.warn("stop old downstream failed (ignored, continuing)",{agentId:e,err:String(l)})});let c;try{c=await this.spawnAndInitialize(o,a.path)}catch(l){throw new A("MODEL_SWITCH_FAILED",`failed to spawn new downstream after switchModel: ${l instanceof Error?l.message:String(l)}`,{cause:l})}this.rewireSession(o,c);let u=[...o.sessions.entries()];for(let[l,p]of u)try{await c.sessionLoad({sessionId:p,cwd:o.workspace}),o.verifiedSessions.add(p)}catch(m){throw new A("MODEL_SWITCH_FAILED",`sessionLoad failed after switchModel for cloud session ${l} (acp=${p}): ${m instanceof Error?m.message:String(m)}`,{cause:m})}u.length>0&&j.info("executeModelSwitch: session/load reloaded",{agentId:e,count:u.length}),o.status="ok",j.info("executeModelSwitch: success",{agentId:e,framework:o.framework})}};F();import{spawn as Oa}from"node:child_process";import{constants as Js,access as Ba}from"node:fs/promises";import{delimiter as za,join as qa}from"node:path";var Ua=M("framework-detector"),Xs={"claude-code":"claude",codex:"codex",openclaw:"openclaw"},Fa=[".exe",".cmd",".bat",".ps1"],At=class{env;constructor(e={}){this.env={pathEnv:e.pathEnv??process.env.PATH??"",platform:e.platform??process.platform,spawn:e.spawn??Oa,access:e.access??Ba}}async detect(e){let o=Xs[e],a=await this.which(o);if(!a)return Ua.debug("framework binary not found",{framework:e,bin:o}),null;let c=await this.probeVersion(a);return{path:a,version:c}}async detectAll(){let e=await Promise.all(Object.keys(Xs).map(async a=>[a,await this.detect(a)])),o={};for(let[a,c]of e)c&&(o[a]=c);return o}async which(e){let o=this.env.pathEnv.split(za).filter(Boolean),a=this.env.platform==="win32"?["",...Fa]:[""];for(let c of o)for(let u of a){let l=qa(c,e+u);if(await this.isExecutable(l))return l}return null}async isExecutable(e){try{let o=this.env.platform==="win32"?Js.F_OK:Js.X_OK;return await this.env.access(e,o),!0}catch{return!1}}async probeVersion(e){return new Promise(o=>{let a="",c=!1,u,l=p=>{c||(c=!0,u&&clearTimeout(u),o(p.trim()||"unknown"))};try{let p=this.env.spawn(e,["--version"],{stdio:["ignore","pipe","pipe"]});u=setTimeout(()=>{p.kill("SIGKILL"),l("unknown")},5e3),p.stdout?.on("data",m=>{a+=m.toString("utf8")}),p.on("error",()=>l("unknown")),p.on("close",()=>{let m=Ha(a).split(/\r?\n/)[0]??"";l(m)})}catch{l("unknown")}})}},Ka=new RegExp("\x1B\\[[0-9;]*[A-Za-z]","g");function Ha(r){return r.replace(Ka,"")}ir();ue();function fn(r){return Wt(r??W().configFile)}function Dt(r,e){return jt(e??W().configFile,r)}at();F();var te=M("core"),Wa=5*6e4,ja=3e4,dn=class{upstream;agents=new Map;disconnectedAgents=new Set;extensions;paths;upstreamIds=new ft;pendingUpstream=new Map;pendingBridge=new Map;constructor(e){this.upstream=e.upstream,this.extensions=e.extensions??{},this.paths=e.paths}registerExtension(e,o){this.extensions[e]=o}async start(){this.upstream.onFrame(e=>this.handleFrame(e)),await this.upstream.start(),te.info("Core started",{extensions:Object.keys(this.extensions)})}async stop(e){te.info("Core stopping",{reason:e}),await Promise.all([...this.agents.values()].map(o=>o.dispose(e))),this.agents.clear(),await this.upstream.stop(e)}get(e){return this.agents.get(e)}register(e){this.agents.set(e.agentId,e),this.attachDownstreamHooks(e),te.info("agent registered",{agentId:e.agentId,framework:e.framework})}unregister(e){this.agents.delete(e)}reviveIfDisconnected(e){this.disconnectedAgents.delete(e)&&te.info("agent revived from disconnect",{agentId:e})}attachDownstreamHooks(e){e.downstream.onUpdate(o=>{this.forwardUpdate(e,o)}),e.downstream.onAgentRequest(o=>{this.handleAgentRequest(e,o)}),e.downstream.onExit((o,a)=>{te.warn("agent downstream exited",{agentId:e.agentId,code:o,signal:a})})}attachHooks(e){this.attachDownstreamHooks(e)}async handleFrame(e){if(tn(e)){this.handleUpstreamResponse(e);return}if(en(e))try{if(e.method.startsWith("_agent/")){let o=this.extensions[e.method];if(!o){await this.sendError(e.id,K.METHOD_NOT_FOUND,`extension not registered: ${e.method}`);return}let a=await o(e,this);await this.upstream.send(ut(e.id,a));return}if(e.method.startsWith("session/")){let o=await this.routeSessionMethod(e);await this.upstream.send(ut(e.id,o));return}if(e.method==="initialize"){await this.upstream.send(ut(e.id,{protocolVersion:1,agentCapabilities:{loadSession:!0}}));return}await this.sendError(e.id,K.METHOD_NOT_FOUND,`method not implemented: ${e.method}`)}catch(o){te.error("handleFrame failed",{method:e.method,err:String(o)}),await this.upstream.send(Ve(e.id,nn(o)))}}async routeSessionMethod(e){if(!e.params||typeof e.params!="object")throw new A("IPC_BAD_REQUEST",`${e.method} requires params`);let o=e.params,a=o._meta?.cozeAgentId;if(!a)throw new A("IPC_BAD_REQUEST",`${e.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 u=Date.now(),l=!1;try{let p=await c.msgQueue.enqueue(()=>this.dispatchSessionCall(c,e.method,o));return l=!0,p}finally{te.info("session call done",{agentId:c.agentId,method:e.method,durationMs:Date.now()-u,ok:l})}}async dispatchSessionCall(e,o,a){e.lastActiveAt=Date.now();let{stripped:c}=Ps(a);switch(o){case"session/new":{let u=c;return await e.downstream.sessionNew({...u,cwd:u.cwd||e.workspace})}case"session/load":{let u=c,l=u.sessionId,p=e.sessions.get(l);try{let m=p??l,b=await e.downstream.sessionLoad({...u,sessionId:m,cwd:u.cwd||e.workspace});return p||e.sessions.set(l,m),b}catch(m){te.warn("session/load failed,fallback to session/new",{agentId:e.agentId,cloudId:l,err:String(m)});let b=await e.downstream.sessionNew({cwd:u.cwd||e.workspace});return e.sessions.set(l,b.sessionId),{}}}case"session/prompt":{let u=c,l=u.sessionId,p=e.sessions.get(l),m=!1;if(p&&!e.verifiedSessions.has(p))try{await e.downstream.sessionLoad({sessionId:p,cwd:e.workspace}),e.verifiedSessions.add(p),te.info("session restored via session/load",{agentId:e.agentId,cloudId:l,acpId:p})}catch(y){te.warn("session/load failed,fallback to session/new",{agentId:e.agentId,cloudId:l,acpId:p,err:String(y)}),e.sessions.delete(l),p=void 0}p||(p=(await e.downstream.sessionNew({cwd:e.workspace})).sessionId,e.sessions.set(l,p),e.verifiedSessions.add(p),m=!0);let b=a._meta?.cozeTriggerMsgId;b?e.activeTriggers.set(p,b):e.activeTriggers.delete(p);let w=await e.downstream.sessionPrompt({...u,sessionId:p});return m&&this.persistSessionMapping(e),w}case"session/cancel":{let l=c.sessionId;if(!l)throw new A("IPC_BAD_REQUEST","session/cancel: missing sessionId");let p=e.sessions.get(l);return p&&await e.downstream.sessionCancel({sessionId:p}),{ok:!0}}default:throw new A("IPC_BAD_REQUEST",`session method not supported: ${o}`)}}forwardUpdate(e,o){let a=o.sessionId,c=this.reverseSessionId(e,a);if(!c){te.debug("drop update for unknown session",{agentId:e.agentId,acpId:a});return}let u={cozeAgentId:e.agentId},l=e.activeTriggers.get(a);l&&(u.cozeTriggerMsgId=l),this.upstream.send(zs("session/update",{...o,sessionId:c,_meta:u})).catch(p=>te.warn("forward update failed",{agentId:e.agentId,err:String(p)}))}handleAgentRequest(e,o){if(o.method==="session/request_permission"){this.forwardPermissionRequest(e,o);return}te.warn("unhandled agent request,returning method_not_found",{agentId:e.agentId,method:o.method}),e.downstream.respondAgentRequestError(o.id,{code:K.METHOD_NOT_FOUND,message:`method not handled by Bridge: ${o.method}`})}forwardPermissionRequest(e,o){let a=this.upstreamIds.next("session/request_permission"),c=o.params??{},l=c.sessionId,p=l?e.activeTriggers.get(l):void 0,m={cozeAgentId:e.agentId};p&&(m.cozeTriggerMsgId=p);let b=l?this.reverseSessionId(e,l):void 0,w={...c,...b?{sessionId:b}:{},_meta:m},y=setTimeout(()=>{let E=this.pendingUpstream.get(a);E&&(this.pendingUpstream.delete(a),te.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:o.id,session:e,method:o.method,timer:y}),this.upstream.send(ct(a,"session/request_permission",w)).catch(E=>{let T=this.pendingUpstream.get(a);T&&(clearTimeout(T.timer),this.pendingUpstream.delete(a)),te.error("forward permission request failed",{agentId:e.agentId,err:String(E)}),e.downstream.respondAgentRequestError(o.id,{code:K.INTERNAL_ERROR,message:`upstream send failed: ${String(E)}`})})}handleUpstreamResponse(e){if(e.id===null)return;let o=this.pendingUpstream.get(e.id);if(o){this.pendingUpstream.delete(e.id),clearTimeout(o.timer),e.error?o.session.downstream.respondAgentRequestError(o.agentRequestId,e.error):o.session.downstream.respondAgentRequest(o.agentRequestId,e.result);return}let a=this.pendingBridge.get(e.id);if(a){this.pendingBridge.delete(e.id),clearTimeout(a.timer),e.error?a.reject(new Qt(e.error)):a.resolve(e.result);return}te.debug("orphan upstream response (no pending)",{id:e.id})}sendRequest(e,o,a=ja){let c=this.upstreamIds.next(e);return new Promise((u,l)=>{let p=setTimeout(()=>{this.pendingBridge.delete(c),l(new A("AGENT_TIMEOUT",`${e} timed out after ${a}ms`))},a);this.pendingBridge.set(c,{method:e,resolve:u,reject:l,timer:p}),this.upstream.send(ct(c,e,o)).catch(m=>{let b=this.pendingBridge.get(c);b&&(clearTimeout(b.timer),this.pendingBridge.delete(c)),l(m)})})}async persistSessionMapping(e){if(this.paths)try{await or(e.agentId,e.sessions,this.paths)}catch(o){te.warn("persist session mapping failed",{agentId:e.agentId,err:String(o)})}}reverseSessionId(e,o){for(let[a,c]of e.sessions.entries())if(c===o)return a}sendError(e,o,a){return this.upstream.send(Ve(e,{code:o,message:a}))}};F();ue();import{randomBytes as Ga}from"node:crypto";import{chmod as Ja,mkdir as Xa,writeFile as Vs}from"node:fs/promises";import{createServer as Va}from"node:http";import{dirname as Ya}from"node:path";var Za=1e6,cr=M("ipc"),ln=class{server=null;port=0;token="";routes;paths;constructor(e){this.routes=new Map(e.routes.map(o=>[`${o.method} ${o.path}`,o])),this.paths=e.paths??W()}async start(){this.token=Ga(32).toString("hex");let e=Va((a,c)=>{this.dispatch(a,c)});this.server=e,await new Promise((a,c)=>{e.once("error",c),e.listen(0,"127.0.0.1",()=>a())});let o=e.address();if(!o||typeof o!="object")throw new Error("failed to obtain IPC port");return this.port=o.port,await this.persistAuthFiles(),cr.info("IPC listening",{port:this.port}),{port:this.port,token:this.token}}async stop(){let e=this.server;e&&(await new Promise((o,a)=>{e.close(c=>c?a(c):o())}),this.server=null)}async persistAuthFiles(){await Xa(Ya(this.paths.portFile),{recursive:!0}),await Vs(this.paths.portFile,String(this.port),"utf8"),await Vs(this.paths.tokenFile,this.token,"utf8");try{await Ja(this.paths.tokenFile,384)}catch(e){cr.warn("chmod token file failed (non-POSIX?)",{err:String(e)})}}async dispatch(e,o){if(e.headers.authorization!==`Bearer ${this.token}`){Lt(o,401,{error:"unauthorized"});return}let c=`${e.method} ${(e.url??"").split("?")[0]}`,u=this.routes.get(c);if(!u){Lt(o,404,{error:"not found"});return}let l=null;if(e.method==="POST")try{l=await $a(e)}catch(p){Lt(o,400,{error:"invalid json",detail:String(p)});return}try{let p=await u.handler(l,e);Lt(o,200,p??{ok:!0})}catch(p){cr.error("IPC handler failed",{key:c,err:String(p)}),Lt(o,500,{error:p instanceof Error?p.message:String(p)})}}};function Lt(r,e,o){r.statusCode=e,r.setHeader("content-type","application/json"),r.end(JSON.stringify(o))}async function $a(r){let e=[],o=0;for await(let c of r){let u=c;if(o+=u.length,o>Za)throw new Error("body too large");e.push(u)}let a=Buffer.concat(e).toString("utf8");return a?JSON.parse(a):null}var vo=Te(oi(),1);var Nc=Te(to(),1),Rc=Te(Pn(),1),Mc=Te(ht(),1),Oc=Te(vr(),1),Bc=Te(Er(),1),zc=Te(Tr(),1),uo=Te(Nn(),1),qc=Te(co(),1);var fo=uo.default;F();var Mn="1008033",lo="1289";var ho="pbbp2",go="https://www.coze.cn",po="/api/coze_claw/resource/get_frontier_key",Uc="https://www.coze.cn",Fc="wss://frontier.coze.cn";function mo(r){return r??process.env.COZE_BRIDGE_HANDSHAKE_URL??Uc}function _o(r){return r??process.env.COZE_BRIDGE_FRONTIER_URL??Fc}function On(r){let e={},o=r?.ttEnv??process.env.COZE_BRIDGE_TT_ENV,a=r?.usePpe??process.env.COZE_BRIDGE_USE_PPE;return o&&(e["x-tt-env"]=o),a&&(e["x-use-ppe"]=a),e}var ie=M("upstream.frontier"),bo="application/json",yo="none",Bn=class{constructor(e){this.opts=e}opts;fws=null;handler=null;connectHandler=null;opened=!1;openCount=0;async start(){if(this.fws){ie.warn("start called on already-started FrontierUpstream; noop");return}let e={Authorization:`Bearer ${this.opts.privatecode}`,Origin:go,...On(this.opts.ppeOverride)};class o extends fo{constructor(p){super(p,ho,{headers:e})}send(p,...m){if(bs("debug"))try{let b;typeof p=="string"?b=Buffer.from(p,"utf8"):p instanceof Buffer?b=p:p instanceof ArrayBuffer?b=new Uint8Array(p):ArrayBuffer.isView(p)?b=new Uint8Array(p.buffer,p.byteOffset,p.byteLength):b=new Uint8Array(0);let w=Buffer.from(b.slice(0,128)).toString("hex");ie.debug("WS raw frame out",{bytes:b.byteLength,headHex:w})}catch(b){ie.warn("WS raw frame dump failed",{err:String(b)})}super.send(p,...m)}}let a=_o(this.opts.urlOverride),c={url:a,ws:o,fpID:lo,aID:Mn,accessKey:this.opts.handshake.accessKey,deviceID:this.opts.handshake.deviceId,payloadType:{type:bo,force:!0},payloadEncoding:{encoding:yo,force:!0},enableTransformTextPayload:!0,enableQoS:!1,enableAutoAck:!1,automaticOpen:!1,debug:this.opts.debug??!1},u=new vo.FWS(c);u.onopen=()=>{this.opened=!0,this.openCount+=1;let l=this.openCount===1;ie.info("frontier opened",{url:a,remoteDeviceId:this.opts.handshake.deviceId,initial:l,openCount:this.openCount}),this.connectHandler&&Promise.resolve(this.connectHandler({initial:l})).catch(p=>ie.warn("onConnect handler threw (ignored)",{err:String(p)}))},u.onclose=l=>{this.opened=!1,ie.info("frontier closed",{code:l.code,reason:l.reason,willReconnect:l.willReconnect})},u.onerror=l=>{ie.warn("frontier error",{code:l.code,msg:l.message})},u.onmessage=l=>this.handleMessage(l),this.fws=u,await u.connect()}async stop(e){let o=this.fws;if(o){this.fws=null,this.opened=!1;try{o.close(1e3,e??"bridge shutdown")}catch(a){ie.warn("frontier close threw (ignored)",{err:String(a)})}}}async send(e){let o=this.fws;if(!o)throw new A("UPSTREAM_DISCONNECTED","frontier upstream not started");let a=JSON.stringify(e),c=e;ie.info("frontier frame out",{method:c.method,jsonrpcId:c.id,size:a.length});try{await o.send(a,{service:33555712,method:1,payloadType:bo,payloadEncoding:yo})}catch(u){throw new A("UPSTREAM_DISCONNECTED",`frontier send failed: ${String(u)}`,{cause:u})}}onFrame(e){this.handler=e}onConnect(e){this.connectHandler=e}isConnected(){return this.opened&&this.fws?.readyState===1}handleMessage(e){let o=e.message?.service;if(o!==33555712){ie.debug("drop non-adapter frontier frame",{service:o});return}let a=Wc(e);if(!a){ie.debug("frontier message without text payload, drop",{payloadType:e.message?.payloadType});return}if(!this.handler){ie.debug("frame received but no onFrame handler",{size:a.length});return}let c;try{c=JSON.parse(a)}catch(u){ie.warn("frontier message JSON parse failed",{err:String(u),head:a.slice(0,80)});return}ie.info("frontier frame in",{logid:Hc(e.message?.LogID),logidNew:e.message?.LogIDNew,msgId:e.message?.msgID,jsonrpcId:c.id}),Promise.resolve(this.handler(c)).catch(u=>ie.warn("frontier frame handler threw",{err:String(u)}))}};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 o=e?.payload;if(!o)return null;try{return Buffer.from(o).toString("utf8")}catch{return null}}F();function Co(r){return r?r.startsWith("boe_")?{ttEnv:r}:{ttEnv:r,usePpe:"1"}:{}}var So=M("handshake");async function Eo(r){let e=mo(r.endpoint),o=r.timeoutMs??1e4,a=`${jc(e)}${po}?aid=${encodeURIComponent(Mn)}`,c={Authorization:`Bearer ${r.privatecode}`,Accept:"application/json",...On(r.ppeOverride)},u=new AbortController,l=setTimeout(()=>u.abort(),o);So.info("frontier key handshake",{base:e});try{let p=await fetch(a,{method:"GET",headers:c,signal:u.signal}),m=p.headers.get("x-tt-logid")??"",b=p.headers.get("x-tt-trace-id")??"";if(!p.ok){let T=await p.text().catch(()=>"");throw new A("UPSTREAM_HANDSHAKE_FAILED",`handshake HTTP ${p.status} logid=${m}: ${T.slice(0,200)}`)}let w=await p.json();if(w.code!==void 0&&w.code!==0)throw new A("UPSTREAM_HANDSHAKE_FAILED",`handshake code=${w.code} msg=${w.msg??"-"} logid=${m}`);let y=w.data?.access_key,E=w.data?.device_id;if(!y||!E)throw new A("UPSTREAM_HANDSHAKE_FAILED",`handshake response missing access_key/device_id logid=${m}: ${JSON.stringify(w)}`);return So.info("handshake ok",{remoteDeviceId:E,logid:m,traceId:b}),{accessKey:y,deviceId:E}}catch(p){throw p instanceof A?p:p.name==="AbortError"?new A("UPSTREAM_HANDSHAKE_FAILED",`handshake timeout (${o}ms)`):new A("UPSTREAM_HANDSHAKE_FAILED",String(p),{cause:p})}finally{clearTimeout(l)}}function jc(r){return r.endsWith("/")?r.slice(0,-1):r}F();var Nr=M("upstream.switchable"),zn=class{inner;handler=null;connectHandler=null;constructor(e){this.inner=e}async swap(e,o){if(this.inner===e)return;Nr.info("swap upstream",{reason:o});let a=this.inner;this.inner=e,this.handler&&e.onFrame(this.handler),this.connectHandler&&e.onConnect&&e.onConnect(this.connectHandler);try{await e.start()}catch(c){throw Nr.error("swap target start failed, reverting",{err:String(c)}),this.inner=a,c}await a.stop(o??"swapped").catch(c=>Nr.warn("previous upstream stop threw (ignored)",{err:String(c)}))}current(){return this.inner}start(){return this.inner.start()}stop(e){return this.inner.stop(e)}send(e){return this.inner.send(e)}onFrame(e){this.handler=e,this.inner.onFrame(e)}onConnect(e){this.connectHandler=e,this.inner.onConnect?.(e)}isConnected(){return this.inner.isConnected()}};F();var Rr=M("upstream"),Bt=class{handler=null;async start(){Rr.info("NoopUpstream started (M1 skeleton; real Frontier wired in M4)")}async stop(e){Rr.info("NoopUpstream stopped",{reason:e})}async send(e){Rr.debug("NoopUpstream.send (dropped)",{method:"method"in e?e.method:void 0})}onFrame(e){this.handler=e}isConnected(){return!1}async injectFrame(e){this.handler&&await this.handler(e)}};F();ue();F();ue();import{readFileSync as Gc,unlinkSync as Jc}from"node:fs";import{mkdir as Xc,readFile as Ao,unlink as Do,writeFile as Vc}from"node:fs/promises";import{dirname as Yc}from"node:path";var Zc=M("single-instance"),qn=class{pidFile;acquired=!1;constructor(e={}){this.pidFile=e.pidFile??W().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&&(Zc.warn("removing stale pid file",{stalePid:e}),await Do(this.pidFile).catch(()=>{})),await Xc(Yc(this.pidFile),{recursive:!0}),await Vc(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"),o=Number.parseInt(e.trim(),10);return Number.isFinite(o)&&o>0?o:null}catch(e){if(e.code==="ENOENT")return null;throw e}}isAlive(e){try{return process.kill(e,0),!0}catch(o){return o.code==="EPERM"}}installCleanupHooks(){process.once("exit",()=>{if(this.acquired)try{Gc(this.pidFile,"utf8").trim()===String(process.pid)&&Jc(this.pidFile)}catch{}})}};var ne=M("daemon"),$c="coze-bridge-daemon";async function Po(){let r=new qn({processTitle:$c}),e=await r.acquire();if(e.kind==="already-running")throw new Error(`coze-bridge daemon already running (pid=${e.pid})`);let o=await fn(),a=o??{};sr({pid:process.pid}),ne.info(o?"loaded bridge config":"initialized bridge config");try{let I=new At;a.frameworksCache=await I.detectAll(),ne.info("refreshed frameworks_cache",{detected:Object.keys(a.frameworksCache)})}catch(I){ne.warn("framework detection failed",{err:String(I)})}await Dt(a);let c=new zn(new Bt),u=W(),l=new dn({upstream:c,paths:u});await eu(u,l);let p=new un({paths:u,config:a,registry:l,healthReporter:async I=>{await l.sendRequest("_agent/health",I)}}),m,b,w=null,y=null;l.registerExtension("_agent/create",async I=>p.createAgent(I.params)),l.registerExtension("_agent/health",async()=>({ok:!0}));let E=new Zt({agents:l.agents,disposeAndMarkDisconnected:async(I,H)=>{let J=l.agents.get(I);J&&(await J.dispose(`disconnect: ${H}`).catch(Ae=>ne.warn("dispose during disconnect failed (ignored)",{agentId:I,err:String(Ae)})),J.status="disconnected",l.unregister(I)),l.disconnectedAgents.add(I)},executeModelSwitch:I=>p.executeModelSwitch(I)});l.registerExtension("_agent/listSkills",I=>E.listSkills(I.params)),l.registerExtension("_agent/addSkills",I=>E.addSkills(I.params)),l.registerExtension("_agent/removeSkills",I=>E.removeSkills(I.params)),l.registerExtension("_agent/getFileTree",I=>E.getFileTree(I.params)),l.registerExtension("_agent/getFileContent",I=>E.getFileContent(I.params)),l.registerExtension("_agent/update",I=>E.updateAgent(I.params)),l.registerExtension("_agent/disconnect",I=>E.disconnectAgent(I.params)),l.registerExtension("_agent/switchModel",I=>E.switchModel(I.params));let T=new Xt({paths:u,handlers:E,sendDetail:I=>l.sendRequest("_agent/detail",I)});c.onConnect(({initial:I})=>{ne.info("frontier upstream connected, triggering detail sync",{initial:I}),T.syncAll(I?"initial-connect":"reconnect").catch(H=>ne.warn("detail sync top-level error (ignored)",{err:String(H)}))});let k=new ln({paths:u,routes:[{method:"GET",path:"/status",handler:async()=>({running:!0,pid:process.pid,agents:[...l.agents.keys()],deviceId:w??"",frameworksCache:a.frameworksCache??{}})},{method:"POST",path:"/pair",handler:async I=>{let H=I,J=H?.privatecode,Ae=H?.pairing_code;if(!J||!Ae)throw new A("IPC_BAD_REQUEST","/pair requires privatecode + pairing_code");let ze=Co(H.env),be=H.handshake_url,ye=H.frontier_url,me=Qc(H.env,be,ye),nt=!!m&&m!==J,qt=b!==void 0&&b!==me;if(nt||qt){ne.warn("pair config switched, resetting agents",{pcChanged:nt,envChanged:qt,previousPc:m?Lo(m):"",nextPc:Lo(J),previousEnvKey:b??"",nextEnvKey:me});for(let Pe of[...l.agents.values()])await Pe.dispose("pair config switch").catch(()=>{}),l.agents.delete(Pe.agentId);await c.swap(new Bt,"pair switch").catch(()=>{})}let Ut=await Eo({privatecode:J,...be?{endpoint:be}:{},ppeOverride:ze});w=Ut.deviceId,sr({deviceId:w,pid:process.pid});let De=new Bn({handshake:Ut,privatecode:J,...ye?{urlOverride:ye}:{},ppeOverride:ze});await c.swap(De,"pair"),m=J,b=me;let Le=Object.keys(a.frameworksCache??{});try{let Pe=await l.sendRequest("_agent/pair",{pairCode:Ae,patToken:J,frameworks:Le,_meta:{cozeDeviceId:w}});return ne.info("_agent/pair ok",{pairResult:Pe}),y||(y=new $t({core:l,getDeviceId:()=>w??""})),y.start(),{ok:!0,note:"paired with cloud"}}catch(Pe){return ne.error("_agent/pair failed",{err:String(Pe)}),{ok:!1,note:`pair failed: ${String(Pe)}`}}}},{method:"POST",path:"/_agent/create",handler:async I=>{let H=I;return{ok:!0,result:await p.createAgent(H)}}},{method:"POST",path:"/refresh",handler:async()=>{ne.info("IPC /refresh: re-detecting frameworks");let I=new At;return a.frameworksCache=await I.detectAll(),await Dt(a),{ok:!0,frameworks:a.frameworksCache}}},{method:"POST",path:"/shutdown",handler:async()=>(ne.info("IPC /shutdown received"),setImmediate(()=>{ce.shutdown("ipc /shutdown")}),{ok:!0})}]}),{port:N,token:G}=await k.start();await l.start();let oe=null,ce={port:N,token:G,core:l,ipc:k,shutdown(I){return oe||(ne.info("daemon shutdown",{reason:I}),oe=(async()=>{y?.stop(),await l.stop(I),await k.stop(),await r.release()})(),oe)}};for(let I of["SIGTERM","SIGINT"])process.on(I,()=>{ce.shutdown(I).then(()=>process.exit(0))});return ne.info("daemon ready",{port:N,pid:process.pid,nodeVersion:process.version,platform:process.platform,frameworks:Object.keys(a.frameworksCache??{}),libVersion:a.libVersion??"dev"}),ce}function Lo(r){return r.length<=8?"***":`${r.slice(0,4)}***${r.slice(-4)}`}function Qc(r,e,o){return`${r??""}|${e??""}|${o??""}`}async function eu(r,e){let{readdir:o}=await import("node:fs/promises"),a;try{a=await o(r.agentsRoot)}catch{return}let{loadAgentConfig:c,enforceAgentConfigMode:u}=await Promise.resolve().then(()=>(at(),vs));for(let l of a){await u(l,r).catch(p=>ne.warn("enforceAgentConfigMode failed (ignored)",{agentId:l,err:String(p)}));try{let p=await c(l,r);p?.disconnectedAt&&(e.disconnectedAgents.add(l),ne.info("agent marked disconnected on startup",{agentId:l,disconnectedAt:p.disconnectedAt,reason:p.disconnectReason??""}))}catch(p){ne.warn("failed to load agent config on startup, skipping",{agentId:l,err:String(p)})}}}Or();ue();import{readFile as To}from"node:fs/promises";var je=class{paths;constructor(e){this.paths=e??W()}async probe(e=1e3){let o=await this.readAuth();if(!o)return{kind:"not-running"};try{let a=await this.fetch(o,{method:"GET",path:"/status",timeoutMs:e});return a.status===200?{kind:"connected",...o}:{kind:"stale",reason:`unexpected status ${a.status}`}}catch(a){return{kind:"stale",reason:cu(a)}}}async request(e){let o=await this.readAuth();if(!o)throw new Error("coze-bridge daemon not running (no port/token files)");return this.fetch(o,e)}async readAuth(){try{let[e,o]=await Promise.all([To(this.paths.portFile,"utf8"),To(this.paths.tokenFile,"utf8")]),a=Number.parseInt(e.trim(),10),c=o.trim();return!Number.isFinite(a)||a<=0||!c?null:{port:a,token:c}}catch(e){if(e.code==="ENOENT")return null;throw e}}async fetch(e,o){let a=o.body!==void 0,c={Authorization:`Bearer ${e.token}`};a&&(c["content-type"]="application/json");let u=new AbortController,l=setTimeout(()=>u.abort(),o.timeoutMs??5e3);try{let p=await fetch(`http://127.0.0.1:${e.port}${o.path}`,{method:o.method,headers:c,body:a?JSON.stringify(o.body):void 0,signal:u.signal}),m=await p.text();return{status:p.status,body:xu(m)}}finally{clearTimeout(l)}}};function xu(r){if(!r)return null;try{return JSON.parse(r)}catch{return r}}function cu(r){return r instanceof Error?r.message:String(r)}F();ue();import{copyFile as Io,mkdir as uu,readFile as Br,writeFile as fu}from"node:fs/promises";import{dirname as du,resolve as zr,sep as Un}from"node:path";import{fileURLToPath as lu}from"node:url";F();ue();var No=M("dist-install");function hu(r){let e=lu(r),o=du(e),a=`${Un}src${Un}`;if(o.includes(a)||o.endsWith(`${Un}src${Un}cli`))return null;let c=zr(o,"index.js"),u=zr(o,"..","package.json");return{dist:c,pkgJson:u}}async function Ro(r={}){let e=r.paths??W(),o=hu(import.meta.url),a=r.sourceDist??o?.dist,c=r.sourcePackageJson??o?.pkgJson;if(!a||!c)return{kind:"dev-mode-skip",reason:"running from src/(tsx loader);no dist/ to install"};let u;try{u=JSON.parse(await Br(c,"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 l=await fn(e.configFile)??{},p=l.libVersion;if(p===u)try{return await Br(e.libEntry),{kind:"already-current",libVersion:u}}catch{}await uu(e.libDir,{recursive:!0}),await Io(a,e.libEntry),await Io(`${a}.map`,`${e.libEntry}.map`).catch(()=>{});let m=zr(e.libDir,"package.json"),b=`${JSON.stringify({type:"module"},null,2)}
91
- `;return await Br(m,"utf8").catch(()=>null)!==b&&await fu(m,b),l.libVersion=u,await Dt(l,e.configFile),No.info("dist installed",{libEntry:e.libEntry,fromVersion:p,toVersion:u}),p?{kind:"version-changed",fromVersion:p,toVersion:u,libEntry:e.libEntry}:{kind:"first-install",libVersion:u,libEntry:e.libEntry}}var Nu=M("cli");function zt(r,e){let o=[],a;for(let c=0;c<r.length;c++){let u=r[c];if(u===e){a=r[c+1],c+=1;continue}if(u.startsWith(`${e}=`)){a=u.slice(e.length+1);continue}o.push(u)}return{value:a,rest:o}}function Ru(r){let e=r.slice(2);if(e.includes("--daemon"))return{mode:"daemon"};if(e.includes("--status"))return{mode:"status"};if(e.includes("--stop"))return{mode:"stop"};if(e.includes("--refresh"))return{mode:"refresh"};if(e.includes("--uninstall"))return{mode:"uninstall"};if(e.includes("--install-service"))return{mode:"install-service"};if(e.includes("--help")||e.includes("-h")||e.length===0)return{mode:"help"};let o=e,{value:a,rest:c}=zt(o,"--pat-token");o=c;let{value:u,rest:l}=zt(o,"--pair-code");o=l;let{value:p,rest:m}=zt(o,"--env");o=m;let{value:b,rest:w}=zt(o,"--handshake-url");o=w;let{value:y,rest:E}=zt(o,"--frontier-url");if(o=E,!a||!u)return{mode:"help"};let T={mode:"pair",privatecode:a,pairingCode:u};return p&&(T.env=p),b&&(T.handshakeUrl=b),y&&(T.frontierUrl=y),T}var Mu=`
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:
@@ -107,38 +107,42 @@ Environment routing (optional, per-pair, not persisted):
107
107
  --handshake-url <url> override HTTP base (default https://www.coze.cn)
108
108
  --frontier-url <url> override Frontier WS URL (default wss://frontier.coze.cn)
109
109
 
110
- Example: npx -y coze-bridge --pat-token=sat_xxx --pair-code=xxx --env=ppe_xxx
110
+ Auto-connect agent (optional):
111
+ --agent-id <id> pair \u540E\u81EA\u52A8 connect \u6307\u5B9A agent \u2014 \u672C\u5730\u5DF2\u6709\u8D70 reconnect/
112
+ revive, \u6CA1\u6709\u8D70 _agent/detail \u62C9\u4E91\u7AEF\u8BE6\u60C5\u7136\u540E\u672C\u5730\u65B0\u5EFA
113
+
114
+ Example: npx -y coze-bridge --pat-token=sat_xxx --pair-code=xxx --env=ppe_xxx --agent-id=7639628097007927571
111
115
 
112
116
  Internal:
113
117
  <node> <entry> --daemon daemon mode (OS supervisor only)
114
- `.trimStart();async function Uo(r=process.argv,e={}){let o=Ru(r);switch(o.mode){case"help":return process.stdout.write(Mu),0;case"daemon":{try{await Po()}catch(a){return Nu.error("daemon start failed",{err:String(a)}),1}return new Promise(()=>{})}case"status":return Ou(e);case"stop":return Bu(e);case"refresh":return zu(e);case"uninstall":return qu(e);case"install-service":return Uu();case"pair":{let a={};return o.env&&(a.env=o.env),o.handshakeUrl&&(a.handshakeUrl=o.handshakeUrl),o.frontierUrl&&(a.frontierUrl=o.frontierUrl),Fu(o.privatecode,o.pairingCode,e,a)}}}async function Ou(r){let e=new je(r.paths),o=await e.probe();if(o.kind==="not-running")return process.stdout.write(`coze-bridge: not running
115
- `),1;if(o.kind==="stale")return process.stdout.write(`coze-bridge: stale (${o.reason})
116
- `),1;let a=await e.request({method:"GET",path:"/status"});return process.stdout.write(`coze-bridge: running
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
+ `),1;if(i.kind==="stale")return process.stdout.write(`coze-bridge: stale (${i.reason})
120
+ `),1;let a=await t.request({method:"GET",path:"/status"});return process.stdout.write(`coze-bridge: running
117
121
  ${JSON.stringify(a.body,null,2)}
118
- `),0}async function Bu(r){let e=new je(r.paths);if((await e.probe()).kind==="not-running")return process.stdout.write(`coze-bridge: not running
119
- `),0;try{return await e.request({method:"POST",path:"/shutdown"}),process.stdout.write(`coze-bridge: stopped
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
120
124
  `),0}catch(a){return process.stdout.write(`coze-bridge: stop failed: ${String(a)}
121
- `),1}}async function zu(r){let e=new je(r.paths);if((await e.probe()).kind==="not-running")return process.stdout.write(`coze-bridge: not running (start daemon first)
122
- `),1;try{let a=await e.request({method:"POST",path:"/refresh"});return a.status===200?(process.stdout.write(`coze-bridge: refreshed
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
123
127
  ${JSON.stringify(a.body,null,2)}
124
128
  `),0):(process.stderr.write(`coze-bridge: refresh failed: ${JSON.stringify(a.body)}
125
129
  `),1)}catch(a){return process.stderr.write(`coze-bridge: refresh failed: ${String(a)}
126
- `),1}}async function qu(r){let e=new je(r.paths);if((await e.probe()).kind==="connected"){process.stdout.write(`coze-bridge: stopping daemon...
127
- `);try{await e.request({method:"POST",path:"/shutdown"})}catch(u){process.stderr.write(`coze-bridge: stop failed (continuing): ${String(u)}
128
- `)}await new Promise(u=>setTimeout(u,500))}if(!r.skipSupervisor)try{let{getSupervisor:u,buildContext:l}=await Promise.resolve().then(()=>(jr(),Wr)),p=u();await p.uninstall(l()),process.stdout.write(`coze-bridge: ${p.platform} supervisor unregistered
129
- `)}catch(u){process.stderr.write(`coze-bridge: supervisor uninstall failed (continuing): ${String(u)}
130
- `)}let a=r.paths??W(),{rm:c}=await import("node:fs/promises");try{await c(a.cozeRoot,{recursive:!0,force:!0}),process.stdout.write(`coze-bridge: removed ${a.cozeRoot}
131
- `)}catch(u){return process.stderr.write(`coze-bridge: remove failed: ${String(u)}
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
+ `)}catch(f){process.stderr.write(`coze-bridge: supervisor uninstall failed (continuing): ${String(f)}
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
+ `)}catch(f){return process.stderr.write(`coze-bridge: remove failed: ${String(f)}
132
136
  `),1}return process.stdout.write(`coze-bridge: uninstalled
133
- `),0}async function Uu(){try{let{getSupervisor:r,buildContext:e}=await Promise.resolve().then(()=>(jr(),Wr)),o=r(),a=e();return process.stdout.write(`coze-bridge: installing ${o.platform} supervisor...
134
- `),await o.install(a),process.stdout.write(`coze-bridge: supervisor installed (daemon will auto-start on login)
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
+ `),await i.install(a),process.stdout.write(`coze-bridge: supervisor installed (daemon will auto-start on login)
135
139
  `),0}catch(r){return process.stderr.write(`coze-bridge: --install-service failed: ${String(r)}
136
- `),1}}async function Fu(r,e,o,a={}){let c=new je(o.paths),u=o.spawnDaemon??ko;if(!o.skipDistInstall){let m=await Ro({paths:o.paths});m.kind==="version-changed"?(process.stdout.write(`coze-bridge: upgraded ${m.fromVersion} \u2192 ${m.toVersion}
137
- `),(await c.probe()).kind==="connected"&&(await c.request({method:"POST",path:"/shutdown"}).catch(()=>{}),await new Promise(w=>setTimeout(w,500)))):m.kind==="first-install"&&process.stdout.write(`coze-bridge: installed ${m.libVersion}
138
- `)}let l=await c.probe();if(l.kind!=="connected"&&(process.stdout.write(`coze-bridge: starting daemon...
139
- `),await u({paths:o.paths}),l=await Ku(c,o.waitTimeoutMs??1e4,o.sleep??Hu),l.kind!=="connected"))return process.stderr.write(`coze-bridge: daemon did not come up: ${l.kind}
140
- `),1;let p={privatecode:r,pairing_code:e};a.env&&(p.env=a.env),a.handshakeUrl&&(p.handshake_url=a.handshakeUrl),a.frontierUrl&&(p.frontier_url=a.frontierUrl);try{let m=await c.request({method:"POST",path:"/pair",body:p});return m.status===200&&m.body?.ok?(process.stdout.write(`coze-bridge: paired (${m.body.note??"ok"})
141
- `),0):(process.stderr.write(`coze-bridge: pair failed: ${JSON.stringify(m.body)}
142
- `),1)}catch(m){return process.stderr.write(`coze-bridge: pair failed: ${String(m)}
143
- `),1}}async function Ku(r,e,o){let a=Date.now()+e;for(;Date.now()<a;){let c=await r.probe(500);if(c.kind==="connected")return c;await o(200)}return r.probe(500)}function Hu(r){return new Promise(e=>setTimeout(e,r))}Uo(process.argv).then(r=>process.exit(r),r=>{process.stderr.write(`fatal: ${r instanceof Error?r.stack??r.message:String(r)}
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)}
144
148
  `),process.exit(1)});