yolkbot 1.3.1 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/browser/build/global.js
CHANGED
|
@@ -19,7 +19,7 @@ ${n}Connection: close\r
|
|
|
19
19
|
`)+4;Q.slice(d).length>=r&&B.end()}}}),B.on("end",()=>{let a=/transfer-encoding:\s*chunked/i.test(Q),c=Q.split(`\r
|
|
20
20
|
\r
|
|
21
21
|
`)[1];if(a){let r=c,d=[],w=0;for(;w<r.length;){let k=r.indexOf(`\r
|
|
22
|
-
`,w);if(k===-1)break;let U=r.slice(w,k).trim(),x=parseInt(U,16);if(x===0)break;w=k+2,d.push(r.slice(w,w+x)),w+=x+2}c=d.join("")}o({json:()=>JSON.parse(c),text:()=>c})})},Ce=(B,{method:A="GET",proxy:t,headers:e={},body:i=null}={})=>new Promise((I,g)=>{let{hostname:o,port:n,pathname:C,protocol:Q,search:a}=new URL(B),c=Q==="https:",r=n?parseInt(n):c?443:80,d=o,w=C+a,k=Qe(t);if(!k)return dt.lookup(d,(H,M)=>{if(H)throw H;let S=(c?wt.connect:lt.connect)(r,M,c?{servername:d}:void 0,()=>{kA(S,{method:A,pathname:w,destHost:d,destPort:r,headers:e,body:i},I)});S.on("error",F=>{throw F})});let{host:U,port:x,user:m,pass:T,remoteResolve:X}=k,rt=H=>{let M=lt.connect(x,U,()=>{m&&T?M.write(Buffer.from([5,1,2])):M.write(Buffer.from([5,1,0]))}),DA=()=>{let F;if(X){let R=Buffer.from(d);F=Buffer.concat([Buffer.from([5,1,0,3,R.length]),R,Buffer.from([r>>8&255,r&255])])}else{let R=Buffer.from(H.split(".").map(Number));F=Buffer.concat([Buffer.from([5,1,0,1]),R,Buffer.from([r>>8&255,r&255])])}M.write(F)},S=0;M.on("data",F=>{if(S===0)if(m&&T){if(F[1]!==2)return g("You tried to add authencation to a proxy that does not support username/password.");let R=Buffer.from(m),ht=Buffer.from(T),oe=Buffer.concat([Buffer.from([1,R.length]),R,Buffer.from([ht.length]),ht]);M.write(oe),S=.5}else{if(F[1]!==0)return g("You tried to use a proxy that requires authentication. Add authentication to your proxy URL.");S=1,DA()}else if(S===.5){if(F[1]!==0)return g("Your input proxy username/password was incorrect.");S=1,DA()}else if(S===1){if(F[1]!==0)return g("SOCKS5 proxy connection failed :(");if(c){let R=wt.connect({socket:M,servername:d},()=>{kA(R,{method:A,pathname:w,destHost:d,destPort:r,headers:e,body:i},I)});R.on("error",g)}else kA(M,{method:A,pathname:w,destHost:d,destPort:r,headers:e,body:i},I);S=2}}),M.on("error",g)};X?rt():dt.lookup(d,(H,M)=>{if(H)return g(H);rt(M)})}),mt=Ce;var _={},V=typeof window<"u"&&typeof HTMLElement<"u",QA=typeof WebSocketPair<"u"&&typeof Cloudflare<"u",ue=typeof process<"u"&&process.moduleLoadList?.length>0,De=typeof Deno<"u"&&typeof navigator<"u"&&navigator.userAgent?.startsWith("Deno/"),ke=typeof Bun<"u"&&typeof navigator<"u"&&navigator.userAgent?.startsWith("Bun/");if(!V&&!QA&&!ue&&!De&&!ke)throw new Error("yolkbot doesn't know how to run in this environment. Please open an issue on GitHub with information on where you run yolkbot.");_.isBrowser=V;_.isIsolated=V||QA;_.fetch=V||QA?globalThis.fetch:mt;_.WebSocket=V||QA?globalThis.WebSocket:(await Promise.resolve().then(()=>(Dt(),ut))).WWWebSocket;var p=_;var bA={};aA(bA,{BanDuration:()=>YA,ChallengeSubType:()=>fe,ChallengeType:()=>Ne,ChatFlag:()=>Me,ChiknWinnerDailyLimit:()=>JA,CollectType:()=>CA,CoopState:()=>EA,FirebaseKey:()=>K,FramesBetweenSyncs:()=>q,GameAction:()=>cA,GameMode:()=>u,GameOptionFlag:()=>xA,GunEquipTime:()=>HA,GunList:()=>b,ItemType:()=>J,Movement:()=>D,PlayType:()=>rA,ShellStreak:()=>y,SocialMedia:()=>KA,SocialReward:()=>Ge,StateBufferSize:()=>$,Team:()=>Se,URLRewards:()=>Fe,UserAgent:()=>AA,findItemById:()=>l});var LA={};aA(LA,{AUG:()=>UA,CSG1:()=>MA,Cluck9mm:()=>GA,DozenGauge:()=>NA,Eggk47:()=>fA,M24:()=>RA,RPEGG:()=>SA,SMG:()=>FA});var Y=class{constructor(){this.adsMod=.5,this.burst=0,this.burstRof=0,this.movementAccuracyMod=1,this.radius=0,this.reloadBloom=!0,this.reloadTimeMod=1,this.tracer=0}},fA=class extends Y{constructor(){super(),this.ammo={rounds:30,capacity:30,reload:30,store:240,storeMax:240,pickup:30},this.longReloadTime=205,this.shortReloadTime=160,this.weaponName="EggK-47",this.internalName="Eggk47",this.standardMeshName="eggk47",this.automatic=!0,this.damage=30,this.range=20,this.recoil=7,this.rof=3,this.totalDamage=30,this.velocity=1.5,this.accuracyMin=.15,this.accuracyMax=.03,this.accuracyLoss=.05,this.accuracyRecover=.025,this.tracer=1}},NA=class extends Y{constructor(){super(),this.ammo={rounds:2,capacity:2,reload:2,store:24,storeMax:24,pickup:8},this.longReloadTime=155,this.shortReloadTime=155,this.weaponName="Scrambler",this.internalName="Dozen Gauge",this.standardMeshName="dozenGauge",this.automatic=!1,this.damage=8.5,this.range=8,this.recoil=10,this.rof=8,this.totalDamage=170,this.velocity=1,this.accuracyMin=.16,this.accuracyMax=.13,this.accuracyLoss=.17,this.accuracyRecover=.02,this.adsMod=.6,this.movementAccuracyMod=.2,this.tracer=0}},MA=class extends Y{constructor(){super(),this.ammo={rounds:15,capacity:15,reload:15,store:60,storeMax:60,pickup:15},this.longReloadTime=225,this.shortReloadTime=165,this.weaponName="Free Ranger",this.internalName="CSG-1",this.standardMeshName="csg1",this.automatic=!1,this.damage=105,this.range=50,this.recoil=13,this.rof=13,this.totalDamage=105,this.velocity=1.75,this.accuracyMin=.3,this.accuracyMax=.004,this.accuracyLoss=.3,this.accuracyRecover=.025,this.tracer=0}},GA=class extends Y{constructor(){super(),this.ammo={rounds:15,capacity:15,reload:15,store:60,storeMax:60,pickup:15},this.longReloadTime=195,this.shortReloadTime=160,this.weaponName="Cluck 9mm",this.internalName="Cluck 9mm",this.standardMeshName="cluck9mm",this.automatic=!1,this.damage=26,this.range=15,this.recoil=6,this.rof=4,this.totalDamage=26,this.velocity=1,this.accuracyMin=.15,this.accuracyMax=.035,this.accuracyLoss=.09,this.accuracyRecover=.08,this.adsMod=.8,this.movementAccuracyMod=.6,this.tracer=0}},SA=class extends Y{constructor(){super(),this.ammo={rounds:1,capacity:1,reload:1,store:3,storeMax:3,pickup:1},this.longReloadTime=170,this.shortReloadTime=170,this.weaponName="RPEGG",this.internalName="Eggsploder",this.standardMeshName="rpegg",this.automatic=!1,this.damage=140,this.range=45,this.recoil=60,this.rof=40,this.totalDamage=192.5,this.velocity=.4,this.accuracyMin=.3,this.accuracyMax=.015,this.accuracyLoss=.3,this.accuracyRecover=.02,this.radius=2.75}},FA=class extends Y{constructor(){super(),this.ammo={rounds:40,capacity:40,reload:40,store:200,storeMax:200,pickup:40},this.longReloadTime=225,this.shortReloadTime=190,this.weaponName="Whipper",this.internalName="SMEGG",this.standardMeshName="smg",this.automatic=!0,this.damage=23,this.range=20,this.recoil=7,this.rof=2,this.totalDamage=23,this.velocity=1.25,this.accuracyMin=.19,this.accuracyMax=.06,this.accuracyLoss=.045,this.accuracyRecover=.05,this.adsMod=.6,this.movementAccuracyMod=.7,this.tracer=2}},RA=class extends Y{constructor(){super(),this.ammo={rounds:1,capacity:1,reload:1,store:12,storeMax:12,pickup:4},this.longReloadTime=144,this.shortReloadTime=144,this.weaponName="Crackshot",this.internalName="M2DZ",this.standardMeshName="m24",this.automatic=!0,this.damage=170,this.range=60,this.recoil=20,this.rof=15,this.totalDamage=170,this.velocity=2,this.accuracyMin=.35,this.accuracyMax=0,this.accuracyLoss=.1,this.accuracyRecover=.023,this.movementAccuracyMod=1.3,this.reloadBloom=!1,this.reloadTimeMod=.8,this.tracer=0}},UA=class extends Y{constructor(){super(),this.ammo={rounds:24,capacity:24,reload:24,store:150,storeMax:150,pickup:24},this.longReloadTime=205,this.shortReloadTime=160,this.weaponName="Tri-Hard",this.internalName="AUG",this.standardMeshName="aug",this.automatic=!1,this.damage=32,this.range=20,this.recoil=18,this.rof=15,this.totalDamage=34,this.velocity=1.5,this.accuracyMin=.15,this.accuracyMax=.03,this.accuracyLoss=.037,this.accuracyRecover=.03,this.adsMod=.6,this.burst=3,this.burstRof=3,this.movementAccuracyMod=.8,this.movementInstability=2,this.tracer=0}};var l=()=>null;var YA={FiveMinutes:0,FifteenMinutes:1,OneHour:2},fe={Killstreak:0,KillWithWeapon:1,MovementDistance:3,Jumping:4,TimePlayed:6,TimeAlive:7,KillWithCondition:8,TotalKills:10,SpatulaKills:10,Collecting:18,FromTheCoop:20,SpecialOffensive:21,WinKOTC:23,KillWithSpatula:23},Ne={Kill:0,Damage:1,Death:2,Movement:3,Collect:4,Time:5,KOTC:6,Spatula:7},Me={None:0,Pinned:2,Team:4,Mod:254,Server:255},JA=3,CA={Ammo:0,Grenade:1},EA={Start:0,Score:1,Win:2,Capturing:3,Contested:4,Takeover:5,Abandoned:6,Unclaimed:7},K="AIzaSyDP4SIjKaw6A4c-zvfYxICpbEjn1rRnN50",q=3,cA={Reset:1,Pause:2},u={FFA:0,Team:1,Spatula:2,KOTC:3},xA={Locked:1,NoTeamChange:2,NoTeamShuffle:4},HA=13,b=[fA,NA,MA,SA,FA,RA,UA],J={Hat:1,Stamp:2,Primary:3,Secondary:4,Grenade:6,Melee:7},D={Forward:1,Backward:2,Left:4,Right:8,Jump:16,Fire:32,Melee:64,Scope:128},rA={JoinPublic:0,CreatePrivate:1,JoinPrivate:2},y={HardBoiled:1,EggBreaker:2,Restock:4,OverHeal:8,DoubleEggs:16,MiniEgg:32},KA={Facebook:0,Instagram:1,Tiktok:2,Discord:3,Youtube:4,Twitter:5,Twitch:6},Ge={Discord:"rew_1200",Tiktok:"rew_1208",Instagram:"rew_1219",Steam:"rew_1223",Facebook:"rew_1227",Twitter:"rew_1234",Twitch:"rew_twitch_social"},$=256,Se={Blue:1,Red:2},Fe=["giveBasketBrosReward","mercZoneFinalGift","midMonthGiveMeEggs","newYolkerSignupReward","newYolkerItemReward","newYolkerWelcomeBack","WelcomeBack"],AA=p.isBrowser?null:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36";var PA=class{url="";proxy="";binaryType="";maxRetries=5;connectionTimeout=5e3;constructor(A,t){this.url=A,p.isBrowser&&t&&(console.error("You cannot pass a proxy to a yolkws inside of a browser."),process.exit(1)),this.proxy=t}async tryConnect(A=1){let t=new URL(this.url),e=async()=>A===5?!1:await this.tryConnect(A+1);try{this.socket=p.isBrowser?new p.WebSocket(this.url):new p.WebSocket(this.url,{proxy:this.proxy||void 0,headers:{"accept-encoding":"gzip, deflate, br, zstd","accept-language":"en-US,en;q=0.9","cache-control":"no-cache",connection:"Upgrade",origin:t.origin.replace("ws","http"),pragma:"no-cache","sec-websocket-extensions":"permessage-deflate; client_max_window_bits","user-agent":AA}}),this.binaryType&&(this.socket.binaryType=this.binaryType)}catch(i){return console.error(`Failed to connect on try ${A}, trying again...`,i),await e()}return this.onBeforeConnect&&this.onBeforeConnect(),new Promise(i=>{let I=setTimeout(async()=>{p.isBrowser?this.socket.close():this.socket.terminate(),i(await e())},this.connectionTimeout),g=async o=>{clearTimeout(I),console.error("WebSocket error",o),i(await e())};this.socket.addEventListener("open",async()=>{clearTimeout(I),this.socket.removeEventListener("error",g),i(!0)}),this.socket.addEventListener("error",g)})}get onmessage(){return this.socket?.onmessage}set onmessage(A){this.socket?this.socket.onmessage=A:console.error("set onmessage before socket existed")}get onclose(){return this.socket?.onclose}set onclose(A){this.socket?this.socket.onclose=A:console.error("set onclose before socket existed")}get onerror(){return this.socket?.onerror}set onerror(A){this.socket?this.socket.onerror=A:console.error("set onclose before socket existed")}send(A){return this.socket?.send(A)}close(A){return this.socket?.close(A)}},z=PA;var tA={origin:"https://shellshock.io","user-agent":AA,"x-client-version":"Chrome/JsCore/9.17.2/FirebaseCore-web","x-firebase-locale":"en"},eA=class{constructor(A={}){this.proxy=A.proxy,this.instance=A.instance||"shellshock.io",this.protocol=A.protocol||"wss",this.maxRetries=A.maxRetries||5,this.suppressErrors=A.suppressErrors||!1,this.connectionTimeout=A.connectionTimeout||5e3}queryServices=async A=>{let t=new z(`${this.protocol}://${this.instance}/services/`,this.proxy);return t.connectionTimeout=this.connectionTimeout,!await t.tryConnect(-2)||t.socket.readyState<1?"websocket_connect_fail":new Promise(i=>{let I=!1;t.onmessage=g=>{I=!0;try{let o=JSON.parse(g.data);i(o)}catch{this.suppressErrors||(console.error("queryServices: Bad API JSON response with call: "+A.cmd+" and data:",JSON.stringify(A)),console.error("queryServices: Full data sent: ",JSON.stringify(A))),i("bad_json")}t.close()},t.onerror=()=>!I&&i("unknown_socket_error"),t.onclose=()=>!I&&i("services_closed_early"),t.send(JSON.stringify(A))})};#A=async(A,t,e)=>{if(!A||!t)return"firebase_no_credentials";let i,I;try{i=await(await p.fetch(`https://identitytoolkit.googleapis.com/v1/accounts:${e}?key=${K}`,{method:"POST",body:JSON.stringify({email:A,password:t,returnSecureToken:!0}),headers:{...tA,"content-type":"application/json"},proxy:this.proxy})).json(),I=i.idToken}catch(o){return o.code==="auth/network-request-failed"?(this.suppressErrors||console.error("loginWithCredentials: Network req failed (auth/network-request-failed)"),"firebase_network_failed"):o.code==="auth/missing-email"?"firebase_no_credentials":o.code==="ERR_BAD_REQUEST"?(this.suppressErrors||console.error("loginWithCredentials: Error:",A,t),this.suppressErrors||console.error("loginWithCredentials: Error:",i||o),"firebase_bad_request"):(this.suppressErrors||console.error("loginWithCredentials: Error:",A,t,o),"firebase_unknown_error")}if(!I)return this.suppressErrors||console.error("loginWithCredentials: the game sent no idToken",i),"firebase_no_token";this.idToken=I;let g=await this.queryServices({cmd:"auth",firebaseToken:I});return typeof g=="object"?{firebase:i,...g}:g};createAccount=async(A,t)=>await this.#A(A,t,"signUp");loginWithCredentials=async(A,t)=>await this.#A(A,t,"signInWithPassword");loginWithRefreshToken=async A=>{if(!A)return"firebase_no_credentials";let t=new URLSearchParams;t.append("grant_type","refresh_token"),t.append("refresh_token",A);let e,i;try{e=await(await p.fetch(`https://securetoken.googleapis.com/v1/token?key=${K}`,{method:"POST",body:t,headers:{...tA,"content-type":"application/x-www-form-urlencoded"},proxy:this.proxy})).json(),i=e.id_token}catch(g){return g.code==="auth/network-request-failed"?(this.suppressErrors||console.error("loginWithRefreshToken: Network req failed (auth/network-request-failed)"),"firebase_network_failed"):g.code==="auth/missing-email"?"firebase_no_credentials":(this.suppressErrors||console.error("loginWithRefreshToken: Error:",g,A),"firebase_unknown_error")}if(!i)return this.suppressErrors||console.error("loginWithRefreshToken: the game sent no idToken",e),"firebase_no_token";this.idToken=i;let I=await this.queryServices({cmd:"auth",firebaseToken:i});return typeof I=="object"?{firebase:e,...I}:I};loginAnonymously=async()=>{let t=await(await p.fetch("https://identitytoolkit.googleapis.com/v1/accounts:signUp?key="+K,{method:"POST",body:JSON.stringify({returnSecureToken:!0}),headers:{...tA,"content-type":"application/json"},proxy:this.proxy})).json(),e=t.idToken;if(!e)return this.suppressErrors||console.error("loginAnonymously: the game sent no idToken",t),"firebase_no_token";this.idToken=e;let i=await this.queryServices({cmd:"auth",firebaseToken:e});return typeof i=="object"?{firebase:t,...i}:i};sendEmailVerification=async(A=this.idToken)=>{if(!A)return"no_idtoken_passed";let e=await(await p.fetch("https://identitytoolkit.googleapis.com/v1/accounts:sendOobCode?key="+K,{method:"POST",body:JSON.stringify({requestType:"VERIFY_EMAIL",idToken:A}),headers:{...tA,"content-type":"application/json"},proxy:this.proxy})).json();return e.kind!=="identitytoolkit#GetOobConfirmationCodeResponse"?(this.suppressErrors||console.error("sendEmailVerification: the game sent an invalid response",e),"firebase_invalid_response"):{email:e.email}};verifyOobCode=async A=>{if(!A)return"no_oob_code_passed";let e=await(await p.fetch("https://www.googleapis.com/identitytoolkit/v3/relyingparty/setAccountInfo?key="+K,{method:"POST",body:JSON.stringify({oobCode:A}),headers:{...tA,"x-client-version":"Chrome/JsCore/3.7.5/FirebaseCore-web",referer:"https://shellshockio-181719.firebaseapp.com/","content-type":"application/json"},proxy:this.proxy})).json();return e.emailVerified?e.email:(this.suppressErrors||console.error("verifyOobCode: the game sent an invalid response",e),"firebase_invalid_response")}},hA=eA;var TA=class{static buffer;static idx;static init(A){this.buffer=new Uint8Array(A),this.idx=0}static isMoreDataAvailable(){return Math.max(0,this.buffer.length-this.idx)}static unPackInt8U(){let A=this.idx;return this.idx++,this.buffer[A]}static unPackInt8(){return(this.unPackInt8U()+128)%256-128}static unPackInt16U(){let A=this.idx;return this.idx+=2,this.buffer[A]+this.buffer[A+1]*256}static unPackInt24U(){let A=this.idx;return this.idx+=3,this.buffer[A]+this.buffer[A+1]*256+this.buffer[A+2]*65536}static unPackInt32U(){let A=this.idx;return this.idx+=4,this.buffer[A]+this.buffer[A+1]*256+this.buffer[A+2]*65536+this.buffer[A+3]*16777216}static unPackInt16(){return(this.unPackInt16U()+32768)%65536-32768}static unPackInt32(){return(this.unPackInt32U()+2147483648)%4294967296-2147483648}static unPackRadU(){return this.unPackInt24U()/2097152}static unPackRad(){return this.unPackInt16U()/8192-Math.PI}static unPackFloat(){return this.unPackInt16()/256}static unPackDouble(){return this.unPackInt32()/1048576}static unPackString(A){A=A||255;let t=Math.min(this.unPackInt8U(),A);return this.unPackStringHelper(t)}static unPackLongString(A){A=A||16383;let t=Math.min(this.unPackInt16U(),A);return this.unPackStringHelper(t)}static unPackStringHelper(A){if(this.isMoreDataAvailable()<A)return 0;let e="";for(let i=0;i<A;i++){let I=this.unPackInt16U();I>0&&(e+=String.fromCodePoint(I))}return e}},s=TA;var qA=class{constructor(A=16384){this.idx=0,this.arrayBuffer=new ArrayBuffer(A),this.buffer=new Uint8Array(this.arrayBuffer,0,A)}send(A){let t=new Uint8Array(this.arrayBuffer,0,this.idx);A.send(t)}packInt8(A){this.buffer[this.idx]=A&255,this.idx++}packInt16(A){this.buffer[this.idx]=A&255,this.buffer[this.idx+1]=A>>8&255,this.idx+=2}packInt24(A){this.buffer[this.idx]=A&255,this.buffer[this.idx+1]=A>>8&255,this.buffer[this.idx+2]=A>>16&255,this.idx+=3}packInt32(A){this.buffer[this.idx]=A&255,this.buffer[this.idx+1]=A>>8&255,this.buffer[this.idx+2]=A>>16&255,this.buffer[this.idx+3]=A>>24&255,this.idx+=4}packRadU(A){this.packInt24(A*2097152)}packRad(A){this.packInt16((A+Math.PI)*8192)}packFloat(A){this.packInt16(A*256)}packDouble(A){this.packInt32(A*1048576)}packString(A){typeof A!="string"&&(A=""),this.packInt8(A.length);for(let t=0;t<A.length;t++)this.packInt16(A.charCodeAt(t))}packLongString(A){typeof A!="string"&&(A=""),this.packInt16(A.length);for(let t=0;t<A.length;t++)this.packInt16(A.charCodeAt(t))}},h=qA;var Re={gameNotFound:4e3,gameFull:4001,badName:4002,mainMenu:4003,gameIdleExceeded:4004,corruptedLoginData0:4005,corruptedLoginData1:4006,corruptedLoginData2:4007,corruptedLoginData3:4008,corruptedLoginData4:4009,corruptedLoginData5:4010,gameMaxPlayersExceeded:4011,gameDestroyUser:4012,joinGameOutOfOrder:4013,gameShuttingDown:4014,readyBeforeReady:4015,booted:4016,gameErrorOnUserSocket:4017,uuidNotFound:4018,sessionNotFound:4019,clusterFullCpu:4020,clusterFullMem:4021,noClustersAvailable:4022,locked:4023},dA=Re;var Ue={},E=Ue;var Le=Object.fromEntries(Object.entries(KA).map(([B,A])=>[A,B.toLowerCase()])),gA=class{constructor(A,t=null){this.id=A.id,this.uniqueId=A.uniqueId,this.name=A.name,this.safeName=A.safeName,this.team=A.team,this.playing=A.playing,this.socials=A.social&&JSON.parse(A.social),this.socials&&this.socials.forEach(e=>e.type=Le[e.id]),this.isVip=A.upgradeProductId>0,this.showBadge=!A.hideBadge||!1,this.streak=A.score,this.streakRewards=Object.values(y).filter(e=>A.activeShellStreaks&e),this.scale=this.streakRewards.includes(y.MiniEgg)?.5:1,this.position={x:A.x,y:A.y,z:A.z},this.jumping=A.$controlKeys&D.Jump,this.scoping=A.$controlKeys&D.Scope,this.climbing=!1,this.view={yaw:A.yaw,pitch:A.pitch},this.updateKotcZone(t),this.character={eggColor:A.shellColor,primaryGun:A.primaryWeaponItem,secondaryGun:A.secondaryWeaponItem,stamp:A.stampItem,hat:A.hatItem,grenade:A.grenadeItem,melee:A.meleeItem,stampPos:{x:A.stampPosX,y:A.stampPosY}},this.stats={totalKills:A.totalKills,totalDeaths:A.totalDeaths,bestStreak:A.bestStreak},this.activeGun=A.weaponIdx,this.selectedGun=A.charClass,this.weapons=[],this.character.primaryGun&&(this.weapons[0]=new b[this.selectedGun],this.weapons[1]=new GA),this.grenades=1,this.hp=A.hp,this.hpShield=0,this.spawnShield=A.shield,this.randomSeed=0}updateKotcZone(A){if(!A)return this.inKotcZone=!1;let t=Math.floor(this.position.x),e=Math.floor(this.position.y),i=Math.floor(this.position.z);this.inKotcZone=A.some(I=>I.x===t&&I.y===e&&I.z===i)&&this.playing}},lA=gA;var P=(B,A,t)=>(A>>>=0,new TextDecoder().decode(new Uint8Array(B.memory.buffer).subarray(A,A+t))),v=(B,A)=>{let t=new TextEncoder().encode(A),e=B.__wbindgen_malloc(t.length,1)>>>0;return new Uint8Array(B.memory.buffer).subarray(e,e+t.length).set(t),[e,t.length]},iA=(B,A)=>{let t=B.__externref_table_alloc();return B.__wbindgen_export_2.set(t,A),t};var Ye=`
|
|
22
|
+
`,w);if(k===-1)break;let U=r.slice(w,k).trim(),x=parseInt(U,16);if(x===0)break;w=k+2,d.push(r.slice(w,w+x)),w+=x+2}c=d.join("")}o({json:()=>JSON.parse(c),text:()=>c})})},Ce=(B,{method:A="GET",proxy:t,headers:e={},body:i=null}={})=>new Promise((I,g)=>{let{hostname:o,port:n,pathname:C,protocol:Q,search:a}=new URL(B),c=Q==="https:",r=n?parseInt(n):c?443:80,d=o,w=C+a,k=Qe(t);if(!k)return dt.lookup(d,(H,M)=>{if(H)throw H;let S=(c?wt.connect:lt.connect)(r,M,c?{servername:d}:void 0,()=>{kA(S,{method:A,pathname:w,destHost:d,destPort:r,headers:e,body:i},I)});S.on("error",F=>{throw F})});let{host:U,port:x,user:m,pass:T,remoteResolve:X}=k,rt=H=>{let M=lt.connect(x,U,()=>{m&&T?M.write(Buffer.from([5,1,2])):M.write(Buffer.from([5,1,0]))}),DA=()=>{let F;if(X){let R=Buffer.from(d);F=Buffer.concat([Buffer.from([5,1,0,3,R.length]),R,Buffer.from([r>>8&255,r&255])])}else{let R=Buffer.from(H.split(".").map(Number));F=Buffer.concat([Buffer.from([5,1,0,1]),R,Buffer.from([r>>8&255,r&255])])}M.write(F)},S=0;M.on("data",F=>{if(S===0)if(m&&T){if(F[1]!==2)return g("You tried to add authencation to a proxy that does not support username/password.");let R=Buffer.from(m),ht=Buffer.from(T),oe=Buffer.concat([Buffer.from([1,R.length]),R,Buffer.from([ht.length]),ht]);M.write(oe),S=.5}else{if(F[1]!==0)return g("You tried to use a proxy that requires authentication. Add authentication to your proxy URL.");S=1,DA()}else if(S===.5){if(F[1]!==0)return g("Your input proxy username/password was incorrect.");S=1,DA()}else if(S===1){if(F[1]!==0)return g("SOCKS5 proxy connection failed :(");if(c){let R=wt.connect({socket:M,servername:d},()=>{kA(R,{method:A,pathname:w,destHost:d,destPort:r,headers:e,body:i},I)});R.on("error",g)}else kA(M,{method:A,pathname:w,destHost:d,destPort:r,headers:e,body:i},I);S=2}}),M.on("error",g)};X?rt():dt.lookup(d,(H,M)=>{if(H)return g(H);rt(M)})}),mt=Ce;var _={},V=typeof window<"u"&&typeof HTMLElement<"u",QA=typeof WebSocketPair<"u"&&typeof Cloudflare<"u",ue=typeof process<"u"&&process.moduleLoadList?.length>0,De=typeof Deno<"u"&&typeof navigator<"u"&&navigator.userAgent?.startsWith("Deno/"),ke=typeof Bun<"u"&&typeof navigator<"u"&&navigator.userAgent?.startsWith("Bun/");if(!V&&!QA&&!ue&&!De&&!ke)throw new Error("yolkbot doesn't know how to run in this environment. Please open an issue on GitHub with information on where you run yolkbot.");_.isBrowser=V;_.isIsolated=V||QA;_.fetch=V||QA?globalThis.fetch:mt;_.WebSocket=V||QA?globalThis.WebSocket:(await Promise.resolve().then(()=>(Dt(),ut))).WWWebSocket;var p=_;var bA={};aA(bA,{BanDuration:()=>YA,ChallengeSubType:()=>fe,ChallengeType:()=>Ne,ChatFlag:()=>Me,ChiknWinnerDailyLimit:()=>JA,CollectType:()=>CA,CoopState:()=>EA,FirebaseKey:()=>K,FramesBetweenSyncs:()=>q,GameAction:()=>cA,GameMode:()=>u,GameOptionFlag:()=>xA,GunEquipTime:()=>HA,GunList:()=>b,ItemType:()=>J,Movement:()=>D,PlayType:()=>rA,ShellStreak:()=>y,SocialMedia:()=>KA,SocialReward:()=>Ge,StateBufferSize:()=>$,Team:()=>Se,URLRewards:()=>Fe,UserAgent:()=>AA,findItemById:()=>l});var LA={};aA(LA,{AUG:()=>UA,CSG1:()=>MA,Cluck9mm:()=>GA,DozenGauge:()=>NA,Eggk47:()=>fA,M24:()=>RA,RPEGG:()=>SA,SMG:()=>FA});var Y=class{constructor(){this.adsMod=.5,this.burst=0,this.burstRof=0,this.movementAccuracyMod=1,this.radius=0,this.reloadBloom=!0,this.reloadTimeMod=1,this.tracer=0}},fA=class extends Y{constructor(){super(),this.ammo={rounds:30,capacity:30,reload:30,store:240,storeMax:240,pickup:30},this.longReloadTime=205,this.shortReloadTime=160,this.weaponName="EggK-47",this.internalName="Eggk47",this.standardMeshName="eggk47",this.automatic=!0,this.damage=30,this.range=20,this.recoil=7,this.rof=3,this.totalDamage=30,this.velocity=1.5,this.accuracyMin=.15,this.accuracyMax=.03,this.accuracyLoss=.05,this.accuracyRecover=.025,this.tracer=1}},NA=class extends Y{constructor(){super(),this.ammo={rounds:2,capacity:2,reload:2,store:24,storeMax:24,pickup:8},this.longReloadTime=155,this.shortReloadTime=155,this.weaponName="Scrambler",this.internalName="Dozen Gauge",this.standardMeshName="dozenGauge",this.automatic=!1,this.damage=8.5,this.range=8,this.recoil=10,this.rof=8,this.totalDamage=170,this.velocity=1,this.accuracyMin=.16,this.accuracyMax=.13,this.accuracyLoss=.17,this.accuracyRecover=.02,this.adsMod=.6,this.movementAccuracyMod=.2,this.tracer=0}},MA=class extends Y{constructor(){super(),this.ammo={rounds:15,capacity:15,reload:15,store:60,storeMax:60,pickup:15},this.longReloadTime=225,this.shortReloadTime=165,this.weaponName="Free Ranger",this.internalName="CSG-1",this.standardMeshName="csg1",this.automatic=!1,this.damage=105,this.range=50,this.recoil=13,this.rof=13,this.totalDamage=105,this.velocity=1.75,this.accuracyMin=.3,this.accuracyMax=.004,this.accuracyLoss=.3,this.accuracyRecover=.025,this.tracer=0}},GA=class extends Y{constructor(){super(),this.ammo={rounds:15,capacity:15,reload:15,store:60,storeMax:60,pickup:15},this.longReloadTime=195,this.shortReloadTime=160,this.weaponName="Cluck 9mm",this.internalName="Cluck 9mm",this.standardMeshName="cluck9mm",this.automatic=!1,this.damage=26,this.range=15,this.recoil=6,this.rof=4,this.totalDamage=26,this.velocity=1,this.accuracyMin=.15,this.accuracyMax=.035,this.accuracyLoss=.09,this.accuracyRecover=.08,this.adsMod=.8,this.movementAccuracyMod=.6,this.tracer=0}},SA=class extends Y{constructor(){super(),this.ammo={rounds:1,capacity:1,reload:1,store:3,storeMax:3,pickup:1},this.longReloadTime=170,this.shortReloadTime=170,this.weaponName="RPEGG",this.internalName="Eggsploder",this.standardMeshName="rpegg",this.automatic=!1,this.damage=140,this.range=45,this.recoil=60,this.rof=40,this.totalDamage=192.5,this.velocity=.4,this.accuracyMin=.3,this.accuracyMax=.015,this.accuracyLoss=.3,this.accuracyRecover=.02,this.radius=2.75}},FA=class extends Y{constructor(){super(),this.ammo={rounds:40,capacity:40,reload:40,store:200,storeMax:200,pickup:40},this.longReloadTime=225,this.shortReloadTime=190,this.weaponName="Whipper",this.internalName="SMEGG",this.standardMeshName="smg",this.automatic=!0,this.damage=23,this.range=20,this.recoil=7,this.rof=2,this.totalDamage=23,this.velocity=1.25,this.accuracyMin=.19,this.accuracyMax=.06,this.accuracyLoss=.045,this.accuracyRecover=.05,this.adsMod=.6,this.movementAccuracyMod=.7,this.tracer=2}},RA=class extends Y{constructor(){super(),this.ammo={rounds:1,capacity:1,reload:1,store:12,storeMax:12,pickup:4},this.longReloadTime=144,this.shortReloadTime=144,this.weaponName="Crackshot",this.internalName="M2DZ",this.standardMeshName="m24",this.automatic=!0,this.damage=170,this.range=60,this.recoil=20,this.rof=15,this.totalDamage=170,this.velocity=2,this.accuracyMin=.35,this.accuracyMax=0,this.accuracyLoss=.1,this.accuracyRecover=.023,this.movementAccuracyMod=1.3,this.reloadBloom=!1,this.reloadTimeMod=.8,this.tracer=0}},UA=class extends Y{constructor(){super(),this.ammo={rounds:24,capacity:24,reload:24,store:150,storeMax:150,pickup:24},this.longReloadTime=205,this.shortReloadTime=160,this.weaponName="Tri-Hard",this.internalName="AUG",this.standardMeshName="aug",this.automatic=!1,this.damage=32,this.range=20,this.recoil=18,this.rof=15,this.totalDamage=34,this.velocity=1.5,this.accuracyMin=.15,this.accuracyMax=.03,this.accuracyLoss=.037,this.accuracyRecover=.03,this.adsMod=.6,this.burst=3,this.burstRof=3,this.movementAccuracyMod=.8,this.movementInstability=2,this.tracer=0}};var l=()=>null;var YA={FiveMinutes:0,FifteenMinutes:1,OneHour:2},fe={Killstreak:0,KillWithWeapon:1,MovementDistance:3,Jumping:4,TimePlayed:6,TimeAlive:7,KillWithCondition:8,TotalKills:10,SpatulaKills:10,Collecting:18,FromTheCoop:20,SpecialOffensive:21,WinKOTC:23,KillWithSpatula:23},Ne={Kill:0,Damage:1,Death:2,Movement:3,Collect:4,Time:5,KOTC:6,Spatula:7},Me={None:0,Pinned:2,Team:4,Mod:254,Server:255},JA=3,CA={Ammo:0,Grenade:1},EA={Start:0,Score:1,Win:2,Capturing:3,Contested:4,Takeover:5,Abandoned:6,Unclaimed:7},K="AIzaSyDP4SIjKaw6A4c-zvfYxICpbEjn1rRnN50",q=3,cA={Reset:1,Pause:2},u={FFA:0,Team:1,Spatula:2,KOTC:3},xA={Locked:1,NoTeamChange:2,NoTeamShuffle:4},HA=13,b=[fA,NA,MA,SA,FA,RA,UA],J={Hat:1,Stamp:2,Primary:3,Secondary:4,Grenade:6,Melee:7},D={Forward:1,Backward:2,Left:4,Right:8,Jump:16,Fire:32,Melee:64,Scope:128},rA={JoinPublic:0,CreatePrivate:1,JoinPrivate:2},y={HardBoiled:1,EggBreaker:2,Restock:4,OverHeal:8,DoubleEggs:16,MiniEgg:32},KA={Facebook:0,Instagram:1,Tiktok:2,Discord:3,Youtube:4,Twitter:5,Twitch:6},Ge={Discord:"rew_1200",Tiktok:"rew_1208",Instagram:"rew_1219",Steam:"rew_1223",Facebook:"rew_1227",Twitter:"rew_1234",Twitch:"rew_twitch_social"},$=256,Se={Blue:1,Red:2},Fe=["giveBasketBrosReward","mercZoneFinalGift","midMonthGiveMeEggs","newYolkerSignupReward","newYolkerItemReward","newYolkerWelcomeBack","WelcomeBack"],AA=p.isBrowser?null:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36";var PA=class{url="";proxy="";binaryType="";maxRetries=5;connectionTimeout=5e3;constructor(A,t){this.url=A,p.isBrowser&&t&&(console.error("You cannot pass a proxy to a yolkws inside of a browser."),process.exit(1)),this.proxy=t}async tryConnect(A=1){let t=new URL(this.url),e=async()=>A===5?!1:await this.tryConnect(A+1);try{this.socket=p.isBrowser?new p.WebSocket(this.url):new p.WebSocket(this.url,{proxy:this.proxy||void 0,headers:{"accept-encoding":"gzip, deflate, br, zstd","accept-language":"en-US,en;q=0.9","cache-control":"no-cache",connection:"Upgrade",origin:t.origin.replace("ws","http"),pragma:"no-cache","sec-websocket-extensions":"permessage-deflate; client_max_window_bits","user-agent":AA}}),this.binaryType&&(this.socket.binaryType=this.binaryType)}catch(i){return console.error(`Failed to connect on try ${A}, trying again...`,i),await e()}return this.onBeforeConnect&&this.onBeforeConnect(),new Promise(i=>{let I=setTimeout(async()=>{this.socket.close(),i(await e())},this.connectionTimeout),g=async o=>{clearTimeout(I),console.error("WebSocket error",o),i(await e())};this.socket.addEventListener("open",async()=>{clearTimeout(I),this.socket.removeEventListener("error",g),i(!0)}),this.socket.addEventListener("error",g)})}get onmessage(){return this.socket?.onmessage}set onmessage(A){this.socket?this.socket.onmessage=A:console.error("set onmessage before socket existed")}get onclose(){return this.socket?.onclose}set onclose(A){this.socket?this.socket.onclose=A:console.error("set onclose before socket existed")}get onerror(){return this.socket?.onerror}set onerror(A){this.socket?this.socket.onerror=A:console.error("set onclose before socket existed")}send(A){return this.socket?.send(A)}close(A){return this.socket?.close(A)}},z=PA;var tA={origin:"https://shellshock.io","user-agent":AA,"x-client-version":"Chrome/JsCore/9.17.2/FirebaseCore-web","x-firebase-locale":"en"},eA=class{constructor(A={}){this.proxy=A.proxy,this.instance=A.instance||"shellshock.io",this.protocol=A.protocol||"wss",this.maxRetries=A.maxRetries||5,this.suppressErrors=A.suppressErrors||!1,this.connectionTimeout=A.connectionTimeout||5e3}queryServices=async A=>{let t=new z(`${this.protocol}://${this.instance}/services/`,this.proxy);return t.connectionTimeout=this.connectionTimeout,!await t.tryConnect(-2)||t.socket.readyState<1?"websocket_connect_fail":new Promise(i=>{let I=!1;t.onmessage=g=>{I=!0;try{let o=JSON.parse(g.data);i(o)}catch{this.suppressErrors||(console.error("queryServices: Bad API JSON response with call: "+A.cmd+" and data:",JSON.stringify(A)),console.error("queryServices: Full data sent: ",JSON.stringify(A))),i("bad_json")}t.close()},t.onerror=()=>!I&&i("unknown_socket_error"),t.onclose=()=>!I&&i("services_closed_early"),t.send(JSON.stringify(A))})};#A=async(A,t,e)=>{if(!A||!t)return"firebase_no_credentials";let i,I;try{i=await(await p.fetch(`https://identitytoolkit.googleapis.com/v1/accounts:${e}?key=${K}`,{method:"POST",body:JSON.stringify({email:A,password:t,returnSecureToken:!0}),headers:{...tA,"content-type":"application/json"},proxy:this.proxy})).json(),I=i.idToken}catch(o){return o.code==="auth/network-request-failed"?(this.suppressErrors||console.error("loginWithCredentials: Network req failed (auth/network-request-failed)"),"firebase_network_failed"):o.code==="auth/missing-email"?"firebase_no_credentials":o.code==="ERR_BAD_REQUEST"?(this.suppressErrors||console.error("loginWithCredentials: Error:",A,t),this.suppressErrors||console.error("loginWithCredentials: Error:",i||o),"firebase_bad_request"):(this.suppressErrors||console.error("loginWithCredentials: Error:",A,t,o),"firebase_unknown_error")}if(!I)return this.suppressErrors||console.error("loginWithCredentials: the game sent no idToken",i),"firebase_no_token";this.idToken=I;let g=await this.queryServices({cmd:"auth",firebaseToken:I});return typeof g=="object"?{firebase:i,...g}:g};createAccount=async(A,t)=>await this.#A(A,t,"signUp");loginWithCredentials=async(A,t)=>await this.#A(A,t,"signInWithPassword");loginWithRefreshToken=async A=>{if(!A)return"firebase_no_credentials";let t=new URLSearchParams;t.append("grant_type","refresh_token"),t.append("refresh_token",A);let e,i;try{e=await(await p.fetch(`https://securetoken.googleapis.com/v1/token?key=${K}`,{method:"POST",body:t,headers:{...tA,"content-type":"application/x-www-form-urlencoded"},proxy:this.proxy})).json(),i=e.id_token}catch(g){return g.code==="auth/network-request-failed"?(this.suppressErrors||console.error("loginWithRefreshToken: Network req failed (auth/network-request-failed)"),"firebase_network_failed"):g.code==="auth/missing-email"?"firebase_no_credentials":(this.suppressErrors||console.error("loginWithRefreshToken: Error:",g,A),"firebase_unknown_error")}if(!i)return this.suppressErrors||console.error("loginWithRefreshToken: the game sent no idToken",e),"firebase_no_token";this.idToken=i;let I=await this.queryServices({cmd:"auth",firebaseToken:i});return typeof I=="object"?{firebase:e,...I}:I};loginAnonymously=async()=>{let t=await(await p.fetch("https://identitytoolkit.googleapis.com/v1/accounts:signUp?key="+K,{method:"POST",body:JSON.stringify({returnSecureToken:!0}),headers:{...tA,"content-type":"application/json"},proxy:this.proxy})).json(),e=t.idToken;if(!e)return this.suppressErrors||console.error("loginAnonymously: the game sent no idToken",t),"firebase_no_token";this.idToken=e;let i=await this.queryServices({cmd:"auth",firebaseToken:e});return typeof i=="object"?{firebase:t,...i}:i};sendEmailVerification=async(A=this.idToken)=>{if(!A)return"no_idtoken_passed";let e=await(await p.fetch("https://identitytoolkit.googleapis.com/v1/accounts:sendOobCode?key="+K,{method:"POST",body:JSON.stringify({requestType:"VERIFY_EMAIL",idToken:A}),headers:{...tA,"content-type":"application/json"},proxy:this.proxy})).json();return e.kind!=="identitytoolkit#GetOobConfirmationCodeResponse"?(this.suppressErrors||console.error("sendEmailVerification: the game sent an invalid response",e),"firebase_invalid_response"):{email:e.email}};verifyOobCode=async A=>{if(!A)return"no_oob_code_passed";let e=await(await p.fetch("https://www.googleapis.com/identitytoolkit/v3/relyingparty/setAccountInfo?key="+K,{method:"POST",body:JSON.stringify({oobCode:A}),headers:{...tA,"x-client-version":"Chrome/JsCore/3.7.5/FirebaseCore-web",referer:"https://shellshockio-181719.firebaseapp.com/","content-type":"application/json"},proxy:this.proxy})).json();return e.emailVerified?e.email:(this.suppressErrors||console.error("verifyOobCode: the game sent an invalid response",e),"firebase_invalid_response")}},hA=eA;var TA=class{static buffer;static idx;static init(A){this.buffer=new Uint8Array(A),this.idx=0}static isMoreDataAvailable(){return Math.max(0,this.buffer.length-this.idx)}static unPackInt8U(){let A=this.idx;return this.idx++,this.buffer[A]}static unPackInt8(){return(this.unPackInt8U()+128)%256-128}static unPackInt16U(){let A=this.idx;return this.idx+=2,this.buffer[A]+this.buffer[A+1]*256}static unPackInt24U(){let A=this.idx;return this.idx+=3,this.buffer[A]+this.buffer[A+1]*256+this.buffer[A+2]*65536}static unPackInt32U(){let A=this.idx;return this.idx+=4,this.buffer[A]+this.buffer[A+1]*256+this.buffer[A+2]*65536+this.buffer[A+3]*16777216}static unPackInt16(){return(this.unPackInt16U()+32768)%65536-32768}static unPackInt32(){return(this.unPackInt32U()+2147483648)%4294967296-2147483648}static unPackRadU(){return this.unPackInt24U()/2097152}static unPackRad(){return this.unPackInt16U()/8192-Math.PI}static unPackFloat(){return this.unPackInt16()/256}static unPackDouble(){return this.unPackInt32()/1048576}static unPackString(A){A=A||255;let t=Math.min(this.unPackInt8U(),A);return this.unPackStringHelper(t)}static unPackLongString(A){A=A||16383;let t=Math.min(this.unPackInt16U(),A);return this.unPackStringHelper(t)}static unPackStringHelper(A){if(this.isMoreDataAvailable()<A)return 0;let e="";for(let i=0;i<A;i++){let I=this.unPackInt16U();I>0&&(e+=String.fromCodePoint(I))}return e}},s=TA;var qA=class{constructor(A=16384){this.idx=0,this.arrayBuffer=new ArrayBuffer(A),this.buffer=new Uint8Array(this.arrayBuffer,0,A)}send(A){let t=new Uint8Array(this.arrayBuffer,0,this.idx);A.send(t)}packInt8(A){this.buffer[this.idx]=A&255,this.idx++}packInt16(A){this.buffer[this.idx]=A&255,this.buffer[this.idx+1]=A>>8&255,this.idx+=2}packInt24(A){this.buffer[this.idx]=A&255,this.buffer[this.idx+1]=A>>8&255,this.buffer[this.idx+2]=A>>16&255,this.idx+=3}packInt32(A){this.buffer[this.idx]=A&255,this.buffer[this.idx+1]=A>>8&255,this.buffer[this.idx+2]=A>>16&255,this.buffer[this.idx+3]=A>>24&255,this.idx+=4}packRadU(A){this.packInt24(A*2097152)}packRad(A){this.packInt16((A+Math.PI)*8192)}packFloat(A){this.packInt16(A*256)}packDouble(A){this.packInt32(A*1048576)}packString(A){typeof A!="string"&&(A=""),this.packInt8(A.length);for(let t=0;t<A.length;t++)this.packInt16(A.charCodeAt(t))}packLongString(A){typeof A!="string"&&(A=""),this.packInt16(A.length);for(let t=0;t<A.length;t++)this.packInt16(A.charCodeAt(t))}},h=qA;var Re={gameNotFound:4e3,gameFull:4001,badName:4002,mainMenu:4003,gameIdleExceeded:4004,corruptedLoginData0:4005,corruptedLoginData1:4006,corruptedLoginData2:4007,corruptedLoginData3:4008,corruptedLoginData4:4009,corruptedLoginData5:4010,gameMaxPlayersExceeded:4011,gameDestroyUser:4012,joinGameOutOfOrder:4013,gameShuttingDown:4014,readyBeforeReady:4015,booted:4016,gameErrorOnUserSocket:4017,uuidNotFound:4018,sessionNotFound:4019,clusterFullCpu:4020,clusterFullMem:4021,noClustersAvailable:4022,locked:4023},dA=Re;var Ue={},E=Ue;var Le=Object.fromEntries(Object.entries(KA).map(([B,A])=>[A,B.toLowerCase()])),gA=class{constructor(A,t=null){this.id=A.id,this.uniqueId=A.uniqueId,this.name=A.name,this.safeName=A.safeName,this.team=A.team,this.playing=A.playing,this.socials=A.social&&JSON.parse(A.social),this.socials&&this.socials.forEach(e=>e.type=Le[e.id]),this.isVip=A.upgradeProductId>0,this.showBadge=!A.hideBadge||!1,this.streak=A.score,this.streakRewards=Object.values(y).filter(e=>A.activeShellStreaks&e),this.scale=this.streakRewards.includes(y.MiniEgg)?.5:1,this.position={x:A.x,y:A.y,z:A.z},this.jumping=A.$controlKeys&D.Jump,this.scoping=A.$controlKeys&D.Scope,this.climbing=!1,this.view={yaw:A.yaw,pitch:A.pitch},this.updateKotcZone(t),this.character={eggColor:A.shellColor,primaryGun:A.primaryWeaponItem,secondaryGun:A.secondaryWeaponItem,stamp:A.stampItem,hat:A.hatItem,grenade:A.grenadeItem,melee:A.meleeItem,stampPos:{x:A.stampPosX,y:A.stampPosY}},this.stats={totalKills:A.totalKills,totalDeaths:A.totalDeaths,bestStreak:A.bestStreak},this.activeGun=A.weaponIdx,this.selectedGun=A.charClass,this.weapons=[],this.character.primaryGun&&(this.weapons[0]=new b[this.selectedGun],this.weapons[1]=new GA),this.grenades=1,this.hp=A.hp,this.hpShield=0,this.spawnShield=A.shield,this.randomSeed=0}updateKotcZone(A){if(!A)return this.inKotcZone=!1;let t=Math.floor(this.position.x),e=Math.floor(this.position.y),i=Math.floor(this.position.z);this.inKotcZone=A.some(I=>I.x===t&&I.y===e&&I.z===i)&&this.playing}},lA=gA;var P=(B,A,t)=>(A>>>=0,new TextDecoder().decode(new Uint8Array(B.memory.buffer).subarray(A,A+t))),v=(B,A)=>{let t=new TextEncoder().encode(A),e=B.__wbindgen_malloc(t.length,1)>>>0;return new Uint8Array(B.memory.buffer).subarray(e,e+t.length).set(t),[e,t.length]},iA=(B,A)=>{let t=B.__externref_table_alloc();return B.__wbindgen_export_2.set(t,A),t};var Ye=`
|
|
23
23
|
var comp_spinner_overlay = {
|
|
24
24
|
template: '#spinner-overlay-template',
|
|
25
25
|
components: {
|
package/browser/build/module.js
CHANGED
|
@@ -19,7 +19,7 @@ ${n}Connection: close\r
|
|
|
19
19
|
`)+4;Q.slice(d).length>=r&&B.end()}}}),B.on("end",()=>{let a=/transfer-encoding:\s*chunked/i.test(Q),c=Q.split(`\r
|
|
20
20
|
\r
|
|
21
21
|
`)[1];if(a){let r=c,d=[],w=0;for(;w<r.length;){let k=r.indexOf(`\r
|
|
22
|
-
`,w);if(k===-1)break;let U=r.slice(w,k).trim(),J=parseInt(U,16);if(J===0)break;w=k+2,d.push(r.slice(w,w+J)),w+=J+2}c=d.join("")}o({json:()=>JSON.parse(c),text:()=>c})})},Qe=(B,{method:A="GET",proxy:t,headers:e={},body:i=null}={})=>new Promise((I,g)=>{let{hostname:o,port:n,pathname:C,protocol:Q,search:a}=new URL(B),c=Q==="https:",r=n?parseInt(n):c?443:80,d=o,w=C+a,k=ae(t);if(!k)return ct.lookup(d,(H,M)=>{if(H)throw H;let S=(c?ht.connect:rt.connect)(r,M,c?{servername:d}:void 0,()=>{DA(S,{method:A,pathname:w,destHost:d,destPort:r,headers:e,body:i},I)});S.on("error",F=>{throw F})});let{host:U,port:J,user:m,pass:T,remoteResolve:X}=k,Ct=H=>{let M=rt.connect(J,U,()=>{m&&T?M.write(Buffer.from([5,1,2])):M.write(Buffer.from([5,1,0]))}),uA=()=>{let F;if(X){let R=Buffer.from(d);F=Buffer.concat([Buffer.from([5,1,0,3,R.length]),R,Buffer.from([r>>8&255,r&255])])}else{let R=Buffer.from(H.split(".").map(Number));F=Buffer.concat([Buffer.from([5,1,0,1]),R,Buffer.from([r>>8&255,r&255])])}M.write(F)},S=0;M.on("data",F=>{if(S===0)if(m&&T){if(F[1]!==2)return g("You tried to add authencation to a proxy that does not support username/password.");let R=Buffer.from(m),Et=Buffer.from(T),Be=Buffer.concat([Buffer.from([1,R.length]),R,Buffer.from([Et.length]),Et]);M.write(Be),S=.5}else{if(F[1]!==0)return g("You tried to use a proxy that requires authentication. Add authentication to your proxy URL.");S=1,uA()}else if(S===.5){if(F[1]!==0)return g("Your input proxy username/password was incorrect.");S=1,uA()}else if(S===1){if(F[1]!==0)return g("SOCKS5 proxy connection failed :(");if(c){let R=ht.connect({socket:M,servername:d},()=>{DA(R,{method:A,pathname:w,destHost:d,destPort:r,headers:e,body:i},I)});R.on("error",g)}else DA(M,{method:A,pathname:w,destHost:d,destPort:r,headers:e,body:i},I);S=2}}),M.on("error",g)};X?Ct():ct.lookup(d,(H,M)=>{if(H)return g(H);Ct(M)})}),dt=Qe;var _={},V=typeof window<"u"&&typeof HTMLElement<"u",BA=typeof WebSocketPair<"u"&&typeof Cloudflare<"u",ye=typeof process<"u"&&process.moduleLoadList?.length>0,ue=typeof Deno<"u"&&typeof navigator<"u"&&navigator.userAgent?.startsWith("Deno/"),De=typeof Bun<"u"&&typeof navigator<"u"&&navigator.userAgent?.startsWith("Bun/");if(!V&&!BA&&!ye&&!ue&&!De)throw new Error("yolkbot doesn't know how to run in this environment. Please open an issue on GitHub with information on where you run yolkbot.");_.isBrowser=V;_.isIsolated=V||BA;_.fetch=V||BA?globalThis.fetch:dt;_.WebSocket=V||BA?globalThis.WebSocket:(await Promise.resolve().then(()=>(pt(),mt))).WWWebSocket;var y=_;var ut={};IA(ut,{BanDuration:()=>UA,ChallengeSubType:()=>ke,ChallengeType:()=>fe,ChatFlag:()=>Ne,ChiknWinnerDailyLimit:()=>LA,CollectType:()=>oA,CoopState:()=>nA,FirebaseKey:()=>K,FramesBetweenSyncs:()=>q,GameAction:()=>aA,GameMode:()=>u,GameOptionFlag:()=>YA,GunEquipTime:()=>xA,GunList:()=>b,ItemType:()=>x,Movement:()=>D,PlayType:()=>QA,ShellStreak:()=>p,SocialMedia:()=>JA,SocialReward:()=>Me,StateBufferSize:()=>$,Team:()=>Ge,URLRewards:()=>Se,UserAgent:()=>AA,findItemById:()=>l});var yt={};IA(yt,{AUG:()=>RA,CSG1:()=>NA,Cluck9mm:()=>MA,DozenGauge:()=>fA,Eggk47:()=>kA,M24:()=>FA,RPEGG:()=>GA,SMG:()=>SA});var Y=class{constructor(){this.adsMod=.5,this.burst=0,this.burstRof=0,this.movementAccuracyMod=1,this.radius=0,this.reloadBloom=!0,this.reloadTimeMod=1,this.tracer=0}},kA=class extends Y{constructor(){super(),this.ammo={rounds:30,capacity:30,reload:30,store:240,storeMax:240,pickup:30},this.longReloadTime=205,this.shortReloadTime=160,this.weaponName="EggK-47",this.internalName="Eggk47",this.standardMeshName="eggk47",this.automatic=!0,this.damage=30,this.range=20,this.recoil=7,this.rof=3,this.totalDamage=30,this.velocity=1.5,this.accuracyMin=.15,this.accuracyMax=.03,this.accuracyLoss=.05,this.accuracyRecover=.025,this.tracer=1}},fA=class extends Y{constructor(){super(),this.ammo={rounds:2,capacity:2,reload:2,store:24,storeMax:24,pickup:8},this.longReloadTime=155,this.shortReloadTime=155,this.weaponName="Scrambler",this.internalName="Dozen Gauge",this.standardMeshName="dozenGauge",this.automatic=!1,this.damage=8.5,this.range=8,this.recoil=10,this.rof=8,this.totalDamage=170,this.velocity=1,this.accuracyMin=.16,this.accuracyMax=.13,this.accuracyLoss=.17,this.accuracyRecover=.02,this.adsMod=.6,this.movementAccuracyMod=.2,this.tracer=0}},NA=class extends Y{constructor(){super(),this.ammo={rounds:15,capacity:15,reload:15,store:60,storeMax:60,pickup:15},this.longReloadTime=225,this.shortReloadTime=165,this.weaponName="Free Ranger",this.internalName="CSG-1",this.standardMeshName="csg1",this.automatic=!1,this.damage=105,this.range=50,this.recoil=13,this.rof=13,this.totalDamage=105,this.velocity=1.75,this.accuracyMin=.3,this.accuracyMax=.004,this.accuracyLoss=.3,this.accuracyRecover=.025,this.tracer=0}},MA=class extends Y{constructor(){super(),this.ammo={rounds:15,capacity:15,reload:15,store:60,storeMax:60,pickup:15},this.longReloadTime=195,this.shortReloadTime=160,this.weaponName="Cluck 9mm",this.internalName="Cluck 9mm",this.standardMeshName="cluck9mm",this.automatic=!1,this.damage=26,this.range=15,this.recoil=6,this.rof=4,this.totalDamage=26,this.velocity=1,this.accuracyMin=.15,this.accuracyMax=.035,this.accuracyLoss=.09,this.accuracyRecover=.08,this.adsMod=.8,this.movementAccuracyMod=.6,this.tracer=0}},GA=class extends Y{constructor(){super(),this.ammo={rounds:1,capacity:1,reload:1,store:3,storeMax:3,pickup:1},this.longReloadTime=170,this.shortReloadTime=170,this.weaponName="RPEGG",this.internalName="Eggsploder",this.standardMeshName="rpegg",this.automatic=!1,this.damage=140,this.range=45,this.recoil=60,this.rof=40,this.totalDamage=192.5,this.velocity=.4,this.accuracyMin=.3,this.accuracyMax=.015,this.accuracyLoss=.3,this.accuracyRecover=.02,this.radius=2.75}},SA=class extends Y{constructor(){super(),this.ammo={rounds:40,capacity:40,reload:40,store:200,storeMax:200,pickup:40},this.longReloadTime=225,this.shortReloadTime=190,this.weaponName="Whipper",this.internalName="SMEGG",this.standardMeshName="smg",this.automatic=!0,this.damage=23,this.range=20,this.recoil=7,this.rof=2,this.totalDamage=23,this.velocity=1.25,this.accuracyMin=.19,this.accuracyMax=.06,this.accuracyLoss=.045,this.accuracyRecover=.05,this.adsMod=.6,this.movementAccuracyMod=.7,this.tracer=2}},FA=class extends Y{constructor(){super(),this.ammo={rounds:1,capacity:1,reload:1,store:12,storeMax:12,pickup:4},this.longReloadTime=144,this.shortReloadTime=144,this.weaponName="Crackshot",this.internalName="M2DZ",this.standardMeshName="m24",this.automatic=!0,this.damage=170,this.range=60,this.recoil=20,this.rof=15,this.totalDamage=170,this.velocity=2,this.accuracyMin=.35,this.accuracyMax=0,this.accuracyLoss=.1,this.accuracyRecover=.023,this.movementAccuracyMod=1.3,this.reloadBloom=!1,this.reloadTimeMod=.8,this.tracer=0}},RA=class extends Y{constructor(){super(),this.ammo={rounds:24,capacity:24,reload:24,store:150,storeMax:150,pickup:24},this.longReloadTime=205,this.shortReloadTime=160,this.weaponName="Tri-Hard",this.internalName="AUG",this.standardMeshName="aug",this.automatic=!1,this.damage=32,this.range=20,this.recoil=18,this.rof=15,this.totalDamage=34,this.velocity=1.5,this.accuracyMin=.15,this.accuracyMax=.03,this.accuracyLoss=.037,this.accuracyRecover=.03,this.adsMod=.6,this.burst=3,this.burstRof=3,this.movementAccuracyMod=.8,this.movementInstability=2,this.tracer=0}};var l=()=>null;var UA={FiveMinutes:0,FifteenMinutes:1,OneHour:2},ke={Killstreak:0,KillWithWeapon:1,MovementDistance:3,Jumping:4,TimePlayed:6,TimeAlive:7,KillWithCondition:8,TotalKills:10,SpatulaKills:10,Collecting:18,FromTheCoop:20,SpecialOffensive:21,WinKOTC:23,KillWithSpatula:23},fe={Kill:0,Damage:1,Death:2,Movement:3,Collect:4,Time:5,KOTC:6,Spatula:7},Ne={None:0,Pinned:2,Team:4,Mod:254,Server:255},LA=3,oA={Ammo:0,Grenade:1},nA={Start:0,Score:1,Win:2,Capturing:3,Contested:4,Takeover:5,Abandoned:6,Unclaimed:7},K="AIzaSyDP4SIjKaw6A4c-zvfYxICpbEjn1rRnN50",q=3,aA={Reset:1,Pause:2},u={FFA:0,Team:1,Spatula:2,KOTC:3},YA={Locked:1,NoTeamChange:2,NoTeamShuffle:4},xA=13,b=[kA,fA,NA,GA,SA,FA,RA],x={Hat:1,Stamp:2,Primary:3,Secondary:4,Grenade:6,Melee:7},D={Forward:1,Backward:2,Left:4,Right:8,Jump:16,Fire:32,Melee:64,Scope:128},QA={JoinPublic:0,CreatePrivate:1,JoinPrivate:2},p={HardBoiled:1,EggBreaker:2,Restock:4,OverHeal:8,DoubleEggs:16,MiniEgg:32},JA={Facebook:0,Instagram:1,Tiktok:2,Discord:3,Youtube:4,Twitter:5,Twitch:6},Me={Discord:"rew_1200",Tiktok:"rew_1208",Instagram:"rew_1219",Steam:"rew_1223",Facebook:"rew_1227",Twitter:"rew_1234",Twitch:"rew_twitch_social"},$=256,Ge={Blue:1,Red:2},Se=["giveBasketBrosReward","mercZoneFinalGift","midMonthGiveMeEggs","newYolkerSignupReward","newYolkerItemReward","newYolkerWelcomeBack","WelcomeBack"],AA=y.isBrowser?null:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36";var HA=class{url="";proxy="";binaryType="";maxRetries=5;connectionTimeout=5e3;constructor(A,t){this.url=A,y.isBrowser&&t&&(console.error("You cannot pass a proxy to a yolkws inside of a browser."),process.exit(1)),this.proxy=t}async tryConnect(A=1){let t=new URL(this.url),e=async()=>A===5?!1:await this.tryConnect(A+1);try{this.socket=y.isBrowser?new y.WebSocket(this.url):new y.WebSocket(this.url,{proxy:this.proxy||void 0,headers:{"accept-encoding":"gzip, deflate, br, zstd","accept-language":"en-US,en;q=0.9","cache-control":"no-cache",connection:"Upgrade",origin:t.origin.replace("ws","http"),pragma:"no-cache","sec-websocket-extensions":"permessage-deflate; client_max_window_bits","user-agent":AA}}),this.binaryType&&(this.socket.binaryType=this.binaryType)}catch(i){return console.error(`Failed to connect on try ${A}, trying again...`,i),await e()}return this.onBeforeConnect&&this.onBeforeConnect(),new Promise(i=>{let I=setTimeout(async()=>{y.isBrowser?this.socket.close():this.socket.terminate(),i(await e())},this.connectionTimeout),g=async o=>{clearTimeout(I),console.error("WebSocket error",o),i(await e())};this.socket.addEventListener("open",async()=>{clearTimeout(I),this.socket.removeEventListener("error",g),i(!0)}),this.socket.addEventListener("error",g)})}get onmessage(){return this.socket?.onmessage}set onmessage(A){this.socket?this.socket.onmessage=A:console.error("set onmessage before socket existed")}get onclose(){return this.socket?.onclose}set onclose(A){this.socket?this.socket.onclose=A:console.error("set onclose before socket existed")}get onerror(){return this.socket?.onerror}set onerror(A){this.socket?this.socket.onerror=A:console.error("set onclose before socket existed")}send(A){return this.socket?.send(A)}close(A){return this.socket?.close(A)}},z=HA;var tA={origin:"https://shellshock.io","user-agent":AA,"x-client-version":"Chrome/JsCore/9.17.2/FirebaseCore-web","x-firebase-locale":"en"},CA=class{constructor(A={}){this.proxy=A.proxy,this.instance=A.instance||"shellshock.io",this.protocol=A.protocol||"wss",this.maxRetries=A.maxRetries||5,this.suppressErrors=A.suppressErrors||!1,this.connectionTimeout=A.connectionTimeout||5e3}queryServices=async A=>{let t=new z(`${this.protocol}://${this.instance}/services/`,this.proxy);return t.connectionTimeout=this.connectionTimeout,!await t.tryConnect(-2)||t.socket.readyState<1?"websocket_connect_fail":new Promise(i=>{let I=!1;t.onmessage=g=>{I=!0;try{let o=JSON.parse(g.data);i(o)}catch{this.suppressErrors||(console.error("queryServices: Bad API JSON response with call: "+A.cmd+" and data:",JSON.stringify(A)),console.error("queryServices: Full data sent: ",JSON.stringify(A))),i("bad_json")}t.close()},t.onerror=()=>!I&&i("unknown_socket_error"),t.onclose=()=>!I&&i("services_closed_early"),t.send(JSON.stringify(A))})};#A=async(A,t,e)=>{if(!A||!t)return"firebase_no_credentials";let i,I;try{i=await(await y.fetch(`https://identitytoolkit.googleapis.com/v1/accounts:${e}?key=${K}`,{method:"POST",body:JSON.stringify({email:A,password:t,returnSecureToken:!0}),headers:{...tA,"content-type":"application/json"},proxy:this.proxy})).json(),I=i.idToken}catch(o){return o.code==="auth/network-request-failed"?(this.suppressErrors||console.error("loginWithCredentials: Network req failed (auth/network-request-failed)"),"firebase_network_failed"):o.code==="auth/missing-email"?"firebase_no_credentials":o.code==="ERR_BAD_REQUEST"?(this.suppressErrors||console.error("loginWithCredentials: Error:",A,t),this.suppressErrors||console.error("loginWithCredentials: Error:",i||o),"firebase_bad_request"):(this.suppressErrors||console.error("loginWithCredentials: Error:",A,t,o),"firebase_unknown_error")}if(!I)return this.suppressErrors||console.error("loginWithCredentials: the game sent no idToken",i),"firebase_no_token";this.idToken=I;let g=await this.queryServices({cmd:"auth",firebaseToken:I});return typeof g=="object"?{firebase:i,...g}:g};createAccount=async(A,t)=>await this.#A(A,t,"signUp");loginWithCredentials=async(A,t)=>await this.#A(A,t,"signInWithPassword");loginWithRefreshToken=async A=>{if(!A)return"firebase_no_credentials";let t=new URLSearchParams;t.append("grant_type","refresh_token"),t.append("refresh_token",A);let e,i;try{e=await(await y.fetch(`https://securetoken.googleapis.com/v1/token?key=${K}`,{method:"POST",body:t,headers:{...tA,"content-type":"application/x-www-form-urlencoded"},proxy:this.proxy})).json(),i=e.id_token}catch(g){return g.code==="auth/network-request-failed"?(this.suppressErrors||console.error("loginWithRefreshToken: Network req failed (auth/network-request-failed)"),"firebase_network_failed"):g.code==="auth/missing-email"?"firebase_no_credentials":(this.suppressErrors||console.error("loginWithRefreshToken: Error:",g,A),"firebase_unknown_error")}if(!i)return this.suppressErrors||console.error("loginWithRefreshToken: the game sent no idToken",e),"firebase_no_token";this.idToken=i;let I=await this.queryServices({cmd:"auth",firebaseToken:i});return typeof I=="object"?{firebase:e,...I}:I};loginAnonymously=async()=>{let t=await(await y.fetch("https://identitytoolkit.googleapis.com/v1/accounts:signUp?key="+K,{method:"POST",body:JSON.stringify({returnSecureToken:!0}),headers:{...tA,"content-type":"application/json"},proxy:this.proxy})).json(),e=t.idToken;if(!e)return this.suppressErrors||console.error("loginAnonymously: the game sent no idToken",t),"firebase_no_token";this.idToken=e;let i=await this.queryServices({cmd:"auth",firebaseToken:e});return typeof i=="object"?{firebase:t,...i}:i};sendEmailVerification=async(A=this.idToken)=>{if(!A)return"no_idtoken_passed";let e=await(await y.fetch("https://identitytoolkit.googleapis.com/v1/accounts:sendOobCode?key="+K,{method:"POST",body:JSON.stringify({requestType:"VERIFY_EMAIL",idToken:A}),headers:{...tA,"content-type":"application/json"},proxy:this.proxy})).json();return e.kind!=="identitytoolkit#GetOobConfirmationCodeResponse"?(this.suppressErrors||console.error("sendEmailVerification: the game sent an invalid response",e),"firebase_invalid_response"):{email:e.email}};verifyOobCode=async A=>{if(!A)return"no_oob_code_passed";let e=await(await y.fetch("https://www.googleapis.com/identitytoolkit/v3/relyingparty/setAccountInfo?key="+K,{method:"POST",body:JSON.stringify({oobCode:A}),headers:{...tA,"x-client-version":"Chrome/JsCore/3.7.5/FirebaseCore-web",referer:"https://shellshockio-181719.firebaseapp.com/","content-type":"application/json"},proxy:this.proxy})).json();return e.emailVerified?e.email:(this.suppressErrors||console.error("verifyOobCode: the game sent an invalid response",e),"firebase_invalid_response")}},EA=CA;var KA=class{static buffer;static idx;static init(A){this.buffer=new Uint8Array(A),this.idx=0}static isMoreDataAvailable(){return Math.max(0,this.buffer.length-this.idx)}static unPackInt8U(){let A=this.idx;return this.idx++,this.buffer[A]}static unPackInt8(){return(this.unPackInt8U()+128)%256-128}static unPackInt16U(){let A=this.idx;return this.idx+=2,this.buffer[A]+this.buffer[A+1]*256}static unPackInt24U(){let A=this.idx;return this.idx+=3,this.buffer[A]+this.buffer[A+1]*256+this.buffer[A+2]*65536}static unPackInt32U(){let A=this.idx;return this.idx+=4,this.buffer[A]+this.buffer[A+1]*256+this.buffer[A+2]*65536+this.buffer[A+3]*16777216}static unPackInt16(){return(this.unPackInt16U()+32768)%65536-32768}static unPackInt32(){return(this.unPackInt32U()+2147483648)%4294967296-2147483648}static unPackRadU(){return this.unPackInt24U()/2097152}static unPackRad(){return this.unPackInt16U()/8192-Math.PI}static unPackFloat(){return this.unPackInt16()/256}static unPackDouble(){return this.unPackInt32()/1048576}static unPackString(A){A=A||255;let t=Math.min(this.unPackInt8U(),A);return this.unPackStringHelper(t)}static unPackLongString(A){A=A||16383;let t=Math.min(this.unPackInt16U(),A);return this.unPackStringHelper(t)}static unPackStringHelper(A){if(this.isMoreDataAvailable()<A)return 0;let e="";for(let i=0;i<A;i++){let I=this.unPackInt16U();I>0&&(e+=String.fromCodePoint(I))}return e}},s=KA;var bA=class{constructor(A=16384){this.idx=0,this.arrayBuffer=new ArrayBuffer(A),this.buffer=new Uint8Array(this.arrayBuffer,0,A)}send(A){let t=new Uint8Array(this.arrayBuffer,0,this.idx);A.send(t)}packInt8(A){this.buffer[this.idx]=A&255,this.idx++}packInt16(A){this.buffer[this.idx]=A&255,this.buffer[this.idx+1]=A>>8&255,this.idx+=2}packInt24(A){this.buffer[this.idx]=A&255,this.buffer[this.idx+1]=A>>8&255,this.buffer[this.idx+2]=A>>16&255,this.idx+=3}packInt32(A){this.buffer[this.idx]=A&255,this.buffer[this.idx+1]=A>>8&255,this.buffer[this.idx+2]=A>>16&255,this.buffer[this.idx+3]=A>>24&255,this.idx+=4}packRadU(A){this.packInt24(A*2097152)}packRad(A){this.packInt16((A+Math.PI)*8192)}packFloat(A){this.packInt16(A*256)}packDouble(A){this.packInt32(A*1048576)}packString(A){typeof A!="string"&&(A=""),this.packInt8(A.length);for(let t=0;t<A.length;t++)this.packInt16(A.charCodeAt(t))}packLongString(A){typeof A!="string"&&(A=""),this.packInt16(A.length);for(let t=0;t<A.length;t++)this.packInt16(A.charCodeAt(t))}},h=bA;var Fe={gameNotFound:4e3,gameFull:4001,badName:4002,mainMenu:4003,gameIdleExceeded:4004,corruptedLoginData0:4005,corruptedLoginData1:4006,corruptedLoginData2:4007,corruptedLoginData3:4008,corruptedLoginData4:4009,corruptedLoginData5:4010,gameMaxPlayersExceeded:4011,gameDestroyUser:4012,joinGameOutOfOrder:4013,gameShuttingDown:4014,readyBeforeReady:4015,booted:4016,gameErrorOnUserSocket:4017,uuidNotFound:4018,sessionNotFound:4019,clusterFullCpu:4020,clusterFullMem:4021,noClustersAvailable:4022,locked:4023},cA=Fe;var Re={},E=Re;var Ue=Object.fromEntries(Object.entries(JA).map(([B,A])=>[A,B.toLowerCase()])),rA=class{constructor(A,t=null){this.id=A.id,this.uniqueId=A.uniqueId,this.name=A.name,this.safeName=A.safeName,this.team=A.team,this.playing=A.playing,this.socials=A.social&&JSON.parse(A.social),this.socials&&this.socials.forEach(e=>e.type=Ue[e.id]),this.isVip=A.upgradeProductId>0,this.showBadge=!A.hideBadge||!1,this.streak=A.score,this.streakRewards=Object.values(p).filter(e=>A.activeShellStreaks&e),this.scale=this.streakRewards.includes(p.MiniEgg)?.5:1,this.position={x:A.x,y:A.y,z:A.z},this.jumping=A.$controlKeys&D.Jump,this.scoping=A.$controlKeys&D.Scope,this.climbing=!1,this.view={yaw:A.yaw,pitch:A.pitch},this.updateKotcZone(t),this.character={eggColor:A.shellColor,primaryGun:A.primaryWeaponItem,secondaryGun:A.secondaryWeaponItem,stamp:A.stampItem,hat:A.hatItem,grenade:A.grenadeItem,melee:A.meleeItem,stampPos:{x:A.stampPosX,y:A.stampPosY}},this.stats={totalKills:A.totalKills,totalDeaths:A.totalDeaths,bestStreak:A.bestStreak},this.activeGun=A.weaponIdx,this.selectedGun=A.charClass,this.weapons=[],this.character.primaryGun&&(this.weapons[0]=new b[this.selectedGun],this.weapons[1]=new MA),this.grenades=1,this.hp=A.hp,this.hpShield=0,this.spawnShield=A.shield,this.randomSeed=0}updateKotcZone(A){if(!A)return this.inKotcZone=!1;let t=Math.floor(this.position.x),e=Math.floor(this.position.y),i=Math.floor(this.position.z);this.inKotcZone=A.some(I=>I.x===t&&I.y===e&&I.z===i)&&this.playing}},hA=rA;var P=(B,A,t)=>(A>>>=0,new TextDecoder().decode(new Uint8Array(B.memory.buffer).subarray(A,A+t))),v=(B,A)=>{let t=new TextEncoder().encode(A),e=B.__wbindgen_malloc(t.length,1)>>>0;return new Uint8Array(B.memory.buffer).subarray(e,e+t.length).set(t),[e,t.length]},eA=(B,A)=>{let t=B.__externref_table_alloc();return B.__wbindgen_export_2.set(t,A),t};var Le=`
|
|
22
|
+
`,w);if(k===-1)break;let U=r.slice(w,k).trim(),J=parseInt(U,16);if(J===0)break;w=k+2,d.push(r.slice(w,w+J)),w+=J+2}c=d.join("")}o({json:()=>JSON.parse(c),text:()=>c})})},Qe=(B,{method:A="GET",proxy:t,headers:e={},body:i=null}={})=>new Promise((I,g)=>{let{hostname:o,port:n,pathname:C,protocol:Q,search:a}=new URL(B),c=Q==="https:",r=n?parseInt(n):c?443:80,d=o,w=C+a,k=ae(t);if(!k)return ct.lookup(d,(H,M)=>{if(H)throw H;let S=(c?ht.connect:rt.connect)(r,M,c?{servername:d}:void 0,()=>{DA(S,{method:A,pathname:w,destHost:d,destPort:r,headers:e,body:i},I)});S.on("error",F=>{throw F})});let{host:U,port:J,user:m,pass:T,remoteResolve:X}=k,Ct=H=>{let M=rt.connect(J,U,()=>{m&&T?M.write(Buffer.from([5,1,2])):M.write(Buffer.from([5,1,0]))}),uA=()=>{let F;if(X){let R=Buffer.from(d);F=Buffer.concat([Buffer.from([5,1,0,3,R.length]),R,Buffer.from([r>>8&255,r&255])])}else{let R=Buffer.from(H.split(".").map(Number));F=Buffer.concat([Buffer.from([5,1,0,1]),R,Buffer.from([r>>8&255,r&255])])}M.write(F)},S=0;M.on("data",F=>{if(S===0)if(m&&T){if(F[1]!==2)return g("You tried to add authencation to a proxy that does not support username/password.");let R=Buffer.from(m),Et=Buffer.from(T),Be=Buffer.concat([Buffer.from([1,R.length]),R,Buffer.from([Et.length]),Et]);M.write(Be),S=.5}else{if(F[1]!==0)return g("You tried to use a proxy that requires authentication. Add authentication to your proxy URL.");S=1,uA()}else if(S===.5){if(F[1]!==0)return g("Your input proxy username/password was incorrect.");S=1,uA()}else if(S===1){if(F[1]!==0)return g("SOCKS5 proxy connection failed :(");if(c){let R=ht.connect({socket:M,servername:d},()=>{DA(R,{method:A,pathname:w,destHost:d,destPort:r,headers:e,body:i},I)});R.on("error",g)}else DA(M,{method:A,pathname:w,destHost:d,destPort:r,headers:e,body:i},I);S=2}}),M.on("error",g)};X?Ct():ct.lookup(d,(H,M)=>{if(H)return g(H);Ct(M)})}),dt=Qe;var _={},V=typeof window<"u"&&typeof HTMLElement<"u",BA=typeof WebSocketPair<"u"&&typeof Cloudflare<"u",ye=typeof process<"u"&&process.moduleLoadList?.length>0,ue=typeof Deno<"u"&&typeof navigator<"u"&&navigator.userAgent?.startsWith("Deno/"),De=typeof Bun<"u"&&typeof navigator<"u"&&navigator.userAgent?.startsWith("Bun/");if(!V&&!BA&&!ye&&!ue&&!De)throw new Error("yolkbot doesn't know how to run in this environment. Please open an issue on GitHub with information on where you run yolkbot.");_.isBrowser=V;_.isIsolated=V||BA;_.fetch=V||BA?globalThis.fetch:dt;_.WebSocket=V||BA?globalThis.WebSocket:(await Promise.resolve().then(()=>(pt(),mt))).WWWebSocket;var y=_;var ut={};IA(ut,{BanDuration:()=>UA,ChallengeSubType:()=>ke,ChallengeType:()=>fe,ChatFlag:()=>Ne,ChiknWinnerDailyLimit:()=>LA,CollectType:()=>oA,CoopState:()=>nA,FirebaseKey:()=>K,FramesBetweenSyncs:()=>q,GameAction:()=>aA,GameMode:()=>u,GameOptionFlag:()=>YA,GunEquipTime:()=>xA,GunList:()=>b,ItemType:()=>x,Movement:()=>D,PlayType:()=>QA,ShellStreak:()=>p,SocialMedia:()=>JA,SocialReward:()=>Me,StateBufferSize:()=>$,Team:()=>Ge,URLRewards:()=>Se,UserAgent:()=>AA,findItemById:()=>l});var yt={};IA(yt,{AUG:()=>RA,CSG1:()=>NA,Cluck9mm:()=>MA,DozenGauge:()=>fA,Eggk47:()=>kA,M24:()=>FA,RPEGG:()=>GA,SMG:()=>SA});var Y=class{constructor(){this.adsMod=.5,this.burst=0,this.burstRof=0,this.movementAccuracyMod=1,this.radius=0,this.reloadBloom=!0,this.reloadTimeMod=1,this.tracer=0}},kA=class extends Y{constructor(){super(),this.ammo={rounds:30,capacity:30,reload:30,store:240,storeMax:240,pickup:30},this.longReloadTime=205,this.shortReloadTime=160,this.weaponName="EggK-47",this.internalName="Eggk47",this.standardMeshName="eggk47",this.automatic=!0,this.damage=30,this.range=20,this.recoil=7,this.rof=3,this.totalDamage=30,this.velocity=1.5,this.accuracyMin=.15,this.accuracyMax=.03,this.accuracyLoss=.05,this.accuracyRecover=.025,this.tracer=1}},fA=class extends Y{constructor(){super(),this.ammo={rounds:2,capacity:2,reload:2,store:24,storeMax:24,pickup:8},this.longReloadTime=155,this.shortReloadTime=155,this.weaponName="Scrambler",this.internalName="Dozen Gauge",this.standardMeshName="dozenGauge",this.automatic=!1,this.damage=8.5,this.range=8,this.recoil=10,this.rof=8,this.totalDamage=170,this.velocity=1,this.accuracyMin=.16,this.accuracyMax=.13,this.accuracyLoss=.17,this.accuracyRecover=.02,this.adsMod=.6,this.movementAccuracyMod=.2,this.tracer=0}},NA=class extends Y{constructor(){super(),this.ammo={rounds:15,capacity:15,reload:15,store:60,storeMax:60,pickup:15},this.longReloadTime=225,this.shortReloadTime=165,this.weaponName="Free Ranger",this.internalName="CSG-1",this.standardMeshName="csg1",this.automatic=!1,this.damage=105,this.range=50,this.recoil=13,this.rof=13,this.totalDamage=105,this.velocity=1.75,this.accuracyMin=.3,this.accuracyMax=.004,this.accuracyLoss=.3,this.accuracyRecover=.025,this.tracer=0}},MA=class extends Y{constructor(){super(),this.ammo={rounds:15,capacity:15,reload:15,store:60,storeMax:60,pickup:15},this.longReloadTime=195,this.shortReloadTime=160,this.weaponName="Cluck 9mm",this.internalName="Cluck 9mm",this.standardMeshName="cluck9mm",this.automatic=!1,this.damage=26,this.range=15,this.recoil=6,this.rof=4,this.totalDamage=26,this.velocity=1,this.accuracyMin=.15,this.accuracyMax=.035,this.accuracyLoss=.09,this.accuracyRecover=.08,this.adsMod=.8,this.movementAccuracyMod=.6,this.tracer=0}},GA=class extends Y{constructor(){super(),this.ammo={rounds:1,capacity:1,reload:1,store:3,storeMax:3,pickup:1},this.longReloadTime=170,this.shortReloadTime=170,this.weaponName="RPEGG",this.internalName="Eggsploder",this.standardMeshName="rpegg",this.automatic=!1,this.damage=140,this.range=45,this.recoil=60,this.rof=40,this.totalDamage=192.5,this.velocity=.4,this.accuracyMin=.3,this.accuracyMax=.015,this.accuracyLoss=.3,this.accuracyRecover=.02,this.radius=2.75}},SA=class extends Y{constructor(){super(),this.ammo={rounds:40,capacity:40,reload:40,store:200,storeMax:200,pickup:40},this.longReloadTime=225,this.shortReloadTime=190,this.weaponName="Whipper",this.internalName="SMEGG",this.standardMeshName="smg",this.automatic=!0,this.damage=23,this.range=20,this.recoil=7,this.rof=2,this.totalDamage=23,this.velocity=1.25,this.accuracyMin=.19,this.accuracyMax=.06,this.accuracyLoss=.045,this.accuracyRecover=.05,this.adsMod=.6,this.movementAccuracyMod=.7,this.tracer=2}},FA=class extends Y{constructor(){super(),this.ammo={rounds:1,capacity:1,reload:1,store:12,storeMax:12,pickup:4},this.longReloadTime=144,this.shortReloadTime=144,this.weaponName="Crackshot",this.internalName="M2DZ",this.standardMeshName="m24",this.automatic=!0,this.damage=170,this.range=60,this.recoil=20,this.rof=15,this.totalDamage=170,this.velocity=2,this.accuracyMin=.35,this.accuracyMax=0,this.accuracyLoss=.1,this.accuracyRecover=.023,this.movementAccuracyMod=1.3,this.reloadBloom=!1,this.reloadTimeMod=.8,this.tracer=0}},RA=class extends Y{constructor(){super(),this.ammo={rounds:24,capacity:24,reload:24,store:150,storeMax:150,pickup:24},this.longReloadTime=205,this.shortReloadTime=160,this.weaponName="Tri-Hard",this.internalName="AUG",this.standardMeshName="aug",this.automatic=!1,this.damage=32,this.range=20,this.recoil=18,this.rof=15,this.totalDamage=34,this.velocity=1.5,this.accuracyMin=.15,this.accuracyMax=.03,this.accuracyLoss=.037,this.accuracyRecover=.03,this.adsMod=.6,this.burst=3,this.burstRof=3,this.movementAccuracyMod=.8,this.movementInstability=2,this.tracer=0}};var l=()=>null;var UA={FiveMinutes:0,FifteenMinutes:1,OneHour:2},ke={Killstreak:0,KillWithWeapon:1,MovementDistance:3,Jumping:4,TimePlayed:6,TimeAlive:7,KillWithCondition:8,TotalKills:10,SpatulaKills:10,Collecting:18,FromTheCoop:20,SpecialOffensive:21,WinKOTC:23,KillWithSpatula:23},fe={Kill:0,Damage:1,Death:2,Movement:3,Collect:4,Time:5,KOTC:6,Spatula:7},Ne={None:0,Pinned:2,Team:4,Mod:254,Server:255},LA=3,oA={Ammo:0,Grenade:1},nA={Start:0,Score:1,Win:2,Capturing:3,Contested:4,Takeover:5,Abandoned:6,Unclaimed:7},K="AIzaSyDP4SIjKaw6A4c-zvfYxICpbEjn1rRnN50",q=3,aA={Reset:1,Pause:2},u={FFA:0,Team:1,Spatula:2,KOTC:3},YA={Locked:1,NoTeamChange:2,NoTeamShuffle:4},xA=13,b=[kA,fA,NA,GA,SA,FA,RA],x={Hat:1,Stamp:2,Primary:3,Secondary:4,Grenade:6,Melee:7},D={Forward:1,Backward:2,Left:4,Right:8,Jump:16,Fire:32,Melee:64,Scope:128},QA={JoinPublic:0,CreatePrivate:1,JoinPrivate:2},p={HardBoiled:1,EggBreaker:2,Restock:4,OverHeal:8,DoubleEggs:16,MiniEgg:32},JA={Facebook:0,Instagram:1,Tiktok:2,Discord:3,Youtube:4,Twitter:5,Twitch:6},Me={Discord:"rew_1200",Tiktok:"rew_1208",Instagram:"rew_1219",Steam:"rew_1223",Facebook:"rew_1227",Twitter:"rew_1234",Twitch:"rew_twitch_social"},$=256,Ge={Blue:1,Red:2},Se=["giveBasketBrosReward","mercZoneFinalGift","midMonthGiveMeEggs","newYolkerSignupReward","newYolkerItemReward","newYolkerWelcomeBack","WelcomeBack"],AA=y.isBrowser?null:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36";var HA=class{url="";proxy="";binaryType="";maxRetries=5;connectionTimeout=5e3;constructor(A,t){this.url=A,y.isBrowser&&t&&(console.error("You cannot pass a proxy to a yolkws inside of a browser."),process.exit(1)),this.proxy=t}async tryConnect(A=1){let t=new URL(this.url),e=async()=>A===5?!1:await this.tryConnect(A+1);try{this.socket=y.isBrowser?new y.WebSocket(this.url):new y.WebSocket(this.url,{proxy:this.proxy||void 0,headers:{"accept-encoding":"gzip, deflate, br, zstd","accept-language":"en-US,en;q=0.9","cache-control":"no-cache",connection:"Upgrade",origin:t.origin.replace("ws","http"),pragma:"no-cache","sec-websocket-extensions":"permessage-deflate; client_max_window_bits","user-agent":AA}}),this.binaryType&&(this.socket.binaryType=this.binaryType)}catch(i){return console.error(`Failed to connect on try ${A}, trying again...`,i),await e()}return this.onBeforeConnect&&this.onBeforeConnect(),new Promise(i=>{let I=setTimeout(async()=>{this.socket.close(),i(await e())},this.connectionTimeout),g=async o=>{clearTimeout(I),console.error("WebSocket error",o),i(await e())};this.socket.addEventListener("open",async()=>{clearTimeout(I),this.socket.removeEventListener("error",g),i(!0)}),this.socket.addEventListener("error",g)})}get onmessage(){return this.socket?.onmessage}set onmessage(A){this.socket?this.socket.onmessage=A:console.error("set onmessage before socket existed")}get onclose(){return this.socket?.onclose}set onclose(A){this.socket?this.socket.onclose=A:console.error("set onclose before socket existed")}get onerror(){return this.socket?.onerror}set onerror(A){this.socket?this.socket.onerror=A:console.error("set onclose before socket existed")}send(A){return this.socket?.send(A)}close(A){return this.socket?.close(A)}},z=HA;var tA={origin:"https://shellshock.io","user-agent":AA,"x-client-version":"Chrome/JsCore/9.17.2/FirebaseCore-web","x-firebase-locale":"en"},CA=class{constructor(A={}){this.proxy=A.proxy,this.instance=A.instance||"shellshock.io",this.protocol=A.protocol||"wss",this.maxRetries=A.maxRetries||5,this.suppressErrors=A.suppressErrors||!1,this.connectionTimeout=A.connectionTimeout||5e3}queryServices=async A=>{let t=new z(`${this.protocol}://${this.instance}/services/`,this.proxy);return t.connectionTimeout=this.connectionTimeout,!await t.tryConnect(-2)||t.socket.readyState<1?"websocket_connect_fail":new Promise(i=>{let I=!1;t.onmessage=g=>{I=!0;try{let o=JSON.parse(g.data);i(o)}catch{this.suppressErrors||(console.error("queryServices: Bad API JSON response with call: "+A.cmd+" and data:",JSON.stringify(A)),console.error("queryServices: Full data sent: ",JSON.stringify(A))),i("bad_json")}t.close()},t.onerror=()=>!I&&i("unknown_socket_error"),t.onclose=()=>!I&&i("services_closed_early"),t.send(JSON.stringify(A))})};#A=async(A,t,e)=>{if(!A||!t)return"firebase_no_credentials";let i,I;try{i=await(await y.fetch(`https://identitytoolkit.googleapis.com/v1/accounts:${e}?key=${K}`,{method:"POST",body:JSON.stringify({email:A,password:t,returnSecureToken:!0}),headers:{...tA,"content-type":"application/json"},proxy:this.proxy})).json(),I=i.idToken}catch(o){return o.code==="auth/network-request-failed"?(this.suppressErrors||console.error("loginWithCredentials: Network req failed (auth/network-request-failed)"),"firebase_network_failed"):o.code==="auth/missing-email"?"firebase_no_credentials":o.code==="ERR_BAD_REQUEST"?(this.suppressErrors||console.error("loginWithCredentials: Error:",A,t),this.suppressErrors||console.error("loginWithCredentials: Error:",i||o),"firebase_bad_request"):(this.suppressErrors||console.error("loginWithCredentials: Error:",A,t,o),"firebase_unknown_error")}if(!I)return this.suppressErrors||console.error("loginWithCredentials: the game sent no idToken",i),"firebase_no_token";this.idToken=I;let g=await this.queryServices({cmd:"auth",firebaseToken:I});return typeof g=="object"?{firebase:i,...g}:g};createAccount=async(A,t)=>await this.#A(A,t,"signUp");loginWithCredentials=async(A,t)=>await this.#A(A,t,"signInWithPassword");loginWithRefreshToken=async A=>{if(!A)return"firebase_no_credentials";let t=new URLSearchParams;t.append("grant_type","refresh_token"),t.append("refresh_token",A);let e,i;try{e=await(await y.fetch(`https://securetoken.googleapis.com/v1/token?key=${K}`,{method:"POST",body:t,headers:{...tA,"content-type":"application/x-www-form-urlencoded"},proxy:this.proxy})).json(),i=e.id_token}catch(g){return g.code==="auth/network-request-failed"?(this.suppressErrors||console.error("loginWithRefreshToken: Network req failed (auth/network-request-failed)"),"firebase_network_failed"):g.code==="auth/missing-email"?"firebase_no_credentials":(this.suppressErrors||console.error("loginWithRefreshToken: Error:",g,A),"firebase_unknown_error")}if(!i)return this.suppressErrors||console.error("loginWithRefreshToken: the game sent no idToken",e),"firebase_no_token";this.idToken=i;let I=await this.queryServices({cmd:"auth",firebaseToken:i});return typeof I=="object"?{firebase:e,...I}:I};loginAnonymously=async()=>{let t=await(await y.fetch("https://identitytoolkit.googleapis.com/v1/accounts:signUp?key="+K,{method:"POST",body:JSON.stringify({returnSecureToken:!0}),headers:{...tA,"content-type":"application/json"},proxy:this.proxy})).json(),e=t.idToken;if(!e)return this.suppressErrors||console.error("loginAnonymously: the game sent no idToken",t),"firebase_no_token";this.idToken=e;let i=await this.queryServices({cmd:"auth",firebaseToken:e});return typeof i=="object"?{firebase:t,...i}:i};sendEmailVerification=async(A=this.idToken)=>{if(!A)return"no_idtoken_passed";let e=await(await y.fetch("https://identitytoolkit.googleapis.com/v1/accounts:sendOobCode?key="+K,{method:"POST",body:JSON.stringify({requestType:"VERIFY_EMAIL",idToken:A}),headers:{...tA,"content-type":"application/json"},proxy:this.proxy})).json();return e.kind!=="identitytoolkit#GetOobConfirmationCodeResponse"?(this.suppressErrors||console.error("sendEmailVerification: the game sent an invalid response",e),"firebase_invalid_response"):{email:e.email}};verifyOobCode=async A=>{if(!A)return"no_oob_code_passed";let e=await(await y.fetch("https://www.googleapis.com/identitytoolkit/v3/relyingparty/setAccountInfo?key="+K,{method:"POST",body:JSON.stringify({oobCode:A}),headers:{...tA,"x-client-version":"Chrome/JsCore/3.7.5/FirebaseCore-web",referer:"https://shellshockio-181719.firebaseapp.com/","content-type":"application/json"},proxy:this.proxy})).json();return e.emailVerified?e.email:(this.suppressErrors||console.error("verifyOobCode: the game sent an invalid response",e),"firebase_invalid_response")}},EA=CA;var KA=class{static buffer;static idx;static init(A){this.buffer=new Uint8Array(A),this.idx=0}static isMoreDataAvailable(){return Math.max(0,this.buffer.length-this.idx)}static unPackInt8U(){let A=this.idx;return this.idx++,this.buffer[A]}static unPackInt8(){return(this.unPackInt8U()+128)%256-128}static unPackInt16U(){let A=this.idx;return this.idx+=2,this.buffer[A]+this.buffer[A+1]*256}static unPackInt24U(){let A=this.idx;return this.idx+=3,this.buffer[A]+this.buffer[A+1]*256+this.buffer[A+2]*65536}static unPackInt32U(){let A=this.idx;return this.idx+=4,this.buffer[A]+this.buffer[A+1]*256+this.buffer[A+2]*65536+this.buffer[A+3]*16777216}static unPackInt16(){return(this.unPackInt16U()+32768)%65536-32768}static unPackInt32(){return(this.unPackInt32U()+2147483648)%4294967296-2147483648}static unPackRadU(){return this.unPackInt24U()/2097152}static unPackRad(){return this.unPackInt16U()/8192-Math.PI}static unPackFloat(){return this.unPackInt16()/256}static unPackDouble(){return this.unPackInt32()/1048576}static unPackString(A){A=A||255;let t=Math.min(this.unPackInt8U(),A);return this.unPackStringHelper(t)}static unPackLongString(A){A=A||16383;let t=Math.min(this.unPackInt16U(),A);return this.unPackStringHelper(t)}static unPackStringHelper(A){if(this.isMoreDataAvailable()<A)return 0;let e="";for(let i=0;i<A;i++){let I=this.unPackInt16U();I>0&&(e+=String.fromCodePoint(I))}return e}},s=KA;var bA=class{constructor(A=16384){this.idx=0,this.arrayBuffer=new ArrayBuffer(A),this.buffer=new Uint8Array(this.arrayBuffer,0,A)}send(A){let t=new Uint8Array(this.arrayBuffer,0,this.idx);A.send(t)}packInt8(A){this.buffer[this.idx]=A&255,this.idx++}packInt16(A){this.buffer[this.idx]=A&255,this.buffer[this.idx+1]=A>>8&255,this.idx+=2}packInt24(A){this.buffer[this.idx]=A&255,this.buffer[this.idx+1]=A>>8&255,this.buffer[this.idx+2]=A>>16&255,this.idx+=3}packInt32(A){this.buffer[this.idx]=A&255,this.buffer[this.idx+1]=A>>8&255,this.buffer[this.idx+2]=A>>16&255,this.buffer[this.idx+3]=A>>24&255,this.idx+=4}packRadU(A){this.packInt24(A*2097152)}packRad(A){this.packInt16((A+Math.PI)*8192)}packFloat(A){this.packInt16(A*256)}packDouble(A){this.packInt32(A*1048576)}packString(A){typeof A!="string"&&(A=""),this.packInt8(A.length);for(let t=0;t<A.length;t++)this.packInt16(A.charCodeAt(t))}packLongString(A){typeof A!="string"&&(A=""),this.packInt16(A.length);for(let t=0;t<A.length;t++)this.packInt16(A.charCodeAt(t))}},h=bA;var Fe={gameNotFound:4e3,gameFull:4001,badName:4002,mainMenu:4003,gameIdleExceeded:4004,corruptedLoginData0:4005,corruptedLoginData1:4006,corruptedLoginData2:4007,corruptedLoginData3:4008,corruptedLoginData4:4009,corruptedLoginData5:4010,gameMaxPlayersExceeded:4011,gameDestroyUser:4012,joinGameOutOfOrder:4013,gameShuttingDown:4014,readyBeforeReady:4015,booted:4016,gameErrorOnUserSocket:4017,uuidNotFound:4018,sessionNotFound:4019,clusterFullCpu:4020,clusterFullMem:4021,noClustersAvailable:4022,locked:4023},cA=Fe;var Re={},E=Re;var Ue=Object.fromEntries(Object.entries(JA).map(([B,A])=>[A,B.toLowerCase()])),rA=class{constructor(A,t=null){this.id=A.id,this.uniqueId=A.uniqueId,this.name=A.name,this.safeName=A.safeName,this.team=A.team,this.playing=A.playing,this.socials=A.social&&JSON.parse(A.social),this.socials&&this.socials.forEach(e=>e.type=Ue[e.id]),this.isVip=A.upgradeProductId>0,this.showBadge=!A.hideBadge||!1,this.streak=A.score,this.streakRewards=Object.values(p).filter(e=>A.activeShellStreaks&e),this.scale=this.streakRewards.includes(p.MiniEgg)?.5:1,this.position={x:A.x,y:A.y,z:A.z},this.jumping=A.$controlKeys&D.Jump,this.scoping=A.$controlKeys&D.Scope,this.climbing=!1,this.view={yaw:A.yaw,pitch:A.pitch},this.updateKotcZone(t),this.character={eggColor:A.shellColor,primaryGun:A.primaryWeaponItem,secondaryGun:A.secondaryWeaponItem,stamp:A.stampItem,hat:A.hatItem,grenade:A.grenadeItem,melee:A.meleeItem,stampPos:{x:A.stampPosX,y:A.stampPosY}},this.stats={totalKills:A.totalKills,totalDeaths:A.totalDeaths,bestStreak:A.bestStreak},this.activeGun=A.weaponIdx,this.selectedGun=A.charClass,this.weapons=[],this.character.primaryGun&&(this.weapons[0]=new b[this.selectedGun],this.weapons[1]=new MA),this.grenades=1,this.hp=A.hp,this.hpShield=0,this.spawnShield=A.shield,this.randomSeed=0}updateKotcZone(A){if(!A)return this.inKotcZone=!1;let t=Math.floor(this.position.x),e=Math.floor(this.position.y),i=Math.floor(this.position.z);this.inKotcZone=A.some(I=>I.x===t&&I.y===e&&I.z===i)&&this.playing}},hA=rA;var P=(B,A,t)=>(A>>>=0,new TextDecoder().decode(new Uint8Array(B.memory.buffer).subarray(A,A+t))),v=(B,A)=>{let t=new TextEncoder().encode(A),e=B.__wbindgen_malloc(t.length,1)>>>0;return new Uint8Array(B.memory.buffer).subarray(e,e+t.length).set(t),[e,t.length]},eA=(B,A)=>{let t=B.__externref_table_alloc();return B.__wbindgen_export_2.set(t,A),t};var Le=`
|
|
23
23
|
var comp_spinner_overlay = {
|
|
24
24
|
template: '#spinner-overlay-template',
|
|
25
25
|
components: {
|